All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/2] drm/i915: Relocate SKL+ NV12 src width w/a
Date: Tue, 23 Oct 2018 16:40:59 +0300	[thread overview]
Message-ID: <20181023134059.GT9144@intel.com> (raw)
In-Reply-To: <d249091f-a9c6-067c-b9f1-1b028b4dbece@linux.intel.com>

On Tue, Oct 23, 2018 at 03:25:03PM +0200, Maarten Lankhorst wrote:
> Op 18-10-18 om 21:59 schreef Ville Syrjala:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> > The SKL+ NV12 src width alignment w/a is still living in an odd place.
> > Everything else was already relocated closer to the main plane check
> > function. Move this workaround as well.
> >
> > As a bonus we avoid the funky rotated vs. not mess with the src
> > coordinates as this now gets checked before we rotate the coordinates.
> >
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_display.c | 25 -------------------------
> >  drivers/gpu/drm/i915/intel_sprite.c  | 21 +++++++++++++++++++++
> >  2 files changed, 21 insertions(+), 25 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > index fc7e3b0bd95c..940d514cf9d7 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -3049,28 +3049,6 @@ static int skl_check_main_surface(struct intel_plane_state *plane_state)
> >  	return 0;
> >  }
> >  
> > -static int
> > -skl_check_nv12_surface(struct intel_plane_state *plane_state)
> > -{
> > -	/* Display WA #1106 */
> > -	if (plane_state->base.rotation !=
> > -	    (DRM_MODE_REFLECT_X | DRM_MODE_ROTATE_90) &&
> > -	    plane_state->base.rotation != DRM_MODE_ROTATE_270)
> > -		return 0;
> > -
> > -	/*
> > -	 * src coordinates are rotated here.
> > -	 * We check height but report it as width
> > -	 */
> > -	if (((drm_rect_height(&plane_state->base.src) >> 16) % 4) != 0) {
> > -		DRM_DEBUG_KMS("src width must be multiple "
> > -			      "of 4 for rotated NV12\n");
> > -		return -EINVAL;
> > -	}
> > -
> > -	return 0;
> > -}
> > -
> >  static int skl_check_nv12_aux_surface(struct intel_plane_state *plane_state)
> >  {
> >  	const struct drm_framebuffer *fb = plane_state->base.fb;
> > @@ -3153,9 +3131,6 @@ int skl_check_plane_surface(struct intel_plane_state *plane_state)
> >  	 * the main surface setup depends on it.
> >  	 */
> >  	if (fb->format->format == DRM_FORMAT_NV12) {
> > -		ret = skl_check_nv12_surface(plane_state);
> > -		if (ret)
> > -			return ret;
> >  		ret = skl_check_nv12_aux_surface(plane_state);
> >  		if (ret)
> >  			return ret;
> > diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
> > index 7cd59eee5cad..0fe6c664e83c 100644
> > --- a/drivers/gpu/drm/i915/intel_sprite.c
> > +++ b/drivers/gpu/drm/i915/intel_sprite.c
> > @@ -1342,6 +1342,23 @@ static int skl_plane_check_dst_coordinates(const struct intel_crtc_state *crtc_s
> >  	return 0;
> >  }
> >  
> > +static int skl_plane_check_nv12_rotation(const struct intel_plane_state *plane_state)
> > +{
> > +	const struct drm_framebuffer *fb = plane_state->base.fb;
> > +	unsigned int rotation = plane_state->base.rotation;
> > +	int src_w = drm_rect_width(&plane_state->base.src) >> 16;
> > +
> > +	/* Display WA #1106 */
> > +	if (fb->format->format == DRM_FORMAT_NV12 && src_w & 3 &&
> Could we put more nv12 checks here? I want to pull the scaler SRC W/H checks in as well..

Hmm. The way those are done atm is a bit funky, but there isa the 
nv12 vs. not-nv12 limits to consider there as well. Not really sure
what the best approach is.

> 
> Probably stylize it a bit with an early return for !NV12, so all checks come after that. :)
> 
> ~Maarten
> 
> Other than that patch 1-2 look good, so have a r-b with or without those suggested changes.

Thanks. I think I'll smash these in as is for now and think a bit more
about the scaler stuff.

> > +	    (rotation == DRM_MODE_ROTATE_270 ||
> > +	     rotation == (DRM_MODE_REFLECT_X | DRM_MODE_ROTATE_90))) {
> > +		DRM_DEBUG_KMS("src width must be multiple of 4 for rotated NV12\n");
> > +		return -EINVAL;
> > +	}
> > +
> > +	return 0;
> > +}
> > +
> >  static int skl_plane_check(struct intel_crtc_state *crtc_state,
> >  			   struct intel_plane_state *plane_state)
> >  {
> > @@ -1380,6 +1397,10 @@ static int skl_plane_check(struct intel_crtc_state *crtc_state,
> >  	if (ret)
> >  		return ret;
> >  
> > +	ret = skl_plane_check_nv12_rotation(plane_state);
> > +	if (ret)
> > +		return ret;
> > +
> >  	ret = skl_check_plane_surface(plane_state);
> >  	if (ret)
> >  		return ret;
> 

-- 
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2018-10-23 13:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-18 19:59 [PATCH 1/2] drm/i915: Relocate SKL+ NV12 src width w/a Ville Syrjala
2018-10-18 19:59 ` [PATCH 2/2] drm/i915: Move the SKL+ zero constant alpha handling Ville Syrjala
2018-10-18 20:56 ` ✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915: Relocate SKL+ NV12 src width w/a Patchwork
2018-10-19  0:13 ` ✗ Fi.CI.IGT: failure " Patchwork
2018-10-23 13:25 ` [PATCH 1/2] " Maarten Lankhorst
2018-10-23 13:40   ` Ville Syrjälä [this message]
2018-10-23 13:49     ` Maarten Lankhorst
2018-10-23 14:22 ` ✗ Fi.CI.BAT: failure for series starting with [1/2] " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181023134059.GT9144@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=maarten.lankhorst@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.