diff options
author | Srivardhan Hebbar <sri.hebbar@samsung.com> | 2014-10-30 09:33:55 -0400 |
---|---|---|
committer | Chris Michael <cp.michael@samsung.com> | 2014-10-30 09:36:21 -0400 |
commit | 399c571ab6c74efad9603d89dae8e947436ff6f4 (patch) | |
tree | 9d64417b6e720559950e326076266e8f531747be | |
parent | 864394e7938e7d6389e40c458371bd548d0eb1a3 (diff) | |
download | efl-399c571ab6c74efad9603d89dae8e947436ff6f4.tar.gz |
ecoreidrm: Cleaned up unwanted code.
Summary: Cleaned up all unwanted code's in ecore_drm. This just
removes a bunch of already commented out code.
@fix
Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>
Reviewers: devilhorns
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D1615
-rw-r--r-- | src/lib/ecore_drm/Ecore_Drm.h | 13 | ||||
-rw-r--r-- | src/lib/ecore_drm/ecore_drm.c | 4 | ||||
-rw-r--r-- | src/lib/ecore_drm/ecore_drm_dbus.c | 1 | ||||
-rw-r--r-- | src/lib/ecore_drm/ecore_drm_device.c | 129 | ||||
-rw-r--r-- | src/lib/ecore_drm/ecore_drm_fb.c | 57 | ||||
-rw-r--r-- | src/lib/ecore_drm/ecore_drm_output.c | 176 | ||||
-rw-r--r-- | src/lib/ecore_drm/ecore_drm_private.h | 23 |
7 files changed, 0 insertions, 403 deletions
diff --git a/src/lib/ecore_drm/Ecore_Drm.h b/src/lib/ecore_drm/Ecore_Drm.h index 81d6bf92ad..e85cdf10b4 100644 --- a/src/lib/ecore_drm/Ecore_Drm.h +++ b/src/lib/ecore_drm/Ecore_Drm.h @@ -61,9 +61,6 @@ typedef struct _Ecore_Drm_Fb unsigned int stride, size; int fd; void *mmap; -/* #ifdef HAVE_GBM */ -/* struct gbm_bo *bo; */ -/* #endif */ } Ecore_Drm_Fb; struct _Ecore_Drm_Device @@ -108,16 +105,6 @@ struct _Ecore_Drm_Device struct xkb_context *xkb_ctx; unsigned int window; - -/* #ifdef HAVE_GBM */ -/* struct gbm_device *gbm; */ -/* struct */ -/* { */ -/* EGLDisplay disp; */ -/* EGLContext ctxt; */ -/* EGLConfig cfg; */ -/* } egl; */ -/* #endif */ }; /* opaque structure to represent a drm device */ diff --git a/src/lib/ecore_drm/ecore_drm.c b/src/lib/ecore_drm/ecore_drm.c index 0a81bf27f6..4f15893641 100644 --- a/src/lib/ecore_drm/ecore_drm.c +++ b/src/lib/ecore_drm/ecore_drm.c @@ -142,10 +142,6 @@ ecore_drm_gbm_get(Ecore_Drm_Device *dev) { if (!dev) return NULL; -#ifdef HAVE_GBM - return dev->gbm; -#endif - return NULL; } diff --git a/src/lib/ecore_drm/ecore_drm_dbus.c b/src/lib/ecore_drm/ecore_drm_dbus.c index 631a4378c6..83b48b3207 100644 --- a/src/lib/ecore_drm/ecore_drm_dbus.c +++ b/src/lib/ecore_drm/ecore_drm_dbus.c @@ -67,7 +67,6 @@ _cb_device_paused(void *ctxt EINA_UNUSED, const Eldbus_Message *msg) { if (!strcmp(type, "pause")) { - /* TODO: device pause done */ _ecore_drm_dbus_device_pause_done(maj, min); } diff --git a/src/lib/ecore_drm/ecore_drm_device.c b/src/lib/ecore_drm/ecore_drm_device.c index ff9a224c1d..e8ca0521fa 100644 --- a/src/lib/ecore_drm/ecore_drm_device.c +++ b/src/lib/ecore_drm/ecore_drm_device.c @@ -5,49 +5,6 @@ #include "ecore_drm_private.h" #include <dlfcn.h> -/* #ifdef HAVE_GBM */ -/* static Eina_Bool */ -/* _ecore_drm_device_egl_config_get(Ecore_Drm_Device *dev, const EGLint *attribs, const EGLint *visual) */ -/* { */ -/* EGLint c = 0, m = 0; */ -/* EGLConfig *cfgs; */ -/* int i = 0; */ - -/* if (!eglGetConfigs(dev->egl.disp, NULL, 0, &c) || (c < 1)) */ -/* return EINA_FALSE; */ - -/* if (!(cfgs = calloc(c, sizeof(*cfgs)))) return EINA_FALSE; */ - -/* if (!eglChooseConfig(dev->egl.disp, attribs, cfgs, c, &m)) */ -/* { */ -/* free(cfgs); */ -/* return EINA_FALSE; */ -/* } */ - -/* for (i = 0; i < m; i++) */ -/* { */ -/* EGLint id; */ - -/* if (visual) */ -/* { */ -/* if (!eglGetConfigAttrib(dev->egl.disp, cfgs[i], */ -/* EGL_NATIVE_VISUAL_ID, &id)) */ -/* continue; */ - -/* if ((id != 0) && (id != *visual)) */ -/* continue; */ -/* } */ - -/* dev->egl.cfg = cfgs[i]; */ -/* free(cfgs); */ -/* return EINA_TRUE; */ -/* } */ - -/* free(cfgs); */ -/* return EINA_FALSE; */ -/* } */ -/* #endif */ - static void _ecore_drm_device_cb_page_flip(int fd EINA_UNUSED, unsigned int frame EINA_UNUSED, unsigned int sec EINA_UNUSED, unsigned int usec EINA_UNUSED, void *data) { @@ -322,76 +279,6 @@ ecore_drm_device_open(Ecore_Drm_Device *dev) return EINA_FALSE; } -/* #ifdef HAVE_GBM */ -/* if (getenv("ECORE_DRM_HW_ACCEL")) */ -/* { */ - /* Typically, gbm loads the dri driver However some versions of Mesa - * do not have libglapi symbols linked in the driver. Because of this, - * using hardware accel for our drm code Could fail with a - * message that the driver could not load. Let's be proactive and - * work around this for the user by preloading the glapi library */ - /* dlopen("libglapi.so.0", (RTLD_LAZY | RTLD_GLOBAL)); */ - - /* if ((dev->gbm = gbm_create_device(dev->drm.fd))) */ - /* { */ - /* EGLint major, minor, visual; */ - /* const EGLint attribs[] = */ - /* { */ - /* EGL_SURFACE_TYPE, EGL_WINDOW_BIT, */ - /* EGL_RED_SIZE, 1, EGL_GREEN_SIZE, 1, */ - /* EGL_BLUE_SIZE, 1, EGL_ALPHA_SIZE, 0, */ - /* EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, EGL_NONE */ - /* }; */ - - /* dev->use_hw_accel = EINA_TRUE; */ - /* dev->format = GBM_FORMAT_XRGB8888; */ - - /* dev->egl.disp = eglGetDisplay(dev->gbm); */ - /* if (dev->egl.disp == EGL_NO_DISPLAY) */ - /* { */ - /* ERR("Could not get egl display"); */ - /* goto init_software; */ - /* } */ - - /* if (!eglInitialize(dev->egl.disp, &major, &minor)) */ - /* { */ - /* ERR("Could not initialize egl"); */ - /* goto init_software; */ - /* } */ - - /* visual = dev->format; */ - /* if (!_ecore_drm_device_egl_config_get(dev, attribs, &visual)) */ - /* { */ - /* ERR("Could not get egl config"); */ - /* goto init_software; */ - /* } */ - /* } */ - /* else */ - /* { */ - /* WRN("Failed to create gbm device"); */ - /* goto init_software; */ - /* } */ - /* } */ - /* else */ -/* #endif */ - /* { */ - /* TODO: init software */ -/* init_software: */ -/* DBG("Init Software Engine"); */ -/* #ifdef HAVE_GBM */ -/* if (dev->egl.disp) */ -/* { */ -/* eglMakeCurrent(dev->egl.disp, EGL_NO_SURFACE, EGL_NO_SURFACE, */ -/* EGL_NO_CONTEXT); */ -/* eglTerminate(dev->egl.disp); */ -/* eglReleaseThread(); */ -/* } */ - -/* if (dev->gbm) gbm_device_destroy(dev->gbm); */ -/* dev->gbm = NULL; */ -/* #endif */ -/* } */ - /* try to create xkb context */ if (!(dev->xkb_ctx = xkb_context_new(0))) { @@ -426,22 +313,6 @@ ecore_drm_device_close(Ecore_Drm_Device *dev) /* check for valid device */ if (!dev) return EINA_FALSE; -/* #ifdef HAVE_GBM */ -/* if (dev->use_hw_accel) */ -/* { */ -/* if (dev->egl.disp) */ -/* { */ -/* eglMakeCurrent(dev->egl.disp, EGL_NO_SURFACE, EGL_NO_SURFACE, */ -/* EGL_NO_CONTEXT); */ -/* eglTerminate(dev->egl.disp); */ -/* eglReleaseThread(); */ -/* } */ - -/* if (dev->gbm) gbm_device_destroy(dev->gbm); */ -/* dev->gbm = NULL; */ -/* } */ -/* #endif */ - /* close xkb context */ if (dev->xkb_ctx) xkb_context_unref(dev->xkb_ctx); diff --git a/src/lib/ecore_drm/ecore_drm_fb.c b/src/lib/ecore_drm/ecore_drm_fb.c index 1ba0390ced..af05c171c5 100644 --- a/src/lib/ecore_drm/ecore_drm_fb.c +++ b/src/lib/ecore_drm/ecore_drm_fb.c @@ -95,60 +95,3 @@ ecore_drm_fb_destroy(Ecore_Drm_Fb *fb) drmIoctl(fb->fd, DRM_IOCTL_MODE_DESTROY_DUMB, &darg); free(fb); } - -/* #ifdef HAVE_GBM */ -/* static void */ -/* _ecore_drm_fb_user_data_destroy(struct gbm_bo *bo EINA_UNUSED, void *data) */ -/* { */ -/* Ecore_Drm_Fb *fb; */ - -/* if (!(fb = data)) return; */ -/* ecore_drm_fb_destroy(fb); */ -/* } */ - -/* Ecore_Drm_Fb * */ -/* _ecore_drm_fb_bo_get(Ecore_Drm_Device *dev, struct gbm_bo *bo) */ -/* { */ -/* Ecore_Drm_Fb *fb; */ -/* unsigned int width, height; */ -/* unsigned int h[4], p[4], o[4]; */ -/* int ret = -1; */ - -/* if ((fb = gbm_bo_get_user_data(bo))) return fb; */ - -/* if (!(fb = calloc(1, sizeof(Ecore_Drm_Fb)))) return NULL; */ - -/* fb->bo = bo; */ - -/* width = gbm_bo_get_width(bo); */ -/* height = gbm_bo_get_height(bo); */ -/* fb->stride = gbm_bo_get_stride(bo); */ -/* fb->hdl = gbm_bo_get_handle(bo).u32; */ -/* fb->size = (fb->stride * height); */ -/* fb->fd = dev->drm.fd; */ - -/* h[0] = fb->hdl; */ -/* p[0] = fb->stride; */ -/* o[0] = 0; */ - -/* ret = drmModeAddFB2(dev->drm.fd, width, height, dev->format, h, p, o, */ -/* &fb->id, 0); */ -/* if (ret) */ -/* { */ -/* ret = drmModeAddFB(dev->drm.fd, width, height, 24, 32, */ -/* fb->stride, fb->hdl, &fb->id); */ - -/* } */ - -/* if (ret) */ -/* { */ -/* ERR("Error during ModeAddFb"); */ -/* free(fb); */ -/* return NULL; */ -/* } */ - -/* gbm_bo_set_user_data(bo, fb, _ecore_drm_fb_user_data_destroy); */ - -/* return fb; */ -/* } */ -/* #endif */ diff --git a/src/lib/ecore_drm/ecore_drm_output.c b/src/lib/ecore_drm/ecore_drm_output.c index 3ec9665bd4..b6e0df8064 100644 --- a/src/lib/ecore_drm/ecore_drm_output.c +++ b/src/lib/ecore_drm/ecore_drm_output.c @@ -14,145 +14,6 @@ static const char *conn_types[] = }; /* local functions */ -/* #ifdef HAVE_GBM */ -/* static Eina_Bool */ -/* _ecore_drm_output_context_create(Ecore_Drm_Device *dev, EGLSurface surface) */ -/* { */ -/* EGLBoolean r; */ -/* static const EGLint attribs[] = */ -/* { */ -/* EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE */ -/* }; */ - -/* if ((!dev->egl.disp) || (!dev->egl.cfg)) return EINA_FALSE; */ - -/* if (!eglBindAPI(EGL_OPENGL_ES_API)) */ -/* { */ -/* ERR("Could not bind egl api"); */ -/* return EINA_FALSE; */ -/* } */ - -/* dev->egl.ctxt = */ -/* eglCreateContext(dev->egl.disp, dev->egl.cfg, EGL_NO_CONTEXT, attribs); */ -/* if (!dev->egl.ctxt) */ -/* { */ -/* ERR("Could not create Egl Context"); */ -/* return EINA_FALSE; */ -/* } */ - -/* r = eglMakeCurrent(dev->egl.disp, surface, surface, dev->egl.ctxt); */ -/* if (r == EGL_FALSE) */ -/* { */ -/* ERR("Could not make surface current"); */ -/* return EINA_FALSE; */ -/* } */ - -/* return EINA_TRUE; */ -/* } */ - -/* static Eina_Bool */ -/* _ecore_drm_output_hardware_setup(Ecore_Drm_Device *dev, Ecore_Drm_Output *output) */ -/* { */ -/* unsigned int i = 0; */ -/* int flags = 0; */ -/* int w = 0, h = 0; */ - -/* if ((!dev) || (!output)) return EINA_FALSE; */ - -/* if (output->current_mode) */ -/* { */ -/* w = output->current_mode->width; */ -/* h = output->current_mode->height; */ -/* } */ -/* else */ -/* { */ -/* w = 1024; */ -/* h = 768; */ -/* } */ - -/* flags = (GBM_BO_USE_SCANOUT | GBM_BO_USE_RENDERING); */ - -/* if (!(output->surface = */ -/* gbm_surface_create(dev->gbm, w, h, GBM_FORMAT_ARGB8888, flags))) */ -/* { */ -/* ERR("Could not create output surface"); */ -/* return EINA_FALSE; */ -/* } */ - -/* if (!(output->egl.surface = */ -/* eglCreateWindowSurface(dev->egl.disp, dev->egl.cfg, */ -/* output->surface, NULL))) */ -/* { */ -/* ERR("Could not create output egl surface"); */ -/* gbm_surface_destroy(output->surface); */ -/* return EINA_FALSE; */ -/* } */ - -/* if (!dev->egl.ctxt) */ -/* { */ -/* if (!_ecore_drm_output_context_create(dev, output->egl.surface)) */ -/* { */ -/* ERR("Could not create context"); */ -/* gbm_surface_destroy(output->surface); */ -/* return EINA_FALSE; */ -/* } */ -/* } */ - -/* flags = (GBM_BO_USE_CURSOR_64X64 | GBM_BO_USE_WRITE); */ -/* for (i = 0; i < NUM_FRAME_BUFFERS; i++) */ -/* { */ -/* if (output->cursor[i]) continue; */ -/* if (!(output->cursor[i] = */ -/* gbm_bo_create(dev->gbm, 64, 64, dev->format, flags))) */ -/* { */ -/* continue; */ -/* } */ -/* } */ - -/* if ((!output->cursor[0]) || (!output->cursor[1])) */ -/* { */ -/* WRN("Hardware Cursor Buffers not available"); */ -/* dev->cursors_broken = EINA_TRUE; */ -/* } */ - -/* return EINA_TRUE; */ -/* } */ - -/* static void */ -/* _ecore_drm_output_hardware_render(Ecore_Drm_Output *output) */ -/* { */ -/* struct gbm_bo *bo; */ -/* int ret; */ - -/* if (!output) return; */ -/* if (!output->current_mode) return; */ - -/* glViewport(output->x, output->y, */ -/* output->current_mode->width, output->current_mode->height); */ - -/* if (eglMakeCurrent(output->dev->egl.disp, output->egl.surface, */ -/* output->egl.surface, output->dev->egl.ctxt) == EGL_FALSE) */ -/* return; */ - -/* glClearColor(1.0, 1.0, 0.0, 1.0); */ -/* glClear(GL_COLOR_BUFFER_BIT); */ -/* glFlush(); */ - -/* eglSwapBuffers(output->dev->egl.disp, output->egl.surface); */ - -/* if (!(bo = gbm_surface_lock_front_buffer(output->surface))) */ -/* { */ -/* ERR("Failed to lock front buffer"); */ -/* return; */ -/* } */ - -/* if (!(output->next = _ecore_drm_fb_bo_get(output->dev, bo))) */ -/* { */ -/* ERR("Failed to get FB from bo"); */ -/* gbm_surface_release_buffer(output->surface, bo); */ -/* } */ -/* } */ -/* #endif */ static Eina_Bool _ecore_drm_output_software_setup(Ecore_Drm_Device *dev, Ecore_Drm_Output *output) @@ -510,23 +371,6 @@ _ecore_drm_output_create(Ecore_Drm_Device *dev, drmModeRes *res, drmModeConnecto if (!output->current_mode) goto mode_err; } -/* #ifdef HAVE_GBM */ -/* if ((dev->use_hw_accel) && (dev->gbm)) */ -/* { */ -/* if (!_ecore_drm_output_hardware_setup(dev, output)) */ -/* { */ -/* ERR("Could not setup output for hardware acceleration"); */ -/* dev->use_hw_accel = EINA_FALSE; */ -/* if (!_ecore_drm_output_software_setup(dev, output)) */ -/* goto mode_err; */ -/* else */ -/* DBG("Setup Output %d for Software Rendering", output->crtc_id); */ -/* } */ -/* else */ -/* DBG("Setup Output %d for Hardware Acceleration", output->crtc_id); */ -/* } */ -/* else */ -/* #endif */ { dev->use_hw_accel = EINA_FALSE; if (!_ecore_drm_output_software_setup(dev, output)) @@ -597,10 +441,6 @@ _ecore_drm_output_fb_release(Ecore_Drm_Output *output, Ecore_Drm_Fb *fb) if ((fb->mmap) && (fb != output->dumb[0]) && (fb != output->dumb[1])) ecore_drm_fb_destroy(fb); -/* #ifdef HAVE_GBM */ -/* else if (fb->bo) */ -/* gbm_bo_destroy(fb->bo); */ -/* #endif */ } void @@ -854,15 +694,6 @@ ecore_drm_output_fb_release(Ecore_Drm_Output *output, Ecore_Drm_Fb *fb) if ((fb->mmap) && (fb != output->dumb[0]) && (fb != output->dumb[1])) ecore_drm_fb_destroy(fb); -/* #ifdef HAVE_GBM */ -/* else if (fb->bo) */ -/* { */ -/* if (fb->from_client) */ -/* gbm_bo_destroy(fb->bo); */ -/* else */ -/* gbm_surface_release_buffer(output->surface, fb->bo); */ -/* } */ -/* #endif */ } EAPI void @@ -880,13 +711,6 @@ ecore_drm_output_repaint(Ecore_Drm_Output *output) if (!output->next) { -/* #ifdef HAVE_GBM */ -/* if (output->dev->use_hw_accel) */ -/* { */ -/* _ecore_drm_output_hardware_render(output); */ -/* } */ -/* else */ -/* #endif */ { _ecore_drm_output_software_render(output); } diff --git a/src/lib/ecore_drm/ecore_drm_private.h b/src/lib/ecore_drm/ecore_drm_private.h index e7be4dfd13..fe769a4c6f 100644 --- a/src/lib/ecore_drm/ecore_drm_private.h +++ b/src/lib/ecore_drm/ecore_drm_private.h @@ -28,14 +28,6 @@ # include <xf86drmMode.h> # include <drm_fourcc.h> -/* # ifdef HAVE_GBM */ -/* # include <gbm.h> */ -/* # include <EGL/egl.h> */ -/* # include <EGL/eglext.h> */ -/* # include <GLES2/gl2.h> */ -/* # include <GLES2/gl2ext.h> */ -/* # endif */ - # include <Eeze.h> # include <Eldbus.h> # include <Ecore_Drm.h> @@ -136,17 +128,6 @@ struct _Ecore_Drm_Output Ecore_Drm_Fb *current, *next; Ecore_Drm_Fb *dumb[NUM_FRAME_BUFFERS]; Ecore_Drm_Backlight *backlight; - -/* # ifdef HAVE_GBM */ -/* struct gbm_surface *surface; */ -/* struct gbm_bo *cursor[NUM_FRAME_BUFFERS]; */ -/* struct */ -/* { */ -/* EGLSurface surface; */ -/* } egl; */ -/* # endif */ - - /* TODO: finish */ }; struct _Ecore_Drm_Seat @@ -259,10 +240,6 @@ void _ecore_drm_evdev_device_destroy(Ecore_Drm_Evdev *evdev); Ecore_Drm_Fb *_ecore_drm_fb_create(Ecore_Drm_Device *dev, int width, int height); void _ecore_drm_fb_destroy(Ecore_Drm_Fb *fb); -/* #ifdef HAVE_GBM */ -/* Ecore_Drm_Fb *_ecore_drm_fb_bo_get(Ecore_Drm_Device *dev, struct gbm_bo *bo); */ -/* #endif */ - void _ecore_drm_output_fb_release(Ecore_Drm_Output *output, Ecore_Drm_Fb *fb); void _ecore_drm_output_repaint_start(Ecore_Drm_Output *output); void _ecore_drm_output_frame_finish(Ecore_Drm_Output *output); |