xserver-multidpi/mi/mibank.h
Paulo Cesar Pereira de Andrade 49f77fff14 Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.

  This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)

  LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.

  xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 05:43:34 -02:00

113 lines
3.9 KiB
C

/*
* Copyright 1997 through 2004 by Marc Aurele La France (TSI @ UQV), tsi@xfree86.org
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that copyright
* notice and this permission notice appear in supporting documentation, and
* that the name of Marc Aurele La France not be used in advertising or
* publicity pertaining to distribution of the software without specific,
* written prior permission. Marc Aurele La France makes no representations
* about the suitability of this software for any purpose. It is provided
* "as-is" without express or implied warranty.
*
* MARC AURELE LA FRANCE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO
* EVENT SHALL MARC AURELE LA FRANCE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#ifndef __MIBANK_H__
#define __MIBANK_H__ 1
#include "scrnintstr.h"
/*
* Banking external interface.
*/
/*
* This is the banking function type. The return value is normally zero.
* Non-zero returns can be used to implement the likes of scanline interleave,
* etc.
*/
typedef int miBankProc(
ScreenPtr /*pScreen*/,
unsigned int /*iBank*/
);
typedef miBankProc *miBankProcPtr;
typedef struct _miBankInfo
{
/*
* Banking refers to the use of one or more apertures (in the server's
* address space) to access various parts of a potentially larger hardware
* frame buffer.
*
* Three different banking schemes are supported:
*
* Single banking is indicated when pBankA and pBankB are equal and all
* three miBankProcPtr's point to the same function. Here, both reads and
* writes through the aperture access the same hardware location.
*
* Shared banking is indicated when pBankA and pBankB are equal but the
* source and destination functions differ. Here reads through the
* aperture do not necessarily access the same hardware location as writes.
*
* Double banking is indicated when pBankA and pBankB differ. Here two
* independent apertures are used to provide read/write access to
* potentially different hardware locations.
*
* Any other combination will result in no banking.
*/
miBankProcPtr SetSourceBank; /* Set pBankA bank number */
miBankProcPtr SetDestinationBank; /* Set pBankB bank number */
miBankProcPtr SetSourceAndDestinationBanks; /* Set both bank numbers */
pointer pBankA; /* First aperture location */
pointer pBankB; /* First or second aperture location */
/*
* BankSize is in units of sizeof(char) and is the size of each bank.
*/
unsigned long BankSize;
/*
* nBankDepth is the colour depth associated with the maximum number of a
* pixel's bits that are simultaneously accessible through the frame buffer
* aperture.
*/
unsigned int nBankDepth;
} miBankInfoRec, *miBankInfoPtr;
extern _X_EXPORT Bool
miInitializeBanking(
ScreenPtr /*pScreen*/,
unsigned int /*xsize*/,
unsigned int /*ysize*/,
unsigned int /*width*/,
miBankInfoPtr /*pBankInfo*/
);
/*
* This function determines the minimum screen width, given a initial estimate
* and various screen attributes. DDX needs to determine this width before
* initializing the screen.
*/
extern _X_EXPORT int
miScanLineWidth(
unsigned int /*xsize*/,
unsigned int /*ysize*/,
unsigned int /*width*/,
unsigned long /*BankSize*/,
PixmapFormatRec * /*pBankFormat*/,
unsigned int /*nWidthUnit*/
);
#endif /* __MIBANK_H__ */