mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-31 20:40:09 +01:00
panfrost: Drop Gallium-local pan_bo_create wrapper
We can handle pandecode in shared code now, which will matter for tracing non-Gallium drivers. Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5794>
This commit is contained in:
parent
ed1910dc68
commit
1d88f07820
7 changed files with 20 additions and 32 deletions
|
|
@ -86,7 +86,7 @@ panfrost_pool_alloc(struct pan_pool *pool, size_t sz)
|
|||
* flags to this function and keep the read/write,
|
||||
* fragment/vertex+tiler pools separate.
|
||||
*/
|
||||
bo = pan_bo_create(pool->dev, bo_sz, 0);
|
||||
bo = panfrost_bo_create(pool->dev, bo_sz, 0);
|
||||
|
||||
uintptr_t flags = PAN_BO_ACCESS_PRIVATE |
|
||||
PAN_BO_ACCESS_RW |
|
||||
|
|
|
|||
|
|
@ -181,7 +181,7 @@ panfrost_shader_compile(struct panfrost_context *ctx,
|
|||
* that's how I'd do it. */
|
||||
|
||||
if (size) {
|
||||
state->bo = pan_bo_create(dev, size, PAN_BO_EXECUTE);
|
||||
state->bo = panfrost_bo_create(dev, size, PAN_BO_EXECUTE);
|
||||
memcpy(state->bo->cpu, dst, size);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -969,7 +969,7 @@ panfrost_create_sampler_view_bo(struct panfrost_sampler_view *so,
|
|||
so->base.u.tex.last_layer,
|
||||
type, prsrc->layout);
|
||||
|
||||
so->bo = pan_bo_create(device, size, 0);
|
||||
so->bo = panfrost_bo_create(device, size, 0);
|
||||
|
||||
so->bifrost_descriptor = rzalloc(pctx, struct bifrost_texture_descriptor);
|
||||
panfrost_new_texture_bifrost(
|
||||
|
|
@ -997,7 +997,7 @@ panfrost_create_sampler_view_bo(struct panfrost_sampler_view *so,
|
|||
type, prsrc->layout);
|
||||
size += sizeof(struct mali_texture_descriptor);
|
||||
|
||||
so->bo = pan_bo_create(device, size, 0);
|
||||
so->bo = panfrost_bo_create(device, size, 0);
|
||||
|
||||
panfrost_new_texture(
|
||||
so->bo->cpu,
|
||||
|
|
@ -1279,7 +1279,7 @@ panfrost_begin_query(struct pipe_context *pipe, struct pipe_query *q)
|
|||
case PIPE_QUERY_OCCLUSION_PREDICATE_CONSERVATIVE:
|
||||
/* Allocate a bo for the query results to be stored */
|
||||
if (!query->bo) {
|
||||
query->bo = pan_bo_create(
|
||||
query->bo = panfrost_bo_create(
|
||||
pan_device(ctx->base.screen),
|
||||
sizeof(unsigned), 0);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -629,12 +629,12 @@ panfrost_batch_create_bo(struct panfrost_batch *batch, size_t size,
|
|||
{
|
||||
struct panfrost_bo *bo;
|
||||
|
||||
bo = pan_bo_create(pan_device(batch->ctx->base.screen), size,
|
||||
bo = panfrost_bo_create(pan_device(batch->ctx->base.screen), size,
|
||||
create_flags);
|
||||
panfrost_batch_add_bo(batch, bo, access_flags);
|
||||
|
||||
/* panfrost_batch_add_bo() has retained a reference and
|
||||
* pan_bo_create() initialize the refcnt to 1, so let's
|
||||
* panfrost_bo_create() initialize the refcnt to 1, so let's
|
||||
* unreference the BO here so it gets released when the batch is
|
||||
* destroyed (unless it's retained by someone else in the meantime).
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -50,23 +50,6 @@
|
|||
#include "pandecode/decode.h"
|
||||
#include "panfrost-quirks.h"
|
||||
|
||||
/* Wrapper around panfrost_bo_create that handles pandecode */
|
||||
|
||||
struct panfrost_bo *
|
||||
pan_bo_create(struct panfrost_device *dev, size_t size, uint32_t flags)
|
||||
{
|
||||
struct panfrost_bo *bo = panfrost_bo_create(dev, size, flags);
|
||||
|
||||
if (dev->debug & (PAN_DBG_TRACE | PAN_DBG_SYNC)) {
|
||||
if (flags & PAN_BO_INVISIBLE)
|
||||
pandecode_inject_mmap(bo->gpu, NULL, bo->size, NULL);
|
||||
else if (!(flags & PAN_BO_DELAY_MMAP))
|
||||
pandecode_inject_mmap(bo->gpu, bo->cpu, bo->size, NULL);
|
||||
}
|
||||
|
||||
return bo;
|
||||
}
|
||||
|
||||
void
|
||||
panfrost_resource_reset_damage(struct panfrost_resource *pres)
|
||||
{
|
||||
|
|
@ -113,7 +96,7 @@ panfrost_resource_from_handle(struct pipe_screen *pscreen,
|
|||
templat->bind & PIPE_BIND_RENDER_TARGET) {
|
||||
unsigned size = panfrost_compute_checksum_size(
|
||||
&rsc->slices[0], templat->width0, templat->height0);
|
||||
rsc->slices[0].checksum_bo = pan_bo_create(dev, size, 0);
|
||||
rsc->slices[0].checksum_bo = panfrost_bo_create(dev, size, 0);
|
||||
rsc->checksummed = true;
|
||||
}
|
||||
|
||||
|
|
@ -448,7 +431,7 @@ panfrost_resource_create_bo(struct panfrost_device *dev, struct panfrost_resourc
|
|||
|
||||
/* We create a BO immediately but don't bother mapping, since we don't
|
||||
* care to map e.g. FBOs which the CPU probably won't touch */
|
||||
pres->bo = pan_bo_create(dev, bo_size, PAN_BO_DELAY_MMAP);
|
||||
pres->bo = panfrost_bo_create(dev, bo_size, PAN_BO_DELAY_MMAP);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -650,7 +633,7 @@ panfrost_transfer_map(struct pipe_context *pctx,
|
|||
* doing to it.
|
||||
*/
|
||||
if (!(bo->flags & (PAN_BO_IMPORTED | PAN_BO_EXPORTED)))
|
||||
newbo = pan_bo_create(dev, bo->size,
|
||||
newbo = panfrost_bo_create(dev, bo->size,
|
||||
flags);
|
||||
|
||||
if (newbo) {
|
||||
|
|
@ -952,7 +935,7 @@ panfrost_resource_hint_layout(
|
|||
/* If we grew in size, reallocate the BO */
|
||||
if (new_size > rsrc->bo->size) {
|
||||
panfrost_bo_unreference(rsrc->bo);
|
||||
rsrc->bo = pan_bo_create(dev, new_size, PAN_BO_DELAY_MMAP);
|
||||
rsrc->bo = panfrost_bo_create(dev, new_size, PAN_BO_DELAY_MMAP);
|
||||
}
|
||||
|
||||
/* TODO: If there are textures bound, regenerate their descriptors */
|
||||
|
|
|
|||
|
|
@ -126,8 +126,4 @@ panfrost_resource_set_damage_region(struct pipe_screen *screen,
|
|||
unsigned int nrects,
|
||||
const struct pipe_box *rects);
|
||||
|
||||
|
||||
struct panfrost_bo *
|
||||
pan_bo_create(struct panfrost_device *dev, size_t size, uint32_t flags);
|
||||
|
||||
#endif /* PAN_RESOURCE_H */
|
||||
|
|
|
|||
|
|
@ -31,6 +31,8 @@
|
|||
#include "drm-uapi/panfrost_drm.h"
|
||||
|
||||
#include "pan_bo.h"
|
||||
#include "pan_util.h"
|
||||
#include "../pandecode/public.h"
|
||||
|
||||
#include "os/os_mman.h"
|
||||
|
||||
|
|
@ -405,6 +407,13 @@ panfrost_bo_create(struct panfrost_device *dev, size_t size,
|
|||
_mesa_set_add(bo->dev->active_bos, bo);
|
||||
pthread_mutex_unlock(&dev->active_bos_lock);
|
||||
|
||||
if (dev->debug & (PAN_DBG_TRACE | PAN_DBG_SYNC)) {
|
||||
if (flags & PAN_BO_INVISIBLE)
|
||||
pandecode_inject_mmap(bo->gpu, NULL, bo->size, NULL);
|
||||
else if (!(flags & PAN_BO_DELAY_MMAP))
|
||||
pandecode_inject_mmap(bo->gpu, bo->cpu, bo->size, NULL);
|
||||
}
|
||||
|
||||
return bo;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue