Commit 52ce7074 authored by Wambui Karuga's avatar Wambui Karuga Committed by Jani Nikula

drm/i915/ggtt: use new drm logging macros in gt/intel_ggtt.c

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: default avatarWambui Karuga <wambui.karugax@gmail.com>
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200128071437.9284-3-wambui.karugax@gmail.com
parent d4c3c0b8
...@@ -472,7 +472,8 @@ static int ggtt_reserve_guc_top(struct i915_ggtt *ggtt) ...@@ -472,7 +472,8 @@ static int ggtt_reserve_guc_top(struct i915_ggtt *ggtt)
GUC_GGTT_TOP, I915_COLOR_UNEVICTABLE, GUC_GGTT_TOP, I915_COLOR_UNEVICTABLE,
PIN_NOEVICT); PIN_NOEVICT);
if (ret) 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; return ret;
} }
...@@ -544,8 +545,9 @@ static int init_ggtt(struct i915_ggtt *ggtt) ...@@ -544,8 +545,9 @@ static int init_ggtt(struct i915_ggtt *ggtt)
/* Clear any non-preallocated blocks */ /* Clear any non-preallocated blocks */
drm_mm_for_each_hole(entry, &ggtt->vm.mm, hole_start, hole_end) { drm_mm_for_each_hole(entry, &ggtt->vm.mm, hole_start, hole_end) {
DRM_DEBUG_KMS("clearing unused GTT space: [%lx, %lx]\n", drm_dbg_kms(&ggtt->vm.i915->drm,
hole_start, hole_end); "clearing unused GTT space: [%lx, %lx]\n",
hole_start, hole_end);
ggtt->vm.clear_range(&ggtt->vm, hole_start, ggtt->vm.clear_range(&ggtt->vm, hole_start,
hole_end - hole_start); hole_end - hole_start);
} }
...@@ -1267,6 +1269,7 @@ intel_rotate_pages(struct intel_rotation_info *rot_info, ...@@ -1267,6 +1269,7 @@ intel_rotate_pages(struct intel_rotation_info *rot_info,
struct drm_i915_gem_object *obj) struct drm_i915_gem_object *obj)
{ {
unsigned int size = intel_rotation_info_size(rot_info); unsigned int size = intel_rotation_info_size(rot_info);
struct drm_i915_private *i915 = to_i915(obj->base.dev);
struct sg_table *st; struct sg_table *st;
struct scatterlist *sg; struct scatterlist *sg;
int ret = -ENOMEM; int ret = -ENOMEM;
...@@ -1296,8 +1299,9 @@ intel_rotate_pages(struct intel_rotation_info *rot_info, ...@@ -1296,8 +1299,9 @@ intel_rotate_pages(struct intel_rotation_info *rot_info,
kfree(st); kfree(st);
err_st_alloc: err_st_alloc:
DRM_DEBUG_DRIVER("Failed to create rotated mapping for object size %zu! (%ux%u tiles, %u pages)\n", 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); obj->base.size, rot_info->plane[0].width,
rot_info->plane[0].height, size);
return ERR_PTR(ret); return ERR_PTR(ret);
} }
...@@ -1349,6 +1353,7 @@ intel_remap_pages(struct intel_remapped_info *rem_info, ...@@ -1349,6 +1353,7 @@ intel_remap_pages(struct intel_remapped_info *rem_info,
struct drm_i915_gem_object *obj) struct drm_i915_gem_object *obj)
{ {
unsigned int size = intel_remapped_info_size(rem_info); unsigned int size = intel_remapped_info_size(rem_info);
struct drm_i915_private *i915 = to_i915(obj->base.dev);
struct sg_table *st; struct sg_table *st;
struct scatterlist *sg; struct scatterlist *sg;
int ret = -ENOMEM; int ret = -ENOMEM;
...@@ -1380,8 +1385,9 @@ intel_remap_pages(struct intel_remapped_info *rem_info, ...@@ -1380,8 +1385,9 @@ intel_remap_pages(struct intel_remapped_info *rem_info,
kfree(st); kfree(st);
err_st_alloc: err_st_alloc:
DRM_DEBUG_DRIVER("Failed to create remapped mapping for object size %zu! (%ux%u tiles, %u pages)\n", 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); obj->base.size, rem_info->plane[0].width,
rem_info->plane[0].height, size);
return ERR_PTR(ret); return ERR_PTR(ret);
} }
...@@ -1479,8 +1485,9 @@ i915_get_ggtt_vma_pages(struct i915_vma *vma) ...@@ -1479,8 +1485,9 @@ i915_get_ggtt_vma_pages(struct i915_vma *vma)
if (IS_ERR(vma->pages)) { if (IS_ERR(vma->pages)) {
ret = PTR_ERR(vma->pages); ret = PTR_ERR(vma->pages);
vma->pages = NULL; vma->pages = NULL;
DRM_ERROR("Failed to get pages for VMA view type %u (%d)!\n", drm_err(&vma->vm->i915->drm,
vma->ggtt_view.type, ret); "Failed to get pages for VMA view type %u (%d)!\n",
vma->ggtt_view.type, ret);
} }
return ret; return ret;
} }
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