panfrost: Free imported BOs

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
This commit is contained in:
Alyssa Rosenzweig 2019-02-15 00:15:14 +00:00
parent b5a01296f4
commit 4a4ed53c01
3 changed files with 12 additions and 0 deletions

View file

@ -312,6 +312,10 @@ panfrost_destroy_bo(struct panfrost_screen *screen, struct panfrost_bo *pbo)
/* TODO */
printf("--leaking checksum (%zd bytes)--\n", bo->checksum_slab.size);
}
if (bo->imported) {
screen->driver->free_imported_bo(screen, bo);
}
}
static void

View file

@ -45,6 +45,12 @@ struct panfrost_bo {
/* Memory entry corresponding to gpu above */
struct panfrost_memory_entry *entry[MAX_MIP_LEVELS];
/* Set if this bo was imported rather than allocated */
bool imported;
/* Number of bytes of the imported allocation */
size_t imported_size;
/* Set for tiled, clear for linear. */
bool tiled;

View file

@ -60,6 +60,8 @@ struct panfrost_driver {
int extent);
void (*free_slab) (struct panfrost_screen *screen,
struct panfrost_memory *mem);
void (*free_imported_bo) (struct panfrost_screen *screen,
struct panfrost_bo *bo);
void (*enable_counters) (struct panfrost_screen *screen);
};