summaryrefslogtreecommitdiff
path: root/src/video_core/gpu.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/video_core/gpu.h')
-rw-r--r--src/video_core/gpu.h71
1 files changed, 71 insertions, 0 deletions
diff --git a/src/video_core/gpu.h b/src/video_core/gpu.h
index af5ccd1e9..fb8975811 100644
--- a/src/video_core/gpu.h
+++ b/src/video_core/gpu.h
@@ -156,6 +156,46 @@ public:
156 /// Returns a const reference to the GPU DMA pusher. 156 /// Returns a const reference to the GPU DMA pusher.
157 const Tegra::DmaPusher& DmaPusher() const; 157 const Tegra::DmaPusher& DmaPusher() const;
158 158
159 struct Regs {
160 static constexpr size_t NUM_REGS = 0x100;
161
162 union {
163 struct {
164 INSERT_PADDING_WORDS(0x4);
165 struct {
166 u32 address_high;
167 u32 address_low;
168
169 GPUVAddr SmaphoreAddress() const {
170 return static_cast<GPUVAddr>((static_cast<GPUVAddr>(address_high) << 32) |
171 address_low);
172 }
173 } smaphore_address;
174
175 u32 semaphore_sequence;
176 u32 semaphore_trigger;
177 INSERT_PADDING_WORDS(0xC);
178
179 // The puser and the puller share the reference counter, the pusher only has read
180 // access
181 u32 reference_count;
182 INSERT_PADDING_WORDS(0x5);
183
184 u32 semaphore_acquire;
185 u32 semaphore_release;
186 INSERT_PADDING_WORDS(0xE4);
187
188 // Puller state
189 u32 acquire_mode;
190 u32 acquire_source;
191 u32 acquire_active;
192 u32 acquire_timeout;
193 u32 acquire_value;
194 };
195 std::array<u32, NUM_REGS> reg_array;
196 };
197 } regs{};
198
159private: 199private:
160 std::unique_ptr<Tegra::DmaPusher> dma_pusher; 200 std::unique_ptr<Tegra::DmaPusher> dma_pusher;
161 std::unique_ptr<Tegra::MemoryManager> memory_manager; 201 std::unique_ptr<Tegra::MemoryManager> memory_manager;
@@ -173,6 +213,37 @@ private:
173 std::unique_ptr<Engines::MaxwellDMA> maxwell_dma; 213 std::unique_ptr<Engines::MaxwellDMA> maxwell_dma;
174 /// Inline memory engine 214 /// Inline memory engine
175 std::unique_ptr<Engines::KeplerMemory> kepler_memory; 215 std::unique_ptr<Engines::KeplerMemory> kepler_memory;
216
217 void ProcessBindMethod(const MethodCall& method_call);
218 void ProcessSemaphoreTriggerMethod();
219 void ProcessSemaphoreRelease();
220 void ProcessSemaphoreAcquire();
221
222 // Calls a GPU puller method.
223 void CallPullerMethod(const MethodCall& method_call);
224 // Calls a GPU engine method.
225 void CallEngineMethod(const MethodCall& method_call);
226 // Determines where the method should be executed.
227 bool ExecuteMethodOnEngine(const MethodCall& method_call);
176}; 228};
177 229
230#define ASSERT_REG_POSITION(field_name, position) \
231 static_assert(offsetof(GPU::Regs, field_name) == position * 4, \
232 "Field " #field_name " has invalid position")
233
234ASSERT_REG_POSITION(smaphore_address, 0x4);
235ASSERT_REG_POSITION(semaphore_sequence, 0x6);
236ASSERT_REG_POSITION(semaphore_trigger, 0x7);
237ASSERT_REG_POSITION(reference_count, 0x14);
238ASSERT_REG_POSITION(semaphore_acquire, 0x1A);
239ASSERT_REG_POSITION(semaphore_release, 0x1B);
240
241ASSERT_REG_POSITION(acquire_mode, 0x100);
242ASSERT_REG_POSITION(acquire_source, 0x101);
243ASSERT_REG_POSITION(acquire_active, 0x102);
244ASSERT_REG_POSITION(acquire_timeout, 0x103);
245ASSERT_REG_POSITION(acquire_value, 0x104);
246
247#undef ASSERT_REG_POSITION
248
178} // namespace Tegra 249} // namespace Tegra