diff options
author | Eric Anholt <[email protected]> | 2014-07-21 11:27:35 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2014-08-11 14:45:28 -0700 |
commit | a8f2bf0f51222a96a49dfb3d6f9b36d3e54d08cd (patch) | |
tree | 5f7ab98c9ba5a69d761b253560908ac9c2358a81 /src/gallium/drivers/vc4/vc4_drm.h | |
parent | 6a5ece12aac0f079dff3aaf00b2ec5c420b9b1f8 (diff) |
vc4: Rewrite the kernel ABI to support texture uniform relocation.
This required building a shader parser that would walk the program to find
where the texturing-related uniforms are in the uniforms stream.
Note that as of this commit, a new kernel is required for rendering on
actual VC4 hardware (currently that commit is named "drm/vc4: Introduce
shader validation and better command stream validation.", but is likely to
be squashed as part of an eventual merge of the kernel driver).
Diffstat (limited to 'src/gallium/drivers/vc4/vc4_drm.h')
-rw-r--r-- | src/gallium/drivers/vc4/vc4_drm.h | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/src/gallium/drivers/vc4/vc4_drm.h b/src/gallium/drivers/vc4/vc4_drm.h index b958f1d03d0..cc4c735d881 100644 --- a/src/gallium/drivers/vc4/vc4_drm.h +++ b/src/gallium/drivers/vc4/vc4_drm.h @@ -74,6 +74,21 @@ struct drm_vc4_submit_cl { */ void __user *shader_records; + /* Pointer to uniform data and texture handles for the textures + * referenced by the shader. + * + * For each shader state record, there is a set of uniform data in the + * order referenced by the record (FS, VS, then CS). Each set of + * uniform data has a uint32_t index into bo_handles per texture + * sample operation, in the order the QPU_W_TMUn_S writes appear in + * the program. Following the texture BO handle indices is the actual + * uniform data. + * + * The individual uniform state blocks don't have sizes passed in, + * because the kernel has to determine the sizes anyway during shader + * code validation. + */ + void __user *uniforms; void __user *bo_handles; /* Size in bytes of the binner command list. */ @@ -84,11 +99,13 @@ struct drm_vc4_submit_cl { uint32_t shader_record_len; /* Number of shader records. * - * This could just be computed from the contents of shader_records, - * but it keeps the kernel from having to resize various allocations - * it makes. + * This could just be computed from the contents of shader_records and + * the address bits of references to them from the bin CL, but it + * keeps the kernel from having to resize some allocations it makes. */ uint32_t shader_record_count; + /** Size in bytes of the uniform state. */ + uint32_t uniforms_len; /* Number of BO handles passed in (size is that times 4). */ uint32_t bo_handle_count; |