[PATCH xserver 4/6] modesetting: Retrieve drm connector in drmmode_output_detect()
Daniel Martin
consume.noise at gmail.com
Mon Nov 20 09:54:04 UTC 2017
So, we don't rely on the mode_output member.
Signed-off-by: Daniel Martin <consume.noise at gmail.com>
---
hw/xfree86/drivers/modesetting/drmmode_display.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c
index 4e8b7e51b..b2a563713 100644
--- a/hw/xfree86/drivers/modesetting/drmmode_display.c
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
@@ -1142,21 +1142,19 @@ drmmode_output_detect(xf86OutputPtr output)
/* go to the hw and retrieve a new output struct */
drmmode_output_private_ptr drmmode_output = output->driver_private;
drmmode_ptr drmmode = drmmode_output->drmmode;
+ drmModeConnectorPtr koutput;
xf86OutputStatus status;
if (drmmode_output->output_id == -1)
return XF86OutputStatusDisconnected;
- drmModeFreeConnector(drmmode_output->mode_output);
-
- drmmode_output->mode_output =
- drmModeGetConnector(drmmode->fd, drmmode_output->output_id);
- if (!drmmode_output->mode_output) {
+ koutput = drmModeGetConnector(drmmode->fd, drmmode_output->output_id);
+ if (!koutput) {
drmmode_output->output_id = -1;
return XF86OutputStatusDisconnected;
}
- switch (drmmode_output->mode_output->connection) {
+ switch (koutput->connection) {
case DRM_MODE_CONNECTED:
status = XF86OutputStatusConnected;
break;
@@ -1168,6 +1166,8 @@ drmmode_output_detect(xf86OutputPtr output)
status = XF86OutputStatusUnknown;
break;
}
+
+ drmModeFreeConnector(koutput);
return status;
}
--
2.13.6
More information about the xorg-devel
mailing list