aboutsummaryrefslogtreecommitdiffstats
path: root/include/uapi
diff options
context:
space:
mode:
authorThomas Hellstrom <thellstrom@vmware.com>2012-11-21 04:23:14 -0500
committerThomas Hellstrom <thellstrom@vmware.com>2014-01-17 01:47:53 -0500
commitcfe4d53eee81878ded963e76957f4aeed85f0a82 (patch)
tree7ca662265faaf37146914ddbbdf07631c212b524 /include/uapi
parentd9019498dddae69c69d0981a056f137d2893d3e0 (diff)
drm/vmwgfx: Update the driver user-space interface for guest-backed objects
Not hooked up yet. This is only the definition. Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Zack Rusin <zackr@vmware.com> Conflicts: include/uapi/drm/vmwgfx_drm.h
Diffstat (limited to 'include/uapi')
-rw-r--r--include/uapi/drm/vmwgfx_drm.h199
1 files changed, 199 insertions, 0 deletions
diff --git a/include/uapi/drm/vmwgfx_drm.h b/include/uapi/drm/vmwgfx_drm.h
index bcb0912afe7a..39ab12f6e982 100644
--- a/include/uapi/drm/vmwgfx_drm.h
+++ b/include/uapi/drm/vmwgfx_drm.h
@@ -55,6 +55,11 @@
55#define DRM_VMW_PRESENT 18 55#define DRM_VMW_PRESENT 18
56#define DRM_VMW_PRESENT_READBACK 19 56#define DRM_VMW_PRESENT_READBACK 19
57#define DRM_VMW_UPDATE_LAYOUT 20 57#define DRM_VMW_UPDATE_LAYOUT 20
58#define DRM_VMW_CREATE_SHADER 21
59#define DRM_VMW_UNREF_SHADER 22
60#define DRM_VMW_GB_SURFACE_CREATE 23
61#define DRM_VMW_GB_SURFACE_REF 24
62
58 63
59/*************************************************************************/ 64/*************************************************************************/
60/** 65/**
@@ -75,6 +80,8 @@
75#define DRM_VMW_PARAM_FIFO_CAPS 4 80#define DRM_VMW_PARAM_FIFO_CAPS 4
76#define DRM_VMW_PARAM_MAX_FB_SIZE 5 81#define DRM_VMW_PARAM_MAX_FB_SIZE 5
77#define DRM_VMW_PARAM_FIFO_HW_VERSION 6 82#define DRM_VMW_PARAM_FIFO_HW_VERSION 6
83#define DRM_VMW_PARAM_MAX_SURF_MEMORY 7
84#define DRM_VMW_PARAM_3D_CAPS_SIZE 8
78 85
79/** 86/**
80 * struct drm_vmw_getparam_arg 87 * struct drm_vmw_getparam_arg
@@ -787,4 +794,196 @@ struct drm_vmw_update_layout_arg {
787 uint64_t rects; 794 uint64_t rects;
788}; 795};
789 796
797
798/*************************************************************************/
799/**
800 * DRM_VMW_CREATE_SHADER - Create shader
801 *
802 * Creates a shader and optionally binds it to a dma buffer containing
803 * the shader byte-code.
804 */
805
806/**
807 * enum drm_vmw_shader_type - Shader types
808 */
809enum drm_vmw_shader_type {
810 drm_vmw_shader_type_vs = 0,
811 drm_vmw_shader_type_ps,
812 drm_vmw_shader_type_gs
813};
814
815
816/**
817 * struct drm_vmw_shader_create_arg
818 *
819 * @shader_type: Shader type of the shader to create.
820 * @size: Size of the byte-code in bytes.
821 * where the shader byte-code starts
822 * @buffer_handle: Buffer handle identifying the buffer containing the
823 * shader byte-code
824 * @shader_handle: On successful completion contains a handle that
825 * can be used to subsequently identify the shader.
826 * @offset: Offset in bytes into the buffer given by @buffer_handle,
827 *
828 * Input / Output argument to the DRM_VMW_CREATE_SHADER Ioctl.
829 */
830struct drm_vmw_shader_create_arg {
831 enum drm_vmw_shader_type shader_type;
832 uint32_t size;
833 uint32_t buffer_handle;
834 uint32_t shader_handle;
835 uint64_t offset;
836};
837
838/*************************************************************************/
839/**
840 * DRM_VMW_UNREF_SHADER - Unreferences a shader
841 *
842 * Destroys a user-space reference to a shader, optionally destroying
843 * it.
844 */
845
846/**
847 * struct drm_vmw_shader_arg
848 *
849 * @handle: Handle identifying the shader to destroy.
850 *
851 * Input argument to the DRM_VMW_UNREF_SHADER ioctl.
852 */
853struct drm_vmw_shader_arg {
854 uint32_t handle;
855 uint32_t pad64;
856};
857
858/*************************************************************************/
859/**
860 * DRM_VMW_GB_SURFACE_CREATE - Create a host guest-backed surface.
861 *
862 * Allocates a surface handle and queues a create surface command
863 * for the host on the first use of the surface. The surface ID can
864 * be used as the surface ID in commands referencing the surface.
865 */
866
867/**
868 * enum drm_vmw_surface_flags
869 *
870 * @drm_vmw_surface_flag_shareable: Whether the surface is shareable
871 * @drm_vmw_surface_flag_scanout: Whether the surface is a scanout
872 * surface.
873 * @drm_vmw_surface_flag_create_buffer: Create a backup buffer if none is
874 * given.
875 */
876enum drm_vmw_surface_flags {
877 drm_vmw_surface_flag_shareable = (1 << 0),
878 drm_vmw_surface_flag_scanout = (1 << 1),
879 drm_vmw_surface_flag_create_buffer = (1 << 2)
880};
881
882/**
883 * struct drm_vmw_gb_surface_create_req
884 *
885 * @svga3d_flags: SVGA3d surface flags for the device.
886 * @format: SVGA3d format.
887 * @mip_level: Number of mip levels for all faces.
888 * @drm_surface_flags Flags as described above.
889 * @multisample_count Future use. Set to 1.
890 * @autogen_filter Future use. Set to 0.
891 * @buffer_handle Buffer handle of backup buffer. SVGA3D_INVALID_ID
892 * if none.
893 * @base_size Size of the base mip level for all faces.
894 *
895 * Input argument to the DRM_VMW_GB_SURFACE_CREATE Ioctl.
896 * Part of output argument for the DRM_VMW_GB_SURFACE_REF Ioctl.
897 */
898struct drm_vmw_gb_surface_create_req {
899 uint32_t svga3d_flags;
900 uint32_t format;
901 uint32_t mip_levels;
902 enum drm_vmw_surface_flags drm_surface_flags;
903 uint32_t multisample_count;
904 uint32_t autogen_filter;
905 uint32_t buffer_handle;
906 uint32_t pad64;
907 struct drm_vmw_size base_size;
908};
909
910/**
911 * struct drm_vmw_gb_surface_create_rep
912 *
913 * @handle: Surface handle.
914 * @backup_size: Size of backup buffers for this surface.
915 * @buffer_handle: Handle of backup buffer. SVGA3D_INVALID_ID if none.
916 * @buffer_size: Actual size of the buffer identified by
917 * @buffer_handle
918 * @buffer_map_handle: Offset into device address space for the buffer
919 * identified by @buffer_handle.
920 *
921 * Part of output argument for the DRM_VMW_GB_SURFACE_REF ioctl.
922 * Output argument for the DRM_VMW_GB_SURFACE_CREATE ioctl.
923 */
924struct drm_vmw_gb_surface_create_rep {
925 uint32_t handle;
926 uint32_t backup_size;
927 uint32_t buffer_handle;
928 uint32_t buffer_size;
929 uint64_t buffer_map_handle;
930};
931
932/**
933 * union drm_vmw_gb_surface_create_arg
934 *
935 * @req: Input argument as described above.
936 * @rep: Output argument as described above.
937 *
938 * Argument to the DRM_VMW_GB_SURFACE_CREATE ioctl.
939 */
940union drm_vmw_gb_surface_create_arg {
941 struct drm_vmw_gb_surface_create_rep rep;
942 struct drm_vmw_gb_surface_create_req req;
943};
944
945/*************************************************************************/
946/**
947 * DRM_VMW_GB_SURFACE_REF - Reference a host surface.
948 *
949 * Puts a reference on a host surface with a given handle, as previously
950 * returned by the DRM_VMW_GB_SURFACE_CREATE ioctl.
951 * A reference will make sure the surface isn't destroyed while we hold
952 * it and will allow the calling client to use the surface handle in
953 * the command stream.
954 *
955 * On successful return, the Ioctl returns the surface information given
956 * to and returned from the DRM_VMW_GB_SURFACE_CREATE ioctl.
957 */
958
959/**
960 * struct drm_vmw_gb_surface_reference_arg
961 *
962 * @creq: The data used as input when the surface was created, as described
963 * above at "struct drm_vmw_gb_surface_create_req"
964 * @crep: Additional data output when the surface was created, as described
965 * above at "struct drm_vmw_gb_surface_create_rep"
966 *
967 * Output Argument to the DRM_VMW_GB_SURFACE_REF ioctl.
968 */
969struct drm_vmw_gb_surface_ref_rep {
970 struct drm_vmw_gb_surface_create_req creq;
971 struct drm_vmw_gb_surface_create_rep crep;
972};
973
974/**
975 * union drm_vmw_gb_surface_reference_arg
976 *
977 * @req: Input data as described above at "struct drm_vmw_surface_arg"
978 * @rep: Output data as described above at "struct drm_vmw_gb_surface_ref_rep"
979 *
980 * Argument to the DRM_VMW_GB_SURFACE_REF Ioctl.
981 */
982union drm_vmw_gb_surface_reference_arg {
983 struct drm_vmw_gb_surface_ref_rep rep;
984 struct drm_vmw_surface_arg req;
985};
986
987
988
790#endif 989#endif