summaryrefslogtreecommitdiff
path: root/progs/egl/segl/segl_kms.c
blob: bb4fcfca654ea04447856eac4929d846f01d1653 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#include <stdlib.h>
#include <sys/time.h>

#include "segl.h"

static EGLNativeWindowType
kms_create_window(struct segl_winsys *winsys, const char *name,
                  EGLint width, EGLint height, EGLint visual)
{
   return 0;
}

static void
kms_destroy_window(struct segl_winsys *winsys, EGLNativeWindowType win)
{
}


static EGLNativePixmapType 
kms_create_pixmap(struct segl_winsys *winsys, EGLint width, EGLint height,
                  EGLint depth)
{
   return 0;
}

static void
kms_destroy_pixmap(struct segl_winsys *winsys, EGLNativePixmapType pix)
{
}

static double
kms_now(struct segl_winsys *winsys)
{
   struct timeval tv;

   gettimeofday(&tv, NULL);

   return (double) tv.tv_sec + tv.tv_usec / 1000000.0;
}

struct segl_winsys *
segl_get_winsys(EGLNativeDisplayType dpy)
{
   struct segl_winsys *winsys;

   winsys = calloc(1, sizeof(*winsys));
   if (winsys) {
      winsys->dpy = dpy;

      winsys->create_window = kms_create_window;
      winsys->destroy_window = kms_destroy_window;
      winsys->create_pixmap = kms_create_pixmap;
      winsys->destroy_pixmap = kms_destroy_pixmap;

      winsys->now = kms_now;
   }

   return winsys;
}