Message ID | 20220712122347.6781-1-quic_vboma@quicinc.com |
---|---|
State | New |
Headers | show |
Series | [1/7] venus : Add default values for the control V4L2_CID_COLORIMETRY_HDR10_MASTERING_DISPLAY | expand |
On 7/12/22 16:34, Nicolas Dufresne wrote: > Le mardi 12 juillet 2022 à 17:53 +0530, Viswanath Boma a écrit : >> From: Stanimir Varbanov <stanimir.varbanov@linaro.org> >> >> V4l2 encoder compliance expecting default values of colormetry for the control. > > nit: colormetry -> colorimetry > >> >> Change-Id: I1db0d4940b54e033d646ce39d60dc488afba8d58 >> Signed-off-by: Viswanath Boma <quic_vboma@quicinc.com> >> --- >> drivers/media/platform/qcom/venus/venc_ctrls.c | 4 +++- >> 1 file changed, 3 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/media/platform/qcom/venus/venc_ctrls.c b/drivers/media/platform/qcom/venus/venc_ctrls.c >> index ea5805e71c143..37ba7d97f99b2 100644 >> --- a/drivers/media/platform/qcom/venus/venc_ctrls.c >> +++ b/drivers/media/platform/qcom/venus/venc_ctrls.c >> @@ -352,6 +352,8 @@ static const struct v4l2_ctrl_ops venc_ctrl_ops = { >> int venc_ctrl_init(struct venus_inst *inst) >> { >> int ret; >> + struct v4l2_ctrl_hdr10_mastering_display p_hdr10_mastering = { {34000, 13250, 7500 }, >> + { 16000, 34500, 3000 }, 15635, 16450, 10000000, 500 }; > > What is the origin of these values ? Should this be done in the control > framework instead ? We needed some safe default values to satisfy v4l2 control. I took the values from here [1]. I'm not sure do we need them in v4l2 control core (most probably it is a good to have it), Hans ? > >> >> ret = v4l2_ctrl_handler_init(&inst->ctrl_handler, 58); >> if (ret) >> @@ -580,7 +582,7 @@ int venc_ctrl_init(struct venus_inst *inst) >> >> v4l2_ctrl_new_std_compound(&inst->ctrl_handler, &venc_ctrl_ops, >> V4L2_CID_COLORIMETRY_HDR10_MASTERING_DISPLAY, >> - v4l2_ctrl_ptr_create(NULL)); >> + v4l2_ctrl_ptr_create((void *)&p_hdr10_mastering)); >> >> v4l2_ctrl_new_std(&inst->ctrl_handler, &venc_ctrl_ops, >> V4L2_CID_MPEG_VIDEO_INTRA_REFRESH_PERIOD, 0, >
Hi Viswanath, On 7/12/22 15:23, Viswanath Boma wrote: > From: Stanimir Varbanov <stanimir.varbanov@linaro.org> In fact this comes from you, please drop 'From'. > > V4l2 encoder compliance expecting default values of colormetry for the control. > > Change-Id: I1db0d4940b54e033d646ce39d60dc488afba8d58 Drop this. > Signed-off-by: Viswanath Boma <quic_vboma@quicinc.com> > --- > drivers/media/platform/qcom/venus/venc_ctrls.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/media/platform/qcom/venus/venc_ctrls.c b/drivers/media/platform/qcom/venus/venc_ctrls.c > index ea5805e71c143..37ba7d97f99b2 100644 > --- a/drivers/media/platform/qcom/venus/venc_ctrls.c > +++ b/drivers/media/platform/qcom/venus/venc_ctrls.c > @@ -352,6 +352,8 @@ static const struct v4l2_ctrl_ops venc_ctrl_ops = { > int venc_ctrl_init(struct venus_inst *inst) > { > int ret; > + struct v4l2_ctrl_hdr10_mastering_display p_hdr10_mastering = { {34000, 13250, 7500 }, > + { 16000, 34500, 3000 }, 15635, 16450, 10000000, 500 }; Please do this with proper indentation. > > ret = v4l2_ctrl_handler_init(&inst->ctrl_handler, 58); > if (ret) > @@ -580,7 +582,7 @@ int venc_ctrl_init(struct venus_inst *inst) > > v4l2_ctrl_new_std_compound(&inst->ctrl_handler, &venc_ctrl_ops, > V4L2_CID_COLORIMETRY_HDR10_MASTERING_DISPLAY, > - v4l2_ctrl_ptr_create(NULL)); > + v4l2_ctrl_ptr_create((void *)&p_hdr10_mastering)); I think you do not need to cast to (void *). > > v4l2_ctrl_new_std(&inst->ctrl_handler, &venc_ctrl_ops, > V4L2_CID_MPEG_VIDEO_INTRA_REFRESH_PERIOD, 0,
diff --git a/drivers/media/platform/qcom/venus/venc_ctrls.c b/drivers/media/platform/qcom/venus/venc_ctrls.c index ea5805e71c143..37ba7d97f99b2 100644 --- a/drivers/media/platform/qcom/venus/venc_ctrls.c +++ b/drivers/media/platform/qcom/venus/venc_ctrls.c @@ -352,6 +352,8 @@ static const struct v4l2_ctrl_ops venc_ctrl_ops = { int venc_ctrl_init(struct venus_inst *inst) { int ret; + struct v4l2_ctrl_hdr10_mastering_display p_hdr10_mastering = { {34000, 13250, 7500 }, + { 16000, 34500, 3000 }, 15635, 16450, 10000000, 500 }; ret = v4l2_ctrl_handler_init(&inst->ctrl_handler, 58); if (ret) @@ -580,7 +582,7 @@ int venc_ctrl_init(struct venus_inst *inst) v4l2_ctrl_new_std_compound(&inst->ctrl_handler, &venc_ctrl_ops, V4L2_CID_COLORIMETRY_HDR10_MASTERING_DISPLAY, - v4l2_ctrl_ptr_create(NULL)); + v4l2_ctrl_ptr_create((void *)&p_hdr10_mastering)); v4l2_ctrl_new_std(&inst->ctrl_handler, &venc_ctrl_ops, V4L2_CID_MPEG_VIDEO_INTRA_REFRESH_PERIOD, 0,