Skip to contentSkip to conversation

drm/i915: Fix scaler init during CRTC HW state readout

PATCH Superseded Imre Deak 6 participants 19 messages Jul 19, 2017 – Jul 21, 2017

Subsystems (3)
lore
Share & tools
lore

Imre Deak

author
#0 lore raw

PATCH 1/2 drm/i915: Fix scaler init during CRTC HW state readout

The scaler allocation code depends on a non-zero default value for the crtc scaler_id, so make sure we initialize the scaler state accordingly even if the crtc is off. This fixes at least an initial YUV420 modeset (added in a follow-up patchset by Shashank) when booting with the screen
off: after the initial HW readout and modeset which enables the scaler a subsequent modeset will disable the scaler which isn't properly allocated. This results in a funky HW state where the pipe scaler HW registers can't be modified and the normally black screen is grey and shifted to the right or jitters.

The problem was revealed by Shashank's YUV420 patchset and first reported by Ville.

Cc Shashank Sharma <[email protected]>
Cc Ville Syrjälä <[email protected]>
Cc Chandra Konduru <[email protected]>
Cc Matt Roper <[email protected]>
Cc <[email protected]> # 4.11.x
Fixes a1b2278e4dfc ("drm/i915: skylake panel fitting using shared scalers")

---

[ Older stable versions need backporting, so that's for a follow-up ]

---
 drivers/gpu/drm/i915/intel_display.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/gpu/drm/i915/intel_display.c +7 -7
index 7774f3465fbc..8a38e64b1931 100644
@@ -9132,6 +9132,13 @@ static bool haswell_get_pipe_config(struct intel_crtc *crtc,
 	u64 power_domain_mask;
 	bool active;
 
+	if (INTEL_GEN(dev_priv) >= 9) {
+		intel_crtc_init_scalers(crtc, pipe_config);
+
+		pipe_config->scaler_state.scaler_id = -1;
+		pipe_config->scaler_state.scaler_users &= ~(1 << SKL_CRTC_INDEX);
+	}
+
 	power_domain = POWER_DOMAIN_PIPE(crtc->pipe);
 	if (!intel_display_power_get_if_enabled(dev_priv, power_domain))
 		return false;
@@ -9160,13 +9167,6 @@ static bool haswell_get_pipe_config(struct intel_crtc *crtc,
 	pipe_config->gamma_mode =
 		I915_READ(GAMMA_MODE(crtc->pipe)) & GAMMA_MODE_MODE_MASK;
 
-	if (INTEL_GEN(dev_priv) >= 9) {
-		intel_crtc_init_scalers(crtc, pipe_config);
-
-		pipe_config->scaler_state.scaler_id = -1;
-		pipe_config->scaler_state.scaler_users &= ~(1 << SKL_CRTC_INDEX);
-	}
-
 	power_domain = POWER_DOMAIN_PIPE_PANEL_FITTER(crtc->pipe);
 	if (intel_display_power_get_if_enabled(dev_priv, power_domain)) {
 		power_domain_mask |= BIT_ULL(power_domain);
Signature · 1 line
2.13.2
author
#1 lore raw

PATCH 2/2 drm/i915: Simplify scaler init during CRTC HW readout

The crtc state starts out being bzero'd, so no need to clear scaler_users. Also intel_crtc_init_scalers() knows already which platforms have scalers, so no need for the platform check here. Similarly intel_crtc_init_scalers() will init scaler_id as required, so no need to do it here separately.

Cc Chandra Konduru <[email protected]>
Cc Matt Roper <[email protected]>
---
 drivers/gpu/drm/i915/intel_display.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)
drivers/gpu/drm/i915/intel_display.c +1 -6
index 8a38e64b1931..7210f418e9c0 100644
@@ -9132,12 +9132,7 @@ static bool haswell_get_pipe_config(struct intel_crtc *crtc,
 	u64 power_domain_mask;
 	bool active;
 
-	if (INTEL_GEN(dev_priv) >= 9) {
-		intel_crtc_init_scalers(crtc, pipe_config);
-
-		pipe_config->scaler_state.scaler_id = -1;
-		pipe_config->scaler_state.scaler_users &= ~(1 << SKL_CRTC_INDEX);
-	}
+	intel_crtc_init_scalers(crtc, pipe_config);
 
 	power_domain = POWER_DOMAIN_PIPE(crtc->pipe);
 	if (!intel_display_power_get_if_enabled(dev_priv, power_domain))
Signature · 6 lines
2.13.2

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#6 lore raw

✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915: Fix scaler init during CRTC HW state readout

In reply to Imre Deak
== Series Details ==

== Series Details ==

Series: series starting with [1/2] drm/i915: Fix scaler init during CRTC HW state readout
URL : https://patchwork.freedesktop.org/series/27607/
State : success

== Summary ==

Series 27607v1 Series without cover letter
https://patchwork.freedesktop.org/api/1.0/series/27607/revisions/1/mbox/

Test kms_cursor_legacy:

        Subgroup basic-busy-flip-before-cursor-legacy:
                warn       -> FAIL       (fi-snb-2600) fdo#100215
Test kms_flip:
        Subgroup basic-flip-vs-modeset:
                warn       -> SKIP       (fi-skl-x1585l) fdo#101781
Test kms_pipe_crc_basic:
        Subgroup hang-read-crc-pipe-a:
                warn       -> DMESG-FAIL (fi-pnv-d510) fdo#101597 +1

fdo#100215 https://bugs.freedesktop.org/show_bug.cgi?id=100215
fdo#101781 https://bugs.freedesktop.org/show_bug.cgi?id=101781
fdo#101597 https://bugs.freedesktop.org/show_bug.cgi?id=101597

fi-bdw-5557u     total:279  pass:0    dwarn:0   dfail:0   fail:0   skip:11  time:454s
fi-bdw-gvtdvm    total:279  pass:0    dwarn:0   dfail:0   fail:0   skip:14  time:439s
fi-blb-e6850     total:279  pass:0    dwarn:0   dfail:1   fail:0   skip:54  time:359s
fi-bsw-n3050     total:279  pass:0    dwarn:0   dfail:0   fail:0   skip:36  time:539s
fi-bxt-j4205     total:279  pass:0    dwarn:0   dfail:0   fail:0   skip:19  time:518s
fi-byt-j1900     total:279  pass:0    dwarn:0   dfail:1   fail:0   skip:24  time:490s
fi-byt-n2820     total:279  pass:0    dwarn:0   dfail:1   fail:0   skip:28  time:493s
fi-glk-2a        total:279  pass:0    dwarn:0   dfail:0   fail:0   skip:19  time:599s
fi-hsw-4770      total:279  pass:0    dwarn:0   dfail:0   fail:0   skip:16  time:435s
fi-hsw-4770r     total:279  pass:0    dwarn:0   dfail:0   fail:0   skip:16  time:416s
fi-ilk-650       total:279  pass:0    dwarn:0   dfail:0   fail:0   skip:50  time:414s
fi-ivb-3520m     total:279  pass:0    dwarn:0   dfail:0   fail:0   skip:18  time:504s
fi-ivb-3770      total:279  pass:0    dwarn:0   dfail:0   fail:0   skip:18  time:473s
fi-kbl-7500u     total:279  pass:0    dwarn:0   dfail:0   fail:0   skip:18  time:467s
fi-kbl-7560u     total:279  pass:0    dwarn:0   dfail:0   fail:0   skip:10  time:575s
fi-kbl-r         total:279  pass:0    dwarn:0   dfail:0   fail:0   skip:18  time:581s
fi-pnv-d510      total:279  pass:0    dwarn:0   dfail:3   fail:0   skip:55  time:559s
fi-skl-6260u     total:279  pass:0    dwarn:0   dfail:0   fail:0   skip:10  time:467s
fi-skl-6700hq    total:279  pass:0    dwarn:0   dfail:0   fail:0   skip:17  time:594s
fi-skl-6700k     total:279  pass:0    dwarn:0   dfail:0   fail:0   skip:18  time:467s
fi-skl-6770hq    total:279  pass:0    dwarn:0   dfail:0   fail:0   skip:10  time:473s
fi-skl-gvtdvm    total:279  pass:0    dwarn:0   dfail:0   fail:0   skip:13  time:436s
fi-skl-x1585l    total:279  pass:0    dwarn:0   dfail:0   fail:0   skip:11  time:470s
fi-snb-2520m     total:279  pass:0    dwarn:0   dfail:0   fail:0   skip:28  time:545s
fi-snb-2600      total:279  pass:0    dwarn:0   dfail:0   fail:1   skip:29  time:404s

f7e80ae2a77f233ffca8fcf5739b26e2bd9a80a6 drm-tip: 2017y-07m-19d-18h-16m-25s UTC integration manifest e51c5fc drm/i915: Simplify scaler init during CRTC HW readout
c296387 drm/i915: Fix scaler init during CRTC HW state readout

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_5239/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

maintainer
#7 lore raw
In reply to Imre Deak
Quoted 22 lines · Imre Deak

The scaler allocation code depends on a non-zero default value for the crtc scaler_id, so make sure we initialize the scaler state accordingly even if the crtc is off. This fixes at least an initial YUV420 modeset (added in a follow-up patchset by Shashank) when booting with the screen
off: after the initial HW readout and modeset which enables the scaler a subsequent modeset will disable the scaler which isn't properly allocated. This results in a funky HW state where the pipe scaler HW registers can't be modified and the normally black screen is grey and shifted to the right or jitters.

The problem was revealed by Shashank's YUV420 patchset and first reported by Ville.

Cc Shashank Sharma <[email protected]>
Cc Ville Syrjälä <[email protected]>
Cc Chandra Konduru <[email protected]>
Cc Matt Roper <[email protected]>
Cc <[email protected]> # 4.11.x
Fixes a1b2278e4dfc ("drm/i915: skylake panel fitting using shared scalers")
Quoted 3 lines

---

[ Older stable versions need backporting, so that's for a follow-up ]

I thought we'd annotate cc: stable with all the kernels that need the fix, not according to where the fix applies as-is. In this case, it would be v4.2+, right?

BR,
Jani.

Quoted 36 lines
---
 drivers/gpu/drm/i915/intel_display.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/gpu/drm/i915/intel_display.c +7 -7
index 7774f3465fbc..8a38e64b1931 100644
@@ -9132,6 +9132,13 @@ static bool haswell_get_pipe_config(struct intel_crtc *crtc,
 	u64 power_domain_mask;
 	bool active;
 
+	if (INTEL_GEN(dev_priv) >= 9) {
+		intel_crtc_init_scalers(crtc, pipe_config);
+
+		pipe_config->scaler_state.scaler_id = -1;
+		pipe_config->scaler_state.scaler_users &= ~(1 << SKL_CRTC_INDEX);
+	}
+
 	power_domain = POWER_DOMAIN_PIPE(crtc->pipe);
 	if (!intel_display_power_get_if_enabled(dev_priv, power_domain))
 		return false;
@@ -9160,13 +9167,6 @@ static bool haswell_get_pipe_config(struct intel_crtc *crtc,
 	pipe_config->gamma_mode =
 		I915_READ(GAMMA_MODE(crtc->pipe)) & GAMMA_MODE_MODE_MASK;
 
-	if (INTEL_GEN(dev_priv) >= 9) {
-		intel_crtc_init_scalers(crtc, pipe_config);
-
-		pipe_config->scaler_state.scaler_id = -1;
-		pipe_config->scaler_state.scaler_users &= ~(1 << SKL_CRTC_INDEX);
-	}
-
 	power_domain = POWER_DOMAIN_PIPE_PANEL_FITTER(crtc->pipe);
 	if (intel_display_power_get_if_enabled(dev_priv, power_domain)) {
 		power_domain_mask |= BIT_ULL(power_domain);
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
author
#8 lore raw
Quoted 23 lines · Jani Nikula
Quoted 22 lines · Imre Deak

The scaler allocation code depends on a non-zero default value for the crtc scaler_id, so make sure we initialize the scaler state accordingly even if the crtc is off. This fixes at least an initial YUV420 modeset (added in a follow-up patchset by Shashank) when booting with the screen
off: after the initial HW readout and modeset which enables the scaler a subsequent modeset will disable the scaler which isn't properly allocated. This results in a funky HW state where the pipe scaler HW registers can't be modified and the normally black screen is grey and shifted to the right or jitters.

The problem was revealed by Shashank's YUV420 patchset and first reported by Ville.

Cc Shashank Sharma <[email protected]>
Cc Ville Syrjälä <[email protected]>
Cc Chandra Konduru <[email protected]>
Cc Matt Roper <[email protected]>
Cc <[email protected]> # 4.11.x
Fixes a1b2278e4dfc ("drm/i915: skylake panel fitting using shared scalers")
Quoted 7 lines
Quoted 3 lines

---

[ Older stable versions need backporting, so that's for a follow-up ]

I thought we'd annotate cc: stable with all the kernels that need the fix, not according to where the fix applies as-is. In this case, it would be v4.2+, right?

Hm, not sure. I know that this won't apply before 4.11 and I will have to send a backported version anyway. So wanted to save a redundant turn around after the automatic cherry picking to those stable versions fail.

Greg, what's the proper tag in this case?

Thanks,
Imre

Quoted 32 lines

BR,
Jani.

Quoted 26 lines
---
 drivers/gpu/drm/i915/intel_display.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/gpu/drm/i915/intel_display.c +7 -0
index 7774f3465fbc..8a38e64b1931 100644
@@ -9132,6 +9132,13 @@ static bool haswell_get_pipe_config(struct intel_crtc *crtc,
 	u64 power_domain_mask;
 	bool active;
 
+	if (INTEL_GEN(dev_priv) >= 9) {
+		intel_crtc_init_scalers(crtc, pipe_config);
+
+		pipe_config->scaler_state.scaler_id = -1;
+		pipe_config->scaler_state.scaler_users &= ~(1 << SKL_CRTC_INDEX);
+	}
+
 	power_domain = POWER_DOMAIN_PIPE(crtc->pipe);
 	if (!intel_display_power_get_if_enabled(dev_priv, power_domain))
 		return false;
@@ -9160,13 +9167,6 @@ static bool haswell_get_pipe_config(struct intel_crtc *crtc,
 	pipe_config->gamma_mode =
 		I915_READ(GAMMA_MODE(crtc->pipe)) & GAMMA_MODE_MODE_MASK;
 
Quoted 13 lines
Quoted 10 lines
drivers/gpu/drm/i915/intel_display.c +0 -7
-	if (INTEL_GEN(dev_priv) >= 9) {
-		intel_crtc_init_scalers(crtc, pipe_config);
-
-		pipe_config->scaler_state.scaler_id = -1;
-		pipe_config->scaler_state.scaler_users &= ~(1 << SKL_CRTC_INDEX);
-	}
-
 	power_domain = POWER_DOMAIN_PIPE_PANEL_FITTER(crtc->pipe);
 	if (intel_display_power_get_if_enabled(dev_priv, power_domain)) {
 		power_domain_mask |= BIT_ULL(power_domain);
Signature · 1 line
Jani Nikula, Intel Open Source Technology Center

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

#11 lore raw

✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915: Fix scaler init during CRTC HW state readout

In reply to Imre Deak
== Series Details ==

== Series Details ==

Series: series starting with [1/2] drm/i915: Fix scaler init during CRTC HW state readout
URL : https://patchwork.freedesktop.org/series/27607/
State : success

== Summary ==

Series 27607v1 Series without cover letter
https://patchwork.freedesktop.org/api/1.0/series/27607/revisions/1/mbox/

Test kms_flip:

        Subgroup basic-flip-vs-modeset:
                pass       -> SKIP       (fi-skl-x1585l) fdo#101781
Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-b:
                dmesg-warn -> PASS       (fi-byt-j1900) fdo#101705

fdo#101781 https://bugs.freedesktop.org/show_bug.cgi?id=101781
fdo#101705 https://bugs.freedesktop.org/show_bug.cgi?id=101705

fi-bdw-5557u     total:279  pass:268  dwarn:0   dfail:0   fail:0   skip:11  time:455s
fi-bdw-gvtdvm    total:279  pass:265  dwarn:0   dfail:0   fail:0   skip:14  time:425s
fi-blb-e6850     total:279  pass:224  dwarn:1   dfail:0   fail:0   skip:54  time:357s
fi-bsw-n3050     total:279  pass:243  dwarn:0   dfail:0   fail:0   skip:36  time:539s
fi-bxt-j4205     total:279  pass:260  dwarn:0   dfail:0   fail:0   skip:19  time:510s
fi-byt-j1900     total:279  pass:255  dwarn:0   dfail:0   fail:0   skip:24  time:492s
fi-byt-n2820     total:279  pass:250  dwarn:1   dfail:0   fail:0   skip:28  time:492s
fi-glk-2a        total:279  pass:260  dwarn:0   dfail:0   fail:0   skip:19  time:598s
fi-hsw-4770      total:279  pass:263  dwarn:0   dfail:0   fail:0   skip:16  time:439s
fi-hsw-4770r     total:279  pass:263  dwarn:0   dfail:0   fail:0   skip:16  time:417s
fi-ilk-650       total:279  pass:229  dwarn:0   dfail:0   fail:0   skip:50  time:414s
fi-ivb-3520m     total:279  pass:261  dwarn:0   dfail:0   fail:0   skip:18  time:505s
fi-ivb-3770      total:279  pass:261  dwarn:0   dfail:0   fail:0   skip:18  time:476s
fi-kbl-7500u     total:279  pass:261  dwarn:0   dfail:0   fail:0   skip:18  time:461s
fi-kbl-7560u     total:279  pass:269  dwarn:0   dfail:0   fail:0   skip:10  time:577s
fi-kbl-r         total:279  pass:261  dwarn:0   dfail:0   fail:0   skip:18  time:585s
fi-pnv-d510      total:279  pass:221  dwarn:3   dfail:0   fail:0   skip:55  time:559s
fi-skl-6260u     total:279  pass:269  dwarn:0   dfail:0   fail:0   skip:10  time:460s
fi-skl-6700hq    total:279  pass:262  dwarn:0   dfail:0   fail:0   skip:17  time:586s
fi-skl-6700k     total:279  pass:261  dwarn:0   dfail:0   fail:0   skip:18  time:468s
fi-skl-6770hq    total:279  pass:269  dwarn:0   dfail:0   fail:0   skip:10  time:480s
fi-skl-gvtdvm    total:279  pass:266  dwarn:0   dfail:0   fail:0   skip:13  time:434s
fi-skl-x1585l    total:279  pass:268  dwarn:0   dfail:0   fail:0   skip:11  time:474s
fi-snb-2520m     total:279  pass:251  dwarn:0   dfail:0   fail:0   skip:28  time:542s
fi-snb-2600      total:279  pass:250  dwarn:0   dfail:0   fail:0   skip:29  time:406s

0fb3fc159dfcd22ce3b81818c3ffb33bcf737936 drm-tip: 2017y-07m-20d-08h-46m-42s UTC integration manifest 5e28a62 drm/i915: Simplify scaler init during CRTC HW readout
dddab95 drm/i915: Fix scaler init during CRTC HW state readout

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_5240/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#9 lore raw
In reply to Imre Deak
Quoted 32 lines · Imre Deak
Quoted 23 lines · Jani Nikula
Quoted 22 lines · Imre Deak

The scaler allocation code depends on a non-zero default value for the crtc scaler_id, so make sure we initialize the scaler state accordingly even if the crtc is off. This fixes at least an initial YUV420 modeset (added in a follow-up patchset by Shashank) when booting with the screen
off: after the initial HW readout and modeset which enables the scaler a subsequent modeset will disable the scaler which isn't properly allocated. This results in a funky HW state where the pipe scaler HW registers can't be modified and the normally black screen is grey and shifted to the right or jitters.

The problem was revealed by Shashank's YUV420 patchset and first reported by Ville.

Cc Shashank Sharma <[email protected]>
Cc Ville Syrjälä <[email protected]>
Cc Chandra Konduru <[email protected]>
Cc Matt Roper <[email protected]>
Cc <[email protected]> # 4.11.x
Fixes a1b2278e4dfc ("drm/i915: skylake panel fitting using shared scalers")
Quoted 7 lines
Quoted 3 lines

---

[ Older stable versions need backporting, so that's for a follow-up ]

I thought we'd annotate cc: stable with all the kernels that need the fix, not according to where the fix applies as-is. In this case, it would be v4.2+, right?

Quoted 6 lines

Hm, not sure. I know that this won't apply before 4.11 and I will have to send a backported version anyway. So wanted to save a redundant turn around after the automatic cherry picking to those stable versions fail.

Greg, what's the proper tag in this case?

4.2+ and then when you get the "this didn't apply" email, send the backported patches. That way the stable maintainers know it "should" be applied there, but it just doesn't seem to work with the existing patch.

thanks,

greg k-h

author
#10 lore raw
Quoted 38 lines · Greg Kroah-Hartman
Quoted 37 lines · Imre Deak
Quoted 23 lines · Jani Nikula
Quoted 22 lines · Imre Deak

The scaler allocation code depends on a non-zero default value for the crtc scaler_id, so make sure we initialize the scaler state accordingly even if the crtc is off. This fixes at least an initial YUV420 modeset (added in a follow-up patchset by Shashank) when booting with the screen
off: after the initial HW readout and modeset which enables the scaler a subsequent modeset will disable the scaler which isn't properly allocated. This results in a funky HW state where the pipe scaler HW registers can't be modified and the normally black screen is grey and shifted to the right or jitters.

The problem was revealed by Shashank's YUV420 patchset and first reported by Ville.

Cc Shashank Sharma <[email protected]>
Cc Ville Syrj�l� <[email protected]>
Cc Chandra Konduru <[email protected]>
Cc Matt Roper <[email protected]>
Cc <[email protected]> # 4.11.x
Fixes a1b2278e4dfc ("drm/i915: skylake panel fitting using shared scalers")
Quoted 7 lines
Quoted 3 lines

---

[ Older stable versions need backporting, so that's for a follow-up ]

I thought we'd annotate cc: stable with all the kernels that need the fix, not according to where the fix applies as-is. In this case, it would be v4.2+, right?

Hm, not sure. I know that this won't apply before 4.11 and I will have to send a backported version anyway. So wanted to save a redundant turn around after the automatic cherry picking to those stable versions fail.

Quoted 5 lines
Quoted 1 line

Greg, what's the proper tag in this case?

4.2+ and then when you get the "this didn't apply" email, send the backported patches. That way the stable maintainers know it "should" be applied there, but it just doesn't seem to work with the existing patch.

Ok, will resend with that, thanks for catching this and clarifying.

--Imre

author
#12 lore raw

PATCH v2 1/2 drm/i915: Fix scaler init during CRTC HW state readout

In reply to Imre Deak

The scaler allocation code depends on a non-zero default value for the crtc scaler_id, so make sure we initialize the scaler state accordingly even if the crtc is off. This fixes at least an initial YUV420 modeset (added in a follow-up patchset by Shashank) when booting with the screen
off: after the initial HW readout and modeset which enables the scaler a subsequent modeset will disable the scaler which isn't properly allocated. This results in a funky HW state where the pipe scaler HW registers can't be modified and the normally black screen is grey and shifted to the right or jitters.

The problem was revealed by Shashank's YUV420 patchset and first reported by Ville.

v2:
- In the stable tag also include versions which need backporting (Jani)

Cc Jani Nikula <[email protected]>
Cc Shashank Sharma <[email protected]>
Cc Ville Syrjälä <[email protected]>
Cc Chandra Konduru <[email protected]>
Cc Matt Roper <[email protected]>
Cc <[email protected]> # 4.2.x
Fixes a1b2278e4dfc ("drm/i915: skylake panel fitting using shared scalers")

---

[ Stable versions before 4.11 need backporting, so that's for a follow-up ]

---
 drivers/gpu/drm/i915/intel_display.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/gpu/drm/i915/intel_display.c +7 -7
index 7774f3465fbc..8a38e64b1931 100644
@@ -9132,6 +9132,13 @@ static bool haswell_get_pipe_config(struct intel_crtc *crtc,
 	u64 power_domain_mask;
 	bool active;
 
+	if (INTEL_GEN(dev_priv) >= 9) {
+		intel_crtc_init_scalers(crtc, pipe_config);
+
+		pipe_config->scaler_state.scaler_id = -1;
+		pipe_config->scaler_state.scaler_users &= ~(1 << SKL_CRTC_INDEX);
+	}
+
 	power_domain = POWER_DOMAIN_PIPE(crtc->pipe);
 	if (!intel_display_power_get_if_enabled(dev_priv, power_domain))
 		return false;
@@ -9160,13 +9167,6 @@ static bool haswell_get_pipe_config(struct intel_crtc *crtc,
 	pipe_config->gamma_mode =
 		I915_READ(GAMMA_MODE(crtc->pipe)) & GAMMA_MODE_MODE_MASK;
 
-	if (INTEL_GEN(dev_priv) >= 9) {
-		intel_crtc_init_scalers(crtc, pipe_config);
-
-		pipe_config->scaler_state.scaler_id = -1;
-		pipe_config->scaler_state.scaler_users &= ~(1 << SKL_CRTC_INDEX);
-	}
-
 	power_domain = POWER_DOMAIN_PIPE_PANEL_FITTER(crtc->pipe);
 	if (intel_display_power_get_if_enabled(dev_priv, power_domain)) {
 		power_domain_mask |= BIT_ULL(power_domain);
Signature · 6 lines
2.13.2

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#13 lore raw

✓ Fi.CI.BAT: success for series starting with [v2,1/2] drm/i915: Fix scaler init during CRTC HW state readout (rev2)

In reply to Imre Deak
== Series Details ==

== Series Details ==

Series: series starting with [v2,1/2] drm/i915: Fix scaler init during CRTC HW state readout (rev2)
URL : https://patchwork.freedesktop.org/series/27607/
State : success

== Summary ==

Series 27607v2 Series without cover letter
https://patchwork.freedesktop.org/api/1.0/series/27607/revisions/2/mbox/

Test kms_cursor_legacy:

        Subgroup basic-busy-flip-before-cursor-atomic:
                fail       -> PASS       (fi-snb-2600) fdo#100215
Test kms_flip:
        Subgroup basic-flip-vs-modeset:
                pass       -> SKIP       (fi-skl-x1585l) fdo#101781

fdo#100215 https://bugs.freedesktop.org/show_bug.cgi?id=100215
fdo#101781 https://bugs.freedesktop.org/show_bug.cgi?id=101781

fi-bdw-5557u     total:279  pass:268  dwarn:0   dfail:0   fail:0   skip:11  time:442s
fi-bdw-gvtdvm    total:279  pass:265  dwarn:0   dfail:0   fail:0   skip:14  time:427s
fi-blb-e6850     total:279  pass:224  dwarn:1   dfail:0   fail:0   skip:54  time:350s
fi-bsw-n3050     total:279  pass:243  dwarn:0   dfail:0   fail:0   skip:36  time:540s
fi-bxt-j4205     total:279  pass:260  dwarn:0   dfail:0   fail:0   skip:19  time:513s
fi-byt-j1900     total:279  pass:254  dwarn:1   dfail:0   fail:0   skip:24  time:489s
fi-byt-n2820     total:279  pass:250  dwarn:1   dfail:0   fail:0   skip:28  time:482s
fi-glk-2a        total:279  pass:260  dwarn:0   dfail:0   fail:0   skip:19  time:598s
fi-hsw-4770      total:279  pass:263  dwarn:0   dfail:0   fail:0   skip:16  time:435s
fi-hsw-4770r     total:279  pass:263  dwarn:0   dfail:0   fail:0   skip:16  time:419s
fi-ilk-650       total:279  pass:229  dwarn:0   dfail:0   fail:0   skip:50  time:415s
fi-ivb-3520m     total:279  pass:261  dwarn:0   dfail:0   fail:0   skip:18  time:507s
fi-ivb-3770      total:279  pass:261  dwarn:0   dfail:0   fail:0   skip:18  time:476s
fi-kbl-7500u     total:279  pass:261  dwarn:0   dfail:0   fail:0   skip:18  time:466s
fi-kbl-7560u     total:279  pass:269  dwarn:0   dfail:0   fail:0   skip:10  time:574s
fi-kbl-r         total:279  pass:261  dwarn:0   dfail:0   fail:0   skip:18  time:586s
fi-pnv-d510      total:279  pass:222  dwarn:2   dfail:0   fail:0   skip:55  time:567s
fi-skl-6260u     total:279  pass:269  dwarn:0   dfail:0   fail:0   skip:10  time:459s
fi-skl-6700hq    total:279  pass:262  dwarn:0   dfail:0   fail:0   skip:17  time:584s
fi-skl-6700k     total:279  pass:261  dwarn:0   dfail:0   fail:0   skip:18  time:466s
fi-skl-6770hq    total:279  pass:269  dwarn:0   dfail:0   fail:0   skip:10  time:478s
fi-skl-gvtdvm    total:279  pass:266  dwarn:0   dfail:0   fail:0   skip:13  time:435s
fi-skl-x1585l    total:279  pass:268  dwarn:0   dfail:0   fail:0   skip:11  time:480s
fi-snb-2520m     total:279  pass:251  dwarn:0   dfail:0   fail:0   skip:28  time:544s
fi-snb-2600      total:279  pass:250  dwarn:0   dfail:0   fail:0   skip:29  time:403s

948c3bddb3333e7245970c684749ba5d72370cd2 drm-tip: 2017y-07m-20d-10h-52m-43s UTC integration manifest ad6c516 drm/i915: Simplify scaler init during CRTC HW readout
8915378 drm/i915: Fix scaler init during CRTC HW state readout

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_5246/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Acked-by on v1 1/2
#15 lore raw
In reply to Imre Deak

Regards
Shashank

Quoted 61 lines · Imre Deak

The scaler allocation code depends on a non-zero default value for the crtc scaler_id, so make sure we initialize the scaler state accordingly even if the crtc is off. This fixes at least an initial YUV420 modeset (added in a follow-up patchset by Shashank) when booting with the screen
off: after the initial HW readout and modeset which enables the scaler a subsequent modeset will disable the scaler which isn't properly allocated. This results in a funky HW state where the pipe scaler HW registers can't be modified and the normally black screen is grey and shifted to the right or jitters.

The problem was revealed by Shashank's YUV420 patchset and first reported by Ville.

Cc Shashank Sharma <[email protected]>
Cc Ville Syrjälä <[email protected]>
Cc Chandra Konduru <[email protected]>
Cc Matt Roper <[email protected]>
Cc <[email protected]> # 4.11.x
Fixes a1b2278e4dfc ("drm/i915: skylake panel fitting using shared scalers")

---

[ Older stable versions need backporting, so that's for a follow-up ]

---
  drivers/gpu/drm/i915/intel_display.c | 14 +++++++-------
  1 file changed, 7 insertions(+), 7 deletions(-)
drivers/gpu/drm/i915/intel_display.c +7 -7
index 7774f3465fbc..8a38e64b1931 100644
@@ -9132,6 +9132,13 @@ static bool haswell_get_pipe_config(struct intel_crtc *crtc,
  	u64 power_domain_mask;
  	bool active;
 
+	if (INTEL_GEN(dev_priv) >= 9) {
+		intel_crtc_init_scalers(crtc, pipe_config);
+
+		pipe_config->scaler_state.scaler_id = -1;
+		pipe_config->scaler_state.scaler_users &= ~(1 << SKL_CRTC_INDEX);
+	}
+
  	power_domain = POWER_DOMAIN_PIPE(crtc->pipe);
  	if (!intel_display_power_get_if_enabled(dev_priv, power_domain))
  		return false;
@@ -9160,13 +9167,6 @@ static bool haswell_get_pipe_config(struct intel_crtc *crtc,
  	pipe_config->gamma_mode =
  		I915_READ(GAMMA_MODE(crtc->pipe)) & GAMMA_MODE_MODE_MASK;
 
-	if (INTEL_GEN(dev_priv) >= 9) {
-		intel_crtc_init_scalers(crtc, pipe_config);
-
-		pipe_config->scaler_state.scaler_id = -1;
-		pipe_config->scaler_state.scaler_users &= ~(1 << SKL_CRTC_INDEX);
-	}
-
  	power_domain = POWER_DOMAIN_PIPE_PANEL_FITTER(crtc->pipe);
  	if (intel_display_power_get_if_enabled(dev_priv, power_domain)) {
  		power_domain_mask |= BIT_ULL(power_domain);
#16 lore raw

Hi,

Quoted 34 lines · Shashank

Regards
Shashank

Quoted 29 lines · Imre Deak

The scaler allocation code depends on a non-zero default value for the crtc scaler_id, so make sure we initialize the scaler state accordingly even if the crtc is off. This fixes at least an initial YUV420 modeset (added in a follow-up patchset by Shashank) when booting with the screen
off: after the initial HW readout and modeset which enables the scaler a subsequent modeset will disable the scaler which isn't properly allocated. This results in a funky HW state where the pipe scaler HW registers can't be modified and the normally black screen is grey and shifted to the right or jitters.

The problem was revealed by Shashank's YUV420 patchset and first reported by Ville.

Cc Shashank Sharma <[email protected]>
Cc Ville Syrjälä <[email protected]>
Cc Chandra Konduru <[email protected]>
Cc Matt Roper <[email protected]>
Cc <[email protected]> # 4.11.x
Fixes a1b2278e4dfc ("drm/i915: skylake panel fitting using shared scalers")

---

[ Older stable versions need backporting, so that's for a follow-up ]

---
  drivers/gpu/drm/i915/intel_display.c | 14 +++++++-------
  1 file changed, 7 insertions(+), 7 deletions(-)
Quoted 14 lines
Quoted 5 lines
drivers/gpu/drm/i915/intel_display.c +0 -0
index 7774f3465fbc..8a38e64b1931 100644

drivers/gpu/drm/i915/intel_display.c static bool haswell_get_pipe_config(struct · line 9140

Quoted 9 lines
drivers/gpu/drm/i915/intel_display.c +4 -0
@@ -9132,6 +9132,13 @@ static bool haswell_get_pipe_config(struct 
 intel_crtc *crtc,
      u64 power_domain_mask;
      bool active;
  +    if (INTEL_GEN(dev_priv) >= 9) {
+        intel_crtc_init_scalers(crtc, pipe_config);
+
+        pipe_config->scaler_state.scaler_id = -1;
+        pipe_config->scaler_state.scaler_users &= ~(1 << 
 SKL_CRTC_INDEX);

We are already setting scaler_id to -1 during init_scalers & doing memset over intel_crtc_state in intel_modeset_readout_hw_state, So IMO above 2 lines are unnecessary.. Should not we reading actual HW state of scaler here instead of just clearing it.

-Mahesh

Quoted 25 lines
Quoted 10 lines
drivers/gpu/drm/i915/intel_display.c +2 -0
+    }
+
      power_domain = POWER_DOMAIN_PIPE(crtc->pipe);
      if (!intel_display_power_get_if_enabled(dev_priv, power_domain))
          return false;
@@ -9160,13 +9167,6 @@ static bool haswell_get_pipe_config(struct 
 intel_crtc *crtc,
      pipe_config->gamma_mode =
          I915_READ(GAMMA_MODE(crtc->pipe)) & GAMMA_MODE_MODE_MASK;
  -    if (INTEL_GEN(dev_priv) >= 9) {

drivers/gpu/drm/i915/intel_display.c static bool haswell_get_pipe_config(struct · line 9172

Quoted 10 lines
drivers/gpu/drm/i915/intel_display.c +0 -6
-        intel_crtc_init_scalers(crtc, pipe_config);
-
-        pipe_config->scaler_state.scaler_id = -1;
-        pipe_config->scaler_state.scaler_users &= ~(1 << 
 SKL_CRTC_INDEX);
-    }
-
      power_domain = POWER_DOMAIN_PIPE_PANEL_FITTER(crtc->pipe);
      if (intel_display_power_get_if_enabled(dev_priv, power_domain)) {
          power_domain_mask |= BIT_ULL(power_domain);

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

author
#17 lore raw
Quoted 49 lines · Mahesh Kumar

Hi,

Quoted 45 lines · Shashank

Regards
Shashank

Quoted 40 lines · Imre Deak

The scaler allocation code depends on a non-zero default value for the crtc scaler_id, so make sure we initialize the scaler state accordingly even if the crtc is off. This fixes at least an initial YUV420 modeset (added in a follow-up patchset by Shashank) when booting with the screen
off: after the initial HW readout and modeset which enables the scaler a subsequent modeset will disable the scaler which isn't properly allocated. This results in a funky HW state where the pipe scaler HW registers can't be modified and the normally black screen is grey and shifted to the right or jitters.

The problem was revealed by Shashank's YUV420 patchset and first reported by Ville.

Cc Shashank Sharma <[email protected]>
Cc Ville Syrjälä <[email protected]>
Cc Chandra Konduru <[email protected]>
Cc Matt Roper <[email protected]>
Cc <[email protected]> # 4.11.x
Fixes a1b2278e4dfc ("drm/i915: skylake panel fitting using shared

scalers")

---

[ Older stable versions need backporting, so that's for a follow-up ]

---
  drivers/gpu/drm/i915/intel_display.c | 14 +++++++-------
  1 file changed, 7 insertions(+), 7 deletions(-)
drivers/gpu/drm/i915/intel_display.c +0 -0
index 7774f3465fbc..8a38e64b1931 100644
@@ -9132,6 +9132,13 @@ static bool haswell_get_pipe_config(struct
 intel_crtc *crtc,
      u64 power_domain_mask;
      bool active;
  +    if (INTEL_GEN(dev_priv) >= 9) {
Quoted 8 lines
Quoted 5 lines

drivers/gpu/drm/i915/intel_display.c static bool haswell_get_pipe_config(struct intel_crtc *crtc,

Quoted 5 lines
drivers/gpu/drm/i915/intel_display.c +4 -0
+        intel_crtc_init_scalers(crtc, pipe_config);
+
+        pipe_config->scaler_state.scaler_id = -1;
+        pipe_config->scaler_state.scaler_users &= ~(1 <<
 SKL_CRTC_INDEX);

We are already setting scaler_id to -1 during init_scalers & doing memset over intel_crtc_state in intel_modeset_readout_hw_state, So IMO above 2 lines are unnecessary..

They are removed in the next patch. I didn't want to remove them in one go, since for stable I wanted to keep the changes minimal.

Quoted 2 lines

Should not we reading actual HW state of scaler here instead of just clearing it.

We will read the scaler state later after determining that the crtc is on. If it's off the scaler is also off matching the default state we set here.

Quoted 28 lines

-Mahesh

Quoted 25 lines
Quoted 10 lines
drivers/gpu/drm/i915/intel_display.c +2 -0
+    }
+
      power_domain = POWER_DOMAIN_PIPE(crtc->pipe);
      if (!intel_display_power_get_if_enabled(dev_priv, power_domain))
          return false;
@@ -9160,13 +9167,6 @@ static bool haswell_get_pipe_config(struct
 intel_crtc *crtc,
      pipe_config->gamma_mode =
          I915_READ(GAMMA_MODE(crtc->pipe)) & GAMMA_MODE_MODE_MASK;
  -    if (INTEL_GEN(dev_priv) >= 9) {

drivers/gpu/drm/i915/intel_display.c static bool haswell_get_pipe_config(struct · line 9172

Quoted 10 lines
drivers/gpu/drm/i915/intel_display.c +0 -6
-        intel_crtc_init_scalers(crtc, pipe_config);
-
-        pipe_config->scaler_state.scaler_id = -1;
-        pipe_config->scaler_state.scaler_users &= ~(1 <<
 SKL_CRTC_INDEX);
-    }
-
      power_domain = POWER_DOMAIN_PIPE_PANEL_FITTER(crtc->pipe);
      if (intel_display_power_get_if_enabled(dev_priv, power_domain)) {
          power_domain_mask |= BIT_ULL(power_domain);

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

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

Reviewed-by
#18 lore raw

Hi

Quoted 58 lines · Imre Deak
Quoted 49 lines · Mahesh Kumar

Hi,

Quoted 45 lines · Shashank

Regards
Shashank

Quoted 40 lines · Imre Deak

The scaler allocation code depends on a non-zero default value for the crtc scaler_id, so make sure we initialize the scaler state accordingly even if the crtc is off. This fixes at least an initial YUV420 modeset (added in a follow-up patchset by Shashank) when booting with the screen
off: after the initial HW readout and modeset which enables the scaler a subsequent modeset will disable the scaler which isn't properly allocated. This results in a funky HW state where the pipe scaler HW registers can't be modified and the normally black screen is grey and shifted to the right or jitters.

The problem was revealed by Shashank's YUV420 patchset and first reported by Ville.

Cc Shashank Sharma <[email protected]>
Cc Ville Syrjälä <[email protected]>
Cc Chandra Konduru <[email protected]>
Cc Matt Roper <[email protected]>
Cc <[email protected]> # 4.11.x
Fixes a1b2278e4dfc ("drm/i915: skylake panel fitting using shared

scalers")

---

[ Older stable versions need backporting, so that's for a follow-up ]

---
   drivers/gpu/drm/i915/intel_display.c | 14 +++++++-------
   1 file changed, 7 insertions(+), 7 deletions(-)
drivers/gpu/drm/i915/intel_display.c +0 -0
index 7774f3465fbc..8a38e64b1931 100644
@@ -9132,6 +9132,13 @@ static bool haswell_get_pipe_config(struct
 intel_crtc *crtc,
       u64 power_domain_mask;
       bool active;
   +    if (INTEL_GEN(dev_priv) >= 9) {
Quoted 8 lines
Quoted 5 lines

drivers/gpu/drm/i915/intel_display.c static bool haswell_get_pipe_config(struct intel_crtc *crtc,

Quoted 5 lines
drivers/gpu/drm/i915/intel_display.c +4 -0
+        intel_crtc_init_scalers(crtc, pipe_config);
+
+        pipe_config->scaler_state.scaler_id = -1;
+        pipe_config->scaler_state.scaler_users &= ~(1 <<
 SKL_CRTC_INDEX);

We are already setting scaler_id to -1 during init_scalers & doing memset over intel_crtc_state in intel_modeset_readout_hw_state, So IMO above 2 lines are unnecessary..

Quoted 2 lines

They are removed in the next patch. I didn't want to remove them in one go, since for stable I wanted to keep the changes minimal.

OK, l'm fine with it.

Quoted 32 lines
Quoted 3 lines

Should not we reading actual HW state of scaler here instead of just clearing it.

We will read the scaler state later after determining that the crtc is on. If it's off the scaler is also off matching the default state we set here.

Quoted 25 lines

-Mahesh

Quoted 24 lines
Quoted 10 lines
drivers/gpu/drm/i915/intel_display.c +2 -0
+    }
+
       power_domain = POWER_DOMAIN_PIPE(crtc->pipe);
       if (!intel_display_power_get_if_enabled(dev_priv, power_domain))
           return false;
@@ -9160,13 +9167,6 @@ static bool haswell_get_pipe_config(struct
 intel_crtc *crtc,
       pipe_config->gamma_mode =
           I915_READ(GAMMA_MODE(crtc->pipe)) & GAMMA_MODE_MODE_MASK;
   -    if (INTEL_GEN(dev_priv) >= 9) {

drivers/gpu/drm/i915/intel_display.c static bool haswell_get_pipe_config(struct · line 9172

Quoted 10 lines
drivers/gpu/drm/i915/intel_display.c +0 -6
-        intel_crtc_init_scalers(crtc, pipe_config);
-
-        pipe_config->scaler_state.scaler_id = -1;
-        pipe_config->scaler_state.scaler_users &= ~(1 <<
 SKL_CRTC_INDEX);
-    }
-
       power_domain = POWER_DOMAIN_PIPE_PANEL_FITTER(crtc->pipe);
       if (intel_display_power_get_if_enabled(dev_priv, power_domain)) {
           power_domain_mask |= BIT_ULL(power_domain);

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

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

#2 lore raw

Re: [PATCH 2/2] drm/i915: Simplify scaler init during CRTC HW readout

In reply to Imre Deak

Hi,

Quoted 18 lines · Imre Deak

The crtc state starts out being bzero'd, so no need to clear scaler_users. Also intel_crtc_init_scalers() knows already which platforms have scalers, so no need for the platform check here. Similarly intel_crtc_init_scalers() will init scaler_id as required, so no need to do it here separately.

Cc Chandra Konduru <[email protected]>
Cc Matt Roper <[email protected]>
---
  drivers/gpu/drm/i915/intel_display.c | 7 +------
  1 file changed, 1 insertion(+), 6 deletions(-)
drivers/gpu/drm/i915/intel_display.c +0 -0
index 8a38e64b1931..7210f418e9c0 100644

drivers/gpu/drm/i915/intel_display.c static bool haswell_get_pipe_config(struct intel_crtc *crtc, · line 9135

Quoted 10 lines
drivers/gpu/drm/i915/intel_display.c +1 -6
@@ -9132,12 +9132,7 @@ static bool haswell_get_pipe_config(struct intel_crtc *crtc,
  	u64 power_domain_mask;
  	bool active;
 
-	if (INTEL_GEN(dev_priv) >= 9) {
-		intel_crtc_init_scalers(crtc, pipe_config);
-
-		pipe_config->scaler_state.scaler_id = -1;
-		pipe_config->scaler_state.scaler_users &= ~(1 << SKL_CRTC_INDEX);
-	}
+	intel_crtc_init_scalers(crtc, pipe_config);

If we are removing gen check, then IMHO we should initialize "scaler_id = -1" even before !crtc->num_scalers check in intel_crtc_init_scalers function, just to make sure scaler state doesn't have wrong value in platforms where we don't have any scalers.

-Mahesh

drivers/gpu/drm/i915/intel_display.c static bool haswell_get_pipe_config(struct intel_crtc *crtc, · line 9138

Quoted 3 lines
drivers/gpu/drm/i915/intel_display.c +0 -0
  	power_domain = POWER_DOMAIN_PIPE(crtc->pipe);
  	if (!intel_display_power_get_if_enabled(dev_priv, power_domain))

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

author
#3 lore raw

Re: [PATCH 2/2] drm/i915: Simplify scaler init during CRTC HW readout

Quoted 27 lines · Mahesh Kumar

Hi,

Quoted 23 lines · Imre Deak

The crtc state starts out being bzero'd, so no need to clear scaler_users. Also intel_crtc_init_scalers() knows already which platforms have scalers, so no need for the platform check here. Similarly intel_crtc_init_scalers() will init scaler_id as required, so no need to do it here separately.

Cc Chandra Konduru <[email protected]>
Cc Matt Roper <[email protected]>
---
  drivers/gpu/drm/i915/intel_display.c | 7 +------
  1 file changed, 1 insertion(+), 6 deletions(-)
drivers/gpu/drm/i915/intel_display.c +0 -3
index 8a38e64b1931..7210f418e9c0 100644
@@ -9132,12 +9132,7 @@ static bool haswell_get_pipe_config(struct intel_crtc *crtc,
  	u64 power_domain_mask;
  	bool active;
-	if (INTEL_GEN(dev_priv) >= 9) {
-		intel_crtc_init_scalers(crtc, pipe_config);
-
Quoted 8 lines

drivers/gpu/drm/i915/intel_display.c static bool haswell_get_pipe_config(struct intel_crtc *crtc, · line 9135

Quoted 4 lines
drivers/gpu/drm/i915/intel_display.c +1 -3
-		pipe_config->scaler_state.scaler_id = -1;
-		pipe_config->scaler_state.scaler_users &= ~(1 << SKL_CRTC_INDEX);
-	}
+	intel_crtc_init_scalers(crtc, pipe_config);

If we are removing gen check, then IMHO we should initialize "scaler_id = -1" even before !crtc->num_scalers check in intel_crtc_init_scalers function, just to make sure scaler state doesn't have wrong value in platforms where we don't have any scalers.

I agree that setting scaler_id to -1 on all platforms is a good idea, but it's unrelated to removing here the GEN check. intel_crtc_init_scalers() is already called for all platforms in intel_crtc_init(). So this change won't make a difference for platforms without scalers: we leave scaler_id zeroed on those already now (they have num_scalers set to 0). This isn't either a problem since we allocate scalers only on GEN9+.

So we could do what you suggest but imo as a follow-up.

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

Reviewed-by
#4 lore raw

Re: [PATCH 2/2] drm/i915: Simplify scaler init during CRTC HW readout

Hi,

Quoted 36 lines · Imre Deak
Quoted 27 lines · Mahesh Kumar

Hi,

Quoted 23 lines · Imre Deak

The crtc state starts out being bzero'd, so no need to clear scaler_users. Also intel_crtc_init_scalers() knows already which platforms have scalers, so no need for the platform check here. Similarly intel_crtc_init_scalers() will init scaler_id as required, so no need to do it here separately.

Cc Chandra Konduru <[email protected]>
Cc Matt Roper <[email protected]>
---
   drivers/gpu/drm/i915/intel_display.c | 7 +------
   1 file changed, 1 insertion(+), 6 deletions(-)
drivers/gpu/drm/i915/intel_display.c +0 -3
index 8a38e64b1931..7210f418e9c0 100644
@@ -9132,12 +9132,7 @@ static bool haswell_get_pipe_config(struct intel_crtc *crtc,
   	u64 power_domain_mask;
   	bool active;
-	if (INTEL_GEN(dev_priv) >= 9) {
-		intel_crtc_init_scalers(crtc, pipe_config);
-
Quoted 8 lines

drivers/gpu/drm/i915/intel_display.c static bool haswell_get_pipe_config(struct intel_crtc *crtc, · line 9135

Quoted 4 lines
drivers/gpu/drm/i915/intel_display.c +1 -3
-		pipe_config->scaler_state.scaler_id = -1;
-		pipe_config->scaler_state.scaler_users &= ~(1 << SKL_CRTC_INDEX);
-	}
+	intel_crtc_init_scalers(crtc, pipe_config);

If we are removing gen check, then IMHO we should initialize "scaler_id = -1" even before !crtc->num_scalers check in intel_crtc_init_scalers function, just to make sure scaler state doesn't have wrong value in platforms where we don't have any scalers.

Quoted 8 lines

I agree that setting scaler_id to -1 on all platforms is a good idea, but it's unrelated to removing here the GEN check. intel_crtc_init_scalers() is already called for all platforms in intel_crtc_init(). So this change won't make a difference for platforms without scalers: we leave scaler_id zeroed on those already now (they have num_scalers set to 0). This isn't either a problem since we allocate scalers only on GEN9+.

So we could do what you suggest but imo as a follow-up.

sounds good, But if you are going to write a cleanup patch, will that be possible for you to do following change also.
0 indicates no scaler is used & non-zero +ve value indicates used
scaler id.
in any case

-Mahesh

Quoted 2 lines

--Imre

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

author
#5 lore raw

Re: [PATCH 2/2] drm/i915: Simplify scaler init during CRTC HW readout

Quoted 49 lines · Mahesh Kumar

Hi,

Quoted 45 lines · Imre Deak
Quoted 28 lines · Mahesh Kumar

Hi,

Quoted 24 lines · Imre Deak

The crtc state starts out being bzero'd, so no need to clear scaler_users. Also intel_crtc_init_scalers() knows already which platforms have scalers, so no need for the platform check here. Similarly intel_crtc_init_scalers() will init scaler_id as required, so no need to do it here separately.

Cc Chandra Konduru <[email protected]>
Cc Matt Roper <[email protected]>
---
   drivers/gpu/drm/i915/intel_display.c | 7 +------
   1 file changed, 1 insertion(+), 6 deletions(-)
drivers/gpu/drm/i915/intel_display.c +0 -4
index 8a38e64b1931..7210f418e9c0 100644
@@ -9132,12 +9132,7 @@ static bool haswell_get_pipe_config(struct intel_crtc *crtc,
   	u64 power_domain_mask;
   	bool active;
-	if (INTEL_GEN(dev_priv) >= 9) {
-		intel_crtc_init_scalers(crtc, pipe_config);
-
-		pipe_config->scaler_state.scaler_id = -1;
Quoted 8 lines

drivers/gpu/drm/i915/intel_display.c static bool haswell_get_pipe_config(struct intel_crtc *crtc, · line 9135

Quoted 3 lines
drivers/gpu/drm/i915/intel_display.c +1 -2
-		pipe_config->scaler_state.scaler_users &= ~(1 << SKL_CRTC_INDEX);
-	}
+	intel_crtc_init_scalers(crtc, pipe_config);

If we are removing gen check, then IMHO we should initialize "scaler_id = -1" even before !crtc->num_scalers check in intel_crtc_init_scalers function, just to make sure scaler state doesn't have wrong value in platforms where we don't have any scalers.

I agree that setting scaler_id to -1 on all platforms is a good idea, but it's unrelated to removing here the GEN check. intel_crtc_init_scalers() is already called for all platforms in intel_crtc_init(). So this change won't make a difference for platforms without scalers: we leave scaler_id zeroed on those already now (they have num_scalers set to 0). This isn't either a problem since we allocate scalers only on GEN9+.

Quoted 5 lines
Quoted 1 line

So we could do what you suggest but imo as a follow-up.

sounds good, But if you are going to write a cleanup patch, will that be possible for you to do following change also. 0 indicates no scaler is used & non-zero +ve value indicates used scaler id.

That's one possibility, or we could just use a helper to initialize the intel specific part of the state; there could be other fields there with non-zero default values. This helper could be then used in the few places where this is done now (or done partially) open-coded.

Also patches are welcome, feel free to follow-up:)

Quoted 8 lines

in any case

-Mahesh

Quoted 2 lines

--Imre

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

author
#14 lore raw

Re: ✓ Fi.CI.BAT: success for series starting with [v2,1/2] drm/i915: Fix scaler init during CRTC HW state readout (rev2)

In reply to Patchwork
Quoted 10 lines · Patchwork

== Series Details ==

Series: series starting with [v2,1/2] drm/i915: Fix scaler init during CRTC HW state readout (rev2)
URL : https://patchwork.freedesktop.org/series/27607/
State : success

== Summary ==

Series 27607v2 Series without cover letter
https://patchwork.freedesktop.org/api/1.0/series/27607/revisions/2/mbox/

Thanks for the review, I pushed these to -dinq.

Quoted 37 lines

Test kms_cursor_legacy:

        Subgroup basic-busy-flip-before-cursor-atomic:
                fail       -> PASS       (fi-snb-2600) fdo#100215
Test kms_flip:
        Subgroup basic-flip-vs-modeset:
                pass       -> SKIP       (fi-skl-x1585l) fdo#101781

fdo#100215 https://bugs.freedesktop.org/show_bug.cgi?id=100215
fdo#101781 https://bugs.freedesktop.org/show_bug.cgi?id=101781

fi-bdw-5557u     total:279  pass:268  dwarn:0   dfail:0   fail:0   skip:11  time:442s
fi-bdw-gvtdvm    total:279  pass:265  dwarn:0   dfail:0   fail:0   skip:14  time:427s
fi-blb-e6850     total:279  pass:224  dwarn:1   dfail:0   fail:0   skip:54  time:350s
fi-bsw-n3050     total:279  pass:243  dwarn:0   dfail:0   fail:0   skip:36  time:540s
fi-bxt-j4205     total:279  pass:260  dwarn:0   dfail:0   fail:0   skip:19  time:513s
fi-byt-j1900     total:279  pass:254  dwarn:1   dfail:0   fail:0   skip:24  time:489s
fi-byt-n2820     total:279  pass:250  dwarn:1   dfail:0   fail:0   skip:28  time:482s
fi-glk-2a        total:279  pass:260  dwarn:0   dfail:0   fail:0   skip:19  time:598s
fi-hsw-4770      total:279  pass:263  dwarn:0   dfail:0   fail:0   skip:16  time:435s
fi-hsw-4770r     total:279  pass:263  dwarn:0   dfail:0   fail:0   skip:16  time:419s
fi-ilk-650       total:279  pass:229  dwarn:0   dfail:0   fail:0   skip:50  time:415s
fi-ivb-3520m     total:279  pass:261  dwarn:0   dfail:0   fail:0   skip:18  time:507s
fi-ivb-3770      total:279  pass:261  dwarn:0   dfail:0   fail:0   skip:18  time:476s
fi-kbl-7500u     total:279  pass:261  dwarn:0   dfail:0   fail:0   skip:18  time:466s
fi-kbl-7560u     total:279  pass:269  dwarn:0   dfail:0   fail:0   skip:10  time:574s
fi-kbl-r         total:279  pass:261  dwarn:0   dfail:0   fail:0   skip:18  time:586s
fi-pnv-d510      total:279  pass:222  dwarn:2   dfail:0   fail:0   skip:55  time:567s
fi-skl-6260u     total:279  pass:269  dwarn:0   dfail:0   fail:0   skip:10  time:459s
fi-skl-6700hq    total:279  pass:262  dwarn:0   dfail:0   fail:0   skip:17  time:584s
fi-skl-6700k     total:279  pass:261  dwarn:0   dfail:0   fail:0   skip:18  time:466s
fi-skl-6770hq    total:279  pass:269  dwarn:0   dfail:0   fail:0   skip:10  time:478s
fi-skl-gvtdvm    total:279  pass:266  dwarn:0   dfail:0   fail:0   skip:13  time:435s
fi-skl-x1585l    total:279  pass:268  dwarn:0   dfail:0   fail:0   skip:11  time:480s
fi-snb-2520m     total:279  pass:251  dwarn:0   dfail:0   fail:0   skip:28  time:544s
fi-snb-2600      total:279  pass:250  dwarn:0   dfail:0   fail:0   skip:29  time:403s
Quoted 7 lines

948c3bddb3333e7245970c684749ba5d72370cd2 drm-tip: 2017y-07m-20d-10h-52m-43s UTC integration manifest ad6c516 drm/i915: Simplify scaler init during CRTC HW readout
8915378 drm/i915: Fix scaler init during CRTC HW state readout

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_5246/

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