video: driver: remove input meta via request support
remove input meta via request support Change-Id: If2a504455e1899c4cefb2a9142f7a92db02a45f2 Signed-off-by: Akshata Sahukar <quic_asahukar@quicinc.com>
This commit is contained in:
@@ -1491,19 +1491,6 @@ static struct msm_platform_inst_capability instance_cap_data_anorak[] = {
|
||||
0,
|
||||
CAP_FLAG_OUTPUT_PORT},
|
||||
|
||||
{INPUT_METADATA_FD, ENC|DEC, CODECS_ALL,
|
||||
INVALID_FD, INT_MAX, 1, INVALID_FD,
|
||||
V4L2_CID_MPEG_VIDC_INPUT_METADATA_FD,
|
||||
0,
|
||||
CAP_FLAG_INPUT_PORT | CAP_FLAG_DYNAMIC_ALLOWED},
|
||||
|
||||
{INPUT_META_VIA_REQUEST, ENC|DEC, CODECS_ALL,
|
||||
V4L2_MPEG_MSM_VIDC_DISABLE, V4L2_MPEG_MSM_VIDC_ENABLE,
|
||||
1, V4L2_MPEG_MSM_VIDC_DISABLE,
|
||||
V4L2_CID_MPEG_VIDC_INPUT_METADATA_VIA_REQUEST_ENABLE,
|
||||
0,
|
||||
CAP_FLAG_INPUT_PORT},
|
||||
|
||||
{META_LTR_MARK_USE, ENC, H264|HEVC,
|
||||
V4L2_MPEG_VIDC_META_DISABLE,
|
||||
V4L2_MPEG_VIDC_META_ENABLE | V4L2_MPEG_VIDC_META_RX_OUTPUT,
|
||||
@@ -2403,18 +2390,6 @@ static struct msm_platform_inst_cap_dependency instance_cap_dependency_data_anor
|
||||
msm_vidc_adjust_all_intra,
|
||||
NULL},
|
||||
|
||||
{INPUT_METADATA_FD, ENC|DEC, CODECS_ALL,
|
||||
{0},
|
||||
{0},
|
||||
NULL,
|
||||
NULL},
|
||||
|
||||
{INPUT_META_VIA_REQUEST, ENC|DEC, CODECS_ALL,
|
||||
{0},
|
||||
{0},
|
||||
NULL,
|
||||
NULL},
|
||||
|
||||
{META_EVA_STATS, ENC, CODECS_ALL,
|
||||
{0},
|
||||
{ENH_LAYER_COUNT, REQUEST_PREPROCESS}},
|
||||
|
@@ -1690,18 +1690,6 @@ static struct msm_platform_inst_capability instance_cap_data_kalama[] = {
|
||||
0,
|
||||
CAP_FLAG_OUTPUT_PORT},
|
||||
|
||||
{INPUT_METADATA_FD, ENC|DEC, CODECS_ALL,
|
||||
INVALID_FD, INT_MAX, 1, INVALID_FD,
|
||||
V4L2_CID_MPEG_VIDC_INPUT_METADATA_FD,
|
||||
0,
|
||||
CAP_FLAG_INPUT_PORT | CAP_FLAG_DYNAMIC_ALLOWED},
|
||||
|
||||
{INPUT_META_VIA_REQUEST, ENC|DEC, CODECS_ALL,
|
||||
0, 1, 1, 0,
|
||||
V4L2_CID_MPEG_VIDC_INPUT_METADATA_VIA_REQUEST_ENABLE,
|
||||
0,
|
||||
CAP_FLAG_INPUT_PORT},
|
||||
|
||||
{META_LTR_MARK_USE, ENC, H264|HEVC,
|
||||
MSM_VIDC_META_DISABLE,
|
||||
MSM_VIDC_META_ENABLE | MSM_VIDC_META_RX_OUTPUT,
|
||||
@@ -2592,18 +2580,6 @@ static struct msm_platform_inst_cap_dependency instance_cap_dependency_data_kala
|
||||
msm_vidc_adjust_all_intra,
|
||||
NULL},
|
||||
|
||||
{INPUT_METADATA_FD, ENC|DEC, CODECS_ALL,
|
||||
{0},
|
||||
{0},
|
||||
NULL,
|
||||
NULL},
|
||||
|
||||
{INPUT_META_VIA_REQUEST, ENC|DEC, CODECS_ALL,
|
||||
{0},
|
||||
{0},
|
||||
NULL,
|
||||
NULL},
|
||||
|
||||
{META_EVA_STATS, ENC, CODECS_ALL,
|
||||
{0},
|
||||
{ENH_LAYER_COUNT, REQUEST_PREPROCESS}},
|
||||
|
@@ -1336,19 +1336,6 @@ static struct msm_platform_inst_capability instance_cap_data_waipio[] = {
|
||||
0,
|
||||
CAP_FLAG_OUTPUT_PORT},
|
||||
|
||||
{INPUT_METADATA_FD, ENC|DEC, CODECS_ALL,
|
||||
INVALID_FD, INT_MAX, 1, INVALID_FD,
|
||||
V4L2_CID_MPEG_VIDC_INPUT_METADATA_FD,
|
||||
0,
|
||||
CAP_FLAG_INPUT_PORT | CAP_FLAG_DYNAMIC_ALLOWED},
|
||||
|
||||
{INPUT_META_VIA_REQUEST, ENC|DEC, CODECS_ALL,
|
||||
V4L2_MPEG_MSM_VIDC_DISABLE, V4L2_MPEG_MSM_VIDC_ENABLE,
|
||||
1, V4L2_MPEG_MSM_VIDC_DISABLE,
|
||||
V4L2_CID_MPEG_VIDC_INPUT_METADATA_VIA_REQUEST_ENABLE,
|
||||
0,
|
||||
CAP_FLAG_INPUT_PORT},
|
||||
|
||||
{META_LTR_MARK_USE, ENC, H264|HEVC,
|
||||
V4L2_MPEG_VIDC_META_DISABLE,
|
||||
V4L2_MPEG_VIDC_META_ENABLE | V4L2_MPEG_VIDC_META_RX_OUTPUT,
|
||||
@@ -2154,18 +2141,6 @@ static struct msm_platform_inst_cap_dependency instance_cap_dependency_data_waip
|
||||
msm_vidc_adjust_all_intra,
|
||||
NULL},
|
||||
|
||||
{INPUT_METADATA_FD, ENC|DEC, CODECS_ALL,
|
||||
{0},
|
||||
{0},
|
||||
NULL,
|
||||
NULL},
|
||||
|
||||
{INPUT_META_VIA_REQUEST, ENC|DEC, CODECS_ALL,
|
||||
{0},
|
||||
{0},
|
||||
NULL,
|
||||
NULL},
|
||||
|
||||
{META_EVA_STATS, ENC, CODECS_ALL,
|
||||
{0},
|
||||
{ENH_LAYER_COUNT, REQUEST_PREPROCESS}},
|
||||
|
@@ -588,8 +588,6 @@ bool res_is_less_than_or_equal_to(u32 width, u32 height,
|
||||
int signal_session_msg_receipt(struct msm_vidc_inst *inst,
|
||||
enum signal_session_response cmd);
|
||||
int msm_vidc_get_properties(struct msm_vidc_inst *inst);
|
||||
int msm_vidc_create_input_metadata_buffer(struct msm_vidc_inst *inst, int buf_fd);
|
||||
int msm_vidc_update_input_meta_buffer_index(struct msm_vidc_inst *inst, struct vb2_buffer *vb2);
|
||||
int msm_vidc_update_input_rate(struct msm_vidc_inst *inst, u64 time_us);
|
||||
int msm_vidc_add_buffer_stats(struct msm_vidc_inst *inst,
|
||||
struct msm_vidc_buffer *buf);
|
||||
|
@@ -520,8 +520,6 @@ enum msm_vidc_inst_capability_type {
|
||||
FILM_GRAIN,
|
||||
SUPER_BLOCK,
|
||||
DRAP,
|
||||
INPUT_METADATA_FD,
|
||||
INPUT_META_VIA_REQUEST,
|
||||
ENC_IP_CR,
|
||||
COMPLEXITY,
|
||||
CABAC_MAX_BITRATE,
|
||||
|
@@ -1434,18 +1434,12 @@ int msm_vdec_streamon_input(struct msm_vidc_inst *inst)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/*
|
||||
* do not check for input meta port streamon when
|
||||
* request is enabled
|
||||
*/
|
||||
if (!inst->capabilities->cap[INPUT_META_VIA_REQUEST].value) {
|
||||
if (is_input_meta_enabled(inst) &&
|
||||
!inst->bufq[INPUT_META_PORT].vb2q->streaming) {
|
||||
i_vpr_e(inst,
|
||||
"%s: Meta port must be streamed on before data port\n",
|
||||
__func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
if (is_input_meta_enabled(inst) &&
|
||||
!inst->bufq[INPUT_META_PORT].vb2q->streaming) {
|
||||
i_vpr_e(inst,
|
||||
"%s: Meta port must be streamed on before data port\n",
|
||||
__func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
rc = msm_vidc_check_session_supported(inst);
|
||||
|
@@ -813,18 +813,12 @@ int msm_venc_streamon_input(struct msm_vidc_inst *inst)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/*
|
||||
* do not check for input meta port streamon when
|
||||
* request is enabled
|
||||
*/
|
||||
if (!inst->capabilities->cap[INPUT_META_VIA_REQUEST].value) {
|
||||
if (is_input_meta_enabled(inst) &&
|
||||
!inst->bufq[INPUT_META_PORT].vb2q->streaming) {
|
||||
i_vpr_e(inst,
|
||||
"%s: Meta port must be streamed on before data port\n",
|
||||
__func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
if (is_input_meta_enabled(inst) &&
|
||||
!inst->bufq[INPUT_META_PORT].vb2q->streaming) {
|
||||
i_vpr_e(inst,
|
||||
"%s: Meta port must be streamed on before data port\n",
|
||||
__func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
rc = msm_vidc_check_session_supported(inst);
|
||||
|
@@ -443,9 +443,6 @@ u32 msm_vidc_encoder_input_meta_size(struct msm_vidc_inst *inst)
|
||||
|
||||
size = MSM_VIDC_METADATA_SIZE;
|
||||
|
||||
if (inst->capabilities->cap[INPUT_META_VIA_REQUEST].value)
|
||||
return ENCODE_INPUT_METADATA_SIZE;
|
||||
|
||||
if (inst->capabilities->cap[META_ROI_INFO].value) {
|
||||
lcu_size = 16;
|
||||
|
||||
|
@@ -1132,25 +1132,6 @@ int msm_v4l2_op_s_ctrl(struct v4l2_ctrl *ctrl)
|
||||
goto unlock;
|
||||
}
|
||||
|
||||
if (cap_id == INPUT_METADATA_FD) {
|
||||
if (ctrl->val == INVALID_FD || ctrl->val == INT_MAX) {
|
||||
i_vpr_e(inst,
|
||||
"%s: client configured invalid input metadata fd %d\n",
|
||||
__func__, ctrl->val);
|
||||
rc = 0;
|
||||
goto unlock;
|
||||
}
|
||||
if (!capability->cap[INPUT_META_VIA_REQUEST].value) {
|
||||
i_vpr_e(inst,
|
||||
"%s: input metadata not enabled via request\n", __func__);
|
||||
rc = -EINVAL;
|
||||
goto unlock;
|
||||
}
|
||||
rc = msm_vidc_create_input_metadata_buffer(inst, ctrl->val);
|
||||
if (rc)
|
||||
goto unlock;
|
||||
}
|
||||
|
||||
/* mark client set flag */
|
||||
capability->cap[cap_id].flags |= CAP_FLAG_CLIENT_SET;
|
||||
|
||||
|
@@ -184,8 +184,6 @@ static const struct msm_vidc_cap_name cap_name_arr[] = {
|
||||
{FILM_GRAIN, "FILM_GRAIN" },
|
||||
{SUPER_BLOCK, "SUPER_BLOCK" },
|
||||
{DRAP, "DRAP" },
|
||||
{INPUT_METADATA_FD, "INPUT_METADATA_FD" },
|
||||
{INPUT_META_VIA_REQUEST, "INPUT_META_VIA_REQUEST" },
|
||||
{ENC_IP_CR, "ENC_IP_CR" },
|
||||
{COMPLEXITY, "COMPLEXITY" },
|
||||
{CABAC_MAX_BITRATE, "CABAC_MAX_BITRATE" },
|
||||
@@ -4129,14 +4127,6 @@ int msm_vidc_vb2_buffer_done(struct msm_vidc_inst *inst,
|
||||
if (port < 0)
|
||||
return -EINVAL;
|
||||
|
||||
/*
|
||||
* vb2_buffer_done not required if input metadata
|
||||
* buffer sent via request api
|
||||
*/
|
||||
if (buf->type == MSM_VIDC_BUF_INPUT_META &&
|
||||
inst->capabilities->cap[INPUT_META_VIA_REQUEST].value)
|
||||
return 0;
|
||||
|
||||
q = inst->bufq[port].vb2q;
|
||||
if (!q->streaming) {
|
||||
i_vpr_e(inst, "%s: port %d is not streaming\n",
|
||||
@@ -6780,94 +6770,3 @@ int msm_vidc_get_properties(struct msm_vidc_inst *inst)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int msm_vidc_create_input_metadata_buffer(struct msm_vidc_inst *inst, int fd)
|
||||
{
|
||||
int rc = 0;
|
||||
struct msm_vidc_buffer *buf = NULL;
|
||||
struct msm_vidc_buffers *buffers;
|
||||
struct dma_buf *dma_buf;
|
||||
|
||||
if (!inst) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (fd < 0) {
|
||||
i_vpr_e(inst, "%s: invalid input metadata buffer fd %d\n",
|
||||
__func__, fd);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
buffers = msm_vidc_get_buffers(inst, MSM_VIDC_BUF_INPUT_META, __func__);
|
||||
if (!buffers)
|
||||
return -EINVAL;
|
||||
|
||||
buf = msm_memory_pool_alloc(inst, MSM_MEM_POOL_BUFFER);
|
||||
if (!buf) {
|
||||
i_vpr_e(inst, "%s: buffer pool alloc failed\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
INIT_LIST_HEAD(&buf->list);
|
||||
buf->type = MSM_VIDC_BUF_INPUT_META;
|
||||
buf->index = INT_MAX;
|
||||
buf->fd = fd;
|
||||
dma_buf = msm_vidc_memory_get_dmabuf(inst, fd);
|
||||
if (!dma_buf) {
|
||||
rc = -ENOMEM;
|
||||
goto error_dma_buf;
|
||||
}
|
||||
buf->dmabuf = dma_buf;
|
||||
buf->data_size = dma_buf->size;
|
||||
buf->buffer_size = dma_buf->size;
|
||||
buf->attr |= MSM_VIDC_ATTR_DEFERRED;
|
||||
|
||||
rc = msm_vidc_map_driver_buf(inst, buf);
|
||||
if (rc)
|
||||
goto error_map;
|
||||
|
||||
list_add_tail(&buf->list, &buffers->list);
|
||||
return rc;
|
||||
|
||||
error_map:
|
||||
msm_vidc_memory_put_dmabuf(inst, buf->dmabuf);
|
||||
error_dma_buf:
|
||||
msm_memory_pool_free(inst, buf);
|
||||
return rc;
|
||||
}
|
||||
|
||||
int msm_vidc_update_input_meta_buffer_index(struct msm_vidc_inst *inst,
|
||||
struct vb2_buffer *vb2)
|
||||
{
|
||||
int rc = 0;
|
||||
bool found = false;
|
||||
struct msm_vidc_buffer *buf = NULL;
|
||||
struct msm_vidc_buffers *buffers;
|
||||
|
||||
if (!inst || !vb2) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (vb2->type != INPUT_MPLANE)
|
||||
return 0;
|
||||
|
||||
buffers = msm_vidc_get_buffers(inst, MSM_VIDC_BUF_INPUT_META, __func__);
|
||||
if (!buffers)
|
||||
return -EINVAL;
|
||||
list_for_each_entry(buf, &buffers->list, list) {
|
||||
if (buf->index == INT_MAX) {
|
||||
buf->index = vb2->index;
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!found) {
|
||||
i_vpr_e(inst, "%s: missing input metabuffer for index %d\n",
|
||||
__func__, vb2->index);
|
||||
rc = -EINVAL;
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
@@ -217,15 +217,6 @@ int msm_vidc_start_streaming(struct vb2_queue *q, unsigned int count)
|
||||
goto unlock;
|
||||
}
|
||||
|
||||
if (q->type == INPUT_META_PLANE &&
|
||||
inst->capabilities->cap[INPUT_META_VIA_REQUEST].value) {
|
||||
i_vpr_e(inst,
|
||||
"%s: invalid input meta port start when request enabled\n",
|
||||
__func__);
|
||||
rc = -EINVAL;
|
||||
goto unlock;
|
||||
}
|
||||
|
||||
if (q->type == INPUT_META_PLANE || q->type == OUTPUT_META_PLANE) {
|
||||
i_vpr_h(inst, "%s: nothing to start on %s\n",
|
||||
__func__, v4l2_type_name(q->type));
|
||||
@@ -509,12 +500,6 @@ void msm_vidc_buf_queue(struct vb2_buffer *vb2)
|
||||
goto unlock;
|
||||
}
|
||||
|
||||
if (inst->capabilities->cap[INPUT_META_VIA_REQUEST].value) {
|
||||
rc = msm_vidc_update_input_meta_buffer_index(inst, vb2);
|
||||
if (rc)
|
||||
goto unlock;
|
||||
}
|
||||
|
||||
if (is_decode_session(inst))
|
||||
rc = msm_vdec_qbuf(inst, vb2);
|
||||
else if (is_encode_session(inst))
|
||||
|
@@ -218,12 +218,6 @@ enum v4l2_mpeg_video_av1_tier {
|
||||
/* AV1 Decoder Film Grain */
|
||||
#define V4L2_CID_MPEG_VIDC_AV1D_FILM_GRAIN_PRESENT \
|
||||
(V4L2_CID_MPEG_VIDC_BASE + 0x35)
|
||||
/* Control to set input metadata buffer fd */
|
||||
#define V4L2_CID_MPEG_VIDC_INPUT_METADATA_FD \
|
||||
(V4L2_CID_MPEG_VIDC_BASE + 0x36)
|
||||
/* Control to enable input metadata via request api */
|
||||
#define V4L2_CID_MPEG_VIDC_INPUT_METADATA_VIA_REQUEST_ENABLE \
|
||||
(V4L2_CID_MPEG_VIDC_BASE + 0x37)
|
||||
/* Enables Output buffer fence id via input metadata */
|
||||
#define V4L2_CID_MPEG_VIDC_METADATA_OUTBUF_FENCE \
|
||||
(V4L2_CID_MPEG_VIDC_BASE + 0x38)
|
||||
|
Reference in New Issue
Block a user