Fix type/flags usage problem to check for preferred modes.

Add more debugging to help diagnose problems.
main
Alan Hourihane 2007-06-28 21:25:13 +01:00
parent fa92e1f2ec
commit e79e2a5816
2 changed files with 13 additions and 10 deletions

View File

@ -436,9 +436,12 @@ bool drm_crtc_set_mode(struct drm_crtc *crtc, struct drm_display_mode *mode,
*/ */
crtc->funcs->mode_set(crtc, mode, adjusted_mode, x, y); crtc->funcs->mode_set(crtc, mode, adjusted_mode, x, y);
list_for_each_entry(output, &dev->mode_config.output_list, head) { list_for_each_entry(output, &dev->mode_config.output_list, head) {
if (output->crtc == crtc) if (output->crtc == crtc) {
dev_warn(&output->dev->pdev->dev, "%s: set mode %s\n",
output->name, mode->name);
output->funcs->mode_set(output, mode, adjusted_mode); output->funcs->mode_set(output, mode, adjusted_mode);
} }
}
/* Now, enable the clocks, plane, pipe, and outputs that we set up. */ /* Now, enable the clocks, plane, pipe, and outputs that we set up. */
crtc->funcs->commit(crtc); crtc->funcs->commit(crtc);
@ -787,16 +790,14 @@ static void drm_pick_crtcs (drm_device_t *dev)
des_mode = NULL; des_mode = NULL;
list_for_each_entry(des_mode, &output->modes, head) { list_for_each_entry(des_mode, &output->modes, head) {
if (des_mode->flags & DRM_MODE_TYPE_PREFERRED) if (des_mode->type & DRM_MODE_TYPE_PREFERRED)
break; break;
} }
/* No preferred mode, let's select another which should pick /* No preferred mode, let's just select the first available */
* the default 640x480 if nothing else is here. if (!des_mode || !(des_mode->type & DRM_MODE_TYPE_PREFERRED)) {
*/
if (!des_mode || !(des_mode->flags & DRM_MODE_TYPE_PREFERRED)) {
list_for_each_entry(des_mode, &output->modes, head) { list_for_each_entry(des_mode, &output->modes, head) {
if (des_mode->flags & DRM_MODE_TYPE_DEFAULT) if (des_mode)
break; break;
} }
} }

View File

@ -46,12 +46,12 @@
void drm_mode_debug_printmodeline(struct drm_device *dev, void drm_mode_debug_printmodeline(struct drm_device *dev,
struct drm_display_mode *mode) struct drm_display_mode *mode)
{ {
DRM_DEBUG("Modeline %d:\"%s\" %d %d %d %d %d %d %d %d %d %d\n", DRM_DEBUG("Modeline %d:\"%s\" %d %d %d %d %d %d %d %d %d %d 0x%x\n",
mode->mode_id, mode->name, mode->vrefresh, mode->clock, mode->mode_id, mode->name, mode->vrefresh, mode->clock,
mode->hdisplay, mode->hsync_start, mode->hdisplay, mode->hsync_start,
mode->hsync_end, mode->htotal, mode->hsync_end, mode->htotal,
mode->vdisplay, mode->vsync_start, mode->vdisplay, mode->vsync_start,
mode->vsync_end, mode->vtotal); mode->vsync_end, mode->vtotal, mode->type);
} }
EXPORT_SYMBOL(drm_mode_debug_printmodeline); EXPORT_SYMBOL(drm_mode_debug_printmodeline);
@ -387,8 +387,10 @@ void drm_mode_prune_invalid(struct drm_device *dev,
list_for_each_entry_safe(mode, t, mode_list, head) { list_for_each_entry_safe(mode, t, mode_list, head) {
if (mode->status != MODE_OK) { if (mode->status != MODE_OK) {
list_del(&mode->head); list_del(&mode->head);
if (verbose) if (verbose) {
drm_mode_debug_printmodeline(dev, mode);
DRM_DEBUG("Not using %s mode %d\n", mode->name, mode->status); DRM_DEBUG("Not using %s mode %d\n", mode->name, mode->status);
}
kfree(mode); kfree(mode);
} }
} }