Module Name: src
Committed By: mrg
Date: Wed Apr 28 04:51:41 UTC 2021
Modified Files:
src/sys/arch/arm/rockchip: rk_drm.c
Log Message:
for big endian kernels use DRM_FORMAT_BGRX8888 pixel format.
now my pinebook pro console looks right with evbarm64-eb, instead
of having red and green swapped, and no blue. fixes both console
"text" mode and X11.
To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/sys/arch/arm/rockchip/rk_drm.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/arm/rockchip/rk_drm.c
diff -u src/sys/arch/arm/rockchip/rk_drm.c:1.5 src/sys/arch/arm/rockchip/rk_drm.c:1.6
--- src/sys/arch/arm/rockchip/rk_drm.c:1.5 Sat Apr 24 23:36:28 2021
+++ src/sys/arch/arm/rockchip/rk_drm.c Wed Apr 28 04:51:41 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: rk_drm.c,v 1.5 2021/04/24 23:36:28 thorpej Exp $ */
+/* $NetBSD: rk_drm.c,v 1.6 2021/04/28 04:51:41 mrg Exp $ */
/*-
* Copyright (c) 2019 Jared D. McNeill <[email protected]>
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rk_drm.c,v 1.5 2021/04/24 23:36:28 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rk_drm.c,v 1.6 2021/04/28 04:51:41 mrg Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -330,7 +330,11 @@ rk_drm_fb_probe(struct drm_fb_helper *he
fb->offsets[0] = 0;
fb->width = width;
fb->height = height;
+#ifdef __ARM_BIG_ENDIAN
+ fb->pixel_format = DRM_FORMAT_BGRX8888;
+#else
fb->pixel_format = DRM_FORMAT_XRGB8888;
+#endif
drm_fb_get_bpp_depth(fb->pixel_format, &fb->depth, &fb->bits_per_pixel);
error = drm_framebuffer_init(ddev, fb, &rk_drm_framebuffer_funcs);