Commit 3480a07b authored by epenner@chromium.org's avatar epenner@chromium.org

Revert "gpu: Fix Vivante's "hisilicon" GPUs"

Revert "gpu: Fix uninitialized variable."

Reverting these two CLs so they can be landed behind
#ifdef's (for merge safety).

BUG=179250
NOTRY=true

No try since this is just a revert.

Review URL: https://chromiumcodereview.appspot.com/14241009

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@195275 0039d316-1c4b-4281-b951-d872f2087c98
parent 3da7ac8f
......@@ -507,18 +507,6 @@ void GpuCommandBufferStub::OnInitialize(
return;
}
// TODO(epenner): If we can initialize the feature-info earlier,
// this code can be removed and done only during surface creation.
// This code is only needed for the very first surface, which is
// created before the ContextGroup is initialized.
if (context_group_->feature_info()->workarounds()
.makecurrent_recreates_surfaces) {
// This only works with virtual contexts!
DCHECK(CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableVirtualGLContexts));
surface_->SetRecreateOnMakeCurrent(true);
}
if (CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableGPUServiceLogging)) {
decoder_->set_log_commands(true);
......
......@@ -29,15 +29,6 @@ scoped_refptr<gfx::GLSurface> ImageTransportSurface::CreateNativeSurface(
if (!initialize_success)
return scoped_refptr<gfx::GLSurface>();
if (stub->decoder()
->GetContextGroup()
->feature_info()
->workarounds()
.makecurrent_recreates_surfaces) {
static_cast<gfx::NativeViewGLSurfaceEGL*>
(surface.get())->SetRecreateOnMakeCurrent(true);
}
return scoped_refptr<gfx::GLSurface>(new PassThroughImageTransportSurface(
manager, stub, surface.get(), false));
}
......
......@@ -74,7 +74,6 @@ bool CollectBasicGraphicsInfo(content::GPUInfo* gpu_info) {
bool is_arm = vendor.find("arm") != std::string::npos;
bool is_qualcomm = vendor.find("qualcomm") != std::string::npos;
bool is_mali_t604 = is_arm && renderer.find("mali-t604") != std::string::npos;
bool is_hisilicon = vendor.find("hisilicon") != std::string::npos;
base::android::BuildInfo* build_info =
base::android::BuildInfo::GetInstance();
......@@ -92,8 +91,7 @@ bool CollectBasicGraphicsInfo(content::GPUInfo* gpu_info) {
// IMG: avoid context switching perf problems, crashes with share groups
// Mali-T604: http://crbug.com/154715
// QualComm, NVIDIA: Crashes with share groups
if (is_hisilicon || is_img || is_mali_t604 || is_nexus7
|| (is_qualcomm && sdk_int != 16)) {
if (is_img || is_mali_t604 || is_nexus7 || (is_qualcomm && sdk_int != 16)) {
CommandLine::ForCurrentProcess()->AppendSwitch(
switches::kEnableVirtualGLContexts);
}
......
......@@ -191,7 +191,6 @@ void FeatureInfo::AddFeatures(const CommandLine& command_line) {
bool is_qualcomm = false;
bool is_imagination = false;
bool is_arm = false;
bool is_hisilicon = false;
const char* gl_strings[2];
gl_strings[0] = reinterpret_cast<const char*>(glGetString(GL_VENDOR));
gl_strings[1] = reinterpret_cast<const char*>(glGetString(GL_RENDERER));
......@@ -209,7 +208,6 @@ void FeatureInfo::AddFeatures(const CommandLine& command_line) {
is_qualcomm |= string_set.Contains("qualcomm");
is_imagination |= string_set.Contains("imagination");
is_arm |= string_set.Contains("arm");
is_hisilicon |= string_set.Contains("hisilicon");
}
}
......@@ -223,9 +221,6 @@ void FeatureInfo::AddFeatures(const CommandLine& command_line) {
workarounds_.flush_on_context_switch = true;
workarounds_.delete_instead_of_resize_fbo = true;
}
if (is_hisilicon) {
workarounds_.makecurrent_recreates_surfaces = true;
}
#if defined(OS_MACOSX)
workarounds_.needs_offscreen_buffer_workaround = is_nvidia;
workarounds_.needs_glsl_built_in_function_emulation = is_amd;
......
......@@ -28,8 +28,6 @@
exit_on_context_lost) \
GPU_OP(FLUSH_ON_CONTEXT_SWITCH, \
flush_on_context_switch) \
GPU_OP(MAKECURRENT_RECREATES_SURFACES, \
makecurrent_recreates_surfaces) \
GPU_OP(MAX_CUBE_MAP_TEXTURE_SIZE_LIMIT_1024, \
max_cube_map_texture_size_limit_1024) \
GPU_OP(MAX_CUBE_MAP_TEXTURE_SIZE_LIMIT_4096, \
......
......@@ -112,9 +112,6 @@ bool GLContextEGL::MakeCurrent(GLSurface* surface) {
return false;
}
if (!RecreateSurfaceIfNeeded(surface))
return false;
if (!surface->OnMakeCurrent(this)) {
LOG(ERROR) << "Could not make current.";
return false;
......@@ -124,39 +121,6 @@ bool GLContextEGL::MakeCurrent(GLSurface* surface) {
return true;
}
bool GLContextEGL::RecreateSurfaceIfNeeded(GLSurface* surface) {
if (!surface || !surface->RecreateOnMakeCurrent())
return true;
// This is specifically needed for Vivante GPU's on Android.
// A native view surface will not be configured correctly
// unless we do all of the following steps after making the
// surface current.
GLint fbo = 0;
glGetIntegerv(GL_FRAMEBUFFER_BINDING, &fbo);
glBindFramebufferEXT(GL_FRAMEBUFFER, 0);
eglMakeCurrent(display_,
EGL_NO_SURFACE,
EGL_NO_SURFACE,
EGL_NO_CONTEXT);
if (!surface->Recreate()) {
LOG(ERROR) << "Failed to recreate surface";
return false;
}
if (!eglMakeCurrent(display_,
surface->GetHandle(),
surface->GetHandle(),
context_)) {
LOG(ERROR) << "eglMakeCurrent failed with error "
<< GetLastEGLErrorString();
return false;
}
glBindFramebufferEXT(GL_FRAMEBUFFER, fbo);
return true;
}
void GLContextEGL::ReleaseCurrent(GLSurface* surface) {
if (!IsCurrent(surface))
return;
......
......@@ -36,8 +36,6 @@ class GLContextEGL : public GLContext {
virtual bool WasAllocatedUsingRobustnessExtension() OVERRIDE;
virtual bool GetTotalGpuMemory(size_t* bytes) OVERRIDE;
bool RecreateSurfaceIfNeeded(GLSurface* surface);
protected:
virtual ~GLContextEGL();
......
......@@ -84,11 +84,6 @@ bool GLSurface::Resize(const gfx::Size& size) {
return false;
}
bool GLSurface::Recreate() {
NOTIMPLEMENTED();
return false;
}
bool GLSurface::DeferDraws() {
return false;
}
......@@ -150,13 +145,6 @@ VSyncProvider* GLSurface::GetVSyncProvider() {
return NULL;
}
bool GLSurface::RecreateOnMakeCurrent() {
return false;
}
void GLSurface::SetRecreateOnMakeCurrent(bool recreate) {
}
GLSurface* GLSurface::GetCurrent() {
return current_surface_.Pointer()->Get();
}
......@@ -197,10 +185,6 @@ bool GLSurfaceAdapter::Resize(const gfx::Size& size) {
return surface_->Resize(size);
}
bool GLSurfaceAdapter::Recreate() {
return surface_->Recreate();
}
bool GLSurfaceAdapter::DeferDraws() {
return surface_->DeferDraws();
}
......@@ -265,14 +249,6 @@ VSyncProvider* GLSurfaceAdapter::GetVSyncProvider() {
return surface_->GetVSyncProvider();
}
bool GLSurfaceAdapter::RecreateOnMakeCurrent() {
return surface_->RecreateOnMakeCurrent();
}
void GLSurfaceAdapter::SetRecreateOnMakeCurrent(bool recreate) {
surface_->SetRecreateOnMakeCurrent(recreate);
}
GLSurfaceAdapter::~GLSurfaceAdapter() {}
} // namespace gfx
......@@ -39,9 +39,6 @@ class GL_EXPORT GLSurface : public base::RefCounted<GLSurface> {
virtual bool Resize(const gfx::Size& size);
// Recreate the surface without changing the size.
virtual bool Recreate();
// Unschedule the GpuScheduler and return true to abort the processing of
// a GL draw call to this surface and defer it until the GpuScheduler is
// rescheduled.
......@@ -105,11 +102,6 @@ class GL_EXPORT GLSurface : public base::RefCounted<GLSurface> {
// of screen refresh. If unavailable, returns NULL.
virtual VSyncProvider* GetVSyncProvider();
// Certain surfaces need to be destroyed and recreated
// every time they are made the current surface.
virtual bool RecreateOnMakeCurrent();
virtual void SetRecreateOnMakeCurrent(bool recreate);
// Create a GL surface that renders directly to a view.
static scoped_refptr<GLSurface> CreateViewGLSurface(
bool software,
......@@ -145,7 +137,6 @@ class GL_EXPORT GLSurfaceAdapter : public GLSurface {
virtual bool Initialize() OVERRIDE;
virtual void Destroy() OVERRIDE;
virtual bool Resize(const gfx::Size& size) OVERRIDE;
virtual bool Recreate() OVERRIDE;
virtual bool DeferDraws() OVERRIDE;
virtual bool IsOffscreen() OVERRIDE;
virtual bool SwapBuffers() OVERRIDE;
......@@ -162,8 +153,6 @@ class GL_EXPORT GLSurfaceAdapter : public GLSurface {
virtual void* GetConfig() OVERRIDE;
virtual unsigned GetFormat() OVERRIDE;
virtual VSyncProvider* GetVSyncProvider() OVERRIDE;
virtual bool RecreateOnMakeCurrent() OVERRIDE;
virtual void SetRecreateOnMakeCurrent(bool recreate) OVERRIDE;
GLSurface* surface() const { return surface_.get(); }
......
......@@ -221,8 +221,7 @@ NativeViewGLSurfaceEGL::NativeViewGLSurfaceEGL(bool software,
: window_(window),
surface_(NULL),
supports_post_sub_buffer_(false),
config_(NULL),
recreate_on_make_current_(false) {
config_(NULL) {
software_ = software;
#if defined(OS_ANDROID)
if (window)
......@@ -400,28 +399,16 @@ bool NativeViewGLSurfaceEGL::Resize(const gfx::Size& size) {
if (was_current)
current_context->ReleaseCurrent(this);
Recreate();
if (was_current)
return current_context->MakeCurrent(this);
return true;
}
bool NativeViewGLSurfaceEGL::Recreate() {
Destroy();
if (!Initialize()) {
LOG(ERROR) << "Failed to create surface.";
LOG(ERROR) << "Failed to resize pbuffer.";
return false;
}
return true;
}
bool NativeViewGLSurfaceEGL::RecreateOnMakeCurrent() {
return recreate_on_make_current_;
}
void NativeViewGLSurfaceEGL::SetRecreateOnMakeCurrent(bool recreate) {
recreate_on_make_current_ = recreate;
if (was_current)
return current_context->MakeCurrent(this);
return true;
}
EGLSurface NativeViewGLSurfaceEGL::GetHandle() {
......
......@@ -60,7 +60,6 @@ class GL_EXPORT NativeViewGLSurfaceEGL : public GLSurfaceEGL {
virtual bool Initialize() OVERRIDE;
virtual void Destroy() OVERRIDE;
virtual bool Resize(const gfx::Size& size) OVERRIDE;
virtual bool Recreate() OVERRIDE;
virtual bool IsOffscreen() OVERRIDE;
virtual bool SwapBuffers() OVERRIDE;
virtual gfx::Size GetSize() OVERRIDE;
......@@ -68,8 +67,6 @@ class GL_EXPORT NativeViewGLSurfaceEGL : public GLSurfaceEGL {
virtual std::string GetExtensions() OVERRIDE;
virtual bool PostSubBuffer(int x, int y, int width, int height) OVERRIDE;
virtual VSyncProvider* GetVSyncProvider() OVERRIDE;
virtual bool RecreateOnMakeCurrent() OVERRIDE;
virtual void SetRecreateOnMakeCurrent(bool recreate) OVERRIDE;
protected:
virtual ~NativeViewGLSurfaceEGL();
......@@ -80,7 +77,6 @@ class GL_EXPORT NativeViewGLSurfaceEGL : public GLSurfaceEGL {
EGLSurface surface_;
bool supports_post_sub_buffer_;
EGLConfig config_;
bool recreate_on_make_current_;
scoped_ptr<VSyncProvider> vsync_provider_;
......
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