[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190814184702.54275-19-john.stultz@linaro.org>
Date: Wed, 14 Aug 2019 18:46:54 +0000
From: John Stultz <john.stultz@...aro.org>
To: lkml <linux-kernel@...r.kernel.org>
Cc: Xu YiPing <xuyiping@...ilicon.com>,
Rongrong Zou <zourongrong@...il.com>,
Xinliang Liu <z.liuxinliang@...ilicon.com>,
David Airlie <airlied@...ux.ie>,
Daniel Vetter <daniel@...ll.ch>,
dri-devel <dri-devel@...ts.freedesktop.org>,
Sam Ravnborg <sam@...nborg.org>,
John Stultz <john.stultz@...aro.org>
Subject: [RESEND][PATCH v3 18/26] drm: kirin: Move config max_width and max_height to driver data
From: Xu YiPing <xuyiping@...ilicon.com>
As part of refactoring the kirin driver to better support
different hardware revisions, this patch moves the max_width
and max_height values used in kirin_drm_mode_config_inita to
hardware specific driver data.
This will make it easier to add support for new devices
via a new kirin_drm_data structure.
Cc: Rongrong Zou <zourongrong@...il.com>
Cc: Xinliang Liu <z.liuxinliang@...ilicon.com>
Cc: David Airlie <airlied@...ux.ie>
Cc: Daniel Vetter <daniel@...ll.ch>
Cc: dri-devel <dri-devel@...ts.freedesktop.org>
Cc: Sam Ravnborg <sam@...nborg.org>
Reviewed-by: Sam Ravnborg <sam@...nborg.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 | 2 ++
drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 17 +++++------------
drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.h | 2 ++
3 files changed, 9 insertions(+), 12 deletions(-)
diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
index fc0f4c04d1c9..68efd508d86b 100644
--- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
+++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c
@@ -1054,6 +1054,8 @@ struct kirin_drm_data ade_driver_data = {
.prim_plane = ADE_CH1,
.channel_formats = channel_formats,
.channel_formats_cnt = ARRAY_SIZE(channel_formats),
+ .config_max_width = 2048,
+ .config_max_height = 2048,
.crtc_helper_funcs = &ade_crtc_helper_funcs,
.crtc_funcs = &ade_crtc_funcs,
.plane_helper_funcs = &ade_plane_helper_funcs,
diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
index bf1e601fb367..7956d698d368 100644
--- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
+++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
@@ -39,17 +39,6 @@ static int kirin_drm_kms_cleanup(struct drm_device *dev)
return 0;
}
-static void kirin_drm_mode_config_init(struct drm_device *dev)
-{
- dev->mode_config.min_width = 0;
- dev->mode_config.min_height = 0;
-
- dev->mode_config.max_width = 2048;
- dev->mode_config.max_height = 2048;
-
- dev->mode_config.funcs = driver_data->mode_config_funcs;
-}
-
static int kirin_drm_kms_init(struct drm_device *dev)
{
int ret;
@@ -58,7 +47,11 @@ static int kirin_drm_kms_init(struct drm_device *dev)
/* dev->mode_config initialization */
drm_mode_config_init(dev);
- kirin_drm_mode_config_init(dev);
+ dev->mode_config.min_width = 0;
+ dev->mode_config.min_height = 0;
+ dev->mode_config.max_width = driver_data->config_max_width;
+ dev->mode_config.max_height = driver_data->config_max_width;
+ dev->mode_config.funcs = driver_data->mode_config_funcs;
/* display controller init */
ret = driver_data->init(to_platform_device(dev->dev));
diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.h b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.h
index 2b660df60293..43be65f82a03 100644
--- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.h
+++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.h
@@ -37,6 +37,8 @@ struct kirin_plane {
struct kirin_drm_data {
const u32 *channel_formats;
u32 channel_formats_cnt;
+ int config_max_width;
+ int config_max_height;
u32 num_planes;
u32 prim_plane;
--
2.17.1
Powered by blists - more mailing lists