diff options
author | Christian König <christian.koenig@amd.com> | 2015-08-04 18:51:05 +0300 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2015-08-17 23:51:02 +0300 |
commit | 47f38501f11fa45d8a7797f1965448c1e20049d4 (patch) | |
tree | 67bba28445392c7584477178fce996a412e72dc3 /drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | |
parent | 0e89d0c16b9446a094215e71734e583c438bf83d (diff) | |
download | linux-47f38501f11fa45d8a7797f1965448c1e20049d4.tar.xz |
drm/amdgpu: cleanup amdgpu_ctx inti/fini v2
Cleanup the kernel context handling.
v2: rebased
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com> (v1)
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_device.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index 801ebfc44034..42d1a22c1199 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -1525,13 +1525,10 @@ int amdgpu_device_init(struct amdgpu_device *adev, return r; } - if (!adev->kernel_ctx) { - uint32_t id = 0; - r = amdgpu_ctx_alloc(adev, NULL, &id); - if (r) { - dev_err(adev->dev, "failed to create kernel context (%d).\n", r); - return r; - } + r = amdgpu_ctx_init(adev, true, &adev->kernel_ctx); + if (r) { + dev_err(adev->dev, "failed to create kernel context (%d).\n", r); + return r; } r = amdgpu_ib_ring_tests(adev); if (r) @@ -1594,7 +1591,7 @@ void amdgpu_device_fini(struct amdgpu_device *adev) adev->shutdown = true; /* evict vram memory */ amdgpu_bo_evict_vram(adev); - amdgpu_ctx_free(adev, NULL, 0); + amdgpu_ctx_fini(&adev->kernel_ctx); amdgpu_ib_pool_fini(adev); amdgpu_fence_driver_fini(adev); amdgpu_fbdev_fini(adev); |