[Intel-gfx] intel_prepare_render(intel); unhelpful?

Peter Clifton pcjc2 at cam.ac.uk
Mon Nov 1 20:20:42 CET 2010


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




More information about the Intel-gfx mailing list