Skip to contentSkip to conversation

drm/i915/skl: Assume no scaling is available when things are not as expected

PATCH Superseded Tvrtko Ursulin 5 participants 7 messages Jun 1, 2015 – Jun 17, 2015

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915/skl: Assume no scaling is available when things are not as expected

From: Tvrtko Ursulin <[email protected]>

Cdclk < crtc_clock is not allowed and suggests a different problem elsewhere.

It is more robust and safe to assume no scaling is possible in this case.

---
 drivers/gpu/drm/i915/intel_display.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_display.c +1 -1
index 93a5e51..4c99373 100644
@@ -13234,7 +13234,7 @@ skl_max_scale(struct intel_crtc *intel_crtc, struct intel_crtc_state *crtc_state
 	crtc_clock = crtc_state->base.adjusted_mode.crtc_clock;
 	cdclk = dev_priv->display.get_display_clock_speed(dev);
 
-	if (!crtc_clock || !cdclk)
+	if (!crtc_clock || !cdclk || (cdclk < crtc_clock))
 		return DRM_PLANE_HELPER_NO_SCALING;
 
 	/*
Signature · 6 lines
2.4.0

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Tested-by on v1 1/1
#1 lore raw

Task id: 6513 -------------------------------------Summary-------------------------------------
Platform Delta drm-intel-nightly Series Applied

PNV                                  276/276              276/276
ILK                                  303/303              303/303
SNB                 -1              315/315              314/315
IVB                                  343/343              343/343
BYT                                  287/287              287/287
BDW                                  321/321              321/321

-------------------------------------Detailed-------------------------------------
Platform Test drm-intel-nightly Series Applied
*SNB igt@pm_rpm@dpms-mode-unset-non-lpsp PASS(1) DMESG_WARN(1)
(dmesg patch applied)WARNING:at_drivers/gpu/drm/i915/intel_uncore.c:#assert_device_not_suspended[i915]()@WARNING:.* at .* assert_device_not_suspended+0x
Note: You need to pay more attention to line start with '*'
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

#2 lore raw
In reply to Tvrtko Ursulin
Quoted 17 lines · Tvrtko Ursulin

From: Tvrtko Ursulin <[email protected]>

Cdclk < crtc_clock is not allowed and suggests a different problem elsewhere.

It is more robust and safe to assume no scaling is possible in this case.

---
 drivers/gpu/drm/i915/intel_display.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_display.c +0 -0
index 93a5e51..4c99373 100644

drivers/gpu/drm/i915/intel_display.c skl_max_scale(struct intel_crtc *intel_crtc, struct intel_crtc_state *crtc_state · line 13235

Quoted 2 lines
drivers/gpu/drm/i915/intel_display.c +0 -0
@@ -13234,7 +13234,7 @@ skl_max_scale(struct intel_crtc *intel_crtc, struct intel_crtc_state *crtc_state
 	crtc_clock = crtc_state->base.adjusted_mode.crtc_clock;
 	cdclk = dev_priv->display.get_display_clock_speed(dev);

Probably fallout from the in-flight dynamic cdclk stuff - this code checks the wrong bits I guess. Chandra?

Thanks, Daniel

Quoted 13 lines
drivers/gpu/drm/i915/intel_display.c +1 -1
-	if (!crtc_clock || !cdclk)
+	if (!crtc_clock || !cdclk || (cdclk < crtc_clock))
 		return DRM_PLANE_HELPER_NO_SCALING;
 
 	/*
Signature · 6 lines
2.4.0

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#3 lore raw
Quoted 18 lines
Quoted 5 lines

Cdclk < crtc_clock is not allowed and suggests a different problem elsewhere.

It is more robust and safe to assume no scaling is possible in this case.

Review

Quoted 7 lines
---
 drivers/gpu/drm/i915/intel_display.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
(quoted diff) +0 -0

b/drivers/gpu/drm/i915/intel_display.c

drivers/gpu/drm/i915/intel_display.c skl_max_scale(struct intel_crtc *intel_crtc, struct

Quoted 4 lines

index 93a5e51..4c99373 100644

drivers/gpu/drm/i915/intel_display.c +0 -0
@@ -13234,7 +13234,7 @@ skl_max_scale(struct intel_crtc *intel_crtc, struct

intel_crtc_state *crtc_state

Quoted 5 lines

drivers/gpu/drm/i915/intel_display.c skl_max_scale(struct intel_crtc *intel_crtc, struct intel_crtc_state *crtc_state · line 13235

Quoted 2 lines
drivers/gpu/drm/i915/intel_display.c +0 -0
 	crtc_clock = crtc_state->base.adjusted_mode.crtc_clock;
 	cdclk = dev_priv->display.get_display_clock_speed(dev);

Probably fallout from the in-flight dynamic cdclk stuff - this code checks the wrong bits I guess. Chandra?

Looks like something elsewhere has fallen out and issue manifested here.

Damien reported another issue where get_display_clock_speed causing an assert because it is called when dev_priv->pm.suspend is true during runtime resume. But later was resolved after one of atomic patch is reverted.

While Maarten is addressing recently reported atomic issues, for time being some atomic crtc patches were reverted.

I am not 100% sure whether issue here is due to same root cause or due to something different.

Quoted 12 lines

Thanks, Daniel

Quoted 9 lines
drivers/gpu/drm/i915/intel_display.c +1 -2
-	if (!crtc_clock || !cdclk)
+	if (!crtc_clock || !cdclk || (cdclk < crtc_clock))
 		return DRM_PLANE_HELPER_NO_SCALING;
 
 	/*
--

2.4.0

Quoted 9 lines
Quoted 4 lines

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

--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

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

#4 lore raw
Quoted 31 lines · Chandra
Quoted 18 lines
Quoted 5 lines

Cdclk < crtc_clock is not allowed and suggests a different problem elsewhere.

It is more robust and safe to assume no scaling is possible in this case.

Review

Quoted 7 lines
---
 drivers/gpu/drm/i915/intel_display.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
(quoted diff) +0 -0

b/drivers/gpu/drm/i915/intel_display.c

drivers/gpu/drm/i915/intel_display.c skl_max_scale(struct intel_crtc *intel_crtc, struct

Quoted 4 lines

index 93a5e51..4c99373 100644

drivers/gpu/drm/i915/intel_display.c +0 -0
@@ -13234,7 +13234,7 @@ skl_max_scale(struct intel_crtc *intel_crtc, struct

intel_crtc_state *crtc_state

Quoted 5 lines

drivers/gpu/drm/i915/intel_display.c skl_max_scale(struct intel_crtc *intel_crtc, struct intel_crtc_state *crtc_state · line 13235

Quoted 2 lines
drivers/gpu/drm/i915/intel_display.c +0 -0
 	crtc_clock = crtc_state->base.adjusted_mode.crtc_clock;
 	cdclk = dev_priv->display.get_display_clock_speed(dev);

Probably fallout from the in-flight dynamic cdclk stuff - this code checks the wrong bits I guess. Chandra?

Looks like something elsewhere has fallen out and issue manifested here.

Damien reported another issue where get_display_clock_speed causing an assert because it is called when dev_priv->pm.suspend is true during runtime resume. But later was resolved after one of atomic patch is reverted.

Quoted 5 lines

While Maarten is addressing recently reported atomic issues, for time being some atomic crtc patches were reverted.

I am not 100% sure whether issue here is due to same root cause or due to something different.

You need to check the cached (and soon the one in the global atomic modeset state structure) cdclk value, not the current one in the hw. And yeah that can result in asserts since the hw might not be one yet when this code is run. I.e. this isn't about atomic modeset but just about interaction with the recent cdclk work. And with the existing rpm feature.

In the future we should even upclock the cdclck stuff (once dynamic cdclk is implemented on skl) to make sure it fits the desired scaler configuration. But that's follow-up work.
-Daniel

Quoted 22 lines
Quoted 22 lines

Thanks, Daniel

Quoted 9 lines
drivers/gpu/drm/i915/intel_display.c +1 -2
-	if (!crtc_clock || !cdclk)
+	if (!crtc_clock || !cdclk || (cdclk < crtc_clock))
 		return DRM_PLANE_HELPER_NO_SCALING;
 
 	/*
--

2.4.0

Quoted 4 lines

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

--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#5 lore raw
Quoted 44 lines · Daniel Vetter
Quoted 31 lines · Chandra
Quoted 18 lines
Quoted 5 lines

Cdclk < crtc_clock is not allowed and suggests a different problem elsewhere.

It is more robust and safe to assume no scaling is possible in this case.

Review

Quoted 7 lines
---
 drivers/gpu/drm/i915/intel_display.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
(quoted diff) +0 -0

b/drivers/gpu/drm/i915/intel_display.c

drivers/gpu/drm/i915/intel_display.c skl_max_scale(struct intel_crtc *intel_crtc, struct

Quoted 4 lines

index 93a5e51..4c99373 100644

drivers/gpu/drm/i915/intel_display.c +0 -0
@@ -13234,7 +13234,7 @@ skl_max_scale(struct intel_crtc *intel_crtc, struct

intel_crtc_state *crtc_state

Quoted 5 lines

drivers/gpu/drm/i915/intel_display.c skl_max_scale(struct intel_crtc *intel_crtc, struct intel_crtc_state *crtc_state · line 13235

Quoted 2 lines
drivers/gpu/drm/i915/intel_display.c +0 -0
 	crtc_clock = crtc_state->base.adjusted_mode.crtc_clock;
 	cdclk = dev_priv->display.get_display_clock_speed(dev);

Probably fallout from the in-flight dynamic cdclk stuff - this code checks the wrong bits I guess. Chandra?

Looks like something elsewhere has fallen out and issue manifested here.

Damien reported another issue where get_display_clock_speed causing an assert because it is called when dev_priv->pm.suspend is true during runtime resume. But later was resolved after one of atomic patch is reverted.

Quoted 5 lines

While Maarten is addressing recently reported atomic issues, for time being some atomic crtc patches were reverted.

I am not 100% sure whether issue here is due to same root cause or due to something different.

You need to check the cached (and soon the one in the global atomic modeset state structure) cdclk value, not the current one in the hw. And yeah that can result in asserts since the hw might not be one yet when this code is run. I.e. this isn't about atomic modeset but just about interaction with the recent cdclk work. And with the existing rpm feature.

Quoted 3 lines

In the future we should even upclock the cdclck stuff (once dynamic cdclk is implemented on skl) to make sure it fits the desired scaler configuration. But that's follow-up work.

For something like that we probably need some kind of new property to request extra cdclk headroom when doing a modeset. Otherwise we're going to end up blinking the displays all the time.

Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#6 lore raw
Quoted 45 lines · Ville Syrjälä
Quoted 44 lines · Daniel Vetter
Quoted 31 lines · Chandra
Quoted 18 lines
Quoted 5 lines

Cdclk < crtc_clock is not allowed and suggests a different problem elsewhere.

It is more robust and safe to assume no scaling is possible in this case.

Review

Quoted 7 lines
---
 drivers/gpu/drm/i915/intel_display.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
(quoted diff) +0 -0

b/drivers/gpu/drm/i915/intel_display.c

drivers/gpu/drm/i915/intel_display.c skl_max_scale(struct intel_crtc *intel_crtc, struct

Quoted 4 lines

index 93a5e51..4c99373 100644

drivers/gpu/drm/i915/intel_display.c +0 -0
@@ -13234,7 +13234,7 @@ skl_max_scale(struct intel_crtc *intel_crtc, struct

intel_crtc_state *crtc_state

Quoted 5 lines

drivers/gpu/drm/i915/intel_display.c skl_max_scale(struct intel_crtc *intel_crtc, struct intel_crtc_state *crtc_state · line 13235

Quoted 2 lines
drivers/gpu/drm/i915/intel_display.c +0 -0
 	crtc_clock = crtc_state->base.adjusted_mode.crtc_clock;
 	cdclk = dev_priv->display.get_display_clock_speed(dev);

Probably fallout from the in-flight dynamic cdclk stuff - this code checks the wrong bits I guess. Chandra?

Looks like something elsewhere has fallen out and issue manifested here.

Damien reported another issue where get_display_clock_speed causing an assert because it is called when dev_priv->pm.suspend is true during runtime resume. But later was resolved after one of atomic patch is reverted.

Quoted 5 lines

While Maarten is addressing recently reported atomic issues, for time being some atomic crtc patches were reverted.

I am not 100% sure whether issue here is due to same root cause or due to something different.

You need to check the cached (and soon the one in the global atomic modeset state structure) cdclk value, not the current one in the hw. And yeah that can result in asserts since the hw might not be one yet when this code is run. I.e. this isn't about atomic modeset but just about interaction with the recent cdclk work. And with the existing rpm feature.

Quoted 7 lines
Quoted 3 lines

In the future we should even upclock the cdclck stuff (once dynamic cdclk is implemented on skl) to make sure it fits the desired scaler configuration. But that's follow-up work.

For something like that we probably need some kind of new property to request extra cdclk headroom when doing a modeset. Otherwise we're going to end up blinking the displays all the time.

Userspace can avoid the blinking by not setting the ALLOW_MODESET flag. Then we'll reject the atomic update if it would require a cdclk change. Same on the downclocking, we'd need to not force a modeset if userspace doesn't one one. We might still need some explicit headroom perhaps on top of this.
-Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx