Browse Source

handle better disconnect

pull/120/head
Maufeat 8 months ago
committed by crueter
parent
commit
a2b0b7e801
  1. 14
      src/core/hle/service/nvnflinger/buffer_queue_producer.cpp
  2. 2
      src/core/hle/service/nvnflinger/hos_binder_driver.cpp

14
src/core/hle/service/nvnflinger/buffer_queue_producer.cpp

@ -744,6 +744,17 @@ Status BufferQueueProducer::Disconnect(NativeWindowApi api) {
return Status::NoError; return Status::NoError;
} }
if (core->connected_api == NativeWindowApi::NoConnectedApi) {
LOG_DEBUG(Service_Nvnflinger, "already disconnected (req = {})", api);
return Status::NoError;
}
if (core->connected_api != api) {
LOG_WARNING(Service_Nvnflinger,
"Disconnect api mismatch (cur = {} req = {}) — forcing disconnect",
core->connected_api, api);
}
switch (api) { switch (api) {
case NativeWindowApi::Egl: case NativeWindowApi::Egl:
case NativeWindowApi::Cpu: case NativeWindowApi::Cpu:
@ -770,8 +781,7 @@ Status BufferQueueProducer::Disconnect(NativeWindowApi api) {
} }
} }
// Call back without lock held
if (listener != nullptr) {
if (listener) {
listener->OnBuffersReleased(); listener->OnBuffersReleased();
} }

2
src/core/hle/service/nvnflinger/hos_binder_driver.cpp

@ -40,7 +40,7 @@ Result IHOSBinderDriver::TransactParcel(s32 binder_id, u32 transaction_id,
} }
Result IHOSBinderDriver::AdjustRefcount(s32 binder_id, s32 addval, s32 type) { Result IHOSBinderDriver::AdjustRefcount(s32 binder_id, s32 addval, s32 type) {
LOG_WARNING(Service_VI, "(STUBBED) called id={}, addval={}, type={}", binder_id, addval, type);
LOG_DEBUG(Service_VI, "called id={}, addval={}, type={}", binder_id, addval, type);
R_UNLESS(type == 0 || type == 1, ResultUnknown); R_UNLESS(type == 0 || type == 1, ResultUnknown);
m_server->AdjustRefcount(binder_id, addval, type == 1); m_server->AdjustRefcount(binder_id, addval, type == 1);
R_SUCCEED(); R_SUCCEED();

Loading…
Cancel
Save