aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_queryobj.c
diff options
context:
space:
mode:
authorLionel Landwerlin <[email protected]>2017-08-30 08:44:37 +0100
committerLionel Landwerlin <[email protected]>2017-08-30 17:59:17 +0100
commitb83a97a65d16cd28c0763545ee3f78832939237c (patch)
treead02aab9670162a0a735a742a223efbafacb9a93 /src/mesa/drivers/dri/i965/brw_queryobj.c
parentde9649071a7ded45b75bd935b0f59ca13d8e642c (diff)
i965: drop brw->gen in favor of devinfo->gen
Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_queryobj.c')
-rw-r--r--src/mesa/drivers/dri/i965/brw_queryobj.c29
1 files changed, 19 insertions, 10 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_queryobj.c b/src/mesa/drivers/dri/i965/brw_queryobj.c
index 04ce9a94cad..906a68ead1b 100644
--- a/src/mesa/drivers/dri/i965/brw_queryobj.c
+++ b/src/mesa/drivers/dri/i965/brw_queryobj.c
@@ -84,7 +84,9 @@ brw_raw_timestamp_delta(struct brw_context *brw, uint64_t time0, uint64_t time1)
void
brw_write_timestamp(struct brw_context *brw, struct brw_bo *query_bo, int idx)
{
- if (brw->gen == 6) {
+ const struct gen_device_info *devinfo = &brw->screen->devinfo;
+
+ if (devinfo->gen == 6) {
/* Emit Sandybridge workaround flush: */
brw_emit_pipe_control_flush(brw,
PIPE_CONTROL_CS_STALL |
@@ -93,7 +95,7 @@ brw_write_timestamp(struct brw_context *brw, struct brw_bo *query_bo, int idx)
uint32_t flags = PIPE_CONTROL_WRITE_TIMESTAMP;
- if (brw->gen == 9 && brw->gt == 4)
+ if (devinfo->gen == 9 && brw->gt == 4)
flags |= PIPE_CONTROL_CS_STALL;
brw_emit_pipe_control_write(brw, flags,
@@ -106,12 +108,13 @@ brw_write_timestamp(struct brw_context *brw, struct brw_bo *query_bo, int idx)
void
brw_write_depth_count(struct brw_context *brw, struct brw_bo *query_bo, int idx)
{
+ const struct gen_device_info *devinfo = &brw->screen->devinfo;
uint32_t flags = PIPE_CONTROL_WRITE_DEPTH_COUNT | PIPE_CONTROL_DEPTH_STALL;
- if (brw->gen == 9 && brw->gt == 4)
+ if (devinfo->gen == 9 && brw->gt == 4)
flags |= PIPE_CONTROL_CS_STALL;
- if (brw->gen >= 10) {
+ if (devinfo->gen >= 10) {
/* "Driver must program PIPE_CONTROL with only Depth Stall Enable bit set
* prior to programming a PIPE_CONTROL with Write PS Depth Count Post sync
* operation."
@@ -131,11 +134,12 @@ brw_queryobj_get_results(struct gl_context *ctx,
struct brw_query_object *query)
{
struct brw_context *brw = brw_context(ctx);
+ const struct gen_device_info *devinfo = &brw->screen->devinfo;
int i;
uint64_t *results;
- assert(brw->gen < 6);
+ assert(devinfo->gen < 6);
if (query->bo == NULL)
return;
@@ -257,8 +261,9 @@ brw_begin_query(struct gl_context *ctx, struct gl_query_object *q)
{
struct brw_context *brw = brw_context(ctx);
struct brw_query_object *query = (struct brw_query_object *)q;
+ const struct gen_device_info *devinfo = &brw->screen->devinfo;
- assert(brw->gen < 6);
+ assert(devinfo->gen < 6);
switch (query->Base.Target) {
case GL_TIME_ELAPSED_EXT:
@@ -328,8 +333,9 @@ brw_end_query(struct gl_context *ctx, struct gl_query_object *q)
{
struct brw_context *brw = brw_context(ctx);
struct brw_query_object *query = (struct brw_query_object *)q;
+ const struct gen_device_info *devinfo = &brw->screen->devinfo;
- assert(brw->gen < 6);
+ assert(devinfo->gen < 6);
switch (query->Base.Target) {
case GL_TIME_ELAPSED_EXT:
@@ -381,8 +387,9 @@ brw_end_query(struct gl_context *ctx, struct gl_query_object *q)
static void brw_wait_query(struct gl_context *ctx, struct gl_query_object *q)
{
struct brw_query_object *query = (struct brw_query_object *)q;
+ const struct gen_device_info *devinfo = &brw_context(ctx)->screen->devinfo;
- assert(brw_context(ctx)->gen < 6);
+ assert(devinfo->gen < 6);
brw_queryobj_get_results(ctx, query);
query->Base.Ready = true;
@@ -398,8 +405,9 @@ static void brw_check_query(struct gl_context *ctx, struct gl_query_object *q)
{
struct brw_context *brw = brw_context(ctx);
struct brw_query_object *query = (struct brw_query_object *)q;
+ const struct gen_device_info *devinfo = &brw->screen->devinfo;
- assert(brw->gen < 6);
+ assert(devinfo->gen < 6);
/* From the GL_ARB_occlusion_query spec:
*
@@ -427,8 +435,9 @@ static void
ensure_bo_has_space(struct gl_context *ctx, struct brw_query_object *query)
{
struct brw_context *brw = brw_context(ctx);
+ const struct gen_device_info *devinfo = &brw->screen->devinfo;
- assert(brw->gen < 6);
+ assert(devinfo->gen < 6);
if (!query->bo || query->last_index * 2 + 1 >= 4096 / sizeof(uint64_t)) {