aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRob Clark2016-05-31 11:06:50 -0500
committerRob Clark2016-07-20 18:42:21 -0500
commiteb846d46bca614f24c50f3fa89f94a6820e16589 (patch)
treeef805cc2fe2f4ee02694eeeecbf3c8904d20ea47 /freedreno/freedreno_priv.h
parent0c270df8dfde6d6d7b7adb236cd3325f2c0115bd (diff)
downloadexternal-libdrm-eb846d46bca614f24c50f3fa89f94a6820e16589.tar.gz
external-libdrm-eb846d46bca614f24c50f3fa89f94a6820e16589.tar.xz
external-libdrm-eb846d46bca614f24c50f3fa89f94a6820e16589.zip
freedreno: add madvise support
With a new enough drm/msm, we can let the kernel know about buffers that are in the bo cache, so the kernel can free them under memory pressure. Signed-off-by: Rob Clark <robclark@freedesktop.org>
Diffstat (limited to 'freedreno/freedreno_priv.h')
-rw-r--r--freedreno/freedreno_priv.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/freedreno/freedreno_priv.h b/freedreno/freedreno_priv.h
index 4159e526..f3ddd77d 100644
--- a/freedreno/freedreno_priv.h
+++ b/freedreno/freedreno_priv.h
@@ -54,6 +54,13 @@
54#include "freedreno_ringbuffer.h" 54#include "freedreno_ringbuffer.h"
55#include "drm.h" 55#include "drm.h"
56 56
57#ifndef TRUE
58# define TRUE 1
59#endif
60#ifndef FALSE
61# define FALSE 0
62#endif
63
57struct fd_device_funcs { 64struct fd_device_funcs {
58 int (*bo_new_handle)(struct fd_device *dev, uint32_t size, 65 int (*bo_new_handle)(struct fd_device *dev, uint32_t size,
59 uint32_t flags, uint32_t *handle); 66 uint32_t flags, uint32_t *handle);
@@ -76,6 +83,7 @@ struct fd_bo_cache {
76 83
77struct fd_device { 84struct fd_device {
78 int fd; 85 int fd;
86 int version;
79 atomic_t refcnt; 87 atomic_t refcnt;
80 88
81 /* tables to keep track of bo's, to avoid "evil-twin" fd_bo objects: 89 /* tables to keep track of bo's, to avoid "evil-twin" fd_bo objects:
@@ -139,6 +147,7 @@ struct fd_bo_funcs {
139 int (*offset)(struct fd_bo *bo, uint64_t *offset); 147 int (*offset)(struct fd_bo *bo, uint64_t *offset);
140 int (*cpu_prep)(struct fd_bo *bo, struct fd_pipe *pipe, uint32_t op); 148 int (*cpu_prep)(struct fd_bo *bo, struct fd_pipe *pipe, uint32_t op);
141 void (*cpu_fini)(struct fd_bo *bo); 149 void (*cpu_fini)(struct fd_bo *bo);
150 int (*madvise)(struct fd_bo *bo, int willneed);
142 void (*destroy)(struct fd_bo *bo); 151 void (*destroy)(struct fd_bo *bo);
143}; 152};
144 153