Skip to content

Commit

Permalink
drm/i915/dp: split up panel power control from backlight pwm control
Browse files Browse the repository at this point in the history
Make it possible to change panel power control backlight state without
touching the PWM. No functional changes.

Signed-off-by: Jani Nikula <[email protected]>
Reviewed_by: Clinton Taylor <[email protected]>
Tested_by: Clinton Taylor <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
  • Loading branch information
jnikula authored and danvet committed Sep 3, 2014
1 parent 9dd3c60 commit 1250d10
Showing 1 changed file with 26 additions and 13 deletions.
39 changes: 26 additions & 13 deletions drivers/gpu/drm/i915/intel_dp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1384,21 +1384,15 @@ void intel_edp_panel_off(struct intel_dp *intel_dp)
intel_display_power_put(dev_priv, power_domain);
}

void intel_edp_backlight_on(struct intel_dp *intel_dp)
/* Enable backlight in the panel power control. */
static void _intel_edp_backlight_on(struct intel_dp *intel_dp)
{
struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp);
struct drm_device *dev = intel_dig_port->base.base.dev;
struct drm_i915_private *dev_priv = dev->dev_private;
u32 pp;
u32 pp_ctrl_reg;

if (!is_edp(intel_dp))
return;

DRM_DEBUG_KMS("\n");

intel_panel_enable_backlight(intel_dp->attached_connector);

/*
* If we enable the backlight right away following a panel power
* on, we may see slight flicker as the panel syncs with the eDP
Expand All @@ -1415,17 +1409,26 @@ void intel_edp_backlight_on(struct intel_dp *intel_dp)
POSTING_READ(pp_ctrl_reg);
}

void intel_edp_backlight_off(struct intel_dp *intel_dp)
/* Enable backlight PWM and backlight PP control. */
void intel_edp_backlight_on(struct intel_dp *intel_dp)
{
if (!is_edp(intel_dp))
return;

DRM_DEBUG_KMS("\n");

intel_panel_enable_backlight(intel_dp->attached_connector);
_intel_edp_backlight_on(intel_dp);
}

/* Disable backlight in the panel power control. */
static void _intel_edp_backlight_off(struct intel_dp *intel_dp)
{
struct drm_device *dev = intel_dp_to_dev(intel_dp);
struct drm_i915_private *dev_priv = dev->dev_private;
u32 pp;
u32 pp_ctrl_reg;

if (!is_edp(intel_dp))
return;

DRM_DEBUG_KMS("\n");
pp = ironlake_get_pp_control(intel_dp);
pp &= ~EDP_BLC_ENABLE;

Expand All @@ -1436,7 +1439,17 @@ void intel_edp_backlight_off(struct intel_dp *intel_dp)
intel_dp->last_backlight_off = jiffies;

edp_wait_backlight_off(intel_dp);
}

/* Disable backlight PP control and backlight PWM. */
void intel_edp_backlight_off(struct intel_dp *intel_dp)
{
if (!is_edp(intel_dp))
return;

DRM_DEBUG_KMS("\n");

_intel_edp_backlight_off(intel_dp);
intel_panel_disable_backlight(intel_dp->attached_connector);
}

Expand Down

0 comments on commit 1250d10

Please sign in to comment.