staticint vmw_dx_streamoutput_create(struct vmw_resource *res)
{ struct vmw_private *dev_priv = res->dev_priv; struct vmw_dx_streamoutput *so = vmw_res_to_dx_streamoutput(res); int ret = 0;
WARN_ON_ONCE(!so->committed);
if (vmw_resource_mob_attached(res)) {
mutex_lock(&dev_priv->binding_mutex);
ret = vmw_dx_streamoutput_unscrub(res);
mutex_unlock(&dev_priv->binding_mutex);
}
staticvoid vmw_dx_streamoutput_hw_destroy(struct vmw_resource *res)
{ /* Destroyed by user-space cmd buf or as part of context takedown. */
res->id = -1;
}
/** * vmw_dx_streamoutput_add - Add a streamoutput as a cmd buf managed resource. * @man: Command buffer managed resource manager for current context. * @ctx: Pointer to context resource. * @user_key: The identifier for this streamoutput. * @list: The list of staged command buffer managed resources. * * Return: 0 on success, negative error code on failure.
*/ int vmw_dx_streamoutput_add(struct vmw_cmdbuf_res_manager *man, struct vmw_resource *ctx, u32 user_key, struct list_head *list)
{ struct vmw_dx_streamoutput *so; struct vmw_resource *res; struct vmw_private *dev_priv = ctx->dev_priv; int ret;
so = kmalloc(sizeof(*so), GFP_KERNEL); if (!so) { return -ENOMEM;
}
res = &so->res;
so->ctx = ctx;
so->cotable = vmw_resource_reference
(vmw_context_cotable(ctx, SVGA_COTABLE_STREAMOUTPUT));
so->id = user_key;
so->committed = false;
INIT_LIST_HEAD(&so->cotable_head);
ret = vmw_resource_init(dev_priv, res, true,
vmw_dx_streamoutput_res_free,
&vmw_dx_streamoutput_func); if (ret) goto out_resource_init;
ret = vmw_cmdbuf_res_add(man, vmw_cmdbuf_res_streamoutput, user_key,
res, list); if (ret) goto out_resource_init;
/** * vmw_dx_streamoutput_set_size - Sets streamoutput mob size in res struct. * @res: The streamoutput res for which need to set size. * @size: The size provided by user-space to set.
*/ void vmw_dx_streamoutput_set_size(struct vmw_resource *res, u32 size)
{ struct vmw_dx_streamoutput *so = vmw_res_to_dx_streamoutput(res);
so->size = size;
}
/** * vmw_dx_streamoutput_remove - Stage streamoutput for removal. * @man: Command buffer managed resource manager for current context. * @user_key: The identifier for this streamoutput. * @list: The list of staged command buffer managed resources. * * Return: 0 on success, negative error code on failure.
*/ int vmw_dx_streamoutput_remove(struct vmw_cmdbuf_res_manager *man,
u32 user_key, struct list_head *list)
{ struct vmw_resource *r;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.