From ee339b2bcb751c02f64afc6d451aa5b5e248c0ab Mon Sep 17 00:00:00 2001 From: securecrt Date: Mon, 23 Jul 2012 18:59:50 +0800 Subject: [PATCH] msm: kgsl: Write the retired timestamp on resume Write the retired timestamp into the expected location. This fixes userspace crashes after resume when the retired timestamp is read as 0 instead of the expected last timestamp. --- drivers/gpu/msm/adreno_ringbuffer.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/msm/adreno_ringbuffer.c b/drivers/gpu/msm/adreno_ringbuffer.c index e2580171..57af5563 100755 --- a/drivers/gpu/msm/adreno_ringbuffer.c +++ b/drivers/gpu/msm/adreno_ringbuffer.c @@ -309,6 +309,11 @@ int adreno_ringbuffer_start(struct adreno_ringbuffer *rb, unsigned int init_ram) adreno_regwrite(device, REG_SCRATCH_UMSK, GSL_RB_MEMPTRS_SCRATCH_MASK); + /* update the eoptimestamp field with the last retired timestamp */ + kgsl_sharedmem_writel(&device->memstore, + KGSL_DEVICE_MEMSTORE_OFFSET(eoptimestamp), + rb->timestamp); + /* load the CP ucode */ status = adreno_ringbuffer_load_pm4_ucode(device);