* [PATCH v2] venus: venc: Fix setting of profile and level
@ 2020-10-27 9:19 Stanimir Varbanov
2020-10-29 20:31 ` Steev Klimaszewski
2020-12-29 20:15 ` patchwork-bot+linux-arm-msm
0 siblings, 2 replies; 3+ messages in thread
From: Stanimir Varbanov @ 2020-10-27 9:19 UTC (permalink / raw)
To: linux-media, linux-arm-msm, linux-kernel; +Cc: Stanimir Varbanov
The profile and level in op_set_ctrl was recently changed but during
v4l2_ctrl_handler_setup profile and level control values are mangled.
Fixes: 435c53c3698f ("media: venus: venc: Use helper to set profile and level")
Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
---
v2: Fixed kernel test robot WARNING
drivers/media/platform/qcom/venus/core.h | 15 +++++++--
drivers/media/platform/qcom/venus/venc.c | 31 ++++++++++++++++++-
.../media/platform/qcom/venus/venc_ctrls.c | 14 +++++++--
3 files changed, 55 insertions(+), 5 deletions(-)
diff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platform/qcom/venus/core.h
index 7b79a33dc9d6..05c9fbd51f0c 100644
--- a/drivers/media/platform/qcom/venus/core.h
+++ b/drivers/media/platform/qcom/venus/core.h
@@ -243,8 +243,19 @@ struct venc_controls {
u32 header_mode;
- u32 profile;
- u32 level;
+ struct {
+ u32 h264;
+ u32 mpeg4;
+ u32 hevc;
+ u32 vp8;
+ u32 vp9;
+ } profile;
+ struct {
+ u32 h264;
+ u32 mpeg4;
+ u32 hevc;
+ u32 vp9;
+ } level;
};
struct venus_buffer {
diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c
index f8b1484e7dcd..47246528ac7e 100644
--- a/drivers/media/platform/qcom/venus/venc.c
+++ b/drivers/media/platform/qcom/venus/venc.c
@@ -537,6 +537,7 @@ static int venc_set_properties(struct venus_inst *inst)
struct hfi_quantization quant;
struct hfi_quantization_range quant_range;
u32 ptype, rate_control, bitrate;
+ u32 profile, level;
int ret;
ret = venus_helper_set_work_mode(inst, VIDC_WORK_MODE_2);
@@ -684,7 +685,35 @@ static int venc_set_properties(struct venus_inst *inst)
if (ret)
return ret;
- ret = venus_helper_set_profile_level(inst, ctr->profile, ctr->level);
+ switch (inst->hfi_codec) {
+ case HFI_VIDEO_CODEC_H264:
+ profile = ctr->profile.h264;
+ level = ctr->level.h264;
+ break;
+ case HFI_VIDEO_CODEC_MPEG4:
+ profile = ctr->profile.mpeg4;
+ level = ctr->level.mpeg4;
+ break;
+ case HFI_VIDEO_CODEC_VP8:
+ profile = ctr->profile.vp8;
+ level = 0;
+ break;
+ case HFI_VIDEO_CODEC_VP9:
+ profile = ctr->profile.vp9;
+ level = ctr->level.vp9;
+ break;
+ case HFI_VIDEO_CODEC_HEVC:
+ profile = ctr->profile.hevc;
+ level = ctr->level.hevc;
+ break;
+ case HFI_VIDEO_CODEC_MPEG2:
+ default:
+ profile = 0;
+ level = 0;
+ break;
+ }
+
+ ret = venus_helper_set_profile_level(inst, profile, level);
if (ret)
return ret;
diff --git a/drivers/media/platform/qcom/venus/venc_ctrls.c b/drivers/media/platform/qcom/venus/venc_ctrls.c
index 0708b3b89d0c..cf860e6446c0 100644
--- a/drivers/media/platform/qcom/venus/venc_ctrls.c
+++ b/drivers/media/platform/qcom/venus/venc_ctrls.c
@@ -103,15 +103,25 @@ static int venc_op_s_ctrl(struct v4l2_ctrl *ctrl)
ctr->h264_entropy_mode = ctrl->val;
break;
case V4L2_CID_MPEG_VIDEO_MPEG4_PROFILE:
+ ctr->profile.mpeg4 = ctrl->val;
+ break;
case V4L2_CID_MPEG_VIDEO_H264_PROFILE:
+ ctr->profile.h264 = ctrl->val;
+ break;
case V4L2_CID_MPEG_VIDEO_HEVC_PROFILE:
+ ctr->profile.hevc = ctrl->val;
+ break;
case V4L2_CID_MPEG_VIDEO_VP8_PROFILE:
- ctr->profile = ctrl->val;
+ ctr->profile.vp8 = ctrl->val;
break;
case V4L2_CID_MPEG_VIDEO_MPEG4_LEVEL:
+ ctr->level.mpeg4 = ctrl->val;
+ break;
case V4L2_CID_MPEG_VIDEO_H264_LEVEL:
+ ctr->level.h264 = ctrl->val;
+ break;
case V4L2_CID_MPEG_VIDEO_HEVC_LEVEL:
- ctr->level = ctrl->val;
+ ctr->level.hevc = ctrl->val;
break;
case V4L2_CID_MPEG_VIDEO_H264_I_FRAME_QP:
ctr->h264_i_qp = ctrl->val;
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] venus: venc: Fix setting of profile and level
2020-10-27 9:19 [PATCH v2] venus: venc: Fix setting of profile and level Stanimir Varbanov
@ 2020-10-29 20:31 ` Steev Klimaszewski
2020-12-29 20:15 ` patchwork-bot+linux-arm-msm
1 sibling, 0 replies; 3+ messages in thread
From: Steev Klimaszewski @ 2020-10-29 20:31 UTC (permalink / raw)
To: Stanimir Varbanov, linux-media, linux-arm-msm, linux-kernel
On 10/27/20 4:19 AM, Stanimir Varbanov wrote:
> The profile and level in op_set_ctrl was recently changed but during
> v4l2_ctrl_handler_setup profile and level control values are mangled.
>
> Fixes: 435c53c3698f ("media: venus: venc: Use helper to set profile and level")
> Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
> ---
>
> v2: Fixed kernel test robot WARNING
>
> drivers/media/platform/qcom/venus/core.h | 15 +++++++--
> drivers/media/platform/qcom/venus/venc.c | 31 ++++++++++++++++++-
> .../media/platform/qcom/venus/venc_ctrls.c | 14 +++++++--
> 3 files changed, 55 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platform/qcom/venus/core.h
> index 7b79a33dc9d6..05c9fbd51f0c 100644
> --- a/drivers/media/platform/qcom/venus/core.h
> +++ b/drivers/media/platform/qcom/venus/core.h
> @@ -243,8 +243,19 @@ struct venc_controls {
>
> u32 header_mode;
>
> - u32 profile;
> - u32 level;
> + struct {
> + u32 h264;
> + u32 mpeg4;
> + u32 hevc;
> + u32 vp8;
> + u32 vp9;
> + } profile;
> + struct {
> + u32 h264;
> + u32 mpeg4;
> + u32 hevc;
> + u32 vp9;
> + } level;
> };
>
> struct venus_buffer {
> diff --git a/drivers/media/platform/qcom/venus/venc.c b/drivers/media/platform/qcom/venus/venc.c
> index f8b1484e7dcd..47246528ac7e 100644
> --- a/drivers/media/platform/qcom/venus/venc.c
> +++ b/drivers/media/platform/qcom/venus/venc.c
> @@ -537,6 +537,7 @@ static int venc_set_properties(struct venus_inst *inst)
> struct hfi_quantization quant;
> struct hfi_quantization_range quant_range;
> u32 ptype, rate_control, bitrate;
> + u32 profile, level;
> int ret;
>
> ret = venus_helper_set_work_mode(inst, VIDC_WORK_MODE_2);
> @@ -684,7 +685,35 @@ static int venc_set_properties(struct venus_inst *inst)
> if (ret)
> return ret;
>
> - ret = venus_helper_set_profile_level(inst, ctr->profile, ctr->level);
> + switch (inst->hfi_codec) {
> + case HFI_VIDEO_CODEC_H264:
> + profile = ctr->profile.h264;
> + level = ctr->level.h264;
> + break;
> + case HFI_VIDEO_CODEC_MPEG4:
> + profile = ctr->profile.mpeg4;
> + level = ctr->level.mpeg4;
> + break;
> + case HFI_VIDEO_CODEC_VP8:
> + profile = ctr->profile.vp8;
> + level = 0;
> + break;
> + case HFI_VIDEO_CODEC_VP9:
> + profile = ctr->profile.vp9;
> + level = ctr->level.vp9;
> + break;
> + case HFI_VIDEO_CODEC_HEVC:
> + profile = ctr->profile.hevc;
> + level = ctr->level.hevc;
> + break;
> + case HFI_VIDEO_CODEC_MPEG2:
> + default:
> + profile = 0;
> + level = 0;
> + break;
> + }
> +
> + ret = venus_helper_set_profile_level(inst, profile, level);
> if (ret)
> return ret;
>
> diff --git a/drivers/media/platform/qcom/venus/venc_ctrls.c b/drivers/media/platform/qcom/venus/venc_ctrls.c
> index 0708b3b89d0c..cf860e6446c0 100644
> --- a/drivers/media/platform/qcom/venus/venc_ctrls.c
> +++ b/drivers/media/platform/qcom/venus/venc_ctrls.c
> @@ -103,15 +103,25 @@ static int venc_op_s_ctrl(struct v4l2_ctrl *ctrl)
> ctr->h264_entropy_mode = ctrl->val;
> break;
> case V4L2_CID_MPEG_VIDEO_MPEG4_PROFILE:
> + ctr->profile.mpeg4 = ctrl->val;
> + break;
> case V4L2_CID_MPEG_VIDEO_H264_PROFILE:
> + ctr->profile.h264 = ctrl->val;
> + break;
> case V4L2_CID_MPEG_VIDEO_HEVC_PROFILE:
> + ctr->profile.hevc = ctrl->val;
> + break;
> case V4L2_CID_MPEG_VIDEO_VP8_PROFILE:
> - ctr->profile = ctrl->val;
> + ctr->profile.vp8 = ctrl->val;
> break;
> case V4L2_CID_MPEG_VIDEO_MPEG4_LEVEL:
> + ctr->level.mpeg4 = ctrl->val;
> + break;
> case V4L2_CID_MPEG_VIDEO_H264_LEVEL:
> + ctr->level.h264 = ctrl->val;
> + break;
> case V4L2_CID_MPEG_VIDEO_HEVC_LEVEL:
> - ctr->level = ctrl->val;
> + ctr->level.hevc = ctrl->val;
> break;
> case V4L2_CID_MPEG_VIDEO_H264_I_FRAME_QP:
> ctr->h264_i_qp = ctrl->val;
Hi Stanimir,
When I apply this patch on top of my 5.10rc1 tree - (
https://github.com/steev/linux/commits/c630-5.10-rc1... my c630 no
longer boots. Unfortunately... nothing shows up in the logs, and I have
no idea how to get debug output from the c630.
-- Steev
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] venus: venc: Fix setting of profile and level
2020-10-27 9:19 [PATCH v2] venus: venc: Fix setting of profile and level Stanimir Varbanov
2020-10-29 20:31 ` Steev Klimaszewski
@ 2020-12-29 20:15 ` patchwork-bot+linux-arm-msm
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+linux-arm-msm @ 2020-12-29 20:15 UTC (permalink / raw)
To: Stanimir Varbanov; +Cc: linux-arm-msm
Hello:
This patch was applied to qcom/linux.git (refs/heads/for-next):
On Tue, 27 Oct 2020 11:19:36 +0200 you wrote:
> The profile and level in op_set_ctrl was recently changed but during
> v4l2_ctrl_handler_setup profile and level control values are mangled.
>
> Fixes: 435c53c3698f ("media: venus: venc: Use helper to set profile and level")
> Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
> ---
>
> [...]
Here is the summary with links:
- [v2] venus: venc: Fix setting of profile and level
https://git.kernel.org/qcom/c/a7a20f721e81
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-12-29 20:18 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-27 9:19 [PATCH v2] venus: venc: Fix setting of profile and level Stanimir Varbanov
2020-10-29 20:31 ` Steev Klimaszewski
2020-12-29 20:15 ` patchwork-bot+linux-arm-msm
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).