8. tizen.org8
Tizen Kernel MM, Graphics (DRM)
Kernel / Device Drivers (BSP)
Kernel / Core & Subsystem
X Server
DRM Framework
GEM
Display HDMI
Virtual
Display
Post
Processor
G2D
EFL
Evas
2D GPU
backend
X Video Drivers
Userptr
NEON
2D GPU
backend
PIXMAN
EXA
V4L2
VB2
Codec Camera
GStreamer
OpenMAX
Libdrm
XV Extension
UMM
Open
GL
Multimedia FW
XvImageSink
Core External
Library
Core
Framework
OEM
Adaptation
Kernel
Kernel
GPU
DDK
(G3D)
Radio
* Images from MS Office clipart and Samsung
Gstreamer-
CameraSrc
DMABUF
9. tizen.org9
Graphics:
DRM/GEM (Graphics Execution Manager)
drm_fb_helperdrm_mode_config
Linux
DRM Common Framework
GEM
drm_framebuffer fb_infoCrtc
Connector
Encoder
GEM
Allocator
Plane
Common
Specific
drm_framebufferCrtc
Connector
Encoder
Plane
10. tizen.org10
Graphics:
DRM/GEM (Graphics Execution Manager)
drm_fb_helperdrm_mode_config
Linux
DRM Common Framework
GEM
drm_framebuffer fb_infoCrtc
Connector
Encoder
GEM
Allocator
Plane
Common
Specific
drm_framebufferCrtc
Connector
Encoder
Plane
Graphics Execution Manager
⢠Framework developed by Intel
⢠To manage graphics memory
⢠Framework for buffer management.
⢠Allocation and sharing.
11. tizen.org11
Graphics: DRM/GEM Allocation
⢠GEM Allocation steps @ Tizen (Generic)
1. DRM_IOCTL_MODE_CREATE_DUMB
⢠Create GEM object(global) & user GEM handle(per process)
⢠dumb_create() of struct drm_driver
⢠No physical memory allocated.
2. DRM_IOCTL_MODE_MAP_DUMB
⢠Create fake mmap offset of a gem object and relay the object to user
⢠A hash key of the gem object.
⢠dumb_map_offset() of struct drm_driver
3. MMAP
⢠Request mmap based on the hash key as the offset
⢠Create user address space
⢠Setup cache attribute.
⢠Not mapped to physical memory, yet
12. tizen.org12
Graphics: DRM/GEM Allocation
⢠GEM Allocation steps @ Tizen (Generic)
4. On-demand Paging
â Implement & Register a fault handler that
⢠With a page fault, allocate a page and map the page.
â vma->vm_ops->fault = xxx_drm_gem_fault
5. Use!
6. DRM_IOCTL_MODE_DESTROY_DUMB
â Remove GEM handle & object
â Free memory
â Implement dumb_destroy() of struct drm_driver
13. tizen.org13
Graphics: DRM/GEM Allocation
⢠GEM Allocation steps @ Tizen (Exynos Only)
1. DRM_IOCTL_EXYNOS_GEM_CREATE
⢠Only use user-desired size and buffer types.
⢠Create gem object(global) & user gem handle(per process)
⢠physical memory allocated.
2. DRM_IOCTL_EXYNOS_GEM_MMAP
⢠Create user address space
⢠Map the user address space to physical memory
⢠LIBDRM of Exynos uses these APIs, not the generic.
14. tizen.org14
Graphics: DRM/GEM Sharing
⢠GEM Sharing @ Tizen
⢠DRM_IOCTL_GEM_FLINK
â âI will share this GEM to others.â
â Create GEM object name for the given GEM handle
⢠Global key vaue for sharing
⢠DRM_IOCTL_GEM_OPEN
â âI want to use the shared GEM.â
â Create GEM handle based on the given GEM object name
⢠DRM_IOCTL_GEM_CLOSE
⢠You donât need to implement. Itâs already there with DRM.
GEM
Create
GEM
FLINK
GEM
OPEN
gem handle gem object name gem handle
Process 1 Process 2
15. tizen.org15
Tizen Kernel MM, Multimedia (V4L2/VB2)
Kernel / Device Drivers (BSP)
Kernel / Core & Subsystem
X Server
DRM Framework
GEM
Display HDMI
Virtual
Display
Post
Processor
G2D
EFL
Evas
2D GPU
backend
X Video Drivers
Userptr
NEON
2D GPU
backend
PIXMAN
EXA
V4L2
VB2
Codec Camera
GStreamer
OpenMAX
Libdrm
XV Extension
UMM
Open
GL
Multimedia FW
XvImageSink
Core External
Library
Core
Framework
OEM
Adaptation
Kernel
Kernel
GPU
DDK
(G3D)
Radio
* Images from MS Office clipart and Samsung
Gstreamer-
CameraSrc
DMABUF
16. tizen.org16
Multimedia: V4L2/VB2
⢠Tizen recommends to use V4L2 at Tizen kernel for Multimedia
devices
⢠Video input (codec & camera) & Radio
⢠However, as long as the kernel has:
â Gstreamer/OpenMAX plugins
â A method to share with other F/W via DMABUF of UMM,
⢠Tizen multimedia works.
⢠If V4L2/VB2 is used, things get easier.
17. tizen.org17
Tizen Kernel MM, OpenGL/G3D-GPU
Kernel / Device Drivers (BSP)
Kernel / Core & Subsystem
X Server
DRM Framework
GEM
Display HDMI
Virtual
Display
Post
Processor
G2D
EFL
Evas
2D GPU
backend
X Video Drivers
Userptr
NEON
2D GPU
backend
PIXMAN
EXA
V4L2
VB2
Codec Camera
GStreamer
OpenMAX
Libdrm
XV Extension
UMM
Open
GL
Multimedia FW
XvImageSink
Core External
Library
Core
Framework
OEM
Adaptation
Kernel
Kernel
GPU
DDK
(G3D)
Radio
* Images from MS Office clipart and Samsung
Gstreamer-
CameraSrc
DMABUF
18. tizen.org18
OpenGL / G3D-GPU
⢠Most ARM SoC GPUs (MALI, SGX, âŚ) use their own memory
manager
⢠E.g., Exynos4412/4210 Tizen Reference Kernel has Mali w/ UMP.
â Mali DDK modified to be compatible with UMM-DMABUF.
⢠If GPU drivers use DRM, it would be great.
⢠(and make them GPL)
20. tizen.org20
NEED FOR SOMETHING, A Scenario
Kernel / Device Drivers (BSP)
Kernel / Core & Subsystem
X Server
DRM Framework
GEM
Display HDMI
Virtual
Display
Post
Processor
G2D
EFL
Evas
2D GPU
backend
X Video Drivers
Userptr
NEON
2D GPU
backend
PIXMAN
EXA
V4L2
VB2
Codec Camera
GStreamer
OpenMAX
Libdrm
XV Extension
Open
GL
Multimedia FW
XvImageSink
Core External
Library
Core
Framework
OEM
Adaptation
Kernel
Kernel
GPU
DDK
(G3D)
Radio
* Images from MS Office clipart and Samsung
Gstreamer-
CameraSrc
Camera fetches a video stream
This scenario is simplified for presentation.
Not an actual example of Tizen
21. tizen.org21
NEED FOR SOMETHING, A Scenario
Kernel / Device Drivers (BSP)
Kernel / Core & Subsystem
X Server
DRM Framework
GEM
Display HDMI
Virtual
Display
Post
Processor
G2D
EFL
Evas
2D GPU
backend
X Video Drivers
Userptr
NEON
2D GPU
backend
PIXMAN
EXA
V4L2
VB2
Codec Camera
GStreamer
OpenMAX
Libdrm
XV Extension
Open
GL
Multimedia FW
XvImageSink
Core External
Library
Core
Framework
OEM
Adaptation
Kernel
Kernel
GPU
DDK
(G3D)
Radio
* Images from MS Office clipart and Samsung
Gstreamer-
CameraSrc
Camera fetches a video stream
Draws its own images
This scenario is simplified for presentation.
Not an actual example of Tizen
22. tizen.org22
NEED FOR SOMETHING, A Scenario
Kernel / Device Drivers (BSP)
Kernel / Core & Subsystem
X Server
DRM Framework
GEM
Display HDMI
Virtual
Display
Post
Processor
G2D
EFL
Evas
2D GPU
backend
X Video Drivers
Userptr
NEON
2D GPU
backend
PIXMAN
EXA
V4L2
VB2
Codec Camera
GStreamer
OpenMAX
Libdrm
XV Extension
Open
GL
Multimedia FW
XvImageSink
Core External
Library
Core
Framework
OEM
Adaptation
Kernel
Kernel
GPU
DDK
(G3D)
Radio
* Images from MS Office clipart and Samsung
Gstreamer-
CameraSrc
Camera fetches a video stream
Draws its own images
GPU Merges the two
/ Puts the merged image
This scenario is simplified for presentation.
Not an actual example of Tizen
23. tizen.org23
NEED FOR SOMETHING, A Scenario
Kernel / Device Drivers (BSP)
Kernel / Core & Subsystem
X Server
DRM Framework
GEM
Display HDMI
Virtual
Display
Post
Processor
G2D
EFL
Evas
2D GPU
backend
X Video Drivers
Userptr
NEON
2D GPU
backend
PIXMAN
EXA
V4L2
VB2
Codec Camera
GStreamer
OpenMAX
Libdrm
XV Extension
Open
GL
Multimedia FW
XvImageSink
Core External
Library
Core
Framework
OEM
Adaptation
Kernel
Kernel
GPU
DDK
(G3D)
Radio
* Images from MS Office clipart and Samsung
Gstreamer-
CameraSrc
Camera fetches a video stream
Draws its own images
DRM-FIMD(display) Output
This scenario is simplified for presentation.
Not an actual example of Tizen
GPU Merges the two
/ Puts the merged image
24. tizen.org24
NEED FOR SOMETHING, A Scenario
Kernel / Device Drivers (BSP)
Kernel / Core & Subsystem
X Server
DRM Framework
GEM
Display HDMI
Virtual
Display
Post
Processor
G2D
EFL
Evas
2D GPU
backend
X Video Drivers
Userptr
NEON
2D GPU
backend
PIXMAN
EXA
V4L2
VB2
Codec Camera
GStreamer
OpenMAX
Libdrm
XV Extension
Open
GL
Multimedia FW
XvImageSink
Core External
Library
Core
Framework
OEM
Adaptation
Kernel
Kernel
GPU
DDK
(G3D)
Radio
* Images from MS Office clipart and Samsung
Gstreamer-
CameraSrc
Camera fetches a video stream
Draws its own images
DRM-FIMD(display) Output
At a VB2 buffer
At a GEM buffer
GEM buffer
This scenario is simplified for presentation.
Not an actual example of Tizen
GPU Merges the two
/ Puts the merged image
From GEM + VB2 into its own (e.g., UMP)
25. tizen.org25
Tizen Kernel MM, UMM
Kernel / Device Drivers (BSP)
Kernel / Core & Subsystem
X Server
DRM Framework
GEM
Display HDMI
Virtual
Display
Post
Processor
G2D
EFL
Evas
2D GPU
backend
X Video Drivers
Userptr
NEON
2D GPU
backend
PIXMAN
EXA
V4L2
VB2
Codec Camera
GStreamer
OpenMAX
Libdrm
XV Extension
UMM
Open
GL
Multimedia FW
XvImageSink
Core External
Library
Core
Framework
OEM
Adaptation
Kernel
Kernel
GPU
DDK
(G3D)
Radio
* Images from MS Office clipart and Samsung
Gstreamer-
CameraSrc
DMABUF
A mechanism to share between
DRM, V4L2, and others
w/o memcpy
26. tizen.org26
Tizen Kernel MM, UMM
Kernel / Device Drivers (BSP)
Kernel / Core & Subsystem
X Server
DRM Framework
GEM
Display HDMI
Virtual
Display
Post
Processor
G2D
EFL
Evas
2D GPU
backend
X Video Drivers
Userptr
NEON
2D GPU
backend
PIXMAN
EXA
V4L2
VB2
Codec Camera
GStreamer
OpenMAX
Libdrm
XV Extension
UMM
Open
GL
Multimedia FW
XvImageSink
Core External
Library
Core
Framework
OEM
Adaptation
Kernel
Kernel
GPU
DDK
(G3D)
Radio
* Images from MS Office clipart and Samsung
Gstreamer-
CameraSrc
DMABUF
Requirement from Tizen platform and hardware
⢠Different Memory Managers: GEM, VB2, GPU-adhoc, âŚ
⢠Share buffers
⢠w/o memcpy
⢠From and to users
⢠Never expose directly to users (e.g., physical address)
ď¨ UMM DMABUF!
27. tizen.org27
Tizen Kernel Memory Management
Unified Memory Management (UMM)
⢠Introduced by Jesse Barker, 2011
⢠Includes
â DMABUF (sharing buffer)
â DMA Mapping API for Allocation.
â CMA (Contiguous Memory Allocator)
IOMMU (MMU for I/O devs)
28. tizen.org28
Tizen Kernel MM, UMM
DMA Buffer Sharing: DMABUF
⢠Export
â GEM/VB2/⌠object ď DMABUF
⢠Import
â DMABUF ď GEM/VB2/⌠object
⢠Userspace sees DMABUF as a File Descriptor
29. tizen.org29
DMA Buffer Sharing: DMABUF, Example
Camera ď Display
X server
Video encoder
Xvsink
Camera src
User space
Kernel space DRM KMS
GEM Codec CameraV4L2 V4L2
struct dma_buf
Display Codec Camera
Memory
Camera App
FD
HW
30. tizen.org30
DMA Buffer Sharing: DMABUF, Example
Conceptual Data Flow
X server
Video encoder
Xvsink
Camera src
User space
Kernel space DRM KMS
GEM Codec CameraV4L2 V4L2
struct dma_buf
Display Codec Camera
Memory
Camera App
FD
HW
31. tizen.org31
DMABUF Usage Example 1/4
Camera App
1) Request V4L2 camera buffer (U)
2) Allocate CMA buffer (K)
3) Request a camera frame at the
V4L2 buffer (U)
4) Store the camera frame &
Notify user (K)
5) Request DMABUF export for the
V4L2 camera buffer (U)
6) dma_buf_exporter() (K)
- Create DMABUF from V4L2 buffer
7) dma_buf_fd() (K)
- Provide FD of the DMABUF to
user
X server
Video encoder
Xvsink
Camera src
User space
Kernel space DRM
KMS
GEM
Codec CameraV4L2 V4L2
struct dma_buf
Display Codec Camera
Memory
Camera App
FD
HW
32. tizen.org32
DMABUF Usage Example 1/4
Camera App
1) Request V4L2 camera buffer (U)
2) Allocate CMA buffer (K)
3) Request a camera frame at the
V4L2 buffer (U)
4) Store the camera frame &
Notify user (K)
5) Request DMABUF export for the
V4L2 camera buffer (U)
6) dma_buf_exporter() (K)
- Create DMABUF from V4L2 buffer
7) dma_buf_fd() (K)
- Provide FD of the DMABUF to
user
X server
Video encoder
Xvsink
Camera src
User space
Kernel space DRM
KMS
GEM
Codec CameraV4L2 V4L2
struct dma_buf
Display Codec Camera
Memory
Camera App
FD
HW
33. tizen.org33
DMABUF Usage Example 1/4
Camera App
1) Request V4L2 camera buffer (U)
2) Allocate CMA buffer (K)
3) Request a camera frame at the
V4L2 buffer (U)
4) Store the camera frame &
Notify user (K)
5) Request DMABUF export for the
V4L2 camera buffer (U)
6) dma_buf_exporter() (K)
- Create DMABUF from V4L2 buffer
7) dma_buf_fd() (K)
- Provide FD of the DMABUF to
user
X server
Video encoder
Xvsink
Camera src
User space
Kernel space DRM
KMS
GEM
Codec CameraV4L2 V4L2
struct dma_buf
Display Codec Camera
Memory
Camera App
FD
HW
34. tizen.org34
DMABUF Usage Example 2/4
Camera App
8) Request FD->GEM conversion (U)
9) dma_buf_get(fd) (K)
- Get DMABUF from FD
10)dma_buf_attach(dma-buf) /
dma_buf_map_attachment() (K)
- Get Buffer from DMABUF
11) Import as GEM, send user (K)
12) Request GEM object name (U)
13) Return GEM object name (K)
14) Send GEM object name to X (U)
X server
Video encoder
Xvsink
Camera src
User space
Kernel space DRM
KMS
GEM
Codec CameraV4L2 V4L2
struct dma_buf
Display Codec Camera
Memory
Camera App
FD
HW
35. tizen.org35
DMABUF Usage Example 2/4
Camera App
8) Request FD->GEM conversion (U)
9) dma_buf_get(fd) (K)
- Get DMABUF from FD
10) dma_buf_attach(dma-buf) /
dma_buf_map_attachment() (K)
- Get Buffer from DMABUF
11) Import as GEM, send user (K)
12) Request GEM object name (U)
13) Return GEM object name (K)
14) Send GEM object name to X (U)
X server
Video encoder
Xvsink
Camera src
User space
Kernel space DRM
KMS
GEM
Codec CameraV4L2 V4L2
struct dma_buf
Display Codec Camera
Memory
Camera App
FD
HW
36. tizen.org36
DMABUF Usage Example 3/4
X server
15) Convert given GEM object name
to GEM. Display its content.
(U & K)
X server
Video encoder
Xvsink
Camera src
User space
Kernel space DRM
KMS
GEM
Codec CameraV4L2 V4L2
struct dma_buf
Display Codec Camera
Memory
Camera App
FD
HW
37. tizen.org37
DMABUF Usage Example 3/4
X server
15) Convert given GEM object name
to GEM. Display its content.
(U & K)
X server
Video encoder
Xvsink
Camera src
User space
Kernel space DRM
KMS
GEM
Codec CameraV4L2 V4L2
struct dma_buf
Display Codec Camera
Memory
Camera App
FD
HW
38. tizen.org38
DMABUF Usage Example 4/4
Close after usage
1) âFreeâ the GEM object (U)
2) Remove reference from the
DMABUF (K)
3) Close(DMABUF-FD) at cam app (U)
4) (No more reference to DMABUF)
Release callback executed (K)
X server
Video encoder
Xvsink
Camera src
User space
Kernel space DRM
KMS
GEM
Codec CameraV4L2 V4L2
struct dma_buf
Display Codec Camera
Memory
Camera App
FD
HW
39. tizen.org39
DMABUF Usage Example 4/4
Close after usage
1) âFreeâ the GEM object (U)
2) Remove reference from the
DMABUF
3) Close(DMABUF-FD) at cam app (U)
4) (No more reference to DMABUF)
Release callback executed (K)
X server
Video encoder
Xvsink
Camera src
User space
Kernel space DRM
KMS
GEM
Codec CameraV4L2 V4L2
struct dma_buf
Display Codec Camera
Memory
Camera App
FD
HW
40. tizen.org40
DMABUF Usage Example 4/4
Close after usage
1) âFreeâ the GEM object (U)
2) Remove reference from the
DMABUF
3) Close(DMABUF-FD) at cam app (U)
4) (No more reference to DMABUF)
Release callback executed (K)
X server
Video encoder
Xvsink
Camera src
User space
Kernel space DRM
KMS
GEM
Codec CameraV4L2 V4L2
struct dma_buf
Display Codec Camera
Memory
Camera App
FD
HW
41. tizen.org41
Sorry, Back to DRM/GEMâŚ
⢠DMABUF Import / Export needs to be added
⢠DRM_IOCTL_PRIME_HANDLE_TO_FD
⢠Export gem handle into dmabuf fd
⢠DRM_IOCTL_PRIME_FD_TO_HANDLE
⢠Import dmabuf fd into gem handle
43. tizen.org43
Tizen Kernel Memory Management
Unified Memory Management (UMM)
⢠Introduced by Jesse Barker, 2011
⢠Includes
â DMABUF (sharing buffer)
â DMA Mapping API for Allocation.
â CMA (Contiguous Memory Allocator)
IOMMU (MMU for I/O devs)
44. tizen.org44
Tizen Kernel MM, UMM
DMA Mapping API @ Tizen Reference
DRM / GEM
DMA Mapping Framework
IOMMUBuddyCMA
IOMMU
Common
Driver
System Memory
V4L2 / VB2
1 2
1: âExynos-DRMâ provides unified device address space for all DRM devices
2: Each V4L2 device has its own device address space
2 2
47. tizen.org47
Tizen Kernel MM, Buffer Sync.
Kernel / Device Drivers (BSP)
Kernel / Core & Subsystem
X Server
DRM Framework
GEM
Display HDMI
Virtual
Display
Post
Processor
G2D
EFL
Evas
2D GPU
backend
X Video Drivers
Userptr
NEON
2D GPU
backend
PIXMAN
EXA
V4L2
VB2
Codec Camera
GStreamer
OpenMAX
Libdrm
XV Extension
UMM
Open
GL
Multimedia FW
XvImageSink
Core External
Library
Core
Framework
OEM
Adaptation
Kernel
Kernel
GPU
DDK
(G3D)
Radio
* Images from MS Office clipart and Samsung
Gstreamer-
CameraSrc
DMABUF
Synchronization?
48. tizen.org48
Tizen Kernel MM, Buffer Sync.
Whatâs the problem?
BUS
DRAMDRAMDRAM
CPU GPU
Simple Usage Scenario
1. CPU writes to buffer1.
2. CPU tells GPU to do something on buffer1.
3. GPU does something on buffer1.
4. GPU finishes.
5. CPU reads the buffer1
49. tizen.org49
Tizen Kernel MM, Buffer Sync.
Whatâs the problem?
BUS
DRAMDRAMDRAM
CPU GPU
Simple Usage Scenario
1. CPU writes to buffer1.
2. CPU tells GPU to do something on buffer1.
3. GPU does something on buffer1.
4. GPU finishes.
5. CPU reads the buffer1
50. tizen.org50
Tizen Kernel MM, Buffer Sync.
Whatâs the problem?
BUS
DRAMDRAMDRAM
CPU GPU
Simple Usage Scenario
1. CPU writes to buffer1.
2. CPU tells GPU to do something on buffer1.
3. GPU does something on buffer1.
4. GPU finishes.
5. CPU reads the buffer1
51. tizen.org51
Tizen Kernel MM, Buffer Sync.
Whatâs the problem?
BUS
DRAMDRAMDRAM
CPU GPU
Simple Usage Scenario
1. CPU writes to buffer1.
2. CPU tells GPU to do something on buffer1.
3. GPU does something on buffer1.
4. GPU finishes.
5. CPU reads the buffer1
52. tizen.org52
Tizen Kernel MM, Buffer Sync.
Whatâs the problem?
BUS
DRAMDRAMDRAM
CPU GPU
Simple Usage Scenario
1. CPU writes to buffer1.
2. CPU tells GPU to do something on buffer1.
3. GPU does something on buffer1.
4. GPU finishes.
5. CPU reads the buffer1
53. tizen.org53
Tizen Kernel MM, Buffer Sync.
Whatâs the problem?
Simple Usage Scenario
1. CPU writes to buffer1.
2. CPU tells GPU to do something on buffer1.
3. GPU does something on buffer1.
4. GPU finishes.
5. CPU reads the buffer1
How to ensure CPU wonât use buffer 1 until step 4?
(esp., a user process)
54. tizen.org54
Tizen Kernel MM, Buffer Sync.
Whatâs the problem?
BUS
DRAMDRAMDRAM
CPU,
Thread1
GPU
⢠What if there are two threads using GPU?
â And if the two look at the same buffer?
⢠Not even aware of it?
CPU,
Thread2
55. tizen.org55
Tizen Kernel MM, Buffer Sync.
Whatâs the problem?
BUS
DRAMDRAMDRAM
CPU,
Thread1
GPU
⢠What if the two DMA devices (GPU, FIMC) share buffer?
â But hard to know it at drivers or user threads.
â FIMC never knows when GPU finishes
â FIMC never knows when Threads1 stops using âbuffer1â
â Threads2 never know when GPU stops using âbuffer1â
CPU,
Thread2
FIMC-IPP
(Image Post Processing)
58. tizen.org58
Memory Size Optimization: Challenge
⢠A device with 512MB RAM
⢠Graphics/Multimedia devices want 400MB reserved
â No IOMMU.
⢠The userspace wants to run a web browser and HTML5 app!
â˘REALLY POSSIBLE?
59. tizen.org59
Memory Size Optimization: Challenge
⢠A device with 512MB RAM
⢠Graphics/Multimedia devices want 400MB reserved
â No IOMMU
⢠The userspace wants to run a web browser and HTML5 app!
â˘REALLY POSSIBLE?
â˘WHY NOT?
60. tizen.org60
Minimize H/W Reserved Memory
CMA (Contiguous Memory Allocator)
⢠Camera wants to reserve 400MB.
â No IOMMU: too primitive to use paging.
⢠You donât use cameras while web browsing.
â Free the 400MB reserved to camera, let userspace use it.
⢠CMA can do.
61. tizen.org61
Minimize H/W Reserved Memory
⢠(Obsolete/Low-cost) ARM SoCâs DMA devices
â No IOMMU
â Use physically continuous memory chunk.
⢠No paging
⢠Potentially, a lot of memory is wasted.
BUS
CPU
MMU
L2 Cache
DRAM Controller
DRAMDRAMDRAM
CPUCPU
GPU
62. tizen.org62
Minimize H/W Reserved Memory
IOMMU
⢠(Modern/Mid-High-cost) ARM SoCâs DMA devices
â IOMMU for DMA devices!
â Use paging!
⢠Dynamically allocate & free
BUS
CPU
MMU
L2 Cache
DRAM Controller
DRAMDRAMDRAM
CPUCPU
GPU
IOMMU
63. tizen.org63
Minimize H/W Reserved Memory
IOMMU
⢠Exynos4210/4412-based Tizen mobile device
â Achieved near-zero reserved memory.
â At the âmenuscreenâ, only around ~40MB allocated for display
and GPU.
â Unfortunately, not included in the Tizen reference kernel.
⢠But easily supported by Vanilla kernel for Tizen reference boards
64. tizen.org64
Minimize H/W Reserved Memory
Results with 1GB RAM Device
-sh-4.1# free
total used free shared buffers cached
Mem: 1029428 302020 727408 0 16164 133084
-/+ buffers/cache: 152772 876656
Swap: 0 0 0
-sh-4.1# uname -a
Linux localhost 3.8.3-00841-gc1981b1 #34 SMP PREEMPT Wed Apr 10 10:24:04 KST 2013 armv7l GNU/Linux
Mostly available to kernel (1005.3 of 1024MB)
Even with Tizen loaded, mostly free to users (856MB of 1GB)
65. tizen.org65
Memory Size Optimization:
Still Hungry?
⢠Further optimization required for low-budget devices
â Running full features with 512MB?
â Or even < 512MB?
⢠What about multi-tasking or âbackground appsâ?