From: Dave Airlie Date: Thu, 22 Jan 2009 16:47:15 +0000 (+1000) Subject: radeon: add r100/r200 workarounds for legacy aging X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=014c52eb6bc2fc0edb69d1ef063eb6c9735b3833;p=mesa.git radeon: add r100/r200 workarounds for legacy aging --- diff --git a/src/mesa/drivers/dri/radeon/radeon_bo_legacy.c b/src/mesa/drivers/dri/radeon/radeon_bo_legacy.c index e378b118e0e..32b452d6363 100644 --- a/src/mesa/drivers/dri/radeon/radeon_bo_legacy.c +++ b/src/mesa/drivers/dri/radeon/radeon_bo_legacy.c @@ -163,14 +163,17 @@ static void legacy_get_current_age(struct bo_manager_legacy *boml) drm_radeon_getparam_t gp; int r; - gp.param = RADEON_PARAM_LAST_CLEAR; - gp.value = (int *)&boml->current_age; - r = drmCommandWriteRead(boml->base.fd, DRM_RADEON_GETPARAM, - &gp, sizeof(gp)); - if (r) { - fprintf(stderr, "%s: drmRadeonGetParam: %d\n", __FUNCTION__, r); - exit(1); - } + if (IS_R300_CLASS(boml->screen)) { + gp.param = RADEON_PARAM_LAST_CLEAR; + gp.value = (int *)&boml->current_age; + r = drmCommandWriteRead(boml->base.fd, DRM_RADEON_GETPARAM, + &gp, sizeof(gp)); + if (r) { + fprintf(stderr, "%s: drmRadeonGetParam: %d\n", __FUNCTION__, r); + exit(1); + } + } else + boml->current_age = boml->screen->scratch[3]; } static int legacy_is_pending(struct radeon_bo *bo) diff --git a/src/mesa/drivers/dri/radeon/radeon_cs_legacy.c b/src/mesa/drivers/dri/radeon/radeon_cs_legacy.c index af9ee4df472..3a3a245d798 100644 --- a/src/mesa/drivers/dri/radeon/radeon_cs_legacy.c +++ b/src/mesa/drivers/dri/radeon/radeon_cs_legacy.c @@ -317,12 +317,20 @@ static int cs_emit(struct radeon_cs *cs) cmd.boxes = (drm_clip_rect_t *) csm->ctx->pClipRects; } - dump_cmdbuf(cs); + // dump_cmdbuf(cs); r = drmCommandWrite(cs->csm->fd, DRM_RADEON_CMDBUF, &cmd, sizeof(cmd)); if (r) { return r; } + if (!IS_R300_CLASS(csm->ctx->radeonScreen)) { + drm_radeon_irq_emit_t emit_cmd; + emit_cmd.irq_seq = &csm->pending_age; + r = drmCommandWrite(cs->csm->fd, DRM_RADEON_IRQ_EMIT, &emit_cmd, sizeof(emit_cmd)); + if (r) { + return r; + } + } cs_set_age(cs); return 0; }