[Intel-gfx] [PATCH 2/2] drm/i915: Move drm_framebuffer_unreference out of struct_mutex for takeover

Chris Wilson chris at chris-wilson.co.uk
Tue Mar 10 05:19:32 PDT 2015


On Tue, Mar 10, 2015 at 12:02:28PM +0000, Tvrtko Ursulin wrote:
> >@@ -13707,13 +13709,18 @@ void intel_modeset_gem_init(struct drm_device *dev)
> >  					       NULL)) {
> >  			DRM_ERROR("failed to pin boot fb on pipe %d\n",
> >  				  to_intel_crtc(c)->pipe);
> >-			drm_framebuffer_unreference(c->primary->fb);
> >-			c->primary->fb = NULL;
> >-			update_state_fb(c->primary);
> >+			unused[n_unused++] = c->primary;
> >  		}
> >  	}
> >  	mutex_unlock(&dev->struct_mutex);
> >
> >+	while (n_unused--) {
> >+		struct drm_plane *p = unused[n_unused];
> >+		drm_framebuffer_unreference(p->fb);
> >+		p->fb = NULL;
> >+		update_state_fb(p);
> >+	}
> >+
> 
> For this one I am not sure. Should c->primary->fb = NULL remain
> under the locked loop? If not what is the the mutex protecting then?

It's a dummy mutex that only exists to keep the WARNs quiet. This phase
of initialisation is explicitly single-threaded.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list