Chromium Code Reviews

Side by Side Diff: gpu/ipc/client/command_buffer_proxy_impl.cc

Issue 2881813002: Revert of gpu: GPU service scheduler. (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
« no previous file with comments | « gpu/ipc/client/command_buffer_proxy_impl.h ('k') | gpu/ipc/client/gpu_channel_host.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "gpu/ipc/client/command_buffer_proxy_impl.h" 5 #include "gpu/ipc/client/command_buffer_proxy_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 42 matching lines...)
53 CommandBufferProxyImpl::CommandBufferProxyImpl(int channel_id, 53 CommandBufferProxyImpl::CommandBufferProxyImpl(int channel_id,
54 int32_t route_id, 54 int32_t route_id,
55 int32_t stream_id) 55 int32_t stream_id)
56 : lock_(nullptr), 56 : lock_(nullptr),
57 gpu_control_client_(nullptr), 57 gpu_control_client_(nullptr),
58 command_buffer_id_(CommandBufferProxyID(channel_id, route_id)), 58 command_buffer_id_(CommandBufferProxyID(channel_id, route_id)),
59 route_id_(route_id), 59 route_id_(route_id),
60 stream_id_(stream_id), 60 stream_id_(stream_id),
61 weak_this_(AsWeakPtr()) { 61 weak_this_(AsWeakPtr()) {
62 DCHECK(route_id); 62 DCHECK(route_id);
63 DCHECK_NE(stream_id, GPU_STREAM_INVALID);
63 } 64 }
64 65
65 // static 66 // static
66 std::unique_ptr<CommandBufferProxyImpl> CommandBufferProxyImpl::Create( 67 std::unique_ptr<CommandBufferProxyImpl> CommandBufferProxyImpl::Create(
67 scoped_refptr<GpuChannelHost> host, 68 scoped_refptr<GpuChannelHost> host,
68 gpu::SurfaceHandle surface_handle, 69 gpu::SurfaceHandle surface_handle,
69 CommandBufferProxyImpl* share_group, 70 CommandBufferProxyImpl* share_group,
70 int32_t stream_id, 71 int32_t stream_id,
71 gpu::SchedulingPriority stream_priority, 72 gpu::GpuStreamPriority stream_priority,
72 const gpu::gles2::ContextCreationAttribHelper& attribs, 73 const gpu::gles2::ContextCreationAttribHelper& attribs,
73 const GURL& active_url, 74 const GURL& active_url,
74 scoped_refptr<base::SingleThreadTaskRunner> task_runner) { 75 scoped_refptr<base::SingleThreadTaskRunner> task_runner) {
75 DCHECK(!share_group || (stream_id == share_group->stream_id_)); 76 DCHECK(!share_group || (stream_id == share_group->stream_id_));
76 TRACE_EVENT1("gpu", "GpuChannelHost::CreateViewCommandBuffer", 77 TRACE_EVENT1("gpu", "GpuChannelHost::CreateViewCommandBuffer",
77 "surface_handle", surface_handle); 78 "surface_handle", surface_handle);
78 79
79 GPUCreateCommandBufferConfig init_params; 80 GPUCreateCommandBufferConfig init_params;
80 init_params.surface_handle = surface_handle; 81 init_params.surface_handle = surface_handle;
81 init_params.share_group_id = 82 init_params.share_group_id =
(...skipping 582 matching lines...)
664 // Can only wait on an unverified sync token if it is from the same channel. 665 // Can only wait on an unverified sync token if it is from the same channel.
665 int sync_token_channel_id = GetChannelID(sync_token.command_buffer_id()); 666 int sync_token_channel_id = GetChannelID(sync_token.command_buffer_id());
666 int channel_id = GetChannelID(command_buffer_id_); 667 int channel_id = GetChannelID(command_buffer_id_);
667 if (sync_token.namespace_id() != gpu::CommandBufferNamespace::GPU_IO || 668 if (sync_token.namespace_id() != gpu::CommandBufferNamespace::GPU_IO ||
668 sync_token_channel_id != channel_id) { 669 sync_token_channel_id != channel_id) {
669 return false; 670 return false;
670 } 671 }
671 672
672 // If waiting on a different stream, flush pending commands on that stream. 673 // If waiting on a different stream, flush pending commands on that stream.
673 int32_t release_stream_id = sync_token.extra_data_field(); 674 int32_t release_stream_id = sync_token.extra_data_field();
675 if (release_stream_id == gpu::GPU_STREAM_INVALID)
676 return false;
677
674 if (release_stream_id != stream_id_) 678 if (release_stream_id != stream_id_)
675 channel_->FlushPendingStream(release_stream_id); 679 channel_->FlushPendingStream(release_stream_id);
676 680
677 return true; 681 return true;
678 } 682 }
679 683
680 void CommandBufferProxyImpl::AddLatencyInfo( 684 void CommandBufferProxyImpl::AddLatencyInfo(
681 const std::vector<ui::LatencyInfo>& latency_info) { 685 const std::vector<ui::LatencyInfo>& latency_info) {
682 CheckLock(); 686 CheckLock();
683 for (size_t i = 0; i < latency_info.size(); i++) 687 for (size_t i = 0; i < latency_info.size(); i++)
(...skipping 260 matching lines...)
944 return; 948 return;
945 channel_->FlushPendingStream(stream_id_); 949 channel_->FlushPendingStream(stream_id_);
946 channel_->Send(new GpuChannelMsg_DestroyCommandBuffer(route_id_)); 950 channel_->Send(new GpuChannelMsg_DestroyCommandBuffer(route_id_));
947 channel_->RemoveRoute(route_id_); 951 channel_->RemoveRoute(route_id_);
948 channel_ = nullptr; 952 channel_ = nullptr;
949 if (gpu_control_client_) 953 if (gpu_control_client_)
950 gpu_control_client_->OnGpuControlLostContext(); 954 gpu_control_client_->OnGpuControlLostContext();
951 } 955 }
952 956
953 } // namespace gpu 957 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/ipc/client/command_buffer_proxy_impl.h ('k') | gpu/ipc/client/gpu_channel_host.h » ('j') | no next file with comments »

Powered by Google App Engine