Commit a70491cc authored by Joe Perches's avatar Joe Perches Committed by Daniel Vetter

i915: Add and use pr_fmt and pr_<level>

Use a more current logging style.  Ensure that appropriate
logging messages are prefixed with "i915: ".

Convert printks to pr_<level>.  Align arguments.
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 5a15ab5b
...@@ -26,6 +26,8 @@ ...@@ -26,6 +26,8 @@
* *
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include "drmP.h" #include "drmP.h"
#include "drm.h" #include "drm.h"
#include "drm_crtc_helper.h" #include "drm_crtc_helper.h"
...@@ -1159,14 +1161,14 @@ static void i915_switcheroo_set_state(struct pci_dev *pdev, enum vga_switcheroo_ ...@@ -1159,14 +1161,14 @@ static void i915_switcheroo_set_state(struct pci_dev *pdev, enum vga_switcheroo_
struct drm_device *dev = pci_get_drvdata(pdev); struct drm_device *dev = pci_get_drvdata(pdev);
pm_message_t pmm = { .event = PM_EVENT_SUSPEND }; pm_message_t pmm = { .event = PM_EVENT_SUSPEND };
if (state == VGA_SWITCHEROO_ON) { if (state == VGA_SWITCHEROO_ON) {
printk(KERN_INFO "i915: switched on\n"); pr_info("switched on\n");
dev->switch_power_state = DRM_SWITCH_POWER_CHANGING; dev->switch_power_state = DRM_SWITCH_POWER_CHANGING;
/* i915 resume handler doesn't set to D0 */ /* i915 resume handler doesn't set to D0 */
pci_set_power_state(dev->pdev, PCI_D0); pci_set_power_state(dev->pdev, PCI_D0);
i915_resume(dev); i915_resume(dev);
dev->switch_power_state = DRM_SWITCH_POWER_ON; dev->switch_power_state = DRM_SWITCH_POWER_ON;
} else { } else {
printk(KERN_ERR "i915: switched off\n"); pr_err("switched off\n");
dev->switch_power_state = DRM_SWITCH_POWER_CHANGING; dev->switch_power_state = DRM_SWITCH_POWER_CHANGING;
i915_suspend(dev, pmm); i915_suspend(dev, pmm);
dev->switch_power_state = DRM_SWITCH_POWER_OFF; dev->switch_power_state = DRM_SWITCH_POWER_OFF;
......
...@@ -26,6 +26,8 @@ ...@@ -26,6 +26,8 @@
* *
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/sysrq.h> #include <linux/sysrq.h>
#include <linux/slab.h> #include <linux/slab.h>
#include "drmP.h" #include "drmP.h"
...@@ -1103,33 +1105,26 @@ static void i915_report_and_clear_eir(struct drm_device *dev) ...@@ -1103,33 +1105,26 @@ static void i915_report_and_clear_eir(struct drm_device *dev)
if (!eir) if (!eir)
return; return;
printk(KERN_ERR "render error detected, EIR: 0x%08x\n", pr_err("render error detected, EIR: 0x%08x\n", eir);
eir);
if (IS_G4X(dev)) { if (IS_G4X(dev)) {
if (eir & (GM45_ERROR_MEM_PRIV | GM45_ERROR_CP_PRIV)) { if (eir & (GM45_ERROR_MEM_PRIV | GM45_ERROR_CP_PRIV)) {
u32 ipeir = I915_READ(IPEIR_I965); u32 ipeir = I915_READ(IPEIR_I965);
printk(KERN_ERR " IPEIR: 0x%08x\n", pr_err(" IPEIR: 0x%08x\n", I915_READ(IPEIR_I965));
I915_READ(IPEIR_I965)); pr_err(" IPEHR: 0x%08x\n", I915_READ(IPEHR_I965));
printk(KERN_ERR " IPEHR: 0x%08x\n", pr_err(" INSTDONE: 0x%08x\n",
I915_READ(IPEHR_I965));
printk(KERN_ERR " INSTDONE: 0x%08x\n",
I915_READ(INSTDONE_I965)); I915_READ(INSTDONE_I965));
printk(KERN_ERR " INSTPS: 0x%08x\n", pr_err(" INSTPS: 0x%08x\n", I915_READ(INSTPS));
I915_READ(INSTPS)); pr_err(" INSTDONE1: 0x%08x\n", I915_READ(INSTDONE1));
printk(KERN_ERR " INSTDONE1: 0x%08x\n", pr_err(" ACTHD: 0x%08x\n", I915_READ(ACTHD_I965));
I915_READ(INSTDONE1));
printk(KERN_ERR " ACTHD: 0x%08x\n",
I915_READ(ACTHD_I965));
I915_WRITE(IPEIR_I965, ipeir); I915_WRITE(IPEIR_I965, ipeir);
POSTING_READ(IPEIR_I965); POSTING_READ(IPEIR_I965);
} }
if (eir & GM45_ERROR_PAGE_TABLE) { if (eir & GM45_ERROR_PAGE_TABLE) {
u32 pgtbl_err = I915_READ(PGTBL_ER); u32 pgtbl_err = I915_READ(PGTBL_ER);
printk(KERN_ERR "page table error\n"); pr_err("page table error\n");
printk(KERN_ERR " PGTBL_ER: 0x%08x\n", pr_err(" PGTBL_ER: 0x%08x\n", pgtbl_err);
pgtbl_err);
I915_WRITE(PGTBL_ER, pgtbl_err); I915_WRITE(PGTBL_ER, pgtbl_err);
POSTING_READ(PGTBL_ER); POSTING_READ(PGTBL_ER);
} }
...@@ -1138,53 +1133,42 @@ static void i915_report_and_clear_eir(struct drm_device *dev) ...@@ -1138,53 +1133,42 @@ static void i915_report_and_clear_eir(struct drm_device *dev)
if (!IS_GEN2(dev)) { if (!IS_GEN2(dev)) {
if (eir & I915_ERROR_PAGE_TABLE) { if (eir & I915_ERROR_PAGE_TABLE) {
u32 pgtbl_err = I915_READ(PGTBL_ER); u32 pgtbl_err = I915_READ(PGTBL_ER);
printk(KERN_ERR "page table error\n"); pr_err("page table error\n");
printk(KERN_ERR " PGTBL_ER: 0x%08x\n", pr_err(" PGTBL_ER: 0x%08x\n", pgtbl_err);
pgtbl_err);
I915_WRITE(PGTBL_ER, pgtbl_err); I915_WRITE(PGTBL_ER, pgtbl_err);
POSTING_READ(PGTBL_ER); POSTING_READ(PGTBL_ER);
} }
} }
if (eir & I915_ERROR_MEMORY_REFRESH) { if (eir & I915_ERROR_MEMORY_REFRESH) {
printk(KERN_ERR "memory refresh error:\n"); pr_err("memory refresh error:\n");
for_each_pipe(pipe) for_each_pipe(pipe)
printk(KERN_ERR "pipe %c stat: 0x%08x\n", pr_err("pipe %c stat: 0x%08x\n",
pipe_name(pipe), I915_READ(PIPESTAT(pipe))); pipe_name(pipe), I915_READ(PIPESTAT(pipe)));
/* pipestat has already been acked */ /* pipestat has already been acked */
} }
if (eir & I915_ERROR_INSTRUCTION) { if (eir & I915_ERROR_INSTRUCTION) {
printk(KERN_ERR "instruction error\n"); pr_err("instruction error\n");
printk(KERN_ERR " INSTPM: 0x%08x\n", pr_err(" INSTPM: 0x%08x\n", I915_READ(INSTPM));
I915_READ(INSTPM));
if (INTEL_INFO(dev)->gen < 4) { if (INTEL_INFO(dev)->gen < 4) {
u32 ipeir = I915_READ(IPEIR); u32 ipeir = I915_READ(IPEIR);
printk(KERN_ERR " IPEIR: 0x%08x\n", pr_err(" IPEIR: 0x%08x\n", I915_READ(IPEIR));
I915_READ(IPEIR)); pr_err(" IPEHR: 0x%08x\n", I915_READ(IPEHR));
printk(KERN_ERR " IPEHR: 0x%08x\n", pr_err(" INSTDONE: 0x%08x\n", I915_READ(INSTDONE));
I915_READ(IPEHR)); pr_err(" ACTHD: 0x%08x\n", I915_READ(ACTHD));
printk(KERN_ERR " INSTDONE: 0x%08x\n",
I915_READ(INSTDONE));
printk(KERN_ERR " ACTHD: 0x%08x\n",
I915_READ(ACTHD));
I915_WRITE(IPEIR, ipeir); I915_WRITE(IPEIR, ipeir);
POSTING_READ(IPEIR); POSTING_READ(IPEIR);
} else { } else {
u32 ipeir = I915_READ(IPEIR_I965); u32 ipeir = I915_READ(IPEIR_I965);
printk(KERN_ERR " IPEIR: 0x%08x\n", pr_err(" IPEIR: 0x%08x\n", I915_READ(IPEIR_I965));
I915_READ(IPEIR_I965)); pr_err(" IPEHR: 0x%08x\n", I915_READ(IPEHR_I965));
printk(KERN_ERR " IPEHR: 0x%08x\n", pr_err(" INSTDONE: 0x%08x\n",
I915_READ(IPEHR_I965));
printk(KERN_ERR " INSTDONE: 0x%08x\n",
I915_READ(INSTDONE_I965)); I915_READ(INSTDONE_I965));
printk(KERN_ERR " INSTPS: 0x%08x\n", pr_err(" INSTPS: 0x%08x\n", I915_READ(INSTPS));
I915_READ(INSTPS)); pr_err(" INSTDONE1: 0x%08x\n", I915_READ(INSTDONE1));
printk(KERN_ERR " INSTDONE1: 0x%08x\n", pr_err(" ACTHD: 0x%08x\n", I915_READ(ACTHD_I965));
I915_READ(INSTDONE1));
printk(KERN_ERR " ACTHD: 0x%08x\n",
I915_READ(ACTHD_I965));
I915_WRITE(IPEIR_I965, ipeir); I915_WRITE(IPEIR_I965, ipeir);
POSTING_READ(IPEIR_I965); POSTING_READ(IPEIR_I965);
} }
......
...@@ -25,6 +25,8 @@ ...@@ -25,6 +25,8 @@
* *
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/acpi.h> #include <linux/acpi.h>
#include <linux/acpi_io.h> #include <linux/acpi_io.h>
#include <acpi/video.h> #include <acpi/video.h>
...@@ -355,7 +357,7 @@ static void intel_didl_outputs(struct drm_device *dev) ...@@ -355,7 +357,7 @@ static void intel_didl_outputs(struct drm_device *dev)
} }
if (!acpi_video_bus) { if (!acpi_video_bus) {
printk(KERN_WARNING "No ACPI video bus found\n"); pr_warn("No ACPI video bus found\n");
return; return;
} }
......
...@@ -28,6 +28,8 @@ ...@@ -28,6 +28,8 @@
* Chris Wilson <chris@chris-wilson.co.uk> * Chris Wilson <chris@chris-wilson.co.uk>
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/moduleparam.h> #include <linux/moduleparam.h>
#include "intel_drv.h" #include "intel_drv.h"
...@@ -172,7 +174,7 @@ u32 intel_panel_get_max_backlight(struct drm_device *dev) ...@@ -172,7 +174,7 @@ u32 intel_panel_get_max_backlight(struct drm_device *dev)
/* XXX add code here to query mode clock or hardware clock /* XXX add code here to query mode clock or hardware clock
* and program max PWM appropriately. * and program max PWM appropriately.
*/ */
printk_once(KERN_WARNING "fixme: max PWM is zero.\n"); pr_warn_once("fixme: max PWM is zero\n");
return 1; return 1;
} }
......
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