Merge "video: driver: encoder delay start: CSC"
这个提交包含在:
@@ -16,5 +16,6 @@ int msm_vidc_set_ir_period(void *instance,
|
||||
enum msm_vidc_inst_capability_type cap_id);
|
||||
int msm_vidc_set_signal_color_info(void *instance,
|
||||
enum msm_vidc_inst_capability_type cap_id);
|
||||
int msm_vidc_adjust_csc(void *instance, struct v4l2_ctrl *ctrl);
|
||||
|
||||
#endif
|
||||
|
@@ -277,3 +277,33 @@ int msm_vidc_set_signal_color_info(void *instance,
|
||||
return rc;
|
||||
}
|
||||
|
||||
int msm_vidc_adjust_csc(void *instance, struct v4l2_ctrl *ctrl)
|
||||
{
|
||||
struct msm_vidc_inst_capability *capability;
|
||||
s32 adjusted_value;
|
||||
s32 pix_fmt = -1;
|
||||
struct msm_vidc_inst *inst = (struct msm_vidc_inst *) instance;
|
||||
|
||||
if (!inst || !inst->capabilities) {
|
||||
d_vpr_e("%s: invalid params\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
capability = inst->capabilities;
|
||||
|
||||
if (is_decode_session(inst))
|
||||
return 0;
|
||||
|
||||
adjusted_value = ctrl ? ctrl->val : capability->cap[CSC].value;
|
||||
|
||||
if (msm_vidc_get_parent_value(inst, CSC, PIX_FMTS,
|
||||
&pix_fmt, __func__))
|
||||
return -EINVAL;
|
||||
|
||||
/* disable csc for 10-bit encoding */
|
||||
if (is_10bit_colorformat(pix_fmt))
|
||||
adjusted_value = 0;
|
||||
|
||||
msm_vidc_update_cap_value(inst, CSC, adjusted_value, __func__);
|
||||
|
||||
return 0;
|
||||
}
|
@@ -782,7 +782,7 @@ static struct msm_platform_inst_capability instance_cap_data_kalama[] = {
|
||||
|
||||
{CSC, ENC, CODECS_ALL,
|
||||
0, 1, 1, 0,
|
||||
0,
|
||||
V4L2_CID_MPEG_VIDC_CSC,
|
||||
HFI_PROP_CSC},
|
||||
|
||||
{CSC_CUSTOM_MATRIX, ENC, CODECS_ALL,
|
||||
|
@@ -852,7 +852,7 @@ static struct msm_platform_inst_capability instance_cap_data_pineapple[] = {
|
||||
|
||||
{CSC, ENC, CODECS_ALL,
|
||||
0, 1, 1, 0,
|
||||
0,
|
||||
V4L2_CID_MPEG_VIDC_CSC,
|
||||
HFI_PROP_CSC},
|
||||
|
||||
{CSC_CUSTOM_MATRIX, ENC, CODECS_ALL,
|
||||
@@ -2024,15 +2024,15 @@ static struct msm_platform_inst_cap_dependency instance_cap_dependency_data_pine
|
||||
*/
|
||||
|
||||
{PIX_FMTS, ENC, H264,
|
||||
{META_ROI_INFO, IR_PERIOD}},
|
||||
{META_ROI_INFO, IR_PERIOD, CSC}},
|
||||
|
||||
{PIX_FMTS, ENC, HEVC,
|
||||
{PROFILE, MIN_FRAME_QP, MAX_FRAME_QP, I_FRAME_QP, P_FRAME_QP,
|
||||
B_FRAME_QP, META_ROI_INFO, MIN_QUALITY, BLUR_TYPES, IR_PERIOD,
|
||||
LTR_COUNT}},
|
||||
LTR_COUNT, CSC}},
|
||||
|
||||
{PIX_FMTS, ENC, HEIC,
|
||||
{PROFILE}},
|
||||
{PROFILE, CSC}},
|
||||
|
||||
{PIX_FMTS, DEC, HEVC|HEIC,
|
||||
{PROFILE}},
|
||||
@@ -2183,6 +2183,11 @@ static struct msm_platform_inst_cap_dependency instance_cap_dependency_data_pine
|
||||
msm_vidc_adjust_blur_resolution,
|
||||
msm_vidc_set_blur_resolution},
|
||||
|
||||
{CSC, ENC, CODECS_ALL,
|
||||
{0},
|
||||
msm_vidc_adjust_csc,
|
||||
msm_vidc_set_u32},
|
||||
|
||||
{CSC_CUSTOM_MATRIX, ENC, CODECS_ALL,
|
||||
{0},
|
||||
NULL,
|
||||
|
@@ -386,19 +386,6 @@ static int msm_venc_set_colorspace(struct msm_vidc_inst* inst,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static bool msm_venc_csc_required(struct msm_vidc_inst* inst)
|
||||
{
|
||||
struct v4l2_format *in_fmt = &inst->fmts[INPUT_PORT];
|
||||
struct v4l2_format *out_fmt = &inst->fmts[OUTPUT_PORT];
|
||||
|
||||
/* video hardware supports conversion to REC709 CSC only */
|
||||
if (in_fmt->fmt.pix_mp.colorspace != out_fmt->fmt.pix_mp.colorspace &&
|
||||
out_fmt->fmt.pix_mp.colorspace == V4L2_COLORSPACE_REC709)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static int msm_venc_set_csc(struct msm_vidc_inst* inst,
|
||||
enum msm_vidc_port_type port)
|
||||
{
|
||||
@@ -410,9 +397,6 @@ static int msm_venc_set_csc(struct msm_vidc_inst* inst,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
msm_vidc_update_cap_value(inst, CSC,
|
||||
msm_venc_csc_required(inst) ? 1 : 0, __func__);
|
||||
|
||||
csc = inst->capabilities->cap[CSC].value;
|
||||
i_vpr_h(inst, "%s: csc: %u\n", __func__, csc);
|
||||
rc = venus_hfi_session_property(inst,
|
||||
|
在新工单中引用
屏蔽一个用户