panvk: Add a decode context at the panvk_device level

For now it points to panfrost_device::decode_ctx, but it will be
explicitly instantiated when we move away from panfrost_{device,bo}.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Constantine Shablya <constantine.shablya@collabora.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26698>
This commit is contained in:
Boris Brezillon
2023-12-12 12:26:48 +01:00
committed by Marge Bot
parent acdcf5c0a1
commit d155d6b7a3
3 changed files with 14 additions and 6 deletions

View File

@@ -28,6 +28,8 @@
#include "panvk_private.h"
#include "decode.h"
#include "pan_bo.h"
#include "pan_encoder.h"
#include "pan_util.h"
@@ -967,6 +969,8 @@ panvk_CreateDevice(VkPhysicalDevice physicalDevice,
}
}
device->debug.decode_ctx = device->pdev.decode_ctx;
*pDevice = panvk_device_to_handle(device);
return VK_SUCCESS;

View File

@@ -261,6 +261,11 @@ struct panvk_device {
int queue_count[PANVK_MAX_QUEUE_FAMILIES];
struct panvk_physical_device *physical_device;
struct {
struct pandecode_context *decode_ctx;
} debug;
int _lost;
};

View File

@@ -42,7 +42,6 @@ panvk_queue_submit_batch(struct panvk_queue *queue, struct panvk_batch *batch,
{
const struct panvk_device *dev = queue->device;
unsigned debug = dev->physical_device->instance->debug_flags;
const struct panfrost_device *pdev = &dev->pdev;
int ret;
/* Reset the batch if it's already been issued */
@@ -77,12 +76,12 @@ panvk_queue_submit_batch(struct panvk_queue *queue, struct panvk_batch *batch,
}
if (debug & PANVK_DEBUG_TRACE) {
pandecode_jc(pdev->decode_ctx, batch->jc.first_job,
pandecode_jc(dev->debug.decode_ctx, batch->jc.first_job,
dev->physical_device->kmod.props.gpu_prod_id);
}
if (debug & PANVK_DEBUG_DUMP)
pandecode_dump_mappings(pdev->decode_ctx);
pandecode_dump_mappings(dev->debug.decode_ctx);
}
if (batch->fragment_job) {
@@ -111,15 +110,15 @@ panvk_queue_submit_batch(struct panvk_queue *queue, struct panvk_batch *batch,
}
if (debug & PANVK_DEBUG_TRACE)
pandecode_jc(pdev->decode_ctx, batch->fragment_job,
pandecode_jc(dev->debug.decode_ctx, batch->fragment_job,
dev->physical_device->kmod.props.gpu_prod_id);
if (debug & PANVK_DEBUG_DUMP)
pandecode_dump_mappings(pdev->decode_ctx);
pandecode_dump_mappings(dev->debug.decode_ctx);
}
if (debug & PANVK_DEBUG_TRACE)
pandecode_next_frame(pdev->decode_ctx);
pandecode_next_frame(dev->debug.decode_ctx);
batch->issued = true;
}