History

drm/vmwgfx: Update the user-space interface.

When time-based throttling is implemented, we need to bump minor. When the old way of detecting scanout is removed, we need to bump major. In the meantime, this change should not break existing user-space.

Thomas Hellstrom committed 16 years ago

Commit f77cef31 parent e28cab44 files · +21 −8Browse files

Unified · Split

4 files
  1. drivers/gpu/drm/vmwgfx/vmwgfx_drv.h +3 −3
  2. drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c +6 −0
  3. drivers/gpu/drm/vmwgfx/vmwgfx_resource.c +3 −2
  4. include/drm/vmwgfx_drm.h +9 −3
drivers/gpu/drm/vmwgfx/vmwgfx_drv.h+3−3
@@ -39,10 +39,10 @@ · 38 unmodified lines
3939 #include "ttm/ttm_execbuf_util.h"
4040 #include "ttm/ttm_module.h"
4141
42−#define VMWGFX_DRIVER_DATE "20090724"
42+#define VMWGFX_DRIVER_DATE "20100118"
4343 #define VMWGFX_DRIVER_MAJOR 0
44−#define VMWGFX_DRIVER_MINOR 1
45−#define VMWGFX_DRIVER_PATCHLEVEL 2
44+#define VMWGFX_DRIVER_MINOR 9
45+#define VMWGFX_DRIVER_PATCHLEVEL 0
4646 #define VMWGFX_FILE_PAGE_OFFSET 0x00100000
4747 #define VMWGFX_FIFO_STATIC_SIZE (1024*1024)
4848 #define VMWGFX_MAX_RELOCATIONS 2048
drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c+6−0
@@ -48,6 +48,12 @@ int vmw_getparam_ioctl(struct drm_device *dev, void *data, · 47 unmodified lines
4848 case DRM_VMW_PARAM_FIFO_OFFSET:
4949 param->value = dev_priv->mmio_start;
5050 break;
51+ case DRM_VMW_PARAM_HW_CAPS:
52+ param->value = dev_priv->capabilities;
53+ break;
54+ case DRM_VMW_PARAM_FIFO_CAPS:
55+ param->value = dev_priv->fifo.capabilities;
56+ break;
5157 default:
5258 DRM_ERROR("Illegal vmwgfx get param request: %d\n",
5359 param->param);
drivers/gpu/drm/vmwgfx/vmwgfx_resource.c+3−2
@@ -610,9 +610,10 @@ int vmw_surface_define_ioctl(struct drm_device *dev, void *data, · 609 unmodified lines
610610 */
611611 srf->flags &= ~SVGA3D_SURFACE_HINT_SCANOUT;
612612 srf->scanout = true;
613− } else {
613+ } else if (req->scanout)
614+ srf->scanout = true;
615+ else
614616 srf->scanout = false;
615− }
616617
617618 if (srf->scanout &&
618619 srf->num_sizes == 1 &&
include/drm/vmwgfx_drm.h+9−3
@@ -68,7 +68,8 @@ · 67 unmodified lines
6868 #define DRM_VMW_PARAM_NUM_FREE_STREAMS 1
6969 #define DRM_VMW_PARAM_3D 2
7070 #define DRM_VMW_PARAM_FIFO_OFFSET 3
71−
71+#define DRM_VMW_PARAM_HW_CAPS 4
72+#define DRM_VMW_PARAM_FIFO_CAPS 5
7273
7374 /**
7475 * struct drm_vmw_getparam_arg
@@ -181,6 +182,8 @@ struct drm_vmw_context_arg { · 106 unmodified lines
181182 * The size of the array should equal the total number of mipmap levels.
182183 * @shareable: Boolean whether other clients (as identified by file descriptors)
183184 * may reference this surface.
185+ * @scanout: Boolean whether the surface is intended to be used as a
186+ * scanout.
184187 *
185188 * Input data to the DRM_VMW_CREATE_SURFACE Ioctl.
186189 * Output data from the DRM_VMW_REF_SURFACE Ioctl.
@@ -192,7 +195,7 @@ struct drm_vmw_surface_create_req { · 5 unmodified lines
192195 uint32_t mip_levels[DRM_VMW_MAX_SURFACE_FACES];
193196 uint64_t size_addr;
194197 int32_t shareable;
195− uint32_t pad64;
198+ int32_t scanout;
196199 };
197200
198201 /**
@@ -295,6 +298,9 @@ union drm_vmw_surface_reference_arg { · 96 unmodified lines
295298 *
296299 * @commands: User-space address of a command buffer cast to an uint64_t.
297300 * @command-size: Size in bytes of the command buffer.
301+ * @throttle-us: Sleep until software is less than @throttle_us
302+ * microseconds ahead of hardware. The driver may round this value
303+ * to the nearest kernel tick.
298304 * @fence_rep: User-space address of a struct drm_vmw_fence_rep cast to an
299305 * uint64_t.
300306 *
@@ -304,7 +310,7 @@ union drm_vmw_surface_reference_arg { · 3 unmodified lines
304310 struct drm_vmw_execbuf_arg {
305311 uint64_t commands;
306312 uint32_t command_size;
307− uint32_t pad64;
313+ uint32_t throttle_us;
308314 uint64_t fence_rep;
309315 };
310316