drm/vkms: fix xrgb on compute crc
authorMelissa Wen <melissa.srw@gmail.com>
Thu, 30 Jul 2020 20:25:24 +0000 (17:25 -0300)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Sun, 2 Aug 2020 13:22:31 +0000 (15:22 +0200)
The previous memset operation was not correctly zeroing the alpha
channel to compute the crc, and as a result, the IGT subtest
kms_cursor_crc/pipe-A-cursor-alpha-transparent fails.

Fixes: db7f419c06d7c ("drm/vkms: Compute CRC with Cursor Plane")
Signed-off-by: Melissa Wen <melissa.srw@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20200730202524.5upzuh4irboru7my@smtp.gmail.com
drivers/gpu/drm/vkms/vkms_composer.c

index 4af2f19480f4f490288693ef0e69cac8f1b69ed5..b8b060354667e22e9f7f156a20fb55484621e989 100644 (file)
@@ -33,7 +33,7 @@ static uint32_t compute_crc(void *vaddr_out, struct vkms_composer *composer)
                                     + (i * composer->pitch)
                                     + (j * composer->cpp);
                        /* XRGB format ignores Alpha channel */
-                       memset(vaddr_out + src_offset + 24, 0,  8);
+                       bitmap_clear(vaddr_out + src_offset, 24, 8);
                        crc = crc32_le(crc, vaddr_out + src_offset,
                                       sizeof(u32));
                }