mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-29 22:30:24 +01:00
nvk: Take GETPARAM_EXEC_PUSH_MAX into account
Reviewed-by: Danilo Krummrich <dakr@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25444>
This commit is contained in:
parent
0756a13aba
commit
fac31bb7bd
3 changed files with 12 additions and 3 deletions
|
|
@ -22,10 +22,11 @@
|
|||
|
||||
#define NVK_PUSH_MAX_SYNCS 16
|
||||
#define NVK_PUSH_MAX_BINDS 4096
|
||||
#define NVK_PUSH_MAX_PUSH NOUVEAU_GEM_MAX_PUSH
|
||||
#define NVK_PUSH_MAX_PUSH 1024
|
||||
|
||||
struct push_builder {
|
||||
struct nvk_device *dev;
|
||||
uint32_t max_push;
|
||||
struct drm_nouveau_sync req_wait[NVK_PUSH_MAX_SYNCS];
|
||||
struct drm_nouveau_sync req_sig[NVK_PUSH_MAX_SYNCS];
|
||||
struct drm_nouveau_exec_push req_push[NVK_PUSH_MAX_PUSH];
|
||||
|
|
@ -40,6 +41,8 @@ push_builder_init(struct nvk_device *dev, struct push_builder *pb,
|
|||
bool is_vmbind)
|
||||
{
|
||||
pb->dev = dev;
|
||||
pb->max_push = is_vmbind ? 0 :
|
||||
MIN2(NVK_PUSH_MAX_PUSH, dev->ws_dev->max_push);
|
||||
pb->req = (struct drm_nouveau_exec) {
|
||||
.channel = dev->ws_ctx->channel,
|
||||
.push_count = 0,
|
||||
|
|
@ -211,7 +214,7 @@ push_add_push(struct push_builder *pb, uint64_t addr, uint32_t range,
|
|||
if (no_prefetch)
|
||||
flags |= DRM_NOUVEAU_EXEC_PUSH_NO_PREFETCH;
|
||||
|
||||
assert(pb->req.push_count < NVK_PUSH_MAX_PUSH);
|
||||
assert(pb->req.push_count < pb->max_push);
|
||||
pb->req_push[pb->req.push_count++] = (struct drm_nouveau_exec_push) {
|
||||
.va = addr,
|
||||
.va_len = range,
|
||||
|
|
@ -332,7 +335,7 @@ nvk_queue_submit_drm_nouveau(struct nvk_queue *queue,
|
|||
if (push->range == 0)
|
||||
continue;
|
||||
|
||||
if (pb.req.push_count >= NVK_PUSH_MAX_PUSH) {
|
||||
if (pb.req.push_count >= pb.max_push) {
|
||||
VkResult result = push_submit(&pb, queue, sync);
|
||||
if (result != VK_SUCCESS)
|
||||
return result;
|
||||
|
|
|
|||
|
|
@ -303,6 +303,11 @@ nouveau_ws_device_new(drmDevicePtr drm_device)
|
|||
|
||||
device->fd = fd;
|
||||
|
||||
if (nouveau_ws_param(fd, NOUVEAU_GETPARAM_EXEC_PUSH_MAX, &value))
|
||||
device->max_push = NOUVEAU_GEM_MAX_PUSH;
|
||||
else
|
||||
device->max_push = value;
|
||||
|
||||
if (device->info.vram_size_B == 0)
|
||||
device->local_mem_domain = NOUVEAU_GEM_DOMAIN_GART;
|
||||
else
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ struct nouveau_ws_device {
|
|||
|
||||
struct nv_device_info info;
|
||||
|
||||
uint32_t max_push;
|
||||
uint32_t local_mem_domain;
|
||||
|
||||
enum nvk_debug debug_flags;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue