summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/gma500/power.h
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2022-09-09 14:56:45 +0300
committerHans de Goede <hdegoede@redhat.com>2022-09-17 16:20:40 +0300
commit672c473576ca5c9f5a40ac848c938e6898a5aac8 (patch)
treeb52e49ec624c543f86548ea1b5f2791707d86fa3 /drivers/gpu/drm/gma500/power.h
parentd35a4bf66079b92e232ac85b08f19312be9b7eca (diff)
downloadlinux-672c473576ca5c9f5a40ac848c938e6898a5aac8.tar.xz
drm/gma500: Rewrite power management code
Rewrite the power.c code. For some reason this was doing locking + refcounting + state (suspended or not) bookkeeping all by itself. But there is no reason for this, this is all taken care of by the runtime-pm core, through pm_runtime_get()/_put(). Besides this not being necessary the DIY code is also quite weird/ buggy in some places. E.g. power_begin() would manually do a resume when not resumed already and force_on=true, followed by a pm_runtime_get(), which will cause a call to gma_power_resume() to get scheduled which would redo the entire resume again. Which can all be replaced by a single pm_runtime_get_sync() call. Note that this is just a cleanup, this does not actually fix the (disabled through #if 0) runtime-pm support. It does now call pm_runtime_enable(), but only after doing a pm_runtime_get() at probe-time, so the device is never runtime suspended. Doing this permanent get() + enable() instead of not calling enable() at all is necessary for the pm_runtime_get_if_in_use() call in gma_power_begin() to work properly. Note this also removes the gma_power_is_on() call a check like this without actually holding a reference is always racy, so it is a bad idea (and therefor has no pm_runtime_foo() equivalent). The 2 code paths which were using gma_power_is_on() are actually both guaranteed to only run when the device is powered-on so the 2 checks can simply be dropped. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com> Link: https://patchwork.freedesktop.org/patch/msgid/20220909115646.99920-6-hdegoede@redhat.com
Diffstat (limited to 'drivers/gpu/drm/gma500/power.h')
-rw-r--r--drivers/gpu/drm/gma500/power.h9
1 files changed, 0 insertions, 9 deletions
diff --git a/drivers/gpu/drm/gma500/power.h b/drivers/gpu/drm/gma500/power.h
index 0c89c4d6ec20..243b9dd00910 100644
--- a/drivers/gpu/drm/gma500/power.h
+++ b/drivers/gpu/drm/gma500/power.h
@@ -55,18 +55,9 @@ bool gma_power_begin(struct drm_device *dev, bool force);
void gma_power_end(struct drm_device *dev);
/*
- * Use this function to do an instantaneous check for if the hw is on.
- * Only use this in cases where you know the mutex is already held such
- * as in irq install/uninstall and you need to
- * prevent a deadlock situation. Otherwise use gma_power_begin().
- */
-bool gma_power_is_on(struct drm_device *dev);
-
-/*
* GFX-Runtime PM callbacks
*/
int psb_runtime_suspend(struct device *dev);
int psb_runtime_resume(struct device *dev);
-int psb_runtime_idle(struct device *dev);
#endif /*_PSB_POWERMGMT_H_*/