Lines Matching full:shader
44 struct vmw_shader shader; member
124 * Shader management:
164 struct vmw_shader *shader = vmw_res_to_shader(res); in vmw_gb_shader_init() local
183 shader->size = size; in vmw_gb_shader_init()
184 shader->type = type; in vmw_gb_shader_init()
185 shader->num_input_sig = num_input_sig; in vmw_gb_shader_init()
186 shader->num_output_sig = num_output_sig; in vmw_gb_shader_init()
193 * GB shader code:
199 struct vmw_shader *shader = vmw_res_to_shader(res); in vmw_gb_shader_create() local
211 DRM_ERROR("Failed to allocate a shader id.\n"); in vmw_gb_shader_create()
229 cmd->body.type = shader->type; in vmw_gb_shader_create()
230 cmd->body.sizeInBytes = shader->size; in vmw_gb_shader_create()
340 * DX shader code:
344 * vmw_dx_shader_commit_notify - Notify that a shader operation has been
347 * @res: Pointer to the shader resource.
354 struct vmw_dx_shader *shader = vmw_res_to_dx_shader(res); in vmw_dx_shader_commit_notify() local
359 vmw_cotable_add_resource(shader->cotable, in vmw_dx_shader_commit_notify()
360 &shader->cotable_head); in vmw_dx_shader_commit_notify()
361 shader->committed = true; in vmw_dx_shader_commit_notify()
362 res->id = shader->id; in vmw_dx_shader_commit_notify()
366 list_del_init(&shader->cotable_head); in vmw_dx_shader_commit_notify()
367 shader->committed = false; in vmw_dx_shader_commit_notify()
374 * vmw_dx_shader_unscrub - Have the device reattach a MOB to a DX shader.
376 * @res: The shader resource
382 struct vmw_dx_shader *shader = vmw_res_to_dx_shader(res); in vmw_dx_shader_unscrub() local
389 if (!list_empty(&shader->cotable_head) || !shader->committed) in vmw_dx_shader_unscrub()
392 cmd = VMW_CMD_CTX_RESERVE(dev_priv, sizeof(*cmd), shader->ctx->id); in vmw_dx_shader_unscrub()
398 cmd->body.cid = shader->ctx->id; in vmw_dx_shader_unscrub()
399 cmd->body.shid = shader->id; in vmw_dx_shader_unscrub()
404 vmw_cotable_add_resource(shader->cotable, &shader->cotable_head); in vmw_dx_shader_unscrub()
410 * vmw_dx_shader_create - The DX shader create callback
412 * @res: The DX shader resource
415 * makes sure that we unscrub the shader if it's previously been scrubbed.
420 struct vmw_dx_shader *shader = vmw_res_to_dx_shader(res); in vmw_dx_shader_create() local
423 WARN_ON_ONCE(!shader->committed); in vmw_dx_shader_create()
431 res->id = shader->id; in vmw_dx_shader_create()
436 * vmw_dx_shader_bind - The DX shader bind callback
438 * @res: The DX shader resource
457 * vmw_dx_shader_scrub - Have the device unbind a MOB from a DX shader.
459 * @res: The shader resource
461 * This function unbinds a MOB from the DX shader without requiring the
468 struct vmw_dx_shader *shader = vmw_res_to_dx_shader(res); in vmw_dx_shader_scrub() local
475 if (list_empty(&shader->cotable_head)) in vmw_dx_shader_scrub()
478 WARN_ON_ONCE(!shader->committed); in vmw_dx_shader_scrub()
485 cmd->body.cid = shader->ctx->id; in vmw_dx_shader_scrub()
491 list_del_init(&shader->cotable_head); in vmw_dx_shader_scrub()
497 * vmw_dx_shader_unbind - The dx shader unbind callback.
499 * @res: The shader resource
538 * Scrubs all shader MOBs so that any subsequent shader unbind or shader
557 * vmw_dx_shader_res_free - The DX shader free callback
559 * @res: The shader resource
561 * Frees the DX shader resource.
565 struct vmw_dx_shader *shader = vmw_res_to_dx_shader(res); in vmw_dx_shader_res_free() local
567 vmw_resource_unreference(&shader->cotable); in vmw_dx_shader_res_free()
568 kfree(shader); in vmw_dx_shader_res_free()
572 * vmw_dx_shader_add - Add a shader resource as a command buffer managed
577 * @user_key: The id used for this shader.
578 * @shader_type: The shader type.
587 struct vmw_dx_shader *shader; in vmw_dx_shader_add() local
595 shader = kmalloc(sizeof(*shader), GFP_KERNEL); in vmw_dx_shader_add()
596 if (!shader) { in vmw_dx_shader_add()
600 res = &shader->res; in vmw_dx_shader_add()
601 shader->ctx = ctx; in vmw_dx_shader_add()
602 shader->cotable = vmw_resource_reference in vmw_dx_shader_add()
604 shader->id = user_key; in vmw_dx_shader_add()
605 shader->committed = false; in vmw_dx_shader_add()
606 INIT_LIST_HEAD(&shader->cotable_head); in vmw_dx_shader_add()
613 * The user_key name-space is not per shader type for DX shaders, in vmw_dx_shader_add()
614 * so when hashing, use a single zero shader type. in vmw_dx_shader_add()
622 res->id = shader->id; in vmw_dx_shader_add()
634 * User-space shader management:
641 shader.res); in vmw_user_shader_base_to_res()
647 container_of(res, struct vmw_user_shader, shader.res); in vmw_user_shader_free()
654 struct vmw_shader *shader = vmw_res_to_shader(res); in vmw_shader_free() local
656 kfree(shader); in vmw_shader_free()
702 res = &ushader->shader.res; in vmw_user_shader_alloc()
742 struct vmw_shader *shader; in vmw_shader_alloc() local
746 shader = kzalloc(sizeof(*shader), GFP_KERNEL); in vmw_shader_alloc()
747 if (unlikely(!shader)) { in vmw_shader_alloc()
752 res = &shader->res; in vmw_shader_alloc()
781 VMW_DEBUG_USER("Couldn't find buffer for shader creation.\n"); in vmw_shader_define()
786 VMW_DEBUG_USER("Illegal buffer- or shader size.\n"); in vmw_shader_define()
800 VMW_DEBUG_USER("Illegal shader type.\n"); in vmw_shader_define()
814 * vmw_shader_id_ok - Check whether a compat shader user key and
815 * shader type are within valid bounds.
817 * @user_key: User space id of the shader.
818 * @shader_type: Shader type.
828 * vmw_shader_key - Compute a hash key suitable for a compat shader.
830 * @user_key: User space id of the shader.
831 * @shader_type: Shader type.
842 * vmw_shader_remove - Stage a compat shader for removal.
844 * @man: Pointer to the compat shader manager identifying the shader namespace.
845 * @user_key: The key that is used to identify the shader. The key is
846 * unique to the shader type.
847 * @shader_type: Shader type.
865 * vmw_compat_shader_add - Create a compat shader and stage it for addition
869 * @man: Pointer to the compat shader manager identifying the shader namespace.
870 * @user_key: The key that is used to identify the shader. The key is
871 * unique to the shader type.
872 * @bytecode: Pointer to the bytecode of the shader.
873 * @shader_type: Shader type.
904 /* Map and copy shader bytecode. */ in vmw_compat_shader_add()
934 * vmw_shader_lookup - Look up a compat shader
937 * the shader namespace.
938 * @user_key: The user space id of the shader.
939 * @shader_type: The shader type.
941 * Returns a refcounted pointer to a struct vmw_resource if the shader was