Back to index

xserver-xorg-video-modesetting  0.3.0
driver.h
Go to the documentation of this file.
00001 /*
00002  * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
00003  * All Rights Reserved.
00004  *
00005  * Permission is hereby granted, free of charge, to any person obtaining a
00006  * copy of this software and associated documentation files (the
00007  * "Software"), to deal in the Software without restriction, including
00008  * without limitation the rights to use, copy, modify, merge, publish,
00009  * distribute, sub license, and/or sell copies of the Software, and to
00010  * permit persons to whom the Software is furnished to do so, subject to
00011  * the following conditions:
00012  *
00013  * The above copyright notice and this permission notice (including the
00014  * next paragraph) shall be included in all copies or substantial portions
00015  * of the Software.
00016  *
00017  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
00018  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00019  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
00020  * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
00021  * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
00022  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
00023  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00024  *
00025  *
00026  * Author: Alan Hourihane <alanh@tungstengraphics.com>
00027  *
00028  */
00029 
00030 #include <errno.h>
00031 #include <drm.h>
00032 #include <xf86drm.h>
00033 #include <damage.h>
00034 
00035 #include "drmmode_display.h"
00036 #define DRV_ERROR(msg)      xf86DrvMsg(pScrn->scrnIndex, X_ERROR, msg);
00037 
00038 typedef struct
00039 {
00040     int lastInstance;
00041     int refCount;
00042     ScrnInfoPtr pScrn_1;
00043     ScrnInfoPtr pScrn_2;
00044 } EntRec, *EntPtr;
00045 
00046 typedef struct _modesettingRec
00047 {
00048     int fd;
00049 
00050     EntPtr entityPrivate;
00051 
00052     int Chipset;
00053     EntityInfoPtr pEnt;
00054 #if XSERVER_LIBPCIACCESS
00055     struct pci_device *PciInfo;
00056 #else
00057     pciVideoPtr PciInfo;
00058     PCITAG PciTag;
00059 #endif
00060 
00061     Bool noAccel;
00062     Bool SWCursor;
00063     CloseScreenProcPtr CloseScreen;
00064 
00065     /* Broken-out options. */
00066     OptionInfoPtr Options;
00067 
00068     unsigned int SaveGeneration;
00069 
00070     CreateScreenResourcesProcPtr createScreenResources;
00071     ScreenBlockHandlerProcPtr BlockHandler;
00072     void *driver;
00073 
00074     drmmode_rec drmmode;
00075 
00076     DamagePtr damage;
00077     Bool dirty_enabled;
00078 
00079 } modesettingRec, *modesettingPtr;
00080 
00081 #define modesettingPTR(p) ((modesettingPtr)((p)->driverPrivate))