diff options
author | Jason Ekstrand <[email protected]> | 2017-03-17 16:16:06 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2017-04-04 18:33:52 -0700 |
commit | 060a6434eca9fb05ca2dfd612f8abd4786ee4549 (patch) | |
tree | 5252b43be7b5baaaf0ac13ecebb83b0400bb5511 /src/intel/vulkan/anv_gem.c | |
parent | 651ec926fc10258ddc567da44c231d5303b8740f (diff) |
anv: Advertise larger heap sizes
Instead of just advertising the aperture size, we do something more
intelligent. On systems with a full 48-bit PPGTT, we can address 100%
of the available system RAM from the GPU. In order to keep clients from
burning 100% of your available RAM for graphics resources, we have a
nice little heuristic (which has received exactly zero tuning) to keep
things under a reasonable level of control.
Reviewed-by: Kristian H. Kristensen <[email protected]>
Diffstat (limited to 'src/intel/vulkan/anv_gem.c')
-rw-r--r-- | src/intel/vulkan/anv_gem.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/intel/vulkan/anv_gem.c b/src/intel/vulkan/anv_gem.c index 6a996ea3db8..2d07a3dbb0e 100644 --- a/src/intel/vulkan/anv_gem.c +++ b/src/intel/vulkan/anv_gem.c @@ -288,6 +288,22 @@ anv_gem_destroy_context(struct anv_device *device, int context) } int +anv_gem_get_context_param(int fd, int context, uint32_t param, uint64_t *value) +{ + struct drm_i915_gem_context_param gp = { + .ctx_id = context, + .param = param, + }; + + int ret = anv_ioctl(fd, DRM_IOCTL_I915_GEM_CONTEXT_GETPARAM, &gp); + if (ret == -1) + return -1; + + *value = gp.value; + return 0; +} + +int anv_gem_get_aperture(int fd, uint64_t *size) { struct drm_i915_gem_get_aperture aperture = { 0 }; |