summaryrefslogtreecommitdiff
path: root/kms++/inc
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2020-10-07 08:58:35 +0300
committerTomi Valkeinen <tomi.valkeinen@ti.com>2020-10-09 15:54:43 +0300
commitd9a1ffe56d0beb9cdd048d0e83f7d0177b31411a (patch)
tree6227b71ee23bfa344b4cd5896ec485409158a0bc /kms++/inc
parent37d27443432b7b84d256bd5a7c505e7ef8e09bbd (diff)
Bulk format of all files
Diffstat (limited to 'kms++/inc')
-rw-r--r--kms++/inc/kms++/atomicreq.h8
-rw-r--r--kms++/inc/kms++/blob.h3
-rw-r--r--kms++/inc/kms++/card.h6
-rw-r--r--kms++/inc/kms++/connector.h8
-rw-r--r--kms++/inc/kms++/crtc.h11
-rw-r--r--kms++/inc/kms++/decls.h2
-rw-r--r--kms++/inc/kms++/dmabufframebuffer.h5
-rw-r--r--kms++/inc/kms++/drmobject.h6
-rw-r--r--kms++/inc/kms++/drmpropobject.h4
-rw-r--r--kms++/inc/kms++/dumbframebuffer.h5
-rw-r--r--kms++/inc/kms++/encoder.h5
-rw-r--r--kms++/inc/kms++/extframebuffer.h5
-rw-r--r--kms++/inc/kms++/framebuffer.h15
-rw-r--r--kms++/inc/kms++/mode_cvt.h1
-rw-r--r--kms++/inc/kms++/modedb.h2
-rw-r--r--kms++/inc/kms++/omap/omapcard.h2
-rw-r--r--kms++/inc/kms++/omap/omapframebuffer.h5
-rw-r--r--kms++/inc/kms++/pagefliphandler.h9
-rw-r--r--kms++/inc/kms++/pipeline.h2
-rw-r--r--kms++/inc/kms++/pixelformats.h16
-rw-r--r--kms++/inc/kms++/plane.h8
-rw-r--r--kms++/inc/kms++/property.h8
-rw-r--r--kms++/inc/kms++/videomode.h13
23 files changed, 70 insertions, 79 deletions
diff --git a/kms++/inc/kms++/atomicreq.h b/kms++/inc/kms++/atomicreq.h
index a678b54..780cc8f 100644
--- a/kms++/inc/kms++/atomicreq.h
+++ b/kms++/inc/kms++/atomicreq.h
@@ -20,9 +20,9 @@ public:
AtomicReq& operator=(const AtomicReq& other) = delete;
void add(uint32_t ob_id, uint32_t prop_id, uint64_t value);
- void add(DrmPropObject *ob, Property *prop, uint64_t value);
- void add(DrmPropObject *ob, const std::string& prop, uint64_t value);
- void add(DrmPropObject *ob, const std::map<std::string, uint64_t>& values);
+ void add(DrmPropObject* ob, Property* prop, uint64_t value);
+ void add(DrmPropObject* ob, const std::string& prop, uint64_t value);
+ void add(DrmPropObject* ob, const std::map<std::string, uint64_t>& values);
void add_display(Connector* conn, Crtc* crtc, Blob* videomode,
Plane* primary, Framebuffer* fb);
@@ -36,4 +36,4 @@ private:
_drmModeAtomicReq* m_req;
};
-}
+} // namespace kms
diff --git a/kms++/inc/kms++/blob.h b/kms++/inc/kms++/blob.h
index 31e915c..011613d 100644
--- a/kms++/inc/kms++/blob.h
+++ b/kms++/inc/kms++/blob.h
@@ -5,7 +5,6 @@
namespace kms
{
-
class Blob : public DrmObject
{
public:
@@ -19,4 +18,4 @@ private:
bool m_created;
};
-}
+} // namespace kms
diff --git a/kms++/inc/kms++/card.h b/kms++/inc/kms++/card.h
index f60b184..bf6f9bf 100644
--- a/kms++/inc/kms++/card.h
+++ b/kms++/inc/kms++/card.h
@@ -11,8 +11,7 @@
namespace kms
{
-struct CardVersion
-{
+struct CardVersion {
int major;
int minor;
int patchlevel;
@@ -24,6 +23,7 @@ struct CardVersion
class Card
{
friend class Framebuffer;
+
public:
static std::unique_ptr<Card> open_named_card(const std::string& name);
@@ -95,4 +95,4 @@ private:
CardVersion m_version;
};
-}
+} // namespace kms
diff --git a/kms++/inc/kms++/connector.h b/kms++/inc/kms++/connector.h
index 323d37d..f45a487 100644
--- a/kms++/inc/kms++/connector.h
+++ b/kms++/inc/kms++/connector.h
@@ -7,11 +7,9 @@
namespace kms
{
-
struct ConnectorPriv;
-enum class ConnectorStatus
-{
+enum class ConnectorStatus {
Unknown,
Connected,
Disconnected,
@@ -20,6 +18,7 @@ enum class ConnectorStatus
class Connector : public DrmPropObject
{
friend class Card;
+
public:
void refresh();
@@ -44,6 +43,7 @@ public:
const std::string& subpixel_str() const;
std::vector<Videomode> get_modes() const;
std::vector<Encoder*> get_encoders() const;
+
private:
Connector(Card& card, uint32_t id, uint32_t idx);
~Connector() override;
@@ -59,4 +59,4 @@ private:
Crtc* m_saved_crtc;
};
-}
+} // namespace kms
diff --git a/kms++/inc/kms++/crtc.h b/kms++/inc/kms++/crtc.h
index 990fc20..1ba8a07 100644
--- a/kms++/inc/kms++/crtc.h
+++ b/kms++/inc/kms++/crtc.h
@@ -6,13 +6,13 @@
namespace kms
{
-
struct CrtcPriv;
class Crtc : public DrmPropObject
{
friend class Card;
friend class Connector;
+
public:
void refresh();
@@ -21,7 +21,7 @@ public:
int set_mode(Connector* conn, const Videomode& mode);
int set_mode(Connector* conn, Framebuffer& fb, const Videomode& mode);
- int set_plane(Plane *plane, Framebuffer &fb,
+ int set_plane(Plane* plane, Framebuffer& fb,
int32_t dst_x, int32_t dst_y, uint32_t dst_w, uint32_t dst_h,
float src_x, float src_y, float src_w, float src_h);
int disable_mode();
@@ -30,7 +30,7 @@ public:
Plane* get_primary_plane();
- int page_flip(Framebuffer& fb, void *data);
+ int page_flip(Framebuffer& fb, void* data);
uint32_t buffer_id() const;
uint32_t x() const;
@@ -40,15 +40,16 @@ public:
int mode_valid() const;
Videomode mode() const;
int gamma_size() const;
+
private:
Crtc(Card& card, uint32_t id, uint32_t idx);
~Crtc() override;
void setup() override;
- void restore_mode(Connector *conn);
+ void restore_mode(Connector* conn);
CrtcPriv* m_priv;
std::vector<Plane*> m_possible_planes;
};
-}
+} // namespace kms
diff --git a/kms++/inc/kms++/decls.h b/kms++/inc/kms++/decls.h
index 438dad5..a4b5631 100644
--- a/kms++/inc/kms++/decls.h
+++ b/kms++/inc/kms++/decls.h
@@ -18,4 +18,4 @@ class PageFlipHandlerBase;
class Plane;
class Property;
struct Videomode;
-}
+} // namespace kms
diff --git a/kms++/inc/kms++/dmabufframebuffer.h b/kms++/inc/kms++/dmabufframebuffer.h
index 328dd2b..6643a81 100644
--- a/kms++/inc/kms++/dmabufframebuffer.h
+++ b/kms++/inc/kms++/dmabufframebuffer.h
@@ -8,7 +8,6 @@
namespace kms
{
-
class DmabufFramebuffer : public Framebuffer
{
public:
@@ -42,7 +41,7 @@ private:
uint32_t stride;
uint32_t offset;
uint64_t modifier;
- uint8_t *map;
+ uint8_t* map;
};
unsigned m_num_planes;
@@ -53,4 +52,4 @@ private:
uint32_t m_sync_flags = 0;
};
-}
+} // namespace kms
diff --git a/kms++/inc/kms++/drmobject.h b/kms++/inc/kms++/drmobject.h
index a939aa7..e15ed4c 100644
--- a/kms++/inc/kms++/drmobject.h
+++ b/kms++/inc/kms++/drmobject.h
@@ -6,10 +6,10 @@
namespace kms
{
-
class DrmObject
{
friend class Card;
+
public:
DrmObject(const DrmObject& other) = delete;
DrmObject& operator=(const DrmObject& other) = delete;
@@ -26,7 +26,7 @@ protected:
virtual ~DrmObject();
- virtual void setup() { }
+ virtual void setup() {}
virtual void set_id(uint32_t id);
@@ -37,4 +37,4 @@ private:
uint32_t m_object_type;
uint32_t m_idx;
};
-}
+} // namespace kms
diff --git a/kms++/inc/kms++/drmpropobject.h b/kms++/inc/kms++/drmpropobject.h
index 48e0265..dc3a806 100644
--- a/kms++/inc/kms++/drmpropobject.h
+++ b/kms++/inc/kms++/drmpropobject.h
@@ -8,10 +8,10 @@
namespace kms
{
-
class DrmPropObject : public DrmObject
{
friend class Card;
+
public:
void refresh_props();
@@ -38,4 +38,4 @@ protected:
private:
std::map<uint32_t, uint64_t> m_prop_values;
};
-}
+} // namespace kms
diff --git a/kms++/inc/kms++/dumbframebuffer.h b/kms++/inc/kms++/dumbframebuffer.h
index 15ea982..af5fe42 100644
--- a/kms++/inc/kms++/dumbframebuffer.h
+++ b/kms++/inc/kms++/dumbframebuffer.h
@@ -7,7 +7,6 @@
namespace kms
{
-
class DumbFramebuffer : public Framebuffer
{
public:
@@ -35,7 +34,7 @@ private:
uint32_t size;
uint32_t stride;
uint32_t offset;
- uint8_t *map;
+ uint8_t* map;
};
unsigned m_num_planes;
@@ -43,4 +42,4 @@ private:
PixelFormat m_format;
};
-}
+} // namespace kms
diff --git a/kms++/inc/kms++/encoder.h b/kms++/inc/kms++/encoder.h
index 72c0213..9476d80 100644
--- a/kms++/inc/kms++/encoder.h
+++ b/kms++/inc/kms++/encoder.h
@@ -5,12 +5,12 @@
namespace kms
{
-
struct EncoderPriv;
class Encoder : public DrmPropObject
{
friend class Card;
+
public:
void refresh();
@@ -18,10 +18,11 @@ public:
std::vector<Crtc*> get_possible_crtcs() const;
const std::string& get_encoder_type() const;
+
private:
Encoder(Card& card, uint32_t id, uint32_t idx);
~Encoder() override;
EncoderPriv* m_priv;
};
-}
+} // namespace kms
diff --git a/kms++/inc/kms++/extframebuffer.h b/kms++/inc/kms++/extframebuffer.h
index 3fb74ca..00dc9bf 100644
--- a/kms++/inc/kms++/extframebuffer.h
+++ b/kms++/inc/kms++/extframebuffer.h
@@ -8,7 +8,6 @@
namespace kms
{
-
class ExtFramebuffer : public Framebuffer
{
public:
@@ -34,7 +33,7 @@ private:
uint32_t stride;
uint32_t offset;
uint64_t modifier;
- uint8_t *map;
+ uint8_t* map;
};
unsigned m_num_planes;
@@ -43,4 +42,4 @@ private:
PixelFormat m_format;
};
-}
+} // namespace kms
diff --git a/kms++/inc/kms++/framebuffer.h b/kms++/inc/kms++/framebuffer.h
index bcfd1f0..6f77b98 100644
--- a/kms++/inc/kms++/framebuffer.h
+++ b/kms++/inc/kms++/framebuffer.h
@@ -5,16 +5,16 @@
namespace kms
{
-enum class CpuAccess
-{
+enum class CpuAccess {
Read,
Write,
ReadWrite,
};
-class IFramebuffer {
+class IFramebuffer
+{
public:
- virtual ~IFramebuffer() { }
+ virtual ~IFramebuffer() {}
virtual uint32_t width() const = 0;
virtual uint32_t height() const = 0;
@@ -28,8 +28,8 @@ public:
virtual uint8_t* map(unsigned plane) { throw std::runtime_error("not implemented"); }
virtual int prime_fd(unsigned plane) { throw std::runtime_error("not implemented"); }
- virtual void begin_cpu_access(CpuAccess access) { }
- virtual void end_cpu_access() { }
+ virtual void begin_cpu_access(CpuAccess access) {}
+ virtual void end_cpu_access() {}
};
class Framebuffer : public DrmObject, public IFramebuffer
@@ -42,6 +42,7 @@ public:
uint32_t height() const override { return m_height; }
void flush();
+
protected:
Framebuffer(Card& card, uint32_t width, uint32_t height);
@@ -50,4 +51,4 @@ private:
uint32_t m_height;
};
-}
+} // namespace kms
diff --git a/kms++/inc/kms++/mode_cvt.h b/kms++/inc/kms++/mode_cvt.h
index 8902e4a..3fa8a07 100644
--- a/kms++/inc/kms++/mode_cvt.h
+++ b/kms++/inc/kms++/mode_cvt.h
@@ -4,7 +4,6 @@
namespace kms
{
-
Videomode videomode_from_cvt(uint32_t hact, uint32_t vact, uint32_t refresh, bool ilace, bool reduced_v2, bool video_optimized);
}
diff --git a/kms++/inc/kms++/modedb.h b/kms++/inc/kms++/modedb.h
index b6447c6..0650442 100644
--- a/kms++/inc/kms++/modedb.h
+++ b/kms++/inc/kms++/modedb.h
@@ -13,4 +13,4 @@ extern const Videomode cea_modes[];
const Videomode& find_dmt(uint32_t width, uint32_t height, float vrefresh, bool ilace);
const Videomode& find_cea(uint32_t width, uint32_t height, float vrefresh, bool ilace);
-}
+} // namespace kms
diff --git a/kms++/inc/kms++/omap/omapcard.h b/kms++/inc/kms++/omap/omapcard.h
index 2f1f528..123205b 100644
--- a/kms++/inc/kms++/omap/omapcard.h
+++ b/kms++/inc/kms++/omap/omapcard.h
@@ -17,4 +17,4 @@ public:
private:
struct omap_device* m_omap_dev;
};
-}
+} // namespace kms
diff --git a/kms++/inc/kms++/omap/omapframebuffer.h b/kms++/inc/kms++/omap/omapframebuffer.h
index 70bf946..72329b4 100644
--- a/kms++/inc/kms++/omap/omapframebuffer.h
+++ b/kms++/inc/kms++/omap/omapframebuffer.h
@@ -12,8 +12,7 @@ class OmapCard;
class OmapFramebuffer : public Framebuffer
{
public:
- enum Flags
- {
+ enum Flags {
None = 0,
Tiled = 1 << 0,
MemContig = 1 << 1,
@@ -59,4 +58,4 @@ private:
PixelFormat m_format;
};
-}
+} // namespace kms
diff --git a/kms++/inc/kms++/pagefliphandler.h b/kms++/inc/kms++/pagefliphandler.h
index 79cda0d..2f5fdcd 100644
--- a/kms++/inc/kms++/pagefliphandler.h
+++ b/kms++/inc/kms++/pagefliphandler.h
@@ -1,11 +1,12 @@
#pragma once
-namespace kms {
+namespace kms
+{
class PageFlipHandlerBase
{
public:
- PageFlipHandlerBase() { }
- virtual ~PageFlipHandlerBase() { }
+ PageFlipHandlerBase() {}
+ virtual ~PageFlipHandlerBase() {}
virtual void handle_page_flip(uint32_t frame, double time) = 0;
};
-}
+} // namespace kms
diff --git a/kms++/inc/kms++/pipeline.h b/kms++/inc/kms++/pipeline.h
index ef04ec1..236e582 100644
--- a/kms++/inc/kms++/pipeline.h
+++ b/kms++/inc/kms++/pipeline.h
@@ -8,4 +8,4 @@ struct Pipeline {
Crtc* crtc;
Connector* connector;
};
-}
+} // namespace kms
diff --git a/kms++/inc/kms++/pixelformats.h b/kms++/inc/kms++/pixelformats.h
index 4e453a2..6f2671b 100644
--- a/kms++/inc/kms++/pixelformats.h
+++ b/kms++/inc/kms++/pixelformats.h
@@ -6,13 +6,12 @@
namespace kms
{
-constexpr uint32_t MakeFourCC(const char *fourcc)
+constexpr uint32_t MakeFourCC(const char* fourcc)
{
return fourcc[0] | (fourcc[1] << 8) | (fourcc[2] << 16) | (fourcc[3] << 24);
}
-enum class PixelFormat : uint32_t
-{
+enum class PixelFormat : uint32_t {
Undefined = 0,
NV12 = MakeFourCC("NV12"),
@@ -82,21 +81,18 @@ static inline std::string PixelFormatToFourCC(PixelFormat f)
return std::string(buf);
}
-enum class PixelColorType
-{
+enum class PixelColorType {
RGB,
YUV,
};
-struct PixelFormatPlaneInfo
-{
+struct PixelFormatPlaneInfo {
uint8_t bitspp;
uint8_t xsub;
uint8_t ysub;
};
-struct PixelFormatInfo
-{
+struct PixelFormatInfo {
PixelColorType type;
uint8_t num_planes;
struct PixelFormatPlaneInfo planes[4];
@@ -104,4 +100,4 @@ struct PixelFormatInfo
const struct PixelFormatInfo& get_pixel_format_info(PixelFormat format);
-}
+} // namespace kms
diff --git a/kms++/inc/kms++/plane.h b/kms++/inc/kms++/plane.h
index 1d78537..d3cfde5 100644
--- a/kms++/inc/kms++/plane.h
+++ b/kms++/inc/kms++/plane.h
@@ -4,9 +4,7 @@
namespace kms
{
-
-enum class PlaneType
-{
+enum class PlaneType {
Overlay = 1 << 0,
Primary = 1 << 1,
Cursor = 1 << 2,
@@ -17,6 +15,7 @@ struct PlanePriv;
class Plane : public DrmPropObject
{
friend class Card;
+
public:
bool supports_crtc(Crtc* crtc) const;
bool supports_format(PixelFormat fmt) const;
@@ -33,10 +32,11 @@ public:
uint32_t x() const;
uint32_t y() const;
uint32_t gamma_size() const;
+
private:
Plane(Card& card, uint32_t id, uint32_t idx);
~Plane() override;
PlanePriv* m_priv;
};
-}
+} // namespace kms
diff --git a/kms++/inc/kms++/property.h b/kms++/inc/kms++/property.h
index 8d6088e..7c7b834 100644
--- a/kms++/inc/kms++/property.h
+++ b/kms++/inc/kms++/property.h
@@ -6,11 +6,9 @@
namespace kms
{
-
struct PropertyPriv;
-enum class PropertyType
-{
+enum class PropertyType {
Range,
Enum,
Blob,
@@ -22,6 +20,7 @@ enum class PropertyType
class Property : public DrmObject
{
friend class Card;
+
public:
const std::string& name() const;
@@ -32,6 +31,7 @@ public:
std::map<uint64_t, std::string> get_enums() const;
std::vector<uint64_t> get_values() const;
std::vector<uint32_t> get_blob_ids() const;
+
private:
Property(Card& card, uint32_t id);
~Property() override;
@@ -41,4 +41,4 @@ private:
PropertyPriv* m_priv;
std::string m_name;
};
-}
+} // namespace kms
diff --git a/kms++/inc/kms++/videomode.h b/kms++/inc/kms++/videomode.h
index 3aacd57..7209ea9 100644
--- a/kms++/inc/kms++/videomode.h
+++ b/kms++/inc/kms++/videomode.h
@@ -8,16 +8,13 @@
namespace kms
{
-
-enum class SyncPolarity
-{
+enum class SyncPolarity {
Undefined,
Positive,
Negative,
};
-struct Videomode
-{
+struct Videomode {
std::string name;
uint32_t clock;
@@ -26,8 +23,8 @@ struct Videomode
uint32_t vrefresh;
- uint32_t flags; // DRM_MODE_FLAG_*
- uint32_t type; // DRM_MODE_TYPE_*
+ uint32_t flags; // DRM_MODE_FLAG_*
+ uint32_t type; // DRM_MODE_TYPE_*
std::unique_ptr<Blob> to_blob(Card& card) const;
@@ -59,4 +56,4 @@ struct Videomode
struct Videomode videomode_from_timings(uint32_t clock_khz,
uint16_t hact, uint16_t hfp, uint16_t hsw, uint16_t hbp,
uint16_t vact, uint16_t vfp, uint16_t vsw, uint16_t vbp);
-}
+} // namespace kms