• Home
  • Raw
  • Download

Lines Matching full:shader

44 	struct vmw_shader shader;  member
125 * Shader management:
165 struct vmw_shader *shader = vmw_res_to_shader(res); in vmw_gb_shader_init() local
184 shader->size = size; in vmw_gb_shader_init()
185 shader->type = type; in vmw_gb_shader_init()
186 shader->num_input_sig = num_input_sig; in vmw_gb_shader_init()
187 shader->num_output_sig = num_output_sig; in vmw_gb_shader_init()
194 * GB shader code:
200 struct vmw_shader *shader = vmw_res_to_shader(res); in vmw_gb_shader_create() local
212 DRM_ERROR("Failed to allocate a shader id.\n"); in vmw_gb_shader_create()
223 DRM_ERROR("Failed reserving FIFO space for shader " 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()
259 DRM_ERROR("Failed reserving FIFO space for shader " in vmw_gb_shader_bind()
290 DRM_ERROR("Failed reserving FIFO space for shader " in vmw_gb_shader_unbind()
333 DRM_ERROR("Failed reserving FIFO space for shader " in vmw_gb_shader_destroy()
351 * DX shader code:
355 * vmw_dx_shader_commit_notify - Notify that a shader operation has been
358 * @res: Pointer to the shader resource.
365 struct vmw_dx_shader *shader = vmw_res_to_dx_shader(res); in vmw_dx_shader_commit_notify() local
370 vmw_cotable_add_resource(shader->cotable, in vmw_dx_shader_commit_notify()
371 &shader->cotable_head); in vmw_dx_shader_commit_notify()
372 shader->committed = true; in vmw_dx_shader_commit_notify()
373 res->id = shader->id; in vmw_dx_shader_commit_notify()
377 list_del_init(&shader->cotable_head); in vmw_dx_shader_commit_notify()
378 shader->committed = false; in vmw_dx_shader_commit_notify()
385 * vmw_dx_shader_unscrub - Have the device reattach a MOB to a DX shader.
387 * @res: The shader resource
393 struct vmw_dx_shader *shader = vmw_res_to_dx_shader(res); in vmw_dx_shader_unscrub() local
400 if (!list_empty(&shader->cotable_head) || !shader->committed) in vmw_dx_shader_unscrub()
404 shader->ctx->id); in vmw_dx_shader_unscrub()
406 DRM_ERROR("Failed reserving FIFO space for shader " in vmw_dx_shader_unscrub()
413 cmd->body.cid = shader->ctx->id; in vmw_dx_shader_unscrub()
414 cmd->body.shid = shader->id; in vmw_dx_shader_unscrub()
419 vmw_cotable_add_resource(shader->cotable, &shader->cotable_head); in vmw_dx_shader_unscrub()
425 * vmw_dx_shader_create - The DX shader create callback
427 * @res: The DX shader resource
430 * makes sure that we unscrub the shader if it's previously been scrubbed.
435 struct vmw_dx_shader *shader = vmw_res_to_dx_shader(res); in vmw_dx_shader_create() local
438 WARN_ON_ONCE(!shader->committed); in vmw_dx_shader_create()
446 res->id = shader->id; in vmw_dx_shader_create()
451 * vmw_dx_shader_bind - The DX shader bind callback
453 * @res: The DX shader resource
472 * vmw_dx_shader_scrub - Have the device unbind a MOB from a DX shader.
474 * @res: The shader resource
476 * This function unbinds a MOB from the DX shader without requiring the
483 struct vmw_dx_shader *shader = vmw_res_to_dx_shader(res); in vmw_dx_shader_scrub() local
490 if (list_empty(&shader->cotable_head)) in vmw_dx_shader_scrub()
493 WARN_ON_ONCE(!shader->committed); in vmw_dx_shader_scrub()
496 DRM_ERROR("Failed reserving FIFO space for shader " in vmw_dx_shader_scrub()
503 cmd->body.cid = shader->ctx->id; in vmw_dx_shader_scrub()
509 list_del_init(&shader->cotable_head); in vmw_dx_shader_scrub()
515 * vmw_dx_shader_unbind - The dx shader unbind callback.
517 * @res: The shader resource
556 * Scrubs all shader MOBs so that any subsequent shader unbind or shader
575 * vmw_dx_shader_res_free - The DX shader free callback
577 * @res: The shader resource
579 * Frees the DX shader resource and updates memory accounting.
584 struct vmw_dx_shader *shader = vmw_res_to_dx_shader(res); in vmw_dx_shader_res_free() local
586 vmw_resource_unreference(&shader->cotable); in vmw_dx_shader_res_free()
587 kfree(shader); in vmw_dx_shader_res_free()
592 * vmw_dx_shader_add - Add a shader resource as a command buffer managed
597 * @user_key: The id used for this shader.
598 * @shader_type: The shader type.
607 struct vmw_dx_shader *shader; in vmw_dx_shader_add() local
617 vmw_shader_dx_size = ttm_round_pot(sizeof(*shader)); in vmw_dx_shader_add()
626 DRM_ERROR("Out of graphics memory for shader " in vmw_dx_shader_add()
631 shader = kmalloc(sizeof(*shader), GFP_KERNEL); in vmw_dx_shader_add()
632 if (!shader) { in vmw_dx_shader_add()
637 res = &shader->res; in vmw_dx_shader_add()
638 shader->ctx = ctx; in vmw_dx_shader_add()
639 shader->cotable = vmw_context_cotable(ctx, SVGA_COTABLE_DXSHADER); in vmw_dx_shader_add()
640 shader->id = user_key; in vmw_dx_shader_add()
641 shader->committed = false; in vmw_dx_shader_add()
642 INIT_LIST_HEAD(&shader->cotable_head); in vmw_dx_shader_add()
649 * The user_key name-space is not per shader type for DX shaders, in vmw_dx_shader_add()
650 * so when hashing, use a single zero shader type. in vmw_dx_shader_add()
658 res->id = shader->id; in vmw_dx_shader_add()
670 * User-space shader management:
677 shader.res); in vmw_user_shader_base_to_res()
683 container_of(res, struct vmw_user_shader, shader.res); in vmw_user_shader_free()
693 struct vmw_shader *shader = vmw_res_to_shader(res); in vmw_shader_free() local
696 kfree(shader); in vmw_shader_free()
756 DRM_ERROR("Out of graphics memory for shader " in vmw_user_shader_alloc()
769 res = &ushader->shader.res; in vmw_user_shader_alloc()
809 struct vmw_shader *shader; in vmw_shader_alloc() local
830 DRM_ERROR("Out of graphics memory for shader " in vmw_shader_alloc()
835 shader = kzalloc(sizeof(*shader), GFP_KERNEL); in vmw_shader_alloc()
836 if (unlikely(!shader)) { in vmw_shader_alloc()
843 res = &shader->res; in vmw_shader_alloc()
873 DRM_ERROR("Could not find buffer for shader " in vmw_shader_define()
880 DRM_ERROR("Illegal buffer- or shader size.\n"); in vmw_shader_define()
894 DRM_ERROR("Illegal shader type.\n"); in vmw_shader_define()
914 * vmw_shader_id_ok - Check whether a compat shader user key and
915 * shader type are within valid bounds.
917 * @user_key: User space id of the shader.
918 * @shader_type: Shader type.
928 * vmw_shader_key - Compute a hash key suitable for a compat shader.
930 * @user_key: User space id of the shader.
931 * @shader_type: Shader type.
942 * vmw_shader_remove - Stage a compat shader for removal.
944 * @man: Pointer to the compat shader manager identifying the shader namespace.
945 * @user_key: The key that is used to identify the shader. The key is
946 * unique to the shader type.
947 * @shader_type: Shader type.
965 * vmw_compat_shader_add - Create a compat shader and stage it for addition
968 * @man: Pointer to the compat shader manager identifying the shader namespace.
969 * @user_key: The key that is used to identify the shader. The key is
970 * unique to the shader type.
971 * @bytecode: Pointer to the bytecode of the shader.
972 * @shader_type: Shader type.
973 * @tfile: Pointer to a struct ttm_object_file that the guest-backed shader is
1009 /* Map and copy shader bytecode. */ in vmw_compat_shader_add()
1040 * vmw_shader_lookup - Look up a compat shader
1043 * the shader namespace.
1044 * @user_key: The user space id of the shader.
1045 * @shader_type: The shader type.
1047 * Returns a refcounted pointer to a struct vmw_resource if the shader was