intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Avoid clearing the base drm_crtc_state
@ 2017-03-03 15:46 Chris Wilson
  2017-03-03 17:23 ` ✗ Fi.CI.BAT: failure for " Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Chris Wilson @ 2017-03-03 15:46 UTC (permalink / raw)
  To: intel-gfx

To prevent having to preserve the drm_crtc_state as we clear the
intel_crtc_state, only memset our extended state.

Fixes:
drivers/gpu/drm/i915/intel_display.c: In function ‘clear_intel_crtc_state’:
drivers/gpu/drm/i915/intel_display.c:11301:1: error: the frame size of 1056 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/intel_display.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index e6881a69a88f..cfab4d135af3 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -11269,7 +11269,6 @@ clear_intel_crtc_state(struct intel_crtc_state *crtc_state)
 {
 	struct drm_i915_private *dev_priv =
 		to_i915(crtc_state->base.crtc->dev);
-	struct drm_crtc_state tmp_state;
 	struct intel_crtc_scaler_state scaler_state;
 	struct intel_dpll_hw_state dpll_hw_state;
 	struct intel_shared_dpll *shared_dpll;
@@ -11281,7 +11280,6 @@ clear_intel_crtc_state(struct intel_crtc_state *crtc_state)
 	 * 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;
 	dpll_hw_state = crtc_state->dpll_hw_state;
@@ -11289,9 +11287,9 @@ clear_intel_crtc_state(struct intel_crtc_state *crtc_state)
 	if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv))
 		wm_state = crtc_state->wm;
 
-	memset(crtc_state, 0, sizeof *crtc_state);
+	memset(&crtc_state->base + 1, 0,
+	       sizeof(*crtc_state) - sizeof(crtc_state->base));
 
-	crtc_state->base = tmp_state;
 	crtc_state->scaler_state = scaler_state;
 	crtc_state->shared_dpll = shared_dpll;
 	crtc_state->dpll_hw_state = dpll_hw_state;
-- 
2.11.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* ✗ Fi.CI.BAT: failure for drm/i915: Avoid clearing the base drm_crtc_state
  2017-03-03 15:46 [PATCH] drm/i915: Avoid clearing the base drm_crtc_state Chris Wilson
@ 2017-03-03 17:23 ` Patchwork
  2017-03-03 20:18 ` ✓ Fi.CI.BAT: success " Patchwork
  2017-03-06 17:46 ` [PATCH] " Daniel Vetter
  2 siblings, 0 replies; 7+ messages in thread
From: Patchwork @ 2017-03-03 17:23 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Avoid clearing the base drm_crtc_state
URL   : https://patchwork.freedesktop.org/series/20635/
State : failure

== Summary ==

Series 20635v1 drm/i915: Avoid clearing the base drm_crtc_state
https://patchwork.freedesktop.org/api/1.0/series/20635/revisions/1/mbox/

Test gem_exec_basic:
        Subgroup gtt-render:
                pass       -> INCOMPLETE (fi-byt-j1900)
Test gem_exec_flush:
        Subgroup basic-batch-kernel-default-uc:
                pass       -> FAIL       (fi-snb-2600) fdo#100007

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

fi-bdw-5557u     total:278  pass:267  dwarn:0   dfail:0   fail:0   skip:11 
fi-bsw-n3050     total:278  pass:239  dwarn:0   dfail:0   fail:0   skip:39 
fi-bxt-j4205     total:278  pass:259  dwarn:0   dfail:0   fail:0   skip:19 
fi-bxt-t5700     total:278  pass:258  dwarn:0   dfail:0   fail:0   skip:20 
fi-byt-j1900     total:35   pass:29   dwarn:0   dfail:0   fail:0   skip:5  
fi-byt-n2820     total:278  pass:247  dwarn:0   dfail:0   fail:0   skip:31 
fi-hsw-4770      total:278  pass:262  dwarn:0   dfail:0   fail:0   skip:16 
fi-hsw-4770r     total:278  pass:262  dwarn:0   dfail:0   fail:0   skip:16 
fi-ilk-650       total:278  pass:228  dwarn:0   dfail:0   fail:0   skip:50 
fi-ivb-3520m     total:278  pass:260  dwarn:0   dfail:0   fail:0   skip:18 
fi-ivb-3770      total:278  pass:260  dwarn:0   dfail:0   fail:0   skip:18 
fi-kbl-7500u     total:278  pass:259  dwarn:1   dfail:0   fail:0   skip:18 
fi-skl-6260u     total:278  pass:268  dwarn:0   dfail:0   fail:0   skip:10 
fi-skl-6700hq    total:278  pass:261  dwarn:0   dfail:0   fail:0   skip:17 
fi-skl-6700k     total:278  pass:256  dwarn:4   dfail:0   fail:0   skip:18 
fi-skl-6770hq    total:278  pass:268  dwarn:0   dfail:0   fail:0   skip:10 
fi-snb-2520m     total:278  pass:250  dwarn:0   dfail:0   fail:0   skip:28 
fi-snb-2600      total:278  pass:248  dwarn:0   dfail:0   fail:1   skip:29 

1d7915e7823628a0d548c6ecc5ad5b9a4ae4a6ff drm-tip: 2017y-03m-03d-15h-54m-06s UTC integration manifest
ce61b1a drm/i915: Avoid clearing the base drm_crtc_state

== Logs ==

For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_4057/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 7+ messages in thread

* ✓ Fi.CI.BAT: success for drm/i915: Avoid clearing the base drm_crtc_state
  2017-03-03 15:46 [PATCH] drm/i915: Avoid clearing the base drm_crtc_state Chris Wilson
  2017-03-03 17:23 ` ✗ Fi.CI.BAT: failure for " Patchwork
@ 2017-03-03 20:18 ` Patchwork
  2017-03-06 17:46 ` [PATCH] " Daniel Vetter
  2 siblings, 0 replies; 7+ messages in thread
From: Patchwork @ 2017-03-03 20:18 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Avoid clearing the base drm_crtc_state
URL   : https://patchwork.freedesktop.org/series/20635/
State : success

== Summary ==

Series 20635v1 drm/i915: Avoid clearing the base drm_crtc_state
https://patchwork.freedesktop.org/api/1.0/series/20635/revisions/1/mbox/

Test kms_pipe_crc_basic:
        Subgroup hang-read-crc-pipe-a:
                dmesg-fail -> PASS       (fi-ivb-3770)
        Subgroup hang-read-crc-pipe-b:
                incomplete -> PASS       (fi-ivb-3770)

fi-bdw-5557u     total:278  pass:267  dwarn:0   dfail:0   fail:0   skip:11 
fi-bsw-n3050     total:278  pass:239  dwarn:0   dfail:0   fail:0   skip:39 
fi-bxt-j4205     total:278  pass:259  dwarn:0   dfail:0   fail:0   skip:19 
fi-bxt-t5700     total:278  pass:258  dwarn:0   dfail:0   fail:0   skip:20 
fi-byt-j1900     total:278  pass:251  dwarn:0   dfail:0   fail:0   skip:27 
fi-byt-n2820     total:278  pass:247  dwarn:0   dfail:0   fail:0   skip:31 
fi-hsw-4770      total:278  pass:262  dwarn:0   dfail:0   fail:0   skip:16 
fi-hsw-4770r     total:278  pass:262  dwarn:0   dfail:0   fail:0   skip:16 
fi-ilk-650       total:278  pass:228  dwarn:0   dfail:0   fail:0   skip:50 
fi-ivb-3520m     total:278  pass:260  dwarn:0   dfail:0   fail:0   skip:18 
fi-ivb-3770      total:278  pass:260  dwarn:0   dfail:0   fail:0   skip:18 
fi-kbl-7500u     total:278  pass:259  dwarn:1   dfail:0   fail:0   skip:18 
fi-skl-6260u     total:278  pass:268  dwarn:0   dfail:0   fail:0   skip:10 
fi-skl-6700hq    total:278  pass:261  dwarn:0   dfail:0   fail:0   skip:17 
fi-skl-6700k     total:278  pass:256  dwarn:4   dfail:0   fail:0   skip:18 
fi-skl-6770hq    total:278  pass:268  dwarn:0   dfail:0   fail:0   skip:10 
fi-snb-2520m     total:278  pass:250  dwarn:0   dfail:0   fail:0   skip:28 
fi-snb-2600      total:278  pass:249  dwarn:0   dfail:0   fail:0   skip:29 

28b9323ecab32009497a95444b2ec35c274c97e8 drm-tip: 2017y-03m-03d-18h-32m-47s UTC integration manifest
0d9f470 drm/i915: Avoid clearing the base drm_crtc_state

== Logs ==

For more details see: https://intel-gfx-ci.01.org/CI/Patchwork_4062/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] drm/i915: Avoid clearing the base drm_crtc_state
  2017-03-03 15:46 [PATCH] drm/i915: Avoid clearing the base drm_crtc_state Chris Wilson
  2017-03-03 17:23 ` ✗ Fi.CI.BAT: failure for " Patchwork
  2017-03-03 20:18 ` ✓ Fi.CI.BAT: success " Patchwork
@ 2017-03-06 17:46 ` Daniel Vetter
  2017-03-06 21:05   ` Chris Wilson
  2017-03-07 12:49   ` Chris Wilson
  2 siblings, 2 replies; 7+ messages in thread
From: Daniel Vetter @ 2017-03-06 17:46 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

On Fri, Mar 03, 2017 at 03:46:44PM +0000, Chris Wilson wrote:
> To prevent having to preserve the drm_crtc_state as we clear the
> intel_crtc_state, only memset our extended state.
> 
> Fixes:
> drivers/gpu/drm/i915/intel_display.c: In function ‘clear_intel_crtc_state’:
> drivers/gpu/drm/i915/intel_display.c:11301:1: error: the frame size of 1056 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>  drivers/gpu/drm/i915/intel_display.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index e6881a69a88f..cfab4d135af3 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -11269,7 +11269,6 @@ clear_intel_crtc_state(struct intel_crtc_state *crtc_state)
>  {
>  	struct drm_i915_private *dev_priv =
>  		to_i915(crtc_state->base.crtc->dev);
> -	struct drm_crtc_state tmp_state;
>  	struct intel_crtc_scaler_state scaler_state;
>  	struct intel_dpll_hw_state dpll_hw_state;
>  	struct intel_shared_dpll *shared_dpll;
> @@ -11281,7 +11280,6 @@ clear_intel_crtc_state(struct intel_crtc_state *crtc_state)
>  	 * 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;
>  	dpll_hw_state = crtc_state->dpll_hw_state;
> @@ -11289,9 +11287,9 @@ clear_intel_crtc_state(struct intel_crtc_state *crtc_state)
>  	if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv))
>  		wm_state = crtc_state->wm;
>  
> -	memset(crtc_state, 0, sizeof *crtc_state);
> +	memset(&crtc_state->base + 1, 0,
> +	       sizeof(*crtc_state) - sizeof(crtc_state->base));

Maybe add a comment like /* Only clear our part of the overall struct. */
or similar, since this is not entirely obvious what's going on. Also

	COMPILE_BUG_ON(offsetof(struct intel_crtc_state, base) != 0);

maybe? Anyway, I'll let you decide on both, either way:

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
>  
> -	crtc_state->base = tmp_state;
>  	crtc_state->scaler_state = scaler_state;
>  	crtc_state->shared_dpll = shared_dpll;
>  	crtc_state->dpll_hw_state = dpll_hw_state;
> -- 
> 2.11.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://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
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] drm/i915: Avoid clearing the base drm_crtc_state
  2017-03-06 17:46 ` [PATCH] " Daniel Vetter
@ 2017-03-06 21:05   ` Chris Wilson
  2017-03-07 13:00     ` Ville Syrjälä
  2017-03-07 12:49   ` Chris Wilson
  1 sibling, 1 reply; 7+ messages in thread
From: Chris Wilson @ 2017-03-06 21:05 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: intel-gfx

On Mon, Mar 06, 2017 at 06:46:16PM +0100, Daniel Vetter wrote:
> On Fri, Mar 03, 2017 at 03:46:44PM +0000, Chris Wilson wrote:
> > @@ -11289,9 +11287,9 @@ clear_intel_crtc_state(struct intel_crtc_state *crtc_state)
> >  	if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv))
> >  		wm_state = crtc_state->wm;
> >  
> > -	memset(crtc_state, 0, sizeof *crtc_state);
> > +	memset(&crtc_state->base + 1, 0,
> > +	       sizeof(*crtc_state) - sizeof(crtc_state->base));
> 
> Maybe add a comment like /* Only clear our part of the overall struct. */
> or similar, since this is not entirely obvious what's going on. Also
> 
> 	COMPILE_BUG_ON(offsetof(struct intel_crtc_state, base) != 0);
> 
> maybe? Anyway, I'll let you decide on both, either way:

I thought we had the BUILD_BUG_ON already -- the NULL correspondance is
widely used. I did one version with it, then thought that it would be
better in to_intel_crtc_state() and so left it out.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] drm/i915: Avoid clearing the base drm_crtc_state
  2017-03-06 17:46 ` [PATCH] " Daniel Vetter
  2017-03-06 21:05   ` Chris Wilson
@ 2017-03-07 12:49   ` Chris Wilson
  1 sibling, 0 replies; 7+ messages in thread
From: Chris Wilson @ 2017-03-07 12:49 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: intel-gfx

On Mon, Mar 06, 2017 at 06:46:16PM +0100, Daniel Vetter wrote:
> On Fri, Mar 03, 2017 at 03:46:44PM +0000, Chris Wilson wrote:
> > To prevent having to preserve the drm_crtc_state as we clear the
> > intel_crtc_state, only memset our extended state.
> > 
> > Fixes:
> > drivers/gpu/drm/i915/intel_display.c: In function ‘clear_intel_crtc_state’:
> > drivers/gpu/drm/i915/intel_display.c:11301:1: error: the frame size of 1056 bytes is larger than 1024 bytes [-Werror=frame-larger-than=]
> > 
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > ---
> >  drivers/gpu/drm/i915/intel_display.c | 6 ++----
> >  1 file changed, 2 insertions(+), 4 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > index e6881a69a88f..cfab4d135af3 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -11269,7 +11269,6 @@ clear_intel_crtc_state(struct intel_crtc_state *crtc_state)
> >  {
> >  	struct drm_i915_private *dev_priv =
> >  		to_i915(crtc_state->base.crtc->dev);
> > -	struct drm_crtc_state tmp_state;
> >  	struct intel_crtc_scaler_state scaler_state;
> >  	struct intel_dpll_hw_state dpll_hw_state;
> >  	struct intel_shared_dpll *shared_dpll;
> > @@ -11281,7 +11280,6 @@ clear_intel_crtc_state(struct intel_crtc_state *crtc_state)
> >  	 * 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;
> >  	dpll_hw_state = crtc_state->dpll_hw_state;
> > @@ -11289,9 +11287,9 @@ clear_intel_crtc_state(struct intel_crtc_state *crtc_state)
> >  	if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv))
> >  		wm_state = crtc_state->wm;
> >  
> > -	memset(crtc_state, 0, sizeof *crtc_state);
> > +	memset(&crtc_state->base + 1, 0,
> > +	       sizeof(*crtc_state) - sizeof(crtc_state->base));
> 
> Maybe add a comment like /* Only clear our part of the overall struct. */
> or similar, since this is not entirely obvious what's going on. Also
> 
> 	COMPILE_BUG_ON(offsetof(struct intel_crtc_state, base) != 0);
> 
> maybe? Anyway, I'll let you decide on both, either way:
> 
> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

Did both and pushed. Thanks, a few of my machines were tripping over
this which is a bit puzzling as to how they have different values for
the stack warning.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] drm/i915: Avoid clearing the base drm_crtc_state
  2017-03-06 21:05   ` Chris Wilson
@ 2017-03-07 13:00     ` Ville Syrjälä
  0 siblings, 0 replies; 7+ messages in thread
From: Ville Syrjälä @ 2017-03-07 13:00 UTC (permalink / raw)
  To: Chris Wilson, Daniel Vetter, intel-gfx

On Mon, Mar 06, 2017 at 09:05:47PM +0000, Chris Wilson wrote:
> On Mon, Mar 06, 2017 at 06:46:16PM +0100, Daniel Vetter wrote:
> > On Fri, Mar 03, 2017 at 03:46:44PM +0000, Chris Wilson wrote:
> > > @@ -11289,9 +11287,9 @@ clear_intel_crtc_state(struct intel_crtc_state *crtc_state)
> > >  	if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv))
> > >  		wm_state = crtc_state->wm;
> > >  
> > > -	memset(crtc_state, 0, sizeof *crtc_state);
> > > +	memset(&crtc_state->base + 1, 0,
> > > +	       sizeof(*crtc_state) - sizeof(crtc_state->base));
> > 
> > Maybe add a comment like /* Only clear our part of the overall struct. */
> > or similar, since this is not entirely obvious what's going on. Also
> > 
> > 	COMPILE_BUG_ON(offsetof(struct intel_crtc_state, base) != 0);
> > 
> > maybe? Anyway, I'll let you decide on both, either way:
> 
> I thought we had the BUILD_BUG_ON already -- the NULL correspondance is
> widely used. I did one version with it, then thought that it would be
> better in to_intel_crtc_state() and so left it out.

I posted a patch for that once but I never finished it. In the end I was
even thinking of having both const and non-const to_foo() macros.

If someone wants to continue my work I pushed it here:
git://github.com/vsyrjala/linux.git kms_obj_base_0_2

-- 
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-03-07 13:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-03 15:46 [PATCH] drm/i915: Avoid clearing the base drm_crtc_state Chris Wilson
2017-03-03 17:23 ` ✗ Fi.CI.BAT: failure for " Patchwork
2017-03-03 20:18 ` ✓ Fi.CI.BAT: success " Patchwork
2017-03-06 17:46 ` [PATCH] " Daniel Vetter
2017-03-06 21:05   ` Chris Wilson
2017-03-07 13:00     ` Ville Syrjälä
2017-03-07 12:49   ` Chris Wilson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).