[PATCH weston v2] simple-dmabuf-drm: fix build with --disable-egl

Pekka Paalanen ppaalanen at gmail.com
Tue Jul 10 13:16:51 UTC 2018


On Mon,  9 Jul 2018 17:38:49 +0200
Emilio Pozuelo Monfort <pochu27 at gmail.com> wrote:

> This code calls into EGL to see if the dmabuf import modifiers
> extension is available, and if not it assumes XRGB8888 is supported.
> 
> Rather than disabling this client doesn't get build if one disables
> EGL, we can just remove this and stop lying to ourselves.
> 
> Signed-off-by: Emilio Pozuelo Monfort <emilio.pozuelo at collabora.co.uk>
> ---
> 
> Alright, this removes this check entirely, which means the client will
> fail if the extension is not available. This is just a test client, so
> it's not the end of the world if that combination is tested.
> 
>  clients/simple-dmabuf-drm.c | 11 -----------
>  1 file changed, 11 deletions(-)
> 
> diff --git a/clients/simple-dmabuf-drm.c b/clients/simple-dmabuf-drm.c
> index fcab30e5..2a21fe51 100644
> --- a/clients/simple-dmabuf-drm.c
> +++ b/clients/simple-dmabuf-drm.c
> @@ -57,7 +57,6 @@
>  
>  #include <wayland-client.h>
>  #include "shared/zalloc.h"
> -#include "shared/platform.h"
>  #include "xdg-shell-unstable-v6-client-protocol.h"
>  #include "fullscreen-shell-unstable-v1-client-protocol.h"
>  #include "linux-dmabuf-unstable-v1-client-protocol.h"
> @@ -850,7 +849,6 @@ static struct display *
>  create_display(int opts, int format)
>  {
>  	struct display *display;
> -	const char *extensions;
>  
>  	display = malloc(sizeof *display);
>  	if (display == NULL) {
> @@ -863,15 +861,6 @@ create_display(int opts, int format)
>  	display->req_dmabuf_immediate = opts & OPT_IMMEDIATE;
>  	display->req_dmabuf_modifiers = (format == DRM_FORMAT_NV12);
>  
> -	/*
> -	 * hard code format if the platform egl doesn't support format
> -	 * querying / advertising.
> -	 */
> -	extensions = eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS);
> -	if (extensions && !weston_check_egl_extension(extensions,
> -				"EGL_EXT_image_dma_buf_import_modifiers"))
> -		display->xrgb8888_format_found = 1;
> -
>  	display->registry = wl_display_get_registry(display->display);
>  	wl_registry_add_listener(display->registry,
>  				 &registry_listener, display);

Hi Emilio,

while this change is good, I found a couple more things that this
exposes.

The app still gets linked to libEGL and libgbm when it should not.

The code you remove here was hiding a bug where xrgb8888_format_found
was not set if the dmabuf interface was negotiated to version 2 or 1.
The handler dmabuf_format() has no code. Another patch to fix this
would be nice.


Thanks,
pq
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/wayland-devel/attachments/20180710/425a172e/attachment.sig>


More information about the wayland-devel mailing list