OUT_RING(chan, 1);
}*/
- FIRE_RING(chan);
- if (fence)
+ if (fence) {
+ /* horrific hack to make glFinish() work in the absence of
+ * having proper fences in nvfx. a pending rewrite will
+ * fix this properly, but may be a while off.
+ */
+ MARK_RING(chan, 1, 1);
+ OUT_RELOC(chan, screen->fence, 0, NOUVEAU_BO_WR |
+ NOUVEAU_BO_DUMMY, 0, 0);
+ FIRE_RING(chan);
+ nouveau_bo_map(screen->fence, NOUVEAU_BO_RDWR);
+ nouveau_bo_unmap(screen->fence);
*fence = NULL;
+ } else {
+ FIRE_RING(chan);
+ }
}
static void
nouveau_notifier_free(&screen->sync);
nouveau_grobj_free(&screen->eng3d);
nvfx_screen_surface_takedown(pscreen);
+ nouveau_bo_ref(NULL, &screen->fence);
nouveau_screen_fini(&screen->base);
pscreen->is_format_supported = nvfx_screen_is_format_supported;
pscreen->context_create = nvfx_create;
+ ret = nouveau_bo_new(dev, NOUVEAU_BO_VRAM, 0, 4096, &screen->fence);
+ if (ret) {
+ nvfx_screen_destroy(pscreen);
+ return NULL;
+ }
+
switch (dev->chipset & 0xf0) {
case 0x30:
if (NV30_3D_CHIPSET_3X_MASK & (1 << (dev->chipset & 0x0f)))