DRM: Add 64-bit support

Some of the data types were incorrectly concatenated
from 64-bit to 32-bit tokens. This patch addresses these issues.

Change-Id: Ie224bcd43aa73da8ceaea9088ac8c35989d758bc
Tracked-On: https://jira01.devtools.intel.com/browse/IMINAN-7099
Signed-off-by: AtanasX D Zlatinski <atanasx.d.zlatinski@intel.com>
Reviewed-on: https://android.intel.com/160388
Reviewed-by: cactus <cactus@intel.com>
Reviewed-by: Agarwal, Tarun <tarun.agarwal@intel.com>
Tested-by: Agarwal, Tarun <tarun.agarwal@intel.com>
Reviewed-on: https://android.intel.com:443/291372
diff --git a/libdrm/xf86drm.c b/libdrm/xf86drm.c
index eaa7e51..cd6c771 100644
--- a/libdrm/xf86drm.c
+++ b/libdrm/xf86drm.c
@@ -329,7 +329,7 @@
 	drm_server_info->get_perms(&serv_group, &serv_mode);
 	devmode  = serv_mode ? serv_mode : DRM_DEV_MODE;
 	devmode &= ~(S_IXUSR|S_IXGRP|S_IXOTH);
-	group = (serv_group >= 0) ? serv_group : DRM_DEV_GID;
+	group = ((int)serv_group >= 0) ? serv_group : DRM_DEV_GID;
     }
 
 #if !defined(UDEV)
@@ -387,7 +387,7 @@
     /* Check if the device node is not what we expect it to be, and recreate it
      * and try again if so.
      */
-    if (st.st_rdev != dev) {
+    if ((long)st.st_rdev != dev) {
 	if (!isroot)
 	    return DRM_ERR_NOT_ROOT;
 	remove(buf);
@@ -2166,7 +2166,7 @@
 int drmGetStats(int fd, drmStatsT *stats)
 {
     drm_stats_t s;
-    int         i;
+    unsigned int i;
 
     if (drmIoctl(fd, DRM_IOCTL_GET_STATS, &s))
 	return -errno;
diff --git a/shared-core/drm.h b/shared-core/drm.h
index d97844f..5bea948 100644
--- a/shared-core/drm.h
+++ b/shared-core/drm.h
@@ -115,7 +115,7 @@
 #define _DRM_LOCKING_CONTEXT(lock) ((lock) & ~(_DRM_LOCK_HELD|_DRM_LOCK_CONT))
 
 #if defined(__linux__)
-typedef unsigned int drm_handle_t;
+typedef unsigned long int drm_handle_t;
 #else
 #include <sys/types.h>
 typedef unsigned long drm_handle_t;	/**< To mapped regions */