Merge "vidc: Add metabuffer mode support for encoder driver." into msm-3.0
This commit is contained in:
committed by
QuIC Gerrit Code Review
commit
2acd05e80b
@@ -901,6 +901,9 @@ static u32 ddl_set_enc_property(struct ddl_client_context *ddl,
|
||||
property_value);
|
||||
vcd_status = VCD_S_SUCCESS;
|
||||
break;
|
||||
case VCD_I_META_BUFFER_MODE:
|
||||
vcd_status = VCD_S_SUCCESS;
|
||||
break;
|
||||
default:
|
||||
DDL_MSG_ERROR("INVALID ID %d\n", (int)property_hdr->prop_id);
|
||||
vcd_status = VCD_ERR_ILLEGAL_OP;
|
||||
|
||||
@@ -1540,6 +1540,29 @@ static long vid_enc_ioctl(struct file *file,
|
||||
return -EFAULT;
|
||||
break;
|
||||
}
|
||||
case VEN_IOCTL_SET_METABUFFER_MODE:
|
||||
{
|
||||
u32 metabuffer_mode, vcd_status;
|
||||
struct vcd_property_hdr vcd_property_hdr;
|
||||
struct vcd_property_live live_mode;
|
||||
|
||||
if (copy_from_user(&venc_msg, arg, sizeof(venc_msg)))
|
||||
return -EFAULT;
|
||||
if (copy_from_user(&metabuffer_mode, venc_msg.in,
|
||||
sizeof(metabuffer_mode)))
|
||||
return -EFAULT;
|
||||
vcd_property_hdr.prop_id = VCD_I_META_BUFFER_MODE;
|
||||
vcd_property_hdr.sz =
|
||||
sizeof(struct vcd_property_live);
|
||||
live_mode.live = metabuffer_mode;
|
||||
vcd_status = vcd_set_property(client_ctx->vcd_handle,
|
||||
&vcd_property_hdr, &live_mode);
|
||||
if (vcd_status) {
|
||||
pr_err(" Setting metabuffer mode failed");
|
||||
return -EIO;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case VEN_IOCTL_SET_AC_PREDICTION:
|
||||
case VEN_IOCTL_GET_AC_PREDICTION:
|
||||
case VEN_IOCTL_SET_RVLC:
|
||||
|
||||
@@ -90,13 +90,13 @@ static u32 vcd_encode_start_in_open(struct vcd_clnt_ctxt *cctxt)
|
||||
return VCD_ERR_ILLEGAL_OP;
|
||||
}
|
||||
|
||||
if (!cctxt->in_buf_pool.entries ||
|
||||
if ((!cctxt->meta_mode && !cctxt->in_buf_pool.entries) ||
|
||||
!cctxt->out_buf_pool.entries ||
|
||||
cctxt->in_buf_pool.validated != cctxt->in_buf_pool.count ||
|
||||
(!cctxt->meta_mode &&
|
||||
cctxt->in_buf_pool.validated != cctxt->in_buf_pool.count) ||
|
||||
cctxt->out_buf_pool.validated !=
|
||||
cctxt->out_buf_pool.count) {
|
||||
VCD_MSG_ERROR("Buffer pool is not completely setup yet");
|
||||
|
||||
return VCD_ERR_BAD_STATE;
|
||||
}
|
||||
|
||||
@@ -495,6 +495,13 @@ static u32 vcd_set_property_cmn
|
||||
rc = ddl_set_property(cctxt->ddl_handle, prop_hdr, prop_val);
|
||||
VCD_FAILED_RETURN(rc, "Failed: ddl_set_property");
|
||||
switch (prop_hdr->prop_id) {
|
||||
case VCD_I_META_BUFFER_MODE:
|
||||
{
|
||||
struct vcd_property_live *live =
|
||||
(struct vcd_property_live *)prop_val;
|
||||
cctxt->meta_mode = live->live;
|
||||
break;
|
||||
}
|
||||
case VCD_I_LIVE:
|
||||
{
|
||||
struct vcd_property_live *live =
|
||||
|
||||
@@ -208,6 +208,7 @@ struct vcd_clnt_ctxt {
|
||||
struct ion_client *vcd_ion_client;
|
||||
u32 vcd_enable_ion;
|
||||
struct vcd_clnt_ctxt *next;
|
||||
u32 meta_mode;
|
||||
};
|
||||
|
||||
#define VCD_BUFFERPOOL_INUSE_DECREMENT(val) \
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
#define VCD_I_GET_H264_MV_SIZE (VCD_START_BASE + 0x1F)
|
||||
#define VCD_I_DEC_PICTYPE (VCD_START_BASE + 0x20)
|
||||
#define VCD_I_CONT_ON_RECONFIG (VCD_START_BASE + 0x21)
|
||||
#define VCD_I_META_BUFFER_MODE (VCD_START_BASE + 0x22)
|
||||
|
||||
#define VCD_START_REQ (VCD_START_BASE + 0x1000)
|
||||
#define VCD_I_REQ_IFRAME (VCD_START_REQ + 0x1)
|
||||
|
||||
@@ -653,7 +653,7 @@ u32 vcd_free_one_buffer_internal(
|
||||
VCD_FAILED_RETURN(rc, "Invalid buffer type provided");
|
||||
|
||||
first_frm_recvd &= cctxt->status.mask;
|
||||
if (first_frm_recvd) {
|
||||
if (first_frm_recvd && !cctxt->meta_mode) {
|
||||
VCD_MSG_ERROR(
|
||||
"VCD free buffer called when data path is active");
|
||||
return VCD_ERR_BAD_STATE;
|
||||
|
||||
@@ -435,6 +435,9 @@ struct venc_ioctl_msg{
|
||||
#define VEN_IOCTL_GET_NUMBER_INSTANCES \
|
||||
_IOR(VEN_IOCTLBASE_ENC, 46, struct venc_ioctl_msg)
|
||||
|
||||
#define VEN_IOCTL_SET_METABUFFER_MODE \
|
||||
_IOW(VEN_IOCTLBASE_ENC, 47, struct venc_ioctl_msg)
|
||||
|
||||
struct venc_switch{
|
||||
unsigned char status;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user