omapfb: add flags for memory alloc
authorTomi Valkeinen <tomi.valkeinen@ti.com>
Tue, 30 May 2017 10:57:53 +0000 (13:57 +0300)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Tue, 30 May 2017 11:22:00 +0000 (14:22 +0300)
kms++/inc/kms++/omap/omapframebuffer.h
kms++/src/omap/omapframebuffer.cpp
py/pykms/pykmsomap.cpp

index 02ac79f3b3dce85ba06c595f8b2c9df0c4eceefb..d1152b571e0e970570e06485b9f009c37d84791e 100644 (file)
@@ -16,6 +16,9 @@ public:
        {
                None = 0,
                Tiled = 1 << 0,
+               MemContig = 1 << 1,
+               MemTiler = 1 << 2,
+               MemPin = 1 << 3,
        };
 
        OmapFramebuffer(OmapCard& card, uint32_t width, uint32_t height, const std::string& fourcc, Flags flags = Flags::None);
index 4aa1cdb8703470bf03a875e8f08a8a0f272dab4d..b27ca2258f7bca9b1eb88c7abba0b9262ad96ae2 100644 (file)
@@ -54,6 +54,15 @@ void OmapFramebuffer::Create(Flags buffer_flags)
 
                uint32_t flags = OMAP_BO_SCANOUT | OMAP_BO_WC;
 
+#if defined(OMAP_BO_MEM_CONTIG)
+               if (buffer_flags & Flags::MemContig)
+                       flags |= OMAP_BO_MEM_CONTIG;
+               if (buffer_flags & Flags::MemTiler)
+                       flags |= OMAP_BO_MEM_TILER;
+               if (buffer_flags & Flags::MemPin)
+                       flags |= OMAP_BO_MEM_PIN;
+#endif
+
                struct omap_bo* bo;
 
                uint32_t stride;
index 20740929c48e1ddf7a1118ff034c7d23b7a339e4..0c3a8eecda2a3fef47a480a9a50a611680b8cee1 100644 (file)
@@ -20,6 +20,9 @@ void init_pykmsomap(py::module &m)
        py::enum_<OmapFramebuffer::Flags>(omapfb, "Flags")
                        .value("None", OmapFramebuffer::Flags::None)
                        .value("Tiled", OmapFramebuffer::Flags::Tiled)
+                       .value("MemContig", OmapFramebuffer::Flags::MemContig)
+                       .value("MemTiler", OmapFramebuffer::Flags::MemTiler)
+                       .value("MemPin", OmapFramebuffer::Flags::MemPin)
                        .export_values()
                        ;