Fix type/flags usage problem to check for preferred modes.
Add more debugging to help diagnose problems.main
parent
fa92e1f2ec
commit
e79e2a5816
|
@ -436,8 +436,11 @@ 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. */
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue