static void
write_timestamp(struct brw_context *brw, drm_intel_bo *query_bo, int idx)
{
- struct intel_context *intel = &brw->intel;
- if (intel->gen >= 6) {
+ if (brw->gen >= 6) {
/* 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;
- assert(intel->gen < 6);
+ assert(brw->gen < 6);
BEGIN_BATCH(4);
OUT_BATCH(_3DSTATE_PIPE_CONTROL | (4 - 2) |
struct brw_query_object *query)
{
struct brw_context *brw = brw_context(ctx);
- struct intel_context *intel = intel_context(ctx);
int i;
uint64_t *results;
- assert(intel->gen < 6);
+ assert(brw->gen < 6);
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");
}
brw_begin_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;
- assert(intel->gen < 6);
+ assert(brw->gen < 6);
switch (query->Base.Target) {
case GL_TIME_ELAPSED_EXT:
* avoid them when necessary. They're required for occlusion queries,
* so turn them on now.
*/
- intel->stats_wm++;
+ brw->stats_wm++;
brw->state.dirty.brw |= BRW_NEW_STATS_WM;
break;
brw_end_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;
- assert(intel->gen < 6);
+ assert(brw->gen < 6);
switch (query->Base.Target) {
case GL_TIME_ELAPSED_EXT:
brw->query.obj = NULL;
- intel->stats_wm--;
+ brw->stats_wm--;
brw->state.dirty.brw |= BRW_NEW_STATS_WM;
break;
{
struct brw_query_object *query = (struct brw_query_object *)q;
- assert(intel_context(ctx)->gen < 6);
+ assert(brw_context(ctx)->gen < 6);
brw_queryobj_get_results(ctx, query);
query->Base.Ready = true;
static void brw_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;
- assert(intel->gen < 6);
+ assert(brw->gen < 6);
/* 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)) {
ensure_bo_has_space(struct gl_context *ctx, struct brw_query_object *query)
{
struct brw_context *brw = brw_context(ctx);
- struct intel_context *intel = intel_context(ctx);
- assert(intel->gen < 6);
+ assert(brw->gen < 6);
if (!query->bo || query->last_index * 2 + 1 >= 4096 / sizeof(uint64_t)) {
void
brw_emit_query_begin(struct brw_context *brw)
{
- struct intel_context *intel = &brw->intel;
- struct gl_context *ctx = &intel->ctx;
+ struct gl_context *ctx = &brw->ctx;
struct brw_query_object *query = brw->query.obj;
- if (intel->hw_ctx)
+ if (brw->hw_ctx)
return;
/* Skip if we're not doing any queries, or we've already recorded the
void
brw_emit_query_end(struct brw_context *brw)
{
- struct intel_context *intel = &brw->intel;
struct brw_query_object *query = brw->query.obj;
- if (intel->hw_ctx)
+ if (brw->hw_ctx)
return;
if (!brw->query.begin_emitted)