drm/mgag200: Clean up mga_set_start_address()
authorThomas Zimmermann <tzimmermann@suse.de>
Fri, 15 May 2020 08:32:20 +0000 (10:32 +0200)
committerThomas Zimmermann <tzimmermann@suse.de>
Tue, 19 May 2020 07:41:32 +0000 (09:41 +0200)
commitd6237687e08fec0eb98a505f4d0db08c14a899cf
tree15bd22e4fd643a29224f2f58cbba4e498b7df69c
parent5a77e2bfdd4f898289d9746cc9cd97651308ed14
drm/mgag200: Clean up mga_set_start_address()

All register names and fields are now named according to the
MGA programming manuals. The function doesn't need the CRTC, so
callers pass in the device structure directly. The logging now
uses device-specific macros.

The original implementation busy-waited for the VSYNC flag to go
up, to synchronize the page flip with the display's vblank. This
code has been moved to mga_crtc_mode_set_base(). It's still present
in the non-atomic code paths, but won't be used in atomic commits.
With atomic, we should use interrupts to synchronize with vblanks.

v3:
* clarify commit message wrt. vblank busy-waiting
v2:
* use to_mga_device()
* use MiB instead of MB
* replace empty while loop with do-while, fixes checkpatch warning
* replace uint{8,32}_t with u{8,32}

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Tested-by: John Donnelly <John.p.donnelly@oracle.com>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Acked-by: Emil Velikov <emil.velikov@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200515083233.32036-3-tzimmermann@suse.de
drivers/gpu/drm/mgag200/mgag200_drv.h
drivers/gpu/drm/mgag200/mgag200_mode.c