diff mbox series

[v3,1/7] drm/dp_helper: Add helper to check DSC support with given o/p format

Message ID 20230309062855.393087-2-suraj.kandpal@intel.com (mailing list archive)
State New, archived
Headers show
Series Enable YCbCr420 format for VDSC | expand

Commit Message

Kandpal, Suraj March 9, 2023, 6:28 a.m. UTC
From: Ankit Nautiyal <ankit.k.nautiyal@intel.com>

Add helper to check if the DP sink supports DSC with the given
o/p format.

v2: Add documentation for the helper. (Uma Shankar)

v3: /** instead of  /* (Uma Shankar)

Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Reviewed-by: Uma Shankar <uma.shankar@intel.com>
---
 include/drm/display/drm_dp_helper.h | 13 +++++++++++++
 1 file changed, 13 insertions(+)

Comments

Jani Nikula March 20, 2023, 8:59 a.m. UTC | #1
Thomas, Maxime, Maarten, ack for merging this one via drm-intel?

BR,
Jani.



On Thu, 09 Mar 2023, Suraj Kandpal <suraj.kandpal@intel.com> wrote:
> From: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
>
> Add helper to check if the DP sink supports DSC with the given
> o/p format.
>
> v2: Add documentation for the helper. (Uma Shankar)
>
> v3: /** instead of  /* (Uma Shankar)
>
> Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> Reviewed-by: Uma Shankar <uma.shankar@intel.com>
> ---
>  include/drm/display/drm_dp_helper.h | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
>
> diff --git a/include/drm/display/drm_dp_helper.h b/include/drm/display/drm_dp_helper.h
> index ab55453f2d2c..533d3ee7fe05 100644
> --- a/include/drm/display/drm_dp_helper.h
> +++ b/include/drm/display/drm_dp_helper.h
> @@ -194,6 +194,19 @@ drm_dp_dsc_sink_max_slice_width(const u8 dsc_dpcd[DP_DSC_RECEIVER_CAP_SIZE])
>  		DP_DSC_SLICE_WIDTH_MULTIPLIER;
>  }
>  
> +/**
> + * drm_dp_dsc_sink_supports_format() - check if sink supports DSC with given output format
> + * @dsc_dpcd : DSC-capability DPCDs of the sink
> + * @output_format: output_format which is to be checked
> + *
> + * Returns true if the sink supports DSC with the given output_format, false otherwise.
> + */
> +static inline bool
> +drm_dp_dsc_sink_supports_format(const u8 dsc_dpcd[DP_DSC_RECEIVER_CAP_SIZE], u8 output_format)
> +{
> +	return dsc_dpcd[DP_DSC_DEC_COLOR_FORMAT_CAP - DP_DSC_SUPPORT] & output_format;
> +}
> +
>  /* Forward Error Correction Support on DP 1.4 */
>  static inline bool
>  drm_dp_sink_supports_fec(const u8 fec_capable)
Maarten Lankhorst March 24, 2023, 3:42 p.m. UTC | #2
ack

On 2023-03-20 09:59, Jani Nikula wrote:
> Thomas, Maxime, Maarten, ack for merging this one via drm-intel?
>
> BR,
> Jani.
>
>
>
> On Thu, 09 Mar 2023, Suraj Kandpal <suraj.kandpal@intel.com> wrote:
>> From: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
>>
>> Add helper to check if the DP sink supports DSC with the given
>> o/p format.
>>
>> v2: Add documentation for the helper. (Uma Shankar)
>>
>> v3: /** instead of  /* (Uma Shankar)
>>
>> Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
>> Reviewed-by: Uma Shankar <uma.shankar@intel.com>
>> ---
>>   include/drm/display/drm_dp_helper.h | 13 +++++++++++++
>>   1 file changed, 13 insertions(+)
>>
>> diff --git a/include/drm/display/drm_dp_helper.h b/include/drm/display/drm_dp_helper.h
>> index ab55453f2d2c..533d3ee7fe05 100644
>> --- a/include/drm/display/drm_dp_helper.h
>> +++ b/include/drm/display/drm_dp_helper.h
>> @@ -194,6 +194,19 @@ drm_dp_dsc_sink_max_slice_width(const u8 dsc_dpcd[DP_DSC_RECEIVER_CAP_SIZE])
>>   		DP_DSC_SLICE_WIDTH_MULTIPLIER;
>>   }
>>   
>> +/**
>> + * drm_dp_dsc_sink_supports_format() - check if sink supports DSC with given output format
>> + * @dsc_dpcd : DSC-capability DPCDs of the sink
>> + * @output_format: output_format which is to be checked
>> + *
>> + * Returns true if the sink supports DSC with the given output_format, false otherwise.
>> + */
>> +static inline bool
>> +drm_dp_dsc_sink_supports_format(const u8 dsc_dpcd[DP_DSC_RECEIVER_CAP_SIZE], u8 output_format)
>> +{
>> +	return dsc_dpcd[DP_DSC_DEC_COLOR_FORMAT_CAP - DP_DSC_SUPPORT] & output_format;
>> +}
>> +
>>   /* Forward Error Correction Support on DP 1.4 */
>>   static inline bool
>>   drm_dp_sink_supports_fec(const u8 fec_capable)
diff mbox series

Patch

diff --git a/include/drm/display/drm_dp_helper.h b/include/drm/display/drm_dp_helper.h
index ab55453f2d2c..533d3ee7fe05 100644
--- a/include/drm/display/drm_dp_helper.h
+++ b/include/drm/display/drm_dp_helper.h
@@ -194,6 +194,19 @@  drm_dp_dsc_sink_max_slice_width(const u8 dsc_dpcd[DP_DSC_RECEIVER_CAP_SIZE])
 		DP_DSC_SLICE_WIDTH_MULTIPLIER;
 }
 
+/**
+ * drm_dp_dsc_sink_supports_format() - check if sink supports DSC with given output format
+ * @dsc_dpcd : DSC-capability DPCDs of the sink
+ * @output_format: output_format which is to be checked
+ *
+ * Returns true if the sink supports DSC with the given output_format, false otherwise.
+ */
+static inline bool
+drm_dp_dsc_sink_supports_format(const u8 dsc_dpcd[DP_DSC_RECEIVER_CAP_SIZE], u8 output_format)
+{
+	return dsc_dpcd[DP_DSC_DEC_COLOR_FORMAT_CAP - DP_DSC_SUPPORT] & output_format;
+}
+
 /* Forward Error Correction Support on DP 1.4 */
 static inline bool
 drm_dp_sink_supports_fec(const u8 fec_capable)