Changeset View
Changeset View
Standalone View
Standalone View
plugins/platforms/drm/drm_object_crtc.h
Show All 19 Lines | |||||
20 | #ifndef KWIN_DRM_OBJECT_CRTC_H | 20 | #ifndef KWIN_DRM_OBJECT_CRTC_H | ||
21 | #define KWIN_DRM_OBJECT_CRTC_H | 21 | #define KWIN_DRM_OBJECT_CRTC_H | ||
22 | 22 | | |||
23 | #include "drm_object.h" | 23 | #include "drm_object.h" | ||
24 | 24 | | |||
25 | namespace KWin | 25 | namespace KWin | ||
26 | { | 26 | { | ||
27 | 27 | | |||
28 | class DrmBackend; | ||||
28 | class DrmBuffer; | 29 | class DrmBuffer; | ||
29 | 30 | | |||
30 | class DrmCrtc : public DrmObject | 31 | class DrmCrtc : public DrmObject | ||
31 | { | 32 | { | ||
32 | public: | 33 | public: | ||
33 | DrmCrtc(uint32_t crtc_id, int fd); | 34 | DrmCrtc(uint32_t crtc_id, int fd, int resIndex); | ||
34 | 35 | | |||
35 | virtual ~DrmCrtc(); | 36 | virtual ~DrmCrtc(); | ||
36 | 37 | | |||
37 | bool init(); | 38 | bool init(); | ||
38 | 39 | | |||
39 | enum class PropertyIndex { | 40 | enum class PropertyIndex { | ||
40 | ModeId = 0, | 41 | ModeId = 0, | ||
41 | Active, | 42 | Active, | ||
42 | Count | 43 | Count | ||
43 | }; | 44 | }; | ||
44 | 45 | | |||
45 | bool initProps(); | 46 | bool initProps(); | ||
47 | | ||||
48 | int resIndex() const { | ||||
49 | return m_resIndex; | ||||
50 | } | ||||
51 | | ||||
52 | DrmBuffer *current() { | ||||
53 | return m_currentBuffer; | ||||
54 | } | ||||
55 | DrmBuffer *next() { | ||||
56 | return m_nextBuffer; | ||||
57 | } | ||||
58 | void setNext(DrmBuffer *buffer) { | ||||
59 | m_nextBuffer = buffer; | ||||
60 | } | ||||
61 | | ||||
62 | void flipBuffer(); | ||||
63 | bool blank(); | ||||
64 | | ||||
65 | private: | ||||
66 | DrmBackend *m_backend; | ||||
67 | int m_resIndex; | ||||
68 | | ||||
69 | DrmBuffer *m_currentBuffer = nullptr; | ||||
70 | DrmBuffer *m_nextBuffer = nullptr; | ||||
71 | DrmBuffer *m_blackBuffer = nullptr; | ||||
46 | }; | 72 | }; | ||
47 | 73 | | |||
48 | } | 74 | } | ||
49 | 75 | | |||
50 | #endif | 76 | #endif | ||
51 | 77 | |