Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm/sunxi Treat ARGB/XRGB as BGRA/BGRX on big endia...



details:   https://anonhg.NetBSD.org/src/rev/d401ec4af076
branches:  trunk
changeset: 955981:d401ec4af076
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sun Oct 18 14:00:08 2020 +0000

description:
Treat ARGB/XRGB as BGRA/BGRX on big endian kernels.

diffstat:

 sys/arch/arm/sunxi/sunxi_mixer.c |  14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diffs (46 lines):

diff -r e7e097535ef3 -r d401ec4af076 sys/arch/arm/sunxi/sunxi_mixer.c
--- a/sys/arch/arm/sunxi/sunxi_mixer.c  Sun Oct 18 13:07:31 2020 +0000
+++ b/sys/arch/arm/sunxi/sunxi_mixer.c  Sun Oct 18 14:00:08 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_mixer.c,v 1.11 2020/02/09 15:22:25 jakllsch Exp $ */
+/* $NetBSD: sunxi_mixer.c,v 1.12 2020/10/18 14:00:08 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2019 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sunxi_mixer.c,v 1.11 2020/02/09 15:22:25 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sunxi_mixer.c,v 1.12 2020/10/18 14:00:08 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -99,8 +99,13 @@
 #define          OVL_V_ATTCTL_LAY_FBFMT_YUV422         0x06
 #define          OVL_V_ATTCTL_LAY_FBFMT_YUV420         0x0a
 #define          OVL_V_ATTCTL_LAY_FBFMT_YUV411         0x0e
+#if BYTE_ORDER == BIG_ENDIAN
+#define          OVL_V_ATTCTL_LAY_FBFMT_ARGB_8888      0x03
+#define          OVL_V_ATTCTL_LAY_FBFMT_XRGB_8888      0x07
+#else
 #define          OVL_V_ATTCTL_LAY_FBFMT_ARGB_8888      0x00
 #define          OVL_V_ATTCTL_LAY_FBFMT_XRGB_8888      0x04
+#endif
 #define         OVL_V_ATTCTL_LAY0_EN                   __BIT(0)
 #define        OVL_V_MBSIZE(n)         (0x004 + (n) * 0x30)
 #define        OVL_V_COOR(n)           (0x008 + (n) * 0x30)
@@ -124,8 +129,13 @@
 /* OVL_UI registers */
 #define        OVL_UI_ATTR_CTL(n)      (0x000 + (n) * 0x20)
 #define         OVL_UI_ATTR_CTL_LAY_FBFMT              __BITS(12,8)
+#if BYTE_ORDER == BIG_ENDIAN
+#define          OVL_UI_ATTR_CTL_LAY_FBFMT_ARGB_8888   0x03
+#define          OVL_UI_ATTR_CTL_LAY_FBFMT_XRGB_8888   0x07
+#else
 #define          OVL_UI_ATTR_CTL_LAY_FBFMT_ARGB_8888   0x00
 #define          OVL_UI_ATTR_CTL_LAY_FBFMT_XRGB_8888   0x04
+#endif
 #define         OVL_UI_ATTR_CTL_LAY_EN                 __BIT(0)
 #define        OVL_UI_MBSIZE(n)        (0x004 + (n) * 0x20)
 #define        OVL_UI_COOR(n)          (0x008 + (n) * 0x20)



Home | Main Index | Thread Index | Old Index