Re: [Mesa-dev] [PATCH] egl/dri2: remove unused buffer_count variable
On 18 July 2017 at 17:48, Eric Engestrom wrote: > On 18 July 2017 09:12:50 BST, Gwan-gyeong Mun wrote: >> It removes unused buffer_count variable from dri2_egl_surface. >> And it polishes the assert of dri2_drm_get_buffers_with_format(). >> >> Signed-off-by: Mun Gwan-gyeong > > Reviewed-by: Eric Engestrom > Thanks for double-checking Eric. Gwan-gyeong Mun, I've pushed the reviewed patches. Can you skim through the patchwork list [1] and update accordingly - superseded, rejected, etc.. Thanks Emil [1] https://patchwork.freedesktop.org/project/mesa/patches/?submitter=16449 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] egl/dri2: remove unused buffer_count variable
On 18 July 2017 09:12:50 BST, Gwan-gyeong Mun wrote: > It removes unused buffer_count variable from dri2_egl_surface. > And it polishes the assert of dri2_drm_get_buffers_with_format(). > > Signed-off-by: Mun Gwan-gyeong Reviewed-by: Eric Engestrom > --- > src/egl/drivers/dri2/egl_dri2.h | 1 - > src/egl/drivers/dri2/platform_android.c | 5 + > src/egl/drivers/dri2/platform_drm.c | 3 +-- > src/egl/drivers/dri2/platform_x11.c | 1 - > 4 files changed, 2 insertions(+), 8 deletions(-) > > diff --git a/src/egl/drivers/dri2/egl_dri2.h > b/src/egl/drivers/dri2/egl_dri2.h > index 5b3e93abe0..a8133e0e50 100644 > --- a/src/egl/drivers/dri2/egl_dri2.h > +++ b/src/egl/drivers/dri2/egl_dri2.h > @@ -246,7 +246,6 @@ struct dri2_egl_surface > _EGLSurface base; > __DRIdrawable *dri_drawable; > __DRIbuffer buffers[5]; > - int buffer_count; > bool have_fake_front; > > #ifdef HAVE_X11_PLATFORM > diff --git a/src/egl/drivers/dri2/platform_android.c > b/src/egl/drivers/dri2/platform_android.c > index 13006fee87..300e2d9dbf 100644 > --- a/src/egl/drivers/dri2/platform_android.c > +++ b/src/egl/drivers/dri2/platform_android.c > @@ -1003,16 +1003,13 @@ droid_get_buffers_with_format(__DRIdrawable * > driDrawable, > if (update_buffers(dri2_surf) < 0) >return NULL; > > - dri2_surf->buffer_count = > - droid_get_buffers_parse_attachments(dri2_surf, attachments, > count); > + *out_count = droid_get_buffers_parse_attachments(dri2_surf, > attachments, count); > > if (width) >*width = dri2_surf->base.Width; > if (height) >*height = dri2_surf->base.Height; > > - *out_count = dri2_surf->buffer_count; > - > return dri2_surf->buffers; > } > > diff --git a/src/egl/drivers/dri2/platform_drm.c > b/src/egl/drivers/dri2/platform_drm.c > index 8e12aed0b3..aa3937581a 100644 > --- a/src/egl/drivers/dri2/platform_drm.c > +++ b/src/egl/drivers/dri2/platform_drm.c > @@ -321,10 +321,9 @@ dri2_drm_get_buffers_with_format(__DRIdrawable > *driDrawable, > struct dri2_egl_surface *dri2_surf = loaderPrivate; > int i, j; > > - dri2_surf->buffer_count = 0; > for (i = 0, j = 0; i < 2 * count; i += 2, j++) { >assert(attachments[i] < __DRI_BUFFER_COUNT); > - assert(dri2_surf->buffer_count < 5); > + assert(j < ARRAY_SIZE(dri2_surf->buffers)); > >switch (attachments[i]) { >case __DRI_BUFFER_BACK_LEFT: > diff --git a/src/egl/drivers/dri2/platform_x11.c > b/src/egl/drivers/dri2/platform_x11.c > index c10cd84fce..b01f739010 100644 > --- a/src/egl/drivers/dri2/platform_x11.c > +++ b/src/egl/drivers/dri2/platform_x11.c > @@ -445,7 +445,6 @@ dri2_x11_process_buffers(struct dri2_egl_surface > *dri2_surf, >dri2_egl_display(dri2_surf->base.Resource.Display); > xcb_rectangle_t rectangle; > > - dri2_surf->buffer_count = count; > dri2_surf->have_fake_front = false; > > /* This assumes the DRI2 buffer attachment tokens matches the ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH] egl/dri2: remove unused buffer_count variable
It removes unused buffer_count variable from dri2_egl_surface. And it polishes the assert of dri2_drm_get_buffers_with_format(). Signed-off-by: Mun Gwan-gyeong --- src/egl/drivers/dri2/egl_dri2.h | 1 - src/egl/drivers/dri2/platform_android.c | 5 + src/egl/drivers/dri2/platform_drm.c | 3 +-- src/egl/drivers/dri2/platform_x11.c | 1 - 4 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/egl/drivers/dri2/egl_dri2.h b/src/egl/drivers/dri2/egl_dri2.h index 5b3e93abe0..a8133e0e50 100644 --- a/src/egl/drivers/dri2/egl_dri2.h +++ b/src/egl/drivers/dri2/egl_dri2.h @@ -246,7 +246,6 @@ struct dri2_egl_surface _EGLSurface base; __DRIdrawable *dri_drawable; __DRIbuffer buffers[5]; - int buffer_count; bool have_fake_front; #ifdef HAVE_X11_PLATFORM diff --git a/src/egl/drivers/dri2/platform_android.c b/src/egl/drivers/dri2/platform_android.c index 13006fee87..300e2d9dbf 100644 --- a/src/egl/drivers/dri2/platform_android.c +++ b/src/egl/drivers/dri2/platform_android.c @@ -1003,16 +1003,13 @@ droid_get_buffers_with_format(__DRIdrawable * driDrawable, if (update_buffers(dri2_surf) < 0) return NULL; - dri2_surf->buffer_count = - droid_get_buffers_parse_attachments(dri2_surf, attachments, count); + *out_count = droid_get_buffers_parse_attachments(dri2_surf, attachments, count); if (width) *width = dri2_surf->base.Width; if (height) *height = dri2_surf->base.Height; - *out_count = dri2_surf->buffer_count; - return dri2_surf->buffers; } diff --git a/src/egl/drivers/dri2/platform_drm.c b/src/egl/drivers/dri2/platform_drm.c index 8e12aed0b3..aa3937581a 100644 --- a/src/egl/drivers/dri2/platform_drm.c +++ b/src/egl/drivers/dri2/platform_drm.c @@ -321,10 +321,9 @@ dri2_drm_get_buffers_with_format(__DRIdrawable *driDrawable, struct dri2_egl_surface *dri2_surf = loaderPrivate; int i, j; - dri2_surf->buffer_count = 0; for (i = 0, j = 0; i < 2 * count; i += 2, j++) { assert(attachments[i] < __DRI_BUFFER_COUNT); - assert(dri2_surf->buffer_count < 5); + assert(j < ARRAY_SIZE(dri2_surf->buffers)); switch (attachments[i]) { case __DRI_BUFFER_BACK_LEFT: diff --git a/src/egl/drivers/dri2/platform_x11.c b/src/egl/drivers/dri2/platform_x11.c index c10cd84fce..b01f739010 100644 --- a/src/egl/drivers/dri2/platform_x11.c +++ b/src/egl/drivers/dri2/platform_x11.c @@ -445,7 +445,6 @@ dri2_x11_process_buffers(struct dri2_egl_surface *dri2_surf, dri2_egl_display(dri2_surf->base.Resource.Display); xcb_rectangle_t rectangle; - dri2_surf->buffer_count = count; dri2_surf->have_fake_front = false; /* This assumes the DRI2 buffer attachment tokens matches the -- 2.13.3 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev