168
169
page_flipper->wait_for_flip(current_crtc->crtc_id);
172
void mgg::KMSOutput::set_cursor(gbm_bo* buffer)
176
if (auto result = drmModeSetCursor(
178
current_crtc->crtc_id,
179
gbm_bo_get_handle(buffer).u32,
180
gbm_bo_get_width(buffer),
181
gbm_bo_get_height(buffer)))
183
BOOST_THROW_EXCEPTION(
184
::boost::enable_error_info(std::runtime_error("drmModeSetCursor() failed"))
185
<< (boost::error_info<KMSOutput, decltype(result)>(result)));
190
void mgg::KMSOutput::move_cursor(geometry::Point destination)
194
if (auto result = drmModeMoveCursor(drm_fd, current_crtc->crtc_id,
195
destination.x.as_uint32_t(),
196
destination.y.as_uint32_t()))
198
BOOST_THROW_EXCEPTION(
199
::boost::enable_error_info(std::runtime_error("drmModeMoveCursor() failed"))
200
<< (boost::error_info<KMSOutput, decltype(result)>(result)));
205
void mgg::KMSOutput::clear_cursor()
209
drmModeSetCursor(drm_fd, current_crtc->crtc_id, 0, 0, 0);
171
213
bool mgg::KMSOutput::ensure_crtc()
173
215
/* Nothing to do if we already have a crtc */