radeon: add r100/r200 workarounds for legacy aging
authorDave Airlie <airlied@redhat.com>
Thu, 22 Jan 2009 16:47:15 +0000 (02:47 +1000)
committerDave Airlie <airlied@redhat.com>
Thu, 22 Jan 2009 16:47:15 +0000 (02:47 +1000)
src/mesa/drivers/dri/radeon/radeon_bo_legacy.c
src/mesa/drivers/dri/radeon/radeon_cs_legacy.c

index e378b118e0e85ad88c2a45469126a9b2e8fbf333..32b452d6363f618da8ea5418456b0db08f85b183 100644 (file)
@@ -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)
index af9ee4df472413e6dd2a853a84d3710ed2c50a05..3a3a245d79812a78546438ac26df742e7ae93842 100644 (file)
@@ -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;
 }