Skip to content

Commit 70c3881

Browse files
author
Thomas Zimmermann
committed
drm/mgag200: Set/clear <syncrst> field in display enable/disable helpers
Modifying the <syncrst> field in mgag200_{enable,disable}_display() makes the code more readable. Also clear the <asyncrst> field to enable the display. The other bits in SEQ0 are unused, so no functional changes are made. Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Lyude Paul <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 153fef4 commit 70c3881

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

drivers/gpu/drm/mgag200/mgag200_mode.c

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1284,7 +1284,12 @@ static void mgag200_g200ev_set_hiprilvl(struct mga_device *mdev)
12841284

12851285
static void mgag200_enable_display(struct mga_device *mdev)
12861286
{
1287-
u8 seq1, crtcext1;
1287+
u8 seq0, seq1, crtcext1;
1288+
1289+
RREG_SEQ(0x00, seq0);
1290+
seq0 |= MGAREG_SEQ0_SYNCRST |
1291+
MGAREG_SEQ0_ASYNCRST;
1292+
WREG_SEQ(0x00, seq0);
12881293

12891294
/*
12901295
* TODO: replace busy waiting with vblank IRQ; put
@@ -1307,7 +1312,11 @@ static void mgag200_enable_display(struct mga_device *mdev)
13071312

13081313
static void mgag200_disable_display(struct mga_device *mdev)
13091314
{
1310-
u8 seq1, crtcext1;
1315+
u8 seq0, seq1, crtcext1;
1316+
1317+
RREG_SEQ(0x00, seq0);
1318+
seq0 &= ~MGAREG_SEQ0_SYNCRST;
1319+
WREG_SEQ(0x00, seq0);
13111320

13121321
/*
13131322
* TODO: replace busy waiting with vblank IRQ; put
@@ -1338,9 +1347,6 @@ static void mga_crtc_prepare(struct drm_crtc *crtc)
13381347
struct drm_device *dev = crtc->dev;
13391348
struct mga_device *mdev = to_mga_device(dev);
13401349

1341-
/* start sync reset */
1342-
WREG_SEQ(0, 1);
1343-
13441350
if (mdev->type == G200_WB || mdev->type == G200_EW3)
13451351
mga_g200wb_prepare(crtc);
13461352
}
@@ -1357,7 +1363,6 @@ static void mga_crtc_commit(struct drm_crtc *crtc)
13571363
if (mdev->type == G200_WB || mdev->type == G200_EW3)
13581364
mga_g200wb_commit(crtc);
13591365

1360-
WREG_SEQ(0, 0x3);
13611366
mga_crtc_load_lut(crtc);
13621367
mgag200_enable_display(mdev);
13631368
}

drivers/gpu/drm/mgag200/mgag200_reg.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,9 @@
236236
#define MGAREG_SEQ_INDEX 0x1fc4
237237
#define MGAREG_SEQ_DATA 0x1fc5
238238

239+
#define MGAREG_SEQ0_ASYNCRST BIT(0)
240+
#define MGAREG_SEQ0_SYNCRST BIT(1)
241+
239242
#define MGAREG_SEQ1_SCROFF BIT(5)
240243

241244
#define MGAREG_CRTC_INDEX 0x1fd4

0 commit comments

Comments
 (0)