summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSuprith Malligere Shankaregowda <supgow@codeaurora.org>2018-05-08 15:19:31 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2018-07-02 22:50:56 -0700
commited5f87f97d9df318cab215fb8b5a6cd264c377d7 (patch)
treec33e251be007eae3a27c93fb06f8ce176fd3aaff
parent0dc1009129bdb74447b3d36524ff6254cc2a41cd (diff)
msm: kgsl: Add hibernation support
Invoke kgsl_suspend and kgsl_resume during hibernation of KGSL. Change-Id: I8e1a8ad8b9293d568950a9e71667d1088ff6fbba Signed-off-by: Suprith Malligere Shankaregowda <supgow@codeaurora.org> Signed-off-by: Thomas (Wonyoung) Yun <wyun@codeaurora.org>
-rw-r--r--drivers/gpu/msm/kgsl.c10
-rw-r--r--drivers/gpu/msm/kgsl_pwrctrl.c3
2 files changed, 5 insertions, 8 deletions
diff --git a/drivers/gpu/msm/kgsl.c b/drivers/gpu/msm/kgsl.c
index db9e5f7d6d6b..4eed26b64577 100644
--- a/drivers/gpu/msm/kgsl.c
+++ b/drivers/gpu/msm/kgsl.c
@@ -742,7 +742,6 @@ static int kgsl_suspend_device(struct kgsl_device *device, pm_message_t state)
if (!device)
return -EINVAL;
- KGSL_PWR_WARN(device, "suspend start\n");
mutex_lock(&device->mutex);
status = kgsl_pwrctrl_change_state(device, KGSL_STATE_SUSPEND);
@@ -750,7 +749,6 @@ static int kgsl_suspend_device(struct kgsl_device *device, pm_message_t state)
device->ftbl->dispatcher_halt(device);
mutex_unlock(&device->mutex);
- KGSL_PWR_WARN(device, "suspend end\n");
return status;
}
@@ -759,7 +757,6 @@ static int kgsl_resume_device(struct kgsl_device *device)
if (!device)
return -EINVAL;
- KGSL_PWR_WARN(device, "resume start\n");
mutex_lock(&device->mutex);
if (device->state == KGSL_STATE_SUSPEND) {
device->ftbl->dispatcher_unhalt(device);
@@ -775,11 +772,11 @@ static int kgsl_resume_device(struct kgsl_device *device)
device->ftbl->idle(device);
kgsl_pwrctrl_change_state(device, KGSL_STATE_SLUMBER);
KGSL_PWR_ERR(device,
- "resume invoked without a suspend\n");
+ "resume invoked without a suspend, state = 0x%x\n",
+ device->state);
}
mutex_unlock(&device->mutex);
- KGSL_PWR_WARN(device, "resume end\n");
return 0;
}
@@ -808,8 +805,7 @@ static int kgsl_runtime_resume(struct device *dev)
}
const struct dev_pm_ops kgsl_pm_ops = {
- .suspend = kgsl_suspend,
- .resume = kgsl_resume,
+ SET_SYSTEM_SLEEP_PM_OPS(kgsl_suspend, kgsl_resume)
.runtime_suspend = kgsl_runtime_suspend,
.runtime_resume = kgsl_runtime_resume,
};
diff --git a/drivers/gpu/msm/kgsl_pwrctrl.c b/drivers/gpu/msm/kgsl_pwrctrl.c
index b1b0b69d55ba..b5476b06176a 100644
--- a/drivers/gpu/msm/kgsl_pwrctrl.c
+++ b/drivers/gpu/msm/kgsl_pwrctrl.c
@@ -2785,7 +2785,7 @@ static int _suspend(struct kgsl_device *device)
if ((device->state == KGSL_STATE_NONE) ||
(device->state == KGSL_STATE_INIT) ||
(device->state == KGSL_STATE_SUSPEND))
- return ret;
+ goto done;
/* drain to prevent from more commands being submitted */
device->ftbl->drain(device);
@@ -2802,6 +2802,7 @@ static int _suspend(struct kgsl_device *device)
if (ret)
goto err;
+done:
kgsl_pwrctrl_set_state(device, KGSL_STATE_SUSPEND);
return ret;