[Intel-gfx] [PATCH 1/2] intel_device: Don't close the fd on probe failure if it is server managed

Hans de Goede hdegoede at redhat.com
Tue Mar 18 15:16:30 CET 2014


I hit this corner case when testing a single X server spanning both intel
gfx + an usb display link adapter driven by xf86-video-modesetting.

In this scenario the intel driver gets its platformProbe method called first,
and if it then closes the server managed fd, the xf86-video-modesetting gets
EBADFD errors.

Signed-off-by: Hans de Goede <hdegoede at redhat.com>
---
 src/intel_device.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/intel_device.c b/src/intel_device.c
index c0e1582..2d31ec8 100644
--- a/src/intel_device.c
+++ b/src/intel_device.c
@@ -339,7 +339,8 @@ int intel_open_device(int entity_num,
 	return fd;
 
 err_close:
-	close(fd);
+	if (master_count == 0) /* Don't close server-fds */
+		close(fd);
 err_path:
 	free(local_path);
 	return -1;
-- 
1.9.0




More information about the Intel-gfx mailing list