|
@@ -213,7 +213,14 @@ void adreno_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit,
|
|
|
void adreno_flush(struct msm_gpu *gpu)
|
|
|
{
|
|
|
struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu);
|
|
|
- uint32_t wptr = get_wptr(gpu->rb);
|
|
|
+ uint32_t wptr;
|
|
|
+
|
|
|
+ /*
|
|
|
+ * Mask wptr value that we calculate to fit in the HW range. This is
|
|
|
+ * to account for the possibility that the last command fit exactly into
|
|
|
+ * the ringbuffer and rb->next hasn't wrapped to zero yet
|
|
|
+ */
|
|
|
+ wptr = get_wptr(gpu->rb) & ((gpu->rb->size / 4) - 1);
|
|
|
|
|
|
/* ensure writes to ringbuffer have hit system memory: */
|
|
|
mb();
|