summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/msm/adreno
diff options
context:
space:
mode:
authorRob Clark <robdclark@gmail.com>2017-02-12 11:42:14 -0500
committerRob Clark <robdclark@gmail.com>2017-04-08 06:59:31 -0400
commitde098e5fb123ca142656eaf7936ce2a60b7d1339 (patch)
tree34c4484eb35c64449ae89d772b27dfdcdc0e049d /drivers/gpu/drm/msm/adreno
parenteeb754746b140c5f55e6b25706a9142aa549b348 (diff)
drm/msm/adreno: reset ringbuffer in hw_init
We need to do this also in resume path when we need to re-hw_init(). Signed-off-by: Rob Clark <robdclark@gmail.com>
Diffstat (limited to 'drivers/gpu/drm/msm/adreno')
-rw-r--r--drivers/gpu/drm/msm/adreno/adreno_gpu.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.c b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
index 823f9dfe6db9..05a3d1fd6d30 100644
--- a/drivers/gpu/drm/msm/adreno/adreno_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
@@ -68,6 +68,14 @@ int adreno_hw_init(struct msm_gpu *gpu)
return ret;
}
+ /* reset ringbuffer: */
+ gpu->rb->cur = gpu->rb->start;
+
+ /* reset completed fence seqno: */
+ adreno_gpu->memptrs->fence = gpu->fctx->completed_fence;
+ adreno_gpu->memptrs->rptr = 0;
+ adreno_gpu->memptrs->wptr = 0;
+
/* Setup REG_CP_RB_CNTL: */
adreno_gpu_write(adreno_gpu, REG_ADRENO_CP_RB_CNTL,
/* size is log2(quad-words): */
@@ -111,7 +119,6 @@ uint32_t adreno_last_fence(struct msm_gpu *gpu)
void adreno_recover(struct msm_gpu *gpu)
{
- struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu);
struct drm_device *dev = gpu->dev;
int ret;
@@ -119,15 +126,6 @@ void adreno_recover(struct msm_gpu *gpu)
// so maybe continuing to call ->pm_suspend/resume() is better?
gpu->funcs->pm_suspend(gpu);
-
- /* reset ringbuffer: */
- gpu->rb->cur = gpu->rb->start;
-
- /* reset completed fence seqno: */
- adreno_gpu->memptrs->fence = gpu->fctx->completed_fence;
- adreno_gpu->memptrs->rptr = 0;
- adreno_gpu->memptrs->wptr = 0;
-
gpu->funcs->pm_resume(gpu);
ret = msm_gpu_hw_init(gpu);