Skip to content

Commit e8f834b

Browse files
author
Thomas Zimmermann
committed
drm/mgag200: Use adjusted mode values for CRTCs
Use the values with the crtc_ prefix from struct drm_display_mode to program hardware. The DRM core adjusted these values to the requirements of CRTC hardware. Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Jocelyn Falempe <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent b345b35 commit e8f834b

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

drivers/gpu/drm/mgag200/mgag200_mode.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -208,19 +208,19 @@ void mgag200_set_mode_regs(struct mga_device *mdev, const struct drm_display_mod
208208
unsigned int vdispend, vsyncstr, vsyncend, vtotal;
209209
u8 misc, crtcext1, crtcext2, crtcext5;
210210

211-
hdispend = mode->hdisplay / 8 - 1;
212-
hsyncstr = mode->hsync_start / 8 - 1;
213-
hsyncend = mode->hsync_end / 8 - 1;
214-
htotal = mode->htotal / 8 - 1;
211+
hdispend = mode->crtc_hdisplay / 8 - 1;
212+
hsyncstr = mode->crtc_hsync_start / 8 - 1;
213+
hsyncend = mode->crtc_hsync_end / 8 - 1;
214+
htotal = mode->crtc_htotal / 8 - 1;
215215

216216
/* Work around hardware quirk */
217217
if ((htotal & 0x07) == 0x06 || (htotal & 0x07) == 0x04)
218218
htotal++;
219219

220-
vdispend = mode->vdisplay - 1;
221-
vsyncstr = mode->vsync_start - 1;
222-
vsyncend = mode->vsync_end - 1;
223-
vtotal = mode->vtotal - 2;
220+
vdispend = mode->crtc_vdisplay - 1;
221+
vsyncstr = mode->crtc_vsync_start - 1;
222+
vsyncend = mode->crtc_vsync_end - 1;
223+
vtotal = mode->crtc_vtotal - 2;
224224

225225
misc = RREG8(MGA_MISC_IN);
226226

0 commit comments

Comments
 (0)