diff --git a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c index d6a1a6e..57f042a 100644 --- a/drivers/gpu/drm/i915/intel_crt.c +++ b/drivers/gpu/drm/i915/intel_crt.c @@ -32,6 +32,15 @@ #include "intel_drv.h" #include "i915_drm.h" #include "i915_drv.h" +static void printmodeline(struct drm_display_mode *mode) +{ + printk("Modeline %d:\"%s\" %d %d %d %d %d %d %d %d %d %d 0x%x 0x%x\n", + mode->base.id, mode->name, mode->vrefresh, mode->clock, + mode->hdisplay, mode->hsync_start, + mode->hsync_end, mode->htotal, + mode->vdisplay, mode->vsync_start, + mode->vsync_end, mode->vtotal, mode->type, mode->flags); +} static void intel_crt_dpms(struct drm_encoder *encoder, int mode) { @@ -72,19 +81,33 @@ static int intel_crt_mode_valid(struct drm_connector *connector, struct drm_device *dev = connector->dev; int max_clock = 0; - if (mode->flags & DRM_MODE_FLAG_DBLSCAN) + if (mode->flags & DRM_MODE_FLAG_DBLSCAN) { + printk("\n DEBUG:the mode line is DBLSCAN flags is %x\n", + mode->flags); + printmodeline(mode); return MODE_NO_DBLESCAN; + } - if (mode->clock < 25000) + if (mode->clock < 25000) { + printk("\n DEBUG:the mode line clock is less 25000," + "clock is %d\n", mode->clock); + printmodeline(mode); return MODE_CLOCK_LOW; + } if (!IS_I9XX(dev)) max_clock = 350000; else max_clock = 400000; - if (mode->clock > max_clock) + if (mode->clock > max_clock) { + printk("\n DEBUG:the mode line clock is bigger than max value," + "clock is %d\n", mode->clock); + printmodeline(mode); return MODE_CLOCK_HIGH; + } + printk("DEBUG: the mode line is valid \n"); + printmodeline(mode); return MODE_OK; } @@ -454,6 +477,15 @@ static int intel_crt_get_modes(struct drm_connector *connector) intel_i2c_destroy(ddcbus); end: + if (ret) { + struct drm_display_mode *t, *cur_mode; + printk("\n DEBUG: print all modes from EDID START\n"); + list_for_each_entry_safe(cur_mode, t, &connector->probed_modes, head) + printmodeline(cur_mode); + printk("\n DEBUG: print all modes from EDID END\n"); + } else + printk("\n DEBUG no modes from EDID\n"); + return ret; }