diff options
| author | 2022-01-30 22:26:01 +0100 | |
|---|---|---|
| committer | 2022-10-06 21:00:52 +0200 | |
| commit | 2931101e6f5aa755566ef40f6e6dc71909fd3e92 (patch) | |
| tree | 76e847786e355e24a136562d42177b895a03315e /src/video_core/host1x/vic.cpp | |
| parent | VideoCore: Refactor syncing. (diff) | |
| download | yuzu-2931101e6f5aa755566ef40f6e6dc71909fd3e92.tar.gz yuzu-2931101e6f5aa755566ef40f6e6dc71909fd3e92.tar.xz yuzu-2931101e6f5aa755566ef40f6e6dc71909fd3e92.zip | |
NVDRV: Refactor Host1x
Diffstat (limited to 'src/video_core/host1x/vic.cpp')
| -rw-r--r-- | src/video_core/host1x/vic.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/video_core/host1x/vic.cpp b/src/video_core/host1x/vic.cpp index a9422670a..5d8039841 100644 --- a/src/video_core/host1x/vic.cpp +++ b/src/video_core/host1x/vic.cpp | |||
| @@ -19,7 +19,7 @@ extern "C" { | |||
| 19 | #include "common/logging/log.h" | 19 | #include "common/logging/log.h" |
| 20 | 20 | ||
| 21 | #include "video_core/engines/maxwell_3d.h" | 21 | #include "video_core/engines/maxwell_3d.h" |
| 22 | #include "video_core/gpu.h" | 22 | #include "video_core/host1x/host1x.h" |
| 23 | #include "video_core/host1x/nvdec.h" | 23 | #include "video_core/host1x/nvdec.h" |
| 24 | #include "video_core/host1x/vic.h" | 24 | #include "video_core/host1x/vic.h" |
| 25 | #include "video_core/memory_manager.h" | 25 | #include "video_core/memory_manager.h" |
| @@ -49,8 +49,8 @@ union VicConfig { | |||
| 49 | BitField<46, 14, u64_le> surface_height_minus1; | 49 | BitField<46, 14, u64_le> surface_height_minus1; |
| 50 | }; | 50 | }; |
| 51 | 51 | ||
| 52 | Vic::Vic(GPU& gpu_, std::shared_ptr<Nvdec> nvdec_processor_) | 52 | Vic::Vic(Host1x& host1x_, std::shared_ptr<Nvdec> nvdec_processor_) |
| 53 | : gpu(gpu_), | 53 | : host1x(host1x_), |
| 54 | nvdec_processor(std::move(nvdec_processor_)), converted_frame_buffer{nullptr, av_free} {} | 54 | nvdec_processor(std::move(nvdec_processor_)), converted_frame_buffer{nullptr, av_free} {} |
| 55 | 55 | ||
| 56 | Vic::~Vic() = default; | 56 | Vic::~Vic() = default; |
| @@ -81,7 +81,7 @@ void Vic::Execute() { | |||
| 81 | LOG_ERROR(Service_NVDRV, "VIC Luma address not set."); | 81 | LOG_ERROR(Service_NVDRV, "VIC Luma address not set."); |
| 82 | return; | 82 | return; |
| 83 | } | 83 | } |
| 84 | const VicConfig config{gpu.MemoryManager().Read<u64>(config_struct_address + 0x20)}; | 84 | const VicConfig config{host1x.MemoryManager().Read<u64>(config_struct_address + 0x20)}; |
| 85 | const AVFramePtr frame_ptr = nvdec_processor->GetFrame(); | 85 | const AVFramePtr frame_ptr = nvdec_processor->GetFrame(); |
| 86 | const auto* frame = frame_ptr.get(); | 86 | const auto* frame = frame_ptr.get(); |
| 87 | if (!frame) { | 87 | if (!frame) { |
| @@ -159,12 +159,12 @@ void Vic::WriteRGBFrame(const AVFrame* frame, const VicConfig& config) { | |||
| 159 | Texture::SwizzleSubrect(width, height, width * 4, width, 4, luma_buffer.data(), | 159 | Texture::SwizzleSubrect(width, height, width * 4, width, 4, luma_buffer.data(), |
| 160 | converted_frame_buf_addr, block_height, 0, 0); | 160 | converted_frame_buf_addr, block_height, 0, 0); |
| 161 | 161 | ||
| 162 | gpu.MemoryManager().WriteBlock(output_surface_luma_address, luma_buffer.data(), size); | 162 | host1x.MemoryManager().WriteBlock(output_surface_luma_address, luma_buffer.data(), size); |
| 163 | } else { | 163 | } else { |
| 164 | // send pitch linear frame | 164 | // send pitch linear frame |
| 165 | const size_t linear_size = width * height * 4; | 165 | const size_t linear_size = width * height * 4; |
| 166 | gpu.MemoryManager().WriteBlock(output_surface_luma_address, converted_frame_buf_addr, | 166 | host1x.MemoryManager().WriteBlock(output_surface_luma_address, converted_frame_buf_addr, |
| 167 | linear_size); | 167 | linear_size); |
| 168 | } | 168 | } |
| 169 | } | 169 | } |
| 170 | 170 | ||
| @@ -192,8 +192,8 @@ void Vic::WriteYUVFrame(const AVFrame* frame, const VicConfig& config) { | |||
| 192 | luma_buffer[dst + x] = luma_src[src + x]; | 192 | luma_buffer[dst + x] = luma_src[src + x]; |
| 193 | } | 193 | } |
| 194 | } | 194 | } |
| 195 | gpu.MemoryManager().WriteBlock(output_surface_luma_address, luma_buffer.data(), | 195 | host1x.MemoryManager().WriteBlock(output_surface_luma_address, luma_buffer.data(), |
| 196 | luma_buffer.size()); | 196 | luma_buffer.size()); |
| 197 | 197 | ||
| 198 | // Chroma | 198 | // Chroma |
| 199 | const std::size_t half_height = frame_height / 2; | 199 | const std::size_t half_height = frame_height / 2; |
| @@ -234,8 +234,8 @@ void Vic::WriteYUVFrame(const AVFrame* frame, const VicConfig& config) { | |||
| 234 | ASSERT(false); | 234 | ASSERT(false); |
| 235 | break; | 235 | break; |
| 236 | } | 236 | } |
| 237 | gpu.MemoryManager().WriteBlock(output_surface_chroma_address, chroma_buffer.data(), | 237 | host1x.MemoryManager().WriteBlock(output_surface_chroma_address, chroma_buffer.data(), |
| 238 | chroma_buffer.size()); | 238 | chroma_buffer.size()); |
| 239 | } | 239 | } |
| 240 | 240 | ||
| 241 | } // namespace Host1x | 241 | } // namespace Host1x |