[v3.1,1/3] drm/i915: Fix broken mst get_hw_state.
diff mbox

Message ID 1438861657-14109-1-git-send-email-maarten.lankhorst@linux.intel.com
State New
Headers show

Commit Message

Maarten Lankhorst Aug. 6, 2015, 11:47 a.m. UTC
This function always returned false because intel_connector->encoder
is always NULL. Instead use the attached encoder from atomic.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_dp_mst.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Comments

Daniel Vetter Aug. 6, 2015, 12:59 p.m. UTC | #1
On Thu, Aug 06, 2015 at 01:47:35PM +0200, Maarten Lankhorst wrote:
> This function always returned false because intel_connector->encoder
> is always NULL. Instead use the attached encoder from atomic.

Note that you've broken this since you removed the updating of
intel_connector->encoder somewhere in the 4.3 atomic series. So this is a
regression fix. Can you please digg out the right commit?

> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/intel_dp_mst.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c b/drivers/gpu/drm/i915/intel_dp_mst.c
> index e3a5864160fa..ff01569158ea 100644
> --- a/drivers/gpu/drm/i915/intel_dp_mst.c
> +++ b/drivers/gpu/drm/i915/intel_dp_mst.c
> @@ -395,9 +395,12 @@ static const struct drm_encoder_funcs intel_dp_mst_enc_funcs = {
>  
>  static bool intel_dp_mst_get_hw_state(struct intel_connector *connector)
>  {
> -	if (connector->encoder) {
> +	struct intel_encoder *encoder;
> +
> +	encoder = to_intel_encoder(connector->base.state->best_encoder);

Strictly speaking this won't work for hw state readout since what we
really need to do is ask the mst connector which mst stream it accepts and
then compare that with all the mst encoders ...

But that's been broken since forever. Only side-effect here is that
fastboot won't work with mst and that's imo totally ok. Please also add
this to your commit message.
-Daniel
> +	if (encoder) {
>  		enum pipe pipe;
> -		if (!connector->encoder->get_hw_state(connector->encoder, &pipe))
> +		if (!encoder->get_hw_state(encoder, &pipe))
>  			return false;
>  		return true;
>  	}
> -- 
> 2.1.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Patch
diff mbox

diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c b/drivers/gpu/drm/i915/intel_dp_mst.c
index e3a5864160fa..ff01569158ea 100644
--- a/drivers/gpu/drm/i915/intel_dp_mst.c
+++ b/drivers/gpu/drm/i915/intel_dp_mst.c
@@ -395,9 +395,12 @@  static const struct drm_encoder_funcs intel_dp_mst_enc_funcs = {
 
 static bool intel_dp_mst_get_hw_state(struct intel_connector *connector)
 {
-	if (connector->encoder) {
+	struct intel_encoder *encoder;
+
+	encoder = to_intel_encoder(connector->base.state->best_encoder);
+	if (encoder) {
 		enum pipe pipe;
-		if (!connector->encoder->get_hw_state(connector->encoder, &pipe))
+		if (!encoder->get_hw_state(encoder, &pipe))
 			return false;
 		return true;
 	}