Re: [Mesa-dev] [PATCH] egl/wayland: Ignore rects from SwapBuffersWithDamage

2015-11-13 Thread Daniel Stone
On 12 November 2015 at 16:47, Jason Ekstrand  wrote:
> On Thu, Nov 12, 2015 at 6:46 AM, Pekka Paalanen  wrote:
>> Reviewed-by: Pekka Paalanen 
>>
>> Perhaps a TODO comment referring to
>> https://bugs.freedesktop.org/show_bug.cgi?id=78190
>> would be nice.
>
> Yes, that would be good.  One day, we need to add a
> wl_surface.buffer_damage request.  I blame Kristian for that not
> happening.  I was working on that almost two years ago when he
> co-opted me to work on drivers. :-P
>
> Reviewed-by: Jason Ekstrand 

Ha. Thanks both for review; pushed now as d1314de.

Emil, this would make a good stable candidate.

Cheers,
Daniel
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] egl/wayland: Ignore rects from SwapBuffersWithDamage

2015-11-12 Thread Pekka Paalanen
On Sat,  7 Nov 2015 18:34:20 +
Daniel Stone  wrote:

> eglSwapBuffersWithDamage accepts damage-region rectangles to hint the
> compositor that it only needs to redraw certain areas, which was passed
> through the wl_surface_damage request, as designed.
> 
> Wayland also offers a buffer transformation interface, e.g. to allow
> users to render pre-rotated buffers. Unfortunately, there is no way to
> query buffer transforms, and the damage region was provided in surface,
> rather than buffer, co-ordinate space.
> 
> Users could perhaps account for this themselves, but EGL also requires
> co-ordinates to be passed in GL/mathematical co-ordinate space, with an
> inversion to Wayland's natural/scanout co-orodinate space, so the
> transformation is so convoluted that it's unreasonable to expect anyone
> to do it.
> 
> Pending creation and acceptance of a wl_surface.buffer_damage request,
> which will accept co-ordinates in buffer co-ordinate space, pessimise to
> always sending full-surface damage.
> 
> bce64c6c provides the explanation for why we send maximum-range damage,
> rather than the full size of the surface: in the presence of buffer
> transformations, full-surface damage may not actually cover the entire
> surface.
> 
> Signed-off-by: Daniel Stone 
> Cc: Jasper St. Pierre 
> ---
>  src/egl/drivers/dri2/platform_wayland.c | 14 ++
>  1 file changed, 2 insertions(+), 12 deletions(-)
> 
> diff --git a/src/egl/drivers/dri2/platform_wayland.c 
> b/src/egl/drivers/dri2/platform_wayland.c
> index 0d161f6..9e8e6ce 100644
> --- a/src/egl/drivers/dri2/platform_wayland.c
> +++ b/src/egl/drivers/dri2/platform_wayland.c
> @@ -703,18 +703,8 @@ dri2_wl_swap_buffers_with_damage(_EGLDriver *drv,
> dri2_surf->dx = 0;
> dri2_surf->dy = 0;
>  
> -   if (n_rects == 0) {
> -  wl_surface_damage(dri2_surf->wl_win->surface,
> -0, 0, INT32_MAX, INT32_MAX);
> -   } else {
> -  for (i = 0; i < n_rects; i++) {
> - const int *rect = [i * 4];
> - wl_surface_damage(dri2_surf->wl_win->surface,
> -   rect[0],
> -   dri2_surf->base.Height - rect[1] - rect[3],
> -   rect[2], rect[3]);
> -  }
> -   }
> +wl_surface_damage(dri2_surf->wl_win->surface,
> +  0, 0, INT32_MAX, INT32_MAX);
>  
> if (dri2_dpy->is_different_gpu) {
>_EGLContext *ctx = _eglGetCurrentContext();

One space too much of indent?

Reviewed-by: Pekka Paalanen 

Perhaps a TODO comment referring to
https://bugs.freedesktop.org/show_bug.cgi?id=78190
would be nice.


Thanks,
pq


signature.asc
Description: PGP signature
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH] egl/wayland: Ignore rects from SwapBuffersWithDamage

2015-11-12 Thread Jason Ekstrand
On Thu, Nov 12, 2015 at 6:46 AM, Pekka Paalanen  wrote:
> On Sat,  7 Nov 2015 18:34:20 +
> Daniel Stone  wrote:
>
>> eglSwapBuffersWithDamage accepts damage-region rectangles to hint the
>> compositor that it only needs to redraw certain areas, which was passed
>> through the wl_surface_damage request, as designed.
>>
>> Wayland also offers a buffer transformation interface, e.g. to allow
>> users to render pre-rotated buffers. Unfortunately, there is no way to
>> query buffer transforms, and the damage region was provided in surface,
>> rather than buffer, co-ordinate space.
>>
>> Users could perhaps account for this themselves, but EGL also requires
>> co-ordinates to be passed in GL/mathematical co-ordinate space, with an
>> inversion to Wayland's natural/scanout co-orodinate space, so the
>> transformation is so convoluted that it's unreasonable to expect anyone
>> to do it.
>>
>> Pending creation and acceptance of a wl_surface.buffer_damage request,
>> which will accept co-ordinates in buffer co-ordinate space, pessimise to
>> always sending full-surface damage.
>>
>> bce64c6c provides the explanation for why we send maximum-range damage,
>> rather than the full size of the surface: in the presence of buffer
>> transformations, full-surface damage may not actually cover the entire
>> surface.
>>
>> Signed-off-by: Daniel Stone 
>> Cc: Jasper St. Pierre 
>> ---
>>  src/egl/drivers/dri2/platform_wayland.c | 14 ++
>>  1 file changed, 2 insertions(+), 12 deletions(-)
>>
>> diff --git a/src/egl/drivers/dri2/platform_wayland.c 
>> b/src/egl/drivers/dri2/platform_wayland.c
>> index 0d161f6..9e8e6ce 100644
>> --- a/src/egl/drivers/dri2/platform_wayland.c
>> +++ b/src/egl/drivers/dri2/platform_wayland.c
>> @@ -703,18 +703,8 @@ dri2_wl_swap_buffers_with_damage(_EGLDriver *drv,
>> dri2_surf->dx = 0;
>> dri2_surf->dy = 0;
>>
>> -   if (n_rects == 0) {
>> -  wl_surface_damage(dri2_surf->wl_win->surface,
>> -0, 0, INT32_MAX, INT32_MAX);
>> -   } else {
>> -  for (i = 0; i < n_rects; i++) {
>> - const int *rect = [i * 4];
>> - wl_surface_damage(dri2_surf->wl_win->surface,
>> -   rect[0],
>> -   dri2_surf->base.Height - rect[1] - rect[3],
>> -   rect[2], rect[3]);
>> -  }
>> -   }
>> +wl_surface_damage(dri2_surf->wl_win->surface,
>> +  0, 0, INT32_MAX, INT32_MAX);
>>
>> if (dri2_dpy->is_different_gpu) {
>>_EGLContext *ctx = _eglGetCurrentContext();
>
> One space too much of indent?
>
> Reviewed-by: Pekka Paalanen 
>
> Perhaps a TODO comment referring to
> https://bugs.freedesktop.org/show_bug.cgi?id=78190
> would be nice.

Yes, that would be good.  One day, we need to add a
wl_surface.buffer_damage request.  I blame Kristian for that not
happening.  I was working on that almost two years ago when he
co-opted me to work on drivers. :-P

Reviewed-by: Jason Ekstrand 
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH] egl/wayland: Ignore rects from SwapBuffersWithDamage

2015-11-07 Thread Daniel Stone
eglSwapBuffersWithDamage accepts damage-region rectangles to hint the
compositor that it only needs to redraw certain areas, which was passed
through the wl_surface_damage request, as designed.

Wayland also offers a buffer transformation interface, e.g. to allow
users to render pre-rotated buffers. Unfortunately, there is no way to
query buffer transforms, and the damage region was provided in surface,
rather than buffer, co-ordinate space.

Users could perhaps account for this themselves, but EGL also requires
co-ordinates to be passed in GL/mathematical co-ordinate space, with an
inversion to Wayland's natural/scanout co-orodinate space, so the
transformation is so convoluted that it's unreasonable to expect anyone
to do it.

Pending creation and acceptance of a wl_surface.buffer_damage request,
which will accept co-ordinates in buffer co-ordinate space, pessimise to
always sending full-surface damage.

bce64c6c provides the explanation for why we send maximum-range damage,
rather than the full size of the surface: in the presence of buffer
transformations, full-surface damage may not actually cover the entire
surface.

Signed-off-by: Daniel Stone 
Cc: Jasper St. Pierre 
---
 src/egl/drivers/dri2/platform_wayland.c | 14 ++
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/src/egl/drivers/dri2/platform_wayland.c 
b/src/egl/drivers/dri2/platform_wayland.c
index 0d161f6..9e8e6ce 100644
--- a/src/egl/drivers/dri2/platform_wayland.c
+++ b/src/egl/drivers/dri2/platform_wayland.c
@@ -703,18 +703,8 @@ dri2_wl_swap_buffers_with_damage(_EGLDriver *drv,
dri2_surf->dx = 0;
dri2_surf->dy = 0;
 
-   if (n_rects == 0) {
-  wl_surface_damage(dri2_surf->wl_win->surface,
-0, 0, INT32_MAX, INT32_MAX);
-   } else {
-  for (i = 0; i < n_rects; i++) {
- const int *rect = [i * 4];
- wl_surface_damage(dri2_surf->wl_win->surface,
-   rect[0],
-   dri2_surf->base.Height - rect[1] - rect[3],
-   rect[2], rect[3]);
-  }
-   }
+wl_surface_damage(dri2_surf->wl_win->surface,
+  0, 0, INT32_MAX, INT32_MAX);
 
if (dri2_dpy->is_different_gpu) {
   _EGLContext *ctx = _eglGetCurrentContext();
-- 
2.5.0

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev