summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2013-04-29 13:02:00 +0100
committerChris Michael <cp.michael@samsung.com>2013-04-29 13:02:00 +0100
commit57052b92e1a1d8b0c73a69f8a2e9e977a156f956 (patch)
treed4217cb2b6a9839012dfa4a937f9a50ad2c09ecb /src
parent53fd97fd084d518afe26a53982e87dacea8c717d (diff)
Add start of drm engine
NB: Nothing to see here, just basic evas_engine setup. Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to 'src')
-rw-r--r--src/modules/evas/engines/drm/evas_engine.c89
1 files changed, 89 insertions, 0 deletions
diff --git a/src/modules/evas/engines/drm/evas_engine.c b/src/modules/evas/engines/drm/evas_engine.c
new file mode 100644
index 0000000..a3fa93e
--- /dev/null
+++ b/src/modules/evas/engines/drm/evas_engine.c
@@ -0,0 +1,89 @@
1#include "evas_common.h"
2#include "evas_private.h"
3#include "Evas_Engine_Drm.h"
4#include "evas_engine.h"
5
6/* function tables - filled in later (func and parent func) */
7static Evas_Func func, pfunc;
8
9/* external variables */
10int _evas_engine_drm_log_dom;
11
12/* engine api functions */
13static void *
14eng_info(Evas *evas EINA_UNUSED)
15{
16 Evas_Engine_Info_Drm *info;
17
18 /* try to allocate space for our engine info structure */
19 if (!(info = calloc(1, sizeof(Evas_Engine_Info_Drm))))
20 return NULL;
21
22 /* set some engine default properties */
23 info->magic.magic = rand();
24 info->render_mode = EVAS_RENDER_MODE_BLOCKING;
25
26 return info;
27}
28
29static void
30eng_info_free(Evas *evas EINA_UNUSED, void *einfo)
31{
32 Evas_Engine_Info_Drm *info;
33
34 /* free the engine info */
35 if ((info = (Evas_Engine_Info_Drm *)einfo))
36 free(info);
37}
38
39/* module api functions */
40static int
41module_open(Evas_Module *em)
42{
43 /* check for valid evas module */
44 if (!em) return 0;
45
46 /* try to inherit functions from software_generic engine */
47 if (!_evas_module_engine_inherit(&pfunc, "software_generic")) return 0;
48
49 /* try to create eina logging domain */
50 _evas_engine_drm_log_dom =
51 eina_log_domain_register("evas-drm", EVAS_DEFAULT_LOG_COLOR);
52
53 /* if we could not create a logging domain, error out */
54 if (_evas_engine_drm_log_dom < 0)
55 {
56 EINA_LOG_ERR("Can not create a module log domain.");
57 return 0;
58 }
59
60 /* store parent functions */
61 func = pfunc;
62
63 /* override the methods we provide */
64 EVAS_API_OVERRIDE(info, &func, eng_);
65 EVAS_API_OVERRIDE(info_free, &func, eng_);
66
67 /* advertise our engine functions */
68 em->functions = (void *)(&func);
69
70 return 1;
71}
72
73static void
74module_close(Evas_Module *em EINA_UNUSED)
75{
76 /* unregister the eina log domain for this engine */
77 eina_log_domain_unregister(_evas_engine_drm_log_dom);
78}
79
80static Evas_Module_Api evas_modapi =
81{
82 EVAS_MODULE_API_VERSION, "drm", "none", { module_open, module_close }
83};
84
85EVAS_MODULE_DEFINE(EVAS_MODULE_TYPE_ENGINE, engine, drm);
86
87#ifndef EVAS_STATIC_BUILD_DRM
88EVAS_EINA_MODULE_DEFINE(engine, drm);
89#endif