1 /* Copyright (c) 1993, 1998, Oracle and/or its affiliates. All rights reserved.
3 * Permission is hereby granted, free of charge, to any person obtaining a
4 * copy of this software and associated documentation files (the "Software"),
5 * to deal in the Software without restriction, including without limitation
6 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 * and/or sell copies of the Software, and to permit persons to whom the
8 * Software is furnished to do so, subject to the following conditions:
10 * The above copyright notice and this permission notice (including the next
11 * paragraph) shall be included in all copies or substantial portions of the
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 * DEALINGS IN THE SOFTWARE.
24 #ifndef _DGA_PIXSHARED_H
25 #define _DGA_PIXSHARED_H
28 * dga_pixshared.h - Sun Direct Graphics Access shared page include file.
31 /* Below is the definition of the pixmap shared page structure plus all
32 * the other misc. definitions and structures that are used in both the
33 * server and dga client library.
35 * Shared Pixmap Information. This structure contains the information
36 * necessary to allow the server and client to share access to a DGA
37 * pixmap . This information is located in the first page of
38 * the shared memory created by the server in response to a call to
39 * XDgaGrabPixmap(). The server communicates the current state
40 * of the shared pixmap to the client through the fields within
44 typedef u_int
*PX_LOCKP_T
;
46 #define PXMPMAGIC 0x50584D50 /* "PXMP"=0x50584D50 */
47 #define PXMPVERS 0 /* Current version number */
49 typedef struct shpx_entry_0
{
50 u_int s_fd
; /* server's file descriptor */
51 u_int offset
; /* offset to first pixmap info struct*/
52 u_int s_size
; /* current total file size */
55 typedef struct shpx_entry_1
{
56 int s_num_shpx
; /* current number of shared pixmaps */
57 u_int s_dir_seq
; /* server's shpx directory change cnt*/
58 u_int s_next_offset
; /* server's next avail offset */
61 typedef struct shpx_entry
{
62 u_int xid
; /* xid of shared pixmap */
63 u_int offset
; /* offset to info struct */
64 u_int size
; /* total size of this pixmap */
67 typedef union shpx_directory
{
68 SHPX_ENTRY_0 shpx_entry_0
;
69 SHPX_ENTRY_1 shpx_entry_1
;
70 SHPX_ENTRY shpx_entry
;
73 typedef struct shared_pixmap_info
{
74 u_int magic
; /* magic number, "PXMP"=0x50584D50 */
75 u_char version
; /* version, currently 0 */
76 u_char obsolete
; /* pixmap info obsolete flag */
77 u_char device
; /* device type identifier from fbio.h ???*/
78 u_char cached
; /* 1 = pixels cached on hw; 0 = pixels in mem */
79 u_int s_cacheseq
; /* server's cache sequence count */
80 u_int s_modified
; /* server has changed this data struct*/
81 u_int data_offset
; /* offset to pixel data */
82 u_int device_offset
; /* offset to device specific section */
83 short width
; /* pixmap width */
84 short height
; /* pixmap height */
85 u_int linebytes
; /* bytes per scanline */
86 u_char depth
; /* pixmap depth */
87 u_char bitsperpixel
; /* pixmap bitsPerPixel */
88 u_char pad1
[2]; /* Unused pad area */
89 u_int s_fd
; /* server's file descriptor */
90 u_int s_size
; /* server's size of pixel array */
91 u_int s_dir_index
; /* server's shpx directory index */
92 SHPX_DIRECTORY
*s_shpx_dir
; /* server's pointer to shpx dir */
93 u_char
*s_pixels
; /* server shared pixel memory pointer*/
94 u_char scr_name
[32]; /* screen name for cached pixmap */
95 u_char fn
[256]; /* Shared file name */
96 u_int p_refcnt
; /* for nested locking */
97 PX_LOCKP_T p_lockp
; /* pointer to lockpage */
98 PX_LOCKP_T p_unlockp
; /* pointer to unlockpage */
99 uint32_t p_cookie
; /* "cookie" for lock pages */
100 int locktype
; /* type of locking */
101 u_int s_devinfoseq
; /* indicates change to dev_info */
102 /* DO NOT ADD ANYTHING BELOW dev_info - if you need to any any
103 * thing, do so after this line and above dev_info
105 char dev_info
[32]; /* device specific information */
106 } SHARED_PIXMAP_INFO
;
108 #endif /* _DGA_PIXSHARED_H */