diff options
author | Roman Marchenko <r.marchenko@samsung.com> | 2015-12-30 18:31:44 +0200 |
---|---|---|
committer | Roman Marchenko <r.marchenko@samsung.com> | 2015-12-30 18:31:44 +0200 |
commit | fed394770e1afc3429bfce2999b2312b43a0b247 (patch) | |
tree | 4f17ffb6634e0b980b9ffd4b68535a7e034d3800 | |
parent | 57114dc3f550cf6b1529196a80bd077fee38c48e (diff) | |
download | libdrm-fed394770e1afc3429bfce2999b2312b43a0b247.tar.gz libdrm-fed394770e1afc3429bfce2999b2312b43a0b247.tar.bz2 libdrm-fed394770e1afc3429bfce2999b2312b43a0b247.zip |
[SPRD] Add a calling of a user handler from sprd_drmsubmit/tizen/20160104.053450accepted/tizen/wearable/20160104.224259accepted/tizen/tv/20160104.224241accepted/tizen/mobile/20160104.224223
Change-Id: I56e0128932a77940d8522caffca7225bd20785d7
Signed-off-by: Roman Marchenko <r.marchenko@samsung.com>
-rwxr-xr-x | sprd/sprd_drm.c | 5 | ||||
-rw-r--r-- | xf86drm.h | 1 | ||||
-rw-r--r-- | xf86drmMode.c | 29 |
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; } @@ -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; |