summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoman Marchenko <r.marchenko@samsung.com>2015-12-30 18:31:44 +0200
committerRoman Marchenko <r.marchenko@samsung.com>2015-12-30 18:31:44 +0200
commitfed394770e1afc3429bfce2999b2312b43a0b247 (patch)
tree4f17ffb6634e0b980b9ffd4b68535a7e034d3800
parent57114dc3f550cf6b1529196a80bd077fee38c48e (diff)
downloadlibdrm-fed394770e1afc3429bfce2999b2312b43a0b247.tar.gz
libdrm-fed394770e1afc3429bfce2999b2312b43a0b247.tar.bz2
libdrm-fed394770e1afc3429bfce2999b2312b43a0b247.zip
Change-Id: I56e0128932a77940d8522caffca7225bd20785d7 Signed-off-by: Roman Marchenko <r.marchenko@samsung.com>
-rwxr-xr-xsprd/sprd_drm.c5
-rw-r--r--xf86drm.h1
-rw-r--r--xf86drmMode.c29
3 files changed, 23 insertions, 12 deletions
diff --git a/sprd/sprd_drm.c b/sprd/sprd_drm.c
index 283ba1e6..d4d7b7d7 100755
--- a/sprd/sprd_drm.c
+++ b/sprd/sprd_drm.c
@@ -1857,6 +1857,11 @@ static int sprd_drm_handle_event(int fd, drmEventContextPtr evctx)
}
drmFree(sprd_event);
}
+#ifdef TIZEN_USE_USER_HANDLER
+ else {
+ drmSendUserEvent(e);
+ }
+#endif
i += e->length;
}
diff --git a/xf86drm.h b/xf86drm.h
index c9610d20..ff629379 100644
--- a/xf86drm.h
+++ b/xf86drm.h
@@ -740,6 +740,7 @@ extern int drmHandleEvent(int fd, drmEventContextPtr evctx);
typedef int (*drm_user_handler)(struct drm_event *event);
extern int drmAddUserHandler(int fd, drm_user_handler handler);
extern void drmRemoveUserHandler(int fd, drm_user_handler handler);
+extern void drmSendUserEvent(struct drm_event * e);
#endif
extern char *drmGetDeviceNameFromFd(int fd);
diff --git a/xf86drmMode.c b/xf86drmMode.c
index 24c8851e..2a8ec56d 100644
--- a/xf86drmMode.c
+++ b/xf86drmMode.c
@@ -906,6 +906,22 @@ drmRemoveUserHandler(int fd, drm_user_handler handler)
}
}
}
+
+void drmSendUserEvent(struct drm_event * e)
+{
+ struct drm_user_handler_data *data;
+ int ret = -1;
+ if (!user_handler_list_init)
+ return;
+
+ DRMLISTFOREACHENTRY(data, &user_handler_list, link) {
+ if (data->handler) {
+ ret = data->handler(e);
+ if (ret == 0)
+ return;
+ }
+ }
+}
#endif
int drmHandleEvent(int fd, drmEventContextPtr evctx)
@@ -960,18 +976,7 @@ int drmHandleEvent(int fd, drmEventContextPtr evctx)
default:
#ifdef TIZEN_USE_USER_HANDLER
{
- struct drm_user_handler_data *data;
- int ret = -1;
- if (!user_handler_list_init)
- break;
- DRMLISTFOREACHENTRY(data, &user_handler_list, link) {
- if (data->handler)
- {
- ret = data->handler(e);
- if (ret == 0)
- break;
- }
- }
+ drmSendUserEvent(e);
}
#endif
break;