[Intel-gfx] [PATCH 1/2] drm/i915: Rename intel_output to intel_encoder.

Daniel Vetter daniel at ffwll.ch
Thu Mar 25 23:07:49 CET 2010


Hi Eric,

I admit, this idea is probably nuts. But given that these patches are even
bigger than my "introduce dereference helpers" stuff, I've thought about
how to do this more incrementally. Furthermore they introduce a flag day,
ie. simply dropping a part is impossible (in contrast to my deref
helpers). What about changing intel_output to

struct intel_output {
	/* encoder stuff */
	struct drm_encoder enc;
	/* intel encoder specific stuff cut out for brevity */

	/* connector stuff */
	struct drm_connector base;
	/* add new connector related fields here */
};

ie. move the connector related field(s) to the bottom. Then introduce

struct intel_encoder {
	struct drm_encoder base;
	/* intel encoder specific stuff */
};

struct intel_connector {
	struct drm_connector base;
	/* add new connector related fields here */
};



struct intel_simple_encoder {
	struct intel_encoder intel_enc;
	struct intel_connector intel_connector;
};

i.e. struct intel_simple_encoder and struct intel_output have the exact
same memory layout. With this we should be able to gradually change the
code over to the new data structures. Differentiating between
intel_simple_encoder and intel_connector could then be done on the type
stored in drm_connector, if this is ever needed. To retain compatibility
for code still using 1:1 connector:encoder mapping intel_*_output
functions would simply typecast and call the corresponding
intel_*_encoder|connector function.

I haven't looked closely at the code, much less tried to implement this.
But if you really want to avoid a driver-wide sed-induced flag-day,
something like this could work.

-Daniel
-- 
Daniel Vetter
Mail: daniel at ffwll.ch
Mobile: +41 (0)79 365 57 48



More information about the Intel-gfx mailing list