Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Clifton <pcjc2@cam.ac.uk>
To: Eric Anholt <eric@anholt.net>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>
Subject: Re: intel_prepare_render(intel); unhelpful?
Date: Mon, 01 Nov 2010 19:20:42 +0000	[thread overview]
Message-ID: <1288639242.21440.50.camel@pcjc2lap> (raw)
In-Reply-To: <877hgxwvfp.fsf@pollan.anholt.net>

On Sun, 2010-10-31 at 20:54 -0700, Eric Anholt wrote:
> On Sun, 31 Oct 2010 01:15:34 +0000, Peter Clifton <pcjc2@cam.ac.uk> 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)

  reply	other threads:[~2010-11-01 19:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-31  1:15 intel_prepare_render(intel); unhelpful? Peter Clifton
2010-11-01  3:54 ` Eric Anholt
2010-11-01 19:20   ` Peter Clifton [this message]
2010-11-01 19:52   ` Peter Clifton
2010-11-01 20:17     ` Eric Anholt
     [not found]       ` <1288645484.2714.2.camel@pcjc2lap>
     [not found]         ` <874oc0203e.fsf@pollan.anholt.net>
2010-11-01 22:19           ` Peter Clifton
2010-11-02 15:40             ` Eric Anholt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1288639242.21440.50.camel@pcjc2lap \
    --to=pcjc2@cam.ac.uk \
    --cc=eric@anholt.net \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox