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