[Intel-gfx] [7/8] drm/i915/dsc: Add debugfs entry to validate DSC fractional bpp

Sui Jingfeng suijingfeng at loongson.cn
Fri Sep 22 16:03:03 UTC 2023


Hi,


On 2023/9/13 14:06, Mitul Golani wrote:
> From: Swati Sharma <swati2.sharma at intel.com>
>
> DSC_Sink_BPP_Precision entry is added to i915_dsc_fec_support_show
> to depict sink's precision.
> Also, new debugfs entry is created to enforce fractional bpp.
> If Force_DSC_Fractional_BPP_en is set then while iterating over
> output bpp with fractional step size we will continue if output_bpp is
> computed as integer. With this approach, we will be able to validate
> DSC with fractional bpp.
>
> v2:
> Add drm_modeset_unlock to new line(Suraj)
>
> Signed-off-by: Swati Sharma <swati2.sharma at intel.com>
> Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal at intel.com>
> Signed-off-by: Mitul Golani <mitulkumar.ajitkumar.golani at intel.com>
> Reviewed-by: Suraj Kandpal <suraj.kandpal at intel.com>
> ---
>   .../drm/i915/display/intel_display_debugfs.c  | 83 +++++++++++++++++++
>   .../drm/i915/display/intel_display_types.h    |  1 +
>   2 files changed, 84 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_display_debugfs.c b/drivers/gpu/drm/i915/display/intel_display_debugfs.c
> index f05b52381a83..776ab96def1f 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_debugfs.c
> +++ b/drivers/gpu/drm/i915/display/intel_display_debugfs.c
> @@ -1244,6 +1244,8 @@ static int i915_dsc_fec_support_show(struct seq_file *m, void *data)
>   								      DP_DSC_YCbCr420_Native)),
>   			   str_yes_no(drm_dp_dsc_sink_supports_format(intel_dp->dsc_dpcd,
>   								      DP_DSC_YCbCr444)));
> +		seq_printf(m, "DSC_Sink_BPP_Precision: %d\n",
> +			   drm_dp_dsc_sink_bpp_incr(intel_dp->dsc_dpcd));
>   		seq_printf(m, "Force_DSC_Enable: %s\n",
>   			   str_yes_no(intel_dp->force_dsc_en));
>   		if (!intel_dp_is_edp(intel_dp))
> @@ -1436,6 +1438,84 @@ static const struct file_operations i915_dsc_output_format_fops = {
>   	.write = i915_dsc_output_format_write
>   };
>   
> +static int i915_dsc_fractional_bpp_show(struct seq_file *m, void *data)
> +{
> +	struct drm_connector *connector = m->private;
> +	struct drm_device *dev = connector->dev;
> +	struct drm_crtc *crtc;
> +	struct intel_dp *intel_dp;
> +	struct intel_encoder *encoder = intel_attached_encoder(to_intel_connector(connector));

The 'to_intel_connector()' inline function get used twice in this function,
if it were me, I will cache it with a local variable to prevent over long in horizontal.


         struct intel_connector *intel_connector = to_intel_connector(connector);
         struct intel_encoder *encoder = intel_attached_encoder(intel_connector);

> +	int ret;
> +
> +	if (!encoder)
> +		return -ENODEV;
> +
> +	ret = drm_modeset_lock_single_interruptible(&dev->mode_config.connection_mutex);
> +	if (ret)
> +		return ret;
> +
> +	crtc = connector->state->crtc;
> +	if (connector->status != connector_status_connected || !crtc) {
> +		ret = -ENODEV;
> +		goto out;
> +	}
> +
> +	intel_dp = intel_attached_dp(to_intel_connector(connector));


          intel_dp = intel_attached_dp(intel_connector);

But this patch is OK, I just give a suggestion.



More information about the Intel-gfx mailing list