From 3c593f4357e75c31695baa5ac74d8f9102b9bef4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Sat, 3 Aug 2013 16:17:57 +0200 Subject: [PATCH] remove nvidiahack lib 1. it apparently is ineffective 2. if it was effective, it's current behavior would be not exactly helpful (sets __GL_YIELD to NOTHING, causing busy waits on doublebuffer swapping) 3. it does for sure pollute the doublebuffer/usleep detection (setenv is set to override), ie. the overehad detection code gets a different opinion on __GL_YIELD than libGL REVIEW: 111858 CCBUG: 322060 --- CMakeLists.txt | 14 -------------- nvidiahack.cpp | 52 -------------------------------------------------- 2 files changed, 66 deletions(-) delete mode 100644 nvidiahack.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 9d9cae32a5..1e78bfcf82 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -313,8 +313,6 @@ if(OPENGL_FOUND) if (DL_LIBRARY) target_link_libraries(kdeinit_kwin ${DL_LIBRARY}) endif() - # must be after opengl, to be initialized first by the linker - target_link_libraries(kdeinit_kwin kwinnvidiahack) elseif(OPENGLES_FOUND) target_link_libraries(kdeinit_kwin ${kwinLibs} kwinglesutils ${OPENGLES_LIBRARIES}) set_target_properties(kdeinit_kwin PROPERTIES COMPILE_FLAGS "-DKWIN_HAVE_OPENGLES") @@ -333,18 +331,6 @@ if(OPENGLES_FOUND) install(TARGETS kwin_gles ${INSTALL_TARGETS_DEFAULT_ARGS} ) endif() -########### next target ############### - -set( kwinnvidiahack_LIB_SRCS - nvidiahack.cpp ) - - -kde4_add_library(kwinnvidiahack SHARED ${kwinnvidiahack_LIB_SRCS}) - -set_target_properties(kwinnvidiahack PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION} ) -set_target_properties(kwinnvidiahack PROPERTIES OUTPUT_NAME ${KWIN_NAME}nvidiahack) -install(TARGETS kwinnvidiahack ${INSTALL_TARGETS_DEFAULT_ARGS} LIBRARY NAMELINK_SKIP) - ########### install files ############### install( FILES kwin.kcfg DESTINATION ${KCFG_INSTALL_DIR} RENAME ${KWIN_NAME}.kcfg ) diff --git a/nvidiahack.cpp b/nvidiahack.cpp deleted file mode 100644 index fe5737acda..0000000000 --- a/nvidiahack.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/******************************************************************** - KWin - the KDE window manager - This file is part of the KDE project. - -Copyright (C) 2007 Lubos Lunak - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . -*********************************************************************/ - -// krazy:skip - -/* - - The only purpose of this file is to be later in the link order than - (nvidia's) libGL, thus being initialized by the dynamic linker before it, - allowing it to set __GL_YIELD=NOTHING soon enough for libGL to notice it. - -*/ - -#include -#include - -class kwinnvidiahack -{ -public: - kwinnvidiahack(); -}; - -kwinnvidiahack::kwinnvidiahack() -{ - const char* env = getenv("KWIN_NVIDIA_HACK"); -#if 1 // turned on by default - if (env == NULL || env[ 0 ] != '0') - setenv("__GL_YIELD", "NOTHING", true); -#else // turned off by default - if (env != NULL && env[ 0 ] != '0') - setenv("__GL_YIELD", "NOTHING", true); -#endif -} - -kwinnvidiahack kwinnvidiahackinst;