Mesa (mesa_7_7_branch): radeon/r200: fix bad state emission causes kernel to do bad depth clear

Dave Airlie airlied at kemper.freedesktop.org
Wed Feb 24 09:18:55 UTC 2010


Module: Mesa
Branch: mesa_7_7_branch
Commit: bc7e12e5e3c063b8f29fecad43d85b09fa6b205d
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=bc7e12e5e3c063b8f29fecad43d85b09fa6b205d

Author: Dave Airlie <airlied at redhat.com>
Date:   Wed Feb 24 17:19:09 2010 +1000

radeon/r200: fix bad state emission causes kernel to do bad depth clear

The kernel lets you clear depth without getting a depth offset
from userspace, mesa used to emit state before clear, but that got
lost in the refactoring, which made the kernel bug show up. Fix
mesa driver to emit the state properly now.

cherry-pick + squash master commits.

Signed-off-by: Dave Airlie <airlied at redhat.com>

---

 src/mesa/drivers/dri/r200/r200_ioctl.c     |    2 ++
 src/mesa/drivers/dri/radeon/radeon_ioctl.c |    2 ++
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/mesa/drivers/dri/r200/r200_ioctl.c b/src/mesa/drivers/dri/r200/r200_ioctl.c
index b238adb..e81dcc2 100644
--- a/src/mesa/drivers/dri/r200/r200_ioctl.c
+++ b/src/mesa/drivers/dri/r200/r200_ioctl.c
@@ -65,6 +65,8 @@ static void r200KernelClear(GLcontext *ctx, GLuint flags)
    GLint cx, cy, cw, ch, ret;
    GLuint i;
 
+   radeonEmitState(&rmesa->radeon);
+
    LOCK_HARDWARE( &rmesa->radeon );
 
    /* Throttle the number of clear ioctls we do.
diff --git a/src/mesa/drivers/dri/radeon/radeon_ioctl.c b/src/mesa/drivers/dri/radeon/radeon_ioctl.c
index 674b72d..8ea8900 100644
--- a/src/mesa/drivers/dri/radeon/radeon_ioctl.c
+++ b/src/mesa/drivers/dri/radeon/radeon_ioctl.c
@@ -457,6 +457,8 @@ static void radeonKernelClear(GLcontext *ctx, GLuint flags)
    GLint ret, i;
    GLint cx, cy, cw, ch;
 
+   radeonEmitState(&rmesa->radeon);
+
    LOCK_HARDWARE( &rmesa->radeon );
 
    /* compute region after locking: */




More information about the mesa-commit mailing list