[Intel-gfx] [PATCH 2/8] drm/i915: Make the intel_device_info structure kept in dev_priv writable

Daniel Vetter daniel at ffwll.ch
Mon Feb 10 17:54:18 CET 2014


On Mon, Feb 10, 2014 at 04:17:10PM +0200, Ville Syrjälä wrote:
> On Mon, Feb 10, 2014 at 02:06:16PM +0000, Damien Lespiau wrote:
> > On Mon, Feb 10, 2014 at 02:53:29PM +0200, Ville Syrjälä wrote:
> > > > Since every access should now go through the macro I think it'd be good to
> > > > give this a __ prefix to make it clear that users better think twice
> > > > before using it. Maybe as a patch on top of all this?
> > > 
> > > No. Everyone having to use the macro was a requirement of the v2 patch.
> > > With v3 that requirement was lifted since the const is right there on
> > > the struct itself. I think that was the whole point of v3.
> > 
> > The "everyone should now go through the macro" is not for the const.
> > There's a new idea floating around to replace the macros by hardcoded
> > values to be able to compile the driver for a specific platform and use
> > the compiler dead code elimiation pass(es) to reduce the text size.
> > 
> > There may be more cunning ways to reduce the driver size, haven't
> > thought much about it.
> 
> One easy thing to do would be just dropping the unused output types
> from the driver when doing the special build. I'd be surprised if
> the compiler is smart enough to figure that stuff out with the
> function pointer indirections we do there. Not sure how much we'd
> save though.

It is (mostly) smart enough to rip it all out. But for completely unclear
reasons (at least to me) it doesn't do the right thing with ripping out
dead code from intel_setup_outputs, so you have to help it out with the
occasionaly && 0. Even thought the INTEL_INFO check hardcodes to the
same ... But maybe I've missed something.

The big problem is the lack of lto - I've done these experiments by
including all our .c files into one big thing. Compile time went through
the roof a bit ;-)

> Or just make kernel memory swappable ;)

*shudder*

Cheers, Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch



More information about the Intel-gfx mailing list