On Sat, 30 Oct 2010 14:04:11 +0100, Peter Clifton <pc...@cam.ac.uk> wrote: > I think I'll need some help with this. I'm by no means a kernel > programmer, so I'm feeling my way in the dark with this. > > I want to design an interface so I can synchronise my GPU idle flags > polling with batchbuffer execution. I'm imagining at a high level, doing > something like this in my application (or mesa). (Hand-wavey-pseudocode)
Here's a thought. It ties in a little with something Arjan was asking for. Have trace events around batchbuffer submit that report the timestamp before and after -- you can do this on G45+ at least using PIPE_CONTROL writes to a temporary BO that the kernel makes for the job. The idle-bit tracing daemon would ask for those events, then run (CPU-side) doing the capture of INSTDONEs and the TIMESTAMP register, and also collecting the perf events. It could throw out reg captures that aren't within start/end of batchbuffers once perf events beyond those points arrive so you don't spew irrelevant data to disk. I think we've got pids of requester in the trace events, so you could correlate the records with which app did the rendering. The tricky part would be that the kernel needs to collect the PIPE_CONTROL-written timestamp values out "some time later" after the GPU is done with them and generate the events at that point -- so if you enabled lots of tracking, you'd see a tracing stream that looks something like: i915_gem_request_submit i915_gem_request_retire i915_gem_request_started # the new gpu-side timestamp event i915_gem_request_finished # the new gpu-side timestamp event
pgpl1cXKrReBs.pgp
Description: PGP signature
_______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx