linux-xiaomi-chiron/drivers/gpu/drm/panfrost
Boris Brezillon bdefca2d8d drm/panfrost: Add the panfrost_gem_mapping concept
With the introduction of per-FD address space, the same BO can be mapped
in different address space if the BO is globally visible (GEM_FLINK)
and opened in different context or if the dmabuf is self-imported. The
current implementation does not take case into account, and attaches the
mapping directly to the panfrost_gem_object.

Let's create a panfrost_gem_mapping struct and allow multiple mappings
per BO.

The mappings are refcounted which helps solve another problem where
mappings were torn down (GEM handle closed by userspace) while GPU
jobs accessing those BOs were still in-flight. Jobs now keep a
reference on the mappings they use.

v2 (robh):
- Minor review comment clean-ups from Steven
- Use list_is_singular helper
- Just WARN if we add a mapping when madvise state is not WILLNEED.
  With that, drop the use of object_name_lock.

v3 (robh):
- Revert returning list iterator in panfrost_gem_mapping_get()

Fixes: a5efb4c9a5 ("drm/panfrost: Restructure the GEM object creation")
Fixes: 7282f7645d ("drm/panfrost: Implement per FD address spaces")
Cc: <stable@vger.kernel.org>
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: Rob Herring <robh@kernel.org>
Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Steven Price <steven.price@arm.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200116021554.15090-1-robh@kernel.org
2020-01-21 10:32:55 -06:00
..
Kconfig drm/panfrost: Require the simple_ondemand governor 2019-06-10 09:30:34 -06:00
Makefile drm/panfrost: Add madvise and shrinker support 2019-08-08 15:57:36 -06:00
panfrost_devfreq.c drm/panfrost: devfreq: Round frequencies to OPPs 2019-12-06 11:05:39 -06:00
panfrost_devfreq.h drm/panfrost: Simplify devfreq utilisation tracking 2019-10-29 13:01:51 -05:00
panfrost_device.c drm/panfrost: Fix regulator_get_optional() misuse 2019-09-19 11:45:44 -05:00
panfrost_device.h drm/panfrost: Simplify devfreq utilisation tracking 2019-10-29 13:01:51 -05:00
panfrost_drv.c drm/panfrost: Add the panfrost_gem_mapping concept 2020-01-21 10:32:55 -06:00
panfrost_features.h drm/panfrost: Add initial panfrost driver 2019-04-12 12:56:46 -05:00
panfrost_gem.c drm/panfrost: Add the panfrost_gem_mapping concept 2020-01-21 10:32:55 -06:00
panfrost_gem.h drm/panfrost: Add the panfrost_gem_mapping concept 2020-01-21 10:32:55 -06:00
panfrost_gem_shrinker.c drm/panfrost: Add the panfrost_gem_mapping concept 2020-01-21 10:32:55 -06:00
panfrost_gpu.c drm/panfrost: Add missing GPU feature registers 2019-10-14 13:46:48 -05:00
panfrost_gpu.h drm/panfrost: Add initial panfrost driver 2019-04-12 12:56:46 -05:00
panfrost_issues.h drm/panfrost: Add errata descriptions from kbase 2019-08-23 12:16:27 -05:00
panfrost_job.c drm/panfrost: Add the panfrost_gem_mapping concept 2020-01-21 10:32:55 -06:00
panfrost_job.h drm/panfrost: Add the panfrost_gem_mapping concept 2020-01-21 10:32:55 -06:00
panfrost_mmu.c drm/panfrost: Add the panfrost_gem_mapping concept 2020-01-21 10:32:55 -06:00
panfrost_mmu.h drm/panfrost: Add the panfrost_gem_mapping concept 2020-01-21 10:32:55 -06:00
panfrost_perfcnt.c drm/panfrost: Add the panfrost_gem_mapping concept 2020-01-21 10:32:55 -06:00
panfrost_perfcnt.h drm/panfrost: Open/close the perfcnt BO 2019-12-06 11:06:20 -06:00
panfrost_regs.h drm/panfrost: Expose performance counters through unstable ioctls 2019-06-18 09:23:48 -06:00
TODO drm/panfrost: Remove commented out call to panfrost_core_dump 2019-10-09 13:36:56 -05:00