diff options
author | Christian König <christian.koenig@amd.com> | 2016-03-11 15:12:53 +0100 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2016-03-14 14:08:30 -0400 |
commit | 22e5a2f46a26adc6822c54af946b384e14930417 (patch) | |
tree | 7e8e3e849c38fa284167887d495675d94b76307b /drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | |
parent | 77163f074aa68b06f6de2f2fc271f4a828d56da2 (diff) | |
download | lwn-22e5a2f46a26adc6822c54af946b384e14930417.tar.gz lwn-22e5a2f46a26adc6822c54af946b384e14930417.zip |
drm/amdgpu: move fence structure into amdgpu_fence.c
No need to have that in the header file any more.
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c index fabb01e8c8d5..3db18f42c5c9 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c @@ -47,9 +47,33 @@ * that the the relevant GPU caches have been flushed. */ +struct amdgpu_fence { + struct fence base; + + /* RB, DMA, etc. */ + struct amdgpu_ring *ring; + uint64_t seq; + + wait_queue_t fence_wake; +}; + static struct kmem_cache *amdgpu_fence_slab; static atomic_t amdgpu_fence_slab_ref = ATOMIC_INIT(0); +/* + * Cast helper + */ +static const struct fence_ops amdgpu_fence_ops; +static inline struct amdgpu_fence *to_amdgpu_fence(struct fence *f) +{ + struct amdgpu_fence *__f = container_of(f, struct amdgpu_fence, base); + + if (__f->base.ops == &amdgpu_fence_ops) + return __f; + + return NULL; +} + /** * amdgpu_fence_write - write a fence value * @@ -663,7 +687,7 @@ static void amdgpu_fence_release(struct fence *f) kmem_cache_free(amdgpu_fence_slab, fence); } -const struct fence_ops amdgpu_fence_ops = { +static const struct fence_ops amdgpu_fence_ops = { .get_driver_name = amdgpu_fence_get_driver_name, .get_timeline_name = amdgpu_fence_get_timeline_name, .enable_signaling = amdgpu_fence_enable_signaling, |