summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2009-01-23 02:47:15 +1000
committerDave Airlie <airlied@redhat.com>2009-01-23 02:47:15 +1000
commit014c52eb6bc2fc0edb69d1ef063eb6c9735b3833 (patch)
tree782001a460cc48c328d2f24fd9f3bfd8a5914a4c /src/mesa/drivers/dri
parent4ca76586c23200b66cb4f85afb21ea02853779ea (diff)
radeon: add r100/r200 workarounds for legacy aging
Diffstat (limited to 'src/mesa/drivers/dri')
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_bo_legacy.c19
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_cs_legacy.c10
2 files changed, 20 insertions, 9 deletions
diff --git a/src/mesa/drivers/dri/radeon/radeon_bo_legacy.c b/src/mesa/drivers/dri/radeon/radeon_bo_legacy.c
index e378b118e0..32b452d636 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 af9ee4df47..3a3a245d79 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;
}