mirror of
https://github.com/yuzu-emu/yuzu-android.git
synced 2025-06-18 21:37:59 -05:00
vi: check layer state before opening or closing
This commit is contained in:
@ -719,7 +719,12 @@ private:
|
||||
return;
|
||||
}
|
||||
|
||||
nvnflinger.OpenLayer(layer_id);
|
||||
if (!nvnflinger.OpenLayer(layer_id)) {
|
||||
LOG_WARNING(Service_VI, "Tried to open layer which was already open");
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultOperationFailed);
|
||||
return;
|
||||
}
|
||||
|
||||
android::OutputParcel parcel;
|
||||
parcel.WriteInterface(NativeWindow{*buffer_queue_id});
|
||||
@ -737,7 +742,12 @@ private:
|
||||
|
||||
LOG_DEBUG(Service_VI, "called. layer_id=0x{:016X}", layer_id);
|
||||
|
||||
nvnflinger.CloseLayer(layer_id);
|
||||
if (!nvnflinger.CloseLayer(layer_id)) {
|
||||
LOG_WARNING(Service_VI, "Tried to close layer which was not open");
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultOperationFailed);
|
||||
return;
|
||||
}
|
||||
|
||||
IPC::ResponseBuilder rb{ctx, 2};
|
||||
rb.Push(ResultSuccess);
|
||||
|
Reference in New Issue
Block a user