#include <sys/mman.h>
#include <sys/time.h>
#include <stdarg.h>
-#include "drm.h"
/* Not all systems have MAP_FAILED defined */
#ifndef MAP_FAILED
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;
}
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;
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;
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;
#include <stdarg.h>
#include <sys/types.h>
+#include <stdint.h>
#include <drm.h>
/* Defaults, if nothing set in xf86config */
#define HASH_MAIN 0
#if !HASH_MAIN
-# include "drm.h"
# include "xf86drm.h"
#endif
#define RANDOM_MAIN 0
#if !RANDOM_MAIN
-# include "drm.h"
# include "xf86drm.h"
#endif
#define SL_MAIN 0
#if !SL_MAIN
-# include "drm.h"
# include "xf86drm.h"
#else
# include <sys/time.h>
{
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;
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);
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);
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;
};
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);
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;
}
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
};
}
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;
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) {
#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 <sys/types.h>
-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 */
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.
};
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;
};
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;
#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;
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 {
};
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;
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;
};
/**