aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorAlex Deucher <alexander.deucher@amd.com>2011-10-22 10:07:09 -0400
committerDave Airlie <airlied@redhat.com>2011-11-01 12:01:52 -0400
commit9bb7703c5ea62ca1925cbfa0cd776f04de96fcf2 (patch)
tree1a6a08cc83764e843a941346b139ebec126f260b /drivers/gpu
parent340764465aa4a586ca332e61ae64883e5ad6f183 (diff)
drm/radeon/kms: rework texture cache flush in r6xx+ blit code
Move the TC flush before the texture setup to match mesa and the ddx. Also, move the TC flush into the texture setup function. Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/radeon/evergreen_blit_kms.c5
-rw-r--r--drivers/gpu/drm/radeon/r600_blit_kms.c10
-rw-r--r--drivers/gpu/drm/radeon/radeon.h2
3 files changed, 10 insertions, 7 deletions
diff --git a/drivers/gpu/drm/radeon/evergreen_blit_kms.c b/drivers/gpu/drm/radeon/evergreen_blit_kms.c
index dcf11bbc06d9..879f7335029e 100644
--- a/drivers/gpu/drm/radeon/evergreen_blit_kms.c
+++ b/drivers/gpu/drm/radeon/evergreen_blit_kms.c
@@ -174,7 +174,7 @@ set_vtx_resource(struct radeon_device *rdev, u64 gpu_addr)
174static void 174static void
175set_tex_resource(struct radeon_device *rdev, 175set_tex_resource(struct radeon_device *rdev,
176 int format, int w, int h, int pitch, 176 int format, int w, int h, int pitch,
177 u64 gpu_addr) 177 u64 gpu_addr, u32 size)
178{ 178{
179 u32 sq_tex_resource_word0, sq_tex_resource_word1; 179 u32 sq_tex_resource_word0, sq_tex_resource_word1;
180 u32 sq_tex_resource_word4, sq_tex_resource_word7; 180 u32 sq_tex_resource_word4, sq_tex_resource_word7;
@@ -196,6 +196,9 @@ set_tex_resource(struct radeon_device *rdev,
196 sq_tex_resource_word7 = format | 196 sq_tex_resource_word7 = format |
197 S__SQ_CONSTANT_TYPE(SQ_TEX_VTX_VALID_TEXTURE); 197 S__SQ_CONSTANT_TYPE(SQ_TEX_VTX_VALID_TEXTURE);
198 198
199 cp_set_surface_sync(rdev,
200 PACKET3_TC_ACTION_ENA, size, gpu_addr);
201
199 radeon_ring_write(rdev, PACKET3(PACKET3_SET_RESOURCE, 8)); 202 radeon_ring_write(rdev, PACKET3(PACKET3_SET_RESOURCE, 8));
200 radeon_ring_write(rdev, 0); 203 radeon_ring_write(rdev, 0);
201 radeon_ring_write(rdev, sq_tex_resource_word0); 204 radeon_ring_write(rdev, sq_tex_resource_word0);
diff --git a/drivers/gpu/drm/radeon/r600_blit_kms.c b/drivers/gpu/drm/radeon/r600_blit_kms.c
index c4cf1308d4a1..ff36532734b7 100644
--- a/drivers/gpu/drm/radeon/r600_blit_kms.c
+++ b/drivers/gpu/drm/radeon/r600_blit_kms.c
@@ -201,7 +201,7 @@ set_vtx_resource(struct radeon_device *rdev, u64 gpu_addr)
201static void 201static void
202set_tex_resource(struct radeon_device *rdev, 202set_tex_resource(struct radeon_device *rdev,
203 int format, int w, int h, int pitch, 203 int format, int w, int h, int pitch,
204 u64 gpu_addr) 204 u64 gpu_addr, u32 size)
205{ 205{
206 uint32_t sq_tex_resource_word0, sq_tex_resource_word1, sq_tex_resource_word4; 206 uint32_t sq_tex_resource_word0, sq_tex_resource_word1, sq_tex_resource_word4;
207 207
@@ -222,6 +222,9 @@ set_tex_resource(struct radeon_device *rdev,
222 S_038010_DST_SEL_Z(SQ_SEL_Z) | 222 S_038010_DST_SEL_Z(SQ_SEL_Z) |
223 S_038010_DST_SEL_W(SQ_SEL_W); 223 S_038010_DST_SEL_W(SQ_SEL_W);
224 224
225 cp_set_surface_sync(rdev,
226 PACKET3_TC_ACTION_ENA, size, gpu_addr);
227
225 radeon_ring_write(rdev, PACKET3(PACKET3_SET_RESOURCE, 7)); 228 radeon_ring_write(rdev, PACKET3(PACKET3_SET_RESOURCE, 7));
226 radeon_ring_write(rdev, 0); 229 radeon_ring_write(rdev, 0);
227 radeon_ring_write(rdev, sq_tex_resource_word0); 230 radeon_ring_write(rdev, sq_tex_resource_word0);
@@ -760,10 +763,7 @@ void r600_kms_blit_copy(struct radeon_device *rdev,
760 vb[11] = i2f(h); 763 vb[11] = i2f(h);
761 764
762 rdev->r600_blit.primitives.set_tex_resource(rdev, FMT_8_8_8_8, 765 rdev->r600_blit.primitives.set_tex_resource(rdev, FMT_8_8_8_8,
763 w, h, w, src_gpu_addr); 766 w, h, w, src_gpu_addr, size_in_bytes);
764 rdev->r600_blit.primitives.cp_set_surface_sync(rdev,
765 PACKET3_TC_ACTION_ENA,
766 size_in_bytes, src_gpu_addr);
767 rdev->r600_blit.primitives.set_render_target(rdev, COLOR_8_8_8_8, 767 rdev->r600_blit.primitives.set_render_target(rdev, COLOR_8_8_8_8,
768 w, h, dst_gpu_addr); 768 w, h, dst_gpu_addr);
769 rdev->r600_blit.primitives.set_scissors(rdev, 0, 0, w, h); 769 rdev->r600_blit.primitives.set_scissors(rdev, 0, 0, w, h);
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
index e3170c794c1d..3a78f8666fa7 100644
--- a/drivers/gpu/drm/radeon/radeon.h
+++ b/drivers/gpu/drm/radeon/radeon.h
@@ -533,7 +533,7 @@ struct r600_blit_cp_primitives {
533 void (*set_vtx_resource)(struct radeon_device *rdev, u64 gpu_addr); 533 void (*set_vtx_resource)(struct radeon_device *rdev, u64 gpu_addr);
534 void (*set_tex_resource)(struct radeon_device *rdev, 534 void (*set_tex_resource)(struct radeon_device *rdev,
535 int format, int w, int h, int pitch, 535 int format, int w, int h, int pitch,
536 u64 gpu_addr); 536 u64 gpu_addr, u32 size);
537 void (*set_scissors)(struct radeon_device *rdev, int x1, int y1, 537 void (*set_scissors)(struct radeon_device *rdev, int x1, int y1,
538 int x2, int y2); 538 int x2, int y2);
539 void (*draw_auto)(struct radeon_device *rdev); 539 void (*draw_auto)(struct radeon_device *rdev);