[Meego-kernel] [PATCH 12/26] GFX: Make gfx runtime pm configurable by cmdline
hitesh.k.patel at intel.com
hitesh.k.patel at intel.com
Wed Nov 24 19:59:26 PST 2010
From: Hitesh K. Patel <hitesh.k.patel at intel.com>
Gfx runtime pm is enabled by default,
and can be disabled by passing the "ospm=0" in cmdline.
Re-enabled the module_param for debug purpose
The related entries can be found in /sys/modules/mefield_gfx/parameters/
Signed-off-by: Hitesh K. Patel <hitesh.k.patel at intel.com>
---
drivers/staging/mrst/drv/mdfld_dsi_dbi.c | 4 +---
drivers/staging/mrst/drv/psb_drv.c | 26 +++++++++++++++++++++-----
2 files changed, 22 insertions(+), 8 deletions(-)
diff --git a/drivers/staging/mrst/drv/mdfld_dsi_dbi.c b/drivers/staging/mrst/drv/mdfld_dsi_dbi.c
index 691e166..45d8030 100644
--- a/drivers/staging/mrst/drv/mdfld_dsi_dbi.c
+++ b/drivers/staging/mrst/drv/mdfld_dsi_dbi.c
@@ -496,14 +496,12 @@ void mdfld_dsi_dbi_exit_dsr (struct drm_device *dev, u32 update_src)
PSB_DEBUG_ENTRY("\n");
- /*
- if(!allow_runtime_pm){
+ if(drm_psb_ospm && !allow_runtime_pm) {
printk(KERN_ALERT "Enable runtime_pm \n");
allow_runtime_pm = 1;
pm_runtime_allow(&gpDrmDevice->pdev->dev);
}
- */
dbi_output = dsr_info->dbi_outputs;
/*for each output, exit dsr*/
diff --git a/drivers/staging/mrst/drv/psb_drv.c b/drivers/staging/mrst/drv/psb_drv.c
index 87af1d7..4c0bdc3 100644
--- a/drivers/staging/mrst/drv/psb_drv.c
+++ b/drivers/staging/mrst/drv/psb_drv.c
@@ -91,6 +91,25 @@ module_param_named(topaz_pmpolicy, drm_topaz_pmpolicy, int, 0600);
module_param_named(topaz_sbuswa, drm_topaz_sbuswa, int, 0600);
module_param_named(ospm, drm_psb_ospm, int, 0600);
module_param_named(topaz_clockgating, drm_psb_topaz_clockgating, int, 0600);
+#ifndef MODULE
+/* Make ospm configurable via cmdline firstly, and others can be enabled if needed. */
+static int __init config_ospm(char *arg)
+{
+ /* ospm turn on/off control can be passed in as a cmdline parameter */
+ /* to enable this feature add ospm=1 to cmdline */
+ /* to disable this feature add ospm=0 to cmdline */
+ if (!arg)
+ return -EINVAL;
+
+ if (!strcasecmp(arg, "0"))
+ drm_psb_ospm = 0;
+ else if (!strcasecmp (arg, "1"))
+ drm_psb_ospm = 1;
+
+ return 0;
+}
+early_param ("ospm", config_ospm);
+#endif
static struct pci_device_id pciidlist[] = {
#ifdef SGX535
@@ -2534,18 +2553,16 @@ static long psb_unlocked_ioctl(struct file *filp, unsigned int cmd,
{
struct drm_file *file_priv = filp->private_data;
struct drm_device *dev = file_priv->minor->dev;
- /*
struct drm_psb_private *dev_priv = dev->dev_private;
static unsigned int runtime_allowed = 0;
- */
unsigned int nr = DRM_IOCTL_NR(cmd);
long ret;
DRM_DEBUG("cmd = %x, nr = %x\n", cmd, nr);
/*Simple (work around)Ugly hack to make runtime pm start only after X is initialized*/
/*This doesn't work with Medfield RT PM.*/
- /*
- if(!runtime_allowed && !(dev_priv->is_lvds_on || dev_priv->is_mipi_on)) {
+
+ if(drm_psb_ospm && !runtime_allowed && !(dev_priv->is_lvds_on || dev_priv->is_mipi_on)) {
runtime_allowed ++;
}
if((runtime_allowed == 1) && (dev_priv->is_lvds_on || dev_priv->is_mipi_on)) {
@@ -2553,7 +2570,6 @@ static long psb_unlocked_ioctl(struct file *filp, unsigned int cmd,
pm_runtime_allow(&dev->pdev->dev);
dev_priv->rpm_enabled = 1;
}
- */
/*
* The driver private ioctls and TTM ioctls should be
--
1.7.1
More information about the MeeGo-kernel
mailing list