diff options
author | Rob Clark <robdclark@chromium.org> | 2023-03-29 14:57:23 -0700 |
---|---|---|
committer | Marge Bot <emma+marge@anholt.net> | 2023-03-30 18:46:04 +0000 |
commit | f9a074dd5506d1e883aa0b3c5f0173a8484bce09 (patch) | |
tree | d3eaf75f0e070858bba3f666f5430eff8d8724ef /src/egl | |
parent | 816f434efc0eaa44f1a0a67b8c789f484eeebad0 (diff) | |
download | mesa-f9a074dd5506d1e883aa0b3c5f0173a8484bce09.tar.gz |
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>
Diffstat (limited to 'src/egl')
-rw-r--r-- | src/egl/drivers/dri2/egl_dri2.c | 11 | ||||
-rw-r--r-- | src/egl/drivers/dri2/egl_dri2.h | 3 | ||||
-rw-r--r-- | src/egl/drivers/dri2/platform_android.c | 2 |
3 files changed, 13 insertions, 3 deletions
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c index b20f2468fb4..0ebc46ee845 100644 --- a/src/egl/drivers/dri2/egl_dri2.c +++ b/src/egl/drivers/dri2/egl_dri2.c @@ -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) { diff --git a/src/egl/drivers/dri2/egl_dri2.h b/src/egl/drivers/dri2/egl_dri2.h index a803a0f229d..0fab2aab157 100644 --- a/src/egl/drivers/dri2/egl_dri2.h +++ b/src/egl/drivers/dri2/egl_dri2.h @@ -606,6 +606,9 @@ 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); const __DRIconfig * diff --git a/src/egl/drivers/dri2/platform_android.c b/src/egl/drivers/dri2/platform_android.c index f5e34ee3824..94327a6e54c 100644 --- a/src/egl/drivers/dri2/platform_android.c +++ b/src/egl/drivers/dri2/platform_android.c @@ -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 |