pvr_file
int pvr_context_create(struct pvr_file *pvr_file, struct drm_pvr_ioctl_create_context_args *args)
struct pvr_device *pvr_dev = pvr_file->pvr_dev;
err = remap_priority(pvr_file, args->priority, &ctx->priority);
ctx->vm_ctx = pvr_vm_context_lookup(pvr_file, args->vm_context_handle);
remap_priority(struct pvr_file *pvr_file, s32 uapi_priority,
err = xa_alloc(&pvr_file->ctx_handles, &args->handle, ctx, xa_limit_32b, GFP_KERNEL);
list_add_tail(&ctx->file_link, &pvr_file->contexts);
pvr_context_destroy(struct pvr_file *pvr_file, u32 handle)
struct pvr_context *ctx = xa_erase(&pvr_file->ctx_handles, handle);
void pvr_destroy_contexts_for_file(struct pvr_file *pvr_file)
if (!capable(CAP_SYS_NICE) && !drm_is_current_master(from_pvr_file(pvr_file)))
struct pvr_device *pvr_dev = pvr_file->pvr_dev;
xa_for_each(&pvr_file->ctx_handles, handle, ctx)
pvr_context_destroy(pvr_file, handle);
ctx = list_first_entry(&pvr_file->contexts, struct pvr_context, file_link);
while (!list_entry_is_head(ctx, &pvr_file->contexts, file_link)) {
ctx = list_first_entry(&pvr_file->contexts, struct pvr_context, file_link);
pvr_context_lookup(struct pvr_file *pvr_file, u32 handle)
xa_lock(&pvr_file->ctx_handles);
ctx = pvr_context_get(xa_load(&pvr_file->ctx_handles, handle));
xa_unlock(&pvr_file->ctx_handles);
int pvr_context_create(struct pvr_file *pvr_file, struct drm_pvr_ioctl_create_context_args *args);
int pvr_context_destroy(struct pvr_file *pvr_file, u32 handle);
void pvr_destroy_contexts_for_file(struct pvr_file *pvr_file);
#define from_pvr_file(pvr_file) ((pvr_file)->file)
struct pvr_file *pvr_file = to_pvr_file(file);
vm_ctx = pvr_vm_context_lookup(pvr_file, args->vm_context_handle);
pvr_obj = pvr_gem_object_from_handle(pvr_file, args->handle);
struct pvr_file *pvr_file = to_pvr_file(file);
vm_ctx = pvr_vm_context_lookup(pvr_file, args->vm_context_handle);
struct pvr_file *pvr_file = to_pvr_file(file);
err = pvr_submit_jobs(pvr_dev, pvr_file, args);
err = pvr_gem_object_into_handle(pvr_obj, pvr_file, &args->handle);
struct pvr_file *pvr_file;
pvr_file = kzalloc_obj(*pvr_file);
if (!pvr_file)
pvr_file->file = file;
pvr_file->pvr_dev = pvr_dev;
INIT_LIST_HEAD(&pvr_file->contexts);
xa_init_flags(&pvr_file->ctx_handles, XA_FLAGS_ALLOC1);
xa_init_flags(&pvr_file->free_list_handles, XA_FLAGS_ALLOC1);
xa_init_flags(&pvr_file->hwrt_handles, XA_FLAGS_ALLOC1);
xa_init_flags(&pvr_file->vm_ctx_handles, XA_FLAGS_ALLOC1);
file->driver_priv = pvr_file;
struct pvr_file *pvr_file = to_pvr_file(file);
pvr_destroy_contexts_for_file(pvr_file);
pvr_destroy_free_lists_for_file(pvr_file);
pvr_destroy_hwrt_datasets_for_file(pvr_file);
pvr_destroy_vm_contexts_for_file(pvr_file);
kfree(pvr_file);
struct pvr_file *pvr_file = to_pvr_file(file);
pvr_obj = pvr_gem_object_from_handle(pvr_file, args->handle);
struct pvr_file *pvr_file = file->driver_priv;
ret = pvr_context_create(pvr_file, args);
struct pvr_file *pvr_file = file->driver_priv;
return pvr_context_destroy(pvr_file, args->handle);
struct pvr_file *pvr_file = to_pvr_file(file);
free_list = pvr_free_list_create(pvr_file, args);
err = xa_alloc(&pvr_file->free_list_handles,
struct pvr_file *pvr_file = to_pvr_file(file);
struct pvr_file *pvr_file = to_pvr_file(file);
free_list = xa_erase(&pvr_file->free_list_handles, args->handle);
struct pvr_file *pvr_file = to_pvr_file(file);
hwrt = pvr_hwrt_dataset_create(pvr_file, args);
err = xa_alloc(&pvr_file->hwrt_handles,
struct pvr_file *pvr_file = to_pvr_file(file);
hwrt = xa_erase(&pvr_file->hwrt_handles, args->handle);
struct pvr_file *pvr_file = to_pvr_file(file);
vm_ctx = pvr_vm_create_context(pvr_file->pvr_dev, true);
err = xa_alloc(&pvr_file->vm_ctx_handles,
struct pvr_file *pvr_file = to_pvr_file(file);
vm_ctx = xa_erase(&pvr_file->vm_ctx_handles, args->handle);
free_list_create_fw_structure(struct pvr_file *pvr_file,
struct pvr_device *pvr_dev = pvr_file->pvr_dev;
pvr_free_list_create(struct pvr_file *pvr_file,
err = free_list_create_kernel_structure(pvr_file, args, free_list);
err = xa_alloc(&pvr_file->pvr_dev->free_list_ids,
err = free_list_create_fw_structure(pvr_file, args, free_list);
free_list_create_kernel_structure(struct pvr_file *pvr_file,
void pvr_destroy_free_lists_for_file(struct pvr_file *pvr_file)
xa_for_each(&pvr_file->free_list_handles, handle, free_list) {
pvr_free_list_put(xa_erase(&pvr_file->free_list_handles, handle));
vm_ctx = pvr_vm_context_lookup(pvr_file, args->vm_context_handle);
free_list->pvr_dev = pvr_file->pvr_dev;
pvr_free_list_create(struct pvr_file *pvr_file,
pvr_destroy_free_lists_for_file(struct pvr_file *pvr_file);
pvr_free_list_lookup(struct pvr_file *pvr_file, u32 handle)
xa_lock(&pvr_file->free_list_handles);
free_list = pvr_free_list_get(xa_load(&pvr_file->free_list_handles, handle));
xa_unlock(&pvr_file->free_list_handles);
struct pvr_file;
struct pvr_file *pvr_file, u32 *handle)
struct drm_file *file = from_pvr_file(pvr_file);
pvr_gem_object_from_handle(struct pvr_file *pvr_file, u32 handle)
struct drm_file *file = from_pvr_file(pvr_file);
struct pvr_file *pvr_file, u32 *handle);
struct pvr_gem_object *pvr_gem_object_from_handle(struct pvr_file *pvr_file,
struct pvr_file;
hwrt_init_common_fw_structure(struct pvr_file *pvr_file,
struct pvr_device *pvr_dev = pvr_file->pvr_dev;
hwrt_data_init_fw_structure(struct pvr_file *pvr_file,
struct pvr_device *pvr_dev = pvr_file->pvr_dev;
hwrt_init_kernel_structure(struct pvr_file *pvr_file,
struct pvr_device *pvr_dev = pvr_file->pvr_dev;
pvr_hwrt_dataset_create(struct pvr_file *pvr_file,
err = hwrt_init_kernel_structure(pvr_file, args, hwrt);
err = hwrt_init_common_fw_structure(pvr_file, args, hwrt);
err = hwrt_data_init_fw_structure(pvr_file, hwrt, args,
void pvr_destroy_hwrt_datasets_for_file(struct pvr_file *pvr_file)
hwrt->free_lists[i] = pvr_free_list_lookup(pvr_file, args->free_list_handles[i]);
xa_for_each(&pvr_file->hwrt_handles, handle, hwrt) {
pvr_hwrt_dataset_put(xa_erase(&pvr_file->hwrt_handles, handle));
pvr_hwrt_dataset_lookup(struct pvr_file *pvr_file, u32 handle)
xa_lock(&pvr_file->hwrt_handles);
hwrt = xa_load(&pvr_file->hwrt_handles, handle);
xa_unlock(&pvr_file->hwrt_handles);
pvr_hwrt_data_lookup(struct pvr_file *pvr_file, u32 handle, u32 index)
struct pvr_hwrt_dataset *hwrt_dataset = pvr_hwrt_dataset_lookup(pvr_file, handle);
pvr_hwrt_dataset_create(struct pvr_file *pvr_file,
pvr_destroy_hwrt_datasets_for_file(struct pvr_file *pvr_file);
prepare_job_syncs(struct pvr_file *pvr_file,
from_pvr_file(pvr_file),
err = pvr_sync_add_deps_to_job(pvr_file, &job_data->job->base,
prepare_job_syncs_for_each(struct pvr_file *pvr_file,
int err = prepare_job_syncs(pvr_file, &job_data[i],
struct pvr_file *pvr_file,
job->ctx = pvr_context_lookup(pvr_file, args->context_handle);
job->hwrt = pvr_hwrt_data_lookup(pvr_file, args->hwrt.set_handle,
err = pvr_queue_job_init(job, pvr_file->file->client_id);
struct pvr_file *pvr_file,
create_job(pvr_dev, pvr_file, &job_args[i]);
pvr_submit_jobs(struct pvr_device *pvr_dev, struct pvr_file *pvr_file,
err = pvr_job_data_init(pvr_dev, pvr_file, job_args, &args->jobs.count,
err = prepare_job_syncs_for_each(pvr_file, job_data, &args->jobs.count,
int pvr_submit_jobs(struct pvr_device *pvr_dev, struct pvr_file *pvr_file,
struct pvr_file;
pvr_sync_add_deps_to_job(struct pvr_file *pvr_file, struct drm_sched_job *job,
err = drm_syncobj_find_fence(from_pvr_file(pvr_file), sync_ops[i].handle,
struct pvr_file;
pvr_sync_add_deps_to_job(struct pvr_file *pvr_file, struct drm_sched_job *job,
pvr_vm_context_lookup(struct pvr_file *pvr_file, u32 handle)
xa_lock(&pvr_file->vm_ctx_handles);
vm_ctx = xa_load(&pvr_file->vm_ctx_handles, handle);
xa_unlock(&pvr_file->vm_ctx_handles);
void pvr_destroy_vm_contexts_for_file(struct pvr_file *pvr_file)
xa_for_each(&pvr_file->vm_ctx_handles, handle, vm_ctx) {
pvr_vm_context_put(xa_erase(&pvr_file->vm_ctx_handles, handle));
struct pvr_file;
struct pvr_vm_context *pvr_vm_context_lookup(struct pvr_file *pvr_file, u32 handle);
void pvr_destroy_vm_contexts_for_file(struct pvr_file *pvr_file);