diff mbox series

[1/2] drm/i915/mtl: Added restriction for plane downscaling

Message ID 20220826121741.25485-1-animesh.manna@intel.com (mailing list archive)
State New, archived
Headers show
Series [1/2] drm/i915/mtl: Added restriction for plane downscaling | expand

Commit Message

Manna, Animesh Aug. 26, 2022, 12:17 p.m. UTC
The second Scaler (i.e. Scaler 2) does not support vertical
downscaling (i.e. it's vertical scale factor must not be greater
than 1.0). So, vertical plane downscaling is not supported on MTL,
scale factor modified accordingly.

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Manasi Navare <manasi.d.navare@intel.com>
Signed-off-by: Animesh Manna <animesh.manna@intel.com>
---
 drivers/gpu/drm/i915/display/skl_universal_plane.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Comments

Murthy, Arun R Aug. 29, 2022, 2:48 a.m. UTC | #1
> -----Original Message-----
> From: Intel-gfx <intel-gfx-bounces@lists.freedesktop.org> On Behalf Of
> Animesh Manna
> Sent: Friday, August 26, 2022 5:48 PM
> To: intel-gfx@lists.freedesktop.org
> Subject: [Intel-gfx] [PATCH 1/2] drm/i915/mtl: Added restriction for plane
> downscaling
> 
> The second Scaler (i.e. Scaler 2) does not support vertical downscaling (i.e.
> it's vertical scale factor must not be greater than 1.0). So, vertical plane
> downscaling is not supported on MTL, scale factor modified accordingly.
> 
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Cc: Manasi Navare <manasi.d.navare@intel.com>
> Signed-off-by: Animesh Manna <animesh.manna@intel.com>
> ---
>  drivers/gpu/drm/i915/display/skl_universal_plane.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/skl_universal_plane.c
> b/drivers/gpu/drm/i915/display/skl_universal_plane.c
> index bcfde81e4d08..6bfcda748e7b 100644
> --- a/drivers/gpu/drm/i915/display/skl_universal_plane.c
> +++ b/drivers/gpu/drm/i915/display/skl_universal_plane.c
> @@ -1464,9 +1464,12 @@ static int skl_plane_max_scale(struct
> drm_i915_private *dev_priv,
>  	 * whether we can use the HQ scaler mode. Assume
>  	 * the best case.
>  	 * FIXME need to properly check this later.
> +	 * FIXME On MTL, adjust specific scaler's downscaling capability.
This should not be FIXME and this is a limitation of hardware. A NOTE can be added instead!
>  	 */
> -	if (DISPLAY_VER(dev_priv) >= 10 ||
> -	    !intel_format_info_is_yuv_semiplanar(fb->format, fb->modifier))
> +	if (IS_METEORLAKE(dev_priv))
> +		return 0x10000;
Can this magic number be replaced with a macro?

> +	else if (DISPLAY_VER(dev_priv) >= 10 ||
> +		 !intel_format_info_is_yuv_semiplanar(fb->format, fb-
> >modifier))
>  		return 0x30000 - 1;
>  	else
>  		return 0x20000 - 1;
> --
> 2.29.0


Thanks and Regards,
Arun R Murthy
--------------------
Luca Coelho Aug. 29, 2022, 7:43 a.m. UTC | #2
On Mon, 2022-08-29 at 02:48 +0000, Murthy, Arun R wrote:
> > -----Original Message-----
> > From: Intel-gfx <intel-gfx-bounces@lists.freedesktop.org> On Behalf
> > Of
> > Animesh Manna
> > Sent: Friday, August 26, 2022 5:48 PM
> > To: intel-gfx@lists.freedesktop.org
> > Subject: [Intel-gfx] [PATCH 1/2] drm/i915/mtl: Added restriction
> > for plane
> > downscaling
> > 
> > The second Scaler (i.e. Scaler 2) does not support vertical
> > downscaling (i.e.
> > it's vertical scale factor must not be greater than 1.0). So,
> > vertical plane
> > downscaling is not supported on MTL, scale factor modified
> > accordingly.
> > 
> > Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > Cc: Manasi Navare <manasi.d.navare@intel.com>
> > Signed-off-by: Animesh Manna <animesh.manna@intel.com>
> > ---
> >  drivers/gpu/drm/i915/display/skl_universal_plane.c | 7 +++++--
> >  1 file changed, 5 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/display/skl_universal_plane.c
> > b/drivers/gpu/drm/i915/display/skl_universal_plane.c
> > index bcfde81e4d08..6bfcda748e7b 100644
> > --- a/drivers/gpu/drm/i915/display/skl_universal_plane.c
> > +++ b/drivers/gpu/drm/i915/display/skl_universal_plane.c
> > @@ -1464,9 +1464,12 @@ static int skl_plane_max_scale(struct
> > drm_i915_private *dev_priv,
> >  	 * whether we can use the HQ scaler mode. Assume
> >  	 * the best case.
> >  	 * FIXME need to properly check this later.
> > +	 * FIXME On MTL, adjust specific scaler's downscaling
> > capability.
> This should not be FIXME and this is a limitation of hardware. A NOTE
> can be added instead!

I have been working on this and I have a proper implementation for this
FIXME.

This patch is not correct because it limits scaling on all cases, i.e.
vertical scaling, horizontal scaling and both in scaler 1 and scaler 2.
But the hardware limitation is only in vertical scaling with scaler 2.

I sent the fix to our internal list last Friday.  I think we should
only take this patch upstream after it has been squashed with my
changes.


> >  	 */
> > -	if (DISPLAY_VER(dev_priv) >= 10 ||
> > -	    !intel_format_info_is_yuv_semiplanar(fb->format, fb-
> > >modifier))
> > +	if (IS_METEORLAKE(dev_priv))
> > +		return 0x10000;
> Can this magic number be replaced with a macro?

This is not really a magic number, it's a 16.16 fixed point notation. 
0x10000 represents 1.0 (no scaling).


--
Cheers,
Luca.
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/skl_universal_plane.c b/drivers/gpu/drm/i915/display/skl_universal_plane.c
index bcfde81e4d08..6bfcda748e7b 100644
--- a/drivers/gpu/drm/i915/display/skl_universal_plane.c
+++ b/drivers/gpu/drm/i915/display/skl_universal_plane.c
@@ -1464,9 +1464,12 @@  static int skl_plane_max_scale(struct drm_i915_private *dev_priv,
 	 * whether we can use the HQ scaler mode. Assume
 	 * the best case.
 	 * FIXME need to properly check this later.
+	 * FIXME On MTL, adjust specific scaler's downscaling capability.
 	 */
-	if (DISPLAY_VER(dev_priv) >= 10 ||
-	    !intel_format_info_is_yuv_semiplanar(fb->format, fb->modifier))
+	if (IS_METEORLAKE(dev_priv))
+		return 0x10000;
+	else if (DISPLAY_VER(dev_priv) >= 10 ||
+		 !intel_format_info_is_yuv_semiplanar(fb->format, fb->modifier))
 		return 0x30000 - 1;
 	else
 		return 0x20000 - 1;