Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 164023
b: refs/heads/master
c: 7cbb355
h: refs/heads/master
i:
  164021: 94f7300
  164019: fbb8c09
  164015: 0da8420
v: v3
  • Loading branch information
Dave Airlie authored and Dave Airlie committed Sep 18, 2009
1 parent 4e1c36b commit 6a98eac
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 41456df2d45299c2eea5aaabafbaa2430ab9a124
refs/heads/master: 7cbb355e947b3b426cefd9a3dc0dda3af9f9345a
21 changes: 14 additions & 7 deletions trunk/drivers/gpu/drm/radeon/r600_blit_kms.c
Original file line number Diff line number Diff line change
Expand Up @@ -548,25 +548,32 @@ void r600_vb_ib_put(struct radeon_device *rdev)
int r600_blit_prepare_copy(struct radeon_device *rdev, int size_bytes)
{
int r;
int ring_size;
int ring_size, line_size;
int max_size;
/* loops of emits 64 + fence emit possible */
int dwords_per_loop = 76;
int dwords_per_loop = 76, num_loops;

r = r600_vb_ib_get(rdev);
WARN_ON(r);

/* set_render_target emits 2 extra dwords on rv6xx */
if (rdev->family > CHIP_R600 && rdev->family < CHIP_RV770)
dwords_per_loop += 2;

/* 8 bpp vs 32 bpp for xfer unit */
if (size_bytes & 3)
max_size = 8192*8192;
line_size = 8192;
else
max_size = 8192*8192*4;
line_size = 8192*4;

r = r600_vb_ib_get(rdev);
WARN_ON(r);
max_size = 8192 * line_size;

ring_size = ((size_bytes + max_size) / max_size) * dwords_per_loop;
/* major loops cover the max size transfer */
num_loops = ((size_bytes + max_size) / max_size);
/* minor loops cover the extra non aligned bits */
num_loops += ((size_bytes % line_size) ? 1 : 0);
/* calculate number of loops correctly */
ring_size = num_loops * dwords_per_loop;
/* set default + shaders */
ring_size += 40; /* shaders + def state */
ring_size += 3; /* fence emit for VB IB */
Expand Down

0 comments on commit 6a98eac

Please sign in to comment.