OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/gpu/gpu_data_manager_impl_private.h" | 5 #include "content/browser/gpu/gpu_data_manager_impl_private.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
712 if ((gpu_info_.display_link_version.IsValid() | 712 if ((gpu_info_.display_link_version.IsValid() |
713 && gpu_info_.display_link_version.IsOlderThan("7.2")) || | 713 && gpu_info_.display_link_version.IsOlderThan("7.2")) || |
714 gpu_info_.lenovo_dcute) { | 714 gpu_info_.lenovo_dcute) { |
715 reduce_sandbox = true; | 715 reduce_sandbox = true; |
716 } | 716 } |
717 #endif | 717 #endif |
718 | 718 |
719 if (gpu_info_.optimus) | 719 if (gpu_info_.optimus) |
720 reduce_sandbox = true; | 720 reduce_sandbox = true; |
721 | 721 |
722 if (gpu_info_.amd_switchable) { | |
723 // The image transport surface currently doesn't work with AMD Dynamic | |
724 // Switchable graphics. | |
725 reduce_sandbox = true; | |
726 command_line->AppendSwitch(switches::kDisableImageTransportSurface); | |
727 } | |
728 | |
729 if (reduce_sandbox) | 722 if (reduce_sandbox) |
730 command_line->AppendSwitch(switches::kReduceGpuSandbox); | 723 command_line->AppendSwitch(switches::kReduceGpuSandbox); |
731 | 724 |
732 // Pass GPU and driver information to GPU process. We try to avoid full GPU | 725 // Pass GPU and driver information to GPU process. We try to avoid full GPU |
733 // info collection at GPU process startup, but we need gpu vendor_id, | 726 // info collection at GPU process startup, but we need gpu vendor_id, |
734 // device_id, driver_vendor, driver_version for deciding whether we need to | 727 // device_id, driver_vendor, driver_version for deciding whether we need to |
735 // collect full info (on Linux) and for crash reporting purpose. | 728 // collect full info (on Linux) and for crash reporting purpose. |
736 command_line->AppendSwitchASCII(switches::kGpuVendorID, | 729 command_line->AppendSwitchASCII(switches::kGpuVendorID, |
737 base::StringPrintf("0x%04x", gpu_info_.gpu.vendor_id)); | 730 base::StringPrintf("0x%04x", gpu_info_.gpu.vendor_id)); |
738 command_line->AppendSwitchASCII(switches::kGpuDeviceID, | 731 command_line->AppendSwitchASCII(switches::kGpuDeviceID, |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
883 void GpuDataManagerImplPrivate::HandleGpuSwitch() { | 876 void GpuDataManagerImplPrivate::HandleGpuSwitch() { |
884 GpuDataManagerImpl::UnlockedSession session(owner_); | 877 GpuDataManagerImpl::UnlockedSession session(owner_); |
885 observer_list_->Notify(&GpuDataManagerObserver::OnGpuSwitching); | 878 observer_list_->Notify(&GpuDataManagerObserver::OnGpuSwitching); |
886 } | 879 } |
887 | 880 |
888 #if defined(OS_WIN) | 881 #if defined(OS_WIN) |
889 bool GpuDataManagerImplPrivate::IsUsingAcceleratedSurface() const { | 882 bool GpuDataManagerImplPrivate::IsUsingAcceleratedSurface() const { |
890 if (base::win::GetVersion() < base::win::VERSION_VISTA) | 883 if (base::win::GetVersion() < base::win::VERSION_VISTA) |
891 return false; | 884 return false; |
892 | 885 |
893 if (gpu_info_.amd_switchable) | |
894 return false; | |
895 if (use_swiftshader_) | 886 if (use_swiftshader_) |
896 return false; | 887 return false; |
897 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 888 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
898 if (command_line->HasSwitch(switches::kDisableImageTransportSurface)) | 889 if (command_line->HasSwitch(switches::kDisableImageTransportSurface)) |
899 return false; | 890 return false; |
900 return !IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_TEXTURE_SHARING); | 891 return !IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_TEXTURE_SHARING); |
901 } | 892 } |
902 #endif | 893 #endif |
903 | 894 |
904 void GpuDataManagerImplPrivate::BlockDomainFrom3DAPIs( | 895 void GpuDataManagerImplPrivate::BlockDomainFrom3DAPIs( |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1192 void GpuDataManagerImplPrivate::OnGpuProcessInitFailure() { | 1183 void GpuDataManagerImplPrivate::OnGpuProcessInitFailure() { |
1193 gpu_process_accessible_ = false; | 1184 gpu_process_accessible_ = false; |
1194 gpu_info_.finalized = true; | 1185 gpu_info_.finalized = true; |
1195 complete_gpu_info_already_requested_ = true; | 1186 complete_gpu_info_already_requested_ = true; |
1196 // Some observers might be waiting. | 1187 // Some observers might be waiting. |
1197 NotifyGpuInfoUpdate(); | 1188 NotifyGpuInfoUpdate(); |
1198 } | 1189 } |
1199 | 1190 |
1200 } // namespace content | 1191 } // namespace content |
1201 | 1192 |
OLD | NEW |