Merge "msm: vidc: amend cvp module structures"
This commit is contained in:
commit
671a044e76
@ -22,7 +22,41 @@ static void print_cvp_buffer(u32 tag, const char *str,
|
||||
cbuf->offset, cbuf->dbuf, cbuf->kvaddr);
|
||||
}
|
||||
|
||||
static int msm_cvp_fill_planeinfo(struct cvp_kmd_color_plane_info *plane_info,
|
||||
static int msm_cvp_get_version_info(struct msm_vidc_inst *inst)
|
||||
{
|
||||
int rc;
|
||||
struct msm_cvp_external *cvp;
|
||||
struct cvp_kmd_arg *arg;
|
||||
struct cvp_kmd_sys_properties *sys_prop;
|
||||
struct cvp_kmd_sys_property *prop_data;
|
||||
u32 version;
|
||||
|
||||
if (!inst || !inst->cvp) {
|
||||
dprintk(VIDC_ERR, "%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
cvp = inst->cvp;
|
||||
arg = cvp->arg;
|
||||
|
||||
memset(arg, 0, sizeof(struct cvp_kmd_arg));
|
||||
arg->type = CVP_KMD_GET_SYS_PROPERTY;
|
||||
sys_prop = (struct cvp_kmd_sys_properties *)&arg->data.sys_properties;
|
||||
sys_prop->prop_num = CVP_KMD_HFI_VERSION_PROP_NUMBER;
|
||||
prop_data = (struct cvp_kmd_sys_property *)
|
||||
&arg->data.sys_properties.prop_data;
|
||||
prop_data->prop_type = CVP_KMD_HFI_VERSION_PROP_TYPE;
|
||||
rc = msm_cvp_private(cvp->priv, CVP_KMD_GET_SYS_PROPERTY, arg);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR, "%s: failed, rc %d\n", __func__, rc);
|
||||
return rc;
|
||||
}
|
||||
version = prop_data->data;
|
||||
dprintk(VIDC_HIGH, "%s: version %#x\n", __func__, version);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int msm_cvp_fill_planeinfo(struct msm_cvp_color_plane_info *plane_info,
|
||||
u32 color_fmt, u32 width, u32 height)
|
||||
{
|
||||
int rc = 0;
|
||||
@ -420,8 +454,14 @@ static void msm_cvp_deinit_internal_buffers(struct msm_vidc_inst *inst)
|
||||
|
||||
arg = kzalloc(sizeof(struct cvp_kmd_arg), GFP_KERNEL);
|
||||
if (arg) {
|
||||
memset(arg, 0, sizeof(struct cvp_kmd_arg));
|
||||
arg->type = CVP_KMD_HFI_PERSIST_CMD;
|
||||
arg->buf_offset = offsetof(struct
|
||||
msm_cvp_session_release_persist_buffers_packet,
|
||||
persist1_buffer) / sizeof(u32);
|
||||
arg->buf_num = (sizeof(struct
|
||||
msm_cvp_session_release_persist_buffers_packet) -
|
||||
(arg->buf_offset * sizeof(u32))) /
|
||||
sizeof(struct msm_cvp_buffer_type);
|
||||
memcpy(&(arg->data.pbuf_cmd), &persist2_packet,
|
||||
sizeof(struct
|
||||
msm_cvp_session_release_persist_buffers_packet));
|
||||
@ -432,6 +472,8 @@ static void msm_cvp_deinit_internal_buffers(struct msm_vidc_inst *inst)
|
||||
"release failed: persist2_buffer",
|
||||
inst, &cvp->persist2_buffer);
|
||||
kfree(arg);
|
||||
} else {
|
||||
dprintk(VIDC_ERR, "%s: alloc failed\n", __func__);
|
||||
}
|
||||
|
||||
rc = msm_cvp_free_buffer(inst, &cvp->persist2_buffer);
|
||||
@ -481,11 +523,13 @@ static int msm_cvp_init_internal_buffers(struct msm_vidc_inst *inst)
|
||||
|
||||
memset(arg, 0, sizeof(struct cvp_kmd_arg));
|
||||
arg->type = CVP_KMD_HFI_PERSIST_CMD;
|
||||
if (sizeof(struct cvp_kmd_persist_buf) <
|
||||
sizeof(struct msm_cvp_session_set_persist_buffers_packet)) {
|
||||
dprintk(VIDC_ERR, "%s: insufficient size\n", __func__);
|
||||
goto error;
|
||||
}
|
||||
arg->buf_offset = offsetof(
|
||||
struct msm_cvp_session_set_persist_buffers_packet,
|
||||
persist1_buffer) / sizeof(u32);
|
||||
arg->buf_num = (sizeof(
|
||||
struct msm_cvp_session_set_persist_buffers_packet) -
|
||||
(arg->buf_offset * sizeof(u32))) /
|
||||
sizeof(struct msm_cvp_buffer_type);
|
||||
memcpy(&(arg->data.pbuf_cmd), &persist2_packet,
|
||||
sizeof(struct msm_cvp_session_set_persist_buffers_packet));
|
||||
rc = msm_cvp_private(cvp->priv, CVP_KMD_HFI_PERSIST_CMD, arg);
|
||||
@ -522,7 +566,7 @@ static int msm_cvp_prepare_extradata(struct msm_vidc_inst *inst,
|
||||
struct msm_cvp_external *cvp;
|
||||
struct vb2_buffer *vb;
|
||||
struct dma_buf *dbuf;
|
||||
char *kvaddr;
|
||||
char *kvaddr = NULL;
|
||||
struct msm_vidc_extradata_header *e_hdr;
|
||||
bool input_extradata, found_end;
|
||||
|
||||
@ -718,9 +762,14 @@ static int msm_cvp_frame_process(struct msm_vidc_inst *inst,
|
||||
return 0;
|
||||
}
|
||||
|
||||
memset(arg, 0, sizeof(struct cvp_kmd_arg));
|
||||
arg->type = CVP_KMD_SEND_CMD_PKT;
|
||||
arg->buf_offset = offsetof(struct msm_cvp_dme_frame_packet,
|
||||
fullres_srcbuffer) / sizeof(u32);
|
||||
arg->buf_num = (sizeof(struct msm_cvp_dme_frame_packet) -
|
||||
(arg->buf_offset * sizeof(u32))) /
|
||||
sizeof(struct msm_cvp_buffer_type);
|
||||
frame = (struct msm_cvp_dme_frame_packet *)&arg->data.hfi_pkt.pkt_data;
|
||||
|
||||
frame->size = sizeof(struct msm_cvp_dme_frame_packet);
|
||||
frame->packet_type = HFI_CMD_SESSION_CVP_DME_FRAME;
|
||||
frame->session_id = cvp->session_id;
|
||||
@ -1004,6 +1053,12 @@ static int msm_vidc_cvp_open(struct msm_vidc_inst *inst)
|
||||
dprintk(VIDC_HIGH, "%s: cvp session id %#x\n",
|
||||
__func__, cvp->session_id);
|
||||
|
||||
rc = msm_cvp_get_version_info(inst);
|
||||
if (rc) {
|
||||
dprintk(VIDC_ERR, "%s: get_version_info failed\n", __func__);
|
||||
goto error;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
error:
|
||||
|
@ -37,6 +37,14 @@
|
||||
#define HFI_DME_INTERNAL_PERSIST_2_BUFFER_SIZE (512 * 1024)
|
||||
#define HFI_DME_FRAME_CONTEXT_BUFFER_SIZE (64 * 1024)
|
||||
|
||||
#define CVP_KMD_HFI_VERSION_PROP_TYPE (1)
|
||||
#define CVP_KMD_HFI_VERSION_PROP_NUMBER (1)
|
||||
|
||||
static inline bool is_vidc_cvp_enabled(struct msm_vidc_inst *inst)
|
||||
{
|
||||
return !!inst->cvp;
|
||||
}
|
||||
|
||||
enum HFI_COLOR_PLANE_TYPE {
|
||||
HFI_COLOR_PLANE_METADATA,
|
||||
HFI_COLOR_PLANE_PICDATA,
|
||||
@ -45,21 +53,35 @@ enum HFI_COLOR_PLANE_TYPE {
|
||||
HFI_MAX_COLOR_PLANES
|
||||
};
|
||||
|
||||
static inline bool is_vidc_cvp_enabled(struct msm_vidc_inst *inst)
|
||||
{
|
||||
return !!inst->cvp;
|
||||
}
|
||||
struct msm_cvp_color_plane_info {
|
||||
u32 stride[HFI_MAX_COLOR_PLANES];
|
||||
u32 buf_size[HFI_MAX_COLOR_PLANES];
|
||||
};
|
||||
|
||||
struct msm_cvp_client_data {
|
||||
u32 transactionid;
|
||||
u32 client_data1;
|
||||
u32 client_data2;
|
||||
u32 kernel_data1;
|
||||
u32 kernel_data2;
|
||||
u32 reserved1;
|
||||
u32 reserved2;
|
||||
};
|
||||
|
||||
struct msm_cvp_buffer_type {
|
||||
u32 buffer_addr;
|
||||
u32 size;
|
||||
u32 offset;
|
||||
u32 flags;
|
||||
u32 reserved1;
|
||||
u32 reserved2;
|
||||
};
|
||||
|
||||
struct msm_cvp_session_release_persist_buffers_packet {
|
||||
u32 size;
|
||||
u32 packet_type;
|
||||
u32 session_id;
|
||||
struct cvp_kmd_client_data client_data;
|
||||
struct msm_cvp_client_data client_data;
|
||||
u32 cvp_op;
|
||||
struct msm_cvp_buffer_type persist1_buffer;
|
||||
struct msm_cvp_buffer_type persist2_buffer;
|
||||
@ -69,7 +91,7 @@ struct msm_cvp_session_set_persist_buffers_packet {
|
||||
u32 size;
|
||||
u32 packet_type;
|
||||
u32 session_id;
|
||||
struct cvp_kmd_client_data client_data;
|
||||
struct msm_cvp_client_data client_data;
|
||||
u32 cvp_op;
|
||||
struct msm_cvp_buffer_type persist1_buffer;
|
||||
struct msm_cvp_buffer_type persist2_buffer;
|
||||
@ -79,13 +101,16 @@ struct msm_cvp_dme_frame_packet {
|
||||
u32 size;
|
||||
u32 packet_type;
|
||||
u32 session_id;
|
||||
struct cvp_kmd_client_data client_data;
|
||||
struct msm_cvp_client_data client_data;
|
||||
u32 stream_idx;
|
||||
u32 skip_mv_calc;
|
||||
u32 min_fpx_threshold;
|
||||
u32 enable_descriptor_lpf;
|
||||
u32 enable_ncc_subpel;
|
||||
u32 descmatch_threshold;
|
||||
int ncc_robustness_threshold;
|
||||
u32 reserved[8];
|
||||
u32 buf_marker;
|
||||
struct msm_cvp_buffer_type fullres_srcbuffer;
|
||||
struct msm_cvp_buffer_type src_buffer;
|
||||
struct msm_cvp_buffer_type srcframe_contextbuffer;
|
||||
@ -100,15 +125,16 @@ struct msm_cvp_dme_basic_config_packet {
|
||||
u32 size;
|
||||
u32 packet_type;
|
||||
u32 session_id;
|
||||
struct cvp_kmd_client_data client_data;
|
||||
struct msm_cvp_client_data client_data;
|
||||
u32 stream_idx;
|
||||
u32 srcbuffer_format;
|
||||
struct cvp_kmd_color_plane_info srcbuffer_planeinfo;
|
||||
struct msm_cvp_color_plane_info srcbuffer_planeinfo;
|
||||
u32 src_width;
|
||||
u32 src_height;
|
||||
u32 fullres_width;
|
||||
u32 fullres_height;
|
||||
u32 fullresbuffer_format;
|
||||
struct cvp_kmd_color_plane_info fullresbuffer_planeinfo;
|
||||
struct msm_cvp_color_plane_info fullresbuffer_planeinfo;
|
||||
u32 ds_enable;
|
||||
u32 enable_lrme_robustness;
|
||||
u32 enable_inlier_tracking;
|
||||
|
Loading…
Reference in New Issue
Block a user