summaryrefslogtreecommitdiff
path: root/kms++/plane.cpp
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2016-06-11 21:46:24 +0300
committerTomi Valkeinen <tomi.valkeinen@ti.com>2016-06-11 21:46:24 +0300
commit9916712a62169606d845510028a3ea6f84bd442f (patch)
treeaca4e1bec39500812111c43a8ecee862edae0002 /kms++/plane.cpp
parent736b295100ce441e800457bcbd08cb36db543ff2 (diff)
kms++: organize into subdirs
Diffstat (limited to 'kms++/plane.cpp')
-rw-r--r--kms++/plane.cpp105
1 files changed, 0 insertions, 105 deletions
diff --git a/kms++/plane.cpp b/kms++/plane.cpp
deleted file mode 100644
index 46cd3e6..0000000
--- a/kms++/plane.cpp
+++ /dev/null
@@ -1,105 +0,0 @@
-#include <stdio.h>
-#include <iostream>
-#include <unistd.h>
-#include <fcntl.h>
-#include <cassert>
-#include <xf86drm.h>
-#include <xf86drmMode.h>
-
-#include "kms++.h"
-
-using namespace std;
-
-namespace kms
-{
-
-struct PlanePriv
-{
- drmModePlanePtr drm_plane;
-};
-
-Plane::Plane(Card &card, uint32_t id, uint32_t idx)
- :DrmPropObject(card, id, DRM_MODE_OBJECT_PLANE, idx)
-{
- m_priv = new PlanePriv();
- m_priv->drm_plane = drmModeGetPlane(this->card().fd(), this->id());
- assert(m_priv->drm_plane);
-}
-
-Plane::~Plane()
-{
- drmModeFreePlane(m_priv->drm_plane);
- delete m_priv;
-}
-
-bool Plane::supports_crtc(Crtc* crtc) const
-{
- return m_priv->drm_plane->possible_crtcs & (1 << crtc->idx());
-}
-
-bool Plane::supports_format(PixelFormat fmt) const
-{
- auto p = m_priv->drm_plane;
-
- for (unsigned i = 0; i < p->count_formats; ++i)
- if ((uint32_t)fmt == p->formats[i])
- return true;
-
- return false;
-}
-
-PlaneType Plane::plane_type() const
-{
- if (card().has_has_universal_planes())
- return (PlaneType)get_prop_value("type");
- else
- return PlaneType::Overlay;
-}
-
-vector<PixelFormat> Plane::get_formats() const
-{
- auto p = m_priv->drm_plane;
- vector<PixelFormat> r;
-
- for (unsigned i = 0; i < p->count_formats; ++i)
- r.push_back((PixelFormat) p->formats[i]);
-
- return r;
-}
-
-uint32_t Plane::crtc_id() const
-{
- return m_priv->drm_plane->crtc_id;
-}
-
-uint32_t Plane::fb_id() const
-{
- return m_priv->drm_plane->fb_id;
-}
-
-uint32_t Plane::crtc_x() const
-{
- return m_priv->drm_plane->crtc_x;
-}
-
-uint32_t Plane::crtc_y() const
-{
- return m_priv->drm_plane->crtc_y;
-}
-
-uint32_t Plane::x() const
-{
- return m_priv->drm_plane->x;
-}
-
-uint32_t Plane::y() const
-{
- return m_priv->drm_plane->y;
-}
-
-uint32_t Plane::gamma_size() const
-{
- return m_priv->drm_plane->gamma_size;
-}
-
-}