[Mesa-dev] [PATCH 1/4] gallium-egl: Use native types rather than EGL ones

Emil Velikov emil.l.velikov at gmail.com
Mon Jul 8 10:33:24 PDT 2013


ping
Does anyone have any objections on this patch? Feel free to commit, it
looks ok

Cheers
Emil

On 22/06/13 16:43, Emil Velikov wrote:
> Change egl_g3d_wl_drm_common_query_buffer() to use boolean/int rather than
> EGLBoolean/EGLint, based on the interface in native_wayland_bufmgr.h,
> 
> Resolves type conversion warnings spotted by gcc
> 
> x11/native_dri2.c:892:1: warning: initialization from incompatible pointer
> type[enabled by default]
>  };
>  ^
> 
> x11/native_dri2.c:892:1: warning: (near initialization for
> 'dri2_display_wayland_bufmgr.query_buffer') [enabled by default]
> 
> wayland/native_drm.c:302:1: warning: initialization from incompatible pointer
> type [enabled by default]
>  };
>  ^
> wayland/native_drm.c:302:1: warning: (near initialization for
> 'wayland_drm_display_wayland_bufmgr.query_buffer') [enabled by default]
> 
> drm/native_drm.c:244:1: warning: initialization from incompatible pointer
> type [enabled by default]
>  };
>  ^
> drm/native_drm.c:244:1: warning: (near initialization for
> 'drm_display_wayland_bufmgr.query_buffer') [enabled by default]
> 
> Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
> CC: Kristian Høgsberg <krh at bitplanet.net>
> ---
>  .../egl/common/native_wayland_drm_bufmgr_helper.c        | 16 ++++++++--------
>  .../egl/common/native_wayland_drm_bufmgr_helper.h        |  4 ++--
>  2 files changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git a/src/gallium/state_trackers/egl/common/native_wayland_drm_bufmgr_helper.c b/src/gallium/state_trackers/egl/common/native_wayland_drm_bufmgr_helper.c
> index a9e7342..0711236 100644
> --- a/src/gallium/state_trackers/egl/common/native_wayland_drm_bufmgr_helper.c
> +++ b/src/gallium/state_trackers/egl/common/native_wayland_drm_bufmgr_helper.c
> @@ -69,10 +69,10 @@ egl_g3d_wl_drm_common_wl_buffer_get_resource(struct native_display *ndpy,
>     return wayland_drm_buffer_get_buffer(buffer);
>  }
>  
> -EGLBoolean
> +boolean
>  egl_g3d_wl_drm_common_query_buffer(struct native_display *ndpy,
>                                     struct wl_buffer *_buffer,
> -                                   EGLint attribute, EGLint *value)
> +                                   int attribute, int *value)
>  {
>     struct wl_drm_buffer *buffer = (struct wl_drm_buffer *) _buffer;
>     struct pipe_resource *resource = buffer->driver_buffer;
> @@ -85,21 +85,21 @@ egl_g3d_wl_drm_common_query_buffer(struct native_display *ndpy,
>        switch (resource->format) {
>        case PIPE_FORMAT_B8G8R8A8_UNORM:
>           *value = EGL_TEXTURE_RGBA;
> -         return EGL_TRUE;
> +         return TRUE;
>        case PIPE_FORMAT_B8G8R8X8_UNORM:
>           *value = EGL_TEXTURE_RGB;
> -         return EGL_TRUE;
> +         return TRUE;
>        default:
> -         return EGL_FALSE;
> +         return FALSE;
>        }
>     case EGL_WIDTH:
>        *value = buffer->buffer.width;
> -      return EGL_TRUE;
> +      return TRUE;
>     case EGL_HEIGHT:
>        *value = buffer->buffer.height;
> -      return EGL_TRUE;
> +      return TRUE;
>     default:
> -      return EGL_FALSE;
> +      return FALSE;
>     }
>  }
>  
> diff --git a/src/gallium/state_trackers/egl/common/native_wayland_drm_bufmgr_helper.h b/src/gallium/state_trackers/egl/common/native_wayland_drm_bufmgr_helper.h
> index 543dc6f..cf86b90 100644
> --- a/src/gallium/state_trackers/egl/common/native_wayland_drm_bufmgr_helper.h
> +++ b/src/gallium/state_trackers/egl/common/native_wayland_drm_bufmgr_helper.h
> @@ -39,9 +39,9 @@ struct pipe_resource *
>  egl_g3d_wl_drm_common_wl_buffer_get_resource(struct native_display *ndpy,
>                                               struct wl_buffer *buffer);
>  
> -EGLBoolean
> +boolean
>  egl_g3d_wl_drm_common_query_buffer(struct native_display *ndpy,
>                                     struct wl_buffer *buffer,
> -                                   EGLint attribute, EGLint *value);
> +                                   int attribute, int *value);
>  
>  #endif /* _NATIVE_WAYLAND_DRM_BUFMGR_HELPER_H_ */
> 



More information about the mesa-dev mailing list