Re: [PATCH weston 02/10] Use linux-dmabuf protocol from wayland-protocols

2015-11-05 Thread Pekka Paalanen
On Wed,  4 Nov 2015 16:49:51 +0800
Jonas Ådahl  wrote:

> Signed-off-by: Jonas Ådahl 
> ---
>  Makefile.am   |  13 +--
>  clients/simple-dmabuf.c   |  56 +-
>  protocol/linux-dmabuf.xml | 274 
> --
>  src/gl-renderer.c |   6 +-
>  src/linux-dmabuf.c|  40 +++
>  5 files changed, 57 insertions(+), 332 deletions(-)
>  delete mode 100644 protocol/linux-dmabuf.xml

Acked-by: Pekka Paalanen 

Subject to the question of whether non-global interfaces should have
the renaming treatment. The non-global interface in this extension did
have the 'z' prefix already, but I don't think it was thought through
much.


Thanks,
pq


pgpDaHQXtDFfP.pgp
Description: OpenPGP digital signature
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH weston 02/10] Use linux-dmabuf protocol from wayland-protocols

2015-11-04 Thread Jonas Ådahl
Signed-off-by: Jonas Ådahl 
---
 Makefile.am   |  13 +--
 clients/simple-dmabuf.c   |  56 +-
 protocol/linux-dmabuf.xml | 274 --
 src/gl-renderer.c |   6 +-
 src/linux-dmabuf.c|  40 +++
 5 files changed, 57 insertions(+), 332 deletions(-)
 delete mode 100644 protocol/linux-dmabuf.xml

diff --git a/Makefile.am b/Makefile.am
index 2524591..9f7cc9d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -127,8 +127,8 @@ nodist_weston_SOURCES = 
\
protocol/presentation_timing-server-protocol.h  \
protocol/scaler-protocol.c  \
protocol/scaler-server-protocol.h   \
-   protocol/linux-dmabuf-protocol.c\
-   protocol/linux-dmabuf-server-protocol.h
+   protocol/linux-dmabuf-unstable-v1-protocol.c\
+   protocol/linux-dmabuf-unstable-v1-server-protocol.h
 
 BUILT_SOURCES += $(nodist_weston_SOURCES)
 
@@ -533,11 +533,11 @@ nodist_weston_simple_dmabuf_SOURCES = \
protocol/xdg-shell-client-protocol.h\
protocol/fullscreen-shell-unstable-v1-protocol.c\
protocol/fullscreen-shell-unstable-v1-client-protocol.h \
-   protocol/linux-dmabuf-protocol.c \
-   protocol/linux-dmabuf-client-protocol.h
+   protocol/linux-dmabuf-unstable-v1-protocol.c \
+   protocol/linux-dmabuf-unstable-v1-client-protocol.h
 weston_simple_dmabuf_CFLAGS = $(AM_CFLAGS) $(SIMPLE_DMABUF_CLIENT_CFLAGS)
 weston_simple_dmabuf_LDADD = $(SIMPLE_DMABUF_CLIENT_LIBS) libshared.la
-BUILT_SOURCES += protocol/linux-dmabuf-client-protocol.h
+BUILT_SOURCES += protocol/linux-dmabuf-unstable-v1-client-protocol.h
 endif
 
 noinst_LTLIBRARIES += libtoytoolkit.la
@@ -1351,8 +1351,7 @@ EXTRA_DIST += \
protocol/presentation_timing.xml\
protocol/scaler.xml \
protocol/ivi-application.xml\
-   protocol/ivi-hmi-controller.xml \
-   protocol/linux-dmabuf.xml
+   protocol/ivi-hmi-controller.xml
 
 #
 # manual test modules in tests subdirectory
diff --git a/clients/simple-dmabuf.c b/clients/simple-dmabuf.c
index 793aef2..f9d794d 100644
--- a/clients/simple-dmabuf.c
+++ b/clients/simple-dmabuf.c
@@ -42,7 +42,7 @@
 #include 
 #include "xdg-shell-client-protocol.h"
 #include "fullscreen-shell-unstable-v1-client-protocol.h"
-#include "linux-dmabuf-client-protocol.h"
+#include "linux-dmabuf-unstable-v1-client-protocol.h"
 
 struct display {
struct wl_display *display;
@@ -50,7 +50,7 @@ struct display {
struct wl_compositor *compositor;
struct xdg_shell *shell;
struct zwl_fullscreen_shell1 *fshell;
-   struct zlinux_dmabuf *dmabuf;
+   struct zlinux_dmabuf1 *dmabuf;
int xrgb_format_found;
 };
 
@@ -187,7 +187,7 @@ unmap_bo(struct buffer *my_buf)
 
 static void
 create_succeeded(void *data,
-struct zlinux_buffer_params *params,
+struct zlinux_buffer_params1 *params,
 struct wl_buffer *new_buffer)
 {
struct buffer *buffer = data;
@@ -195,22 +195,22 @@ create_succeeded(void *data,
buffer->buffer = new_buffer;
wl_buffer_add_listener(buffer->buffer, &buffer_listener, buffer);
 
-   zlinux_buffer_params_destroy(params);
+   zlinux_buffer_params1_destroy(params);
 }
 
 static void
-create_failed(void *data, struct zlinux_buffer_params *params)
+create_failed(void *data, struct zlinux_buffer_params1 *params)
 {
struct buffer *buffer = data;
 
buffer->buffer = NULL;
 
-   zlinux_buffer_params_destroy(params);
+   zlinux_buffer_params1_destroy(params);
 
fprintf(stderr, "Error: zlinux_buffer_params.create failed.\n");
 }
 
-static const struct zlinux_buffer_params_listener params_listener = {
+static const struct zlinux_buffer_params1_listener params_listener = {
create_succeeded,
create_failed
 };
@@ -219,7 +219,7 @@ static int
 create_dmabuf_buffer(struct display *display, struct buffer *buffer,
 int width, int height)
 {
-   struct zlinux_buffer_params *params;
+   struct zlinux_buffer_params1 *params;
uint64_t modifier;
uint32_t flags;
 
@@ -259,20 +259,20 @@ create_dmabuf_buffer(struct display *display, struct 
buffer *buffer,
modifier = 0;
flags = 0;
 
-   params = zlinux_dmabuf_create_params(display->dmabuf);
-   zlinux_buffer_params_add(params,
-buffer->dmabuf_fd,
-0, /* plane_idx */
-0, /* offset */
-buffer->stride,
-modifier >> 32,
-modifier & 0x);
-   zlinux_buffer_params_add_listener(params, ¶ms_listener, buffer);
-   zlinux_buffer_params_create(params,
-