diff mbox series

[meta-arago,master/kirkstone] weston: update bbappend 9.0.0 -> 10.0.2

Message ID 20230104190739.27676-1-afd@ti.com
State Accepted
Delegated to: Ryan Eatmon
Headers show
Series [meta-arago,master/kirkstone] weston: update bbappend 9.0.0 -> 10.0.2 | expand

Commit Message

Andrew Davis Jan. 4, 2023, 7:07 p.m. UTC
To match upstream oe-core/master.

Signed-off-by: Andrew Davis <afd@ti.com>
---
 ...equire-GL_EXT_unpack_subimage-commit.patch | 91 +++++++++++++++++++
 ...ct-plane-based-on-current-attached-C.patch | 52 +++++------
 ..._9.0.0.bbappend => weston_10.0.2.bbappend} |  3 +-
 3 files changed, 115 insertions(+), 31 deletions(-)
 create mode 100644 meta-arago-distro/recipes-graphics/wayland/weston/0001-Revert-require-GL_EXT_unpack_subimage-commit.patch
 rename meta-arago-distro/recipes-graphics/wayland/{weston_9.0.0.bbappend => weston_10.0.2.bbappend} (78%)

Comments

Denys Dmytriyenko Jan. 4, 2023, 9:07 p.m. UTC | #1
On Wed, Jan 04, 2023 at 01:07:39PM -0600, Andrew Davis via lists.yoctoproject.org wrote:
> To match upstream oe-core/master.
> 
> Signed-off-by: Andrew Davis <afd@ti.com>
> ---
>  ...equire-GL_EXT_unpack_subimage-commit.patch | 91 +++++++++++++++++++
>  ...ct-plane-based-on-current-attached-C.patch | 52 +++++------
>  ..._9.0.0.bbappend => weston_10.0.2.bbappend} |  3 +-
>  3 files changed, 115 insertions(+), 31 deletions(-)
>  create mode 100644 meta-arago-distro/recipes-graphics/wayland/weston/0001-Revert-require-GL_EXT_unpack_subimage-commit.patch
>  rename meta-arago-distro/recipes-graphics/wayland/{weston_9.0.0.bbappend => weston_10.0.2.bbappend} (78%)
> 
> 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
> new file mode 100644
> index 00000000..8bc882fb
> --- /dev/null
> +++ b/meta-arago-distro/recipes-graphics/wayland/weston/0001-Revert-require-GL_EXT_unpack_subimage-commit.patch
> @@ -0,0 +1,91 @@
> +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.

The obvious question - how safe is it to assume GL_EXT_unpack_subimage is 
not being used some place else outside of this commit and not guarded by:

if (!gr->has_unpack_subimage)


Is this extention really in the driver, or just in a Mesa API translation 
layer? Could it be better fixed in the DDK?
Andrew Davis Jan. 4, 2023, 10:15 p.m. UTC | #2
On 1/4/23 3:07 PM, Denys Dmytriyenko wrote:
> On Wed, Jan 04, 2023 at 01:07:39PM -0600, Andrew Davis via lists.yoctoproject.org wrote:
>> To match upstream oe-core/master.
>>
>> Signed-off-by: Andrew Davis <afd@ti.com>
>> ---
>>   ...equire-GL_EXT_unpack_subimage-commit.patch | 91 +++++++++++++++++++
>>   ...ct-plane-based-on-current-attached-C.patch | 52 +++++------
>>   ..._9.0.0.bbappend => weston_10.0.2.bbappend} |  3 +-
>>   3 files changed, 115 insertions(+), 31 deletions(-)
>>   create mode 100644 meta-arago-distro/recipes-graphics/wayland/weston/0001-Revert-require-GL_EXT_unpack_subimage-commit.patch
>>   rename meta-arago-distro/recipes-graphics/wayland/{weston_9.0.0.bbappend => weston_10.0.2.bbappend} (78%)
>>
>> 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
>> new file mode 100644
>> index 00000000..8bc882fb
>> --- /dev/null
>> +++ b/meta-arago-distro/recipes-graphics/wayland/weston/0001-Revert-require-GL_EXT_unpack_subimage-commit.patch
>> @@ -0,0 +1,91 @@
>> +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.
> 
> The obvious question - how safe is it to assume GL_EXT_unpack_subimage is
> not being used some place else outside of this commit and not guarded by:
> 
> if (!gr->has_unpack_subimage)
> 
> 
> Is this extention really in the driver, or just in a Mesa API translation
> layer? Could it be better fixed in the DDK?
> 

You are right, it is not a very safe assumption, this patch is almost certainly
not complete for all cases. And even if it was, it only fixes Weston, others like
wlroots have the same issues[0], so other compositors are going to be broken too.

Long term this extension will need added to the driver. Unfortunately all work on
keeping this driver alive is unofficial, and I just don't have the free time to
add and test new extensions right now :(

Andrew

[0] https://github.com/tmlind/wlroots/commit/04491889240bbadb693aa37036dc55835118b2cc
Denys Dmytriyenko Jan. 18, 2023, 9:50 p.m. UTC | #3
On Wed, Jan 04, 2023 at 04:15:44PM -0600, Andrew Davis via lists.yoctoproject.org wrote:
> On 1/4/23 3:07 PM, Denys Dmytriyenko wrote:
> >On Wed, Jan 04, 2023 at 01:07:39PM -0600, Andrew Davis via lists.yoctoproject.org wrote:
> >>To match upstream oe-core/master.
> >>
> >>Signed-off-by: Andrew Davis <afd@ti.com>
> >>---
> >>  ...equire-GL_EXT_unpack_subimage-commit.patch | 91 +++++++++++++++++++
> >>  ...ct-plane-based-on-current-attached-C.patch | 52 +++++------
> >>  ..._9.0.0.bbappend => weston_10.0.2.bbappend} |  3 +-
> >>  3 files changed, 115 insertions(+), 31 deletions(-)
> >>  create mode 100644 meta-arago-distro/recipes-graphics/wayland/weston/0001-Revert-require-GL_EXT_unpack_subimage-commit.patch
> >>  rename meta-arago-distro/recipes-graphics/wayland/{weston_9.0.0.bbappend => weston_10.0.2.bbappend} (78%)
> >>
> >>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
> >>new file mode 100644
> >>index 00000000..8bc882fb
> >>--- /dev/null
> >>+++ b/meta-arago-distro/recipes-graphics/wayland/weston/0001-Revert-require-GL_EXT_unpack_subimage-commit.patch
> >>@@ -0,0 +1,91 @@
> >>+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.
> >
> >The obvious question - how safe is it to assume GL_EXT_unpack_subimage is
> >not being used some place else outside of this commit and not guarded by:
> >
> >if (!gr->has_unpack_subimage)
> >
> >
> >Is this extention really in the driver, or just in a Mesa API translation
> >layer? Could it be better fixed in the DDK?
> >
> 
> You are right, it is not a very safe assumption, this patch is almost certainly
> not complete for all cases. And even if it was, it only fixes Weston, others like
> wlroots have the same issues[0], so other compositors are going to be broken too.
> 
> Long term this extension will need added to the driver. Unfortunately all work on
> keeping this driver alive is unofficial, and I just don't have the free time to
> add and test new extensions right now :(
> 
> Andrew
> 
> [0] https://github.com/tmlind/wlroots/commit/04491889240bbadb693aa37036dc55835118b2cc

Ryan,

I see you are pulling this patch to the WIP branches - what's the consensus 
here? As discussed, this is a very partial solution. Moreover, it only "fixes" 
meta-arago, so won't help people using just meta-ti with other distros...
Andrew Davis Jan. 18, 2023, 10:34 p.m. UTC | #4
On 1/18/23 3:50 PM, Denys Dmytriyenko wrote:
> On Wed, Jan 04, 2023 at 04:15:44PM -0600, Andrew Davis via lists.yoctoproject.org wrote:
>> On 1/4/23 3:07 PM, Denys Dmytriyenko wrote:
>>> On Wed, Jan 04, 2023 at 01:07:39PM -0600, Andrew Davis via lists.yoctoproject.org wrote:
>>>> To match upstream oe-core/master.
>>>>
>>>> Signed-off-by: Andrew Davis <afd@ti.com>
>>>> ---
>>>>   ...equire-GL_EXT_unpack_subimage-commit.patch | 91 +++++++++++++++++++
>>>>   ...ct-plane-based-on-current-attached-C.patch | 52 +++++------
>>>>   ..._9.0.0.bbappend => weston_10.0.2.bbappend} |  3 +-
>>>>   3 files changed, 115 insertions(+), 31 deletions(-)
>>>>   create mode 100644 meta-arago-distro/recipes-graphics/wayland/weston/0001-Revert-require-GL_EXT_unpack_subimage-commit.patch
>>>>   rename meta-arago-distro/recipes-graphics/wayland/{weston_9.0.0.bbappend => weston_10.0.2.bbappend} (78%)
>>>>
>>>> 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
>>>> new file mode 100644
>>>> index 00000000..8bc882fb
>>>> --- /dev/null
>>>> +++ b/meta-arago-distro/recipes-graphics/wayland/weston/0001-Revert-require-GL_EXT_unpack_subimage-commit.patch
>>>> @@ -0,0 +1,91 @@
>>>> +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.
>>>
>>> The obvious question - how safe is it to assume GL_EXT_unpack_subimage is
>>> not being used some place else outside of this commit and not guarded by:
>>>
>>> if (!gr->has_unpack_subimage)
>>>
>>>
>>> Is this extention really in the driver, or just in a Mesa API translation
>>> layer? Could it be better fixed in the DDK?
>>>
>>
>> You are right, it is not a very safe assumption, this patch is almost certainly
>> not complete for all cases. And even if it was, it only fixes Weston, others like
>> wlroots have the same issues[0], so other compositors are going to be broken too.
>>
>> Long term this extension will need added to the driver. Unfortunately all work on
>> keeping this driver alive is unofficial, and I just don't have the free time to
>> add and test new extensions right now :(
>>
>> Andrew
>>
>> [0] https://github.com/tmlind/wlroots/commit/04491889240bbadb693aa37036dc55835118b2cc
> 
> Ryan,
> 
> I see you are pulling this patch to the WIP branches - what's the consensus
> here? As discussed, this is a very partial solution. Moreover, it only "fixes"
> meta-arago, so won't help people using just meta-ti with other distros...
> 

Partial solution is better than no solution, right? Today even *with* meta-arago
your images will have broken graphics, at least with this we can start building
and testing some part of the graphics stack kirkstone.

(I don't like half-measures either, but it's all I have today)

Andrew
Denys Dmytriyenko Jan. 19, 2023, 10:58 p.m. UTC | #5
On Wed, Jan 18, 2023 at 04:34:00PM -0600, Andrew Davis via lists.yoctoproject.org wrote:
> On 1/18/23 3:50 PM, Denys Dmytriyenko wrote:
> >On Wed, Jan 04, 2023 at 04:15:44PM -0600, Andrew Davis via lists.yoctoproject.org wrote:
> >>On 1/4/23 3:07 PM, Denys Dmytriyenko wrote:
> >>>On Wed, Jan 04, 2023 at 01:07:39PM -0600, Andrew Davis via lists.yoctoproject.org wrote:
> >>>>To match upstream oe-core/master.
> >>>>
> >>>>Signed-off-by: Andrew Davis <afd@ti.com>
> >>>>---
> >>>>  ...equire-GL_EXT_unpack_subimage-commit.patch | 91 +++++++++++++++++++
> >>>>  ...ct-plane-based-on-current-attached-C.patch | 52 +++++------
> >>>>  ..._9.0.0.bbappend => weston_10.0.2.bbappend} |  3 +-
> >>>>  3 files changed, 115 insertions(+), 31 deletions(-)
> >>>>  create mode 100644 meta-arago-distro/recipes-graphics/wayland/weston/0001-Revert-require-GL_EXT_unpack_subimage-commit.patch
> >>>>  rename meta-arago-distro/recipes-graphics/wayland/{weston_9.0.0.bbappend => weston_10.0.2.bbappend} (78%)
> >>>>
> >>>>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
> >>>>new file mode 100644
> >>>>index 00000000..8bc882fb
> >>>>--- /dev/null
> >>>>+++ b/meta-arago-distro/recipes-graphics/wayland/weston/0001-Revert-require-GL_EXT_unpack_subimage-commit.patch
> >>>>@@ -0,0 +1,91 @@
> >>>>+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.
> >>>
> >>>The obvious question - how safe is it to assume GL_EXT_unpack_subimage is
> >>>not being used some place else outside of this commit and not guarded by:
> >>>
> >>>if (!gr->has_unpack_subimage)
> >>>
> >>>
> >>>Is this extention really in the driver, or just in a Mesa API translation
> >>>layer? Could it be better fixed in the DDK?
> >>>
> >>
> >>You are right, it is not a very safe assumption, this patch is almost certainly
> >>not complete for all cases. And even if it was, it only fixes Weston, others like
> >>wlroots have the same issues[0], so other compositors are going to be broken too.
> >>
> >>Long term this extension will need added to the driver. Unfortunately all work on
> >>keeping this driver alive is unofficial, and I just don't have the free time to
> >>add and test new extensions right now :(
> >>
> >>Andrew
> >>
> >>[0] https://github.com/tmlind/wlroots/commit/04491889240bbadb693aa37036dc55835118b2cc
> >
> >Ryan,
> >
> >I see you are pulling this patch to the WIP branches - what's the consensus
> >here? As discussed, this is a very partial solution. Moreover, it only "fixes"
> >meta-arago, so won't help people using just meta-ti with other distros...
> >
> 
> Partial solution is better than no solution, right? Today even *with* meta-arago
> your images will have broken graphics, at least with this we can start building
> and testing some part of the graphics stack kirkstone.
> 
> (I don't like half-measures either, but it's all I have today)

Ok, sounds fair... Next question - was it tested and is it supposed to 
build/work? Or is it again a maintainers' problem? :)
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
new file mode 100644
index 00000000..8bc882fb
--- /dev/null
+++ b/meta-arago-distro/recipes-graphics/wayland/weston/0001-Revert-require-GL_EXT_unpack_subimage-commit.patch
@@ -0,0 +1,91 @@ 
+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/0001-backend-drm-Select-plane-based-on-current-attached-C.patch b/meta-arago-distro/recipes-graphics/wayland/weston/0001-backend-drm-Select-plane-based-on-current-attached-C.patch
index ef445797..76569645 100644
--- a/meta-arago-distro/recipes-graphics/wayland/weston/0001-backend-drm-Select-plane-based-on-current-attached-C.patch
+++ b/meta-arago-distro/recipes-graphics/wayland/weston/0001-backend-drm-Select-plane-based-on-current-attached-C.patch
@@ -1,5 +1,5 @@ 
-From 943323d177ef33494d9d063aeb7f0e9785d9b3c1 Mon Sep 17 00:00:00 2001
-From: "Andrew F. Davis" <afd@ti.com>
+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
 
@@ -11,45 +11,37 @@  This prevents changing a CRTC's primary plane when it is active
 which is not allowed by the DRM framework.
 
 Based-on-patch-by: Eric Ruei <e-ruei1@ti.com>
-Signed-off-by: Andrew F. Davis <afd@ti.com>
+Signed-off-by: Andrew Davis <afd@ti.com>
 ---
- libweston/backend-drm/drm-internal.h |  1 +
- libweston/backend-drm/drm.c          | 10 ++++++++++
- 2 files changed, 11 insertions(+)
+ 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 6f5a9880..65b7486d 100644
+index 48600880..b381ca31 100644
 --- a/libweston/backend-drm/drm-internal.h
 +++ b/libweston/backend-drm/drm-internal.h
-@@ -398,6 +398,7 @@ struct drm_plane {
- 
+@@ -468,6 +468,7 @@ struct drm_plane {
  	uint32_t possible_crtcs;
  	uint32_t plane_id;
+ 	uint32_t plane_idx;
 +	uint32_t crtc_id;
- 	uint32_t count_formats;
  
  	struct drm_property_info props[WDRM_PLANE__COUNT];
+ 
 diff --git a/libweston/backend-drm/drm.c b/libweston/backend-drm/drm.c
-index 041a15a5..544b1aff 100644
+index 42787702..b5b7c4ba 100644
 --- a/libweston/backend-drm/drm.c
 +++ b/libweston/backend-drm/drm.c
-@@ -819,6 +819,7 @@ drm_plane_create(struct drm_backend *b, const drmModePlane *kplane,
- 	if (kplane) {
- 		plane->possible_crtcs = kplane->possible_crtcs;
- 		plane->plane_id = kplane->plane_id;
-+		plane->crtc_id = kplane->crtc_id;
+@@ -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);
  
- 		props = drmModeObjectGetProperties(b->drm.fd, kplane->plane_id,
- 						   DRM_MODE_OBJECT_PLANE);
-@@ -843,6 +844,7 @@ drm_plane_create(struct drm_backend *b, const drmModePlane *kplane,
- 	else {
- 		plane->possible_crtcs = (1 << output->pipe);
- 		plane->plane_id = 0;
-+		plane->crtc_id = 0;
- 		plane->count_formats = 1;
- 		plane->formats[0].format = format;
- 		plane->type = type;
-@@ -950,6 +952,14 @@ drm_output_find_special_plane(struct drm_backend *b, struct drm_output *output,
+@@ -866,6 +867,14 @@ drm_output_find_special_plane(struct drm_backend *b, struct drm_output *output,
  		if (found_elsewhere)
  			continue;
  
@@ -58,12 +50,12 @@  index 041a15a5..544b1aff 100644
 +		 * switch away a plane from a CTRC when active. */
 +		if ((type == WDRM_PLANE_TYPE_PRIMARY) &&
 +		    (plane->crtc_id != 0) &&
-+		    (plane->crtc_id != output->crtc_id))
++		    (plane->crtc_id != output->crtc->crtc_id))
 +			continue;
 +
- 		plane->possible_crtcs = (1 << output->pipe);
+ 		plane->possible_crtcs = (1 << output->crtc->pipe);
  		return plane;
  	}
 -- 
-2.17.1
+2.38.1
 
diff --git a/meta-arago-distro/recipes-graphics/wayland/weston_9.0.0.bbappend b/meta-arago-distro/recipes-graphics/wayland/weston_10.0.2.bbappend
similarity index 78%
rename from meta-arago-distro/recipes-graphics/wayland/weston_9.0.0.bbappend
rename to meta-arago-distro/recipes-graphics/wayland/weston_10.0.2.bbappend
index 804507e3..b1b7d26a 100644
--- a/meta-arago-distro/recipes-graphics/wayland/weston_9.0.0.bbappend
+++ b/meta-arago-distro/recipes-graphics/wayland/weston_10.0.2.bbappend
@@ -1,10 +1,11 @@ 
 FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
 
-PR:append = ".arago3"
+PR:append = ".arago1"
 
 #        file://0002-weston-Allow-visual_id-to-be-0.patch
 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 \
 "