Skip to content

Commit c61200c

Browse files
jljusten2danvet
authored andcommitted
drm/i915: Add GPGPU_THREADS_DISPATCHED to the register whitelist
This will allow us to read the number of dispatched compute threads for GL_ARB_pipeline_statistics_query. Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Cc: Ben Widawsky <ben@bwidawsk.net> Reviewed-by: Ben Widawsky <ben@bwidawsk.net> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
1 parent 7174537 commit c61200c

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

drivers/gpu/drm/i915/i915_cmd_parser.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,7 @@ static const struct drm_i915_cmd_table hsw_blt_ring_cmds[] = {
405405
#define REG64(addr) (addr), (addr + sizeof(u32))
406406

407407
static const u32 gen7_render_regs[] = {
408+
REG64(GPGPU_THREADS_DISPATCHED),
408409
REG64(HS_INVOCATION_COUNT),
409410
REG64(DS_INVOCATION_COUNT),
410411
REG64(IA_VERTICES_COUNT),
@@ -1153,6 +1154,7 @@ int i915_cmd_parser_get_version(void)
11531154
* hardware parsing enabled (so does not allow new use cases).
11541155
* 2. Allow access to the MI_PREDICATE_SRC0 and
11551156
* MI_PREDICATE_SRC1 registers.
1157+
* 3. Allow access to the GPGPU_THREADS_DISPATCHED register.
11561158
*/
1157-
return 2;
1159+
return 3;
11581160
}

drivers/gpu/drm/i915/i915_reg.h

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -463,17 +463,18 @@
463463
*/
464464
#define BCS_SWCTRL 0x22200
465465

466-
#define HS_INVOCATION_COUNT 0x2300
467-
#define DS_INVOCATION_COUNT 0x2308
468-
#define IA_VERTICES_COUNT 0x2310
469-
#define IA_PRIMITIVES_COUNT 0x2318
470-
#define VS_INVOCATION_COUNT 0x2320
471-
#define GS_INVOCATION_COUNT 0x2328
472-
#define GS_PRIMITIVES_COUNT 0x2330
473-
#define CL_INVOCATION_COUNT 0x2338
474-
#define CL_PRIMITIVES_COUNT 0x2340
475-
#define PS_INVOCATION_COUNT 0x2348
476-
#define PS_DEPTH_COUNT 0x2350
466+
#define GPGPU_THREADS_DISPATCHED 0x2290
467+
#define HS_INVOCATION_COUNT 0x2300
468+
#define DS_INVOCATION_COUNT 0x2308
469+
#define IA_VERTICES_COUNT 0x2310
470+
#define IA_PRIMITIVES_COUNT 0x2318
471+
#define VS_INVOCATION_COUNT 0x2320
472+
#define GS_INVOCATION_COUNT 0x2328
473+
#define GS_PRIMITIVES_COUNT 0x2330
474+
#define CL_INVOCATION_COUNT 0x2338
475+
#define CL_PRIMITIVES_COUNT 0x2340
476+
#define PS_INVOCATION_COUNT 0x2348
477+
#define PS_DEPTH_COUNT 0x2350
477478

478479
/* There are the 4 64-bit counter registers, one for each stream output */
479480
#define GEN7_SO_NUM_PRIMS_WRITTEN(n) (0x5200 + (n) * 8)

0 commit comments

Comments
 (0)