diff options
author | Lukas Rusak <lorusak@gmail.com> | 2018-11-02 09:24:09 -0700 |
---|---|---|
committer | Lukas Rusak <lorusak@gmail.com> | 2018-11-02 09:24:09 -0700 |
commit | e17e0be9e97b0f89631c283ece71cd67ece0608a (patch) | |
tree | 41cc8ebb7e7094685aaad16d75568c64973b82cd | |
parent | d0a7c35877c0978e68c55412cf9e0dcab0916b22 (diff) |
Revert "windowing/gbm: add VT handler"
This reverts commit 913a5fa6bf90ac7effbbd2cbb0d4c2ee3f7efa62.
-rw-r--r-- | xbmc/windowing/gbm/CMakeLists.txt | 2 | ||||
-rw-r--r-- | xbmc/windowing/gbm/VTUtils.cpp | 62 | ||||
-rw-r--r-- | xbmc/windowing/gbm/VTUtils.h | 35 | ||||
-rw-r--r-- | xbmc/windowing/gbm/WinSystemGbm.cpp | 5 | ||||
-rw-r--r-- | xbmc/windowing/gbm/WinSystemGbm.h | 4 |
5 files changed, 0 insertions, 108 deletions
diff --git a/xbmc/windowing/gbm/CMakeLists.txt b/xbmc/windowing/gbm/CMakeLists.txt index d0dfd85cbd..78c788c158 100644 --- a/xbmc/windowing/gbm/CMakeLists.txt +++ b/xbmc/windowing/gbm/CMakeLists.txt @@ -5,7 +5,6 @@ set(SOURCES OptionalsReg.cpp DRMLegacy.cpp DRMAtomic.cpp OffScreenModeSetting.cpp - VTUtils.cpp WinSystemGbmEGLContext.cpp) set(HEADERS OptionalsReg.h @@ -15,7 +14,6 @@ set(HEADERS OptionalsReg.h DRMLegacy.h DRMAtomic.h OffScreenModeSetting.h - VTUtils.h WinSystemGbmEGLContext.h) if (OPENGL_FOUND) diff --git a/xbmc/windowing/gbm/VTUtils.cpp b/xbmc/windowing/gbm/VTUtils.cpp deleted file mode 100644 index cd57f793fb..0000000000 --- a/xbmc/windowing/gbm/VTUtils.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (C) 2005-2018 Team Kodi - * This file is part of Kodi - https://kodi.tv - * - * SPDX-License-Identifier: GPL-2.0-or-later - * See LICENSES/README.md for more information. - */ - -#include "VTUtils.h" - -#include "platform/MessagePrinter.h" -#include "utils/log.h" -#include "utils/StringUtils.h" - -#include <linux/major.h> -#include <linux/kd.h> -#include <linux/vt.h> -#include <sys/ioctl.h> -#include <sys/stat.h> -#include <sys/sysmacros.h> - -using namespace KODI::WINDOWING::GBM; - -bool CVTUtils::OpenTTY() -{ - m_ttyDevice = ttyname(STDIN_FILENO); - - m_fd.attach(open(m_ttyDevice.c_str(), O_RDWR | O_CLOEXEC)); - if (m_fd < 0) - { - CMessagePrinter::DisplayError(StringUtils::Format("ERROR: failed to open tty: %s", m_ttyDevice)); - CLog::Log(LOGERROR, "CVTUtils::%s - failed to open tty: %s", __FUNCTION__, m_ttyDevice); - return false; - } - - struct stat buf; - if (fstat(m_fd, &buf) == -1 || major(buf.st_rdev) != TTY_MAJOR || minor(buf.st_rdev) == 0) - { - CMessagePrinter::DisplayError(StringUtils::Format("ERROR: %s is not a vt", m_ttyDevice)); - CLog::Log(LOGERROR, "CVTUtils::%s - %s is not a vt", __FUNCTION__, m_ttyDevice); - return false; - } - - int kdMode{-1}; - auto ret = ioctl(m_fd, KDGETMODE, &kdMode); - if (ret) - { - CLog::Log(LOGERROR, "CVTUtils::%s - failed to get VT mode: %s", __FUNCTION__, strerror(errno)); - return false; - } - - if (kdMode != KD_TEXT) - { - CMessagePrinter::DisplayError(StringUtils::Format("ERROR: %s is already in graphics mode, is another display server running?", m_ttyDevice)); - CLog::Log(LOGERROR, "CVTUtils::%s - %s is already in graphics mode, is another display server running?", __FUNCTION__, m_ttyDevice); - return false; - } - - CLog::Log(LOGNOTICE, "CVTUtils::%s - opened tty: %s", __FUNCTION__, m_ttyDevice.c_str()); - - return true; -} diff --git a/xbmc/windowing/gbm/VTUtils.h b/xbmc/windowing/gbm/VTUtils.h deleted file mode 100644 index 42543e5909..0000000000 --- a/xbmc/windowing/gbm/VTUtils.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (C) 2005-2018 Team Kodi - * This file is part of Kodi - https://kodi.tv - * - * SPDX-License-Identifier: GPL-2.0-or-later - * See LICENSES/README.md for more information. - */ - -#pragma once - -#include "platform/posix/utils/FileHandle.h" - -namespace KODI -{ -namespace WINDOWING -{ -namespace GBM -{ - -class CVTUtils -{ -public: - CVTUtils() = default; - ~CVTUtils() = default; - - bool OpenTTY(); - -private: - KODI::UTILS::POSIX::CFileHandle m_fd; - std::string m_ttyDevice; -}; - -} -} -} diff --git a/xbmc/windowing/gbm/WinSystemGbm.cpp b/xbmc/windowing/gbm/WinSystemGbm.cpp index 1d6bf3afdf..8d5888891a 100644 --- a/xbmc/windowing/gbm/WinSystemGbm.cpp +++ b/xbmc/windowing/gbm/WinSystemGbm.cpp @@ -73,11 +73,6 @@ CWinSystemGbm::CWinSystemGbm() : bool CWinSystemGbm::InitWindowSystem() { - if (!m_vt.OpenTTY()) - { - return false; - } - m_DRM = std::make_shared<CDRMAtomic>(); if (!m_DRM->InitDrm()) diff --git a/xbmc/windowing/gbm/WinSystemGbm.h b/xbmc/windowing/gbm/WinSystemGbm.h index 65119c7684..954e7737df 100644 --- a/xbmc/windowing/gbm/WinSystemGbm.h +++ b/xbmc/windowing/gbm/WinSystemGbm.h @@ -17,7 +17,6 @@ #include "windowing/WinSystem.h" #include "DRMUtils.h" #include "VideoLayerBridge.h" -#include "VTUtils.h" class IDispResource; @@ -80,9 +79,6 @@ protected: XbmcThreads::EndTime m_dispResetTimer; std::unique_ptr<OPTIONALS::CLircContainer, OPTIONALS::delete_CLircContainer> m_lirc; std::unique_ptr<CLibInputHandler> m_libinput; - -private: - CVTUtils m_vt; }; } |