All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sinclair Yeh <syeh@vmware.com>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: Thomas Hellstrom <thellstrom@vmware.com>,
	Daniel Vetter <daniel.vetter@ffwll.ch>,
	intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	VMware Graphics <linux-graphics-maintainer@vmware.com>,
	Deepak Rawat <drawat@vmware.com>
Subject: Re: [PATCH v2 02/13] drm/vmwgfx: Stop using plane->fb in vmw_kms_helper_dirty()
Date: Mon, 4 Jun 2018 11:13:53 -0700	[thread overview]
Message-ID: <20180604181352.GA31191@vmware.com> (raw)
In-Reply-To: <20180530200857.GS23723@intel.com>

On Wed, May 30, 2018 at 11:08:57PM +0300, Ville Syrjälä wrote:
> On Fri, May 25, 2018 at 09:50:34PM +0300, 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.
> > 
> > v2: Drop the comment and make the code do what it did before (Thomas)
> > 
> > Cc: Deepak Rawat <drawat@vmware.com>
> > 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 | 9 ++++++---
> >  1 file changed, 6 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
> > index 2e4c38bb846d..5417eb1b486e 100644
> > --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
> > +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
> > @@ -2326,9 +2326,12 @@ 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;
> > +
> > +			lockdep_assert_held(&plane->mutex);
> 
> kbuild test robot told me
> >> include/linux/lockdep.h:347:52: error: 'struct drm_modeset_lock' has
> >> no member named 'dep_map'                      
>     #define lockdep_is_held(lock)  lock_is_held(&(lock)->dep_map)                                                      
> 
> Maybe I'll just drop the asserts? Or do people really want them
> (in which case I gues I need to dig out the underlying mutex)?

Eitherway is fine with me.


> 
> > +
> > +			if (plane->state->fb == &framebuffer->base)
> > +				units[num_units++] = vmw_crtc_to_du(crtc);
> >  		}
> >  	}
> >  
> > -- 
> > 2.16.1
> 
> -- 
> 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-06-04 18:13 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-25 18:50 [PATCH v2 00/13] drm: Eliminate plane->fb/crtc usage for atomic drivers Ville Syrjala
2018-05-25 18:50 ` [PATCH v2 01/13] drm/vmwgfx: Stop using plane->fb in vmw_kms_atomic_check_modeset() Ville Syrjala
2018-05-25 18:50 ` [PATCH v2 02/13] drm/vmwgfx: Stop using plane->fb in vmw_kms_helper_dirty() Ville Syrjala
2018-05-30 20:08   ` Ville Syrjälä
2018-06-04 18:13     ` Sinclair Yeh [this message]
2018-06-11 17:58       ` Ville Syrjälä
2018-05-25 18:50 ` [PATCH v2 03/13] drm/vmwgfx: Stop using plane->fb in vmw_kms_update_implicit_fb() Ville Syrjala
2018-05-25 18:50 ` [PATCH v2 04/13] drm/vmwgfx: Stop updating plane->fb Ville Syrjala
2018-05-25 18:50 ` [PATCH v2 05/13] drm/vmwgfx: Stop using plane->fb in atomic_enable() Ville Syrjala
2018-05-25 18:50 ` [PATCH v2 06/13] drm/vmwgfx: Stop messing about with plane->fb/old_fb/crtc Ville Syrjala
2018-05-25 18:50 ` [PATCH v2 07/13] drm/amdgpu/dc: Stop updating plane->fb Ville Syrjala
2018-05-25 18:50 ` [PATCH v2 08/13] drm/i915: Stop updating plane->fb/crtc Ville Syrjala
2018-05-25 18:50 ` [PATCH v2 09/13] drm/exynos: Stop updating plane->crtc Ville Syrjala
     [not found] ` <20180525185045.29689-1-ville.syrjala-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2018-05-25 18:50   ` [PATCH v2 10/13] drm/msm: Stop updating plane->fb/crtc Ville Syrjala
2018-05-25 18:50 ` [PATCH v2 11/13] drm/virtio: Stop updating plane->crtc Ville Syrjala
2018-05-25 18:50 ` Ville Syrjala
2018-05-25 18:50 ` [PATCH v2 12/13] drm/vc4: Stop updating plane->fb/crtc Ville Syrjala
2018-05-30 19:31   ` Eric Anholt
2018-05-25 18:50 ` [PATCH v2 13/13] drm: Stop updating plane->crtc/fb/old_fb on atomic drivers Ville Syrjala
2018-05-25 19:12 ` ✗ Fi.CI.CHECKPATCH: warning for drm: Eliminate plane->fb/crtc usage for atomic drivers (rev6) Patchwork
2018-05-25 19:29 ` ✓ Fi.CI.BAT: success " Patchwork
2018-05-26  6:02 ` ✓ Fi.CI.IGT: " Patchwork
2018-05-30 17:41 ` [PATCH v2 00/13] drm: Eliminate plane->fb/crtc usage for atomic drivers Sinclair Yeh

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=20180604181352.GA31191@vmware.com \
    --to=syeh@vmware.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=drawat@vmware.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=linux-graphics-maintainer@vmware.com \
    --cc=thellstrom@vmware.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 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.