Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/mgag200: Add dedicted variable for <linecomp> field

Replace the line-compare value of <vdispend> with a dedicated variable
<linecomp>. Improves readability and prepares for vblank support.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20240718104551.575912-6-tzimmermann@suse.de

+7 -4
+7 -4
drivers/gpu/drm/mgag200/mgag200_mode.c
··· 206 206 { 207 207 unsigned int hdispend, hsyncstr, hsyncend, htotal, hblkstr, hblkend; 208 208 unsigned int vdispend, vsyncstr, vsyncend, vtotal, vblkstr, vblkend; 209 + unsigned int linecomp; 209 210 u8 misc, crtcext1, crtcext2, crtcext5; 210 211 211 212 hdispend = mode->crtc_hdisplay / 8 - 1; ··· 225 224 vtotal = mode->crtc_vtotal - 2; 226 225 vblkstr = mode->crtc_vblank_start; 227 226 vblkend = vtotal + 1; 227 + 228 + linecomp = vdispend; 228 229 229 230 misc = RREG8(MGA_MISC_IN); 230 231 ··· 252 249 ((vdispend & 0x400) >> 8) | 253 250 ((vblkstr & 0xc00) >> 7) | 254 251 ((vsyncstr & 0xc00) >> 5) | 255 - ((vdispend & 0x400) >> 3); 252 + ((linecomp & 0x400) >> 3); 256 253 crtcext5 = 0x00; 257 254 258 255 WREG_CRT(0x00, htotal - 4); ··· 266 263 ((vdispend & 0x100) >> 7) | 267 264 ((vsyncstr & 0x100) >> 6) | 268 265 ((vblkstr & 0x100) >> 5) | 269 - ((vdispend & 0x100) >> 4) | /* linecomp */ 266 + ((linecomp & 0x100) >> 4) | 270 267 ((vtotal & 0x200) >> 4) | 271 268 ((vdispend & 0x200) >> 3) | 272 269 ((vsyncstr & 0x200) >> 2)); 273 270 WREG_CRT(0x09, ((vblkstr & 0x200) >> 4) | 274 - ((vdispend & 0x200) >> 3)); 271 + ((linecomp & 0x200) >> 3)); 275 272 WREG_CRT(0x10, vsyncstr & 0xff); 276 273 WREG_CRT(0x11, (vsyncend & 0x0f) | 0x20); 277 274 WREG_CRT(0x12, vdispend & 0xff); ··· 279 276 WREG_CRT(0x15, vblkstr & 0xff); 280 277 WREG_CRT(0x16, vblkend & 0xff); 281 278 WREG_CRT(0x17, 0xc3); 282 - WREG_CRT(0x18, vdispend & 0xff); 279 + WREG_CRT(0x18, linecomp & 0xff); 283 280 284 281 WREG_ECRT(0x01, crtcext1); 285 282 WREG_ECRT(0x02, crtcext2);