[Mesa-dev] [PATCH 22/30] egl/dri2: coding style cleanup

Eric Engestrom eric at engestrom.ch
Sun Sep 25 03:24:28 UTC 2016


On Thu, Aug 25, 2016 at 05:18:44PM +0100, Emil Velikov wrote:
> From: Emil Velikov <emil.velikov at collabora.com>
> 
> Consistently indent with space rather than a mix of tab and
> spaces.
> 
> Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
> ---
>  src/egl/drivers/dri2/egl_dri2.c | 286 ++++++++++++++++++++--------------------
>  src/egl/drivers/dri2/egl_dri2.h |  18 +--
>  2 files changed, 152 insertions(+), 152 deletions(-)
> 
> diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
> index 1d38b24..344a7f3 100644
> --- a/src/egl/drivers/dri2/egl_dri2.c
> +++ b/src/egl/drivers/dri2/egl_dri2.c
> @@ -80,54 +80,54 @@ const __DRIuseInvalidateExtension use_invalidate = {
>  
>  EGLint dri2_to_egl_attribute_map[] = {
>     0,
> -   EGL_BUFFER_SIZE,		/* __DRI_ATTRIB_BUFFER_SIZE */
> -   EGL_LEVEL,			/* __DRI_ATTRIB_LEVEL */
> -   EGL_RED_SIZE,		/* __DRI_ATTRIB_RED_SIZE */
> -   EGL_GREEN_SIZE,		/* __DRI_ATTRIB_GREEN_SIZE */
> -   EGL_BLUE_SIZE,		/* __DRI_ATTRIB_BLUE_SIZE */
> -   EGL_LUMINANCE_SIZE,		/* __DRI_ATTRIB_LUMINANCE_SIZE */
> -   EGL_ALPHA_SIZE,		/* __DRI_ATTRIB_ALPHA_SIZE */
> -   0,				/* __DRI_ATTRIB_ALPHA_MASK_SIZE */
> -   EGL_DEPTH_SIZE,		/* __DRI_ATTRIB_DEPTH_SIZE */
> -   EGL_STENCIL_SIZE,		/* __DRI_ATTRIB_STENCIL_SIZE */
> -   0,				/* __DRI_ATTRIB_ACCUM_RED_SIZE */
> -   0,				/* __DRI_ATTRIB_ACCUM_GREEN_SIZE */
> -   0,				/* __DRI_ATTRIB_ACCUM_BLUE_SIZE */
> -   0,				/* __DRI_ATTRIB_ACCUM_ALPHA_SIZE */
> -   EGL_SAMPLE_BUFFERS,		/* __DRI_ATTRIB_SAMPLE_BUFFERS */
> -   EGL_SAMPLES,			/* __DRI_ATTRIB_SAMPLES */
> -   0,				/* __DRI_ATTRIB_RENDER_TYPE, */
> -   0,				/* __DRI_ATTRIB_CONFIG_CAVEAT */
> -   0,				/* __DRI_ATTRIB_CONFORMANT */
> -   0,				/* __DRI_ATTRIB_DOUBLE_BUFFER */
> -   0,				/* __DRI_ATTRIB_STEREO */
> -   0,				/* __DRI_ATTRIB_AUX_BUFFERS */
> -   0,				/* __DRI_ATTRIB_TRANSPARENT_TYPE */
> -   0,				/* __DRI_ATTRIB_TRANSPARENT_INDEX_VALUE */
> -   0,				/* __DRI_ATTRIB_TRANSPARENT_RED_VALUE */
> -   0,				/* __DRI_ATTRIB_TRANSPARENT_GREEN_VALUE */
> -   0,				/* __DRI_ATTRIB_TRANSPARENT_BLUE_VALUE */
> -   0,				/* __DRI_ATTRIB_TRANSPARENT_ALPHA_VALUE */
> -   0,				/* __DRI_ATTRIB_FLOAT_MODE (deprecated) */
> -   0,				/* __DRI_ATTRIB_RED_MASK */
> -   0,				/* __DRI_ATTRIB_GREEN_MASK */
> -   0,				/* __DRI_ATTRIB_BLUE_MASK */
> -   0,				/* __DRI_ATTRIB_ALPHA_MASK */
> -   EGL_MAX_PBUFFER_WIDTH,	/* __DRI_ATTRIB_MAX_PBUFFER_WIDTH */
> -   EGL_MAX_PBUFFER_HEIGHT,	/* __DRI_ATTRIB_MAX_PBUFFER_HEIGHT */
> -   EGL_MAX_PBUFFER_PIXELS,	/* __DRI_ATTRIB_MAX_PBUFFER_PIXELS */
> -   0,				/* __DRI_ATTRIB_OPTIMAL_PBUFFER_WIDTH */
> -   0,				/* __DRI_ATTRIB_OPTIMAL_PBUFFER_HEIGHT */
> -   0,				/* __DRI_ATTRIB_VISUAL_SELECT_GROUP */
> -   0,				/* __DRI_ATTRIB_SWAP_METHOD */
> -   EGL_MAX_SWAP_INTERVAL,	/* __DRI_ATTRIB_MAX_SWAP_INTERVAL */
> -   EGL_MIN_SWAP_INTERVAL,	/* __DRI_ATTRIB_MIN_SWAP_INTERVAL */
> -   0,				/* __DRI_ATTRIB_BIND_TO_TEXTURE_RGB */
> -   0,				/* __DRI_ATTRIB_BIND_TO_TEXTURE_RGBA */
> -   0,				/* __DRI_ATTRIB_BIND_TO_MIPMAP_TEXTURE */
> -   0,				/* __DRI_ATTRIB_BIND_TO_TEXTURE_TARGETS */
> -   EGL_Y_INVERTED_NOK,		/* __DRI_ATTRIB_YINVERTED */
> -   0,				/* __DRI_ATTRIB_FRAMEBUFFER_SRGB_CAPABLE */
> +   EGL_BUFFER_SIZE,                /* __DRI_ATTRIB_BUFFER_SIZE */
> +   EGL_LEVEL,                        /* __DRI_ATTRIB_LEVEL */
> +   EGL_RED_SIZE,                /* __DRI_ATTRIB_RED_SIZE */
> +   EGL_GREEN_SIZE,                /* __DRI_ATTRIB_GREEN_SIZE */
> +   EGL_BLUE_SIZE,                /* __DRI_ATTRIB_BLUE_SIZE */
> +   EGL_LUMINANCE_SIZE,                /* __DRI_ATTRIB_LUMINANCE_SIZE */
> +   EGL_ALPHA_SIZE,                /* __DRI_ATTRIB_ALPHA_SIZE */
> +   0,                                /* __DRI_ATTRIB_ALPHA_MASK_SIZE */
> +   EGL_DEPTH_SIZE,                /* __DRI_ATTRIB_DEPTH_SIZE */
> +   EGL_STENCIL_SIZE,                /* __DRI_ATTRIB_STENCIL_SIZE */
> +   0,                                /* __DRI_ATTRIB_ACCUM_RED_SIZE */
> +   0,                                /* __DRI_ATTRIB_ACCUM_GREEN_SIZE */
> +   0,                                /* __DRI_ATTRIB_ACCUM_BLUE_SIZE */
> +   0,                                /* __DRI_ATTRIB_ACCUM_ALPHA_SIZE */
> +   EGL_SAMPLE_BUFFERS,                /* __DRI_ATTRIB_SAMPLE_BUFFERS */
> +   EGL_SAMPLES,                        /* __DRI_ATTRIB_SAMPLES */
> +   0,                                /* __DRI_ATTRIB_RENDER_TYPE, */
> +   0,                                /* __DRI_ATTRIB_CONFIG_CAVEAT */
> +   0,                                /* __DRI_ATTRIB_CONFORMANT */
> +   0,                                /* __DRI_ATTRIB_DOUBLE_BUFFER */
> +   0,                                /* __DRI_ATTRIB_STEREO */
> +   0,                                /* __DRI_ATTRIB_AUX_BUFFERS */
> +   0,                                /* __DRI_ATTRIB_TRANSPARENT_TYPE */
> +   0,                                /* __DRI_ATTRIB_TRANSPARENT_INDEX_VALUE */
> +   0,                                /* __DRI_ATTRIB_TRANSPARENT_RED_VALUE */
> +   0,                                /* __DRI_ATTRIB_TRANSPARENT_GREEN_VALUE */
> +   0,                                /* __DRI_ATTRIB_TRANSPARENT_BLUE_VALUE */
> +   0,                                /* __DRI_ATTRIB_TRANSPARENT_ALPHA_VALUE */
> +   0,                                /* __DRI_ATTRIB_FLOAT_MODE (deprecated) */
> +   0,                                /* __DRI_ATTRIB_RED_MASK */
> +   0,                                /* __DRI_ATTRIB_GREEN_MASK */
> +   0,                                /* __DRI_ATTRIB_BLUE_MASK */
> +   0,                                /* __DRI_ATTRIB_ALPHA_MASK */
> +   EGL_MAX_PBUFFER_WIDTH,        /* __DRI_ATTRIB_MAX_PBUFFER_WIDTH */
> +   EGL_MAX_PBUFFER_HEIGHT,        /* __DRI_ATTRIB_MAX_PBUFFER_HEIGHT */
> +   EGL_MAX_PBUFFER_PIXELS,        /* __DRI_ATTRIB_MAX_PBUFFER_PIXELS */
> +   0,                                /* __DRI_ATTRIB_OPTIMAL_PBUFFER_WIDTH */
> +   0,                                /* __DRI_ATTRIB_OPTIMAL_PBUFFER_HEIGHT */
> +   0,                                /* __DRI_ATTRIB_VISUAL_SELECT_GROUP */
> +   0,                                /* __DRI_ATTRIB_SWAP_METHOD */
> +   EGL_MAX_SWAP_INTERVAL,        /* __DRI_ATTRIB_MAX_SWAP_INTERVAL */
> +   EGL_MIN_SWAP_INTERVAL,        /* __DRI_ATTRIB_MIN_SWAP_INTERVAL */
> +   0,                                /* __DRI_ATTRIB_BIND_TO_TEXTURE_RGB */
> +   0,                                /* __DRI_ATTRIB_BIND_TO_TEXTURE_RGBA */
> +   0,                                /* __DRI_ATTRIB_BIND_TO_MIPMAP_TEXTURE */
> +   0,                                /* __DRI_ATTRIB_BIND_TO_TEXTURE_TARGETS */
> +   EGL_Y_INVERTED_NOK,                /* __DRI_ATTRIB_YINVERTED */
> +   0,                                /* __DRI_ATTRIB_FRAMEBUFFER_SRGB_CAPABLE */

This looks like it was done by sed. Could you manually align the
comments, pretty please? :)

>  };
>  
>  const __DRIconfig *

[snip]

> diff --git a/src/egl/drivers/dri2/egl_dri2.h b/src/egl/drivers/dri2/egl_dri2.h
> index b5f3386..4f66e31 100644
> --- a/src/egl/drivers/dri2/egl_dri2.h
> +++ b/src/egl/drivers/dri2/egl_dri2.h
> @@ -216,13 +216,13 @@ struct dri2_egl_display
>     struct wl_drm            *wl_drm;
>     struct wl_shm            *wl_shm;
>     struct wl_event_queue    *wl_queue;
> -   int			     authenticated;
> -   int			     formats;
> +   int                             authenticated;
> +   int                             formats;
>     uint32_t                  capabilities;
>  #endif
>  
>     int              is_render_node;
> -   int			     is_different_gpu;
> +   int                             is_different_gpu;
>  };
>  
>  struct dri2_egl_context
> @@ -262,7 +262,7 @@ struct dri2_egl_surface
>     int                    dx;
>     int                    dy;
>     struct wl_callback    *throttle_callback;
> -   int			  format;
> +   int                          format;

Same with the last 3 hunks, please align the field names :)

With these fixed:
Reviewed-by: Eric Engestrom <eric at engestrom.ch>

>  #endif
>  
>  #ifdef HAVE_DRM_PLATFORM
> @@ -363,17 +363,17 @@ dri2_lookup_egl_image(__DRIscreen *screen, void *image, void *data);
>  
>  struct dri2_egl_config *
>  dri2_add_config(_EGLDisplay *disp, const __DRIconfig *dri_config, int id,
> -		EGLint surface_type, const EGLint *attr_list,
> -		const unsigned int *rgba_masks);
> +                EGLint surface_type, const EGLint *attr_list,
> +                const unsigned int *rgba_masks);
>  
>  _EGLImage *
>  dri2_create_image_khr(_EGLDriver *drv, _EGLDisplay *disp,
> -		      _EGLContext *ctx, EGLenum target,
> -		      EGLClientBuffer buffer, const EGLint *attr_list);
> +                      _EGLContext *ctx, EGLenum target,
> +                      EGLClientBuffer buffer, const EGLint *attr_list);
>  
>  _EGLImage *
>  dri2_create_image_dma_buf(_EGLDisplay *disp, _EGLContext *ctx,
> -			  EGLClientBuffer buffer, const EGLint *attr_list);
> +                          EGLClientBuffer buffer, const EGLint *attr_list);
>  
>  EGLBoolean
>  dri2_initialize_x11(_EGLDriver *drv, _EGLDisplay *disp);
> -- 
> 2.9.0


More information about the mesa-dev mailing list