Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Dave Airlie
mesa
Commits
62ffca7d
Commit
62ffca7d
authored
Nov 16, 2022
by
Dave Airlie
Browse files
Add sparse image binding
parent
41a121fc
Pipeline
#739381
waiting for manual action with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/nouveau/vulkan/nvk_queue_drm_nouveau.c
View file @
62ffca7d
...
...
@@ -5,6 +5,7 @@
#include
"nvk_cmd_pool.h"
#include
"nvk_device.h"
#include
"nvk_buffer.h"
#include
"nvk_image.h"
#include
"nvk_device_memory.h"
#include
"nvk_physical_device.h"
...
...
@@ -168,6 +169,27 @@ push_add_buffer_bind(struct push_builder *pb,
#endif
}
static
void
push_add_image_opaque_bind
(
struct
push_builder
*
pb
,
VkSparseImageOpaqueMemoryBindInfo
*
bind_info
)
{
#if NVK_NEW_UAPI == 1
VK_FROM_HANDLE
(
nvk_image
,
image
,
bind_info
->
image
);
for
(
unsigned
i
=
0
;
i
<
bind_info
->
bindCount
;
i
++
)
{
const
VkSparseMemoryBind
*
bind
=
&
bind_info
->
pBinds
[
i
];
VK_FROM_HANDLE
(
nvk_device_memory
,
mem
,
bind
->
memory
);
pb
->
bind_ops
[
pb
->
vmbind
.
op_count
++
]
=
(
struct
drm_nouveau_vm_bind_op
)
{
.
op
=
DRM_NOUVEAU_VM_BIND_OP_MAP
,
.
handle
=
mem
->
bo
->
handle
,
.
addr
=
image
->
addr
+
bind
->
resourceOffset
,
.
bo_offset
=
bind
->
memoryOffset
,
.
range
=
bind
->
size
,
.
flags
=
image
->
nil
.
pte_kind
,
};
}
#endif
}
static
void
push_add_push
(
struct
push_builder
*
pb
,
struct
nouveau_ws_bo
*
bo
,
uint32_t
dw_offset
,
uint32_t
dw_count
)
...
...
@@ -320,7 +342,7 @@ nvk_queue_submit_drm_nouveau(struct nvk_queue *queue,
struct
nvk_device
*
dev
=
nvk_queue_device
(
queue
);
struct
push_builder
pb
;
VkResult
result
;
bool
is_vmbind
=
submit
->
buffer_bind_count
>
0
;
bool
is_vmbind
=
submit
->
buffer_bind_count
>
0
||
submit
->
image_opaque_bind_count
>
0
;
if
(
is_vmbind
)
assert
(
submit
->
command_buffer_count
==
0
);
...
...
@@ -339,6 +361,10 @@ nvk_queue_submit_drm_nouveau(struct nvk_queue *queue,
push_add_buffer_bind
(
&
pb
,
&
submit
->
buffer_binds
[
i
]);
}
for
(
uint32_t
i
=
0
;
i
<
submit
->
image_opaque_bind_count
;
i
++
)
{
push_add_image_opaque_bind
(
&
pb
,
&
submit
->
image_opaque_binds
[
i
]);
}
if
(
submit
->
command_buffer_count
==
0
)
{
push_add_push
(
&
pb
,
queue
->
empty_push
,
0
,
queue
->
empty_push_dw_count
);
}
else
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment