From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH] drm/i915: Introduce accurate frontbuffer tracking Date: Wed, 18 Jun 2014 17:55:31 +0200 Message-ID: <20140618155531.GK5821@phenom.ffwll.local> References: <1403092757-31421-12-git-send-email-daniel.vetter@ffwll.ch> <1403096485-26669-1-git-send-email-daniel.vetter@ffwll.ch> <20140618145544.GQ31023@nuc-i3427.alporthouse.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-wg0-f49.google.com (mail-wg0-f49.google.com [74.125.82.49]) by gabe.freedesktop.org (Postfix) with ESMTP id 4CA946E36B for ; Wed, 18 Jun 2014 08:55:39 -0700 (PDT) Received: by mail-wg0-f49.google.com with SMTP id y10so1047686wgg.8 for ; Wed, 18 Jun 2014 08:55:38 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20140618145544.GQ31023@nuc-i3427.alporthouse.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Chris Wilson , Daniel Vetter , Intel Graphics Development , Rodrigo Vivi List-Id: intel-gfx@lists.freedesktop.org On Wed, Jun 18, 2014 at 03:55:44PM +0100, Chris Wilson wrote: > On Wed, Jun 18, 2014 at 03:01:25PM +0200, Daniel Vetter wrote: > > +void i915_gem_update_fb_bits(struct drm_i915_gem_object *old, > > + struct drm_i915_gem_object *new, > > + unsigned frontbuffer_bits); > > + > > Time to be a nuisance: > > i915_gem_object_track_fb() > > The key part is that is operates on the object. The other is just to try > and shorten the name as compensation. Hm, I've thought the i915_gem part is a giveaway - I'm not too fond of the i915_gem_obj prefix since it's so long ... > > @@ -1062,6 +1065,7 @@ intel_disable_plane(struct drm_plane *plane) > > struct drm_device *dev = plane->dev; > > struct intel_plane *intel_plane = to_intel_plane(plane); > > struct intel_crtc *intel_crtc; > > + enum pipe pipe; > > > > if (!plane->fb) > > return 0; > > @@ -1070,6 +1074,7 @@ intel_disable_plane(struct drm_plane *plane) > > return -EINVAL; > > > > intel_crtc = to_intel_crtc(plane->crtc); > > + pipe = intel_crtc->pipe; > > > > if (intel_crtc->active) { > > bool primary_was_enabled = intel_crtc->primary_enabled; > > @@ -1088,6 +1093,8 @@ intel_disable_plane(struct drm_plane *plane) > > > > mutex_lock(&dev->struct_mutex); > > intel_unpin_fb_obj(intel_plane->obj); > > + i915_gem_update_fb_bits(intel_plane->obj, NULL, > > + INTEL_FRONTBUFFER_SPRITE(pipe)); > > Introducing a local here for a one off, or was checkpatch in an angry > mood with INTEL_FRONTBUFFER_SPRITE(intel_crtc->pipe) ? Just a case of shortening the line a bit, it looks terribly ugly imo. I hope we can prettify this once we have a bit more unified nuclear flip logic for all planes. > That's all I spotted, the logic looks fine. But just remind me, > i915_gem_object_track_fb() did do a lockdep_assert_held(&dev->struct_mutex)? Yeah, both when new or old are non-NULL, as a prep for per-object locking. If we ever get there ;-) -Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch