[PATCH RFC 000/111] Etnaviv DRM driver
Lucas Stach
l.stach at pengutronix.de
Thu Apr 2 08:29:02 PDT 2015
Hey all,
this is the Etnaviv DRM driver for Vivante embedded GPUs. It is heavily
influenced by the MSM driver, as can be clearly seen with the first commits.
The userspace interface does a look a lot like the MSM one, with some small
differences:
- Each GPU core is a pipe as with MSM, but Vivante doesn't have a strict
separation of tasks between the pipes. On some SoCs like the i.MX6 each
pipe feeds one rendering backend (2D, 3D, VG), but there are also SoCs
out there where on core (pipe) houses more than one backend. So pipes
on Etnaviv represent one core, that may be switched between multiple
execution state through the command stream. To allow for proper separation
between processes each process may specify the expected execution state
on submit.
- OR-ing and shifting of BO reloc addresses has been removed, as there is
need for this on Vivante GPUs. The register interface is designed in a way
that one always fills in complete 32bit addresses without any additional
informations.
- Presumption of BO addresses is not used right now, as the GPU MMU v1 can not
quarantee full protection. There is a 2GB window into physical memory without
any MMU translation in between, so we always have to process all relocs to guard
against malicious userspace. I've left it in the interface though as MMU v2
seems to be able to give full protection and it might become useful at that
point.
Unfinished stuff:
- GPU PM and context switching. This already works for the GPU 2D where there
isn't much state to retain on the GPU itself. For full context switching and
power down support on the GPU 3D the userspace needs to aid the kernel with a
context restore buffer. This part isn't done yet.
It's a rather long series. I already tried to squash some commits together, but
wanted to retain the authorship of the individual people that worked on this
driver for now. Maybe if everyone involved is okay with it we could squash some
of the fixup commits a bit more.
I've kept things in staging for now, as that's the place where Christian started
this driver, but would really like to move it to DRM proper _before_ merging. So
please review stuff with that in mind.
Russell King has some experimental support in the xf86-video-armada driver to
get some X accel running atop of this. I have a working libdrm/MESA stack that
basically works for some simple applications, but needs a good deal more work to
clean up.
If you would like to look at this stuff as a git tree feel free to fetch:
git://git.pengutronix.de/git/lst/linux.git etnaviv-for-upstream
Regards,
Lucas
Christian Gmeiner (2):
staging: etnaviv: add drm driver
staging: etnaviv: quiten down kernel log output
Lucas Stach (28):
staging: etnaviv: add devicetree bindings
staging: etnaviv: import new headers
staging: etnaviv: remove IOMMUv2 stubs
staging: etnaviv: allow to draw up to 256 rectangles in one draw call
staging: etnaviv: align command stream size to 64 bit
staging: etnaviv: correct instruction count for GC2000 and GC880
staging: etnaviv: reconfigure bus mapping on GC2000
staging: etnaviv: fix cache cleaning for uncached SHM buffers
staging: etnaviv: properly flush all TLBs on MMUv1
staging: etnaviv: convert to_etnaviv_bo() to real function
staging: etnaviv: take gpu instead of pipe as input to fence wait
function
staging: etnaviv: plug in fence waiting in cpu_prepare
staging: etnaviv: allow to map buffer object into multiple address
spaces
staging: etnaviv: don't pretend to have a single MMU
staging: etnaviv: use GPU device to construct MMU
staging: etnaviv: flush MMU when switching context
staging: etnaviv: add flag to force buffer through MMU
staging: etnaviv: use more natural devicetree abstraction
staging: etnaviv: don't override platform provided IRQ flags
staging: etnaviv: separate GPU pipes from execution state
staging: etnaviv: make sure to unlock DRM mutex when component bind
fails
staging: etnaviv: clean up public API
staging: etnaviv: prune dumb buffer support
staging: etnaviv: properly prefix all prime functions to etnaviv
staging: etnaviv: rename last remaining bits from msm to etnaviv
staging: etnaviv: add proper license header to all files
staging: etnaviv: some final trivial changes to the module
ARM: imx6: add Vivante GPU nodes
Philipp Zabel (1):
of: Add vendor prefix for Vivante Corporation
Russell King (80):
staging: etnaviv: fix oops on unbind
staging: etnaviv: fix oops in timer subsystem caused by hangcheck
timer
staging: etnaviv: fix etnaviv_add_components()
staging: etnaviv: fix etnaviv_hw_reset()
staging: etnaviv: fix etnaviv gpu debugfs output
staging: etnaviv: fix fence implementation
staging: etnaviv: fix buffer dumping code
staging: etnaviv: fix ring buffer overflow check
staging: etnaviv: fix cleanup of imported dmabufs
staging: etnaviv: fix printk formats
staging: etnaviv: validation: ensure space for the LINK command
staging: etnaviv: validation: improve command buffer size checks
staging: etnaviv: validation: improve relocation validation
staging: etnaviv: fix sparse warnings
staging: etnaviv: use devm_ioremap_resource()
staging: etnaviv: respect the submission command offset
staging: etnaviv: add an offset for buffer dumping
staging: etnaviv: quieten down submission debugging
staging: etnaviv: fix multiple command buffer submission in
etnaviv_buffer_queue()
staging: etnaviv: package up events into etnaviv_event struct
staging: etnaviv: track the last known GPU position
staging: etnaviv: ensure that ring buffer wraps
staging: etnaviv: fix checkpatch errors
staging: etnaviv: fix checkpatch warnings
staging: etnaviv: fix get_pages() failure path
staging: etnaviv: add gem operations structure to etnaviv objects
staging: etnaviv: convert prime import to use etnaviv_gem_ops
staging: etnaviv: convert shmem release to use etnaviv_gem_ops
staging: etnaviv: convert cmdbuf release to use etnaviv_gem_ops
staging: etnaviv: move drm_gem_object_release()
staging: etnaviv: ensure cleanup of reservation object
staging: etnaviv: clean up etnaviv_gem_free_object()
staging: etnaviv: provide etnaviv_gem_new_private()
staging: etnaviv: move msm_gem_import() etc to etnaviv_gem_prime.c
staging: etnaviv: clean up prime import
staging: etnaviv: convert get_pages()/put_pages() to take etnaviv_obj
staging: etnaviv: clean up etnaviv_gem_{get,put}_pages()
staging: etnaviv: add gem get_pages() method
staging: etnaviv: fix DMA API usage
staging: etnaviv: add support to insert a MMU flush into GPU stream
staging: etnaviv: move GPU memory management into MMU
staging: etnaviv: publish and use mmu geometry
staging: etnaviv: mmuv1: ensure we unmap all entries
staging: etnaviv: move MMU setup and teardown code to etnaviv_mmu.c
staging: etnaviv: hack: bypass iommu with contiguous buffers
staging: etnaviv: implement round-robin GPU MMU allocation
staging: etnaviv: fix etnaviv_iommu_map_gem() return paths
staging: etnaviv: implement MMU reaping
staging: etnaviv: move scatterlist creation to etnaviv_gem_get_pages()
staging: etnaviv: add userptr mapping support
staging: etnaviv: call the DRM device 'drm'
staging: etnaviv: clean up printk()s etc
staging: etnaviv: safely take down hangcheck
staging: etnaviv: move hangcheck disable to separate function
staging: etnaviv: stop the hangcheck timer mis-firing
staging: etnaviv: ensure that we retire all pending events
staging: etnaviv: ensure GPU reset times out
staging: etnaviv: add workarounds for GC320 on iMX6
staging: etnaviv: increase iommu page table size to 512KiB
staging: etnaviv: allow non-DT use
staging: etnaviv: dump mmu allocations
staging: etnaviv: use definitions for constants
staging: etnaviv: fix fence wrapping for gem objects
staging: etnaviv: move scatterlist map/unmap
staging: etnaviv: remove presumption of BO addresses
staging: etnaviv: clean up etnaviv mmu scatterlist code
staging: etnaviv: "better" DMA API usage
staging: etnaviv: iommu: add a poisoned bad page
staging: etnaviv: validate user supplied command stream
staging: etnaviv: allow get_param without auth
staging: etnaviv: fix busy reporting
staging: etnaviv: fix event allocation failure path
staging: etnaviv: remove powerrail support
staging: etnaviv: NULL out stale pointers at unbind time
staging: etnaviv: move mutex around component_{un,}bind_all()
staging: etnaviv: move PM calls into bind/unbind callbacks
staging: etnaviv: separate out etnaviv gpu hardware initialisation
staging: etnaviv: add support to shutdown and restore the front end
staging: etnaviv: runtime PM: add initial support
staging: etnaviv: add support for offset physical memory
.../bindings/drm/etnaviv/etnaviv-drm.txt | 44 +
.../devicetree/bindings/vendor-prefixes.txt | 1 +
arch/arm/boot/dts/imx6dl.dtsi | 5 +
arch/arm/boot/dts/imx6q.dtsi | 14 +
arch/arm/boot/dts/imx6qdl.dtsi | 19 +
drivers/staging/Kconfig | 2 +
drivers/staging/Makefile | 1 +
drivers/staging/etnaviv/Kconfig | 20 +
drivers/staging/etnaviv/Makefile | 18 +
drivers/staging/etnaviv/cmdstream.xml.h | 218 ++++
drivers/staging/etnaviv/common.xml.h | 249 ++++
drivers/staging/etnaviv/etnaviv_buffer.c | 306 +++++
drivers/staging/etnaviv/etnaviv_cmd_parser.c | 121 ++
drivers/staging/etnaviv/etnaviv_drv.c | 675 +++++++++++
drivers/staging/etnaviv/etnaviv_drv.h | 143 +++
drivers/staging/etnaviv/etnaviv_gem.c | 904 ++++++++++++++
drivers/staging/etnaviv/etnaviv_gem.h | 137 +++
drivers/staging/etnaviv/etnaviv_gem_prime.c | 116 ++
drivers/staging/etnaviv/etnaviv_gem_submit.c | 427 +++++++
drivers/staging/etnaviv/etnaviv_gpu.c | 1255 ++++++++++++++++++++
drivers/staging/etnaviv/etnaviv_gpu.h | 159 +++
drivers/staging/etnaviv/etnaviv_iommu.c | 216 ++++
drivers/staging/etnaviv/etnaviv_iommu.h | 26 +
drivers/staging/etnaviv/etnaviv_mmu.c | 269 +++++
drivers/staging/etnaviv/etnaviv_mmu.h | 53 +
drivers/staging/etnaviv/state.xml.h | 351 ++++++
drivers/staging/etnaviv/state_hi.xml.h | 407 +++++++
include/uapi/drm/etnaviv_drm.h | 225 ++++
28 files changed, 6381 insertions(+)
create mode 100644 Documentation/devicetree/bindings/drm/etnaviv/etnaviv-drm.txt
create mode 100644 drivers/staging/etnaviv/Kconfig
create mode 100644 drivers/staging/etnaviv/Makefile
create mode 100644 drivers/staging/etnaviv/cmdstream.xml.h
create mode 100644 drivers/staging/etnaviv/common.xml.h
create mode 100644 drivers/staging/etnaviv/etnaviv_buffer.c
create mode 100644 drivers/staging/etnaviv/etnaviv_cmd_parser.c
create mode 100644 drivers/staging/etnaviv/etnaviv_drv.c
create mode 100644 drivers/staging/etnaviv/etnaviv_drv.h
create mode 100644 drivers/staging/etnaviv/etnaviv_gem.c
create mode 100644 drivers/staging/etnaviv/etnaviv_gem.h
create mode 100644 drivers/staging/etnaviv/etnaviv_gem_prime.c
create mode 100644 drivers/staging/etnaviv/etnaviv_gem_submit.c
create mode 100644 drivers/staging/etnaviv/etnaviv_gpu.c
create mode 100644 drivers/staging/etnaviv/etnaviv_gpu.h
create mode 100644 drivers/staging/etnaviv/etnaviv_iommu.c
create mode 100644 drivers/staging/etnaviv/etnaviv_iommu.h
create mode 100644 drivers/staging/etnaviv/etnaviv_mmu.c
create mode 100644 drivers/staging/etnaviv/etnaviv_mmu.h
create mode 100644 drivers/staging/etnaviv/state.xml.h
create mode 100644 drivers/staging/etnaviv/state_hi.xml.h
create mode 100644 include/uapi/drm/etnaviv_drm.h
--
2.1.4
More information about the dri-devel
mailing list