mirror of
https://github.com/lingble/meta-tegra.git
synced 2025-10-29 11:32:30 +00:00
l4t-graphics-demos: refresh build patches for L4T R36.4.0
* Updates for wayland-related changes * Drop NV12 blocklinear support in weston-dmabuf-formats due to missing source file Signed-off-by: Matt Madison <matt@madison.systems>
This commit is contained in:
committed by
Matt Madison
parent
1d7352e011
commit
78a1abfd5a
@@ -1,20 +1,21 @@
|
||||
From f064b0f4b1a934fd9c21a7c1ccff4017f942322f Mon Sep 17 00:00:00 2001
|
||||
From: Ilies CHERGUI <ilies.chergui@gmail.com>
|
||||
Date: Wed, 9 Aug 2023 23:26:36 +0100
|
||||
From 1045a020db6b4341348332a1f062317b0f73aac9 Mon Sep 17 00:00:00 2001
|
||||
From: Matt Madison <matt@madison.systems>
|
||||
Date: Sun, 13 Oct 2024 10:29:02 -0700
|
||||
Subject: [PATCH] weston-dmabuf-formats cross-build fixes
|
||||
|
||||
Upstream-Status: Inappropriate [OE specific]
|
||||
|
||||
Signed-off-by: Matt Madison <matt@madison.systems>
|
||||
---
|
||||
.../weston-dmabuf-formats/Makefile | 41 +++++++++++++++----
|
||||
1 file changed, 34 insertions(+), 7 deletions(-)
|
||||
.../weston-dmabuf-formats/Makefile | 42 +++++++++++++++----
|
||||
.../weston-dmabuf-formats.c | 34 +--------------
|
||||
2 files changed, 36 insertions(+), 40 deletions(-)
|
||||
|
||||
diff --git a/usr/src/nvidia/graphics_demos/weston-dmabuf-formats/Makefile b/usr/src/nvidia/graphics_demos/weston-dmabuf-formats/Makefile
|
||||
index 5c4d9ea..95e5c6c 100644
|
||||
index 5c4d9ea..1c5ef8c 100644
|
||||
--- a/usr/src/nvidia/graphics_demos/weston-dmabuf-formats/Makefile
|
||||
+++ b/usr/src/nvidia/graphics_demos/weston-dmabuf-formats/Makefile
|
||||
@@ -28,8 +28,16 @@ WESTON-DMABUF-FORMATS_OBJS :=
|
||||
@@ -28,8 +28,17 @@ WESTON-DMABUF-FORMATS_OBJS :=
|
||||
WESTON-DMABUF-FORMATS_OBJS += $(NV_WINSYS)/weston-dmabuf-formats.o
|
||||
INTERMEDIATES += $(WESTON-DMABUF-FORMATS_OBJS)
|
||||
|
||||
@@ -24,6 +25,7 @@ index 5c4d9ea..95e5c6c 100644
|
||||
+PROTOCOLS += $(NV_WINSYS)/fullscreen-shell-unstable-v1-client-protocol.h
|
||||
+PROTOCOLS += $(NV_WINSYS)/xdg-shell-client-protocol.h
|
||||
+PROTOCOLS += $(NV_WINSYS)/linux-dmabuf-unstable-v1-client-protocol.h
|
||||
+PROTOCOLS += $(NV_WINSYS)/linux-explicit-synchronization-unstable-v1-client-protocol.h
|
||||
+INTERMEDIATES += $(PROTOCOLS)
|
||||
+CFLAGS += -I$(NV_WINSYS)/ -I=$(includedir)/libdrm/nvidia
|
||||
+
|
||||
@@ -33,7 +35,7 @@ index 5c4d9ea..95e5c6c 100644
|
||||
|
||||
WESTON-DMABUF-FORMATS_LDLIBS :=
|
||||
WESTON-DMABUF-FORMATS_LDLIBS += -lm
|
||||
@@ -37,12 +45,9 @@ WESTON-DMABUF-FORMATS_LDLIBS += -lrt
|
||||
@@ -37,12 +46,9 @@ WESTON-DMABUF-FORMATS_LDLIBS += -lrt
|
||||
WESTON-DMABUF-FORMATS_LDLIBS += -lpthread
|
||||
WESTON-DMABUF-FORMATS_LDLIBS += -l:libEGL.so.1
|
||||
WESTON-DMABUF-FORMATS_LDLIBS += -l:libGLESv2.so.2
|
||||
@@ -48,7 +50,7 @@ index 5c4d9ea..95e5c6c 100644
|
||||
WESTON-DMABUF-FORMATS_LDLIBS += ${NV_PLATFORM_WINSYS_LIBS}
|
||||
|
||||
ifeq ($(findstring $(NV_WINSYS),egldevice screen wayland x11),)
|
||||
@@ -61,8 +66,30 @@ FORCE:
|
||||
@@ -61,8 +67,30 @@ FORCE:
|
||||
$(NV_WINSYS)/weston-dmabuf-formats: $(WESTON-DMABUF-FORMATS_OBJS) $(WESTON-DMABUF-FORMATS_DEMOLIBS)
|
||||
$(LD) $(LDFLAGS) -o $@ $^ $(WESTON-DMABUF-FORMATS_LDLIBS)
|
||||
|
||||
@@ -79,3 +81,70 @@ index 5c4d9ea..95e5c6c 100644
|
||||
endef
|
||||
$(foreach demolib,$(WESTON-DMABUF-FORMATS_DEMOLIBS),$(eval $(call demolib-rule,$(demolib))))
|
||||
+$(foreach protocol,$(PROTOCOLS),$(eval $(call protocol-rule,$(basename $(protocol)))))
|
||||
diff --git a/usr/src/nvidia/graphics_demos/weston-dmabuf-formats/weston-dmabuf-formats.c b/usr/src/nvidia/graphics_demos/weston-dmabuf-formats/weston-dmabuf-formats.c
|
||||
index 87bf837..0881569 100644
|
||||
--- a/usr/src/nvidia/graphics_demos/weston-dmabuf-formats/weston-dmabuf-formats.c
|
||||
+++ b/usr/src/nvidia/graphics_demos/weston-dmabuf-formats/weston-dmabuf-formats.c
|
||||
@@ -67,8 +67,6 @@
|
||||
#include <GLES2/gl2.h>
|
||||
#include <GLES2/gl2ext.h>
|
||||
|
||||
-#include "balls_nv12_hex.h"
|
||||
-
|
||||
#ifndef DRM_FORMAT_MOD_LINEAR
|
||||
#define DRM_FORMAT_MOD_LINEAR 0
|
||||
#endif
|
||||
@@ -143,18 +141,6 @@ typedef enum _rendering_type {
|
||||
GL_RENDERING
|
||||
} rendering_type;
|
||||
|
||||
-static struct {
|
||||
- uint8_t *data;
|
||||
- uint32_t width;
|
||||
- uint32_t height;
|
||||
- uint32_t max_surface_planes;
|
||||
-} nv12_format_info = {
|
||||
- balls_nv12_hex,
|
||||
- BALLS_NV12_IMAGE_WIDTH,
|
||||
- BALLS_NV12_IMAGE_HEIGHT,
|
||||
- 2
|
||||
-};
|
||||
-
|
||||
struct display {
|
||||
struct wl_display *display;
|
||||
struct wl_registry *registry;
|
||||
@@ -414,19 +400,8 @@ static void
|
||||
fill_content_bl(struct buffer *buf)
|
||||
{
|
||||
switch (buf->format) {
|
||||
- case DRM_FORMAT_NV12:
|
||||
- {
|
||||
- uint32_t imageUVOffset = buf->width * buf->height;
|
||||
-
|
||||
- Raw2NvBufSurface(nv12_format_info.data, 0, 0, buf->width,
|
||||
- buf->height, buf->surface);
|
||||
- Raw2NvBufSurface(&nv12_format_info.data[imageUVOffset], 0, 1, buf->width / 2,
|
||||
- buf->height / 2, buf->surface);
|
||||
- break;
|
||||
- }
|
||||
-
|
||||
default:
|
||||
- fprintf(stderr, "Block linear formats other than NV12 are not supported.\n");
|
||||
+ fprintf(stderr, "Block linear formats are not supported due to missing sources.\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -2343,13 +2318,6 @@ main(int argc, char **argv)
|
||||
if (!display)
|
||||
return 1;
|
||||
|
||||
- if (opts & OPT_ALLOC_BLOCKLINEAR) {
|
||||
- if (import_format == DRM_FORMAT_NV12) {
|
||||
- width = nv12_format_info.width;
|
||||
- height = nv12_format_info.height;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
window = create_window(display, width, height, import_format, opts);
|
||||
if (!window) {
|
||||
destroy_display(display);
|
||||
|
||||
@@ -1,327 +0,0 @@
|
||||
From a3c37e751932847c633aea23c8da4d1ce3439012 Mon Sep 17 00:00:00 2001
|
||||
From: Matt Madison <matt@madison.systems>
|
||||
Date: Sat, 25 May 2024 05:45:20 -0700
|
||||
Subject: [PATCH] Convert nvgldemo-wayland to use xdg-shell
|
||||
|
||||
Upstream-Status: Pending
|
||||
|
||||
Signed-off-by: Matt Madison <matt@madison.systems>
|
||||
---
|
||||
.../nvidia/graphics_demos/nvgldemo/Makefile | 33 ++++-
|
||||
.../nvgldemo/nvgldemo_win_wayland.c | 119 +++++++++---------
|
||||
.../nvgldemo/nvgldemo_win_wayland.h | 6 +-
|
||||
3 files changed, 95 insertions(+), 63 deletions(-)
|
||||
|
||||
diff --git a/usr/src/nvidia/graphics_demos/nvgldemo/Makefile b/usr/src/nvidia/graphics_demos/nvgldemo/Makefile
|
||||
index 2637b5a..7b26a64 100644
|
||||
--- a/usr/src/nvidia/graphics_demos/nvgldemo/Makefile
|
||||
+++ b/usr/src/nvidia/graphics_demos/nvgldemo/Makefile
|
||||
@@ -28,6 +28,14 @@ ifeq ($(NV_WINSYS),screen)
|
||||
endif
|
||||
ifeq ($(NV_WINSYS),wayland)
|
||||
NVGLDEMO_OBJS += wayland/nvgldemo_win_wayland.o
|
||||
+ PROTOCOLS :=
|
||||
+ PROTOCOLS += $(NV_WINSYS)/xdg-shell-client-protocol.h
|
||||
+ INTERMEDIATES += $(PROTOCOLS)
|
||||
+ CFLAGS += -I$(NV_WINSYS)/
|
||||
+
|
||||
+ PROTOCOLSDIR := $(shell pkg-config --variable=pkgdatadir wayland-protocols)
|
||||
+
|
||||
+ NVGLDEMO_OBJS += $(patsubst %.h,%.o,$(PROTOCOLS))
|
||||
endif
|
||||
ifeq ($(NV_WINSYS),x11)
|
||||
NVGLDEMO_OBJS += x11/nvgldemo_win_x11.o
|
||||
@@ -53,9 +61,32 @@ FORCE:
|
||||
|
||||
$(NV_WINSYS)/libnvgldemo.a: $(NV_WINSYS)/libnvgldemo.a($(NVGLDEMO_OBJS))
|
||||
|
||||
+ifeq ($(NV_WINSYS),wayland)
|
||||
+wayland/nvgldemo_win_wayland.o: $(PROTOCOLS)
|
||||
+endif
|
||||
+
|
||||
+define protocol-rule
|
||||
+$(1).h: FORCE
|
||||
+ @mkdir -p $(dir $(1))
|
||||
+ifeq ($(findstring unstable,$(1)),)
|
||||
+ wayland-scanner client-header $$(PROTOCOLSDIR)/stable/$$(shell echo $$(notdir $(1)) | sed -e's,-client-protocol.*,,')/$(patsubst %-client-protocol,%.xml,$(notdir $(1))) $$@
|
||||
+else
|
||||
+ wayland-scanner client-header $$(PROTOCOLSDIR)/unstable/$$(shell echo $$(notdir $(1)) | sed -e's,-unstable.*,,')/$(patsubst %-client-protocol,%.xml,$(notdir $(1))) $$@
|
||||
+endif
|
||||
+$(1).c: $(1).h
|
||||
+ifeq ($(findstring unstable,$(1)),)
|
||||
+ wayland-scanner code $$(PROTOCOLSDIR)/stable/$$(shell echo $$(notdir $(1)) | sed -e's,-client-protocol.*,,')/$(patsubst %-client-protocol,%.xml,$(notdir $(1))) $$@
|
||||
+else
|
||||
+ wayland-scanner code $$(PROTOCOLSDIR)/unstable/$$(shell echo $$(notdir $(1)) | sed -e's,-unstable.*,,')/$(patsubst %-client-protocol,%.xml,$(notdir $(1))) $$@
|
||||
+endif
|
||||
+$(1).o: $(1).c
|
||||
+ @mkdir -p $(dir $(1))
|
||||
+ $$(COMPILE.c) $$(OUTPUT_OPTION) $$<
|
||||
+endef
|
||||
+
|
||||
define demolib-rule
|
||||
$(1): FORCE
|
||||
$(MAKE) -C $$(subst $$(NV_WINSYS)/,,$$(dir $$@))
|
||||
endef
|
||||
$(foreach demolib,$(NVGLDEMO_DEMOLIBS),$(eval $(call demolib-rule,$(demolib))))
|
||||
-
|
||||
+$(foreach protocol,$(PROTOCOLS),$(eval $(call protocol-rule,$(basename $(protocol)))))
|
||||
diff --git a/usr/src/nvidia/graphics_demos/nvgldemo/nvgldemo_win_wayland.c b/usr/src/nvidia/graphics_demos/nvgldemo/nvgldemo_win_wayland.c
|
||||
index 1ac060a..711ae50 100644
|
||||
--- a/usr/src/nvidia/graphics_demos/nvgldemo/nvgldemo_win_wayland.c
|
||||
+++ b/usr/src/nvidia/graphics_demos/nvgldemo/nvgldemo_win_wayland.c
|
||||
@@ -48,18 +48,27 @@ static NvGlDemoPointerCB pointerCB = NULL;
|
||||
static NvGlDemoButtonCB buttonCB = NULL;
|
||||
|
||||
static void
|
||||
-handle_ping(void *data, struct wl_shell_surface *wlShellSurface,
|
||||
+handle_ping(void *data, struct xdg_wm_base *xdgWmBase,
|
||||
uint32_t serial)
|
||||
{
|
||||
- wl_shell_surface_pong(wlShellSurface, serial);
|
||||
+ xdg_wm_base_pong(xdgWmBase, serial);
|
||||
}
|
||||
|
||||
+static const struct xdg_wm_base_listener xdg_wm_base_listener =
|
||||
+{
|
||||
+ handle_ping,
|
||||
+};
|
||||
+
|
||||
static void
|
||||
-handle_configure(void *data, struct wl_shell_surface *shell_surface,
|
||||
- uint32_t edges, int32_t width, int32_t height)
|
||||
+handle_configure(void *data, struct xdg_toplevel *xdgTopLevel,
|
||||
+ int32_t width, int32_t height,
|
||||
+ struct wl_array *states)
|
||||
{
|
||||
struct Window *window = data;
|
||||
|
||||
+ if (width == 0 || height == 0)
|
||||
+ return;
|
||||
+
|
||||
if (window->wlEGLNativeWindow) {
|
||||
wl_egl_window_resize(window->wlEGLNativeWindow, width, height, 0, 0);
|
||||
}
|
||||
@@ -76,10 +85,28 @@ handle_configure(void *data, struct wl_shell_surface *shell_surface,
|
||||
}
|
||||
}
|
||||
|
||||
-static const struct wl_shell_surface_listener shell_surface_listener =
|
||||
+static void
|
||||
+handle_toplevel_close(void *data, struct xdg_toplevel *xdgTopLevel)
|
||||
{
|
||||
- handle_ping,
|
||||
+ struct Window *window = data;
|
||||
+ NvGlDemoWindowTerm();
|
||||
+}
|
||||
+
|
||||
+static const struct xdg_toplevel_listener xdg_toplevel_listener = {
|
||||
handle_configure,
|
||||
+ handle_toplevel_close
|
||||
+};
|
||||
+
|
||||
+static void xdg_surface_configure(void *data, struct xdg_surface *xdgSurface,
|
||||
+ uint32_t serial)
|
||||
+{
|
||||
+ struct Window *window = data;
|
||||
+ xdg_surface_ack_configure(xdgSurface, serial);
|
||||
+ window->configured = 1;
|
||||
+}
|
||||
+
|
||||
+static const struct xdg_surface_listener xdg_surface_listener = {
|
||||
+ xdg_surface_configure
|
||||
};
|
||||
|
||||
#ifdef ENABLE_IVI_SHELL
|
||||
@@ -108,21 +135,6 @@ static const struct ivi_surface_listener ivi_surface_listener = {
|
||||
};
|
||||
#endif
|
||||
|
||||
-static void
|
||||
-configure_callback(void *data, struct wl_callback *callback, uint32_t time)
|
||||
-{
|
||||
- struct Window *window = data;
|
||||
-
|
||||
- wl_callback_destroy(callback);
|
||||
-
|
||||
- window->configured = 1;
|
||||
-}
|
||||
-
|
||||
-static struct wl_callback_listener configure_callback_listener =
|
||||
-{
|
||||
- configure_callback,
|
||||
-};
|
||||
-
|
||||
static void
|
||||
toggle_fullscreen(struct Window *window, int fullscreen)
|
||||
{
|
||||
@@ -133,20 +145,11 @@ toggle_fullscreen(struct Window *window, int fullscreen)
|
||||
window->configured = 0;
|
||||
|
||||
if (fullscreen) {
|
||||
- wl_shell_surface_set_fullscreen(
|
||||
- window->wlShellSurface,
|
||||
- WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT,0, NULL);
|
||||
+ xdg_toplevel_set_fullscreen(window->xdgTopLevel, NULL);
|
||||
} else {
|
||||
- wl_shell_surface_set_toplevel(window->wlShellSurface);
|
||||
- handle_configure(window, window->wlShellSurface, 0,
|
||||
- window->window_size.width,
|
||||
- window->window_size.height);
|
||||
+ xdg_toplevel_unset_fullscreen(window->xdgTopLevel);
|
||||
}
|
||||
|
||||
- callback = wl_display_sync(window->display->wlDisplay);
|
||||
- wl_callback_add_listener(callback, &configure_callback_listener,
|
||||
- window);
|
||||
-
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -419,10 +422,10 @@ registry_handle_global(void *data, struct wl_registry *registry,
|
||||
{
|
||||
struct Display *d = data;
|
||||
|
||||
- if (strcmp(interface, "wl_compositor") == 0) {
|
||||
+ if (strcmp(interface, wl_compositor_interface.name) == 0) {
|
||||
d->wlCompositor = wl_registry_bind(registry, name,
|
||||
&wl_compositor_interface, 1);
|
||||
- } else if (strcmp(interface, "wl_subcompositor") == 0) {
|
||||
+ } else if (strcmp(interface, wl_subcompositor_interface.name) == 0) {
|
||||
d->wlSubcompositor = wl_registry_bind(registry, name,
|
||||
&wl_subcompositor_interface, 1);
|
||||
#ifdef NVGLDEMO_ENABLE_DMABUF
|
||||
@@ -436,9 +439,10 @@ registry_handle_global(void *data, struct wl_registry *registry,
|
||||
d->wlExplicitSync = wl_registry_bind(registry, name,
|
||||
&zwp_linux_explicit_synchronization_v1_interface, 1);
|
||||
#endif
|
||||
- } else if (strcmp(interface, "wl_shell") == 0) {
|
||||
- d->wlShell = wl_registry_bind(registry, name,
|
||||
- &wl_shell_interface, 1);
|
||||
+ } else if (strcmp(interface, xdg_wm_base_interface.name) == 0) {
|
||||
+ d->xdgWmBase = wl_registry_bind(registry, name,
|
||||
+ &xdg_wm_base_interface, 1);
|
||||
+ xdg_wm_base_add_listener(d->xdgWmBase, &xdg_wm_base_listener, d);
|
||||
} else if (strcmp(interface, "wl_seat") == 0) {
|
||||
d->wlSeat = wl_registry_bind(registry, name,
|
||||
&wl_seat_interface, 1);
|
||||
@@ -595,8 +599,8 @@ NvGlDemoDisplayTerm(void)
|
||||
wl_seat_destroy(demoState.platform->display.wlSeat);
|
||||
}
|
||||
|
||||
- if (demoState.platform->display.wlShell) {
|
||||
- wl_shell_destroy(demoState.platform->display.wlShell);
|
||||
+ if (demoState.platform->display.xdgWmBase) {
|
||||
+ xdg_wm_base_destroy(demoState.platform->display.xdgWmBase);
|
||||
}
|
||||
|
||||
#ifdef ENABLE_IVI_SHELL
|
||||
@@ -653,16 +657,12 @@ NvGlDemoDisplayTerm(void)
|
||||
|
||||
static int create_shell_surface(struct Window *window, struct Display *display)
|
||||
{
|
||||
- window->wlShellSurface = wl_shell_get_shell_surface(
|
||||
- display->wlShell, window->wlSurface);
|
||||
-
|
||||
- if (window->wlShellSurface == NULL) {
|
||||
- NvGlDemoLog("Failed to create wayland shell surface.\n");
|
||||
- return 0;
|
||||
- }
|
||||
-
|
||||
- wl_shell_surface_add_listener(window->wlShellSurface,
|
||||
- &shell_surface_listener, window);
|
||||
+ window->xdgSurface = xdg_wm_base_get_xdg_surface(
|
||||
+ display->xdgWmBase, window->wlSurface);
|
||||
+ xdg_surface_add_listener(window->xdgSurface, &xdg_surface_listener, window);
|
||||
+ window->xdgTopLevel = xdg_surface_get_toplevel(window->xdgSurface);
|
||||
+ xdg_toplevel_add_listener(window->xdgTopLevel, &xdg_toplevel_listener, window);
|
||||
+ wl_surface_commit(window->wlSurface);
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -705,7 +705,7 @@ NvGlDemoWindowInit(
|
||||
}
|
||||
|
||||
if (!demoState.platform->display.wlCompositor ||
|
||||
- !(demoState.platform->display.wlShell
|
||||
+ !(demoState.platform->display.xdgWmBase
|
||||
#ifdef ENABLE_IVI_SHELL
|
||||
|| demoState.platform->display.ivi_application
|
||||
#endif
|
||||
@@ -751,7 +751,7 @@ NvGlDemoWindowInit(
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
- if (demoState.platform->display.wlShell) {
|
||||
+ if (demoState.platform->display.xdgWmBase) {
|
||||
if (!create_shell_surface(&demoState.platform->window,
|
||||
&demoState.platform->display)) {
|
||||
goto fail;
|
||||
@@ -774,7 +774,7 @@ NvGlDemoWindowInit(
|
||||
goto fail;
|
||||
}
|
||||
|
||||
- if (demoState.platform->display.wlShell
|
||||
+ if (demoState.platform->display.xdgWmBase
|
||||
#ifdef ENABLE_IVI_SHELL
|
||||
&& !demoState.platform->display.ivi_application
|
||||
#endif
|
||||
@@ -811,9 +811,13 @@ void NvGlDemoWindowTerm(void)
|
||||
demoState.platform->window.wlEGLNativeWindow = 0;
|
||||
}
|
||||
|
||||
- if (demoState.platform->window.wlShellSurface) {
|
||||
- wl_shell_surface_destroy(demoState.platform->window.wlShellSurface);
|
||||
- demoState.platform->window.wlShellSurface = 0;
|
||||
+ if (demoState.platform->window.xdgTopLevel) {
|
||||
+ xdg_toplevel_destroy(demoState.platform->window.xdgTopLevel);
|
||||
+ demoState.platform->window.xdgTopLevel = 0;
|
||||
+ }
|
||||
+ if (demoState.platform->window.xdgSurface) {
|
||||
+ xdg_surface_destroy(demoState.platform->window.xdgSurface);
|
||||
+ demoState.platform->window.xdgSurface = 0;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_IVI_SHELL
|
||||
@@ -823,11 +827,6 @@ void NvGlDemoWindowTerm(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
- if (demoState.platform->window.wlSurface) {
|
||||
- wl_surface_destroy(demoState.platform->window.wlSurface);
|
||||
- demoState.platform->window.wlSurface = 0;
|
||||
- }
|
||||
-
|
||||
if (demoState.platform->window.callback) {
|
||||
wl_callback_destroy(demoState.platform->window.callback);
|
||||
demoState.platform->window.callback = 0;
|
||||
diff --git a/usr/src/nvidia/graphics_demos/nvgldemo/nvgldemo_win_wayland.h b/usr/src/nvidia/graphics_demos/nvgldemo/nvgldemo_win_wayland.h
|
||||
index 0e84f41..24eca67 100644
|
||||
--- a/usr/src/nvidia/graphics_demos/nvgldemo/nvgldemo_win_wayland.h
|
||||
+++ b/usr/src/nvidia/graphics_demos/nvgldemo/nvgldemo_win_wayland.h
|
||||
@@ -39,6 +39,7 @@
|
||||
#endif
|
||||
#include "wayland-client.h"
|
||||
#include "wayland-egl.h"
|
||||
+#include "xdg-shell-client-protocol.h"
|
||||
|
||||
#ifdef ENABLE_IVI_SHELL
|
||||
#include "ivi-application-client-protocol.h"
|
||||
@@ -70,7 +71,7 @@ struct Display {
|
||||
uint64_t formatModifiers_XRGB8[NVGLDEMO_MAX_DRM_MODIFIERS];
|
||||
uint64_t formatModifiers_ARGB8[NVGLDEMO_MAX_DRM_MODIFIERS];
|
||||
#endif
|
||||
- struct wl_shell *wlShell;
|
||||
+ struct xdg_wm_base *xdgWmBase;
|
||||
#ifdef ENABLE_IVI_SHELL
|
||||
struct ivi_application *ivi_application;
|
||||
enum ivi_interface_type ivi_type;
|
||||
@@ -102,7 +103,8 @@ struct Window {
|
||||
struct Display *display;
|
||||
struct wl_egl_window *wlEGLNativeWindow;
|
||||
struct wl_surface *wlSurface;
|
||||
- struct wl_shell_surface *wlShellSurface;
|
||||
+ struct xdg_surface *xdgSurface;
|
||||
+ struct xdg_toplevel *xdgTopLevel;
|
||||
#ifdef ENABLE_IVI_SHELL
|
||||
struct ivi_surface *ivi_surface;
|
||||
unsigned int ivi_surfaceId;
|
||||
@@ -0,0 +1,65 @@
|
||||
From 828e67c0da236e82ab31cd92a599269579e34194 Mon Sep 17 00:00:00 2001
|
||||
From: Matt Madison <matt@madison.systems>
|
||||
Date: Sun, 13 Oct 2024 10:26:36 -0700
|
||||
Subject: [PATCH] Fix use of wayland protocols in nvgldemo makefile
|
||||
|
||||
Upstream-Status: Inappropriate [OE-specific]
|
||||
Signed-off-by: Matt Madison <matt@madison.systems>
|
||||
---
|
||||
.../nvidia/graphics_demos/nvgldemo/Makefile | 34 ++++++++++++++++++-
|
||||
1 file changed, 33 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/usr/src/nvidia/graphics_demos/nvgldemo/Makefile b/usr/src/nvidia/graphics_demos/nvgldemo/Makefile
|
||||
index 2637b5a..0609f4b 100644
|
||||
--- a/usr/src/nvidia/graphics_demos/nvgldemo/Makefile
|
||||
+++ b/usr/src/nvidia/graphics_demos/nvgldemo/Makefile
|
||||
@@ -28,6 +28,15 @@ ifeq ($(NV_WINSYS),screen)
|
||||
endif
|
||||
ifeq ($(NV_WINSYS),wayland)
|
||||
NVGLDEMO_OBJS += wayland/nvgldemo_win_wayland.o
|
||||
+ PROTOCOLS :=
|
||||
+ PROTOCOLS += $(NV_WINSYS)/xdg-shell-client-protocol.h
|
||||
+ PROTOCOLS += $(NV_WINSYS)/linux-explicit-synchronization-unstable-v1-client-protocol.h
|
||||
+ INTERMEDIATES += $(PROTOCOLS)
|
||||
+ CFLAGS += -I$(NV_WINSYS)/
|
||||
+
|
||||
+ PROTOCOLSDIR := $(shell pkg-config --variable=pkgdatadir wayland-protocols)
|
||||
+
|
||||
+ NVGLDEMO_OBJS += $(patsubst %.h,%.o,$(PROTOCOLS))
|
||||
endif
|
||||
ifeq ($(NV_WINSYS),x11)
|
||||
NVGLDEMO_OBJS += x11/nvgldemo_win_x11.o
|
||||
@@ -53,9 +62,32 @@ FORCE:
|
||||
|
||||
$(NV_WINSYS)/libnvgldemo.a: $(NV_WINSYS)/libnvgldemo.a($(NVGLDEMO_OBJS))
|
||||
|
||||
+ifeq ($(NV_WINSYS),wayland)
|
||||
+wayland/nvgldemo_win_wayland.o: $(PROTOCOLS)
|
||||
+endif
|
||||
+
|
||||
+define protocol-rule
|
||||
+$(1).h: FORCE
|
||||
+ @mkdir -p $(dir $(1))
|
||||
+ifeq ($(findstring unstable,$(1)),)
|
||||
+ wayland-scanner client-header $$(PROTOCOLSDIR)/stable/$$(shell echo $$(notdir $(1)) | sed -e's,-client-protocol.*,,')/$(patsubst %-client-protocol,%.xml,$(notdir $(1))) $$@
|
||||
+else
|
||||
+ wayland-scanner client-header $$(PROTOCOLSDIR)/unstable/$$(shell echo $$(notdir $(1)) | sed -e's,-unstable.*,,')/$(patsubst %-client-protocol,%.xml,$(notdir $(1))) $$@
|
||||
+endif
|
||||
+$(1).c: $(1).h
|
||||
+ifeq ($(findstring unstable,$(1)),)
|
||||
+ wayland-scanner private-code $$(PROTOCOLSDIR)/stable/$$(shell echo $$(notdir $(1)) | sed -e's,-client-protocol.*,,')/$(patsubst %-client-protocol,%.xml,$(notdir $(1))) $$@
|
||||
+else
|
||||
+ wayland-scanner private-code $$(PROTOCOLSDIR)/unstable/$$(shell echo $$(notdir $(1)) | sed -e's,-unstable.*,,')/$(patsubst %-client-protocol,%.xml,$(notdir $(1))) $$@
|
||||
+endif
|
||||
+$(1).o: $(1).c
|
||||
+ @mkdir -p $(dir $(1))
|
||||
+ $$(COMPILE.c) $$(OUTPUT_OPTION) $$<
|
||||
+endef
|
||||
+
|
||||
define demolib-rule
|
||||
$(1): FORCE
|
||||
$(MAKE) -C $$(subst $$(NV_WINSYS)/,,$$(dir $$@))
|
||||
endef
|
||||
$(foreach demolib,$(NVGLDEMO_DEMOLIBS),$(eval $(call demolib-rule,$(demolib))))
|
||||
-
|
||||
+$(foreach protocol,$(PROTOCOLS),$(eval $(call protocol-rule,$(basename $(protocol)))))
|
||||
@@ -8,7 +8,7 @@ LIC_FILES_CHKSUM = "file://README;endline=21;md5=17bf753e98379a9888c5bd3f81da8d4
|
||||
SRC_URI += "\
|
||||
file://0001-Fix-stdbool.h-inclusion-check.patch;patchdir=../../../.. \
|
||||
file://0002-weston-dmabuf-formats-cross-build-fixes.patch;patchdir=../../../.. \
|
||||
file://0003-Convert-nvgldemo-wayland-to-use-xdg-shell.patch;patchdir=../../../.. \
|
||||
file://0003-Fix-use-of-wayland-protocols-in-nvgldemo-makefile.patch;patchdir=../../../.. \
|
||||
"
|
||||
|
||||
REQUIRED_DISTRO_FEATURES = "opengl"
|
||||
|
||||
Reference in New Issue
Block a user