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

📄 services.h

📁 Lido PXA270平台开发板的最新BSP,包括源代码
💻 H
📖 第 1 页 / 共 5 页
字号:
	IMG_UINT32		    ui32ByteStride;
	PVRSRV_PIXEL_FORMAT	ePixelFormat;
} PVRSRV_PRIMARY_SURF_INFO;

typedef struct _PVRSRV_SURF_
{
	struct _PVRSRV_MEM_INFO_		*psMemInfo; 		/*!< primary memory info. */

	IMG_UINT32						ui32ByteStride;		/*!< Offset in bytes from one line of the surface to the next */

	IMG_UINT32 						ui32PixelWidth;		/*!< How many pixels wide is the surface */
	IMG_UINT32 						ui32PixelHeight;	/*!< How many pixels high is the surface */
	PVRSRV_PIXEL_FORMAT				ePixelFormat;		/*!< Format (e.g. rgb888) of the pixels in the surface */
														/*!< Array of pointers to the buffers set up for the flip ring */
} PVRSRV_SURF;

/*!
 *****************************************************************************
 *	Device identifier structure
 *****************************************************************************/
typedef struct _PVRSRV_DEVICE_IDENTIFIER_
{
	PVRSRV_DEVICE_TYPE		eDeviceType;		/*!< Identifies the type of the device */
	PVRSRV_DEVICE_CLASS		eDeviceClass;		/*!< Identifies more general class of device - display/3d/mpeg etc */
	IMG_UINT32				ui32DeviceIndex;	/*!< Index of the device within the system */
	IMG_UINT32				ui8VersionMajor;	/*!< Which version of the identified core */ 
	IMG_UINT32				ui8VersionMinor;	/*!< Which sub version of the core */
	IMG_BOOL				bIsMemoryMaster;	/*!< Can this device initialise the BM */
	IMG_BOOL				bIsKickerDevice;	/*!< is it the kicker device */
	IMG_BOOL				bInterruptSense;
	IMG_BOOL				bResetSense;
    IMG_UINT32              ui32CoreFlags;          /* core identification flags */
    IMG_UINT32              ui32CoreConfig;
} PVRSRV_DEVICE_IDENTIFIER;


/*!
 *	Region Header Structure
 */
typedef struct _MBX1_REGION_ENTRY_
{
	IMG_UINT32	ui32Header;	/*!< region header word */
	IMG_UINT32	ui32ListPtr;/*!< list pointer */
} MBX1_REGION_ENTRY, *PMBX1_REGION_ENTRY;


/*!
 *****************************************************************************
 * Device data specific to a 3d core
 *****************************************************************************/
typedef struct _DEVICE3D_
{
	volatile IMG_BOOL		bTAIdle;					/*!< TA idle, UM/KM */
	volatile IMG_BOOL		b3DIdle;					/*!< 3D idle, UM/KM */
	volatile IMG_BOOL		b2DIdle;					/*!< 2D idle, UM/KM */
	volatile IMG_BOOL		bRestartTA;					/*!< request to restart TA, UM/KM */
	volatile IMG_BOOL		bEnablePartialRender;		/*!< Enable partial render processing UM/KM */
								
	volatile IMG_BOOL		bTAContextInterrupt;		/*!< TA context interrupt boolean, UM/KM */
	volatile IMG_BOOL		bTAStreamErrorInterrupt;	/*!< TA stream error interrupt boolean, UM/KM */

#ifdef FIX_HW_PRN_296
	IMG_BOOL				bLastContextStreamError;	/*!< fixes persistent stream errors */
#endif

	volatile IMG_UINT32		aui32HWContextIDState[2];	/*!< state of both HW Context IDs, UM/KM */
	
	volatile PVRSRV_TARENDERINFO *psCurrentTARenderInfoKM; /*!< Current TArender context (for TA complete handler to update) */
	volatile PVRSRV_TARENDERINFO *psCurrentTARenderInfoUM; /*!< this is OK to UM because there's only one current ptr */
	
	IMG_UINT32				ui32Last3DCtlID;	/*!< last renderctl to acquire the TA, UM */
	IMG_DEV_VIRTADDR		LastTAContextDevVAddr;
												/*!< Device address of the context associated with the previous 
													TA - for multi context support */
	IMG_DEV_VIRTADDR		LastEVMContextDevVAddr;
												/*!< Device address of the previous EVM context - for multi context support */
	IMG_UINT32				ui32LastTilesX;		/*!< tile dimensions of last context */
	IMG_UINT32				ui32LastTilesY;		/*!< tile dimensions of last context */
	IMG_BOOL				bLastContextMidScene;/*!< required for clean-up */
												/*!< If true, the previous context used for the device was unfinished. */
	RENDERSYNCS_HANDLE		hRenderSync;		/*!< Render Command synchronisation handle , KM */
	
	IMG_BOOL				bRenderComplete;	/*!< ISR render complete boolean */
	volatile IMG_BOOL		bEVMDAlloc;			/*!< ISR EVM de alloc boolean */
	volatile IMG_BOOL		bTATimeOut;			/*!< ISR TA Timeout boolean */
	volatile IMG_BOOL		bTAStopMode;		/*!< signal to ISR for alternate mode of operation for TAComplete int */
	volatile IMG_BOOL		bBlock3DProcessing;	/*!< signal to ISR to block processing of renders */
	volatile IMG_BOOL		bProcVertMode;		/*!< signal to ISR for alternate mode of operation for TAComplete int */
			
	BLTSYNCS_HANDLE			hBlitSync;			/*!< Blit Command synchronisation handle, KM */
	volatile IMG_UINT32		ui32OpsCount;		/*!< Display Driver OpsCount (clock gating), KM */
												
	IMG_UINT32 				ui32BytesFreeTAFifo;/*!< Number of free bytes in fifo, UM/KM */
	IMG_UINT32 				ui32BytesReservedTA;/*!< Number of bytes in slaveport reserved for 3d, UM/KM */
	IMG_UINT32 				ui32BytesReserved2d;/*!< Number of bytes in slaveport reserved for 2d, UM/KM */
												
	PVRSRV_RES_HANDLE	 	hTAResource;		/*!< TA resource, UM/KM */
	PVRSRV_RES_HANDLE		hTAConfigResource;	/*!< resource for TAConfig, UM/KM */
	PVRSRV_RES_HANDLE	 	h2DSlaveportResource;/*!< resource for 2d slaveport, UM/KM */
	PVRSRV_MUTEX_HANDLE		hMutexTAFifoSpace;	/*!< mutex for space in TA Fifo, UM/KM */
	
	IMG_UINT32				ui32PixelsInTileX;	/*!< Number of pixels in a tile in X */
	IMG_UINT32				ui32PixelsInTileY;	/*!< Number of pixels in a tile in Y */
	IMG_UINT32				ui32TileXGran;		/*!< Number of Tiles RT must by rounded to in X */
	IMG_UINT32				ui32TileYGran;		/*!< Number of Tiles RT must by rounded to in Y */

	IMG_UINT32				ui32BackgrndTagObjID;
												/*!< Background Tag Object ID, KM */
												
	IMG_UINT32				ui32TAConfigRegVal;	/*!< copy of taconfig state to be recovered after each partial render completes */
	IMG_VOID				(*pfnGetTilePixelSize) (IMG_UINT32 *ui32Width, IMG_UINT32 *ui32Height);
												/*!< Gets device specific tile dimensions in pixels, KM */
#if defined(FIX_HW_PRN_223) || defined(FIX_HW_PRN_251) || defined(FIX_HW_PRN_264_MBXLITE) || defined(FIX_HW_PRN_264_MBX)
	IMG_UINT32				ui32SpecialListPtr; /*!< special list ptr */
#endif
#if defined (FIX_HW_PRN_264_MBX)
	IMG_UINT32				ui32SpecialObjectPointer;
#endif

	PVRSRV_PARAMBUFFER_HANDLE	hParamBuffer;	/*!< handle to parameter buffer, KM */
	IMG_UINT32				ui32ParamBufferRefCount;	/*!< reference count on PB, required because removeRTA and 
															destroyPB is not at an atomic action */

#if defined(SUPPORT_3D_BLIT)
	IMG_HANDLE					h3DBlitCtl;
	IMG_HANDLE					hOvl3DBlitCtl;
#endif	
	IMG_UINT32				ui32TASlavePortOffset;	   /*!< write offset into slave port address range */
	IMG_UINT32				ui322DSlavePortOffset;	   /*!< write offset into slave port address range */
	IMG_UINT32				ui32TAControlSlavePortOffset; /*!< write offset into slave port address range */
	
} DEVICE3D;



/*!
 *****************************************************************************
 * Device data specific to a display device
 *****************************************************************************/
typedef struct _DEVICEDISPLAY_
{
	VSYNC_FLIP_CMD_INFO_HANDLE  psVSyncFlipHead;	/*!< Vsync queue head */
	VSYNC_FLIP_CMD_INFO_HANDLE  psVSyncFlipTail;	/*!< Vsync queue tail */
	VSYNC_FLIP_CMD_INFO_HANDLE  psVSyncFlipMem;		/*!< Vsync queue memory */
	IMG_UINT32					ui32VSyncCount;		/*!< Vsyncs elapsed */
	IMG_BOOL					bProcVsyncFlip;		/*!< flip on vsync mode */
	IMG_BOOL					bIsDirty;			/*!< display update hint */
												/*!< Internal queue of commands that have been checked for
												  	 dependencies and are now waiting for a vsync */
	PVRSRV_PRIMARY_SURF	sPrimarySurface;		/*!< Structure describing the format and location of the default
													 buffer for this display device */ 

	/*!< These fn pointers could be used for 3d party display controllers. */
	IMG_VOID				(*pfnFlipDisplay) (struct _PVRSRV_DEV_INFO_ *psDevInfo, IMG_UINT32 ui32PhysAddr);
												/*!< device specific flip function  */

	IMG_VOID				(*pfnFlipOverlay) (struct _PVRSRV_DEV_INFO_ *psDevInfo, IMG_VOID* pvInfo);
	                                            /*!< device specific overlay flip function */

	IMG_VOID				(*pfnUpdateDisplay) (struct _PVRSRV_DEV_INFO_ *psDevInfo);
												/*!< device specific update function  */
} DEVICEDISPLAY;


		
/*!
 *****************************************************************************
 * Device data specific to a MPEG device
 *****************************************************************************/
typedef struct _DEVICEMPEG_
{
	IMG_UINT32 				ui32BytesFreeIDCTFifo;	/*!< Number of free bytes in fifo, UM/KM */
	PVRSRV_RES_HANDLE		hDeviceResource;		/*!< Device lock */
} DEVICEMPEG;




/*!
 *****************************************************************************
 * PVRSRV dev control block (basically all info for each dev).
 * NOTE:- Any pointers included in this structure are KERNEL mode poinsters and are
 * not meaningful in the user address space.
 * 
 *****************************************************************************/
typedef struct _PVRSRV_DEV_INFO_
{
	PVRSRV_DEVICE_IDENTIFIER sDevId;			/*!< Structure uniquely identifying the core within the system */
	PVRSRV_DEV_LOCATION		sDevLocation;		/*!< Device Memory Info */
	IMG_UINT32				ui32NumConnected;	/*!< number of client connections to device */
#ifdef SUPPORT_POWER_STATE
	PVR_POWER_STATE			ePowerState;		/*!< power state */
#endif
	
	PVRSRV_MUTEX_HANDLE		hClockGateMutex;	/*!< mutex for cgating support, UM/KM */
	
	IMG_UINT32				*pui32KickerAddrKM;		/*!< kicker address */
	
	IMG_BOOL				bDummyProcessing;	/*!< dummy command processing mode */
    struct _PVRSRV_DEV_INFO_ *psNext;	 /*!< Internal structure management */

#ifdef SUPPORT_PCI
	PVRSRV_DEV_PCI			sPCI;
#endif /* SUPPORT_PCI */
	
	/* common device functions */
	PVRSRV_ERROR			(IMG_CALLCONV *pfnInitDevice) (PPVRSRV_DEV_INFO);	/*!< device initialiser */
	PVRSRV_ERROR			(IMG_CALLCONV *pfnDeInitDevice) (PPVRSRV_DEV_INFO);	/*!< device deinitialiser */
	IMG_VOID				(*pfnDeviceISR) (PPVRSRV_DEV_INFO);					/*!< device isr handler */
	IMG_VOID 				(*pfnProcessCommands) ( PPVRSRV_DEV_INFO, 			
													PVRSRV_QUEUE_INFO*,
													PVRSRV_CMD_HEADER*);		/*!< command processor for device */
	IMG_VOID 				(*pfnDummyProcessCommands) ( PPVRSRV_DEV_INFO, 
														PVRSRV_QUEUE_INFO*,
														PVRSRV_CMD_HEADER*);	/*!< dummy command processor for device */
#ifdef SUPPORT_POWER_STATE
	//PVRSRV_ERROR			(*pfnSetPowerState) ( PPVRSRV_DEV_INFO,
	//											  PVR_POWER_STATE,		
	//											  IMG_UINT32);			/*!< power state handler for device */
	IMG_VOID			(*pfnSetPowerState) ( PPVRSRV_DEV_INFO,
												  PVR_POWER_STATE,		
												  IMG_UINT32);			/*!< power state handler for device */
#endif

  /*
   * Union to hold information specific to a specific device type
   */
	union 
	{
		DEVICE3D s3D;			/*!< 3d device specific data */
		DEVICEDISPLAY sDisplay;	/*!< display device specific data */
		DEVICEMPEG sMpeg;		/*!< mpeg device specific data */
		
	 }sDeviceSpecific;

	/* Optional System lay specific pointers, used by sysutil functions */
	IMG_PVOID		pvSysRegsPtr;	/*!< system register access */
	IMG_UINT32		ui32RegsSize;	/*!< system register access */

	IMG_PVOID		pvSysDataPtr;	/*!< system register access */
	IMG_UINT32		ui32DataSize;	/*!< system register access */

} PVRSRV_DEV_INFO;



/*! 
 *****************************************************************************
 Any device specific addreses needed in user side code.
 *****************************************************************************/
typedef struct _PVRSRV_HW_INFO_
{

	IMG_VOID			*pvRegsBase;			/*!< User mode linear address of current device register */
	IMG_UINT32			*pui32KickerAddr;		/*!< User mode linear address of Command kicker */
	IMG_VOID			*pvSOCRegsBase;			/*!< User mode linear address of SOC registers */
	/*
	 * Union to hold location information specific to a specific device type
	 */
	union {
		struct {
			PVRSRV_DEV_SLAVE_PORT	sTASlavePort;	/*!< TA Slave port info */
			PVRSRV_DEV_SLAVE_PORT	s2DSlavePort;	/*!< 2D Slave port info */
			PVRSRV_DEV_SLAVE_PORT	sTAControlSlavePort;	/*!< TA control Slave port info */

		} sMBX; 
	
		struct 
		{
			IMG_PVOID               pvSPLinearBase;	/*!< Linear slave port address */
			IMG_PVOID               pvSPCmd;		/*!< Command data linear sp addr */
			IMG_PVOID               pvSPIDCT;		/*!< IDCT data linear sp addr */

		} sM24VA; 

	} sDeviceSpecific;	  
} PVRSRV_HW_INFO;


/*! 
 *****************************************************************************
 * This structure allows the user mode glue code to have an OS independant set of 
 * prototypes
 *****************************************************************************/
typedef struct _PVRSRV_DEV_DATA_
{
	IMG_HANDLE				hServices;			/*!< UM IOCTL handle */
	PPVRSRV_DEV_INFO		psDevInfoKM;		/*!< KM version of info ptr */
	PPVRSRV_DEV_INFO		psDevInfoUM;		/*!< UM version of info ptr */

	/* Internal to services */
	PRESMAN_ITEM			psResItem;			/*!< Pointer to resource item for allocate */

} PVRSRV_DEV_DATA;


/*! 
 *****************************************************************************
 * This structure is used for OS independent registry (profile) access
 *****************************************************************************/
typedef struct _PVRSRV_REGISTRY_INFO_
{
    IMG_UINT32              ui32DevCookie;
    IMG_PCHAR                   pszKey;
    IMG_PCHAR               pszValue;
    IMG_PCHAR               pszBuf;
    IMG_UINT32              ui32BufSize;
} PVRSRV_REGISTRY_INFO, *PPVRSRV_REGISTRY_INFO;


/*****************************************************************************
 * PVR Services API prototypes.
 *****************************************************************************/
IMG_IMPORT
PVRSRV_ERROR IMG_CALLCONV PVRSRVConnect(IMG_CHAR* szDevicePath, IMG_HANDLE *phServices);

IMG_IMPORT
PVRSRV_ERROR IMG_CALLCONV PVRSRVDisconnect(IMG_HANDLE hServices);

IMG_IMPORT
PVRSRV_ERROR IMG_CALLCONV PVRSRVEnumerateDevices(	IMG_HANDLE hServices,
													IMG_UINT32 *puiNumDevices,
													PVRSRV_DEVICE_IDENTIFIER *puiDevIDs);
IMG_IMPORT
PVRSRV_ERROR IMG_CALLCONV PVRSRVAcquireDeviceData(	IMG_HANDLE			hServices,
													IMG_UINT32			uiDevIndex,
													PVRSRV_DEV_DATA		*psDevData,
													PVRSRV_DEVICE_TYPE	eDeviceType);

IMG_IMPORT
IMG_UINT32 ReadHWReg(IMG_PVOID pvLinRegBaseAddr, IMG_UINT32 ui32Offset);

⌨️ 快捷键说明

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