diff mbox

[16/18] drm/i915: set/unset the DDI eDP backlight

Message ID 1351024208-3489-17-git-send-email-przanoni@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Paulo Zanoni Oct. 23, 2012, 8:30 p.m. UTC
From: Paulo Zanoni <paulo.r.zanoni@intel.com>

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
---
 drivers/gpu/drm/i915/intel_ddi.c | 15 +++++++++++++--
 drivers/gpu/drm/i915/intel_dp.c  |  4 ++--
 drivers/gpu/drm/i915/intel_drv.h |  6 ++++--
 3 files changed, 19 insertions(+), 6 deletions(-)

Comments

Rodrigo Vivi Oct. 24, 2012, 2:11 p.m. UTC | #1
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>

On Tue, Oct 23, 2012 at 6:30 PM, Paulo Zanoni <przanoni@gmail.com> wrote:
> From: Paulo Zanoni <paulo.r.zanoni@intel.com>
>
> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_ddi.c | 15 +++++++++++++--
>  drivers/gpu/drm/i915/intel_dp.c  |  4 ++--
>  drivers/gpu/drm/i915/intel_drv.h |  6 ++++--
>  3 files changed, 19 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
> index 30b0db7..232f2d0 100644
> --- a/drivers/gpu/drm/i915/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/intel_ddi.c
> @@ -1231,12 +1231,23 @@ void intel_enable_ddi(struct intel_encoder *intel_encoder)
>                  * enabling the port.
>                  */
>                 I915_WRITE(DDI_BUF_CTL(port), DDI_BUF_CTL_ENABLE);
> +       } else if (type == INTEL_OUTPUT_EDP) {
> +               struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
> +
> +               ironlake_edp_backlight_on(intel_dp);
>         }
>  }
>
> -void intel_disable_ddi(struct intel_encoder *encoder)
> +void intel_disable_ddi(struct intel_encoder *intel_encoder)
>  {
> -       /* This will be needed in the future, so leave it here for now */
> +       struct drm_encoder *encoder = &intel_encoder->base;
> +       int type = intel_encoder->type;
> +
> +       if (type == INTEL_OUTPUT_EDP) {
> +               struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
> +
> +               ironlake_edp_backlight_off(intel_dp);
> +       }
>  }
>
>  int intel_ddi_get_cdclk_freq(struct drm_i915_private *dev_priv)
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index 6d30b2d..d926f99 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -1166,7 +1166,7 @@ static void ironlake_edp_panel_off(struct intel_dp *intel_dp)
>         ironlake_wait_panel_off(intel_dp);
>  }
>
> -static void ironlake_edp_backlight_on(struct intel_dp *intel_dp)
> +void ironlake_edp_backlight_on(struct intel_dp *intel_dp)
>  {
>         struct drm_device *dev = intel_dp->base.base.dev;
>         struct drm_i915_private *dev_priv = dev->dev_private;
> @@ -1192,7 +1192,7 @@ static void ironlake_edp_backlight_on(struct intel_dp *intel_dp)
>         intel_panel_enable_backlight(dev, pipe);
>  }
>
> -static void ironlake_edp_backlight_off(struct intel_dp *intel_dp)
> +void ironlake_edp_backlight_off(struct intel_dp *intel_dp)
>  {
>         struct drm_device *dev = intel_dp->base.base.dev;
>         struct drm_i915_private *dev_priv = dev->dev_private;
> diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> index c05e892..47d62fb 100644
> --- a/drivers/gpu/drm/i915/intel_drv.h
> +++ b/drivers/gpu/drm/i915/intel_drv.h
> @@ -439,6 +439,8 @@ extern void intel_dp_start_link_train(struct intel_dp *intel_dp);
>  extern void intel_dp_complete_link_train(struct intel_dp *intel_dp);
>  extern void intel_dp_sink_dpms(struct intel_dp *intel_dp, int mode);
>  extern bool intel_dpd_is_edp(struct drm_device *dev);
> +extern void ironlake_edp_backlight_on(struct intel_dp *intel_dp);
> +extern void ironlake_edp_backlight_off(struct intel_dp *intel_dp);
>  extern void intel_edp_link_config(struct intel_encoder *, int *, int *);
>  extern int intel_edp_target_clock(struct intel_encoder *,
>                                   struct drm_display_mode *mode);
> @@ -602,8 +604,8 @@ extern void intel_disable_gt_powersave(struct drm_device *dev);
>  extern void gen6_gt_check_fifodbg(struct drm_i915_private *dev_priv);
>  extern void ironlake_teardown_rc6(struct drm_device *dev);
>
> -extern void intel_enable_ddi(struct intel_encoder *encoder);
> -extern void intel_disable_ddi(struct intel_encoder *encoder);
> +extern void intel_enable_ddi(struct intel_encoder *intel_encoder);
> +extern void intel_disable_ddi(struct intel_encoder *intel_encoder);
>  extern bool intel_ddi_get_hw_state(struct intel_encoder *encoder,
>                                    enum pipe *pipe);
>  extern void intel_ddi_mode_set(struct drm_encoder *encoder,
> --
> 1.7.11.4
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Daniel Vetter Oct. 24, 2012, 2:22 p.m. UTC | #2
On Tue, Oct 23, 2012 at 10:30 PM, Paulo Zanoni <przanoni@gmail.com> wrote:
> From: Paulo Zanoni <paulo.r.zanoni@intel.com>
>
> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>

I think in this commit message we should mention that we've just
recently added the same to all the other eDP variations. I'll add the
right commit citation when applying.
-Daniel
Paulo Zanoni Oct. 24, 2012, 2:43 p.m. UTC | #3
Hi

2012/10/24 Daniel Vetter <daniel@ffwll.ch>:
> On Tue, Oct 23, 2012 at 10:30 PM, Paulo Zanoni <przanoni@gmail.com> wrote:
>> From: Paulo Zanoni <paulo.r.zanoni@intel.com>
>>
>> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
>
> I think in this commit message we should mention that we've just
> recently added the same to all the other eDP variations. I'll add the
> right commit citation when applying.

This commit is orthogonal to the ones you sent recently. Here I'm just
calling ironlake_edp_backlight_{on,off}. On your recent backlight
commit you just changed the functions I call (ironlake_edp_panel_off
and ironlake_edp_backlight_on).

> -Daniel
> --
> Daniel Vetter
> Software Engineer, Intel Corporation
> +41 (0) 79 365 57 48 - http://blog.ffwll.ch
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
index 30b0db7..232f2d0 100644
--- a/drivers/gpu/drm/i915/intel_ddi.c
+++ b/drivers/gpu/drm/i915/intel_ddi.c
@@ -1231,12 +1231,23 @@  void intel_enable_ddi(struct intel_encoder *intel_encoder)
 		 * enabling the port.
 		 */
 		I915_WRITE(DDI_BUF_CTL(port), DDI_BUF_CTL_ENABLE);
+	} else if (type == INTEL_OUTPUT_EDP) {
+		struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
+
+		ironlake_edp_backlight_on(intel_dp);
 	}
 }
 
-void intel_disable_ddi(struct intel_encoder *encoder)
+void intel_disable_ddi(struct intel_encoder *intel_encoder)
 {
-	/* This will be needed in the future, so leave it here for now */
+	struct drm_encoder *encoder = &intel_encoder->base;
+	int type = intel_encoder->type;
+
+	if (type == INTEL_OUTPUT_EDP) {
+		struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
+
+		ironlake_edp_backlight_off(intel_dp);
+	}
 }
 
 int intel_ddi_get_cdclk_freq(struct drm_i915_private *dev_priv)
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 6d30b2d..d926f99 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -1166,7 +1166,7 @@  static void ironlake_edp_panel_off(struct intel_dp *intel_dp)
 	ironlake_wait_panel_off(intel_dp);
 }
 
-static void ironlake_edp_backlight_on(struct intel_dp *intel_dp)
+void ironlake_edp_backlight_on(struct intel_dp *intel_dp)
 {
 	struct drm_device *dev = intel_dp->base.base.dev;
 	struct drm_i915_private *dev_priv = dev->dev_private;
@@ -1192,7 +1192,7 @@  static void ironlake_edp_backlight_on(struct intel_dp *intel_dp)
 	intel_panel_enable_backlight(dev, pipe);
 }
 
-static void ironlake_edp_backlight_off(struct intel_dp *intel_dp)
+void ironlake_edp_backlight_off(struct intel_dp *intel_dp)
 {
 	struct drm_device *dev = intel_dp->base.base.dev;
 	struct drm_i915_private *dev_priv = dev->dev_private;
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index c05e892..47d62fb 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -439,6 +439,8 @@  extern void intel_dp_start_link_train(struct intel_dp *intel_dp);
 extern void intel_dp_complete_link_train(struct intel_dp *intel_dp);
 extern void intel_dp_sink_dpms(struct intel_dp *intel_dp, int mode);
 extern bool intel_dpd_is_edp(struct drm_device *dev);
+extern void ironlake_edp_backlight_on(struct intel_dp *intel_dp);
+extern void ironlake_edp_backlight_off(struct intel_dp *intel_dp);
 extern void intel_edp_link_config(struct intel_encoder *, int *, int *);
 extern int intel_edp_target_clock(struct intel_encoder *,
 				  struct drm_display_mode *mode);
@@ -602,8 +604,8 @@  extern void intel_disable_gt_powersave(struct drm_device *dev);
 extern void gen6_gt_check_fifodbg(struct drm_i915_private *dev_priv);
 extern void ironlake_teardown_rc6(struct drm_device *dev);
 
-extern void intel_enable_ddi(struct intel_encoder *encoder);
-extern void intel_disable_ddi(struct intel_encoder *encoder);
+extern void intel_enable_ddi(struct intel_encoder *intel_encoder);
+extern void intel_disable_ddi(struct intel_encoder *intel_encoder);
 extern bool intel_ddi_get_hw_state(struct intel_encoder *encoder,
 				   enum pipe *pipe);
 extern void intel_ddi_mode_set(struct drm_encoder *encoder,