[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1556061656-1733-25-git-send-email-john.stultz@linaro.org>
Date: Tue, 23 Apr 2019 16:20:55 -0700
From: John Stultz <john.stultz@...aro.org>
To: lkml <linux-kernel@...r.kernel.org>
Cc: Xu YiPing <xuyiping@...ilicon.com>,
Xinliang Liu <z.liuxinliang@...ilicon.com>,
Rongrong Zou <zourongrong@...il.com>,
Xinwei Kong <kong.kongxinwei@...ilicon.com>,
Chen Feng <puck.chen@...ilicon.com>,
David Airlie <airlied@...ux.ie>,
Daniel Vetter <daniel@...ll.ch>,
dri-devel <dri-devel@...ts.freedesktop.org>,
John Stultz <john.stultz@...aro.org>
Subject: [PATCH 24/25] drm: kirin: Pass driver data to crtc init and plane init
From: Xu YiPing <xuyiping@...ilicon.com>
As part of refactoring the kirin driver to better support
different hardware revisions, this patch changes funcitons
to pass the kirin_driver_data as a prameter.
This will allow those funcitons to be later moved to the
generic kirin_drm_drv.c
Cc: Xinliang Liu <z.liuxinliang@...ilicon.com>
Cc: Rongrong Zou <zourongrong@...il.com>
Cc: Xinwei Kong <kong.kongxinwei@...ilicon.com>
Cc: Chen Feng <puck.chen@...ilicon.com>
Cc: David Airlie <airlied@...ux.ie>
Cc: Daniel Vetter <daniel@...ll.ch>
Cc: dri-devel <dri-devel@...ts.freedesktop.org>
Signed-off-by: Xu YiPing <xuyiping@...ilicon.com>
[jstultz: Reworded commit message]
Signed-off-by: John Stultz <john.stultz@...aro.org>
---
drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c | 25 ++++++++++++++-----------
1 file changed, 14 insertions(+), 11 deletions(-)
diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
index 71671f8..876e25b 100644
--- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
+++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
@@ -572,7 +572,8 @@ static const struct drm_crtc_funcs ade_crtc_funcs = {
};
static int kirin_drm_crtc_init(struct drm_device *dev, struct drm_crtc *crtc,
- struct drm_plane *plane)
+ struct drm_plane *plane,
+ const struct kirin_drm_data *driver_data)
{
struct device_node *port;
int ret;
@@ -589,13 +590,13 @@ static int kirin_drm_crtc_init(struct drm_device *dev, struct drm_crtc *crtc,
crtc->port = port;
ret = drm_crtc_init_with_planes(dev, crtc, plane, NULL,
- ade_driver_data.crtc_funcs, NULL);
+ driver_data->crtc_funcs, NULL);
if (ret) {
DRM_ERROR("failed to init crtc.\n");
return ret;
}
- drm_crtc_helper_add(crtc, ade_driver_data.crtc_helper_funcs);
+ drm_crtc_helper_add(crtc, driver_data->crtc_helper_funcs);
return 0;
}
@@ -894,21 +895,22 @@ static struct drm_plane_funcs ade_plane_funcs = {
static int kirin_drm_plane_init(struct drm_device *dev,
struct kirin_plane *kplane,
- enum drm_plane_type type)
+ enum drm_plane_type type,
+ const struct kirin_drm_data *driver_data)
{
int ret = 0;
ret = drm_universal_plane_init(dev, &kplane->base, 1,
- ade_driver_data.plane_funcs,
- ade_driver_data.channel_formats,
- ade_driver_data.channel_formats_cnt,
- NULL, type, NULL);
+ driver_data->plane_funcs,
+ driver_data->channel_formats,
+ driver_data->channel_formats_cnt,
+ NULL, type, NULL);
if (ret) {
DRM_ERROR("fail to init plane, ch=%d\n", kplane->ch);
return ret;
}
- drm_plane_helper_add(&kplane->base, ade_driver_data.plane_helper_funcs);
+ drm_plane_helper_add(&kplane->base, driver_data->plane_helper_funcs);
return 0;
}
@@ -1024,14 +1026,15 @@ static int ade_drm_init(struct platform_device *pdev)
else
type = DRM_PLANE_TYPE_OVERLAY;
- ret = kirin_drm_plane_init(dev, kplane, type);
+ ret = kirin_drm_plane_init(dev, kplane, type, &ade_driver_data);
if (ret)
return ret;
}
/* crtc init */
ret = kirin_drm_crtc_init(dev, &kcrtc->base,
- &ade->planes[ade_driver_data.prim_plane].base);
+ &ade->planes[ade_driver_data.prim_plane].base,
+ &ade_driver_data);
if (ret)
return ret;
--
2.7.4
Powered by blists - more mailing lists