diff options
| author | 2023-12-29 09:50:04 +0100 | |
|---|---|---|
| committer | 2024-01-18 21:12:30 -0500 | |
| commit | 96fd1348aea9d70cb502a94cbd0412be6edb0189 (patch) | |
| tree | b264d2437dd4fda8c8257566bb5a5d8eb096131a /src/video_core/host1x/codecs | |
| parent | SMMU: Fix Unregister on MultiAddress (diff) | |
| download | yuzu-96fd1348aea9d70cb502a94cbd0412be6edb0189.tar.gz yuzu-96fd1348aea9d70cb502a94cbd0412be6edb0189.tar.xz yuzu-96fd1348aea9d70cb502a94cbd0412be6edb0189.zip | |
GPU SMMU: Expand to 34 bits
Diffstat (limited to 'src/video_core/host1x/codecs')
| -rw-r--r-- | src/video_core/host1x/codecs/h264.cpp | 9 | ||||
| -rw-r--r-- | src/video_core/host1x/codecs/vp8.cpp | 4 | ||||
| -rw-r--r-- | src/video_core/host1x/codecs/vp9.cpp | 6 |
3 files changed, 9 insertions, 10 deletions
diff --git a/src/video_core/host1x/codecs/h264.cpp b/src/video_core/host1x/codecs/h264.cpp index 309a7f1d5..994591c8d 100644 --- a/src/video_core/host1x/codecs/h264.cpp +++ b/src/video_core/host1x/codecs/h264.cpp | |||
| @@ -32,13 +32,12 @@ H264::~H264() = default; | |||
| 32 | std::span<const u8> H264::ComposeFrame(const Host1x::NvdecCommon::NvdecRegisters& state, | 32 | std::span<const u8> H264::ComposeFrame(const Host1x::NvdecCommon::NvdecRegisters& state, |
| 33 | size_t* out_configuration_size, bool is_first_frame) { | 33 | size_t* out_configuration_size, bool is_first_frame) { |
| 34 | H264DecoderContext context; | 34 | H264DecoderContext context; |
| 35 | host1x.MemoryManager().ReadBlock(state.picture_info_offset, &context, | 35 | host1x.GMMU().ReadBlock(state.picture_info_offset, &context, sizeof(H264DecoderContext)); |
| 36 | sizeof(H264DecoderContext)); | ||
| 37 | 36 | ||
| 38 | const s64 frame_number = context.h264_parameter_set.frame_number.Value(); | 37 | const s64 frame_number = context.h264_parameter_set.frame_number.Value(); |
| 39 | if (!is_first_frame && frame_number != 0) { | 38 | if (!is_first_frame && frame_number != 0) { |
| 40 | frame.resize_destructive(context.stream_len); | 39 | frame.resize_destructive(context.stream_len); |
| 41 | host1x.MemoryManager().ReadBlock(state.frame_bitstream_offset, frame.data(), frame.size()); | 40 | host1x.GMMU().ReadBlock(state.frame_bitstream_offset, frame.data(), frame.size()); |
| 42 | *out_configuration_size = 0; | 41 | *out_configuration_size = 0; |
| 43 | return frame; | 42 | return frame; |
| 44 | } | 43 | } |
| @@ -159,8 +158,8 @@ std::span<const u8> H264::ComposeFrame(const Host1x::NvdecCommon::NvdecRegisters | |||
| 159 | std::memcpy(frame.data(), encoded_header.data(), encoded_header.size()); | 158 | std::memcpy(frame.data(), encoded_header.data(), encoded_header.size()); |
| 160 | 159 | ||
| 161 | *out_configuration_size = encoded_header.size(); | 160 | *out_configuration_size = encoded_header.size(); |
| 162 | host1x.MemoryManager().ReadBlock(state.frame_bitstream_offset, | 161 | host1x.GMMU().ReadBlock(state.frame_bitstream_offset, frame.data() + encoded_header.size(), |
| 163 | frame.data() + encoded_header.size(), context.stream_len); | 162 | context.stream_len); |
| 164 | 163 | ||
| 165 | return frame; | 164 | return frame; |
| 166 | } | 165 | } |
diff --git a/src/video_core/host1x/codecs/vp8.cpp b/src/video_core/host1x/codecs/vp8.cpp index ee6392ff9..be97e3b00 100644 --- a/src/video_core/host1x/codecs/vp8.cpp +++ b/src/video_core/host1x/codecs/vp8.cpp | |||
| @@ -14,7 +14,7 @@ VP8::~VP8() = default; | |||
| 14 | 14 | ||
| 15 | std::span<const u8> VP8::ComposeFrame(const Host1x::NvdecCommon::NvdecRegisters& state) { | 15 | std::span<const u8> VP8::ComposeFrame(const Host1x::NvdecCommon::NvdecRegisters& state) { |
| 16 | VP8PictureInfo info; | 16 | VP8PictureInfo info; |
| 17 | host1x.MemoryManager().ReadBlock(state.picture_info_offset, &info, sizeof(VP8PictureInfo)); | 17 | host1x.GMMU().ReadBlock(state.picture_info_offset, &info, sizeof(VP8PictureInfo)); |
| 18 | 18 | ||
| 19 | const bool is_key_frame = info.key_frame == 1u; | 19 | const bool is_key_frame = info.key_frame == 1u; |
| 20 | const auto bitstream_size = static_cast<size_t>(info.vld_buffer_size); | 20 | const auto bitstream_size = static_cast<size_t>(info.vld_buffer_size); |
| @@ -45,7 +45,7 @@ std::span<const u8> VP8::ComposeFrame(const Host1x::NvdecCommon::NvdecRegisters& | |||
| 45 | frame[9] = static_cast<u8>(((info.frame_height >> 8) & 0x3f)); | 45 | frame[9] = static_cast<u8>(((info.frame_height >> 8) & 0x3f)); |
| 46 | } | 46 | } |
| 47 | const u64 bitstream_offset = state.frame_bitstream_offset; | 47 | const u64 bitstream_offset = state.frame_bitstream_offset; |
| 48 | host1x.MemoryManager().ReadBlock(bitstream_offset, frame.data() + header_size, bitstream_size); | 48 | host1x.GMMU().ReadBlock(bitstream_offset, frame.data() + header_size, bitstream_size); |
| 49 | 49 | ||
| 50 | return frame; | 50 | return frame; |
| 51 | } | 51 | } |
diff --git a/src/video_core/host1x/codecs/vp9.cpp b/src/video_core/host1x/codecs/vp9.cpp index 306c3d0e8..e2ae1f76d 100644 --- a/src/video_core/host1x/codecs/vp9.cpp +++ b/src/video_core/host1x/codecs/vp9.cpp | |||
| @@ -358,7 +358,7 @@ void VP9::WriteMvProbabilityUpdate(VpxRangeEncoder& writer, u8 new_prob, u8 old_ | |||
| 358 | 358 | ||
| 359 | Vp9PictureInfo VP9::GetVp9PictureInfo(const Host1x::NvdecCommon::NvdecRegisters& state) { | 359 | Vp9PictureInfo VP9::GetVp9PictureInfo(const Host1x::NvdecCommon::NvdecRegisters& state) { |
| 360 | PictureInfo picture_info; | 360 | PictureInfo picture_info; |
| 361 | host1x.MemoryManager().ReadBlock(state.picture_info_offset, &picture_info, sizeof(PictureInfo)); | 361 | host1x.GMMU().ReadBlock(state.picture_info_offset, &picture_info, sizeof(PictureInfo)); |
| 362 | Vp9PictureInfo vp9_info = picture_info.Convert(); | 362 | Vp9PictureInfo vp9_info = picture_info.Convert(); |
| 363 | 363 | ||
| 364 | InsertEntropy(state.vp9_entropy_probs_offset, vp9_info.entropy); | 364 | InsertEntropy(state.vp9_entropy_probs_offset, vp9_info.entropy); |
| @@ -373,7 +373,7 @@ Vp9PictureInfo VP9::GetVp9PictureInfo(const Host1x::NvdecCommon::NvdecRegisters& | |||
| 373 | 373 | ||
| 374 | void VP9::InsertEntropy(u64 offset, Vp9EntropyProbs& dst) { | 374 | void VP9::InsertEntropy(u64 offset, Vp9EntropyProbs& dst) { |
| 375 | EntropyProbs entropy; | 375 | EntropyProbs entropy; |
| 376 | host1x.MemoryManager().ReadBlock(offset, &entropy, sizeof(EntropyProbs)); | 376 | host1x.GMMU().ReadBlock(offset, &entropy, sizeof(EntropyProbs)); |
| 377 | entropy.Convert(dst); | 377 | entropy.Convert(dst); |
| 378 | } | 378 | } |
| 379 | 379 | ||
| @@ -383,7 +383,7 @@ Vp9FrameContainer VP9::GetCurrentFrame(const Host1x::NvdecCommon::NvdecRegisters | |||
| 383 | // gpu.SyncGuestHost(); epic, why? | 383 | // gpu.SyncGuestHost(); epic, why? |
| 384 | current_frame.info = GetVp9PictureInfo(state); | 384 | current_frame.info = GetVp9PictureInfo(state); |
| 385 | current_frame.bit_stream.resize(current_frame.info.bitstream_size); | 385 | current_frame.bit_stream.resize(current_frame.info.bitstream_size); |
| 386 | host1x.MemoryManager().ReadBlock(state.frame_bitstream_offset, | 386 | host1x.GMMU().ReadBlock(state.frame_bitstream_offset, |
| 387 | current_frame.bit_stream.data(), | 387 | current_frame.bit_stream.data(), |
| 388 | current_frame.info.bitstream_size); | 388 | current_frame.info.bitstream_size); |
| 389 | } | 389 | } |