[PATCH 4/5] drm: Add support for subclassing struct drm_device

Damien Lespiau damien.lespiau at intel.com
Thu Jan 9 04:11:55 PST 2014


On Wed, Jan 08, 2014 at 09:26:51PM +0100, Daniel Vetter wrote:
> > So the parent structure is expected to have "struct drm_device" at
> > offset 0? I'd rather like to see a "drm_dev_init()" alongside
> > drm_dev_alloc() similar to device_initialize().
> 
> Yeah, I think for subclassing we want drivers in charge to kmalloc the
> entire thing and embedded struct drm_device wherever they please to do so.
> Adding struct_size stuff all over the place still forces us through the
> midlayer ...
> 
> I'm trying to get there with my giant drm cleanup series (which contains
> some of the same dev_priv_size cleanups like yours). Dunno whether it's
> worth all to much to start embedding before we have that all ready since
> imo the big value in demidlayering is that it allows us to fix up the
> init/teardown sequence. That it also allows struct drm_device embedding is
> kinda neat, but not my main goal.
> -Daniel

I'm not sure why would people want struct drm_device at a non-0 offset,
but in any case, if Daniel is already looking into this, let's scrap
that series. At least we know that it doesn't have to be a long term
plan and we can do it as soon as we want.

-- 
Damien



More information about the dri-devel mailing list