diff mbox

drm/i915: Call intel_opregion_notify_encoder in intel_sanitize_encoder, v2.

Message ID 20180516085038.36785-1-maarten.lankhorst@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Maarten Lankhorst May 16, 2018, 8:50 a.m. UTC
Normally this is called on a modeset, but the call is missing when
we inherit the mode from the BIOS, so make sure it's called somewhere
in hardware readout.

Changes since v1:
- Unconditionally call intel_opregion_notify_encoder. (Ville)

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Ville Syrjälä May 16, 2018, 2:45 p.m. UTC | #1
On Wed, May 16, 2018 at 10:50:38AM +0200, Maarten Lankhorst wrote:
> Normally this is called on a modeset, but the call is missing when
> we inherit the mode from the BIOS, so make sure it's called somewhere
> in hardware readout.
> 
> Changes since v1:
> - Unconditionally call intel_opregion_notify_encoder. (Ville)
> 
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/intel_display.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 501b83a9a128..e9dc72341e5f 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -15176,6 +15176,9 @@ static void intel_sanitize_encoder(struct intel_encoder *encoder)
>  		connector->base.dpms = DRM_MODE_DPMS_OFF;
>  		connector->base.encoder = NULL;
>  	}
> +
> +	/* notify opregion of the sanitized encoder state */
> +	intel_opregion_notify_encoder(encoder, connector && has_active_crtc);

Seems reasonable. The only minor nit is that we call this before the
encoder hooks in the normal modeset path, here we call it after the
hooks. Not sure it really matters though, so

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

>  }
>  
>  void i915_redisable_vga_power_on(struct drm_i915_private *dev_priv)
> -- 
> 2.17.0
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 501b83a9a128..e9dc72341e5f 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -15176,6 +15176,9 @@  static void intel_sanitize_encoder(struct intel_encoder *encoder)
 		connector->base.dpms = DRM_MODE_DPMS_OFF;
 		connector->base.encoder = NULL;
 	}
+
+	/* notify opregion of the sanitized encoder state */
+	intel_opregion_notify_encoder(encoder, connector && has_active_crtc);
 }
 
 void i915_redisable_vga_power_on(struct drm_i915_private *dev_priv)