blob: 4be5bf8eb8e1000703272d33aca83908f35676ff [file] [log] [blame]
Kristian Høgsberge82dd8c2008-03-26 19:26:59 -04001/*
2 * Copyright © 2007,2008 Red Hat, Inc.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Soft-
6 * ware"), to deal in the Software without restriction, including without
7 * limitation the rights to use, copy, modify, merge, publish, distribute,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, provided that the above copyright
10 * notice(s) and this permission notice appear in all copies of the Soft-
11 * ware and that both the above copyright notice(s) and this permission
12 * notice appear in supporting documentation.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL-
16 * ITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY
17 * RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN
18 * THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSE-
19 * QUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
20 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
21 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFOR-
22 * MANCE OF THIS SOFTWARE.
23 *
24 * Except as contained in this notice, the name of a copyright holder shall
25 * not be used in advertising or otherwise to promote the sale, use or
26 * other dealings in this Software without prior written authorization of
27 * the copyright holder.
28 *
29 * Authors:
30 * Kristian Høgsberg (krh@redhat.com)
31 */
32
33#ifndef _DRI2_H_
34#define _DRI2_H_
35
Emil Velikovf41a6532014-02-28 17:56:01 +000036#include <xf86drm.h>
Kristian Høgsberg48308092008-10-11 20:41:14 -040037#include <X11/extensions/Xfixes.h>
38#include <X11/extensions/dri2tokens.h>
39
RALOVICH, Kristóf08962682009-08-12 12:41:22 +020040typedef struct
41{
42 unsigned int attachment;
43 unsigned int name;
44 unsigned int pitch;
45 unsigned int cpp;
46 unsigned int flags;
Kristian Høgsbergf56b5692008-08-13 11:46:25 -040047} DRI2Buffer;
48
Brian Paul944eebb2013-11-11 08:12:05 -070049struct glx_screen;
50
Kristian Høgsberge82dd8c2008-03-26 19:26:59 -040051extern Bool
RALOVICH, Kristóf08962682009-08-12 12:41:22 +020052DRI2QueryExtension(Display * display, int *eventBase, int *errorBase);
53
Kristian Høgsberge82dd8c2008-03-26 19:26:59 -040054extern Bool
RALOVICH, Kristóf08962682009-08-12 12:41:22 +020055DRI2QueryVersion(Display * display, int *major, int *minor);
56
Kristian Høgsberge82dd8c2008-03-26 19:26:59 -040057extern Bool
RALOVICH, Kristóf08962682009-08-12 12:41:22 +020058DRI2Connect(Display * display, XID window,
59 char **driverName, char **deviceName);
60
Kristian Høgsberg77c7f902008-10-14 23:07:42 -040061extern Bool
RALOVICH, Kristóf08962682009-08-12 12:41:22 +020062DRI2Authenticate(Display * display, XID window, drm_magic_t magic);
63
Kristian Høgsbergf56b5692008-08-13 11:46:25 -040064extern void
RALOVICH, Kristóf08962682009-08-12 12:41:22 +020065DRI2CreateDrawable(Display * display, XID drawable);
66
Kristian Høgsberg77c7f902008-10-14 23:07:42 -040067extern void
RALOVICH, Kristóf08962682009-08-12 12:41:22 +020068DRI2DestroyDrawable(Display * display, XID handle);
69
70extern DRI2Buffer*
71DRI2GetBuffers(Display * dpy, XID drawable,
72 int *width, int *height,
73 unsigned int *attachments, int count,
74 int *outCount);
Kristian Høgsberg48308092008-10-11 20:41:14 -040075
Ian Romanickd8d7b2c2009-04-20 20:52:56 -070076/**
77 * \note
78 * This function is only supported with DRI2 version 1.1 or later.
79 */
RALOVICH, Kristóf08962682009-08-12 12:41:22 +020080extern DRI2Buffer*
81DRI2GetBuffersWithFormat(Display * dpy, XID drawable,
82 int *width, int *height,
83 unsigned int *attachments,
84 int count, int *outCount);
Ian Romanickd8d7b2c2009-04-20 20:52:56 -070085
Kristian Høgsberg77c7f902008-10-14 23:07:42 -040086extern void
RALOVICH, Kristóf08962682009-08-12 12:41:22 +020087DRI2CopyRegion(Display * dpy, XID drawable,
88 XserverRegion region,
89 CARD32 dest, CARD32 src);
Kristian Høgsberge82dd8c2008-03-26 19:26:59 -040090
Kristian Høgsberge82dd8c2008-03-26 19:26:59 -040091#endif