summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/mgag200
diff options
context:
space:
mode:
authorThomas Zimmermann <tzimmermann@suse.de>2022-06-01 14:25:21 +0300
committerThomas Zimmermann <tzimmermann@suse.de>2022-06-07 10:40:08 +0300
commitd1e40d8e4b4df3f705c7898b264b2cfb60bdafc4 (patch)
treea2041aa1bacb94a4741f821884b40faae3ad9334 /drivers/gpu/drm/mgag200
parent98da4b99a0525c222dab7cd8e73153eaea062dc3 (diff)
downloadlinux-d1e40d8e4b4df3f705c7898b264b2cfb60bdafc4.tar.xz
drm/mgag200: Store vidrst flag in device info
Set new vidrst flag in device info for models that synchronize with external sources (i.e., BMCs). In modesetting, set the corresponding bits from the device-info flag. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> Tested-by: Jocelyn Falempe <jfalempe@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20220601112522.5774-10-tzimmermann@suse.de
Diffstat (limited to 'drivers/gpu/drm/mgag200')
-rw-r--r--drivers/gpu/drm/mgag200/mgag200_drv.h6
-rw-r--r--drivers/gpu/drm/mgag200/mgag200_g200.c2
-rw-r--r--drivers/gpu/drm/mgag200/mgag200_g200eh.c2
-rw-r--r--drivers/gpu/drm/mgag200/mgag200_g200eh3.c2
-rw-r--r--drivers/gpu/drm/mgag200/mgag200_g200er.c2
-rw-r--r--drivers/gpu/drm/mgag200/mgag200_g200ev.c2
-rw-r--r--drivers/gpu/drm/mgag200/mgag200_g200ew3.c2
-rw-r--r--drivers/gpu/drm/mgag200/mgag200_g200se.c12
-rw-r--r--drivers/gpu/drm/mgag200/mgag200_g200wb.c2
-rw-r--r--drivers/gpu/drm/mgag200/mgag200_mode.c7
-rw-r--r--drivers/gpu/drm/mgag200/mgag200_reg.h2
11 files changed, 24 insertions, 17 deletions
diff --git a/drivers/gpu/drm/mgag200/mgag200_drv.h b/drivers/gpu/drm/mgag200/mgag200_drv.h
index f0fb13238f4f..1ceb19a987e2 100644
--- a/drivers/gpu/drm/mgag200/mgag200_drv.h
+++ b/drivers/gpu/drm/mgag200/mgag200_drv.h
@@ -200,6 +200,9 @@ struct mgag200_device_info {
*/
unsigned long max_mem_bandwidth;
+ /* HW has external source (e.g., BMC) to synchronize with */
+ bool has_vidrst:1;
+
/*
* HW does not handle 'startadd' register correctly. Always set
* it's value to 0.
@@ -208,11 +211,12 @@ struct mgag200_device_info {
};
#define MGAG200_DEVICE_INFO_INIT(_max_hdisplay, _max_vdisplay, _max_mem_bandwidth, \
- _bug_no_startadd) \
+ _has_vidrst, _bug_no_startadd) \
{ \
.max_hdisplay = (_max_hdisplay), \
.max_vdisplay = (_max_vdisplay), \
.max_mem_bandwidth = (_max_mem_bandwidth), \
+ .has_vidrst = (_has_vidrst), \
.bug_no_startadd = (_bug_no_startadd), \
}
diff --git a/drivers/gpu/drm/mgag200/mgag200_g200.c b/drivers/gpu/drm/mgag200/mgag200_g200.c
index 4ec1b18ab170..58ae5d067263 100644
--- a/drivers/gpu/drm/mgag200/mgag200_g200.c
+++ b/drivers/gpu/drm/mgag200/mgag200_g200.c
@@ -34,7 +34,7 @@ static int mgag200_g200_init_pci_options(struct pci_dev *pdev)
*/
static const struct mgag200_device_info mgag200_g200_device_info =
- MGAG200_DEVICE_INFO_INIT(2048, 2048, 0, false);
+ MGAG200_DEVICE_INFO_INIT(2048, 2048, 0, false, false);
static void mgag200_g200_interpret_bios(struct mgag200_g200_device *g200,
const unsigned char *bios, size_t size)
diff --git a/drivers/gpu/drm/mgag200/mgag200_g200eh.c b/drivers/gpu/drm/mgag200/mgag200_g200eh.c
index a35ba2fdfc0e..ee38d918c727 100644
--- a/drivers/gpu/drm/mgag200/mgag200_g200eh.c
+++ b/drivers/gpu/drm/mgag200/mgag200_g200eh.c
@@ -11,7 +11,7 @@
*/
static const struct mgag200_device_info mgag200_g200eh_device_info =
- MGAG200_DEVICE_INFO_INIT(2048, 2048, 37500, false);
+ MGAG200_DEVICE_INFO_INIT(2048, 2048, 37500, false, false);
struct mga_device *mgag200_g200eh_device_create(struct pci_dev *pdev, const struct drm_driver *drv,
enum mga_type type)
diff --git a/drivers/gpu/drm/mgag200/mgag200_g200eh3.c b/drivers/gpu/drm/mgag200/mgag200_g200eh3.c
index 649559be1482..4b69206296ee 100644
--- a/drivers/gpu/drm/mgag200/mgag200_g200eh3.c
+++ b/drivers/gpu/drm/mgag200/mgag200_g200eh3.c
@@ -11,7 +11,7 @@
*/
static const struct mgag200_device_info mgag200_g200eh3_device_info =
- MGAG200_DEVICE_INFO_INIT(2048, 2048, 0, false);
+ MGAG200_DEVICE_INFO_INIT(2048, 2048, 0, false, false);
struct mga_device *mgag200_g200eh3_device_create(struct pci_dev *pdev,
const struct drm_driver *drv,
diff --git a/drivers/gpu/drm/mgag200/mgag200_g200er.c b/drivers/gpu/drm/mgag200/mgag200_g200er.c
index e661fad2f8b2..7e44fcc7bb59 100644
--- a/drivers/gpu/drm/mgag200/mgag200_g200er.c
+++ b/drivers/gpu/drm/mgag200/mgag200_g200er.c
@@ -11,7 +11,7 @@
*/
static const struct mgag200_device_info mgag200_g200er_device_info =
- MGAG200_DEVICE_INFO_INIT(2048, 2048, 55000, false);
+ MGAG200_DEVICE_INFO_INIT(2048, 2048, 55000, false, false);
struct mga_device *mgag200_g200er_device_create(struct pci_dev *pdev, const struct drm_driver *drv,
enum mga_type type)
diff --git a/drivers/gpu/drm/mgag200/mgag200_g200ev.c b/drivers/gpu/drm/mgag200/mgag200_g200ev.c
index 07a3862d69de..87a9497ab805 100644
--- a/drivers/gpu/drm/mgag200/mgag200_g200ev.c
+++ b/drivers/gpu/drm/mgag200/mgag200_g200ev.c
@@ -11,7 +11,7 @@
*/
static const struct mgag200_device_info mgag200_g200ev_device_info =
- MGAG200_DEVICE_INFO_INIT(2048, 2048, 32700, false);
+ MGAG200_DEVICE_INFO_INIT(2048, 2048, 32700, false, false);
struct mga_device *mgag200_g200ev_device_create(struct pci_dev *pdev, const struct drm_driver *drv,
enum mga_type type)
diff --git a/drivers/gpu/drm/mgag200/mgag200_g200ew3.c b/drivers/gpu/drm/mgag200/mgag200_g200ew3.c
index 7f3987435085..61f944319bc9 100644
--- a/drivers/gpu/drm/mgag200/mgag200_g200ew3.c
+++ b/drivers/gpu/drm/mgag200/mgag200_g200ew3.c
@@ -11,7 +11,7 @@
*/
static const struct mgag200_device_info mgag200_g200ew3_device_info =
- MGAG200_DEVICE_INFO_INIT(2048, 2048, 0, false);
+ MGAG200_DEVICE_INFO_INIT(2048, 2048, 0, true, false);
static resource_size_t mgag200_g200ew3_device_probe_vram(struct mga_device *mdev)
{
diff --git a/drivers/gpu/drm/mgag200/mgag200_g200se.c b/drivers/gpu/drm/mgag200/mgag200_g200se.c
index 78120470b7be..0ccec9358529 100644
--- a/drivers/gpu/drm/mgag200/mgag200_g200se.c
+++ b/drivers/gpu/drm/mgag200/mgag200_g200se.c
@@ -33,22 +33,22 @@ static int mgag200_g200se_init_pci_options(struct pci_dev *pdev)
*/
static const struct mgag200_device_info mgag200_g200se_a_01_device_info =
- MGAG200_DEVICE_INFO_INIT(1600, 1200, 24400, true);
+ MGAG200_DEVICE_INFO_INIT(1600, 1200, 24400, false, true);
static const struct mgag200_device_info mgag200_g200se_a_02_device_info =
- MGAG200_DEVICE_INFO_INIT(1920, 1200, 30100, true);
+ MGAG200_DEVICE_INFO_INIT(1920, 1200, 30100, false, true);
static const struct mgag200_device_info mgag200_g200se_a_03_device_info =
- MGAG200_DEVICE_INFO_INIT(2048, 2048, 55000, false);
+ MGAG200_DEVICE_INFO_INIT(2048, 2048, 55000, false, false);
static const struct mgag200_device_info mgag200_g200se_b_01_device_info =
- MGAG200_DEVICE_INFO_INIT(1600, 1200, 24400, false);
+ MGAG200_DEVICE_INFO_INIT(1600, 1200, 24400, false, false);
static const struct mgag200_device_info mgag200_g200se_b_02_device_info =
- MGAG200_DEVICE_INFO_INIT(1920, 1200, 30100, false);
+ MGAG200_DEVICE_INFO_INIT(1920, 1200, 30100, false, false);
static const struct mgag200_device_info mgag200_g200se_b_03_device_info =
- MGAG200_DEVICE_INFO_INIT(2048, 2048, 55000, false);
+ MGAG200_DEVICE_INFO_INIT(2048, 2048, 55000, false, false);
static int mgag200_g200se_init_unique_rev_id(struct mgag200_g200se_device *g200se)
{
diff --git a/drivers/gpu/drm/mgag200/mgag200_g200wb.c b/drivers/gpu/drm/mgag200/mgag200_g200wb.c
index 0943ad2a9999..97002c08da41 100644
--- a/drivers/gpu/drm/mgag200/mgag200_g200wb.c
+++ b/drivers/gpu/drm/mgag200/mgag200_g200wb.c
@@ -11,7 +11,7 @@
*/
static const struct mgag200_device_info mgag200_g200wb_device_info =
- MGAG200_DEVICE_INFO_INIT(1280, 1024, 31877, false);
+ MGAG200_DEVICE_INFO_INIT(1280, 1024, 31877, true, false);
struct mga_device *mgag200_g200wb_device_create(struct pci_dev *pdev, const struct drm_driver *drv,
enum mga_type type)
diff --git a/drivers/gpu/drm/mgag200/mgag200_mode.c b/drivers/gpu/drm/mgag200/mgag200_mode.c
index aa85558faa1b..e339f50d6bc8 100644
--- a/drivers/gpu/drm/mgag200/mgag200_mode.c
+++ b/drivers/gpu/drm/mgag200/mgag200_mode.c
@@ -377,6 +377,7 @@ static void mgag200_init_regs(struct mga_device *mdev)
static void mgag200_set_mode_regs(struct mga_device *mdev,
const struct drm_display_mode *mode)
{
+ const struct mgag200_device_info *info = mdev->info;
unsigned int hdisplay, hsyncstart, hsyncend, htotal;
unsigned int vdisplay, vsyncstart, vsyncend, vtotal;
u8 misc, crtcext1, crtcext2, crtcext5;
@@ -411,9 +412,9 @@ static void mgag200_set_mode_regs(struct mga_device *mdev,
((hdisplay & 0x100) >> 7) |
((hsyncstart & 0x100) >> 6) |
(htotal & 0x40);
- if (mdev->type == G200_WB || mdev->type == G200_EW3)
- crtcext1 |= BIT(7) | /* vrsten */
- BIT(3); /* hrsten */
+ if (info->has_vidrst)
+ crtcext1 |= MGAREG_CRTCEXT1_VRSTEN |
+ MGAREG_CRTCEXT1_HRSTEN;
crtcext2 = ((vtotal & 0xc00) >> 10) |
((vdisplay & 0x400) >> 8) |
diff --git a/drivers/gpu/drm/mgag200/mgag200_reg.h b/drivers/gpu/drm/mgag200/mgag200_reg.h
index 60e705283fe8..99a9ab7d9119 100644
--- a/drivers/gpu/drm/mgag200/mgag200_reg.h
+++ b/drivers/gpu/drm/mgag200/mgag200_reg.h
@@ -252,8 +252,10 @@
#define MGAREG_CRTCEXT0_OFFSET_MASK GENMASK(5, 4)
+#define MGAREG_CRTCEXT1_VRSTEN BIT(7)
#define MGAREG_CRTCEXT1_VSYNCOFF BIT(5)
#define MGAREG_CRTCEXT1_HSYNCOFF BIT(4)
+#define MGAREG_CRTCEXT1_HRSTEN BIT(3)
#define MGAREG_CRTCEXT3_MGAMODE BIT(7)