* 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 |
* 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);
}
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(
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,
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);
}
{
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).
*/
#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)
{
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;
}
/* 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
* 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) {
/* 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 */
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 */
#include "drm-uapi/panfrost_drm.h"
#include "pan_bo.h"
+#include "pan_util.h"
+#include "../pandecode/public.h"
#include "os/os_mman.h"
_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;
}