summaryrefslogtreecommitdiff
path: root/src/modules/evas/engines/drm/evas_engine.h
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2014-02-11 07:09:39 +0000
committerChris Michael <cp.michael@samsung.com>2014-02-28 13:08:19 +0000
commitb42af265bee3f8ffd8c113a585c3d6a8f0460ca0 (patch)
treec566fa985741cc69b2f9afe18aff5d7f508a26d2 /src/modules/evas/engines/drm/evas_engine.h
parentb36adec9523c15425b1ceb337e69c060bef3a2f9 (diff)
evas-drm: Add Evas Drm Engine (software only currently)
@feature: Add working Evas_Drm Engine (software only currently) Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to 'src/modules/evas/engines/drm/evas_engine.h')
-rw-r--r--src/modules/evas/engines/drm/evas_engine.h74
1 files changed, 72 insertions, 2 deletions
diff --git a/src/modules/evas/engines/drm/evas_engine.h b/src/modules/evas/engines/drm/evas_engine.h
index 3cfbbeeb6a..5abfcd8a11 100644
--- a/src/modules/evas/engines/drm/evas_engine.h
+++ b/src/modules/evas/engines/drm/evas_engine.h
@@ -1,6 +1,22 @@
1#ifndef EVAS_ENGINE_H 1#ifndef EVAS_ENGINE_H
2# define EVAS_ENGINE_H 2# define EVAS_ENGINE_H
3 3
4#include "evas_common_private.h"
5#include "evas_macros.h"
6#include "evas_private.h"
7#include "Evas.h"
8#include "Evas_Engine_Drm.h"
9
10#include <xf86drm.h>
11#include <xf86drmMode.h>
12#include <drm_fourcc.h>
13
14#include <signal.h>
15#include <sys/ioctl.h>
16#include <sys/types.h>
17#include <unistd.h>
18#include <fcntl.h>
19
4extern int _evas_engine_drm_log_dom; 20extern int _evas_engine_drm_log_dom;
5 21
6# ifdef ERR 22# ifdef ERR
@@ -28,6 +44,10 @@ extern int _evas_engine_drm_log_dom;
28# endif 44# endif
29# define CRI(...) EINA_LOG_DOM_CRIT(_evas_engine_drm_log_dom, __VA_ARGS__) 45# define CRI(...) EINA_LOG_DOM_CRIT(_evas_engine_drm_log_dom, __VA_ARGS__)
30 46
47/* define a maximum number of 'buffers' (double-buff, triple-buff, etc) */
48# define NUM_BUFFERS 2
49
50typedef struct _Buffer Buffer;
31typedef struct _Outbuf Outbuf; 51typedef struct _Outbuf Outbuf;
32 52
33enum 53enum
@@ -38,15 +58,65 @@ enum
38 MODE_TRIPLE 58 MODE_TRIPLE
39}; 59};
40 60
61enum
62{
63 OUTBUF_DEPTH_NONE,
64 OUTBUF_DEPTH_ARGB_32BPP_8888_8888,
65 OUTBUF_DEPTH_RGB_32BPP_8888_8888,
66 OUTBUF_DEPTH_LAST
67};
68
69struct _Buffer
70{
71 int w, h;
72 int stride, size;
73 int handle;
74 unsigned int fb;
75 void *data;
76
77 Eina_Bool valid : 1;
78};
79
41struct _Outbuf 80struct _Outbuf
42{ 81{
43 int w, h; 82 int w, h;
44 unsigned int rotation, depth; 83 unsigned int rotation, depth;
45 Eina_Bool destination_alpha : 1; 84 Eina_Bool destination_alpha : 1;
85
86 struct
87 {
88 RGBA_Image *onebuf;
89 Eina_Array onebuf_regions;
90
91 Buffer buffer[NUM_BUFFERS], *sent;
92 int curr, num;
93
94 int fd;
95 unsigned int conn, crtc;
96 drmModeModeInfo mode;
97 drmEventContext ctx;
98 Eina_Bool pending_flip : 1;
99
100 Eina_List *pending_writes;
101 Eina_List *prev_pending_writes;
102 } priv;
46}; 103};
47 104
48Outbuf *evas_outbuf_setup(int w, int h, unsigned int rotation, unsigned int depth, Eina_Bool alpha); 105Outbuf *evas_outbuf_setup(Evas_Engine_Info_Drm *info, int w, int h);
49void evas_outbuf_free(Outbuf *ob); 106void evas_outbuf_free(Outbuf *ob);
50void evas_outbuf_reconfigure(Outbuf *ob, int w, int h, unsigned int rotation, unsigned int depth, Eina_Bool alpha); 107void evas_outbuf_reconfigure(Evas_Engine_Info_Drm *info, Outbuf *ob, int w, int h);
108int evas_outbuf_buffer_state_get(Outbuf *ob);
109RGBA_Image *evas_outbuf_update_region_new(Outbuf *ob, int x, int y, int w, int h, int *cx, int *cy, int *cw, int *ch);
110void evas_outbuf_update_region_push(Outbuf *ob, RGBA_Image *update, int x, int y, int w, int h);
111void evas_outbuf_flush(Outbuf *ob);
112
113Eina_Bool evas_drm_init(Evas_Engine_Info_Drm *info, int card);
114Eina_Bool evas_drm_shutdown(Evas_Engine_Info_Drm *info);
115
116Eina_Bool evas_drm_outbuf_setup(Outbuf *ob);
117void evas_drm_outbuf_framebuffer_set(Outbuf *ob, Buffer *buffer);
118Eina_Bool evas_drm_framebuffer_create(int fd, Buffer *buffer, int depth);
119void evas_drm_framebuffer_destroy(int fd, Buffer *buffer);
120Eina_Bool evas_drm_framebuffer_send(Outbuf *ob, Buffer *buffer, Eina_Rectangle *rects, unsigned int count);
51 121
52#endif 122#endif