amdgpu_glamor.h revision d6c0b56e
1d6c0b56eSmrg/*
2d6c0b56eSmrg * Copyright © 2011 Intel Corporation.
3d6c0b56eSmrg *             2012 Advanced Micro Devices, Inc.
4d6c0b56eSmrg *
5d6c0b56eSmrg * Permission is hereby granted, free of charge, to any person
6d6c0b56eSmrg * obtaining a copy of this software and associated documentation
7d6c0b56eSmrg * files (the "Software"), to deal in the Software without
8d6c0b56eSmrg * restriction, including without limitation the rights to use, copy,
9d6c0b56eSmrg * modify, merge, publish, distribute, sublicense, and/or sell copies
10d6c0b56eSmrg * of the Software, and to permit persons to whom the Software is
11d6c0b56eSmrg * furnished to do so, subject to the following conditions:
12d6c0b56eSmrg *
13d6c0b56eSmrg * The above copyright notice and this permission notice (including
14d6c0b56eSmrg * the next paragraph) shall be included in all copies or substantial
15d6c0b56eSmrg * portions of the Software.
16d6c0b56eSmrg *
17d6c0b56eSmrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18d6c0b56eSmrg * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19d6c0b56eSmrg * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20d6c0b56eSmrg * NONINFRINGEMENT.  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
21d6c0b56eSmrg * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
22d6c0b56eSmrg * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23d6c0b56eSmrg * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
24d6c0b56eSmrg * DEALINGS IN THE SOFTWARE.
25d6c0b56eSmrg */
26d6c0b56eSmrg
27d6c0b56eSmrg#ifndef AMDGPU_GLAMOR_H
28d6c0b56eSmrg#define AMDGPU_GLAMOR_H
29d6c0b56eSmrg
30d6c0b56eSmrg#include "xf86xv.h"
31d6c0b56eSmrg
32d6c0b56eSmrg#define GLAMOR_FOR_XORG  1
33d6c0b56eSmrg#include <glamor.h>
34d6c0b56eSmrg
35d6c0b56eSmrg#ifndef CREATE_PIXMAP_USAGE_SHARED
36d6c0b56eSmrg#define CREATE_PIXMAP_USAGE_SHARED AMDGPU_CREATE_PIXMAP_DRI2
37d6c0b56eSmrg#endif
38d6c0b56eSmrg
39d6c0b56eSmrg#define AMDGPU_CREATE_PIXMAP_SHARED(usage) \
40d6c0b56eSmrg	((usage) == AMDGPU_CREATE_PIXMAP_DRI2 || \
41d6c0b56eSmrg	 (usage) == CREATE_PIXMAP_USAGE_SHARED)
42d6c0b56eSmrg
43d6c0b56eSmrg#ifndef GLAMOR_NO_DRI3
44d6c0b56eSmrg#define GLAMOR_NO_DRI3 0
45d6c0b56eSmrg#define glamor_fd_from_pixmap glamor_dri3_fd_from_pixmap
46d6c0b56eSmrg#define glamor_pixmap_from_fd glamor_egl_dri3_pixmap_from_fd
47d6c0b56eSmrg#endif
48d6c0b56eSmrg
49d6c0b56eSmrg#ifndef GLAMOR_INVERTED_Y_AXIS
50d6c0b56eSmrg#define GLAMOR_INVERTED_Y_AXIS 0
51d6c0b56eSmrg#endif
52d6c0b56eSmrg#ifndef GLAMOR_USE_SCREEN
53d6c0b56eSmrg#define GLAMOR_USE_SCREEN 0
54d6c0b56eSmrg#endif
55d6c0b56eSmrg#ifndef GLAMOR_USE_PICTURE_SCREEN
56d6c0b56eSmrg#define GLAMOR_USE_PICTURE_SCREEN 0
57d6c0b56eSmrg#endif
58d6c0b56eSmrg
59d6c0b56eSmrgstruct amdgpu_pixmap;
60d6c0b56eSmrg
61d6c0b56eSmrgBool amdgpu_glamor_pre_init(ScrnInfoPtr scrn);
62d6c0b56eSmrgBool amdgpu_glamor_init(ScreenPtr screen);
63d6c0b56eSmrgvoid amdgpu_glamor_fini(ScreenPtr screen);
64d6c0b56eSmrgvoid amdgpu_glamor_screen_init(ScreenPtr screen);
65d6c0b56eSmrgBool amdgpu_glamor_create_screen_resources(ScreenPtr screen);
66d6c0b56eSmrgvoid amdgpu_glamor_free_screen(int scrnIndex, int flags);
67d6c0b56eSmrg
68d6c0b56eSmrgvoid amdgpu_glamor_flush(ScrnInfoPtr pScrn);
69d6c0b56eSmrgvoid amdgpu_glamor_finish(ScrnInfoPtr pScrn);
70d6c0b56eSmrg
71d6c0b56eSmrgBool
72d6c0b56eSmrgamdgpu_glamor_create_textured_pixmap(PixmapPtr pixmap, struct amdgpu_pixmap *priv);
73d6c0b56eSmrgvoid amdgpu_glamor_exchange_buffers(PixmapPtr src, PixmapPtr dst);
74d6c0b56eSmrg
75d6c0b56eSmrgXF86VideoAdaptorPtr amdgpu_glamor_xv_init(ScreenPtr pScreen, int num_adapt);
76d6c0b56eSmrg
77d6c0b56eSmrg#endif /* AMDGPU_GLAMOR_H */
78