diff options
author | SooChan Lim <sc1.lim@samsung.com> | 2015-11-23 21:31:10 +0900 |
---|---|---|
committer | SooChan Lim <sc1.lim@samsung.com> | 2015-11-24 16:43:53 +0900 |
commit | cf3887b4f080727d9d399352c77e54f966b183c0 (patch) | |
tree | 33b00d92573258e2f313c39d2b54526c856a5feb | |
parent | 6f043773edd412fd91eb7425668229fbeaa2d546 (diff) | |
download | libdrm-cf3887b4f080727d9d399352c77e54f966b183c0.tar.gz libdrm-cf3887b4f080727d9d399352c77e54f966b183c0.tar.bz2 libdrm-cf3887b4f080727d9d399352c77e54f966b183c0.zip |
[SPRD] add feature HAVE_SPRD
Change-Id: I43add1f488177e926da8e50d47bae912e9e3137c
-rw-r--r-- | tests/modeprint/modeprint.c | 2 | ||||
-rwxr-xr-x | xf86drm.c | 8 | ||||
-rw-r--r-- | xf86drm.h | 2 | ||||
-rw-r--r-- | xf86drmMode.c | 5 |
4 files changed, 16 insertions, 1 deletions
diff --git a/tests/modeprint/modeprint.c b/tests/modeprint/modeprint.c index c1fc0798..d3acb22d 100644 --- a/tests/modeprint/modeprint.c +++ b/tests/modeprint/modeprint.c @@ -412,8 +412,10 @@ int main(int argc, char **argv) return 1; } +#ifdef HAVE_SPRD if (strcmp(module_name,"sprd") == 0) sprd_device_create(fd); +#endif res = drmModeGetResources(fd); if (res == 0) { @@ -162,29 +162,35 @@ void drmFree(void *pt) /** * Call ioctl, restarting if it is interupted */ + +#ifdef HAVE_SPRD static ioctl_hook fp_ioctl_hook; +#endif int drmIoctl(int fd, unsigned long request, void *arg) { int ret; +#ifdef HAVE_SPRD if (fp_ioctl_hook){ return fp_ioctl_hook(fd, request, arg); } - +#endif do { ret = ioctl(fd, request, arg); } while (ret == -1 && (errno == EINTR || errno == EAGAIN)); return ret; } +#ifdef HAVE_SPRD int drmIoctlSetHook(ioctl_hook hook) { fp_ioctl_hook = hook; return 0; } +#endif static unsigned long drmGetKeyFromFd(int fd) { @@ -740,8 +740,10 @@ extern char *drmGetDeviceNameFromFd(int fd); extern int drmPrimeHandleToFD(int fd, uint32_t handle, uint32_t flags, int *prime_fd); extern int drmPrimeFDToHandle(int fd, int prime_fd, uint32_t *handle); +//#define HAVE_SPRD typedef int (*handle_event_hook)(int fd, drmEventContextPtr evctx); extern int drmHandleEventSetHook(handle_event_hook hook); +//#endif #if defined(__cplusplus) || defined(c_plusplus) } diff --git a/xf86drmMode.c b/xf86drmMode.c index d63f41dd..4ec48d3f 100644 --- a/xf86drmMode.c +++ b/xf86drmMode.c @@ -841,6 +841,7 @@ int drmModeCrtcSetGamma(int fd, uint32_t crtc_id, uint32_t size, return DRM_IOCTL(fd, DRM_IOCTL_MODE_SETGAMMA, &l); } +#ifdef HAVE_SPRD static handle_event_hook handleEventHook = NULL; int drmHandleEventSetHook(handle_event_hook hook) @@ -848,6 +849,7 @@ int drmHandleEventSetHook(handle_event_hook hook) handleEventHook = hook; return 0; } +#endif int drmHandleEvent(int fd, drmEventContextPtr evctx) { @@ -858,10 +860,13 @@ int drmHandleEvent(int fd, drmEventContextPtr evctx) /* The DRM read semantics guarantees that we always get only * complete events. */ + +#ifdef HAVE_SPRD if(handleEventHook) { if (handleEventHook(fd, evctx) == 0) return 0; } +#endif len = read(fd, buffer, sizeof buffer); if (len == 0) |