Skip to content

Commit 379ba80

Browse files
author
Thomas Zimmermann
committed
drm/mgag200: Don't set or clear <scroff> field during modeset
The simple pipe's disable function disables the screen by calling mgag200_disable_screen(). The simple pipe's enable function enables the screen by calling mgag200_enable_display(). During modeset operations the screen is off and remains off. It's only enabled after the modeset has been completed. Therefore remove all code that sets or clears the <scroff> field while in modeset. The related code also modifies the <syncrst> field in SEQ0. For now, keep this code in place. Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Lyude Paul <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent fc42e89 commit 379ba80

File tree

1 file changed

+3
-39
lines changed

1 file changed

+3
-39
lines changed

drivers/gpu/drm/mgag200/mgag200_mode.c

Lines changed: 3 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1219,14 +1219,8 @@ static void mgag200_set_format_regs(struct mga_device *mdev,
12191219
static void mgag200_g200er_reset_tagfifo(struct mga_device *mdev)
12201220
{
12211221
static uint32_t RESET_FLAG = 0x00200000; /* undocumented magic value */
1222-
u8 seq1;
12231222
u32 memctl;
12241223

1225-
/* screen off */
1226-
RREG_SEQ(0x01, seq1);
1227-
seq1 |= MGAREG_SEQ1_SCROFF;
1228-
WREG_SEQ(0x01, seq1);
1229-
12301224
memctl = RREG32(MGAREG_MEMCTL);
12311225

12321226
memctl |= RESET_FLAG;
@@ -1236,11 +1230,6 @@ static void mgag200_g200er_reset_tagfifo(struct mga_device *mdev)
12361230

12371231
memctl &= ~RESET_FLAG;
12381232
WREG32(MGAREG_MEMCTL, memctl);
1239-
1240-
/* screen on */
1241-
RREG_SEQ(0x01, seq1);
1242-
seq1 &= ~MGAREG_SEQ1_SCROFF;
1243-
WREG_SEQ(0x01, seq1);
12441233
}
12451234

12461235
static void mgag200_g200se_set_hiprilvl(struct mga_device *mdev,
@@ -1339,21 +1328,9 @@ static void mga_crtc_prepare(struct drm_crtc *crtc)
13391328
{
13401329
struct drm_device *dev = crtc->dev;
13411330
struct mga_device *mdev = to_mga_device(dev);
1342-
u8 tmp;
1343-
1344-
if (mdev->type == G200_SE_A || mdev->type == G200_SE_B) {
1345-
WREG_SEQ(0, 1);
1346-
msleep(50);
1347-
WREG_SEQ(1, 0x20);
1348-
msleep(20);
1349-
} else {
1350-
WREG8(MGAREG_SEQ_INDEX, 0x1);
1351-
tmp = RREG8(MGAREG_SEQ_DATA);
13521331

1353-
/* start sync reset */
1354-
WREG_SEQ(0, 1);
1355-
WREG_SEQ(1, tmp | 0x20);
1356-
}
1332+
/* start sync reset */
1333+
WREG_SEQ(0, 1);
13571334

13581335
if (mdev->type == G200_WB || mdev->type == G200_EW3)
13591336
mga_g200wb_prepare(crtc);
@@ -1367,24 +1344,11 @@ static void mga_crtc_commit(struct drm_crtc *crtc)
13671344
{
13681345
struct drm_device *dev = crtc->dev;
13691346
struct mga_device *mdev = to_mga_device(dev);
1370-
u8 tmp;
13711347

13721348
if (mdev->type == G200_WB || mdev->type == G200_EW3)
13731349
mga_g200wb_commit(crtc);
13741350

1375-
if (mdev->type == G200_SE_A || mdev->type == G200_SE_B) {
1376-
msleep(50);
1377-
WREG_SEQ(1, 0x0);
1378-
msleep(20);
1379-
WREG_SEQ(0, 0x3);
1380-
} else {
1381-
WREG8(MGAREG_SEQ_INDEX, 0x1);
1382-
tmp = RREG8(MGAREG_SEQ_DATA);
1383-
1384-
tmp &= ~0x20;
1385-
WREG_SEQ(0x1, tmp);
1386-
WREG_SEQ(0, 3);
1387-
}
1351+
WREG_SEQ(0, 0x3);
13881352
mga_crtc_dpms(crtc, DRM_MODE_DPMS_ON);
13891353
}
13901354

0 commit comments

Comments
 (0)