public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
* [RFC] Subclassing struct drm_device
@ 2014-01-08 18:31 Damien Lespiau
  2014-01-08 18:31 ` [PATCH 1/5] drm: Remove unnecessary dev_priv_size initializations to 0 Damien Lespiau
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Damien Lespiau @ 2014-01-08 18:31 UTC (permalink / raw)
  To: dri-devel; +Cc: intel-gfx

I was reminded on Monday that we'd like to be able to subclass struct
drm_device so we don't have to always juggle between a pointer to a struct
drm_device and its drv_private field to access everything we care about.

It'd be nicer for those two pointers to have the same value to avoid a few
extra instructions pretty everywhere.

Turns out, there's a cheap way to go towards that goal, just make DRM core
allocate enough space for drivers that want to subclass struct drm_device and
have a transition path where dev_private points to the start of the structure.

I've converted i915 to do just that, seems to still boot. Of course, a number
of nice refactoring are possible once dev == dev_priv, but that'd be for follow
up patches on top.

Thoughts?

-- 
Damien

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

end of thread, other threads:[~2014-01-09 12:18 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-08 18:31 [RFC] Subclassing struct drm_device Damien Lespiau
2014-01-08 18:31 ` [PATCH 1/5] drm: Remove unnecessary dev_priv_size initializations to 0 Damien Lespiau
2014-01-08 18:31 ` [PATCH 2/5] drm: Remove dev_priv_size from struct drm_buf Damien Lespiau
2014-01-08 18:31 ` [PATCH 3/5] drm: Rename dev_priv_size to buf_priv_size Damien Lespiau
2014-01-08 18:31 ` [PATCH 4/5] drm: Add support for subclassing struct drm_device Damien Lespiau
2014-01-08 19:01   ` David Herrmann
2014-01-08 20:26     ` Daniel Vetter
2014-01-09 12:11       ` Damien Lespiau
2014-01-09 12:18         ` David Herrmann
2014-01-08 18:31 ` [PATCH 5/5] drm/i915: Make struct drm_i915_private a subclass of " Damien Lespiau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox