All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>,
	Daniel Vetter <daniel@ffwll.ch>,
	intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Avoid clearing the base drm_crtc_state
Date: Tue, 7 Mar 2017 15:00:27 +0200	[thread overview]
Message-ID: <20170307130027.GW31595@intel.com> (raw)
In-Reply-To: <20170306210547.GI3201@nuc-i3427.alporthouse.com>

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

  reply	other threads:[~2017-03-07 13:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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ä [this message]
2017-03-07 12:49   ` Chris Wilson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170307130027.GW31595@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=daniel@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.