[PATCH 0/2] resource versioning V3

Kristian Høgsberg hoegsberg at gmail.com
Tue May 28 13:06:25 PDT 2013


On Fri, May 24, 2013 at 11:40:24AM +0200, alexl at redhat.com wrote:
> From: Alexander Larsson <alexl at redhat.com>
> 
> New in this version:
> * We look up the private with wl_signal_get
> * Fixed off-by-one error in method_counts array lookup
>   (version 1 is at offset 0)

I talked to Jason about a different approach in IRC today.  We've long
wanted to make wl_resouce opaque, but wl_buffer breaks that.  So the
idea is to change struct wl_buffer to:

	struct wl_buffer {
	
		struct /* wl_resource */ {
			struct /* wl_object */ {
				const struct wl_interface *interface;
				const void *implementation;
				uint32_t id;
			} object;
	
			void (*destroy)(struct wl_resource *resource);
			struct wl_list link;
			struct wl_signal destroy_signal;
			struct wl_client *client;
			void *data;
		} resource;
	
		int32_t width, height;
		uint32_t busy_count;
	};

and then remove wl_object and wl_resource from the public headers.
Then anything that adds a resource using wl_client_add_resource() will
get flagged as adding a legacy/unversioned resource.  One way to flag
it is to use a bit in the pointer in the wl_map and we can add an
internal wl_resource_is_legacy() helper or such that looks up that
bit.  Or maybe wl_resource_get_version() will do that and return 1 if
it's an legacy resource).  Then we can add the EGL token to create EGL
images from a wl_resource instead of a wl_buffer and then start
planning for removing struct wl_buffer.

Kristian


> Alexander Larsson (2):
>   wl_resource: Add version field and getter/setter
>   wayland-server: Version check requests
> 
>  src/scanner.c        |  54 ++++++++++++++++++++++++----
>  src/wayland-server.c | 100 +++++++++++++++++++++++++++++++++++++++++++++++++--
>  src/wayland-server.h |   6 ++++
>  3 files changed, 151 insertions(+), 9 deletions(-)
> 
> -- 
> 1.8.1.4
> 
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel


More information about the wayland-devel mailing list