Hello, This patch series is an attempt at making memory allocation more consistent by implementing SLAB pool allocation around the BO allocation logic. Note that my initial goal was to pass referenced BOs to the kernel driver, but I've decided to clean things up along the way (just let me know if you think it was a mistake).
The first 4 patches are simple cleanups and could have been sent separately, but it's easier for me to post everything as a single series to avoid dependency issues. Patch 5 might be a bit more controversial, as I move some of the fields that were in panfrost_bo to panfrost_resource. The rationale here being that other drivers (vc4, freedreno, ...) seem to keep _bo objects as simple memory backing objs that do not contain any meta data describing the buffer content. This approach allows us to re-use those objects to allocate anything, not only texture or FB resources. Again, if you think that's a wrong decision, let me know. Patch 6 is in the same vein, it makes BO import/export functions more generic so they can be used for !winsys bufs. Patches 7-9 are here to re-use the BO creation/destruction logic as much as possible instead of duplicating the code or having convoluted code doing panfrost_bo <-> panfrost_memory conversions. And finally, patch 10 is making use of all the changes described above to pass all referenced BOs to the kernel driver when a job is submitted, thus making sure the job will wait for all resources to be ready before being scheduled. I know there's a lot going on in the panfrost area right now, and some of what I'm proposing here might be irrelevant or might have to be ported on top of other changes (which is fine). Let me know if that's the case. Regards, Boris Boris Brezillon (10): panfrost: Move scanout res creation out of panfrost_resource_create() panfrost: Get rid of the panfrost_driver abstraction leftovers panfrost: Get rid of the "free imported BO" logic panfrost: Stop exposing internal panfrost_drm_*() functions panfrost: Move BO meta-data out of panfrost_bo panfrost: Avoid passing winsys handles to import/export BO funcs panfrost: Move the mmap BO logic out of panfrost_drm_import_bo() panfrost: Add the panfrost_drm_{create,release}_bo() helpers panfrost: Make SLAB pool creation rely on BO helpers panfrost: Pass referenced BOs to the SUBMIT ioctls src/gallium/drivers/panfrost/pan_allocate.c | 21 +- src/gallium/drivers/panfrost/pan_allocate.h | 22 +- src/gallium/drivers/panfrost/pan_context.c | 40 +-- src/gallium/drivers/panfrost/pan_drm.c | 263 +++++++++--------- src/gallium/drivers/panfrost/pan_drm.h | 32 --- src/gallium/drivers/panfrost/pan_fragment.c | 2 +- src/gallium/drivers/panfrost/pan_mfbd.c | 24 +- src/gallium/drivers/panfrost/pan_resource.c | 242 ++++++++-------- src/gallium/drivers/panfrost/pan_resource.h | 42 +-- src/gallium/drivers/panfrost/pan_scoreboard.c | 2 +- src/gallium/drivers/panfrost/pan_screen.c | 2 - src/gallium/drivers/panfrost/pan_screen.h | 17 +- src/gallium/drivers/panfrost/pan_sfbd.c | 8 +- 13 files changed, 333 insertions(+), 384 deletions(-) delete mode 100644 src/gallium/drivers/panfrost/pan_drm.h -- 2.21.0 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev