summaryrefslogtreecommitdiff
path: root/vmwgfx/vmwgfx_saa.h
diff options
context:
space:
mode:
Diffstat (limited to 'vmwgfx/vmwgfx_saa.h')
-rw-r--r--vmwgfx/vmwgfx_saa.h110
1 files changed, 110 insertions, 0 deletions
diff --git a/vmwgfx/vmwgfx_saa.h b/vmwgfx/vmwgfx_saa.h
new file mode 100644
index 0000000..bb8ec96
--- /dev/null
+++ b/vmwgfx/vmwgfx_saa.h
@@ -0,0 +1,110 @@
1/*
2 * Copyright 2011 VMWare, Inc.
3 * All Rights Reserved.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the
7 * "Software"), to deal in the Software without restriction, including
8 * without limitation the rights to use, copy, modify, merge, publish,
9 * distribute, sub license, and/or sell copies of the Software, and to
10 * permit persons to whom the Software is furnished to do so, subject to
11 * the following conditions:
12 *
13 * The above copyright notice and this permission notice (including the
14 * next paragraph) shall be included in all copies or substantial portions
15 * of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
20 * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
21 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
22 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
23 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 *
25 * Author: Thomas Hellstrom <thellstrom@vmware.com>
26 */
27
28#ifndef _VMWGFX_SAA_H_
29#define _VMWGFX_SAA_H_
30
31#include "saa.h"
32#include <xa_composite.h>
33#include "vmwgfx_drmi.h"
34#include "wsbm_util.h"
35
36
37#define VMWGFX_FLAG_FORCE_GMR (1 << 0) /* Create with GMR as backing store */
38#define VMWGFX_FLAG_FORCE_SURFACE (1 << 1) /* Create with surface as backing store */
39#define VMWGFX_FLAG_AVOID_HWACCEL (1 << 2) /* Avoid Hardware acceleration on this pixmap */
40#define VMWGFX_FLAG_USE_PRESENT (1 << 3) /* Use presents when copying to this pixmap */
41
42struct vmwgfx_saa_pixmap {
43 struct saa_pixmap base;
44 RegionPtr dirty_present;
45 RegionPtr present_damage;
46 RegionPtr pending_update;
47 RegionPtr pending_present;
48 uint32_t usage_flags;
49 uint32_t backing;
50 void *malloc;
51 struct vmwgfx_dmabuf *gmr;
52 struct xa_surface *hw;
53 uint32_t fb_id;
54 int hw_is_dri2_fronts;
55 struct _WsbmListHead sync_x_head;
56 struct _WsbmListHead scanout_list;
57
58 uint32_t xa_flags;
59 uint32_t staging_add_flags;
60 uint32_t staging_remove_flags;
61 enum xa_formats staging_format;
62};
63
64struct vmwgfx_screen_entry {
65 struct _WsbmListHead scanout_head;
66 PixmapPtr pixmap;
67};
68
69static inline struct vmwgfx_saa_pixmap *
70to_vmwgfx_saa_pixmap(struct saa_pixmap *spix)
71{
72 return (struct vmwgfx_saa_pixmap *) spix;
73}
74
75static inline struct vmwgfx_saa_pixmap*
76vmwgfx_saa_pixmap(PixmapPtr pix)
77{
78 return to_vmwgfx_saa_pixmap(saa_get_saa_pixmap(pix));
79}
80
81extern Bool
82vmwgfx_saa_init(ScreenPtr pScreen, int drm_fd, struct xa_tracker *xat,
83 void (*present_flush)(ScreenPtr pScreen),
84 Bool direct_presents,
85 Bool only_hw_presents,
86 Bool rendercheck);
87
88extern uint32_t
89vmwgfx_scanout_ref(struct vmwgfx_screen_entry *box);
90
91extern void
92vmwgfx_scanout_unref(struct vmwgfx_screen_entry *box);
93
94extern void
95vmwgfx_scanout_refresh(PixmapPtr pixmap);
96
97extern void
98vmwgfx_remove_dri2_list(struct vmwgfx_saa_pixmap *vpix);
99
100extern void
101vmwgfx_flush_dri2(ScreenPtr pScreen);
102
103extern Bool
104vmwgfx_hw_dri2_validate(PixmapPtr pixmap, unsigned int depth);
105
106Bool
107vmwgfx_hw_accel_validate(PixmapPtr pixmap, unsigned int depth,
108 uint32_t add_flags, uint32_t remove_flags,
109 RegionPtr region);
110#endif