diff options
| author | Stanimir Varbanov <stanimir.varbanov@linaro.org> | 2022-03-03 15:06:35 +0000 |
|---|---|---|
| committer | Mauro Carvalho Chehab <mchehab@kernel.org> | 2022-04-24 08:34:18 +0100 |
| commit | cef92b14e6535d550d571b99e753b04e44423286 (patch) | |
| tree | 5c151ff0a9734ef978d77c90327abcfdf3d64182 /drivers/media/platform/qcom/venus/vdec.c | |
| parent | 1af7d8dacfc926c9bf73d21035e1fc78655fed07 (diff) | |
| download | cachepc-linux-cef92b14e6535d550d571b99e753b04e44423286.tar.gz cachepc-linux-cef92b14e6535d550d571b99e753b04e44423286.zip | |
media: venus: Add a handling of QC10C compressed format
This adds QC10C compressed pixel format in the Venus driver, and
make it possible to discover from v4l2 clients.
Note: The QC10C format will be enumerable via VIDIOC_ENUM_FMT when
the bitstream is 10-bits and the headers are parsed.
Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Diffstat (limited to 'drivers/media/platform/qcom/venus/vdec.c')
| -rw-r--r-- | drivers/media/platform/qcom/venus/vdec.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c index b7408e0845a6..2232969e709a 100644 --- a/drivers/media/platform/qcom/venus/vdec.c +++ b/drivers/media/platform/qcom/venus/vdec.c @@ -35,6 +35,10 @@ static const struct venus_format vdec_formats[] = { .num_planes = 1, .type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE, }, { + .pixfmt = V4L2_PIX_FMT_QC10C, + .num_planes = 1, + .type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE, + },{ .pixfmt = V4L2_PIX_FMT_NV12, .num_planes = 1, .type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE, @@ -114,6 +118,10 @@ find_format(struct venus_inst *inst, u32 pixfmt, u32 type) !venus_helper_check_format(inst, fmt[i].pixfmt)) return NULL; + if (V4L2_TYPE_IS_CAPTURE(type) && fmt[i].pixfmt == V4L2_PIX_FMT_QC10C && + !(inst->bit_depth == VIDC_BITDEPTH_10)) + return NULL; + return &fmt[i]; } @@ -133,11 +141,16 @@ find_format_by_index(struct venus_inst *inst, unsigned int index, u32 type) if (fmt[i].type != type) continue; - if (V4L2_TYPE_IS_OUTPUT(type)) + if (V4L2_TYPE_IS_OUTPUT(type)) { valid = venus_helper_check_codec(inst, fmt[i].pixfmt); - else if (V4L2_TYPE_IS_CAPTURE(type)) + } else if (V4L2_TYPE_IS_CAPTURE(type)) { valid = venus_helper_check_format(inst, fmt[i].pixfmt); + if (fmt[i].pixfmt == V4L2_PIX_FMT_QC10C && + !(inst->bit_depth == VIDC_BITDEPTH_10)) + valid = false; + } + if (k == index && valid) break; if (valid) @@ -1539,7 +1552,7 @@ static const struct hfi_inst_ops vdec_hfi_ops = { static void vdec_inst_init(struct venus_inst *inst) { inst->hfi_codec = HFI_VIDEO_CODEC_H264; - inst->fmt_out = &vdec_formats[7]; + inst->fmt_out = &vdec_formats[8]; inst->fmt_cap = &vdec_formats[0]; inst->width = frame_width_min(inst); inst->height = ALIGN(frame_height_min(inst), 32); |
