Simple KMS helper are deprecated since they only add an intermediate
layer between drivers and the atomic modesetting.
This patch removes the drm_simple_encoder_init() helper usage in the
xlnx zynqmp_dpsub driver by open coding it and using the encoder atomic
helpers directly. This is a step to eventually get rid of this simple
KMS helper, once all drivers that use it have been converted.

Signed-off-by: Diogo Silva <[email protected]>
---
 drivers/gpu/drm/xlnx/zynqmp_kms.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/xlnx/zynqmp_kms.c 
b/drivers/gpu/drm/xlnx/zynqmp_kms.c
index d5f9224505655..698ac692abce9 100644
--- a/drivers/gpu/drm/xlnx/zynqmp_kms.c
+++ b/drivers/gpu/drm/xlnx/zynqmp_kms.c
@@ -30,7 +30,6 @@
 #include <drm/drm_mode_config.h>
 #include <drm/drm_plane.h>
 #include <drm/drm_probe_helper.h>
-#include <drm/drm_simple_kms_helper.h>
 #include <drm/drm_vblank.h>
 
 #include <linux/clk.h>
@@ -417,6 +416,10 @@ static const struct drm_driver zynqmp_dpsub_drm_driver = {
        .minor                          = 0,
 };
 
+static const struct drm_encoder_funcs zynqmp_dpsub_encoder_funcs = {
+       .destroy = drm_encoder_cleanup,
+};
+
 static int zynqmp_dpsub_kms_init(struct zynqmp_dpsub *dpsub)
 {
        struct drm_encoder *encoder = &dpsub->drm->encoder;
@@ -436,7 +439,8 @@ static int zynqmp_dpsub_kms_init(struct zynqmp_dpsub *dpsub)
 
        /* Create the encoder and attach the bridge. */
        encoder->possible_crtcs |= drm_crtc_mask(&dpsub->drm->crtc);
-       drm_simple_encoder_init(&dpsub->drm->dev, encoder, 
DRM_MODE_ENCODER_NONE);
+       drm_encoder_init(&dpsub->drm->dev, encoder, &zynqmp_dpsub_encoder_funcs,
+                        DRM_MODE_ENCODER_NONE, NULL);
 
        ret = drm_bridge_attach(encoder, dpsub->bridge, NULL,
                                DRM_BRIDGE_ATTACH_NO_CONNECTOR);

-- 
2.51.2

Reply via email to