summaryrefslogtreecommitdiff
path: root/src/compositor-drm.c
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2015-07-15 13:00:36 -0500
committerBryce Harrington <bryce@osg.samsung.com>2015-07-16 19:03:43 -0700
commit8ae2db5b0cc5673e442938aa176cb44ada3e20ca (patch)
tree3cd6d82774f2774bdc1fb10c77360f903bad223f /src/compositor-drm.c
parent0720ea36c8ee7e957d292a9ca41f35b403f39062 (diff)
downloadweston-8ae2db5b0cc5673e442938aa176cb44ada3e20ca.tar.gz
input: Pass the appropriate pointer type to bindings instead of a seat
Normally we need to check if a seat's [device_type]_count is > 0 before we can use the associated pointer. However, in a binding you're guaranteed that the seat has a device of that type. If we pass in that type instead of the seat, it's obvious we don't have to test it. The bindings can still get the seat pointer via whatever->seat if they need it. This is preparation for a follow up patch that prevents direct access to seat->device_type pointers, and this will save us a few tests at that point. Reviewed-by: Jonas Ã…dahl <jadahl@gmail.com> Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Diffstat (limited to 'src/compositor-drm.c')
-rw-r--r--src/compositor-drm.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/compositor-drm.c b/src/compositor-drm.c
index 42195ec2..b4ca916e 100644
--- a/src/compositor-drm.c
+++ b/src/compositor-drm.c
@@ -2764,7 +2764,8 @@ session_notify(struct wl_listener *listener, void *data)
}
static void
-switch_vt_binding(struct weston_seat *seat, uint32_t time, uint32_t key, void *data)
+switch_vt_binding(struct weston_keyboard *keyboard, uint32_t time,
+ uint32_t key, void *data)
{
struct weston_compositor *compositor = data;
@@ -2828,7 +2829,8 @@ find_primary_gpu(struct drm_backend *b, const char *seat)
}
static void
-planes_binding(struct weston_seat *seat, uint32_t time, uint32_t key, void *data)
+planes_binding(struct weston_keyboard *keyboard, uint32_t time, uint32_t key,
+ void *data)
{
struct drm_backend *b = data;
@@ -2908,7 +2910,7 @@ create_recorder(struct drm_backend *b, int width, int height,
}
static void
-recorder_binding(struct weston_seat *seat, uint32_t time, uint32_t key,
+recorder_binding(struct weston_keyboard *keyboard, uint32_t time, uint32_t key,
void *data)
{
struct drm_backend *b = data;
@@ -2993,10 +2995,11 @@ switch_to_gl_renderer(struct drm_backend *b)
}
static void
-renderer_switch_binding(struct weston_seat *seat, uint32_t time, uint32_t key,
- void *data)
+renderer_switch_binding(struct weston_keyboard *keyboard, uint32_t time,
+ uint32_t key, void *data)
{
- struct drm_backend *b = (struct drm_backend *)seat->compositor->backend;
+ struct drm_backend *b =
+ (struct drm_backend *) keyboard->seat->compositor;
switch_to_gl_renderer(b);
}