Skip to content

Commit 7c65dc5

Browse files
ondrackametux
authored andcommitted
modesetting: byte-swap ARGB cursor uploads on big-endian
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2156>
1 parent 5e0430e commit 7c65dc5

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

hw/xfree86/drivers/modesetting/drmmode_display.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@
5858

5959
#include "driver.h"
6060

61+
#if X_BYTE_ORDER == X_BIG_ENDIAN
62+
#define cpu_to_le32(x) bswap_32(x)
63+
#else
64+
#define cpu_to_le32(x) (x)
65+
#endif
66+
6167
static Bool drmmode_xf86crtc_resize(ScrnInfoPtr scrn, int width, int height);
6268
static PixmapPtr drmmode_create_pixmap_header(ScreenPtr pScreen, int width, int height,
6369
int depth, int bitsPerPixel, int devKind,
@@ -1875,7 +1881,7 @@ drmmode_load_cursor_argb_check(xf86CrtcPtr crtc, CARD32 *image)
18751881
i = 0;
18761882
for (y = 0; y < height; y++) {
18771883
for (x = 0; x < width; x++)
1878-
ptr[i++] = image[y * ms->max_cursor_width + x]; // cpu_to_le32(image[i]);
1884+
ptr[i++] = cpu_to_le32(image[y * ms->max_cursor_width + x]);
18791885
}
18801886
/* clear the remainder for good measure */
18811887
for (; i < ms->max_cursor_width * ms->max_cursor_height; i++)

0 commit comments

Comments
 (0)