summaryrefslogtreecommitdiffstats
path: root/chromium/gpu
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/gpu')
-rw-r--r--chromium/gpu/command_buffer/client/raster_implementation.cc18
-rw-r--r--chromium/gpu/command_buffer/client/raster_implementation.h4
-rw-r--r--chromium/gpu/command_buffer/client/raster_implementation_unittest.cc7
-rw-r--r--chromium/gpu/command_buffer/service/raster_decoder.cc28
-rw-r--r--chromium/gpu/command_buffer/service/shared_context_state.cc2
-rw-r--r--chromium/gpu/command_buffer/service/shared_context_state.h2
-rw-r--r--chromium/gpu/config/gpu_driver_bug_list.json35
-rw-r--r--chromium/gpu/config/gpu_lists_version.h2
-rw-r--r--chromium/gpu/config/gpu_util.cc5
-rw-r--r--chromium/gpu/config/gpu_workaround_list.txt1
-rw-r--r--chromium/gpu/ipc/service/direct_composition_surface_win.cc6
11 files changed, 90 insertions, 20 deletions
diff --git a/chromium/gpu/command_buffer/client/raster_implementation.cc b/chromium/gpu/command_buffer/client/raster_implementation.cc
index a4ad95d85a2..2a8d060343f 100644
--- a/chromium/gpu/command_buffer/client/raster_implementation.cc
+++ b/chromium/gpu/command_buffer/client/raster_implementation.cc
@@ -191,11 +191,12 @@ class RasterImplementation::PaintOpSerializer {
TransferCacheSerializeHelperImpl* transfer_cache_helper,
ClientFontManager* font_manager)
: ri_(ri),
- buffer_(static_cast<char*>(ri_->MapRasterCHROMIUM(initial_size))),
stashing_image_provider_(stashing_image_provider),
transfer_cache_helper_(transfer_cache_helper),
- font_manager_(font_manager),
- free_bytes_(buffer_ ? initial_size : 0) {}
+ font_manager_(font_manager) {
+ buffer_ =
+ static_cast<char*>(ri_->MapRasterCHROMIUM(initial_size, &free_bytes_));
+ }
~PaintOpSerializer() {
// Need to call SendSerializedData;
@@ -213,12 +214,11 @@ class RasterImplementation::PaintOpSerializer {
ri_->paint_cache_->AbortPendingEntries();
SendSerializedData();
- buffer_ = static_cast<char*>(ri_->MapRasterCHROMIUM(kBlockAlloc));
+ buffer_ =
+ static_cast<char*>(ri_->MapRasterCHROMIUM(kBlockAlloc, &free_bytes_));
if (!buffer_) {
- free_bytes_ = 0;
return 0;
}
- free_bytes_ = kBlockAlloc;
size = op->Serialize(buffer_ + written_bytes_, free_bytes_, options);
}
DCHECK_LE(size, free_bytes_);
@@ -919,7 +919,9 @@ void RasterImplementation::WaitSyncTokenCHROMIUM(
gpu_control_->WaitSyncToken(verified_sync_token);
}
-void* RasterImplementation::MapRasterCHROMIUM(GLsizeiptr size) {
+void* RasterImplementation::MapRasterCHROMIUM(uint32_t size,
+ uint32_t* size_allocated) {
+ *size_allocated = 0u;
if (size < 0) {
SetGLError(GL_INVALID_VALUE, "glMapRasterCHROMIUM", "negative size");
return nullptr;
@@ -934,7 +936,7 @@ void* RasterImplementation::MapRasterCHROMIUM(GLsizeiptr size) {
raster_mapped_buffer_ = base::nullopt;
return nullptr;
}
-
+ *size_allocated = raster_mapped_buffer_->size();
return raster_mapped_buffer_->address();
}
diff --git a/chromium/gpu/command_buffer/client/raster_implementation.h b/chromium/gpu/command_buffer/client/raster_implementation.h
index 444379df337..c4e01fd8628 100644
--- a/chromium/gpu/command_buffer/client/raster_implementation.h
+++ b/chromium/gpu/command_buffer/client/raster_implementation.h
@@ -242,7 +242,9 @@ class RASTER_EXPORT RasterImplementation : public RasterInterface,
GLenum value,
const char* label);
- void* MapRasterCHROMIUM(GLsizeiptr size);
+ // Try to map a transfer buffer of |size|. Will return a pointer to a
+ // buffer of |size_allocated|, which will be equal to or lesser than |size|.
+ void* MapRasterCHROMIUM(uint32_t size, uint32_t* size_allocated);
// |raster_written_size| is the size of buffer used by raster commands.
// |total_written_size| is the total size of the buffer written to, including
diff --git a/chromium/gpu/command_buffer/client/raster_implementation_unittest.cc b/chromium/gpu/command_buffer/client/raster_implementation_unittest.cc
index d78df6c45af..99cf3a984ab 100644
--- a/chromium/gpu/command_buffer/client/raster_implementation_unittest.cc
+++ b/chromium/gpu/command_buffer/client/raster_implementation_unittest.cc
@@ -202,13 +202,6 @@ class RasterImplementationTest : public testing::Test {
QueryTracker* GetQueryTracker() { return gl_->query_tracker_.get(); }
- void* MapRasterCHROMIUM(GLsizeiptr size) {
- return gl_->MapRasterCHROMIUM(size);
- }
- void UnmapRasterCHROMIUM(GLsizeiptr written_size) {
- gl_->UnmapRasterCHROMIUM(written_size, written_size);
- }
-
struct ContextInitOptions {
ContextInitOptions()
: bind_generates_resource_client(true),
diff --git a/chromium/gpu/command_buffer/service/raster_decoder.cc b/chromium/gpu/command_buffer/service/raster_decoder.cc
index c16915d4e8b..b306574e4a5 100644
--- a/chromium/gpu/command_buffer/service/raster_decoder.cc
+++ b/chromium/gpu/command_buffer/service/raster_decoder.cc
@@ -95,6 +95,21 @@ namespace {
base::AtomicSequenceNumber g_raster_decoder_id;
+class ScopedProgressReporter {
+ public:
+ ScopedProgressReporter(gl::ProgressReporter* reporter) : reporter_(reporter) {
+ if (reporter_)
+ reporter_->ReportProgress();
+ }
+ ~ScopedProgressReporter() {
+ if (reporter_)
+ reporter_->ReportProgress();
+ }
+
+ private:
+ gl::ProgressReporter* reporter_;
+};
+
// This class prevents any GL errors that occur when it is in scope from
// being reported to the client.
class ScopedGLErrorSuppressor {
@@ -2206,6 +2221,8 @@ void RasterDecoderImpl::DoRasterCHROMIUM(GLuint raster_shm_id,
options.crash_dump_on_failure = true;
size_t paint_buffer_size = raster_shm_size;
+ ScopedProgressReporter report_progress(
+ shared_context_state_->progress_reporter());
while (paint_buffer_size > 0) {
size_t skip = 0;
cc::PaintOp* deserialized_op = cc::PaintOp::Deserialize(
@@ -2242,7 +2259,16 @@ void RasterDecoderImpl::DoEndRasterCHROMIUM() {
recorder_ = nullptr;
sk_surface_->draw(ddl.get());
}
- sk_surface_->prepareForExternalIO();
+
+ {
+ // This is a slow operation since skia will execute the GPU work for the
+ // complete tile. Make sure the progress reporter is notified to avoid
+ // hangs.
+ ScopedProgressReporter report_progress(
+ shared_context_state_->progress_reporter());
+ sk_surface_->prepareForExternalIO();
+ }
+
if (!shared_image_) {
// Test only path for SetUpForRasterCHROMIUMForTest.
sk_surface_.reset();
diff --git a/chromium/gpu/command_buffer/service/shared_context_state.cc b/chromium/gpu/command_buffer/service/shared_context_state.cc
index 7b4ccdbe188..02acb107330 100644
--- a/chromium/gpu/command_buffer/service/shared_context_state.cc
+++ b/chromium/gpu/command_buffer/service/shared_context_state.cc
@@ -74,6 +74,8 @@ void SharedContextState::InitializeGrContext(
GrContextOptions::PersistentCache* cache,
GpuProcessActivityFlags* activity_flags,
gl::ProgressReporter* progress_reporter) {
+ progress_reporter_ = progress_reporter;
+
if (!use_vulkan_gr_context_) {
DCHECK(context_->IsCurrent(nullptr));
sk_sp<GrGLInterface> interface(gl::init::CreateGrGLInterface(
diff --git a/chromium/gpu/command_buffer/service/shared_context_state.h b/chromium/gpu/command_buffer/service/shared_context_state.h
index 51a28b2ebc5..7883ac2af41 100644
--- a/chromium/gpu/command_buffer/service/shared_context_state.h
+++ b/chromium/gpu/command_buffer/service/shared_context_state.h
@@ -79,6 +79,7 @@ class GPU_GLES2_EXPORT SharedContextState
viz::VulkanContextProvider* vk_context_provider() {
return vk_context_provider_;
}
+ gl::ProgressReporter* progress_reporter() const { return progress_reporter_; }
GrContext* gr_context() { return gr_context_; }
gles2::FeatureInfo* feature_info() { return feature_info_.get(); }
gles2::ContextState* context_state() const { return context_state_.get(); }
@@ -143,6 +144,7 @@ class GPU_GLES2_EXPORT SharedContextState
// raster decoders and display compositor share this context_state_.
std::unique_ptr<gles2::ContextState> context_state_;
+ gl::ProgressReporter* progress_reporter_ = nullptr;
sk_sp<GrContext> owned_gr_context_;
std::unique_ptr<ServiceTransferCache> transfer_cache_;
size_t glyph_cache_max_texture_bytes_ = 0u;
diff --git a/chromium/gpu/config/gpu_driver_bug_list.json b/chromium/gpu/config/gpu_driver_bug_list.json
index 2ac3cf79c5e..4996becd8a7 100644
--- a/chromium/gpu/config/gpu_driver_bug_list.json
+++ b/chromium/gpu/config/gpu_driver_bug_list.json
@@ -3067,6 +3067,41 @@
"features": [
"disable_direct_composition"
]
+ },
+ {
+ "id": 293,
+ "cr_bugs": [931527],
+ "description": "Frequent crashes in glClear on Android N with driver 12.0.04rel0",
+ "os": {
+ "type": "android",
+ "version": {
+ "op": "<",
+ "value": "8.0"
+ }
+ },
+ "driver_version": {
+ "op": "=",
+ "value": "12.0.04rel0"
+ },
+ "features": [
+ "gl_clear_broken"
+ ]
+ },
+ {
+ "id": 294,
+ "cr_bugs": [932879],
+ "description": "Hardware overlays result in black videos on non-Intel GPUs",
+ "os": {
+ "type": "win"
+ },
+ "exceptions": [
+ {
+ "vendor_id": "0x8086"
+ }
+ ],
+ "features": [
+ "disable_direct_composition_layers"
+ ]
}
]
}
diff --git a/chromium/gpu/config/gpu_lists_version.h b/chromium/gpu/config/gpu_lists_version.h
index 545fc54a310..2e511214d9c 100644
--- a/chromium/gpu/config/gpu_lists_version.h
+++ b/chromium/gpu/config/gpu_lists_version.h
@@ -3,6 +3,6 @@
#ifndef GPU_CONFIG_GPU_LISTS_VERSION_H_
#define GPU_CONFIG_GPU_LISTS_VERSION_H_
-#define GPU_LISTS_VERSION "8cd51bd20244a019d86ed5092017a118e2ad962a"
+#define GPU_LISTS_VERSION "4564075605dd87605df1f8c00bf7161c9c4eb41b"
#endif // GPU_CONFIG_GPU_LISTS_VERSION_H_
diff --git a/chromium/gpu/config/gpu_util.cc b/chromium/gpu/config/gpu_util.cc
index c4f4b72d2c8..40115b2bcb0 100644
--- a/chromium/gpu/config/gpu_util.cc
+++ b/chromium/gpu/config/gpu_util.cc
@@ -232,9 +232,14 @@ void AppendWorkaroundsToCommandLine(const GpuFeatureInfo& gpu_feature_info,
if (gpu_feature_info.IsWorkaroundEnabled(DISABLE_ES3_GL_CONTEXT)) {
command_line->AppendSwitch(switches::kDisableES3GLContext);
}
+#if defined(OS_WIN)
if (gpu_feature_info.IsWorkaroundEnabled(DISABLE_DIRECT_COMPOSITION)) {
command_line->AppendSwitch(switches::kDisableDirectComposition);
}
+ if (gpu_feature_info.IsWorkaroundEnabled(DISABLE_DIRECT_COMPOSITION_LAYERS)) {
+ command_line->AppendSwitch(switches::kDisableDirectCompositionLayers);
+ }
+#endif
}
// Adjust gpu feature status based on enabled gpu driver bug workarounds.
diff --git a/chromium/gpu/config/gpu_workaround_list.txt b/chromium/gpu/config/gpu_workaround_list.txt
index 826c74a5e00..c8e2cbadd83 100644
--- a/chromium/gpu/config/gpu_workaround_list.txt
+++ b/chromium/gpu/config/gpu_workaround_list.txt
@@ -22,6 +22,7 @@ disable_d3d11
disable_delayed_copy_nv12
disable_depth_texture
disable_direct_composition
+disable_direct_composition_layers
disable_discard_framebuffer
disable_dxgi_zero_copy_video
disable_es3_gl_context
diff --git a/chromium/gpu/ipc/service/direct_composition_surface_win.cc b/chromium/gpu/ipc/service/direct_composition_surface_win.cc
index 46710ba1e6e..93e0fe4341a 100644
--- a/chromium/gpu/ipc/service/direct_composition_surface_win.cc
+++ b/chromium/gpu/ipc/service/direct_composition_surface_win.cc
@@ -1712,10 +1712,12 @@ bool DirectCompositionSurfaceWin::AreOverlaysSupported() {
InitializeHardwareOverlaySupport();
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
- if (command_line->HasSwitch(switches::kDisableDirectCompositionLayers))
- return false;
+ // Enable flag should be checked before the disable flag, so we could
+ // overwrite GPU driver bug workarounds in testing.
if (command_line->HasSwitch(switches::kEnableDirectCompositionLayers))
return true;
+ if (command_line->HasSwitch(switches::kDisableDirectCompositionLayers))
+ return false;
return g_supports_overlays;
}