2 * Mesa 3-D graphics library
5 * Copyright (C) 2010 LunarG Inc.
6 * Copyright (C) 2011 VMware Inc. All rights reserved.
8 * Permission is hereby granted, free of charge, to any person obtaining a
9 * copy of this software and associated documentation files (the "Software"),
10 * to deal in the Software without restriction, including without limitation
11 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
12 * and/or sell copies of the Software, and to permit persons to whom the
13 * Software is furnished to do so, subject to the following conditions:
15 * The above copyright notice and this permission notice shall be included
16 * in all copies or substantial portions of the Software.
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
21 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
23 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
24 * DEALINGS IN THE SOFTWARE.
27 * Chia-I Wu <olv@lunarg.com>
28 * Thomas Hellstrom <thellstrom@vmware.com>
33 struct resource_surface;
36 struct resource_surface *
37 resource_surface_create(struct pipe_screen *screen,
38 enum pipe_format format, uint bind);
41 resource_surface_destroy(struct resource_surface *rsurf);
44 resource_surface_set_size(struct resource_surface *rsurf,
45 uint width, uint height);
48 resource_surface_get_size(struct resource_surface *rsurf,
49 uint *width, uint *height);
52 resource_surface_add_resources(struct resource_surface *rsurf,
56 resource_surface_import_resource(struct resource_surface *rsurf,
57 enum native_attachment which,
58 struct pipe_resource *pres);
61 resource_surface_get_resources(struct resource_surface *rsurf,
62 struct pipe_resource **resources,
65 struct pipe_resource *
66 resource_surface_get_single_resource(struct resource_surface *rsurf,
67 enum native_attachment which);
70 resource_surface_swap_buffers(struct resource_surface *rsurf,
71 enum native_attachment buf1,
72 enum native_attachment buf2,
73 boolean only_if_exist);
76 resource_surface_present(struct resource_surface *rsurf,
77 enum native_attachment which,
78 void *winsys_drawable_handle);
81 * Perform a gallium copy blit between the back left and front left
82 * surfaces. Needs to be followed by a call to resource_surface_flush.
85 resource_surface_copy_swap(struct resource_surface *rsurf,
86 struct native_display *ndpy);
89 * Throttle on outstanding rendering using the copy context. For example
93 resource_surface_throttle(struct resource_surface *rsurf);
96 * Flush pending rendering using the copy context. This function saves a
97 * marker for upcoming throttles.
100 resource_surface_flush(struct resource_surface *rsurf,
101 struct native_display *ndpy);
103 * Wait for all rendering using the copy context to be complete. Frees all
104 * throttle markers saved using resource_surface_flush.
107 resource_surface_wait(struct resource_surface *rsurf);
109 struct pipe_resource *
110 drm_display_import_native_buffer(struct native_display *ndpy,
111 struct native_buffer *nbuf);
114 drm_display_export_native_buffer(struct native_display *ndpy,
115 struct pipe_resource *res,
116 struct native_buffer *nbuf);