From 88e1e7f14bd830af43f0b7279fe5af78046dcfee Mon Sep 17 00:00:00 2001
From: Feng Chen <vonchenplus@gmail.com>
Date: Tue, 28 Dec 2021 18:39:11 +0800
Subject: [PATCH 1/3] Implement few type in bufferqueue query method

---
 src/core/hle/service/nvflinger/buffer_queue.cpp | 4 ++++
 src/core/hle/service/nvflinger/buffer_queue.h   | 5 +++++
 2 files changed, 9 insertions(+)

diff --git a/src/core/hle/service/nvflinger/buffer_queue.cpp b/src/core/hle/service/nvflinger/buffer_queue.cpp
index b4c3a6099f..5fead6d1b9 100644
--- a/src/core/hle/service/nvflinger/buffer_queue.cpp
+++ b/src/core/hle/service/nvflinger/buffer_queue.cpp
@@ -186,6 +186,10 @@ u32 BufferQueue::Query(QueryType type) {
     case QueryType::NativeWindowWidth:
     case QueryType::NativeWindowHeight:
         break;
+    case QueryType::NativeWindowMinUndequeuedBuffers:
+        return 0;
+    case QueryType::NativeWindowConsumerUsageBits:
+        return 0;
     }
     UNIMPLEMENTED_MSG("Unimplemented query type={}", type);
     return 0;
diff --git a/src/core/hle/service/nvflinger/buffer_queue.h b/src/core/hle/service/nvflinger/buffer_queue.h
index 7b7baeaea2..f2a5791337 100644
--- a/src/core/hle/service/nvflinger/buffer_queue.h
+++ b/src/core/hle/service/nvflinger/buffer_queue.h
@@ -57,6 +57,11 @@ public:
         NativeWindowWidth = 0,
         NativeWindowHeight = 1,
         NativeWindowFormat = 2,
+        /// The minimum number of buffers that must remain un-dequeued after a buffer has been
+        /// queued
+        NativeWindowMinUndequeuedBuffers = 3,
+        /// The consumer gralloc usage bits currently set by the consumer
+        NativeWindowConsumerUsageBits = 10,
     };
 
     explicit BufferQueue(Kernel::KernelCore& kernel, u32 id_, u64 layer_id_,

From e18bf4b0629f547e82c9a492b81744de29952620 Mon Sep 17 00:00:00 2001
From: Feng Chen <vonchenplus@gmail.com>
Date: Tue, 28 Dec 2021 18:41:33 +0800
Subject: [PATCH 2/3] Remove invalid header include

---
 src/video_core/gpu.cpp | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/video_core/gpu.cpp b/src/video_core/gpu.cpp
index 8788f5148f..f524f8bae5 100644
--- a/src/video_core/gpu.cpp
+++ b/src/video_core/gpu.cpp
@@ -17,7 +17,6 @@
 #include "core/frontend/emu_window.h"
 #include "core/hardware_interrupt_manager.h"
 #include "core/hle/service/nvdrv/nvdata.h"
-#include "core/hle/service/nvflinger/buffer_queue.h"
 #include "core/perf_stats.h"
 #include "video_core/cdma_pusher.h"
 #include "video_core/dma_pusher.h"

From 1eec9590c393d604c67320904a8fffaa5da3a8a1 Mon Sep 17 00:00:00 2001
From: Feng Chen <vonchenplus@gmail.com>
Date: Tue, 28 Dec 2021 18:48:44 +0800
Subject: [PATCH 3/3] Remove invalid assertion statement

---
 src/core/hle/service/nvflinger/nvflinger.cpp | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/src/core/hle/service/nvflinger/nvflinger.cpp b/src/core/hle/service/nvflinger/nvflinger.cpp
index a22811ec12..01e69de301 100644
--- a/src/core/hle/service/nvflinger/nvflinger.cpp
+++ b/src/core/hle/service/nvflinger/nvflinger.cpp
@@ -100,9 +100,6 @@ std::optional<u64> NVFlinger::OpenDisplay(std::string_view name) {
 
     LOG_DEBUG(Service, "Opening \"{}\" display", name);
 
-    // TODO(Subv): Currently we only support the Default display.
-    ASSERT(name == "Default");
-
     const auto itr =
         std::find_if(displays.begin(), displays.end(),
                      [&](const VI::Display& display) { return display.GetName() == name; });