Commit 096fa27c authored by jmadill's avatar jmadill Committed by Commit bot

Revert of Add new gpu driver bug workaround DISABLE_TRANSPARENT_VISUALS...

Revert of Add new gpu driver bug workaround DISABLE_TRANSPARENT_VISUALS (patchset #17 id:310001 of https://codereview.chromium.org/2124633002/ )

Reason for revert:
Seems to break the Android and Linux GPU fyi bots:
https://build.chromium.org/p/chromium.gpu.fyi/builders/Android%20Release%20%28Nexus%205X%29/builds/1098
https://build.chromium.org/p/chromium.gpu.fyi/builders/Linux%20Release%20%28ATI%29/builds/48671
https://build.chromium.org/p/chromium.gpu.fyi/builders/Android%20Release%20%28Nexus%206P%29/builds/1004
<couple others>

GpuProcess.no_transparent_visuals_gpu_process
Failure: disable_transparent_visuals is missing in Browser process workarounds: [u'broken_egl_image_ref_counting', u'clear_uniforms_before_first_program_use', u'disable_blend_equation_advanced', u'disable_chromium_framebuffer_multisample', u'disable_depth_texture', u'disable_discard_framebuffer', u'disable_framebuffer_cmaa', u'disable_program_cache', u'force_cube_map_positive_x_allocation', u'max_copy_texture_chromium_size_1048576', u'max_texture_size_limit_4096', u'scalarize_vec_and_mat_constructor_args', u'unbind_attachments_on_bound_render_fbo_delete', u'unbind_egl_context_to_flush_driver_caches', u'use_virtualized_gl_contexts', u'wake_up_gpu_before_drawing']

[  FAILED  ] GpuProcess.no_transparent_visuals_gpu_process (5860 ms)

Original issue's description:
> Add new gpu driver bug workaround DISABLE_TRANSPARENT_VISUALS
>
> This is for better polish in the UI but it fixes a drag
> image issue on Linux crbug.com/593256 .
>
> Also add a kGpuDriverBugListJson entry to automatically
> disable transparent visuals on all drivers (especially
> the proprietary NVIDIA driver) except for opensource
> drivers (i.e. Mesa based drivers).
>
> BUG=369209
>
> R=kbr@chromium.org, sadrul@chromium.org, tapted@chromium.org
> CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
>
> Committed: https://crrev.com/71b2517dd4cd620a56ca6f13571129c6aee30b42
> Cr-Commit-Position: refs/heads/master@{#406505}

TBR=kbr@chromium.org,sadrul@chromium.org,tapted@chromium.org,piman@chromium.org,j.isorce@samsung.com
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=369209

Review-Url: https://codereview.chromium.org/2171023002
Cr-Commit-Position: refs/heads/master@{#407047}
parent cc40af91
......@@ -181,7 +181,6 @@
#endif
#if defined(USE_X11)
#include "gpu/config/gpu_driver_bug_workaround_type.h"
#include "ui/base/x/x11_util_internal.h" // nogncheck
#include "ui/gfx/x/x11_connection.h" // nogncheck
#include "ui/gfx/x/x11_switches.h" // nogncheck
......@@ -763,22 +762,6 @@ int BrowserMainLoop::PreCreateThreads() {
// 2) Must be after parts_->PreCreateThreads to pick up chrome://flags.
GpuDataManagerImpl::GetInstance()->Initialize();
#if defined(USE_X11) && !defined(OS_CHROMEOS)
// PreCreateThreads is called before CreateStartupTasks which starts the gpu
// process.
bool enable_transparent_visuals =
!GpuDataManagerImpl::GetInstance()->IsDriverBugWorkaroundActive(
gpu::DISABLE_TRANSPARENT_VISUALS);
Visual* visual = NULL;
int depth = 0;
ui::ChooseVisualForWindow(enable_transparent_visuals, &visual, &depth);
DCHECK(depth > 0);
base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
switches::kWindowDepth, base::IntToString(depth));
base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
switches::kX11VisualID, base::UintToString(visual->visualid));
#endif
#if !defined(GOOGLE_CHROME_BUILD) || defined(OS_ANDROID)
// Single-process is an unsupported and not fully tested mode, so
// don't enable it for official Chrome builds (except on Android).
......@@ -1402,6 +1385,20 @@ bool BrowserMainLoop::InitializeToolkit() {
LOG(ERROR) << "Unable to open X display.";
return false;
}
#if !defined(OS_CHROMEOS)
// InitializeToolkit is called before CreateStartupTasks which one starts the
// gpu process.
Visual* visual = NULL;
int depth = 0;
ui::ChooseVisualForWindow(&visual, &depth);
DCHECK(depth > 0);
base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
switches::kWindowDepth, base::IntToString(depth));
base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
switches::kX11VisualID, base::UintToString(visual->visualid));
#endif
#endif
// Env creates the compositor. Aura widgets need the compositor to be created
......
......@@ -522,56 +522,6 @@ class EqualBugWorkaroundsInBrowserAndGpuProcessPage(gpu_test_base.PageBase):
(browser_list, gpu_list, list(diff)))
class HasTransparentVisualsShared(GpuProcessSharedPageState):
def __init__(self, test, finder_options, story_set):
super(HasTransparentVisualsShared, self).__init__(
test, finder_options, story_set)
options = finder_options.browser_options
if sys.platform.startswith('linux'):
# Hit id 173 from kGpuDriverBugListJson.
options.AppendExtraBrowserArgs('--gpu-testing-gl-version=3.0 Mesa ' \
'12.1')
class HasTransparentVisualsGpuProcessPage(DriverBugWorkaroundsTestsPage):
def __init__(self, story_set, expectations):
super(HasTransparentVisualsGpuProcessPage, self).__init__(
name='GpuProcess.has_transparent_visuals_gpu_process',
page_set=story_set,
shared_page_state_class=HasTransparentVisualsShared,
expectations=expectations,
expected_workaround=None,
unexpected_workaround='disable_transparent_visuals')
def Validate(self, tab, results):
if sys.platform.startswith('linux'):
super(HasTransparentVisualsGpuProcessPage, self).Validate(tab, results)
class NoTransparentVisualsShared(GpuProcessSharedPageState):
def __init__(self, test, finder_options, story_set):
super(NoTransparentVisualsShared, self).__init__(
test, finder_options, story_set)
options = finder_options.browser_options
if sys.platform.startswith('linux'):
# Hit id 173 from kGpuDriverBugListJson.
options.AppendExtraBrowserArgs('--gpu-testing-gl-version=4.5.0 ' \
'NVIDIA 352.41')
class NoTransparentVisualsGpuProcessPage(DriverBugWorkaroundsTestsPage):
def __init__(self, story_set, expectations):
super(NoTransparentVisualsGpuProcessPage, self).__init__(
name='GpuProcess.no_transparent_visuals_gpu_process',
page_set=story_set,
shared_page_state_class=NoTransparentVisualsShared,
expectations=expectations,
expected_workaround='disable_transparent_visuals',
unexpected_workaround=None)
def Validate(self, tab, results):
if sys.platform.startswith('linux'):
super(NoTransparentVisualsGpuProcessPage, self).Validate(tab, results)
class GpuProcessTestsStorySet(story_set_module.StorySet):
""" Tests that accelerated content triggers the creation of a GPU process """
......@@ -607,8 +557,6 @@ class GpuProcessTestsStorySet(story_set_module.StorySet):
self.AddStory(DriverBugWorkaroundsUponGLRendererPage(self, expectations))
self.AddStory(EqualBugWorkaroundsInBrowserAndGpuProcessPage(self,
expectations))
self.AddStory(HasTransparentVisualsGpuProcessPage(self, expectations))
self.AddStory(NoTransparentVisualsGpuProcessPage(self, expectations))
@property
def allow_mixed_story_states(self):
......
......@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/compiler_specific.h"
#include "base/macros.h"
#include "base/run_loop.h"
#include "base/strings/string_number_conversions.h"
......@@ -24,10 +23,6 @@
#include "ui/base/win/shell.h"
#endif
#if defined(USE_X11) && !defined(OS_CHROMEOS)
#include "ui/gfx/x/x11_switches.h"
#endif
namespace extensions {
namespace {
......@@ -135,30 +130,20 @@ IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest, WindowsApiSetShapeNoPerm) {
IN_PROC_BROWSER_TEST_F(PlatformAppBrowserTest,
WindowsApiAlphaEnabledHasPermissions) {
const char kNoAlphaDir[] =
const char* no_alpha_dir =
"platform_apps/windows_api_alpha_enabled/has_permissions_no_alpha";
const char kHasAlphaDir[] =
"platform_apps/windows_api_alpha_enabled/has_permissions_has_alpha";
ALLOW_UNUSED_LOCAL(kHasAlphaDir);
const char* test_dir = kNoAlphaDir;
const char* test_dir = no_alpha_dir;
#if defined(USE_AURA) && (defined(OS_CHROMEOS) || !defined(OS_LINUX))
test_dir = kHasAlphaDir;
test_dir =
"platform_apps/windows_api_alpha_enabled/has_permissions_has_alpha";
#if defined(OS_WIN)
if (!ui::win::IsAeroGlassEnabled()) {
test_dir = kNoAlphaDir;
test_dir = no_alpha_dir;
}
#endif // OS_WIN
#endif // USE_AURA && (OS_CHROMEOS || !OS_LINUX)
#if defined(USE_X11) && !defined(OS_CHROMEOS)
if (base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
switches::kWindowDepth) == "32") {
test_dir = kHasAlphaDir;
}
#endif // USE_X11 && !OS_CHROMEOS
EXPECT_TRUE(RunPlatformAppTest(test_dir)) << message_;
}
......
......@@ -19,7 +19,7 @@ const char kGpuDriverBugListJson[] = LONG_STRING_CONST(
{
"name": "gpu driver bug list",
// Please update the version number whenever you change this file.
"version": "8.77",
"version": "8.76",
"entries": [
{
"id": 1,
......@@ -1857,22 +1857,6 @@ LONG_STRING_CONST(
"features": [
"disable_framebuffer_cmaa"
]
},
{
"id": 173,
"description": "Limit transparent visuals to drivers known to work",
"cr_bugs": [369209],
"os": {
"type": "linux"
},
"exceptions" : [
{
"driver_vendor": "Mesa"
}
],
"features": [
"disable_transparent_visuals"
]
}
]
}
......
......@@ -67,8 +67,6 @@
disable_timestamp_queries) \
GPU_OP(DISABLE_MULTISAMPLING_COLOR_MASK_USAGE, \
disable_multisampling_color_mask_usage) \
GPU_OP(DISABLE_TRANSPARENT_VISUALS, \
disable_transparent_visuals) \
GPU_OP(DISABLE_WEBGL_RGB_MULTISAMPLING_USAGE, \
disable_webgl_rgb_multisampling_usage) \
GPU_OP(ETC1_POWER_OF_TWO_ONLY, \
......
......@@ -58,6 +58,11 @@
#include "ui/gfx/skia_util.h"
#include "ui/gfx/x/x11_error_tracker.h"
#if !defined(OS_CHROMEOS)
#include "base/command_line.h"
#include "ui/gfx/x/x11_switches.h"
#endif
#if defined(OS_FREEBSD)
#include <sys/sysctl.h>
#include <sys/types.h>
......@@ -1412,9 +1417,7 @@ void LogErrorEventDescription(XDisplay* dpy,
}
#if !defined(OS_CHROMEOS)
void ChooseVisualForWindow(bool enable_transparent_visuals,
Visual** visual,
int* depth) {
void ChooseVisualForWindow(Visual** visual, int* depth) {
static Visual* s_visual = NULL;
static int s_depth = 0;
......@@ -1422,7 +1425,8 @@ void ChooseVisualForWindow(bool enable_transparent_visuals,
XDisplay* display = gfx::GetXDisplay();
XAtom NET_WM_CM_S0 = XInternAtom(display, "_NET_WM_CM_S0", False);
if (enable_transparent_visuals &&
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableTransparentVisuals) &&
XGetSelectionOwner(display, NET_WM_CM_S0) != None) {
// Choose the first ARGB8888 visual
XVisualInfo visual_template;
......@@ -1435,6 +1439,12 @@ void ChooseVisualForWindow(bool enable_transparent_visuals,
// Why support only 8888 ARGB? Because it's all that GTK+ supports. In
// gdkvisual-x11.cc, they look for this specific visual and use it for
// all their alpha channel using needs.
//
// TODO(erg): While the following does find a valid visual, some GL
// drivers
// don't believe that this has an alpha channel. According to marcheu@,
// this should work on open source driver though. (It doesn't work with
// NVidia's binaries currently.) http://crbug.com/369209
const XVisualInfo& info = visual_list[i];
if (info.depth == 32 && info.visual->red_mask == 0xff0000 &&
info.visual->green_mask == 0x00ff00 &&
......
......@@ -51,9 +51,7 @@ UI_BASE_X_EXPORT void LogErrorEventDescription(Display* dpy,
// supports transparency. NULL parameters are allowed to install or query the
// cached visual and depth.
#if !defined(OS_CHROMEOS)
UI_BASE_X_EXPORT void ChooseVisualForWindow(bool enable_transparent_visuals,
Visual** visual,
int* depth);
UI_BASE_X_EXPORT void ChooseVisualForWindow(Visual** visual, int* depth);
#endif
} // namespace ui
......
......@@ -8,6 +8,13 @@
namespace switches {
#if !defined(OS_CHROMEOS)
// When enabled, tries to get a transparent X11 visual so that we can have
// per-pixel alpha in windows.
//
// TODO(erg): Remove this switch once we've stabilized the code
// path. http://crbug.com/369209
const char kEnableTransparentVisuals[] = "enable-transparent-visuals";
// Color bit depth of the main window created in the browser process and matches
// XWindowAttributes.depth.
const char kWindowDepth[] = "window-depth";
......
......@@ -11,6 +11,7 @@
namespace switches {
#if !defined(OS_CHROMEOS)
GFX_EXPORT extern const char kEnableTransparentVisuals[];
GFX_EXPORT extern const char kWindowDepth[];
GFX_EXPORT extern const char kX11Display[];
GFX_EXPORT extern const char kX11VisualID[];
......
......@@ -1158,7 +1158,7 @@ void DesktopWindowTreeHostX11::InitX11Window(
Visual* visual;
int depth;
ui::ChooseVisualForWindow(true, &visual, &depth);
ui::ChooseVisualForWindow(&visual, &depth);
if (depth == 32) {
attribute_mask |= CWColormap;
swa.colormap =
......
......@@ -7,7 +7,7 @@
#include <set>
#include "base/bind.h"
#include "base/environment.h"
#include "base/command_line.h"
#include "base/macros.h"
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
......@@ -3740,14 +3740,13 @@ void InitializeWidgetForOpacity(
Widget::InitParams init_params,
const Widget::InitParams::WindowOpacity opacity) {
#if defined(USE_X11)
// testing/xvfb.py runs xvfb and xcompmgr.
std::unique_ptr<base::Environment> env(base::Environment::Create());
bool has_compositing_manager = env->HasVar("_CHROMIUM_INSIDE_XVFB");
int depth = 0;
ui::ChooseVisualForWindow(has_compositing_manager, NULL, &depth);
// On Linux, transparent visuals is currently not activated by default.
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
command_line->AppendSwitch(switches::kEnableTransparentVisuals);
if (has_compositing_manager)
EXPECT_EQ(depth, 32);
int depth = 0;
ui::ChooseVisualForWindow(NULL, &depth);
EXPECT_EQ(depth, 32);
#endif
init_params.opacity = opacity;
......@@ -3759,8 +3758,7 @@ void InitializeWidgetForOpacity(
widget.Init(init_params);
#if defined(USE_X11)
if (has_compositing_manager)
EXPECT_TRUE(widget.IsTranslucentWindowOpacitySupported());
EXPECT_TRUE(widget.IsTranslucentWindowOpacitySupported());
#endif
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment