Skip to contentSkip to conversation

drm/i915: fix up the edp power well check

PATCH In review Daniel Vetter 4 participants 10 messages May 29, 2013 – May 31, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915: fix up the edp power well check

Now that we track the cpu transcoder we need accurately in the pipe config we can finally fix up the transcoder check. With the current code eDP on port D will be broken since we'd errornously cut the power.

For reference see

commit 2124b72e6283c4e84a55e71077fee91793f4c801

Author: Paulo Zanoni <[email protected]>
Date:   Fri Mar 22 14:07:23 2013 -0300

drm/i915: don't disable the power well yet

Cc Takashi Iwai <[email protected]>
Cc Paulo Zanoni <[email protected]>
---
 drivers/gpu/drm/i915/intel_display.c |    6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/gpu/drm/i915/intel_display.c +1 -5
index 3db4ed2..1ee9e92 100644
@@ -5809,12 +5809,8 @@ static void haswell_modeset_global_resources(struct drm_device *dev)
 		/* Even the eDP panel fitter is outside the always-on well. */
 		if (crtc->config.pch_pfit.size && crtc->base.enabled)
 			enable = true;
-	}
 
-	list_for_each_entry(encoder, &dev->mode_config.encoder_list,
-			    base.head) {
-		if (encoder->type != INTEL_OUTPUT_EDP &&
-		    encoder->connectors_active)
+		if (crtc->config.cpu_transcoder != TRANSCODER_EDP)
 			enable = true;
 	}
 
Signature · 1 line
1.7.10.4
#1 lore raw
Quoted 8 lines · Daniel Vetter

Now that we track the cpu transcoder we need accurately in the pipe config we can finally fix up the transcoder check. With the current code eDP on port D will be broken since we'd errornously cut the power.

For reference see

commit 2124b72e6283c4e84a55e71077fee91793f4c801

Quoted 8 lines
Author: Paulo Zanoni <[email protected]>
Date:   Fri Mar 22 14:07:23 2013 -0300

drm/i915: don't disable the power well yet

Cc Takashi Iwai <[email protected]>
Cc Paulo Zanoni <[email protected]>

Adding imre since he smashed his r-b onto the regressing commit. -Daniel

Quoted 25 lines
---
 drivers/gpu/drm/i915/intel_display.c |    6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/gpu/drm/i915/intel_display.c +1 -5
index 3db4ed2..1ee9e92 100644
@@ -5809,12 +5809,8 @@ static void haswell_modeset_global_resources(struct drm_device *dev)
 		/* Even the eDP panel fitter is outside the always-on well. */
 		if (crtc->config.pch_pfit.size && crtc->base.enabled)
 			enable = true;
-	}
 
-	list_for_each_entry(encoder, &dev->mode_config.encoder_list,
-			    base.head) {
-		if (encoder->type != INTEL_OUTPUT_EDP &&
-		    encoder->connectors_active)
+		if (crtc->config.cpu_transcoder != TRANSCODER_EDP)
 			enable = true;
 	}
 
Signature · 1 line
1.7.10.4
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#2 lore raw
Quoted 12 lines · Daniel Vetter
Quoted 11 lines · Daniel Vetter

Now that we track the cpu transcoder we need accurately in the pipe config we can finally fix up the transcoder check. With the current code eDP on port D will be broken since we'd errornously cut the power.

For reference see

commit 2124b72e6283c4e84a55e71077fee91793f4c801

Author: Paulo Zanoni <[email protected]>
Date:   Fri Mar 22 14:07:23 2013 -0300
Quoted 7 lines
Quoted 5 lines

drm/i915: don't disable the power well yet

Cc Takashi Iwai <[email protected]>
Cc Paulo Zanoni <[email protected]>

Adding imre since he smashed his r-b onto the regressing commit.

Meh, replied to the wrong patch, never mind.
-Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#3 lore raw
In reply to Daniel Vetter

At Wed, 29 May 2013 19:56:11 +0200,

Quoted 8 lines · Daniel Vetter

Now that we track the cpu transcoder we need accurately in the pipe config we can finally fix up the transcoder check. With the current code eDP on port D will be broken since we'd errornously cut the power.

For reference see

Quoted 7 lines

commit 2124b72e6283c4e84a55e71077fee91793f4c801

Author: Paulo Zanoni <[email protected]>
Date:   Fri Mar 22 14:07:23 2013 -0300

drm/i915: don't disable the power well yet

Cc Takashi Iwai <[email protected]>

Sorry, I have no hardware that showed the problem around here for testing now, unfortunately.

Takashi

Quoted 27 lines
---
 drivers/gpu/drm/i915/intel_display.c |    6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/gpu/drm/i915/intel_display.c +1 -5
index 3db4ed2..1ee9e92 100644
@@ -5809,12 +5809,8 @@ static void haswell_modeset_global_resources(struct drm_device *dev)
 		/* Even the eDP panel fitter is outside the always-on well. */
 		if (crtc->config.pch_pfit.size && crtc->base.enabled)
 			enable = true;
-	}
 
-	list_for_each_entry(encoder, &dev->mode_config.encoder_list,
-			    base.head) {
-		if (encoder->type != INTEL_OUTPUT_EDP &&
-		    encoder->connectors_active)
+		if (crtc->config.cpu_transcoder != TRANSCODER_EDP)
 			enable = true;
 	}
 
Signature · 1 line
1.7.10.4
#4 lore raw
Quoted 14 lines · Takashi Iwai

At Wed, 29 May 2013 19:56:11 +0200,

Quoted 12 lines · Daniel Vetter

Now that we track the cpu transcoder we need accurately in the pipe config we can finally fix up the transcoder check. With the current code eDP on port D will be broken since we'd errornously cut the power.

For reference see

commit 2124b72e6283c4e84a55e71077fee91793f4c801

Author: Paulo Zanoni <[email protected]>
Date:   Fri Mar 22 14:07:23 2013 -0300
Quoted 6 lines
Quoted 3 lines

drm/i915: don't disable the power well yet

Cc Takashi Iwai <[email protected]>

Sorry, I have no hardware that showed the problem around here for testing now, unfortunately.

Np, that was just an fyi cc ;-)
-Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
#5 lore raw
In reply to Daniel Vetter

2013/5/29 Daniel Vetter <[email protected]>:

Quoted 25 lines

Now that we track the cpu transcoder we need accurately in the pipe config we can finally fix up the transcoder check. With the current code eDP on port D will be broken since we'd errornously cut the power.

For reference see

commit 2124b72e6283c4e84a55e71077fee91793f4c801

Author: Paulo Zanoni <[email protected]>
Date:   Fri Mar 22 14:07:23 2013 -0300

drm/i915: don't disable the power well yet

Cc Takashi Iwai <[email protected]>
Cc Paulo Zanoni <[email protected]>
---
 drivers/gpu/drm/i915/intel_display.c |    6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/gpu/drm/i915/intel_display.c +0 -0
index 3db4ed2..1ee9e92 100644

drivers/gpu/drm/i915/intel_display.c static void haswell_modeset_global_resources(struct drm_device *dev) · line 5813

Quoted 10 lines
drivers/gpu/drm/i915/intel_display.c +1 -5
@@ -5809,12 +5809,8 @@ static void haswell_modeset_global_resources(struct drm_device *dev)
                /* Even the eDP panel fitter is outside the always-on well. */
                if (crtc->config.pch_pfit.size && crtc->base.enabled)
                        enable = true;
-       }
 
-       list_for_each_entry(encoder, &dev->mode_config.encoder_list,
-                           base.head) {
-               if (encoder->type != INTEL_OUTPUT_EDP &&
-                   encoder->connectors_active)
+               if (crtc->config.cpu_transcoder != TRANSCODER_EDP)

Don't you also need to check for crtc->base.enabled here? If you do this, please notice that all 3 checks inside the loop will have a check for crtc->base.enabled inside, so you might want to move that to a "if (!crtc->base.enabled) continue;" or something similar.

Please also update/remove the comment that has an "XXX" tag.

Quoted 10 lines
drivers/gpu/drm/i915/intel_display.c +0 -1
                        enable = true;
        }
 
--

1.7.10.4

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Signature · 1 line
Paulo Zanoni
#6 lore raw

PATCH 1/1 drm/i915: fix up the edp power well check

Now that we track the cpu transcoder we need accurately in the pipe config we can finally fix up the transcoder check. With the current code eDP on port D will be broken since we'd errornously cut the power.

For reference see

commit 2124b72e6283c4e84a55e71077fee91793f4c801

Author: Paulo Zanoni <[email protected]>
Date:   Fri Mar 22 14:07:23 2013 -0300

drm/i915: don't disable the power well yet

v2:
- Kill the now outdated comment (Paulo)
- Add the missing crtc->base.enabled check and consolidate it (Paulo)
- Smash all checks together, looks neater that way.

Cc Takashi Iwai <[email protected]>
Cc Paulo Zanoni <[email protected]>
---
 drivers/gpu/drm/i915/intel_display.c |   17 ++++-------------
 1 file changed, 4 insertions(+), 13 deletions(-)
drivers/gpu/drm/i915/intel_display.c +4 -13
index 3db4ed2..7cc953d 100644
@@ -5801,20 +5801,11 @@ static void haswell_modeset_global_resources(struct drm_device *dev)
 	struct intel_encoder *encoder;
 
 	list_for_each_entry(crtc, &dev->mode_config.crtc_list, base.head) {
-		if (crtc->pipe != PIPE_A && crtc->base.enabled)
-			enable = true;
-		/* XXX: Should check for edp transcoder here, but thanks to init
-		 * sequence that's not yet available. Just in case desktop eDP
-		 * on PORT D is possible on haswell, too. */
-		/* Even the eDP panel fitter is outside the always-on well. */
-		if (crtc->config.pch_pfit.size && crtc->base.enabled)
-			enable = true;
-	}
+		if (!crtc->base.enabled)
+			continue;
 
-	list_for_each_entry(encoder, &dev->mode_config.encoder_list,
-			    base.head) {
-		if (encoder->type != INTEL_OUTPUT_EDP &&
-		    encoder->connectors_active)
+		if (crtc->pipe != PIPE_A || crtc->config.pch_pfit.size ||
+		    crtc->config.cpu_transcoder != TRANSCODER_EDP)
 			enable = true;
 	}
 
Signature · 1 line
1.7.10.4
#7 lore raw

PATCH 1/1 drm/i915: fix up the edp power well check

In reply to Paulo Zanoni

Now that we track the cpu transcoder we need accurately in the pipe config we can finally fix up the transcoder check. With the current code eDP on port D will be broken since we'd errornously cut the power.

For reference see

commit 2124b72e6283c4e84a55e71077fee91793f4c801

Author: Paulo Zanoni <[email protected]>
Date:   Fri Mar 22 14:07:23 2013 -0300

drm/i915: don't disable the power well yet

v2:
- Kill the now outdated comment (Paulo)
- Add the missing crtc->base.enabled check and consolidate it (Paulo)
- Smash all checks together, looks neater that way.

v3: Kill the unused encoder variable.

Cc Takashi Iwai <[email protected]>
Cc Paulo Zanoni <[email protected]>
---
 drivers/gpu/drm/i915/intel_display.c |   18 ++++--------------
 1 file changed, 4 insertions(+), 14 deletions(-)
drivers/gpu/drm/i915/intel_display.c +4 -14
index 3db4ed2..c4adbfe 100644
@@ -5798,23 +5798,13 @@ static void haswell_modeset_global_resources(struct drm_device *dev)
 {
 	bool enable = false;
 	struct intel_crtc *crtc;
-	struct intel_encoder *encoder;
 
 	list_for_each_entry(crtc, &dev->mode_config.crtc_list, base.head) {
-		if (crtc->pipe != PIPE_A && crtc->base.enabled)
-			enable = true;
-		/* XXX: Should check for edp transcoder here, but thanks to init
-		 * sequence that's not yet available. Just in case desktop eDP
-		 * on PORT D is possible on haswell, too. */
-		/* Even the eDP panel fitter is outside the always-on well. */
-		if (crtc->config.pch_pfit.size && crtc->base.enabled)
-			enable = true;
-	}
+		if (!crtc->base.enabled)
+			continue;
 
-	list_for_each_entry(encoder, &dev->mode_config.encoder_list,
-			    base.head) {
-		if (encoder->type != INTEL_OUTPUT_EDP &&
-		    encoder->connectors_active)
+		if (crtc->pipe != PIPE_A || crtc->config.pch_pfit.size ||
+		    crtc->config.cpu_transcoder != TRANSCODER_EDP)
 			enable = true;
 	}
 
Signature · 1 line
1.7.10.4
Reviewed-by on v1 1/1
#8 lore raw

2013/5/31 Daniel Vetter <[email protected]>:

Quoted 18 lines

Now that we track the cpu transcoder we need accurately in the pipe config we can finally fix up the transcoder check. With the current code eDP on port D will be broken since we'd errornously cut the power.

For reference see

commit 2124b72e6283c4e84a55e71077fee91793f4c801

Author: Paulo Zanoni <[email protected]>
Date:   Fri Mar 22 14:07:23 2013 -0300

drm/i915: don't disable the power well yet

v2:
- Kill the now outdated comment (Paulo)
- Add the missing crtc->base.enabled check and consolidate it (Paulo)
- Smash all checks together, looks neater that way.

Quoted 5 lines

v3: Kill the unused encoder variable.

Cc Takashi Iwai <[email protected]>
Cc Paulo Zanoni <[email protected]>
Quoted 43 lines
---
 drivers/gpu/drm/i915/intel_display.c |   18 ++++--------------
 1 file changed, 4 insertions(+), 14 deletions(-)
drivers/gpu/drm/i915/intel_display.c +4 -15
index 3db4ed2..c4adbfe 100644
@@ -5798,23 +5798,13 @@ static void haswell_modeset_global_resources(struct drm_device *dev)
 {
        bool enable = false;
        struct intel_crtc *crtc;
-       struct intel_encoder *encoder;
 
        list_for_each_entry(crtc, &dev->mode_config.crtc_list, base.head) {
-               if (crtc->pipe != PIPE_A && crtc->base.enabled)
-                       enable = true;
-               /* XXX: Should check for edp transcoder here, but thanks to init
-                * sequence that's not yet available. Just in case desktop eDP
-                * on PORT D is possible on haswell, too. */
-               /* Even the eDP panel fitter is outside the always-on well. */
-               if (crtc->config.pch_pfit.size && crtc->base.enabled)
-                       enable = true;
-       }
+               if (!crtc->base.enabled)
+                       continue;
 
-       list_for_each_entry(encoder, &dev->mode_config.encoder_list,
-                           base.head) {
-               if (encoder->type != INTEL_OUTPUT_EDP &&
-                   encoder->connectors_active)
+               if (crtc->pipe != PIPE_A || crtc->config.pch_pfit.size ||
+                   crtc->config.cpu_transcoder != TRANSCODER_EDP)
                        enable = true;
        }
 
--

1.7.10.4

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Signature · 1 line
Paulo Zanoni
#9 lore raw
Quoted 19 lines · Paulo Zanoni

2013/5/31 Daniel Vetter <[email protected]>:

Quoted 18 lines

Now that we track the cpu transcoder we need accurately in the pipe config we can finally fix up the transcoder check. With the current code eDP on port D will be broken since we'd errornously cut the power.

For reference see

commit 2124b72e6283c4e84a55e71077fee91793f4c801

Author: Paulo Zanoni <[email protected]>
Date:   Fri Mar 22 14:07:23 2013 -0300

drm/i915: don't disable the power well yet

v2:
- Kill the now outdated comment (Paulo)
- Add the missing crtc->base.enabled check and consolidate it (Paulo)
- Smash all checks together, looks neater that way.

Quoted 7 lines
Quoted 5 lines

v3: Kill the unused encoder variable.

Cc Takashi Iwai <[email protected]>
Cc Paulo Zanoni <[email protected]>

Queued for -next, thanks for the review.
-Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch