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