mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2026-08-24 14:45:46 +00:00
lib: add gem_available_aperture_size helper
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
@@ -588,6 +588,15 @@ void *gem_mmap__cpu(int fd, uint32_t handle, int size, int prot)
|
|||||||
return (void *)(uintptr_t)mmap_arg.addr_ptr;
|
return (void *)(uintptr_t)mmap_arg.addr_ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint64_t gem_available_aperture_size(int fd)
|
||||||
|
{
|
||||||
|
struct drm_i915_gem_get_aperture aperture;
|
||||||
|
|
||||||
|
aperture.aper_size = 256*1024*1024;
|
||||||
|
do_ioctl(fd, DRM_IOCTL_I915_GEM_GET_APERTURE, &aperture);
|
||||||
|
return aperture.aper_available_size;
|
||||||
|
}
|
||||||
|
|
||||||
uint64_t gem_aperture_size(int fd)
|
uint64_t gem_aperture_size(int fd)
|
||||||
{
|
{
|
||||||
struct drm_i915_gem_get_aperture aperture;
|
struct drm_i915_gem_get_aperture aperture;
|
||||||
|
|||||||
@@ -79,6 +79,7 @@ void *gem_mmap__gtt(int fd, uint32_t handle, int size, int prot);
|
|||||||
void *gem_mmap__cpu(int fd, uint32_t handle, int size, int prot);
|
void *gem_mmap__cpu(int fd, uint32_t handle, int size, int prot);
|
||||||
#define gem_mmap gem_mmap__gtt
|
#define gem_mmap gem_mmap__gtt
|
||||||
|
|
||||||
|
uint64_t gem_available_aperture_size(int fd);
|
||||||
uint64_t gem_aperture_size(int fd);
|
uint64_t gem_aperture_size(int fd);
|
||||||
uint64_t gem_mappable_aperture_size(void);
|
uint64_t gem_mappable_aperture_size(void);
|
||||||
int gem_madvise(int fd, uint32_t handle, int state);
|
int gem_madvise(int fd, uint32_t handle, int state);
|
||||||
|
|||||||
Reference in New Issue
Block a user