[Mesa-dev] [PATCH 00/10] panfrost: Try to make BO handling more consistent

Tomeu Vizoso tomeu at tomeuvizoso.net
Tue Jul 2 14:57:52 UTC 2019


On Tue, 2 Jul 2019 at 15:24, Boris Brezillon
<boris.brezillon at collabora.com> wrote:
>
> 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.

Looks great to me, will be a pleasure to rebase my modifiers work on
top of this.

Reviewed-by: Tomeu Vizoso <tomeu.vizoso at collabora.com>

Thanks,

Tomeu

> 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
>


More information about the mesa-dev mailing list