Merge pull request #3867 from fritsch/amd-bisect

Mesa: Fix the performance regression in an upstream conform way
This commit is contained in:
Peter Frühberger 2015-02-04 15:56:21 +01:00
commit c0295522db
2 changed files with 22 additions and 33 deletions

View File

@ -1,33 +0,0 @@
From 2402ec06e7d968bfa2dd06d73d5d9a5096fcfbb5 Mon Sep 17 00:00:00 2001
From: fritsch <Peter.Fruehberger@gmail.com>
Date: Tue, 3 Feb 2015 10:10:48 +0100
Subject: [PATCH 2/3] Revert "r600g,radeonsi: Always use GTT again for
PIPE_USAGE_STREAM buffers"
This reverts commit 64c2bdc334ba472603b1e7cd2c3046cfbce285b6.
---
src/gallium/drivers/radeon/r600_buffer_common.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/src/gallium/drivers/radeon/r600_buffer_common.c b/src/gallium/drivers/radeon/r600_buffer_common.c
index acdabc0..ee05776 100644
--- a/src/gallium/drivers/radeon/r600_buffer_common.c
+++ b/src/gallium/drivers/radeon/r600_buffer_common.c
@@ -110,13 +110,11 @@ bool r600_init_resource(struct r600_common_screen *rscreen,
enum radeon_bo_flag flags = 0;
switch (res->b.b.usage) {
- case PIPE_USAGE_STREAM:
- flags = RADEON_FLAG_GTT_WC;
- /* fall through */
case PIPE_USAGE_STAGING:
/* Transfers are likely to occur more often with these resources. */
res->domains = RADEON_DOMAIN_GTT;
break;
+ case PIPE_USAGE_STREAM:
case PIPE_USAGE_DYNAMIC:
/* Older kernels didn't always flush the HDP cache before
* CS execution
--
1.9.1

View File

@ -0,0 +1,22 @@
diff --git a/src/mesa/state_tracker/st_cb_bufferobjects.c b/src/mesa/state_tracker/st_cb_bufferobjects.c
index 55f3644..d68e1e9 100644
--- a/src/mesa/state_tracker/st_cb_bufferobjects.c
+++ b/src/mesa/state_tracker/st_cb_bufferobjects.c
@@ -256,8 +256,15 @@ st_bufferobj_data(struct gl_context *ctx,
break;
case GL_STREAM_DRAW:
case GL_STREAM_COPY:
- pipe_usage = PIPE_USAGE_STREAM;
- break;
+ /* XXX: Remove this test when we have PBO unpack acceleration. Right
+ * now, PBO unpacking is done by the CPU, so we have to make sure
+ * CPU reads are fast.
+ */
+ if (target != GL_PIXEL_UNPACK_BUFFER_ARB) {
+ pipe_usage = PIPE_USAGE_STREAM;
+ break;
+ }
+ /* fall through */
case GL_STATIC_READ:
case GL_DYNAMIC_READ:
case GL_STREAM_READ: