⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pvrdd.h

📁 Lido PXA270平台开发板的最新BSP,包括源代码
💻 H
字号:
/******************************************************************************
* Name         : pvrdd.h
* Title        : System dependant functions.
* Author(s)    : Imagination Technologies
* Created      : 1st August 2003
*
* Copyright    : 2003 by Imagination Technologies Limited.
*                All rights reserved.  No part of this software, either
*                material or conceptual may be copied or distributed,
*                transmitted, transcribed, stored in a retrieval system 
*                or translated into any human or computer language in any
*                form by any means, electronic, mechanical, manual or
*                other-wise, or disclosed to third parties without the
*                express written permission of Imagination Technologies
*                Limited, Unit 8, HomePark Industrial Estate, 
*                King's Langley, Hertfordshire, WD4 8LZ, U.K.
*
* Description  : System dependant functions.
*
* Platform     : Generic
*
* Notes        : formerly pmxdd.h mks rev 1.11
*
* Modifications:-
* $Log: pvrdd.h $
*
*  --- Revision Logs Removed --- 
*
*
******************************************************************************/

#if !defined (_PVRDD_H_)
#define _PVRDD_H_

#include "dxinc.h"

#include "services.h"
#include "pvrddcmn.h"
#include "hwdefs.h"
#include "pvrdxreg.h"
#include "pdpal.h"

/*
	Determines size related info for texture - sadly, only needed by pdump.c
*/
BOOL GetSizeInfo(DWORD dwSize,
				 PDWORD pdwTSPSize,
				 PDWORD pdwScale,
				 PDWORD pdwMapLevels);

#define CREATE_FLIP_MASK(OverlayNum) (0x3 << (OverlayNum * 2))
#define CREATE_FLIP_VALUE(OverlayNum, BufNum) ((BufNum) << (OverlayNum * 2))

/*****************************************************************************
 Forward declarations.
*****************************************************************************/
typedef struct _SURFDATA_		*PSURFDATA;

/*****************************************************************************
 Structs to keep track of primary and overlay flip chains
*****************************************************************************/
#define MAX_FLIP_SURFACES	4	/* an arbitrary limit on the number of surfaces in a flip chain */
typedef struct
{
	PVOID			pvSurfaceData;
} PRIM_SURF_INFO, *PPRIM_SURF_INFO;

typedef struct
{
	DWORD			dwActiveSurfaces;
	PRIM_SURF_INFO	asSurfaceInfo[MAX_FLIP_SURFACES];
} PRIM_SURF_TABLE, *PPRIM_SURF_TABLE;

/*
	This type enumeration specifies if colors are keyed from the source or
	destination surface.
*/

typedef enum e_COLORKEY_TYPE {

  ColorKeyNone = 0,
  SourceColorKey = 1,
  DestColorKey = 2,
  SourceAndDestColorKey = 3

} COLORKEY_TYPE;
/*
	Size of the largest Blt in DWORDs
*/
#define MAX_BLT_SIZE	56
/*
	Struct for managing connections to the resource Manager
*/
typedef struct _RESMAN_CONNECTION_
{
	HANDLE			hProcID;
	DWORD			dwConnected;
	struct	_RESMAN_CONNECTION_ *psNext;
} RESMAN_CONNECTION;


#define SIZEOF_MBXSURF_CLASS    0x50
#define SIZEOF_MEMNODE_CLASS    0x18

typedef struct _SURFDATA_
{
	/*
		GPE requires us to work with a GPESurf-compatible class - not
		good when you're stuck in C. To get round this we call a convert
		routine to create a new MBXSurf object on the heap, then copy 
		this into an array at the top of this struct. Hacky, but it works.
	*/
	BYTE					abyMBXSurfClass[SIZEOF_MBXSURF_CLASS];

	/*
		General flags
		
		NB:	Currently used to differentiate between the data for 
			index/vertex buffers and surfaces. Note that the position of
			this member within the structure must match that of the same
			member within our buffer-data structure (BUFFDATA).

			Yes, I know it's hacky, and have several better solutions in
			mind. Hopefully, one day they might even get used...
	*/
	DWORD					dwFlags;

	/*
		The GPE driver also requires a MemNode class to contain the 
		MemInfo pointer. We'll allocate space for this here to so that it
		can be set up during surface creation
	*/
	BYTE					abyMemNodeClass[SIZEOF_MEMNODE_CLASS];

	/*
		Pointer to the MBXSurf object on the heap.
	*/
	PVOID					pvGPESurf;

	/*
		DD surface details - filled-in by CreateSurfaceEx and used
		by 3D HAL routines, as the DD surface structures are not available.
	*/
	DWORD					dwDDSCaps;
	DWORD					dwDDSCaps2;
	DWORD					dwDDSFlags;
	DWORD					lDDSPitch;

	/*
		Surface dimension stuff.
		(Stride is in pixels).
	*/
	DWORD					dwWidth;
	DWORD					dwHeight;
	LONG					lStride;

	/*	
		Surface memory
	*/
	PVOID					pvLinAddress;
	
	/*
		Mem info stuff...
	*/
	PPVRSRV_MEM_INFO		psMemInfo;

	/*
		Pixel format
	*/
	DWORD					dwMBXFormat;
	DDPIXELFORMAT			sPixelFormat;

	/*
		Display list stuff.
	*/
	DWORD					dwSurfaceIndex;

	/*
		DirectDraw ColorKey stuff.
	*/
	COLORKEY_TYPE			eColorKeyType;
	DWORD					dwDDSrcColorKey;
	DWORD					dwDDDstColorKey;

	/*
		Stuff....
	*/
	DWORD					dwDDGblFlags;


	/* Lock Synchronisation values */
	struct
	{
		IMG_UINT32				ui32ReadOpsPending;
		IMG_UINT32				ui32NextWriteOp;
	}sLock;

	/* Blit Synchronisation values */
	struct
	{
		IMG_UINT32				ui32ReadOpsPending;
		IMG_UINT32				ui32NextWriteOp;
	}sBlit;

	/*
		DDBlit optimiser
	*/
	DWORD					dwLastOpWasBlit;

	/*
		Overlay detais 
	*/
	PDP_OVERLAY				sOverlaySurface;

} SURFDATA, *PSURFDATA;

/*
	MBX surface flags for above structure.
*/
#define SURFDATAFLAGS_PRIMARY				0x00000001
#define SURFDATAFLAGS_OVERLAY				0x00000002
#define SURFDATAFLAGS_PRIMARY_FLIP_CHAIN	0x00000004
#define SURFDATAFLAGS_LOCK_PENDING			0x00000008
#define SURFDATAFLAGS_LOCKED				0x00000010


#define SURFDATA_CLEARFLAGS_FULLSCREEN_DEPTH		0x00000001
#define SURFDATA_CLEARFLAGS_FULLSCREEN_TARGET		0x00000002

/* 
	This isn't a surfdata object, it's a hw buffer entry
	(in the surface list - so we can deallocate OK)		
*/

#define SURFDATAFLAGS_LASTOPWASBLT			0x04000000

#define SURFDATAFLAGS_PDUMPED				0x80000000	/* Only for PDUMPING */

/*****************************************************************************
 Internal DD Driver per instance data structure.
 This is accessed from dwReserved3 (dwReserved2 on NT) of the DD global driver object (lpDD)
*****************************************************************************/

#define HAL_COMMANDQUEUE_SIZE 1024

typedef struct _DXHALDATA_
{
	DWORD				dwDevCookie;

	LPDDHALINFO			psDDHALInfo;

	CHAR				pszDriverName[MAX_DRIVER_NAME];

	/*
		Number of CreateSurface's called 
	*/
	DWORD				dwSurfaceCount;			/* Used to control BMC enable/disable */
	DWORD				dwBMCDestroyed;			/* BMC disabled? (0 - enabled, else disabled reason) */

	/*
		Registry stuff..
	*/
	PVR_REG_DATA		sRegData;

	/*
		Used to detected midscene texture reuse
	*/
	DWORD				dwSceneCounter;

	/* 
		All vars below here were in MBXHAL_DEV
	*/
	PRIM_SURF_TABLE		sPrimFlipTable;

	/* Overlay control data */
	BOOL				bOverlayInUse;
	PDP_OVERLAYATTRIBS	sOverlayAttributes;	
	PRIM_SURF_TABLE		sOvlFlipTable;

	/*
		Dev data for the display device
	*/
	PVRSRV_DEV_DATA		sDisplayDevData;

	/*
		Dev data for the mbx
	*/
	PVRSRV_DEV_DATA		sDevData;

	/*
		Primary surface data pointer
	*/
	PVRSRV_PRIMARY_SURF	*psPrimSurfData;

	/*
		Hardware Info 
	*/
	PVRSRV_HW_INFO		sHWInfo;

	/* 
		Command queue info 
	*/
	PVRSRV_QUEUE_INFO	*psDDQueueInfo;

	/*
		List of connections to resource manager
	*/
	RESMAN_CONNECTION	*psResManConnections;

	/* 
		Temporary Storage for blit construction 
	*/
	DWORD				dwBlitBuffer[MAX_BLT_SIZE];

	/*
		PDUMP Context 
	*/
#ifdef PDUMP
	PDUMP_CONTEXT		*psPDContext;
#endif

} DXHALDATA, *PDXHALDATA;


/*
	Generic pixel format type
*/
typedef enum _MBXDD_PIXELFORMAT_
{
	MBXDD_PIXELFORMAT_RGB,
	MBXDD_PIXELFORMAT_PALETTISED,
	MBXDD_PIXELFORMAT_PLANARISED,
	MBXDD_PIXELFORMAT_FOURCC,

	MBXDD_PIXELFORMAT_UNRECOGNISED,

	MBXDD_PIXELFORMAT_COUNT,
	MBXDD_PIXELFORMAT_FORCEDWORD	= 0x7FFFFFFF
} MBXDD_PIXELFORMAT, *PMBXDD_PIXELFORMAT;

typedef enum _MBXDD_FORMAT_
{
	MBXDD_FORMAT_RGB332,
	MBXDD_FORMAT_RGB565,
	MBXDD_FORMAT_RGB555,
	MBXDD_FORMAT_RGB888,
	MBXDD_FORMAT_BGR888,
	MBXDD_FORMAT_YUV420,
	MBXDD_FORMAT_YUV444,
	MBXDD_FORMAT_VUY444,
	MBXDD_FORMAT_GREY_SCALE,
	MBXDD_FORMAT_YUYV,
	MBXDD_FORMAT_YVYU,
	MBXDD_FORMAT_UYVY,
	MBXDD_FORMAT_VYUY,
	MBXDD_FORMAT_PAL12,
	MBXDD_FORMAT_PAL8,
	MBXDD_FORMAT_PAL4,
	MBXDD_FORMAT_PAL2,
	MBXDD_FORMAT_PAL1,
	MBXDD_FORMAT_ARGB1555,
	MBXDD_FORMAT_ARGB4444,
	MBXDD_FORMAT_ARGB8888,
	MBXDD_FORMAT_ABGR8888,
	MBXDD_FORMAT_YV12,
	MBXDD_FORMAT_I420,
	MBXDD_FORMAT_IMC2,
	MBXDD_FORMAT_PVRTC2,
	MBXDD_FORMAT_PVRTC4,

	MBXDD_FORMAT_COUNT,
	MBXDD_FORMAT_FORCEDWORD			= 0x7FFFFFFF
} MBXDD_FORMAT, *PMBXDD_FORMAT;

#endif /* #ifndef _PVRDD_H_ */
/*****************************************************************************
 End of file (pvrdd)
*****************************************************************************/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -