drm/i915/ggtt: use new drm logging macros in gt/intel_ggtt.c
authorWambui Karuga <wambui.karugax@gmail.com>
Tue, 28 Jan 2020 07:14:31 +0000 (10:14 +0300)
committerJani Nikula <jani.nikula@intel.com>
Thu, 30 Jan 2020 13:51:13 +0000 (15:51 +0200)
Manual conversion of the printk based logging macros to the new struct
drm_based logging macros in drm/i915/gt/intel_ggtt.c.
Also includes extracting the struct drm_i915_private device from various
intel types to use in the new macros.

Signed-off-by: Wambui Karuga <wambui.karugax@gmail.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200128071437.9284-3-wambui.karugax@gmail.com
drivers/gpu/drm/i915/gt/intel_ggtt.c

index 79096722ce16744210ddd535af666a1fb3209913..fdfed921402b2837bb9716861cf8d0d0d958aece 100644 (file)
@@ -472,7 +472,8 @@ static int ggtt_reserve_guc_top(struct i915_ggtt *ggtt)
                                   GUC_GGTT_TOP, I915_COLOR_UNEVICTABLE,
                                   PIN_NOEVICT);
        if (ret)
-               DRM_DEBUG_DRIVER("Failed to reserve top of GGTT for GuC\n");
+               drm_dbg(&ggtt->vm.i915->drm,
+                       "Failed to reserve top of GGTT for GuC\n");
 
        return ret;
 }
@@ -544,8 +545,9 @@ static int init_ggtt(struct i915_ggtt *ggtt)
 
        /* Clear any non-preallocated blocks */
        drm_mm_for_each_hole(entry, &ggtt->vm.mm, hole_start, hole_end) {
-               DRM_DEBUG_KMS("clearing unused GTT space: [%lx, %lx]\n",
-                             hole_start, hole_end);
+               drm_dbg_kms(&ggtt->vm.i915->drm,
+                           "clearing unused GTT space: [%lx, %lx]\n",
+                           hole_start, hole_end);
                ggtt->vm.clear_range(&ggtt->vm, hole_start,
                                     hole_end - hole_start);
        }
@@ -1267,6 +1269,7 @@ intel_rotate_pages(struct intel_rotation_info *rot_info,
                   struct drm_i915_gem_object *obj)
 {
        unsigned int size = intel_rotation_info_size(rot_info);
+       struct drm_i915_private *i915 = to_i915(obj->base.dev);
        struct sg_table *st;
        struct scatterlist *sg;
        int ret = -ENOMEM;
@@ -1296,8 +1299,9 @@ err_sg_alloc:
        kfree(st);
 err_st_alloc:
 
-       DRM_DEBUG_DRIVER("Failed to create rotated mapping for object size %zu! (%ux%u tiles, %u pages)\n",
-                        obj->base.size, rot_info->plane[0].width, rot_info->plane[0].height, size);
+       drm_dbg(&i915->drm, "Failed to create rotated mapping for object size %zu! (%ux%u tiles, %u pages)\n",
+               obj->base.size, rot_info->plane[0].width,
+               rot_info->plane[0].height, size);
 
        return ERR_PTR(ret);
 }
@@ -1349,6 +1353,7 @@ intel_remap_pages(struct intel_remapped_info *rem_info,
                  struct drm_i915_gem_object *obj)
 {
        unsigned int size = intel_remapped_info_size(rem_info);
+       struct drm_i915_private *i915 = to_i915(obj->base.dev);
        struct sg_table *st;
        struct scatterlist *sg;
        int ret = -ENOMEM;
@@ -1380,8 +1385,9 @@ err_sg_alloc:
        kfree(st);
 err_st_alloc:
 
-       DRM_DEBUG_DRIVER("Failed to create remapped mapping for object size %zu! (%ux%u tiles, %u pages)\n",
-                        obj->base.size, rem_info->plane[0].width, rem_info->plane[0].height, size);
+       drm_dbg(&i915->drm, "Failed to create remapped mapping for object size %zu! (%ux%u tiles, %u pages)\n",
+               obj->base.size, rem_info->plane[0].width,
+               rem_info->plane[0].height, size);
 
        return ERR_PTR(ret);
 }
@@ -1479,8 +1485,9 @@ i915_get_ggtt_vma_pages(struct i915_vma *vma)
        if (IS_ERR(vma->pages)) {
                ret = PTR_ERR(vma->pages);
                vma->pages = NULL;
-               DRM_ERROR("Failed to get pages for VMA view type %u (%d)!\n",
-                         vma->ggtt_view.type, ret);
+               drm_err(&vma->vm->i915->drm,
+                       "Failed to get pages for VMA view type %u (%d)!\n",
+                       vma->ggtt_view.type, ret);
        }
        return ret;
 }