Lines Matching full:shader
45 struct vmw_shader shader; member
127 * Shader management:
167 struct vmw_shader *shader = vmw_res_to_shader(res); in vmw_gb_shader_init() local
186 shader->size = size; in vmw_gb_shader_init()
187 shader->type = type; in vmw_gb_shader_init()
188 shader->num_input_sig = num_input_sig; in vmw_gb_shader_init()
189 shader->num_output_sig = num_output_sig; in vmw_gb_shader_init()
196 * GB shader code:
202 struct vmw_shader *shader = vmw_res_to_shader(res); in vmw_gb_shader_create() local
214 DRM_ERROR("Failed to allocate a shader id.\n"); in vmw_gb_shader_create()
232 cmd->body.type = shader->type; in vmw_gb_shader_create()
233 cmd->body.sizeInBytes = shader->size; in vmw_gb_shader_create()
343 * DX shader code:
347 * vmw_dx_shader_commit_notify - Notify that a shader operation has been
350 * @res: Pointer to the shader resource.
357 struct vmw_dx_shader *shader = vmw_res_to_dx_shader(res); in vmw_dx_shader_commit_notify() local
362 vmw_cotable_add_resource(shader->cotable, in vmw_dx_shader_commit_notify()
363 &shader->cotable_head); in vmw_dx_shader_commit_notify()
364 shader->committed = true; in vmw_dx_shader_commit_notify()
365 res->id = shader->id; in vmw_dx_shader_commit_notify()
369 list_del_init(&shader->cotable_head); in vmw_dx_shader_commit_notify()
370 shader->committed = false; in vmw_dx_shader_commit_notify()
377 * vmw_dx_shader_unscrub - Have the device reattach a MOB to a DX shader.
379 * @res: The shader resource
385 struct vmw_dx_shader *shader = vmw_res_to_dx_shader(res); in vmw_dx_shader_unscrub() local
392 if (!list_empty(&shader->cotable_head) || !shader->committed) in vmw_dx_shader_unscrub()
395 cmd = VMW_CMD_CTX_RESERVE(dev_priv, sizeof(*cmd), shader->ctx->id); in vmw_dx_shader_unscrub()
401 cmd->body.cid = shader->ctx->id; in vmw_dx_shader_unscrub()
402 cmd->body.shid = shader->id; in vmw_dx_shader_unscrub()
407 vmw_cotable_add_resource(shader->cotable, &shader->cotable_head); in vmw_dx_shader_unscrub()
413 * vmw_dx_shader_create - The DX shader create callback
415 * @res: The DX shader resource
418 * makes sure that we unscrub the shader if it's previously been scrubbed.
423 struct vmw_dx_shader *shader = vmw_res_to_dx_shader(res); in vmw_dx_shader_create() local
426 WARN_ON_ONCE(!shader->committed); in vmw_dx_shader_create()
434 res->id = shader->id; in vmw_dx_shader_create()
439 * vmw_dx_shader_bind - The DX shader bind callback
441 * @res: The DX shader resource
460 * vmw_dx_shader_scrub - Have the device unbind a MOB from a DX shader.
462 * @res: The shader resource
464 * This function unbinds a MOB from the DX shader without requiring the
471 struct vmw_dx_shader *shader = vmw_res_to_dx_shader(res); in vmw_dx_shader_scrub() local
478 if (list_empty(&shader->cotable_head)) in vmw_dx_shader_scrub()
481 WARN_ON_ONCE(!shader->committed); in vmw_dx_shader_scrub()
488 cmd->body.cid = shader->ctx->id; in vmw_dx_shader_scrub()
494 list_del_init(&shader->cotable_head); in vmw_dx_shader_scrub()
500 * vmw_dx_shader_unbind - The dx shader unbind callback.
502 * @res: The shader resource
541 * Scrubs all shader MOBs so that any subsequent shader unbind or shader
560 * vmw_dx_shader_res_free - The DX shader free callback
562 * @res: The shader resource
564 * Frees the DX shader resource.
568 struct vmw_dx_shader *shader = vmw_res_to_dx_shader(res); in vmw_dx_shader_res_free() local
570 vmw_resource_unreference(&shader->cotable); in vmw_dx_shader_res_free()
571 kfree(shader); in vmw_dx_shader_res_free()
575 * vmw_dx_shader_add - Add a shader resource as a command buffer managed
580 * @user_key: The id used for this shader.
581 * @shader_type: The shader type.
590 struct vmw_dx_shader *shader; in vmw_dx_shader_add() local
598 shader = kmalloc(sizeof(*shader), GFP_KERNEL); in vmw_dx_shader_add()
599 if (!shader) { in vmw_dx_shader_add()
603 res = &shader->res; in vmw_dx_shader_add()
604 shader->ctx = ctx; in vmw_dx_shader_add()
605 shader->cotable = vmw_resource_reference in vmw_dx_shader_add()
607 shader->id = user_key; in vmw_dx_shader_add()
608 shader->committed = false; in vmw_dx_shader_add()
609 INIT_LIST_HEAD(&shader->cotable_head); in vmw_dx_shader_add()
616 * The user_key name-space is not per shader type for DX shaders, in vmw_dx_shader_add()
617 * so when hashing, use a single zero shader type. in vmw_dx_shader_add()
625 res->id = shader->id; in vmw_dx_shader_add()
637 * User-space shader management:
644 shader.res); in vmw_user_shader_base_to_res()
650 container_of(res, struct vmw_user_shader, shader.res); in vmw_user_shader_free()
657 struct vmw_shader *shader = vmw_res_to_shader(res); in vmw_shader_free() local
659 kfree(shader); in vmw_shader_free()
705 res = &ushader->shader.res; in vmw_user_shader_alloc()
745 struct vmw_shader *shader; in vmw_shader_alloc() local
749 shader = kzalloc(sizeof(*shader), GFP_KERNEL); in vmw_shader_alloc()
750 if (unlikely(!shader)) { in vmw_shader_alloc()
755 res = &shader->res; in vmw_shader_alloc()
784 VMW_DEBUG_USER("Couldn't find buffer for shader creation.\n"); in vmw_shader_define()
789 VMW_DEBUG_USER("Illegal buffer- or shader size.\n"); in vmw_shader_define()
803 VMW_DEBUG_USER("Illegal shader type.\n"); in vmw_shader_define()
817 * vmw_shader_id_ok - Check whether a compat shader user key and
818 * shader type are within valid bounds.
820 * @user_key: User space id of the shader.
821 * @shader_type: Shader type.
831 * vmw_shader_key - Compute a hash key suitable for a compat shader.
833 * @user_key: User space id of the shader.
834 * @shader_type: Shader type.
845 * vmw_shader_remove - Stage a compat shader for removal.
847 * @man: Pointer to the compat shader manager identifying the shader namespace.
848 * @user_key: The key that is used to identify the shader. The key is
849 * unique to the shader type.
850 * @shader_type: Shader type.
868 * vmw_compat_shader_add - Create a compat shader and stage it for addition
872 * @man: Pointer to the compat shader manager identifying the shader namespace.
873 * @user_key: The key that is used to identify the shader. The key is
874 * unique to the shader type.
875 * @bytecode: Pointer to the bytecode of the shader.
876 * @shader_type: Shader type.
910 /* Map and copy shader bytecode. */ in vmw_compat_shader_add()
940 * vmw_shader_lookup - Look up a compat shader
943 * the shader namespace.
944 * @user_key: The user space id of the shader.
945 * @shader_type: The shader type.
947 * Returns a refcounted pointer to a struct vmw_resource if the shader was