[Spice-devel] [RFC v2 4/5] video-stream: Force stream creation for a valid dmabuf fd

Vivek Kasireddy vivek.kasireddy at intel.com
Mon Jan 23 08:41:22 UTC 2023


If a drawable contains a valid dmabuf fd, then it makes sense to
create a stream for it right away.

Cc: Gerd Hoffmann <kraxel at redhat.com>
Cc: Marc-André Lureau <marcandre.lureau at redhat.com>
Cc: Dongwon Kim <dongwon.kim at intel.com>
Signed-off-by: Vivek Kasireddy <vivek.kasireddy at intel.com>
---
 server/video-stream.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/server/video-stream.cpp b/server/video-stream.cpp
index 28b42d91..8b957373 100644
--- a/server/video-stream.cpp
+++ b/server/video-stream.cpp
@@ -218,6 +218,9 @@ static bool is_next_stream_frame(const Drawable *candidate,
     if (!candidate->streamable) {
         return FALSE;
     }
+    if (candidate->dmabuf_fd > 0) {
+        return TRUE;
+    }
 
     if (candidate->creation_time - other_time >
             (stream ? RED_STREAM_CONTINUOUS_MAX_DELTA : RED_STREAM_DETECTION_MAX_DELTA)) {
@@ -448,7 +451,7 @@ static bool video_stream_add_frame(DisplayChannel *display,
         frame_drawable->last_gradual_frame = last_gradual_frame;
     }
 
-    if (is_stream_start(frame_drawable)) {
+    if (is_stream_start(frame_drawable) || frame_drawable->dmabuf_fd > 0) {
         display_channel_create_stream(display, frame_drawable);
         return TRUE;
     }
-- 
2.37.2



More information about the Spice-devel mailing list