00001 /************************************************************************** 00002 * 00003 * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. 00004 * All Rights Reserved. 00005 * 00006 * Permission is hereby granted, free of charge, to any person obtaining a 00007 * copy of this software and associated documentation files (the 00008 * "Software"), to deal in the Software without restriction, including 00009 * without limitation the rights to use, copy, modify, merge, publish, 00010 * distribute, sub license, and/or sell copies of the Software, and to 00011 * permit persons to whom the Software is furnished to do so, subject to 00012 * the following conditions: 00013 * 00014 * The above copyright notice and this permission notice (including the 00015 * next paragraph) shall be included in all copies or substantial portions 00016 * of the Software. 00017 * 00018 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 00019 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 00020 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. 00021 * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR 00022 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 00023 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 00024 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 00025 * 00026 **************************************************************************/ 00027 00028 #ifndef _INTEL_SCREEN_H_ 00029 #define _INTEL_SCREEN_H_ 00030 00031 #include "dri_util.h" 00032 #include "i830_common.h" 00033 #include "xmlconfig.h" 00034 #include "ws_dri_bufpool.h" 00035 00036 #include "pipe/p_compiler.h" 00037 00038 #include "intel_be_device.h" 00039 00040 struct intel_screen 00041 { 00042 struct intel_be_device base; 00043 00044 struct { 00045 drm_handle_t handle; 00046 00047 /* We create a static dri buffer for the frontbuffer. 00048 */ 00049 struct _DriBufferObject *buffer; 00050 struct pipe_surface *surface; 00051 struct pipe_texture *texture; 00052 00053 char *map; /* memory map */ 00054 int offset; /* from start of video mem, in bytes */ 00055 int pitch; /* row stride, in bytes */ 00056 int width; 00057 int height; 00058 int size; 00059 int cpp; /* for front and back buffers */ 00060 } front; 00061 00062 int deviceID; 00063 int drmMinor; 00064 00065 drmI830Sarea *sarea; 00066 00070 driOptionCache optionCache; 00071 00072 boolean havePools; 00073 00078 struct intel_context *dummyContext; 00079 00080 /* 00081 * New stuff form the i915tex integration 00082 */ 00083 unsigned batch_id; 00084 00085 00086 struct pipe_winsys *winsys; 00087 }; 00088 00089 00090 00092 static INLINE struct intel_screen * 00093 intel_screen(__DRIscreenPrivate *sPriv) 00094 { 00095 return (struct intel_screen *) sPriv->private; 00096 } 00097 00098 00099 extern void 00100 intelUpdateScreenRotation(__DRIscreenPrivate * sPriv, drmI830Sarea * sarea); 00101 00102 00103 extern void intelDestroyContext(__DRIcontextPrivate * driContextPriv); 00104 00105 extern boolean intelUnbindContext(__DRIcontextPrivate * driContextPriv); 00106 00107 extern boolean 00108 intelMakeCurrent(__DRIcontextPrivate * driContextPriv, 00109 __DRIdrawablePrivate * driDrawPriv, 00110 __DRIdrawablePrivate * driReadPriv); 00111 00112 00113 extern boolean 00114 intelCreatePools(__DRIscreenPrivate *sPriv); 00115 00116 extern boolean 00117 intelCreateContext(const __GLcontextModes * visual, 00118 __DRIcontextPrivate * driContextPriv, 00119 void *sharedContextPrivate); 00120 00121 00122 #endif