summaryrefslogtreecommitdiff
path: root/EGL/yagl_dri2.h
blob: 4350e42de975eabfb6de85b85ab4ace9511392c4 (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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#ifndef _YAGL_DRI2_H_
#define _YAGL_DRI2_H_

#include "yagl_export.h"
#include "yagl_types.h"
#include <X11/extensions/Xfixes.h>
#include <X11/extensions/dri2tokens.h>
#include <X11/Xmd.h>
#include <X11/Xlibint.h>
#include <xf86drm.h>

typedef struct
{
   unsigned int attachment;
   unsigned int name;
   unsigned int pitch;
   unsigned int cpp;
   unsigned int flags;
} yagl_DRI2Buffer;

Bool yagl_DRI2QueryExtension(Display *display,
                             int *eventBase,
                             int *errorBase);

Bool yagl_DRI2QueryVersion(Display *display,
                           int *major,
                           int *minor);

Bool yagl_DRI2Connect(Display *display,
                      XID window,
                      char **driverName,
                      char **deviceName);

Bool yagl_DRI2Authenticate(Display *display,
                           XID window,
                           drm_magic_t magic);

void yagl_DRI2CreateDrawable(Display *display, XID drawable);

void yagl_DRI2DestroyDrawable(Display *display, XID handle);

yagl_DRI2Buffer *yagl_DRI2GetBuffers(Display *dpy, XID drawable,
                                     int *width, int *height,
                                     unsigned int *attachments, int count,
                                     int *outCount);

yagl_DRI2Buffer *yagl_DRI2GetBuffersWithFormat(Display *dpy,
                                               XID drawable,
                                               int *width, int *height,
                                               unsigned int *attachments,
                                               int count, int *outCount);

void yagl_DRI2CopyRegion(Display *dpy,
                         XID drawable,
                         XserverRegion region,
                         CARD32 dest, CARD32 src);

void yagl_DRI2SwapBuffers(Display *dpy, XID drawable,
                          CARD64 target_msc, CARD64 divisor,
                          CARD64 remainder, CARD64 *count);

Bool yagl_DRI2GetMSC(Display *dpy, XID drawable,
                     CARD64 *ust, CARD64 *msc, CARD64 *sbc);

Bool yagl_DRI2WaitMSC(Display *dpy, XID drawable,
                      CARD64 target_msc, CARD64 divisor,
                      CARD64 remainder, CARD64 *ust, CARD64 *msc, CARD64 *sbc);

Bool yagl_DRI2WaitSBC(Display *dpy, XID drawable,
                      CARD64 target_sbc, CARD64 *ust,
                      CARD64 *msc, CARD64 *sbc);

void yagl_DRI2SwapInterval(Display *dpy, XID drawable, int interval);

#endif