[Mesa-dev] [PATCH] winsys/radeon: fix nop packet padding.
j.glisse at gmail.com
j.glisse at gmail.com
Thu Jul 24 14:42:21 PDT 2014
From: Jerome Glisse <jglisse at redhat.com>
The gpu packet prefetcher hates the ugly big nop packet those leads
to prefetching some invalid memory in some case. Apparently hawaii
is particularly sensible to this.
Note this only partialy fix hawaii issues and some zbuffer tiling
issues are still present.
Signed-off-by: Jérôme Glisse <jglisse at redhat.com>
---
src/gallium/winsys/radeon/drm/radeon_drm_cs.c | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_cs.c b/src/gallium/winsys/radeon/drm/radeon_drm_cs.c
index a06ecb2..502a550 100644
--- a/src/gallium/winsys/radeon/drm/radeon_drm_cs.c
+++ b/src/gallium/winsys/radeon/drm/radeon_drm_cs.c
@@ -451,8 +451,22 @@ static void radeon_drm_cs_flush(struct radeon_winsys_cs *rcs,
while (rcs->cdw & 7)
OUT_CS(&cs->base, 0x80000000); /* type2 nop packet */
} else {
- while (rcs->cdw & 7)
- OUT_CS(&cs->base, 0xffff1000); /* type3 nop packet */
+ switch (rcs->cdw & 7) {
+ case 0:
+ break;
+ case 7:
+ /* FIXME can this be bad if we are at cs[LAST_DW-1] ? Need to
+ * think of something.
+ */
+ OUT_CS(&cs->base, 0xc0001000);
+ OUT_CS(&cs->base, 0xcafedead);
+ /* Note we fallthrough as this will add another 7 dwords */
+ default:
+ OUT_CS(&cs->base, 0xc0001000 | (((8 - (rcs->cdw & 7)) - 1) << 16));
+ while (rcs->cdw & 7) {
+ OUT_CS(&cs->base, 0xcafedead);
+ }
+ }
}
break;
case RING_UVD:
--
1.8.3.1
More information about the mesa-dev
mailing list