summaryrefslogtreecommitdiff
path: root/drivers/gpu/msm/kgsl_pwrctrl.c
diff options
context:
space:
mode:
authorHareesh Gundu <hareeshg@codeaurora.org>2017-06-07 14:50:15 +0530
committerHareesh Gundu <hareeshg@codeaurora.org>2017-06-13 12:03:27 +0530
commit71c3b2e17c6fb4d1b040d3c8c75d76b78a050cce (patch)
tree50e555ec334bfa860d3a3a6f2798358e7ca29e87 /drivers/gpu/msm/kgsl_pwrctrl.c
parent85baaeb2e2d0e7c67bf4e5cc22d15e173d01b209 (diff)
msm: kgsl: Defer issue commands to worker thread
Currently submit ioctl getting blocked till the commands gets added to ringbuffer incase inflight count is less than context burst count. If the submit command happens in GPU slumber state, it will add the GPU wakeup time to submit IOCTL. This will add latency in preparing next frame in CPU side. Defer commands submission to dispatcher worker, if the GPU is in slumber state. CRs-Fixed: 2055107 Change-Id: I099ba721e02bbcd8ccadb1bc518c7c1ef4fb7e21 Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
Diffstat (limited to 'drivers/gpu/msm/kgsl_pwrctrl.c')
-rw-r--r--drivers/gpu/msm/kgsl_pwrctrl.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/drivers/gpu/msm/kgsl_pwrctrl.c b/drivers/gpu/msm/kgsl_pwrctrl.c
index 0150d50c925b..ead436c68cbb 100644
--- a/drivers/gpu/msm/kgsl_pwrctrl.c
+++ b/drivers/gpu/msm/kgsl_pwrctrl.c
@@ -2347,9 +2347,24 @@ void kgsl_idle_check(struct work_struct *work)
|| device->state == KGSL_STATE_NAP) {
if (!atomic_read(&device->active_cnt)) {
+ spin_lock(&device->submit_lock);
+ if (device->submit_now) {
+ spin_unlock(&device->submit_lock);
+ goto done;
+ }
+ /* Don't allow GPU inline submission in SLUMBER */
+ if (requested_state == KGSL_STATE_SLUMBER)
+ device->slumber = true;
+ spin_unlock(&device->submit_lock);
+
ret = kgsl_pwrctrl_change_state(device,
device->requested_state);
if (ret == -EBUSY) {
+ if (requested_state == KGSL_STATE_SLUMBER) {
+ spin_lock(&device->submit_lock);
+ device->slumber = false;
+ spin_unlock(&device->submit_lock);
+ }
/*
* If the GPU is currently busy, restore
* the requested state and reschedule
@@ -2360,7 +2375,7 @@ void kgsl_idle_check(struct work_struct *work)
kgsl_schedule_work(&device->idle_check_ws);
}
}
-
+done:
if (!ret)
kgsl_pwrctrl_request_state(device, KGSL_STATE_NONE);
@@ -2789,6 +2804,13 @@ static void kgsl_pwrctrl_set_state(struct kgsl_device *device,
trace_kgsl_pwr_set_state(device, state);
device->state = state;
device->requested_state = KGSL_STATE_NONE;
+
+ spin_lock(&device->submit_lock);
+ if (state == KGSL_STATE_SLUMBER || state == KGSL_STATE_SUSPEND)
+ device->slumber = true;
+ else
+ device->slumber = false;
+ spin_unlock(&device->submit_lock);
}
static void kgsl_pwrctrl_request_state(struct kgsl_device *device,