diff options
author | Christian König <christian.koenig@amd.com> | 2015-05-11 09:34:59 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2015-06-03 21:03:34 -0400 |
commit | 3cb485f34049b7f3a00f6f73d2325e0858f64ddb (patch) | |
tree | ed523717c68630c27010a39d112b360492b23c93 /drivers/gpu/drm/amd/amdgpu/amdgpu.h | |
parent | d919ad49ac04e1e417ea511d61455786a0f0fdb7 (diff) |
drm/amdgpu: fix context switch
Properly protect the state and also handle submission failures.
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Reviewed-by: Monk Liu <monk.liu@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu.h')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h index 72d9d9ec5c9f..003fa2d12bfb 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h | |||
@@ -893,6 +893,7 @@ struct amdgpu_ib { | |||
893 | struct amdgpu_fence *fence; | 893 | struct amdgpu_fence *fence; |
894 | struct amdgpu_user_fence *user; | 894 | struct amdgpu_user_fence *user; |
895 | struct amdgpu_vm *vm; | 895 | struct amdgpu_vm *vm; |
896 | struct amdgpu_ctx *ctx; | ||
896 | struct amdgpu_sync sync; | 897 | struct amdgpu_sync sync; |
897 | uint32_t gds_base, gds_size; | 898 | uint32_t gds_base, gds_size; |
898 | uint32_t gws_base, gws_size; | 899 | uint32_t gws_base, gws_size; |
@@ -943,9 +944,7 @@ struct amdgpu_ring { | |||
943 | unsigned wptr_offs; | 944 | unsigned wptr_offs; |
944 | unsigned next_rptr_offs; | 945 | unsigned next_rptr_offs; |
945 | unsigned fence_offs; | 946 | unsigned fence_offs; |
946 | struct drm_file *current_filp; | 947 | struct amdgpu_ctx *current_ctx; |
947 | unsigned current_ctx; | ||
948 | bool need_ctx_switch; | ||
949 | enum amdgpu_ring_type type; | 948 | enum amdgpu_ring_type type; |
950 | char name[16]; | 949 | char name[16]; |
951 | }; | 950 | }; |
@@ -1236,7 +1235,7 @@ struct amdgpu_cs_chunk { | |||
1236 | struct amdgpu_cs_parser { | 1235 | struct amdgpu_cs_parser { |
1237 | struct amdgpu_device *adev; | 1236 | struct amdgpu_device *adev; |
1238 | struct drm_file *filp; | 1237 | struct drm_file *filp; |
1239 | uint32_t ctx_id; | 1238 | struct amdgpu_ctx *ctx; |
1240 | struct amdgpu_bo_list *bo_list; | 1239 | struct amdgpu_bo_list *bo_list; |
1241 | /* chunks */ | 1240 | /* chunks */ |
1242 | unsigned nchunks; | 1241 | unsigned nchunks; |