aboutsummaryrefslogtreecommitdiffstats
path: root/src/intel/blorp/blorp_blit.c
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2017-08-28 21:19:22 -0700
committerKenneth Graunke <[email protected]>2017-08-30 16:59:19 -0700
commitfc20df830cc1f3bfd2d04c7927ba63d606cfc89f (patch)
treed756fe2f6dd1522f3756eea454f219f0d95279a7 /src/intel/blorp/blorp_blit.c
parent81d5b61a194d0cb060c4e836db6abc4f1b4fb0e8 (diff)
blorp: Make blorp_buffer_copy work on Gen4-6.
Gen4-6 can only handle surfaces up to 8192. Only Gen7+ can do 16384. Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/intel/blorp/blorp_blit.c')
-rw-r--r--src/intel/blorp/blorp_blit.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/intel/blorp/blorp_blit.c b/src/intel/blorp/blorp_blit.c
index b012a0a0b37..9c921cc044d 100644
--- a/src/intel/blorp/blorp_blit.c
+++ b/src/intel/blorp/blorp_blit.c
@@ -2588,17 +2588,18 @@ do_buffer_copy(struct blorp_batch *batch,
0, 0, 0, 0, width, height);
}
-/* This is maximum possible width/height our HW can handle */
-#define MAX_SURFACE_DIM (1ull << 14)
-
void
blorp_buffer_copy(struct blorp_batch *batch,
struct blorp_address src,
struct blorp_address dst,
uint64_t size)
{
+ const struct gen_device_info *devinfo = batch->blorp->isl_dev->info;
uint64_t copy_size = size;
+ /* This is maximum possible width/height our HW can handle */
+ uint64_t max_surface_dim = 1 << (devinfo->gen >= 7 ? 14 : 13);
+
/* First, we compute the biggest format that can be used with the
* given offsets and size.
*/
@@ -2608,20 +2609,20 @@ blorp_buffer_copy(struct blorp_batch *batch,
bs = gcd_pow2_u64(bs, size);
/* First, we make a bunch of max-sized copies */
- uint64_t max_copy_size = MAX_SURFACE_DIM * MAX_SURFACE_DIM * bs;
+ uint64_t max_copy_size = max_surface_dim * max_surface_dim * bs;
while (copy_size >= max_copy_size) {
- do_buffer_copy(batch, &src, &dst, MAX_SURFACE_DIM, MAX_SURFACE_DIM, bs);
+ do_buffer_copy(batch, &src, &dst, max_surface_dim, max_surface_dim, bs);
copy_size -= max_copy_size;
src.offset += max_copy_size;
dst.offset += max_copy_size;
}
/* Now make a max-width copy */
- uint64_t height = copy_size / (MAX_SURFACE_DIM * bs);
- assert(height < MAX_SURFACE_DIM);
+ uint64_t height = copy_size / (max_surface_dim * bs);
+ assert(height < max_surface_dim);
if (height != 0) {
- uint64_t rect_copy_size = height * MAX_SURFACE_DIM * bs;
- do_buffer_copy(batch, &src, &dst, MAX_SURFACE_DIM, height, bs);
+ uint64_t rect_copy_size = height * max_surface_dim * bs;
+ do_buffer_copy(batch, &src, &dst, max_surface_dim, height, bs);
copy_size -= rect_copy_size;
src.offset += rect_copy_size;
dst.offset += rect_copy_size;