media: venus: return P010 as preferred format for 10 bit decode
authorDikshita Agarwal <quic_dikshita@quicinc.com>
Mon, 22 May 2023 06:48:18 +0000 (07:48 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Fri, 9 Jun 2023 13:04:32 +0000 (14:04 +0100)
If bit depth is detected as 10 bit by firmware, return
P010 as preferred decoder format to the client.

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>
drivers/media/platform/qcom/venus/vdec.c

index 96ecedafe5463d0562238416b1277bc09711af9f..12a2e99508f504dfbd424ec6c30eaa9a114b24e0 100644 (file)
@@ -1503,8 +1503,13 @@ static void vdec_event_change(struct venus_inst *inst,
        inst->out_width = ev_data->width;
        inst->out_height = ev_data->height;
 
-       if (inst->bit_depth != ev_data->bit_depth)
+       if (inst->bit_depth != ev_data->bit_depth) {
                inst->bit_depth = ev_data->bit_depth;
+               if (inst->bit_depth == VIDC_BITDEPTH_10)
+                       inst->fmt_cap = &vdec_formats[VENUS_FMT_P010];
+               else
+                       inst->fmt_cap = &vdec_formats[VENUS_FMT_NV12];
+       }
 
        if (inst->pic_struct != ev_data->pic_struct)
                inst->pic_struct = ev_data->pic_struct;