Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/drm2/dist/drm Fix hot-plug with small patch...



details:   https://anonhg.NetBSD.org/src/rev/1960da7c58c0
branches:  trunk
changeset: 795721:1960da7c58c0
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Fri Apr 25 19:07:55 2014 +0000

description:
Fix hot-plug with small patch from upstream before a full update.

diffstat:

 sys/external/bsd/drm2/dist/drm/drm_fb_helper.c |  14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)

diffs (38 lines):

diff -r 137a97a1123e -r 1960da7c58c0 sys/external/bsd/drm2/dist/drm/drm_fb_helper.c
--- a/sys/external/bsd/drm2/dist/drm/drm_fb_helper.c    Fri Apr 25 19:02:51 2014 +0000
+++ b/sys/external/bsd/drm2/dist/drm/drm_fb_helper.c    Fri Apr 25 19:07:55 2014 +0000
@@ -40,6 +40,7 @@
 #include <linux/notifier.h>
 #include <linux/printk.h>
 #include <linux/sysrq.h>
+#include <asm/bug.h>
 #include <drm/drmP.h>
 #include <drm/drm_crtc.h>
 #include <drm/drm_fb_helper.h>
@@ -1331,6 +1332,7 @@
        for (i = 0; i < fb_helper->crtc_count; i++) {
                modeset = &fb_helper->crtc_info[i].mode_set;
                modeset->num_connectors = 0;
+               modeset->fb = NULL;
        }
 
        for (i = 0; i < fb_helper->connector_count; i++) {
@@ -1350,6 +1352,18 @@
                }
        }
 
+       /* Clear out any old modes if there are no more connected outputs. */
+       for (i = 0; i < fb_helper->crtc_count; i++) {
+               modeset = &fb_helper->crtc_info[i].mode_set;
+               if (modeset->num_connectors == 0) {
+                       BUG_ON(modeset->fb);
+                       BUG_ON(modeset->num_connectors);
+                       if (modeset->mode)
+                               drm_mode_destroy(dev, modeset->mode);
+                       modeset->mode = NULL;
+                       fb_helper->crtc_info[i].desired_mode = NULL;
+               }
+       }
 out:
        kfree(crtcs);
        kfree(modes);



Home | Main Index | Thread Index | Old Index