diff mbox series

drm/i915/dp: Return min bpc supported by source instead of 0

Message ID 20250131041342.3086716-1-ankit.k.nautiyal@intel.com (mailing list archive)
State New
Headers show
Series drm/i915/dp: Return min bpc supported by source instead of 0 | expand

Commit Message

Nautiyal, Ankit K Jan. 31, 2025, 4:13 a.m. UTC
Currently, intel_dp_dsc_max_src_input_bpc can return 0 for platforms not
supporting DSC, which could theoretically cause issues in clamp()
due to a low limit being greater than the high limit.

Instead, return the minimum bpc supported by the source to prevent
such issues.

Reported-by: Linux Kernel Functional Testing <lkft@linaro.org>
Closes: https://lore.kernel.org/all/CA+G9fYtNfM399_=_ff81zeRJv=0+z7oFJfPGmJgTp6yrJmU+1w@mail.gmail.com/
Fixes: 160672b86b0d ("drm/i915/dp: Use clamp for pipe_bpp limits with DSC")
Cc: Suraj Kandpal <suraj.kandpal@intel.com>
Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
---
 drivers/gpu/drm/i915/display/intel_dp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Kandpal, Suraj Jan. 31, 2025, 4:55 a.m. UTC | #1
> -----Original Message-----
> From: Nautiyal, Ankit K <ankit.k.nautiyal@intel.com>
> Sent: Friday, January 31, 2025 9:44 AM
> To: intel-gfx@lists.freedesktop.org; intel-xe@lists.freedesktop.org
> Cc: jani.nikula@linux.intel.com; Kandpal, Suraj <suraj.kandpal@intel.com>;
> Vivi, Rodrigo <rodrigo.vivi@intel.com>; david.laight.linux@gmail.com;
> naresh.kamboju@linaro.org
> Subject: [PATCH] drm/i915/dp: Return min bpc supported by source instead
> of 0
> 
> Currently, intel_dp_dsc_max_src_input_bpc can return 0 for platforms not
> supporting DSC, which could theoretically cause issues in clamp() due to a
> low limit being greater than the high limit.
> 

No need for the extra line above
Rest LGTM,
Reviewed-by: Suraj Kandpal <suraj.kandpal@intel.com>

> Instead, return the minimum bpc supported by the source to prevent such
> issues.
> 
> Reported-by: Linux Kernel Functional Testing <lkft@linaro.org>
> Closes:
> https://lore.kernel.org/all/CA+G9fYtNfM399_=_ff81zeRJv=0+z7oFJfPGmJgTp6y
> rJmU+1w@mail.gmail.com/
> Fixes: 160672b86b0d ("drm/i915/dp: Use clamp for pipe_bpp limits with
> DSC")
> Cc: Suraj Kandpal <suraj.kandpal@intel.com>
> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_dp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c
> b/drivers/gpu/drm/i915/display/intel_dp.c
> index 80214a559013..d28abf081844 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -1791,7 +1791,7 @@ int intel_dp_dsc_max_src_input_bpc(struct
> intel_display *display)
>  	if (DISPLAY_VER(display) == 11)
>  		return 10;
> 
> -	return 0;
> +	return intel_dp_dsc_min_src_input_bpc();
>  }
> 
>  int intel_dp_dsc_compute_max_bpp(const struct intel_connector *connector,
> --
> 2.45.2
Borah, Chaitanya Kumar Jan. 31, 2025, 6:10 a.m. UTC | #2
> -----Original Message-----
> From: Intel-xe <intel-xe-bounces@lists.freedesktop.org> On Behalf Of Ankit
> Nautiyal
> Sent: Friday, January 31, 2025 9:44 AM
> To: intel-gfx@lists.freedesktop.org; intel-xe@lists.freedesktop.org
> Cc: jani.nikula@linux.intel.com; Kandpal, Suraj <suraj.kandpal@intel.com>;
> Vivi, Rodrigo <rodrigo.vivi@intel.com>; david.laight.linux@gmail.com;
> naresh.kamboju@linaro.org
> Subject: [PATCH] drm/i915/dp: Return min bpc supported by source instead
> of 0
> 
> Currently, intel_dp_dsc_max_src_input_bpc can return 0 for platforms not
> supporting DSC, which could theoretically cause issues in clamp() due to a
> low limit being greater than the high limit.
> 
> Instead, return the minimum bpc supported by the source to prevent such
> issues.
> 
> Reported-by: Linux Kernel Functional Testing <lkft@linaro.org>
> Closes:
> https://lore.kernel.org/all/CA+G9fYtNfM399_=_ff81zeRJv=0+z7oFJfPGmJgTp6y
> rJmU+1w@mail.gmail.com/
> Fixes: 160672b86b0d ("drm/i915/dp: Use clamp for pipe_bpp limits with
> DSC")
> Cc: Suraj Kandpal <suraj.kandpal@intel.com>
> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>

Solves the build issue for linux-next.

Tested-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>



> ---
>  drivers/gpu/drm/i915/display/intel_dp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c
> b/drivers/gpu/drm/i915/display/intel_dp.c
> index 80214a559013..d28abf081844 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -1791,7 +1791,7 @@ int intel_dp_dsc_max_src_input_bpc(struct
> intel_display *display)
>  	if (DISPLAY_VER(display) == 11)
>  		return 10;
> 
> -	return 0;
> +	return intel_dp_dsc_min_src_input_bpc();
>  }
> 
>  int intel_dp_dsc_compute_max_bpp(const struct intel_connector *connector,
> --
> 2.45.2
Rodrigo Vivi Jan. 31, 2025, 3:20 p.m. UTC | #3
On Fri, Jan 31, 2025 at 01:10:25AM -0500, Borah, Chaitanya Kumar wrote:
> 
> 
> > -----Original Message-----
> > From: Intel-xe <intel-xe-bounces@lists.freedesktop.org> On Behalf Of Ankit
> > Nautiyal
> > Sent: Friday, January 31, 2025 9:44 AM
> > To: intel-gfx@lists.freedesktop.org; intel-xe@lists.freedesktop.org
> > Cc: jani.nikula@linux.intel.com; Kandpal, Suraj <suraj.kandpal@intel.com>;
> > Vivi, Rodrigo <rodrigo.vivi@intel.com>; david.laight.linux@gmail.com;
> > naresh.kamboju@linaro.org
> > Subject: [PATCH] drm/i915/dp: Return min bpc supported by source instead
> > of 0
> > 
> > Currently, intel_dp_dsc_max_src_input_bpc can return 0 for platforms not
> > supporting DSC, which could theoretically cause issues in clamp() due to a
> > low limit being greater than the high limit.
> > 
> > Instead, return the minimum bpc supported by the source to prevent such
> > issues.
> > 
> > Reported-by: Linux Kernel Functional Testing <lkft@linaro.org>
> > Closes:
> > https://lore.kernel.org/all/CA+G9fYtNfM399_=_ff81zeRJv=0+z7oFJfPGmJgTp6y
> > rJmU+1w@mail.gmail.com/
> > Fixes: 160672b86b0d ("drm/i915/dp: Use clamp for pipe_bpp limits with
> > DSC")
> > Cc: Suraj Kandpal <suraj.kandpal@intel.com>
> > Cc: Jani Nikula <jani.nikula@linux.intel.com>
> > Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> > Signed-off-by: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
> 
> Solves the build issue for linux-next.
> 
> Tested-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>

pushed to drm-intel-next. Thank you all

> 
> 
> 
> > ---
> >  drivers/gpu/drm/i915/display/intel_dp.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/display/intel_dp.c
> > b/drivers/gpu/drm/i915/display/intel_dp.c
> > index 80214a559013..d28abf081844 100644
> > --- a/drivers/gpu/drm/i915/display/intel_dp.c
> > +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> > @@ -1791,7 +1791,7 @@ int intel_dp_dsc_max_src_input_bpc(struct
> > intel_display *display)
> >  	if (DISPLAY_VER(display) == 11)
> >  		return 10;
> > 
> > -	return 0;
> > +	return intel_dp_dsc_min_src_input_bpc();
> >  }
> > 
> >  int intel_dp_dsc_compute_max_bpp(const struct intel_connector *connector,
> > --
> > 2.45.2
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index 80214a559013..d28abf081844 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -1791,7 +1791,7 @@  int intel_dp_dsc_max_src_input_bpc(struct intel_display *display)
 	if (DISPLAY_VER(display) == 11)
 		return 10;
 
-	return 0;
+	return intel_dp_dsc_min_src_input_bpc();
 }
 
 int intel_dp_dsc_compute_max_bpp(const struct intel_connector *connector,