Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/imx: Use simple encoder

The imx driver uses empty implementations for its encoders. Replace
the code with the generic simple encoder.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200305155950.2705-9-tzimmermann@suse.de

+8 -31
+2 -6
drivers/gpu/drm/imx/dw_hdmi-imx.c
··· 18 18 #include <drm/drm_edid.h> 19 19 #include <drm/drm_encoder.h> 20 20 #include <drm/drm_of.h> 21 + #include <drm/drm_simple_kms_helper.h> 21 22 22 23 #include "imx-drm.h" 23 24 ··· 144 143 .atomic_check = dw_hdmi_imx_atomic_check, 145 144 }; 146 145 147 - static const struct drm_encoder_funcs dw_hdmi_imx_encoder_funcs = { 148 - .destroy = drm_encoder_cleanup, 149 - }; 150 - 151 146 static enum drm_mode_status 152 147 imx6q_hdmi_mode_valid(struct drm_connector *con, 153 148 const struct drm_display_mode *mode) ··· 233 236 return ret; 234 237 235 238 drm_encoder_helper_add(encoder, &dw_hdmi_imx_encoder_helper_funcs); 236 - drm_encoder_init(drm, encoder, &dw_hdmi_imx_encoder_funcs, 237 - DRM_MODE_ENCODER_TMDS, NULL); 239 + drm_simple_encoder_init(drm, encoder, DRM_MODE_ENCODER_TMDS); 238 240 239 241 platform_set_drvdata(pdev, hdmi); 240 242
-6
drivers/gpu/drm/imx/imx-drm-core.c
··· 42 42 } 43 43 EXPORT_SYMBOL_GPL(imx_drm_connector_destroy); 44 44 45 - void imx_drm_encoder_destroy(struct drm_encoder *encoder) 46 - { 47 - drm_encoder_cleanup(encoder); 48 - } 49 - EXPORT_SYMBOL_GPL(imx_drm_encoder_destroy); 50 - 51 45 static int imx_drm_atomic_check(struct drm_device *dev, 52 46 struct drm_atomic_state *state) 53 47 {
-1
drivers/gpu/drm/imx/imx-drm.h
··· 38 38 struct drm_encoder *encoder, struct device_node *np); 39 39 40 40 void imx_drm_connector_destroy(struct drm_connector *connector); 41 - void imx_drm_encoder_destroy(struct drm_encoder *encoder); 42 41 43 42 int ipu_planes_assign_pre(struct drm_device *dev, 44 43 struct drm_atomic_state *state);
+2 -6
drivers/gpu/drm/imx/imx-ldb.c
··· 26 26 #include <drm/drm_panel.h> 27 27 #include <drm/drm_print.h> 28 28 #include <drm/drm_probe_helper.h> 29 + #include <drm/drm_simple_kms_helper.h> 29 30 30 31 #include "imx-drm.h" 31 32 ··· 394 393 .best_encoder = imx_ldb_connector_best_encoder, 395 394 }; 396 395 397 - static const struct drm_encoder_funcs imx_ldb_encoder_funcs = { 398 - .destroy = imx_drm_encoder_destroy, 399 - }; 400 - 401 396 static const struct drm_encoder_helper_funcs imx_ldb_encoder_helper_funcs = { 402 397 .atomic_mode_set = imx_ldb_encoder_atomic_mode_set, 403 398 .enable = imx_ldb_encoder_enable, ··· 438 441 } 439 442 440 443 drm_encoder_helper_add(encoder, &imx_ldb_encoder_helper_funcs); 441 - drm_encoder_init(drm, encoder, &imx_ldb_encoder_funcs, 442 - DRM_MODE_ENCODER_LVDS, NULL); 444 + drm_simple_encoder_init(drm, encoder, DRM_MODE_ENCODER_LVDS); 443 445 444 446 if (imx_ldb_ch->bridge) { 445 447 ret = drm_bridge_attach(&imx_ldb_ch->encoder,
+2 -6
drivers/gpu/drm/imx/imx-tve.c
··· 21 21 #include <drm/drm_atomic_helper.h> 22 22 #include <drm/drm_fb_helper.h> 23 23 #include <drm/drm_probe_helper.h> 24 + #include <drm/drm_simple_kms_helper.h> 24 25 25 26 #include "imx-drm.h" 26 27 ··· 349 348 .mode_valid = imx_tve_connector_mode_valid, 350 349 }; 351 350 352 - static const struct drm_encoder_funcs imx_tve_encoder_funcs = { 353 - .destroy = imx_drm_encoder_destroy, 354 - }; 355 - 356 351 static const struct drm_encoder_helper_funcs imx_tve_encoder_helper_funcs = { 357 352 .mode_set = imx_tve_encoder_mode_set, 358 353 .enable = imx_tve_encoder_enable, ··· 476 479 return ret; 477 480 478 481 drm_encoder_helper_add(&tve->encoder, &imx_tve_encoder_helper_funcs); 479 - drm_encoder_init(drm, &tve->encoder, &imx_tve_encoder_funcs, 480 - encoder_type, NULL); 482 + drm_simple_encoder_init(drm, &tve->encoder, encoder_type); 481 483 482 484 drm_connector_helper_add(&tve->connector, 483 485 &imx_tve_connector_helper_funcs);
+2 -6
drivers/gpu/drm/imx/parallel-display.c
··· 18 18 #include <drm/drm_of.h> 19 19 #include <drm/drm_panel.h> 20 20 #include <drm/drm_probe_helper.h> 21 + #include <drm/drm_simple_kms_helper.h> 21 22 22 23 #include "imx-drm.h" 23 24 ··· 257 256 .best_encoder = imx_pd_connector_best_encoder, 258 257 }; 259 258 260 - static const struct drm_encoder_funcs imx_pd_encoder_funcs = { 261 - .destroy = imx_drm_encoder_destroy, 262 - }; 263 - 264 259 static const struct drm_bridge_funcs imx_pd_bridge_funcs = { 265 260 .enable = imx_pd_bridge_enable, 266 261 .disable = imx_pd_bridge_disable, ··· 285 288 */ 286 289 imxpd->connector.dpms = DRM_MODE_DPMS_OFF; 287 290 288 - drm_encoder_init(drm, encoder, &imx_pd_encoder_funcs, 289 - DRM_MODE_ENCODER_NONE, NULL); 291 + drm_simple_encoder_init(drm, encoder, DRM_MODE_ENCODER_NONE); 290 292 291 293 imxpd->bridge.funcs = &imx_pd_bridge_funcs; 292 294 drm_bridge_attach(encoder, &imxpd->bridge, NULL, 0);