Commit Graph

7 Commits

Author SHA1 Message Date
Yandong Lin
0e03d3bc70 fix[mpp_dmabuf]: fix align cache line size calculate err
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: Ide7daa58b12b22dc115acbbb7a9b8e305a167d57
2024-01-12 10:37:24 +08:00
Herman Chen
c06d3b4a71 fix[dmabuf]: Disable dmabuf partial sync function
For kernel dmabuf driver has bug on partial sync function we deside to
disable partial sync to reduce user's error.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I2c69c407eb5b0056ad0377699fef6ef31e1d79cd
2024-01-11 16:17:44 +08:00
Yandong Lin
35a99b5d50 fix[dmabuf]: align offset/len to cache line for partial sync
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com>
Change-Id: Ib6b0f6714bc4d98daa83f02d17c7659c00df570a
2023-12-27 14:56:46 +08:00
Herman Chen
d9fb399576 fix[dma-buf]: Add dma-buf.h for old ndk compiling
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Id1188a945aa56af165c5957b88aa1a7453f5799b
2023-12-06 14:44:23 +08:00
Herman Chen
6ce3007994 refactor[allocator]: Refactor allocator flow
1. Allocator api is determined by buffer type.
2. Allocator ctx is determined by both buffer type and buffer flags.
3. All allocator dma_heap / drm / ion / ext_dma should support different
buffer flags.
4. The buffer flag supports cacheable / 32-bit / contig options.
5. Add flags update flow on allocator create process.
6. Add mpp_dmabuf_has_partial_ops to disable dmabuf partial ops when the
kernel driver has bug.

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: If36a05c6704112cad3ab46861023597ff02bf14c
2023-11-29 09:54:36 +08:00
Herman Chen
d4913c1b88 chore[mpp_dmabuf]: Add dmabuf ioctl unit test
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Ice181f6d8cf312d68c79d6e6a33cddcbf65ef5f6
2023-11-16 16:33:40 +08:00
xueman.ruan
e15972e9af feat[mpp_dmabuf]: Add dmabuf sync operation
sync_begin - cache invalidate, should be called before cpu read
sync_end   - cache flush, should be called after cpu write

MppBuffer sync flow:
1. hw access
2. sync_begin
3. cpu access (read / write)
4. sync_end
5. hw access

NOTE: readonly option is faster for read only buffer.

Signed-off-by: xueman.ruan <xueman.ruan@rock-chips.com>
Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: I253a6139e9bb30808c07075d64f17b5cfad8519a
2023-11-16 14:27:02 +08:00