mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-31 01:10:16 +01:00
nouveau: implement and enable PIPE_CAP_QUERY_MEMORY_INFO
Signed-off-by: Yusuf Khan <yusisamerican@gmail.com> Reviewed-by: Karol Herbst <kherbst@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17931>
This commit is contained in:
parent
17eda68df3
commit
4e9cce39d3
4 changed files with 19 additions and 3 deletions
|
|
@ -187,6 +187,20 @@ reserve_vma(uintptr_t start, uint64_t reserved_size)
|
|||
return reserved;
|
||||
}
|
||||
|
||||
static void
|
||||
nouveau_query_memory_info(struct pipe_screen *pscreen,
|
||||
struct pipe_memory_info *info)
|
||||
{
|
||||
const struct nouveau_screen *screen = nouveau_screen(pscreen);
|
||||
struct nouveau_device *dev = screen->device;
|
||||
|
||||
info->total_device_memory = dev->vram_size / 1024;
|
||||
info->total_staging_memory = dev->gart_size / 1024;
|
||||
|
||||
info->avail_device_memory = dev->vram_limit / 1024;
|
||||
info->avail_staging_memory = dev->gart_limit / 1024;
|
||||
}
|
||||
|
||||
int
|
||||
nouveau_screen_init(struct nouveau_screen *screen, struct nouveau_device *dev)
|
||||
{
|
||||
|
|
@ -325,6 +339,8 @@ nouveau_screen_init(struct nouveau_screen *screen, struct nouveau_device *dev)
|
|||
pscreen->fence_reference = nouveau_screen_fence_ref;
|
||||
pscreen->fence_finish = nouveau_screen_fence_finish;
|
||||
|
||||
pscreen->query_memory_info = nouveau_query_memory_info;
|
||||
|
||||
nouveau_disk_cache_create(screen);
|
||||
|
||||
screen->transfer_pushbuf_threshold = 192;
|
||||
|
|
|
|||
|
|
@ -100,6 +100,7 @@ nv30_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
|
|||
case PIPE_CAP_VERTEX_BUFFER_STRIDE_4BYTE_ALIGNED_ONLY:
|
||||
case PIPE_CAP_VERTEX_ELEMENT_SRC_OFFSET_4BYTE_ALIGNED_ONLY:
|
||||
case PIPE_CAP_ALLOW_MAPPED_BUFFERS_DURING_EXECUTION:
|
||||
case PIPE_CAP_QUERY_MEMORY_INFO:
|
||||
return 1;
|
||||
case PIPE_CAP_TEXTURE_TRANSFER_MODES:
|
||||
return PIPE_TEXTURE_TRANSFER_BLIT;
|
||||
|
|
@ -201,7 +202,6 @@ nv30_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
|
|||
case PIPE_CAP_BUFFER_SAMPLER_VIEW_RGBA_ONLY:
|
||||
case PIPE_CAP_SURFACE_REINTERPRET_BLOCKS:
|
||||
case PIPE_CAP_QUERY_BUFFER_OBJECT:
|
||||
case PIPE_CAP_QUERY_MEMORY_INFO:
|
||||
case PIPE_CAP_PCI_GROUP:
|
||||
case PIPE_CAP_PCI_BUS:
|
||||
case PIPE_CAP_PCI_DEVICE:
|
||||
|
|
|
|||
|
|
@ -269,6 +269,7 @@ nv50_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
|
|||
case PIPE_CAP_ALLOW_DYNAMIC_VAO_FASTPATH:
|
||||
case PIPE_CAP_SHAREABLE_SHADERS:
|
||||
case PIPE_CAP_PREFER_BACK_BUFFER_REUSE:
|
||||
case PIPE_CAP_QUERY_MEMORY_INFO:
|
||||
return 1;
|
||||
|
||||
case PIPE_CAP_ALPHA_TEST:
|
||||
|
|
@ -327,7 +328,6 @@ nv50_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
|
|||
case PIPE_CAP_BUFFER_SAMPLER_VIEW_RGBA_ONLY:
|
||||
case PIPE_CAP_SURFACE_REINTERPRET_BLOCKS:
|
||||
case PIPE_CAP_QUERY_BUFFER_OBJECT:
|
||||
case PIPE_CAP_QUERY_MEMORY_INFO:
|
||||
case PIPE_CAP_PCI_GROUP:
|
||||
case PIPE_CAP_PCI_BUS:
|
||||
case PIPE_CAP_PCI_DEVICE:
|
||||
|
|
|
|||
|
|
@ -317,6 +317,7 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
|
|||
case PIPE_CAP_ALLOW_DYNAMIC_VAO_FASTPATH:
|
||||
case PIPE_CAP_SHAREABLE_SHADERS:
|
||||
case PIPE_CAP_PREFER_BACK_BUFFER_REUSE:
|
||||
case PIPE_CAP_QUERY_MEMORY_INFO:
|
||||
return 1;
|
||||
case PIPE_CAP_TEXTURE_TRANSFER_MODES:
|
||||
return nouveau_screen(pscreen)->vram_domain & NOUVEAU_BO_VRAM ? PIPE_TEXTURE_TRANSFER_BLIT : 0;
|
||||
|
|
@ -377,7 +378,6 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
|
|||
case PIPE_CAP_GENERATE_MIPMAP:
|
||||
case PIPE_CAP_BUFFER_SAMPLER_VIEW_RGBA_ONLY:
|
||||
case PIPE_CAP_SURFACE_REINTERPRET_BLOCKS:
|
||||
case PIPE_CAP_QUERY_MEMORY_INFO:
|
||||
case PIPE_CAP_PCI_GROUP:
|
||||
case PIPE_CAP_PCI_BUS:
|
||||
case PIPE_CAP_PCI_DEVICE:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue