summaryrefslogtreecommitdiff
path: root/freedreno/kgsl
diff options
context:
space:
mode:
authorRob Clark <robclark@freedesktop.org>2016-05-31 12:06:50 -0400
committerRob Clark <robclark@freedesktop.org>2016-07-20 19:42:21 -0400
commiteb846d46bca614f24c50f3fa89f94a6820e16589 (patch)
treeef805cc2fe2f4ee02694eeeecbf3c8904d20ea47 /freedreno/kgsl
parent0c270df8dfde6d6d7b7adb236cd3325f2c0115bd (diff)
downloadlibdrm-eb846d46bca614f24c50f3fa89f94a6820e16589.tar.gz
libdrm-eb846d46bca614f24c50f3fa89f94a6820e16589.tar.bz2
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/kgsl')
-rw-r--r--freedreno/kgsl/kgsl_bo.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/freedreno/kgsl/kgsl_bo.c b/freedreno/kgsl/kgsl_bo.c
index 2b45b5e2..ab3485e3 100644
--- a/freedreno/kgsl/kgsl_bo.c
+++ b/freedreno/kgsl/kgsl_bo.c
@@ -116,6 +116,11 @@ static void kgsl_bo_cpu_fini(struct fd_bo *bo)
{
}
+static int kgsl_bo_madvise(struct fd_bo *bo, int willneed)
+{
+ return willneed; /* not supported by kgsl */
+}
+
static void kgsl_bo_destroy(struct fd_bo *bo)
{
struct kgsl_bo *kgsl_bo = to_kgsl_bo(bo);
@@ -127,6 +132,7 @@ static const struct fd_bo_funcs funcs = {
.offset = kgsl_bo_offset,
.cpu_prep = kgsl_bo_cpu_prep,
.cpu_fini = kgsl_bo_cpu_fini,
+ .madvise = kgsl_bo_madvise,
.destroy = kgsl_bo_destroy,
};