mirror of
https://github.com/nyanmisaka/mpp.git
synced 2025-10-30 04:02:07 +08:00
fix[mpp_dmabuf]: fix align cache line size calculate err
Signed-off-by: Yandong Lin <yandong.lin@rock-chips.com> Change-Id: Ide7daa58b12b22dc115acbbb7a9b8e305a167d57
This commit is contained in:
@@ -72,8 +72,8 @@ MPP_RET mpp_dmabuf_sync_partial_begin(RK_S32 fd, RK_S32 ro, RK_U32 offset, RK_U3
|
||||
return MPP_OK;
|
||||
|
||||
sync.flags = DMA_BUF_SYNC_START | (ro ? DMA_BUF_SYNC_READ : DMA_BUF_SYNC_RW);
|
||||
sync.offset = offset / CACHE_LINE_SIZE;
|
||||
sync.len = MPP_ALIGN(length, CACHE_LINE_SIZE);
|
||||
sync.offset = MPP_ALIGN_DOWN(offset, CACHE_LINE_SIZE);
|
||||
sync.len = MPP_ALIGN(length + offset - sync.offset, CACHE_LINE_SIZE);
|
||||
|
||||
ret = ioctl(fd, DMA_BUF_IOCTL_SYNC_PARTIAL, &sync);
|
||||
if (ret) {
|
||||
@@ -103,8 +103,8 @@ MPP_RET mpp_dmabuf_sync_partial_end(RK_S32 fd, RK_S32 ro, RK_U32 offset, RK_U32
|
||||
return MPP_OK;
|
||||
|
||||
sync.flags = DMA_BUF_SYNC_END | (ro ? DMA_BUF_SYNC_READ : DMA_BUF_SYNC_RW);
|
||||
sync.offset = offset / CACHE_LINE_SIZE;
|
||||
sync.len = MPP_ALIGN(length, CACHE_LINE_SIZE);
|
||||
sync.offset = MPP_ALIGN_DOWN(offset, CACHE_LINE_SIZE);
|
||||
sync.len = MPP_ALIGN(length + offset - sync.offset, CACHE_LINE_SIZE);
|
||||
|
||||
ret = ioctl(fd, DMA_BUF_IOCTL_SYNC_PARTIAL, &sync);
|
||||
if (ret) {
|
||||
|
||||
Reference in New Issue
Block a user