diff options
author | Alyssa Rosenzweig <[email protected]> | 2019-02-15 00:15:14 +0000 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2019-02-18 05:10:06 +0000 |
commit | 4a4ed53c012c39c3a0781c7944f9449e258ada1d (patch) | |
tree | a13d58dff141632ab8172b8e1843cd29d7832f3d /src/gallium | |
parent | b5a01296f408441bda32f484da81620f7fc7e39f (diff) |
panfrost: Free imported BOs
Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/drivers/panfrost/pan_resource.c | 4 | ||||
-rw-r--r-- | src/gallium/drivers/panfrost/pan_resource.h | 6 | ||||
-rw-r--r-- | src/gallium/drivers/panfrost/pan_screen.h | 2 |
3 files changed, 12 insertions, 0 deletions
diff --git a/src/gallium/drivers/panfrost/pan_resource.c b/src/gallium/drivers/panfrost/pan_resource.c index 1287193c0e9..26f4782a4ad 100644 --- a/src/gallium/drivers/panfrost/pan_resource.c +++ b/src/gallium/drivers/panfrost/pan_resource.c @@ -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 diff --git a/src/gallium/drivers/panfrost/pan_resource.h b/src/gallium/drivers/panfrost/pan_resource.h index af92fa48ec9..dea2332dbfa 100644 --- a/src/gallium/drivers/panfrost/pan_resource.h +++ b/src/gallium/drivers/panfrost/pan_resource.h @@ -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; diff --git a/src/gallium/drivers/panfrost/pan_screen.h b/src/gallium/drivers/panfrost/pan_screen.h index afb3d34b5b1..646923c9864 100644 --- a/src/gallium/drivers/panfrost/pan_screen.h +++ b/src/gallium/drivers/panfrost/pan_screen.h @@ -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); }; |