On 22.05.2023 08:17, Dikshita Agarwal wrote:
Use enums to list supported formats for encoder and decoderThanks a lot.
instead of array index which was a error prone design.
Signed-off-by: Dikshita Agarwal <quic_dikshita@xxxxxxxxxxx>
---
Reviewed-by: Konrad Dybcio <konrad.dybcio@xxxxxxxxxx>
drivers/media/platform/qcom/venus/core.h | 16 ++++++++Nit: I don't think the '= n' is necessary here, as it doesn't
drivers/media/platform/qcom/venus/vdec.c | 63 +++++++++++++++++++-------------
drivers/media/platform/qcom/venus/venc.c | 31 +++++++++-------
3 files changed, 72 insertions(+), 38 deletions(-)
diff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platform/qcom/venus/core.h
index 12a42fb..e988ed4 100644
--- a/drivers/media/platform/qcom/venus/core.h
+++ b/drivers/media/platform/qcom/venus/core.h
@@ -83,6 +83,22 @@ struct venus_resources {
const char *fwname;
};
+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,
map to anything in hw/fw (or does it?)
--
Konrad