diff mbox series

[master/kirkstone,2/2] weston: drop patch reverting GL_EXT_unpack_subimage requirement

Message ID 20230224101240.4132411-2-denis@denix.org
State Rejected
Delegated to: Ryan Eatmon
Headers show
Series [master/kirkstone,v2,1/2] all: convert graphics conditional switching from gpu to opengl | expand

Commit Message

Denys Dmytriyenko Feb. 24, 2023, 10:12 a.m. UTC
From: Denys Dmytriyenko <denys@konsulko.com>

With the updated graphics recipes in meta-ti this hack is no longer needed.

Signed-off-by: Denys Dmytriyenko <denys@konsulko.com>
---
 ...equire-GL_EXT_unpack_subimage-commit.patch | 90 -------------------
 .../wayland/weston_10.0.2.bbappend            |  1 -
 2 files changed, 91 deletions(-)
 delete mode 100644 meta-arago-distro/recipes-graphics/wayland/weston/0001-Revert-require-GL_EXT_unpack_subimage-commit.patch

Comments

Andrew Davis Feb. 24, 2023, 2:16 p.m. UTC | #1
On 2/24/23 4:12 AM, Denys Dmytriyenko wrote:
> From: Denys Dmytriyenko <denys@konsulko.com>
> 
> With the updated graphics recipes in meta-ti this hack is no longer needed.
> 

Did you test that? What board and with what program?

Andrew

> Signed-off-by: Denys Dmytriyenko <denys@konsulko.com>
> ---
>   ...equire-GL_EXT_unpack_subimage-commit.patch | 90 -------------------
>   .../wayland/weston_10.0.2.bbappend            |  1 -
>   2 files changed, 91 deletions(-)
>   delete mode 100644 meta-arago-distro/recipes-graphics/wayland/weston/0001-Revert-require-GL_EXT_unpack_subimage-commit.patch
> 
> diff --git a/meta-arago-distro/recipes-graphics/wayland/weston/0001-Revert-require-GL_EXT_unpack_subimage-commit.patch b/meta-arago-distro/recipes-graphics/wayland/weston/0001-Revert-require-GL_EXT_unpack_subimage-commit.patch
> deleted file mode 100644
> index 8b03ddd6..00000000
> --- a/meta-arago-distro/recipes-graphics/wayland/weston/0001-Revert-require-GL_EXT_unpack_subimage-commit.patch
> +++ /dev/null
> @@ -1,90 +0,0 @@
> -From 6558a9153cc81199146132041c61023a2c2e1b2e Mon Sep 17 00:00:00 2001
> -From: Andrew Davis <afd@ti.com>
> -Date: Thu, 6 Oct 2022 15:49:31 -0500
> -Subject: [PATCH] Revert require GL_EXT_unpack_subimage commit
> -
> -This reverts commit 593d5af43a8e2c2a3371088fa7ae430d0517c82d.
> -
> -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.
> -
> -Signed-off-by: Andrew Davis <afd@ti.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
> ---- a/libweston/renderer-gl/gl-renderer-internal.h
> -+++ b/libweston/renderer-gl/gl-renderer-internal.h
> -@@ -133,6 +133,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;
> -diff --git a/libweston/renderer-gl/gl-renderer.c b/libweston/renderer-gl/gl-renderer.c
> -index a5f5eae4..410ba85c 100644
> ---- a/libweston/renderer-gl/gl-renderer.c
> -+++ b/libweston/renderer-gl/gl-renderer.c
> -@@ -1835,6 +1835,7 @@ gl_renderer_flush_damage(struct weston_surface *surface)
> - {
> -	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 weston_buffer *buffer = gs->buffer_ref.buffer;
> -	struct weston_view *view;
> -@@ -1872,6 +1873,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->num_textures; j++) {
> -+			glBindTexture(GL_TEXTURE_2D, gs->textures[j]);
> -+			glTexImage2D(GL_TEXTURE_2D, 0,
> -+				     gs->gl_format[j],
> -+				     gs->pitch / gs->hsub[j],
> -+				     buffer->height / gs->vsub[j],
> -+				     0,
> -+				     gl_format_from_internal(gs->gl_format[j]),
> -+				     gs->gl_pixel_type,
> -+				     data + gs->offset[j]);
> -+		}
> -+		wl_shm_buffer_end_access(buffer->shm_buffer);
> -+
> -+		goto done;
> -+	}
> -+
> -	if (gs->needs_full_upload || quirks->gl_force_full_upload) {
> -		glPixelStorei(GL_UNPACK_SKIP_PIXELS_EXT, 0);
> -		glPixelStorei(GL_UNPACK_SKIP_ROWS_EXT, 0);
> -@@ -3932,11 +3951,9 @@ gl_renderer_setup(struct weston_compositor *ec, EGLSurface egl_surface)
> -	else
> -		ec->read_format = 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");
> --		return -1;
> --	}
> -+	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"))
> -@@ -3977,6 +3994,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 == PIXMAN_a8r8g8b8 ? "BGRA" : "RGBA");
> -+	weston_log_continue(STAMP_SPACE "wl_shm sub-image to texture: %s\n",
> -+			    gr->has_unpack_subimage ? "yes" : "no");
> -	weston_log_continue(STAMP_SPACE "EGL Wayland extension: %s\n",
> -			    gr->has_bind_display ? "yes" : "no");
> diff --git a/meta-arago-distro/recipes-graphics/wayland/weston_10.0.2.bbappend b/meta-arago-distro/recipes-graphics/wayland/weston_10.0.2.bbappend
> index b1b7d26a..dd893f1e 100644
> --- a/meta-arago-distro/recipes-graphics/wayland/weston_10.0.2.bbappend
> +++ b/meta-arago-distro/recipes-graphics/wayland/weston_10.0.2.bbappend
> @@ -7,5 +7,4 @@ SRC_URI += " \
>           file://0003-weston-Fix-virtual-keyboard-display-issue-for-QT5-ap.patch \
>           file://0004-weston-Fix-touch-screen-crash-issue.patch \
>           file://0001-backend-drm-Select-plane-based-on-current-attached-C.patch \
> -        file://0001-Revert-require-GL_EXT_unpack_subimage-commit.patch \
>   "
Denys Dmytriyenko Feb. 28, 2023, 11:29 p.m. UTC | #2
On Fri, Feb 24, 2023 at 08:16:25AM -0600, Andrew Davis via lists.yoctoproject.org wrote:
> On 2/24/23 4:12 AM, Denys Dmytriyenko wrote:
> >From: Denys Dmytriyenko <denys@konsulko.com>
> >
> >With the updated graphics recipes in meta-ti this hack is no longer needed.
> 
> Did you test that? What board and with what program?

If I remember correctly, there was a build failure in the past with newer 
Weston complaining that the extenstion does not exist in the old binary DDK. 
Since I haven't seen this failure with the updated Mesa-based graphics stack, 
I assumed that is now resolved.

My testing was mostly with Rogue and I see in the commit log that this is 
specific to SGX, which currently builds full software-rendering stack w/o any 
HW acceleration.

Is this extension a pure software implementation in Mesa or does it require 
corresponding HW support? If the latter, then we definitely still need this 
revert and my patch removing it can be dropped.


> >Signed-off-by: Denys Dmytriyenko <denys@konsulko.com>
> >---
> >  ...equire-GL_EXT_unpack_subimage-commit.patch | 90 -------------------
> >  .../wayland/weston_10.0.2.bbappend            |  1 -
> >  2 files changed, 91 deletions(-)
> >  delete mode 100644 meta-arago-distro/recipes-graphics/wayland/weston/0001-Revert-require-GL_EXT_unpack_subimage-commit.patch
> >
> >diff --git a/meta-arago-distro/recipes-graphics/wayland/weston/0001-Revert-require-GL_EXT_unpack_subimage-commit.patch b/meta-arago-distro/recipes-graphics/wayland/weston/0001-Revert-require-GL_EXT_unpack_subimage-commit.patch
> >deleted file mode 100644
> >index 8b03ddd6..00000000
> >--- a/meta-arago-distro/recipes-graphics/wayland/weston/0001-Revert-require-GL_EXT_unpack_subimage-commit.patch
> >+++ /dev/null
> >@@ -1,90 +0,0 @@
> >-From 6558a9153cc81199146132041c61023a2c2e1b2e Mon Sep 17 00:00:00 2001
> >-From: Andrew Davis <afd@ti.com>
> >-Date: Thu, 6 Oct 2022 15:49:31 -0500
> >-Subject: [PATCH] Revert require GL_EXT_unpack_subimage commit
> >-
> >-This reverts commit 593d5af43a8e2c2a3371088fa7ae430d0517c82d.
> >-
> >-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.
> >-
> >-Signed-off-by: Andrew Davis <afd@ti.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
> >---- a/libweston/renderer-gl/gl-renderer-internal.h
> >-+++ b/libweston/renderer-gl/gl-renderer-internal.h
> >-@@ -133,6 +133,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;
> >-diff --git a/libweston/renderer-gl/gl-renderer.c b/libweston/renderer-gl/gl-renderer.c
> >-index a5f5eae4..410ba85c 100644
> >---- a/libweston/renderer-gl/gl-renderer.c
> >-+++ b/libweston/renderer-gl/gl-renderer.c
> >-@@ -1835,6 +1835,7 @@ gl_renderer_flush_damage(struct weston_surface *surface)
> >- {
> >-	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 weston_buffer *buffer = gs->buffer_ref.buffer;
> >-	struct weston_view *view;
> >-@@ -1872,6 +1873,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->num_textures; j++) {
> >-+			glBindTexture(GL_TEXTURE_2D, gs->textures[j]);
> >-+			glTexImage2D(GL_TEXTURE_2D, 0,
> >-+				     gs->gl_format[j],
> >-+				     gs->pitch / gs->hsub[j],
> >-+				     buffer->height / gs->vsub[j],
> >-+				     0,
> >-+				     gl_format_from_internal(gs->gl_format[j]),
> >-+				     gs->gl_pixel_type,
> >-+				     data + gs->offset[j]);
> >-+		}
> >-+		wl_shm_buffer_end_access(buffer->shm_buffer);
> >-+
> >-+		goto done;
> >-+	}
> >-+
> >-	if (gs->needs_full_upload || quirks->gl_force_full_upload) {
> >-		glPixelStorei(GL_UNPACK_SKIP_PIXELS_EXT, 0);
> >-		glPixelStorei(GL_UNPACK_SKIP_ROWS_EXT, 0);
> >-@@ -3932,11 +3951,9 @@ gl_renderer_setup(struct weston_compositor *ec, EGLSurface egl_surface)
> >-	else
> >-		ec->read_format = 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");
> >--		return -1;
> >--	}
> >-+	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"))
> >-@@ -3977,6 +3994,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 == PIXMAN_a8r8g8b8 ? "BGRA" : "RGBA");
> >-+	weston_log_continue(STAMP_SPACE "wl_shm sub-image to texture: %s\n",
> >-+			    gr->has_unpack_subimage ? "yes" : "no");
> >-	weston_log_continue(STAMP_SPACE "EGL Wayland extension: %s\n",
> >-			    gr->has_bind_display ? "yes" : "no");
> >diff --git a/meta-arago-distro/recipes-graphics/wayland/weston_10.0.2.bbappend b/meta-arago-distro/recipes-graphics/wayland/weston_10.0.2.bbappend
> >index b1b7d26a..dd893f1e 100644
> >--- a/meta-arago-distro/recipes-graphics/wayland/weston_10.0.2.bbappend
> >+++ b/meta-arago-distro/recipes-graphics/wayland/weston_10.0.2.bbappend
> >@@ -7,5 +7,4 @@ SRC_URI += " \
> >          file://0003-weston-Fix-virtual-keyboard-display-issue-for-QT5-ap.patch \
> >          file://0004-weston-Fix-touch-screen-crash-issue.patch \
> >          file://0001-backend-drm-Select-plane-based-on-current-attached-C.patch \
> >-        file://0001-Revert-require-GL_EXT_unpack_subimage-commit.patch \
> >  "
Andrew Davis Feb. 28, 2023, 11:57 p.m. UTC | #3
On 2/28/23 5:29 PM, Denys Dmytriyenko wrote:
> On Fri, Feb 24, 2023 at 08:16:25AM -0600, Andrew Davis via lists.yoctoproject.org wrote:
>> On 2/24/23 4:12 AM, Denys Dmytriyenko wrote:
>>> From: Denys Dmytriyenko <denys@konsulko.com>
>>>
>>> With the updated graphics recipes in meta-ti this hack is no longer needed.
>>
>> Did you test that? What board and with what program?
> 
> If I remember correctly, there was a build failure in the past with newer
> Weston complaining that the extenstion does not exist in the old binary DDK.
> Since I haven't seen this failure with the updated Mesa-based graphics stack,
> I assumed that is now resolved.
> 
> My testing was mostly with Rogue and I see in the commit log that this is
> specific to SGX, which currently builds full software-rendering stack w/o any
> HW acceleration.
> 
> Is this extension a pure software implementation in Mesa or does it require
> corresponding HW support? If the latter, then we definitely still need this
> revert and my patch removing it can be dropped.
> 

Unfortunately it needs to be handled in the GPU driver on the UM side, so
not something Mesa can fix for us. And the error only shows up as a runtime
issue when you try to start Weston and it sees the extension is not available.

We will need to keep this patch until someone can add the software emulation
of this function inside the SGX UM driver. It is on my todo list for someday..

Andrew

> 
>>> Signed-off-by: Denys Dmytriyenko <denys@konsulko.com>
>>> ---
>>>   ...equire-GL_EXT_unpack_subimage-commit.patch | 90 -------------------
>>>   .../wayland/weston_10.0.2.bbappend            |  1 -
>>>   2 files changed, 91 deletions(-)
>>>   delete mode 100644 meta-arago-distro/recipes-graphics/wayland/weston/0001-Revert-require-GL_EXT_unpack_subimage-commit.patch
>>>
>>> diff --git a/meta-arago-distro/recipes-graphics/wayland/weston/0001-Revert-require-GL_EXT_unpack_subimage-commit.patch b/meta-arago-distro/recipes-graphics/wayland/weston/0001-Revert-require-GL_EXT_unpack_subimage-commit.patch
>>> deleted file mode 100644
>>> index 8b03ddd6..00000000
>>> --- a/meta-arago-distro/recipes-graphics/wayland/weston/0001-Revert-require-GL_EXT_unpack_subimage-commit.patch
>>> +++ /dev/null
>>> @@ -1,90 +0,0 @@
>>> -From 6558a9153cc81199146132041c61023a2c2e1b2e Mon Sep 17 00:00:00 2001
>>> -From: Andrew Davis <afd@ti.com>
>>> -Date: Thu, 6 Oct 2022 15:49:31 -0500
>>> -Subject: [PATCH] Revert require GL_EXT_unpack_subimage commit
>>> -
>>> -This reverts commit 593d5af43a8e2c2a3371088fa7ae430d0517c82d.
>>> -
>>> -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.
>>> -
>>> -Signed-off-by: Andrew Davis <afd@ti.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
>>> ---- a/libweston/renderer-gl/gl-renderer-internal.h
>>> -+++ b/libweston/renderer-gl/gl-renderer-internal.h
>>> -@@ -133,6 +133,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;
>>> -diff --git a/libweston/renderer-gl/gl-renderer.c b/libweston/renderer-gl/gl-renderer.c
>>> -index a5f5eae4..410ba85c 100644
>>> ---- a/libweston/renderer-gl/gl-renderer.c
>>> -+++ b/libweston/renderer-gl/gl-renderer.c
>>> -@@ -1835,6 +1835,7 @@ gl_renderer_flush_damage(struct weston_surface *surface)
>>> - {
>>> -	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 weston_buffer *buffer = gs->buffer_ref.buffer;
>>> -	struct weston_view *view;
>>> -@@ -1872,6 +1873,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->num_textures; j++) {
>>> -+			glBindTexture(GL_TEXTURE_2D, gs->textures[j]);
>>> -+			glTexImage2D(GL_TEXTURE_2D, 0,
>>> -+				     gs->gl_format[j],
>>> -+				     gs->pitch / gs->hsub[j],
>>> -+				     buffer->height / gs->vsub[j],
>>> -+				     0,
>>> -+				     gl_format_from_internal(gs->gl_format[j]),
>>> -+				     gs->gl_pixel_type,
>>> -+				     data + gs->offset[j]);
>>> -+		}
>>> -+		wl_shm_buffer_end_access(buffer->shm_buffer);
>>> -+
>>> -+		goto done;
>>> -+	}
>>> -+
>>> -	if (gs->needs_full_upload || quirks->gl_force_full_upload) {
>>> -		glPixelStorei(GL_UNPACK_SKIP_PIXELS_EXT, 0);
>>> -		glPixelStorei(GL_UNPACK_SKIP_ROWS_EXT, 0);
>>> -@@ -3932,11 +3951,9 @@ gl_renderer_setup(struct weston_compositor *ec, EGLSurface egl_surface)
>>> -	else
>>> -		ec->read_format = 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");
>>> --		return -1;
>>> --	}
>>> -+	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"))
>>> -@@ -3977,6 +3994,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 == PIXMAN_a8r8g8b8 ? "BGRA" : "RGBA");
>>> -+	weston_log_continue(STAMP_SPACE "wl_shm sub-image to texture: %s\n",
>>> -+			    gr->has_unpack_subimage ? "yes" : "no");
>>> -	weston_log_continue(STAMP_SPACE "EGL Wayland extension: %s\n",
>>> -			    gr->has_bind_display ? "yes" : "no");
>>> diff --git a/meta-arago-distro/recipes-graphics/wayland/weston_10.0.2.bbappend b/meta-arago-distro/recipes-graphics/wayland/weston_10.0.2.bbappend
>>> index b1b7d26a..dd893f1e 100644
>>> --- a/meta-arago-distro/recipes-graphics/wayland/weston_10.0.2.bbappend
>>> +++ b/meta-arago-distro/recipes-graphics/wayland/weston_10.0.2.bbappend
>>> @@ -7,5 +7,4 @@ SRC_URI += " \
>>>           file://0003-weston-Fix-virtual-keyboard-display-issue-for-QT5-ap.patch \
>>>           file://0004-weston-Fix-touch-screen-crash-issue.patch \
>>>           file://0001-backend-drm-Select-plane-based-on-current-attached-C.patch \
>>> -        file://0001-Revert-require-GL_EXT_unpack_subimage-commit.patch \
>>>   "
Denys Dmytriyenko March 1, 2023, 12:15 a.m. UTC | #4
On Tue, Feb 28, 2023 at 05:57:40PM -0600, Andrew Davis wrote:
> On 2/28/23 5:29 PM, Denys Dmytriyenko wrote:
> >On Fri, Feb 24, 2023 at 08:16:25AM -0600, Andrew Davis via lists.yoctoproject.org wrote:
> >>On 2/24/23 4:12 AM, Denys Dmytriyenko wrote:
> >>>From: Denys Dmytriyenko <denys@konsulko.com>
> >>>
> >>>With the updated graphics recipes in meta-ti this hack is no longer needed.
> >>
> >>Did you test that? What board and with what program?
> >
> >If I remember correctly, there was a build failure in the past with newer
> >Weston complaining that the extenstion does not exist in the old binary DDK.
> >Since I haven't seen this failure with the updated Mesa-based graphics stack,
> >I assumed that is now resolved.
> >
> >My testing was mostly with Rogue and I see in the commit log that this is
> >specific to SGX, which currently builds full software-rendering stack w/o any
> >HW acceleration.
> >
> >Is this extension a pure software implementation in Mesa or does it require
> >corresponding HW support? If the latter, then we definitely still need this
> >revert and my patch removing it can be dropped.
> >
> 
> Unfortunately it needs to be handled in the GPU driver on the UM side, so
> not something Mesa can fix for us. And the error only shows up as a runtime
> issue when you try to start Weston and it sees the extension is not available.
> 
> We will need to keep this patch until someone can add the software emulation
> of this function inside the SGX UM driver. It is on my todo list for someday..

Andrew,

Thanks for confirming.

Ryan,

We still need Andrew's revert, please drop my patch from the queue. Thanks.
Ryan Eatmon March 1, 2023, 2:56 p.m. UTC | #5
On 2/28/2023 6:15 PM, Denys Dmytriyenko wrote:
> On Tue, Feb 28, 2023 at 05:57:40PM -0600, Andrew Davis wrote:
>> On 2/28/23 5:29 PM, Denys Dmytriyenko wrote:
>>> On Fri, Feb 24, 2023 at 08:16:25AM -0600, Andrew Davis via lists.yoctoproject.org wrote:
>>>> On 2/24/23 4:12 AM, Denys Dmytriyenko wrote:
>>>>> From: Denys Dmytriyenko <denys@konsulko.com>
>>>>>
>>>>> With the updated graphics recipes in meta-ti this hack is no longer needed.
>>>>
>>>> Did you test that? What board and with what program?
>>>
>>> If I remember correctly, there was a build failure in the past with newer
>>> Weston complaining that the extenstion does not exist in the old binary DDK.
>>> Since I haven't seen this failure with the updated Mesa-based graphics stack,
>>> I assumed that is now resolved.
>>>
>>> My testing was mostly with Rogue and I see in the commit log that this is
>>> specific to SGX, which currently builds full software-rendering stack w/o any
>>> HW acceleration.
>>>
>>> Is this extension a pure software implementation in Mesa or does it require
>>> corresponding HW support? If the latter, then we definitely still need this
>>> revert and my patch removing it can be dropped.
>>>
>>
>> Unfortunately it needs to be handled in the GPU driver on the UM side, so
>> not something Mesa can fix for us. And the error only shows up as a runtime
>> issue when you try to start Weston and it sees the extension is not available.
>>
>> We will need to keep this patch until someone can add the software emulation
>> of this function inside the SGX UM driver. It is on my todo list for someday..
> 
> Andrew,
> 
> Thanks for confirming.
> 
> Ryan,
> 
> We still need Andrew's revert, please drop my patch from the queue. Thanks.

Roger that.
Ryan Eatmon March 1, 2023, 7:27 p.m. UTC | #6
And now for a fun development, the patch in question no longer applies 
cleanly on master...


On 3/1/2023 8:56 AM, Ryan Eatmon via lists.yoctoproject.org wrote:
> 
> 
> On 2/28/2023 6:15 PM, Denys Dmytriyenko wrote:
>> On Tue, Feb 28, 2023 at 05:57:40PM -0600, Andrew Davis wrote:
>>> On 2/28/23 5:29 PM, Denys Dmytriyenko wrote:
>>>> On Fri, Feb 24, 2023 at 08:16:25AM -0600, Andrew Davis via 
>>>> lists.yoctoproject.org wrote:
>>>>> On 2/24/23 4:12 AM, Denys Dmytriyenko wrote:
>>>>>> From: Denys Dmytriyenko <denys@konsulko.com>
>>>>>>
>>>>>> With the updated graphics recipes in meta-ti this hack is no 
>>>>>> longer needed.
>>>>>
>>>>> Did you test that? What board and with what program?
>>>>
>>>> If I remember correctly, there was a build failure in the past with 
>>>> newer
>>>> Weston complaining that the extenstion does not exist in the old 
>>>> binary DDK.
>>>> Since I haven't seen this failure with the updated Mesa-based 
>>>> graphics stack,
>>>> I assumed that is now resolved.
>>>>
>>>> My testing was mostly with Rogue and I see in the commit log that 
>>>> this is
>>>> specific to SGX, which currently builds full software-rendering 
>>>> stack w/o any
>>>> HW acceleration.
>>>>
>>>> Is this extension a pure software implementation in Mesa or does it 
>>>> require
>>>> corresponding HW support? If the latter, then we definitely still 
>>>> need this
>>>> revert and my patch removing it can be dropped.
>>>>
>>>
>>> Unfortunately it needs to be handled in the GPU driver on the UM 
>>> side, so
>>> not something Mesa can fix for us. And the error only shows up as a 
>>> runtime
>>> issue when you try to start Weston and it sees the extension is not 
>>> available.
>>>
>>> We will need to keep this patch until someone can add the software 
>>> emulation
>>> of this function inside the SGX UM driver. It is on my todo list for 
>>> someday..
>>
>> Andrew,
>>
>> Thanks for confirming.
>>
>> Ryan,
>>
>> We still need Andrew's revert, please drop my patch from the queue. 
>> Thanks.
> 
> Roger that.
> 
>
Randolph Sapp March 3, 2023, 9:11 p.m. UTC | #7
If SGX patches are stalling builds drop them. I'll add them back in 
when we get SGX fully functional. I don't see all of these patches 
being necessary now that my pvr-dri work has been approved. It'll make 
more sense to pull them as we need them later.

On Wed, Mar 1 2023 at 13:27:34 -06:00:00, Ryan Eatmon via 
lists.yoctoproject.org <reatmon=ti.com@lists.yoctoproject.org> wrote:
> 
> And now for a fun development, the patch in question no longer 
> applies cleanly on master...
> 
> 
> On 3/1/2023 8:56 AM, Ryan Eatmon via lists.yoctoproject.org wrote:
>> 
>> 
>> On 2/28/2023 6:15 PM, Denys Dmytriyenko wrote:
>>> On Tue, Feb 28, 2023 at 05:57:40PM -0600, Andrew Davis wrote:
>>>> On 2/28/23 5:29 PM, Denys Dmytriyenko wrote:
>>>>> On Fri, Feb 24, 2023 at 08:16:25AM -0600, Andrew Davis via 
>>>>> lists.yoctoproject.org wrote:
>>>>>> On 2/24/23 4:12 AM, Denys Dmytriyenko wrote:
>>>>>>> From: Denys Dmytriyenko <denys@konsulko.com 
>>>>>>> <mailto:denys@konsulko.com>>
>>>>>>> 
>>>>>>> With the updated graphics recipes in meta-ti this hack is no 
>>>>>>> longer needed.
>>>>>> 
>>>>>> Did you test that? What board and with what program?
>>>>> 
>>>>> If I remember correctly, there was a build failure in the past 
>>>>> with newer
>>>>> Weston complaining that the extenstion does not exist in the old 
>>>>> binary DDK.
>>>>> Since I haven't seen this failure with the updated Mesa-based 
>>>>> graphics stack,
>>>>> I assumed that is now resolved.
>>>>> 
>>>>> My testing was mostly with Rogue and I see in the commit log that 
>>>>> this is
>>>>> specific to SGX, which currently builds full software-rendering 
>>>>> stack w/o any
>>>>> HW acceleration.
>>>>> 
>>>>> Is this extension a pure software implementation in Mesa or does 
>>>>> it require
>>>>> corresponding HW support? If the latter, then we definitely still 
>>>>> need this
>>>>> revert and my patch removing it can be dropped.
>>>>> 
>>>> 
>>>> Unfortunately it needs to be handled in the GPU driver on the UM 
>>>> side, so
>>>> not something Mesa can fix for us. And the error only shows up as 
>>>> a runtime
>>>> issue when you try to start Weston and it sees the extension is 
>>>> not available.
>>>> 
>>>> We will need to keep this patch until someone can add the software 
>>>> emulation
>>>> of this function inside the SGX UM driver. It is on my todo list 
>>>> for someday..
>>> 
>>> Andrew,
>>> 
>>> Thanks for confirming.
>>> 
>>> Ryan,
>>> 
>>> We still need Andrew's revert, please drop my patch from the queue. 
>>> Thanks.
>> 
>> Roger that.
>> 
>> 
> 
> --
> Ryan Eatmon                reatmon@ti.com <mailto:reatmon@ti.com>
> -----------------------------------------
> Texas Instruments, Inc.  -  LCPD  -  MGTS
> 
> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#14242): 
> <https://lists.yoctoproject.org/g/meta-arago/message/14242>
> Mute This Topic: <https://lists.yoctoproject.org/mt/97203204/7094281>
> Group Owner: meta-arago+owner@lists.yoctoproject.org 
> <mailto:meta-arago+owner@lists.yoctoproject.org>
> Unsubscribe: 
> <https://lists.yoctoproject.org/g/meta-arago/leave/11554122/7094281/459377185/xyzzy> 
> [rs@ti.com <mailto:rs@ti.com>]
> -=-=-=-=-=-=-=-=-=-=-=-
> 
>
diff mbox series

Patch

diff --git a/meta-arago-distro/recipes-graphics/wayland/weston/0001-Revert-require-GL_EXT_unpack_subimage-commit.patch b/meta-arago-distro/recipes-graphics/wayland/weston/0001-Revert-require-GL_EXT_unpack_subimage-commit.patch
deleted file mode 100644
index 8b03ddd6..00000000
--- a/meta-arago-distro/recipes-graphics/wayland/weston/0001-Revert-require-GL_EXT_unpack_subimage-commit.patch
+++ /dev/null
@@ -1,90 +0,0 @@ 
-From 6558a9153cc81199146132041c61023a2c2e1b2e Mon Sep 17 00:00:00 2001
-From: Andrew Davis <afd@ti.com>
-Date: Thu, 6 Oct 2022 15:49:31 -0500
-Subject: [PATCH] Revert require GL_EXT_unpack_subimage commit
-
-This reverts commit 593d5af43a8e2c2a3371088fa7ae430d0517c82d.
-
-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.
-
-Signed-off-by: Andrew Davis <afd@ti.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
---- a/libweston/renderer-gl/gl-renderer-internal.h
-+++ b/libweston/renderer-gl/gl-renderer-internal.h
-@@ -133,6 +133,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;
-diff --git a/libweston/renderer-gl/gl-renderer.c b/libweston/renderer-gl/gl-renderer.c
-index a5f5eae4..410ba85c 100644
---- a/libweston/renderer-gl/gl-renderer.c
-+++ b/libweston/renderer-gl/gl-renderer.c
-@@ -1835,6 +1835,7 @@ gl_renderer_flush_damage(struct weston_surface *surface)
- {
-	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 weston_buffer *buffer = gs->buffer_ref.buffer;
-	struct weston_view *view;
-@@ -1872,6 +1873,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->num_textures; j++) {
-+			glBindTexture(GL_TEXTURE_2D, gs->textures[j]);
-+			glTexImage2D(GL_TEXTURE_2D, 0,
-+				     gs->gl_format[j],
-+				     gs->pitch / gs->hsub[j],
-+				     buffer->height / gs->vsub[j],
-+				     0,
-+				     gl_format_from_internal(gs->gl_format[j]),
-+				     gs->gl_pixel_type,
-+				     data + gs->offset[j]);
-+		}
-+		wl_shm_buffer_end_access(buffer->shm_buffer);
-+
-+		goto done;
-+	}
-+
-	if (gs->needs_full_upload || quirks->gl_force_full_upload) {
-		glPixelStorei(GL_UNPACK_SKIP_PIXELS_EXT, 0);
-		glPixelStorei(GL_UNPACK_SKIP_ROWS_EXT, 0);
-@@ -3932,11 +3951,9 @@ gl_renderer_setup(struct weston_compositor *ec, EGLSurface egl_surface)
-	else
-		ec->read_format = 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");
--		return -1;
--	}
-+	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"))
-@@ -3977,6 +3994,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 == PIXMAN_a8r8g8b8 ? "BGRA" : "RGBA");
-+	weston_log_continue(STAMP_SPACE "wl_shm sub-image to texture: %s\n",
-+			    gr->has_unpack_subimage ? "yes" : "no");
-	weston_log_continue(STAMP_SPACE "EGL Wayland extension: %s\n",
-			    gr->has_bind_display ? "yes" : "no");
diff --git a/meta-arago-distro/recipes-graphics/wayland/weston_10.0.2.bbappend b/meta-arago-distro/recipes-graphics/wayland/weston_10.0.2.bbappend
index b1b7d26a..dd893f1e 100644
--- a/meta-arago-distro/recipes-graphics/wayland/weston_10.0.2.bbappend
+++ b/meta-arago-distro/recipes-graphics/wayland/weston_10.0.2.bbappend
@@ -7,5 +7,4 @@  SRC_URI += " \
         file://0003-weston-Fix-virtual-keyboard-display-issue-for-QT5-ap.patch \
         file://0004-weston-Fix-touch-screen-crash-issue.patch \
         file://0001-backend-drm-Select-plane-based-on-current-attached-C.patch \
-        file://0001-Revert-require-GL_EXT_unpack_subimage-commit.patch \
 "