summaryrefslogtreecommitdiff
path: root/src/wayland-shm.c
AgeCommit message (Collapse)AuthorFilesLines
2012-10-19Move un-namespaced container_of into private headerKristian Høgsberg1-0/+1
2012-08-16Add wl_shm_buffer_create()Kristian Høgsberg1-1/+45
2012-07-20wayland-shm: Commit the width/height getters that actually compileKristian Høgsberg1-4/+4
2012-07-20shm: Add shm_buffer getters for width and heightKristian Høgsberg1-0/+16
2012-07-09wayland-shm: Add return before we hit the error clean-up pathKristian Høgsberg1-0/+2
Regression in c94c0946db694ec29b5aebb94a8be0501bacfbc7
2012-07-09shm: Plug leak in shm_create_pool()Martin Olsson1-6/+9
2012-05-23shm: use mremap on pool resizeAnder Conselvan de Oliveira1-7/+5
2012-05-22shm: Zero busy count for allocated buffersRob Bradford1-0/+1
This avoids a valgrind error like: ==31496== Conditional jump or move depends on uninitialised value(s) ==31496== at 0x407620: weston_buffer_post_release (compositor.c:928) ==31496== by 0x406AEB: weston_surface_attach (compositor.c:725) ==31496== by 0x409EB8: pointer_attach (compositor.c:2009) ==31496== by 0x34ECE05D63: ffi_call_unix64 (unix64.S:75) ==31496== by 0x34ECE05784: ffi_call (ffi64.c:486) ==31496== by 0x5674C4D: wl_closure_invoke (connection.c:770) ==31496== by 0x566ECCB: wl_client_connection_data (wayland-server.c:255) ==31496== by 0x56722F9: wl_event_source_fd_dispatch (event-loop.c:79) ==31496== by 0x5672C99: wl_event_loop_dispatch (event-loop.c:410) ==31496== by 0x56705FF: wl_display_run (wayland-server.c:1004) ==31496== by 0x40C775: main (compositor.c:2937) ==31496== Uninitialised value was created by a heap allocation ==31496== at 0x4A074CD: malloc (vg_replace_malloc.c:236) ==31496== by 0x5670EA7: shm_pool_create_buffer (wayland-shm.c:113) ==31496== by 0x34ECE05D63: ffi_call_unix64 (unix64.S:75) ==31496== by 0x34ECE05784: ffi_call (ffi64.c:486) ==31496== by 0x5674C4D: wl_closure_invoke (connection.c:770) ==31496== by 0x566ECCB: wl_client_connection_data (wayland-server.c:255) ==31496== by 0x56722F9: wl_event_source_fd_dispatch (event-loop.c:79) ==31496== by 0x5672C99: wl_event_loop_dispatch (event-loop.c:410) ==31496== by 0x56705FF: wl_display_run (wayland-server.c:1004) ==31496== by 0x40C775: main (compositor.c:2937)
2012-05-22shm: Add request for resizing poolsAnder Conselvan de Oliveira1-5/+30
2012-04-11Switch protocol to using serial numbers for ordering events and requestsKristian Høgsberg1-2/+2
The wayland protocol, as X, uses timestamps to match up certain requests with input events. The problem is that sometimes we need to send out an event that doesn't have a corresponding timestamped input event. For example, the pointer focus surface goes away and new surface needs to receive a pointer enter event. These events are normally timestamped with the evdev event timestamp, but in this case, we don't have a evdev timestamp. So we have to go to gettimeofday (or clock_gettime()) and then we don't know if it's coming from the same time source etc. However for all these cases we don't need a real time timestamp, we just need a serial number that encodes the order of events inside the server. So we introduce a serial number mechanism that we can use to order events. We still need real-time timestamps for actual input device events (motion, buttons, keys, touch), to be able to reason about double-click speed and movement speed so events that correspond to user input carry both a serial number and a timestamp. The serial number also give us a mechanism to key together events that are "logically the same" such as a unicode event and a keycode event, or a motion event and a relative event from a raw device.
2012-04-03shm: Allocate shm buffers through new wl_shm_pool interfaceKristian Høgsberg1-41/+99
There's a big cost to setting up and tearing down a mmap and faulting in the pages to back it. For cases where we're continuously reallocating shm wl_buffers (resizing a surface, typically) it is a big performance improvement to be able to reuse a mmap area. This change makes the shm buffer allocation a two step process: first allocate a wl_shm_pool, then allocate a buffer from the pool. The wl_shm_pool encapsulate the shared memory pool, and lets clients allocate wl_buffers backed by chunks of that memory. Buffers are allocated at an offset into the pool, so it's possible to create multiple buffers from one pool, for example for icons or cursor images.
2012-03-30shm: Fix stride signedness in protocolKristian Høgsberg1-1/+1
Make stride argument of wl_shm.create_buffer a signed integer.
2012-03-30shm: fix cosmetic gcc warningsPekka Paalanen1-2/+2
Fix warning: 'static' is not at beginning of declaration Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-03-26Remove wl_buffer.damage and simplify shm implementationKristian Høgsberg1-51/+7
2012-03-02server: use the event sending wrappersPekka Paalanen1-4/+2
This exposes some type mismatches that are fixed in the next commit. Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
2012-01-11shm: Drop non-premul format, use less ambiguous ARGB8888 naming conventionKristian Høgsberg1-6/+5
This also matches the new wl_drm format names.
2011-09-01server: Make error posting functions take a resource instead of a clientKristian Høgsberg1-11/+11
2011-08-31Remove the wl_visual interfaceKristian Høgsberg1-12/+31
The visual interface was meant to be a generic mechanism for specifying the content of a buffer. It goes back to before we had the buffer factory interfaces (like wl_drm and wl_shm) and we wanted to keep it open-ended enough that yuv, png or even svg buffer or so would be possible. Now that we have the buffer abstraction, we can add different buffer types by introducing new interfaces that create buffers. It only makes sense to leave it to those interfaces to specify the contents of the buffers. For wl_shm, this means that we now just specify the pixel format using an enum. For EGL buffers, the exact pixel formats are controlled by the implementation (part of wl_drm and similar), and from the client point of view, everything is controlled using EGLConfigs.
2011-08-29shm: Compare resource interface when validating visualKristian Høgsberg1-1/+1
2011-08-27server: Pass struct wl_resource for object referencesKristian Høgsberg1-1/+2
2011-08-27Always allocate a new wl_resource when binding an objectKristian Høgsberg1-8/+16
Previously we would bind some resources into multiple client hash tables.
2011-08-27server: Assign global id as part of wl_display_add_global()Kristian Høgsberg1-1/+0
2011-08-27server: Make everything in the object hash a wl_resourceKristian Høgsberg1-16/+19
2011-08-12Rename source subdir from wayland to srcKristian Høgsberg1-0/+223