1196N/A/* Copyright (c) 1993, 1998, Oracle and/or its affiliates. All rights reserved.
1196N/A *
1196N/A * Permission is hereby granted, free of charge, to any person obtaining a
1196N/A * copy of this software and associated documentation files (the "Software"),
1196N/A * to deal in the Software without restriction, including without limitation
1196N/A * the rights to use, copy, modify, merge, publish, distribute, sublicense,
1196N/A * and/or sell copies of the Software, and to permit persons to whom the
1196N/A * Software is furnished to do so, subject to the following conditions:
1196N/A *
1196N/A * The above copyright notice and this permission notice (including the next
1196N/A * paragraph) shall be included in all copies or substantial portions of the
1196N/A * Software.
1196N/A *
1196N/A * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1196N/A * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1196N/A * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
1196N/A * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1196N/A * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
1196N/A * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
1196N/A * DEALINGS IN THE SOFTWARE.
1196N/A */
1196N/A
1196N/A
1196N/A#ifndef _DGA_PIXSHARED_H
1196N/A#define _DGA_PIXSHARED_H
1196N/A
1196N/A/*
1196N/A * dga_pixshared.h - Sun Direct Graphics Access shared page include file.
1196N/A */
1196N/A
1196N/A/* Below is the definition of the pixmap shared page structure plus all
1196N/A * the other misc. definitions and structures that are used in both the
1196N/A * server and dga client library.
1196N/A *
1196N/A * Shared Pixmap Information. This structure contains the information
1196N/A * necessary to allow the server and client to share access to a DGA
1196N/A * pixmap . This information is located in the first page of
1196N/A * the shared memory created by the server in response to a call to
1196N/A * XDgaGrabPixmap(). The server communicates the current state
1196N/A * of the shared pixmap to the client through the fields within
1196N/A * this structure.
1196N/A */
1196N/A
1196N/Atypedef u_int *PX_LOCKP_T;
1196N/A
1196N/A#define PXMPMAGIC 0x50584D50 /* "PXMP"=0x50584D50 */
1196N/A#define PXMPVERS 0 /* Current version number */
1196N/A
1196N/Atypedef struct shpx_entry_0 {
1196N/A u_int s_fd; /* server's file descriptor */
1196N/A u_int offset; /* offset to first pixmap info struct*/
1196N/A u_int s_size; /* current total file size */
1196N/A} SHPX_ENTRY_0;
1196N/A
1196N/Atypedef struct shpx_entry_1 {
1196N/A int s_num_shpx; /* current number of shared pixmaps */
1196N/A u_int s_dir_seq; /* server's shpx directory change cnt*/
1196N/A u_int s_next_offset; /* server's next avail offset */
1196N/A} SHPX_ENTRY_1;
1196N/A
1196N/Atypedef struct shpx_entry {
1196N/A u_int xid; /* xid of shared pixmap */
1196N/A u_int offset; /* offset to info struct */
1196N/A u_int size; /* total size of this pixmap */
1196N/A} SHPX_ENTRY;
1196N/A
1196N/Atypedef union shpx_directory {
1196N/A SHPX_ENTRY_0 shpx_entry_0;
1196N/A SHPX_ENTRY_1 shpx_entry_1;
1196N/A SHPX_ENTRY shpx_entry;
1196N/A} SHPX_DIRECTORY;
1196N/A
1196N/Atypedef struct shared_pixmap_info {
1196N/A u_int magic; /* magic number, "PXMP"=0x50584D50 */
1196N/A u_char version; /* version, currently 0 */
1196N/A u_char obsolete; /* pixmap info obsolete flag */
1196N/A u_char device; /* device type identifier from fbio.h ???*/
1196N/A u_char cached; /* 1 = pixels cached on hw; 0 = pixels in mem */
1196N/A u_int s_cacheseq; /* server's cache sequence count */
1196N/A u_int s_modified; /* server has changed this data struct*/
1196N/A u_int data_offset; /* offset to pixel data */
1196N/A u_int device_offset; /* offset to device specific section */
1196N/A short width; /* pixmap width */
1196N/A short height; /* pixmap height */
1196N/A u_int linebytes; /* bytes per scanline */
1196N/A u_char depth; /* pixmap depth */
1196N/A u_char bitsperpixel; /* pixmap bitsPerPixel */
1196N/A u_char pad1[2]; /* Unused pad area */
1196N/A u_int s_fd; /* server's file descriptor */
1196N/A u_int s_size; /* server's size of pixel array */
1196N/A u_int s_dir_index; /* server's shpx directory index */
1196N/A SHPX_DIRECTORY *s_shpx_dir; /* server's pointer to shpx dir */
1196N/A u_char *s_pixels; /* server shared pixel memory pointer*/
1196N/A u_char scr_name[32]; /* screen name for cached pixmap */
1196N/A u_char fn[256]; /* Shared file name */
1196N/A u_int p_refcnt; /* for nested locking */
1196N/A PX_LOCKP_T p_lockp; /* pointer to lockpage */
1196N/A PX_LOCKP_T p_unlockp; /* pointer to unlockpage */
1196N/A uint32_t p_cookie; /* "cookie" for lock pages */
1196N/A int locktype; /* type of locking */
1196N/A u_int s_devinfoseq; /* indicates change to dev_info */
1196N/A /* DO NOT ADD ANYTHING BELOW dev_info - if you need to any any
1196N/A * thing, do so after this line and above dev_info
1196N/A */
1196N/A char dev_info[32]; /* device specific information */
1196N/A} SHARED_PIXMAP_INFO;
1196N/A
1196N/A#endif /* _DGA_PIXSHARED_H */
1196N/A