libkms: move sources lists to makefile.sources
[platform/upstream/libdrm.git] / freedreno / freedreno_priv.h
index 061d807..b204e53 100644 (file)
 #ifndef FREEDRENO_PRIV_H_
 #define FREEDRENO_PRIV_H_
 
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include <stdlib.h>
 #include <errno.h>
 #include <string.h>
@@ -41,6 +45,7 @@
 #include <stdio.h>
 #include <assert.h>
 
+#include "libdrm.h"
 #include "xf86drm.h"
 #include "xf86atomic.h"
 
@@ -84,6 +89,8 @@ struct fd_device {
        struct fd_bo_bucket cache_bucket[14 * 4];
        int num_buckets;
        time_t time;
+
+       int closefd;        /* call close(fd) upon destruction */
 };
 
 void fd_cleanup_bo_cache(struct fd_device *dev, time_t time);
@@ -112,6 +119,7 @@ struct fd_ringmarker {
 struct fd_ringbuffer_funcs {
        void * (*hostptr)(struct fd_ringbuffer *ring);
        int (*flush)(struct fd_ringbuffer *ring, uint32_t *last_start);
+       void (*reset)(struct fd_ringbuffer *ring);
        void (*emit_reloc)(struct fd_ringbuffer *ring,
                        const struct fd_reloc *reloc);
        void (*emit_reloc_ring)(struct fd_ringbuffer *ring,
@@ -131,6 +139,7 @@ struct fd_bo {
        uint32_t size;
        uint32_t handle;
        uint32_t name;
+       int fd;          /* dmabuf handle */
        void *map;
        atomic_t refcnt;
        struct fd_bo_funcs *funcs;
@@ -140,9 +149,6 @@ struct fd_bo {
        time_t free_time;        /* time when added to bucket-list */
 };
 
-struct fd_bo *fd_bo_from_handle(struct fd_device *dev,
-               uint32_t handle, uint32_t size);
-
 #define ALIGN(v,a) (((v) + (a) - 1) & ~((a) - 1))
 #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))