diff options
Diffstat (limited to 'sys/dev/pci/drm/radeon/radeon_test.c')
-rw-r--r-- | sys/dev/pci/drm/radeon/radeon_test.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/sys/dev/pci/drm/radeon/radeon_test.c b/sys/dev/pci/drm/radeon/radeon_test.c index 4ab69640929..0c7f228db6e 100644 --- a/sys/dev/pci/drm/radeon/radeon_test.c +++ b/sys/dev/pci/drm/radeon/radeon_test.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0 OR MIT /* * Copyright 2009 VMware, Inc. * @@ -21,8 +22,8 @@ * * Authors: Michel Dänzer */ -#include <dev/pci/drm/drmP.h> -#include <dev/pci/drm/radeon_drm.h> +#include <drm/drmP.h> +#include <drm/radeon_drm.h> #include "radeon_reg.h" #include "radeon.h" @@ -59,7 +60,7 @@ static void radeon_do_test_moves(struct radeon_device *rdev, int flag) n = rdev->mc.gtt_size - rdev->gart_pin_size; n /= size; - gtt_obj = kzalloc(n * sizeof(*gtt_obj), GFP_KERNEL); + gtt_obj = kcalloc(n, sizeof(*gtt_obj), GFP_KERNEL); if (!gtt_obj) { DRM_ERROR("Failed to allocate %d pointers\n", n); r = 1; @@ -246,7 +247,7 @@ out_unref: out_cleanup: kfree(gtt_obj); if (r) { - printk(KERN_WARNING "Error while testing BO move.\n"); + pr_warn("Error while testing BO move\n"); } } @@ -298,7 +299,12 @@ static int radeon_test_create_and_emit_fence(struct radeon_device *rdev, DRM_ERROR("Failed to lock ring A %d\n", ring->idx); return r; } - radeon_fence_emit(rdev, fence, ring->idx); + r = radeon_fence_emit(rdev, fence, ring->idx); + if (r) { + DRM_ERROR("Failed to emit fence\n"); + radeon_ring_unlock_undo(rdev, ring); + return r; + } radeon_ring_unlock_commit(rdev, ring, false); } return 0; @@ -394,7 +400,7 @@ out_cleanup: radeon_fence_unref(&fence2); if (r) - printk(KERN_WARNING "Error while testing ring sync (%d).\n", r); + pr_warn("Error while testing ring sync (%d)\n", r); } static void radeon_test_ring_sync2(struct radeon_device *rdev, @@ -504,7 +510,7 @@ out_cleanup: radeon_fence_unref(&fenceB); if (r) - printk(KERN_WARNING "Error while testing ring sync (%d).\n", r); + pr_warn("Error while testing ring sync (%d)\n", r); } static bool radeon_test_sync_possible(struct radeon_ring *ringA, |