static void
write_timestamp(struct brw_context *brw, drm_intel_bo *query_bo, int idx)
{
- struct intel_context *intel = &brw->intel;
/* Emit workaround flushes: */
- if (intel->gen == 6) {
+ 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().
static void
write_depth_count(struct brw_context *brw, drm_intel_bo *query_bo, int idx)
{
- struct intel_context *intel = &brw->intel;
/* Emit Sandybridge workaround flush: */
- if (intel->gen == 6)
+ if (brw->gen == 6)
intel_emit_post_sync_nonzero_flush(brw);
BEGIN_BATCH(5);
write_reg(struct brw_context *brw,
drm_intel_bo *query_bo, uint32_t reg, int idx)
{
- struct intel_context *intel = &brw->intel;
- assert(intel->gen >= 6);
+ assert(brw->gen >= 6);
intel_batchbuffer_emit_mi_flush(brw);
write_xfb_primitives_written(struct brw_context *brw,
drm_intel_bo *query_bo, int idx)
{
- struct intel_context *intel = &brw->intel;
- if (intel->gen >= 7) {
- write_reg(brw, query_bo, SO_NUM_PRIMS_WRITTEN0_IVB, idx);
+ if (brw->gen >= 7) {
+ write_reg(brw, query_bo, GEN7_SO_NUM_PRIMS_WRITTEN(0), idx);
} else {
- write_reg(brw, query_bo, SO_NUM_PRIMS_WRITTEN, idx);
+ write_reg(brw, query_bo, GEN6_SO_NUM_PRIMS_WRITTEN, idx);
}
}
struct brw_query_object *query)
{
struct brw_context *brw = brw_context(ctx);
- struct intel_context *intel = intel_context(ctx);
if (query->bo == NULL)
return;
* still contributing to it, flush it now so the results will be present
* when mapped.
*/
- if (drm_intel_bo_references(intel->batch.bo, query->bo))
+ if (drm_intel_bo_references(brw->batch.bo, query->bo))
intel_batchbuffer_flush(brw);
- if (unlikely(intel->perf_debug)) {
+ if (unlikely(brw->perf_debug)) {
if (drm_intel_bo_busy(query->bo)) {
perf_debug("Stalling on the GPU waiting for a query object.\n");
}
static void gen6_check_query(struct gl_context *ctx, struct gl_query_object *q)
{
struct brw_context *brw = brw_context(ctx);
- struct intel_context *intel = intel_context(ctx);
struct brw_query_object *query = (struct brw_query_object *)q;
/* From the GL_ARB_occlusion_query spec:
* not ready yet on the first time it is queried. This ensures that
* the async query will return true in finite time.
*/
- if (query->bo && drm_intel_bo_references(intel->batch.bo, query->bo))
+ if (query->bo && drm_intel_bo_references(brw->batch.bo, query->bo))
intel_batchbuffer_flush(brw);
if (query->bo == NULL || !drm_intel_bo_busy(query->bo)) {