From: Ville Syrjälä <ville.syrj...@linux.intel.com>

The only caller of vmw_kms_update_implicit_fb() is the page_flip
hook which itself gets called with the plane mutex already held.
Hence we can look at plane->state safely. Toss in a lockdep assert
to make the situation more clear.

Cc: Deepak Rawat <dra...@vmware.com>
Cc: Thomas Hellstrom <thellst...@vmware.com>
Cc: Sinclair Yeh <s...@vmware.com>
Cc: VMware Graphics <linux-graphics-maintai...@vmware.com>
Cc: Daniel Vetter <daniel.vet...@ffwll.ch>
Signed-off-by: Ville Syrjälä <ville.syrj...@linux.intel.com>
Reviewed-by: Deepak Rawat <dra...@vmware.com>
---
 drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c 
b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
index 5417eb1b486e..04d51bb639b8 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
@@ -2813,14 +2813,17 @@ void vmw_kms_update_implicit_fb(struct vmw_private 
*dev_priv,
                                struct drm_crtc *crtc)
 {
        struct vmw_display_unit *du = vmw_crtc_to_du(crtc);
+       struct drm_plane *plane = crtc->primary;
        struct vmw_framebuffer *vfb;
 
+       lockdep_assert_held(&plane->mutex);
+
        mutex_lock(&dev_priv->global_kms_state_mutex);
 
        if (!du->is_implicit)
                goto out_unlock;
 
-       vfb = vmw_framebuffer_to_vfb(crtc->primary->fb);
+       vfb = vmw_framebuffer_to_vfb(plane->state->fb);
        WARN_ON_ONCE(dev_priv->num_implicit != 1 &&
                     dev_priv->implicit_fb != vfb);
 
-- 
2.16.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to