Commit c3ad63af authored by Ilija Hadzic's avatar Ilija Hadzic Committed by Alex Deucher

drm/radeon: rename r100_cs_dump_packet to radeon_cs_dump_packet

This function is not limited to r100, but it can dump a
(raw) packet for any ASIC. Rename it accordingly and move
its declaration to radeon.h
Signed-off-by: default avatarIlija Hadzic <ihadzic@research.bell-labs.com>
Reviewed-by: default avatarMarek Olšák <maraeo@gmail.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent d6e18a34
...@@ -1219,7 +1219,7 @@ int r100_reloc_pitch_offset(struct radeon_cs_parser *p, ...@@ -1219,7 +1219,7 @@ int r100_reloc_pitch_offset(struct radeon_cs_parser *p,
if (r) { if (r) {
DRM_ERROR("No reloc for ib[%d]=0x%04X\n", DRM_ERROR("No reloc for ib[%d]=0x%04X\n",
idx, reg); idx, reg);
r100_cs_dump_packet(p, pkt); radeon_cs_dump_packet(p, pkt);
return r; return r;
} }
...@@ -1233,7 +1233,7 @@ int r100_reloc_pitch_offset(struct radeon_cs_parser *p, ...@@ -1233,7 +1233,7 @@ int r100_reloc_pitch_offset(struct radeon_cs_parser *p,
if (reloc->lobj.tiling_flags & RADEON_TILING_MICRO) { if (reloc->lobj.tiling_flags & RADEON_TILING_MICRO) {
if (reg == RADEON_SRC_PITCH_OFFSET) { if (reg == RADEON_SRC_PITCH_OFFSET) {
DRM_ERROR("Cannot src blit from microtiled surface\n"); DRM_ERROR("Cannot src blit from microtiled surface\n");
r100_cs_dump_packet(p, pkt); radeon_cs_dump_packet(p, pkt);
return -EINVAL; return -EINVAL;
} }
tile_flags |= RADEON_DST_TILE_MICRO; tile_flags |= RADEON_DST_TILE_MICRO;
...@@ -1263,7 +1263,7 @@ int r100_packet3_load_vbpntr(struct radeon_cs_parser *p, ...@@ -1263,7 +1263,7 @@ int r100_packet3_load_vbpntr(struct radeon_cs_parser *p,
if (c > 16) { if (c > 16) {
DRM_ERROR("Only 16 vertex buffers are allowed %d\n", DRM_ERROR("Only 16 vertex buffers are allowed %d\n",
pkt->opcode); pkt->opcode);
r100_cs_dump_packet(p, pkt); radeon_cs_dump_packet(p, pkt);
return -EINVAL; return -EINVAL;
} }
track->num_arrays = c; track->num_arrays = c;
...@@ -1272,7 +1272,7 @@ int r100_packet3_load_vbpntr(struct radeon_cs_parser *p, ...@@ -1272,7 +1272,7 @@ int r100_packet3_load_vbpntr(struct radeon_cs_parser *p,
if (r) { if (r) {
DRM_ERROR("No reloc for packet3 %d\n", DRM_ERROR("No reloc for packet3 %d\n",
pkt->opcode); pkt->opcode);
r100_cs_dump_packet(p, pkt); radeon_cs_dump_packet(p, pkt);
return r; return r;
} }
idx_value = radeon_get_ib_value(p, idx); idx_value = radeon_get_ib_value(p, idx);
...@@ -1285,7 +1285,7 @@ int r100_packet3_load_vbpntr(struct radeon_cs_parser *p, ...@@ -1285,7 +1285,7 @@ int r100_packet3_load_vbpntr(struct radeon_cs_parser *p,
if (r) { if (r) {
DRM_ERROR("No reloc for packet3 %d\n", DRM_ERROR("No reloc for packet3 %d\n",
pkt->opcode); pkt->opcode);
r100_cs_dump_packet(p, pkt); radeon_cs_dump_packet(p, pkt);
return r; return r;
} }
ib[idx+2] = radeon_get_ib_value(p, idx + 2) + ((u32)reloc->lobj.gpu_offset); ib[idx+2] = radeon_get_ib_value(p, idx + 2) + ((u32)reloc->lobj.gpu_offset);
...@@ -1298,7 +1298,7 @@ int r100_packet3_load_vbpntr(struct radeon_cs_parser *p, ...@@ -1298,7 +1298,7 @@ int r100_packet3_load_vbpntr(struct radeon_cs_parser *p,
if (r) { if (r) {
DRM_ERROR("No reloc for packet3 %d\n", DRM_ERROR("No reloc for packet3 %d\n",
pkt->opcode); pkt->opcode);
r100_cs_dump_packet(p, pkt); radeon_cs_dump_packet(p, pkt);
return r; return r;
} }
idx_value = radeon_get_ib_value(p, idx); idx_value = radeon_get_ib_value(p, idx);
...@@ -1355,20 +1355,6 @@ int r100_cs_parse_packet0(struct radeon_cs_parser *p, ...@@ -1355,20 +1355,6 @@ int r100_cs_parse_packet0(struct radeon_cs_parser *p,
return 0; return 0;
} }
void r100_cs_dump_packet(struct radeon_cs_parser *p,
struct radeon_cs_packet *pkt)
{
volatile uint32_t *ib;
unsigned i;
unsigned idx;
ib = p->ib.ptr;
idx = pkt->idx;
for (i = 0; i <= (pkt->count + 1); i++, idx++) {
DRM_INFO("ib[%d]=0x%08X\n", idx, ib[idx]);
}
}
/** /**
* r100_cs_packet_next_vline() - parse userspace VLINE packet * r100_cs_packet_next_vline() - parse userspace VLINE packet
* @parser: parser structure holding parsing context. * @parser: parser structure holding parsing context.
...@@ -1492,14 +1478,14 @@ int r100_cs_packet_next_reloc(struct radeon_cs_parser *p, ...@@ -1492,14 +1478,14 @@ int r100_cs_packet_next_reloc(struct radeon_cs_parser *p,
if (p3reloc.type != PACKET_TYPE3 || p3reloc.opcode != PACKET3_NOP) { if (p3reloc.type != PACKET_TYPE3 || p3reloc.opcode != PACKET3_NOP) {
DRM_ERROR("No packet3 for relocation for packet at %d.\n", DRM_ERROR("No packet3 for relocation for packet at %d.\n",
p3reloc.idx); p3reloc.idx);
r100_cs_dump_packet(p, &p3reloc); radeon_cs_dump_packet(p, &p3reloc);
return -EINVAL; return -EINVAL;
} }
idx = radeon_get_ib_value(p, p3reloc.idx + 1); idx = radeon_get_ib_value(p, p3reloc.idx + 1);
if (idx >= relocs_chunk->length_dw) { if (idx >= relocs_chunk->length_dw) {
DRM_ERROR("Relocs at %d after relocations chunk end %d !\n", DRM_ERROR("Relocs at %d after relocations chunk end %d !\n",
idx, relocs_chunk->length_dw); idx, relocs_chunk->length_dw);
r100_cs_dump_packet(p, &p3reloc); radeon_cs_dump_packet(p, &p3reloc);
return -EINVAL; return -EINVAL;
} }
/* FIXME: we assume reloc size is 4 dwords */ /* FIXME: we assume reloc size is 4 dwords */
...@@ -1584,7 +1570,7 @@ static int r100_packet0_check(struct radeon_cs_parser *p, ...@@ -1584,7 +1570,7 @@ static int r100_packet0_check(struct radeon_cs_parser *p,
if (r) { if (r) {
DRM_ERROR("No reloc for ib[%d]=0x%04X\n", DRM_ERROR("No reloc for ib[%d]=0x%04X\n",
idx, reg); idx, reg);
r100_cs_dump_packet(p, pkt); radeon_cs_dump_packet(p, pkt);
return r; return r;
} }
break; break;
...@@ -1601,7 +1587,7 @@ static int r100_packet0_check(struct radeon_cs_parser *p, ...@@ -1601,7 +1587,7 @@ static int r100_packet0_check(struct radeon_cs_parser *p,
if (r) { if (r) {
DRM_ERROR("No reloc for ib[%d]=0x%04X\n", DRM_ERROR("No reloc for ib[%d]=0x%04X\n",
idx, reg); idx, reg);
r100_cs_dump_packet(p, pkt); radeon_cs_dump_packet(p, pkt);
return r; return r;
} }
track->zb.robj = reloc->robj; track->zb.robj = reloc->robj;
...@@ -1614,7 +1600,7 @@ static int r100_packet0_check(struct radeon_cs_parser *p, ...@@ -1614,7 +1600,7 @@ static int r100_packet0_check(struct radeon_cs_parser *p,
if (r) { if (r) {
DRM_ERROR("No reloc for ib[%d]=0x%04X\n", DRM_ERROR("No reloc for ib[%d]=0x%04X\n",
idx, reg); idx, reg);
r100_cs_dump_packet(p, pkt); radeon_cs_dump_packet(p, pkt);
return r; return r;
} }
track->cb[0].robj = reloc->robj; track->cb[0].robj = reloc->robj;
...@@ -1630,7 +1616,7 @@ static int r100_packet0_check(struct radeon_cs_parser *p, ...@@ -1630,7 +1616,7 @@ static int r100_packet0_check(struct radeon_cs_parser *p,
if (r) { if (r) {
DRM_ERROR("No reloc for ib[%d]=0x%04X\n", DRM_ERROR("No reloc for ib[%d]=0x%04X\n",
idx, reg); idx, reg);
r100_cs_dump_packet(p, pkt); radeon_cs_dump_packet(p, pkt);
return r; return r;
} }
if (!(p->cs_flags & RADEON_CS_KEEP_TILING_FLAGS)) { if (!(p->cs_flags & RADEON_CS_KEEP_TILING_FLAGS)) {
...@@ -1657,7 +1643,7 @@ static int r100_packet0_check(struct radeon_cs_parser *p, ...@@ -1657,7 +1643,7 @@ static int r100_packet0_check(struct radeon_cs_parser *p,
if (r) { if (r) {
DRM_ERROR("No reloc for ib[%d]=0x%04X\n", DRM_ERROR("No reloc for ib[%d]=0x%04X\n",
idx, reg); idx, reg);
r100_cs_dump_packet(p, pkt); radeon_cs_dump_packet(p, pkt);
return r; return r;
} }
track->textures[0].cube_info[i].offset = idx_value; track->textures[0].cube_info[i].offset = idx_value;
...@@ -1675,7 +1661,7 @@ static int r100_packet0_check(struct radeon_cs_parser *p, ...@@ -1675,7 +1661,7 @@ static int r100_packet0_check(struct radeon_cs_parser *p,
if (r) { if (r) {
DRM_ERROR("No reloc for ib[%d]=0x%04X\n", DRM_ERROR("No reloc for ib[%d]=0x%04X\n",
idx, reg); idx, reg);
r100_cs_dump_packet(p, pkt); radeon_cs_dump_packet(p, pkt);
return r; return r;
} }
track->textures[1].cube_info[i].offset = idx_value; track->textures[1].cube_info[i].offset = idx_value;
...@@ -1693,7 +1679,7 @@ static int r100_packet0_check(struct radeon_cs_parser *p, ...@@ -1693,7 +1679,7 @@ static int r100_packet0_check(struct radeon_cs_parser *p,
if (r) { if (r) {
DRM_ERROR("No reloc for ib[%d]=0x%04X\n", DRM_ERROR("No reloc for ib[%d]=0x%04X\n",
idx, reg); idx, reg);
r100_cs_dump_packet(p, pkt); radeon_cs_dump_packet(p, pkt);
return r; return r;
} }
track->textures[2].cube_info[i].offset = idx_value; track->textures[2].cube_info[i].offset = idx_value;
...@@ -1711,7 +1697,7 @@ static int r100_packet0_check(struct radeon_cs_parser *p, ...@@ -1711,7 +1697,7 @@ static int r100_packet0_check(struct radeon_cs_parser *p,
if (r) { if (r) {
DRM_ERROR("No reloc for ib[%d]=0x%04X\n", DRM_ERROR("No reloc for ib[%d]=0x%04X\n",
idx, reg); idx, reg);
r100_cs_dump_packet(p, pkt); radeon_cs_dump_packet(p, pkt);
return r; return r;
} }
if (!(p->cs_flags & RADEON_CS_KEEP_TILING_FLAGS)) { if (!(p->cs_flags & RADEON_CS_KEEP_TILING_FLAGS)) {
...@@ -1782,7 +1768,7 @@ static int r100_packet0_check(struct radeon_cs_parser *p, ...@@ -1782,7 +1768,7 @@ static int r100_packet0_check(struct radeon_cs_parser *p,
if (r) { if (r) {
DRM_ERROR("No reloc for ib[%d]=0x%04X\n", DRM_ERROR("No reloc for ib[%d]=0x%04X\n",
idx, reg); idx, reg);
r100_cs_dump_packet(p, pkt); radeon_cs_dump_packet(p, pkt);
return r; return r;
} }
ib[idx] = idx_value + ((u32)reloc->lobj.gpu_offset); ib[idx] = idx_value + ((u32)reloc->lobj.gpu_offset);
...@@ -1942,7 +1928,7 @@ static int r100_packet3_check(struct radeon_cs_parser *p, ...@@ -1942,7 +1928,7 @@ static int r100_packet3_check(struct radeon_cs_parser *p,
r = r100_cs_packet_next_reloc(p, &reloc); r = r100_cs_packet_next_reloc(p, &reloc);
if (r) { if (r) {
DRM_ERROR("No reloc for packet3 %d\n", pkt->opcode); DRM_ERROR("No reloc for packet3 %d\n", pkt->opcode);
r100_cs_dump_packet(p, pkt); radeon_cs_dump_packet(p, pkt);
return r; return r;
} }
ib[idx+1] = radeon_get_ib_value(p, idx+1) + ((u32)reloc->lobj.gpu_offset); ib[idx+1] = radeon_get_ib_value(p, idx+1) + ((u32)reloc->lobj.gpu_offset);
...@@ -1956,7 +1942,7 @@ static int r100_packet3_check(struct radeon_cs_parser *p, ...@@ -1956,7 +1942,7 @@ static int r100_packet3_check(struct radeon_cs_parser *p,
r = r100_cs_packet_next_reloc(p, &reloc); r = r100_cs_packet_next_reloc(p, &reloc);
if (r) { if (r) {
DRM_ERROR("No reloc for packet3 %d\n", pkt->opcode); DRM_ERROR("No reloc for packet3 %d\n", pkt->opcode);
r100_cs_dump_packet(p, pkt); radeon_cs_dump_packet(p, pkt);
return r; return r;
} }
ib[idx] = radeon_get_ib_value(p, idx) + ((u32)reloc->lobj.gpu_offset); ib[idx] = radeon_get_ib_value(p, idx) + ((u32)reloc->lobj.gpu_offset);
......
...@@ -83,8 +83,6 @@ int r100_cs_track_check(struct radeon_device *rdev, struct r100_cs_track *track) ...@@ -83,8 +83,6 @@ int r100_cs_track_check(struct radeon_device *rdev, struct r100_cs_track *track)
void r100_cs_track_clear(struct radeon_device *rdev, struct r100_cs_track *track); void r100_cs_track_clear(struct radeon_device *rdev, struct r100_cs_track *track);
int r100_cs_packet_next_reloc(struct radeon_cs_parser *p, int r100_cs_packet_next_reloc(struct radeon_cs_parser *p,
struct radeon_cs_reloc **cs_reloc); struct radeon_cs_reloc **cs_reloc);
void r100_cs_dump_packet(struct radeon_cs_parser *p,
struct radeon_cs_packet *pkt);
int r100_cs_packet_parse_vline(struct radeon_cs_parser *p); int r100_cs_packet_parse_vline(struct radeon_cs_parser *p);
......
...@@ -162,7 +162,7 @@ int r200_packet0_check(struct radeon_cs_parser *p, ...@@ -162,7 +162,7 @@ int r200_packet0_check(struct radeon_cs_parser *p,
if (r) { if (r) {
DRM_ERROR("No reloc for ib[%d]=0x%04X\n", DRM_ERROR("No reloc for ib[%d]=0x%04X\n",
idx, reg); idx, reg);
r100_cs_dump_packet(p, pkt); radeon_cs_dump_packet(p, pkt);
return r; return r;
} }
break; break;
...@@ -179,7 +179,7 @@ int r200_packet0_check(struct radeon_cs_parser *p, ...@@ -179,7 +179,7 @@ int r200_packet0_check(struct radeon_cs_parser *p,
if (r) { if (r) {
DRM_ERROR("No reloc for ib[%d]=0x%04X\n", DRM_ERROR("No reloc for ib[%d]=0x%04X\n",
idx, reg); idx, reg);
r100_cs_dump_packet(p, pkt); radeon_cs_dump_packet(p, pkt);
return r; return r;
} }
track->zb.robj = reloc->robj; track->zb.robj = reloc->robj;
...@@ -192,7 +192,7 @@ int r200_packet0_check(struct radeon_cs_parser *p, ...@@ -192,7 +192,7 @@ int r200_packet0_check(struct radeon_cs_parser *p,
if (r) { if (r) {
DRM_ERROR("No reloc for ib[%d]=0x%04X\n", DRM_ERROR("No reloc for ib[%d]=0x%04X\n",
idx, reg); idx, reg);
r100_cs_dump_packet(p, pkt); radeon_cs_dump_packet(p, pkt);
return r; return r;
} }
track->cb[0].robj = reloc->robj; track->cb[0].robj = reloc->robj;
...@@ -211,7 +211,7 @@ int r200_packet0_check(struct radeon_cs_parser *p, ...@@ -211,7 +211,7 @@ int r200_packet0_check(struct radeon_cs_parser *p,
if (r) { if (r) {
DRM_ERROR("No reloc for ib[%d]=0x%04X\n", DRM_ERROR("No reloc for ib[%d]=0x%04X\n",
idx, reg); idx, reg);
r100_cs_dump_packet(p, pkt); radeon_cs_dump_packet(p, pkt);
return r; return r;
} }
if (!(p->cs_flags & RADEON_CS_KEEP_TILING_FLAGS)) { if (!(p->cs_flags & RADEON_CS_KEEP_TILING_FLAGS)) {
...@@ -264,7 +264,7 @@ int r200_packet0_check(struct radeon_cs_parser *p, ...@@ -264,7 +264,7 @@ int r200_packet0_check(struct radeon_cs_parser *p,
if (r) { if (r) {
DRM_ERROR("No reloc for ib[%d]=0x%04X\n", DRM_ERROR("No reloc for ib[%d]=0x%04X\n",
idx, reg); idx, reg);
r100_cs_dump_packet(p, pkt); radeon_cs_dump_packet(p, pkt);
return r; return r;
} }
track->textures[i].cube_info[face - 1].offset = idx_value; track->textures[i].cube_info[face - 1].offset = idx_value;
...@@ -282,7 +282,7 @@ int r200_packet0_check(struct radeon_cs_parser *p, ...@@ -282,7 +282,7 @@ int r200_packet0_check(struct radeon_cs_parser *p,
if (r) { if (r) {
DRM_ERROR("No reloc for ib[%d]=0x%04X\n", DRM_ERROR("No reloc for ib[%d]=0x%04X\n",
idx, reg); idx, reg);
r100_cs_dump_packet(p, pkt); radeon_cs_dump_packet(p, pkt);
return r; return r;
} }
...@@ -359,7 +359,7 @@ int r200_packet0_check(struct radeon_cs_parser *p, ...@@ -359,7 +359,7 @@ int r200_packet0_check(struct radeon_cs_parser *p,
if (r) { if (r) {
DRM_ERROR("No reloc for ib[%d]=0x%04X\n", DRM_ERROR("No reloc for ib[%d]=0x%04X\n",
idx, reg); idx, reg);
r100_cs_dump_packet(p, pkt); radeon_cs_dump_packet(p, pkt);
return r; return r;
} }
ib[idx] = idx_value + ((u32)reloc->lobj.gpu_offset); ib[idx] = idx_value + ((u32)reloc->lobj.gpu_offset);
......
...@@ -615,7 +615,7 @@ static int r300_packet0_check(struct radeon_cs_parser *p, ...@@ -615,7 +615,7 @@ static int r300_packet0_check(struct radeon_cs_parser *p,
if (r) { if (r) {
DRM_ERROR("No reloc for ib[%d]=0x%04X\n", DRM_ERROR("No reloc for ib[%d]=0x%04X\n",
idx, reg); idx, reg);
r100_cs_dump_packet(p, pkt); radeon_cs_dump_packet(p, pkt);
return r; return r;
} }
break; break;
...@@ -634,7 +634,7 @@ static int r300_packet0_check(struct radeon_cs_parser *p, ...@@ -634,7 +634,7 @@ static int r300_packet0_check(struct radeon_cs_parser *p,
if (r) { if (r) {
DRM_ERROR("No reloc for ib[%d]=0x%04X\n", DRM_ERROR("No reloc for ib[%d]=0x%04X\n",
idx, reg); idx, reg);
r100_cs_dump_packet(p, pkt); radeon_cs_dump_packet(p, pkt);
return r; return r;
} }
track->cb[i].robj = reloc->robj; track->cb[i].robj = reloc->robj;
...@@ -647,7 +647,7 @@ static int r300_packet0_check(struct radeon_cs_parser *p, ...@@ -647,7 +647,7 @@ static int r300_packet0_check(struct radeon_cs_parser *p,
if (r) { if (r) {
DRM_ERROR("No reloc for ib[%d]=0x%04X\n", DRM_ERROR("No reloc for ib[%d]=0x%04X\n",
idx, reg); idx, reg);
r100_cs_dump_packet(p, pkt); radeon_cs_dump_packet(p, pkt);
return r; return r;
} }
track->zb.robj = reloc->robj; track->zb.robj = reloc->robj;
...@@ -676,7 +676,7 @@ static int r300_packet0_check(struct radeon_cs_parser *p, ...@@ -676,7 +676,7 @@ static int r300_packet0_check(struct radeon_cs_parser *p,
if (r) { if (r) {
DRM_ERROR("No reloc for ib[%d]=0x%04X\n", DRM_ERROR("No reloc for ib[%d]=0x%04X\n",
idx, reg); idx, reg);
r100_cs_dump_packet(p, pkt); radeon_cs_dump_packet(p, pkt);
return r; return r;
} }
...@@ -749,7 +749,7 @@ static int r300_packet0_check(struct radeon_cs_parser *p, ...@@ -749,7 +749,7 @@ static int r300_packet0_check(struct radeon_cs_parser *p,
if (r) { if (r) {
DRM_ERROR("No reloc for ib[%d]=0x%04X\n", DRM_ERROR("No reloc for ib[%d]=0x%04X\n",
idx, reg); idx, reg);
r100_cs_dump_packet(p, pkt); radeon_cs_dump_packet(p, pkt);
return r; return r;
} }
...@@ -834,7 +834,7 @@ static int r300_packet0_check(struct radeon_cs_parser *p, ...@@ -834,7 +834,7 @@ static int r300_packet0_check(struct radeon_cs_parser *p,
if (r) { if (r) {
DRM_ERROR("No reloc for ib[%d]=0x%04X\n", DRM_ERROR("No reloc for ib[%d]=0x%04X\n",
idx, reg); idx, reg);
r100_cs_dump_packet(p, pkt); radeon_cs_dump_packet(p, pkt);
return r; return r;
} }
...@@ -1049,7 +1049,7 @@ static int r300_packet0_check(struct radeon_cs_parser *p, ...@@ -1049,7 +1049,7 @@ static int r300_packet0_check(struct radeon_cs_parser *p,
if (r) { if (r) {
DRM_ERROR("No reloc for ib[%d]=0x%04X\n", DRM_ERROR("No reloc for ib[%d]=0x%04X\n",
idx, reg); idx, reg);
r100_cs_dump_packet(p, pkt); radeon_cs_dump_packet(p, pkt);
return r; return r;
} }
ib[idx] = idx_value + ((u32)reloc->lobj.gpu_offset); ib[idx] = idx_value + ((u32)reloc->lobj.gpu_offset);
...@@ -1091,7 +1091,7 @@ static int r300_packet0_check(struct radeon_cs_parser *p, ...@@ -1091,7 +1091,7 @@ static int r300_packet0_check(struct radeon_cs_parser *p,
if (r) { if (r) {
DRM_ERROR("No reloc for ib[%d]=0x%04X\n", DRM_ERROR("No reloc for ib[%d]=0x%04X\n",
idx, reg); idx, reg);
r100_cs_dump_packet(p, pkt); radeon_cs_dump_packet(p, pkt);
return r; return r;
} }
track->aa.robj = reloc->robj; track->aa.robj = reloc->robj;
...@@ -1159,7 +1159,7 @@ static int r300_packet3_check(struct radeon_cs_parser *p, ...@@ -1159,7 +1159,7 @@ static int r300_packet3_check(struct radeon_cs_parser *p,
r = r100_cs_packet_next_reloc(p, &reloc); r = r100_cs_packet_next_reloc(p, &reloc);
if (r) { if (r) {
DRM_ERROR("No reloc for packet3 %d\n", pkt->opcode); DRM_ERROR("No reloc for packet3 %d\n", pkt->opcode);
r100_cs_dump_packet(p, pkt); radeon_cs_dump_packet(p, pkt);
return r; return r;
} }
ib[idx+1] = radeon_get_ib_value(p, idx + 1) + ((u32)reloc->lobj.gpu_offset); ib[idx+1] = radeon_get_ib_value(p, idx + 1) + ((u32)reloc->lobj.gpu_offset);
......
...@@ -1976,6 +1976,8 @@ int radeon_cs_packet_parse(struct radeon_cs_parser *p, ...@@ -1976,6 +1976,8 @@ int radeon_cs_packet_parse(struct radeon_cs_parser *p,
struct radeon_cs_packet *pkt, struct radeon_cs_packet *pkt,
unsigned idx); unsigned idx);
bool radeon_cs_packet_next_is_pkt3_nop(struct radeon_cs_parser *p); bool radeon_cs_packet_next_is_pkt3_nop(struct radeon_cs_parser *p);
void radeon_cs_dump_packet(struct radeon_cs_parser *p,
struct radeon_cs_packet *pkt);
int r600_cs_common_vline_parse(struct radeon_cs_parser *p, int r600_cs_common_vline_parse(struct radeon_cs_parser *p,
uint32_t *vline_start_end, uint32_t *vline_start_end,
uint32_t *vline_status); uint32_t *vline_status);
......
...@@ -716,3 +716,24 @@ bool radeon_cs_packet_next_is_pkt3_nop(struct radeon_cs_parser *p) ...@@ -716,3 +716,24 @@ bool radeon_cs_packet_next_is_pkt3_nop(struct radeon_cs_parser *p)
return false; return false;
return true; return true;
} }
/**
* radeon_cs_dump_packet() - dump raw packet context
* @p: structure holding the parser context.
* @pkt: structure holding the packet.
*
* Used mostly for debugging and error reporting.
**/
void radeon_cs_dump_packet(struct radeon_cs_parser *p,
struct radeon_cs_packet *pkt)
{
volatile uint32_t *ib;
unsigned i;
unsigned idx;
ib = p->ib.ptr;
idx = pkt->idx;
for (i = 0; i <= (pkt->count + 1); i++, idx++)
DRM_INFO("ib[%d]=0x%08X\n", idx, ib[idx]);
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment