2011/4/5 Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>: > Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> > --- > Âdrivers/gpu/drm/drm_modes.c | Â 52 +++++++++++++++++++++++++++++++++++++++++- > Â1 files changed, 50 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c > index 25bf873..b3e07ac 100644 > --- a/drivers/gpu/drm/drm_modes.c > +++ b/drivers/gpu/drm/drm_modes.c > @@ -853,6 +853,52 @@ void drm_mode_validate_clocks(struct drm_device *dev, > Â} > ÂEXPORT_SYMBOL(drm_mode_validate_clocks); > > +static const char *mode_status_to_string(enum drm_mode_status status) > +{ > + Â Â Â const char *strings[] = { + static? > + Â Â Â Â Â Â Â [MODE_OK] = "OK", > + Â Â Â Â Â Â Â [MODE_HSYNC] = "hsync out of range", > + Â Â Â Â Â Â Â [MODE_VSYNC] = "vsync out of range", > + Â Â Â Â Â Â Â [MODE_H_ILLEGAL] = "illegal horizontal timings", > + Â Â Â Â Â Â Â [MODE_V_ILLEGAL] = "illegal vertical timings", > + Â Â Â Â Â Â Â [MODE_BAD_WIDTH] = "requires an unsupported linepitch", > + Â Â Â Â Â Â Â [MODE_NOMODE] = "no mode with a maching name", s/maching/matching/ > + Â Â Â Â Â Â Â [MODE_NO_INTERLACE] = "interlaced mode not supported", > + Â Â Â Â Â Â Â [MODE_NO_DBLESCAN] = "doublescan mode not supported", > + Â Â Â Â Â Â Â [MODE_NO_VSCAN] = "multiscan mode not supported", > + Â Â Â Â Â Â Â [MODE_MEM] = "insufficient video memory", > + Â Â Â Â Â Â Â [MODE_VIRTUAL_X] = "mode width too large for specified virtual size", > + Â Â Â Â Â Â Â [MODE_VIRTUAL_Y] = "mode height too large for specified virtual size", > + Â Â Â Â Â Â Â [MODE_MEM_VIRT] = "insufficient video memory given virtual size", > + Â Â Â Â Â Â Â [MODE_NOCLOCK] = "no fixed clock available", > + Â Â Â Â Â Â Â [MODE_CLOCK_HIGH] = "clock required is too high", > + Â Â Â Â Â Â Â [MODE_CLOCK_LOW] = "clock required is too low", > + Â Â Â Â Â Â Â [MODE_CLOCK_RANGE] = "clock/mode isn't in a ClockRange", > + Â Â Â Â Â Â Â [MODE_BAD_HVALUE] = "horizontal timing was out of range", > + Â Â Â Â Â Â Â [MODE_BAD_VVALUE] = "vertical timing was out of range", > + Â Â Â Â Â Â Â [MODE_BAD_VSCAN] = "VScan value out of range", > + Â Â Â Â Â Â Â [MODE_HSYNC_NARROW] = "horizontal sync too narrow", > + Â Â Â Â Â Â Â [MODE_HSYNC_WIDE] = "horizontal sync too wide", > + Â Â Â Â Â Â Â [MODE_HBLANK_NARROW] = "horizontal blanking too narrow", > + Â Â Â Â Â Â Â [MODE_HBLANK_WIDE] = "horizontal blanking too wide", > + Â Â Â Â Â Â Â [MODE_VSYNC_NARROW] = "vertical sync too narrow", > + Â Â Â Â Â Â Â [MODE_VSYNC_WIDE] = "vertical sync too wide", > + Â Â Â Â Â Â Â [MODE_VBLANK_NARROW] = "vertical blanking too narrow", > + Â Â Â Â Â Â Â [MODE_VBLANK_WIDE] = "vertical blanking too wide", > + Â Â Â Â Â Â Â [MODE_PANEL] = "exceeds panel dimensions", > + Â Â Â Â Â Â Â [MODE_INTERLACE_WIDTH] = "width too large for interlaced mode", > + Â Â Â Â Â Â Â [MODE_ONE_WIDTH] = "only one width is supported", > + Â Â Â Â Â Â Â [MODE_ONE_HEIGHT] = "only one height is supported", > + Â Â Â Â Â Â Â [MODE_ONE_SIZE] = "only one resolution is supported", > + Â Â Â Â Â Â Â [MODE_NO_REDUCED] = "monitor doesn't accept reduced blanking", > + Â Â Â }; > + > + Â Â Â if ((unsigned)status > ARRAY_SIZE(strings)) > -> >= > + Â Â Â Â Â Â Â return "unknown"; > + > + Â Â Â return strings[status]; > +} > + > Â/** > Â* drm_mode_prune_invalid - remove invalid modes from mode list > Â* @dev: DRM device > @@ -876,8 +922,10 @@ void drm_mode_prune_invalid(struct drm_device *dev, > Â Â Â Â Â Â Â Â Â Â Â Âlist_del(&mode->head); > Â Â Â Â Â Â Â Â Â Â Â Âif (verbose) { > Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Âdrm_mode_debug_printmodeline(mode); > - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â DRM_DEBUG_KMS("Not using %s mode %d\n", > - Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â mode->name, mode->status); > + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â DRM_DEBUG_KMS("Not using %s mode: %s [%d]\n", > + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â mode->name, > + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â mode_status_to_string(mode->status), > + Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â mode->status); > Â Â Â Â Â Â Â Â Â Â Â Â} > Â Â Â Â Â Â Â Â Â Â Â Âdrm_mode_destroy(dev, mode); > Â Â Â Â Â Â Â Â} > -- _______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/dri-devel