diff options
author | Nicolai Hähnle <nicolai.haehnle@amd.com> | 2016-10-04 03:43:30 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2016-10-12 15:44:14 -0400 |
commit | ce199ad690bd0a6ac6bf9e4df2c87b59d76f84da (patch) | |
tree | e9ba88b2c13b3fcb10c104d942bf88c9c88c9548 | |
parent | 6ae81452f9278ba1accdd4152d75061a8349a0f3 (diff) |
drm/amdgpu: initialize the context reset_counter in amdgpu_ctx_init
Ensure that we really only report a GPU reset if one has happened since the
creation of the context.
Signed-off-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c index e203e5561107..a5e2fcbef0f0 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | |||
@@ -43,6 +43,9 @@ static int amdgpu_ctx_init(struct amdgpu_device *adev, struct amdgpu_ctx *ctx) | |||
43 | ctx->rings[i].sequence = 1; | 43 | ctx->rings[i].sequence = 1; |
44 | ctx->rings[i].fences = &ctx->fences[amdgpu_sched_jobs * i]; | 44 | ctx->rings[i].fences = &ctx->fences[amdgpu_sched_jobs * i]; |
45 | } | 45 | } |
46 | |||
47 | ctx->reset_counter = atomic_read(&adev->gpu_reset_counter); | ||
48 | |||
46 | /* create context entity for each ring */ | 49 | /* create context entity for each ring */ |
47 | for (i = 0; i < adev->num_rings; i++) { | 50 | for (i = 0; i < adev->num_rings; i++) { |
48 | struct amdgpu_ring *ring = adev->rings[i]; | 51 | struct amdgpu_ring *ring = adev->rings[i]; |