egl/dri2: remove unused buffer_count variable
authorGwan-gyeong Mun <elongbug@gmail.com>
Tue, 18 Jul 2017 08:12:26 +0000 (17:12 +0900)
committerEmil Velikov <emil.l.velikov@gmail.com>
Wed, 19 Jul 2017 12:06:50 +0000 (13:06 +0100)
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 <elongbug@gmail.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
src/egl/drivers/dri2/egl_dri2.h
src/egl/drivers/dri2/platform_android.c
src/egl/drivers/dri2/platform_drm.c
src/egl/drivers/dri2/platform_x11.c

index 0388b642cd5b6b6bcc6e7f25b3c1606d525c7db5..ccfefef61fc2d4022d14076de38b092f0f79be76 100644 (file)
@@ -256,7 +256,6 @@ struct dri2_egl_surface
    _EGLSurface          base;
    __DRIdrawable       *dri_drawable;
    __DRIbuffer          buffers[5];
-   int                  buffer_count;
    bool                 have_fake_front;
 
 #ifdef HAVE_X11_PLATFORM
index 13006fee873a0a590aedb841a7a0dea1677f96a2..300e2d9dbfbc84190d1f578d1aac5884ac7315d6 100644 (file)
@@ -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;
 }
 
index d18c73cb338ccc43ba37a34ef4efb538cf6815ec..d59009f3d2ed5894a74df48871a5d02b0a4c1cd7 100644 (file)
@@ -323,10 +323,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:
index c10cd84fce9fbf33d105402ac20a712a6a1feaba..b01f739010bf9b649a3c1aaeeacf1b95157da8bd 100644 (file)
@@ -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