mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 03:15:31 +09:00
video: rockchip: mpp: re-define MPP_DEVICE_TYPE
Change-Id: I9cc654388c15394198575fa321edbdca437d5f77 Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
This commit is contained in:
@@ -41,19 +41,29 @@
|
||||
|
||||
#define MPP_IOC_CUSTOM_BASE (0x1000)
|
||||
|
||||
/**
|
||||
* Device type: classified by hardware feature
|
||||
*/
|
||||
enum MPP_DEVICE_TYPE {
|
||||
MPP_DEVICE_ENC = 0x0,
|
||||
MPP_DEVICE_DEC = 0x1,
|
||||
MPP_DEVICE_PP = 0x2,
|
||||
MPP_DEVICE_DEC_PP = 0x3,
|
||||
MPP_DEVICE_DEC_HEVC = 0x4,
|
||||
MPP_DEVICE_DEC_RKV = 0x5,
|
||||
MPP_DEVICE_ENC_RKV = 0x6,
|
||||
MPP_DEVICE_DEC_AVSPLUS = 0x7,
|
||||
MPP_DEVICE_ENC_VEPU22 = 0x8,
|
||||
MPP_DEVICE_VDPU1 = 0, /* 0x00000001 */
|
||||
MPP_DEVICE_VDPU2 = 1, /* 0x00000002 */
|
||||
MPP_DEVICE_VDPU1_PP = 2, /* 0x00000004 */
|
||||
MPP_DEVICE_VDPU2_PP = 3, /* 0x00000008 */
|
||||
|
||||
MPP_DEVICE_HEVC_DEC = 8, /* 0x00000100 */
|
||||
MPP_DEVICE_RKVDEC = 9, /* 0x00000200 */
|
||||
MPP_DEVICE_AVSPLUS_DEC = 12, /* 0x00001000 */
|
||||
|
||||
MPP_DEVICE_RKVENC = 16, /* 0x00010000 */
|
||||
MPP_DEVICE_VEPU1 = 17, /* 0x00020000 */
|
||||
MPP_DEVICE_VEPU2 = 18, /* 0x00040000 */
|
||||
MPP_DEVICE_VEPU22 = 24, /* 0x01000000 */
|
||||
MPP_DEVICE_BUTT,
|
||||
};
|
||||
|
||||
/**
|
||||
* Driver type: classified by driver
|
||||
*/
|
||||
enum MPP_DRIVER_TYPE {
|
||||
MPP_DRIVER_NULL = 0,
|
||||
MPP_DRIVER_VDPU1,
|
||||
|
||||
@@ -1451,7 +1451,7 @@ static struct mpp_dev_ops rkvdec_3328_dev_ops = {
|
||||
};
|
||||
|
||||
static const struct mpp_dev_var rk_hevcdec_data = {
|
||||
.device_type = MPP_DEVICE_DEC_RKV,
|
||||
.device_type = MPP_DEVICE_HEVC_DEC,
|
||||
.hw_info = &rk_hevcdec_hw_info,
|
||||
.trans_info = rk_hevcdec_trans,
|
||||
.hw_ops = &rkvdec_v1_hw_ops,
|
||||
@@ -1459,7 +1459,7 @@ static const struct mpp_dev_var rk_hevcdec_data = {
|
||||
};
|
||||
|
||||
static const struct mpp_dev_var rkvdec_v1_data = {
|
||||
.device_type = MPP_DEVICE_DEC_RKV,
|
||||
.device_type = MPP_DEVICE_RKVDEC,
|
||||
.hw_info = &rkvdec_v1_hw_info,
|
||||
.trans_info = rkvdec_v1_trans,
|
||||
.hw_ops = &rkvdec_v1_hw_ops,
|
||||
@@ -1467,7 +1467,7 @@ static const struct mpp_dev_var rkvdec_v1_data = {
|
||||
};
|
||||
|
||||
static const struct mpp_dev_var rkvdec_3399_data = {
|
||||
.device_type = MPP_DEVICE_DEC_RKV,
|
||||
.device_type = MPP_DEVICE_RKVDEC,
|
||||
.hw_info = &rkvdec_v1_hw_info,
|
||||
.trans_info = rkvdec_v1_trans,
|
||||
.hw_ops = &rkvdec_3399_hw_ops,
|
||||
@@ -1475,7 +1475,7 @@ static const struct mpp_dev_var rkvdec_3399_data = {
|
||||
};
|
||||
|
||||
static const struct mpp_dev_var rkvdec_3328_data = {
|
||||
.device_type = MPP_DEVICE_DEC_RKV,
|
||||
.device_type = MPP_DEVICE_RKVDEC,
|
||||
.hw_info = &rkvdec_v1_hw_info,
|
||||
.trans_info = rkvdec_v1_trans,
|
||||
.hw_ops = &rkvdec_3328_hw_ops,
|
||||
|
||||
@@ -65,7 +65,7 @@ static int mpp_init_grf(struct device_node *np,
|
||||
return -ENODATA;
|
||||
|
||||
ret = of_property_read_u32_index(np, "rockchip,grf-values",
|
||||
index, &grf_value);
|
||||
index, &grf_value);
|
||||
if (ret)
|
||||
return -ENODATA;
|
||||
|
||||
|
||||
@@ -232,7 +232,7 @@ static void *vdpu_alloc_task(struct mpp_session *session,
|
||||
|
||||
mpp_task_init(session, &task->mpp_task);
|
||||
|
||||
if (session->device_type == MPP_DEVICE_DEC_PP) {
|
||||
if (session->device_type == MPP_DEVICE_VDPU1_PP) {
|
||||
task->pp_enable = true;
|
||||
task->hw_info = &vdpu_pp_v1_hw_info;
|
||||
} else {
|
||||
@@ -646,7 +646,7 @@ static struct mpp_dev_ops vdpu_v1_dev_ops = {
|
||||
};
|
||||
|
||||
static const struct mpp_dev_var vdpu_v1_data = {
|
||||
.device_type = MPP_DEVICE_DEC,
|
||||
.device_type = MPP_DEVICE_VDPU1,
|
||||
.hw_info = &vdpu_v1_hw_info,
|
||||
.trans_info = vdpu_v1_trans,
|
||||
.hw_ops = &vdpu_v1_hw_ops,
|
||||
@@ -654,7 +654,7 @@ static const struct mpp_dev_var vdpu_v1_data = {
|
||||
};
|
||||
|
||||
static const struct mpp_dev_var avsd_plus_data = {
|
||||
.device_type = MPP_DEVICE_DEC_AVSPLUS,
|
||||
.device_type = MPP_DEVICE_AVSPLUS_DEC,
|
||||
.hw_info = &vdpu_v1_hw_info,
|
||||
.trans_info = vdpu_v1_trans,
|
||||
.hw_ops = &vdpu_v1_hw_ops,
|
||||
@@ -710,10 +710,9 @@ static int vdpu_probe(struct platform_device *pdev)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (mpp->var->device_type == MPP_DEVICE_DEC) {
|
||||
mpp->srv->sub_devices[MPP_DEVICE_PP] = mpp;
|
||||
mpp->srv->sub_devices[MPP_DEVICE_DEC_PP] = mpp;
|
||||
}
|
||||
if (mpp->var->device_type == MPP_DEVICE_VDPU1)
|
||||
mpp->srv->sub_devices[MPP_DEVICE_VDPU1_PP] = mpp;
|
||||
|
||||
mpp->session_max_buffers = VDPU1_SESSION_MAX_BUFFERS;
|
||||
vdpu_debugfs_init(mpp);
|
||||
dev_info(dev, "probing finish\n");
|
||||
|
||||
@@ -607,7 +607,7 @@ static struct mpp_dev_ops vdpu_v2_dev_ops = {
|
||||
};
|
||||
|
||||
static const struct mpp_dev_var vdpu_v2_data = {
|
||||
.device_type = MPP_DEVICE_DEC,
|
||||
.device_type = MPP_DEVICE_VDPU2,
|
||||
.hw_info = &vdpu_v2_hw_info,
|
||||
.trans_info = vdpu_v2_trans,
|
||||
.hw_ops = &vdpu_v2_hw_ops,
|
||||
@@ -661,10 +661,9 @@ static int vdpu_probe(struct platform_device *pdev)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (mpp->var->device_type == MPP_DEVICE_DEC) {
|
||||
mpp->srv->sub_devices[MPP_DEVICE_PP] = mpp;
|
||||
mpp->srv->sub_devices[MPP_DEVICE_DEC_PP] = mpp;
|
||||
}
|
||||
if (mpp->var->device_type == MPP_DEVICE_VDPU2)
|
||||
mpp->srv->sub_devices[MPP_DEVICE_VDPU2_PP] = mpp;
|
||||
|
||||
mpp->session_max_buffers = VDPU2_SESSION_MAX_BUFFERS;
|
||||
vdpu_debugfs_init(mpp);
|
||||
dev_info(dev, "probing finish\n");
|
||||
|
||||
@@ -512,7 +512,7 @@ static struct mpp_dev_ops vepu_v1_dev_ops = {
|
||||
};
|
||||
|
||||
static const struct mpp_dev_var vepu_v1_data = {
|
||||
.device_type = MPP_DEVICE_ENC,
|
||||
.device_type = MPP_DEVICE_VEPU1,
|
||||
.hw_info = &vepu_v1_hw_info,
|
||||
.trans_info = trans_rk_vepu1,
|
||||
.hw_ops = &vepu_v1_hw_ops,
|
||||
|
||||
@@ -519,7 +519,7 @@ static struct mpp_dev_ops vepu_v2_dev_ops = {
|
||||
};
|
||||
|
||||
static const struct mpp_dev_var vepu_v2_data = {
|
||||
.device_type = MPP_DEVICE_ENC,
|
||||
.device_type = MPP_DEVICE_VEPU2,
|
||||
.hw_info = &vepu_v2_hw_info,
|
||||
.trans_info = trans_rk_vepu2,
|
||||
.hw_ops = &vepu_v2_hw_ops,
|
||||
|
||||
Reference in New Issue
Block a user