From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH 14/15] drm/i915: Track frontbuffer invalidation/flushing Date: Tue, 17 Jun 2014 09:45:00 +0200 Message-ID: <20140617074500.GX5821@phenom.ffwll.local> References: <1402941095-27879-1-git-send-email-daniel.vetter@ffwll.ch> <1402941095-27879-15-git-send-email-daniel.vetter@ffwll.ch> <20140617065438.GG17744@nuc-i3427.alporthouse.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-we0-f170.google.com (mail-we0-f170.google.com [74.125.82.170]) by gabe.freedesktop.org (Postfix) with ESMTP id 41B9D6E638 for ; Tue, 17 Jun 2014 00:45:09 -0700 (PDT) Received: by mail-we0-f170.google.com with SMTP id w61so6846383wes.1 for ; Tue, 17 Jun 2014 00:45:08 -0700 (PDT) Content-Disposition: inline In-Reply-To: <20140617065438.GG17744@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 Tue, Jun 17, 2014 at 07:54:38AM +0100, Chris Wilson wrote: > On Mon, Jun 16, 2014 at 07:51:34PM +0200, Daniel Vetter wrote: > > +/** > > + * intel_frontbuffer_flush - flush frontbuffer > > + * @dev: DRM device > > + * @frontbuffer_bits: frontbuffer plane tracking bits > > + * > > + * This function gets called every time rendering on the given planes has > > + * completed and frontbuffer caching can be started again. Flushes will get > > + * delayed if they're blocked by some oustanding asynchronous rendering. > > + * > > + * Can be called without any locks held. > > + */ > > +void intel_frontbuffer_flush(struct drm_device *dev, > > + unsigned frontbuffer_bits) > > intel_fb_complete. My naming convetion was: - intel_frontbuffer: Deals in raw frontbuffer tracking bits. - intel_fb: Takes a gem object, assumes dev->struct_mutex is held. I've stolen these from the intel_mark_fb_busy function. The main functions are flush/invalidate, all the others just add a bit of magic (which delays) around them. Imo invalidate is definitely the right pick if you look at fbc/psr as fancy caches, not sure about flush. Maybe finish given our sw_finish ioctl, but not sure that's better than flush. My thinking is: - invalidate the cache fully (i.e. disable it) - flush data into the cache again (i.e. enable it again) Cheers, Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch