Commit be26a66d authored by Jani Nikula's avatar Jani Nikula Committed by Daniel Vetter

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: default avatarJani Nikula <jani.nikula@intel.com>
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent 71279a11
...@@ -161,7 +161,7 @@ EXPORT_SYMBOL(drm_helper_crtc_in_use); ...@@ -161,7 +161,7 @@ EXPORT_SYMBOL(drm_helper_crtc_in_use);
static void static void
drm_encoder_disable(struct drm_encoder *encoder) drm_encoder_disable(struct drm_encoder *encoder)
{ {
struct drm_encoder_helper_funcs *encoder_funcs = encoder->helper_private; const struct drm_encoder_helper_funcs *encoder_funcs = encoder->helper_private;
if (encoder->bridge) if (encoder->bridge)
encoder->bridge->funcs->disable(encoder->bridge); encoder->bridge->funcs->disable(encoder->bridge);
...@@ -191,7 +191,7 @@ static void __drm_helper_disable_unused_functions(struct drm_device *dev) ...@@ -191,7 +191,7 @@ static void __drm_helper_disable_unused_functions(struct drm_device *dev)
} }
list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private; const struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private;
crtc->enabled = drm_helper_crtc_in_use(crtc); crtc->enabled = drm_helper_crtc_in_use(crtc);
if (!crtc->enabled) { if (!crtc->enabled) {
if (crtc_funcs->disable) if (crtc_funcs->disable)
...@@ -229,7 +229,7 @@ EXPORT_SYMBOL(drm_helper_disable_unused_functions); ...@@ -229,7 +229,7 @@ EXPORT_SYMBOL(drm_helper_disable_unused_functions);
static void static void
drm_crtc_prepare_encoders(struct drm_device *dev) drm_crtc_prepare_encoders(struct drm_device *dev)
{ {
struct drm_encoder_helper_funcs *encoder_funcs; const struct drm_encoder_helper_funcs *encoder_funcs;
struct drm_encoder *encoder; struct drm_encoder *encoder;
list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) { 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,8 +271,8 @@ bool drm_crtc_helper_set_mode(struct drm_crtc *crtc,
{ {
struct drm_device *dev = crtc->dev; struct drm_device *dev = crtc->dev;
struct drm_display_mode *adjusted_mode, saved_mode, saved_hwmode; struct drm_display_mode *adjusted_mode, saved_mode, saved_hwmode;
struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private; const struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private;
struct drm_encoder_helper_funcs *encoder_funcs; const struct drm_encoder_helper_funcs *encoder_funcs;
int saved_x, saved_y; int saved_x, saved_y;
bool saved_enabled; bool saved_enabled;
struct drm_encoder *encoder; struct drm_encoder *encoder;
...@@ -473,7 +473,7 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set) ...@@ -473,7 +473,7 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
bool fb_changed = false; /* if true and !mode_changed just do a flip */ bool fb_changed = false; /* if true and !mode_changed just do a flip */
struct drm_connector *save_connectors, *connector; struct drm_connector *save_connectors, *connector;
int count = 0, ro, fail = 0; int count = 0, ro, fail = 0;
struct drm_crtc_helper_funcs *crtc_funcs; const struct drm_crtc_helper_funcs *crtc_funcs;
struct drm_mode_set save_set; struct drm_mode_set save_set;
int ret; int ret;
int i; int i;
...@@ -573,7 +573,7 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set) ...@@ -573,7 +573,7 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
/* a) traverse passed in connector list and get encoders for them */ /* a) traverse passed in connector list and get encoders for them */
count = 0; count = 0;
list_for_each_entry(connector, &dev->mode_config.connector_list, head) { list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
struct drm_connector_helper_funcs *connector_funcs = const struct drm_connector_helper_funcs *connector_funcs =
connector->helper_private; connector->helper_private;
new_encoder = connector->encoder; new_encoder = connector->encoder;
for (ro = 0; ro < set->num_connectors; ro++) { for (ro = 0; ro < set->num_connectors; ro++) {
...@@ -733,7 +733,7 @@ static int drm_helper_choose_encoder_dpms(struct drm_encoder *encoder) ...@@ -733,7 +733,7 @@ static int drm_helper_choose_encoder_dpms(struct drm_encoder *encoder)
static void drm_helper_encoder_dpms(struct drm_encoder *encoder, int mode) static void drm_helper_encoder_dpms(struct drm_encoder *encoder, int mode)
{ {
struct drm_bridge *bridge = encoder->bridge; struct drm_bridge *bridge = encoder->bridge;
struct drm_encoder_helper_funcs *encoder_funcs; const struct drm_encoder_helper_funcs *encoder_funcs;
if (bridge) { if (bridge) {
if (mode == DRM_MODE_DPMS_ON) if (mode == DRM_MODE_DPMS_ON)
...@@ -795,7 +795,7 @@ void drm_helper_connector_dpms(struct drm_connector *connector, int mode) ...@@ -795,7 +795,7 @@ void drm_helper_connector_dpms(struct drm_connector *connector, int mode)
/* from off to on, do crtc then encoder */ /* from off to on, do crtc then encoder */
if (mode < old_dpms) { if (mode < old_dpms) {
if (crtc) { if (crtc) {
struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private; const struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private;
if (crtc_funcs->dpms) if (crtc_funcs->dpms)
(*crtc_funcs->dpms) (crtc, (*crtc_funcs->dpms) (crtc,
drm_helper_choose_crtc_dpms(crtc)); drm_helper_choose_crtc_dpms(crtc));
...@@ -809,7 +809,7 @@ void drm_helper_connector_dpms(struct drm_connector *connector, int mode) ...@@ -809,7 +809,7 @@ void drm_helper_connector_dpms(struct drm_connector *connector, int mode)
if (encoder) if (encoder)
drm_helper_encoder_dpms(encoder, encoder_dpms); drm_helper_encoder_dpms(encoder, encoder_dpms);
if (crtc) { if (crtc) {
struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private; const struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private;
if (crtc_funcs->dpms) if (crtc_funcs->dpms)
(*crtc_funcs->dpms) (crtc, (*crtc_funcs->dpms) (crtc,
drm_helper_choose_crtc_dpms(crtc)); drm_helper_choose_crtc_dpms(crtc));
...@@ -871,7 +871,7 @@ void drm_helper_resume_force_mode(struct drm_device *dev) ...@@ -871,7 +871,7 @@ void drm_helper_resume_force_mode(struct drm_device *dev)
{ {
struct drm_crtc *crtc; struct drm_crtc *crtc;
struct drm_encoder *encoder; struct drm_encoder *encoder;
struct drm_crtc_helper_funcs *crtc_funcs; const struct drm_crtc_helper_funcs *crtc_funcs;
int encoder_dpms; int encoder_dpms;
bool ret; bool ret;
...@@ -936,7 +936,7 @@ int drm_helper_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *mod ...@@ -936,7 +936,7 @@ int drm_helper_crtc_mode_set(struct drm_crtc *crtc, struct drm_display_mode *mod
struct drm_framebuffer *old_fb) struct drm_framebuffer *old_fb)
{ {
struct drm_crtc_state *crtc_state; struct drm_crtc_state *crtc_state;
struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private; const struct drm_crtc_helper_funcs *crtc_funcs = crtc->helper_private;
int ret; int ret;
if (crtc->funcs->atomic_duplicate_state) if (crtc->funcs->atomic_duplicate_state)
......
...@@ -238,7 +238,7 @@ static void drm_fb_helper_restore_lut_atomic(struct drm_crtc *crtc) ...@@ -238,7 +238,7 @@ static void drm_fb_helper_restore_lut_atomic(struct drm_crtc *crtc)
int drm_fb_helper_debug_enter(struct fb_info *info) int drm_fb_helper_debug_enter(struct fb_info *info)
{ {
struct drm_fb_helper *helper = info->par; struct drm_fb_helper *helper = info->par;
struct drm_crtc_helper_funcs *funcs; const struct drm_crtc_helper_funcs *funcs;
int i; int i;
list_for_each_entry(helper, &kernel_fb_helper_list, kernel_fb_list) { 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,7 +285,7 @@ int drm_fb_helper_debug_leave(struct fb_info *info)
{ {
struct drm_fb_helper *helper = info->par; struct drm_fb_helper *helper = info->par;
struct drm_crtc *crtc; struct drm_crtc *crtc;
struct drm_crtc_helper_funcs *funcs; const struct drm_crtc_helper_funcs *funcs;
struct drm_framebuffer *fb; struct drm_framebuffer *fb;
int i; int i;
...@@ -765,7 +765,7 @@ int drm_fb_helper_setcmap(struct fb_cmap *cmap, struct fb_info *info) ...@@ -765,7 +765,7 @@ int drm_fb_helper_setcmap(struct fb_cmap *cmap, struct fb_info *info)
{ {
struct drm_fb_helper *fb_helper = info->par; struct drm_fb_helper *fb_helper = info->par;
struct drm_device *dev = fb_helper->dev; struct drm_device *dev = fb_helper->dev;
struct drm_crtc_helper_funcs *crtc_funcs; const struct drm_crtc_helper_funcs *crtc_funcs;
u16 *red, *green, *blue, *transp; u16 *red, *green, *blue, *transp;
struct drm_crtc *crtc; struct drm_crtc *crtc;
int i, j, rc = 0; int i, j, rc = 0;
...@@ -1551,7 +1551,7 @@ static int drm_pick_crtcs(struct drm_fb_helper *fb_helper, ...@@ -1551,7 +1551,7 @@ static int drm_pick_crtcs(struct drm_fb_helper *fb_helper,
int c, o; int c, o;
struct drm_device *dev = fb_helper->dev; struct drm_device *dev = fb_helper->dev;
struct drm_connector *connector; struct drm_connector *connector;
struct drm_connector_helper_funcs *connector_funcs; const struct drm_connector_helper_funcs *connector_funcs;
struct drm_encoder *encoder; struct drm_encoder *encoder;
int my_score, best_score, score; int my_score, best_score, score;
struct drm_fb_helper_crtc **crtcs, *crtc; struct drm_fb_helper_crtc **crtcs, *crtc;
......
...@@ -401,9 +401,9 @@ int drm_plane_helper_commit(struct drm_plane *plane, ...@@ -401,9 +401,9 @@ int drm_plane_helper_commit(struct drm_plane *plane,
struct drm_plane_state *plane_state, struct drm_plane_state *plane_state,
struct drm_framebuffer *old_fb) struct drm_framebuffer *old_fb)
{ {
struct drm_plane_helper_funcs *plane_funcs; const struct drm_plane_helper_funcs *plane_funcs;
struct drm_crtc *crtc[2]; struct drm_crtc *crtc[2];
struct drm_crtc_helper_funcs *crtc_funcs[2]; const struct drm_crtc_helper_funcs *crtc_funcs[2];
int i, ret = 0; int i, ret = 0;
plane_funcs = plane->helper_private; plane_funcs = plane->helper_private;
......
...@@ -98,7 +98,7 @@ static int drm_helper_probe_single_connector_modes_merge_bits(struct drm_connect ...@@ -98,7 +98,7 @@ static int drm_helper_probe_single_connector_modes_merge_bits(struct drm_connect
{ {
struct drm_device *dev = connector->dev; struct drm_device *dev = connector->dev;
struct drm_display_mode *mode; struct drm_display_mode *mode;
struct drm_connector_helper_funcs *connector_funcs = const struct drm_connector_helper_funcs *connector_funcs =
connector->helper_private; connector->helper_private;
int count = 0; int count = 0;
int mode_flags = 0; int mode_flags = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment