summaryrefslogtreecommitdiff
path: root/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2016-11-14 15:24:16 -0500
committerChris Michael <cp.michael@samsung.com>2016-11-15 08:42:07 -0500
commitc58de1ce1dce70d036fd74b30bb346b1e2ff13b1 (patch)
treedf748a807eb410f7dc78b912bb04f4fd15bf4050 /src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
parentfbc58c3424f3ae4893b94cde7adac4e71d7ff526 (diff)
ecore-evas-drm: Fix call to drmHandleEvent
As we don't compile-time link to libdrm anymore, we need to make a call to ecore_drm2_event_handle in order to process drm events. Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to 'src/modules/ecore_evas/engines/drm/ecore_evas_drm.c')
-rw-r--r--src/modules/ecore_evas/engines/drm/ecore_evas_drm.c39
1 files changed, 33 insertions, 6 deletions
diff --git a/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c b/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
index ac970f5017..5e34d13852 100644
--- a/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
+++ b/src/modules/ecore_evas/engines/drm/ecore_evas_drm.c
@@ -12,15 +12,12 @@
12#include "ecore_evas_drm.h" 12#include "ecore_evas_drm.h"
13#include <Ecore_Drm2.h> 13#include <Ecore_Drm2.h>
14#include <Evas_Engine_Drm.h> 14#include <Evas_Engine_Drm.h>
15#include <drm_fourcc.h>
16 15
17#ifdef BUILD_ECORE_EVAS_GL_DRM 16#ifdef BUILD_ECORE_EVAS_GL_DRM
18# include <Evas_Engine_GL_Drm.h> 17# include <Evas_Engine_GL_Drm.h>
19# include <dlfcn.h> 18# include <dlfcn.h>
20#endif 19#endif
21 20
22#include <xf86drm.h>
23
24#ifdef EAPI 21#ifdef EAPI
25# undef EAPI 22# undef EAPI
26#endif 23#endif
@@ -43,6 +40,37 @@
43# endif 40# endif
44#endif /* ! _WIN32 */ 41#endif /* ! _WIN32 */
45 42
43/* DRM_FORMAT_XRGB8888 and fourcc_code borrowed from <drm_fourcc.h>
44 *
45 * Copyright 2011 Intel Corporation
46 *
47 * Permission is hereby granted, free of charge, to any person obtaining a
48 * copy of this software and associated documentation files (the "Software"),
49 * to deal in the Software without restriction, including without limitation
50 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
51 * and/or sell copies of the Software, and to permit persons to whom the
52 * Software is furnished to do so, subject to the following conditions:
53 *
54 * The above copyright notice and this permission notice (including the next
55 * paragraph) shall be included in all copies or substantial portions of the
56 * Software.
57 *
58 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
59 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
60 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
61 * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
62 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
63 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
64 * OTHER DEALINGS IN THE SOFTWARE.
65 */
66#define fourcc_code(a, b, c, d) \
67 ((uint32_t)(a) | ((uint32_t)(b) << 8) | \
68 ((uint32_t)(c) << 16) | ((uint32_t)(d) << 24))
69#define DRM_FORMAT_XRGB8888 \
70 fourcc_code('X', 'R', '2', '4') /* [31:0] x:R:G:B 8:8:8:8 little endian */
71
72/* end borrowed <drm_fourcc.h> code */
73
46typedef struct _Ecore_Evas_Engine_Drm_Data 74typedef struct _Ecore_Evas_Engine_Drm_Data
47{ 75{
48 int fd; 76 int fd;
@@ -51,7 +79,7 @@ typedef struct _Ecore_Evas_Engine_Drm_Data
51 int x, y, w, h; 79 int x, y, w, h;
52 int depth, bpp; 80 int depth, bpp;
53 unsigned int format; 81 unsigned int format;
54 drmEventContext ctx; 82 Ecore_Drm2_Context ctx;
55 Ecore_Fd_Handler *hdlr; 83 Ecore_Fd_Handler *hdlr;
56 Ecore_Drm2_Device *dev; 84 Ecore_Drm2_Device *dev;
57 Ecore_Drm2_Output *output; 85 Ecore_Drm2_Output *output;
@@ -601,7 +629,7 @@ _cb_drm_event(void *data, Ecore_Fd_Handler *hdlr EINA_UNUSED)
601 629
602 ee = data; 630 ee = data;
603 edata = ee->engine.data; 631 edata = ee->engine.data;
604 ret = drmHandleEvent(edata->fd, &edata->ctx); 632 ret = ecore_drm2_event_handle(edata->fd, &edata->ctx);
605 if (ret) 633 if (ret)
606 { 634 {
607 WRN("drmHandleEvent failed to read an event"); 635 WRN("drmHandleEvent failed to read an event");
@@ -898,7 +926,6 @@ _ecore_evas_new_internal(const char *device, int x, int y, int w, int h, Eina_Bo
898 926
899 /* setup vblank handler */ 927 /* setup vblank handler */
900 memset(&edata->ctx, 0, sizeof(edata->ctx)); 928 memset(&edata->ctx, 0, sizeof(edata->ctx));
901 edata->ctx.version = DRM_EVENT_CONTEXT_VERSION;
902 edata->ctx.page_flip_handler = _cb_pageflip; 929 edata->ctx.page_flip_handler = _cb_pageflip;
903 930
904 edata->hdlr = 931 edata->hdlr =