From: Paulo Zanoni <paulo.r.zanoni@intel.com>
To: ville.syrjala@linux.intel.com, intel-gfx@lists.freedesktop.org
Cc: stable@vger.kernel.org, Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Subject: Re: [PATCH 3/3] drm/i915: Fix 90/270 rotated coordinates for FBC
Date: Mon, 03 Apr 2017 14:57:39 -0300 [thread overview]
Message-ID: <1491242259.2562.9.camel@intel.com> (raw)
In-Reply-To: <20170331180056.14086-4-ville.syrjala@linux.intel.com>
Em Sex, 2017-03-31 às 21:00 +0300, ville.syrjala@linux.intel.com
escreveu:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> The clipped src coordinates have already been rotated by 270 degrees
> for
> when the plane rotation is 90/270 degrees, hence the FBC code should
> no
> longer swap the width and height.
I've never payed too much attention to rotation, but based on the
mentioned commits, what's said on the messages and my understanding of
the code, this looks sane, so:
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
And in case someone suggests to just kill
intel_fbc_get_plane_source_size(), I'd like to point that "plane source
size" is wording used by our spec and there's a nice comment explaining
what exactly it's supposed to be, so I'd be in favor of keeping it.
Super bonus point if you end up writing some sort of rotation test for
kms_frontbuffer_tracking or kms_fbc_crc. The problem is that I'm not
entirely too sure about how much the current code structure for those
tests is ready to easily support such a test with minimal efforts.
Needs to be studied.
>
> Cc: stable@vger.kernel.org
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
> Fixes: b63a16f6cd89 ("drm/i915: Compute display surface offset in the
> plane check hook for SKL+")
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> drivers/gpu/drm/i915/intel_fbc.c | 19 +++++++------------
> 1 file changed, 7 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_fbc.c
> b/drivers/gpu/drm/i915/intel_fbc.c
> index ded2add18b26..d93c58410bff 100644
> --- a/drivers/gpu/drm/i915/intel_fbc.c
> +++ b/drivers/gpu/drm/i915/intel_fbc.c
> @@ -82,20 +82,10 @@ static unsigned int
> get_crtc_fence_y_offset(struct intel_crtc *crtc)
> static void intel_fbc_get_plane_source_size(struct
> intel_fbc_state_cache *cache,
> int *width, int *height)
> {
> - int w, h;
> -
> - if (drm_rotation_90_or_270(cache->plane.rotation)) {
> - w = cache->plane.src_h;
> - h = cache->plane.src_w;
> - } else {
> - w = cache->plane.src_w;
> - h = cache->plane.src_h;
> - }
> -
> if (width)
> - *width = w;
> + *width = cache->plane.src_w;
> if (height)
> - *height = h;
> + *height = cache->plane.src_h;
> }
>
> static int intel_fbc_calculate_cfb_size(struct drm_i915_private
> *dev_priv,
> @@ -746,6 +736,11 @@ static void intel_fbc_update_state_cache(struct
> intel_crtc *crtc,
> cache->crtc.hsw_bdw_pixel_rate = crtc_state-
> >pixel_rate;
>
> cache->plane.rotation = plane_state->base.rotation;
> + /*
> + * Src coordinates are already rotated by 270 degrees for
> + * the 90/270 degree plane rotation cases (to match the
> + * GTT mapping), hence no need to account for rotation here.
> + */
> cache->plane.src_w = drm_rect_width(&plane_state->base.src)
> >> 16;
> cache->plane.src_h = drm_rect_height(&plane_state->base.src)
> >> 16;
> cache->plane.visible = plane_state->base.visible;
next prev parent reply other threads:[~2017-04-03 17:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20170331180056.14086-1-ville.syrjala@linux.intel.com>
2017-03-31 18:00 ` [PATCH 1/3] drm/i915: Fix scaling check for 90/270 degree plane rotation ville.syrjala
2017-03-31 18:00 ` [PATCH 2/3] drm/i915: Fix SKL+ watermarks for 90/270 rotation ville.syrjala
2017-03-31 18:00 ` [PATCH 3/3] drm/i915: Fix 90/270 rotated coordinates for FBC ville.syrjala
2017-04-03 17:57 ` Paulo Zanoni [this message]
2017-05-19 11:34 ` [Intel-gfx] " Tvrtko Ursulin
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=1491242259.2562.9.camel@intel.com \
--to=paulo.r.zanoni@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=stable@vger.kernel.org \
--cc=tvrtko.ursulin@intel.com \
--cc=ville.syrjala@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).