30 #include <linux/slab.h>
68 dev_err(rdev->
dev,
"failed to get a new IB (%d)\n", r);
79 ib->
ptr = radeon_sa_bo_cpu_addr(ib->
sa_bo);
135 bool need_sync =
false;
147 dev_err(rdev->
dev,
"scheduling IB failed (%d).\n", r);
164 if (ib->
vm && !ib->
vm->last_flush) {
174 dev_err(rdev->
dev,
"failed to emit fence for new IB (%d)\n", r);
182 if (ib->
vm && !ib->
vm->last_flush) {
218 if (radeon_debugfs_sa_init(rdev)) {
219 dev_err(rdev->
dev,
"failed to register debugfs file for SA\n");
268 DRM_ERROR(
"radeon: failed testing IB on GFX ring (%d).\n", r);
274 DRM_ERROR(
"radeon: failed testing IB on ring %d (%d).\n", i, r);
308 DRM_ERROR(
"radeon: writing more dwords to the ring than expected!\n");
352 if (rdev->
wb.enabled)
540 unsigned long cjiffies, elapsed;
558 dev_err(rdev->
dev,
"GPU lockup CP stall for more than %lumsec\n", elapsed);
596 else if (rdev->
wb.enabled)
618 for (i = 0; i <
size; ++
i) {
619 (*data)[
i] = ring->
ring[ptr++];
650 for (i = 0; i <
size; ++
i) {
694 dev_err(rdev->
dev,
"(%d) ring create failed\n", r);
703 radeon_bo_unreserve(ring->
ring_obj);
704 dev_err(rdev->
dev,
"(%d) ring pin failed\n", r);
708 (
void **)&ring->
ring);
709 radeon_bo_unreserve(ring->
ring_obj);
711 dev_err(rdev->
dev,
"(%d) ring map failed\n", r);
717 if (rdev->
wb.enabled) {
722 if (radeon_debugfs_ring_init(rdev, ring)) {
723 DRM_ERROR(
"Failed to register debugfs file for rings !\n");
754 radeon_bo_unreserve(ring_obj);
763 #if defined(CONFIG_DEBUG_FS)
765 static int radeon_debugfs_ring_info(
struct seq_file *
m,
void *
data)
767 struct drm_info_node *
node = (
struct drm_info_node *) m->
private;
770 int ridx = *(
int*)node->info_ent->data;
787 for (j = 0; j <=
count; j++) {
798 static struct drm_info_list radeon_debugfs_ring_info_list[] = {
799 {
"radeon_ring_gfx", radeon_debugfs_ring_info, 0, &radeon_ring_type_gfx_index},
800 {
"radeon_ring_cp1", radeon_debugfs_ring_info, 0, &cayman_ring_type_cp1_index},
801 {
"radeon_ring_cp2", radeon_debugfs_ring_info, 0, &cayman_ring_type_cp2_index},
804 static int radeon_debugfs_sa_info(
struct seq_file *m,
void *data)
806 struct drm_info_node *node = (
struct drm_info_node *) m->
private;
810 radeon_sa_bo_dump_debug_info(&
rdev->ring_tmp_bo, m);
816 static struct drm_info_list radeon_debugfs_sa_list[] = {
817 {
"radeon_sa_info", &radeon_debugfs_sa_info, 0,
NULL},
824 #if defined(CONFIG_DEBUG_FS)
826 for (i = 0; i <
ARRAY_SIZE(radeon_debugfs_ring_info_list); ++
i) {
827 struct drm_info_list *
info = &radeon_debugfs_ring_info_list[
i];
828 int ridx = *(
int*)radeon_debugfs_ring_info_list[i].data;
831 if (&rdev->
ring[ridx] != ring)
842 static int radeon_debugfs_sa_init(
struct radeon_device *rdev)
844 #if defined(CONFIG_DEBUG_FS)