| 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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 ashmem_handle.release().value(), &scoped_platform_handle); | 180 ashmem_handle.release().value(), &scoped_platform_handle); |
| 181 DCHECK_EQ(mojo_result, MOJO_RESULT_OK); | 181 DCHECK_EQ(mojo_result, MOJO_RESULT_OK); |
| 182 | 182 |
| 183 auto fd = base::ScopedFD(scoped_platform_handle.release().handle); | 183 auto fd = base::ScopedFD(scoped_platform_handle.release().handle); |
| 184 accelerator_->BindSharedMemory(static_cast<PortType>(port), index, | 184 accelerator_->BindSharedMemory(static_cast<PortType>(port), index, |
| 185 std::move(fd), offset, length); | 185 std::move(fd), offset, length); |
| 186 } | 186 } |
| 187 | 187 |
| 188 void BindDmabuf(::arc::mojom::PortType port, | 188 void BindDmabuf(::arc::mojom::PortType port, |
| 189 uint32_t index, | 189 uint32_t index, |
| 190 mojo::ScopedHandle dmabuf_handle) override { | 190 mojo::ScopedHandle dmabuf_handle, |
| 191 int32_t stride) override { |
| 191 DVLOG(2) << "BindDmabuf port=" << port << ", index=" << index; | 192 DVLOG(2) << "BindDmabuf port=" << port << ", index=" << index; |
| 192 mojo::edk::ScopedPlatformHandle scoped_platform_handle; | 193 mojo::edk::ScopedPlatformHandle scoped_platform_handle; |
| 193 MojoResult mojo_result = mojo::edk::PassWrappedPlatformHandle( | 194 MojoResult mojo_result = mojo::edk::PassWrappedPlatformHandle( |
| 194 dmabuf_handle.release().value(), &scoped_platform_handle); | 195 dmabuf_handle.release().value(), &scoped_platform_handle); |
| 195 DCHECK_EQ(mojo_result, MOJO_RESULT_OK); | 196 DCHECK_EQ(mojo_result, MOJO_RESULT_OK); |
| 196 | 197 |
| 197 auto fd = base::ScopedFD(scoped_platform_handle.release().handle); | 198 auto fd = base::ScopedFD(scoped_platform_handle.release().handle); |
| 198 accelerator_->BindDmabuf(static_cast<PortType>(port), index, std::move(fd)); | 199 accelerator_->BindDmabuf(static_cast<PortType>(port), index, std::move(fd), |
| 200 stride); |
| 199 } | 201 } |
| 200 | 202 |
| 201 void UseBuffer(::arc::mojom::PortType port, | 203 void UseBuffer(::arc::mojom::PortType port, |
| 202 uint32_t index, | 204 uint32_t index, |
| 203 ::arc::mojom::BufferMetadataPtr metadata) override { | 205 ::arc::mojom::BufferMetadataPtr metadata) override { |
| 204 DVLOG(2) << "UseBuffer port=" << port << ", index=" << index; | 206 DVLOG(2) << "UseBuffer port=" << port << ", index=" << index; |
| 205 accelerator_->UseBuffer(static_cast<PortType>(port), index, | 207 accelerator_->UseBuffer(static_cast<PortType>(port), index, |
| 206 metadata.To<BufferMetadata>()); | 208 metadata.To<BufferMetadata>()); |
| 207 } | 209 } |
| 208 | 210 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 | 258 |
| 257 callback.Run(mojo::ScopedHandle(mojo::Handle(wrapped_handle)), token); | 259 callback.Run(mojo::ScopedHandle(mojo::Handle(wrapped_handle)), token); |
| 258 } | 260 } |
| 259 | 261 |
| 260 void GpuArcVideoService::RemoveClient(AcceleratorStub* stub) { | 262 void GpuArcVideoService::RemoveClient(AcceleratorStub* stub) { |
| 261 accelerator_stubs_.erase(stub); | 263 accelerator_stubs_.erase(stub); |
| 262 } | 264 } |
| 263 | 265 |
| 264 } // namespace arc | 266 } // namespace arc |
| 265 } // namespace chromeos | 267 } // namespace chromeos |
| OLD | NEW |