[Intel-gfx] [PATCH 1/2] DRM/I915: Add the debug info for i915 connectors/crtc by using DRM_DEBUG_KMS
yakui.zhao at intel.com
yakui.zhao at intel.com
Fri Jul 10 02:57:04 CEST 2009
From: Zhao Yakui <yakui.zhao at intel.com>
Add the debug info for i915 connectors/crtc by using the DRM_DEBUG_KMS instead
of DRM_DEBUG in KMS mode.
Signed-off-by: Zhao Yakui <yakui.zhao at intel.com>
---
drivers/gpu/drm/i915/intel_bios.c | 31 +++++++----
drivers/gpu/drm/i915/intel_crt.c | 6 +-
drivers/gpu/drm/i915/intel_display.c | 91 ++++++++++++++++++++--------------
drivers/gpu/drm/i915/intel_dp.c | 12 ++++-
drivers/gpu/drm/i915/intel_dp_i2c.c | 9 ++--
drivers/gpu/drm/i915/intel_fb.c | 24 +++++----
drivers/gpu/drm/i915/intel_hdmi.c | 22 ++++++--
drivers/gpu/drm/i915/intel_sdvo.c | 25 ++++++---
drivers/gpu/drm/i915/intel_tv.c | 9 ++--
9 files changed, 143 insertions(+), 86 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c
index da22863..a875360 100644
--- a/drivers/gpu/drm/i915/intel_bios.c
+++ b/drivers/gpu/drm/i915/intel_bios.c
@@ -33,6 +33,8 @@
#define SLAVE_ADDR1 0x70
#define SLAVE_ADDR2 0x72
+#define I915_BIOS "i915_bios"
+
static void *
find_section(struct bdb_header *bdb, int section_id)
{
@@ -140,7 +142,7 @@ parse_lfp_panel_data(struct drm_i915_private *dev_priv,
dev_priv->lfp_lvds_vbt_mode = panel_fixed_mode;
- DRM_DEBUG("Found panel mode in BIOS VBT tables:\n");
+ DRM_DEBUG_KMS(I915_BIOS, "Found panel mode in BIOS VBT tables:\n");
drm_mode_debug_printmodeline(panel_fixed_mode);
return;
@@ -217,7 +219,8 @@ parse_sdvo_device_mapping(struct drm_i915_private *dev_priv,
p_defs = find_section(bdb, BDB_GENERAL_DEFINITIONS);
if (!p_defs) {
- DRM_DEBUG("No general definition block is found\n");
+ DRM_DEBUG_KMS(I915_BIOS,
+ "No general definition block is found\n");
return;
}
/* judge whether the size of child device meets the requirements.
@@ -227,7 +230,8 @@ parse_sdvo_device_mapping(struct drm_i915_private *dev_priv,
*/
if (p_defs->child_dev_size != sizeof(*p_child)) {
/* different child dev size . Ignore it */
- DRM_DEBUG("different child size is found. Invalid.\n");
+ DRM_DEBUG_KMS(I915_BIOS, "different child size is found"
+ ". Invalid.\n");
return;
}
/* get the block size of general definitions */
@@ -254,11 +258,12 @@ parse_sdvo_device_mapping(struct drm_i915_private *dev_priv,
if (p_child->dvo_port != DEVICE_PORT_DVOB &&
p_child->dvo_port != DEVICE_PORT_DVOC) {
/* skip the incorrect SDVO port */
- DRM_DEBUG("Incorrect SDVO port. Skip it \n");
+ DRM_DEBUG_KMS(I915_BIOS,
+ "Incorrect SDVO port. Skip it \n");
continue;
}
- DRM_DEBUG("the SDVO device with slave addr %2x is found on "
- "%s port\n",
+ DRM_DEBUG_KMS(I915_BIOS,
+ "the SDVO device with slave addr %2x is found on %s port\n",
p_child->slave_addr,
(p_child->dvo_port == DEVICE_PORT_DVOB) ?
"SDVOB" : "SDVOC");
@@ -269,13 +274,14 @@ parse_sdvo_device_mapping(struct drm_i915_private *dev_priv,
p_mapping->dvo_wiring = p_child->dvo_wiring;
p_mapping->initialized = 1;
} else {
- DRM_DEBUG("Maybe one SDVO port is shared by "
- "two SDVO device.\n");
+ DRM_DEBUG_KMS(I915_BIOS, "Maybe one SDVO port is "
+ "shared by two SDVO device.\n");
}
if (p_child->slave2_addr) {
/* Maybe this is a SDVO device with multiple inputs */
/* And the mapping info is not added */
- DRM_DEBUG("there exists the slave2_addr. Maybe this "
+ DRM_DEBUG_KMS(I915_BIOS,
+ "there exists the slave2_addr. Maybe this "
"is a SDVO device with multiple inputs.\n");
}
count++;
@@ -283,7 +289,8 @@ parse_sdvo_device_mapping(struct drm_i915_private *dev_priv,
if (!count) {
/* No SDVO device info is found */
- DRM_DEBUG("No SDVO device info is found in VBT\n");
+ DRM_DEBUG_KMS(I915_BIOS,
+ "No SDVO device info is found in VBT\n");
}
return;
}
@@ -313,8 +320,10 @@ intel_init_bios(struct drm_device *dev)
int i;
bios = pci_map_rom(pdev, &size);
- if (!bios)
+ if (!bios) {
+ DRM_DEBUG_KMS(I915_BIOS, "Can't map pci rom\n");
return -1;
+ }
/* Scour memory looking for the VBT signature */
for (i = 0; i + 4 < size; i++) {
diff --git a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c
index 954b859..a637ec3 100644
--- a/drivers/gpu/drm/i915/intel_crt.c
+++ b/drivers/gpu/drm/i915/intel_crt.c
@@ -33,6 +33,7 @@
#include "i915_drm.h"
#include "i915_drv.h"
+#define I915_CRT "i915_crt"
static void intel_crt_dpms(struct drm_encoder *encoder, int mode)
{
struct drm_device *dev = encoder->dev;
@@ -166,7 +167,7 @@ static bool intel_igdng_crt_detect_hotplug(struct drm_connector *connector)
ADPA_CRT_HOTPLUG_ENABLE |
ADPA_CRT_HOTPLUG_FORCE_TRIGGER);
- DRM_DEBUG("pch crt adpa 0x%x", adpa);
+ DRM_DEBUG_KMS(I915_CRT, "pch crt adpa 0x%x", adpa);
I915_WRITE(PCH_ADPA, adpa);
/* This might not be needed as not specified in spec...*/
@@ -527,8 +528,7 @@ void intel_crt_init(struct drm_device *dev)
i2c_reg = GPIOA;
intel_output->ddc_bus = intel_i2c_create(dev, i2c_reg, "CRTDDC_A");
if (!intel_output->ddc_bus) {
- dev_printk(KERN_ERR, &dev->pdev->dev, "DDC bus registration "
- "failed.\n");
+ DRM_ERROR("failure in CRTC DDC bus registration \n");
return;
}
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 508838e..25d028c 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -34,6 +34,8 @@
#include "drm_crtc_helper.h"
+#define I915_DIS "i915_mode"
+
bool intel_pipe_has_type (struct drm_crtc *crtc, int type);
static void intel_update_watermarks(struct drm_device *dev);
@@ -865,7 +867,7 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y,
/* no fb bound */
if (!crtc->fb) {
- DRM_DEBUG("No FB bound\n");
+ DRM_DEBUG_KMS(I915_DIS, "No FB bound\n");
return 0;
}
@@ -959,7 +961,8 @@ intel_pipe_set_base(struct drm_crtc *crtc, int x, int y,
Start = obj_priv->gtt_offset;
Offset = y * crtc->fb->pitch + x * (crtc->fb->bits_per_pixel / 8);
- DRM_DEBUG("Writing base %08lX %08lX %d %d\n", Start, Offset, x, y);
+ DRM_DEBUG_KMS(I915_DIS,
+ "Writing base %08lX %08lX %d %d\n", Start, Offset, x, y);
I915_WRITE(dspstride, crtc->fb->pitch);
if (IS_I965G(dev)) {
I915_WRITE(dspbase, Offset);
@@ -1037,7 +1040,7 @@ static void igdng_crtc_dpms(struct drm_crtc *crtc, int mode)
case DRM_MODE_DPMS_ON:
case DRM_MODE_DPMS_STANDBY:
case DRM_MODE_DPMS_SUSPEND:
- DRM_DEBUG("crtc %d dpms on\n", pipe);
+ DRM_DEBUG_KMS(I915_DIS, "crtc %d dpms on\n", pipe);
/* enable PCH DPLL */
temp = I915_READ(pch_dpll_reg);
if ((temp & DPLL_VCO_ENABLE) == 0) {
@@ -1105,12 +1108,13 @@ static void igdng_crtc_dpms(struct drm_crtc *crtc, int mode)
udelay(150);
temp = I915_READ(fdi_rx_iir_reg);
- DRM_DEBUG("FDI_RX_IIR 0x%x\n", temp);
+ DRM_DEBUG_KMS(I915_DIS, "FDI_RX_IIR 0x%x\n", temp);
if ((temp & FDI_RX_BIT_LOCK) == 0) {
for (j = 0; j < tries; j++) {
temp = I915_READ(fdi_rx_iir_reg);
- DRM_DEBUG("FDI_RX_IIR 0x%x\n", temp);
+ DRM_DEBUG_KMS(I915_DIS,
+ "FDI_RX_IIR 0x%x\n", temp);
if (temp & FDI_RX_BIT_LOCK)
break;
udelay(200);
@@ -1119,11 +1123,11 @@ static void igdng_crtc_dpms(struct drm_crtc *crtc, int mode)
I915_WRITE(fdi_rx_iir_reg,
temp | FDI_RX_BIT_LOCK);
else
- DRM_DEBUG("train 1 fail\n");
+ DRM_DEBUG_KMS(I915_DIS, "train 1 fail\n");
} else {
I915_WRITE(fdi_rx_iir_reg,
temp | FDI_RX_BIT_LOCK);
- DRM_DEBUG("train 1 ok 2!\n");
+ DRM_DEBUG_KMS(I915_DIS, "train 1 ok 2!\n");
}
temp = I915_READ(fdi_tx_reg);
temp &= ~FDI_LINK_TRAIN_NONE;
@@ -1138,12 +1142,13 @@ static void igdng_crtc_dpms(struct drm_crtc *crtc, int mode)
udelay(150);
temp = I915_READ(fdi_rx_iir_reg);
- DRM_DEBUG("FDI_RX_IIR 0x%x\n", temp);
+ DRM_DEBUG_KMS(I915_DIS, "FDI_RX_IIR 0x%x\n", temp);
if ((temp & FDI_RX_SYMBOL_LOCK) == 0) {
for (j = 0; j < tries; j++) {
temp = I915_READ(fdi_rx_iir_reg);
- DRM_DEBUG("FDI_RX_IIR 0x%x\n", temp);
+ DRM_DEBUG_KMS(I915_DIS,
+ "FDI_RX_IIR 0x%x\n", temp);
if (temp & FDI_RX_SYMBOL_LOCK)
break;
udelay(200);
@@ -1151,14 +1156,14 @@ static void igdng_crtc_dpms(struct drm_crtc *crtc, int mode)
if (j != tries) {
I915_WRITE(fdi_rx_iir_reg,
temp | FDI_RX_SYMBOL_LOCK);
- DRM_DEBUG("train 2 ok 1!\n");
+ DRM_DEBUG_KMS(I915_DIS, "train 2 ok 1!\n");
} else
- DRM_DEBUG("train 2 fail\n");
+ DRM_DEBUG_KMS(I915_DIS, "train 2 fail\n");
} else {
I915_WRITE(fdi_rx_iir_reg, temp | FDI_RX_SYMBOL_LOCK);
- DRM_DEBUG("train 2 ok 2!\n");
+ DRM_DEBUG_KMS(I915_DIS, "train 2 ok 2!\n");
}
- DRM_DEBUG("train done\n");
+ DRM_DEBUG_KMS(I915_DIS, "train done\n");
/* set transcoder timing */
I915_WRITE(trans_htot_reg, I915_READ(cpu_htot_reg));
@@ -1198,7 +1203,7 @@ static void igdng_crtc_dpms(struct drm_crtc *crtc, int mode)
break;
case DRM_MODE_DPMS_OFF:
- DRM_DEBUG("crtc %d dpms off\n", pipe);
+ DRM_DEBUG_KMS(I915_DIS, "crtc %d dpms off\n", pipe);
/* Disable the VGA plane that we never use */
I915_WRITE(CPU_VGACNTRL, VGA_DISP_DISABLE);
@@ -1221,7 +1226,8 @@ static void igdng_crtc_dpms(struct drm_crtc *crtc, int mode)
while ((I915_READ(pipeconf_reg) & I965_PIPECONF_ACTIVE) != 0)
;
} else
- DRM_DEBUG("crtc %d is disabled\n", pipe);
+ DRM_DEBUG_KMS(I915_DIS,
+ "crtc %d is disabled\n", pipe);
/* IGDNG-A : disable cpu panel fitter ? */
temp = I915_READ(pf_ctl_reg);
@@ -1721,7 +1727,8 @@ static struct cxsr_latency *intel_get_cxsr_latency(int is_desktop, int fsb,
break;
}
if (i >= ARRAY_SIZE(cxsr_latency_table)) {
- DRM_DEBUG("Unknown FSB/MEM found, disable CxSR\n");
+ DRM_DEBUG_KMS(I915_DIS,
+ "Unknown FSB/MEM found, disable CxSR\n");
return NULL;
}
return latency;
@@ -1736,7 +1743,7 @@ static void igd_disable_cxsr(struct drm_device *dev)
reg = I915_READ(DSPFW3);
reg &= ~(IGD_SELF_REFRESH_EN);
I915_WRITE(DSPFW3, reg);
- DRM_INFO("Big FIFO is disabled\n");
+ DRM_DEBUG_KMS(I915_DIS, "Big FIFO is disabled\n");
}
static void igd_enable_cxsr(struct drm_device *dev, unsigned long clock,
@@ -1750,7 +1757,8 @@ static void igd_enable_cxsr(struct drm_device *dev, unsigned long clock,
latency = intel_get_cxsr_latency(IS_IGDG(dev), dev_priv->fsb_freq,
dev_priv->mem_freq);
if (!latency) {
- DRM_DEBUG("Unknown FSB/MEM found, disable CxSR\n");
+ DRM_DEBUG_KMS(I915_DIS,
+ "Unknown FSB/MEM found, disable CxSR\n");
igd_disable_cxsr(dev);
return;
}
@@ -1762,7 +1770,7 @@ static void igd_enable_cxsr(struct drm_device *dev, unsigned long clock,
reg &= 0x7fffff;
reg |= wm << 23;
I915_WRITE(DSPFW1, reg);
- DRM_DEBUG("DSPFW1 register is %x\n", reg);
+ DRM_DEBUG_KMS(I915_DIS, "DSPFW1 register is %x\n", reg);
/* cursor SR */
wm = intel_calculate_wm(clock, &igd_cursor_wm, pixel_size,
@@ -1787,14 +1795,14 @@ static void igd_enable_cxsr(struct drm_device *dev, unsigned long clock,
reg &= ~(0x3f << 16);
reg |= (wm & 0x3f) << 16;
I915_WRITE(DSPFW3, reg);
- DRM_DEBUG("DSPFW3 register is %x\n", reg);
+ DRM_DEBUG_KMS(I915_DIS, "DSPFW3 register is %x\n", reg);
/* activate cxsr */
reg = I915_READ(DSPFW3);
reg |= IGD_SELF_REFRESH_EN;
I915_WRITE(DSPFW3, reg);
- DRM_INFO("Big FIFO is enabled\n");
+ DRM_DEBUG_KMS(I915_DIS, "Big FIFO is enabled\n");
return;
}
@@ -1806,7 +1814,8 @@ static void i965_update_wm(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
- DRM_DEBUG("Setting FIFO watermarks - A: 8, B: 8, C: 8, SR 8\n");
+ DRM_DEBUG_KMS(I915_DIS,
+ "Setting FIFO watermarks - A: 8, B: 8, C: 8, SR 8\n");
/* 965 has limitations... */
I915_WRITE(DSPFW1, (8 << 16) | (8 << 8) | (8 << 0));
@@ -1838,8 +1847,8 @@ static void i9xx_update_wm(struct drm_device *dev, int planea_clock,
planeb_entries = intel_calculate_wm(planeb_clock, wm_params,
pixel_size, latency_ns);
- DRM_DEBUG("FIFO entries - A: %d, B: %d\n", planea_entries,
- planeb_entries);
+ DRM_DEBUG_KMS(I915_DIS, "FIFO entries - A: %d, B: %d\n",
+ planea_entries, planeb_entries);
if (IS_I9XX(dev)) {
asize = dsparb & 0x7f;
@@ -1848,7 +1857,7 @@ static void i9xx_update_wm(struct drm_device *dev, int planea_clock,
asize = dsparb & 0x1ff;
bsize = (dsparb >> DSPARB_BEND_SHIFT) & 0x1ff;
}
- DRM_DEBUG("FIFO size - A: %d, B: %d\n", asize, bsize);
+ DRM_DEBUG_KMS(I915_DIS, "FIFO size - A: %d, B: %d\n", asize, bsize);
/* Two extra entries for padding */
awm = asize - (planea_entries + 2);
@@ -1858,12 +1867,14 @@ static void i9xx_update_wm(struct drm_device *dev, int planea_clock,
if (awm <= 0) {
/* pipe is on but has too few FIFO entries */
if (planea_entries != 0)
- DRM_DEBUG("plane A needs more FIFO entries\n");
+ DRM_DEBUG_KMS(I915_DIS,
+ "plane A needs more FIFO entries\n");
awm = 1;
}
if (bwm <= 0) {
if (planeb_entries != 0)
- DRM_DEBUG("plane B needs more FIFO entries\n");
+ DRM_DEBUG_KMS(I915_DIS,
+ "plane B needs more FIFO entries\n");
bwm = 1;
}
@@ -1883,8 +1894,9 @@ static void i9xx_update_wm(struct drm_device *dev, int planea_clock,
srwm = wm_params->fifo_size - sr_entries;
}
- DRM_DEBUG("Setting FIFO watermarks - A: %d, B: %d, C: %d, SR %d\n",
- awm, bwm, cwm, srwm);
+ DRM_DEBUG_KMS(I915_DIS, "Setting FIFO watermarks - "
+ "A: %d, B: %d, C: %d, SR %d\n",
+ awm, bwm, cwm, srwm);
fwater_lo = fwater_lo | ((bwm & 0x3f) << 16) | (awm & 0x3f);
fwater_hi = fwater_hi | (cwm & 0x1f);
@@ -1964,11 +1976,13 @@ static void intel_update_watermarks(struct drm_device *dev)
if (crtc->enabled) {
enabled++;
if (intel_crtc->plane == 0) {
- DRM_DEBUG("plane A (pipe %d) clock: %d\n",
+ DRM_DEBUG_KMS(I915_DIS,
+ "plane A (pipe %d) clock: %d\n",
intel_crtc->pipe, crtc->mode.clock);
planea_clock = crtc->mode.clock;
} else {
- DRM_DEBUG("plane B (pipe %d) clock: %d\n",
+ DRM_DEBUG_KMS(I915_DIS,
+ "plane B (pipe %d) clock: %d\n",
intel_crtc->pipe, crtc->mode.clock);
planeb_clock = crtc->mode.clock;
}
@@ -2081,7 +2095,8 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc,
if (is_lvds && dev_priv->lvds_use_ssc && num_outputs < 2) {
refclk = dev_priv->lvds_ssc_freq * 1000;
- DRM_DEBUG("using SSC reference clock of %d MHz\n", refclk / 1000);
+ DRM_DEBUG_KMS(I915_DIS,
+ "using SSC reference clock of %d MHz\n", refclk / 1000);
} else if (IS_I9XX(dev)) {
refclk = 96000;
if (IS_IGDNG(dev))
@@ -2241,7 +2256,8 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc,
if (!IS_IGDNG(dev) && intel_panel_fitter_pipe(dev) == pipe)
I915_WRITE(PFIT_CONTROL, 0);
- DRM_DEBUG("Mode for pipe %c:\n", pipe == 0 ? 'A' : 'B');
+ DRM_DEBUG_KMS(I915_DIS, "Mode for pipe %c:\n",
+ pipe == 0 ? 'A' : 'B');
drm_mode_debug_printmodeline(mode);
/* assign to IGDNG registers */
@@ -2416,11 +2432,11 @@ static int intel_crtc_cursor_set(struct drm_crtc *crtc,
size_t addr;
int ret;
- DRM_DEBUG("\n");
+ DRM_DEBUG_KMS(I915_DIS, "\n");
/* if we want to turn off the cursor ignore width and height */
if (!handle) {
- DRM_DEBUG("cursor off\n");
+ DRM_DEBUG_KMS(I915_DIS, "cursor off\n");
if (IS_MOBILE(dev) || IS_I9XX(dev)) {
temp &= ~(CURSOR_MODE | MCURSOR_GAMMA_ENABLE);
temp |= CURSOR_MODE_DISABLE;
@@ -2737,7 +2753,8 @@ static int intel_crtc_clock_get(struct drm_device *dev, struct drm_crtc *crtc)
7 : 14;
break;
default:
- DRM_DEBUG("Unknown DPLL mode %08x in programmed "
+ DRM_DEBUG_KMS(I915_DIS,
+ "Unknown DPLL mode %08x in programmed "
"mode\n", (int)(dpll & DPLL_MODE_MASK));
return 0;
}
@@ -3163,7 +3180,7 @@ void intel_modeset_init(struct drm_device *dev)
num_pipe = 2;
else
num_pipe = 1;
- DRM_DEBUG("%d display pipe%s available.\n",
+ DRM_DEBUG_KMS(I915_DIS, "%d display pipe%s available.\n",
num_pipe, num_pipe > 1 ? "s" : "");
for (i = 0; i < num_pipe; i++) {
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 6770ae8..8bdd350 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -40,6 +40,8 @@
#define DP_LINK_CONFIGURATION_SIZE 9
+#define I915_DP "i915_dp"
+
struct intel_dp_priv {
uint32_t output_reg;
uint32_t DP;
@@ -261,7 +263,8 @@ intel_dp_aux_ch(struct intel_output *intel_output,
/* Timeouts occur when the device isn't connected, so they're
* "normal" -- don't fill the kernel log with these */
if (status & DP_AUX_CH_CTL_TIME_OUT_ERROR) {
- DRM_DEBUG("dp_aux_ch timeout status 0x%08x\n", status);
+ DRM_DEBUG_KMS(I915_DP, "dp_aux_ch timeout status 0x%08x\n",
+ status);
return -ETIMEDOUT;
}
@@ -414,7 +417,9 @@ intel_dp_mode_fixup(struct drm_encoder *encoder, struct drm_display_mode *mode,
dp_priv->link_bw = bws[clock];
dp_priv->lane_count = lane_count;
adjusted_mode->clock = intel_dp_link_clock(dp_priv->link_bw);
- DRM_DEBUG("Display port link bw %02x lane count %d clock %d\n",
+ DRM_DEBUG_KMS(I915_DP,
+ "Display port link bw %02x "
+ "lane count %d clock %d\n",
dp_priv->link_bw, dp_priv->lane_count,
adjusted_mode->clock);
return true;
@@ -1153,4 +1158,7 @@ intel_dp_init(struct drm_device *dev, int output_reg)
u32 temp = I915_READ(PEG_BAND_GAP_DATA);
I915_WRITE(PEG_BAND_GAP_DATA, (temp & ~0xf) | 0xd);
}
+ DRM_DEBUG_KMS(I915_DP, "%s is detected\n",
+ (output_reg == DP_B) ? "DPDDC-B" :
+ (output_reg == DP_C) ? "DPDDC-C" : "DPDDC-D");
}
diff --git a/drivers/gpu/drm/i915/intel_dp_i2c.c b/drivers/gpu/drm/i915/intel_dp_i2c.c
index a63b6f5..b90ee8f 100644
--- a/drivers/gpu/drm/i915/intel_dp_i2c.c
+++ b/drivers/gpu/drm/i915/intel_dp_i2c.c
@@ -38,6 +38,7 @@
#define MODE_I2C_READ 4
#define MODE_I2C_STOP 8
+#define I915_DPAUX "i915_dpi2c"
static int
i2c_algo_dp_aux_transaction(struct i2c_adapter *adapter, int mode,
uint8_t write_byte, uint8_t *read_byte)
@@ -85,7 +86,7 @@ i2c_algo_dp_aux_transaction(struct i2c_adapter *adapter, int mode,
msg, msg_bytes,
reply, reply_bytes);
if (ret < 0) {
- DRM_DEBUG("aux_ch failed %d\n", ret);
+ DRM_DEBUG_KMS(I915_DPAUX, "aux_ch failed %d\n", ret);
return ret;
}
switch (reply[0] & AUX_I2C_REPLY_MASK) {
@@ -95,10 +96,10 @@ i2c_algo_dp_aux_transaction(struct i2c_adapter *adapter, int mode,
}
return reply_bytes - 1;
case AUX_I2C_REPLY_NACK:
- DRM_DEBUG("aux_ch nack\n");
+ DRM_DEBUG_KMS(I915_DPAUX, "aux_ch nack\n");
return -EREMOTEIO;
case AUX_I2C_REPLY_DEFER:
- DRM_DEBUG("aux_ch defer\n");
+ DRM_DEBUG_KMS(I915_DPAUX, "aux_ch defer\n");
udelay(100);
break;
default:
@@ -224,7 +225,7 @@ i2c_algo_dp_aux_xfer(struct i2c_adapter *adapter,
if (ret >= 0)
ret = num;
i2c_algo_dp_aux_stop(adapter, reading);
- DRM_DEBUG("dp_aux_xfer return %d\n", ret);
+ DRM_DEBUG_KMS(I915_DPAUX, "dp_aux_xfer return %d\n", ret);
return ret;
}
diff --git a/drivers/gpu/drm/i915/intel_fb.c b/drivers/gpu/drm/i915/intel_fb.c
index 1d30802..a9ad4a8 100644
--- a/drivers/gpu/drm/i915/intel_fb.c
+++ b/drivers/gpu/drm/i915/intel_fb.c
@@ -43,6 +43,8 @@
#include "i915_drm.h"
#include "i915_drv.h"
+#define I915_FB "i915_fb"
+
struct intelfb_par {
struct drm_device *dev;
struct drm_display_mode *our_mode;
@@ -203,7 +205,7 @@ static int intelfb_set_par(struct fb_info *info)
struct fb_var_screeninfo *var = &info->var;
int i;
- DRM_DEBUG("%d %d\n", var->xres, var->pixclock);
+ DRM_DEBUG_KMS(I915_FB, "%d %d\n", var->xres, var->pixclock);
if (var->pixclock != -1) {
@@ -610,7 +612,8 @@ static int intelfb_create(struct drm_device *dev, uint32_t fb_width,
par->dev = dev;
/* To allow resizeing without swapping buffers */
- DRM_DEBUG("allocated %dx%d fb: 0x%08x, bo %p\n", intel_fb->base.width,
+ DRM_DEBUG_KMS(I915_FB,
+ "allocated %dx%d fb: 0x%08x, bo %p\n", intel_fb->base.width,
intel_fb->base.height, obj_priv->gtt_offset, fbo);
mutex_unlock(&dev->struct_mutex);
@@ -698,13 +701,13 @@ static int intelfb_multi_fb_probe_crtc(struct drm_device *dev, struct drm_crtc *
} else
intelfb_set_par(info);
- DRM_INFO("fb%d: %s frame buffer device\n", info->node,
+ DRM_DEBUG_KMS(I915_FB, "fb%d: %s frame buffer device\n", info->node,
info->fix.id);
/* Switch back to kernel console on panic */
kernelfb_mode = *modeset;
atomic_notifier_chain_register(&panic_notifier_list, &paniced);
- DRM_DEBUG("registered panic notifier\n");
+ DRM_DEBUG_KMS(I915_FB, "registered panic notifier\n");
return 0;
}
@@ -737,7 +740,7 @@ static int intelfb_single_fb_probe(struct drm_device *dev)
struct intelfb_par *par;
struct drm_mode_set *modeset = NULL;
- DRM_DEBUG("\n");
+ DRM_DEBUG_KMS(I915_FB, "\n");
/* Get a count of crtcs now in use and new min/maxes width/heights */
list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
@@ -766,14 +769,15 @@ static int intelfb_single_fb_probe(struct drm_device *dev)
if (crtc_count == 0 || fb_width == -1 || fb_height == -1) {
/* hmm everyone went away - assume VGA cable just fell out
and will come back later. */
- DRM_DEBUG("no CRTCs available?\n");
+ DRM_DEBUG_KMS(I915_FB, "no CRTCs available?\n");
return 0;
}
//fail
/* Find the fb for our new config */
if (list_empty(&dev->mode_config.fb_kernel_list)) {
- DRM_DEBUG("creating new fb (console size %dx%d, "
+ DRM_DEBUG_KMS(I915_FB,
+ "creating new fb (console size %dx%d, "
"buffer size %dx%d)\n", fb_width, fb_height,
surface_width, surface_height);
ret = intelfb_create(dev, fb_width, fb_height, surface_width,
@@ -852,13 +856,13 @@ static int intelfb_single_fb_probe(struct drm_device *dev)
} else
intelfb_set_par(info);
- DRM_INFO("fb%d: %s frame buffer device\n", info->node,
+ DRM_DEBUG_KMS(I915_FB, "fb%d: %s frame buffer device\n", info->node,
info->fix.id);
/* Switch back to kernel console on panic */
kernelfb_mode = *modeset;
atomic_notifier_chain_register(&panic_notifier_list, &paniced);
- DRM_DEBUG("registered panic notifier\n");
+ DRM_DEBUG_KMS(I915_FB, "registered panic notifier\n");
return 0;
}
@@ -898,7 +902,7 @@ int intelfb_probe(struct drm_device *dev)
{
int ret;
- DRM_DEBUG("\n");
+ DRM_DEBUG_KMS(I915_FB, "\n");
/* something has changed in the lower levels of hell - deal with it
here */
diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
index 9e30daa..56e8e31 100644
--- a/drivers/gpu/drm/i915/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/intel_hdmi.c
@@ -36,6 +36,8 @@
#include "i915_drm.h"
#include "i915_drv.h"
+#define I915_HDMI "i915_hdmi"
+
struct intel_hdmi_priv {
u32 sdvox_reg;
u32 save_SDVOX;
@@ -270,6 +272,7 @@ void intel_hdmi_init(struct drm_device *dev, int sdvox_reg)
struct drm_connector *connector;
struct intel_output *intel_output;
struct intel_hdmi_priv *hdmi_priv;
+ char hdmi_buf[10];
intel_output = kcalloc(sizeof(struct intel_output) +
sizeof(struct intel_hdmi_priv), 1, GFP_KERNEL);
@@ -287,20 +290,27 @@ void intel_hdmi_init(struct drm_device *dev, int sdvox_reg)
connector->interlace_allowed = 0;
connector->doublescan_allowed = 0;
+ memset(hdmi_buf, 0, sizeof(hdmi_buf));
/* Set up the DDC bus. */
- if (sdvox_reg == SDVOB)
+ if (sdvox_reg == SDVOB) {
intel_output->ddc_bus = intel_i2c_create(dev, GPIOE, "HDMIB");
- else if (sdvox_reg == SDVOC)
+ memcpy(&hdmi_buf, "HDMIB", 5);
+ } else if (sdvox_reg == SDVOC) {
intel_output->ddc_bus = intel_i2c_create(dev, GPIOD, "HDMIC");
- else if (sdvox_reg == HDMIB)
+ memcpy(hdmi_buf, "HDMIC", 5);
+ } else if (sdvox_reg == HDMIB) {
intel_output->ddc_bus = intel_i2c_create(dev, PCH_GPIOE,
"HDMIB");
- else if (sdvox_reg == HDMIC)
+ memcpy(hdmi_buf, "HDMIB", 5);
+ } else if (sdvox_reg == HDMIC) {
intel_output->ddc_bus = intel_i2c_create(dev, PCH_GPIOD,
"HDMIC");
- else if (sdvox_reg == HDMID)
+ memcpy(hdmi_buf, "HDMIC", 5);
+ } else if (sdvox_reg == HDMID) {
intel_output->ddc_bus = intel_i2c_create(dev, PCH_GPIOF,
"HDMID");
+ memcpy(hdmi_buf, "HDMID", 5);
+ }
if (!intel_output->ddc_bus)
goto err_connector;
@@ -324,7 +334,7 @@ void intel_hdmi_init(struct drm_device *dev, int sdvox_reg)
u32 temp = I915_READ(PEG_BAND_GAP_DATA);
I915_WRITE(PEG_BAND_GAP_DATA, (temp & ~0xf) | 0xd);
}
-
+ DRM_DEBUG_KMS(I915_HDMI, "%s is detected\n", hdmi_buf);
return;
err_connector:
diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c
index 4f0c309..dbedd05 100644
--- a/drivers/gpu/drm/i915/intel_sdvo.c
+++ b/drivers/gpu/drm/i915/intel_sdvo.c
@@ -178,7 +178,7 @@ static bool intel_sdvo_read_byte(struct intel_output *intel_output, u8 addr,
return true;
}
- DRM_DEBUG("i2c transfer returned %d\n", ret);
+ DRM_DEBUG_KMS(I915_SDVO, "i2c transfer returned %d\n", ret);
return false;
}
@@ -658,10 +658,12 @@ static int intel_sdvo_get_clock_rate_mult(struct intel_output *intel_output)
status = intel_sdvo_read_response(intel_output, &response, 1);
if (status != SDVO_CMD_STATUS_SUCCESS) {
- DRM_DEBUG("Couldn't get SDVO clock rate multiplier\n");
+ DRM_DEBUG_KMS(I915_SDVO,
+ "Couldn't get SDVO clock rate multiplier\n");
return SDVO_CLOCK_RATE_MULT_1X;
} else {
- DRM_DEBUG("Current clock rate multiplier: %d\n", response);
+ DRM_DEBUG_KMS(I915_SDVO,
+ "Current clock rate multiplier: %d\n", response);
}
return response;
@@ -942,14 +944,16 @@ static void intel_sdvo_set_tv_format(struct intel_output *output)
format = &sdvo_priv->tv_format;
memset(&unset, 0, sizeof(unset));
if (memcmp(format, &unset, sizeof(*format))) {
- DRM_DEBUG("%s: Choosing default TV format of NTSC-M\n",
+ DRM_DEBUG_KMS(I915_SDVO,
+ "%s: Choosing default TV format of NTSC-M\n",
SDVO_NAME(sdvo_priv));
format->ntsc_m = 1;
intel_sdvo_write_cmd(output, SDVO_CMD_SET_TV_FORMAT, format,
sizeof(*format));
status = intel_sdvo_read_response(output, NULL, 0);
if (status != SDVO_CMD_STATUS_SUCCESS)
- DRM_DEBUG("%s: Failed to set TV format\n",
+ DRM_DEBUG_KMS(I915_SDVO,
+ "%s: Failed to set TV format\n",
SDVO_NAME(sdvo_priv));
}
}
@@ -1220,7 +1224,8 @@ static void intel_sdvo_dpms(struct drm_encoder *encoder, int mode)
* a given it the status is a success, we succeeded.
*/
if (status == SDVO_CMD_STATUS_SUCCESS && !input1) {
- DRM_DEBUG("First %s output reported failure to sync\n",
+ DRM_DEBUG_KMS(I915_SDVO,
+ "First %s output reported failure to sync\n",
SDVO_NAME(sdvo_priv));
}
@@ -1316,7 +1321,8 @@ static void intel_sdvo_restore(struct drm_connector *connector)
intel_wait_for_vblank(dev);
status = intel_sdvo_get_trained_inputs(intel_output, &input1, &input2);
if (status == SDVO_CMD_STATUS_SUCCESS && !input1)
- DRM_DEBUG("First %s output reported failure to sync\n",
+ DRM_DEBUG_KMS(I915_SDVO,
+ "First %s output reported failure to sync\n",
SDVO_NAME(sdvo_priv));
}
@@ -1395,7 +1401,7 @@ int intel_sdvo_supports_hotplug(struct drm_connector *connector)
u8 response[2];
u8 status;
struct intel_output *intel_output;
- DRM_DEBUG("\n");
+ DRM_DEBUG_KMS(I915_SDVO, "\n");
if (!connector)
return 0;
@@ -1460,7 +1466,8 @@ static enum drm_connector_status intel_sdvo_detect(struct drm_connector *connect
intel_sdvo_write_cmd(intel_output, SDVO_CMD_GET_ATTACHED_DISPLAYS, NULL, 0);
status = intel_sdvo_read_response(intel_output, &response, 2);
- DRM_DEBUG("SDVO response %d %d\n", response[0], response[1]);
+ DRM_DEBUG_KMS(I915_SDVO, "SDVO response %d %d\n",
+ response[0], response[1]);
if (status != SDVO_CMD_STATUS_SUCCESS)
return connector_status_unknown;
diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c
index a43c98e..25f5a8c 100644
--- a/drivers/gpu/drm/i915/intel_tv.c
+++ b/drivers/gpu/drm/i915/intel_tv.c
@@ -43,6 +43,7 @@ enum tv_margin {
TV_MARGIN_RIGHT, TV_MARGIN_BOTTOM
};
+#define I915_TV "i915_tv"
/** Private structure for the integrated TV support */
struct intel_tv_priv {
int type;
@@ -1415,16 +1416,16 @@ intel_tv_detect_type (struct drm_crtc *crtc, struct intel_output *intel_output)
* 0 0 0 Component
*/
if ((tv_dac & TVDAC_SENSE_MASK) == (TVDAC_B_SENSE | TVDAC_C_SENSE)) {
- DRM_DEBUG("Detected Composite TV connection\n");
+ DRM_DEBUG_KMS(I915_TV, "Detected Composite TV connection\n");
type = DRM_MODE_CONNECTOR_Composite;
} else if ((tv_dac & (TVDAC_A_SENSE|TVDAC_B_SENSE)) == TVDAC_A_SENSE) {
- DRM_DEBUG("Detected S-Video TV connection\n");
+ DRM_DEBUG_KMS(I915_TV, "Detected S-Video TV connection\n");
type = DRM_MODE_CONNECTOR_SVIDEO;
} else if ((tv_dac & TVDAC_SENSE_MASK) == 0) {
- DRM_DEBUG("Detected Component TV connection\n");
+ DRM_DEBUG_KMS(I915_TV, "Detected Component TV connection\n");
type = DRM_MODE_CONNECTOR_Component;
} else {
- DRM_DEBUG("No TV connection detected\n");
+ DRM_DEBUG_KMS(I915_TV, "No TV connection detected\n");
type = -1;
}
--
1.5.4.5
More information about the Intel-gfx
mailing list