cdma_pusher: Remove unnecessary intermediate std::vector in Step()
We can use the underlying raw u32 instead of copying all command headers to another vector as u32s before using them.
This commit is contained in:
@@ -52,10 +52,9 @@ void CDmaPusher::Step() {
|
|||||||
const auto entries{cdma_queue.front()};
|
const auto entries{cdma_queue.front()};
|
||||||
cdma_queue.pop();
|
cdma_queue.pop();
|
||||||
|
|
||||||
std::vector<u32> values(entries.size());
|
for (const auto entry : entries) {
|
||||||
std::memcpy(values.data(), entries.data(), entries.size() * sizeof(u32));
|
const u32 value = entry.raw;
|
||||||
|
|
||||||
for (const u32 value : values) {
|
|
||||||
if (mask != 0) {
|
if (mask != 0) {
|
||||||
const u32 lbs = Common::CountTrailingZeroes32(mask);
|
const u32 lbs = Common::CountTrailingZeroes32(mask);
|
||||||
mask &= ~(1U << lbs);
|
mask &= ~(1U << lbs);
|
||||||
@@ -72,7 +71,7 @@ void CDmaPusher::Step() {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto mode = static_cast<ChSubmissionMode>((value >> 28) & 0xf);
|
const auto mode = entry.submission_mode.Value();
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case ChSubmissionMode::SetClass: {
|
case ChSubmissionMode::SetClass: {
|
||||||
mask = value & 0x3f;
|
mask = value & 0x3f;
|
||||||
|
|||||||
@@ -67,8 +67,8 @@ struct ChCommand {
|
|||||||
std::vector<u32> arguments;
|
std::vector<u32> arguments;
|
||||||
};
|
};
|
||||||
|
|
||||||
using ChCommandHeaderList = std::vector<Tegra::ChCommandHeader>;
|
using ChCommandHeaderList = std::vector<ChCommandHeader>;
|
||||||
using ChCommandList = std::vector<Tegra::ChCommand>;
|
using ChCommandList = std::vector<ChCommand>;
|
||||||
|
|
||||||
struct ThiRegisters {
|
struct ThiRegisters {
|
||||||
u32_le increment_syncpt{};
|
u32_le increment_syncpt{};
|
||||||
|
|||||||
Reference in New Issue
Block a user