WIP: drm/tegra: Introduce new Host1x driver and new v2 UAPI
authorDmitry Osipenko <digetx@gmail.com>
Wed, 5 Dec 2018 13:31:12 +0000 (16:31 +0300)
committerDmitry Osipenko <digetx@gmail.com>
Sun, 10 Feb 2019 17:49:21 +0000 (20:49 +0300)
commit9aae414ed24822ab885c46b3795f5f6e0ff44d72
tree7acebbd63bf4d91fee09d7aa7401972c8a9e65b5
parent23f2863e528f183ce0dc4fa88e8de756a2ef2ac7
WIP: drm/tegra: Introduce new Host1x driver and new v2 UAPI

The new driver and UAPI provide all necessary features that are
necessary for implementing of a proper userspace driver. The new driver
takes a different approach in regards to working with sync points by
making each submitted job to take an individual sync point, this solves
the problem with the sync point recovery that old driver suffered from.
The new Host1x driver and v2 UAPI are optimized for performance and
minimal resources consumption. The new v2 UAPI exposes to userspace the HW
cmdstream-related features that are necessary for a proper HW fencing.
The staging v1 UAPI is kept functional and all of current userspace will
continue to work with the new driver, note that some of the
never-really-used features of v1 UAPI have been removed (like sync point
increment IOCTL) and will return EPERM.

Key moments of v2 UAPI:
- Raw sync points are not exposed to userspace.

- Job descriptors are embedded into the commands stream. Kernel
  driver parses the stream and patches the descriptors in-place.

- Commands buffer is copied from userspace via usrptr (no BO
  allocation and uncached-reading overhead).

- Channel is not restricted to a single client, thus 3d channel can
  take a multi-client job that uses 2d / 3d.

- Supports explicit jobs fencing. DRM sync object and DRM scheduler
  are utilized to provide the fencing support.

- Allows to use host1x gather opcode, which is restricted to
  data-upload usecase only. This allows userspace to pre-allocate
  a gather buffer, put shaders code / data there, and use two-word
  "gather" opcode to upload data from the buffer without pushing
  that data into the commands stream on each submission.
89 files changed:
drivers/gpu/drm/tegra/Kconfig
drivers/gpu/drm/tegra/Makefile
drivers/gpu/drm/tegra/channel.c [new file with mode: 0644]
drivers/gpu/drm/tegra/channel.h [new file with mode: 0644]
drivers/gpu/drm/tegra/client.c [new file with mode: 0644]
drivers/gpu/drm/tegra/client.h [new file with mode: 0644]
drivers/gpu/drm/tegra/dc.c
drivers/gpu/drm/tegra/drm.c
drivers/gpu/drm/tegra/drm.h
drivers/gpu/drm/tegra/fb.c
drivers/gpu/drm/tegra/gem.c
drivers/gpu/drm/tegra/gem.h
drivers/gpu/drm/tegra/gr2d.c
drivers/gpu/drm/tegra/gr2d.h
drivers/gpu/drm/tegra/gr3d.c
drivers/gpu/drm/tegra/uapi/debug.c [new file with mode: 0644]
drivers/gpu/drm/tegra/uapi/debug.h [new file with mode: 0644]
drivers/gpu/drm/tegra/uapi/gart.c [new file with mode: 0644]
drivers/gpu/drm/tegra/uapi/gart.h [new file with mode: 0644]
drivers/gpu/drm/tegra/uapi/job.h [new file with mode: 0644]
drivers/gpu/drm/tegra/uapi/job_v1.c [new file with mode: 0644]
drivers/gpu/drm/tegra/uapi/job_v2.c [new file with mode: 0644]
drivers/gpu/drm/tegra/uapi/patching.c [new file with mode: 0644]
drivers/gpu/drm/tegra/uapi/scheduler.c [new file with mode: 0644]
drivers/gpu/drm/tegra/uapi/scheduler.h [new file with mode: 0644]
drivers/gpu/drm/tegra/uapi/uapi.c [new file with mode: 0644]
drivers/gpu/drm/tegra/uapi/uapi.h [new file with mode: 0644]
drivers/gpu/drm/tegra/vic.c
drivers/gpu/host1x/Kconfig
drivers/gpu/host1x/Makefile
drivers/gpu/host1x/buffer_object.c [new file with mode: 0644]
drivers/gpu/host1x/bus.c
drivers/gpu/host1x/debug.c [new file with mode: 0644]
drivers/gpu/host1x/dev.c [deleted file]
drivers/gpu/host1x/dev.h [deleted file]
drivers/gpu/host1x/dma_pool.c [new file with mode: 0644]
drivers/gpu/host1x/fence.c [new file with mode: 0644]
drivers/gpu/host1x/host1x.c [new file with mode: 0644]
drivers/gpu/host1x/host1x.h [new file with mode: 0644]
drivers/gpu/host1x/iommu.c [new file with mode: 0644]
drivers/gpu/host1x/mipi.c
drivers/gpu/host1x/soc/channel.c [new file with mode: 0644]
drivers/gpu/host1x/soc/channel_hw.c [new file with mode: 0644]
drivers/gpu/host1x/soc/debug.c [new file with mode: 0644]
drivers/gpu/host1x/soc/host1x01.c [new file with mode: 0644]
drivers/gpu/host1x/soc/host1x01.h [new file with mode: 0644]
drivers/gpu/host1x/soc/host1x02.c [new file with mode: 0644]
drivers/gpu/host1x/soc/host1x02.h [new file with mode: 0644]
drivers/gpu/host1x/soc/host1x04.c [new file with mode: 0644]
drivers/gpu/host1x/soc/host1x04.h [new file with mode: 0644]
drivers/gpu/host1x/soc/host1x05.c [new file with mode: 0644]
drivers/gpu/host1x/soc/host1x05.h [new file with mode: 0644]
drivers/gpu/host1x/soc/host1x06.c [new file with mode: 0644]
drivers/gpu/host1x/soc/host1x06.h [new file with mode: 0644]
drivers/gpu/host1x/soc/host1x07.c [new file with mode: 0644]
drivers/gpu/host1x/soc/host1x07.h [new file with mode: 0644]
drivers/gpu/host1x/soc/hw/host1x01_hardware.h [new file with mode: 0644]
drivers/gpu/host1x/soc/hw/host1x02_hardware.h [new file with mode: 0644]
drivers/gpu/host1x/soc/hw/host1x04_hardware.h [new file with mode: 0644]
drivers/gpu/host1x/soc/hw/host1x05_hardware.h [new file with mode: 0644]
drivers/gpu/host1x/soc/hw/host1x06_hardware.h [new file with mode: 0644]
drivers/gpu/host1x/soc/hw/host1x07_hardware.h [new file with mode: 0644]
drivers/gpu/host1x/soc/hw/hw_host1x01_channel.h [new file with mode: 0644]
drivers/gpu/host1x/soc/hw/hw_host1x01_sync.h [new file with mode: 0644]
drivers/gpu/host1x/soc/hw/hw_host1x01_uclass.h [new file with mode: 0644]
drivers/gpu/host1x/soc/hw/hw_host1x02_channel.h [new file with mode: 0644]
drivers/gpu/host1x/soc/hw/hw_host1x02_sync.h [new file with mode: 0644]
drivers/gpu/host1x/soc/hw/hw_host1x02_uclass.h [new file with mode: 0644]
drivers/gpu/host1x/soc/hw/hw_host1x04_channel.h [new file with mode: 0644]
drivers/gpu/host1x/soc/hw/hw_host1x04_sync.h [new file with mode: 0644]
drivers/gpu/host1x/soc/hw/hw_host1x04_uclass.h [new file with mode: 0644]
drivers/gpu/host1x/soc/hw/hw_host1x05_channel.h [new file with mode: 0644]
drivers/gpu/host1x/soc/hw/hw_host1x05_sync.h [new file with mode: 0644]
drivers/gpu/host1x/soc/hw/hw_host1x05_uclass.h [new file with mode: 0644]
drivers/gpu/host1x/soc/hw/hw_host1x06_hypervisor.h [new file with mode: 0644]
drivers/gpu/host1x/soc/hw/hw_host1x06_uclass.h [new file with mode: 0644]
drivers/gpu/host1x/soc/hw/hw_host1x06_vm.h [new file with mode: 0644]
drivers/gpu/host1x/soc/hw/hw_host1x07_hypervisor.h [new file with mode: 0644]
drivers/gpu/host1x/soc/hw/hw_host1x07_uclass.h [new file with mode: 0644]
drivers/gpu/host1x/soc/hw/hw_host1x07_vm.h [new file with mode: 0644]
drivers/gpu/host1x/soc/mlocks.c [new file with mode: 0644]
drivers/gpu/host1x/soc/mlocks_hw.c [new file with mode: 0644]
drivers/gpu/host1x/soc/pushbuf.c [new file with mode: 0644]
drivers/gpu/host1x/soc/syncpoints.c [new file with mode: 0644]
drivers/gpu/host1x/soc/syncpoints_hw.c [new file with mode: 0644]
drivers/gpu/host1x/syncpt.c [deleted file]
drivers/i2c/busses/i2c-tegra.c
include/linux/host1x.h
include/uapi/drm/tegra_drm.h