Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/evbarm/rpi add VC memory management goop



details:   https://anonhg.NetBSD.org/src/rev/f082b31a1336
branches:  trunk
changeset: 332476:f082b31a1336
user:      macallan <macallan%NetBSD.org@localhost>
date:      Tue Sep 23 10:52:21 2014 +0000

description:
add VC memory management goop

diffstat:

 sys/arch/evbarm/rpi/vcprop.h |  34 ++++++++++++++++++++++++++++++++--
 1 files changed, 32 insertions(+), 2 deletions(-)

diffs (62 lines):

diff -r d9250d58cbca -r f082b31a1336 sys/arch/evbarm/rpi/vcprop.h
--- a/sys/arch/evbarm/rpi/vcprop.h      Tue Sep 23 09:18:33 2014 +0000
+++ b/sys/arch/evbarm/rpi/vcprop.h      Tue Sep 23 10:52:21 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vcprop.h,v 1.10 2014/09/23 09:18:33 macallan Exp $     */
+/*     $NetBSD: vcprop.h,v 1.11 2014/09/23 10:52:21 macallan Exp $     */
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -88,6 +88,11 @@
 
 #define        VCPROPTAG_GET_EDID_BLOCK        0x00030020
 
+#define        VCPROPTAG_ALLOCMEM              0x0003000c
+#define        VCPROPTAG_LOCKMEM               0x0003000d
+#define        VCPROPTAG_UNLOCKMEM             0x0003000e
+#define        VCPROPTAG_RELEASEMEM            0x0003000f
+
 #define        VCPROPTAG_SET_CURSOR_INFO       0x00008011
 #define        VCPROPTAG_SET_CURSOR_STATE      0x00008010
 
@@ -283,7 +288,7 @@
        uint32_t width;
        uint32_t height;
        uint32_t __pad;         /* unused */
-       uint32_t pixels;
+       uint32_t pixels;        /* bus address in VC memory */
        uint32_t hotspot_x;
        uint32_t hotspot_y;
 };
@@ -296,6 +301,31 @@
        uint32_t flags;         /* 0 - display coord. 1 - fb coord. */
 };
 
+struct vcprop_tag_allocmem {
+       struct vcprop_tag tag;
+       uint32_t size;  /* handle returned here */
+       uint32_t align;
+       uint32_t flags;
+/*
+ * flag definitions from
+ * https://github.com/raspberrypi/firmware/wiki/Mailbox-property-interface
+ */
+#define MEM_FLAG_DISCARDABLE   (1 << 0) /* can be resized to 0 at any time. Use for cached data */
+#define MEM_FLAG_NORMAL                (0 << 2) /* normal allocating alias. Don't use from ARM */
+#define MEM_FLAG_DIRECT                (1 << 2) /* 0xC alias uncached */
+#define MEM_FLAG_COHERENT      (2 << 2) /* 0x8 alias. Non-allocating in L2 but coherent */
+#define MEM_FLAG_L1_NONALLOCATING (MEM_FLAG_DIRECT | MEM_FLAG_COHERENT) /* Allocating in L2 */
+#define MEM_FLAG_ZERO          (1 << 4)  /* initialise buffer to all zeros */
+#define MEM_FLAG_NO_INIT       (1 << 5) /* don't initialise (default is initialise to all ones */
+#define MEM_FLAG_HINT_PERMALOCK        (1 << 6) /* Likely to be locked for long periods of time. */
+};
+
+/* also for unlock and release */
+struct vcprop_tag_lockmem {
+       struct vcprop_tag tag;
+       uint32_t handle;        /* bus address returned here */
+};
+
 struct vcprop_buffer_hdr {
        uint32_t vpb_len;
        uint32_t vpb_rcode;



Home | Main Index | Thread Index | Old Index