drm/amdgpu: create fence slab once when amdgpu module init.
authorRex Zhu <Rex.Zhu@amd.com>
Thu, 12 May 2016 05:27:28 +0000 (13:27 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 13 May 2016 18:30:22 +0000 (14:30 -0400)
commitd573de2d00835e38cef1fb4bff7b49c174c68941
treecb84cee91af7122f9503796aa5b390d47b83d999
parent8b41e7a03a306d93276f91c1dae39dc51a1af58d
drm/amdgpu: create fence slab once when amdgpu module init.

This avoids problems with multiple GPUs.  For example,
if the first GPU failed before amdgpu_fence_init() was
called, amdgpu_fence_slab_ref is still 0 and it will
get decremented in amdgpu_fence_driver_fini().  This
will lead to a crash during init of the second GPU since
amdgpu_fence_slab_ref is not 0.

v2: add functions for init/exit instead of
    moving the variables into the driver.

Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu.h
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c