aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomi Valkeinen2017-05-30 05:57:53 -0500
committerTomi Valkeinen2017-05-30 06:22:00 -0500
commit21bc24b7aee138bd1f43a11eb8b86e96039fdacf (patch)
treeeafb0f1615b751b20dd0bc8e378fb9a7e3a1b39f
parent2d86678f0a78abf67cdef6be375f7d787c4f017d (diff)
downloadexternal-kmsxx-21bc24b7aee138bd1f43a11eb8b86e96039fdacf.tar.gz
external-kmsxx-21bc24b7aee138bd1f43a11eb8b86e96039fdacf.tar.xz
external-kmsxx-21bc24b7aee138bd1f43a11eb8b86e96039fdacf.zip
omapfb: add flags for memory alloc
-rw-r--r--kms++/inc/kms++/omap/omapframebuffer.h3
-rw-r--r--kms++/src/omap/omapframebuffer.cpp9
-rw-r--r--py/pykms/pykmsomap.cpp3
3 files changed, 15 insertions, 0 deletions
diff --git a/kms++/inc/kms++/omap/omapframebuffer.h b/kms++/inc/kms++/omap/omapframebuffer.h
index 02ac79f..d1152b5 100644
--- a/kms++/inc/kms++/omap/omapframebuffer.h
+++ b/kms++/inc/kms++/omap/omapframebuffer.h
@@ -16,6 +16,9 @@ public:
16 { 16 {
17 None = 0, 17 None = 0,
18 Tiled = 1 << 0, 18 Tiled = 1 << 0,
19 MemContig = 1 << 1,
20 MemTiler = 1 << 2,
21 MemPin = 1 << 3,
19 }; 22 };
20 23
21 OmapFramebuffer(OmapCard& card, uint32_t width, uint32_t height, const std::string& fourcc, Flags flags = Flags::None); 24 OmapFramebuffer(OmapCard& card, uint32_t width, uint32_t height, const std::string& fourcc, Flags flags = Flags::None);
diff --git a/kms++/src/omap/omapframebuffer.cpp b/kms++/src/omap/omapframebuffer.cpp
index 4aa1cdb..b27ca22 100644
--- a/kms++/src/omap/omapframebuffer.cpp
+++ b/kms++/src/omap/omapframebuffer.cpp
@@ -54,6 +54,15 @@ void OmapFramebuffer::Create(Flags buffer_flags)
54 54
55 uint32_t flags = OMAP_BO_SCANOUT | OMAP_BO_WC; 55 uint32_t flags = OMAP_BO_SCANOUT | OMAP_BO_WC;
56 56
57#if defined(OMAP_BO_MEM_CONTIG)
58 if (buffer_flags & Flags::MemContig)
59 flags |= OMAP_BO_MEM_CONTIG;
60 if (buffer_flags & Flags::MemTiler)
61 flags |= OMAP_BO_MEM_TILER;
62 if (buffer_flags & Flags::MemPin)
63 flags |= OMAP_BO_MEM_PIN;
64#endif
65
57 struct omap_bo* bo; 66 struct omap_bo* bo;
58 67
59 uint32_t stride; 68 uint32_t stride;
diff --git a/py/pykms/pykmsomap.cpp b/py/pykms/pykmsomap.cpp
index 2074092..0c3a8ee 100644
--- a/py/pykms/pykmsomap.cpp
+++ b/py/pykms/pykmsomap.cpp
@@ -20,6 +20,9 @@ void init_pykmsomap(py::module &m)
20 py::enum_<OmapFramebuffer::Flags>(omapfb, "Flags") 20 py::enum_<OmapFramebuffer::Flags>(omapfb, "Flags")
21 .value("None", OmapFramebuffer::Flags::None) 21 .value("None", OmapFramebuffer::Flags::None)
22 .value("Tiled", OmapFramebuffer::Flags::Tiled) 22 .value("Tiled", OmapFramebuffer::Flags::Tiled)
23 .value("MemContig", OmapFramebuffer::Flags::MemContig)
24 .value("MemTiler", OmapFramebuffer::Flags::MemTiler)
25 .value("MemPin", OmapFramebuffer::Flags::MemPin)
23 .export_values() 26 .export_values()
24 ; 27 ;
25 28