On Wed, 11 Jan 2023, Suraj Kandpal <[email protected]> wrote:
> From: Swati Sharma <[email protected]>
>
> If force_dsc_ycbcr420_en is set through debugfs allow DSC iff
> output_format is INTEL_OUTPUT_FORMAT_YCBCR420.

Squash this with the previous patch.

>
> Signed-off-by: Swati Sharma <[email protected]>
> ---
>  drivers/gpu/drm/i915/display/intel_dp.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c 
> b/drivers/gpu/drm/i915/display/intel_dp.c
> index 2adac42e585d..666ee85dd23a 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -1528,6 +1528,10 @@ int intel_dp_dsc_compute_config(struct intel_dp 
> *intel_dp,
>       if (!intel_dp_dsc_supports_format(intel_dp, pipe_config->output_format))
>               return -EINVAL;
>  
> +     if (intel_dp->force_dsc_ycbcr420_en &&
> +         pipe_config->output_format != INTEL_OUTPUT_FORMAT_YCBCR420)
> +             return -EINVAL;

It would be more generally useful, and perhaps even cleaner to
implement, to force the output format, as in *any* output format,
instead of having a specific force_dsc_ycbcr420_en.

BR,
Jani.


> +
>       if (compute_pipe_bpp)
>               pipe_bpp = intel_dp_dsc_compute_bpp(intel_dp, 
> conn_state->max_requested_bpc);
>       else

-- 
Jani Nikula, Intel Open Source Graphics Center

Reply via email to