Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0 OR MIT
0002 /**************************************************************************
0003  * Copyright 2014-2015 VMware, Inc., Palo Alto, CA., USA
0004  *
0005  * Permission is hereby granted, free of charge, to any person obtaining a
0006  * copy of this software and associated documentation files (the
0007  * "Software"), to deal in the Software without restriction, including
0008  * without limitation the rights to use, copy, modify, merge, publish,
0009  * distribute, sub license, and/or sell copies of the Software, and to
0010  * permit persons to whom the Software is furnished to do so, subject to
0011  * the following conditions:
0012  *
0013  * The above copyright notice and this permission notice (including the
0014  * next paragraph) shall be included in all copies or substantial portions
0015  * of the Software.
0016  *
0017  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
0018  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
0019  * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
0020  * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
0021  * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
0022  * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
0023  * USE OR OTHER DEALINGS IN THE SOFTWARE.
0024  *
0025  **************************************************************************/
0026 
0027 #include "vmwgfx_drv.h"
0028 #include "vmwgfx_resource_priv.h"
0029 #include "vmwgfx_so.h"
0030 #include "vmwgfx_binding.h"
0031 
0032 /*
0033  * The currently only reason we need to keep track of views is that if we
0034  * destroy a hardware surface, all views pointing to it must also be destroyed,
0035  * otherwise the device will error.
0036  * So in particular if a surface is evicted, we must destroy all views pointing
0037  * to it, and all context bindings of that view. Similarly we must restore
0038  * the view bindings, views and surfaces pointed to by the views when a
0039  * context is referenced in the command stream.
0040  */
0041 
0042 /**
0043  * struct vmw_view - view metadata
0044  *
0045  * @rcu: RCU callback head
0046  * @res: The struct vmw_resource we derive from
0047  * @ctx: Non-refcounted pointer to the context this view belongs to.
0048  * @srf: Refcounted pointer to the surface pointed to by this view.
0049  * @cotable: Refcounted pointer to the cotable holding this view.
0050  * @srf_head: List head for the surface-to-view list.
0051  * @cotable_head: List head for the cotable-to_view list.
0052  * @view_type: View type.
0053  * @view_id: User-space per context view id. Currently used also as per
0054  * context device view id.
0055  * @cmd_size: Size of the SVGA3D define view command that we've copied from the
0056  * command stream.
0057  * @committed: Whether the view is actually created or pending creation at the
0058  * device level.
0059  * @cmd: The SVGA3D define view command copied from the command stream.
0060  */
0061 struct vmw_view {
0062     struct rcu_head rcu;
0063     struct vmw_resource res;
0064     struct vmw_resource *ctx;      /* Immutable */
0065     struct vmw_resource *srf;      /* Immutable */
0066     struct vmw_resource *cotable;  /* Immutable */
0067     struct list_head srf_head;     /* Protected by binding_mutex */
0068     struct list_head cotable_head; /* Protected by binding_mutex */
0069     unsigned view_type;            /* Immutable */
0070     unsigned view_id;              /* Immutable */
0071     u32 cmd_size;                  /* Immutable */
0072     bool committed;                /* Protected by binding_mutex */
0073     u32 cmd[1];                    /* Immutable */
0074 };
0075 
0076 static int vmw_view_create(struct vmw_resource *res);
0077 static int vmw_view_destroy(struct vmw_resource *res);
0078 static void vmw_hw_view_destroy(struct vmw_resource *res);
0079 static void vmw_view_commit_notify(struct vmw_resource *res,
0080                    enum vmw_cmdbuf_res_state state);
0081 
0082 static const struct vmw_res_func vmw_view_func = {
0083     .res_type = vmw_res_view,
0084     .needs_backup = false,
0085     .may_evict = false,
0086     .type_name = "DX view",
0087     .backup_placement = NULL,
0088     .create = vmw_view_create,
0089     .commit_notify = vmw_view_commit_notify,
0090 };
0091 
0092 /**
0093  * struct vmw_view_define - view define command body stub
0094  *
0095  * @view_id: The device id of the view being defined
0096  * @sid: The surface id of the view being defined
0097  *
0098  * This generic struct is used by the code to change @view_id and @sid of a
0099  * saved view define command.
0100  */
0101 struct vmw_view_define {
0102     uint32 view_id;
0103     uint32 sid;
0104 };
0105 
0106 /**
0107  * vmw_view - Convert a struct vmw_resource to a struct vmw_view
0108  *
0109  * @res: Pointer to the resource to convert.
0110  *
0111  * Returns a pointer to a struct vmw_view.
0112  */
0113 static struct vmw_view *vmw_view(struct vmw_resource *res)
0114 {
0115     return container_of(res, struct vmw_view, res);
0116 }
0117 
0118 /**
0119  * vmw_view_commit_notify - Notify that a view operation has been committed to
0120  * hardware from a user-supplied command stream.
0121  *
0122  * @res: Pointer to the view resource.
0123  * @state: Indicating whether a creation or removal has been committed.
0124  *
0125  */
0126 static void vmw_view_commit_notify(struct vmw_resource *res,
0127                    enum vmw_cmdbuf_res_state state)
0128 {
0129     struct vmw_view *view = vmw_view(res);
0130     struct vmw_private *dev_priv = res->dev_priv;
0131 
0132     mutex_lock(&dev_priv->binding_mutex);
0133     if (state == VMW_CMDBUF_RES_ADD) {
0134         struct vmw_surface *srf = vmw_res_to_srf(view->srf);
0135 
0136         list_add_tail(&view->srf_head, &srf->view_list);
0137         vmw_cotable_add_resource(view->cotable, &view->cotable_head);
0138         view->committed = true;
0139         res->id = view->view_id;
0140 
0141     } else {
0142         list_del_init(&view->cotable_head);
0143         list_del_init(&view->srf_head);
0144         view->committed = false;
0145         res->id = -1;
0146     }
0147     mutex_unlock(&dev_priv->binding_mutex);
0148 }
0149 
0150 /**
0151  * vmw_view_create - Create a hardware view.
0152  *
0153  * @res: Pointer to the view resource.
0154  *
0155  * Create a hardware view. Typically used if that view has previously been
0156  * destroyed by an eviction operation.
0157  */
0158 static int vmw_view_create(struct vmw_resource *res)
0159 {
0160     struct vmw_view *view = vmw_view(res);
0161     struct vmw_surface *srf = vmw_res_to_srf(view->srf);
0162     struct vmw_private *dev_priv = res->dev_priv;
0163     struct {
0164         SVGA3dCmdHeader header;
0165         struct vmw_view_define body;
0166     } *cmd;
0167 
0168     mutex_lock(&dev_priv->binding_mutex);
0169     if (!view->committed) {
0170         mutex_unlock(&dev_priv->binding_mutex);
0171         return 0;
0172     }
0173 
0174     cmd = VMW_CMD_CTX_RESERVE(res->dev_priv, view->cmd_size, view->ctx->id);
0175     if (!cmd) {
0176         mutex_unlock(&dev_priv->binding_mutex);
0177         return -ENOMEM;
0178     }
0179 
0180     memcpy(cmd, &view->cmd, view->cmd_size);
0181     WARN_ON(cmd->body.view_id != view->view_id);
0182     /* Sid may have changed due to surface eviction. */
0183     WARN_ON(view->srf->id == SVGA3D_INVALID_ID);
0184     cmd->body.sid = view->srf->id;
0185     vmw_cmd_commit(res->dev_priv, view->cmd_size);
0186     res->id = view->view_id;
0187     list_add_tail(&view->srf_head, &srf->view_list);
0188     vmw_cotable_add_resource(view->cotable, &view->cotable_head);
0189     mutex_unlock(&dev_priv->binding_mutex);
0190 
0191     return 0;
0192 }
0193 
0194 /**
0195  * vmw_view_destroy - Destroy a hardware view.
0196  *
0197  * @res: Pointer to the view resource.
0198  *
0199  * Destroy a hardware view. Typically used on unexpected termination of the
0200  * owning process or if the surface the view is pointing to is destroyed.
0201  */
0202 static int vmw_view_destroy(struct vmw_resource *res)
0203 {
0204     struct vmw_private *dev_priv = res->dev_priv;
0205     struct vmw_view *view = vmw_view(res);
0206     struct {
0207         SVGA3dCmdHeader header;
0208         union vmw_view_destroy body;
0209     } *cmd;
0210 
0211     lockdep_assert_held_once(&dev_priv->binding_mutex);
0212     vmw_binding_res_list_scrub(&res->binding_head);
0213 
0214     if (!view->committed || res->id == -1)
0215         return 0;
0216 
0217     cmd = VMW_CMD_CTX_RESERVE(dev_priv, sizeof(*cmd), view->ctx->id);
0218     if (!cmd)
0219         return -ENOMEM;
0220 
0221     cmd->header.id = vmw_view_destroy_cmds[view->view_type];
0222     cmd->header.size = sizeof(cmd->body);
0223     cmd->body.view_id = view->view_id;
0224     vmw_cmd_commit(dev_priv, sizeof(*cmd));
0225     res->id = -1;
0226     list_del_init(&view->cotable_head);
0227     list_del_init(&view->srf_head);
0228 
0229     return 0;
0230 }
0231 
0232 /**
0233  * vmw_hw_view_destroy - Destroy a hardware view as part of resource cleanup.
0234  *
0235  * @res: Pointer to the view resource.
0236  *
0237  * Destroy a hardware view if it's still present.
0238  */
0239 static void vmw_hw_view_destroy(struct vmw_resource *res)
0240 {
0241     struct vmw_private *dev_priv = res->dev_priv;
0242 
0243     mutex_lock(&dev_priv->binding_mutex);
0244     WARN_ON(vmw_view_destroy(res));
0245     res->id = -1;
0246     mutex_unlock(&dev_priv->binding_mutex);
0247 }
0248 
0249 /**
0250  * vmw_view_key - Compute a view key suitable for the cmdbuf resource manager
0251  *
0252  * @user_key: The user-space id used for the view.
0253  * @view_type: The view type.
0254  *
0255  * Destroy a hardware view if it's still present.
0256  */
0257 static u32 vmw_view_key(u32 user_key, enum vmw_view_type view_type)
0258 {
0259     return user_key | (view_type << 20);
0260 }
0261 
0262 /**
0263  * vmw_view_id_ok - Basic view id and type range checks.
0264  *
0265  * @user_key: The user-space id used for the view.
0266  * @view_type: The view type.
0267  *
0268  * Checks that the view id and type (typically provided by user-space) is
0269  * valid.
0270  */
0271 static bool vmw_view_id_ok(u32 user_key, enum vmw_view_type view_type)
0272 {
0273     return (user_key < SVGA_COTABLE_MAX_IDS &&
0274         view_type < vmw_view_max);
0275 }
0276 
0277 /**
0278  * vmw_view_res_free - resource res_free callback for view resources
0279  *
0280  * @res: Pointer to a struct vmw_resource
0281  *
0282  * Frees memory held by the struct vmw_view.
0283  */
0284 static void vmw_view_res_free(struct vmw_resource *res)
0285 {
0286     struct vmw_view *view = vmw_view(res);
0287 
0288     vmw_resource_unreference(&view->cotable);
0289     vmw_resource_unreference(&view->srf);
0290     kfree_rcu(view, rcu);
0291 }
0292 
0293 /**
0294  * vmw_view_add - Create a view resource and stage it for addition
0295  * as a command buffer managed resource.
0296  *
0297  * @man: Pointer to the compat shader manager identifying the shader namespace.
0298  * @ctx: Pointer to a struct vmw_resource identifying the active context.
0299  * @srf: Pointer to a struct vmw_resource identifying the surface the view
0300  * points to.
0301  * @view_type: The view type deduced from the view create command.
0302  * @user_key: The key that is used to identify the shader. The key is
0303  * unique to the view type and to the context.
0304  * @cmd: Pointer to the view create command in the command stream.
0305  * @cmd_size: Size of the view create command in the command stream.
0306  * @list: Caller's list of staged command buffer resource actions.
0307  */
0308 int vmw_view_add(struct vmw_cmdbuf_res_manager *man,
0309          struct vmw_resource *ctx,
0310          struct vmw_resource *srf,
0311          enum vmw_view_type view_type,
0312          u32 user_key,
0313          const void *cmd,
0314          size_t cmd_size,
0315          struct list_head *list)
0316 {
0317     static const size_t vmw_view_define_sizes[] = {
0318         [vmw_view_sr] = sizeof(SVGA3dCmdDXDefineShaderResourceView),
0319         [vmw_view_rt] = sizeof(SVGA3dCmdDXDefineRenderTargetView),
0320         [vmw_view_ds] = sizeof(SVGA3dCmdDXDefineDepthStencilView),
0321         [vmw_view_ua] = sizeof(SVGA3dCmdDXDefineUAView)
0322     };
0323 
0324     struct vmw_private *dev_priv = ctx->dev_priv;
0325     struct vmw_resource *res;
0326     struct vmw_view *view;
0327     size_t size;
0328     int ret;
0329 
0330     if (cmd_size != vmw_view_define_sizes[view_type] +
0331         sizeof(SVGA3dCmdHeader)) {
0332         VMW_DEBUG_USER("Illegal view create command size.\n");
0333         return -EINVAL;
0334     }
0335 
0336     if (!vmw_view_id_ok(user_key, view_type)) {
0337         VMW_DEBUG_USER("Illegal view add view id.\n");
0338         return -EINVAL;
0339     }
0340 
0341     size = offsetof(struct vmw_view, cmd) + cmd_size;
0342 
0343     view = kmalloc(size, GFP_KERNEL);
0344     if (!view) {
0345         return -ENOMEM;
0346     }
0347 
0348     res = &view->res;
0349     view->ctx = ctx;
0350     view->srf = vmw_resource_reference(srf);
0351     view->cotable = vmw_resource_reference
0352         (vmw_context_cotable(ctx, vmw_view_cotables[view_type]));
0353     view->view_type = view_type;
0354     view->view_id = user_key;
0355     view->cmd_size = cmd_size;
0356     view->committed = false;
0357     INIT_LIST_HEAD(&view->srf_head);
0358     INIT_LIST_HEAD(&view->cotable_head);
0359     memcpy(&view->cmd, cmd, cmd_size);
0360     ret = vmw_resource_init(dev_priv, res, true,
0361                 vmw_view_res_free, &vmw_view_func);
0362     if (ret)
0363         goto out_resource_init;
0364 
0365     ret = vmw_cmdbuf_res_add(man, vmw_cmdbuf_res_view,
0366                  vmw_view_key(user_key, view_type),
0367                  res, list);
0368     if (ret)
0369         goto out_resource_init;
0370 
0371     res->id = view->view_id;
0372     res->hw_destroy = vmw_hw_view_destroy;
0373 
0374 out_resource_init:
0375     vmw_resource_unreference(&res);
0376 
0377     return ret;
0378 }
0379 
0380 /**
0381  * vmw_view_remove - Stage a view for removal.
0382  *
0383  * @man: Pointer to the view manager identifying the shader namespace.
0384  * @user_key: The key that is used to identify the view. The key is
0385  * unique to the view type.
0386  * @view_type: View type
0387  * @list: Caller's list of staged command buffer resource actions.
0388  * @res_p: If the resource is in an already committed state, points to the
0389  * struct vmw_resource on successful return. The pointer will be
0390  * non ref-counted.
0391  */
0392 int vmw_view_remove(struct vmw_cmdbuf_res_manager *man,
0393             u32 user_key, enum vmw_view_type view_type,
0394             struct list_head *list,
0395             struct vmw_resource **res_p)
0396 {
0397     if (!vmw_view_id_ok(user_key, view_type)) {
0398         VMW_DEBUG_USER("Illegal view remove view id.\n");
0399         return -EINVAL;
0400     }
0401 
0402     return vmw_cmdbuf_res_remove(man, vmw_cmdbuf_res_view,
0403                      vmw_view_key(user_key, view_type),
0404                      list, res_p);
0405 }
0406 
0407 /**
0408  * vmw_view_cotable_list_destroy - Evict all views belonging to a cotable.
0409  *
0410  * @dev_priv: Pointer to a device private struct.
0411  * @list: List of views belonging to a cotable.
0412  * @readback: Unused. Needed for function interface only.
0413  *
0414  * This function evicts all views belonging to a cotable.
0415  * It must be called with the binding_mutex held, and the caller must hold
0416  * a reference to the view resource. This is typically called before the
0417  * cotable is paged out.
0418  */
0419 void vmw_view_cotable_list_destroy(struct vmw_private *dev_priv,
0420                    struct list_head *list,
0421                    bool readback)
0422 {
0423     struct vmw_view *entry, *next;
0424 
0425     lockdep_assert_held_once(&dev_priv->binding_mutex);
0426 
0427     list_for_each_entry_safe(entry, next, list, cotable_head)
0428         WARN_ON(vmw_view_destroy(&entry->res));
0429 }
0430 
0431 /**
0432  * vmw_view_surface_list_destroy - Evict all views pointing to a surface
0433  *
0434  * @dev_priv: Pointer to a device private struct.
0435  * @list: List of views pointing to a surface.
0436  *
0437  * This function evicts all views pointing to a surface. This is typically
0438  * called before the surface is evicted.
0439  */
0440 void vmw_view_surface_list_destroy(struct vmw_private *dev_priv,
0441                    struct list_head *list)
0442 {
0443     struct vmw_view *entry, *next;
0444 
0445     lockdep_assert_held_once(&dev_priv->binding_mutex);
0446 
0447     list_for_each_entry_safe(entry, next, list, srf_head)
0448         WARN_ON(vmw_view_destroy(&entry->res));
0449 }
0450 
0451 /**
0452  * vmw_view_srf - Return a non-refcounted pointer to the surface a view is
0453  * pointing to.
0454  *
0455  * @res: pointer to a view resource.
0456  *
0457  * Note that the view itself is holding a reference, so as long
0458  * the view resource is alive, the surface resource will be.
0459  */
0460 struct vmw_resource *vmw_view_srf(struct vmw_resource *res)
0461 {
0462     return vmw_view(res)->srf;
0463 }
0464 
0465 /**
0466  * vmw_view_lookup - Look up a view.
0467  *
0468  * @man: The context's cmdbuf ref manager.
0469  * @view_type: The view type.
0470  * @user_key: The view user id.
0471  *
0472  * returns a refcounted pointer to a view or an error pointer if not found.
0473  */
0474 struct vmw_resource *vmw_view_lookup(struct vmw_cmdbuf_res_manager *man,
0475                      enum vmw_view_type view_type,
0476                      u32 user_key)
0477 {
0478     return vmw_cmdbuf_res_lookup(man, vmw_cmdbuf_res_view,
0479                      vmw_view_key(user_key, view_type));
0480 }
0481 
0482 /**
0483  * vmw_view_dirtying - Return whether a view type is dirtying its resource
0484  * @res: Pointer to the view
0485  *
0486  * Each time a resource is put on the validation list as the result of a
0487  * view pointing to it, we need to determine whether that resource will
0488  * be dirtied (written to by the GPU) as a result of the corresponding
0489  * GPU operation. Currently only rendertarget-, depth-stencil and unordered
0490  * access views are capable of dirtying its resource.
0491  *
0492  * Return: Whether the view type of @res dirties the resource it points to.
0493  */
0494 u32 vmw_view_dirtying(struct vmw_resource *res)
0495 {
0496     static u32 view_is_dirtying[vmw_view_max] = {
0497         [vmw_view_rt] = VMW_RES_DIRTY_SET,
0498         [vmw_view_ds] = VMW_RES_DIRTY_SET,
0499         [vmw_view_ua] = VMW_RES_DIRTY_SET,
0500     };
0501 
0502     /* Update this function as we add more view types */
0503     BUILD_BUG_ON(vmw_view_max != 4);
0504     return view_is_dirtying[vmw_view(res)->view_type];
0505 }
0506 
0507 const u32 vmw_view_destroy_cmds[] = {
0508     [vmw_view_sr] = SVGA_3D_CMD_DX_DESTROY_SHADERRESOURCE_VIEW,
0509     [vmw_view_rt] = SVGA_3D_CMD_DX_DESTROY_RENDERTARGET_VIEW,
0510     [vmw_view_ds] = SVGA_3D_CMD_DX_DESTROY_DEPTHSTENCIL_VIEW,
0511     [vmw_view_ua] = SVGA_3D_CMD_DX_DESTROY_UA_VIEW,
0512 };
0513 
0514 const SVGACOTableType vmw_view_cotables[] = {
0515     [vmw_view_sr] = SVGA_COTABLE_SRVIEW,
0516     [vmw_view_rt] = SVGA_COTABLE_RTVIEW,
0517     [vmw_view_ds] = SVGA_COTABLE_DSVIEW,
0518     [vmw_view_ua] = SVGA_COTABLE_UAVIEW,
0519 };
0520 
0521 const SVGACOTableType vmw_so_cotables[] = {
0522     [vmw_so_el] = SVGA_COTABLE_ELEMENTLAYOUT,
0523     [vmw_so_bs] = SVGA_COTABLE_BLENDSTATE,
0524     [vmw_so_ds] = SVGA_COTABLE_DEPTHSTENCIL,
0525     [vmw_so_rs] = SVGA_COTABLE_RASTERIZERSTATE,
0526     [vmw_so_ss] = SVGA_COTABLE_SAMPLER,
0527     [vmw_so_so] = SVGA_COTABLE_STREAMOUTPUT,
0528     [vmw_so_max]= SVGA_COTABLE_MAX
0529 };
0530 
0531 
0532 /* To remove unused function warning */
0533 static void vmw_so_build_asserts(void) __attribute__((used));
0534 
0535 
0536 /*
0537  * This function is unused at run-time, and only used to dump various build
0538  * asserts important for code optimization assumptions.
0539  */
0540 static void vmw_so_build_asserts(void)
0541 {
0542     /* Assert that our vmw_view_cmd_to_type() function is correct. */
0543     BUILD_BUG_ON(SVGA_3D_CMD_DX_DESTROY_SHADERRESOURCE_VIEW !=
0544              SVGA_3D_CMD_DX_DEFINE_SHADERRESOURCE_VIEW + 1);
0545     BUILD_BUG_ON(SVGA_3D_CMD_DX_DEFINE_RENDERTARGET_VIEW !=
0546              SVGA_3D_CMD_DX_DEFINE_SHADERRESOURCE_VIEW + 2);
0547     BUILD_BUG_ON(SVGA_3D_CMD_DX_DESTROY_RENDERTARGET_VIEW !=
0548              SVGA_3D_CMD_DX_DEFINE_SHADERRESOURCE_VIEW + 3);
0549     BUILD_BUG_ON(SVGA_3D_CMD_DX_DEFINE_DEPTHSTENCIL_VIEW !=
0550              SVGA_3D_CMD_DX_DEFINE_SHADERRESOURCE_VIEW + 4);
0551     BUILD_BUG_ON(SVGA_3D_CMD_DX_DESTROY_DEPTHSTENCIL_VIEW !=
0552              SVGA_3D_CMD_DX_DEFINE_SHADERRESOURCE_VIEW + 5);
0553 
0554     /* Assert that our "one body fits all" assumption is valid */
0555     BUILD_BUG_ON(sizeof(union vmw_view_destroy) != sizeof(u32));
0556 
0557     /* Assert that the view key space can hold all view ids. */
0558     BUILD_BUG_ON(SVGA_COTABLE_MAX_IDS >= ((1 << 20) - 1));
0559 
0560     /*
0561      * Assert that the offset of sid in all view define commands
0562      * is what we assume it to be.
0563      */
0564     BUILD_BUG_ON(offsetof(struct vmw_view_define, sid) !=
0565              offsetof(SVGA3dCmdDXDefineShaderResourceView, sid));
0566     BUILD_BUG_ON(offsetof(struct vmw_view_define, sid) !=
0567              offsetof(SVGA3dCmdDXDefineRenderTargetView, sid));
0568     BUILD_BUG_ON(offsetof(struct vmw_view_define, sid) !=
0569              offsetof(SVGA3dCmdDXDefineDepthStencilView, sid));
0570     BUILD_BUG_ON(offsetof(struct vmw_view_define, sid) !=
0571              offsetof(SVGA3dCmdDXDefineUAView, sid));
0572     BUILD_BUG_ON(offsetof(struct vmw_view_define, sid) !=
0573              offsetof(SVGA3dCmdDXDefineDepthStencilView_v2, sid));
0574 }