[PATCH v2] Add a new field for compositors to store the gamma encoding of wl_buffers.

John Kåre Alsaker john.kare.alsaker at gmail.com
Mon Oct 1 01:49:42 PDT 2012


busy_count and gamma is only used by compositors. Nothing in the
wayland libraries uses these, so they are not defined there. We should
probably add a pointer for the compositor to allocate further state
too without having to use a map for that.

On Mon, Oct 1, 2012 at 9:42 AM, Pekka Paalanen <ppaalanen at gmail.com> wrote:
> On Sun, 30 Sep 2012 01:39:14 +0200
> John Kåre Alsaker <john.kare.alsaker at gmail.com> wrote:
>
>> ---
>>  src/wayland-server.h | 1 +
>>  src/wayland-shm.c    | 3 +--
>>  2 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/wayland-server.h b/src/wayland-server.h
>> index 45cc61c..9fa754f 100644
>> --- a/src/wayland-server.h
>> +++ b/src/wayland-server.h
>> @@ -180,6 +180,7 @@ struct wl_buffer {
>>       struct wl_resource resource;
>>       int32_t width, height;
>>       uint32_t busy_count;
>> +     uint32_t gamma;
>>  };
>
> Where are all the possible values for 'gamma' defined and documented?
> Should it be an enum?
>
> Usually such changes are accompanied by further patches, that use the
> new things, so they can be evaluated. This change is an API break for
> servers and Mesa. Maybe it's a little early for this right now?
>
>
> Thanks,
> pq
>
>>  struct wl_surface {
>> diff --git a/src/wayland-shm.c b/src/wayland-shm.c
>> index 90c4cf7..f73b3f7 100644
>> --- a/src/wayland-shm.c
>> +++ b/src/wayland-shm.c
>> @@ -112,7 +112,7 @@ shm_pool_create_buffer(struct wl_client *client, struct wl_resource *resource,
>>               return;
>>       }
>>
>> -     buffer = malloc(sizeof *buffer);
>> +     buffer = calloc(1, sizeof *buffer);
>>       if (buffer == NULL) {
>>               wl_resource_post_no_memory(resource);
>>               return;
>> @@ -120,7 +120,6 @@ shm_pool_create_buffer(struct wl_client *client, struct wl_resource *resource,
>>
>>       buffer->buffer.width = width;
>>       buffer->buffer.height = height;
>> -     buffer->buffer.busy_count = 0;
>>       buffer->format = format;
>>       buffer->stride = stride;
>>       buffer->offset = offset;
>


More information about the wayland-devel mailing list