mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-07-20 09:25:45 +00:00
Compare commits
4 commits
7cf2b860b4
...
843d6fcbfe
Author | SHA1 | Date | |
---|---|---|---|
|
843d6fcbfe | ||
|
dd11abfdbb | ||
|
f248e6f721 | ||
|
83ec5869d7 |
3 changed files with 19 additions and 10 deletions
|
@ -92,7 +92,7 @@ private:
|
|||
bool is_allocating{};
|
||||
mutable std::condition_variable_any is_allocating_condition;
|
||||
|
||||
std::vector<BufferInfo> history;
|
||||
std::vector<BufferInfo> history{8};
|
||||
};
|
||||
|
||||
} // namespace Service::android
|
||||
|
|
|
@ -512,7 +512,7 @@ Status BufferQueueProducer::QueueBuffer(s32 slot, const QueueBufferInput& input,
|
|||
slots[slot].buffer_state = BufferState::Queued;
|
||||
++core->frame_counter;
|
||||
slots[slot].frame_number = core->frame_counter;
|
||||
slots[slot].queue_time = 0;
|
||||
slots[slot].queue_time = timestamp;
|
||||
slots[slot].presentation_time = 0;
|
||||
|
||||
item.acquire_called = slots[slot].acquire_called;
|
||||
|
@ -530,11 +530,9 @@ Status BufferQueueProducer::QueueBuffer(s32 slot, const QueueBufferInput& input,
|
|||
item.is_droppable = core->dequeue_buffer_cannot_block || async;
|
||||
item.swap_interval = swap_interval;
|
||||
|
||||
// TODO: .queue_time should be changed to the correct value
|
||||
position = (position + 1) % 8;
|
||||
LOG_WARNING(Service_Nvnflinger, "position={}", position);
|
||||
core->history[position] = {.frame_number = core->frame_counter,
|
||||
.queue_time = timestamp,
|
||||
.queue_time = slots[slot].queue_time,
|
||||
.state = BufferState::Queued};
|
||||
|
||||
sticky_transform = sticky_transform_;
|
||||
|
@ -936,13 +934,20 @@ void BufferQueueProducer::Transact(u32 code, std::span<const u8> parcel_data,
|
|||
break;
|
||||
}
|
||||
case TransactionId::GetBufferHistory: {
|
||||
LOG_WARNING(Service_Nvnflinger, "(STUBBED) called");
|
||||
LOG_WARNING(Service_Nvnflinger, "called, transaction=GetBufferHistory");
|
||||
|
||||
std::scoped_lock lock{core->mutex};
|
||||
|
||||
auto buffer_history_count = std::min(parcel_in.Read<s32>(), (s32)core->history.size());
|
||||
|
||||
BufferInfo* info = new BufferInfo[buffer_history_count];
|
||||
if (buffer_history_count <= 0) {
|
||||
parcel_out.Write(Status::BadValue);
|
||||
parcel_out.Write<s32>(0);
|
||||
status = Status::None;
|
||||
break;
|
||||
}
|
||||
|
||||
auto info = new BufferInfo[buffer_history_count];
|
||||
auto pos = position;
|
||||
for (int i = 0; i < buffer_history_count; i++) {
|
||||
info[i] = core->history[(pos - i) % core->history.size()];
|
||||
|
@ -952,8 +957,10 @@ void BufferQueueProducer::Transact(u32 code, std::span<const u8> parcel_data,
|
|||
pos--;
|
||||
}
|
||||
|
||||
parcel_out.Write(Status::NoError);
|
||||
parcel_out.Write(buffer_history_count);
|
||||
parcel_out.WriteFlattenedObject<BufferInfo>(info);
|
||||
status = Status::NoError;
|
||||
status = Status::None;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
@ -961,7 +968,9 @@ void BufferQueueProducer::Transact(u32 code, std::span<const u8> parcel_data,
|
|||
break;
|
||||
}
|
||||
|
||||
if (status != Status::None) {
|
||||
parcel_out.Write(status);
|
||||
}
|
||||
|
||||
const auto serialized = parcel_out.Serialize();
|
||||
std::memcpy(parcel_reply.data(), serialized.data(),
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace Service::android {
|
|||
|
||||
class GraphicBuffer;
|
||||
|
||||
enum class BufferState : u32 {
|
||||
enum class BufferState : s32 {
|
||||
Free = 0,
|
||||
Dequeued = 1,
|
||||
Queued = 2,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue