forked from enlightenment/efl
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.
This commit is contained in:
parent
9df3bb10bb
commit
5551567847
|
@ -3,10 +3,6 @@
|
||||||
#include <linux/kd.h>
|
#include <linux/kd.h>
|
||||||
#include <sys/mman.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
|
static int
|
||||||
_evas_drm_crtc_find(int fd, drmModeRes *res, drmModeConnector *conn)
|
_evas_drm_crtc_find(int fd, drmModeRes *res, drmModeConnector *conn)
|
||||||
{
|
{
|
||||||
|
@ -66,112 +62,6 @@ _evas_drm_crtc_buffer_get(int fd, int crtc_id)
|
||||||
return id;
|
return 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
|
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)
|
_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)
|
||||||
{
|
{
|
||||||
|
@ -251,32 +141,6 @@ _evas_drm_outbuf_planes_setup(Outbuf *ob, drmModePlaneResPtr pres)
|
||||||
return EINA_TRUE;
|
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
|
Eina_Bool
|
||||||
evas_drm_outbuf_setup(Outbuf *ob)
|
evas_drm_outbuf_setup(Outbuf *ob)
|
||||||
{
|
{
|
||||||
|
|
|
@ -51,11 +51,6 @@ _output_setup(Evas_Engine_Info_Drm *info, int w, int h)
|
||||||
info->info.own_tty = EINA_TRUE;
|
info->info.own_tty = EINA_TRUE;
|
||||||
info->info.tty = ecore_drm_tty_get(drm_dev);
|
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 */
|
/* 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);
|
ecore_drm_device_free(drm_dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* shutdown tty */
|
|
||||||
/* FIXME use ecore_drm_tty */
|
|
||||||
evas_drm_shutdown(info);
|
|
||||||
|
|
||||||
free(re);
|
free(re);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -211,8 +202,6 @@ eng_output_free(void *data)
|
||||||
ecore_drm_device_free(drm_dev);
|
ecore_drm_device_free(drm_dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME use ecore_drm_tty */
|
|
||||||
evas_drm_shutdown(re->info);
|
|
||||||
evas_render_engine_software_generic_clean(&re->generic);
|
evas_render_engine_software_generic_clean(&re->generic);
|
||||||
free(re);
|
free(re);
|
||||||
|
|
||||||
|
|
|
@ -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_update_region_free(Outbuf *ob, RGBA_Image *update);
|
||||||
void evas_outbuf_flush(Outbuf *ob, Tilebuf_Rect *rects, Evas_Render_Mode render_mode);
|
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);
|
Eina_Bool evas_drm_outbuf_setup(Outbuf *ob);
|
||||||
void evas_drm_outbuf_framebuffer_set(Outbuf *ob, Buffer *buffer);
|
void evas_drm_outbuf_framebuffer_set(Outbuf *ob, Buffer *buffer);
|
||||||
Eina_Bool evas_drm_framebuffer_create(int fd, Buffer *buffer, int depth);
|
Eina_Bool evas_drm_framebuffer_create(int fd, Buffer *buffer, int depth);
|
||||||
|
|
Loading…
Reference in New Issue