Lines Matching full:view
37 * to it, and all context bindings of that view. Similarly we must restore
38 * the view bindings, views and surfaces pointed to by the views when a
43 * struct vmw_view - view metadata
47 * @ctx: Non-refcounted pointer to the context this view belongs to.
48 * @srf: Refcounted pointer to the surface pointed to by this view.
49 * @cotable: Refcounted pointer to the cotable holding this view.
50 * @srf_head: List head for the surface-to-view list.
52 * @view_type: View type.
53 * @view_id: User-space per context view id. Currently used also as per
54 * context device view id.
55 * @cmd_size: Size of the SVGA3D define view command that we've copied from the
57 * @committed: Whether the view is actually created or pending creation at the
59 * @cmd: The SVGA3D define view command copied from the command stream.
86 .type_name = "DX view",
93 * struct vmw_view_define - view define command body stub
95 * @view_id: The device id of the view being defined
96 * @sid: The surface id of the view being defined
99 * saved view define command.
119 * vmw_view_commit_notify - Notify that a view operation has been committed to
122 * @res: Pointer to the view resource.
129 struct vmw_view *view = vmw_view(res); in vmw_view_commit_notify() local
134 struct vmw_surface *srf = vmw_res_to_srf(view->srf); in vmw_view_commit_notify()
136 list_add_tail(&view->srf_head, &srf->view_list); in vmw_view_commit_notify()
137 vmw_cotable_add_resource(view->cotable, &view->cotable_head); in vmw_view_commit_notify()
138 view->committed = true; in vmw_view_commit_notify()
139 res->id = view->view_id; in vmw_view_commit_notify()
142 list_del_init(&view->cotable_head); in vmw_view_commit_notify()
143 list_del_init(&view->srf_head); in vmw_view_commit_notify()
144 view->committed = false; in vmw_view_commit_notify()
151 * vmw_view_create - Create a hardware view.
153 * @res: Pointer to the view resource.
155 * Create a hardware view. Typically used if that view has previously been
160 struct vmw_view *view = vmw_view(res); in vmw_view_create() local
161 struct vmw_surface *srf = vmw_res_to_srf(view->srf); in vmw_view_create()
169 if (!view->committed) { in vmw_view_create()
174 cmd = VMW_CMD_CTX_RESERVE(res->dev_priv, view->cmd_size, view->ctx->id); in vmw_view_create()
180 memcpy(cmd, &view->cmd, view->cmd_size); in vmw_view_create()
181 WARN_ON(cmd->body.view_id != view->view_id); in vmw_view_create()
183 WARN_ON(view->srf->id == SVGA3D_INVALID_ID); in vmw_view_create()
184 cmd->body.sid = view->srf->id; in vmw_view_create()
185 vmw_cmd_commit(res->dev_priv, view->cmd_size); in vmw_view_create()
186 res->id = view->view_id; in vmw_view_create()
187 list_add_tail(&view->srf_head, &srf->view_list); in vmw_view_create()
188 vmw_cotable_add_resource(view->cotable, &view->cotable_head); in vmw_view_create()
195 * vmw_view_destroy - Destroy a hardware view.
197 * @res: Pointer to the view resource.
199 * Destroy a hardware view. Typically used on unexpected termination of the
200 * owning process or if the surface the view is pointing to is destroyed.
205 struct vmw_view *view = vmw_view(res); in vmw_view_destroy() local
214 if (!view->committed || res->id == -1) in vmw_view_destroy()
217 cmd = VMW_CMD_CTX_RESERVE(dev_priv, sizeof(*cmd), view->ctx->id); in vmw_view_destroy()
221 cmd->header.id = vmw_view_destroy_cmds[view->view_type]; in vmw_view_destroy()
223 cmd->body.view_id = view->view_id; in vmw_view_destroy()
226 list_del_init(&view->cotable_head); in vmw_view_destroy()
227 list_del_init(&view->srf_head); in vmw_view_destroy()
233 * vmw_hw_view_destroy - Destroy a hardware view as part of resource cleanup.
235 * @res: Pointer to the view resource.
237 * Destroy a hardware view if it's still present.
250 * vmw_view_key - Compute a view key suitable for the cmdbuf resource manager
252 * @user_key: The user-space id used for the view.
253 * @view_type: The view type.
255 * Destroy a hardware view if it's still present.
263 * vmw_view_id_ok - Basic view id and type range checks.
265 * @user_key: The user-space id used for the view.
266 * @view_type: The view type.
268 * Checks that the view id and type (typically provided by user-space) is
278 * vmw_view_res_free - resource res_free callback for view resources
286 struct vmw_view *view = vmw_view(res); in vmw_view_res_free() local
288 vmw_resource_unreference(&view->cotable); in vmw_view_res_free()
289 vmw_resource_unreference(&view->srf); in vmw_view_res_free()
290 kfree_rcu(view, rcu); in vmw_view_res_free()
294 * vmw_view_add - Create a view resource and stage it for addition
299 * @srf: Pointer to a struct vmw_resource identifying the surface the view
301 * @view_type: The view type deduced from the view create command.
303 * unique to the view type and to the context.
304 * @cmd: Pointer to the view create command in the command stream.
305 * @cmd_size: Size of the view create command in the command stream.
326 struct vmw_view *view; in vmw_view_add() local
332 VMW_DEBUG_USER("Illegal view create command size.\n"); in vmw_view_add()
337 VMW_DEBUG_USER("Illegal view add view id.\n"); in vmw_view_add()
343 view = kmalloc(size, GFP_KERNEL); in vmw_view_add()
344 if (!view) { in vmw_view_add()
348 res = &view->res; in vmw_view_add()
349 view->ctx = ctx; in vmw_view_add()
350 view->srf = vmw_resource_reference(srf); in vmw_view_add()
351 view->cotable = vmw_resource_reference in vmw_view_add()
353 view->view_type = view_type; in vmw_view_add()
354 view->view_id = user_key; in vmw_view_add()
355 view->cmd_size = cmd_size; in vmw_view_add()
356 view->committed = false; in vmw_view_add()
357 INIT_LIST_HEAD(&view->srf_head); in vmw_view_add()
358 INIT_LIST_HEAD(&view->cotable_head); in vmw_view_add()
359 memcpy(&view->cmd, cmd, cmd_size); in vmw_view_add()
371 res->id = view->view_id; in vmw_view_add()
381 * vmw_view_remove - Stage a view for removal.
383 * @man: Pointer to the view manager identifying the shader namespace.
384 * @user_key: The key that is used to identify the view. The key is
385 * unique to the view type.
386 * @view_type: View type
398 VMW_DEBUG_USER("Illegal view remove view id.\n"); in vmw_view_remove()
416 * a reference to the view resource. This is typically called before the
452 * vmw_view_srf - Return a non-refcounted pointer to the surface a view is
455 * @res: pointer to a view resource.
457 * Note that the view itself is holding a reference, so as long
458 * the view resource is alive, the surface resource will be.
466 * vmw_view_lookup - Look up a view.
469 * @view_type: The view type.
470 * @user_key: The view user id.
472 * returns a refcounted pointer to a view or an error pointer if not found.
483 * vmw_view_dirtying - Return whether a view type is dirtying its resource
484 * @res: Pointer to the view
487 * view pointing to it, we need to determine whether that resource will
492 * Return: Whether the view type of @res dirties the resource it points to.
502 /* Update this function as we add more view types */ in vmw_view_dirtying()
557 /* Assert that the view key space can hold all view ids. */ in vmw_so_build_asserts()
561 * Assert that the offset of sid in all view define commands in vmw_so_build_asserts()