diff options
| author | 2020-11-23 15:01:40 -0500 | |
|---|---|---|
| committer | 2021-02-13 13:07:53 -0500 | |
| commit | 77564f987cc52ea6d841e7d18ade2646783f3651 (patch) | |
| tree | 6c21f3c58453d3af5fba62b1fa59266d1149c180 /src/video_core/command_classes | |
| parent | nvdec cleanup (diff) | |
| download | yuzu-77564f987cc52ea6d841e7d18ade2646783f3651.tar.gz yuzu-77564f987cc52ea6d841e7d18ade2646783f3651.tar.xz yuzu-77564f987cc52ea6d841e7d18ade2646783f3651.zip | |
streamline cdma_pusher/command_classes
Diffstat (limited to 'src/video_core/command_classes')
| -rw-r--r-- | src/video_core/command_classes/nvdec.cpp | 8 | ||||
| -rw-r--r-- | src/video_core/command_classes/nvdec.h | 2 | ||||
| -rw-r--r-- | src/video_core/command_classes/vic.h | 44 |
3 files changed, 6 insertions, 48 deletions
diff --git a/src/video_core/command_classes/nvdec.cpp b/src/video_core/command_classes/nvdec.cpp index 79e1f4e13..e4f919afd 100644 --- a/src/video_core/command_classes/nvdec.cpp +++ b/src/video_core/command_classes/nvdec.cpp | |||
| @@ -12,16 +12,16 @@ Nvdec::Nvdec(GPU& gpu_) : gpu(gpu_), codec(std::make_unique<Codec>(gpu)) {} | |||
| 12 | 12 | ||
| 13 | Nvdec::~Nvdec() = default; | 13 | Nvdec::~Nvdec() = default; |
| 14 | 14 | ||
| 15 | void Nvdec::ProcessMethod(Method method, const std::vector<u32>& arguments) { | 15 | void Nvdec::ProcessMethod(Method method, u32 argument) { |
| 16 | if (method == Method::SetVideoCodec) { | 16 | if (method == Method::SetVideoCodec) { |
| 17 | codec->StateWrite(static_cast<u32>(method), arguments[0]); | 17 | codec->StateWrite(static_cast<u32>(method), argument); |
| 18 | } else { | 18 | } else { |
| 19 | codec->StateWrite(static_cast<u32>(method), static_cast<u64>(arguments[0]) << 8); | 19 | codec->StateWrite(static_cast<u32>(method), static_cast<u64>(argument) << 8); |
| 20 | } | 20 | } |
| 21 | 21 | ||
| 22 | switch (method) { | 22 | switch (method) { |
| 23 | case Method::SetVideoCodec: | 23 | case Method::SetVideoCodec: |
| 24 | codec->SetTargetCodec(static_cast<NvdecCommon::VideoCodec>(arguments[0])); | 24 | codec->SetTargetCodec(static_cast<NvdecCommon::VideoCodec>(argument)); |
| 25 | break; | 25 | break; |
| 26 | case Method::Execute: | 26 | case Method::Execute: |
| 27 | Execute(); | 27 | Execute(); |
diff --git a/src/video_core/command_classes/nvdec.h b/src/video_core/command_classes/nvdec.h index e4877c533..e66be80b8 100644 --- a/src/video_core/command_classes/nvdec.h +++ b/src/video_core/command_classes/nvdec.h | |||
| @@ -23,7 +23,7 @@ public: | |||
| 23 | ~Nvdec(); | 23 | ~Nvdec(); |
| 24 | 24 | ||
| 25 | /// Writes the method into the state, Invoke Execute() if encountered | 25 | /// Writes the method into the state, Invoke Execute() if encountered |
| 26 | void ProcessMethod(Method method, const std::vector<u32>& arguments); | 26 | void ProcessMethod(Method method, u32 argument); |
| 27 | 27 | ||
| 28 | /// Return most recently decoded frame | 28 | /// Return most recently decoded frame |
| 29 | [[nodiscard]] AVFramePtr GetFrame(); | 29 | [[nodiscard]] AVFramePtr GetFrame(); |
diff --git a/src/video_core/command_classes/vic.h b/src/video_core/command_classes/vic.h index 6eaf72f21..f5a2ed100 100644 --- a/src/video_core/command_classes/vic.h +++ b/src/video_core/command_classes/vic.h | |||
| @@ -15,43 +15,6 @@ namespace Tegra { | |||
| 15 | class GPU; | 15 | class GPU; |
| 16 | class Nvdec; | 16 | class Nvdec; |
| 17 | 17 | ||
| 18 | struct PlaneOffsets { | ||
| 19 | u32 luma_offset{}; | ||
| 20 | u32 chroma_u_offset{}; | ||
| 21 | u32 chroma_v_offset{}; | ||
| 22 | }; | ||
| 23 | |||
| 24 | struct VicRegisters { | ||
| 25 | INSERT_PADDING_WORDS(64); | ||
| 26 | u32 nop{}; | ||
| 27 | INSERT_PADDING_WORDS(15); | ||
| 28 | u32 pm_trigger{}; | ||
| 29 | INSERT_PADDING_WORDS(47); | ||
| 30 | u32 set_application_id{}; | ||
| 31 | u32 set_watchdog_timer{}; | ||
| 32 | INSERT_PADDING_WORDS(17); | ||
| 33 | u32 context_save_area{}; | ||
| 34 | u32 context_switch{}; | ||
| 35 | INSERT_PADDING_WORDS(43); | ||
| 36 | u32 execute{}; | ||
| 37 | INSERT_PADDING_WORDS(63); | ||
| 38 | std::array<std::array<PlaneOffsets, 8>, 8> surfacex_slots{}; | ||
| 39 | u32 picture_index{}; | ||
| 40 | u32 control_params{}; | ||
| 41 | u32 config_struct_offset{}; | ||
| 42 | u32 filter_struct_offset{}; | ||
| 43 | u32 palette_offset{}; | ||
| 44 | u32 hist_offset{}; | ||
| 45 | u32 context_id{}; | ||
| 46 | u32 fce_ucode_size{}; | ||
| 47 | PlaneOffsets output_surface{}; | ||
| 48 | u32 fce_ucode_offset{}; | ||
| 49 | INSERT_PADDING_WORDS(4); | ||
| 50 | std::array<u32, 8> slot_context_id{}; | ||
| 51 | INSERT_PADDING_WORDS(16); | ||
| 52 | }; | ||
| 53 | static_assert(sizeof(VicRegisters) == 0x7A0, "VicRegisters is an invalid size"); | ||
| 54 | |||
| 55 | class Vic { | 18 | class Vic { |
| 56 | public: | 19 | public: |
| 57 | enum class Method : u32 { | 20 | enum class Method : u32 { |
| @@ -67,14 +30,11 @@ public: | |||
| 67 | ~Vic(); | 30 | ~Vic(); |
| 68 | 31 | ||
| 69 | /// Write to the device state. | 32 | /// Write to the device state. |
| 70 | void ProcessMethod(Method method, const std::vector<u32>& arguments); | 33 | void ProcessMethod(Method method, u32 argument); |
| 71 | 34 | ||
| 72 | private: | 35 | private: |
| 73 | void Execute(); | 36 | void Execute(); |
| 74 | 37 | ||
| 75 | void VicStateWrite(u32 offset, u32 arguments); | ||
| 76 | VicRegisters vic_state{}; | ||
| 77 | |||
| 78 | enum class VideoPixelFormat : u64_le { | 38 | enum class VideoPixelFormat : u64_le { |
| 79 | RGBA8 = 0x1f, | 39 | RGBA8 = 0x1f, |
| 80 | BGRA8 = 0x20, | 40 | BGRA8 = 0x20, |
| @@ -88,8 +48,6 @@ private: | |||
| 88 | BitField<9, 2, u64_le> chroma_loc_vert; | 48 | BitField<9, 2, u64_le> chroma_loc_vert; |
| 89 | BitField<11, 4, u64_le> block_linear_kind; | 49 | BitField<11, 4, u64_le> block_linear_kind; |
| 90 | BitField<15, 4, u64_le> block_linear_height_log2; | 50 | BitField<15, 4, u64_le> block_linear_height_log2; |
| 91 | BitField<19, 3, u64_le> reserved0; | ||
| 92 | BitField<22, 10, u64_le> reserved1; | ||
| 93 | BitField<32, 14, u64_le> surface_width_minus1; | 51 | BitField<32, 14, u64_le> surface_width_minus1; |
| 94 | BitField<46, 14, u64_le> surface_height_minus1; | 52 | BitField<46, 14, u64_le> surface_height_minus1; |
| 95 | }; | 53 | }; |