Drop support for XFree86-VidModeExtension
Was only used as fallback for older NVIDIA drivers. At the same time also drop the call to nvidia-settings which was also only used as a fallback for refresh rate detection. REVIEW: 122423
This commit is contained in:
parent
881ddeb18b
commit
87caab24ca
3 changed files with 0 additions and 89 deletions
|
@ -496,13 +496,6 @@ set(kwin_WAYLAND_EGL_LIBS
|
|||
Wayland::Egl
|
||||
)
|
||||
|
||||
find_library(XF86VM_LIBRARY Xxf86vm)
|
||||
if (XF86VM_LIBRARY)
|
||||
set(kwin_XLIB_LIBS ${kwin_XLIB_LIBS} ${XF86VM_LIBRARY})
|
||||
else()
|
||||
add_definitions(-DKWIN_NO_XF86VM)
|
||||
endif()
|
||||
|
||||
if(KWIN_BUILD_ACTIVITIES)
|
||||
set(kwin_KDE_LIBS ${kwin_KDE_LIBS} KF5::Activities)
|
||||
endif()
|
||||
|
|
47
options.cpp
47
options.cpp
|
@ -33,12 +33,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include "xcbutils.h"
|
||||
#include <kwinglplatform.h>
|
||||
|
||||
#ifndef KWIN_HAVE_OPENGLES
|
||||
#ifndef KWIN_NO_XF86VM
|
||||
#include <X11/extensions/xf86vmode.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif //KCMRULES
|
||||
|
||||
namespace KWin
|
||||
|
@ -51,47 +45,6 @@ int currentRefreshRate()
|
|||
int rate = -1;
|
||||
if (options->refreshRate() > 0) // use manually configured refresh rate
|
||||
rate = options->refreshRate();
|
||||
#ifndef KWIN_HAVE_OPENGLES
|
||||
else if (GLPlatform::instance()->driver() == Driver_NVidia) {
|
||||
#ifndef KWIN_NO_XF86VM
|
||||
int major, event, error;
|
||||
static const bool s_hasVidMode = XQueryExtension(display(), "XFree86-VidModeExtension", &major, &event, &error);
|
||||
if (s_hasVidMode) {
|
||||
XF86VidModeModeLine modeline;
|
||||
int dotclock, vtotal;
|
||||
if (XF86VidModeGetModeLine(display(), 0, &dotclock, &modeline)) {
|
||||
vtotal = modeline.vtotal;
|
||||
if (modeline.flags & 0x0010) // V_INTERLACE
|
||||
dotclock *= 2;
|
||||
if (modeline.flags & 0x0020) // V_DBLSCAN
|
||||
vtotal *= 2;
|
||||
if (modeline.htotal*vtotal) // BUG 313996
|
||||
rate = 1000*dotclock/(modeline.htotal*vtotal); // WTF was wikipedia 1998 when I nedded it?
|
||||
qCDebug(KWIN_CORE) << "Vertical Refresh Rate (as detected by XF86VM): " << rate << "Hz";
|
||||
}
|
||||
}
|
||||
if (rate < 1)
|
||||
#endif
|
||||
{ // modeline approach failed
|
||||
QProcess nvidia_settings;
|
||||
QStringList env = QProcess::systemEnvironment();
|
||||
env << QStringLiteral("LC_ALL=C");
|
||||
nvidia_settings.setEnvironment(env);
|
||||
nvidia_settings.start(QStringLiteral("nvidia-settings"), QStringList() << QStringLiteral("-t") << QStringLiteral("-q") << QStringLiteral("RefreshRate"), QIODevice::ReadOnly);
|
||||
nvidia_settings.waitForFinished();
|
||||
if (nvidia_settings.exitStatus() == QProcess::NormalExit) {
|
||||
QString reply = QString::fromLocal8Bit(nvidia_settings.readAllStandardOutput()).split(QStringLiteral(" ")).first();
|
||||
bool ok;
|
||||
float frate = QLocale::c().toFloat(reply, &ok);
|
||||
if (!ok)
|
||||
rate = -1;
|
||||
else
|
||||
rate = qRound(frate);
|
||||
qCDebug(KWIN_CORE) << "Vertical Refresh Rate (as detected by nvidia-settings): " << rate << "Hz";
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
else if (Xcb::Extensions::self()->isRandrAvailable()) {
|
||||
Xcb::RandR::ScreenInfo screenInfo(rootWindow());
|
||||
rate = screenInfo->rate;
|
||||
|
|
|
@ -49,10 +49,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
#include <KProcess>
|
||||
#include <KToolInvocation>
|
||||
|
||||
#ifndef KWIN_NO_XF86VM
|
||||
#include <X11/extensions/xf86vmode.h>
|
||||
#endif
|
||||
#include <fixx11h.h>
|
||||
#include <QAction>
|
||||
#include <QCheckBox>
|
||||
#include <QtConcurrentRun>
|
||||
|
@ -1861,37 +1857,6 @@ void Workspace::slotInvertScreen()
|
|||
if (succeeded)
|
||||
return;
|
||||
|
||||
//BEGIN XF86VidMode inversion - only works if optionally libXxf86vm is linked
|
||||
#ifndef KWIN_NO_XF86VM
|
||||
int size = 0;
|
||||
// TODO: this doesn't work with screen numbers in twinview - probably relevant only for multihead?
|
||||
const int scrn = 0; // active_screen
|
||||
if (XF86VidModeGetGammaRampSize(display(), scrn, &size)) {
|
||||
unsigned short *red, *green, *blue;
|
||||
red = new unsigned short[size];
|
||||
green = new unsigned short[size];
|
||||
blue = new unsigned short[size];
|
||||
if (XF86VidModeGetGammaRamp(display(), scrn, size, red, green, blue)) {
|
||||
qCDebug(KWIN_CORE) << "inverting screen using XF86VidModeSetGammaRamp";
|
||||
const int half = size / 2 + 1;
|
||||
unsigned short swap;
|
||||
for (int i = 0; i < half; ++i) {
|
||||
swap = red[i]; red[i] = red[size - 1 - i]; red[size - 1 - i] = swap;
|
||||
swap = green[i]; green[i] = green[size - 1 - i]; green[size - 1 - i] = swap;
|
||||
swap = blue[i]; blue[i] = blue[size - 1 - i]; blue[size - 1 - i] = swap;
|
||||
}
|
||||
XF86VidModeSetGammaRamp(display(), scrn, size, red, green, blue);
|
||||
succeeded = true;
|
||||
}
|
||||
delete [] red;
|
||||
delete [] green;
|
||||
delete [] blue;
|
||||
}
|
||||
|
||||
if (succeeded)
|
||||
return;
|
||||
#endif
|
||||
|
||||
//BEGIN effect plugin inversion - atm only works with OpenGL and has an overhead to it
|
||||
if (effects) {
|
||||
if (Effect *inverter = static_cast<EffectsHandlerImpl*>(effects)->provides(Effect::ScreenInversion)) {
|
||||
|
|
Loading…
Reference in a new issue