summaryrefslogtreecommitdiffstats
path: root/src/egl/wayland
diff options
context:
space:
mode:
authorKristian Høgsberg <[email protected]>2011-05-11 15:28:19 -0400
committerKristian Høgsberg <[email protected]>2011-05-19 12:07:00 -0400
commit339544f4bbef9be1b4b3465f28482b9699a99692 (patch)
tree69b50797a76e1b05876b8395d82116b2f54398c6 /src/egl/wayland
parentec4dfc2aad16ed3d04f47657e9f2cb22e791d511 (diff)
wayland-drm: Use new generic error event
Diffstat (limited to 'src/egl/wayland')
-rw-r--r--src/egl/wayland/wayland-drm/protocol/wayland-drm.xml6
-rw-r--r--src/egl/wayland/wayland-drm/wayland-drm.c27
2 files changed, 17 insertions, 16 deletions
diff --git a/src/egl/wayland/wayland-drm/protocol/wayland-drm.xml b/src/egl/wayland/wayland-drm/protocol/wayland-drm.xml
index cd5d191227a..0331f124e80 100644
--- a/src/egl/wayland/wayland-drm/protocol/wayland-drm.xml
+++ b/src/egl/wayland/wayland-drm/protocol/wayland-drm.xml
@@ -3,6 +3,12 @@
<!-- drm support. This object is created by the server and published
using the display's global event. -->
<interface name="wl_drm" version="1">
+ <enum name="error">
+ <entry name="authenticate_fail" value="0"/>
+ <entry name="invalid_visual" value="1"/>
+ <entry name="invalid_name" value="2"/>
+ </enum>
+
<!-- Call this request with the magic received from drmGetMagic().
It will be passed on to the drmAuthMagic() or
DRIAuthConnection() call. This authentication must be
diff --git a/src/egl/wayland/wayland-drm/wayland-drm.c b/src/egl/wayland/wayland-drm/wayland-drm.c
index 03a756bf0a3..d68f9c7bac3 100644
--- a/src/egl/wayland/wayland-drm/wayland-drm.c
+++ b/src/egl/wayland/wayland-drm/wayland-drm.c
@@ -101,12 +101,9 @@ drm_create_buffer(struct wl_client *client, struct wl_drm *drm,
buffer->buffer.visual = visual;
if (visual->object.interface != &wl_visual_interface) {
- /* FIXME: Define a real exception event instead of
- * abusing this one */
- wl_client_post_event(client,
- (struct wl_object *) drm->display,
- WL_DISPLAY_INVALID_OBJECT, 0);
- fprintf(stderr, "invalid visual in create_buffer\n");
+ wl_client_post_error(client, &drm->object,
+ WL_DRM_ERROR_INVALID_VISUAL,
+ "invalid visual");
return;
}
@@ -116,12 +113,9 @@ drm_create_buffer(struct wl_client *client, struct wl_drm *drm,
stride, visual);
if (buffer->driver_buffer == NULL) {
- /* FIXME: Define a real exception event instead of
- * abusing this one */
- wl_client_post_event(client,
- (struct wl_object *) drm->display,
- WL_DISPLAY_INVALID_OBJECT, 0);
- fprintf(stderr, "failed to create image for name %d\n", name);
+ wl_client_post_error(client, &drm->object,
+ WL_DRM_ERROR_INVALID_NAME,
+ "invalid name");
return;
}
@@ -140,9 +134,9 @@ drm_authenticate(struct wl_client *client,
struct wl_drm *drm, uint32_t id)
{
if (drm->callbacks->authenticate(drm->user_data, id) < 0)
- wl_client_post_event(client,
- (struct wl_object *) drm->display,
- WL_DISPLAY_INVALID_OBJECT, 0);
+ wl_client_post_error(client, &drm->object,
+ WL_DRM_ERROR_AUTHENTICATE_FAIL,
+ "authenicate failed");
else
wl_client_post_event(client, &drm->object,
WL_DRM_AUTHENTICATED);
@@ -154,7 +148,8 @@ const static struct wl_drm_interface drm_interface = {
};
static void
-post_drm_device(struct wl_client *client, struct wl_object *global)
+post_drm_device(struct wl_client *client,
+ struct wl_object *global, uint32_t version)
{
struct wl_drm *drm = (struct wl_drm *) global;