public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Matt Roper <matthew.d.roper@intel.com>
To: sonika.jindal@intel.com
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/2] drm/i915: Updating plane parameters for primary plane in setplane
Date: Tue, 19 Aug 2014 13:50:04 -0700	[thread overview]
Message-ID: <20140819205004.GV2245@intel.com> (raw)
In-Reply-To: <1408429603-15058-2-git-send-email-sonika.jindal@intel.com>

On Tue, Aug 19, 2014 at 11:56:42AM +0530, sonika.jindal@intel.com wrote:
> From: Sonika Jindal <sonika.jindal@intel.com>
> 
> Signed-off-by: Sonika Jindal <sonika.jindal@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_display.c |   24 ++++++++++++++++++++++++
>  1 file changed, 24 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index e9b578e..1b0e403 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -11528,6 +11528,21 @@ intel_primary_plane_setplane(struct drm_plane *plane, struct drm_crtc *crtc,
>  		.x2 = intel_crtc->active ? intel_crtc->config.pipe_src_w : 0,
>  		.y2 = intel_crtc->active ? intel_crtc->config.pipe_src_h : 0,
>  	};
> +	const struct {
> +		int crtc_x, crtc_y;
> +		unsigned int crtc_w, crtc_h;
> +		uint32_t src_x, src_y, src_w, src_h;
> +	} orig = {
> +		.crtc_x = crtc_x,
> +		.crtc_y = crtc_y,
> +		.crtc_w = crtc_w,
> +		.crtc_h = crtc_h,
> +		.src_x = src_x,
> +		.src_y = src_y,
> +		.src_w = src_w,
> +		.src_h = src_h,
> +	};
> +	struct intel_plane *intel_plane = to_intel_plane(plane);
>  	bool visible;
>  	int ret;
>  
> @@ -11604,6 +11619,15 @@ intel_primary_plane_setplane(struct drm_plane *plane, struct drm_crtc *crtc,
>  
>  		return 0;
>  	}
> +	intel_plane->crtc_x = orig.crtc_x;
> +	intel_plane->crtc_y = orig.crtc_y;
> +	intel_plane->crtc_w = orig.crtc_w;
> +	intel_plane->crtc_h = orig.crtc_h;
> +	intel_plane->src_x = orig.src_x;
> +	intel_plane->src_y = orig.src_y;
> +	intel_plane->src_w = orig.src_w;
> +	intel_plane->src_h = orig.src_h;
> +	intel_plane->obj = obj;
>  
>  	ret = intel_pipe_set_base(crtc, src.x1, src.y1, fb);
>  	if (ret)

I haven't been following all of this thread carefully, but wouldn't you
want to update the intel_plane fields after the point where the function
can no longer fail?  E.g., if I try to setplane() to a new location
while I have a pageflip pending, my request will fail and the plane
position won't update, yet you're still going to be updating the
internal state tracking variables here.  Then if you do an
intel_plane_restore() later you're going to see the plane jump
unexpectedly.

On the other hand, what about the case where the setplane succeeds, but
the plane isn't visible (either because it's fully clipped or because
your crtc isn't active right now).  Those are other paths through the
intel_primary_plane_setplane() function that don't seem to be updating
the intel_plane fields, even though it seems like you'd want to so that
your plane doesn't snap back to an old position on a later
intel_plane_restore().

Sorry if I'm overlooking something obvious here; I haven't been keeping
up with this whole email thread.


Matt

-- 
Matt Roper
Graphics Software Engineer
IoTG Platform Enabling & Development
Intel Corporation
(916) 356-2795

  reply	other threads:[~2014-08-19 20:49 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-15  8:40 [PATCH 0/6] Add 180 degree primary and sprite rotation sonika.jindal
2014-07-15  8:40 ` [PATCH 1/6] drm/i915: Add 180 degree sprite rotation support sonika.jindal
2014-07-15  8:40 ` [PATCH 2/6] drm/i915: Make intel_plane_restore() return an error sonika.jindal
2014-07-15  8:40 ` [PATCH 3/6] drm: Add rotation_property to mode_config sonika.jindal
2014-07-15 12:13   ` [PATCH] drm: Add rotation_property to mode_config and creating it sonika.jindal
2014-07-28 15:29     ` Ville Syrjälä
2014-07-28 18:47       ` Daniel Vetter
2014-07-29  9:40         ` Ville Syrjälä
2014-07-29 10:30           ` Daniel Vetter
2014-07-31  4:09             ` Jindal, Sonika
2014-08-04 10:29               ` Jindal, Sonika
2014-08-04 11:54                 ` Ville Syrjälä
2014-08-04 12:04                   ` Jindal, Sonika
2014-07-15  8:40 ` [PATCH 4/6] drm/i915: Add rotation property for sprites sonika.jindal
2014-07-15 12:12   ` [PATCH] " sonika.jindal
2014-07-15  8:40 ` [PATCH 5/6] drm/i915: Add 180 degree primary plane rotation support sonika.jindal
2014-07-15  9:11   ` Daniel Vetter
2014-07-15  9:38     ` Jindal, Sonika
2014-07-15 10:31       ` Daniel Vetter
2014-07-15 11:30     ` [PATCH 0/3 v2] Moving creation of rotation_property to drm layer sonika.jindal
2014-07-15 11:30       ` [PATCH 1/4] drm: Add rotation_property to mode_config and creating it sonika.jindal
2014-07-15 11:30       ` [PATCH 2/4] drm/i915: Add rotation property for sprites sonika.jindal
2014-07-15 11:30       ` [PATCH 3/4] drm/i915: Add 180 degree primary plane rotation support sonika.jindal
2014-07-15 12:02       ` [PATCH 0/3 v2] Moving creation of rotation_property to drm layer Daniel Vetter
2014-07-15 12:10         ` Jindal, Sonika
2014-07-15 12:10     ` [PATCH] drm/i915: Add 180 degree primary plane rotation support sonika.jindal
2014-08-07 11:45     ` [PATCH 5/6] " Daniel Vetter
2014-08-07 12:11       ` Daniel Vetter
2014-08-11 11:07         ` Jindal, Sonika
2014-08-11 11:42           ` Daniel Vetter
2014-08-11 12:07             ` Jindal, Sonika
2014-08-11 12:23               ` Daniel Vetter
2014-08-12  3:25                 ` Jindal, Sonika
2014-08-19  6:26                   ` [PATCH 0/2] 180 Primary plane rotation: calling setplane in set_property sonika.jindal
2014-08-19  6:26                     ` [PATCH 1/2] drm/i915: Updating plane parameters for primary plane in setplane sonika.jindal
2014-08-19 20:50                       ` Matt Roper [this message]
2014-08-20  5:53                         ` Jindal, Sonika
2014-08-21  6:14                           ` sonika.jindal
2014-08-25 20:42                             ` Daniel Vetter
2014-08-19  6:26                     ` [PATCH 2/2] drm/i915: Add 180 degree primary plane rotation support sonika.jindal
2014-08-19 22:51                       ` Matt Roper
2014-08-20  5:36                         ` Jindal, Sonika
2014-08-21  6:15                           ` sonika.jindal
2014-08-21  8:33                             ` Ville Syrjälä
2014-08-21 11:44                               ` Jindal, Sonika
2014-08-21 13:37                                 ` Ville Syrjälä
2014-08-22  3:59                                   ` Jindal, Sonika
2014-08-22  6:58                                     ` [PATCH] " sonika.jindal
2014-08-22  8:14                                     ` [PATCH 2/2] " Ville Syrjälä
2014-08-22  8:22                                       ` Jindal, Sonika
2014-08-22  8:36                                       ` [PATCH] " sonika.jindal
2014-08-25 20:50                                         ` Daniel Vetter
2014-07-15  8:40 ` [PATCH 6/6] drm: Resetting rotation property sonika.jindal
2014-08-04 12:01   ` Ville Syrjälä
2014-08-04 12:03     ` Jindal, Sonika
2014-07-15 10:52 ` [PATCH 0/6] Add 180 degree primary and sprite rotation Damien Lespiau
2014-07-15 10:55   ` Jindal, Sonika
2014-07-15 10:57     ` Damien Lespiau

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=20140819205004.GV2245@intel.com \
    --to=matthew.d.roper@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=sonika.jindal@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