* [PATCH] venus: venc: Fix h264 8x8 transform control
@ 2022-02-08 15:52 Stanimir Varbanov
2022-02-10 19:36 ` Fritz Koenig
0 siblings, 1 reply; 2+ messages in thread
From: Stanimir Varbanov @ 2022-02-08 15:52 UTC (permalink / raw)
To: linux-media, linux-arm-msm; +Cc: Vikash Garodia, dikshita, Stanimir Varbanov
During encoder driver open controls are initialized via a call
to v4l2_ctrl_handler_setup which returns EINVAL error for
V4L2_CID_MPEG_VIDEO_H264_8X8_TRANSFORM v4l2 control. The control
default value is disabled and because of firmware limitations
8x8 transform cannot be disabled for the supported HIGH and
CONSTRAINED_HIGH profiles.
To fix the issue change the control default value to enabled
(this is fine because the firmware enables 8x8 transform for
high and constrained_high profiles by default). Also, correct
the checking of profile ids in s_ctrl from hfi to v4l2 ids.
Fixes: bfee75f73c37 ("media: venus: venc: add support for V4L2_CID_MPEG_VIDEO_H264_8X8_TRANSFORM control")
Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
---
drivers/media/platform/qcom/venus/venc.c | 4 ++--
drivers/media/platform/qcom/venus/venc_ctrls.c | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c
index 84bafc3118cc..adea4c3b8c20 100644
--- a/drivers/media/platform/qcom/venus/venc.c
+++ b/drivers/media/platform/qcom/venus/venc.c
@@ -662,8 +662,8 @@ static int venc_set_properties(struct venus_inst *inst)
ptype = HFI_PROPERTY_PARAM_VENC_H264_TRANSFORM_8X8;
h264_transform.enable_type = 0;
- if (ctr->profile.h264 == HFI_H264_PROFILE_HIGH ||
- ctr->profile.h264 == HFI_H264_PROFILE_CONSTRAINED_HIGH)
+ if (ctr->profile.h264 == V4L2_MPEG_VIDEO_H264_PROFILE_HIGH ||
+ ctr->profile.h264 == V4L2_MPEG_VIDEO_H264_PROFILE_CONSTRAINED_HIGH)
h264_transform.enable_type = ctr->h264_8x8_transform;
ret = hfi_session_set_property(inst, ptype, &h264_transform);
diff --git a/drivers/media/platform/qcom/venus/venc_ctrls.c b/drivers/media/platform/qcom/venus/venc_ctrls.c
index 1ada42df314d..ea5805e71c14 100644
--- a/drivers/media/platform/qcom/venus/venc_ctrls.c
+++ b/drivers/media/platform/qcom/venus/venc_ctrls.c
@@ -320,8 +320,8 @@ static int venc_op_s_ctrl(struct v4l2_ctrl *ctrl)
ctr->intra_refresh_period = ctrl->val;
break;
case V4L2_CID_MPEG_VIDEO_H264_8X8_TRANSFORM:
- if (ctr->profile.h264 != HFI_H264_PROFILE_HIGH &&
- ctr->profile.h264 != HFI_H264_PROFILE_CONSTRAINED_HIGH)
+ if (ctr->profile.h264 != V4L2_MPEG_VIDEO_H264_PROFILE_HIGH &&
+ ctr->profile.h264 != V4L2_MPEG_VIDEO_H264_PROFILE_CONSTRAINED_HIGH)
return -EINVAL;
/*
@@ -457,7 +457,7 @@ int venc_ctrl_init(struct venus_inst *inst)
V4L2_CID_MPEG_VIDEO_H264_I_FRAME_MIN_QP, 1, 51, 1, 1);
v4l2_ctrl_new_std(&inst->ctrl_handler, &venc_ctrl_ops,
- V4L2_CID_MPEG_VIDEO_H264_8X8_TRANSFORM, 0, 1, 1, 0);
+ V4L2_CID_MPEG_VIDEO_H264_8X8_TRANSFORM, 0, 1, 1, 1);
v4l2_ctrl_new_std(&inst->ctrl_handler, &venc_ctrl_ops,
V4L2_CID_MPEG_VIDEO_H264_P_FRAME_MIN_QP, 1, 51, 1, 1);
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] venus: venc: Fix h264 8x8 transform control
2022-02-08 15:52 [PATCH] venus: venc: Fix h264 8x8 transform control Stanimir Varbanov
@ 2022-02-10 19:36 ` Fritz Koenig
0 siblings, 0 replies; 2+ messages in thread
From: Fritz Koenig @ 2022-02-10 19:36 UTC (permalink / raw)
To: Stanimir Varbanov
Cc: Linux Media Mailing List, linux-arm-msm, Vikash Garodia,
Dikshita Agarwal
On Tue, Feb 8, 2022 at 10:52 AM Stanimir Varbanov
<stanimir.varbanov@linaro.org> wrote:
>
> During encoder driver open controls are initialized via a call
> to v4l2_ctrl_handler_setup which returns EINVAL error for
> V4L2_CID_MPEG_VIDEO_H264_8X8_TRANSFORM v4l2 control. The control
> default value is disabled and because of firmware limitations
> 8x8 transform cannot be disabled for the supported HIGH and
> CONSTRAINED_HIGH profiles.
>
> To fix the issue change the control default value to enabled
> (this is fine because the firmware enables 8x8 transform for
> high and constrained_high profiles by default). Also, correct
> the checking of profile ids in s_ctrl from hfi to v4l2 ids.
>
> Fixes: bfee75f73c37 ("media: venus: venc: add support for V4L2_CID_MPEG_VIDEO_H264_8X8_TRANSFORM control")
> Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
> ---
> drivers/media/platform/qcom/venus/venc.c | 4 ++--
> drivers/media/platform/qcom/venus/venc_ctrls.c | 6 +++---
> 2 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c
> index 84bafc3118cc..adea4c3b8c20 100644
> --- a/drivers/media/platform/qcom/venus/venc.c
> +++ b/drivers/media/platform/qcom/venus/venc.c
> @@ -662,8 +662,8 @@ static int venc_set_properties(struct venus_inst *inst)
>
> ptype = HFI_PROPERTY_PARAM_VENC_H264_TRANSFORM_8X8;
> h264_transform.enable_type = 0;
> - if (ctr->profile.h264 == HFI_H264_PROFILE_HIGH ||
> - ctr->profile.h264 == HFI_H264_PROFILE_CONSTRAINED_HIGH)
> + if (ctr->profile.h264 == V4L2_MPEG_VIDEO_H264_PROFILE_HIGH ||
> + ctr->profile.h264 == V4L2_MPEG_VIDEO_H264_PROFILE_CONSTRAINED_HIGH)
> h264_transform.enable_type = ctr->h264_8x8_transform;
>
> ret = hfi_session_set_property(inst, ptype, &h264_transform);
> diff --git a/drivers/media/platform/qcom/venus/venc_ctrls.c b/drivers/media/platform/qcom/venus/venc_ctrls.c
> index 1ada42df314d..ea5805e71c14 100644
> --- a/drivers/media/platform/qcom/venus/venc_ctrls.c
> +++ b/drivers/media/platform/qcom/venus/venc_ctrls.c
> @@ -320,8 +320,8 @@ static int venc_op_s_ctrl(struct v4l2_ctrl *ctrl)
> ctr->intra_refresh_period = ctrl->val;
> break;
> case V4L2_CID_MPEG_VIDEO_H264_8X8_TRANSFORM:
> - if (ctr->profile.h264 != HFI_H264_PROFILE_HIGH &&
> - ctr->profile.h264 != HFI_H264_PROFILE_CONSTRAINED_HIGH)
> + if (ctr->profile.h264 != V4L2_MPEG_VIDEO_H264_PROFILE_HIGH &&
> + ctr->profile.h264 != V4L2_MPEG_VIDEO_H264_PROFILE_CONSTRAINED_HIGH)
> return -EINVAL;
>
> /*
> @@ -457,7 +457,7 @@ int venc_ctrl_init(struct venus_inst *inst)
> V4L2_CID_MPEG_VIDEO_H264_I_FRAME_MIN_QP, 1, 51, 1, 1);
>
> v4l2_ctrl_new_std(&inst->ctrl_handler, &venc_ctrl_ops,
> - V4L2_CID_MPEG_VIDEO_H264_8X8_TRANSFORM, 0, 1, 1, 0);
> + V4L2_CID_MPEG_VIDEO_H264_8X8_TRANSFORM, 0, 1, 1, 1);
>
> v4l2_ctrl_new_std(&inst->ctrl_handler, &venc_ctrl_ops,
> V4L2_CID_MPEG_VIDEO_H264_P_FRAME_MIN_QP, 1, 51, 1, 1);
> --
> 2.25.1
>
Tested-by: Fritz Koenig <frkoenig@chromium.org>
Reviewed-by: Fritz Koenig <frkoenig@chromium.org>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-02-10 19:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-08 15:52 [PATCH] venus: venc: Fix h264 8x8 transform control Stanimir Varbanov
2022-02-10 19:36 ` Fritz Koenig
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.