[Mesa-dev] [PATCH] egl: deduplicate allocations of local buffer over each platform backend (v2)

Tomasz Figa tfiga at chromium.org
Tue Aug 8 03:55:47 UTC 2017


Hi Gwan-gyeong,

On Sat, Aug 5, 2017 at 12:16 AM, Gwan-gyeong Mun <elongbug at gmail.com> wrote:
> platform_drm, platform_wayland and platform_android have similiar local buffer
> allocation routines. For deduplicating, it unifies dri2_egl_surface's
> local buffer allocation routines. And it polishes inconsistent indentations.
>
> Note that as dri2_wl_get_buffers_with_format() have not make a __DRI_BUFFER_BACK_LEFT
> attachment buffer for local_buffers, new helper function, dri2_egl_surface_free_local_buffers(),
> will drop the __DRI_BUFFER_BACK_LEFT check.
> So if other platforms use new helper functions, we have to ensure not to make
> __DRI_BUFFER_BACK_LEFT attachment buffer for local_buffers.
>
> v2: Fixes from Emil's review:
>    a) Make local_buffers variable, dri2_egl_surface_alloc_local_buffer() and
>       dri2_egl_surface_free_local_buffers() unconditionally.
>    b) Preserve the original codeflow for error_path and normal_path.
>    c) Add note on commit messages for dropping of __DRI_BUFFER_BACK_LEFT check.
>    c) Rollback the unrelated whitespace changes.
>    d) Add a missing blank line.
>
> Signed-off-by: Mun Gwan-gyeong <elongbug at gmail.com>
> Reviewed-by: Emil Velikov <emil.velikov at collabora.com>
> ---
>  src/egl/drivers/dri2/egl_dri2.c         | 34 +++++++++++++++++++++
>  src/egl/drivers/dri2/egl_dri2.h         | 14 ++++++---
>  src/egl/drivers/dri2/platform_android.c | 40 ++-----------------------
>  src/egl/drivers/dri2/platform_drm.c     | 46 ++++++++---------------------
>  src/egl/drivers/dri2/platform_wayland.c | 52 ++++++++-------------------------
>  5 files changed, 71 insertions(+), 115 deletions(-)

For platform_android (FYI, it touches only legacy code used for DRI
control nodes):

Reviewed-by: Tomasz Figa <tfiga at chromium.org>

Best regards,
Tomasz


More information about the mesa-dev mailing list