diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2013-01-04 12:16:05 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2013-01-04 12:25:46 -0500 |
commit | a10fbb4224e53c6b3528d671051be4b98bd8e9b9 (patch) | |
tree | f0b49e6d089ccd84e38d762366da066da795b39e /drivers/gpu | |
parent | 43fb778754ffd1ef8b4f579a5c94f118292acfb5 (diff) |
drm/radeon: fix DMA CS parser for r6xx linear copy packet
Was using the r7xx format.
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/radeon/r600_cs.c | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/drivers/gpu/drm/radeon/r600_cs.c b/drivers/gpu/drm/radeon/r600_cs.c index 9ea13d07cc55..03191a56eb44 100644 --- a/drivers/gpu/drm/radeon/r600_cs.c +++ b/drivers/gpu/drm/radeon/r600_cs.c | |||
@@ -2677,16 +2677,29 @@ int r600_dma_cs_parse(struct radeon_cs_parser *p) | |||
2677 | } | 2677 | } |
2678 | p->idx += 7; | 2678 | p->idx += 7; |
2679 | } else { | 2679 | } else { |
2680 | src_offset = ib[idx+2]; | 2680 | if (p->family >= CHIP_RV770) { |
2681 | src_offset |= ((u64)(ib[idx+4] & 0xff)) << 32; | 2681 | src_offset = ib[idx+2]; |
2682 | dst_offset = ib[idx+1]; | 2682 | src_offset |= ((u64)(ib[idx+4] & 0xff)) << 32; |
2683 | dst_offset |= ((u64)(ib[idx+3] & 0xff)) << 32; | 2683 | dst_offset = ib[idx+1]; |
2684 | dst_offset |= ((u64)(ib[idx+3] & 0xff)) << 32; | ||
2684 | 2685 | ||
2685 | ib[idx+1] += (u32)(dst_reloc->lobj.gpu_offset & 0xfffffffc); | 2686 | ib[idx+1] += (u32)(dst_reloc->lobj.gpu_offset & 0xfffffffc); |
2686 | ib[idx+2] += (u32)(src_reloc->lobj.gpu_offset & 0xfffffffc); | 2687 | ib[idx+2] += (u32)(src_reloc->lobj.gpu_offset & 0xfffffffc); |
2687 | ib[idx+3] += upper_32_bits(dst_reloc->lobj.gpu_offset) & 0xff; | 2688 | ib[idx+3] += upper_32_bits(dst_reloc->lobj.gpu_offset) & 0xff; |
2688 | ib[idx+4] += upper_32_bits(src_reloc->lobj.gpu_offset) & 0xff; | 2689 | ib[idx+4] += upper_32_bits(src_reloc->lobj.gpu_offset) & 0xff; |
2689 | p->idx += 5; | 2690 | p->idx += 5; |
2691 | } else { | ||
2692 | src_offset = ib[idx+2]; | ||
2693 | src_offset |= ((u64)(ib[idx+3] & 0xff)) << 32; | ||
2694 | dst_offset = ib[idx+1]; | ||
2695 | dst_offset |= ((u64)(ib[idx+3] & 0xff0000)) << 16; | ||
2696 | |||
2697 | ib[idx+1] += (u32)(dst_reloc->lobj.gpu_offset & 0xfffffffc); | ||
2698 | ib[idx+2] += (u32)(src_reloc->lobj.gpu_offset & 0xfffffffc); | ||
2699 | ib[idx+3] += upper_32_bits(src_reloc->lobj.gpu_offset) & 0xff; | ||
2700 | ib[idx+3] += (upper_32_bits(dst_reloc->lobj.gpu_offset) & 0xff) << 16; | ||
2701 | p->idx += 4; | ||
2702 | } | ||
2690 | } | 2703 | } |
2691 | if ((src_offset + (count * 4)) > radeon_bo_size(src_reloc->robj)) { | 2704 | if ((src_offset + (count * 4)) > radeon_bo_size(src_reloc->robj)) { |
2692 | dev_warn(p->dev, "DMA copy src buffer too small (%llu %lu)\n", | 2705 | dev_warn(p->dev, "DMA copy src buffer too small (%llu %lu)\n", |