mbox series

[0/4] venus: add support for 10 bit decoding

Message ID 1683196599-3730-1-git-send-email-quic_dikshita@quicinc.com
Headers show
Series venus: add support for 10 bit decoding | expand

Message

Dikshita Agarwal May 4, 2023, 10:36 a.m. UTC
This series includes the changes to
  - add V4L2_PIX_FMT_P010 as supported decoder format.
  - consider dpb color format while calculating buffer
    size for dpb buffers.
  - update dpb and opb color format when bit depth
    changes is detected, also update preferred color
    format to P010 in this case.

With this series, divided the previous version [1] into
multiple patches as suggested in review comments.

[1] https://patchwork.linuxtv.org/project/linux-media/list/?series=10376

Dikshita Agarwal (4):
  venus: add support for V4L2_PIX_FMT_P010 color format
  venus: update calculation for dpb buffers
  venus: add handling of bit depth change from firmwar
  venus: return P010 as preferred format for 10 bit decode

 drivers/media/platform/qcom/venus/helpers.c        | 24 ++++++++++++++++++++++
 drivers/media/platform/qcom/venus/hfi_plat_bufs.h  |  3 +++
 .../media/platform/qcom/venus/hfi_plat_bufs_v6.c   |  8 +++++++-
 drivers/media/platform/qcom/venus/vdec.c           | 16 +++++++++++++--
 4 files changed, 48 insertions(+), 3 deletions(-)

Comments

Bryan O'Donoghue May 4, 2023, 1:49 p.m. UTC | #1
On 04/05/2023 11:36, Dikshita Agarwal wrote:
> This series includes the changes to
>    - add V4L2_PIX_FMT_P010 as supported decoder format.
>    - consider dpb color format while calculating buffer
>      size for dpb buffers.
>    - update dpb and opb color format when bit depth
>      changes is detected, also update preferred color
>      format to P010 in this case.
> 
> With this series, divided the previous version [1] into
> multiple patches as suggested in review comments.
> 
> [1] https://patchwork.linuxtv.org/project/linux-media/list/?series=10376
> 
> Dikshita Agarwal (4):
>    venus: add support for V4L2_PIX_FMT_P010 color format
>    venus: update calculation for dpb buffers
>    venus: add handling of bit depth change from firmwar
>    venus: return P010 as preferred format for 10 bit decode
> 
>   drivers/media/platform/qcom/venus/helpers.c        | 24 ++++++++++++++++++++++
>   drivers/media/platform/qcom/venus/hfi_plat_bufs.h  |  3 +++
>   .../media/platform/qcom/venus/hfi_plat_bufs_v6.c   |  8 +++++++-
>   drivers/media/platform/qcom/venus/vdec.c           | 16 +++++++++++++--
>   4 files changed, 48 insertions(+), 3 deletions(-)
> 

For future reference a series like this should:

1. Include a log of what changed between the last series and this
2. Describe which comments you addressed
    I generally try to say
    "Added newline to dts - Konrad"
    "Sent the series as a -v3 - Bryan"
    etc
3. Ideally provide a link to the previous series in
 
https://lore.kernel.org/linux-arm-msm/1682492417-20496-1-git-send-email-quic_dikshita@quicinc.com/
4. Use versioning
    This set should be prefixed with "v2-0000-cover-letter" 
"v2-0001-add-support" etc

"git format-patch mybase..targettip --cover-letter -v2"

---
bod
Bryan O'Donoghue May 4, 2023, 1:51 p.m. UTC | #2
On 04/05/2023 14:49, Bryan O'Donoghue wrote:
> On 04/05/2023 11:36, Dikshita Agarwal wrote:
>> This series includes the changes to
>>    - add V4L2_PIX_FMT_P010 as supported decoder format.
>>    - consider dpb color format while calculating buffer
>>      size for dpb buffers.
>>    - update dpb and opb color format when bit depth
>>      changes is detected, also update preferred color
>>      format to P010 in this case.
>>
>> With this series, divided the previous version [1] into
>> multiple patches as suggested in review comments.
>>
>> [1] https://patchwork.linuxtv.org/project/linux-media/list/?series=10376
>>
>> Dikshita Agarwal (4):
>>    venus: add support for V4L2_PIX_FMT_P010 color format
>>    venus: update calculation for dpb buffers
>>    venus: add handling of bit depth change from firmwar
>>    venus: return P010 as preferred format for 10 bit decode
>>
>>   drivers/media/platform/qcom/venus/helpers.c        | 24 
>> ++++++++++++++++++++++
>>   drivers/media/platform/qcom/venus/hfi_plat_bufs.h  |  3 +++
>>   .../media/platform/qcom/venus/hfi_plat_bufs_v6.c   |  8 +++++++-
>>   drivers/media/platform/qcom/venus/vdec.c           | 16 +++++++++++++--
>>   4 files changed, 48 insertions(+), 3 deletions(-)
>>
> 
> For future reference a series like this should:
> 
> 1. Include a log of what changed between the last series and this
> 2. Describe which comments you addressed
>     I generally try to say
>     "Added newline to dts - Konrad"
>     "Sent the series as a -v3 - Bryan"
>     etc
> 3. Ideally provide a link to the previous series in
> 
> https://lore.kernel.org/linux-arm-msm/1682492417-20496-1-git-send-email-quic_dikshita@quicinc.com/
> 4. Use versioning
>     This set should be prefixed with "v2-0000-cover-letter" 
> "v2-0001-add-support" etc
> 
> "git format-patch mybase..targettip --cover-letter -v2"
> 
> ---
> bod

Doh I see you did most of that - just missed the V2.

Please remember to version your subsequent series. "git format-patch -v2"

---
bod
Konrad Dybcio May 4, 2023, 5:32 p.m. UTC | #3
On 4.05.2023 12:36, Dikshita Agarwal wrote:
> Set opb format to TP10_UWC and dpb to client set format
> when bit depth change to 10 bit is detecting by firmware.
> 
> Signed-off-by: Dikshita Agarwal <quic_dikshita@quicinc.com>
> ---
>  drivers/media/platform/qcom/venus/helpers.c | 18 ++++++++++++++++++
>  drivers/media/platform/qcom/venus/vdec.c    |  5 ++++-
>  2 files changed, 22 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c
> index 4ad6232..4f48ebd 100644
> --- a/drivers/media/platform/qcom/venus/helpers.c
> +++ b/drivers/media/platform/qcom/venus/helpers.c
> @@ -1770,6 +1770,24 @@ 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) {
This could be unbroken

> +		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);
This could be unbroken

Otherwise I think this lgtm

Acked-by: Konrad Dybcio <konrad.dybcio@linaro.org>

Konrad
> +		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,
> diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c
> index 687d62e..69f7f6e 100644
> --- a/drivers/media/platform/qcom/venus/vdec.c
> +++ b/drivers/media/platform/qcom/venus/vdec.c
> @@ -701,6 +701,9 @@ static int vdec_set_work_route(struct venus_inst *inst)
>  }
>  
>  #define is_ubwc_fmt(fmt) (!!((fmt) & HFI_COLOR_FORMAT_UBWC_BASE))
> +#define is_10bit_ubwc_fmt(fmt) (!!((fmt) & HFI_COLOR_FORMAT_10_BIT_BASE & \
> +				 HFI_COLOR_FORMAT_UBWC_BASE))
> +
>  
>  static int vdec_output_conf(struct venus_inst *inst)
>  {
> @@ -748,7 +751,7 @@ static int vdec_output_conf(struct venus_inst *inst)
>  		inst->opb_fmt = out2_fmt;
>  		inst->dpb_buftype = HFI_BUFFER_OUTPUT;
>  		inst->dpb_fmt = out_fmt;
> -	} else if (is_ubwc_fmt(out2_fmt)) {
> +	} else if (is_ubwc_fmt(out2_fmt) || is_10bit_ubwc_fmt(out_fmt)) {
>  		inst->opb_buftype = HFI_BUFFER_OUTPUT;
>  		inst->opb_fmt = out_fmt;
>  		inst->dpb_buftype = HFI_BUFFER_OUTPUT2;