All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Thomas Hellstrom <thellstrom@vmware.com>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>,
	intel-gfx@lists.freedesktop.org,
	VMware Graphics <linux-graphics-maintainer@vmware.com>,
	dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 3/7] drm/vmwgfx: Stop using plane->fb in vmw_kms_helper_dirty()
Date: Thu, 5 Apr 2018 23:26:30 +0300	[thread overview]
Message-ID: <20180405202630.GM5453@intel.com> (raw)
In-Reply-To: <3d110ea7-7f1e-b9e2-28d2-88b0f7518c08@vmware.com>

On Thu, Apr 05, 2018 at 10:15:57PM +0200, Thomas Hellstrom wrote:
> On 04/05/2018 09:50 PM, Ville Syrjala wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> > Instead of plane->fb (which we're going to deprecate for atomic drivers)
> > we need to look at plane->state->fb. The maze of code leading to
> > vmw_kms_helper_dirty() wasn't particularly clear, but my analysis
> > concluded that the calls originating from vmw_*_primary_plane_atomic_update()
> > all pass in the crtc which means we'll never end up in this branch
> > of the function. All other callers use drm_modeset_lock_all() somewhere
> > higher up, which means accessing plane->state is safe. We'll toss in
> > a lockdep assert to catch wrongdoers.
> >
> > Cc: Thomas Hellstrom <thellstrom@vmware.com>
> > Cc: Sinclair Yeh <syeh@vmware.com>
> > Cc: VMware Graphics <linux-graphics-maintainer@vmware.com>
> > Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> >   drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 15 ++++++++++++---
> >   1 file changed, 12 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
> > index a2a796b4cc23..5a824125c231 100644
> > --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
> > +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
> > @@ -2326,9 +2326,18 @@ int vmw_kms_helper_dirty(struct vmw_private *dev_priv,
> >   	} else {
> >   		list_for_each_entry(crtc, &dev_priv->dev->mode_config.crtc_list,
> >   				    head) {
> > -			if (crtc->primary->fb != &framebuffer->base)
> > -				continue;
> > -			units[num_units++] = vmw_crtc_to_du(crtc);
> > +			struct drm_plane *plane = crtc->primary;
> > +
> > +			/*
> > +			 * vmw_*_primary_plane_atomic_update() pass in the crtc,
> > +			 * and so don't end up here. All other callers use
> > +			 * drm_modeset_lock_all(), hence we can access the
> > +			 * plane state safely.
> > +			 */
> > +			lockdep_assert_held(&plane->mutex);
> > +
> I think we can remove the comment (it's a helper, so current users may 
> not be future users),
> but the lockdep assert should be OK.

OK.

> > +			if (plane->state->fb != &framebuffer->base)
> > +				units[num_units++] = vmw_crtc_to_du(crtc);
> 
> This doesn't seem to do what the original code did...

Whoops. Good catch.

> 
> >   		}
> >   	}
> >   
> 
> /Thomas
> 

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2018-04-05 20:26 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-05 19:50 [PATCH 1/7] drm/arc: Stop consulting plane->fb Ville Syrjala
2018-04-05 19:50 ` [PATCH 2/7] drm/vmwgfx: Stop using plane->fb in vmw_kms_atomic_check_modeset() Ville Syrjala
2018-04-05 20:15   ` Deepak Singh Rawat
2018-04-05 20:29     ` Ville Syrjälä
2018-04-05 20:38       ` Deepak Singh Rawat
2018-04-05 19:50 ` [PATCH 3/7] drm/vmwgfx: Stop using plane->fb in vmw_kms_helper_dirty() Ville Syrjala
2018-04-05 20:15   ` Thomas Hellstrom
2018-04-05 20:26     ` Ville Syrjälä [this message]
2018-04-05 20:33   ` [PATCH v2 " Ville Syrjala
2018-04-06  8:51   ` [PATCH " kbuild test robot
2018-04-05 19:50 ` [PATCH 4/7] drm/vmwgfx: Stop using plane->fb in vmw_kms_update_implicit_fb() Ville Syrjala
2018-04-06 18:21   ` Deepak Singh Rawat
2018-04-05 19:50 ` [PATCH 5/7] drm/vmwgfx: Stop updating plane->fb Ville Syrjala
2018-04-06 19:14   ` Deepak Singh Rawat
2018-04-06 19:35     ` Ville Syrjälä
2018-05-11 15:54       ` Ville Syrjälä
2018-05-16 17:10         ` Deepak Singh Rawat
2018-04-05 19:50 ` [PATCH 6/7] drm/vmwgfx: Stop using plane->fb in atomic_enable() Ville Syrjala
2018-04-06 18:56   ` Deepak Singh Rawat
2018-04-05 19:50 ` [PATCH 7/7] drm/vmwgfx: Stop messing about with plane->fb/old_fb/crtc Ville Syrjala
2018-04-05 20:39   ` Daniel Vetter
2018-04-05 20:07 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/7] drm/arc: Stop consulting plane->fb Patchwork
2018-04-05 20:08 ` [PATCH 1/7] " Daniel Vetter
2018-04-05 20:19   ` Ville Syrjälä
2018-04-05 20:43     ` Daniel Vetter
2018-04-05 20:23 ` ✓ Fi.CI.BAT: success for series starting with [1/7] " Patchwork
2018-04-05 20:51 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/7] drm/arc: Stop consulting plane->fb (rev2) Patchwork
2018-04-05 21:06 ` ✓ Fi.CI.BAT: success " Patchwork
2018-04-05 22:14 ` ✓ Fi.CI.IGT: success for series starting with [1/7] drm/arc: Stop consulting plane->fb Patchwork
2018-04-05 22:50 ` ✗ Fi.CI.IGT: warning for series starting with [1/7] drm/arc: Stop consulting plane->fb (rev2) Patchwork
2018-04-06  5:58   ` Saarinen, Jani
2018-04-06  8:50 ` [PATCH 1/7] drm/arc: Stop consulting plane->fb Alexey Brodkin

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=20180405202630.GM5453@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=linux-graphics-maintainer@vmware.com \
    --cc=thellstrom@vmware.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.