diff options
author | Christian König <christian.koenig@amd.com> | 2016-02-03 13:44:52 +0100 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2016-02-10 14:17:18 -0500 |
commit | 50838c8cc413de8da39c4c216ae05410845d5a44 (patch) | |
tree | 1a7f94a784593e9da9a02d801f28d46ac4dbafa7 /drivers/gpu/drm/amd/amdgpu/amdgpu.h | |
parent | 4acabfe3793eb9bf89f71cc0cef23dfb2a812916 (diff) | |
download | lwn-50838c8cc413de8da39c4c216ae05410845d5a44.tar.gz lwn-50838c8cc413de8da39c4c216ae05410845d5a44.zip |
drm/amdgpu: add proper job alloc/free functions
And use them in the CS instead of allocating IBs and jobs separately.
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucer@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu.h')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h index 935b9aa08474..5c55445f0260 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h @@ -796,6 +796,9 @@ enum amdgpu_ring_type { extern struct amd_sched_backend_ops amdgpu_sched_ops; +int amdgpu_job_alloc(struct amdgpu_device *adev, unsigned num_ibs, + struct amdgpu_job **job); +void amdgpu_job_free(struct amdgpu_job *job); int amdgpu_sched_ib_submit_kernel_helper(struct amdgpu_device *adev, struct amdgpu_ring *ring, struct amdgpu_ib *ibs, @@ -1216,9 +1219,8 @@ struct amdgpu_cs_parser { unsigned nchunks; struct amdgpu_cs_chunk *chunks; - /* indirect buffers */ - uint32_t num_ibs; - struct amdgpu_ib *ibs; + /* scheduler job object */ + struct amdgpu_job *job; /* buffer objects */ struct ww_acquire_ctx ticket; @@ -1249,14 +1251,14 @@ struct amdgpu_job { static inline u32 amdgpu_get_ib_value(struct amdgpu_cs_parser *p, uint32_t ib_idx, int idx) { - return p->ibs[ib_idx].ptr[idx]; + return p->job->ibs[ib_idx].ptr[idx]; } static inline void amdgpu_set_ib_value(struct amdgpu_cs_parser *p, uint32_t ib_idx, int idx, uint32_t value) { - p->ibs[ib_idx].ptr[idx] = value; + p->job->ibs[ib_idx].ptr[idx] = value; } /* |