summaryrefslogtreecommitdiff
path: root/src/modules/evas/engines/gl_drm/evas_engine.h
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2015-06-02 09:05:26 -0400
committerChris Michael <cp.michael@samsung.com>2015-06-05 10:00:44 -0400
commit58dbb63ba4bbc235477793b016ba31d2bf17d1fb (patch)
treea8ca151bf5871043ebe10d9cc66054865c84bfac /src/modules/evas/engines/gl_drm/evas_engine.h
parent3f4c569341ab501b188f49c273bb961e0f1b75ee (diff)
evas-gl-drm: Remove old engine code
Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to '')
-rw-r--r--src/modules/evas/engines/gl_drm/evas_engine.h191
1 files changed, 0 insertions, 191 deletions
diff --git a/src/modules/evas/engines/gl_drm/evas_engine.h b/src/modules/evas/engines/gl_drm/evas_engine.h
deleted file mode 100644
index b97b0476fe..0000000000
--- a/src/modules/evas/engines/gl_drm/evas_engine.h
+++ /dev/null
@@ -1,191 +0,0 @@
1#ifndef EVAS_ENGINE_H
2# define EVAS_ENGINE_H
3
4#include "config.h"
5#include "evas_common_private.h"
6#include "evas_private.h"
7#include "Evas.h"
8#include "Evas_Engine_GL_Drm.h"
9#include "evas_macros.h"
10
11#define GL_GLEXT_PROTOTYPES
12#include <EGL/egl.h>
13#include <EGL/eglext.h>
14#include <EGL/eglmesaext.h>
15#include <GLES2/gl2.h>
16#include <GLES2/gl2ext.h>
17#include "../gl_generic/Evas_Engine_GL_Generic.h"
18
19#include <xf86drm.h>
20#include <xf86drmMode.h>
21#include <drm_fourcc.h>
22
23#include <signal.h>
24#include <sys/ioctl.h>
25#include <sys/types.h>
26#include <unistd.h>
27#include <fcntl.h>
28
29extern int extn_have_buffer_age;
30extern int _evas_engine_gl_drm_log_dom;
31
32extern Evas_GL_Common_Context_New glsym_evas_gl_common_context_new;
33extern Evas_GL_Common_Context_Call glsym_evas_gl_common_context_flush;
34extern Evas_GL_Common_Context_Call glsym_evas_gl_common_context_free;
35extern Evas_GL_Common_Context_Call glsym_evas_gl_common_context_use;
36extern Evas_GL_Common_Context_Call glsym_evas_gl_common_context_newframe;
37extern Evas_GL_Common_Context_Call glsym_evas_gl_common_context_done;
38extern Evas_GL_Common_Context_Resize_Call glsym_evas_gl_common_context_resize;
39extern Evas_GL_Common_Buffer_Dump_Call glsym_evas_gl_common_buffer_dump;
40extern Evas_GL_Preload_Render_Call glsym_evas_gl_preload_render_lock;
41extern Evas_GL_Preload_Render_Call glsym_evas_gl_preload_render_unlock;
42
43/* define this to enable debug for the gl_drm engine */
44/* #define GL_DRM_DBG 0 */
45
46# ifdef ERR
47# undef ERR
48# endif
49# define ERR(...) EINA_LOG_DOM_ERR(_evas_engine_gl_drm_log_dom, __VA_ARGS__)
50
51# ifdef DBG
52# undef DBG
53# endif
54# define DBG(...) EINA_LOG_DOM_DBG(_evas_engine_gl_drm_log_dom, __VA_ARGS__)
55
56# ifdef INF
57# undef INF
58# endif
59# define INF(...) EINA_LOG_DOM_INFO(_evas_engine_gl_drm_log_dom, __VA_ARGS__)
60
61# ifdef WRN
62# undef WRN
63# endif
64# define WRN(...) EINA_LOG_DOM_WARN(_evas_engine_gl_drm_log_dom, __VA_ARGS__)
65
66# ifdef CRI
67# undef CRI
68# endif
69# define CRI(...) EINA_LOG_DOM_CRIT(_evas_engine_gl_drm_log_dom, __VA_ARGS__)
70
71# define NUM_BUFFERS 2
72
73typedef struct _Buffer Buffer;
74typedef struct _Plane Plane;
75
76struct _Buffer
77{
78 int stride;
79 int size;
80 int handle;
81 unsigned int fb;
82 struct gbm_bo *bo; //used for hardware framebuffers
83 Eina_Bool valid : 1;
84};
85
86struct _Plane
87{
88 unsigned int id;
89 unsigned int crtcs;
90
91 struct
92 {
93 unsigned int x, y;
94 unsigned int w, h;
95 } src, dst;
96
97 unsigned int num_formats;
98 unsigned int formats[];
99};
100
101struct _Outbuf
102{
103 EGLContext egl_context[1];
104 EGLSurface egl_surface[1];
105 EGLConfig egl_config;
106 EGLDisplay egl_disp;
107 struct gbm_device *gbm;
108 struct gbm_surface *surface;
109 Evas *evas;
110 uint32_t format;
111 uint32_t flags;
112 Evas_Engine_GL_Context *gl_context;
113 Evas_Engine_Info_GL_Drm *info;
114 Render_Engine_Swap_Mode swap_mode;
115 int w, h;
116 int depth, rot, screen, alpha;
117 int prev_age;
118 int frame_cnt;
119 int vsync;
120 Eina_Bool lost_back : 1;
121 Eina_Bool surf : 1;
122
123 struct
124 {
125 Eina_Bool drew : 1;
126 } draw;
127
128 struct
129 {
130 int fd;
131 unsigned int conn, crtc, fb;
132 Buffer buffer[NUM_BUFFERS];
133 int curr, num;
134 drmModeModeInfo mode;
135 drmEventContext ctx;
136 Eina_List *pending_writes;
137 Eina_List *planes;
138 Eina_Bool pending_flip : 1;
139 } priv;
140};
141
142struct _Context_3D
143{
144 EGLDisplay display;
145 EGLContext context;
146 EGLSurface surface;
147};
148
149Outbuf *eng_window_new(Evas_Engine_Info_GL_Drm *info, Evas *e, struct gbm_device *gbm, struct gbm_surface *surface, int screen, int depth, int w, int h, int indirect, int alpha, int rot, Render_Engine_Swap_Mode swap_mode);
150void eng_window_free(Outbuf *gw);
151void eng_window_use(Outbuf *gw);
152void eng_window_unsurf(Outbuf *gw);
153void eng_window_resurf(Outbuf *gw);
154
155void eng_outbuf_reconfigure(Outbuf *ob, int w, int h, int rot, Outbuf_Depth depth);
156int eng_outbuf_get_rot(Outbuf *ob);
157Render_Engine_Swap_Mode eng_outbuf_swap_mode(Outbuf *ob);
158Eina_Bool eng_outbuf_region_first_rect(Outbuf *ob);
159void *eng_outbuf_new_region_for_update(Outbuf *ob, int x, int y, int w, int h, int *cx, int *cy, int *cw, int *ch);
160void eng_outbuf_push_free_region_for_update(Outbuf *ob, RGBA_Image *update);
161void eng_outbuf_push_updated_region(Outbuf *ob, RGBA_Image *update, int x, int y, int w, int h);
162void eng_outbuf_flush(Outbuf *ob, Tilebuf_Rect *rects, Evas_Render_Mode render_mode);
163Evas_Engine_GL_Context* eng_outbuf_gl_context_get(Outbuf *ob);
164void *eng_outbuf_egl_display_get(Outbuf *ob);
165
166void eng_gl_context_free(Context_3D *context);
167void eng_gl_context_use(Context_3D *context);
168
169Eina_Bool eng_preload_make_current(void *data, void *doit);
170
171Context_3D *eng_gl_context_new(Outbuf *win);
172
173static inline Eina_Bool
174_re_wincheck(Outbuf *ob)
175{
176 if (ob->surf) return EINA_TRUE;
177 eng_window_resurf(ob);
178 ob->lost_back = 1;
179 if (!ob->surf)
180 {
181 ERR("GL engine can't re-create window surface!");
182 }
183 return EINA_FALSE;
184}
185
186Eina_Bool evas_drm_gbm_init(Evas_Engine_Info_GL_Drm *info, int w, int h);
187Eina_Bool evas_drm_gbm_shutdown(Evas_Engine_Info_GL_Drm *info);
188Eina_Bool evas_drm_outbuf_setup(Outbuf *ob);
189void evas_drm_outbuf_framebuffer_set(Outbuf *ob, Buffer *buffer);
190Eina_Bool evas_drm_framebuffer_send(Outbuf *ob, Buffer *buffer);
191#endif