Skip to content

Commit

Permalink
drm/vc4: Add the DRM_IOCTL_VC4_GEM_MADVISE ioctl
Browse files Browse the repository at this point in the history
This ioctl will allow us to purge inactive userspace buffers when the
system is running out of contiguous memory.

For now, the purge logic is rather dumb in that it does not try to
release only the amount of BO needed to meet the last CMA alloc request
but instead purges all objects placed in the purgeable pool as soon as
we experience a CMA allocation failure.

Note that the in-kernel BO cache is always purged before the purgeable
cache because those objects are known to be unused while objects marked
as purgeable by a userspace application/library might have to be
restored when they are marked back as unpurgeable, which can be
expensive.

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20171019125748.3152-1-boris.brezillon@free-electrons.com
  • Loading branch information
Boris Brezillon authored and anholt committed Oct 19, 2017
1 parent 06e733e commit b9f1925
Show file tree
Hide file tree
Showing 6 changed files with 507 additions and 15 deletions.
Loading

0 comments on commit b9f1925

Please sign in to comment.