Changing malidp driver to accomadate the change of
drm_writeback_connector.base and drm_writeback_connector.encoder
to a pointer the reason for which is explained in the
Patch(drm: add writeback pointers to drm_connector).

Signed-off-by: Kandpal Suraj <suraj.kand...@intel.com>
---
 drivers/gpu/drm/arm/malidp_crtc.c |  2 +-
 drivers/gpu/drm/arm/malidp_drv.h  |  2 ++
 drivers/gpu/drm/arm/malidp_mw.c   | 12 ++++++++----
 3 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/drivers/gpu/drm/arm/malidp_crtc.c 
b/drivers/gpu/drm/arm/malidp_crtc.c
index 494075ddbef6..294aacd4beef 100644
--- a/drivers/gpu/drm/arm/malidp_crtc.c
+++ b/drivers/gpu/drm/arm/malidp_crtc.c
@@ -424,7 +424,7 @@ static int malidp_crtc_atomic_check(struct drm_crtc *crtc,
                u32 new_mask = crtc_state->connector_mask;
 
                if ((old_mask ^ new_mask) ==
-                   (1 << drm_connector_index(&malidp->mw_connector.base)))
+                   (1 << drm_connector_index(malidp->mw_connector.base)))
                        crtc_state->connectors_changed = false;
        }
 
diff --git a/drivers/gpu/drm/arm/malidp_drv.h b/drivers/gpu/drm/arm/malidp_drv.h
index cdfddfabf2d1..971810a685f1 100644
--- a/drivers/gpu/drm/arm/malidp_drv.h
+++ b/drivers/gpu/drm/arm/malidp_drv.h
@@ -31,6 +31,8 @@ struct malidp_error_stats {
 struct malidp_drm {
        struct malidp_hw_device *dev;
        struct drm_crtc crtc;
+       struct drm_connector connector;
+       struct drm_encoder encoder;
        struct drm_writeback_connector mw_connector;
        wait_queue_head_t wq;
        struct drm_pending_vblank_event *event;
diff --git a/drivers/gpu/drm/arm/malidp_mw.c b/drivers/gpu/drm/arm/malidp_mw.c
index f5847a79dd7e..9bd2e400cd3d 100644
--- a/drivers/gpu/drm/arm/malidp_mw.c
+++ b/drivers/gpu/drm/arm/malidp_mw.c
@@ -206,21 +206,25 @@ static u32 *get_writeback_formats(struct malidp_drm 
*malidp, int *n_formats)
 int malidp_mw_connector_init(struct drm_device *drm)
 {
        struct malidp_drm *malidp = drm->dev_private;
+       struct drm_writeback_connector *wb_conn;
        u32 *formats;
        int ret, n_formats;
 
        if (!malidp->dev->hw->enable_memwrite)
                return 0;
 
-       malidp->mw_connector.encoder.possible_crtcs = 1 << 
drm_crtc_index(&malidp->crtc);
-       drm_connector_helper_add(&malidp->mw_connector.base,
+       wb_conn = &malidp->mw_connector;
+       wb_conn->base = &malidp->connector;
+       wb_conn->encoder = &malidp->encoder;
+       malidp->mw_connector.encoder->possible_crtcs = 1 << 
drm_crtc_index(&malidp->crtc);
+       drm_connector_helper_add(wb_conn->base,
                                 &malidp_mw_connector_helper_funcs);
 
        formats = get_writeback_formats(malidp, &n_formats);
        if (!formats)
                return -ENOMEM;
 
-       ret = drm_writeback_connector_init(drm, &malidp->mw_connector,
+       ret = drm_writeback_connector_init(drm, wb_conn,
                                           &malidp_mw_connector_funcs,
                                           &malidp_mw_encoder_helper_funcs,
                                           formats, n_formats);
@@ -236,7 +240,7 @@ void malidp_mw_atomic_commit(struct drm_device *drm,
 {
        struct malidp_drm *malidp = drm->dev_private;
        struct drm_writeback_connector *mw_conn = &malidp->mw_connector;
-       struct drm_connector_state *conn_state = mw_conn->base.state;
+       struct drm_connector_state *conn_state = mw_conn->base->state;
        struct malidp_hw_device *hwdev = malidp->dev;
        struct malidp_mw_connector_state *mw_state;
 
-- 
2.17.1

Reply via email to