Commit 36034c95 authored by Wambui Karuga's avatar Wambui Karuga Committed by Jani Nikula

drm/i915/ggtt: convert to drm_device based logging macros.

Converts various instances of the printk based drm logging macros to use
the struct drm_device based logging macros in i915/gt/intel_ggtt.c.
This change was done using the following coccinelle script that matches
based on the existence of a drm_i915_private device:
@@
identifier fn, T;
@@

fn(...) {
...
struct drm_i915_private *T = ...;
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}

@@
identifier fn, T;
@@

fn(...,struct drm_i915_private *T,...) {
<+...
(
-DRM_INFO(
+drm_info(&T->drm,
...)
|
-DRM_ERROR(
+drm_err(&T->drm,
...)
|
-DRM_WARN(
+drm_warn(&T->drm,
...)
|
-DRM_DEBUG_DRIVER(
+drm_dbg(&T->drm,
...)
|
-DRM_DEBUG_KMS(
+drm_dbg_kms(&T->drm,
...)
|
-DRM_DEBUG_ATOMIC(
+drm_dbg_atomic(&T->drm,
...)
)
...+>
}

New checkpatch warnings were fixed manually.

Note that this converts DRM_DEBUG_DRIVER to drm_dbg()

References: https://lists.freedesktop.org/archives/dri-devel/2020-January/253381.htmlSigned-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/20200314183344.17603-2-wambui.karugax@gmail.com
parent 38825817
...@@ -769,13 +769,13 @@ static int ggtt_probe_common(struct i915_ggtt *ggtt, u64 size) ...@@ -769,13 +769,13 @@ static int ggtt_probe_common(struct i915_ggtt *ggtt, u64 size)
else else
ggtt->gsm = ioremap_wc(phys_addr, size); ggtt->gsm = ioremap_wc(phys_addr, size);
if (!ggtt->gsm) { if (!ggtt->gsm) {
DRM_ERROR("Failed to map the ggtt page table\n"); drm_err(&i915->drm, "Failed to map the ggtt page table\n");
return -ENOMEM; return -ENOMEM;
} }
ret = setup_scratch_page(&ggtt->vm, GFP_DMA32); ret = setup_scratch_page(&ggtt->vm, GFP_DMA32);
if (ret) { if (ret) {
DRM_ERROR("Scratch setup failed\n"); drm_err(&i915->drm, "Scratch setup failed\n");
/* iounmap will also get called at remove, but meh */ /* iounmap will also get called at remove, but meh */
iounmap(ggtt->gsm); iounmap(ggtt->gsm);
return ret; return ret;
...@@ -835,7 +835,8 @@ static int gen8_gmch_probe(struct i915_ggtt *ggtt) ...@@ -835,7 +835,8 @@ static int gen8_gmch_probe(struct i915_ggtt *ggtt)
if (!err) if (!err)
err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(39)); err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(39));
if (err) if (err)
DRM_ERROR("Can't set DMA mask/consistent mask (%d)\n", err); drm_err(&i915->drm,
"Can't set DMA mask/consistent mask (%d)\n", err);
pci_read_config_word(pdev, SNB_GMCH_CTRL, &snb_gmch_ctl); pci_read_config_word(pdev, SNB_GMCH_CTRL, &snb_gmch_ctl);
if (IS_CHERRYVIEW(i915)) if (IS_CHERRYVIEW(i915))
...@@ -982,7 +983,8 @@ static int gen6_gmch_probe(struct i915_ggtt *ggtt) ...@@ -982,7 +983,8 @@ static int gen6_gmch_probe(struct i915_ggtt *ggtt)
* just a coarse sanity check. * just a coarse sanity check.
*/ */
if (ggtt->mappable_end < (64<<20) || ggtt->mappable_end > (512<<20)) { if (ggtt->mappable_end < (64<<20) || ggtt->mappable_end > (512<<20)) {
DRM_ERROR("Unknown GMADR size (%pa)\n", &ggtt->mappable_end); drm_err(&i915->drm, "Unknown GMADR size (%pa)\n",
&ggtt->mappable_end);
return -ENXIO; return -ENXIO;
} }
...@@ -990,7 +992,8 @@ static int gen6_gmch_probe(struct i915_ggtt *ggtt) ...@@ -990,7 +992,8 @@ static int gen6_gmch_probe(struct i915_ggtt *ggtt)
if (!err) if (!err)
err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(40)); err = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(40));
if (err) if (err)
DRM_ERROR("Can't set DMA mask/consistent mask (%d)\n", err); drm_err(&i915->drm,
"Can't set DMA mask/consistent mask (%d)\n", err);
pci_read_config_word(pdev, SNB_GMCH_CTRL, &snb_gmch_ctl); pci_read_config_word(pdev, SNB_GMCH_CTRL, &snb_gmch_ctl);
size = gen6_get_total_gtt_size(snb_gmch_ctl); size = gen6_get_total_gtt_size(snb_gmch_ctl);
...@@ -1037,7 +1040,7 @@ static int i915_gmch_probe(struct i915_ggtt *ggtt) ...@@ -1037,7 +1040,7 @@ static int i915_gmch_probe(struct i915_ggtt *ggtt)
ret = intel_gmch_probe(i915->bridge_dev, i915->drm.pdev, NULL); ret = intel_gmch_probe(i915->bridge_dev, i915->drm.pdev, NULL);
if (!ret) { if (!ret) {
DRM_ERROR("failed to set up gmch\n"); drm_err(&i915->drm, "failed to set up gmch\n");
return -EIO; return -EIO;
} }
...@@ -1085,26 +1088,29 @@ static int ggtt_probe_hw(struct i915_ggtt *ggtt, struct intel_gt *gt) ...@@ -1085,26 +1088,29 @@ static int ggtt_probe_hw(struct i915_ggtt *ggtt, struct intel_gt *gt)
return ret; return ret;
if ((ggtt->vm.total - 1) >> 32) { if ((ggtt->vm.total - 1) >> 32) {
DRM_ERROR("We never expected a Global GTT with more than 32bits" drm_err(&i915->drm,
" of address space! Found %lldM!\n", "We never expected a Global GTT with more than 32bits"
ggtt->vm.total >> 20); " of address space! Found %lldM!\n",
ggtt->vm.total >> 20);
ggtt->vm.total = 1ULL << 32; ggtt->vm.total = 1ULL << 32;
ggtt->mappable_end = ggtt->mappable_end =
min_t(u64, ggtt->mappable_end, ggtt->vm.total); min_t(u64, ggtt->mappable_end, ggtt->vm.total);
} }
if (ggtt->mappable_end > ggtt->vm.total) { if (ggtt->mappable_end > ggtt->vm.total) {
DRM_ERROR("mappable aperture extends past end of GGTT," drm_err(&i915->drm,
" aperture=%pa, total=%llx\n", "mappable aperture extends past end of GGTT,"
&ggtt->mappable_end, ggtt->vm.total); " aperture=%pa, total=%llx\n",
&ggtt->mappable_end, ggtt->vm.total);
ggtt->mappable_end = ggtt->vm.total; ggtt->mappable_end = ggtt->vm.total;
} }
/* GMADR is the PCI mmio aperture into the global GTT. */ /* GMADR is the PCI mmio aperture into the global GTT. */
DRM_DEBUG_DRIVER("GGTT size = %lluM\n", ggtt->vm.total >> 20); drm_dbg(&i915->drm, "GGTT size = %lluM\n", ggtt->vm.total >> 20);
DRM_DEBUG_DRIVER("GMADR size = %lluM\n", (u64)ggtt->mappable_end >> 20); drm_dbg(&i915->drm, "GMADR size = %lluM\n",
DRM_DEBUG_DRIVER("DSM size = %lluM\n", (u64)ggtt->mappable_end >> 20);
(u64)resource_size(&intel_graphics_stolen_res) >> 20); drm_dbg(&i915->drm, "DSM size = %lluM\n",
(u64)resource_size(&intel_graphics_stolen_res) >> 20);
return 0; return 0;
} }
......
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