IoctlGpfifoEntry now uses bit field

This commit is contained in:
David Marcec
2018-02-05 17:27:21 -08:00
parent 0b8635aeeb
commit e554cc0982
2 changed files with 8 additions and 5 deletions

View File

@@ -129,10 +129,7 @@ u32 nvhost_gpu::SubmitGPFIFO(const std::vector<u8>& input, std::vector<u8>& outp
entries.resize(params.num_entries);
std::memcpy(&entries[0], &input.data()[24], params.num_entries * 8);
for (auto entry : entries) {
u32 unk1 = (entry.entry1 >> 8) & 0x3;
u32 sz = (entry.entry1 >> 10) & 0x1fffff;
u32 unk2 = entry.entry1 >> 31;
u64 va_addr = entry.entry0 | ((entry.entry1 & 0xff) << 32);
u64 va_addr = (entry.gpu_va_hi << 32) | entry.entry0;
// TODO(ogniK): Process these
}
params.fence_out.id = 0;

View File

@@ -95,7 +95,13 @@ private:
struct IoctlGpfifoEntry {
u32_le entry0; // gpu_va_lo
u32_le entry1; // gpu_va_hi | (unk_0x02 << 0x08) | (size << 0x0A) | (unk_0x01 << 0x1F)
union {
u32_le entry1; // gpu_va_hi | (unk_0x02 << 0x08) | (size << 0x0A) | (unk_0x01 << 0x1F)
BitField<0, 8, u32> gpu_va_hi;
BitField<8, 2, u32> unk1;
BitField<10, 21, u32> sz;
BitField<31, 1, u32> unk2;
};
};
static_assert(sizeof(IoctlGpfifoEntry) == 8, "IoctlGpfifoEntry is incorrect size");