Skip to content

Commit

Permalink
Revert "gpu: Disable AImageReader for ARM GPUs on Android P and below."
Browse files Browse the repository at this point in the history
This reverts commit 56d27fb.

Reason for revert: This was a temporarily landed as a safer merge
candidate for M81. The long term fix for the bug has already landed.

Original change's description:
> gpu: Disable AImageReader for ARM GPUs on Android P and below.
> 
> This change adds a temporary workaround to effectively revert the
> following changes. While the long term fix for this bug has landed, it
> might be too risky to merge to M81. So this change reverts enabling of
> AImageReader on these GPUs, to restore the behaviour prior to M80.
> 
> Reverted changes:
> https://chromium-review.googlesource.com/c/chromium/src/+/2015553
> https://chromium-review.googlesource.com/c/chromium/src/+/1873393
> 
> TBR=nyquist@chromium.org
> R=​dalecurtis@chromium.org
> 
> Bug: 1051705
> Change-Id: I2f7f0828c8ba4a7279c2f6bb95de449402d88f92
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2087987
> Commit-Queue: Khushal <khushalsagar@chromium.org>
> Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#747355}

TBR=dalecurtis@chromium.org,nyquist@chromium.org,khushalsagar@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 1051705
Change-Id: I97c4e3198a3581fc3c437894c0be57681d4d80fa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2107807
Reviewed-by: Khushal <khushalsagar@chromium.org>
Commit-Queue: Khushal <khushalsagar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#751247}
  • Loading branch information
khushalsagar authored and Commit Bot committed Mar 18, 2020
1 parent 56a96e5 commit 6602b8d
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 39 deletions.
8 changes: 1 addition & 7 deletions base/android/android_image_reader_compat.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,15 @@
namespace base {
namespace android {

bool AndroidImageReader::disable_support_ = false;

AndroidImageReader& AndroidImageReader::GetInstance() {
// C++11 static local variable initialization is
// thread-safe.
static base::NoDestructor<AndroidImageReader> instance;
return *instance;
}

void AndroidImageReader::DisableSupport() {
disable_support_ = true;
}

bool AndroidImageReader::IsSupported() {
return !disable_support_ && is_supported_;
return is_supported_;
}

AndroidImageReader::AndroidImageReader() {
Expand Down
4 changes: 0 additions & 4 deletions base/android/android_image_reader_compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@ class BASE_EXPORT AndroidImageReader {
// Thread safe GetInstance.
static AndroidImageReader& GetInstance();

// Disable image reader support.
static void DisableSupport();

// Check if the image reader usage is supported. This function returns TRUE
// if android version is >=OREO, image reader support is not disabled and all
// the required functions are loaded.
Expand Down Expand Up @@ -67,7 +64,6 @@ class BASE_EXPORT AndroidImageReader {
AndroidImageReader();
bool LoadFunctions();

static bool disable_support_;
bool is_supported_;
pAImage_delete AImage_delete_;
pAImage_deleteAsync AImage_deleteAsync_;
Expand Down
16 changes: 0 additions & 16 deletions gpu/config/gpu_driver_bug_list.json
Original file line number Diff line number Diff line change
Expand Up @@ -3568,22 +3568,6 @@
"dont_delete_source_texture_for_egl_image"
]
},
{
"id":335,
"cr_bugs": [1051705],
"description": "Disable AImageReader on ARM GPUs",
"os": {
"type": "android",
"version": {
"op": "<",
"value": "10"
}
},
"gl_vendor": "ARM.*",
"features": [
"disable_aimagereader"
]
},
{
"id": 336,
"cr_bugs": [625785],
Expand Down
1 change: 0 additions & 1 deletion gpu/config/gpu_workaround_list.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ decode_encode_srgb_for_generatemipmap
depth_stencil_renderbuffer_resize_emulation
disable_2d_canvas_auto_flush
disable_accelerated_vpx_decode
disable_aimagereader
disable_async_readpixels
disable_av_sample_buffer_display_layer
disable_blend_equation_advanced
Expand Down
11 changes: 0 additions & 11 deletions gpu/ipc/service/gpu_init.cc
Original file line number Diff line number Diff line change
Expand Up @@ -524,12 +524,6 @@ bool GpuInit::InitializeAndStartSandbox(base::CommandLine* command_line,
ui::OzonePlatform::GetInstance()->AfterSandboxEntry();
#endif

#if defined(OS_ANDROID)
// Disable AImageReader if the workaround is enabled.
if (gpu_feature_info_.IsWorkaroundEnabled(DISABLE_AIMAGEREADER)) {
base::android::AndroidImageReader::DisableSupport();
}
#endif
#if defined(USE_OZONE)
gpu_feature_info_.supported_buffer_formats_for_allocation_and_texturing =
std::move(supported_buffer_formats_for_texturing);
Expand All @@ -556,11 +550,6 @@ void GpuInit::InitializeInProcess(base::CommandLine* command_line,

default_offscreen_surface_ = gl::init::CreateOffscreenGLSurface(gfx::Size());

// Disable AImageReader if the workaround is enabled.
if (gpu_feature_info_.IsWorkaroundEnabled(DISABLE_AIMAGEREADER)) {
base::android::AndroidImageReader::DisableSupport();
}

UMA_HISTOGRAM_ENUMERATION("GPU.GLImplementation", gl::GetGLImplementation());
}
#else
Expand Down

0 comments on commit 6602b8d

Please sign in to comment.