diff --git a/libdrm/xf86drm.c b/libdrm/xf86drm.c index 52a6d92f..8cee4fbc 100644 --- a/libdrm/xf86drm.c +++ b/libdrm/xf86drm.c @@ -49,7 +49,6 @@ #include #include #include -#include "drm.h" /* Not all systems have MAP_FAILED defined */ #ifndef MAP_FAILED @@ -2698,7 +2697,7 @@ static void drmBOCopyReply(const struct drm_bo_info_rep *rep, drmBO *buf) int drmBOCreate(int fd, unsigned long start, unsigned long size, unsigned pageAlignment, void *user_buffer, drm_bo_type_t type, - drm_u64_t mask, + uint64_t mask, unsigned hint, drmBO *buf) { struct drm_bo_create_arg arg; @@ -2879,7 +2878,7 @@ int drmBOUnmap(int fd, drmBO *buf) } int drmBOValidate(int fd, drmBO *buf, - drm_u64_t flags, drm_u64_t mask, + uint64_t flags, uint64_t mask, unsigned hint) { struct drm_bo_op_arg arg; @@ -3057,7 +3056,7 @@ int drmBOValidateList(int fd, drmBOList *list) struct drm_bo_op_arg *arg, *first; struct drm_bo_op_req *req; struct drm_bo_arg_rep *rep; - drm_u64_t *prevNext = NULL; + uint64_t *prevNext = NULL; drmBO *buf; int ret; @@ -3121,7 +3120,7 @@ int drmBOFenceList(int fd, drmBOList *list, unsigned fenceHandle) struct drm_bo_op_arg *arg, *first; struct drm_bo_op_req *req; struct drm_bo_arg_rep *rep; - drm_u64_t *prevNext = NULL; + uint64_t *prevNext = NULL; drmBO *buf; unsigned fence_flags; int ret; diff --git a/libdrm/xf86drm.h b/libdrm/xf86drm.h index d4260cc9..230f54ce 100644 --- a/libdrm/xf86drm.h +++ b/libdrm/xf86drm.h @@ -36,6 +36,7 @@ #include #include +#include #include /* Defaults, if nothing set in xf86config */ diff --git a/libdrm/xf86drmHash.c b/libdrm/xf86drmHash.c index d1ade063..82cbc2a5 100644 --- a/libdrm/xf86drmHash.c +++ b/libdrm/xf86drmHash.c @@ -74,7 +74,6 @@ #define HASH_MAIN 0 #if !HASH_MAIN -# include "drm.h" # include "xf86drm.h" #endif diff --git a/libdrm/xf86drmRandom.c b/libdrm/xf86drmRandom.c index 61ffb078..ecab9e2d 100644 --- a/libdrm/xf86drmRandom.c +++ b/libdrm/xf86drmRandom.c @@ -77,7 +77,6 @@ #define RANDOM_MAIN 0 #if !RANDOM_MAIN -# include "drm.h" # include "xf86drm.h" #endif diff --git a/libdrm/xf86drmSL.c b/libdrm/xf86drmSL.c index ce60648d..58aefac7 100644 --- a/libdrm/xf86drmSL.c +++ b/libdrm/xf86drmSL.c @@ -44,7 +44,6 @@ #define SL_MAIN 0 #if !SL_MAIN -# include "drm.h" # include "xf86drm.h" #else # include diff --git a/libdrm/xf86mm.h b/libdrm/xf86mm.h index 61978bc9..d1e0b28f 100644 --- a/libdrm/xf86mm.h +++ b/libdrm/xf86mm.h @@ -107,9 +107,9 @@ typedef struct _drmBO { drm_bo_type_t type; unsigned handle; - drm_u64_t mapHandle; - drm_u64_t flags; - drm_u64_t mask; + uint64_t mapHandle; + uint64_t flags; + uint64_t mask; unsigned mapFlags; unsigned long size; unsigned long offset; @@ -180,7 +180,7 @@ extern int drmBOCreateList(int numTarget, drmBOList *list); extern int drmBOCreate(int fd, unsigned long start, unsigned long size, unsigned pageAlignment,void *user_buffer, - drm_bo_type_t type, drm_u64_t mask, + drm_bo_type_t type, uint64_t mask, unsigned hint, drmBO *buf); extern int drmBODestroy(int fd, drmBO *buf); extern int drmBOReference(int fd, unsigned handle, drmBO *buf); @@ -188,8 +188,8 @@ extern int drmBOUnReference(int fd, drmBO *buf); extern int drmBOMap(int fd, drmBO *buf, unsigned mapFlags, unsigned mapHint, void **address); extern int drmBOUnmap(int fd, drmBO *buf); -extern int drmBOValidate(int fd, drmBO *buf, drm_u64_t flags, - drm_u64_t mask, unsigned hint); +extern int drmBOValidate(int fd, drmBO *buf, uint64_t flags, + uint64_t mask, unsigned hint); extern int drmBOFence(int fd, drmBO *buf, unsigned flags, unsigned fenceHandle); extern int drmBOInfo(int fd, drmBO *buf); diff --git a/linux-core/drmP.h b/linux-core/drmP.h index 19e9d627..c5dfe6bf 100644 --- a/linux-core/drmP.h +++ b/linux-core/drmP.h @@ -551,7 +551,7 @@ struct drm_map_list { struct list_head head; /**< list head */ struct drm_hash_item hash; struct drm_map *map; /**< mapping */ - drm_u64_t user_token; + uint64_t user_token; struct drm_mm_node *file_offset_node; }; @@ -931,9 +931,9 @@ extern int drm_unbind_agp(DRM_AGP_MEM * handle); extern void drm_free_memctl(size_t size); extern int drm_alloc_memctl(size_t size); -extern void drm_query_memctl(drm_u64_t *cur_used, - drm_u64_t *low_threshold, - drm_u64_t *high_threshold); +extern void drm_query_memctl(uint64_t *cur_used, + uint64_t *low_threshold, + uint64_t *high_threshold); extern void drm_init_memctl(size_t low_threshold, size_t high_threshold, size_t unit_size); diff --git a/linux-core/drm_bo.c b/linux-core/drm_bo.c index 681d37fe..374be04e 100644 --- a/linux-core/drm_bo.c +++ b/linux-core/drm_bo.c @@ -2629,7 +2629,7 @@ static int drm_bo_setup_vm_locked(struct drm_buffer_object * bo) return -ENOMEM; } - list->user_token = ((drm_u64_t) list->hash.key) << PAGE_SHIFT; + list->user_token = ((uint64_t) list->hash.key) << PAGE_SHIFT; return 0; } diff --git a/linux-core/drm_memory.c b/linux-core/drm_memory.c index 454c33e8..f68a3a3e 100644 --- a/linux-core/drm_memory.c +++ b/linux-core/drm_memory.c @@ -38,9 +38,9 @@ static struct { spinlock_t lock; - drm_u64_t cur_used; - drm_u64_t low_threshold; - drm_u64_t high_threshold; + uint64_t cur_used; + uint64_t low_threshold; + uint64_t high_threshold; } drm_memctl = { .lock = SPIN_LOCK_UNLOCKED }; @@ -82,9 +82,9 @@ void drm_free_memctl(size_t size) } EXPORT_SYMBOL(drm_free_memctl); -void drm_query_memctl(drm_u64_t *cur_used, - drm_u64_t *low_threshold, - drm_u64_t *high_threshold) +void drm_query_memctl(uint64_t *cur_used, + uint64_t *low_threshold, + uint64_t *high_threshold) { spin_lock(&drm_memctl.lock); *cur_used = drm_memctl.cur_used; diff --git a/linux-core/drm_proc.c b/linux-core/drm_proc.c index 3f9cb028..08bf99d6 100644 --- a/linux-core/drm_proc.c +++ b/linux-core/drm_proc.c @@ -436,9 +436,9 @@ static int drm__objects_info(char *buf, char **start, off_t offset, int request, int len = 0; struct drm_buffer_manager *bm = &dev->bm; struct drm_fence_manager *fm = &dev->fm; - drm_u64_t used_mem; - drm_u64_t low_mem; - drm_u64_t high_mem; + uint64_t used_mem; + uint64_t low_mem; + uint64_t high_mem; if (offset > DRM_PROC_LIMIT) { diff --git a/shared-core/drm.h b/shared-core/drm.h index 3ab63d5d..de8967ad 100644 --- a/shared-core/drm.h +++ b/shared-core/drm.h @@ -127,16 +127,9 @@ #define _DRM_LOCKING_CONTEXT(lock) ((lock) & ~(_DRM_LOCK_HELD|_DRM_LOCK_CONT)) #if defined(__linux__) -#if defined(__KERNEL__) -typedef __u64 drm_u64_t; -#else -typedef unsigned long long drm_u64_t; -#endif - typedef unsigned int drm_handle_t; #else #include -typedef u_int64_t drm_u64_t; typedef unsigned long drm_handle_t; /**< To mapped regions */ #endif typedef unsigned int drm_context_t; /**< GLXContext handle */ @@ -677,7 +670,7 @@ struct drm_fence_arg { unsigned int flags; unsigned int signaled; unsigned int pad64; - drm_u64_t expand_pad[3]; /*Future expansion */ + uint64_t expand_pad[3]; /*Future expansion */ }; /* Buffer permissions, referring to how the GPU uses the buffers. @@ -792,8 +785,8 @@ enum drm_bo_type { }; struct drm_bo_info_req { - drm_u64_t mask; - drm_u64_t flags; + uint64_t mask; + uint64_t flags; unsigned int handle; unsigned int hint; unsigned int fence_class; @@ -801,9 +794,9 @@ struct drm_bo_info_req { }; struct drm_bo_create_req { - drm_u64_t mask; - drm_u64_t size; - drm_u64_t buffer_start; + uint64_t mask; + uint64_t size; + uint64_t buffer_start; unsigned int hint; unsigned int page_alignment; enum drm_bo_type type; @@ -827,12 +820,12 @@ struct drm_bo_op_req { #define DRM_BO_REP_BUSY 0x00000001 struct drm_bo_info_rep { - drm_u64_t flags; - drm_u64_t mask; - drm_u64_t size; - drm_u64_t offset; - drm_u64_t arg_handle; - drm_u64_t buffer_start; + uint64_t flags; + uint64_t mask; + uint64_t size; + uint64_t offset; + uint64_t arg_handle; + uint64_t buffer_start; unsigned int handle; unsigned int fence_flags; unsigned int rep_flags; @@ -841,7 +834,7 @@ struct drm_bo_info_rep { unsigned int hw_tile_stride; unsigned int tile_info; unsigned int pad64; - drm_u64_t expand_pad[4]; /*Future expansion */ + uint64_t expand_pad[4]; /*Future expansion */ }; struct drm_bo_arg_rep { @@ -876,7 +869,7 @@ struct drm_bo_map_wait_idle_arg { }; struct drm_bo_op_arg { - drm_u64_t next; + uint64_t next; union { struct drm_bo_op_req req; struct drm_bo_arg_rep rep; @@ -905,8 +898,8 @@ struct drm_mm_init_arg { unsigned int major; unsigned int minor; unsigned int mem_type; - drm_u64_t p_offset; - drm_u64_t p_size; + uint64_t p_offset; + uint64_t p_size; }; /**