From cf0e1da1eeb8f34cac75cb58277dabd7f3752ff6 Mon Sep 17 00:00:00 2001 From: William Norman Date: Mon, 7 Sep 2026 15:19:59 +0800 Subject: [PATCH] qcom: vidc: default decoder output to linear NV12 The Qualcomm GStreamer stack cannot convert the UBWC "NV12_Q08C" decoder output, so Videos shows a blue/green screen. The DPB (decoded picture buffer) size is derived from the PIX_FMTS capability value; keeping it UBWC while forcing the output linear left the DPB at zero and stalled the decoder. Default the decoder output to linear NV12 and split the PIX_FMTS capability into separate ENC/DEC entries so the decoder defaults to linear NV12 while the encoder keeps UBWC for camera input. --- .../platform/sa8775p/src/msm_vidc_sa8775p.c | 21 +++++++++++++++---- ubuntu/qcom/video/vidc/src/msm_vdec.c | 2 +- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/ubuntu/qcom/video/platform/sa8775p/src/msm_vidc_sa8775p.c b/ubuntu/qcom/video/platform/sa8775p/src/msm_vidc_sa8775p.c index 2b5e77acaa944..91d1d65b04ac5 100644 --- a/ubuntu/qcom/video/platform/sa8775p/src/msm_vidc_sa8775p.c +++ b/ubuntu/qcom/video/platform/sa8775p/src/msm_vidc_sa8775p.c @@ -313,19 +313,32 @@ static struct msm_platform_inst_capability instance_cap_data_sa8775p[] = { {SECURE_FRAME_HEIGHT, ENC, HEVC, 96, 4096, 1, 1080}, - {PIX_FMTS, ENC | DEC, H264, + {PIX_FMTS, ENC, H264, MSM_VIDC_FMT_NV12, MSM_VIDC_FMT_NV12C, MSM_VIDC_FMT_NV12 | MSM_VIDC_FMT_NV21 | MSM_VIDC_FMT_NV12C, MSM_VIDC_FMT_NV12C}, - {PIX_FMTS, ENC | DEC, HEVC | AV1, + {PIX_FMTS, DEC, H264, + MSM_VIDC_FMT_NV12, + MSM_VIDC_FMT_NV12C, + MSM_VIDC_FMT_NV12 | MSM_VIDC_FMT_NV21 | MSM_VIDC_FMT_NV12C, + MSM_VIDC_FMT_NV12}, + + {PIX_FMTS, ENC, HEVC | AV1, MSM_VIDC_FMT_NV12, MSM_VIDC_FMT_TP10C, MSM_VIDC_FMT_NV12 | MSM_VIDC_FMT_NV21 | MSM_VIDC_FMT_NV12C | MSM_VIDC_FMT_P010 | MSM_VIDC_FMT_TP10C, MSM_VIDC_FMT_NV12C}, + {PIX_FMTS, DEC, HEVC | AV1, + MSM_VIDC_FMT_NV12, + MSM_VIDC_FMT_TP10C, + MSM_VIDC_FMT_NV12 | MSM_VIDC_FMT_NV21 | MSM_VIDC_FMT_NV12C | + MSM_VIDC_FMT_P010 | MSM_VIDC_FMT_TP10C, + MSM_VIDC_FMT_NV12}, + {PIX_FMTS, ENC, HEIC, MSM_VIDC_FMT_NV12, MSM_VIDC_FMT_P010, @@ -337,14 +350,14 @@ static struct msm_platform_inst_capability instance_cap_data_sa8775p[] = { MSM_VIDC_FMT_TP10C, MSM_VIDC_FMT_NV12 | MSM_VIDC_FMT_NV21 | MSM_VIDC_FMT_NV12C | MSM_VIDC_FMT_P010 | MSM_VIDC_FMT_TP10C, - MSM_VIDC_FMT_NV12C}, + MSM_VIDC_FMT_NV12}, {PIX_FMTS, DEC, VP9, MSM_VIDC_FMT_NV12, MSM_VIDC_FMT_TP10C, MSM_VIDC_FMT_NV12 | MSM_VIDC_FMT_NV21 | MSM_VIDC_FMT_NV12C | MSM_VIDC_FMT_P010 | MSM_VIDC_FMT_TP10C, - MSM_VIDC_FMT_NV12C}, + MSM_VIDC_FMT_NV12}, {MIN_BUFFERS_INPUT, ENC | DEC, CODECS_ALL, 0, 64, 1, 4, V4L2_CID_MIN_BUFFERS_FOR_OUTPUT, diff --git a/ubuntu/qcom/video/vidc/src/msm_vdec.c b/ubuntu/qcom/video/vidc/src/msm_vdec.c index 10784a134d4d2..8f19776829d73 100644 --- a/ubuntu/qcom/video/vidc/src/msm_vdec.c +++ b/ubuntu/qcom/video/vidc/src/msm_vdec.c @@ -2622,7 +2622,7 @@ int msm_vdec_inst_init(struct msm_vidc_inst *inst) f = &inst->fmts[OUTPUT_PORT]; f->type = OUTPUT_MPLANE; f->fmt.pix_mp.pixelformat = - v4l2_colorformat_from_driver(inst, MSM_VIDC_FMT_NV12C, __func__); + v4l2_colorformat_from_driver(inst, MSM_VIDC_FMT_NV12, __func__); colorformat = v4l2_colorformat_to_driver(inst, f->fmt.pix_mp.pixelformat, __func__); f->fmt.pix_mp.width = video_y_stride_pix(colorformat, DEFAULT_WIDTH);