summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/dri
diff options
context:
space:
mode:
authorEmil Velikov <[email protected]>2015-10-15 00:45:13 +0100
committerEmil Velikov <[email protected]>2015-11-21 12:52:20 +0000
commit13bccee87d6344ec7932b42de3fe3a2d10d30d96 (patch)
tree9187ca88a182170ef745c9b19ba7a4b653e32b4a /src/gallium/state_trackers/dri
parentb7f5c2ee48a8e386a891996ca83eb56fdc21229e (diff)
st/dri: Don't close the drm fd on failure
Ported from an identically named commit in st/xa commit 35cf3831d71770211f29da6608313dc1f6213d7b Author: Thomas Hellstrom <[email protected]> Date: Thu Jul 3 02:07:36 2014 -0700 st/xa: Don't close the drm fd on failure v2 Signed-off-by: Emil Velikov <[email protected]> Acked-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/dri')
-rw-r--r--src/gallium/state_trackers/dri/dri2.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gallium/state_trackers/dri/dri2.c b/src/gallium/state_trackers/dri/dri2.c
index 62173750381..5b7be64ba5a 100644
--- a/src/gallium/state_trackers/dri/dri2.c
+++ b/src/gallium/state_trackers/dri/dri2.c
@@ -1457,7 +1457,7 @@ dri2_init_screen(__DRIscreen * sPriv)
sPriv->driverPrivate = (void *)screen;
- if (pipe_loader_drm_probe_fd(&screen->dev, screen->fd)) {
+ if (pipe_loader_drm_probe_fd(&screen->dev, dup(screen->fd))) {
pscreen = pipe_loader_create_screen(screen->dev);
throttle_ret = pipe_loader_configuration(screen->dev, DRM_CONF_THROTTLE);
@@ -1529,7 +1529,7 @@ dri_kms_init_screen(__DRIscreen * sPriv)
sPriv->driverPrivate = (void *)screen;
- if (pipe_loader_sw_probe_kms(&screen->dev, screen->fd))
+ if (pipe_loader_sw_probe_kms(&screen->dev, dup(screen->fd)))
pscreen = pipe_loader_create_screen(screen->dev);
if (drmGetCap(sPriv->fd, DRM_CAP_PRIME, &cap) == 0 &&