From: Hitesh K. Patel <[email protected]>

1. Add support for Medfield Runtime Power Management.
2. Also, disable Debug Prints.
3. Also reduce SGX uKernel idle timer value to increase D0i3 residency.

Change-Id: I78516ba058724b1b4a8812e043d8e4b3222ba832
Signed-off-by: Rajesh Poornachandran <[email protected]>
Signed-off-by: Hitesh K. Patel <[email protected]>
---
 drivers/staging/mrst/drv/mdfld_dsi_dbi.c           |   18 +++-
 drivers/staging/mrst/drv/mdfld_dsi_dbi_dpu.c       |    3 +-
 drivers/staging/mrst/drv/psb_drv.c                 |   18 ++--
 drivers/staging/mrst/drv/psb_intel_display.c       |    2 +-
 drivers/staging/mrst/drv/psb_intel_display2.c      |   23 ++++
 drivers/staging/mrst/drv/psb_powermgmt.c           |  111 +++++++++++++-------
 drivers/staging/mrst/drv/pyr_cmd.c                 |    1 +
 drivers/staging/mrst/drv/tpo_cmd.c                 |    1 +
 .../pvr/services4/system/medfield/psb_powermgmt.h  |   85 ---------------
 .../mrst/pvr/services4/system/medfield/sysconfig.c |    2 +-
 .../pvr/services4/system/moorestown/sysconfig.c    |    2 +-
 .../pvr/services4/system/unified/psb_powermgmt.h   |   85 ---------------
 .../services4/system/unified/sysconfig-medfield.c  |    2 +-
 .../system/unified/sysconfig-moorestown.c          |    2 +-
 14 files changed, 130 insertions(+), 225 deletions(-)
 delete mode 100644 
drivers/staging/mrst/pvr/services4/system/medfield/psb_powermgmt.h
 delete mode 100644 
drivers/staging/mrst/pvr/services4/system/unified/psb_powermgmt.h

diff --git a/drivers/staging/mrst/drv/mdfld_dsi_dbi.c 
b/drivers/staging/mrst/drv/mdfld_dsi_dbi.c
index ccbfcca..d4dab42 100644
--- a/drivers/staging/mrst/drv/mdfld_dsi_dbi.c
+++ b/drivers/staging/mrst/drv/mdfld_dsi_dbi.c
@@ -28,6 +28,11 @@
 #include "mdfld_dsi_dbi.h"
 #include "mdfld_dsi_dbi_dpu.h"
 
+ #include "psb_powermgmt.h"
+ #include <linux/pm_runtime.h>
+
+extern int allow_runtime_pm;
+extern struct drm_device *gpDrmDevice;
 /**
  * set refreshing area
  */
@@ -88,7 +93,7 @@ update_area_again:
         * release cb_lock before going to sleep.
         * NOTE: since cb_write wasn't reset, DSR timer wouldn't be able to 
         * get access to command buffer.
-        * FIXME: this may lead to mode setting failed.
+        * this may lead to mode setting failed.
         */ 
        spin_unlock_irqrestore(&dbi_output->cb_lock, flags);
        
@@ -399,9 +404,9 @@ static void mdfld_dbi_output_exit_dsr (struct 
mdfld_dsi_dbi_output * dbi_output,
                REG_READ(dpll_reg);
                udelay(500);
                
-               /*FIXME: add timeout*/
+               /*add timeout*/
                while (!(REG_READ(pipeconf_reg) & PIPECONF_DSIPLL_LOCK)) {
-                       
+                       cpu_relax();
                }
        }
        
@@ -442,6 +447,13 @@ void mdfld_dsi_dbi_exit_dsr (struct drm_device *dev, u32 
update_src)
        
        PSB_DEBUG_ENTRY("\n");
        
+       if(!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*/
        for(i=0; i<dsr_info->dbi_output_num; i++) {
diff --git a/drivers/staging/mrst/drv/mdfld_dsi_dbi_dpu.c 
b/drivers/staging/mrst/drv/mdfld_dsi_dbi_dpu.c
index bcf2b01..9558d42 100644
--- a/drivers/staging/mrst/drv/mdfld_dsi_dbi_dpu.c
+++ b/drivers/staging/mrst/drv/mdfld_dsi_dbi_dpu.c
@@ -139,13 +139,12 @@ static int mdfld_fb_damage(struct mdfld_dbi_dpu_info * 
dpu_info,
                                                   struct psb_drm_dpu_rect * 
damaged_rect)
 {
        struct psb_drm_dpu_rect * rect;
-       
+
        if(plane == MDFLD_PLANEA) {
                rect = &dpu_info->damage_pipea;
        } else {
                rect = &dpu_info->damage_pipec;
        }
-       
        mdfld_check_boundary(dpu_info, damaged_rect);
        
        /*add fb damage area to this pipe*/
diff --git a/drivers/staging/mrst/drv/psb_drv.c 
b/drivers/staging/mrst/drv/psb_drv.c
index 61eba6c..1cf3570 100644
--- a/drivers/staging/mrst/drv/psb_drv.c
+++ b/drivers/staging/mrst/drv/psb_drv.c
@@ -335,7 +335,7 @@ static int psb_gamma_ioctl(struct drm_device *dev, void 
*data,
                           struct drm_file *file_priv);
 static int psb_dpst_bl_ioctl(struct drm_device *dev, void *data,
                             struct drm_file *file_priv);
-#if 0 /*#ifdef MDFLD_HDCP*/                         
+#ifdef FIX_MDFLD_HDCP /*#ifdef MDFLD_HDCP*/
 static int psb_hdcp_i2c_access_ioctl(struct drm_device *dev, void *data,
                             struct drm_file *file_priv);
 #endif 
@@ -434,7 +434,7 @@ static struct drm_ioctl_desc psb_ioctls[] = {
        /*PSB_IOCTL_DEF(DRM_IOCTL_PSB_FLIP, psb_page_flip, DRM_AUTH),*/
        PSB_IOCTL_DEF(DRM_IOCTL_LNC_VIDEO_GETPARAM,
                        lnc_video_getparam, DRM_AUTH),
-#if 0 /*#ifdef MDFLD_HDCP*/                    
+#ifdef FIX_MDFLD_HDCP /*#ifdef MDFLD_HDCP*/
        PSB_IOCTL_DEF(DRM_IOCTL_PSB_HDCP_I2C_ACCESS, psb_hdcp_i2c_access_ioctl,
                      DRM_AUTH)
 #endif                       
@@ -2000,7 +2000,7 @@ static int psb_stolen_memory_ioctl(struct drm_device 
*dev, void *data,
        return 0;
 }
 
-#if 0 /*#ifdef MDFLD_HDCP*/
+#ifdef FIX_MDFLD_HDCP /*#ifdef MDFLD_HDCP*/
 static int psb_hdcp_i2c_access_ioctl(struct drm_device *dev, void *data,
                                   struct drm_file *file_priv)
 {
@@ -2168,7 +2168,7 @@ static int psb_register_rw_ioctl(struct drm_device *dev, 
void *data,
                        if (arg->display_write_mask & REGRWBITS_VTOTAL_B)
                                PSB_WVDC32(arg->display.vtotal_b,
                                           VTOTAL_B);
-#if 0 /*#ifdef MDFLD_HDCP*/                                                    
           
+#ifdef FIX_MDFLD_HDCP /*#ifdef MDFLD_HDCP*/
                        if (arg->display_write_mask & REGRWBITS_HDCP)
                                PSB_WVDC32(arg->display.hdcp_value,
                                           arg->display.hdcp_reg);
@@ -2220,7 +2220,7 @@ static int psb_register_rw_ioctl(struct drm_device *dev, 
void *data,
                        if (arg->display_read_mask & REGRWBITS_VTOTAL_B)
                                arg->display.vtotal_b = PSB_RVDC32(VTOTAL_B);
                        ospm_power_using_hw_end(OSPM_DISPLAY_ISLAND);
-#if 0 /*#ifdef MDFLD_HDCP*/                                                    
           
+#ifdef FIX_MDFLD_HDCP /*#ifdef MDFLD_HDCP*/
                        if (arg->display_read_mask & REGRWBITS_HDCP)
                                arg->display.hdcp_value = 
PSB_RVDC32(arg->display.hdcp_reg);
 #endif                                                                    
@@ -2486,13 +2486,15 @@ 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;
+       /*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.
+#ifdef FIX_OSPM_POWER_DOWN
        if(!runtime_allowed && !(dev_priv->is_lvds_on || dev_priv->is_mipi_on)) 
{
                runtime_allowed ++;
        }
@@ -2500,7 +2502,7 @@ static long psb_unlocked_ioctl(struct file *filp, 
unsigned int cmd,
                runtime_allowed ++;
                pm_runtime_allow(&dev->pdev->dev);
        }
-
+#endif
        /*
         * The driver private ioctls and TTM ioctls should be
         * thread-safe.
diff --git a/drivers/staging/mrst/drv/psb_intel_display.c 
b/drivers/staging/mrst/drv/psb_intel_display.c
index 304194f..83f3a3e 100644
--- a/drivers/staging/mrst/drv/psb_intel_display.c
+++ b/drivers/staging/mrst/drv/psb_intel_display.c
@@ -1923,7 +1923,7 @@ void mrstWaitForPipeEnable(struct drm_device *dev)
 
 static const struct mrst_limit_t *mrst_limit(struct drm_crtc *crtc)
 {
-       const struct mrst_limit_t *limit;
+       const struct mrst_limit_t *limit = NULL;
        struct drm_device *dev = crtc->dev;
        DRM_DRIVER_PRIVATE_T *dev_priv = dev->dev_private;
 
diff --git a/drivers/staging/mrst/drv/psb_intel_display2.c 
b/drivers/staging/mrst/drv/psb_intel_display2.c
index bb36710..7219a74 100644
--- a/drivers/staging/mrst/drv/psb_intel_display2.c
+++ b/drivers/staging/mrst/drv/psb_intel_display2.c
@@ -29,6 +29,12 @@
 #include "mdfld_dsi_dbi_dpu.h"
 #endif
 
+#include <linux/pm_runtime.h>
+
+extern int allow_runtime_pm;
+extern struct drm_device *gpDrmDevice;
+extern void mdfld_save_display(struct drm_device *dev);
+
 /* MDFLD_PLATFORM start */
 void mdfldWaitForPipeDisable(struct drm_device *dev, int pipe)
 {
@@ -658,12 +664,22 @@ static void mdfld_crtc_dpms(struct drm_crtc *crtc, int 
mode)
                /* Give the overlay scaler a chance to enable
                   if it's on this pipe */
                /* psb_intel_crtc_dpms_video(crtc, true); TODO */
+
+               //Runtime PM
+               if(allow_runtime_pm){
+                       dev_priv->is_mipi_on = true;
+               }
+
                break;
        case DRM_MODE_DPMS_OFF:
                /* Give the overlay scaler a chance to disable
                 * if it's on this pipe */
                /* psb_intel_crtc_dpms_video(crtc, FALSE); TODO */
 
+               //Runtime PM
+                if(allow_runtime_pm && dev_priv->is_mipi_on && pipe == 0)
+                         mdfld_save_display(gpDrmDevice);
+
                if (pipe != 1)
                        mdfld_dsi_gen_fifo_ready (dev, gen_fifo_stat_reg, 
HS_CTRL_FIFO_EMPTY | HS_DATA_FIFO_EMPTY);
 
@@ -717,6 +733,13 @@ static void mdfld_crtc_dpms(struct drm_crtc *crtc, int 
mode)
 #endif  /* MDFLD_PO_JLIU7 */   
                        }
                }
+
+               //Runtime PM
+                if(allow_runtime_pm && pipe == 1){
+                        dev_priv->is_mipi_on = false;
+                        pm_request_idle(&gpDrmDevice->pdev->dev);
+                }
+
                break;
        }
 
diff --git a/drivers/staging/mrst/drv/psb_powermgmt.c 
b/drivers/staging/mrst/drv/psb_powermgmt.c
index 6962b71..6a7e976 100644
--- a/drivers/staging/mrst/drv/psb_powermgmt.c
+++ b/drivers/staging/mrst/drv/psb_powermgmt.c
@@ -39,6 +39,8 @@
 #include <asm/intel_scu_ipc.h>
 #include <linux/pm_runtime.h>
 
+#undef OSPM_GFX_DPK
+
 extern IMG_UINT32 gui32SGXDeviceID;
 extern IMG_UINT32 gui32MRSTDisplayDeviceID;
 extern IMG_UINT32 gui32MRSTMSVDXDeviceID;
@@ -53,6 +55,7 @@ static atomic_t g_display_access_count;
 static atomic_t g_graphics_access_count;
 static atomic_t g_videoenc_access_count;
 static atomic_t g_videodec_access_count;
+int allow_runtime_pm = 0;
 
 void ospm_power_island_up(int hw_islands);
 void ospm_power_island_down(int hw_islands);
@@ -212,10 +215,9 @@ static int ospm_runtime_pm_topaz_resume(struct drm_device 
*dev)
 }
 #endif
 
-#if 0
+#ifdef FIX_OSPM_POWER_DOWN
 void ospm_apm_power_down_msvdx(struct drm_device *dev)
 {
-       //FIXME-RAJESH: 
        return;
        mutex_lock(&g_ospm_mutex);
 
@@ -237,7 +239,6 @@ out:
 
 void ospm_apm_power_down_topaz(struct drm_device *dev)
 {
-       //FIXME-RAJESH: 
        return; /* todo for OSPM */
 
        mutex_lock(&g_ospm_mutex);
@@ -363,6 +364,7 @@ void ospm_power_uninit(void)
        pm_runtime_set_suspended(&gpDrmDevice->pdev->dev);
 }
 
+
 /*
  * save_display_registers
  *
@@ -1241,6 +1243,21 @@ static int mdfld_restore_cursor_overlay_registers(struct 
drm_device *dev)
 }
 
 /*
+ *  mdfld_save_display
+ *
+ * Description: Save display status before DPMS OFF for RuntimePM
+ */
+void mdfld_save_display(struct drm_device *dev)
+{
+       printk(KERN_ALERT "ospm_save_display\n");
+
+       mdfld_save_cursor_overlay_registers(dev);
+
+       mdfld_save_display_registers(dev, 0);
+
+       mdfld_save_display_registers(dev, 2);
+}
+/*
  * powermgmt_suspend_display
  *
  * Description: Suspend the display hardware saving state and disabling
@@ -1272,22 +1289,28 @@ void ospm_suspend_display(struct drm_device *dev)
 
                mdfld_save_cursor_overlay_registers(dev);
 
-               if (dev_priv->dbi_panel_on) {
+                //Runtime PM
+                if(dev_priv->is_mipi_on)
+                        mdfld_save_cursor_overlay_registers(dev);
+
+               if(dev_priv->is_mipi_on){
                        mdfld_save_display_registers(dev, 0);
                        if (mdfld_dsi_dbi_update_power(dev_priv->dbi_output, 
DRM_MODE_DPMS_OFF)) 
                                DRM_ERROR("%s, can't disable dbi_0 panel. \n", 
__FUNCTION__);
                        
-                       mdfld_disable_crtc (dev, 0);
                }
 
-               if (dev_priv->dbi_panel_on2) {
+               mdfld_disable_crtc (dev, 0);
+
+               if(dev_priv->is_mipi_on){
                        mdfld_save_display_registers(dev, 2);
                        if (mdfld_dsi_dbi_update_power(dev_priv->dbi_output2, 
DRM_MODE_DPMS_OFF)) 
                                DRM_ERROR("%s, can't disable dbi_2 panel. \n", 
__FUNCTION__);
 
-                       mdfld_disable_crtc (dev, 2);
                }
 
+               mdfld_disable_crtc (dev, 2);
+
                if (PSB_RVDC32(HDMIB_CONTROL) & HDMIB_PORT_EN) {
                        mdfld_save_display_registers(dev, 1);
 
@@ -1383,13 +1406,10 @@ void ospm_resume_display(struct pci_dev *pdev)
        /*psb_gtt_init(dev_priv->pg, 1);*/
        
        if (IS_MDFLD(dev)) {
-               if (dev_priv->dbi_panel_on) {
-                       mdfld_restore_display_registers(dev, 0);
-               }
 
-               if (dev_priv->dbi_panel_on2) {
-                       mdfld_restore_display_registers(dev, 2);
-               }
+               mdfld_restore_display_registers(dev, 0);
+
+               mdfld_restore_display_registers(dev, 2);
 
 #if 0  /* FIXME_JLIU7 need to add similiar functions for DPI MIPI */
                if (dev_priv->dpi_panel_on) {
@@ -1506,7 +1526,9 @@ int ospm_power_suspend(struct pci_dev *pdev, pm_message_t 
state)
 
        if(gbSuspendInProgress || gbResumeInProgress)
         {
-                printk(KERN_ALERT "FIXME-RAJESH: %s system BUSY \n", __func__);
+#ifdef OSPM_GFX_DPK
+                printk(KERN_ALERT "OSPM_GFX_DPK: %s system BUSY \n", __func__);
+#endif
                 return  -EBUSY;
         }
 
@@ -1570,7 +1592,9 @@ void ospm_power_island_up(int hw_islands)
        if (IS_MID(gpDrmDevice) && 
                (hw_islands & (OSPM_GRAPHICS_ISLAND | OSPM_VIDEO_ENC_ISLAND |
                       OSPM_VIDEO_DEC_ISLAND))) {
+
                pwr_cnt = inl(dev_priv->apm_base + PSB_APM_CMD);
+
                pwr_mask = 0;
                if (hw_islands & OSPM_GRAPHICS_ISLAND) {
                        pwr_cnt &= ~PSB_PWRGT_GFX_MASK;
@@ -1594,9 +1618,11 @@ void ospm_power_island_up(int hw_islands)
                }
 
                outl(pwr_cnt, dev_priv->apm_base + PSB_APM_CMD);
+
                while (true) {
-                       pwr_sts = inl(dev_priv->apm_base + PSB_APM_STS);
-            if ((pwr_sts & pwr_mask) == 0)
+                   pwr_sts = inl(dev_priv->apm_base + PSB_APM_STS);
+
+                   if ((pwr_sts & pwr_mask) == 0)
                                break;
                        else
                                udelay(10);
@@ -1635,13 +1661,17 @@ int ospm_power_resume(struct pci_dev *pdev)
 {
        if(gbSuspendInProgress || gbResumeInProgress)
         {
-                printk(KERN_ALERT "FIXME-RAJESH: %s hw_island: Suspend || 
gbResumeInProgress!!!! \n", __func__);
+#ifdef OSPM_GFX_DPK
+                printk(KERN_ALERT "OSPM_GFX_DPK: %s hw_island: Suspend || 
gbResumeInProgress!!!! \n", __func__);
+#endif
                 return 0;
         }
 
         mutex_lock(&g_ospm_mutex);
 
-       printk(KERN_ALERT "FIXME-RAJESH: ospm_power_resume \n");
+#ifdef OSPM_GFX_DPK
+       printk(KERN_ALERT "OSPM_GFX_DPK: ospm_power_resume \n");
+#endif
 
        gbResumeInProgress = true;
 
@@ -1699,8 +1729,9 @@ void ospm_power_island_down(int islands)
                pwr_cnt |= inl(dev_priv->apm_base);
                outl(pwr_cnt, dev_priv->apm_base);
                while (true) {
-                       pwr_sts = inl(dev_priv->apm_base + PSB_APM_STS);
-            if ((pwr_sts & pwr_mask) == pwr_mask)
+                   pwr_sts = inl(dev_priv->apm_base + PSB_APM_STS);
+
+                   if ((pwr_sts & pwr_mask) == pwr_mask)
                                break;
                        else
                                udelay(10);
@@ -1880,7 +1911,6 @@ bool ospm_power_using_hw_begin(int hw_island, bool 
force_on)
                }
                //increment pm_runtime_refcount
                        pm_runtime_get(&pdev->dev);
-               //printk(KERN_ALERT "Mrst Runtime PM: %s , ref_count:%d, 
hw_island:%d\n", __func__, atomic_read(&pdev->dev.power.usage_count), 
hw_island);
        }
 
 #if 0 /* conflict with X holding the lock*/
@@ -1901,7 +1931,6 @@ bool ospm_power_using_hw_begin(int hw_island, bool 
force_on)
  */
 void ospm_power_using_hw_end(int hw_island)
 {
-       int ret;
        switch(hw_island)
        {
                case OSPM_GRAPHICS_ISLAND:
@@ -1917,16 +1946,10 @@ void ospm_power_using_hw_end(int hw_island)
                        atomic_dec(&g_display_access_count);
                        break;
        }
-       ret = pm_runtime_put(&gpDrmDevice->pdev->dev);
-       /*printk(KERN_ALERT "Mrst Runtime PM: %s , ref_count:%d, 
hw_island:%d\n", __func__, 
atomic_read(&gpDrmDevice->pdev->dev.power.usage_count), hw_island);
-       if(atomic_read(&g_graphics_access_count))
-               printk(KERN_ALERT "gfx\n");
-       if(atomic_read(&g_videoenc_access_count))
-               printk(KERN_ALERT "enc\n");
-       if(atomic_read(&g_videodec_access_count))
-               printk(KERN_ALERT "dec\n");
-       if(atomic_read(&g_display_access_count))
-               printk(KERN_ALERT "display\n");*/
+
+        //decrement runtime pm ref count
+       pm_runtime_put(&gpDrmDevice->pdev->dev);
+
        WARN_ON(atomic_read(&g_graphics_access_count) < 0);
        WARN_ON(atomic_read(&g_videoenc_access_count) < 0);
        WARN_ON(atomic_read(&g_videodec_access_count) < 0);
@@ -1934,20 +1957,34 @@ void ospm_power_using_hw_end(int hw_island)
 }
 int psb_runtime_suspend(struct device *dev)
 {
+       struct drm_psb_private* dev_priv = gpDrmDevice->dev_private;
        pm_message_t state;
        int ret = 0;
        state.event = 0;
-       //printk(KERN_ALERT "Mrst Runtime PM: %s \n", __func__);
-       ret = ospm_power_suspend(gpDrmDevice->pdev, state);
+
+#ifdef OSPM_GFX_DPK
+       printk(KERN_ALERT "OSPM_GFX_DPK: %s \n", __func__);
+#endif
+        if (atomic_read(&g_graphics_access_count) || 
atomic_read(&g_videoenc_access_count)
+           || atomic_read(&g_videodec_access_count) || 
atomic_read(&g_display_access_count)
+           || dev_priv->is_mipi_on ){
+#ifdef OSPM_GFX_DPK
+                printk(KERN_ALERT "OSPM_GFX_DPK: GFX: %d VEC: %d VED: %d DC: 
%d MIPI: %d \n", atomic_read(&g_graphics_access_count),
+                         atomic_read(&g_videoenc_access_count), 
atomic_read(&g_videodec_access_count), atomic_read(&g_display_access_count),
+                        dev_priv->is_mipi_on);
+#endif
+                return -EBUSY;
+        }
+        else
+               ret = ospm_power_suspend(gpDrmDevice->pdev, state);
+
        return ret;
 }
 
 int psb_runtime_resume(struct device *dev)
 {
-       int ret = 0;
-       //printk(KERN_ALERT "Mrst Runtime PM: %s \n", __func__);
        /*Nop*/
-       return ret;
+       return 0;
 }
 
 int psb_runtime_idle(struct device *dev)
diff --git a/drivers/staging/mrst/drv/pyr_cmd.c 
b/drivers/staging/mrst/drv/pyr_cmd.c
index 5db6faa..503e8ef 100644
--- a/drivers/staging/mrst/drv/pyr_cmd.c
+++ b/drivers/staging/mrst/drv/pyr_cmd.c
@@ -29,6 +29,7 @@
 
 #include "displays/pyr_cmd.h"
 #include "mdfld_dsi_dbi.h"
+#include "mdfld_dsi_dbi_dpu.h"
 
 struct drm_display_mode*
 pyr_cmd_get_config_mode(struct drm_device* dev)
diff --git a/drivers/staging/mrst/drv/tpo_cmd.c 
b/drivers/staging/mrst/drv/tpo_cmd.c
index 91249f0..6ac10a3 100644
--- a/drivers/staging/mrst/drv/tpo_cmd.c
+++ b/drivers/staging/mrst/drv/tpo_cmd.c
@@ -29,6 +29,7 @@
 
 #include "displays/tpo_cmd.h"
 #include "mdfld_dsi_dbi.h"
+#include "mdfld_dsi_dbi_dpu.h"
 
 static struct drm_display_mode*
 tpo_cmd_get_config_mode(struct drm_device* dev)
diff --git a/drivers/staging/mrst/pvr/services4/system/medfield/psb_powermgmt.h 
b/drivers/staging/mrst/pvr/services4/system/medfield/psb_powermgmt.h
deleted file mode 100644
index 62c2ac4..0000000
--- a/drivers/staging/mrst/pvr/services4/system/medfield/psb_powermgmt.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/**************************************************************************
- * Copyright (c) 2009, Intel Corporation.
- * All Rights Reserved.
-
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 
THE
- * SOFTWARE.
- *
- * Authors:
- *    Benjamin Defnet <[email protected]>
- *    Rajesh Poornachandran <[email protected]>
- *
- */
-#ifndef _PSB_POWERMGMT_H_
-#define _PSB_POWERMGMT_H_
-
-#include <linux/pci.h>
-#include <drm/drmP.h>
-
-#define OSPM_GRAPHICS_ISLAND   0x1
-#define OSPM_VIDEO_ENC_ISLAND  0x2
-#define OSPM_VIDEO_DEC_ISLAND  0x4
-#define OSPM_DISPLAY_ISLAND    0x8
-#define OSPM_ALL_ISLANDS       0xf
-
-typedef enum _UHBUsage
-{
-    OSPM_UHB_ONLY_IF_ON = 0,
-    OSPM_UHB_FORCE_POWER_ON,
-    OSPM_UHB_IGNORE_POWER_OFF,
-} UHBUsage;
-
-//extern int psb_check_msvdx_idle(struct drm_device *dev);
-//extern int lnc_check_topaz_idle(struct drm_device *dev);
-/* Use these functions to power down video HW for D0i3 purpose  */
-void ospm_apm_power_down_msvdx(struct drm_device *dev);
-void ospm_apm_power_down_topaz(struct drm_device *dev);
-
-void ospm_power_init(struct drm_device *dev);
-void ospm_power_uninit(void);
-
-
-/*
- * OSPM will call these functions
- */
-int ospm_power_suspend(struct pci_dev *pdev, pm_message_t state);
-int ospm_power_resume(struct pci_dev *pdev);
-
-/*
- * These are the functions the driver should use to wrap all hw access
- * (i.e. register reads and writes)
- */
-bool ospm_power_using_hw_begin(int hw_island, bool force_on);
-void ospm_power_using_hw_end(int hw_island);
-
-/*
- * Use this function to do an instantaneous check for if the hw is on.
- * Only use this in cases where you know the g_state_change_mutex
- * is already held such as in irq install/uninstall and you need to
- * prevent a deadlock situation.  Otherwise use ospm_power_using_hw_begin().
- */
-bool ospm_power_is_hw_on(int hw_islands);
-
-/*
- * Power up/down different hw component rails/islands
- */
-void ospm_power_island_down(int hw_islands);
-void ospm_power_island_up(int hw_islands);
-void ospm_suspend_graphics(void);
-#endif /*_PSB_POWERMGMT_H_*/
diff --git a/drivers/staging/mrst/pvr/services4/system/medfield/sysconfig.c 
b/drivers/staging/mrst/pvr/services4/system/medfield/sysconfig.c
index 3dd4b83..3ea30f8 100644
--- a/drivers/staging/mrst/pvr/services4/system/medfield/sysconfig.c
+++ b/drivers/staging/mrst/pvr/services4/system/medfield/sysconfig.c
@@ -53,7 +53,7 @@
 #define SYS_SGX_CLOCK_SPEED                    (400000000)
 #define SYS_SGX_HWRECOVERY_TIMEOUT_FREQ                (100) 
 #define SYS_SGX_PDS_TIMER_FREQ                 (1000) 
-#define SYS_SGX_ACTIVE_POWER_LATENCY_MS                (50)
+#define SYS_SGX_ACTIVE_POWER_LATENCY_MS                (5)
 
 #if defined(SUPPORT_DRI_DRM_EXT)
 #define        DRI_DRM_STATIC
diff --git a/drivers/staging/mrst/pvr/services4/system/moorestown/sysconfig.c 
b/drivers/staging/mrst/pvr/services4/system/moorestown/sysconfig.c
index 15add05..dc1d428 100644
--- a/drivers/staging/mrst/pvr/services4/system/moorestown/sysconfig.c
+++ b/drivers/staging/mrst/pvr/services4/system/moorestown/sysconfig.c
@@ -52,7 +52,7 @@
 #define SYS_SGX_CLOCK_SPEED                    (400000000)
 #define SYS_SGX_HWRECOVERY_TIMEOUT_FREQ                (100) 
 #define SYS_SGX_PDS_TIMER_FREQ                 (1000) 
-#define SYS_SGX_ACTIVE_POWER_LATENCY_MS                (50)
+#define SYS_SGX_ACTIVE_POWER_LATENCY_MS                (5)
 
 #if defined(SUPPORT_DRI_DRM_EXT)
 #define        DRI_DRM_STATIC
diff --git a/drivers/staging/mrst/pvr/services4/system/unified/psb_powermgmt.h 
b/drivers/staging/mrst/pvr/services4/system/unified/psb_powermgmt.h
deleted file mode 100644
index 62c2ac4..0000000
--- a/drivers/staging/mrst/pvr/services4/system/unified/psb_powermgmt.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/**************************************************************************
- * Copyright (c) 2009, Intel Corporation.
- * All Rights Reserved.
-
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 
THE
- * SOFTWARE.
- *
- * Authors:
- *    Benjamin Defnet <[email protected]>
- *    Rajesh Poornachandran <[email protected]>
- *
- */
-#ifndef _PSB_POWERMGMT_H_
-#define _PSB_POWERMGMT_H_
-
-#include <linux/pci.h>
-#include <drm/drmP.h>
-
-#define OSPM_GRAPHICS_ISLAND   0x1
-#define OSPM_VIDEO_ENC_ISLAND  0x2
-#define OSPM_VIDEO_DEC_ISLAND  0x4
-#define OSPM_DISPLAY_ISLAND    0x8
-#define OSPM_ALL_ISLANDS       0xf
-
-typedef enum _UHBUsage
-{
-    OSPM_UHB_ONLY_IF_ON = 0,
-    OSPM_UHB_FORCE_POWER_ON,
-    OSPM_UHB_IGNORE_POWER_OFF,
-} UHBUsage;
-
-//extern int psb_check_msvdx_idle(struct drm_device *dev);
-//extern int lnc_check_topaz_idle(struct drm_device *dev);
-/* Use these functions to power down video HW for D0i3 purpose  */
-void ospm_apm_power_down_msvdx(struct drm_device *dev);
-void ospm_apm_power_down_topaz(struct drm_device *dev);
-
-void ospm_power_init(struct drm_device *dev);
-void ospm_power_uninit(void);
-
-
-/*
- * OSPM will call these functions
- */
-int ospm_power_suspend(struct pci_dev *pdev, pm_message_t state);
-int ospm_power_resume(struct pci_dev *pdev);
-
-/*
- * These are the functions the driver should use to wrap all hw access
- * (i.e. register reads and writes)
- */
-bool ospm_power_using_hw_begin(int hw_island, bool force_on);
-void ospm_power_using_hw_end(int hw_island);
-
-/*
- * Use this function to do an instantaneous check for if the hw is on.
- * Only use this in cases where you know the g_state_change_mutex
- * is already held such as in irq install/uninstall and you need to
- * prevent a deadlock situation.  Otherwise use ospm_power_using_hw_begin().
- */
-bool ospm_power_is_hw_on(int hw_islands);
-
-/*
- * Power up/down different hw component rails/islands
- */
-void ospm_power_island_down(int hw_islands);
-void ospm_power_island_up(int hw_islands);
-void ospm_suspend_graphics(void);
-#endif /*_PSB_POWERMGMT_H_*/
diff --git 
a/drivers/staging/mrst/pvr/services4/system/unified/sysconfig-medfield.c 
b/drivers/staging/mrst/pvr/services4/system/unified/sysconfig-medfield.c
index 1cb3aa1..93cb20b 100644
--- a/drivers/staging/mrst/pvr/services4/system/unified/sysconfig-medfield.c
+++ b/drivers/staging/mrst/pvr/services4/system/unified/sysconfig-medfield.c
@@ -52,7 +52,7 @@
 #define SYS_SGX_CLOCK_SPEED                    (400000000)
 #define SYS_SGX_HWRECOVERY_TIMEOUT_FREQ                (100) 
 #define SYS_SGX_PDS_TIMER_FREQ                 (1000) 
-#define SYS_SGX_ACTIVE_POWER_LATENCY_MS                (50)
+#define SYS_SGX_ACTIVE_POWER_LATENCY_MS                (5)
 
 #if defined(SUPPORT_DRI_DRM_EXT)
 #define        DRI_DRM_STATIC
diff --git 
a/drivers/staging/mrst/pvr/services4/system/unified/sysconfig-moorestown.c 
b/drivers/staging/mrst/pvr/services4/system/unified/sysconfig-moorestown.c
index 821f6a4..9b29870 100644
--- a/drivers/staging/mrst/pvr/services4/system/unified/sysconfig-moorestown.c
+++ b/drivers/staging/mrst/pvr/services4/system/unified/sysconfig-moorestown.c
@@ -52,7 +52,7 @@
 #define SYS_SGX_CLOCK_SPEED                    (400000000)
 #define SYS_SGX_HWRECOVERY_TIMEOUT_FREQ                (100) 
 #define SYS_SGX_PDS_TIMER_FREQ                 (1000) 
-#define SYS_SGX_ACTIVE_POWER_LATENCY_MS                (50)
+#define SYS_SGX_ACTIVE_POWER_LATENCY_MS                (5)
 
 #if defined(SUPPORT_DRI_DRM_EXT)
 #define        DRI_DRM_STATIC
-- 
1.7.1

_______________________________________________
MeeGo-kernel mailing list
[email protected]
http://lists.meego.com/listinfo/meego-kernel

Reply via email to