summaryrefslogtreecommitdiff
path: root/kms++/src/crtc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kms++/src/crtc.cpp')
-rw-r--r--kms++/src/crtc.cpp24
1 files changed, 11 insertions, 13 deletions
diff --git a/kms++/src/crtc.cpp b/kms++/src/crtc.cpp
index 7ffaaff..6dc4333 100644
--- a/kms++/src/crtc.cpp
+++ b/kms++/src/crtc.cpp
@@ -11,14 +11,12 @@ using namespace std;
namespace kms
{
-
-struct CrtcPriv
-{
+struct CrtcPriv {
drmModeCrtcPtr drm_crtc;
};
-Crtc::Crtc(Card &card, uint32_t id, uint32_t idx)
- :DrmPropObject(card, id, DRM_MODE_OBJECT_CRTC, idx)
+Crtc::Crtc(Card& card, uint32_t id, uint32_t idx)
+ : DrmPropObject(card, id, DRM_MODE_OBJECT_CRTC, idx)
{
m_priv = new CrtcPriv();
m_priv->drm_crtc = drmModeGetCrtc(this->card().fd(), this->id());
@@ -65,13 +63,13 @@ int Crtc::set_mode(Connector* conn, const Videomode& mode)
unique_ptr<Blob> blob = mode.to_blob(card());
req.add(conn, {
- { "CRTC_ID", this->id() },
- });
+ { "CRTC_ID", this->id() },
+ });
req.add(this, {
- { "ACTIVE", 1 },
- { "MODE_ID", blob->id() },
- });
+ { "ACTIVE", 1 },
+ { "MODE_ID", blob->id() },
+ });
int r = req.commit_sync(true);
@@ -117,7 +115,7 @@ int Crtc::disable_plane(Plane* plane)
Plane* Crtc::get_primary_plane()
{
- Plane *primary = nullptr;
+ Plane* primary = nullptr;
for (Plane* p : get_possible_planes()) {
if (p->plane_type() != PlaneType::Primary)
@@ -135,7 +133,7 @@ Plane* Crtc::get_primary_plane()
throw invalid_argument(string("No primary plane for crtc ") + to_string(id()));
}
-int Crtc::page_flip(Framebuffer& fb, void *data)
+int Crtc::page_flip(Framebuffer& fb, void* data)
{
return drmModePageFlip(card().fd(), id(), fb.id(), DRM_MODE_PAGE_FLIP_EVENT, data);
}
@@ -180,4 +178,4 @@ int Crtc::gamma_size() const
return m_priv->drm_crtc->gamma_size;
}
-}
+} // namespace kms