]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - android/external-libkmsxx.git/commitdiff
dumbfb: add offset
authorTomi Valkeinen <tomi.valkeinen@ti.com>
Mon, 26 Oct 2015 15:35:55 +0000 (17:35 +0200)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Mon, 26 Oct 2015 15:38:30 +0000 (17:38 +0200)
libkms++/dumbframebuffer.cpp
libkms++/dumbframebuffer.h

index 9de02da0074b61f8892040b9aa9f5dbc2fd7a2ef..c64010aa3df88fc278edae147b4acb37f7cb5a4c 100644 (file)
@@ -91,6 +91,7 @@ void DumbFramebuffer::Create()
                plane.handle = creq.handle;
                plane.stride = creq.pitch;
                plane.size = creq.height * creq.pitch;
                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",
 
                /*
                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 };
        /* 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);
        uint32_t id;
        r = drmModeAddFB2(card().fd(), width(), height(), (uint32_t)format(),
                          bo_handles, pitches, offsets, &id, 0);
index c836e398d0385cf23c15f1fc9169afb5a7208f24..49cf8a0daa352fff72f216a9440580c65fe97388 100644 (file)
@@ -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; }
        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();
 
 
        void clear();
 
@@ -29,6 +30,7 @@ private:
                uint32_t handle;
                uint32_t size;
                uint32_t stride;
                uint32_t handle;
                uint32_t size;
                uint32_t stride;
+               uint32_t offset;
                uint8_t *map;
        };
 
                uint8_t *map;
        };