URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=7a70f033b5fbb8d3e5956cc4df30b84f0d4d9653 Author: Kenneth Graunke <kenn...@whitecape.org> Date: Wed Nov 13 15:42:57 2013 -0800
i965: Enable the AMD_performance_monitor extension on Gen5+. Signed-off-by: Kenneth Graunke <kenn...@whitecape.org> Reviewed-by: Eric Anholt <e...@anholt.net> URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=2af1aedeca3db2de7c503e9d3b1fec81b9861f1a Author: Kenneth Graunke <kenn...@whitecape.org> Date: Wed Nov 13 15:36:29 2013 -0800 i965: Take "bookend" OA snapshots at the start/end of each batch. Unfortunately, our hardware only has one set of aggregating performance counters shared between all 3D programs, and their values are not saved or restored by hardware contexts. Also, at least on Sandybridge and Ivybridge, the counters lose their values if the GPU goes to sleep. To work around both of these problems, we have to snapshot the performance counters at the beginning and end of each batch, similar to how we handle query objects on platforms that don't support hardware contexts. I call these "bookend" snapshots. Since there can be multiple performance monitors active at a time, we store the bookend snapshots in a global BO, shared by all monitors. For monitors that span multiple batches, acquiring results involves adding up three segments: BeginPerfMonitor --> End of Batch 1 ("head") Start of Batch 2 --> End of Batch 2 ... ("middle") Start of Batch N-1 --> End of Batch N-1 Start of Batch N --> EndPerfMonitor ("tail") Monitors that refer to bookend BO snapshots are considered "unresolved". We delay resolving them (and adding up deltas to obtain the results) as long as possible to avoid blocking on mapping monitor->oa_bo. We can also run out of space in the bookend BO, at which point we have to resolve all unresolved monitors. Then we can throw away the snapshots and begin writing at the beginning of the buffer. Signed-off-by: Kenneth Graunke <kenn...@whitecape.org> Reviewed-by: Eric Anholt <e...@anholt.net> URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=1172974ddddd785e7441d0eb68cc561b4e8d010f Author: Kenneth Graunke <kenn...@whitecape.org> Date: Tue Oct 22 11:21:43 2013 -0700 i965: Reserve batchbuffer space for a closing MI_REPORT_PERF_COUNT. In order to use the Observability Architecture effectively, we'll need to take snapshots of the OA counters via MI_REPORT_PERF_COUNT at the start and end of each batch. Experimentation reveals that we need to flush before and after each MI_REPORT_PERF_COUNT to get working values. For simplicitly, I chose to use intel_batchbuffer_emit_mi_flush(), which unfortunately expands to triple pipe controls on Sandybridge. We may want to start computing per-generation reserved batch space to avoid the insanity of Sandybridge's PIPE_CONTROL cost. That said, much of this cost existed before I rewrote the query object support to use hardware contexts, so it's at least not entirely new. Signed-off-by: Kenneth Graunke <kenn...@whitecape.org> Reviewed-by: Eric Anholt <e...@anholt.net> URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=fedc14a050cac9cc4501a648b9c84c62fc6e1086 Author: Kenneth Graunke <kenn...@whitecape.org> Date: Wed Nov 13 15:13:59 2013 -0800 i965: Add some plumbing for gathering OA results. Currently, this only considers the monitor start and end snapshots. This is woefully insufficient, but allows me to add a bunch of the infrastructure now and flesh it out later. Signed-off-by: Kenneth Graunke <kenn...@whitecape.org> Reviewed-by: Eric Anholt <e...@anholt.net> URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=c289c70ce156e1248c53f018401a7670b9f513eb Author: Kenneth Graunke <kenn...@whitecape.org> Date: Sat Nov 2 20:58:10 2013 -0700 i965: Start and stop OA counters as necessary. We need to start OA at the beginning of each batch where monitors are active. OACONTROL isn't part of the hardware context, so to avoid leaving counters enabled for other applications, we turn them off at the end of the batch too. We also need to start them at BeginPerfMonitor time (unless they've already been started). We stop them when the monitor last ends as well. Signed-off-by: Kenneth Graunke <kenn...@whitecape.org> Reviewed-by: Eric Anholt <e...@anholt.net> URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=834c9575b281f72385085fc1b9adca3893c9c71e Author: Kenneth Graunke <kenn...@whitecape.org> Date: Wed Nov 13 13:14:46 2013 -0800 i965: Add functions to start and stop the OA counters. Signed-off-by: Kenneth Graunke <kenn...@whitecape.org> Reviewed-by: Eric Anholt <e...@anholt.net> URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=367c7c2d7cbc9a53805162d335405b3b08d46c2d Author: Kenneth Graunke <kenn...@whitecape.org> Date: Wed Mar 27 14:46:05 2013 -0700 i965: Add #defines for the OACONTROL register and fields. We'll need to write this register to start/stop performance counters. Signed-off-by: Kenneth Graunke <kenn...@whitecape.org> Reviewed-by: Eric Anholt <e...@anholt.net> URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=901cae07ffa93910f6ce01263881b1977303d5d5 Author: Kenneth Graunke <kenn...@whitecape.org> Date: Sat Nov 2 20:16:58 2013 -0700 i965: Take OA counter snapshots at Begin/EndPerfMonitor time. Signed-off-by: Kenneth Graunke <kenn...@whitecape.org> Reviewed-by: Eric Anholt <e...@anholt.net> URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=093ecbfe3b8339ef846f46c2a04d32856273a2d7 Author: Kenneth Graunke <kenn...@whitecape.org> Date: Sat Nov 2 18:48:18 2013 -0700 i965: Add a function to emit the MI_REPORT_PERF_COUNT packet. MI_REPORT_PERF_COUNT writes a snapshot of the Observability Architecture counters to a buffer. Exactly how it works varies between generations: Ironlake requires two packets, Sandybridge has to use GGTT, and Ivybridge and later use PPGTT. v2: Assert that we didn't use more space than we reserved (suggested by Eric Anholt). Signed-off-by: Kenneth Graunke <kenn...@whitecape.org> Reviewed-by: Eric Anholt <e...@anholt.net> URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=b05b1eff1c974c897d99f8ae1b3cb480ee39ef67 Author: Kenneth Graunke <kenn...@whitecape.org> Date: Sat Nov 2 19:44:49 2013 -0700 i965: Track the number of monitors that need OA counters. Using the OA counters requires some per-batch work. When starting and ending a batch, it's useful to know whether any monitors are actually interested in OA data. Signed-off-by: Kenneth Graunke <kenn...@whitecape.org> Reviewed-by: Eric Anholt <e...@anholt.net> URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=7329f8dd10673a474554fd881eb09d6908496e0f Author: Kenneth Graunke <kenn...@whitecape.org> Date: Sat Nov 2 19:10:19 2013 -0700 i965: Enumerate Observability Architecture counters on Gen5+. In addition to listing the counter names, we include several "remap" tables. Confusingly, counters are documented with names like "A23", are written to some buffer offset other than 23, and exposed by core Mesa under a counter ID that is different still. The first is inevitable; MI_REPORT_PERF_COUNT writes certain counters to fixed locations in the buffer. The latter could be avoided, but core Mesa uses the "Counters" array index as the ID for a counter. We could do remapping there, but it would just complicate the core Mesa code. Signed-off-by: Kenneth Graunke <kenn...@whitecape.org> Reviewed-by: Eric Anholt <e...@anholt.net> URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=9f41585eb5a42a680cdd167181eebda26a2bff8b Author: Kenneth Graunke <kenn...@whitecape.org> Date: Thu Oct 31 16:27:01 2013 -0700 i965: Expose pipeline statistics registers via performance monitors. This is fairly simple: - At BeginPerfMonitor time, take an opening snapshot. - At EndPerfMonitor time, take a closing snapshot. - The first time the application asks for results, subtract the two and store that value. Then free the BO containing the snapshots. - On subsequent requests for the results, just return the saved value. - On reset, throw away the results. Signed-off-by: Kenneth Graunke <kenn...@whitecape.org> Reviewed-by: Eric Anholt <e...@anholt.net> URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=91950d1aeae6f1c6b0d859e588e59ae52840d4d8 Author: Kenneth Graunke <kenn...@whitecape.org> Date: Thu Oct 31 16:02:35 2013 -0700 i965: Enumerate the pipeline statistics register counters on Gen6+. For now, we only support these on Gen6+, since that's what currently uses hardware contexts. When we add Ironlake hardware context support, we can add pipeline statistics register support for that as well. In theory, we could support pipeline statistics counters even without hardware contexts, but it would be annoyingly painful. Signed-off-by: Kenneth Graunke <kenn...@whitecape.org> Reviewed-by: Eric Anholt <e...@anholt.net> URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=569adb40d7f3fa5084c20dd4b774fb1482d00c9c Author: Kenneth Graunke <kenn...@whitecape.org> Date: Thu Oct 31 16:00:23 2013 -0700 i965: Initialize performance monitor Groups/NumGroups. Since we don't support any counters, there are zero groups. Signed-off-by: Kenneth Graunke <kenn...@whitecape.org> Reviewed-by: Eric Anholt <e...@anholt.net> URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=7bf3cd4315343c3f1e0c36cc5ca1f790857e072a Author: Kenneth Graunke <kenn...@whitecape.org> Date: Thu Oct 31 15:50:19 2013 -0700 i965: Add macros for creating performance monitor counters and groups. The Observability Architecture counters are 32-bit unsigned values, and the Pipeline Statistics Register counters are 64-bit unsigned values. These convenience macros make it easy to create those types of counters. Signed-off-by: Kenneth Graunke <kenn...@whitecape.org> Reviewed-by: Eric Anholt <e...@anholt.net> URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=63b8ce612fa11c9aee5db101d3446c9783bf4111 Author: Kenneth Graunke <kenn...@whitecape.org> Date: Sat Nov 2 19:42:54 2013 -0700 i965: Periodically dump the list of monitors if INTEL_DEBUG=perfmon. It's useful to see the state of all outstanding monitors; the start of a new batch seems like a reasonable time to print them out. Signed-off-by: Kenneth Graunke <kenn...@whitecape.org> Reviewed-by: Eric Anholt <e...@anholt.net> URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=379a246fc190c1bc1664a4ecf24aabca13314c7f Author: Kenneth Graunke <kenn...@whitecape.org> Date: Thu Oct 31 15:42:09 2013 -0700 i965: Add basic driver hooks and plumbing for AMD_performance_monitor. These stub functions will be filled out in later patches. Signed-off-by: Kenneth Graunke <kenn...@whitecape.org> Reviewed-by: Eric Anholt <e...@anholt.net> URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=b64eb100b0c74d1d601f646bb2fe6175fa722450 Author: Kenneth Graunke <kenn...@whitecape.org> Date: Wed Oct 30 23:17:23 2013 -0700 i965: Add INTEL_DEBUG=perfmon support. This will enable debugging printfs for the AMD_performance_monitor code. Signed-off-by: Kenneth Graunke <kenn...@whitecape.org> Reviewed-by: Eric Anholt <e...@anholt.net> URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=a4bf7f6b6e612626c4e4fc21507ac213a7ba4b00 Author: Kenneth Graunke <kenn...@whitecape.org> Date: Tue Oct 15 19:32:53 2013 -0700 i965: Move brw_emit_query_begin() to the render ring prelude. Without hardware contexts, the pipeline statistics registers are free-running and include data from every 3D application running. In order to find out the contributions of one particular context, we need to take a snapshot at the start and end of each batch. Previously, we emitted the PIPE_CONTROL necessary to capture PS_DEPTH_COUNT when drawing primitives. Special tracking ensured it happened only on the first draw of the batch, rather than on every draw. Moving this to brw_new_batch increases symmetry, since the final snapshot has always been in brw_finish_batch, which is just a few lines below. It should be basically equivalent. Signed-off-by: Kenneth Graunke <kenn...@whitecape.org> Reviewed-by: Eric Anholt <e...@anholt.net> URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=bb9d2eab8934fe526e7128e5902fffc2f5a050d3 Author: Kenneth Graunke <kenn...@whitecape.org> Date: Mon Oct 28 20:10:40 2013 -0700 i965: Introduce a "render ring prelude" hook. The new intel_batchbuffer_emit_render_ring_prelude() hook will be called when switching from BLT or UNKNOWN_RING to RENDER_RING. This provides a place to emit state that should go at the start of each render ring batch, with minimal overhead. Signed-off-by: Kenneth Graunke <kenn...@whitecape.org> Reviewed-by: Eric Anholt <e...@anholt.net> URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=395a32717df494353703f3581edcd3ba380f16d6 Author: Kenneth Graunke <kenn...@whitecape.org> Date: Thu Nov 21 14:07:12 2013 -0800 i965: Introduce an UNKNOWN_RING state. When we first create a batch buffer, it's empty. We don't actually know what ring it will be targeted at until the first BEGIN_BATCH or BEGIN_BATCH_BLT macro. Previously, one could determine the state of the batch by checking brw->batch.ring (blit vs. render) and brw->batch.used != 0 (known vs. unknown). This should be functionally equivalent, but the tri-state enum is a bit clearer. v2: Catch three explicit require_space callers (thanks to Carl and Eric). v3: Split the boolean -> enum change from the UNKNOWN_RING change. Signed-off-by: Kenneth Graunke <kenn...@whitecape.org> Reviewed-by: Eric Anholt <e...@anholt.net> URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=6bc40f9af5b35724caff9fa7ced47b2ca6183f22 Author: Kenneth Graunke <kenn...@whitecape.org> Date: Mon Oct 28 16:06:10 2013 -0700 i965: Convert brw->batch.is_blit to a BLT_RING/RENDER_RING enum. Passing BLT_RING or RENDER_RING to batchbuffer functions is a lot more obvious than passing true or false. Signed-off-by: Kenneth Graunke <kenn...@whitecape.org> Reviewed-by: Eric Anholt <e...@anholt.net> _______________________________________________ mesa-commit mailing list mesa-commit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-commit