drm/i915: Preserve ddi_pll_sel when allocating new pipe_config
Subsystems (2)
PATCH 1/1 drm/i915: Preserve ddi_pll_sel when allocating new pipe_config
When the modeset code is reached with a CRTC that only needs a flip, the code that assigns PLLs is skipped. But since there is still a state swap for that CRTC, the current PLL assignment needs to be preserved. I missed the ddi_pll_sel field in the following commit, which causes warnings in DDI platforms.
commit 4978cc93d9ac240b435ce60431aef24239b4c270
Author: Ander Conselvan de Oliveira <[email protected]> Date: Tue Apr 21 17:13:21 2015 +0300
drm/i915: Preserve shared DPLL information in new pipe_config
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90410
--- drivers/gpu/drm/i915/intel_display.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/i915/intel_display.c +3 -0
@@ -11452,12 +11452,14 @@ clear_intel_crtc_state(struct intel_crtc_state *crtc_state)struct intel_crtc_scaler_state scaler_state;struct intel_dpll_hw_state dpll_hw_state;enum intel_dpll_id shared_dpll; +uint32_t ddi_pll_sel;/* Clear only the intel specific part of the crtc state excluding scalers */ tmp_state = crtc_state->base; scaler_state = crtc_state->scaler_state; shared_dpll = crtc_state->shared_dpll; dpll_hw_state = crtc_state->dpll_hw_state; + ddi_pll_sel = crtc_state->ddi_pll_sel;memset (crtc_state,0 ,sizeof *crtc_state);
@@ -11465,6 +11467,7 @@ clear_intel_crtc_state(struct intel_crtc_state *crtc_state) crtc_state->scaler_state = scaler_state; crtc_state->shared_dpll = shared_dpll; crtc_state->dpll_hw_state = dpll_hw_state; + crtc_state->ddi_pll_sel = ddi_pll_sel; } static int
Signature · 6 lines
2.1.0 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 6 lines · Ander Conselvan de Oliveira
When the modeset code is reached with a CRTC that only needs a flip, the code that assigns PLLs is skipped. But since there is still a state swap for that CRTC, the current PLL assignment needs to be preserved. I missed the
ddi_pll_selfield in the following commit, which causes warnings in DDI platforms.
Quoted 8 lines
commit
4978cc93d9ac240b435ce60431aef24239b4c270Author: Ander Conselvan de Oliveira <[email protected]> Date: Tue Apr 21 17:13:21 2015 +0300drm/i915: Preserve shared DPLL information in new
pipe_configBugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90410
Signed-off-by Ander Conselvan de Oliveira <[email protected]>
(it's probably be good to update the comment with the reason *why* we preserve some state (both the base states and some of the intel states, not that we actually do so, it's easy to figure that part from the code, typical a++; /* increment a */ comment :)
Signature · 1 line
Damien
Quoted 38 lines
--- drivers/gpu/drm/i915/intel_display.c | 3 +++ 1 file changed, 3 insertions(+)drivers/gpu/drm/i915/intel_display.c +3
-0@@ -11452,12 +11452,14 @@ clear_intel_crtc_state(struct intel_crtc_state *crtc_state)struct intel_crtc_scaler_state scaler_state;struct intel_dpll_hw_state dpll_hw_state;enum intel_dpll_id shared_dpll; +uint32_t ddi_pll_sel;/* Clear only the intel specific part of the crtc state excluding scalers */ tmp_state = crtc_state->base; scaler_state = crtc_state->scaler_state; shared_dpll = crtc_state->shared_dpll; dpll_hw_state = crtc_state->dpll_hw_state; + ddi_pll_sel = crtc_state->ddi_pll_sel;memset (crtc_state,0 ,sizeof *crtc_state);@@ -11465,6 +11467,7 @@ clear_intel_crtc_state(struct intel_crtc_state *crtc_state) crtc_state->scaler_state = scaler_state; crtc_state->shared_dpll = shared_dpll; crtc_state->dpll_hw_state = dpll_hw_state; + crtc_state->ddi_pll_sel = ddi_pll_sel; } static intSignature · 6 lines
2.1.0 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 1/1 drm/i915: Update comment in clear_intel_crtc_state()
Explain why a few fields of the new pipe_config have their values preserved, while the others are zeroed.
--- drivers/gpu/drm/i915/intel_display.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_display.c +5 -1
@@ -11460,7 +11460,11 @@ clear_intel_crtc_state(struct intel_crtc_state *crtc_state)enum intel_dpll_id shared_dpll;uint32_t ddi_pll_sel; -/* Clear only the intel specific part of the crtc state excluding scalers */ +/* FIXME: before the switch to atomic started, a new pipe_config was +* kzalloc'd. Code that depends on any field being zero should be +* fixed, so that the crtc_state can be safely duplicated. For now, +* only fields that are know to not cause problems are preserved. */ + tmp_state = crtc_state->base; scaler_state = crtc_state->scaler_state; shared_dpll = crtc_state->shared_dpll;
Signature · 6 lines
2.1.0 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Daniel Vetter
AppliedRe: [PATCH] drm/i915: Update comment in clear_intel_crtc_state()
Quoted 4 lines · Ander Conselvan de Oliveira
Explain why a few fields of the new
pipe_confighave their values preserved, while the others are zeroed.Signed-off-by Ander Conselvan de Oliveira <[email protected]>
Queued for -next, thanks for the patch.
-Daniel
Quoted 28 lines
--- drivers/gpu/drm/i915/intel_display.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)drivers/gpu/drm/i915/intel_display.c +5
-1@@ -11460,7 +11460,11 @@ clear_intel_crtc_state(struct intel_crtc_state *crtc_state)enum intel_dpll_id shared_dpll;uint32_t ddi_pll_sel; -/* Clear only the intel specific part of the crtc state excluding scalers */ +/* FIXME: before the switch to atomic started, a new pipe_config was +* kzalloc'd. Code that depends on any field being zero should be +* fixed, so that the crtc_state can be safely duplicated. For now, +* only fields that are know to not cause problems are preserved. */ + tmp_state = crtc_state->base; scaler_state = crtc_state->scaler_state; shared_dpll = crtc_state->shared_dpll;Signature · 6 lines
2.1.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
Jani Nikula
maintainerRe: [PATCH] drm/i915: Update comment in clear_intel_crtc_state()
In reply to Ander Conselvan de OliveiraQuoted 13 lines · Ander Conselvan de Oliveira
Explain why a few fields of the new
pipe_confighave their values preserved, while the others are zeroed.Signed-off-by Ander Conselvan de Oliveira <[email protected]>--- drivers/gpu/drm/i915/intel_display.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)drivers/gpu/drm/i915/intel_display.c +0
-0
drivers/gpu/drm/i915/intel_display.c clear_intel_crtc_state(struct intel_crtc_state *crtc_state) · line 11467
Quoted 9 lines
drivers/gpu/drm/i915/intel_display.c +5
-1@@ -11460,7 +11460,11 @@ clear_intel_crtc_state(struct intel_crtc_state *crtc_state)enum intel_dpll_id shared_dpll;uint32_t ddi_pll_sel; -/* Clear only the intel specific part of the crtc state excluding scalers */ +/* FIXME: before the switch to atomic started, a new pipe_config was +* kzalloc'd. Code that depends on any field being zero should be +* fixed, so that the crtc_state can be safely duplicated. For now, +* only fields that are know to not cause problems are preserved. */ +
Nitpick, the opening /* and at least the closing */ should be on their own lines.
Quoted 10 lines
drivers/gpu/drm/i915/intel_display.c +0
-0tmp_state = crtc_state->base; scaler_state = crtc_state->scaler_state; shared_dpll = crtc_state->shared_dpll;Signature · 6 lines
2.1.0 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH] drm/i915: Update comment in clear_intel_crtc_state()
Quoted 17 lines · Jani Nikula
Quoted 16 lines · Ander Conselvan de Oliveira
Explain why a few fields of the new
pipe_confighave their values preserved, while the others are zeroed.Signed-off-by Ander Conselvan de Oliveira <[email protected]>--- drivers/gpu/drm/i915/intel_display.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)drivers/gpu/drm/i915/intel_display.c +0
-0@@ -11460,7 +11460,11 @@ clear_intel_crtc_state(struct intel_crtc_state *crtc_state)enum intel_dpll_id shared_dpll;uint32_t ddi_pll_sel;
Quoted 9 lines
drivers/gpu/drm/i915/intel_display.c clear_intel_crtc_state(struct intel_crtc_state *crtc_state) · line 11467
Quoted 6 lines
drivers/gpu/drm/i915/intel_display.c +5
-1-/* Clear only the intel specific part of the crtc state excluding scalers */ +/* FIXME: before the switch to atomic started, a new pipe_config was +* kzalloc'd. Code that depends on any field being zero should be +* fixed, so that the crtc_state can be safely duplicated. For now, +* only fields that are know to not cause problems are preserved. */ +Nitpick, the opening /* and at least the closing */ should be on their own lines.
I've seen a mix of both styles through-out the driver, so it wasn't clear to me that's preferred. I'll follow that from now on.
Thanks,
Ander
Quoted 7 lines
Quoted 7 lines
drivers/gpu/drm/i915/intel_display.c +0
-0tmp_state = crtc_state->base; scaler_state = crtc_state->scaler_state; shared_dpll = crtc_state->shared_dpll;Signature · 1 line
2.1.0
Quoted 5 lines
Quoted 4 lines
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH] drm/i915: Update comment in clear_intel_crtc_state()
Quoted 28 lines · Ander Conselvan De Oliveira
Quoted 17 lines · Jani Nikula
Quoted 16 lines · Ander Conselvan de Oliveira
Explain why a few fields of the new
pipe_confighave their values preserved, while the others are zeroed.Signed-off-by Ander Conselvan de Oliveira <[email protected]>--- drivers/gpu/drm/i915/intel_display.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)drivers/gpu/drm/i915/intel_display.c +0
-0@@ -11460,7 +11460,11 @@ clear_intel_crtc_state(struct intel_crtc_state *crtc_state)enum intel_dpll_id shared_dpll;uint32_t ddi_pll_sel;Quoted 9 lines
drivers/gpu/drm/i915/intel_display.c clear_intel_crtc_state(struct intel_crtc_state *crtc_state) · line 11467
Quoted 6 lines
drivers/gpu/drm/i915/intel_display.c +5
-1-/* Clear only the intel specific part of the crtc state excluding scalers */ +/* FIXME: before the switch to atomic started, a new pipe_config was +* kzalloc'd. Code that depends on any field being zero should be +* fixed, so that the crtc_state can be safely duplicated. For now, +* only fields that are know to not cause problems are preserved. */ +Nitpick, the opening /* and at least the closing */ should be on their own lines.
Quoted 2 lines
I've seen a mix of both styles through-out the driver, so it wasn't clear to me that's preferred. I'll follow that from now on.
Yeah i915 isn't consistent about this at all. Whatever floats the boat applies here ;-)
-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
Task id: 6415 -------------------------------------Summary-------------------------------------
Platform Delta drm-intel-nightly Series Applied
PNV 276/276 276/276 ILK 283/283 283/283 SNB -1 314/314 313/314 IVB 338/338 338/338 BYT 286/286 286/286 BDW 320/320 320/320
-------------------------------------Detailed-------------------------------------
Platform Test drm-intel-nightly Series Applied
SNB igt@pm_rpm@dpms-mode-unset-non-lpsp DMESG_WARN(14)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