Skip to content

Memory Allocation for Hardware

pedwo edited this page Mar 4, 2011 · 6 revisions

Memory Allocation for Hardware

The multimedia libraries (libshcodecs, libshveu, libshbeu) and the SH multimedia plugins use User IO to access hardware registers and for memory used by the hardware IP blocks. The hardware IP blocks requires a special memory allocator as the memory must be physically contiguous.

The kernel Video For Linux (v4l2) interface is used for camera capture (CEU). For the best performance, the v4l2 USERPTR interface should be used so that captured frame buffers can be passed to other SH hardware IP blocks such as the VEU scaler.

UIO memory is managed by UIOMux; however the amount of memory available is specified to the kernel on the command line in the form ‘memchunk.device=size’. If nothing is specified, relatively small defaults are used.

The following table provides a guide to the amount of UIO memory required to use the SH GStreamer plugins to perform common operations.

Resolution Camera capture Video Decode & Encode
memchunk.veu0= memchunk.vpu=
QVGA (320×240) 1m 1m
VGA (640×480) 2m 3m
D1 (720×480) Not supported 3m
SVGA (800×600) 2m 5m
720p (1280×720) 4m 8m

Note: The exception to UIOMux managed memory is DirectFB, which requires a block of memory to be reserved for its exclusive use. See DirectFB on SH772x

Note: The maximum amount of memory that can be allocated to a single device is controlled by the kernel option CONFIG_FORCE_MAX_ZONEORDER. When set to 12, the maximum is 8MB; 13 gives 16MB, etc. To change this setting, the option is under System type → Memory management options → Maximum zone order. To get Buildroot to modify your kernel settings you can use “make linux26-menuconfig”

Clone this wiki locally