]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/mgag200: Simplify offset calculation
authorThomas Zimmermann <tzimmermann@suse.de>
Wed, 15 Apr 2026 15:23:37 +0000 (17:23 +0200)
committerThomas Zimmermann <tzimmermann@suse.de>
Mon, 20 Apr 2026 07:15:57 +0000 (09:15 +0200)
commit0bfc9fbd8e51184fe845a14d2f7357090f294568
tree075f25a5f786b33d56503be3982bdbf59c96692a
parent8d5ffd34c1adee5a25940961af4d10a3d18d0088
drm/mgag200: Simplify offset calculation

The offset value sets the distance in bytes between two consecutive
scanlines. Reduce the calculation to the minimum.

According to the Matrox programming manual, Sec 4.6.5, the offset
is the scanline pitch in bits divided by 128. The field pitches[0] in
struct drm_framebuffer stores the scanline pitch in bytes, so we have
to divide by 16 only. Reducing the existing bpp-shift look-up and
offset calculations also returns exactly this for all formats.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Co-developed-by: Jocelyn Falempe <jfalempe@redhat.com>
Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com>
Link: https://patch.msgid.link/20260415152625.101710-4-tzimmermann@suse.de
drivers/gpu/drm/mgag200/mgag200_mode.c