Re: [Mesa-dev] [PATCH v2 4/8] egl: add dri2_egl_surface_update_buffer_age() helper (v2)

2017-10-19 Thread Emil Velikov
On 18 October 2017 at 23:43, Gurchetan Singh
 wrote:
> The comment "we don't use get_back_bo() since ..." only makes sense in
> context on droid_swap_buffers.  Why aren't you calling this helper in
> dri2_drm_swap_buffers and dri2_wl_swap_buffers_with_damage?  It seems like
> you can.
>
I believe there's a bug in the Android implementation (some braindump
can be found here [1]), that with works around.
I've been meaning to write a patch to address it, but keep on getting
distracted.

Once that is addressed, one should be able to reuse it.

-Emil

[1] https://lists.freedesktop.org/archives/mesa-dev/2017-June/158409.html
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH v2 4/8] egl: add dri2_egl_surface_update_buffer_age() helper (v2)

2017-10-18 Thread Gurchetan Singh
The comment "we don't use get_back_bo() since ..." only makes sense in
context on droid_swap_buffers.  Why aren't you calling this helper
in dri2_drm_swap_buffers and dri2_wl_swap_buffers_with_damage?  It seems
like you can.


On Tue, Oct 17, 2017 at 7:38 AM, Emil Velikov 
wrote:

> On 6 October 2017 at 22:38, Gwan-gyeong Mun  wrote:
> > To share common update buffer age code.
> > This updates old buffer's age and sets current back buffer's age to 1.
> >
> > In preparation to adding of new platform which uses this helper.
> >
> > v2:
> >  - Fixes from Eric's review:
> >a) Split out series of refactor for helpers to a separate series.
> >b) Add the new helper function and use them to replace the old code
> in the
> >   same patch.
> >  - Fixes from Rob's review:
> >Remove unneeded ifdef block
> >
> Reviewed-by: Emil Velikov 
>
> -Emil
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH v2 4/8] egl: add dri2_egl_surface_update_buffer_age() helper (v2)

2017-10-17 Thread Emil Velikov
On 6 October 2017 at 22:38, Gwan-gyeong Mun  wrote:
> To share common update buffer age code.
> This updates old buffer's age and sets current back buffer's age to 1.
>
> In preparation to adding of new platform which uses this helper.
>
> v2:
>  - Fixes from Eric's review:
>a) Split out series of refactor for helpers to a separate series.
>b) Add the new helper function and use them to replace the old code in the
>   same patch.
>  - Fixes from Rob's review:
>Remove unneeded ifdef block
>
Reviewed-by: Emil Velikov 

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


[Mesa-dev] [PATCH v2 4/8] egl: add dri2_egl_surface_update_buffer_age() helper (v2)

2017-10-06 Thread Gwan-gyeong Mun
To share common update buffer age code.
This updates old buffer's age and sets current back buffer's age to 1.

In preparation to adding of new platform which uses this helper.

v2:
 - Fixes from Eric's review:
   a) Split out series of refactor for helpers to a separate series.
   b) Add the new helper function and use them to replace the old code in the
  same patch.
 - Fixes from Rob's review:
   Remove unneeded ifdef block

Signed-off-by: Mun Gwan-gyeong 
---
 src/egl/drivers/dri2/egl_dri2.c | 15 +++
 src/egl/drivers/dri2/egl_dri2.h |  3 +++
 src/egl/drivers/dri2/platform_android.c | 11 +--
 3 files changed, 19 insertions(+), 10 deletions(-)

diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index 3622d18a24..a0f58ca8e4 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -1100,6 +1100,21 @@ 
dri2_egl_surface_record_buffers_and_update_back_buffer(struct dri2_egl_surface *
}
 }
 
+void
+dri2_egl_surface_update_buffer_age(struct dri2_egl_surface *dri2_surf)
+{
+   for (int i = 0; i < ARRAY_SIZE(dri2_surf->color_buffers); i++) {
+  if (dri2_surf->color_buffers[i].age > 0)
+ dri2_surf->color_buffers[i].age++;
+   }
+
+   /* "XXX: we don't use get_back_bo() since it causes regressions in
+* several dEQP tests.
+*/
+   if (dri2_surf->back)
+  dri2_surf->back->age = 1;
+}
+
 /**
  * Called via eglTerminate(), drv->API.Terminate().
  *
diff --git a/src/egl/drivers/dri2/egl_dri2.h b/src/egl/drivers/dri2/egl_dri2.h
index 67d7b7f863..fe3880ef89 100644
--- a/src/egl/drivers/dri2/egl_dri2.h
+++ b/src/egl/drivers/dri2/egl_dri2.h
@@ -468,6 +468,9 @@ void
 dri2_egl_surface_record_buffers_and_update_back_buffer(struct dri2_egl_surface 
*dri2_surf,
void *buffer);
 
+void
+dri2_egl_surface_update_buffer_age(struct dri2_egl_surface *dri2_surf);
+
 EGLBoolean
 dri2_init_surface(_EGLSurface *surf, _EGLDisplay *dpy, EGLint type,
 _EGLConfig *conf, const EGLint *attrib_list, EGLBoolean 
enable_out_fence);
diff --git a/src/egl/drivers/dri2/platform_android.c 
b/src/egl/drivers/dri2/platform_android.c
index 202db9a883..29ee12b140 100644
--- a/src/egl/drivers/dri2/platform_android.c
+++ b/src/egl/drivers/dri2/platform_android.c
@@ -569,16 +569,7 @@ droid_swap_buffers(_EGLDriver *drv, _EGLDisplay *disp, 
_EGLSurface *draw)
if (dri2_surf->base.Type != EGL_WINDOW_BIT)
   return EGL_TRUE;
 
-   for (int i = 0; i < ARRAY_SIZE(dri2_surf->color_buffers); i++) {
-  if (dri2_surf->color_buffers[i].age > 0)
- dri2_surf->color_buffers[i].age++;
-   }
-
-   /* "XXX: we don't use get_back_bo() since it causes regressions in
-* several dEQP tests.
-*/
-   if (dri2_surf->back)
-  dri2_surf->back->age = 1;
+   dri2_egl_surface_update_buffer_age(dri2_surf);
 
dri2_flush_drawable_for_swapbuffers(disp, draw);
 
-- 
2.14.2

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