stefan pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=5551567847c1b0dbcade39209ff5a88c78808b56

commit 5551567847c1b0dbcade39209ff5a88c78808b56
Author: Stefan Schmidt <s.schm...@samsung.com>
Date:   Thu Aug 14 16:40:32 2014 +0200

    evas/drm: Remove rest of the tty handling which is now unused
    
    With the move to ecore_drm for tty handling these all became unused.
    Ecore_drm already takes care of setting up the SIGUSR1/2 handler and
    the rest of the tty setup.
    
    Now that this is gone evas_drm_init/shutdown have no functionality
    anymore either.
---
 src/modules/evas/engines/drm/evas_drm.c    | 136 -----------------------------
 src/modules/evas/engines/drm/evas_engine.c |  11 ---
 src/modules/evas/engines/drm/evas_engine.h |   3 -
 3 files changed, 150 deletions(-)

diff --git a/src/modules/evas/engines/drm/evas_drm.c 
b/src/modules/evas/engines/drm/evas_drm.c
index a1b4c93..1d3c5f7 100644
--- a/src/modules/evas/engines/drm/evas_drm.c
+++ b/src/modules/evas/engines/drm/evas_drm.c
@@ -3,10 +3,6 @@
 #include <linux/kd.h>
 #include <sys/mman.h>
 
-/* NB: REALLY hate to store this here, but sigaction signal handlers cannot 
- * pass any 'user data' to the signal handlers :( */
-static Evas_Engine_Info_Drm *siginfo;
-
 static int 
 _evas_drm_crtc_find(int fd, drmModeRes *res, drmModeConnector *conn)
 {
@@ -67,112 +63,6 @@ _evas_drm_crtc_buffer_get(int fd, int crtc_id)
 }
 
 static void 
-_evas_drm_tty_sigusr1(int x EINA_UNUSED, siginfo_t *info EINA_UNUSED, void 
*data EINA_UNUSED)
-{
-   Evas_Engine_Info_Drm *einfo;
-
-   DBG("Caught SIGUSR1");
-
-   if (!(einfo = siginfo)) return;
-
-   /* TODO: set canvas to not render */
-
-   DBG("\tDrop Master & Release VT");
-
-   /* drop drm master */
-   if (einfo->info.own_fd)
-     {
-        if (drmDropMaster(einfo->info.fd) != 0)
-          WRN("Could not drop drm master: %m");
-     }
-
-   /* release vt */
-   if (einfo->info.own_tty)
-     {
-        if (ioctl(einfo->info.tty, VT_RELDISP, 1) < 0)
-          WRN("Could not release vt: %m");
-     }
-}
-
-static void 
-_evas_drm_tty_sigusr2(int x EINA_UNUSED, siginfo_t *info EINA_UNUSED, void 
*data EINA_UNUSED)
-{
-   Evas_Engine_Info_Drm *einfo;
-
-   DBG("Caught SIGUSR2");
-
-   if (!(einfo = siginfo)) return;
-
-   /* TODO: set canvas to render again */
-
-   DBG("\tAcquire VT & Set Master");
-
-   /* acquire vt */
-   if (einfo->info.own_tty)
-     {
-        if (ioctl(einfo->info.tty, VT_RELDISP, VT_ACKACQ) < 0)
-          WRN("Could not acquire vt: %m");
-     }
-
-   /* set master */
-   if (einfo->info.own_fd)
-     {
-        if (drmSetMaster(einfo->info.fd) != 0)
-          WRN("Could not set drm master: %m");
-     }
-}
-
-static Eina_Bool 
-_evas_drm_tty_setup(Evas_Engine_Info_Drm *info)
-{
-   struct vt_mode vtmode = { 0 };
-   struct sigaction sig;
-
-   /* check for valid tty */
-   if (info->info.tty < 0) return EINA_FALSE;
-
-#if 0
-   /* set vt to graphics mode */
-   if (ioctl(info->info.tty, KDSETMODE, KD_GRAPHICS) < 0)
-     {
-        CRI("Could not set tty to graphics mode: %m");
-        return EINA_FALSE;
-     }
-#endif
-
-   /* setup tty rel/acq signals */
-   vtmode.mode = VT_PROCESS;
-   vtmode.waitv = 0;
-   vtmode.relsig = SIGUSR1;
-   vtmode.acqsig = SIGUSR2;
-   if (ioctl(info->info.tty, VT_SETMODE, &vtmode) < 0)
-     {
-        CRI("Could not set tty mode: %m");
-        return EINA_FALSE;
-     }
-
-   /* store info struct 
-    * 
-    * NB: REALLY hate to store this here, but sigaction signal handlers cannot 
-    * pass any 'user data' to the signal handlers :(
-    */
-   siginfo = info;
-
-   /* setup signal handlers for above signals */
-   sig.sa_sigaction = _evas_drm_tty_sigusr1;
-   sig.sa_flags = (SA_NODEFER | SA_SIGINFO | SA_RESTART);
-   sigemptyset(&sig.sa_mask);
-   sigaction(SIGUSR1, &sig, NULL);
-
-   sig.sa_sigaction = _evas_drm_tty_sigusr2;
-   sig.sa_flags = (SA_NODEFER | SA_SIGINFO | SA_RESTART);
-   sigemptyset(&sig.sa_mask);
-   sigaction(SIGUSR2, &sig, NULL);
-
-   return EINA_TRUE;
-}
-
-static void 
 _evas_drm_outbuf_page_flip(int fd EINA_UNUSED, unsigned int seq EINA_UNUSED, 
unsigned int tv_sec EINA_UNUSED, unsigned int tv_usec EINA_UNUSED, void *data)
 {
    Outbuf *ob;
@@ -251,32 +141,6 @@ _evas_drm_outbuf_planes_setup(Outbuf *ob, 
drmModePlaneResPtr pres)
    return EINA_TRUE;
 }
 
-Eina_Bool
-evas_drm_init(Evas_Engine_Info_Drm *info)
-{
-   /* check for valid engine info */
-   if (!info) return EINA_FALSE;
-
-   setvbuf(stdout, NULL, _IONBF, 0);
-
-   /* with the tty opened, we need to set it up */
-   if (!_evas_drm_tty_setup(info))
-     {
-        return EINA_FALSE;
-     }
-
-   return EINA_TRUE;
-}
-
-Eina_Bool 
-evas_drm_shutdown(Evas_Engine_Info_Drm *info)
-{
-   /* check for valid engine info */
-   if (!info) return EINA_TRUE;
-
-   return EINA_TRUE;
-}
-
 Eina_Bool 
 evas_drm_outbuf_setup(Outbuf *ob)
 {
diff --git a/src/modules/evas/engines/drm/evas_engine.c 
b/src/modules/evas/engines/drm/evas_engine.c
index e76e179..c6f2034 100644
--- a/src/modules/evas/engines/drm/evas_engine.c
+++ b/src/modules/evas/engines/drm/evas_engine.c
@@ -51,11 +51,6 @@ _output_setup(Evas_Engine_Info_Drm *info, int w, int h)
            info->info.own_tty = EINA_TRUE;
            info->info.tty = ecore_drm_tty_get(drm_dev);
        }
-
-       /* try to init drm (this includes openening tty) */
-       /* FIXME replace with ecore_drm_tty */
-        if (!evas_drm_init(info))
-          goto on_error;
      }
 
    /* try to allocate space for our render engine structure */
@@ -92,10 +87,6 @@ _output_setup(Evas_Engine_Info_Drm *info, int w, int h)
         ecore_drm_device_free(drm_dev);
      }
 
-   /* shutdown tty */
-   /* FIXME use ecore_drm_tty */
-   evas_drm_shutdown(info);
-
    free(re);
    return NULL;
 }
@@ -211,8 +202,6 @@ eng_output_free(void *data)
         ecore_drm_device_free(drm_dev);
      }
 
-   /* FIXME use ecore_drm_tty */
-   evas_drm_shutdown(re->info);
    evas_render_engine_software_generic_clean(&re->generic);
    free(re);
 
diff --git a/src/modules/evas/engines/drm/evas_engine.h 
b/src/modules/evas/engines/drm/evas_engine.h
index b92a4cf..0e7ae1c 100644
--- a/src/modules/evas/engines/drm/evas_engine.h
+++ b/src/modules/evas/engines/drm/evas_engine.h
@@ -128,9 +128,6 @@ void evas_outbuf_update_region_push(Outbuf *ob, RGBA_Image 
*update, int x, int y
 void evas_outbuf_update_region_free(Outbuf *ob, RGBA_Image *update);
 void evas_outbuf_flush(Outbuf *ob, Tilebuf_Rect *rects, Evas_Render_Mode 
render_mode);
 
-Eina_Bool evas_drm_init(Evas_Engine_Info_Drm *info);
-Eina_Bool evas_drm_shutdown(Evas_Engine_Info_Drm *info);
-
 Eina_Bool evas_drm_outbuf_setup(Outbuf *ob);
 void evas_drm_outbuf_framebuffer_set(Outbuf *ob, Buffer *buffer);
 Eina_Bool evas_drm_framebuffer_create(int fd, Buffer *buffer, int depth);

-- 


Reply via email to