diff mbox series

[3/3] venus: Add a handling of QC10C compressed format

Message ID 20210429105815.2790770-4-stanimir.varbanov@linaro.org
State New
Headers show
Series Qualcomm custom compressed pixfmt | expand

Commit Message

Stanimir Varbanov April 29, 2021, 10:58 a.m. UTC
This adds QC10C compressed pixel format in the Venus driver, and
make it enumeratable from v4l2 clients.

Note: The QC10C format shouldn't be possible to enumerate by the
client if the decoded bitstream is not 10bits. This is not
implemented in this patch yet.

Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
---
 drivers/media/platform/qcom/venus/helpers.c | 2 ++
 drivers/media/platform/qcom/venus/vdec.c    | 6 +++++-
 2 files changed, 7 insertions(+), 1 deletion(-)

Comments

Hans Verkuil June 2, 2021, 10:01 a.m. UTC | #1
On 29/04/2021 12:58, Stanimir Varbanov wrote:
> This adds QC10C compressed pixel format in the Venus driver, and
> make it enumeratable from v4l2 clients.

enumeratable -> possible to discover

(or possibly 'enumerable', but I prefer the phrase suggested above)

> 
> Note: The QC10C format shouldn't be possible to enumerate by the
> client if the decoded bitstream is not 10bits. This is not

10bits -> 10-bits

> implemented in this patch yet.

Obvious question: will this be done in a later patch that is being
prepared? Would it be better to wait until such a patch is available?

Regards,

	Hans

> 
> Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
> ---
>  drivers/media/platform/qcom/venus/helpers.c | 2 ++
>  drivers/media/platform/qcom/venus/vdec.c    | 6 +++++-
>  2 files changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c
> index 3a0b07d237a5..58bf2e0654ce 100644
> --- a/drivers/media/platform/qcom/venus/helpers.c
> +++ b/drivers/media/platform/qcom/venus/helpers.c
> @@ -563,6 +563,8 @@ static u32 to_hfi_raw_fmt(u32 v4l2_fmt)
>  		return HFI_COLOR_FORMAT_NV21;
>  	case V4L2_PIX_FMT_QC8C:
>  		return HFI_COLOR_FORMAT_NV12_UBWC;
> +	case V4L2_PIX_FMT_QC10C:
> +		return HFI_COLOR_FORMAT_YUV420_TP10_UBWC;
>  	default:
>  		break;
>  	}
> diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c
> index d4cc51fc019c..7ad8cd66b8bc 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,
> @@ -1508,7 +1512,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[6];
> +	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);
>
Stanimir Varbanov June 2, 2021, 1:30 p.m. UTC | #2
On 6/2/21 1:01 PM, Hans Verkuil wrote:
> On 29/04/2021 12:58, Stanimir Varbanov wrote:

>> This adds QC10C compressed pixel format in the Venus driver, and

>> make it enumeratable from v4l2 clients.

> 

> enumeratable -> possible to discover

> 

> (or possibly 'enumerable', but I prefer the phrase suggested above)

> 

>>

>> Note: The QC10C format shouldn't be possible to enumerate by the

>> client if the decoded bitstream is not 10bits. This is not

> 

> 10bits -> 10-bits

> 

>> implemented in this patch yet.

> 

> Obvious question: will this be done in a later patch that is being

> prepared? Would it be better to wait until such a patch is available?

> 


Yes, It will be implemented in v2.

-- 
regards,
Stan
diff mbox series

Patch

diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c
index 3a0b07d237a5..58bf2e0654ce 100644
--- a/drivers/media/platform/qcom/venus/helpers.c
+++ b/drivers/media/platform/qcom/venus/helpers.c
@@ -563,6 +563,8 @@  static u32 to_hfi_raw_fmt(u32 v4l2_fmt)
 		return HFI_COLOR_FORMAT_NV21;
 	case V4L2_PIX_FMT_QC8C:
 		return HFI_COLOR_FORMAT_NV12_UBWC;
+	case V4L2_PIX_FMT_QC10C:
+		return HFI_COLOR_FORMAT_YUV420_TP10_UBWC;
 	default:
 		break;
 	}
diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c
index d4cc51fc019c..7ad8cd66b8bc 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,
@@ -1508,7 +1512,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[6];
+	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);