Changeset View
Changeset View
Standalone View
Standalone View
plugins/platforms/drm/drm_output.h
Show All 40 Lines | |||||
41 | } | 41 | } | ||
42 | } | 42 | } | ||
43 | 43 | | |||
44 | namespace KWin | 44 | namespace KWin | ||
45 | { | 45 | { | ||
46 | 46 | | |||
47 | class DrmBackend; | 47 | class DrmBackend; | ||
48 | class DrmBuffer; | 48 | class DrmBuffer; | ||
49 | class DrmDumbBuffer; | ||||
49 | class DrmPlane; | 50 | class DrmPlane; | ||
50 | class DrmConnector; | 51 | class DrmConnector; | ||
51 | class DrmCrtc; | 52 | class DrmCrtc; | ||
52 | 53 | | |||
53 | class DrmOutput : public QObject | 54 | class DrmOutput : public QObject | ||
54 | { | 55 | { | ||
55 | Q_OBJECT | 56 | Q_OBJECT | ||
56 | public: | 57 | public: | ||
57 | struct Edid { | 58 | struct Edid { | ||
58 | QByteArray eisaId; | 59 | QByteArray eisaId; | ||
59 | QByteArray monitorName; | 60 | QByteArray monitorName; | ||
60 | QByteArray serialNumber; | 61 | QByteArray serialNumber; | ||
61 | QSize physicalSize; | 62 | QSize physicalSize; | ||
62 | }; | 63 | }; | ||
63 | virtual ~DrmOutput(); | 64 | virtual ~DrmOutput(); | ||
64 | void showCursor(DrmBuffer *buffer); | 65 | void showCursor(DrmDumbBuffer *buffer); | ||
graesslin: why change here? From what I see only the DrmBuffer API is used, isn't it? | |||||
See my comment https://phabricator.kde.org/D4026#inline-16024 handle() is not known to DrmBuffer right now, because it's not needed for a DrmSurfaceBuffer. Also doesn't it make more sense to specify the argument as much as possible so it's easier to read the code? A cursor buffer is always a dumb buffer. romangg: See my comment https://phabricator.kde.org/D4026#inline-16024
`handle()` is not known to… | |||||
65 | void hideCursor(); | 66 | void hideCursor(); | ||
66 | void moveCursor(const QPoint &globalPos); | 67 | void moveCursor(const QPoint &globalPos); | ||
67 | bool init(drmModeConnector *connector); | 68 | bool init(drmModeConnector *connector); | ||
68 | bool present(DrmBuffer *buffer); | 69 | bool present(DrmBuffer *buffer); | ||
69 | void pageFlipped(); | 70 | void pageFlipped(); | ||
70 | void restoreSaved(); | 71 | void restoreSaved(); | ||
71 | bool blank(); | 72 | bool blank(); | ||
72 | 73 | | |||
Show All 34 Lines | 103 | private: | |||
107 | bool presentLegacy(DrmBuffer *buffer); | 108 | bool presentLegacy(DrmBuffer *buffer); | ||
108 | bool setModeLegacy(DrmBuffer *buffer); | 109 | bool setModeLegacy(DrmBuffer *buffer); | ||
109 | void initEdid(drmModeConnector *connector); | 110 | void initEdid(drmModeConnector *connector); | ||
110 | void initDpms(drmModeConnector *connector); | 111 | void initDpms(drmModeConnector *connector); | ||
111 | bool isCurrentMode(const drmModeModeInfo *mode) const; | 112 | bool isCurrentMode(const drmModeModeInfo *mode) const; | ||
112 | void initUuid(); | 113 | void initUuid(); | ||
113 | void setGlobalPos(const QPoint &pos); | 114 | void setGlobalPos(const QPoint &pos); | ||
114 | 115 | | |||
115 | void pageFlippedBufferRemover(DrmBuffer *oldbuffer, DrmBuffer *newbuffer); | | |||
116 | bool initPrimaryPlane(); | 116 | bool initPrimaryPlane(); | ||
117 | bool initCursorPlane(); | 117 | bool initCursorPlane(); | ||
118 | DrmObject::AtomicReturn atomicReqModesetPopulate(drmModeAtomicReq *req, bool enable); | 118 | DrmObject::AtomicReturn atomicReqModesetPopulate(drmModeAtomicReq *req, bool enable); | ||
119 | 119 | | |||
120 | DrmBackend *m_backend; | 120 | DrmBackend *m_backend; | ||
121 | QPoint m_globalPos; | 121 | QPoint m_globalPos; | ||
122 | quint32 m_crtcId = 0; | 122 | quint32 m_crtcId = 0; | ||
123 | quint32 m_connector = 0; | 123 | quint32 m_connector = 0; | ||
124 | quint32 m_lastStride = 0; | 124 | quint32 m_lastStride = 0; | ||
125 | bool m_lastGbm = false; | 125 | bool m_lastGbm = false; | ||
126 | drmModeModeInfo m_mode; | 126 | drmModeModeInfo m_mode; | ||
127 | DrmBuffer *m_currentBuffer = nullptr; | 127 | DrmBuffer *m_currentBuffer = nullptr; | ||
128 | DrmBuffer *m_nextBuffer = nullptr; | 128 | DrmBuffer *m_nextBuffer = nullptr; | ||
129 | DrmBuffer *m_blackBuffer = nullptr; | 129 | DrmDumbBuffer *m_blackBuffer = nullptr; | ||
130 | struct CrtcCleanup { | 130 | struct CrtcCleanup { | ||
131 | static void inline cleanup(_drmModeCrtc *ptr) { | 131 | static void inline cleanup(_drmModeCrtc *ptr) { | ||
132 | drmModeFreeCrtc(ptr); // TODO: Atomically? See compositor-drm.c l.3670 | 132 | drmModeFreeCrtc(ptr); // TODO: Atomically? See compositor-drm.c l.3670 | ||
133 | } | 133 | } | ||
134 | }; | 134 | }; | ||
135 | Edid m_edid; | 135 | Edid m_edid; | ||
136 | QScopedPointer<_drmModeCrtc, CrtcCleanup> m_savedCrtc; | 136 | QScopedPointer<_drmModeCrtc, CrtcCleanup> m_savedCrtc; | ||
137 | QPointer<KWayland::Server::OutputInterface> m_waylandOutput; | 137 | QPointer<KWayland::Server::OutputInterface> m_waylandOutput; | ||
Show All 20 Lines |
why change here? From what I see only the DrmBuffer API is used, isn't it?