gfx: display: use a bool parameter for force in ospm_power_using_hw_begin()
authorJani Nikula <jani.nikula@intel.com>
Tue, 7 Feb 2012 13:08:23 +0000 (15:08 +0200)
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Tue, 3 Jul 2012 09:29:43 +0000 (12:29 +0300)
Remove an unnecessary level of abstraction from what is a simple thing.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Tested-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
13 files changed:
drivers/staging/mrst/drv/mdfld_dsi_dbi.c
drivers/staging/mrst/drv/mdfld_dsi_dpi.c
drivers/staging/mrst/drv/mdfld_dsi_output.c
drivers/staging/mrst/drv/mdfld_overlay.c
drivers/staging/mrst/drv/psb_bl.c
drivers/staging/mrst/drv/psb_drv.c
drivers/staging/mrst/drv/psb_intel_display.c
drivers/staging/mrst/drv/psb_irq.c
drivers/staging/mrst/drv/psb_page_flip.c
drivers/staging/mrst/drv/psb_powermgmt.c
drivers/staging/mrst/drv/psb_powermgmt.h
drivers/staging/mrst/drv/psb_sgx.c
drivers/staging/mrst/drv/tpo_cmd.c

index e41f9fe..ed3a550 100644 (file)
@@ -208,7 +208,7 @@ void mdfld_dsi_dbi_enter_dsr (struct mdfld_dsi_dbi_output * dbi_output, int pipe
                dspsurf_reg = DSPCSURF;
        }
 
-       if (!ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, OSPM_UHB_FORCE_POWER_ON)) {
+       if (!ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, true)) {
                DRM_ERROR("hw begin failed\n");
                return;
        }
@@ -275,7 +275,7 @@ static void mdfld_dbi_output_exit_dsr (struct mdfld_dsi_dbi_output * dbi_output,
                dspcntr_reg = DSPCCNTR;
        }
 
-       if (!ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, OSPM_UHB_FORCE_POWER_ON)) {
+       if (!ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, true)) {
                DRM_ERROR("hw begin failed\n");
                return;
        }
index 0df7458..9f5896c 100644 (file)
@@ -678,7 +678,7 @@ static void mdfld_dsi_dpi_set_power(struct drm_encoder * encoder, bool on)
                pipeconf_reg = PIPECCONF;
        
        /*start up display island if it was shutdown*/
-       if (!ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, OSPM_UHB_FORCE_POWER_ON))
+       if (!ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, true))
                return;
 
        if(on) {
@@ -907,7 +907,7 @@ void mdfld_dsi_dpi_mode_set(struct drm_encoder * encoder,
        }
        
        /*start up display island if it was shutdown*/
-       if (!ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, OSPM_UHB_FORCE_POWER_ON))
+       if (!ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, true))
                return;
 
        if (get_panel_type(dev, pipe) == TC35876X) {
index 148d25f..f432c82 100644 (file)
@@ -255,7 +255,7 @@ static void mdfld_dsi_controller_shutdown(struct mdfld_dsi_config * dsi_config,
        
        dev = dsi_config->dev;
        
-       if (!ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, OSPM_UHB_FORCE_POWER_ON)) {
+       if (!ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, true)) {
                DRM_ERROR("hw begin failed\n");
                return;
        }
@@ -311,7 +311,7 @@ static void mdfld_dsi_controller_startup(struct mdfld_dsi_config * dsi_config, i
        
        dev = dsi_config->dev;
        
-       if (!ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, OSPM_UHB_FORCE_POWER_ON)) {
+       if (!ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, true)) {
                DRM_ERROR("hw begin failed\n");
                return;
        }
index fab66b5..f89a879 100644 (file)
@@ -262,7 +262,7 @@ static int ovl_wait(struct mfld_overlay *ovl)
        unsigned long timeout = jiffies + msecs_to_jiffies(OVL_UPDATE_TIMEOUT);
 
        /* No point in waiting if the hardware is powered down */
-       if (!ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, OSPM_UHB_ONLY_IF_ON))
+       if (!ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, false))
                return 0;
 
        /*
@@ -322,7 +322,7 @@ static void ovl_commit(struct mfld_overlay *ovl, unsigned int dirty)
        spin_unlock_irq(&ovl->regs_lock);
 
        /* If the hardware is powered down, postpone the OVADD write to resume time. */
-       if (!ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, OSPM_UHB_ONLY_IF_ON))
+       if (!ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, false))
                return;
 
        spin_lock_irq(&ovl->regs_lock);
@@ -1361,7 +1361,7 @@ static int ovl_regs_show(struct seq_file *s, void *data)
 #undef OVL_REG_SHOW
 #define OVL_REG_SHOW(x) seq_printf(s, "%s 0x%08x\n", #x, OVL_REG_READ(ovl, OVL_ ## x))
 
-       if (!ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, OSPM_UHB_FORCE_POWER_ON))
+       if (!ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, true))
                return -ENXIO;
 
        OVL_REG_SHOW(OVADD);
index d5234a4..c8cf4da 100644 (file)
@@ -62,8 +62,7 @@ int psb_set_brightness(struct backlight_device *bd)
        if (level < BRIGHTNESS_MIN_LEVEL)
                level = BRIGHTNESS_MIN_LEVEL;
 
-       if (ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND,
-                                       OSPM_UHB_ONLY_IF_ON)) {
+       if (ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, false)) {
                u32 adjusted_level = 0;
 
                /*
index 0c1d666..0455daf 100644 (file)
@@ -1507,9 +1507,8 @@ static int psb_hist_enable_ioctl(struct drm_device *dev, void *data,
        struct dpst_ie_histogram_control ie_hist_cont_reg;
        uint32_t *enable = data;
 
-       if (!ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, OSPM_UHB_FORCE_POWER_ON)) {
+       if (!ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, true))
                return 0;
-       }
 
        if (*enable == 1) {
                ie_hist_cont_reg.data = PSB_RVDC32(HISTOGRAM_LOGIC_CONTROL);
@@ -1562,9 +1561,8 @@ static int psb_hist_status_ioctl(struct drm_device *dev, void *data,
        uint32_t iedbr_busy_bit         = 0x80000000;
        int dpst3_bin_count             = 32;
 
-       if (!ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, OSPM_UHB_ONLY_IF_ON)) {
+       if (!ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, false))
                return 0;
-       }
 
        ie_hist_cont_reg.data                   = PSB_RVDC32(blm_hist_ctl);
        ie_hist_cont_reg.bin_reg_func_select    = dpst3_bin_threshold_count;
@@ -1636,9 +1634,8 @@ static int psb_dpst_ioctl(struct drm_device *dev, void *data,
        uint32_t y;
        uint32_t reg;
 
-       if (!ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, OSPM_UHB_ONLY_IF_ON)) {
+       if (!ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, false))
                return 0;
-       }
 
        reg = PSB_RVDC32(PIPEASRC);
 
@@ -1694,9 +1691,8 @@ static int psb_update_guard_ioctl(struct drm_device *dev, void *data,
        struct dpst_guardband* input = (struct dpst_guardband*) data;
        struct dpst_guardband reg_data;
 
-       if (!ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, OSPM_UHB_ONLY_IF_ON)) {
+       if (!ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, false))
                return 0;
-       }
 
        reg_data.data = PSB_RVDC32(HISTOGRAM_INT_CONTROL);
        reg_data.guardband = input->guardband;
@@ -1742,8 +1738,7 @@ static int psb_mode_operation_ioctl(struct drm_device *dev, void *data,
                drm_fb = obj_to_fb(obj);
                psb_fb = to_psb_fb(drm_fb);
 
-               if (ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND,
-                                             OSPM_UHB_ONLY_IF_ON)) {
+               if (ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, false)) {
                        REG_WRITE(DSPASURF, psb_fb->offset);
                        REG_READ(DSPASURF);
                        ospm_power_using_hw_end(OSPM_DISPLAY_ISLAND);
@@ -1944,11 +1939,10 @@ static int psb_register_rw_ioctl(struct drm_device *dev, void *data,
        struct drm_psb_register_rw_arg *arg = data;
        unsigned int iep_ble_status;
        unsigned long iep_timeout;
-       UHBUsage usage =
-               arg->b_force_hw_on ? OSPM_UHB_FORCE_POWER_ON : OSPM_UHB_ONLY_IF_ON;
+       bool force_on = arg->b_force_hw_on;
 
        if (arg->display_write_mask != 0) {
-               if (ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, usage)) {
+               if (ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, force_on)) {
                        if (arg->display_write_mask & REGRWBITS_PFIT_CONTROLS)
                                PSB_WVDC32(arg->display.pfit_controls,
                                           PFIT_CONTROL);
@@ -1998,7 +1992,7 @@ static int psb_register_rw_ioctl(struct drm_device *dev, void *data,
        }
 
        if (arg->display_read_mask != 0) {
-               if (ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, usage)) {
+               if (ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, force_on)) {
                        if (arg->display_read_mask &
                            REGRWBITS_PFIT_CONTROLS)
                                arg->display.pfit_controls =
@@ -2045,7 +2039,7 @@ static int psb_register_rw_ioctl(struct drm_device *dev, void *data,
        }
 
        if (arg->overlay_write_mask != 0) {
-               if (ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, usage)) {
+               if (ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, force_on)) {
                        if (arg->overlay_write_mask & OV_REGRWBITS_OGAM_ALL) {
                                PSB_WVDC32(arg->overlay.OGAMC5, OV_OGAMC5);
                                PSB_WVDC32(arg->overlay.OGAMC4, OV_OGAMC4);
@@ -2152,7 +2146,7 @@ static int psb_register_rw_ioctl(struct drm_device *dev, void *data,
        }
 
        if (arg->overlay_read_mask != 0) {
-               if (ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, usage)) {
+               if (ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, force_on)) {
                        if (arg->overlay_read_mask & OV_REGRWBITS_OGAM_ALL) {
                                arg->overlay.OGAMC5 = PSB_RVDC32(OV_OGAMC5);
                                arg->overlay.OGAMC4 = PSB_RVDC32(OV_OGAMC4);
@@ -2199,7 +2193,7 @@ static int psb_register_rw_ioctl(struct drm_device *dev, void *data,
        }
 
        if (arg->sprite_enable_mask != 0) {
-               if (ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, usage)) {
+               if (ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, force_on)) {
                        PSB_WVDC32(0x1F3E, DSPARB);
                        PSB_WVDC32(arg->sprite.dspa_control | PSB_RVDC32(DSPACNTR), DSPACNTR);
                        PSB_WVDC32(arg->sprite.dspa_key_value, DSPAKEYVAL);
@@ -2218,7 +2212,7 @@ static int psb_register_rw_ioctl(struct drm_device *dev, void *data,
        }
 
        if (arg->sprite_disable_mask != 0) {
-               if (ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, usage)) {
+               if (ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, force_on)) {
                        PSB_WVDC32(0x3F3E, DSPARB);
                        PSB_WVDC32(0x0, DSPCCNTR);
                        PSB_WVDC32(arg->sprite.dspc_surface, DSPCSURF);
@@ -2228,7 +2222,7 @@ static int psb_register_rw_ioctl(struct drm_device *dev, void *data,
        }
 
        if (arg->subpicture_enable_mask != 0) {
-               if (ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, usage)) {
+               if (ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, force_on)) {
                        uint32_t temp;
                        if (arg->subpicture_enable_mask & REGRWBITS_DSPACNTR) {
                                temp =  PSB_RVDC32(DSPACNTR);
@@ -2277,7 +2271,7 @@ static int psb_register_rw_ioctl(struct drm_device *dev, void *data,
        }
 
        if (arg->subpicture_disable_mask != 0) {
-               if (ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, usage)) {
+               if (ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, force_on)) {
                        uint32_t temp;
                        if (arg->subpicture_disable_mask & REGRWBITS_DSPACNTR) {
                                temp =  PSB_RVDC32(DSPACNTR);
index 5d7d8ab..0180112 100644 (file)
@@ -168,8 +168,7 @@ void psb_intel_crtc_load_lut(struct drm_crtc *crtc)
                return;
        }
        
-       if (ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND,
-                                     OSPM_UHB_ONLY_IF_ON)) {
+       if (ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, false)) {
                for (i = 0; i < 256; i++) {
                        REG_WRITE(palreg + 4 * i,
                                  ((psb_intel_crtc->lut_r[i] +
@@ -694,8 +693,7 @@ static int mdfld_intel_crtc_cursor_set(struct drm_crtc *crtc,
                temp = 0;
                temp |= CURSOR_MODE_DISABLE;
 
-               if (ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND,
-                                             OSPM_UHB_ONLY_IF_ON)) {
+               if (ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, false)) {
                        REG_WRITE(control, temp);
                        REG_WRITE(base, 0);
                        ospm_power_using_hw_end(OSPM_DISPLAY_ISLAND);
@@ -748,7 +746,7 @@ static int mdfld_intel_crtc_cursor_set(struct drm_crtc *crtc,
        temp |= (pipe << 28);
        temp |= CURSOR_MODE_64_ARGB_AX | MCURSOR_GAMMA_ENABLE;
 
-       if (ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, OSPM_UHB_ONLY_IF_ON)) {
+       if (ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, false)) {
                REG_WRITE(control, temp);
                REG_WRITE(base, addr);
                ospm_power_using_hw_end(OSPM_DISPLAY_ISLAND);
@@ -829,8 +827,7 @@ static int mdfld_intel_crtc_cursor_move(struct drm_crtc *crtc, int x, int y)
 
        addr = psb_intel_crtc->cursor_addr;
 
-       if (ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND,
-                                     OSPM_UHB_ONLY_IF_ON)) {
+       if (ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, false)) {
                REG_WRITE(pos, temp);
                REG_WRITE(base, addr);
                ospm_power_using_hw_end(OSPM_DISPLAY_ISLAND);
@@ -919,8 +916,7 @@ static int mdfld__intel_pipe_set_base(struct drm_crtc *crtc, int x, int y,
                return -EINVAL;
        }
 
-       if (!ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND,
-                                      OSPM_UHB_FORCE_POWER_ON))
+       if (!ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, true))
                return 0;
 
        Start = mode_dev->bo_offset(dev, psbfb);
@@ -1105,8 +1101,7 @@ static void mdfld_crtc_dpms(struct drm_crtc *crtc, int mode)
                return;
        }
 
-       if (!ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND,
-                                      OSPM_UHB_FORCE_POWER_ON))
+       if (!ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, true))
                return;
 
        /* XXX: When our outputs are all unaware of DPMS modes other than off
@@ -1544,8 +1539,7 @@ static int mdfld_crtc_mode_set(struct drm_crtc *crtc,
        PSB_DEBUG_ENTRY("pipe = 0x%x\n", pipe);
 
        if (pipe == 1) {
-               if (!ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND,
-                               OSPM_UHB_FORCE_POWER_ON))
+               if (!ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, true))
                        return 0;
                android_hdmi_crtc_mode_set(crtc, mode, adjusted_mode,
                        x, y, old_fb);
@@ -1618,7 +1612,7 @@ static int mdfld_crtc_mode_set(struct drm_crtc *crtc,
        PSB_DEBUG_ENTRY("vdisplay = %d\n",
                 mode->vdisplay);
 
-       if (!ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, OSPM_UHB_FORCE_POWER_ON))
+       if (!ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, true))
                return 0;
 
        memcpy(&psb_intel_crtc->saved_mode, mode, sizeof(struct drm_display_mode));
index 8234eb7..bb49f5b 100644 (file)
@@ -111,7 +111,7 @@ psb_enable_pipestat(struct drm_psb_private *dev_priv, int pipe, u32 mask)
                        trcmd_vblank_power(PVR_TRCMD_RESUME, pipe);
                dev_priv->pipestat[pipe] |= mask;
                /* Enable the interrupt, clear any pending status */
-               if (ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, OSPM_UHB_ONLY_IF_ON)) {
+               if (ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, false)) {
                        u32 writeVal = PSB_RVDC32(reg);
                        writeVal |= (mask | (mask >> 16));
                        PSB_WVDC32(writeVal, reg);
@@ -129,7 +129,7 @@ psb_disable_pipestat(struct drm_psb_private *dev_priv, int pipe, u32 mask)
                if (mask & PIPE_VBLANK_INTERRUPT_ENABLE)
                        trcmd_vblank_power(PVR_TRCMD_SUSPEND, pipe);
                dev_priv->pipestat[pipe] &= ~mask;
-               if (ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, OSPM_UHB_ONLY_IF_ON)) {
+               if (ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, false)) {
                        u32 writeVal = PSB_RVDC32(reg);
                        writeVal &= ~mask;
                        PSB_WVDC32(writeVal, reg);
@@ -142,7 +142,7 @@ psb_disable_pipestat(struct drm_psb_private *dev_priv, int pipe, u32 mask)
 static void
 mid_enable_pipe_event(struct drm_psb_private *dev_priv, int pipe)
 {
-       if (ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, OSPM_UHB_ONLY_IF_ON)) {
+       if (ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, false)) {
                u32 pipe_event = mid_pipe_event(pipe);
                dev_priv->vdc_irq_mask |= pipe_event;
                PSB_WVDC32(~dev_priv->vdc_irq_mask, PSB_INT_MASK_R);
@@ -155,7 +155,7 @@ static void
 mid_disable_pipe_event(struct drm_psb_private *dev_priv, int pipe)
 {
        if (dev_priv->pipestat[pipe] == 0) {
-               if (ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, OSPM_UHB_ONLY_IF_ON)) {
+               if (ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, false)) {
                        u32 pipe_event = mid_pipe_event(pipe);
                        dev_priv->vdc_irq_mask &= ~pipe_event;
                        PSB_WVDC32(~dev_priv->vdc_irq_mask, PSB_INT_MASK_R);
@@ -688,7 +688,7 @@ void psb_irq_turn_on_dpst(struct drm_device *dev)
        u32 hist_reg;
        u32 pwm_reg;
 
-       if (ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, OSPM_UHB_ONLY_IF_ON)) {
+       if (ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, false)) {
                PSB_WVDC32(BIT(31), HISTOGRAM_LOGIC_CONTROL);
                hist_reg = PSB_RVDC32(HISTOGRAM_LOGIC_CONTROL);
                PSB_WVDC32(BIT(31), HISTOGRAM_INT_CONTROL);
@@ -736,7 +736,7 @@ void psb_irq_turn_off_dpst(struct drm_device *dev)
        u32 hist_reg;
        u32 pwm_reg;
 
-       if (ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, OSPM_UHB_ONLY_IF_ON)) {
+       if (ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, false)) {
                PSB_WVDC32(0x00000000, HISTOGRAM_INT_CONTROL);
                hist_reg = PSB_RVDC32(HISTOGRAM_INT_CONTROL);
 
@@ -799,7 +799,7 @@ int psb_enable_vblank(struct drm_device *dev, int pipe)
        if (!is_panel_vid_or_cmd(dev))
                return mdfld_enable_te(dev, pipe);
 
-       if (ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, OSPM_UHB_ONLY_IF_ON)) {
+       if (ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, false)) {
                reg_val = REG_READ(pipeconf_reg);
                ospm_power_using_hw_end(OSPM_DISPLAY_ISLAND);
        }
@@ -914,7 +914,7 @@ int mdfld_enable_te(struct drm_device *dev, int pipe)
 
        PSB_DEBUG_ENTRY("pipe = %d, \n", pipe);
 
-       if (ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, OSPM_UHB_ONLY_IF_ON)) {
+       if (ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, false)) {
                reg_val = REG_READ(pipeconf_reg);
                ospm_power_using_hw_end(OSPM_DISPLAY_ISLAND);
        }
@@ -961,7 +961,7 @@ int mdfld_irq_enable_hdmi_audio(struct drm_device *dev)
        unsigned long irqflags;
        u32 reg_val = 0, mask = 0;
 
-       if (ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, OSPM_UHB_ONLY_IF_ON)) {
+       if (ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, false)) {
                reg_val = REG_READ(PIPEBCONF);
                ospm_power_using_hw_end(OSPM_DISPLAY_ISLAND);
        }
index e825d1f..524852f 100644 (file)
@@ -120,8 +120,7 @@ write_scanout_regs(struct pending_flip *pending_flip, uint32_t offset)
                return;
        }
 
-       if (!ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND,
-                                      OSPM_UHB_FORCE_POWER_ON))
+       if (!ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, true))
                return;
 
        iowrite32(offset, dev_priv->vdc_reg + reg_offset);
index b6f3b4e..857e4cb 100644 (file)
@@ -1588,7 +1588,7 @@ bool ospm_power_is_hw_on(int hw_islands)
  * power state transition and the caller will be expected to handle that
  * even if force_on is set to true.
  */
-bool ospm_power_using_hw_begin(int hw_island, UHBUsage usage)
+bool ospm_power_using_hw_begin(int hw_island, bool force_on)
 {
        struct drm_device *drm_dev = gpDrmDevice; /* FIXME: Pass as parameter */
        bool ret = true;
@@ -1596,7 +1596,6 @@ bool ospm_power_using_hw_begin(int hw_island, UHBUsage usage)
        bool b_atomic = (in_interrupt() || in_atomic());
        bool locked = true;
        IMG_UINT32 deviceID = 0;
-       bool force_on = usage ? true : false;
 
        if (b_atomic)
                pm_runtime_get(&drm_dev->pdev->dev);
index 10e352f..3f1732d 100644 (file)
 #define DISPLAY_B 0x2
 #define DISPLAY_C 0x4
 
-typedef enum _UHBUsage
-{
-    OSPM_UHB_ONLY_IF_ON = 0,
-    OSPM_UHB_FORCE_POWER_ON,
-} 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  */
@@ -80,7 +74,7 @@ int ospm_power_resume(struct device *dev);
  * 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, UHBUsage usage);
+bool ospm_power_using_hw_begin(int hw_island, bool force_on);
 void ospm_power_using_hw_end(int hw_island);
 
 /*
index 74c79a4..d801ea5 100644 (file)
@@ -746,15 +746,13 @@ int psb_cmdbuf_ioctl(struct drm_device *dev, void *data,
                return ret;
 
        if (arg->engine == PSB_ENGINE_VIDEO) {
-               if (!ospm_power_using_hw_begin(OSPM_VIDEO_DEC_ISLAND,
-                                              OSPM_UHB_FORCE_POWER_ON))
+               if (!ospm_power_using_hw_begin(OSPM_VIDEO_DEC_ISLAND, true))
                        return -EBUSY;
        } else if (arg->engine == LNC_ENGINE_ENCODE) {
                if (dev_priv->topaz_disabled)
                        return -ENODEV;
 
-               if (!ospm_power_using_hw_begin(OSPM_VIDEO_ENC_ISLAND,
-                                              OSPM_UHB_FORCE_POWER_ON))
+               if (!ospm_power_using_hw_begin(OSPM_VIDEO_ENC_ISLAND, true))
                        return -EBUSY;
        }
 
index 83dbec8..5bc327e 100644 (file)
@@ -155,7 +155,7 @@ static void mdfld_dsi_dbi_set_power(struct drm_encoder *encoder, bool on)
                        dev_priv->dual_mipi = false;
        }
 
-       if (!ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, OSPM_UHB_FORCE_POWER_ON)) {
+       if (!ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, true)) {
                DRM_ERROR("hw begin failed\n");
                return;
        }
@@ -270,7 +270,7 @@ static void mdfld_dsi_dbi_mode_set(struct drm_encoder * encoder,
                mipi_val |= 0x2; /*two lanes for port A and C respectively*/
        }
 
-       if (!ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, OSPM_UHB_FORCE_POWER_ON)) {
+       if (!ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, true)) {
                DRM_ERROR("hw begin failed\n");
                return;
        }
@@ -431,7 +431,7 @@ static void mdfld_dsi_dbi_update_fb (struct mdfld_dsi_dbi_output * dbi_output, i
                dspsurf_reg = DSPCSURF;
        }
 
-       if (!ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, OSPM_UHB_FORCE_POWER_ON)) {
+       if (!ospm_power_using_hw_begin(OSPM_DISPLAY_ISLAND, true)) {
                DRM_ERROR("hw begin failed\n");
                return;
        }