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