mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-04-18 14:40:40 +02:00
v3dv: clif format dumping support
Add support for V3D_DEBUG=clif. Useful to compare clif_dumps from vulkan small-programs and the equivalent opengl ones. As we are here we expand clif_dump_packet wrapper to use v3d42_clif_dump_packet if needed, as the vulkan driver would use that packet version. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
This commit is contained in:
parent
15fb14ca1e
commit
e252e536e4
3 changed files with 36 additions and 1 deletions
|
|
@ -105,7 +105,9 @@ static bool
|
|||
clif_dump_packet(struct clif_dump *clif, uint32_t offset, const uint8_t *cl,
|
||||
uint32_t *size, bool reloc_mode)
|
||||
{
|
||||
if (clif->devinfo->ver >= 41)
|
||||
if (clif->devinfo->ver >= 42)
|
||||
return v3d42_clif_dump_packet(clif, offset, cl, size, reloc_mode);
|
||||
else if (clif->devinfo->ver >= 41)
|
||||
return v3d41_clif_dump_packet(clif, offset, cl, size, reloc_mode);
|
||||
else
|
||||
return v3d33_clif_dump_packet(clif, offset, cl, size, reloc_mode);
|
||||
|
|
|
|||
|
|
@ -96,6 +96,7 @@ libvulkan_broadcom = shared_library(
|
|||
inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux, inc_broadcom, inc_compiler, inc_util,
|
||||
],
|
||||
link_with : [
|
||||
libbroadcom_cle,
|
||||
libbroadcom_v3d,
|
||||
# For glsl_type_singleton_init_or_ref:
|
||||
libglsl,
|
||||
|
|
|
|||
|
|
@ -24,8 +24,38 @@
|
|||
#include "v3dv_private.h"
|
||||
#include "drm-uapi/v3d_drm.h"
|
||||
|
||||
#include "broadcom/clif/clif_dump.h"
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
static void
|
||||
v3dv_clif_dump(struct v3dv_queue *queue,
|
||||
struct v3dv_cmd_buffer *cmd_buffer,
|
||||
struct drm_v3d_submit_cl *submit)
|
||||
{
|
||||
if (!(V3D_DEBUG & (V3D_DEBUG_CL | V3D_DEBUG_CLIF)))
|
||||
return;
|
||||
|
||||
struct clif_dump *clif = clif_dump_init(&queue->device->devinfo,
|
||||
stderr,
|
||||
V3D_DEBUG & V3D_DEBUG_CL);
|
||||
|
||||
set_foreach(cmd_buffer->bos, entry) {
|
||||
struct v3dv_bo *bo = (void *)entry->key;
|
||||
char *name = ralloc_asprintf(NULL, "%s_0x%x",
|
||||
"" /* bo->name */ , bo->offset);
|
||||
|
||||
v3dv_bo_map(queue->device, bo, bo->size);
|
||||
clif_dump_add_bo(clif, name, bo->offset, bo->size, bo->map);
|
||||
|
||||
ralloc_free(name);
|
||||
}
|
||||
|
||||
clif_dump(clif, submit);
|
||||
|
||||
clif_dump_destroy(clif);
|
||||
}
|
||||
|
||||
static VkResult
|
||||
queue_submit(struct v3dv_queue *queue,
|
||||
const VkSubmitInfo *pSubmit,
|
||||
|
|
@ -76,6 +106,8 @@ queue_submit(struct v3dv_queue *queue,
|
|||
assert(bo_idx == submit.bo_handle_count);
|
||||
submit.bo_handles = (uintptr_t)(void *)bo_handles;
|
||||
|
||||
v3dv_clif_dump(queue, cmd_buffer, &submit);
|
||||
|
||||
int ret = v3dv_ioctl(queue->device->fd, DRM_IOCTL_V3D_SUBMIT_CL, &submit);
|
||||
static bool warned = false;
|
||||
if (ret && !warned) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue