]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/mgag200: Use adjusted mode values for CRTCs
authorThomas Zimmermann <tzimmermann@suse.de>
Thu, 18 Jul 2024 10:44:13 +0000 (12:44 +0200)
committerThomas Zimmermann <tzimmermann@suse.de>
Fri, 19 Jul 2024 08:40:20 +0000 (10:40 +0200)
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 <tzimmermann@suse.de>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240718104551.575912-4-tzimmermann@suse.de
drivers/gpu/drm/mgag200/mgag200_mode.c

index 6a0477426c07bfba7b8c0e1e45bd0723facf13c4..1174fb79831e62144ffa0da3d746fd152781a187 100644 (file)
@@ -208,19 +208,19 @@ void mgag200_set_mode_regs(struct mga_device *mdev, const struct drm_display_mod
        unsigned int vdispend, vsyncstr, vsyncend, vtotal;
        u8 misc, crtcext1, crtcext2, crtcext5;
 
-       hdispend = mode->hdisplay / 8 - 1;
-       hsyncstr = mode->hsync_start / 8 - 1;
-       hsyncend = mode->hsync_end / 8 - 1;
-       htotal = mode->htotal / 8 - 1;
+       hdispend = mode->crtc_hdisplay / 8 - 1;
+       hsyncstr = mode->crtc_hsync_start / 8 - 1;
+       hsyncend = mode->crtc_hsync_end / 8 - 1;
+       htotal = mode->crtc_htotal / 8 - 1;
 
        /* Work around hardware quirk */
        if ((htotal & 0x07) == 0x06 || (htotal & 0x07) == 0x04)
                htotal++;
 
-       vdispend = mode->vdisplay - 1;
-       vsyncstr = mode->vsync_start - 1;
-       vsyncend = mode->vsync_end - 1;
-       vtotal = mode->vtotal - 2;
+       vdispend = mode->crtc_vdisplay - 1;
+       vsyncstr = mode->crtc_vsync_start - 1;
+       vsyncend = mode->crtc_vsync_end - 1;
+       vtotal = mode->crtc_vtotal - 2;
 
        misc = RREG8(MGA_MISC_IN);