diff mbox series

drm/i915: Add PLANE_CUS_CTL restriction in max_width

Message ID 20211201034727.1666-1-vidya.srinivas@intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915: Add PLANE_CUS_CTL restriction in max_width | expand

Commit Message

Srinivas, Vidya Dec. 1, 2021, 3:47 a.m. UTC
PLANE_CUS_CTL has a restriction of 4096 width even though
PLANE_SIZE and scaler size registers supports max 5120.
Take care of this restriction in max_width.

Without this patch, when 5k content is sent on HDR plane
with NV12 content, FIFO underrun is seen and screen blanks
out.

v2: Addressed review comments from Ville. Added separate
functions for max_width - for HDR and SDR

v3: Addressed review comments from Ville. Changed names of
HDR and SDR max_width functions to icl_hdr_plane_max_width
and icl_sdr_plane_max_width

v4: Fixed paranthesis alignment. No code change

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Vidya Srinivas <vidya.srinivas@intel.com>
Signed-off-by: Yashashvi Shantam <shantam.yashashvi@intel.com>
---
 .../drm/i915/display/skl_universal_plane.c    | 21 +++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

Comments

Ville Syrjälä Dec. 1, 2021, 3:02 p.m. UTC | #1
On Wed, Dec 01, 2021 at 09:17:27AM +0530, Vidya Srinivas wrote:
> PLANE_CUS_CTL has a restriction of 4096 width even though
> PLANE_SIZE and scaler size registers supports max 5120.
> Take care of this restriction in max_width.
> 
> Without this patch, when 5k content is sent on HDR plane
> with NV12 content, FIFO underrun is seen and screen blanks
> out.
> 
> v2: Addressed review comments from Ville. Added separate
> functions for max_width - for HDR and SDR
> 
> v3: Addressed review comments from Ville. Changed names of
> HDR and SDR max_width functions to icl_hdr_plane_max_width
> and icl_sdr_plane_max_width
> 
> v4: Fixed paranthesis alignment. No code change
> 
> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Signed-off-by: Vidya Srinivas <vidya.srinivas@intel.com>
> Signed-off-by: Yashashvi Shantam <shantam.yashashvi@intel.com>

Hmm. What's this extra sob doing here?

> ---
>  .../drm/i915/display/skl_universal_plane.c    | 21 +++++++++++++++----
>  1 file changed, 17 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/skl_universal_plane.c b/drivers/gpu/drm/i915/display/skl_universal_plane.c
> index 28890876bdeb..e717eb58b105 100644
> --- a/drivers/gpu/drm/i915/display/skl_universal_plane.c
> +++ b/drivers/gpu/drm/i915/display/skl_universal_plane.c
> @@ -420,9 +420,19 @@ static int icl_plane_min_width(const struct drm_framebuffer *fb,
>  	}
>  }
>  
> -static int icl_plane_max_width(const struct drm_framebuffer *fb,
> -			       int color_plane,
> -			       unsigned int rotation)
> +static int icl_hdr_plane_max_width(const struct drm_framebuffer *fb,
> +				int color_plane,
> +				unsigned int rotation)
> +{
> +	if (intel_format_info_is_yuv_semiplanar(fb->format, fb->modifier))
> +		return 4096;
> +	else
> +		return 5120;
> +}
> +
> +static int icl_sdr_plane_max_width(const struct drm_framebuffer *fb,
> +				int color_plane,
> +				unsigned int rotation)
>  {
>  	return 5120;
>  }
> @@ -2108,7 +2118,10 @@ skl_universal_plane_create(struct drm_i915_private *dev_priv,
>  
>  	if (DISPLAY_VER(dev_priv) >= 11) {
>  		plane->min_width = icl_plane_min_width;
> -		plane->max_width = icl_plane_max_width;
> +		if (icl_is_hdr_plane(dev_priv, plane_id))
> +			plane->max_width = icl_hdr_plane_max_width;
> +		else
> +			plane->max_width = icl_sdr_plane_max_width;
>  		plane->max_height = icl_plane_max_height;
>  		plane->min_cdclk = icl_plane_min_cdclk;
>  	} else if (DISPLAY_VER(dev_priv) >= 10) {
> -- 
> 2.33.0
Srinivas, Vidya Dec. 2, 2021, 3:25 a.m. UTC | #2
> -----Original Message-----
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Sent: Wednesday, December 1, 2021 8:33 PM
> To: Srinivas, Vidya <vidya.srinivas@intel.com>
> Cc: intel-gfx@lists.freedesktop.org; Yashashvi, Shantam
> <shantam.yashashvi@intel.com>
> Subject: Re: [PATCH] drm/i915: Add PLANE_CUS_CTL restriction in max_width
> 
> On Wed, Dec 01, 2021 at 09:17:27AM +0530, Vidya Srinivas wrote:
> > PLANE_CUS_CTL has a restriction of 4096 width even though PLANE_SIZE
> > and scaler size registers supports max 5120.
> > Take care of this restriction in max_width.
> >
> > Without this patch, when 5k content is sent on HDR plane with NV12
> > content, FIFO underrun is seen and screen blanks out.
> >
> > v2: Addressed review comments from Ville. Added separate functions for
> > max_width - for HDR and SDR
> >
> > v3: Addressed review comments from Ville. Changed names of HDR and
> SDR
> > max_width functions to icl_hdr_plane_max_width and
> > icl_sdr_plane_max_width
> >
> > v4: Fixed paranthesis alignment. No code change
> >
> > Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > Signed-off-by: Vidya Srinivas <vidya.srinivas@intel.com>
> > Signed-off-by: Yashashvi Shantam <shantam.yashashvi@intel.com>
> 
> Hmm. What's this extra sob doing here?

Hello Ville, sincere apologies. When I run checkpatch.pl I see no warnings on my host.
However patchwork keeps reporting paranthesis alignment warning.
I tried to push it multiple times after running checkpatch.pl on my host. Really sorry about that.

Regards
Vidya


> 
> > ---
> >  .../drm/i915/display/skl_universal_plane.c    | 21 +++++++++++++++----
> >  1 file changed, 17 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/display/skl_universal_plane.c
> > b/drivers/gpu/drm/i915/display/skl_universal_plane.c
> > index 28890876bdeb..e717eb58b105 100644
> > --- a/drivers/gpu/drm/i915/display/skl_universal_plane.c
> > +++ b/drivers/gpu/drm/i915/display/skl_universal_plane.c
> > @@ -420,9 +420,19 @@ static int icl_plane_min_width(const struct
> drm_framebuffer *fb,
> >  	}
> >  }
> >
> > -static int icl_plane_max_width(const struct drm_framebuffer *fb,
> > -			       int color_plane,
> > -			       unsigned int rotation)
> > +static int icl_hdr_plane_max_width(const struct drm_framebuffer *fb,
> > +				int color_plane,
> > +				unsigned int rotation)
> > +{
> > +	if (intel_format_info_is_yuv_semiplanar(fb->format, fb->modifier))
> > +		return 4096;
> > +	else
> > +		return 5120;
> > +}
> > +
> > +static int icl_sdr_plane_max_width(const struct drm_framebuffer *fb,
> > +				int color_plane,
> > +				unsigned int rotation)
> >  {
> >  	return 5120;
> >  }
> > @@ -2108,7 +2118,10 @@ skl_universal_plane_create(struct
> > drm_i915_private *dev_priv,
> >
> >  	if (DISPLAY_VER(dev_priv) >= 11) {
> >  		plane->min_width = icl_plane_min_width;
> > -		plane->max_width = icl_plane_max_width;
> > +		if (icl_is_hdr_plane(dev_priv, plane_id))
> > +			plane->max_width = icl_hdr_plane_max_width;
> > +		else
> > +			plane->max_width = icl_sdr_plane_max_width;
> >  		plane->max_height = icl_plane_max_height;
> >  		plane->min_cdclk = icl_plane_min_cdclk;
> >  	} else if (DISPLAY_VER(dev_priv) >= 10) {
> > --
> > 2.33.0
> 
> --
> Ville Syrjälä
> Intel
Ville Syrjälä Dec. 2, 2021, 10:55 a.m. UTC | #3
On Thu, Dec 02, 2021 at 03:25:34AM +0000, Srinivas, Vidya wrote:
> 
> 
> > -----Original Message-----
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > Sent: Wednesday, December 1, 2021 8:33 PM
> > To: Srinivas, Vidya <vidya.srinivas@intel.com>
> > Cc: intel-gfx@lists.freedesktop.org; Yashashvi, Shantam
> > <shantam.yashashvi@intel.com>
> > Subject: Re: [PATCH] drm/i915: Add PLANE_CUS_CTL restriction in max_width
> > 
> > On Wed, Dec 01, 2021 at 09:17:27AM +0530, Vidya Srinivas wrote:
> > > PLANE_CUS_CTL has a restriction of 4096 width even though PLANE_SIZE
> > > and scaler size registers supports max 5120.
> > > Take care of this restriction in max_width.
> > >
> > > Without this patch, when 5k content is sent on HDR plane with NV12
> > > content, FIFO underrun is seen and screen blanks out.
> > >
> > > v2: Addressed review comments from Ville. Added separate functions for
> > > max_width - for HDR and SDR
> > >
> > > v3: Addressed review comments from Ville. Changed names of HDR and
> > SDR
> > > max_width functions to icl_hdr_plane_max_width and
> > > icl_sdr_plane_max_width
> > >
> > > v4: Fixed paranthesis alignment. No code change
> > >
> > > Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > Signed-off-by: Vidya Srinivas <vidya.srinivas@intel.com>
> > > Signed-off-by: Yashashvi Shantam <shantam.yashashvi@intel.com>
> > 
> > Hmm. What's this extra sob doing here?
> 
> Hello Ville, sincere apologies. When I run checkpatch.pl I see no warnings on my host.
> However patchwork keeps reporting paranthesis alignment warning.
> I tried to push it multiple times after running checkpatch.pl on my host. Really sorry about that.

I was asking about the extra "signed-off-by" (sob).
Srinivas, Vidya Dec. 2, 2021, 11:10 a.m. UTC | #4
> -----Original Message-----
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Sent: Thursday, December 2, 2021 4:26 PM
> To: Srinivas, Vidya <vidya.srinivas@intel.com>
> Cc: intel-gfx@lists.freedesktop.org; Yashashvi, Shantam
> <shantam.yashashvi@intel.com>
> Subject: Re: [PATCH] drm/i915: Add PLANE_CUS_CTL restriction in max_width
> 
> On Thu, Dec 02, 2021 at 03:25:34AM +0000, Srinivas, Vidya wrote:
> >
> >
> > > -----Original Message-----
> > > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > Sent: Wednesday, December 1, 2021 8:33 PM
> > > To: Srinivas, Vidya <vidya.srinivas@intel.com>
> > > Cc: intel-gfx@lists.freedesktop.org; Yashashvi, Shantam
> > > <shantam.yashashvi@intel.com>
> > > Subject: Re: [PATCH] drm/i915: Add PLANE_CUS_CTL restriction in
> > > max_width
> > >
> > > On Wed, Dec 01, 2021 at 09:17:27AM +0530, Vidya Srinivas wrote:
> > > > PLANE_CUS_CTL has a restriction of 4096 width even though
> > > > PLANE_SIZE and scaler size registers supports max 5120.
> > > > Take care of this restriction in max_width.
> > > >
> > > > Without this patch, when 5k content is sent on HDR plane with NV12
> > > > content, FIFO underrun is seen and screen blanks out.
> > > >
> > > > v2: Addressed review comments from Ville. Added separate functions
> > > > for max_width - for HDR and SDR
> > > >
> > > > v3: Addressed review comments from Ville. Changed names of HDR and
> > > SDR
> > > > max_width functions to icl_hdr_plane_max_width and
> > > > icl_sdr_plane_max_width
> > > >
> > > > v4: Fixed paranthesis alignment. No code change
> > > >
> > > > Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > > Signed-off-by: Vidya Srinivas <vidya.srinivas@intel.com>
> > > > Signed-off-by: Yashashvi Shantam <shantam.yashashvi@intel.com>
> > >
> > > Hmm. What's this extra sob doing here?
> >
> > Hello Ville, sincere apologies. When I run checkpatch.pl I see no warnings
> on my host.
> > However patchwork keeps reporting paranthesis alignment warning.
> > I tried to push it multiple times after running checkpatch.pl on my host.
> Really sorry about that.
> 
> I was asking about the extra "signed-off-by" (sob).

Hello Ville, I am really sorry about that. Should I keep single signed-off-by and push the patch
again? Kindly let me know. Thank you.

Regards
Vidya

> 
> --
> Ville Syrjälä
> Intel
Ville Syrjälä Dec. 2, 2021, 11:13 a.m. UTC | #5
On Thu, Dec 02, 2021 at 11:10:37AM +0000, Srinivas, Vidya wrote:
> 
> 
> > -----Original Message-----
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > Sent: Thursday, December 2, 2021 4:26 PM
> > To: Srinivas, Vidya <vidya.srinivas@intel.com>
> > Cc: intel-gfx@lists.freedesktop.org; Yashashvi, Shantam
> > <shantam.yashashvi@intel.com>
> > Subject: Re: [PATCH] drm/i915: Add PLANE_CUS_CTL restriction in max_width
> > 
> > On Thu, Dec 02, 2021 at 03:25:34AM +0000, Srinivas, Vidya wrote:
> > >
> > >
> > > > -----Original Message-----
> > > > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > > Sent: Wednesday, December 1, 2021 8:33 PM
> > > > To: Srinivas, Vidya <vidya.srinivas@intel.com>
> > > > Cc: intel-gfx@lists.freedesktop.org; Yashashvi, Shantam
> > > > <shantam.yashashvi@intel.com>
> > > > Subject: Re: [PATCH] drm/i915: Add PLANE_CUS_CTL restriction in
> > > > max_width
> > > >
> > > > On Wed, Dec 01, 2021 at 09:17:27AM +0530, Vidya Srinivas wrote:
> > > > > PLANE_CUS_CTL has a restriction of 4096 width even though
> > > > > PLANE_SIZE and scaler size registers supports max 5120.
> > > > > Take care of this restriction in max_width.
> > > > >
> > > > > Without this patch, when 5k content is sent on HDR plane with NV12
> > > > > content, FIFO underrun is seen and screen blanks out.
> > > > >
> > > > > v2: Addressed review comments from Ville. Added separate functions
> > > > > for max_width - for HDR and SDR
> > > > >
> > > > > v3: Addressed review comments from Ville. Changed names of HDR and
> > > > SDR
> > > > > max_width functions to icl_hdr_plane_max_width and
> > > > > icl_sdr_plane_max_width
> > > > >
> > > > > v4: Fixed paranthesis alignment. No code change
> > > > >
> > > > > Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > > > Signed-off-by: Vidya Srinivas <vidya.srinivas@intel.com>
> > > > > Signed-off-by: Yashashvi Shantam <shantam.yashashvi@intel.com>
> > > >
> > > > Hmm. What's this extra sob doing here?
> > >
> > > Hello Ville, sincere apologies. When I run checkpatch.pl I see no warnings
> > on my host.
> > > However patchwork keeps reporting paranthesis alignment warning.
> > > I tried to push it multiple times after running checkpatch.pl on my host.
> > Really sorry about that.
> > 
> > I was asking about the extra "signed-off-by" (sob).
> 
> Hello Ville, I am really sorry about that. Should I keep single signed-off-by and push the patch
> again? Kindly let me know. Thank you.

Yeah, please resend with proper signed-off-by.
Srinivas, Vidya Dec. 2, 2021, 11:19 a.m. UTC | #6
> -----Original Message-----
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Sent: Thursday, December 2, 2021 4:43 PM
> To: Srinivas, Vidya <vidya.srinivas@intel.com>
> Cc: intel-gfx@lists.freedesktop.org; Yashashvi, Shantam
> <shantam.yashashvi@intel.com>
> Subject: Re: [PATCH] drm/i915: Add PLANE_CUS_CTL restriction in max_width
> 
> On Thu, Dec 02, 2021 at 11:10:37AM +0000, Srinivas, Vidya wrote:
> >
> >
> > > -----Original Message-----
> > > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > Sent: Thursday, December 2, 2021 4:26 PM
> > > To: Srinivas, Vidya <vidya.srinivas@intel.com>
> > > Cc: intel-gfx@lists.freedesktop.org; Yashashvi, Shantam
> > > <shantam.yashashvi@intel.com>
> > > Subject: Re: [PATCH] drm/i915: Add PLANE_CUS_CTL restriction in
> > > max_width
> > >
> > > On Thu, Dec 02, 2021 at 03:25:34AM +0000, Srinivas, Vidya wrote:
> > > >
> > > >
> > > > > -----Original Message-----
> > > > > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > > > Sent: Wednesday, December 1, 2021 8:33 PM
> > > > > To: Srinivas, Vidya <vidya.srinivas@intel.com>
> > > > > Cc: intel-gfx@lists.freedesktop.org; Yashashvi, Shantam
> > > > > <shantam.yashashvi@intel.com>
> > > > > Subject: Re: [PATCH] drm/i915: Add PLANE_CUS_CTL restriction in
> > > > > max_width
> > > > >
> > > > > On Wed, Dec 01, 2021 at 09:17:27AM +0530, Vidya Srinivas wrote:
> > > > > > PLANE_CUS_CTL has a restriction of 4096 width even though
> > > > > > PLANE_SIZE and scaler size registers supports max 5120.
> > > > > > Take care of this restriction in max_width.
> > > > > >
> > > > > > Without this patch, when 5k content is sent on HDR plane with
> > > > > > NV12 content, FIFO underrun is seen and screen blanks out.
> > > > > >
> > > > > > v2: Addressed review comments from Ville. Added separate
> > > > > > functions for max_width - for HDR and SDR
> > > > > >
> > > > > > v3: Addressed review comments from Ville. Changed names of HDR
> > > > > > and
> > > > > SDR
> > > > > > max_width functions to icl_hdr_plane_max_width and
> > > > > > icl_sdr_plane_max_width
> > > > > >
> > > > > > v4: Fixed paranthesis alignment. No code change
> > > > > >
> > > > > > Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > > > > Signed-off-by: Vidya Srinivas <vidya.srinivas@intel.com>
> > > > > > Signed-off-by: Yashashvi Shantam <shantam.yashashvi@intel.com>
> > > > >
> > > > > Hmm. What's this extra sob doing here?
> > > >
> > > > Hello Ville, sincere apologies. When I run checkpatch.pl I see no
> > > > warnings
> > > on my host.
> > > > However patchwork keeps reporting paranthesis alignment warning.
> > > > I tried to push it multiple times after running checkpatch.pl on my host.
> > > Really sorry about that.
> > >
> > > I was asking about the extra "signed-off-by" (sob).
> >
> > Hello Ville, I am really sorry about that. Should I keep single
> > signed-off-by and push the patch again? Kindly let me know. Thank you.
> 
> Yeah, please resend with proper signed-off-by.

Hello Ville, I have kept a single signed-off-by and pushed
https://patchwork.freedesktop.org/patch/465010/?series=97053&rev=9
Apologies for bothering you. Thank you very much. Kindly have a check.

Regards
Vidya


> 
> --
> Ville Syrjälä
> Intel
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 28890876bdeb..e717eb58b105 100644
--- a/drivers/gpu/drm/i915/display/skl_universal_plane.c
+++ b/drivers/gpu/drm/i915/display/skl_universal_plane.c
@@ -420,9 +420,19 @@  static int icl_plane_min_width(const struct drm_framebuffer *fb,
 	}
 }
 
-static int icl_plane_max_width(const struct drm_framebuffer *fb,
-			       int color_plane,
-			       unsigned int rotation)
+static int icl_hdr_plane_max_width(const struct drm_framebuffer *fb,
+				int color_plane,
+				unsigned int rotation)
+{
+	if (intel_format_info_is_yuv_semiplanar(fb->format, fb->modifier))
+		return 4096;
+	else
+		return 5120;
+}
+
+static int icl_sdr_plane_max_width(const struct drm_framebuffer *fb,
+				int color_plane,
+				unsigned int rotation)
 {
 	return 5120;
 }
@@ -2108,7 +2118,10 @@  skl_universal_plane_create(struct drm_i915_private *dev_priv,
 
 	if (DISPLAY_VER(dev_priv) >= 11) {
 		plane->min_width = icl_plane_min_width;
-		plane->max_width = icl_plane_max_width;
+		if (icl_is_hdr_plane(dev_priv, plane_id))
+			plane->max_width = icl_hdr_plane_max_width;
+		else
+			plane->max_width = icl_sdr_plane_max_width;
 		plane->max_height = icl_plane_max_height;
 		plane->min_cdclk = icl_plane_min_cdclk;
 	} else if (DISPLAY_VER(dev_priv) >= 10) {