[Mesa-dev] [PATCH] gallium/winsys/kms: Close drm device filedescriptor on kms_dri_sw_winsys release

Lukasz Spintzyk lukasz.spintzyk at gmail.com
Mon Sep 5 16:48:18 UTC 2016


This closes filedescriptor owned by kms_dri_sw_winsys struct. It fixes issue
where removal of udl or evdi module used by DisplayLink devices was impossible
due to not closed filedescriptors.

When this file descriptor was not closed then command
rmmod udl was returning error "Module udl is in use".
By this fix xserver does not prevent module removal when usb device
is unplugged.

Signed-off-by: Lukasz Spintzyk <lukasz.spintzyk at gmail.com>
---
 src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.c b/src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.c
index 07eca99..f06ccef 100644
--- a/src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.c
+++ b/src/gallium/winsys/sw/kms-dri/kms_dri_sw_winsys.c
@@ -371,6 +371,9 @@ kms_sw_displaytarget_display(struct sw_winsys *ws,
 static void
 kms_destroy_sw_winsys(struct sw_winsys *winsys)
 {
+   struct kms_sw_winsys *kms_sw = kms_sw_winsys(winsys);
+
+   close(kms_sw->fd);
    FREE(winsys);
 }
 
-- 
2.7.4



More information about the mesa-dev mailing list