From: Ville Syrjälä ville.syrjala@linux.intel.com
Preserve the destination mode's list head in drm_mode_copy. Just in case someone decides that it's a good idea to overwrite a mode which happens to be on some list,
Signed-off-by: Ville Syrjälä ville.syrjala@linux.intel.com --- drivers/gpu/drm/drm_modes.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c index a371ff8..ba86316 100644 --- a/drivers/gpu/drm/drm_modes.c +++ b/drivers/gpu/drm/drm_modes.c @@ -787,16 +787,17 @@ EXPORT_SYMBOL(drm_mode_set_crtcinfo); * LOCKING: * None. * - * Copy an existing mode into another mode, preserving the object id - * of the destination mode. + * Copy an existing mode into another mode, preserving the object id and + * list head of the destination mode. */ void drm_mode_copy(struct drm_display_mode *dst, const struct drm_display_mode *src) { int id = dst->base.id; + struct list_head head = dst->head;
*dst = *src; dst->base.id = id; - INIT_LIST_HEAD(&dst->head); + dst->head = head; } EXPORT_SYMBOL(drm_mode_copy);
From: Ville Syrjälä ville.syrjala@linux.intel.com
Keeping the modes in the same order as we probe them makes it a bit easier to track what's happening.
Signed-off-by: Ville Syrjälä ville.syrjala@linux.intel.com --- drivers/gpu/drm/drm_crtc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index e7e9242..f072ac6 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c @@ -657,7 +657,7 @@ EXPORT_SYMBOL(drm_crtc_cleanup); void drm_mode_probed_add(struct drm_connector *connector, struct drm_display_mode *mode) { - list_add(&mode->head, &connector->probed_modes); + list_add_tail(&mode->head, &connector->probed_modes); } EXPORT_SYMBOL(drm_mode_probed_add);
On Fri, May 31, 2013 at 2:17 PM, ville.syrjala@linux.intel.com wrote:
From: Ville Syrjälä ville.syrjala@linux.intel.com
Keeping the modes in the same order as we probe them makes it a bit easier to track what's happening.
Signed-off-by: Ville Syrjälä ville.syrjala@linux.intel.com
I've just added a regression fixer to my -fixes queue which depends upon the old behaviour ... I'll make a note to fix this once stuff is merged together again. For reference the patch this will break in -fixes is:
commit c3456fb3e4712d0448592af3c5d644c9472cd3c1 Author: Daniel Vetter daniel.vetter@ffwll.ch Date: Mon Jun 10 09:47:58 2013 +0200
drm/i915: prefer VBT modes for SVDO-LVDS over EDID
Cheers, Daniel
drivers/gpu/drm/drm_crtc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index e7e9242..f072ac6 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c @@ -657,7 +657,7 @@ EXPORT_SYMBOL(drm_crtc_cleanup); void drm_mode_probed_add(struct drm_connector *connector, struct drm_display_mode *mode) {
list_add(&mode->head, &connector->probed_modes);
list_add_tail(&mode->head, &connector->probed_modes);
} EXPORT_SYMBOL(drm_mode_probed_add);
-- 1.8.1.5
dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
-- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch
On Tue, Jun 11, 2013 at 09:15:29AM +0200, Daniel Vetter wrote:
On Fri, May 31, 2013 at 2:17 PM, ville.syrjala@linux.intel.com wrote:
From: Ville Syrjälä ville.syrjala@linux.intel.com
Keeping the modes in the same order as we probe them makes it a bit easier to track what's happening.
Signed-off-by: Ville Syrjälä ville.syrjala@linux.intel.com
I've just added a regression fixer to my -fixes queue which depends upon the old behaviour ... I'll make a note to fix this once stuff is merged together again. For reference the patch this will break in -fixes is:
commit c3456fb3e4712d0448592af3c5d644c9472cd3c1 Author: Daniel Vetter daniel.vetter@ffwll.ch Date: Mon Jun 10 09:47:58 2013 +0200
drm/i915: prefer VBT modes for SVDO-LVDS over EDID
That is not the only place to have a subtle dependence upon the ordering of modes in the list. -Chris
On Tue, Jun 11, 2013 at 08:48:48AM +0100, Chris Wilson wrote:
On Tue, Jun 11, 2013 at 09:15:29AM +0200, Daniel Vetter wrote:
On Fri, May 31, 2013 at 2:17 PM, ville.syrjala@linux.intel.com wrote:
From: Ville Syrjälä ville.syrjala@linux.intel.com
Keeping the modes in the same order as we probe them makes it a bit easier to track what's happening.
Signed-off-by: Ville Syrjälä ville.syrjala@linux.intel.com
I've just added a regression fixer to my -fixes queue which depends upon the old behaviour ... I'll make a note to fix this once stuff is merged together again. For reference the patch this will break in -fixes is:
commit c3456fb3e4712d0448592af3c5d644c9472cd3c1 Author: Daniel Vetter daniel.vetter@ffwll.ch Date: Mon Jun 10 09:47:58 2013 +0200
drm/i915: prefer VBT modes for SVDO-LVDS over EDID
That is not the only place to have a subtle dependence upon the ordering of modes in the list.
I've now included latest drm-next into drm-intel-nightly. I guess we'll find out soon ;-) -Daniel
From: Ville Syrjälä ville.syrjala@linux.intel.com
Keeping the modes sorted by vrefresh before the pixel clock makes the mode list somehow more pleasing to the eye.
Signed-off-by: Ville Syrjälä ville.syrjala@linux.intel.com --- This is quite a subjective thing, so if no one else wants it, I'm fine with dropping it. More of an RFC really...
drivers/gpu/drm/drm_crtc_helper.c | 5 +++-- drivers/gpu/drm/drm_modes.c | 5 +++++ 2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c index ed1334e..f554516 100644 --- a/drivers/gpu/drm/drm_crtc_helper.c +++ b/drivers/gpu/drm/drm_crtc_helper.c @@ -189,13 +189,14 @@ prune: if (list_empty(&connector->modes)) return 0;
+ list_for_each_entry(mode, &connector->modes, head) + mode->vrefresh = drm_mode_vrefresh(mode); + drm_mode_sort(&connector->modes);
DRM_DEBUG_KMS("[CONNECTOR:%d:%s] probed modes :\n", connector->base.id, drm_get_connector_name(connector)); list_for_each_entry(mode, &connector->modes, head) { - mode->vrefresh = drm_mode_vrefresh(mode); - drm_mode_set_crtcinfo(mode, CRTC_INTERLACE_HALVE_V); drm_mode_debug_printmodeline(mode); } diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c index ba86316..4370fd4 100644 --- a/drivers/gpu/drm/drm_modes.c +++ b/drivers/gpu/drm/drm_modes.c @@ -1018,6 +1018,11 @@ static int drm_mode_compare(void *priv, struct list_head *lh_a, struct list_head diff = b->hdisplay * b->vdisplay - a->hdisplay * a->vdisplay; if (diff) return diff; + + diff = b->vrefresh - a->vrefresh; + if (diff) + return diff; + diff = b->clock - a->clock; return diff; }
On Fri, May 31, 2013 at 8:17 AM, ville.syrjala@linux.intel.com wrote:
From: Ville Syrjälä ville.syrjala@linux.intel.com
Preserve the destination mode's list head in drm_mode_copy. Just in case someone decides that it's a good idea to overwrite a mode which happens to be on some list,
Signed-off-by: Ville Syrjälä ville.syrjala@linux.intel.com
For the series: Reviewed-by: Alex Deucher alexander.deucher@amd.com
drivers/gpu/drm/drm_modes.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c index a371ff8..ba86316 100644 --- a/drivers/gpu/drm/drm_modes.c +++ b/drivers/gpu/drm/drm_modes.c @@ -787,16 +787,17 @@ EXPORT_SYMBOL(drm_mode_set_crtcinfo);
- LOCKING:
- None.
- Copy an existing mode into another mode, preserving the object id
- of the destination mode.
- Copy an existing mode into another mode, preserving the object id and
*/
- list head of the destination mode.
void drm_mode_copy(struct drm_display_mode *dst, const struct drm_display_mode *src) { int id = dst->base.id;
struct list_head head = dst->head; *dst = *src; dst->base.id = id;
INIT_LIST_HEAD(&dst->head);
dst->head = head;
} EXPORT_SYMBOL(drm_mode_copy);
-- 1.8.1.5
dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel
dri-devel@lists.freedesktop.org