clients/simple-dmabuf-egl: Add some notes when using direct-display
authorMarius Vlad <marius.vlad@collabora.com>
Thu, 5 Dec 2019 13:07:56 +0000 (15:07 +0200)
committerDaniel Stone <daniel@fooishbar.org>
Wed, 11 Dec 2019 19:40:24 +0000 (19:40 +0000)
protocol

As dmabuf uses a different coordinate (top-left) system than OpenGL
(bottom-left) using both direct-display with the Y_INVERT dmabuf attrib
flag would result in the image being inverted (direct-display will
remove the Y_INVERT flag, which caused the image to be displayed
correctly). Notifies users that direct-display is in use.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Suggested-by: Pekka Paalanen <pekka.paalanen@collabora.com>
clients/simple-dmabuf-egl.c

index acd79bfcd6660ad59e89e2526449cedd157e2d8c..10e72a9bc0281373a482eee94de62d5ef18fa9f9 100644 (file)
@@ -409,6 +409,9 @@ create_dmabuf_buffer(struct display *display, struct buffer *buffer,
                /* turn off Y_INVERT otherwise linux-dmabuf will reject it and
                 * we need all dmabuf flags turned off */
                flags &= ~ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_Y_INVERT;
+
+               fprintf(stdout, "image is y-inverted as direct-display flag was set, "
+                               "dmabuf y-inverted attribute flag was removed\n");
        }
 
        for (i = 0; i < buffer->plane_count; ++i) {
@@ -1454,7 +1457,10 @@ print_usage_and_exit(void)
                "\t'-m,--mandelbrot'"
                "\n\t\trender a mandelbrot set with multiple draw calls\n"
                "\t'-g,--direct-display'"
-               "\n\t\tenables weston-direct-display extension to attempt direct scan-out\n");
+               "\n\t\tenables weston-direct-display extension to attempt "
+               "direct scan-out;\n\t\tnote this will cause the image to be "
+               "displayed inverted as GL uses a\n\t\tdifferent texture "
+               "coordinate system\n");
        exit(0);
 }