@@ -1,6 +1,6 @@
-From 6558a9153cc81199146132041c61023a2c2e1b2e Mon Sep 17 00:00:00 2001
-From: Andrew Davis <afd@ti.com>
-Date: Thu, 6 Oct 2022 15:49:31 -0500
+From 14513f40b8776b2c75d28368cbeb6393fe89fef1 Mon Sep 17 00:00:00 2001
+From: Denys Dmytriyenko <denys@konsulko.com>
+Date: Thu, 6 Jul 2023 01:48:41 +0000
Subject: [PATCH] Revert require GL_EXT_unpack_subimage commit
This reverts commit 593d5af43a8e2c2a3371088fa7ae430d0517c82d.
@@ -9,43 +9,44 @@ That commit removed support for GPU drivers without GL_EXT_unpack_subimage
which SGX does not support. Add back support for GPUs without this
extension.
-Upstream-Status: Pending
+Upstream-Status: Inappropriate [specific to TI SGX]
Signed-off-by: Andrew Davis <afd@ti.com>
+Signed-off-by: Denys Dmytriyenko <denys@konsulko.com>
---
libweston/renderer-gl/gl-renderer-internal.h | 2 ++
libweston/renderer-gl/gl-renderer.c | 29 ++++++++++++++++----
2 files changed, 26 insertions(+), 5 deletions(-)
diff --git a/libweston/renderer-gl/gl-renderer-internal.h b/libweston/renderer-gl/gl-renderer-internal.h
-index 72101b47..7a6e2f48 100644
+index 888df84..cabf1ed 100644
--- a/libweston/renderer-gl/gl-renderer-internal.h
+++ b/libweston/renderer-gl/gl-renderer-internal.h
-@@ -148,6 +148,8 @@ struct gl_renderer {
- PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC create_platform_window;
- bool has_platform_base;
-
+@@ -153,6 +153,8 @@ struct gl_renderer {
+ PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC create_platform_window;
+ bool has_platform_base;
+
+ bool has_unpack_subimage;
+
- PFNEGLBINDWAYLANDDISPLAYWL bind_display;
- PFNEGLUNBINDWAYLANDDISPLAYWL unbind_display;
- PFNEGLQUERYWAYLANDBUFFERWL query_buffer;
+ PFNEGLBINDWAYLANDDISPLAYWL bind_display;
+ PFNEGLUNBINDWAYLANDDISPLAYWL unbind_display;
+ PFNEGLQUERYWAYLANDBUFFERWL query_buffer;
diff --git a/libweston/renderer-gl/gl-renderer.c b/libweston/renderer-gl/gl-renderer.c
-index a5f5eae4..410ba85c 100644
+index 4a6da14..3cddf6e 100644
--- a/libweston/renderer-gl/gl-renderer.c
+++ b/libweston/renderer-gl/gl-renderer.c
-@@ -1793,6 +1793,7 @@ struct weston_buffer *buffer)
+@@ -1970,6 +1970,7 @@ gl_renderer_flush_damage(struct weston_surface *surface,
{
- const struct weston_testsuite_quirks *quirks =
- &surface->compositor->test_data.test_quirks;
+ const struct weston_testsuite_quirks *quirks =
+ &surface->compositor->test_data.test_quirks;
+ struct gl_renderer *gr = get_renderer(surface->compositor);
- struct gl_surface_state *gs = get_surface_state(surface);
- struct gl_buffer_state *gb = gs->buffer;
- struct weston_view *view;
-@@ -1835,6 +1836,24 @@ struct weston_buffer *buffer)
-
- glActiveTexture(GL_TEXTURE0);
-
+ struct gl_surface_state *gs = get_surface_state(surface);
+ struct gl_buffer_state *gb = gs->buffer;
+ struct weston_view *view;
+@@ -2012,6 +2013,24 @@ gl_renderer_flush_damage(struct weston_surface *surface,
+
+ glActiveTexture(GL_TEXTURE0);
+
+ if (!gr->has_unpack_subimage) {
+ wl_shm_buffer_begin_access(buffer->shm_buffer);
+ for (j = 0; j < gs->buffer->num_textures; j++) {
@@ -64,13 +65,13 @@ index a5f5eae4..410ba85c 100644
+ goto done;
+ }
+
- if (gb->needs_full_upload || quirks->gl_force_full_upload) {
- glPixelStorei(GL_UNPACK_SKIP_PIXELS_EXT, 0);
- glPixelStorei(GL_UNPACK_SKIP_ROWS_EXT, 0);
-@@ -3896,11 +3915,9 @@ gl_renderer_setup(struct weston_compositor *ec, EGLSurface egl_surface)
- else
- ec->read_format = pixel_format_get_info_by_pixman(PIXMAN_a8b8g8r8);
-
+ if (gb->needs_full_upload || quirks->gl_force_full_upload) {
+ glPixelStorei(GL_UNPACK_SKIP_PIXELS_EXT, 0);
+ glPixelStorei(GL_UNPACK_SKIP_ROWS_EXT, 0);
+@@ -4103,11 +4122,9 @@ gl_renderer_setup(struct weston_compositor *ec, EGLSurface egl_surface)
+ else
+ ec->read_format = pixel_format_get_info_by_pixman(PIXMAN_a8b8g8r8);
+
- if (gr->gl_version < gr_gl_version(3, 0) &&
- !weston_check_egl_extension(extensions, "GL_EXT_unpack_subimage")) {
- weston_log("GL_EXT_unpack_subimage not available.\n");
@@ -79,15 +80,18 @@ index a5f5eae4..410ba85c 100644
+ if (gr->gl_version >= gr_gl_version(3, 0) ||
+ weston_check_egl_extension(extensions, "GL_EXT_unpack_subimage"))
+ gr->has_unpack_subimage = true;
-
- if (gr->gl_version >= gr_gl_version(3, 0) ||
- weston_check_egl_extension(extensions, "GL_EXT_texture_type_2_10_10_10_REV"))
-@@ -3945,6 +3962,8 @@ gl_renderer_setup(struct weston_compositor *ec, EGLSurface egl_surface)
- gr_gl_version_minor(gr->gl_version));
- weston_log_continue(STAMP_SPACE "read-back format: %s\n",
- ec->read_format->drm_format_name);
+
+ if (gr->gl_version >= gr_gl_version(3, 0) ||
+ weston_check_egl_extension(extensions, "GL_EXT_texture_type_2_10_10_10_REV"))
+@@ -4194,6 +4211,8 @@ gl_renderer_setup(struct weston_compositor *ec, EGLSurface egl_surface)
+ gr_gl_version_minor(gr->gl_version));
+ weston_log_continue(STAMP_SPACE "read-back format: %s\n",
+ ec->read_format->drm_format_name);
+ weston_log_continue(STAMP_SPACE "wl_shm sub-image to texture: %s\n",
+ gr->has_unpack_subimage ? "yes" : "no");
- weston_log_continue(STAMP_SPACE "wl_shm 10 bpc formats: %s\n",
- yesno(gr->has_texture_type_2_10_10_10_rev));
- weston_log_continue(STAMP_SPACE "wl_shm 16 bpc formats: %s\n",
+ weston_log_continue(STAMP_SPACE "glReadPixels supports y-flip: %s\n",
+ yesno(gr->has_pack_reverse));
+ weston_log_continue(STAMP_SPACE "wl_shm 10 bpc formats: %s\n",
+--
+2.25.1
+
deleted file mode 100644
@@ -1,63 +0,0 @@
-From 8c4445d4dbd4c2d5de5a19370fcc5d8777a7e6d4 Mon Sep 17 00:00:00 2001
-From: Andrew Davis <afd@ti.com>
-Date: Fri, 6 Mar 2020 13:06:55 -0500
-Subject: [PATCH] backend-drm: Select plane based on current attached CRTC
-
-When doing plane selection for an output CRTC check if the plane
-already has a CRTC attached and if so prefer that plane only for
-the corresponding CRTC.
-
-This prevents changing a CRTC's primary plane when it is active
-which is not allowed by the DRM framework.
-
-Upstream-Status: Pending
-
-Based-on-patch-by: Eric Ruei <e-ruei1@ti.com>
-Signed-off-by: Andrew Davis <afd@ti.com>
----
- libweston/backend-drm/drm-internal.h | 1 +
- libweston/backend-drm/drm.c | 9 +++++++++
- 2 files changed, 10 insertions(+)
-
-diff --git a/libweston/backend-drm/drm-internal.h b/libweston/backend-drm/drm-internal.h
-index 48600880..b381ca31 100644
---- a/libweston/backend-drm/drm-internal.h
-+++ b/libweston/backend-drm/drm-internal.h
-@@ -468,6 +468,7 @@ struct drm_plane {
- uint32_t possible_crtcs;
- uint32_t plane_id;
- uint32_t plane_idx;
-+ uint32_t crtc_id;
-
- struct drm_property_info props[WDRM_PLANE__COUNT];
-
-diff --git a/libweston/backend-drm/drm.c b/libweston/backend-drm/drm.c
-index 42787702..b5b7c4ba 100644
---- a/libweston/backend-drm/drm.c
-+++ b/libweston/backend-drm/drm.c
-@@ -776,6 +776,7 @@ drm_plane_create(struct drm_backend *b, const drmModePlane *kplane)
- plane->state_cur->complete = true;
- plane->possible_crtcs = kplane->possible_crtcs;
- plane->plane_id = kplane->plane_id;
-+ plane->crtc_id = kplane->crtc_id;
-
- weston_drm_format_array_init(&plane->formats);
-
-@@ -866,6 +867,14 @@ drm_output_find_special_plane(struct drm_backend *b, struct drm_output *output,
- if (found_elsewhere)
- continue;
-
-+ /* If a plane already has a CRTC selected and it is not our
-+ * output's CRTC, then do not select this plane. We cannot
-+ * switch away a plane from a CTRC when active. */
-+ if ((type == WDRM_PLANE_TYPE_PRIMARY) &&
-+ (plane->crtc_id != 0) &&
-+ (plane->crtc_id != output->crtc->crtc_id))
-+ continue;
-+
- plane->possible_crtcs = (1 << output->crtc->pipe);
- return plane;
- }
-2.38.1
-
similarity index 55%
rename from meta-arago-distro/recipes-graphics/wayland/weston_11.0.1.bbappend
rename to meta-arago-distro/recipes-graphics/wayland/weston_12.0.1.bbappend
@@ -2,12 +2,7 @@ FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
PR:append = ".arago1"
-# Drop 0001-backend-drm-Select-plane-based-on-current-attached-C.patch once we
-# get past version 11.0.1 or commit 94afcbcdc3f1b1cfc050da242c9c70009b007fc6
-# upstream
-
SRC_URI += " \
- file://0001-backend-drm-Select-plane-based-on-current-attached-C.patch \
file://0001-Revert-require-GL_EXT_unpack_subimage-commit.patch \
"