Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm/rockchip for big endian kernels use DRM_FORMAT_...



details:   https://anonhg.NetBSD.org/src/rev/c0d1a034890c
branches:  trunk
changeset: 378907:c0d1a034890c
user:      mrg <mrg%NetBSD.org@localhost>
date:      Wed Apr 28 04:51:41 2021 +0000

description:
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.

diffstat:

 sys/arch/arm/rockchip/rk_drm.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (30 lines):

diff -r f74425bb0704 -r c0d1a034890c sys/arch/arm/rockchip/rk_drm.c
--- a/sys/arch/arm/rockchip/rk_drm.c    Wed Apr 28 03:34:02 2021 +0000
+++ b/sys/arch/arm/rockchip/rk_drm.c    Wed Apr 28 04:51:41 2021 +0000
@@ -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 <jmcneill%invisible.ca@localhost>
@@ -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);



Home | Main Index | Thread Index | Old Index