OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "chrome/gpu/gpu_arc_video_service.h" | 5 #include "chrome/gpu/gpu_arc_video_service.h" |
6 | 6 |
7 #include <fcntl.h> | 7 #include <fcntl.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 ashmem_handle.release().value(), &scoped_platform_handle); | 183 ashmem_handle.release().value(), &scoped_platform_handle); |
184 DCHECK_EQ(mojo_result, MOJO_RESULT_OK); | 184 DCHECK_EQ(mojo_result, MOJO_RESULT_OK); |
185 | 185 |
186 auto fd = base::ScopedFD(scoped_platform_handle.release().handle); | 186 auto fd = base::ScopedFD(scoped_platform_handle.release().handle); |
187 accelerator_->BindSharedMemory(static_cast<PortType>(port), index, | 187 accelerator_->BindSharedMemory(static_cast<PortType>(port), index, |
188 std::move(fd), offset, length); | 188 std::move(fd), offset, length); |
189 } | 189 } |
190 | 190 |
191 void BindDmabuf(::arc::mojom::PortType port, | 191 void BindDmabuf(::arc::mojom::PortType port, |
192 uint32_t index, | 192 uint32_t index, |
193 mojo::ScopedHandle dmabuf_handle) override { | 193 mojo::ScopedHandle dmabuf_handle, |
| 194 int32_t stride) override { |
194 DVLOG(2) << "BindDmabuf port=" << port << ", index=" << index; | 195 DVLOG(2) << "BindDmabuf port=" << port << ", index=" << index; |
195 mojo::edk::ScopedPlatformHandle scoped_platform_handle; | 196 mojo::edk::ScopedPlatformHandle scoped_platform_handle; |
196 MojoResult mojo_result = mojo::edk::PassWrappedPlatformHandle( | 197 MojoResult mojo_result = mojo::edk::PassWrappedPlatformHandle( |
197 dmabuf_handle.release().value(), &scoped_platform_handle); | 198 dmabuf_handle.release().value(), &scoped_platform_handle); |
198 DCHECK_EQ(mojo_result, MOJO_RESULT_OK); | 199 DCHECK_EQ(mojo_result, MOJO_RESULT_OK); |
199 | 200 |
200 auto fd = base::ScopedFD(scoped_platform_handle.release().handle); | 201 auto fd = base::ScopedFD(scoped_platform_handle.release().handle); |
201 accelerator_->BindDmabuf(static_cast<PortType>(port), index, std::move(fd)); | 202 accelerator_->BindDmabuf(static_cast<PortType>(port), index, std::move(fd), |
| 203 stride); |
202 } | 204 } |
203 | 205 |
204 void UseBuffer(::arc::mojom::PortType port, | 206 void UseBuffer(::arc::mojom::PortType port, |
205 uint32_t index, | 207 uint32_t index, |
206 ::arc::mojom::BufferMetadataPtr metadata) override { | 208 ::arc::mojom::BufferMetadataPtr metadata) override { |
207 DVLOG(2) << "UseBuffer port=" << port << ", index=" << index; | 209 DVLOG(2) << "UseBuffer port=" << port << ", index=" << index; |
208 accelerator_->UseBuffer(static_cast<PortType>(port), index, | 210 accelerator_->UseBuffer(static_cast<PortType>(port), index, |
209 metadata.To<BufferMetadata>()); | 211 metadata.To<BufferMetadata>()); |
210 } | 212 } |
211 | 213 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 | 263 |
262 callback.Run(mojo::ScopedHandle(mojo::Handle(wrapped_handle)), token); | 264 callback.Run(mojo::ScopedHandle(mojo::Handle(wrapped_handle)), token); |
263 } | 265 } |
264 | 266 |
265 void GpuArcVideoService::RemoveClient(AcceleratorStub* stub) { | 267 void GpuArcVideoService::RemoveClient(AcceleratorStub* stub) { |
266 accelerator_stubs_.erase(stub); | 268 accelerator_stubs_.erase(stub); |
267 } | 269 } |
268 | 270 |
269 } // namespace arc | 271 } // namespace arc |
270 } // namespace chromeos | 272 } // namespace chromeos |
OLD | NEW |