Lines Matching defs:shader
44 struct vmw_shader shader;
169 struct vmw_shader *shader = vmw_res_to_shader(res);
188 shader->size = size;
189 shader->type = type;
190 shader->num_input_sig = num_input_sig;
191 shader->num_output_sig = num_output_sig;
198 * GB shader code:
204 struct vmw_shader *shader = vmw_res_to_shader(res);
216 DRM_ERROR("Failed to allocate a shader id.\n");
234 cmd->body.type = shader->type;
235 cmd->body.sizeInBytes = shader->size;
345 * DX shader code:
349 * vmw_dx_shader_commit_notify - Notify that a shader operation has been
352 * @res: Pointer to the shader resource.
359 struct vmw_dx_shader *shader = vmw_res_to_dx_shader(res);
364 vmw_cotable_add_resource(shader->cotable,
365 &shader->cotable_head);
366 shader->committed = true;
367 res->id = shader->id;
371 list_del_init(&shader->cotable_head);
372 shader->committed = false;
379 * vmw_dx_shader_unscrub - Have the device reattach a MOB to a DX shader.
381 * @res: The shader resource
387 struct vmw_dx_shader *shader = vmw_res_to_dx_shader(res);
394 if (!list_empty(&shader->cotable_head) || !shader->committed)
397 cmd = VMW_FIFO_RESERVE_DX(dev_priv, sizeof(*cmd), shader->ctx->id);
403 cmd->body.cid = shader->ctx->id;
404 cmd->body.shid = shader->id;
409 vmw_cotable_add_resource(shader->cotable, &shader->cotable_head);
415 * vmw_dx_shader_create - The DX shader create callback
417 * @res: The DX shader resource
420 * makes sure that we unscrub the shader if it's previously been scrubbed.
425 struct vmw_dx_shader *shader = vmw_res_to_dx_shader(res);
428 WARN_ON_ONCE(!shader->committed);
436 res->id = shader->id;
441 * vmw_dx_shader_bind - The DX shader bind callback
443 * @res: The DX shader resource
462 * vmw_dx_shader_scrub - Have the device unbind a MOB from a DX shader.
464 * @res: The shader resource
466 * This function unbinds a MOB from the DX shader without requiring the
473 struct vmw_dx_shader *shader = vmw_res_to_dx_shader(res);
480 if (list_empty(&shader->cotable_head))
483 WARN_ON_ONCE(!shader->committed);
490 cmd->body.cid = shader->ctx->id;
496 list_del_init(&shader->cotable_head);
502 * vmw_dx_shader_unbind - The dx shader unbind callback.
504 * @res: The shader resource
543 * Scrubs all shader MOBs so that any subsequent shader unbind or shader
562 * vmw_dx_shader_res_free - The DX shader free callback
564 * @res: The shader resource
566 * Frees the DX shader resource and updates memory accounting.
571 struct vmw_dx_shader *shader = vmw_res_to_dx_shader(res);
573 vmw_resource_unreference(&shader->cotable);
574 kfree(shader);
579 * vmw_dx_shader_add - Add a shader resource as a command buffer managed
584 * @user_key: The id used for this shader.
585 * @shader_type: The shader type.
594 struct vmw_dx_shader *shader;
604 vmw_shader_dx_size = ttm_round_pot(sizeof(*shader));
613 DRM_ERROR("Out of graphics memory for shader "
618 shader = kmalloc(sizeof(*shader), GFP_KERNEL);
619 if (!shader) {
624 res = &shader->res;
625 shader->ctx = ctx;
626 shader->cotable = vmw_resource_reference
628 shader->id = user_key;
629 shader->committed = false;
630 INIT_LIST_HEAD(&shader->cotable_head);
637 * The user_key name-space is not per shader type for DX shaders,
638 * so when hashing, use a single zero shader type.
646 res->id = shader->id;
658 * User-space shader management:
665 shader.res);
671 container_of(res, struct vmw_user_shader, shader.res);
681 struct vmw_shader *shader = vmw_res_to_shader(res);
684 kfree(shader);
741 DRM_ERROR("Out of graphics memory for shader "
754 res = &ushader->shader.res;
794 struct vmw_shader *shader;
812 DRM_ERROR("Out of graphics memory for shader "
817 shader = kzalloc(sizeof(*shader), GFP_KERNEL);
818 if (unlikely(!shader)) {
825 res = &shader->res;
855 VMW_DEBUG_USER("Couldn't find buffer for shader creation.\n");
861 VMW_DEBUG_USER("Illegal buffer- or shader size.\n");
875 VMW_DEBUG_USER("Illegal shader type.\n");
895 * vmw_shader_id_ok - Check whether a compat shader user key and
896 * shader type are within valid bounds.
898 * @user_key: User space id of the shader.
909 * vmw_shader_key - Compute a hash key suitable for a compat shader.
911 * @user_key: User space id of the shader.
923 * vmw_shader_remove - Stage a compat shader for removal.
925 * @man: Pointer to the compat shader manager identifying the shader namespace.
926 * @user_key: The key that is used to identify the shader. The key is
927 * unique to the shader type.
946 * vmw_compat_shader_add - Create a compat shader and stage it for addition
949 * @man: Pointer to the compat shader manager identifying the shader namespace.
950 * @user_key: The key that is used to identify the shader. The key is
951 * unique to the shader type.
952 * @bytecode: Pointer to the bytecode of the shader.
954 * @tfile: Pointer to a struct ttm_object_file that the guest-backed shader is
990 /* Map and copy shader bytecode. */
1021 * vmw_shader_lookup - Look up a compat shader
1024 * the shader namespace.
1025 * @user_key: The user space id of the shader.
1026 * @shader_type: The shader type.
1028 * Returns a refcounted pointer to a struct vmw_resource if the shader was