summaryrefslogtreecommitdiff
path: root/libkms++
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2015-11-12 20:20:04 +0200
committerTomi Valkeinen <tomi.valkeinen@ti.com>2015-11-13 17:55:48 +0200
commite1b78c7b484a5025d854d8f1e5d0cc3f2cc3113e (patch)
tree5aaa2ba5a300fc48cebeff99904802e9b4927fba /libkms++
parent0f904fb2b2836035bd7564deeb2e115369b73c98 (diff)
dumbfb: move prime_fd() and fix its return type
Diffstat (limited to 'libkms++')
-rw-r--r--libkms++/dumbframebuffer.cpp26
-rw-r--r--libkms++/dumbframebuffer.h2
2 files changed, 14 insertions, 14 deletions
diff --git a/libkms++/dumbframebuffer.cpp b/libkms++/dumbframebuffer.cpp
index 730d297..ec0fefb 100644
--- a/libkms++/dumbframebuffer.cpp
+++ b/libkms++/dumbframebuffer.cpp
@@ -35,19 +35,6 @@ DumbFramebuffer::~DumbFramebuffer()
Destroy();
}
-uint32_t DumbFramebuffer::prime_fd(unsigned int plane)
-{
- if (m_planes[plane].prime_fd >= 0)
- return m_planes[plane].prime_fd;
-
- int r = drmPrimeHandleToFD(card().fd(), m_planes[plane].handle,
- DRM_CLOEXEC, &m_planes[plane].prime_fd);
- if (r)
- throw std::runtime_error("drmPrimeHandleToFD failed\n");
-
- return m_planes[plane].prime_fd;
-}
-
struct FormatPlaneInfo
{
uint8_t bitspp; /* bits per (macro) pixel */
@@ -164,4 +151,17 @@ uint8_t* DumbFramebuffer::map(unsigned plane)
return p.map;
}
+int DumbFramebuffer::prime_fd(unsigned int plane)
+{
+ if (m_planes[plane].prime_fd >= 0)
+ return m_planes[plane].prime_fd;
+
+ int r = drmPrimeHandleToFD(card().fd(), m_planes[plane].handle,
+ DRM_CLOEXEC, &m_planes[plane].prime_fd);
+ if (r)
+ throw std::runtime_error("drmPrimeHandleToFD failed\n");
+
+ return m_planes[plane].prime_fd;
+}
+
}
diff --git a/libkms++/dumbframebuffer.h b/libkms++/dumbframebuffer.h
index c221421..226a8dc 100644
--- a/libkms++/dumbframebuffer.h
+++ b/libkms++/dumbframebuffer.h
@@ -20,7 +20,7 @@ public:
uint32_t size(unsigned plane) const { return m_planes[plane].size; }
uint32_t offset(unsigned plane) const { return m_planes[plane].offset; }
uint8_t* map(unsigned plane);
- uint32_t prime_fd(unsigned plane);
+ int prime_fd(unsigned plane);
private:
struct FramebufferPlane {