summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/tiny
diff options
context:
space:
mode:
authorThomas Zimmermann <tzimmermann@suse.de>2023-02-15 17:15:01 +0100
committerThomas Zimmermann <tzimmermann@suse.de>2023-03-13 10:35:47 +0100
commitd1c0cc8d0d7008856cf425c64d7203f95beed841 (patch)
treec057e327b8b2d19df163363c88516c0a0459d644 /drivers/gpu/drm/tiny
parenta1eccc574f977bd21a4ec8ac54bd73a2756bd281 (diff)
downloadlwn-d1c0cc8d0d7008856cf425c64d7203f95beed841.tar.gz
lwn-d1c0cc8d0d7008856cf425c64d7203f95beed841.zip
drm/cirrus: Compute blit destination offset in single location
The calculation for the scanout-buffer blit offset is independent from the color format. In the one case where the current code uses fb->pitches[0] instead of cirrus->pitch, their values are identical. Hence merge all into a single line. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> Acked-by: Gerd Hoffmann <kraxel@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230215161517.5113-2-tzimmermann@suse.de
Diffstat (limited to 'drivers/gpu/drm/tiny')
-rw-r--r--drivers/gpu/drm/tiny/cirrus.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/gpu/drm/tiny/cirrus.c b/drivers/gpu/drm/tiny/cirrus.c
index cf35b6090503..7fb21db8416d 100644
--- a/drivers/gpu/drm/tiny/cirrus.c
+++ b/drivers/gpu/drm/tiny/cirrus.c
@@ -327,17 +327,15 @@ static int cirrus_fb_blit_rect(struct drm_framebuffer *fb,
return -ENODEV;
iosys_map_set_vaddr_iomem(&dst, cirrus->vram);
+ iosys_map_incr(&dst, drm_fb_clip_offset(cirrus->pitch, fb->format, rect));
if (cirrus->cpp == fb->format->cpp[0]) {
- iosys_map_incr(&dst, drm_fb_clip_offset(fb->pitches[0], fb->format, rect));
drm_fb_memcpy(&dst, fb->pitches, vmap, fb, rect);
} else if (fb->format->cpp[0] == 4 && cirrus->cpp == 2) {
- iosys_map_incr(&dst, drm_fb_clip_offset(cirrus->pitch, fb->format, rect));
drm_fb_xrgb8888_to_rgb565(&dst, &cirrus->pitch, vmap, fb, rect, false);
} else if (fb->format->cpp[0] == 4 && cirrus->cpp == 3) {
- iosys_map_incr(&dst, drm_fb_clip_offset(cirrus->pitch, fb->format, rect));
drm_fb_xrgb8888_to_rgb888(&dst, &cirrus->pitch, vmap, fb, rect);
} else {