drm: Branch 'master' - 2 commits

[email protected] (Eric Anholt)
Newsgroups gmane.comp.video.dri.patches
Message-ID <[email protected]>
 xf86drm.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 2d8c01f256011c013edf3a76672d6ce9e2b05d8f
Author: Eric Anholt <[email protected]>
Date:   Fri Oct 21 10:09:47 2016 -0700

    Silence runtime complaints on platform devices
    
    glxgears was spamming this 12 times at startup because of Mesa's
    probing of the DRM device code, which doesn't support platform
    devices.
    
    Signed-off-by: Eric Anholt <[email protected]>
    Reviewed-by: Alex Deucher <[email protected]>

diff --git a/xf86drm.c b/xf86drm.c
index 9b52889..52add5e 100644
--- a/xf86drm.c
+++ b/xf86drm.c
@@ -3149,7 +3149,6 @@ int drmGetDevice(int fd, drmDevicePtr *device)
 
             break;
         default:
-            fprintf(stderr, "The subsystem type is not supported yet\n");
             continue;
         }
 
@@ -3259,7 +3258,6 @@ int drmGetDevices(drmDevicePtr devices[], int max_devices)
 
             break;
         default:
-            fprintf(stderr, "The subsystem type is not supported yet\n");
             continue;
         }
 
commit 677cd97dc4a930af508388713f5016baf664ed18
Author: Rob Herring <[email protected]>
Date:   Fri Oct 21 10:07:59 2016 -0700

    Return an -ENODEV from drmGetDevice() when no device was found.
    
    Fixes crashes in Mesa on platform devices, which expected *device to
    have a device when 0 was returned.
    
    (code from a paste by Rob, commit message by anholt)
    
    Signed-off-by: Eric Anholt <[email protected]>
    Reviewed-by: Alex Deucher <[email protected]>
    Reviewed-by: Emil Velikov <[email protected]>

diff --git a/xf86drm.c b/xf86drm.c
index 9cfca49..9b52889 100644
--- a/xf86drm.c
+++ b/xf86drm.c
@@ -3181,6 +3181,8 @@ int drmGetDevice(int fd, drmDevicePtr *device)
 
     closedir(sysdir);
     free(local_devices);
+    if (*device == NULL)
+	return -ENODEV;
     return 0;
 
 free_devices:

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
--
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.