[PATCH] xf86drm: remove to open the DRM device unnecessarily

Zhou, Jammy Jammy.Zhou at amd.com
Thu May 28 02:00:09 PDT 2015


Reviewed-by: Jammy Zhou <Jammy.Zhou at amd.com>

Regards,
Jammy

-----Original Message-----
From: dri-devel [mailto:dri-devel-bounces at lists.freedesktop.org] On Behalf Of Joonyoung Shim
Sent: Thursday, May 28, 2015 8:58 AM
To: dri-devel at lists.freedesktop.org
Cc: emil.l.velikov at 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 at samsung.com>
---
 xf86drm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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

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


More information about the dri-devel mailing list