[PATCH v4 9/9] media: qcom: venus: Enable HEVC decoding for MSM8939

Erikas Bitovtas
2026-05-05T21:46:33Z

MSM8939 supports HEVC decoding. Do not disable the HEVC codec HFI bit
and add it to codec type converter method so it can be recognized.

Signed-off-by: Erikas Bitovtas <xerikasxx@gmail.com>
---
drivers/media/platform/qcom/venus/core.c | 2 ++
drivers/media/platform/qcom/venus/hfi_parser.c | 3 ++-
2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c
index 1871cf3830ac..eda6b19708ab 100644
--- a/drivers/media/platform/qcom/venus/core.c
+++ b/drivers/media/platform/qcom/venus/core.c
@@ -178,6 +178,8 @@ static void venus_sys_error_handler(struct work_struct *work)
static u32 to_v4l2_codec_type(u32 codec)
{
switch (codec) {
+ case HFI_VIDEO_CODEC_HEVC:
+ return V4L2_PIX_FMT_HEVC;
case HFI_VIDEO_CODEC_H264:
return V4L2_PIX_FMT_H264;
case HFI_VIDEO_CODEC_H263:
diff --git a/drivers/media/platform/qcom/venus/hfi_parser.c b/drivers/media/platform/qcom/venus/hfi_parser.c
index 92765f9c8873..178274d10c02 100644
--- a/drivers/media/platform/qcom/venus/hfi_parser.c
+++ b/drivers/media/platform/qcom/venus/hfi_parser.c
@@ -207,7 +207,8 @@ static int parse_codecs(struct venus_core *core, void *data)
core->enc_codecs = codecs->enc_codecs;

if (IS_V1(core)) {
- core->dec_codecs &= ~HFI_VIDEO_CODEC_HEVC;
+ if (!device_is_compatible(core->dev, "qcom,msm8939-venus"))
+ core->dec_codecs &= ~HFI_VIDEO_CODEC_HEVC;
core->dec_codecs &= ~HFI_VIDEO_CODEC_SPARK;
core->enc_codecs &= ~HFI_VIDEO_CODEC_HEVC;
}

--
2.54.0