drm/gma500/cdv: Add and hook up chip op for disabling sr
authorPatrik Jakobsson <patrik.r.jakobsson@gmail.com>
Wed, 14 Aug 2013 22:54:44 +0000 (00:54 +0200)
committerPatrik Jakobsson <patrik.r.jakobsson@gmail.com>
Wed, 14 Aug 2013 22:54:44 +0000 (00:54 +0200)
Add a callback hook to the chip ops struct to allow chips to have their
specific self-refresh function. Currently only used by cdv.

Signed-off-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
drivers/gpu/drm/gma500/cdv_device.c
drivers/gpu/drm/gma500/cdv_device.h
drivers/gpu/drm/gma500/cdv_intel_display.c
drivers/gpu/drm/gma500/gma_display.c
drivers/gpu/drm/gma500/gma_display.h
drivers/gpu/drm/gma500/psb_drv.h

index 747d903fe49f33f3bb3f5c945bc48b57a4e29dbd..162f686c532db9cfc8dd565b24b6af1d59fa33b6 100644 (file)
@@ -657,4 +657,5 @@ const struct psb_ops cdv_chip_ops = {
        .power_down = cdv_power_down,
        .power_up = cdv_power_up,
        .update_wm = cdv_update_wm,
+       .disable_sr = cdv_disable_sr,
 };
index 9e4805627450202136be76336b62fecd19237f71..705c11d47d456cfd37b2dec4a8ebe6660ad4fa6d 100644 (file)
@@ -27,3 +27,4 @@ extern void cdv_hdmi_init(struct drm_device *dev, struct psb_intel_mode_device *
 extern struct drm_display_mode *cdv_intel_crtc_mode_get(struct drm_device *dev,
                                             struct drm_crtc *crtc);
 extern void cdv_update_wm(struct drm_device *dev, struct drm_crtc *crtc);
+extern void cdv_disable_sr(struct drm_device *dev);
index feacbbaabf14fc399c16a1ec072805e23b2b98cb..8fbfa06da62d867d8b70d944a7e195388ab36848 100644 (file)
@@ -511,7 +511,7 @@ static bool is_pipeb_lvds(struct drm_device *dev, struct drm_crtc *crtc)
        return false;
 }
 
-void cdv_intel_disable_self_refresh(struct drm_device *dev)
+void cdv_disable_sr(struct drm_device *dev)
 {
        if (REG_READ(FW_BLC_SELF) & FW_BLC_SELF_EN) {
 
@@ -534,6 +534,7 @@ void cdv_intel_disable_self_refresh(struct drm_device *dev)
 
 void cdv_update_wm(struct drm_device *dev, struct drm_crtc *crtc)
 {
+       struct drm_psb_private *dev_priv = dev->dev_private;
 
        if (cdv_intel_single_pipe_active(dev)) {
                u32 fw;
@@ -587,8 +588,7 @@ void cdv_update_wm(struct drm_device *dev, struct drm_crtc *crtc)
 
                gma_wait_for_vblank(dev);
 
-               cdv_intel_disable_self_refresh(dev);
-       
+               dev_priv->ops->disable_sr(dev);
        }
 }
 
index fe972c930c2c5cc4c6c11f304435e995eca7c7f9..24e8af3d22bfd34583d8b826b3fd75f7023002c7 100644 (file)
@@ -211,7 +211,7 @@ void gma_crtc_dpms(struct drm_crtc *crtc, int mode)
         */
 
        if (IS_CDV(dev))
-               cdv_intel_disable_self_refresh(dev);
+               dev_priv->ops->disable_sr(dev);
 
        switch (mode) {
        case DRM_MODE_DPMS_ON:
index 9a4e8941bd253ed0c71b4d0f11b559759d31c878..78b9f986a6e5edf7bbc29615bdf0be356961a689 100644 (file)
@@ -100,7 +100,4 @@ extern bool gma_pll_is_valid(struct drm_crtc *crtc,
 extern bool gma_find_best_pll(const struct gma_limit_t *limit,
                              struct drm_crtc *crtc, int target, int refclk,
                              struct gma_clock_t *best_clock);
-
-/* Cedarview specific functions */
-extern void cdv_intel_disable_self_refresh(struct drm_device *dev);
 #endif
index effd69502be539332b79ecb63ecc9c8d0cb30d3d..b7221f3c40b9f3afb502363cfc8de53942c4fbda 100644 (file)
@@ -696,6 +696,7 @@ struct psb_ops {
        int (*power_up)(struct drm_device *dev);
        int (*power_down)(struct drm_device *dev);
        void (*update_wm)(struct drm_device *dev, struct drm_crtc *crtc);
+       void (*disable_sr)(struct drm_device *dev);
 
        void (*lvds_bl_power)(struct drm_device *dev, bool on);
 #ifdef CONFIG_BACKLIGHT_CLASS_DEVICE