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