aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys/drm/radeon
diff options
context:
space:
mode:
authorCorbin Simpson <[email protected]>2009-05-20 07:18:08 -0700
committerCorbin Simpson <[email protected]>2009-05-20 07:18:08 -0700
commit4550423211063010a2fa482037d8233bb80e3773 (patch)
tree3a6950411164482f6a0280f677520e52ff31da19 /src/gallium/winsys/drm/radeon
parent0c75cb5afe81b0de9d006f9f9b75fdc9a15038d0 (diff)
radeon-gallium: Don't permit reading and writing a BO in one CS.
This fixes some silent problems in current libdrm_radeon. surface_copy still locks up hard.
Diffstat (limited to 'src/gallium/winsys/drm/radeon')
-rw-r--r--src/gallium/winsys/drm/radeon/core/radeon_r300.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/gallium/winsys/drm/radeon/core/radeon_r300.c b/src/gallium/winsys/drm/radeon/core/radeon_r300.c
index 65366e242cf..995bf6aa22b 100644
--- a/src/gallium/winsys/drm/radeon/core/radeon_r300.c
+++ b/src/gallium/winsys/drm/radeon/core/radeon_r300.c
@@ -69,6 +69,16 @@ static boolean radeon_r300_validate(struct r300_winsys* winsys)
return TRUE;
}
+ /* XXX should probably be its own function */
+ for (i = 0; i < priv->bo_count; i++) {
+ if (sc[i].read_domains && sc[i].write_domain) {
+ /* Cute, cute. We need to flush first. */
+ debug_printf("radeon: BO %p can't be read and written; "
+ "requesting flush.\n", sc[i].bo);
+ return TRUE;
+ }
+ }
+
/* Things are fine, we can proceed as normal. */
return FALSE;
}
@@ -109,9 +119,15 @@ static void radeon_r300_write_cs_reloc(struct r300_winsys* winsys,
{
struct radeon_winsys_priv* priv =
(struct radeon_winsys_priv*)winsys->radeon_winsys;
+ int retval = 0;
- radeon_cs_write_reloc(priv->cs,
+ retval = radeon_cs_write_reloc(priv->cs,
((struct radeon_pipe_buffer*)pbuffer)->bo, rd, wd, flags);
+
+ if (retval) {
+ debug_printf("radeon: Relocation of %p (%d, %d, %d) failed!\n",
+ pbuffer, rd, wd, flags);
+ }
}
static void radeon_r300_end_cs(struct r300_winsys* winsys,