a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync/*
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * Copyright © 2013 Keith Packard
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync *
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * Permission to use, copy, modify, distribute, and sell this software and its
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * documentation for any purpose is hereby granted without fee, provided that
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * the above copyright notice appear in all copies and that both that copyright
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * notice and this permission notice appear in supporting documentation, and
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * that the name of the copyright holders not be used in advertising or
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * publicity pertaining to distribution of the software without specific,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * written prior permission. The copyright holders make no representations
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * about the suitability of this software for any purpose. It is provided "as
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * is" without express or implied warranty.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync *
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync * OF THIS SOFTWARE.
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#ifndef _DRI3_H_
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#define _DRI3_H_
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#ifdef DRI3
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#include <X11/extensions/dri3proto.h>
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#include <randrstr.h>
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#define DRI3_SCREEN_INFO_VERSION 1
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef int (*dri3_open_proc)(ScreenPtr screen,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync RRProviderPtr provider,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int *fd);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef int (*dri3_open_client_proc)(ClientPtr client,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync ScreenPtr screen,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync RRProviderPtr provider,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int *fd);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef PixmapPtr (*dri3_pixmap_from_fd_proc) (ScreenPtr screen,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync int fd,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync CARD16 width,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync CARD16 height,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync CARD16 stride,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync CARD8 depth,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync CARD8 bpp);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef int (*dri3_fd_from_pixmap_proc) (ScreenPtr screen,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync PixmapPtr pixmap,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync CARD16 *stride,
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync CARD32 *size);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsynctypedef struct dri3_screen_info {
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync uint32_t version;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync dri3_open_proc open;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync dri3_pixmap_from_fd_proc pixmap_from_fd;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync dri3_fd_from_pixmap_proc fd_from_pixmap;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync /* Version 1 */
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync dri3_open_client_proc open_client;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync} dri3_screen_info_rec, *dri3_screen_info_ptr;
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT Bool
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncdri3_screen_init(ScreenPtr screen, dri3_screen_info_ptr info);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncextern _X_EXPORT int
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsyncdri3_send_open_reply(ClientPtr client, int fd);
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#endif
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync
a5e7ae69e440f6816420fc99599f044e79e716b6vboxsync#endif /* _DRI3_H_ */