drm/vc4: Add an API for creating GPU shaders in GEM BOs.
authorEric Anholt <eric@anholt.net>
Mon, 30 Nov 2015 19:41:40 +0000 (11:41 -0800)
committerEric Anholt <eric@anholt.net>
Tue, 8 Dec 2015 04:05:09 +0000 (20:05 -0800)
commit463873d5701427f2964a0b4b72c45f1f14b6df87
tree023716d1baafccda43cd6bb35f61a9a83b48f86c
parentd5bc60f6ad05b3c676b057bec662cfafc3ee24dd
drm/vc4: Add an API for creating GPU shaders in GEM BOs.

Since we have no MMU, the kernel needs to validate that the submitted
shader code won't make any accesses to memory that the user doesn't
control, which involves banning some operations (general purpose DMA
writes), and tracking where we need to write out pointers for other
operations (texture sampling).  Once it's validated, we return a GEM
BO containing the shader, which doesn't allow mapping for write or
exporting to other subsystems.

v2: Use __u32-style types.

Signed-off-by: Eric Anholt <eric@anholt.net>
drivers/gpu/drm/vc4/Makefile
drivers/gpu/drm/vc4/vc4_bo.c
drivers/gpu/drm/vc4/vc4_drv.c
drivers/gpu/drm/vc4/vc4_drv.h
drivers/gpu/drm/vc4/vc4_qpu_defines.h [new file with mode: 0644]
drivers/gpu/drm/vc4/vc4_validate_shaders.c [new file with mode: 0644]
include/uapi/drm/vc4_drm.h