From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Clifton Subject: Re: intel_prepare_render(intel); unhelpful? Date: Mon, 01 Nov 2010 19:20:42 +0000 Message-ID: <1288639242.21440.50.camel@pcjc2lap> References: <1288487734.3762.12.camel@pcjc2lap> <877hgxwvfp.fsf@pollan.anholt.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from ppsw-51.csi.cam.ac.uk (ppsw-51.csi.cam.ac.uk [131.111.8.151]) by gabe.freedesktop.org (Postfix) with ESMTP id 8426D9E764 for ; Mon, 1 Nov 2010 12:20:45 -0700 (PDT) In-Reply-To: <877hgxwvfp.fsf@pollan.anholt.net> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Eric Anholt , "intel-gfx@lists.freedesktop.org" List-Id: intel-gfx@lists.freedesktop.org On Sun, 2010-10-31 at 20:54 -0700, Eric Anholt wrote: > On Sun, 31 Oct 2010 01:15:34 +0000, Peter Clifton wrote: > > For instance, in intelClear() we call it - AIUI, flushing rendering > > before code execution continues. Nasty ;( > > I don't see flushing in intel_prepare_render() unless you're using > frontbuffer rendering, which you shouldn't be. Hmm.. no, I'm not rendering to the front buffer - and having re-read the code, I see what you mean. I'll have to investigate further what is going on, as I'm sure I noted a change in performance when I removed the call. Perhaps some extra data is warranted here. The batchbuffers I'm ending up with aren't small, so perhaps I'm hitting a penalty at the end of intel_prepare_render() with the throttling. I think the throttling logic looks suspect too, but I'll fetch and read / try your new code before I go much more into depth on the existing implementation. However.. this is my understanding of it: The comments in the code suggest the intention is to wait on the "swapbuffers before the one we just emitted", but I think the code does this instead: Render frame into back-buffer: (CPU: Render commands) Reference Batch1 (to be submitted) as first_post_swapbuffers Batch1 (After any previous GPU commands) (CPU: Render commands) Batch2 (After Batch1) (CPU: Render commands) Batch3 (After Batch2) Swap buffers: (Sets need_throttle flag) Swap1 (After batch3) Render frame into back-buffer (Queued to wait for Swap1 - ON GPU?) (CPU: Render commands) First intel_prepare_render call stalls _CPU_ waiting for Batch1 to complete Reference Batch4 (to be submitted) as first_post_swapbuffers Batch4 (After Swap1) (CPU: Render commands) Batch5 (After Batch4) (CPU: Render commands) Batch6 (After Batch5) Swap buffers: (Sets need_throttle flag) Swap2 (After Batch6 - ON GPU?) Render frame into back-buffer (CPU: Render commands) First intel_prepare_render call stalls _CPU_ waiting for Batch4 to complete Reference Batch 7 (to be submitted) as first_post_swapbuffers Batch7 (CPU: Render commands) Batch8 (CPU: Render commands) Batch9 .... -- Peter Clifton Electrical Engineering Division, Engineering Department, University of Cambridge, 9, JJ Thomson Avenue, Cambridge CB3 0FA Tel: +44 (0)7729 980173 - (No signal in the lab!) Tel: +44 (0)1223 748328 - (Shared lab phone, ask for me)