summaryrefslogtreecommitdiff
path: root/drivers/media/platform/qcom/venus/helpers.c
diff options
context:
space:
mode:
authorDikshita Agarwal <quic_dikshita@quicinc.com>2023-05-22 09:48:17 +0300
committerMauro Carvalho Chehab <mchehab@kernel.org>2023-06-09 16:04:13 +0300
commit996d215547a877406e601439bd6533d8524d27db (patch)
treea27e557b9446d4f5c7524a856c5b2b645b275894 /drivers/media/platform/qcom/venus/helpers.c
parent58b64dd09fd83542effd621daf65b53114904619 (diff)
downloadlinux-996d215547a877406e601439bd6533d8524d27db.tar.xz
media: venus: add handling of bit depth change from firmware
Set opb format to TP10_UWC and dpb to client set format when bit depth change to 10 bit is detecting by firmware. Acked-by: Konrad Dybcio <konrad.dybcio@linaro.org> Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com> Signed-off-by: Stanimir Varbanov <stanimir.k.varbanov@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/media/platform/qcom/venus/helpers.c')
-rw-r--r--drivers/media/platform/qcom/venus/helpers.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c
index d02060ffe558..1822e85ab6bf 100644
--- a/drivers/media/platform/qcom/venus/helpers.c
+++ b/drivers/media/platform/qcom/venus/helpers.c
@@ -1765,6 +1765,22 @@ int venus_helper_get_out_fmts(struct venus_inst *inst, u32 v4l2_fmt,
if (!caps)
return -EINVAL;
+ if (inst->bit_depth == VIDC_BITDEPTH_10 && inst->session_type == VIDC_SESSION_TYPE_DEC) {
+ found_ubwc = find_fmt_from_caps(caps, HFI_BUFFER_OUTPUT,
+ HFI_COLOR_FORMAT_YUV420_TP10_UBWC);
+ found = find_fmt_from_caps(caps, HFI_BUFFER_OUTPUT2, fmt);
+ if (found_ubwc && found) {
+ /*
+ * Hard-code DPB buffers to be 10bit UBWC
+ * until V4L2 is able to expose compressed/tiled
+ * formats to applications.
+ */
+ *out_fmt = HFI_COLOR_FORMAT_YUV420_TP10_UBWC;
+ *out2_fmt = fmt;
+ return 0;
+ }
+ }
+
if (ubwc) {
ubwc_fmt = fmt | HFI_COLOR_FORMAT_UBWC_BASE;
found_ubwc = find_fmt_from_caps(caps, HFI_BUFFER_OUTPUT,