mirror of
https://github.com/nyanmisaka/mpp.git
synced 2025-10-21 16:19:23 +08:00
[mpp_device]: Add regs offset helper function
This helper function is for address register setup its offset. When offset is less than 4M (20bit) the offset and buffer fd (10bit) can be filled in 32bit word. When offset is larger than 4M the full offset should be sent by ioctl MPP_DEV_REG_OFFSET. Change-Id: I5f59f3c941e41cf85fa2ab8895d2a177f4412e64 Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
#include "mpp_env.h"
|
||||
#include "mpp_log.h"
|
||||
#include "mpp_mem.h"
|
||||
#include "mpp_common.h"
|
||||
|
||||
#include "mpp_device_debug.h"
|
||||
#include "mpp_service_api.h"
|
||||
@@ -152,3 +153,19 @@ MPP_RET mpp_dev_ioctl(MppDev ctx, RK_S32 cmd, void *param)
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
MPP_RET mpp_dev_set_reg_offset(MppDev dev, RK_U32 *regs, RK_S32 index, RK_U32 offset)
|
||||
{
|
||||
if (offset < SZ_4M)
|
||||
regs[index] += offset << 10;
|
||||
else {
|
||||
MppDevRegOffsetCfg trans_cfg;
|
||||
|
||||
trans_cfg.reg_idx = index;
|
||||
trans_cfg.offset = offset;
|
||||
|
||||
mpp_dev_ioctl(dev, MPP_DEV_REG_OFFSET, &trans_cfg);
|
||||
}
|
||||
|
||||
return MPP_OK;
|
||||
}
|
||||
|
Reference in New Issue
Block a user