mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-29 21:00:16 +01:00
i965: Delete duplicate write_timestamp function.
brw_queryobj.c needs a version of write_timestamp that works on all generations for the QueryCounter() driver hook. So there's no point in duplicating it in gen6_queryobj.c. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Chris Forbes <chrisf@ijw.co.nz> Reviewed-by: Eric Anholt <eric@anholt.net>
This commit is contained in:
parent
532b1fecd9
commit
db1dc21a75
3 changed files with 8 additions and 39 deletions
|
|
@ -1559,6 +1559,7 @@ void brw_emit_query_end(struct brw_context *brw);
|
|||
|
||||
/** gen6_queryobj.c */
|
||||
void gen6_init_queryobj_functions(struct dd_function_table *functions);
|
||||
void brw_write_timestamp(struct brw_context *brw, drm_intel_bo *bo, int idx);
|
||||
void brw_store_register_mem64(struct brw_context *brw,
|
||||
drm_intel_bo *bo, uint32_t reg, int idx);
|
||||
|
||||
|
|
|
|||
|
|
@ -46,8 +46,8 @@
|
|||
/**
|
||||
* Emit PIPE_CONTROLs to write the current GPU timestamp into a buffer.
|
||||
*/
|
||||
static void
|
||||
write_timestamp(struct brw_context *brw, drm_intel_bo *query_bo, int idx)
|
||||
void
|
||||
brw_write_timestamp(struct brw_context *brw, drm_intel_bo *query_bo, int idx)
|
||||
{
|
||||
if (brw->gen >= 6) {
|
||||
/* Emit workaround flushes: */
|
||||
|
|
@ -269,7 +269,7 @@ brw_begin_query(struct gl_context *ctx, struct gl_query_object *q)
|
|||
*/
|
||||
drm_intel_bo_unreference(query->bo);
|
||||
query->bo = drm_intel_bo_alloc(brw->bufmgr, "timer query", 4096, 4096);
|
||||
write_timestamp(brw, query->bo, 0);
|
||||
brw_write_timestamp(brw, query->bo, 0);
|
||||
break;
|
||||
|
||||
case GL_ANY_SAMPLES_PASSED:
|
||||
|
|
@ -321,7 +321,7 @@ brw_end_query(struct gl_context *ctx, struct gl_query_object *q)
|
|||
switch (query->Base.Target) {
|
||||
case GL_TIME_ELAPSED_EXT:
|
||||
/* Write the final timestamp. */
|
||||
write_timestamp(brw, query->bo, 1);
|
||||
brw_write_timestamp(brw, query->bo, 1);
|
||||
break;
|
||||
|
||||
case GL_ANY_SAMPLES_PASSED:
|
||||
|
|
@ -515,7 +515,7 @@ brw_query_counter(struct gl_context *ctx, struct gl_query_object *q)
|
|||
|
||||
drm_intel_bo_unreference(query->bo);
|
||||
query->bo = drm_intel_bo_alloc(brw->bufmgr, "timestamp query", 4096, 4096);
|
||||
write_timestamp(brw, query->bo, 0);
|
||||
brw_write_timestamp(brw, query->bo, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -39,38 +39,6 @@
|
|||
#include "intel_batchbuffer.h"
|
||||
#include "intel_reg.h"
|
||||
|
||||
/**
|
||||
* Emit PIPE_CONTROLs to write the current GPU timestamp into a buffer.
|
||||
*/
|
||||
static void
|
||||
write_timestamp(struct brw_context *brw, drm_intel_bo *query_bo, int idx)
|
||||
{
|
||||
/* Emit workaround flushes: */
|
||||
if (brw->gen == 6) {
|
||||
/* The timestamp write below is a non-zero post-sync op, which on
|
||||
* Gen6 necessitates a CS stall. CS stalls need stall at scoreboard
|
||||
* set. See the comments for intel_emit_post_sync_nonzero_flush().
|
||||
*/
|
||||
BEGIN_BATCH(4);
|
||||
OUT_BATCH(_3DSTATE_PIPE_CONTROL | (4 - 2));
|
||||
OUT_BATCH(PIPE_CONTROL_CS_STALL | PIPE_CONTROL_STALL_AT_SCOREBOARD);
|
||||
OUT_BATCH(0);
|
||||
OUT_BATCH(0);
|
||||
ADVANCE_BATCH();
|
||||
}
|
||||
|
||||
BEGIN_BATCH(5);
|
||||
OUT_BATCH(_3DSTATE_PIPE_CONTROL | (5 - 2));
|
||||
OUT_BATCH(PIPE_CONTROL_WRITE_TIMESTAMP);
|
||||
OUT_RELOC(query_bo,
|
||||
I915_GEM_DOMAIN_INSTRUCTION, I915_GEM_DOMAIN_INSTRUCTION,
|
||||
PIPE_CONTROL_GLOBAL_GTT_WRITE |
|
||||
idx * sizeof(uint64_t));
|
||||
OUT_BATCH(0);
|
||||
OUT_BATCH(0);
|
||||
ADVANCE_BATCH();
|
||||
}
|
||||
|
||||
/**
|
||||
* Emit PIPE_CONTROLs to write the PS_DEPTH_COUNT register into a buffer.
|
||||
*/
|
||||
|
|
@ -272,7 +240,7 @@ gen6_begin_query(struct gl_context *ctx, struct gl_query_object *q)
|
|||
* obtain the time elapsed. Notably, this includes time elapsed while
|
||||
* the system was doing other work, such as running other applications.
|
||||
*/
|
||||
write_timestamp(brw, query->bo, 0);
|
||||
brw_write_timestamp(brw, query->bo, 0);
|
||||
break;
|
||||
|
||||
case GL_ANY_SAMPLES_PASSED:
|
||||
|
|
@ -311,7 +279,7 @@ gen6_end_query(struct gl_context *ctx, struct gl_query_object *q)
|
|||
|
||||
switch (query->Base.Target) {
|
||||
case GL_TIME_ELAPSED:
|
||||
write_timestamp(brw, query->bo, 1);
|
||||
brw_write_timestamp(brw, query->bo, 1);
|
||||
break;
|
||||
|
||||
case GL_ANY_SAMPLES_PASSED:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue