forked from enlightenment/efl
Merge branch 'master' of ssh://git.enlightenment.org/core/efl
This commit is contained in:
commit
1142864d6f
|
@ -8,11 +8,11 @@ static Evas_Engine_Info_GL_Drm *siginfo;
|
|||
static void
|
||||
_evas_drm_fb_destroy_callback(struct gbm_bo *bo, void *data)
|
||||
{
|
||||
Buffer *buffer = data;
|
||||
struct gbm_device *gbm = gbm_bo_get_device(bo);
|
||||
Buffer *buffer = data;
|
||||
struct gbm_device *gbm = gbm_bo_get_device(bo);
|
||||
|
||||
if (buffer->fb)
|
||||
drmModeRmFB(gbm_device_get_fd(gbm), buffer->fb);
|
||||
if (buffer->fb)
|
||||
drmModeRmFB(gbm_device_get_fd(gbm), buffer->fb);
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -363,9 +363,9 @@ evas_drm_gbm_init(Evas_Engine_Info_GL_Drm *info, int w, int h)
|
|||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
if (!(info->info.surface = gbm_surface_create(info->info.gbm, w, h,
|
||||
info->info.format,
|
||||
info->info.flags)))
|
||||
if (!(info->info.surface =
|
||||
gbm_surface_create(info->info.gbm, w, h,
|
||||
info->info.format, info->info.flags)))
|
||||
{
|
||||
gbm_device_destroy(info->info.gbm);
|
||||
info->info.gbm = NULL;
|
||||
|
@ -544,7 +544,6 @@ evas_drm_outbuf_framebuffer_set(Outbuf *ob, Buffer *buffer)
|
|||
|
||||
ret = drmModeAddFB2(ob->priv.fd, width, height, format, handles,
|
||||
pitches, offsets, &(buffer->fb), 0);
|
||||
|
||||
if (ret)
|
||||
{
|
||||
ret = drmModeAddFB(ob->priv.fd, width, height, 24, 32,
|
||||
|
@ -554,7 +553,6 @@ evas_drm_outbuf_framebuffer_set(Outbuf *ob, Buffer *buffer)
|
|||
|
||||
ret = drmModeSetCrtc(ob->priv.fd, ob->priv.crtc, buffer->fb, 0, 0,
|
||||
&ob->priv.conn, 1, &ob->priv.mode);
|
||||
|
||||
if (ret) ERR("Failed to set crtc: %m");
|
||||
|
||||
gbm_bo_set_user_data(buffer->bo, buffer, _evas_drm_fb_destroy_callback);
|
||||
|
|
|
@ -453,8 +453,7 @@ eng_outbuf_swap_mode(Outbuf *ob)
|
|||
|
||||
EGLint age = 0;
|
||||
|
||||
if (!eglQuerySurface(ob->egl_disp,
|
||||
ob->egl_surface[0],
|
||||
if (!eglQuerySurface(ob->egl_disp, ob->egl_surface[0],
|
||||
EGL_BUFFER_AGE_EXT, &age))
|
||||
age = 0;
|
||||
|
||||
|
@ -481,10 +480,7 @@ eng_outbuf_region_first_rect(Outbuf *ob)
|
|||
eng_window_use(ob);
|
||||
if (!_re_wincheck(ob)) return EINA_TRUE;
|
||||
|
||||
glsym_evas_gl_common_context_resize(ob->gl_context,
|
||||
ob->w, ob->h,
|
||||
ob->rot);
|
||||
|
||||
glsym_evas_gl_common_context_resize(ob->gl_context, ob->w, ob->h, ob->rot);
|
||||
glsym_evas_gl_common_context_flush(ob->gl_context);
|
||||
glsym_evas_gl_common_context_newframe(ob->gl_context);
|
||||
|
||||
|
@ -601,8 +597,7 @@ eng_outbuf_flush(Outbuf *ob, Tilebuf_Rect *rects, Evas_Render_Mode render_mode)
|
|||
}
|
||||
i += 4;
|
||||
}
|
||||
glsym_eglSwapBuffersWithDamage(ob->egl_disp,
|
||||
ob->egl_surface[0],
|
||||
glsym_eglSwapBuffersWithDamage(ob->egl_disp, ob->egl_surface[0],
|
||||
result, num);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -246,9 +246,9 @@ evgl_eng_display_get(void *data)
|
|||
}
|
||||
|
||||
if (eng_get_ob(re))
|
||||
return (void*)eng_get_ob(re)->egl_disp;
|
||||
return (void*)eng_get_ob(re)->egl_disp;
|
||||
else
|
||||
return NULL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void *
|
||||
|
@ -263,9 +263,9 @@ evgl_eng_evas_surface_get(void *data)
|
|||
}
|
||||
|
||||
if (eng_get_ob(re))
|
||||
return (void*)eng_get_ob(re)->egl_surface[0];
|
||||
return (void*)eng_get_ob(re)->egl_surface[0];
|
||||
else
|
||||
return NULL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -492,7 +492,6 @@ evgl_eng_string_get(void *data)
|
|||
}
|
||||
|
||||
return eglQueryString(eng_get_ob(re)->egl_disp, EGL_EXTENSIONS);
|
||||
|
||||
}
|
||||
|
||||
static void *
|
||||
|
@ -514,7 +513,7 @@ evgl_eng_rotation_angle_get(void *data)
|
|||
}
|
||||
|
||||
if ((eng_get_ob(re)) && (eng_get_ob(re)->gl_context))
|
||||
return eng_get_ob(re)->gl_context->rot;
|
||||
return eng_get_ob(re)->gl_context->rot;
|
||||
else
|
||||
{
|
||||
ERR("Unable to retrieve rotation angle.");
|
||||
|
@ -573,29 +572,20 @@ eng_setup(Evas *eo_e, void *in)
|
|||
|
||||
if ((s = getenv("EVAS_GL_SWAP_MODE")))
|
||||
{
|
||||
if ((!strcasecmp(s, "full")) ||
|
||||
(!strcasecmp(s, "f")))
|
||||
if ((!strcasecmp(s, "full")) || (!strcasecmp(s, "f")))
|
||||
swap_mode = MODE_FULL;
|
||||
else if ((!strcasecmp(s, "copy")) ||
|
||||
(!strcasecmp(s, "c")))
|
||||
else if ((!strcasecmp(s, "copy")) || (!strcasecmp(s, "c")))
|
||||
swap_mode = MODE_COPY;
|
||||
else if ((!strcasecmp(s, "double")) ||
|
||||
(!strcasecmp(s, "d")) ||
|
||||
(!strcasecmp(s, "2")))
|
||||
(!strcasecmp(s, "d")) || (!strcasecmp(s, "2")))
|
||||
swap_mode = MODE_DOUBLE;
|
||||
else if ((!strcasecmp(s, "triple")) ||
|
||||
(!strcasecmp(s, "t")) ||
|
||||
(!strcasecmp(s, "3")))
|
||||
(!strcasecmp(s, "t")) || (!strcasecmp(s, "3")))
|
||||
swap_mode = MODE_TRIPLE;
|
||||
else if ((!strcasecmp(s, "quadruple")) ||
|
||||
(!strcasecmp(s, "q")) ||
|
||||
(!strcasecmp(s, "4")))
|
||||
(!strcasecmp(s, "q")) || (!strcasecmp(s, "4")))
|
||||
swap_mode = MODE_QUADRUPLE;
|
||||
}
|
||||
else
|
||||
{
|
||||
swap_mode = MODE_FULL;
|
||||
}
|
||||
|
||||
/* check for existing engine output */
|
||||
if (!epd->engine.data.output)
|
||||
|
@ -623,8 +613,7 @@ eng_setup(Evas *eo_e, void *in)
|
|||
if (info->info.fd < 0)
|
||||
{
|
||||
/* try to init drm (this includes openening the card & tty) */
|
||||
if (!ecore_drm_init())
|
||||
return 0;
|
||||
if (!ecore_drm_init()) return 0;
|
||||
|
||||
/* try getting the default drm device */
|
||||
if (!(drm_dev = ecore_drm_device_find(NULL, NULL)))
|
||||
|
@ -664,24 +653,19 @@ eng_setup(Evas *eo_e, void *in)
|
|||
}
|
||||
}
|
||||
|
||||
DBG("FD: %d, GBM_DEVICE: 0x%x, GBM_SURFACE: 0x%x",
|
||||
info->info.fd, (unsigned int)info->info.gbm,
|
||||
(unsigned int)info->info.surface);
|
||||
DBG("FD: %d, GBM_DEVICE: 0x%x, GBM_SURFACE: 0x%x",
|
||||
info->info.fd, (unsigned int)info->info.gbm,
|
||||
(unsigned int)info->info.surface);
|
||||
|
||||
re = calloc(1, sizeof(Render_Engine));
|
||||
if (!re) return 0;
|
||||
|
||||
/* try to create new outbuf */
|
||||
ob = eng_window_new(info, eo_e,
|
||||
info->info.gbm,
|
||||
info->info.surface,
|
||||
info->info.screen,
|
||||
info->info.depth,
|
||||
epd->output.w, epd->output.h,
|
||||
info->indirect,
|
||||
ob = eng_window_new(info, eo_e, info->info.gbm, info->info.surface,
|
||||
info->info.screen,info->info.depth,
|
||||
epd->output.w, epd->output.h, info->indirect,
|
||||
info->info.destination_alpha,
|
||||
info->info.rotation,
|
||||
swap_mode);
|
||||
info->info.rotation, swap_mode);
|
||||
if (!ob)
|
||||
{
|
||||
/* shutdown destroy gbm surface & shutdown gbm device */
|
||||
|
@ -694,7 +678,6 @@ eng_setup(Evas *eo_e, void *in)
|
|||
return 0;
|
||||
}
|
||||
|
||||
|
||||
if (!evas_render_engine_gl_generic_init(&re->generic, ob,
|
||||
eng_outbuf_swap_mode,
|
||||
eng_outbuf_get_rot,
|
||||
|
@ -732,11 +715,9 @@ eng_setup(Evas *eo_e, void *in)
|
|||
|
||||
if ((s = getenv("EVAS_GL_PARTIAL_MERGE")))
|
||||
{
|
||||
if ((!strcmp(s, "bounding")) ||
|
||||
(!strcmp(s, "b")))
|
||||
if ((!strcmp(s, "bounding")) || (!strcmp(s, "b")))
|
||||
merge_mode = MERGE_BOUNDING;
|
||||
else if ((!strcmp(s, "full")) ||
|
||||
(!strcmp(s, "f")))
|
||||
else if ((!strcmp(s, "full")) || (!strcmp(s, "f")))
|
||||
merge_mode = MERGE_FULL;
|
||||
}
|
||||
|
||||
|
@ -808,16 +789,13 @@ eng_setup(Evas *eo_e, void *in)
|
|||
info->info.fd, (unsigned int)info->info.gbm,
|
||||
(unsigned int)info->info.surface);
|
||||
|
||||
ob = eng_window_new(info, eo_e,
|
||||
info->info.gbm,
|
||||
info->info.surface,
|
||||
info->info.screen,
|
||||
ob = eng_window_new(info, eo_e, info->info.gbm,
|
||||
info->info.surface, info->info.screen,
|
||||
info->info.depth,
|
||||
epd->output.w, epd->output.h,
|
||||
info->indirect,
|
||||
info->info.destination_alpha,
|
||||
info->info.rotation,
|
||||
swap_mode);
|
||||
info->info.rotation, swap_mode);
|
||||
|
||||
eng_window_use(ob);
|
||||
if (ob)
|
||||
|
@ -831,6 +809,7 @@ eng_setup(Evas *eo_e, void *in)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!eng_get_ob(re))
|
||||
{
|
||||
free(re);
|
||||
|
@ -860,6 +839,7 @@ eng_setup(Evas *eo_e, void *in)
|
|||
epd->engine.data.context =
|
||||
epd->engine.func->context_new(epd->engine.data.output);
|
||||
}
|
||||
|
||||
eng_window_use(eng_get_ob(re));
|
||||
|
||||
return 1;
|
||||
|
@ -956,8 +936,8 @@ module_open(Evas_Module *em)
|
|||
/* try to create eina logging domain */
|
||||
if (_evas_engine_gl_drm_log_dom < 0)
|
||||
{
|
||||
_evas_engine_gl_drm_log_dom =
|
||||
eina_log_domain_register("evas-gl-drm", EVAS_DEFAULT_LOG_COLOR);
|
||||
_evas_engine_gl_drm_log_dom =
|
||||
eina_log_domain_register("evas-gl-drm", EVAS_DEFAULT_LOG_COLOR);
|
||||
}
|
||||
|
||||
/* if we could not create a logging domain, error out */
|
||||
|
@ -980,8 +960,7 @@ module_open(Evas_Module *em)
|
|||
ORD(output_dump);
|
||||
|
||||
/* Mesa's EGL driver loads wayland egl by default. (called by eglGetProcaddr() )
|
||||
* implicit env set (EGL_PLATFORM=drm) prevent that.
|
||||
*/
|
||||
* implicit env set (EGL_PLATFORM=drm) prevent that. */
|
||||
setenv("EGL_PLATFORM", "drm", 1);
|
||||
gl_symbols();
|
||||
|
||||
|
@ -999,13 +978,7 @@ module_close(Evas_Module *em EINA_UNUSED)
|
|||
|
||||
static Evas_Module_Api evas_modapi =
|
||||
{
|
||||
EVAS_MODULE_API_VERSION,
|
||||
"gl_drm",
|
||||
"none",
|
||||
{
|
||||
module_open,
|
||||
module_close
|
||||
}
|
||||
EVAS_MODULE_API_VERSION, "gl_drm", "none", { module_open, module_close }
|
||||
};
|
||||
|
||||
EVAS_MODULE_DEFINE(EVAS_MODULE_TYPE_ENGINE, engine, gl_drm);
|
||||
|
|
Loading…
Reference in New Issue