Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm/allwinner Add awinmp(4) glue.



details:   https://anonhg.NetBSD.org/src/rev/19bec53741b5
branches:  trunk
changeset: 334736:19bec53741b5
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Thu Dec 04 11:16:38 2014 +0000

description:
Add awinmp(4) glue.

It won't compile (uses nonexistent ioctls) but adding this for posterity.
In my testing, 2D accel for solid fill and copy is considerably slower than
with software rendering, so no sense in turning this on.

diffstat:

 sys/arch/arm/allwinner/awin_debe.c |  18 ++++++++++++++++--
 sys/arch/arm/allwinner/awin_fb.c   |  20 ++++++++++++++++++--
 sys/arch/arm/allwinner/awin_intr.h |   3 ++-
 sys/arch/arm/allwinner/awin_io.c   |   3 ++-
 sys/arch/arm/allwinner/awin_var.h  |   4 +++-
 sys/arch/arm/allwinner/files.awin  |   7 ++++++-
 6 files changed, 47 insertions(+), 8 deletions(-)

diffs (192 lines):

diff -r d8184412df5c -r 19bec53741b5 sys/arch/arm/allwinner/awin_debe.c
--- a/sys/arch/arm/allwinner/awin_debe.c        Thu Dec 04 04:35:13 2014 +0000
+++ b/sys/arch/arm/allwinner/awin_debe.c        Thu Dec 04 11:16:38 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: awin_debe.c,v 1.10 2014/11/30 20:04:57 jmcneill Exp $ */
+/* $NetBSD: awin_debe.c,v 1.11 2014/12/04 11:16:38 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2014 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -28,6 +28,7 @@
 
 #include "opt_allwinner.h"
 #include "genfb.h"
+#include "awin_mp.h"
 
 #ifndef AWIN_DEBE_VIDEOMEM
 #define AWIN_DEBE_VIDEOMEM     (16 * 1024 * 1024)
@@ -36,7 +37,7 @@
 #define AWIN_DEBE_CURMAX       64
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: awin_debe.c,v 1.10 2014/11/30 20:04:57 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: awin_debe.c,v 1.11 2014/12/04 11:16:38 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -114,6 +115,9 @@
        struct awinio_attach_args * const aio = aux;
        const struct awin_locators * const loc = &aio->aio_loc;
        prop_dictionary_t cfg = device_properties(self);
+#if NAWIN_MP > 0
+       device_t mpdev;
+#endif
        int error;
 
        sc->sc_dev = self;
@@ -197,6 +201,16 @@
                    "couldn't allocate video memory, error = %d\n", error);
                return;
        }
+
+#if NAWIN_MP > 0
+       mpdev = device_find_by_driver_unit("awinmp", 0);
+       if (mpdev) {
+               paddr_t pa = sc->sc_dmamap->dm_segs[0].ds_addr;
+               if (pa >= AWIN_SDRAM_PBASE)
+                       pa -= AWIN_SDRAM_PBASE;
+               awin_mp_setbase(mpdev, pa, sc->sc_dmasize);
+       }
+#endif
 }
 
 static int
diff -r d8184412df5c -r 19bec53741b5 sys/arch/arm/allwinner/awin_fb.c
--- a/sys/arch/arm/allwinner/awin_fb.c  Thu Dec 04 04:35:13 2014 +0000
+++ b/sys/arch/arm/allwinner/awin_fb.c  Thu Dec 04 11:16:38 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: awin_fb.c,v 1.8 2014/11/30 20:25:54 jmcneill Exp $ */
+/* $NetBSD: awin_fb.c,v 1.9 2014/12/04 11:16:38 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2014 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -26,8 +26,10 @@
  * SUCH DAMAGE.
  */
 
+#include "awin_mp.h"
+
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: awin_fb.c,v 1.8 2014/11/30 20:25:54 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: awin_fb.c,v 1.9 2014/12/04 11:16:38 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -47,6 +49,7 @@
 struct awin_fb_softc {
        struct genfb_softc sc_gen;
        device_t sc_debedev;
+       device_t sc_mpdev;
 
        bus_dma_tag_t sc_dmat;
        bus_dma_segment_t *sc_dmasegs;
@@ -87,6 +90,7 @@
        sc->sc_dmat = afb->afb_dmat;
        sc->sc_dmasegs = afb->afb_dmasegs;
        sc->sc_ndmasegs = afb->afb_ndmasegs;
+       sc->sc_mpdev = device_find_by_driver_unit("awinmp", 0);
 
        prop_dictionary_set_uint32(cfg, "width", afb->afb_width);
        prop_dictionary_set_uint32(cfg, "height", afb->afb_height);
@@ -146,6 +150,10 @@
                if (error == 0) {
                        fbi->fbi_flags |= WSFB_VRAM_IS_RAM;
                        fbi->fbi_fbsize = sc->sc_dmasegs[0].ds_len;
+#if NAWIN_MP > 0
+                       if (sc->sc_mpdev)
+                               fbi->fbi_flags |= WSFB_ACCEL;
+#endif
                }
                return error;
        case WSDISPLAYIO_SVIDEO:
@@ -155,6 +163,14 @@
        case WSDISPLAYIO_GCURMAX:
        case WSDISPLAYIO_SCURSOR:
                return awin_debe_ioctl(sc->sc_debedev, cmd, data);
+#if NAWIN_MP > 0
+       case WSDISPLAYIO_FILL:
+       case WSDISPLAYIO_COPY:
+       case WSDISPLAYIO_SYNC:
+               if (sc->sc_mpdev == NULL)
+                       return EPASSTHROUGH;
+               return awin_mp_ioctl(sc->sc_mpdev, cmd, data);
+#endif
        default:
                return EPASSTHROUGH;
        }
diff -r d8184412df5c -r 19bec53741b5 sys/arch/arm/allwinner/awin_intr.h
--- a/sys/arch/arm/allwinner/awin_intr.h        Thu Dec 04 04:35:13 2014 +0000
+++ b/sys/arch/arm/allwinner/awin_intr.h        Thu Dec 04 11:16:38 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: awin_intr.h,v 1.9 2014/11/02 23:55:06 jmcneill Exp $ */
+/* $NetBSD: awin_intr.h,v 1.10 2014/12/04 11:16:38 jmcneill Exp $ */
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -161,6 +161,7 @@
 #define AWIN_A31_IRQ_USB3      106
 #define AWIN_A31_IRQ_USB4      108
 #define AWIN_A31_IRQ_GMAC      114
+#define AWIN_A31_IRQ_MP                115
 #define AWIN_A31_IRQ_HDMI      120
 
 #endif /* _ARM_ALLWINNER_AWIN_INTR_H_ */
diff -r d8184412df5c -r 19bec53741b5 sys/arch/arm/allwinner/awin_io.c
--- a/sys/arch/arm/allwinner/awin_io.c  Thu Dec 04 04:35:13 2014 +0000
+++ b/sys/arch/arm/allwinner/awin_io.c  Thu Dec 04 11:16:38 2014 +0000
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(1, "$NetBSD: awin_io.c,v 1.28 2014/11/11 17:00:59 jmcneill Exp $");
+__KERNEL_RCSID(1, "$NetBSD: awin_io.c,v 1.29 2014/12/04 11:16:38 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -108,6 +108,7 @@
        { "com", OFFANDSIZE(UART6), 6, AWIN_IRQ_UART6, A10|A20 },
        { "com", OFFANDSIZE(UART7), 7, AWIN_IRQ_UART7, A10|A20 },
        { "com", OFFANDSIZE(UART0), 0, AWIN_A31_IRQ_UART0, A31 },
+       { "awinmp", OFFANDSIZE(MP), NOPORT, AWIN_A31_IRQ_MP, A31 },
        { "awindebe", AWIN_DE_BE0_OFFSET, 0x1000, 0, NOINTR, AANY },
        { "awindebe", AWIN_DE_BE1_OFFSET, 0x1000, 1, NOINTR, AANY },
        { "awintcon", OFFANDSIZE(LCD0), 0, NOINTR, AANY },
diff -r d8184412df5c -r 19bec53741b5 sys/arch/arm/allwinner/awin_var.h
--- a/sys/arch/arm/allwinner/awin_var.h Thu Dec 04 04:35:13 2014 +0000
+++ b/sys/arch/arm/allwinner/awin_var.h Thu Dec 04 11:16:38 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: awin_var.h,v 1.26 2014/11/23 23:04:58 jmcneill Exp $ */
+/* $NetBSD: awin_var.h,v 1.27 2014/12/04 11:16:38 jmcneill Exp $ */
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -133,6 +133,8 @@
 void   awin_debe_set_videomode(const struct videomode *);
 void   awin_debe_enable(bool);
 int    awin_debe_ioctl(device_t, u_long, void *);
+int    awin_mp_ioctl(device_t, u_long, void *);
+void   awin_mp_setbase(device_t, paddr_t, size_t);
 
 struct awin_hdmi_info {
        bool    display_connected;
diff -r d8184412df5c -r 19bec53741b5 sys/arch/arm/allwinner/files.awin
--- a/sys/arch/arm/allwinner/files.awin Thu Dec 04 04:35:13 2014 +0000
+++ b/sys/arch/arm/allwinner/files.awin Thu Dec 04 11:16:38 2014 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.awin,v 1.26 2014/11/18 01:53:53 jmcneill Exp $
+#      $NetBSD: files.awin,v 1.27 2014/12/04 11:16:38 jmcneill Exp $
 #
 # Configuration info for Allwinner ARM Peripherals
 #
@@ -158,6 +158,11 @@
 attach awindebe at awinio with awin_debe
 file   arch/arm/allwinner/awin_debe.c          awin_debe | awin_hdmi
 
+# A10/A20/A31 Mixer processor (MP)
+device awinmp
+attach awinmp at awinio with awin_mp
+file   arch/arm/allwinner/awin_mp.c            awin_mp         needs-flag
+
 # Framebuffer
 attach genfb at awindebe with awin_fb: edid
 file   arch/arm/allwinner/awin_fb.c            awin_fb         needs-flag



Home | Main Index | Thread Index | Old Index