From 8cbd23218e20ec04b28af61daa0b143ca527902d Mon Sep 17 00:00:00 2001 From: Shubhraprakash Das Date: Sun, 4 Mar 2012 14:41:39 -0700 Subject: [PATCH] msm: kgsl: Check before resetting timestamps of 2D core to 0 on startup The timestamp of 2D core should not be set to 0 on startup if the device has previously been started and is waking up from a suspend call. This can cause processes to wait indefinitely for the 2D core if they received a timestamp before the device went into suspend Change-Id: Ida5dbdcb89ea7e0cf86110ecc2bd7d568123c364 Signed-off-by: Shubhraprakash Das --- drivers/gpu/msm/z180.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/msm/z180.c b/drivers/gpu/msm/z180.c index cb3da907571..6c43a7552fd 100644 --- a/drivers/gpu/msm/z180.c +++ b/drivers/gpu/msm/z180.c @@ -339,13 +339,15 @@ static void addcmd(struct z180_ringbuffer *rb, unsigned int index, *p++ = ADDR_VGV3_LAST << 24; } -static void z180_cmdstream_start(struct kgsl_device *device) +static void z180_cmdstream_start(struct kgsl_device *device, int init_ram) { struct z180_device *z180_dev = Z180_DEVICE(device); unsigned int cmd = VGV3_NEXTCMD_JUMP << VGV3_NEXTCMD_NEXTCMD_FSHIFT; - z180_dev->timestamp = 0; - z180_dev->current_timestamp = 0; + if (init_ram) { + z180_dev->timestamp = 0; + z180_dev->current_timestamp = 0; + } addmarker(&z180_dev->ringbuffer, 0); @@ -566,7 +568,7 @@ static int z180_start(struct kgsl_device *device, unsigned int init_ram) if (status) goto error_clk_off; - z180_cmdstream_start(device); + z180_cmdstream_start(device, init_ram); mod_timer(&device->idle_timer, jiffies + FIRST_TIMEOUT); kgsl_pwrctrl_irq(device, KGSL_PWRFLAGS_ON);