struct amdgpu_job {
struct amd_sched_job base;
struct amdgpu_device *adev;
- struct drm_file *owner;
struct amdgpu_ib *ibs;
uint32_t num_ibs;
struct mutex job_lock;
job->adev = parser->adev;
job->ibs = parser->ibs;
job->num_ibs = parser->num_ibs;
- job->owner = parser->filp;
+ job->base.owner = parser->filp;
mutex_init(&job->job_lock);
if (job->ibs[job->num_ibs - 1].user) {
memcpy(&job->uf, &parser->uf,
r = amdgpu_ib_schedule(sched_job->adev,
sched_job->num_ibs,
sched_job->ibs,
- sched_job->owner);
+ sched_job->base.owner);
if (r)
goto err;
fence = amdgpu_fence_ref(sched_job->ibs[sched_job->num_ibs - 1].fence);
job->adev = adev;
job->ibs = ibs;
job->num_ibs = num_ibs;
- job->owner = owner;
+ job->base.owner = owner;
mutex_init(&job->job_lock);
job->free_job = free_job;
mutex_lock(&job->job_lock);
int amd_sched_entity_push_job(struct amd_sched_job *sched_job)
{
struct amd_sched_entity *entity = sched_job->s_entity;
- struct amd_sched_fence *fence = amd_sched_fence_create(entity);
+ struct amd_sched_fence *fence = amd_sched_fence_create(
+ entity, sched_job->owner);
int r;
if (!fence)
struct fence base;
struct amd_gpu_scheduler *scheduler;
spinlock_t lock;
+ void *owner;
};
struct amd_sched_job {
struct amd_gpu_scheduler *sched;
struct amd_sched_entity *s_entity;
struct amd_sched_fence *s_fence;
+ void *owner;
};
extern const struct fence_ops amd_sched_fence_ops;
int amd_sched_entity_push_job(struct amd_sched_job *sched_job);
struct amd_sched_fence *amd_sched_fence_create(
- struct amd_sched_entity *s_entity);
+ struct amd_sched_entity *s_entity, void *owner);
void amd_sched_fence_signal(struct amd_sched_fence *fence);
#include <drm/drmP.h>
#include "gpu_scheduler.h"
-struct amd_sched_fence *amd_sched_fence_create(struct amd_sched_entity *s_entity)
+struct amd_sched_fence *amd_sched_fence_create(struct amd_sched_entity *s_entity, void *owner)
{
struct amd_sched_fence *fence = NULL;
unsigned seq;
fence = kzalloc(sizeof(struct amd_sched_fence), GFP_KERNEL);
if (fence == NULL)
return NULL;
-
+ fence->owner = owner;
fence->scheduler = s_entity->scheduler;
spin_lock_init(&fence->lock);