dri2/android: Bypass throttling

The android window system (SurfaceFlinger, et al) already does it's own
throttling.  Trying to do this also in mesa's egl is counterproductive.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22197>
This commit is contained in:
Rob Clark
2023-03-29 14:57:23 -07:00
committed by Marge Bot
parent 816f434efc
commit f9a074dd55
3 changed files with 13 additions and 3 deletions

View File

@@ -1829,7 +1829,8 @@ dri2_swap_interval(_EGLDisplay *disp, _EGLSurface *surf, EGLint interval)
* do our swapbuffers.
*/
void
dri2_flush_drawable_for_swapbuffers(_EGLDisplay *disp, _EGLSurface *draw)
dri2_flush_drawable_for_swapbuffers_flags(_EGLDisplay *disp, _EGLSurface *draw,
enum __DRI2throttleReason throttle_reason)
{
struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
__DRIdrawable *dri_drawable = dri2_dpy->vtbl->get_dri_drawable(draw);
@@ -1853,13 +1854,19 @@ dri2_flush_drawable_for_swapbuffers(_EGLDisplay *disp, _EGLSurface *draw)
dri_drawable,
__DRI2_FLUSH_DRAWABLE |
__DRI2_FLUSH_INVALIDATE_ANCILLARY,
__DRI2_THROTTLE_SWAPBUFFER);
throttle_reason);
} else {
dri2_dpy->flush->flush(dri_drawable);
}
}
}
void
dri2_flush_drawable_for_swapbuffers(_EGLDisplay *disp, _EGLSurface *draw)
{
dri2_flush_drawable_for_swapbuffers_flags(disp, draw, __DRI2_THROTTLE_SWAPBUFFER);
}
static EGLBoolean
dri2_swap_buffers(_EGLDisplay *disp, _EGLSurface *surf)
{

View File

@@ -605,6 +605,9 @@ dri2_initialize_device(_EGLDisplay *disp);
static inline void
dri2_teardown_device(struct dri2_egl_display *dri2_dpy) { /* noop */ }
void
dri2_flush_drawable_for_swapbuffers_flags(_EGLDisplay *disp, _EGLSurface *draw,
enum __DRI2throttleReason throttle_reason);
void
dri2_flush_drawable_for_swapbuffers(_EGLDisplay *disp, _EGLSurface *draw);

View File

@@ -997,7 +997,7 @@ droid_swap_buffers(_EGLDisplay *disp, _EGLSurface *draw)
if (dri2_surf->back)
dri2_surf->back->age = 1;
dri2_flush_drawable_for_swapbuffers(disp, draw);
dri2_flush_drawable_for_swapbuffers_flags(disp, draw, -1);
/* dri2_surf->buffer can be null even when no error has occured. For
* example, if the user has called no GL rendering commands since the