aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2015-12-04 03:45:45 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2015-12-08 10:07:52 -0500
commit4490d4c7111e1ebf748ea2c3e1e64d103d73bae7 (patch)
tree3f169f7d490c11407ea6132589b4600c47a21b2b
parent092d01dae09aa6779ed41c3ac637e1e3c835424b (diff)
drm: Make helper vtable pointers type-safe
Originally the idea behind void* was to allow different sets of helpers. But now we have that (with probe, plane, crtc and atomic helpers) and we still just use the same set of vtables. That's the only way to make the individual helpers modular and allow drivers to pick&choose and transition between them. So this flexibility isn't really needed. Also we have lots of non-vtable data meanwhile in core structures too, this is not the first one at all. Given that the void * is only trouble since gcc can't warn you if you mix them up. Let's fix that and make them typesafe. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1449218769-16577-5-git-send-email-daniel.vetter@ffwll.ch Reviewed-by: Thierry Reding <treding@nvidia.com>
-rw-r--r--include/drm/drm_crtc.h13
1 files changed, 9 insertions, 4 deletions
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index 4765df331002..e8f8e4e9a6a1 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -254,6 +254,11 @@ struct drm_plane;
254struct drm_bridge; 254struct drm_bridge;
255struct drm_atomic_state; 255struct drm_atomic_state;
256 256
257struct drm_crtc_helper_funcs;
258struct drm_encoder_helper_funcs;
259struct drm_connector_helper_funcs;
260struct drm_plane_helper_funcs;
261
257/** 262/**
258 * struct drm_crtc_state - mutable CRTC state 263 * struct drm_crtc_state - mutable CRTC state
259 * @crtc: backpointer to the CRTC 264 * @crtc: backpointer to the CRTC
@@ -467,7 +472,7 @@ struct drm_crtc {
467 uint16_t *gamma_store; 472 uint16_t *gamma_store;
468 473
469 /* if you are using the helper */ 474 /* if you are using the helper */
470 const void *helper_private; 475 const struct drm_crtc_helper_funcs *helper_private;
471 476
472 struct drm_object_properties properties; 477 struct drm_object_properties properties;
473 478
@@ -597,7 +602,7 @@ struct drm_encoder {
597 struct drm_crtc *crtc; 602 struct drm_crtc *crtc;
598 struct drm_bridge *bridge; 603 struct drm_bridge *bridge;
599 const struct drm_encoder_funcs *funcs; 604 const struct drm_encoder_funcs *funcs;
600 const void *helper_private; 605 const struct drm_encoder_helper_funcs *helper_private;
601}; 606};
602 607
603/* should we poll this connector for connects and disconnects */ 608/* should we poll this connector for connects and disconnects */
@@ -702,7 +707,7 @@ struct drm_connector {
702 /* requested DPMS state */ 707 /* requested DPMS state */
703 int dpms; 708 int dpms;
704 709
705 const void *helper_private; 710 const struct drm_connector_helper_funcs *helper_private;
706 711
707 /* forced on connector */ 712 /* forced on connector */
708 struct drm_cmdline_mode cmdline_mode; 713 struct drm_cmdline_mode cmdline_mode;
@@ -870,7 +875,7 @@ struct drm_plane {
870 875
871 enum drm_plane_type type; 876 enum drm_plane_type type;
872 877
873 const void *helper_private; 878 const struct drm_plane_helper_funcs *helper_private;
874 879
875 struct drm_plane_state *state; 880 struct drm_plane_state *state;
876}; 881};