xf86drm: remove to open the DRM device unnecessarily
diff mbox

Message ID FD5696F5CDD4B04D92C97DB96167DECA1619BBF0@SCYBEXDAG04.amd.com
State New
Headers show

Commit Message

Jammy Zhou May 28, 2015, 9 a.m. UTC
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>


Regards,
Jammy

-----Original Message-----
From: dri-devel [mailto:dri-devel-bounces@lists.freedesktop.org] On Behalf Of Joonyoung Shim

Sent: Thursday, May 28, 2015 8:58 AM
To: dri-devel@lists.freedesktop.org
Cc: emil.l.velikov@gmail.com
Subject: [PATCH] xf86drm: remove to open the DRM device unnecessarily

This is to remove to open the DRM device unnecessarily as call
drmAvailable() when name is NULL or drm_server_info is NULL in drmOpenWithType function.

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>

---
 xf86drm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

Patch
diff mbox

diff --git a/xf86drm.c b/xf86drm.c
index b5a174b..900e4b1 100644
--- a/xf86drm.c
+++ b/xf86drm.c
@@ -725,7 +725,7 @@  int drmOpen(const char *name, const char *busid)
  */
 int drmOpenWithType(const char *name, const char *busid, int type)  {
-    if (!drmAvailable() && name != NULL && drm_server_info) {
+    if (name != NULL && drm_server_info && !drmAvailable()) {
 	/* try to load the kernel module */
 	if (!drm_server_info->load_module(name)) {
 	    drmMsg("[drm] failed to load kernel module \"%s\"\n", name);
--
1.9.1