summaryrefslogtreecommitdiff
path: root/libkms++
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2015-10-26 17:35:55 +0200
committerTomi Valkeinen <tomi.valkeinen@ti.com>2015-10-26 17:38:30 +0200
commit4a9274d0ebc6a35e479302b6f1e83bfb7cb97ba0 (patch)
treec223240b264d9bf64380353c6c1d12285c8ea977 /libkms++
parent3e49992a478f01016cc326e4b1719a10e5078280 (diff)
dumbfb: add offset
Diffstat (limited to 'libkms++')
-rw-r--r--libkms++/dumbframebuffer.cpp3
-rw-r--r--libkms++/dumbframebuffer.h2
2 files changed, 4 insertions, 1 deletions
diff --git a/libkms++/dumbframebuffer.cpp b/libkms++/dumbframebuffer.cpp
index 9de02da..c64010a 100644
--- a/libkms++/dumbframebuffer.cpp
+++ b/libkms++/dumbframebuffer.cpp
@@ -91,6 +91,7 @@ void DumbFramebuffer::Create()
plane.handle = creq.handle;
plane.stride = creq.pitch;
plane.size = creq.height * creq.pitch;
+ plane.offset = 0;
/*
printf("buf %d: %dx%d, bitspp %d, stride %d, size %d\n",
@@ -117,7 +118,7 @@ void DumbFramebuffer::Create()
/* create framebuffer object for the dumb-buffer */
uint32_t bo_handles[4] = { m_planes[0].handle, m_planes[1].handle };
uint32_t pitches[4] = { m_planes[0].stride, m_planes[1].stride };
- uint32_t offsets[4] = { 0 };
+ uint32_t offsets[4] = { m_planes[0].offset, m_planes[1].offset };
uint32_t id;
r = drmModeAddFB2(card().fd(), width(), height(), (uint32_t)format(),
bo_handles, pitches, offsets, &id, 0);
diff --git a/libkms++/dumbframebuffer.h b/libkms++/dumbframebuffer.h
index c836e39..49cf8a0 100644
--- a/libkms++/dumbframebuffer.h
+++ b/libkms++/dumbframebuffer.h
@@ -21,6 +21,7 @@ public:
uint8_t* map(unsigned plane) const { return m_planes[plane].map; }
uint32_t stride(unsigned plane) const { return m_planes[plane].stride; }
uint32_t size(unsigned plane) const { return m_planes[plane].size; }
+ uint32_t offset(unsigned plane) const { return m_planes[plane].offset; }
void clear();
@@ -29,6 +30,7 @@ private:
uint32_t handle;
uint32_t size;
uint32_t stride;
+ uint32_t offset;
uint8_t *map;
};