diff options
author | Giulio Benetti <giulio.benetti@micronovasrl.com> | 2018-03-13 07:36:57 -0400 |
---|---|---|
committer | Maxime Ripard <maxime.ripard@bootlin.com> | 2018-03-14 04:07:13 -0400 |
commit | cde8b7548272640437d2fa691ae211f940066f6b (patch) | |
tree | 77b841540166326d1a3fac97ed432d69a553dae7 | |
parent | fd1eabd8800461d4ce1665b005e745353dfb3e49 (diff) |
drm/sun4i: move rgb mode_valid from connector to encoder
mode_valid function must be connected to encoder.
Otherwise it could get not be called by drm in the case there's a
bridge connected to encoder instead of a panel.
Move mode_valid function pointer to encoder helper functions,
changing its prototype according to encoder helper function pointer.
Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Link: https://patchwork.freedesktop.org/patch/msgid/1520941017-81177-1-git-send-email-giulio.benetti@micronovasrl.com
-rw-r--r-- | drivers/gpu/drm/sun4i/sun4i_rgb.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/gpu/drm/sun4i/sun4i_rgb.c b/drivers/gpu/drm/sun4i/sun4i_rgb.c index 832f8f9bc47f..a2a697a099e6 100644 --- a/drivers/gpu/drm/sun4i/sun4i_rgb.c +++ b/drivers/gpu/drm/sun4i/sun4i_rgb.c | |||
@@ -52,10 +52,10 @@ static int sun4i_rgb_get_modes(struct drm_connector *connector) | |||
52 | return drm_panel_get_modes(tcon->panel); | 52 | return drm_panel_get_modes(tcon->panel); |
53 | } | 53 | } |
54 | 54 | ||
55 | static int sun4i_rgb_mode_valid(struct drm_connector *connector, | 55 | static enum drm_mode_status sun4i_rgb_mode_valid(struct drm_encoder *crtc, |
56 | struct drm_display_mode *mode) | 56 | const struct drm_display_mode *mode) |
57 | { | 57 | { |
58 | struct sun4i_rgb *rgb = drm_connector_to_sun4i_rgb(connector); | 58 | struct sun4i_rgb *rgb = drm_encoder_to_sun4i_rgb(crtc); |
59 | struct sun4i_tcon *tcon = rgb->tcon; | 59 | struct sun4i_tcon *tcon = rgb->tcon; |
60 | u32 hsync = mode->hsync_end - mode->hsync_start; | 60 | u32 hsync = mode->hsync_end - mode->hsync_start; |
61 | u32 vsync = mode->vsync_end - mode->vsync_start; | 61 | u32 vsync = mode->vsync_end - mode->vsync_start; |
@@ -106,7 +106,6 @@ static int sun4i_rgb_mode_valid(struct drm_connector *connector, | |||
106 | 106 | ||
107 | static struct drm_connector_helper_funcs sun4i_rgb_con_helper_funcs = { | 107 | static struct drm_connector_helper_funcs sun4i_rgb_con_helper_funcs = { |
108 | .get_modes = sun4i_rgb_get_modes, | 108 | .get_modes = sun4i_rgb_get_modes, |
109 | .mode_valid = sun4i_rgb_mode_valid, | ||
110 | }; | 109 | }; |
111 | 110 | ||
112 | static void | 111 | static void |
@@ -156,6 +155,7 @@ static void sun4i_rgb_encoder_disable(struct drm_encoder *encoder) | |||
156 | static struct drm_encoder_helper_funcs sun4i_rgb_enc_helper_funcs = { | 155 | static struct drm_encoder_helper_funcs sun4i_rgb_enc_helper_funcs = { |
157 | .disable = sun4i_rgb_encoder_disable, | 156 | .disable = sun4i_rgb_encoder_disable, |
158 | .enable = sun4i_rgb_encoder_enable, | 157 | .enable = sun4i_rgb_encoder_enable, |
158 | .mode_valid = sun4i_rgb_mode_valid, | ||
159 | }; | 159 | }; |
160 | 160 | ||
161 | static void sun4i_rgb_enc_destroy(struct drm_encoder *encoder) | 161 | static void sun4i_rgb_enc_destroy(struct drm_encoder *encoder) |