aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJani Nikula <jani.nikula@intel.com>2015-03-11 05:51:06 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2015-04-07 12:11:25 -0400
commitbe26a66de5f5722388966a62d772df832818bcb9 (patch)
treed004bf6ddcb0069e3d6e5879ebe95ed3c1e37980
parent71279a11380faabf70ea2827dc168b4156a10971 (diff)
drm/drm: constify all struct drm_*_helper funcs pointers
They are not to be modified. Generated using the semantic patch: @@ @@ ( const struct drm_crtc_helper_funcs * | - struct drm_crtc_helper_funcs * + const struct drm_crtc_helper_funcs * ) @@ @@ ( const struct drm_encoder_helper_funcs * | - struct drm_encoder_helper_funcs * + const struct drm_encoder_helper_funcs * ) @@ @@ ( const struct drm_connector_helper_funcs * | - struct drm_connector_helper_funcs * + const struct drm_connector_helper_funcs * ) @@ @@ ( const struct drm_plane_helper_funcs * | - struct drm_plane_helper_funcs * + const struct drm_plane_helper_funcs * ) Signed-off-by: Jani Nikula <jani.nikula@intel.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--drivers/gpu/drm/drm_crtc_helper.c24
-rw-r--r--drivers/gpu/drm/drm_fb_helper.c8
-rw-r--r--drivers/gpu/drm/drm_plane_helper.c4
-rw-r--r--drivers/gpu/drm/drm_probe_helper.c2
4 files changed, 19 insertions, 19 deletions
diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c
index dd895c409ca3..ab00286aec93 100644
--- a/drivers/gpu/drm/drm_crtc_helper.c
+++ b/drivers/gpu/drm/drm_crtc_helper.c
@@ -161,7 +161,7 @@ EXPORT_SYMBOL(drm_helper_crtc_in_use);
161static void 161static void
162drm_encoder_disable(struct drm_encoder *encoder) 162drm_encoder_disable(struct drm_encoder *encoder)
163{ 163{
164 struct drm_encoder_helper_funcs *encoder_funcs = encoder->helper_private; 164 const struct drm_encoder_helper_funcs *encoder_funcs = encoder->helper_private;
165 165
166 if (encoder->bridge) 166 if (encoder->bridge)
167 encoder->bridge->funcs->disable(encoder->bridge); 167 encoder->bridge->funcs->disable(encoder->bridge);
@@ -191,7 +191,7 @@ static void __drm_helper_disable_unused_functions(struct drm_device *dev)
191 } 191 }
192 192
193 list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { 193 list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
194 struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private; 194 const struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private;
195 crtc->enabled = drm_helper_crtc_in_use(crtc); 195 crtc->enabled = drm_helper_crtc_in_use(crtc);
196 if (!crtc->enabled) { 196 if (!crtc->enabled) {
197 if (crtc_funcs->disable) 197 if (crtc_funcs->disable)
@@ -229,7 +229,7 @@ EXPORT_SYMBOL(drm_helper_disable_unused_functions);
229static void 229static void
230drm_crtc_prepare_encoders(struct drm_device *dev) 230drm_crtc_prepare_encoders(struct drm_device *dev)
231{ 231{
232 struct drm_encoder_helper_funcs *encoder_funcs; 232 const struct drm_encoder_helper_funcs *encoder_funcs;
233 struct drm_encoder *encoder; 233 struct drm_encoder *encoder;
234 234
235 list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) { 235 list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) {
@@ -271,8 +271,8 @@ bool drm_crtc_helper_set_mode(struct drm_crtc *crtc,
271{ 271{
272 struct drm_device *dev = crtc->dev; 272 struct drm_device *dev = crtc->dev;
273 struct drm_display_mode *adjusted_mode, saved_mode, saved_hwmode; 273 struct drm_display_mode *adjusted_mode, saved_mode, saved_hwmode;
274 struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private; 274 const struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private;
275 struct drm_encoder_helper_funcs *encoder_funcs; 275 const struct drm_encoder_helper_funcs *encoder_funcs;
276 int saved_x, saved_y; 276 int saved_x, saved_y;
277 bool saved_enabled; 277 bool saved_enabled;
278 struct drm_encoder *encoder; 278 struct drm_encoder *encoder;
@@ -473,7 +473,7 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
473 bool fb_changed = false; /* if true and !mode_changed just do a flip */ 473 bool fb_changed = false; /* if true and !mode_changed just do a flip */
474 struct drm_connector *save_connectors, *connector; 474 struct drm_connector *save_connectors, *connector;
475 int count = 0, ro, fail = 0; 475 int count = 0, ro, fail = 0;
476 struct drm_crtc_helper_funcs *crtc_funcs; 476 const struct drm_crtc_helper_funcs *crtc_funcs;
477 struct drm_mode_set save_set; 477 struct drm_mode_set save_set;
478 int ret; 478 int ret;
479 int i; 479 int i;
@@ -573,7 +573,7 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
573 /* a) traverse passed in connector list and get encoders for them */ 573 /* a) traverse passed in connector list and get encoders for them */
574 count = 0; 574 count = 0;
575 list_for_each_entry(connector, &dev->mode_config.connector_list, head) { 575 list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
576 struct drm_connector_helper_funcs *connector_funcs = 576 const struct drm_connector_helper_funcs *connector_funcs =
577 connector->helper_private; 577 connector->helper_private;
578 new_encoder = connector->encoder; 578 new_encoder = connector->encoder;
579 for (ro = 0; ro < set->num_connectors; ro++) { 579 for (ro = 0; ro < set->num_connectors; ro++) {
@@ -733,7 +733,7 @@ static int drm_helper_choose_encoder_dpms(struct drm_encoder *encoder)
733static void drm_helper_encoder_dpms(struct drm_encoder *encoder, int mode) 733static void drm_helper_encoder_dpms(struct drm_encoder *encoder, int mode)
734{ 734{
735 struct drm_bridge *bridge = encoder->bridge; 735 struct drm_bridge *bridge = encoder->bridge;
736 struct drm_encoder_helper_funcs *encoder_funcs; 736 const struct drm_encoder_helper_funcs *encoder_funcs;
737 737
738 if (bridge) { 738 if (bridge) {
739 if (mode == DRM_MODE_DPMS_ON) 739 if (mode == DRM_MODE_DPMS_ON)
@@ -795,7 +795,7 @@ void drm_helper_connector_dpms(struct drm_connector *connector, int mode)
795 /* from off to on, do crtc then encoder */ 795 /* from off to on, do crtc then encoder */
796 if (mode < old_dpms) { 796 if (mode < old_dpms) {
797 if (crtc) { 797 if (crtc) {
798 struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private; 798 const struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private;
799 if (crtc_funcs->dpms) 799 if (crtc_funcs->dpms)
800 (*crtc_funcs->dpms) (crtc, 800 (*crtc_funcs->dpms) (crtc,
801 drm_helper_choose_crtc_dpms(crtc)); 801 drm_helper_choose_crtc_dpms(crtc));
@@ -809,7 +809,7 @@ void drm_helper_connector_dpms(struct drm_connector *connector, int mode)
809 if (encoder) 809 if (encoder)
810 drm_helper_encoder_dpms(encoder, encoder_dpms); 810 drm_helper_encoder_dpms(encoder, encoder_dpms);
811 if (crtc) { 811 if (crtc) {
812 struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private; 812 const struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private;
813 if (crtc_funcs->dpms) 813 if (crtc_funcs->dpms)
814 (*crtc_funcs->dpms) (crtc, 814 (*crtc_funcs->dpms) (crtc,
815 drm_helper_choose_crtc_dpms(crtc)); 815 drm_helper_choose_crtc_dpms(crtc));
@@ -871,7 +871,7 @@ void drm_helper_resume_force_mode(struct drm_device *dev)
871{ 871{
872 struct drm_crtc *crtc; 872 struct drm_crtc *crtc;
873 struct drm_encoder *encoder; 873 struct drm_encoder *encoder;
874 struct drm_crtc_helper_funcs *crtc_funcs; 874 const struct drm_crtc_helper_funcs *crtc_funcs;
875 int encoder_dpms; 875 int encoder_dpms;
876 bool ret; 876 bool ret;
877 877
@@ -936,7 +936,7 @@ int drm_helper_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *mod
936 struct drm_framebuffer *old_fb) 936 struct drm_framebuffer *old_fb)
937{ 937{
938 struct drm_crtc_state *crtc_state; 938 struct drm_crtc_state *crtc_state;
939 struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private; 939 const struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private;
940 int ret; 940 int ret;
941 941
942 if (crtc->funcs->atomic_duplicate_state) 942 if (crtc->funcs->atomic_duplicate_state)
diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
index 309b9476fe96..cac422916c7a 100644
--- a/drivers/gpu/drm/drm_fb_helper.c
+++ b/drivers/gpu/drm/drm_fb_helper.c
@@ -238,7 +238,7 @@ static void drm_fb_helper_restore_lut_atomic(struct drm_crtc *crtc)
238int drm_fb_helper_debug_enter(struct fb_info *info) 238int drm_fb_helper_debug_enter(struct fb_info *info)
239{ 239{
240 struct drm_fb_helper *helper = info->par; 240 struct drm_fb_helper *helper = info->par;
241 struct drm_crtc_helper_funcs *funcs; 241 const struct drm_crtc_helper_funcs *funcs;
242 int i; 242 int i;
243 243
244 list_for_each_entry(helper, &kernel_fb_helper_list, kernel_fb_list) { 244 list_for_each_entry(helper, &kernel_fb_helper_list, kernel_fb_list) {
@@ -285,7 +285,7 @@ int drm_fb_helper_debug_leave(struct fb_info *info)
285{ 285{
286 struct drm_fb_helper *helper = info->par; 286 struct drm_fb_helper *helper = info->par;
287 struct drm_crtc *crtc; 287 struct drm_crtc *crtc;
288 struct drm_crtc_helper_funcs *funcs; 288 const struct drm_crtc_helper_funcs *funcs;
289 struct drm_framebuffer *fb; 289 struct drm_framebuffer *fb;
290 int i; 290 int i;
291 291
@@ -765,7 +765,7 @@ int drm_fb_helper_setcmap(struct fb_cmap *cmap, struct fb_info *info)
765{ 765{
766 struct drm_fb_helper *fb_helper = info->par; 766 struct drm_fb_helper *fb_helper = info->par;
767 struct drm_device *dev = fb_helper->dev; 767 struct drm_device *dev = fb_helper->dev;
768 struct drm_crtc_helper_funcs *crtc_funcs; 768 const struct drm_crtc_helper_funcs *crtc_funcs;
769 u16 *red, *green, *blue, *transp; 769 u16 *red, *green, *blue, *transp;
770 struct drm_crtc *crtc; 770 struct drm_crtc *crtc;
771 int i, j, rc = 0; 771 int i, j, rc = 0;
@@ -1551,7 +1551,7 @@ static int drm_pick_crtcs(struct drm_fb_helper *fb_helper,
1551 int c, o; 1551 int c, o;
1552 struct drm_device *dev = fb_helper->dev; 1552 struct drm_device *dev = fb_helper->dev;
1553 struct drm_connector *connector; 1553 struct drm_connector *connector;
1554 struct drm_connector_helper_funcs *connector_funcs; 1554 const struct drm_connector_helper_funcs *connector_funcs;
1555 struct drm_encoder *encoder; 1555 struct drm_encoder *encoder;
1556 int my_score, best_score, score; 1556 int my_score, best_score, score;
1557 struct drm_fb_helper_crtc **crtcs, *crtc; 1557 struct drm_fb_helper_crtc **crtcs, *crtc;
diff --git a/drivers/gpu/drm/drm_plane_helper.c b/drivers/gpu/drm/drm_plane_helper.c
index 33807e0adac7..40c1db9ad7c3 100644
--- a/drivers/gpu/drm/drm_plane_helper.c
+++ b/drivers/gpu/drm/drm_plane_helper.c
@@ -401,9 +401,9 @@ int drm_plane_helper_commit(struct drm_plane *plane,
401 struct drm_plane_state *plane_state, 401 struct drm_plane_state *plane_state,
402 struct drm_framebuffer *old_fb) 402 struct drm_framebuffer *old_fb)
403{ 403{
404 struct drm_plane_helper_funcs *plane_funcs; 404 const struct drm_plane_helper_funcs *plane_funcs;
405 struct drm_crtc *crtc[2]; 405 struct drm_crtc *crtc[2];
406 struct drm_crtc_helper_funcs *crtc_funcs[2]; 406 const struct drm_crtc_helper_funcs *crtc_funcs[2];
407 int i, ret = 0; 407 int i, ret = 0;
408 408
409 plane_funcs = plane->helper_private; 409 plane_funcs = plane->helper_private;
diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c
index 6591d48c1b9d..d44437fc42b1 100644
--- a/drivers/gpu/drm/drm_probe_helper.c
+++ b/drivers/gpu/drm/drm_probe_helper.c
@@ -98,7 +98,7 @@ static int drm_helper_probe_single_connector_modes_merge_bits(struct drm_connect
98{ 98{
99 struct drm_device *dev = connector->dev; 99 struct drm_device *dev = connector->dev;
100 struct drm_display_mode *mode; 100 struct drm_display_mode *mode;
101 struct drm_connector_helper_funcs *connector_funcs = 101 const struct drm_connector_helper_funcs *connector_funcs =
102 connector->helper_private; 102 connector->helper_private;
103 int count = 0; 103 int count = 0;
104 int mode_flags = 0; 104 int mode_flags = 0;