xf86-video-intel: src/sna/sna_display.c

Chris Wilson ickle at kemper.freedesktop.org
Wed Sep 9 03:28:10 PDT 2015


 src/sna/sna_display.c |   25 +++++++++++++++++++++++--
 1 file changed, 23 insertions(+), 2 deletions(-)

New commits:
commit f5aabb7bddc6fc5dc910a983d1291c9864f65f06
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Sep 9 11:18:15 2015 +0100

    sna: On hotplug events, update the output->status
    
    During the hotplug event, we query the current connector status and use
    that to trigger an output changed event to the clients. However, since
    we know the new status, we can set that on the RROutput immediately.
    Note the modelist is left unchanged, and will only be queried when the
    user requests it (though we may want to provide that in the hotplug
    notify as well).
    
    References: https://bugs.freedesktop.org/show_bug.cgi?id=91929#c2
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 34d19bb..d13d283 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -4848,8 +4848,29 @@ void sna_mode_discover(struct sna *sna)
 
 		sna_output->last_detect = 0;
 		if (sna_output->serial == serial) {
-			if (sna_output_detect(output) != output->status)
-				RROutputChanged(output->randr_output, TRUE);
+			xf86OutputStatus status = sna_output_detect(output);
+			if (status != output->status) {
+				RROutputPtr rr = output->randr_output;
+				unsigned value;
+
+				DBG(("%s: output %s (id=%d), changed status %d -> %d\n",
+				     __FUNCTION__, output->name, sna_output->id, output->status, status));
+
+				output->status = status;
+				switch (status) {
+				case XF86OutputStatusConnected:
+					value = RR_Connected;
+					break;
+				case XF86OutputStatusDisconnected:
+					value = RR_Disconnected;
+					break;
+				default:
+				case XF86OutputStatusUnknown:
+					value = RR_UnknownConnection;
+					break;
+				}
+				RROutputSetConnection(rr, value);
+			}
 			continue;
 		}
 


More information about the xorg-commit mailing list