2023-05-22 07:00:19

by Dikshita Agarwal

[permalink] [raw]
Subject: [PATCH v2 1/4] venus: add support for V4L2_PIX_FMT_P010 color format

add V4L2_PIX_FMT_P010 as supported color format for decoder.

Reviewed-by: Konrad Dybcio <[email protected]>
Signed-off-by: Dikshita Agarwal <[email protected]>
---
drivers/media/platform/qcom/venus/core.h | 21 +++++++++++----------
drivers/media/platform/qcom/venus/helpers.c | 2 ++
drivers/media/platform/qcom/venus/vdec.c | 5 +++++
3 files changed, 18 insertions(+), 10 deletions(-)

diff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platform/qcom/venus/core.h
index e988ed4..250342d 100644
--- a/drivers/media/platform/qcom/venus/core.h
+++ b/drivers/media/platform/qcom/venus/core.h
@@ -87,16 +87,17 @@ enum venus_fmt {
VENUS_FMT_NV12 = 0,
VENUS_FMT_QC08C = 1,
VENUS_FMT_QC10C = 2,
- VENUS_FMT_H264 = 3,
- VENUS_FMT_VP8 = 4,
- VENUS_FMT_VP9 = 5,
- VENUS_FMT_HEVC = 6,
- VENUS_FMT_VC1_ANNEX_G = 7,
- VENUS_FMT_VC1_ANNEX_L = 8,
- VENUS_FMT_MPEG4 = 9,
- VENUS_FMT_MPEG2 = 10,
- VENUS_FMT_H263 = 11,
- VENUS_FMT_XVID = 12,
+ VENUS_FMT_P010 = 3,
+ VENUS_FMT_H264 = 4,
+ VENUS_FMT_VP8 = 5,
+ VENUS_FMT_VP9 = 6,
+ VENUS_FMT_HEVC = 7,
+ VENUS_FMT_VC1_ANNEX_G = 8,
+ VENUS_FMT_VC1_ANNEX_L = 9,
+ VENUS_FMT_MPEG4 = 10,
+ VENUS_FMT_MPEG2 = 11,
+ VENUS_FMT_H263 = 12,
+ VENUS_FMT_XVID = 13,
};

struct venus_format {
diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c
index a2ceab7..9a38b36 100644
--- a/drivers/media/platform/qcom/venus/helpers.c
+++ b/drivers/media/platform/qcom/venus/helpers.c
@@ -612,6 +612,8 @@ static u32 to_hfi_raw_fmt(u32 v4l2_fmt)
return HFI_COLOR_FORMAT_NV12_UBWC;
case V4L2_PIX_FMT_QC10C:
return HFI_COLOR_FORMAT_YUV420_TP10_UBWC;
+ case V4L2_PIX_FMT_P010:
+ return HFI_COLOR_FORMAT_P010;
default:
break;
}
diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c
index bab985b..7aeaf77 100644
--- a/drivers/media/platform/qcom/venus/vdec.c
+++ b/drivers/media/platform/qcom/venus/vdec.c
@@ -45,6 +45,11 @@ static const struct venus_format vdec_formats[] = {
.num_planes = 1,
.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE,
},
+ [VENUS_FMT_P010] = {
+ .pixfmt = V4L2_PIX_FMT_P010,
+ .num_planes = 1,
+ .type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE,
+ },
[VENUS_FMT_H264] = {
.pixfmt = V4L2_PIX_FMT_H264,
.num_planes = 1,
--
2.7.4