* [PATCH] drm/i915: Preserve ddi_pll_sel when allocating new pipe_config
@ 2015-05-15 8:51 Ander Conselvan de Oliveira
2015-05-15 13:28 ` Damien Lespiau
2015-05-18 5:06 ` [PATCH] drm/i915: Preserve ddi_pll_sel when allocating new pipe_config shuang.he
0 siblings, 2 replies; 8+ messages in thread
From: Ander Conselvan de Oliveira @ 2015-05-15 8:51 UTC (permalink / raw)
To: intel-gfx; +Cc: 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_sel field in the following commit, which causes
warnings in DDI platforms.
commit 4978cc93d9ac240b435ce60431aef24239b4c270
Author: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
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
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
---
drivers/gpu/drm/i915/intel_display.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index b580640..8d40d7d 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -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
--
2.1.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] drm/i915: Preserve ddi_pll_sel when allocating new pipe_config
2015-05-15 8:51 [PATCH] drm/i915: Preserve ddi_pll_sel when allocating new pipe_config Ander Conselvan de Oliveira
@ 2015-05-15 13:28 ` Damien Lespiau
2015-05-20 6:03 ` [PATCH] drm/i915: Update comment in clear_intel_crtc_state() Ander Conselvan de Oliveira
2015-05-18 5:06 ` [PATCH] drm/i915: Preserve ddi_pll_sel when allocating new pipe_config shuang.he
1 sibling, 1 reply; 8+ messages in thread
From: Damien Lespiau @ 2015-05-15 13:28 UTC (permalink / raw)
To: Ander Conselvan de Oliveira; +Cc: intel-gfx
On Fri, May 15, 2015 at 11:51:50AM +0300, Ander Conselvan de Oliveira wrote:
> 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 <ander.conselvan.de.oliveira@intel.com>
> 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
> Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>
(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 :)
--
Damien
> ---
> drivers/gpu/drm/i915/intel_display.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index b580640..8d40d7d 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -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
> --
> 2.1.0
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] drm/i915: Preserve ddi_pll_sel when allocating new pipe_config
2015-05-15 8:51 [PATCH] drm/i915: Preserve ddi_pll_sel when allocating new pipe_config Ander Conselvan de Oliveira
2015-05-15 13:28 ` Damien Lespiau
@ 2015-05-18 5:06 ` shuang.he
1 sibling, 0 replies; 8+ messages in thread
From: shuang.he @ 2015-05-18 5:06 UTC (permalink / raw)
To: shuang.he, lei.a.liu, intel-gfx, ander.conselvan.de.oliveira
Tested-By: Intel Graphics QA PRTS (Patch Regression Test System Contact: shuang.he@intel.com)
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
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH] drm/i915: Update comment in clear_intel_crtc_state()
2015-05-15 13:28 ` Damien Lespiau
@ 2015-05-20 6:03 ` Ander Conselvan de Oliveira
2015-05-20 7:33 ` Daniel Vetter
2015-05-20 7:37 ` Jani Nikula
0 siblings, 2 replies; 8+ messages in thread
From: Ander Conselvan de Oliveira @ 2015-05-20 6:03 UTC (permalink / raw)
To: damien.lespiau; +Cc: Ander Conselvan de Oliveira, intel-gfx
Explain why a few fields of the new pipe_config have their values
preserved, while the others are zeroed.
Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
---
drivers/gpu/drm/i915/intel_display.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index a7732b4..b0cd649 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -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;
--
2.1.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] drm/i915: Update comment in clear_intel_crtc_state()
2015-05-20 6:03 ` [PATCH] drm/i915: Update comment in clear_intel_crtc_state() Ander Conselvan de Oliveira
@ 2015-05-20 7:33 ` Daniel Vetter
2015-05-20 7:37 ` Jani Nikula
1 sibling, 0 replies; 8+ messages in thread
From: Daniel Vetter @ 2015-05-20 7:33 UTC (permalink / raw)
To: Ander Conselvan de Oliveira; +Cc: intel-gfx
On Wed, May 20, 2015 at 09:03:27AM +0300, Ander Conselvan de Oliveira wrote:
> Explain why a few fields of the new pipe_config have their values
> preserved, while the others are zeroed.
>
> Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Queued for -next, thanks for the patch.
-Daniel
> ---
> drivers/gpu/drm/i915/intel_display.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index a7732b4..b0cd649 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -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;
> --
> 2.1.0
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] drm/i915: Update comment in clear_intel_crtc_state()
2015-05-20 6:03 ` [PATCH] drm/i915: Update comment in clear_intel_crtc_state() Ander Conselvan de Oliveira
2015-05-20 7:33 ` Daniel Vetter
@ 2015-05-20 7:37 ` Jani Nikula
2015-05-20 7:43 ` Ander Conselvan De Oliveira
1 sibling, 1 reply; 8+ messages in thread
From: Jani Nikula @ 2015-05-20 7:37 UTC (permalink / raw)
To: damien.lespiau; +Cc: Ander Conselvan de Oliveira, intel-gfx
On Wed, 20 May 2015, Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com> wrote:
> Explain why a few fields of the new pipe_config have their values
> preserved, while the others are zeroed.
>
> Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
> ---
> drivers/gpu/drm/i915/intel_display.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index a7732b4..b0cd649 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -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.
> tmp_state = crtc_state->base;
> scaler_state = crtc_state->scaler_state;
> shared_dpll = crtc_state->shared_dpll;
> --
> 2.1.0
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] drm/i915: Update comment in clear_intel_crtc_state()
2015-05-20 7:37 ` Jani Nikula
@ 2015-05-20 7:43 ` Ander Conselvan De Oliveira
2015-05-20 7:47 ` Daniel Vetter
0 siblings, 1 reply; 8+ messages in thread
From: Ander Conselvan De Oliveira @ 2015-05-20 7:43 UTC (permalink / raw)
To: Jani Nikula; +Cc: intel-gfx
On Wed, 2015-05-20 at 10:37 +0300, Jani Nikula wrote:
> On Wed, 20 May 2015, Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com> wrote:
> > Explain why a few fields of the new pipe_config have their values
> > preserved, while the others are zeroed.
> >
> > Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
> > ---
> > drivers/gpu/drm/i915/intel_display.c | 6 +++++-
> > 1 file changed, 5 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > index a7732b4..b0cd649 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -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.
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
>
> > tmp_state = crtc_state->base;
> > scaler_state = crtc_state->scaler_state;
> > shared_dpll = crtc_state->shared_dpll;
> > --
> > 2.1.0
> >
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/intel-gfx
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] drm/i915: Update comment in clear_intel_crtc_state()
2015-05-20 7:43 ` Ander Conselvan De Oliveira
@ 2015-05-20 7:47 ` Daniel Vetter
0 siblings, 0 replies; 8+ messages in thread
From: Daniel Vetter @ 2015-05-20 7:47 UTC (permalink / raw)
To: Ander Conselvan De Oliveira; +Cc: intel-gfx
On Wed, May 20, 2015 at 10:43:20AM +0300, Ander Conselvan De Oliveira wrote:
> On Wed, 2015-05-20 at 10:37 +0300, Jani Nikula wrote:
> > On Wed, 20 May 2015, Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com> wrote:
> > > Explain why a few fields of the new pipe_config have their values
> > > preserved, while the others are zeroed.
> > >
> > > Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
> > > ---
> > > drivers/gpu/drm/i915/intel_display.c | 6 +++++-
> > > 1 file changed, 5 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > > index a7732b4..b0cd649 100644
> > > --- a/drivers/gpu/drm/i915/intel_display.c
> > > +++ b/drivers/gpu/drm/i915/intel_display.c
> > > @@ -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.
>
> 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
--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2015-05-20 7:45 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-15 8:51 [PATCH] drm/i915: Preserve ddi_pll_sel when allocating new pipe_config Ander Conselvan de Oliveira
2015-05-15 13:28 ` Damien Lespiau
2015-05-20 6:03 ` [PATCH] drm/i915: Update comment in clear_intel_crtc_state() Ander Conselvan de Oliveira
2015-05-20 7:33 ` Daniel Vetter
2015-05-20 7:37 ` Jani Nikula
2015-05-20 7:43 ` Ander Conselvan De Oliveira
2015-05-20 7:47 ` Daniel Vetter
2015-05-18 5:06 ` [PATCH] drm/i915: Preserve ddi_pll_sel when allocating new pipe_config shuang.he
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox