Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 98324
b: refs/heads/master
c: 9156cf0
h: refs/heads/master
v: v3
  • Loading branch information
Roland Scheidegger authored and Dave Airlie committed Jun 19, 2008
1 parent 67681da commit af06bbf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 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: c0beb2a723d69934a53f51a9d664c5b1dbbf634b
refs/heads/master: 9156cf09f56150ed89f77eaa4c386a07789776a0
14 changes: 11 additions & 3 deletions trunk/drivers/char/drm/radeon_state.c
Original file line number Diff line number Diff line change
Expand Up @@ -1662,7 +1662,7 @@ static int radeon_cp_dispatch_texture(struct drm_device * dev,
u32 height;
int i;
u32 texpitch, microtile;
u32 offset;
u32 offset, byte_offset;
RING_LOCALS;

if (radeon_check_and_fixup_offset(dev_priv, file_priv, &tex->offset)) {
Expand Down Expand Up @@ -1727,6 +1727,13 @@ static int radeon_cp_dispatch_texture(struct drm_device * dev,
} else
microtile = 0;

/* this might fail for zero-sized uploads - are those illegal? */
if (!radeon_check_offset(dev_priv, tex->offset + image->height *
blit_width - 1)) {
DRM_ERROR("Invalid final destination offset\n");
return -EINVAL;
}

DRM_DEBUG("tex=%dx%d blit=%d\n", tex_width, tex->height, blit_width);

do {
Expand Down Expand Up @@ -1840,6 +1847,7 @@ static int radeon_cp_dispatch_texture(struct drm_device * dev,
}

#undef RADEON_COPY_MT
byte_offset = (image->y & ~2047) * blit_width;
buf->file_priv = file_priv;
buf->used = size;
offset = dev_priv->gart_buffers_offset + buf->offset;
Expand All @@ -1854,9 +1862,9 @@ static int radeon_cp_dispatch_texture(struct drm_device * dev,
RADEON_DP_SRC_SOURCE_MEMORY |
RADEON_GMC_CLR_CMP_CNTL_DIS | RADEON_GMC_WR_MSK_DIS);
OUT_RING((spitch << 22) | (offset >> 10));
OUT_RING((texpitch << 22) | (tex->offset >> 10));
OUT_RING((texpitch << 22) | ((tex->offset >> 10) + (byte_offset >> 10)));
OUT_RING(0);
OUT_RING((image->x << 16) | image->y);
OUT_RING((image->x << 16) | (image->y % 2048));
OUT_RING((image->width << 16) | height);
RADEON_WAIT_UNTIL_2D_IDLE();
ADVANCE_RING();
Expand Down

0 comments on commit af06bbf

Please sign in to comment.