[Test] Added tests for CUtil::SplitParams
[xbmc.git] / xbmc / windowing / gbm / drm / DRMCrtc.cpp
blob426fd953bbb77f0c66998c3fad5c25e0f992ee0a
1 /*
2 * Copyright (C) 2005-2020 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
9 #include "DRMCrtc.h"
11 #include <cstring>
12 #include <errno.h>
13 #include <stdexcept>
14 #include <string>
16 using namespace KODI::WINDOWING::GBM;
18 CDRMCrtc::CDRMCrtc(int fd, uint32_t crtc) : CDRMObject(fd), m_crtc(drmModeGetCrtc(m_fd, crtc))
20 if (!m_crtc)
21 throw std::runtime_error("drmModeGetCrtc failed: " + std::string{strerror(errno)});
23 if (!GetProperties(m_crtc->crtc_id, DRM_MODE_OBJECT_CRTC))
24 throw std::runtime_error("failed to get properties for crtc: " +
25 std::to_string(m_crtc->crtc_id));