Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Matt Roper <matthew.d.roper@intel.com>
Cc: intel-gfx@lists.freedesktop.org,
	Gustavo Padovan <gustavo.padovan@collabora.co.uk>
Subject: Re: [PATCH 4/5] drm/i915: Don't store panning coordinates as 16.16 fixed point
Date: Tue, 18 Nov 2014 21:52:42 +0200	[thread overview]
Message-ID: <20141118195242.GQ10649@intel.com> (raw)
In-Reply-To: <1416276639-30297-5-git-send-email-matthew.d.roper@intel.com>

On Mon, Nov 17, 2014 at 06:10:38PM -0800, Matt Roper wrote:
> When using the universal plane interface, the source rectangle
> coordinates define the panning offset for the primary plane, which needs
> to be stored in crtc->{x,y}.  The original universal plane code
> negelected to set these panning offset fields, which was partially
> remedied in:
> 
>         commit ccc759dc2a0214fd8b65ed4ebe78050874a67f94
>         Author: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
>         Date:   Wed Sep 24 14:20:22 2014 -0300
> 
>             drm/i915: Merge of visible and !visible paths for primary planes
> 
> However the plane source coordinates are provided in 16.16 fixed point
> format and the above commit forgot to convert back to integer
> coordinates before saving the values.  When we replace
> intel_pipe_set_base() with plane->funcs->update_plane() in a future
> patch, this bug becomes visible via the set_config entrypoint as well as
> update_plane.
> 
> Cc: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
> Testcase: igt/kms_plane
> Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_display.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 8dbc0e9..1c1886e 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -11668,8 +11668,8 @@ intel_commit_primary_plane(struct drm_plane *plane,
>  	struct drm_rect *src = &state->src;
>  
>  	crtc->primary->fb = fb;
> -	crtc->x = src->x1;
> -	crtc->y = src->y1;
> +	crtc->x = src->x1 >> 16;
> +	crtc->y = src->y1 >> 16;

Oh I had the notion that we shift these down during the check phase.
But I see we only do that for sprites. We should pick one approach
and use it for all planes. I suppose keeping to the 16.16 format is
the better option in anticipation of the day when we have planes
which can do sub-pixel panning.

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

>  
>  	intel_plane->crtc_x = state->orig_dst.x1;
>  	intel_plane->crtc_y = state->orig_dst.y1;
> -- 
> 1.8.5.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

  reply	other threads:[~2014-11-18 19:53 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-18  2:10 [PATCH 0/5] i915 display refactoring Matt Roper
2014-11-18  2:10 ` [PATCH 1/5] drm: Refactor mode stereo doubling into its own function Matt Roper
2014-11-18  2:10 ` [PATCH 2/5] drm: add helper to get crtc timings (v2) Matt Roper
2014-11-18  7:56   ` Daniel Vetter
2014-11-18  8:49   ` Jani Nikula
2014-11-18 17:12   ` [PATCH 2/5] drm: add helper to get crtc timings (v3) Matt Roper
2014-11-18 20:11     ` Ville Syrjälä
2014-11-18  2:10 ` [PATCH 3/5] drm/i915: remove intel_crtc_cursor_set_obj() (v5) Matt Roper
2014-11-18  2:10 ` [PATCH 4/5] drm/i915: Don't store panning coordinates as 16.16 fixed point Matt Roper
2014-11-18 19:52   ` Ville Syrjälä [this message]
2014-11-18  2:10 ` [PATCH 5/5] drm/i915: remove intel_pipe_set_base() (v3) Matt Roper
2014-11-18  8:34   ` shuang.he
2014-11-18 20:35   ` Ville Syrjälä
2014-11-18 21:25   ` Jesse Barnes

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=20141118195242.GQ10649@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=gustavo.padovan@collabora.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=matthew.d.roper@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