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
46 * @ctx: Non-refcounted pointer to the context this view belongs to.
47 * @srf: Refcounted pointer to the surface pointed to by this view.
48 * @cotable: Refcounted pointer to the cotable holding this view.
49 * @srf_head: List head for the surface-to-view list.
51 * @view_type: View type.
52 * @view_id: User-space per context view id. Currently used also as per
53 * context device view id.
54 * @cmd_size: Size of the SVGA3D define view command that we've copied from the
56 * @committed: Whether the view is actually created or pending creation at the
58 * @cmd: The SVGA3D define view command copied from the command stream.
85 .type_name = "DX view",
92 * struct vmw_view - view define command body stub
94 * @view_id: The device id of the view being defined
95 * @sid: The surface id of the view being defined
98 * saved view define command.
118 * vmw_view_commit_notify - Notify that a view operation has been committed to
121 * @res: Pointer to the view resource.
128 struct vmw_view *view = vmw_view(res); in vmw_view_commit_notify() local
133 struct vmw_surface *srf = vmw_res_to_srf(view->srf); in vmw_view_commit_notify()
135 list_add_tail(&view->srf_head, &srf->view_list); in vmw_view_commit_notify()
136 vmw_cotable_add_resource(view->cotable, &view->cotable_head); in vmw_view_commit_notify()
137 view->committed = true; in vmw_view_commit_notify()
138 res->id = view->view_id; in vmw_view_commit_notify()
141 list_del_init(&view->cotable_head); in vmw_view_commit_notify()
142 list_del_init(&view->srf_head); in vmw_view_commit_notify()
143 view->committed = false; in vmw_view_commit_notify()
150 * vmw_view_create - Create a hardware view.
152 * @res: Pointer to the view resource.
154 * Create a hardware view. Typically used if that view has previously been
159 struct vmw_view *view = vmw_view(res); in vmw_view_create() local
160 struct vmw_surface *srf = vmw_res_to_srf(view->srf); in vmw_view_create()
168 if (!view->committed) { in vmw_view_create()
173 cmd = VMW_FIFO_RESERVE_DX(res->dev_priv, view->cmd_size, view->ctx->id); in vmw_view_create()
179 memcpy(cmd, &view->cmd, view->cmd_size); in vmw_view_create()
180 WARN_ON(cmd->body.view_id != view->view_id); in vmw_view_create()
182 WARN_ON(view->srf->id == SVGA3D_INVALID_ID); in vmw_view_create()
183 cmd->body.sid = view->srf->id; in vmw_view_create()
184 vmw_fifo_commit(res->dev_priv, view->cmd_size); in vmw_view_create()
185 res->id = view->view_id; in vmw_view_create()
186 list_add_tail(&view->srf_head, &srf->view_list); in vmw_view_create()
187 vmw_cotable_add_resource(view->cotable, &view->cotable_head); in vmw_view_create()
194 * vmw_view_destroy - Destroy a hardware view.
196 * @res: Pointer to the view resource.
198 * Destroy a hardware view. Typically used on unexpected termination of the
199 * owning process or if the surface the view is pointing to is destroyed.
204 struct vmw_view *view = vmw_view(res); in vmw_view_destroy() local
213 if (!view->committed || res->id == -1) in vmw_view_destroy()
216 cmd = VMW_FIFO_RESERVE_DX(dev_priv, sizeof(*cmd), view->ctx->id); in vmw_view_destroy()
220 cmd->header.id = vmw_view_destroy_cmds[view->view_type]; in vmw_view_destroy()
222 cmd->body.view_id = view->view_id; in vmw_view_destroy()
225 list_del_init(&view->cotable_head); in vmw_view_destroy()
226 list_del_init(&view->srf_head); in vmw_view_destroy()
232 * vmw_hw_view_destroy - Destroy a hardware view as part of resource cleanup.
234 * @res: Pointer to the view resource.
236 * Destroy a hardware view if it's still present.
249 * vmw_view_key - Compute a view key suitable for the cmdbuf resource manager
251 * @user_key: The user-space id used for the view.
252 * @view_type: The view type.
254 * Destroy a hardware view if it's still present.
262 * vmw_view_id_ok - Basic view id and type range checks.
264 * @user_key: The user-space id used for the view.
265 * @view_type: The view type.
267 * Checks that the view id and type (typically provided by user-space) is
277 * vmw_view_res_free - resource res_free callback for view resources
285 struct vmw_view *view = vmw_view(res); in vmw_view_res_free() local
286 size_t size = offsetof(struct vmw_view, cmd) + view->cmd_size; in vmw_view_res_free()
289 vmw_resource_unreference(&view->cotable); in vmw_view_res_free()
290 vmw_resource_unreference(&view->srf); in vmw_view_res_free()
291 kfree_rcu(view, rcu); in vmw_view_res_free()
296 * vmw_view_add - Create a view resource and stage it for addition
301 * @srf: Pointer to a struct vmw_resource identifying the surface the view
303 * @view_type: The view type deduced from the view create command.
305 * unique to the view type and to the context.
306 * @cmd: Pointer to the view create command in the command stream.
307 * @cmd_size: Size of the view create command in the command stream.
328 struct vmw_view *view; in vmw_view_add() local
338 VMW_DEBUG_USER("Illegal view create command size.\n"); in vmw_view_add()
343 VMW_DEBUG_USER("Illegal view add view id.\n"); in vmw_view_add()
352 DRM_ERROR("Out of graphics memory for view creation\n"); in vmw_view_add()
356 view = kmalloc(size, GFP_KERNEL); in vmw_view_add()
357 if (!view) { in vmw_view_add()
362 res = &view->res; in vmw_view_add()
363 view->ctx = ctx; in vmw_view_add()
364 view->srf = vmw_resource_reference(srf); in vmw_view_add()
365 view->cotable = vmw_resource_reference in vmw_view_add()
367 view->view_type = view_type; in vmw_view_add()
368 view->view_id = user_key; in vmw_view_add()
369 view->cmd_size = cmd_size; in vmw_view_add()
370 view->committed = false; in vmw_view_add()
371 INIT_LIST_HEAD(&view->srf_head); in vmw_view_add()
372 INIT_LIST_HEAD(&view->cotable_head); in vmw_view_add()
373 memcpy(&view->cmd, cmd, cmd_size); in vmw_view_add()
385 res->id = view->view_id; in vmw_view_add()
395 * vmw_view_remove - Stage a view for removal.
397 * @man: Pointer to the view manager identifying the shader namespace.
398 * @user_key: The key that is used to identify the view. The key is
399 * unique to the view type.
400 * @view_type: View type
412 VMW_DEBUG_USER("Illegal view remove view id.\n"); in vmw_view_remove()
430 * a reference to the view resource. This is typically called before the
466 * vmw_view_srf - Return a non-refcounted pointer to the surface a view is
469 * @res: pointer to a view resource.
471 * Note that the view itself is holding a reference, so as long
472 * the view resource is alive, the surface resource will be.
480 * vmw_view_lookup - Look up a view.
483 * @view_type: The view type.
484 * @user_key: The view user id.
486 * returns a refcounted pointer to a view or an error pointer if not found.
497 * vmw_view_dirtying - Return whether a view type is dirtying its resource
498 * @res: Pointer to the view
501 * view pointing to it, we need to determine whether that resource will
506 * Return: Whether the view type of @res dirties the resource it points to.
516 /* Update this function as we add more view types */ in vmw_view_dirtying()
570 /* Assert that the view key space can hold all view ids. */ in vmw_so_build_asserts()
574 * Assert that the offset of sid in all view define commands in vmw_so_build_asserts()