diff --git a/Start_WM/test6.ncb b/Start_WM/test6.ncb
new file mode 100755
index 00000000..47e9a102
Binary files /dev/null and b/Start_WM/test6.ncb differ
diff --git a/Start_WM/test6.sln b/Start_WM/test6.sln
new file mode 100755
index 00000000..6223065f
--- /dev/null
+++ b/Start_WM/test6.sln
@@ -0,0 +1,30 @@
+
+Microsoft Visual Studio Solution File, Format Version 10.00
+# Visual Studio 2008
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "test6", "test6\test6.vcproj", "{C7D031E8-B513-4310-A29D-E50069448615}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Pocket PC 2003 (ARMV4) = Debug|Pocket PC 2003 (ARMV4)
+ Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
+ Release|Pocket PC 2003 (ARMV4) = Release|Pocket PC 2003 (ARMV4)
+ Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I) = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {C7D031E8-B513-4310-A29D-E50069448615}.Debug|Pocket PC 2003 (ARMV4).ActiveCfg = Debug|Pocket PC 2003 (ARMV4)
+ {C7D031E8-B513-4310-A29D-E50069448615}.Debug|Pocket PC 2003 (ARMV4).Build.0 = Debug|Pocket PC 2003 (ARMV4)
+ {C7D031E8-B513-4310-A29D-E50069448615}.Debug|Pocket PC 2003 (ARMV4).Deploy.0 = Debug|Pocket PC 2003 (ARMV4)
+ {C7D031E8-B513-4310-A29D-E50069448615}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
+ {C7D031E8-B513-4310-A29D-E50069448615}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Build.0 = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
+ {C7D031E8-B513-4310-A29D-E50069448615}.Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Deploy.0 = Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
+ {C7D031E8-B513-4310-A29D-E50069448615}.Release|Pocket PC 2003 (ARMV4).ActiveCfg = Release|Pocket PC 2003 (ARMV4)
+ {C7D031E8-B513-4310-A29D-E50069448615}.Release|Pocket PC 2003 (ARMV4).Build.0 = Release|Pocket PC 2003 (ARMV4)
+ {C7D031E8-B513-4310-A29D-E50069448615}.Release|Pocket PC 2003 (ARMV4).Deploy.0 = Release|Pocket PC 2003 (ARMV4)
+ {C7D031E8-B513-4310-A29D-E50069448615}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).ActiveCfg = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
+ {C7D031E8-B513-4310-A29D-E50069448615}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Build.0 = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
+ {C7D031E8-B513-4310-A29D-E50069448615}.Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I).Deploy.0 = Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/Start_WM/test6.suo b/Start_WM/test6.suo
new file mode 100755
index 00000000..ce060240
Binary files /dev/null and b/Start_WM/test6.suo differ
diff --git a/Start_WM/test6/inc/GF.h b/Start_WM/test6/inc/GF.h
new file mode 100755
index 00000000..3eb96011
--- /dev/null
+++ b/Start_WM/test6/inc/GF.h
@@ -0,0 +1,43 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/** @file GF.h
+ GFSDK top-level include header file.
+*/
+
+#ifndef __GF_H__
+#define __GF_H__
+
+/* Device Interface Width */
+#define GF_DEVICE_INTERFACE_HOST_16 0x1
+#define GF_DEVICE_INTERFACE_HOST_32 0x2
+
+/* Device Interface Type */
+#define GF_DEVICE_INTERFACE_TYPE_A 0x1
+#define GF_DEVICE_INTERFACE_TYPE_B 0x2
+#define GF_DEVICE_INTERFACE_TYPE_C 0x3
+
+/*
+ * Device Addressing options and compile-time selection
+ */
+#define GF_DEVICE_ADDRESS_DIRECT 0x1
+#define GF_DEVICE_ADDRESS_INDIRECT16 0x2
+#define GF_DEVICE_ADDRESS_INDIRECT32 0x4
+
+#include "nvcommon.h"
+#include "GFDef.h"
+#include "GFRmHelp.h"
+
+/** @mainpage GoForce 5500 Software Development Kit API Reference
+
+ @image html nv_logo_horiz.gif
+*/
+
+#endif /* __GF_H__ */
+
diff --git a/Start_WM/test6/inc/GF3D.h b/Start_WM/test6/inc/GF3D.h
new file mode 100755
index 00000000..b06322c6
--- /dev/null
+++ b/Start_WM/test6/inc/GF3D.h
@@ -0,0 +1,39 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/** @file GF3D.h
+ GFSDK 3D API
+*/
+
+#ifndef __GF3D_H__
+#define __GF3D_H__
+
+#include "GF.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/** @addtogroup group3D 3DAPI 3D API
+*/
+/*@{*/
+
+// Typesafe functions for opening and closing this component
+GF_RETTYPE GF3DOpen(GFRmHandle hRm, GF3DHandle *ph3D,
+ GF_STATE_TYPE state, GFRmChHandle hCh);
+void GF3DClose(GF3DHandle *ph3D);
+
+/*@}*/
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __GF3D_H__ */
diff --git a/Start_WM/test6/inc/GFAudio.h b/Start_WM/test6/inc/GFAudio.h
new file mode 100755
index 00000000..47ccbeda
--- /dev/null
+++ b/Start_WM/test6/inc/GFAudio.h
@@ -0,0 +1,168 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/*
+ * File: GFAudio.h
+ * GFSDK Audio Format API header file.
+ */
+
+#ifndef __GFAudio_H__
+#define __GFAudio_H__
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+//*****************************************************************************
+// Audio Types
+//*****************************************************************************
+//#if defined GFMMPROC_ADVANCED_3D_AUDIO_CONTROLS
+
+typedef struct _NvVectorS32
+{
+ NvS32 x;
+ NvS32 y;
+ NvS32 z;
+
+} NvVectorS32;
+
+//#endif
+
+
+//*****************************************************************************
+// Audio Formats
+//*****************************************************************************
+//
+// Note: FrameSize and Flags must be the first 2 entries in each parameter list below.
+
+typedef struct _GFMMPROC_PCM_PARAMETERS
+{
+ NvU32 FrameSize;
+ NvU32 Flags;
+
+} GFMMPROC_PCM_PARAMETERS;
+
+typedef struct _GFMMPROC_SBC_PARAMETERS
+{
+ NvU32 FrameSize;
+ NvU32 Flags;
+ NvU8 join;
+ NvU32 SampleRate;
+ NvU16 Bitpool;
+ NvU16 Channels;
+ NvU16 Channelmode;
+ NvU32 SamplesPerFrame;
+ NvU8 subbands;
+ NvU8 bitpool;
+
+} GFMMPROC_SBC_PARAMETERS;
+
+typedef struct _GFMMPROC_MP3_PARAMETERS
+{
+ NvU32 FrameSize;
+ NvU32 Flags;
+
+ NvU32 SampleRate;
+ NvU16 BitsPerSample;
+ NvU16 Channels;
+ NvU32 SamplesPerFrame;
+
+} GFMMPROC_MP3_PARAMETERS;
+
+typedef struct _GFAUDIO_AAC_PARAMETERS
+{
+ NvU32 FrameSize;
+ NvU32 Flags;
+
+ NvU16 BitsPerSample;
+ NvU16 Channels;
+
+ NvU32 SamplingRate;
+ NvU32 ExtensionSamplingRate;
+ NvU32 BitRate;
+ NvU32 ChannelConfig;
+ NvU32 AudioObjectType;
+
+ NvS16 CntBits;
+ NvS16 frameOK;
+ NvU32 CRC_Check;
+ NvU32 CRC_Reg;
+
+} GFMMPROC_AAC_PARAMETERS;
+
+typedef struct _GFAUDIO_AMRNB_PARAMETERS
+{
+ NvU32 FrameSize;
+ NvU32 Flags;
+
+ NvU32 SamplingRate;
+ NvU16 BitsPerSample;
+ NvU16 Channels;
+ NvU32 format;
+// NvU32 SamplesPerFrame;
+// NvU32 ExtensionSamplingRate;
+ NvU32 Mode;
+ NvU32 NumberOfFrames;
+} GFMMPROC_AMRNB_PARAMETERS;
+
+typedef struct _GFAUDIO_WMA_PARAMETERS
+{
+ NvU32 FrameSize;
+ NvU32 Flags;
+
+ NvU16 FormatTag;
+ NvU16 Channels;
+ NvU32 SamplingRate;
+ NvU32 AvgBytesPerSec;
+ NvU16 BlockAlign;
+ NvU16 BitsPerSample;
+ NvU32 ChannelMask;
+ NvU16 EncodeOpt;
+ NvU16 AdvancedEncodeOpt;
+
+ // Stuff for playerInfo
+ NvU16 PlayerOpt;
+ NvS32 PeakAmplitudeRef;
+ NvS32 RmsAmplitudeRef;
+ NvS32 PeakAmplitudeTarget;
+ NvS32 RmsAmplitudeTarget;
+ NvS16 DRCSetting;
+ NvS32 *rgiMixDownMatrix;
+
+ NvU32 AuParserState;
+
+} GFMMPROC_WMA_PARAMETERS;
+
+typedef struct _GFAUDIO_AMRWB_PARAMETERS
+{
+ NvU32 FrameSize;
+ NvU32 Flags;
+
+ NvU32 SamplingRate;
+ NvU16 BitsPerSample;
+ NvU16 Channels;
+ NvU32 format;
+// NvU32 SamplesPerFrame;
+// NvU32 ExtensionSamplingRate;
+ NvU32 Mode;
+} GFMMPROC_AMRWB_PARAMETERS;
+
+typedef struct _GFMMPROC_MIDI_PARAMETERS
+{
+ NvU32 FrameSize;
+ NvU32 Flags;
+} GFMMPROC_MIDI_PARAMETERS;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
diff --git a/Start_WM/test6/inc/GFBDev.h b/Start_WM/test6/inc/GFBDev.h
new file mode 100755
index 00000000..ccbd4513
--- /dev/null
+++ b/Start_WM/test6/inc/GFBDev.h
@@ -0,0 +1,189 @@
+/*
+ * Copyright 2003-2005 NVIDIA Corporation. All Rights Reserved.
+ *
+ * BY INSTALLING THE SOFTWARE THE USER AGREES TO THE TERMS BELOW.
+ *
+ * User agrees to use the software under carefully controlled conditions
+ * and to inform all employees and contractors who have access to the software
+ * that the source code of the software is confidential and proprietary
+ * information of NVIDIA and is licensed to user as such. User acknowledges
+ * and agrees that protection of the source code is essential and user shall
+ * retain the source code in strict confidence. User shall restrict access to
+ * the source code of the software to those employees and contractors of user
+ * who have agreed to be bound by a confidentiality obligation which
+ * incorporates the protections and restrictions substantially set forth
+ * herein, and who have a need to access the source code in order to carry out
+ * the business purpose between NVIDIA and user. The software provided
+ * herewith to user may only be used so long as the software is used solely
+ * with NVIDIA products and no other third party products (hardware or
+ * software). The software must carry the NVIDIA copyright notice shown
+ * above. User must not disclose, copy, duplicate, reproduce, modify,
+ * publicly display, create derivative works of the software other than as
+ * expressly authorized herein. User must not under any circumstances,
+ * distribute or in any way disseminate the information contained in the
+ * source code and/or the source code itself to third parties except as
+ * expressly agreed to by NVIDIA. In the event that user discovers any bugs
+ * in the software, such bugs must be reported to NVIDIA and any fixes may be
+ * inserted into the source code of the software by NVIDIA only. User shall
+ * not modify the source code of the software in any way. User shall be fully
+ * responsible for the conduct of all of its employees, contractors and
+ * representatives who may in any way violate these restrictions.
+ *
+ * NO WARRANTY
+ * THE ACCOMPANYING SOFTWARE (INCLUDING OBJECT AND SOURCE CODE) PROVIDED BY
+ * NVIDIA TO USER IS PROVIDED "AS IS." NVIDIA DISCLAIMS ALL WARRANTIES,
+ * EXPRESS, IMPLIED OR STATUTORY, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ * WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT.
+
+ * LIMITATION OF LIABILITY
+ * NVIDIA SHALL NOT BE LIABLE TO USER, USER'S CUSTOMERS, OR ANY OTHER PERSON
+ * OR ENTITY CLAIMING THROUGH OR UNDER USER FOR ANY LOSS OF PROFITS, INCOME,
+ * SAVINGS, OR ANY OTHER CONSEQUENTIAL, INCIDENTAL, SPECIAL, PUNITIVE, DIRECT
+ * OR INDIRECT DAMAGES (WHETHER IN AN ACTION IN CONTRACT, TORT OR BASED ON A
+ * WARRANTY), EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGES. THESE LIMITATIONS SHALL APPLY NOTWITHSTANDING ANY FAILURE OF THE
+ * ESSENTIAL PURPOSE OF ANY LIMITED REMEDY. IN NO EVENT SHALL NVIDIA'S
+ * AGGREGATE LIABILITY TO USER OR ANY OTHER PERSON OR ENTITY CLAIMING THROUGH
+ * OR UNDER USER EXCEED THE AMOUNT OF MONEY ACTUALLY PAID BY USER TO NVIDIA
+ * FOR THE SOFTWARE PROVIDED HEREWITH.
+ */
+
+/*
+ * File: GFBDev.h
+ * GFSDK Block Device API header file.
+ */
+
+#ifndef GF_BDEV_H
+#define GF_BDEV_H
+
+#include "GF.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+/** @addtogroup groupBDev BDevAPI Block Device API
+ */
+/*@{*/
+
+/** Block Device Capability definitions
+ Low 12 bits are for device types.
+ Matches GFFDEV_CAP_DEVICE_xxx in GFFDev.h
+ */
+#define GFBDEV_CAP_SD GFFDEV_CAP_DEVICE_SD /**< SD Storage Supported */
+#define GFBDEV_CAP_SDIO GFFDEV_CAP_DEVICE_SDIO /***< SDIO Supported */
+#define GFBDEV_CAP_MOUNT 0x00010000 /**< Mount/Unmount Supported */
+#define GFBDEV_CAP_DEVICE_MASK 0x00000FFF
+
+/** GFDRV_INFO: File system run-time struct.
+ Created when the volume is mounted via GFBDevMount (@see GFBDevMount()).
+ sec_total, sec_size, read, and write are filled in by
+ GFBDevMount() (or its lower level out-calls).
+
+ read is mapped to BDevSDRead
+ write is mapped to BDevSDWrite
+ -- see GFBDevSD.c for details.
+ */
+typedef struct _GFDRV_INFO
+{
+ NvU32 dev;
+ NvU32 fat_type;
+ NvU32 sec_size;
+ NvU32 sec_total;
+ NvU32 cluster_size;
+ NvU32 cluster_total;
+ NvU32 rel_sec;
+ NvU32 data_sec_count;
+ NvU32 fat_sec_count;
+ NvU32 dir_count;
+ NvU32 root_sec_count;
+ NvU32 boot_sec;
+ NvU32 fat1_sec;
+ NvU32 fat2_sec;
+ NvU32 root_sec;
+ NvU32 data_sec;
+ NvU32 reFormat;
+
+ NvU32 (*upd_fat)( struct _GFDRV_INFO *drv, NvU32 ndx, NvU32 data );
+ NvU32 (*new_fat)( struct _GFDRV_INFO *drv, NvU32 ndx );
+ NvU32 (*next_fat)( struct _GFDRV_INFO *drv, NvU32 ndx );
+ NvU32 (*get_fat)( struct _GFDRV_INFO *drv, NvU32 ndx );
+ NvU32 (*read)( NvU32 dev, NvU32 sec, NvU32 secSize, NvU32 count,
+ NvU32 buf );
+ NvU32 (*write)( NvU32 dev, NvU32 sec, NvU32 secSize, NvU32 count,
+ NvU32 buf );
+
+ unsigned char *part_tab;
+ unsigned char *boot_tab;
+ unsigned char *fat_tab;
+ unsigned char *dir_tab;
+} GFDRV_INFO;
+
+/* Publicly exposed Block Device API function in the table */
+/** @internal */
+typedef struct _GFBDEVTABLE
+{
+ GF_RETTYPE (* BDevGetProperty)( GFBDevHandle BDevHandle,
+ PGFPROPERTY pBDevProp );
+
+ GF_RETTYPE (* BDevMount)( GFBDevHandle BDevHandle,
+ GFDRV_INFO **pDrvInfo );
+
+ GF_RETTYPE (* BDevUnmount)( GFBDevHandle BDevHandle );
+
+} GFBDEVTABLE, *PGFBDEVTABLE;
+
+// Typesafe functions for opening and closing this component
+GF_RETTYPE GFBDevSDOpen(GFRmHandle hRm, GFBDevHandle *phBDev,
+ GF_STATE_TYPE state, GFRmChHandle hCh);
+void GFBDevClose(GFRmHandle hRm, GFBDevHandle *phBDev);
+
+/** @name Functions
+@{*/
+
+/** Gets BDev API properties.
+ @param BDevHandle (#GFBDevHandle) Handle to the Block Device API
+ @param pBDevProp (#PGFPROPERTY) pointer to property struct.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Error
+ */
+#define GFBDevGetProperty( BDevHandle, pBDevProp ) \
+ ((PGFBDEVTABLE)BDevHandle)->BDevGetProperty( BDevHandle, pBDevProp )
+
+/** Initializes the SD device and run-time support structure.
+ @param BDevHandle (#GFBDevHandle) Handle to the Block Device API
+ @param pDrvInfo (#GFDRV_INFO) run-time support struct
+
+ This creates and assigns a #GFDRV_INFO into
+ the given BDevHandle (actually a #BDEVSDTABLE).
+ Read and Write functions are assinged into the #GFDRV_INFO which
+ should be used by higher-level file systems to access the SD
+ device.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Error
+ */
+#define GFBDevMount( BDevHandle, pDrvInfo ) \
+ ((PGFBDEVTABLE)BDevHandle)->BDevMount( BDevHandle, pDrvInfo )
+
+/** Uninitializes the SD device.
+ @param BDevHandle (#GFBDevHandle) Handle to the Block Device API
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Error
+ */
+#define GFBDevUnmount( BDevHandle ) \
+ ((PGFBDEVTABLE)BDevHandle)->BDevUnmount( BDevHandle )
+
+/*@}*/
+/*@}*/
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* GF_BDEV_H */
+
diff --git a/Start_WM/test6/inc/GFBitmap.h b/Start_WM/test6/inc/GFBitmap.h
new file mode 100755
index 00000000..22286e00
--- /dev/null
+++ b/Start_WM/test6/inc/GFBitmap.h
@@ -0,0 +1,45 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/*
+ * File: GFBitmap.h
+ * GFSDK Bitmap header file.
+ */
+
+
+#ifndef __GFBITMAP_H__
+#define __GFBITMAP_H__
+
+/* Bitmap Color Format - Follow Surface Format GF_SURFACE_xxx */
+#define GF_BITMAP_YUV420 0x00000001
+#define GF_BITMAP_YUV422 0x00000002
+#define GF_BITMAP_YUYV (GF_BITMAP_YUV422|0x00000004)
+#define GF_BITMAP_YVYU (GF_BITMAP_YUV422|0x00000008)
+#define GF_BITMAP_UYVY (GF_BITMAP_YUV422|0x00000010)
+#define GF_BITMAP_VYUY (GF_BITMAP_YUV422|0x00000020)
+#define GF_BITMAP_MPEGDEC (GF_BITMAP_YUV420|0x00000040)
+#define GF_BITMAP_RGB565 0x00010000
+#define GF_BITMAP_RGB8 0x00070000
+#define GF_BITMAP_ARGB8888 0x00030000
+#define GF_BITMAP_ARGB6666 0x000F0000
+
+/* Bitmap */
+typedef struct _GFBITMAP
+{
+ NvU16 width;
+ NvU16 height;
+ NvS32 stride;
+ NvU32 format;
+ NvU8 bpp; // Bits per pixel
+ NvU8 reserved;
+ NvU16 offset; // Offset from beginning of bitmap to data
+ NvU8 data; // Real data starts from "Offset" location
+} GFBITMAP, *PGFBITMAP;
+
+#endif /* __GFBITMAP_H__ */
diff --git a/Start_WM/test6/inc/GFCamera.h b/Start_WM/test6/inc/GFCamera.h
new file mode 100755
index 00000000..f7730b5a
--- /dev/null
+++ b/Start_WM/test6/inc/GFCamera.h
@@ -0,0 +1,367 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/** @file GFCamera.h
+ GFSDK Camera API header file.
+*/
+
+#ifndef __CAMERA_H__
+#define __CAMERA_H__
+
+#include "GF.h"
+#include "GFVx.h"
+#include "GFCameraScr.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+/** @addtogroup groupCamera CameraAPI Camera API
+
+ @ref pageCameraAppNotes
+
+ @ref pageCameraAppNotes1
+
+
+*/
+/*@{*/
+
+
+/* Helper Macros - Do not assume bytes are properly aligned! */
+#ifndef MAKENvU8S16
+#define MAKENvU8S16( data16 ) \
+ (NvU8)((data16) & 0xFF), (NvU8)(((data16) >> 8) & 0xFF)
+#endif /* MAKENvU8S16 */
+#ifndef MAKENvU8S32
+#define MAKENvU8S32( data32 ) \
+ (NvU8)((data32) & 0xFF), \
+ (NvU8)(((data32) >> 8) & 0xFF), \
+ (NvU8)(((data32) >> 16) & 0xFF), \
+ (NvU8)(((data32) >> 24) & 0xFF)
+#endif /* MAKENvU8S32 */
+#ifndef MAKE16
+#define MAKE16( ptr ) \
+ ((NvU16)(*ptr) | ((NvU16)(*(ptr+1)) << 8))
+#endif /* MAKE16 */
+#ifndef MAKE32
+#define MAKE32( ptr ) \
+ ((NvU32)MAKE16( ptr ) | (NvU32)MAKE16( (ptr+2) ) << 16)
+#endif /* MAKE32 */
+
+/* GFCAMERA instruction (special) */
+#define GFCAMERA_NONE 0x00
+#define GFCAMERA_NORMAL_WRITE 0x01
+#define GFCAMERA_DELAY_MSEC 0x02
+#define GFCAMERA_NEED_MCLOCK 0x03
+
+/* GFCameraSetResolution Options */
+#define GFCAMERA_POWERON_OPTION 0x00000001
+
+/* GFCAMERA Error codes */
+#define GFCAM_ERROR_ILLEGAL_PARAMETER (GFCAM_ERROR | 0x00000001L)
+#define GFCAM_ERROR_ALLOC_FAILED (GFCAM_ERROR | 0x00000002L)
+#define GFCAM_ERROR_VM_ALLOC_FAILED (GFCAM_ERROR | 0x00000003L)
+#define GFCAM_ERROR_SCRIPT_ACCESS_FAILED (GFCAM_ERROR | 0x00000004L)
+#define GFCAM_ERROR_NATIVE_FUNCTION_FAILED (GFCAM_ERROR | 0x00000005L)
+#define GFCAM_ERROR_GETTING_COMPONENT (GFCAM_ERROR | 0x00000006L)
+#define GFCAM_ERROR_VM_BUFFER_ALLOC_FAILED (GFCAM_ERROR | 0x00000007L)
+#define GFCAM_ERROR_CAMERA_SCRIPT_NOT_PRESENT (GFCAM_ERROR | 0x00000008L)
+#define GFCAM_ERROR_FUNCTION_NOT_SUPPORTED (GFCAM_ERROR | 0x00000009L)
+
+/* GFCAMERAINSTRTYPE */
+typedef struct _GFCAMERAINSTRTYPE
+{
+ NvU16 skip; // IMPORTANT: Multiple instructions
+ // must be in ascending skip order
+ NvU8 type;
+ NvU16 size;
+ NvU32 data;
+} GFCAMERAINSTRTYPE, *PGFCAMERAINSTRTYPE;
+
+/* GFCAMERABAYERINFO - BayerInfo struct */
+typedef struct _GFCAMERABAYERINFO
+{
+ NvU16 ScanWidth;
+ NvU16 ScanHeight;
+
+ NvU16 ActiveLineStart;
+ NvU16 ActiveLineWidth;
+ NvU16 ActiveFrameStart;
+ NvU16 ActiveFrameHeight;
+ NvU8 hSyncEdge;
+ NvU8 vSyncEdge;
+ NvU16 bayerSel;
+
+} GFCAMERABAYERINFO, *PGFCAMERABAYERINFO;
+
+/* GFCAMERARESOLUTIONTYPE - Resolution struct */
+typedef struct _GFCAMERARESOLUTIONTYPE
+{
+ NvU16 x;
+ NvU16 y;
+ NvU8 numInstr;
+ GFCAMERAINSTRTYPE *pInstr;
+ GFCAMERABAYERINFO *pBayerInfo;
+} GFCAMERARESOLUTIONTYPE, *PGFCAMERARESOLUTIONTYPE;
+
+
+
+/* GFCAMERATABLETYPE - Camera Table */
+#define GFCAMERA_NAME_SIZE 32
+typedef struct _GFCAMERATABLETYPE
+{
+ NvU16 id;
+ NvU16 ver;
+ NvU32 scriptSubID;
+ char name[GFCAMERA_NAME_SIZE];
+ // variable name char string always
+ // ends with a '0'
+ NvU32 VIPFlag;
+ NvU32 VIPNewTiming;
+ NvU32 VIPColorFormat;
+ NvU8 VIPHOffset;
+ NvU8 VIPVOffset;
+ NvU8 numI2CBytes; //bytes per transfer/packet
+ NvU8 numRes;
+ GFCAMERARESOLUTIONTYPE *pResData;
+ NvU16 initDataSize;
+ NvU8 *pInitData;
+// GFCAMERABAYERINFO *pBayerInfo;
+ struct _GFCAMERATABLETYPE *pNext;
+} GFCAMERATABLETYPE, *PGFCAMERATABLETYPE;
+
+// Typesafe functions for opening and closing this component
+GF_RETTYPE GFCameraOpen(GFRmHandle hRm, GFCameraHandle *phCamera,
+ GF_STATE_TYPE state, GFRmChHandle hCh);
+void GFCameraClose(GFCameraHandle *phCamera);
+
+/** This routine returns the camera's properties and capabilities.
+ These properties are returned in the GFPROPERTY structure.
+
+ @param CameraHandle (#GFCameraHandle) Handle to CameraAPI
+ @param pProp (PGFPROPERTY) Pointer to GFPROPERTY structure.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ @see GFPROPERTY
+*/
+GF_RETTYPE GFCameraGetProperty(GFCameraHandle CameraHandle,
+ PGFPROPERTY pProp);
+
+/** This routine programs the camera's registers based on the data
+ contained in the camera table.
+
+ @param CameraHandle (#GFCameraHandle) Handle to CameraAPI
+ @param pCamera (PGFCAMERATABLETYPE) Pointer to camera entry.
+ @param resX (NvU16) Horizontal resolution
+ @param resY (NvU16) Vertical resolution
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ @see PGFCAMERATABLETYPE
+*/
+GF_RETTYPE GFCameraSetup(GFCameraHandle CameraHandle,
+ PGFCAMERATABLETYPE pCamera,
+ NvU16 resX,
+ NvU16 resY );
+
+/** This routine programs the camera's registers for a resolution change.
+ The main difference from GFCameraSetup() is the lack of camera power on.
+
+ @param CameraHandle (#GFCameraHandle) Handle to CameraAPI
+ @param pCamera (PGFCAMERATABLETYPE) Pointer to camera entry.
+ @param resX (NvU16) Horizontal resolution
+ @param resY (NvU16) Vertical resolution
+ @param poweron (NvU32) flag indicates whether camera power on should be executed
+ @param option (NvU32) flag passed to camera script SetResolution function
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ @see PGFCAMERATABLETYPE
+*/
+GF_RETTYPE GFCameraSetResolution(GFCameraHandle CameraHandle,
+ PGFCAMERATABLETYPE pCamera,
+ NvU16 resX,
+ NvU16 resY,
+ NvU32 poweron,
+ NvU32 option);
+
+/** This routine allocates the run-time camera table structure from the
+ camera scripts.
+
+ @param CameraHandle (#GFCameraHandle) Handle to CameraAPI
+ @param *pTable (NvU8) Pointer to camera configuration table, ignored for GFSDK SC15.
+ Camera configurations are passed via scripts.
+ @param *ppCamera (PGFCAMERATABLETYPE) Returns pointer to linked list of camera description tables
+
+ @return On success the number of cameras in the linked list is returned. This can be 0.
+ On failure an error code is returned. To distinguish between success and failure,
+ use macro #ISGFERROR() or #ISGFSUCCESS().
+
+ @see PGFCAMERATABLETYPE
+*/
+GF_RETTYPE GFCameraTableAlloc(GFCameraHandle CameraHandle,
+ NvU8 *pTable,
+ PGFCAMERATABLETYPE *ppCamera);
+
+/** This routine frees the camera table structure created by
+ GFCameraTableAlloc().
+
+ @param CameraHandle (#GFCameraHandle) Handle to CameraAPI
+ @param *ppCamera (PGFCAMERATABLETYPE) Pointer to camera entry.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ @see PGFCAMERATABLETYPE
+*/
+GF_RETTYPE GFCameraTableFree(GFCameraHandle CameraHandle,
+ PGFCAMERATABLETYPE *ppCamera);
+
+GF_RETTYPE GFCameraTableDump(GFCameraHandle CameraHandle,
+ PGFCAMERATABLETYPE pCamera);
+
+/** This routine finds a camera that is contained in the camera table structure.
+ It does so using various parameters that refer to entries in the table.
+
+ @param CameraHandle (#GFCameraHandle) Handle to CameraAPI
+ @param *pCamera (PGFCAMERATABLETYPE) Pointer to camera entry.
+ @param *pWanted (PGFCAMERATABLETYPE) Pointer to the found PGFCAMERATABLETYPE structure.
+ @param id (NvU32) Unique I2C slave ID for the camera.
+ @param *name (Char) pointer to name.
+ @param resX (NvU16) Horizontal resolution
+ @param resY (NvU16) Vertical resolution
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+*/
+GF_RETTYPE GFCameraFind(GFCameraHandle CameraHandle,
+ PGFCAMERATABLETYPE pCamera,
+ PGFCAMERATABLETYPE *pWanted,
+ NvU32 id,
+ char *name,
+ NvU16 resX,
+ NvU16 resY );
+
+/** This routine scans for a camera that is contained in the
+ table structure created by GFCameraTableAlloc().
+
+ @param CameraHandle (#GFCameraHandle) Handle to CameraAPI
+ @param *pTable (NvU8) Pointer to camera table.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+*/
+GF_RETTYPE GFCameraScan(GFCameraHandle CameraHandle,
+ PGFCAMERATABLETYPE pCamera);
+
+/** This routine uses the script subID parameter to find a camera
+ that is contained in the camera table structure.
+
+ @param CameraHandle (#GFCameraHandle) Handle to CameraAPI
+ @param *pCamera (PGFCAMERATABLETYPE) Pointer to camera entry.
+ @param *pWanted (PGFCAMERATABLETYPE) Pointer to the found PGFCAMERATABLETYPE structure.
+ @param subID (NvU32) Camera script subID.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+*/
+GF_RETTYPE GFCameraScriptFind(GFCameraHandle CameraHandle,
+ PGFCAMERATABLETYPE pCamera,
+ PGFCAMERATABLETYPE *pWanted,
+ NvU32 subID);
+
+/** This routine calls the camera script function to operate on a user defined
+ camera attribute. A shared buffer is used to pass parameters to and from
+ the camera script function.
+
+ The shared buffer and may contain data used by the script function
+ to perform the requested operation. The first data should indicate
+ the primary setting of the operation. The convention is to use ranges
+ that are normalized from 0 to 100. Where specific data is required,
+ that data must match that which is allowable by the camera in use.
+ If not, the error code GFCAM_ERROR_ILLEGAL_PARAMETER is returned.
+
+ The attribute may be one of the defined flags listed below.
+ GFCAMERA_CAMERACONTROL_PAN
+ GFCAMERA_CAMERACONTROL_TILT
+ GFCAMERA_CAMERACONTROL_ROLL
+ GFCAMERA_CAMERACONTROL_ZOOM
+ GFCAMERA_CAMERACONTROL_EXPOSURE
+ GFCAMERA_CAMERACONTROL_IRIS
+ GFCAMERA_CAMERACONTROL_FOCUS
+ GFCAMERA_CAMERACONTROL_FLASH
+ GFCAMERA_VIDEOPROCAMP_BRIGHTNESS
+ GFCAMERA_VIDEOPROCAMP_CONTRAST
+ GFCAMERA_VIDEOPROCAMP_HUE
+ GFCAMERA_VIDEOPROCAMP_SATURATION
+ GFCAMERA_VIDEOPROCAMP_SHARPNESS
+ GFCAMERA_VIDEOPROCAMP_GAMMA
+ GFCAMERA_VIDEOPROCAMP_COLORENABLE
+ GFCAMERA_VIDEOPROCAMP_WHITEBALANCE
+ GFCAMERA_VIDEOPROCAMP_BACKLIGHT_COMPENSATION
+ GFCAMERA_VIDEOPROCAMP_GAIN
+
+
+ @param CameraHandle (#GFCameraHandle) Handle to CameraAPI
+ @param *pCamera (PGFCAMERATABLETYPE) Pointer to camera entry.
+ @param attribute (NvU32) Attribute flag indicates operation.
+ @param *sharedBuffer (NvU32) pointer to a shared buffer.
+ @param bufferSize (NvU32) Size of shared buffer.
+ @param *readValue (NvU32) pointer to the returned value from the camera script function.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+ @retval #GFCAM_ERROR_FUNCTION_NOT_SUPPORTED Attribute not supported
+ @retval #GFCAM_ERROR_ILLEGAL_PARAMETER Parameter out of range
+
+*/
+GF_RETTYPE GFCameraScriptSetAttribute(GFCameraHandle CameraHandle,
+ PGFCAMERATABLETYPE pCamera,
+ NvU32 attribute,
+ NvU32 *sharedBuffer,
+ NvU32 bufferSize,
+ NvU32 *readValue);
+
+/** This routine uses the camera script function to execute a powerup or
+ powerdown sequence.
+
+ @param CameraHandle (#GFCameraHandle) Handle to CameraAPI
+ @param *pCamera (PGFCAMERATABLETYPE) Pointer to camera entry.
+ @param poweron (NvU32) If set to '0' execute powerdown, if '1', execute powerup.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+*/
+GF_RETTYPE GFCameraPower(GFCameraHandle CameraHandle,
+ PGFCAMERATABLETYPE pCamera,
+ NvU32 poweron);
+
+/*@}*/
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+/** @page pageCameraAppNotes CameraAPI Application Notes
+
+ @section pageCameraAppNotes1 Todo
+
+*/
+
+#endif /* __CAMERA_H__ */
+
diff --git a/Start_WM/test6/inc/GFCameraScr.h b/Start_WM/test6/inc/GFCameraScr.h
new file mode 100755
index 00000000..b34eb21b
--- /dev/null
+++ b/Start_WM/test6/inc/GFCameraScr.h
@@ -0,0 +1,40 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+#if !defined (__GFCAMERASCR_INC__)
+#define __GFCAMERASCR_INC__
+
+/* Camera Script error codes */
+#define GFCAMERA_NOT_SUPPORTED 0x80000000 //return error code for attribute
+#define GFCAMERA_PARAMETER_ERROR 0x80000001 //return out of range parameter
+
+/** Camera script attribute flags, for camera control functions
+ @see GFCameraScriptSetAttribute()
+*/
+#define GFCAMERA_CAMERACONTROL_PAN 0x00000001
+#define GFCAMERA_CAMERACONTROL_TILT 0x00000002
+#define GFCAMERA_CAMERACONTROL_ROLL 0x00000003
+#define GFCAMERA_CAMERACONTROL_ZOOM 0x00000004
+#define GFCAMERA_CAMERACONTROL_EXPOSURE 0x00000005
+#define GFCAMERA_CAMERACONTROL_IRIS 0x00000006
+#define GFCAMERA_CAMERACONTROL_FOCUS 0x00000007
+#define GFCAMERA_CAMERACONTROL_FLASH 0x00000008
+#define GFCAMERA_VIDEOPROCAMP_BRIGHTNESS 0x00000009
+#define GFCAMERA_VIDEOPROCAMP_CONTRAST 0x0000000a
+#define GFCAMERA_VIDEOPROCAMP_HUE 0x0000000b
+#define GFCAMERA_VIDEOPROCAMP_SATURATION 0x0000000c
+#define GFCAMERA_VIDEOPROCAMP_SHARPNESS 0x0000000d
+#define GFCAMERA_VIDEOPROCAMP_GAMMA 0x0000000e
+#define GFCAMERA_VIDEOPROCAMP_COLORENABLE 0x0000000f
+#define GFCAMERA_VIDEOPROCAMP_WHITEBALANCE 0x00000010
+#define GFCAMERA_VIDEOPROCAMP_BACKLIGHT_COMPENSATION 0x00000011
+#define GFCAMERA_VIDEOPROCAMP_GAIN 0x00000012
+
+#endif
+
diff --git a/Start_WM/test6/inc/GFDef.h b/Start_WM/test6/inc/GFDef.h
new file mode 100755
index 00000000..c7a9df55
--- /dev/null
+++ b/Start_WM/test6/inc/GFDef.h
@@ -0,0 +1,254 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/*
+ * File: GFDef.h
+ * GFSDK Definition header file
+ */
+
+#ifndef __GFDEF_H__
+#define __GFDEF_H__
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+#include "GFDefScr.h"
+
+/* Register field manipulation using xxx_RANGE macros defined in hardware
+ * header files.
+ */
+#define GF_LOWBIT(x) (0?x)
+#define GF_HIGHBIT(x) (1?x)
+#define GF_SIZE(x) (GF_HIGHBIT(x)-GF_LOWBIT(x)+1)
+#define GF_SHIFT(x) ((0?x)%32)
+#define GF_MASK(x) (0xFFFFFFFFUL>>(31-((1?x)%32)+((0?x)%32)))
+#define GF_BITS(val, x) (((val) & GF_MASK(x))<> GF_SHIFT(d##_##r##_0_##f##_RANGE))& GF_MASK(d##_##r##_0_##f##_RANGE))
+
+#define GF_FLD_SET_DRF_NUM(d,r,f,n,v) ((v & ~GF_SHIFTMASK(d##_##r##_0_##f##_RANGE)) | GF_DRF_NUM(d,r,f,n))
+#define GF_FLD_SET_DRF_DEF(d,r,f,c,v) (((v) & ~GF_SHIFTMASK(d##_##r##_0_##f##_RANGE)) | GF_DRF_DEF(d,r,f,c))
+
+#define GF_RESETVAL(d,r) (d##_##r##_0_RESET_VAL)
+
+#define OP_DRF_DEF(o,f,c) ((o##_##f##_##c) << GF_SHIFT(o##_##f##_RANGE))
+#define OP_DRF_NUM(o,f,n) (((n)& GF_MASK(o##_##f##_RANGE))<< GF_SHIFT(o##_##f##_RANGE))
+#define OP_DRF_VAL(o,f,v) (((v)>> GF_SHIFT(o##_##f##_RANGE))& GF_MASK(o##_##f##_RANGE))
+
+#define OP_FLD_SET_DRF_NUM(o,f,n,v) ((v & ~GF_SHIFTMASK(o##_##f##_RANGE)) | GF_DRF_NUM(o,f,n))
+#define OP_FLD_SET_DRF_DEF(o,f,c,v) (((v) & ~GF_SHIFTMASK(o##_##f##_RANGE)) | GF_DRF_DEF(o,f,c))
+
+/* Default Return Codes */
+/* - All errors has MSB set, indicate a negative val. */
+
+/** Macro to test if an error code of type GF_RETTYPE signals failure.
+ @param code (GF_RETTYPE) Error code
+ @return Evaluates to \a true on failure, \a false on success.
+*/
+#define ISGFERROR(code) ((GF_RETTYPE)(code) < GF_SUCCESS)
+
+/** Macro to test if an error code of type GF_RETTYPE signals success.
+ @param code (GF_RETTYPE) Error code
+ @return Evaluates to \a true on success, \a false on failure.
+*/
+#define ISGFSUCCESS(code) ((GF_RETTYPE)(code) >= GF_SUCCESS)
+
+/** Common error code: Generic error. */
+#define GF_ERROR 0x80000000L
+/** Common error code: Success (not an error). */
+#define GF_SUCCESS 0x00000000L
+/** Common error code: Busy (not an error). */
+#define GF_ERROR_BUSY 0x80000001L
+/** Common error code: Out of memory. This can be CPU heap memory, or GPU memory. */
+#define GF_ERROR_OUT_MEMORY 0x80000003L
+/** Common error code: Bad parameter. */
+#define GF_ERROR_BAD_PARAMETER 0x80000005L
+
+
+#define GF_COMPONENT_ERROR_SHIFT 24
+/** Macro to reverse bits of the 7 bit component ID.
+ See GF_RETTYPE for explanation.
+*/
+#define GF_COMPONENT_REVERSE(c) ((((c)&64)>>6)|(((c)&32)>>4)|(((c)&16)>>2)|((c)&8)|(((c)&4)<<2)|(((c)&2)<<4)|(((c)&1)<<6))
+
+#define GX_ERROR (GF_COMPONENT_REVERSE(GF_GXAPI)<
+
+/** Utility macro */
+#define CHECK_STATUS_CLEANUP(f) \
+ do { \
+ if(ISGFERROR( ( status = (f) ) )) \
+ goto Cleanup; \
+ } while(0)
+
+
+
+#if !defined(NV_MODS)
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/*
+ * READ THIS FIRST:
+ *
+ * None of these funtions should be called directly by an application. The
+ * macros below should be used instead.
+ */
+
+/** Diag context structure */
+typedef struct _GFDIAGCONTEXT
+{
+ NvU32 processID;
+ NvU32 threadID;
+} GFDIAGCONTEXT, *PGFDIAGCONTEXT;
+
+
+/** Public exposed DIAG API functions in the table */
+typedef struct _GFDIAGTABLE
+{
+ /**
+ @see GF_DIAG_INITIALIZE
+ */
+ GF_RETTYPE ( *DiagInitialize)( GFDiagHandle DiagHandle, int argc, char **argv );
+
+ /**
+ @see GF_DIAG_GET_VERSION
+ */
+ GF_RETTYPE ( *DiagGetVersion)( GFDiagHandle DiagHandle, char *versionStr, int bufferLen );
+
+ /**
+ @see GF_DIAG_SET_RENDER_SURFACE
+ */
+ GF_RETTYPE ( *DiagSetRenderSurface)( GFDiagHandle DiagHandle, PGFRMSURFACE surface );
+
+ /**
+ @see GF_DIAG_SET_IDLE_CHIP_CALLBACK
+ */
+ GF_RETTYPE ( *DiagSetIdleChipCallback)( GFDiagHandle DiagHandle,
+ GF_RETTYPE (*pIdleCallback)(void *idleCallbackData), void *data );
+
+ /**
+ @see GF_DIAG_FRAME_DONE
+ */
+ GF_RETTYPE ( *DiagFrameDone)( GFDiagHandle DiagHandle );
+
+ /**
+ @see GF_DIAG_CLEANUP
+ */
+ GF_RETTYPE ( *DiagCleanup)( GFDiagHandle DiagHandle );
+
+ /**
+ @see GF_DIAG_RUN_TEST
+ */
+ GF_RETTYPE (* DiagRunTest)( GFDiagHandle DiagHandle, char *testName,
+ const char *pCmdLine, NvU8 flag, GFDiagHandle *pDiagChildHandle );
+
+ /**
+ @see GF_DIAG_WAIT_FOR_TEST
+ */
+ GF_RETTYPE (* DiagWaitForTest)( GFDiagHandle DiagHandle );
+
+ /**
+ @see GF_DIAG_PRINT
+ */
+ GF_RETTYPE (* DiagPrint)( GFDiagHandle DiagHandle, const char *msg );
+
+ /**
+ @see GF_DIAG_GET_CONTEXT
+ */
+ GF_RETTYPE (* DiagGetContext)( GFDiagHandle DiagHandle, GFDIAGCONTEXT *pContext );
+} GFDIAGTABLE, *PGFDIAGTABLE;
+
+/*
+*****************************************************************************
+* MACROS - Apps should use these to communicate with GFDiag
+*****************************************************************************
+*/
+
+// Function documentation goes here to bypass #ifdef problems
+
+/** @name Functions
+@{*/
+
+/** @def GF_DIAG_MAIN
+ Replace your standard definition of "int main" with with this macro
+ for use with GFDiag.
+
+ @param unused1 (int) Unused -- obsolete argument, to be removed
+ @param unused2 (char**) Unused -- obsolete argument, to be removed
+ @param testName (char*) Name of the test
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+*/
+
+/** @def GF_DIAG_INITIALIZE
+ Control things like storing vs checking, HW vs SW crcs via this function.
+
+ @param DiagHandle (#GFDiagHandle) Handle to Diag
+ @param argc (int) Argument count
+ @param argv (char**) Argument data
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ Will read in the stored CRCs if applicable.
+*/
+
+/** @def GF_DIAG_GET_VERSION
+ Query the GFDiag version.
+
+ @param DiagHandle (#GFDiagHandle) Handle to Diag
+ @param str (char*) Pointer to a buffer that will be filled with the GFDiag version
+ @param len (int) Length of the buffer, versionStr
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ The application allocates a buffer and passes it
+ (along with its length) to GFDiag.
+*/
+
+/** @def GF_DIAG_SET_IDLE_CHIP_CALLBACK
+Allow the test to idle the chip in its own way.
+
+ @param DiagHandle (#GFDiagHandle) Handle to Diag
+ @param callbackFn (GF_RETTYPE (void *idleCallbackData)) Function pointer to call on idle
+ @param callbackData (void*) Data to pass to pIdleCallback when it is called
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+*/
+
+/** @def GF_DIAG_SET_RENDER_SURFACE
+ Tell GFDiag what surface we want to CRC etc.
+
+ @param DiagHandle (#GFDiagHandle) Handle to Diag
+ @param surface (#PGFRMSURFACE) Surface we want to CRC
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+*/
+
+/** @def GF_DIAG_FRAME_DONE
+ Announce the completion of a frame.
+
+ @param DiagHandle (#GFDiagHandle) Handle to Diag
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ GFDiag has the option to:
+
+ Calculate a CRC on the primary surface. This function calls the callback
+ function set by GFDiagSetIdleChipCallback (or a default if no idle chip
+ callback is supplied) to idle the chip before calculating CRCs
+
+ In "storing mode" this will store the CRC in some DB that gets written
+ to file later.
+
+ In "checking mode" this checks the CRC against the one we read in from file.
+*/
+
+/** @def GF_DIAG_CLEANUP
+ Perform any necessary cleanup operations before the test exits and write
+ CRCs to file if applicable.
+
+ @param DiagHandle (#GFDiagHandle) Handle to Diag
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+*/
+
+/** @def GF_DIAG_PRINT
+ Prints to GFDiag.
+
+ @param DiagHandle (#GFDiagHandle) Handle to Diag
+ @param x (const char*) Message to print
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+*/
+
+/** @def GF_DIAG_RUN_TEST
+Starts a test executing.
+
+ @param DiagHandle (#GFDiagHandle) Handle to Diag
+ @param testName (char*) Name of the test to execute
+ @param pCmdLine (const char*) The command line to execute the test
+ @param flag (NvU8) This is an option specifying how the test should be run. May contain one of: GF_DIAG_RUN_NEW_PROCESS, GF_DIAG_RUN_NEW_THREAD or GF_DIAG_RUN_NORMAL
+ @param pDiagChildHandle (#GFDiagHandle) This is a pointer to a GFDiagHandle that will be filled in with the handle of the child process
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+*/
+
+/** @def GF_DIAG_WAIT_FOR_TEST
+ Waits for test to complete, return value will be result of test.
+
+ @param DiagHandle (#GFDiagHandle) Handle to Diag of test to run (probably the handle placed in pDiagChildHandle from GF_DAIG_RUN_TEST)
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ @see GF_DIAG_RUN_TEST
+*/
+
+/** @def GF_DIAG_GET_CONTEXT
+Gets context from GFDiag.
+
+ @param DiagHandle (#GFDiagHandle) Handle to Diag
+ @param pContext (#GFDIAGCONTEXT) Points to a structure that will be filled with the current context
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+*/
+
+/** @def GF_DIAG_PRINTF
+ Format prints a message.
+
+ @param x (bracketed printf string) Message to print
+*/
+
+/*@}*/
+
+/* Run flags */
+
+/** Test is run in same thread */
+#define GF_DIAG_RUN_NORMAL 1
+#define GF_DIAG_RUN_NEW_THREAD 2
+#define GF_DIAG_RUN_NEW_PROCESS 4
+
+
+/** @def GF_DIAG_CRC_STATUS
+ Helper macro to check the status of a call to GF_DIAG_FRAME_DONE
+ and increment a fail count if the status was a failure.
+
+ eg:
+ @code GF_DIAG_CRC_STATUS(GF_DIAG_FRAME_DONE("DxTest"), GF_Diag_CrcFailCount);
+ @endcode
+
+ @param status The status of a call to GF_DIAG_FRAME_DONE
+ @param gf_diag_crcFailCount The var containing the current failure count
+
+ @see GF_DIAG_FRAME_DONE
+*/
+#define GF_DIAG_CRC_STATUS(status, gf_diag_crcFailCount)
+
+#ifdef GF_DIAG_ENABLED
+
+/*
+ * See doxygen comments above for info on the following macros
+ */
+#define GF_DIAG_MAIN(unused1, unused2, testName) \
+ int TestMain(int argc, char *argv[], GFDiagHandle handle)
+
+#define GF_DIAG_INITIALIZE(handle, argc, argv) \
+ ((PGFDIAGTABLE)handle)->DiagInitialize((handle), (argc), (argv))
+
+#define GF_DIAG_GET_VERSION(handle, str, len) \
+ ((PGFDIAGTABLE)handle)->DiagGetVersion((handle), (str), (len))
+
+#define GF_DIAG_SET_IDLE_CHIP_CALLBACK(handle, callbackFn, callbackData) \
+ ((PGFDIAGTABLE)handle)->DiagSetIdleChipCallback(handle, callbackFn, callbackData)
+
+#define GF_DIAG_SET_RENDER_SURFACE(handle, surface) \
+ ((PGFDIAGTABLE)handle)->DiagSetRenderSurface((handle), (surface))
+
+#define GF_DIAG_FRAME_DONE(handle) \
+ ((PGFDIAGTABLE)handle)->DiagFrameDone((handle))
+
+#define GF_DIAG_CLEANUP(handle) \
+ ((PGFDIAGTABLE)handle)->DiagCleanup((handle))
+
+#define GF_DIAG_PRINT(handle, x) \
+ ((PGFDIAGTABLE)handle)->DiagPrint(handle, x)
+
+#define GF_DIAG_RUN_TEST(handle, testName, pCmdLine, flag, pDiagChildHandle) \
+ ((PGFDIAGTABLE)handle)->DiagRunTest(handle, testName, pCmdLine, flag, pDiagChildHandle)
+
+#define GF_DIAG_WAIT_FOR_TEST(handle) \
+ ((PGFDIAGTABLE)handle)->DiagWaitForTest(handle)
+
+#define GF_DIAG_GET_CONTEXT(handle, pContext) \
+ ((PGFDIAGTABLE)handle)->DiagGetContext(handle, pContext)
+
+
+static void
+GFDiagPrintf( GFDiagHandle handle, const char *fmt, ... )
+{
+ char buf[1024];
+ va_list list;
+
+ va_start(list, fmt);
+
+ GFSprintfVAL(buf, fmt, list);
+
+ GF_DIAG_PRINT(handle, buf);
+
+ va_end(list);
+}
+
+#define GF_DIAG_PRINTF(x) GFDiagPrintf x
+
+#else
+
+/*
+ * Do this exactly like nvplat...so this will have an OS specific
+ * implementation in the final GFDiag.h
+ */
+#if NVOS_IS_LINUX || NVOS_IS_WINDOWS
+#define GF_DIAG_MAIN(unused1, unused2, testName) \
+ int TestMain(int argc, char *argv[])
+#define GF_DIAG_MAIN_DEFAULT_1ARG(unused1, unused2, testName, arg1) \
+ int TestMain(int argc, char *argv[])
+#define GF_DIAG_MAIN_DEFAULT_2ARGS(unused1, unused2, testName, arg1, arg2) \
+ int TestMain(int argc, char *argv[])
+#define GF_DIAG_MAIN_DEFAULT_3ARGS(unused1, unused2, testName, arg1, arg2, arg3) \
+ int TestMain(int argc, char *argv[])
+#else
+#define GF_DIAG_MAIN(unused1, unused2, testName) \
+ int argc = 1; \
+ char *argv[] = { #testName }; \
+ int main()
+#define GF_DIAG_MAIN_DEFAULT_1ARG(unused1, unused2, testName, arg1) \
+ int argc = 2; \
+ char *argv[] = { #testName, arg1 }; \
+ int main()
+#define GF_DIAG_MAIN_DEFAULT_2ARGS(unused1, unused2, testName, arg1, arg2) \
+ int argc = 3; \
+ char *argv[] = { #testName, arg1, arg2 }; \
+ int main()
+#define GF_DIAG_MAIN_DEFAULT_3ARGS(unused1, unused2, testName, arg1, arg2, arg3) \
+ int argc = 4; \
+ char *argv[] = { #testName, arg1, arg2, arg3 }; \
+ int main()
+#endif
+
+#define GF_DIAG_INITIALIZE(testName, argc, argv) GF_SUCCESS
+#define GF_DIAG_CLEANUP(testName) GF_SUCCESS
+
+/* These should be removed once all the Apps & MODS are updated */
+#define GF_DIAG_GET_VERSION(testName, str, len) GF_SUCCESS
+#define GF_DIAG_SET_IDLE_CHIP_CALLBACK(testName, callbackFn, callbackData) GF_SUCCESS
+#define GF_DIAG_SET_RENDER_SURFACE(testName, surface) GF_SUCCESS
+#define GF_DIAG_FRAME_DONE(testName) GF_SUCCESS
+#define GF_DIAG_PRINT(handle, x) GF_SUCCESS
+#define GF_DIAG_RUN_TEST(handle, testName, pCmdLine, flag, pDiagChildHandle) GF_SUCCESS
+#define GF_DIAG_WAIT_FOR_TEST(handle) GF_SUCCESS
+#define GF_DIAG_GET_CONTEXT(handle, pContext) GF_SUCCESS
+
+#define GF_DIAG_PRINTF(x) GFPrintf x
+
+#endif /* GF_DIAG_ENABLED */
+
+#ifdef __cplusplus
+}
+#endif
+
+/* NV_MODS */
+#else
+
+/* GFDiag is always enabled in NV_MODS builds */
+#define GF_DIAG_ENABLED 1
+
+#ifndef INCLUDED_GFMODS_H
+#include "../GFMods/src/GFMods.h"
+#endif
+
+#endif /* NV_MODS */
+
+#define CHECK_STATUS_MSG(f,TEXT) \
+ do { \
+ if(ISGFERROR( ( status = (f) ) )) \
+ { \
+ GF_DIAG_PRINTF((TEXT)); \
+ } \
+ } while(0)
+
+
+#define CHECK_STATUS_CLEANUP_MSG(f , TEXT) \
+ do { \
+ if(ISGFERROR( ( status = (f) ) )) \
+ { \
+ GF_DIAG_PRINTF(TEXT); \
+ goto Cleanup; \
+ } \
+ } while(0)
+
+#define CHECK_STATUS_AND_DISPLAY_CLEANUP_MSG(f , TEXT) \
+ do { \
+ if(ISGFERROR( ( status = (f) ) )) \
+ { \
+ GF_DIAG_PRINTF((TEXT,f)); \
+ goto Cleanup; \
+ } \
+ } while(0)
+#endif /* __GFDIAG_H__ */
diff --git a/Start_WM/test6/inc/GFDispCmdData.h b/Start_WM/test6/inc/GFDispCmdData.h
new file mode 100755
index 00000000..5106900b
--- /dev/null
+++ b/Start_WM/test6/inc/GFDispCmdData.h
@@ -0,0 +1,1740 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+#if !defined __GFDISPCMDDATA_H__
+#define __GFDISPCMDDATA_H__
+
+// Display Signal Options 0
+
+#define GF_DEFAULT_TABLE 0x01 // Display Default Table Support
+#define GF_DXAPI_SUPPORT 0x02 // DxAPI Support
+#define GF_FMARK_SUPPORT 0x04 // FMARK Supported by panel
+
+#define GFSDXAPI_PROC0 0x80000000 // PROC0 in Display DxAPI table in Script
+#define GFSDXAPI_PROC1 0x80000001 // PROC1 in Display DxAPI table in Script
+#define GFSDXAPI_PROC2 0x80000002 // PROC2 in Display DxAPI table in Script
+#define GFSDXAPI_PROC3 0x80000003 // PROC3 in Display DxAPI table in Script
+#define GFSDXAPI_PROC4 0x80000004 // PROC4 in Display DxAPI table in Script
+#define GFSDXAPI_PROC5 0x80000005 // PROC5 in Display DxAPI table in Script
+#define GFSDXAPI_PROC6 0x80000006 // PROC6 in Display DxAPI table in Script
+#define GFSDXAPI_PROC7 0x80000007 // PROC7 in Display DxAPI table in Script
+#define GFSDXAPI_PROC8 0x80000008 // PROC8 in Display DxAPI table in Script
+#define GFSDXAPI_PROC9 0x80000009 // PROC9 in Display DxAPI table in Script
+#define GFSDXAPI_PROC10 0x8000000A // PROC10 in Display DxAPI table in Script
+#define GFSDXAPI_PROC11 0x8000000B // PROC11 in Display DxAPI table in Script
+#define GFSDXAPI_PROC12 0x8000000C // PROC12 in Display DxAPI table in Script
+#define GFSDXAPI_PROC13 0x8000000D // PROC13 in Display DxAPI table in Script
+#define GFSDXAPI_PROC14 0x8000000E // PROC14 in Display DxAPI table in Script
+#define GFSDXAPI_PROC15 0x8000000F // PROC14 in Display DxAPI table in Script
+#define GFSDXAPI_PROC16 0x80000010 // PROC16 in Display DxAPI table in Script
+#define GFSDXAPI_PROC17 0x80000011 // PROC17 in Display DxAPI table in Script
+#define GFSDXAPI_PROC18 0x80000012 // PROC18 in Display DxAPI table in Script
+#define GFSDXAPI_PROC19 0x80000013 // PROC19 in Display DxAPI table in Script
+#define GFSDXAPI_PROC20 0x80000014 // PROC20 in Display DxAPI table in Script
+#define GFSDXAPI_PROC21 0x80000015 // PROC21 in Display DxAPI table in Script
+#define GFSDXAPI_PROC22 0x80000016 // PROC22 in Display DxAPI table in Script
+#define GFSDXAPI_PROC23 0x80000017 // PROC23 in Display DxAPI table in Script
+#define GFSDXAPI_PROC24 0x80000018 // PROC24 in Display DxAPI table in Script
+#define GFSDXAPI_PROC25 0x80000019 // PROC25 in Display DxAPI table in Script
+#define GFSDXAPI_PROC26 0x8000001A // PROC26 in Display DxAPI table in Script
+#define GFSDXAPI_PROC27 0x8000001B // PROC27 in Display DxAPI table in Script
+#define GFSDXAPI_PROC28 0x8000001C // PROC28 in Display DxAPI table in Script
+#define GFSDXAPI_PROC29 0x8000001D // PROC29 in Display DxAPI table in Script
+#define GFSDXAPI_PROC30 0x8000001E // PROC30 in Display DxAPI table in Script
+#define GFSDXAPI_PROC31 0x8000001F // PROC31 in Display DxAPI table in Script
+#define GFSDXAPI_PROC_END 0x8000FFFF // PROC End in Display DxAPI table in Script
+
+#define OFFSET_DISP_SIGNAL_OPTIONS0 0x00000101
+
+#define GFSCMD_H_PULSE0 0x00088101
+#define GFSCMD_H_PULSE1 0x000A8101
+#define GFSCMD_H_PULSE2 0x000C8101
+#define GFSCMD_V_PULSE0 0x00108101
+#define GFSCMD_V_PULSE1 0x00128101
+#define GFSCMD_V_PULSE2 0x00138101
+#define GFSCMD_V_PULSE3 0x00148101
+#define GFSCMD_M0 0x00188101
+#define GFSCMD_M1 0x001A8101
+
+#define GF_H_PULSE0_DISABLE 0x00000000
+#define GF_H_PULSE0_ENABLE 0x00000100
+#define GF_H_PULSE1_DISABLE 0x00000000
+#define GF_H_PULSE1_ENABLE 0x00000400
+#define GF_H_PULSE2_DISABLE 0x00000000
+#define GF_H_PULSE2_ENABLE 0x00001000
+#define GF_V_PULSE0_DISABLE 0x00000000
+#define GF_V_PULSE0_ENABLE 0x00010000
+#define GF_V_PULSE1_DISABLE 0x00000000
+#define GF_V_PULSE1_ENABLE 0x00040000
+#define GF_V_PULSE2_DISABLE 0x00000000
+#define GF_V_PULSE2_ENABLE 0x00080000
+#define GF_V_PULSE3_DISABLE 0x00000000
+#define GF_V_PULSE3_ENABLE 0x00100000
+#define GF_M0_DISABLE 0x00000000
+#define GF_M0_ENABLE 0x01000000
+#define GF_M1_DISABLE 0x00000000
+#define GF_M1_ENABLE 0x02000000
+
+
+// Display Signal Options 1
+
+#define OFFSET_DISP_SIGNAL_OPTIONS1 0x00000102
+#define GFSCMD_DI 0x00108102
+#define GFSCMD_PP 0x00128102
+
+#define GF_DI_DISABLE 0x00000000
+#define GF_DI_ENABLE 0x00010000
+#define GF_PP_DISABLE 0x00000000
+#define GF_PP_ENABLE 0x00040000
+
+#define OFFSET_H_PULSE0_CONTROL 0x0000010c
+
+#define GFSCMD_H_PULSE0_MODE 0x0003810c
+#define GFSCMD_H_PULSE0_POLARITY 0x0004810c
+#define GFSCMD_H_PULSE0_V_QUAL 0x0006810c
+#define GFSCMD_H_PULSE0_LAST 0x0008810c
+
+#define GF_H_PULSE0_MODE_NORMAL 0x00000000
+#define GF_H_PULSE0_MODE_ONE_CLOCK 0x00000008
+#define GF_H_PULSE0_POLARITY_HIGH 0x00000000
+#define GF_H_PULSE0_POLARITY_LOW 0x00000010
+#define GF_H_PULSE0_V_QUAL_ALWAYS 0x00000000
+#define GF_H_PULSE0_V_QUAL_VACTIVE 0x00000080
+#define GF_H_PULSE0_V_QUAL_VACTIVE1 0x000000A0
+#define GF_H_PULSE0_LAST_START_A 0x00000000
+#define GF_H_PULSE0_LAST_END_A 0x00000100
+#define GF_H_PULSE0_LAST_START_B 0x00000200
+#define GF_H_PULSE0_LAST_END_B 0x00000300
+#define GF_H_PULSE0_LAST_START_C 0x00000400
+#define GF_H_PULSE0_LAST_END_C 0x00000500
+#define GF_H_PULSE0_LAST_START_D 0x00000600
+#define GF_H_PULSE0_LAST_END_D 0x00000700
+
+#define OFFSET_H_PULSE0_POSITION_A 0x0000010d
+#define GFSCMD_H_PULSE0_POSITION_A 0x0000810d
+
+#define OFFSET_H_PULSE1_CONTROL 0x00000111
+
+#define GFSCMD_H_PULSE1_MODE 0x00038111
+#define GFSCMD_H_PULSE1_POLARITY 0x00048111
+#define GFSCMD_H_PULSE1_V_QUAL 0x00068111
+#define GFSCMD_H_PULSE1_LAST 0x00088111
+
+#define GF_H_PULSE1_MODE_NORMAL 0x00000000
+#define GF_H_PULSE1_MODE_ONE_CLOCK 0x00000008
+#define GF_H_PULSE1_POLARITY_HIGH 0x00000000
+#define GF_H_PULSE1_POLARITY_LOW 0x00000010
+#define GF_H_PULSE1_V_QUAL_ALWAYS 0x00000000
+#define GF_H_PULSE1_V_QUAL_VACTIVE 0x00000080
+#define GF_H_PULSE1_V_QUAL_VACTIVE1 0x000000A0
+#define GF_H_PULSE1_LAST_START_A 0x00000000
+#define GF_H_PULSE1_LAST_END_A 0x00000100
+#define GF_H_PULSE1_LAST_START_B 0x00000200
+#define GF_H_PULSE1_LAST_END_B 0x00000300
+#define GF_H_PULSE1_LAST_START_C 0x00000400
+#define GF_H_PULSE1_LAST_END_C 0x00000500
+#define GF_H_PULSE1_LAST_START_D 0x00000600
+#define GF_H_PULSE1_LAST_END_D 0x00000700
+
+#define OFFSET_H_PULSE1_POSITION_A 0x00000112
+#define GFSCMD_H_PULSE1_POSITION_A 0x00008112
+
+#define OFFSET_H_PULSE2_CONTROL 0x00000116
+#define GFSCMD_H_PULSE2_MODE 0x00038116
+#define GFSCMD_H_PULSE2_POLARITY 0x00048116
+#define GFSCMD_H_PULSE2_V_QUAL 0x00068116
+#define GFSCMD_H_PULSE2_LAST 0x00088116
+
+#define GF_H_PULSE2_MODE_NORMAL 0x00000000
+#define GF_H_PULSE2_MODE_ONE_CLOCK 0x00000008
+#define GF_H_PULSE2_POLARITY_HIGH 0x00000000
+#define GF_H_PULSE2_POLARITY_LOW 0x00000010
+#define GF_H_PULSE2_V_QUAL_ALWAYS 0x00000000
+#define GF_H_PULSE2_V_QUAL_VACTIVE 0x00000080
+#define GF_H_PULSE2_V_QUAL_VACTIVE1 0x000000A0
+#define GF_H_PULSE2_LAST_START_A 0x00000000
+#define GF_H_PULSE2_LAST_END_A 0x00000100
+#define GF_H_PULSE2_LAST_START_B 0x00000200
+#define GF_H_PULSE2_LAST_END_B 0x00000300
+#define GF_H_PULSE2_LAST_START_C 0x00000400
+#define GF_H_PULSE2_LAST_END_C 0x00000500
+#define GF_H_PULSE2_LAST_START_D 0x00000600
+#define GF_H_PULSE2_LAST_END_D 0x00000700
+
+#define OFFSET_H_PULSE2_POSITION_A 0x00000117
+#define GFSCMD_H_PULSE2_POSITION_A 0x00008117
+
+#define GFSCMD_V_PULSE0_POLARITY 0x0004811b
+#define GFSCMD_V_PULSE0_DELAY_CNTRL 0x0006811b
+#define GFSCMD_V_PULSE0_LAST 0x0008811b
+
+#define GF_V_PULSE0_POLARITY_HIGH 0x00000000
+#define GF_V_PULSE0_POLARITY_LOW 0x00000010
+#define GF_V_PULSE0_NODELAY 0x00000000
+#define GF_V_PULSE0_DELAY 0x00000040
+#define GF_V_PULSE0_DELAY1 0x00000080
+#define GF_V_PULSE0_LAST_START_A 0x00000000
+#define GF_V_PULSE0_LAST_END_A 0x00000100
+#define GF_V_PULSE0_LAST_START_B 0x00000200
+#define GF_V_PULSE0_LAST_END_B 0x00000300
+#define GF_V_PULSE0_LAST_START_C 0x00000400
+#define GF_V_PULSE0_LAST_END_C 0x00000500
+
+#define OFFSET_V_PULSE0_POSITION_A 0x0000011c
+#define GFSCMD_V_PULSE0_POSITION_A 0x0000811c
+
+#define GF_V_PULSE0_START_A 0x00000000
+#define GF_V_PULSE0_END_A 0x00010000
+
+#define GFSCMD_V_PULSE1_POLARITY 0x0004811f
+#define GFSCMD_V_PULSE1_DELAY_CNTRL 0x0006811f
+#define GFSCMD_V_PULSE1_LAST 0x0008811f
+
+#define GF_V_PULSE1_POLARITY_HIGH 0x00000000
+#define GF_V_PULSE1_POLARITY_LOW 0x00000010
+#define GF_V_PULSE1_NODELAY 0x00000000
+#define GF_V_PULSE1_DELAY1 0x00000040
+#define GF_V_PULSE1_DELAY2 0x00000080
+#define GF_V_PULSE1_LAST_START_A 0x00000000
+#define GF_V_PULSE1_LAST_END_A 0x00000100
+#define GF_V_PULSE1_LAST_START_B 0x00000200
+#define GF_V_PULSE1_LAST_END_B 0x00000300
+#define GF_V_PULSE1_LAST_START_C 0x00000400
+#define GF_V_PULSE1_LAST_END_C 0x00000500
+
+#define OFFSET_V_PULSE1_POSITION_A 0x00000120
+#define GFSCMD_V_PULSE1_POSITION_A 0x00008120
+
+#define OFFSET_M0_CONTROL 0x00000127
+#define GFSCMD_M0_CLOCK_SELECT 0x00008127
+#define GFSCMD_M0_PHASE_CONTROL 0x00048127
+#define GFSCMD_M0_PHASE_RESET 0x00068127
+#define GFSCMD_M0_POLARITY 0x00078127
+#define GFSCMD_M0_PERIOD 0x00088127
+#define GFSCMD_M0_H_POSITION 0x00108127
+
+#define GF_M0_CLOCK_SELECT_PCLK 0x00000000
+#define GF_M0_CLOCK_SELECT_LCLK 0x00000002
+#define GF_M0_CLOCK_SELECT_FCLK 0x00000003
+#define GF_M0_PHASE_CONTROL_FREE_RUN 0x00000000
+#define GF_M0_PHASE_CONTROL_VACTIVE_RESTART 0x00000020
+#define GF_M0_PHASE_CONTROL_FRAME_INVERT 0x00000030
+#define GF_M0_PHASE_RESET_NOT_RESET 0x00000000
+#define GF_M0_PHASE_RESET_RESET 0x00000040
+#define GF_M0_POLARITY_HIGH 0x00000000
+#define GF_M0_POLARITY_LOW 0x00000080
+#define GF_M0_PERIOD_VAL 0x00000100
+#define GF_M0_H_POSITION_VAL 0x00010000
+
+#define OFFSET_M1_CONTROL 0x00000128
+#define GFSCMD_M1_CLOCK_SELECT 0x00008128
+#define GFSCMD_M1_PHASE_CONTROL 0x00048128
+#define GFSCMD_M1_PHASE_RESET 0x00068128
+#define GFSCMD_M1_POLARITY 0x00078128
+#define GFSCMD_M1_PERIOD 0x00088128
+#define GFSCMD_M1_H_POSITION 0x00108128
+
+#define GF_M1_CLOCK_SELECT_PCLK 0x00000000
+#define GF_M1_CLOCK_SELECT_LCLK 0x00000002
+#define GF_M1_CLOCK_SELECT_FCLK 0x00000003
+#define GF_M1_PHASE_CONTROL_FREE_RUN 0x00000000
+#define GF_M1_PHASE_CONTROL_VACTIVE_RESTART 0x00000020
+#define GF_M1_PHASE_CONTROL_FRAME_INVERT 0x00000030
+#define GF_M1_PHASE_RESET_NOT_RESET 0x00000000
+#define GF_M1_PHASE_RESET_RESET 0x00000040
+#define GF_M1_POLARITY_HIGH 0x00000000
+#define GF_M1_POLARITY_LOW 0x00000080
+#define GF_M1_PERIOD_VAL 0x00000100
+#define GF_M1_H_POSITION_VAL 0x00010000
+
+#define GF_DISP_CLOCK_CONTROL_0 0x0000012f
+
+#define GFSCMD_SHIFT_CLK_DIVIDER 0x0000812f
+#define GFSCMD_PIXEL_CLK_DIVIDER 0x0008812f
+
+//#define GF_SHCLKD_1_256_VAL 0x00000000
+#define GF_PCD1 0x00000000
+#define GF_PCD1H 0x00000100
+#define GF_PCD2 0x00000200
+#define GF_PCD3 0x00000300
+#define GF_PCD4 0x00000400
+#define GF_PCD6 0x00000500
+#define GF_PCD8 0x00000600
+#define GF_PCD9 0x00000700
+#define GF_PCD12 0x00000800
+#define GF_PCD16 0x00000900
+#define GF_PCD13 0x00000a00
+#define GF_PCD18 0x00000b00
+#define GF_PCD24 0x00000c00
+
+#define OFFSET_DISP_INTERFACE_CONTROL 0x00000130
+#define GFSCMD_DISP_DATA_FORMAT 0x00008130
+
+#define GFSCMD_DISP_DATA_ALIGNMENT 0x00088130
+#define GFSCMD_DISP_DATA_ORDER 0x00098130
+
+#define GF_DF1P1C_PRLL 0x00000000
+#define GF_DF1P2C24B_PRLL 0x00000001
+#define GF_DF1P2C18B_PRLL 0x00000002
+#define GF_DF1P2C16B_PRLL 0x00000003
+#define GF_DF1CNL_SRL 0x00000004
+#define GF_DF2CNL_SRL 0x00000005
+#define GF_DF3CNL_SRL 0x00000006
+#define GF_DF_SPI 0x00000007
+#define GF_MSB 0x00000000
+#define GF_LSB 0x00000100
+#define GF_RED_BLUE 0x00000000
+#define GF_BLUE_RED 0x00000200
+
+#define OFFSET_DISP_COLOR_CONTROL 0x00000131
+#define GFSCMD_BASE_COLOR_SIZE 0x00008131
+#define GFSCMD_DITHER_CONTROL 0x00088131
+#define GFSCMD_ORD_DITHER_ROTATION 0x000C8131
+#define GFSCMD_DISP_COLOR_SWAP 0x00108131
+#define GFSCMD_BLANK_COLOR 0x00118131
+#define GFSCMD_NON_BASE_COLOR 0x00128131
+#define GFSCMD_LCD_MD0 0x00188131
+
+#define GF_BASE666 0x00000000
+#define GF_BASE111 0x00000001
+#define GF_BASE222 0x00000002
+#define GF_BASE333 0x00000003
+#define GF_BASE444 0x00000004
+#define GF_BASE555 0x00000005
+#define GF_BASE565 0x00000006
+#define GF_BASE332 0x00000007
+#define GF_BASE888 0x00000008
+#define GF_DISABLE 0x00000000
+#define GF_ORDERED 0x00000200
+#define GF_ERRDIFF 0x00000300
+#define GF_ORD_DITHER_ROTATION_VAL 0x00000000
+#define GF_SWAP_RGB 0x00000000
+#define GF_SWAP_BGR 0x00010000
+#define GF_BLANK_ZERO 0x00000000
+#define GF_BLANK_ONES 0x00020000
+#define GF_NON_BASE_ZERO 0x00000000
+#define GF_NON_BASE_ONES 0x00040000
+#define GF_LCD_MD0_LOW 0x00000000
+#define GF_LCD_MD0_HIGH 0x01000000
+
+
+#define OFFSET_SHIFT_CLOCK_OPTIONS 0x00000132
+
+#define GFSCMD_SC0_H_QUALIFIER 0x00008132
+#define GFSCMD_SC0_V_QUALIFIER 0x00038132
+#define GFSCMD_SC0_CLK_DIVIDER 0x00068132
+#define GFSCMD_SC1_H_QUALIFIER 0x00108132
+#define GFSCMD_SC1_V_QUALIFIER 0x00138132
+#define GFSCMD_SC1_CLK_DIVIDER 0x00158132
+
+#define GF_SC0_H_DISABLE 0x00000000
+#define GF_SC0_H_NO_HQUAL 0x00000001
+#define GF_SC0_H_HACTIVE 0x00000002
+#define GF_SC0_H_EXT_HACTIVE 0x00000003
+#define GF_SC0_H_HPULSE0 0x00000004
+#define GF_SC0_H_EXT_HPULSE0 0x00000005
+#define GF_SC0_V_NO_VQUAL 0x00000000
+#define GF_SC0_V_RESERVED 0x00000008
+#define GF_SC0_V_VACTIVE 0x00000010
+#define GF_SC0_V_EXT_VACTIVE 0x00000018
+#define GF_SC0_V_VPULSE0 0x00000020
+#define GF_SC0_V_EXT_VPULSE0 0x00000028
+#define GF_SC0_DIV1 0x00000000
+#define GF_SC0_DIV2 0x00000040
+#define GF_SC0_DIV4 0x00000080
+
+#define GF_SC1_H_DISABLE 0x00000000
+#define GF_SC1_H_NO_HQUAL 0x00010000
+#define GF_SC1_H_HACTIVE 0x00020000
+#define GF_SC1_H_EXT_HACTIVE 0x00030000
+#define GF_SC1_H_HPULSE1 0x00040000
+#define GF_SC1_H_EXT_HPULSE1 0x00050000
+#define GF_SC1_V_NO_VQUAL 0x00000000
+#define GF_SC1_V_RESERVED 0x00080000
+#define GF_SC1_V_VACTIVE 0x00100000
+#define GF_SC1_V_EXT_VACTIVE 0x00180000
+#define GF_SC1_V_VPULSE1 0x00200000
+#define GF_SC1_V_EXT_VPULSE1 0x00280000
+#define GF_SC1_DIV1 0x00000000
+#define GF_SC1_DIV2 0x00400000
+#define GF_SC1_DIV4 0x00800000
+
+#define OFFSET_DATA_ENABLE_OPTIONS 0x00000133
+
+#define GFSCMD_DE_SELECT_ACTIVE 0x00008133
+#define GFSCMD_DE_CONTROL 0x00038133
+
+#define GF_DE_ACTIVE_ALL_LINES 0x00000000
+#define GF_DE_ACTIVE_NOBLANK 0x00000001
+#define GF_DE_ONECLK 0x00000000
+#define GF_DE_NORMAL 0x00000004
+#define GF_DE_ONE_CLK_PRECD_ACTIVE 0x00000008
+#define GF_DE_ONE_PIXEL_CLK_EARLY 0x0000000C
+
+
+#define OFFSET_SERIAL_INTERFACE_OPTIONS 0x00000134
+#define GFSCMD_SDT_STP_MODE 0x00008134
+#define GFSCMD_SDT_STP_DURATION 0x00028134
+#define GFSCMD_STH_DURATION 0x00068134
+#define GFSCMD_STP_CONTRO 0x00078134
+
+#define GF_SDT_STP_DISABLE 0x00000000
+#define GF_SDT_STP_RESERVED 0x00000001
+#define GF_SDT_STP_ENABLE_DUP 0x00000002
+#define GF_SDT_STP_ENABLE 0x00000003
+#define GF_SDT_STP_DURATION_VAL 0x00000000
+#define GF_ONE_CLOCK 0x00000000
+#define GF_TWO_CLOCK 0x00000040
+#define GF_STP_NORMAL 0x00000000
+#define GF_STP_EXTENDED 0x00000080
+
+
+#define OFFSET_LCD_LSPI_OPTIONS 0x00000135
+#define GFSCMD_LCD_SPI_CS_MAIN 0x00008135
+#define GFSCMD_LCD_SPI_DC 0x00018135
+#define GFSCMD_SPI_CS_CONTROL_LCD_IS_SPI 0x00028135
+#define GFSCMD_LCD_SPI_DIRECTION_LSB2MSB 0x00048135
+
+#define GF_CS_MAIN 0x00000000
+#define GF_CS_SUB 0x00000001
+#define GF_LDC_LOW 0x00000000
+#define GF_LDC_HIGH 0x00000002
+#define GF_LCD_IS_SPI 0x00000000
+#define GF_LCD_SPI 0x00000004
+#define GF_IS_SPI 0x00000008
+#define GF_FORCED 0x0000000C
+#define GF_MSB2LSB 0x00000000
+#define GF_LSB2MSB 0x00000010
+
+
+#define OFFSET_SIGNAL_RAISE 0x00000005
+#define GFSCMD_SIGNAL_RAISE_VECTOR 0x00008005
+#define GFSCMD_SIGNAL_RAISE_SELECT 0x00088005
+#define GFSCMD_SIGNAL_RAISE_CHANNEL_ID 0x00108005
+
+#define GF_RAISE_VECTOR_VAL 0x00000000
+#define GF_RAISE_NONE 0x00000000
+#define GF_RAISE_FRAME_END 0x00000100
+#define GF_RAISE_VBLANK 0x00000200
+#define GF_RAISE_VPULSE3 0x00000300
+#define GF_RAISE_CHANNEL_ID_VAL 0x00000000
+
+
+#define OFFSET_SIGNAL_REFCOUNT 0x00000006
+#define GFSCMD_SIGNAL_REFCOUNT_VECTOR 0x00008006
+#define GFSCMD_SIGNAL_REFCOUNT_SELECT 0x00108006
+
+#define GF_REFCOUNT_VECTOR_VAL 0x00000000
+#define GF_REFCOUNT_NONE 0x00000000
+#define GF_REFCOUNT_FRAME_END 0x00010000
+
+
+
+// Display Power Control
+
+#define OFFSET_DISPLAY_POWER_CONTROL 0x00000009
+#define GFSCMD_PW0_CONTROL 0x00008009
+#define GFSCMD_PW1_CONTROL 0x00028009
+#define GFSCMD_PW2_CONTROL 0x00048009
+#define GFSCMD_PW3_CONTROL 0x00068009
+#define GFSCMD_PW4_CONTROL 0x00088009
+#define GFSCMD_PM0_CONTROL 0x00108009
+#define GFSCMD_PM1_CONTROL 0x00128009
+#define GFSCMD_SPI_CONTROL 0x00188009
+#define GFSCMD_HSPI_CONTROL 0x00198009
+
+#define GF_PW0_DISABLE 0x00000000
+#define GF_PW0_ENABLE 0x00000001
+#define GF_PW1_DISABLE 0x00000000
+#define GF_PW1_ENABLE 0x00000004
+#define GF_PW2_DISABLE 0x00000000
+#define GF_PW2_ENABLE 0x00000010
+#define GF_PW3_DISABLE 0x00000000
+#define GF_PW3_ENABLE 0x00000040
+#define GF_PW4_DISABLE 0x00000000
+#define GF_PW4_ENABLE 0x00010000
+#define GF_PM0_DISABLE 0x00000000
+#define GF_PM0_ENABLE 0x00040000
+#define GF_PM1_DISABLE 0x00000000
+#define GF_PM1_ENABLE 0x00400000
+#define GF_SPI_DISABLE 0x00000000
+#define GF_SPI_ENABLE 0x01000000
+#define GF_HSPI_DISABLE 0x00000000
+#define GF_HSPI_ENABLE 0x02000000
+
+// Pin Output Enable registers
+
+#define OFFSET_PIN_OUTPUT_ENABLE0 0x00000802
+#define GFSCMD_LD0_PIN_OUTPUT 0x00008802
+#define GFSCMD_LD1_PIN_OUTPUT 0x00028802
+#define GFSCMD_LD2_PIN_OUTPUT 0x00048802
+#define GFSCMD_LD3_PIN_OUTPUT 0x00068802
+#define GFSCMD_LD4_PIN_OUTPUT 0x00088802
+#define GFSCMD_LD5_PIN_OUTPUT 0x000a8802
+#define GFSCMD_LD6_PIN_OUTPUT 0x000c8802
+#define GFSCMD_LD7_PIN_OUTPUT 0x000e8802
+#define GFSCMD_LD8_PIN_OUTPUT 0x00108802
+#define GFSCMD_LD9_PIN_OUTPUT 0x00128802
+#define GFSCMD_LD10_PIN_OUTPUT 0x00148802
+#define GFSCMD_LD11_PIN_OUTPUT 0x00168802
+#define GFSCMD_LD12_PIN_OUTPUT 0x00188802
+#define GFSCMD_LD13_PIN_OUTPUT 0x001a8802
+#define GFSCMD_LD14_PIN_OUTPUT 0x001c8802
+#define GFSCMD_LD15_PIN_OUTPUT 0x001e8802
+#define GFSCMD_LD0_LD15_PIN_OUTPUT 0x00208802
+
+
+#define GF_LD0_OUTPUT_ENABLE 0x00000000
+#define GF_LD0_OUTPUT_DISABLE 0x00000001
+#define GF_LD1_OUTPUT_ENABLE 0x00000000
+#define GF_LD1_OUTPUT_DISABLE 0x00000004
+#define GF_LD2_OUTPUT_ENABLE 0x00000000
+#define GF_LD2_OUTPUT_DISABLE 0x00000010
+#define GF_LD3_OUTPUT_ENABLE 0x00000000
+#define GF_LD3_OUTPUT_DISABLE 0x00000040
+#define GF_LD4_OUTPUT_ENABLE 0x00000000
+#define GF_LD4_OUTPUT_DISABLE 0x00000100
+#define GF_LD5_OUTPUT_ENABLE 0x00000000
+#define GF_LD5_OUTPUT_DISABLE 0x00000400
+#define GF_LD6_OUTPUT_ENABLE 0x00000000
+#define GF_LD6_OUTPUT_DISABLE 0x00001000
+#define GF_LD7_OUTPUT_ENABLE 0x00000000
+#define GF_LD7_OUTPUT_DISABLE 0x00004000
+#define GF_LD8_OUTPUT_ENABLE 0x00000000
+#define GF_LD8_OUTPUT_DISABLE 0x00010000
+#define GF_LD9_OUTPUT_ENABLE 0x00000000
+#define GF_LD9_OUTPUT_DISABLE 0x00040000
+#define GF_LD10_OUTPUT_ENABLE 0x00000000
+#define GF_LD10_OUTPUT_DISABLE 0x00100000
+#define GF_LD11_OUTPUT_ENABLE 0x00000000
+#define GF_LD11_OUTPUT_DISABLE 0x00400000
+#define GF_LD12_OUTPUT_ENABLE 0x00000000
+#define GF_LD12_OUTPUT_DISABLE 0x01000000
+#define GF_LD13_OUTPUT_ENABLE 0x00000000
+#define GF_LD13_OUTPUT_DISABLE 0x04000000
+#define GF_LD14_OUTPUT_ENABLE 0x00000000
+#define GF_LD14_OUTPUT_DISABLE 0x10000000
+#define GF_LD15_OUTPUT_ENABLE 0x00000000
+#define GF_LD15_OUTPUT_DISABLE 0x40000000
+#define GF_LD0_LD15_OUTPUT_ENABLE 0x00000000
+#define GF_LD0_LD15_OUTPUT_DISABLE 0x55555555
+
+
+#define OFFSET_PIN_OUTPUT_ENABLE1 0x00000803
+#define GFSCMD_LD16_PIN_OUTPUT 0x00008803
+#define GFSCMD_LD17_PIN_OUTPUT 0x00028803
+#define GFSCMD_LPW0_PIN_OUTPUT 0x00108803
+#define GFSCMD_LPW1_PIN_OUTPUT 0x00128803
+#define GFSCMD_LPW2_PIN_OUTPUT 0x00148803
+#define GFSCMD_LSC0_PIN_OUTPUT 0x00188803
+#define GFSCMD_LSC1_PIN_OUTPUT 0x001a8803
+#define GFSCMD_LVS_PIN_OUTPUT 0x001c8803
+#define GFSCMD_LHS_PIN_OUTPUT 0x001e8803
+#define GFSCMD_LD16_LD17_PIN_OUTPUT 0x00208803
+
+#define GF_LD16_OUTPUT_ENABLE 0x00000000
+#define GF_LD16_OUTPUT_DISABLE 0x00000001
+#define GF_LD17_OUTPUT_ENABLE 0x00000000
+#define GF_LD17_OUTPUT_DISABLE 0x00000004
+#define GF_LPW0_OUTPUT_ENABLE 0x00000000
+#define GF_LPW0_OUTPUT_DISABLE 0x00010000
+#define GF_LPW1_OUTPUT_ENABLE 0x00000000
+#define GF_LPW1_OUTPUT_DISABLE 0x00040000
+#define GF_LPW2_OUTPUT_ENABLE 0x00000000
+#define GF_LPW2_OUTPUT_DISABLE 0x00100000
+#define GF_LSC0_OUTPUT_ENABLE 0x00000000
+#define GF_LSC0_OUTPUT_DISABLE 0x01000000
+#define GF_LSC1_OUTPUT_ENABLE 0x00000000
+#define GF_LSC1_OUTPUT_DISABLE 0x04000000
+#define GF_LVS_OUTPUT_ENABLE 0x00000000
+#define GF_LVS_OUTPUT_DISABLE 0x10000000
+#define GF_LHS_OUTPUT_ENABLE 0x00000000
+#define GF_LHS_OUTPUT_DISABLE 0x40000000
+#define GF_LD16_LD17_OUTPUT_ENABLE 0x00000000
+#define GF_LD16_LD17_OUTPUT_DISABLE 0x00000005
+
+
+#define DC_PIN_OUTPUT_ENABLE2 0x00000804
+#define GFSCMD_LHP0_PIN_OUTPUT 0x00008804
+#define GFSCMD_LHP1_PIN_OUTPUT 0x00028804
+#define GFSCMD_LHP2_PIN_OUTPUT 0x00048804
+#define GFSCMD_LVP0_PIN_OUTPUT 0x00088804
+#define GFSCMD_LVP1_PIN_OUTPUT 0x000A8804
+#define GFSCMD_LM0_PIN_OUTPUT 0x00108804
+#define GFSCMD_LM1_PIN_OUTPUT 0x00128804
+#define GFSCMD_LDI_PIN_OUTPUT 0x00148804
+#define GFSCMD_LPP_PIN_OUTPUT 0x00168804
+
+#define GF_LHP0_OUTPUT_ENABLE 0x00000000
+#define GF_LHP0_OUTPUT_DISABLE 0x00000001
+#define GF_LHP1_OUTPUT_ENABLE 0x00000000
+#define GF_LHP1_OUTPUT_DISABLE 0x00000004
+#define GF_LHP2_OUTPUT_ENABLE 0x00000000
+#define GF_LHP2_OUTPUT_DISABLE 0x00000010
+#define GF_LVP0_OUTPUT_ENABLE 0x00000000
+#define GF_LVP0_OUTPUT_DISABLE 0x00000100
+#define GF_LVP1_OUTPUT_ENABLE 0x00000000
+#define GF_LVP1_OUTPUT_DISABLE 0x00000404
+#define GF_LM0_OUTPUT_ENABLE 0x00000000
+#define GF_LM0_OUTPUT_DISABLE 0x00010000
+#define GF_LM1_OUTPUT_ENABLE 0x00000000
+#define GF_LM1_OUTPUT_DISABLE 0x00040000
+#define GF_LDI_OUTPUT_ENABLE 0x00000000
+#define GF_LDI_OUTPUT_DISABLE 0x00100000
+#define GF_LPP_OUTPUT_ENABLE 0x00000000
+#define GF_LPP_OUTPUT_DISABLE 0x00400000
+
+#define OFFSET_OUTPUT_ENABLE3 0x00000805
+#define GFSCMD_LSCK_PIN_OUTPUT 0x00008805
+#define GFSCMD_LSDA_PIN_OUTPUT 0x00028805
+#define GFSCMD_LCSN_PIN_OUTPUT 0x00048805
+#define GFSCMD_LDC_PIN_OUTPUT 0x00068805
+#define GFSCMD_LSPI_PIN_OUTPUT 0x00088805
+
+#define GF_LSCK_OUTPUT_ENABLE 0x00000000
+#define GF_LSCK_OUTPUT_DISABLE 0x00000001
+#define GF_LSDA_OUTPUT_ENABLE 0x00000000
+#define GF_LSDA_OUTPUT_DISABLE 0x00000004
+#define GF_LCSN_OUTPUT_ENABLE 0x00000000
+#define GF_LCSN_OUTPUT_DISABLE 0x00000010
+#define GF_LDC_OUTPUT_ENABLE 0x00000000
+#define GF_LDC_OUTPUT_DISABLE 0x00000040
+#define GF_LSPI_OUTPUT_ENABLE 0x00000000
+#define GF_LSPI_OUTPUT_DISABLE 0x00000100
+
+
+// Pin Output Polarity registers
+
+#define OFFSET_PIN_OUTPUT_POLARITY0 0x00000806
+#define GFSCMD_LD0_PIN_POLARITY 0x00008806
+#define GFSCMD_LD1_PIN_POLARITY 0x00028806
+#define GFSCMD_LD2_PIN_POLARITY 0x00048806
+#define GFSCMD_LD3_PIN_POLARITY 0x00068806
+#define GFSCMD_LD4_PIN_POLARITY 0x00088806
+#define GFSCMD_LD5_PIN_POLARITY 0x000a8806
+#define GFSCMD_LD6_PIN_POLARITY 0x000c8806
+#define GFSCMD_LD7_PIN_POLARITY 0x000e8806
+#define GFSCMD_LD8_PIN_POLARITY 0x00108806
+#define GFSCMD_LD9_PIN_POLARITY 0x00128806
+#define GFSCMD_LD10_PIN_POLARITY 0x00148806
+#define GFSCMD_LD11_PIN_POLARITY 0x00168806
+#define GFSCMD_LD12_PIN_POLARITY 0x00188806
+#define GFSCMD_LD13_PIN_POLARITY 0x001a8806
+#define GFSCMD_LD14_PIN_POLARITY 0x001c8806
+#define GFSCMD_LD15_PIN_POLARITY 0x001e8806
+#define GFSCMD_LD0_LD15_PIN_POLARITY 0x00208806
+
+
+#define GF_LD0_POLARITY_HIGH 0x00000000
+#define GF_LD0_POLARITY_LOW 0x00000001
+#define GF_LD1_POLARITY_HIGH 0x00000000
+#define GF_LD1_POLARITY_LOW 0x00000004
+#define GF_LD2_POLARITY_HIGH 0x00000000
+#define GF_LD2_POLARITY_LOW 0x00000010
+#define GF_LD3_POLARITY_HIGH 0x00000000
+#define GF_LD3_POLARITY_LOW 0x00000040
+#define GF_LD4_POLARITY_HIGH 0x00000000
+#define GF_LD4_POLARITY_LOW 0x00000100
+#define GF_LD5_POLARITY_HIGH 0x00000000
+#define GF_LD5_POLARITY_LOW 0x00000400
+#define GF_LD6_POLARITY_HIGH 0x00000000
+#define GF_LD6_POLARITY_LOW 0x00001000
+#define GF_LD7_POLARITY_HIGH 0x00000000
+#define GF_LD7_POLARITY_LOW 0x00004000
+#define GF_LD8_POLARITY_HIGH 0x00000000
+#define GF_LD8_POLARITY_LOW 0x00010000
+#define GF_LD9_POLARITY_HIGH 0x00000000
+#define GF_LD9_POLARITY_LOW 0x00040000
+#define GF_LD10_POLARITY_HIGH 0x00000000
+#define GF_LD10_POLARITY_LOW 0x00100000
+#define GF_LD11_POLARITY_HIGH 0x00000000
+#define GF_LD11_POLARITY_LOW 0x00400000
+#define GF_LD12_POLARITY_HIGH 0x00000000
+#define GF_LD12_POLARITY_LOW 0x01000000
+#define GF_LD13_POLARITY_HIGH 0x00000000
+#define GF_LD13_POLARITY_LOW 0x04000000
+#define GF_LD14_POLARITY_HIGH 0x00000000
+#define GF_LD14_POLARITY_LOW 0x10000000
+#define GF_LD15_POLARITY_HIGH 0x00000000
+#define GF_LD15_POLARITY_LOW 0x40000000
+#define GF_LD0_LD15_POLARITY_HIGH 0x00000000
+#define GF_LD0_LD15_POLARITY_LOW 0x55555555
+
+#define OFFSET_PIN_OUTPUT_POLARITY1 0x00000807
+#define GFSCMD_LD16_PIN_POLARITY 0x00008807
+#define GFSCMD_LD17_PIN_POLARITY 0x00028807
+#define GFSCMD_LPW0_PIN_POLARITY 0x00108807
+#define GFSCMD_LPW1_PIN_POLARITY 0x00128807
+#define GFSCMD_LPW2_PIN_POLARITY 0x00148807
+#define GFSCMD_LSC0_PIN_POLARITY 0x00188807
+#define GFSCMD_LSC1_PIN_POLARITY 0x001a8807
+#define GFSCMD_LVS_PIN_POLARITY 0x001c8807
+#define GFSCMD_LHS_PIN_POLARITY 0x001e8807
+#define GFSCMD_LD16_LD17_PIN_POLARITY 0x00208807
+
+#define GF_LD16_POLARITY_HIGH 0x00000000
+#define GF_LD16_POLARITY_LOW 0x00000001
+#define GF_LD17_POLARITY_HIGH 0x00000000
+#define GF_LD17_POLARITY_LOW 0x00000004
+#define GF_LPW0_POLARITY_HIGH 0x00000000
+#define GF_LPW0_POLARITY_LOW 0x00010000
+#define GF_LPW1_POLARITY_HIGH 0x00000000
+#define GF_LPW1_POLARITY_LOW 0x00040000
+#define GF_LPW2_POLARITY_HIGH 0x00000000
+#define GF_LPW2_POLARITY_LOW 0x00100000
+#define GF_LSC0_POLARITY_HIGH 0x00000000
+#define GF_LSC0_POLARITY_LOW 0x01000000
+#define GF_LSC1_POLARITY_HIGH 0x00000000
+#define GF_LSC1_POLARITY_LOW 0x04000000
+#define GF_LVS_POLARITY_HIGH 0x00000000
+#define GF_LVS_POLARITY_LOW 0x10000000
+#define GF_LHS_POLARITY_HIGH 0x00000000
+#define GF_LHS_POLARITY_LOW 0x40000000
+#define GF_LD16_LD17_POLARITY_HIGH 0x00000000
+#define GF_LD16_LD17_POLARITY_LOW 0x00000005
+
+#define DC_PIN_OUTPUT_POLARITY2 0x00000808
+#define GFSCMD_LHP0_PIN_POLARITY 0x00008808
+#define GFSCMD_LHP1_PIN_POLARITY 0x00028808
+#define GFSCMD_LHP2_PIN_POLARITY 0x00048808
+#define GFSCMD_LVP0_PIN_POLARITY 0x00088808
+#define GFSCMD_LVP1_PIN_POLARITY 0x000A8808
+#define GFSCMD_LM0_PIN_POLARITY 0x00108808
+#define GFSCMD_LM1_PIN_POLARITY 0x00128808
+#define GFSCMD_LDI_PIN_POLARITY 0x00148808
+#define GFSCMD_LPP_PIN_POLARITY 0x00168808
+
+#define GF_LHP0_POLARITY_HIGH 0x00000000
+#define GF_LHP0_POLARITY_LOW 0x00000001
+#define GF_LHP1_POLARITY_HIGH 0x00000000
+#define GF_LHP1_POLARITY_LOW 0x00000004
+#define GF_LHP2_POLARITY_HIGH 0x00000000
+#define GF_LHP2_POLARITY_LOW 0x00000010
+#define GF_LVP0_POLARITY_HIGH 0x00000000
+#define GF_LVP0_POLARITY_LOW 0x00000100
+#define GF_LVP1_POLARITY_HIGH 0x00000000
+#define GF_LVP1_POLARITY_LOW 0x00000404
+#define GF_LM0_POLARITY_HIGH 0x00000000
+#define GF_LM0_POLARITY_LOW 0x00010000
+#define GF_LM1_POLARITY_HIGH 0x00000000
+#define GF_LM1_POLARITY_LOW 0x00040000
+#define GF_LDI_POLARITY_HIGH 0x00000000
+#define GF_LDI_POLARITY_LOW 0x00100000
+#define GF_LPP_POLARITY_HIGH 0x00000000
+#define GF_LPP_POLARITY_LOW 0x00400000
+
+#define OFFSET_OUTPUT_POLARITY3 0x00000809
+#define GFSCMD_LSCK_PIN_POLARITY 0x00008809
+#define GFSCMD_LSDA_PIN_POLARITY 0x00028809
+#define GFSCMD_LCSN_PIN_POLARITY 0x00048809
+#define GFSCMD_LDC_PIN_POLARITY 0x00068809
+#define GFSCMD_LSPI_PIN_POLARITY 0x00088809
+
+#define GF_LSCK_POLARITY_HIGH 0x00000000
+#define GF_LSCK_POLARITY_LOW 0x00000001
+#define GF_LSDA_POLARITY_HIGH 0x00000000
+#define GF_LSDA_POLARITY_LOW 0x00000004
+#define GF_LCSN_POLARITY_HIGH 0x00000000
+#define GF_LCSN_POLARITY_LOW 0x00000010
+#define GF_LDC_POLARITY_HIGH 0x00000000
+#define GF_LDC_POLARITY_LOW 0x00000040
+#define GF_LSPI_POLARITY_HIGH 0x00000000
+#define GF_LSPI_POLARITY_LOW 0x00000100
+
+// Pin Output data registers
+
+#define OFFSET_PIN_OUTPUT_DATA0 0x0000080a
+#define GFSCMD_LD0_PIN_OUTPUT_DATA 0x0000880a
+#define GFSCMD_LD1_PIN_OUTPUT_DATA 0x0002880a
+#define GFSCMD_LD2_PIN_OUTPUT_DATA 0x0004880a
+#define GFSCMD_LD3_PIN_OUTPUT_DATA 0x0006880a
+#define GFSCMD_LD4_PIN_OUTPUT_DATA 0x0008880a
+#define GFSCMD_LD5_PIN_OUTPUT_DATA 0x000a880a
+#define GFSCMD_LD6_PIN_OUTPUT_DATA 0x000c880a
+#define GFSCMD_LD7_PIN_OUTPUT_DATA 0x000e880a
+#define GFSCMD_LD8_PIN_OUTPUT_DATA 0x0010880a
+#define GFSCMD_LD9_PIN_OUTPUT_DATA 0x0012880a
+#define GFSCMD_LD10_PIN_OUTPUT_DATA 0x0014880a
+#define GFSCMD_LD11_PIN_OUTPUT_DATA 0x0016880a
+#define GFSCMD_LD12_PIN_OUTPUT_DATA 0x0018880a
+#define GFSCMD_LD13_PIN_OUTPUT_DATA 0x001a880a
+#define GFSCMD_LD14_PIN_OUTPUT_DATA 0x001c880a
+#define GFSCMD_LD15_PIN_OUTPUT_DATA 0x001e880a
+#define GFSCMD_LD0_LD15_PIN_OUTPUT_DATA 0x0020880a
+
+
+#define GF_LD0_DATA_LOW 0x00000002
+#define GF_LD0_DATA_HIGH 0x00000003
+#define GF_LD1_DATA_LOW 0x00000008
+#define GF_LD1_DATA_HIGH 0x0000000c
+#define GF_LD2_DATA_LOW 0x00000020
+#define GF_LD2_DATA_HIGH 0x00000030
+#define GF_LD3_DATA_LOW 0x00000080
+#define GF_LD3_DATA_HIGH 0x000000c0
+#define GF_LD4_DATA_LOW 0x00000200
+#define GF_LD4_DATA_HIGH 0x00000300
+#define GF_LD5_DATA_LOW 0x00000800
+#define GF_LD5_DATA_HIGH 0x00000c00
+#define GF_LD6_DATA_LOW 0x00002000
+#define GF_LD6_DATA_HIGH 0x00003000
+#define GF_LD7_DATA_LOW 0x00008000
+#define GF_LD7_DATA_HIGH 0x0000c000
+#define GF_LD8_DATA_LOW 0x00020000
+#define GF_LD8_DATA_HIGH 0x00030000
+#define GF_LD9_DATA_LOW 0x00080000
+#define GF_LD9_DATA_HIGH 0x000c0000
+#define GF_LD10_DATA_LOW 0x00200000
+#define GF_LD10_DATA_HIGH 0x00300000
+#define GF_LD11_DATA_LOW 0x00800000
+#define GF_LD11_DATA_HIGH 0x00c00000
+#define GF_LD12_DATA_LOW 0x02000000
+#define GF_LD12_DATA_HIGH 0x03000000
+#define GF_LD13_DATA_LOW 0x08000000
+#define GF_LD13_DATA_HIGH 0x0c000000
+#define GF_LD14_DATA_LOW 0x20000000
+#define GF_LD14_DATA_HIGH 0x30000000
+#define GF_LD15_DATA_LOW 0x80000000
+#define GF_LD15_DATA_HIGH 0xc0000000
+#define GF_LD0_LD15_DATA_LOW 0xaaaaaaaa
+#define GF_LD0_LD15_DATA_HIGH 0xffffffff
+
+#define OFFSET_PIN_OUTPUT_DATA1 0x0000080b
+#define GFSCMD_LD16_PIN_OUTPUT_DATA 0x0000880b
+#define GFSCMD_LD17_PIN_OUTPUT_DATA 0x0002880b
+#define GFSCMD_LPW0_PIN_OUTPUT_DATA 0x0010880b
+#define GFSCMD_LPW1_PIN_OUTPUT_DATA 0x0012880b
+#define GFSCMD_LPW2_PIN_OUTPUT_DATA 0x0014880b
+#define GFSCMD_LSC0_PIN_OUTPUT_DATA 0x0018880b
+#define GFSCMD_LSC1_PIN_OUTPUT_DATA 0x001a880b
+#define GFSCMD_LVS_PIN_OUTPUT_DATA 0x001c880b
+#define GFSCMD_LHS_PIN_OUTPUT_DATA 0x001e880b
+#define GFSCMD_LD16_LD17_PIN_OUTPUT_DATA 0x0020880b
+
+#define GF_LD16_DATA_LOW 0x00000002
+#define GF_LD16_DATA_HIGH 0x00000003
+#define GF_LD17_DATA_LOW 0x00000008
+#define GF_LD17_DATA_HIGH 0x0000000c
+#define GF_LPW0_DATA_LOW 0x00020000
+#define GF_LPW0_DATA_HIGH 0x00030000
+#define GF_LPW1_DATA_LOW 0x00080000
+#define GF_LPW1_DATA_HIGH 0x000c0000
+#define GF_LPW2_DATA_LOW 0x00200000
+#define GF_LPW2_DATA_HIGH 0x00300000
+#define GF_LSC0_DATA_LOW 0x02000000
+#define GF_LSC0_DATA_HIGH 0x03000000
+#define GF_LSC1_DATA_LOW 0x08000000
+#define GF_LSC1_DATA_HIGH 0x0c000000
+#define GF_LVS_DATA_LOW 0x20000000
+#define GF_LVS_DATA_HIGH 0x30000000
+#define GF_LHS_DATA_LOW 0x80000000
+#define GF_LHS_DATA_HIGH 0xc0000000
+#define GF_LD16_LD17_DATA_LOW 0x0000000a
+#define GF_LD16_LD17_DATA_HIGH 0x0000000f
+
+
+#define OFFSET_PIN_OUTPUT_DATA2 0x0000080c
+#define GFSCMD_LHP0_PIN_OUTPUT_DATA 0x0000880c
+#define GFSCMD_LHP1_PIN_OUTPUT_DATA 0x0002880c
+#define GFSCMD_LHP2_PIN_OUTPUT_DATA 0x0004880c
+#define GFSCMD_LVP0_PIN_OUTPUT_DATA 0x0008880c
+#define GFSCMD_LVP1_PIN_OUTPUT_DATA 0x000A880c
+#define GFSCMD_LM0_PIN_OUTPUT_DATA 0x0010880c
+#define GFSCMD_LM1_PIN_OUTPUT_DATA 0x0012880c
+#define GFSCMD_LDI_PIN_OUTPUT_DATA 0x0014880c
+#define GFSCMD_LPP_PIN_OUTPUT_DATA 0x0016880c
+
+#define GF_LHP0_DATA_LOW 0x00000002
+#define GF_LHP0_DATA_HIGH 0x00000003
+#define GF_LHP1_DATA_LOW 0x00000008
+#define GF_LHP1_DATA_HIGH 0x0000000c
+#define GF_LHP2_DATA_LOW 0x00000020
+#define GF_LHP2_DATA_HIGH 0x00000030
+#define GF_LVP0_DATA_LOW 0x00000200
+#define GF_LVP0_DATA_HIGH 0x00000300
+#define GF_LVP1_DATA_LOW 0x00000800
+#define GF_LVP1_DATA_HIGH 0x00000c00
+#define GF_LM0_DATA_LOW 0x00020000
+#define GF_LM0_DATA_HIGH 0x00030000
+#define GF_LM1_DATA_LOW 0x00080000
+#define GF_LM1_DATA_HIGH 0x000c0000
+#define GF_LDI_DATA_LOW 0x00200000
+#define GF_LDI_DATA_HIGH 0x00300000
+#define GF_LPP_DATA_LOW 0x00800000
+#define GF_LPP_DATA_HIGH 0x00c00000
+
+#define OFFSET_OUTPUT_DATA3 0x0000080d
+#define GFSCMD_LSCK_PIN_OUTPUT_DATA 0x0000880d
+#define GFSCMD_LSDA_PIN_OUTPUT_DATA 0x0002880d
+#define GFSCMD_LCSN_PIN_OUTPUT_DATA 0x0004880d
+#define GFSCMD_LDC_PIN_OUTPUT_DATA 0x0006880d
+#define GFSCMD_LSPI_PIN_OUTPUT_DATA 0x0008880d
+
+#define GF_LSCK_DATA_LOW 0x00000002
+#define GF_LSCK_DATA_HIGH 0x00000003
+#define GF_LSDA_DATA_LOW 0x00000008
+#define GF_LSDA_DATA_HIGH 0x0000000c
+#define GF_LCSN_DATA_LOW 0x00000020
+#define GF_LCSN_DATA_HIGH 0x00000030
+#define GF_LDC_DATA_LOW 0x00000080
+#define GF_LDC_DATA_HIGH 0x000000c0
+#define GF_LSPI_DATA_LOW 0x00000200
+#define GF_LSPI_DATA_HIGH 0x00000300
+
+// Pin Input Enable
+
+#define GFSCMD_LSPI_PIN_INPUT 0x00088811
+#define GF_LSPI_INPUT_ENABLE 0x00000000
+#define GF_LSPI_INPUT_DISABLE 0x00000100
+
+#define GFSCMD_LDC_PIN_INPUT 0x00088411
+#define GF_LDC_INPUT_ENABLE 0x00000000
+#define GF_LDC_INPUT_DISABLE 0x00000040
+
+#define GFSCMD_LPP_PIN_INPUT 0x00168811
+#define GF_LPP_INPUT_ENABLE 0x00000000
+#define GF_LPP_INPUT_DISABLE 0x00400000
+
+// Pin Output Select
+
+#define DC_PIN_OUTPUT_SELECT0 0x00000814
+#define GFSCMD_LD0_OUTPUT_SELECT 0x00008814
+#define GFSCMD_LD1_OUTPUT_SELECT 0x00048814
+#define GFSCMD_LD2_OUTPUT_SELECT 0x00088814
+#define GFSCMD_LD3_OUTPUT_SELECT 0x000C8814
+#define GFSCMD_LD4_OUTPUT_SELECT 0x00108814
+#define GFSCMD_LD5_OUTPUT_SELECT 0x00148814
+#define GFSCMD_LD6_OUTPUT_SELECT 0x00188814
+#define GFSCMD_LD7_OUTPUT_SELECT 0x001C8814
+#define GFSCMD_LD0_LD7_OUTPUT_SELECT 0x00208814
+
+#define GF_LD0_PIN_FOR_LD0 0
+#define GF_LD0_PIN_FOR_LD0_OUT 1
+#define GF_LD0_PIN_FOR_SC_ 4
+#define GF_LD1_PIN_FOR_LD1 0
+#define GF_LD1_PIN_FOR_LD1_OUT 1
+#define GF_LD1_PIN_FOR_SC 4
+#define GF_LD2_PIN_FOR_LD2 0
+#define GF_LD2_PIN_FOR_LD2_OUT 1
+#define GF_LD2_PIN_FOR_SD0_ 4
+#define GF_LD3_PIN_FOR_LD3 0
+#define GF_LD3_PIN_FOR_LD3_OUT 1
+#define GF_LD3_PIN_FOR_SD0 4
+#define GF_LD4_PIN_FOR_LD4 0
+#define GF_LD4_PIN_FOR_LD4_OUT 1
+#define GF_LD4_PIN_FOR_SD1_ 4
+#define GF_LD5_PIN_FOR_LD5 0
+#define GF_LD5_PIN_FOR_LD5_OUT 1
+#define GF_LD5_PIN_FOR_SD1 4
+#define GF_LD6_PIN_FOR_LD6 0
+#define GF_LD6_PIN_FOR_LD6_OUT 1
+#define GF_LD6_PIN_FOR_STH 4
+#define GF_LD7_PIN_FOR_LD7 0
+#define GF_LD7_PIN_FOR_LD7_OUT 1
+#define GF_LD7_PIN_FOR_SDT 4
+#define GF_LD0_LD7_PIN_FOR_LD0_LD7 0x00000000
+#define GF_LD0_LD7_PIN_FOR_LD0_LD7_OUT 0x11111111
+#define GF_LD0_LD7_PIN_FOR_LPD0_LPD7_OUT 0x22222222
+
+#define DC_PIN_OUTPUT_SELECT1 0x00000815
+#define GFSCMD_LD8_OUTPUT_SELECT 0x00008815
+#define GFSCMD_LD9_OUTPUT_SELECT 0x00048815
+#define GFSCMD_LD10_OUTPUT_SELECT 0x00088815
+#define GFSCMD_LD11_OUTPUT_SELECT 0x000C8815
+#define GFSCMD_LD12_OUTPUT_SELECT 0x00108815
+#define GFSCMD_LD13_OUTPUT_SELECT 0x00148815
+#define GFSCMD_LD14_OUTPUT_SELECT 0x00188815
+#define GFSCMD_LD15_OUTPUT_SELECT 0x001C8815
+#define GFSCMD_LD8_LD15_OUTPUT_SELECT 0x00208815
+
+#define GF_LD8_PIN_FOR_LD8 0
+#define GF_LD8_PIN_FOR_LD8_OUT 1
+#define GF_LD8_PIN_FOR_LPD8_OUT 2
+#define GF_LD8_PIN_FOR_STP 4
+#define GF_LD9_PIN_FOR_LD9 0
+#define GF_LD9_PIN_FOR_LD9_OUT 1
+#define GF_LD9_PIN_FOR_LPD9_OUT 2
+#define GF_LD9_PIN_FOR_SD2_ 4
+#define GF_LD10_PIN_FOR_LD10 0
+#define GF_LD10_PIN_FOR_LD10_OUT 1
+#define GF_LD10_PIN_FOR_SD2 4
+#define GF_LD11_PIN_FOR_LD11 0
+#define GF_LD11_PIN_FOR_LD11_OUT 1
+#define GF_LD12_PIN_FOR_LD12 0
+#define GF_LD12_PIN_FOR_LD12_OUT 1
+#define GF_LD13_PIN_FOR_LD13 0
+#define GF_LD13_PIN_FOR_LD13_OUT 1
+#define GF_LD14_PIN_FOR_LD14 0
+#define GF_LD14_PIN_FOR_LD14_OUT 1
+#define GF_LD15_PIN_FOR_LD15 0
+#define GF_LD15_PIN_FOR_LD15_OUT 1
+#define GF_LD8_LD15_PIN_FOR_LD8_LD15 0x00000000
+#define GF_LD8_LD15_PIN_FOR_LD8_LD15_OUT 0x11111111
+#define GF_LD8_LD15_PIN_FOR_LPD8_LPD15_OUT 0x22222222
+
+#define DC_PIN_OUTPUT_SELECT2 0x00000816
+#define GFSCMD_LD16_OUTPUT_SELECT 0x00008816
+#define GFSCMD_LD17_OUTPUT_SELECT 0x00048816
+
+#define GF_LD16_PIN_FOR_LD16 0
+#define GF_LD16_PIN_FOR_LD16_OUT 1
+#define GF_LD17_PIN_FOR_LD17 0
+#define GF_LD17_PIN_FOR_LD17_OUT 1
+
+#define OFFSET_PIN_OUTPUT_SELECT3 0x00000817
+#define GFSCMD_LPW0_OUTPUT_SELECT 0x00008817
+#define GFSCMD_LPW1_OUTPUT_SELECT 0x00048817
+#define GFSCMD_LPW2_OUTPUT_SELECT 0x00088817
+#define GFSCMD_LSC0_OUTPUT_SELECT 0x00108817
+#define GFSCMD_LSC1_OUTPUT_SELECT 0x00148817
+#define GFSCMD_LVS_OUTPUT_SELECT 0x00188817
+#define GFSCMD_LHS_OUTPUT_SELECT 0x001c8817
+
+#define GF_LPW0_PIN_FOR_PW0 0
+#define GF_LPW0_PIN_FOR_PW0_OUT 1
+#define GF_LPW0_PIN_FOR_PW1 2
+#define GF_LPW0_PIN_FOR_PM0 3
+#define GF_LPW0_PIN_FOR_PW2 4
+#define GF_LPW1_PIN_FOR_PW1 0
+#define GF_LPW1_PIN_FOR_PW1_OUT 1
+#define GF_LPW1_PIN_FOR_PW2 2
+#define GF_LPW1_PIN_FOR_PM1 3
+#define GF_LPW1_PIN_FOR_PW3 4
+#define GF_LPW2_PIN_FOR_PW2 0
+#define GF_LPW2_PIN_FOR_PW2_OUT 1
+#define GF_LPW2_PIN_FOR_PW3 2
+#define GF_LPW2_PIN_FOR_PM0 3
+#define GF_LPW2_PIN_FOR_PW4 4
+#define GF_LSC0_PIN_FOR_LSC0 0
+#define GF_LSC0_PIN_FOR_LSC0_OUT 1
+#define GF_LSC1_PIN_FOR_LSC1 0
+#define GF_LSC1_PIN_FOR_LSC1_OUT 1
+#define GF_LSC1_PIN_FOR_LSC1_DE 2
+#define GF_LVS_PIN_FOR_VSYNC 0
+#define GF_LVS_PIN_FOR_LVS_OUT 1
+#define GF_LVS_PIN_FOR_PM1 3
+#define GF_LHS_PIN_FOR_HSYNC 0
+#define GF_LHS_PIN_FOR_LHS_OUT 1
+#define GF_LHS_PIN_FOR_PM0 3
+
+#define OFSSET_PIN_OUTPUT_SELECT4 0x00000818
+#define GFSCMD_LHP0_OUTPUT_SELECT 0x00008818
+#define GFSCMD_LHP1_OUTPUT_SELECT 0x00048818
+#define GFSCMD_LHP2_OUTPUT_SELECT 0x00088818
+#define GFSCMD_LVP0_OUTPUT_SELECT 0x00108818
+#define GFSCMD_LVP1_OUTPUT_SELECT 0x00148818
+
+#define GF_LHP0_PIN_FOR_LHP0 0
+#define GF_LHP0_PIN_FOR_LHP0_OUT 1
+#define GF_LHP0_PIN_FOR_LD21 2
+#define GF_LHP0_PIN_FOR_PM0 3
+#define GF_LHP1_PIN_FOR_LHP1 0
+#define GF_LHP1_PIN_FOR_LHP1_OUT 1
+#define GF_LHP1_PIN_FOR_LD18 2
+#define GF_LHP1_PIN_FOR_PM1 3
+#define GF_LHP2_PIN_FOR_LHP2 0
+#define GF_LHP2_PIN_FOR_LHP2_OUT 1
+#define GF_LHP2_PIN_FOR_LD19 2
+#define GF_LHP2_PIN_FOR_PM0 3
+#define GF_LHP2_PIN_FOR_LVP2 4
+#define GF_LVP0_PIN_FOR_LVP0 0
+#define GF_LVP0_PIN_FOR_LVP0_OUT 1
+#define GF_LVP0_PIN_FOR_PM0 3
+#define GF_LVP1_PIN_FOR_LVP1 0
+#define GF_LVP1_PIN_FOR_LVP1_OUT 1
+#define GF_LVP1_PIN_FOR_LD20 2
+#define GF_LVP1_PIN_FOR_PM1 3
+#define GF_LVP1_PIN_FOR_PW4 4
+
+#define OFFSET_PIN_OUTPUT_SELECT5 0x00000819
+#define GFSCMD_LM0_OUTPUT_SELECT 0x00008819
+#define GFSCMD_LM1_OUTPUT_SELECT 0x00048819
+#define GFSCMD_LDI_OUTPUT_SELECT 0x00088819
+#define GFSCMD_LPP_OUTPUT_SELECT 0x000c8819
+
+#define GF_LM0_PIN_FOR_LM0 0
+#define GF_LM0_PIN_FOR_LM0_OUT 1
+#define GF_LM0_PIN_FOR_SCS 2
+#define GF_LM0_PIN_FOR_PM0 3
+#define GF_LM0_PIN_FOR_LVP2 4
+#define GF_LM1_PIN_FOR_M1 0
+#define GF_LM1_PIN_FOR_LM1_OUT 1
+#define GF_LM1_PIN_FOR_LD21 2
+#define GF_LM1_PIN_FOR_PM1 3
+#define GF_LM1_PIN_FOR_LVP3 4
+#define GF_LDI_PIN_FOR_DI 0
+#define GF_LDI_PIN_FOR_LDI_OUT 1
+#define GF_LDI_PIN_FOR_LD22 2
+#define GF_LDI_PIN_FOR_PM0 3
+#define GF_LDI_PIN_FOR_SCS 4
+#define GF_LPP_PIN_FOR_PP 0
+#define GF_LPP_PIN_FOR_LPP_OUT 1
+#define GF_LPP_PIN_FOR_LD23 2
+#define GF_LPP_PIN_FOR_PM1 3
+#define GF_LPP_PIN_FOR_LVP3 4
+
+#define OFFSET_PIN_OUTPUT_SELECT6 0x0000081a
+#define GFSCMD_LSCK_OUTPUT_SELECT 0x0000881a
+#define GFSCMD_LSDA_OUTPUT_SELECT 0x0004881a
+#define GFSCMD_LCSN_OUTPUT_SELECT 0x0008881a
+#define GFSCMD_LDC_OUTPUT_SELECT 0x000c881a
+#define GFSCMD_LSPI_OUTPUT_SELECT 0x0010881a
+
+#define GF_LSCK_PIN_FOR_SCK 0
+#define GF_LSCK_PIN_FOR_LSCK_OUT 1
+#define GF_LSCK_PIN_FOR_PM0 3
+#define GF_LSDA_PIN_FOR_SDA 0
+#define GF_LSDA_PIN_FOR_LSDA_OUT 1
+#define GF_LSDA_PIN_FOR_SCS 2
+#define GF_LSDA_PIN_FOR_PM1 3
+#define GF_LCS_PIN_FOR_MCS 0
+#define GF_LCS_PIN_FOR_LCS_OUT 1
+#define GF_LCS_PIN_FOR_PM0 3
+#define GF_LDC_PIN_FOR_SDC 0
+#define GF_LDC_PIN_FOR_LDC_OUT 1
+#define GF_LDC_PIN_FOR_LD22 2
+#define GF_LDC_PIN_FOR_PM1 3
+#define GF_LSPI_PIN_FOR_SPI 0
+#define GF_LSPI_PIN_FOR_LSPI_OUT 1
+#define GF_LSPI_PIN_FOR_DE 2
+#define GF_LSPI_PIN_FOR_PM0 3
+#define GF_LSPI_PIN_FOR_PCLK 4
+
+
+//#define OFFSET_PIN_MISC_CONTROL 0x0000081b
+//#define DISP_CLOCK_OUTPUT_MASK
+//#define DISP_CLOCK_OUTPUT_SHIFT
+//#define DISP_CLOCK_OUTPUT_DISABLE
+//#define DISP_CLOCK_OUTPUT_ENABLE
+
+#define OFFSET_PM0_CONTROL 0x0000081c
+#define GFSCMD_PM0_CLOCK_SELECT 0x0000881c
+#define GFSCMD_PM0_CLOCK_DIVIDER 0x0004881c
+#define GFSCMD_PM0_PERIOD 0x0012881c
+
+#define GF_PM0_SHIFT_CLOCK 0x00000000
+#define GF_PM0_PIXEL_CLOCK 0x00000001
+#define GF_PM0_LINE_CLOCK 0x00000002
+#define GF_PM0_FRAME_CLOCK 0x00000003
+#define GF_PM0_CLOCK_DIVIDER_VAL 0x00000010
+#define GF_PM0_PERIOD_VAL 0x00040000
+
+#define OFFSET_PM0_DUTY_CYCLE 0x0000081d
+#define GFSCMD_PM0_DUTY_CYCLE 0x0000881d
+
+#define GF_PM0_DUTY_CYCLE_VAL 0x00000000
+
+#define OFFSET_PM1_CONTROL 0x0000081e
+#define GFSCMD_PM1_CLOCK_SELECT 0x0000881e
+#define GFSCMD_PM1_CLOCK_DIVIDER 0x0004881e
+#define GFSCMD_PM1_PERIOD 0x0012881e
+
+#define GF_PM1_SHIFT_CLOCK 0x00000000
+#define GF_PM1_PIXEL_CLOCK 0x00000001
+#define GF_PM1_LINE_CLOCK 0x00000002
+#define GF_PM1_FRAME_CLOCK 0x00000003
+#define GF_PM1_CLOCK_DIVIDER_VAL 0x00000010
+#define GF_PM1_PERIOD_VAL 0x00040000
+
+#define OFFSET_PM1_DUTY_CYCLE 0x0000081f
+#define GFSCMD_PM1_DUTY_CYCLE 0x0000881f
+
+#define GF_PM1_DUTY_CYCLE_VAL 0x00000000
+
+////////////////////////
+#define OFFSET_SPI_CONTROL 0x00000820
+#define GFSCMD_SPI_SERIAL_CLK_CONTROL 0x00008820
+#define GFSCMD_SPI_DATA_DIRECTION 0x00038820
+#define GFSCMD_SPI_BITS_PER_CYCLE 0x00048820
+#define GFSCMD_SPI_CLK_DIVIDER_1_32 0x00108820
+#define GFSCMD_SPI_STATUS 0x00188820
+
+#define GF_SPI_1SCLK_CS_RISING_EDGE_ACTV 0x00000000
+#define GF_SPI_2SCLK_CS_RISING_EDGE_ACTV 0x00000001
+#define GF_SPI_1SCLK_CS_FALLING_EDGE_ACTV 0x00000002
+#define GF_SPI_2SCLK_CS_FALLING_EDGE_ACTV 0x00000003
+#define GF_SPI_MSB2LSB 0x00000000
+#define GF_SPI_LSB2MSB 0x00000008
+#define GF_SPI8 0x00000000
+#define GF_SPI8DC 0x00000010
+#define GF_SPI12 0x00000020
+#define GF_SPI16 0x00000030
+#define GF_SPI16DC 0x00000040
+#define GF_START_BYTE_PLUS_SPI16 0x00000050
+#define GF_SPI18 0x00000060
+#define GF_SPI24 0x00000070
+//#define GF_SPI_CLK_DIVIDER_1_32_VAL
+#define GF_SPI_STATUS_DISABLE 0x00000000
+#define GF_STATUS_ENABLE_HOST_SPI 0x01000000
+#define GF_STATUS_ENABLE_HOST_IS_SPI 0x02000000
+#define GF_STATUS_ENABLE_ALL_SPI_CYCL 0x03000000
+
+//#define OFFSET_HSPI_START_BYTE 0x00000821
+#define GFSCMD_HSPI_DATA_START_BYTE 0x00008821
+#define GFSCMD_HSPI_START_BYTE 0x00008821
+//#define GFSCMD_HSPI_COMMAND_START_BYTE 0x00088821
+
+//#define OFFSET_HSPI_WRITE_DATA_CD 0x00000822
+#define GFSCMD_HSPI_WRITE_DATA_A 0x00008822
+#define GFSCMD_HSPI_WRITE_DATA_B 0x00088822
+#define GFSCMD_HSPI_WRITE_DATA_AB 0x00208822
+
+//#define OFFSET_HSPI_WRITE_DATA_CD 0x00000823
+#define GFSCMD_HSPI_WRITE_DATA_C 0x00008823
+#define GFSCMD_HSPI_WRITE_DATA_D 0x00088823
+#define GFSCMD_HSPI_WRITE_DATA_CD 0x00208823
+
+#define GF_HSPI_CMD_CYCLE1 0
+#define GF_HSPI_CMD_CYCLE2 0
+#define GF_HSPI_CMD_CYCLE3 0
+#define GF_HSPI_CMD_CYCLE4 0
+
+#define GF_HSPI_DATA_CYCLE1 1
+#define GF_HSPI_DATA_CYCLE2 2
+#define GF_HSPI_DATA_CYCLE3 4
+#define GF_HSPI_DATA_CYCLE4 8
+
+#define GF_HSPI_MAIN_CS_CYCLE1 1
+#define GF_HSPI_MAIN_CS_CYCLE2 2
+#define GF_HSPI_MAIN_CS_CYCLE3 4
+#define GF_HSPI_MAIN_CS_CYCLE4 8
+
+#define GF_HSPI_SUB_CS_CYCLE1 1
+#define GF_HSPI_SUB_CS_CYCLE2 2
+#define GF_HSPI_SUB_CS_CYCLE3 4
+#define GF_HSPI_SUB_CS_CYCLE4 8
+
+//////////////////////////
+
+#if 0
+// LCD SPI interface signals
+
+#define DC_P_LCD_SPI_OPTIONS 0x00000135
+#define GF_LCD_SPI_CS 0x00008135
+#define GF_LCD_SPI_DC 0x00018135
+#define GF_SPI_CS_CONTROL 0x00028135
+#define GF_LCD_SPI_DIRECTION 0x00048135
+
+#define GF_LCD_SPI_CS_MAIN 0x00000000
+#define GF_LCD_SPI_CS_SUB 0x00000001
+#define GF_LCD_SPI_DC_LOW 0x00000000
+#define GF_LCD_SPI_DC_HIGH 0x00000002
+#define GF_SPI_CS_CONTROL_LCD_IS_SPI 0x00000000
+#define GF_SPI_CS_CONTROL_LCD_SPI 0x00000004
+#define GF_SPI_CS_CONTROL_IS_SPI 0x00000008
+#define GF_SPI_CS_CONTROL_FORCED 0x0000000C
+#define GF_LCD_SPI_DIRECTION_MSB2LSB 0x00000000
+#define GF_LCD_SPI_DIRECTION_LSB2MSB 0x00000010
+#endif
+
+// Class: Initialization Sequence (IS)
+
+#define OFSSET_P_INIT_SEQ_CONTROL 0x00000141
+#define GFSCMD_SEND_INIT_SEQUENCE 0x00008141
+#define GFSCMD_INIT_SEQUENCE_MODE_PLCD 0x00018141
+#define GFSCMD_INIT_SEQ_DC_SIGNAL_NODC 0x00048141
+#define GFSCMD_INIT_SEQ_DC_CONTROL 0x00078141
+#define GFSCMD_FRAME_INIT_SEQ_CYCLES 0x00088141
+
+#define GF_SEND_INIT_SEQUENCE_DISABLE 0x00000000
+#define GF_SEND_INIT_SEQUENCE_ENABLE 0x00000001
+#define GF_INIT_SEQUENCE_MODE_PLCD_INIT 0x00000000
+#define GF_INIT_SEQUENCE_MODE_SPI_INIT 0x00000002
+#define GF_INIT_SEQ_SIGNAL_NODC 0x00000000
+#define GF_INIT_SEQ_SIGNAL_VSYNC 0x00000010
+#define GF_INIT_SEQ_SIGNAL_VPULSE0 0x00000020
+#define GF_INIT_SEQ_SIGNAL_VPULSE1 0x00000030
+#define GF_INIT_SEQ_SIGNAL_VPULSE2 0x00000040
+#define GF_INIT_SEQ_SIGNAL_VPULSE3 0x00000050
+#define GF_INIT_SEQ_CONTROL 0x00000080
+
+//#define GF_FRAME_INIT_SEQ_CYCLES 0x00000100
+
+
+// SPI Init Sequence Write Data bits 31-0
+#define DC_P_SPI_INIT_SEQ_DATA_A 0x00000142
+#define GFSCMD_SPI_INIT_SEQ_DATA_A 0x00008142
+
+// SPI Init Sequence Write Data bits 63-32
+#define DC_P_SPI_INIT_SEQ_DATA_B 0x00000143
+#define GFSCMD_SPI_INIT_SEQ_DATA_B 0x00008143
+
+// SPI Init Sequence Write Data bits 95-64
+#define DC_P_SPI_INIT_SEQ_DATA_C 0x00000144
+#define GFSCMD_SPI_INIT_SEQ_DATA_C 0x00008144
+
+// SPI Init Sequence Write Data bits 127-96
+#define DC_P_SPI_INIT_SEQ_DATA_D 0x00000145
+#define GFSCMD_SPI_INIT_SEQ_DATA_D 0x00008145
+
+#define OFFSET_DISPLAY_COMMAND 0x00000003
+#define GFSCMD_DISPLAY_CTRL_MODE 0x00058003
+
+#define GF_CTRL_MODE_STOP 0x00000000
+#define GF_CTRL_MODE_C_DISPLAY 0x00000020
+#define GF_CTRL_MODE_NC_DISPLAY 0x00000040
+#define GF_CTRL_MODE_NOCHANGE 0x000000C0
+
+
+/* Other Commands */
+
+#define GF_NO_DATA 0x00000000
+#define GFSCMD_LVDD_ON 0x01020000
+#define GFSCMD_LVDD_OFF 0x01020001
+
+#define GFSCMD_RESET_LHP2 0x0104880c
+#define GFSCMD_RESET_LVP0 0x0108880c
+#define GFSCMD_MS_DELAY 0x01005A5A
+#define GFSCMD_WAIT_VBLANK 0x01005555
+#define GFSCMD_END_OF_TABLE 0x0100ffff
+#define GFSCMD_I2C_A_PAL_PLL2_CLK 0x0100F000
+
+#define GFSDEFAULT_CMD 0x10000000 // Default settings
+#define GFSDEFAULT_BACKLIGHT0 0x10000001
+#define GF_ON_LPW2 0x00000000
+#define GF_ON_LPW0 0x00000001
+
+#define GFSDEFAULT_BACKLIGHT1 0x10000002
+#define GF_ON_LM1 0x00000000
+#define GF_ON_LPW1 0x00000001
+
+#define GFPDRV_CMD 0x20000000
+#define GFHOST_CMD 0x40000000
+#define GFSCMD_PANEL_PKT_HEADER_START 0x40000000
+
+#define GF_DLY_AFTR_DATA_SENT_MASK 0x00002000
+#define GF_A_2MS_DLY_AFTR_DATA_SENT 0x00000000
+#define GF_A_NO_DLY_AFTR_DATA_SENT 0x00002000
+
+#define GF_RAISE_WAIT_AFTR_DATA_SENT_MASK 0x00001000
+#define GF_A_RAISE_WAIT_AFTR_DATA_SENT 0x00001000
+
+#define GF_DATA_BURST_MASK 0x000000ff
+#define GF_A_DATA_BURST0 0x00000000
+#define GF_A_DATA_BURST1 0x00000001
+#define GF_A_DATA_BURST2 0x00000002
+#define GF_A_DATA_BURST3 0x00000003
+#define GF_A_DATA_BURST4 0x00000004
+#define GF_A_DATA_BURST5 0x00000005
+#define GF_A_DATA_BURST6 0x00000006
+#define GF_A_DATA_BURST7 0x00000007
+#define GF_A_DATA_BURST8 0x00000008
+
+#define GF_CS_MASK 0x000f0000
+#define GF_A_MCS_ACTVH 0x00010000
+#define GF_A_MCS_ACTVL 0x00020000
+#define GF_A_SCS_ACTVH 0x00030000
+#define GF_A_SCS_ACTVL 0x00040000
+
+#define GF_RS_DC_MASK 0x00f00000
+#define GF_A_RS_DC_IXH_DATAL 0x00100000
+#define GF_A_RS_DC_IXL_DATAL 0x00200000
+#define GF_A_RS_DC_IXL_DATAH 0x00300000
+#define GF_A_RS_DC_IXH_DATAH 0x00400000
+
+#define GF_IFACE_MASK 0x00008f00
+#define GF_A_IFACE_PRLL 0x00008000
+
+#define GF_A_IFACE_PRLL_8 0x00008100
+#define GF_A_IFACE_PRLL_9 0x00008200
+#define GF_A_IFACE_PRLL_16 0x00008300
+#define GF_A_IFACE_PRLL_18 0x00008400
+#define GF_A_IFACE_SPI_8 0x00000100
+#define GF_A_IFACE_SPI_8DC 0x00000200
+#define GF_A_IFACE_SPI_12 0x00000300
+#define GF_A_IFACE_SPI_16 0x00000400
+#define GF_A_IFACE_SPI_16DC 0x00000500
+#define GF_A_IFACE_SPI_16_START8 0x00000600
+#define GF_A_IFACE_SPI_18 0x00000700
+#define GF_A_IFACE_SPI_24 0x00000800
+#define GF_A_IF_LSB_ALINED 0x00004000
+#define GF_A_IF_MSB_ALINED 0x00000000
+#define GF_IF_ALINED_MASK 0x00004000
+
+#define GF_CLK_PER_PIXEL_MASK 0x3f000000
+#define GF_A_1CLK_PIXEL 0x01000000
+#define GF_A_2CLK_PIXEL 0x02000000
+#define GF_A_3CLK_PIXEL 0x03000000
+#define GF_A_4CLK_PIXEL 0x04000000
+#define GF_A_24CLK_PIXEL 0x18000000
+
+// Parellel
+#define GF_A_DATA_VLD_MASK 0xC0000000
+#define GF_A_DATA_VLD_CLK_RISE 0x40000000
+#define GF_A_DATA_VLD_CLK_FALL 0x80000000
+
+// Serial
+
+#define GF_SPI_SCLK_CS_EDGE_ACTV_MASK 0xC0000000
+#define GF_A_SPI_1SCLK_CS_RISING_EDGE_ACTV 0x40000000
+#define GF_A_SPI_2SCLK_CS_RISING_EDGE_ACTV 0x00000000
+#define GF_A_SPI_1SCLK_CS_FALLING_EDGE_ACTV 0xC0000000
+#define GF_A_SPI_2SCLK_CS_FALLING_EDGE_ACTV 0x80000000
+
+#define GF_A_SPI_CS_ACTVH 0x00010000
+#define GF_A_SPI_CS_ACTVL 0x00020000
+
+#define GF_SPI_RS_DC_MASK 0x00f00000
+#define GF_A_SPI_RS_DC_IXH_DATAL 0x00100000
+#define GF_A_SPI_RS_DC_IXL_DATAL 0x00200000
+#define GF_A_SPI_RS_DC_IXL_DATAH 0x00300000
+#define GF_A_SPI_RS_DC_IXH_DATAH 0x00400000
+
+
+#define GF_B_ 0x00000000
+#define GF_C_ 0x00000000
+
+#define GF_SPI_DATA_START_BYTE 0x00000000
+#define GF_SPI_CMD_START_BYTE 0x00000000
+#define GF_PANEL_DRV_CMD_DATA ~0x0000ffff
+#define GFSCMD_PANEL_PKT_HEADER_END 0x40008000
+
+#define GFPERIODIC_CMD 0x4000C000
+#define GFSCMD_PERIODIC_PKT_HEADER_START 0x4000C000
+#define GFSCMD_PERIODIC_PKT_HEADER_SIZE 0x0000000A
+
+#define GF_IS_PERDC_MSB9_LSB9_SWAP_MASK 0x00800000
+#define GF_IS_PERDC_MSB9_LSB9_SWAP 0x00800000
+
+#define GF_IS_PERDC_PARLL_CYCLE_MASK 0x0000000f
+#define GF_IS_PERDC_PARLL_CYCLE0 0x00000000
+#define GF_IS_PERDC_PARLL_CYCLE1 0x00000001
+#define GF_IS_PERDC_PARLL_CYCLE2 0x00000002
+#define GF_IS_PERDC_PARLL_CYCLE3 0x00000003
+#define GF_IS_PERDC_PARLL_CYCLE4 0x00000004
+#define GF_IS_PERDC_PARLL_CYCLE5 0x00000005
+#define GF_IS_PERDC_PARLL_CYCLE6 0x00000006
+#define GF_IS_PERDC_PARLL_CYCLE7 0x00000007
+#define GF_IS_PERDC_PARLL_CYCLE8 0x00000008
+#define GF_IS_PERDC_PARLL_CYCLE9 0x00000009
+#define GF_IS_PERDC_PARLL_CYCLE10 0x0000000A
+#define GF_IS_PERDC_PARLL_CYCLE11 0x0000000B
+#define GF_IS_PERDC_PARLL_CYCLE12 0x0000000C
+
+#define GF_IS_PERDC_PARLL_IF_MASK 0xf0000000
+#define GF_IS_PERDC_PARLL_IF_8 0x00000000
+#define GF_IS_PERDC_PARLL_IF_9 0x10000000
+#define GF_IS_PERDC_PARLL_IF_18 0x20000000
+#define GF_IS_PERDC_PARLL_IF_16 0x30000000
+
+#define GF_IS_PERDC_PARLL_MAX_DATA_MASK 0x0000ff00
+#define GF_IS_PERDC_PARLL_MAX_DATA_IF_8 0x00005900
+#define GF_IS_PERDC_PARLL_MAX_DATA_IF_9 0x00005900
+#define GF_IS_PERDC_PARLL_MAX_DATA_IF_16 0x00006B00
+#define GF_IS_PERDC_PARLL_MAX_DATA_IF_18 0x00006B00
+
+#define GFIS_PRLL_EN_RS_DC_C 0
+#define GFIS_PRLL_EN_RS_DC_D 0
+
+#define GFIS_PRLL_ENBLE_LSC0_18_CYCLE_1_D (1 << (108-96))
+#define GFIS_PRLL_ENBLE_LSC0_18_CYCLE_2_D (1 << (111-96))
+#define GFIS_PRLL_ENBLE_LSC0_18_CYCLE_3_D (1 << (114-96))
+#define GFIS_PRLL_ENBLE_LSC0_18_CYCLE_4_D (1 << (117-96))
+#define GFIS_PRLL_ENBLE_LSC0_18_CYCLE_5_D (1 << (120-96))
+#define GFIS_PRLL_ENBLE_LSC0_18_CYCLE_6_D (1 << (123-96))
+
+#define GFIS_PRLL_ENBLE_LSC1_18_CYCLE_1_D (1 << (109-96))
+#define GFIS_PRLL_ENBLE_LSC1_18_CYCLE_2_D (1 << (112-96))
+#define GFIS_PRLL_ENBLE_LSC1_18_CYCLE_3_D (1 << (115-96))
+#define GFIS_PRLL_ENBLE_LSC1_18_CYCLE_4_D (1 << (118-96))
+#define GFIS_PRLL_ENBLE_LSC1_18_CYCLE_5_D (1 << (121-96))
+#define GFIS_PRLL_ENBLE_LSC1_18_CYCLE_6_D (1 << (124-96))
+
+#define GFIS_PRLL_RS_CD_18_CYCLE_1_H_D (1 << (110-96))
+#define GFIS_PRLL_RS_CD_18_CYCLE_1_L_D 0x00000000
+#define GFIS_PRLL_RS_CD_18_CYCLE_2_H_D (1 << (113-96))
+#define GFIS_PRLL_RS_CD_18_CYCLE_2_L_D 0x00000000
+#define GFIS_PRLL_RS_CD_18_CYCLE_3_H_D (1 << (116-96))
+#define GFIS_PRLL_RS_CD_18_CYCLE_3_L_D 0x00000000
+#define GFIS_PRLL_RS_CD_18_CYCLE_4_H_D (1 << (119-96))
+#define GFIS_PRLL_RS_CD_18_CYCLE_4_L_D 0x00000000
+#define GFIS_PRLL_RS_CD_18_CYCLE_5_H_D (1 << (122-96))
+#define GFIS_PRLL_RS_CD_18_CYCLE_5_L_D 0x00000000
+#define GFIS_PRLL_RS_CD_18_CYCLE_6_H_D (1 << (125-96))
+#define GFIS_PRLL_RS_CD_18_CYCLE_6_L_D 0x00000000
+
+#define GFIS_PRLL_ENBLE_LSC0_9_CYCLE_1_C (1 << (90-64))
+#define GFIS_PRLL_ENBLE_LSC0_9_CYCLE_2_C (1 << (93-64))
+#define GFIS_PRLL_ENBLE_LSC0_9_CYCLE_3_D (1 << (96-96))
+#define GFIS_PRLL_ENBLE_LSC0_9_CYCLE_4_D (1 << (99-96))
+#define GFIS_PRLL_ENBLE_LSC0_9_CYCLE_5_D (1 << (102-96))
+#define GFIS_PRLL_ENBLE_LSC0_9_CYCLE_6_D (1 << (105-96))
+#define GFIS_PRLL_ENBLE_LSC0_9_CYCLE_7_D (1 << (108-96))
+#define GFIS_PRLL_ENBLE_LSC0_9_CYCLE_8_D (1 << (111-96))
+#define GFIS_PRLL_ENBLE_LSC0_9_CYCLE_9_D (1 << (114-96))
+#define GFIS_PRLL_ENBLE_LSC0_9_CYCLE_10_D (1 << (117-96))
+
+#define GFIS_PRLL_ENBLE_LSC1_9_CYCLE_1_C (1 << (91-64))
+#define GFIS_PRLL_ENBLE_LSC1_9_CYCLE_2_C (1 << (94-64))
+#define GFIS_PRLL_ENBLE_LSC1_9_CYCLE_3_D (1 << (97-96))
+#define GFIS_PRLL_ENBLE_LSC1_9_CYCLE_4_D (1 << (100-96))
+#define GFIS_PRLL_ENBLE_LSC1_9_CYCLE_5_D (1 << (103-96))
+#define GFIS_PRLL_ENBLE_LSC1_9_CYCLE_6_D (1 << (106-96))
+#define GFIS_PRLL_ENBLE_LSC1_9_CYCLE_7_D (1 << (109-96))
+#define GFIS_PRLL_ENBLE_LSC1_9_CYCLE_8_D (1 << (112-96))
+#define GFIS_PRLL_ENBLE_LSC1_9_CYCLE_9_D (1 << (115-96))
+#define GFIS_PRLL_ENBLE_LSC1_9_CYCLE_10_D (1 << (118-96))
+
+#define GFIS_PRLL_RS_CD_9_CYCLE_1_H_C (1 << (92-64))
+#define GFIS_PRLL_RS_CD_9_CYCLE_1_L_C 0x00000000
+#define GFIS_PRLL_RS_CD_9_CYCLE_2_H_C (1 << (95-64))
+#define GFIS_PRLL_RS_CD_9_CYCLE_2_L_C 0x00000000
+#define GFIS_PRLL_RS_CD_9_CYCLE_3_H_D (1 << (98-96))
+#define GFIS_PRLL_RS_CD_9_CYCLE_3_L_D 0x00000000
+#define GFIS_PRLL_RS_CD_9_CYCLE_4_H_D (1 << (101-96))
+#define GFIS_PRLL_RS_CD_9_CYCLE_4_L_D 0x00000000
+#define GFIS_PRLL_RS_CD_9_CYCLE_5_H_D (1 << (104-96))
+#define GFIS_PRLL_RS_CD_9_CYCLE_5_L_D 0x00000000
+#define GFIS_PRLL_RS_CD_9_CYCLE_6_H_D (1 << (107-96))
+#define GFIS_PRLL_RS_CD_9_CYCLE_6_L_D 0x00000000
+#define GFIS_PRLL_RS_CD_9_CYCLE_7_H_D (1 << (110-96))
+#define GFIS_PRLL_RS_CD_9_CYCLE_7_L_D 0x00000000
+#define GFIS_PRLL_RS_CD_9_CYCLE_8_H_D (1 << (113-96))
+#define GFIS_PRLL_RS_CD_9_CYCLE_8_L_D 0x00000000
+#define GFIS_PRLL_RS_CD_9_CYCLE_9_H_D (1 << (116-96))
+#define GFIS_PRLL_RS_CD_9_CYCLE_9_L_D 0x00000000
+#define GFIS_PRLL_RS_CD_9_CYCLE_10_H_D (1 << (119-96))
+#define GFIS_PRLL_RS_CD_9_CYCLE_10_L_D 0x00000000
+
+// Serial
+
+#define GF_IS_PERDC_SERIAL_CYCLE_MASK 0x0000000f
+#define GF_IS_PERDC_SERIAL_CYCLE0 0x00000000
+#define GF_IS_PERDC_SERIAL_CYCLE1 0x00000001
+#define GF_IS_PERDC_SERIAL_CYCLE2 0x00000002
+#define GF_IS_PERDC_SERIAL_CYCLE3 0x00000003
+#define GF_IS_PERDC_SERIAL_CYCLE4 0x00000004
+#define GF_IS_PERDC_SERIAL_CYCLE5 0x00000005
+#define GF_IS_PERDC_SERIAL_CYCLE6 0x00000006
+#define GF_IS_PERDC_SERIAL_CYCLE7 0x00000007
+#define GF_IS_PERDC_SERIAL_CYCLE8 0x00000008
+#define GF_IS_PERDC_SERIAL_CYCLE9 0x00000009
+#define GF_IS_PERDC_SERIAL_CYCLE10 0x0000000A
+#define GF_IS_PERDC_SERIAL_CYCLE11 0x0000000B
+#define GF_IS_PERDC_SERIAL_CYCLE12 0x0000000C
+
+#define GF_IS_PERDC_SERIAL_IF_MASK 0xf0000000
+#define GF_IS_PERDC_SERIAL_IF_8 0x80000000
+#define GF_IS_PERDC_SERIAL_IF_9 0x90000000
+#define GF_IS_PERDC_SERIAL_IF_12 0xA0000000
+#define GF_IS_PERDC_SERIAL_IF_16 0xB0000000
+#define GF_IS_PERDC_SERIAL_IF_18 0xC0000000
+#define GF_IS_PERDC_SERIAL_IF_24 0xD0000000
+
+#define GF_IS_PERDC_SERIAL_MAX_DATA_MASK 0x0000ff00
+#define GF_IS_PERDC_SERIAL_MAX_DATA_IF_8 0x00005900
+#define GF_IS_PERDC_SERIAL_MAX_DATA_IF_9 0x00005900
+#define GF_IS_PERDC_SERIAL_MAX_DATA_IF_12 0x00006A00
+#define GF_IS_PERDC_SERIAL_MAX_DATA_IF_16 0x00006B00
+#define GF_IS_PERDC_SERIAL_MAX_DATA_IF_18 0x00006C00
+#define GF_IS_PERDC_SERIAL_MAX_DATA_IF_24 0x00006D00
+
+#define GFIS_SERIAL_EN_RS_DC_C 0
+#define GFIS_SERIAL_EN_RS_DC_D 0
+
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_24_CYCLE_1_D (1 << (96-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_24_CYCLE_2_D (1 << (98-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_24_CYCLE_3_D (1 << (100-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_24_CYCLE_4_D (1 << (102-96))
+
+#define GFIS_SERIAL_RS_CD_24_CYCLE_1_H_D (1 << (97-96))
+#define GFIS_SERIAL_RS_CD_24_CYCLE_1_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_24_CYCLE_2_H_D (1 << (99-96))
+#define GFIS_SERIAL_RS_CD_24_CYCLE_2_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_24_CYCLE_3_H_D (1 << (101-96))
+#define GFIS_SERIAL_RS_CD_24_CYCLE_3_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_24_CYCLE_4_H_D (1 << (103-96))
+#define GFIS_SERIAL_RS_CD_24_CYCLE_4_L_D 0x00000000
+
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_18_CYCLE_1_D (1 << (108-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_18_CYCLE_2_D (1 << (110-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_18_CYCLE_3_D (1 << (112-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_18_CYCLE_4_D (1 << (114-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_18_CYCLE_5_D (1 << (116-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_18_CYCLE_6_D (1 << (118-96))
+
+#define GFIS_SERIAL_RS_CD_18_CYCLE_1_H_D (1 << (109-96))
+#define GFIS_SERIAL_RS_CD_18_CYCLE_1_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_18_CYCLE_2_H_D (1 << (111-96))
+#define GFIS_SERIAL_RS_CD_18_CYCLE_2_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_18_CYCLE_3_H_D (1 << (113-96))
+#define GFIS_SERIAL_RS_CD_18_CYCLE_3_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_18_CYCLE_4_H_D (1 << (115-96))
+#define GFIS_SERIAL_RS_CD_18_CYCLE_4_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_18_CYCLE_5_H_D (1 << (117-96))
+#define GFIS_SERIAL_RS_CD_18_CYCLE_5_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_18_CYCLE_6_H_D (1 << (119-96))
+#define GFIS_SERIAL_RS_CD_18_CYCLE_6_L_D 0x00000000
+
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_16_CYCLE_1_D (1 << (112-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_16_CYCLE_2_D (1 << (114-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_16_CYCLE_3_D (1 << (116-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_16_CYCLE_4_D (1 << (118-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_16_CYCLE_5_D (1 << (120-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_16_CYCLE_6_D (1 << (122-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_16_CYCLE_7_D (1 << (124-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_16_CYCLE_7_D (1 << (124-96))
+
+#define GFIS_SERIAL_RS_CD_16_CYCLE_1_H_D (1 << (113-96))
+#define GFIS_SERIAL_RS_CD_16_CYCLE_1_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_16_CYCLE_2_H_D (1 << (115-96))
+#define GFIS_SERIAL_RS_CD_16_CYCLE_2_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_16_CYCLE_3_H_D (1 << (117-96))
+#define GFIS_SERIAL_RS_CD_16_CYCLE_3_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_16_CYCLE_4_H_D (1 << (119-96))
+#define GFIS_SERIAL_RS_CD_16_CYCLE_4_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_16_CYCLE_5_H_D (1 << (121-96))
+#define GFIS_SERIAL_RS_CD_16_CYCLE_5_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_16_CYCLE_6_H_D (1 << (123-96))
+#define GFIS_SERIAL_RS_CD_16_CYCLE_6_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_16_CYCLE_7_H_D (1 << (125-96))
+#define GFIS_SERIAL_RS_CD_16_CYCLE_7_L_D 0x00000000
+
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_12_CYCLE_1_D (1 << (109-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_12_CYCLE_2_D (1 << (111-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_12_CYCLE_3_D (1 << (113-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_12_CYCLE_4_D (1 << (115-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_12_CYCLE_5_D (1 << (117-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_12_CYCLE_6_D (1 << (119-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_12_CYCLE_7_D (1 << (121-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_12_CYCLE_8_D (1 << (123-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_12_CYCLE_9_D (1 << (125-96))
+
+#define GFIS_SERIAL_RS_CD_12_CYCLE_1_H_D (1 << (110-96))
+#define GFIS_SERIAL_RS_CD_12_CYCLE_1_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_12_CYCLE_2_H_D (1 << (112-96))
+#define GFIS_SERIAL_RS_CD_12_CYCLE_2_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_12_CYCLE_3_H_D (1 << (114-96))
+#define GFIS_SERIAL_RS_CD_12_CYCLE_3_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_12_CYCLE_4_H_D (1 << (116-96))
+#define GFIS_SERIAL_RS_CD_12_CYCLE_4_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_12_CYCLE_5_H_D (1 << (118-96))
+#define GFIS_SERIAL_RS_CD_12_CYCLE_5_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_12_CYCLE_6_H_D (1 << (120-96))
+#define GFIS_SERIAL_RS_CD_12_CYCLE_6_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_12_CYCLE_7_H_D (1 << (122-96))
+#define GFIS_SERIAL_RS_CD_12_CYCLE_7_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_12_CYCLE_8_H_D (1 << (124-96))
+#define GFIS_SERIAL_RS_CD_12_CYCLE_8_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_12_CYCLE_9_H_D (1 << (126-96))
+#define GFIS_SERIAL_RS_CD_12_CYCLE_9_L_D 0x00000000
+
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_9_CYCLE_1_D (1 << (99-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_9_CYCLE_2_D (1 << (101-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_9_CYCLE_3_D (1 << (103-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_9_CYCLE_4_D (1 << (105-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_9_CYCLE_5_D (1 << (107-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_9_CYCLE_6_D (1 << (109-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_9_CYCLE_7_D (1 << (111-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_9_CYCLE_8_D (1 << (113-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_9_CYCLE_9_D (1 << (115-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_9_CYCLE_10_D (1 << (117-96))
+
+#define GFIS_SERIAL_RS_CD_9_CYCLE_1_H_D (1 << (100-96))
+#define GFIS_SERIAL_RS_CD_9_CYCLE_1_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_9_CYCLE_2_H_D (1 << (102-96))
+#define GFIS_SERIAL_RS_CD_9_CYCLE_2_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_9_CYCLE_3_H_D (1 << (104-96))
+#define GFIS_SERIAL_RS_CD_9_CYCLE_3_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_9_CYCLE_4_H_D (1 << (106-96))
+#define GFIS_SERIAL_RS_CD_9_CYCLE_4_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_9_CYCLE_5_H_D (1 << (108-96))
+#define GFIS_SERIAL_RS_CD_9_CYCLE_5_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_9_CYCLE_6_H_D (1 << (110-96))
+#define GFIS_SERIAL_RS_CD_9_CYCLE_6_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_9_CYCLE_7_H_D (1 << (112-96))
+#define GFIS_SERIAL_RS_CD_9_CYCLE_7_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_9_CYCLE_8_H_D (1 << (114-96))
+#define GFIS_SERIAL_RS_CD_9_CYCLE_8_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_9_CYCLE_9_H_D (1 << (116-96))
+#define GFIS_SERIAL_RS_CD_9_CYCLE_9_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_9_CYCLE_10_H_D (1 << (118-96))
+#define GFIS_SERIAL_RS_CD_9_CYCLE_10_L_D 0x00000000
+
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_8_CYCLE_1_D (1 << (96-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_8_CYCLE_2_D (1 << (98-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_8_CYCLE_3_D (1 << (100-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_8_CYCLE_4_D (1 << (102-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_8_CYCLE_5_D (1 << (104-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_8_CYCLE_6_D (1 << (106-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_8_CYCLE_7_D (1 << (108-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_8_CYCLE_8_D (1 << (110-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_8_CYCLE_9_D (1 << (112-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_8_CYCLE_10_D (1 << (114-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_8_CYCLE_11_D (1 << (116-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_8_CYCLE_12_D (1 << (118-96))
+
+#define GFIS_SERIAL_RS_CD_8_CYCLE_1_H_D (1 << (97-96))
+#define GFIS_SERIAL_RS_CD_8_CYCLE_1_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_8_CYCLE_2_H_D (1 << (99-96))
+#define GFIS_SERIAL_RS_CD_8_CYCLE_2_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_8_CYCLE_3_H_D (1 << (101-96))
+#define GFIS_SERIAL_RS_CD_8_CYCLE_3_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_8_CYCLE_4_H_D (1 << (103-96))
+#define GFIS_SERIAL_RS_CD_8_CYCLE_4_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_8_CYCLE_5_H_D (1 << (105-96))
+#define GFIS_SERIAL_RS_CD_8_CYCLE_5_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_8_CYCLE_6_H_D (1 << (107-96))
+#define GFIS_SERIAL_RS_CD_8_CYCLE_6_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_8_CYCLE_7_H_D (1 << (109-96))
+#define GFIS_SERIAL_RS_CD_8_CYCLE_7_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_8_CYCLE_8_H_D (1 << (111-96))
+#define GFIS_SERIAL_RS_CD_8_CYCLE_8_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_8_CYCLE_9_H_D (1 << (113-96))
+#define GFIS_SERIAL_RS_CD_8_CYCLE_9_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_8_CYCLE_10_H_D (1 << (115-96))
+#define GFIS_SERIAL_RS_CD_8_CYCLE_10_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_8_CYCLE_11_H_D (1 << (117-96))
+#define GFIS_SERIAL_RS_CD_8_CYCLE_11_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_8_CYCLE_12_H_D (1 << (119-96))
+#define GFIS_SERIAL_RS_CD_8_CYCLE_12_L_D 0x00000000
+
+#define GFSCMD_PERIODIC_PKT_HEADER_END 0x4000E000
+
+#define GFSCMD_I2C_PKT_HEADER_START 0x4000A000
+
+#define GF_I2C_DATA_BURST_MASK 0x000000ff
+#define GF_I2C_A_DATA_BURST0 0x00000000
+#define GF_I2C_A_DATA_BURST1 0x00000001
+#define GF_I2C_A_DATA_BURST2 0x00000002
+#define GF_I2C_A_DATA_BURST3 0x00000003
+#define GF_I2C_A_DATA_BURST4 0x00000004
+#define GF_I2C_A_DATA_BURST5 0x00000005
+#define GF_I2C_A_DATA_BURST6 0x00000006
+#define GF_I2C_A_DATA_BURST7 0x00000007
+#define GF_I2C_A_DATA_BURST8 0x00000008
+
+#define GF_HW_SW_I2C_MASK 0x00000300
+#define GF_HW_I2C 0x00000000
+#define GF_SW_I2C 0x00000100
+#define GF_I2C_B_WRITE_ID 0x00000000
+#define GF_I2C_C_READ_ID 0x00000000
+#define GFSCMD_I2C_PKT_HEADER_END 0x4000B000
+
+
+//SDIO GPIOs
+
+#define GFSCMD_GPIO_SD_INIT 0x00008f00 //One time Init SD GPIO
+#define GF_NO_DATA 0x00000000
+
+#define GFSCMD_GPIO_SD_PIN_SDGP0 0x00008f01
+#define GFSCMD_GPIO_SD_PIN_SDGP1 0x00018f01
+#define GFSCMD_GPIO_SD_PIN_CMD 0x00028f02
+#define GFSCMD_GPIO_SD_PIN_CLK 0x00038f02
+#define GFSCMD_GPIO_SD_PIN_DATA0 0x00048f00
+#define GFSCMD_GPIO_SD_PIN_DATA1 0x00048f01
+#define GFSCMD_GPIO_SD_PIN_DATA2 0x00048f02
+#define GFSCMD_GPIO_SD_PIN_DATA3 0x00048f03
+
+#define GF_GPIO_PIN_OUTPUT_ENABLE 0x00000000
+#define GF_GPIO_PIN_INPUT_ENABLE 0x00000001
+#define GF_GPIO_PIN_DISABLE 0x00000002
+#define GF_GPIO_PIN_HIGH 0x00000003
+#define GF_GPIO_PIN_LOW 0x00000004
+
+#endif //__GFDISPCMDDATA_H__
diff --git a/Start_WM/test6/inc/GFDx.h b/Start_WM/test6/inc/GFDx.h
new file mode 100755
index 00000000..cca38e76
--- /dev/null
+++ b/Start_WM/test6/inc/GFDx.h
@@ -0,0 +1,1847 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/** @file GFDx.h
+ GFSDK Display Initialization API header file.
+ */
+
+#ifndef GF_DX_H
+#define GF_DX_H
+
+#include "GFDispCmdData.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+/** @addtogroup groupDx DxAPI Display Initialization API
+
+ @ref pageDxAppNotes
+
+
+*/
+/*@{*/
+
+/** GFDxAPI color info to be used during programming GFDxErase*/
+#define GFDX_COLOR_RED 0xF800F800
+#define GFDX_COLOR_GREEN 0x07E007E0
+#define GFDX_COLOR_BLUE 0x001F001F
+
+
+
+/** GFDxAPI error code: Function not supported. */
+#define GFDX_ERROR_NO_SUPPORT (GFDX_ERROR | 2)
+/** GFDxAPI error code: Invalid attribute ID for GFDxSetAttribute() / GFDxGetAttribute(). */
+#define GFDX_ERROR_INVALID_ATTRIBUTE (GFDX_ERROR | 6)
+
+/**
+ This struct is used by GFDxGetProperty().
+ * */
+typedef struct _GFDXPROPERTY
+{
+ /** standard GF property, following info is available as cap */
+ GFPROPERTY Prop;
+ /** Not supported */
+ NvU16 LcdWidth;
+ /** Not supported */
+ NvU16 LcdHeight;
+ /** Not supported */
+ NvU16 LcdIndex;
+ /** Not supported */
+ char LcdName[18];
+ /** Not supported */
+ NvU16 SubLcdWidth;
+ /** Not supported */
+ NvU16 SubLcdHeight;
+ /** Not supported */
+ NvU16 SubLcdIndex;
+ /** Not supported */
+ char SubLcdName[18];
+
+} GFDXPROPERTY, *PGFDXPROPERTY;
+
+#define DC_P_A_BLEND_2WIN_B DC_P_B_BLEND_2WIN_A
+#define DC_P_A_BLEND_2WIN_C DC_P_B_BLEND_2WIN_C
+
+#define DC_P_C_BLEND_2WIN_A DC_P_B_BLEND_2WIN_A
+#define DC_P_C_BLEND_2WIN_B DC_P_B_BLEND_2WIN_C
+
+//#define DC_P_B_BLEND_2WIN_B DC_P_B_BLEND_2WIN_C
+#define P_B_CKEY_ENABLE_2WIN_B_CKEY0 P_B_CKEY_ENABLE_2WIN_C_CKEY0
+#define P_B_CKEY_ENABLE_2WIN_B_CKEY1 P_B_CKEY_ENABLE_2WIN_C_CKEY1
+#define P_B_BLEND_CONTROL_2WIN_B_MASK P_B_BLEND_CONTROL_2WIN_C_MASK
+#define P_B_BLEND_CONTROL_2WIN_B_ALPHA_WEIGHT P_B_BLEND_CONTROL_2WIN_C_ALPHA_WEIGHT
+#define P_B_BLEND_CONTROL_2WIN_B_DEPENDENT_WEIGHT P_B_BLEND_CONTROL_2WIN_C_DEPENDENT_WEIGHT
+#define P_B_BLEND_WEIGHT0_2WIN_B_MASK P_B_BLEND_WEIGHT0_2WIN_C_MASK
+#define P_B_BLEND_WEIGHT0_2WIN_B_SHIFT P_B_BLEND_WEIGHT0_2WIN_C_SHIFT
+#define P_B_BLEND_WEIGHT1_2WIN_B_MASK P_B_BLEND_WEIGHT1_2WIN_C_MASK
+#define P_B_BLEND_WEIGHT1_2WIN_B_SHIFT P_B_BLEND_WEIGHT1_2WIN_C_SHIFT
+
+//#define DC_P_B_BLEND_3WIN_AB DC_P_B_BLEND_3WIN_AC
+#define DC_P_A_BLEND_3WIN_BC DC_P_B_BLEND_3WIN_AC
+#define P_B_CKEY_ENABLE_3WIN_AB_CKEY0 P_B_CKEY_ENABLE_3WIN_AC_CKEY0
+#define P_B_CKEY_ENABLE_3WIN_AB_CKEY1 P_B_CKEY_ENABLE_3WIN_AC_CKEY1
+#define P_B_BLEND_CONTROL_3WIN_AB_MASK P_B_BLEND_CONTROL_3WIN_AC_MASK
+#define P_B_BLEND_CONTROL_3WIN_AB_ALPHA_WEIGHT P_B_BLEND_CONTROL_3WIN_AC_ALPHA_WEIGHT
+#define P_B_BLEND_CONTROL_3WIN_AB_DEPENDENT_WEIGHT P_B_BLEND_CONTROL_3WIN_AC_DEPENDENT_WEIGHT
+#define P_B_BLEND_WEIGHT0_3WIN_AB_MASK P_B_BLEND_WEIGHT0_3WIN_AC_MASK
+#define P_B_BLEND_WEIGHT0_3WIN_AB_SHIFT P_B_BLEND_WEIGHT0_3WIN_AC_SHIFT
+#define P_B_BLEND_WEIGHT1_3WIN_AB_MASK P_B_BLEND_WEIGHT1_3WIN_AC_MASK
+#define P_B_BLEND_WEIGHT1_3WIN_AB_SHIFT P_B_BLEND_WEIGHT1_3WIN_AC_SHIFT
+
+//#define DC_P_B_BLEND_3WIN_BC DC_P_B_BLEND_3WIN_AC
+#define DC_P_C_BLEND_3WIN_AB DC_P_B_BLEND_3WIN_AC
+#define P_B_CKEY_ENABLE_3WIN_BC_CKEY0 P_B_CKEY_ENABLE_3WIN_AC_CKEY0
+#define P_B_CKEY_ENABLE_3WIN_BC_CKEY1 P_B_CKEY_ENABLE_3WIN_AC_CKEY1
+#define P_B_BLEND_CONTROL_3WIN_BC_MASK P_B_BLEND_CONTROL_3WIN_AC_MASK
+#define P_B_BLEND_CONTROL_3WIN_BC_ALPHA_WEIGHT P_B_BLEND_CONTROL_3WIN_AC_ALPHA_WEIGHT
+#define P_B_BLEND_CONTROL_3WIN_BC_DEPENDENT_WEIGHT P_B_BLEND_CONTROL_3WIN_AC_DEPENDENT_WEIGHT
+#define P_B_BLEND_WEIGHT0_3WIN_BC_MASK P_B_BLEND_WEIGHT0_3WIN_AC_MASK
+#define P_B_BLEND_WEIGHT0_3WIN_BC_SHIFT P_B_BLEND_WEIGHT0_3WIN_AC_SHIFT
+#define P_B_BLEND_WEIGHT1_3WIN_BC_MASK P_B_BLEND_WEIGHT1_3WIN_AC_MASK
+#define P_B_BLEND_WEIGHT1_3WIN_BC_SHIFT P_B_BLEND_WEIGHT1_3WIN_AC_SHIFT
+
+/**
+ Definition of attribute ids for Set/GetAttributes()
+ */
+typedef enum _GFDXATTRIBUTES
+ {
+ /** Width of the LCD fixed (240 for a 240x320 panel) */
+ GFDX_ATTR_LCDWIDTH,
+ /** Height of the LCD fixed (320 for a 240x320 panel) */
+ GFDX_ATTR_LCDHEIGHT,
+ /** NVIDIA panel index, This function overwrites environment panel Index setting */
+ GFDX_ATTR_LCDTYPE,
+ /** Name of the panel (upto 16 chars,"PHILIPS_LP7123A") */
+ GFDX_ATTR_LCDNAME,
+ /** Width of the display area usually same as LCDWIDTH,
+ Parameters: W[15:0] */
+ GFDX_ATTR_WIDTH,
+ /** Height of the display area, can be less if emulating smaller size,
+ Parameters: H[15:0] */
+ GFDX_ATTR_HEIGHT,
+ /** set/gets width height together to avoid artifacts,
+ Parameters: W[15:0], H[31:16] */
+ GFDX_ATTR_WH_WA,
+ /** set/gets x, y start position of window A,
+ Parameters: X[15:0], Y[31:16] */
+ GFDX_ATTR_XY_POS_WA,
+ /** Color Depth Bits per pixel: 1,2,4,8,12,15(RGB555),16(RGB565), 32(ARGB888),
+ GFDX_COLOR_DEPTH_YCbCr422,
+ GFDX_COLOR_DEPTH_YUV422,
+ GFDX_COLOR_DEPTH_YCbCr420P,
+ GFDX_COLOR_DEPTH_YUV420P,
+ GFDX_COLOR_DEPTH_YUV422P,
+ GFDX_COLOR_DEPTH_YCbCr422P,
+ GFDX_COLOR_DEPTH_YCbCr422R,
+ GFDX_COLOR_DEPTH_YUV422R,
+ GFDX_COLOR_DEPTH_YCbCr422RA,
+ GFDX_COLOR_DEPTH_YUV422RA,
+ */
+ GFDX_ATTR_BPP_WA,
+ /** On/Off Horizontal & Vertical Pixel Doubling for window A,
+ Parameters: GFDXA_PIX_DBL_H, GFDXA_PIX_DBL_V or 0-Disable */
+ GFDX_ATTR_PIXEL_DBL_WA,
+ /** Start Address for Window A Buffer 0 */
+ GFDX_ATTR_ADDR_WA_B0,
+ /** Start Address for Window A Buffer 1 */
+ GFDX_ATTR_ADDR_WA_B1,
+ /** Stride for Window A Buffer 0 */
+ GFDX_ATTR_STRIDE_WA_B0,
+ /** Stride for Window A Buffer 1 */
+ GFDX_ATTR_STRIDE_WA_B1,
+ /** Enable/Disable Windows A, Parameters: 1-Enable 0-Disable */
+ GFDX_ATTR_ENABLE_WA,
+ /** Enable/Disable Buf0, Buf1, VI, GE Double Buffer (see def),
+ Parameters: GFDXA_DB_BUF0, GFDXA_DB_BUF1, GFDXA_DB_GE, GFDXA_DB_VI,
+ GFDXA_DB_EPP, GFDXA_DB_MPEGE, GFDXA_DB_HOST
+ */
+ GFDX_ATTR_DBL_BUF_WA,
+ /** Sets/Gets GC Rotate bits for window A, for internal use only */
+ GFDX_ATTR_ROTATE_BIT_WA,
+ /** Set/Get H Direction Increment/Decrement for window A, for internal use only */
+ GFDX_ATTR_H_DIRECTION_WA,
+ /** Set/Get V Direction Increment/Decrement for window A, for internal use only */
+ GFDX_ATTR_V_DIRECTION_WA,
+ /** Enable/Disable Palette for WinA */
+ GFDX_ATTR_PALETTE_EN_WA,
+ /** Set/Get Palette 666 R[31-24], G[23-16], B[15-8], Index[7-0] WinA */
+ GFDX_ATTR_PALETTE_WA,
+ /** Set/Get Palette 888 R[31-24], G[23-16], B[15-8], Index[7-0] WinA */
+ GFDX_ATTR_PALETTE888_WA,
+ /** Enable/Disable DV WinA ,
+ Parameters: GFDX_ATTR_DV_ENABLE, GFDX_ATTR_DV_DISABLE
+ */
+ GFDX_ATTR_DV_CONTROL_EN_WA,
+ /** Set/Get DV Control R[26-24], G[18-16], B[10-8] WinA */
+ GFDX_ATTR_DV_CONTROL_WA,
+ /** Color Key0 Lower range for overlay, there are two sets of color keys KEY0 & KEY1,
+ Parameters: R[23-16],G[15-8],B[7-0], Each KEY has Lower and Upper range */
+ GFDX_ATTR_COLOR_KEY0_LOWER_RANGE,
+ /** Color Key0 Upper range for overlay, there are two sets of color keys KEY0 & KEY1,
+ Parameters: R[23-16],G[15-8],B[7-0], Each KEY has Lower and Upper range */
+ GFDX_ATTR_COLOR_KEY0_UPPER_RANGE,
+ /** Color Key1 Lower range for overlay, there are two sets of color keys KEY0 & KEY1,
+ Parameters: R[23-16],G[15-8],B[7-0], Each KEY has Lower and Upper range */
+ GFDX_ATTR_COLOR_KEY1_LOWER_RANGE,
+ /** Color Key1 Upper range for overlay, there are two sets of color keys KEY0 & KEY1,
+ Parameters: R[23-16],G[15-8],B[7-0], Each KEY has Lower and Upper range */
+ GFDX_ATTR_COLOR_KEY1_UPPER_RANGE,
+ /** Color Key enbled but pixel color is not in range,
+ Parameters: GFDXA_BLEND_CONTROL_NOKEY_ALPHA_WEIGHT else 0 for Fix Weight */
+ GFDX_ATTR_COLOR_NOKEY_WA,
+ /** Weight0 for Color Key not match area,
+ Parameters: Weight0 value[7:0], if 1-bit Alpha Weight0 value = 0 */
+ GFDX_ATTR_COLOR_NOKEY_WEIGHT0_WA,
+ /** Weight1 for Color Key not match area,
+ Parameters: Weight1 value[7:0], if 1-bit Alpha Weight1 value = 1 */
+ GFDX_ATTR_COLOR_NOKEY_WEIGHT1_WA,
+ /** Color Key0 Enble/Disable for WinA,
+ Parameters: GFDXA_BLEND_COLOR_KEY0_ENABLE or GFDXA_BLEND_COLOR_KEY0_DISABLE */
+ GFDX_ATTR_COLOR_KEY0_1WIN_WA,
+ /** Color Key1 Enble/Disable for WinA,
+ Parameters: GFDXA_BLEND_COLOR_KEY1_ENABLE or GFDXA_BLEND_COLOR_KEY1_DISABLE */
+ GFDX_ATTR_COLOR_KEY1_1WIN_WA,
+ /** Blend Control for WinA where does not Overlap with other Window,
+ Parameters: GFDXA_BLEND_CONTROL_nWIN_ALPHA_WEIGHT or 0 for Fix Weight */
+ GFDX_ATTR_COLOR_1WIN_WA,
+ /** Win Blend Weight0 for CKey disabled or CKey enabled w key match area or 1-bit Alpha, Alpha 0 uses Weight0,
+ Parameters: Weight0 value[7:0], if 1-bit Alpha Weight0 value = 0 */
+ GFDX_ATTR_COLOR_1WIN_WEIGHT0_WA,
+ /** Win Blend Weight1 for CKey disabled or CKey enabled w key match area or 1-bit Alpha, Alpha 1 uses Weight1,
+ Parameters: Weight1 value[7:0], if 1-bit Alpha Weight1 value = 1 */
+ GFDX_ATTR_COLOR_1WIN_WEIGHT1_WA,
+ /** Color Key0 Enble/Disable for WinA, Overlap with WinB,
+ Parameters: GFDXA_BLEND_COLOR_KEY0_ENABLE (if 2WIN_A_CKEY1 enbled then ENABLE_2WIN_A_CKEY01
+ else 2WIN_A_CKEY0)
+ GFDXA_BLEND_COLOR_KEY0_DISABLE (if 2WIN_A_CKEY1 enbled then ENABLE_2WIN_A_CKEY1
+ else 2WIN_A_NOKEY)
+ */
+ GFDX_ATTR_COLOR_KEY0_2WIN_B_WA,
+ /** Color Key1 Enble/Disable for WinA, Overlap with WinB,
+ Parameters: GFDXA_BLEND_COLOR_KEY1_ENABLE (if 2WIN_A_CKEY1 enbled then ENABLE_2WIN_A_CKEY01
+ else 2WIN_A_CKEY1)
+ GFDXA_BLEND_COLOR_KEY1_DISABLE (if 2WIN_A_CKEY1 enbled then ENABLE_2WIN_A_CKEY0
+ else 2WIN_A_NOKEY)
+ */
+ GFDX_ATTR_COLOR_KEY1_2WIN_B_WA,
+ /** Blend Control for WinA area that overlap with WinB only
+ Parameters: GFDXA_BLEND_CONTROL_nWIN_ALPHA_WEIGHT or GFDXA_BLEND_CONTROL_nWIN_DEPENDENT_WEIGHT
+ or 0 for FIX WEIGHT
+ */
+ GFDX_ATTR_COLOR_2WIN_B_WA,
+ /** Win Blend Weight0 for CKey disabled or CKey enabled w key match area or 1-bit Alpha, Alpha 0 uses Weight0
+ Parameters: Weight0 value[7:0], if 1-bit Alpha Weight0 value = 0 */
+ GFDX_ATTR_COLOR_2WIN_B_WEIGHT0_WA,
+ /** Win Blend Weight1 for CKey disabled or CKey enabled w key match area or 1-bit Alpha, Alpha 1 uses Weight1
+ Parameters: Weight1 value[7:0], if 1-bit Alpha Weight1 value = 1 */
+ GFDX_ATTR_COLOR_2WIN_B_WEIGHT1_WA,
+ /** Color Key0 Enble/Disable for WinA, Overlap with WinC
+ Parameters: GFDXA_BLEND_COLOR_KEY0_ENABLE (if 2WIN_A_CKEY1 enbled then ENABLE_2WIN_A_CKEY01
+ else 2WIN_A_CKEY0)
+ GFDXA_BLEND_COLOR_KEY0_DISABLE (if 2WIN_A_CKEY1 enbled then ENABLE_2WIN_A_CKEY1
+ else 2WIN_A_NOKEY)
+ */
+ GFDX_ATTR_COLOR_KEY0_2WIN_C_WA,
+ /** Color Key1 Enble/Disable for WinA, Overlap with WinC
+ Parameters: GFDXA_BLEND_COLOR_KEY1_ENABLE (if 2WIN_A_CKEY1 enbled then ENABLE_2WIN_A_CKEY01
+ else 2WIN_A_CKEY1)
+ GFDXA_BLEND_COLOR_KEY1_DISABLE (if 2WIN_A_CKEY1 enbled then ENABLE_2WIN_A_CKEY0
+ else 2WIN_A_NOKEY)
+ */
+ GFDX_ATTR_COLOR_KEY1_2WIN_C_WA,
+ /** Blend Control for WinA area that overlap with WinC only
+ Parameters: GFDXA_BLEND_CONTROL_nWIN_ALPHA_WEIGHT or GFDXA_BLEND_CONTROL_nWIN_DEPENDENT_WEIGHT
+ or 0 for FIX WEIGHT
+ */
+ GFDX_ATTR_COLOR_2WIN_C_WA,
+ /** Win Blend Weight0 for CKey disabled or CKey enabled w key match area or 1-bit Alpha, Alpha 0 uses Weight0
+ Parameters: Weight0 value[7:0], if 1-bit Alpha Weight0 value = 0 */
+ GFDX_ATTR_COLOR_2WIN_C_WEIGHT0_WA,
+ /** Win Blend Weight1 for CKey disabled or CKey enabled w key match area or 1-bit Alpha, Alpha 1 uses Weight1
+ Parameters: Weight1 value[7:0], if 1-bit Alpha Weight1 value = 1 */
+ GFDX_ATTR_COLOR_2WIN_C_WEIGHT1_WA,
+ /** Color Key0 Enble/Disable for WinA, Overlap with WinA & WinC Only
+ Parameters: GFDXA_BLEND_COLOR_KEY0_ENABLE (if 3WIN_AC_CKEY1 enbled then ENABLE_3WIN_AC_CKEY01
+ else 3WIN_AC_CKEY0)
+ GFDXA_BLEND_COLOR_KEY0_DISABLE (if 3WIN_AC_CKEY1 enbled then ENABLE_3WIN_AC_CKEY1
+ else 3WIN_AC_NOKEY)
+ */
+ GFDX_ATTR_COLOR_KEY0_3WIN_BC_WA,
+ /** Color Key1 Enble/Disable for WinA, Overlap with WinA & WinC
+ Parameters: GFDXA_BLEND_COLOR_KEY1_ENABLE (if 3WIN_AC_CKEY1 enbled then ENABLE_3WIN_AC_CKEY01
+ else 3WIN_AC_CKEY1)
+ GFDXA_BLEND_COLOR_KEY1_DISABLE (if 3WIN_AC_CKEY1 enbled then ENABLE_3WIN_AC_CKEY0
+ else 3WIN_AC_NOKEY)
+ */
+ GFDX_ATTR_COLOR_KEY1_3WIN_BC_WA,
+ /** Blend Control for WinA area that overlap with WinA & WinC only
+ Parameters: GFDXA_BLEND_CONTROL_nWIN_ALPHA_WEIGHT or GFDXA_BLEND_CONTROL_nWIN_DEPENDENT_WEIGHT
+ or 0 for FIX WEIGHT
+ */
+ GFDX_ATTR_COLOR_3WIN_BC_WA,
+ /** Win Blend Weight0 for CKey disabled or CKey enabled w key match area or 1-bit Alpha, Alpha 0 uses Weight0
+ Parameters: Weight0 value[7:0], if 1-bit Alpha Weight0 value = 0 */
+ GFDX_ATTR_COLOR_3WIN_BC_WEIGHT0_WA,
+ /** Win Blend Weight1 for CKey disabled or CKey enabled w key match area or 1-bit Alpha, Alpha 1 uses Weight1
+ Parameters: Weight1 value[7:0], if 1-bit Alpha Weight1 value = 1 */
+ GFDX_ATTR_COLOR_3WIN_BC_WEIGHT1_WA,
+ /** set/gets width height together to avoid artifacts */
+ GFDX_ATTR_WH_WB,
+ /** set/gets source width height together to avoid artifacts,
+ Parameters: W[15:0], H[31:16] */
+ GFDX_ATTR_SRC_WH_WB,
+ /** set/gets x, y start position of window B,
+ Parameters: X[15:0], Y[31:16] */
+ GFDX_ATTR_XY_POS_WB,
+ /** Color Depth Bits per pixel: 1,2,4,8,12,15(RGB555),16(RGB565), 32(ARGB888),
+ GFDX_COLOR_DEPTH_YCbCr422,
+ GFDX_COLOR_DEPTH_YUV422,
+ GFDX_COLOR_DEPTH_YCbCr420P,
+ GFDX_COLOR_DEPTH_YUV420P,
+ GFDX_COLOR_DEPTH_YUV422P,
+ GFDX_COLOR_DEPTH_YCbCr422P,
+ GFDX_COLOR_DEPTH_YCbCr422R,
+ GFDX_COLOR_DEPTH_YUV422R,
+ GFDX_COLOR_DEPTH_YCbCr422RA,
+ GFDX_COLOR_DEPTH_YUV422RA,
+ */
+ GFDX_ATTR_BPP_WB,
+ /** On/Off Horizontal & Vertical Pixel Doubling for Window B,
+ Parameters: GFDXA_PIX_DBL_H, GFDXA_PIX_DBL_V or 0-Disable */
+ GFDX_ATTR_PIXEL_DBL_WB,
+ /** Upscales/Downscales window */
+ GFDX_ATTR_SCALE_WB,
+ /** Start Address for Window B Buffer 0 */
+ GFDX_ATTR_ADDR_WB_B0,
+ /** U Start Address for Window B Buffer 0 */
+ GFDX_ATTR_ADDR_U_WB_B0,
+ /** V Start Address for Window B Buffer 0 */
+ GFDX_ATTR_ADDR_V_WB_B0,
+ /** Stride for Window B Buffer 0 */
+ GFDX_ATTR_STRIDE_WB_B0,
+ /** UV Stride for Window B Buffer 0 */
+ GFDX_ATTR_STRIDE_UV_WB_B0,
+ /** Start Address for Window B Buffer 1 */
+ GFDX_ATTR_ADDR_WB_B1,
+ /** U Start Address for Window B Buffer 1 */
+ GFDX_ATTR_ADDR_U_WB_B1,
+ /** V Start Address for Window B Buffer 1 */
+ GFDX_ATTR_ADDR_V_WB_B1,
+ /** Stride for Window B Buffer 1 */
+ GFDX_ATTR_STRIDE_WB_B1,
+ /** UV Stride for Window B Buffer 1 */
+ GFDX_ATTR_STRIDE_UV_WB_B1,
+ /** Enable/Disable Windows B, Parameters: 1-Enable 0-Disable */
+ GFDX_ATTR_ENABLE_WB,
+ /** Enable/Disable Buf0, Buf1, VI, GE Double Buffer (see def),
+ Parameters: GFDXA_DB_BUF0, GFDXA_DB_BUF1, GFDXA_DB_GE, GFDXA_DB_VI,
+ GFDXA_DB_EPP, GFDXA_DB_MPEGE, GFDXA_DB_HOST
+ */
+ GFDX_ATTR_DBL_BUF_WB,
+ /** Sets/Gets GC Rotate bits for window B, for internal use only */
+ GFDX_ATTR_ROTATE_BIT_WB,
+ /** Set/Get H Direction Increment/Decrement for window B, for internal use only */
+ GFDX_ATTR_H_DIRECTION_WB,
+ /** Set/Get V Direction Increment/Decrement for window B, for internal use only */
+ GFDX_ATTR_V_DIRECTION_WB,
+ /** Enable/Disable Palette for WinB */
+ GFDX_ATTR_PALETTE_EN_WB,
+ /** Set/Get Palette 666 R[31-24], G[23-16], B[15-8], Index[7-0] WinB */
+ GFDX_ATTR_PALETTE_WB,
+ /** Set/Get Palette 888 R[31-24], G[23-16], B[15-8], Index[7-0] WinB */
+ GFDX_ATTR_PALETTE888_WB,
+ /** Enable/Disable DV WinB ,
+ Parameters: GFDX_ATTR_DV_ENABLE, GFDX_ATTR_DV_DISABLE
+ */
+ GFDX_ATTR_DV_CONTROL_EN_WB,
+ /** Set/Get DV Control R[26-24], G[18-16], B[10-8] WinB */
+ GFDX_ATTR_DV_CONTROL_WB,
+ /** Color Key enbled but pixel color is not in range
+ Parameters: GFDXA_BLEND_CONTROL_NOKEY_ALPHA_WEIGHT else 0 for Fix Weight */
+ GFDX_ATTR_COLOR_NOKEY_WB,
+ /** Weight0 for Color Key not match area
+ Parameters: Weight0 value[7:0], if 1-bit Alpha Weight0 value = 0 */
+ GFDX_ATTR_COLOR_NOKEY_WEIGHT0_WB,
+ /** Weight1 for Color Key not match area
+ Parameters: Weight1 value[7:0], if 1-bit Alpha Weight1 value = 1 */
+ GFDX_ATTR_COLOR_NOKEY_WEIGHT1_WB,
+ /** Color Key0 Enble/Disable for WinB
+ Parameters: GFDXA_BLEND_COLOR_KEY0_ENABLE or GFDXA_BLEND_COLOR_KEY0_DISABLE */
+ GFDX_ATTR_COLOR_KEY0_1WIN_WB,
+ /** Color Key1 Enble/Disable for WinB
+ Parameters: GFDXA_BLEND_COLOR_KEY1_ENABLE or GFDXA_BLEND_COLOR_KEY1_DISABLE */
+ GFDX_ATTR_COLOR_KEY1_1WIN_WB,
+ /** Blend Control for WinB where does not Overlap with other Window
+ Parameters: GFDXA_BLEND_CONTROL_nWIN_ALPHA_WEIGHT or 0 for Fix Weight */
+ GFDX_ATTR_COLOR_1WIN_WB,
+ /** Win Blend Weight0 for CKey disabled or CKey enabled w key match area or 1-bit Alpha, Alpha 0 uses Weight0
+ Parameters: Weight0 value[7:0], if 1-bit Alpha Weight0 value = 0 */
+ GFDX_ATTR_COLOR_1WIN_WEIGHT0_WB,
+ /** Win Blend Weight1 for CKey disabled or CKey enabled w key match area or 1-bit Alpha, Alpha 1 uses Weight1
+ Parameters: Weight1 value[7:0], if 1-bit Alpha Weight1 value = 1 */
+ GFDX_ATTR_COLOR_1WIN_WEIGHT1_WB,
+ /** Color Key0 Enble/Disable for WinB, Overlap with WinA
+ Parameters: GFDXA_BLEND_COLOR_KEY0_ENABLE (if 2WIN_B_CKEY1 enbled then ENABLE_2WIN_B_CKEY01
+ else 2WIN_B_CKEY0)
+ GFDXA_BLEND_COLOR_KEY0_DISABLE (if 2WIN_B_CKEY1 enbled then ENABLE_2WIN_B_CKEY1
+ else 2WIN_B_NOKEY)
+ */
+ GFDX_ATTR_COLOR_KEY0_2WIN_A_WB,
+ /** Color Key1 Enble/Disable for WinB, Overlap with WinA
+ Parameters: GFDXA_BLEND_COLOR_KEY1_ENABLE (if 2WIN_B_CKEY1 enbled then ENABLE_2WIN_B_CKEY01
+ else 2WIN_B_CKEY1)
+ GFDXA_BLEND_COLOR_KEY1_DISABLE (if 2WIN_B_CKEY1 enbled then ENABLE_2WIN_B_CKEY0
+ else 2WIN_B_NOKEY)
+ */
+ GFDX_ATTR_COLOR_KEY1_2WIN_A_WB,
+ /** Blend Control for WinB where does not Overlap with other Window
+ Parameters: GFDXA_BLEND_CONTROL_nWIN_ALPHA_WEIGHT or GFDXA_BLEND_CONTROL_nWIN_DEPENDENT_WEIGHT
+ or 0 for FIX WEIGHT
+ */
+ GFDX_ATTR_COLOR_2WIN_A_WB,
+ /** Win Blend Weight0 for CKey disabled or CKey enabled w key match area or 1-bit Alpha, Alpha 0 uses Weight0
+ Parameters: Weight0 value[7:0], if 1-bit Alpha Weight0 value = 0 */
+ GFDX_ATTR_COLOR_2WIN_A_WEIGHT0_WB,
+ /** Win Blend Weight1 for CKey disabled or CKey enabled w key match area or 1-bit Alpha, Alpha 1 uses Weight1
+ Parameters: Weight1 value[7:0], if 1-bit Alpha Weight1 value = 1 */
+ GFDX_ATTR_COLOR_2WIN_A_WEIGHT1_WB,
+ /** Color Key0 Enble/Disable for WinB, Overlap with WinC
+ Parameters: GFDXA_BLEND_COLOR_KEY0_ENABLE (if 2WIN_B_CKEY1 enbled then ENABLE_2WIN_B_CKEY01
+ else 2WIN_B_CKEY0)
+ GFDXA_BLEND_COLOR_KEY0_DISABLE (if 2WIN_B_CKEY1 enbled then ENABLE_2WIN_B_CKEY1
+ else 2WIN_B_NOKEY)
+ */
+ GFDX_ATTR_COLOR_KEY0_2WIN_C_WB,
+ /** Color Key1 Enble/Disable for WinB, Overlap with WinC
+ Parameters: GFDXA_BLEND_COLOR_KEY1_ENABLE (if 2WIN_B_CKEY1 enbled then ENABLE_2WIN_B_CKEY01
+ else 2WIN_B_CKEY1)
+ GFDXA_BLEND_COLOR_KEY1_DISABLE (if 2WIN_B_CKEY1 enbled then ENABLE_2WIN_B_CKEY0
+ else 2WIN_B_NOKEY)
+ */
+ GFDX_ATTR_COLOR_KEY1_2WIN_C_WB,
+ /** Blend Control for WinB area that overlap with WinC only
+ Parameters: GFDXA_BLEND_CONTROL_nWIN_ALPHA_WEIGHT or GFDXA_BLEND_CONTROL_nWIN_DEPENDENT_WEIGHT
+ or 0 for FIX WEIGHT
+ */
+ GFDX_ATTR_COLOR_2WIN_C_WB,
+ /** Win Blend Weight0 for CKey disabled or CKey enabled w key match area or 1-bit Alpha, Alpha 0 uses Weight0
+ Parameters: Weight0 value[7:0], if 1-bit Alpha Weight0 value = 0 */
+ GFDX_ATTR_COLOR_2WIN_C_WEIGHT0_WB,
+ /** Win Blend Weight1 for CKey disabled or CKey enabled w key match area or 1-bit Alpha, Alpha 1 uses Weight1
+ Parameters: Weight1 value[7:0], if 1-bit Alpha Weight1 value = 1 */
+ GFDX_ATTR_COLOR_2WIN_C_WEIGHT1_WB,
+ /** Color Key0 Enble/Disable for WinB, Overlap with WinA & WinC Only
+ Parameters: GFDXA_BLEND_COLOR_KEY0_ENABLE (if 3WIN_BC_CKEY1 enbled then ENABLE_3WIN_BC_CKEY01
+ else 3WIN_BC_CKEY0)
+ GFDXA_BLEND_COLOR_KEY0_DISABLE (if 3WIN_BC_CKEY1 enbled then ENABLE_3WIN_BC_CKEY1
+ else 3WIN_BC_NOKEY)
+ */
+ GFDX_ATTR_COLOR_KEY0_3WIN_AC_WB,
+ /** Color Key1 Enble/Disable for WinB, Overlap with WinA & WinC
+ Parameters: GFDXA_BLEND_COLOR_KEY1_ENABLE (if 3WIN_BC_CKEY1 enbled then ENABLE_3WIN_BC_CKEY01
+ else 3WIN_BC_CKEY1)
+ GFDXA_BLEND_COLOR_KEY1_DISABLE (if 3WIN_BC_CKEY1 enbled then ENABLE_3WIN_BC_CKEY0
+ else 3WIN_BC_NOKEY)
+ */
+ GFDX_ATTR_COLOR_KEY1_3WIN_AC_WB,
+ /** Blend Control for WinB area that overlap with WinA & WinC only
+ Parameters: GFDXA_BLEND_CONTROL_nWIN_ALPHA_WEIGHT or GFDXA_BLEND_CONTROL_nWIN_DEPENDENT_WEIGHT
+ or 0 for FIX WEIGHT
+ */
+ GFDX_ATTR_COLOR_3WIN_AC_WB,
+ /** Win Blend Weight0 for CKey disabled or CKey enabled w key match area or 1-bit Alpha, Alpha 0 uses Weight0
+ Parameters: Weight0 value[7:0], if 1-bit Alpha Weight0 value = 0 */
+ GFDX_ATTR_COLOR_3WIN_AC_WEIGHT0_WB,
+ /** Win Blend Weight1 for CKey disabled or CKey enabled w key match area or 1-bit Alpha, Alpha 1 uses Weight1
+ Parameters: Weight1 value[7:0], if 1-bit Alpha Weight1 value = 1 */
+ GFDX_ATTR_COLOR_3WIN_AC_WEIGHT1_WB,
+
+ /** set/gets width height together to avoid artifacts */
+ GFDX_ATTR_WH_WC,
+ /** set/gets source width height together to avoid artifacts,
+ Parameters: W[15:0], H[31:16] */
+ GFDX_ATTR_SRC_WH_WC,
+ /** set/gets x, y start position of window C,
+ Parameters: X[15:0], Y[31:16] */
+ GFDX_ATTR_XY_POS_WC,
+ /** Color Depth Bits per pixel: 1,2,4,8,12,15(RGB555),16(RGB565), 32(ARGB888),
+ GFDX_COLOR_DEPTH_YCbCr422,
+ GFDX_COLOR_DEPTH_YUV422,
+ GFDX_COLOR_DEPTH_YCbCr420P,
+ GFDX_COLOR_DEPTH_YUV420P,
+ GFDX_COLOR_DEPTH_YUV422P,
+ GFDX_COLOR_DEPTH_YCbCr422P,
+ GFDX_COLOR_DEPTH_YCbCr422R,
+ GFDX_COLOR_DEPTH_YUV422R,
+ GFDX_COLOR_DEPTH_YCbCr422RA,
+ GFDX_COLOR_DEPTH_YUV422RA,
+ */
+ GFDX_ATTR_BPP_WC,
+ /** Set Trigger for encode window, 0- Disable, 1- Enable, 2-single Shot*/
+ GFDX_ATTR_TRIGGER_WENC,
+ /** On/Off Horizontal & Vertical Pixel Doubling for Window C,
+ Parameters: GFDXA_PIX_DBL_H, GFDXA_PIX_DBL_V or 0-Disable */
+ GFDX_ATTR_PIXEL_DBL_WC,
+ /** Upscales/Downscales window */
+ GFDX_ATTR_SCALE_WC,
+ /** Start Address for window C Buffer 0 */
+ GFDX_ATTR_ADDR_WC_B0,
+ /** U Start Address for window C Buffer 0 */
+ GFDX_ATTR_ADDR_U_WC_B0,
+ /** V Start Address for window C Buffer 0 */
+ GFDX_ATTR_ADDR_V_WC_B0,
+ /** Stride for window C Buffer 0 */
+ GFDX_ATTR_STRIDE_WC_B0,
+ /** UV Stride for window C Buffer 0 */
+ GFDX_ATTR_STRIDE_UV_WC_B0,
+ /** Start Address for window C Buffer 1 */
+ GFDX_ATTR_ADDR_WC_B1,
+ /** U Start Address for window C Buffer 1 */
+ GFDX_ATTR_ADDR_U_WC_B1,
+ /** V Start Address for window C Buffer 1 */
+ GFDX_ATTR_ADDR_V_WC_B1,
+ /** Stride for window C Buffer 1 */
+ GFDX_ATTR_STRIDE_WC_B1,
+ /** UV Stride for window C Buffer 1 */
+ GFDX_ATTR_STRIDE_UV_WC_B1,
+ /** Enable/Disable Windows C, Parameters: 1-Enable 0-Disable */
+ GFDX_ATTR_ENABLE_WC,
+ /** Enable/Disable Buf0, Buf1, VI, GE Double Buffer (see def),
+ Parameters: GFDXA_DB_BUF0, GFDXA_DB_BUF1, GFDXA_DB_GE, GFDXA_DB_VI,
+ GFDXA_DB_EPP, GFDXA_DB_MPEGE, GFDXA_DB_HOST
+ */
+ GFDX_ATTR_DBL_BUF_WC,
+ /** Sets/Gets GC Rotate bits for window C, for internal use only */
+ GFDX_ATTR_ROTATE_BIT_WC,
+ /** Set/Get H Direction Increment/Decrement for window C, for internal use only */
+ GFDX_ATTR_H_DIRECTION_WC,
+ /** Set/Get V Direction Increment/Decrement for window C, for internal use only */
+ GFDX_ATTR_V_DIRECTION_WC,
+ /** Enable/Disable Palette for WinC */
+ GFDX_ATTR_PALETTE_EN_WC,
+ /** Set/Get Palette 666 R[31-24], G[23-16], B[15-8], Index[7-0] WinC */
+ GFDX_ATTR_PALETTE_WC,
+ /** Set/Get Palette 888 R[31-24], G[23-16], B[15-8], Index[7-0] WinC */
+ GFDX_ATTR_PALETTE888_WC,
+ /** Enable/Disable DV WinC,
+ Parameters: GFDX_ATTR_DV_ENABLE, GFDX_ATTR_DV_DISABLE
+ */
+ GFDX_ATTR_DV_CONTROL_EN_WC,
+ /** Set/Get DV Control R[26-24], G[18-16], B[10-8] WinA */
+ GFDX_ATTR_DV_CONTROL_WC,
+ /** Color Key enbled but pixel color is not in range
+ Parameters: GFDXA_BLEND_CONTROL_NOKEY_ALPHA_WEIGHT else 0 for Fix Weight */
+ GFDX_ATTR_COLOR_NOKEY_WC,
+ /** Weight0 for Color Key not match area
+ Parameters: Weight0 value[7:0], if 1-bit Alpha Weight0 value = 0 */
+ GFDX_ATTR_COLOR_NOKEY_WEIGHT0_WC,
+ /** Weight1 for Color Key not match area
+ Parameters: Weight1 value[7:0], if 1-bit Alpha Weight1 value = 1 */
+ GFDX_ATTR_COLOR_NOKEY_WEIGHT1_WC,
+ /** Color Key0 Enble/Disable for WinC
+ Parameters: GFDXA_BLEND_COLOR_KEY0_ENABLE or GFDXA_BLEND_COLOR_KEY0_DISABLE */
+ GFDX_ATTR_COLOR_KEY0_1WIN_WC,
+ /** Color Key1 Enble/Disable for WinC
+ Parameters: GFDXA_BLEND_COLOR_KEY1_ENABLE or GFDXA_BLEND_COLOR_KEY1_DISABLE */
+ GFDX_ATTR_COLOR_KEY1_1WIN_WC,
+ /** Blend Control for WinC where does not Overlap with other Window
+ Parameters: GFDXA_BLEND_CONTROL_nWIN_ALPHA_WEIGHT or 0 for Fix Weight */
+ GFDX_ATTR_COLOR_1WIN_WC,
+ /** Win Blend Weight0 for CKey disabled or CKey enabled w key match area or 1-bit Alpha, Alpha 0 uses Weight0
+ Parameters: Weight0 value[7:0], if 1-bit Alpha Weight0 value = 0 */
+ GFDX_ATTR_COLOR_1WIN_WEIGHT0_WC,
+ /** Win Blend Weight1 for CKey disabled or CKey enabled w key match area or 1-bit Alpha, Alpha 1 uses Weight1
+ Parameters: Weight1 value[7:0], if 1-bit Alpha Weight1 value = 1 */
+ GFDX_ATTR_COLOR_1WIN_WEIGHT1_WC,
+ /** Color Key0 Enble/Disable for WinC, Overlap with WinA
+ Parameters: GFDXA_BLEND_COLOR_KEY0_ENABLE (if 2WIN_C_CKEY1 enbled then ENABLE_2WIN_C_CKEY01
+ else 2WIN_C_CKEY0)
+ GFDXA_BLEND_COLOR_KEY0_DISABLE (if 2WIN_C_CKEY1 enbled then ENABLE_2WIN_C_CKEY1
+ else 2WIN_C_NOKEY)
+ */
+ GFDX_ATTR_COLOR_KEY0_2WIN_A_WC,
+ /** Color Key1 Enble/Disable for WinC, Overlap with WinA
+ Parameters: GFDXA_BLEND_COLOR_KEY1_ENABLE (if 2WIN_C_CKEY1 enbled then ENABLE_2WIN_C_CKEY01
+ else 2WIN_C_CKEY1)
+ GFDXA_BLEND_COLOR_KEY1_DISABLE (if 2WIN_C_CKEY1 enbled then ENABLE_2WIN_C_CKEY0
+ else 2WIN_C_NOKEY)
+ */
+ GFDX_ATTR_COLOR_KEY1_2WIN_A_WC,
+ /** Blend Control for WinC area that overlap with WinA only
+ Parameters: GFDXA_BLEND_CONTROL_nWIN_ALPHA_WEIGHT or GFDXA_BLEND_CONTROL_nWIN_DEPENDENT_WEIGHT
+ or 0 for FIX WEIGHT
+ */
+ GFDX_ATTR_COLOR_2WIN_A_WC,
+ /** Win Blend Weight0 for CKey disabled or CKey enabled w key match area or 1-bit Alpha, Alpha 0 uses Weight0
+ Parameters: Weight0 value[7:0], if 1-bit Alpha Weight0 value = 0 */
+ GFDX_ATTR_COLOR_2WIN_A_WEIGHT0_WC,
+ /** Win Blend Weight1 for CKey disabled or CKey enabled w key match area or 1-bit Alpha, Alpha 1 uses Weight1
+ Parameters: Weight1 value[7:0], if 1-bit Alpha Weight1 value = 1 */
+ GFDX_ATTR_COLOR_2WIN_A_WEIGHT1_WC,
+ /** Color Key0 Enble/Disable for WinC, Overlap with WinB
+ Parameters: GFDXA_BLEND_COLOR_KEY0_ENABLE (if 2WIN_C_CKEY1 enbled then ENABLE_2WIN_C_CKEY01
+ else 2WIN_C_CKEY0)
+ GFDXA_BLEND_COLOR_KEY0_DISABLE (if 2WIN_C_CKEY1 enbled then ENABLE_2WIN_C_CKEY1
+ else 2WIN_C_NOKEY)
+ */
+ GFDX_ATTR_COLOR_KEY0_2WIN_B_WC,
+ /** Color Key1 Enble/Disable for WinC, Overlap with WinB
+ Parameters: GFDXA_BLEND_COLOR_KEY1_ENABLE (if 2WIN_C_CKEY1 enbled then ENABLE_2WIN_C_CKEY01
+ else 2WIN_C_CKEY1)
+ GFDXA_BLEND_COLOR_KEY1_DISABLE (if 2WIN_C_CKEY1 enbled then ENABLE_2WIN_C_CKEY0
+ else 2WIN_C_NOKEY)
+ */
+ GFDX_ATTR_COLOR_KEY1_2WIN_B_WC,
+ /** Blend Control for WinC area that overlap with WinB only
+ Parameters: GFDXA_BLEND_CONTROL_nWIN_ALPHA_WEIGHT or GFDXA_BLEND_CONTROL_nWIN_DEPENDENT_WEIGHT
+ or 0 for FIX WEIGHT
+ */
+ GFDX_ATTR_COLOR_2WIN_B_WC,
+ /** Win Blend Weight0 for CKey disabled or CKey enabled w key match area or 1-bit Alpha, Alpha 0 uses Weight0
+ Parameters: Weight0 value[7:0], if 1-bit Alpha Weight0 value = 0 */
+ GFDX_ATTR_COLOR_2WIN_B_WEIGHT0_WC,
+ /** Win Blend Weight1 for CKey disabled or CKey enabled w key match area or 1-bit Alpha, Alpha 1 uses Weight1
+ Parameters: Weight1 value[7:0], if 1-bit Alpha Weight1 value = 1 */
+ GFDX_ATTR_COLOR_2WIN_B_WEIGHT1_WC,
+ /** Color Key0 Enble/Disable for WinC, Overlap with WinA & WinB Only
+ Parameters: GFDXA_BLEND_COLOR_KEY0_ENABLE (if 3WIN_AB_CKEY1 enbled then ENABLE_3WIN_AB_CKEY01
+ else 3WIN_AB_CKEY0)
+ GFDXA_BLEND_COLOR_KEY0_DISABLE (if 3WIN_AB_CKEY1 enbled then ENABLE_3WIN_AB_CKEY1
+ else 3WIN_AB_NOKEY)
+ */
+ GFDX_ATTR_COLOR_KEY0_3WIN_AB_WC,
+ /** Color Key1 Enble/Disable for WinC, Overlap with WinA & WinB
+ Parameters: GFDXA_BLEND_COLOR_KEY1_ENABLE (if 3WIN_AB_CKEY1 enbled then ENABLE_3WIN_AB_CKEY01
+ else 3WIN_AB_CKEY1)
+ GFDXA_BLEND_COLOR_KEY1_DISABLE (if 3WIN_AB_CKEY1 enbled then ENABLE_3WIN_AB_CKEY0
+ else 3WIN_AB_NOKEY)
+ */
+ GFDX_ATTR_COLOR_KEY1_3WIN_AB_WC,
+ /** Blend Control for WinC area that overlap with WinA & WinB only
+ Parameters: GFDXA_BLEND_CONTROL_nWIN_ALPHA_WEIGHT or GFDXA_BLEND_CONTROL_nWIN_DEPENDENT_WEIGHT
+ or 0 for FIX WEIGHT
+ */
+ GFDX_ATTR_COLOR_3WIN_AB_WC,
+ /** Win Blend Weight0 for CKey disabled or CKey enabled w key match area or 1-bit Alpha, Alpha 0 uses Weight0
+ Parameters: Weight0 value[7:0], if 1-bit Alpha Weight0 value = 0 */
+ GFDX_ATTR_COLOR_3WIN_AB_WEIGHT0_WC,
+ /** Win Blend Weight1 for CKey disabled or CKey enabled w key match area or 1-bit Alpha, Alpha 1 uses Weight1
+ Parameters: Weight1 value[7:0], if 1-bit Alpha Weight1 value = 1 */
+ GFDX_ATTR_COLOR_3WIN_AB_WEIGHT1_WC,
+ /** GC Color Key for overlay, Not supported */
+ GFDX_ATTR_COLOR_KEY,
+ /** GC Color Key Mask for overlay, Not supported */
+ GFDX_ATTR_COLOR_KEY_MASK,
+ /** Set overlap type (see def), Not supported */
+ GFDX_ATTR_OVERLAP_TYPE,
+ /** Gets VDisplay End for GE Start Window programming, Not supported */
+ GFDX_ATTR_V_DISPLAY_END,
+ /** Gets range for clock divider L=0:H=15 */
+ GFDX_ATTR_PWM0_CLK_RANGE,
+ /** Gets range for duty cycle L=0:H=255 */
+ GFDX_ATTR_PWM0_DTY_RANGE,
+ /** Controls Backlight0 clock divider for PWM0 Bits[5:0] */
+ GFDX_ATTR_PWM0_CLOCK,
+ /** Controls Backlight0 duty cycle for PWM0 Bits[7:0] */
+ GFDX_ATTR_PWM0_DUTYCY,
+ /** Gets range for clock divider L=0:H=15 */
+ GFDX_ATTR_PWM1_CLK_RANGE,
+ /** Gets range for duty cycle L=0:H=255 */
+ GFDX_ATTR_PWM1_DTY_RANGE,
+ /** Controls Backlight1 clock divider for PWM1 Bits[5:0] */
+ GFDX_ATTR_PWM1_CLOCK,
+ /** Controls Backlight1 duty cycle for PWM1 Bits[7:0] */
+ GFDX_ATTR_PWM1_DUTYCY,
+ /** LCD Type 0-Main Lcd, 1-Sub Lcd */
+ GFDX_ATTR_DISP_TYPE,
+ /** SW register 1 for program usage */
+ GFDX_ATTR_SW_REG_1,
+ /** SW register 2 for program usage */
+ GFDX_ATTR_SW_REG_2,
+ /** set/gets width height of screen encode window,
+ Parameters: W[15:0], H[31:16] */
+ GFDX_ATTR_WH_WENC,
+ /** set/gets x, y start position of screen encode window,
+ Parameters: X[15:0], Y[31:16] */
+ GFDX_ATTR_XY_POS_WENC,
+ /** Enable/Disable screen encode window. Parameters: 1-Enable 0-Disable.
+ * Please note that this sets the encode rate to its maximum value of
+ * 1.000 so if you plan to change it after enabling,
+ * use attribute GFDX_ATTR_WENC_RATE. */
+ GFDX_ATTR_ENABLE_WENC,
+ /** Get Device ID & Rev, Not supported */
+ GFDX_ATTR_DEVICE_INFO,
+ /** Enable CRC, Set Wait 1 or 2 VSync
+ Parameters: GFDXA_CRC_WAIT_VSYNC1, GFDXA_CRC_WAIT_VSYNC2, GFDXA_CRC_DISABLE
+ */
+ GFDX_ATTR_CRC_ENABLE,
+ /** Get Check Sum */
+ GFDX_ATTR_CRC_CHECK_SUM,
+ /** Not supported, Not supported */
+ GFDX_ATTR_HC_SHAPE,
+ /** load Hardware Cursor Image, Not supported */
+ GFDX_ATTR_HC_SHAPE_EXT,
+ /** set cursor hot spot, Not supported */
+ GFDX_ATTR_HC_HOTSPOT,
+ /** set foreground and background color, Not supported */
+ GFDX_ATTR_HC_COLOR,
+ /** Set Hardware Cursor new Position, Not supported */
+ GFDX_ATTR_HC_POSITION,
+ /** Enable, Disable Hardware Cursor, Not supported */
+ GFDX_ATTR_HC_SHOW,
+ /** free internal buffer, Not supported */
+ GFDX_ATTR_HC_RELEASE,
+ /** Set Start or Stop Frame
+ Parameters: GFDX_MAIN_START, GFDX_MAIN_STOP, GFDX_SUB_START, GFDX_SUB_STOP
+ */
+ GFDX_ATTR_STOP_START,
+ /** Set Start or Stop Frame
+ Parameters: GFDX_MAIN_ONE_FRAME, GFDX_SUB_ONE_FRAME
+ */
+ GFDX_ATTR_SEND_ONE_FRAME,
+ /** Set No change */
+ GFDX_ATTR_NOCHANGE,
+ /** Get Pre Init LCD Resolution Bit[0-15] Width, Bit[16-31] Height*/
+ GFDX_ATTR_PRE_INIT_LCD_RES,
+ /** NVIDIA panel index internal to API use */
+ GFDX_ATTR_INTERNAL_LCDTYPE,
+ /** Setting this attribute will bypass any hardware writes in DxAPI which go through
+ * the GFDX_CHANNEL_xx macros. The runtime environment GFSDK_DXINIT_BYPASS uses
+ * this attribue to disable hardware writes during DxSetDisplay().
+ * Parameters: GFDX_SET_WRITE_SHADOW or GFDX_CLR_WRITE_SHADOW
+ */
+ GFDX_ATTR_WRITE_SHADOW_ONLY,
+ /** Backlight0 ON GPIO LPW2 Low */
+ GFDX_ATTR_BACKLIGHT0_ON,
+ /** Backlight1 ON GPIO LM1 Low */
+ GFDX_ATTR_BACKLIGHT1_ON,
+ /** Backlight0 OFF GPIO LPW2 High */
+ GFDX_ATTR_BACKLIGHT0_OFF,
+ /** Backlight1 OFF GPIO LM1 High*/
+ GFDX_ATTR_BACKLIGHT1_OFF,
+ /** configure BACKLIGHT0 as GPIO on LPW2*/
+ GFDX_ATTR_BACKLIGHT0_CONFIGURE_GPIO,
+ /** configure BACKLIGHT1 as GPIO on LM1*/
+ GFDX_ATTR_BACKLIGHT1_CONFIGURE_GPIO,
+ /** configure BACKLIGHT0 as PWM on LPW2*/
+ GFDX_ATTR_BACKLIGHT0_CONFIGURE_PWM,
+ /** configure BACKLIGHT1 as PWM on LM1 */
+ GFDX_ATTR_BACKLIGHT1_CONFIGURE_PWM,
+
+ /** Set Stop Frame Options,
+ Parameters: GFDX_MAIN_STOP_POLARITY_HIGH, GFDX_MAIN_STOP_POLARITY_LOW, GFDX_SUB_STOP_POLARITY_HIGH
+ GFDX_SUB_STOP_POLARITY_LOW, GFDX_MAIN_STOP_INPUT_PIN_ENABLE, GFDX_MAIN_STOP_INPUT_PIN_DISABLE,
+ GFDX_SUB_STOP_INPUT_PIN_ENABLE, GFDX_SUB_STOP_INPUT_PIN_DISABLE, GFDX_STOP_WINDOW_A_NC_ENABLE,
+ GFDX_STOP_WINDOW_A_NC_DISABLE, GFDX_STOP_WINDOW_B_NC_ENABLE, GFDX_STOP_WINDOW_B_NC_DISABLE,
+ GFDX_STOP_WINDOW_B_NC_ENABLE, GFDX_STOP_WINDOW_B_NC_DISABLE
+ */
+ GFDX_ATTR_STOP_FRAME_OPTIONS,
+ /** Set Non Continuos Display */
+ GFDX_ATTR_NC_DISPLAY,
+ /** Horizontal and Vertical Filter Support Window B
+ Parameters: GFDX_H_FILTER_ENABLE, GFDX_H_FILTER_DISABLE, GFDX_V_FILTER_ENABLE, GFDX_V_FILTER_DISABLE
+ */
+ GFDX_ATTR_H_V_FILTER_WB,
+ /** Horizontal and Vertical Filter Support Window C
+ Parameters: GFDX_H_FILTER_ENABLE, GFDX_H_FILTER_DISABLE, GFDX_V_FILTER_ENABLE, GFDX_V_FILTER_DISABLE
+ */
+ GFDX_ATTR_H_V_FILTER_WC,
+
+ /** Get Supported Display Script Options
+ Parameters: GFDX_DEFAULT_TABLE, GFDX_DXAPI_SUPPORT, GFDX_FMARK_SUPPORT
+ */
+ GFDX_ATTR_DISPLAY_SCRIPT_OPTIONS,
+ /** Rate of window decode output frames when sending continuously.
+ * please note that the rate is overwritten with the maximum value (i.e. 1.000
+ * which is represented by a fixed point fraction 16.16) if you use attribute
+ * GFDX_ATTR_ENABLE_WENC, so you need to overwrite with this attribute.
+ * Parameters: any number between 0x0 and 0x10000 (i.e. 0.0 an 1.000)
+ */
+ GFDX_ATTR_WENC_RATE
+
+} GFDXATTRIBUTES;
+
+// Stop Frame Options
+#define GFDX_MAIN_STOP_POLARITY_HIGH 0x00000001
+#define GFDX_MAIN_STOP_POLARITY_LOW 0x80000001
+#define GFDX_MAIN_STOP_INPUT_PIN_ENABLE 0x00000002
+#define GFDX_MAIN_STOP_INPUT_PIN_DISABLE 0x80000002
+
+#define GFDX_SUB_STOP_POLARITY_HIGH 0x00000004
+#define GFDX_SUB_STOP_POLARITY_LOW 0x80000004
+#define GFDX_SUB_STOP_INPUT_PIN_ENABLE 0x00000006
+#define GFDX_SUB_STOP_INPUT_PIN_DISABLE 0x80000006
+
+#define GFDX_STOP_WINDOW_A_NC_ENABLE 0x00000010
+#define GFDX_STOP_WINDOW_A_NC_DISABLE 0x80000010
+#define GFDX_STOP_WINDOW_B_NC_ENABLE 0x00000011
+#define GFDX_STOP_WINDOW_B_NC_DISABLE 0x80000011
+#define GFDX_STOP_WINDOW_C_NC_ENABLE 0x00000012
+#define GFDX_STOP_WINDOW_C_NC_DISABLE 0x80000012
+
+// Horizontal and Vertical Filter Support Window B & C
+
+#define GFDX_H_FILTER_ENABLE 0x00000100
+#define GFDX_H_FILTER_DISABLE 0x80000100
+#define GFDX_V_FILTER_ENABLE 0x00004000
+#define GFDX_V_FILTER_DISABLE 0x80004000
+#define GFDX_V_FILTER_OPTIMIZE_ENABLE 0x00010000
+#define GFDX_V_FILTER_OPTIMIZE_DISABLE 0x80010000
+
+// Display Script Options
+
+#define GFDX_DEFAULT_TABLE 0x00000001
+#define GFDX_DXAPI_SUPPORT 0x00000002
+#define GFDX_FMARK_SUPPORT 0x00000004
+
+
+/** Attribute value for GFDX_ATTR_WRITE_SHADOW_ONLY.
+ * Setting this attribute will disable all channel hardware writes in DxAPI.
+ * The runtime environment GFSDK_DXINIT_BYPASS uses this attribue to disable
+ * hardware writes in DxSetDisplay().
+ */
+#define GFDX_SET_WRITE_SHADOW 0x00000001
+/** Attribute value for GFDX_ATTR_WRITE_SHADOW_ONLY.
+ * This attribute is used to clear the effect of #GFDX_SET_WRITE_SHADOW.
+ * It must be used explicitly to re-enable hardware writes in DxAPI.
+ */
+#define GFDX_CLR_WRITE_SHADOW 0x80000001
+
+
+
+#define GFDX_COLOR_DEPTH_YCbCr422 (16UL | 0x80000000)
+#define GFDX_COLOR_DEPTH_YUV422 (17UL | 0x80000000)
+#define GFDX_COLOR_DEPTH_YCbCr420P (18UL | 0x80000000)
+#define GFDX_COLOR_DEPTH_YUV420P (19UL | 0x80000000)
+#define GFDX_COLOR_DEPTH_YCbCr422P (20UL | 0x80000000)
+#define GFDX_COLOR_DEPTH_YUV422P (21UL | 0x80000000)
+#define GFDX_COLOR_DEPTH_YCbCr422R (22UL | 0x80000000)
+#define GFDX_COLOR_DEPTH_YUV422R (23UL | 0x80000000)
+#define GFDX_COLOR_DEPTH_YCbCr422RA (24UL | 0x80000000)
+#define GFDX_COLOR_DEPTH_YUV422RA (25UL | 0x80000000)
+
+#define GFDX_SWAP_MASK 0x000f0000
+#define GFDX_NO_SWAP 0x00000000
+#define GFDX_BYTE_SWAP 0x00010000
+#define GFDX_ORDER_SWAP 0x00020000
+#define GFDX_WORD_SWAP 0x00030000
+
+#define GFDX_COLOR_DEPTH_YUV422_YVYU (17UL | 0x80000000 | GFDX_NO_SWAP)
+#define GFDX_COLOR_DEPTH_YUV422_VYUY (17UL | 0x80000000 | GFDX_BYTE_SWAP)
+#define GFDX_COLOR_DEPTH_YUV422_UYVY (17UL | 0x80000000 | GFDX_ORDER_SWAP)
+#define GFDX_COLOR_DEPTH_YUV422_YUYV (17UL | 0x80000000 | GFDX_WORD_SWAP)
+
+#define GFDX_COLOR_DEPTH_YCbCr422_YVYU (16UL | 0x80000000 | GFDX_NO_SWAP)
+#define GFDX_COLOR_DEPTH_YCbCr422_VYUY (16UL | 0x80000000 | GFDX_BYTE_SWAP)
+#define GFDX_COLOR_DEPTH_YCbCr422_UYVY (16UL | 0x80000000 | GFDX_ORDER_SWAP)
+#define GFDX_COLOR_DEPTH_YCbCr422_YUYV (16UL | 0x80000000 | GFDX_WORD_SWAP)
+
+
+// Horizontal Filter Coefficients
+
+#define GF_H_P00C0 0x0
+#define GF_H_P00C1 (0x0 << 3 )
+#define GF_H_P00C2 (0x80 << 8 )
+#define GF_H_P00C3 (0x0 << 16)
+#define GF_H_P00C4 (0x0 << 24)
+#define GF_H_P00C5 (0x0 << 29)
+#define GF_H_P00CX GF_H_P00C0|GF_H_P00C1|GF_H_P00C2|GF_H_P00C3|GF_H_P00C4|GF_H_P00C5
+
+#define GF_H_P01C0 0x1
+#define GF_H_P01C1 (0x1c << 3 )
+#define GF_H_P01C2 (0x7c << 8 )
+#define GF_H_P01C3 (0x8 << 16)
+#define GF_H_P01C4 (0x1e << 24)
+#define GF_H_P01C5 (0x1 << 29)
+#define GF_H_P01CX GF_H_P01C0|GF_H_P01C1|GF_H_P01C2|GF_H_P01C3|GF_H_P01C4|GF_H_P01C5
+
+#define GF_H_P02C0 0x1
+#define GF_H_P02C1 (0x18 << 3 )
+#define GF_H_P02C2 (0x7a << 8 )
+#define GF_H_P02C3 (0x11 << 16)
+#define GF_H_P02C4 (0x1b << 24)
+#define GF_H_P02C5 (0x1 << 29)
+#define GF_H_P02CX GF_H_P02C0|GF_H_P02C1|GF_H_P02C2|GF_H_P02C3|GF_H_P02C4|GF_H_P02C5
+
+#define GF_H_P03C0 0x2
+#define GF_H_P03C1 (0x15 << 3 )
+#define GF_H_P03C2 (0x73 << 8 )
+#define GF_H_P03C3 (0x1b << 16)
+#define GF_H_P03C4 (0x19 << 24)
+#define GF_H_P03C5 (0x2 << 29)
+#define GF_H_P03CX GF_H_P03C0|GF_H_P03C1|GF_H_P03C2|GF_H_P03C3|GF_H_P03C4|GF_H_P03C5
+
+#define GF_H_P04C0 0x2
+#define GF_H_P04C1 (0x13 << 3 )
+#define GF_H_P04C2 (0x6d << 8 )
+#define GF_H_P04C3 (0x25 << 16)
+#define GF_H_P04C4 (0x17 << 24)
+#define GF_H_P04C5 (0x2 << 29)
+#define GF_H_P04CX GF_H_P04C0|GF_H_P04C1|GF_H_P04C2|GF_H_P04C3|GF_H_P04C4|GF_H_P04C5
+
+#define GF_H_P05C0 0x3
+#define GF_H_P05C1 (0x11 << 3 )
+#define GF_H_P05C2 (0x66 << 8 )
+#define GF_H_P05C3 (0x2f << 16)
+#define GF_H_P05C4 (0x15 << 24)
+#define GF_H_P05C5 (0x2 << 29)
+#define GF_H_P05CX GF_H_P05C0|GF_H_P05C1|GF_H_P05C2|GF_H_P05C3|GF_H_P05C4|GF_H_P05C5
+
+#define GF_H_P06C0 0x3
+#define GF_H_P06C1 (0x11 << 3 )
+#define GF_H_P06C2 (0x5e << 8 )
+#define GF_H_P06C3 (0x38 << 16)
+#define GF_H_P06C4 (0x13 << 24)
+#define GF_H_P06C5 (0x3 << 29)
+#define GF_H_P06CX GF_H_P06C0|GF_H_P06C1|GF_H_P06C2|GF_H_P06C3|GF_H_P06C4|GF_H_P06C5
+
+#define GF_H_P07C0 0x3
+#define GF_H_P07C1 (0x10 << 3 )
+#define GF_H_P07C2 (0x55 << 8 )
+#define GF_H_P07C3 (0x43 << 16)
+#define GF_H_P07C4 (0x12 << 24)
+#define GF_H_P07C5 (0x3 << 29)
+#define GF_H_P07CX GF_H_P07C0|GF_H_P07C1|GF_H_P07C2|GF_H_P07C3|GF_H_P07C4|GF_H_P07C5
+
+#define GF_H_P08C0 0x3
+#define GF_H_P08C1 (0x11 << 3 )
+#define GF_H_P08C2 (0x4c << 8 )
+#define GF_H_P08C3 (0x4c << 16)
+#define GF_H_P08C4 (0x11 << 24)
+#define GF_H_P08C5 (0x3 << 29)
+#define GF_H_P08CX GF_H_P08C0|GF_H_P08C1|GF_H_P08C2|GF_H_P08C3|GF_H_P08C4|GF_H_P08C5
+
+#define GF_H_P09C0 0x3
+#define GF_H_P09C1 (0x12 << 3 )
+#define GF_H_P09C2 (0x43 << 8 )
+#define GF_H_P09C3 (0x55 << 16)
+#define GF_H_P09C4 (0x10 << 24)
+#define GF_H_P09C5 (0x3 << 29)
+#define GF_H_P09CX GF_H_P09C0|GF_H_P09C1|GF_H_P09C2|GF_H_P09C3|GF_H_P09C4|GF_H_P09C5
+
+#define GF_H_P0AC0 0x3
+#define GF_H_P0AC1 (0x13 << 3 )
+#define GF_H_P0AC2 (0x38 << 8 )
+#define GF_H_P0AC3 (0x5e << 16)
+#define GF_H_P0AC4 (0x11 << 24)
+#define GF_H_P0AC5 (0x3 << 29)
+#define GF_H_P0ACX GF_H_P0AC0|GF_H_P0AC1|GF_H_P0AC2|GF_H_P0AC3|GF_H_P0AC4|GF_H_P0AC5
+
+#define GF_H_P0BC0 0x2
+#define GF_H_P0BC1 (0x15 << 3 )
+#define GF_H_P0BC2 (0x2f << 8 )
+#define GF_H_P0BC3 (0x66 << 16)
+#define GF_H_P0BC4 (0x11 << 24)
+#define GF_H_P0BC5 (0x3 << 29)
+#define GF_H_P0BCX GF_H_P0BC0|GF_H_P0BC1|GF_H_P0BC2|GF_H_P0BC3|GF_H_P0BC4|GF_H_P0BC5
+
+#define GF_H_P0CC0 0x2
+#define GF_H_P0CC1 (0x17 << 3 )
+#define GF_H_P0CC2 (0x25 << 8 )
+#define GF_H_P0CC3 (0x6d << 16)
+#define GF_H_P0CC4 (0x13 << 24)
+#define GF_H_P0CC5 (0x2 << 29)
+#define GF_H_P0CCX GF_H_P0CC0|GF_H_P0CC1|GF_H_P0CC2|GF_H_P0CC3|GF_H_P0CC4|GF_H_P0CC5
+
+#define GF_H_P0DC0 0x2
+#define GF_H_P0DC1 (0x19 << 3 )
+#define GF_H_P0DC2 (0x1b << 8 )
+#define GF_H_P0DC3 (0x73 << 16)
+#define GF_H_P0DC4 (0x15 << 24)
+#define GF_H_P0DC5 (0x2 << 29)
+#define GF_H_P0DCX GF_H_P0DC0|GF_H_P0DC1|GF_H_P0DC2|GF_H_P0DC3|GF_H_P0DC4|GF_H_P0DC5
+
+#define GF_H_P0EC0 0x1
+#define GF_H_P0EC1 (0x1b << 3 )
+#define GF_H_P0EC2 (0x11 << 8 )
+#define GF_H_P0EC3 (0x7a << 16)
+#define GF_H_P0EC4 (0x18 << 24)
+#define GF_H_P0EC5 (0x1 << 29)
+#define GF_H_P0ECX GF_H_P0EC0|GF_H_P0EC1|GF_H_P0EC2|GF_H_P0EC3|GF_H_P0EC4|GF_H_P0EC5
+
+#define GF_H_P0FC0 0x1
+#define GF_H_P0FC1 (0x1e << 3 )
+#define GF_H_P0FC2 (0x8 << 8 )
+#define GF_H_P0FC3 (0x7c << 16)
+#define GF_H_P0FC4 (0x1c << 24)
+#define GF_H_P0FC5 (0x1 << 29)
+#define GF_H_P0FCX GF_H_P0FC0|GF_H_P0FC1|GF_H_P0FC2|GF_H_P0FC3|GF_H_P0FC4|GF_H_P0FC5
+
+// Vertical Filter Coefficients
+#define GF_V_P00C0 0x80
+#define GF_V_P01C0 0x78
+#define GF_V_P02C0 0x70
+#define GF_V_P03C0 0x68
+#define GF_V_P04C0 0x60
+#define GF_V_P05C0 0x58
+#define GF_V_P06C0 0x50
+#define GF_V_P07C0 0x48
+#define GF_V_P08C0 0x40
+#define GF_V_P09C0 0x38
+#define GF_V_P0AC0 0x30
+#define GF_V_P0BC0 0x28
+#define GF_V_P0CC0 0x20
+#define GF_V_P0DC0 0x18
+#define GF_V_P0EC0 0x10
+#define GF_V_P0FC0 0x8
+
+/** Hardware Cursor definition */
+typedef struct _HC_COLOR
+{
+ NvU32 foreground;
+ NvU32 background;
+} HC_COLOR, *PHC_COLOR;
+
+typedef struct _HC_POSITION
+{
+ NvU32 x;
+ NvU32 y;
+} HC_POSITION, *PHC_POSITION;
+
+typedef struct _HC_HOTSPOT
+{
+ NvU32 x;
+ NvU32 y;
+} HC_HOTSPOT, *PHC_HOTSPOT;
+
+enum
+{
+ CD64X64,
+ CD32X32
+};
+
+typedef struct _HC_MASK
+{
+ NvU32 *data;
+ NvU32 size;
+ NvU32 dimension;
+} HC_MASK, *PHC_MASK;
+
+typedef struct _DisplayTimingEntry
+{
+ /** Horizontal Ref. Need not to be changed, set 0 for default setting */
+ NvU16 usHRef;
+ /** Vertical Ref. Need not to be changed, set 0 for default setting */
+ NvU16 usVRef;
+ /** Horizontal Sync Width, set 0 for default setting */
+ NvU16 usHSyncWidth;
+ /** Vertical Sync Width, set 0 for default setting */
+ NvU16 usVSyncWidth;
+ /** Horizontal Back Porch, set 0 for default setting */
+ NvU16 usHBackPorch;
+ /** Vertical Back Porch, set 0 for default setting */
+ NvU16 usVBackPorch;
+ /** Horizontal Active, Set same as Window Width */
+ NvU16 usHActive;
+ /** Vertical Active, Set same as Window Height */
+ NvU16 usVActive;
+ /** Horizontal Total, set 0 for default setting */
+ NvU16 usHTotal;
+ /** Vertical Total, set 0 for default setting */
+ NvU16 usVTotal;
+ /** Window Width */
+ NvU16 usPanelVX;
+ /** Window Height */
+ NvU16 usPanelVY;
+ /** Window Start X Position */
+ NvU16 usPosX;
+ /** Window Start Y Position */
+ NvU16 usPosY;
+ /** Window Sel 0-WinA (GFDX_DISPTMG_SEL_WINA), 1-WinB (GFDX_DISPTMG_SEL_WINB) */
+ NvU16 SelWin;
+ NvU16 Reserved1;
+ NvU16 Reserved2;
+ NvU16 Reserved3;
+} DISPLAYTIMINGENTRY, *PDISPLAYTIMINGENTRY;
+
+// Display Timing
+
+#define GFDX_DISPTMG_SEL_WINA 0
+#define GFDX_DISPTMG_SEL_WINB 1
+
+/** redefine some of the constants for compatibility */
+#define GFDX_ATTR_WIDTH_HEIGHT GFDX_ATTR_WH_WA
+#define GFDX_ATTR_XY_POSITION GFDX_ATTR_XY_POS_WA
+#define GFDX_ATTR_BPP GFDX_ATTR_BPP_WA
+#define GFDX_ATTR_PIXEL_DOUBLE GFDX_ATTR_PIXEL_DBL_WA
+#define GFDX_ATTR_STARTADDR GFDX_ATTR_ADDR_WA_B0
+#define GFDX_ATTR_STRIDE GFDX_ATTR_STRIDE_WA_B0
+
+/** definition of GFDX_ATTR_PIXEL_DOUBLE */
+#define GFDXA_PIX_DBL_H 0x01 /* Horizontal pixel doubling on */
+#define GFDXA_PIX_DBL_V 0x02 /* Vertical pixel doubling on */
+
+/** definition of GFDX_ATTR_DOUBLE_BUF control (0,2,1,3 is same as hw) */
+#define GFDXA_DB_BUF0 0x00 /* GC display buffer address is from buf0 */
+#define GFDXA_DB_BUF1 0x02 /* GC display buffer address is from buf1 */
+#define GFDXA_DB_HOST 0x06 /* GC display buffer address is from Host */
+#define GFDXA_DB_GE 0x01 /* GC display buffer address is from GE */
+#define GFDXA_DB_VI 0x03 /* GC display buffer address is from VI */
+#define GFDXA_DB_EPP 0x04
+#define GFDXA_DB_MPEGE 0x05
+
+/** definition of GFDX_ATTR_ROTATE_BIT_W? */
+#define GFDXA_ROTATE_BITS_0 0x00000000 // no rotation, x+,y+,startAddr = 0
+#define GFDXA_ROTATE_BITS_90 0x00000500 // +90 (anti-clock), x-, y+, start= stride-3 (TL)
+#define GFDXA_ROTATE_BITS_180 0x00000300 // +180(anti-clock), x-, y-, start= height*stride-3 (BR)
+#define GFDXA_ROTATE_BITS_270 0x00000600 // +270(anti-clock), x+, y-, start= (height-1)*stride (BL)
+
+/** definition of Color Key and Alpha Blending*/
+#define GFDXA_BLEND_CONTROL_NOKEY_ALPHA_WEIGHT 0x00000001
+
+#define GFDXA_BLEND_COLOR_KEY0_ENABLE 0x00000001
+#define GFDXA_BLEND_COLOR_KEY1_ENABLE 0x00000002
+#define GFDXA_BLEND_COLOR_KEY0_DISABLE 0x00000000
+#define GFDXA_BLEND_COLOR_KEY1_DISABLE 0x00000000
+#define GFDXA_BLEND_CONTROL_nWIN_ALPHA_WEIGHT 0x00000004
+#define GFDXA_BLEND_CONTROL_nWIN_DEPENDENT_WEIGHT 0x00000008
+
+/** Disable CRC capture. */
+#define GFDXA_CRC_DISABLE 0x00000000
+/** Wait for 1 VSYNC and capture CRC for one frame. */
+#define GFDXA_CRC_WAIT_VSYNC1 0x00000001
+/** Wait for 2 VSYNC and capture CRC for one frame. */
+#define GFDXA_CRC_WAIT_VSYNC2 0x00000003
+
+/** Set Direction for Rotation*/
+#define GFDX_ATTR_H_DIRECTION_DECREMENT 0x00000001
+#define GFDX_ATTR_H_DIRECTION_INCREMENT 0x00000000
+#define GFDX_ATTR_V_DIRECTION_DECREMENT 0x00000004
+#define GFDX_ATTR_V_DIRECTION_INCREMENT 0x00000000
+
+/** definition of Palette Enable/Disable*/
+#define GFDX_ATTR_PALETTE_ENABLE 0x00010000
+#define GFDX_ATTR_PALETTE_DISABLE 0x00000000
+#define GFDX_ATTR_DV_ENABLE 0x00100000
+#define GFDX_ATTR_DV_DISABLE 0x00000000
+
+#define GFDX_ATTR_WENC_DISABLE 0x00000000
+#define GFDX_ATTR_WENC_ENABLE 0x00000001
+#define GFDX_ATTR_WENC_TRIG_DISABLE 0x00000000
+#define GFDX_ATTR_WENC_TRIG_ENABLE 0x00000001
+#define GFDX_ATTR_WENC_TRIG_ONE_SHOT 0x00000002
+
+/** Read CRC Check Sum */
+#define GFDXA_CRC_READ_CHECK_SUM 0x00000001
+
+/**
+ Sub-LCD support
+ */
+#define LCD_MAIN 0
+#define LCD_SUB 1
+#define MAX_LCD 2
+
+/**
+ Start-Stop Frame support
+ */
+#define GFDX_MAIN_START 0x00000001
+#define GFDX_MAIN_STOP 0x00000002
+#define GFDX_SUB_START 0x00000003
+#define GFDX_SUB_STOP 0x00000004
+#define GFDX_MAIN_ONE_FRAME 0x00000001
+#define GFDX_SUB_ONE_FRAME 0x00000002
+
+#define GF_DISPLAY_NORMAL 0x00000000
+#define GF_DISPLAY_PARTIAL 0x00000001
+
+#ifdef PROJECT_SEC_G1
+#define GF_DISPLAY_NTSC_V570 0x00000002
+#define GF_DISPLAY_NTSC_V490 0x00000003
+#define GF_DISPLAY_NTSC_V700 0x00000004
+#define GF_DISPLAY_PAL 0x00000005
+#endif
+
+/**
+ DxEnableDisplay support
+ */
+#define GF_PANEL_DRV_ONOFF 0x00000100
+#define GF_PANEL_DRV_SLP_WKUP 0x00000200
+
+/**
+ Clock selections, profile and options
+ */
+#define GFDX_OSC 0x00000001
+#define GFDX_ROSC 0x00000002
+#define GFDX_PLL1 0x00000003
+#define GFDX_PLL_QUERY 0x80000000
+#define GFDX_POWER 0x00010000
+#define GFDX_PERFORMANCE 0x00020000
+
+/**
+ Option for GFDxVSync: Waits until vertical blank (default).
+ */
+#define GFDX_VSYNC_WAIT 0x0000
+/**
+ Option for GFDxVSync: Checks and immediately returns vertical blank status.
+ Returns GF_SUCCESS if in vertical blank, else returns GF_ERROR.
+ */
+#define GFDX_VSYNC_CHECK 0x0001
+/**
+ Option for GFDxVSync: Puts Wait token in the command FIFO and the CPU returns
+ immediately. Uses FRAME_END interrupt bit.
+ */
+#define GFDX_VSYNC_HW_WAIT 0x0002
+/**
+ Option for GFDxVSync: Raise and wait in the command fifo for VBLANK.
+ */
+#define GFDX_VBLANK_HW_WAIT 0x0003
+/**
+ Option for GFDxVSync: Raise and wait in the command fifo for VPULSE3.
+ */
+#define GFDX_VPULSE3_HW_WAIT 0x0004
+
+/** Dx Hardware has multiple windows (some registers are replicated per
+ window - the window must be exlicitly selected to write to the correct
+ register in the window). Use this enum to select which window
+ to write to for APIs that support this - window selection is mostly
+ done through the attribute name, eg: _WA, _WB, etc.
+ */
+typedef enum _GFDXWINDOWSELECT
+{
+ DX_WINDOW_SELECT_NONE = 0,
+ DX_WINDOW_SELECT_NORMAL = 1, /* all windows */
+ DX_WINDOW_SELECT_A = 2,
+ DX_WINDOW_SELECT_B = 4,
+ DX_WINDOW_SELECT_C = 8
+} GFDXWINDOWSELECT;
+
+/** Color Space Conversion coefficients. Use GFDxSetCSCCoeff() and
+ GFDxGetCSCCoeff() to write/read the coefficients to/from hardware.
+ */
+typedef struct _GFDXCSCCOEFF
+{
+ NvU32 YOF;
+ NvU32 KYRGB;
+ NvU32 KUR;
+ NvU32 KVR;
+ NvU32 KUG;
+ NvU32 KVG;
+ NvU32 KUB;
+ NvU32 KVB;
+} GFDXCSCCOEF;
+
+typedef struct _DXSCRIPTCMD
+{
+ NvU32 ScriptCmdType; /** Script Command */
+ NvU32 DataBurstCount; /** Burst count 0-255, not Valid for GFSCMD */
+ NvU32 PanelDriverCmd; /** Valid Only if ScriptCmdType = GFPDRV_CMD */
+ NvU32 *PanelIndexData; /** Data pointer */
+ NvU32 GFData; /** Valid only if ScriptCmdType is GFSCMD */
+ NvU32 reserved1;
+} DXSCRIPTCMD, *PDXSCRIPTCMD;
+
+typedef struct _GFLCDTABLE {
+ /** For usage see GFDxSetDisplay()*/
+ GF_RETTYPE (* DxSetDisplay)(GFDxHandle DxHandle, int lcdSel, NvU32 ulStartAddr,
+ NvU32 ulStride, unsigned bpp);
+ /** For usage see GFDxEnableDisplay()*/
+ GF_RETTYPE (* DxEnableDisplay)(GFDxHandle DxHandle, int lcdSel, unsigned bOn);
+ /** For usage see GFDxSetAttribute()*/
+ GF_RETTYPE (* DxSetAttribute)(GFDxHandle DxHandle, int lcdSel, unsigned aid, NvU32 attr);
+ /** For usage see GFDxGetAttribute()*/
+ GF_RETTYPE (* DxGetAttribute)(GFDxHandle DxHandle, int lcdSel, unsigned aid, NvU32 *attr);
+ /** For usage see GFDxSetAttributeWithCS()*/
+ GF_RETTYPE (* DxSetAttributeWithCS)(GFDxHandle DxHandle, int lcdSel, unsigned aid, NvU32 attr);
+ /** For usage see GFDxGetAttributeWithCS()*/
+ GF_RETTYPE (* DxGetAttributeWithCS)(GFDxHandle DxHandle, int lcdSel, unsigned aid, NvU32 *attr);
+ /** For usage see GFDxRotate()*/
+ GF_RETTYPE (* DxRotate)(GFDxHandle DxHandle, int lcdSel, unsigned nRotate, NvU32 ulStartAddr);
+ /** For usage see GFDxErase()*/
+ GF_RETTYPE (* DxErase)(GFDxHandle DxHandle, int lcdSel, NvU32 ulStartAddr, NvU32 color);
+ /** For usage see GFDxSwitchLCD()*/
+ GF_RETTYPE (* DxSwitchLCD)(GFDxHandle DxHandle, int lcdSel, int Option);
+ /** LCD Configurations */
+ void * pLcdConfig;
+ /** For usage see GFDxScriptCmd()*/
+ GF_RETTYPE (* DxScriptCmd)(GFDxHandle DxHandle, int lcdSel, PDXSCRIPTCMD pDxScriptCmd, NvU32 Option);
+ /** For usage see GFDxScriptCmdWithCS()*/
+ GF_RETTYPE (* DxScriptCmdWithCS)(GFDxHandle DxHandle, int lcdSel, PDXSCRIPTCMD pDxScriptCmd, NvU32 Option);
+ /** For usage see GFDxDisplayTiming()*/
+ GF_RETTYPE (* DxDisplayTiming)(GFDxHandle DxHandle, int lcdSel, PDISPLAYTIMINGENTRY pDxTiming, NvU32 Option);
+ /** For usage see GFDxDisplayTimingWithCS()*/
+ GF_RETTYPE (* DxDisplayTimingWithCS)(GFDxHandle DxHandle, int lcdSel, PDISPLAYTIMINGENTRY pDxTiming, NvU32 Option);
+ /** For usage see GFDxSetDisplayEx()*/
+ GF_RETTYPE (* DxSetDisplayEx)(GFDxHandle DxHandle, int lcdSel, NvU32 ulStartAddr,
+ NvU32 ulStride, unsigned bpp, unsigned bOn);
+} GFLCDTABLE;
+
+/* Publicly exposed DX API function table */
+typedef struct _GFDXTABLE
+{
+ /** For usage see GFDxGetProperty()*/
+ GF_RETTYPE (* DxGetProperty)(GFDxHandle DxHandle, PGFDXPROPERTY pDxProp);
+ /** For usage see GFDxVSync()*/
+ GF_RETTYPE (* DxVSync)(GFDxHandle DxHandle, NvU16 option);
+ /** For usage see GFDxSetDisplayWithCS()*/
+ GF_RETTYPE (* DxSetDisplayWithCS)(GFDxHandle DxHandle, int lcdSel,
+ NvU32 ulStartAddr, NvU32 ulStride, unsigned bpp);
+ /** For usage see GFDxEnableDisplayWithCS()*/
+ GF_RETTYPE (* DxEnableDisplayWithCS)(GFDxHandle DxHandle, int lcdSel,
+ unsigned bOn);
+// Removed to make the WinCE dll binary compatible with SC4 dll.
+// GF_RETTYPE (* DxHSync)(GFDxHandle DxHandle, NvU16 option);
+
+ /** For per LCD functions. ()*/
+ GFLCDTABLE Lcd[MAX_LCD];
+ /** For usage see GFDxEraseWithCS()*/
+ GF_RETTYPE (* DxEraseWithCS)(GFDxHandle DxHandle, int lcdSel,
+ NvU32 ulStartAddr, NvU32 color);
+ /** For usage see GFDxSetCSCCoeff()*/
+ GF_RETTYPE (* DxSetCSCCoeff)( GFDxHandle DxHandle, GFDXWINDOWSELECT window,
+ GFDXCSCCOEF *coef );
+ /** For usage see GFDxGetCSCCoeff()*/
+ GF_RETTYPE (* DxGetCSCCoeff)( GFDxHandle DxHandle, GFDXWINDOWSELECT window,
+ GFDXCSCCOEF *coef );
+ /** For usage see GFDxVSyncWithCS()*/
+ GF_RETTYPE (* DxVSyncWithCS)(GFDxHandle DxHandle, NvU16 option);
+ /** For usage see GFDxSetCSCCoeffWithCS()*/
+ GF_RETTYPE (* DxSetCSCCoeffWithCS)( GFDxHandle DxHandle, GFDXWINDOWSELECT window,
+ GFDXCSCCOEF *coef );
+ /** For usage see GFDxGetCSCCoeffWithCS()*/
+ GF_RETTYPE (* DxGetCSCCoeffWithCS)( GFDxHandle DxHandle, GFDXWINDOWSELECT window,
+ GFDXCSCCOEF *coef );
+ /** For usage see GFDxSetDisplayExWithCS()*/
+ GF_RETTYPE (* DxSetDisplayExWithCS)(GFDxHandle DxHandle, int lcdSel,
+ NvU32 ulStartAddr, NvU32 ulStride, unsigned bpp, unsigned bOn);
+} GFDXTABLE, *PGFDXTABLE;
+
+/** Filter coefficients */
+typedef struct GFDxHorizontalFilter_t
+{
+ NvU32 filter[16];
+} GFDxHorizontalFilter;
+
+typedef struct GFDxVerticalFilter_t
+{
+ NvU32 filter[16];
+} GFDxVerticalFilter;
+
+/**
+ Typesafe function for opening Dx component.
+ This function is implicitly called by the resource manager (GFRm) in response
+ to an applications call to GFRmComponentGet() for the GFDxAPI
+ component. It is not supposed to be called by an application. It is included
+ here only for the purpose of GFDxAPI source code customization.
+
+ @param hrm (GFRmHandle) Handle to Rm component.
+ @param phDx (GFDxHandle *) Handle to Dx component.
+ @param state (GF_STATE_TYPE)
+ @param hCh (GFRmChHandle) Handle to Channel.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+ */
+GF_RETTYPE GFDxOpen(GFRmHandle hRm, GFDxHandle *phDx,
+ GF_STATE_TYPE state, GFRmChHandle hCh);
+
+/**
+ Typesafe function for closing Dx component.
+ This function is implicitly called by the resource manager (GFRm) in response
+ to an applications call to GFRmComponentGet() for the GFDxAPI
+ component. It is included here only for the purpose of GFDxAPI source code
+ customization.
+
+ @param phDx (GFDxHandle *) Handle to Dx component.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+ *
+*/
+void GFDxClose(GFDxHandle *phDx);
+
+/**
+ This funtion returns the fixed properties of the display hardware.
+
+ @param DxHandle (GFDxHandle) Handle to Dx Component
+ @param pDxProp (PGFDXPROPERTY) See #GFDXPROPERTY
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+ */
+#define GFDxGetProperty( handle, pDxProp ) \
+ ((PGFDXTABLE)handle)->DxGetProperty( handle, pDxProp )
+
+/**
+ This functions waits for a vertical sync and returns to the caller.
+ IMPORTANT NOTE: This function is now identical to the WithCS version
+ of it (i.e. it has Critical Sections and is multi-thread safe) as the
+ WithCS version is being phased out.
+
+ @param DxHandle (GFDxHandle) Handle to Dx Component.
+ @param option (NvU16) Search for Option for GFDxVSync for more info.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+ */
+#define GFDxVSync(handle, option) \
+ ((PGFDXTABLE)handle)->DxVSync( handle, option )
+
+/**
+ IMPORTANT NOTE: This function is being phased out. The critical
+ section functionality now exists in GFDxVSync().
+ */
+#define GFDxVSyncWithCS(handle, option) \
+ ((PGFDXTABLE)handle)->DxVSyncWithCS( handle, option )
+
+/**
+ IMPORTANT NOTE: This function is not available.
+ */
+#define GFDxHSync(handle, option) \
+ ((PGFDXTABLE)handle)->DxHSync( handle, option )
+
+/**
+ This function initializes the main LCD or sub-LCD display.
+ IMPORTANT NOTE: This function is now identical to the WithCS version
+ of it (i.e. it has Critical Sections and is multi-thread safe) as the
+ WithCS version is being phased out.
+
+ @param Handle (DxHandle) Handle to Dx Component.
+ @param lcdSel (int) 0 for LCD_MAIN.
+ 1 for LCD_SUB.
+ @param ulStartAddr (NvU32) display start address for main or sub-LCD (should be set to 0).
+ GFDxSetAttribute() should be called to set the display start
+ address for the main LCD or sub-LCD.
+ @param ulStride (NvU32) Default stride if 0; otherwise use the passed value.
+ GFDxSetAttribute() should be called to set the display stride
+ for the main LCD or sub-LCD.
+ @param bpp (unsigned) Default should be 16 bits/pixel for main LCD or sub-LCD.
+ GFDxSetAttribute() should be called to set the display bpp for
+ the main LCD or sub-LCD.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+ */
+#define GFDxSetDisplay( handle, lcdSel, ulStartAddr, ulStride, bpp ) \
+ ((PGFDXTABLE)handle)->Lcd[lcdSel].DxSetDisplay( handle, lcdSel, ulStartAddr, ulStride, bpp )
+
+/**
+ IMPORTANT NOTE: This function is being phased out. The critical
+ section functionality now exists in GFDxSetDisplay().
+ */
+#define GFDxSetDisplayWithCS( handle, lcdSel, ulStartAddr, ulStride, bpp ) \
+ ((PGFDXTABLE)handle)->DxSetDisplayWithCS( handle, lcdSel, ulStartAddr, \
+ ulStride, bpp )
+
+/**
+ This function initializes the main LCD or sub-LCD display.
+ IMPORTANT NOTE: This function extends GFDxSetDisplay() function by adding an option to enable/disable
+ the LCD display.
+
+ @param Handle (DxHandle) Handle to Dx Component.
+ @param lcdSel (int) 0 for LCD_MAIN.
+ 1 for LCD_SUB.
+ @param ulStartAddr (NvU32) display start address for main or sub-LCD (should be set to 0).
+ GFDxSetAttribute() should be called to set the display start
+ address for the main LCD or sub-LCD.
+ @param ulStride (NvU32) Default stride if 0; otherwise use the passed value.
+ GFDxSetAttribute() should be called to set the display stride
+ for the main LCD or sub-LCD.
+ @param bpp (unsigned) Default should be 16 bits/pixel for main LCD or sub-LCD.
+ GFDxSetAttribute() should be called to set the display bpp for
+ the main LCD or sub-LCD.
+ @param bOn (unsigned) 1 to Enable Display,
+ 0 to disable Display.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+ */
+#define GFDxSetDisplayEx( handle, lcdSel, ulStartAddr, ulStride, bpp, bOn ) \
+ ((PGFDXTABLE)handle)->Lcd[lcdSel].DxSetDisplayEx( handle, lcdSel, ulStartAddr, ulStride, bpp, bOn )
+
+/**
+ IMPORTANT NOTE: This function is being phased out. The critical
+ section functionality now exists in GFDxSetDisplayEx().
+ */
+#define GFDxSetDisplayExWithCS( handle, lcdSel, ulStartAddr, ulStride, bpp, bOn ) \
+ ((PGFDXTABLE)handle)->DxSetDisplayExWithCS( handle, lcdSel, ulStartAddr, \
+ ulStride, bpp, On)
+
+/**
+ This function enables/disables LCD display with proper power sequencing.
+ IMPORTANT NOTE: This function is now identical to the WithCS version
+ of it (i.e. it has Critical Sections and is multi-thread safe) as the
+ WithCS version is being phased out.
+
+ @param Handle (DxHandle) Handle to Dx Component.
+ @param lcdSel (int) 0 for LCD_MAIN.
+ 1 for LCD_SUB.
+ @param bOn (unsigned) Bit0: 1 to Enable Display,
+ 0 to disable Display.
+ Also Option for Panel Driver On/Off
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+ */
+#define GFDxEnableDisplay( handle, lcdSel, bOn ) \
+ ((PGFDXTABLE)handle)->Lcd[lcdSel].DxEnableDisplay( handle, lcdSel, bOn )
+
+/**
+ IMPORTANT NOTE: This function is being phased out. The critical
+ section functionality now exists in GFDxEnableDisplay().
+ */
+#define GFDxEnableDisplayWithCS( handle, lcdSel, bOn ) \
+ ((PGFDXTABLE)handle)->DxEnableDisplayWithCS( handle, lcdSel, bOn )
+
+/**
+ GFDxSetAttribute() sets the display attributes for a main panel or
+ subpanel. All the GFDxAPI attributes should be set after the
+ GFDxSetDisplay()
+ IMPORTANT NOTE: This function is now identical to the WithCS version
+ of it (i.e. it has Critical Sections and is multi-thread safe) as the
+ WithCS version is being phased out.
+
+ @param DxHandle (GFDxHandle) Handle to Dx Component.
+ @param lcdSel (int) 0 for LCD_MAIN.
+ 1 for LCD_SUB.
+ @param aid (unsigned) Attribute IDs. See #GFDXATTRIBUTES Enumeration Type
+ @param attr (NvU32) Attribute value for main LCD or sub-LCD. Should be
+ written with attribute ID in aid.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+ */
+#define GFDxSetAttribute( handle, lcdSel, aid, attr) \
+ ((PGFDXTABLE)handle)->Lcd[lcdSel].DxSetAttribute( handle, lcdSel, aid, attr )
+
+/**
+ Execute script command from DxApiTable. Send cmd/data to panel.
+ IMPORTANT NOTE: This function is now identical to the WithCS version
+ of it (i.e. it has Critical Sections and is multi-thread safe) as the
+ WithCS version is being phased out.
+
+ @param DxHandle (GFDxHandle) Handle to Dx Component.
+ @param lcdSel (int) 0 for LCD_MAIN.
+ 1 for LCD_SUB.
+ @param ScriptCmdType (PDXSCRIPTCMD) Script Command
+ @param Option (NvU32) Reserved, not used.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+ */
+#define GFDxScriptCmd( handle, lcdSel, pDxScriptCmd, Option) \
+ ((PGFDXTABLE)handle)->Lcd[lcdSel].DxScriptCmd( handle, lcdSel, pDxScriptCmd, Option )
+
+/**
+ IMPORTANT NOTE: This function is being phased out. The critical
+ section functionality now exists in GFDxScriptCmd().
+ */
+#define GFDxScriptCmdWithCS( handle, lcdSel, pDxScriptCmd, Option) \
+ ((PGFDXTABLE)handle)->Lcd[lcdSel].DxScriptCmdWithCS( handle, lcdSel, pDxScriptCmd, Option )
+
+/** Sets the timing registers.
+ IMPORTANT NOTE: This function is now identical to the WithCS version
+ of it (i.e. it has Critical Sections and is multi-thread safe) as the
+ WithCS version is being phased out.
+
+ @param DxHandle (GFDxHandle) Handle to Dx Component.
+ @param lcdSel (int) 0 for LCD_MAIN.
+ 1 for LCD_SUB.
+ @param pDxTiming (PDISPLAYTIMINGENTRY) See #PDISPLAYTIMINGENTRY.
+ @param Option (NvU32) GF_DISPLAY_PARTIAL or GF_DISPLAY_NORMAL.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+ */
+#define GFDxDisplayTiming( handle, lcdSel, pDxTiming, Option) \
+ ((PGFDXTABLE)handle)->Lcd[lcdSel].DxDisplayTiming( handle, lcdSel, pDxTiming, Option )
+
+/**
+ IMPORTANT NOTE: This function is being phased out. The critical
+ section functionality now exists in GFDxDisplayTiming().
+ */
+#define GFDxDisplayTimingWithCS( handle, lcdSel, pDxTiming, Option) \
+ ((PGFDXTABLE)handle)->Lcd[lcdSel].DxDisplayTimingWithCS( handle, lcdSel, pDxTiming, Option )
+
+/**
+ This function returns the bit depth, the destination stride, the start address,
+ the associated surface of the display buffer, or the graphics command
+ execution control. The location of the returned attribute value is pointed to by
+ attr.
+ IMPORTANT NOTE: This function is now identical to the WithCS version
+ of it (i.e. it has Critical Sections and is multi-thread safe) as the
+ WithCS version is being phased out.
+
+ @param DxHandle (GFDxHandle) Handle to Dx Component.
+ @param lcdSel (int) 0 for LCD_MAIN.
+ 1 for LCD_SUB.
+ @param aid (unsigned) Attribute ID. see #GFDXATTRIBUTES.
+ @param attr (NvU32 *) pointer to attribute value.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+ */
+#define GFDxGetAttribute( handle, lcdSel, aid, pAttr) \
+ ((PGFDXTABLE)handle)->Lcd[lcdSel].DxGetAttribute( handle, lcdSel, aid, pAttr )
+
+/**
+ IMPORTANT NOTE: This function is being phased out. The critical
+ section functionality now exists in GFDxSetAttribute().
+ */
+#define GFDxSetAttributeWithCS( handle, lcdSel, aid, attr) \
+ ((PGFDXTABLE)handle)->Lcd[lcdSel].DxSetAttributeWithCS( handle, lcdSel, aid, attr )
+
+/**
+ IMPORTANT NOTE: This function is being phased out. The critical
+ section functionality now exists in GFDxGetAttribute().
+ */
+#define GFDxGetAttributeWithCS( handle, lcdSel, aid, pAttr) \
+ ((PGFDXTABLE)handle)->Lcd[lcdSel].DxGetAttributeWithCS( handle, lcdSel, aid, pAttr )
+
+/**
+ IMPORTANT NOTE: this function is not available.
+ */
+#define GFDxRotate( handle, lcdSel, nRotate, ulStartAddr ) \
+ ((PGFDXTABLE)handle)->Lcd[lcdSel].DxRotate( handle, lcdSel, nRotate, ulStartAddr )
+
+/**
+ This function clears the main or subdisplay screen with the given color. It also
+ clears the display buffer of the main or subpanel window. Window A buffer 0
+ is used as a display buffer.
+ IMPORTANT NOTE: This function is now identical to the WithCS version
+ of it (i.e. it has Critical Sections and is multi-thread safe) as the
+ WithCS version is being phased out.
+
+ @param DxHandle (GFDxHandle) Handle to Dx Component.
+ @param lcdSel (int) 0 for LCD_MAIN.
+ 1 for LCD_SUB.
+ @param ulStartAddr (NvU32) Start Address. (The offset in bytes of the
+ display frame buffer.)
+ @param color (NvU32) Clear screen with this color. The 32-bit value
+ has a 16-bit color duplicated in the upper and
+ lower parts.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+ */
+#define GFDxErase( handle, lcdSel, ulStartAddr, color ) \
+ ((PGFDXTABLE)handle)->Lcd[lcdSel].DxErase( handle, lcdSel, ulStartAddr, color )
+
+/**
+ IMPORTANT NOTE: This function is being phased out. The critical
+ section functionality now exists in GFDxErase().
+ */
+#define GFDxEraseWithCS( handle, lcdSel, ulStartAddr, color ) \
+ ((PGFDXTABLE)handle)->DxEraseWithCS( handle, lcdSel, ulStartAddr, color )
+
+/**
+ This function enables swithcing between the main LCD and sub-LCD.
+ IMPORTANT NOTE: This function has critical sections and is thread-safe.
+
+ @param DxHandle (GFDxHandle) Handle to Dx Component.
+ @param lcdSel (int) 0 for LCD_MAIN.
+ 1 for LCD_SUB.
+ @param Option (NvU32) 0 for switch (Must be set to 0)
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+ */
+#define GFDxSwitchLCD( handle, lcdSel, Option ) \
+ ((PGFDXTABLE)handle)->Lcd[lcdSel].DxSwitchLCD( handle, lcdSel, Option )
+
+/**
+ This function sets the hardware Color Space Conversion (CSC) Coefficients.
+ IMPORTANT NOTE: This function is now identical to the WithCS version
+ of it (i.e. it has Critical Sections and is multi-thread safe) as the
+ WithCS version is being phased out.
+
+ @param DxHandle (GFDxHandle) Handle to Dx Component.
+ @param window (GFDXWINDOWSELECT) Controller window. see #GFDXWINDOWSELECT.
+ @param coef (GFDXCSCCOEF *) CSC coefficients. see #GFDXCSCCOEF.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+ */
+#define GFDxSetCSCCoeff( handle, window, coef ) \
+ ((PGFDXTABLE)handle)->DxSetCSCCoeff( handle, window, coef )
+
+/**
+ This function gets the hardware Color Space Conversion (CSC) Coefficients.
+ IMPORTANT NOTE: This function is now identical to the WithCS version
+ of it (i.e. it has Critical Sections and is multi-thread safe) as the
+ WithCS version is being phased out.
+
+ @param DxHandle (GFDxHandle) Handle to Dx Component.
+ @param window (GFDXWINDOWSELECT) Controller window. see #GFDXWINDOWSELECT.
+ @param coef (GFDXCSCCOEF *) CSC coefficients. see #GFDXCSCCOEF.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+ */
+#define GFDxGetCSCCoeff( handle, window, coef ) \
+ ((PGFDXTABLE)handle)->DxGetCSCCoeff( handle, window, coef )
+
+/**
+ IMPORTANT NOTE: This function is being phased out. The critical
+ section functionality now exists in GFDxSetCSCCoeff().
+ */
+#define GFDxSetCSCCoeffWithCS( handle, window, coef ) \
+ ((PGFDXTABLE)handle)->DxSetCSCCoeffWithCS( handle, window, coef )
+
+/**
+ IMPORTANT NOTE: This function is being phased out. The critical
+ section functionality now exists in GFDxGetCSCCoeff().
+ */
+#define GFDxGetCSCCoeffWithCS( handle, window, coef ) \
+ ((PGFDXTABLE)handle)->DxGetCSCCoeffWithCS( handle, window, coef )
+/*@}*/
+
+/** GFDxSetDefaultPanelMode - sets the default mode for multi-mode panels.
+
+ @param handle A handle to a Dx instance
+ @param mode The panel mode
+
+ Some panels support multiple modes. To support mode switching, the
+ default panel mode must be known.
+ */
+GF_RETTYPE
+GFDxSetDefaultPanelMode( GFDxHandle handle, NvU32 mode );
+
+/** GFDxSwitchPanelMode - switch from the current mode to a new mode.
+
+ @param handle A handle to a Dx instance
+ @param mode The panel mode
+
+ This switches from the current mode to a new mode. This calls a display
+ script with the name "SwitchMode__to_" where x is the current mode
+ and y is the new mode.
+ */
+GF_RETTYPE
+GFDxSwitchPanelMode( GFDxHandle handle, NvU32 mode );
+
+/** GFDxSPIRegEnable - enable register reads and writes over SPI.
+
+ @param handle A handle to a Dx instance
+ @param enable Either enable or disable register read/writes.
+
+ Enabling SPI register reads/writes may change the pin mapping which
+ may prevent the rest of the display api from behaving properly (pixel
+ data may no longer output to the panel). Disabling will restore
+ the pin mapping.
+ */
+void
+GFDxSpiRegEnable( GFDxHandle handle, NvBool enable );
+
+/** GFDxSPIRegWrite - write a 16 bit register over SPI.
+
+ @param handle A handle to a Dx instance
+ @param address The address to write
+ @param data The data to write
+ */
+GF_RETTYPE
+GFDxSpiRegWrite( GFDxHandle handle, NvU16 address, NvU16 data );
+
+/** GFDxSPIRegRead - read a 16 bit register over SPI.
+
+ @param handle A handle to a Dx instance
+ @param address The address to read from
+ @param data The data to read (out param)
+ */
+GF_RETTYPE
+GFDxSpiRegRead( GFDxHandle handle, NvU16 address, NvU16 *data );
+
+/** GFDxSpiPixelInit - send init sequence to the panel and setup the pixel
+ write hardware.
+
+ @param handle A handle to a Dx instance
+ @param seq_data_a The first 32 bits of init data
+ @param seq_data_b The second 32 bits of init data
+ @param seq_data_c The third 32 bits of init data
+ @param seq_data_d The fourth 32 bits of init data
+
+ Note that this only support SPI16 mode, msb2lsb data ordering.
+
+ Some panels may need the init sequence before every frame, in which
+ case, this should always be called before GFDxSpiPixelWrite().
+ */
+GF_RETTYPE
+GFDxSpiPixelInit( GFDxHandle handle, NvU32 seq_data_a,
+ NvU32 seq_data_b, NvU32 seq_data_c, NvU32 seq_data_d );
+
+/** GFDxSpiPixelWrite - writes the given pixel to the panel over SPI.
+
+ @param handle A handle to a Dx instance
+ @param pixel The pixels to write
+ */
+GF_RETTYPE
+GFDxSpiPixelWrite( GFDxHandle handle, NvUPtr pixels );
+
+/** GFDxSpiScript - send commands to the spi hardware via an in-memory script.
+
+ @param handle A handle to a Dx instance
+ @param script The script to execute
+ */
+GF_RETTYPE
+GFDxSpiScript( GFDxHandle handle, NvU32 *script );
+
+/** GFDxSetPixelClock - sets the pixel clock divider in half step increments.
+
+ @param handle A handle to the Dx instance
+ @param divider The pixel clock divider (actually shift clock - pixel clock
+ will be the same as shift clock)
+
+ Note: the divider is in half step increments: 1 = 1, 2 = 1.5, 3 = 2, etc.
+ */
+GF_RETTYPE
+GFDxSetPixelClock( GFDxHandle handle, NvU32 divider );
+
+/** GFDxGetPixelClock - gets the current shift clock divider value.
+
+ @param handle A handle to the Dx instance
+ @param divider The pixel clock divider (actually shift clock - pixel clock
+ will be the same as shift clock)
+
+ */
+GF_RETTYPE
+GFDxGetPixelClock( GFDxHandle handle, NvU32 *divider );
+
+/** GFDxSetFilter - sets the window filtering coefficients.
+
+ @param handle A handle to the Dx instance
+ @param window The target window for the new coefficients
+ @param hfilter The horizontal filtering coefficients
+ @param vfilter The vertical filtering coefficients
+
+ Window A does NOT support filtering.
+ Window C only supports horizontal filtering (the vfilter param must be
+ null)
+ Window B supports both h and v filtering
+
+ Passing null to both h and v filter will disabling filtering.
+
+ DX_WINDOW_SELECT_NONE and DX_WINDOW_SELECT_NORMAL should not be used.
+ */
+GF_RETTYPE
+GFDxSetFilter( GFDxHandle handle, GFDXWINDOWSELECT window,
+ GFDxHorizontalFilter *hfilter, GFDxVerticalFilter *vfilter );
+
+#ifdef PROJECT_SEC_G1
+/** GFDxSetFilter - sets the clock and timing to support focus TV encoder.
+
+ @param handle A handle to the Dx instance
+ @param option The Normal/NTSC/PAL mode to set
+ */
+GF_RETTYPE
+GFDxSetMode( GFDxHandle handle, NvU32 option );
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+/** @page pageDxAppNotes DxAPI Application Notes
+
+ @section pageDxAppNotes1 Todo
+
+*/
+
+#endif /* GF_DX_H */
diff --git a/Start_WM/test6/inc/GFEPP.h b/Start_WM/test6/inc/GFEPP.h
new file mode 100755
index 00000000..36d28219
--- /dev/null
+++ b/Start_WM/test6/inc/GFEPP.h
@@ -0,0 +1,89 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/** @file GFEPP.h
+ GFSDK EPP API
+*/
+
+#ifndef __GFEPP_H__
+#define __GFEPP_H__
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+/** @addtogroup groupEPP EPPAPI EPP API
+*/
+/*@{*/
+
+typedef struct _GFEPPBUFFERINFO
+{
+ NvU32 flag;
+ PGFRECT pSrcRect;
+ void *pLine;
+ NvU32 alphaValue;
+ NvU32 numofSurfs;
+ PGFRMSURFACE *ppSurf;
+} GFEPPBUFFERINFO, *PEPPBUFFERINFO;
+
+
+// Typesafe functions for opening and closing this component
+GF_RETTYPE GFEPPOpen(GFRmHandle hRm, GFEPPHandle *phEPP,
+ GF_STATE_TYPE state, GFRmChHandle hCh);
+void GFEPPClose(GFEPPHandle *phEPP);
+
+GF_RETTYPE GFEPPSetBuffers(GFEPPHandle EPPHandle, PEPPBUFFERINFO pBuf);
+GF_RETTYPE GFEPPRaiseBuffer(GFEPPHandle EPPHandle, NvU32, NvU32* pCmdS, NvU32* pIndex);
+GF_RETTYPE GFEPPRaiseFrame(GFEPPHandle EPPHandle, NvU32, NvU32* pCmdS, NvU32* pIndex);
+
+
+#define EPPBUFFERINFO_FLAG_SRC_VI 0x00000001
+ //incoming video from VI
+#define EPPBUFFERINFO_FLAG_SRC_SB 0x00000002
+ //incoming video from SB
+#define EPPBUFFERINFO_FLAG_SRC_GC 0x00000003
+ //incoming video from display
+#define EPPBUFFERINFO_FLAG_SRC_MASK 0x0000000F
+
+#define EPPBUFFERINFO_FLAG_SRC_VI_YUV444 0x00000010
+ //incoming video from VI
+#define EPPBUFFERINFO_FLAG_SRC_VI_BAYER 0x00000020
+ //incoming video from VI, Raw Bayer data
+#define EPPBUFFERINFO_FLAG_SRC_VI_RGB 0x00000030
+ //incoming video from VI, Raw RGB data
+#define EPPBUFFERINFO_FLAG_SRC_VI_MASK 0x000000F0
+
+#define EPPBUFFERINFO_FLAG_PRE_PROC 0x00000100
+ //pre process filter enable
+#define EPPBUFFERINFO_FLAG_AVERAGE 0x00000200
+ //enable average for 420 planar or 444 to 422 conversion.
+#define EPPBUFFERINFO_FLAG_C_SIGN 0x00000400
+ //chroma sign
+#define EPPBUFFERINFO_FLAG_DMA 0x00000800
+ //enable DMA
+#define EPPBUFFERINFO_FLAG_DUP 0x00001000
+ //duplicate
+#define EPPBUFFERINFO_FLAG_H_DIRECTION 0x00002000
+#define EPPBUFFERINFO_FLAG_V_DIRECTION 0x00004000
+#define EPPBUFFERINFO_FLAG_XY_SWAP 0x00008000
+
+#define EPPBUFFERINFO_FLAG_SRC_SB_YUV 0x00010000
+#define EPPBUFFERINFO_FLAG_SRC_SB_RGB 0x00020000
+#define EPPBUFFERINFO_FLAG_SRC_SB_MASK 0x000F0000
+
+ //BE CAREFUL WITH THE STRIDE PROGRAMMING!
+
+/*@}*/
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // _GFEPP_H_
diff --git a/Start_WM/test6/inc/GFFDev.h b/Start_WM/test6/inc/GFFDev.h
new file mode 100755
index 00000000..6826085b
--- /dev/null
+++ b/Start_WM/test6/inc/GFFDev.h
@@ -0,0 +1,321 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/** @file GFFDev.h
+ GFSDK File Device API header file.
+*/
+
+#ifndef __GFFDEV_H__
+#define __GFFDEV_H__
+
+#include "nvtypes.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+/** @addtogroup groupFDev FDevAPI File Device API
+
+ @ref pageFDevAppNotes
+
+ @ref pageFDevAppNotes1
+
+
+*/
+/*@{*/
+
+/** FDev capability flag.
+ @see GFFDevMount()
+ */
+#define GFFDEV_CAP_STANDARD 0x00010000 /**< Standard C Library */
+
+/** FDev capability flag.
+ @see GFFDevMount()
+ */
+#define GFFDEV_CAP_DEVICE_SD 0x00000001 /**< SD Device Supported */
+
+/** FDev capability flag.
+ @see GFFDevMount()
+ */
+#define GFFDEV_CAP_FAT 0x00020000 /**< Fat FileSystem */
+
+/** FDev capability flag.
+ @see GFFDevMount()
+ */
+#define GFFDEV_CAP_DEVICE_MASK 0x00000FFF
+
+/** FDev capability flag - default on the selected OS.
+ Linux, Windows -> Standard, else -> SD
+ @see GFFDevMount()
+ */
+#if !NVOS_IS_WINDOWS && !NVOS_IS_LINUX
+#define GFFDEV_CAP_DEFAULT_FOR_OS GFFDEV_CAP_DEVICE_SD
+#else
+#define GFFDEV_CAP_DEFAULT_FOR_OS GFFDEV_CAP_STANDARD
+#endif
+
+/** Parameter enum for GFFDevSeekFile.
+ @see GFFDevSeekFile
+ */
+typedef enum
+{
+ GFFDEV_SEEK_SET = 0, /**< Set fileHandle relative to beginning of file */
+ GFFDEV_SEEK_CUR, /**< Set fileHandle relative to specified offset location */
+ GFFDEV_SEEK_END /**< Set fileHandle relative to end of file */
+} GFFDEVSEEKTYPE;
+
+/** Public File Info structure.
+ Matches Microsoft's struct _finddata_t .
+
+ @see FDevFindFirstFile()
+ @see FDevFindNextFile()
+ */
+typedef struct _GFFDEVFILEINFO
+{
+ unsigned attrib;
+ NvU32 time_create; /**< -1 for FAT file systems */
+ NvU32 time_access; /**< -1 for FAT file systems */
+ NvU32 time_write;
+ NvU32 size;
+ char name[260];
+} GFFDEVFILEINFO, *PGFFDEVFILEINFO;
+
+// Typesafe functions for opening and closing this component
+GF_RETTYPE GFFDevOpen(GFRmHandle hRm, GFFDevHandle *phFDev,
+ GF_STATE_TYPE state, GFRmChHandle hCh);
+void GFFDevClose(GFFDevHandle *phFDev);
+
+/** @name Functions
+@{*/
+
+/** Mounts a filesystem.
+ @param FDevHandle (#GFFDevHandle) Handle to FDev API
+ @param capType (NvU32) capability type
+
+ The filesystem pointed to by #FDevHandle will be mounted based on
+ the #capType.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Error
+ */
+GF_RETTYPE GFFDevMount(GFFDevHandle FDevHandle, NvU32 capType);
+
+/** Unmounts a mounted filesystem.
+ @param FDevHandle (#GFFDevHandle) Handle to FDev API
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Error
+*/
+GF_RETTYPE GFFDevUnmount(GFFDevHandle FDevHandle);
+
+/** Opens a file.
+ @param FDevHandle (#GFFDevHandle) Handle to FDev API
+ @param fileName (const char *) name of the file
+ @param fileSpec (const char *) read/write/etc flags
+ @param pFileHandle (#GFFDevFileHandle) Pointer to the handle of the opened file -
+ will be filled in by #GFFDevOpenFile()
+
+ Opens a file on the mounted filesystem with #fileName. Open flags,
+ given by #fileSpec, are the same as libc's fopen.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Error
+ */
+GF_RETTYPE GFFDevOpenFile(GFFDevHandle FDevhandle,
+ const char *fileName,
+ const char *fileSpec,
+ GFFDevFileHandle *pFileHandle);
+
+/** Closes an open file.
+ @param FDevHandle (#GFFDevHandle) Handle to FDev API
+ @param pFileHandle (#GFFDevFileHandle *) Pointer to the open file
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Error
+ */
+GF_RETTYPE GFFDevCloseFile(GFFDevHandle FDevhandle,
+ GFFDevFileHandle *pFileHandle);
+
+/** Reads data from a file.
+ @param FDevHandle (#GFFDevHandle) Handle to FDev API
+ @param fileHandle (#GFFDevFileHandle) Handle to the open file
+ @param pReadBuf (void *) Buffer for file bytes
+ @param pCount (NvU32 *) Pointer to number of bytes to read, will be
+ written to the actual number of bytes read.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Error
+ */
+GF_RETTYPE GFFDevReadFile(GFFDevHandle FDevhandle,
+ GFFDevFileHandle fileHandle,
+ void * pReadBuf,
+ NvU32 *pCount);
+
+/** Writes data to an open file.
+ @param FDevHandle (#GFFDevHandle) Handle to FDev API
+ @param fileHandle (#GFFDevFileHandle) Handle to open file
+ @param pWriteBuf (void *) pointer to bytes to write to the file
+ @param pCount (NvU32 *) pointer to number of bytes to write, will
+ be written to actual number of bytes written.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Error
+ */
+GF_RETTYPE GFFDevWriteFile(GFFDevHandle FDevHandle,
+ GFFDevFileHandle fileHandle,
+ void * pWriteBuf,
+ NvU32 *pCount );
+
+/** Sets the file read/write position.
+ @param FDevHandle (#GFFDevHandle) Handle to FDev API
+ @param fileHandle (#GFFDevFileHandle) Handle to open file
+ @param offset (NvS32) offset to be used with #where
+ @param where (#GFFDEVSEEKTYPE) file offset base
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Error
+ */
+GF_RETTYPE GFFDevSeekFile(GFFDevHandle FDevHandle,
+ GFFDevFileHandle fileHandle,
+ NvS32 offset,
+ GFFDEVSEEKTYPE where);
+
+/** Gets the current file position.
+ @param FDevHandle (#GFFDevHandle) Handle to FDev API
+ @param fileHandle (#GFFDevFileHandle) Handle to open file
+ @param pOffset (NvU32 *) pointer to offset, will be filled in
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Error
+ */
+GF_RETTYPE GFFDevTellFile(GFFDevHandle FDevHandle,
+ GFFDevFileHandle fileHandle,
+ NvU32 *pOffset);
+
+/** Gets the file size.
+ @param FDevHandle (#GFFDevHandle) Handle to FDev API
+ @param fileName (#GFFDevFileHandle) Handle of open file
+ @param pSize (NvU32 *) pointer to file size, will be filled in.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Error
+ */
+GF_RETTYPE GFFDevGetFileSize(GFFDevHandle FDevHandle,
+ const char *fileName,
+ NvU32 *pSize);
+
+/** Renames a file.
+ @param FDevHandle (#GFFDevHandle) Handle to FDev API
+ @param oldFileName (const char *) name of existing file
+ @param newFileName (const char *) name to which to rename the file
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Error
+ */
+GF_RETTYPE GFFDevRenameFile(GFFDevHandle FDevHandle,
+ const char *oldFileName,
+ const char *newFileName);
+
+/** Removes a file from the filesystem
+ @param FDevHandle (#GFFDevHandle) Handle to FDev API
+ @param fileName (#GFFDevFileHandle) Handle of open file
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Error
+ */
+GF_RETTYPE GFFDevDeleteFile(GFFDevHandle FDevHandle,
+ const char *fileName);
+
+/** Gets the first file in a directory.
+ @param FDevHandle (#GFFDevHandle) Handle to FDev API
+ @param dirName (const char *) Name of the directory to enumerate
+ @param pFileInfo (#GFFDEVFILEINFO *) pointer to the file info for the
+ first file
+ @param pDirHandle (#GFFDevDirHandle *) pointer to the handle to the directory
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Error
+ */
+GF_RETTYPE GFFDevFindFirstFile(GFFDevHandle FDevHandle,
+ const char *dirName,
+ GFFDEVFILEINFO *pFileInfo,
+ GFFDevDirHandle *pDirHandle);
+
+/** Gets the next file in the directory.
+ @param FDevHandle (#GFFDevHandle) Handle to FDev API
+ @param pFileInfo (#GFFDEVFILEINFO *) pointer ot the info for the next file
+ @param pDirHandle (#GFFDevDirHandle *) pointer to the directory handle
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Error
+ */
+GF_RETTYPE GFFDevFindNextFile(GFFDevHandle FDevHandle,
+ GFFDEVFILEINFO *pFileInfo,
+ GFFDevDirHandle *pDirHandle);
+
+/** Closes the directory.
+ @param FDevHandle (#GFFDevHandle) Handle to FDev API
+ @param pDirHandle (#GFFDevDirHandle *) pointer to the directory handle
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Error
+ */
+GF_RETTYPE GFFDevFindCloseFile(GFFDevHandle FDevHandle,
+ GFFDevDirHandle *pdirHandle);
+
+/** Flushes all buffered data to the file.
+ @param FDevHandle (#GFFDevHandle) Handle to FDev API
+ @param fileName (#GFFDevFileHandle) Handle of open file
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Error
+ */
+GF_RETTYPE GFFDevFlushFile(GFFDevHandle FDevHandle,
+ GFFDevFileHandle fileHandle);
+
+/** Gets the filesystem blocks for the file.
+ @param FDevHandle (#GFFDevHandle) Handle to FDev API
+ @param fileName (#GFFDevFileHandle) Handle of open file
+ @param size (NvU32) size of the file
+ @param ppBlockList (#PGFBLOCKLIST *) block list to be allocated
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Error
+ */
+GF_RETTYPE GFFDevBlockListAlloc(GFFDevHandle FDevHandle,
+ GFFDevFileHandle fileHandle,
+ NvU32 size,
+ PGFBLOCKLIST *ppBlockList );
+
+/** Gets the FDev API properties
+ @param FDevHandle (#GFFDevHandle) Handle to FDev API
+ @param pBlockList (#PGFBLOCKLIST) Block list to deallocate
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Error
+ */
+GF_RETTYPE GFFDevBlockListFree(GFFDevHandle FDevHandle,
+ PGFBLOCKLIST pBlockList );
+
+/*@}*/
+/*@}*/
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+/** @page pageFDevAppNotes FDevAPI Application Notes
+
+ @section pageFDevAppNotes1 Todo
+
+*/
+
+#endif /* __GFFDEV_H__ */
+
diff --git a/Start_WM/test6/inc/GFGx.h b/Start_WM/test6/inc/GFGx.h
new file mode 100755
index 00000000..5a974df4
--- /dev/null
+++ b/Start_WM/test6/inc/GFGx.h
@@ -0,0 +1,1927 @@
+/*
+ * Copyright (c) 2005 - 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software and related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an express
+ * license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+/** @file GFGx.h
+ GFSDK Graphics API header file.
+*/
+
+#ifndef __GFGx_H__
+#define __GFGx_H__
+
+#include "GFRm.h"
+
+/* GFGxAPI error codes */
+#include "GFGxError.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+
+/** @addtogroup groupGx GxAPI Graphics API
+*/
+ /*
+ @ref pageGxAppNotes
+
+
+ */
+
+/*@{*/
+
+/**** GX CAPABILITIES DEFINITIONS ****/
+
+/** GFGxAPI capability definition : bitblt support.
+ @see GFGxGetProperty()
+*/
+#define GFGX_CAP_BLT 0x00000001UL // BitBlt
+/** GFGxAPI capability definition : linedraw support.
+ @see GFGxGetProperty()
+*/
+#define GFGX_CAP_LINE 0x00000002UL // Line draw
+/** GFGxAPI capability definition : clipping support.
+ @see GFGxGetProperty()
+*/
+#define GFGX_CAP_CLIP 0x00000004UL // Clipping
+/** GFGxAPI capability definition : stretchblt support.
+ @see GFGxGetProperty()
+*/
+#define GFGX_CAP_STRETCHBLT 0x00000008UL // StretchBlt
+/** GFGxAPI capability definition : alphablending support.
+ @see GFGxGetProperty()
+*/
+#define GFGX_CAP_ALPHABLENDING 0x00000010UL // Alpha blending
+/** GFGxAPI capability definition : alphablending and transparency support.
+ @see GFGxGetProperty()
+*/
+#define GFGX_CAP_ALPHA_COLOR_CMP 0x00000020UL // Alpha blending
+
+/* NEW CAPABILITY FLAGS */
+
+/** GFGxAPI capability definition : fast rotation support.
+ @see GFGxGetProperty()
+*/
+#define GFGX_CAP_FAST_ROTATION 0x00000040UL // Fast Rotation
+
+/** GFGxAPI capability definition : inside clipping support.
+ @see GFGxGetProperty()
+*/
+#define GFGX_CAP_CLIPPING_INSIDE 0x00000100UL // Inside Clipping
+/** GFGxAPI capability definition : fadeblt support.
+ @see GFGxGetProperty()
+*/
+#define GFGX_CAP_FADE_BLT 0x00000200UL // Fade Blt
+
+/** GFGxAPI capability definition : color pattern support.
+ @see GFGxGetProperty()
+*/
+#define GFGX_CAP_COLOR_PATTERN 0x00001000UL // Color Pattern
+/** GFGxAPI capability definition : color pattern transparency support.
+ @see GFGxGetProperty()
+*/
+#define GFGX_CAP_CLR_PAT_TRANSPARENT 0x00002000UL // Color Pattern Transparency
+/** GFGxAPI capability definition : alphablending and fading support.
+ @see GFGxGetProperty()
+*/
+#define GFGX_CAP_ALPHA_AND_FADING 0x00004000UL // ALpha Blending & fading
+/** GFGxAPI capability definition : 1BPP alpha plane support.
+ @see GFGxGetProperty()
+*/
+#define GFGX_CAP_ALPHA_PLANAR_1BPP 0x00008000UL // Planar 1 BPP Alpha
+/** GFGxAPI capability definition : 2BPP alpha plane support.
+ @see GFGxGetProperty()
+*/
+#define GFGX_CAP_ALPHA_PLANAR_2BPP 0x00010000UL // Planar 2 BPP Alpha
+/** GFGxAPI capability definition : 4BPP alpha plane support.
+ @see GFGxGetProperty()
+*/
+#define GFGX_CAP_ALPHA_PLANAR_4BPP 0x00020000UL // Planar 4 BPP Alpha
+/** GFGxAPI capability definition : 8BPP alpha plane support.
+ @see GFGxGetProperty()
+*/
+#define GFGX_CAP_ALPHA_PLANAR_8BPP 0x00040000UL // Planar 8 BPP Alpha
+/** GFGxAPI capability definition : SRC4DST4BPP alpha plane support.
+ @see GFGxGetProperty()
+*/
+#define GFGX_CAP_ALPHA_PLANAR_SRC4DST4 0x00080000UL // Planar 44 BPP Alpha
+ // 8 bpp plane, src * 4 + dst*4
+/** GFGxAPI capability definition : 32BPP to 16BPP alphablending support.
+ @see GFGxGetProperty()
+*/
+#define GFGX_CAP_ALPHA_PLANAR_32BLEND16 0x00200000UL // 32 bits source blending
+/** GFGxAPI capability definition : src 1555 alphablending support.
+ @see GFGxGetProperty()
+*/
+#define GFGX_CAP_ALPHA_SRC1555 0x00400000UL // Src alpha 1555
+/** GFGxAPI capability definition : src 4444 alphablending support.
+ @see GFGxGetProperty()
+*/
+#define GFGX_CAP_ALPHA_SRC4444 0x00800000UL // Src alpha 4444
+/** GFGxAPI capability definition : src fixed alphablending support.
+ @see GFGxGetProperty()
+*/
+#define GFGX_CAP_ALPHA_FIXED 0x01000000UL // Fixed alpha
+
+/**** CLIPPING FLAGS ****/
+
+/* disable clipping */
+/** GFGxAPI CLIPPING flags : disable clipping.
+ @see GFGxSetClip()
+*/
+#define GFGX_SETCLIP_DISABLE 0x00000000UL
+
+/* enable clipping */
+/** GFGxAPI CLIPPING flags : enable clipping.
+ @see GFGxSetClip()
+*/
+#define GFGX_SETCLIP_ENABLE 0x00000001UL
+
+/* set clipping rectangle */
+/** GFGxAPI CLIPPING flags : set clipping rectangle.
+ @see GFGxSetClip()
+*/
+#define GFGX_SETCLIP_SETRECT 0x00000002UL
+
+/* set inside clipping - default is outside clipping*/
+/** GFGxAPI CLIPPING flags : set inside clipping, default is outside.
+ @see GFGxSetClip()
+*/
+#define GFGX_SETCLIP_INSIDE 0x00000004UL
+
+
+/**** LINE DRAW FLAGS ****/
+
+/* don't draw last pixel */
+/** GFGxAPI LINE DRAW flags : do not draw last pixel.
+ @see GFGxLine()
+*/
+#define GFGX_LINE_NOT_DRAW_LAST_PIXEL 0x00000001UL
+
+/**** BITBLT - SOURCE FLAGS ****/
+
+/* source is screen */
+/** GFGxAPI BITBLT Source flags : source comes from video mem.
+ @see GFGxBlt()
+*/
+#define GFGX_BLT_SRC_VIDEO 0x00000000UL
+
+/* color source in system memory */
+/** GFGxAPI BITBLT Source flags : colour source comes from system mem.
+ @see GFGxBlt()
+*/
+#define GFGX_BLT_SRC_SYSMEM_COLOR 0x00000001UL
+
+/* mono source in system memory */
+/** GFGxAPI BITBLT Source flags : mono source comes from system mem.
+ @see GFGxBlt()
+*/
+#define GFGX_BLT_SRC_SYSMEM_MONO 0x00000002UL
+
+/* source is solid color */
+/** GFGxAPI BITBLT Source flags : source is solid (unique color).
+ @see GFGxBlt()
+*/
+#define GFGX_BLT_SRC_SOLID 0x00000004UL
+
+
+/**** BITBLT - PATTERN FLAGS ****/
+
+/* pattern is mono */
+/** GFGxAPI BITBLT Pattern flags : pattern is mono.
+ @see GFGxBlt()
+*/
+#define GFGX_BLT_PAT_MONO 0x00000008UL
+
+/* pattern is color */
+/** GFGxAPI BITBLT Pattern flags : pattern is color.
+ @see GFGxBlt()
+*/
+#define GFGX_BLT_PAT_COLOR 0x00000010UL
+
+/* pattern is solid color */
+/** GFGxAPI BITBLT Pattern flags : pattern is solid (unique color).
+ @see GFGxBlt()
+*/
+#define GFGX_BLT_PAT_SOLID 0x00000020UL
+
+/* pattern is cached */
+/** GFGxAPI BITBLT Pattern flags : pattern is cached in video mem.
+ The pattern ID for the cached pattern is returned in the pPatID
+ field in GFGXBLTPARAM sruct. User needs to make sure that a valid
+ pointer is passed in pPatID.
+ @see GFGxBlt()
+*/
+#define GFGX_BLT_PAT_CACHE 0x00000040UL
+
+
+/**** BITBLT - MODE FLAGS ****/
+/**** Linear / XY Mode / Surface Flag ****/
+
+/* XY Mode Blt */
+/** GFGxAPI BITBLT Mode flags : X/Y mode is used.
+ @see GFGxBlt()
+*/
+#define GFGX_BLT_MODE_XY 0x00000000UL
+
+/* Linear Mode Blt */
+/** GFGxAPI BITBLT Mode flags : linear mode is used.
+ @see GFGxBlt()
+*/
+#define GFGX_BLT_MODE_LINEAR 0x00000080UL
+
+/* Surface to Surface blt */
+/** GFGxAPI BITBLT Mode flags : surface to surface mode is used.
+ @see GFGxBlt()
+*/
+#define GFGX_BLT_SURFACE 0x00000100UL
+
+
+/**** BITBLT - CLIPPING FLAGS ****/
+
+/* enable clipping */
+/** GFGxAPI BITBLT Clipping flags : enable clipping.
+ @see GFGxBlt()
+*/
+#define GFGX_BLT_CLIP 0x00000200UL
+
+/**** BITBLT - SOURCE TRANSPARENCY FLAGS ****/
+
+/* color source transparent blt (if source pixel matches colorCompare,
+do not overwrite) */
+/** GFGxAPI BITBLT Source Transparency flags : enable color source transparency
+ (if source pixel matches colorCompare, do not overwrite).
+ @see GFGxBlt()
+*/
+#define GFGX_BLT_TRANSPARENT_SRC_COLOR 0x00000400UL
+
+/* color source inverse transparent blt (if source pixel matches
+colorCompare, overwrite) */
+/** GFGxAPI BITBLT Source Transparency flags : enable color source inverse
+ transparency (if source pixel matches colorCompare, overwrite).
+ @see GFGxBlt()
+*/
+#define GFGX_BLT_TRANSPARENT_SRC_COLOR_INV 0x08000000UL
+
+
+/* mono source transparent blt (if source bit is 0, no
+overwrite on corresponding destination location) */
+/** GFGxAPI BITBLT Source Transparency flags : enable mono source transparency
+ (if source bit is 0, no overwrite on corresponding destination location).
+ @see GFGxBlt()
+*/
+#define GFGX_BLT_TRANSPARENT_SRC_MONO 0x00000800UL
+
+/* mono source inverted transparent blt (if source bit
+is 1, no overwrite on corresponding destination location) */
+/** GFGxAPI BITBLT Source Transparency flags : enable mono source inverse
+ transparency (if source bit is 1, no overwrite on corresponding destination
+ location).
+ @see GFGxBlt()
+*/
+#define GFGX_BLT_TRANSPARENT_SRC_MONO_INV 0x00001000UL
+
+
+/**** BITBLT - DESTINATION TRANSPARENCY FLAGS ****/
+
+/* destination transparent blt (if destination pixel matches colorCompare,
+overwrite) */
+/** GFGxAPI BITBLT Destination Transparency flags : enable destination
+ transparency (if destination pixel matches colorCompare, overwrite).
+ @see GFGxBlt()
+*/
+#define GFGX_BLT_TRANSPARENT_DST 0x00002000UL
+
+/* destination transparent inverse blt (if destination pixel matches
+colorCompare, donot overwrite) */
+/** GFGxAPI BITBLT Destination Transparency flags : enable destination inverse
+ transparency (if destination pixel matches colorCompare, do not overwrite).
+ @see GFGxBlt()
+*/
+#define GFGX_BLT_TRANSPARENT_DST_INV 0x10000000UL
+
+/**** BITBLT - PATTERN TRANSPARENCY FLAGS ****/
+
+/* Mono pattern transparent Blt */
+/** GFGxAPI BITBLT Pattern Transparency flags : enable mono pattern transparency
+ (if pattern bit is 0, no overwrite on corresponding destination location).
+ @see GFGxBlt()
+*/
+#define GFGX_BLT_TRANSPARENT_PAT_MONO 0x00004000UL
+
+/* Mono pattern inverted transparent Blt */
+/** GFGxAPI BITBLT Pattern Transparency flags : enable mono pattern inverse
+ transparency (if pattern bit is 1, no overwrite on corresponding destination
+ location).
+ @see GFGxBlt()
+*/
+#define GFGX_BLT_TRANSPARENT_PAT_MONO_INV 0x00008000UL
+
+/* Color pattern transparency Blt */
+/** GFGxAPI BITBLT Pattern Transparency flags : enable color pattern transparency
+ (if pattern pixel matches colorCompare, do not overwrite).
+ @see GFGxBlt()
+*/
+#define GFGX_BLT_TRANSPARENT_PAT_COLOR 0x00010000UL
+
+/* Color pattern transparency Blt */
+/** GFGxAPI BITBLT Pattern Transparency flags : enable color pattern inverse
+ transparency (if pattern pixel matches colorCompare, overwrite).
+ @see GFGxBlt()
+*/
+#define GFGX_BLT_TRANSPARENT_PAT_COLOR_INV 0x20000000UL
+
+/**** Fade Blt ****/
+/** GFGxAPI BITBLT flags : enable fade blt.
+ @see GFGxBlt()
+*/
+#define GFGX_BLT_FADE_BLT 0x00020000UL
+
+/* Enable alpha blending */
+/** GFGxAPI BITBLT flags : enable alphablending.
+ @see GFGxBlt()
+*/
+#define GFGX_BLT_ALPHA_BLENDING 0x00080000UL
+
+
+
+/**** ALPHABLENDING FLAGS ****/
+
+/* Fixed alpha operation */
+/** GFGxAPI BITBLT Alphablending flags : alpha mode is fixed value.
+ @see GFGxBlt()
+*/
+#define GFGX_BLT_ALPHA_FIXED ( 0x00200000UL)
+
+/* Inverse Fixed alpha */
+/** GFGxAPI BITBLT Alphablending flags : alpha mode is inverse fixed value.
+ @see GFGxBlt()
+*/
+#define GFGX_BLT_ALPHA_FIXED_INV (0x00400000UL)
+
+/* Source alpha ARGB1555 */
+/** GFGxAPI BITBLT Alphablending flags : alpha mode is source ARGB1555.
+ @see GFGxBlt()
+*/
+#define GFGX_BLT_ALPHA_SRC_1555_T (0x00800000UL)
+
+/* Inverse Source alpha ARGB1555 */
+/** GFGxAPI BITBLT Alphablending flags : alpha mode is inverse source ARGB1555.
+ @see GFGxBlt()
+*/
+#define GFGX_BLT_ALPHA_SRC_1555_T_INV (0x01000000UL)
+
+/* Source alpha ARGB4444 */
+/** GFGxAPI BITBLT Alphablending flags : alpha mode is source ARGB4444.
+ @see GFGxBlt()
+*/
+#define GFGX_BLT_ALPHA_SRC_4444 (0x02000000UL)
+
+/* Inverse Source ARGB4444 */
+/** GFGxAPI BITBLT Alphablending flags : alpha mode is inverse source ARGB4444.
+ @see GFGxBlt()
+*/
+#define GFGX_BLT_ALPHA_SRC_4444_INV (0x04000000UL)
+
+/* new flags */
+
+/** GFGxAPI BITBLT Alphablending mask.
+ @see GFGxBlt()
+*/
+#define GFGXEX1_MASK 0x3FFFFFFF
+
+/* Fixed alpha operation */
+/** GFGxAPI BITBLT Alphablending flags : alpha mode is fixed value.
+ @see GFGxBlt()
+*/
+#define GFGXEX1_BLT_ALPHA_FIXED (0x40000000 | 0x00000001UL)
+
+/* Inverse Fixed alpha */
+/** GFGxAPI BITBLT Alphablending flags : alpha mode is inverse fixed value.
+ @see GFGxBlt()
+*/
+#define GFGXEX1_BLT_ALPHA_FIXED_INV (0x40000000 | 0x00000002UL)
+
+/* Source alpha ARGB1555 */
+/** GFGxAPI BITBLT Alphablending flags : alpha mode is source ARGB1555.
+ @see GFGxBlt()
+*/
+#define GFGXEX1_BLT_ALPHA_SRC_1555_T (0x40000000 | 0x00000004UL)
+
+/* Inverse Source alpha ARGB1555 */
+/** GFGxAPI BITBLT Alphablending flags : alpha mode is inverse source ARGB1555.
+ @see GFGxBlt()
+*/
+#define GFGXEX1_BLT_ALPHA_SRC_1555_T_INV (0x40000000 | 0x00000008UL)
+
+/* Source alpha ARGB4444 */
+/** GFGxAPI BITBLT Alphablending flags : alpha mode is source ARGB4444.
+ @see GFGxBlt()
+*/
+#define GFGXEX1_BLT_ALPHA_SRC_4444 (0x40000000 | 0x00000010UL)
+
+/* Inverse Source ARGB4444 */
+/** GFGxAPI BITBLT Alphablending flags : alpha mode is inverse source ARGB4444.
+ @see GFGxBlt()
+*/
+#define GFGXEX1_BLT_ALPHA_SRC_4444_INV (0x40000000 | 0x00000020UL)
+
+/* Source alpha ARGB8888 */
+/** GFGxAPI BITBLT Alphablending flags : alpha mode is source ARGB8888.
+ @see GFGxBlt()
+*/
+#define GFGXEX1_BLT_ALPHA_SRC_8888 (0x40000000 | 0x00000040UL)
+
+/* Inverse source alpha ARGB8888 */
+/** GFGxAPI BITBLT Alphablending flags : alpha mode is inverse source ARGB8888.
+ @see GFGxBlt()
+*/
+#define GFGXEX1_BLT_ALPHA_SRC_8888_INV (0x40000000 | 0x00000080UL)
+
+/* Destination alpha ARGB8888 */
+/** GFGxAPI BITBLT Alphablending flags : alpha mode is destination ARGB8888.
+ @see GFGxBlt()
+*/
+#define GFGXEX1_BLT_ALPHA_DST_8888 (0x40000000 | 0x00000100UL)
+
+/* Inverse Destination alpha 8888 */
+/** GFGxAPI BITBLT Alphablending flags : alpha mode is inverse destination ARGB8888.
+ @see GFGxBlt()
+*/
+#define GFGXEX1_BLT_ALPHA_DST_8888_INV (0x40000000 | 0x00000200UL)
+
+/* Planar 1BPP alpha blending */
+/** GFGxAPI BITBLT Alphablending flags : alpha mode is 1BPP planar.
+ @see GFGxBlt()
+*/
+#define GFGXEX1_BLT_PLANAR_1BPP (0x40000000 | 0x00000400UL )
+
+/* Planar 1BPP Inv alpha blending */
+/** GFGxAPI BITBLT Alphablending flags : alpha mode is inverse 1BPP planar.
+ @see GFGxBlt()
+*/
+#define GFGXEX1_BLT_PLANAR_1BPP_INV (0x40000000 | 0x00000800UL)
+
+/* Planar 2BPP alpha blending */
+/** GFGxAPI BITBLT Alphablending flags : alpha mode is 2BPP planar.
+ @see GFGxBlt()
+*/
+#define GFGXEX1_BLT_PLANAR_2BPP (0x40000000 | 0x00001000UL)
+
+/* Planar 2BPP Inv alpha blending */
+/** GFGxAPI BITBLT Alphablending flags : alpha mode is inverse 2BPP planar.
+ @see GFGxBlt()
+*/
+#define GFGXEX1_BLT_PLANAR_2BPP_INV (0x40000000 | 0x00002000UL)
+
+/* Planar 4BPP alpha Blending */
+/** GFGxAPI BITBLT Alphablending flags : alpha mode is 4BPP planar.
+ @see GFGxBlt()
+*/
+#define GFGXEX1_BLT_PLANAR_4BPP (0x40000000 | 0x00004000UL)
+
+/* Planar 4BPP Inv alpha Blending */
+/** GFGxAPI BITBLT Alphablending flags : alpha mode is inverse 4BPP planar.
+ @see GFGxBlt()
+*/
+#define GFGXEX1_BLT_PLANAR_4BPP_INV (0x40000000 | 0x00008000UL)
+
+/* Planar 8BPP alpha Blending */
+/** GFGxAPI BITBLT Alphablending flags : alpha mode is 8BPP planar.
+ @see GFGxBlt()
+*/
+#define GFGXEX1_BLT_PLANAR_8BPP (0x40000000 | 0x00010000UL)
+
+/* Planar 8Bpp Inv alpha Blending */
+/** GFGxAPI BITBLT Alphablending flags : alpha mode is inverse 8BPP planar.
+ @see GFGxBlt()
+*/
+#define GFGXEX1_BLT_PLANAR_8BPP_INV (0x40000000 | 0x00020000UL)
+
+/* Planar 44BPP alpha blending */
+/** GFGxAPI BITBLT Alphablending flags : alpha mode is SRC4DST4BPP planar.
+ @see GFGxBlt()
+*/
+#define GFGXEX1_BLT_PLANAR_44BPP (0x40000000 | 0x00040000UL)
+
+/* Planar 32 bpp src blending 16 bpp dst */
+/** GFGxAPI BITBLT Alphablending flags : alpha mode is 32BPP src to 16BPP dst.
+ @see GFGxBlt()
+*/
+#define GFGXEX1_BLT_PLANAR_32BPP16 (0x40000000 | 0x00080000UL)
+
+/*Planar Inv 32 bpp src blending 16 bpp dst */
+/** GFGxAPI BITBLT Alphablending flags : alpha mode is inverse 32BPP src to
+ 16BPP dst.
+ @see GFGxBlt()
+*/
+#define GFGXEX1_BLT_PLANAR_32BPP16_INV (0x40000000 | 0x00100000UL)
+
+/* Alpha planar is already in video mem, no need to transfer it from sys mem */
+#define GFGXEX1_BLT_PLANAR_NOTRANSFER (0x40000000 | 0x00200000UL)
+
+/**** FAST ROTATION FLAGS ****/
+/** GFGxAPI BITBLT Fast Rotation mask.
+ @see GFGxFastRotate()
+*/
+#define GFGXEX2_MASK 0x3FFFFFFF
+
+/* Fast Rotation Modes */
+
+/* Square (in place rotation) */
+/** GFGxAPI BITBLT Fast Rotation flags : dst is same than src.
+ @see GFGxFastRotate()
+*/
+#define GFGXEX2_FAST_ROTATE_SQUARE (0x80000000 | 0x00000001UL)
+
+/* Source to Destination Rotation ( 2 buffers) */
+/** GFGxAPI BITBLT Fast Rotation flags : dst is different than src.
+ @see GFGxFastRotate()
+*/
+#define GFGXEX2_FAST_ROTATE_SRC_DST_COPY (0x80000000 | 0x00000002UL)
+
+/* Disable Fast Rotation */
+/** GFGxAPI BITBLT Fast Rotation flags : disable fast rotation.
+ @see GFGxFastRotate()
+*/
+#define GFGXEX2_FAST_ROTATE_DISABLE (0x80000000 | 0x00000004UL)
+
+/* Fast Rotation Types */
+
+/* Flip-X */
+/** GFGxAPI BITBLT Fast Rotation flags : FLIP-X transformation.
+ @see GFGxFastRotate()
+*/
+#define GFGXEX2_FAST_ROTATE_FLIP_X (0x80000000 | 0x00000008UL)
+
+/* Flip-Y */
+/** GFGxAPI BITBLT Fast Rotation flags : FLIP-Y transformation.
+ @see GFGxFastRotate()
+*/
+#define GFGXEX2_FAST_ROTATE_FLIP_Y (0x80000000 | 0x00000010UL)
+
+/* Trans-LR */
+/** GFGxAPI BITBLT Fast Rotation flags : TRANSPOSE LEFT-RIGHT transformation.
+ @see GFGxFastRotate()
+*/
+#define GFGXEX2_FAST_ROTATE_TRANS_LR (0x80000000 | 0x00000020UL)
+
+/* Trans-RL */
+/** GFGxAPI BITBLT Fast Rotation flags : TRANSPOSE RIGHT-LEFT transformation.
+ @see GFGxFastRotate()
+*/
+#define GFGXEX2_FAST_ROTATE_TRANS_RL (0x80000000 | 0x00000040UL)
+
+/* 90 deg Rotation */
+/** GFGxAPI BITBLT Fast Rotation flags : 90 rotation.
+ @see GFGxFastRotate()
+*/
+#define GFGXEX2_FAST_ROTATE_ROT_90 (0x80000000 | 0x00000080UL)
+
+/* 180 deg Rotation */
+/** GFGxAPI BITBLT Fast Rotation flags : 180 rotation.
+ @see GFGxFastRotate()
+*/
+#define GFGXEX2_FAST_ROTATE_ROT_180 (0x80000000 | 0x00000100UL)
+
+/* 270 deg Rotation */
+/** GFGxAPI BITBLT Fast Rotation flags : 270 rotation.
+ @see GFGxFastRotate()
+*/
+#define GFGXEX2_FAST_ROTATE_ROT_270 (0x80000000 | 0x00000200UL)
+
+/* Identity */
+/** GFGxAPI BITBLT Fast Rotation flags : identity transformation.
+ @see GFGxFastRotate()
+*/
+#define GFGXEX2_FAST_ROTATE_IDENTITY (0x80000000 | 0x00000400UL)
+
+
+/** GFGXAPI STRETCHBLT flag in GFGXBLTPARAM struct
+ This flag waits for the StretchBlt engine to be idle.
+ If enabled it will block the CPU thread until the StretchBlt is done.
+ It is effective only for GFGxStretchBlt().
+ For other api's it is ignored.
+ @see GFGxBlt()
+*/
+#define GFGX_STRETCHBLT_WAITFOR_FINISH 0x00100000UL
+
+
+/*
+ * Definition of attribute ids for Set/GetAttributes()
+ */
+
+/** GFGxAPI attributes definition.
+ @see GFGxGetAttribute(), GFGxSetAttribute()
+*/
+typedef enum _GFGXATTRIBUTES
+ {
+ /** Current bits per pixel. */
+ GFGX_ATTR_BPP,
+ /** Frame buffer line width in bytes. */
+ GFGX_ATTR_STRIDE,
+ /** Ptr to start address of the display frame buffer. */
+ GFGX_ATTR_ADDR_PTR,
+ /** Start address offset. */
+ GFGX_ATTR_ADDR,
+ /** Surface for GFGxAPI operations. */
+ GFGX_ATTR_SURFACE,
+ /** Palette RGB888. */
+ GFGX_ATTR_PALETTE_RGB888
+} GFGXATTRIBUTES;
+
+/* Blt parameter struct */
+/** GFGxAPI BLT parameter structure.
+ @see GFGxBlt()
+*/
+typedef struct _GFGXBLTPARAM
+{
+ /** Destination x in pixels (relative to left). */
+ NvS16 dx;
+ /** Destination y in scan lines (relative to top). */
+ NvS16 dy;
+ /** Width of the source rectangle in pixels. */
+ NvS16 w;
+ /** Height of the source rectangle in pixels. */
+ NvS16 h;
+ /** Source x in pixels (relative to left). */
+ NvS16 sx;
+ /** Source y in scan lines (relative to top). */
+ NvS16 sy;
+ /** Width of the source rectangle in pixels (for Stretch Blt only). */
+ NvS16 sw;
+ /** Height of the source rectangle in scan lines (for Stretch Blt only). */
+ NvS16 sh;
+ /** Color depth */
+ NvU16 bpp;
+ /** Number of bytes per scanline for bitmap. */
+ NvS16 stride;
+ /** Foreground color (used if pixel data is 1 on 1BPP source bitmap). */
+ NvU32 fgColor;
+ /** Background color (used if pixel data is 0 on 1BPP source bitmap). */
+ NvU32 bgColor;
+ /** Pointer to source bitmap. */
+ NvU8 *pBits;
+ /** Pattern offset in x direction. */
+ NvS16 px;
+ /** Pattern offset in y direction. */
+ NvS16 py;
+ /** Pattern foreground color (used if pixel data is 1 on 1BPP pattern bitmap).*/
+ NvU32 patFgColor;
+ /** Pattern background color (used if pixel data is 0 on 1BPP pattern bitmap).*/
+ NvU32 patBgColor;
+ /** Pattern color key for transparent blt.*/
+ NvU32 patColorCmp;
+ /** Pointer to pattern bitmap. */
+ NvU8 *pPatBits;
+ /** Number of bytes per scanline for pattern. */
+ NvU32 patStride;
+ /** Width of pattern. */
+ NvU32 patW;
+ /** Height of pattern. */
+ NvU32 patH;
+
+ /** pointer to Pattern ID when GFGX_BLT_PAT_CACHE flag is set. */
+ /** GFGxBlt() will return the patID in this field */
+ NvU32 *pPatID;
+
+ // Miscellaneous parameters
+ /** Color key for transparent blt. */
+ NvU32 colorCompare;
+ /** Main flags setting. */
+ NvU32 flags;
+ /** Raster operation code (ROP3). */
+ NvU16 rop3;
+
+ // Surface parameters
+ /** Pointer to dst surface pointer. */
+ PGFRMSURFACE *ppDestSurf;
+ /** Pointer to src surface pointer. */
+ PGFRMSURFACE *ppSrcSurf;
+ /** Source start address. */
+ NvU32 srcStartAddr;
+ /** Destination start address. */
+ NvU32 dstStartAddr;
+ /** Number of bytes per scanline for destination. */
+ NvS16 dstStride;
+
+ // alpha blending parameters
+ /** Alpha value for GFGX_BLT_ALPHA_FIXED or alphaFg for GFGX_BLT_ALPHA_SRC_1555_T. */
+ NvU16 alpha;
+ /** Background alpha for GFGX_BLT_ALPHA_SRC_1555_T. */
+ NvU16 alphaBg;
+ /** Pointer to alpha plane. */
+ NvU8 *pAlphaplane;
+
+ // Fading parameters
+ /** Fading coefficient. */
+ NvU32 fadeCoeff;
+ /** Fading offset. */
+ NvU32 fadeOffset;
+
+ /** Alphablending flag. */
+ NvU32 flagex1;
+
+ /** Fast rotation flag. */
+ NvU32 flagex2;
+
+} GFGXBLTPARAM;
+
+
+/** @name Functions
+@{*/
+
+/** This function returns version and capabilities of API and hardware.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param pGxProp (PGFPROPERTY) Pointer to property structure to be filled in
+
+ @retval #GF_SUCCESS pGxProp filled in successfully
+ @retval #GF_ERROR Some error occured
+
+ The #GFPROPERTY structure passed with parameter pGxProp will be
+ filled in on successfull return.
+
+ The GFPROPERTY::Capability field will hold a combination of flagbits
+ indicating capabilities specific to the GFGxAPI :
+
+
+ #GFGX_CAP_BLT
+ BitBlt supported.
+ #GFGX_CAP_LINE
+ Line Draw supported.
+ #GFGX_CAP_CLIP
+ Clipping supported.
+ #GFGX_CAP_STRETCHBLT
+ Stretchblt supported.
+ #GFGX_CAP_ALPHABLENDING
+ Alphablending supported.
+ #GFGX_CAP_ALPHA_COLOR_CMP
+ Alphablending and transparency supported.
+ #GFGX_CAP_FAST_ROTATION
+ Fast rotation supported.
+ #GFGX_CAP_CLIPPING_INSIDE
+ Inside clipping supported.
+ #GFGX_CAP_FADE_BLT
+ Fadeblt supported.
+ #GFGX_CAP_COLOR_PATTERN
+ Color pattern supported.
+ #GFGX_CAP_CLR_PAT_TRANSPARENT
+ Color pattern transparency supported.
+ #GFGX_CAP_ALPHA_AND_FADING
+ Alphablending and fading supported.
+ #GFGX_CAP_ALPHA_PLANAR_1BPP
+ 1BPP alpha planar supported.
+ #GFGX_CAP_ALPHA_PLANAR_2BPP
+ 2BPP alpha plane supported.
+ #GFGX_CAP_ALPHA_PLANAR_4BPP
+ 4BPP alpha plane supported.
+ #GFGX_CAP_ALPHA_PLANAR_8BPP
+ 8BPP alpha plane supported.
+ #GFGX_CAP_ALPHA_PLANAR_SRC4DST4
+ SRC4DST4BPP alpha plane supported.
+ #GFGX_CAP_ALPHA_PLANAR_32BLEND16
+ 32BPP to 16BPP alphablending supported.
+ #GFGX_CAP_ALPHA_SRC1555
+ Src 1555 alphablending supported.
+ #GFGX_CAP_ALPHA_SRC4444
+ Src 4444 alphablending supported.
+ #GFGX_CAP_ALPHA_FIXED
+ Src fixed alphablending supported.
+
+
+ It is recommended, but not mandatory, that you call this function to query
+ for the GFGxAPI version and capabilities before proceeding to call any of
+ the other GFGxAPI functions.
+
+ @see GFPROPERTY
+*/
+GF_RETTYPE GFGxGetProperty(GFGxHandle GxHandle,
+ PGFPROPERTY pGxProp);
+/** This function fills a rectangle in video memory with the specified solid color.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param x,y (NvS16) left-top corner of the rectangle (x in pixels, y in scan lines)
+ @param w,h (NvS16) width & height of the rectangle (w in pixels, h in scan lines)
+ @param color (NvU32) color to be filled (8BPP index, or 16BPP-32BPP TrueColor)
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+
+ @see GFGxFillRectEx()
+*/
+GF_RETTYPE GFGxFillRect(GFGxHandle GxHandle,
+ NvS16 x, NvS16 y,
+ NvS16 w, NvS16 h,
+ NvU32 color);
+/** This function is commonly used in scrolling an image in video memory. It copies
+ a rectangular image in the video memory to another location in the same video
+ memory.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param dx,dy (NvS16) left-top corner of destination rectangle (dx in pixels, dy in scan lines)
+ @param w,h (NvS16) width & height of rectangles (w in pixels, h in scan lines)
+ @param sx,sy (NvS16) left-top corner of source rectangle (sx in pixels, sy in scan lines)
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ GFGxCopyRect() checks for the destruction of the copied image in video memory
+ caused by overlapping source and destination locations.
+
+ Also, if the destination for the rectangle exceeds the limit of the video memory,
+ wrapping is done in hardware and no error code is returned.
+
+
+ @see GFGxCopyRectEx(), GFGxCopyRectDirect()
+*/
+GF_RETTYPE GFGxCopyRect(GFGxHandle GxHandle,
+ NvS16 dx, NvS16 dy,
+ NvS16 w, NvS16 h,
+ NvS16 sx, NvS16 sy);
+
+/** This function copies a source bitmap from system memory to the video memory.
+ The source bitmap is specified in monochrome (1BPP) pixels.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param dx,dy (NvS16) left-top corner of destination rectangle (dx in pixels, dy in scan lines)
+ @param w,h (NvS16) width & height of the rectangle in pixels and scan lines
+ @param sx,sy (NvS16) left-top corner of source rectangle (sx in pixels, sy in scan lines)
+ @param fgColor (NvU16) color applied to source data bit 1 (The color depth should be same as the frame buffer)
+ @param bgColor (NvU16) color applied to source data bit 0 (The color depth should be same as the frame buffer)
+ @param srcStride (NvS16) source stride in bytes
+ @param pMonoBits (NvU8*) pointer to monochome (1bpp) bitmap
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+
+ @see GFGxCopyTransMonoBitmap()
+*/
+GF_RETTYPE GFGxCopyMonoBitmap( GFGxHandle GxHandle,
+ NvS16 dx, NvS16 dy,
+ NvS16 w, NvS16 h,
+ NvS16 sx, NvS16 sy,
+ NvU32 fgColor, NvU32 bgColor,
+ NvS16 srcStride,
+ NvU8 *pMonoBits);
+/** This function copies the bitmap from video memory to system memory.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param dx,dy (NvS16) left-top corner of destination rectangle (dx in pixels, dy in scan lines)
+ @param w,h (NvS16) width & height of the rectangle in pixels and scan lines
+ @param sx,sy (NvS16) left-top corner of source rectangle (sx in pixels, sy in scan lines)
+ @param dstStride (NvS16) destination stride in bytes
+ @param pDstAddr (NvU8*) pointer to destination buffer
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+*/
+GF_RETTYPE GFGxReadBlt( GFGxHandle GxHandle,
+ NvS16 dx, NvS16 dy,
+ NvS16 w, NvS16 h,
+ NvS16 sx, NvS16 sy,
+ NvS16 dstStride,
+ NvU8 *pDstStartAddr);
+/** This function copies a source bitmap from system memory to the video memory.
+ The source bitmap is specified in monochrome (1BPP) pixels and can be transparent.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param dx,dy (NvS16) left-top corner of destination rectangle
+ @param w,h (NvS16) width & height of the rectangle in pixels and scan lines
+ @param sx,sy (NvS16) left-top corner of source rectangle
+ @param color (NvU16) color applied to non-transparent source data bit
+ @param srcStride (NvS16) source stride in bytes
+ @param pMonoBits (NvU8*) pointer to monochome (1bpp) bitmap
+ @param selectTrans (NvS16) transparency select: 0 or 1
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ This function is similar to GFGxCopyMonoBitmap() except for the selectTrans parameter.
+ This parameter indicates whether bit data equal to 0 or 1 is going to be transparent.
+ This function could be used for drawing a transparent text string or character.
+
+
+ @see GFGxCopyMonoBitmap()
+*/
+GF_RETTYPE GFGxCopyTransMonoBitmap( GFGxHandle GxHandle,
+ NvS16 dx, NvS16 dy,
+ NvS16 w, NvS16 h,
+ NvS16 sx, NvS16 sy,
+ NvU32 color,
+ NvS16 srcStride,
+ NvU8 *pMonoBits,
+ NvS16 selectTrans );
+/** This function is used to blit/blend a given source rectangle to/with the given
+ destination location in the video memory.
+
+ Overlap rectangles are handled properly. Source and destination rectangles must
+ have same size.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param pBltParam (#GFGXBLTPARAM*) refer to structure definition
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+
+ This routine is more generic. It supports System Memory to Video Memory Blts and
+ Video to Video Memory Blts involving Source and Pattern data.The Source and Pattern
+ data can be either Color or Monochrome(1 Bpp). Monochrome Blts are supported by performing
+ a Monochrome to Color Expansion.
+
+ Tiling mode is also supported for Mono Patttern Blts. The size of the pattern in this case
+ should be 16x16. Tiling is not supported for Color Patterns.
+
+ The following features can also be enabled during Blts :
+
+ - Color Source and Mono Source Transparency
+ - Destination Transparency,
+ - Color Pattern and Mono Pattern Transparency
+ - Alphablending ( Both Planar and Source Alpha)
+ - Fading
+ - Microsoft Windows compatible ROP3
+ - Clipping
+
+ GFGxBlt() supports both raster operations and alpha blending operations.The two types
+ of operations are mutually exclusive.
+
+ Please refer to the supported GFGxBlt() flags starting with GFGX_BLT_* and GFGXEX1_BLT_*.
+
+
+ @see GFGxCopyRect(), GFGxCopyRectDirect(), GFGxBltSurface(), GFGxCopyMonoBitmap(),
+ GFGxCopyTransMonoBitmap(), GFGxCopyColorBitmap()
+*/
+GF_RETTYPE GFGxBlt( GFGxHandle GxHandle,
+ const GFGXBLTPARAM *pBltParam );
+
+/**
+ This function performs a surface-to-surface blit. The color depth of the source
+ surface must match that of the destination. Also, the width and height of the
+ source must be the same as the destination's width and height.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param ppDestSurf (#PGFRMSURFACE*) pointer to destination surface pointer
+ @param ppSrcSurf (#PGFRMSURFACE) pointer so source surface pointer
+ @param w,h (NvS16) width & height of the rectangle in pixels and scan lines
+ @param rop3 (NvU16) raster operation code
+ @param srcStartAddr (NvU32) start address relative to the source surface
+ @param dstStartAddr (NvU32) start address relative to the destination surface
+ @param flags (NvU32) Transparent blit flag. See Below
+ @param colorCompare (NvU32) color key for transparent blit. If there is no transparent blit, colorCompare = 0
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ Transparent blit flag is one of the following:
+ - GFGX_BLT_TRANSPARENT_SRC_COLOR
+ - GFGX_BLT_TRANSPARENT_SRC_MONO
+ - GFGX_BLT_TRANSPARENT_SRC_MONO_INV
+ - GFGX_BLT_TRANSPARENT_DST
+ - GFGX_BLT_TRANSPARENT_PAT_COLOR
+ - GFGX_BLT_TRANSPARENT_PAT_COLOR_INV
+ - GFGX_BLT_TRANSPARENT_PAT_MONO
+ - GFGX_BLT_TRANSPARENT_PAT_MONO_INV
+ Refer to GFGX_BLT_X flag definitions for further information. If no transparent blit, flag = 0
+
+ Alphablending is not supported.
+
+
+ @see GFGxCopyRect(), GFGxCopyRectDirect(), GFGxBltSurface(), GFGxCopyMonoBitmap(),
+ GFGxCopyTransMonoBitmap(), GFGxCopyColorBitmap()
+*/
+GF_RETTYPE GFGxBltSurface( GFGxHandle GxHandle, PGFRMSURFACE *ppDestSurf,
+ PGFRMSURFACE *ppSrcSurf,
+ NvS16 w, NvS16 h, NvU16 rop3,
+ NvU32 srcStartAddr, NvU32 dstStartAddr,
+ NvU32 flags, NvU32 colorCompare);
+
+/** This function copies a source bitmap from system memory to the video memory.
+ The source bitmap's color depth must match the destination's video memory's color depth.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param dx,dy (NvS16) left-top corner of destination rectangle
+ @param w,h (NvS16) width & height of the rectangle in pixels and scan lines
+ @param sx,sy (NvS16) left-top corner of source rectangle
+ @param srcStride (NvS16) source stride in bytes, must be pixel size aligned
+ @param pColorBits (NvU8*) pointer to color bitmap
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+
+ @see GFGxCopyMonoBitmap()
+*/
+GF_RETTYPE GFGxCopyColorBitmap( GFGxHandle GxHandle,
+ NvS16 dx, NvS16 dy,
+ NvS16 w, NvS16 h,
+ NvS16 sx, NvS16 sy,
+ NvS16 srcStride,
+ NvU8 *pColorBits );
+
+/** This function draws a line from a point x1, y1 to another point x2, y2 with a specified color
+ and ROP2 code. GFGxSetClip() should be called before calling GFGxLine(). If clipping is needed,
+ it is assumed that clipping is enabled and clipping rectangle was set by GFGxSetClip(). If
+ clipping is not set, the line wraps if it is too long, and no error code is returned.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param x1,y1 (NvU16) (x,y) destination point coords (in pixels, scan lines)
+ @param x2,y2 (NvU16) (x,y) source point coords in (pixels, scan lines)
+ @param rop2 (NvU16) ROP2 code
+ @param color (NvU16) color key for transparent blt or pattern color
+ @param flags (NvU16) refer to GFGX_LINE_X flag definitions
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ Set flags to GFGX_LINE_NOT_DRAW_LAST_PIXEL if the last pixel is not to be
+ drawn.
+
+*/
+GF_RETTYPE GFGxLine( GFGxHandle GxHandle,
+ NvU16 x1, NvU16 y1, NvU16 x2, NvU16 y2,
+ NvU16 rop2, NvU32 color, NvU16 flags );
+
+/** This function enables or disables clipping and also sets the clipping rectangle for subsequent
+ blit and line drawing functions.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param pClipRect (#PGFRECT) pointer to the clipping rectangle
+ @param clipFlag (NvU32) See below
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ Set clipFlag to one of the following:
+ - GFGX_SETCLIP_DISABLE
+ - GFGX_SETCLIP_ENABLE
+ - GFGX_SETCLIP_SETRECT
+ Refer to GFGX_SETCLIP_X flag definitions
+
+ Clipping Sample Code
+ // Initialize clipping and rectangle parameters.
+ clipRect.top = 10;
+ clipRect.left = 10;
+ clipRect.right = 60;
+ clipRect.bottom = 60;
+ // Set the clipping rectangle and enable clipping.
+ GFGxSetClip( GxHandle, &clipRect, (GFGX_SETCLIP_SETRECT|
+ GFGX_SETCLIP_ENABLE) );
+ // Call drawing function: Rectangle Fill, Pattern Fill, etc.
+ GFGXFillRect( GxHandle, 20, 20, 30, 30, 0x07E0 );
+ // Disable clipping.
+ GFGxSetClip( GxHandle, NULL, GFGX_SETCLIP_DISABLE );
+
+
+*/
+GF_RETTYPE GFGxSetClip( GFGxHandle GxHandle,
+ PGFRECT pClipRect, NvU32 clipFlag);
+
+/** This function ensures synchronization between 2D operations and others modules operations.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param timeout (NvU32) obsolete parameter
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ When several modules share the same channel (like 3D,2D), it may be necessary to
+ synchronize the command flow with the 2D module execution. Putting a GFGxNotBusy()
+ call after a 2D operation ensures that commands which follow the 2D command are
+ executed after full completion of the 2D command.
+
+ As opposed to GFGxWaitNotBusy(), this function doesn't block the CPU thread.
+ Graphics engine may not be idle when returning from the function. Control returns
+ to the CPU right after a wait command is placed in the graphics engine command FIFO.
+ The GoForce hardware begins executing the commands following the engine idle
+ command only after the graphics engine becomes idle.
+
+
+ @see GFGxWaitNotBusy()
+*/
+GF_RETTYPE GFGxNotBusy( GFGxHandle GxHandle,
+ NvU32 timeout );
+/** This function sets the new value into the palette entry at index location.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param palVal (NvU32) New palette entry value
+ @param index (NvU16) Index of the palette entry
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ The index value ranges from [0..255] inclusively. Parameter palVal is in RGB format,
+ where bits [0-7] represent the red value, bits [8-15] the green value, and bits [16-23]
+ the blue value.
+
+ When this function is called, the physical palette entry is modified permanently.
+
+ This function is used only for the 8-bits per-pixel mode and does not apply to the RGB 16 and
+ 32-bits mode.
+
+
+ @see GFGxGetPal(), GFGxSetPalRange(), GFGxGetPalRange()
+*/
+GF_RETTYPE GFGxSetPal(GFGxHandle GxHandle,
+ NvU32 palVal, NvU16 index);
+
+/** This function sets the a range of new values pointed by pPalRange into the palette entries
+ starting at startIndex location and ending at endIndex inclusively.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param pPalRange (NvU32*) Pointer to a range of palette entry values
+ @param startIndex (NvU16) Starting index of palette entries
+ @param endIndex (NvU16) Ending index of palette entries
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ The index value ranges from [0..255] inclusively. Each palette entry value is in RGB format,
+ where bits [0-7] represent the red value, bits [8-15] the green value, and bits [16-23]
+ the blue value.
+
+ When this function is called, the physical palette entry is modified permanently.
+
+ This function is used only for the 8-bits per-pixel mode and does not apply to the RGB 16 and
+ 32-bits mode.
+
+
+ @see GFGxGetPal(), GFGxSetPalRange(), GFGxGetPalRange()
+*/
+GF_RETTYPE GFGxSetPalRange(GFGxHandle GxHandle,
+ NvU32 * palRange,
+ NvU16 startIndex, NvU16 endIndex);
+
+/** This function returns the palette entry value at index location.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param pPalVal (NvU32*) pointer to palette entry value
+ @param index (NvU16) index of the palette entry
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ The index value ranges from [0..255] inclusively. The returned palette entry value is stored
+ in the location pointed to by pPalVal.
+
+ This function is used only for the 8-bits per-pixel mode and does not apply to the RGB 16 and
+ 32-bits mode.
+
+
+ @see GFGxSetPal(), GFGxSetPalRange(), GFGxGetPalRange()
+*/
+GF_RETTYPE GFGxGetPal(GFGxHandle GxHandle,
+ NvU32 * pPalVal,
+ NvU16 index);
+/** This function returns the palette entry values starting from location startIndex to endIndex
+ inclusively.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param pPalArray (NvU32*) Pointer to a range of palette entry values
+ @param startIndex (NvU16) Starting index of palette entries
+ @param endIndex (NvU16) Ending index of palette entries
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ The index value ranges from [0..255] inclusively. The returned values are stored into
+ variables pointed to by pPalArray.
+
+ This function is used only for the 8-bits per-pixel mode and does not apply to the RGB 16 and
+ 32-bits mode.
+
+
+ @see GFGxSetPal(), GFGxGetPal(), GFGxSetPalRange()
+*/
+
+GF_RETTYPE GFGxGetPalRange(GFGxHandle GxHandle,
+ NvU32 * pPalArray,
+ NvU16 startIndex, NvU16 endIndex);
+/** This function transfers a color bitmap of exact full screen size from system memory to video memory.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param pBltParam (#GFGXBLTPARAM*) refere to structure definition
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+
+ @see GFGxBlt()
+*/
+
+GF_RETTYPE GFGxBltFullScreen(GFGxHandle GxHandle,
+ const GFGXBLTPARAM *pBltParam);
+/** This function copies a rectangular image in the video memory to another location in the same video
+ memory without taking care of overlapping cases.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param dx,dy (NvS16) left-top corner of destination rectangle
+ @param w,h (NvS16) width & height of rectangles
+ @param sx,sy (NvS16) left-top corner of source rectangle
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ This is a special case of GxCopyRect(). It does not check on destructions of copied image
+ on video memory due to overlapping source and destination locations.
+
+
+ @see GFGxCopyRectEx(), GFGxCopyRect()
+*/
+GF_RETTYPE GFGxCopyRectDirect(GFGxHandle GxHandle,
+ NvS16 dx, NvS16 dy,
+ NvS16 w, NvS16 h,
+ NvS16 sx, NvS16 sy);
+/** This function copies a source bitmap from system memory to the video memory with
+ certain restrictions.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param bitmapPtr (NvU32*) Pointer to color bitmap
+ @param size_in_bytes (NvU16) Total bytes to transfer
+ @param rect (#GFRECT) Destination rectangle
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ This is a special case of GxCopyColorBitmap(). Conditions below must be verified :
+ - The source bitmap pointer, pColorBits, has to be a 32-bit (DWORD) aligned address.
+ - The size of each line of the source bitmap must be 64-bits (8 bytes, QWORD) aligned.
+ - There must not be any skipping bytes between lines.
+ - Total bitmap size has to be smaller than or equal to 2K (2048) bytes.
+ - The source bitmap's color depth MUST match the destination video memory's color depth.
+
+
+ @see GxCopyColorBitmap()
+*/
+GF_RETTYPE GFGxCopyPackedColorBitmap(GFGxHandle GxHandle,
+ NvU32 *pColorBits,
+ NvU16 bitmapSize,
+ GFRECT rect);
+/** This function sets a given attribute.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param aid (NvU32) Attribute id, such as width, height etc
+ @param attr (NvU32) Attribute value
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ Attribute id can be one of the following :
+
+ #GFGX_ATTR_BPP
+ Current bits per pixel.
+ #GFGX_ATTR_STRIDE
+ Frame buffer line width in bytes.
+ #GFGX_ATTR_ADDR_PTR
+ Ptr to start address of the display frame buffer.
+ #GFGX_ATTR_ADDR
+ Start address offset.
+ #GFGX_ATTR_SURFACE
+ Surface for GFGxAPI operations.
+ #GFGX_ATTR_PALETTE_RGB888
+ Palette RGB888.
+
+
+
+ @see GFGxGetAttribute()
+*/
+
+GF_RETTYPE GFGxSetAttribute(GFGxHandle GxHandle,
+ NvU32 aid,NvU32 attr);
+/** This function gets an attribute. Certain attributes are fixed.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param aid (NvU32) attribute id, such as width, height etc
+ @param attr (NvU32*) pointer to returned attribute value
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ Attribute id can be one of the following :
+
+
+ #GFGX_ATTR_BPP
+ Current bits per pixel.
+ #GFGX_ATTR_STRIDE
+ Frame buffer line width in bytes.
+ #GFGX_ATTR_ADDR_PTR
+ Ptr to start address of the display frame buffer.
+ #GFGX_ATTR_ADDR
+ Start address offset.
+ #GFGX_ATTR_SURFACE
+ Surface for GFGxAPI operations.
+ #GFGX_ATTR_PALETTE_RGB888
+ Palette RGB888.
+
+
+ @see GFGxSetAttribute()
+*/
+GF_RETTYPE GFGxGetAttribute(GFGxHandle GxHandle,
+ NvU32 aid, NvU32 *attr);
+/** This function checks whether the graphics engine is busy or idle.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param timeout (NvU32) obsolete parameter
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ The function will wait until the graphics engine is idle. For example, if you want
+ to write to the frame buffer but the graphics engine is busy the function can be used
+ to wait until it is idle.
+
+ As opposed to GFGxNotBusy(), this function blocks the CPU thread while waiting for
+ the graphics engine to become idle.
+
+
+ @see GFGxNotBusy()
+*/
+GF_RETTYPE GFGxWaitNotBusy( GFGxHandle GxHandle,
+ NvU32 timeout );
+/** This function is used to stretch or shrink an image, which can be in system memory or video memory.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param pBltParam (#GFGXBLTPARAM*) refere to structure definition
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ The function has these limitations :
+ - supports 16 and 32BPP color depths,
+
+ @see GFGxBlt()
+*/
+
+GF_RETTYPE GFGxStretchBlt( GFGxHandle GxHandle,
+ const GFGXBLTPARAM *pBltParam );
+/*******************************New API's based on enhancing old API's****************************/
+
+/** This function fills a rectangle in the video memory with the specified solid color.
+ Video memory location is specified by the surface parameter.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param pSurf (#PGFRMSURFACE) pointer to destination surface
+ @param x,y (NvS16) left-top corner of the rectangle
+ @param w,h (NvS16) width & height of the rectangle
+ @param color (NvU32) color to be filled (8BPP index, or 16BPP-32BPP TrueColor)
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+
+ @see GFGxFillRect()
+*/
+ /* Old API's with enhancement */
+GF_RETTYPE GFGxFillRectEx(GFGxHandle GxHandle,
+ PGFRMSURFACE pSurf,
+ NvS16 x, NvS16 y,
+ NvS16 w, NvS16 h,
+ NvU32 color);
+/** This function copies a rectangular image in the video memory to another location in the same
+ video memory. It is commonly used in scrolling an image in video memory.
+ Video memory location is specified by the surface parameter.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param pSurf (#PGFRMSURFACE) pointer to destination surface
+ @param dx,dy (NvS16) left-top corner of destination rectangle
+ @param w,h (NvS16) width & height of rectangles
+ @param sx,sy (NvS16) left-top corner of source rectangle
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ GFGxCopyRectEx() checks for the destruction of the copied image in video memory
+ caused by overlapping source and destination locations. Also, if the destination
+ for the rectangle exceeds the limit of the video memory, wrapping is done in hardware
+ and no error code is returned.
+
+
+ @see GFGxCopyRect(), GFGxCopyRectDirect()
+*/
+GF_RETTYPE GFGxCopyRectEx(GFGxHandle GxHandle,
+ PGFRMSURFACE pSurf,
+ NvS16 dx, NvS16 dy,
+ NvS16 w, NvS16 h,
+ NvS16 sx, NvS16 sy);
+/** This function copies a source bitmap from system memory to the video memory.
+ The source bitmap is specified in monochrome (1BPP) pixels.
+ Video memory location is specified by the surface parameter.
+
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param pSurf (#PGFRMSURFACE) pointer to destination surface
+ @param dx,dy (NvS16) left-top corner of destination rectangle
+ @param w,h (NvS16) width & height of the rectangle in pixels and scan lines
+ @param sx,sy (NvS16) left-top corner of source rectangle
+ @param fgColor (NvU16) color applied to source data bit 1
+ @param bgColor (NvU16) color applied to source data bit 0
+ @param srcStride (NvS16) source stride in bytes
+ @param pMonoBits (NvU8*) pointer to monochome (1bpp) bitmap
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+
+ @see GFGxCopyTransMonoBitmap()
+*/
+GF_RETTYPE GFGxCopyMonoBitmapEx( GFGxHandle GxHandle,
+ PGFRMSURFACE pSurf,
+ NvS16 dx, NvS16 dy,
+ NvS16 w, NvS16 h,
+ NvS16 sx, NvS16 sy,
+ NvU32 fgColor, NvU32 bgColor,
+ NvS16 srcStride,
+ NvU8 *pMonoBits);
+/** This function copies a source bitmap from system memory to the video memory.
+ The source bitmap is specified in monochrome (1BPP) pixels and can be transparent.
+ Video memory location is specified by the surface parameter.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param pSurf (#PGFRMSURFACE) pointer to destination surface
+ @param dx,dy (NvS16) left-top corner of destination rectangle
+ @param w,h (NvS16) width & height of the rectangle in pixels and scan lines
+ @param sx,sy (NvS16) left-top corner of source rectangle
+ @param color (NvU16) color applied to non-transparent source data bit
+ @param srcStride (NvS16) source stride in bytes
+ @param pMonoBits (NvU8*) pointer to monochome (1bpp) bitmap
+ @param selectTrans (NvS16) transparency select: 0 or 1
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ This function is similar to GFGxCopyMonoBitmapEx() except for the selectTrans
+ parameter. This parameter indicates whether bit data equal to 0 or 1 is going to be
+ transparent.
+
+ This function could be used for drawing a transparent text string or character.
+
+
+ @see GFGxCopyMonoBitmapEx()
+*/
+GF_RETTYPE GFGxCopyTransMonoBitmapEx( GFGxHandle GxHandle,
+ PGFRMSURFACE pSurf,
+ NvS16 dx, NvS16 dy,
+ NvS16 w, NvS16 h,
+ NvS16 sx, NvS16 sy,
+ NvU32 color,
+ NvS16 srcStride,
+ NvU8 *pMonoBits,
+ NvS16 selectTrans);
+
+/** This function copies a source bitmap from system memory to the video memory.
+ The source bitmap's color depth must match the destination's video memory's color depth.
+ Video memory location is specified by the surface parameter.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param pSurf (#PGFRMSURFACE) pointer to destination surface
+ @param dx,dy (NvS16) left-top corner of destination rectangle
+ @param w,h (NvS16) width & height of the rectangle in pixels and scan lines
+ @param sx,sy (NvS16) left-top corner of source rectangle
+ @param srcStride (NvS16) source stride in bytes, must be pixel size aligned
+ @param pColorBits (NvU8*) pointer to color bitmap
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+
+ @see GFGxCopyMonoBitmap()
+*/
+GF_RETTYPE GFGxCopyColorBitmapEx( GFGxHandle GxHandle,
+ PGFRMSURFACE pSurf,
+ NvS16 dx, NvS16 dy,
+ NvS16 w, NvS16 h,
+ NvS16 sx, NvS16 sy,
+ NvS16 srcStride,
+ NvU8 *pColorBits
+ );
+
+/** This function draws a line from a point x1, y1 to another point x2, y2 with a specified color
+ and ROP2 code.
+ Video memory location is specified by the surface parameter.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param pSurf (#PGFRMSURFACE) pointer to destination surface
+ @param x1,y1 (NvU16) (x,y) destination point coords
+ @param x2,y2 (NvU16) (x,y) source point coords
+ @param rop2 (NvU16) ROP2 code
+ @param color (NvU16) color key for transparent blt or pattern color
+ @param flags (NvU16) refere to GFGX_LINE_X flag definitions
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+
+ @see GFGxLine()
+*/
+GF_RETTYPE GFGxLineEx( GFGxHandle GxHandle,
+ PGFRMSURFACE pSurf,
+ NvU16 x1, NvU16 y1,
+ NvU16 x2, NvU16 y2,
+ NvU16 rop2, NvU32 color,
+ NvU16 flags);
+
+GF_RETTYPE GFGxBltFullScreenEx(GFGxHandle GxHandle,
+ PGFRMSURFACE pSurf,
+ const GFGXBLTPARAM *pBltParam);
+/** This function copies a rectangular image in the video memory to another location in the same video
+ memory without taking care of overlapping cases.
+ Video memory location is specified by the surface parameter.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param pSurf (#PGFRMSURFACE) pointer to destination surface
+ @param dx,dy (NvS16) left-top corner of destination rectangle
+ @param w,h (NvS16) width & height of rectangles
+ @param sx,sy (NvS16) left-top corner of source rectangle
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ This is a special case of GxCopyRect(). It does not check on destructions
+ of copied image on video memory due to overlapping source and destination locations.
+
+
+ @see GFGxCopyRectEx(), GFGxCopyRect(), GFGxCopyRectDirect()
+*/
+GF_RETTYPE GFGxCopyRectDirectEx(GFGxHandle GxHandle,
+ PGFRMSURFACE pSurfNvS16,
+ NvS16 dx, NvS16 dy,
+ NvS16 w, NvS16 h,
+ NvS16 sx, NvS16 sy);
+
+/** This function copies a source bitmap from system memory to the video memory with
+ certain restrictions.
+ Video memory location is specified by the surface parameter.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param pSurf (#PGFRMSURFACE) pointer to destination surface
+ @param pColorBits (NvU32*) pointer to color bitmap
+ @param bitmapSize (NvU16) total bytes to transfer
+ @param rect (#GFRECT) destination rectangle
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ This is a special case of GxCopyColorBitmap(). Conditions below must be verified :
+ - The source bitmap pointer, pColorBits, has to be a 32-bit (DWORD) aligned address.
+ - The size of each line of the source bitmap must be 64-bits (8 bytes, QWORD) aligned.
+ - There must not be any skipping bytes between lines.
+ - Total bitmap size has to be smaller than or equal to 2K (2048) bytes.
+ - The source bitmap's color depth MUST match the destination video memory's color depth.
+
+
+ @see GxCopyColorBitmap(), GFGxCopyPackedColorBitmap()
+*/
+GF_RETTYPE GFGxCopyPackedColorBitmapEx( GFGxHandle GxHandle,
+ PGFRMSURFACE pSurf,
+ NvU32 *pColorBits,
+ NvU16 bitmapSize,
+ GFRECT rect
+/** This function performs a surface-to-surface blit. The color depth of the source
+ surface must match that of the destination. Also, the width and height of the
+ source must be the same as the destination's width and height.
+ Alphablending parameters can be specified.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param ppDestSurf (#PGFRMSURFACE*)pointer to destination surface pointer
+ @param ppSrcSurf (#PGFRMSURFACE) pointer so source surface pointer
+ @param w,h (NvS16) width & height of the rectangle in pixels and scan lines
+ @param rop3 (NvU16) raster operation code
+ @param srcStartAddr (NvU32) start address relative to the source surface
+ @param dstStartAddr (NvU32) start address relative to the destination surface
+ @param flags (NvU32) refer to GFGX_BLT_X flag definitions
+ @param flagex1 (NvU32) refer to alphablending flag definitions GFGXEX1_BLT_X
+ @param colorCompare (NvU32) color key for transparent blit
+ @param alpha (NvU16) alpha value for GFGX_BLT_ALPHA_FIXED or alphaFg
+ @param alphaBg (NvU16) background alpha
+
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+
+ @see GFGxCopyRect(), GFGxCopyRectDirect(), GFGxBltSurface(), GFGxCopyMonoBitmap(),
+ GFGxCopyTransMonoBitmap(), GFGxCopyColorBitmap()
+*/ );
+GF_RETTYPE GFGxBltSurfaceEx( GFGxHandle GxHandle, PGFRMSURFACE *ppDestSurf,
+ PGFRMSURFACE *ppSrcSurf,
+ NvS16 w, NvS16 h, NvU16 rop3,
+ NvU32 srcStartAddr, NvU32 dstStartAddr,
+ NvU32 flags, NvU32 flagex1, NvU32 colorCompare,
+ NvU16 alpha, NvU16 alphaBg);
+
+ /* New API's based on new features */
+
+/*******************************New API's based on New Features***********************************/
+
+/** This function is used to transform a given source rectangle to the given destination
+ location in the video memory.
+
+ Rotation takes place in counterclockwise direction.
+
+ Destination rectangle can be same than source rectangle or different.
+ Both source and destination must be in video memory.
+
+ Common input data requirements :
+
+ - the data buffer must be aligned on all edges (top, bottom, left, right), which also implies
+ that stride is multiple of 16 bytes,
+ - the base address of both source and destination must be aligned at a 128-bit word aligned,
+ - in GFGX_BLT_SURFACE mode, source and destination must be same format : GF_SURFACE_RGB8,
+ GF_SURFACE_RGB565, GF_SURFACE_ARGB8888, or GF_SURFACE_YUV420,
+ - GFGX_BLT_MODE_LINEAR and X/Y modes are also supported for GF_SURFACE_RGB8, GF_SURFACE_RGB565
+ and GF_SURFACE_ARGB8888,
+ - width and height must be multiple of 16 pixels in 8bpp mode, 8 in 16bpp and 4 in 32bpp for
+ GF_SURFACE_RGB8, GF_SURFACE_RGB565 and GF_SURFACE_ARGB8888 surfaces,
+ - in GFGXEX2_FAST_ROTATE_SQUARE mode, width should be equal to height for 90, 270,
+ TRANS_LR and TRANS_RL modes. Also the destination surface should be same as source
+ surface.
+
+ Specific GF_SURFACE_YUV420 input data requirements :
+
+ - only GFGX_BLT_SURFACE mode is supported, with no offsets defined for both source and
+ destination (dstStartAddr = srcStartAddr = 0).
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param pBltParam (#GFGXBLTPARAM*) refere to structure definition
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+
+ This function can be used the same way than GFGxBlt, adding flagex2 information.
+
+ The following transformations are supported :
+
+
+
+ #GFGXEX2_FAST_ROTATE_FLIP_X
+ FLIP-X.
+ #GFGXEX2_FAST_ROTATE_FLIP_Y
+ FLIP-Y.
+ #GFGXEX2_FAST_ROTATE_TRANS_LR
+ TRANSPOSE LEFT-RIGHT.
+ #GFGXEX2_FAST_ROTATE_TRANS_RL
+ TRANSPOSE RIGHT-LEFT.
+ #GFGXEX2_FAST_ROTATE_ROT_90
+ 90 rotation.
+ #GFGXEX2_FAST_ROTATE_ROT_180
+ 180 rotation.
+ #GFGXEX2_FAST_ROTATE_ROT_270
+ 270 rotation.
+
+
+
+ @see GFGxBlt()
+*/
+GF_RETTYPE GFGxFastRotate(GFGxHandle GxHandle,
+ const GFGXBLTPARAM *pBltParam);
+/** This function copies a source bitmap from system memory to the video memory.
+ The source bitmap's color depth must match the destination's video memory's color depth.
+ Source transparency is supported.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param dx,dy (NvS16) left-top corner of destination rectangle
+ @param w,h (NvS16) width & height of the rectangle in pixels and scan lines
+ @param sx,sy (NvS16) left-top corner of source rectangle
+ @param srcStride (NvS16) source stride in bytes, must be pixel size aligned
+ @param pColorBits (NvU8*) pointer to color bitmap
+ @param pSrcColorKey (NvU32*) pointer to source color key. If NULL no transparency.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+
+ @see GFGxCopyMonoBitmap(), GFGxCopyColorBitmap()
+*/
+GF_RETTYPE GFGxCopyTransColorBitmap(GFGxHandle GxHandle,
+ NvS16 dx,
+ NvS16 dy,
+ NvS16 w,
+ NvS16 h,
+ NvS16 sx,
+ NvS16 sy,
+ NvS16 srcStride,
+ NvU8 *pColorBits,
+ NvU32 *pSrcColorKey);
+/** This function copies a source bitmap from system memory to the video memory with a mono
+ pattern buffer combination.
+ The source bitmap's color depth must match the destination's video memory's color depth.
+ Source and mono pattern transparencies are supported.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param dx,dy (NvS16) left-top corner of destination rectangle
+ @param w,h (NvS16) width & height of the rectangle in pixels and scan lines
+ @param sx,sy (NvS16) left-top corner of source rectangle
+ @param srcStride (NvS16) source stride in bytes, must be pixel size aligned
+ @param pColorBits (NvU8*) pointer to color bitmap
+ @param pSrcColorKey (NvU32*) pointer to source color key. If NULL no transparency.
+ @param rop3 (NvU8) raster operation code
+ @param pPatBuffer (NvU8*) pointer to pattern buffer
+ @param patFgColor (NvU32) pattern foreground color
+ @param patBgColor (NvU32) pattern background color
+ @param patW, patH (NvU32) width & height of pattern buffer
+ @param patStride (NvU32) pattern stride in bytes
+ @param pSelectPatTrans (NvU16*) pointer to pattern color key. If NULL no transparency.
+
+ Depending of pattern size, replicated mode is used or not.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+
+ @see GFGxCopyTransColorBitmap(), GFGxCopyColorBitmap()
+*/
+GF_RETTYPE GFGxCopyTransColorBitmapWithMonoPattern(GFGxHandle GxHandle,
+ NvS16 dx,
+ NvS16 dy,
+ NvS16 w,
+ NvS16 h,
+ NvS16 sx,
+ NvS16 sy,
+ NvS16 srcStride,
+ NvU8 *pColorBits,
+ NvU32 *pSrcColorKey,
+ NvU8 rop3,
+ NvU8 *pPatBuffer,
+ NvU32 patFgColor,
+ NvU32 patBgColor,
+ NvU32 patW,
+ NvU32 patH,
+ NvU32 patStride,
+ NvU16 *pSelectPatTrans);
+/** This function copies a source bitmap from system memory to the video memory with a colour
+ pattern buffer combination.
+ The source bitmap and pattern's color depth must match the destination's video memory's color depth.
+ Source and color pattern transparencies are supported.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param dx,dy (NvS16) left-top corner of destination rectangle
+ @param w,h (NvS16) width & height of the rectangle in pixels and scan lines
+ @param sx,sy (NvS16) left-top corner of source rectangle
+ @param srcStride (NvS16) source stride in bytes, must be pixel size aligned
+ @param pColorBits (NvU8*) pointer to color bitmap
+ @param pSrcColorKey (NvU32*) pointer to source color key. If NULL no transparency.
+ @param rop3 (NvU8) raster operation code
+ @param pPatBuffer (NvU8*) pointer to pattern buffer
+ @param patW, patH (NvU32) width & height of pattern buffer
+ @param patStride (NvU32) pattern stride in bytes
+ @param pPatColorKey (NvU32*) pointer to pattern color key. If NULL no transparency.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+
+ @see GFGxCopyTransColorBitmap(), GFGxCopyColorBitmap(), GFGxCopyTransColorBitmapWithMonoPattern()
+*/
+GF_RETTYPE GFGxCopyTransColorBitmapWithColorPattern(GFGxHandle GxHandle,
+ NvS16 dx,
+ NvS16 dy,
+ NvS16 w,
+ NvS16 h,
+ NvS16 sx,
+ NvS16 sy,
+ NvS16 srcStride,
+ NvU8 *pColorBits,
+ NvU32 *pSrcColorKey,
+ NvU8 rop3,
+ NvU8 *pPatBuffer,
+ NvU32 patW,
+ NvU32 patH,
+ NvU32 patStride,
+ NvU32 *pPatColorKey);
+/** This function copies a source bitmap from system memory to the video memory with a mono
+ pattern buffer combination.
+ The source bitmap and pattern are mono (1BPP).
+ Mono source and mono pattern transparencies are supported.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param dx,dy (NvS16) left-top corner of destination rectangle
+ @param w,h (NvS16) width & height of the rectangle in pixels and scan lines
+ @param sx,sy (NvS16) left-top corner of source rectangle
+ @param srcFgColor (NvU32) source foreground color
+ @param srcBgColor (NvU32) source background color
+ @param srcStride (NvS16) source stride in bytes
+ @param pMonoBits (NvU8*) pointer to source bitmap
+ @param pSelectSrcTrans (NvU16*) pointer to source color key. If NULL no transparency.
+ @param rop3 (NvU8) raster operation code
+ @param pPatBuffer (NvU8*) pointer to pattern buffer
+ @param patFgColor (NvU32) pattern foreground color
+ @param patBgColor (NvU32) pattern background color
+ @param patW, patH (NvU32) width & height of pattern buffer
+ @param patStride (NvU32) pattern stride in bytes
+ @param pSelectPatTrans (NvU16*) pointer to pattern color key. If NULL no transparency.
+
+ Depending of pattern size, replicated mode is used or not.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+
+ @see GFGxCopyTransColorBitmap(), GFGxCopyTransMonoBitmap()
+*/
+GF_RETTYPE GFGxCopyTransMonoBitmapWithMonoPattern(GFGxHandle GxHandle,
+ NvS16 dx,
+ NvS16 dy,
+ NvS16 w,
+ NvS16 h,
+ NvS16 sx,
+ NvS16 sy,
+ NvU32 srcFgColor,
+ NvU32 srcBgColor,
+ NvS16 srcStride,
+ NvU8 *pMonoBits,
+ NvU16 *pSelectSrcTrans,
+ NvU8 rop3,
+ NvU8 *pPatBuffer,
+ NvU32 patFgColor,
+ NvU32 patBgColor,
+ NvU32 patW,
+ NvU32 patH,
+ NvU32 patStride,
+ NvU16 *pSelectPatTrans);
+/** This function copies a source bitmap from system memory to the video memory with a color
+ pattern buffer combination.
+ The source bitmap is mono (1BPP).
+ Mono source and color pattern transparencies are supported.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param dx,dy (NvS16) left-top corner of destination rectangle
+ @param w,h (NvS16) width & height of the rectangle in pixels and scan lines
+ @param sx,sy (NvS16) left-top corner of source rectangle
+ @param srcFgColor (NvU32) source foreground color
+ @param srcBgColor (NvU32) source background color
+ @param srcStride (NvS16) source stride in bytes
+ @param pMonoBits (NvU8*) pointer to source bitmap
+ @param pSelectSrcTrans (NvU16*) pointer to source color key. If NULL no transparency.
+ @param rop3 (NvU8) raster operation code
+ @param pPatBuffer (NvU8*) pointer to pattern buffer
+ @param patW, patH (NvU32) width & height of pattern buffer
+ @param patStride (NvU32) pattern stride in bytes
+ @param pPatColorKey (NvU32*) pointer to pattern color key. If NULL no transparency.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+
+ @see GFGxCopyTransMonoBitmap(), GFGxCopyTransMonoBitmapWithMonoPattern()
+*/
+GF_RETTYPE GFGxCopyTransMonoBitmapWithColorPattern(GFGxHandle GxHandle,
+ NvS16 dx,
+ NvS16 dy,
+ NvS16 w,
+ NvS16 h,
+ NvS16 sx,
+ NvS16 sy,
+ NvU32 srcFgColor,
+ NvU32 srcBgColor,
+ NvS16 srcStride,
+ NvU8 *pMonoBits,
+ NvU16 *pSelectSrcTrans,
+ NvU8 rop3,
+ NvU8 *pPatBuffer,
+ NvU32 patW,
+ NvU32 patH,
+ NvU32 patStride,
+ NvU32 *pPatColorKey);
+
+/** This function purges the graphics cache used to store pattern buffers when
+ GFGX_BLT_PAT_CACHE is used.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+
+ @retval #GF_SUCCESS Success
+ @retval #GFGX_ERROR_NULL_PARAMETER Invalid GxHandle
+
+ @see GFGxBlt()
+*/
+GF_RETTYPE GFGxCachePurge(GFGxHandle GxHandle);
+
+// Typesafe functions for opening and closing this component
+GF_RETTYPE GFGxOpen(GFRmHandle hRm, GFGxHandle *phGx,
+ GF_STATE_TYPE state, GFRmChHandle hCh);
+void GFGxClose(GFGxHandle *phGx);
+
+/*@}*/
+/*@}*/
+
+#ifdef __cplusplus
+}
+#endif
+
+/** @page pageGxAppNotes GxAPI Application Notes
+
+ @section pageGxAppNotes1 Todo
+
+*/
+
+#endif // _GFGx_H_
diff --git a/Start_WM/test6/inc/GFGxError.h b/Start_WM/test6/inc/GFGxError.h
new file mode 100755
index 00000000..64e84624
--- /dev/null
+++ b/Start_WM/test6/inc/GFGxError.h
@@ -0,0 +1,46 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/*
+ * File: GFGxError.h
+ * GFSDK Gx Graphics API header file.
+ */
+
+#ifndef __GFGXERROR_H__
+#define __GFGXERROR_H__
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+/** GFGxAPI error code: Bad parameter. */
+#define GFGX_ERROR_ILLEGAL_PARAMETER (GFGX_ERROR | 0x00000001L)
+#define GFGX_ERROR_NULL_SURFACE (GFGX_ERROR | 0x00000002L)
+/** GFGxAPI error code: Color depth not supported. */
+#define GFGX_ERROR_COLORDEPTH_NOT_SUPPORTED (GFGX_ERROR | 0x00000003L)
+#define GFGX_ERROR_ILLEGAL_ALPHA_MODE (GFGX_ERROR | 0x00000004L)
+#define GFGX_ERROR_ILLEGAL_ROTATION_FLAG (GFGX_ERROR | 0x00000005L)
+#define GFGX_ERROR_GETTING_COMPONENT (GFGX_ERROR | 0x00000006L)
+#define GFGX_ERROR_NO_PRIMARY_SURFACE (GFGX_ERROR | 0x00000007L)
+#define GFGX_ERROR_NO_COLORCONVERT_SUPPORT (GFGX_ERROR | 0x00000008L)
+#define GFGX_ERROR_NULL_PARAMETER (GFGX_ERROR | 0x00000009L)
+/** GFGxAPI error code: Function not supported. */
+#define GFGX_ERROR_NOT_SUPPORTED (GFGX_ERROR | 0x0000000AL)
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // __GFGXERROR_H__
+
+
+
diff --git a/Start_WM/test6/inc/GFI2C.h b/Start_WM/test6/inc/GFI2C.h
new file mode 100755
index 00000000..458a21c0
--- /dev/null
+++ b/Start_WM/test6/inc/GFI2C.h
@@ -0,0 +1,314 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/** @file GFI2C.h
+ GFSDK I2C API header file.
+*/
+
+#ifndef __I2C_H__
+#define __I2C_H__
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/** @addtogroup groupI2C I2CAPI I2C API
+*/
+/*@{*/
+
+/** GFI2C Error code: Function was passed an illegal parameter. */
+#define GFI2C_ERROR_ILLEGAL_PARAMETER (GFI2C_ERROR | 0x00000001L)
+/** GFI2C Error code: I2C slave device did not respond with ack signal. */
+#define GFI2C_ERROR_ACKNOWLEDGE_FAILURE (GFI2C_ERROR | 0x00000002L)
+/** GFI2C Error code: Polling routine generated a timeout error. */
+#define GFI2C_ERROR_TIMEOUT_ERROR (GFI2C_ERROR | 0x00000003L)
+
+/** Enum specifies attribute ids for GFI2CSetAttribute()
+ @see GFI2CSetAttribute()
+*/
+typedef enum _GFI2CATTRIBUTES
+{
+ GFI2C_ATTR_PULLUP, /**< Set internal I2C pullups, see GFI2C_ATTR_PULLUP_FLAGS. */
+ GFI2C_ATTR_SW, /**< Set to use GPIO for SW I2C */
+ GFI2C_ATTR_HW, /**< Set to use HW I2C (default) */
+ GFI2C_ATTR_TIMING, /**< I2C timing mode, valid for GFI2C_ATTR_HW mode only, see GFI2C_TIMING */
+ GFI2C_ATTR_RESPTIMEOUT /**< Set I2C Ack response timeout in ms */
+
+} GFI2CATTRIBUTES;
+
+/** Flag bits for for GFI2C_ATTR_PULLUP attribute.
+
+ Usage example:
+
+ attr = (SP_SCL_PULLUP_DISABLE | SP_SDA_PULLUP_DISABLE)
+ GFI2CSetAttribute(I2CHandle, GFI2C_ATTR_PULLUP, attr)
+
+
+ @see GFI2CSetAttribute(), GFI2CATTRIBUTES
+*/
+typedef enum _GFI2C_ATTR_PULLUP_FLAGS
+{
+ SDA_PULLDOWN_DISABLE = 0, //!< Flag to disable I2C data pull down
+ SDA_PULLDOWN_ENABLE = 1, //!< Flag to enable I2C data pull down
+ SDA_PULLUP_DISABLE = 0, //!< Flag to disable I2C data pull up
+ SDA_PULLUP_ENABLE = 1, //!< Flag to enable I2C data pull up
+ SCL_PULLDOWN_DISABLE = 0, //!< Flag to disable I2C clock pull down
+ SCL_PULLDOWN_ENABLE = 1, //!< Flag to enable I2C clock pull down
+ SCL_PULLUP_DISABLE = 0, //!< Flag to disable I2C data pull up
+ SCL_PULLUP_ENABLE = 0, //!< Flag to enable I2C clock pull up
+ SCL_DEFAULT = 0, //!< Flag sets I2C clock back to default
+ SDA_DEFAULT = 0 //!< Flag sets I2C data back to default
+
+} GFI2C_ATTR_PULLUP_FLAGS;
+
+/** Timing modes for GFI2C_ATTR_TIMING attribute.
+
+ The timing mode has effect for I2C HW mode (GFI2C_ATTR_HW) only.
+
+ It affects the programming of IC_IC_CONFIG_0/THDCTL and
+ IC_TCOMMAND_0/SPEED_CTL registers.
+*/
+typedef enum _GFI2C_TIMING
+{
+ /** Standard timing (default).
+ IC_TCOMMAND_0, SPEED_CTL is programmed to STD_MODE (standard timing).
+ */
+ GFI2C_TIMING_STANDARD = 0,
+
+ /** Fast mode with 2 clocks extended hold time.
+ IC_TCOMMAND_0, SPEED_CTL is programmed to FAST_MODE.
+ IC_IC_CONFIG_0, THDCTL is programmed to b'10 (add 2 clocks to hold time).
+ */
+ GFI2C_TIMING_FASTADD2CLK
+
+} GFI2C_TIMING;
+
+typedef struct _GFI2CTABLE
+{
+ GF_RETTYPE (* I2CWrite)( GFI2CHandle I2CHandle,
+ NvU32 slaveAddr,
+ NvU8 *pDataBytes,
+ NvU32 len,
+ NvU32 delayInMSec );
+
+ GF_RETTYPE (* I2CRead)( GFI2CHandle I2CHandle,
+ NvU32 slaveAddr,
+ NvU8 *pDataBytes,
+ NvU32 len,
+ NvU32 delayInMSec );
+
+ GF_RETTYPE (* I2CRestartRead)( GFI2CHandle I2CHandle,
+ NvU32 slaveAddr,
+ NvU32 index,
+ NvU8 *pDataBytes,
+ NvU32 len,
+ NvU32 delayInMSec );
+
+ GF_RETTYPE (* I2CScan)( GFI2CHandle I2CHandle,
+ NvU16 slaveAddr );
+
+ GF_RETTYPE (* I2CPowerSwitch)( GFI2CHandle I2CHandle, NvU8 status);
+
+ GF_RETTYPE (* I2CGetProperty)( GFI2CHandle I2CHandle,
+ PGFPROPERTY pI2CProp );
+
+ GF_RETTYPE (* I2CSetAttribute)(GFI2CHandle I2CHandle, NvU32 aid, NvU32 attr);
+ GF_RETTYPE (* I2CSetClock)( GFI2CHandle I2CHandle, NvU32 selectclock);
+ GF_RETTYPE (* I2CWritePrepare)( GFI2CHandle I2CHandle,
+ NvU32 slaveAddr,
+ NvU32 *pData,
+ NvU32 len,
+ NvU32 *pBuffer,
+ NvU32 *bufferSize);
+ GF_RETTYPE (* I2CRestartWrite)( GFI2CHandle I2CHandle,
+ NvU32 slaveAddr1,
+ NvU8 *pIndexBytes,
+ NvU32 lenIndex,
+ NvU32 slaveAddr2,
+ NvU8 *pDataBytes,
+ NvU32 lenData,
+ NvU32 delayInMSec );
+
+} GFI2CTABLE, *PGFI2CTABLE;
+
+/** Open GFI2C component.
+ @param hRm RM handle
+ @param phI2C Returns I2C component handle on success
+ @param state Channel allocation mode
+ @param hCh Channel to use, or NULL to allocate new
+*/
+GF_RETTYPE GFI2COpen(GFRmHandle hRm, GFI2CHandle *phI2C, GF_STATE_TYPE state, GFRmChHandle hCh);
+
+/** Close GFi@c component.
+ @param phI2C I2C component handle, will be reset to NULL. Can be NULL.
+*/
+void GFI2CClose(GFI2CHandle *phI2C);
+
+/** This routine writes out len bytes of data during one I2C transfer.
+
+ @param I2CHandle (#GFI2CHandle) Handle to I2CAPI
+ @param slaveAddr (NvU32) I2C address of slave device
+ @param pDataBytes (NvU8) Pointer to data bytes to be written
+ @param len (NvU32) Number of bytes of data to be written
+ @param delayInMSec (NvU32) Optional delay inserted after transfer
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+*/
+#define GFI2CWrite(I2CHandle, slaveAddr, pDataBytes, len, delayInMSec) \
+ ((PGFI2CTABLE)I2CHandle)->I2CWrite(I2CHandle, slaveAddr, pDataBytes, len, delayInMSec)
+
+/** This routine reads len bytes of data during one I2C transfer. A typical I2C slave
+ device requires its address already be set by a preceding GFI2CWrite() function.
+ These functions should be executed together with no other activity in between.
+
+ @param I2CHandle (#GFI2CHandle) Handle to I2CAPI
+ @param slaveAddr (NvU32) I2C address of slave device
+ @param pDataBytes (NvU8) Pointer to data bytes read from device
+ @param len (NvU32) Number of bytes of data to be read
+ @param delayInMSec (NvU32) Optional delay inserted after transfer
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+*/
+#define GFI2CRead(I2CHandle, slaveAddr, pDataBytes, len, delayInMSec) \
+ ((PGFI2CTABLE)I2CHandle)->I2CRead(I2CHandle, slaveAddr, pDataBytes, len, delayInMSec)
+
+/** This function reads in len or fewer bytes of data from an I2C slave device. It differs
+ from the GFI2CRead() function in that it does so with a combination of an I2C write and
+ read. There is an I2C write of the slave address and index byte then followed by a START
+ condition. There is no STOP condition in-between the write and read transactions.
+
+ @param I2CHandle (#GFI2CHandle) Handle to I2CAPI
+ @param slaveAddr (NvU32) I2C address of slave device
+ @param index (NvU32) 2nd byte index of slave device register
+ @param pDataBytes (NvU8) Pointer to data bytes read from device
+ @param len (NvU32) Number of bytes of data to be read
+ @param delayInMSec (NvU32) Optional delay inserted after transfer
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+*/
+#define GFI2CRestartRead(I2CHandle, slaveAddr, index, pDataBytes, len, delayInMSec) \
+ ((PGFI2CTABLE)I2CHandle)->I2CRestartRead(I2CHandle, slaveAddr, index, pDataBytes, len, delayInMSec)
+
+/** This routine writes out a I2C slave address and checks for an ACK.
+
+ @param I2CHandle (#GFI2CHandle) Handle to I2CAPI
+ @param slaveAddr (NvU32) I2C address of slave device
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+*/
+#define GFI2CScan(I2CHandle, slaveAddr) \
+ ((PGFI2CTABLE)I2CHandle)->I2CScan(I2CHandle, slaveAddr)
+
+/** This function has been replaced by camera scripting. Camera power is now
+ controlled by a function in the camera scripts.
+*/
+#define GFI2CPowerSwitch(I2CHandle, status) \
+ ((PGFI2CTABLE)I2CHandle)->I2CPowerSwitch(I2CHandle, status)
+
+/** This routine sets various I2C attributes. The aid parameter passes an
+ enumeration GFI2CATTRIBUTES that selects the attribute operation. Each
+ attribute has a set of defined values passed in the parameter attr, that
+ it will operate on.
+
+ @param I2CHandle (#GFI2CHandle) Handle to I2CAPI
+ @param aid (NvU32) attribute flag
+ @param attr (NvU32) attribute data value
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ @see GFI2CATTRIBUTES
+
+*/
+#define GFI2CSetAttribute( I2CHandle, aid, attr) \
+ ((PGFI2CTABLE)I2CHandle)->I2CSetAttribute(I2CHandle, aid, attr )
+
+/** This routine sets the I2C clock output on the SCL pin. The parameter
+ selectclock specifies the new I2C clock in kilohertz. The default
+ is 100. If selectclock = 0, then the default will be set.
+
+ @param I2CHandle (#GFI2CHandle) Handle to I2CAPI
+ @param selectclock (NvU32) new clock value in kHz.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+*/
+#define GFI2CSetClock(I2CHandle, selectclock) \
+ ((PGFI2CTABLE)I2CHandle)->I2CSetClock(I2CHandle, selectclock)
+
+/** This routine Provide properties about I2C.
+
+ @param I2CHandle (#GFI2CHandle) Handle to I2CAPI
+ @param pProp (GFPROPERTY) pointer to GFPROPERTY struct.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+*/
+#define GFI2CGetProperty(I2CHandle, pProp) \
+ ((PGFI2CTABLE)I2CHandle)->I2CGetProperty(I2CHandle, pProp)
+
+/** This function prepares a buffer that contains the command sequence for an
+ I2C write. This may concatenated onto another command sequence and written
+ to the channel as a combination of two transactions.
+
+ @param I2CHandle (#GFI2CHandle) Handle to I2CAPI
+ @param slaveAddr (NvU32) I2C address of slave device
+ @param pData (NvU8) Pointer to data bytes to be written
+ @param len (NvU32) Number of bytes of data to be read
+ @param pBuffer (NvU8) Pointer to command sequence for I2C write
+ @param bufferSize (NvU32) Number of commands returned
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+*/
+#define GFI2CWritePrepare(I2CHandle, slaveAddr, pData, len, pBuffer, bufferSize) \
+ ((PGFI2CTABLE)I2CHandle)->I2CWritePrepare(I2CHandle, slaveAddr, pData, len, pBuffer, bufferSize)
+
+/** This function writes lenData bytes of data to an I2C slave device. It differs
+ from the GFI2CWrite() function in that it does so with a combination of two I2C writes
+ There is an I2C write of the slave address and index bytes then followed by a START
+ condition. There is no STOP condition in-between the write and write transactions.
+
+ @param I2CHandle (#GFI2CHandle) Handle to I2CAPI
+ @param slaveAddr1 (NvU32) I2C address of 1st slave device
+ @param pDataIndex (NvU8) Pointer to index data to be written to the 1st device
+ @param lenIndex (NvU32) index data length
+ @param slaveAddr2 (NvU32) I2C address of 2nd slave device
+ @param pDataBytes (NvU8) Pointer to data bytes written to 2nd device
+ @param lenData (NvU32) Number of bytes of data to be read
+ @param delayInMSec (NvU32) Optional delay inserted after transfer
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+*/
+#define GFI2CRestartWrite(I2CHandle, slaveAddr1, pIndexBytes, lenIndex, \
+ slaveAddr2, pDataBytes, lenData, delayInMSec) \
+ ((PGFI2CTABLE)I2CHandle)->I2CRestartWrite(I2CHandle, slaveAddr1, pIndexBytes, lenIndex, \
+ slaveAddr2, pDataBytes, lenData, delayInMSec)
+
+/*@}*/
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __I2C_H__ */
+
diff --git a/Start_WM/test6/inc/GFI2S.h b/Start_WM/test6/inc/GFI2S.h
new file mode 100755
index 00000000..bbfd876e
--- /dev/null
+++ b/Start_WM/test6/inc/GFI2S.h
@@ -0,0 +1,49 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/*
+* File: GFi2s.h
+* I2S header file.
+*/
+
+
+#ifndef __I2S_H__
+#define __I2S_H__
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+// Typesafe functions for opening and closing this component
+GF_RETTYPE GFI2SOpen(GFRmHandle hRm, GFI2SHandle *phI2S,
+ GF_STATE_TYPE state, GFRmChHandle hCh);
+void GFI2SClose(GFI2SHandle *phI2S);
+
+GF_RETTYPE GFI2SSetTransmitBuffer(GFI2SHandle I2SHandle,
+ NvU32 startAddr,
+ NvU32 sizeBytes,
+ NvU32 numBuffers);
+
+GF_RETTYPE GFI2SSetTransmitState(GFI2SHandle I2SHandle,
+ NvU32 state);
+
+GF_RETTYPE GFI2SSetReceiveBuffer(GFI2SHandle I2SHandle,
+ NvU32 startAddr,
+ NvU32 sizeBytes,
+ NvU32 numBuffers);
+
+GF_RETTYPE GFI2SSetReceiveState(GFI2SHandle I2SHandle,
+ NvU32 state);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __I2S_H__ */
diff --git a/Start_WM/test6/inc/GFINTx.h b/Start_WM/test6/inc/GFINTx.h
new file mode 100755
index 00000000..2b45eb76
--- /dev/null
+++ b/Start_WM/test6/inc/GFINTx.h
@@ -0,0 +1,114 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/** @file GFINTx.h
+ GFSDK Interrupt API header file.
+*/
+
+#ifndef __GFINTx_H__
+#define __GFINTx_H__
+
+#include "GFRmOEM.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+/** @addtogroup groupINTx INTxAPI Interrupt API
+*/
+/*@{*/
+
+#define GF_INTR_START 0
+#define GF_INTR_END 15
+
+/* Embedded memory controller interrupt */
+#define GF_EMC_INTR (15)
+
+/* MC interrupt. */
+#define GF_MC_INTR (14)
+
+/* SD interrupt. */
+#define GF_SD_INTR (13)
+
+/* I2C interrupt. */
+#define GF_IC_INTR (12)
+
+/* I2s interrupt. */
+#define GF_I2S_INTR (11)
+
+/* Display interrupt. */
+#define GF_DISPLAY_INTR (10)
+
+/* 3d interrupt. */
+#define GF_GR3D_INTR (9)
+
+/* 2d interrupt. */
+#define GF_GR2D_INTR (8)
+
+/* DSP interrupt. */
+#define GF_DSP_INTR (7)
+
+/* ISP interrupt. */
+#define GF_ISP_INTR (6)
+
+/* SDGP1 input falling edge interrupt. */
+#define GF_EPP_INTR (5)
+
+/* VI interrupt. */
+#define GF_VI_INTR (4)
+
+/* JPEG Encoder interrupt. */
+#define GF_JPEGE_INTR (3)
+
+/* Mpeg Encoder interrupt. */
+#define GF_ME_INTR (2)
+
+/* Graphics MPD interrupt. */
+#define GF_GRMPD_INTR (1)
+
+/* Host interface interrupt. */
+#define GF_HOST_INTR (0)
+
+// Typesafe functions for opening and closing this component
+GF_RETTYPE GFINTxOpen(GFRmHandle hRm, GFINTxHandle *phINTx,
+ GF_STATE_TYPE state, GFRmChHandle hCh);
+void GFINTxClose(GFINTxHandle *phINTx);
+
+/* ### Helper Macros ### */
+GF_RETTYPE GFINTxGetProperty(GFINTxHandle INTxHandle,
+ PGFPROPERTY pINTxProp);
+
+
+GF_RETTYPE GFINTxDisable(GFINTxHandle INTxHandle,
+ NvU32 idInt);
+
+GF_RETTYPE GFINTxEnable(GFINTxHandle INTxHandle,
+ NvU32 idInt);
+
+/** Wait for system level interrupt request.
+ @param handle Handle to INTx API
+ @param idInt System level interrupt ID
+ @param timeout Timeout in miliseconds, or 0 to wait endlessly
+ @retval GF_SUCCESS Interrupt request received
+ @retval GF_WAIT_TIME_OUT Timeout without interrupt request received
+*/
+GF_RETTYPE GFINTxWaitForIRQ(GFINTxHandle INTxHandle,
+ NvU32 idInt,
+ NvU32 timeout);
+
+/*@}*/
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // __GFINTx_H__
+/* End of file. */
+
diff --git a/Start_WM/test6/inc/GFIsp.h b/Start_WM/test6/inc/GFIsp.h
new file mode 100755
index 00000000..b3c7e512
--- /dev/null
+++ b/Start_WM/test6/inc/GFIsp.h
@@ -0,0 +1,1654 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/** @file GFIsp.h
+ GFSDK Image Signal Processing API header file.
+*/
+
+#ifndef _GF_ISP__
+#define _GF_ISP__
+
+//#define DVS_DEVELOPMENT
+
+#include "GFCamera.h"
+#include "GFVx.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+/** @addtogroup groupIsp IspAPI Image Signal Processing API
+
+ As image resolution increases (three megapixels and up), image signal
+ processing inside the imager module becomes complex and costly, and the
+ required bandwidth to transfer processed data to the GPU increases.
+
+ One solution to this problem is to incorporate image signal processing (ISP1)
+ capabilities inside the GPU, and let the imager send raw Bayer Pattern Data
+ from the CMOS or CCD sensor to the GPU. This reduces bandwidth as ISP
+ programming is easier and much faster compared to having the ISP unit
+ inside the imager.
+
+ The ISP pipeline consists of various stages of image processing operations to
+ enhance the image so that its digital representation is as close to the natural
+ look as possible. The ISP pipeline consists of the following stages:
+ - Optical Black Compensation (OB)
+ - De-Knee Linearization
+ - Lens Shading Compensation
+ - White Balance Gain Adjustment (M1, M2, M3 statistics gathering)
+ - Bad Pixel Compensation
+ - Noise Reduction
+ - Demosaicing
+ - Edge Enhancement (M4 statistics gathering)
+ - Color Noise Reduction
+ - Color Correction
+ - Gamma Correction
+ - RGB to YUV conversion
+
+ Besides these pipeline stages, the ISP module also provides a statistics
+ collection mechanism that can be applied to multiple regions of the image.
+ Image statistics information can be used to compute Auto Exposure (AE),
+ Auto White Balance (AWB) and Auto Focus (AF).
+
+ The GFISPAPI sets up parameters for each pipeline functional block. If
+ needed, the user can also choose to bypass each individual functional block.
+ Once all blocks are set up, image data flows through them automatically.
+
+ Figure 1, "Block Diagram of the ISP Interface," shows the ISP with
+ respect to other input blocks such as video input (VI) and the encoder
+ preprocessor (EPP).
+
+ @image html ISPFigure1.bmp
+
+ Figure 2, "Internal ISP Data Flow," shows the data flow inside the
+ ISP.
+
+ @image html ISPFigure2.bmp
+
+*/
+/*@{*/
+
+/** @defgroup groupIspCapability ISP Capability Flags
+ These flags represent the various capabilities of the ISP.
+ @see GFISPPROPERTY
+*/
+/*@{*/
+
+/** IspAPI property flag: Bayer format input supported.
+ @see GFISPGetProperty()
+*/
+#define GFISP_CAP_FORMAT_BAYER 0x00000001
+
+/** IspAPI property flag: Stacked format input supported.
+ @see GFISPGetProperty()
+*/
+#define GFISP_CAP_FORMAT_STACKED 0x00000002
+
+/** IspAPI property flag: Three optical black regions supported.
+ @see GFISPGetProperty(), GFISPOBCONTROL
+*/
+#define GFISP_CAP_THREE_OB_REGIONS 0x00000004
+
+/** IspAPI property flag: Four optical black regions supported.
+ @see GFISPGetProperty(), GFISPOBCONTROL
+*/
+#define GFISP_CAP_FOUR_OB_REGIONS 0x00000008
+
+/** IspAPI property flag: Frame-based optical black supported.
+ @see GFISPGetProperty(), GFISPOBCONTROL
+*/
+#define GFISP_CAP_FRAME_OB 0x00000010
+
+/** IspAPI property flag: Line-based optical black supported.
+ @see GFISPGetProperty(), GFISPOBCONTROL
+*/
+#define GFISP_CAP_LINE_OB 0x00000020
+
+/** IspAPI property flag: Column-based optical black supported.
+ @see GFISPGetProperty()
+*/
+#define GFISP_CAP_COLUMN_OB 0x00000040
+
+/** IspAPI property flag: Deknee (input linearization) supported.
+ @see GFISPGetProperty(), GFISPDEKNEECONTROL
+*/
+#define GFISP_CAP_DE_KNEE 0x00000100
+
+/** IspAPI property flag: Lens shading supported.
+ @see GFISPGetProperty(), GFISPLENSSHADING
+*/
+#define GFISP_CAP_LENSSHADING 0x00000200
+
+/** IspAPI property flag: White balance supported.
+ @see GFISPGetProperty(), GFISPWBCONTROL
+*/
+#define GFISP_CAP_WB 0x00000400
+
+/** IspAPI property flag: Demosaic supported.
+ @see GFISPGetProperty(), GFISPDEMOSAICCONTROL
+*/
+#define GFISP_CAP_DEMOSIAC 0x00000800
+
+/** IspAPI property flag: Edge enhancement supported.
+ @see GFISPGetProperty(), GFISPEDGEENHANCECONTROL
+*/
+#define GFISP_CAP_EDGEENHANCE 0x00001000
+
+/** IspAPI property flag: Bad pixel concealment supported.
+ @see GFISPGetProperty(), GFISPBADPIXELCONTROL
+*/
+#define GFISP_CAP_BADPIXEL 0x00002000
+
+/** IspAPI property flag: Noise reduction supported.
+ @see GFISPGetProperty(), GFISPNOISECONTROL1
+*/
+#define GFISP_CAP_NOISEREDUCTION1 0x00004000
+
+/** IspAPI property flag: Color noise reduction supported.
+ @see GFISPGetProperty(), GFISPNOISECONTROL2
+*/
+#define GFISP_CAP_NOISEREDUCTION2 0x00008000
+
+/** IspAPI property flag: Color correction supported.
+ @see GFISPGetProperty(), GFISPCOLORCORRECTION
+*/
+#define GFISP_CAP_COLORCORRECTION 0x00100000
+
+/** IspAPI property flag: Gamma correction supported.
+ @see GFISPGetProperty(), GFISPGAMMACONTROL
+*/
+#define GFISP_CAP_GAMMACORRECTION 0x00200000
+
+/** IspAPI property flag: YUV conversion supported.
+ @see GFISPGetProperty(), GFISPYUVCONVERSION
+*/
+#define GFISP_CAP_YUVCONVERSION 0x00400000
+
+/** IspAPI property flag: M1 window statistics supported.
+ @see GFISPGetProperty(), GFISPM1WINDOW
+*/
+#define GFISP_CAP_M1 0x01000000
+
+/** IspAPI property flag: M2 window statistics supported.
+ @see GFISPGetProperty(), GFISPM2WINDOW
+*/
+#define GFISP_CAP_M2 0x02000000
+
+/** IspAPI property flag: M3 window statistics supported.
+ @see GFISPGetProperty(), GFISPM3WINDOW
+*/
+#define GFISP_CAP_M3 0x04000000
+
+/** IspAPI property flag: M4 window statistics supported.
+ @see GFISPGetProperty(), GFISPM4WINDOW
+*/
+#define GFISP_CAP_M4 0x08000000
+
+/** IspAPI property flag: Negative effect supported.
+ @see GFISPGetProperty()
+*/
+#define GFISP_CAP_NEGATIVEEFFECT 0x80000000
+/*@}*/
+
+//#define MANUAL_ENABLE_WAIT_FOR_OUTPUT_END 1
+
+/** Struct for ISP version and capabilities.
+ @see GFISPGetProperty
+*/
+typedef struct _GFISPPROPERTY
+{
+ NvU32 size; /**< Actual size of GFISPPROPERTY data structure. */
+ NvU32 version; /**< Version of GFISPAPI. */
+
+ NvU32 cap; /**< Combination of @ref groupIspCapability. Each bit corresponds to one ISP capability. */
+ NvU32 maxWidth, /**< Maximum supported image width. */
+ maxHeight; /**< Maximum image height. */
+ NvU32 supportedScriptVersion; /**< Version of script supported by ISP API. Incorrect script version may cause some API calls to fail. */
+} GFISPPROPERTY, *PGFISPPROPERTY;
+
+
+/** Definition of attribute ids for GFISPGetAttribute() and GFISPSetAttribute().
+*/
+typedef enum _GFISPATTRIBUTES {
+ GFISP_ATTR_ENABLE_ISP, /**< The master switch of ISP. 1 = Enable ISP processing, 0 = Disable */
+ GFISP_ATTR_ENABLE_OB, /**< The master switch for optical black. 1 = Enable OB, 0 = Disable */
+ GFISP_ATTR_ENABLE_SENSOR_MANUAL_OB, /**< The master switch for SENSOR Manual optical black. 1 = Enable OB, 0 = Disable */
+ GFISP_ATTR_ENABLE_SENSOR_AUTO_OB, /**< The master switch for SENSOR Auto optical black. 1 = Enable OB, 0 = Disable */
+ GFISP_ATTR_ENABLE_FOB, /**< Switch for frame based optical black. 1 = Enable frame based optical black, 0 = Disable */
+ GFISP_ATTR_ENABLE_FOB_SELFRESET, /**< Switch for self-reset for frame based optical black. 1 = Enable (reset every frame), 0 = Disable */
+ GFISP_ATTR_ENABLE_FOB_TEMPORAL, /**< Switch for temporal filtering for frame based optical black. 1 = Enable temporal filtering, 0 = Disable */
+ GFISP_ATTR_ENABLE_LOB, /**< Switch for line based optical black. 1 = Enable line based OB, 0 = Disable */
+ GFISP_ATTR_ENABLE_DEKNEE, /**< Switch for deknee. 1 = Enable deknee, 0 = Disable */
+ GFISP_ATTR_ENABLE_LENS_SHADING, /**< Switch for lens shading correction. 1 = Enable lens shading correction, 0 = Disable */
+ GFISP_ATTR_ENABLE_WB, /**< The master switch for white balance. 1 = Enable white balance, 0 = Disable */
+ GFISP_ATTR_ENABLE_AWB, /**< Switch for built-in automatic white balance. 1 = Automatic/dynamic (real-time) white balance, 0 = Preprogrammed mode white balance */
+ GFISP_ATTR_AWB_HOLD, /**< Switch to pause automatic white balance. Only effective when GFISP_ATTR_ENABLE_AWB=1. 1 = Start applying current AWB gain value to all future frames, 0 = Restore normal AWB mode */
+ GFISP_ATTR_ENABLE_DEMOSAIC, /**< Switch for demosaic processing. 1 = Enable demosaic processing, 0 = Disable */
+ GFISP_ATTR_ENABLE_EDGE_ENHANCE, /**< Switch for edge enhancement. 1 = Enable edge enhancement, 0 = Disable */
+ GFISP_ATTR_ENABLE_NOISE_CONTROL1, /**< Switch for noise control 1. Noise control method 1 is built in the demosaic unit. 1 = Enable noise control 1, 0 = Disable */
+ GFISP_ATTR_ENABLE_BAD_PIXEL, /**< Switch for bad pixel concealment. 1 = Enable bad pixel detection and concealment, 0 = Disable */
+ GFISP_ATTR_ENABLE_COLOR_CORRECTION, /**< Switch for color correction. 1 = Enable color correction, 0 = Disable */
+ GFISP_ATTR_ENABLE_NOISE_CONTROL2, /**< Switch for noise control 2. Noise control method 2 is built in the color correction unit. 1 = Enable noise control 2, 0 = Disable */
+ GFISP_ATTR_ENABLE_GAMMA_CORRECTION, /**< Switch for gamma correction. 1 = Enable gamma correction, 0 = Disable */
+ GFISP_ATTR_ENABLE_YUV_CONVERSION, /**< Switch for RGB to YUV conversion. 1 = Enable RGB-YUV conversion, 0 = Disable */
+ GFISP_ATTR_ENABLE_NEGATIVE_EFFECT, /**< Switch for negative effect. 1 = Negate whole output image, 0 = Normal image */
+ GFISP_ATTR_ENABLE_M2, /**< Switch for M2 statistics. 1 = Enable M2 statistics gathering, 0 = Disable */
+ GFISP_ATTR_ENABLE_M3, /**< Switch for M3 statistics. 1 = Enable M3 statistics gathering, 0 = Disable */
+ GFISP_ATTR_ENABLE_M4, /**< Switch for M4 statistics. 1 = Enable M4 statistics gathering, 0 = Disable */
+ GFISP_ATTR_ENABLE_STATS_RAISE, /**< Switch for statistics raise. 1 = Generate raise vector when statistics gathering is complete, 0 = Disable */
+ GFISP_ATTR_ENABLE_STATS_INT, /**< Switch for statistics interrupt. 1 = Generate interrupt when statistics gathering is complete, 0 = Disable */
+ GFISP_ATTR_STATS_LINE_END, /**< The line at which statistics gathering is complete. When the line counter reaches STATS_LINE_END, the raise vector and/or interrupt are generated (if enabled). */
+#ifdef MANUAL_ENABLE_WAIT_FOR_OUTPUT_END
+ GFISP_ATTR_ENABLE_WAIT_FOR_OUTPUT_END, /**< Temporary used to enable wait for OUTPUT_END. 1 = Wait for output end, 0 = Disable */
+#endif
+ /* Special effects */
+ GFISP_ATTR_ENABLE_EMBOSS, /**< Switch for emboss special effect. 1 = Enable emboss special effect, 0 = Disable */
+ GFISP_ATTR_ENABLE_SOLARIZE, /**< Switch for solarize special effect. 1 = Enable solarize special effect, 0 = Disable */
+ GFISP_ATTR_ENABLE_SEPIA, /**< Switch for sepia special effect. 1 = Enable sepia special effect, 0 = Disable */
+ GFISP_ATTR_ENABLE_MONOCHROME, /**< Switch for monochrome special effect. 1 = Enable monochrome special effect, 0 = Disable */
+ /* Video settings */
+ GFISP_ATTR_CONTRAST, /**< Contrast control. Acts as offset for Y data. Range is [0, 128]. */
+ GFISP_ATTR_BRIGHTNESS, /**< Brightness control. Modifies slope of Y data. Range is [0, 256]. */
+ GFISP_ATTR_HUE, /**< Hue control. Modifies slope of UV data. Range is [0, 128]. */
+ GFISP_ATTR_SATURATION_U, /**< Hue control. Modifies slope of UV data. Range is [0, 256]. */
+ GFISP_ATTR_SATURATION_V, /**< Hue control. Modifies slope of UV data. Range is [0, 256]. */
+ /* Software 3A control */
+ GFISP_ATTR_ENABLE_3A_AE, /**< Switch for software auto exposure. 1 = Enable auto exposure and disable sensor exposure, 0 = Disable */
+ GFISP_ATTR_ENABLE_3A_AWB, /**< Switch for software auto white balance. 1 = Enable auto white balance and disable sensor exposure, 0 = Disable */
+ GFISP_ATTR_ENABLE_3A_AF, /**< Switch for software auto focus. 1 = Enable auto focus and disable sensor auto focus, 0 = Disable */
+
+ GFISP_ATTR_ENABLE_SENSOR_AE, /**< Switch for sensor auto exposure. 1 = Enable sensor auto exposure and disable software expoture, 0 = Disable */
+ GFISP_ATTR_ENABLE_SENSOR_AWB, /**< Switch for sensor auto white balance. 1 = Enable sensor auto white balance and disable software white balance, 0 = Disable */
+ GFISP_ATTR_ENABLE_SENSOR_AF, /**< Switch for sensor auto focus. 1 = Enable sensor auto focus and disable software auto focus, 0 = Disable */
+ GFISP_ATTR_ENABLE_AUTO_CC_VIVIDITY /**< Flag for auto vividity. 1 = Enable auto vividity, 0 = Disable auto vividity*/
+} GFISPATTRIBUTES;
+
+
+/** Definition of parameter ids and data structures for #GFISPGetParameter and #GFISPSetParameter.
+*/
+typedef enum _GFISPPARAMETERS {
+ GFISP_PARA_TIMING, /**< Get/Set timing parameters. @see GFISPIMGTIMING */
+ GFISP_PARA_M1WINDOW, /**< Get/Set M1 statistics parameters. @see GFISPM1WINDOW */
+ GFISP_PARA_M2WINDOW, /**< Get/Set M2 statistics parameters. @see GFISPM2WINDOW */
+ GFISP_PARA_M3WINDOW, /**< Get/Set M3 statistics parameters. @see GFISPM3WINDOW */
+ GFISP_PARA_M4WINDOW, /**< Get/Set M4 statistics parameters. @see GFISPM4WINDOW */
+ GFISP_PARA_OB, /**< Get/Set optical black parameters. @see GFISPOBCONTROL */
+ GFISP_PARA_DEKNEE, /**< Get/Set deknee parameters. @see GFISPDEKNEECONTROL */
+ GFISP_PARA_LENSSHADING, /**< Get/Set lens shading parameters. @see GFISPLENSSHADING */
+ GFISP_PARA_WB, /**< Get/Set white balance parameters. @see GFISPWBCONTROL */
+ GFISP_PARA_DEMOSAIC, /**< Get/Set demosaic parameters. @see GFISPDEMOSAICCONTROL */
+ GFISP_PARA_EDGEENHANCE, /**< Get/Set edge enhancement parameters. @see GFISPEDGEENHANCECONTROL */
+ GFISP_PARA_NOISECONTROL1, /**< Get/Set noise control 1 parameters. @see GFISPNOISECONTROL1 */
+ GFISP_PARA_NOISECONTROL2, /**< Get/Set noise control 2 parameters. @see GFISPNOISECONTROL2 */
+ GFISP_PARA_BADPIXEL, /**< Get/Set bad pixel parameters. @see GFISPBADPIXELCONTROL */
+ GFISP_PARA_COLORCORRECT, /**< Get/Set color correction parameters. @see GFISPCOLORCORRECTION */
+ GFISP_PARA_GAMMACORRECT, /**< Get/Set gamma correction parameters. @see GFISPGAMMACONTROL */
+ GFISP_PARA_YUVCONVERT, /**< Get/Set YUV conversion parameters. @see GFISPYUVCONVERSION */
+ GFISP_PARA_SETMODE, /**< Get/Set ISP mode as specified in script. @see GFISPSETMODE */
+ GFISP_PARA_3A_AE, /**< Get/Set 3A AE parameters. @see GFISP3AAE */
+ GFISP_PARA_3A_AWB, /**< Get/Set 3A AWB parameters. @see GFISP3AAWB */
+ GFISP_PARA_3A_AF , /**< Get/Set 3A AF parameters. @see GFISP3AAF */
+ GFISP_PARA_3A_PREV_MODE_AWB,
+ GFISP_PARA_3A_AWB_SAT_Y_LIMITS,
+ GFISP_PARA_3A_FRAME_RATE_LOW_LIMIT,
+ GFISP_PARA_3A_FRAME_RATE_HIGH_LIMIT,
+ GFISP_PARA_3A_FRAME_RATE_CHOICE,
+ GFISP_PARA_ISO_SENSITIVITY, /**< Get/Set ISO Sensitivity for 3AAE. */
+ GFISP_PARA_REDUCE_GAIN_COMPRESS_GAMMA, /**< Reduce/Restore sensor gain and compensate gain change through Gamma curve Compression/Restoration.
+ To be used only with SetParameter fn. @see GFISPGAINGAMMACTRL */
+ GFISP_PARA_IMAGE_STABILIZATION, /**< Set Image Stabilization. 1 = Enable Image Stabilization, 0 = Disable */
+ GFISP_PARA_EXPOSURE_CONTROL, /**< Get/Set exposure control parameters. @see GFISPEXPOSURECONTROL */
+ GFISP_PARA_EXPOSURE, /**< Get/Set exposure manually. @see GFISPMANUALEXPOSURE */
+ GFISP_ISP_SENSOR_CAPABILITY, /**< ISP 3A Capability >*/
+ GFISP_PARA_SENSOR_REGISTER /**< SENSOR Register Read wrtie parameter>*/
+
+} GFISPPARAMETERS;
+
+/** Number of fractional bits of fixed point parameters.
+ All fixed point parameters are in u8.8 format or 2's complement
+ s7.8 format regardless of internal precision to simplify the
+ interface and keep it consistent across chip revisions.
+ Generic macros have been provided to convert to and
+ from floating point format on systems that support it. For
+ actual range and precision of individual parameters, see the
+ description of that parameter.
+*/
+#define GFISP_FIXEDPOINTPARAMETER_FBITS 8
+/** Total number of bits of fixed point parameters.
+ All fixed point parameters are in u8.8 format or 2's complement
+ s7.8 format regardless of internal precision to simplify the
+ interface and keep it consistent across chip revisions.
+ Generic macros have been provided to convert to and
+ from floating point format on systems that support it. For
+ actual range and precision of individual parameters, see the
+ description of that parameter.
+*/
+#define GFISP_FIXEDPOINTPARAMETER_BITS 16
+/** Macro to convert floating point to fixed point.
+ All fixed point parameters are in u8.8 format or 2's complement
+ s7.8 format regardless of internal precision to simplify the
+ interface and keep it consistent across chip revisions.
+ Generic macros have been provided to convert to and
+ from floating point format on systems that support it. For
+ actual range and precision of individual parameters, see the
+ description of that parameter.
+*/
+#define GFISP_CONVERT_FLOAT_TO_FIXED_SIGNED(x) ((NvS16)(x * (2 << GFISP_FIXEDPOINTPARAMETER_FBITS)))
+/** Macro to convert floating point to fixed point.
+ All fixed point parameters are in u8.8 format or 2's complement
+ s7.8 format regardless of internal precision to simplify the
+ interface and keep it consistent across chip revisions.
+ Generic macros have been provided to convert to and
+ from floating point format on systems that support it. For
+ actual range and precision of individual parameters, see the
+ description of that parameter.
+*/
+#define GFISP_CONVERT_FLOAT_TO_FIXED_UNSIGNED(x) ((NvU16)(x * (2 << GFISP_FIXEDPOINTPARAMETER_FBITS)))
+/** Macro to convert fixed point to floating point.
+ All fixed point parameters are in u8.8 format or 2's complement
+ s7.8 format regardless of internal precision to simplify the
+ interface and keep it consistent across chip revisions.
+ Generic macros have been provided to convert to and
+ from floating point format on systems that support it. For
+ actual range and precision of individual parameters, see the
+ description of that parameter.
+*/
+#define GFISP_CONVERT_FIXED_TO_FLOAT(x) (((float)x) / (2 << GFISP_FIXEDPOINTPARAMETER_FBITS))
+
+
+/** Enum for which pixel of the R, G, G, B pattern the active frame starts on.
+ @see GFISPIMGTIMING
+*/
+typedef enum
+{
+ GFISP_RGGB = 0,
+ GFISP_GRBG = 1,
+ GFISP_GBRG = 2,
+ GFISP_BGGR = 3
+} GFISP_BAYERPATTERN_SEL;
+
+/** Timing Generator Control.
+
+ Whole timing frame consists of scanned part and idle parts (void periods in between lines
+ and frames). Overall scanned image frame is specified by H_SCAN_SIZE and V_SCAN_SIZE which
+ includes H and V blank periods. Line and pixel counters are set to 1 at transitions of active
+ edge of V and H sync input pulses. Note that coordinate in the whole frame starts with
+ (1,1) instead of (0,0).
+
+ In horizotal direction, H sync active edge indicates start of scan line and it initiates
+ pixel count from 1 to H_SCAN_SIZE (end of line). After H_SCAN_SIZE pixels are received,
+ the ISP module goes into void period, in which it waits for next arrival of H sync active
+ edge. In practice, H blank period is composed of inactive period during H_SCAN SIZE and the
+ void period in between end of line and start next line.
+
+ Same applies to vertical direction.
+
+ Active part (non-blanking part) consists of "optical black" lines at top and bottom of the
+ image frame and left and right of image line, and active lines with active pixels in the
+ middle.
+
+ @see GFISPGetParameter, GFISPSetParameter
+*/
+typedef struct _GFISPIMGTIMING
+{
+ NvU16 hScanSize, /**< Number of pixel clock periods per scan line (including H blanking). */
+ vScanSize; /**< Number of line periods per scan frame (including V blanking). */
+ NvU8 hSyncEdge, /**< Active edge selection for horizontal sync. 0 = positive transition, 1 = negative transition. */
+ vSyncEdge; /**< Active edge selection for vertical sync. 0 = positive transition, 1 = negative transition. */
+ GFISP_BAYERPATTERN_SEL bayerSel; /**< Bayer timing format. Specifies which pixel of the R, G, G, B pattern the active frame starts on. */
+
+ GFRECT ActiveRect; /**< Active image area. */
+ GFRECT OutputRect; /**< Output image area. */
+} GFISPIMGTIMING, *PGFISPIMGTIMING;
+
+
+/** Enum for the number of samples to take across the M1 statistics window.
+ @see GFISPM1WINDOW
+*/
+typedef enum
+{
+ GFISP_M1SAMPLE32 = 0,
+ GFISP_M1SAMPLE64 = 1
+} GFISP_M1_SAMPLE_SEL;
+
+/** M1 statistics window control.
+
+ The GFISPAPI provides four methods that programmers can use to gather
+ statistics on pixel values. Based on the values, the programmer can take
+ appropriate compensating action as needed. The four methods are M1
+ Window, M2 Window, M3 Window, and M4 Window.
+
+ This structure describes the M1 Window method, which measures average/
+ peak pixel values inside the specified area. It returns eight valuesfour
+ values (RGGB) represent average pixels, and four values represent peak
+ pixels. The measurement result can be used for white balance, either
+ automatically by AWB or manually by the programmer.
+
+ Refer to the function #GFISPReadMWindowValues() for reading the
+ measured values.
+
+ @see GFISPGetParameter, GFISPSetParameter, GFISPReadMWindowValues
+*/
+typedef struct _GFISPM1WINDOW
+{
+ GFRECT M1WindowRect; /**< M1 Window size/position. */
+ GFISP_M1_SAMPLE_SEL horzSampSel, /**< Horizontal sample density. */
+ vertSampSel; /**< Vertical sample density. */
+ NvU16 PeakMax; /**< Maximum limit of peak detection. */
+ NvU16 TemporalFilterStrength; /**< Selects temporal filter coefficients. Valid range is [0-7]. Value 0 effectively turns off temporal filter. */
+} GFISPM1WINDOW, *PGFISPM1WINDOW;
+
+
+/** M2 statistics window control.
+
+ The GFISPAPI provides four methods that programmers can use to gather
+ statistics on pixel values. Based on the values, the programmer can take
+ appropriate compensating action as needed. The four methods are M1
+ Window, M2 Window, M3 Window, and M4 Window.
+
+ This structure describes the M2 Window method for gathering statistics on
+ pixel values. The M2 Window method measures the number of pixels at
+ specified ranges inside a specified area. A histogram with four bins is
+ generated.
+
+ Refer to the function #GFISPReadMWindowValues() for reading the
+ measured values.
+
+ @see GFISPGetParameter, GFISPSetParameter, GFISPReadMWindowValues, GFISP_ATTR_ENABLE_M2
+*/
+typedef struct _GFISPM2WINDOW
+{
+ GFRECT M2WindowRect; /**< M2 Window size/pos. */
+ NvU16 HistBinL1, /**< Cut point of 1st bin. */
+ HistBinL2, /**< Cut point of 2nd bin. */
+ HistBinL3; /**< Cut point of 3rd bin. */
+ NvU16 reserved;
+} GFISPM2WINDOW, *PGFISPM2WINDOW;
+
+
+/** M3 statistics window control.
+
+ The GFISPAPI provides four methods that programmers can use to gather
+ statistics on pixel values. Based on the values, the programmer can take
+ appropriate compensating action as needed. The four methods are M1
+ Window, M2 Window, M3 Window, and M4 Window.
+
+ This structure describes the M3 Window method for gathering statistics on
+ pixel values, The M3 Window method generates a group of pixel samples
+ from the specified area. Each sub-window generates one 32-bit value.
+
+ The horizontal interval of M3 sub-windows is derived from M3 window
+ line width divided by M3 window horizontal count, rounded down.
+
+ The vertical interval of M3 sub-windows is derived from M3 window
+ frame height divided by M3 window vertical count, rounded down.
+
+ Refer to the function #GFISPReadMWindowValues() for reading the
+ measured values.
+
+ @see GFISPGetParameter, GFISPSetParameter, GFISPReadMWindowValues, GFISP_ATTR_ENABLE_M3
+*/
+typedef struct _GFISPM3WINDOW
+{
+ GFRECT M3WindowRect; /**< M3 Window size/pos. */
+ NvU8 SubWindowCountH, /**< Number of sub-windows in horizontal direction. Can be {16,32,64}. */
+ SubWindowCountV; /**< Number of sub-windows in vertical direction. Can be {16,32,64}. */
+ NvU16 SubWindowWidth, /**< Width of sub-windows. Can be {2,4,8,16,32}. */
+ SubWindowHeight; /**< Height of sub-windows. Can be {2,4,8,16,32}. */
+ NvU16 reserved;
+} GFISPM3WINDOW, *PGFISPM3WINDOW;
+
+
+/** M4 statistics window control.
+
+ The GFISPAPI provides four methods that programmers can use to gather
+ statistics on pixel values. Based on the values, the programmer can take
+ appropriate compensating action as needed. The four methods are M1
+ Window, M2 Window, M3 Window, and M4 Window.
+
+ This structure describes the M4 Window method for gathering statistics on
+ pixel values. The M4 Window method takes statistical measurements for
+ auto-focus control. It generates two values for each sub-window. One value
+ represents the high frequency factor inside the sub-window. The other value
+ represents sub-window luminance.
+
+ There are {1, 2, 3, 4, 6, 9} sub-windows in {1,2,3}x{1,2,3} configurations.
+
+ SC15 implementation has the following constraints
+ * SubWindowintervalH >= SubWindowWidth
+ * SubWindowintervalV >= SubWindowHeight
+
+ Refer to the function #GFISPReadMWindowValues() for reading the
+ measured values.
+
+ @see GFISPGetParameter, GFISPSetParameter, GFISPReadMWindowValues, GFISP_ATTR_ENABLE_M4
+*/
+typedef struct _GFISPM4WINDOW
+{
+ NvU32 Left, /**< Specifies left of first M4 sub-window. */
+ Top; /**< Specifies top of first M4 sub-window. */
+ NvU8 SubWindowCountH, /**< Specifies the number of sub-windows in the horizontal direction. Can be {1,2,3}. */
+ SubWindowCountV; /**< Specifies the number of sub-windows in the vertical direction. Can be {1,2,3}. */
+ NvU16 SubWindowWidth, /**< Specifies the width of each sub-window. */
+ SubWindowHeight; /**< Specifies the height of each sub-window. */
+ NvU16 SubWindowIntervalH, /**< Specifies the horizontal interval of sub-windows. */
+ SubWindowIntervalV; /**< Specifies the vertical interval of sub-windows. */
+ NvU8 CoreLimit; /**< Top limit of noise coring for M4 statistics gathering. Valid range is [0-63]. */
+ NvU8 reserved;
+} GFISPM4WINDOW, *PGFISPM4WINDOW;
+
+
+/** Enum for the Optical Black Mode.
+ @see GFISPOBCONTROL
+*/
+typedef enum
+{
+ OB_MODE_FRAME = 0,
+ OB_MODE_AVG_FRAME_LINE = 1,
+ OB_MODE_LINE = 2
+} GFISP_OB_MODE_SEL;
+
+
+/** Optical black control.
+
+ The very first ISP operation to be applied to the input pixel signal is to
+ establish "black" level. This anchors signal activities to a black reference level,
+ or "zero" level.
+
+ There are two methods of accomplishing optical blacking. One method is
+ performed on each frame and is called Frame-based Optical Blacking (FOB).
+ The other method is performed on each scan line and is called Line-based
+ Optical Blacking (LOB).
+
+ Under FOB, optical black level can be established in one of two ways--by
+ setting it manually, or more commonly by letting the ISP measure it
+ automatically. In the automatic method the user can specify black regions
+ which surround the active imaging area. The pixel levels from these regions
+ are used to determine the input signal level of reference black, which is
+ mapped to "zero" level in the subsequent pixel processing.
+
+ LOB is applied to each scan line and is used to detect and compensate for
+ fluctuations in the imager input signal level of reference black.
+
+ The user can choose to use either FOB, or LOB, or both.
+
+ Four optical black regions are defined through 16 coordinates.
+
+ If ISP's OB capability is GFISP_CAP_THREE_OB_REGIONS, then:
+ - Only six of the 16 OB coordinates are used:
+ - OBTopRegionStartV, OBTopRegionHeight,
+ - OBLeftRegionStartH, OBLeftRegionWidth,
+ - OBBottomRegionStartV, OBBottomRegionHeight
+ - Right OB region is not supported.
+ - Top region width is assumed equal to input width.
+ - Left region height is assumed equal to input height.
+ - Bottom region width is assumed equal to input width.
+ - Bottom region is only used if GFISP_ATTR_ENABLE_FOB_SELFRESET is disabled.
+
+ If ISP's OB capability is GFISP_CAP_FOUR_OB_REGIONS, then all sixteen
+ OB coordinates are used.
+
+ @see GFISPGetParameter, GFISPSetParameter, GFISP_ATTR_ENABLE_FOB, GFISP_ATTR_ENABLE_FOB_SELFRESET, GFISP_ATTR_ENABLE_FOB_TEMPORAL, GFISP_ATTR_ENABLE_MANUALOB, GFISP_ATTR_ENABLE_LOB
+*/
+typedef struct _GFISPOBCONTROL
+{
+ NvU32 OBTopRegionStartV, OBTopRegionHeight, OBTopRegionStartH, OBTopRegionWidth;
+ NvU32 OBBottomRegionStartV, OBBottomRegionHeight, OBBottomRegionStartH, OBBottomRegionWidth;
+ NvU32 OBLeftRegionStartV, OBLeftRegionHeight, OBLeftRegionStartH, OBLeftRegionWidth;
+ NvU32 OBRightRegionStartV, OBRightRegionHeight, OBRightRegionStartH, OBRightRegionWidth;
+
+ NvU8 FOBCoef; /**< Filter coefficient of FOB acquisition. Valid range is [0-15]. */
+ NvU8 TOBCoef; /**< Temporal filter coefficient of FOB temporal filter. Valid range is [0-15]. */
+
+ NvU8 LOBWidth; /**< Width used for LOB. Valid values are {2, 4, 8}. */
+
+ NvU8 FOBAdjust; /**< Manual adjustment applied to the black level. Valid range is [0, 63]. */
+ GFISP_OB_MODE_SEL OBMode; /**< Optical black mode vales {frame, avg of frame + line, line } */
+} GFISPOBCONTROL, *PGFISPOBCONTROL;
+
+
+/** This structure describes one approximated linear segment for deknee.
+ @see GFISPDEKNEECONTROL
+*/
+typedef struct _GFISPDEKNEEENTRY
+{
+ NvU16 start; /**< Start of a range. */
+ NvU16 slope; /**< Slope of the linear. Unsigned fixed point format. Valid range is [0, 3 63/64] with precision of 1/64. */
+} GFISPDEKNEEENTRY, *PGFISPDEKNEEENTRY;
+
+/** Deknee control.
+
+ Imagers tend to show some degree of non-linearity in their light-to-electric
+ transfer characteristics. Deknee unit attempts to improve the linearity.
+
+ NVIDIA ISP implements Deknee as a piece-wise linear approximation of up
+ to 16 segments.
+
+ This structure describes the start and slope values for the Deknee look-up
+ table. The caller may choose to divide the table into 4, 8, or 16 linear segments
+ (4, 8, or 16 entries in the table).
+
+ @see GFISPGetParameter, GFISPSetParameter, GFISP_ATTR_ENABLE_DEKNEE
+*/
+typedef struct _GFISPDEKNEECONTROL
+{
+ NvU32 nEntries; /**< Number of entries in the pEntry table. Valid values are {4,8,16}. */
+ GFISPDEKNEEENTRY *pEntries; /**< Deknee entry table. */
+} GFISPDEKNEECONTROL, *PGFISPDEKNEECONTROL;
+
+
+/** Lens shading compensation control.
+
+ An optical lens in front of the imager tends to introduce shading and
+ unevenness in the strength of incident light. It is strongest at the center and
+ diminishes as the distance from the center increases. Actual shading
+ characteristics vary depending on the choice of optics.
+
+ This structure describes a method for compensating for this shading by
+ applying varying levels of gain to the pixel signal in the reverse function of
+ the shading.
+
+ The GFISPAPI implements this as a second degree quadratic equation for
+ each color component at H and V:
+
+ F = 1 + X * (Coef1 + Coef2 *X)
+
+ @see GFISPGetParameter, GFISPSetParameter, GFISP_ATTR_ENABLE_LENS_SHADING
+*/
+typedef struct _GFISPLENSHADING
+{
+ NvU16 hCenter, /**< Horizontal center point of camera lens. */
+ vCenter; /**< Vertical center point of camera lens. */
+
+ NvU16 rHorzCoef1, /**< First order coefficient for Horizontal Red. Unsigned fixed point format. Valid range is [0, 7 63/64] with precision of 1/64. */
+ rHorzCoef2; /**< Second order coefficient for Horizontal Red. Unsigned fixed point format. Valid range is [0, 7 63/64] with precision of 1/64. */
+ NvU16 rVertCoef1, /**< First order coefficient for Vertical Red. Unsigned fixed point format. Valid range is [0, 7 63/64] with precision of 1/64. */
+ rVertCoef2; /**< Second order coefficient for Vertical Red. Unsigned fixed point format. Valid range is [0, 7 63/64] with precision of 1/64. */
+ NvU16 gHorzCoef1, /**< First order coefficient for Horizontal Green. Unsigned fixed point format. Valid range is [0, 7 63/64] with precision of 1/64. */
+ gHorzCoef2; /**< Second order coefficient for Horizontal Green. Unsigned fixed point format. Valid range is [0, 7 63/64] with precision of 1/64. */
+ NvU16 gVertCoef1, /**< First order coefficient for Vertical Green. Unsigned fixed point format. Valid range is [0, 7 63/64] with precision of 1/64. */
+ gVertCoef2; /**< Second order coefficient for Vertical Green. Unsigned fixed point format. Valid range is [0, 7 63/64] with precision of 1/64. */
+ NvU16 bHorzCoef1, /**< First order coefficient for Horizontal Blue. Unsigned fixed point format. Valid range is [0, 7 63/64] with precision of 1/64. */
+ bHorzCoef2; /**< Second order coefficient for Horizontal Blue. Unsigned fixed point format. Valid range is [0, 7 63/64] with precision of 1/64. */
+ NvU16 bVertCoef1, /**< First order coefficient for Vertical Blue. Unsigned fixed point format. Valid range is [0, 7 63/64] with precision of 1/64. */
+ bVertCoef2; /**< Second order coefficient for Vertical Blue. Unsigned fixed point format. Valid range is [0, 7 63/64] with precision of 1/64. */
+} GFISPLENSSHADING, *PGFISPLENSSHADING;
+
+
+
+/** White balance control.
+
+ White Values
+
+ RGB component signal levels are balanced to render white objects as white.
+ This is a normalization step of electronic signal of RGB color primaries.
+ Depending on the "color temperature" of the white reference, the relative
+ strength of RGB tri-stimulus values vary. In the electric signal, ER/EG/EB
+ corresponding to the RGB tri-stimulus values are normalized so that white (of
+ 100% strength) is represented by ER = EG = EB = 1. The original image in front
+ of the imager is reproduced only when a display device does precise reverse
+ conversion, which is a purely ideal case. Otherwise, the original image is
+ rendered in different shades of colors depending on the reference white for
+ which the display device is tuned.
+
+ Gray Values
+
+ RGB pixel values that represent "gray" objects may be obtained in various
+ ways. For example, a picture frame can be filled with a "white" object, or
+ average values for a large number of pixels can be calculated, or a set of
+ average values collected in many sampling spotscan be used to represent the
+ approximated "gray" object.
+
+ Gain Factors and White Balance
+
+ Digital gain values are dedicated to each of the four color channels (R, Gr, Gb,
+ B).
+
+ Depending on how to set gain factors, there are two ways to use White
+ Balance. A commonly used method is called Dynamic WB, or AWB. Under
+ AWB, gain values are updated automatically by ISP internal AWB control
+ based on the average values and peak values in {R, G1, G2, B} color channels.
+ Refer to #GFISP_PARA_M1WINDOW.
+
+ - If the frame exposure is high ("Top" level, controlled by ThresholdT2M/
+ ThresholdM2T), gains are calculated from the average RGrGbB values.
+ - If the frame exposure is low ("Bottom" level, controlled by
+ ThresholdM2B/ThresholdB2M), gains are calculated from peak
+ RGrGbB values.
+ - If the frame exposure is in the middle range, gains are calculated from
+ both average and peak values.
+
+ Under AWB, the user can send a command to freeze the current gain value by
+ setting GFISP_ATTR_AWB_HOLD to 1. Then the current AWB gain value is
+ applied to all future frames.
+
+ The other method is called pre-programmed WB or Static WB. It sets preprogrammed
+ gain values and applies them all time. Under this mode, the
+ programmer determines the proper gain values based on the M1/M3
+ measurement window output.
+
+ @see GFISPGetParameter, GFISPSetParameter, GFISP_ATTR_ENABLE_WB, GFISP_ATTR_ENABLE_AWB,
+ GFISP_ATTR_AWB_HOLD, GFISPM1WINDOW
+*/
+typedef struct _GFISPWBCONTROL
+{
+ // Static WB.
+ NvU16 RGain, /**< Static gain factor for Red. Only effective when GFISP_ATTR_ENABLE_AWB==0. */
+ GrGain, /**< Static gain factor for Green on Red. Only effective when GFISP_ATTR_ENABLE_AWB==0. */
+ BGain, /**< Static gain factor for Blue. Only effective when GFISP_ATTR_ENABLE_AWB==0. */
+ GbGain; /**< Static gain factor for Green on Blue. Only effective when GFISP_ATTR_ENABLE_AWB==0. */
+
+ // Both statis and auto WB.
+ NvU16 TopClipLimit; /**< Lower limit of gain based clipping. Effective for both Static WB and Auto WB. Value 0 effectively turns off Top-clipping. */
+
+ // Auto WB.
+ NvU16 PeakRef; /**< White reference level for gain adjustment. Only effective when GFISP_ATTR_ENABLE_AWB==1. */
+
+ NvU16 RGainMax, RGainMin; /**< Max/Min Gain factor for Red. Only effective when GFISP_ATTR_ENABLE_AWB==1. */
+ NvU16 GGainMax, GGainMin; /**< Max/Min Gain factor for Green. Only effective when GFISP_ATTR_ENABLE_AWB==1. */
+ NvU16 BGainMax, BGainMin; /**< Max/Min Gain factor for Blue. Only effective when GFISP_ATTR_ENABLE_AWB==1. */
+
+ NvU16 ThresholdT2M, /**< Top-to-Middle transition level. Only effective when GFISP_ATTR_ENABLE_AWB==1. */
+ ThresholdM2T, /**< Middle-to-Top transition level. Only effective when GFISP_ATTR_ENABLE_AWB==1. */
+ ThresholdM2B, /**< Middle-to-Bottom transition level. Only effective when GFISP_ATTR_ENABLE_AWB==1. */
+ ThresholdB2M; /**< Bottom-to-Middle transition level. Only effective when GFISP_ATTR_ENABLE_AWB==1. */
+
+} GFISPWBCONTROL, *PGFISPWBCONTROL;
+
+
+/** Demosaic mode enum for #GFISPDEMOSAICCONTROL.
+*/
+typedef enum
+{
+ GFISP_DM3X3 = 0, // 3x3 one-shot demosaicing
+ GFISP_DM3X3BPNR = 1, // 3x3 demosaicing/bad-pixel/noise-reduction
+ GFISP_DM5X5 = 2, // 5x5 one-shot demosaicing
+ GFISP_DM5X5BP = 3, // 5x5 demosaicing/bad-pixel
+ GFISP_DM5X5BPNR = 4 // 5x5 demosaicing/bad-pixel/noise-reduction
+} GFISP_DEMOSAIC_MODE_SEL;
+
+/** Demosaic control.
+
+ This structure controls the demosaic process, which uses 2D interpolation to
+ convert Bayer format R/G/B pixel signals obtained from the imager to
+ generate R/G/B component values.
+
+ Under the SC15 hardware implementation, the Demosaic unit is built with
+ bad pixel (BP) and noise reduction (NR) control inside, so picking demosaic
+ mode affects bad pixel and noise reduction control. Unless limited by
+ memory bandwidth, programmers should always pick BPNR modes. Otherwise, BP
+ and NR features are not available, even if you try to turn on BP or NR
+ controls with GFISPSetAttribute().
+
+ @see GFISPGetParameter, GFISPSetParameter, GFISP_ATTR_ENABLE_DEMOSAIC,
+ GFISPBADPIXELCONTROL, GFISPNOISECONTROL1
+*/
+typedef struct _GFISPDEMOSAICCONTROL
+{
+ GFISP_DEMOSAIC_MODE_SEL DemosaicMode; /**< Demosaic mode selection. */
+} GFISPDEMOSAICCONTROL, *PGFISPDEMOSAICCONTROL;
+
+
+/** Coring limit scaling selection enum for #GFISPEDGEENHANCECONTROL. */
+typedef enum
+{
+ GFISP_GCLIMIT_SCALE_4 = 0, // range [1,4.5]
+ GFISP_GCLIMIT_SCALE_8 = 1, // range [1,8.5]
+ GFISP_GCLIMIT_SCALE_16= 2, // range [1,16.5]
+ GFISP_GCLIMIT_SCALE_32= 3 // range [1,32.5]
+} GFISP_GCORINGLIMIT_SCALE_SEL;
+
+/** Edge enhancement control.
+
+ This structure controls the edge enhancement process, accomplished by the
+ following:
+ -# Extracting the high frequency component (HF) of the pixel
+ -# Amplifying HF if the extracted value is "large" (that is, coring)
+ -# Adding the amplified HF back to the Y channel of the pixel.
+
+ In the SC15 implementation, edge enhancement control resides in the
+ Demosaic unit. It is effective only if DM3X3BPNR, DM5X5NR, or DM5X5BPNR
+ demosaic mode is selected. The threshold that's used for coring is not a predetermined
+ fixed value, but instead is adaptive depending on the brightness
+ level. If the pixel surround is bright (more visible), the coring threshold will
+ be larger, which means only stronger edges are enhanced. Weaker edges are
+ considered more noise-prone and therefore are not enhanced.
+
+ Two control parameters are used to determine the adaptive coring threshold:
+ GCoringLimit and GCoreScaleSel.
+
+ @see GFISPGetParameter, GFISPSetParameter, GFISP_ATTR_ENABLE_EDGE_ENHANCE
+*/
+typedef struct _GFISPEDGEENHANCECONTROL
+{
+ NvU16 StrengthLevel; /**< How heavily the edge enhancement is applied. Unsigned fixed-point format. Valid range is [0, 3 7/8] with a precision of 1/8, plus [4, 15 1/2] with a precision of 1/2. */
+
+ NvU16 GCoringLimit; /**< Minimum coring level. The coring level increases when the pixel's surrounding brightness level goes up. Valid range is [0-63]. */
+ GFISP_GCORINGLIMIT_SCALE_SEL GCoringScaleSel; /**< Scaling factor of GCoringLimit. Specifies the influence of the brightness level to the coring level. The higher the GCoreScaleSel is, the larger the coring level grows under the same brightness. */
+} GFISPEDGEENHANCECONTROL, *PGFISPEDGEENHANCECONTROL;
+
+
+/** Noise Reduction 1 control.
+
+ There are two noise reduction functions in ISP datapath:
+ -# 3D noise reduction
+ -# False color reduction
+
+ GFISPNOISECONTROL1 applies to the first method.
+ It resides in Demosaic unit along with edge enhancement. It is effective
+ only if DM3X3BPNR, DM5X5NR, or DM5X5BPNR demosaic mode is selected.
+
+ This method reduces noise not only in the image plane but also in the
+ intensity domain. In other words, low pass filtering is applied to pixels that
+ have a similar pixel value and are also close to the same location.
+ FilterStrengthLevel defines the filter kernel size on the intensity
+ domain. Larger FilterStrengthLevel generates a smoother but blurry
+ image.
+
+ @see GFISPGetParameter, GFISPSetParameter, GFISP_ATTR_ENABLE_NOISE_CONTROL1
+*/
+typedef struct _GFISPNOISECONTROL1
+{
+ NvU16 FilterStrengthLevel; /**< Weighted average scaling factor. Valid range is [0,7]. */
+} GFISPNOISECONTROL1, *PGFISPNOISECONTROL1;
+
+
+/** Noise Reduction 2 control.
+
+ There are two noise reduction functions in ISP datapath:
+ -# 3D noise reduction
+ -# False color reduction
+
+ GFISPNOISECONTROL2 applies to the second method.
+ It resides in color correction unit.
+
+ This method reduces the colorfulness of pixels at shadow region or at edges
+ to de-emphasize color noise and color aliasing effects. HighLimit and
+ TransitionWidth specify the pixels that will undergo the color reduction.
+ If the luminance level of the pixel is larger than (HighLimit +
+ TransitionWidth), the pixel's colorfulness is intact. If the luminance level
+ is smaller than HighLimit, the colorfulness is reduced to a minimum (i.e., no
+ color correction is applied). Pixels with luminance levels between these limits
+ pass through an intermediate colorfulness reduction factor. CCScaleFactor
+ specifies how much color reduction should be applied at edge pixels. Larger
+ CCScaleFactor creates a more noticeable color reduction at the edges.
+
+ @see GFISPGetParameter, GFISPSetParameter, GFISP_ATTR_ENABLE_NOISE_CONTROL2
+*/
+typedef struct _GFISPNOISECONTROL2
+{
+ NvU16 HighLimit; /**< Upper-limit level of noise reduction curve. */
+ NvU16 TransitionWidth; /**< Width of noise reduction curve. Valid values are {16, 32, 64, 128}. */
+ NvU16 CCScaleFactor; /**< Slope of noise reduction curve. Unsigned fixed point format. Valid range is [0, 31]. */
+} GFISPNOISECONTROL2, *PGFISPNOISECONTROL2;
+
+
+
+/** Bad pixel control.
+
+ This structure controls a method to conceal bad pixels.
+
+ The process resides in the Demosaic unit along with edge enhancement
+ and noise control 1. It is effective only if DM3X3BPNR or DM5X5BPNR demosaic
+ mode is selected.
+
+ If a pixel value deviates greatly from its surrounding pixels, the pixel is
+ considered to be a bad pixel. The deviation is defined in terms of the
+ percentage of the average value of the surrounding pixels.
+
+ Two ratio coefficients are used:
+ - If the pixel is within a flat area, LowCoef is used,
+ - If the pixel is at an edge region, UpCoef is used.
+ If the average of the surrounding pixels is lower than DarkLevel, it is
+ considered to be at a shadow region, and DarkLevel instead of the average
+ value will be used to calculate the deviation threshold.
+
+ @see GFISPGetParameter, GFISPSetParameter, GFISP_ATTR_ENABLE_BAD_PIXEL
+*/
+typedef struct _GFISPBADPIXELCONTROL
+{
+ NvU16 DarkLevel; /**< Bad-pixel dark level. */
+ NvU16 UpCoef, /**< Coefficient for upper threshold. Unsigned fixed point format. Valid range is [0, 1 7/8] with precision of 1/8. */
+ LowCoef; /**< Coefficient for lower threshold. Unsigned fixed point format. Valid range is [0, 1 7/8] with precision of 1/8. */
+} GFISPBADPIXELCONTROL, *PGFISPBADPIXELCONTROL;
+
+
+/** Color correction control.
+
+ This structure controls the color correction process.
+
+ In a strict sense, the color correction module transforms a given color space
+ (based on the optical characteristics of the imager) to a specific color space
+ such as described by the CCIR 601 standard. The color component signals are
+ then handled according to that standard color space from that point on.
+
+ For high-end cameras, color correction is used to match some sensitive colors
+ such as flesh tone to a desired shade of colors, and is handled primarily by
+ experts who know what they are doing.
+
+ In practice, there may be a simpler means with fewer control parameters,
+ where the color shade of images is adjusted to suit the viewer's taste. So, gain
+ and offset of R, G, and B pixels are individually adjusted.
+
+ GFISP color correction consists of 3x3 matrix factors for the camera RGB
+ (cRGB) to standard RGB (sRGB) conversion. Subjective adjustment of color
+ can also be included.
+ - Coefficients on the main diagonal are unsigned. Valid range is [0, 7 255/256].
+ - Off-diagonal coefficients are unsigned. Valid range is [-7 255/256, 7 255/256].
+
+ @see GFISPGetParameter, GFISPSetParameter, GFISP_ATTR_ENABLE_COLOR_CORRECTION
+*/
+typedef struct _GFISPCOLORCORRECTION
+{
+ NvU16 R2R; /**< Red-to-red coefficient. Unsigned fixed point format. Valid range is [0, 7 255/256]. */
+ NvS16 R2G; /**< Red-to-green coefficient. Signed fixed point format. Valid range is [-7 255/256, 7 255/256]. */
+ NvS16 R2B; /**< Red-to-blue coefficient. Signed fixed point format. Valid range is [-7 255/256, 7 255/256]. */
+ NvS16 G2R; /**< Green-to-red coefficient. Signed fixed point format. Valid range is [-7 255/256, 7 255/256]. */
+ NvU16 G2G; /**< Green-to-green coefficient. Unsigned fixed point format. Valid range is [0, 7 255/256]. */
+ NvS16 G2B; /**< Green-to-blue coefficient. Signed fixed point format. Valid range is [-7 255/256, 7 255/256]. */
+ NvS16 B2R; /**< Blue-to-red coefficient. Signed fixed point format. Valid range is [-7 255/256, 7 255/256]. */
+ NvS16 B2G; /**< Blue-to-green coefficient. Signed fixed point format. Valid range is [-7 255/256, 7 255/256]. */
+ NvU16 B2B; /**< Blue-to-blue coefficient. Unsigned fixed point format. Valid range is [0, 7 255/256]. */
+ NvS16 Vividity; /**< Multiplier to boost the diagonal elements. Signed fixed point format. Valid Range [-64/256, 64/256]. */
+ NvS16 VividityScaleFactor; /**< Multiplier to boost the diagonal elements. Signed fixed point format. Valid Range [-OffDiagona/64, OffDiagonal/64]. */
+ NvU16 GainStart; /**< Starting Gain for Auto Vividity . */
+ NvU16 GainEnd; /**< End Gain for Auto Vividity. */
+} GFISPCOLORCORRECTION, *PGFISPCOLORCORRECTION;
+
+
+/** This structure describes one approximated linear segment for gamma.
+ @see GFISPGAMMACONTROL
+*/
+typedef struct _GFISPGAMMAENTRY
+{
+ NvU16 inputStart; /**< Input start value of line segment. Valid range is [0, 1023]. */
+ NvU16 outputStart; /**< Output start value of line segment. Valid range is [0, 255]. */
+ NvS16 slope; /**< Slope of the line segment. Signed fixed point format. Valid range is [-7 63/64, 7 63/64]. */
+ NvU16 reserved;
+} GFISPGAMMAENTRY, *PGFISPGAMMAENTRY;
+
+/** Gamma correction control.
+
+ This structure controls the gamma correction process.
+
+ Gamma correction applies non-linear characteristics to compensate for the
+ non-linear characteristics of display devices such as cathode ray tubes driven
+ by R, G, B primary color signals. So, in a strict sense, this must be applied to
+ R, G, B signals.
+
+ In SC15 implementation, gamma correction is approximated using up to 16
+ line segments. Each line entry must be provided in ascending order (within
+ the input range).
+
+ @see GFISPGetParameter, GFISPSetParameter, GFISP_ATTR_ENABLE_GAMMA_CORRECTION
+*/
+typedef struct _GFISPGAMMACONTROL
+{
+ NvU32 nEntries; /**< Number of entries in the pEntries table. Valid range is [1-16]. */
+ GFISPGAMMAENTRY *pEntries; /**< Gamma entry table. */
+} GFISPGAMMACONTROL, *PGFISPGAMMACONTROL;
+
+
+/** Y signal range selection enum for #GFISPYUVCONVERSION.
+*/
+typedef enum
+{
+ GFISP_YRANGE_FULL = 0, /**< Range of [0,255]. */
+ GFISP_YRANGE_NEARFULL = 1, /**< Rage of [1,254] (exclude 00 and FF). */
+ GFISP_YRANGE_ITU601 = 2 /**< ITU601 standard. */
+} GFISP_YRANGE_SEL;
+
+/** RGB to YUV conversion control.
+ This structure controls the YUV conversion process, which converts RGB
+ color space to corresponding YUV color space, based on the 3x3 matrix.
+
+ {Y, U, V} shall have offset values that are not shown in the formula above.
+*/
+typedef struct _GFISPYUVCONVERSION
+{
+ GFISP_YRANGE_SEL YRangeSel; /**< YUV output signal range. */
+ NvS16 YOff; /**< Y value offset. Valid range is [-128, 127]. */
+
+ // 3x3 YUV conversion matrix.
+ // G2Y is unsigned fixed point format. Valid range is [0, 1 255/256].
+ // R2Y and B2Y are unsigned fixed point format. Valid range is [0, 255/256].
+ // R2U, G2U, B2U, R2V, G2V, B2V are signed fixed point format.
+ // Valid range is [-255/256, 255/256].
+ NvS16 R2Y; /**< Red-to-Y coefficient. Unsigned fixed point format. Valid range is [0, 255/256]. */
+ NvS16 G2Y; /**< Green-to-Y coefficient. Unsigned fixed point format. Valid range is [0, 1 255/256]. */
+ NvS16 B2Y; /**< Blue-to-Y coefficient. Unsigned fixed point format. Valid range is [0, 1 255/256]. */
+ NvS16 R2U; /**< Red-to-U coefficient. Signed fixed point format. Valid range is [-255/256, 255/256]. */
+ NvS16 G2U; /**< Green-to-U coefficient. Signed fixed point format. Valid range is [-255/256, 255/256]. */
+ NvS16 B2U; /**< Blue-to-U coefficient. Signed fixed point format. Valid range is [-255/256, 255/256]. */
+ NvS16 R2V; /**< Red-to-V coefficient. Signed fixed point format. Valid range is [-255/256, 255/256]. */
+ NvS16 G2V; /**< Green-to-V coefficient. Signed fixed point format. Valid range is [-255/256, 255/256]. */
+ NvS16 B2V; /**< Blue-to-V coefficient. Signed fixed point format. Valid range is [-255/256, 255/256]. */
+} GFISPYUVCONVERSION, *PGFISPYUVCONVERSION;
+
+/** Isp set mode
+ This structure set ISP parameters to the specified mode, as specidied in the ISP script.
+*/
+typedef struct _GFISPSETMODE
+{
+ NvS32 Mode; /**< Mode number. */
+} GFISPSETMODE, *PGFISPSETMODE;
+
+/** 3A AE parameter
+ These enum contains 3A AE control parameters.
+*/
+
+typedef enum
+{
+ GFISP_AE_FRAME_CHOICE_FIXED = 0, /**< fixed frame rate. At lowlux AE will use only digital gain to increase brightness */
+ GFISP_AE_FRAME_CHOICE_FLEXIBLE = 1 /**< At lowlux AE will increase frame height first (i.e., lower frame rate) to increase brightness Frame height is bounded by FrameHeight at GFISP_AE_SENSORINFO. */
+}GFISP_AE_FRAME_CHOICE;
+
+typedef enum
+{
+ GFISP_AE_METERING_CHOICE_EVALUATIVE = 0, /**< calculate luminance average by propriotary algorithm */
+ GFISP_AE_METERING_CHOICE_SPOT = 1, /**< calculate luminance average from center window only */
+ GFISP_AE_METERING_CHOICE_CENTER = 2, /**< GFISP_AE_METERING_CHOICE_CENTER: calculate luminance average from weighted sum of center window and whole frame */
+ GFISP_AE_METERING_CHOICE_MATRIX = 3 /**< calculate luminance average from weighted sum of 3x3 sub-windows */
+}GFISP_AE_METERING_CHOICE;
+
+typedef enum
+{
+ GFISP_AE_ANTIFLICKER_CHOICE_50HZ = 0, /**< use AEStep_50Hz in GFISP_AE_SENSORINFO as exposure steps */
+ GFISP_AE_ANTIFLICKER_CHOICE_60HZ = 1, /**< use AEStep_60Hz in GFISP_AE_SENSORINFO as exposure steps */
+ GFISP_AE_ANTIFLICKER_CHOICE_MANUAL = 2, /**< use ManualAntiFlickerStep in GFISP_AE_CONTROL1 as exposure steps */
+ GFISP_AE_ANTIFLICKER_CHOICE_AUTO = 3 /**< enable auto anti-flickering */
+}GFISP_AE_ANTIFLICKER_CHOICE;
+
+/** 3A AE parameter
+ This structure contains 3A AE parameters.
+*/
+typedef struct _GFISP3AAE
+{
+ NvU16 AETarget; /**< [0..255]. Target average luminance value for AE convergence. Higher value renders brighter image. */
+ NvU16 AEToleranceIn; /**< [0..255]. Convergence tolerance from AESTATE_OUT to AESTATE_IN */
+ NvU16 AEToleranceOut; /**< [0..255]. Convergence tolerance from AESTATE_OUT to AESTATE_IN. Normally AEToleranceOut >= AEToleranceIn */
+ GFISP_AE_FRAME_CHOICE FrameRateChoice; /**< GFISP_AE_FRAME_CHOICE */
+ GFISP_AE_METERING_CHOICE MeteringChoice; /**< GFISP_AE_METERING_CHOICE */
+ GFISP_AE_ANTIFLICKER_CHOICE AntiFlickerChoice; /**< GFISP_AE_ANTIFLICKER_CHOICE */
+ NvU8 ConvergeSpeed; /**< [1..15]. AE convergence speed. 1 being the fastest (immediate update) */
+ NvS32 Status; /**< 3A AE Status. Read only */
+
+ NvU32 ManualAntiFlickerStep; // manual exposure step. Used when AntiFlickerChoice=GFISP_AE_ANTIFLICKER_CHOICE_MANUAL
+ NvS32 CenterWeight, FrameWeight; // weights for MeteringChoice=GFISP_AE_METERING_CHOICE_CENTER
+ NvS32 Metering11, Metering12, Metering13,// weights for MeteringChoice=GFISP_AE_METERING_CHOICE_MATRIX
+ Metering21, Metering22, Metering23,
+ Metering31, Metering32, Metering33;
+ NvU16 AdditionalLumaIncreaseForFlatScene;// [0..255]. give final exposure additional increase if scene is flat.
+ NvU16 BacklightTbright; // [0..255]. Threshold for determining "bright regions" (for backlight checking)
+ NvU16 BacklightTdark; // [0..255]. Threshold for determining "dark regions" (for backlight checking)
+ NvU16 TOverexposed; // [0..255]. Threshold for determining overexposed condition.
+ NvU16 TDark; // [0..255]. Threshold for determining dark condition.
+ NvU8 AutoNoiseControl; /**< Auto Noise Control */
+} GFISP3AAE, *PGFISP3AAE;
+
+/* Exposure parameter USED for Manual Exposure and Gain settings
+*/
+typedef struct _GFISPEXPOSURECONTROL
+{
+ NvU32 MaxFrameHeight; // longest exposure time allowed. >= DefaultFrameHeight, in unit
+ // of per scanline.
+ // For constant framerate application, set MaxFrameHeight=FrameHeight.
+
+ NvU32 DefaultFrameHeight; // sensor's default time difference betwee two consecutive VSYNC pulses,
+ // in unit of per scanline.
+ NvU32 DefaultFrameHeightIS; // Limit the frame height corresponding to ET of 1/60 sec
+
+ NvU16 MaxGain; // [1..128]. max digital gains allowed. Normally set to 2 (=200%)
+ // if anti-flickering is on. If larger sensitivity boost is needed
+ // at lowlux condition set MaxGain to higher value.
+ NvU16 MinGain; //Minimum Exposure Gain in ISP Format
+
+ NvU16 MaxGainIS; // max digital gain allowed in the case of image stabilization
+
+}GFISPEXPOSURECONTROL, *PGFISPEXPOSURECONTROL;
+
+/* Manual Exposure and Gain settings
+*/
+typedef struct _GFISPMANUALEXPOSURE
+{
+ NvU32 Exposure; // exposure time
+ NvU32 Gain; // digital gain
+}GFISPMANUALEXPOSURE, *PGFISPMANUALEXPOSURE;
+
+
+/** 3A AWB parameter
+ This structure contains 3A AWB parameters.
+*/
+
+typedef enum
+{
+ GFISP_AWB_WBMODE_CLOUDY = 0, /**<: for cloudy conditions (7,000K - 8,000K) */
+ GFISP_AWB_WBMODE_SUNNY = 1, /**<: for sunny conditions (5,500K - 6,000K) */
+ GFISP_AWB_WBMODE_FLASH = 2, /**<: for strobe or xenon flashes (~5,000K) */
+ GFISP_AWB_WBMODE_FLUORESCENT = 3, /**<: for indoor office conditions (~3,000K) */
+ GFISP_AWB_WBMODE_INCANDESCENT = 4, /**<: for indoor home conditions (~2,800K) */
+}GFISP_AWB_WBCUSTOM;
+
+typedef enum
+{
+ GFISP_AWB_COPLEXITY_HIGH = 0, /***/
+ GFISP_AWB_COPLEXITY_MEDIUM = 1, /***/
+ GFISP_AWB_COPLEXITY_LOW = 2 /***/
+}GFISP_AWB_COMPLEXITY;
+
+typedef struct _GFISP3AAWB
+{
+ NvU8 fWBCustom; // =0 when WB Custom Setting OFF
+ // =1 when WB Custom Setting ON
+ GFISP_AWB_WBCUSTOM WBCustomK; // Choose one of the defined illum class when fWBCustom=1
+ // GFISP_AWB_WBMODE_CLOUDY = 0, /**<: for cloudy conditions (7,000K - 8,000K) */
+ // GFISP_AWB_WBMODE_SUNNY = 1, /**<: for sunny conditions (5,500K - 6,000K) */
+ // GFISP_AWB_WBMODE_FLASH = 2 /**<: for strobe or xenon flashes (~5,000K) */
+ // GFISP_AWB_WBMODE_FLUORESCENT = 3, /**<: for indoor office conditions (~3,000K) */
+ // GFISP_AWB_WBMODE_INCANDESCENT = 4, /**<: for indoor home conditions (~2,800K) */
+ // Must be < NumWBCustom
+
+ GFISP_AWB_COMPLEXITY ComplexityMode;
+ NvS8 WBShift; /**< Moves up or down illuminant class. For white balance bracketing. */
+ /**< timing and stability control */
+ NvU8 ConvergeSpeed; /**< [0..6], 6 being the fastest (immediate update) */
+ NvU8 ToleranceIn; /**< [0..255], tolerance for convergence. */
+ NvU8 ToleranceOut; /**< [0..255], threshold for triggering new AWB update. Normally ToleranceIn < ToleranceOut, and both toelrances are small (e.g., 5 to 10). */
+ NvU32 FilterCoefficient; /**< [0-20] Filter coefficient used for scene change detection . */
+ NvU32 M3FilterCoefficient; /**< [0-60] Filter coefficient used for temporal low pass filtering of M3 Buffer . */
+ NvU32 UseM3LPFilter; /**< Flag for M3 Low Pass Filter. 1 = Enable LPF, 0 = Disable */
+ NvU32 KXYCorrelation; /**< To be used for scene change detection. */
+
+ NvS32 Status; /**< 3A AWB Status. Read only */
+} GFISP3AAWB, *PGFISP3AAWB;
+
+typedef enum
+{
+ GFISP_AFSTATE_IN = 0,
+ GFISP_AFSTATE_OUT = 1,
+ GFISP_AFSTATE_INIT = 2
+}GFISP_AF_STATE;
+
+typedef enum
+{
+ GFISP_AF_TYPE_CENTER = 1,
+ GFISP_AF_TYPE_AUTO_EVALUATE = 2,
+ GFISP_AF_TYPE_FACE_PRIORITY = 3
+}GFISP_AF_TYPE;
+
+typedef enum
+{
+ GFISP_AF_MODE_CONTINUOUS = 0,
+ GFISP_AF_MODE_SINGLE = 1
+}GFISP_AF_MODE;
+
+/** 3A AF parameter
+ This structure contains 3A AF parameters.
+*/
+typedef struct _GFISP3AAF
+{
+ GFISP_AF_STATE Status; /**< 3A AF Status. Read only */
+ GFISP_AF_MODE Mode;
+ NvU8 Speed;
+ NvU8 LockTillAE;
+ NvU8 LockTillAWB;
+ NvU8 TakeSnapshot;
+} GFISP3AAF, *PGFISP3AAF;
+
+/** ISP 3A Capability.
+To get the 3A capability for a particular sensor.
+*/
+typedef struct _GFISPSENSORCAPABILITY
+{
+ NvU8 AWBCapability; /***/
+ NvU8 AECapability; /***/
+ NvU8 AFCapability; /***/
+ NvU8 ManualOBCapability; /***/
+ NvU8 AutoOBCapability; /***/
+}GFISPSENSORCAPABILITY, *PGFISPSENSORCAPABILITY;
+
+
+
+typedef enum
+{
+ GFISP_SENSOR_I2C_8_BIT_REGISTER = 0,
+ GFISP_SENSOR_I2C_16_BIT_REGISTER = 1,
+} REGISTERTYPE;
+
+typedef struct _GFISPSENSORRWREGISTER
+{
+ REGISTERTYPE RegisterType; //0: 8-bit register , 1: 16-bit register
+ NvU32 Addr; /**< Address : data read-write address>*/
+ NvU32 Data; /**< Value of data at that address >*/
+}GFISPSENSORRWREGISTER, *PGFISPSENSORRWREGISTER;
+
+/** 3A algorithm type
+ These enum contains 3A algorithm type required for checking convergence.
+*/
+typedef enum
+{
+ GFISP_CB_REGISTER_3A_AWB = 0,
+ GFISP_CB_REGISTER_3A_AE = 1,
+ GFISP_CB_REGISTER_3A_AF = 2
+} GFISP3ATYPE;
+
+/** Enabling or disabling the "gain reduction and gamma compression" property for reducing noise introduced due to high gain
+* in case of Image Stabilization.
+*/
+typedef enum
+{
+ GFISP_REDUCE_GAIN_COMPRESS_GAMMA_ON,
+ GFISP_REDUCE_GAIN_COMPRESS_GAMMA_OFF
+} GFISPGAINGAMMACTRL;
+/** Public exposed ISP API function table. See @ref groupIspFunctions. */
+typedef struct _GFISPTABLE
+{
+ GF_RETTYPE (* ISPGetProperty) ( GFIspHandle ISPHandle, PGFISPPROPERTY pIspProp );
+
+#if defined(DVS_DEVELOPMENT)
+ GF_RETTYPE (* ISPSetup) ( GFIspHandle ISPHandle, GFVxHandle VxHandle, PGFCAMERARESOLUTIONTYPE pCameraResolution, GFVXBLT vxBlt );
+#else
+ GF_RETTYPE (* ISPSetup) ( GFIspHandle ISPHandle, PGFCAMERARESOLUTIONTYPE pCameraResolution );
+#endif
+
+ GF_RETTYPE (* ISPSetResolution) ( GFIspHandle ISPHandle, PGFCAMERARESOLUTIONTYPE pCameraResolution );
+
+ GF_RETTYPE (* ISPGetAttribute) ( GFIspHandle ISPHandle,
+ GFISPATTRIBUTES aid,
+ NvU32 *attr);
+ GF_RETTYPE (* ISPSetAttribute) ( GFIspHandle ISPHandle,
+ GFISPATTRIBUTES aid,
+ NvU32 attr);
+
+ GF_RETTYPE (* ISPSetAttributeToDefault) (GFIspHandle ISPHandle, GFISPATTRIBUTES aid);
+
+ GF_RETTYPE (* ISPGetParameter) ( GFIspHandle ISPHandle,
+ GFISPPARAMETERS pid,
+ NvU32 *pSize,
+ void *pPara);
+ GF_RETTYPE (* ISPSetParameter) ( GFIspHandle ISPHandle,
+ GFISPPARAMETERS pid,
+ NvU32 size,
+ void *pPara);
+
+ GF_RETTYPE (* ISPSetParameterToDefault) (GFIspHandle ISPHandle, GFISPPARAMETERS pid);
+
+ GF_RETTYPE (* ISPTriggerMWindowGather) (GFIspHandle ISPHandle);
+
+ GF_RETTYPE (* ISPReadMWindowValues) ( GFIspHandle ISPHandle,
+ NvS32 szM1Buffer,
+ NvU32 *pM1Buffer,
+ NvS32 szM2Buffer,
+ NvU32 *pM2Buffer,
+ NvS32 szM3Buffer,
+ NvU32 *pM3Buffer,
+ NvS32 szM4Buffer,
+ NvU32 *pM4Buffer);
+
+ GF_RETTYPE (* ISPOEMScriptFunc) (GFIspHandle ISPHandle,
+ NvU32 ScriptFuncTag,
+ NvU32 size,
+ NvU32 *pBuffer);
+
+ GF_RETTYPE (* ISP3APeriodicTrigger)(GFIspHandle ISPHandle);
+
+ GF_RETTYPE (* ISPAeBracketingSetET) (NvS32 mode, NvU32 *pRetExposure, NvS32 *pRetGain);
+
+ GF_RETTYPE (* ISPAwbBracketingSetIllum) (NvS32 mode, NvU16 *pRetCCT);
+
+ GF_RETTYPE (* ISPRegister3ACallback) (GFIspHandle ISPHandle, GFISP3ATYPE type, void (*func)(void *), void *pParameter);
+
+} GFISPTABLE, *PGFISPTABLE;
+
+// Typesafe functions for opening and closing this component
+GF_RETTYPE GFIspOpen(GFRmHandle hRm, GFIspHandle *phIsp,
+ GF_STATE_TYPE state, GFRmChHandle hCh);
+void GFIspClose(GFIspHandle *phIsp);
+
+/** @defgroup groupIspFunctions ISP Function macros
+ These function macros represent the function calls for GFISPAPI.
+*/
+/*@{*/
+
+/** Returns information about the GFISPAPI.
+
+ @param handle Valid handle to GFISPAPI component.
+ @param pIspProp Pointer to a #GFISPPROPERTY struct.
+ For the sake of future expansion, the caller should put the size of
+ the structure into the #GFISPPROPERTY::size field; GFISPAPI will not
+ fill the structure beyond this size.
+
+ @retval GF_SUCCESS Success
+ @retval GFISP_ERROR_SIZE_TOO_SMALL Error: size parameter is too small to fit even partial results.
+
+ This function returns information about the GFISPAPI, including the
+ following:
+ - GFISPAPI module version
+ - ISP capability
+ - ISP limit parameters
+ It is good practice to use this function to query for the API version and
+ capabilities before using other GFISPAPI functions.
+
+ @see GFISPPROPERTY, groupIspCapability
+*/
+#define GFISPGetProperty( handle, pIspProp ) \
+ ((PGFISPTABLE)handle)->ISPGetProperty( handle, pIspProp )
+
+/** Sets up the ISP API for use with a particular camera.
+
+ @param handle Valid handle to GFISPAPI component.
+ @param pCameraResolution Pointer to a #GFCAMERARESOLUTIONTYPE structure
+ with valid BayerInfo.
+
+ @retval GF_SUCCESS Success
+ @retval GFISP_ERROR_BAD_HANDLE #handle is invalid.
+ @retval GFISP_ERROR_ILLEGAL_PARAMETER One or more parameters is NULL or out-of-range.
+
+ You must call GFISPGetProperty before calling any other ISP API functions,
+ with the exception of GFISPGetProperty. This function initializes ISP
+ to work with a particular resolution of camera.
+
+*/
+#if defined(DVS_DEVELOPMENT)
+#define GFISPSetup( handle, vxhandle, pCameraResolution, vxBlt ) \
+ ((PGFISPTABLE)handle)->ISPSetup( handle, vxhandle, pCameraResolution, vxBlt )
+#else
+#define GFISPSetup( handle, pCameraResolution ) \
+ ((PGFISPTABLE)handle)->ISPSetup( handle, pCameraResolution )
+#endif
+
+/** Resizes/repositions all windows based on resolution data.
+
+ @param handle Valid handle to GFISPAPI component.
+ @param pCameraResolution Pointer to a #GFCAMERARESOLUTIONTYPE structure
+ with valid BayerInfo.
+
+ @retval GF_SUCCESS Success
+ @retval GFISP_ERROR_BAD_HANDLE #handle is invalid.
+ @retval GFISP_ERROR_ILLEGAL_PARAMETER One or more parameters is NULL or out-of-range.
+ @retval GFISP_ERROR_CALL_SETUP_FIRST The application did not call GFISPSetup() prior to calling this function.
+
+ This function resizes and repositions the windows for several ISP parameters
+ based on the provided BayerInfo struct. Affected parameters are:
+ - Timing
+ - M1-M4 statistics windows
+ - Optical black regions
+ - Lens shading center point
+
+*/
+#define GFISPSetResolution( handle, pCameraResolution ) \
+ ((PGFISPTABLE)handle)->ISPSetResolution( handle, pCameraResolution )
+
+/** Get an attribute of the GFISPAPI.
+
+ @param handle Valid handle to GFISPAPI component.
+ @param aid Attribute ID. One of #GFISPATTRIBUTES enumeration type.
+ @param pAttrData Pointer to an #NvU32 to be filled with the attribute value.
+
+ @retval GF_SUCCESS Success
+ @retval GFISP_ERROR_BAD_HANDLE #handle is invalid.
+ @retval GFISP_ERROR_ILLEGAL_PARAMETER One or more parameters is NULL or out-of-range.
+ @retval GFISP_ERROR_CALL_SETUP_FIRST The application did not call GFISPSetup() prior to calling this function.
+
+ @see GFISPATTRIBUTES
+*/
+#define GFISPGetAttribute( handle, aid, pAttrData ) \
+ ((PGFISPTABLE)handle)->ISPGetAttribute( handle, aid, pAttrData )
+
+/** Set an attribute of the GFISPAPI.
+
+ @param handle Valid handle to GFISPAPI component.
+ @param aid Attribute ID. A #GFISPATTRIBUTES enumeration type value.
+ @param attrData Pointer to an #NvU32 to be filled with the attribute value.
+
+ @retval GF_SUCCESS Success
+ @retval GFISP_ERROR_BAD_HANDLE #handle is invalid.
+ @retval GFISP_ERROR_ILLEGAL_PARAMETER One or more parameters is NULL or out-of-range.
+ @retval GFISP_ERROR_CALL_SETUP_FIRST The application did not call GFISPSetup() prior to calling this function.
+
+ Under the NVIDIA ISP implementation, certain ISP functions can be turned
+ on or off independent of parameter settings. In most cases, this function
+ simply switches certain ISP functions on or off.
+
+ To set parameters for specific ISP functions, see GFISPSetParameter().
+
+ @see GFISPATTRIBUTES
+*/
+#define GFISPSetAttribute( handle, aid, attrData ) \
+ ((PGFISPTABLE)handle)->ISPSetAttribute( handle, aid, attrData )
+
+/** Set an attribute of the GFISPAPI to its default value.
+
+ @param handle Valid handle to GFISPAPI component.
+ @param aid Attribute ID. A #GFISPATTRIBUTES enumeration type value.
+
+ @retval GF_SUCCESS Success
+ @retval GFISP_ERROR_BAD_HANDLE #handle is invalid.
+ @retval GFISP_ERROR_ILLEGAL_PARAMETER One or more parameters is NULL or out-of-range.
+ @retval GFISP_ERROR_CALL_SETUP_FIRST The application did not call GFISPSetup() prior to calling this function.
+
+ @see GFISPATTRIBUTES
+*/
+#define GFISPSetAttributeToDefault( handle, aid ) \
+ ((PGFISPTABLE)handle)->ISPSetAttributeToDefault( handle, aid )
+
+/** Get parameters for a given ISP functional block.
+
+ @param handle Valid handle to GFISPAPI component.
+ @param pid Parameter ID. A #GFISPPARAMETERS enumeration type value.
+ @param pSize Pointer to an #NvU32 to be filled with the parameter size. Can be NULL.
+ @param pPara Pointer to a certain GFISPAPI data structure, depending on #pid. Can be NULL.
+
+ @retval GF_SUCCESS Success
+ @retval GFISP_ERROR_BAD_HANDLE #handle is invalid.
+ @retval GFISP_ERROR_ILLEGAL_PARAMETER One or more parameters is NULL or out-of-range.
+ @retval GFISP_ERROR_CALL_SETUP_FIRST The application did not call GFISPSetup() prior to calling this function.
+
+ @see GFISPPARAMETERS
+*/
+#define GFISPGetParameter( handle, pid, pSize, pPara ) \
+ ((PGFISPTABLE)handle)->ISPGetParameter( handle, pid, pSize, pPara )
+
+/** Set parameters for a given ISP functional block.
+
+ @param handle Valid handle to GFISPAPI component.
+ @param pid Parameter ID. A #GFISPPARAMETERS enumeration type value.
+ @param size #NvU32 with actual size of GFISPAPI structure pointed to by #pPara.
+ @param pPara Pointer to a certain GFISPAPI data structure, depending on #pid.
+
+ @retval GF_SUCCESS Success
+ @retval GFISP_ERROR_BAD_HANDLE #handle is invalid.
+ @retval GFISP_ERROR_ILLEGAL_PARAMETER One or more parameters is NULL or out-of-range.
+ @retval GFISP_ERROR_SIZE_TOO_SMALL #size parameter is too small
+ @retval GFISP_ERROR_CALL_SETUP_FIRST The application did not call GFISPSetup() prior to calling this function.
+
+ @see GFISPPARAMETERS
+*/
+#define GFISPSetParameter( handle, pid, size, pPara ) \
+ ((PGFISPTABLE)handle)->ISPSetParameter( handle, pid, size, pPara )
+
+/** Set parameters for a given ISP functional block to their default value.
+
+ @param handle Valid handle to GFISPAPI component.
+ @param pid Parameter ID. A #GFISPPARAMETERS enumeration type value.
+
+ @retval GF_SUCCESS Success
+ @retval GFISP_ERROR_BAD_HANDLE #handle is invalid.
+ @retval GFISP_ERROR_ILLEGAL_PARAMETER One or more parameters is NULL or out-of-range.
+ @retval GFISP_ERROR_CALL_SETUP_FIRST The application did not call GFISPSetup() prior to calling this function.
+
+ @see GFISPPARAMETERS
+*/
+#define GFISPSetParameterToDefault( handle, pid ) \
+ ((PGFISPTABLE)handle)->ISPSetParameterToDefault( handle, pid )
+
+/** Triggers MWindow statistics to be gathered on the next frame.
+
+ @param handle Valid handle to GFISPAPI component.
+
+ @retval GF_SUCCESS Success
+ @retval GFISP_ERROR_BAD_HANDLE #handle is invalid.
+ @retval GFISP_ERROR_CALL_SETUP_FIRST The application did not call GFISPSetup() prior to calling this function.
+
+ This function will trigger MWindow statistics to be gathered for
+ any of the M2, M3, M4 statistics that are turned on. M1 statistics
+ are constantly gathered. The statistics will become available at
+ the end of the next frame, and can be read by calling
+ GFISPReadMWindowValues().
+
+ Calling GFISPTriggerMWindowGather implicitly sets
+ #GFISP_ATTR_ENABLE_STATS_INT to 1.
+
+ @see GFISPReadMWindowValues
+*/
+#define GFISPTriggerMWindowGather( handle ) \
+ ((PGFISPTABLE)handle)->ISPTriggerMWindowGather( handle )
+
+/** Reads gathered MWindow statistics if they are ready.
+
+ @param handle Valid handle to GFISPAPI component.
+ @param szM1Buffer Maximum size of M1Buffer provided by caller (in bytes). The
+ GFISPAPI fills the buffer as much as it can. If zero, the GFISPAPI
+ doesn't fill the M1Buffer.
+ @param pM1Buffer Array of 8 data. First four 32-bit values will be filled with average
+ RGGB pixel values. Next four values will be filled with peak pixel values.
+ Can be NULL, then the GFISPAPI doesn't fill M1Buffer.
+ @param szM2Buffer Maximum size of M2Buffer provided by caller (in bytes). The
+ GFISPAPI fills the buffer as much as it can. If zero, the GFISPAPI
+ doesn't fill the M2Buffer.
+ @param pM2Buffer Array of 16 data. Data is arranged in 32-bit words as follows:
+ {R1, Gr1, Gb1, B1,
+ R2, Gr2, Gb2, B2, ...}
+ Can be NULL, then the GFISPAPI doesn't fill M2Buffer.
+ @param szM3Buffer Maximum size of M3Buffer provided by caller (in bytes). The
+ GFISPAPI fills the buffer as much as it can. If zero, the GFISPAPI
+ doesn't fill the M3Buffer.
+ @param pM3Buffer Array to hold pixel samples. The size matches the M3 Window specification.
+ The data is arranged as follows:
+ {R1, R2, R3, R4},
+ {Gr1, Gr2, Gr3, Gr4},
+ {Gb1, Gb2, Gb3, Gb4},
+ {B1, B2, B3, B4},
+ {R5, R6, R7, R8},
+ ...
+ Can be NULL, then the GFISPAPI doesn't fill M3Buffer.
+ @param szM4Buffer Maximum size of M4Buffer provided by caller (in bytes). The
+ GFISPAPI fills the buffer as much as it can. If zero, the GFISPAPI
+ doesn't fill the M4Buffer.
+ @param pM4Buffer Array of 2*M4WindowNumber data. Data is arranged as follows:
+ {HF1, Luma1, HF2, Luma2, ...}
+ Can be NULL, then the GFISPAPI doesn't fill M4Buffer.
+
+ @retval GF_SUCCESS Success
+ @retval GFISP_ERROR_BAD_HANDLE #handle is invalid.
+ @retval GFISP_ERROR_STATISTICS_NOT_READY M2/M3/M4 statistics not ready.
+ @retval GFISP_ERROR_CALL_SETUP_FIRST The application did not call GFISPSetup() prior to calling this function.
+
+ Call this function to read the MWindow values gathered by the last call to
+ GFISPTriggerMWindowGather(). The user may either poll for statistics ready
+ by checking the return code, or use the interrupt mechanism to only call
+ GFISPReadMWindowValues once the statistics are ready.
+
+ After the statistics are gathered, they will remain available for reading
+ until the next call to GFISPTriggerMWindowGather().
+
+ M1 statistics are gathered every frame regardless of whether
+ GFISPTriggerMWindowGather() has been called. The user can read
+ the last frame's M1 statistics without ever triggering a gather by
+ passing 0 and NULL for the M2-M4 parameters to GFISPReadMWindowValues().
+
+ @see GFISPTriggerMWindowGather
+*/
+#define GFISPReadMWindowValues( handle, szM1Buffer, pM1Buffer, \
+ szM2Buffer, pM2Buffer, szM3Buffer, pM3Buffer, szM4Buffer, pM4Buffer ) \
+ ((PGFISPTABLE)handle)->ISPReadMWindowValues( handle, szM1Buffer, pM1Buffer, \
+ szM2Buffer, pM2Buffer, szM3Buffer, pM3Buffer, szM4Buffer, pM4Buffer )
+
+/** Call Oem function defined in ISP script.
+
+ @param handle Valid handle to GFISPAPI component.
+ @param ScriptFuncTag Function tag used by the script.
+ @param size Number of entries in the buffer pointed to by #pBuffer.
+ @param pBuffer Point to a @param #NvU32 buffer that will be passed to script function.
+ Use it to send parameter to script function and get data back.
+
+ @retval GF_SUCCESS Success
+ @retval GFISP_ERROR_BAD_HANDLE #handle is invalid.
+ @retval GFISP_ERROR_CALL_SETUP_FIRST The application did not call GFISPSetup() prior to calling this function.
+
+ Call this function to access script function OemScriptFunc().
+*/
+#define GFISPOEMScriptFunc( handle, ScriptFuncTag, size, pBuffer ) \
+ ((PGFISPTABLE)handle)->ISPOEMScriptFunc( handle, ScriptFuncTag, size, pBuffer )
+
+/** Trigger periodic software 3A function.
+
+ @param handle Valid handle to GFISPAPI component.
+ @retval GF_SUCCESS Success
+ @retval GFISP_ERROR_BAD_HANDLE #handle is invalid.
+ @retval GFISP_ERROR_CALL_SETUP_FIRST The application did not call GFISPSetup() prior to calling this function.
+
+ Call this function at every vertical blank to trigger periodic software 3A function
+*/
+#define GFISP3APeriodicTrigger( handle ) \
+ ((PGFISPTABLE)handle)->ISP3APeriodicTrigger( handle )
+
+/** Exposure Bracketing Function
+ @param handle Valid handle to GFISPAPI component
+ @param mode Range: 0 Exposure value output by AC Algo
+ -1 Less by one-third stop than AC Output
+ 1 More by one-third stop than AC Output
+ @param.pRetExpsoure Expsoure at current mode is returned through this pointer
+ @param pGain Gain at current mode is returned through this pointer
+ @retval GF_SUCCESS or GF_ERROR
+
+ Call this function three times with different modes each time in order to record images with exposure bracketing
+*/
+#define GFISPAeBracketingSetET(handle, mode, pRetExposure, pRetGain) \
+ ((PGFISPTABLE)handle)->ISPAeBracketingSetET( mode, pRetExposure, pRetGain )
+
+/** White Balance Bracketing Function
+ @param handle Valid handle to GFISPAPI component
+ @param mode Range: 0 Exposure value output by AC Algo
+ -1 Less by one Illuminant than AC Output
+ 1 More by one Illuminant than AC Output
+ @param pRetCCT Color Temprature at current mode is returned through this pointer
+ @retval GF_SUCCESS or GF_ERROR
+
+ Call this function three times with different modes each time in order to record images with White Balance bracketing
+*/
+#define GFISPAwbBracketingSetIllum(handle, mode, pRetCCT) \
+ ((PGFISPTABLE)handle)->ISPAwbBracketingSetIllum( mode, pRetCCT )
+
+/** Register callback function for the convergence of software Auto White balance
+
+ @param handle Valid handle to GFISPAPI component.
+ @param algoType whether AWB, AE or AF
+ @param func Pointer to the callback function
+ @param pParameter pointer to the argument of function call
+ @retval GF_SUCCESS Success
+ @retval GFISP_ERROR_BAD_HANDLE #handle is invalid.
+ @retval GFISP_ERROR If invalid function pointer is passed
+
+ Call this function when application wants to know whether the auto white balance algorithm is converged or not.
+ When algorithm converges it calls the function func which is registered as callback function.
+*/
+#define GFISPRegister3ACallback(handle, algoType, func, pParameter) \
+ ((PGFISPTABLE)handle)->ISPRegister3ACallback( handle, algoType, func, pParameter )
+
+/*@}*/ // End function macros
+
+/*@}*/ // End ISP API Doxygen
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* _GF_ISP__ */
diff --git a/Start_WM/test6/inc/GFIspError.h b/Start_WM/test6/inc/GFIspError.h
new file mode 100755
index 00000000..4f173424
--- /dev/null
+++ b/Start_WM/test6/inc/GFIspError.h
@@ -0,0 +1,37 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/*
+ * File: GFIspError.h
+ * GFSDK Image Signal Processor API error code header file.
+ */
+
+#ifndef __GFISPERROR_H__
+#define __GFISPERROR_H__
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+#define GFISP_ERROR_ILLEGAL_PARAMETER (GFISP_ERROR | 0x00000001L)
+#define GFISP_ERROR_BAD_HANDLE (GFISP_ERROR | 0x00000002L)
+#define GFISP_ERROR_SIZE_TOO_SMALL (GFISP_ERROR | 0x00000003L)
+#define GFISP_ERROR_STATISTICS_NOT_READY (GFISP_ERROR | 0x00000004L)
+#define GFISP_ERROR_CALL_SETUP_FIRST (GFISP_ERROR | 0x00000005L)
+#define GFISP_ERROR_OUT_OF_MEMORY (GFISP_ERROR | 0x00000006L)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // __GFISPERROR_H__
+
+
+
diff --git a/Start_WM/test6/inc/GFJxDec.h b/Start_WM/test6/inc/GFJxDec.h
new file mode 100755
index 00000000..879f10ed
--- /dev/null
+++ b/Start_WM/test6/inc/GFJxDec.h
@@ -0,0 +1,508 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/** @file GFJxDec.h
+GFSDK JPEG Decode API header file.
+*/
+#ifndef _GF_JPEG_DEC__
+#define _GF_JPEG_DEC__
+
+#include "nvtypes.h"
+#include "GFVx.h"
+
+#ifdef __cplusplus
+extern "C" { // only need to export C interface if
+ // used by C++ source code
+#endif
+
+/** @addtogroup groupJx JxDecAPI JPEG Decoder API
+*/
+ /*
+ @ref pageGxAppNotes
+
+
+ */
+
+/*@{*/
+
+// JXDECCapFlags
+
+/** JxDecAPI property flag: Support for Sequential encoded JPEG.
+ @see GFJxDecGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_JXDEC_CAP_SEQUENTIAL_DCT 0x00000001
+
+/** JxDecAPI property flag: Support for Progressive encoded JPEG.
+ @see GFJxDecGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_JXDEC_CAP_PROGRESS_DCT 0x00000002
+
+/** JxDecAPI property flag: Support for lossless encoded JPEG.
+ @see GFJxDecGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_JXDEC_CAP_LOSSLESS 0x00000004
+
+/** JxDecAPI property flag: Support for hierarchical encoded JPEG.
+ @see GFJxDecGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_JXDEC_CAP_HIERARCHICAL 0x00000008
+
+/** JxDecAPI property flag: Support for 8 bits encoded JPEG.
+ @see GFJxDecGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_JXDEC_CAP_8_BIT 0x00000010
+
+/** JxDecAPI property flag: "No" Support for 12 bits encoded JPEG Presently.
+ @see GFJxDecGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_JXDEC_CAP_12_BIT 0x00000020
+
+/** JxDecAPI property flag: Support for Interleaved mode.
+ @see GFJxDecGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_JXDEC_CAP_INTERLEAVE 0x00000040
+
+/** JxDecAPI property flag: "No" Support presently for Interleaved mode.
+ @see GFJxDecGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_JXDEC_CAP_NO_INTERLEAVE 0x00000080
+
+/** JxDecAPI property flag: Support for Huffman Coding.
+ @see GFJxDecGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_JXDEC_CAP_HUFFMAN 0x00000100
+
+/** JxDecAPI property flag: No Support for Arithematic Coding presently.
+ @see GFJxDecGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_JXDEC_CAP_ARITHMETIC 0x00000200
+
+/** JxDecAPI property flag: No Support for Interchange format coding.
+ @see GFJxDecGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_JXDEC_CAP_INTERCHANGE 0x00000400
+
+/** JxDecAPI property flag: Support for Pixel Based Cropping(MCU based Cropping).
+ @see GFJxDecGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_JXDEC_CAP_CROPPING 0x00001000
+
+/** JxDecAPI property flag: Support for YUV444 encoded JPEG images.
+ @see GFJxDecGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_JXDEC_CAP_YUV444 0x00002000
+
+/** JxDecAPI property flag: Support for YUV422 encoded JPEG images.
+ @see GFJxDecGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_JXDEC_CAP_YUV422 0x00004000
+
+/** JxDecAPI property flag: YUV422 Rotation Supported.
+ @see GFJxDecGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_JXDEC_CAP_ROTATED_YUV422 0x00008000
+
+/** JxDecAPI property flag: Support for YUV420 encoded JPEG images.
+ @see GFJxDecGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_JXDEC_CAP_YUV420 0x00010000
+
+/** JxDecAPI property flag: Support for Gray Scale encoded JPEG images.
+ @see GFJxDecGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_JXDEC_CAP_GRAY_SCALE 0x00020000
+
+/** JxDecAPI property flag: Support for Extended RGB format 24/32 bpp.
+ @see GFJxDecGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_JXDEC_CAP_EXTEND_RGB 0x00040000
+
+/** JxDecAPI property flag: Support for YUV420 output decoded format.
+ @see GFJxDecGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_JXDEC_CAP_420_OUTPUT 0x00080000
+
+/** JxDecAPI property flag: Support for YUV422 output decoded format.
+ @see GFJxDecGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_JXDEC_CAP_422_OUTPUT 0x00100000
+
+/** Image source dimensions and color format of the input JPEG to be decoded.
+ This structure is passed as parameter to GFJxDecGetImageInfo().
+
+ @see GFRMSURFACE::ColorFormat, GFJxDecGetImageInfo()
+*/
+typedef struct _GFJXDECIMAGEINFO
+{
+ NvU32 IIFlag; /**< Deprecated, do not use.
+ This variable is set to the same error code as returned by GFJxDecGetImageInfo().
+ @deprecated
+ */
+ NvU32 Width; /**< Width of the input image */
+ NvU32 Height; /**< Height of the input image */
+ NvU32 ColorFormat; /**< Color Format of input image (YUV420, YUV422, ...)
+ @see GFRMSURFACE.ColorFormat */
+}GFJXDECIMAGEINFO, *PGFJXDECIMAGEINFO;
+
+/** GFJxDecStart parameter structure.
+ This structure specifies target surface, scaling, source
+ and destination cropping for the decode operation.
+
+ @see GFJxDecStart()
+*/
+typedef struct _GFJXDECSTART
+{
+ NvU32 SFlag; /**< Deprecated, do not use. @deprecated */
+ PGFRMSURFACE pDestSurf; /**< Destination Surface to hold the decoded image.
+ The color format of the surface controls the output color format.
+ If no destination cropping rectangle is given, the decoded picture
+ is scaled to match the surface size.
+ */
+ PGFRECT pCroppingRect; /**< Source cropping area to be decoded, or NULL for no cropping.
+ Top-left position of the cropping rectangle must be aligned
+ to an MCU boundary.
+ */
+ PGFRECT pDestRect; /**< Destination cropping area, or NULL for no cropping.
+ If a destination cropping rectangle is given, the decoded picture
+ will be scaled to fit this rectangle.
+ */
+ NvU32 Error; /**< Deprecated, do not use.
+ This variable will be set to the same value as returned by GFJxDecStart().
+ @deprecated
+ */
+} GFJXDECSTART, *PGFJXDECSTART;
+
+
+//SFlag: not used anymore. Cropping is decided on whether
+//the pCroppingRect is NULL or not
+#define GF_JXDEC_SFLAG_CROPPING 0
+
+/** GF_DECODER_IDLE is returned if hardware decoder is idle by GFJxDecGetStatus().
+ @see GFJxDecGetStatus()
+*/
+#define GF_DECODER_IDLE 0x00000001
+
+/** GF_DECODER_BUSY is returned if hardware decoder is busy by GFJxDecGetStatus().
+ @see GFJxDecGetStatus()
+*/
+#define GF_DECODER_BUSY 0x00000002
+
+
+/** JxDecAPI Pass JX_DEC_SET_READBITSTREAM to GFJxDecSet to register call back function
+@see GFJxDecSet()
+*/
+#define JX_DEC_SET_READBITSTREAM 1
+
+/** Structure holding the callback function pointer.
+ Used in registering the callback function
+*/
+typedef struct _GFJXDECCALLBACK
+{
+ void *pPara; /**< Not used anymore */
+ NvU32 (*pCallBack)(void * pPara, NvU8 ** ppBuffer, NvS32 * BufferLength);
+ /**<
+ Application callback function pointer.
+ Register a callback function for fetching JPEG Image data.
+
+ @param *pPara Not used anymore
+ @param ppBuffer Buffer Pointer
+ @param BufferLength Buffer Length in bytes, 0 if no bytes read.
+
+ @retval The number of bytes read successfully, 0 if no bytes read.
+ */
+
+}GFJXDECCALLBACK, *PGFJXDECCALLBACK;
+
+/** Structure holding the callback function pointer.
+ Used in registering the callback function
+*/
+typedef struct _GFJXDECGETIMAGECALLBACK
+{
+ void *pPara;
+ /**< pPara is a parameter passed from application,
+ and application wants API to call back with this parameter
+ */
+ NvU32 (*pCallBack)(void * pPara, PGFRMSURFACE pImageSurf, PGFRECT pImageRect, NvU32 uiImageFlag);
+ /**<
+ Application callback function pointer.
+ Register a callback function for fetching decoded JPEG Image data.
+
+ @param *pPara Parameter to pass on to application callback function
+ @param pImageSurf Surface Pointer
+ @param pImageRect Source rectangle
+ @param uiImageFlag
+
+ #JX_DEC_IF_LAST_PORTION_IMAGE
+ This is the last portion of decoded image
+
+ @retval 0
+ */
+}GFJXDECGETIMAGECALLBACK, *PGFJXDECGETIMAGECALLBACK;
+
+
+/** This is the last portion of the Image.
+ @see GFJXDECGETIMAGECALLBACK
+*/
+#define JX_DEC_IF_LAST_PORTION_IMAGE 0x00000001 //this is the last portion of decoded image
+
+//Attribute uiFeature
+
+/** Set get decoded image call back(inorder to dump the decoded YUV from JPEG).
+ @see GFJXDECGETIMAGECALLBACK, GFJxDecGetImageInfo
+*/
+#define JX_DEC_GETIMAGE 0x00000001
+
+/** Pass JX_DEC_GETIMAGE_COLORFORMAT with GFJxDecGetAttribute to get JPEG image color format. */
+#define JX_DEC_GETIMAGE_COLORFORMAT 0x00000002
+
+
+/** Call this function get the JxDec Component's handle.
+ @param hRm (#GFRmHandle) Handle to the Resource Manager
+ @param phJxDec (#GFJxDECHandle) Pointer to the JxDecAPI Handle
+ @param state Set to Default state.
+ @param hCh (#GFRmChHandle) Channel Handle
+ @retval #GF_SUCCESS JxDec component registered successfully
+ @retval #GF_ERROR Some error occured
+*/
+GF_RETTYPE GFJxDecOpen(GFRmHandle hRm, GFJxDecHandle *phJxDec, GF_STATE_TYPE state, GFRmChHandle hCh);
+
+
+/** The function releases the JxDec's Component handle.
+ @param phJxDec (#GFJxDECHandle) Pointer to the JxDecAPI Handle
+*/
+void GFJxDecClose(GFJxDecHandle *phJxDec);
+
+/** This function returns version and capabilities of JPEG decoder.
+
+ @param hJxDec Handle to JxDecAPI
+ @param pJXProp Pointer to property structure to be filled in
+
+ @retval #GF_SUCCESS \a pJXProp filled in successfully
+ @retval #GF_ERROR Some error occured
+
+ @see GFPROPERTY
+*/
+GF_RETTYPE GFJxDecGetProperty(GFJxDecHandle hJxDec, PGFPROPERTY pJXProp);
+
+/** This function returns the status of the JPEG Decoder
+
+ @param hJxDec Handle to JxDecAPI
+ @param pStatus Returns status, GF_DECODER_BUSY or GF_DECODER_IDLE.
+*/
+GF_RETTYPE GFJxDecGetStatus(GFJxDecHandle hJxDec, NvU32* pStatus);
+
+/** The funtion gets the information about the input image and fills it into the pInfo
+
+ If the function fails, it will return an error code describing the failure cause.
+
+ @param hJxDec Handle to JxDecAPI
+ @param pInfo Pointer to Image Information structure to be filled in
+
+ @retval GF_SUCCESS \a pInfo filled in successfully
+ @retval GF_JXDEC_IFLAG_INVALID_MARKER Invalid Marker in JPEG file
+ @retval GF_JXDEC_IFLAG_INVALID_HDR_LEN Invalid header (marker) length in JPEG file
+ @retval GF_JXDEC_IFLAG_INVALID_SIG Invalid Image Signature(eg: JFIF, AVI, ..) in JPEG file
+ @retval GF_JXDEC_IFLAG_INVALID_DQT Invalid Quantization Table in JPEG file
+ @retval GF_JXDEC_IFLAG_INVALID_DHT Invalid Huffman Tables in JPEG file
+ @retval GF_JXDEC_IFLAG_INVALID_VALUE Invalid image parameters (eg: width, height , ...) in JPEG file
+ @retval GF_JXDEC_IFLAG_INVALID_FORMAT Invalid format in JPEG file
+ @retval GF_JXDEC_IFLAG_PROGRESSIVE_MARKER Invalid Marker in JPEG file
+ @see GFJXDECIMAGEINFO
+*/
+GF_RETTYPE GFJxDecGetImageInfo(GFJxDecHandle hJxDec, PGFJXDECIMAGEINFO pInfo);
+
+/** This function sets up a callback function
+ @param hJxDec Handle to JxDecAPI
+ @param uiFeature Feature ID to set
+ @param pInfo Feature specific parameter
+
+
+ \a uiFeature
+ \a pInfo interpretation
+ Meaning
+ JX_DEC_SET_READBITSTREAM
+ GFJXDECCALLBACK*
+ Set up Jpeg bitstream feed callback
+
+
+ @retval #GF_SUCCESS If successful
+ @retval #GFJXD_ERROR_INVALID_PARAMETER Invalid parameter
+
+ @see GFJXDECCALLBACK
+*/
+GF_RETTYPE GFJxDecSet(GFJxDecHandle hJxDec, NvU32 uiFeature, void* pInfo);
+
+/** Set attributes for the decoder.
+ @param hJxDec Handle to JxDecAPI,
+ @param attrID Attribute ID to be set
+ @param pInfo Attruvyte specific parameter
+
+
+ #JX_DEC_GETIMAGE
+ Get the YUV decoded JPEG image into a file, Sets the decoder image callback
+ #JX_DEC_GETIMAGE_COLORFORMAT
+ Set get decoded image color format.
+
+
+ @retval #GF_SUCCESS
+*/
+GF_RETTYPE GFJxDecSetAttribute(GFJxDecHandle hJxDec, NvU32 attrID, NvU32* pInfo);
+
+/** Gets attributes for the decoder
+ @param hJxDec Handle to JxDecAPI,
+ @param attrID Attribute ID to read
+ @param pInfo Pointer to block returning attribute specific data
+
+ #JX_DEC_GETIMAGE
+ Get the YUV decoded JPEG image into a file, Sets the decoder image callback
+ #JX_DEC_GETIMAGE_COLORFORMAT
+ Set get decoded image color format.
+
+*/
+GF_RETTYPE GFJxDecGetAttribute(GFJxDecHandle hJxDec, NvU32 attrID, NvU32* pInfo);
+
+/** Setup JxDecAPI for JPEG decoding a frame.
+
+ If GFJxDecStart() fails, it will return an error code describing the failure cause.
+ If GFJxDecStart() succeeded, GFJxDecEnd() must be called later.
+
+ @param hJxDec Handle to JxDecAPI
+ @param pStart Pointer to #GFJXDECSTART parameter structure.
+
+ @retval GF_SUCCESS Success
+ @retval GFRM_ERROR_OUT_MEMORY Not enough free GPU or system memory
+ @retval GF_JXDEC_NOT_SUPPORT_DESTSURFACE_FORMAT Destination Surface format not supported by the decoder
+ @retval GF_JXDEC_DECODER_WIDTH_TOO_BIG Image source width exceeds max decoder width
+ @retval GF_JXDEC_DECODER_HEIGHT_TOO_BIG Image source height exceeds max decoder height
+
+ @see GFJXDECSTART, GFJxDecSetAttribute(),GFJxDecEnd()
+*/
+GF_RETTYPE GFJxDecStart(GFJxDecHandle hJxDec, PGFJXDECSTART pStart);
+
+/** Decode the image
+ @param hJxDec Handle to JxDecAPI
+ @param uiFlag Reserved, must be 0.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ @see GFJxDecGetImageInfo(), GFJxDecStart(), GFJxDecSetAttribute(), GFJxDecEnd()
+
+*/
+GF_RETTYPE GFJxDecDecodeImage(GFJxDecHandle hJxDec, NvU32 uiFlag);
+
+/** End or cancel decoding a frame.
+ Must be called only, if GFJxDecStart() has been called before.
+ @param hJxDec Handle to JxDecAPI
+*/
+GF_RETTYPE GFJxDecEnd(GFJxDecHandle hJxDec);
+
+
+/** GFJxDecAPI Error Codes. */
+enum
+{
+ /** GFJxDecAPI API called with invalid parameters. */
+ GFJXD_ERROR_INVALID_PARAMETER = GFJXD_ERROR,
+
+ /** Operation not supported. */
+ GFJXD_ERROR_NOT_SUPPORTED,
+
+ /** Encountered incomplete bitstream during decoding. */
+ GFJXD_ERROR_INCOMPLETE_BITSTREAM,
+
+ /** GFJxDecStart() return code: Can't support this destination surface type.
+ @see GFJXDECSTART, GFJxDecStart()
+ */
+ GF_JXDEC_NOT_SUPPORT_DESTSURFACE_FORMAT,
+
+ /** GFJxDecStart() return code: Image width is too big for hardware decoder to handle
+ @see GFJXDECSTART, GFJxDecStart()
+ */
+ GF_JXDEC_DECODER_WIDTH_TOO_BIG,
+
+ /** GFJxDecStart() return code: Image height is too big for hardware decoder to handle
+ @see GFJXDECSTART, GFJxDecStart()
+ */
+ GF_JXDEC_DECODER_HEIGHT_TOO_BIG,
+
+ /** GFJxDecGetImageInfo() return code: If set then the input marker is Invalid,
+ if unset its a valid marker.
+ @see GFJXDECIMAGEINFO, GFJxDecGetImageInfo()
+ */
+ GF_JXDEC_IFLAG_INVALID_MARKER,
+
+ /** GFJxDecGetImageInfo() return code: If set then the Header Length is Invalid,
+ if unset its a valid header length.
+ @see GFJXDECIMAGEINFO, GFJxDecGetImageInfo()
+ */
+ GF_JXDEC_IFLAG_INVALID_HDR_LEN,
+
+ /** GFJxDecGetImageInfo() return code: If set then the Signature(eg: JFIF, AVI, ..) is Invalid,
+ if unset its a valid signature.
+ @see GFJXDECIMAGEINFO, GFJxDecGetImageInfo()
+ */
+ GF_JXDEC_IFLAG_INVALID_SIG,
+
+ /** GFJxDecGetImageInfo() return code: If set then the there occured an error in reading the Quantization Table,
+ if unset the Quantization Table was read clean.
+ @see GFJXDECIMAGEINFO, GFJxDecGetImageInfo()
+ */
+ GF_JXDEC_IFLAG_INVALID_DQT,
+
+ /** GFJxDecGetImageInfo() return code: If set then the Huffman Tables were not loaded properly
+ if unset Huffman Tables were loaded.
+ @see GFJXDECIMAGEINFO, GFJxDecGetImageInfo()
+ */
+ GF_JXDEC_IFLAG_INVALID_DHT,
+
+ /** GFJxDecGetImageInfo() return code: If set then there was an invalid value(eg : erroneous/incomplete bitstream) in the stream,
+ if unset its a valid Iflag.
+ @see GFJXDECIMAGEINFO, GFJxDecGetImageInfo()
+ */
+ GF_JXDEC_IFLAG_INVALID_VALUE,
+
+ /** GFJxDecGetImageInfo() return code: If set then the progressive marker not supported,
+ if unset its a valid marker.
+ @see GFJXDECIMAGEINFO, GFJxDecGetImageInfo()
+ */
+
+ GF_JXDEC_IFLAG_PROGRESSIVE_MARKER,
+ /** GFJxDecGetImageInfo() return code: If set then there was an invalid header format encountered in the stream,
+ if unset its a valid Iflag.
+ @see GFJXDECIMAGEINFO, GFJxDecGetImageInfo()
+ */
+ GF_JXDEC_IFLAG_INVALID_FORMAT
+};
+
+
+/** @page pageJxDecAppNotes JxDecAPI Application Notes
+ @section pageJxDecAppNotes Programming Sequence
+
+ The following procedure requires that GFRmOpen() is called first to start GFSDK usage.
+ -# Call GFJxDecOpen() to obtain JxDecHandle which will be passed to different functions of JxDecAPI.
+ -# Query the properties through GFJxDecGetProperty() to check whether the desired JxDec features can be supported.
+ -# Call GFRmSurfaceAlloc() to allocate one surface to hold the decoded image.
+ -# Register the call back function using GFJxDecSet()
+ -# Call GFJxDecGetImageInfo() to get the JPEG image information, such as width and height.
+ -# GFJxDecStart() is the next function to call. This function will setup the decoder.
+ -# Call GFJxDecDecodeImage() to do the real decoding.
+ -# After the whole bitstream has been fed, call GFJxDecEnd() to end the decoding process.
+ -# Release surface by calling GFRmSurfaceFree().
+ -# Release JPEG decoder by calling GFJxDecClose().
+*/
+
+/*@}*/
+
+#ifdef __cplusplus
+}
+#endif
+#endif
+
diff --git a/Start_WM/test6/inc/GFJxEnc.h b/Start_WM/test6/inc/GFJxEnc.h
new file mode 100755
index 00000000..c5170b44
--- /dev/null
+++ b/Start_WM/test6/inc/GFJxEnc.h
@@ -0,0 +1,1306 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/** @file GFJxEnc.h
+ GFSDK JPEG Encode API header file.
+*/
+
+#ifndef _GF_JPEG_ENC__
+#define _GF_JPEG_ENC__
+
+#include "GF.h"
+#include "GFRm.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+/** @addtogroup groupJxEnc JxEncAPI JPEG Encoder API
+
+ @ref pageJxEncAppNotes
+
+ @ref pageJxEncAppNotes1
+
+
+*/
+/*@{*/
+
+/** JxEncAPI property flag: JPEG quantization table is programmable.
+ @see GFJxEncGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_JX_ENC_CAP_QTABLE 0x00000001
+
+/** JxEncAPI property flag: Interrupt data capture mode and polling mode
+ supported, if this flag is off then only polling mode is supported.
+ @see GFJxEncGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_JX_ENC_CAP_INTERRUPT 0x00000004
+
+/** JxEncAPI property flag: Digital zoom supported.
+ @see GFJxEncGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_JX_ENC_CAP_DIGITAL_ZOOM 0x00000008
+
+/** JxEncAPI property flag: Motion JPEG mode supported.
+ @see GFJxEncGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_JX_ENC_CAP_MOTION_JPEG 0x00000010
+
+/** JxEncAPI property flag: Rate control supported.
+ @see GFJxEncGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_JX_ENC_CAP_RATE_CONTROL 0x00000020
+
+/** JxEncAPI property flag: Planar YUV422 data supported.
+ @see GFJxEncGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_JX_ENC_CAP_422_PLANAR 0x00000040
+
+/** JxEncAPI property flag: Rotation supported.
+ @see GFJxEncGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_JX_ENC_CAP_ROTATION 0x00000080
+
+
+/** Image source/target dimensions and data source for JPEG encoding.
+
+ This structure is passed as parameter to GFJxEncStart() and describes
+ data source, source cropping rectangle and destination image size.
+
+ The surface the application wants to encode is pSrcSurf. If the application
+ wants to encode an image from a camera or to re-encode a JPEG bitstream,
+ this field should be set to NULL. If the application wants to encode an
+ image from the display, this field should point to the primary surface. If
+ an application wants to encode an existing image, it must create a system
+ memory surface to hold the image and set this field to the system memory
+ surface.
+
+ @see GFJxEncStart()
+*/
+typedef struct _GFJXENCSTART
+{
+ PGFRMSURFACE pSrcSurf;/**< Surface to encode,
+ NULL for camera or re-encode JPEG
+ */
+ PGFRECT pSrcRect; /**< Source image area need to encode */
+ NvU32 DestWidth; /**< Final encoded image width */
+ NvU32 DestHeight; /**< Final encode image height */
+ NvU32 uiOptions; /**< Bitmask of flags to control encoding
+
+ #GF_CAPT_BITSTREAM
+ If set only bitstream is output, if
+ unset JFIF header will be added
+
+ #GF_CAPT_PIECE_MEAL
+ Piecemeal encoding @todo clarify
+ meaning
+
+
+ */
+ NvU32 Error; /**< Returns detailed error code on GFJxEncStart() failure
+
+ #GF_CAPT_ERROR_VIDEO_MEMORY_NOT_BIG_ENOUGH
+ Not enough free video memory, try to release
+ unnecessary video surfaces
+ #GF_CAPT_ERROR_WRONG_CONFIG
+ Wrong input parameters, for example srcRect
+ size greater than pSrcSurf dimensions
+ #GF_CAPT_ERROR_NO_CALLBACK
+ No callback function available
+
+ */
+} GFJXENCSTART, *PGFJXENCSTART;
+
+/** JxEncAPI GFJXENCSTART::uiOptions flagbit: If set only bitstream is output,
+ if unset JFIF header will be added.
+ @see GFJXENCSTART, GFJxEncStart()
+*/
+#define GF_CAPT_BITSTREAM 1
+
+/** JxEncAPI GFJXENCSTART::uiOptions flagbit: Piecemeal encoding
+ @todo clarify meaning
+ @see GFJXENCSTART, GFJxEncStart()
+*/
+#define GF_CAPT_PIECE_MEAL 2
+
+/** JxEncAPI GFJXENCSTART::Error return code: Not enough free video memory.
+ Try to release unnecessary video surfaces.
+ @see GFJXENCSTART, GFJxEncStart()
+*/
+#define GF_CAPT_ERROR_VIDEO_MEMORY_NOT_BIG_ENOUGH 1
+
+/** JxEncAPI GFJXENCSTART::Error return code: Wrong input parameters.
+ E.g. srcRect size greater than pSrcSurf dimensions.
+ @see GFJXENCSTART, GFJxEncStart()
+*/
+#define GF_CAPT_ERROR_WRONG_CONFIG 2
+
+/** JxEncAPI GFJXENCSTART::Error return code: No callback function available.
+ @todo clarify
+ @see GFJXENCSTART, GFJxEncStart()
+*/
+#define GF_CAPT_ERROR_NO_CALLBACK 4
+
+/** Descriptor for JPEG encode buffers.
+ This structure describes a buffer and its fill status for encoded
+ JPEG data or raw YUV transfered from the JPEG encoder to the
+ application. It is used with GFJxEncCapture() and GFJxEncFetchImage()
+ in either polling or callback data fetch mode.
+
+ @see GFJxEncCapture(), GFJxEncFetchImage(), GFJxEncPRComplete()
+*/
+typedef struct _GFJXENC_BUF {
+ NvU8 *pBuf; /**< Pointer to the buffer */
+ NvU32 bufSize; /**< Size of the buffer in bytes */
+ NvU32 nBytesCaptured; /**< Number of bytes captured,
+ app initializes to 0
+ */
+} GFJXENC_BUF, *PGFJXENC_BUF;
+
+/** Fetch buffer descriptor for use with GFJxEncFetchImage().
+ This data structure is used by GFJxEncInterruptHandler() to fetch encoded
+ image data when IntType is GFJX_ENC_STREAM_BUF_INTR or GFJX_ENC_DONE_INTR.
+*/
+typedef struct _GFJXENC_FETCH_BUF{
+ PGFJXENC_BUF pBuf;
+ NvU32 numOfBuf;
+ NvU32 status;
+} GFJXENC_FETCH_BUF, *PGFJXENC_FETCH_BUF;
+
+
+/** JxEncAPI data fetch status code: All data of the current frame was fetched.
+ @see GFJxEncFetchImage(), GFJxEncCapture()
+*/
+#define JXENC_DATA_COMPLETE 0x1
+
+/** JxEncAPI data fetch status code: Data was fetched only partially.
+ The application should make more calls to GFJxEncFetchImage() to fetch
+ the rest.
+ @see GFJxEncFetchImage(), GFJxEncCapture()
+*/
+#define JXENC_MORE_FETCH 0x2
+
+/** JxEncAPI data fetch status code: New frame was encoded and is ready to
+ fetch.
+ @see GFJxEncFetchImage(), GFJxEncCapture()
+*/
+#define JXENC_NEW_FRAME 0x8
+
+/** JxEncAPI data fetch status code: Time out error occured while encoded data is fetching.
+ fetch.
+ @see GFJxEncFetchImage(), GFJxEncCapture()
+*/
+#define JXENC_TIME_OUT 0x10
+
+// definition of uiFeature for GFJxEncSetAttribute
+//the following definations are for set only
+
+/** JxEncAPI attribute: Choose preset QTable, coefficients in luma and chroma
+ Qtable are all 1.
+
+ Interpretation of associated data block: None.
+
+ Attribute is set-only.
+
+ @see GFJxEncSetAttribute(), GFJxEncGetAttribute()
+*/
+#define JX_ENC_SET_100QUALITY 0
+
+/** JxEncAPI attribute: Choose preset QTable, standard Qtable A and B,
+ divided by 2.
+
+ Interpretation of associated data block: None.
+
+ Attribute is set-only.
+
+ @see GFJxEncSetAttribute(), GFJxEncGetAttribute()
+*/
+#define JX_ENC_SET_85QUALITY 1
+
+/** JxEncAPI attribute: Choose preset QTable, standard Qtable A and B.
+
+ Interpretation of associated data block: None.
+
+ Attribute is set-only.
+ @see GFJxEncSetAttribute(), GFJxEncGetAttribute()
+*/
+#define JX_ENC_SET_75QUALITY 2
+
+/** JxEncAPI attribute: Choose preset QTable, standard Qtable C and D.
+
+ Interpretation of associated data block: None.
+
+ Attribute is set-only.
+
+ @see GFJxEncSetAttribute(), GFJxEncGetAttribute()
+*/
+#define JX_ENC_SET_50QUALITY 3
+
+/** JxEncAPI attribute: Choose preset QTable, standard Qtable C and D,
+ multiplied by 2.
+
+ Interpretation of associated data block: None.
+
+ Attribute is set-only.
+
+ @see GFJxEncSetAttribute(), GFJxEncGetAttribute()
+*/
+#define JX_ENC_SET_25QUALITY 4
+
+/** JxEncAPI attribute: Choose preset QTable, standard Qtable C and D,
+ multiplied by 4.
+
+ Interpretation of associated data block: None.
+
+ Attribute is set-only.
+
+ @see GFJxEncSetAttribute(), GFJxEncGetAttribute()
+*/
+#define JX_ENC_SET_12QUALITY 5
+
+//the following definations can be used for set and get
+
+/** JxEncAPI attribute: Set custom luma QTable.
+
+ Interpretation of associated data block:
+ A table of 64 16-bit (type NvU16) entries with quantization coefficients
+ to be used for luma MCU's.
+
+ Attribute can be set and get.
+
+ @see GFJxEncSetAttribute(), GFJxEncGetAttribute()
+*/
+#define JX_ENC_LQTABLE 6
+
+/** JxEncAPI attribute: Set custom chroma QTable.
+
+ Interpretation of associated data block:
+ A table of 64 16-bit (type NvU16) entries with quantization coefficients
+ to be used for chroma MCU's.
+
+ Attribute can be set and get.
+
+ @see GFJxEncSetAttribute(), GFJxEncGetAttribute()
+*/
+#define JX_ENC_CQTABLE 7
+
+/** JxEncAPI attribute: Decimation filter enable/disable.
+
+ Interpretation of associated data block:
+
+ NvU32 decimation enable
+ 0 = disable
+ 1 = enable
+
+
+ Attribute can be set and get.
+
+ @see GFJxEncSetAttribute(), GFJxEncGetAttribute()
+*/
+#define JX_ENC_FILTER 8
+
+/** JxEncAPI attribute: Huffman bit stuffing.
+
+ Interpretation of associated data block:
+
+ NvU32 Huffman stuffing enable
+ 0 = disable
+ 1 = enable
+
+
+ Attribute can be set and get.
+ @see GFJxEncSetAttribute(), GFJxEncGetAttribute()
+*/
+#define JX_ENC_HUFF_BSTUFF 13
+
+/** JxEncAPI attribute: Motion JPEG capturing mode enable/disable.
+
+ Interpretation of associated data block:
+
+ NvU32 Motion JPEG capturing mode enable
+ 0 = disable
+ 1 = enable
+
+
+ Attribute can be set and get.
+ @see GFJxEncSetAttribute(), GFJxEncGetAttribute()
+*/
+#define JX_ENC_MOTION_JPEG 14
+
+/** JxEncAPI attribute: Raw data capturing mode enable/disable.
+
+ Interpretation of associated data block:
+
+ NvU32 Raw data capturing mode enable
+ 0 = disable
+ 1 = enable
+
+
+ Attribute can be set and get.
+ @see GFJxEncSetAttribute(), GFJxEncGetAttribute()
+*/
+#define JX_ENC_RAW_DATA 15
+
+/** JxEncAPI attribute: Re-encode a JPEG bitstream.
+
+ Registration of callback function for JPEG re-encode application:
+
+ #PGFJXDECCALLBACK structure
+
+
+ Attribute is set only.
+ @see GFJxEncSetAttribute(), GFJxEncGetAttribute()
+*/
+#define JX_ENC_BITSTREAM 16
+
+/** JxEncAPI attribute: JPEG encoding colour format.
+
+ Only YUV420 and YUV422 encoding is supported. The JPEG encoder converts
+ the incoming image to the configured colour format, and then encodes it
+ in the JPEG bitstream.
+
+ Only YUV420 and YUV422 are
+ valid.
+
+ Interpretation of associated data block:
+
+ NvU32 Colour format identifier, one of:
+ #GF_SURFACE_PLANAR_YUV422
+ #GF_SURFACE_YUV420
+
+
+ Attribute can be set and get.
+ @see GFJxEncSetAttribute(), GFJxEncGetAttribute(), GFRMSURFACE::ColorFormat
+*/
+#define JX_ENC_ENCODE_FORMAT 17
+
+/** JxEncAPI attribute: Maximum JPEG byte size.
+
+ The JPEG encoder will not generate a JPEG bitstream larger than this.
+
+ Interpretation of associated data block:
+
+ NvU32 Maximum size in bytes
+
+
+ Attribute can be set and get.
+ @see GFJxEncSetAttribute(), GFJxEncGetAttribute()
+*/
+#define JX_ENC_MAX_SIZE 18
+
+/** JxEncAPI attribute: Camera focal point.
+
+ Image area which is close to the focal point will be encoded with higher
+ quality. Takes effect only when #JX_ENC_MAX_SIZE is set.
+
+ Interpretation of associated data block:
+
+ NvU32 Focal point X position
+ NvU32 Focal point Y position
+
+
+ Attribute can be set and get.
+ @see GFJxEncSetAttribute(), GFJxEncGetAttribute(), #JX_ENC_DEGRADATION,
+ #JX_ENC_MAX_SIZE
+*/
+#define JX_ENC_FOCAL_POINT 19
+
+/** JxEncAPI attribute: Image quality degradation from focal point.
+
+ Image areas further from the focal point get encoded with fewer bits.
+ The number of bits is linearly degraded based on the percentage of
+ degradation in the X and Y directions. This attribute takes effect only
+ when JX_ENC_MAX_SIZE is set.
+
+ Interpretation of associated data block:
+
+ NvU32 X direction degradation percentage
+ NvU32 Y direction degradation percentage
+
+
+ Attribute can be set and get.
+ @see GFJxEncSetAttribute(), GFJxEncGetAttribute(), #JX_ENC_FOCAL_POINT,
+ #JX_ENC_MAX_SIZE
+*/
+#define JX_ENC_DEGRADATION 20
+
+/** JxEncAPI attribute: JPEG encode rotation and flip control.
+
+ Interpretation of associated data block:
+
+ NvU32 Rotation and flip control, one of the following constants
+ #JX_ENC_ROTATE_0
+ #JX_ENC_ROTATE_90
+ #JX_ENC_ROTATE_180
+ #JX_ENC_ROTATE_270
+ optionally logically ORed with zero or more of the following flags
+ #JX_ENC_H_FLIP
+ #JX_ENC_V_FLIP
+
+
+ Default is #JX_ENC_ROTATE_0.
+
+ Attribute can be set and get.
+ @see GFJxEncSetAttribute(), GFJxEncGetAttribute()
+*/
+#define JX_ENC_ROTATION 21
+
+/** JxEncAPI attribute: Rotation and flip control for rartial rotation API.
+
+ Enables and configures the partial rotation engine for partially rotated
+ JPEG encoding. Partially rotated JPEG encoding allows for rotated encoding
+ of large image sizes with a small image capture buffer.
+
+ Interpretation of associated data block:
+
+ NvU32 Rotation and flip control, one of the following constants
+ #JX_PRENC_ROTATE_UNSET - reset and disable partial rotation engine
+ #JX_ENC_ROTATE_0
+ #JX_ENC_ROTATE_90
+ #JX_ENC_ROTATE_180
+ #JX_ENC_ROTATE_270
+ if not #JX_PRENC_ROTATE_UNSET optionally logically ORed with zero or
+ more of the following flags
+ #JX_ENC_H_FLIP
+ #JX_ENC_V_FLIP
+
+
+ Attribute can be set and get.
+ @see GFJxEncSetAttribute(), GFJxEncGetAttribute()
+*/
+#define JX_ENC_PARTIAL_ROTATE 22
+
+/** JxEncAPI attribute: Bypass FIFO.
+
+ Interpretation of associated data block:
+
+ NvU32 Raw data capturing mode enable
+ 0 = Fetching encoded data through DMA FIFO
+ 1 = Fetching encoded data directly through output buffer not through
+ DMA FIFO
+
+
+ Attribute can be set and get.
+ @see GFJxEncSetAttribute(), GFJxEncGetAttribute()
+*/
+#define JX_ENC_BYPASS_FIFO 23
+
+/** JxEncAPI attribute: Piece-Meal encoding.
+
+ Interpretation of associated data block:
+
+ NvU32 Piece-Meal encoding enable
+ 0 = enable
+ 1 = disable
+
+
+ Attribute is get only.
+ @see GFJxEncSetAttribute(), GFJxEncGetAttribute()
+*/
+#define JX_ENC_PIECE_MEAL 24
+
+/** JxEncAPI attribute: Fetch Low bitstream.
+
+ Registration of callback function for fetching raw data stream from JPEG encoder:
+
+ #PGFJXDECCALLBACK structure
+
+
+ Attribute is set only.
+ @see GFJxEncSetAttribute(), GFJxEncGetAttribute()
+*/
+
+#define JX_ENC_RAW_DATA_STREAM 25
+
+/** JxEncAPI attribute: Fetch Low JPEG bitstream.
+
+ Registration of callback function for fetching JPEG raw data stream from JPEG encoder:
+
+ #PGFJXDECCALLBACK structure
+
+
+ Attribute is set only.
+ @see GFJxEncSetAttribute(), GFJxEncGetAttribute()
+*/
+
+#define JX_ENC_RAW_JPEG_CAPTURE 26
+
+/** JxEncAPI attribute: Set Timeout value
+
+
+ Interpretation of associated data block:
+
+ NvU32 timeout timeout value
+ 0 = no timeout
+ > 0 = timeout value
+
+
+ Attribute is set only.
+ @see GFJxEncSetAttribute(), GFJxEncGetAttribute()
+*/
+
+#define JX_ENC_TIMEOUT_CONF 27
+
+/** JxEncAPI attribute: Stop preview enable/disable.
+
+ Interpretation of associated data block:
+
+ NvU32 Stop preview mode enable
+ 0 = disable
+ 1 = enable
+
+
+ Attribute can be set and get.
+ @see GFJxEncSetAttribute(), GFJxEncGetAttribute()
+*/
+
+#define JX_ENC_STOP_PREVIEW 28
+
+
+/** Option for attributes #JX_ENC_ROTATION, #JX_ENC_PARTIAL_ROTATE:
+ Non-rotated JPEG encode.
+ @see #JX_ENC_ROTATION, #JX_ENC_PARTIAL_ROTATE, GFJxEncSetAttribute(),
+ GFJxEncGetAttribute()
+*/
+
+#define JX_ENC_ROTATE_0 0x0
+
+/** Option for attributes #JX_ENC_ROTATION, #JX_ENC_PARTIAL_ROTATE:
+ JPEG encode rotated 90 degrees.
+ @see #JX_ENC_ROTATION, #JX_ENC_PARTIAL_ROTATE, GFJxEncSetAttribute(),
+ GFJxEncGetAttribute()
+*/
+#define JX_ENC_ROTATE_90 0x1
+
+/** Option for attributes #JX_ENC_ROTATION, #JX_ENC_PARTIAL_ROTATE:
+ JPEG encode rotated 180 degrees.
+ @see #JX_ENC_ROTATION, #JX_ENC_PARTIAL_ROTATE, GFJxEncSetAttribute(),
+ GFJxEncGetAttribute()
+*/
+#define JX_ENC_ROTATE_180 0x2
+
+/** Option for attributes #JX_ENC_ROTATION, #JX_ENC_PARTIAL_ROTATE:
+ JPEG encode rotated 270 degrees.
+ @see #JX_ENC_ROTATION, #JX_ENC_PARTIAL_ROTATE, GFJxEncSetAttribute(),
+ GFJxEncGetAttribute()
+*/
+#define JX_ENC_ROTATE_270 0x3
+
+/** Option for attributes #JX_ENC_ROTATION, #JX_ENC_PARTIAL_ROTATE:
+ JPEG encode horizontally flipped.
+ @see #JX_ENC_ROTATION, #JX_ENC_PARTIAL_ROTATE, GFJxEncSetAttribute(),
+ GFJxEncGetAttribute()
+*/
+#define JX_ENC_H_FLIP 0x10
+
+/** Option for attributes #JX_ENC_ROTATION, #JX_ENC_PARTIAL_ROTATE:
+ JPEG encode vertically flipped.
+ @see #JX_ENC_ROTATION, #JX_ENC_PARTIAL_ROTATE, GFJxEncSetAttribute(),
+ GFJxEncGetAttribute()
+*/
+#define JX_ENC_V_FLIP 0x20
+
+/** Option for attribute #JX_ENC_PARTIAL_ROTATE: Reset and disable partial
+ rotation.
+ Pass this to GFJxEncSetAttribute() for attribute #JX_ENC_PARTIAL_ROTATE
+ to unset the Partial Rotation Flag and reset the PR Engine.
+ @see #JX_ENC_PARTIAL_ROTATE, GFJxEncSetAttribute(), GFJxEncGetAttribute()
+*/
+#define JX_ENC_ROTATE_UNSET 0xff
+
+typedef void (*GFJX_ENC_CALLBACK)(void *userData);
+
+/** JxEncAPI interrupt operation types.
+ Constants to specify operation for a call to GFJxEncInterruptControl().
+ @see GFJX_ENC_INTERRUPT_TYPE, GFJxEncInterruptControl()
+*/
+typedef enum
+{
+ /** Enable interrupt/status assertion for an interrupt type. */
+ GFJX_ENC_INTERRUPT_ENABLE,
+
+ /** Disable interrupt/status assertion for an interrupt type. */
+ GFJX_ENC_INTERRUPT_DISABLE,
+
+ /** Clear interrupt/status assertion for an interrupt type. */
+ GFJX_ENC_INTERRUPT_CLEAR,
+
+ /** Query for interrupt/status assertion for an interrupt type. */
+ GFJX_ENC_INTERRUPT_QUERY_STATUS,
+
+ /** Set DMA FIFO threshold. */
+ GFJX_ENC_INTERRUPT_SET_DMA_FIFO_THRESHOLD,
+
+ /** Get DMA FIFO threshold. */
+ GFJX_ENC_INTERRUPT_GET_DMA_FIFO_THRESHOLD,
+
+ /** Set strean buffer threshold. */
+ GFJX_ENC_INTERRUPT_SET_BUF_THRESHOLD,
+
+ /** Get strean buffer threshold. */
+ GFJX_ENC_INTERRUPT_GET_BUF_THRESHOLD
+
+} GFJX_ENC_INTERRUPT_OPERATION_TYPE;
+
+
+/** JxEncAPI interrupt types.
+ @see GFJX_ENC_INTERRUPT_OPERATION_TYPE, GFJxEncInterruptControl()
+*/
+typedef enum
+{
+ /** JPEG read DMA FIFO low threshold.
+ Interrupt/status is asserted if the JPEG read DMA FIFO status is less
+ than the JPEG read DMA FIFO threshold value.
+ */
+ GFJX_ENC_DMA_FIFO_LOW_INTR = 0,
+
+ /** JPEG read DMA FIFO high threshold.
+ Interrupt/status is asserted if the JPEG read DMA FIFO status is
+ greater than or equal to the JPEG read DMA FIFO threshold value.
+ */
+ GFJX_ENC_DMA_FIFO_HIGH_INTR = 0x1,
+
+ /** Stream buffer threshold interrupt. */
+ GFJX_ENC_STREAM_BUF_INTR = 0x2,
+
+ /** Main buffer end hit interrupt. */
+ GFJX_ENC_MAIN_BUF_HIT_INTR = 0x4,
+
+ /** Encoding done interrupt. */
+ GFJX_ENC_DONE_INTR = 0x8,
+
+ /** Encoded stream transfer done interrupt. */
+ GFJX_ENC_TRANSFER_DONE_INTR = 0x10,
+
+ /** Maximum bit count hit interrupt. */
+ GFJX_ENC_MAX_BIT_HIT_INTR = 0x20,
+
+ /** Circular buffer overflow interrupt. */
+ GFJX_ENC_CIR_BUF_OVERFLOW_INTR = 0x40
+
+} GFJX_ENC_INTERRUPT_TYPE;
+
+/** JxEncAPI virtual function pointer table. */
+typedef struct _GFJXENCTABLE
+{
+ GF_RETTYPE (* JxEncGetProperty)(GFJxEncHandle hJxEnc, PGFPROPERTY pJXProp);
+ GF_RETTYPE (* JxEncSetAttribute)(GFJxEncHandle hJxEnc,
+ NvU32 uiFeature, NvU32* pInfo);
+ GF_RETTYPE (* JxEncGetAttribute)(GFJxEncHandle hJxEnc,
+ NvU32 uiFeature, NvU32* pInfo);
+ GF_RETTYPE (* JxEncStart)(GFJxEncHandle hJxEnc, PGFJXENCSTART pStart);
+ GF_RETTYPE (* JxEncFetchImage)(GFJxEncHandle hJxEnc,
+ PGFJXENC_BUF aBuf, NvU32 nBuf, NvU32 *pStatus);
+ GF_RETTYPE (* JxEncEnd)(GFJxEncHandle hJxEnc);
+ GF_RETTYPE (* JxEncSetupInterrupt)(GFJxEncHandle hJxEnc,
+ void (*Inter)(void *), void *IPara);
+ GF_RETTYPE (* JxEncCapture)(GFJxEncHandle hJxEnc,
+ PGFJXENC_BUF aBuf, NvU32 nBuf, NvU32 *pStatus);
+ GF_RETTYPE (* JxEncInterruptControl)(GFJxEncHandle hJxEnc,
+ GFJX_ENC_INTERRUPT_TYPE IntType, GFJX_ENC_INTERRUPT_OPERATION_TYPE op,
+ void * pData);
+ GF_RETTYPE (* JxEncInterruptHandler)(GFJxEncHandle hJxEnc,
+ GFJX_ENC_INTERRUPT_TYPE IntType, void * pData); // Reserved.
+ GF_RETTYPE (*JxEncPRComplete)(GFJxEncHandle hJxEnc,
+ PGFJXENC_BUF inBuf,NvU32 inBufNum,PGFJXENC_BUF outBuf,
+ NvU32 outBufNum,PGFJXENC_BUF dcacBuf,NvU32 dcacBufNum);
+ GF_RETTYPE (*JxEncBracket)(GFJxEncHandle hJxEnc,
+ GFJX_ENC_CALLBACK before,
+ GFJX_ENC_CALLBACK after,
+ void *userData);
+} GFJXENCTABLE, *PGFJXENCTABLE;
+
+#ifdef PROJECT_SEC_G1
+// Attribute constant and data structure for EXIF
+#define JX_ENC_SET_EXIF_INFO 30
+
+typedef struct _GFJXENCEXIFINFO
+{
+ NvS8 CameraMaker[32];
+ NvS8 CameraModel[40];
+ NvS8 FirmwareVersion[5];
+ NvU32 FNumberNum;
+ NvU32 FNumberDenom;
+ NvS32 ExpBiasNum;
+ NvS32 ExpBiasDenom;
+ NvU16 WhiteBalance;
+ NvU32 DigitalZoomNum;
+ NvU32 DigitalZoomDenom;
+} GFJXENCEXIFINFO;
+#endif
+
+// Typesafe functions for opening and closing this component
+GF_RETTYPE GFJxEncOpen(GFRmHandle hRm, GFJxEncHandle *phJxEnc,
+ GF_STATE_TYPE state, GFRmChHandle hCh);
+void GFJxEncClose(GFJxEncHandle *phJxEnc);
+
+/* #### JxEnc Helper macros. Maybe useful for backward compatible API. #### */
+
+/** @name Functions
+@{*/
+
+/** This function returns version and capabilities of API and hardware.
+
+ @param hJxEnc (#GFJxEncHandle) Handle to JxEncAPI
+ @param pJXProp (PGFPROPERTY) Pointer to property structure to be filled in
+
+ @retval #GF_SUCCESS \a pJXProp filled in successfully
+ @retval #GF_ERROR Some error occured
+
+ The #GFPROPERTY structure passed with parameter \a pJXProp will be
+ filled in on successfull return. The GFPROPERTY::Capability field
+ will hold a combination of flagbits indicating capabilities specific
+ to the JxEncAPI:
+
+
+ #GF_JX_ENC_CAP_QTABLE
+ JPEG quantization table is programmable.
+ #GF_JX_ENC_CAP_INTERRUPT
+ Interrupt data capture mode and polling mode supported,
+ if this flag is off then only polling mode is supported.
+ #GF_JX_ENC_CAP_DIGITAL_ZOOM
+ Digital zoom supported.
+ #GF_JX_ENC_CAP_MOTION_JPEG
+ Motion JPEG mode supported.
+ #GF_JX_ENC_CAP_RATE_CONTROL
+ Rate control supported.
+ #GF_JX_ENC_CAP_422_PLANAR
+ Planar YUV422 data supported.
+ #GF_JX_ENC_CAP_ROTATION
+ Rotation supported.
+
+
+ It is a good practice to call this function to query for the API version
+ and its capabilities before using the rest of the JxEncAPI functions.
+
+ @see GFPROPERTY
+*/
+#define GFJxEncGetProperty(hJxEnc, pJXProp) \
+ ((PGFJXENCTABLE)hJxEnc)->JxEncGetProperty(hJxEnc, pJXProp)
+
+/** Set configuration of a feature of the JPEG encoder hardware.
+
+ @param hJxEnc (#GFJxEncHandle) Handle to JxEncAPI
+ @param uiFeature (NvU32) Feature type identifier, see table.
+ @param pInfo (NvU32*) Pointer to feature specific input parameter block.
+ Pointer type will be reinterpreted according to
+ feature type.
+
+ @retval #GF_SUCCESS Configuration changed successfully
+ @retval #GF_ERROR Some error occured
+
+ The feature to be set is identified with parameter \a uiFeature,
+ specific input parameters are passed via a block in parameter \a pInfo.
+ The contents of this data block is interpreted depending on the
+ feature to be set.
+
+ The following features are defined, for the data to be provided in
+ \a pInfo see the individual attribute's documentation.
+
+
+ \b Attribute \b Direction \b Synopsis
+ #JX_ENC_SET_100QUALITY set
+ Choose preset QTable, coefficients in luma
+ and chroma Qtable are all 1.
+ #JX_ENC_SET_85QUALITY set
+ Choose preset QTable, standard Qtable A and B,
+ divided by 2.
+ #JX_ENC_SET_75QUALITY set
+ Choose preset QTable, standard Qtable A and B.
+ #JX_ENC_SET_50QUALITY set
+ Choose preset QTable, standard Qtable C and D.
+ #JX_ENC_SET_25QUALITY set
+ Choose preset QTable, standard Qtable C and D,
+ multiplied by 2.
+ #JX_ENC_SET_12QUALITY set
+ Choose preset QTable, standard Qtable C and D,
+ multiplied by 4.
+ #JX_ENC_LQTABLE set, get
+ Set custom luma QTable.
+ #JX_ENC_CQTABLE set, get
+ Set custom chroma QTable.
+ #JX_ENC_FILTER set, get
+ Decimation filter enable/disable.
+ #JX_ENC_HUFF_BSTUFF set, get
+ Huffman bit stuffing.
+ #JX_ENC_MOTION_JPEG set, get
+ Motion JPEG capturing mode enable/disable.
+ #JX_ENC_RAW_DATA set, get
+ Raw data capturing mode enable/disable.
+ #JX_ENC_BITSTREAM set
+ Re-encode a JPEG bitstream.
+ #JX_ENC_ENCODE_FORMAT set, get
+ JPEG encoding colour format.
+ #JX_ENC_MAX_SIZE set, get
+ Maximum JPEG byte size.
+ #JX_ENC_FOCAL_POINT set, get
+ Camera focal point.
+ #JX_ENC_DEGRADATION set, get
+ Image quality degradation from focal point.
+ #JX_ENC_ROTATION set, get
+ JPEG encode rotation and flip control.
+ #JX_ENC_PARTIAL_ROTATE set, get
+ Rotation and flip control for Partial Rotation API.
+ #JX_ENC_BYPASS_FIFO set, get
+ Bypass FIFO.
+ #JX_ENC_PIECE_MEAL get
+ Piece-Meal encoding.
+ #JX_ENC_STOP_PREVIEW set, get
+ Stop preview mode enable/disable.
+ #JX_ENC_RAW_JPEG_CAPTURE set
+ Fetch Low JPEG bitstream.
+ #JX_ENC_RAW_DATA_STREAM set
+ Fetch Low bitstream.
+ #JX_ENC_TIMEOUT_CONF set, get
+ Set Timeout value.
+
+
+ Most of the time an application should only set a quantization table for
+ luminance or chrominance. These quantization tables are in the same format
+ as standard quantization tables (1 to 255). Other features are hardware
+ dependent.
+
+ @see GFJxEncGetAttribute()
+*/
+#define GFJxEncSetAttribute(hJxEnc, uiFeature, pInfo) \
+ ((PGFJXENCTABLE)hJxEnc)->JxEncSetAttribute(hJxEnc, uiFeature, pInfo)
+
+/** Get current configuration of a feature of the JPEG encoder hardware.
+
+ @param hJxEnc (#GFJxEncHandle) Handle to JxEncAPI
+ @param uiFeature (NvU32) Feature type identifier,
+ see table in GFJxEncSetAttribute().
+ @param pInfo (NvU32*) Pointer to feature specific input parameter block.
+ Pointer type will be reinterpreted according to
+ feature type.
+
+ @retval #GF_SUCCESS \a pInfo filled in successfully
+ @retval #GF_ERROR Some error occured
+
+ @see GFJxEncSetAttribute()
+*/
+#define GFJxEncGetAttribute(hJxEnc, uiFeature, pInfo) \
+ ((PGFJXENCTABLE)hJxEnc)->JxEncGetAttribute(hJxEnc, uiFeature, pInfo)
+
+/** Setup JxEncAPI for JPEG encoding.
+
+ @param hJxEnc (#GFJxEncHandle) Handle to JxEncAPI
+ @param pStart (#PGFJXENCSTART) Pointer to #GFJXENCSTART structure for
+ definition of encode source and destination
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured, check GFJXENCSTART::Error for
+ detailed error reason code.
+
+ Before starting capture, the application should call this function to setup
+ the encoder. Once this function has been called, the application can use
+ GFJxEncCapture() to capture as many frames as desired. JxEncCapture()
+ starts and optionally fetches data for a frame. JxEncFetchImageData()
+ fetches the image data to host CPU side. An application should keep calling
+ it until all encoded data is processed. Finally GFJxEncEnd() has to be
+ called to release the encoder.
+
+ Parameter \a pStart passes a #GFJXENCSTART structure describing image data
+ source, source cropping area, and destination size.
+
+ Encoding is from one of the following sources:
+ - VI (Camera, cropping and scale up/down is done via VxVIPSet(),
+ Rotation/flip is done via JxEncSelectEPPRotation() )
+ - Screen encoding (GC, source is primary surface)
+ - Bitstream encoding. This is used to re-encode a JPEG bit stream, and
+ invokes JxDecAPI internally to decode the existing bitstream.
+ The following options are available for bitstream re-encoding:
+ - Crop image size
+ - Scale up
+ - Change QTables
+ - Apply rate control
+ - Rotation (0, 90, 180, 270, H-Flip, V-Flip)
+
+ On failure an error reason code is returned in field GFJXENCSTART::Error of
+ parameter \a pStart.
+
+ @see GFJXENCSTART, GFJxEncSetAttribute(), GFJxEncCapture(),
+ GFJxEncFetchImage(), GFJxEncEnd()
+*/
+#define GFJxEncStart(hJxEnc, pStart) \
+ ((PGFJXENCTABLE)hJxEnc)->JxEncStart(hJxEnc, pStart)
+
+/** Polls JxEncAPI for data fetch from JPEG encoder.
+
+ @param hJxEnc (#GFJxEncHandle) Handle to JxEncAPI
+ @param aBuf (#PGFJXENC_BUF) Pointer to array of #GFJXENC_BUF structures
+ @param nBuf (NvU32) Number of pointers passed with \a aBuf.
+ @param pStatus (NvU32) Returns data fetch status, see table
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ Captures the JPEG encoded bit stream in the given application owned
+ buffers. Capturing the encoded image can be done in polling or interrupt
+ mode. This function should be called after GFJxEncCapture(). It is usually
+ called from either the application's fetching poll loop, or the interrupt
+ callback routine set up with GFJxEncSetupInterrupt().
+
+ The application must fill all the fields in the referenced buffer
+ structures and must make sure each PGFJXENC_BUF::nBytesCaptured is set
+ to 0. The PGFJXENC_BUF::nBytesCaptured field is updated by the JXEncAPI
+ to show the actual number of bytes captured. JXEncAPI keeps filling the
+ buffers in the array until it exhausts all the buffers. If all the buffers
+ are exhausted and there is more data to be copied, the function returns
+ and sets \a pStatus to #JXENC_MORE_FETCH. The application should then keep
+ calling GFJxEncFetchImage() to fetch the remaining data. Each buffer in
+ the array should be a multiple of 64 bytes for best performance.
+
+ The status of the data fetch is returned in \a pStatus as one of the
+ following reason codes:
+
+
+ #JXENC_DATA_COMPLETE All data of the current frame was
+ fetched.
+ #JXENC_MORE_FETCH Data was fetched only partially.
+ The application should make more calls to GFJxEncFetchImage() to
+ fetch the rest.
+ #JXENC_NEW_FRAME A new frame was encoded and is ready
+ to fetch.
+ #JXENC_TIME_OUT Timeout on GFJxEncFetchImage
+
+
+
+ @see GFJxEncCapture(), GFJxEncSetupInterrupt(), #GFJXENC_BUF
+*/
+#define GFJxEncFetchImage(hJxEnc, aBuf, nBuf, pStatus) \
+ ((PGFJXENCTABLE)hJxEnc)->JxEncFetchImage(hJxEnc, aBuf, nBuf, pStatus)
+
+/** Polls JxEncAPI for data fetch from JPEG encoder.
+
+ @param hJxEnc (#GFJxEncHandle) Handle to JxEncAPI
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ This function disables the encoder and releases internal resources related
+ to the current capture.
+
+ @see GFJxEncStart()
+*/
+#define GFJxEncEnd(hJxEnc) \
+ ((PGFJXENCTABLE)hJxEnc)->JxEncEnd(hJxEnc)
+
+/** Register a callback function for fetching encoded JPEG data.
+
+ @param hJxEnc (#GFJxEncHandle) Handle to JxEncAPI
+ @param Inter (void(*)(void *)) Application callback function pointer
+ @param IPara (void*) Parameter to pass on to application callback function
+
+ @retval #GF_SUCCESS Callback installed successfully
+ @retval #GF_ERROR Some error occured
+
+ This function can be used to register a callback function for fetching
+ encoded JPEG data. This function must be called before GFJxEncCapture().
+ The callback function must meet the following prototype:
+
+
+ void InterruptCallback(void* lPara);
+
+
+ Whenever encoding is triggered, JXEncAPI calls the registered interrupt
+ callback function, passing on the application defined parameter \a IPara.
+
+ Inside the callback function, the application can call GFJxEncFetchImage()
+ to portionally fetch the encoded datastream.
+
+ If no callback function shall be used, the application could alternatively
+ use a polling scheme.
+
+ @see GFJxEncCapture()
+*/
+#define GFJxEncSetupInterrupt(hJxEnc, Inter, IPara) \
+ ((PGFJXENCTABLE)hJxEnc)->JxEncSetupInterrupt(hJxEnc, Inter, IPara)
+
+/** Trigger JPEG encoder for one frame and optionally display capture preview.
+
+ @param hJxEnc (#GFJxEncHandle) Handle to JxEncAPI
+ @param aBuf (#PGFJXENC_BUF) Pointer to array #GFJXENC_BUF structures
+ @param nBuf (NvU32) Number of pointers passed with \a aBuf, if
+ passing 0 then the function is non-blocking
+ @param pStatus (NvU32) Returns data fetch status, for reason codes
+ see table at GFJxEncFetchImage()
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ Triggers the JPEG encoder for a frame and optionally displays the same
+ frame in a preview window in decimated form.
+
+ Encoded data can be fetched via a polling scheme or via an interrupt
+ handler set up with GFJxEncSetupInterrupt(). In any case
+ GFJxEncFetchImage() is used to transfer encoded data to application
+ buffers.
+
+ If application set up an interrupt handler to fetch encoded data, then
+ \a nBuf should be passed as 0.
+
+ This function can optionally fetch data right after triggering encoding to
+ buffers provided via \a aBuf. This will block the CPU until all data is
+ returned or buffer space is exhausted. If \a nBuf is 0, the function
+ returns right away and \a pStatus is updated to #JXENC_NEW_FRAME to
+ indicate data is pending. The application should then call
+ GFJxEncFetchImage() either from an interrupt handler or from same thread to
+ fetch the encoded/raw data.
+
+ If \a nBuf is not 0, it specifies the number of buffers in the array
+ \a aBuf. The function will block until it runs out of buffers. It
+ will return #JXENC_MORE_FETCH in parameter \a pStatus if more data is
+ available. The application must call GFJxEncFetchImage() to fetch the
+ remaining data. See GFJxEncFetchImage() for information on return
+ status codes and how the passed buffers are handled.
+
+ JPEG Encoding from camera or raw data capture from camera happens in
+ realtime, so if the internal circular buffer in GPU memory is not big
+ enough then GFJxEncFetchImage() should be called more fequently to empty
+ the outputBuf and avoid buffer overflows.
+
+ @see GFJxEncSetupInterrupt(), GFJxEncFetchImage(), #GFJXENC_BUF
+*/
+#define GFJxEncCapture(hJxEnc, aBuf, nBuf, pStatus) \
+ ((PGFJXENCTABLE)hJxEnc)->JxEncCapture(hJxEnc, aBuf, nBuf, pStatus)
+
+/** JxEncAPI Component-level interrupt control.
+
+ @param hJxEnc (#GFJxEncHandle) Handle to JxEncAPI
+ @param IntType (#GFJX_ENC_INTERRUPT_TYPE) JxEncAPI interrupt type
+ @param op (#GFJX_ENC_INTERRUPT_OPERATION_TYPE) GFJxEncAPI interrupt
+ operation
+ @param pData (void*) Pointer to input or output data block, see table
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+ @retval #GF_ERROR_BAD_PARAMETER Invalid parameters
+
+ The following operations (parameter op ) are defined for this call.
+
+ Operation #GFJX_ENC_INTERRUPT_ENABLE
+
+ Enable status/interrupt generation for interrupts of type specified by
+ \a IntType.
+
+ Depending on the interrupt type additional action and the parameter
+ \a pData is interpreted as following:
+
+
+ #GFJX_ENC_DMA_FIFO_LOW_INTR
+ JPEG read DMA FIFO status/interrupt generation is put into low
+ threshold mode, i.e. interrupt/status is asserted if the JPEG
+ read DMA FIFO status is less than the threshold value.
+
+ \a pData points to block containing:
+ NvU32 DMA FIFO low threshold value in range 0..15
+
+ \a pData can be NULL to leave the threshold value unchanged.
+
+
+
+ #GFJX_ENC_DMA_FIFO_HIGH_INTR
+ JPEG read DMA FIFO status/interrupt generation is put into
+ high threshold mode, i.e. interrupt/status is asserted if the
+ JPEG read DMA FIFO status is greater than or equal toless than
+ the threshold value.
+
+ \a pData points to block containing:
+ NvU32 DMA FIFO high threshold value in range 0..15
+
+ \a pData can be NULL to leave the threshold value unchanged.
+
+
+
+ #GFJX_ENC_STREAM_BUF_INTR
+ \a pData points to block containing:
+ NvU32 JPEG stream buffer threshold value in bytes, must
+ be multiple of 8
+
+ \a pData can be NULL to leave the threshold value unchanged.
+
+
+
+ otherwise
+ \a pData is ignored
+
+
+
+ Operation #GFJX_ENC_INTERRUPT_DISABLE
+
+ Disable status/interrupt generation for interrupts of type specified by
+ \a IntType.
+
+ Operation #GFJX_ENC_INTERRUPT_CLEAR
+
+ Clear status/interrupt assertion for interrupt of type specified by
+ \a IntType.
+
+ Operation #GFJX_ENC_INTERRUPT_QUERY_STATUS
+
+ Return current status/interrupt assertion for interrupt of type
+ specified by \a IntType. The state is returned in the block referenced
+ by \a pData.
+
+ Interpretation of associated data block \a pData
+
+ NvU32 Interrupt/status assertion state, one of:
+ GF_INTERRUPT_ON_STATUS_TRUE = asserted
+ GF_INTERRUPT_ON_STATUS_FALSE = not asserted
+
+
+ Operation #GFJX_ENC_INTERRUPT_SET_DMA_FIFO_THRESHOLD
+
+ Set DMA FIFO threshold value that controls interrupt/status assertion
+ for interrupt types #GFJX_ENC_DMA_FIFO_LOW_INTR and
+ #GFJX_ENC_DMA_FIFO_HIGH_INTR.
+
+ Interpretation of associated data block \a pData
+
+ NvU32 DMA FIFO threshold value in range 0..15
+
+
+ Operation #GFJX_ENC_INTERRUPT_GET_DMA_FIFO_THRESHOLD
+
+ Return DMA FIFO threshold value that controls interrupt/status
+ assertion for interrupt types #GFJX_ENC_DMA_FIFO_LOW_INTR and
+ #GFJX_ENC_DMA_FIFO_HIGH_INTR.
+
+ Interpretation of associated data block \a pData
+
+ NvU32 DMA FIFO threshold value in range 0..15
+
+
+ Operation #GFJX_ENC_INTERRUPT_SET_BUF_THRESHOLD
+
+ Set JPEG stream buffer threshold value that controls interrupt/status
+ assertion for interrupt type #GFJX_ENC_STREAM_BUF_INTR.
+
+ Interpretation of associated data block \a pData
+
+ NvU32 DMA read buffer threshold value in bytes, must be multiple of 8
+
+
+ Operation #GFJX_ENC_INTERRUPT_GET_BUF_THRESHOLD
+
+ Return JPEG stream buffer threshold value that controls
+ interrupt/status assertion for interrupt type
+ #GFJX_ENC_STREAM_BUF_INTR.
+
+ Interpretation of associated data block \a pData
+
+ NvU32 DMA read buffer threshold value in bytes, must be multiple of 8
+
+
+ @see GFJX_ENC_INTERRUPT_TYPE, GFJX_ENC_INTERRUPT_OPERATION_TYPE
+*/
+#define GFJxEncInterruptControl(hJxEnc, IntType, op, pData)\
+ ((PGFJXENCTABLE)hJxEnc)->JxEncInterruptControl(hJxEnc, IntType, op, pData)
+
+/** Standard interrupt handler for fetching encoded JPEG data.
+
+ @param hJxEnc (#GFJxEncHandle) Handle to JxEncAPI
+ @param IntType (#GFJX_ENC_INTERRUPT_TYPE) JxEncAPI interrupt type
+ @param pData (void*) Pointer to input or output data block,
+ depending on \a IntType. See table.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+
+ \a IntType Interpretation of \a pData
+ #GFJX_ENC_STREAM_BUF_INTR, GFJX_ENC_DONE_INTR
+ #PGFJXENC_FETCH_BUF
+
+
+ Usually this callback is not used, because the interrupt service thread
+ at the application level can call GFJxEncFetchImage() directly to
+ complete the task of fetching encoded data.
+
+ @todo clarify
+ @see GFJxEncFetchImage()
+*/
+#define GFJxEncInterruptHandler(hJxEnc, IntType, pData)\
+ ((PGFJXENCTABLE)hJxEnc)->JxEncInterruptHandler(hJxEnc, IntType, pData)
+
+/** Generate final JPEG bitstream from a partially rotated bitstream.
+
+ @param hJxEnc (#GFJxEncHandle) Handle to JxEncAPI
+ @param inBuf (#PGFJXENC_BUF) Pointer to array of #GFJXENC_BUF structs
+ holding fragmented input bitstream
+ @param inBufNum (NvU32) Size of array \a inBuf
+ @param outBuf (#PGFJXENC_BUF) Pointer to array of #GFJXENC_BUF structs
+ to output fragmented JPEG bitstream
+ @param outBufNum (NvU32) Size of array \a outBuf
+ @param dcacBuf (#PGFJXENC_BUF) ?
+ @param dcacBufNum (NvU32) Size of array \a dcacBuf
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ @todo clarify
+*/
+#define GFJxEncPRComplete(hJxEnc,inBuf,inBufNum,outBuf,outBufNum,dcacBuf,dcacBufNum)\
+ ((PGFJXENCTABLE)hJxEnc)->JxEncPRComplete(hJxEnc,inBuf,inBufNum,outBuf,outBufNum,dcacBuf,dcacBufNum)
+
+/** Provide callbacks for immediately before and after any encode events.
+ These will be called by JxEncode() when it is invoked.
+ Calling this routine a second time will overwrite previously set
+ values.
+
+ @param hJxEnc (#GFJxEncHandle) Handle to JxEncAPI
+ @param before (#GFJX_ENC_CALLBACK) proc to call before capture
+ @param after (#GFJX_ENC_CALLBACK) proc to call after capture
+ @param userData (void *) data to be supplied to before() and
+ after() when they are invoked.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+*/
+#define GFJxEncBracket(hJxEnc, before, after, userData) \
+ ((PGFJXENCTABLE)hJxEnc)->JxEncBracket(hJxEnc, before, after, userData)
+
+/*@}*/
+/*@}*/
+ /** @page pageJxEncAppNotes JxEncAPI Application Notes
+
+ @section pageJxEncAppNotes1 Programming Sequence
+
+ The following procedure requires that GFRmOpen() is called first to start GFSDK usage.
+ The description is for a typical case where encoding of a still image being captured
+ from a camera is done and preview shown on the display.
+
+ 1. In case of camera encoding, setup the camera & initialize VIP.
+
+ 2. Obtain the handle specific to JPEG encoder by calling GFJxEncOpen().
+
+ 3. Call GFRmSurfaceAlloc() to allocate one referance surface for encoding purposes.
+
+ 4. Call GFJxEncSetAttribute() if specific features need to be set,
+ such as encoding width, encoding height, rotation, quality factor, etc.
+
+ 5. Start the encoding by calling GFJxEncStart().
+
+ 6. If the current source image is from the CPU, the application should call GFJxEncFeedImage()
+ to feed the image to the GFJxEncAPI via GFJxEncCapture().
+
+ 7. The application should fetch the encoded stream by calling GFJxEncFetchImage().
+ Application should keep it calling till whole encoded data is out.
+
+ 8. For exiting, free all relevent resources and call GFJxEncEnd() to free the JPEG encoder component.
+
+ */
+#ifdef __cplusplus
+} // only need to export C interface if
+ // used by C++ source code
+#endif
+
+#endif //_GF_JPEG_ENC__
diff --git a/Start_WM/test6/inc/GFMinimalIsp.h b/Start_WM/test6/inc/GFMinimalIsp.h
new file mode 100755
index 00000000..5f5546d3
--- /dev/null
+++ b/Start_WM/test6/inc/GFMinimalIsp.h
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2007 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an express
+ * license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+#ifndef __GFMINIMALISP_H_
+#define __GFMINIMALISP_H_
+
+#include "GF.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+GF_RETTYPE GFMinimalIspOpen(GFRmHandle hRm, GFMinimalIspHandle *phIsp,
+ GF_STATE_TYPE state, GFRmChHandle hCh);
+void GFMinimalIspClose(GFMinimalIspHandle *phIsp);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/Start_WM/test6/inc/GFMmProc.h b/Start_WM/test6/inc/GFMmProc.h
new file mode 100755
index 00000000..1489db73
--- /dev/null
+++ b/Start_WM/test6/inc/GFMmProc.h
@@ -0,0 +1,1766 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/** @file GFMmProc.h
+ GFSDK Multimedia Processor API header file.
+*/
+
+#ifndef __GFMmProc_H__
+#define __GFMmProc_H__
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+/** @addtogroup groupMmProc MmProcAPI Multimedia Processor API
+*/
+/*@{*/
+
+// Typesafe functions for opening and closing this component
+GF_RETTYPE GFMmProcOpen(GFRmHandle hRm, GFMmProcHandle *phMmProc,
+ GF_STATE_TYPE state, GFRmChHandle hCh);
+void GFMmProcClose(GFRmHandle hRm, GFMmProcHandle *phMmProc);
+
+//*****************************************************************************
+//*****************************************************************************
+//
+// Packages
+//
+//*****************************************************************************
+//*****************************************************************************
+
+//
+// These defines are used to import or remove functionality within the audio
+// engine.
+//
+//#define GFMMPROC_BASIC_AUDIO
+
+//
+// Adds audio controls to the package beyond basic playback.
+//
+//#define GFMMPROC_BASIC_AUDIO
+
+//
+// Adds advanced multimedia processing and functionality.
+//
+// NOTE: Currently the advanced feature set requires the basic level of audio
+// support. This requirement may not be present in future revisions.
+//
+//#define GFMMPROC_BASIC_AUDIO
+//#define GFMMPROC_ADVANCED
+
+//
+// Adds 3D audio controls (requires GFMMPROC_ADVANCED).
+//
+//#define GFMMPROC_BASIC_AUDIO
+//#define GFMMPROC_ADVANCED
+//#define GFMMPROC_ADVANCED_3D_AUDIO_CONTROLS
+
+//
+// Adds advanced controls (requires GFMMPROC_ADVANCED).
+//
+//#define GFMMPROC_BASIC_AUDIO
+//#define GFMMPROC_ADVANCED
+//#define GFMMPROC_ADVANCED_CONTROLS
+
+//
+// Adds global effect audio controls (requires GFMMPROC_ADVANCED_CONTROLS).
+//
+//#define GFMMPROC_BASIC_AUDIO
+//#define GFMMPROC_ADVANCED
+//#define GFMMPROC_ADVANCED_CONTROLS
+//#define GFMMPROC_ADVANCED_AUDIO_EFFECT_CONTROLS
+
+
+//*****************************************************************************
+//*****************************************************************************
+//
+// Defines
+//
+//*****************************************************************************
+//*****************************************************************************
+
+#if defined GFMMPROC_BASIC_AUDIO || defined GFMMPROC_ADVANCED
+#define GFMMPROC_TIME_UNITS_PER_SECOND 1000000
+#endif
+
+typedef GF_HANDLE GFMMPROC_OBJECT;
+
+
+//*****************************************************************************
+// Object
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_OBJECT_TABLE
+{
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+} GFMMPROC_OBJECT_TABLE;
+
+#define GFMMPROC_OBJECT_DEFAULT_STR "Object"
+#define GFMMPROC_OBJECT_MANAGER_STR "Manager"
+#define GFMMPROC_OBJECT_GLOBAL_MANAGER_STR "GlobalManager"
+#define GFMMPROC_OBJECT_PLAYER_STR "Player"
+#define GFMMPROC_OBJECT_SOUND_SOURCE_3D_STR "SoundSource3D"
+#define GFMMPROC_OBJECT_SPECTATOR_STR "Spectator"
+#define GFMMPROC_OBJECT_MODULE_STR "Module"
+#define GFMMPROC_OBJECT_MEDIA_PROCESSOR_STR "MediaProcessor"
+#define GFMMPROC_OBJECT_CODEC_STR "Codec"
+
+#define GFMMPROC_CONTROL_DEFAULT_STR "Control"
+#define GFMMPROC_CONTROL_MIDI_STR "MIDI"
+#define GFMMPROC_CONTROL_PITCH_STR "Pitch"
+#define GFMMPROC_CONTROL_RATE_STR "Rate"
+#define GFMMPROC_CONTROL_RECORD_STR "Record"
+#define GFMMPROC_CONTROL_STOP_TIME_STR "StopTime"
+#define GFMMPROC_CONTROL_TEMPO_STR "Tempo"
+#define GFMMPROC_CONTROL_TONE_STR "Tone"
+#define GFMMPROC_CONTROL_VOLUME_STR "Volume"
+
+#define GFMMPROC_CONTROL_AUDIO_FORMAT_STR "AudioFormat"
+#define GFMMPROC_CONTROL_EFFECT_STR "Effect"
+#define GFMMPROC_CONTROL_EFFECT_ORDER_STR "EffectOrder"
+#define GFMMPROC_CONTROL_FORMAT_STR "Format"
+#define GFMMPROC_CONTROL_MIDI_CHANNEL_STR "MIDIChannel"
+#define GFMMPROC_CONTROL_PAN_STR "Pan"
+#define GFMMPROC_CONTROL_PRIORITY_STR "Priority"
+
+#define GFMMPROC_CONTROL_COMMIT_STR "Commit"
+#define GFMMPROC_CONTROL_ORIENTATION_STR "Orientation"
+#define GFMMPROC_CONTROL_DIRECTIVITY_STR "Directivity"
+#define GFMMPROC_CONTROL_DISTANCE_ATTENUATION_STR "DistanceAttenuation"
+#define GFMMPROC_CONTROL_DOPPLER_STR "Doppler"
+#define GFMMPROC_CONTROL_LOCATION_STR "Location"
+#define GFMMPROC_CONTROL_MACROSCOPIC_STR "Macroscopic"
+#define GFMMPROC_CONTROL_OBSTRUCTION_STR "Obstruction"
+#define GFMMPROC_CONTROL_3DCOEFFICIENTS_STR "3DCoefficients"
+
+#define GFMMPROC_CONTROL_EFFECT_AUDIO_VIRTUALIZER_STR "AudioVirtualizer"
+#define GFMMPROC_CONTROL_EFFECT_ACOUSTIC_ECHO_CANCELLATION_STR "AcousticEchoCancellation"
+#define GFMMPROC_CONTROL_EFFECT_SBC_STR "SBC"
+#define GFMMPROC_CONTROL_EFFECT_SBR_STR "SBR"
+#define GFMMPROC_CONTROL_EFFECT_DRC_STR "DRC"
+#define GFMMPROC_CONTROL_EFFECT_CHORUS_STR "Chorus"
+#define GFMMPROC_CONTROL_EFFECT_EQUALIZER_STR "Equalizer"
+#define GFMMPROC_CONTROL_EFFECT_REVERB_STR "Reverb"
+#define GFMMPROC_CONTROL_REVERB_SOURCE_STR "ReverbSource"
+
+
+#define GFMmProcObjectIsInstance(handle, objectType) \
+ ((GFMMPROC_OBJECT_TABLE*)handle)->MmProcObjectIsInstance(handle, objectType)
+
+GF_HANDLE GFMmProcObjectAlloc(GFMmProcHandle component, const char* objectType);
+void GFMmProcObjectFree(GF_HANDLE handle);
+
+#if defined GFMMPROC_BASIC_AUDIO || defined GFMMPROC_ADVANCED
+
+typedef GF_HANDLE GFMMPROC_STREAM;
+
+//*****************************************************************************
+// Stream
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_STREAM_TABLE
+{
+ void (*MmProcStreamClose)(GFMMPROC_STREAM handle);
+ NvS32 (*MmProcStreamGetBuffer)(GFMMPROC_STREAM handle, NvU32 tag, void** descriptor, void** buffer);
+ void (*MmProcStreamReleaseBuffer)(GFMMPROC_STREAM handle, NvU32 tag, NvU32 status, NvU32 size);
+ void (*MmProcStreamReset)(GFMMPROC_STREAM handle);
+
+} GFMMPROC_STREAM_TABLE;
+
+#define GFMMPROC_STREAM_END_OF_MEDIA 0x00000001
+
+#define GFMmProcStreamClose(handle) \
+ ((GFMMPROC_STREAM_TABLE*)handle)->MmProcStreamClose(handle)
+#define GFMmProcStreamGetBuffer(handle, tag, descriptor, buffer) \
+ ((GFMMPROC_STREAM_TABLE*)handle)->MmProcStreamGetBuffer(handle, tag, descriptor, buffer)
+#define GFMmProcStreamReleaseBuffer(handle, tag, status, size) \
+ ((GFMMPROC_STREAM_TABLE*)handle)->MmProcStreamReleaseBuffer(handle, tag, status, size)
+#define GFMmProcStreamReset(handle) \
+ ((GFMMPROC_STREAM_TABLE*)handle)->MmProcStreamReset(handle)
+
+#endif // #if defined GFMMPROC_BASIC_AUDIO || defined GFMMPROC_ADVANCED
+
+
+
+//*****************************************************************************
+//*****************************************************************************
+//
+//
+// GFMMPROC_BASIC_AUDIO
+//
+//
+//*****************************************************************************
+//*****************************************************************************
+
+#if defined GFMMPROC_BASIC_AUDIO
+
+typedef GFMMPROC_OBJECT GFMMPROC_CONTROL;
+typedef GF_HANDLE GFMMPROC_CONTROLLABLE;
+typedef GFMMPROC_OBJECT GFMMPROC_MANAGER;
+typedef GFMMPROC_CONTROLLABLE GFMMPROC_PLAYER;
+typedef GF_HANDLE GFMMPROC_PLAYER_LISTENER;
+typedef GF_HANDLE GFMMPROC_TIME_BASE;
+typedef enum {
+ GFMMPROC_CODEC_TYPE_UNSPECIFIED = 0,
+ GFMMPROC_CODEC_TYPE_I2S,
+ GFMMPROC_CODEC_TYPE_AC97
+} GFMMPROC_CODEC_TYPE;
+
+//*****************************************************************************
+// Control
+//*****************************************************************************
+//
+typedef GFMMPROC_OBJECT_TABLE GFMMPROC_CONTROL_TABLE;
+
+
+//*****************************************************************************
+// Controllable
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_CONTROLLABLE_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+ GFMMPROC_CONTROL (*MmProcControllableGetControl)(GFMMPROC_CONTROLLABLE handle, char* controlType);
+ GFMMPROC_CONTROL* (*MmProcControllableGetControls)(GFMMPROC_CONTROLLABLE handle);
+
+} GFMMPROC_CONTROLLABLE_TABLE;
+
+#define GFMmProcControllableGetControl(handle, controlType) \
+ ((GFMMPROC_CONTROLLABLE_TABLE*)handle)->MmProcControllableGetControl(handle, controlType)
+#define GFMmProcControllableGetControls(handle) \
+ ((GFMMPROC_CONTROLLABLE_TABLE*)handle)->MmProcControllableGetControls(handle)
+
+
+//*****************************************************************************
+// Manager
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_MANAGER_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+ GFMMPROC_PLAYER (*MmProcManagerCreatePlayer)(GFMMPROC_MANAGER handle, char* locator);
+// GFMMPROC_PLAYER (*MmProcManagerCreatePlayerForDataSource)(GFMMPROC_MANAGER handle, DataSource source);
+ GFMMPROC_PLAYER (*MmProcManagerCreatePlayerForStream)(GFMMPROC_MANAGER handle, GFMMPROC_STREAM stream, char* contentType);
+ char* (*MmProcManagerGetSupportedContentTypes)(GFMMPROC_MANAGER handle, char* protocol);
+ char* (*MmProcManagerGetSupportedProtocols)(GFMMPROC_MANAGER handle, char* contentType);
+ GFMMPROC_TIME_BASE (*MmProcManagerGetSystemTimeBase)(GFMMPROC_MANAGER handle);
+ void (*MmProcManagerPlayTone)(GFMMPROC_MANAGER handle, NvU32 note, NvU32 duration, NvU32 volume);
+ void (*MmProcManagerProcess)(GFMMPROC_MANAGER handle);
+ GFMMPROC_CODEC_TYPE (*MmProcManagerGetCodecType)(GFMMPROC_MANAGER handle);
+ void (*MmProcManagerCodecWrite)(GFMMPROC_MANAGER handle, NvU32 offset, NvU32 value);
+ NvU32 (*MmProcManagerCodecRead)(GFMMPROC_MANAGER handle, NvU32 offset);
+
+} GFMMPROC_MANAGER_TABLE;
+
+#define GFMMPROC_MANAGER_MIDI_DEVICE_LOCATOR "device://midi"
+#define GFMMPROC_MANAGER_TONE_DEVICE_LOCATOR "device://tone"
+
+#define GFMmProcManagerCreatePlayer(handle, locator) \
+ ((GFMMPROC_MANAGER_TABLE*)handle)->MmProcManagerCreatePlayer(handle, locator)
+//#define GFMmProcManagerCreatePlayerForDataSource(handle, source) Add multiline delineator here
+// ((GFMMPROC_MANAGER_TABLE*)handle)->MmProcManagerCreatePlayerForDataSource(handle, source)
+#define GFMmProcManagerCreatePlayerForStream(handle, stream, contentType) \
+ ((GFMMPROC_MANAGER_TABLE*)handle)->MmProcManagerCreatePlayerForStream(handle, stream, contentType)
+#define GFMmProcManagerGetSupportedContentTypes(handle, protocol) \
+ ((GFMMPROC_MANAGER_TABLE*)handle)->MmProcManagerGetSupportedContentTypes(handle, protocol)
+#define GFMmProcManagerGetSupportedProtocols(handle, contentType) \
+ ((GFMMPROC_MANAGER_TABLE*)handle)->MmProcManagerGetSupportedProtocols(handle, contentType)
+#define GFMmProcManagerGetSystemTimeBase(handle) \
+ ((GFMMPROC_MANAGER_TABLE*)handle)->MmProcManagerGetSystemTimeBase(handle)
+#define GFMmProcManagerPlayTone(handle, note, duration, volume) \
+ ((GFMMPROC_MANAGER_TABLE*)handle)->MmProcManagerPlayTone(handle, note, duration, volume)
+#define GFMmProcManagerProcess(handle) \
+ ((GFMMPROC_MANAGER_TABLE*)handle)->MmProcManagerProcess(handle)
+#define MmProcManagerGetCodecType(handle) \
+ ((GFMMPROC_MANAGER_TABLE*)handle)->MmProcManagerGetCodecType(handle)
+#define MmProcManagerCodecWrite(handle, offset, value) \
+ ((GFMMPROC_MANAGER_TABLE*)handle)->MmProcManagerCodecWrite(handle, offset, value)
+#define MmProcManagerCodecRead(handle, offset) \
+ ((GFMMPROC_MANAGER_TABLE*)handle)->MmProcManagerCodecRead(handle, offset)
+
+
+//*****************************************************************************
+// Player
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_PLAYER_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+ //
+ // Controllable Methods
+ //
+ GFMMPROC_CONTROL (*MmProcControllableGetControl)(GFMMPROC_CONTROLLABLE handle, char* controlType);
+ GFMMPROC_CONTROL* (*MmProcControllableGetControls)(GFMMPROC_CONTROLLABLE handle);
+
+ void (*MmProcPlayerAddPlayerListener)(GFMMPROC_PLAYER handle, GFMMPROC_PLAYER_LISTENER playerListener);
+ void (*MmProcPlayerClose)(GFMMPROC_PLAYER handle);
+ void (*MmProcPlayerDeallocate)(GFMMPROC_PLAYER handle);
+ char* (*MmProcPlayerGetContentType)(GFMMPROC_PLAYER handle);
+ NvS64 (*MmProcPlayerGetDuration)(GFMMPROC_PLAYER handle);
+ NvS64 (*MmProcPlayerGetMediaTime)(GFMMPROC_PLAYER handle);
+ NvU32 (*MmProcPlayerGetState)(GFMMPROC_PLAYER handle);
+ GFMMPROC_TIME_BASE (*MmProcPlayerGetTimeBase)(GFMMPROC_PLAYER handle);
+ NvU32 (*MmProcPlayerPrefetch)(GFMMPROC_PLAYER handle);
+ void (*MmProcPlayerPull)(GFMMPROC_PLAYER handle, NvS32 allow);
+ void (*MmProcPlayerRealize)(GFMMPROC_PLAYER handle);
+ void (*MmProcPlayerRemovePlayerListener)(GFMMPROC_PLAYER handle, GFMMPROC_PLAYER_LISTENER playerListener);
+ void (*MmProcPlayerSetLoopCount)(GFMMPROC_PLAYER handle, NvS32 count);
+ NvS64 (*MmProcPlayerSetMediaTime)(GFMMPROC_PLAYER handle, NvS64 now);
+ void (*MmProcPlayerSetTimeBase)(GFMMPROC_PLAYER handle, GFMMPROC_TIME_BASE master);
+ void (*MmProcPlayerStart)(GFMMPROC_PLAYER handle);
+ void (*MmProcPlayerStop)(GFMMPROC_PLAYER handle);
+
+} GFMMPROC_PLAYER_TABLE;
+
+#define GFMMPROC_PLAYER_UNREALIZED 100
+#define GFMMPROC_PLAYER_REALIZED 200
+#define GFMMPROC_PLAYER_PREFETCHED 300
+#define GFMMPROC_PLAYER_STARTED 400
+#define GFMMPROC_PLAYER_CLOSED 0
+#define GFMMPROC_PLAYER_TIME_UNKNOWN -1
+
+#define GFMmProcPlayerAddPlayerListener(handle, playerListener) \
+ ((GFMMPROC_PLAYER_TABLE*)handle)->MmProcPlayerAddPlayerListener(handle, playerListener)
+#define GFMmProcPlayerClose(handle) \
+ ((GFMMPROC_PLAYER_TABLE*)handle)->MmProcPlayerClose(handle)
+#define GFMmProcPlayerDeallocate(handle) \
+ ((GFMMPROC_PLAYER_TABLE*)handle)->MmProcPlayerDeallocate(handle)
+#define GFMmProcPlayerGetContentType(handle) \
+ ((GFMMPROC_PLAYER_TABLE*)handle)->MmProcPlayerGetContentType(handle)
+#define GFMmProcPlayerGetDuration(handle) \
+ ((GFMMPROC_PLAYER_TABLE*)handle)->MmProcPlayerGetDuration(handle)
+#define GFMmProcPlayerGetMediaTime(handle) \
+ ((GFMMPROC_PLAYER_TABLE*)handle)->MmProcPlayerGetMediaTime(handle)
+#define GFMmProcPlayerGetState(handle) \
+ ((GFMMPROC_PLAYER_TABLE*)handle)->MmProcPlayerGetState(handle)
+#define GFMmProcPlayerGetTimeBase(handle) \
+ ((GFMMPROC_PLAYER_TABLE*)handle)->MmProcPlayerGetTimeBase(handle)
+#define GFMmProcPlayerPrefetch(handle) \
+ ((GFMMPROC_PLAYER_TABLE*)handle)->MmProcPlayerPrefetch(handle)
+#define GFMmProcPlayerPull(handle, allow) \
+ ((GFMMPROC_PLAYER_TABLE*)handle)->MmProcPlayerPull(handle, allow)
+#define GFMmProcPlayerRealize(handle) \
+ ((GFMMPROC_PLAYER_TABLE*)handle)->MmProcPlayerRealize(handle)
+#define GFMmProcPlayerRemovePlayerListener(handle, playerListener) \
+ ((GFMMPROC_PLAYER_TABLE*)handle)->MmProcPlayerRemovePlayerListener(handle, playerListener)
+#define GFMmProcPlayerSetLoopCount(handle, count) \
+ ((GFMMPROC_PLAYER_TABLE*)handle)->MmProcPlayerSetLoopCount(handle, count)
+#define GFMmProcPlayerSetMediaTime(handle, now) \
+ ((GFMMPROC_PLAYER_TABLE*)handle)->MmProcPlayerSetMediaTime(handle, now)
+#define GFMmProcPlayerSetTimeBase(handle, master) \
+ ((GFMMPROC_PLAYER_TABLE*)handle)->MmProcPlayerSetMediaTime(handle, master)
+#define GFMmProcPlayerStart(handle) \
+ ((GFMMPROC_PLAYER_TABLE*)handle)->MmProcPlayerStart(handle)
+#define GFMmProcPlayerStop(handle) \
+ ((GFMMPROC_PLAYER_TABLE*)handle)->MmProcPlayerStop(handle)
+
+
+//*****************************************************************************
+// PlayerListener
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_PLAYER_LISTENER_TABLE
+{
+ void (*MmProcPlayerListenerPlayerUpdate)(GFMMPROC_PLAYER_LISTENER handle, GFMMPROC_PLAYER player, const char* event, void* eventData);
+
+} GFMMPROC_PLAYER_LISTENER_TABLE;
+
+#define GFMMPROC_PLAYER_LISTENER_BUFFERING_STARTED "bufferingStarted"
+#define GFMMPROC_PLAYER_LISTENER_BUFFERING_STOPPED "bufferingStopped"
+#define GFMMPROC_PLAYER_LISTENER_CLOSED "closed"
+#define GFMMPROC_PLAYER_LISTENER_END_OF_MEDIA "endOfMedia"
+#define GFMMPROC_PLAYER_LISTENER_DEVICE_AVAILABLE "deviceAvailable"
+#define GFMMPROC_PLAYER_LISTENER_DEVICE_UNAVAILABLE "deviceUnavailable"
+#define GFMMPROC_PLAYER_LISTENER_DURATION_UPDATED "durationUpdated"
+#define GFMMPROC_PLAYER_LISTENER_ERROR "error"
+#define GFMMPROC_PLAYER_LISTENER_FORMAT_CHANGED "formatChanged"
+#define GFMMPROC_PLAYER_LISTENER_RECORD_ERROR "recordError"
+#define GFMMPROC_PLAYER_LISTENER_RECORD_STARTED "recordStarted"
+#define GFMMPROC_PLAYER_LISTENER_RECORD_STOPPED "recordStopped"
+#define GFMMPROC_PLAYER_LISTENER_STARTED "started"
+#define GFMMPROC_PLAYER_LISTENER_STOPPED "stopped"
+#define GFMMPROC_PLAYER_LISTENER_STOPPED_AT_TIME "stoppedAtTime"
+#define GFMMPROC_PLAYER_LISTENER_VOLUME_CHANGED "volumeChanged"
+
+#define GFMmProcPlayerListenerPlayerUpdate(handle, player, event, eventData) \
+ ((GFMMPROC_PLAYER_LISTENER_TABLE*)handle)->MmProcPlayerListenerPlayerUpdate(handle, player, event, eventData)
+
+
+//*****************************************************************************
+// TimeBase
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_TIME_BASE_TABLE
+{
+ NvU32 (*MmProcTimeBaseGetTime)(GFMMPROC_TIME_BASE handle);
+
+} GFMMPROC_TIME_BASE_TABLE;
+
+#define GFMmProcTimeBaseGetTime(handle) \
+ ((GFMMPROC_TIME_BASE_TABLE*)handle)->MmProcTimeBaseGetTime(handle)
+
+
+
+//*****************************************************************************
+//*****************************************************************************
+//
+//
+// GFMMPROC_BASIC_AUDIO_CONTROLS
+//
+//
+//*****************************************************************************
+//*****************************************************************************
+
+#if defined GFMMPROC_BASIC_AUDIO_CONTROLS
+
+typedef GFMMPROC_CONTROL GFMMPROC_CONTROL_MIDI;
+typedef GFMMPROC_CONTROL GFMMPROC_CONTROL_PITCH;
+typedef GFMMPROC_CONTROL GFMMPROC_CONTROL_RATE;
+typedef GFMMPROC_CONTROL GFMMPROC_CONTROL_RECORD;
+typedef GFMMPROC_CONTROL GFMMPROC_CONTROL_STOP_TIME;
+typedef GFMMPROC_CONTROL GFMMPROC_CONTROL_TEMPO;
+typedef GFMMPROC_CONTROL GFMMPROC_CONTROL_TONE;
+typedef GFMMPROC_CONTROL GFMMPROC_CONTROL_VOLUME;
+
+
+
+//*****************************************************************************
+// MIDIControl
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_CONTROL_MIDI_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+ NvS32* (*MmProcControlMidiGetBankList)(GFMMPROC_CONTROL_MIDI hande, NvS32 custom);
+ NvS8 (*MmProcControlMidiGetChannelVolume)(GFMMPROC_CONTROL_MIDI hande, NvU8 channel);
+ char* (*MmProcControlMidiGetKeyName)(GFMMPROC_CONTROL_MIDI hande, NvS32 bank, NvS32 program, NvS32 key);
+ NvS32* (*MmProcControlMidiGetProgram)(GFMMPROC_CONTROL_MIDI hande, NvU8 channel);
+ NvS32* (*MmProcControlMidiGetProgramList)(GFMMPROC_CONTROL_MIDI hande, NvS32 bank);
+ char* (*MmProcControlMidiGetProgramName)(GFMMPROC_CONTROL_MIDI hande, NvS32 bank, NvS32 program);
+ NvS32 (*MmProcControlMidiIsBankQuerySupported)(GFMMPROC_CONTROL_MIDI hande);
+ NvS32 (*MmProcControlMidiLongMidiEvent)(GFMMPROC_CONTROL_MIDI hande, NvS8* data, NvS32 offset, NvS32 length);
+ void (*MmProcControlMidiShortMidiEvent)(GFMMPROC_CONTROL_MIDI hande, NvS32 type, NvS32 data1, NvS32 data2);
+
+} GFMMPROC_CONTROL_MIDI_TABLE;
+
+#define GFMMPROC_CONTROL_MIDI_CONTROL_CHANGE 176
+#define GFMMPROC_CONTROL_MIDI_NOTE_ON 144
+
+#define GFMmProcControlMidiGetBankList(handle, custom) \
+ ((GFMMPROC_CONTROL_MIDI_TABLE*)handle)->MmProcControlMidiGetBankList(handle, custom)
+#define GFMmProcControlMidiGetChannelVolume(handle, channel) \
+ ((GFMMPROC_CONTROL_MIDI_TABLE*)handle)->MmProcControlMidiGetChannelVolume(handle, channel)
+#define GFMmProcControlMidiGetKeyName(handle, bank, program, key) \
+ ((GFMMPROC_CONTROL_MIDI_TABLE*)handle)->MmProcControlMidiGetKeyName(handle, bank, program, key)
+#define GFMmProcControlMidiGetProgram(handle, channel) \
+ ((GFMMPROC_CONTROL_MIDI_TABLE*)handle)->MmProcControlMidiGetProgram(handle, channel)
+#define GFMmProcControlMidiGetProgramList(handle, bank) \
+ ((GFMMPROC_CONTROL_MIDI_TABLE*)handle)->MmProcControlMidiGetProgramList(handle, bank)
+#define GFMmProcControlMidiGetProgramName(handle, bank, program) \
+ ((GFMMPROC_CONTROL_MIDI_TABLE*)handle)->MmProcControlMidiGetProgramName(handle, bank, program)
+#define GFMmProcControlMidiIsBankQuerySupported(handle) \
+ ((GFMMPROC_CONTROL_MIDI_TABLE*)handle)->MmProcControlMidiIsBankQuerySupported(handle)
+#define GFMmProcControlMidiLongMidiEvent(handle) \
+ ((GFMMPROC_CONTROL_MIDI_TABLE*)handle)->MmProcControlMidiLongMidiEvent(handle, data, offset, length)
+#define GFMmProcControlMidiShortMidiEvent(handle, type, data1, data2) \
+ ((GFMMPROC_CONTROL_MIDI_TABLE*)handle)->(handle, type, data1, data2)
+
+
+//*****************************************************************************
+// PitchControl
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_CONTROL_PITCH_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+ NvS32 (*MmProcControlPitchGetMaxPitch)(GFMMPROC_CONTROL_PITCH handle);
+ NvS32 (*MmProcControlPitchGetMinPitch)(GFMMPROC_CONTROL_PITCH handle);
+ NvS32 (*MmProcControlPitchGetPitch)(GFMMPROC_CONTROL_PITCH handle);
+ NvS32 (*MmProcControlPitchSetPitch)(GFMMPROC_CONTROL_PITCH handle, NvS32 millisemitones);
+
+} GFMMPROC_CONTROL_PITCH_TABLE;
+
+#define GFMmProcControlPitchGetMaxPitch(handle) \
+ ((GFMMPROC_CONTROL_PITCH_TABLE*)handle)->MmProcControlPitchGetMaxPitch(handle)
+#define GFMmProcControlPitchGetMinPitch(handle) \
+ ((GFMMPROC_CONTROL_PITCH_TABLE*)handle)->MmProcControlPitchGetMinPitch(handle)
+#define GFMmProcControlPitchGetPitch(handle) \
+ ((GFMMPROC_CONTROL_PITCH_TABLE*)handle)->MmProcControlPitchGetPitch(handle)
+#define GFMmProcControlPitchSetPitch(handle, millisemitones) \
+ ((GFMMPROC_CONTROL_PITCH_TABLE*)handle)->MmProcControlPitchSetPitch(handle, millisemitones)
+
+
+//*****************************************************************************
+// RateControl
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_CONTROL_RATE_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+ NvS32 (*MmProcControlRateGetMaxRate)(GFMMPROC_CONTROL_RATE handle);
+ NvS32 (*MmProcControlRateGetMinRate)(GFMMPROC_CONTROL_RATE handle);
+ NvS32 (*MmProcControlRateGetRate)(GFMMPROC_CONTROL_RATE handle);
+ NvS32 (*MmProcControlRateSetRate)(GFMMPROC_CONTROL_RATE handle, NvS32 millirate);
+
+} GFMMPROC_CONTROL_RATE_TABLE;
+
+#define GFMmProcControlRateGetMaxRate(handle) \
+ ((GFMMPROC_CONTROL_RATE_TABLE*)handle)->MmProcControlRateGetMaxRate(handle)
+#define GFMmProcControlRateGetMinRate(handle) \
+ ((GFMMPROC_CONTROL_RATE_TABLE*)handle)->MmProcControlRateGetMinRate(handle)
+#define GFMmProcControlRateGetRate(handle) \
+ ((GFMMPROC_CONTROL_RATE_TABLE*)handle)->MmProcControlRateGetRate(handle)
+#define GFMmProcControlRateSetRate(handle, millirate) \
+ ((GFMMPROC_CONTROL_RATE_TABLE*)handle)->MmProcControlRateSetRate(handle, millirate)
+
+
+//*****************************************************************************
+// RecordControl
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_CONTROL_RECORD_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+ void (*MmProcControlRecordCommit)(GFMMPROC_CONTROL_RECORD handle);
+ char* (*MmProcControlRecordGetContentType)(GFMMPROC_CONTROL_RECORD handle);
+ void (*MmProcControlRecordSetRecordLocation)(GFMMPROC_CONTROL_RECORD handle, char* locator);
+ void (*MmProcControlRecordSetRecordStream)(GFMMPROC_CONTROL_RECORD handle, GFMMPROC_STREAM stream, char* contentType);
+ NvS32 (*MmProcControlRecordSetRecordSizeLimit)(GFMMPROC_CONTROL_RECORD handle, NvS32 size);
+ void (*MmProcControlRecordStartRecord)(GFMMPROC_CONTROL_RECORD handle);
+ void (*MmProcControlRecordStopRecord)(GFMMPROC_CONTROL_RECORD handle);
+ void (*MmProcControlRecordReset)(GFMMPROC_CONTROL_RECORD handle);
+
+} GFMMPROC_CONTROL_RECORD_TABLE;
+
+#define GFMmProcControlRecordCommit(handle) \
+ ((GFMMPROC_CONTROL_RECORD_TABLE*)handle)->MmProcControlRecordCommit(handle)
+#define GFMmProcControlRecordGetContentType(handle) \
+ ((GFMMPROC_CONTROL_RECORD_TABLE*)handle)->MmProcControlRecordGetContentType(handle)
+#define GFMmProcControlRecordSetRecordLocation(handle, locator) \
+ ((GFMMPROC_CONTROL_RECORD_TABLE*)handle)->MmProcControlRecordSetRecordLocation(handle, locator)
+#define GFMmProcControlRecordSetRecordStream(handle, stream, contentType) \
+ ((GFMMPROC_CONTROL_RECORD_TABLE*)handle)->MmProcControlRecordSetRecordStream(handle, stream, contentType)
+#define GFMmProcControlRecordSetRecordSizeLimit(handle, size) \
+ ((GFMMPROC_CONTROL_RECORD_TABLE*)handle)->MmProcControlRecordSetRecordSizeLimit(handle, size)
+#define GFMmProcControlRecordStartRecord(handle) \
+ ((GFMMPROC_CONTROL_RECORD_TABLE*)handle)->MmProcControlRecordStartRecord(handle)
+#define GFMmProcControlRecordStopRecord(handle) \
+ ((GFMMPROC_CONTROL_RECORD_TABLE*)handle)->MmProcControlRecordStopRecord(handle)
+#define GFMmProcControlRecordReset(handle) \
+ ((GFMMPROC_CONTROL_RECORD_TABLE*)handle)->MmProcControlRecordReset(handle)
+
+
+//*****************************************************************************
+// StopTimeControl
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_CONTROL_STOP_TIME_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+ NvS64 (*MmProcControlStopTimeGetStopTime)(GFMMPROC_CONTROL_STOP_TIME handle);
+ void (*MmProcControlStopTimeSetStopTime)(GFMMPROC_CONTROL_STOP_TIME handle, NvS64 stopTime);
+
+} GFMMPROC_CONTROL_STOP_TIME_TABLE;
+
+#define GFMMPROC_CONTROL_STOP_TIME_RESET -1
+
+#define GFMmProcControlStopTimeGetStopTime(handle) \
+ (GFMMPROC_CONTROL_STOP_TIME_TABLE*)handle)->MmProcControlStopTimeGetStopTime(handle)
+#define GFMmProcControlStopTimeSetStopTime(handle, stopTime) \
+ ((GFMMPROC_CONTROL_STOP_TIME_TABLE*)handle)->MmProcControlStopTimeSetStopTime(handle, stopTime)
+
+
+//*****************************************************************************
+// TempoControl
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_CONTROL_TEMPO_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+ //
+ // Rate Methods
+ //
+ NvS32 (*MmProcControlRateGetMaxRate)(GFMMPROC_CONTROL_RATE handle);
+ NvS32 (*MmProcControlRateGetMinRate)(GFMMPROC_CONTROL_RATE handle);
+ NvS32 (*MmProcControlRateGetRate)(GFMMPROC_CONTROL_RATE handle);
+ NvS32 (*MmProcControlRateSetRate)(GFMMPROC_CONTROL_RATE handle, NvS32 millirate);
+
+ NvS32 (*MmProcControlTempoGetTempo)(GFMMPROC_CONTROL_TEMPO handle);
+ NvS32 (*MmProcControlTempoSetTempo)(GFMMPROC_CONTROL_TEMPO handle, NvS32 millitempo);
+
+} GFMMPROC_CONTROL_TEMPO_TABLE;
+
+#define GFMmProcControlTempoGetTempo(handle) \
+ ((GFMMPROC_CONTROL_TEMPO_TABLE*)handle)->MmProcControlTempoGetTempo(handle)
+#define GFMmProcControlTempoSetTempo(handle) \
+ ((GFMMPROC_CONTROL_TEMPO_TABLE*)handle)->MmProcControlTempoSetTempo(handle, millitempo)
+
+
+//*****************************************************************************
+// ToneControl
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_CONTROL_TONE_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+ void (*MmProcControlToneSetSequence)(GFMMPROC_CONTROL_TONE handle, NvS8* sequence);
+
+} GFMMPROC_CONTROL_TONE_TABLE;
+
+#define GFMMPROC_CONTROL_TONE_VERSION -2
+#define GFMMPROC_CONTROL_TONE_TEMPO -3
+#define GFMMPROC_CONTROL_TONE_RESOLUTION -4
+#define GFMMPROC_CONTROL_TONE_BLOCK_START -5
+#define GFMMPROC_CONTROL_TONE_BLOCK_END -6
+#define GFMMPROC_CONTROL_TONE_PLAY_BLOCK -7
+#define GFMMPROC_CONTROL_TONE_SET_VOLUME -8
+#define GFMMPROC_CONTROL_TONE_REPEAT -9
+#define GFMMPROC_CONTROL_TONE_C4 60
+#define GFMMPROC_CONTROL_TONE_SILENCE -1
+
+#define GFMmProcControlToneSetSequence(handle, sequence) \
+ ((GFMMPROC_CONTROL_TONE_TABLE*)handle)->MmProcControlToneSetSequence(handle, sequence)
+
+
+//*****************************************************************************
+// VolumeControl
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_CONTROL_VOLUME_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+ NvS32 (*MmProcControlVolumeGetLevel)(GFMMPROC_CONTROL_VOLUME handle);
+ NvS32 (*MmProcControlVolumeIsMuted)(GFMMPROC_CONTROL_VOLUME handle);
+ NvS32 (*MmProcControlVolumeSetLevel)(GFMMPROC_CONTROL_VOLUME handle, NvS32 level);
+ void (*MmProcControlVolumeSetMute)(GFMMPROC_CONTROL_VOLUME handle, NvS32 mute);
+
+} GFMMPROC_CONTROL_VOLUME_TABLE;
+
+#define GFMmProcControlVolumeGetLevel(handle) \
+ ((GFMMPROC_CONTROL_VOLUME_TABLE*)handle)->MmProcControlVolumeGetLevel(handle)
+#define GFMmProcControlVolumeIsMuted(handle) \
+ ((GFMMPROC_CONTROL_VOLUME_TABLE*)handle)->MmProcControlVolumeIsMuted(handle)
+#define GFMmProcControlVolumeSetLevel(handle, level) \
+ ((GFMMPROC_CONTROL_VOLUME_TABLE*)handle)->MmProcControlVolumeSetLevel(handle, level)
+#define GFMmProcControlVolumeSetMute(handle, mute) \
+ ((GFMMPROC_CONTROL_VOLUME_TABLE*)handle)->MmProcControlVolumeSetMute(handle, mute)
+
+
+#endif // GFMMPROC_BASIC_AUDIO_CONTROLS
+
+#endif // GFMMPROC_BASIC_AUDIO
+
+
+
+//*****************************************************************************
+//*****************************************************************************
+//
+//
+// GFMMPROC_ADVANCED
+//
+//
+//*****************************************************************************
+//*****************************************************************************
+
+#if defined GFMMPROC_ADVANCED
+
+typedef GF_HANDLE GFMMPROC_MODULE;
+typedef GFMMPROC_MODULE GFMMPROC_EFFECT_MODULE;
+typedef GFMMPROC_MANAGER GFMMPROC_GLOBAL_MANAGER;
+typedef GFMMPROC_CONTROLLABLE GFMMPROC_MEDIA_PROCESSOR;
+typedef GF_HANDLE GFMMPROC_MEDIA_PROCESSOR_LISTENER;
+typedef GFMMPROC_CONTROLLABLE GFMMPROC_SPECTATOR;
+typedef GFMMPROC_MODULE GFMMPROC_SOUND_SOURCE_3D;
+
+
+//*****************************************************************************
+// Module
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_MODULE_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+ //
+ // Controllable Methods
+ //
+ GFMMPROC_CONTROL (*MmProcControllableGetControl)(GFMMPROC_CONTROLLABLE handle, char* controlType);
+ GFMMPROC_CONTROL* (*MmProcControllableGetControls)(GFMMPROC_CONTROLLABLE handle);
+
+ void (*MmProcModuleAddMIDIChannel)(GFMMPROC_MODULE handle, GFMMPROC_PLAYER player, NvS32 channel);
+ void (*MmProcModuleAddPlayer)(GFMMPROC_MODULE handle, GFMMPROC_PLAYER player);
+ void (*MmProcModuleRemoveMIDIChannel)(GFMMPROC_MODULE handle, GFMMPROC_PLAYER player, NvS32 channel);
+ void (*MmProcModuleRemovePlayer)(GFMMPROC_MODULE handle, GFMMPROC_PLAYER player);
+
+} GFMMPROC_MODULE_TABLE;
+
+#define GFMmProcModuleAddMIDIChannel(handle, player, channel) \
+ ((GFMMPROC_MODULE_TABLE*)handle)->MmProcModuleAddMIDIChannel(handle, player, channel)
+#define GFMmProcModuleAddPlayer(handle, player) \
+ ((GFMMPROC_MODULE_TABLE*)handle)->MmProcModuleAddPlayer(handle, player)
+#define GFMmProcModuleGetControl(handle, controlType) \
+ ((GFMMPROC_MODULE_TABLE*)handle)->MmProcModuleGetControl(handle, controlType)
+#define GFMmProcModuleGetControls(handle) \
+ ((GFMMPROC_MODULE_TABLE*)handle)->MmProcModuleGetControls(handle)
+#define GFMmProcModuleRemoveMIDIChannel(handle, player, channel) \
+ ((GFMMPROC_MODULE_TABLE*)handle)->MmProcModuleRemoveMIDIChannel(handle, player, channel)
+#define GFMmProcModuleRemovePlayer(handle, player) \
+ ((GFMMPROC_MODULE_TABLE*)handle)->MmProcModuleRemovePlayer(handle, player)
+
+
+//*****************************************************************************
+// EffectModule
+//*****************************************************************************
+//
+typedef GFMMPROC_MODULE_TABLE GFMMPROC_EFFECT_MODULE_TABLE;
+
+
+//*****************************************************************************
+// GlobalManager
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_GLOBAL_MANAGER_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+ //
+ // Manager Methods
+ //
+ GFMMPROC_PLAYER (*MmProcManagerCreatePlayer)(GFMMPROC_MANAGER handle, char* locator);
+// GFMMPROC_PLAYER (*MmProcManagerCreatePlayerForDataSource)(GFMMPROC_MANAGER handle, DataSource source);
+ GFMMPROC_PLAYER (*MmProcManagerCreatePlayerForStream)(GFMMPROC_MANAGER handle, GFMMPROC_STREAM stream, char* type);
+ char* (*MmProcManagerGetSupportedContentTypes)(GFMMPROC_MANAGER handle, char* protocol);
+ char* (*MmProcManagerGetSupportedProtocols)(GFMMPROC_MANAGER handle, char* contentType);
+ GFMMPROC_TIME_BASE (*MmProcManagerGetSystemTimeBase)(GFMMPROC_MANAGER handle);
+ void (*MmProcManagerPlayTone)(GFMMPROC_MANAGER handle, NvU32 note, NvU32 duration, NvU32 volume);
+ void (*MmProcManagerProcess)(GFMMPROC_MANAGER handle);
+ GFMMPROC_CODEC_TYPE (*MmProcManagerGetCodecType)(GFMMPROC_MANAGER handle);
+ void (*MmProcManagerCodecWrite)(GFMMPROC_MANAGER handle, NvU32 offset, NvU32 value);
+ NvU32 (*MmProcManagerCodecRead)(GFMMPROC_MANAGER handle, NvU32 offset);
+
+ GFMMPROC_EFFECT_MODULE (*MmProcGlobalManagerCreateEffectModule)(GFMMPROC_GLOBAL_MANAGER handle);
+ GFMMPROC_MEDIA_PROCESSOR (*MmProcGlobalManagerCreateMediaProcessor)(GFMMPROC_GLOBAL_MANAGER handle);
+ GFMMPROC_SOUND_SOURCE_3D (*MmProcGlobalManagerCreateSoundSource3D)(GFMMPROC_GLOBAL_MANAGER handle);
+ GFMMPROC_CONTROL (*MmProcGlobalManagerGetControl)(GFMMPROC_GLOBAL_MANAGER handle, char* controlType);
+ GFMMPROC_CONTROL* (*MmProcGlobalManagerGetControls)(GFMMPROC_GLOBAL_MANAGER handle);
+ GFMMPROC_SPECTATOR (*MmProcGlobalManagerGetSpectator)(GFMMPROC_GLOBAL_MANAGER handle);
+ char* (*MmProcGlobalManagerGetSupportedMediaProcessorInputTypes)(GFMMPROC_GLOBAL_MANAGER handle);
+ NvS32 (*MmProcGlobalManagerGetUnitsPerMeter)(GFMMPROC_GLOBAL_MANAGER handle);
+ void (*MmProcGlobalManagerSetUnitsPerMeter)(GFMMPROC_GLOBAL_MANAGER handle, NvS32 newScalingFactor);
+
+} GFMMPROC_GLOBAL_MANAGER_TABLE;
+
+#define GFMmProcGlobalManagerCreateEffectModule(handle) \
+ ((GFMMPROC_GLOBAL_MANAGER_TABLE*)handle)->MmProcGlobalManagerCreateEffectModule(handle)
+#define GFMmProcGlobalManagerCreateMediaProcessor(handle) \
+ ((GFMMPROC_GLOBAL_MANAGER_TABLE*)handle)->MmProcGlobalManagerCreateMediaProcessor(handle)
+#define GFMmProcGlobalManagerCreateSoundSource3D(handle) \
+ ((GFMMPROC_GLOBAL_MANAGER_TABLE*)handle)->MmProcGlobalManagerCreateSoundSource3D(handle)
+#define GFMmProcGlobalManagerGetControl(handle, controlType) \
+ ((GFMMPROC_GLOBAL_MANAGER_TABLE*)handle)->MmProcGlobalManagerGetControl(handle, controlType)
+#define GFMmProcGlobalManagerGetControls(handle) \
+ ((GFMMPROC_GLOBAL_MANAGER_TABLE*)handle)->MmProcGlobalManagerGetControls(handle)
+#define GFMmProcGlobalManagerGetSpectator(handle) \
+ ((GFMMPROC_GLOBAL_MANAGER_TABLE*)handle)->MmProcGlobalManagerGetSpectator(handle)
+#define GFMmProcGlobalManagerGetSupportedMediaProcessorInputTypes(handle) \
+ ((GFMMPROC_GLOBAL_MANAGER_TABLE*)handle)->MmProcGlobalManagerGetSupportedMediaProcessorInputTypes(handle)
+#define GFMmProcGlobalManagerGetUnitsPerMeter(handle) \
+ ((GFMMPROC_GLOBAL_MANAGER_TABLE*)handle)->MmProcGlobalManagerGetUnitsPerMeter(handle)
+#define GFMmProcGlobalManagerSetUnitsPerMeter(handle, newScalingFactor) \
+ ((GFMMPROC_GLOBAL_MANAGER_TABLE*)handle)->MmProcGlobalManagerSetUnitsPerMeter(handle, newScalingFactor)
+
+
+//*****************************************************************************
+// MediaProcessor
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_MEDIA_PROCESSOR_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+ //
+ // Controllable Methods
+ //
+ GFMMPROC_CONTROL (*MmProcControllableGetControl)(GFMMPROC_CONTROLLABLE handle, char* controlType);
+ GFMMPROC_CONTROL* (*MmProcControllableGetControls)(GFMMPROC_CONTROLLABLE handle);
+
+ void (*MmProcMediaProcessorAbort)(GFMMPROC_MEDIA_PROCESSOR handle);
+ void (*MmProcMediaProcessorAddMediaProcessorListener)(GFMMPROC_MEDIA_PROCESSOR handle,
+ GFMMPROC_MEDIA_PROCESSOR_LISTENER mediaProcessorListener);
+ void (*MmProcMediaProcessorComplete)(GFMMPROC_MEDIA_PROCESSOR handle);
+ NvS32 (*MmProcMediaProcessorGetProgress)(GFMMPROC_MEDIA_PROCESSOR handle);
+ void (*MmProcMediaProcessorRemoveMediaProcessorListener)(GFMMPROC_MEDIA_PROCESSOR handle,
+ GFMMPROC_MEDIA_PROCESSOR_LISTENER mediaProcessorListener);
+ void (*MmProcMediaProcessorStart)(GFMMPROC_MEDIA_PROCESSOR handle);
+ void (*MmProcMediaProcessorStop)(GFMMPROC_MEDIA_PROCESSOR handle);
+ GFMMPROC_PLAYER (*MmProcMediaProcessorSetInput)(GFMMPROC_MEDIA_PROCESSOR handle, GFMMPROC_STREAM input, char* contentType, NvS32 length);
+ GFMMPROC_PLAYER (*MmProcMediaProcessorSetOutput)(GFMMPROC_MEDIA_PROCESSOR handle, GFMMPROC_STREAM output, char* contentType);
+
+} GFMMPROC_MEDIA_PROCESSOR_TABLE;
+
+#define GFMMPROC_MEDIA_PROCESSOR_UNKNOWN -1
+
+#define GFMmProcMediaProcessorAbort(handle) \
+ ((GFMMPROC_MEDIA_PROCESSOR_TABLE*)handle)->MmProcMediaProcessorAbort(handle)
+#define GFMmProcMediaProcessorAddMediaProcessorListener(handle, mediaProcessorListener) \
+ ((GFMMPROC_MEDIA_PROCESSOR_TABLE*)handle)->MmProcMediaProcessorAddMediaProcessorListener(handle, mediaProcessorListener)
+#define GFMmProcMediaProcessorComplete(handle) \
+ ((GFMMPROC_MEDIA_PROCESSOR_TABLE*)handle)->MmProcMediaProcessorComplete(handle)
+#define GFMmProcMediaProcessorGetProgress(handle) \
+ ((GFMMPROC_MEDIA_PROCESSOR_TABLE*)handle)->MmProcMediaProcessorGetProgress(handle)
+#define GFMmProcMediaProcessorRemoveMediaProcessorListener(handle, mediaProcessorListener) \
+ ((GFMMPROC_MEDIA_PROCESSOR_TABLE*)handle)->MmProcMediaProcessorRemoveMediaProcessorListener(handle, mediaProcessorListener)
+#define GFMmProcMediaProcessorStart(handle) \
+ ((GFMMPROC_MEDIA_PROCESSOR_TABLE*)handle)->MmProcMediaProcessorStart(handle)
+#define GFMmProcMediaProcessorStop(handle) \
+ ((GFMMPROC_MEDIA_PROCESSOR_TABLE*)handle)->MmProcMediaProcessorStop(handle)
+#define GFMmProcMediaProcessorSetInput(handle, input, contentType, length) \
+ ((GFMMPROC_MEDIA_PROCESSOR_TABLE*)handle)->MmProcMediaProcessorSetInput(handle, input, contentType, length)
+#define GFMmProcMediaProcessorSetOutput(handle, output, contentType) \
+ ((GFMMPROC_MEDIA_PROCESSOR_TABLE*)handle)->MmProcMediaProcessorSetOutput(handle, output, contentType)
+
+
+//*****************************************************************************
+// MediaProcessorListener
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_MEDIA_PROCESSOR_LISTENER_TABLE
+{
+ void (*MmProcMediaProcessorListenerMediaProcessorUpdate)(GFMMPROC_MEDIA_PROCESSOR_LISTENER handle,
+ GFMMPROC_MEDIA_PROCESSOR processor, char* event,
+ void* eventData);
+
+} GFMMPROC_MEDIA_PROCESSOR_LISTENER_TABLE;
+
+#define GFMMPROC_MEDIA_PROCESSOR_LISTENER_PROCESSING_COMPLETED "processingCompleted"
+#define GFMMPROC_MEDIA_PROCESSOR_LISTENER_PROCESSING_ERROR "processingError"
+
+#define GFMmProcMediaProcessorListenerMediaProcessorUpdate(handle, processor, event, eventData) \
+ ((GFMMPROC_MEDIA_PROCESSOR_LISTENER_TABLE*)handle)->MmProcMediaProcessorListenerMediaProcessorUpdate(handle, processor, event, eventData)
+
+
+//*****************************************************************************
+// Spectator
+//*****************************************************************************
+//
+typedef GFMMPROC_CONTROLLABLE_TABLE GFMMPROC_SPECTATOR_TABLE;
+
+
+//*****************************************************************************
+// SoundSource3D
+//*****************************************************************************
+//
+typedef GFMMPROC_MODULE_TABLE GFMMPROC_SOUND_SOURCE_3D_TABLE;
+
+
+
+//*****************************************************************************
+//*****************************************************************************
+//
+//
+// GFMMPROC_ADVANCED_3D_AUDIO_CONTROLS
+//
+//
+//*****************************************************************************
+//*****************************************************************************
+
+#if defined GFMMPROC_ADVANCED_3D_AUDIO_CONTROLS
+
+typedef GFMMPROC_CONTROL GFMMPROC_CONTROL_COMMIT;
+typedef GFMMPROC_CONTROL GFMMPROC_CONTROL_ORIENTATION;
+typedef GFMMPROC_CONTROL_ORIENTATION GFMMPROC_CONTROL_DIRECTIVITY;
+typedef GFMMPROC_CONTROL GFMMPROC_CONTROL_DISTANCE_ATTENUATION;
+typedef GFMMPROC_CONTROL GFMMPROC_CONTROL_DOPPLER;
+typedef GFMMPROC_CONTROL GFMMPROC_CONTROL_LOCATION;
+typedef GFMMPROC_CONTROL_ORIENTATION GFMMPROC_CONTROL_MACROSCOPIC;
+typedef GFMMPROC_CONTROL GFMMPROC_CONTROL_OBSTRUCTION;
+
+#include "GFAudio.h"
+
+//*****************************************************************************
+// CommitControl
+//*****************************************************************************
+typedef struct _GFMMPROC_CONTROL_COMMIT_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+ void (*MmProcControlCommitCommit)(GFMMPROC_CONTROL_COMMIT handle);
+ NvS32 (*MmProcControlCommitIsDeferred)(GFMMPROC_CONTROL_COMMIT handle);
+ void (*MmProcControlCommitSetDeferred)(GFMMPROC_CONTROL_COMMIT handle, NvS32 deferred);
+
+} GFMMPROC_CONTROL_COMMIT_TABLE;
+
+#define GFMmProcControlCommitCommit(handle) \
+ ((GFMMPROC_CONTROL_COMMIT_TABLE*)handle)->MmProcControlCommitCommit(handle)
+#define GFMmProcControlCommitIsDeferred(handle) \
+ ((GFMMPROC_CONTROL_COMMIT_TABLE*)handle)->MmProcControlCommitIsDeferred(handle)
+#define GFMmProcControlCommitSetDeferred(handle, deferred) \
+ ((GFMMPROC_CONTROL_COMMIT_TABLE*)handle)->MmProcControlCommitSetDeferred(handle, deferred)
+
+
+
+//*****************************************************************************
+// OrientationControl
+//*****************************************************************************
+typedef struct _GFMMPROC_CONTROL_ORIENTATION_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+ void (*MmProcControlOrientationGetOrientation)(GFMMPROC_CONTROL_ORIENTATION handle,
+ NvVectorS32* frontVector, NvVectorS32* aboveVector);
+ void (*MmProcControlOrientationSetOrientation)(GFMMPROC_CONTROL_ORIENTATION handle,
+ NvVectorS32 frontVector, NvVectorS32 aboveVector);
+
+} GFMMPROC_CONTROL_ORIENTATION_TABLE;
+
+#define GFMmProcControlOrientationGetOrientation(handle, frontVector, aboveVector) \
+ ((GFMMPROC_CONTROL_ORIENTATION_TABLE*)handle)->MmProcControlOrientationGetOrientation(handle, frontVector, aboveVector)
+#define GFMmProcControlOrientationSetOrientation(handle, frontVector, aboveVector) \
+ ((GFMMPROC_CONTROL_ORIENTATION_TABLE*)handle)->MmProcControlOrientationSetOrientation(handle, frontVector, aboveVector)
+
+
+//*****************************************************************************
+// DirectivityControl
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_CONTROL_DIRECTIVITY_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+ //
+ // Orientation Methods
+ //
+ void (*MmProcControlOrientationGetOrientation)(GFMMPROC_CONTROL_ORIENTATION handle,
+ NvVectorS32* frontVector, NvVectorS32* aboveVector);
+ void (*MmProcControlOrientationSetOrientation)(GFMMPROC_CONTROL_ORIENTATION handle,
+ NvVectorS32 frontVector, NvVectorS32 aboveVector);
+
+ void (*MmProcControlDirectivityGetParameters)(GFMMPROC_CONTROL_DIRECTIVITY handle, NvVectorS32* vector);
+ void (*MmProcControlDirectivitySetParameters)(GFMMPROC_CONTROL_DIRECTIVITY handle,
+ NvS32 minAngle, NvS32 maxAngle, NvS32 rearLevel);
+
+} GFMMPROC_CONTROL_DIRECTIVITY_TABLE;
+
+#define GFMmProcControlDirectivityGetParameters(handle, vector) \
+ ((GFMMPROC_CONTROL_DIRECTIVITY_TABLE*)handle)->MmProcControlDirectivityGetParameters(handle, vector)
+#define GFMmProcControlDirectivitySetParameters(handle, minAngle, maxAngle, rearLevel) \
+ ((GFMMPROC_CONTROL_DIRECTIVITY_TABLE*)handle)->MmProcControlDirectivitySetParameters(handle, minAngle, maxAngle, rearLevel)
+
+
+//*****************************************************************************
+// DistanceAttenuationControl
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_CONTROL_DISTANCE_ATTENUATION_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+ NvS32 (*MmProcControlDistanceAttenuationGetMaxDistance)(GFMMPROC_CONTROL_DISTANCE_ATTENUATION handle);
+ NvS32 (*MmProcControlDistanceAttenuationGetMinDistance)(GFMMPROC_CONTROL_DISTANCE_ATTENUATION handle);
+ NvS32 (*MmProcControlDistanceAttenuationGetMuteAfterMax)(GFMMPROC_CONTROL_DISTANCE_ATTENUATION handle);
+ NvS32 (*MmProcControlDistanceAttenuationGetRolloffFactor)(GFMMPROC_CONTROL_DISTANCE_ATTENUATION handle);
+ void (*MmProcControlDistanceAttenuationSetParameters)(GFMMPROC_CONTROL_DISTANCE_ATTENUATION handle,
+ NvS32 minDistance, NvS32 maxDistance,
+ NvS32 muteAfterMax, NvS32 rolloffFactor);
+
+} GFMMPROC_CONTROL_DISTANCE_ATTENUATION_TABLE;
+
+#define GFMmProcControlDistanceAttenuationGetMaxDistance(handle) \
+ ((GFMMPROC_CONTROL_DISTANCE_ATTENUATION_TABLE*)handle)->MmProcControlDistanceAttenuationGetMaxDistance(handle)
+#define GFMmProcControlDistanceAttenuationGetMinDistance(handle) \
+ ((GFMMPROC_CONTROL_DISTANCE_ATTENUATION_TABLE*)handle)->MmProcControlDistanceAttenuationGetMinDistance(handle)
+#define GFMmProcControlDistanceAttenuationGetMuteAfterMax(handle) \
+ ((GFMMPROC_CONTROL_DISTANCE_ATTENUATION_TABLE*)handle)->MmProcControlDistanceAttenuationGetMuteAfterMax(handle)
+#define GFMmProcControlDistanceAttenuationGetRolloffFactor(handle) \
+ ((GFMMPROC_CONTROL_DISTANCE_ATTENUATION_TABLE*)handle)->MmProcControlDistanceAttenuationGetRolloffFactor(handle)
+#define GFMmProcControlDistanceAttenuationSetParameters(handle, minDistance, maxDistance, muteAfterMax, rolloffFactor) \
+ ((GFMMPROC_CONTROL_DISTANCE_ATTENUATION_TABLE*)handle)->MmProcControlDistanceAttenuationSetParameters(handle, minDistance, maxDistance, muteAfterMax, rolloffFactor)
+
+
+//*****************************************************************************
+// DopplerControl
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_CONTROL_DOPPLER_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+ void (*MmProcControlDopplerGetVelocityCartesian)(GFMMPROC_CONTROL_DOPPLER handle, NvVectorS32* vector);
+ NvS32 (*MmProcControlDopplerIsEnabled)(GFMMPROC_CONTROL_DOPPLER handle);
+ void (*MmProcControlDopplerSetEnabled)(GFMMPROC_CONTROL_DOPPLER handle, NvS32 dopplerEnabled);
+ void (*MmProcControlDopplerSetVelocityCartesian)(GFMMPROC_CONTROL_DOPPLER handle, NvVectorS32 vector);
+ void (*MmProcControlDopplerSetVelocitySpherical)(GFMMPROC_CONTROL_DOPPLER handle,
+ NvS32 azimuth, NvS32 elevation, NvS32 radius);
+
+} GFMMPROC_CONTROL_DOPPLER_TABLE;
+
+#define GFMmProcControlDopplerGetVelocityCartesian(handle, vector) \
+ ((GFMMPROC_CONTROL_DOPPLER_TABLE*)handle)->MmProcControlDopplerGetVelocityCartesian(handle, vector)
+#define GFMmProcControlDopplerIsEnabled(handle) \
+ ((GFMMPROC_CONTROL_DOPPLER_TABLE*)handle)->MmProcControlDopplerIsEnabled(handle)
+#define GFMmProcControlDopplerSetEnabled(handle, dopplerEnabled) \
+ ((GFMMPROC_CONTROL_DOPPLER_TABLE*)handle)->MmProcControlDopplerSetEnabled(handle, dopplerEnabled)
+#define GFMmProcControlDopplerSetVelocityCartesian(handle, vector) \
+ ((GFMMPROC_CONTROL_DOPPLER_TABLE*)handle)->MmProcControlDopplerSetVelocityCartesian(handle, vector)
+#define GFMmProcControlDopplerSetVelocitySpherical(handle, azimuth, elevation, radius) \
+ ((GFMMPROC_CONTROL_DOPPLER_TABLE*)handle)->MmProcControlDopplerSetVelocitySpherical(handle, azimuth, elevation, radius)
+
+
+//*****************************************************************************
+// LocationControl
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_CONTROL_LOCATION_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+ void (*MmProcControlLocationGetCartesian)(GFMMPROC_CONTROL_LOCATION handle, NvVectorS32* vector);
+ void (*MmProcControlLocationSetCartesian)(GFMMPROC_CONTROL_LOCATION handle, NvVectorS32 vector);
+ void (*MmProcControlLocationSetSpherical)(GFMMPROC_CONTROL_LOCATION handle, NvS32 azimuth, NvS32 elevation, NvS32 radius);
+ void (*MmProcControlLocationSetCoefficients)(GFMMPROC_CONTROL_LOCATION handle,GFMMPROC_SOUND_SOURCE_3D SS3D,GFMMPROC_SPECTATOR spec, NvS32 CurrVec[],NvS32 TargVec[]);
+ void (*MmProcControlLocationGetCoefficients)(GFMMPROC_CONTROL_LOCATION handle, void* Coeff);
+
+} GFMMPROC_CONTROL_LOCATION_TABLE;
+
+#define GFMmProcControlLocationGetCartesian(handle, vector) \
+ ((GFMMPROC_CONTROL_LOCATION_TABLE*)handle)->MmProcControlLocationGetCartesian(handle, vector)
+#define GFMmProcControlLocationSetCartesian(handle, vector) \
+ ((GFMMPROC_CONTROL_LOCATION_TABLE*)handle)->MmProcControlLocationSetCartesian(handle, vector)
+#define GFMmProcControlLocationSetSpherical(handle, azimuth, elevation, radius) \
+ ((GFMMPROC_CONTROL_LOCATION_TABLE*)handle)->MmProcControlLocationSetSpherical(handle, azimuth, elevation, radius)
+#define GFMmProcControlLocationSetCoefficients(handle, SS3D,spec, CurrVec,TargVec) \
+ ((GFMMPROC_CONTROL_LOCATION_TABLE*)handle)->MmProcControlLocationSetCoefficients(handle, SS3D,spec, CurrVec,TargVec)
+#define GFMmProcControlLocationGetCoefficients(handle,pCoeff)\
+ ((GFMMPROC_CONTROL_LOCATION_TABLE*)handle)->MmProcControlLocationGetCoefficients(handle,pCoeff)
+
+//*****************************************************************************
+// MacroscopicControl
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_CONTROL_MACROSCOPIC_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+ //
+ // Orientation Methods
+ //
+ void (*MmProcControlOrientationGetOrientation)(GFMMPROC_CONTROL_ORIENTATION handle,
+ NvVectorS32* frontVector, NvVectorS32* aboveVector);
+ void (*MmProcControlOrientationSetOrientation)(GFMMPROC_CONTROL_ORIENTATION handle,
+ NvVectorS32 frontVector, NvVectorS32 aboveVector);
+
+ void (*MmProcControlMacroscopicGetSize)(GFMMPROC_CONTROL_MACROSCOPIC handle, NvVectorS32* vector);
+ void (*MmProcControlMacroscopicSetSize)(GFMMPROC_CONTROL_MACROSCOPIC handle, NvVectorS32 vector);
+
+} GFMMPROC_CONTROL_MACROSCOPIC_TABLE;
+
+#define GFMmProcControlMacroscopicGetSize(handle, vector) \
+ ((GFMMPROC_CONTROL_MACROSCOPIC_TABLE*)handle)->MmProcControlMacroscopicGetSize(handle, vector)
+#define GFMmProcControlMacroscopicSetSize(handle, vector) \
+ ((GFMMPROC_CONTROL_MACROSCOPIC_TABLE*)handle)->MmProcControlMacroscopicSetSize(handle, vector)
+
+
+//*****************************************************************************
+// ObstructionControl
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_CONTROL_OBSTRUCTION_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+ NvS32 (*MmProcControlObstructionGetHFLevel)(GFMMPROC_CONTROL_OBSTRUCTION handle);
+ NvS32 (*MmProcControlObstructionGetLevel)(GFMMPROC_CONTROL_OBSTRUCTION handle);
+ void (*MmProcControlObstructionSetHFLevel)(GFMMPROC_CONTROL_OBSTRUCTION handle, NvS32 HFLevel);
+ void (*MmProcControlObstructionSetLevel)(GFMMPROC_CONTROL_OBSTRUCTION handle, NvS32 level);
+
+} GFMMPROC_CONTROL_OBSTRUCTION_TABLE;
+
+#define GFMmProcControlObstructionGetHFLevel(handle) \
+ ((GFMMPROC_CONTROL_OBSTRUCTION_TABLE*)handle)->MmProcControlObstructionGetHFLevel(handle)
+#define GFMmProcControlObstructionGetLevel(handle) \
+ ((GFMMPROC_CONTROL_OBSTRUCTION_TABLE*)handle)->MmProcControlObstructionGetLevel(handle)
+#define GFMmProcControlObstructionSetHFLevel(handle, HFLevel) \
+ ((GFMMPROC_CONTROL_OBSTRUCTION_TABLE*)handle)->MmProcControlObstructionSetHFLevel(handle, HFLevel)
+#define GFMmProcControlObstructionSetLevel(handle, level) \
+ ((GFMMPROC_CONTROL_OBSTRUCTION_TABLE*)handle)->MmProcControlObstructionSetLevel(handle, level)
+
+
+#endif // GFMMPROC_ADVANCED_3D_AUDIO_CONTROLS
+
+
+
+
+//*****************************************************************************
+//*****************************************************************************
+//
+//
+// GFMMPROC_ADVANCED_CONTROLS
+//
+//
+//*****************************************************************************
+//*****************************************************************************
+
+#if defined GFMMPROC_ADVANCED_CONTROLS
+
+typedef GFMMPROC_CONTROL GFMMPROC_CONTROL_AUDIO_FORMAT;
+typedef GFMMPROC_CONTROL GFMMPROC_CONTROL_EFFECT;
+typedef GFMMPROC_CONTROL GFMMPROC_CONTROL_EFFECT_ORDER;
+typedef GFMMPROC_CONTROL GFMMPROC_CONTROL_FORMAT;
+typedef GFMMPROC_CONTROL GFMMPROC_CONTROL_MIDI_CHANNEL;
+typedef GFMMPROC_CONTROL GFMMPROC_CONTROL_PAN;
+typedef GFMMPROC_CONTROL GFMMPROC_CONTROL_PRIORITY;
+
+
+
+//*****************************************************************************
+// FormatControl
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_CONTROL_FORMAT_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+ NvS32 (*MmProcControlFormatGetEstimatedBitRate)(GFMMPROC_CONTROL_FORMAT handle);
+ char* (*MmProcControlFormatGetFormat)(GFMMPROC_CONTROL_FORMAT handle);
+ NvS32 (*MmProcControlFormatGetIntParameterValue)(GFMMPROC_CONTROL_FORMAT handle, char* parameter);
+ NvS32 (*MmProcControlFormatGetMetadataOverride)(GFMMPROC_CONTROL_FORMAT handle);
+ NvS32 (*MmProcControlFormatGetMetadataSupportMode)(GFMMPROC_CONTROL_FORMAT handle);
+ char* (*MmProcControlFormatGetStrParameterValue)(GFMMPROC_CONTROL_FORMAT handle, char* parameter);
+ char* (*MmProcControlFormatGetSupportedFormats)(GFMMPROC_CONTROL_FORMAT handle);
+ NvS32* (*MmProcControlFormatGetSupportedIntParameterRange)(GFMMPROC_CONTROL_FORMAT handle, char* parameter);
+ char* (*MmProcControlFormatGetSupportedIntParameters)(GFMMPROC_CONTROL_FORMAT handle);
+ char* (*MmProcControlFormatGetSupportedMetadataKeys)(GFMMPROC_CONTROL_FORMAT handle);
+ char* (*MmProcControlFormatGetSupportedStrParameters)(GFMMPROC_CONTROL_FORMAT handle);
+ char* (*MmProcControlFormatGetSupportedStrParameterValues)(GFMMPROC_CONTROL_FORMAT handle, char* parameter);
+ void (*MmProcControlFormatSetFormat)(GFMMPROC_CONTROL_FORMAT handle, char* format);
+ void (*MmProcControlFormatSetMetadata)(GFMMPROC_CONTROL_FORMAT handle, char* key, char* value);
+ void (*MmProcControlFormatSetMetadataOverride)(GFMMPROC_CONTROL_FORMAT handle, NvS32 override);
+ void (*MmProcControlFormatSetParameterStr)(GFMMPROC_CONTROL_FORMAT handle, char* parameter, char* value);
+ NvS32 (*MmProcControlFormatSetParameterInt)(GFMMPROC_CONTROL_FORMAT handle, char* parameter, NvS32 value);
+
+} GFMMPROC_CONTROL_FORMAT_TABLE;
+
+#define GFMMPROC_CONTROL_FORMAT_METADATA_NOT_SUPPORTED 0
+#define GFMMPROC_CONTROL_FORMAT_METADATA_SUPPORTED_FIXED_KEYS 1
+#define GFMMPROC_CONTROL_FORMAT_METADATA_SUPPORTED_FREE_KEYS 2
+
+#define GFMMPROC_CONTROL_FORMAT_PARAM_BITRATE "bitrate"
+#define GFMMPROC_CONTROL_FORMAT_PARAM_BITRATE_TYPE "bitrate type"
+#define GFMMPROC_CONTROL_FORMAT_PARAM_BITS_PER_SAMPLE "bits per sample"
+#define GFMMPROC_CONTROL_FORMAT_PARAM_CHANNELS "channels"
+#define GFMMPROC_CONTROL_FORMAT_PARAM_FRAMERATE "frame rate"
+#define GFMMPROC_CONTROL_FORMAT_PARAM_QUALITY "quality"
+#define GFMMPROC_CONTROL_FORMAT_PARAM_SAMPLERATE "sample rate"
+#define GFMMPROC_CONTROL_FORMAT_PARAM_TRACK "track"
+#define GFMMPROC_CONTROL_FORMAT_PARAM_TRACKS_AVAILABLE "tracks available"
+#define GFMMPROC_CONTROL_FORMAT_PARAM_VERSION_TYPE "version type"
+
+#define GFMMPROC_CONTROL_FORMAT_TRACK_ALL -1
+#define GFMMPROC_CONTROL_FORMAT_TRACK_DEFAULT 0
+#define GFMMPROC_CONTROL_FORMAT_TRACK_ONE 1
+
+
+#define GFMmProcControlFormatGetEstimatedBitRate(handle) \
+ ((GFMMPROC_CONTROL_FORMAT_TABLE*)handle)->MmProcControlFormatGetEstimatedBitRate(handle)
+#define GFMmProcControlFormatGetFormat(handle) \
+ ((GFMMPROC_CONTROL_FORMAT_TABLE*)handle)->MmProcControlFormatGetFormat(handle)
+#define GFMmProcControlFormatGetIntParameterValue(handle, parameter) \
+ ((GFMMPROC_CONTROL_FORMAT_TABLE*)handle)->MmProcControlFormatGetIntParameterValue(handle, parameter)
+#define GFMmProcControlFormatGetMetadataOverride(handle) \
+ ((GFMMPROC_CONTROL_FORMAT_TABLE*)handle)->MmProcControlFormatGetMetadataOverride(handle)
+#define GFMmProcControlFormatGetMetadataSupportMode(handle) \
+ ((GFMMPROC_CONTROL_FORMAT_TABLE*)handle)->MmProcControlFormatGetMetadataSupportMode(handle)
+#define GFMmProcControlFormatGetStrParameterValue(handle, parameter) \
+ ((GFMMPROC_CONTROL_FORMAT_TABLE*)handle)->MmProcControlFormatGetStrParameterValue(handle, parameter)
+#define GFMmProcControlFormatGetSupportedFormats(handle) \
+ ((GFMMPROC_CONTROL_FORMAT_TABLE*)handle)->MmProcControlFormatGetSupportedFormats(handle)
+#define GFMmProcControlFormatGetSupportedIntParameterRange(handle, parameter) \
+ ((GFMMPROC_CONTROL_FORMAT_TABLE*)handle)->MmProcControlFormatGetSupportedIntParameterRange(handle, parameter)
+#define GFMmProcControlFormatGetSupportedIntParameters(handle) \
+ ((GFMMPROC_CONTROL_FORMAT_TABLE*)handle)->MmProcControlFormatGetSupportedIntParameters(handle)
+#define GFMmProcControlFormatGetSupportedMetadataKeys(handle) \
+ ((GFMMPROC_CONTROL_FORMAT_TABLE*)handle)->MmProcControlFormatGetSupportedMetadataKeys(handle)
+#define GFMmProcControlFormatGetSupportedStrParameters(handle) \
+ ((GFMMPROC_CONTROL_FORMAT_TABLE*)handle)->MmProcControlFormatGetSupportedStrParameters(handle)
+#define GFMmProcControlFormatGetSupportedStrParameterValues(handle, parameter) \
+ ((GFMMPROC_CONTROL_FORMAT_TABLE*)handle)->MmProcControlFormatGetSupportedStrParameterValues(handle, parameter)
+#define GFMmProcControlFormatSetFormat(handle, format) \
+ ((GFMMPROC_CONTROL_FORMAT_TABLE*)handle)->MmProcControlFormatSetFormat(handle, format)
+#define GFMmProcControlFormatSetMetadata(handle, key, value) \
+ ((GFMMPROC_CONTROL_FORMAT_TABLE*)handle)->MmProcControlFormatSetMetadata(handle, key, value)
+#define GFMmProcControlFormatSetMetadataOverride(handle, override) \
+ ((GFMMPROC_CONTROL_FORMAT_TABLE*)handle)->MmProcControlFormatSetMetadataOverride(handle, override)
+#define GFMmProcControlFormatSetParameterStr(handle, parameter, value) \
+ ((GFMMPROC_CONTROL_FORMAT_TABLE*)handle)->MmProcControlFormatSetParameterStr(handle, parameter, value)
+#define GFMmProcControlFormatSetParameterInt(handle, parameter, value) \
+ ((GFMMPROC_CONTROL_FORMAT_TABLE*)handle)->MmProcControlFormatSetParameterInt(handle, parameter, value)
+
+
+
+//*****************************************************************************
+// AudioFormatControl
+//*****************************************************************************
+//
+typedef GFMMPROC_CONTROL_FORMAT_TABLE GFMMPROC_CONTROL_AUDIO_FORMAT_TABLE;
+
+
+//*****************************************************************************
+// EffectControl
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_CONTROL_EFFECT_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+ char* (*MmProcControlEffectGetPreset)(GFMMPROC_CONTROL_EFFECT handle);
+ char** (*MmProcControlEffectGetPresetNames)(GFMMPROC_CONTROL_EFFECT handle);
+ NvS32 (*MmProcControlEffectGetScope)(GFMMPROC_CONTROL_EFFECT handle);
+ NvS32 (*MmProcControlEffectIsEnabled)(GFMMPROC_CONTROL_EFFECT handle);
+ NvS32 (*MmProcControlEffectIsEnforced)(GFMMPROC_CONTROL_EFFECT handle);
+ void (*MmProcControlEffectSetEnabled)(GFMMPROC_CONTROL_EFFECT handle, NvS32 enable);
+ void (*MmProcControlEffectSetEnforced)(GFMMPROC_CONTROL_EFFECT handle, NvS32 enforced);
+ void (*MmProcControlEffectSetPreset)(GFMMPROC_CONTROL_EFFECT handle, char* preset);
+ void (*MmProcControlEffectSetScope)(GFMMPROC_CONTROL_EFFECT handle, NvS32 scope);
+
+} GFMMPROC_CONTROL_EFFECT_TABLE;
+
+#define GFMMPROC_CONTROL_EFFECT_SCOPE_LIVE_ONLY 1
+#define GFMMPROC_CONTROL_EFFECT_SCOPE_RECORD_ONLY 2
+#define GFMMPROC_CONTROL_EFFECT_SCOPE_LIVE_AND_RECORD 3
+
+#define GFMmProcControlEffectGetPreset(handle) \
+ ((GFMMPROC_CONTROL_EFFECT_TABLE*)handle)->MmProcControlEffectGetPreset(handle)
+#define GFMmProcControlEffectGetPresetNames(handle) \
+ ((GFMMPROC_CONTROL_EFFECT_TABLE*)handle)->MmProcControlEffectGetPresetNames(handle)
+#define GFMmProcControlEffectGetScope(handle) \
+ ((GFMMPROC_CONTROL_EFFECT_TABLE*)handle)->MmProcControlEffectGetScope(handle)
+#define GFMmProcControlEffectIsEnabled(handle) \
+ ((GFMMPROC_CONTROL_EFFECT_TABLE*)handle)->MmProcControlEffectIsEnabled(handle)
+#define GFMmProcControlEffectIsEnforced(handle) \
+ ((GFMMPROC_CONTROL_EFFECT_TABLE*)handle)->MmProcControlEffectIsEnforced(handle)
+#define GFMmProcControlEffectSetEnabled(handle, enable) \
+ ((GFMMPROC_CONTROL_EFFECT_TABLE*)handle)->MmProcControlEffectSetEnabled(handle, enable)
+#define GFMmProcControlEffectSetEnforced(handle, enforced) \
+ ((GFMMPROC_CONTROL_EFFECT_TABLE*)handle)->MmProcControlEffectSetEnforced(handle, enforced)
+#define GFMmProcControlEffectSetPreset(handle, preset) \
+ ((GFMMPROC_CONTROL_EFFECT_TABLE*)handle)->MmProcControlEffectSetPreset(handle, preset)
+#define GFMmProcControlEffectSetScope(handle, scope) \
+ ((GFMMPROC_CONTROL_EFFECT_TABLE*)handle)->MmProcControlEffectSetScope(handle, scope)
+
+
+//*****************************************************************************
+// EffectOrderControl
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_CONTROL_EFFECT_ORDER_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+ NvS32 (*MmProcControlEffectOrderGetEffectOrder)(GFMMPROC_CONTROL_EFFECT_ORDER handle, GFMMPROC_CONTROL_EFFECT effect);
+ GFMMPROC_CONTROL_EFFECT (*MmProcControlEffectOrderGetEffectOrders)(GFMMPROC_CONTROL_EFFECT_ORDER handle);
+ NvS32 (*MmProcControlEffectOrderSetEffectOrder)(GFMMPROC_CONTROL_EFFECT_ORDER handle, GFMMPROC_CONTROL_EFFECT effect, NvS32 order);
+
+} GFMMPROC_CONTROL_EFFECT_ORDER_TABLE;
+
+#define GFMmProcControlEffectOrderGetEffectOrder(handle, effect) \
+ ((GFMMPROC_CONTROL_EFFECT_ORDER_TABLE*)handle)->(handle, effect)
+#define GFMmProcControlEffectOrderGetEffectOrders(handle) \
+ ((GFMMPROC_CONTROL_EFFECT_ORDER_TABLE*)handle)->MmProcControlEffectOrderGetEffectOrders(handle)
+#define GFMmProcControlEffectOrderSetEffectOrder(handle, effect, order) \
+ ((GFMMPROC_CONTROL_EFFECT_ORDER_TABLE*)handle)->MmProcControlEffectOrderSetEffectOrder(handle, effect, order)
+
+
+//*****************************************************************************
+// MIDIChannelControl
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_CONTROL_MIDI_CHANNEL_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+ GFMMPROC_CONTROL (*MmProcControlMidiChannelGetChannelControl)(GFMMPROC_CONTROL_MIDI_CHANNEL handle, char* controlType, NvS32 channel);
+ GFMMPROC_CONTROL* (*MmProcControlMidiChannelGetChannelControls)(GFMMPROC_CONTROL_MIDI_CHANNEL handle, NvS32 channel);
+
+} GFMMPROC_CONTROL_MIDI_CHANNEL_TABLE;
+
+#define GFMmProcControlMidiChannelGetChannelControl(handle, controlType, channel) \
+ ((GFMMPROC_CONTROL_MIDI_CHANNEL_TABLE*)handle)->MmProcControlMidiChannelGetChannelControl(handle, controlType, channel)
+#define GFMmProcControlMidiChannelGetChannelControls(handle, channel) \
+ ((GFMMPROC_CONTROL_MIDI_CHANNEL_TABLE*)handle)->MmProcControlMidiChannelGetChannelControls(handle, channel)
+
+
+//*****************************************************************************
+// PanControl
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_CONTROL_PAN_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+ NvS32 (*MmProcControlPanGetPan)(GFMMPROC_CONTROL_PAN handle);
+ NvS32 (*MmProcControlPanSetPan)(GFMMPROC_CONTROL_PAN handle, NvS32 pan);
+
+} GFMMPROC_CONTROL_PAN_TABLE;
+
+#define GFMmProcControlPanGetPan(handle) \
+ ((GFMMPROC_CONTROL_PAN_TABLE*)handle)->MmProcControlPanGetPan(handle)
+#define GFMmProcControlPanSetPan(handle, pan) \
+ ((GFMMPROC_CONTROL_PAN_TABLE*)handle)->MmProcControlPanSetPan(handle, pan)
+
+
+//*****************************************************************************
+// PriorityControl
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_CONTROL_PRIORITY_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+ NvS32 (*MmProcControlPriorityGetPriority)(GFMMPROC_CONTROL_PRIORITY handle);
+ void (*MmProcControlPrioritySetPriority)(GFMMPROC_CONTROL_PRIORITY handle, NvS32 level);
+
+} GFMMPROC_CONTROL_PRIORITY_TABLE;
+
+#define GFMmProcControlPriorityGetPriority(handle) \
+ ((GFMMPROC_CONTROL_PRIORITY_TABLE*)handle)->MmProcControlPriorityGetPriority(handle)
+#define GFMmProcControlPrioritySetPriority(handle, level) \
+ ((GFMMPROC_CONTROL_PRIORITY_TABLE*)handle)->MmProcControlPrioritySetPriority(handle, level)
+
+
+
+//*****************************************************************************
+//*****************************************************************************
+//
+//
+// GFMMPROC_ADVANCED_AUDIO_EFFECT_CONTROLS
+//
+//
+//*****************************************************************************
+//*****************************************************************************
+
+#if defined GFMMPROC_ADVANCED_AUDIO_EFFECT_CONTROLS
+
+typedef GFMMPROC_CONTROL_EFFECT GFMMPROC_CONTROL_EFFECT_AUDIO_VIRTUALIZER;
+typedef GFMMPROC_CONTROL_EFFECT GFMMPROC_CONTROL_EFFECT_ACOUSTIC_ECHO_CANCELLATION;
+typedef GFMMPROC_CONTROL_EFFECT GFMMPROC_CONTROL_EFFECT_CHORUS;
+typedef GFMMPROC_CONTROL_EFFECT GFMMPROC_CONTROL_EFFECT_EQUALIZER;
+typedef GFMMPROC_CONTROL_EFFECT GFMMPROC_CONTROL_EFFECT_REVERB;
+typedef GFMMPROC_CONTROL_EFFECT GFMMPROC_CONTROL_EFFECT_DRC;
+typedef GFMMPROC_CONTROL GFMMPROC_CONTROL_REVERB_SOURCE;
+
+//*****************************************************************************
+// AudioVirtualizerControl
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_CONTROL_EFFECT_AUDIO_VIRTUALIZER_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+ char* (*MmProcControlEffectGetPreset)(GFMMPROC_CONTROL_EFFECT handle);
+ char** (*MmProcControlEffectGetPresetNames)(GFMMPROC_CONTROL_EFFECT handle);
+ NvS32 (*MmProcControlEffectGetScope)(GFMMPROC_CONTROL_EFFECT handle);
+ NvS32 (*MmProcControlEffectIsEnabled)(GFMMPROC_CONTROL_EFFECT handle);
+ NvS32 (*MmProcControlEffectIsEnforced)(GFMMPROC_CONTROL_EFFECT handle);
+ void (*MmProcControlEffectSetEnabled)(GFMMPROC_CONTROL_EFFECT handle, NvS32 enable);
+ void (*MmProcControlEffectSetEnforced)(GFMMPROC_CONTROL_EFFECT handle, NvS32 enforced);
+ void (*MmProcControlEffectSetPreset)(GFMMPROC_CONTROL_EFFECT handle, char* preset);
+ void (*MmProcControlEffectSetScope)(GFMMPROC_CONTROL_EFFECT handle, NvS32 scope);
+
+ NvS32 (*MmProcControlEffectAudioVirtualizerGetSpread)(GFMMPROC_CONTROL_EFFECT_AUDIO_VIRTUALIZER handle);
+ void (*MmProcControlEffectAudioVirtualizerSetSpread)(GFMMPROC_CONTROL_EFFECT_AUDIO_VIRTUALIZER handle, NvS32 width);
+
+} GFMMPROC_CONTROL_EFFECT_AUDIO_VIRTUALIZER_TABLE;
+
+#define GFMmProcControlEffectAudioVirtualizerGetSpread(handle) \
+ ((GFMMPROC_CONTROL_EFFECT_AUDIO_VIRTUALIZER_TABLE*)handle)->MmProcControlEffectAudioVirtualizerGetSpread(handle)
+#define GFMmProcControlEffectAudioVirtualizerSetSpread(handle, width) \
+ ((GFMMPROC_CONTROL_EFFECT_AUDIO_VIRTUALIZER_TABLE*)handle)->MmProcControlEffectAudioVirtualizerSetSpread(handle, width)
+
+
+//*****************************************************************************
+// AcousticEchoCancellationControl
+//*****************************************************************************
+//
+typedef GFMMPROC_CONTROL_EFFECT_TABLE GFMMPROC_CONTROL_EFFECT_ACOUSTIC_ECHO_CANCELLATION_TABLE;
+
+//*****************************************************************************
+// SBCControl
+//*****************************************************************************
+//
+typedef GFMMPROC_CONTROL_EFFECT_TABLE GFMMPROC_CONTROL_EFFECT_SBC_TABLE;
+
+//*****************************************************************************
+// SBRControl
+//*****************************************************************************
+//
+typedef GFMMPROC_CONTROL_EFFECT_TABLE GFMMPROC_CONTROL_EFFECT_SBR_TABLE;
+
+
+//*****************************************************************************
+// ChorusControl
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_CONTROL_EFFECT_CHORUS_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+ char* (*MmProcControlEffectGetPreset)(GFMMPROC_CONTROL_EFFECT handle);
+ char** (*MmProcControlEffectGetPresetNames)(GFMMPROC_CONTROL_EFFECT handle);
+ NvS32 (*MmProcControlEffectGetScope)(GFMMPROC_CONTROL_EFFECT handle);
+ NvS32 (*MmProcControlEffectIsEnabled)(GFMMPROC_CONTROL_EFFECT handle);
+ NvS32 (*MmProcControlEffectIsEnforced)(GFMMPROC_CONTROL_EFFECT handle);
+ void (*MmProcControlEffectSetEnabled)(GFMMPROC_CONTROL_EFFECT handle, NvS32 enable);
+ void (*MmProcControlEffectSetEnforced)(GFMMPROC_CONTROL_EFFECT handle, NvS32 enforced);
+ void (*MmProcControlEffectSetPreset)(GFMMPROC_CONTROL_EFFECT handle, char* preset);
+ void (*MmProcControlEffectSetScope)(GFMMPROC_CONTROL_EFFECT handle, NvS32 scope);
+
+ NvS32 (*MmProcControlEffectChorusGetAverageDelay)(GFMMPROC_CONTROL_EFFECT_CHORUS handle);
+ NvS32 (*MmProcControlEffectChorusGetMaxAverageDelay)(GFMMPROC_CONTROL_EFFECT_CHORUS handle);
+ NvS32 (*MmProcControlEffectChorusGetMaxModulationDepth)(GFMMPROC_CONTROL_EFFECT_CHORUS handle);
+ NvS32 (*MmProcControlEffectChorusGetMaxModulationRate)(GFMMPROC_CONTROL_EFFECT_CHORUS handle);
+ NvS32 (*MmProcControlEffectChorusGetMinModulationRate)(GFMMPROC_CONTROL_EFFECT_CHORUS handle);
+ NvS32 (*MmProcControlEffectChorusGetModulationDepth)(GFMMPROC_CONTROL_EFFECT_CHORUS handle);
+ NvS32 (*MmProcControlEffectChorusGetModulationRate)(GFMMPROC_CONTROL_EFFECT_CHORUS handle);
+ NvS32 (*MmProcControlEffectChorusGetWetLevel)(GFMMPROC_CONTROL_EFFECT_CHORUS handle);
+ void (*MmProcControlEffectChorusSetAverageDelay)(GFMMPROC_CONTROL_EFFECT_CHORUS handle, NvS32 delay);
+ void (*MmProcControlEffectChorusSetModulationDepth)(GFMMPROC_CONTROL_EFFECT_CHORUS handle, NvS32 depth);
+ void (*MmProcControlEffectChorusSetModulationRate)(GFMMPROC_CONTROL_EFFECT_CHORUS handle, NvS32 rate);
+ NvS32 (*MmProcControlEffectChorusSetWetLevel)(GFMMPROC_CONTROL_EFFECT_CHORUS handle, NvS32 level);
+
+} GFMMPROC_CONTROL_EFFECT_CHORUS_TABLE;
+
+#define GFMmProcControlEffectChorusGetAverageDelay(handle) \
+ ((GFMMPROC_CONTROL_EFFECT_CHORUS_TABLE*)handle)->MmProcControlEffectChorusGetAverageDelay(handle)
+#define GFMmProcControlEffectChorusGetMaxAverageDelay(handle) \
+ ((GFMMPROC_CONTROL_EFFECT_CHORUS_TABLE*)handle)->MmProcControlEffectChorusGetMaxAverageDelay(handle)
+#define GFMmProcControlEffectChorusGetMaxModulationDepth(handle) \
+ ((GFMMPROC_CONTROL_EFFECT_CHORUS_TABLE*)handle)->MmProcControlEffectChorusGetMaxModulationDepth(handle)
+#define GFMmProcControlEffectChorusGetMaxModulationRate(handle) \
+ ((GFMMPROC_CONTROL_EFFECT_CHORUS_TABLE*)handle)->MmProcControlEffectChorusGetMaxModulationRate(handle)
+#define GFMmProcControlEffectChorusGetMinModulationRate(handle) \
+ ((GFMMPROC_CONTROL_EFFECT_CHORUS_TABLE*)handle)->MmProcControlEffectChorusGetMinModulationRate(handle)
+#define GFMmProcControlEffectChorusGetModulationDepth(handle) \
+ ((GFMMPROC_CONTROL_EFFECT_CHORUS_TABLE*)handle)->MmProcControlEffectChorusGetModulationDepth(handle)
+#define GFMmProcControlEffectChorusGetModulationRate(handle) \
+ ((GFMMPROC_CONTROL_EFFECT_CHORUS_TABLE*)handle)->MmProcControlEffectChorusGetModulationRate(handle)
+#define GFMmProcControlEffectChorusGetWetLevel(handle) \
+ ((GFMMPROC_CONTROL_EFFECT_CHORUS_TABLE*)handle)->MmProcControlEffectChorusGetWetLevel(handle)
+#define GFMmProcControlEffectChorusSetAverageDelay(handle, delay) \
+ ((GFMMPROC_CONTROL_EFFECT_CHORUS_TABLE*)handle)->MmProcControlEffectChorusSetAverageDelay(handle, delay)
+#define GFMmProcControlEffectChorusSetModulationDepth(handle, depth) \
+ ((GFMMPROC_CONTROL_EFFECT_CHORUS_TABLE*)handle)->MmProcControlEffectChorusSetModulationDepth(handle, depth)
+#define GFMmProcControlEffectChorusSetModulationRate(handle, rate) \
+ ((GFMMPROC_CONTROL_EFFECT_CHORUS_TABLE*)handle)->MmProcControlEffectChorusSetModulationRate(handle, rate)
+#define GFMmProcControlEffectChorusSetWetLevel(handle, level) \
+ ((GFMMPROC_CONTROL_EFFECT_CHORUS_TABLE*)handle)->MmProcControlEffectChorusSetWetLevel(handle, level)
+
+
+//*****************************************************************************
+// EqualizerControl
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_CONTROL_EFFECT_EQUALIZER_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+ char* (*MmProcControlEffectGetPreset)(GFMMPROC_CONTROL_EFFECT handle);
+ char** (*MmProcControlEffectGetPresetNames)(GFMMPROC_CONTROL_EFFECT handle);
+ NvS32 (*MmProcControlEffectGetScope)(GFMMPROC_CONTROL_EFFECT handle);
+ NvS32 (*MmProcControlEffectIsEnabled)(GFMMPROC_CONTROL_EFFECT handle);
+ NvS32 (*MmProcControlEffectIsEnforced)(GFMMPROC_CONTROL_EFFECT handle);
+ void (*MmProcControlEffectSetEnabled)(GFMMPROC_CONTROL_EFFECT handle, NvS32 enable);
+ void (*MmProcControlEffectSetEnforced)(GFMMPROC_CONTROL_EFFECT handle, NvS32 enforced);
+ void (*MmProcControlEffectSetPreset)(GFMMPROC_CONTROL_EFFECT handle, char* preset);
+ void (*MmProcControlEffectSetScope)(GFMMPROC_CONTROL_EFFECT handle, NvS32 scope);
+
+ NvS32 (*MmProcControlEffectEqualizerGetBand)(GFMMPROC_CONTROL_EFFECT_EQUALIZER handle, NvS32 frequency);
+ NvS32 (*MmProcControlEffectEqualizerGetBandLevel)(GFMMPROC_CONTROL_EFFECT_EQUALIZER handle, NvS32 band);
+ NvS32 (*MmProcControlEffectEqualizerGetBass)(GFMMPROC_CONTROL_EFFECT_EQUALIZER handle);
+ NvS32 (*MmProcControlEffectEqualizerGetCenterFreq)(GFMMPROC_CONTROL_EFFECT_EQUALIZER handle, NvS32 band);
+ NvS32 (*MmProcControlEffectEqualizerGetMaxBandLevel)(GFMMPROC_CONTROL_EFFECT_EQUALIZER handle);
+ NvS32 (*MmProcControlEffectEqualizerGetMinBandLevel)(GFMMPROC_CONTROL_EFFECT_EQUALIZER handle);
+ NvS32 (*MmProcControlEffectEqualizerGetNumberOfBands)(GFMMPROC_CONTROL_EFFECT_EQUALIZER handle);
+ NvS32 (*MmProcControlEffectEqualizerGetTreble)(GFMMPROC_CONTROL_EFFECT_EQUALIZER handle);
+ void (*MmProcControlEffectEqualizerSetBandLevel)(GFMMPROC_CONTROL_EFFECT_EQUALIZER handle, NvS32 level, NvS32 band);
+ NvS32 (*MmProcControlEffectEqualizerSetBass)(GFMMPROC_CONTROL_EFFECT_EQUALIZER handle, NvS32 level);
+ NvS32 (*MmProcControlEffectEqualizerSetTreble)(GFMMPROC_CONTROL_EFFECT_EQUALIZER handle, NvS32 level);
+ NvS32 (*MmProcControlEffectEqualizerSetBandX)(GFMMPROC_CONTROL_EFFECT_EQUALIZER handle, NvS32 *levelptr);
+
+} GFMMPROC_CONTROL_EFFECT_EQUALIZER_TABLE;
+
+#define GFMMPROC_CONTROL_EFFECT_EQUALIZER_UNDEFINED -1004
+
+#define GFMmProcControlEffectEqualizerGetBand(handle, frequency) \
+ ((GFMMPROC_CONTROL_EFFECT_EQUALIZER_TABLE*)handle)->(handle, frequency)
+#define GFMmProcControlEffectEqualizerGetBandLevel(handle, band) \
+ ((GFMMPROC_CONTROL_EFFECT_EQUALIZER_TABLE*)handle)->MmProcControlEffectEqualizerGetBandLevel(handle, band)
+#define GFMmProcControlEffectEqualizerGetBass(handle) \
+ ((GFMMPROC_CONTROL_EFFECT_EQUALIZER_TABLE*)handle)->MmProcControlEffectEqualizerGetBass(handle)
+#define GFMmProcControlEffectEqualizerGetCenterFreq(handle, band) \
+ ((GFMMPROC_CONTROL_EFFECT_EQUALIZER_TABLE*)handle)->MmProcControlEffectEqualizerGetCenterFreq(handle, band)
+#define GFMmProcControlEffectEqualizerGetMaxBandLevel(handle) \
+ ((GFMMPROC_CONTROL_EFFECT_EQUALIZER_TABLE*)handle)->MmProcControlEffectEqualizerGetMaxBandLevel(handle)
+#define GFMmProcControlEffectEqualizerGetMinBandLevel(handle) \
+ ((GFMMPROC_CONTROL_EFFECT_EQUALIZER_TABLE*)handle)->MmProcControlEffectEqualizerGetMinBandLevel(handle)
+#define GFMmProcControlEffectEqualizerGetNumberOfBands(handle) \
+ ((GFMMPROC_CONTROL_EFFECT_EQUALIZER_TABLE*)handle)->MmProcControlEffectEqualizerGetNumberOfBands(handle)
+#define GFMmProcControlEffectEqualizerGetTreble(handle) \
+ ((GFMMPROC_CONTROL_EFFECT_EQUALIZER_TABLE*)handle)->MmProcControlEffectEqualizerGetTreble(handle)
+#define GFMmProcControlEffectEqualizerSetBandLevel(handle, level, band) \
+ ((GFMMPROC_CONTROL_EFFECT_EQUALIZER_TABLE*)handle)->MmProcControlEffectEqualizerSetBandLevel(handle, level, band)
+#define GFMmProcControlEffectEqualizerSetBass(handle, level) \
+ ((GFMMPROC_CONTROL_EFFECT_EQUALIZER_TABLE*)handle)->MmProcControlEffectEqualizerSetBass(handle, level)
+#define GFMmProcControlEffectEqualizerSetTreble(handle, level) \
+ ((GFMMPROC_CONTROL_EFFECT_EQUALIZER_TABLE*)handle)->MmProcControlEffectEqualizerSetTreble(handle, level)
+#define GFMmProcControlEffectEqualizerSetBandX(handle, levelptr) \
+ ((GFMMPROC_CONTROL_EFFECT_EQUALIZER_TABLE*)handle)->MmProcControlEffectEqualizerSetBandX(handle, levelptr)
+
+
+//*****************************************************************************
+// Dynamic Range Control (DRC)
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_CONTROL_EFFECT_DRC_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+
+ char* (*MmProcControlEffectGetPreset)(GFMMPROC_CONTROL_EFFECT handle);
+ char** (*MmProcControlEffectGetPresetNames)(GFMMPROC_CONTROL_EFFECT handle);
+ NvS32 (*MmProcControlEffectGetScope)(GFMMPROC_CONTROL_EFFECT handle);
+ NvS32 (*MmProcControlEffectIsEnabled)(GFMMPROC_CONTROL_EFFECT handle);
+ NvS32 (*MmProcControlEffectIsEnforced)(GFMMPROC_CONTROL_EFFECT handle);
+ void (*MmProcControlEffectSetEnabled)(GFMMPROC_CONTROL_EFFECT handle, NvS32 enable);
+ void (*MmProcControlEffectSetEnforced)(GFMMPROC_CONTROL_EFFECT handle, NvS32 enforced);
+ void (*MmProcControlEffectSetPreset)(GFMMPROC_CONTROL_EFFECT handle, char* preset);
+ void (*MmProcControlEffectSetScope)(GFMMPROC_CONTROL_EFFECT handle, NvS32 scope);
+
+ NvS32 (*MmProcControlEffectDRCGetDRCEnable)(GFMMPROC_CONTROL_EFFECT_DRC handle);
+ void (*MmProcControlEffectDRCSetDRCEnable)(GFMMPROC_CONTROL_EFFECT_DRC handle, NvS32 Param);
+ NvS32 (*MmProcControlEffectDRCGetNoiseGateTh)(GFMMPROC_CONTROL_EFFECT_DRC handle);
+ void (*MmProcControlEffectDRCSetNoiseGateTh)(GFMMPROC_CONTROL_EFFECT_DRC handle, NvS32 Param);
+ NvS32 (*MmProcControlEffectDRCGetLowerCompTh)(GFMMPROC_CONTROL_EFFECT_DRC handle);
+ void (*MmProcControlEffectDRCSetLowerCompTh)(GFMMPROC_CONTROL_EFFECT_DRC handle, NvS32 Param);
+ NvS32 (*MmProcControlEffectDRCGetUpperCompTh)(GFMMPROC_CONTROL_EFFECT_DRC handle);
+ void (*MmProcControlEffectDRCSetUpperCompTh)(GFMMPROC_CONTROL_EFFECT_DRC handle, NvS32 Param);
+ NvS32 (*MmProcControlEffectDRCGetClipTh)(GFMMPROC_CONTROL_EFFECT_DRC handle);
+ void (*MmProcControlEffectDRCSetClipTh)(GFMMPROC_CONTROL_EFFECT_DRC handle, NvS32 Param);
+} GFMMPROC_CONTROL_EFFECT_DRC_TABLE;
+
+#define GFMmProcControlEffectDRCGetDRCEnable(handle) \
+ ((GFMMPROC_CONTROL_EFFECT_DRC_TABLE*)handle)->MmProcControlEffectDRCGetDRCEnable(handle)
+#define GFMmProcControlEffectDRCSetDRCEnable(handle, Param) \
+ ((GFMMPROC_CONTROL_EFFECT_DRC_TABLE*)handle)->MmProcControlEffectDRCSetDRCEnable(handle, Param)
+#define GFMmProcControlEffectDRCGetNoiseGateTh(handle) \
+ ((GFMMPROC_CONTROL_EFFECT_DRC_TABLE*)handle)->MmProcControlEffectDRCGetNoiseGateTh(handle)
+#define GFMmProcControlEffectDRCSetNoiseGateTh(handle, Param) \
+ ((GFMMPROC_CONTROL_EFFECT_DRC_TABLE*)handle)->MmProcControlEffectDRCSetNoiseGateTh(handle, Param)
+#define GFMmProcControlEffectDRCGetLowerCompTh(handle) \
+ ((GFMMPROC_CONTROL_EFFECT_DRC_TABLE*)handle)->MmProcControlEffectDRCGetLowerCompTh(handle)
+#define GFMmProcControlEffectDRCSetLowerCompTh(handle, Param) \
+ ((GFMMPROC_CONTROL_EFFECT_DRC_TABLE*)handle)->MmProcControlEffectDRCSetLowerCompTh(handle, Param)
+#define GFMmProcControlEffectDRCGetUpperCompTh(handle) \
+ ((GFMMPROC_CONTROL_EFFECT_DRC_TABLE*)handle)->MmProcControlEffectDRCGetUpperCompTh(handle)
+#define GFMmProcControlEffectDRCSetUpperCompTh(handle, Param) \
+ ((GFMMPROC_CONTROL_EFFECT_DRC_TABLE*)handle)->MmProcControlEffectDRCSetUpperCompTh(handle, Param)
+#define GFMmProcControlEffectDRCGetClipTh(handle) \
+ ((GFMMPROC_CONTROL_EFFECT_DRC_TABLE*)handle)->MmProcControlEffectDRCGetClipTh(handle)
+#define GFMmProcControlEffectDRCSetClipTh(handle, Param) \
+ ((GFMMPROC_CONTROL_EFFECT_DRC_TABLE*)handle)->MmProcControlEffectDRCSetClipTh(handle, Param)
+
+
+
+
+//*****************************************************************************
+// ReverbControl
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_CONTROL_EFFECT_REVERB_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+ char* (*MmProcControlEffectGetPreset)(GFMMPROC_CONTROL_EFFECT handle);
+ char** (*MmProcControlEffectGetPresetNames)(GFMMPROC_CONTROL_EFFECT handle);
+ NvS32 (*MmProcControlEffectGetScope)(GFMMPROC_CONTROL_EFFECT handle);
+ NvS32 (*MmProcControlEffectIsEnabled)(GFMMPROC_CONTROL_EFFECT handle);
+ NvS32 (*MmProcControlEffectIsEnforced)(GFMMPROC_CONTROL_EFFECT handle);
+ void (*MmProcControlEffectSetEnabled)(GFMMPROC_CONTROL_EFFECT handle, NvS32 enable);
+ void (*MmProcControlEffectSetEnforced)(GFMMPROC_CONTROL_EFFECT handle, NvS32 enforced);
+ void (*MmProcControlEffectSetPreset)(GFMMPROC_CONTROL_EFFECT handle, char* preset);
+ void (*MmProcControlEffectSetScope)(GFMMPROC_CONTROL_EFFECT handle, NvS32 scope);
+
+ NvS32 (*MmProcControlEffectReverbGetReverbLevel)(GFMMPROC_CONTROL_EFFECT_REVERB handle);
+ NvS32 (*MmProcControlEffectReverbGetReverbTime)(GFMMPROC_CONTROL_EFFECT_REVERB handle);
+ NvS32 (*MmProcControlEffectReverbSetReverbLevel)(GFMMPROC_CONTROL_EFFECT_REVERB handle, NvS32 level);
+ void (*MmProcControlEffectReverbSetReverbTime)(GFMMPROC_CONTROL_EFFECT_REVERB handle, NvS32 time);
+
+} GFMMPROC_CONTROL_EFFECT_REVERB_TABLE;
+
+#define GFMmProcControlEffectReverbGetReverbLevel(handle) \
+ ((GFMMPROC_CONTROL_EFFECT_REVERB_TABLE*)handle)->MmProcControlEffectReverbGetReverbLevel(handle)
+#define GFMmProcControlEffectReverbGetReverbTime(handle) \
+ ((GFMMPROC_CONTROL_EFFECT_REVERB_TABLE*)handle)->MmProcControlEffectReverbGetReverbTime(handle)
+#define GFMmProcControlEffectReverbSetReverbLevel(handle, level) \
+ ((GFMMPROC_CONTROL_EFFECT_REVERB_TABLE*)handle)->MmProcControlEffectReverbSetReverbLevel(handle, level)
+#define GFMmProcControlEffectReverbSetReverbTime(handle, time) \
+ ((GFMMPROC_CONTROL_EFFECT_REVERB_TABLE*)handle)->MmProcControlEffectReverbSetReverbTime(handle, time)
+
+
+//*****************************************************************************
+// ReverbSourceControl
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_CONTROL_REVERB_SOURCE_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+ NvS32 (*MmProcControlReverbSourceGetRoomLevel)(GFMMPROC_CONTROL_REVERB_SOURCE handle);
+ void (*MmProcControlReverbSourceSetRoomLevel)(GFMMPROC_CONTROL_REVERB_SOURCE handle, NvS32 level);
+
+} GFMMPROC_CONTROL_REVERB_SOURCE_TABLE;
+
+#define GFMMPROC_CONTROL_REVERB_SOURCE_DISCONNECT -2147483648
+
+#define GFMmProcControlReverbSourceGetRoomLevel(handle) \
+ ((GFMMPROC_CONTROL_REVERB_SOURCE_TABLE*)handle)->MmProcControlReverbSourceGetRoomLevel(handle)
+#define GFMmProcControlReverbSourceSetRoomLevel(handle, level) \
+ ((GFMMPROC_CONTROL_REVERB_SOURCE_TABLE*)handle)->MmProcControlReverbSourceSetRoomLevel(handle, level)
+
+
+
+#endif // GFMMPROC_ADVANCED_AUDIO_EFFECT_CONTROLS
+
+#endif // GFMMPROC_ADVANCED_CONTROLS
+
+#endif // GFMMPROC_ADVANCED
+
+/*@}*/
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
diff --git a/Start_WM/test6/inc/GFMxDec.h b/Start_WM/test6/inc/GFMxDec.h
new file mode 100755
index 00000000..78cc7c5c
--- /dev/null
+++ b/Start_WM/test6/inc/GFMxDec.h
@@ -0,0 +1,727 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+*
+* NVIDIA Corporation and its licensors retain all intellectual property
+* and proprietary rights in and to this software, related documentation
+* and any modifications thereto. Any use, reproduction, disclosure or
+* distribution of this software and related documentation without an
+* express license agreement from NVIDIA Corporation is strictly prohibited.
+*/
+
+/** @file GFMxDec.h
+GFSDK MPEG Decode API header file.
+*/
+
+#ifndef _GF_MPEG_DEC__
+#define _GF_MPEG_DEC__
+
+#include "nvtypes.h"
+#include "GFVx.h"
+#include "GFDef.h"
+
+#ifdef __cplusplus
+extern "C" { // only need to export C interface if
+ // used by C++ source code
+#endif
+
+ /** @addtogroup groupMxDec MxDecAPI MPEG Decode API
+
+ @ref pageMxDecAppNotes
+
+ @ref pageMxDecAppNotes1
+
+
+ */
+ /*@{*/
+
+ /****************************************************************************************************/
+ // MXDECCapFlags
+ /** MxDecAPI property flag: Support for Simple Profile.
+ @see GFMXDECTABLE::MxDecGetProperty, GFPROPERTY::Capability
+ */
+#define GF_MXDEC_CAP_SIMPLE 0x00000001
+ /** MxDecAPI property flag: Support for simple profile.
+ @see GFMXDECTABLE::MxDecGetProperty, GFPROPERTY::Capability
+ */
+
+#define GF_MXDEC_CAP_SCALE 0x00000002
+ /** MxDecAPI property flag: Support for simple scale profile.
+ @see GFMXDECTABLE::MxDecGetProperty, GFPROPERTY::Capability
+ */
+
+#define GF_MXDEC_CAP_CORE 0x00000004
+ /** MxDecAPI property flag: Support for CORE profile.
+ @see GFMXDECTABLE::MxDecGetProperty, GFPROPERTY::Capability
+ */
+
+#define GF_MXDEC_CAP_MAIN 0x00000008
+ /** MxDecAPI property flag: Support for MAIN profile.
+ @see GFMXDECTABLE::MxDecGetProperty, GFPROPERTY::Capability
+ */
+
+ /** MxDecAPI property flag: Support for N_bit profile.
+ @see GFMXDECTABLE::MxDecGetProperty, GFPROPERTY::Capability
+ */
+#define GF_MXDEC_CAP_N_BIT 0x00000010
+
+ /** MxDecAPI property flag: Support for LEVEL 1.
+ @see GFMXDECTABLE::MxDecGetProperty, GFPROPERTY::Capability
+ */
+#define GF_MXDEC_CAP_LEVEL1 0x00000100
+
+ /** MxDecAPI property flag: Support for LEVEL 2.
+ @see GFMXDECTABLE::MxDecGetProperty, GFPROPERTY::Capability
+ */
+#define GF_MXDEC_CAP_LEVEL2 0x00000200
+
+ /** MxDecAPI property flag: Support for LEVEL 3.
+ @see GFMXDECTABLE::MxDecGetProperty, GFPROPERTY::Capability
+ */
+#define GF_MXDEC_CAP_LEVEL3 0x00000400
+
+ /** MxDecAPI property flag: Support for LEVEL 4.
+ @see GFMXDECTABLE::MxDecGetProperty, GFPROPERTY::Capability
+ */
+#define GF_MXDEC_CAP_LEVEL4 0x00000800
+
+ /** MxDecAPI property flag: Support for Post Processing's de-blocking.
+ @see GFMXDECTABLE::MxDecGetProperty, GFPROPERTY::Capability
+ */
+#define GF_MXDEC_CAP_DB 0x00001000
+
+ /** MxDecAPI property flag: Support for Post Processing's de-ringing.
+ @see GFMXDECTABLE::MxDecGetProperty, GFPROPERTY::Capability
+ */
+#define GF_MXDEC_CAP_DR 0x00002000
+
+ /****************************************************************************************************/
+ /** This structure holds the video object plane (VOP) information. */
+ typedef struct _GFMXDECVOP
+ {
+ NvU32 uiVOPinfo; /**< Set new VOP information */
+ NvU32 uiFFORWARD; /**< FCODE_FORWARD, ignore this value if it is I frame */
+ PGFRMSURFACE pRef; /**< Reference VOP, ignore this item, if current VOP is an I */
+ PGFRMSURFACE pCur; /**< Current VOP */
+ PGFRECT pRefRect; /**< Specifies a rectangular area within the pRef surface for the
+ GFMxDecAPI to use with the reference image. This field only takes
+ effect when MXDEC_VOP_SPECIFY_REFSURF_RECT is set. The rectangles
+ top and left should be aligned by the application, which should call
+ GFMxDecGetAttribute() with MXDEC_ATTR_MP4_DEC_VOP_RECT_TOP_ALIGNMENT
+ and MXDEC_ATTR_MP4_DEC_VOP_RECT_LEFT_ALIGNMENT to get the required
+ alignment. The rectangle's width and height should exactly match the
+ image width and height that is encoded in the bit stream. */
+
+ PGFRECT pCurRect; /**< Specifies a rectangular area of the pCur surface within which the
+ GFMxDecAPI should place the decoded image output. This field only takes
+ effect if MXDEC_VOP_SPECIFY_CURSURF_RECT is set. The rectangles top and
+ left should be aligned by the application, which should call GFMxDecGetAttribute()
+ with MXDEC_ATTR_MP4_DEC_VOP_RECT_TOP_ALIGNMENT and
+ MXDEC_ATTR_MP4_DEC_VOP_RECT_LEFT_ALIGNMENT to get the required alignment.
+ The rectangle's width and height should exactly match the image width and
+ height that is encoded in the bit stream. */
+ }GFMXDECVOP, *PGFMXDECVOP;
+
+ /****************************************************************************************************/
+ //uiVOPinfo values
+ /** GFMXDECVOP::uiVOPinfo : If set, this is P VOP. If unset, it is I VOP.
+ @see GFMXDECVOP, GFMXDECTABLE::MxDecSetVOP */
+#define MXDEC_VOP_P_VOP 0x1
+
+ /** GFMXDECVOP::uiVOPinfo : This parameter comes as a part of the bitstream.
+ This indicates that rounding should be performed while doing Motion Compensation.
+ @see GFMXDECVOP, GFMXDECTABLE::MxDecSetVOP */
+#define MXDEC_VOP_ROUNDING_ONE 0x2
+
+ /** GFMXDECVOP::uiVOPinfo : If set, this bitstream is short video header format.
+ @see GFMXDECVOP, GFMXDECTABLE::MxDecSetVOP */
+#define MXDEC_VOP_SHORT_HEADER 0x4
+
+ /** GFMXDECVOP::uiVOPinfo : If set, If this flag is set, pRefSurfRect must be set.
+ GFMxDec will reference image in pRefSurfRect area of pRef surface. Otherwise, GFMxDec will reference the whole pRef surface area.
+ @see GFMXDECVOP, GFMXDECTABLE::MxDecSetVOP */
+#define MXDEC_VOP_SPECIFY_REFSURF_RECT 0x8
+
+ /** GFMXDECVOP::uiVOPinfo : If this flag is set, pCurSurfRect must be set. GFMxDec will output decoded image to
+ pCurSurfRect area of pCur surface. Otherwise, GFMxDec will output to pCur surface starting from top left corner , the width and
+ height are equal to pCur surface width and height.
+ @see GFMXDECVOP, GFMXDECTABLE::MxDecSetVOP */
+#define MXDEC_VOP_SPECIFY_CURSURF_RECT 0x10
+
+ /****************************************************************************************************/
+ /** This structure holds the postprocessing information. */
+ typedef struct _GFMXDECPP
+ {
+ PGFRMSURFACE* pDestSurf; /**< Pointer to an array of surfaces that will hold the result from Post Processing
+ pointer to an array of surfaces to accommodate auto post processing. */
+ PGFRMSURFACE* pSrcSurf; /**< Pointer to an array of surfaces to be post processed pointer to an array of surfaces
+ to accommodate auto post processing. */
+ PGFRECT pRect; /**< Rectangular area to be processed for both source and destination surfaces.
+ @see GFRECT */
+ NvU32 numofDestSurf; /**< Number of Destination Surfaces. If MXDEC_PP_AUTO flag is set, this parameter must be filled. */
+ NvU32 numofSrcSurf; /**< Number of Source Surfaces. If MXDEC_PP_AUTO flag is set, this parameter must be filled. */
+ NvU8 * lpQuantiser; /**< Pointer to array of quantization steps (QPs) for macroblocks in
+ the source VOP. The GFMxDecAPI automatically saved the last
+ two decoded VOPs QP tables. The application may not need to
+ reload the table if it can make sure the source VOP is one of the
+ last decoded VOPs. This field must be filled if
+ MXDEC_PP_RELOAD_QUANTIZER is set. */
+ NvU32 PPOption; /**< Post-processing option. */
+ /**<
+ #MXDEC_PP_DB_ON
+ Turn on DeBlocking filter for this frame
+ #MXDEC_PP_DR_ON
+ Turn on DeRinging filter for this frame
+ #MXDEC_PP_AUTO
+ Auto trigger Post Processing by Hardware
+ #MXDEC_PP_RELOAD_QUANTIZER
+ Reload the source VOP's qunantizers
+ #MXDEC_PP_OP_ASYNC
+ Enables ASYNC mode
+
+ */
+ } GFMXDECPP, *PGFMXDECPP;
+
+ /****************************************************************************************************/
+ // PPOption
+ /** GFMXDECPP::PPOption : Turn on DeBlocking filter for this frame.
+ @see GFMXDECPP, GFMXDECTABLE::MxDecPostProcessing */
+#define MXDEC_PP_DB_ON 0x1
+
+ /** GFMXDECPP::PPOption : Turn on DeRinging filter for this frame.
+ @see GFMXDECPP, GFMXDECTABLE::MxDecPostProcessing */
+#define MXDEC_PP_DR_ON 0x2
+
+ /** GFMXDECPP::PPOption : Auto trigger Post Processing by Hardware.
+ @see GFMXDECPP, GFMXDECTABLE::MxDecPostProcessing */
+#define MXDEC_PP_AUTO 0x4
+
+ /** GFMXDECPP::PPOption : Reload the source VOP's qunantizers.
+ @see GFMXDECPP, GFMXDECTABLE::MxDecPostProcessing */
+#define MXDEC_PP_RELOAD_QUANTIZER 0x8
+
+ /** GFMXDECPP::PPOption : enables ASYN mode. GFMxDecPostProcessing()
+ will return after pushing the commands but without waiting for them to
+ complete. This option is useful to achieve some paralellism because
+ post-processed frame is usually not used right away for rendering. So
+ there is enough time for hardware to complete the decoding before this
+ frame will be used by app. It is ok to call PostProcessing even when
+ decoding of this frame is not complete. Inside GPU, hardware synchronizes
+ with the decoder.
+ @see GFMXDECPP, GFMXDECTABLE::MxDecPostProcessing */
+#define MXDEC_PP_OP_ASYNC 0x00000010
+
+ /****************************************************************************************************/
+ //pStatus
+ /** Argument pStatus in GFMxDecGetStatus() : GFMxDecGetStatus() can be called by the application to indicate whether 1 frame
+ has been decoded or not.
+ @see GFMXDECTABLE::MxDecGetStatus */
+#define GF_DECODER_FRAME_DONE 0x00000010
+
+ /** Argument pStatus in GFMxDecGetStatus() : GFMxDecGetStatus() can be called by the application to indicate whether post-processing
+ engine is done with the frame or not.
+ @see GFMXDECTABLE::MxDecGetStatus */
+#define GF_DECODER_PP_FRAME_DONE 0x00000020
+
+ /****************************************************************************************************/
+ /** GFMxDecSet::uiFeature : Application sets this attribute to register a callback function and
+ its correpnding parameter to read bitstream data */
+#define MXDEC_SET_READBITSTREAM 1
+
+ /** GFMxDecSet::uiFeature Application needs to set this flag in order to send MPEG4 bitstream data in Prefill Mode;
+ When this is set:
+ - application does not need to register any bitstream-read callback function as data will be fed upfront.
+ - application needs to set an attribute MXDEC_ATTR_PRE_DETERMINED_BOUNDARY to indicate that data will be fed on frame boundary.
+ @see GFMXDECTABLE::MxDecSet */
+#define GFMXDEC_OPTION_PREFILLBUFFER 0x00000002
+
+ /****************************************************************************************************/
+ /** Structure holding the callback function pointer.
+ Used in registering the callback function
+ The callback function is a function which the API calls to request a portion of the bit stream from the application.
+ @see GFMXDECTABLE::MxDecSet
+ */
+ typedef struct _GFMXDECCALLBACK
+ {
+ void *pPara; /**< pPara is a parameter passed from application and the application
+ wants the API to callback with this parameter. */
+ NvU32 (*pCallBack)(void * pPara, NvU8 ** ppBuffer, NvS32 * BufferLength, NvU32 uFlag);
+ /**<
+ Application callback function pointer.
+ Register a callback function for fetching MPEG stream data.
+
+ If application set MXDEC_ATTR_PRE_DETERMINED_BOUNDARY, application should
+ return MXDEC_BOUNDARY_REACHED when the boundary is detected.
+ If APP does not set MXDEC_ATTR_PRE_DETERMINED_BOUNDARY, 0 should be returned.
+
+ @param *pPara Parameter to pass on to application callback function
+ @param ppBuffer Buffer Pointer
+ @param BufferLength Parameter to pass on to application callback function
+ @param uFlag Flag for reading bitstream backward/forward.
+
+ #MXDEC_READ_BITSTREAM_FORWARD
+ Read bitstream in forward direction
+ #MXDEC_READ_BITSTREAM_BACKWARD
+ Read bitstream in backward direction
+
+
+ @retval The number of bytes read successfully, 0 if no bytes read.
+ */
+ }GFMXDECCALLBACK, *PGFMXDECCALLBACK;
+
+ /****************************************************************************************************/
+ /** Returned by application when MXDEC_ATTR_PRE_DETERMINED_BOUNDARY is set and boundary is detected. */
+#define MXDEC_BOUNDARY_REACHED 0x00000001
+
+ // for backward/forward reading bitstream flags
+ /** Read bitstream in forward direction.
+ @see GFMXDECCALLBACK
+ */
+#define MXDEC_READ_BITSTREAM_FORWARD 0x00000002
+
+ /** Read bitstream in backward direction.
+ @see GFMXDECCALLBACK
+ */
+#define MXDEC_READ_BITSTREAM_BACKWARD 0x00000003
+
+ /****************************************************************************************************/
+ //uiVOLinfo
+ /** GFMXDECMP4SETVOL::uiVOLinfo : If set indicates that VOL is in short header format.
+ @see GFMXDECMP4SETVOL*/
+#define MXDEC_MP4_SET_SHORT_HEADER 0x00000001
+
+ /****************************************************************************************************/
+ /** This structure hold information of the PreFill buffer.
+ */
+ typedef struct _GFMXDECPREFILLBUFFER
+ {
+ NvU8* pPreFillBuffer; /**< Input, Prefill buffer pointer filled by application. */
+ NvU32 PreFillBufferLength; /**< Input, Length of pref-fill buffer. */
+ NvU32 PreFillBufferBytesConsumed; /**< Output, Amount of bytes consumed by the component. */
+ NvU32 prefill_enabled; /**< Flag to identify if prefill buffer is supplied by application. */
+ } GFMXDECPREFILLBUFFER;
+
+ /****************************************************************************************************/
+ /** This structure hold the information needed for decoding a Video Object Layer (VOL).
+ @see GFMXDECTABLE::MxDecMP4DecVOL */
+ typedef struct _GFMXDECMP4DECVOL
+ {
+ NvU32 uiVOLinfo; /**< Indicates format of the VOL. Set by API. */
+ /**<
+ #MXDEC_MP4_SHORT_HEADER
+ Short header format detected
+ #MXDEC_MP4_DATA_PARTITION
+ Data Partitioning mode detected
+ #MXDEC_MP4_PROFILE_LEVEL
+ Profile and level field is valid
+ #MXDEC_MP4_PRIORITY
+ Priority field is valid
+ #MXDEC_MP4_VSOTYPE
+ Visual object type field is valid
+ #MXDEC_MP4_VIDEO_SIGNAL
+ VideoFormat and VideoRange fields are valid
+ #MXDEC_MP4_COLOR_DESCRIPTION
+ Color, Transfer and Matrix fields are valid
+ #MXDEC_MP4_VOID
+ VObjectID field is valid
+ #MXDEC_MP4_VOLID
+ VOLID field is valid
+
+ */
+ NvU32 uiWidth; /**< Display width, set by API */
+ NvU32 uiHeight; /**< Display height, set by API */
+ unsigned int Profile; /**< Mpeg4 Profile. Set by API.*/
+ /**<
+ #MXDEC_MP4_SIMPLE_PROFILE Profile is simple profile
+ #MXDEC_MP4_ADVANCE_SIMPLE_PROFILE Profile is advance simple profile
+
+ */
+ unsigned int Level; /**< Mpeg4 Level. Set by API. */
+ unsigned int VObjectID; /**< Video Object ID. Set by API. */
+ unsigned int VOLID; /**< Video Object Layer ID. Set by API. */
+ unsigned int Priority; /**< Priority(of what (???)). Set by API. */
+ unsigned int VSOType; /**< VSO(full form(???)) Type. Set by API. */
+ unsigned int VideoFormat; /**< Video Format (what are the possible values (???)). Set by API. */
+ unsigned int VideoRange; /**< Video Range. Set by API. */
+ unsigned int Color; /**< Color primaries. */
+ unsigned int Transfer; /**< Transfer charateristics. */
+ unsigned int Matrix; /**< Matrix coefficients(???). */
+ GFMXDECPREFILLBUFFER prefill;
+ }GFMXDECMP4DECVOL, *PGFMXDECMP4DECVOL;
+
+ /****************************************************************************************************/
+ //uiVOLinfo
+ /** GFMXDECMP4DECVOL::uiVOLinfo : Short header format detected.
+ @see GFMXDECMP4DECVOL, GFMXDECTABLE::MxDecMP4DecVOL */
+#define MXDEC_MP4_SHORT_HEADER 0x00000001
+
+ /** GFMXDECMP4DECVOL::uiVOLinfo : Data Partitioning mode detected.
+ @see GFMXDECMP4DECVOL, GFMXDECTABLE::MxDecMP4DecVOL */
+#define MXDEC_MP4_DATA_PARTITION 0x00000002
+
+ /** GFMXDECMP4DECVOL::uiVOLinfo : Profile and level field is valid.
+ @see GFMXDECMP4DECVOL, GFMXDECTABLE::MxDecMP4DecVOL */
+#define MXDEC_MP4_PROFILE_LEVEL 0x00000004
+
+ /** GFMXDECMP4DECVOL::uiVOLinfo : Priority field is valid.
+ @see GFMXDECMP4DECVOL, GFMXDECTABLE::MxDecMP4DecVOL */
+#define MXDEC_MP4_PRIORITY 0x00000008
+
+ /** GFMXDECMP4DECVOL::uiVOLinfo : Visual object type field is valid.
+ @see GFMXDECMP4DECVOL, GFMXDECTABLE::MxDecMP4DecVOL */
+#define MXDEC_MP4_VSOTYPE 0x00000010
+
+ /** GFMXDECMP4DECVOL::uiVOLinfo : VideoFormat and VideoRange fields are valid.
+ @see GFMXDECMP4DECVOL, GFMXDECTABLE::MxDecMP4DecVOL */
+#define MXDEC_MP4_VIDEO_SIGNAL 0x00000020
+
+ /** GFMXDECMP4DECVOL::uiVOLinfo : Color, Transfer and Matrix fields are valid.
+ @see GFMXDECMP4DECVOL, GFMXDECTABLE::MxDecMP4DecVOL */
+#define MXDEC_MP4_COLOR_DESCRIPTION 0x00000040
+
+ /** GFMXDECMP4DECVOL::uiVOLinfo : VObjectID field is valid.
+ @see GFMXDECMP4DECVOL, GFMXDECTABLE::MxDecMP4DecVOL */
+#define MXDEC_MP4_VOID 0x00000080
+
+ /** GFMXDECMP4DECVOL::uiVOLinfo : VOLID field is valid.
+ @see GFMXDECMP4DECVOL, GFMXDECTABLE::MxDecMP4DecVOL */
+#define MXDEC_MP4_VOLID 0x00000100
+
+ /****************************************************************************************************/
+ //Profile
+ /** GFMXDECMP4DECVOL::Profile : Profile is simple profile.
+ @see GFMXDECMP4DECVOL, GFMXDECTABLE::MxDecMP4DecVOL */
+#define MXDEC_MP4_SIMPLE_PROFILE 0x00000000
+
+ /** GFMXDECMP4DECVOL::Profile : Profile is advance simple profile.
+ @see GFMXDECMP4DECVOL, GFMXDECTABLE::MxDecMP4DecVOL */
+#define MXDEC_MP4_ADVANCE_SIMPLE_PROFILE 0x00000009
+
+ /****************************************************************************************************/
+ //resync options
+ /** Argument ResyncOption for GFMXDECTABLE::MxDecMP4DecResync : Resync to next nearest VOL.
+ @see GFMXDECTABLE::MxDecMP4DecResync */
+#define MXDEC_MP4_RESYNC_FORWARD_NEAREST_VOL 0x1
+
+ /** Argument ResyncOption for GFMXDECTABLE::MxDecMP4DecResync : Resync to next nearest VOP.
+ @see GFMXDECTABLE::MxDecMP4DecResync */
+#define MXDEC_MP4_RESYNC_FORWARD_NEAREST_VOP 0x2
+
+ /** Argument ResyncOption for GFMXDECTABLE::MxDecMP4DecResync : Resync to next nearest I-VOP.
+ @see GFMXDECTABLE::MxDecMP4DecResync */
+#define MXDEC_MP4_RESYNC_FORWARD_NEAREST_I_VOP 0x4
+
+ /** Argument ResyncOption for GFMXDECTABLE::MxDecMP4DecResync : Resync to next VOL.
+ @see GFMXDECTABLE::MxDecMP4DecResync */
+#define MXDEC_MP4_RESYNC_FORWARD_NEXT_VOL 0x8
+
+ /** Argument ResyncOption for GFMXDECTABLE::MxDecMP4DecResync : Resync to next VOL.
+ @see GFMXDECTABLE::MxDecMP4DecResync */
+#define MXDEC_MP4_RESYNC_FORWARD_NEXT_VOP 0x10
+
+ /** Argument ResyncOption for GFMXDECTABLE::MxDecMP4DecResync : Resync to next I-VOP.
+ @see GFMXDECTABLE::MxDecMP4DecResync */
+#define MXDEC_MP4_RESYNC_FORWARD_NEXT_I_VOP 0x20
+
+ /** Argument ResyncOption for GFMXDECTABLE::MxDecMP4DecResync : Resync to previous nearest VOL.
+ @see GFMXDECTABLE::MxDecMP4DecResync */
+#define MXDEC_MP4_RESYNC_BACKWARD_NEAREST_VOL 0x40
+
+ /** Argument ResyncOption for GFMXDECTABLE::MxDecMP4DecResync : Resync to previous nearest VOP.
+ @see GFMXDECTABLE::MxDecMP4DecResync */
+#define MXDEC_MP4_RESYNC_BACKWARD_NEAREST_VOP 0x80
+
+ /** Argument ResyncOption for GFMXDECTABLE::MxDecMP4DecResync : Resync to previous nearest I-VOP.
+ @see GFMXDECTABLE::MxDecMP4DecResync */
+#define MXDEC_MP4_RESYNC_BACKWARD_NEAREST_I_VOP 0x100
+
+ /** Argument ResyncOption for GFMXDECTABLE::MxDecMP4DecResync : Resync to previous VOL.
+ @see GFMXDECTABLE::MxDecMP4DecResync */
+#define MXDEC_MP4_RESYNC_BACKWARD_PREVIOUS_VOL 0x200
+
+ /** Argument ResyncOption for GFMXDECTABLE::MxDecMP4DecResync : Resync to previous VOP.
+ @see GFMXDECTABLE::MxDecMP4DecResync */
+#define MXDEC_MP4_RESYNC_BACKWARD_PREVIOUS_VOP 0x400
+
+ /** Argument ResyncOption for GFMXDECTABLE::MxDecMP4DecResync : Resync to previous I-VOP.
+ @see GFMXDECTABLE::MxDecMP4DecResync */
+#define MXDEC_MP4_RESYNC_BACKWARD_PREVIOUS_I_VOP 0x800
+
+ /****************************************************************************************************/
+ /** This structure hold the information needed for decoding a Video Object Plane (VOP).
+ @see GFMXDECTABLE::MxDecMP4DecVOP */
+ typedef struct _GFMXDECMP4DECVOP
+ {
+ PGFRMSURFACE pRef; /**< Reference VOP, ignore this item, if current VOP is an I. Set by application. */
+ PGFRMSURFACE pCur; /**< Current VOP. Set by application. */
+ PGFRECT pRefRect; /**< Reference rectangle. Set by application.
+ pRefRect specifies a rectangle area for GFMxDec to reference the reference image.
+ This rectangle area should be within the pRef surface. The rectangle top, left should
+ be aligned by application. Application should call GFMxDecGetAttribute() with
+ MXDEC_ATTR_MP4_DEC_VOP_RECT_TOP_ALIGNMENT and MXDEC_ATTR_MP4_DEC_VOP_RECT_LEFT_ALIGNMENT
+ attributions to get the required alignment. This rectangle's width and height should
+ exactly match with the image width and height which has been coded in bit stream. If
+ pRefRect is NULL, GFMxDec will use pRef surface width and height as reference image dimension.
+ */
+ PGFRECT pCurRect; /**< Current rectangle. Set by application.
+ pCurRect specifies a rectangle area for GFMxDec to output the decoded image.
+ This field only take effect when MXDEC_MP4_DEC_VOP_SPECIFY_REFSURF_RECT flag is set.
+ This rectangle area should be within the pCur surface. The rectangle top, left should be
+ aligned by application. Application should call GFMxDecGetAttribute() with
+ MXDEC_ATTR_MP4_DEC_VOP_RECT_TOP_ALIGNMENT and MXDEC_ATTR_MP4_DEC_VOP_RECT_LEFT_ALIGNMENT
+ attributions to get the required alignment. This rectangle's width and height should exactly
+ match with the image width and height which has been coded in bit stream. If pCurRect is NULL,
+ GFMxDec will use pCur surface dimension as decoded image dimension.
+ */
+ NvU32 uiVOPinfo; /**< Get current VOP information. Set by API.
+ #MXDEC_MP4_VOP_P VOP is coded as P-VOP
+ #MXDEC_MP4_NOT_CODED VOP is not coded
+ (???)What about I-VOP? (???)
+ */
+ NvU32 uiTimeStamp; /**< Time to display this VOP, in milliseconds. Set by API. */
+ NvU8 *pMBInfo; /**< Pointer to array where information of whether the MB is decoded or not is stored.
+ Each element will tell if this corresponding MB is wrong. Set by API. */
+ NvU32 uiVOPOption; /**< Must be used to set ASYNC option */
+
+ GFMXDECPREFILLBUFFER prefill;
+ }GFMXDECMP4DECVOP, *PGFMXDECMP4DECVOP;
+
+ /** GFMXDECMP4DECVOP::uiVOPOption: enables ASYNC mode. GFMxDecMP4DecVOP()
+ will return after pushing the commands but without waiting for them to
+ complete. This option is useful to achieve some paralellism because
+ decoded frame is usually not used right away for rendering. So
+ there is enough time for hardware to complete the decoding before this
+ frame will be used by app. It is ok to call PostProcessing even when
+ decoding of this frame is not complete. Inside GPU, hardware synchronizes
+ with the decoder. */
+#define MXDEC_MP4DECVOP_OP_ASYNC 0x00000001
+
+
+ /****************************************************************************************************/
+ //uiVOPinfo
+ /** GFMXDECMP4DECVOP::uiVOPinfo : VOP is coded as P-VOP.
+ @see GFMXDECMP4DECVOP */
+#define MXDEC_MP4_VOP_P 0x00000001
+
+ /** GFMXDECMP4DECVOP::uiVOPinfo : VOP is not coded.
+ @see GFMXDECMP4DECVOP */
+#define MXDEC_MP4_NOT_CODED 0x00000002 //Not coded VOP
+
+ /****************************************************************************************************/
+ //when GF_ERROR is return check the following flag
+ /** This flag is set when atleast one MB is wrong. If application has setup pMBinfo, it can check which MB is wrong. */
+#define MXDEC_MP4_BAD_MB 0x00010000
+
+ /****************************************************************************************************/
+
+#define MXDEC_ATTR_PRE_DETERMINED_BOUNDARY 0x00000001
+ /**< MxDecAPI Attribute : Application will determine the decoding boundary, for MPEG4, this boundary means VOL
+ and VOP boundary. For certain file formats, those boundary information are stored in the video file, application
+ can easily use those information to determine the boundary. If APP wants API to detect the boundary, application
+ should not disable this attribute. This is mainly for streaming case, where application does not have those handy
+ boundary information. API will automatically detect those boundaries. Application does not need to parse the
+ bitstream to detect those boundaries.\n
+ Value to be passed to GFMxDecSetAttribute for setting this attribute:
+ *pInfo == 1 Application will determine the decoding boudary
+ *pInfo == 0 Application will not determine the decoding boudary
+ @see GFMXDECTABLE::MxDecSetAttribute
+ */
+
+#define MXDEC_ATTR_MP4_DEC_VOP_RECT_TOP_ALIGNMENT 0x00000002
+ /**< MxDecAPI Attribute : This attribute only can be used for GFMxDecGetAttribute. If application wants to set pDestRect
+ in GFMXDECVOP or GFMXDECMP4DECVOP, application must use this attribute to get alignment information and align the rectangle
+ top & left corner accordingly. Value returned by GFMxDecGetAttribute:\n
+ *pInfo: Top field alignment in term of lines
+ @see GFMXDECTABLE::MxDecGetAttribute
+ */
+
+#define MXDEC_ATTR_MP4_DEC_VOP_RECT_LEFT_ALIGNMENT 0x00000003
+ /**< MxDecAPI Attribute : This attribute only can be used for GFMxDecGetAttribute. If application wants to set pDestRect
+ in GFMXDECVOP or GFMXDECMP4DECVOP, application must use those attributes to get alignment information and align the rectangle
+ top & left corner accordinately. Value returned by GFMxDecGetAttrubute:\n
+ *pInfo: left field alignment in term of pixels
+ @see GFMXDECTABLE::MxDecGetAttribute
+ */
+
+#define GF_MXDEC_ATTR_DEC_ENABLE_RAISE_WAIT 0x00000004
+ /**< MxDecAPI Attribute : This attribute only can be used for GFMxDecSetAttribute.
+ Value passed to GFMxDecSetAttribute:\n
+
+ *pInfo == 1
+ Raisevectors are allocated per Surface.\n
+ There will be 2 (3 if PostProcessing is ON) sets of raise-wait happening\n
+ 1) Decoder raises On_Frame_Decoded, and VxBlt waits.\n
+ 2) (If enabled in APP) PostProcessing API raises On_PP_Frame_Done, and VxBlt waits.\n
+ 3) VxBlt raises On_Bltted, and Decoder waits.
+ *pInfo == 0 (Default)
+ We do not allocate surface raise vectors but a single raise vector.\n
+ 1) In Decoder, we poll Frame_done, and return only after its done.\n
+ 2) In PostProcessing we poll PP_Frame_done, and return only after its done.\n
+ 3) It is observed that Frame_done & PP_Frame_done bits are affected only if raise is done on those.\n
+ Thats why single raise vector is still needed. This raise vector is not in any suface but in MxDecHandle.
+
+ @see GFMXDECTABLE::MxDecSetAttribute
+ */
+
+#define MXDEC_ATTR_DISABLE_EC 0x00000005
+ /**< MxDecAPI Attribute : Application can disable Error Concealment (EC) by setting this attribute. By default, EC is enabled.
+ Decoder has The Error Robustness (ER) and Concealment (EC) for mpeg4 decoding.
+
+ Error Robustness (Always ON) :
+ The ER means the code will detect any error in the bitstream at proper places and will still proceed ahead for decoding the
+ remaining stream, for posible non-errored data.
+
+ Error Concealment (Default ON): Can be disabled by this very attribute MXDEC_ATTR_DISABLE_EC.
+ EC means, the decoder will try to use previously decoded information to simulate the lost data. The below steps of EC:
+
+ Lost Motion Vector recovery and concealment:
+ 1. Rational interpolation: Predict the lost MV from the current frame
+ 2. Use MV from prev frame
+ 3. Use MV from step 3 and 4, to reconstruct 2 sets of the texture data for lost MB.
+
+ @see GFMXDECTABLE::MxDecSetAttribute */
+
+#define MXDEC_ATTR_MP4_DEC_GET_MBERR_MAP_MATRIX 0x00000006
+ /**< MxDecAPI Attribute : This attribute only can be used for GFMxDecGetAttribute. If application wants to get MB error map for
+ till recently decoded frame. Input parameter is a character array pMBErrMapMatrix of size "number of MBs in a frame". On returning
+ this call fills this char array with 1s & 0s. 1: MB correctly decoded & 0: MB corrupted. This is cumulative err map till this call
+ is made. In this API call after copying the err map to the char array, internal map is resit to all clean MBs. \n
+ Interpretation of block referenced by \a pInfo parameter:
+
+ NvU8 * pMBErrMapMatrix
+
+ @see GFMXDECTABLE::MxDecGetAttribute
+ */
+
+ /****************************************************************************************************/
+
+ /** Typesafe function for opening this component.
+
+ @param hRm (GFRmHandle) Handle specific to Resource Manager API
+ @param phMxDec (GFMxDecHandle *) Pointer to handle specific to MxDecAPI
+ @param state (GF_STATE_TYPE) The state is used to decide if a new ChHandle is to be allocated for MxDec component or not.
+ The values that state can take are:
+ #GF_STATE_DEFAULT
+ #GF_STATE_NEW_OR_SHARE
+ #GF_STATE_NEW_ONLY
+ #GF_STATE_SHARE_ONLY
+
+ @param hCh (GFRmChHandle) Resource Manager Channel Handle
+
+ @retval GF_SUCCESS : If successful
+ @retval GF_ERROR : If error occured
+ */
+ /**< Typesafe functions for opening and closing this component.
+ This API also checks for hardware resources needed through GFRmHwResourceConstraint().
+ Trying to open a second video instance will fail due to existing open context.
+ */
+
+GF_RETTYPE GFMxDecOpen(GFRmHandle hRm, GFMxDecHandle *phMxDec,
+ GF_STATE_TYPE state, GFRmChHandle hCh);
+
+ /** Typesafe function for opening this component.
+
+ @param phMxDec (GFMxDecHandle *) Pointer to handle specific to MxDecAPI
+
+ Close the video instance.
+ */
+void GFMxDecClose(GFMxDecHandle *phMxDec);
+
+GF_RETTYPE GFMxDecGetProperty (GFMxDecHandle MxHandle, PGFPROPERTY pMXProp);
+GF_RETTYPE GFMxDecPostProcessing (GFMxDecHandle pdec, PGFMXDECPP pP);
+GF_RETTYPE GFMxDecSetAttribute (GFMxDecHandle pdec, NvU32 uiFeature, NvU32 *pInfo);
+GF_RETTYPE GFMxDecGetAttribute (GFMxDecHandle pdec, NvU32 uiFeature, NvU32 *pInfo);
+GF_RETTYPE GFMxDecSet (GFMxDecHandle pdec, NvU32 uiFeature, void *pInfo);
+GF_RETTYPE GFMxDecMP4DecVOL (GFMxDecHandle pdec, PGFMXDECMP4DECVOL pVOL);
+GF_RETTYPE GFMxDecMP4DecVOP (GFMxDecHandle pdec, PGFMXDECMP4DECVOP pVOP);
+GF_RETTYPE GFMxDecMP4DecResync (GFMxDecHandle pdec, NvU32 ResyncOption);
+
+ //return value
+#define GFMXDEC_ERROR_NOT_SUPPORT_FORMAT (GFMXD_ERROR | 0x00000001)
+ /**< This error is returned when the input file format is not supported by the decoder. */
+#define GFMXDEC_ERROR_HEADER_DAMAGED (GFMXD_ERROR | 0x00000002)
+ /**< This error is returned when the header of the mpeg4 stream is damaged. */
+#define GFMXDEC_ERROR_NO_VOL_HEADER (GFMXD_ERROR | 0x00000003)
+ /**< This error is returned when no Video Object Layer (VOL) header is detected. */
+#define GFMXDEC_ERROR_NOT_ENOUGH_SYSTEM_MEM (GFMXD_ERROR | 0x00000004)
+ /**< This error is returned when system is out of memory. */
+
+ //return value
+#define GFMXDEC_ERROR_DETECTED_VOL (GFMXD_ERROR | 0x00000005)
+ /**< This error is returned when VOL was detected while decoding VOP. */
+#define GFMXDEC_ERROR_END_OF_FILE (GFMXD_ERROR | 0x00000006)
+ /**< This error is returned when end of file is reached. */
+#define GFMXDEC_ERROR_CORRUPTED_VOP (GFMXD_ERROR | 0x00000007)
+ /**< This error is returned when the VOP is corrupted and cannot be recovered. */
+
+ //return value
+#define GFMXDEC_ERROR_RESYNC_END_OF_FILE (GFMXD_ERROR | 0x00000008)
+ /**< This error is returned when end of file is reached while looking for resync marker. */
+#define GFMXDEC_ERROR_RESYNC_DETECTED_VOL (GFMXD_ERROR | 0x00000009)
+ /**< This error is returned when a VOL start is detected while searching for VOP resync marker. */
+#define GFMXDECMP4_DSP_TIMEOUT (GFMXD_ERROR | 0x00000010)
+ /**< This error is returned when DSP does not return anything for a predetermined timeout period. This error indicates possibility of DSP hang. */
+#define GFMXDEC_ERROR_START_CODE (GFMXD_ERROR | 0x00000011)
+ /**< This error is returned when no start code is found in a chunk of data. */
+
+ /*@}*/
+
+ /** @page pageMxDecAppNotes MxDecAPI Application Notes
+ @section pageMxDecAppNotes1 Programming Sequence
+
+ The following procedure requires that GFRmOpen() is called first to start
+ GFSDK usage.
+
+
+ 1. Initialize the display panel by using GFRmIxInit().\n
+
+ 2. Open the display component by calling GFDxOpen() to get the GFMxDecAPI Dxhandle.\n
+
+ 3. Initialize the display start address, stride and bits per pixel using GFDxSetDisplay().\n
+
+ 4. Get the various attributes of the display panel (width, height, etc) using GFDxGetAttribute().\n
+
+ 5. For clearing the screen, open the graphics component using GFGxOpen() and use GFGxFillRect() for filling the screen with
+ some color (say, black).\n
+
+ 6. Open the FDev component for performing file I/O using GFFDevOpen() and mount it using GFFDevMount().\n
+
+ 7. Open the Vx component using GFVxOpen() and get the GFVxAPI VxHandle. \n
+
+ 8. Query the properties with GFVxGetProperty() to see whether this GFVxAPI version supports MPEG decoding.\n
+
+ 9. If it supports MPEG decoding, call GFMxDecOpen() to get the GFMxDecAPI MxHandle.\n
+
+ 10. Call GFMxDecGetProperty() to query properties. Check whether this GFMxDAPI version can support the desired
+ MPEG profile and level.\n
+
+ 11. If the properties check out, call GFRmSurfaceAlloc() to allocate at least one reference surface and one
+ current surface for decoding purposes.\n
+
+ 12. If the postprocessing engine is needed, allocate one surface to hold the postprocessing results.\n
+
+ 13. For display purposes, the decoder application could call GFVxBlt() for the following two scenarios. \n
+ (a) Performing color space conversion and then a stretch blit to the primary surface directly. \n
+ (b) Blitting to the overlay surface.\n
+ Please refer to the latest GFVxAPI document for additional information. \n
+
+ 14. The decoder application should decode VOP-by-VOP. Call GFMxDecSetVOP() to set up the VOPs characteristics.\n
+
+ 15. After the decoder application has decoded enough macroblocks, call GFMxDecSetMBs() to trigger the hardware
+ to decode those macroblocks until all macroblocks in the current VOP are finished. GFMxDecSetMBs() may initiate
+ the postprocessing engine or video engine automatically.\n
+
+ 16. Before exiting the application, the decoder application should call GFRmSurfaceFree() to free the surfaces
+ that have been allocated. \n
+
+ 17. Call GFMxClose() with the MxHandle to release the resources of the decoder module.\n
+
+ 18. Similarly, call the close functions of the other components which have been opened.\n
+
+ */
+
+#ifdef __cplusplus
+} // only need to export C interface if
+// used by C++ source code
+#endif
+
+#endif
+
diff --git a/Start_WM/test6/inc/GFMxDecH264.h b/Start_WM/test6/inc/GFMxDecH264.h
new file mode 100755
index 00000000..351ca7ca
--- /dev/null
+++ b/Start_WM/test6/inc/GFMxDecH264.h
@@ -0,0 +1,1536 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+*
+* NVIDIA Corporation and its licensors retain all intellectual property
+* and proprietary rights in and to this software, related documentation
+* and any modifications thereto. Any use, reproduction, disclosure or
+* distribution of this software and related documentation without an
+* express license agreement from NVIDIA Corporation is strictly prohibited.
+*/
+
+/** @file GFMxDecH264.h
+GFSDK H264 Decode API header file.
+*/
+
+#ifndef _GF_MPEG_DEC_H264__
+#define _GF_MPEG_DEC_H264__
+
+#include "nvtypes.h"
+#include "GFVx.h"
+#include "GFDef.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /** @addtogroup groupMxDecH264 MxDecH264API H264 Decode API
+
+ The H.264/AVC decoder API handles H.264/AVC baseline-compliant bit
+ streams for this version, but has been defined to handle all of the three
+ profiles for future expansion.
+
+ The H.264/AVC decoder API has two sets of APIa high level API and a low
+ level API.
+
+ Using the High Level API
+
+ The high level API has a built-in entropy decoder. It decodes the bit stream
+ and performs error concealment if the bit stream has an error. This high level
+ API calls the low level API internally. When using the high level API, the
+ application can ignore the low level API.
+
+ The MxDecH264API high level functions include the following:
+ - GFMxDecH264DecSequence()
+ - GFMxDecH264DecPicture()
+ - GFMxDecH264Set()
+ - GFMxDecH264DecSEI()
+ - GFMxDecH264DecNewFrameNum()
+
+ Using the Low Level API
+
+ The low level API is essentially a macroblock decoder engine. It decodes
+ macroblock by macroblock. When using the low level API, the application
+ needs to handle the entropy decoding and error concealment. The low level
+ API assumes that the information passed from caller is correct, and does not
+ have any error concealment functionality build in. The application which
+ called the low level API must make sure that no macroblocks are missing for
+ any picture.
+
+ The MxDecH264API low level functions include the following:
+ - GFMxDecH264SetSequence()
+ - GFMxDecH264SetPicture()
+ - GFMxDecH264SetSlice()
+ - GFMxDecH264SetMBs()
+
+ Application Notes
+
+
+ @ref pageMxDecH264AppNotes
+
+ @ref pageMxDecH264AppNotes1
+ @ref pageMxDecH264AppNotes2
+
+
+ */
+ /*@{*/
+
+ /** MxDecH264API property flag: Baseline profile supported.
+ @see GFMxDecH264GetProperty(), GFPROPERTY::Capability
+ */
+#define GF_MXDEC_H264_CAP_BASELINE 0x00000001UL
+
+ /** MxDecH264API property flag: Main profile supported.
+ @see GFMxDecH264GetProperty(), GFPROPERTY::Capability
+ */
+#define GF_MXDEC_H264_CAP_MAIN 0x00000002UL
+
+ /** MxDecH264API property flag: Extended profile supported.
+ @see GFMxDecH264GetProperty(), GFPROPERTY::Capability
+ */
+#define GF_MXDEC_H264_CAP_EXTENDED 0x00000004UL
+
+ /** MxDecH264API property flag: LEVEL 1 supported.
+ @see GFMxDecH264GetProperty(), GFPROPERTY::Capability
+ */
+#define GF_MXDEC_H264_CAP_LEVEL10 0x00000100UL
+
+ /** MxDecH264API property flag: LEVEL 1.1 supported.
+ @see GFMxDecH264GetProperty(), GFPROPERTY::Capability
+ */
+#define GF_MXDEC_H264_CAP_LEVEL11 0x00000200UL
+
+ /** MxDecH264API property flag: LEVEL 1.2 supported.
+ @see GFMxDecH264GetProperty(), GFPROPERTY::Capability
+ */
+#define GF_MXDEC_H264_CAP_LEVEL12 0x00000400UL
+
+ /** MxDecH264API property flag: LEVEL 1.3 supported.
+ @see GFMxDecH264GetProperty(), GFPROPERTY::Capability
+ */
+#define GF_MXDEC_H264_CAP_LEVEL13 0x00000800UL
+
+ /** MxDecH264API property flag: LEVEL 2 supported.
+ @see GFMxDecH264GetProperty(), GFPROPERTY::Capability
+ */
+#define GF_MXDEC_H264_CAP_LEVEL20 0x00001000UL
+
+ /** MxDecH264API property flag: LEVEL 2.1 supported.
+ @see GFMxDecH264GetProperty(), GFPROPERTY::Capability
+ */
+#define GF_MXDEC_H264_CAP_LEVEL21 0x00002000UL
+
+ /** MxDecH264API property flag: LEVEL 2.2 supported.
+ @see GFMxDecH264GetProperty(), GFPROPERTY::Capability
+ */
+#define GF_MXDEC_H264_CAP_LEVEL22 0x00004000UL
+
+ /** MxDecH264API property flag: LEVEL 3 supported.
+ @see GFMxDecH264GetProperty(), GFPROPERTY::Capability
+ */
+#define GF_MXDEC_H264_CAP_LEVEL30 0x00008000UL
+
+ /** MxDecH264API property flag: LEVEL 3.1 supported.
+ @see GFMxDecH264GetProperty(), GFPROPERTY::Capability
+ */
+#define GF_MXDEC_H264_CAP_LEVEL31 0x00010000UL
+
+ /** MxDecH264API property flag: LEVEL 3.2 supported.
+ @see GFMxDecH264GetProperty(), GFPROPERTY::Capability
+ */
+#define GF_MXDEC_H264_CAP_LEVEL32 0x00020000UL
+
+ /** MxDecH264API property flag: LEVEL 4 supported.
+ @see GFMxDecH264GetProperty(), GFPROPERTY::Capability
+ */
+#define GF_MXDEC_H264_CAP_LEVEL40 0x00040000UL
+
+ /** MxDecH264API property flag: LEVEL 4.1 supported.
+ @see GFMxDecH264GetProperty(), GFPROPERTY::Capability
+ */
+#define GF_MXDEC_H264_CAP_LEVEL41 0x00080000UL
+
+ /** MxDecH264API property flag: LEVEL 4.2 supported.
+ @see GFMxDecH264GetProperty(), GFPROPERTY::Capability
+ */
+#define GF_MXDEC_H264_CAP_LEVEL42 0x00100000UL
+
+ /** MxDecH264API property flag: LEVEL 5 supported.
+ @see GFMxDecH264GetProperty(), GFPROPERTY::Capability
+ */
+#define GF_MXDEC_H264_CAP_LEVEL50 0x00200000UL
+
+ /** MxDecH264API property flag: LEVEL 5.1 supported.
+ @see GFMxDecH264GetProperty(), GFPROPERTY::Capability
+ */
+#define GF_MXDEC_H264_CAP_LEVEL51 0x00400000UL
+
+ /** MxDecH264API property flag: Post Processing de-blocking supported.
+ @see GFMxDecH264GetProperty(), GFPROPERTY::Capability
+ */
+#define GF_MXDEC_H264_CAP_DB 0x01000000UL
+
+ /** MxDecH264API property flag: Post Processing de-ringing supported.
+ @see GFMxDecH264GetProperty(), GFPROPERTY::Capability
+ */
+#define GF_MXDEC_H264_CAP_DR 0x02000000UL
+
+ /** VUI Parameters for GFMXDECH264DECSEQUENCE
+ */
+ typedef struct _GFMXDECH264DECVUI
+ {
+ NvU32 num_units_in_tick;
+ NvU32 time_scale;
+ NvU32 fixed_frame_rate_flag;
+ }GFMXDECH264DECVUI, *PGFMXDECH264DECVUI;
+
+ /** Parameter structure for MxDecH264DecSequence().
+ Both input and output parameters are passed via this structure to MxDecH264DecSequence().
+ @see MxDecH264DecSequence()
+ */
+ typedef struct _GFMXDECH264DECSEQUENCE
+ {
+ NvU32 uiSequenceOption; /**< Input flags, see GFMXDECH264_DECSEQUENCEOPTION_* */
+ NvU32 SequenceInfo; /**< Output flags, see GF_MXDEC_H264_DEC_SEQUENCE_* */
+ NvU16 profile_idc; /**< Output, H264 profile ID */
+ NvU16 level_idc; /**< Output, H264 level ID */
+ NvU16 seq_parameter_set_id;/** PicOrderCnt(CurrPic)
+ Greater than 1 specifies that the pan-scan rectangle information persists until
+ - A new coded video sequence begins
+ - A picture in an access unit containing a pan-scan rectangle SEI message with the
+ same value of pan_scan_rect_id is output having
+ (PicOrderCnt() > PicOrderCnt(CurrPic)) && (PicOrderCnt()<= PicOrderCnt(CurrPic) + pan_scan_rect_repetition_period )
+ */
+ } GFMXDECH264DECSEIPANSCAN, *PGFMXDECH264DECSEIPANSCAN;
+
+ typedef struct _GFMXDECH264DECSEISUBSEQLAYER
+ {
+ NvU32 num_sub_seq_layers_minus1; /**< Output, Specifies the number of sub-sequence layers in the sequence */
+ NvU32 accurate_statistics_flag; /**< Output, This flag when equal to 1 indicates that the values of average_bit_rate and
+ average_frame_rate are rounded from statistically correct values.
+ When equal to 0 indicates that the average_bit_rate and the average_frame_rate are estimates
+ and may deviate somewhat from the correct values.
+ */
+ NvU32 average_bit_rate; /**< Output, Indicates the average bit rate in units of 1000 bits per second. */
+ NvU32 average_frame_rate; /**< Output, Indicates the average frame rate in units of frames/(256 seconds). */
+ } GFMXDECH264DECSEISUBSEQLAYER, *PGFMXDECH264DECSEISUBSEQLAYER;
+
+ typedef struct _GFMXDECH264DECSEISUBSEQ
+ {
+ NvU32 sub_seq_layer_num; /**< Output, Identifies the sub-sequence layer number of the target sub-sequence */
+ NvU32 sub_seq_id; /**< Output, Identifies the target sub-sequence. */
+ NvU32 duration_flag; /**< Output, Equal to 0 indicates that the duration of the target sub-sequence is not specified. */
+ NvU32 sub_seq_duration; /**< Output, Specifies the duration of the target sub-sequence in clock ticks of a 90-kHz clock. */
+ NvU32 average_rate_flag; /**< Output, equal to 0 indicates that the average bit rate and the average frame rate of the target
+ sub-sequence are unspecified
+ */
+ NvU32 accurate_statistics_flag; /**< Output, Same as accurate_statistics_flag in _GFMXDECH264DECSEISUBSEQLAYER*/
+ NvU32 average_bit_rate; /**< Output, Indicates the average bit rate in (1000 bits)/second of the target sub-sequence.*/
+ NvU32 average_frame_rate; /**< Output, Indicates the average frame rate in units of frames/(256 seconds) of the target sub-sequence.*/
+ NvU32 num_referenced_subseqs; /**< Output, Specifies the number of sub-sequences that contain pictures that are used as reference pictures
+ for inter prediction in the pictures of the target sub-sequence.
+ */
+ NvU32 ref_sub_seq_layer_num;
+ NvU32 ref_sub_seq_id;
+ NvU32 ref_sub_seq_direction; /**< Output, ref_sub_seq_layer_num, ref_sub_seq_id, and ref_sub_seq_direction identify the sub-sequence
+ that contains pictures that are used as reference pictures for inter prediction in the pictures
+ of the target sub-sequence.
+ */
+ } GFMXDECH264DECSEISUBSEQ, *PGFMXDECH264DECSEISUBSEQ;
+
+
+
+ /** ulBitMask, ulBitpayloadType: Application will set the corresponding bit of ulBitMask depending upon its requirement of the
+ particular payload type of SEI Message.
+ H264 Decoder API will set the corresponding bit of ulBitpayloadType depending upon the availability of the
+ particular payload type indicated by ulBitMask flag in the SEI NAL unit.
+
+ @see ulBitpayloadType, ulBitMask in _GFMXDECH264DECSEI
+ */
+
+ /** Bit 0: SEI message for buffering period.
+ */
+#define GF_MXDEC_H264_SEI_MESSAGE_BUFFERING_PERIOD 0x00000001UL
+
+ /** Bit 1: SEI message for picture timing.
+ */
+#define GF_MXDEC_H264_SEI_MESSAGE_PICTURE_TIMING 0x00000002UL
+
+ /** Bit 2: SEI message for Pan Scan Rect.
+ */
+#define GF_MXDEC_H264_SEI_MESSAGE_PAN_SCAN 0x00000004UL
+
+ /** Bit 11: SEI message for Sequence Layer Characterization.
+ */
+#define GF_MXDEC_H264_SEI_MESSAGE_SEQ_LAYER_CHARECTERIZATION 0x00000800UL
+
+ /** Bit 12: SEI message for Sequence Characterization.
+ */
+#define GF_MXDEC_H264_SEI_MESSAGE_SEQ_CHARECTERIZATION 0x00001000UL
+
+ /** Parameter structure for MxDecH264DecSEI().
+ Both input and output parameters are passed via this structure to MxDecH264DecSEI().
+ @see MxDecH264DecSEI()
+ */
+ typedef struct _GFMXDECH264DECSEI
+ {
+ NvU32 payloadType; /**< Output, Specifies the type of SEI payload */
+ NvU32 payloadSize; /**< Output, Specifies the number of bytes in SEI payload */
+ GFMXDECH264DECSEIBUFFERINGPERIOD buffperiod; /**< Output, Complete information after parsing the buffering period message of SEI NAL unit
+ GFMXDECH264DECSEIBUFFERINGPERIOD structure
+ */
+ GFMXDECH264DECSEIPICTIMING pictiming; /**< Output, Complete information after parsing the pic_timing message of SEI NAL unit
+ GFMXDECH264DECSEIPICTIMING structure
+ */
+ GFMXDECH264DECSEIPANSCAN panscan; /**< Output, Complete information after parsing the Pan Scan message of SEI NAL unit
+ GFMXDECH264DECSEIPANSCAN structure
+ */
+ GFMXDECH264DECSEISUBSEQLAYER subseqlayer; /**< Output, Complete information after parsing the sub-Seqlayer message of SEI NAL unit
+ GFMXDECH264DECSEISUBSEQLAYER structure
+ */
+ GFMXDECH264DECSEISUBSEQ subseq; /**< Output, Complete information after parsing the sub-Seqlayer message of SEI NAL unit
+ GFMXDECH264DECSEISUBSEQ structure
+ */
+ NvU8 *pPreFillBuffer; /**< Input, Pointer bitstream for sequence header to decode */
+ NvU32 PreFillBufferLength;/**< Input, Length of bitstream in bytes, must cover the entire sequence header */
+ NvU32 ulBitpayloadType; /**< Output, Each Bit Informs a particular SEI message required by the application
+ so that the H264 decoder only parses that message related data stream
+ */
+ NvU32 ulBitMask; /**< Input, Each Masking Bit indicated which information is required by the application */
+ } GFMXDECH264DECSEI, *PGFMXDECH264DECSEI;
+
+ /** GFMXDECH264DECSEQUENCE::SequenceInfo ouput flagbit: constraint_set0_flag is on in the bitstream.
+ */
+#define GF_MXDEC_H264_DEC_SEQUENCE_CONSTRAINT_SET0_FLAG 0x00000001
+
+ /** GFMXDECH264DECSEQUENCE::SequenceInfo ouput flagbit: constraint_set1_flag is on in the bitstream.
+ */
+#define GF_MXDEC_H264_DEC_SEQUENCE_CONSTRAINT_SET1_FLAG 0x00000002
+
+ /** GFMXDECH264DECSEQUENCE::SequenceInfo ouput flagbit: constraint_set2_flag is on in the bitstream.
+ */
+#define GF_MXDEC_H264_DEC_SEQUENCE_CONSTRAINT_SET2_FLAG 0x00000004
+
+ /** GFMXDECH264DECSEQUENCE::SequenceInfo output flagbit: Frame cropping.
+ If this flag is set GFMXDECH264DECSEQUENCE::CroppingRect contains a valid
+ frame cropping rectangle.
+ */
+#define GF_MXDEC_H264_DEC_SEQUENCE_FRAME_CROPPING_FLAG 0x00000008
+
+ /** GFMXDECH264DECSEQUENCE::uiSequenceOption input flagbit: Bitstream is passed with GFMxDecH264DecSequence().
+ If this flag is set bitstream data is passed with the call to GFMxDecH264DecSequence()
+ instead via the read bitstrem callback. This can be used only with boundary detection
+ on application level. The bitstream data is passed via GFMXDECH264DECSEQUENCE::pPreFillBuffer and
+ GFMXDECH264DECSEQUENCE::PreFillBufferLength.
+ */
+#define GFMXDECH264_DECSEQUENCEOPTION_PREFILLBUFFER 0x00000001
+
+#define GFMXDECH264_MAX_NUM_REF_FRAMES 17
+ typedef struct
+ {
+ NvU32 POC;
+ NvU8 isNotDisplayed;
+ NvU8 RetainDuringDPBFlush;
+ NvU8 status;
+ }GFMXDECH264_DPB_DATA;
+
+
+ /** Parameter structure for MxDecH264DecPicture().
+ Both input and output parameters are passed via this structure to MxDecH264DecPicture().
+ @see MxDecH264DecPicture()
+ */
+ typedef struct _GFMXDECH264DECPICTURE
+ {
+ NvU32 uiPictureOption; /**< Input flagbits, see GF_MXDEC_H264_DEC_PICTURE_SPECIFY_*. */
+ PGFRECT pPictureRect; /**< Input, Target rectangle.
+ GFMXDECH264DECPICTURE::pPictureRect specifies a rectangle on the
+ output surface for GFMxDec to output the decoded image.
+
+ This field only take effect when MXDEC_H264_DEC_PICTURE_SPECIFY_SURF_RECT
+ flag is set.
+
+ The rectangle must be within the surface. The rectangle's top and
+ left position must be aligned by application. Call GFMxDecGetAttribute()
+ with #MXDEC_ATTR_H264_DEC_PICTURE_RECT_TOP_ALIGNMENT and
+ #MXDEC_ATTR_H264_DEC_PICTURE_RECT_LEFT_ALIGNMENT to read the alignment
+ requirements. The rectangle's width and height must match the video frame
+ width and height as returned from MxDecH264DecSequence() in
+ GFMXDECH264DECSEQUENCE::pic_width and GFMXDECH264DECSEQUENCE::pic_height.
+
+ Note: Feature not yet implemented.
+ */
+ NvU32 uiPictureInfo; /**< Output flags, see GF_MXDEC_H264_DEC_PICTURE_*. */
+ PGFRMSURFACE reconstructedSurf; /**< Output, Surface holding the decoded picture.
+ If frame is not decoded then reconstructedSurf will not get initialsed i.e. NULL
+ So VXBLT is called if the reconstructedSurf is not NULL.
+ */
+ NvU32 uiPictureOrderCount; /**< Output */
+ NvU32 uiTimeStamp; /**< Output, frame timestamp in miliseconds, valid only if GF_MXDEC_H264_DEC_PICTURE_TIME_STAMP set. */
+ NvU8 * pMBInfo; /**< Output, each element tells the particular MB is wrong or not. */
+ NvU32 UsedAsReference; /**< Output */
+ NvU8* pPreFillBuffer; /**< Input, Pointer bitstream for frame to decode
+ The bitstream pointer needs to be 4-bytes aligned.
+ */
+ NvU32 PreFillBufferLength; /**< Input, Length of bitstream in bytes, must cover the entire frame */
+ NvU32 PreFillBufferBytesConsumed; /**< Output, Amount of bytes consumed by the component */
+ NvU16 flushDPB; /**< Output, set to !=0 by the decoder when it encounters a memory_management_control_operation = 5
+ indication in the bitstream. The application should display (if the
+ NoOutputofPriorPics flag is not set) and flush the entire DPB, i.e remove
+ all previously stored frames from DPB.
+ Current frame should not be displayed/flushed.
+
+ See \a NoOutputofPriorPics for more info.
+ */
+ NvU16 NoOutputofPriorPics; /**< Output, set by the decoder when it encounters a no_output_of_prior_pics_flag in
+ the bitstream. If this set, then flushDPB will also be set. The application
+ should flush the entire DPB, i.e remove all previously stored frames from DPB.
+ Current frame should not be displayed/flushed.
+
+ Summary:
+
+ NoOutputofPriorPics flushDPB Applications response
+ 1 1 Remove all previously stored frames. No display.
+ 0 1 Display all previously stored frames and then remove from DPB.
+ 0 0 Normal operation of decoder.
+
+ */
+ NvU32 ReconSurfaceNumber; /**< Index of reconstructed surface, this is an index into GFMXDECH264SURFLIST::surfList[].
+ valid only if GFMXDECH264DECPICTURE::reconstructedSurf is not NULL.
+ Invalid for streams with picture reordering.
+ */
+ GFMXDECH264_DPB_DATA dpb_data[GFMXDECH264_MAX_NUM_REF_FRAMES];
+ } GFMXDECH264DECPICTURE, *PGFMXDECH264DECPICTURE;
+
+ //uiPictureOption
+
+ /** GFMXDECH264DECPICTURE::uiPictureOption input flagbit: Use target rectangle.
+ If this flag is set, the GFMXDECH264DECPICTURE::pPictureRect will point to
+ a rectangle on the output surface, where the reconstructed frame is placed.
+ */
+#define GF_MXDEC_H264_DEC_PICTURE_SPECIFY_SURF_RECT 0x00000001
+
+ /** GFMXDECH264DECPICTURE::uiPictureOption input flagbit: Bitstream is passed with MxDecH264DecPicture().
+ If this flag is set bitstream data is passed with the call to MxDecH264DecPicture()
+ instead via the read bitstrem callback. This can be used only with frame boundary detection
+ on application level. The bitstream data is passed via GFMXDECH264DECPICTURE::pPreFillBuffer and
+ GFMXDECH264DECPICTURE::PreFillBufferLength.
+ */
+#define GF_MXDEC_H264_DEC_PICTURE_SPECIFY_PREFILLBUFFER 0x00000002
+
+ //PictureInfo:
+
+ /** GFMXDECH264DECSEQUENCE::PictureInfo output flagbit: Current picture is IDR.
+ */
+#define GF_MXDEC_H264_DEC_PICTURE_IDR 0x00000001
+
+ /** GFMXDECH264DECSEQUENCE::PictureInfo output flagbit: GFMXDECH264DECSEQUENCE::uiTimeStamp field is valid.
+ */
+#define GF_MXDEC_H264_DEC_PICTURE_TIME_STAMP 0x00000002
+
+ /** GFMXDECH264DECSEQUENCE::PictureInfo output flagbit: Decoded picture has at least one corrupted macroblock.
+ */
+#define GF_MXDEC_H264_DEC_PICTURE_BAD_MB 0x00000004
+
+ /** GFMXDECH264DECSEQUENCE::PictureInfo output flagbit:
+ Required by the application to decide whether post processing should be applied for a particular frame
+ DeblockingFlag is set, when Deblocking Filtering is disabled for all the slices
+ DeblockingFlag is reset even if deblocking filtering is enabled for atleast one slice
+ */
+#define GF_MXDEC_H264_DEC_PICTURE_DEBLOCKING_FILTER 0x00000008
+
+ typedef struct _GFMXDECH264SEQUENCE
+ {
+ NvU32 SequenceInfo;
+ NvU16 pic_width_in_mbs_minus1;
+ NvU16 pic_height_in_map_units_minus1;
+ } GFMXDECH264SEQUENCE, *PGFMXDECH264SEQUENCE;
+ //PictureInfo:
+#define GF_MXDEC_H264_SEQUENCE_FRAME_MB_ONLY_FLAG 0x00000001
+ //if frame_mb_only_flag is on, this flag must be on
+#define GF_MXDEC_H264_SEQUENCE_MB_ADAPTIVE_FRAME_FIELD_FLAG 0x00000002
+ //if mb_adaptive_frame_filed_flag is on, this flag must be on
+#define GF_MXDEC_H264_SEQUENCE_DIRECT_8X8_INFERENCE_FLAG 0x00000004
+ //if direct_8x8_inference_flag is on, this flag must be on
+
+
+ typedef struct _GFMXDECH264PICTURE
+ {
+ NvU32 PictureInfo;
+ PGFRMSURFACE reconstructedSurf; //surface to hold the decoded picture
+ PGFRECT pRect;
+ NvU8 weighted_bidpred_idc;
+ NvS8 chroma_qp_index_offset;
+ } GFMXDECH264PICTURE, *PGFMXDECH264PICTURE;
+ //PictureInfo:
+#define GF_MXDEC_H264_PICTURE_WEIGHTED_PRED_FLAG 0x00000001
+ //if weighted_pred_flag is on, this flag must be on
+#define GF_MXDEC_H264_PICTURE_DEBLOCKING_FILTER_CONTROL_PRESENT_FLAG 0x00000002
+ //if deblocing_filter_control_present_flag is on, this flag must be on
+#define GF_MXDEC_H264_PICTURE_CONSTRAINED_INTRA_PRED_FLAG 0x00000004
+ //if constrained_intra_pred_flag is on, this flag must be on
+#define GF_MXDEC_H264_PICTURE_IDR 0x00000008
+#define GF_MXDEC_H264_PICTURE_SPECIFY_SURFACE_RECT 0x00000010
+ // If this flag is set, pRect must be set. GFMxDec will reference image
+ // in pRect area of reference surface and output the decoded image in
+ // the pRect area of reconstructedSurf. Otherwise, GFMxDec will use
+ // the whole surface area.
+
+
+ typedef struct _GFMXDECH264WEIGHT
+ {
+ NvS8 luma_weight;
+ NvS8 luma_offset;
+ NvS8 Cb_weight;
+ NvS8 Cb_offset;
+ NvS8 Cr_weight;
+ NvS8 Cr_offset;
+ } GFMXDECH264WEIGHT, *PGFMXDECH264WEIGHT;
+
+
+
+ typedef struct _GFMXDECH264SLICE
+ {
+ NvU32 SliceInfo;
+ NvU16 first_mb_in_slice;
+ NvU16 reserved;
+ NvU8 slice_type;
+ NvU8 num_ref_idx_l0_active_minues1;
+ NvU8 num_ref_idx_l1_active_minues1;
+ NvU8 disable_deblocking_filter_idc ;
+ NvU8 slice_alpha_c0_offset_div2;
+ NvU8 slice_beta_offset_div2;
+ PGFRMSURFACE ref_l0_surfaces[16];
+ PGFRMSURFACE ref_l1_surfaces[16];
+ GFMXDECH264WEIGHT weighttableL0[16];
+ GFMXDECH264WEIGHT weighttableL1[16];
+ } GFMXDECH264SLICE, *PGFMXDECH264SLICE;
+ //SliceInfo:
+#define GF_MXDEC_H264_SLICE_FILED_PIC_FLAG 0x01
+ //when filed_pic_flag is on, this flag must be set
+#define GF_MXDEC_H264_SLICE_BOTTOM_FILED_FLAG 0x02
+ //when bottom_field_flag is on, this flag must be set
+#define GF_MXDEC_H264_SLICE_DIRECT_SPATIAL_MV_PRED_FLAG 0x04
+ //when DIRECT_SPATIAL_MV_PRED_FLAG is on, this flag must be set
+
+
+ typedef struct _GFMXDECH264I4X4LPREDMODE
+ {
+ NvU32 uiPredMode0to7; //Luma4X4 Blk 0 to 7's prediction modes.
+ NvU32 uiPredMode8to15; //Luma4X4 Blk 8 to 15's prediction modes.
+ } GFMXDECH264I4X4LPREDMODE, *PGFMXDECH264I4X4LPREDMODE;
+
+ typedef struct _GFMXDECH264MV
+ {
+ NvS16 Horizontal;
+ //Horizonal motion vector component.
+ NvS16 Vertical;
+ //Vertical motion vector component
+ } GFMXDECH264MV, *PGFMXDECH264MV;
+
+
+ typedef struct _GFMXDECH264REFIDX
+ {
+ NvU8 Ref_idx_l0[4]; //PartIdx's reference index
+ NvU8 Ref_idx_l1[4]; //PartIdx's reference index
+ } GFMXDECH264REFIDX, *PGFMXDECH264REFIDX;
+
+
+ typedef struct _GFMXDECH264SUBMBTYPE
+ {
+ NvU8 sub_mb_type[4]; //PartIdx's sub_mb_type
+ } GFMXDECH264SUBMBTYPE, *PGFMXDECH264SUBMBTYPE;
+
+
+ typedef struct _GFMXDECH264MB
+ {
+ NvU16 uiTotalSize;
+ //Total size in bytes for current macroblock, including this structure
+ //itself and necessary following structure behind of this structure.
+ //Reference the data following GFMXDECH264MB.
+ NvU16 uiTotalCOEFs;// total Coefs for this macroblock
+ NvU32 curMBAddress; // current macroblock address
+ NvU8 MBInfo;
+ // this is the mb_type in bit stream and mb_field_decoding_flag
+ NvU8 uiQP; //this is QPy
+ NvU8 coded_block_pattern;
+ //This field is only valid when current macroblock is not Intra_16x16
+ NvU8 Intra_chroma_pred_mode;
+ //This field is valid only when current macroblock is Intra
+ GFMXDECH264SUBMBTYPE sub_mb_type;
+ union
+ {
+ GFMXDECH264I4X4LPREDMODE I4X4LPredMode; //Intra_4X4 only
+ GFMXDECH264REFIDX RefIdx; //Inter only
+ } mode; // TODO: Name this better
+ NvS32 numCoefsPerSubMB[32];
+ NvS16 index;
+ } GFMXDECH264MB, *PGFMXDECH264MB;
+
+ //MBInfo:
+#define GF_MXDEC_H264_MB_FILED_DECODING_ENABLE 0x80
+ //when mb_field_decoding_flag is on, this flag must be set
+#define GF_MXDEC_H264_MB_SKIP_MB 0x40
+ //skip MB
+
+ //The data following GFMXDECH264MB:
+ //If current macroblock is skipped macroblock, no further data is needed.
+
+ //If current macroblock is IPCM, there are 384 bytes following GFMXDECH264MB.
+
+ //If current macroblock is Inter macroblock, and is using picture list 0 only,
+ //necessary number of GFMXDECH264MV are following. If current macroblock is
+ //using picture list 1 only, necessary number of GFMXDECH264MV are following.
+ //If current macroblock is using both picture list 0 and list 1, necessary
+ //number of GFMXDECH264MV for list 0, and necessary number of GFMXDECH264MV
+ //for list 1 are following GFMXDECH264MB.
+
+ //For both Intra and Inter macroblock, the last portion of data which follows
+ //GFMXDECH264MB is GFMXDECH264MB.uiTotalCOEFs of GFMXDECH264COEF.
+
+
+
+ // definition for attribute
+
+ /** GFMxDecH264 Attribute: Application will determine the decoding boundaries.
+ For H.264/AVC, this boundary means sequence and picture boundary. For certain file formats,
+ those boundary information are stored in a meta data file. Alternatively the application
+ could parse NAL unit boundaries from the H264 stream and determine decoding units.
+ If application wants GFMxDecH264 to detect the boundary, it should not enable this
+ attribute.
+
+ If prefill mode (see #GFMXDECH264_DECSEQUENCEOPTION_PREFILLBUFFER) is used,
+ this attribute must be enabled. Disabled by default.
+
+ Interpretation of block referenced by \a pInfo parameter:
+
+ NvU32 1: APP will determine the decoding boudary
+ 0: APP will not determine the decoding boundary
+
+
+ @see GFMxDecH264GetAttribute(), GFMxDecH264SetAttribute()
+ */
+#define GF_MXDEC_H264_ATTR_PRE_DETERMINED_BOUNDARY 0x00000001
+
+ /** GFMxDecH264 Attribute: Enforce display ordering for sequences containing out of order frames.
+
+ Disabled by default.
+
+ Interpretation of block referenced by \a pInfo parameter:
+
+ NvU32 !=0: Enable reordering
+ 0: Disable reordering
+
+
+ @see GFMxDecH264GetAttribute(), GFMxDecH264SetAttribute()
+ */
+#define GF_MXDEC_H264_ATTR_DISPLAY_REORDERING 0x00000002
+
+#define GF_MXDEC_H264_ATTR_DSP_STREAM_BUFFERING 0x00000003
+ //This Attribute only can be used for GFMxDecH264SetAttribute
+ //If the Application wants to set the mode DSP_STREAM_BUFFERING in H264Decoder, enable the #define DSP_STREAM_BUFFERING in App,
+ //then APP will enable the attribute by calling the GFMxDecH264SetAttribute.
+ //this attribute is used to pass the buffer details, from Application to the host side of GFSDK H264 component.
+
+ /** GFMxDecH264 Attribute: Enable decode surface locking in MxDecH264DecPicture().
+
+ MxDecH264DecPicture() returns the decoded surface number in GFMXDECH264DECPICTURE::ReconSurfaceNumber,
+ which is an index into the decode surface list GFMXDECH264SURFLIST::surfList[] set via
+ #GF_MXDEC_H264_SET_SURFACE_LIST. If surface locking is enabled, MxDecH264DecPicture() will
+ automatically 'lock' the returned surface and exclude it from its list of
+ surfaces used for further decoding. GFMxDecH264 can still read from a locked surface
+ (for reference frames), but it will not overwrite it. The application must not
+ write into a locked surface, since it still may be used as reference frame.
+
+ This locking mechanism is intended for usecases, where the application directly displays
+ the decode surface as video overlay. See also @ref pageMxDecH264AppNotes2
+
+ With surface locking enable, each successfully decoded surface has to be unlocked by the
+ application with GFMxDecH264Set / #GF_MXDEC_H264_SET_UNLOCK_SURFACE.
+
+ Since locked surfaces cannot be used for decoding, the number of decoding surfaces
+ set with #GF_MXDEC_H264_SET_SURFACE_LIST must be R+1+N, where R is the maximum number of
+ reference frames and N the maximum number of simultaneously locked surfaces.
+ Otherwise MxDecH264DecPicture() may fail.
+
+ Disabled by default.
+
+ Interpretation of block referenced by \a pInfo parameter:
+
+ NvU32 !=0: Enable surface locking
+ 0: Disable surface locking
+
+
+ @see GFMxDecH264GetAttribute(), GFMxDecH264SetAttribute(), GF_MXDEC_H264_SET_UNLOCK_SURFACE, @ref pageMxDecH264AppNotes2
+ */
+#define GF_MXDEC_H264_ATTR_SURFACE_LOCKING 0x00000004
+
+ /** GFMxDecH264 Attribute: Get H264 decoder's DSP handle.
+
+ Interpretation of block referenced by \a pInfo parameter:
+
+ NvU32 DSP handle
+
+
+ GFMxDecH264GetAttribute() returns error GFMXDECH264_ERROR_INVALID_STATE, if DSP side not initialized.
+ Can be get only.
+
+ @internal
+ @see GFMxDecH264GetAttribute()
+ */
+#define GF_MXDEC_H264_ATTR_GETDSPHANDLE 0x00000005
+
+#define GF_MXDEC_H264_ATTR_DEC_PICTURE_RECT_TOP_ALIGNMENT 0x00000007
+ //This attribute only can be used for GFMxDecGetAttribute
+ //If application wants to set pDestRect in GFMXDECPICTURE or GFMXDECH264DECPICTURE,
+ //application must use this attributes to get allignment information and
+ //align the rectangle top & left corner accordinately.
+ //*pInfo: top fieled alignment in term of lines
+
+#define GF_MXDEC_H264_ATTR_DEC_PICTURE_RECT_LEFT_ALIGNMENT 0x00000008
+ //This attribute only can be used for GFMxDecGetAttribute
+ //If application wants to set pDestRect in GFMXDECH264PICTURE or GFMXDECH264DECPICTURE,
+ //application must use those attributes to get allignment information and
+ //align the rectangle top & left corner accordinately.
+ //*pInfo: left fieled alignment in term of pixels
+
+#define GF_MXDEC_H264_ATTR_DEC_ENABLE_RAISE_WAIT 0x00000009
+ /*
+ * This attribute only can be used for GFMxDecSetAttribute
+ * if (*pInfo == 1)
+ * {
+ * Raisevectors are allocated per Surface.
+ * There will be 2 (3 if PostProcessing is ON) sets of raise-wait happening
+ * 1) Decoder raises On_Frame_Decoded, and VxBlt waits.
+ * 2) (If enabled in APP) PostProcessing API raises On_PP_Frame_Done, and VxBlt waits.
+ * 3) VxBlt raises On_Bltted, and Decoder waits.
+ * }
+ * else // DEFAULT
+ * {
+ * We do not allocate surface raise vectors but a single raise vector
+ * - In Decoder, we poll Frame_done, and return only after its done
+ * - In PostProcessing we poll PP_Frame_done, and return only after its done
+ * - I observed that Frame_done & PP_Frame_done bits are affected only if raise is done on those. Thats why single raise vector is still needed.
+ * This raise vector is not in any suface but in pdec.
+ * }
+ */
+
+#define GF_MXDEC_H264_ATTR_LEN_OF_NALSIZE 0x0000000a
+ /*To support the decoding of .264 stream where NAL size appears instead of StartCode
+ This is to get the length of the NAL size value*/
+#define GF_MXDEC_H264_ATTR_NALSIZE_DECODING 0x0000000b
+ /* To support runtime decision making between the start code decoding and NAL size decoding*/
+
+
+ /** GFMxDecH264 Attribute: Indicate to the H264 decoder that surfaces have
+ already been allocated by the Application before the sps is decoded.
+ Interpretation of block referenced by \a pInfo parameter:
+
+ NvU32 (Height << 16)| (Width)
+
+
+ Can be set only.
+ */
+#define GF_MXDEC_H264_ATTR_SURFACE_ALLOCATED 0x0000000c
+
+ /** GFMxDecH264 Attribute: Set number of maximum supported reference frames.
+
+ Interpretation of block referenced by \a pInfo parameter:
+
+ NvU32 Number of reference frames
+
+
+ This can be called before or after GFMxDecH264Set(GF_MXDEC_H264_SET_SURFACE_LIST).
+ The number of reference frames must be smaller than the number of surfaces
+ set via GFMxDecH264Set(GF_MXDEC_H264_SET_SURFACE_LIST).
+
+ If this attribute is not set, the number of supported reference frames will be
+ equal to one less the number of surfaces set in GFMxDecH264Set(GF_MXDEC_H264_SET_SURFACE_LIST).
+
+ Can be set only.
+
+ @see GF_MXDEC_H264_SET_SURFACE_LIST
+ */
+#define GF_MXDEC_H264_ATTR_MAXREFFRAMES 0x0000000d
+
+ /** GFMxDecH264 Attribute: Get Error Map Matrix for MBs in last decoded frame.
+
+ This attribute only can be used for GFMxDecGetAttribute. If application wants to get MB error map for
+ till recently decoded frame. Input parameter is a character array pMBErrMapMatrix of size "number of MBs in a frame". On returning
+ this call fills this char array with 1s & 0s. 1: MB correctly decoded & 0: MB corrupted. This is cumulative err map till this call
+ is made. In this API call after copying the err map to the char array, internal map is reset to all clean MBs.
+ Internal map is reset to all clean MBs also when I or SI slice is found.
+
+ Interpretation of block referenced by \a pInfo parameter:
+
+ NvU8 * pMBErrMapMatrix
+
+
+ @internal
+ @see GFMxDecH264GetAttribute()
+ */
+#define GF_MXDEC_H264_ATTR_GET_MBERR_MAP_MATRIX 0x0000000e
+
+/** GFMxDecH264 Attribute: Set Error Concealment (EC) Mode ON or OFF.
+
+ EC is Dynamically ON by default.
+
+ Interpretation of block referenced by \a pInfo parameter:
+
+ NvU32 !=0: Enable EC
+ 0: Disable EC
+
+
+ @see GFMxDecH264SetAttribute()
+*/
+#define GF_MXDEC_H264_ATTR_SWITCH_EC_MODE 0x0000000f
+
+/** GFMxDecH264 Attribute: Set Single Slice Per Frame Mode ON or OFF.
+
+ By default multiple slices per frame is assumed.
+
+ Interpretation of block referenced by \a pInfo parameter:
+
+ NvU32 !=0: Single slice per frame
+ 0: Multiple slices per frame
+
+
+ @see GFMxDecH264SetAttribute()
+*/
+#define GF_MXDEC_H264_ATTR_SINGLE_SLICE_PER_FRAME 0x00000010
+
+
+
+/** GFMxDecH264 Attribute: Put the h264 decoder in the TSPlayer
+ mode. This has to be done first, and sets up the h264 decoder to cooperate
+ with the TS Demux task on the AVP. Does nothing when decode is on the
+ host
+*/
+#define GF_MXDEC_H264_ATTR_SET_TSPLAYER_MODE 0x00000011
+
+
+/** Parameter structure for MxDecH264PostProcessing().
+ Both input and output parameters are passed via this structure to MxDecH264PostProcessing().
+ @see MxDecH264PostProcessing()
+*/
+
+ typedef struct _GFMXDECHH264PP
+ {
+ PGFRMSURFACE* pDestSurf;/**< input,
+ pointer to an array of surfaces that will
+ hold the result from Post Processing
+ pointer to an array of surfaces to
+ accommodate auto post processing
+ */
+ PGFRMSURFACE* pSrcSurf; /**< input,
+ pointer to an array of surfaces to be //post processed
+ pointer to an array of surfaces to
+ accommodate auto post processing
+ */
+ PGFRECT pRect; /**< input,
+ Rectangle area to be processed for both
+ src and dest surface
+ */
+
+ NvU32 numofDestSurf; /**< input,
+ If MXDEC_PP_AUTO flag is set, this
+ parameter must be filled
+ */
+ NvU32 numofSrcSurf; /**< input,
+ If MXDEC_PP_AUTO flag is set, this
+ parameter must be filled
+ */
+ NvU8 * lpQuantiser; /**< input,
+ point to array of QPs for Macro Blocks in
+ the source VOP. GFMX automatically saved
+ the last two decoded VOP's QP tables,
+ Decoder application may not need to reload
+ the table if it can make sure the source
+ VOP is the one within the last decoded
+ VOPs. If MXDEC_PP_RELOAD_QUANTIZER is set,
+ this field must be filled.
+ */
+ NvU32 PPOption; /**
+ NvS32 >0 Surface index which was returned in GFMXDECH264DECPICTURE::ReconSurfaceNumber.
+ NvS32 -1 Reset all locked surfaces to unlocked
+ NvS32 -2 Reserved for internal use
+
+
+ @see GF_MXDEC_H264_ATTR_SURFACE_LOCKING
+ */
+#define GF_MXDEC_H264_SET_UNLOCK_SURFACE 3
+
+ /** GFMxDecH264Set() feature ID: Sync host side H264 state from DSP side.
+ @internal
+ */
+#define GF_MXDEC_H264_SET_SYNC_WITH_DSP 4
+
+ /** GFMxDecH264Set() feature ID: Set or reset DSP idle callback.
+ Can be called on DSP side only.
+ \a pInfo is a pointer to a #GFMXDECH264CALLBACK structure.
+ @internal
+ */
+#define GF_MXDEC_H264_SET_DSPIDLEHANDLER 5
+
+/** GFMxDecH264Set() feature ID: Allow the DSP message poll thread to wake up and terminate.
+ Can be called on Host side only.
+ \a pInfo is ignored.
+ @internal
+*/
+#define GF_MXDEC_H264_SET_EXITDSPMSGTHREAD 6
+
+ /** Parameter structure for GFMxDecH264Set() feature #GF_MXDEC_H264_SET_DSPIDLEHANDLER.
+ @internal
+ */
+ typedef struct _GFMXDECH264DSPIDLECALLBACK
+ {
+ /** Application defined parameter to forward to GFMXDECH264DSPIDLECALLBACK::pCallBack. */
+ void *pPara;
+
+ /** Callback function, which is called from AVP idle loop.
+ @param pPara Application defined parameter, forwarded from GFMXDECH264DSPIDLECALLBACK::pPara
+ */
+ void (*pCallBack)(void* pPara);
+
+ } GFMXDECH264DSPIDLECALLBACK;
+
+
+ /** Parameter structure for GFMxDecH264Set() feature #GF_MXDEC_H264_SET_READBITSTREAM. */
+ typedef struct _GFMXDECH264CALLBACK
+ {
+ /** Application defined parameter to forward to GFMXDECH264CALLBACK::pCallBack. */
+ void *pPara;
+
+ /** Callback function, which is called by MxDecH264 to fetch a portion of bitstream data.
+ @param pPara Application defined parameter, forwarded from GFMXDECH264CALLBACK::pPara
+ @param ppBuffer Callback returns address of the next portion of stream data in \a *ppBuffer
+ @param pBufferLength Callback returns number of bytes in \a ppBuffer in \a *pBufferLength
+ @param uFlag Specifies scan stream direction
+
+ GF_MXDEC_H264_READ_BITSTREAM_FORWARD Forward scan
+ GF_MXDEC_H264_READ_BITSTREAM_BACKWARD Backward scan
+
+
+ @return If the #MXDEC_ATTR_PRE_DETERMINED_BOUNDARY attribute is set, the callback
+ should return #GF_MXDEC_H264_BOUNDARY_REACHED when a frame boundary is
+ detected, or 0 if no boundary is detected.
+ If the #MXDEC_ATTR_PRE_DETERMINED_BOUNDARY attribute is not set, the callback
+ should return 0.
+ */
+ NvU32 (*pCallBack)(void* pPara, NvU8** ppBuffer, NvS32* pBufferLength, NvU32 uFlag);
+
+ }GFMXDECH264CALLBACK, *PGFMXDECH264CALLBACK;
+
+
+
+ /** GFMXDECH264CALLBACK::pCallBack return code */
+#define GF_MXDEC_H264_BOUNDARY_REACHED 0x00000001
+ /** GFMXDECH264CALLBACK::pCallBack uFlag value: Stream forward scan. */
+#define GF_MXDEC_H264_READ_BITSTREAM_FORWARD 0x00000002
+ /** GFMXDECH264CALLBACK::pCallBack uFlag value: Stream backward scan. */
+#define GF_MXDEC_H264_READ_BITSTREAM_BACKWARD 0x00000003
+
+ /** Maximum number of surface pointers GFMXDECH264SURFLIST::surfList[]. */
+#define MXDEC_H264_NUM_SURFACES 17
+
+ /** Parameter structure for GFMxDecH264Set() feature #GF_MXDEC_H264_SET_READBITSTREAM. */
+ typedef struct _GFMXDECH264SURFLIST
+ {
+ /** Number of valid surfaces in GFMXDECH264SURFLIST::surfList[].
+ The number of valid surfaces includes reference, decode surfaces and optional buffer frames.
+ Must be within range 1 and 17.
+ */
+ NvU32 numSurfs;
+
+ /** Surface pointer list.
+
+ Assuming N is the number of reference frames, the first N+1 surfaces
+ in this list will be used as reference and decode surfaces. The currently
+ decoded surface can refer to the N remaining surfaces in this set as
+ reference frames.
+
+ If surface locking mode (#GF_MXDEC_H264_ATTR_SURFACE_LOCKING) is enabled,
+ The remaining M = numSurfs - (N+1) surfaces are used as extra surfaces,
+ to fascilate pre-buffered decoding.
+ */
+ PGFRMSURFACE surfList[MXDEC_H264_NUM_SURFACES];
+
+ }GFMXDECH264SURFLIST, *PGFMXDECH264SURFLIST;
+
+
+ typedef enum
+ {
+ GFMX_DEC_H264_INTERRUPT_ENABLE,
+ GFMX_DEC_H264_INTERRUPT_DISABLE,
+ GFMX_DEC_H264_INTERRUPT_CLEAR
+ } GFMX_DEC_H264_INTERRUPT_OPERATION_TYPE; // Interrupt operation.
+
+ typedef enum
+ {
+ GFMX_DEC_H264_DSP_COMMAND_INTR,
+ GFMX_DEC_H264_POST_PROCESSING_DONE_INTR,
+ GFMX_DEC_H264_DECODE_DONE_INTR
+ } GFMX_DEC_H264_INTERRUPT_TYPE;
+
+ typedef struct _GFMXDECH264TABLE
+ {
+ GF_RETTYPE (* MxDecH264GetProperty)(GFMxDecH264Handle hMxDecH264, PGFPROPERTY pMXProp );
+ GF_RETTYPE (* MxDecH264GetStatus)(GFMxDecH264Handle hMxDecH264, NvU32 * pStatus);
+ GF_RETTYPE (* MxDecH264DecSequence)(GFMxDecH264Handle hMxDecH264, PGFMXDECH264DECSEQUENCE pSequence);
+ GF_RETTYPE (* MxDecH264DecPicture)(GFMxDecH264Handle hMxDecH264, PGFMXDECH264DECPICTURE pPicture);
+ GF_RETTYPE (* MxDecH264SetSequence)(GFMxDecH264Handle hMxDecH264, PGFMXDECH264SEQUENCE pSequence);
+ GF_RETTYPE (* MxDecH264SetPicture)(GFMxDecH264Handle hMxDecH264, PGFMXDECH264PICTURE pPicture);
+ GF_RETTYPE (* MxDecH264SetSlice)(GFMxDecH264Handle hMxDecH264, PGFMXDECH264SLICE pSlice);
+ GF_RETTYPE (* MxDecH264SetMBs)(GFMxDecH264Handle hMxDecH264, PGFMXDECH264MB pMBs);
+ GF_RETTYPE (* MxDecH264PostProcessing)(GFMxDecH264Handle hMxDecH264, PGFMXDECH264PP pP);
+ GF_RETTYPE (* MxDecH264SetAttribute)(GFMxDecH264Handle hMxDecH264, NvU32 uiFeature, NvU32* pInfo);
+ GF_RETTYPE (* MxDecH264GetAttribute)(GFMxDecH264Handle hMxDecH264, NvU32 uiFeature, NvU32* pInfo);
+ GF_RETTYPE (* MxDecH264Set)(GFMxDecH264Handle hMxDecH264, NvU32 uiFeature, void * pInfo);
+ GF_RETTYPE (* MxDecH264InterruptControl)(GFMxDecH264Handle hMxDecH264,
+ GFMX_DEC_H264_INTERRUPT_TYPE IntType, GFMX_DEC_H264_INTERRUPT_OPERATION_TYPE op,
+ void * pData);
+ GF_RETTYPE (* MxDecH264InterruptHandler)(GFMxDecH264Handle hMxDecH264,
+ GFMX_DEC_H264_INTERRUPT_TYPE IntType, void * pData); // Reserved.
+ GF_RETTYPE (* MxDecH264DSPPoll)(GFMxDecH264Handle hMxDecH264, NvU32 timeout);
+ GF_RETTYPE (* MxDecH264DecSEI)(GFMxDecH264Handle hMxDecH264, PGFMXDECH264DECSEI pSEI);
+ GF_RETTYPE (* MxDecH264DecNewFrameNum)(GFMxDecH264Handle hMxDecH264,NvU8* VideoBuffPtr,NvU32 VideoBufferLength);
+ } GFMXDECH264TABLE, *PGFMXDECH264TABLE;
+
+ /**< Typesafe functions for opening and closing this component.
+ This API also checks for hardware resources needed through GFRmHwResourceConstraint().
+ Trying to open a second video instance will fail due to existing open context.
+ */
+GF_RETTYPE GFMxDecH264Open(GFRmHandle hRm, GFMxDecH264Handle *phMxDecH264,
+ GF_STATE_TYPE state, GFRmChHandle hCh);
+
+ /**< Close the video instance.
+ */
+void GFMxDecH264Close(GFMxDecH264Handle *phMxDecH264);
+
+#if NVCPU_IS_XTENSA
+#define MXDH264OFFSET sizeof(GFMXDECH264TABLE)
+#else
+#define MXDH264OFFSET 0
+#endif
+
+
+ /** GFMxDecH264 error code: GFMxDecH264DecSequence() encountered end of bitstream.
+ @see GFMxDecH264DecSequence()
+ */
+#define GFMXDECH264_ERROR_SEQUENCE_END_OF_FILE (GFMXDH264_ERROR | 0x00000001)
+
+ /** GFMxDecH264 error code: GFMxDecH264DecSequence() bitstream format not supported.
+ The sequence header specifies a bitstream format, that is not supported. Most likely
+ reason for this error is that the H.264 profile is not supported.
+ @see GFMxDecH264DecSequence()
+ */
+#define GFMXDECH264_ERROR_SEQUENCE_NOT_SUPPORTED (GFMXDH264_ERROR | 0x00000002)
+
+ /** GFMxDecH264 error code: GFMxDecH264DecSequence() encountered out of GPU memory error.
+ The application can try to free GPU memory and call GFMxDecH264DecSequence() again.
+ @see GFMxDecH264DecSequence()
+ */
+#define GFMXDECH264_ERROR_SEQUENCE_NOT_ENOUGH_MEM (GFMXDH264_ERROR | 0x00000003)
+
+ /** GFMxDecH264 error code: GFMxDecH264DecPicture() encountered sequence header.
+ The application should call GFMxDecH264DecSequence() in response to this return code,
+ to decode the sequence header.
+ @see GFMxDecH264DecPicture(), GFMxDecH264DecSequence()
+ */
+#define GFMXDECH264_ERROR_PICTURE_DETECTED_SEQUENCE (GFMXDH264_ERROR | 0x00000004)
+
+ /** GFMxDecH264 error code: GFMxDecH264DecPicture() encountered end of bitstream.
+ @see GFMxDecH264DecPicture()
+ */
+#define GFMXDECH264_ERROR_PICTURE_END_OF_FILE (GFMXDH264_ERROR | 0x00000005)
+
+ /** GFMxDecH264 error code: GFMxDecH264DecPicture() encountered an unrecoverable bitstream error.
+ The application should call GFMxDecH264DecPicture() again, MxDecH264 will then
+ scan for the next frame boundary and try to decode this frame.
+ @see GFMxDecH264DecPicture()
+ */
+#define GFMXDECH264_ERROR_PICTURE_CORRUPTED_PICTURE (GFMXDH264_ERROR | 0x00000006)
+
+ /** GFMxDecH264 error code: GFMxDecH264DecPicture() encountered out of GPU memory error.
+ The application can try to free GPU memory and call GFMxDecH264DecPicture() again.
+ @see GFMxDecH264DecPicture()
+ */
+#define GFMXDECH264_ERROR_PICTURE_NOT_ENOUGH_MEM (GFMXDH264_ERROR | 0x00000007)
+
+ /** GFMxDecH264 error code: GFMxDecH264DecPicture() returns status to inform application
+ whether picture parameter set is not initialized, which may happen either when picture
+ parameter set is absent or corrupted. pic_parameter_set_id is checked for negative value.
+ */
+#define GFMXDECH264_ERROR_PICTURE_PARAMETER_SET_NOT_INITIALIZED (GFMXDH264_ERROR | 0x00000008)
+
+ /** GFMxDecH264 error code: GFMxDecH264DecPicture() returns error status to inform application
+ that picture parameter set is corrupted.
+ */
+#define GFMXDECH264_ERROR_PICTURE_PARAMETER_SET_CORRUPTED (GFMXDH264_ERROR | 0x00000009)
+
+ /** GFMxDecH264 error code: GFMxDecH264 API was used in invalid state of the decoder.
+ */
+#define GFMXDECH264_ERROR_INVALID_STATE (GFMXDH264_ERROR | 0x0000000A)
+
+ /** GFMxDecH264 error code: GFMxDecH264DecPicture() returns status to inform application that
+ all the surfaces where it could decode are locked.
+ */
+#define GFMXDECH264_ERROR_PICTURE_ALL_SURFACES_LOCKED (GFMXDH264_ERROR | 0x0000000B)
+
+ /*For DecPic timeout on DSP side.*/
+#define GFMXDECH264_ERROR_MXDEC_PIC_TIMEOUT (GFMXDH264_ERROR + 0x0000000C)
+
+
+ /** GFMxDecH264 error code: GFMxDecH264DecSEI() is not supported in bitstream callback mode.
+ @see GFMxDecH264DecSEI()
+ */
+#define GFMXDECH264_ERROR_SEI_NOT_SUPPORTED_FOR_BITSTREAM_CALLBACK_MODE (GFMXDH264_ERROR | 0x0000000D)
+
+ /** GFMxDecH264 error code: GFMxDecH264DecSEI() encountered end of bitstream.
+ @see GFMxDecH264DecSEI()
+ */
+#define GFMXDECH264_ERROR_SEI_END_OF_FILE (GFMXDH264_ERROR | 0x0000000E)
+
+ /** GFMxDecH264 error code: GFMxDecH264DecSEI() cannot decode this NAL Unit as its not SEI.
+ @see GFMxDecH264DecSEI()
+ */
+#define GFMXDECH264_ERROR_SEI_NOT_SEI_RBSP (GFMXDH264_ERROR | 0x0000000F)
+
+ /** GFMxDecH264 error code: GFMxDecH264DecSEI() Timed out on DSP side.
+ @see GFMxDecH264DecSEI()
+ */
+#define GFMXDECH264_ERROR_SEI_TIMEOUT (GFMXDH264_ERROR | 0x00000010)
+
+ /** GFMxDecH264 error code: GFMxDecH264DecNewFrameNum() cannot decode this NAL Unit as
+ it does not contain frame number information.
+ @see GFMxDecH264DecNewFrameNum()
+ */
+#define GFMXDECH264_ERROR_DECFRAMENUM_NOTSUPPORTED (GFMXDH264_ERROR | 0x00000011)
+
+ /* #### MxDecH264 Helper macros. Maybe useful for backward compatible API. #### */
+
+ /** This function returns version and capabilities of API and hardware.
+
+ @param hMxDecH264 (GFMxDecH264Handle) Handle to MxDecH264 component
+ @param pMXProp (PGFPROPERTY) Pointer to property structure to be filled in
+
+ @retval #GF_SUCCESS \a pJXProp filled in successfully
+ @retval #GF_ERROR Some error occured
+
+ The #GFPROPERTY structure passed with parameter \a pMXProp will be
+ filled in on successfull return. The GFPROPERTY::Capability field
+ will hold a combination of flagbits indicating capabilities specific
+ to the MxDecH264API:
+
+
+ #GF_MXDEC_H264_CAP_BASELINE
+ Baseline profile supported
+ #GF_MXDEC_H264_CAP_MAIN
+ Main profile supported
+ #GF_MXDEC_H264_CAP_EXTENDED
+ Extended profile supported
+ #GF_MXDEC_H264_CAP_LEVEL10
+ LEVEL 1.0 supported
+ #GF_MXDEC_H264_CAP_LEVEL11
+ LEVEL 1.1 supported
+ #GF_MXDEC_H264_CAP_LEVEL12
+ LEVEL 1.2 supported
+ #GF_MXDEC_H264_CAP_LEVEL13
+ LEVEL 1.3 supported
+ #GF_MXDEC_H264_CAP_LEVEL20
+ LEVEL 2.0 supported
+ #GF_MXDEC_H264_CAP_LEVEL21
+ LEVEL 2.1 supported
+ #GF_MXDEC_H264_CAP_LEVEL22
+ LEVEL 2.2 supported
+ #GF_MXDEC_H264_CAP_LEVEL30
+ LEVEL 3.0 supported
+ #GF_MXDEC_H264_CAP_LEVEL31
+ LEVEL 3.1 supported
+ #GF_MXDEC_H264_CAP_LEVEL32
+ LEVEL 3.2 supported
+ #GF_MXDEC_H264_CAP_LEVEL40
+ LEVEL 4.0 supported
+ #GF_MXDEC_H264_CAP_LEVEL41
+ LEVEL 4.1 supported
+ #GF_MXDEC_H264_CAP_LEVEL42
+ LEVEL 4.2 supported
+ #GF_MXDEC_H264_CAP_LEVEL50
+ LEVEL 5.0 supported
+ #GF_MXDEC_H264_CAP_LEVEL51
+ LEVEL 5.1 supported
+ #GF_MXDEC_H264_CAP_DB
+ Post Processing de-blocking supported
+ #GF_MXDEC_H264_CAP_DR
+ Post Processing de-ringing supported
+
+
+ It is a good practice to call this function to query for the API version
+ and its capabilities before using the rest of the MxDecH264API functions.
+
+ @see GFPROPERTY
+ */
+#define GFMxDecH264GetProperty(hMxDecH264, pMXProp) \
+ ((PGFMXDECH264TABLE)((NvU32)hMxDecH264+MXDH264OFFSET))->MxDecH264GetProperty(hMxDecH264, pMXProp)
+
+#define GFMxDecH264GetStatus(hMxDecH264, pStatus) \
+ ((PGFMXDECH264TABLE)((NvU32)hMxDecH264+MXDH264OFFSET))->MxDecH264GetStatus(hMxDecH264, pStatus)
+
+ /** Decode sequence header.
+
+ @param hMxDecH264 (GFMxDecH264Handle) Handle to MxDecH264 component
+ @param pSequence (PGFMXDECH264DECSEQUENCE) Pointer to #GFMXDECH264DECSEQUENCE parameter structure
+
+ @retval GF_SUCCESS Sequence header was decoded successfully
+
+ NAL units with nal_unit_type = 7 should be passed to GFMxDecH264DecSequence(). Such NAL units
+ contain Sequence Parameter Set (SPS). The nal_ref_idc should be a non-zero value.
+
+ This function will be called whenever a sequence header is found in the bitstream, decode
+ it and return its characteristics.
+
+ @see GFMXDECH264DECSEQUENCE
+ */
+#define GFMxDecH264DecSequence(hMxDecH264, pSequence)\
+ ((PGFMXDECH264TABLE)((NvU32)hMxDecH264+MXDH264OFFSET))->MxDecH264DecSequence(hMxDecH264, pSequence)
+
+ /** Decode a picture.
+
+ @param hMxDecH264 (GFMxDecH264Handle) Handle to MxDecH264 component
+ @param pPicture (PGFMXDECH264DECPICTURE) Pointer to #GFMXDECH264DECPICTURE parameter structure
+
+ @retval GF_SUCCESS Frame was decoded successfully
+ @retval GFMXDECH264_ERROR_PICTURE_DETECTED_SEQUENCE Sequence header detected
+ @retval GFMXDECH264_ERROR_PICTURE_END_OF_FILE End of stream encountered
+ @retval GFMXDECH264_ERROR_PICTURE_CORRUPTED_PICTURE Unrecoverable bitstream error during frame decode
+ @retval GFMXDECH264_ERROR_PICTURE_NOT_ENOUGH_MEM Out of GPU memory
+
+ All NAL units with nal_unit_type other than 7, should be passed to GFMxDecH264DecPicture().
+ In specific, for nal_unit_type value as 8, the NAL Unit contains a Picture Parameter Set (PPS) and
+ for nal_unit_type ranging between 1 and 5, the NAL units contain coded slices.
+
+ GFMxDecH264DecPicture decodes one picture from the bit stream. If GFMxDecH264DecPicture detects an
+ error, it will perform error concealment. If the error is not concealable, GFMxDecH264DecPicture returns
+ the error back to the application.
+ If the current stream position is not on the start of a frame, the function scans forward until a frame
+ start or sequence header is detected.
+
+ For actions to take on the particular return codes, refer to the return code documentation.
+
+ @see GFMXDECH264DECPICTURE
+ */
+#define GFMxDecH264DecPicture(hMxDecH264, pPicture)\
+ ((PGFMXDECH264TABLE)((NvU32)hMxDecH264+MXDH264OFFSET))->MxDecH264DecPicture(hMxDecH264, pPicture)
+
+
+ /** Decode a SEI rbsp.
+
+ @param hMxDecH264 (GFMxDecH264Handle) Handle to MxDecH264 component
+ @param pSEI (PGFMXDECH264DECSEI) Pointer to #GFMXDECH264DECSEI parameter structure
+
+ @retval GF_SUCCESS SEI rbsp was decoded successfully
+ @retval GFMXDECH264_ERROR_SEI_NOT_SUPPORTED_FOR_BITSTREAM_CALLBACK_MODE This API is not supported in bitstream callback mode
+ @retval GFMXDECH264_ERROR_PICTURE_END_OF_FILE End of stream encountered
+ @retval GFMXDECH264_ERROR_SEI_NOT_SEI_RBSP cannot decode this NAL Unit as its not SEI
+
+ All NAL units with nal_unit_type 6 can be passed to GFMxDecH264DecSEI() for decoding in prefill mode.
+
+ GFMxDecH264DecSEI decodes SEI rbsp.
+
+ For actions to take on the particular return codes, refer to the return code documentation.
+
+ @see GFMXDECH264DECSEI
+ */
+#define GFMxDecH264DecSEI(hMxDecH264, pSEI)\
+ ((PGFMXDECH264TABLE)((NvU32)hMxDecH264+MXDH264OFFSET))->MxDecH264DecSEI(hMxDecH264, pSEI)
+
+
+ /** Decode slice header and extract framenumber.
+
+ @param hMxDecH264 (GFMxDecH264Handle) Handle to MxDecH264 component
+ @param VideoBuffPtr Pointer to bitstream
+ @param VideoBufferLength Length of bitstream data available in the buffer
+
+ @retval framenum Framenumber of current nal unit data
+ @retval GFMXDECH264_ERROR_DECFRAMENUM_NOTSUPPORTED Nal unit type not supported
+
+ NAL units with nal_unit_type 1 and 5 can be passed to parse slice header and extract
+ framenumber.
+ This function can be used in prefill buffer mode to find all nal units which
+ belongs to same frame before calling GFMxDecH264DecPicture.
+
+ */
+
+
+#define GFMxDecH264DecNewFrameNum(hMxDecH264,VideoBuffPtr,VideoBufferLength) \
+ ((PGFMXDECH264TABLE)((NvU32)hMxDecH264+MXDH264OFFSET))->MxDecH264DecNewFrameNum(hMxDecH264,VideoBuffPtr,VideoBufferLength)
+
+
+#define GFMxDecH264SetSequence(hMxDecH264, pSequence)\
+ ((PGFMXDECH264TABLE)((NvU32)hMxDecH264+MXDH264OFFSET))->MxDecH264SetSequence(hMxDecH264, pSequence)
+
+#define GFMxDecH264SetPicture(hMxDecH264, pPicture)\
+ ((PGFMXDECH264TABLE)((NvU32)hMxDecH264+MXDH264OFFSET))->MxDecH264SetPicture(hMxDecH264, pPicture)
+
+#define GFMxDecH264SetSlice(hMxDecH264, pSlice)\
+ ((PGFMXDECH264TABLE)((NvU32)hMxDecH264+MXDH264OFFSET))->MxDecH264SetSlice(hMxDecH264, pSlice)
+
+#define GFMxDecH264SetMBs(hMxDecH264, pMBs) \
+ ((PGFMXDECH264TABLE)((NvU32)hMxDecH264+MXDH264OFFSET))->MxDecH264SetMBs(hMxDecH264, pMBs)
+
+/** Post Processing on a decoded YUV surface.
+ @param hMxDecH264 (GFMxDecH264Handle) Handle to MxDecH264 component
+ @param pP (PGFMXDECH264PP) Pointer to #GFMXDECH264PP parameter structure
+
+ @retval GF_SUCCESS Applied post processing on decoded surface successfully
+
+ GFMxDecH264PostProcessing() function can perform DeRinging and DeBlocking or DeBlocking only on a decoded YUV surface data.
+
+ GFMXDECH264DECSEQUENCE::PictureInfo output flagbit (GF_MXDEC_H264_DEC_PICTURE_DEBLOCKING_FILTER)
+ is set by the API if H264 bit stream does not have in-the-loop DeBlocking.
+ This means app can perform out-of-the-loop DeBlocking by calling GFMxDecH264PostProcessing().
+ If H264 bit stream has in-the-loop processing then hardware H264 decoder will perform in-the-loop DeBlokcing
+ and API resets this flag to zero to indicate that app should not perform DeBlocking.
+
+ GFMxDecH264PostProcessing can be called any time. we need decoded YUV surface data and Qp values for each MB.
+ If video is decoded by our hardware decoder then Qp values are saved in the internal SRAM for the last frame.
+
+
+ @see GFMXDECH264PP
+
+*/
+
+
+
+#define GFMxDecH264PostProcessing(hMxDecH264, pP) \
+ ((PGFMXDECH264TABLE)((NvU32)hMxDecH264+MXDH264OFFSET))->MxDecH264PostProcessing(hMxDecH264, pP)
+
+#define GFMxDecH264SetAttribute(hMxDecH264, uiFeature, pInfo) \
+ ((PGFMXDECH264TABLE)((NvU32)hMxDecH264+MXDH264OFFSET))->MxDecH264SetAttribute(hMxDecH264, uiFeature, pInfo)
+
+#define GFMxDecH264GetAttribute(hMxDecH264, uiFeature, pInfo) \
+ ((PGFMXDECH264TABLE)((NvU32)hMxDecH264+MXDH264OFFSET))->MxDecH264GetAttribute(hMxDecH264, uiFeature, pInfo)
+
+ /** Set various runtime parameters.
+
+ @param hMxDecH264 (GFMxDecH264Handle) Handle to MxDecH264 component
+ @param uiFeature (NvU32) ID of feature to set
+ @param pInfo (void*) Feature specific data
+
+ @retval GF_SUCCESS Success
+ @retval GF_FAILURE Failure
+
+ The following features identified by parameter \a uiFeature can be set, see documentation
+ for the individual \a uiFeature IDs for interpretation of data in parameter \a pInfo:
+
+ uiFeature Meaning pInfo interpretation
+ #GF_MXDEC_H264_SET_READBITSTREAM
+ Set up a stream callback function.GFMxDec calls
+ that callback function to request a portion of the bit stream from the application.
+ #GFMXDECH264CALLBACK *
+ #GF_MXDEC_H264_SET_SURFACE_LIST
+ Set a list of surfaces for to be used to store reference and decode frames.
+ #GFMXDECH264SURFLIST *
+ #GF_MXDEC_H264_SET_UNLOCK_SURFACE
+ Unlock one or all locked surface.
+ NvS32
+
+ */
+#define GFMxDecH264Set(hMxDecH264, uiFeature, pInfo) \
+ ((PGFMXDECH264TABLE)((NvU32)hMxDecH264+MXDH264OFFSET))->MxDecH264Set(hMxDecH264, uiFeature, pInfo)
+
+#define GFMxDecH264InterruptControl(hMxDecH264, IntType, op, pData)\
+ ((PGFMXDECH264TABLE)((NvU32)hMxDecH264+MXDH264OFFSET))->MxDecH264InterruptControl(hMxDecH264, IntType, op, pData)
+
+#define GFMxDecH264InterruptHandler(hMxDecH264, IntType, pData)\
+ ((PGFMXDECH264TABLE)((NvU32)hMxDecH264+MXDH264OFFSET))->MxDecH264InterruptHandler(hMxDecH264, IntType, pData)
+
+#define GFMxDecH264DSPPoll(MxHandle, timeout)\
+ ((PGFMXDECH264TABLE)((NvU32)MxHandle+MXDH264OFFSET))->MxDecH264DSPPoll(MxHandle, timeout)
+
+ //Use the following flags in the setattribute function for the picture boundary mode.
+ //If you wish to send the sequence header separately from the first frame use the first flag(SEPARATE_SEQUENCE_HEADER)
+ //else use the second flag.
+#define GFMXDECH264_SEPARATE_SEQUENCE_HEADER 0x1
+#define GFMXDECH264_COMBINED_SEQUENCE_HEADER 0x2
+
+
+ /*@}*/
+
+ /** @page pageMxDecH264AppNotes MxDecH264API Application Notes
+
+ @section pageMxDecH264AppNotes1 Programming Sequence
+
+ Todo
+
+ @section pageMxDecH264AppNotes2 Decode Surface Locking
+
+ The H264 decoder can operate in a surface locking mode, which is activated by
+ attribute #GF_MXDEC_H264_ATTR_SURFACE_LOCKING. In this mode, GFMxDecH264DecPicture()
+ will automatically 'lock' the current surface with the decoded frame, and exclude it
+ from its surface pool available for decoding new frames.
+
+ Surface locking is intended for usecases, were the decode surface is directly used as overlay.
+ For the duration it is displayed as overlay, the locked state ensures, that it won't be
+ overwritten. With this mechanism H264 decode and screen update can run in independent thread
+ contexts.
+
+ If a surface from the pool is locked, it can still be used as a reference frame.
+ However it will never be reused and overwritten during a succeeding call to
+ GFMxDecH264DecPicture().
+
+ The application can re-add the locked surface to the set of writable surfaces by
+ calling GFMxDecH264Set / GF_MXDEC_H264_SET_UNLOCK_SURFACE.
+
+ A locked surface is identified on return from GFMxDecH264DecPicture() via
+ GFMXDECH264DECPICTURE::ReconSurfaceNumber. This ID needs to be passed later to
+ GF_MXDEC_H264_SET_UNLOCK_SURFACE to perform the unlocking.
+
+ The application has to ensure that at least + 1 surfaces
+ in the pool stay unlocked. If GFMxDecH264DecPicture() is called with unsufficient
+ free surfaces, error GFMXDECH264_ERROR_PICTURE_ALL_SURFACES_LOCKED will be returned.
+
+ The number of surfaces set via GFMxDecH264Set / GF_MXDEC_H264_SET_SURFACE_LIST /
+ GFMXDECH264SURFLIST::surfList must be at least N+1+M, where N is the number of reference
+ frames and M the maximum allowed number of simulteneously locked surfaces.
+
+ The lock-state of all surfaces can be reset via GFMxDecH264Set / GF_MXDEC_H264_SET_UNLOCK_SURFACE
+ passing -1 as surface ID.
+ */
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
diff --git a/Start_WM/test6/inc/GFMxDecRV9.h b/Start_WM/test6/inc/GFMxDecRV9.h
new file mode 100755
index 00000000..a341d500
--- /dev/null
+++ b/Start_WM/test6/inc/GFMxDecRV9.h
@@ -0,0 +1,853 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/** @file GFMxDecRV9.h
+ GFSDK RV9 Decode API header file.
+*/
+
+#ifndef _GF_MPEG_DEC_RV9__
+#define _GF_MPEG_DEC_RV9__
+
+#include "nvtypes.h"
+#include "GFVx.h"
+
+#ifdef __cplusplus
+extern "C" { // only need to export C interface if
+ // used by C++ source code
+#endif
+/** @addtogroup group MxDecRV9API
+*/
+/*@{*/
+
+
+// MXDECRV9 CapabilityEx Flag
+#define GF_MXDEC_RV9_CAPEx_USE_DSP 0x00000001
+// Whenever DSP is used for decoding
+// Surace type should be = GF_SURFACE_VIDEO_MEMORY
+// Surface hint type = GF_MEMORY_HINT_BOTTOM_UP
+// In case of Host Used for decoding
+// Surace type = GF_SURFACE_SYSTEM_MEMORY
+// Surface hint type = 0
+// MXDECRV9CapFlags
+/************************************************************************************************************/
+
+/** Argument "GFPROPERTY pMXProp" for MxDecRV9GetProperty().\n
+ Application returns the properties, in GFPROPERTY structure \n
+@see GFMXDECRV9TABLE::MxDecRV9GetProperty , GFPROPERTY::Capability
+*/
+#define GF_MXDEC_RV9_CAP_SIMPLE 0x00000001
+
+/** Argument "GFPROPERTY pMXProp" for MxDecRV9GetProperty().\n
+ Application returns the properties, in GFPROPERTY structure \n
+@see GFMXDECRV9TABLE::MxDecRV9GetProperty , GFPROPERTY::Capability
+*/
+#define GF_MXDEC_RV9_CAP_MEDIUM 0x00000002
+
+/** Argument "GFPROPERTY pMXProp" for MxDecRV9GetProperty().\n
+ Application returns the properties, in GFPROPERTY structure \n
+@see GFMXDECRV9TABLE::MxDecRV9GetProperty , GFPROPERTY::Capability
+*/
+#define GF_MXDEC_RV9_CAP_COMPLEX 0x00000004
+
+/** Argument "GFPROPERTY pMXProp" for MxDecRV9GetProperty().\n
+ Application returns the properties, in GFPROPERTY structure \n
+@see GFMXDECRV9TABLE::MxDecRV9GetProperty , GFPROPERTY::Capability
+*/
+#define GF_MXDEC_RV9_CAP_LEVEL1 0x00000100
+
+/** Argument "GFPROPERTY pMXProp" for MxDecRV9GetProperty().\n
+ Application returns the properties, in GFPROPERTY structure \n
+@see GFMXDECRV9TABLE::MxDecRV9GetProperty , GFPROPERTY::Capability
+*/
+#define GF_MXDEC_RV9_CAP_LEVEL2 0x00000200
+
+/** Argument "GFPROPERTY pMXProp" for MxDecRV9GetProperty().\n
+ Application returns the properties, in GFPROPERTY structure \n
+@see GFMXDECRV9TABLE::MxDecRV9GetProperty , GFPROPERTY::Capability
+*/
+#define GF_MXDEC_RV9_CAP_LEVEL3 0x00000400
+
+/** Argument "GFPROPERTY pMXProp" for MxDecRV9GetProperty().\n
+ Application returns the properties, in GFPROPERTY structure \n
+@see GFMXDECRV9TABLE::MxDecRV9GetProperty , GFPROPERTY::Capability
+*/
+#define GF_MXDEC_RV9_CAP_LEVEL4 0x00000800
+
+/** Argument "GFPROPERTY pMXProp" for MxDecRV9GetProperty().\n
+ Application returns the properties, in GFPROPERTY structure \n
+@see GFMXDECRV9TABLE::MxDecRV9GetProperty , GFPROPERTY::Capability
+*/
+#define GF_MXDEC_RV9_CAP_DB 0x00001000
+
+/** Argument "GFPROPERTY pMXProp" for MxDecRV9GetProperty().\n
+ Application returns the properties, in GFPROPERTY structure \n
+@see GFMXDECRV9TABLE::MxDecRV9GetProperty , GFPROPERTY::Capability
+*/
+#define GF_MXDEC_RV9_CAP_DR 0x00002000
+/*********************************************************************************************************************/
+
+
+
+ /** This structure holds various informations each of the frame to be decoded .
+This structure is passed as parameter to GFMXDECRV9TABLE::MxDecRV9DecodeFrame.
+*/
+
+typedef struct _GFMXDECRV9FRAME
+{
+
+
+ NvU32 uiFrameOption; /**< uiFrameOption values
+
+ #GF_MXDEC_RV9_DEC_FRAME_SPECIFY_SURF_RECT
+ specify rect area to hold the reconstructed image.
+
+ */
+ PGFRECT pFrameRect; /**< not in use */
+ NvU32 uiFrameType; /**< set new frame type information
+
+ #GF_MXDEC_RV9_DISPLAY_FRAME
+ #GF_MXDEC_RV9_KEY_FRAME
+ #GF_MXDEC_RV9_P_FRAME
+ #GF_MXDEC_RV9_B_FRAME
+ #GF_MXDEC_RV9_DONT_DISPLAY_FRAME
+ #GF_MXDEC_RV9_ERRONEOUS_FRAME
+
+ */
+ PGFRMSURFACE pReconstructedSurf;/**< This is the surface to hold the decoded picture */
+ NvU32 uiFrameSequenceCount; /**< set by GFMxDecRV9API */
+ NvU32 uiTimeStamp; /**< in terms of millisecond */
+ NvU8* pPreFillBuffer; /**< Input, Pointer bitstream for frame to decode */
+ NvU32 PreFillBufferLength; /**< Input, Length of bitstream in bytes, must cover the entire frame */
+
+}GFMXDECRV9FRAME, *PGFMXDECRV9FRAME;
+
+//uiFrameOption
+/******************************************************************************************/
+/** uiFrameOption for GFMXDECRV9FRAME passed as an argument in MxDecRV9DecodeFrame(). \n
+specify rect area to hold the reconstructed image.\n
+@see GFMXDECRV9FRAME, GFMXDECRV9TABLE::MxDecRV9DecodeFrame.
+*/
+#define GF_MXDEC_RV9_DEC_FRAME_SPECIFY_SURF_RECT 0x00000001
+
+//uiFrameType values
+
+/******************************************************************************************/
+/** uiFrameType values for GFMXDECRV9FRAME set by MxDecRV9DecodeFrame(). \n
+
+@see GFMXDECRV9FRAME, GFMXDECRV9TABLE::MxDecRV9DecodeFrame
+*/
+#define GF_MXDEC_RV9_DISPLAY_FRAME 0x0
+
+/** uiFrameType values for GFMXDECRV9FRAME set by MxDecRV9DecodeFrame(). \n
+ The decoded Frame is I-frame.
+@see GFMXDECRV9FRAME, GFMXDECRV9TABLE::MxDecRV9DecodeFrame
+*/
+#define GF_MXDEC_RV9_KEY_FRAME 0x1
+
+/** uiFrameType values for GFMXDECRV9FRAME set by MxDecRV9DecodeFrame(). \n
+The Decoded Frame is P-frame.
+@see GFMXDECRV9FRAME, GFMXDECRV9TABLE::MxDecRV9DecodeFrame
+*/
+#define GF_MXDEC_RV9_P_FRAME 0x2
+
+/** uiFrameType values for GFMXDECRV9FRAME set by MxDecRV9DecodeFrame(). \n
+ The decoded Frame is B-frame.
+@see GFMXDECRV9FRAME, GFMXDECRV9TABLE::MxDecRV9DecodeFrame
+*/
+#define GF_MXDEC_RV9_B_FRAME 0x4
+
+/** uiFrameType values for GFMXDECRV9FRAME passed as an argument in MxDecRV9DecodeFrame(). \n
+
+@see GFMXDECRV9FRAME, GFMXDECRV9TABLE::MxDecRV9DecodeFrame
+*/
+#define GF_MXDEC_RV9_DONT_DISPLAY_FRAME 0x8
+
+/** uiFrameType values for GFMXDECRV9FRAME passed as an argument in MxDecRV9DecodeFrame(). \n
+ Decode frame is Erroneous
+@see GFMXDECRV9FRAME, GFMXDECRV9TABLE::MxDecRV9DecodeFrame
+*/
+#define GF_MXDEC_RV9_ERRONEOUS_FRAME 0x16
+/***********************************************************************************************************************/
+
+/** This structure holds various informations needed for Post Processing of decoded frame .
+This structure is passed as parameter to MxDecRV9PostProcessing().
+*/
+typedef struct _GFMXDECRV9PP
+{
+ PGFRMSURFACE pPPSurf;
+ /**< pointer to surface that will
+ hold the result from Post Processing
+ */
+ PGFRECT pPPRect;
+ /**< Rectangle area to be processed for both
+ source and destination surface
+ */
+
+ PGFRMSURFACE pSrcSurf;
+ /**< pointer to surface that will
+ hold the result from Post Processing
+ */
+ PGFRECT pSrcRect;
+ /**< Rectangle area to be processed for both
+ source and destination surface
+ */
+} GFMXDECRV9PP, *PGFMXDECRV9PP;
+
+// PPOption
+#define GF_MXDEC_RV9_PP_SM_OFF 0x0 //Turn OFF Smoothing filter for this frame
+#define GF_MXDEC_RV9_PP_SM_ON 0x1 //Turn ON Smoothing filter for this frame
+#define GF_MXDEC_RV9_PP_DR_ON 0x2 //Turn ON DeRinging filter for this frame
+
+
+// Hardware Status
+/************************************************************************************************************/
+
+#define GF_DECODER_FRAME_DONE 0x00000010
+
+
+
+#define GF_DECODER_PP_FRAME_DONE 0x00000020
+
+/*********************************************************************************************************/
+#define GF_DECODER_PP_FRAME_RV9 0x00000040//
+
+
+/** Attribute MxDecRV9Set::uiFeature.\n
+ Application sets this attribute to register a callback function and
+ its correpnding parameter to read bitstream data .
+@see GFMXDECRV9TABLE::MxDecRV9Set, pInfo should be a pointer to PGFMXDECRV9CALLBACK \n
+*/
+#define GF_MXDEC_RV9_SET_READBITSTREAM 0x1
+
+
+
+/** Attribute MxDecRV9Set::uiFeature \n
+ This will setup the surface list, including all of the ref surface and one reconstructed one. \n
+@see GFMXDECRV9TABLE::MxDecRV9Set, pInfo should a pointer PGFMXDECRV9SURFLIST
+*/
+#define GF_MXDEC_RV9_SET_SURFACE_LIST 0x2
+
+
+
+/** Attribute MxDecRV9Set::uiFeature \n
+ This will Set the GFMxDecRV9API to decode the RV8 stream
+ By default GFMxDecRV9API will assume the stream to be RV9 stream\n
+@see GFMXDECRV9TABLE::MxDecRV9Set
+*/
+#define GF_MXDEC_RV9_BITSTREAM_RV8 0x4
+
+
+/** Attribute GFMxDecRV9SetAttribute::uiFeature and GFMxDecRV9GetAttribute::uiFeature \n
+ Application will determine the decoding boundary, for RV9, this boundary means VOL
+ and VOP boundary. For certain file formats, those boundary information are
+ stored in the video file, APP can easily use those information to determine
+ the boundary.
+ If APP wants API to detect the boundary,App should not disable this attribute. This is mainly for streaming case, APP does
+ not have those handy boundary information. API will automatically detects those
+ boundaries. APP does not need to parse the bitstream to detect those boundaries.\n
+ *pInfo: 1: APP will determine the decoding boudary\n
+ *pInfo: 0: APP will not determine the decoding boundary \n
+@see GFMXDECRV9TABLE::MxDecRV9SetAttribute
+*/
+#define GF_MXDEC_RV9_ATTR_PRE_DETERMINED_BOUNDARY 0x00000001
+
+
+
+/** Attribute GFMxDecRV9GetAttribute::uiFeature \n
+ This attribute only can be used for GFMxDecGetAttribute
+ If application wants to set pDestRect in GFMXDECVOP or GFMXDECMP4DECVOP,
+ application must use this attributes to get allignment information and
+ align the rectangle top & left corner accordinately.\n
+ *pInfo: top fieled alignment in term of lines \n
+@see GFMXDECRV9TABLE::MxDecRV9GetAttribute
+*/
+#define GF_MXDEC_ATTR_RV9_DEC_FRAME_RECT_TOP_ALIGNMENT 0x00000002
+
+
+
+/** Attribute GFMxDecRV9GetAttribute::uiFeature \n
+ This attribute only can be used for GFMxDecGetAttribute
+ If application wants to set pDestRect in GFMXDECVOP or GFMXDECMP4DECVOP,
+ application must use those attributes to get allignment information and
+ align the rectangle top & left corner accordinately.\n
+ *pInfo: left fieled alignment in term of pixels\n
+
+@see GFMXDECRV9TABLE::MxDecRV9GetAttribute
+*/
+#define GF_MXDEC_ATTR_RV9_DEC_FRAME_RECT_LEFT_ALIGNMENT 0x00000003
+
+
+/** Attribute GFMxDecRV9SetAttribute::uiFeature and GFMxDecRV9GetAttribute::uiFeature \n
+ Application will fill the buffer and push the data to the decoder.
+*/
+#define GF_MXDEC_RV9_ATTR_PREFILLBUFFER 0x00000008
+
+/********************************************************************************************************/
+
+/** Structure holding the callback function pointer.
+Used in registering the callback function
+The callback function is a function which the API calls to request a portion of the bit stream from the application.
+@see GFMXDECRV9TABLE::MxDecRV9Set
+*/
+
+
+
+typedef struct _GFMXDECRV9CALLBACK
+{
+ void *pPara;/**< pPara is a parameter passed from APP,
+ and APP wants API to call back with this parameter
+ */
+ NvU32 (*pCallBack)(void * pPara, NvU8 ** ppBuffer, NvU32 * BufferLength,NvU32 uFlag);
+ /**< Application callback function pointer.
+ Register a callback function for fetching RV9 data.
+
+ @param *pPara Parameter to pass on to application callback function
+ @param ppBuffer Buffer Pointer
+ @param BufferLength Parameter to pass on to application callback function
+
+ If APP set GF_MXDEC_RV9_ATTR_PRE_DETERMINED_BOUNDARY,
+ APP should return GF_MXDEC_RV9HD_BOUNDARY_REACHED when the boundary is
+ detected.
+ If APP does not set GF_MXDEC_RV9_ATTR_PRE_DETERMINED_BOUNDARY,
+ 0 should be returned.
+ */
+
+}GFMXDECRV9CALLBACK, *PGFMXDECRV9CALLBACK;
+
+#define GF_MXDEC_RV9HD_ENDOFFILE 0x00000200
+#define GF_MXDEC_RV9HD_APP_DETECT_BOUNDARY 0x00001000
+#define GF_MXDEC_RV9HD_BOUNDARY_REACHED 0x00002000
+#define GF_MXDEC_RV9HD_ENDOFFILE_REACHED 0x00004000
+#define GF_MXDEC_RV9HD_APP_PREFILLBUFFER 0x00008000
+#define GF_MXDEC_RV9HD_BEGININGOFFILE_REACHED 0x00010000
+
+
+
+/** MxDecRV9API GFMXDECRV9CALLBACK::(*pCallBack)(, , ,uFlag)\n
+ for reading bitstream in forward direction
+@see GFMXDECRV9CALLBACK
+*/
+#define GF_MXDEC_RV9_READ_BITSTREAM_FORWARD 0x00000002
+
+/** MxDecRV9API GFMXDECRV9CALLBACK::(*pCallBack)(, , ,uFlag) \n
+ for reading bitstream in reverse direction.
+@see GFMXDECRV9CALLBACK
+*/
+#define GF_MXDEC_RV9_READ_BITSTREAM_BACKWARD 0x00000003
+
+//Resync options :
+
+/** MxDecRV9API GFMxDecRV9Resync( ,ResyncOption)\n
+ Resynchronize forward to the nearest I frame. If the GFMxDecRV9API is right
+ before an I frame, GFMxDecRV9Resync() returns immediately. Otherwise,
+ GFMxDecRV9Resync() moves forward, parsing bits until it reaches the first bit of the next I frame.
+@see ResyncOption, GFMXDECRV9TABLE::MxDecRV9Resync
+*/
+
+#define GF_MXDEC_RV9_RESYNC_FORWARD_NEAREST_I_FRAME 0x00000001
+
+/** MxDecRV9API GFMxDecRV9Resync(,ResyncOption)\n
+ Resynchronize backward to the nearest I frame.
+ GFMxDecRV9Resync() moves backward, parsing bits until it reaches the first bit of the previous I frame.
+@see ResyncOption, GFMXDECRV9TABLE::MxDecRV9Resync
+*/
+#define GF_MXDEC_RV9_RESYNC_BACKWARD_NEAREST_I_FRAME 0x00000002
+
+/** MxDecRV9API GFMxDecRV9Resync(,ResyncOption)\n
+ Resynchronize backward to the nearest P frame.
+ GFMxDecRV9Resync() moves backward, parsing bits until it reaches the first bit of the previous P frame.
+@see ResyncOption, GFMXDECRV9TABLE::MxDecRV9Resync
+*/
+#define GF_MXDEC_RV9_RESYNC_BACKWARD_NEAREST_P_FRAME 0x00000004
+
+
+
+/** this macro is used in GFMXDECRV9SURFLIST structure \n
+ Reference surfaces for RV9 decoder. */
+#define GF_MXDEC_RV9_NUM_SURFACES 3
+
+/** This structure is used to Set up a list of surfaces for RV9
+ decoder .
+*/
+
+typedef struct _GFMXDECRV9SURFLIST
+{
+
+ PGFRMSURFACE SurfList[GF_MXDEC_RV9_NUM_SURFACES];
+ /**< an array of PGFRMSURFACE
+ @see #GF_MXDEC_RV9_NUM_SURFACES
+ */
+
+
+}GFMXDECRV9SURFLIST, *PGFMXDECRV9SURFLIST;
+
+/** This structure is passed to MxDecRV9DecodePictureHeader() function, which sets
+ different fields of this structure.
+*/
+typedef struct _GFMXDECRV9PICHDR
+{
+ NvU32 uiRV8StreamInfo;
+ /**< set by GFMxDecRV9API. Valid only if it is RV8 stream
+
+ #GF_MXDEC_RV8_UMV
+ Unrestricted Motion Vector
+ #GF_MXDEC_RV8_DF
+ In loop Deblocking filter
+ #GF_MXDEC_RV8_SS
+ Slice Structured
+ #GF_MXDEC_RV8_RPR
+ Reference Picture Resampling
+ #GF_MXDEC_RV8_ROUND
+ Round off for half pixel motion compensation
+
+ */
+ NvU32 uiRV9StreamInfo;
+ /**< set by GFMxDecRV9API. Valid only if it is RV9 stream
+
+ #GF_MXDEC_RV9_INTERLACE
+ Interlaced mode used
+ #GF_MXDEC_RV9_DF_PASS_THRU
+ In loop Deblocking filter is disabled
+
+ */
+ NvU32 uiWidth; /**< Video width */
+ NvU32 uiHeight; /**< Video height */
+ NvU32 uiTR; /**< Temporal reference in milliseconds */
+
+}GFMXDECRV9PICHDR, *PGFMXDECRV9PICHDR;
+
+//uiRV8StreamInfo
+
+/** MxDecRV9API GFMXDECRV9PICHDR::uiRV8StreamInfo \n
+ Unrestricted Motion Vector.
+@see GFMXDECRV9PICHDR, GFMXDECRV9TABLE::MxDecRV9DecodePictureHeader
+*/
+#define GF_MXDEC_RV8_UMV 0x00000001
+
+/** MxDecRV9API GFMXDECRV9PICHDR::uiRV8StreamInfo \n
+ In loop Deblocking filter.
+@see GFMXDECRV9PICHDR, GFMXDECRV9TABLE::MxDecRV9DecodePictureHeader
+*/
+#define GF_MXDEC_RV8_DF 0x00000002
+
+/** MxDecRV9API GFMXDECRV9PICHDR::uiRV8StreamInfo\n
+ Slice Structured.
+@see GFMXDECRV9PICHDR, GFMXDECRV9TABLE::MxDecRV9DecodePictureHeader
+*/
+#define GF_MXDEC_RV8_SS 0x00000004
+
+/** MxDecRV9API GFMXDECRV9PICHDR::uiRV8StreamInfo \n
+ Reference Picture Resampling.
+@see GFMXDECRV9PICHDR, GFMXDECRV9TABLE::MxDecRV9DecodePictureHeader
+*/
+#define GF_MXDEC_RV8_RPR 0x00000008
+
+/** MxDecRV9API GFMXDECRV9PICHDR::uiRV8StreamInfo \n
+ Round off for half pixel motion compensation.
+@see GFMXDECRV9PICHDR, GFMXDECRV9TABLE::MxDecRV9DecodePictureHeader
+*/
+#define GF_MXDEC_RV8_ROUND 0x00000010
+
+//uiRV9StreamInfo
+
+/** MxDecRV9API GFMXDECRV9PICHDR::uiRV9StreamInfo \n
+ Interlaced mode used.
+@see GFMXDECRV9PICHDR, GFMXDECRV9TABLE::MxDecRV9DecodePictureHeader
+*/
+#define GF_MXDEC_RV9_INTERLACE 0x00000001
+
+/** MxDecRV9API GFMXDECRV9PICHDR::uiRV9StreamInfo \n
+ In loop Deblocking filter is disabled.
+@see GFMXDECRV9PICHDR, GFMXDECRV9TABLE::MxDecRV9DecodePictureHeader
+*/
+#define GF_MXDEC_RV9_DF_PASS_THRU 0x00000002
+
+//resync options
+//TBD
+
+//when GF_ERROR is return check the following flag
+#define GF_MXDEC_RV9_BAD_MB 0x00010000 //there is at least one MB is wrong
+ //if APP set up pMBInfo, APP can check which MB is wrong
+
+/** MxDecRV9API interrupt operation types.
+Constants to specify operation for a call to MxDecRV9InterruptControl().
+@see GF_MXDEC_RV9_INTERRUPT_OPERATION_TYPE, GFMXDECRV9TABLE::MxDecRV9InterruptControl
+*/
+typedef enum
+{
+ /** Enable interrupt/status assertion for an interrupt type. */
+ GF_MXDEC_RV9_INTERRUPT_ENABLE,
+
+ /** Disable interrupt/status assertion for an interrupt type. */
+ GF_MXDEC_RV9_INTERRUPT_DISABLE,
+
+ /** Clear interrupt/status assertion for an interrupt type. */
+ GF_MXDEC_RV9_INTERRUPT_CLEAR
+} GF_MXDEC_RV9_INTERRUPT_OPERATION_TYPE; // Interrupt operation.
+
+
+
+/** MxDecRV9API interrupt types.
+@see GF_MXDEC_RV9_INTERRUPT_TYPE, GFMXDECRV9TABLE::MxDecRV9InterruptControl and GFMXDECRV9TABLE::MxDecRV9InterruptHandler
+*/
+typedef enum
+{
+ /** Interrupt type is DSP Command Interrupt */
+ GF_MXDEC_RV9_DSP_COMMAND_INTR,
+
+ /** Interrupt type Post Processing done */
+ GF_MXDEC_RV9_POST_PROCESSING_DONE_INTR,
+
+ /** Interrupt type is Decoding done Interrupt */
+ GF_MXDEC_RV9_DECODE_DONE_INTR
+} GF_MXDEC_RV9_INTERRUPT_TYPE;
+
+/** MxDecRV9API virtual function pointer table. */
+typedef struct _GFMXDECRV9TABLE
+{
+
+ /** This function returns version and capabilities of API and hardware.
+
+ @param hMxDecRV9 (GFMxDecRV9Handle) Handle specific to MxDecRV9API
+ @param pMXProp (PGFPROPERTY) Pointer to GFPROPERTY structure to be filled in
+
+ @retval GF_SUCCESS \a pMXProp filled in successfully
+ @retval GF_ERROR Some error occured
+
+ The GFPROPERTY structure passed with parameter \a pMXProp will be
+ filled in on successfull return. The GFPROPERTY::Capability field
+ will hold a combination of flagbits indicating capabilities specific
+ to the MxDecRV9API:
+
+
+ #GF_MXDEC_RV9_CAP_SIMPLE
+ support simple profile.
+ #GF_MXDEC_RV9_CAP_MEDIUM
+ support medium profile.
+ #GF_MXDEC_RV9_CAP_COMPLEX
+ support complex profile
+ #GF_MXDEC_RV9_CAP_LEVEL1
+ support LEVEL 1.
+ #GF_MXDEC_RV9_CAP_LEVEL2
+ support LEVEL 2.
+ #GF_MXDEC_RV9_CAP_LEVEL3
+ support LEVEL 3.
+ #GF_MXDEC_RV9_CAP_LEVEL4
+ support LEVEL 4.
+ #GF_MXDEC_RV9_CAP_DB
+ support Post Processing's smoothing filter for RV8 streams.
+ #GF_MXDEC_RV9_CAP_DR
+ support Post Processing's de-ringing.
+
+
+ It is a good practice to call this function to query for the API version
+ and its capabilities before using the rest of the MxDecRV9API functions.
+
+ @see GFPROPERTY
+*/
+ GF_RETTYPE (* MxDecRV9GetProperty)(GFMxDecRV9Handle hMxDecRV9, PGFPROPERTY pMXProp );
+
+
+
+ GF_RETTYPE (* MxDecRV9GetStatus)(GFMxDecRV9Handle hMxDecRV9, NvU32 * pStatus);
+
+
+ /** This function applies the postprocessing filters to the source surface and outputs
+ the new image to the destitation surface.
+ @param hMxDecRV9 (GFMxDecRV9Handle) Handle specific to MxDecRV9API
+ @param pP (#PGFMXDECRV9PP) Pointer to the PGFMXDECRV9PP.
+ @retval GF_SUCCESS \a if successful
+ @retval GF_ERROR Some error occured
+ GF_ERROR Return values for the above function
+
+ @see PGFMXDECRV9PP
+*/
+ GF_RETTYPE (* MxDecRV9PostProcessing)(GFMxDecRV9Handle hMxDecRV9, PGFMXDECRV9PP pP);
+
+
+ /** This function sets the MxDecRV9API options.
+ @param hMxDecRV9 (GFMxDecRV9Handle) Handle specific to MxDecRV9API
+ @param uiFeature :
+
+ #GF_MXDEC_RV9_ATTR_PRE_DETERMINED_BOUNDARY
+ will determine the VOL and VOP boundary, for RV9.
+ #GF_MXDEC_RV9_ATTR_PREFILLBUFFER
+ App will fill the buffer and push the data to the decoder.
+
+ @param pInfo Pointer to the information buffer.
+ @retval GF_SUCCESS \a if successful
+ @retval GF_ERROR Some error occured
+
+*/
+ GF_RETTYPE (* MxDecRV9SetAttribute)(GFMxDecRV9Handle hMxDecRV9, NvU32 uiFeature, NvU32* pInfo);
+
+
+ /** This function gets the MxDecRV9API options.
+ @param hMxDecRV9 (GFMxDecRV9Handle) Handle specific to MxDecRV9API
+ @param uiFeature :
+
+ #GF_MXDEC_ATTR_RV9_DEC_FRAME_RECT_TOP_ALIGNMENT
+ #GF_MXDEC_ATTR_RV9_DEC_FRAME_RECT_LEFT_ALIGNMENT
+ #GF_MXDEC_RV9_ATTR_PRE_DETERMINED_BOUNDARY
+ #GF_MXDEC_RV9_ATTR_PREFILLBUFFER
+
+ @param pInfo Pointer to the information buffer.
+ @retval GF_SUCCESS \a if successful
+ @retval GF_ERROR Some error occured
+
+*/
+ GF_RETTYPE (* MxDecRV9GetAttribute)(GFMxDecRV9Handle hMxDecRV9, NvU32 uiFeature, NvU32* pInfo);
+
+
+ /** This function sets the MxDecRV9API options.
+ @param hMxDecRV9 (GFMxDecRV9Handle) Handle specific to MxDecRV9API
+ @param uiFeature :
+
+ #GF_MXDEC_RV9_SET_READBITSTREAM
+ will Set up readbitstream call back function.
+ #GF_MXDEC_RV9_SET_SURFACE_LIST
+ will setup the surface list, including all of the ref surface and one reconstructed one.
+ #GF_MXDEC_RV9_BITSTREAM_RV8
+ will Set the GFMxDecRV9API to decode the RV8 stream.
+
+ @param pInfo Pointer to the information buffer.
+ @retval GF_SUCCESS \a if successful
+ @retval GF_ERROR Some error occured
+
+*/
+ GF_RETTYPE (* MxDecRV9Set)(GFMxDecRV9Handle hMxDecRV9, NvU32 uiFeature, void * pInfo);
+
+
+
+
+/** This function Decodes the picture header and gives the related information in
+ PictureHeader.
+ @param hMxDecRV9 (GFMxDecRV9Handle) Handle specific to MxDecRV9API
+ @param pPictureHeader Pointer to the #GFMXDECRV9PICHDR.
+ @retval GF_SUCCESS \a if it successfully decodes the Header
+ @retval GF_ERROR Some error occured
+ GF_ERROR Return values for the above function
+
+ #GF_ERROR_RV9DECPICTUREHDR_DETECTED
+ There is a sequence header in the bit stream.
+ Application need to decide this sequence is an error or this
+ is intended to be in the bit stream.
+ #GF_ERROR_RV9DECPICTUREHDR_END_OF_FILE
+ No more bit stream from application.
+ #GF_ERROR_RV9DECPICTUREHDR_CORRUPTED
+ GFMxDecRV9DecPicture encounters an un-recoverable error
+ in the bit stream. Application should call GFMxDecRV9Resync
+ API to skip this picture.
+ #GF_ERROR_RV9DECPICTUREHDR_NOT_ENOUGH_MEM
+ There is not enough memory.
+
+
+ @see GFMXDECRV9PICHDR
+*/
+ GF_RETTYPE (* MxDecRV9DecodePictureHeader)(GFMxDecRV9Handle hMxDecRV9, PGFMXDECRV9PICHDR pPictureHeader);
+
+
+ /** This function decodes one frame from the bitstream.
+ @param hMxDecRV9 (GFMxDecRV9Handle) Handle specific to MxDecRV9API
+ @param pFrame pointer to #PGFMXDECRV9FRAME
+ @retval GF_SUCCESS \a if successful
+ @retval #GF_MXDEC_RV9_FRAMEDEC_EOF_REACHED \a No more bit streams from the application.
+
+*/
+ GF_RETTYPE (* MxDecRV9DecodeFrame)(GFMxDecRV9Handle hMxDecRV9, PGFMXDECRV9FRAME pFrame);
+
+
+
+/** GFMxDecRV9Resync re-synchronizes to a specific position of a bit stream..
+ @param hMxDecRV9 (GFMxDecRV9Handle) Handle specific to MxDecRV9API
+ @param ResyncOption :
+
+ #GF_MXDEC_RV9_RESYNC_FORWARD_NEAREST_I_FRAME.
+ Resynchronize forward to the nearest I frame.
+ #GF_MXDEC_RV9_RESYNC_BACKWARD_NEAREST_I_FRAME.
+ Resynchronize backward to the nearest I frame.
+ #GF_MXDEC_RV9_RESYNC_BACKWARD_NEAREST_P_FRAME.
+ Resynchronize backward to the nearest P frame.
+
+ @retval GF_SUCCESS \a if successful
+ @retval GF_ERROR Some error occured
+
+*/
+ GF_RETTYPE (* MxDecRV9Resync)(GFMxDecRV9Handle hMxDecRV9, NvU32 ResyncOption);
+
+
+
+
+ GF_RETTYPE (* MxDecRV9InterruptControl)(GFMxDecRV9Handle hMxDecRV9,
+ GF_MXDEC_RV9_INTERRUPT_TYPE IntType, GF_MXDEC_RV9_INTERRUPT_OPERATION_TYPE op,
+ void * pData);
+
+
+
+ /** This function provides component-level interrupt control for the
+ MxDecRV9API. It is optional because an interrupt service thread (IST) at the
+ application level can call the MxDecRV9API to complete the task.
+ @param hMxDecRV9(GFMxDecRV9Handle) Handle specific to MxDecRV9API
+ @param IntType MxDecRV9API interrupt type as defined in
+ #GF_MXDEC_RV9_INTERRUPT_TYPE
+ @param pData Pointer to data being passed in or out.
+ @retval GF_SUCCESS \a if successful.
+ @retval GF_ERROR Some error occured.
+
+*/
+ GF_RETTYPE (* MxDecRV9InterruptHandler)(GFMxDecRV9Handle hMxDecRV9,
+ GF_MXDEC_RV9_INTERRUPT_TYPE IntType, void * pData); // Reserved.
+
+} GFMXDECRV9TABLE, *PGFMXDECRV9TABLE;
+
+// Typesafe functions for opening and closing this component
+GF_RETTYPE GFMxDecRV9Open(GFRmHandle hRm, GFMxDecRV9Handle *phMxDecRV9,
+ GF_STATE_TYPE state, GFRmChHandle hCh);
+void GFMxDecRV9Close(GFMxDecRV9Handle *phMxDecRV9);
+
+#if NVCPU_IS_XTENSA
+#define MXDRV9OFFSET sizeof(GFMXDECRV9TABLE)
+#else
+#define MXDRV9OFFSET 0
+#endif
+
+
+//ERROR return values for the GFMxDecRV9DecodePictureHeader()
+
+/** ERROR return values for the GFMxDecRV9DecodePictureHeader() \n
+ There is a sequence header in the bit stream.
+ Application need to decide this sequence is an error or this
+ is intended to be in the bit stream.
+ @see GFMXDECRV9TABLE::MxDecRV9DecodePictureHeader
+*/
+#define GF_ERROR_RV9DECPICTUREHDR_DETECTED 0x00000001
+
+
+/**ERROR return values for the GFMxDecRV9DecodePictureHeader() \n
+ No more bit stream from application.
+ @see GFMXDECRV9TABLE::MxDecRV9DecodePictureHeader
+*/
+#define GF_ERROR_RV9DECPICTUREHDR_END_OF_FILE 0x00000002
+
+
+/** ERROR return values for the GFMxDecRV9DecodePictureHeader() \n
+ GFMxDecRV9DecPicture encounters an un-recoverable error
+ in the bit stream. Application should call GFMxDecRV9Resync
+ API to skip this picture.
+ @see GFMXDECRV9TABLE::MxDecRV9DecodePictureHeader
+*/
+#define GF_ERROR_RV9DECPICTUREHDR_CORRUPTED 0x00000003
+
+/**ERROR return values for the GFMxDecRV9DecodePictureHeader() \n
+ There is not enough memory.
+*/
+#define GF_ERROR_RV9DECPICTUREHDR_NOT_ENOUGH_MEM 0x00000004
+
+//ERROR return values for MxDecRV9DecodeFrame()
+/** ERROR return values for MxDecRV9DecodeFrame()\n
+ API returns this error when End of file is reached,i.e No more bit stream from application.
+ once this ERROR is returned, the application should provide more media files to decode or
+ exit gracefully.*/
+#define GF_MXDEC_RV9_FRAMEDEC_EOF_REACHED 0x00000001
+
+/* #### MxDecRV9API Helper macros. Maybe useful for backward compatible API. #### */
+
+
+/* #### MxDecRV9 Helper macros. Maybe useful for backward compatible API. #### */
+#define GFMxDecRV9GetProperty(hMxDecRV9, pMXProp) \
+ ((PGFMXDECRV9TABLE)((NvU32)hMxDecRV9+MXDRV9OFFSET))->MxDecRV9GetProperty(hMxDecRV9, pMXProp)
+
+#define GFMxDecRV9GetStatus(hMxDecRV9, pStatus) \
+ ((PGFMXDECRV9TABLE)((NvU32)hMxDecRV9+MXDRV9OFFSET))->MxDecRV9GetStatus(hMxDecRV9, pStatus)
+
+#define GFMxDecRV9DecodePictureHeader(hMxDecRV9, pPictureHeader)\
+ ((PGFMXDECRV9TABLE)((NvU32)hMxDecRV9+MXDRV9OFFSET))->MxDecRV9DecodePictureHeader(hMxDecRV9, pPictureHeader)
+
+#define GFMxDecRV9PostProcessing(hMxDecRV9, pP) \
+ ((PGFMXDECRV9TABLE)((NvU32)hMxDecRV9+MXDRV9OFFSET))->MxDecRV9PostProcessing(hMxDecRV9, pP);
+
+#define GFMxDecRV9SetAttribute(hMxDecRV9, uiFeature, pInfo) \
+ ((PGFMXDECRV9TABLE)((NvU32)hMxDecRV9+MXDRV9OFFSET))->MxDecRV9SetAttribute(hMxDecRV9, uiFeature, pInfo)
+
+#define GFMxDecRV9GetAttribute(hMxDecRV9, uiFeature, pInfo) \
+ ((PGFMXDECRV9TABLE)((NvU32)hMxDecRV9+MXDRV9OFFSET))->MxDecRV9GetAttribute(hMxDecRV9, uiFeature, pInfo)
+
+#define GFMxDecRV9Set(hMxDecRV9, uiFeature, pInfo) \
+ ((PGFMXDECRV9TABLE)((NvU32)hMxDecRV9+MXDRV9OFFSET))->MxDecRV9Set(hMxDecRV9, uiFeature, pInfo)
+
+#define GFMxDecRV9DecodeFrame(hMxDecRV9, pFrame) \
+ ((PGFMXDECRV9TABLE)((NvU32)hMxDecRV9+MXDRV9OFFSET))->MxDecRV9DecodeFrame(hMxDecRV9, pFrame)
+
+#define GFMxDecRV9Resync(hMxDecRV9, ResyncOption) \
+ ((PGFMXDECRV9TABLE)((NvU32)hMxDecRV9+MXDRV9OFFSET))->MxDecRV9Resync(hMxDecRV9, ResyncOption)
+
+#define GFMxDecRV9InterruptControl(hMxDecRV9, IntType, op, pData)\
+ ((PGFMXDECRV9TABLE)((NvU32)hMxDecRV9+MXDRV9OFFSET))->MxDecRV9InterruptControl(hMxDecRV9, IntType, op, pData)
+
+#define GFMxDecRV9InterruptHandler(hMxDecRV9, IntType, pData)\
+ ((PGFMXDECRV9TABLE)((NvU32)hMxDecRV9+MXDRV9OFFSET))->MxDecRV9InterruptHandler(hMxDecRV9, IntType, pData)
+
+
+
+/*@}*/
+/*@}*/
+
+
+/** @page pageMxDecRV9AppNotes MxDecRV9API Application Notes
+ @section pageMxDecRV9AppNotes1 Programming Sequence
+
+ The following procedure requires that GFRmOpen() is called first to start
+ GFSDK usage.
+
+
+
+ 1. Call GFMxDecRV9Open() to obtain RV9Handle. This handle will be passed to different functions of MxDecRV9API.
+
+ 2. Call GFMxDecRV9GetProperty()to querry the properties.Check whether this
+ MxDecRV9API version can support the desired RV9 profile and level.
+
+ 3. Set different attributes of RV9 decoder using GFMxDecRV9SetAttribute(),
+ #GFMXDECRV9TABLE::MxDecRV9SetAttribute.
+
+ 4. Decode the picture header using GFMxDecRV9DecodePictureHeader(),
+ #GFMXDECRV9TABLE::MxDecRV9DecodePictureHeader.
+
+ 5. call GFRmSurfaceAlloc() to allocate at least one reference surface and one
+ current surface for decoding purposes.
+
+ 6. If the postprocessing engine is needed, allocate one surface to hold the
+ postprocessing results.
+
+ 7. For display purposes, the decoder application could call GFVxBlt() for
+ the following two scenarios. Please refer to the latest GFVxAPI document
+ for additional information.
+ Performing color space conversion and then a stretch blit to the primary surface directly.
+ Blitting to the overlay surface.
+
+ 8. The decoder application should decode on frame by frame basis. Call GFMxDecRV9DecodeFrame() to decode each frame.
+ once GF_MXDEC_RV9_FRAMEDEC_EOF_REACHED is returnd by API, application should exit gracefully.
+ #GFMXDECRV9TABLE::MxDecRV9DecodeFrame
+
+ 9. If Post processing is enabled , call GFMxDecRV9PostProcessing().
+ #GFMXDECRV9TABLE::MxDecRV9PostProcessing
+
+ 10. Before exiting the application, the decoder application should call
+ GFRmSurfaceFree() to free the surfaces that have been allocated.
+
+ 11. Call GFMxDecRV9Close() with RV9Handle to release the resources of the decoder module.
+
+*/
+
+
+#ifdef __cplusplus
+} // only need to export C interface if
+ // used by C++ source code
+#endif
+
+#endif
diff --git a/Start_WM/test6/inc/GFMxDecVC1.h b/Start_WM/test6/inc/GFMxDecVC1.h
new file mode 100755
index 00000000..da28a6ec
--- /dev/null
+++ b/Start_WM/test6/inc/GFMxDecVC1.h
@@ -0,0 +1,732 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/** @file GFMxDecVC1.h
+GFSDK VC1 Decode API header file.
+*/
+
+#ifndef _GF_MPEG_DEC_VC1__
+#define _GF_MPEG_DEC_VC1__
+
+#include "nvtypes.h"
+#include "GFVx.h"
+#include "GFDef.h"
+
+#ifdef __cplusplus
+extern "C" { // only need to export C interface if
+ // used by C++ source code
+#endif
+
+ /** @addtogroup groupMxDecVC1 MxDecVC1API VC1 Decode API
+ The VC1 decoder API handles WMV simple profile-compliant bit
+ streams for this version, but has been defined to handle all of the three
+ profiles for future expansion.
+
+ The VC1 decoder API has two sets of APIa high level API and a low
+ level API.
+
+ Using the High Level API
+
+ The high level API has a built-in entropy decoder. It decodes the bit stream.
+ This high level API calls the low level API internally. When using the high level API, the
+ application can ignore the low level API.
+
+ The MxDecVC1API high level functions include the following:
+ - GFMxDecVC1DecSequenceLayer()
+ - GFMxDecVC1DecPicture()
+ - GFMxDecVC1Set()
+
+ Using the Low Level API
+
+ The low level API is essentially a macroblock decoder engine. It decodes
+ macroblock by macroblock. When using the low level API, the application
+ needs to handle the entropy decoding. The low level
+ API assumes that the information passed from caller is correct, and does not
+ have any error concealment functionality build in. The application which
+ called the low level API must make sure that no macroblocks are missing for
+ any picture.
+
+ The MxDecVC1API low level functions include the following:
+ - GFMxDecVC1SetPicture()
+ - GFMxDecVC1SetMBs()
+ - GFMxDecVC1SetPicture()
+
+
+ @ref pageMxDecVC1AppNotes
+
+ @ref pageMxDecVC1AppNotes1
+
+
+ */
+ /*@{*/
+
+ // MXDECVC1CapFlags
+
+ /** MxDecVC1API property flag: Simple profile supported.
+ @see GFMxDecVC1GetProperty(), GFPROPERTY::Capability
+ */
+#define GF_MXDEC_VC1_CAP_SIMPLE 0x00000001
+
+ /** MxDecVC1API property flag: Main profile supported.
+ @see GFMxDecVC1GetProperty(), GFPROPERTY::Capability
+ */
+#define GF_MXDEC_VC1_CAP_MAIN 0x00000002
+
+ /** MxDecVC1API property flag: Extended profile supported.
+ @see GFMxDecVC1GetProperty(), GFPROPERTY::Capability
+ */
+#define GF_MXDEC_VC1_CAP_ADVANCE 0x00000004
+
+ /** MxDecVC1API property flag: Low LEVEL supported.
+ @see GFMxDecVC1GetProperty(), GFPROPERTY::Capability
+ */
+#define GF_MXDEC_VC1_CAP_LOWLEVEL 0x00000008
+
+ /** MxDecVC1API property flag: Medium LEVEL supported.
+ @see GFMxDecVC1GetProperty(), GFPROPERTY::Capability
+ */
+#define GF_MXDEC_VC1_CAP_MEDIUMLEVEL 0x00000010
+
+ /** MxDecVC1API property flag: High LEVEL supported.
+ @see GFMxDecVC1GetProperty(), GFPROPERTY::Capability
+ */
+#define GF_MXDEC_VC1_CAP_HIGHLEVEL 0x00000100
+
+ /** MxDecVC1API property flag: LEVEL 0 supported.
+ @see GFMxDecVC1GetProperty(), GFPROPERTY::Capability
+ */
+#define GF_MXDEC_VC1_CAP_LEVEL0 0x00000200
+
+ /** MxDecVC1API property flag: LEVEL 1 supported.
+ @see GFMxDecVC1GetProperty(), GFPROPERTY::Capability
+ */
+#define GF_MXDEC_VC1_CAP_LEVEL1 0x00000400
+
+ /** MxDecVC1API property flag: LEVEL 2 supported.
+ @see GFMxDecVC1GetProperty(), GFPROPERTY::Capability
+ */
+#define GF_MXDEC_VC1_CAP_LEVEL2 0x00000800
+
+ /** MxDecVC1API property flag: LEVEL 3 supported.
+ @see GFMxDecVC1GetProperty(), GFPROPERTY::Capability
+ */
+#define GF_MXDEC_VC1_CAP_LEVEL3 0x00001000
+
+ /** MxDecVC1API property flag: LEVEL 4 supported.
+ @see GFMxDecVC1GetProperty(), GFPROPERTY::Capability
+ */
+#define GF_MXDEC_VC1_CAP_LEVEL4 0x00002000
+
+
+ /**Enable the DSP side profiling */
+//#define GF_ENABLE_PROFILER 1
+
+// to divert the code for checking the non-working of hw modules as of now
+#define USE_HW_MODULES
+
+ /** Parameter structure for MxDecVC1DecSequenceLayer().
+ Both input and output parameters are passed via this structure to MxDecVC1DecSequenceLayer().
+ @see MxDecVC1DecSequenceLayer()
+ */
+
+
+ typedef struct _GFMXDECVC1DECSEQUENCELAYER
+ {
+
+ NvU32 uiSequenceOption; /**< Input flags, see GFMXDECVC1_DECSEQUENCEOPTION_* */
+ NvU8 ucSequenceLayerInfo; /**< SequenceLayerInfo Definition */
+ NvU16 usWidth; /**< Horizontal size of the coded picture in pixels */
+ NvU16 usHeight; /**< Vertical size of the coded picture in pixels */
+ NvU8 ucProfile; /**< Profile of the sequence */
+ NvU8 ucLevel; /**< Level of the sequence */
+ NvU32 uiHRDRate; /**< Peak transmission rate R in bits per second */
+ NvU32 uiHRDBufferSize; /**< Buffer size B in milliseconds. */
+ NvU32 uiFrameRate; /**< Rounding frame rate of the encoded clips */
+ NvU8* pPreFillBuffer; /**< Input, Pointer bitstream for sequence header to decode */
+ NvU32 PreFillBufferLength; /**< Input, Length of bitstream in bytes, must cover the entire sequence header */
+ NvU32 PreFillBufferBytesConsumed;/**< Output, Amount of bytes consumed by the component */
+
+ } GFMXDECVC1DECSEQUENCELAYER, *PGFMXDECVC1DECSEQUENCELAYER;
+
+ //SequenceLayerInfo:
+#define MXDEC_VC1_CONSTANT_BITRATE 0x00000001 /**< Flag is set when the sequence is encoded at constant bitrate */
+#define MXDEC_VC1_MULTIRESOLUTION 0x00000002 /**< Flag indicating that the frames can be coded at smaller */
+ //resolution. Resolution change is allowed only on I pictures.
+ //Information of the picture
+
+ /** GFMXDECVC1DECSEQUENCELAYER::uiSequenceOption input flagbit: Bitstream is passed with GFMxDecVC1DecSequenceLayer().
+ If this flag is set bitstream data is passed with the call to GFMxDecVC1DecSequenceLayer()
+ instead via the read bitstrem callback. This can be used only with boundary detection
+ on application level. The bitstream data is passed via GFMXDECVC1DECSEQUENCELAYER::pPreFillBuffer and
+ GFMXDECVC1DECSEQUENCELAYER::PreFillBufferLength.
+ */
+#define GFMXDECVC1_DECSEQUENCEOPTION_PREFILLBUFFER 0x00000001
+
+
+ /** Parameter structure for MxDecVC1DecPicture().
+ Both input and output parameters are passed via this structure to MxDecVC1DecPicture().
+ @see MxDecVC1DecPicture()
+ */
+ typedef struct _GFMXDECVC1DECPICTURE
+ {
+ /**< the following fields are set by app */
+ NvU32 uiPictureOption; /**< Set by application. Set to 0 for this version.*/
+ PGFRMSURFACE pRef; /**< Reference Picture Surface */
+ PGFRMSURFACE pCur; /**< Current Picture Surface */
+ PGFRECT pRefRect; /**< pRefSurfRect specified a rectangular area within
+ the pRef surface, and GFMxDecVC1 references the
+ image in the pRefSurfRect area of the pRef surface.
+ If pRefSurfRect is NULL, entire pRef surface is referred.*/
+
+ PGFRECT pCurRect; /**pCurSurfRect specified a rectangular area within
+ the pCur surface, and GFMxDecVC1 references the
+ image in the pCurSurfRect area of the pCur surface.
+ If CurSurfRect is NULL, entire pCur surface is referred.
+ */
+
+ /**< the following fields are set by MxDecVC1DecPicture API */
+ NvU32 uiPictureInfo; /**< Current Picture Information. */
+
+ NvU8* pPreFillBuffer; /**< Input, Pointer bitstream for frame to decode */
+ NvU32 PreFillBufferLength; /**< Input, Length of bitstream in bytes, must cover the entire frame */
+ NvU32 PreFillBufferBytesConsumed; /**< Output, Amount of bytes consumed by the component */
+
+ NvU32 uiTimeStamp; /**< Value Specified in Picture Layer Header.*/
+ NvU8 * pMBInfo; /**< each element tells the particular MB is wrong or not.*/
+
+#ifdef GF_ENABLE_PROFILER
+
+ NvU32 DSPTimers[10];
+#endif
+
+ } GFMXDECVC1DECPICTURE, *PGFMXDECVC1DECPICTURE;
+
+ //PictureInfo:
+#define MXDEC_VC1_DEC_PICTURE_P 0x00000001 //Flag is set when current Picture is P type
+#define MXDEC_VC1_DEC_NOT_CODED 0x00000010 //Flag is set when current picture is not coded.
+
+//uiPictureOption
+
+/** GFMXDECVC1DECPICTURE::uiPictureOption input flagbit: Use target rectangle.
+ If this flag is set, the GFMXDECVC1DECPICTURE::pPictureRect will point to
+ a rectangle on the output surface, where the reconstructed frame is placed.
+*/
+#define GF_MXDEC_VC1_DEC_PICTURE_SPECIFY_SURF_RECT 0x00000001
+
+/** GFMXDECVC1DECPICTURE::uiPictureOption input flagbit: Bitstream is passed with MxDecVC1DecPicture().
+ If this flag is set bitstream data is passed with the call to MxDecVC1DecPicture()
+ instead via the read bitstrem callback. This can be used only with frame boundary detection
+ on application level. The bitstream data is passed via GFMXDECVC1DECPICTURE::pPreFillBuffer and
+ GFMXDECVC1DECPICTURE::PreFillBufferLength.
+*/
+#define GF_MXDEC_VC1_DEC_PICTURE_SPECIFY_PREFILLBUFFER 0x00000002
+
+/** GFMXDECVC1DECPICTURE::uiPictureOption input flagbit: If This Flag is Set Reading of
+ .rcv wrapper will be skipped for each picture.
+*/
+#define GF_MXDEC_VC1_DEC_PICTURE_SPECIFY_SKIP_RCV_WRAPPER 0x00000004
+
+ /**Low level API Picture structure
+ */
+ typedef struct _GFMXDECVC1PICTURE
+ {
+ NvU32 PictureInfo; /**< Current Picture Information defined in
+ //GFMXDECVC1PICTURE Definitions */
+ PGFRMSURFACE pRef; /**< Reference Picture Surface */
+ PGFRMSURFACE pCur; /**< Current Picture Surface */
+ PGFRECT pRefRect; /**< pRefSurfRect specified a rectangular area
+ within the pRef surface, and GFMxDecVC1
+ references the image in the pRefSurfRect
+ area of the pRef surface. If pRefSurfRect is NULL,
+ entire pRef surface is referred. */
+ PGFRECT pCurRect; /**< pCurSurfRect specified a rectangular area
+ within the pCur surface, and GFMxDecVC1
+ references the image in the pCurSurfRect
+ area of the pRef surface. If pCurSurfRect is NULL,
+ entire pCur surface is referred. */
+
+ } GFMXDECVC1PICTURE, *PGFMXDECVC1PICTURE;
+ //PictureInfo:
+#define MXDEC_VC1_PICTURE_P_PICTURE 0x00000001
+ //Indicates a P Picture when set otherwise a I Picture
+#define MXDEC_VC1_PICTURE_SPECIFY_REFSURF_RECT 0x00000002
+ //If this Flag is set, pRefSurfRect must be set, and GFMxDecVC1
+ //references the image in the pRefSurfRect area of the pRef surface.
+ //Otherwise entire pRef surface is referred.
+#define MXDEC_VC1_PICTURE_SPECIFY_CURSURF_RECT 0x00000004
+ //If this Flag is set, pCurSurfRect must be set, and GFMxDecVC1 outputs
+ //the decoded image in the pCurSurfRect area of the pCur surface.
+ //Otherwise entire pCur surface is referred.
+#define MXDEC_VC1_PICTURE_ROUNDING_ONE 0x00000008
+ //PICTURE_ROUNDING_TYPE is one
+
+
+ /**motion vector information for current macroblock*/
+
+ typedef struct _GFMXDECVC1VECTOR
+ {
+ NvS16 sH_MV_DATA; /**< Horizonal motion vector data. */
+ NvS16 sV_MV_DATA; /**< Vertical motion vector data. */
+ } GFMXDECVC1VECTOR, *PGFMXDECVC1VECTOR;
+
+ /**coefficient information for macroblock*/
+
+ typedef struct _GFMXDECVC1COEF
+ {
+ NvU8 uiLAST; /**< This last non-zero coefficient in current block */
+ NvU8 uiRUN; /**< How many zeroes precede this coefficient */
+ NvS16 iLEVEL; /**< This coefficient's level value */
+ } GFMXDECVC1COEF, *PGFMXDECVC1COEF;
+
+ /**macroblock information*/
+
+ typedef struct _GFMXDECVC1MB
+ {
+ NvU16 uiX; /**< MB's x position in the picture*/
+ NvU16 uiY; /**< MB's y position in the picture*/
+ NvU32 uiMBInfo; /**< MacroBlock characteristics*/
+ NvU32 uiBlkType[6]; /**< Block characteristics*/
+ NvU8 uiBlkCoded[6]; /**< Block characteristics*/
+ NvU8 uiBlkNZC[6]; /**< Block characteristics*/
+ NvU8 ucFirstCodedBlk; /**< First Coded Block in Macroblock*/
+ NvU16 uiQuantiser; /**< current MB's quantiser*/
+ GFMXDECVC1VECTOR Vector[4]; /**< motion vector zero ~ three*/
+ NvU32 uiNumofCoef; /**< number of GFMXDECVC1COEF //structures for current MB*/
+
+ } GFMXDECVC1MB, *PGFMXDECVC1MB;
+
+ //MBInfo:
+#define MXDEC_VC1_MB_TYPE_INTER 0x1 //inter mb
+
+ /*Quantiser Type of MacroBlock */
+#define MXDEC_VC1_MB_NON_UNIFORM_QUANTISER 0x2 //Non Uniform Quantiser
+
+
+#define MXDEC_VC1_MB_AC_PRED_ON 0x80 //AC prediction is on
+#define MXDEC_VC1_MB_FIELDTX 0x100
+#define MXDEC_VC1_MB_MV_1_MVS 0x200 //1 motion vector coded
+#define MXDEC_VC1_MB_MV_4_MVS 0x400 //4 motion vector coded
+#define MXDEC_VC1_MB_SKIPPED 0x800 //Macro Block not coded
+
+ /* Motion vector direction bits [15:14] */
+#define MXDEC_VC1_MB_DIRECT 0x1000
+#define MXDEC_VC1_MB_FORWARD 0x2000
+#define MXDEC_VC1_MB_BACKWARD 0x4000
+
+#define MXDEC_VC1_MB_AUTO_DISPLAY 0x8000
+#define MXDEC_VC1_MB_OVERLAP 0x10000
+
+
+#define MXDEC_VC1_MB_MV_MODE1MV_HALF_PEL_BILINEAR 0x20000
+#define MXDEC_VC1_MB_MV_MODE1MV_HALF_PEL 0x40000
+#define MXDEC_VC1_MB_MV_MODE_MIXED_MV 0x100000
+#define MXDEC_VC1_MB_MV_MODE_INTENSITY_COMP 0x200000
+
+#define MXDEC_VC1_MB_MV_RANGE_64_32 0x400000
+#define MXDEC_VC1_MB_MV_RANGE_128_64 0x800000
+#define MXDEC_VC1_MB_MV_RANGE_512_128 0x1000000
+#define MXDEC_VC1_MB_MV_RANGE_1024_256 0x2000000
+
+
+ //uiBlkInfo
+#define MXDEC_VC1_BLK_CODED 0x1
+
+
+#define MXDEC_VC1_BLK_INTER 0x2
+#define MXDEC_VC1_BLK_INTER8X8 0x4
+#define MXDEC_VC1_BLK_INTER8X4 0x8
+#define MXDEC_VC1_BLK_INTER4X8 0x10
+#define MXDEC_VC1_BLK_INTER4X4 0x20
+#define MXDEC_VC1_BLK_INTER_ANY 0x40
+
+#define MXDEC_VC1_BLK_INTRA 0x80
+#define MXDEC_VC1_BLK_INTRA_TOP 0x100
+#define MXDEC_VC1_BLK_INTRA_LEFT 0x200
+
+
+#define MXDEC_VC1_SUBBLK_0 0x1
+#define MXDEC_VC1_SUBBLK_1 0x2
+#define MXDEC_VC1_SUBBLK_2 0x4
+#define MXDEC_VC1_SUBBLK_3 0x8
+
+
+
+ //After GFMX decodes this Macro Block, it will auto trigger video engine to display
+ //this VOP if decoder application set auto blt on through GFVxBlt.
+ //If MXDEC_MB_AUTO_PP and MXDEC_MA_AUTO_DISPLAY both on, //GFMX will trigger Post Processing first, then trigger display engine.
+
+
+ // definition for attribute
+
+ /** GFMxDecVC1 Attribute: Application will determine the decoding boundary, this boundary
+ means sequence and picture layer boundary.
+ Interpretation of block referenced by \a pInfo parameter:
+
+ NvU32 1: APP will determine the decoding boudary
+ 0: APP will not determine the decoding boundary
+
+
+ @see GFMxDecVC1GetAttribute(), GFMxDecVC1SetAttribute()
+ */
+#define GF_MXDEC_VC1_ATTR_PRE_DETERMINED_BOUNDARY 0x00000001
+
+ /** GFMxDecVC1 Attribute: This attribute only can be used for GFMxDecGetAttribute
+ If application wants to set pDestRect in GFMXDECPICTURE or GFMXDECVC1DECPICTURE,
+ application must use this attributes to get allignment information and
+ align the rectangle top & left corner accordinately.
+ *pInfo: top fieled alignment in term of lines
+ */
+#define GF_MXDEC_VC1_ATTR_DEC_PICTURE_RECT_TOP_ALIGNMENT 0x00000010
+
+ /** GFMxDecVC1 Attribute: This attribute only can be used for GFMxDecVC1GetAttribute
+ If application wants to set pDestRect in GFMXDECVC1PICTURE or GFMXDECVC1DECPICTURE,
+ application must use those attributes to get allignment information and
+ align the rectangle top & left corner accordinately.
+ *pInfo: left fieled alignment in term of pixels
+ */
+#define GF_MXDEC_VC1_ATTR_DEC_PICTURE_RECT_LEFT_ALIGNMENT 0x00000011
+
+ /** GFMxDecVC1 Attribute: Save decoder internal state information. This attribute only can be used for GFMxDecVC1GetAttribute
+ *pInfo: state handle
+ */
+#define GF_MXDEC_VC1_ATTR_DEC_SAVE_STATE 0x00000012
+
+ /** GFMxDecVC1 Attribute: Restore decoder internal state information. This attribute only can be used for GFMxDecVC1SetAttribute
+ *pInfo: state handle
+ */
+#define GF_MXDEC_VC1_ATTR_DEC_RESTORE_STATE 0x00000013
+
+ /** GFMxDecVC1 Attribute: Delete particular state handle. This attribute only can be used for GFMxDecVC1SetAttribute
+ *pInfo: state handle
+ */
+#define GF_MXDEC_VC1_ATTR_DEC_DELETE_STATE 0x00000014
+
+#define GF_MXDEC_VC1_ATTR_DEC_ENABLE_RAISE_WAIT 0x00000015
+ //Use this attribute to enable RaiseWait mechanish. This is required for OpenMax application.
+ //Decoder works in FRAME_DONE polling mode by default.This attribute only can be used for GFMxDecVC1SetAttribute
+ //*pInfo: state handle.
+
+ typedef struct _GFMXDECVC1PP
+ {
+ PGFRMSURFACE* pDestSurf;/**< pointer to an array of surfaces that will
+ hold the result from Post Processing
+ pointer to an array of surfaces to
+ accommodate auto post processing
+ */
+ PGFRMSURFACE* pSrcSurf; /**< pointer to an array of surfaces to be //post processed
+ pointer to an array of surfaces to
+ accommodate auto post processing
+ */
+ PGFRECT pRect; /**< Rectangle area to be processed for both
+ src and dest surface
+ */
+ NvU32 numofDestSurf; /**< If MXDEC_PP_AUTO flag is set, this
+ parameter must be filled
+ */
+ NvU32 numofSrcSurf; /**< If MXDEC_PP_AUTO flag is set, this
+ parameter must be filled
+ */
+ NvU8 * lpQuantiser; /**< point to array of QPs for Macro Blocks in
+ the source VOP. GFMX automatically saved
+ the last two decoded VOP's QP tables,
+ Decoder application may not need to reload
+ the table if it can make sure the source
+ VOP is the one within the last decoded
+ VOPs. If MXDEC_PP_RELOAD_QUANTIZER is set,
+ this field must be filled.
+ */
+ NvU32 PPOption; /**
+ GF_MXDEC_VC1_READ_BITSTREAM_FORWARD Forward scan
+ GF_MXDEC_VC1_READ_BITSTREAM_BACKWARD Backward scan
+
+
+ @return If the #MXDEC_ATTR_PRE_DETERMINED_BOUNDARY attribute is set, the callback
+ should return #GF_MXDEC_VC1_BOUNDARY_REACHED when a frame boundary is
+ detected, or 0 if no boundary is detected.
+ If the #MXDEC_ATTR_PRE_DETERMINED_BOUNDARY attribute is not set, the callback
+ should return 0.
+ */
+
+ /**pPara is a parameter passed from APP,
+ and APP wants API to call back with this parameter */
+
+ NvU32 (*pCallBack)(void * pPara, NvU8 ** ppBuffer, NvS32 * BufferLength, NvU32 uFlag);
+ /** If APP set GF_MXDEC_ATTR_PRE_DETERMINED_BOUNDARY,
+ APP should return GF_MXDEC_VC1_BOUNDARY_REACHED when the boundary is
+ detected.
+ If APP does not set GF_MXDEC_ATTR_PRE_DETERMINED_BOUNDARY,
+ 0 should be returned. */
+
+ }GFMXDECVC1CALLBACK, *PGFMXDECVC1CALLBACK;
+
+ /** GFMXDECVC1CALLBACK::pCallBack return code */
+#define GF_MXDEC_VC1_BOUNDARY_REACHED 0x00000001
+ /** GFMXDECVC1CALLBACK::pCallBack uFlag value: Stream forward scan. */
+#define GF_MXDEC_VC1_READ_BITSTREAM_FORWARD 0x00000002
+ /** GFMXDECVC1CALLBACK::pCallBack uFlag value: Stream backward scan. */
+#define GF_MXDEC_VC1_READ_BITSTREAM_BACKWARD 0x00000003
+
+
+
+ typedef enum
+ {
+ GFMX_DEC_VC1_INTERRUPT_ENABLE,
+ GFMX_DEC_VC1_INTERRUPT_DISABLE,
+ GFMX_DEC_VC1_INTERRUPT_CLEAR
+ } GFMX_DEC_VC1_INTERRUPT_OPERATION_TYPE; // Interrupt operation.
+
+ typedef enum
+ {
+ GFMX_DEC_VC1_DECODE_DONE_INTR,
+ GFMX_DEC_VC1_POST_PROCESSING_DONE_INTR,
+ GFMX_DEC_VC1_DSP_COMMAND_INTR,
+ } GFMX_DEC_VC1_INTERRUPT_TYPE;
+
+ typedef struct _GFMXDECVC1TABLE
+ {
+ GF_RETTYPE (* MxDecVC1GetProperty)(GFMxDecVC1Handle hMxDecVC1, PGFPROPERTY pMXProp );
+ GF_RETTYPE (* MxDecVC1GetStatus)(GFMxDecVC1Handle hMxDecVC1, NvU32 * pStatus);
+ GF_RETTYPE (* MxDecVC1DecSequenceLayer)(GFMxDecVC1Handle hMxDecVC1, PGFMXDECVC1DECSEQUENCELAYER pSequenceLayer);
+ GF_RETTYPE (* MxDecVC1DecPicture)(GFMxDecVC1Handle hMxDecVC1, PGFMXDECVC1DECPICTURE pPicture);
+ GF_RETTYPE (* MxDecVC1SetPicture)(GFMxDecVC1Handle hMxDecVC1, PGFMXDECVC1PICTURE pPicture);
+ GF_RETTYPE (* MxDecVC1SetMBs)(GFMxDecVC1Handle hMxDecVC1, PGFMXDECVC1MB pMBs);
+ GF_RETTYPE (* MxDecVC1SetAttribute)(GFMxDecVC1Handle hMxDecVC1, NvU32 uiFeature, NvU32* pInfo);
+ GF_RETTYPE (* MxDecVC1GetAttribute)(GFMxDecVC1Handle hMxDecVC1, NvU32 uiFeature, NvU32* pInfo);
+ GF_RETTYPE (* MxDecVC1Set)(GFMxDecVC1Handle hMxDecVC1, NvU32 uiFeature, void * pInfo);
+ GF_RETTYPE (* MxDecVC1InterruptControl)(GFMxDecVC1Handle hMxDecVC1,
+ GFMX_DEC_VC1_INTERRUPT_TYPE IntType, GFMX_DEC_VC1_INTERRUPT_OPERATION_TYPE op,
+ void * pData);
+ GF_RETTYPE (* MxDecVC1InterruptHandler)(GFMxDecVC1Handle hMxDecVC1,
+ GFMX_DEC_VC1_INTERRUPT_TYPE IntType, void * pData); // Reserved.
+ GF_RETTYPE (* MxDecVC1DecResync)(GFMxDecVC1Handle hMxDecVC1, NvU32 ResyncOption);
+ } GFMXDECVC1TABLE, *PGFMXDECVC1TABLE;
+
+// Typesafe functions for opening and closing this component
+GF_RETTYPE GFMxDecVC1Open(GFRmHandle hRm, GFMxDecVC1Handle *phMxDecVC1,
+ GF_STATE_TYPE state, GFRmChHandle hCh);
+void GFMxDecVC1Close(GFMxDecVC1Handle *phMxDecVC1);
+
+#if NVCPU_IS_XTENSA
+#define MXDVC1OFFSET sizeof(GFMXDECVC1TABLE)
+#else
+#define MXDVC1OFFSET 0
+#endif
+
+ /** #### MxDecVC1 Helper macros. Maybe useful for backward compatible API. ####
+ It is a good practice to call this function to query for the API version
+ and its capabilities before using the rest of the MxDecVC1API functions.
+
+ @see GFPROPERTY
+ */
+
+#define GFMxDecVC1GetProperty(hMxDecVC1, pMXProp) \
+ ((PGFMXDECVC1TABLE)((NvU32)hMxDecVC1+MXDVC1OFFSET))->MxDecVC1GetProperty(hMxDecVC1, pMXProp)
+
+#define GFMxDecVC1GetStatus(hMxDecVC1, pStatus) \
+ ((PGFMXDECVC1TABLE)((NvU32)hMxDecVC1+MXDVC1OFFSET))->MxDecVC1GetStatus(hMxDecVC1, pStatus)
+
+ /** Decode sequence header.
+
+ @param hMxDecVC1 (GFMxDecVC1Handle) Handle to MxDecVC1 component
+ @param pSequence (PGFMXDECVC1DECSEQUENCELAYER) Pointer to #GFMXDECVC1DECSEQUENCELAYER parameter structure
+
+ @retval GF_SUCCESS Sequence header was decoded successfully
+
+ This function will be called whenever a sequence header is found in the bitstream, decode
+ it and return its characteristics.
+
+ @see GFMXDECVC1DECSEQUENCELAYER
+ */
+#define GFMxDecVC1DecSequenceLayer(hMxDecVC1, pSequenceLayer)\
+ ((PGFMXDECVC1TABLE)((NvU32)hMxDecVC1+MXDVC1OFFSET))->MxDecVC1DecSequenceLayer(hMxDecVC1, pSequenceLayer)
+
+
+ //return value
+ /** GFMxDecVC1 error code: GFMxDecVC1DecSequenceLayer() encountered end of bitstream.
+ @see GFMxDecVC1DecSequenceLayer()
+ */
+#define GFMXDECVC1_SEQUENCELAYER_ERROR_END_OF_FILE (GFMXDVC1_ERROR | 0x00000001)
+
+ /** GFMxDecVC1 error code: GFMxDecVC1DecSequenceLayer() bitstream format not supported.
+ The sequence header specifies a bitstream format, that is not supported. Most likely
+ reason for this error is that the VC1 profile is not supported.
+ @see GFMxDecVC1DecSequenceLayer()
+ */
+#define GFMXDECVC1_SEQUENCELAYER_ERROR_NOT_SUPPORT_FORMAT (GFMXDVC1_ERROR | 0x00000002)
+
+ /** GFMxDecVC1 error code: GFMxDecVC1DecSequenceLayer() bitstream format is damaged due to
+ erroroneous stream.
+ @see GFMxDecVC1DecSequenceLayer()
+ */
+#define GFMXDECVC1_SEQUENCELAYER_ERROR_HEADER_DAMAGED (GFMXDVC1_ERROR | 0x00000003)
+
+ /** GFMxDecVC1 error code: GFMxDecVC1DecSequenceLayer() encountered out of GPU memory error.
+ The application can try to free GPU memory and call GFMxDecVC1DecSequenceLayer() again.
+ @see GFMxDecVC1DecSequenceLayer()
+ */
+#define GFMXDECVC1_SEQUENCELAYER_ERROR_NOT_ENOUGH_SYSTEM_MEM (GFMXDVC1_ERROR | 0x00000004)
+
+
+ /** Decode a picture.
+
+ @param GFMxDecVC1 (GFMxDecVC1Handle) Handle to MxDecVC1 component
+ @param pPicture (PGFMXDECVC1DECPICTURE) Pointer to #GFMXDECVC1DECPICTURE parameter structure
+
+ @retval GF_SUCCESS Frame was decoded successfully
+ @retval GFMXDECVC1_PICTURE_ERROR_END_OF_FILE End of stream encountered
+ @retval GFMXDECVC1_PICTURE_ERROR_CORRUPTED_PICTURE Unrecoverable bitstream error during frame decode
+ @retval GFMXDECVC1_PICTURE_ERROR_NOT_ENOUGH_SYSTEM_MEM Out of GPU memory
+ @retval GFMXDECVC1_ERROR_RESYNC_END_OF_FILE Resync was found at end of bitstream.
+ @retval GFMXDECVC1_ERROR_P_PICTURE_FOUND_AT_START instead of Inter frame, intra was found in beginning.
+ @retval GFMXDECVC1_ERROR_DSP_TIMEOUT AVP times out
+
+ GFMxDecVC1DecPicture decodes one picture from the bit stream. If GFMxDecVC1DecPicture detects an
+ error, GFMxDecVC1DecPicture returns the error back to the application.
+ If the current stream position is not on the start of a frame, the function scans forward until a frame
+ start or sequence header is detected.
+
+ @see GFMXDECVC1DECPICTURE
+ */
+#define GFMxDecVC1DecPicture(hMxDecVC1, pPicture)\
+ ((PGFMXDECVC1TABLE)((NvU32)hMxDecVC1+MXDVC1OFFSET))->MxDecVC1DecPicture(hMxDecVC1, pPicture)
+
+ //return value
+ /** GFMxDecVC1 error code: GFMxDecVC1DecPicture() encountered end of bitstream.
+ @see GFMxDecVC1DecPicture()
+ */
+#define GFMXDECVC1_PICTURE_ERROR_END_OF_FILE (GFMXDVC1_ERROR | 0x00000005)
+
+ /** GFMxDecVC1 error code: GFMxDecVC1DecPicture() encountered an unrecoverable bitstream error.
+ The application should call GFMxDecVC1DecResync() again, MxDecVC1 will then
+ scan for the next frame boundary and try to decode this frame.
+ @see GFMxDecVC1DecPicture()
+ */
+#define GFMXDECVC1_PICTURE_ERROR_CORRUPTED_PICTURE (GFMXDVC1_ERROR | 0x00000006)
+
+ /** GFMxDecVC1 error code: GFMxDecVC1DecPicture() encountered out of GPU memory error.
+ System memory is not enough to decode Picture. The application can try to free GPU memory and call
+ GFMxDecVC1DecPicture() again.
+ @see GFMxDecVC1DecPicture()
+ */
+#define GFMXDECVC1_PICTURE_ERROR_NOT_ENOUGH_SYSTEM_MEM (GFMXDVC1_ERROR | 0x00000007)
+
+ /** GFMxDecVC1 error code: GFMxDecVC1DecPicture() upon calling GFMxDecVC1DecResync()
+ encountered end of bitstream.
+ @see GFMxDecVC1DecPicture()
+ */
+#define GFMXDECVC1_ERROR_RESYNC_END_OF_FILE (GFMXDVC1_ERROR | 0x00000008)
+
+ /** GFMxDecVC1 error code: GFMxDecVC1DecPicture() got a
+ "P" frame without it's prior reference frame
+ @see GFMxDecVC1DecPicture()
+ */
+#define GFMXDECVC1_ERROR_P_PICTURE_FOUND_AT_START (GFMXDVC1_ERROR | 0x00000009)
+
+ /** GFMxDecVC1 error code: GFMxDecVC1DecPicture() DSP times out while decoding.
+ @see GFMxDecVC1DecPicture()
+ */
+#define GFMXDECVC1_ERROR_DSP_TIMEOUT (GFMXDVC1_ERROR | 0x0000000a) // dsp hang workaround :(
+
+#define GFMxDecVC1SetPicture(hMxDecVC1, pPicture)\
+ ((PGFMXDECVC1TABLE)((NvU32)hMxDecVC1+MXDVC1OFFSET))->MxDecVC1SetPicture(hMxDecVC1, pPicture)
+
+#define GFMxDecVC1SetMBs(hMxDecVC1, pMBs) \
+ ((PGFMXDECVC1TABLE)((NvU32)hMxDecVC1+MXDVC1OFFSET))->MxDecVC1SetMBs(hMxDecVC1, pMBs);
+
+#define GFMxDecVC1SetAttribute(hMxDecVC1, uiFeature, pInfo) \
+ ((PGFMXDECVC1TABLE)((NvU32)hMxDecVC1+MXDVC1OFFSET))->MxDecVC1SetAttribute(hMxDecVC1, uiFeature, pInfo)
+
+#define GFMxDecVC1GetAttribute(hMxDecVC1, uiFeature, pInfo) \
+ ((PGFMXDECVC1TABLE)((NvU32)hMxDecVC1+MXDVC1OFFSET))->MxDecVC1GetAttribute(hMxDecVC1, uiFeature, pInfo)
+
+#define GFMxDecVC1Set(hMxDecVC1, uiFeature, pInfo) \
+ ((PGFMXDECVC1TABLE)((NvU32)hMxDecVC1+MXDVC1OFFSET))->MxDecVC1Set(hMxDecVC1, uiFeature, pInfo)
+
+#define GFMxDecVC1DecResync(hMxDecVC1, ResyncOption) \
+ ((PGFMXDECVC1TABLE)((NvU32)hMxDecVC1+MXDVC1OFFSET))->MxDecVC1DecResync(hMxDecVC1, ResyncOption)
+
+#define GFMxDecVC1InterruptControl(hMxDecVC1, IntType, op, pData)\
+ ((PGFMXDECVC1TABLE)((NvU32)hMxDecVC1+MXDVC1OFFSET))->MxDecVC1InterruptControl(hMxDecVC1, IntType, op, pData)
+
+#define GFMxDecVC1InterruptHandler(hMxDecVC1, IntType, pData)\
+ ((PGFMXDECVC1TABLE)((NvU32)hMxDecVC1+MXDVC1OFFSET))->MxDecVC1InterruptHandler(hMxDecVC1, IntType, pData)
+
+
+ //resynch value
+#define MXDEC_VC1_RESYNC_FORWARD_NEXT_PICTURE 0x00000001
+ // resync to next picture
+#define MXDEC_VC1_RESYNC_FORWARD_NEXT_I_PICTURE 0x00000002
+ // resync to next I Picture
+#define MXDEC_VC1_RESYNC_BACKWARD_PREVIOUS_PICTURE 0x00000004
+ // resync to next picture
+#define MXDEC_VC1_RESYNC_BACKWARD_PREVIOUS_I_PICTURE 0x00000008
+ // resync to next I Picture
+
+ //return value
+#define VC1DECRESYNC_END_OF_FILE 0x00000002 // end of file whie resync
+
+ /*@}*/
+
+ /** @page pageMxDecVC1AppNotes MxDecVC1API Application Notes
+
+ @section pageMxDecVC1AppNotes1 Programming Sequence
+
+ Todo
+ */
+
+
+#ifdef __cplusplus
+} // only need to export C interface if
+// used by C++ source code
+#endif
+
+#endif
+
+
diff --git a/Start_WM/test6/inc/GFMxDemTS.h b/Start_WM/test6/inc/GFMxDemTS.h
new file mode 100755
index 00000000..3dbca68e
--- /dev/null
+++ b/Start_WM/test6/inc/GFMxDemTS.h
@@ -0,0 +1,725 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/** @file GFMxDemTS.h
+ GFSDK MPEG2 Transport Stream API (host) header file.
+*/
+
+#ifndef _GF_MPEG_TS__
+#define _GF_MPEG_TS__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @addtogroup groupMxDemTS MxDemTSAPI MPEG2 Transport Stream Demux API
+
+ This GFSDK component allows to create MPEG TS demux parsers either running
+ on the host or DSP side. TS data can be pushed from the application,
+ or be streamed from VIP.
+
+ The are multiple types of parser objects, see also GFMXDEMTSPARSERTYPE:
+
+ GFMXDEMTSPARSERTYPE_HOST - demux running on host
+ GFMXDEMTSPARSERTYPE_DSP - demux running on DSP
+ GFMXDEMTSPARSERTYPE_DSPAVSYNC - demux running on DSP with additional AVSync functionality
+
+
+ Programming Sequence for Parsers running on Host, TS data from host
+
+ - Call GFMxDemTSParserCreate(), in parameter structure GFMXDEMTSPARSERREQUEST pass
+ parameters #GFMXDEMTSPARSERTYPE_HOST and #GFMXDEMTSPARSERDATASOURCE_PUSH,
+ pass callback functions to handle demuxed substreams
+ - Poll GFMxDemTSParserPushData() to pass the incoming TS stream
+ - Call GFMxDemTSParserDestroy() to destroy parser object
+
+ Programming Sequence for Parsers running on DSP, TS data from host
+
+ - Call GFMxDemTSParserCreate(), in parameter structure GFMXDEMTSPARSERREQUEST pass
+ parameters #GFMXDEMTSPARSERTYPE_DSP and #GFMXDEMTSPARSERDATASOURCE_PUSH,
+ pass callback functions to handle demuxed substreams
+ - Poll GFMxDemTSParserPushData() to pass the incoming TS stream
+ - Call GFMxDemTSParserDestroy() to destroy parser object
+ - Destroy the DSP message handling thread
+
+ Programming Sequence for Parser running on DSP, TS data from VIP
+
+ Only one parser at a time can be created to capture data from VIP.
+ For this mode the parser must run on DSP.
+*/
+/*@{*/
+
+/** GFMxDemTSParser Maximum number of supported Services.
+ For ISDB-T 1seg, the max is 8 according to ARIB TR-B14, p7-28
+*/
+#define GFMXDEMTS_MAX_SERVICE_NO 8
+
+/** GFMxDemTSParser Maximum number of supported Audio PES.
+ For ISDB-T 1seg, the max is 2.
+*/
+#define GFMXDEMTS_MAX_AUDIO_PID_NO 2
+
+/** Get TS Audio PID.
+ For detail see #GFMXDEMTSPARSERAUDIOPIDLIST.
+ @param audio (NvU32) Combined type and ID value
+ */
+#define GFMXDEMTS_GET_AUDIO_PID(audio) (audio & 0x1FFFU) // Get the lower 13 bits
+
+/** Get TS Service Type.
+ For detail see #GFMXDEMTSPARSERAUDIOPIDLIST.
+ @param service (NvU32) Combined type and ID value
+*/
+#define GFMXDEMTS_GET_AUDIO_TYPE(audio) (audio >> 16)
+
+/** TS Audio Pid List. */
+typedef struct _GFMXDEMTSPARSERAUDIOPIDLIST
+{
+ NvU32 uAudioPidList[GFMXDEMTS_MAX_AUDIO_PID_NO]; //!< low 16 bits Audio PID, high 16 bits Audio Type
+ NvU32 uNoOfAudioPids; //!< Number valid entries in uAudioPidList[]
+
+} GFMXDEMTSPARSERAUDIOPIDLIST;
+
+/** Get TS Service ID.
+ For detail see #GFMXDEMTSPARSERPMTPIDLIST.
+ @param service (NvU32) Combined type and ID value
+*/
+#define GFMXDEMTS_GET_PMT_PID(service) ((((NvU32)(service) & 0xffff00) >> 8) | 0x1FC8)
+
+/** Get TS Service Type.
+ For detail see #GFMXDEMTSPARSERPMTPIDLIST.
+ @param service (NvU32) Combined type and ID value
+*/
+#define GFMXDEMTS_GET_PMT_PID_TYPE(service) ((NvU32)(service) & 0x0000ff)
+
+/** TS Service List.
+ */
+typedef struct _GFMXDEMTSPARSERPMTPIDLIST
+{
+ /** Array of services:
+ Array entries format:
+
+ 32 24 23 8 7 0
+ +---------+------------------------------+----------------+
+ | Invalid | Service ID |Service Type |
+ +---------+------------------------------+----------------+
+
+ */
+ NvU32 uPmtPidList[GFMXDEMTS_MAX_SERVICE_NO];
+
+ /** Number of valid entries in GFMXDEMTSPARSERPMTPIDLIST::uPmtPidList[]. */
+ NvU32 uNoOfServices;
+
+} GFMXDEMTSPARSERPMTPIDLIST;
+
+
+/** TS parser types, parameter values for GFMXDEMTSPARSEREQUEST. */
+typedef enum
+{
+ /** Parser running on host system.
+
+ Parser objects of this type run the TS demux on the host system.
+ In contrast to GFMXDEMTSPARSERTYPE_DSP no hardware resources are involved,
+ and any number of parser objects of this type can be created.
+
+ TS data source is always of type GFMXDEMTSPARSERDATASOURCE_PUSH, i.e.
+ it is provided by the application via GFMxDemTSParserProcessData().
+ */
+ GFMXDEMTSPARSERTYPE_HOST = 0,
+
+ /** Parser running on DSP.
+
+ Parser objects of this type will instanciate a task on the DSP
+ to perform the demux processing. Demuxed data is returned to the host.
+ Demuxed audio data can optionally be processed entirely on DSP side
+ via GFMXDEMTSPARSERREQUEST::pAudioBufDesc.
+
+ This parser type is intended for verifying demux functionality.
+
+ TS data can be provided either from the host (GFMXDEMTSPARSERDATASOURCE_PUSH),
+ or acquired automatically from VIP (GFMXDEMTSPARSERDATASOURCE_VIP2DSP).
+ */
+ GFMXDEMTSPARSERTYPE_DSP,
+
+ /** Parser running on DSP with attached AVSync object.
+
+ Parser objects of this type will instanciate 2 tasks on the DSP,
+ one to perform the demux processing, and one to decode AV-synced H264 video.
+ Audio is processed on DSP side via GFMXDEMTSPARSERREQUEST::pAudioBufDesc.
+
+ TS data can be provided either from the host (GFMXDEMTSPARSERDATASOURCE_PUSH),
+ or acquired automatically from VIP (GFMXDEMTSPARSERDATASOURCE_VIP2DSP).
+ */
+ GFMXDEMTSPARSERTYPE_DSPAVSYNC
+
+} GFMXDEMTSPARSERTYPE;
+
+/** TS data sources, parameter values for GFMXDEMTSPARSEREQUEST. */
+typedef enum
+{
+ /** TS data is pushed by the application.
+
+ TS data is fed from the application via function calls to
+ GFMxDemTSParserProcessData().
+ */
+ GFMXDEMTSPARSERDATASOURCE_PUSH = 0,
+
+ /** TS data is intercepted by the DSP task directly from VIP.
+
+ The TS parser task running on the DSP will open the VIP in Type-A
+ interface mode to receive TS data via an interrupt handler.
+
+ This setting can be used only for parsers running on the DSP
+ (#GFMXDEMTSPARSERTYPE is GFMXDEMTSPARSERTYPE_DSP).
+ */
+ GFMXDEMTSPARSERDATASOURCE_VIP2DSP
+
+} GFMXDEMTSPARSERDATASOURCE;
+
+/** TS Parser object states. */
+typedef enum
+{
+ GFMXDEMTSDSPPARSERSTATE_INSTANTIATED=0, //!< Parser object instanciated, but not initialized
+ GFMXDEMTSDSPPARSERSTATE_READY, //!< Parser object initialized, ready to parse
+ GFMXDEMTSDSPPARSERSTATE_ERROR, //!< Parser object dead due to unrecoverable error (out of mem, etc)
+ GFMXDEMTSDSPPARSERSTATE_SHUTDOWN, //!< Parser object initialized, ready to parse, but shutdown initiated
+ GFMXDEMTSDSPPARSERSTATE_PAUSE //!< Parser object paused
+
+} GFMXDEMTSPARSERSTATE;
+
+/** TS Parser demux status bits. */
+typedef enum
+{
+ GFMXDEMTSPARSERSTATUS_PMT_READY = 0x01,
+ GFMXDEMTSPARSERSTATUS_NIT_READY = 0x02,
+ GFMXDEMTSPARSERSTATUS_VIDEO_FOUND = 0x04,
+ GFMXDEMTSPARSERSTATUS_AUDIO_FOUND = 0x08,
+ // if the number of status goes beyond 8, please change m_uStatus to 16 bits or 32 bits in #CNvTransportParser
+
+} GFMXDEMTSPARSERSTATUS;
+
+/** Parameter structure for GFMxDemTSParserGetStatus(). */
+typedef struct
+{
+ GFMXDEMTSPARSERSTATE state; //!< Parser object state
+ NvU32 status; //!< Parser status bitmask, see #GFMXDEMTSPARSERSTATUS
+ NvU32 frameDropCount; //!< Counts dropped frames in AVSync
+
+} GFMxDemTSParserStatus;
+
+/** TS parser notify reasoncodes for GFMXDEMTSPARSERREQUEST::OnNotify callback. */
+typedef enum
+{
+ /** Incoming TS starved. */
+ GFMXDEMTSPARSERNOTIFY_TSSTARVED = 0,
+
+ /** Overflow of TS data coming from VIP. */
+ GFMXDEMTSPARSERNOTIFY_TSOVERFLOW,
+
+ /** Underflow in audio buffer at demux output side. */
+ GFMXDEMTSPARSERNOTIFY_AUDIOUNDERFLOW,
+
+ /** Overflow in audio buffer at demux output side. */
+ GFMXDEMTSPARSERNOTIFY_AUDIOOVERFLOW,
+
+ /** Underflow in video buffer at demux output side. */
+ GFMXDEMTSPARSERNOTIFY_VIDEOUNDERFLOW,
+
+ /** Overflow in video buffer at demux output side. */
+ GFMXDEMTSPARSERNOTIFY_VIDEOOVERFLOW,
+
+ /** Parser detected PMT change.
+ Associated data:
+
+ NvU32 new PMT PID
+ = 2*max ADTS frame size.
+ */
+ NvU32 AudioBufferSize;
+
+ /** Size of video demux buffer to claim in GPU memory.
+ This field is used only for parsers of type GFMXDEMTSPARSERTYPE_DSP and GFMXDEMTSPARSERTYPE_DSPAVSYNC.
+ Size must be power of 2 and <=2^24 bytes.
+ Optimum size depends on H264 bitrate, and should big enough to hold multiple NAL units.
+ */
+ NvU32 VideoBufferSize;
+
+ /** DSP-side handle (address to GFMXDECH264TABLE) of initialized GFMxDecH264 instance.
+ This address is in DSP address space.
+
+ This field is used only for parsers of type GFMXDEMTSPARSERTYPE_DSPAVSYNC.
+
+ @internal
+ */
+ NvU32 MxDecH264DSPHandle;
+
+ /** Video section callback.
+ Ignored for parser type GFMXDEMTSPARSERTYPE_DSPAVSYNC.
+ @param user Application defined parameter, forwarded from GFMXDEMTSPARSERREQUEST::user
+ @param pllPTS Pointer to PTS, or NULL if not existent
+ @param pllDTS Pointer to DTS, or NULL if not existent
+ */
+ GF_RETTYPE (*OnVideoData)(void* user, NvU8* pBytes, NvU32 cbBytes, NvU32 StreamID, NvS64* pllPTS, NvS64* pllDTS, int bPesStart);
+
+ /** Audio section callback, or NULL to use shared DSP buffer.
+
+ Can be NULL for parser type GFMXDEMTSPARSERTYPE_DSP.
+ Ignored for parser type GFMXDEMTSPARSERTYPE_DSPAVSYNC.
+
+ @param user Application defined parameter, forwarded from GFMXDEMTSPARSERREQUEST::user
+ @param pllPTS Pointer to PTS, or NULL if not existent
+ @param pllDTS Pointer to DTS, or NULL if not existent
+ */
+ GF_RETTYPE (*OnAudioData)(void* user, NvU8* pBytes, NvU32 cbBytes, NvU32 StreamID, NvS64* pllPTS, NvS64* pllDTS, int bPesStart);
+
+ /** PCR (Program Clock Reference) callback.
+ @param user Application defined parameter, forwarded from GFMXDEMTSPARSERREQUEST::user
+ @param llPCRBase Clock
+ @param llPCRExt Clock
+ @param uDiscontinuity discontinuity flag
+ */
+ void (*OnPCR)(void* user, NvS64 llPCRBase, NvU32 llPCRExt, NvU32 uDiscontinuity);
+
+ /** Parser object error and status notify callback.
+ @param user Application defined parameter, forwarded from GFMXDEMTSPARSERREQUEST::user
+ @param notifycode Notify reasoncode, see GFMXDEMTSPARSERNOTIFY
+ @param data Data specific to a notifycode
+ */
+ void (*OnNotify)(void* user, NvU32 notifycode, void* data);
+
+ /** Frame Decoded Callback
+ Will be called in sync with PTS of the frame. The passed surface will be locked, and the
+ application must unlock it later via GFMxDecH264Set() with feature ID GF_MXDEC_H264_SET_UNLOCK_SURFACE.
+ @param user Application defined parameter, forwarded from INvTransportParserCallback::user
+ @param surfaceID surface id
+ @param resolution high 16 bit for xres, low 16 bit for yres
+ @param pPTS Pointer to PTS of this frame
+ @param flags Flag bitmask, bit 0 set validity of PAN Scan Info
+ @param PanTopLeft Top-Left Offset for PAN Scan Rect, low 16 bit signed X, top 16 bit signed Y
+ @param PanBottomRight Bottom-Right Offset for PAN Scan Rect , low 16 bit signed X, top 16 bit signed Y
+ @param FrameType I/P Frame Type
+ */
+ void (*OnFrameDecoded)(void* user, NvU32 sufaceID, NvU32 resolution, NvS64* pPTS, NvU32 flags, NvU32 PanTopLeft, NvU32 PanBottomRight, NvU32 FrameType);
+
+ /** TS data callback
+ @param user Application defined parameter, forwarded from GFMXDEMTSPARSERREQUEST::user
+ @param data TS data
+ @param size TS data size
+ */
+ void (*OnTS)(void* user, NvU8* data, NvU32 size);
+
+ /** Application private data, will be forwarded to callbacks */
+ void* user;
+
+ /** Returns address of circular buffer descriptor shared with audio decoder.
+ This address is in DSP address space.
+ This member is valid only, if GFMXDEMTSPARSERREQUEST::OnAudioData is NULL,
+ and if the parser is of type GFMXDEMTSPARSERTYPE_DSP.
+ */
+ GF_RM_DSP_CIRCBUFFER* pAudioBufDesc;
+
+} GFMXDEMTSPARSERREQUEST;
+
+/** H264 Frame Type, the value is equal to Nal Type*/
+typedef enum
+{
+ MXDEMTS_H264_FRAME_IDR = 5,
+ MXDEMTS_H264_FRAME_P = 1,
+ MXDEMTS_H264_FRAME_INVALID = 0,
+} MXDEMTS_H264_FRAME_TYPE;
+
+// Typesafe functions for opening and closing this component
+GF_RETTYPE GFMxDemTSOpen(GFRmHandle hRm, GFMxDemTSHandle *phMxDemTS,
+ GF_STATE_TYPE state, GFRmChHandle hCh);
+void GFMxDemTSClose(GFMxDemTSHandle *phMxDemTS);
+
+/** Create a TS parser.
+
+ This function creates a TS parser running on the host.
+
+ @param TsHandle Handle to TS component
+ @param pParserReq Parameter structure
+ @param pParserHandle Returns handle on success, unchanged on failure
+
+ @retval GF_SUCCESS Success
+ @retval GF_ERROR_OUT_MEMORY Out of memory
+ @retval GFMXDEMTS_ERROR_CREATEDSPPARSER Failed to create parse object on DSP side
+ @retval GFMXDEMTS_ERROR_NODSPSUPPORT No DSP support in GFSDK
+*/
+GF_RETTYPE GFMxDemTSParserCreate(GFMxDemTSHandle TsHandle, GFMXDEMTSPARSERREQUEST* pParserReq, GFMxDemTSParserHandle* pParserHandle);
+
+/** Destroy TS parser.
+
+ Destroy an TS parser object previously created with GFMxDemTSParserCreate().
+ Save to call on NULL handle.
+
+ @param TsHandle Handle to TS component
+ @param pParserHandle Pointer to parser handle, will be reset to NULL on exit
+*/
+void GFMxDemTSParserDestroy(GFMxDemTSHandle TsHandle, GFMxDemTSParserHandle* pParserHandle);
+
+/** Process a section of the TS stream.
+
+ The input Transport Stream is parsed and the section type handlers passed
+ with GFMXDEMTSPARSERREQUEST are called as their sections are encountered in
+ the stream.
+
+ A call of this function is usually triggered by an interrupt to feed the next
+ portion of an incoming Transport Stream.
+
+ On each call of this function at least 188 byte (TS packet size) must be passed.
+ The Transport Stream is parsed in entities of 188 byte packets. If the passed buffer
+ contains an incomplete packet at the end, it will be copied to an internal buffer
+ and automatically combined with the second part on the next function call.
+
+ Thus it is not required to pass in buffers aligned to TS packet starts, and the
+ buffer must not be a multiple of 188 bytes (TS packet size). However
+ doing so will guarant maximum demux performance since copying around incomplete packets
+ can be avoided.
+
+ This function may only be called for parses created with #GFMXDEMTSPARSERDATASOURCE_PUSH.
+
+ @param TsHandle Handle to TS component
+ @param ParserHandle Parser handle
+ @param pData Pointer to buffer containing TS, the buffer must contain
+ at least 188 bytes of stream data. Buffer start does not
+ need to be aligned with the start of an TS package.
+ @param pSize Pointer to buffer size, must be 188 or larger, will be updated
+ on exit with the number of bytes in the buffer, which where consumed.
+ If the parser was created on the DSP, this size must
+ not exceed the buffersize passed in GFMXDEMTSPARSERREQUEST::TSBufferSize.
+ On success GFMxDemTSParserPushData() will always consume all data,
+ on failure *pSize returns the number of bytes that were successfully
+ consumed before the failure occured.
+ @param timeout Time in ms to wait until DSP parser object gets ready to accept new data,
+ or 0 to block forever, (NvU32)-1 to return immediately if busy.
+ Ignored for DSP objects created with #GFMXDEMTSPARSERTYPE_HOST.
+
+ @retval GF_SUCCESS Success
+ @retval GF_WAIT_TIME_OUT Timeout before data could be sent to DSP
+ @retval GF_ERROR_BUSY DSP was busy and data was not sent, call again,
+ returned only if \a timeout was (NvU32)-1
+*/
+GF_RETTYPE GFMxDemTSParserPushData(GFMxDemTSHandle TsHandle, GFMxDemTSParserHandle ParserHandle, NvU8* pData, NvU32* pSize, NvU32 timeout);
+
+/** (Re-)Start VIP TS data capture and demux on DSP.
+
+ This function can be used only for parsers created as #GFMXDEMTSPARSERDATASOURCE_VIP2DSP.
+
+ @param TsHandle Handle to TS component
+ @param ParserHandle Parser handle
+
+ @retval GF_SUCCESS Success
+*/
+GF_RETTYPE GFMxDemTSParserDSPStart(GFMxDemTSHandle TsHandle, GFMxDemTSParserHandle ParserHandle);
+
+/** Pause VIP TS data capture and demux on DSP.
+
+ This function can be used only for parsers created as #GFMXDEMTSPARSERDATASOURCE_VIP2DSP.
+
+ @param TsHandle Handle to TS component
+ @param ParserHandle Parser handle
+ @param onOff Indicate Pause on or off
+
+ @retval GF_SUCCESS Success
+*/
+GF_RETTYPE GFMxDemTSParserDSPPause(GFMxDemTSHandle TsHandle, GFMxDemTSParserHandle ParserHandle, NvU32 onOff);
+
+/** Step to the next Frame.
+
+ @param TsHandle Handle to TS component
+ @param ParserHandle Parser handle
+
+ @retval GF_SUCCESS Success
+*/
+GF_RETTYPE GFMxDemTSParserDSPNextFrame(GFMxDemTSHandle TsHandle, GFMxDemTSParserHandle ParserHandle);
+
+/** Step to the next I Frame.
+
+ @param TsHandle Handle to TS component
+ @param ParserHandle Parser handle
+
+ @retval GF_SUCCESS Success
+*/
+GF_RETTYPE GFMxDemTSParserDSPNextIFrame(GFMxDemTSHandle TsHandle, GFMxDemTSParserHandle ParserHandle);
+
+/** Get TS PmtPid List
+
+ @param TsHandle Handle to TS component
+ @param ParserHandle Parser handle
+ @param pPmtPidList Returns PMT PID List in current TS, with Service ID and Service Type combined
+
+ @retval GF_SUCCESS Success
+ @retval GFMXDEMTS_ERROR_SERVICESLISTUNAVAILABLE NIT/PAT has not been parsed yet.
+
+ @see GFMxDemTSSetPmtPid()
+*/
+GF_RETTYPE GFMxDemTSParserGetPmtPidList(GFMxDemTSHandle TsHandle, GFMxDemTSParserHandle ParserHandle, GFMXDEMTSPARSERPMTPIDLIST *pPmtPidList);
+
+/** Set TS Service
+
+ PMT PID is set without any check. if the new PMT PID is successfully set, a
+ #GFMXDEMTSPARSERNOTIFY_TSPMTCHANGED notify will be sent to the caller application.
+
+ @param TsHandle Handle to TS component
+ @param ParserHandle Parser handle
+ @param uPmtPid uPmtPid to be set
+
+ @retval GF_SUCCESS Success *
+ @see GFMxDemTSGetPmtPidList()
+ */
+GF_RETTYPE GFMxDemTSParserSetPmtPid(GFMxDemTSHandle TsHandle, GFMxDemTSParserHandle ParserHandle, NvU32 uPmtPid);
+
+/** Get Active PmtPid
+
+ @param TsHandle Handle to TS component
+ @param ParserHandle Parser handle
+ @param pServiceID pointer to Active PmtPid.
+
+ @retval GF_SUCCESS Success *
+ */
+GF_RETTYPE GFMxDemTSParserGetActivePmtPid(GFMxDemTSHandle TsHandle, GFMxDemTSParserHandle ParserHandle, NvU32* pPmtPid);
+
+/** Get TS AudioPid List
+
+ @param TsHandle Handle to TS component
+ @param ParserHandle Parser handle
+ @param pAudioPidList Returns AUDIO PID List in current TS, with PID and Type combined
+
+ @retval GF_SUCCESS Success
+ @retval GFMXDEMTS_ERROR_AUDIOPIDLISTUNAVAILABLE NIT/PAT has not been parsed yet.
+
+ @see GFMxDemTSSetAudioPid()
+*/
+GF_RETTYPE GFMxDemTSParserGetAudioPidList(GFMxDemTSHandle TsHandle, GFMxDemTSParserHandle ParserHandle, GFMXDEMTSPARSERAUDIOPIDLIST *pAudioPidList);
+
+/** Set TS Audio Pid
+
+ @param TsHandle Handle to TS component
+ @param ParserHandle Parser handle
+ @param uAudioPid uAudioPid to be set
+
+ @retval GF_SUCCESS Success
+ @retval GFMXDEMTS_ERROR_AUDIOPIDUNAVAILABLE
+ @see GFMxDemTSGetAudioPidList()
+ */
+GF_RETTYPE GFMxDemTSParserSetAudioPid(GFMxDemTSHandle TsHandle, GFMxDemTSParserHandle ParserHandle, NvU32 uAudioPid);
+
+/** Get Active AudioPid
+
+ Audio PID is set if this AUDIO PID exists in current streams. Otherwise return an error
+
+ @param TsHandle Handle to TS component
+ @param ParserHandle Parser handle
+ @param pAudioPid pointer to Active AudioPid.
+
+ @retval GF_SUCCESS Success
+ */
+GF_RETTYPE GFMxDemTSParserGetActiveAudioPid(GFMxDemTSHandle TsHandle, GFMxDemTSParserHandle ParserHandle, NvU32* pAudioPid);
+
+/** Reset All Table Version
+
+ Reset all Table Versions, including PAT, NIT, and PMT.
+ For reset only PMT table version, see GFMxDemTSParserResetPmtTableVersion
+
+ @param TsHandle Handle to TS component
+ @param ParserHandle Parser handle
+
+ @retval GF_SUCCESS Success
+ */
+GF_RETTYPE GFMxDemTSParserResetAllTableVersions(GFMxDemTSHandle TsHandle, GFMxDemTSParserHandle ParserHandle);
+
+/** Reset PMT Table Version
+
+ To reset all table version, see GFMxDemTSParserResetAllTableVersion
+
+ @param TsHandle Handle to TS component
+ @param ParserHandle Parser handle
+
+ @retval GF_SUCCESS Success
+ */
+GF_RETTYPE GFMxDemTSParserResetPmtTableVersion(GFMxDemTSHandle TsHandle, GFMxDemTSParserHandle ParserHandle);
+
+/** Set Play Speed
+
+ Just used for normal play, for trick play, see xxx.
+
+ @param TsHandle Handle to TS component
+ @param ParserHandle Parser handle
+ @param PlaySpeed Play speed to set in 1.0 * 10^6.
+ A value of 100000 plays at 100% of the current sample rate. 100100 plays at 1.1%,
+ 100010 plays at 100.01%, the smallest increment 100001 plays at 100.001%.
+ Number less than 100000 will slow down the stream in the same way.
+ @retval GF_SUCCESS Success
+ */
+GF_RETTYPE GFMxDemTSParserSetPlaySpeed(GFMxDemTSHandle TsHandle, GFMxDemTSParserHandle ParserHandle, NvU32 PlaySpeed);
+
+/** Set VIP Capture
+
+ @deprecated Do not use, will be removed from public API
+
+ @param TsHandle Handle to TS component
+ @param VxHandle the Vx handle for setting VIP
+ @retval GF_SUCCESS Success *
+ */
+GF_RETTYPE GFMxDemTSSetVIP(GFMxDemTSHandle TsHandle, GFVxHandle VxHandle);
+
+/** VIP Capture on Host Side
+
+ @deprecated Do not use, will be removed from public API
+
+ it captures VIP data from host side, instead of DSP side.
+ For VIP Capture from DSP side, see #GFMXDEMTSPARSERREQUEST (GFMXDEMTSPARSERDATASOURCE_VIP2DSP)
+
+ @param TsHandle Handle to TS component
+ @param pBuf Buffer to host VIP data
+ @param pBufSize Maximum buf size for input, and Number bytes captured for output
+ @retval GF_SUCCESS Success *
+ */
+GF_RETTYPE GFMxDemTSPollVIP(GFMxDemTSHandle TsHandle, NvU8* pBuf, NvU32 *pBufSize);
+
+/** Close VIP Capture
+
+ @deprecated Do not use, will be removed from public API
+
+ @param TsHandle Handle to TS component
+ @param VxHandle the Vx handle for setting VIP
+ @retval GF_SUCCESS Success *
+ */
+void GFMxDemTSCloseVIP(GFMxDemTSHandle TsHandle, GFVxHandle VxHandle);
+
+/** Get demux object state and status.
+
+ Check Parser Status, can be called any time on the parser.
+
+ @param TsHandle Handle to TS component
+ @param ParserHandle Parser handle
+ @param pStatus Returns parser object state and status.
+
+ Bits 0-7 Parser status bitmask, see #GFMXDEMTSPARSERSTATUS
+ Bits 8-24 reserved for extension
+ Bits 23-31 Parser state, see #GFMXDEMTSPARSERSTATE
+
+ @retval GF_SUCCESS Success
+ @retval GFRM_ERROR_BAD_PARAMETER Invalid parser handle passed
+ */
+GF_RETTYPE GFMxDemTSParserGetStatus(GFMxDemTSHandle TsHandle, GFMxDemTSParserHandle ParserHandle, GFMxDemTSParserStatus* pStatus);
+
+/** Clear Demux Buffers.
+
+ This will clear demux input TS buffers. For parsers of type
+ GFMXDEMTSPARSERTYPE_DSPAVSYNC it will also clear ES (video and audio) output buffers.
+
+ @param TsHandle Handle to TS component
+ @param ParserHandle Parser handle
+ @retval GF_SUCCESS Success
+ */
+GF_RETTYPE GFMxDemTSParserClearBuffers(GFMxDemTSHandle TsHandle, GFMxDemTSParserHandle ParserHandle);
+
+/** Enable or disable TS data to be returned from DSP to host.
+
+ If disabled the GFMXDEMTSPARSERREQUEST::OnTS callback won't be called anymore.
+ This function has effect for parsers with datasource GFMXDEMTSPARSERDATASOURCE_VIP2DSP only.
+
+ @param TsHandle Handle to TS component
+ @param ParserHandle Parser handle
+ @param enable 0 to disable, !=0 to enable
+ @retval GF_SUCCESS Success
+ */
+GF_RETTYPE GFMxDemTSParserDSPEnableOnTS(GFMxDemTSHandle TsHandle, GFMxDemTSParserHandle ParserHandle, int enable);
+
+/** GFMxDemTSAPI Error code: Create Parser object on DSP failed.
+ @see GFMxDemTSParserCreate()
+*/
+#define GFMXDEMTS_ERROR_CREATEDSPPARSER (GFMXDEMTS_ERROR + 0)
+
+/** GFMxDemTSAPI Error code: GFSDK not setup for DSP support.
+ @see GFMxDemTSParserCreate()
+*/
+#define GFMXDEMTS_ERROR_NODSPSUPPORT (GFMXDEMTS_ERROR + 1)
+
+/** GFMxDemTSAPI Error code: GFMxDemTSGetPmtPidList() called when NIT/PAT not parsed yet.
+ @see GFMxDemTSGetPmtPidList()
+*/
+#define GFMXDEMTS_ERROR_SERVICESLISTUNAVAILABLE (GFMXDEMTS_ERROR + 2)
+
+/** GFMxDemTSAPI Error code: GFMxDemTSSetPmtPid() when a wrong PMT PID is passed.
+ @see GFMxDemTSSetPmtPid()
+*/
+#define GFMXDEMTS_ERROR_SERVICEUNAVAILABLE (GFMXDEMTS_ERROR + 3)
+
+/** GFMxDemTSAPI Error code: GFMxDemTSGetAudioPidList() called when PMT does not parsed yet, or
+ there is no Audio in current service.
+ @see GFMxDemTSGetAudioPidList()
+*/
+#define GFMXDEMTS_ERROR_AUDIOPIDLISTUNAVAILABLE (GFMXDEMTS_ERROR + 4)
+
+/** GFMxDemTSAPI Error code: GFMxDemTSSetAudioPid() when a wrong Audio PID is passed.
+ @see GFMxDemTSSetAudioPid()
+*/
+#define GFMXDEMTS_ERROR_AUDIOPIDUNAVAILABLE (GFMXDEMTS_ERROR + 5)
+
+/** GFMxDemTSAPI Error code: Signal frame decoded.
+ @internal
+*/
+#define GFMXDEMTS_ERROR_AVSYNCFRAMEDECODED (GFMXDEMTS_ERROR + 6)
+
+/** GFMxDemTSAPI Error code: Cannot claim VIP.
+ @see GFMxDemTSParserCreate()
+*/
+#define GFMXDEMTS_ERROR_VIPUNAVAILABLE (GFMXDEMTS_ERROR + 7)
+
+/** GFMxDemTSAPI Error code: GFMxDemTSParserGetActivePmtPid() called when there is pending PMT PID to be set.
+ @see GFMxDemTSParserGetActivePmtPid()
+*/
+#define GFMXDEMTS_ERROR_GETSERVICEPMTPID (GFMXDEMTS_ERROR + 8)
+
+/** GFMxDemTSAPI Semaphore IDs.
+ These IDs can be used in the RmCreateSemaphore implementation of the
+ OS porting layer to identify GFMxDemTSAPI semaphores.
+*/
+typedef enum
+{
+ GFMXDEMTS_SEMAPHORE_TSBUF = GF_MXDEMTSAPI<<24
+
+} GFMXDEMTS_SEMAPHORE;
+
+/*@}*/
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _GF_MPEG_TS__ */
diff --git a/Start_WM/test6/inc/GFMxEnc.h b/Start_WM/test6/inc/GFMxEnc.h
new file mode 100755
index 00000000..74d4bee7
--- /dev/null
+++ b/Start_WM/test6/inc/GFMxEnc.h
@@ -0,0 +1,795 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+*
+* NVIDIA Corporation and its licensors retain all intellectual property
+* and proprietary rights in and to this software, related documentation
+* and any modifications thereto. Any use, reproduction, disclosure or
+* distribution of this software and related documentation without an
+* express license agreement from NVIDIA Corporation is strictly prohibited.
+*/
+
+/** @file GFMxEnc.h
+GFSDK MPEG Encode API header file.
+*/
+
+// The following ifdef block is the standard way of creating macros which make exporting
+// from a DLL simpler. All files within this DLL are compiled with the GFMXENC_EXPORTS
+// symbol defined on the command line. this symbol should not be defined on any project
+// that uses this DLL. This way any other project whose source files include this file see
+// GFMXENC_API functions as being imported from a DLL, wheras this DLL sees symbols
+// defined with this macro as being exported.
+#ifndef _GF_MPEG_ENC__
+#define _GF_MPEG_ENC__
+
+#include "GFVx.h"
+#include "GFDef.h"
+
+/** @addtogroup groupMxEnc GFMxEncAPI MPEG4 Encode API
+
+ @ref pageMxEncAppNotes
+
+ @ref pageMxEncAppNotes1
+
+
+*/
+/*@{*/
+
+/** MxEncAPI property flag: Support Simple Profile.
+ @see GFMxEncGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_MXENC_CAP_SIMPLE 0x00000001 //Support Simple Profile
+/** MxEncAPI property flag: Support Simple Scale Profile.
+ @see GFMxEncGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_MXENC_CAP_SCALE 0x00000002 //Support Simple Scale Profile
+/** MxEncAPI property flag: Support CORE Profile.
+ @see GFMxEncGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_MXENC_CAP_CORE 0x00000004 //Support CORE Profile
+/** MxEncAPI property flag: Support MAIN Profile.
+ @see GFMxEncGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_MXENC_CAP_MAIN 0x00000008 //Support MAIN Profile
+/** MxEncAPI property flag: Support N_bit profile.
+ @see GFMxEncGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_MXENC_CAP_N_BIT 0x00000010 //Support N_bit Profile
+/** MxEncAPI property flag: Support LEVEL 1.
+ @see GFMxEncGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_MXENC_CAP_LEVEL1 0x00000100 //Support LEVEL 1
+/** MxEncAPI property flag: Support LEVEL 2.
+ @see GFMxEncGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_MXENC_CAP_LEVEL2 0x00000200 //Support LEVEL 2
+/** MxEncAPI property flag: Support LEVEL 3.
+ @see GFMxEncGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_MXENC_CAP_LEVEL3 0x00000400 //Support LEVEL 3
+/** MxEncAPI property flag: Support LEVEL 4.
+ @see GFMxEncGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_MXENC_CAP_LEVEL4 0x00000800 //Support LEVEL 4
+/** MxEncAPI property flag: Support Data Partitioning Mode.
+ @see GFMxEncGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_MXENC_CAP_DATA_PARTITIONING 0x00001000 //Support Data Partitioning Mode
+/** MxEncAPI property flag: Support RVLC Mode.
+ @see GFMxEncGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_MXENC_CAP_RVLC 0x00002000 //Support RVLC Mode
+/** MxEncAPI property flag: Support Rate Control.
+ @see GFMxEncGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_MXENC_CAP_RATE_CONTROL 0x00004000
+//support rate control
+/** MxEncAPI property flag: Support Intra MacroBlock Refreshing.
+ @see GFMxEncGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_MXENC_CAP_IMRF 0x000008000 //Support Intra Macroblock Refreshing
+/** MxEncAPI property flag: Support Rotation.
+ @see GFMxEncGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_MXENC_CAP_ROTATION 0x000010000 //Support Rotation
+
+/** GFMxEncSetVOL parameter struct. */
+typedef struct _GFMXENCVOL
+{
+ NvU32 uiVOLInfo; /**< VOL characteristics */
+ /**<
+
+ #GF_MXENC_VOL_SHORT_VIDEO_HEADER
+ #GF_MXENC_VOL_BYPASS_VLC
+ #GF_MXENC_VOL_RESYNC_MARK_ENABLE
+ #GF_MXENC_VOL_DATA_PARTITION_ENABLE
+ #GF_MXENC_VOL_REVERSIBLE_VLC_ENABLE
+ #GF_MXENC_VOL_RATE_CONTROL_ENABLE
+ #GF_MXENC_VOL_STUFFING_ENABLE
+ #GF_MXENC_VOL_AUTO_IMRF_ENABLE
+ #GF_MXENC_VOL_MC_IMRF_ENABLE
+ #GF_MXENC_VOL_THUMBNAIL_ENABLE
+
+ */
+ PGFRMSURFACE pSrcSurf;/**< Surface to encode*/
+ PGFRECT pSrcRect; /**
+ #GF_MXENC_VOP_4MV_ENABLE
+ #GF_MXENC_VOP_HALF_PEL_ENABLE
+ #GF_MXENC_VOP_PACKET_BASED_ON_MB_NUM
+ #GF_MXENC_VOP_AC_PRE_ALWAYS_ON
+ #GF_MXENC_VOP_AC_PRE_DYNAMICALLY_ON
+ #GF_MXENC_VOP_CHANGE_EXPECTED_SIZE
+ #GF_MXENC_VOP_CHANGE_INITQP
+ #GF_MXENC_VOP_CHANGE_MIN_MAX_QP
+ #GF_MXENC_VOP_4MV_ENABLE
+ #GF_MXENC_VOP_REDUCE_FRAME_RATE
+ #GF_MXENC_VOP_ENCODE_I_ASAP
+ #GF_MXENC_VOP_IMRF_CONTROL_IP_RATIO
+ #GF_MXENC_VOP_LOAD_IMRF_COUNTER_RANGE
+ #GF_MXENC_VOP_LOAD_IMRF_MATRIX
+ #GF_MXENC_VOP_TIMESTAMP_CPU
+ #GF_MXENC_VOP_TIMESTAMP_VI
+ #GF_MXENC_VOP_CHANGE_MAX_QP_RELIEF
+
+ */
+
+ NvU16 uiPacketSize; /**< If GF_MXENC_VOP_PACKET_BASED_ON_MB_NUM flag is on, this field tells the number of macroblocks in a packet. Otherwise, this field tells number of bytes in a packet.*/
+ NvU16 uiIntra_DC_VLC_Thr; /**< Intra DC VLC Threshold*/
+ NvU16 uiHECNum; /**< Frequency to inset HEC marker. 0 means no HEC marker at all. 1~7 means to insert HEC after 1~7 resync marker(s).*/
+ NvU16 uiExpectedISize; /**< If next encoded VOP is I, this field tells GFMxEncAPI the size of bit stream which application expects in number of DWORD.*/
+ NvU16 uiExpectedPSize; /**< If next encoded VOP is P, this field tells GFMxEnc the size of bit stream which application expects in number of DWORD.*/
+ NvU16 uiInitialIQP; /**< Initial QP value for I VOP*/
+ NvU16 uiInitialPQP; /**< Initial QP value for P VOP */
+
+ NvU16 uiMaxIQP; /**< Max QP value for I VOP*/
+ NvU16 uiMinIQP; /**< Min QP value for I VOP */
+
+ NvU16 uiMaxPQP; /**< Max QP value for P VOP*/
+ NvU16 uiMinPQP; /**< Min QP value for P VOP */
+ NvU16 uiMaxQPRelief; /**< Max qp Relief*/
+
+ NvU16 uiNumofP; /**< Number of consecutive P VOPs between two I VOPs.*/
+ NvU16 uiRNumerator; /**< Desired Framerate value. This field must be filled if flag GF_MXENC_VOP_REDUCE_FRAME_RATE is on.*/
+ NvU16 uiRDenominator; /**< Camera Framerate. This field must be filled if flag GF_MXENC_VOP_REDUCE_FRAME_RATE is on.*/
+
+ NvU8 uiIMRFIMinValue; /**< Those values will take effect only when GF_MXENC_VOP_LOAD_IMRF_COUNTER_RANGE flag is set. Whenever an I VOP is encoded, MxEnc will generate a random number in this range for each macroblock.*/
+ NvU8 uiIMRFIMaxValue; /**< Those values will take effect only when GF_MXENC_VOP_LOAD_IMRF_COUNTER_RANGE flag is set. Whenever an I VOP is encoded, MxEnc will generate a random number in this range for each macroblock.*/
+ NvU8 uiIMRFPMinValue; /**< Those values will take effect only when GF_MXENC_VOP_LOAD_IMRF_COUNTER_RANGE flag is set. Whenever a Macro Block counter is reduced to 0, an Intra Macro Block will be generated by MxEnc. MxEnc will generate a random number in this range for this macroblock.*/
+ NvU8 uiIMRFPMaxValue; /**< Those values will take effect only when GF_MXENC_VOP_LOAD_IMRF_COUNTER_RANGE flag is set. Whenever a Macro Block counter is reduced to 0, an Intra Macro Block will be generated by MxEnc. MxEnc will generate a random number in this range for this macroblock.*/
+ NvU8 uiIMRFDefaultCounter; /**< This value will be used as the new counter when the refresh counter in the matrix is decreased to 0.*/
+ NvU8* pMIRFMatrix; /**< Pointer to an array that holds counter for each Macro Block. When this counter is decreased to 0, one Intra Macro Block will be inserted.*/
+
+ NvU32 uiTimeStampModel; /**< Time Stamp Model (VI or CPU).
+
+ #GF_MXENC_VOP_TIMESTAMP_CPU
+ #GF_MXENC_VOP_TIMESTAMP_VI
+
+ */
+
+}GFMXENCVOP, *PGFMXENCVOP;
+
+//uiVOPInfo:
+/**GFMXENCVOP::uiVOPInfo: Enable 4 motion vectors, GFMxEnc will pick 1 MV or 4 MV, depends on which mode is more efficient.*/
+#define GF_MXENC_VOP_4MV_ENABLE 0x00000001
+
+/**GFMXENCVOP::uiVOPInfo : Enable Half Pel Motion Estimation search*/
+#define GF_MXENC_VOP_HALF_PEL_ENABLE 0x00000002
+
+/**GFMXENCVOP::uiVOPInfo:New packet based on the number of MBs. Not the length of the bit stream*/
+#define GF_MXENC_VOP_PACKET_BASED_ON_MB_NUM 0x00000004
+
+/**GFMXENCVOP::uiVOPInfo:AC prediction always on*/
+#define GF_MXENC_VOP_AC_PRE_ALWAYS_ON 0x00000008
+
+/**GFMXENCVOP::uiVOPInfo:AC prediction dynamically on*/
+#define GF_MXENC_VOP_AC_PRE_DYNAMICALLY_ON 0x00000010
+
+/**GFMXENCVOP::uiVOPInfo : Change the expected size for I and P encoded frames. uiExpectedISize, uiExpectedPSize must be filled*/
+#define GF_MXENC_VOP_CHANGE_EXPECTED_SIZE 0x00000020
+
+/**GFMXENCVOP::uiVOPInfo : Change the initial QP for I and P. uiInitialIQP, uiInitialPQP must be filled*/
+#define GF_MXENC_VOP_CHANGE_INITQP 0x00000040
+
+/**GFMXENCVOP::uiVOPInfo : Change the Min and Max QP for I and P frames. uiMaxIQP, uiMinIQP, uiMaxPQP, uiMinPQP must be filled*/
+#define GF_MXENC_VOP_CHANGE_MIN_MAX_QP 0x00000080
+
+/**GFMXENCVOP::uiVOPInfo : Reduce the frame rate by skipping certain frames. uiRNumerator and uiRDenominator must be set.*/
+#define GF_MXENC_VOP_REDUCE_FRAME_RATE 0x00000100
+
+/**GFMXENCVOP::uiVOPInfo : Encode I VOP as soon as possible*/
+#define GF_MXENC_VOP_ENCODE_I_ASAP 0x00000200
+
+/**GFMXENCVOP::uiVOPInfo : Number of P VOPs between two I VOPs controlled by intra macro block refreshing. If this flag is off, it is controlled by uiNumofP*/
+#define GF_MXENC_VOP_IMRF_CONTROL_IP_RATIO 0x00000400
+
+/**GFMXENCVOP::uiVOPInfo : Application can change the counter range by setting this flag and give the range in uiIMRFIMinValue, uiIMRFIMaxValue, uiIMRFPMinValue and uiIMRFPMaxValue. Application only can turn on this flag when GF_MXENC_VOL_AUTO_IMRF_ENABLE is on.*/
+#define GF_MXENC_VOP_LOAD_IMRF_COUNTER_RANGE 0x00000800
+
+/**GFMXENCVOP::uiVOPInfo : Application must fill in uiIMRFDefaultCounter and pIMRFMatrix when this flag is on. Application only can turn on this flag when GF_MXENC_VOL_MC_IMRF_ENABLE flag is on.*/
+#define GF_MXENC_VOP_LOAD_IMRF_MATRIX 0x00001000
+
+/**GFMXENCVOP::uiVOPInfo : Timestamp is provided by CPU*/
+#define GF_MXENC_VOP_TIMESTAMP_CPU 0x00010000
+
+/**GFMXENCVOP::uiVOPInfo: Timestamp is generated by VI*/
+#define GF_MXENC_VOP_TIMESTAMP_VI 0x00020000
+
+/**GFMXENCVOP::uiVOPInfo : Change MAX QP RELIEF value for Rate Control Algorithm*/
+#define GF_MXENC_VOP_CHANGE_MAX_QP_RELIEF 0x00100000
+
+/**typedef struct _GFMXENCRCC*/
+
+typedef struct _GFMXENCRCC
+{
+ NvU16 uiIQP; /**
+ #MXENC_VOP_P_VOP
+ #MXENC_VOP_MORE_FETCH
+ #MXENC_VOP_PORTION_PACKET
+ #MXENC_VOP_MORE_VOP
+ #MXENC_VOP_BEGIN_VOP
+ #MXENC_VOP_END_VOP
+ #MXENC_VOP_BUFFER_OVERFLOW
+
+ */
+ NvU32 uiAverageQP; /**
+ #GF_MXENC_CAP_SIMPLE
+ #GF_MXENC_CAP_SCALE
+ #GF_MXENC_CAP_CORE
+ #GF_MXENC_CAP_MAIN
+ #GF_MXENC_CAP_N_BIT
+ #GF_MXENC_CAP_LEVEL1
+ #GF_MXENC_CAP_LEVEL2
+ #GF_MXENC_CAP_LEVEL3
+ #GF_MXENC_CAP_LEVEL4
+ #GF_MXENC_CAP_DATA_PARTITIONING
+ #GF_MXENC_CAP_RVLC
+ #GF_MXENC_CAP_RATE_CONTROL
+ #GF_MXENC_CAP_IMRF
+ #GF_MXENC_CAP_ROTATION
+
+
+ @retval GF_SUCCESS : If successful.
+ @retval GF_ERROR : If error.
+ @see GFMxEncAPI_Error_Codes
+
+ It is a good practice to call this function to query for the API version
+ and its capabilities before using the rest of the MxEncAPI functions.
+*/
+
+GF_RETTYPE GFMxEncGetStatus(GFMxEncHandle hMxEnc, NvU32 * pStatus);
+/**< This function returns the hardware encoders status.
+
+ @param MXhandle (GFMxEncHandle) Handle specific to the GFMxEncAPI.
+ @param pStatus (NvU32 * ) @see GFMxEncGetStatus Definitions.
+
+ @retval GF_SUCCESS : If successful.
+ @retval GF_ERROR : If error.
+ @see GFMxEncAPI_Error_Codes
+*/
+//pStatus
+/**GFMxEncGetStatus Definitions : If hardware encoder is busy encoding VOPs*/
+#define GF_ENCODER_BUSY 0x00000001
+
+/**GFMxEncGetStatus Definitions : At least one VOP is ready for fetching */
+#define GF_ENCODER_VOP_READY 0x00000002
+
+
+GF_RETTYPE GFMxEncSetVOL(GFMxEncHandle hMxEnc, PGFMXENCVOL pVOL);
+/**< This function sets the characteristics of a new video object layer (VOL) and
+tells the GFMxEncAPI the VOL information. The GFMxEncAPI does not
+generate a VOL bit stream. The application needs to prepare a VOL by itself.
+
+ @param hMxEnc (GFMxEncHandle) Handle specific to the GFMxEncAPI.
+ @param pStatus (PGFMXENCVOL ) Set new VOL information.
+
+ @retval GF_SUCCESS : If successful.
+ @retval GF_ERROR : If error.
+ @see GFMxEncAPI_Error_Codes
+*/
+
+
+
+GF_RETTYPE GFMxEncSetVOP(GFMxEncHandle hMxEnc, PGFMXENCVOP pVOP);
+/**< This function sets the characteristics of a new video object plane (VOP). This
+function should be called after GFMxEncSetVOL() and before
+GFMxEncStart(). If the application decides to change any VOP information
+during the encoding time (after GFMxEncStart()), the application can call
+this function to pass the new VOP information to the GFMxEncAPI.
+Otherwise, the application should not call this function, allowing the
+GFMxEncAPI to reduce overhead.
+
+ @param hMxEnc (GFMxEncHandle) Handle specific to the GFMxEncAPI.
+ @param pStatus (PGFMXENCVOP ) Set new VOP information.
+
+ @retval GF_SUCCESS : If successful.
+ @retval GF_ERROR : If error.
+ @see GFMxEncAPI_Error_Codes
+*/
+
+
+
+GF_RETTYPE GFMxEncRateControlConfig(GFMxEncHandle hMxEnc, PGFMXENCRCC pRCC);
+/**< This function initializes the GFMxEncAPI rate control block. This function is
+optional for application because the GFMxEncAPI automatically initializes
+the rate control block.
+
+ @param hMxEnc (GFMxEncHandle) Handle specific to the GFMxEncAPI.
+ @param pStatus (PGFMXENCRCC ) Set rate control information..
+
+ @retval GF_SUCCESS : If successful.
+ @retval GF_ERROR : If error.
+ @see GFMxEncAPI_Error_Codes
+*/
+
+
+GF_RETTYPE GFMxEncFeedImage(GFMxEncHandle hMxEnc,
+ PGFMXENCFEEDIMAGE pFeedImage);
+/**< The application can call this function if the application has the source image to feed to the encoder.
+This function should not be called if the image comes directly from the video
+input port (VIP), for example, from a camera.
+
+ @param hMxEnc (GFMxEncHandle) Handle specific to the GFMxEncAPI.
+ @param pStatus (PGFMXENCFEEDIMAGE ) New image information.
+
+ @retval GF_SUCCESS : If successful.
+ @retval GF_ERROR : If error.
+ @see GFMxEncAPI_Error_Codes
+*/
+
+
+
+GF_RETTYPE GFMxEncFetchImage(GFMxEncHandle hMxEnc,PGFMXENCFETCHVOP pFetchVOP);
+/**< An application should call this function to fetch the encoded VOP bit stream
+or encoded raw data. If the source image is from the host, the application
+should call this function after GFMxEncFeedImage(). If the source image is
+from a video camera connected to the VIP and the application is using a
+polling scheme, the application should call this function at least at the
+cameras frame rate.
+
+ @param hMxEnc (GFMxEncHandle) Handle specific to the GFMxEncAPI.
+ @param pStatus (PGFMXENCFETCHVOP ) Structure to hold encoded VOP information.
+
+ @retval GF_SUCCESS : If successful.
+ @retval GF_ERROR : If error.
+ @see GFMxEncAPI_Error_Codes
+*/
+
+
+GF_RETTYPE GFMxEncStart(GFMxEncHandle hMxEnc);
+/**< This function starts the GFMxEncAPI module for encoding the bit stream.
+The GFMxEncAPI assumes the first VOP it outputs is the first VOP in the
+current VOL.
+
+ @param hMxEnc (GFMxEncHandle) Handle specific to the GFMxEncAPI.
+
+ @retval GF_SUCCESS : If successful.
+ @retval GF_ERROR : If error.
+ @see GFMxEncAPI_Error_Codes
+*/
+
+GF_RETTYPE GFMxEncPause(GFMxEncHandle hMxEnc);
+/**< This function pauses the encoding process until GFMxEncPause() is called
+again to Resume encoding, or GFMxEncStop() is called to totally stop encoding.
+
+ @param hMxEnc (GFMxEncHandle) Handle specific to the GFMxEncAPI.
+
+ @retval GF_SUCCESS : If successful.
+ @retval GF_ERROR : If error.
+ @see GFMxEncAPI_Error_Codes
+*/
+
+GF_RETTYPE GFMxEncStop(GFMxEncHandle hMxEnc);
+/**< This function stops the encoding process.
+
+ @param hMxEnc (GFMxEncHandle) Handle specific to the GFMxEncAPI.
+
+ @retval GF_SUCCESS : If successful.
+ @retval GF_ERROR : If error.
+ @see GFMxEncAPI_Error_Codes
+*/
+
+GF_RETTYPE GFMxEncSetupInterrupt(GFMxEncHandle hMxEnc,void (*Inter)(void *), void * IPara);
+/**< An application can use this function to set up the interrupt callback function.
+This function must be called before GFMxEncStart().
+If this function returns GF_SUCCESS, whenever a VOP is ready the
+GFMxEncAPI calls the interrupt callback function. Inside of the callback
+function, the application can call GFMxEncSetVOP() if it is needed, and call
+GFMxEncFetchImage() to fetch the encoded VOP.
+If GF_ERROR is returned, the application should use a polling scheme.
+
+
+ @param hMxEnc (GFMxEncHandle) Handle specific to the GFMxEncAPI.
+ @param (*Inter)(void *) (void) Pointer to encoder applications interrupt callback function.
+ @param IPara (void *) Pointer to parameter of encoder applications interrupt callback function.
+
+ @retval GF_SUCCESS : If successful.
+ @retval GF_ERROR : If error.
+ @see GFMxEncAPI_Error_Codes
+*/
+
+
+GF_RETTYPE GFMxEncSetAttribute(GFMxEncHandle hMxEnc, NvU32 uiFeature, NvU32* pInfo);
+/**< This function sets a feature of the MPEG encoder hardware.
+
+ @param hMxEnc (GFMxEncHandle) Handle specific to the GFMxEncAPI.
+ @param uiFeature (NvU32) @see GFMxEncSetAttribute Definitions
+ @param pInfo (NvU32*) Pointer to the information buffer.
+
+ @retval GF_SUCCESS : If successful.
+ @retval GF_ERROR : If error.
+ @see GFMxEncAPI_Error_Codes
+
+ GFMxEncSetAttribute_Definitions:
+
+ #MXENC_ATTR_KEEP_PREV_ENCODING_INTERNAL_RESOURCE
+ #MXENC_PREVIEW_ROTATE_BUFFER
+ #MXENC_GET_PREVIEW_BUFFER
+ #MXENC_ENABLE_INTERRUPT_MODE
+
+
+ MXENC_ENABLE_INTERRUPT_MODE MXENC_GET_PREVIEW_BUFFER MXENC_PREVIEW_ROTATE_BUFFER MXENC_ATTR_KEEP_PREV_ENCODING_INTERNAL_RESOURCE
+*/
+
+
+GF_RETTYPE GFMxEncGetAttribute(GFMxEncHandle hMxEnc, NvU32 uiFeature, NvU32* pInfo);
+/**< This function gets a feature of the MPEG encoder hardware..
+
+ @param hMxEnc (GFMxEncHandle) Handle specific to the GFMxEncAPI.
+ @param uiFeature (NvU32) see GFMxEncGetAttribute_Definitions below.
+ @param pInfo (NvU32*) Pointer to the information buffer.
+
+
+ @retval GF_SUCCESS : If successful.
+ @retval GF_ERROR : If error.
+ @see GFMxEncAPI_Error_Codes
+
+
+
+GFMxEncGetAttribute_Definitions:
+GF4800 and subsequent generation of GPUs have rotator block which can rotate
+video frame before encoding. In a normal mode a Encoder doesn't need to
+capture whole video frame before encoding but in rotation mode, it needs to
+capture full video frame (YUV4:2:0) before encoding. This means rotation
+mode requires more memory.
+This option can be used to enable rotation with 4 basic modes which can be
+ORed with two h-flip and v-flip options.
+Total of 8 unique combination of rotation modes are available.
+*pInfo rotation degree used with MXENC_ATTR_ROTATION
+
+
+ #MXENC_ATTR_ROTATION
+ #MXENC_ATTR_ROTATE_0
+ #MXENC_ATTR_ROTATE_90
+ #MXENC_ATTR_ROTATE_180
+ #MXENC_ATTR_ROTATE_270
+ #MXENC_ATTR_H_FLIP
+ #MXENC_ATTR_V_FLIP
+
+
+
+
+
+*/
+
+/** @name GFMxEncGetAttribute_Definitions
+*/
+//@{
+
+/**GFMxEncGetAttribute_Definitions:
+*/
+
+/**GFMxEncGetAttribute_Definitions::MXENC_ATTR_ROTATION*/
+#define MXENC_ATTR_ROTATION 1
+/**GFMxEncGetAttribute_Definitions::MXENC_ATTR_ROTATE_0*/
+#define MXENC_ATTR_ROTATE_0 0x0
+/**GFMxEncGetAttribute_Definitions::MXENC_ATTR_ROTATE_90*/
+#define MXENC_ATTR_ROTATE_90 0x1
+/**GFMxEncGetAttribute_Definitions::MXENC_ATTR_ROTATE_180*/
+#define MXENC_ATTR_ROTATE_180 0x2
+/**GFMxEncGetAttribute_Definitions::MXENC_ATTR_ROTATE_270*/
+#define MXENC_ATTR_ROTATE_270 0x3
+/**GFMxEncGetAttribute_Definitions::MXENC_ATTR_H_FLIP*/
+#define MXENC_ATTR_H_FLIP 0x10
+/**GFMxEncGetAttribute_Definitions::MXENC_ATTR_V_FLIP*/
+#define MXENC_ATTR_V_FLIP 0x20
+//@}
+
+
+
+GF_RETTYPE GFMxEncInterruptControl(GFMxEncHandle MxHandle);
+/**< This function enables the MxEnc interrupt.
+
+ @param hMxEnc (GFMxEncHandle) Handle specific to the GFMxEncAPI.
+
+ @retval GF_SUCCESS : If successful.
+ @retval GF_ERROR : If error.
+ @see GFMxEncAPI_Error_Codes
+*/
+
+/** @name GFMxEncAPI_Error_Codes
+*/
+//@{
+
+/** GFMXE_SUCCESS*/
+#define GFMXE_SUCCESS GF_SUCCESS
+/** GFMXE_ERROR_NOT_SUPPORT_FORMAT */
+#define GFMXE_ERROR_NOT_SUPPORT_FORMAT (GFMXE_ERROR | 0x00000001)
+/** GFMXE_ERROR_INVALID_PARAMETER */
+#define GFMXE_ERROR_INVALID_PARAMETER (GFMXE_ERROR | 0x00000002)
+/** GFMXE_ERROR_NOT_ENOUGH_EMBEDDED_MEM */
+#define GFMXE_ERROR_NOT_ENOUGH_EMBEDDED_MEM (GFMXE_ERROR | 0x00000003)
+/** GFMXE_ERROR_SET_ATTRIBUTE_FAILED */
+#define GFMXE_ERROR_SET_ATTRIBUTE_FAILED (GFMXE_ERROR | 0x00000004)
+
+//@}
+
+
+ /*@}*/
+
+ /** @page pageMxEncAppNotes MxEncAPI Application Notes
+
+ @section pageMxEncAppNotes1 Programming Sequence
+
+ Todo
+ */
+
+#ifdef __cplusplus
+} // only need to export C interface if
+// used by C++ source code
+#endif
+
+#endif //#ifndef _GF_MPEG_ENC__
diff --git a/Start_WM/test6/inc/GFMxEncH264.h b/Start_WM/test6/inc/GFMxEncH264.h
new file mode 100755
index 00000000..f4f81228
--- /dev/null
+++ b/Start_WM/test6/inc/GFMxEncH264.h
@@ -0,0 +1,788 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+*
+* NVIDIA Corporation and its licensors retain all intellectual property
+* and proprietary rights in and to this software, related documentation
+* and any modifications thereto. Any use, reproduction, disclosure or
+* distribution of this software and related documentation without an
+* express license agreement from NVIDIA Corporation is strictly prohibited.
+*/
+
+/** @file GFMxEncH264.h
+GFSDK H264 Encode API header file.
+*/
+
+// The following ifdef block is the standard way of creating macros which make exporting
+// from a DLL simpler. All files within this DLL are compiled with the GFMXENC_EXPORTS
+// symbol defined on the command line. this symbol should not be defined on any project
+// that uses this DLL. This way any other project whose source files include this file see
+// GFMXENC_API functions as being imported from a DLL, wheras this DLL sees symbols
+// defined with this macro as being exported.
+#ifndef _GF_MPEG_ENC_H264__
+#define _GF_MPEG_ENC_H264__
+
+#include "GFVx.h"
+
+#include "GFDef.h"
+
+/** @addtogroup groupMxEncH264 MxEncH264API H264 Encode API
+
+ @ref pageMxEncH264AppNotes
+
+ @ref pageMxEncH264AppNotes1
+
+
+*/
+/*@{*/
+
+/** @name GFMxEncH264 API Property Caps */
+//@{
+/** MxEncH264API property flag: Support baseline Profile.
+@see MxEncH264GetProperty(), GFPROPERTY::Capability
+*/
+#define GF_MXENC_H264_CAP_BASELINE 0x00000001 //support baseline profile
+/** MxEncH264API property flag: Support Main Profile.
+@see MxEncH264GetProperty(), GFPROPERTY::Capability
+*/
+#define GF_MXENC_H264_CAP_MAIN 0x00000002 //support main profile
+/** MxEncH264API property flag: Support extended Profile.
+@see MxEncH264GetProperty(), GFPROPERTY::Capability
+*/
+#define GF_MXENC_H264_CAP_EXTENDED 0x00000004 //support extended profile
+/** MxEncH264API property flag: Support high 10 Profile.
+@see MxEncH264GetProperty(), GFPROPERTY::Capability
+*/
+#define GF_MXENC_H264_CAP_HIGH10 0x00000008 //support high 10 profile
+/** MxEncH264API property flag: Support high 422 Profile.
+@see MxEncH264GetProperty(), GFPROPERTY::Capability
+*/
+#define GF_MXENC_H264_CAP_HIGH422 0x00000010 //support high 422 profile
+/** MxEncH264API property flag: Support high 444 Profile.
+@see MxEncH264GetProperty(), GFPROPERTY::Capability
+*/
+#define GF_MXENC_H264_CAP_HIGH444 0x00000020 //support high 444 profile
+/** MxEncH264API property flag: Level_IDC following H.264 spec definition.
+@see MxEncH264GetProperty(), GFPROPERTY::Capability
+*/
+#define GF_MXENC_H264_CAP_LEVEL_IDC(Capability) \
+ ((Capability >> 12) & 0xfff)//Level_IDC following H.264 spec definition
+/** MxEncH264API property flag: Support data partitioning mode.
+@see MxEncH264GetProperty(), GFPROPERTY::Capability
+*/
+#define GF_MXENC_H264_CAP_DATA_PARTITIONING 0x10000000 //support data partitioning mode
+/** MxEncH264API property flag: Support rate control.
+@see MxEncH264GetProperty(), GFPROPERTY::Capability
+*/
+#define GF_MXENC_H264_CAP_RATE_CONTROL 0x20000000 //support rate control
+/** MxEncH264API property flag: Support intra macro block refreshing.
+@see MxEncH264GetProperty(), GFPROPERTY::Capability
+*/
+#define GF_MXENC_H264_CAP_IMRF 0x40000000 //support intra macro block refreshing
+/** MxEncH264API property flag: Support rotation.
+@see MxEncH264GetProperty(), GFPROPERTY::Capability
+*/
+#define GF_MXENC_H264_CAP_ROTATION 0x80000000 //support rotation
+
+//@}
+
+
+
+
+/**typedef struct GFMXENCH264SETSEQUENCE_TAG*/
+typedef struct GFMXENCH264SETSEQUENCE_TAG
+{
+ NvU32 SequenceInfo; /**< Sequence characteristics */
+ /**<
+
+ #GF_MXENC_H264_SEQUENCE_CONSTRAINT_SET0_FLAG
+ #GF_MXENC_H264_SEQUENCE_CONSTRAINT_SET1_FLAG
+ #GF_MXENC_H264_SEQUENCE_CONSTRAINT_SET2_FLAG
+ #GF_MXENC_H264_SEQUENCE_DELTA_PIC_ORDER_ALWAYS_ZERO_FLAG
+ #GF_MXENC_H264_SEQUENCE_FRAME_MBS_ONLY_FLAG
+ #GF_MXENC_H264_SEQUENCE_RATE_CONTROL_ENABLE
+ #GF_MXENC_H264_SEQUENCE_AUTO_IMRF_ENABLE
+ #GF_MXENC_H264_SEQUENCE_MC_IMRF_ENABLE
+ #GF_MXENC_H264_SEQUENCE_REALTIME_ENCODE
+ #GF_MXENC_H264_SEQUENCE_DEBLK_I_SLICE
+
+ */
+ NvU32 profile_idc; /**
+ #GF_MXENC_H264_PICTURE_CHANGE_INIT_QP
+ #GF_MXENC_H264_PICTURE_REDUCE_FRAME_RATE
+ #GF_MXENC_H264_PICTURE_ENCODE_IDR_ASAP
+ #GF_MXENC_H264_PICTURE_CHANGE_MIN_MAX_QP
+ #GF_MXENC_H264_PICTURE_LOAD_IMRF_COUNTER_RANGE
+ #GF_MXENC_H264_PICTURE_LOAD_IMRF_MATRIX
+ #GF_MXENC_H264_PICTURE_4MV_ENABLE
+ #GF_MXENC_H264_PICTURE_HALF_PEL_ENABLE
+ #GF_MXENC_H264_PICTURE_DEBLK_FILTER_ENABLE
+ #GF_MXENC_H264_PICTURE_MULTI_SLICE_ENABLE
+
+ */
+ NvU32 numofSlicesGroup; /**< Number of slice groups, default value = 0 */
+ NvU32 sliceGroupMapType; /**< default value is 0 , interleaved slice groups */
+ NvU32 num_of_ref_idx_10_active; /**< Specifies the maximum reference index for reference picture list 0 ,default value is 0 */
+ NvU32 num_of_ref_idx_11_active; /**< Default value is 0 */
+ NvS32 pic_init_qp; /**< Initial value of the slice QP*/
+ NvS32 pic_init_qs; /**< Initial value of the slice QS */
+ NvS32 chroma_qp_index_offset; /**< Specifies the offset that shall be added to QPY and QSY for addressing the table of QPC values. The value of chroma_qp_index_offset shall be in the range of -12 to +12, inclusive. */
+ NvU32 uiMaxIDRQP; /**< Max QP value for IDR */
+ NvU32 uiMinIDRQP; /**< Min QP value for IDR */
+
+ NvU32 uiMaxNONIDRQP; /**< Max QP value for non-IDR picture */
+ NvU32 uiMinNONIDRQP; /**< Min QP value for non-IDR picture */
+
+ NvU32 SliceAlpha; /**< Aplha value for Deblocking */
+ NvU32 SliceBeta; /**< Beta value for Deblocking */
+
+ /**< Packetisation for H264*/
+ NvU32 uiPacketCtrlDisable; /**< Disables the packet mode control */
+ NvU32 uiPacketMode; /**< If 1 ,then in macroblock mode else in bytes mode, bytes mode not supported */
+ NvU32 uiPacketSize; /**< Packet size in MBs or bytes, packet size in bytes is not supported, Value can range from zero to the number of MBs in a frame */
+
+ NvU32 uiNumofPicBetween2IDRs; /**< Number of P frames in between consecutive I Frames */
+ NvU32 uiRNumerator; /**< Desired Framerate value. This field must be filled if flag GF_MXENC_H264_PICTURE_REDUCE_FRAME_RATE is on. */
+ NvU32 uiRDenominator; /**< Camera Framerate. This field must be filled if flag F_MXENC_H264_PICTURE_REDUCE_FRAME_RATE is on. */
+ NvU32 uiIMRFIMinValue; /**< Those values will take effect only when GF_MXENC_H264_PICTURE_LOAD_IMRF_COUNTER_RANGE flag is set. Whenever an I frame is encoded, MxEncH264 will generate a random number in this range for each macroblock */
+ NvU32 uiIMRFIMaxValue; /**< Those values will take effect only when GF_MXENC_H264_PICTURE_LOAD_IMRF_COUNTER_RANGE flag is set. Whenever an I frame is encoded, MxEncH264 will generate a random number in this range for each macroblock. */
+ NvU32 uiIMRFPMinValue; /**< Those values will take effect only when GF_MXENC_H264_PICTURE_LOAD_IMRF_COUNTER_RANGE flag is set. Whenever a Macro Block counter is reduced to 0, an Intra Macro Block will be generated by MxEncH264. MxEncH264 will generate a random number in this range for this macroblock. */
+ NvU32 uiIMRFPMaxValue; /**< Those values will take effect only when GF_MXENC_H264_PICTURE_LOAD_IMRF_COUNTER_RANGE flag is set. Whenever a Macro Block counter is reduced to 0, an Intra Macro Block will be generated by MxEncH264. MxEncH264 will generate a random number in this range for this macroblock. */
+ NvU32 uiIMRFDefaultCounter; /**< This value will be used as the new counter when the refresh counter in the matrix is decreased to 0. */
+ NvU8 *pIMRFMatrix; /**< Pointer to an array that holds counter for each Macro Block. When this counter is decreased to 0, one Intra Macro Block will be inserted.*/
+
+
+} GFMXENCH264SETPICTURE, *PGFMXENCH264SETPICTURE;
+
+/** @name GFMxEncH264 API Setpicture::PictureInfo */
+//@{
+/**GFMXENCH264SETPICTURE::PictureInfo: When application enables this flag, application must set pic_init_qp, pic_init_qs and chroma_qp_index_offset.*/
+#define GF_MXENC_H264_PICTURE_CHANGE_INIT_QP 0x00000001
+
+/**GFMXENCH264SETPICTURE::PictureInfo:Reduce the frame rate by skipping certain frames, Must set uiRNumerator and uiRDenominator.*/
+#define GF_MXENC_H264_PICTURE_REDUCE_FRAME_RATE 0x00000002
+
+/**GFMXENCH264SETPICTURE::PictureInfo: Encode IDR as soon as possible .*/
+#define GF_MXENC_H264_PICTURE_ENCODE_IDR_ASAP 0x00000004
+
+/**GFMXENCH264SETPICTURE::PictureInfo:When application set this flag, application must set uiMaxIDRQP, uiMinIDRQP, uiMaxNONIDRQP and uiMinNONIDRQP .*/
+#define GF_MXENC_H264_PICTURE_CHANGE_MIN_MAX_QP 0x00000008
+
+/**GFMXENCH264SETPICTURE::PictureInfo:Application changes the counter range by setting this, flag and giving the range in uiIMRFIMinValue uiIMRFIMaxValue, uiIMRFPMinValue, and uiIMRFPMaxValue, Applications can turn on this flag only when GF_MXENC_H264_SEQUENCE_AUTO_IMRF_ENABLE is on.*/
+#define GF_MXENC_H264_PICTURE_LOAD_IMRF_COUNTER_RANGE 0x00000010
+
+/**GFMXENCH264SETPICTURE::PictureInfo: Application must fill in uiIMRFDefaultCounter and pIMRFMatrix if this flag is on, Application can turn on flag only if GF_MXENC_H264_PICTURE_MC_IMRF_ENABLE is on .*/
+#define GF_MXENC_H264_PICTURE_LOAD_IMRF_MATRIX 0x00000020
+
+/**GFMXENCH264SETPICTURE::PictureInfo: Enable 4 motion vectors, GFMxEncH264 will pick 1 MV or 4 MV, depends on which mode is more efficient.*/
+#define GF_MXENC_H264_PICTURE_4MV_ENABLE 0x00000040
+
+/**GFMXENCH264SETPICTURE::PictureInfo: Enable half pel motion estimation search.*/
+#define GF_MXENC_H264_PICTURE_HALF_PEL_ENABLE 0x00000080
+
+/**GFMXENCH264SETPICTURE::PictureInfo: Enable Deblocking.*/
+#define GF_MXENC_H264_PICTURE_DEBLK_FILTER_ENABLE 0x00000100
+
+/**GFMXENCH264SETPICTURE::PictureInfo: Enable Multi Slicing. Mutli-slicing is not supported*/
+#define GF_MXENC_H264_PICTURE_MULTI_SLICE_ENABLE 0x00000200
+//@}
+
+/** typedef struct GFMXENCH264RCC_TAG */
+typedef struct GFMXENCH264RCC_TAG
+{
+ NvU16 uiIQP; /**
+ #GF_MXENC_H264_NALS_SEQUENCE_PARAMETER_SET
+ #GF_MXENC_H264_NALS_PICTURE_PARAMETER_SET
+ #GF_MXENC_H264_NALS_IDR_PIC
+ #GF_MXENC_H264_NALS_NON_IDR_PIC
+ #GF_MXENC_H264_NALS_BEGIN_ACCESS_UNIT
+ #GF_MXENC_H264_NALS_PARTIAL_ACCESS_UNIT
+ #GF_MXENC_H264_NALS_END_ACCESS_UNIT
+ #GF_MXENC_H264_NALS_DATA_NOT_READY
+ #GF_MXENC_H264_NALS_MORE_FETCH
+ #GF_MXENC_H264_NALS_MORE_NALS
+
+ */
+ NvU32 uiTime; /**< In milliseconds, the encoded picture's time stamp. First picture may start from 0. */
+ NvU32 uiFetchedSize; /**< Number of available bytes */
+}GFMXENCH264FETCHNALS, *PGFMXENCH264FETCHNALS;
+
+/** @name GFMXENCH264FETCHNALS::uiNALsInfo definitions */
+//@{
+
+/**GFMXENCH264FETCHNALS::uiNALsInfo:Current NAL unit is a Sequence Parameter Set. */
+#define GF_MXENC_H264_NALS_SEQUENCE_PARAMETER_SET 0x00000001
+
+/**GFMXENCH264FETCHNALS::uiNALsInfo:Current NAL unit is a Picture Parameter Set. */
+#define GF_MXENC_H264_NALS_PICTURE_PARAMETER_SET 0x00000002
+
+/**GFMXENCH264FETCHNALS::uiNALsInfo:Current NAL unit belongs to an IDR Pic. */
+#define GF_MXENC_H264_NALS_IDR_PIC 0x00000004
+
+/**GFMXENCH264FETCHNALS::uiNALsInfo:Current NAL unit belongs to a Non-IDR Pic. */
+#define GF_MXENC_H264_NALS_NON_IDR_PIC 0x00000008
+
+/**GFMXENCH264FETCHNALS::uiNALsInfo:Current data is the start of a new Access Unit. */
+#define GF_MXENC_H264_NALS_BEGIN_ACCESS_UNIT 0x00000010
+
+/**GFMXENCH264FETCHNALS::uiNALsInfo:Current data is a Partial Access Unit. */
+#define GF_MXENC_H264_NALS_PARTIAL_ACCESS_UNIT 0x00000020
+
+/**GFMXENCH264FETCHNALS::uiNALsInfo:Current data is the End of the Access Unit. */
+#define GF_MXENC_H264_NALS_END_ACCESS_UNIT 0x00000040
+
+/**GFMXENCH264FETCHNALS::uiNALsInfo:Data of current NAL is not ready yet.*/
+#define GF_MXENC_H264_NALS_DATA_NOT_READY 0x00000080
+
+/**GFMXENCH264FETCHNALS::uiNALsInfo: Present NAL unit is larger than application's buffer size. Call FetchNALs again to get remaining data.*/
+#define GF_MXENC_H264_NALS_MORE_FETCH 0x00000100
+
+/** GFMXENCH264FETCHNALS::uiNALsInfo: More NALs are encoded and ready to be fetched by the application. */
+#define GF_MXENC_H264_NALS_MORE_NALS 0x00000200
+
+//@}
+
+/** @name GFMxEncH264SetAttribute Definitions */
+//@{
+
+/**GFMxEncH264SetAttribute_Definitions::MXENC_H264_ATTR_ROTATION:
+GF4800 and subsequent generation of GPUs have rotator block which can rotate
+video frame before encoding. In a normal mode a Encoder doesn't need to
+capture whole video frame before encoding but in rotation mode, it needs to
+capture full video frame (YUV4:2:0) before encoding. This means rotation
+mode requires more memory.
+This option can be used to enable rotation with 4 basic modes which can be
+ORed with two h-flip and v-flip options.
+Total of 8 unique combination of rotation modes are available.
+*pInfo rotation degree used with MXENC_ATTR_ROTATION
+*/
+#define MXENC_H264_ATTR_ROTATION 1
+
+#define MXENC_H264_ATTR_ROTATE_0 0x0 /**< No rotation */
+#define MXENC_H264_ATTR_ROTATE_90 0x1 /**< Rotate by 90 degree */
+#define MXENC_H264_ATTR_ROTATE_180 0x2 /**< Rotate by 180 degree */
+#define MXENC_H264_ATTR_ROTATE_270 0x3 /**< Rotate by 270 degree */
+#define MXENC_H264_ATTR_H_FLIP 0x10 /**< Flip horizontally */
+#define MXENC_H264_ATTR_V_FLIP 0x20 /**< Flip vertically */
+
+/**GFMxEncH264SetAttribute_Definitions:MXENC_H264_INTRAREFRESH_MODE
+This option allows you to change the INTRA REFRESH mode while encoding is in progress.
+With this option, the application can switch/Turn ON MXENC_H264_INTRAREFRESH_AUTO or
+MXENC_H264_INTRAREFRESH_MC. After switching to MXENC_H264_INTRAREFRESH_MC mode, the application
+has to call GFMxEncH264SetPicture() with pPicture:pIMRFMatrix specifying the Intra Refresh pattern
+*/
+#define MXENC_H264_INTRAREFRESH_MODE 2
+#define MXENC_H264_INTRAREFRESH_AUTO 0x1 /**< Set Intrarefresh pattern in Auto mode */
+#define MXENC_H264_INTRAREFRESH_MC 0x2 /**< Set Intrarefresh pattern in Motion Compensated mode */
+
+//@}
+
+/** typedef enum GFMX_ENC_H264_INTERRUPT_OPERATION_TYPE : Set Interrupt Operation to perform */
+typedef enum
+{
+ GFMX_ENC_H264_INTERRUPT_ENABLE, /**< Enable Interrupt */
+ GFMX_ENC_H264_INTERRUPT_DISABLE, /**< Disable Interrupt */
+ GFMX_ENC_H264_INTERRUPT_CLEAR /**< Clear Interrupt */
+} GFMX_ENC_H264_INTERRUPT_OPERATION_TYPE; // Interrupt operation.
+
+/** typedef enum GFMX_ENC_H264_INTERRUPT_TYPE : Interrupt type*/
+typedef enum
+{
+ GFMX_ENC_H264_FRAME_ENCODE_DONE_INTR /**< Frame Encode Done Interrupt */
+} GFMX_ENC_H264_INTERRUPT_TYPE;
+
+
+#ifdef __cplusplus
+extern "C" { // only need to export C interface if
+ // used by C++ source code
+#endif
+
+ /** MxEncH264API virtual function pointer table.
+ These functions serve as the entry point to the MxEncH264API from the application.
+ */
+ typedef struct _GFMXEncH264TABLE
+ {
+ GF_RETTYPE (* MxEncH264GetProperty)(GFMxEncH264Handle hMxEncH264, PGFPROPERTY pMXProp );
+ /**< This function returns a variety of information, including the version of the
+ GFMxEncH264API encoder module. It is a good practice to call this function to query
+ for the GFMxEncH264API version and its capabilities before using the rest of the
+ GFMxEncH264API functions.
+
+ @param hMxEncH264 (GFMxEncH264Handle) Handle specific to the GFMxEncH264API.
+ @param pMXProp (PGFPROPERTY) Pointer to GFPROPERTY.
+ MxEncH264API property flag below.
+
+ MxEncH264API property flag:
+
+ #GF_MXENC_H264_CAP_BASELINE
+ #GF_MXENC_H264_CAP_MAIN
+ #GF_MXENC_H264_CAP_EXTENDED
+ #GF_MXENC_H264_CAP_HIGH10
+ #GF_MXENC_H264_CAP_HIGH422
+ #GF_MXENC_H264_CAP_HIGH444
+ #GF_MXENC_H264_CAP_LEVEL_IDC
+ #GF_MXENC_H264_CAP_DATA_PARTITIONING
+ #GF_MXENC_H264_CAP_RATE_CONTROL
+ #GF_MXENC_H264_CAP_IMRF
+ #GF_MXENC_H264_CAP_ROTATION
+
+
+ @retval GF_SUCCESS : If successful.
+ @retval GF_ERROR : If error.
+ @see GFMxEncH264API_Error_Codes
+
+ It is a good practice to call this function to query for the API version
+ and its capabilities before using the rest of the MxEncH264API functions.
+ */
+
+ GF_RETTYPE (* MxEncH264GetStatus)(GFMxEncH264Handle hMxEncH264, NvU32 * pStatus);
+ /**< This function returns the hardware encoders status.
+
+ @param hMxEncH264 (GFMxEncH264Handle) Handle specific to the GFMxEncH264API.
+ @param pStatus (NvU32 * ) Status returned by the encoder. @see GFMxEncH264GetStatus Definitions.
+
+ @retval GF_SUCCESS : If successful.
+ @retval GF_ERROR : If error.
+ @see GFMxEncH264API_Error_Codes
+ */
+
+ GF_RETTYPE (* MxEncH264SetSequence)(GFMxEncH264Handle hMxEncH264, PGFMXENCH264SETSEQUENCE pSequence);
+ /**< This function sets the characteristics of a new H264 video sequence and
+ tells the GFMxEncH264API the sequence information. The GFMxEncH264API does not
+ generate a sequence bit stream. The application needs to prepare a sequence by itself.
+
+ @param hMxEncH264 (GFMxEncH264Handle) Handle specific to the GFMxEncH264API.
+ @param pSequence (PGFMXENCH264SETSEQUENCE ) Set new sequence information.
+
+ @retval GF_SUCCESS : If successful.
+ @retval GF_ERROR : If error.
+ @see GFMxEncH264API_Error_Codes
+ */
+
+ GF_RETTYPE (* MxEncH264SetPicture)(GFMxEncH264Handle hMxEncH264, PGFMXENCH264SETPICTURE pPicture);
+ /**< This function sets the characteristics of a new picture. This
+ function should be called after GFMxEncH264SetSequence() and before
+ GFMxEncH264Start(). If the application decides to change any picture information
+ during the encoding time (after GFMxEncH264Start()), the application can call
+ this function to pass the new picture information to the GFMxEncH264API.
+ Otherwise, the application should not call this function, allowing the
+ GFMxEncH264API to reduce overhead.
+
+ @paramhMxEncH264 (GFMxEncH264Handle) Handle specific to the GFMxEncH264API.
+ @param pPicture (PGFMXENCH264SETPICTURE ) Set new picture information.
+
+ @retval GF_SUCCESS : If successful.
+ @retval GF_ERROR : If error.
+ @see GFMxEncH264API_Error_Codes
+ */
+
+ GF_RETTYPE (* MxEncH264RateControlConfig)(GFMxEncH264Handle hMxEncH264, PGFMXENCH264RCC pRCC);
+ /**< This function initializes the GFMxEncH264API rate control block. This function is
+ optional for application because the GFMxEncH264API automatically initializes
+ the rate control block.
+
+ @param hMxEncH264 (GFMxEncH264Handle) Handle specific to the GFMxEncH264API.
+ @param pRCC (PGFMXENCH264RCC ) Set rate control information..
+
+ @retval GF_SUCCESS : If successful.
+ @retval GF_ERROR : If error.
+ @see GFMxEncH264API_Error_Codes
+ */
+
+ GF_RETTYPE (* MxEncH264FeedImage)(GFMxEncH264Handle hMxEncH264,
+ PGFMXENCH264FEEDIMAGE pFeedImage);
+ /**< The application can call this function if the application has the source image to feed to the encoder.
+ This function should not be called if the image comes directly from the video
+ input port (VIP), for example, from a camera.
+
+ @param hMxEncH264 (GFMxEncH264Handle) Handle specific to the GFMxEncH264API.
+ @param pStatus (PGFMXENCH264FEEDIMAGE ) New image information.
+
+ @retval GF_SUCCESS : If successful.
+ @retval GF_ERROR : If error.
+ @see GFMxEncH264API_Error_Codes
+ */
+
+ GF_RETTYPE (* MxEncH264FetchNALs)(GFMxEncH264Handle hMxEncH264,
+ PGFMXENCH264FETCHNALS pFetchNALs);
+ /**< An application should call this function to fetch the encoded NAL bit stream
+ or encoded raw data. If the source image is from the host, the application
+ should call this function after GFMxEnch264FeedImage(). If the source image is
+ from a video camera connected to the VIP and the application is using a
+ polling scheme, the application should call this function at least at the
+ cameras frame rate.
+
+ @param hMxEncH264 (GFMxEncH264Handle) Handle specific to the GFMxEncH264API.
+ @param pFetchNALs (PGFMXENCH264FETCHNALS ) Structure to hold encoded NAL information.
+
+ @retval GF_SUCCESS : If successful.
+ @retval GF_ERROR : If error.
+ @see GFMxEncH264API_Error_Codes
+ */
+
+ GF_RETTYPE (* MxEncH264Start)(GFMxEncH264Handle hMxEncH264);
+ /**< This function starts the GFMxEncH264API module for encoding the bit stream.
+
+ @param hMxEncH264 (GFMxEncH264Handle) Handle specific to the GFMxEncH264API.
+
+ @retval GF_SUCCESS : If successful.
+ @retval GF_ERROR : If error.
+ @see GFMxEncH264API_Error_Codes
+ */
+ GF_RETTYPE (* MxEncH264Pause)(GFMxEncH264Handle hMxEncH264);
+ /**< This function pauses the encoding process until GFMxEnch264Pause() is called
+ again to Resume encoding, or GFMxEncH264Stop() is called to totally stop encoding.
+
+ @param hMxEnc (GFMxEncH264Handle) Handle specific to the GFMxEncH264API.
+
+ @retval GF_SUCCESS : If successful.
+ @retval GF_ERROR : If error.
+ @see GFMxEncH264API_Error_Codes
+ */
+
+ GF_RETTYPE (* MxEncH264Stop)(GFMxEncH264Handle hMxEncH264);
+ /**< This function stops the encoding process.
+
+ @param hMxEncH264 (GFMxEncH264Handle) Handle specific to the GFMxEncH264API.
+
+ @retval GF_SUCCESS : If successful.
+ @retval GF_ERROR : If error.
+ @see GFMxEncH264API_Error_Codes
+ */
+
+ GF_RETTYPE (* MxEncH264SetupInterrupt)(GFMxEncH264Handle hMxEncH264,
+ void (*Inter)(void *), void * IPara);
+ /**< An application can use this function to set up the interrupt callback function.
+
+
+ @param hMxEncH264 (GFMxEncH264Handle) Handle specific to the GFMxEncH264API.
+ @param (*Inter)(void *) (void) Pointer to encoder applications interrupt callback function.
+ @param IPara (void *) Pointer to parameter of encoder applications interrupt callback function.
+
+ @retval GF_SUCCESS : If successful.
+ @retval GF_ERROR : If error.
+ @see GFMxEncH264API_Error_Codes
+ */
+
+ GF_RETTYPE (* MxEncH264SetAttribute)(GFMxEncH264Handle hMxEncH264, NvU32 uiFeature, NvU32* pInfo);
+ /**< This function sets a feature of the H264 encoder.
+
+ @param hMxEncH264 (GFMxEncH264Handle) Handle specific to the GFMxEncH264API.
+ @param uiFeature (NvU32) @see GFMxEncH264SetAttribute Definitions
+ @param pInfo (NvU32*) Pointer to the information buffer.
+
+ @retval GF_SUCCESS : If successful.
+ @retval GF_ERROR : If error.
+ @see GFMxEncH264API_Error_Codes
+
+ GFMxEncH264SetAttribute_Definitions:
+
+ #MXENC_H264_ATTR_ROTATION
+ #MXENC_H264_INTRAREFRESH_MODE
+
+
+
+ */
+ GF_RETTYPE (* MxEncH264GetAttribute)(GFMxEncH264Handle hMxEncH264, NvU32 uiFeature, NvU32* pInfo);
+ /**< This function gets a feature of the H264 encoder.
+
+ @param hMxEnc (GFMxEncH264Handle) Handle specific to the GFMxEncH264API.
+ @param uiFeature (NvU32) see GFMxEncH264GetAttribute_Definitions below.
+ @param pInfo (NvU32*) Pointer to the information buffer.
+
+
+ @retval GF_SUCCESS : If successful.
+ @retval GF_ERROR : If error.
+ @see GFMxEncAPI_Error_Codes
+
+ */
+
+ }GFMXENCH264TABLE, *PGFMXENCH264TABLE;
+
+ // Typesafe functions for opening and closing this component
+ GF_RETTYPE GFMxEncH264Open(GFRmHandle hRm, GFMxEncH264Handle *phMxEncH264,
+ GF_STATE_TYPE state, GFRmChHandle hCh);
+ /**< Typesafe function for opening the H264 Encoder component.
+
+ @param hRm (GFRmHandle) RM Handle got from GFRmOpen.
+ @param phMxEncH264 (GFMxEncH264Handle *) Handle specific to the GFMxEncH264API is returned in this.
+ @param state (GF_STATE_TYPE) .
+ @param hCh (GFRmChHandle) Channel handle
+ */
+
+ void GFMxEncH264Close(GFMxEncH264Handle *phMxEncH264);
+ /**< Typesafe function for closing the H264 Encoder component.
+
+ @param phMxEncH264 (GFMxEncH264Handle *) Pointer to handle specific to H264 encoder component.
+ */
+
+ /** @name GFMxEncH264GetStatus Definitions */
+ //@{
+#define GF_ENCODER_BUSY 0x00000001 /**< Encoder is busy */
+#define GF_ENCODER_VOP_READY 0x00000002 /**< At least one VOP is ready for fetching */
+ //@}
+
+/** @name GFMxEncH264API Helper Macros. */
+ //@{
+
+#define GFMxEncH264GetProperty(hMxEncH264, pMXProp) \
+ ((PGFMXENCH264TABLE)hMxEncH264)->MxEncH264GetProperty(hMxEncH264, pMXProp)
+ /**< Helper macro for GFMxEncH264API.
+ @see GFMXENCH264TABLE::MxEncH264GetProperty
+ */
+
+#define GFMxEncH264GetStatus(hMxEncH264, pStatus) \
+ ((PGFMXENCH264TABLE)hMxEncH264)->MxEncH264GetStatus(hMxEncH264, pStatus)
+ /**< Helper macro for GFMxEncH264API.
+ @see GFMXENCH264TABLE::MxEncH264GetStatus
+ */
+
+#define GFMxEncH264SetSequence(hMxEncH264, pSequence) \
+ ((PGFMXENCH264TABLE)hMxEncH264)->MxEncH264SetSequence(hMxEncH264, pSequence)
+ /**< Helper macro for GFMxEncH264API.
+ @see GFMXENCH264TABLE::MxEncH264SetSequence
+ */
+
+#define GFMxEncH264SetPicture(hMxEncH264, pPicture)\
+ ((PGFMXENCH264TABLE)hMxEncH264)->MxEncH264SetPicture(hMxEncH264, pPicture)
+ /**< Helper macro for GFMxEncH264API.
+ @see GFMXENCH264TABLE::MxEncH264SetPicture
+ */
+
+#define GFMxEncH264RateControlConfig(hMxEncH264, pRCC)\
+ ((PGFMXENCH264TABLE)hMxEncH264)->MxEncH264RateControlConfig(hMxEncH264, pRCC)
+ /**< Helper macro for GFMxEncH264API.
+ @see GFMXENCH264TABLE::MxEncH264RateControlConfig
+ */
+
+#define GFMxEncH264FeedImage(hMxEncH264, pFeedImage)\
+ ((PGFMXENCH264TABLE)hMxEncH264)->MxEncH264FeedImage(hMxEncH264, pFeedImage)
+ /**< Helper macro for GFMxEncH264API.
+ @see GFMXENCH264TABLE::MxEncH264FeedImage
+ */
+
+#define GFMxEncH264FetchNALs(hMxEncH264, pFetchNALs)\
+ ((PGFMXENCH264TABLE)hMxEncH264)->MxEncH264FetchNALs(hMxEncH264, pFetchNALs)
+ /**< Helper macro for GFMxEncH264API.
+ @see GFMXENCH264TABLE::MxEncH264FetchNALs
+ */
+
+#define GFMxEncH264Start(hMxEncH264)\
+ ((PGFMXENCH264TABLE)hMxEncH264)->MxEncH264Start(hMxEncH264)
+ /**< Helper macro for GFMxEncH264API.
+ @see GFMXENCH264TABLE::MxEncH264Start
+ */
+
+#define GFMxEncH264Pause(hMxEncH264)\
+ ((PGFMXENCH264TABLE)hMxEncH264)->MxEncH264Pause(hMxEncH264)
+ /**< Helper macro for GFMxEncH264API.
+ @see GFMXENCH264TABLE::MxEncH264Pause
+ */
+
+#define GFMxEncH264Stop(hMxEncH264)\
+ ((PGFMXENCH264TABLE)hMxEncH264)->MxEncH264Stop(hMxEncH264)
+ /**< Helper macro for GFMxEncH264API.
+ @see GFMXENCH264TABLE::MxEncH264Stop
+ */
+
+#define GFMxEncH264SetupInterrupt(hMxEncH264, Inter,IPara)\
+ ((PGFMXENCH264TABLE)hMxEncH264)->MxEncH264SetupInterrupt(hMxEncH264, Inter,IPara)
+ /**< Helper macro for GFMxEncH264API.
+ @see GFMXENCH264TABLE::MxEncH264SetupInterrupt
+ */
+
+#define GFMxEncH264SetAttribute(hMxEncH264, uiFeature, pInfo) \
+ ((PGFMXENCH264TABLE)hMxEncH264)->MxEncH264SetAttribute(hMxEncH264, uiFeature, pInfo)
+ /**< Helper macro for GFMxEncH264API.
+ @see GFMXENCH264TABLE::MxEncH264SetAttribute
+ */
+
+#define GFMxEncH264GetAttribute(hMxEncH264, uiFeature, pInfo) \
+ ((PGFMXENCH264TABLE)hMxEncH264)->MxEncH264GetAttribute(hMxEncH264, uiFeature, pInfo)
+ /**< Helper macro for GFMxEncH264API.
+ @see GFMXENCH264TABLE::MxEncH264GetAttribute
+ */
+
+ //@}
+
+ /** @name GFMxEncH264API_Error_Codes
+ */
+ //@{
+
+ /** GFMXEH264_SUCCESS*/
+#define GFMXEH264_SUCCESS GF_SUCCESS
+ /** GGFMXEH264_ERROR_NOT_SUPPORT_FORMAT*/
+#define GFMXEH264_ERROR_NOT_SUPPORT_FORMAT (GFMXEH264_ERROR | 0x00000001)
+ /** GFMXEH264_ERROR_INVALID_PARAMETER*/
+#define GFMXEH264_ERROR_INVALID_PARAMETER (GFMXEH264_ERROR | 0x00000002)
+ /** GFMXEH264_ERROR_NOT_ENOUGH_EMBEDDED_MEM*/
+#define GFMXEH264_ERROR_NOT_ENOUGH_EMBEDDED_MEM (GFMXEH264_ERROR | 0x00000003)
+ //@}
+
+
+ /*@}*/
+
+ /** @page pageMxEncH264AppNotes MxEncH264API Application Notes
+
+ @section pageMxEncH264AppNotes1 Programming Sequence
+
+ The following procedure requires that GFRmOpen() is called first to start GFSDK usage. The description is for a typical case
+ where encoding of video being captured from a camera is done and preview shown on the display.
+
+ 1. Initialize the display panel by using GFRmIxInit().\n
+
+ 2. Open the display component by calling GFDxOpen() to get the GFMxDecAPI Dxhandle.\n
+
+ 3. Initialize the display start address, stride and bits per pixel using GFDxSetDisplay().\n
+
+ 4. Get the various attributes of the display panel (width, height, etc) using GFDxGetAttribute().\n
+
+ 5. For clearing the screen, open the graphics component using GFGxOpen() and use GFGxFillRect() for filling the screen with
+ some color (say, green).\n
+
+ 6. Open the Vx component using GFVxOpen() and get the GFVxAPI VxHandle. \n
+
+ 7. Setup the camera. \n
+
+ 8. Initialize VIP. \n
+
+ 9. Obtain the handle specific to H264 encoder by calling GFMxEncH264Open(). \n
+
+ 10. Call GFMxEncH264GetProperty() to query properties. Check whether this version can support the desired H264 profile and level. \n
+
+ 11. If supported, call GFRmSurfaceAlloc() to allocate one surface for encoding purposes. \n
+
+ 12. Call GFMxEncH264SetAttribute() if specific features need to be set. \n
+
+ 13. Call GFMxEncH264SetSequence() for configuring the characteristics of a new H264 video sequence. \n
+
+ 14. Call GFMxEncH264SetPicture() for setting the characteristics of a new picture. \n
+
+ 15. If the current source image is from the CPU, the application should call GFMxEncH264FeedImage() to feed the
+ image to the GFMxEncH264API. If the current source image is coming from the VIP (for example. camera input), the
+ application should skip the GFMxEncH264FeedImage() call.
+
+ 16. If the application uses an interrupt scheme, it must implement a callback function and set it up using GFMxEncH264SetupInterrupt.
+ Inside of the callback function, the application should call GFMxEncH264FetchNALs() to retrieve the encoded NALs. \n
+
+ 17. Start the encoding by calling GFMxEncH264Start(). \n
+
+ 18. The application should periodically call the callback function to get the data from the encoder. \n
+
+ 19. The encoder can be paused by calling GFMxEncH264Pause() and can be resumed by calling GFMxEncH264Pause() again. \n
+
+ 20. Before exiting, call GFMxEncH264Stop() to stop the encoder. \n
+
+ 21. Call the callback function after waiting for some time to get the data for the last frame encoded. \n
+
+ 22. Free all relevent resources and call GFMxEncH264Close() to free the H264 encoder component. \n
+
+ */
+
+#ifdef __cplusplus
+} // only need to export C interface if
+// used by C++ source code
+#endif
+
+#endif //#ifndef _GF_MPEG_ENC_H264__
diff --git a/Start_WM/test6/inc/GFOSx.h b/Start_WM/test6/inc/GFOSx.h
new file mode 100755
index 00000000..f3f48b0d
--- /dev/null
+++ b/Start_WM/test6/inc/GFOSx.h
@@ -0,0 +1,39 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/** @file GFOSx.h
+ GFSDK OS Abstraction API header file.
+*/
+
+#ifndef __GFOSx_H__
+#define __GFOSx_H__
+
+#include "GFRmOEM.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+/** @addtogroup groupOSx OSxAPI OS Abstraction API
+*/
+/*@{*/
+
+// Typesafe functions for opening and closing this component
+GF_RETTYPE GFOSxOpen(GFRmHandle hRm, GFOSxHandle *phOSx,
+ GF_STATE_TYPE state, GFRmChHandle hCh);
+void GFOSxClose(GFOSxHandle *phOSx);
+
+/*@}*/
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // _GFOSx_H_
diff --git a/Start_WM/test6/inc/GFOption.h b/Start_WM/test6/inc/GFOption.h
new file mode 100755
index 00000000..c54f0d7e
--- /dev/null
+++ b/Start_WM/test6/inc/GFOption.h
@@ -0,0 +1,140 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/** @file GFOption.h
+ GFSDK (Compile-time) Option header file.
+ Contains user level options and selected compile-time options.
+*/
+
+#ifndef __GFOPTION_H__
+#define __GFOPTION_H__
+
+#include "cpuopsys.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+
+/***************************************************************************
+ * Hardware Dependent Options and Compile-time selections
+ ***************************************************************************/
+
+/** @name Device ID options and compile-time selection
+ @anchor DeviceIDs
+ #GF_DEVICE_ID_DEFAULT option is for selecting any ID.
+@{*/
+
+#define GF_DEVICE_ID_DEFAULT 0x0000
+#define GF_DEVICE_ID_SC11 0x0011
+#define GF_DEVICE_ID_SC15 0x0015
+#define GF_DEVICE_ID_SC14 0x0014
+
+#ifndef GF_DEVICE_ID
+#define GF_DEVICE_ID GF_DEVICE_ID_SC15
+ // Primary chip id
+#endif /* GF_DEVICE_ID */
+
+#define GF_DEVICE_ID_MASK 0x0000FFFF
+#define GF_DEVICE_ID_SHIFT 0
+#define GF_DEVICE_ID_VALUE( val ) \
+ (((val) >> GF_DEVICE_ID_SHIFT) & GF_DEVICE_ID_MASK)
+/*@}*/
+
+/** @name Device Revision options and compile-time selection
+ @anchor DeviceRevisions
+ #GF_DEVICE_REV_DEFAULT is for selecting any revision.
+ Always use 16bit when referring Device Revision only.
+@{*/
+#define GF_REV_A1 0x00A1
+#define GF_REV_A2 0x00A2
+#define GF_REV_A3 0x00A3
+#define GF_REV_A4 0x00A4
+
+#define GF_DEVICE_REV_DEFAULT 0x0000
+#ifndef GF_DEVICE_REV
+#define GF_DEVICE_REV GF_DEVICE_REV_DEFAULT
+ //!< Primary chip revision
+#endif /* GF_DEVICE_REV */
+
+#define GF_DEVICE_REV_MASK 0x0000FFFF
+#define GF_DEVICE_REV_SHIFT 16
+#define GF_DEVICE_REV_VALUE( val ) \
+ (((val) >> GF_DEVICE_REV_SHIFT) & GF_DEVICE_REV_MASK)
+
+/*@}*/
+
+#if defined(NVCPU_XTENSA)
+
+// On DSP, we always use direct addressing.
+#define GF_DEVICE_ADDRESS_DEFAULT GF_DEVICE_ADDRESS_DIRECT
+#define GF_DEVICE_ADDRESS GF_DEVICE_ADDRESS_DIRECT
+
+#else
+
+// On host CPU, direct & indirect addressing are available in runtime. Default
+// is direct addressing.
+#ifndef GF_DEVICE_ADDRESS_DEFAULT
+#define GF_DEVICE_ADDRESS_DEFAULT GF_DEVICE_ADDRESS_DIRECT
+#endif /* GF_DEVICE_ADDRESS_DEFAULT */
+
+#ifndef GF_DEVICE_ADDRESS
+#define GF_DEVICE_ADDRESS ( GF_DEVICE_ADDRESS_DIRECT \
+ | GF_DEVICE_ADDRESS_INDIRECT16 \
+ | GF_DEVICE_ADDRESS_INDIRECT8 \
+ | GF_DEVICE_ADDRESS_INDIRECT32)
+#endif /* GF_DEVICE_ADDRESS */
+
+#endif
+
+
+
+/***************************************************************************
+ * Operating system Dependent Options
+ ***************************************************************************/
+
+/* The bootloader has already initialized the chip and display. To avoid
+ * writing the hardware again (which can cause screen flicker and other
+ * symptoms that the customer doesn't like), define this variable to 1.
+ */
+#ifndef GF_BOOTLOADER_PRESENT
+#define GF_BOOTLOADER_PRESENT 0
+#endif
+
+
+
+
+// If we're compiling for the bootloader right now, of course the
+// bootloader cannot be present
+#ifdef GF_BOOT_LIB
+#undef GF_BOOTLOADER_PRESENT
+#define GF_BOOTLOADER_PRESENT 0
+#endif
+
+/**************************************************************************
+ * GFSDK Library Auto Compiler Options
+ * Attempts to set up enough options if none is specified by Build Project.
+ **************************************************************************/
+
+// XXX We should get rid of NV_DEBUG, so we don't have both DEBUG and NV_DEBUG
+#if defined(NV_WINDOWS) && !defined(NV_WINDOWS_CE)
+#ifdef _DEBUG
+#ifndef NV_DEBUG
+#define NV_DEBUG 1
+#endif
+#endif
+#endif
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __GFOPTION_H__ */
+
diff --git a/Start_WM/test6/inc/GFRm.h b/Start_WM/test6/inc/GFRm.h
new file mode 100755
index 00000000..6669abcd
--- /dev/null
+++ b/Start_WM/test6/inc/GFRm.h
@@ -0,0 +1,2039 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/** @file GFRm.h
+ GFSDK Resource Manager API header file.
+*/
+
+#ifndef __GFRM_H__
+#define __GFRM_H__
+
+#include "GF.h"
+#include "GFRmError.h"
+
+/** @addtogroup groupRm RmAPI Resource Manager API
+
+ @ref pageRmAppNotes
+
+
+*/
+/*@{*/
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+#include "GFRmScr.h"
+
+/** Hardware Module IDs.
+ List of all the modules in the SCXX chips.
+*/
+typedef enum
+{
+#define GFRM_MODULE(x,y) MODID_##x,
+#include "gfrm_module_ids.h"
+#undef GFRM_MODULE
+ GFNUMOFMODULEIDS
+} eGFModuleIDs;
+
+/** @name Power Planes/Islands
+ List of all the power planes in the SCXX chips.
+@{*/
+
+/** Power Plane ID: Core Power Plane. */
+#define GFPPID_AOCVDD 0x00000001
+
+/** Power Plane ID: Video Codec Power Plane. */
+#define GFPPID_VECVDD 0x00000002
+
+/** Power Plane ID: SRAM Power Plane. */
+#define GFPPID_MMCVDD 0x00000004
+
+/** Power Plane ID: 3D Power Plane. */
+#define GFPPID_TDCVDD 0x00000008
+
+/** Power Plane ID: SRAM I/O Power Plane. */
+#define GFPPID_EMVDD 0x00000010
+
+/** Power Plane ID: Mostly Bus Interface Power Plane. */
+#define GFPPID_HVDD 0x00000020
+
+/** Power Plane ID: Video I/O Power Plane. */
+#define GFPPID_VVDD 0x00000040
+
+/** Power Plane ID: LCD I/O Power Plane. */
+#define GFPPID_LVDD 0x00000080
+
+/** Power Plane ID: Audio I/O Power Plane. */
+#define GFPPID_ACVDD 0x00000100
+
+/** Power Plane ID: SD I/O Power Plane. */
+#define GFPPID_SDVDD 0x00000200
+
+/** Power Plane ID: Oscillator Power Plane. */
+#define GFPPID_AVDDOSC 0x00000400
+
+/** Power Plane ID: PLL1 Power Plane. */
+#define GFPPID_AVDDP1 0x00000800
+
+/** Power Plane ID: PLL2 Power Plane. */
+#define GFPPID_AVDDP2 0x00001000
+
+/** Power Plane ID: DRAM Power Plane. */
+#define GFPPID_DRAM 0x00002000
+
+/** Number of power plane IDs. */
+#define GFNUMOFPPIDS 14
+
+/*@}*/
+
+/** @name States for Component Manager and general services
+@{*/
+
+/** State for registering Component.
+ @see GF_STATE_TYPE, GFRmComponentGet().
+*/
+#define GF_STATE_REGISTER 0x00000001
+
+/** State for unregistering Component.
+ @see GF_STATE_TYPE, GFRmComponentRelease().
+ */
+#define GF_STATE_UNREGISTER 0x00000002
+
+/** State for unregistering all Components (internal used only).
+ @see GF_STATE_TYPE, GFRmComponentRelease().
+ */
+#define GF_STATE_UNREGISTER_ALL 0x00000004
+
+/** General Enable State.
+ @see GF_STATE_TYPE.
+*/
+#define GF_STATE_ENABLE 0x00000008
+
+/** General Disable State.
+ @see GF_STATE_TYPE.
+*/
+#define GF_STATE_DISABLE 0x00000010
+
+/** General Done State.
+ @see GF_STATE_TYPE.
+*/
+#define GF_STATE_DONE 0x00000020
+
+/** State for instantiating a new or share Component.
+ @see GF_STATE_TYPE, GFRmComponentGet().
+ */
+#define GF_STATE_NEW_OR_SHARE 0x00000100
+
+/** State for instantiating a new Component only.
+ @see GF_STATE_TYPE, GFRmComponentGet().
+ */
+#define GF_STATE_NEW_ONLY 0x00000200
+
+/** State for instantiating a share Component only.
+ @see GF_STATE_TYPE, GFRmComponentGet().
+ */
+#define GF_STATE_SHARE_ONLY 0x00000400
+
+/** State indicating special Block Device Component (internal use).
+ @see GF_STATE_TYPE, GFRmComponentGet().
+ */
+#define GF_STATE_BLOCK_DEVICE 0x80000000
+
+/** Default Component instantiation State.
+ @see GF_STATE_TYPE, GFRmComponentGet().
+ */
+#define GF_STATE_DEFAULT GF_STATE_NEW_OR_SHARE
+
+/** Mask for the regular States.
+ @see GF_STATE_TYPE.
+*/
+#define GF_STATE_MASK 0x000000FF
+
+/*@}*/
+
+
+/** Attributes ID/Values.
+ @see GFRmGetAttribute(), GFRmSetAttribute().
+*/
+typedef enum
+{
+ /** Attribute for changing device bus addressing (direct/indirect) mode. */
+ GF_ATTRIB_DEVICE_ADDRESS,
+
+ /** Attribute for mapped/virtual/usable I/O base address. */
+ GF_ATTRIB_IO_MAP_BASE,
+
+ /** Attribute for mapped/virtual/usable embedded memory base. */
+ GF_ATTRIB_EMBEDDED_MEM_MAP_BASE,
+
+ /** Attribute for initial embedded internal memory size. */
+ GF_ATTRIB_INIT_EMBEDDED_MEM_TOTAL,
+
+ /** Attribute for initial available embedded internal memory size. */
+ GF_ATTRIB_INIT_EMBEDDED_MEM_AVAIL,
+
+ /** Attribute for initial embedded extended memory size. */
+ GF_ATTRIB_INIT_EXT_EMBEDDED_MEM_TOTAL,
+
+ /** Attribute for user specific object 0. */
+ GF_ATTRIB_USER_OBJECT_0,
+
+ /** Attribute for user specific object 1. */
+ GF_ATTRIB_USER_OBJECT_1,
+
+ /** Attribute for user specific object 2. */
+ GF_ATTRIB_USER_OBJECT_2,
+
+ /** Attribute for user specific object 3. */
+ GF_ATTRIB_USER_OBJECT_3,
+
+ /** Attribute for swapping memory allocation with shared embedded memory
+ MAX CHUNK scheme. For advanced user only. */
+ GF_ATTRIB_SWAP_SHARE_MEMORY_ALLOC_ON_MAX_CHUNK,
+
+ /** Get device information structure.
+ GFRmGetAttribute() parameter \a AttribData is of type PGFRMDEVICEINFO.
+ */
+ GF_ATTRIB_DEVICE_INFO_STRUCT,
+
+ /** For internal use only. */
+ GF_ATTRIB_RMC_FLAG,
+
+ /** Enable/Disable Hardware Resource Constraint. */
+ GF_ATTRIB_HW_RESOURCE_CONSTRAINT,
+
+ /** Enable embedded extended memory. */
+ GF_ATTRIB_ENABLE_EXTENDED_MEMORY,
+
+ /** Disable RMC trace, closing any log files that might be opened */
+ GF_ATTRIB_DISABLE_RMC_TRACE,
+
+ /** Set/Clr surface with absolute rotation option. */
+ GF_ATTRIB_SURFACE_ABSOLUTE_ROTATE,
+
+ /** Primary surface freeing policy. */
+ GF_ATTRIB_PRIMSURF_FREEING_POLICY,
+
+ /** Primary surface allocation policy. */
+ GF_ATTRIB_PRIMSURF_ALLOCATION_POLICY,
+
+ /** Internal use. */
+ GF_ATTRIB_EFUSE_PRODUCT_SKU_ID,
+
+ /** Internal use. */
+ GF_ATTRIB_MAIN_PANEL_INDEX,
+
+ /** GFRm attribute: Set DSP2Host communication mode.
+
+ This attribute can be used to control how components wait
+ for messages from the DSP. The following options for \a AttribData are available:
+ - #GF_ATTRIB_DSPCOMMODE_POLLING -- Register polling.
+ This mode is intended for debuging only, since it allows only one client
+ to use DSP2Host interrupts.
+ - #GF_ATTRIB_DSPCOMMODE_EVENT -- Receive DSP2Host messages via an interrupt framework.
+ This mode requires an ISR/IST to be setup, that handles DSP interrupts and calls
+ GFRmDispatchMessage().
+
+ The default setting is register polling.
+
+ Attribute can be get and set.
+
+ @see GFRmSetAttribute(), GFRmGetAttribute(), GFRmQueueSetHandler(), GFRmDispatchMessage()
+ */
+ GF_ATTRIB_DSPCOMMODE,
+
+ /** Set surface for DSP debug console output.
+
+ This sets a surface which will be used to output text from the DSP debug console.
+ The DSP XRM must be initialized before this function can be called.
+
+ GFRmSetAttribute() parameter \a AttribData is of type #PGFRMSURFACE and defines a pointer to a
+ surface descriptor.
+
+ @retval GF_SUCCESS Successfully send message
+ @retval GF_WAIT_TIME_OUT Timeout sending message
+ @retval GFRM_ERROR_BAD_PARAMETER Bad parameters, e.g. surface color format is not supported
+
+ @see GFRmSetAttribute()
+
+ Attribute can be set only.
+ */
+ GF_ATTRIB_DSPCONSOLE_SURFACE,
+
+ /** Internal use. */
+ GF_ATTRIB_USE_CAMERA_SCRIPT,
+
+ /** Internal use. */
+ GF_ATTRIB_DEVICE_TYPE,
+
+ /** Timeout in ms for RM IST to wait for interrupts.
+ Set to 0 to disable timeout, default setting is 1000 ms.
+ GFRmSetAttribute() parameter \a AttribData is of type NvU32 and defines timout in ms.
+ */
+ GF_ATTRIB_INTX_TIMEOUT,
+
+ /** Enable debug printout for GPU memory allocations.
+
+ GFRmSetAttribute() parameter \a AttribData is of type NvU32,
+ - 0 means disable log (default)
+ - !=0 means enable log
+
+ This GFRmSetAttribute() call always succeeds.
+
+ @see GFRmSetAttribute()
+
+ Attribute can be set only.
+ */
+ GF_ATTRIB_GPUMEM_ENABLELOG
+
+} GF_ATTRIBUTE_TYPE;
+
+/** DSP2Host communication modes, polling.
+ @see GF_ATTRIB_DSPCOMMODE
+*/
+#define GF_ATTRIB_DSPCOMMODE_POLLING 0
+/** DSP2Host communication modes, OS event synchronization.
+ @see GF_ATTRIB_DSPCOMMODE
+*/
+#define GF_ATTRIB_DSPCOMMODE_EVENT 1
+
+/** GFSDK (low-level) device interface type. (Read Only)
+ * @see GF_ATTRIB_DEVICE_TYPE.
+ **/
+#define GF_ATTRIB_DEVICE_TYPE_HARDWARE 0x00000000
+#define GF_ATTRIB_DEVICE_TYPE_SIMULATOR 0x00001000
+
+
+/** @name Component Types
+
+@{*/
+
+/** Component Type: EPP Component.
+ @anchor ComponentTypes
+*/
+#define GF_EPPAPI 0x00000001L
+
+/** Component Type: Gx (2D) API Component. */
+#define GF_GXAPI 0x00000002L
+
+/** Component Type: Vx (general Video and Video Input Port) API Component. */
+#define GF_VXAPI 0x00000003L
+
+/** Component Type: JxE (JPEG Encode) API Component. */
+#define GF_JXEAPI 0x00000004L
+
+/** Component Type: JxE (JPEG Decode) API Component. */
+#define GF_JXDAPI 0x00000005L
+
+/** Component Type: MxE (MPEG Encode) API Component. */
+#define GF_MXEAPI 0x00000006L
+
+/** Component Type: MxD (MPEG Decode) API Component. */
+#define GF_MXDAPI 0x00000007L
+
+// 0x8 is unused
+
+/** Component Type: Dx (Display and Flat Panel) API Component. */
+#define GF_DXAPI 0x00000009L
+
+// 0xA is unused
+
+/** Component Type: ISP (Image Signal Processing) API Component. */
+#define GF_ISPAPI 0x0000000BL
+
+/** Component Type: FDev (Pseudo File System/Device) API Component. */
+#define GF_FDEVAPI 0x0000000CL
+
+/** Component Type: BDevSD (SD Block Device) Component. */
+#define GF_BDEVSDAPI 0x0000000DL
+
+// 0xE is unused
+// 0xF is unused
+
+/** Component Type: OSx (Operating System) API COmponent */
+#define GF_OSXAPI 0x00000010L
+
+/** Component Type: I2C API Component */
+#define GF_I2CAPI 0x00000011L
+
+/** Component Type: I2S API COmponent */
+#define GF_I2SAPI 0x00000012L
+
+/** Component Type: MMProc (Audio) API COmponent */
+#define GF_MMPROCAPI 0x00000013L
+
+/** Component Type: CAM (Camera) API Component */
+#define GF_CAMAPI 0x00000014L
+
+/** Component Type: 3D API Component */
+#define GF_3DAPI 0x00000015L
+
+/** Component Type: INTx (Interrupt) API COmponent */
+#define GF_INTXAPI 0x00000016L
+
+/** Component Type: MXDH264 (H264 Decoder) API COmponent */
+#define GF_MXDH264API 0x00000017L
+
+/** Component Type: MXEH264 (H264 Encoder) API Component */
+#define GF_MXEH264API 0x00000018L
+
+/** Component Type: RM (Resource Manager) Services (listed only for return status). */
+#define GF_RMAPI 0x00000019L
+
+/** Component Type: GxFB (Gx/2D API with Frame Buffer rendering) API. Internal Use. */
+#define GF_GXFBAPI 0x0000001AL
+
+/** MXDRV9 (RV9 Decoder) API COmponent */
+#define GF_MXDRV9API 0x0000001BL
+
+/** Component Type: MXDVC1 (VC1 Decoder) API Component */
+#define GF_MXDVC1API 0x0000001CL
+
+/** Component Type: MXDEMTS (MPEG TS Demux) API Component */
+#define GF_MXDEMTSAPI 0x0000001DL
+
+/** Component Type: Minimal ISP API Component (NvIsp) */
+#define GF_MINIMALISPAPI 0x0000001EL
+
+/** Component Type: NvISP API Component ID -- only used for GF_TRACE */
+#define NV_ISPAPI 0x0000001FL
+
+/*@}*/
+
+/** NULL driver related. Internal use. */
+#define GF_USE_NULL_DRIVER 0x1
+
+/** NULL driver related. Internal use. */
+#define GF_USE_HW_DRIVER 0x2
+
+
+/** @name Hardware Resources
+ @anchor HardwareResources
+ Flags 'hwEngineReq' in GFRmHwResourceConstraint(). (not working yet).
+ @see GFRmHwResourceConstraint().
+@{*/
+
+/** Hardware resource flag: MPEG Decoder Engine. */
+#define GF_HWR_MPEGD 0x00000001
+
+/** Hardware resource flag: JPEG Decoder is same as MPEG Decoder Engine. */
+#define GF_HWR_JPEGD 0x00000001
+
+/** Hardware resource flag: MPEG Encoder Engine. */
+#define GF_HWR_MPEGE 0x00000002
+
+/** Hardware resource flag: JPEG Encoder shares FrontEnd and BackEnd with JPEG Enc Engine. */
+#define GF_HWR_JPEGE 0x00000002
+
+/** Hardware resource flag: Video Input Port. */
+#define GF_HWR_VIP 0x00000004
+
+/** Hardware resource flag: EPP */
+#define GF_HWR_EPP 0x00000008
+
+
+
+/** Options for GFRmHwResourceConstraint().
+ (not working yet!)
+ @see GFRmHwResourceConstraint().
+*/
+typedef enum
+{
+ /** check availability and allocate hardware resource. */
+ GF_HRC_ALLOCATE,
+
+ /** free hardware resource. */
+ GF_HRC_FREE,
+
+ /** check availability of hardware resource. */
+ GF_HRC_CHECK
+} GF_HRC_OPTIONS;
+
+/*@}*/
+
+/** Component ID structure. */
+typedef struct _GFRMCOMPONENTID
+{
+ NvU32 ComponentType; /**< Component Type, see @ref ComponentTypes. */
+ GFRmChHandle CxtHandle;
+} GFRMCOMPONENTID, *PGFRMCOMPONENTID;
+
+/* Component */
+
+/* forward declaration */
+typedef struct _GFRMCOMPONENT GFRMCOMPONENT, *PGFRMCOMPONENT;
+
+typedef GF_HANDLE (* GFOPENFUNCTIONTYPE)(GFRmHandle pRm, GFRmChHandle);
+typedef GF_RETTYPE (* GFCLOSEFUNCTIONTYPE)(GF_HANDLE *);
+
+/** Component Registration structure.
+ Internal use.
+ @internal
+*/
+struct _GFRMCOMPONENT
+{
+ GFRMCOMPONENTID id; /**< Structure defining component. */
+ GFOPENFUNCTIONTYPE Open; /**< Component Open callback. Called from GFRmComponentGet(). */
+ GFCLOSEFUNCTIONTYPE Close; /**< Component Close callback. Called from GFRmComponentRelease(). */
+};
+
+
+/** @name Surface Types
+ @anchor SurfaceTypes
+ @see GFRmSurfaceAlloc().
+@{*/
+
+/** Surface Type: Surface rotation orientation at 0 degree. */
+#define GF_SURFACE_ROTATE_0 0x00000000
+
+/** Surface Type: Surface rotation orientation at 90 degree (relative to _ROTATE_0). */
+#define GF_SURFACE_ROTATE_90 0x10000000
+
+/** Surface Type: Surface rotation orientation at 180 degree (relative to _ROTATE_0). */
+#define GF_SURFACE_ROTATE_180 0x20000000
+
+/** Surface Type: Surface rotation orientation at 270 degree (relative to _ROTATE_0). */
+#define GF_SURFACE_ROTATE_270 0x30000000
+
+/*
+ * GF_SURFACE_H_FLIP and GF_SURFACE_V_FLIP can be ORed with above 4 rotation
+ * options to create 16 combinations but in reality there are only 8 unique
+ * combinations.
+ */
+
+/** Surface Type: Horizontal Flip. You can or'ed this flag with _ROTATE_ flag above too. */
+#define GF_SURFACE_H_FLIP 0x40000000
+
+/** Surface Type: Vertical Flip. You can or'ed this flag with _ROTATE_ flag above too. */
+#define GF_SURFACE_V_FLIP 0x80000000
+
+/** Surface Type: internal use. */
+#define GF_SURFACE_ROTATE_MASK 0xF0000000
+
+/** Surface Type: internal use. */
+#define GF_SURFACE_PLANAR_ROTATE_MASK 0x30000000
+
+/** Surface Type: internal use. */
+#define GF_SURFACE_ROTATE_SHIFT 28 // bits[31:28]
+
+/** Surface Type: internal use. */
+#define GF_SURFACE_ROTATE_WRAP 8
+
+/** Surface Type: Primary Surface (default rotate orientation). */
+#define GF_SURFACE_PRIMARY 0x00000001 //primary surface
+
+/** Surface Type: Primary Surface with 0 degree rotation. */
+#define GF_SURFACE_PRIMARY_0 (GF_SURFACE_PRIMARY| GF_SURFACE_ROTATE_0)
+
+/** Surface Type: Primary Surface with 90 degree rotation. */
+#define GF_SURFACE_PRIMARY_90 (GF_SURFACE_PRIMARY| GF_SURFACE_ROTATE_90)
+
+/** Surface Type: Primary Surface with 180 degree rotation. */
+#define GF_SURFACE_PRIMARY_180 (GF_SURFACE_PRIMARY| GF_SURFACE_ROTATE_180)
+
+/** Surface Type: Primary Surface with 180 degree rotation. */
+#define GF_SURFACE_PRIMARY_270 (GF_SURFACE_PRIMARY| GF_SURFACE_ROTATE_270)
+
+/** Surface Type: Overlay Surface. */
+#define GF_SURFACE_OVERLAY 0x00000002
+
+/** Surface Type: Surface to reside in embedded (video) memory. */
+#define GF_SURFACE_VIDEO_MEMORY 0x00000004
+
+/** Surface Type: Surface to reside in system memory. */
+#define GF_SURFACE_SYSTEM_MEMORY 0x00000008
+
+/** Surface Type: Sub primary surface (for Sub LCD). */
+#define GF_SURFACE_PRIMARY_SUB 0x00000100 //Sub primary surface
+
+/** Surface Type: Surface to be allocated from "share" embedded memory for
+ advanced use only.
+ Cannot be used with #GF_SURFACE_PRIMARY.
+ No effect with #GF_SURFACE_SYSTEM_MEMORY.
+*/
+#define GF_SURFACE_SHARE 0x00001000
+
+/** Surface Type: Allocate surface with pre-allocated memory handle. */
+#define GF_SURFACE_PREALLOCATED_MEM 0x00002000
+
+/** Request to use new API */
+#define GF_SURFACE_NEW_API 0x01000000
+
+/*
+ * Note: GF_SURFACE_ROTATE_ refers to caller's view of current logical
+ * orientation relative to Primary Surface. And Primary surface is
+ * always set to GF_SURFACE_ROTATE_0 even though physical LCD Display
+ * panel may require different physical orientation.
+ */
+
+/*@}*/
+
+/** @name Surface Hints
+ @anchor SurfaceHints
+ @see GFRmSurfaceAlloc().
+@{*/
+
+/** Surface Hint: Alloc from highest possible position. */
+#define GF_SURFACE_HINT_TOP_DOWN 0x1
+
+/** Surface Hint: Alloc from lowest possible position. */
+#define GF_SURFACE_HINT_BOTTOM_UP 0x2
+
+/** Surface Hint: Alloc max chunck of memory. */
+#define GF_SURFACE_HINT_MAX_CHUNK 0x4
+
+/** Surface Hint: Try allocations from external memory first before internal memory */
+#define GF_SURFACE_HINT_EXT_MEMORY_PREFERRED 0x8
+
+/** Surface Hint: Try allocations only from external memory. */
+#define GF_SURFACE_HINT_EXT_MEMORY_ONLY 0x10
+
+/** Surface Hint: Try allocations only from internal memory. */
+#define GF_SURFACE_HINT_INT_MEMORY_ONLY 0x20
+
+/** Surface Hint: Alloc from embedded memory, YUV in the same contiguous memory.
+ Valid only for GF_SURFACE_YUV420.
+*/
+#define GF_SURFACE_HINT_CONTIGUOUS_MEMORY 0x40
+
+/** Surface Hint: Try allocations from internal memory first before external memory */
+#define GF_SURFACE_HINT_INT_MEMORY_PREFERRED 0x80
+
+/** Surface Hint: Hints to align stride to 4 bytes - default for YUV422 */
+#define GF_SURFACE_HINT_STRIDE_ALIGN4 0x100
+
+/** Surface Hint: Hints to align stride to 8 bytes */
+#define GF_SURFACE_HINT_STRIDE_ALIGN8 0x200
+
+/** Surface Hint: Hints to align stride to 16 bytes */
+#define GF_SURFACE_HINT_STRIDE_ALIGN16 0x400
+
+/** Surface Hint: Hints to align stride to 32 bytes */
+#define GF_SURFACE_HINT_STRIDE_ALIGN32 0x800
+
+/** Surface Hint: Surface will be used for direct read by the applications */
+#define GF_SURFACE_NEED_DIRECT_CPU_READ 0x1000
+
+/** Surface Hint: Surface will be used for direct write by the applications */
+#define GF_SURFACE_NEED_DIRECT_CPU_WRITE 0x2000
+
+/** Surface Hint: Surface will be used for direct access by the applications
+ both read and write actions are allowed
+ */
+#define GF_SURFACE_NEED_DIRECT_CPU_ACCESS \
+ (GF_SURFACE_NEED_DIRECT_CPU_READ | GF_SURFACE_NEED_DIRECT_CPU_WRITE)
+/*@}*/
+
+/** @name Primary surface allocation and freeing policies
+ @see GFRmSetAttribute().
+@{*/
+
+/** Any avaliable memory. Use with GF_ATTRIB_PRIMSURF_ALLOCATION_POLICY. */
+#define GF_ATTRIB_PRIMSURF_ALLOCP_NONE 0x0
+
+/** Allocate Primary surface from embedded extended memory.
+ Use with GF_ATTRIB_PRIMSURF_ALLOCATION_POLICY.
+*/
+#define GF_ATTRIB_PRIMSURF_ALLOCP_USE_EXT_MEM 0x1
+
+/** Allocate Primary surface from internal memory (SRAM).
+ Use with GF_ATTRIB_PRIMSURF_ALLOCATION_POLICY.
+*/
+#define GF_ATTRIB_PRIMSURF_ALLOCP_USE_INT_MEM 0x2
+
+/** Use with GF_ATTRIB_PRIMSURF_FREEING_POLICY. */
+#define GF_ATTRIB_PRIMSURF_FREEP_NONE 0x0
+
+/** Never free, Default policy. Use with GF_ATTRIB_PRIMSURF_FREEING_POLICY. */
+#define GF_ATTRIB_PRIMSURF_FREEP_NEVER_FREE 0x0
+
+/** Free when the ref count is zero. Use with GF_ATTRIB_PRIMSURF_FREEING_POLICY. */
+#define GF_ATTRIB_PRIMSURF_FREEP_FREE_ON_EMPTY 0x1
+
+/** Force free. Use with GF_ATTRIB_PRIMSURF_FREEING_POLICY. */
+#define GF_ATTRIB_PRIMSURF_FREEP_FORCE_FREE 0x2
+
+/*@}*/
+
+/** Surface structure.
+ @see GFRmSurfaceAlloc(), GFRmSurfaceFree().
+*/
+typedef struct _GFRMSURFACE
+{
+ NvU32 width; /**< Width in pixels. */
+ NvU32 height; /**< Height in lines. */
+ NvU32 SurfaceType; /**< Surface type, see @ref SurfaceTypes. */
+ NvU32 ColorFormat; /**< Surface color format, see @ref SurfaceTypes. */
+
+ NvU32 YStride; /**< Stride for RGB, YUV422 surfaces, or Y plane. */
+ NvU32 UStride; /**< U plane stride */
+ NvU32 VStride; /**< V plane stride */
+
+ GFRmMemHandle YMemHandle; /**< Opaque handle for RGB, YUV422 surface, or Y plane memory. */
+ GFRmMemHandle VMemHandle; /**< Opaque handle for V plane memory. */
+ GFRmMemHandle UMemHandle; /**< Opaque handle for U plane memory. */
+
+ NvU32 YOffset; /**< Physical address of RGB, YUV422 surfae, or Y plane. */
+ NvU32 UOffset; /**< Physical address of U plane. */
+ NvU32 VOffset; /**< Physical address of U plane. */
+
+ /* Direct addressable pointer to the memory region. Don't
+ use these pointers, unless you want to run only in
+ "direct addressing mode". Instead, use handles for reading
+ or writing to the memory from the host, and offsets for
+ programming the hardware registers. */
+
+ NvU8 *pY; /**< Pointer to non-planar surface or Y plane of YUV420, valid only for direct addressing. */
+ NvU8 *pU; /**< for YUV420 surface, valid only for direct addressing. */
+ NvU8 *pV; /**< for YUV420 surface, valid only for direct addressing. */
+
+ NvU32 memUsed; /**< Total number of bytes used by surfaces. */
+
+ //void *reserved; // Reserved. Do not modify
+} GFRMSURFACE, *PGFRMSURFACE;
+
+/** Surface Request
+ @see GFRmSurfaceAlloc(), GFRmSurfaceFree().
+*/
+typedef struct _GFRMSURFACEREQUEST
+{
+ NvU32 width; /**< Width in pixels. */
+ NvU32 height; /**< Height in lines. */
+ NvU32 SurfaceType;/**< Surface type, see @ref SurfaceTypes. */
+ NvU32 ColorFormat;/**< Surface color format, see @ref SurfaceTypes. */
+ NvU32 hint; /**< Allocation hint or 0, see @ref SurfaceHints. */
+ NvU8 *pMem; /**< Pointer to pre-allocated memory from which
+ to allocate the surface planes. */
+ NvU32 memSize; /**< Size of pre-allocated Y plane memory. */
+ NvU32 id; /**< User defined ID to track allocated block, debugging use */
+
+ /* Reserved for future */
+ /* GF_RETTYPE (* pSurfaceCallBack)
+ ( GFRmHandle RmHandle, PGFRMSURFACE pSurface); */
+ /* Reserved for future */
+ /* PGFRMSURFACE pSurfaceShare; */
+} GFRMSURFACEREQUEST, *PGFRMSURFACEREQUEST;
+
+/** Device Info */
+typedef struct _GFRMDEVICEINFO
+{
+ NvU32 MinorRev;
+ NvU32 MajorRev;
+ NvU32 ChipID;
+ NvU32 Family;
+} GFRMDEVICEINFO, *PGFRMDEVICEINFO;
+
+/** @name Surface Update Flags
+ @anchor SurfaceUpdateFlags
+ @see GFRmSurfaceUpdate()
+@{*/
+
+/** GFRmSurfaceUpdate() attribute type: Update surface rotation.
+
+ The following values are valid for parameter \a data of GFRmSurfaceUpdate():
+
+ #GF_SURFACE_ROTATE_0
+ #GF_SURFACE_ROTATE_90
+ #GF_SURFACE_ROTATE_180
+ #GF_SURFACE_ROTATE_270
+
+
+ @see GFRmSurfaceUpdate()
+*/
+#define GF_SURFACE_UPDATE_ROTATE 0x00000001
+
+/** GFRmSurfaceUpdate() attribute type: Update surface width.
+
+ Meaning of parameter \a data of GFRmSurfaceUpdate():
+ New surface width in pixels.
+
+ The number of bytes required for the new width must not exceed the
+ surface stride. It is the responsibility of the caller to ensure this.
+
+ @see GFRmSurfaceUpdate()
+*/
+#define GF_SURFACE_UPDATE_WIDTH 0x00000002
+
+/** GFRmSurfaceUpdate() attribute type: Update surface height.
+
+ Meaning of parameter \a data of GFRmSurfaceUpdate():
+ New surface height in line.
+
+ The set height * surface stride must not exceed the memory allocated
+ for the surface. It is the responsibility of the caller to ensure this.
+
+ @see GFRmSurfaceUpdate()
+*/
+#define GF_SURFACE_UPDATE_HEIGHT 0x00000003
+
+/** GFRmSurfaceUpdate() attribute type: Update surface width and stride.
+
+ Meaning of parameter \a data of GFRmSurfaceUpdate():
+ New surface width in pixels.
+
+ YStride, UStride, and VStride will be updated automatically according
+ to alignment requirements. Supported colour formats:
+ - GF_SURFACE_YUV420
+
+ @see GFRmSurfaceUpdate()
+*/
+#define GF_SURFACE_UPDATE_WIDTH_STRIDE 0x00000004
+
+/*@}*/
+
+
+/** @name Memory types
+ @anchor MemoryTypes
+ @see GFRMMEMORYREQUEST, GFRmMemHandleAlloc()
+@{*/
+
+/** Memory Type: Host system memory. */
+#define GF_MEMORY_SYSTEM 0x01
+/** Memory Type: Any GPU memory */
+#define GF_MEMORY_EMBEDDED 0x02
+/** Memory Type: Memory mapped memory. */
+#define GF_MEMORY_MEMMAPPED 0x04
+/** Memory Type: External GPU memory only. */
+#define GF_MEMORY_EMBEDDED_EXT_ONLY GF_MEMORY_EMBEDDED_EXT
+#define GF_MEMORY_EMBEDDED_EXT 0x08
+/** Memory Type: Internal GPU memory only. */
+#define GF_MEMORY_EMBEDDED_INT_ONLY GF_MEMORY_EMBEDDED_INT
+#define GF_MEMORY_EMBEDDED_INT 0x10
+/** Memory type: Internal or external memory with preference to internal memory. */
+#define GF_MEMORY_EMBEDDED_INT_PREFERRED 0x20
+/** Memory type: External or internal memory with preference to external memory. */
+#define GF_MEMORY_EMBEDDED_EXT_PREFERRED 0x40
+/** Memory type: Direct Read access */
+#define GF_MEMORY_DIRECT_CPU_READ_ACCESS 0x80
+/** Memory type: Direct Write access */
+#define GF_MEMORY_DIRECT_CPU_WRITE_ACCESS 0x100
+
+/** Memory type: Direct Read/Write access */
+#define GF_MEMORY_DIRECT_CPU_ACCESS (GF_MEMORY_DIRECT_CPU_WRITE_ACCESS | GF_MEMORY_DIRECT_CPU_READ_ACCESS)
+
+/*@}*/
+
+/** @name Memory Share Types
+ @anchor MemoryShare
+ @see GFRMMEMORYREQUEST, GFRmMemHandleAlloc()
+@{*/
+
+/** Memory Share Flag: Internal use, used in GFRmMemInfo only. */
+#define GF_MEMORY_SHARE 0x80
+
+/*@}*/
+
+/** @name Memory Alignment
+ @anchor MemoryAlignment
+ @see GFRMMEMORYREQUEST, GFRmMemHandleAlloc()
+@{*/
+
+/** Memory alignment types, must match log2 of alignment size. */
+enum
+{
+ GF_MEMORY_ALIGN_NONE = 0, /**< Memory Alignment: Don't care. */
+ GF_MEMORY_ALIGN2, /**< Memory Alignment: Aligned to 2 byte boundary. */
+ GF_MEMORY_ALIGN4, /**< Memory Alignment: Aligned to 4 byte boundary. */
+ GF_MEMORY_ALIGN8, /**< Memory Alignment: Aligned to 8 byte boundary. */
+ GF_MEMORY_ALIGN16, /**< Memory Alignment: Aligned to 16 byte boundary. */
+ GF_MEMORY_ALIGN32, /**< Memory Alignment: Aligned to 32 byte boundary. */
+ GF_MEMORY_ALIGN64, /**< Memory Alignment: Aligned to 64 byte boundary. */
+ GF_MEMORY_ALIGN128, /**< Memory Alignment: Aligned to 128 byte boundary. */
+ GF_MEMORY_ALIGN256, /**< Memory Alignment: Aligned to 256 byte boundary. */
+ GF_MEMORY_ALIGN512, /**< Memory Alignment: Aligned to 512 byte boundary. */
+ GF_MEMORY_ALIGN1024, /**< Memory Alignment: Aligned to 1024 byte boundary. */
+ GF_MEMORY_ALIGN2048, /**< Memory Alignment: Aligned to 2048 byte boundary. */
+ GF_MEMORY_ALIGN4096, /**< Memory Alignment: Aligned to 4096 byte boundary. */
+ GF_MEMORY_ALIGN_DSP = 0xFF /**< Memory Alignment: Aligned properly for DSP cacheline size. */
+};
+
+/*@}*/
+
+/** @name Memory Allocation Hints
+ @anchor MemoryHints
+ @see GFRMMEMORYREQUEST, GFRmMemHandleAlloc()
+@{*/
+/* Memory Hint - Follow Surface Hint */
+/** Memory Allocation Hint: Allocate from high to low addresses. */
+#define GF_MEMORY_HINT_TOP_DOWN GF_SURFACE_HINT_TOP_DOWN
+/** Memory Allocation Hint: Allocate from low to high addresses. */
+#define GF_MEMORY_HINT_BOTTOM_UP GF_SURFACE_HINT_BOTTOM_UP
+/** Memory Allocation Hint: Allocate from maximum available chunk. */
+#define GF_MEMORY_HINT_MAX_CHUNK GF_SURFACE_HINT_MAX_CHUNK
+/** Memory Allocation Hint: Allocate at fixed address. */
+#define GF_MEMORY_HINT_FIXED (GF_MEMORY_HINT_MAX_CHUNK << 1)
+/** Memory Allocation Hint: Allocate for 3D. */
+#define GF_MEMORY_HINT_3D (GF_MEMORY_HINT_MAX_CHUNK << 2)
+
+/* These options are for DRAM as extended memory. This option specifies
+ * bank the buffer should come from. This will avoid
+ * bank clobbering between two buffers that are accessed in lock
+ * step.
+ */
+
+/** Memory Allocation Hint: Allocate from even banks in external memory. */
+#define GF_MEMORY_HINT_EVEN_BANK (GF_MEMORY_HINT_MAX_CHUNK << 3)
+/** Memory Allocation Hint: Allocate from odd banks in external memory. */
+#define GF_MEMORY_HINT_ODD_BANK (GF_MEMORY_HINT_MAX_CHUNK << 4)
+/*@}*/
+
+/** Memory allocation request.
+ @see GFRmMemHandleAlloc()
+*/
+typedef struct _GFRMMEMORYREQUEST
+{
+ NvU32 length; /**< Size in bytes. */
+ NvU32 hint; /**< Allocation hint or 0, see @ref MemoryHints. */
+ struct
+ {
+ NvU16 type; /**< Memory type, see @ref MemoryTypes. */
+ NvU8 share; /**< Share flags or 0, see @ref MemoryShare. */
+ NvU8 align; /**< Alignment flags, see @ref MemoryAlignment. */
+ }
+ flag;
+ NvU32 id; /**< User defined ID to track allocated block, debugging use */
+} GFRMMEMORYREQUEST, *PGFRMMEMORYREQUEST;
+
+/** OS Critical Section bits 0-15 are general purpose use
+bit 16-31 are for internal use */
+#define GF_CRITICAL_SECTION_HW 0x00000001
+/** RM internal use */
+#define GF_CRITICAL_SECTION_SW2 0x00000004
+/** RM internal use */
+#define GF_CRITICAL_SECTION_SW4 0x00000010
+/** I2C critical section */
+#define GF_CRITICAL_SECTION_I2C 0x00000020
+/** RM All channel lock, internal use */
+#define GF_CRITICAL_SECTION_ALL_CHANNELS 0x00000040
+
+/** Ix internal use */
+#define GF_CRITICAL_SECTION_SW8 0x00000100
+
+/** RM DSP to Host communication, internal use */
+#define GF_CRITICAL_SECTION_D2H 0x00000200
+
+/** The SHUTDOWN_DSP lock protects the race between
+ * UpdateDSPFreq/DSPDisable and HandleInterrupt (IST).
+ * (Update and DSPDisable turn off the DSP, HandleInt reads
+ * DSP regs)
+ */
+#define GF_CRITICAL_SECTION_SHUTDOWN_DSP 0x00000400
+/** The DSP lock protects the race between
+ * AddTask and RemoveTask.
+ */
+#define GF_CRITICAL_SECTION_DSP 0x00000401
+
+/** Define the ID for the kernel semaphore */
+#define GF_DSP_KERNEL_SEM_ID 0x0CAFEFAD
+
+/** Shared memory lock - used for internal purposes */
+#define GF_CRITICAL_SECTION_SHM 0x00000800
+
+/** RM Host to DSP communication, internal use */
+#define GF_CRITICAL_SECTION_H2D 0x00001000
+
+/** Rm internal use: lock for channel structures */
+#define GF_CRITICAL_SECTION_CHSTRUCT 0x00004000
+
+/** Dx internal use */
+#define GF_CRITICAL_SECTION_DX 0x00008000
+
+/** Vx internal use */
+#define GF_CRITICAL_SECTION_VX 0x00000080
+
+#ifdef PROJECT_SEC_G1
+/** JxDec internal use */
+#define GF_CRITICAL_SECTION_JXDEC 0x00002000
+#endif
+
+/** Rm internal use: lock for DSP messages */
+#define GF_CRITICAL_SECTION_DSPMSG_MIN 0x00010000
+#define GF_CRITICAL_SECTION_DSPMSG_MAX 0x20000000
+
+/** Audio Shared Memory lock - used for multiprocess OS */
+#define GF_CRITICAL_SECTION_SWAUDIO 0x10002000
+
+/** Maximiun id */
+#define GF_CRITICAL_SECTION_SWMAX 0x00010000
+
+/** OS IRQ Callback */
+typedef void (* GFRMOSIRQCALLBACK)( void *pData );
+
+struct _GFRMCOMMONSTRUCT;
+struct _GFRMENVIRONMENTVARIABLES;
+struct _GFRMEXTDATASTRUCT;
+
+/** Definition of Ix powerplane operations
+ */
+typedef enum _GFIX_POWERPLANE_OP_TYPE
+ {
+ GFIX_POWERPLANE_OP_ENABLE = 0,
+ GFIX_POWERPLANE_OP_DISABLE,
+ GFIX_POWERPLANE_OP_QUERY
+} GFIX_POWERPLANE_OP_TYPE;
+
+/** Configuration structure that may be passed to GFRmOpen().
+ See GFRmOpen() for details.
+*/
+typedef struct _GFRMOPENSTRUCT
+{
+ NvU32 isFirstProcess;
+ NvU32 isDeviceMapped;
+ GF_RETTYPE retStatus; //!< Return error reason code, in case GFRmOpen() fails
+
+ /** Declare which driver HW or NULL driver to use.
+ This is for GFSDK compiled for NULL driver case.
+ */
+ NvU32 useDriver;
+} GFRMOPENSTRUCT;
+
+/** @name Interface Manager Returned Functions
+@{*/
+
+/** Write a 32-bit register in the device.
+
+ @param base I/O base address
+ @param offset Offset of register
+ @param data Data to write
+ */
+typedef void (*GF_FUNC_WRITE_32BIT)(void * base, NvU32 offset, NvU32 data);
+
+/** Read a 32-bit register in the device.
+
+ @param base I/O base address
+ @param offset Offset of register
+
+ @retval #NvU32 register value
+ */
+typedef NvU32 (*GF_FUNC_READ_32BIT)(void * base, NvU32 offset);
+
+/*@}*/
+
+/** Interface Options for Read/Write Embedded FIFO (for Jx/Mx APIs) */
+#define GF_EMBFIFO_SWAP_BYTE 0x00000001
+#define GF_EMBFIFO_SWAP_WORD 0x00000002
+
+/** Interface FIFO flags */
+/** Front-End FIFO */
+#define GF_FIFO_FEND 0x00000001
+/** GE (2D/Primary) FIFO */
+#define GF_FIFO_SRC 0x00000002
+
+/** Interface Helper macro to generate Address Pointer */
+#define GFMAKEADDR(base, offset) (void *)base, offset
+
+/** Utility Debug Flag */
+#define GF_DEBUG_DEFAULT 0
+
+/** 4th argument for GFRmOSGetTickCount */
+#define GF_USEC_TICKS 0
+#define GF_MSEC_TICKS 1
+#define GF_SEC_TICKS 2
+
+/** Flags for the Context manager GF_CTX_DEFAULT, GF_CTX_NEW */
+#define GF_CTX_DEFAULT 1
+#define GF_CTX_NEW 2
+#define GF_CTX_SHARED 3
+
+/*
+ ########################################################################
+ * Function Prototypes for GFSDK Resource Manager (RM) Services
+ ########################################################################
+ */
+
+/* Object Manager */
+
+/** GFRmOpen - Starts Resource Manager and GFSDK.
+
+ @param RmOpenHandle Must be NULL.
+ @return Resource manager handle, or NULL on failure.
+
+ This must be called prior using any GFSDK component APIs and RM services.
+ This function can be called multiple times, for each successfull call
+ the application must also call GFRmClose().
+
+ If this function fails, and a pointer to an open structure is passed in
+ \a RmOpenHandle, the a failure reasoncode will be returned in GF_OPEN_RETTYPE::retStatus.
+*/
+GFRmHandle GFRmOpen(GFRMOPENSTRUCT *RmOpenHandle);
+
+/** GFRmClose - Ends Resource Manager and GFSDK.
+
+ @param pRmHandle Ptr to RmHandle to be closed.
+ @retval GF_RETTYPE #GF_SUCCESS if successful.
+ #GF_ERROR on error.
+
+ All GFSDK resources will be freed related to this process.
+ Calls to GFRmOpen are reference counted, GFDSK will be closed only for
+ the last call to this function.
+ */
+void GFRmClose(GFRmHandle *pRmHandle);
+
+/** GFRmCleanUp - Frees resources allocated to a terminated Resource Manager session.
+
+ @param RmProcessID RM Process ID to clean up after.
+ @retval GF_RETTYPE #GF_SUCCESS if successful.
+ #GF_ERROR on error.
+
+ All GFSDK resources will be freed related to this
+ process.
+ */
+GF_RETTYPE
+GFRmCleanUp( GFRmHandle RmHandle, NvU32 RmProcessID );
+
+// FIXME: ripped off from the API doc. GFRmRecover is not implemented as of
+// yet - there's null implementation in GFRmObj.c.
+/** GFRmRecover - Handles ESD failures.
+
+ @param RmHandle The handle to the Resource Manager.
+ @param option
+ @retval GF_RETTYPE #GF_SUCCESS if successful.
+ #GF_ERROR on error.
+
+ This function is used to recover from an ESD (electrostatic discharge)
+ failure. If the system software finds that the GoForce processor is not
+ responding, the software uses the CPU GPIO to reset the GoForce processor
+ and then calls this function. GFRmRecover() only calls Recover()
+ functions of registered components. For example, the GFDxAPI and GFGxAPI
+ have registered Recover() functions that can bring the GoForce processor
+ back from the reset to normal working mode.
+ */
+GF_RETTYPE
+GFRmRecover( GFRmHandle RmHandle, NvU32 option );
+
+/** GFRmGetProperty - Returns properties of RM.
+
+ @param pRmProp Caller passes ptr to GFPROPERTY that will be filled
+ upon return.
+
+ @retval #GF_SUCCESS if successful.
+ */
+GF_RETTYPE
+GFRmGetProperty( GFRmHandle RmHandle,
+ GFPROPERTY *pRmProp );
+
+/** GFRmSetAttribute - Sets RM attribute.
+
+ @param AttribType Attribute to get of type #GF_ATTRIBUTE_TYPE.
+ @param AttribData Data specific to AttribType.
+
+ @retval #GF_SUCCESS if successful.
+ */
+GF_RETTYPE
+GFRmSetAttribute(GFRmHandle RmHandle,
+ GF_ATTRIBUTE_TYPE AttribType,
+ NvU32 AttribData);
+
+/** GFRmGetAttribute - Gets RM attribute.
+
+ @param AttribType Attribute to get of type #GF_ATTRIBUTE_TYPE.
+ @param AttribData Data specific to AttribType.
+ See GF_ATTRIBUTE_TYPE for interpretation.
+ May pass input and/or output parameters.
+
+ @retval #GF_SUCCESS if successful.
+ */
+GF_RETTYPE
+GFRmGetAttribute(GFRmHandle RmHandle,
+ GF_ATTRIBUTE_TYPE AttribType,
+ NvU32 *pAttribData);
+
+/** Claim or release a hardware resource.
+
+ The GoForce GPU has a few hardware engines which are used by
+ different component API. If a component API is using that hardware
+ engine, then other API component should not be allowed to use that
+ engine. For example we have MPEG Decoder engine in the hardware which
+ is used by GFMxDecAPI and GFJxDecAPI components. If one of the API is
+ using MPEGD Engine and app/system software tries to use other engines,
+ it should not be allowed.
+ For SC4/SC5/SC10/SC12 GPU, we have following constraints:
+ GFMxDecAPI MPEGD, optional Auto Trigger SB
+ GFJxDecAPI MPEGD, optional Auto Trigger SB
+ Both of these component API share same engine so we should only allow
+ one component to be opened at a time.
+
+ GFMxEncAPI MPEGE, EPP (planar converter)
+ GFJxEncAPI JPEGE, EPP (planar converter)
+ Both of these component API share same fron-end planar converter so we
+ should only allow one component to be opened.
+
+ StetchBlt is represented by VxBlt(). SB has one context where auto
+ trigger SB can be set. Manual SB command uses same context for manual
+ command and then restores the auto context.
+ There is no need to check for manual VxBlt().
+ Autotrigger need checking but it is difficult to check in the VxBlt()
+ function.
+
+ This function only deals with Component level constraints.
+ Constraint checking can be enabled if GF_ATTRIB_HW_RESOURCE_CONSTRAINT.
+
+ @param RmHandle Handle to the resource manager.
+ @param options Action code
+ @param hwEngineReq Flag bitmask specifying 0 or more HW engines, see @ref HardwareResources
+
+ @retval GF_SUCCESS Hardware resource is available.
+ @retval GFRM_ERROR_HWRESOURCE_NOT_AVAILABLE Hardware resource is not available.
+ @retval GFRM_ERROR_BAD_PARAMETER Bad parameters passed
+*/
+GF_RETTYPE
+GFRmHwResourceConstraint( GFRmHandle RmHandle,
+ GF_HRC_OPTIONS options,
+ NvU32 hwEngineReq );
+
+/* Context Manager */
+
+/** GFRmContextGet - Retrieves either a default or new context.
+
+ @param RmHandle Handle to the resource manager.
+ @param flags #GF_CTX_DEFAULT or #GF_CTX_NEW
+ @param pContext Pointer to the retreived context.
+
+ @retval #GF_SUCCESS on success.
+ @retval #GF_ERROR on error.
+ */
+GF_RETTYPE
+GFRmContextGet( GFRmHandle RmHandle,
+ NvU32 flags,
+ GFRmChHandle *pContext);
+
+/** GFRmChFree - Free a channel (same thing as a context).
+
+ @param hRm Resource manager handle.
+ @param phCh Pointer to the channel handle.
+
+ @see GFRmContextGet
+ */
+void GFRmChFree(GFRmHandle hRm, GFRmChHandle *phCh);
+
+
+/* Component Manager */
+
+/** GFRmComponentRegister - Register Component with Resource Manager
+
+ @param pComponent Ptr to component to be registerd.
+ @param RegisterState Parameter of type GF_STATE_TYPE.
+ Usually, GF_STATE_REGISTER is passed.
+
+ @retval #GF_SUCCESS on success.
+ @retval #GF_ERROR on error.
+
+ */
+GF_RETTYPE
+GFRmComponentRegister( GFRmHandle RmHandle,
+ GFRMCOMPONENT *pComponent,
+ GF_STATE_TYPE RegisterState );
+
+/** GFRmComponentGet - Gets a registered component, associated with the passed
+ context.
+
+ @param ComponentType Desired component type.
+ @param state Parameter of type #GF_STATE_TYPE.
+ @param pComponent Ptr to Handle to component available.
+ NULL if not available.
+ @param hCh Context Handle. Can be allocated by a call to
+ #GFRmContextGet function.
+
+ @retval #GF_SUCCESS on success.
+ @retval #GF_ERROR on error.
+
+ Depending on the requested state, a newly instantiated component or
+ a shared component is returned. GF_STATE_DEFAULT is the default option
+ for the state parameter. If the hCh passed is NULL, then a default
+ context is associalted with the component.
+
+ */
+GF_RETTYPE
+GFRmComponentGet(GFRmHandle hRm,
+ NvU32 ComponentType,
+ GF_HANDLE *pComponent,
+ GF_STATE_TYPE state,
+ GFRmChHandle hCh);
+
+/** GFRmComponentRelease - Releases the specified component handle.
+
+ @param hRm Handle to the resource manager.
+ @param phComponent Pointer to component handle to be released.
+
+ The handle pointed to by phComponent will be cleared to NULL as a side
+ effect of calling this function. Also, this function has no effect if
+ the handle pointed to by phComponent is already NULL, so it is not
+ necessary to check whether a component handle is NULL before releasing it.
+ */
+void GFRmComponentRelease(GFRmHandle hRm, GF_HANDLE *phComponent);
+
+/* Surface Manager */
+
+/** GFRmSurfaceAlloc - Allocate a Surface without synchronization.
+
+ @param pSurfaceReq Pointer to surface request structure #GFRMSURFACEREQUEST.
+ @param ppSurface Pointer to surface pointer.
+
+ @retval #GF_SUCCESS on success.
+ @retval #GF_ERROR on error.
+ @retval #GF_OUT_OF_MEMORY when low on memory.
+ */
+GF_RETTYPE
+GFRmSurfaceAlloc( GFRmHandle RmHandle,
+ GFRMSURFACEREQUEST *pSurfaceReq,
+ PGFRMSURFACE *ppSurface );
+
+/** GFRmSurfaceFree - Frees an allocated surface.
+
+ @param ppSurface Pointer to surface pointer.
+
+ *ppSurface is cleared to NULL.
+ */
+void
+GFRmSurfaceFree(GFRmHandle hRm,
+ PGFRMSURFACE *ppSurface);
+
+/** GFRmSurfaceQueryPrimaryInfo - Make a query on Primary Surface.
+
+ @param ppSurface Pointer to Primary surface pointer.
+ @param pRotate Ptr to current Rotation orientation.
+ @retval GF_RETTYPE #GF_SUCCESS on success.
+ #GF_ERROR on error.
+
+ Returned surface pointer is for quick reference only and is a
+ pointer to transient structure. In other words, this will not
+ increment the reference count as GFRmSurfaceAlloc does.
+ */
+GF_RETTYPE
+GFRmSurfaceQueryPrimaryInfo( GFRmHandle RmHandle,
+ PGFRMSURFACE *ppSurface,
+ NvU32 *pRotate,
+ NvU32 subSurfaceType );
+
+/** Update surface attributes.
+
+ @param ppSurface Pointer to Primary surface pointer.
+ @param type Type of attribute to update:
+
+ #GF_SURFACE_UPDATE_ROTATE Set surface rotation
+ #GF_SURFACE_UPDATE_WIDTH Set surface width
+ #GF_SURFACE_UPDATE_HEIGHT Set surface height
+
+ @param data Data specific to the type.
+
+ @retval #GF_SUCCESS on success.
+ @retval #GF_ERROR on error.
+
+ Currently only one update flag is defined #GF_SURFACE_UPDATE_ROTATE
+
+ */
+GF_RETTYPE
+GFRmSurfaceUpdate( GFRmHandle RmHandle,
+ PGFRMSURFACE pSurface,
+ NvU32 type,
+ NvU32 data );
+
+/* Memory Manager */
+
+/** Allocate a linear piece of internal memory block.
+
+ @param pMemoryReq Pointer to Memory Request struct #GFRMMEMORYREQUEST.
+ @param pMemHandle A Pointer to the memory handle.
+
+ @retval #GF_SUCCESS on success.
+ @retval #GF_ERROR on error.
+ */
+GF_RETTYPE
+GFRmMemHandleAlloc(GFRmHandle RmHandle,
+ GFRMMEMORYREQUEST *pMemoryReq,
+ GFRmMemHandle *pMemHandle );
+
+/** Frees an allocated internal memory block.
+
+ @param phMem A Pointer to the memory handle.
+ */
+void
+GFRmMemHandleFree(GFRmHandle hRm,
+ GFRmMemHandle *phMem);
+
+/** Current memory info. Only supports embedded memory.
+
+ @param pTotalFree Pointer to NvU32 holding total free memoory available.
+ @param flag Type of memory. Can be one the
+ #GF_MEMORY_EMBEDDED
+ #GF_MEMORY_EMBEDDED_EXT
+ #GF_MEMORY_EMBEDDED_INT
+ @param pMaxChunk Size of the max chunk.
+
+ @retval #GF_SUCCESS on success.
+ @retval #GF_ERROR on error.
+
+ GF_MEMORY_EMBEDDED returns the free memory available in both internal
+ and external memory.
+ */
+GF_RETTYPE
+GFRmMemInfo (GFRmHandle RmHandle,
+ NvU32 *pTotalFree,
+ NvU32 *pMaxChunk,
+ NvU32 flag );
+
+
+/** Get an handle for the entire internal memory. Used for debugging purposes
+ only.
+*/
+GFRmMemHandle GFRmMemGetIntMemHandle(GFRmHandle RmHandle);
+
+/** Get an handle for the entire external memory. Used for debugging purposes
+ only.
+*/
+GFRmMemHandle GFRmMemGetExtMemHandle(GFRmHandle RmHandle);
+
+/** Handle to offset(sc15 view of hw address) conversion.
+ */
+NvU32 GFRmMemGetOffset(GFRmMemHandle hMem);
+
+/** Handle to DSP offset(DSP address address map) conversion.
+ */
+NvU32 GFRmMemGetDSPOffset(GFRmMemHandle hMem);
+
+/** Handle to virtual address conversion.
+
+ Returned pointer cannot be dereferenced excpet in direct
+ addressing mode.
+ */
+void *GFRmMemGetPointer(GFRmMemHandle hMem);
+
+/** Get the DSP address with a particular caching attribute for a given memory
+ handle.
+ */
+NvU32 GFRmMemGetUncachedDSPAddr(GFRmMemHandle hMem);
+NvU32 GFRmMemGetWriteBackDSPAddr(GFRmMemHandle hMem);
+NvU32 GFRmMemGetWriteThroughDSPAddr(GFRmMemHandle hMem);
+
+/** Memory Handle reverse lookup from offset.
+
+ This can be used only for the embedded memory.
+ */
+GF_RETTYPE
+GFRmMemOffsetToHandle(GFRmHandle RmHandle, NvU32 offset, GFRmMemHandle *MemHandle);
+
+/** Converts offset to virtual address.
+
+ @param offset Hardware offset as seen by the SCxx chip.
+ @param ppMemory Pointer to Virtual address.
+
+ */
+GF_RETTYPE
+GFRmMemOffsetToVirt(GFRmHandle RmHandle, NvU32 offset, void **ppMemory);
+
+/** Converts virtual to offset (SCxx hw view)
+
+ @param offset Hardware offset SCxx view.
+ @param ppMemory Virtual address.
+ */
+GF_RETTYPE
+GFRmMemVirtToOffset(GFRmHandle RmHandle, void *ppMemory, NvU32 *offset);
+
+/** Test if the memory offset is from external memory.
+
+ Returns NV_TRUE if the offset is comming from
+ external memory, otherwise NV_FALSE.
+ */
+NvBool
+GFRmIsExternalMemoryOffset(GFRmHandle RmHandle,
+ NvU32 offset);
+
+/** Test if the memory handle is from external memory.
+
+ Returns NV_TRUE if the handle is comming from
+ external memory, otherwise NV_FALSE.
+ */
+NvBool
+GFRmIsExternalMemoryHandle(GFRmHandle RmHandle,
+ GFRmMemHandle memhandle);
+
+/** Test if the memory offset is valid.
+ @return NV_TRUE if valid, or NV_FALSE otherwise.
+ */
+NvBool GFRmIsMemoryOffsetValid(GFRmHandle hRm, NvU32 Offset);
+
+/** Test for bufferoverflows in allocated GPU memory.
+ This does nothing for release builds. In GFSDK debug build
+ each GPU memory block will be guarded by leading and trailing
+ 8 byte marker sequences:
+
+ Start of block: 0x0D,0xF0,0xAD,0xDE,0x0D,0xF0,0xAD,0xDE
+ End of block: 0xDE,0xAD,0xFO,0xOD,0xDE,0xAD,0xFO,0xOD
+
+ This call checks if these guard markers have been overwritten
+ @return Index of corrupted memory block, or -1 if all are ok.
+*/
+int GFRmMemEmbVerify(GFRmHandle RmHandle);
+
+/* CPU bound memory fill functions:
+ These functions will use CPU cycles to write 16 to 32-bit fixed data
+ pattern into GPU memory. These API's will use user specified channel
+ apperture to access memory directly and are equipped with Lock and Unlock
+ routines to be thread safe.
+*/
+
+/** Fill memory with fixed data pattern on a particular channel.
+ Function locks and unlocks the channel automatically.
+ @param ChHandle User-specified channel to use.
+ @param memHandle GPU memory handle to write fixed 32-bit data.
+ @param offset Byte offset relative to memHandle block,
+ must be 32-bit aligned.
+ @param fill 32-bit fixed data pattern.
+ @param words Number of DWORDs to write.
+*/
+void
+GFRmChMemFill32(GFRmChHandle ChHandle, GFRmMemHandle memHandle, NvU32 offset,
+ NvU32 fill, NvU32 words);
+
+/** Fill memory with fixed data pattern on a particular channel.
+ Function locks and unlocks the channel automatically.
+ @param ChHandle User-specified channel to use.
+ @param memHandle GPU memory handle to write fixed 16-bit data.
+ @param offset Byte offset relative to memHandle block,
+ must be 32-bit aligned.
+ @param fill 16-bit fixed data pattern.
+ @param words Number of DWORDs to write.
+*/
+void
+GFRmChMemFill16(GFRmChHandle ChHandle, GFRmMemHandle memHandle, NvU32 offset,
+ NvU16 fill, NvU32 words);
+
+/** Save/Restore functions - These functions Save embedded memory to system memory.
+ * This memory can then be restored back to sys mem when required. These functions
+ * are used during DeepPowerDown.
+ */
+GF_RETTYPE GFRmSaveMemory(GFRmHandle pRm,
+ void *sysMemPtr,
+ NvU32 memSize);
+
+GF_RETTYPE GFRmRestoreMemory(GFRmHandle pRm,
+ void *sysMemPtr,
+ NvU32 memSize);
+
+/* Linear video memory functions:
+
+ These functions are used for transferring system memory to video memory,
+ filling video memory, and video memory to video memory operations. These
+ set of functions use the "1d" engine in hardware. All operations use
+ channels and will be synchronized with other commands. Optionally each
+ operation can be passed a flag to insert a "clear/raise/wait" sequence
+ which will guarantee that the operation has completed before processing
+ more commands in the command stream. For example, if a texture is being
+ downloaded, it is useful that the download be complete prior to some other
+ engine (3d maybe) using this memory.
+
+ Prior to using functions, the 1d engine must be enabled. Disabling
+ will cause the channel passed in to be idled. This is required by hardware
+ so that the command processors state can be updated when the 1d engine
+ has its clock disabled and put into reset.
+
+*/
+
+
+/** Callback prototype for GFRmChLinearSetDMACallback(). */
+typedef void (*GF_FUNC_DMA_CALLBACK)(void *dstAddr, void *srcAddr, NvU32 lengthInWords);
+
+/** Setup an DMA callback for downloading data to SRAM.
+ *
+ * This function allows for the user to to setup a DMA callback when
+ * downloading code to the frame buffer.
+ *
+ * The callback function should return AFTER all data has been transferred to
+ * the device. The downloader writes all data to the framebuffer through
+ * the registered frame buffer window. This window is 4KBytes in length,
+ * so there will be a callback once for each 4Kbytes (or less to handle alignment
+ * constraints).
+ *
+ * Also, it is possible for downloads to be occuring on multiple channels
+ * concurrently, which means that this Callback function must be able to
+ * handle calls from different threads, and do whatever arbitration is required.
+ *
+ * For indirect addressing modes, inside the GFSDK a semaphore will be taken
+ * and held for the duration of this transaction, as multiple threads cannot
+ * access the device concurrently when using an indirect addressing model.
+ *
+ * @param ChHandle The channel that will be used for the download (channel aperture is used)
+ * @param dmaCallback Pointer to the callback function that is called to do the download
+ */
+GF_RETTYPE
+GFRmChLinearSetDMACallback(GFRmChHandle ChHandle,
+ GF_FUNC_DMA_CALLBACK dmaCallback);
+
+/** Flag for GFRmChLinearSysToVidMemcpy(): use a clear/raise/wait. */
+#define GF_RM_LINEAR_USE_CRW 0x01
+
+/** Flag for GFRmChLinearSysToVidMemcpy(): don't synchronize with channel's pushbuffer. */
+#define GF_RM_LINEAR_NO_PB_SYNC 0x02
+
+/** Enable 1D engine for GFRmChLinear* functions.
+ *
+ * Call before using any GFRmChLinear* function. This enables the hardware that is
+ * used for these functions. Internally there is a reference count, so it is safe
+ * to call this multiple times.
+ *
+ * @param ChHandle Any valid channel handle should work.
+ * @see GFRmChLinearDisable()
+ */
+
+GF_RETTYPE
+GFRmChLinearEnable(GFRmChHandle ChHandle);
+
+
+/** Disable 1D engine for GFRmChLinear* functions.
+ *
+ * When the internal reference count reaches zero, the accelerator's clocks will be turned
+ * off to save power
+ *
+ * @param ChHandle Any valid channel should work.
+ * @see GFRmChLinearEnable()
+ */
+
+GF_RETTYPE
+GFRmChLinearDisable(GFRmChHandle ChHandle);
+
+
+
+/** Downloads a system memory buffer to the GPU memory buffer.
+ *
+ * The main reason for using this is that
+ * the copy to video memory is serialized with other operations. A typical use would be something
+ * like: 3d-driver issues draw commands that use a texture. 3d-driver issues a clear/raise/wait to
+ * know when draw is complete. 3d-driver issues a download to update the texture.
+ *
+ * @param pCtx : Current context (channel)
+ * @param memHandle : Handle returned from the memory allocator
+ * @param dstOffset : Offset from the beginning of the block referenced in memHandle
+ * @param pSrc : Source memory address in system memory
+ * @param len : Length in bytes to copy
+ * @param flags : Flags to optionally modify copy behavior
+ *
+ * flags can be one of:
+ *
+ * GF_RM_LINEAR_USE_CRW -- use a clear/raise/wait to make the operation finish prior to other command
+ * in the command stream being executed.
+ * GF_RM_LINEAR_NO_PB_SYNC -- This means the download does not need to be synchronous with the pushbuffer
+ * and the RM can optionally use different more efficient path
+ * than the pushbuffer.
+ *
+ * @return Returns GF_SUCCESS on success
+ */
+GF_RETTYPE
+GFRmChLinearSysToVidMemcpy(GFRmChHandle pCtx,
+ GFRmMemHandle memHandle,
+ NvU32 dstOffset,
+ void *srcPtr,
+ NvU32 bytes,
+ NvU32 flags);
+
+/** Fills a region of GPU memory with a constant value, by memory handle.
+ *
+ * @param ctx Current context (or channel)
+ * @param memHandle Handle to the memory to fill
+ * @param dstOffset Offset inside the memory handle
+ * @param data32 The value being replicated in memory. This value is
+ * interpreted differently depending on the align parameter.
+ * if align==4 all of data32 is used
+ * if align==2 lower 16-bits of data32 is used
+ * if align==1 lower 8-bits of data32 is used
+ *
+ * @param bytes Number of bytes to fill
+ * @param align must 1,2,4
+ * @param flags Can be 0 or GF_RM_LINEAR_USE_CRW
+ */
+GF_RETTYPE
+GFRmChLinearVidMemFill(GFRmChHandle ctx,
+ GFRmMemHandle memHandle,
+ NvU32 dstOffset,
+ NvU32 data32,
+ NvU32 bytes,
+ NvU32 align,
+ NvU32 flags);
+
+/** Copies memory within GPU memory, by memory handle.
+ *
+ * @param ctx The channel handle
+ * @param dstMemHandle memory handle returned from memalloc
+ * @param dstOffset Offset from the beginning of dstMemHandle
+ * @param srcMemhandle memory handle of the src memory
+ * @param srcOffset Offset from the beginning of srcMemHandle
+ * @param bytes Number of bytes to be copied.
+ * @param flags Must be 0 or GF_RM_LINEAR_USE_CRW
+ *
+ */
+GF_RETTYPE
+GFRmChLinearVidMemcpy(GFRmChHandle ctx,
+ GFRmMemHandle dstMemHandle,
+ NvU32 dstOffset,
+ GFRmMemHandle srcMemHandle,
+ NvU32 srcOffset,
+ NvU32 bytes,
+ NvU32 flags);
+
+
+/** @name OS Manager
+@{*/
+
+/** Enter Critical section, extended version.
+ @param id GF_CRITICAL_SECTION_xxx
+ */
+void GFRmOSEnterCSExt(GFRmHandle hRm, NvU32 id);
+
+/** Exit Critical section, extended version.
+ @param id GF_CRITICAL_SECTION_xxx
+ */
+void GFRmOSExitCSExt(GFRmHandle hRm, NvU32 id);
+
+/** Enter Hardware Access Critical section.
+ */
+void GFRmOSEnterCS(GFRmHandle hRm);
+
+/** Exit Hardware Access Critical section.
+ */
+void GFRmOSExitCS(GFRmHandle hRm);
+
+/** Waits for some number of milliseconds.
+ @param msec Number of milliseconds to wait.
+ */
+void GFRmOSWaitMSec(NvU32 msec);
+
+/** Get the current OS tick counter.
+ @return Low 32 bits of millisecond counter.
+*/
+NvU32 GFRmGetTickCountMSec(void);
+
+/** Get the current OS tick counter.
+
+ NOTE: This function is NOT guaranteed to exist on all
+ platforms. Drivers should NOT call this function; it's
+ meant only for benchmarking.
+
+ @return 64 bit microsecond counter.
+ */
+NvU64 GFRmGetTickCountUSec(void);
+
+/** Waits for a keypress with a timeout, and returns the key.
+
+ @param timeOutMSec (NvU32) Milliseconds to wait for the keypress.
+ @retval (int) The code for the key, or zero if we timed out.
+ */
+int GFRmWaitKey(NvU32 timeOutMSec);
+
+/*@}*/
+
+/** @name Read/Write functions
+
+ We provide APIs to read and write GPU registers and memory, independent of
+ which bus addressing mode is in use (direct or indirect, 16 or 32).
+
+ WARNING: These functions are not safe in all cases.
+ 1. They do not take into account handshake mode. With fixed timings it may
+ be unsafe, for example, to use GFRmMemRd/Wr32 to access external memory.
+ 2. They do not take into account limitations on the # of address bits. On
+ some direct addressing platforms, not all the address bits are wired up,
+ so it is impossible to directly access all of memory. For example, it
+ may be unsafe to use GFRmMemRd/Wr32 to access external memory.
+ 3. Some buses do not have full byte enable support. It is possible that
+ GFRmMemWr08, for example, may clobber the other byte in the word.
+
+ It is believed that the first two pitfalls only apply to external memory.
+ You can probably use these APIs safely to access internal memory, subject to
+ caveat (3) (i.e. you should stick to 16-bit or 32-bit writes). For external
+ memory, "use at your own risk."
+
+@{*/
+
+/** Read or write an 8-, 16-, or 32-bit register in the device. */
+NvU8 GFRmRegRd08(GFRmHandle hRm, NvU32 offset);
+NvU16 GFRmRegRd16(GFRmHandle hRm, NvU32 offset);
+NvU32 GFRmRegRd32(GFRmHandle hRm, NvU32 offset);
+void GFRmRegWr08(GFRmHandle hRm, NvU32 offset, NvU8 data);
+void GFRmRegWr16(GFRmHandle hRm, NvU32 offset, NvU16 data);
+void GFRmRegWr32(GFRmHandle hRm, NvU32 offset, NvU32 data);
+
+/** Read or write 8, 16, or 32 bits of data to a given offset in a block of memory.
+ Offset is relative to the memory handle AND not the absolute one.
+ */
+NvU8 GFRmMemRd08(GFRmHandle hRm, GFRmMemHandle hMem, NvU32 offset);
+NvU16 GFRmMemRd16(GFRmHandle hRm, GFRmMemHandle hMem, NvU32 offset);
+NvU32 GFRmMemRd32(GFRmHandle hRm, GFRmMemHandle hMem, NvU32 offset);
+void GFRmMemWr08(GFRmHandle hRm, GFRmMemHandle hMem, NvU32 offset, NvU8 data);
+void GFRmMemWr16(GFRmHandle hRm, GFRmMemHandle hMem, NvU32 offset, NvU16 data);
+void GFRmMemWr32(GFRmHandle hRm, GFRmMemHandle hMem, NvU32 offset, NvU32 data);
+
+/** Read or write a region of a block of memory. Size is in bytes */
+void GFRmMemRead(GFRmHandle hRm, GFRmMemHandle hMem, NvU32 offset,
+ void *pDst, NvU32 size);
+void GFRmMemWrite(GFRmHandle hRm, GFRmMemHandle hMem, NvU32 offset,
+ const void *pSrc, NvU32 size);
+
+/** Fill a block of memory with a given 8-, 16-, or 32-bit word. Size is in words, not bytes */
+void GFRmMemFill08(GFRmHandle hRm, GFRmMemHandle hMem,
+ NvU32 offset, NvU32 size, NvU8 data);
+void GFRmMemFill16(GFRmHandle hRm, GFRmMemHandle hMem,
+ NvU32 offset, NvU32 size, NvU16 data);
+void GFRmMemFill32(GFRmHandle hRm, GFRmMemHandle hMem,
+ NvU32 offset, NvU32 size, NvU32 data);
+
+/** Write to a FIFO in the chip. */
+void GFRmFifoWrite(GFRmHandle hRm, const void *srcPtr,
+ NvU32 dstOffset, NvU32 sizeIn32bits);
+
+/** Waits for the host to idle.
+
+ @retval GF_SUCCESS on success
+ @retval GF_ERROR on error
+*/
+GF_RETTYPE
+GFRmWaitForHostIdle( GFRmHandle RmHandle );
+
+/*@}*/
+
+/** Dispatch DSP2Host messages.
+
+ This function can be called from an IST in response to the DSP2Host
+ interrupt. It will perform the following sequence:
+
+ - read the DSP2Host message from the DSP2Host registers, i.e. GFRmGetMessage()
+ - identify DSP task from the task ID in message parameter 0
+ - add the message to that task's queue
+ - set an event registered with that task to notify it about the new message
+ - clear DSP2Host interrupt register, i.e. GFRmClearDspCommInterrupt()
+
+ If the task ID from the message is unknown, the interrupt is still cleared,
+ but the message is ignored.
+
+ @param ChHandle Channel to use, should be the protected channel (GF_PROTECTED_CHANNEL)
+ @return Returns the DSP task ID the received message belonged to, or 0 if unknown
+*/
+NvU32 GFRmDispatchMessage(GFRmChHandle ChHandle);
+NvU32 GFRmDispatchMessageDual(GFRmChHandle ChHandle, NvU32 dspModule);
+
+/** Descriptor for circular buffer in DSP memory.
+ This structure is intended for shared use between DSP tasks.
+
+ If GF_RM_DSP_CBUFFER::wr == GF_RM_DSP_CBUFFER::rd, the circular buffer is empty.
+ If GF_RM_DSP_CBUFFER::wr != GF_RM_DSP_CBUFFER::rd, the buffer contains
+ (wr>=rd)?wr-rd:size+wr-rd bytes of data, starting at offset rd, wrapping on the buffer end.
+*/
+typedef struct _GFRM_DSP_CIRCBUFFER
+{
+ NvU8* adr; //!< buffer address, DSP address space in GPU memory
+ NvU32 size; //!< Buffer size in bytes
+ NvU32 wr; //!< Current write offset relative to buffer address
+ NvU32 rd; //!< Current read offset relative to buffer address
+ NvU32 userData[4]; //!< User defined, specific depending on usage
+
+} GF_RM_DSP_CIRCBUFFER;
+
+
+/*
+ * Pins that can be used as GPIOs once the corresponding module
+ * has been enabled
+ */
+typedef enum {
+
+ /* SD PINS */
+ GPIO_SD_PIN_DATA0 = 1,
+ GPIO_SD_PIN_DATA1,
+ GPIO_SD_PIN_DATA2,
+ GPIO_SD_PIN_DATA3,
+ GPIO_SD_PIN_CLK,
+ GPIO_SD_PIN_CMD,
+ GPIO_SD_PIN_SDGP0,
+ GPIO_SD_PIN_SDGP1,
+
+ /* VI PINS */
+ GPIO_VI_PIN_VD0,
+ GPIO_VI_PIN_VD1,
+ GPIO_VI_PIN_VD2,
+ GPIO_VI_PIN_VD3,
+ GPIO_VI_PIN_VD4,
+ GPIO_VI_PIN_VD5,
+ GPIO_VI_PIN_VD6,
+ GPIO_VI_PIN_VD7,
+ GPIO_VI_PIN_VD8,
+ GPIO_VI_PIN_VD9,
+ GPIO_VI_PIN_VD10,
+ GPIO_VI_PIN_VD11,
+ GPIO_VI_PIN_VSCK,
+ GPIO_VI_PIN_VHS,
+ GPIO_VI_PIN_VVS,
+ GPIO_VI_PIN_VGP0,
+ GPIO_VI_PIN_VGP1,
+ GPIO_VI_PIN_VGP2,
+ GPIO_VI_PIN_VGP3,
+ GPIO_VI_PIN_VGP4,
+ GPIO_VI_PIN_VGP5,
+ GPIO_VI_PIN_VGP6
+
+} GFGPIOPin;
+
+/*
+ * I/O options for pins
+ */
+typedef enum {
+ GPIO_OPTION_DISABLE = 1,
+ GPIO_OPTION_INPUT,
+ GPIO_OPTION_OUTPUT
+} GFGPIOOption;
+
+/*
+ * Enable/Disable I/O for GPIOS
+ */
+typedef enum {
+ GPIO_MODE_DISABLE = 1,
+ GPIO_MODE_ENABLE
+} GFGPIOMode;
+
+/*
+ * Pin groups whose selects are tied together
+ */
+typedef enum {
+ GPIO_SD_PINGRP_D0_CLK_CMD = 1,
+ GPIO_SD_PINGRP_D1_D2
+} GFGPIOPinGrp;
+
+/*
+ * Pin select for GPIOS
+ */
+typedef enum {
+ GPIO_SELECT_GPIO = 1,
+ GPIO_SELECT_FUNC
+} GFGPIOSelect;
+
+/**
+ *
+ * Sets all the pins of a specific module to GPIO mode
+ *
+ * @param RmHandle Handle specific to the GFRm
+ * @param modid Module
+ *
+ * @return GF_SUCCESS on success
+ *
+ */
+GF_RETTYPE
+GFRmGPIOEnable(GFRmHandle RmHandle, eGFModuleIDs modid);
+
+/**
+ * Initializes the GPIO API
+ *
+ *
+ * @param RmHandle Handle specific to the GFRm
+ * @param modid Module
+ *
+ * @return GF_SUCCESS on success
+ *
+ */
+GF_RETTYPE
+GFRmGPIODisable(GFRmHandle RmHandle, eGFModuleIDs modid);
+
+/**
+ *
+ * Modifies the pin's input/output modes
+ *
+ * @param ChHandle Channel to write to modules through
+ * @param pin Pin to set
+ * @param options One of GPIO_OPTION_DISABLE (ignores mode),
+ * GPIO_OPTION_INPUT, GPIO_OPTION_OUTPUT
+ * @param mode One of GPIO_MODE_ENABLE, GPIO_MODE_DISABLE
+ *
+ * @return GF_SUCCESS on success
+ *
+ */
+GF_RETTYPE
+GFRmGPIOSetPinMode(GFRmChHandle ChHandle, GFGPIOPin pin, GFGPIOOption option, GFGPIOMode mode);
+
+/**
+ *
+ * Sets a particular pin's output select
+ *
+ * @param ChHandle Channel to write to modules through
+ * @param pin Pin to set
+ * @param select One of GPIO_SELECT_GPIO, GPIO_SELECT_FUNC
+ *
+ * @return GF_SUCCESS on success
+ *
+ */
+GF_RETTYPE
+GFRmGPIOSetPinSelect(GFRmChHandle ChHandle, GFGPIOPin pin, GFGPIOSelect select);
+
+/**
+ *
+ * Sets a particular pin group's output select
+ *
+ * @param ChHandle Channel to write to modules through
+ * @param group Pin group to set
+ * @param select One of GPIO_SELECT_GPIO, GPIO_SELECT_FUNC
+ *
+ * @return GF_SUCCESS on success
+ *
+ */
+GF_RETTYPE
+GFRmGPIOSetPinGrpSelect(GFRmChHandle ChHandle, GFGPIOPinGrp group, GFGPIOSelect select);
+
+/**
+ *
+ * Sets the status (high/low) of a pin
+ *
+ * @param ChHandle Channel to write to modules through
+ * @param pin Pin to set
+ * @param value Value to write to pin
+ *
+ */
+void
+GFRmGPIOSetPin(GFRmChHandle ChHandle, GFGPIOPin pin, NvU8 value);
+
+/**
+ * Gets the status (high/low) of a pin
+ *
+ * @param ChHandle Channel to write to modules through
+ * @param pin Pin to set
+ *
+ * @return Status (high/low) of pin
+ *
+ */
+NvU32
+GFRmGPIOGetPin(GFRmChHandle ChHandle, GFGPIOPin pin);
+
+/** @ name Bootflags
+ List of flags inidicating all the devices which are booted
+@{*/
+
+/** Chip is initalized in other words IxInit is called */
+#define GFRM_BOOT_IXINIT 0x1
+
+/** Display is initalized */
+#define GFRM_BOOT_DXINIT 0x2
+
+/*@}*/
+
+/**
+ * Writes to some scratch register with a log of all the components which are
+ * initalized. GFRM_BOOT_* are passed as bootflags.
+ */
+GF_RETTYPE GFRmBootPostInit(GFRmHandle hRm, NvU32 bootflags);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+/*@}*/
+
+/** @page pageRmAppNotes RmAPI Application Notes
+
+ @section pageRmAppNotes1 Todo
+
+*/
+
+#endif /* __GFRM_H__ */
+
diff --git a/Start_WM/test6/inc/GFRmError.h b/Start_WM/test6/inc/GFRmError.h
new file mode 100755
index 00000000..7295b9f2
--- /dev/null
+++ b/Start_WM/test6/inc/GFRmError.h
@@ -0,0 +1,68 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/** @file GFRmError.h
+ GFSDK Resource Manager API error code header file.
+*/
+
+#ifndef __GFRMERROR_H__
+#define __GFRMERROR_H__
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+/** GFRM error code: Function not supported. */
+#define GFRM_ERROR_NO_SUPPORT (GFRM_ERROR | 0x02)
+/** GFRM error code: Out of memory. */
+#define GFRM_ERROR_OUT_MEMORY (GFRM_ERROR | 0x03)
+/** GFRM error code: Operation on primary surface, but primary surface not set. */
+#define GFRM_ERROR_NO_PRIMARY_SURFACE (GFRM_ERROR | 0x04)
+/** GFRM error code: Bad parameters. */
+#define GFRM_ERROR_BAD_PARAMETER (GFRM_ERROR | 0x05)
+/** GFRM error code: Out of memory in DSP XRM heap. */
+#define GFRM_ERROR_XRM_OUTMEMORY (GFRM_ERROR | 0x06)
+/** GFRM error code: GFRM memory manager is not initialized. */
+#define GFRM_ERROR_MEM_MANAGER_NOT_INITIALIZED (GFRM_ERROR | 0x07)
+/** GFRM error code: DSP2Host message queue overflow. */
+#define GFRM_ERROR_QUEUE_OVERFLOW (GFRM_ERROR | 0x08)
+/** GFRM error code: DSP2Host message queue empty (not an error). */
+#define GFRM_ERROR_QUEUE_EMPTY (GFRM_ERROR | 0x09)
+/** GFRM error code: DSP2Host message with unknown task ID received. */
+#define GFRM_ERROR_QUEUE_UNKNOWNTASK (GFRM_ERROR | 0x0A)
+/** GFRM error code: Error getting GPU base address. */
+#define GFRM_ERROR_IXOPEN_GETADDRESS (GFRM_ERROR | 0x0C)
+/** GFRM error code: Error opening file. */
+#define GFRM_ERROR_FILE_OPEN_FAILED (GFRM_ERROR | 0x0D)
+/** GFRM error code: Cannot create XRM task. */
+#define GFRM_ERROR_XRM_CREATETASK (GFRM_ERROR | 0x0E)
+/** GFRM error code: GFRmOSEventWait() failed. */
+#define GF_WAIT_ERROR (GFRM_ERROR | 0x0F)
+/** GFRM error code: GFRmOSEventWait() timed out, the event was not set. */
+#define GF_WAIT_TIME_OUT (GFRM_ERROR | 0x10)
+/** GFRM error code: RmEnableModule tried to enable a module that doesn't exist. */
+#define GFRM_ERROR_MODULE_NOT_EXIST (GFRM_ERROR | 0x11)
+/** GFRM error code: HW Resource not available on GFRmHwResourceConstraint(). */
+#define GFRM_ERROR_HWRESOURCE_NOT_AVAILABLE (GFRM_ERROR | 0x12)
+/** GFRM error code: Host2DSP task message queue overflow. */
+#define GFRM_ERROR_XRM_QUEUE_OVERFLOW (GFRM_ERROR | 0x13)
+/** GFRM error code: Host2DSP task message queue empty. */
+#define GFRM_ERROR_XRM_QUEUE_EMPTY (GFRM_ERROR | 0x14)
+/** GFRM error code: File not found */
+#define GFRM_ERROR_FILE_NOT_FOUND (GFRM_ERROR | 0x15)
+/** GFRM error code: Create semaphore */
+#define GFRM_ERROR_CREATE_SEMAPHORE (GFRM_ERROR | 0x16)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // __GFRMERROR_H__
+
diff --git a/Start_WM/test6/inc/GFRmHelp.h b/Start_WM/test6/inc/GFRmHelp.h
new file mode 100755
index 00000000..82c1fa5a
--- /dev/null
+++ b/Start_WM/test6/inc/GFRmHelp.h
@@ -0,0 +1,515 @@
+/*
+ * Copyright 2003 NVIDIA Corporation. All Rights Reserved.
+ *
+ * BY INSTALLING THE SOFTWARE THE USER AGREES TO THE TERMS BELOW.
+ *
+ * User agrees to use the software under carefully controlled conditions
+ * and to inform all employees and contractors who have access to the software
+ * that the source code of the software is confidential and proprietary
+ * information of NVIDIA and is licensed to user as such. User acknowledges
+ * and agrees that protection of the source code is essential and user shall
+ * retain the source code in strict confidence.User shall restrict access to
+ * the source code of the software to those employees and contractors of user
+ * who have agreed to be bound by a confidentiality obligation which
+ * incorporates the protections and restrictions substantially set forth
+ * herein, and who have a need to access the source code in order to carry out
+ * the business purpose between NVIDIA and user. The software provided
+ * herewith to user may only be used so long as the software is used solely
+ * with NVIDIA products and no other third party products (hardware or
+ * software). The software must carry the NVIDIA copyright notice shown
+ * above. User must not disclose, copy, duplicate, reproduce, modify,
+ * publicly display, create derivative works of the software other than as
+ * expressly authorized herein. User must not under any circumstances,
+ * distribute or in any way disseminate the information contained in the
+ * source code and/or the source code itself to third parties except as
+ * expressly agreed to by NVIDIA. In the event that user discovers any bugs
+ * in the software, such bugs must be reported to NVIDIA and any fixes may be
+ * inserted into the source code of the software by NVIDIA only. User shall
+ * not modify the source code of the software in any way. User shall be fully
+ * responsible for the conduct of all of its employees, contractors and
+ * representatives who may in any way violate these restrictions.
+ *
+ * NO WARRANTY
+ * THE ACCOMPANYING SOFTWARE (INCLUDING OBJECT AND SOURCE CODE) PROVIDED BY
+ * NVIDIA TO USER IS PROVIDED "AS IS." NVIDIA DISCLAIMS ALL WARRANTIES,
+ * EXPRESS, IMPLIED OR STATUTORY, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ * WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT.
+
+ * LIMITATION OF LIABILITY
+ * NVIDIA SHALL NOT BE LIABLE TO USER, USERS CUSTOMERS, OR ANY OTHER PERSON
+ * OR ENTITY CLAIMING THROUGH OR UNDER USER FOR ANY LOSS OF PROFITS, INCOME,
+ * SAVINGS, OR ANY OTHER CONSEQUENTIAL, INCIDENTAL, SPECIAL, PUNITIVE, DIRECT
+ * OR INDIRECT DAMAGES (WHETHER IN AN ACTION IN CONTRACT, TORT OR BASED ON A
+ * WARRANTY), EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGES. THESE LIMITATIONS SHALL APPLY NOTWITHSTANDING ANY FAILURE OF THE
+ * ESSENTIAL PURPOSE OF ANY LIMITED REMEDY. IN NO EVENT SHALL NVIDIAS
+ * AGGREGATE LIABILITY TO USER OR ANY OTHER PERSON OR ENTITY CLAIMING THROUGH
+ * OR UNDER USER EXCEED THE AMOUNT OF MONEY ACTUALLY PAID BY USER TO NVIDIA
+ * FOR THE SOFTWARE PROVIDED HEREWITH.
+ */
+
+/*
+ * File: GFRmHelp.inl
+ * GFSDK Resource Manager Helper Manager inline header file.
+ * #### The helper functions are highly dependent on Operating System ####
+ * #### and Compiler. A number of these functions are macros that ####
+ * #### maps to corresonding operating system functions directly. ####
+ */
+
+#ifndef __GFRMHelp_INL__
+#define __GFRMHelp_INL__
+
+#include "nvtypes.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+/* Defined in GFRMHelp.c */
+extern int GFStricmp(char *, char *);
+extern int GFStrincmp(char *, char *, int);
+
+extern void *GFMalloc(int);
+extern void GFFree(void *ptr);
+
+#if NVOS_IS_WINDOWS_CE
+
+#ifndef __KERNEL__
+#include
+#include
+#endif // __KERNEL__
+
+/* String Helper functions */
+#define GFStrcpy(p1, p2) strcpy(p1, p2)
+#define GFStrncpy(p1, p2, p3) strncpy(p1, p2, p3)
+#define GFStrcat(p1, p2) strcat(p1, p2)
+#define GFStrncat(p1, p2, p3) strncat(p1, p2, p3)
+#define GFStrlen(p1) strlen(p1)
+#define GFStrchr(p1, p2) strchr(p1, p2)
+#define GFStrcmp(p1, p2) strcmp(p1, p2)
+#define GFStrncmp(p1, p2, p3) strncmp(p1, p2, p3)
+#define GFStrtok(p1, p2) strtok(p1, p2)
+#define GFStrstr(p1, p2) strstr(p1, p2)
+#define GFSscanf(p1, p2, p3) sscanf(p1, p2, p3)
+#define GFToupper(p1) toupper(p1)
+#define GFTolower(p1) tolower(p1)
+#define GFAtoi(p1) atoi(p1)
+
+// convert char string to wchar_t
+// p1 = src string of type char
+// p2 = dst string of type wchar_t
+// p3 = size of dst string in wchar_t unit
+#define GFStrConvert(p1, p2, p3) \
+ MultiByteToWideChar(CP_ACP, 0, p1, -1, p2, p3);
+
+// convert wchar_t string to char
+// p1 = src string of type wchar_t
+// p2 = dst string of type char
+// p3 = size of dst string in char unit
+#define GFWStrConvert(p1, p2, p3) \
+ WideCharToMultiByte(CP_ACP, 0, p1, -1, p2, p3, NULL, NULL)
+
+/* Standard Helper functions */
+#define GFStrtol(p1, p2, p3) strtol(p1, p2, p3)
+#define GFStrtod(p1, p2) strtod(p1, p2)
+
+/* Memory Helper functions */
+#define GFMemcpy( p1, p2, p3 ) memcpy( p1, p2, p3 )
+#define GFMemmove( p1, p2, p3 ) memmove( p1, p2, p3 )
+#define GFMemcmp( p1, p2, p3 ) memcmp( p1, p2, p3 )
+#define GFMemset( p1, p2, p3 ) memset( p1, p2, p3 )
+
+#if defined(GF_ENABLE_RMC_TRACE)
+void GFRmRMCTrace(const char *printf_format, ...);
+void GFRmRMCVTrace(const char *printf_format, va_list ap);
+#define GFRMCTrace(a) GFRmRMCTrace a
+#define GFRMCVTrace(a) GFRmRMCVTrace a
+#else
+#define GFRMCTrace(a)
+#define GFRMCVTrace(a)
+#endif
+
+/* Debug Helper functions */
+#if !defined(PROJECT_SEC_G1) || defined(DEBUG)
+#define GFPrintf printf
+#else
+#define GFPrintf
+#endif
+#define GFSprintf sprintf
+#define GFSprintfVAL vsprintf
+#define GFPrintfVAL vprintf
+
+#ifdef DEBUG
+extern void RmDebugBreak(void);
+#define GFDEBUG_ASSERT(x) if(!(x)) \
+ { \
+ GFPrintf(" Assert at Line no: %d in %s ", \
+ __LINE__, __FILE__); \
+ RmDebugBreak(); \
+ }
+#endif
+
+#elif NVOS_IS_LINUX
+
+#ifndef __KERNEL__
+void RmDebugBreak(void);
+#ifdef DEBUG
+#define GFDEBUG_ASSERT(x) if(!(x)) \
+ { \
+ GFPrintf(" Assert at Line no: %d in %s ", \
+ __LINE__, __FILE__); \
+ RmDebugBreak(); \
+ }
+#endif
+
+#include
+#define GFToupper toupper
+#define GFTolower tolower
+
+#include
+#ifndef GF_XTENSA_RM_TASK
+#include
+#endif
+#define GFMemcpy memcpy
+#define GFMemmove memmove
+#define GFMemset memset
+#define GFMemcmp memcmp
+#define GFStrchr strchr
+#define GFStrcmp strcmp
+#define GFStrcpy strcpy
+#define GFStrncpy strncpy
+#define GFStrlen strlen
+#define GFStrcat strcat
+#define GFStrncmp strncmp
+#define GFStrtok strtok
+#define GFStrstr strstr
+#define GFSscanf sscanf
+
+#include
+#define GFPrintf printf
+#define GFSprintf sprintf
+#define GFSprintfVAL vsprintf
+#define GFPrintf printf
+#define GFSprintf sprintf
+#define GFSprintfVAL vsprintf
+#define GFPrintfVAL vprintf
+
+#include
+#define GFStrtol strtol
+#define GFStrtod strtod
+#define GFAtoi atoi
+#include
+
+/* Add or overload RMCTrace function here */
+#if defined(GF_ENABLE_RMC_TRACE)
+#include
+void GFRmRMCTrace(const char *printf_format, ...);
+void GFRmRMCVTrace(const char *printf_format, va_list ap);
+#define GFRMCTrace(a) GFRmRMCTrace a
+#define GFRMCVTrace(a) GFRmRMCVTrace a
+#else
+#define GFRMCTrace(a)
+#define GFRMCVTrace(a)
+#endif
+
+#else /* kernel mode */
+
+#include
+#include
+
+#include
+#define GFToupper toupper
+#define GFTolower tolower
+
+#include
+#define GFMemcpy memcpy
+#define GFMemmove memmove
+#define GFMemset memset
+#define GFStrcpy strcpy
+#define GFStrncpy strncpy
+#define GFStrlen strlen
+#define GFMemcmp memcmp
+#define GFStrcmp strcmp
+#define GFStrncmp strncmp
+#define GFStrcat strcat
+#define GFStrncat strncat
+
+#define GFStrstr strstr
+#define GFSscanf sscanf
+
+#define GFPrintf printk
+#define GFSprintf sprintf
+#define GFSprintfVAL vsprintf
+#define GFPrintfVAL vprintf
+#define GFAtoi atoi
+
+#if defined(GF_ENABLE_RMC_TRACE)
+#include
+void GFRmRMCTrace(const char *printf_format, ...);
+void GFRmRMCVTrace(const char *printf_format, va_list ap);
+#define GFRMCTrace(a) GFRmRMCTrace a
+#define GFRMCVTrace(a) GFRmRMCVTrace a
+#else
+#define GFRMCTrace(a)
+#define GFRMCVTrace(a)
+#endif
+
+#endif /* KERNEL */
+
+#elif NVOS_IS_WINDOWS
+
+#include
+#include
+#include
+#include
+
+/* String functions */
+#define GFStrcpy(p1, p2) strcpy(p1, p2)
+#define GFStrncpy(p1, p2, p3) strncpy(p1, p2, p3)
+#define GFStrcat(p1, p2) strcat(p1, p2)
+#define GFStrncat(p1, p2, p3) strncat(p1, p2, p3)
+#define GFStrstr(p1, p2) strstr(p1, p2)
+#define GFSscanf(p1, p2, p3) sscanf(p1, p2, p3)
+#define GFStrlen(p1) strlen(p1)
+#define GFStrchr(p1, p2) strchr(p1, p2)
+#define GFStrcmp(p1, p2) strcmp(p1, p2)
+#define GFStrncmp(p1, p2, p3) strncmp(p1, p2, p3)
+#define GFStrtok(p1, p2) strtok(p1, p2)
+#define GFToupper(p1) toupper(p1)
+#define GFTolower(p1) tolower(p1)
+#define GFStrConvert(p1, p2, p3) \
+ strcpy(p2,p1)
+// MultiByteToWideChar( CP_ACP, 0, p1, -1, p2, p3 );
+ // convert char string to Wide
+ // p1 = src string of type char
+ // p2 = dst string of type wchar_t
+ // p3 = size of dst string in wchar_t unit
+
+/* Standard Helper functions */
+#define GFStrtol(p1, p2, p3) strtol(p1, p2, p3)
+#define GFStrtod(p1, p2) strtod(p1, p2)
+
+/* Memory Helper functions */
+#define GFMemcpy( p1, p2, p3 ) memcpy( p1, p2, p3 )
+#define GFMemmove( p1, p2, p3 ) memmove( p1, p2, p3 )
+#define GFMemcmp( p1, p2, p3 ) memcmp( p1, p2, p3 )
+#define GFMemset( p1, p2, p3 ) memset( p1, p2, p3 )
+
+#define GFAtoi( p1 ) atoi( p1 )
+/* Debug Helper functions */
+#if !defined(PROJECT_SEC_G1) || defined(DEBUG)
+#define GFPrintf printf
+#else
+#define GFPrintf
+#endif
+#define GFSprintf sprintf
+#define GFSprintfVAL vsprintf
+#define GFPrintfVAL vprintf
+
+#if defined(GF_ENABLE_RMC_TRACE)
+void GFRmRMCTrace(const char *printf_format, ...);
+void GFRmRMCVTrace(const char *printf_format, va_list ap);
+#define GFRMCTrace(a) GFRmRMCTrace a
+#define GFRMCVTrace(a) GFRmRMCVTrace a
+#else
+#define GFRMCTrace(a)
+#define GFRMCVTrace(a)
+#endif
+
+void RmDebugBreak(void);
+#ifdef DEBUG
+#define GFDEBUG_ASSERT(x) if(!(x)) \
+ { \
+ GFPrintf(" Assert at Line no: %d in %s ", \
+ __LINE__, __FILE__); \
+ RmDebugBreak(); \
+ }
+#endif
+
+// Operating system running on the Xtensa
+#elif NVCPU_IS_XTENSA
+
+#include
+
+/* Memory Helper functions */
+#define GFMemcpy( p1, p2, p3 ) memcpy(p1, p2, p3)
+#define GFMemset( p1, p2, p3 ) memset(p1, p2, p3)
+
+#define GFRMCTrace(a)
+#define GFRMCVTrace(a)
+
+#else
+
+#include
+#include
+#include
+#include
+#include
+
+/* String functions */
+extern char GFToupper(char);
+extern char GFTolower(char);
+
+extern int GFAtoi(const char *);
+
+extern void *GFMemcpy(void *, const void *, int);
+extern void *GFMemmove(void *, const void *, int);
+extern void *GFMemset(void *, int, int);
+extern int GFMemcmp(void *, void *, int);
+
+extern char *GFStrcpy(char *, const char *);
+extern char *GFStrncpy(char *, const char *, int);
+
+extern char *GFStrcat(char *, const char *);
+extern char *GFStrncat(char *, const char *, int);
+
+extern int GFStrlen(const char *);
+
+extern char *GFStrchr(const char *,int);
+extern char *GFStrrchr(const char *,int);
+
+extern int GFStrcmp(const char *, const char *);
+extern int GFStrncmp(const char *, const char *, int);
+
+extern char *GFStrstr(const char * string1, const char * string2);
+extern int GFSscanf(char * string1, const char * string2, ...);
+
+extern char *GFStrtok(char *, const char *);
+
+extern long GFStrtol(const char *, char **, int);
+extern double GFStrtod(const char *, char **);
+
+extern int GFPrintf(const char *, ... );
+extern int GFSprintf(char * , const char *, ... );
+extern int GFSprintfVAL(char *, const char *, va_list);
+extern int GFPrintfVAL(const char *, va_list);
+
+#define GFStrConvert(p1, p2, p3) GFStrncpy(p1, p2, p3)
+
+#if defined(GF_ENABLE_RMC_TRACE)
+#define GFRMCTrace(a) printf a
+#define GFRMCVTrace(a) vprintf a
+#else
+#define GFRMCTrace(a)
+#define GFRMCVTrace(a)
+#endif
+
+#ifdef DEBUG
+#define GFDEBUG_ASSERT(x) if(!(x)) \
+ { \
+ GFPrintf(" Assert at Line no: %d in %s ", \
+ __LINE__, __FILE__); \
+ }
+#endif
+
+#endif /* GF_OS */
+
+/* Virtual Key Mappings for Specific OS */
+#if NVOS_IS_LINUX
+/* Virtual Keys */
+#define GF_VKEY_BACK 27
+#define GF_VKEY_FORWARD 13
+#define GF_VKEY_UP 65
+#define GF_VKEY_LEFT 68
+#define GF_VKEY_RIGHT 67
+#define GF_VKEY_DOWN 66
+#define GF_VKEY_SEND 46
+#define GF_VKEY_END 44
+#define GF_VKEY_0 48
+#define GF_VKEY_1 49
+#define GF_VKEY_2 50
+#define GF_VKEY_3 51
+#define GF_VKEY_4 52
+#define GF_VKEY_5 53
+#define GF_VKEY_6 54
+#define GF_VKEY_7 55
+#define GF_VKEY_8 56
+#define GF_VKEY_9 57
+#define GF_VKEY_STAR 42
+#define GF_VKEY_POUND 35
+
+#elif NVOS_IS_WINDOWS_CE
+
+/* Virtual Keys */
+#define GF_VKEY_BACK 27
+#define GF_VKEY_FORWARD 13
+#define GF_VKEY_UP 72
+#define GF_VKEY_LEFT 75
+#define GF_VKEY_RIGHT 77
+#define GF_VKEY_DOWN 80
+#define GF_VKEY_SEND 46
+#define GF_VKEY_END 44
+#define GF_VKEY_0 48
+#define GF_VKEY_1 49
+#define GF_VKEY_2 50
+#define GF_VKEY_3 51
+#define GF_VKEY_4 52
+#define GF_VKEY_5 53
+#define GF_VKEY_6 54
+#define GF_VKEY_7 55
+#define GF_VKEY_8 56
+#define GF_VKEY_9 57
+#define GF_VKEY_STAR 42
+#define GF_VKEY_POUND 35
+
+#elif NVOS_IS_WINDOWS
+/* Virtual Keys */
+#define GF_VKEY_BACK 27
+#define GF_VKEY_FORWARD 13
+#define GF_VKEY_UP 72
+#define GF_VKEY_LEFT 75
+#define GF_VKEY_RIGHT 77
+#define GF_VKEY_DOWN 80
+#define GF_VKEY_SEND 46
+#define GF_VKEY_END 44
+#define GF_VKEY_0 48
+#define GF_VKEY_1 49
+#define GF_VKEY_2 50
+#define GF_VKEY_3 51
+#define GF_VKEY_4 52
+#define GF_VKEY_5 53
+#define GF_VKEY_6 54
+#define GF_VKEY_7 55
+#define GF_VKEY_8 56
+#define GF_VKEY_9 57
+#define GF_VKEY_STAR 42
+#define GF_VKEY_POUND 35
+
+#else
+
+/* Virtual Keys */
+#define GF_VKEY_BACK 2
+#define GF_VKEY_FORWARD 3
+#define GF_VKEY_UP 4
+#define GF_VKEY_LEFT 5
+#define GF_VKEY_RIGHT 6
+#define GF_VKEY_DOWN 7
+#define GF_VKEY_SEND 8
+#define GF_VKEY_END 9
+#define GF_VKEY_0 10
+#define GF_VKEY_1 11
+#define GF_VKEY_2 12
+#define GF_VKEY_3 13
+#define GF_VKEY_4 14
+#define GF_VKEY_5 15
+#define GF_VKEY_6 16
+#define GF_VKEY_7 17
+#define GF_VKEY_8 18
+#define GF_VKEY_9 19
+#define GF_VKEY_STAR 20
+#define GF_VKEY_POUND 21
+
+#endif /* GF_OS */
+
+#ifndef GFDEBUG_ASSERT
+#define GFDEBUG_ASSERT(x) do {} while (0)
+#endif /* GFDEBUG_ASSERT */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __GFRMHelp_INL__ */
+
diff --git a/Start_WM/test6/inc/GFRmHelp.inl b/Start_WM/test6/inc/GFRmHelp.inl
new file mode 100755
index 00000000..4612fce2
--- /dev/null
+++ b/Start_WM/test6/inc/GFRmHelp.inl
@@ -0,0 +1,626 @@
+/*
+ * Copyright 2003 NVIDIA Corporation. All Rights Reserved.
+ *
+ * BY INSTALLING THE SOFTWARE THE USER AGREES TO THE TERMS BELOW.
+ *
+ * User agrees to use the software under carefully controlled conditions
+ * and to inform all employees and contractors who have access to the software
+ * that the source code of the software is confidential and proprietary
+ * information of NVIDIA and is licensed to user as such. User acknowledges
+ * and agrees that protection of the source code is essential and user shall
+ * retain the source code in strict confidence. User shall restrict access to
+ * the source code of the software to those employees and contractors of user
+ * who have agreed to be bound by a confidentiality obligation which
+ * incorporates the protections and restrictions substantially set forth
+ * herein, and who have a need to access the source code in order to carry out
+ * the business purpose between NVIDIA and user. The software provided
+ * herewith to user may only be used so long as the software is used solely
+ * with NVIDIA products and no other third party products (hardware or
+ * software). The software must carry the NVIDIA copyright notice shown
+ * above. User must not disclose, copy, duplicate, reproduce, modify,
+ * publicly display, create derivative works of the software other than as
+ * expressly authorized herein. User must not under any circumstances,
+ * distribute or in any way disseminate the information contained in the
+ * source code and/or the source code itself to third parties except as
+ * expressly agreed to by NVIDIA. In the event that user discovers any bugs
+ * in the software, such bugs must be reported to NVIDIA and any fixes may be
+ * inserted into the source code of the software by NVIDIA only. User shall
+ * not modify the source code of the software in any way. User shall be fully
+ * responsible for the conduct of all of its employees, contractors and
+ * representatives who may in any way violate these restrictions.
+ *
+ * NO WARRANTY
+ * THE ACCOMPANYING SOFTWARE (INCLUDING OBJECT AND SOURCE CODE) PROVIDED BY
+ * NVIDIA TO USER IS PROVIDED "AS IS." NVIDIA DISCLAIMS ALL WARRANTIES,
+ * EXPRESS, IMPLIED OR STATUTORY, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ * WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT.
+
+ * LIMITATION OF LIABILITY
+ * NVIDIA SHALL NOT BE LIABLE TO USER, USERS CUSTOMERS, OR ANY OTHER PERSON
+ * OR ENTITY CLAIMING THROUGH OR UNDER USER FOR ANY LOSS OF PROFITS, INCOME,
+ * SAVINGS, OR ANY OTHER CONSEQUENTIAL, INCIDENTAL, SPECIAL, PUNITIVE, DIRECT
+ * OR INDIRECT DAMAGES (WHETHER IN AN ACTION IN CONTRACT, TORT OR BASED ON A
+ * WARRANTY), EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGES. THESE LIMITATIONS SHALL APPLY NOTWITHSTANDING ANY FAILURE OF THE
+ * ESSENTIAL PURPOSE OF ANY LIMITED REMEDY. IN NO EVENT SHALL NVIDIAS
+ * AGGREGATE LIABILITY TO USER OR ANY OTHER PERSON OR ENTITY CLAIMING THROUGH
+ * OR UNDER USER EXCEED THE AMOUNT OF MONEY ACTUALLY PAID BY USER TO NVIDIA
+ * FOR THE SOFTWARE PROVIDED HEREWITH.
+ */
+
+/*
+ * File: GFRmHelp.inl
+ * GFSDK Resource Manager Helper Manager inline header file.
+ * #### The helper functions are highly dependent on Operating System ####
+ * #### and Compiler. A number of these functions are macros that ####
+ * #### maps to corresonding operating system functions directly. ####
+ */
+
+#ifndef __GFRMHelp_INL__
+#define __GFRMHelp_INL__
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+/*
+ * Define the macro GFRMHELP_IMPORTFUNC to import the helper functions
+ * referenced in GFSDK. Typically Target OS provides definitions for these
+ * functions. Sample definitions are provided in file RMHelpGeneric.c.
+ */
+
+#if defined(GFRMHELP_ABSTRACTION)
+extern char GFAToupper(char);
+extern char GFATolower(char);
+
+extern void *GFMalloc(int);
+extern void GFFree(void *ptr);
+
+extern void *GFMemcpy(void *, const void *, int);
+extern void *GFMemmove(void *, const void *, int);
+extern void *GFMemset(void *, int, int);
+extern int GFMemcmp(void *, void *, int);
+
+extern char *GFAStrcpy(char *, const char *);
+extern char *GFAStrncpy(char *, const char *, int);
+
+extern char *GFAStrcat(char *, const char *);
+extern char *GFAStrncat(char *, const char *, int);
+
+extern char *GFAStrstr(const char * string1, const char * string2);
+extern int GFASscanf(char * string1, const char * string2, ...);
+
+extern int GFAStrlen(const char *);
+
+extern char *GFAStrchr(const char *,int);
+
+extern int GFAStrcmp(const char *, const char *);
+extern int GFAStrncmp(const char *, const char *, int);
+
+extern char *GFAStrtok(char *, const char *);
+
+extern long GFAStrtol(const char *, char **, int);
+extern double GFAStrtod(const char *, char **);
+
+extern int GFAPrintf(const char *, ... );
+
+#if defined(GF_ENABLE_RMC_TRACE)
+void GFRmRMCTrace(const char *printf_format, ...);
+#define GFRMCTrace(a) GFRmRMCTrace a
+#else
+#define GFRMCTrace(a)
+#endif
+
+#else
+
+/* Defined in GFRMHelp.c */
+extern int GFAStricmp(char *, char *);
+extern int GFAStrincmp(char *, char *, int);
+
+
+#if defined(NV_WINDOWS_CE)
+
+#ifndef __KERNEL__
+#include
+#include
+#include
+#endif // __KERNEL__
+
+/* String Helper functions */
+#define GFAStrcpy(p1, p2) strcpy(p1, p2)
+#define GFAStrncpy(p1, p2, p3) strncpy(p1, p2, p3)
+#define GFAStrcat(p1, p2) strcat(p1, p2)
+#define GFAStrncat(p1, p2, p3) strncat(p1, p2, p3)
+#define GFAStrlen(p1) strlen(p1)
+#define GFAStrchr(p1, p2) strchr(p1, p2)
+#define GFAStrcmp(p1, p2) strcmp(p1, p2)
+#define GFAStrncmp(p1, p2, p3) strncmp(p1, p2, p3)
+#define GFAStrtok(p1, p2) strtok(p1, p2)
+#define GFAStrstr(p1, p2) strstr(p1, p2)
+#define GFASscanf(p1, p2, p3) sscanf(p1, p2, p3)
+#define GFAToupper(p1) toupper(p1)
+#define GFATolower(p1) tolower(p1)
+#define GFAAtoi(p1) atoi(p1)
+
+// convert char string to wchar_t
+// p1 = src string of type char
+// p2 = dst string of type wchar_t
+// p3 = size of dst string in wchar_t unit
+#define GFAStrConvert(p1, p2, p3) \
+ MultiByteToWideChar(CP_ACP, 0, p1, -1, p2, p3);
+
+// convert wchar_t string to char
+// p1 = src string of type wchar_t
+// p2 = dst string of type char
+// p3 = size of dst string in char unit
+#define GFWStrConvert(p1, p2, p3) \
+ WideCharToMultiByte(CP_ACP, 0, p1, -1, p2, p3, NULL, NULL)
+
+/* Standard Helper functions */
+#define GFAStrtol(p1, p2, p3) strtol(p1, p2, p3)
+#define GFAStrtod(p1, p2) strtod(p1, p2)
+
+/* Memory Helper functions */
+#define GFMalloc( p1 ) malloc( p1 )
+#define GFFree( p1 ) free( p1 )
+#define GFMemcpy( p1, p2, p3 ) memcpy( p1, p2, p3 )
+#define GFMemmove( p1, p2, p3 ) memmove( p1, p2, p3 )
+#define GFMemcmp( p1, p2, p3 ) memcmp( p1, p2, p3 )
+#define GFMemset( p1, p2, p3 ) memset( p1, p2, p3 )
+
+#if defined(GF_ENABLE_RMC_TRACE)
+void GFRmRMCTrace(const char *printf_format, ...);
+void GFRmRMCVTrace(const char *printf_format, va_list ap);
+#define GFRMCTrace(a) GFRmRMCTrace a
+#define GFRMCVTrace(a) GFRmRMCVTrace a
+#else
+#define GFRMCTrace(a)
+#define GFRMCVTrace(a)
+#endif
+
+/* Debug Helper functions */
+#define GFAPrintf printf
+#define GFASprintf sprintf
+#define GFASprintfVAL vsprintf
+#define GFAPrintfVAL vprintf
+
+#ifdef DEBUG
+extern void RmDebugBreak(void);
+#define GFDEBUG_ASSERT(x) if(!(x)) \
+ { \
+ GFPrintf(" Assert at Line no: %d in %s ", \
+ __LINE__, __FILE__); \
+ RmDebugBreak(); \
+ }
+#endif
+
+#elif defined(NV_LINUX)
+
+#ifndef __KERNEL__
+#ifdef DEBUG
+#include
+#define GFDEBUG_ASSERT(x) assert(x)
+#endif
+
+
+#define __declspec(x)
+
+#include
+#define GFMalloc malloc
+#define GFFree free
+
+#include
+#define GFAToupper toupper
+#define GFATolower tolower
+
+#include
+#ifndef GF_XTENSA_RM_TASK
+#include
+#endif
+#define GFMemcpy memcpy
+#define GFMemmove memmove
+#define GFMemset memset
+#define GFMemcmp memcmp
+#define GFAStrcmp strcmp
+#define GFAStrcpy strcpy
+#define GFAStrncpy strncpy
+#define GFAStrlen strlen
+#define GFAStrcat strcat
+#define GFAStrncmp strncmp
+#define GFAStrtok strtok
+#define GFAStrstr strstr
+#define GFASscanf sscanf
+
+#include
+#define GFAPrintf printf
+#define GFASprintf sprintf
+#define GFASprintfVAL vsprintf
+#define GFAPrintf printf
+#define GFASprintf sprintf
+#define GFASprintfVAL vsprintf
+#define GFAPrintfVAL vprintf
+
+#include
+#define GFAStrtol strtol
+#define GFAStrtod strtod
+#define GFAAtoi atoi
+#include
+
+/* Add or overload RMCTrace function here */
+#if defined(GF_ENABLE_RMC_TRACE)
+#include
+void GFRmRMCTrace(const char *printf_format, ...);
+void GFRmRMCVTrace(const char *printf_format, va_list ap);
+#define GFRMCTrace(a) GFRmRMCTrace a
+#define GFRMCVTrace(a) GFRmRMCVTrace a
+#else
+#define GFRMCTrace(a)
+#define GFRMCVTrace(a)
+#endif
+
+#else /* kernel mode */
+
+#include
+#include
+#define GFMalloc(x) kmalloc((x), GFP_KERNEL)
+#define GFFree kfree
+
+#include
+#define GFAToupper toupper
+#define GFATolower tolower
+
+#include
+#define GFMemcpy memcpy
+#define GFMemmove memmove
+#define GFMemset memset
+#define GFAStrcpy strcpy
+#define GFAStrncpy strncpy
+#define GFAStrlen strlen
+#define GFMemcmp memcmp
+#define GFAStrcmp strcmp
+#define GFAStrncmp strncmp
+#define GFAStrcat strcat
+#define GFAStrncat strncat
+
+#define GFAStrstr strstr
+#define GFASscanf sscanf
+
+#define GFAPrintf printk
+#define GFASprintf sprintf
+#define GFASprintfVAL vsprintf
+#define GFAPrintfVAL vprintf
+#define GFAAtoi atoi
+
+#if defined(GF_ENABLE_RMC_TRACE)
+#include
+void GFRmRMCTrace(const char *printf_format, ...);
+void GFRmRMCVTrace(const char *printf_format, va_list ap);
+#define GFRMCTrace(a) GFRmRMCTrace a
+#define GFRMCVTrace(a) GFRmRMCVTrace a
+#else
+#define GFRMCTrace(a)
+#define GFRMCVTrace(a)
+#endif
+
+#endif /* KERNEL */
+
+#elif defined(NV_WINDOWS)
+
+#include
+#include
+#include
+#include
+#include
+#include
+
+/* String functions */
+#define GFAStrcpy(p1, p2) strcpy(p1, p2)
+#define GFAStrncpy(p1, p2, p3) strncpy(p1, p2, p3)
+#define GFAStrcat(p1, p2) strcat(p1, p2)
+#define GFAStrncat(p1, p2, p3) strncat(p1, p2, p3)
+#define GFAStrstr(p1, p2) strstr(p1, p2)
+#define GFASscanf(p1, p2, p3) sscanf(p1, p2, p3)
+#define GFAStrlen(p1) strlen(p1)
+#define GFAStrchr(p1, p2) strchr(p1, p2)
+#define GFAStrcmp(p1, p2) strcmp(p1, p2)
+#define GFAStrncmp(p1, p2, p3) strncmp(p1, p2, p3)
+#define GFAStrtok(p1, p2) strtok(p1, p2)
+#define GFAToupper(p1) toupper(p1)
+#define GFATolower(p1) tolower(p1)
+#define GFAStrConvert(p1, p2, p3) \
+ strcpy(p2,p1)
+// MultiByteToWideChar( CP_ACP, 0, p1, -1, p2, p3 );
+ // convert char string to Wide
+ // p1 = src string of type char
+ // p2 = dst string of type wchar_t
+ // p3 = size of dst string in wchar_t unit
+
+/* Standard Helper functions */
+#define GFAStrtol(p1, p2, p3) strtol(p1, p2, p3)
+#define GFAStrtod(p1, p2) strtod(p1, p2)
+
+/* Memory Helper functions */
+#define GFMalloc( p1 ) malloc( p1 )
+#define GFFree( p1 ) free( p1 )
+#define GFMemcpy( p1, p2, p3 ) memcpy( p1, p2, p3 )
+#define GFMemmove( p1, p2, p3 ) memmove( p1, p2, p3 )
+#define GFMemcmp( p1, p2, p3 ) memcmp( p1, p2, p3 )
+#define GFMemset( p1, p2, p3 ) memset( p1, p2, p3 )
+
+#define GFAAtoi( p1 ) atoi( p1 )
+/* Debug Helper functions */
+#define GFAPrintf printf
+#define GFASprintf sprintf
+#define GFASprintfVAL vsprintf
+#define GFAPrintfVAL vprintf
+
+#if defined(GF_ENABLE_RMC_TRACE)
+void GFRmRMCTrace(const char *printf_format, ...);
+void GFRmRMCVTrace(const char *printf_format, va_list ap);
+#define GFRMCTrace(a) GFRmRMCTrace a
+#define GFRMCVTrace(a) GFRmRMCVTrace a
+#else
+#define GFRMCTrace(a)
+#define GFRMCVTrace(a)
+#endif
+
+#ifdef DEBUG
+#include "assert.h"
+#define GFDEBUG_ASSERT( x ) assert( x )
+#endif
+
+// Operating system running on the Xtensa
+#elif defined(NVCPU_XTENSA)
+
+#include
+
+#define GFAAtoi(p1)
+/* String functions */
+#define GFAStrcpy(p1, p2) strcpy(p1, p2)
+#define GFAStrncpy(p1, p2, p3)
+#define GFAStrcat(p1, p2)
+#define GFAStrncat(p1, p2, p3)
+#define GFAStrlen(p1)
+#define GFAStrchr(p1, p2)
+#define GFAStrcmp(p1, p2)
+#define GFAStrncmp(p1, p2, p3)
+
+#define GFAStrstr(p1, p2)
+#define GFASscanf(p1, p2, p3)
+
+#define GFAStrncmp(p1, p2, p3)
+#define GFAStrtok(p1, p2)
+#define GFAToupper(p1)
+#define GFATolower(p1)
+#define GFAStrConvert(p1, p2, p3)
+#define GFAAtoi(p1)
+
+/* Standard Helper functions */
+#define GFAStrtol(p1, p2, p3)
+#define GFAStrtod(p1, p2)
+
+/* Memory Helper functions */
+#define GFMalloc( p1 )
+#define GFFree( p1 )
+#define GFMemcpy( p1, p2, p3 ) memcpy(p1, p2, p3)
+#define GFMemmove( p1, p2, p3 ) memmove(p1, p2, p3)
+#define GFMemcmp( p1, p2, p3 ) memcmp(p1, p2, p3)
+#define GFMemset( p1, p2, p3 ) memset(p1, p2, p3)
+
+/* Debug Helper functions */
+#define GFAPrintf
+#define GFASprintf
+#define GFASprintfVAL
+#define GFAPrintfVAL
+
+#define GFRMCTrace(a)
+#define GFRMCVTrace(a)
+
+#else
+
+#include
+#include
+#include
+#include
+#include
+
+/* String functions */
+extern char GFAToupper(char);
+extern char GFATolower(char);
+
+extern int GFAAtoi(const char *);
+//#define GFMalloc( p1 ) malloc( p1 )
+//#define GFFree( p1 ) free( p1 )
+extern void *GFMalloc(int);
+extern void GFFree(void *);
+
+extern void *GFMemcpy(void *, const void *, int);
+extern void *GFMemmove(void *, const void *, int);
+extern void *GFMemset(void *, int, int);
+extern int GFMemcmp(void *, void *, int);
+
+extern char *GFAStrcpy(char *, const char *);
+extern char *GFAStrncpy(char *, const char *, int);
+
+extern char *GFAStrcat(char *, const char *);
+extern char *GFAStrncat(char *, const char *, int);
+
+extern int GFAStrlen(const char *);
+
+extern char *GFAStrchr(const char *,int);
+extern char *GFAStrrchr(const char *,int);
+
+extern int GFAStrcmp(const char *, const char *);
+extern int GFAStrncmp(const char *, const char *, int);
+
+extern char *GFAStrstr(const char * string1, const char * string2);
+extern int GFASscanf(char * string1, const char * string2, ...);
+
+extern char *GFAStrtok(char *, const char *);
+
+extern long GFAStrtol(const char *, char **, int);
+extern double GFAStrtod(const char *, char **);
+
+extern int GFAPrintf(const char *, ... );
+extern int GFASprintf(char * , const char *, ... );
+extern int GFASprintfVAL(char *, const char *, va_list);
+extern int GFAPrintfVAL(const char *, va_list);
+
+#define GFAStrConvert(p1, p2, p3) GFAStrncpy(p1, p2, p3)
+
+#if defined(GF_ENABLE_RMC_TRACE)
+#define GFRMCTrace(a) printf a
+#define GFRMCVTrace(a) vprintf a
+#else
+#define GFRMCTrace(a)
+#define GFRMCVTrace(a)
+#endif
+
+#ifdef DEBUG
+#define GFDEBUG_ASSERT(x) if(!(x)) \
+ { \
+ GFPrintf(" Assert at Line no: %d in %s ", \
+ __LINE__, __FILE__); \
+ }
+#endif
+
+#endif /* GF_OS */
+
+#endif /* GFRMHELP_ABSTRACTION */
+
+
+#define GFStrcpy GFAStrcpy
+#define GFStrncpy GFAStrncpy
+#define GFStrcat GFAStrcat
+#define GFStrncat GFAStrncat
+#define GFStrlen GFAStrlen
+#define GFStrchr GFAStrchr
+#define GFStrrchr GFAStrrchr
+#define GFStrstr GFAStrstr
+#define GFStrcmp GFAStrcmp
+#define GFStricmp GFAStricmp
+#define GFStrincmp GFAStrincmp
+#define GFStrncmp GFAStrncmp
+#define GFStrtok GFAStrtok
+#define GFToupper GFAToupper
+#define GFTolower GFATolower
+#define GFStrConvert GFAStrConvert
+#define GFPrintf GFAPrintf
+#define GFSprintf GFASprintf
+#define GFSprintfVAL GFASprintfVAL
+#define GFPrintfVAL GFAPrintfVAL
+#define GFStrtol GFAStrtol
+#define GFStrtod GFAStrtod
+#define GFSscanf GFASscanf
+#define GFAtoi GFAAtoi
+
+
+/* Virtual Key Mappings for Specific OS */
+#if defined(NV_LINUX)
+/* Virtual Keys */
+#define GF_VKEY_BACK 27
+#define GF_VKEY_FORWARD 13
+#define GF_VKEY_UP 65
+#define GF_VKEY_LEFT 68
+#define GF_VKEY_RIGHT 67
+#define GF_VKEY_DOWN 66
+#define GF_VKEY_SEND 46
+#define GF_VKEY_END 44
+#define GF_VKEY_0 48
+#define GF_VKEY_1 49
+#define GF_VKEY_2 50
+#define GF_VKEY_3 51
+#define GF_VKEY_4 52
+#define GF_VKEY_5 53
+#define GF_VKEY_6 54
+#define GF_VKEY_7 55
+#define GF_VKEY_8 56
+#define GF_VKEY_9 57
+#define GF_VKEY_STAR 42
+#define GF_VKEY_POUND 35
+
+#elif defined(NV_WINDOWS_CE)
+
+/* Virtual Keys */
+#define GF_VKEY_BACK 27
+#define GF_VKEY_FORWARD 13
+#define GF_VKEY_UP 72
+#define GF_VKEY_LEFT 75
+#define GF_VKEY_RIGHT 77
+#define GF_VKEY_DOWN 80
+#define GF_VKEY_SEND 46
+#define GF_VKEY_END 44
+#define GF_VKEY_0 48
+#define GF_VKEY_1 49
+#define GF_VKEY_2 50
+#define GF_VKEY_3 51
+#define GF_VKEY_4 52
+#define GF_VKEY_5 53
+#define GF_VKEY_6 54
+#define GF_VKEY_7 55
+#define GF_VKEY_8 56
+#define GF_VKEY_9 57
+#define GF_VKEY_STAR 42
+#define GF_VKEY_POUND 35
+
+#elif defined(NV_WINDOWS)
+/* Virtual Keys */
+#define GF_VKEY_BACK 27
+#define GF_VKEY_FORWARD 13
+#define GF_VKEY_UP 72
+#define GF_VKEY_LEFT 75
+#define GF_VKEY_RIGHT 77
+#define GF_VKEY_DOWN 80
+#define GF_VKEY_SEND 46
+#define GF_VKEY_END 44
+#define GF_VKEY_0 48
+#define GF_VKEY_1 49
+#define GF_VKEY_2 50
+#define GF_VKEY_3 51
+#define GF_VKEY_4 52
+#define GF_VKEY_5 53
+#define GF_VKEY_6 54
+#define GF_VKEY_7 55
+#define GF_VKEY_8 56
+#define GF_VKEY_9 57
+#define GF_VKEY_STAR 42
+#define GF_VKEY_POUND 35
+
+#else
+
+/* Virtual Keys */
+#define GF_VKEY_BACK 2
+#define GF_VKEY_FORWARD 3
+#define GF_VKEY_UP 4
+#define GF_VKEY_LEFT 5
+#define GF_VKEY_RIGHT 6
+#define GF_VKEY_DOWN 7
+#define GF_VKEY_SEND 8
+#define GF_VKEY_END 9
+#define GF_VKEY_0 10
+#define GF_VKEY_1 11
+#define GF_VKEY_2 12
+#define GF_VKEY_3 13
+#define GF_VKEY_4 14
+#define GF_VKEY_5 15
+#define GF_VKEY_6 16
+#define GF_VKEY_7 17
+#define GF_VKEY_8 18
+#define GF_VKEY_9 19
+#define GF_VKEY_STAR 20
+#define GF_VKEY_POUND 21
+
+#endif /* GF_OS */
+
+#ifndef GFDEBUG_ASSERT
+#define GFDEBUG_ASSERT(x) do {} while (0)
+#endif /* GFDEBUG_ASSERT */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __GFRMHelp_INL__ */
+
diff --git a/Start_WM/test6/inc/GFRmIx.h b/Start_WM/test6/inc/GFRmIx.h
new file mode 100755
index 00000000..c2dddd0d
--- /dev/null
+++ b/Start_WM/test6/inc/GFRmIx.h
@@ -0,0 +1,654 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/** @file GFRmIx.h
+ Chip Initialization API header file.
+*/
+
+#ifndef __GFRMIX_H__
+#define __GFRMIX_H__
+
+#include "GFRm.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+/** @addtogroup groupRmIx Chip Initialization API
+*/
+/*@{*/
+
+/* GPIO configurations
+ * Host GPIO1~GPIO7 correspond to HGP0~HGP6, C32KHZ.
+ * When configured as output, it is necessay to select output as data or
+ * Clocks or interrupt.
+ * GFIX_GPIO_CFG_OUTPUT can Or with GFIX_GPIO_CFG_OUTPUT_SEL_*
+ */
+
+/* Host GPIO type enum */
+typedef enum
+{
+ GFIX_GPIO0 = 0,
+ GFIX_GPIO1,
+ GFIX_GPIO2,
+ GFIX_GPIO3,
+ GFIX_GPIO4,
+ GFIX_GPIO5,
+ GFIX_GPIO6,
+ GFIX_GPIO7
+} GFIX_GPIO_TYPE;
+
+/* Host GPIO operations. */
+#define GFIX_GPIO_GET_INPUT_ENABLE 0x80000000UL
+#define GFIX_GPIO_GET_OUT_PUT_ENABLE 0x40000000UL
+#define GFIX_GPIO_SET_DATA 0x20000000UL
+#define GFIX_GPIO_CLR_DATA 0x10000000UL
+#define GFIX_GPIO_GET_DATA 0x08000000UL
+
+#define GFIX_GPIO_SET_INPUT_ENABLE 0x04000000UL
+#define GFIX_GPIO_CLR_INPUT_ENABLE 0x02000000UL
+#define GFIX_GPIO_SET_OUTPUT_ENABLE 0x01000000UL
+#define GFIX_GPIO_CLR_OUTPUT_ENABLE 0x00800000UL
+
+/*
+ * GPIO output select data, configure the pin as data output.
+ * Meaningful for pin0~pin4(HGP0~HGP4)
+ */
+
+#define GFIX_GPIO_CFG_OUTPUT_SEL_DATA 0x00000000
+
+/*
+ * GPIO output select interrupt, configure the pin as interrupt output.
+ * Meaningful for pin3(HGP3) only
+ */
+#define GFIX_GPIO_CFG_OUTPUT_SEL_INTR 0x00000040
+
+/*
+ * GPIO output select RDY signal
+ * Meaningful for pin4(HGP4) only
+ */
+#define GFIX_GPIO_CFG_OUTPUT_SEL_RDY 0x00000100
+
+/*
+ * For pin5 and pin6(HGP5, HGP6), config output clock or data on HGP5 and HGP6.
+ *
+ */
+#define GFIX_GPIO_CFG_OUTPUT_SEL_HGP56_CLK 0x00000800
+#define GFIX_GPIO_CFG_OUTPUT_SEL_HGP56_DATA 0x00000000
+
+/*
+ * For pin5(HGP5)
+ * select monitor clock to HGP5
+ */
+#define GFIX_GPIO_CFG_OUTPUT_SEL_HGP5_PLL1 0x00000000
+#define GFIX_GPIO_CFG_OUTPUT_SEL_HGP5_PLL2 0x00001000
+#define GFIX_GPIO_CFG_OUTPUT_SEL_HGP5_PLLCOSC 0x00002000
+#define GFIX_GPIO_CFG_OUTPUT_SEL_HGP5_PLLROSC 0x00003000
+
+/*
+ * For pin6(HGP6)
+ * select monitor clock to HGP6
+ */
+#define GFIX_GPIO_CFG_OUTPUT_SEL_HGP6_PLL2 0x00000000
+#define GFIX_GPIO_CFG_OUTPUT_SEL_HGP6_DCFCLK 0x00004000
+#define GFIX_GPIO_CFG_OUTPUT_SEL_HGP6_MCCLK 0x00008000
+#define GFIX_GPIO_CFG_OUTPUT_SEL_HGP6_DSPCLK 0x0000C000
+
+/*
+ * For pin7(C32KHZ)
+ */
+#define GFIX_GPIO_CFG_OUTPUT_SEL_C32KHZ 0x00000000
+
+/*
+ * Definition of attribute ids for Set/GetAttributes()
+ */
+typedef enum _GFIX_ATTR_TYPE
+ {
+ GFIX_ATTR_NONE = 0,
+ GFIX_ATTR_DEVICE_INFO,
+ GFIX_ATTR_DEVICE_INFO_STRUCT, /* Get Device ID & Rev */
+ GFIX_ATTR_EFUSE_PRODUCT_SKU_ID,
+ GFIX_ATTR_DRAM_SELF_REFRESH,
+ GFIX_ATTR_DRAM_DEEP_POWER_DOWN
+} GFIX_ATTR_TYPE;
+
+/*
+ * Definition of module frequency types.
+ */
+typedef enum _GFIX_MODULEFREQ_TYPE
+ {
+ GFIX_MODULEFREQ_OPTIMAL = 0,
+ GFIX_MODULEFREQ_MINIMUM,
+ GFIX_MODULEFREQ_MAXIMUM,
+ GFIX_MODULEFREQ_REQUESTED,
+ GFIX_MODULEFREQ_ACTUAL
+} GFIX_MODULEFREQ_TYPE;
+
+/*
+ * Definition of module operations.
+ */
+#define GFIX_DISABLECLOCK 0x00000001
+#define GFIX_ENABLECLOCK 0x00000002
+#define GFIX_SPECIAL 0x00000004
+#define GFIX_FORCEDISABLECLOCK 0x00000008
+#define GFIX_FORCEENABLECLOCK 0x00000010
+#define GFIX_DYNAMICSWITCH 0x00000020
+
+#define GFIX_FORCEDISABLEMODULE 0x00010000
+#define GFIX_FORCEENABLEMODULE 0x00020000
+
+/*
+ * Clock selections, profile and options
+ */
+enum
+{
+#define GFRM_CLOCK(x, y) GFIX_##x,
+#define GFRM_CLOCK_PLL(x, y) GFIX_##x,
+#include "gfrm_clock_ids.h"
+#undef GFRM_CLOCK
+#undef GFRM_CLOCK_PLL
+ GFNUMOFCLOCKIDS
+};
+
+enum
+{
+#define GFRM_CLOCK(x, y) (1 << GFIX_##x )|
+#define GFRM_CLOCK_PLL(x, y) (1 << GFIX_##x )|
+ GFIX_ALL_CLOCKS =
+#include "gfrm_clock_ids.h"
+ 0, // | 0 to GFIX_ALL_CLOCKS
+#undef GFRM_CLOCK
+#undef GFRM_CLOCK_PLL
+
+#define GFRM_CLOCK(x, y) (1 << GFIX_##x )|
+#define GFRM_CLOCK_PLL(x, y)
+ GFIX_NO_PLLS =
+#include "gfrm_clock_ids.h"
+ 0, // | 0 to GFIX_NO_PLLS
+#undef GFRM_CLOCK
+#undef GFRM_CLOCK_PLL
+
+#define GFRM_CLOCK(x, y)
+#define GFRM_CLOCK_PLL(x, y) (1 << GFIX_##x )|
+ GFIX_ONLY_PLLS =
+#include "gfrm_clock_ids.h"
+ 0, // | 0 to GFIX_NO_PLLS
+#undef GFRM_CLOCK
+#undef GFRM_CLOCK_PLL
+
+ GFIX_N_CLOCKSOURCES = GFNUMOFCLOCKIDS,
+ GFIX_NO_CLOCK = 0xFFFFFFFF,
+ GFIX_PLL_QUERY = 0x80000000
+};
+
+#define GFIX_POWER 0x00010000
+#define GFIX_PERFORMANCE 0x00020000
+
+#define GFIX_DEFAULTSLK 0x00000000
+#define GFIX_HIGHESTSLK 0x00000001
+
+/** Module clock profile */
+typedef struct _GFIXMODULECONFIG
+{
+ NvU8 clockSelection; /**< Selection mode */
+ NvU32 minFrequency; /**< Lowest frequency allowed */
+ NvU32 optimalFrequency; /**< Optimal frequency */
+ NvU32 maxFrequency; /**< Max frequency */
+ NvU32 sourceClocks; /**< Bitfield of valid source clocks */
+} GFIXMODULECONFIG, *PGFIXMODULECONFIG;
+
+/** Module state */
+ typedef struct _GFIXMODULESTATE
+{
+ NvU32 clkRefCount; /**< Reference counter used in GFRmIxEnableModuleClock */
+ NvU32 clkSelect; /**< Clock selected for module (only valid when clkRefCount is non-zero) */
+ /**< If clkSelect==GFIX_NO_CLOCK no clock is selected by this module */
+ NvU32 enableRefCount; /**< Reference counter used in GFRmIxEnableModule */
+} GFIXMODULESTATE, *PGFIXMODULESTATE;
+
+
+/** typedef for callback when the module is disabled */
+
+typedef GF_RETTYPE (*GF_FUNC_RMIX_CALLBACK)(void *handle);
+
+/** Initializes the chip
+
+ @param RmHandle (#GFRmHandle) Handle specific to the GFRm
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ GFRmIxInit() is the first function which touches the hardware, there are no
+ hardware accesses before GFRmIxInit(). It initializes some module's clocks
+ and as well as taking some modules out of reset. It also initializes
+ device-control registers.
+
+ @see GFRmIxDeInit()
+*/
+GF_RETTYPE
+GFRmIxInit( GFRmHandle RmHandle );
+
+/** De-initializes the chip
+
+ @param RmHandle (#GFRmHandle) Handle specific to the GFRm
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ GFRmIxDeInit() does the reverse of GFRmIxInit(), it shut downs the chip.
+ All modules are put back in reset and clocks turned off.
+
+ @see GFRmIxInit()
+*/
+GF_RETTYPE
+GFRmIxDeInit( GFRmHandle RmHandle );
+
+/** This function enables a module's clock
+
+ @param RmHandle (#GFRmHandle) Handle specific to the GFRm
+ @param modid (#eGFModuleIDs) ID of the module
+ @param option (NvU32) Bit field of options, GFIX_ENABLECLOCK,
+ GFIX_DISABLECLOCK, GFIX_FORCEENABLECLOCK,
+ GFIX_FORCEDISABLECLOCK, GFIX_DYNAMICSWITCH, GFIX_SPECIAL
+ @param special (NvU32) Specifies a module specific setting, only used when
+ option contains GFIX_SPECIAL
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ This function enables and disables a module's clock as well as enables the
+ module's source clock. There are two types of enables, the normal enable
+ and the force enable. When doing a normal enable the module's clock enable
+ reference count is increased as well as a call to GFRmIxEnableClockSource()
+ which ensures the module's source clock is enabled. When doing a force
+ enable/disable the modules reference counter is not touched,
+ GFRmIxEnableClockSource() is called which increases/deceases the source's
+ reference count. If the operation is to enable and the clock is currently
+ disabled, for the both normal enable and force disable GFRmIxEnableModuleClock
+ will attempt to find the best clock source and divider for the module.
+
+ Some modules support a dynamic clock divider, that is the clock doesn't have
+ to be turned off before reprogramming the divider. To switch a module's
+ frequency that supports dynamic dividers without first turning the module
+ off set option to GFIX_DYNAMICSWITCH. GFRmIxEnableModuleClock will attempt
+ to find the closest frequency to the desired without changing clock sources.
+
+ Some modules have special clock configurations such as VI, GFIX_SPECIAL can
+ be specified along with GFIX_ENABLECLOCK or by itself to configure the special
+ option for the module.
+*/
+GF_RETTYPE
+GFRmIxEnableModuleClock( GFRmHandle RmHandle,
+ eGFModuleIDs modid,
+ NvU32 option,
+ NvU32 special );
+
+/** Same as GFRmIxEnableModuleClock, but takes a callback
+ function which will be called when the refcount goes
+ to zero.
+
+ @param func Callback funtion of type GFRmIxEnableModuleClock
+ @param arg used as an argument to when callback function is called.
+
+ @see GFRmIxEnableModuleClock()
+*/
+GF_RETTYPE
+GFRmIxEnableModuleClockEx( GFRmHandle RmHandle,
+ eGFModuleIDs modid,
+ NvU32 option,
+ NvU32 special,
+ GF_FUNC_RMIX_CALLBACK func,
+ void *arg);
+
+/** Enables a module
+
+ @param RmHandle (#GFRmHandle) Handle specific to the GFRm
+ @param modid (#eGFModuleIDs) ID of the module
+ @param option (NvU32) If option is nonzero the module will be enabled
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ This function takes a module out of reset. Each module has a reference
+ count which is used to keep track of how many outstanding enables the
+ module has. The module will not be disabled until the reference counter
+ is returned to zero.
+*/
+GF_RETTYPE
+GFRmIxEnableModule( GFRmHandle RmHandle,
+ eGFModuleIDs modid,
+ NvU32 option );
+
+/** Same as GFRmIxEnableModule() but calls the passing in callback
+ function when the refcount of the module goes to zero.
+
+ @param callback Callback function of type GF_FUNC_RMIX_CALLBACK
+ @param arg Argument passed to the callback function.
+
+ @see GFRmIxEnableModule()
+*/
+GF_RETTYPE
+GFRmIxEnableModuleEx( GFRmHandle RmHandle,
+ eGFModuleIDs modid,
+ NvU32 option,
+ GF_FUNC_RMIX_CALLBACK callback,
+ void *arg
+ );
+
+/** Changes frequency of a clock.
+
+ @param RmHandle (#GFRmHandle) Handle specific to the GFRm
+ @param option (NvU32) GFIX_PLL1, GFIX_PLL2, GFIX_ROSC, GFIX_OSC,
+ GFIX_REFCLK0, GFIX_REFCLK1 or GFIX_PLL_QUERY
+ @param pFrequency (NvU32*) Pointer to 32-bit value in KHz to get three
+ digit MHz precision. Returns with newly set
+ current frequency.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+ @retval #GF_ERROR_BAD_PARAMETER Bad parameter passed
+
+ This function sets a clock to a certain frequency. If the clock cannot meet
+ the requested frequency then the closest one will be chosen. For the PLLs
+ this function determines the closest dividers to arrive at the requested
+ frequency. To determine the frequency that will be chosen without actually
+ setting it GFIX_PLL_QUERY can be Or'ed along with the clock ID.
+
+ Some clocks only have one frequency that never changes; this function must
+ still be called at least once to allow the internal logic to know what the
+ frequency of the clock is. To disable the selection of a clock by a module,
+ a clock can be disabled by setting its frequency to zero; this will remove
+ it from consideration for all modules.
+
+ This function will fail if a module is already using the clock.
+
+ @see GFRmIxGetFrequency()
+*/
+GF_RETTYPE
+GFRmIxSetFrequency( GFRmHandle RmHandle,
+ NvU32 option,
+ NvU32 *pFrequency );
+
+/** Retrieves frequency of a clock.
+
+ @param RmHandle (#GFRmHandle) Handle specific to the GFRm
+ @param option (NvU32) GFIX_PLL1, GFIX_PLL2, GFIX_ROSC, GFIX_OSC,
+ GFIX_REFCLK0, GFIX_REFCLK1
+ @param pFrequency (NvU32*) Pointer to 32-bit value in KHz to get three
+ digit MHz precision. Returns with currently
+ set frequency.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+ @retval #GF_ERROR_BAD_PARAMETER Bad parameter passed
+
+ @see GFRmIxSetFrequency()
+*/
+GF_RETTYPE
+GFRmIxGetFrequency( GFRmHandle RmHandle,
+ NvU32 option,
+ NvU32 *pFrequency );
+
+/** Sets the requested frequency of the module.
+
+ @param RmHandle (#GFRmHandle) Handle specific to the GFRm
+ @param modid (#eGFModuleIDs) ID of the module
+ @param frequency (NvU32) 32-bit value in KHz to get three digit MHz
+ precision
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ This function sets the requested frequency of a module, this value must
+ lie between the minimum and maximum frequencies specified in
+ GFRmIxSetModuleConfig(). This value is cached and used when
+ GFRmIxEnableModuleClock() is called attempting to enable the clock to the
+ module.
+
+ @see GFRmIxSetModuleConfig()
+*/
+GF_RETTYPE
+GFRmIxSetModuleFrequency( GFRmHandle RmHandle,
+ eGFModuleIDs modid,
+ NvU32 frequency );
+
+/** This function is used to retrieve clock frequency information about a module.
+
+ @param RmHandle (#GFRmHandle) Handle specific to the GFRm
+ @param modid (#eGFModuleIDs) ID of the module
+ @param type (#GFIX_MODULEFREQ_TYPE) Type of frequency
+ @param pFrequency (NvU32*) Pointer to 32-bit value in KHz to get three digit
+ MHz precision. Returns with currently frequency.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+*/
+GF_RETTYPE
+GFRmIxGetModuleFrequency( GFRmHandle RmHandle,
+ eGFModuleIDs modid,
+ GFIX_MODULEFREQ_TYPE type,
+ NvU32 *pFrequency );
+
+/** This function enables and disables power plane(s).
+
+ @param RmHandle (#GFRmHandle) Handle specific to the GFRm
+ @param ppID (NvU32) ID of power plane (More then one can be Or'ed to perform
+ operation in parallel)
+ @param operation (#GFIX_POWERPLANE_OP_TYPE) Operation to perform on the
+ power planes
+ @param states (NvU32*) Ptr to 32 bit value to store the resulting bit
+ field of a GFIX_POWERPLANE_OP_QUERY operation.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+ @retval #GF_ERROR_BAD_PARAMETER Bad parameter passed
+
+ This function enables and disables power plane(s), multiple power planes can
+ be disabled in one function call. There is two versions of this functions
+ specified with the compilation flag GF_EXTERNAL_POWERPLANE_LOGIC. If this
+ flag is set to 1 then all the power plane logic is done in the platform code,
+ if 0 then all the logic is done in Ix.
+
+ When internal power plane logic is chosen, each power plane has a reference
+ count. If the power plane is to be enabled or disabled, GFRmIxPowerPlane()
+ will call out to RmPowerPlane(), which will perform platform specific enabling.
+*/
+GF_RETTYPE
+GFRmIxPowerPlane( GFRmHandle RmHandle,
+ NvU32 ppID,
+ GFIX_POWERPLANE_OP_TYPE operation,
+ NvU32 *states );
+
+/** Enable and disables clock sources.
+
+ @param RmHandle (#GFRmHandle) Handle specific to the GFRm
+ @param clockid (NvU32) ID of the clock
+ @param state (NvU32) 0 for disable, 1 for enable
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ This function enables and disables a clock's source. A reference counter is
+ used to ensure the clock's source won't be disabled until there is a matching
+ number of enable and disable operations. If a clocks source is to be enabled
+ or disabled, GFRmIxEnableClockSource() will call out to RmEnableClockSource()
+ to do the platform specific enabling or disabling.
+*/
+GF_RETTYPE
+GFRmIxEnableClockSource( GFRmHandle RmHandle,
+ NvU32 clockid,
+ NvU32 state );
+
+/** This function sets the list of reference clocks that a PLL may choose.
+
+ @param RmHandle (#GFRmHandle) Handle specific to the GFRm
+ @param option (NvU32) GFIX_PLL1, GFIX_PLL2
+ @param clocks (NvU32) Bitfield of clocks. (1<
+
+ 0 -> audio structs can be locate anywhere, dspcore will be allocated anywhere (default)
+ 1 -> audio structs must be allocated in internal SRAM, dspcore will be allocated anywhere
+ 0xMM -> MM is a 8 bit wide bitmask: b'10XXYYZZ (i.e. 0x80 | b'XXYYZZ)
+
+ XX controls allocation of dspcore DSP image (about 100 kB)
+ YY to control allocation of GfSgl (about 90 kB, not required for encoding=ADTSINTERNAL)
+ ZZ controls allocation of GfGlobalParameters struct (about 36 kB)
+
+ bitmask meaning:
+ b'00 no special requirement
+ b'01 force internal SRAM
+ b'10 force external SRAM
+ b'11 unused
+
+ */
+
+ NvU32 AudioRecordEnable; //!< GFSDK_AUDIO_REC_ENABLE, Enable SC15 I2S Record, default : 0
+ NvU32 AudioNoI2C; //!< Disable codec I2C access in GFAudioAPI
+ char I2SCodecInit[RM_ENV_MAXLEN]; //!< Codec init addr/data sequence comma delimited zero padded 32 bit hex values "xxxxxxxx,xxxxxxxx,..." up to 128 chars
+ char I2SCodecReset[RM_ENV_MAXLEN]; //!< Codec reset addr/data sequence comma delimited zero padded 32 bit hex values "xxxxxxxx,xxxxxxxx,..." up to 128 chars
+ //!< I2S "aaaaddrr" aaaa - i2s slave address, dd - 8 bit data, rr 7 bit i2s register
+ //!< AC97 "aaaadddd" aaaa - ac97 register address, dddd - 16 bit data value
+ NvU32 I2SCodecEnableSMCLK;
+ NvU32 SCInterfaceMode;
+
+ NvU32 perfMode3D; // 3D perf mode.
+ NvU32 DxInitBypass; // This is used to tell DxSetDisplay() to initialize the
+ // software state without touching the hardware
+ NvU32 noDCPreLoadCtx;
+ NvU32 nulldriver2D;
+#if NVOS_IS_WINDOWS_CE
+ NvU32 BackupMemory;
+#endif
+ NvU32 IndirectAddrSet;
+} GFRMENVIRONMENTVARIABLES, *PGFRMENVIRONMENTVARIABLES;
+
+/* Rm Public Services for platform only. May depend on GFPlat.h */
+enum
+{
+ RM_EXTDATA_INIT_TYPE = 0
+};
+
+enum
+{
+ RM_EXTDATA_INIT_SCRIPT = 0,
+ RM_EXTDATA_RM_SCRIPT,
+ RM_EXTDATA_CAMERA_SCRIPT,
+ RM_EXTDATA_ENVVARS_SCRIPT,
+ RM_EXTDATA_DISPLAY_SCRIPT,
+ RM_EXTDATA_DISPLAY_SUB_SCRIPT,
+ RM_EXTDATA_AUTOCTRL_SCRIPT,
+ RM_EXTDATA_AVP_IMAGE_AUDIO_AVP1,
+ RM_EXTDATA_AVP_IMAGE_MP3_AVP1,
+ RM_EXTDATA_AVP_IMAGE_SBC_AVP1,
+ RM_EXTDATA_AVP_IMAGE_AAC_AVP1,
+ RM_EXTDATA_AVP_IMAGE_EAAC_AVP1,
+ RM_EXTDATA_AVP_IMAGE_AACLPSBR_AVP1,
+ RM_EXTDATA_AVP_IMAGE_AMRNB_AVP1,
+ RM_EXTDATA_AVP_IMAGE_AMRWB_AVP1,
+ RM_EXTDATA_AVP_IMAGE_WMA_AVP1,
+ RM_EXTDATA_AVP_IMAGE_AUDIO_AVP2,
+ RM_EXTDATA_AVP_IMAGE_MP3_AVP2,
+ RM_EXTDATA_AVP_IMAGE_SBC_AVP2,
+ RM_EXTDATA_AVP_IMAGE_AAC_AVP2,
+ RM_EXTDATA_AVP_IMAGE_EAAC_AVP2,
+ RM_EXTDATA_AVP_IMAGE_AACLPSBR_AVP2,
+ RM_EXTDATA_AVP_IMAGE_AMRNB_AVP2,
+ RM_EXTDATA_AVP_IMAGE_AMRWB_AVP2,
+ RM_EXTDATA_AVP_IMAGE_WMA_AVP2,
+ RM_EXTDATA_AVP_IMAGE_H264DEC_AVP1,
+ RM_EXTDATA_AVP_IMAGE_H264DEC_AVP2,
+ RM_EXTDATA_AVP_IMAGE_MP4DEC_AVP1,
+ RM_EXTDATA_AVP_IMAGE_MP4DEC_AVP2,
+ RM_EXTDATA_AVP_IMAGE_JPEGDEC_AVP1,
+ RM_EXTDATA_AVP_IMAGE_JPEGDEC_AVP2,
+ RM_EXTDATA_AVP_IMAGE_H264ENC_AVP1,
+ RM_EXTDATA_AVP_IMAGE_H264ENC_AVP2,
+ RM_EXTDATA_AVP_IMAGE_VC1DEC_AVP1,
+ RM_EXTDATA_AVP_IMAGE_VC1DEC_AVP2,
+ RM_EXTDATA_AVP_IMAGE_RV9DEC_AVP1,
+ RM_EXTDATA_AVP_IMAGE_RV9DEC_AVP2,
+ RM_EXTDATA_AVP_IMAGE_ISP3A_AE_AF_AVP1,
+ RM_EXTDATA_AVP_IMAGE_ISP3A_AWB_AVP1,
+ RM_EXTDATA_AVP_IMAGE_ISP3A_DVS_AVP1,
+ RM_EXTDATA_AVP_IMAGE_BEATNIK_AVP1,
+ RM_EXTDATA_AVP_IMAGE_BEATNIK_AVP2,
+ RM_EXTDATA_AVP_IMAGE_KERNEL_AVP1,
+ RM_EXTDATA_AVP_IMAGE_KERNEL_AVP2,
+ RM_EXTDATA_AVP_IMAGE_DSP_UNITTESTS,
+ RM_EXTDATA_AVP_IMAGE_TSDEM_AVP1, //!< SC15 version of GFMxDemTS DSP image
+ RM_EXTDATA_AVP_IMAGE_TSDEM_AVP2, //!< SC14 version of GFMxDemTS DSP image
+ RM_EXTDATA_AVP_IMAGE_ISP_AVP1
+};
+
+enum
+{
+ RM_EXTDATA_FILE = 0,
+ RM_EXTDATA_FILE_WITH_SUBID,
+};
+
+#define DEFAULTSCRIPTNAME "default"
+
+#define RM_EXTDATA_READ 1 // Read in data
+#define RM_EXTDATA_USEBUFFER 4 // RmAccessExternalData shouldn't handle
+ // allocation of buffer, the data is to
+ // be placed at the orginal buffer address
+#define RM_EXTDATA_SIZE 8 // Query the size of the data
+#define RM_EXTDATA_FILENAME 0x10 // return script file name
+#define RM_EXTDATA_NAME 0x20 // return name of script without prefix and sub ID
+#define RM_EXTDATA_IDLIST 0x40 // return array of script sub ID
+
+/* Fields in struct PGFRMEXTDATASTRUCT
+ * dataType : Type of the data
+ * dataID : ID of the data
+ * subID : Sub ID of script
+ * buffer : Pointer to pointer of the data address
+ * size : Address to store the resulting size. During a read operation if size
+ * is non-zero the amount of bytes read in will be stored there. If size
+ * or the value pointed to by size is zero all the data represented by
+ * dataID will be read in.
+ * option : flag that will change what is returned in buffer and size.
+ */
+typedef struct _GFRMEXTDATASTRUCT
+{
+ NvU32 dataType; // type of data
+ NvU32 dataID; // ID of data
+ NvU32 subID; // sub ID of data
+ void ** buffer;
+ NvU32 * size;
+ NvU32 option;
+} GFRMEXTDATASTRUCT, *PGFRMEXTDATASTRUCT;
+
+
+ /** This function is called to get value from curent environment.
+
+ @param envName environment name in env table
+ @param envType environment type
+ RM_ENV_DECIMAL // String should be parsed as a decimal
+ RM_ENV_HEX // String should be parsed as a hexadecimal
+ RM_ENV_CHAR // String should be parsed as a character
+ RM_ENV_STRING // String used as-is.
+ @param parsedval converted value. Only available while environment type is RM_ENV_DECIMAL or RM_ENV_HEX
+ @return a pointer to the environment table entry containing varname.
+ */
+// char * ReadEnvVars( const char *envName, int envType, NvU32 *parsedval);
+GF_RETTYPE nvGetConfigUint32(const char *name, NvU32 *value);
+
+GF_RETTYPE nvGetConfigString( const char *envName, char **value);
+
+/** Retrieves the Process id of the current process.
+
+ @param RmGetProcessID Pointer to NvU32 for returning the prcess id,
+
+ @return GF_SUCCESS If the platforms support some sort of get process id API
+ @return GF_ERROR. if not support
+*/
+GF_RETTYPE RmGetProcessID( NvU32 *RmProcessID );
+
+/* Thread, Mutex, Event and Semaphore opaque handles */
+typedef struct GFMutex_t *GFMutex;
+typedef struct GFSemaphore_t *GFSemaphore;
+typedef struct GFEvent_t *GFEvent;
+typedef struct GFThread_t *GFThread;
+
+/* Rm platform functions for OS abstraction */
+
+/** Create Mutex object.
+
+ @param id - Mutex identiifer. Used to cretate named objects. If the
+ id is 0, un named object is created.
+
+ @return Handle to the event object, or 0 on failure.
+*/
+GFMutex RmCreateMutex( NvU32 id );
+
+/** Lock mutex object, blocks until mutex can be taken. Must always succeed if
+ given a valid mutex handle.
+
+ @param mutex Mutex handle
+*/
+void RmLockMutex(GFMutex mutex);
+
+/** Unlock mutex object. Must always succeed if given a valid mutex handle.
+
+ @param mutex Mutex handle
+*/
+void RmUnlockMutex(GFMutex mutex);
+
+/** Destroy mutex object. Must always succeed if given a valid mutex handle.
+ Must not crash (should do nothing) if given a NULL handle.
+
+ @param mutex Mutex handle.
+*/
+void RmDestroyMutex(GFMutex mutex );
+
+/** Create semaphore object.
+
+ @param id - Semaphore identifer. Used to create named objects. If the
+ id is 0, unnamed object is created.
+
+ @param InitCount (NvU32) Initial count of semaphore. This value must be
+ greater than zero.
+ @param MaxCount (NvU32) Maximum count of semaphore. This value must be
+ greater than zero.
+
+ @return Handle to semaphore object, or 0 on failure
+*/
+GFSemaphore RmCreateSemaphore(NvU32 id, NvU32 InitCount, NvU32 MaxCount);
+
+/** Destroy semaphore object. Must always succeed if given a valid semaphore
+ handle. Must not crash (should do nothing) if given a NULL handle.
+
+ @param sem Semaphore handle
+*/
+void RmDestroySemaphore(GFSemaphore sem);
+
+/** Signal semaphore object. This function increments the semaphore's counter.
+ Must always succeed if given a valid semaphore handle.
+
+ @param sem Semaphore handle
+*/
+void RmSignalSemaphore(GFSemaphore sem);
+
+/** Wait on semaphore.
+ Function blocks while semaphore's count is 0. Once the count is non-zero,
+ the count is decremented by one and function returns. If timeout is passed
+ as 0, the function does not block.
+
+ @param sem Semaphore handle
+ @param timeout Timeout in miliseconds, 0 for non-blocking, (NvU32)-1 for infinite wait.
+ @retutn GF_SUCCESS indicates that the semaphore was taken successfully, GF_WAIT_TIME_OUT
+ indicates timeout, any other return value indicates error.
+*/
+GF_RETTYPE RmWaitOnSemaphore(GFSemaphore sem, NvU32 timeout);
+
+
+/** Create event object.
+
+ @return Handle to event object, or NULL on failure
+*/
+GFEvent RmCreateEvent(void);
+
+/** Sets the event object to the signaled state. Must always succeed if given
+ a valid event handle.
+
+ @param event Event handle
+*/
+void RmSetEvent( GFEvent event );
+
+/** Resets the event object to the nonsignaled state. Must always succeed if
+ given a valid event handle.
+
+ @param event Event handle
+*/
+void RmResetEvent( GFEvent event );
+
+/** Function blocks until the event is signaled.
+
+ @param event Event handle.
+ @param msec Milli seconds to wait.
+
+ @retval GF_WAIT_GET_OBJECT Event was signaled, and the event object was acquired.
+ @retval GF_WAIT_TIME_OUT Timeout before event was signaled
+ @retval GF_WAIT_ERROR An error occured.
+*/
+GF_RETTYPE RmWaitForEvent(GFEvent event, NvU32 msec );
+
+
+/** Destroys the event object. Must always succeed if given a valid event
+ handle. Must not crash (should do nothing) if given a NULL handle.
+
+ @param event Event Handle. This is the handler returned by
+ the call to RmCreateEvent function.
+*/
+void RmDestroyEvent( GFEvent event );
+
+/** Creates a thread to execute within the calling process.
+
+ @param func (NvU32 (*)(void *)) Pointer to a function to be executed
+ by the thread.
+ @param data (void *) Pointer to variable to be passed to the thread
+
+ @return Handle to thread on success, otherwise 0 is returned.
+*/
+GFThread RmCreateThread(NvU32 (*StartFunction)(void *), void *data);
+
+/** Blocks until the specified thread terminates, then frees system resources
+ associated with the thread. Must always succeed if given a valid thread
+ handle. Must not crash (should do nothing) if given a NULL handle.
+
+ @param ThreadHandle Thread handle retruned by RmCreateThread call
+*/
+void RmJoinThread(GFThread ThreadHandle);
+
+/** Yield execution to other threads. This will be called inside spin loops
+ that are waiting for the hardware to finish something.
+*/
+void RmYield(void);
+
+/** Get full path of extended script data. Assume the script data is at same directory as bootload module.
+ @param modulename (char *)Bootloader module name. If the script data is not at same directory as module, could be NULL.
+ @param fullpath (char *)Pointer to extened script data path.
+
+ @return GF_SUCCESS to signal success, or error code to signal failure
+*/
+GF_RETTYPE
+ RmGetExtDataPath(char *modulename, char *fullpath );
+
+/* File and File Search opaque handles */
+typedef struct GFFile_t *GFFile;
+typedef struct GFFileSearch_t *GFFileSearch;
+
+/** Searches a directory for a file whose name matches the specified file name.
+ It examines subdirectory names as well as file names
+ @param filePath (char *) Pointer to a null-terminated string that specifies a valid directory or path and file name,
+ which can contain wildcard characters (* and ?)
+ @param filename (char *) pointer to the full path file/dir which match this search.
+
+ @return If the function succeeds, the return value is a search handle used in a subsequent call to RmFindNextFile or RmFindClose,
+ NULL if the function failed.
+*/
+GFFileSearch RmFindFirstFile(const char *filePath, char *fileName);
+
+/** Continues a file search from a previous call to the RmFindFirstFile function.
+ @param hFind (GFFileSearch ) Search handle returned by a previous call to the RmFindFirstFile function.
+ @param filename (char *) pointer to the filename with full path which match this search.
+ @return GF_SUCCESS to signal success, or error code to signal failure
+*/
+GF_RETTYPE RmFindNextFile(GFFileSearch hFind, char *fileName);
+
+/** Closes the specified search handle. Must always succeed if given a valid
+ search handle. Must not crash (should do nothing) if given a NULL handle.
+
+ @param hFind (GFFileSearch) Search handle returned by a previous call to the RmFindFirstFile function.
+*/
+void RmFindClose(GFFileSearch hFind);
+
+/** Open file.
+ @param filename (const char *) Filename
+ @param fileSpec (const char *) Type of access permitted
+ @return Handle to the open file. A NULL pointer value indicates an error.
+*/
+GFFile RmFileOpen(const char *fileName, const char *fileSpec);
+
+/** Close file. Must always succeed if given a valid file handle. Must not
+ crash (should do nothing) if given a NULL handle.
+
+ @param fp Handle that RmFileOpen() returned
+*/
+void RmFileClose(GFFile fp);
+
+/** Read data from file.
+ @param buffer (void *) Storage location for data
+ @param lSize (NvU32) Item size in bytes
+ @param lCount(NvU32) Maximum number of items to be read
+ @param fp (GFFile) Pointer that RmFileOpen() returned
+ @return Number of full items actually read, 0 if nothing is read out.
+*/
+GF_RETTYPE RmFileRead(void *buffer, NvU32 lSize, NvU32 lCount, GFFile fp);
+
+/** Get file size.
+ @param fp(GFFile ) Pointer that RmFileOpen() returned
+ @return Current file size in bytes.
+*/
+GF_RETTYPE RmFileSize(GFFile fp);
+
+/** Platform abstraction for millisecond sleep.
+
+ @param msec Milliseconds to sleep.
+ */
+void RmWaitMSec(NvU32 msec);
+
+/** Waits for a keypress with a timeout, and returns the key.
+
+ @param timeOutMSec Milliseconds to wait for the keypress.
+ @retval The code for the key, or zero if we timed out.
+ */
+int RmWaitKey(NvU32 timeOutMSec);
+
+/** Get the current OS tick counter.
+ @return Low 32 bits of millisecond counter.
+*/
+NvU32 RmGetTickCountMSec(void);
+
+/** Get the current OS tick counter.
+
+ NOTE: This function is NOT guaranteed to exist on all
+ platforms. Drivers should NOT call this function; it's
+ meant only for benchmarking.
+
+ @return (NvU64) 64 bit microsecond counter.
+ */
+NvU64 RmGetTickCountUSec(void);
+
+/** SetupPlatform - It is called by RmSetupPlatform to setup any platform specific stuff.
+
+ @param pOutput (PGFRMSETUPPLATFORM) output structure. Used to pass variables to high layer function RmSetupPlatform
+ @param penv (PGFRMENVIRONMENTVARIABLES) pass Environment Variable Configuration structure
+
+ @return GF_SUCCESS to signal success, or error code to signal failure
+
+*/
+GF_RETTYPE SetupPlatform( PGFRMSETUPPLATFORM pOutput, PGFRMENVIRONMENTVARIABLES penv );
+
+/** Called by RmExitPlatform to exit and clean-up any platform specific stuff, if any
+
+ @param pUserObject0 (void *) Pointer to user specified object 0 from high layer function RmExitPlatform
+
+ @return GF_SUCCESS to signal success, or error code to signal failure
+*/
+GF_RETTYPE ExitPlatform( void *pUserObject0);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __GFRMOEM_H__ */
diff --git a/Start_WM/test6/inc/GFRmRDMA.h b/Start_WM/test6/inc/GFRmRDMA.h
new file mode 100755
index 00000000..151ec65d
--- /dev/null
+++ b/Start_WM/test6/inc/GFRmRDMA.h
@@ -0,0 +1,411 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/** @File: GFRmRDMA.h
+ GFSDK Read DMA memmory manager.
+
+ */
+
+#ifndef __GFRMRDMA_H__
+#define __GFRMRDMA_H__
+
+#include "GF.h"
+
+/** @addtogroup groupRDMA RDMA ReadDMA API
+
+ @ref pageRDMAAppNotes
+
+*/
+
+/*@{*/
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+
+
+/** eGFRmRDMAClientID: Enumeration of client id's. SC15 has 4
+ RDMA (Read DMA) FIFO's. Modules specified below can be
+ attached to the RDMA FIFO's. See @
+ */
+typedef enum
+{
+ RDMA_CLID_CPU = 0,
+ RDMA_CLID_DSP,
+ RDMA_CLID_I2S,
+ RDMA_CLID_SD,
+ RDMA_CLID_MPEGE,
+ RDMA_CLID_JPEGE,
+ RDMA_CLID_EPP,
+ RDMA_CLID_VI,
+ RDMA_CLIDS
+} eGFRmRDMAClientID;
+
+/** RDMA buffer header.
+
+ For non-rectangular (or linear) reads
+ RDMA expects a header in the memory. The header formart is as specified
+ below. GFRmRDMAReadHeader function returns the header in this format.
+
+ @See GFRmRDMAReadHeader()
+ */
+
+typedef struct _RDMA_BUF_HEADER
+{
+ NvU32 bufferSize;
+ NvU32 raiseVector;
+ NvU32 channel;
+ NvU8 raiseEnable;
+ NvU8 frameStart;
+ NvU8 frameEnd;
+ NvU8 largeHdr;
+ NvU32 extHeader;
+
+} RDMA_BUFFER_HEADER, *pRDMA_BUFFER_HEADER;
+
+
+/* RDMA flags */
+
+/** RDMA_NONRECT::flags and RDMA_RECT::flags flagbit:
+ No byte swap.
+*/
+#define GF_RDMA_FLAGS_SWAP_NONE 0x00000000
+
+/** RDMA_NONRECT::flags and RDMA_RECT::flags flagbit:
+ Swap bytes in a word. example: 0xaabbccdd to 0xbbaaddcc.
+*/
+#define GF_RDMA_FLAGS_SWAP_BYTE_IN_WORD 0x00000001
+
+/** RDMA_NONRECT::flags and RDMA_RECT::flags flagbit:
+ Swap bytes in dword: 0xaabbccdd to 0xddccbbaa.
+*/
+#define GF_RDMA_FLAGS_SWAP_BYTE_IN_DWORD 0x00000002
+
+/** RDMA_NONRECT::flags and RDMA_RECT::flags flagbit:
+ Swap word in dword example: 0xaabbccdd to 0xccddaabb.
+*/
+#define GF_RDMA_FLAGS_SWAP_WORD_IN_DWORD 0x00000003
+
+/** RDMA_NONRECT::flags and RDMA_RECT::flags bitmask:
+ mask out byte swap options GF_RDMA_FLAGS_SWAP_*.
+*/
+#define GF_RDMA_FLAGS_SWAP_MASK 0x00000003
+
+/** RDMA_NONRECT::flags and RDMA_RECT::flags flagbit:
+ Tells the RDMA engine to output header. Will output a header into the data stream,
+ which has to be read with GFRmRDMAReadHeader() before calling GFRmRDMARead().
+ This flag is relevant only in non-rectangular reads.
+ */
+#define GF_RDMA_FLAGS_STR_HEADER 0x00010000
+
+/** RDMA_RECT
+ Setup information for the RDMA.
+ */
+typedef struct _RDMA_RECT
+{
+ /** physical addess of the buffer in the SC15 Memory view. 32-bit alignment
+ * required. */
+ NvU32 baseOffset;
+
+ /** client id. See @eGFRmRDMAClientID */
+ eGFRmRDMAClientID clid;
+
+ /** buffers/stride/width/lines of the rectangular buffer.
+
+ Need to comply with the following constraints provided
+ by the hardware
+ - if width is not a multiple of 4 bytes (one word):
+ - stride equals width, stride should be the exact stride in bytes (eg. line_stride[1:0] not equal to 0)
+ - if stride is bigger than width, stride should be rounded down to the nearest word
+ (eg. line_stride[1:0] should be zero)
+
+ For example: width = 42 bytes, stride = 82 -> stride should be programmed to 80
+ width = 42 bytes, stride = 42 -> stride should be programmed to 42
+ */
+ NvU32 buffers;
+ NvU32 stride;
+ NvU32 width;
+ NvU32 lines;
+
+ /* use the RDMA flags defined above as GF_RDMS_FLAGS_* */
+ NvU32 flags; //!< Flagbits, see GF_RDMA_FLAGS_*
+
+ /* Timeout in msec. If <=0, then no timeout */
+ NvU32 timeout;
+
+} RDMA_RECT, *pRDMA_RECT;
+
+/** RDMA_NONRECT
+
+ Setup structure for non-rectangular reads.
+
+ */
+typedef struct _RDMA_NONRECT
+{
+ /** Physical addess of the buffer in the GPU address space. Needs to be
+ * 32-bit aligned. */
+ NvU32 baseOffset;
+
+ /** client id. See @eGFRmRDMAClientID */
+ eGFRmRDMAClientID clid;
+
+ NvU32 buffers;
+ NvU32 stride;
+
+ /* use the RDMA flags defined above as GF_RDMS_FLAGS_* */
+ NvU32 flags; //!< Flagbits, see GF_RDMA_FLAGS_*
+
+ /* Timeout in msec. If =0, then no timeout */
+ NvU32 timeout;
+
+} RDMA_NONRECT, *pRDMA_NONRECT;
+
+
+/** There are four read dma channels, the RM manages the allocation/
+ freeing of these channels. This function allocates a channel.
+
+ @param RmHandle Handle to the Rm allocated via call to GFRmOpen.
+ @param DmaHandle Pointer to an allocated handle.
+
+ @retval GF_SUCCESS if a RDMA channel is available, and returns
+ RDMA handle on allocation.
+
+ The release function will return GF_ERROR
+ if the read dma is already released.
+ */
+
+GF_RETTYPE
+GFRmRDMAAlloc(GFRmHandle RmHandle, GFRmRdmaHandle *DmaHandle);
+
+/** There are four read dma channels, the RM manages the allocation/
+ freeing of these channels. This function frees an allocated
+ channel.
+
+ @param hRm Handle to the Rm allocated via call to GFRmOpen.
+ @param phDma Pointer to the DMA handle to be released.
+ */
+void
+GFRmRDMARelease(GFRmHandle hRm, GFRmRdmaHandle *phDma);
+
+/** Setup non-rectangular RDMA.
+
+ When the flag GF_RDMA_FLAGS_STR_HEADER is set, buffer header is written to the
+ memory by the RDMA client. So, when the cpu reads the data, buffer
+ header comes first and then the data. Buffer header has the information
+ of buffer, like its size etc.
+
+
+ So, an example sequence would be
+ - Call setup with GF_RDMA_FLAGS_STR_HEADER flag set.
+ - Read header with the GFRmRDMAReadHeader(...)
+ - Read buffer size of data with GFRmRDMARead() funtion.
+ Buffer size is in the buffer header.
+
+ If this flag is not set, then the there is no buffer header.
+ In this case it is assumed that the the size of the buffer is prefixed
+ and known to the module API writers.
+
+ So, an example sequence would be
+ - Call setup GF_RDMA_FLAGS_STR_HEADER flag not set.
+ - Read buffer size of data with GFRmRDMARead() funtion.
+ Buffer size is known to the callers.
+
+ baseOffset of pReq structure needs to be 32-bit aligned.
+
+ @param DmaHandle Handle returned by @GFRmRDMAAlloc function.
+ @param pReq Populated RDMA req structure. See @RDMA_NONRECT
+*/
+
+GF_RETTYPE
+GFRmRDMASetupNONRect(GFRmRdmaHandle DmaHandle, pRDMA_NONRECT pReq);
+
+/** Setup RDMA for rectangular read.
+
+ Requirement:
+ baseOffset of pReq structure needs to be 32-bit aligned.
+
+ @param DmaHandle Handle returned by @GFRmRDMAAlloc function.
+ @param pReq Populated RDMA req structure. See @RDMA_RECT
+*/
+GF_RETTYPE
+GFRmRDMASetupRect(GFRmRdmaHandle DmaHandle, pRDMA_RECT pReq);
+
+/** Reads the RDMA FIFO status register and returns the
+ available number of FIFO slots. A slot is 32-bit.
+
+ @param DmaHandle Handle returned by @GFRmRDMAAlloc function.
+ */
+NvU32 GFRmRDMAFIFOAvailIn32Bits(GFRmRdmaHandle DmaHandle);
+
+/** Reads memory from SC15 internal/external
+ memory to the system memory pointed by the dstAddr. Need
+ to pass the same rectangular attributes passed, when the
+ RDMA is setup.
+
+ @param DmaHandle Handle returned by @GFRmRDMAAlloc function.
+ @param dstAddr aligned or non-aligned dest pointer. Aligned
+ pointer results in faster reads.
+ @param width Width in bytes to read.
+ @param height Height of the rectangular region.
+
+ @retval Returns GF_SUCCESS or GF_ERROR.
+ */
+
+GF_RETTYPE
+GFRmRDMARectRead(GFRmRdmaHandle DmaHandle, void *dstAddr, NvU32 width, NvU32 height);
+
+
+/** Reads memory from SC15 internal/external
+ memory to the system memory pointed by the dstAddr.
+
+ @param DmaHandle Handle returned by @GFRmRDMAAlloc function.
+ @param dstAddr aligned or non-aligned dest pointer. Aligned
+ pointer results in faster reads.
+ @param sizeInBytes Number of bytes to read.
+
+ @retval Returns GF_SUCCESS or GF_ERROR.
+ */
+
+GF_RETTYPE
+GFRmRDMARead(GFRmRdmaHandle DmaHandle, void *dstAddr, NvU32 sizeInBytes);
+
+/** Reads buffer header. Once this info is read
+ API's will know how much data to read or expect.
+
+ @param DmaHandle Handle returned by @GFRmRDMAAlloc function.
+ @param header Pointer to RDMA header structure. See @RDMA_BUFFER_HEADER
+ */
+GF_RETTYPE
+GFRmRDMAReadHeader(GFRmRdmaHandle DmaHandle, pRDMA_BUFFER_HEADER header);
+
+
+/** Cleanup the RDMA FIFO, by reading out any extra DOWRDS
+ GFRmRDMARead might not have read.
+
+ In general this function need not be used.
+ */
+
+GF_RETTYPE
+GFRmRDMACleanup(GFRmRdmaHandle DmaHandle);
+
+
+/** Gets the actual RDMA channel number from the DMA handle. This is
+ usefull for DSP development. Host code allocates the DMAHandle
+ gets the DMA number from that and creates the DMA handle on the
+ DSP side using GFXRmRDMAAlloc function. GFXRmRDMAAlloc needs to
+ know what DMA channel to use.
+
+ @param DmaHandle RDMA handle.
+ @param dmaNumber RDMA channel number used the handle.
+
+*/
+
+void
+GFRmRDMAGetPortNumber(GFRmRdmaHandle DmaHandle, NvU32 *portNumber);
+
+#if NVCPU_IS_XTENSA
+
+// In XRM, it is expected that the dma handle is allocated on
+// the Host side, and just the dma number is passed into code
+// running on the Xtensa. These functions will setup a
+// DMA handle that can used in the XRM.
+
+
+GF_RETTYPE
+GFXRmRDMAAlloc(NvU32 dmaNumber, GFRmRdmaHandle *DmaHandle);
+
+
+GF_RETTYPE
+GFXRmRDMARelease(GFRmRdmaHandle *DmaHandle);
+
+#endif // NVCPU_IS_XTENSA
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+
+/*@}*/
+
+/** @page pageRDMAAppNotes RDMA Application Notes
+
+ General information about RDMA - RDMA is read DMA hw block. Unlike
+ traditional DMA, sw reads the data from the FIFO to system memory. This is
+ becasuse SC15 cannot bus master and write directly to the system memory.
+ RDMA will be faster becasue the data is buffered by the HOST1x Block and sw
+ reads back data in a tight loop.
+
+ SC15 RDMA supports 2 modes - Linear(AKA NON-Rect) and Rect mode.
+ In both modes the sequence of programming same - setup and then read the data.
+
+ RDMA setup is 2 step process.
+ - RDMA need to know which client will trigger the RDMA. It also need to other
+ parameters like which varies for linear and RECT modes.
+ In rect reads software has to setup the stride/width/number of lines.
+ This information is needed to describe a buffer. In case of non-rect
+ read a buffer header is expected, which describes the buffer. In both
+ cases one need to specify the number of buffers.
+
+ - Client module also need to be setup, as it notifies the RDMA hw block when
+ the data is ready. This step is not needed for CPU triggered case, as the
+ data is already available in the memory.
+
+ Sample program sequence:
+
+ Setup RDMA
+ Setup Client side register (example - vi, SD etc...). Not needed when
+ setup for CLID CPU.
+
+ wait till the data is available ()
+ {
+ Read the data(..)
+ }
+
+ Amount of data to read is either known a-priori (RECT mode) or read from
+ the header (linear mode).
+
+
+ As described ealier RDMA supports 2 modes
+
+ Linear RDMA - RDMA expects a header in the memory right before the data, when
+ it is triggered. That header describes the length and the attributes of the
+ buffer.
+
+ Depending on how the RDMA is setup, buffer header will be/will not be
+ (i.e RDMA_BUFFER_HEADER struct) readout. see #GF_RDMA_FLAGS_STR_HEADER
+
+ When the header is returned the usage looks like
+
+ RDMA_BUFFER_HEADER header;
+ GFRmRDMAReadHeader(...,&header);
+ While (header->bufferSize)
+ {
+ ...
+ GFRmReadRDMA(...)
+ }
+
+ In this mode, it is important is to note that RDMA expect the buffer header
+ in the memory. So, this is not good for CPU triggerd case, as in that case
+ CPU should somehow write the buffer header to read the data already present
+ in the embedded memory.
+
+ Rect RDMA - In this mode, there is no concept of buffer header. Exact size
+ should be programmed in the RDMA registers when the Setup is done. So, sw
+ should know how much data to pull out. Requests for data more than available
+ will result in timeout errors.
+
+ A guideline: if an engine already generated the buffer for you, then use
+ non-rectangular read. Otherwise, use rect read.
+
+*/
+
+#endif /* __GFRMRDMA_H__ */
diff --git a/Start_WM/test6/inc/GFRmScr.h b/Start_WM/test6/inc/GFRmScr.h
new file mode 100755
index 00000000..1678ba09
--- /dev/null
+++ b/Start_WM/test6/inc/GFRmScr.h
@@ -0,0 +1,59 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+#if !defined (__GFRMSCR_INC__)
+#define __GFRMSCR_INC__
+
+/* Surface ColorFormat - Follow GFBITMAP type (GF_BITMAP_xxx) */
+
+#define GF_SURFACE_YUV420 1
+#define GF_SURFACE_YUV422 2
+#define GF_SURFACE_YUV444 4
+#define GF_SURFACE_ROTATED_YUV422 8
+
+#define GF_SURFACE_YUYV (GF_SURFACE_YUV422|0x00000004)
+#define GF_SURFACE_YVYU (GF_SURFACE_YUV422|0x00000008)
+#define GF_SURFACE_UYVY (GF_SURFACE_YUV422|0x00000010)
+#define GF_SURFACE_VYUY (GF_SURFACE_YUV422|0x00000020)
+#define GF_SURFACE_MPEGDEC (GF_SURFACE_YUV420|0x00000040)
+
+
+/** Image is for encoding purpose. Must combine with particular YUV format. */
+#define GF_SURFACE_MPEGENC 0x00000080
+#define GF_SURFACE_JPEGDEC (GF_SURFACE_YUV420|0x00000100)
+
+/** Image is for encoding purpose. Must combine with particular YUV format. */
+#define GF_SURFACE_JPEGENC 0x00000200
+#define GF_SURFACE_PLANAR_YUV422 0x400
+#define GF_SURFACE_RGB565 0x00010000
+
+/** Used for 18 bpp (MSB bits) (18bpp MSB bits) case. */
+#define GF_SURFACE_RGB888 0x00020000
+#define GF_SURFACE_ARGB8888 0x00030000
+#define GF_SURFACE_ARGB1555 0x00040000
+#define GF_SURFACE_ARGB4444 0x00050000
+
+/** Used for 18 bpp (LSB bits). */
+#define GF_SURFACE_RGB666 0x00060000
+
+/** 8bpp surface. */
+#define GF_SURFACE_RGB8 0x00070000
+#define GF_SURFACE_RGB_MASK 0x000F0000
+
+/** Bayer 8bit ColorFormat. */
+#define GF_SURFACE_BAYER8 0x00100000
+
+/** Bayer 16bit ColorFormat. */
+#define GF_SURFACE_BAYER16 0x00200000
+#define GF_SURFACE_ABGR8888 0x00400000
+
+/** YUV422 rotated averaging. */
+#define GF_SURFACE_PLANAR_YUV422RA 0x00800000
+
+#endif
diff --git a/Start_WM/test6/inc/GFTrace.h b/Start_WM/test6/inc/GFTrace.h
new file mode 100755
index 00000000..4d50b3bd
--- /dev/null
+++ b/Start_WM/test6/inc/GFTrace.h
@@ -0,0 +1,304 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/* GFTrace.h: Tracing utility for GFSDK libraries.
+ *
+ * Features a suite of conditionally compilied tracing macros:
+ *
+ * GF_TRACE( a ): for "don't care" tracing - will be mapped
+ * to the DEBUG priority.
+ *
+ * And several others, each with a different priority.
+ *
+ * GF_TRACE_CRITICAL( a )
+ * GF_TRACE_WARNING( a )
+ * GF_TRACE_NORMAL( a )
+ * GF_TRACE_VERBOSE( a )
+ * GF_TRACE_DEBUG( a )
+ *
+ * The trace macro parameter is treated as a printf style argument
+ * list, so it should be wrapped in double-parenthesis, such as:
+ *
+ * GF_TRACE(("Register value is: %x", reg));
+ *
+ * Tracing is either handled via priorities (normal tracing).
+ * Tracing supports logging to a file (defaulting to "gfsdk.log")
+ */
+
+#ifndef GF_RMTRACE_H
+#define GF_RMTRACE_H
+
+/* Required for compilation:
+ *
+ * GF_TRACE_COMPONENTID [id]
+ * 'id' is a number 0 to GF_TRACE_COMPONENT_MAX. Tracing priorities
+ * and thresholds are set via the component id.
+ *
+ * Example usage of this header file:
+ *
+ * #define GF_TRACE_COMPONENTID GF_GXAPI
+ * #define GF_TRACE_ENABLE 1
+ * #include "GFTrace.h"
+ *
+ * void
+ * foo( NvU32 x )
+ * {
+ * GF_TRACE_DEBUG(("foo called with: %x", x ));
+ * }
+ *
+ */
+
+#ifndef GF_TRACE_COMPONENTID
+#error "GF_TRACE_COMPONENTID must be defined."
+#endif
+
+#include
+#include "GFRm.h"
+
+/* see GFRm.h for available component ids */
+
+/* Compiliation options:
+ *
+ * GF_TRACE_ENABLE [0|1]
+ * If zero, will remove tracing for that file.
+ *
+ * GF_TRACE_GLOBAL_DISABLE
+ * If this is defined and set to 1 - tracing is force globally disabled.
+ * If not defined will be controlled by the GF_TRACE_ENABLE macro.
+ *
+ * GF_TRACE_GLOBAL_ENABLE
+ * If this is defined and set to 1 - tracing is force globally enabled.
+ * If not defined will be controlled by the GF_TRACE_ENABLE macro and
+ * GF_TRACE_GLOBAL_DISABLE macros.
+ *
+ * So, the precedence is GF_TRACE_GLOBAL_ENABLE > GF_TRACE_GLOBAL_DISABLE >
+ * GF_TRACE_ENABLE
+ *
+ * GF_TRACE_COMPONENTID_MAX [max]
+ * The maximum number of component ids that may exist for tracing.
+ *
+ * GF_TRACE_MESSAGESIZE_MAX [max]
+ * The maximum length of a tracing message, in bytes.
+ *
+ * GF_TRACE_DECORATE [0|1]
+ * Automatically add a newline, componentname and process ID to
+ * the output.
+ */
+
+/* default for component id max */
+#ifndef GF_TRACE_COMPONENTID_MAX
+#define GF_TRACE_COMPONENTID_MAX 32
+#endif
+
+/* default for message size max */
+#ifndef GF_TRACE_MESSAGESIZE_MAX
+#define GF_TRACE_MESSAGESIZE_MAX 256
+#endif
+
+/* default for decoration is 1 */
+#ifndef GF_TRACE_DECORATE
+#define GF_TRACE_DECORATE 1
+#endif
+
+#if defined(NV_MODS)
+
+/* By default enable everything for MODS */
+#undef GF_TRACE_ENABLE
+#define GF_TRACE_ENABLE 1
+
+#ifndef INCLUDED_GFMODS_H
+#include "GFMods.h"
+#endif
+
+#endif /* NV_MODS */
+
+#if defined(GF_TRACE_GLOBAL_ENABLE) && defined(GF_TRACE_GLOBAL_DISABLE)
+#error "Both GF_TRACE_GLOBAL_DISABLE and GF_TRACE_GLOBAL_ENABLE cannot be defined"
+#endif
+
+/* global overrides */
+#ifdef GF_TRACE_GLOBAL_ENABLE
+ #undef GF_TRACE_ENABLE
+ #define GF_TRACE_ENABLE 1
+#endif
+
+#ifdef GF_TRACE_GLOBAL_DISABLE
+ #undef GF_TRACE_ENABLE
+ #define GF_TRACE_ENABLE 0
+#endif
+
+/* Several priorities from which to choose. Use the
+ * GFRmTrace*Threshold functions to limit tracing output.
+ * By deafult, all messages will be traced in a Debug build,
+ * only Warning, and Critical in a Release build.
+ *
+ * The priority numbers should exactly match the printing
+ * priorities in MODS.
+ */
+#define GF_TRACE_PRI_CRITICAL 5
+#define GF_TRACE_PRI_WARNING 4
+#define GF_TRACE_PRI_NORMAL 3
+#define GF_TRACE_PRI_VERBOSE 2
+#define GF_TRACE_PRI_DEBUG 1
+
+/* Returns the current tracing threshold.
+ */
+NvU32
+GFRmTraceGetThreshold( NvU32 componentId );
+
+/* Sets the current tracing threshold. All messages with an equal-to or
+ * greater-than priority will be traced.
+ */
+void
+GFRmTraceSetThreshold( NvU32 componentId, NvU32 thresh );
+
+/* Gets the current tracing priority.
+ */
+NvU32
+GFRmTraceGetPriority( NvU32 componentId );
+
+/* Sets the current tracing priority for the given component.
+ */
+void
+GFRmTraceSetPriority( NvU32 componentId, NvU32 pri );
+
+/* Trace a message. Takes variable arguments that exactly match those
+ * of the libc printf family. Messages may or may not be controlled
+ * via a priority mechanism.
+ */
+void
+GFRmTrace( NvU32 componentId, NvU32 priority, const char *msg, va_list args );
+
+/* Tracing may be controlled via run-time as well as compile-time.
+ * The run-time options that are available (to be passed into
+ * GFRmTraceConfigure as the option flag) are:
+ *
+ * GF_TRACE_OPT_OUTPUT [ioname]
+ * The output device of normal tracing. Defaults to stdout.
+ * 'value' is a char *, max len is 256. Should be null-terminated.
+ * May be "default" or a filename.
+ *
+ * GF_TRACE_OPT_COMPONENT_ENABLE [id] [0|1]
+ * Component that have compiled in tracing can be turned off or
+ * back on. The configure value is a pointer to an array of two
+ * integers, the first is id, the second is the enable/disable.
+ *
+ * GF_TRACE_OPT_DECORATE [id] [0|1]
+ * Automatically add a newline and component id to the output.
+ * 1 for on, 0 for off. 'id' is the component id.
+ */
+#define GF_TRACE_OPT_OUTPUT 0
+#define GF_TRACE_OPT_COMPONENT_ENABLE 1
+#define GF_TRACE_OPT_DECORATE 2
+
+/* Open the trace file. Called by GFRmOpen */
+GF_RETTYPE GFRmTraceOpen(void);
+
+/* Closes the trace file. Called by GFRmClose */
+void GFRmTraceClose(void);
+
+/* Run-time configuration for tracing. See the GF_TRACE_OPT
+ * flags for 'value' documentation. All configuration settings
+ * assigned via GFRmTraceConfigure() are global across all component
+ * ids, and should be synchronized if accessed by multiple threads.
+ *
+ * Returns 0 on failure, 1 otherwise.
+ */
+NvU32
+GFRmTraceConfigure( int option, void *value );
+
+/* Returns a nice name for the component id.
+ * Note that this will always be defined (never compiled out).
+ */
+const char *
+GFRmTraceGetComponentName( NvU32 componentId );
+
+#if !GF_TRACE_ENABLE || NVCPU_IS_XTENSA
+
+#define GF_TRACE( a )
+#define GF_TRACE_CRITICAL( a )
+#define GF_TRACE_WARNING( a )
+#define GF_TRACE_NORMAL( a )
+#define GF_TRACE_VERBOSE( a )
+#define GF_TRACE_DEBUG( a )
+
+#else /* tracing is enabled */
+
+static NV_INLINE void GFRmTraceWithPriority(const char *msg, ...)
+{
+ va_list list;
+ NvU32 priority = 0;
+
+ va_start( list, msg );
+
+ priority = GFRmTraceGetPriority( GF_TRACE_COMPONENTID );
+
+#if !defined(NV_MODS)
+ GFRmTrace( GF_TRACE_COMPONENTID, priority, msg, list );
+#else
+ GFModsTrace( GF_TRACE_COMPONENTID, priority, msg, list );
+#endif
+ va_end( list );
+}
+
+/* component id will be defined to be -1 for the trace implementation.
+ * Each client must define component id before including this file.
+ *
+ * For a MODS build, GFRmTraceWithPriority() must call ModsDrvVPrintf().
+ * See main/diag/mods/include/modsdrv.h for details. ModsDrvVPrintf()
+ * is called via GFModsTrace().
+ */
+#if GF_TRACE_COMPONENTID >= 0
+
+#define GF_TRACE( a ) \
+ do \
+ { \
+ GFRmTraceSetPriority( GF_TRACE_COMPONENTID, GF_TRACE_PRI_DEBUG ); \
+ GFRmTraceWithPriority a; \
+ } while( 0 )
+
+#define GF_TRACE_CRITICAL( a ) \
+ do \
+ { \
+ GFRmTraceSetPriority( GF_TRACE_COMPONENTID, GF_TRACE_PRI_CRITICAL ); \
+ GFRmTraceWithPriority a; \
+ } while( 0 )
+
+#define GF_TRACE_WARNING( a ) \
+ do \
+ { \
+ GFRmTraceSetPriority( GF_TRACE_COMPONENTID, GF_TRACE_PRI_WARNING ); \
+ GFRmTraceWithPriority a; \
+ } while( 0 )
+
+#define GF_TRACE_NORMAL( a ) \
+ do \
+ { \
+ GFRmTraceSetPriority( GF_TRACE_COMPONENTID, GF_TRACE_PRI_NORMAL ); \
+ GFRmTraceWithPriority a; \
+ } while( 0 )
+
+#define GF_TRACE_VERBOSE( a ) \
+ do \
+ { \
+ GFRmTraceSetPriority( GF_TRACE_COMPONENTID, GF_TRACE_PRI_VERBOSE ); \
+ GFRmTraceWithPriority a; \
+ } while( 0 )
+
+#define GF_TRACE_DEBUG( a ) \
+ do \
+ { \
+ GFRmTraceSetPriority( GF_TRACE_COMPONENTID, GF_TRACE_PRI_DEBUG ); \
+ GFRmTraceWithPriority a; \
+ } while( 0 )
+#endif /* componentid check */
+
+#endif /* enable trace */
+
+#endif /* GFRMTRACE_H */
diff --git a/Start_WM/test6/inc/GFTypes.h b/Start_WM/test6/inc/GFTypes.h
new file mode 100755
index 00000000..49145b10
--- /dev/null
+++ b/Start_WM/test6/inc/GFTypes.h
@@ -0,0 +1,65 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/*
+ * File: GFTypes.h
+ * GFSDK standard data types.
+ */
+
+#ifndef __GFTYPES_H__
+#define __GFTYPES_H__
+
+#include "nvtypes.h"
+
+#ifndef NULL
+#ifdef __cplusplus
+#define NULL 0
+#else
+#define NULL ((void *)0)
+#endif
+#endif
+
+/* Misc Helper macros on data types (deal with byte-endianness later ) */
+#ifndef MAKENvU32
+#define MAKENvU32(dataLo16, dataHi16) \
+ (NvU32)(((NvU32)(dataHi16) << 16) | (NvU32)(dataLo16))
+#endif /* MAKENvU32 */
+
+#ifndef MAKENvU16
+#define MAKENvU16(dataLo8, dataHi8) \
+ (NvU16)(((NvU16)(dataHi8) << 8) | (NvU16)(dataLo8))
+#endif /* MAKENvU16 */
+
+#if defined(__arm)
+# define GFALIGN8 __align(1)
+# define GFALIGN16 __align(2)
+# define GFALIGN32 __align(4)
+#elif defined(__IAR_SYSTEMS_ICC__)
+# define GFALIGN8
+# define GFALIGN16
+# define GFALIGN32
+#elif defined(NV_LINUX)
+# define GFALIGN8
+# define GFALIGN16 __attribute__ ((aligned (2)))
+# define GFALIGN32 __attribute__ ((aligned (4)))
+#elif defined(NVCPU_XTENSA)
+# define GFALIGN8
+# define GFALIGN16 __attribute__ ((aligned (2)))
+# define GFALIGN32 __attribute__ ((aligned (4)))
+#elif defined(NV_WINDOWS)
+# define GFALIGN8
+# define GFALIGN16
+# define GFALIGN32
+#else
+# define GFALIGN8
+# define GFALIGN16
+# define GFALIGN32
+#endif
+
+#endif /* __GFTYPES_H__ */
diff --git a/Start_WM/test6/inc/GFVersion.h b/Start_WM/test6/inc/GFVersion.h
new file mode 100755
index 00000000..399900be
--- /dev/null
+++ b/Start_WM/test6/inc/GFVersion.h
@@ -0,0 +1,24 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/*
+ * File: GFVersion.h
+ * GFSDK build version header file.
+ */
+
+#ifndef __GFVERSION_H__
+#define __GFVERSION_H__
+
+#define GF_MAJOR_VERSION 0x0017
+#define GF_MINOR_VERSION 0x0100
+#define GF_BUILD_NUMBER 1039
+
+
+#endif /* __GFVERSION_H__ */
+
diff --git a/Start_WM/test6/inc/GFVx.h b/Start_WM/test6/inc/GFVx.h
new file mode 100755
index 00000000..5af9e634
--- /dev/null
+++ b/Start_WM/test6/inc/GFVx.h
@@ -0,0 +1,3028 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/** @file GFVx.h
+ GFSDK Video API header file.
+*/
+
+#ifndef __GFVX_H__
+#define __GFVX_H__
+
+#include "GFRm.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+#include "GFVxScr.h"
+
+/** @addtogroup groupVx VxAPI Video API
+
+ @ref pageVxOverview
+
+ @ref pageVxOverview1
+ @ref pageVxOverview2
+ @ref pageVxOverview3
+
+ @ref pageVxAppNotes
+
+
+*/
+/*@{*/
+
+/* GFVX Property Capability */
+
+/** VxAPI property flag: Color space conversion supported.
+ @see GFVxGetProperty(), GFPROPERTY::Capability
+*/
+#define GFVX_CAP_CSC 0x00000001
+
+/** VxAPI property flag: VIP functions available.
+ @see GFVxGetProperty(), GFPROPERTY::Capability
+*/
+#define GFVX_CAP_VIP 0x00000002
+
+/** VxAPI property flag: Enlarge source image via VIP supported.
+ @see GFVxGetProperty(), GFPROPERTY::Capability
+*/
+#define GFVX_CAP_ENLARGE 0x00000004
+
+/** VxAPI property flag: Shrink source image via VIP supported.
+ @see GFVxGetProperty(), GFPROPERTY::Capability
+*/
+#define GFVX_CAP_SHRINK 0x00000008
+
+/** VxAPI property flag: Overlay supported.
+ The GoForce processor version supports overlay display.
+ @see GFVxGetProperty(), GFPROPERTY::Capability
+*/
+#define GFVX_CAP_OVERLAY 0x00000020
+
+/** VxAPI property flag: MPEG4 decoder supported.
+ @see GFVxGetProperty(), GFPROPERTY::Capability
+*/
+#define GFVX_CAP_MPEGDEC 0x00000040
+
+/** VxAPI property flag: MPEG4 encoder supported.
+ @see GFVxGetProperty(), GFPROPERTY::Capability
+*/
+#define GFVX_CAP_MPEGENC 0x00000080
+
+/** VxAPI property flag: JPEG decoder supported.
+ @see GFVxGetProperty(), GFPROPERTY::Capability
+*/
+#define GFVX_CAP_JPEGDEC 0x00000100
+
+/** VxAPI property flag: JPEG encoder supported.
+ @see GFVxGetProperty(), GFPROPERTY::Capability
+*/
+#define GFVX_CAP_JPEGENC 0x00000200
+
+/** VxAPI property flag: Alpha blending supported.
+ @version SC12 and above only.
+ @see GFVxGetProperty(), GFPROPERTY::Capability
+*/
+#define GFVX_CAP_ALPHA_BLEND 0x00000400
+
+/** VxAPI property flag: Extended RGB format 32 bpp supported.
+ @version SC12 above only.
+ @see GFVxGetProperty(), GFPROPERTY::Capability
+*/
+#define GFVX_CAP_EXTEND_RGB 0x00000800
+
+/** VxAPI property flag: Variable sized data camera interface (Type A/B/C)
+ supported. See section @ref pageVxOverview2 for information on Type A/B/C
+ camera interfaces.
+ @version SC12 and above only.
+ @see GFVxGetProperty(), GFPROPERTY::Capability,
+*/
+#define GFVX_CAP_ENCODE_TYPE 0x00001000
+
+/** VxAPI property flag: Bayer type camera interface supported.
+ @version SC15 and above only.
+ @see GFVxGetProperty(), GFPROPERTY::Capability,
+*/
+#define GFVX_CAP_BAYER_TYPE 0x00002000 // support bayer type input
+
+/** VxAPI property flag: YUV Overlay supported.
+ @version SC15 and above only.
+ @see GFVxGetProperty(), GFPROPERTY::Capability
+*/
+#define GFVX_CAP_OVERLAY_YUV 0x00004000
+
+/** VxAPI property flag: Overlay with scaling supported.
+ @version SC15 and above only.
+ @see GFVxGetProperty(), GFPROPERTY::Capability
+*/
+#define GFVX_CAP_OVERLAY_SCALE 0x00008000
+
+/** VxAPI property flag: Multiple Overlay supported.
+ @version SC15 and above only.
+ @see GFVxGetProperty(), GFPROPERTY::Capability
+*/
+#define GFVX_CAP_OVERLAY_MULTIPLE 0x00010000
+
+/** VxAPI property flag: Per pixel alpha supported.
+ Used when application wants to use weight (overlay and blend)
+ defined in pixels alpha bits.
+ @version SC15 and above only.
+ @see GFVxGetProperty(), GFPROPERTY::Capability
+*/
+#define GFVX_CAP_PER_PIXEL_ALPHA 0x00020000
+
+/** VxAPI GFVXBLT::BltOption flagbit: Disable VSync wait.
+ Disable GFVxBlt() synchronization with VSync. The default behaviour of
+ GFVxBlt() is to wait for VSync to prevent display flicker. Note that
+ if the display is disabled there is no VSync signal and GFVxBlt()
+ would block.
+ @see GFVXBLT, GFVxBlt()
+*/
+#define GFVX_BLT_DISABLE_WAIT_VSYNC 0x00000080
+
+/** VxAPI GFVXBLT::BltOption flagbit: Source color key.
+ GFVxBlt() compares each pixel of the source surface with the color key.
+ If the colors match, the pixel is not copied to the destination surface.
+
+ The source color key option is not very useful when scaling is used.
+
+ @see GFVXBLT, GFVxBlt()
+*/
+#define GFVX_BLT_SRC_KEY 0x00000100
+
+/** VxAPI GFVXBLT::BltOption flagbit: Auto-blit at end of VIP frame.
+ If this flag is set, GFVxBlt() configures blit parameters for
+ VIP auto-blit. VIP auto-blit can be used to fire stretch blit automatically
+ at the end of the video input frame from the video input port (VIP). This
+ requires double buffering of the input and output of stretch blit. The use
+ of this flag is to be combined with GFVxVIPUpdate() flag
+ #GFVX_VIP_AUTO_TRIGER_BLT.
+ @see GFVXBLT, GFVxBlt(), #GFVX_VIP_AUTO_TRIGER_BLT
+*/
+#define GFVX_AUTO_BLT 0x00000400
+
+/** VxAPI GFVXBLT::BltOption flagbit: Auto-blit at end of VIP frame.
+ This flag is the same as #GFVX_AUTO_BLT
+ @version SC15 and above only
+ @see GFVXBLT, GFVxBlt(), #GFVX_VIP_AUTO_TRIGER_BLT, #GFVX_AUTO_BLT
+*/
+#define GFVX_BLT_AUTO_VI 0x00000400
+
+/** VxAPI GFVXBLT::BltOption flagbit: Auto-display destination surface.
+ The application does not need call GFVxFlip() to show the surface.
+ With the auto-display option, the VI module triggers stretch blit which
+ in turn sends the destination surface's buffer address to the display
+ controller (GC). VI input data goes into double buffers which become the
+ stretch blit source, the output of stretch blit is also double buffered.
+ @see GFVXBLT, GFVxBlt()
+*/
+#define GFVX_AUTO_DISPLAY 0x00000800
+
+/** VxAPI GFVXBLT::BltOption flagbit: Auto-display destination surface.
+ This flag is the same as #GFVX_AUTO_DISPLAY
+ @version SC15 and above only
+ @see GFVXBLT, GFVxBlt(), #GFVX_AUTO_DISPLAY
+*/
+#define GFVX_BLT_AUTO_DISPLAY 0x00000800
+
+/** VxAPI GFVXBLT::BltOption flagbit: Set up parameters for partial blit
+ If this flag is set, GFVxBlt() configures blit parameters for
+ partial blit. The partial blit works only with circular buffers and
+ source and destination format are not YUV planar format.
+ @see GFVXBLT, GFVxBlt()
+*/
+#define GFVX_BLT_PARTIAL 0x00001000
+
+/** VxAPI GFVXBLT::BltOption flagbit: Trigger partial blit
+ If this flag is set, GFVxBlt() will blit buffer specified
+ in buffer index option of circular buffers to destination surface.
+ The use of this flag is to be combined with GFVxBlt() flag
+ #GFVX_BLT_PARTIAL.
+ @see GFVXBLT, GFVxBlt(), #GFVX_BLT_PARTIAL
+*/
+#define GFVX_BLT_PARTIAL_TRIGGER 0x00002000
+
+/** VxAPI GFVXBLT::BltOption flagbit: Blit without rotation
+ If this flag is set, GFVxBlt() blits without rotation
+ @see GFVXBLT, GFVxBlt()
+*/
+#define GFVX_BLT_ROTATE_0 0x00004000
+
+/** VxAPI GFVXBLT::BltOption flagbit: Blit with 90 degree rotation
+ If this flag is set, GFVxBlt() blits with 90 degree rotation
+ Currently, SC15 doesn't support this feature. However, this flag
+ can be combined with flag GFVX_BLT_H_FLIP to blit with XY swap
+ @see GFVXBLT, GFVxBlt()
+*/
+#define GFVX_BLT_ROTATE_90 0x00008000
+
+/** VxAPI GFVXBLT::BltOption flagbit: Blit with 180 degree rotation
+ If this flag is set, GFVxBlt() blits with 180 degree rotation
+ Currently, SC15 doesn't support this feature.
+ @see GFVXBLT, GFVxBlt()
+*/
+#define GFVX_BLT_ROTATE_180 0x00010000
+
+/** VxAPI GFVXBLT::BltOption flagbit: Blit with 270 degree rotation
+ If this flag is set, GFVxBlt() blits with 270 degree rotation
+ Currently, SC15 doesn't support this feature. However, this flag
+ can be combined with flag GFVX_BLT_V_FLIP to blit with XY swap
+ @see GFVXBLT, GFVxBlt()
+*/
+#define GFVX_BLT_ROTATE_270 0x00020000
+
+/** VxAPI GFVXBLT::BltOption flagbit: Blit with horizontal flip
+ If this flag is set, GFVxBlt() blits with horizontal flip
+ Currently, SC15 doesn't support this feature.
+ @see GFVXBLT, GFVxBlt()
+*/
+#define GFVX_BLT_H_FLIP 0x00040000
+
+/** VxAPI GFVXBLT::BltOption flagbit: Blit with vertical flip
+ If this flag is set, GFVxBlt() blits with vertical flip
+ Currently, SC15 doesn't support this feature
+ @see GFVXBLT, GFVxBlt()
+*/
+#define GFVX_BLT_V_FLIP 0x00080000
+
+/** VxAPI GFVXBLT::BltOption flagbit: Auto-display destination surface
+ using overlay window 2. This is exactly identical to #GFVX_AUTO_DISPLAY
+ except that it uses overlay window 2 instead of overlay window 1 (default).
+
+ @version SC15 and above only
+ @see GFVXBLT, GFVxBlt()
+*/
+#define GFVX_AUTO_DISPLAY_OVERLAY2 0x00100000
+
+/** VxAPI GFVXBLT::BltOption flagbit: Auto-display destination surface
+ using overlay window 2. This flag is the same as #GFVX_AUTO_DISPLAY_OVERLAY2
+ @version SC15 and above only
+ @see GFVXBLT, GFVxBlt(), #GFVX_AUTO_DISPLAY_OVERLAY2
+*/
+#define GFVX_BLT_AUTO_DISPLAY_OVERLAY2 0x00100000
+
+/** VxAPI GFVXBLT::BltOption flagbit: Enables full range in color spce conversion
+ 0<= Y <=255, -128<= U <=127, -128<= V <=127
+ YUV-->RGB conversion formula:
+ R = 1.000Y + 1.402V
+ G = 1.000Y - 0.344U - 0.714V
+ B = 1.000Y + 1.772U
+ This option is useful for decoded video from movies.
+ When this flag is not set, uses CCIR601 range (16-235) as follows:
+ 16<= Y <=235, 16<= U <=240, 16<= V <=240
+ YUV-->RGB conversion formula:
+ R = 1.164(Y-16) + 1.596(Cr-128)
+ G = 1.164(Y-16) - 0.391(Cb-128) - 0.813(Cr-128)
+ B= 1.164(Y-16) + 2.018(Cb-128)
+ This option is useful for video from camera.
+ @version SC15 and above only
+ @see GFVXBLT, GFVxBlt()
+*/
+#define GFVX_BLT_CSC_FULL_RANGE 0x00200000
+
+/** VxAPI GFVXBLT::BltOption flagbit: Enable camera VSync wait.
+ Enable GFVxBlt() synchronization with camera VSync. Note that
+ if the camera is disabled there is no VSync signal and GFVxBlt()
+ would block.
+ @see GFVXBLT, GFVxBlt()
+*/
+#define GFVX_BLT_ENABLE_WAIT_CAMERA_VSYNC 0x00400000
+
+/** VxAPI GFVXBLT::BltOption flagbit: Disable vertical and horizontal filters
+ By default, the vertical and horizontal filters are enabled. If this flag
+ is set, GFVxBlt() blits with filters disabled
+ @see GFVXBLT, GFVxBlt()
+*/
+#define GFVX_BLT_DISABLE_FILTERS 0x00800000
+
+/** VxAPI option parameter of routines GFVxBltSetCSCCoefff()
+ and GFVxVIPSetCSCCoeff() to use CCIR601 range
+
+ CSC_USE_CCIR601_RANGE (16-235) as follows:
+ 16<= Y <=235, 16<= U <=240, 16<= V <=240
+ YUV-->RGB conversion formula:
+
+ R = sat(KYRGB*(Y + YOF) + KUR*U + KVR*V)
+ G = sat(KYRGB*(Y + YOF) + KUG*U + KVG*V)
+ B = sat(KYRGB*(Y + YOF) + KUB*U + KVB*V)
+
+ The CSC coefficients are:
+
+ KYRGB, KUR, KVR 1.1644 0.0000 1.5960
+ KYRGB, KUG, KVG = 1.1644 -0.3918 -0.8130
+ KYRGB, KUB, KVB 1.1644 2.0172 0.0000
+
+ and YOF = -16.0000
+ This option is useful for video from camera.
+
+ @see GFVxBltSetCSCCoeff(), GFVxVIPSetCSCCoeff()
+*/
+#define GFVX_SET_CSC_USE_CCIR601_RANGE 0x00800000
+
+/** VxAPI option parameter of routines GFVxBltSetCSCCoefff()
+ and GFVxVIPSetCSCCoeff() to use full range in color space conversion
+
+ CSC_USE_FULL_RANGE
+ 0<= Y <=255, -128<= U <=127, -128<= V <=127
+ YUV-->RGB conversion formula:
+
+ R = sat(KYRGB*(Y + YOF) + KUR*U + KVR*V)
+ G = sat(KYRGB*(Y + YOF) + KUG*U + KVG*V)
+ B = sat(KYRGB*(Y + YOF) + KUB*U + KVB*V)
+
+ The CSC coefficients are:
+
+ KYRGB, KUR, KVR 1.0000 0.0000 1.4020
+ KYRGB, KUG, KVG = 1.0000 -0.3440 -0.7140
+ KYRGB, KUB, KVB 1.0000 1.7720 0.0000
+
+ and YOF = 0.0000
+ This option is useful for decoded video from movies.
+ @see GFVxBltSetCSCCoeff(), GFVxVIPSetCSCCoeff()
+*/
+#define GFVX_SET_CSC_USE_FULL_RANGE 0x01000000
+
+/** VxAPI option parameter of routines GFVxBltSetCSCCoefff()
+ and GFVxVIPSetCSCCoeff() to use user defined range
+ provided in option parameter pCoeff pointer to GFVXCSCCOEF struct
+
+ @see GFVxBltSetCSCCoeff(), GFVxVIPSetCSCCoeff()
+*/
+#define GFVX_SET_CSC_USE_USER_DEFINED_RANGE 0x02000000
+/** Structure to control GFVxBlt() behaviour.
+ @see GFVxBlt()
+*/
+
+typedef struct _GFVXBLT
+{
+ PGFRMSURFACE *ppDestSurf; /**< Pointer to an array of destination
+ surfaces of identical dimensions.
+
+ For passing scaled YUV output data to
+ the planar block as input to the
+ JPEG/MPEG encoder, pass an array containing
+ one NULL pointer.
+
+ Destination surface dimensions limitations:
+
+ Minimum stride 0 bytes
+ Minimum width 1
+ Minimum height 1
+ Maximum stride 4095 bytes
+ Maximum width 4064 (YUV)
+ (YUV data restricted by JPEG encoder),
+ 32767 (RGB)
+ (RGB data restricted by stride)
+
+ Maximum height 32766, or unlimited
+ if \a pDestRect is specified
+
+
+ If the destination color format is YUV (pass to
+ JPEG/MPEG EPP, and \a pDestRect is not specified,
+ the surface width must be a multiple of 2.
+ */
+ PGFRMSURFACE *ppSrcSurf; /**< Pointer to an array of source surfaces
+ of identical dimensions.
+ Source surface dimensions limitations:
+
+ Minimum stride 0 bytes
+ Minimum width 1
+ Minimum height 1
+ Maximum stride 4095 bytes
+ Maximum width
+ 16383 (SC15),
+ 2032 (SC12),
+ 496 (SC5, RGB or YUV422), 512 (SC5),
+ 496 (SC10, SC4),
+ 312 (SC3 and below),
+ or unlimited if \a pSrcRect is specified
+
+ Maximum height 32766, or unlimited
+ if \a pDestRect is specified
+
+ */
+ PGFRECT pDestRect; /**< Destination rectangle, or NULL to blit
+ scaled to the size of the entire target
+ surface (size of first surface in
+ \a ppDestSurf is used).
+ Destination cropping rectangle limitations:
+
+ Minimum width 1
+ Minimum height 1
+ Maximum width 4064 (YUV),
+ 32767 (RGB)
+
+ Maximum height 32766
+
+
+ If the destination color format is YUV (pass to
+ JPEG/MPEG EPP), the destination cropping rectangle's
+ width must be a multiple of 2.
+ */
+ PGFRECT pSrcRect; /**< Source cropping rectangle, or NULL for
+ no cropping and blit the entire source
+ surface (size of first surface in
+ \a ppSrcSurf is used).
+ Source cropping rectangle limitations:
+
+ Minimum width 1
+ Minimum height 1
+ Maximum width
+ 16383 (SC15),
+ 2032 (SC12),
+ 496 (SC5, RGB or YUV422), 512 (SC5),
+ 496 (SC10, SC4),
+ 312 (SC3 and below)
+
+ Maximum height 32766
+
+ */
+ NvU32 numofDestSurf;/**< Number of destination surfaces in array
+ \a ppDestSurf, used only if
+ #GFVX_AUTO_BLT flag set
+ */
+ NvU32 numofSrcSurf; /**< Number of source surfaces in array
+ \a ppSrcSurf, used only if
+ #GFVX_AUTO_BLT flag or #GFVX_BLT_PARTIAL flag set
+ */
+ NvU32 colorKey; /**< Color key value in RGB888 format */
+ NvU32 BltOption; /**< Flag bitmask:
+
+ #GFVX_BLT_DISABLE_WAIT_VSYNC
+ Disable VSync
+
+ #GFVX_BLT_SRC_KEY
+ Source color key
+
+ #GFVX_AUTO_BLT
+ Auto-blit at end of VIP frame
+
+ #GFVX_AUTO_DISPLAY
+ Auto-show destination surface
+ #GFVX_AUTO_DISPLAY_OVERLAY2
+ Auto-show destination surface from overlay window 2
+
+ #GFVX_BLT_PARTIAL
+ Configure partial blit parameters
+
+ #GFVX_BLT_PARTIAL_TRIGGER
+ Trigger partial blit at end of circular buffer
+
+ #GFVX_BLT_ENABLE_WAIT_CAMERA_VSYNC
+ Enable wait for camera VSYNC
+
+
+ */
+ // Fill The following fields if GFVX_BLT_PARTIAL_TRIGGER is set in BltOption
+ NvU32 FrameStart; /* @Notify start of frame.
+ Used only if #GFVX_BLT_PARTIAL_TRIGGER is set
+ in \a BltOption.
+ */
+ NvU32 FrameEnd; /* @Notify end of frame.
+ Used only if #GFVX_BLT_PARTIAL_TRIGGER is set
+ in \a BltOption.
+ */
+ NvU32 BufferIndex; /* @Specify which buffer of circular buffers is blitted.
+ Used only if #GFVX_BLT_PARTIAL_TRIGGER is set
+ in \a BltOption.
+ */
+} GFVXBLT, *PGFVXBLT;
+
+/** VxAPI GFVXFLIP::FlipOption flagbit: Flip uses second overlay window.
+
+ By default, VxFlip associates foreground and background surfaces
+ to first overlay window and flips them. However, the application can override
+ the default behavior and use second overlay window by using this flag in FlipOption.
+
+ This option should be used only if second overlay surface has been
+ previously set using UpdateOverlay(). .
+
+ @version SC15 and above only
+ @see GFVXFLIP, GFVxFlip()
+*/
+#define GFVX_FLIP_OVERLAY2 0x00000001
+
+/** Structure to control GFVxFlip() behaviour.
+ @see GFVxFlip()
+*/
+typedef struct _GFVXFLIP
+{
+ PGFRMSURFACE pBackGroundSurf; /**< Pointer to the surface to be flipped
+ to the background. This surface will
+ not be seen anymore after the
+ GFVxFlip() call.
+ */
+ PGFRMSURFACE pForeGroundSurf; /**< Pointer to the surface to be flipped
+ to the foreground. This surface will
+ be seen after the GFVxFlip() call.
+ */
+ NvU32 FlipOption;
+ /**< Flagbit mask controlling flip:
+
+ 0
+ Default. Flip uses first overlay window
+ GFVX_FLIP_SECOND_OVERLAY
+ Flip uses second overlay window
+
+ */
+} GFVXFLIP, *PGFVXFLIP;
+
+
+/** VxAPI GFVXUPDATEOVERLAY::UpdateOption flagbit: Overlay without rotation.
+ @see GFVXUPDATEOVERLAY, GFVxUpdateOverlay()
+*/
+#define GFVX_UO_ROTATE_0 GF_SURFACE_ROTATE_0
+
+/** VxAPI GFVXUPDATEOVERLAY::UpdateOption flagbit: Overlay with 180 degree rotation.
+ @see GFVXUPDATEOVERLAY, GFVxUpdateOverlay()
+*/
+#define GFVX_UO_ROTATE_180 GF_SURFACE_ROTATE_180
+
+/** VxAPI GFVXUPDATEOVERLAY::UpdateOption flagbit: Overlay with horizontal
+ flip.
+ @see GFVXUPDATEOVERLAY, GFVxUpdateOverlay()
+*/
+#define GFVX_UO_H_FLIP 0x00000010
+
+/** VxAPI GFVXUPDATEOVERLAY::UpdateOption flagbit: Overlay with vertical
+ flip.
+ @see GFVXUPDATEOVERLAY, GFVxUpdateOverlay()
+*/
+#define GFVX_UO_V_FLIP 0x00000020
+
+/** VxAPI GFVXUPDATEOVERLAY::UpdateOption flagbit: Source color keying.
+
+ A pixel from the source (overlay) surface is displayed only if pixel
+ color from the source surface matches the color key in
+ GFVXUPDATEOVERLAY::ColorKey.
+
+ Source color keying is not useful for video overlay, because changing
+ video is the source.
+
+ @see GFVXUPDATEOVERLAY, GFVxUpdateOverlay(), GFVX_UO_DEST_COLOR_KEY
+*/
+#define GFVX_UO_SRC_COLOR_KEY 0x00010000
+
+/** VxAPI GFVXUPDATEOVERLAY::UpdateOption flagbit: Destination color keying.
+
+ A pixel from the source (overlay) surface is displayed only if pixel
+ color from the destination surface matches the color key in
+ GFVXUPDATEOVERLAY::ColorKey.
+
+ @see GFVXUPDATEOVERLAY, GFVxUpdateOverlay(), GFVX_UO_SRC_COLOR_KEY
+*/
+#define GFVX_UO_DEST_COLOR_KEY 0x00020000
+
+/** VxAPI GFVXUPDATEOVERLAY::UpdateOption flagbit: Alpha blending.
+ Enable alpha blending. Alpha value is used from
+ GFVXUPDATEOVERLAY::AlphaValue.
+
+ As AlphaVal increases, the weight of source (overlay) window increases
+ until the window reaches its maximum weight of 0xFF.
+
+ Even though AlphaVal is a 32 bit number, alpha value can only be a 8 bit value.
+ Application should specify the same value in byte 1 (LSB), 2 and 3 else the API
+ will fail.
+
+ @see GFVXUPDATEOVERLAY, GFVxUpdateOverlay()
+*/
+#define GFVX_UO_ALPHA_BLENDING 0x00040000
+
+/** VxAPI GFVXUPDATEOVERLAY::UpdateOption flagbit: Overlay based on
+ destination alpha only.
+
+ If destination is in 1-bit alpha format (eg ARGB1555), GFVXUPDATEOVERLAY::ColorKey bit[24]
+ contains the alpha value. GFVxUpdateOverlay() compares this value with
+ the target surface's alpha and ignores the RGB value. Overlay (source) surface
+ shows up in portions of the screen where the two match.
+
+ @see GFVXUPDATEOVERLAY, GFVxUpdateOverlay()
+*/
+#define GFVX_UO_COLOR_KEY_ALPHA_ONLY 0x00080000
+
+/** VxAPI GFVXUPDATEOVERLAY::UpdateOption flagbit: Overlay based on
+ destination alpha and color
+
+ If destination is in 1-bit alpha format (eg ARGB1555),
+ GFVXUPDATEOVERLAY::ColorKey bit [24] contains alpha and
+ GFVXUPDATEOVERLAY::ColorKey bit [23:0] contains RGB color values.
+ GFVxUpdateOverlay() compares the key's alpha value and
+ color values with destination surface pixels.
+
+ Overlay (source) surface shows up in portions of the screen where both
+ alpha and color values match.
+
+ If neither #GFVX_UO_COLOR_KEY_ALPHA_ONLY nor #GFVX_UO_COLOR_KEY_ALPHA_COLOR are
+ set, GFVxUpdateOverlay() assumes the RGB values in
+ GFVXUPDATEOVERLAY::ColorKey to be valid and compares the RGB value with
+ surface's RGB value. Depending upon whether #GFVX_UO_SRC_COLOR_KEY or
+ #GFVX_UO_DEST_COLOR_KEY is defined, RGB value is compared with source or
+ destination pixels. If neither #GFVX_UO_SRC_COLOR_KEY nor #GFVX_UO_DEST_COLOR_KEY
+ is defined, overlay(source) surface is overlayed on top of destination surface
+ without any match. #GFVX_UO_COLOR_KEY_ALPHA_ONLY nor #GFVX_UO_COLOR_KEY_ALPHA_COLOR
+ if defined, are ignored.
+
+ @see GFVXUPDATEOVERLAY, GFVxUpdateOverlay()
+*/
+#define GFVX_UO_COLOR_KEY_ALPHA_COLOR 0x00100000
+
+/** VxAPI GFVXUPDATEOVERLAY::UpdateOption flagbit: Alpha blending based on
+ destination alpha.
+
+ If destination is in 1-bit alpha format (eg ARGB1555),
+ GFVXUPDATEOVERLAY::BlendingColorKey bit [24] contains an alpha value.
+ GFVxUpdateOverlay() compares this value with the destination surface's
+ alpha only and ignores the RGB value.
+
+ If the two match, GFVXUPDATEOVERLAY::AlphaValue determines the weight
+ of source surface.
+
+ @see GFVXUPDATEOVERLAY, GFVxUpdateOverlay()
+*/
+#define GFVX_UO_BLD_COLOR_KEY_ALPHA_ONLY 0x00200000
+
+/** VxAPI GFVXUPDATEOVERLAY::UpdateOption flagbit: Alpha blending based on
+ destination alpha and color
+
+ If destination is in 1-bit alpha format (eg ARGB1555),
+ GFVXUPDATEOVERLAY::BlendingColorKey bit [24] contains an alpha value and
+ GFVXUPDATEOVERLAY::BlendingColorKey bit [23:0] contains RGB values.
+ GFVxUpdateOverlay() compares alpha value and color value with the
+ destination surface's alpha and color value.
+
+ Source and destination pixels appear blended in portions of the screen where both
+ alpha and color values match. GFVXUPDATEOVERLAY::AlphaValue determines the weight
+ of source surface.
+
+ If neither #GFVX_UO_BLD_COLOR_KEY_ALPHA_ONLY nor #GFVX_UO_BLD_COLOR_KEY_ALPHA_COLOR
+ are set, GFVxUpdateOverlay() assumes the RGB portion in the key to be
+ valid and compares the RGB value with the surface's RGB value.
+
+ @see GFVXUPDATEOVERLAY, GFVxUpdateOverlay()
+*/
+#define GFVX_UO_BLD_COLOR_KEY_ALPHA_COLOR 0x00400000
+
+/** VxAPI GFVXUPDATEOVERLAY::UpdateOption flagbit: Enable Second overlay window
+
+ SC15 supports two overlay windows. This flag is used to enable
+ the second overlay window.
+
+ @version SC15 and above only
+ @see GFVXUPDATEOVERLAY, GFVxUpdateOverlay()
+*/
+#define GFVX_UO_OVERLAY2 0x00800000
+
+/** VxAPI GFVXUPDATEOVERLAY::UpdateOption flagbit: Show this overlay window on top
+
+ When more than one overlay windows are enabled and their destination rectangles
+ overlap, this flag can be defined to indicate which overlay window should appear
+ on top.
+
+ By default, first overlay window will appear on top if destination
+ rectangles for the two windows overlap. However, application can override the
+ default behavior by specifying #GFVX_UO_ACTIVETOP flag in relevant windows's
+ UpdateOption.
+
+ @version SC15 and above only
+ @see GFVXUPDATEOVERLAY, GFVxUpdateOverlay()
+*/
+#define GFVX_UO_ACTIVETOP 0x01000000
+
+/** VxAPI GFVXUPDATEOVERLAY::UpdateOption flagbit: Overlay and Blend weight
+ comes from per-pixel alpha channel.
+
+ @version SC15 and above only
+ @see GFVXUPDATEOVERLAY, GFVxUpdateOverlay()
+*/
+#define GFVX_UO_COLOR_KEY_PER_PIXEL_ALPHA 0x02000000
+
+/** VxAPI GFVXUPDATEOVERLAY::UpdateOption flagbit: Enable digital vibrance for
+ overlay.
+
+ If this bit is set in UpdateOption, then dvRed, dvGreen and dvBlue must be
+ set in UpdateOverlay structure for overlay window.
+
+ If this bit is set in UpdateOption2, then dvRed2, dvGreen2 and dvBlue2 must be
+ set in UpdateOverlay structure for overlay2 window.
+
+ @version SC15 and above only
+ @see GFVXUPDATEOVERLAY, GFVxUpdateOverlay()
+*/
+#define GFVX_UO_DIGITAL_VIBRANCE 0x04000000
+
+/** VxAPI GFVXUPDATEOVERLAY::UpdateOption2 flagbit: Enable AlphaValue2
+
+ If this bit is set in UpdateOption2, then the alpha value is used
+ from GFVXUPDATEOVERLAY::AlphaValue2
+
+ @version SC15 and above only
+ @see GFVXUPDATEOVERLAY, GFVxUpdateOverlay()
+*/
+#define GFVX_UO_USE_ALPHAVALUE2 0x08000000
+
+/** Structure for controlling GFVxUpdateOverlay() behaviour.
+ @see GFVxUpdateOverlay()
+*/
+typedef struct _GFVXUPDATEOVERLAY
+{
+ PGFRMSURFACE pDestSurf; /**< Destination surface pointer */
+ PGFRMSURFACE pSrcSurf; /**< Source surface pointer, if this pointer
+ is NULL, disable overlay.
+ */
+ PGFRECT pDestRect; /**< Destination rectangle */
+ PGFRECT pSrcRect; /**< Source rectangle */
+ NvU32 ColorKey; /**< Color key value in ARGB32 format.
+ Color keying takes effect only when
+ #GFVX_UO_SRC_COLOR_KEY or
+ #GFVX_UO_DEST_COLOR_KEY is set.
+ */
+ NvU32 UpdateOption;
+ /**< Flagbit mask controlling rotation, color keying:
+
+ #GFVX_UO_ROTATE_0
+ Overlay without rotation
+ #GFVX_UO_ROTATE_180
+ Overlay with 180 degree rotation
+ #GFVX_UO_H_FLIP
+ Overlay with horizontal flip
+ #GFVX_UO_V_FLIP
+ Overlay with vertical flip
+ #GFVX_UO_SRC_COLOR_KEY
+ Source color keying
+ #GFVX_UO_DEST_COLOR_KEY
+ Destination color keying
+ #GFVX_UO_ALPHA_BLENDING
+ Alpha blending
+ #GFVX_UO_COLOR_KEY_ALPHA_ONLY
+ Overlay based on destination alpha
+ #GFVX_UO_COLOR_KEY_ALPHA_COLOR
+ Overlay based on destination alpha and color
+ #GFVX_UO_BLD_COLOR_KEY_ALPHA_ONLY
+ Alpha Blending based on destination alpha
+ #GFVX_UO_BLD_COLOR_KEY_ALPHA_COLOR
+ Alpha Blending based on destination alpha and color
+ #GFVX_UO_OVERLAY2
+ Enable second overlay window
+ #GFVX_UO_ACTIVETOP
+ Show this overlay window on top
+ #GFVX_UO_DIGITAL_VIBRANCE
+ Enable digital vibrance for first overlay window
+
+ */
+ NvU32 BlendingColorKey;
+ /**< Blending color key value in ARGB32 format.
+ Value takes effect only when #GFVX_UO_ALPHA_BLENDING and
+ (#GFVX_UO_SRC_COLOR_KEY or #GFVX_UO_DEST_COLOR_KEY)
+ are set.
+ */
+ NvU32 AlphaValue;
+ /**< Alpha value for blending overlay.
+ Alpha value is used to do blending when
+ blending color key matches. Even though AlphaVal
+ is a 32 bit number, alpha value can only be a 8 bit value.
+ Application should specify the same value in byte 1 (LSB),
+ 2 and 3 else the API will fail.
+ */
+
+ PGFRMSURFACE pDestSurf2; /**< Destination surface pointer for second overlay */
+ PGFRMSURFACE pSrcSurf2; /**< Source surface pointer for second overlay,
+ if this pointer is NULL, disable second overlay.
+ */
+ PGFRECT pDestRect2; /**< Destination rectangle for second overlay */
+ PGFRECT pSrcRect2; /**< Source rectangle for second overlay */
+ NvU32 UpdateOption2;
+ /**< Flagbit mask controlling rotation, color keying for second overlay:
+
+ #GFVX_UO_ROTATE_0
+ Overlay without rotation
+ #GFVX_UO_ROTATE_180
+ Overlay with 180 degree rotation
+ #GFVX_UO_H_FLIP
+ Overlay with horizontal flip
+ #GFVX_UO_V_FLIP
+ Overlay with vertical flip
+ #GFVX_UO_SRC_COLOR_KEY
+ Source color keying
+ #GFVX_UO_DEST_COLOR_KEY
+ Destination color keying
+ #GFVX_UO_ALPHA_BLENDING
+ Alpha blending
+ #GFVX_UO_COLOR_KEY_ALPHA_ONLY
+ Overlay based on destination alpha
+ #GFVX_UO_COLOR_KEY_ALPHA_COLOR
+ Overlay based on destination alpha and color
+ #GFVX_UO_BLD_COLOR_KEY_ALPHA_ONLY
+ Alpha Blending based on destination alpha
+ #GFVX_UO_BLD_COLOR_KEY_ALPHA_COLOR
+ Alpha Blending based on destination alpha and color
+ #GFVX_UO_ACTIVETOP
+ Show this overlay window on top
+ #GFVX_UO_DIGITAL_VIBRANCE
+ Enable digital vibrance for second overlay window
+
+ */
+ NvU8 dvRed; /**< Digital vibrance amplification factor for R overlay.
+ It is configured via GFVxUpdateOverlay(),
+ GFVXUPDATEOVERLAY::dvRed's valid value range
+ is 1 to 100.
+ */
+ NvU8 dvGreen; /**< Digital vibrance amplification factor for G overlay.
+ It is configured via GFVxUpdateOverlay(),
+ GFVXUPDATEOVERLAY::dvGreen's valid value range
+ is 1 to 100.
+ */
+ NvU8 dvBlue; /**< Digital vibrance amplification factor for B overlay.
+ It is configured via GFVxUpdateOverlay(),
+ GFVXUPDATEOVERLAY::dvBlue's valid value range
+ is 1 to 100.
+ */
+ NvU8 dvRed2; /**< Digital vibrance amplification factor for R overlay2.
+ It is configured via GFVxUpdateOverlay(),
+ GFVXUPDATEOVERLAY::dvRed2's valid value range
+ is 1 to 100.
+ */
+ NvU8 dvGreen2; /**< Digital vibrance amplification factor for G overlay2.
+ It is configured via GFVxUpdateOverlay(),
+ GFVXUPDATEOVERLAY::dvGreen2's valid value range
+ is 1 to 100.
+ */
+ NvU8 dvBlue2; /**< Digital vibrance amplification factor for B overlay2.
+ It is configured via GFVxUpdateOverlay(),
+ GFVXUPDATEOVERLAY::dvBlue2's valid value range
+ is 1 to 100.
+ */
+ NvU32 AlphaValue2;
+ /**< Alpha value for blending Window C overlay.
+ Same restriction as for GFVXUPDATEOVERLAY::AlphaValue apply.
+ */
+
+} GFVXUPDATEOVERLAY, *PGFVXUPDATEOVERLAY;
+
+
+/** Parameter structure for GFVxVIPFeedImage().
+ This structure describes the image data that is to be fed to the VIP
+ via the CPU host.
+ @see GFVxVIPFeedImage()
+*/
+typedef struct _GFVXVIPFEEDIMAGE
+{
+ PGFRMSURFACE pSurf; /**< Surface to feed data from, must be in a YUV
+ format and accessible by the host CPU
+ */
+ PGFRECT pSrcRect; /**< Source clipping rectangle for data feeding, or
+ NULL for no clipping
+ */
+} GFVXVIPFEEDIMAGE, *PGFVXVIPFEEDIMAGE;
+
+
+/** VxAPI GFVXVIPPROPERTY::Flag flagbit: VIP supports image shrinking.
+ @see GFVXVIPPROPERTY, GFVxVIPGetProperty(), GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_CAP_SHRINK 0x00000001
+
+/** VxAPI GFVXVIPPROPERTY::Flag flagbit: VIP supports image enlarging.
+ @see GFVXVIPPROPERTY, GFVxVIPGetProperty(), GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_CAP_ENLARGE 0x00000002
+
+/** VxAPI GFVXVIPPROPERTY::Flag flagbit: Parallel video input supported.
+ @see GFVXVIPPROPERTY, GFVxVIPGetProperty(), GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_CAP_PARALLEL 0x00000004
+
+/** VxAPI GFVXVIPPROPERTY::Flag flagbit: Serial video input supported.
+ @see GFVXVIPPROPERTY, GFVxVIPGetProperty(), GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_CAP_SERIAL 0x00000008
+
+/** VxAPI GFVXVIPPROPERTY::Flag flagbit: Vertical and horizontal flip supported
+ for VIP output RGB image.
+ @see GFVXVIPPROPERTY, GFVxVIPGetProperty(), GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_CAP_RGB_VH_FLIP 0x00000010
+
+/** VxAPI GFVXVIPPROPERTY::Flag flagbit: VIP can supply VClock and VHSync
+ signals to the camera chip.
+ @see GFVXVIPPROPERTY, GFVxVIPGetProperty(), GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_CAP_OUTPUT_VCLOCK_VHSYNC 0x00000020
+
+/** VxAPI GFVXVIPPROPERTY::Flag flagbit: VIP can supply a master clock to the
+ camera chip.
+ @see GFVXVIPPROPERTY, GFVxVIPGetProperty(), GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_CAP_OUTPUT_MASTER_CLOCK 0x00000040
+
+/** VxAPI GFVXVIPPROPERTY::Flag flagbit: VIP can accept a JPEG bitstream from
+ a camera with type A interface.
+ See section @ref pageVxOverview2 for description of type A, B, and C
+ interfaces.
+ @see GFVXVIPPROPERTY, GFVxVIPGetProperty(), GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_CAP_TYPE_A 0x00000080
+
+/** VxAPI GFVXVIPPROPERTY::Flag flagbit: VIP can accept a JPEG bitstream from
+ a camera with type B interface.
+ See section @ref pageVxOverview2 for description of type A, B, and C
+ interfaces.
+ @see GFVXVIPPROPERTY, GFVxVIPGetProperty(), GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_CAP_TYPE_B 0x00000100
+
+/** VxAPI GFVXVIPPROPERTY::Flag flagbit: VIP can accept a JPEG bitstream from
+ a camera with type C interface.
+ See section @ref pageVxOverview2 for description of type A, B, and C
+ interfaces.
+ @see GFVXVIPPROPERTY, GFVxVIPGetProperty(), GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_CAP_TYPE_C 0x00000200
+
+/** VxAPI GFVXVIPPROPERTY::Flag flagbit: VIP can accept Bayer format input.
+ @version SC15 and above
+ @see GFVXVIPPROPERTY, GFVxVIPGetProperty(), GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_CAP_BAYER 0x00000400
+
+/** VxAPI GFVXVIPPROPERTY::Flag flagbit: VIP can accept RGB565 format input.
+ @version SC15 and above
+ @see GFVXVIPPROPERTY, GFVxVIPGetProperty(), GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_CAP_RGB565 0x00000800
+
+/** VxAPI GFVXVIPPROPERTY::Flag flagbit: VIP can accept RGB888 format input.
+ @version SC15 and above
+ @see GFVXVIPPROPERTY, GFVxVIPGetProperty(), GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_CAP_RGB888 0x00001000
+
+/** VxAPI GFVXVIPPROPERTY::Flag flagbit: VIP can accept RGB444 format input.
+ @version SC15 and above
+ @see GFVXVIPPROPERTY, GFVxVIPGetProperty(), GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_CAP_RGB444 0x00002000
+
+/** VxAPI GFVXVIPPROPERTY::Flag flagbit: VIP can accept YUV420NP format input.
+ @version SC15 and above
+ @see GFVXVIPPROPERTY, GFVxVIPGetProperty(), GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_CAP_YUV420NP 0x00004000
+
+/** VxAPI GFVXVIPPROPERTY::Flag flagbit: VIP can accept JPEG image from camera
+ through type C_RAW interface. See section @ref pageVxOverview2.
+ @version SC15 and above
+ @see GFVXVIPPROPERTY, GFVxVIPGetProperty(), GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_CAP_TYPE_C_RAW 0x00008000
+
+/** Structure used by GFVxVIPGetProperty() to describe VIP capabilities.
+ @see GFVxVIPGetProperty()
+*/
+typedef struct _GFVXVIPPROPERTY
+{
+ NvU32 Flag; /**< Flag bitmask describing VIP capabilities:
+
+ #GFVX_VIP_CAP_SHRINK
+ VIP supports image shrinking
+ #GFVX_VIP_CAP_ENLARGE
+ VIP supports image enlarging
+ #GFVX_VIP_CAP_PARALLEL
+ Parallel video input supported
+ #GFVX_VIP_CAP_SERIAL
+ Serial video input supported
+ #GFVX_VIP_CAP_RGB_VH_FLIP
+ Vertical and horizontal flip supported for VIP
+ output RGB image
+ #GFVX_VIP_CAP_OUTPUT_VCLOCK_VHSYNC
+ VIP can supply VClock and VHSync signals to the
+ camera chip
+ #GFVX_VIP_CAP_OUTPUT_MASTER_CLOCK
+ VIP can supply a master clock to the
+ camera chip
+ #GFVX_VIP_CAP_TYPE_A
+ VIP can accept a JPEG bitstream from a camera with
+ type A interface
+ #GFVX_VIP_CAP_TYPE_B
+ VIP can accept a JPEG bitstream from a camera with
+ type B interface
+ #GFVX_VIP_CAP_TYPE_C
+ VIP can accept a JPEG bitstream from a camera with
+ type C interface
+ #GFVX_VIP_CAP_BAYER
+ VIP can accept Bayer format input
+ #GFVX_VIP_CAP_RGB565
+ VIP can accept RGB565 format input
+ #GFVX_VIP_CAP_RGB888
+ VIP can accept RGB888 format input
+ #GFVX_VIP_CAP_RGB444
+ VIP can accept RGB444 format input
+ #GFVX_VIP_CAP_YUV420NP
+ VIP can accept YUV420NP format input
+ #GFVX_VIP_CAP_TYPE_C_RAW
+ VIP can accept JPEG image from Camera through
+ type C_RAW interface
+
+ */
+ NvU32 DestFormat;/**< Supported color formats at VIP output, the returned
+ value is a logically OR'ed combination of the
+ following surface identifiers:
+
+ #GF_SURFACE_YUYV
+ YUV422 in YUYV order
+ #GF_SURFACE_YVYU
+ YUV422 in YVYU order
+ #GF_SURFACE_UYVY
+ YUV422 in UYVY order
+ #GF_SURFACE_VYUY
+ YUV422 in VYUY order
+ #GF_SURFACE_RGB565
+ RGB565, 16 bpp
+ #GF_SURFACE_RGB888
+ RGB888, 24 bpp
+ #GF_SURFACE_ARGB8888
+ ARGB8888, 32 bpp
+
+ To check if a specific colour format is
+ supported, logically AND \a DestFormat against the
+ format identifier and compare it as below:
+
+ if ((DestFormat & GF_SURFACE_RGB565) == GF_SURFACE_RGB565)
+ {
+ // RGB565 is supported
+ }
+
+ */
+ NvU32 HMaxNumerator; /**< Maximum horizontal numerator for VI
+ decimation. VI decimation is configured via
+ GFVxVIPSetVIP(), GFVXVIPINFO::HNumerator's
+ valid value range is 1 to \a HMaxNumerator.
+ */
+ NvU32 HMaxDenominator; /**< Maximum horizontal denominator for VI
+ decimation. VI decimation is configured via
+ GFVxVIPSetVIP(), GFVXVIPINFO::HDenominator's
+ valid value range is 1 to \a HMaxDenominator.
+ */
+ NvU32 VMaxNumerator; /**< Maximum vertical numerator for VI decimation.
+ VI decimation is configured via
+ GFVxVIPSetVIP(), GFVXVIPINFO::VNumerator's
+ valid value range is 1 to \a VMaxNumerator.
+ */
+ NvU32 VMaxDenominator; /**< Maximum vertical denominator for VI decimation.
+ VI decimation is configured via
+ GFVxVIPSetVIP(), GFVXVIPINFO::VDenominator's
+ valid value range is 1 to \a VMaxDenominator.
+ */
+} GFVXVIPPROPERTY, *PGFVXVIPPROPERTY;
+
+
+/** Structure used to describe the input frame size if input data format is Bayer.
+ This structure is not used when input source is VIP.
+ @see
+*/
+typedef struct _GFVXBAYERINPUTFRAME
+{
+ NvU16 Width; /**< Host Input source width. */
+ NvU16 Height; /**< Host Input source height. */
+} GFVXBAYERINPUTFRAME, *PGFVXBAYERINPUTFRAME;
+
+/** Structure used to describe ISP scan size if input data format is Bayer.
+ Scan size is camera specific.
+
+ The application should populate this structure with
+ values filled by GFCameraSetup() in GFCAMERATABLETYPE::GFCAMERARESOLUTIONTYPE::pBayerInfo.
+ The application should also configure ISP with values in
+ GFCAMERATABLETYPE::GFCAMERARESOLUTIONTYPE::pBayerInfo::ScanWidth and
+ GFCAMERATABLETYPE::GFCAMERARESOLUTIONTYPE::pBayerInfo::ScanHeight.
+
+ This structure is used only when input source is VIP and input data format is Bayer.
+
+ @see GFISPIMGTIMING
+*/
+typedef struct _GFVXBAYERSCANSIZE
+{
+ NvU16 HScan; /**< VIP input signal horizontal scan size. */
+ NvU16 VScan; /**< VIP input signal vertical scan size. */
+} GFVXBAYERSCANSIZE, *PGFVXBAYERSCANSIZE;
+
+/** Structure used to describe ISP Active Area if input data format is Bayer.
+ Active Area is camera specific.
+
+ The application should populate this structure with
+ values filled by GFCameraSetup() in GFCAMERATABLETYPE::GFCAMERARESOLUTIONTYPE::pBayerInfo.
+ The application should also configure ISP with values in
+ GFCAMERATABLETYPE::GFCAMERARESOLUTIONTYPE::pBayerInfo::ActiveFrameStart,
+ GFCAMERATABLETYPE::GFCAMERARESOLUTIONTYPE::pBayerInfo::ActiveLineStart,
+ GFCAMERATABLETYPE::GFCAMERARESOLUTIONTYPE::pBayerInfo::ActiveFrameHeight and
+ GFCAMERATABLETYPE::GFCAMERARESOLUTIONTYPE::pBayerInfo::ActiveLineWidth.
+
+ Active Area rectangle should fall inside the Scan Size.
+ This structure is used only when input source is VIP and input data format is Bayer.
+
+ @see GFISPIMGTIMING
+*/
+typedef struct _GFVXBAYERACTIVEAREA
+{
+ NvU16 LineStart; /**< VIP input signal horizontal active offset. */
+ NvU16 FrameStart; /**< VIP input signal vertical active offset. */
+ NvU16 LineWidth; /**< VIP input signal horizontal active width. */
+ NvU16 FrameHeight; /**< VIP input signal vertical active height. */
+} GFVXBAYERACTIVEAREA, *PGFVXBAYERACTIVEAREA;
+
+/** Structure used to describe ISP Output Area if input data format is Bayer.
+
+ This structure is not used by VI. It is used to configure ISP.
+ Output Area rectangle can be equal to or less than Active Area rectangle.
+ This structure is used only when input source is VIP and input data format is Bayer.
+
+ @see GFISPIMGTIMING
+*/
+typedef struct _GFVXBAYEROUTPUTAREA
+{
+ NvU16 LineStart; /**< VIP input signal horizontal output offset. */
+ NvU16 FrameStart; /**< VIP input signal vertical output offset. */
+ NvU16 LineWidth; /**< VIP input signal horizontal output width. */
+ NvU16 FrameHeight; /**< VIP input signal vertical output height. */
+} GFVXBAYEROUTPUTAREA, *PGFVXBAYEROUTPUTAREA;
+
+
+/** Structure used to describe the rectangles needed by ISP to properly process Bayer input from camera.
+ This structure is used only when input source is VIP and input data format is Bayer.
+
+ @see GFVXBAYERINPUTFRAME, GFVXBAYERSCANSIZE, GFVXBAYERACTIVEAREA, GFVXBAYEROUTPUTAREA
+*/
+typedef struct _GFVXBAYERINFO
+{
+ PGFVXBAYERINPUTFRAME pInputFrameSize; /**< For VIP input, this field is not used.
+ */
+ PGFVXBAYERSCANSIZE pScanSize; /**< ISP Scan Size.
+ Scan size is camera specific. This field is set
+ by GFCameraAPI in GFCAMERARESOLUTIONTYPE::pBayerInfo.
+ */
+ PGFVXBAYERACTIVEAREA pActiveArea; /**< ISP Active Area.
+ Active Area is camera specific. This field is set
+ by GFCameraAPI in
+ GFCAMERATABLETYPE::GFCAMERARESOLUTIONTYPE::pBayerInfo.
+ Active Area rectangle should fall inside the Scan Size.
+ */
+ PGFVXBAYEROUTPUTAREA pOutputArea; /**< ISP Output Area. This field is not used by VI.
+ Output Area rectangle can be equal to or less than
+ Active Area rectangle.
+ */
+ NvU8 DemosaicKernelSize; /**< For VIP input, this field is not used.
+ */
+ NvU16 IspDownscaleUsed; /**< Use Isp downscale (Only for sc17 and above)
+ */
+} GFVXBAYERINFO, *PGFVXBAYERINFO;
+
+
+///////////Cindy: Following is CSI defination.
+
+/* flags optoins */
+
+/** Pixel Parser stream is from CSI A
+*/
+#define GFVX_CSI_SOURCE_CSI_A 0x00000001
+
+/** Pixel Parser stream is from CSI B
+*/
+#define GFVX_CSI_SOURCE_CSI_B 0x00000002
+
+/** Pixel Parser stream is from HOST
+*/
+#define GFVX_CSI_SOURCE_HOST 0x00000004
+
+/** Pixel Parser stream is from VIP
+*/
+#define GFVX_CSI_SOURCE_VIP 0x00000008
+
+/** Pixel Parser A enable
+*/
+#define GFVX_CSI_PPA_ENABLE 0x00000010
+
+/** Pixel Parser B enable
+*/
+#define GFVX_CSI_PPA_DISABLE 0x00000020
+
+//#define GFVX_CSI_PPA_MASK 0x00000030
+
+/** Pixel Parser A enable
+*/
+#define GFVX_CSI_PPB_ENABLE 0x00000040
+
+/** Pixel Parser B enable
+*/
+#define GFVX_CSI_PPB_DISABLE 0x00000080
+
+//#define GFVX_CSI_PPB_MASK 0x000000C0
+
+/** whether packet header is sent in the beginning of packet or not. payload only mode: no header
+*/
+#define GFVX_CSI_PACKET_HEADER_ENABLE 0x00000100
+
+/** Check data_type and Virtural_Channel_ID or not
+*/
+#define GFVX_CSI_DATA_IDENTIFIER_ENABLE 0x00000200
+
+/** check WordCount from header or register
+*/
+#define GFVX_CSI_WORD_COUNT_SELECT_HEADER 0x00000400
+
+/** check ECC from header
+*/
+#define GFVX_CSI_HEADER_EC_DISABLE 0x00000800
+
+/** pad short line with 0
+*/
+#define GFVX_CSI_LINE_PAD_NONE 0x00001000
+
+/** pad short line with 1
+*/
+#define GFVX_CSI_LINE_PAD_1 0x00002000
+
+/** pad short frame with 0
+*/
+#define GFVX_CSI_FRAME_PAD_NONE 0x00004000
+
+/** pad short frame with 1
+*/
+#define GFVX_CSI_FRAME_PAD_1 0x00008000
+
+/** 2 bytes CRC Check enable
+*/
+#define GFVX_CSI_CRC_CHECK 0x00010000
+
+/** Embedded data enable
+*/
+#define GFVX_CSI_EMBEDDED_DATA_ENABLE 0x00020000
+
+/** enable timeout checking
+*/
+#define GFVX_CSI_LINE_TIMEOUT_ENABLE 0x00040000
+
+#define GFVX_CSI_VSYNC_START_MARK_VSYNC 0x00080000
+
+#define GFVX_CSI_VI_HSYNC_CONTROL 0x00100000
+
+#define GFVX_CSI_VI_VSYNC_CONTROL 0x00200000
+
+
+typedef struct _GFVXCSISET
+{
+ NvU32 flags; /** flag options see above */
+ NvU32 HOffset; /**< VIP input signal horizontal offset. */
+ NvU32 HActive; /**< VIP input signal horizontal active width. */
+ NvU32 VOffset; /**< VIP input signal vertical offset. */
+ NvU32 VActive; /**< VIP input signal vertical active height.*/
+ NvU32 ColorFormat; /** convert to data type*/
+
+// PIXEL_STREAM_PPA_COMMAND:
+ NvU32 StartMarkerFrameMin; //CSI_PPA_START_MARKER_FRAME_MIN; /** comment */
+ NvU32 StartMarkerFrameMax; //CSI_PPA_START_MARKER_FRAME_MAX; /** comment */
+
+// PIXEL_STREAM_A_CONTROL0:
+ NvU32 VirtualChannelID; //CSI_PPA_VIRTUAL_CHANNEL_ID; /** stream virtual ID number */
+ NvU32 OutputFormatOpt; //CSI_PPA_OUTPUT_FORMAT_OPTIONS; /** output format */
+
+// PIXEL_STREAM_A_CONTROL1:
+ NvU32 TopFieldFrame; //CSI_PPA_TOP_FIELD_FRAME; /** camera spec */
+ NvU32 TopFieldFrameMask; //CSI_PPA_TOP_FIELD_FRAME_MASK; /** camera sepc */
+
+// PIXEL_STREAM_A_GAP:
+ NvU32 LineMinGap; //PPA_LINE_MIN_GAP; /** gap between lines */
+ NvU32 FrameMinGap; //PPA_FRAME_MIN_GAP; /** gat between frames */
+
+// PIXEL_STREAM_A_EXPECTED_FRAME:
+ NvU32 LineTimeOutMaxClock; //PPA_MAX_CLOCKS; /** line time out value */
+
+} GFVXCSISET, *PGFVXCSISET;
+
+/* CSI data types
+ *` Set by camera script to match
+ * stream supplied by camera
+ */
+
+#define GFVX_CSI_DATA_YUV420_8 (24UL)
+#define GFVX_CSI_DATA_YUV420_10 (25UL)
+#define GFVX_CSI_DATA_LEG_YUV420_8 (26UL)
+#define GFVX_CSI_DATA_YUV420CSPS_8 (28UL)
+#define GFVX_CSI_DATA_YUV420CSPS_10 (29UL)
+#define GFVX_CSI_DATA_YUV422_8 (30UL)
+#define GFVX_CSI_DATA_YUV422_10 (31UL)
+#define GFVX_CSI_DATA_RGB444 (32UL)
+#define GFVX_CSI_DATA_RGB555 (33UL)
+#define GFVX_CSI_DATA_RGB565 (34UL)
+#define GFVX_CSI_DATA_RGB666 (35UL)
+#define GFVX_CSI_DATA_RGB888 (36UL)
+#define GFVX_CSI_DATA_RAW6 (40UL)
+#define GFVX_CSI_DATA_RAW7 (41UL)
+#define GFVX_CSI_DATA_RAW8 (42UL)
+#define GFVX_CSI_DATA_RAW10 (43UL)
+#define GFVX_CSI_DATA_RAW12 (44UL)
+#define GFVX_CSI_DATA_RAW14 (45UL)
+#define GFVX_CSI_DATA_ARB_DT1 (48UL)
+#define GFVX_CSI_DATA_ARB_DT2 (49UL)
+#define GFVX_CSI_DATA_ARB_DT3 (50UL)
+#define GFVX_CSI_DATA_ARB_DT4 (51UL)
+
+
+/** OutputFormatOpt */
+#define GFVX_CSI_OUTPUT_FORMAT_OPTIONS_ARBITRARY (0UL)
+#define GFVX_CSI_OUTPUT_FORMAT_OPTIONS_PIXEL (1UL)
+#define GFVX_CSI_OUTPUT_FORMAT_OPTIONS_PIXEL_REP (2UL)
+#define GFVX_CSI_OUTPUT_FORMAT_OPTIONS_STORE (3UL)
+
+#define GFVX_INTERNAL_DEBUG 0x10000000
+
+// Below defines are used only when input source is HOST and input format is Bayer
+// Since this is not a valid customer use case, we will not add Doxygen comments to these defines
+
+// Minimum padding requirement for ISP
+#define MIN_SCANSIZE_WIDTH_DIFF 20
+#define MIN_SCANSIZE_HEIGHT_DIFF 10
+
+// The actual minimum padding has not been determined;
+// however, 30 padding on all sides is not enough for
+// Demosaic mode 4 (5X5BPNR) with M3 statistics gathering.
+// 35 on right + 15 on top/left/bottom seems to
+// work fine.
+#define MIN_ACTIVE_AREA_LEFT_PADDING 15
+#define MIN_ACTIVE_AREA_RIGHT_PADDING 35
+#define MIN_ACTIVE_AREA_TOP_PADDING 15
+#define MIN_ACTIVE_AREA_BOTTOM_PADDING 15
+
+// Active Rect must be a few pixels larger than Output Rect to avoid
+// a halo effect where the outer pixels are wrong.
+#define MIN_OUTPUT_AREA_PADDING_3X3 2
+#define MIN_OUTPUT_AREA_PADDING_5X5 3
+
+
+/** Parameter structure passed to GFVxVIPSetVIP().
+ @see GFVxVIPSetVIP()
+*/
+typedef struct _GFVXVIPINFO
+{
+ NvU32 Flag;
+ /**< Flag bitmask, OR'ed combination of:
+
+ #GFVX_VIP_PARALLEL_INPUT
+ 8-bit/clock video data
+ #GFVX_VIP_SERIAL_INPUT
+ Serial input
+ #GFVX_VIP_HVSYNC_IN_STREAM
+ VHSYNC and VVSYNC in the data stream
+ #GFVX_VIP_EXTERNAL_VHSYNC
+ Camera VHSYNC asserted by external signal
+ #GFVX_VIP_INTERNAL_VHSYNC
+ Camera VHSYNC generated by GoForce chip
+ #GFVX_VIP_EXTERNAL_VCLK
+ VCLK generated externally
+ #GFVX_VIP_INTERNAL_VCLK
+ VCLK generated by GoForce chip
+ #GFVX_VIP_DETECT_FIELD
+ Detect field 0 or 1, will not work for internal VHSYNC
+ (#GFVX_VIP_INTERNAL_VHSYNC)
+
+ #GFVX_VIP_RGB_H_FLIP
+ Horizontal flip
+ #GFVX_VIP_RGB_V_FLIP
+ Vertical flip
+ #GFVX_VIP_HOST_IMAGE
+ CPU feeds image to VIP
+ #GFVX_VIP_CHANGE_DEFAULT_TIMING
+ Change the default timing for VHSYNC and VCLK
+ #GFVX_VIP_ASK_FOR_MCLOCK
+ Camera master clock provided by GoForce chip
+ #GFVX_VIP_TYPE_A
+ VIP input type A interface
+ #GFVX_VIP_TYPE_B
+ VIP input type B interface
+ #GFVX_VIP_TYPE_C
+ VIP input type C interface
+ #GFVX_VIP_DEST_BYTE_SWAP
+ Enable destination byte swap for YUV/RGB data written to
+ preview surface
+
+ #GFVX_VIP_TYPE_C_RAW
+ Do not remove the 0xFF, 0x02 sequence when camera is
+ running at type C interface
+
+ #GFVX_VIP_VIP_ROTATE_0
+ VI output without rotation
+ #GFVX_VIP_VIP_ROTATE_90
+ VI output with 90 degree rotation
+ #GFVX_VIP_VIP_ROTATE_180
+ VI output with 180 degree rotation
+ #GFVX_VIP_VIP_ROTATE_270
+ VI output with 270 degree rotation
+ #GFVX_VIP_RGB565
+ RGB565 input to EPP
+ #GFVX_VIP_RGB888
+ RGB888 input to EPP
+ #GFVX_VIP_RGB444
+ RGB444 input to EPP
+ #GFVX_VIP_BYPASS_MCLOCK_PIN
+ Bypass any manipulation on internal master clock generation
+ output pin
+
+ #GFVX_VIP_BYPASS_NON_MCLOCK_PINS
+ Bypass any manipulation on VCLK, VHSYNC, and VID[7:0] pins
+
+ #GFVX_VIP_PRE_GENERATE_MCLOCK
+ Pre-generation of master clock
+
+ */
+ NvU32 HOffset; /**< VIP input signal horizontal offset. */
+ NvU32 HActive; /**< VIP input signal horizontal active width. */
+ NvU32 VOffset; /**< VIP input signal vertical offset. */
+ NvU32 VActive; /**< VIP input signal vertical active height. */
+ NvU32 ColorFormat; /**< VIP input color format identifier, see
+ GFRMSURFACE::ColorFormat.
+ */
+ NvU32 SerialDelay; /**< VIP serial input delay, reserved for future
+ use.
+ */
+ NvU32 NewTiming; /**< Flag bitmask configuring VIP input timing, used
+ only if flag #GFVX_VIP_CHANGE_DEFAULT_TIMING
+ set, OR'ed combination of:
+
+ #GFVX_VIP_PDL_FALLING_VCLK
+ Parallel data latched at falling edge
+ of VCLK (default is rising edge)
+
+ #GFVX_VIP_SDL_RISING_VCLK
+ Serial data lacthed at rising edge of
+ VCLK (default is falling edge)
+
+ #GFVX_VIP_VHSYNC_ACTIVE_LOW
+ VHSYNC active low (default is active
+ high)
+
+ #GFVX_VIP_VVSYNC_ACTIVE_LOW
+ VVSYNC active low (default is active
+ high)
+
+ #GFVX_VIP_VHSYNC_ACTIVE_EDGE_LEAD
+ VHSYNC active leading edge (default
+ is trailing edge)
+
+ #GFVX_VIP_VVSYNC_ACTIVE_EDGE_LEAD
+ VVSYNC active leading edge (default
+ is trailing edge)
+
+ #GFVX_VIP_SFRAME_ACTIVE_LOW
+ Serial video frame sync active low,
+ falling edge indicates start of data
+ frame (default is active high, rising
+ edge indicates start of data frame)
+
+ #GFVX_VIP_SFRAME_SIZE_16
+ Serial video input is 16 bit per frame
+ (default is 8 bit per frame)
+
+ #GFVX_VIP_FILED_0_BOTTOM
+ Field 0 is bottom/even field
+ (default is top/odd field)
+
+ #GFVX_VIP_VCLK_OUTPUT_ACTIVE_LOW
+ VCLK output from GoForce chip active
+ low (default is active high)
+
+
+ */
+ NvU32 HNumerator; /**< VI decimation horizontal numerator, number of
+ pixels to keep from a group of incoming
+ pixels.
+ */
+ NvU32 HDenominator;/**< VI decimation horizontal denominator, group
+ size.
+ */
+ NvU32 VNumerator; /**< VI decimation vertical numerator, number of
+ lines to keep from a group of incoming lines.
+ */
+ NvU32 VDenominator;/**< VI decimation vertical numerator, group
+ size.
+ */
+ NvU32 MClockFreq; /**< Master clock frequency supplied to camera from
+ GoForce chip, used only if
+ #GFVX_VIP_ASK_FOR_MCLOCK set.
+ */
+ NvU32 VClockFreq; /**< Clock frequency required for VIP input signal.
+ */
+
+ // Fill The following fields if GFVX_VIP_INTERNAL_VHSYNC is set in Flag
+ NvU32 VHPulseWidth; /**< VHSYNC pulse width in number of VCLK cycles,
+ valid range is 1 to 8. Used only if
+ #GFVX_VIP_INTERNAL_VHSYNC is set.
+ */
+ NvU32 VHPulsePeriod;/**< VHSYNC pulse period in number of VCLK cycles,
+ valid range 32 to 2048. Used only if
+ #GFVX_VIP_INTERNAL_VHSYNC is set.
+ */
+ NvU32 VVPulseWidth; /**< VVSYNC pulse width in number of VCLK cycles
+ valid range is 1 to 8. Used only if
+ #GFVX_VIP_INTERNAL_VHSYNC is set.
+ */
+ NvU32 VVPulsePeriod;/**< VVSYNC pulse period in number of VCLK
+ valid range 32 to 1024. Used only if
+ #GFVX_VIP_INTERNAL_VHSYNC is set.
+ */
+ NvU32 VVDelay; /**< Number of VCLK cycles from the leading edge
+ of VHSYNC to the leading edge of VVSYNC,
+ valid range is -2 to 13. Used only if
+ #GFVX_VIP_INTERNAL_VHSYNC is set.
+ */
+ PGFVXBAYERINFO pBayerInfo; /**< Structure used to describe the rectangles needed by ISP
+ to properly process Bayer input from camera. This
+ structure is used only when input source is VIP and
+ input data format is Bayer.
+ */
+ PGFVXCSISET pCSIInfo; /** Structure used to describe CSI stream info. Only used when input source is CSI stream
+ */
+} GFVXVIPINFO, *PGFVXVIPINFO;
+
+
+/** VxAPI GFVXVIPUPDATE::UpdateOption action: Start VIP data feeding.
+ @see GFVXVIPUPDATE, GFVxVIPUpdate()
+*/
+#define GFVX_VIP_START 0x00000001
+
+/** VxAPI GFVXVIPUPDATE::UpdateOption action: Stop VIP data feeding.
+ @see GFVXVIPUPDATE, GFVxVIPUpdate()
+*/
+#define GFVX_VIP_STOP 0x00000002
+
+/** VxAPI GFVXVIPUPDATE::UpdateOption action: Start VIP data feeding with
+ synchronized auto-display surface after a frame is captured from VIP.
+ If no output surface is set (GFVXVIPUPDATE::ppSurf is NULL), this action
+ behaves in the same way as #GFVX_VIP_START.
+ @see GFVXVIPUPDATE, GFVxVIPUpdate()
+*/
+#define GFVX_VIP_AUTO_FLIP (0x00000004 | GFVX_VIP_START)
+
+/** VxAPI GFVXVIPUPDATE::UpdateOption action: Start VIP data feeding with
+ synchronized auto-blit from VIP output surface to another surface.
+
+ Parameters for the blit have to be set up separately via GFVxBlt() with
+ flag #GFVX_AUTO_BLT. Auto-blit is triggered after a complete frame has
+ been captured from VIP.
+
+ If no output surface is set (GFVXVIPUPDATE::ppSurf is NULL), this action
+ behaves in the same way as #GFVX_VIP_START.
+
+ Once auto-blit has been enabled it can be disabled with GFVxVIPUpdate()
+ action identifier #GFVX_VIP_AUTO_TRIGER_BLT_OFF.
+
+ @see GFVXVIPUPDATE, GFVxVIPUpdate(), #GFVX_VIP_AUTO_TRIGER_BLT_OFF,
+ #GFVX_AUTO_BLT
+*/
+#define GFVX_VIP_AUTO_TRIGER_BLT (0x00000008 | GFVX_VIP_START)
+
+/** VxAPI GFVXVIPUPDATE::UpdateOption action: Stop auto-blit that has been
+ enabled earlier via #GFVX_VIP_AUTO_TRIGER_BLT.
+
+ Note that this action only disables auto-blit. It does not disable the
+ VIP data feed. If also VIP is to be disabled, GFVxVIPUpdate() has to be
+ called again with action #GFVX_VIP_STOP.
+
+ @see GFVXVIPUPDATE, GFVxVIPUpdate()
+*/
+#define GFVX_VIP_AUTO_TRIGER_BLT_OFF 0x00000010
+
+/** VxAPI GFVXVIPUPDATE::UpdateOption action: Start VIP data feeding with
+ synchronized auto-display surface after a frame is captured from VIP.
+ Second Overlay Window is used instead of first.
+ If no output surface is set (GFVXVIPUPDATE::ppSurf is NULL), this action
+ behaves in the same way as #GFVX_VIP_START.
+
+ @version SC15 and above only
+ @see GFVXVIPUPDATE, GFVxVIPUpdate()
+*/
+#define GFVX_VIP_AUTO_FLIP_OVERLAY2 (0x00000020 | GFVX_VIP_START)
+
+/** VxAPI GFVXVIPUPDATE::UpdateOption action: Capture one frame in VIP buffer
+ if it is combined with flag #GFVX_VIP_START
+
+ @version SC15 and above only
+ @see GFVXVIPUPDATE, GFVxVIPUpdate()
+*/
+#define GFVX_VIP_CAPTURE_ONE_FRAME 0x00000040
+
+/** VxAPI GFVXVIPUPDATE::UpdateOption action: Restart VIP without changes VI
+ state after stop VI
+
+ @version SC15 and above only
+ @see GFVXVIPUPDATE, GFVxVIPUpdate()
+*/
+#define GFVX_VIP_RESTART 0x00000080
+
+/** Parameter structure for GFVxVIPUpdate().
+ @see GFVxVIPUpdate()
+*/
+typedef struct _GFVXVIPUPDATE
+{
+ PGFRMSURFACE *ppSurf; /**< Pointer to an array of VIP output surfaces
+ pointers, or NULL to feed to MPEG/JPEG without
+ display.
+ */
+ NvU32 numofSurf; /**< Number of surface pointers in \a ppSurf, valid
+ range is 1 to 2.
+ */
+ NvU16 XStart; /**< Destination surface X position for the output
+ from VIP
+ */
+ NvU16 YStart; /**< Destination surface Y position for the output
+ from VIP
+ */
+ NvU32 UpdateOption;
+ /**< Action identifier, one of:
+
+ #GFVX_VIP_START
+ Start VIP data feeding
+ #GFVX_VIP_STOP
+ Stop VIP data feeding
+ #GFVX_VIP_AUTO_FLIP
+ Start VIP data feeding and enable
+ auto-display of the last VIP target
+ surface
+
+ #GFVX_VIP_AUTO_TRIGER_BLT
+ Start VIP data feeding and enable
+ auto-blit from the last target surface
+ to additional surfaces
+
+ #GFVX_VIP_AUTO_TRIGER_BLT_OFF
+ Disable auto-blit
+
+ */
+} GFVXVIPUPDATE, *PGFVXVIPUPDATE;
+
+/** VxAPI VxBlt operation modes.
+ Constants to specify SB mode for a call to GFVxBltSetCSCCoeff().
+ @see GFVxBltSetCSCCoeff(), GFVxBltGetCSCCoeff()
+*/
+typedef enum
+{
+ /** Host full frame stretchblt trigger */
+ GFVX_BLT_FULL_MODE,
+
+ /** Host partial frame stretchblt trigger */
+ GFVX_BLT_PARTIAL_MODE,
+
+ /** Auto stretchblt trigger from VI */
+ GFVX_BLT_AUTO_VI_MODE
+} GFVXBLTMODE;
+
+/** VxAPI component level interrupt operation types.
+ Constants to specify operation for a call to GFVxInterruptControl().
+ @see GFVX_INTERRUPT_TYPE, GFVxInterruptControl()
+*/
+typedef enum
+{
+ /** Enable interrupt/status assertion for an interrupt type. */
+ GFVX_INTERRUPT_ENABLE,
+
+ /** Disable interrupt/status assertion for an interrupt type. */
+ GFVX_INTERRUPT_DISABLE,
+
+ /** Clear interrupt/status assertion for an interrupt type. */
+ GFVX_INTERRUPT_CLEAR,
+
+ /** Query for interrupt/status assertion for an interrupt type. */
+ GFVX_INTERRUPT_QUERY_STATUS,
+
+ /** Set Y-FIFO threshold. */
+ GFVX_INTERRUPT_SET_Y_FIFO_THRESHOLD,
+
+ /** Get Y-FIFO threshold. */
+ GFVX_INTERRUPT_GET_Y_FIFO_THRESHOLD,
+
+ /** Set V-counter threshold. */
+ GFVX_INTERRUPT_SET_V_COUNTER_THRESHOLD,
+
+ /** Get V-counter threshold. */
+ GFVX_INTERRUPT_GET_V_COUNTER_THRESHOLD,
+
+ /** Get all bits of VI interrupt status register. */
+ GFVX_INTERRUPT_GET_ALL_STATUS,
+
+ /** Clear all VI interrupt status bits. */
+ GFVX_INTERRUPT_CLEAR_ON_ALL_STATUS
+
+} GFVX_INTERRUPT_OPERATION_TYPE;
+
+/** VxAPI interrupt types.
+ @see GFVX_INTERRUPT_OPERATION_TYPE, GFVxInterruptControl()
+*/
+typedef enum
+{
+ /** VID[8] pin rising edge interrupt. */
+ GFVX_VD8PIN_RISING_EDGE_INTR = 0x0100001,
+ /** VID[9] pin rising edge interrupt. */
+ GFVX_VD9PIN_RISING_EDGE_INTR = 0x0100002,
+ /** VID[10] pin rising edge interrupt. */
+ GFVX_VD10PIN_RISING_EDGE_INTR = 0x0100004,
+ /** VID[11] pin rising edge interrupt. */
+ GFVX_VD11PIN_RISING_EDGE_INTR = 0x0100008,
+ /** VGP[4] pin rising edge interrupt. */
+ GFVX_VGP4PIN_RISING_EDGE_INTR = 0x0100010,
+ /** VGP[5] pin rising edge interrupt. */
+ GFVX_VGP5PIN_RISING_EDGE_INTR = 0x0100020,
+ /** VGP[6] pin rising edge interrupt. */
+ GFVX_VGP6PIN_RISING_EDGE_INTR = 0x0100040,
+ /** VHSYNC pin rising edge interrupt. */
+ GFVX_VHSYNC_RISING_EDGE_INTR = 0x0100080,
+ /** VVSYNC pin rising edge interrupt. */
+ GFVX_VVSYNC_RISING_EDGE_INTR = 0x0100100,
+
+ /** Vertical counter threshold interrupt. */
+ GFVX_VERTICAL_COUNTER_THRESHOLD_INTR = 0x0000200,
+ /** Y-FIFO threshold int. */
+ GFVX_Y_FIFO_THRESHOLD_INTR = 0x0000400,
+ /** Buffer done first output interrupt. */
+ GFVX_BUFFER_FIRST_OUTPUT_INTR = 0x0000800,
+ /** Frame done first output interr upt. */
+ GFVX_FRAME_FIRST_OUTPUT_INTR = 0x0001000,
+ /** Buffer done second output interrupt. */
+ GFVX_BUFFER_SECOND_OUTPUT_INTR = 0x0002000,
+ /** Frame done second output interrupt. */
+ GFVX_FRAME_SECOND_OUTPUT_INTR = 0x0004000,
+ /** VI to EPP error interrupt. */
+ GFVX_EPP_ERROR_INTR = 0x0008000,
+ /** YUV420PA error interrupt. */
+ GFVX_YUV420PA_ERROR_INTR = 0x0010000,
+ /** First output peer stall interrupt. */
+ GFVX_FIRST_OUTPUT_PEER_STALL_INTR = 0x0020000,
+ /** Second output peer stall interrupt. */
+ GFVX_SECOND_OUTPUT_PEER_STALL_INTR = 0x0040000,
+ /** DMA stall interrupt. */
+ GFVX_DMA_STALL_INTR = 0x0080000,
+
+
+ /** VD[8] pin falling edge interrupt. */
+ GFVX_VD8PIN_FALLING_EDGE_INTR = 0x0000001,
+ /** VD[9] pin falling edge interrupt. */
+ GFVX_VD9PIN_FALLING_EDGE_INTR = 0x0000002,
+ /** VD[10] pin falling edge interrupt. */
+ GFVX_VD10PIN_FALLING_EDGE_INTR = 0x0000004,
+ /** VD[11] pin falling edge interrupt. */
+ GFVX_VD11PIN_FALLING_EDGE_INTR = 0x0000008,
+ /** VGP[4] pin falling edge interrupt. */
+ GFVX_VGP4PIN_FALLING_EDGE_INTR = 0x0000010,
+ /** VGP[5] pin falling edge interrupt. */
+ GFVX_VGP5PIN_FALLING_EDGE_INTR = 0x0000020,
+ /** VGP[6] pin falling edge interrupt. */
+ GFVX_VGP6PIN_FALLING_EDGE_INTR = 0x0000040,
+ /** VHSYNC pin falling edge interrupt. */
+ GFVX_VHSYNC_FALLING_EDGE_INTR = 0x0000080,
+ /** VVSYNC pin falling edge interrupt. */
+ GFVX_VVSYNC_FALLING_EDGE_INTR = 0x0000100,
+
+ /** VD[8] pin rising edge interrupt. */
+ GFVX_VD8PIN_RISING_LEVEL_INTR = 0x1100001,
+ /** VD[9] pin rising edge interrupt. */
+ GFVX_VD9PIN_RISING_LEVEL_INTR = 0x1100002,
+ /** VD[10] pin rising edge interrupt. */
+ GFVX_VD10PIN_RISING_LEVEL_INTR = 0x1100004,
+ /** VD[11] pin rising edge interrupt. */
+ GFVX_VD11PIN_RISING_LEVEL_INTR = 0x1100008,
+ /** VGP[4] pin rising edge interrupt. */
+ GFVX_VGP4PIN_RISING_LEVEL_INTR = 0x1100010,
+ /** VGP[5] pin rising edge interrupt. */
+ GFVX_VGP5PIN_RISING_LEVEL_INTR = 0x1100020,
+ /** VGP[6] pin rising edge interrupt. */
+ GFVX_VGP6PIN_RISING_LEVEL_INTR = 0x1100040,
+ /** VHSYNC pin rising edge interrupt. */
+ GFVX_VHSYNC_RISING_LEVEL_INTR = 0x1100080,
+ /** VVSYNC pin rising edge interrupt. */
+ GFVX_VVSYNC_RISING_LEVEL_INTR = 0x1100100,
+
+ /** VD[8] pin falling level interrupt. */
+ GFVX_VD8PIN_FALLING_LEVEL_INTR = 0x1000001,
+ /** VD[9] pin falling level interrupt. */
+ GFVX_VD9PIN_FALLING_LEVEL_INTR = 0x1000002,
+ /** VD[10] pin falling level interrupt. */
+ GFVX_VD10PIN_FALLING_LEVEL_INTR = 0x1000004,
+ /** VD[11] pin falling level interrupt. */
+ GFVX_VD11PIN_FALLING_LEVEL_INTR = 0x1000008,
+ /** VGP[4] pin falling level interrupt. */
+ GFVX_VGP4PIN_FALLING_LEVEL_INTR = 0x1000010,
+ /** VGP[5] pin falling level interrupt. */
+ GFVX_VGP5PIN_FALLING_LEVEL_INTR = 0x1000020,
+ /** VGP[6] pin falling level interrupt. */
+ GFVX_VGP6PIN_FALLING_LEVEL_INTR = 0x1000040,
+ /** VHSYNC pin falling level interrupt. */
+ GFVX_VHSYNC_FALLING_LEVEL_INTR = 0x1000080,
+ /** VVSYNC pin falling level interrupt. */
+ GFVX_VVSYNC_FALLING_LEVEL_INTR = 0x1000100
+
+} GFVX_INTERRUPT_TYPE;
+
+/** VxAPI related attributes.
+ @see GFVxGetAttribute()
+*/
+typedef enum _GFVXATTRIBUTES
+{
+ /** VxAPI attribute: Video input interrupt status.
+ Use this attribute with GFVxGetAttribute() to read the current video
+ input interrupt status.
+
+ Interpretation of associated attribute value:
+
+ NvU32 Bitmask with interrupt status
+ For bitpositions see the VI status register in the GoForce
+ technical manual (Register VI11 on SC12)
+
+
+ Attribute is get only.
+
+ @see GFVxGetAttribute()
+ */
+ GFVX_ATTR_VIDEO_BUF,
+
+ /** VxAPI attribute: Video VIP input status.
+ Use this attribute with GFVxGetAttribute() to read the current number
+ of frames received
+ */
+
+ GFVX_ATTR_VIP_INPUT_FRAME_COUNT,
+
+ /** VxAPI attribute: Video VIP input status.
+ Use this attribute with GFVxGetAttribute() to read the current number
+ of lines received
+ */
+
+ GFVX_ATTR_VIP_INPUT_LINE_COUNT,
+
+} GFVXATTRIBUTES;
+
+/** YUV Color Space Conversion (CSC) coefficients.
+ Parameter structure for GFVxVIPSetCSCCoeff(), GFVxBltSetCSCCoeff(),
+ GFVxVIPGetCSCCoeff(), and GFVxBltGetCSCCoeff()
+
+ YUV color space conversion is used when converting from a YUV formatted
+ surface to RGB formatted surface. The YUV color space conversion formular
+ appears as follows:
+
+ R = sat(KYRGB*(Y + YOF) + KUR*U + KVR*V)
+ G = sat(KYRGB*(Y + YOF) + KUG*U + KVG*V)
+ B = sat(KYRGB*(Y + YOF) + KUB*U + KVB*V)
+
+ By default, the YUV color space conversion coefficients are:
+
+ KYRGB, KUR, KVR 1.1644 0.0000 1.5960
+ KYRGB, KUG, KVG = 1.1644 -0.3918 -0.8130
+ KYRGB, KUB, KVB 1.1644 2.0172 0.0000
+
+ and YOF = -16.0000
+
+ The value corresponding to each of these YUV color space conversion
+ coefficients is a Q16 (signed 15.16 fixed point value).
+
+ For examples:
+ YOF = -16.0000, the value corresponding is 0xFFF00000
+ KYRGB = 1.1644, the value corresponding is 0x00012A16
+ KVR = 1.5960, the value corresponding is 0x00019893
+ KUG = -0.3918, the value corresponding is 0xFFFF9BB3
+ KVG = -0.8130, the value corresponding is 0xFFFF2FE0
+ KUB = 2.0172, the value corresponding is 0x00020467
+*/
+typedef struct _GFVXCSCCOEF
+{
+ NvU32 YOF;
+ NvU32 KYRGB;
+ NvU32 KUR;
+ NvU32 KVR;
+ NvU32 KUG;
+ NvU32 KVG;
+ NvU32 KUB;
+ NvU32 KVB;
+} GFVXCSCCOEF;
+
+
+// Typesafe functions for opening and closing this component
+GF_RETTYPE GFVxOpen(GFRmHandle hRm, GFVxHandle *phVx,
+ GF_STATE_TYPE state, GFRmChHandle hCh);
+void GFVxClose(GFVxHandle *phVx);
+
+/** @name Functions
+@{*/
+
+/** This function returns version and capabilities of API and hardware.
+
+ @param VxHandle (#GFVxHandle) Handle to VxAPI
+ @param pVXProp (#PGFPROPERTY) Pointer to property structure to be
+ filled in
+
+ @retval #GF_SUCCESS \a pJXProp filled in successfully
+ @retval #GF_ERROR Some error occured
+
+ This function returns information about the VxAPI, including the following:
+ - VxAPI module version
+ - VIP support
+ - Overlay support
+ - MPEG decoding and encoding
+ - JPEG decoding and encoding
+
+ The #GFPROPERTY structure passed with parameter \a pVXProp will be
+ filled in on successfull return. The #GFPROPERTY::Capability field
+ will hold a combination of flagbits indicating capabilities specific
+ to the VxAPI:
+
+
+ #GFVX_CAP_CSC Color space conversion supported
+ #GFVX_CAP_VIP VIP functions available
+ #GFVX_CAP_ENLARGE Enlarge source image supported
+ #GFVX_CAP_SHRINK Shrink source image supported
+ #GFVX_CAP_COLOR_CONTROL Color control supported
+ #GFVX_CAP_OVERLAY Overlay supported
+ #GFVX_CAP_MPEGDEC MPEG4 decoder supported
+ #GFVX_CAP_MPEGENC MPEG4 encoder supported
+ #GFVX_CAP_JPEGDEC JPEG decoder supported
+ #GFVX_CAP_JPEGENC JPEG encoder supported
+ #GFVX_CAP_ALPHA_BLEND Alpha blending supported
+ #GFVX_CAP_EXTEND_RGB
+ Extended RGB format 32 bpp supported
+ #GFVX_CAP_OVERLAY_YUV YUV overlay supported
+ #GFVX_CAP_OVERLAY_SCALE Overlay with scaling supported
+ #GFVX_CAP_OVERLAY_MULTIPLE Multiple overlay supported
+
+ #GFVX_CAP_ENCODE_TYPE
+ Variable sized data camera interface (Type A/B/C) supported
+
+
+
+ It is a good practice to call this function to query for the API version
+ and its capabilities before using the rest of the JxDecAPI functions.
+
+ @see GFPROPERTY
+*/
+GF_RETTYPE GFVxGetProperty(GFVxHandle VxHandle, PGFPROPERTY pVvProp);
+
+/** Stretch-blit rectangular area from source to destination surface.
+
+ @param VxHandle (#GFVxHandle) Handle to VxAPI
+ @param pBlt (#PGFVXBLT) Pointer to #GFVXBLT structure
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ This function copies a rectangular area from a source surface to a
+ rectangle in the destination surface. If source and destination
+ rectangles differ in size, the GPU's stretch blit (SB) unit scales the
+ source data to fit the destination rectangle. If the source and destination
+ surfaces have different color formats, GFVxBlt() provides limited color
+ format conversions.
+
+ Source and Destination surfaces have to be in GPU memory. Source surfaces
+ can be in YUV420, YUV422, or RGB565 format. Destination surfaces can be
+ in RGB565, RGB888 (SC12), or ARGB8888 (SC12 SC15) format. YUV output can also
+ be routed to EPP for encoding.
+
+ Color format conversions from a YUV420 or YUV422 source are supported for these
+ destination formats:
+ - RGB565
+ - ARGB8888 (SC12 SC15)
+ - RGB888 (SC12)
+
+ A #GFVXBLT control structure is passed with parameter \a pBlt.
+ GFVXBLT::ppDestSurf points to an array of destination surface pointers,
+ with the number of pointers in this array specified by
+ GFVXBLT::numofDestSurf. GFVXBLT::ppSrcSurf points to an array of source
+ surface pointers, with the size of this array specified by
+ GFVXBLT::numofSrcSurf.
+
+ When the destination surface pointer is NULL, output of SB goes
+ to EPP for encoding.
+
+ See #GFVXBLT for minimum and maximum specifications of source and destination
+ rectangle sizes.
+
+ Instant Blit Mode
+
+ In this mode of operation, the blit is executed immediately via the command
+ FIFO. It is always performed from the first surface in GFVXBLT::ppSrcSurf
+ to the first surface in GFVXBLT::ppDestSurf. Other pointers in these
+ arrays are ignored.
+
+ Auto Blit Mode
+
+ VxBlt() can be used to enable auto-blit mode (flag #GFVX_AUTO_BLT
+ in GFVXBLT::BltOption). Whenever the end of a frame coming from VIP is
+ reached, SB will be fired automatically with the parameters set in GFVXBLT.
+ Auto-blit mode remains set until it is reset by another auto-blit command.
+ During auto-blit mode, manual SB commands should save and restore SB
+ registers (SC12 and below). This is not required for SC15 and above because
+ they have three hardware contexts: one for auto-blit, one for host trigger
+ (manual SB commands) and one for host partial trigger.
+
+ The first time auto-blit is fired, the first surface in GFVXBLT::ppSrcSurf
+ is copied to the first surface in GFVXBLT::ppDestSurf. In subsequent blits,
+ the source and destination arrays are walked through subsequently. If
+ there is only one surface in the GFVXBLT::ppSrcSurf or GFVXBLT::ppDestSurf
+ arrays, only this one is used.
+
+ Note that VxBlt() only sets auto-blit parameters. It is actually enabled by
+ GFVxVIPUpdate() using action #GFVX_VIP_AUTO_TRIGER_BLT, or GFMxDecSetMBs().
+
+ Auto Display
+
+ If auto-display (#GFVX_AUTO_DISPLAY or #GFVX_AUTO_DISPLAY_OVERLAY2) is on,
+ GFVxBlt() automatically shows the destination surface on the screen.
+ The application does not need to call GFVxFlip() to show the surface.
+ Auto-display can be combined with both auto-blit and instant-blit modes.
+
+ Color Keying
+
+ If source color keying (#GFVX_BLT_SRC_KEY) is set, all pixels from the
+ source surface matching GFVXBLT::colorKey are transparent (not copied).
+
+ VSync Synchronisation
+
+ By default all blits are synchronized to display VSync. Note that blits
+ may block, if the display is disabled. Flag #GFVX_BLT_DISABLE_WAIT_VSYNC
+ can be used to disable VSync synchronisation.
+
+ @see GFVXBLT
+*/
+GF_RETTYPE GFVxBlt(GFVxHandle VxHandle, PGFVXBLT pBlt);
+
+/** Activate surface for display.
+
+ @param VxHandle (#GFVxHandle) Handle to VxAPI
+ @param pFlip (#PGFVXFLIP) Pointer to #GFVXFLIP structure
+
+ @retval #GF_SUCCESS Success
+ @retval GFVX_ERROR_COLORFORMAT_NOT_SUPPORTED If ColorFormat is unsupported
+
+ This function changes the display buffer address from one surface to
+ another.
+
+ This function displays #GFVXFLIP::pForeGroundSurf. If
+ GFVXFLIP::pForeGroundSurf is an overlay surface, this function displays
+ that surface to the destination rectangle that has been set by
+ GFVxUpdateOverlay().
+
+ If GFVXFLIP::pForeGroundSurf is not an overlay surface, this function
+ displays the entire surface. In this case GFVxFlip() can show either the
+ primary surface or an offscreen surface on the display screen.
+
+ If there is only one surface for primary or overlay, GFVxFlip() should not
+ be called.
+
+ @see GFVXFLIP
+*/
+GF_RETTYPE GFVxFlip(GFVxHandle VxHandle, PGFVXFLIP pFlip);
+
+/** Configure properties of overlay (WinB) display.
+
+ @param VxHandle (#GFVxHandle) Handle to VxAPI
+ @param pOverlay (#PGFVXUPDATEOVERLAY) Pointer to #GFVXUPDATEOVERLAY structure
+
+ @retval #GF_SUCCESS Success
+ @retval GFVX_ERROR_SURFACETYPE_NOT_SUPPORTED If Source SurfaceType is unsupported
+ @retval GFVX_ERROR_COLORFORMAT_NOT_SUPPORTED If Source ColorFormat is unsupported
+ @retval GFVX_ERROR_ILLEGAL_ALPHA_VALUE If Alpha Value is incorrect
+
+ This function controls overlay (WinB) display, setting the following
+ features:
+ - Destination and source rectangle areas
+ - Rotation for overlay surface
+ - Color keying
+ - Alphablending Color Key (GoForce 4800 and above)
+ - Foreground and Background alpha values. (GoForce 4800 and above)
+ - Destination surface color format (RGB888, ARGB8888 for GoForce 4800 and
+ above)
+
+ SC15 supports the following overlay surface orientations - 0 degree rotated,
+ 180 degree rotated, horizont flip, vertical flip. Overlay surface orientation
+ is always relative to the orientaton of primary surface. For eg. if primary
+ surface is 180 degree rotated and requested overlay surface orientation is
+ 0 degree rotated, then overlay surface will be 180 degree rotated.
+
+ This function supports the following source surface type - GF_SURFACE_OVERLAY.
+ It supports the following source surface colorformats - RGB565, ARGB8888, ARGB1555,
+ ARGB4444.
+
+ In order to work around a hardware bug in SC12, in which the GC displays
+ pixels at the end of the line that are 64 pixels back from the end of
+ the line, the overlay window width will be aligned to 4-pixels.
+
+ If GFVXUPDATEOVERLAY::pSrcSurf is NULL then overlay display is disabled.
+
+ This function will have no effect, if the GoForce media processor version
+ does not support overlays. This can be checked via the #GFVX_CAP_OVERLAY
+ attribute with GFVxGetProperty().
+
+ Color Keying
+
+ With color keying pixels from the overlay surface can be masked (made
+ transparent). It can be enabled in different modes of operation by setting
+ one of the following flags in GFVXUPDATEOVERLAY::UpdateOption:
+ - #GFVX_UO_SRC_COLOR_KEY
+ - #GFVX_UO_DEST_COLOR_KEY
+
+ The color key is passed in GFVXUPDATEOVERLAY::ColorKey. Refer to the flags'
+ documentation for details on modes of operation.
+
+ An exotic color which does not conflict with other colors of a use-case
+ should be selected as the color key. Color keying for overlay display is
+ processed on the fly, no pixels in the surfaces are overwritten.
+
+ If destination is in 1-bit alpha format (eg ARGB1555), application can
+ use two additional flags - #GFVX_UO_COLOR_KEY_ALPHA_ONLY and
+ #GFVX_UO_COLOR_KEY_ALPHA_COLOR. Refer to the flags'
+ documentation for details on modes of operation.
+
+ Alpha Blending
+
+ Overlay display with alpha blending can be enabled by setting
+ flag #GFVX_UO_ALPHA_BLENDING.
+
+ Setting flag #GFVX_UO_ALPHA_BLENDING lets the overlay surface to appear
+ blended with the destination surface using the alpha value passed in
+ GFVXUPDATEOVERLAY::AlphaValue. Refer to the flags' documentation for details
+ on how to define AlphaVal.
+
+ If destination is in 1-bit alpha format (eg ARGB1555), application can
+ use two additional flags - #GFVX_UO_BLD_COLOR_KEY_ALPHA_ONLY and
+ #GFVX_UO_BLD_COLOR_KEY_ALPHA_COLOR. Refer to the flags'
+ documentation for details on modes of operation.
+
+ Just like overlay colorkey, an exotic color which does not conflict with
+ other colors of a use-case should be selected as the blending color key.
+ Blending is processed on the fly, no pixels in the surfaces are overwritten.
+
+ If #GFVX_UO_DEST_COLOR_KEY is set, alpha blending enabled, and the
+ destination pixel color matches BlendingColorKey, the following equation
+ is used to generate the final pixel:
+
+ src * AlphaValue + dest * (1-AlphaValue)
+
+ Otherwise, the original pixel is not updated.
+
+ Alpha blending is supported only on GoForce 4800 and above.
+
+ SC15 supports alphablending with the following restriction - You cannot alpha-match
+ (alpha-blend) in non-key-match areas, at the same time you alpha-blend in key-match areas.
+ In other words, the following flag combinations will not work -
+
+ #GFVX_UO_DEST_COLOR_KEY|#GFVX_UO_ALPHA_BLENDING|#GFVX_UO_BLD_COLOR_KEY_ALPHA_ONLY
+ #GFVX_UO_DEST_COLOR_KEY|#GFVX_UO_COLOR_KEY_ALPHA_COLOR|#GFVX_UO_ALPHA_BLENDING|#GFVX_UO_BLD_COLOR_KEY_ALPHA_ONLY
+ #GFVX_UO_DEST_COLOR_KEY|#GFVX_UO_COLOR_KEY_ALPHA_ONLY|#GFVX_UO_ALPHA_BLENDING
+ #GFVX_UO_DEST_COLOR_KEY|#GFVX_UO_COLOR_KEY_ALPHA_ONLY|#GFVX_UO_ALPHA_BLENDING|#GFVX_UO_BLD_COLOR_KEY_ALPHA_COLOR
+
+ @see GFVXUPDATEOVERLAY
+*/
+GF_RETTYPE GFVxUpdateOverlay(GFVxHandle VxHandle,
+ PGFVXUPDATEOVERLAY pOverlay);
+
+/** Feed image data from host to VIP.
+
+ @param VxHandle (#GFVxHandle) Handle to VxAPI
+ @param pImage (#PGFVXVIPFEEDIMAGE) Pointer to #GFVXVIPFEEDIMAGE parameter
+ structure
+
+ @retval #GF_SUCCESS Success
+ @retval GFVX_ERROR_COLORFORMAT_NOT_SUPPORTED If Source ColorFormat is unsupported
+
+ This function feeds an image from the CPU host via the VI source FIFO to
+ the VIP. It supports YUV420, YUV422 (YUYV, YVYU, UYVY, VYUY), YUV422 planar and
+ Bayer (8, 12) formats.
+
+ For an YUV420 image, it feeds Y-Fifo, U-Fifo, V-Fifo interleaved at 32 bit.
+ For an YUV422 image, it feeds the Y-Fifo only.
+
+ This function is intended to be used for feeding YUV data to the JPEG
+ encoder, or for feeding input for VIP preview display (GFVxVIPSetVIP()
+ and GFVxVIPUpdate()). YUV data for MPEG encoding is fed with
+ GFMxEncFeedImage().
+
+ Parameter \a pImage passes a surface containing source image data and an
+ optional source clipping rectangle. Surface data has to reside in memory
+ accessible by the host CPU, e.g. a surface allocated as type
+ #GF_SURFACE_SYSTEM_MEMORY.
+
+ @see GFVXVIPFEEDIMAGE, GFVX_VIP_HOST_IMAGE
+*/
+GF_RETTYPE GFVxVIPFeedImage(GFVxHandle VxHandle,
+ PGFVXVIPFEEDIMAGE pImage);
+
+/** Setup partial feed image data from host to VIP.
+
+ @param VxHandle (#GFVxHandle) Handle to VxAPI
+ @param colorFormat Color format of feed image surface
+ @param width Width of feed image
+ @param height Height of feed image
+
+ @retval #GF_SUCCESS Success
+ @retval GFVX_ERROR_ILLEGAL_PARAMETER If width and height values are incorrect
+ @retval GFVX_ERROR_COLORFORMAT_NOT_SUPPORTED If color format of feed image surface is unsupported
+
+ This function setups partial feed image from the CPU host via the VI source FIFO to
+ the VIP. It supports YUV420, YUV422 (YUYV, YVYU, UYVY, VYUY), YUV422 planar formats.
+ The partial image data is fed with
+ GFVxVIPPartialFeedImage().
+
+ @see GFVxVIPPartialFeedImage, GFVX_VIP_HOST_IMAGE
+*/
+GF_RETTYPE GFVxVIPPartialFeedImageSetup(GFVxHandle VxHandle,
+ NvU32 colorFormat,
+ NvU32 width,
+ NvU32 height);
+
+/** Feed partial image data from host to VIP.
+
+ @param VxHandle (#GFVxHandle) Handle to VxAPI
+ @param pSrcSurf Pointer to source feed image surface
+ @param pSrcRect Pointer to a clip rectangle from source feed image surface
+
+ @retval #GF_SUCCESS Success
+ @retval GFVX_ERROR_ILLEGAL_PARAMETER If pSrcSurf is NULL
+
+ This function feeds a partial image from the CPU host via the VI source FIFO to
+ the VIP. It supports YUV420, YUV422 (YUYV, YVYU, UYVY, VYUY), YUV422 planar formats.
+
+ For an YUV420 image, it feeds Y-Fifo, U-Fifo, V-Fifo interleaved at 32 bit.
+ For an YUV422 image, it feeds the Y-Fifo only.
+
+ This function is intended to be used for feeding partial YUV data to the JPEG
+ encoder, or for feeding partial input for VIP preview display (GFVxVIPSetVIP()
+ and GFVxVIPUpdate()). YUV data for MPEG encoding is fed with
+ GFMxEncFeedImage().
+
+ Parameter \a pSrcRect is an optional source clipping rectangle.
+ Surface data has to reside in memory accessible by the host CPU,
+ e.g. a surface allocated as type
+ #GF_SURFACE_SYSTEM_MEMORY.
+*/
+GF_RETTYPE GFVxVIPPartialFeedImage(GFVxHandle VxHandle,
+ PGFRMSURFACE pSrcSurf,
+ PGFRECT pSrcRect);
+
+/** Put video unit into sleep mode.
+ @param VxHandle (#GFVxHandle) Handle to VxAPI
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ @note Not implemented by default, this function is intended to be
+ implemented only in GFSDK ports to platforms that are in need of
+ this feature.
+
+ @see GFVxWakeup()
+*/
+GF_RETTYPE GFVxSleep(GFVxHandle VxHandle);
+
+/** Wake up video unit from sleep mode.
+ @param VxHandle (#GFVxHandle) Handle to VxAPI
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ @note Not implemented by default, this function is intended to be
+ implemented only in GFSDK ports to platforms that are in need of
+ this feature.
+
+ @see GFVxSleep()
+*/
+GF_RETTYPE GFVxWakeup(GFVxHandle VxHandle);
+
+/** This function enumerates capabilities of the Video Input Port (VIP).
+
+ @param VxHandle (#GFVxHandle) Handle to VxAPI
+ @param pVIPProp (#PGFVXVIPPROPERTY) Pointer to #GFVXVIPPROPERTY structure
+ to be filled in
+
+ @retval #GF_SUCCESS \a pVIPProp filled in successfully
+ @retval #GF_ERROR Some error occured
+
+ The #GFPROPERTY structure passed with parameter \a pVIPProp will be
+ filled in on successfull return.
+
+ The following GoForce VIP features are described by this function:
+ - Image decimation (scaling) limits
+ - Image flipping
+ - Video input interface type
+
+ Parameters that are passed with a #GFVXVIPINFO structure to GFVxVIPSetVIP()
+ must be within the limits returned by this function.
+
+ @see GFVXVIPPROPERTY, GFVxVIPSetVIP(), GFVXVIPINFO
+*/
+GF_RETTYPE GFVxVIPGetProperty(GFVxHandle VxHandle,
+ PGFVXVIPPROPERTY pVIPProp);
+
+/** Configure video input to VIP.
+
+ @param VxHandle (#GFVxHandle) Handle to VxAPI
+ @param pVIPInfo (#PGFVXVIPINFO) Pointer to GFVXVIPINFO parameter structure
+
+ @retval #GF_SUCCESS Success
+ @retval GFVX_ERROR_ILLEGAL_BAYER_VALUES If values in BayerInfo structure are incorrect
+ @retval GFVX_ERROR_COLORFORMAT_NOT_SUPPORTED If Source ColorFormat is unsupported
+
+ The following VIP properties can be configured using this function, see
+ #GFVXVIPINFO for details:
+ - Data source and format (CPU host or video input)
+ - VIP input cropping rectangle
+ - Image decimation
+ - Input (camera) color format
+
+ After configuring video input, the flow of data has to be explicitly
+ enabled with GFVxVIPUpdate().
+
+ See GFVxVIPGetProperty() for how to test for VIP capabilities at runtime.
+
+ This function returns GFVX_ERROR_COLORFORMAT_NOT_SUPPORTED error if color format
+ is not supported. Supported color formats for HOST input are - YUV422, YUV422 Planar,
+ YUV420 and Bayer (8 and 12). YUV420 is not supported if input source is VIP.
+
+ @see GFVXVIPINFO, GFVxVIPUpdate(), GFVxVIPGetProperty()
+*/
+GF_RETTYPE GFVxVIPSetVIP(GFVxHandle VxHandle,
+ PGFVXVIPINFO pVIPInfo);
+
+/** Enable or disable video feeding through VIP.
+
+ @param VxHandle (#GFVxHandle) Handle to VxAPI
+ @param pUpdate (#GFVXVIPUPDATE) Pointer to a #GFVXVIPUPDATE structure
+
+ @retval #GF_SUCCESS Success
+ @retval GFVX_ERROR_COLORFORMAT_NOT_SUPPORTED If Source ColorFormat is unsupported
+
+ This function enables or disables data feeding through VIP after it has
+ been configured with GFVxVIPSetVIP().
+
+ The action to be performed by this function is defined by the action
+ identifier passed in GFVXVIPUPDATE::UpdateOption of parameter \a pUpdate.
+
+ #GFVX_VIP_START
+
+ Enable VIP data feeding
+
+ The structure passed via \a pUpdate controls the output of the VIP, setting
+ the following parameters:
+ - Destination surface(s) (single or double buffered)
+ - Top-left corner the output video is written to the destination surfaces
+
+ GFVXVIPUPDATE::ppSurf passes an array of 1 or 2 destination surfaces to
+ capture the incoming video stream. If 2 surfaces are passed, the VIP target
+ surface is flipped after each frame of VIP input if #GFVX_VIP_AUTO_FLIP or
+ #GFVX_VIP_AUTO_FLIP_OVERLAY2 flag is specified.
+
+ Color space conversion (CSC) is performed depending on the output surface
+ color formats:
+ - #GF_SURFACE_RGB565 (16 bpp): VI CSC is used.
+ - #GF_SURFACE_ARGB8888 (32 bpp): VI CSC is used, only available for SC12
+ and above
+ - #GF_SURFACE_YUV422: (32 bits per two pixels): No CSC is used, data from
+ the VIP is stored as is in memory
+ - any other format is considered to be YUV422, and the data is stored as is
+
+ If GFVXVIPUPDATE::ppSurf is NULL, data flow through the VIP is still enabled.
+ Data from the VIP is not written to target surfaces, but is is fed to the
+ MPEG or JPEG encoder pre-processor. This mode of operation is useful for the
+ following two cases:
+ - There is not enough memory for JPEG encoding. The application could turn
+ off the screen, enable this mode, and let the JPEG encoder utilize screen
+ memory (the primary surface).
+ - In single-shot mode, the application does not want to display the video
+ image on the screen after enabling the JPEG encoder, thus allowing faster
+ captures and power savings, and freeing bandwidth. After the image is
+ captured, the application enables the JPEG decoder to decode the captured
+ image and shows it on the screen.
+
+
+ #GFVX_VIP_AUTO_FLIP
+
+ Enable VIP data feeding with auto-display
+
+ Behaviour is identical to #GFVX_VIP_START, additionally auto-display of the
+ last captured VIP frame is enabled. It is recommended to use this feature
+ in double buffer mode, passing 2 surfaces in GFVXVIPUPDATE::ppSurf.
+
+
+ #GFVX_VIP_AUTO_FLIP_OVERLAY2
+
+ Enable VIP data feeding with auto-display from overlay window2
+
+ If surfaces to be flipped are overlay surfaces, they are associated with
+ first overlay surface unless #GFVX_VIP_AUTO_FLIP_OVERLAY2 flag is defined.
+ This flag should be used only if UpdateOverlay has been previously called
+ with #GFVX_UO_OVERLAY2 UpdateOption and VxFlip has been called with
+ #GFVX_FLIP_OVERLAY2 FlipOption.
+
+
+
+ #GFVX_VIP_AUTO_TRIGER_BLT
+
+ Enable VIP data feeding with auto-blit
+
+ Behaviour is identical to #GFVX_VIP_START, additionally auto-blit of the
+ last captured VIP frame is enabled. It is recommended to use this feature
+ in double buffer mode, passing 2 surfaces in GFVXVIPUPDATE::ppSurf.
+
+ If #GFVX_VIP_AUTO_FLIP and #GFVX_VIP_AUTO_TRIGER_BLT are required at the
+ same time, these two action identifiers can be logically OR'ed and passed
+ in GFVXVIPUPDATE::UpdateOption.
+
+
+ #GFVX_VIP_STOP
+
+ Disable VIP data feeding
+
+ Stop data feeding through VIP. All other flags and parameters passed in
+ \a pUpdate are ignored.
+
+
+ #GFVX_VIP_AUTO_TRIGER_BLT_OFF
+
+ Disable VIP auto-blit
+
+ Stop auto-blit that has been enabled earlier with this function via
+ #GFVX_VIP_AUTO_TRIGER_BLT. This does not disable VIP data feed.
+
+
+
+ This function returns GFVX_ERROR_COLORFORMAT_NOT_SUPPORTED error if destination
+ surface color format is not supported. Supported destination color formats are -
+ RGB565, ARGB8888, YUV422, YUV422P, YUV420P and YUV420PA.
+
+ @see GFVXVIPUPDATE, GFVxVIPSetVIP()
+*/
+GF_RETTYPE GFVxVIPUpdate(GFVxHandle VxHandle,
+ PGFVXVIPUPDATE pUpdate);
+
+/** Manipulate GPIO signals on VIP.
+
+ @param VxHandle (#GFVxHandle) Handle to VxAPI
+ @param gpio (#GFVX_VIP_GPIO_TYPE) Signal (pin) to manipulate
+ @param operation (NvU32) Operation type, one of:
+
+ #GF_GPIO_SET_INPUT_ENABLE
+ Input enable set to 1
+ #GF_GPIO_CLR_INPUT_ENABLE
+ Input enable clr to 0.
+ #GF_GPIO_GET_INPUT_ENABLE
+ Get input enable.
+ #GF_GPIO_SET_OUTPUT_ENABLE
+ Output enable set to 1.
+ #GF_GPIO_CLR_OUTPUT_ENABLE
+ Output enable clr to 0.
+ #GF_GPIO_GET_OUTPUT_ENABLE
+ Get output enable.
+ #GF_GPIO_SET_DATA
+ Output data set to 1.
+ #GF_GPIO_CLR_DATA
+ Output data clr to 0.
+ #GF_GPIO_GET_DATA Get output data.
+
+ @param pGPIOStatus (#PGFGPIOSTATUS) Pointer to #GFGPIOSTATUS structure
+ returning pin status
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ This function manipulates the GPIO signals on the video input port (VIP).
+ The supported operations are clearing to 0, setting to 1, and getting the
+ status of the input enable, output enable, and data bits.
+
+ @see GFGPIOSTATUS, GFVX_VIP_GPIO_TYPE
+*/
+GF_RETTYPE GFVxVIPGPIO(GFVxHandle VxHandle,
+ GFGPIOPin gpio,
+ NvU32 operation,
+ PGFGPIOSTATUS pGPIOStatus);
+
+/** VxAPI component-level interrupt control.
+
+ @param VxHandle (#GFVxHandle) Handle to VxAPI
+ @param IntType (#GFVX_INTERRUPT_TYPE) VxAPI interrupt type
+ @param op (#GFVX_INTERRUPT_OPERATION_TYPE) VxAPI interrupt operation
+ @param pData (void*) Pointer to input or output data block, depending
+ on interrupt type and operation
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+ @retval #GFVX_ERROR_NO_SUPPORT Operation not supported
+
+ Interpretation of the datablock passed with \a pData depends on the
+ interrupt operation. The following operations (parameter op )
+ are defined for this call,
+
+
+ #GFVX_INTERRUPT_ENABLE
+ Enable interrupt/status assertion for interrupt type \a IntType.
+ \a pData is ignored.
+
+
+ #GFVX_INTERRUPT_DISABLE
+ Disable interrupt/status assertion for interrupt type \a IntType.
+ \a pData is ignored.
+
+
+ #GFVX_INTERRUPT_DISABLE
+ Clear interrupt/status assertion for interrupt type \a IntType.
+ \a pData is ignored.
+
+
+ #GFVX_INTERRUPT_QUERY_STATUS
+ Query for interrupt/status assertion for interrupt type \a IntType.
+
+ Interpretation of associated data block \a pData:
+
+ NvU32 Interrupt/status assertion state, one of:
+ GF_INTERRUPT_ON_STATUS_TRUE = asserted
+ GF_INTERRUPT_ON_STATUS_FALSE = not asserted
+
+
+
+ #GFVX_INTERRUPT_SET_Y_FIFO_THRESHOLD,
+ #GFVX_INTERRUPT_GET_Y_FIFO_THRESHOLD
+
+ Set or get DMA FIFO threshold value that controls interrupt/status
+ assertion for interrupt type #GFVX_Y_FIFO_THRESHOLD_INTR. If the
+ number of filled locations in the Y-FIFO is greater or equal
+ than the programmed value, #GFVX_Y_FIFO_THRESHOLD_INTR is asserted.
+ Note that the threshold value must not be changed within a frame.
+
+ Parameter \a IntType is ignored.
+
+ Interpretation of associated data block \a pData:
+
+ NvU32 Y-FIFO threshold value in range 0..31
+
+
+
+ #GFVX_INTERRUPT_SET_V_COUNTER_THRESHOLD,
+ #GFVX_INTERRUPT_GET_V_COUNTER_THRESHOLD
+
+ Set or get threshold value that controls interrupt/status assertion
+ for interrupt type #GFVX_VERTICAL_COUNTER_THRESHOLD_INTR. If the
+ vertical scanline position for data from parallel video input is
+ greater or equal than the programmed value,
+ #GFVX_VERTICAL_COUNTER_THRESHOLD_INTRis asserted.
+
+ Parameter \a IntType is ignored.
+
+ Interpretation of associated data block \a pData:
+
+ NvU32 Vertical counter threshold value in range 0..4095
+
+
+
+ #GFVX_INTERRUPT_GET_ALL_STATUS
+ Get VI interrupt status bitmask.
+
+ Parameter \a IntType is ignored.
+
+ Interpretation of associated data block \a pData:
+
+ NvU32 Interrupt status bitmask,
+ Logically OR'ed combination of:
+ #GFVX_VID0PIN_RISING_EDGE_INTR
+ #GFVX_VID1PIN_RISING_EDGE_INTR
+ #GFVX_VID2PIN_RISING_EDGE_INTR
+ #GFVX_VID3PIN_RISING_EDGE_INTR
+ #GFVX_VID4PIN_RISING_EDGE_INTR
+ #GFVX_VID5PIN_RISING_EDGE_INTR
+ #GFVX_VID6PIN_RISING_EDGE_INTR
+ #GFVX_VID7PIN_RISING_EDGE_INTR
+ #GFVX_VERTICAL_COUNTER_THRESHOLD_INTR
+ #GFVX_VHSYNC_RISING_INTR
+ #GFVX_VVSYNC_RISING_INTR
+ #GFVX_VIDEO_IN_FIELD_DATA_RECV_INTR
+ #GFVX_EARLY_VIDEO_INTR
+ #GFVX_Y_FIFO_THRESHOLD_INTR
+
+
+
+ #GFVX_INTERRUPT_CLEAR_ON_ALL_STATUS
+ Clear VI interrupt assertions.
+
+ Parameter \a IntType is ignored.
+
+ Interpretation of associated data block \a pData:
+
+ NvU32 Interrupt status bitmask,
+ set bit = clear this interrupt assertion
+ unset bit = leave unchanged
+
+ Valid bits which can be logically OR'ed:
+ #GFVX_VID0PIN_RISING_EDGE_INTR
+ #GFVX_VID1PIN_RISING_EDGE_INTR
+ #GFVX_VID2PIN_RISING_EDGE_INTR
+ #GFVX_VID3PIN_RISING_EDGE_INTR
+ #GFVX_VID4PIN_RISING_EDGE_INTR
+ #GFVX_VID5PIN_RISING_EDGE_INTR
+ #GFVX_VID6PIN_RISING_EDGE_INTR
+ #GFVX_VID7PIN_RISING_EDGE_INTR
+ #GFVX_VERTICAL_COUNTER_THRESHOLD_INTR
+ #GFVX_VHSYNC_RISING_INTR
+ #GFVX_VVSYNC_RISING_INTR
+ #GFVX_VIDEO_IN_FIELD_DATA_RECV_INTR
+ #GFVX_EARLY_VIDEO_INTR
+ #GFVX_Y_FIFO_THRESHOLD_INTR
+
+
+
+
+
+ @see GFVX_INTERRUPT_TYPE, GFVX_INTERRUPT_OPERATION_TYPE,
+ GFVxInterruptHandler()
+*/
+GF_RETTYPE GFVxInterruptControl(GFVxHandle VxHandle,
+ GFVX_INTERRUPT_TYPE IntType, GFVX_INTERRUPT_OPERATION_TYPE op,
+ void * pData);
+
+/** Get information about a feature of the VxAPI.
+
+ @param VxHandle (#GFVxHandle) Handle to VxAPI
+ @param aid (NvU32) Attribute type identifier, see table.
+ @param pAttr (NvU32*) Returns 32 bit attribute value, see attribute
+ type documentation for interpretation
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+
+ \b Attribute \b Direction \b Synopsis
+
+ #GFVX_ATTR_VIDEO_BUF
+ get
+ Video input interrupt status
+
+
+
+
+ @see GFVxSetAttribute()
+*/
+GF_RETTYPE GFVxGetAttribute(GFVxHandle VxHandle, NvU32 aid, NvU32 *attr);
+
+/** Reset VI to a reset state.
+
+ @param VxHandle (#GFVxHandle) Handle to VxAPI
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+*/
+GF_RETTYPE GFVxReset(GFVxHandle);
+
+/** This function waits until the next camera vsync has occurred.
+ It is implemented with interrupt mode. Therefore, it assumes that
+ interrupt platform has already supported or taken care,
+ otherwise it will wait forever for interrupt event
+
+ @param VxHandle (#GFVxHandle) Handle to VxAPI
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+*/
+GF_RETTYPE GFVxWaitCameraVSync(GFVxHandle);
+
+/** This function ensures synchronization between StretchBlt operations and others
+ modules operations.
+
+ @param VxHandle (#GFVxHandle) Handle to GFVxAPI
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ When several modules share the same channel (like SB,JxDec,MxDec),
+ it may be necessary to synchronize the command flow with the StretchBlt (SB)
+ module execution. Putting a GFVxBltNotBusy() call after a SB operation ensures
+ that commands which follow the SB command are executed after full completion
+ of the SB command.
+
+ As opposed to GFVxBltWaitNotBusy(), this function doesn't block the CPU thread.
+ stretchblt engine may not be idle when returning from the function. Control returns
+ to the CPU right after a wait command is placed in the stretchblt engine command FIFO.
+ The GoForce hardware begins executing the commands following the StretchBlt engine idle
+ command only after the stretchblt engine becomes idle.
+
+ @see GFVxBltWaitNotBusy()
+*/
+GF_RETTYPE GFVxBltNotBusy(GFVxHandle VxHandle);
+
+/** This function checks whether the stretchblt engine is busy or idle.
+
+ @param VxHandle (#GFVxHandle) Handle to GFVxAPI
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ The function will wait until the stretchblt engine is idle. For example, if you want
+ to stretchblt to the frame buffer but the stretchblt engine is busy the function can
+ be used to wait until it is idle.
+
+ As opposed to GFVxBltNotBusy(), this function blocks the CPU thread while waiting for
+ the stretchblt engine to become idle.
+
+ @see GFVxBltNotBusy()
+
+*/
+GF_RETTYPE GFVxBltWaitNotBusy(GFVxHandle VxHandle);
+
+/** This function sets the current state stretchblt color space converion (CSC)
+ coefficients that will be programmed to GPU after calling GFVxBlt to do
+ YUV color space conversion to RGB.
+ How to use this routine:
+ - GFVxBltGetCSCCoeff() to get default YUV CSC coefficients, save them
+ - GFVxBltSetCSCCoeff() to change to new YUV CSC coefficients
+ - GFVxBlt() to stretchblt image with your new YUV CSC coefficients to RGB,
+ then done whatever
+ - GFVxBltSetCSCCoeff() to restore back default YUV CSC coefficients
+
+ @param VxHandle (#GFVxHandle) Handle to GFVxAPI
+ @param pCoef (GFVXCSCCOEF*) Pointer to #GFVXCSCCOEF structure
+ @param option (NvU32) Option type, one of:
+
+ - #GFVX_SET_CSC_USE_CCIR601_RANGE -- Use CCIR601 range.
+ This option will ignore parameter pCoef. It will use
+ pre-defined CSC CCIR601 coefficients values.
+ - #GFVX_SET_CSC_USE_FULL_RANGE -- Use color full range.
+ This option will ignore parameter pCoef. It will use
+ pre-defined CSC full range coefficients values.
+ - #GFVX_SET_CSC_USE_USER_DEFINED_RANGE -- Use user defined range.
+ This option will require parameter pCoef. It will use
+ CSC coefficients values provided from pCoef.
+
+ @param sbMode (#GFVXBLTMODE) StretchBlt mode, one of:
+
+ - GFVX_BLT_FULL_MODE: Host full frame stretchblt trigger
+ - GFVX_BLT_PARTIAL_MODE: Host partial frame stretchblt trigger
+ - GFVX_BLT_AUTO_VI_MODE: Auto stretchblt trigger from VI
+
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+*/
+GF_RETTYPE GFVxBltSetCSCCoeff(GFVxHandle VxHandle,
+ GFVXCSCCOEF *pCoef,
+ NvU32 option,
+ GFVXBLTMODE sbMode);
+
+/** This function sets the current state VI color space converion (CSC)
+ coefficients that will be programmed to GPU after calling GFVxVIPUpdate
+ to do YUV color space conversion to RGB.
+ How to use this routine:
+ - GFVxVIPGetCSCCoeff() to get default YUV CSC coefficients, save them
+ - GFVxVIPSetCSCCoeff() to change to new YUV CSC coefficients
+ - GFVxVIPUpdate() to preview image with your new YUV CSC coefficients to RGB
+ - GFVxVIPSetCSCCoeff() to restore back default YUV CSC coefficients
+
+ @param VxHandle (#GFVxHandle) Handle to GFVxAPI
+ @param pCoef (#GFVXCSCCOEF*) Pointer to #GFVXCSCCOEF structure
+ @param option (NvU32) Option type, one of:
+
+ - #GFVX_SET_CSC_USE_CCIR601_RANGE -- Use CCIR601 range.
+ This option will ignore parameter pCoef. It will use
+ pre-defined CSC CCIR601 coefficients values.
+ - #GFVX_SET_CSC_USE_FULL_RANGE -- Use color full range.
+ This option will ignore parameter pCoef. It will use
+ pre-defined CSC full range coefficients values.
+ - #GFVX_SET_CSC_USE_USER_DEFINED_RANGE -- Use user defined range.
+ This option will require parameter pCoef. It will use
+ CSC coefficients values provided from pCoef.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+*/
+GF_RETTYPE GFVxVIPSetCSCCoeff(GFVxHandle VxHandle, GFVXCSCCOEF *pCoef, NvU32 option);
+
+/** This function gets the current state stretchblt color space conversion (CSC)
+ coefficients
+
+ @param VxHandle (#GFVxHandle) Handle to GFVxAPI
+ @param pCoef (#GFVXCSCCOEF*) Pointer to #GFVXCSCCOEF structure
+ @param sbMode (#GFVXBLTMODE) StretchBlt mode, one of:
+ - GFVX_BLT_FULL_MODE: Host full frame stretchblt trigger
+ - GFVX_BLT_PARTIAL_MODE: Host partial frame stretchblt trigger
+ - GFVX_BLT_AUTO_VI_MODE: Auto stretchblt trigger from VI
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+*/
+GF_RETTYPE GFVxBltGetCSCCoeff(GFVxHandle VxHandle, GFVXCSCCOEF *pCoef, GFVXBLTMODE sbMode);
+
+/** This function gets the current state VI color space conversion (CSC) coefficients
+
+ @param VxHandle (#GFVxHandle) Handle to GFVxAPI
+ @param pCoef (#GFVXCSCCOEF*) Pointer to #GFVXCSCCOEF structure
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+*/
+GF_RETTYPE GFVxVIPGetCSCCoeff(GFVxHandle VxHandle, GFVXCSCCOEF *pCoef);
+
+/** @page pageVxOverview VxAPI Overview
+
+ The GFVxAPI is an abstraction layer for both the Video Scalar (StretchBlt)
+ and the Video Input (VI) module. The Video Scalar provides color space
+ conversion (CSC) and smooth scaling of video. The VI module, which connects
+ to the Video Input Port (VIP), accepts data from the VIP or the host CPU
+ through a FIFO mechanism.
+
+ Video data, either decimated or not, can be sent from the VI to JPEG or
+ MPEG encoder, and at the same time can go to memory through CSC for previewing,
+ again either decimated or not. If a decimator is used in both the preview and
+ the encoder paths, it has to have same decimation factor.
+
+ Video data can also be sent to EPP. RGB565, RGB444 and RGB888 data goes directly
+ and YUV422 data, pre or post decimated, is first converted to YUV444 by VI
+ before sending to EPP.
+
+ If data coming from VIP is in Bayer format, VI first sends this data to ISP.
+ After processing, ISP returns YUV444 data to VI. VI converts output of ISP to
+ YUV422 before sending it to core for decimation or to memory or both.
+
+ There are also options to crop, mirror and/or flip video data.
+
+ The Video Scalar and the VI module accept YUV (4:2:2 or 4:2:0) and
+ RGB (565) data as input. YUV data can be converted to YUV planar data or
+ RGB data (RGB:565 for all processors, and RGB:888 or ARGB:8888 for GoForce
+ 3D 4800). RGB data can be scaled, but cannot be converted to YUV, for all
+ processors up to the GoForce 3D 4800.
+
+ @section pageVxOverview1 Video Sources
+
+ The video source for the VI module can be the host CPU or a camera
+ connected to the VIP. The video source for the Video Scalar can be the
+ video memory surface or the output of the JPEG or MPEG decoder through a
+ circular buffer. The GFVxAPI functions that deal only with the VIP have VIP
+ in their function names.
+
+ @section pageVxOverview2 Video Camera Interface
+
+ Usually a video camera connected through the VIP generates YUV 422 data
+ (CCIR656 format) which can be encoded by the NVIDIA GPU. Some cameras
+ generate JPEG-encoded images directly, and the GFSDK can be configured to
+ accept those JPEG-encoded bit streams.
+
+ To control the JPEG input stream, VIP of newer NVIDIA GPUs supports the
+ following camera interface protocols for variably sized bitstream data:
+ - Type A interface : VHSync and VVSync length can be variable, and
+ VVClk should be kept running. (SC12 only)
+ - Type B interface : VHSync and VVSync length can be variable, and
+ VVClk can be stopped during the image transfer period. (SC12 only)
+ - Type C interface : VHSync and VVSync length are fixed, and VVClk
+ should be kept running. The camera can insert 0xff in the image as
+ padding.
+
+ @section pageVxOverview3 Video Coordinate Systems (Regular and Rotated)
+
+ A destination coordinate is always the same as a screen coordinate. The
+ source coordinate stays the same, even if there is rotation.
+*/
+
+/** @page pageVxAppNotes VxAPI Application Notes
+
+ @section pageVxAppNotes1 Programming Sequence
+
+ The easiest way to learn the VxAPI is by referring to the demonstration
+ application source code that come with the GFSDK package. A new application
+ can be started by creating a project at the same directory level as the
+ demo application source directory. This way the same directory tree
+ structure can be maintained. The general sequence for programming the
+ VxAPI is as follows:
+
+ -# Make sure that the build project or file has the right paths to the
+ library and header files. Use relative directory addressing if possible.
+ The GFSDK/Inc directory must be included.
+ -# Include GFVx.h in the source file. This header is all that is needed to
+ access the exposed API functions.
+ -# Call GFRmOpen() before any other GFSDK functions (including the VxAPI).
+ -# Use the handle returned from the Resource Manager in the previous step
+ to call GFRmComponentGet() with #GF_VXAPI as the ComponentType in the
+ #GFRMCOMPONENT structure. The returned handle is the one to use
+ throughout all VxAPI calls.
+ -# To better utilize VxAPI functions, it is a good idea to call
+ GFVxGetProperty() to determine the version that you are using and the
+ available video memory.
+ -# Make calls to the appropriate VxAPI functions. Always remember to pass
+ the same #GFVxHandle returned from GFRmComponentGet().
+ -# When all the VxAPI calls are completed, call GFRmComponentRelease().
+ -# When exiting the application, call RmClose() to release everything
+ associated with the GFSDK.
+*/
+
+//////////////////Raw Capture Defination //////////////////////////
+/** Descriptor for raw data fetch buffers.
+ This structure describes a buffer and its fill status for Raw YUV transfered
+ from RDMA to the application.
+ It is used with GFVxRawCapture() and GFVxRawCaptureFetchImage()
+ in either polling or callback data fetch mode.
+
+ @see GFVxCapture(), GFVxRawCaptureFetchImage()
+*/
+typedef struct _GFVX_BUF {
+ NvU8 *pBuf; /**< Pointer to the buffer */
+ NvU32 bufSize; /**< Size of the buffer in bytes */
+ NvU32 nBytesCaptured; /**< Number of bytes captured,
+ app initializes to 0
+ */
+} GFVX_BUF, *PGFVX_BUF;
+
+
+/** Image source/target dimensions and data source for Raw data capturing.
+
+ This structure is passed as parameter to GFVxRawCaptureStart() and describes
+ data source, source cropping rectangle and destination image size.
+
+ @see GFVxRawCaptureStart()
+*/
+typedef struct _GFVXRAWINFO
+{
+ PGFRMSURFACE pSrcSurf;/**< Surface to encode,
+ NULL for camera.
+ */
+ PGFRECT pSrcRect; /**< Source image area need to capture */
+ NvU32 DestWidth; /**< Final output data width */
+ NvU32 DestHeight; /**< Final output data height */
+ NvU32 uiOptions; /**< Bitmask of flags to control capturing
+
+ */
+ NvU32 Error; /**< Returns detailed error code on GFVxRawCaptureStart() failure
+
+ #GF_CAPT_ERROR_VIDEO_MEMORY_NOT_BIG_ENOUGH
+ Not enough free video memory, try to release
+ unnecessary video surfaces
+ #GF_CAPT_ERROR_WRONG_CONFIG
+ Wrong input parameters, for example srcRect
+ size greater than pSrcSurf dimensions
+ #GF_CAPT_ERROR_NO_CALLBACK
+ No callback function available
+
+ */
+ NvU32 colorFormat;
+} GFVXRAWINFO, *PGFVXRAWINFO;
+
+/** GFVXRAWINFO uiOptions:
+*/
+#define RAWCAPTURE_ATTR_RAW_DATA 0x00000010
+#define RAWCAPTURE_ATTR_RAW_JPEG_CAPTURE 0x00000020
+#define RAWCAPTURE_ATTR_RAW_DATA_STREAM 0x00000030
+
+/** Raw data capture APIs
+*/
+GF_RETTYPE GFVxRawCaptureStart( GFVxHandle VxHandle,
+ PGFVXRAWINFO pStart);
+
+GF_RETTYPE GFVxRawCaptureSetupInterrupt(GFVxHandle VxHandle,
+ void (*Inter)(void *), void *IPara);
+
+GF_RETTYPE GFVxRawCapture (GFVxHandle VxHandle,
+ PGFVX_BUF aBuf, NvU32 nBuf, NvU32 *pStatus );
+
+GF_RETTYPE GFVxRawCaptureFetchImage (GFVxHandle pVx,
+ PGFVX_BUF aBuf, NvU32 nBuf, NvU32 *pStatus );
+
+GF_RETTYPE GFVxRawCaptureEnd( GFVxHandle pVx );
+
+//uiFrameStatus;
+
+/** Raw Capture data fetch status code: All data of the current frame was fetched.
+ @see GFVxRawCaptureFetchImage(), GFVxRawCapture()
+*/
+#define RAWCAPTURE_DATA_COMPLETE 0x1
+
+/** Raw Capture data fetch status code: Data was fetched only partially.
+ The application should make more calls to GFVxRawCaptureFetchImage() to fetch
+ the rest.
+ @see GFVxRawCaptureFetchImage(), GFVxRawCapture()
+*/
+#define RAWCAPTURE_MORE_FETCH 0x2
+
+/** Raw Capture data fetch status code: New frame was captured and is ready to
+ fetch.
+ @see GFVxRawCaptureFetchImage(), GFVxRawCapture()
+*/
+#define RAWCAPTURE_NEW_FRAME 0x8
+
+/** Raw Capture data fetch status code: Time out error occured while output data is fetching.
+ fetch.
+ @see GFVxRawCaptureFetchImage(), GFVxRawCapture()
+*/
+#define RAWCAPTURE_TIME_OUT 0x10
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __GFVX_H__ */
+
+
diff --git a/Start_WM/test6/inc/GFVxError.h b/Start_WM/test6/inc/GFVxError.h
new file mode 100755
index 00000000..7f81f255
--- /dev/null
+++ b/Start_WM/test6/inc/GFVxError.h
@@ -0,0 +1,42 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/** @file GFVxError.h
+ GFVxAPI error codes
+*/
+
+#ifndef __GFVXERROR_H__
+#define __GFVXERROR_H__
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+#define GFVX_ERROR_GET_COMPONENT (GFVX_ERROR | 0x00000001L)
+/** GFVxAPI error code: Function not supported. */
+#define GFVX_ERROR_NO_SUPPORT (GFVX_ERROR | 0x00000002L)
+#define GFVX_ERROR_COLORFORMAT_NOT_SUPPORTED (GFVX_ERROR | 0x00000003L)
+#define GFVX_ERROR_SURFACETYPE_NOT_SUPPORTED (GFVX_ERROR | 0x00000004L)
+#define GFVX_ERROR_ILLEGAL_ALPHA_VALUE (GFVX_ERROR | 0x00000005L)
+#define GFVX_ERROR_ILLEGAL_BAYER_VALUES (GFVX_ERROR | 0x00000006L)
+#define GFVX_ERROR_ILLEGAL_PARAMETER (GFVX_ERROR | 0x00000007L)
+#define GFVX_ERROR_DRIVER_NOT_SUPPORTED (GFVX_ERROR | 0x00000008L)
+#define GFVX_ERROR_FLAG_NOT_SUPPORTED (GFVX_ERROR | 0x00000009L)
+#define GFVX_ERROR_FAIL_ALLOCATE_MEMORY (GFVX_ERROR | 0x0000000AL)
+#define GFVX_ERROR_ILLEGAL_VALUE (GFVX_ERROR | 0x0000000BL)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // __GFVXERROR_H__
+
+
+
diff --git a/Start_WM/test6/inc/GFVxScr.h b/Start_WM/test6/inc/GFVxScr.h
new file mode 100755
index 00000000..394a33ef
--- /dev/null
+++ b/Start_WM/test6/inc/GFVxScr.h
@@ -0,0 +1,311 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+#if !defined (__GFVXSCR_INC__)
+#define __GFVXSCR_INC__
+
+/** VxAPI GFVXVIPINFO::Flag flagbit: 8-bit/clock video data.
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_PARALLEL_INPUT 0x00000001
+
+/** VxAPI GFVXVIPINFO::Flag flagbit: Serial input.
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_SERIAL_INPUT 0x00000002
+
+/** VxAPI GFVXVIPINFO::Flag flagbit: VHSYNC and VVSYNC in the data stream.
+ If this flag is set, vertical and horizontal sync for the camera picture
+ is contained in the data stream going into the data port of the VIP.
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_HVSYNC_IN_STREAM 0x00000004
+
+/** VxAPI GFVXVIPINFO::Flag flagbit: Camera VHSYNC asserted by external signal.
+ If this flag is set, vertical and horizontal sync for the camera picture
+ is asserted to the GoForce chip by external signals, usually coming from
+ the camera chip.
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_EXTERNAL_VHSYNC 0x00000008
+
+/** VxAPI GFVXVIPINFO::Flag flagbit: Camera VHSYNC generated by GoForce chip.
+ If this flag is set, vertical and horizontal sync is generated by the
+ GoForce chip, and not contained in the data stream. The following members
+ of GFVXVIPINFO have to be set to define the timing:
+ - GFVXVIPINFO::VHPulseWidth
+ - GFVXVIPINFO::VHPulsePeriod
+ - GFVXVIPINFO::VVPulseWidth
+ - GFVXVIPINFO::VVPulsePeriod
+ - GFVXVIPINFO::VVDelay
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_INTERNAL_VHSYNC 0x00000010
+
+/** VxAPI GFVXVIPINFO::Flag flagbit: VCLK generated externally.
+ If this flag is set, camera VCLK is provided from an external source,
+ and VLCK will be selected as clock source for VI module.
+ @see GFVXVIPINFO, GFVxVIPSetVIP(), GFVX_VIP_EXTERNAL_VCLK_PRESERVE_CLKSEL
+*/
+#define GFVX_VIP_EXTERNAL_VCLK 0x00000020
+
+/** VxAPI GFVXVIPINFO::Flag flagbit: VCLK generated by GoForce chip.
+ If this flag is set, camera VCLK is provided by the GoForce chip.
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_INTERNAL_VCLK 0x00000040
+
+/** VxAPI GFVXVIPINFO::Flag flagbit: Detect field 0 or 1, will not work for
+ internal VHSYNC (#GFVX_VIP_INTERNAL_VHSYNC).
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_DETECT_FIELD 0x00000080
+
+/** VxAPI GFVXVIPINFO::Flag flagbit: Horizontal flip.
+ Flip VIP image horizontally.
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_RGB_H_FLIP 0x00000100
+
+/** VxAPI GFVXVIPINFO::Flag flagbit: Vertical flip.
+ Flip VIP image vertically.
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_RGB_V_FLIP 0x00000200
+
+/** VxAPI GFVXVIPINFO::Flag flagbit: CPU feeds image to VIP.
+ This flag indicates to the VIP, that image data is fed from the
+ host interface.
+ @see GFVXVIPINFO, GFVxVIPSetVIP(), GFVxVIPFeedImage()
+*/
+#define GFVX_VIP_HOST_IMAGE 0x00000400
+
+/** VxAPI GFVXVIPINFO::Flag flagbit: Change the default timing for VHSYNC and
+ VCLK. If this flag is set, VHSYNC and VCLK timing characteristics such as
+ polarity, active edge, serial frame polarity, size, field info are
+ overridden with GFVxVIPSetVIP() by the parameters passed in
+ GFVXVIPINFO::NewTiming.
+
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_CHANGE_DEFAULT_TIMING 0x00000800
+
+/** VxAPI GFVXVIPINFO::Flag flagbit: Camera master clock provided by GoForce
+ chip. When this flag is set, GFVXVIPINFO::MClockFreq must be set to the
+ ideal clock which the camera wants. Internally the best matching frequency
+ is provided to the camera.
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_ASK_FOR_MCLOCK 0x00001000
+
+/** VxAPI GFVXVIPINFO::Flag flagbit: VIP input type A interface.
+ @see GFVXVIPINFO, GFVxVIPSetVIP(), pageVxOverview2
+*/
+#define GFVX_VIP_TYPE_A 0x00002000
+
+/** VxAPI GFVXVIPINFO::Flag flagbit: VIP input type B interface.
+ @see GFVXVIPINFO, GFVxVIPSetVIP(), pageVxOverview2
+*/
+#define GFVX_VIP_TYPE_B 0x00004000
+
+/** VxAPI GFVXVIPINFO::Flag flagbit: VIP input type C interface.
+ @see GFVXVIPINFO, GFVxVIPSetVIP(), pageVxOverview2
+*/
+#define GFVX_VIP_TYPE_C 0x00008000
+
+/** VxAPI GFVXVIPINFO::Flag flagbit: Camera is running at type C interface
+ and do not remove the 0xFF, 0x02 sequence.
+ @see GFVXVIPINFO, GFVxVIPSetVIP(), pageVxOverview2
+*/
+#define GFVX_VIP_TYPE_C_RAW 0x00010000
+
+/** VxAPI GFVXVIPINFO::Flag flagbit: Enable destination byte swap for YUV/RGB
+ data written to preview surface.
+
+ This flag enables byte swap for 32 bit words of data coming from VIP and
+ going to a target RGB or YUV422 surface. The sequence of 4 byte groups in
+ (LSB)b0 b1 b2 b3(MSB) order is swapped to
+ (LSB)b1 b0 b3 b2(MSB).
+
+ This flag only affects data written to a preview surface, i.e. VIP image
+ capture enabled with GFVxVIPSetVIP() and GFVxVIPUpdate(). It does not
+ affect raw data going to the JPEG/MPEG encoder.
+
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_DEST_BYTE_SWAP 0x00020000
+
+/** VxAPI GFVXVIPINFO::Flag flagbit: VI output without rotation
+ Rotate VIP image 0 degree
+ @version SC15 and above
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_ROTATE_0 0x00040000
+
+/** VxAPI GFVXVIPINFO::Flag flagbit: VI output with 90 degree rotation
+ Rotate VIP image 90 degree
+ @version SC15 and above
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_ROTATE_90 0x00080000
+
+/** VxAPI GFVXVIPINFO::Flag flagbit: VI output with 180 degree rotation
+ Rotate VIP image 180 degree
+ @version SC15 and above
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_ROTATE_180 0x00100000
+
+/** VxAPI GFVXVIPINFO::Flag flagbit: VI output with 270 degree rotation
+ Rotate VIP image 270 degree
+ @version SC15 and above
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_ROTATE_270 0x00200000
+
+/** VxAPI GFVXVIPINFO::Flag flagbit: RGB565 input to EPP.
+ @todo clarify
+ @version SC15 and above
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_RGB565 0x00400000
+
+/** VxAPI GFVXVIPINFO::Flag flagbit: RGB888 input to EPP.
+ @todo clarify
+ @version SC15 and above
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_RGB888 0x00800000
+
+/** VxAPI GFVXVIPINFO::Flag flagbit: RGB444 input to EPP.
+ @todo clarify
+ @version SC15 and above
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_RGB444 0x01000000
+
+/** VxAPI GFVXVIPINFO::Flag flagbit: Preserve VI clock source but enable external VLCK pad.
+ This flag can be used in combination with GFVX_VIP_EXTERNAL_VCLK to enable
+ an external clock on VLCK, but keep the VI module clocksource.
+ @version SC15 and above
+ @see GFVXVIPINFO, GFVxVIPSetVIP(), GFVX_VIP_EXTERNAL_VCLK
+*/
+#define GFVX_VIP_EXTERNAL_VCLK_PRESERVE_CLKSEL 0x02000000
+
+/** VxAPI GFVXVIPINFO::Flag flagbit: VIP input type D interface.
+ @version SC17 and above
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_TYPE_D 0x04000000
+
+#define GFVX_VIP_CSI_ENABLE 0x08000000
+
+/** VxAPI GFVXVIPINFO::Flag flagbit: Bypass any manipulation on internal master
+ clock generation output pin.
+
+ This flag is mutually exclusive to #GFVX_VIP_PRE_GENERATE_MCLOCK and
+ #GFVX_VIP_ASK_FOR_MCLOCK.
+
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_BYPASS_MCLOCK_PIN 0x20000000
+
+/** VxAPI GFVXVIPINFO::Flag flagbit: Bypass any manipulation on VCLK, VHSYNC,
+ and VID[7:0] pins.
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_BYPASS_NON_MCLOCK_PINS 0x40000000
+
+/** VxAPI GFVXVIPINFO::Flag flagbit: Pre-generation of master clock.
+ Useful for scanning the I2C bus for a camera.
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_PRE_GENERATE_MCLOCK 0x80000000
+
+/**
+ Bypass ISP mode.
+*/
+#define GFVX_VIP_BYPASS_ISP 0x10000000
+
+/** VxAPI GFVXVIPINFO::NewTiming flagbit: Parallel data latched at falling edge
+ of VCLK (default is rising edge).
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_PDL_FALLING_VCLK 0x00000001
+
+/** VxAPI GFVXVIPINFO::NewTiming flagbit: Serial data lacthed at rising edge of
+ VCLK (default is falling edge).
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_SDL_RISING_VCLK 0x00000001
+
+/** VxAPI GFVXVIPINFO::NewTiming flagbit: VHSYNC active low (default is active
+ high).
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_VHSYNC_ACTIVE_LOW 0x00000002
+
+/** VxAPI GFVXVIPINFO::NewTiming flagbit: VVSYNC active low (default is active
+ high).
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_VVSYNC_ACTIVE_LOW 0x00000004
+
+/** VxAPI GFVXVIPINFO::NewTiming flagbit: VHSYNC active leading edge (default
+ is trailing edge).
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_VHSYNC_ACTIVE_EDGE_LEAD 0x00000008
+
+/** VxAPI GFVXVIPINFO::NewTiming flagbit: VVSYNC active leading edge (default
+ is trailing edge).
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_VVSYNC_ACTIVE_EDGE_LEAD 0x00000010
+
+/** VxAPI GFVXVIPINFO::NewTiming flagbit: Serial video frame sync active low,
+ falling edge indicates start of data frame (default is active high, rising
+ edge indicates start of data frame).
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_SFRAME_ACTIVE_LOW 0x00000020
+
+/** VxAPI GFVXVIPINFO::NewTiming flagbit: Serial video input is 16 bit per
+ frame (default is 8 bit per frame).
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_SFRAME_SIZE_16 0x00000040
+
+/** VxAPI GFVXVIPINFO::NewTiming flagbit: Field 0 is bottom/even field
+ (default is top/odd field).
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_FILED_0_BOTTOM 0x00000080
+
+/** VxAPI GFVXVIPINFO::NewTiming flagbit: VCLK output from GoForce chip active
+ low (default is active high).
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_VCLK_OUTPUT_ACTIVE_LOW 0x00000100
+
+#define GFVX_VIP_VHSYNC_ACTIVE_LOW_RESET 0x00000200
+
+/** VxAPI GFVXVIPINFO::NewTiming flagbit: VVSYNC reset active low (default is active
+ high).
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_VVSYNC_ACTIVE_LOW_RESET 0x00000400
+
+/** VxAPI GFVXVIPINFO::NewTiming flagbit: VHSYNC reset active leading edge (default
+ is trailing edge).
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+
+
+#endif
diff --git a/Start_WM/test6/inc/cpuopsys.h b/Start_WM/test6/inc/cpuopsys.h
new file mode 100755
index 00000000..daa89a73
--- /dev/null
+++ b/Start_WM/test6/inc/cpuopsys.h
@@ -0,0 +1,309 @@
+
+/*! \brief
+ * Define compile time symbols for CPU type and operating system type.
+ * This file should only contain preprocessor commands so that
+ * there are no dependencies on other files.
+ *
+ * cpuopsys.h
+ *
+ * Copyright (c) 2001, Nvidia Corporation. All rights reserved.
+ */
+
+/*!
+ * Uniform names are defined for compile time options to distinguish
+ * CPU types and Operating systems.
+ * Distinctions between CPU and OpSys should be orthogonal.
+ *
+ * These uniform names have initially been defined by keying off the
+ * makefile/build names defined for builds in the OpenGL group.
+ * Getting the uniform names defined for other builds may require
+ * different qualifications.
+ *
+ * The file is placed here to allow for the possibility of all driver
+ * components using the same naming convention for conditional compilation.
+ */
+
+#ifndef __cpuopsys_h_
+#define __cpuopsys_h_
+
+/*****************************************************************************/
+// Define all OS/CPU-Chip related symbols
+
+// ***** DOS variations
+#if defined(__DJGPP__)
+# define NV_DOS
+#endif
+
+// ***** WINDOWS variations
+#if defined(_WIN32) || defined(_WIN16)
+# define NV_WINDOWS
+
+# if defined(_WIN32_WINNT)
+# define NV_WINDOWS_NT
+# elif defined(_WIN32_WCE)
+# define NV_WINDOWS_CE
+# elif !defined(NV_MODS)
+# define NV_WINDOWS_9X
+# endif
+#endif // _WIN32 || defined(_WIN16)
+
+// ***** Unix variations
+#if defined(__linux__) && !defined(NV_LINUX)
+# define NV_LINUX
+#endif // defined(__linux__)
+
+// SunOS + gcc
+#if defined(__sun__) && defined(__svr4__)
+# define NV_SUNOS
+#endif // defined(__sun__) && defined(__svr4__)
+
+// SunOS + Sun Compiler (named SunPro, Studio or Forte)
+#if defined(__SUNPRO_C) || defined(__SUNPRO_CC)
+# define NV_SUNPRO_C
+# define NV_SUNOS
+# define __FUNCTION__ __func__
+# define NV_OPENGL_THREAD_UNSAFE // XXX To start with
+#endif // defined(_SUNPRO_C) || defined(__SUNPRO_CC)
+
+#if defined(__FreeBSD__)
+# define NV_BSD
+#endif // defined(__FreeBSD__)
+
+// XXXar don't define NV_UNIX on MacOSX or vxworks or dos or QNX
+#if (defined(__unix__) || defined(__unix) ) && !defined(macosx) && !defined(vxworks) && !defined(__DJGPP__) && !defined(NV_UNIX) && !defined(__QNX__) && !defined(__QNXNTO__)// XXX until removed from Makefiles
+# define NV_UNIX
+#endif // defined(__unix__)
+
+#if (defined(__QNX__) || defined(__QNXNTO__)) && !defined(NV_QNX)
+# define NV_QNX
+#endif
+
+// ***** Apple variations
+#if defined(macintosh) || defined(__APPLE__)
+# define NV_MACINTOSH
+# if defined(__MACH__)
+# define NV_MACINTOSH_OSX
+# if !defined(NV_MODS)
+# define NV_MACOSX_OPENGL
+# endif
+# else
+# define NV_MACINTOSH_OS9
+# endif
+# if defined(__LP64__)
+# define NV_MACINTOSH_64
+# endif
+#endif // defined(macintosh)
+
+// ***** VxWorks
+// Tornado 2.21 is gcc 2.96 and #defines __vxworks.
+// Tornado 2.02 is gcc 2.7.2 and doesn't define any OS symbol, so we rely on
+// the build system #defining vxworks.
+#if defined(__vxworks) || defined(vxworks)
+# define NV_VXWORKS
+# if (CPU==PENTIUM)
+# define NV_VXWORKS_PENTIUM
+# elif (CPU==PPC604)
+# define NV_VXWORKS_PPC604
+# endif
+#endif
+
+// ***** Integrity OS
+#if defined(__INTEGRITY)
+# if !defined(NV_INTEGRITY)
+# define NV_INTEGRITY
+# endif
+#endif
+
+// ***** Processor type variations
+// Note: The prefix NV_CPU_* is taken by \\sw\main\sdk\nvidia\inc\Nvcm.h
+
+#if ((defined(_M_IX86) || defined(__i386__) || defined(__i386)) && !defined(NVCPU_X86)) // XXX until removed from Makefiles
+ // _M_IX86 for windows, __i386__ for Linux (or any x86 using gcc)
+ // __i386 for Studio compiler on Solaris x86
+# define NVCPU_X86 // any IA32 machine (not x86-64)
+#endif
+
+#if defined(_WIN32) && defined(_M_IA64)
+# define NVCPU_IA64_WINDOWS // any IA64 for Windows opsys
+#endif
+#if defined(NV_LINUX) && defined(__ia64__)
+# define NVCPU_IA64_LINUX // any IA64 for Linux opsys
+#endif
+#if defined(NVCPU_IA64_WINDOWS) || defined(NVCPU_IA64_LINUX) || defined(IA64)
+# define NVCPU_IA64 // any IA64 for any opsys
+#endif
+
+#if (defined(NV_MACINTOSH) && !(defined(__i386__) || defined(__x86_64__))) || defined(__PPC__) || defined(__ppc)
+# ifndef NVCPU_PPC
+# define NVCPU_PPC // any PowerPC architecture
+# endif
+# ifndef NV_BIG_ENDIAN
+# define NV_BIG_ENDIAN
+# endif
+#endif
+
+#if defined(__x86_64) || defined(AMD64) || defined(_M_AMD64)
+# define NVCPU_X86_64 // any x86-64 for any opsys
+#endif
+
+#if defined(__arm__) && !defined(NVCPU_ARM)
+# define NVCPU_ARM
+#endif
+
+#if defined(__XSCALE__)
+#define NVCPU_XSCALE // for XSCALE ARM processors
+#endif
+
+#if defined(__SH4__)
+# ifndef NVCPU_SH4
+# define NVCPU_SH4 // Renesas (formerly Hitachi) SH4
+# endif
+#endif
+
+// For Xtensa processors
+#if defined(__XTENSA__)
+# define NVCPU_XTENSA
+# if defined(__XTENSA_EB__)
+# define NV_BIG_ENDIAN
+# endif
+#endif
+
+
+// Other flavors of CPU type should be determined at run-time.
+// For example, an x86 architecture with/without SSE.
+// If it can compile, then there's no need for a compile time option.
+// For some current GCC limitations, these may be fixed by using the Intel
+// compiler for certain files in a Linux build.
+
+
+#if defined(NVCPU_IA64) || defined(NVCPU_X86_64)
+# define NV_64_BITS // all architectures where pointers are 64 bits
+#else
+ // we assume 32 bits. I don't see a need for NV_16_BITS.
+#endif
+
+// NOTE: NV_INT64_OK is not needed in the OpenGL driver for any platform
+// we care about these days. The only consideration is that Linux does not
+// have a 64-bit divide on the server. To get around this, we convert the
+// expression to (double) for the division.
+#if (!(defined(macintosh) || defined(vxworks) || defined(__INTEL_COMPILER)) || defined(NV_LINUX)) && !defined(NV_INT64_OK)
+#define NV_INT64_OK
+#endif
+
+// For verification-only features not intended to be included in normal drivers
+#if defined(NV_MODS) && defined(DEBUG) && !defined(NV_DOS)
+#define NV_VERIF_FEATURES
+#endif
+
+
+/*
+ * New, safer family of #define's -- these ones use 0 vs. 1 rather than
+ * defined/!defined. This is advantageous because if you make a typo, say:
+ *
+ * #if NVCPU_IS_BIG_ENDAIN // Oops! Endian is misspelled
+ *
+ * ...some compilers can give you a warning telling you that you screwed up.
+ * The compiler can also give you a warning if you forget to #include
+ * "cpuopsys.h" in your code before the point where you try to use these
+ * conditionals.
+ *
+ * Also, the names have been prefixed in more cases with "CPU" or "OS" for
+ * increased clarity. You can tell the names apart from the old ones because
+ * they all use "_IS_" in the name.
+ *
+ * Finally, these can be used in "if" statements and not just in #if's. For
+ * example:
+ *
+ * if (NVCPU_IS_BIG_ENDIAN) x = Swap32(x);
+ *
+ * Maybe some day in the far-off future these can replace the old #define's.
+ */
+#if defined(NV_WINDOWS)
+#define NVOS_IS_WINDOWS 1
+#else
+#define NVOS_IS_WINDOWS 0
+#endif
+#if defined(NV_WINDOWS_CE)
+#define NVOS_IS_WINDOWS_CE 1
+#else
+#define NVOS_IS_WINDOWS_CE 0
+#endif
+#if defined(NV_LINUX)
+#define NVOS_IS_LINUX 1
+#else
+#define NVOS_IS_LINUX 0
+#endif
+#if defined(NV_UNIX)
+#define NVOS_IS_UNIX 1
+#else
+#define NVOS_IS_UNIX 0
+#endif
+#if defined(NV_QNX)
+#define NVOS_IS_QNX 1
+#else
+#define NVOS_IS_QNX 0
+#endif
+#if defined(NV_MACINTOSH)
+#define NVOS_IS_MACINTOSH 1
+#else
+#define NVOS_IS_MACINTOSH 0
+#endif
+#if defined(NV_VXWORKS)
+#define NVOS_IS_VXWORKS 1
+#else
+#define NVOS_IS_VXWORKS 0
+#endif
+#if defined(NV_INTEGRITY)
+#define NVOS_IS_INTEGRITY 1
+#else
+#define NVOS_IS_INTEGRITY 0
+#endif
+#if defined(NVCPU_X86)
+#define NVCPU_IS_X86 1
+#else
+#define NVCPU_IS_X86 0
+#endif
+#if defined(NVCPU_IA64)
+#define NVCPU_IS_IA64 1
+#else
+#define NVCPU_IS_IA64 0
+#endif
+#if defined(NVCPU_X86_64)
+#define NVCPU_IS_X86_64 1
+#else
+#define NVCPU_IS_X86_64 0
+#endif
+#if defined(NVCPU_PPC)
+#define NVCPU_IS_PPC 1
+#else
+#define NVCPU_IS_PPC 0
+#endif
+#if defined(NVCPU_ARM)
+#define NVCPU_IS_ARM 1
+#else
+#define NVCPU_IS_ARM 0
+#endif
+#if defined(NVCPU_SH4)
+#define NVCPU_IS_SH4 1
+#else
+#define NVCPU_IS_SH4 0
+#endif
+#if defined(NVCPU_XTENSA)
+#define NVCPU_IS_XTENSA 1
+#else
+#define NVCPU_IS_XTENSA 0
+#endif
+#if defined(NV_BIG_ENDIAN)
+#define NVCPU_IS_BIG_ENDIAN 1
+#else
+#define NVCPU_IS_BIG_ENDIAN 0
+#endif
+#if defined(NV_64_BITS)
+#define NVCPU_IS_64_BITS 1
+#else
+#define NVCPU_IS_64_BITS 0
+#endif
+
+/*****************************************************************************/
+
+#endif /* __cpuopsys_h_ */
diff --git a/Start_WM/test6/inc/gfrm_clock_ids.h b/Start_WM/test6/inc/gfrm_clock_ids.h
new file mode 100755
index 00000000..bd0d1209
--- /dev/null
+++ b/Start_WM/test6/inc/gfrm_clock_ids.h
@@ -0,0 +1,22 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/** @file clock_ids.h
+ Clock List & string names
+*/
+
+GFRM_CLOCK(OSC,"osc")
+GFRM_CLOCK(ROSC,"rosc")
+GFRM_CLOCK_PLL(PLL1,"pll1")
+GFRM_CLOCK_PLL(PLL2,"pll2")
+GFRM_CLOCK(REFCLK0,"refclk0")
+GFRM_CLOCK(REFCLK1,"refclk1")
+GFRM_CLOCK(REFCLK2,"refclk2")
+GFRM_CLOCK_PLL(PLL3,"pll3")
+
diff --git a/Start_WM/test6/inc/gfrm_module_ids.h b/Start_WM/test6/inc/gfrm_module_ids.h
new file mode 100755
index 00000000..fb644b13
--- /dev/null
+++ b/Start_WM/test6/inc/gfrm_module_ids.h
@@ -0,0 +1,56 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/** @file module_ids.h
+ Module List & string names
+*/
+
+
+GFRM_MODULE(HOST1X, "host1x")
+GFRM_MODULE(MPD,"mpd")
+GFRM_MODULE(ME,"me")
+GFRM_MODULE(JPEGE,"jpege")
+GFRM_MODULE(VI,"vi")
+GFRM_MODULE(EPP,"epp")
+GFRM_MODULE(ISP,"isp")
+GFRM_MODULE(DSPCORE,"dspcore")
+GFRM_MODULE(GR2D,"gr2d")
+GFRM_MODULE(GR3D,"gr3d")
+GFRM_MODULE(DISPLAY,"display")
+GFRM_MODULE(I2S,"i2s")
+GFRM_MODULE(IC,"ic")
+GFRM_MODULE(SD,"sd")
+GFRM_MODULE(MC,"mc")
+GFRM_MODULE(EMC,"emc")
+GFRM_MODULE(DSP,"dsp")
+GFRM_MODULE(EFUSE,"efuse")
+GFRM_MODULE(AUDIO,"audio")
+GFRM_MODULE(TVO,"tvo")
+GFRM_MODULE(DISPLAYB,"displayb")
+GFRM_MODULE(I2SB,"i2sb")
+GFRM_MODULE(DSPB,"dspb")
+GFRM_MODULE(CVE,"cve")
+GFRM_MODULE(DSPBCORE,"dspbcore")
+GFRM_MODULE(CSI,"csi")
+GFRM_MODULE(TVDAC,"tvdac")
+GFRM_MODULE(APB,"apb")
+GFRM_MODULE(RESET, "reset")
+GFRM_MODULE(SPROM, "sprom")
+GFRM_MODULE(GPIO, "gpio")
+GFRM_MODULE(CLK, "clk")
+GFRM_MODULE(UART, "uart")
+GFRM_MODULE(UART2, "uart2")
+GFRM_MODULE(UART3, "uart3")
+GFRM_MODULE(TIMER, "timer")
+GFRM_MODULE(KBC, "kbc")
+GFRM_MODULE(DMA, "dma")
+GFRM_MODULE(USB, "usb")
+GFRM_MODULE(CEATA, "ceata")
+GFRM_MODULE(FLASH, "flash")
+GFRM_MODULE(XHOST, "xhost")
diff --git a/Start_WM/test6/inc/nvboard.h b/Start_WM/test6/inc/nvboard.h
new file mode 100755
index 00000000..9277a904
--- /dev/null
+++ b/Start_WM/test6/inc/nvboard.h
@@ -0,0 +1,619 @@
+/*
+ * Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an express
+ * license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+#ifndef NVBOARD_H
+#define NVBOARD_H
+
+#include "nvcommon.h"
+#include "nverror.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+/** NvBoard - Board Support Package
+
+ NvBoard is designed to decouple customer platform specifics from generic
+ binary only drivers.
+
+ The interface must be thread-safe.
+ */
+
+typedef struct NvBoardAperture_t
+{
+ /* Physical Address */
+ NvPhysAddr address;
+
+ /* Size of Aperture */
+ NvU32 size;
+} NvBoardAperture;
+
+typedef struct NvBoardApertureIO_t
+{
+ void ( *Write8 )( void *pAddress, NvU8 data );
+ void ( *Write16 )( void *pAddress, NvU16 data );
+ void ( *Write32 )( void *pAddress, NvU32 data );
+ void ( *Write64 )( void *pAddress, NvU64 data );
+ NvU8 ( *Read8 )( void *pAddress );
+ NvU16 ( *Read16 )( void *pAddress );
+ NvU32 ( *Read32 )( void *pAddress );
+ NvU64 ( *Read64 )( void *pAddress );
+} NvBoardApertureIO;
+
+typedef struct NvBoardApertures_t
+{
+ NvBoardAperture hostInterface;
+
+ /* pIO is null unless the apertures cannot be dereferenced */
+ NvBoardApertureIO *pIO;
+} NvBoardApertures;
+
+typedef enum
+{
+ /* Bus type A */
+ NvBoardBusType_A,
+
+ /* Bus type C */
+ NvBoardBusType_C,
+
+ NvBoardBusType_Forceword = 0x7fffffff,
+} NvBoardBusType;
+
+typedef enum
+{
+ /* Direct Addressing */
+ NvBoardBusAddressing_Direct,
+
+ /* Indirect Addressing */
+ NvBoardBusAddressing_Indirect,
+
+ NvBoardBusAddressing_Forceword = 0x7fffffff,
+} NvBoardBusAddressing;
+
+typedef enum
+{
+ /* 16-bit bus */
+ NvBoardBusWidth_16,
+
+ /* 32-bit bus */
+ NvBoardBusWidth_32,
+
+ NvBoardBusWidth_Forceword = 0x7fffffff,
+} NvBoardBusWidth;
+
+typedef enum
+{
+ /* Handshake mode. */
+ NvBoardBusMode_Handshake,
+
+ /* Fixed cycle mode. */
+ NvBoardBusMode_FixedCycle,
+
+ NvBoardBusMode_Forceword = 0x7fffffff,
+} NvBoardBusMode;
+
+typedef enum
+{
+ /* Asynchronous. */
+ NvBoardBusSynchronization_Asynchronous,
+
+ /* Synchronous. */
+ NvBoardBusSynchronization_Synchronous,
+
+ NvBoardBusSynchronization_Forceword = 0x7fffffff,
+} NvBoardBusSynchronization;
+
+typedef enum
+{
+ /* Active low. */
+ NvBoardBusReadyPolarity_ActiveLow,
+
+ /* Active high. */
+ NvBoardBusReadyPolarity_ActiveHigh,
+
+ NvBoardBusReadyPolarity_Forceword = 0x7fffffff,
+} NvBoardBusReadyPolarity;
+
+typedef struct NvBoardMode_t
+{
+ NvBoardBusAddressing GPUaddressing; // Bus perspective from GPU
+ NvBoardBusWidth GPUwidth;
+ NvBoardBusAddressing CPUaddressing; // Bus perspective from CPU
+ NvBoardBusWidth CPUwidth;
+ NvBoardBusType type;
+ NvBoardBusMode mode;
+ NvBoardBusSynchronization synchronization;
+ NvBoardBusReadyPolarity readyPolarity;
+} NvBoardMode;
+
+/** Stateless methods. Methods can be called before NvBoardInit */
+
+/** NvBoardListSupportedModes - Method to enumerate the modes of the board
+
+ Two calls should be made to this method.
+
+ On the first call, the method populates the number of modes, for the
+ display. When this call is issued pMode should be NULL.
+
+ On the second call, the length of the pMode array is indicated by
+ the value of *pNum. When pNum is less than the number of modes the
+ method populates the pMode array with only the first pNum modes.
+ When is more than the number of modes, the method populates the
+ pMode array with the number of modes and writes the number of modes
+ into pNum.
+
+ The first mode enumerated by this method is the recommended / default mode
+ for the display.
+
+ @param pNum unsigned integer value indicating the number of modes in
+ the array pMode.
+
+ @param pMode pointer to an array of mode structures, where the size of
+ the array is determined by the value in pNum.
+
+ @retval NvSuccess - on success
+ NvErrorBadParameter - when at least one parameter is incorrect
+ */
+NvError
+NvBoardListSupportedModes( NvU32 *pNum, NvBoardMode *pMode );
+
+/** Library Initialization */
+
+/** NvBoardInit - platform initialization. Typically chip select is configured here.
+
+ NvBoardInit uses a reference counter. The first invocation performs the
+ initialization, all future calls increment the counter. The counter is
+ decremented by NvBoardDeInit.
+
+ This method is to be called before any other NvBoard methods can be used.
+
+ @param pMode pointer to structure containing a mode to set on the board.
+ If mode is null, the recommended mode will be chosen.
+ */
+NvError
+NvBoardInit( const NvBoardMode *pMode );
+
+/** NvBoardDeInit - platform deinitialization.
+ */
+void
+NvBoardDeInit( void );
+
+/** Wince platform resume control */
+NvError
+NvBoardResume( void );
+
+/** Wince platform suspend control */
+NvError
+NvBoardSuspend( void );
+
+/** SD card detect status when card detect pin is connected to CPU GPIO pin */
+NvError
+nvBoardSDCardDetectStatus(NvU32 *bCardInserted);
+
+/** SD card detect sysintr number if card detect pin is connected to CPU GPIO pin*/
+NvError
+nvBoardSDCardDetectSysintr(NvU32 *dwSysintr);
+
+/** SD card socket power pin configuration
+ In general, this pin is connected to CPU GPIO pin, and we need to configure
+ GPIO input/output mode and setup default value
+*/
+NvError
+nvBoardSDSocketPowerInit(void);
+
+/** SD card socket power control*/
+NvError
+nvBoardSDSocketPowerOnOff(NvU32 SDPowerOn);
+
+/** Camera(VI) interface power plane control*/
+NvError
+nvBoardVIPowerOnOff(NvU32 VIPowerOn);
+
+/** OEM specific powerOn related calls after NV backlight ON.
+
+ @retval ERROR_SUCCESS on success or appropriate wince error
+ codes.
+*/
+NvError
+nvBoard_PostOEMBacklightOn(void);
+
+/** OEM specific powerOff related calls after NV backlight Off.
+
+ @retval ERROR_SUCCESS on success or appropriate wince error
+ codes.
+*/
+NvError
+nvBoard_PostOEMBacklightOff(void);
+
+/** NvBoardGetApertures - get apertures
+ */
+NvError
+NvBoardGetApertures( NvBoardApertures *pApertures );
+
+/** NvBoardGetMode - get current mode
+ */
+NvError
+NvBoardGetMode( NvBoardMode *pMode );
+
+/** Device Events -- Abstraction for interrupts */
+
+/* NvDeviceEvent enumerates the types of events. NvBoard implementors should not
+ hardcode event names. The only enumerated value that should be used in the
+ implementation of NvBoard is NvDeviceEvent_Num.
+ */
+typedef enum NvDeviceEvent_t
+{
+ /* NOTE: Currently using unabstracted events until INTx is removed. */
+ NvDeviceEvent_HOST = 0,
+ NvDeviceEvent_GRMPD,
+ NvDeviceEvent_ME,
+ NvDeviceEvent_JPEGE,
+ NvDeviceEvent_VI,
+ NvDeviceEvent_EPP,
+ NvDeviceEvent_ISP,
+ NvDeviceEvent_DSP,
+ NvDeviceEvent_GR2D,
+ NvDeviceEvent_GR3D,
+ NvDeviceEvent_DISPLAY,
+ NvDeviceEvent_I2S,
+ NvDeviceEvent_IC,
+ NvDeviceEvent_SD,
+ NvDeviceEvent_MC,
+ NvDeviceEvent_EMC,
+
+ /* NUM should always be the 2nd last enumerated value */
+ NvDeviceEvent_Num,
+
+ NvDeviceEvent_Forceword = 0x7fffffff,
+} NvDeviceEvent;
+
+/** NvBoardEnableEvent - Method to enable an event
+
+ If the event is fired before a client is waiting, the event will be remembered
+ for the next NvBoardWaitForEvent invocation.
+ */
+NvError
+NvBoardEnableEvent( NvDeviceEvent event );
+
+/** NvBoardDisableEvent - Method to disable an event
+ */
+void
+NvBoardDisableEvent( NvDeviceEvent event );
+
+/** NvBoardWaitForEvent - This method blocks until the event is fired
+
+ Each event may only have one client waiting on it. If more than one client
+ needs to be notified of an event, a broadcast layer will need to be
+ developed on top of this API.
+
+ Once an event is fired, it is disabled. To reenable the event use
+ NvBoardEnableEvent.
+*/
+NvError
+NvBoardWaitForEvent( NvDeviceEvent event );
+
+/** NvBoardWaitForEventWithTimeOut - NvBoardWaitForEvent with a timeout
+
+ @param timeOut Unit is milliseconds
+ */
+NvError
+NvBoardWaitForEventWithTimeOut( NvDeviceEvent event, NvU32 timeOut );
+
+/** I2C I/O */
+
+/** NvBoardI2CWrite - I2C write operation. Implementing this function is optional.
+ */
+NvError
+NvBoardI2CWrite( NvU32 addr, const void *ptr, NvU32 size );
+
+/** NvBoardI2CRead - I2C read operation. Implementing this function is optional.
+ */
+NvError
+NvBoardI2CRead( NvU32 addr, void *ptr, NvU32 size );
+
+/** Voltage and power control */
+
+typedef enum NvBoardPowerPlane_t
+{
+ NvBoardPowerPlane_AOCVDD = 0,
+ NvBoardPowerPlane_VECVDD,
+ NvBoardPowerPlane_MMCVDD,
+ NvBoardPowerPlane_TDCVDD,
+ NvBoardPowerPlane_VVDD,
+ NvBoardPowerPlane_EMVDD,
+ NvBoardPowerPlane_ACVDD,
+ NvBoardPowerPlane_LVDD,
+ NvBoardPowerPlane_HVDD,
+ NvBoardPowerPlane_AUXVDD,
+ NvBoardPowerPlane_R1CVDD,
+ NvBoardPowerPlane_SDVDD,
+ NvBoardPowerPlane_DRAM,
+
+ NvBoardPowerPlane_Forceword = 0x7fffffff,
+} NvBoardPowerPlane;
+
+typedef enum NvBoardClock_t
+{
+ NvBoardClock_PLL1 = 0,
+ NvBoardClock_PLL2,
+ NvBoardClock_COSC,
+ NvBoardClock_ROSC,
+ NvBoardClock_REF1,
+ NvBoardClock_REF2,
+
+ NvBoardClock_Forceword = 0x7fffffff,
+} NvBoardClock;
+
+/** NvBoardSetVoltage - change voltage of hardware block
+
+ @param voltage Unit is millivolts
+ */
+NvError
+NvBoardSetVoltage( NvBoardPowerPlane block, NvU32 voltage );
+
+/** NvBoardGetVoltage - get voltage of hardware block
+
+ @param voltage Unit is millivolts
+ */
+NvError
+NvBoardGetVoltage( NvBoardPowerPlane plane, NvU32 *voltage );
+
+/** NvBoardPowerOn - enable power to block
+ */
+NvError
+NvBoardPowerOn( NvBoardPowerPlane plane );
+
+/** NvBoardPowerOff - disable power to block
+ */
+NvError
+NvBoardPowerOff( NvBoardPowerPlane plane );
+
+/** NvBoardClockOn - enable clock
+ */
+NvError
+NvBoardClockOn( NvBoardClock clock );
+
+/** NvBoardClockOff - disable clock
+ */
+NvError
+NvBoardClockOff( NvBoardClock clock );
+
+/** NvBoardSetFrequency - set frequency of clock
+
+ @param frequency unit is KHz
+ */
+NvError
+NvBoardSetFrequency( NvBoardClock clock, NvU32 frequency );
+
+
+/** Platfrom specific debug function. This like an ioctl to the platfrom
+ sepcific code.
+ */
+void NvBoardDebug(void *p, NvU32 op, NvU32 arg);
+
+/** Event notification */
+
+typedef enum
+{
+ NvBoardDeviceType_Silicon,
+ NvBoardDeviceType_Emulator,
+ NvBoardDeviceType_Forceword = 0x7fffffff,
+} NvBoardDeviceType;
+
+typedef struct NvBoardDeviceInfo_t
+{
+ NvU32 MinorRev;
+ NvU32 MajorRev;
+ NvU32 ChipID;
+ NvU32 Family;
+ NvBoardDeviceType Type;
+} NvBoardDeviceInfo;
+
+/** NvBoardPostChipInit - Called after the chip is intialized.
+
+ Chip specific timings can be programmed at this point.
+
+ NvIrqPostChipInit should be called here.
+ */
+NvError
+NvBoardPostChipInit( NvBoardDeviceInfo *deviceInfo );
+
+/** NvBoardPreChipDeInit - Called before chip is shutdown.
+
+ NvIrqPreChipDeInit should be called here.
+ */
+NvError
+NvBoardPreChipDeInit( void );
+
+/** NvBoardClockSwitch - Clock switch handling
+
+ @param frequency Unit is kHz
+ */
+NvError
+NvBoardClockSwitch( NvU32 frequency );
+
+typedef enum NvBoardStateEvent_t
+{
+#ifdef NV_WINDOWS_CE
+ NvBoardStateEvent_PreDeviceInit,
+ NvBoardStateEvent_PostDeviceInit,
+ NvBoardStateEvent_PrePanelInit,
+ NvBoardStateEvent_PostPanelInit,
+ NvBoardStateEvent_PreSetMode,
+ NvBoardStateEvent_PostSetMode,
+ NvBoardStateEvent_PreDisplayInit,
+ NvBoardStateEvent_PostDisplayInit,
+ NvBoardStateEvent_PreOEMPowerHandlerVideoPowerOff,
+ NvBoardStateEvent_PostOEMPowerHandlerVideoPowerOff,
+ NvBoardStateEvent_PreOEMPowerHandlerVideoPowerOn,
+ NvBoardStateEvent_PostOEMPowerHandlerVideoPowerOn,
+#endif
+
+ NvBoardStateEvent_Forceword = 0x7fffffff,
+} NvBoardStateEvent;
+
+/** NvBoardGlobalStateNotification - Called during global state transitions
+
+ Only used on Windows CE at the moment.
+ */
+NvError
+NvBoardGlobalStateNotification( NvBoardStateEvent event );
+
+void
+NvBoardOsWaitUS( NvU32 usec );
+
+void
+NvBoardOsSleepMS( NvU32 msec );
+
+typedef struct NvBoardOsMutex_t *NvBoardOsMutex;
+typedef struct NvBoardOsSemaphore_t *NvBoardOsSemaphore;
+typedef struct NvBoardOsThread_t *NvBoardOsThread;
+
+NvError
+NvBoardOsMutexCreate( const char *key, NvBoardOsMutex *mutex );
+
+void
+NvBoardOsMutexLock( NvBoardOsMutex mutex );
+
+void
+NvBoardOsMutexUnlock( NvBoardOsMutex mutex );
+
+void
+NvBoardOsMutexDestroy( NvBoardOsMutex mutex );
+
+typedef struct NvBoardOsSharedMemDescriptor_t *NvBoardOsSharedMemDescriptor;
+
+NvError
+NvBoardOsSharedMemAlloc( const char *key, size_t size,
+ NvBoardOsSharedMemDescriptor *descriptor );
+
+NvError
+NvBoardOsSharedMemMap( NvBoardOsSharedMemDescriptor descriptor, size_t offset,
+ size_t size, void **ptr );
+
+void
+NvBoardOsSharedMemUnmap( void *ptr, size_t size );
+
+void
+NvBoardOsSharedMemFree( NvBoardOsSharedMemDescriptor descriptor );
+
+void
+NvBoardOsMemset( void *s, NvU8 c, size_t size );
+
+int
+NvBoardOsMemcmp( const void *s1, const void *s2, size_t size );
+
+#define NVBOARDOS_KEY_MAX 128
+
+#define NVBOARDOS_MEM_NONE 0x0
+#define NVBOARDOS_MEM_READ 0x1
+#define NVBOARDOS_MEM_WRITE 0x2
+#define NVBOARDOS_MEM_EXECUTE 0x4
+#define NVBOARDOS_MEM_READ_WRITE ( NVBOARDOS_MEM_READ | NVBOARDOS_MEM_WRITE )
+
+typedef enum
+{
+ NvBoardOsMemAttribute_Uncached = 0,
+ NvBoardOsMemAttribute_WriteBack = 1,
+ NvBoardOsMemAttribute_WriteCombined = 2,
+
+ NvBoardOsMemAttribute_Force32 = 0x7FFFFFFF
+} NvBoardOsMemAttribute;
+
+NvError
+NvBoardOsPhysicalMemMap( NvPhysAddr phys, size_t size,
+ NvBoardOsMemAttribute attrib, NvU32 flags, void **ptr );
+
+
+void
+NvBoardOsPhysicalMemUnmap( void *ptr, size_t size );
+
+NvError
+NvBoardOsMemoryAlloc(void **ptr, size_t size);
+
+void
+NvBoardOsMemoryFree(void *ptr, size_t size);
+
+NvError
+NvBoardOsGetConfigU32( const char *name, NvU32 *value );
+
+void *
+NvBoardOsAlloc( size_t size );
+
+void
+NvBoardOsFree( void *ptr );
+
+typedef void (*NvBoardOsThreadFunction)( void *args );
+
+NvError
+NvBoardOsThreadCreate( const char *name, NvBoardOsThreadFunction function,
+ void *args, NvBoardOsThread *thread );
+
+void
+NvBoardOsThreadJoin( NvBoardOsThread thread );
+
+void
+NvBoardOsThreadYield( void );
+
+NvError
+NvBoardOsSemaphoreCreate( const char *key, NvBoardOsSemaphore *semaphore,
+ NvU32 value );
+
+void
+NvBoardOsSemaphoreWait( NvBoardOsSemaphore semaphore );
+
+void
+NvBoardOsSemaphoreSignal( NvBoardOsSemaphore semaphore );
+
+void
+NvBoardOsSemaphoreDestroy( NvBoardOsSemaphore semaphore );
+
+NvError
+nvBoard_PreDisplayInit(void);
+
+NvError
+nvBoard_PostDisplayInit(void);
+
+NvError
+nvBoard_PrePanelInit(void);
+
+NvError
+nvBoard_PostPanelInit(void);
+
+NvError
+nvBoard_PreDeviceInit(void);
+
+NvError
+nvBoard_PostDeviceInit(void);
+
+NvError
+nvBoard_PreSetMode(void);
+
+NvError
+nvBoard_PostSetMode(void);
+
+NvError
+nvBoard_PreOEMPowerHandlerVideoPowerOff(void);
+
+NvError
+nvBoard_PostOEMPowerHandlerVideoPowerOff(void);
+
+NvError
+nvBoard_PreOEMPowerHandlerVideoPowerOn(void);
+
+NvError
+nvBoard_PostOEMPowerHandlerVideoPowerOn(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // NVBOARD_H
diff --git a/Start_WM/test6/inc/nvcommon.h b/Start_WM/test6/inc/nvcommon.h
new file mode 100755
index 00000000..ab79088f
--- /dev/null
+++ b/Start_WM/test6/inc/nvcommon.h
@@ -0,0 +1,153 @@
+/*
+ * Copyright (c) 2006 - 2007 NVIDIA Corporation. All Rights Reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an express
+ * license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+#ifndef NVCOMMON_H
+#define NVCOMMON_H
+
+#include "nvtypes.h"
+
+// Include headers that provide NULL, size_t, offsetof, and [u]intptr_t. In the
+// event that the toolchain doesn't provide these, provide them ourselves.
+#include
+#if NVOS_IS_WINDOWS_CE
+typedef int intptr_t;
+typedef unsigned int uintptr_t;
+#elif (NVOS_IS_LINUX && !defined(__KERNEL__)) || defined(__arm)
+#include
+#endif
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+/** nvcommon.h contains standard definitions used by various interfaces
+ */
+
+/** A physical address */
+#if NVOS_IS_WINDOWS
+typedef NvU64 NvPhysAddr;
+#else
+typedef NvU32 NvPhysAddr;
+#endif
+
+// For historical reasons that are hard to fix, nvtypes.h has an incorrect
+// definition of NV_ALIGN_BYTES for Windows and Macintosh, and for other
+// unsupported compilers like IAR. Provide a correct macro, which we call
+// NV_ALIGN. This can be removed if and when nvtypes.h is fixed.
+// Alternatively, we could use NV_DECLARE_ALIGNED...
+#if NVOS_IS_WINDOWS
+#define NV_ALIGN(size) __declspec(align(size))
+#elif defined(__GNUC__) || NVOS_IS_QNX
+#define NV_ALIGN(size) __attribute__ ((aligned (size)))
+#elif defined(__arm)
+#define NV_ALIGN(size) __align(size)
+#endif
+
+/**
+ * This macro wraps its argument with the equivalent of "#ifdef DEBUG", but also
+ * can be used where #ifdef's can't, like inside a macro.
+ */
+#if defined(DEBUG)
+#define NV_DEBUG_CODE(x) x
+#else
+#define NV_DEBUG_CODE(x)
+#endif
+
+/** Macro for determining the size of an array */
+#define NV_ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
+
+/** Macro for taking min or max of a pair of numbers */
+#define NV_MIN(a,b) (((a) < (b)) ? (a) : (b))
+#define NV_MAX(a,b) (((a) > (b)) ? (a) : (b))
+
+/**
+ * By convention, we use this value to represent an infinite wait interval in
+ * APIs that expect a timeout argument. A value of zero should not be
+ * interpreted as infinite -- it should be interpreted as "time out immediately
+ * and simply check whether the event has already happened."
+ */
+enum { NV_WAIT_INFINITE = 0xFFFFFFFF };
+
+/**
+ * Union that can be used to view a 32-bit word as your choice of a 32-bit
+ * unsigned integer, a 32-bit signed integer, or an IEEE single-precision float.
+ * Here is an example of how you might use it to extract the (integer) bitwise
+ * representation of a floating-point number:
+ * NvData32 data;
+ * data.f = 1.0f;
+ * printf("%x", data.u);
+ */
+typedef union NvData32Rec
+{
+ NvU32 u;
+ NvS32 i;
+ NvF32 f;
+} NvData32;
+
+/** NvPoint structure is used to determine a location on a 2-dimensional
+ object, where the coordinate (0,0) is located at the top-left of the
+ object. The values of x and y are in pixels.
+ */
+typedef struct _NvPoint_t
+{
+ /** horizontal location of the point */
+ NvS32 x;
+
+ /** vertical location of the point */
+ NvS32 y;
+
+} NvPoint;
+
+
+/** NvRect structure is used to define a 2-dimensional rectangle
+ where the rectangle is bottom right exclusive (i.e. the right most
+ column, and the bottom row of the rectangle is not included)
+ */
+typedef struct _NvRect_t
+{
+ /** left column of a rectangle */
+ NvS32 left;
+
+ /** top row of a rectangle*/
+ NvS32 top;
+
+ /** right column of a rectangle */
+ NvS32 right;
+
+ /** bottom row of a rectangle */
+ NvS32 bottom;
+
+} NvRect;
+
+
+/** NvSize structure is used to define a 2-dimensional surface
+ where the surface is determined by it's height and width in
+ pixels
+ */
+typedef struct _NvSize_t
+{
+ /* width of the surface in pixels */
+ NvS32 width;
+
+ /* height of the surface in pixels */
+ NvS32 height;
+
+} NvSize;
+
+
+/** NvDeviceHandle is an opaque handle to a device
+ */
+typedef struct NvDeviceStruct_t *NvDeviceHandle;
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* NVCOMMON_H */
diff --git a/Start_WM/test6/inc/nverror.h b/Start_WM/test6/inc/nverror.h
new file mode 100755
index 00000000..6ef69080
--- /dev/null
+++ b/Start_WM/test6/inc/nverror.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2006 NVIDIA Corporation. All Rights Reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an express
+ * license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+#ifndef NVERROR_H
+#define NVERROR_H
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+/* NvError_t enumeration contains ALL return / error codes. Error codes
+ are specifically explicit to make it easy to identify where an error
+ came from.
+
+ All error codes are derived from the macros in NvErrVal.h
+ */
+typedef enum _NvError_t
+{
+
+#ifdef NVERROR
+#undef NVERROR
+#endif /* NVERROR */
+
+#define NVERROR(_name_, _value_, _desc_) _name_ = _value_,
+
+ /* header included for macro expansion of error codes */
+ #include "nverrval.h"
+
+ /* bogus error code used to padd the enum to 32bits */
+ NvErrorMax = 0x7FFFFFFF
+
+#undef NVERROR
+
+} NvError;
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* NVERROR_H */
+
diff --git a/Start_WM/test6/inc/nverrval.h b/Start_WM/test6/inc/nverrval.h
new file mode 100755
index 00000000..2045dd83
--- /dev/null
+++ b/Start_WM/test6/inc/nverrval.h
@@ -0,0 +1,277 @@
+/*
+ * Copyright (c) 2006 NVIDIA Corporation. All Rights Reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an express
+ * license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/* NvErrVal.h is a header used for macro expansion of the errors defined for
+ the Nv methods & interfaces.
+
+ This header is NOT protected from being included multiple times, as it is
+ used for C pre-processor macro expansion of error codes, and the
+ descriptions of those error codes.
+
+ Each error code has a unique name, description and value to make it easier
+ for developers to identify the source of a failure. Thus there are no
+ generic or unknown error codes.
+*/
+
+/* common error codes */
+NVERROR(NvSuccess, 0x00000000, "success")
+NVERROR(NvError_NotImplemented, 0x00000001, "method or interface is not implemented")
+NVERROR(NvError_NotSupported, 0x00000002, "requested operation is not supported")
+NVERROR(NvError_NotInitialized, 0x00000003, "method or interface is not initialized")
+NVERROR(NvError_BadParameter, 0x00000004, "bad parameter to method or interface")
+NVERROR(NvError_Timeout, 0x00000005, "not completed in the expected time")
+NVERROR(NvError_InsufficientMemory, 0x00000006, "insufficient system memory")
+NVERROR(NvError_ReadOnlyAttribute, 0x00000007, "cannot write a read-only attribute")
+NVERROR(NvError_InvalidState, 0x00000008, "module is in invalid state to perform the requested operation")
+NVERROR(NvError_InvalidAddress, 0x00000009, "invalid address")
+NVERROR(NvError_InvalidSize, 0x0000000A, "invalid size")
+NVERROR(NvError_BadValue, 0x0000000B, "illegal value specified for parameter")
+
+/* surface specific error codes */
+NVERROR(NvError_InsufficientVideoMemory, 0x00010000, "insufficient video memory")
+NVERROR(NvError_BadSurfaceColorScheme, 0x00010001, "this surface scheme is not supported in the current controller")
+
+/* display specific error codes */
+NVERROR(NvError_DisplayIncompatible, 0x00020000, "display incompatible with method or interface")
+NVERROR(NvError_NoCompatibleMode, 0x00020001, "no compatible mode exists for the attached displays")
+NVERROR(NvError_ModeNotSupported, 0x00020002, "the mode is not supported by the display or controller")
+NVERROR(NvError_ControllerActive, 0x00020003, "the controller is active and cannot perform the operation")
+NVERROR(NvError_DisplayAlreadyAttached, 0x00020004, "the display is already attached to the controller")
+NVERROR(NvError_DetachDisplayFirst, 0x00020005, "the display is already attached to another controller")
+NVERROR(NvError_TooManyDisplays, 0x00020006, "the controller has not enough free display slots")
+NVERROR(NvError_NoDisplaysAttached, 0x00020007, "there are no displays attached to this controller")
+NVERROR(NvError_AlreadySuspended, 0x00020008, "the controller is already suspended")
+NVERROR(NvError_NotSuspended, 0x00020009, "the controller is not suspended, so cannot resume it")
+NVERROR(NvError_EmptyColorKeyRange, 0x00020010, "color key range that was set is empty")
+NVERROR(NvError_NoMode, 0x00020011, "controller is not driving a mode, cannot perform the selected action")
+NVERROR(NvError_NotInVerticalBlank, 0x00020012, "controller is not in vertical blank")
+
+/* DMA specific error codes */
+NVERROR(NvError_DmaTargetNotLocked, 0x00030000, "client does not have a lock for this target DMA controller")
+NVERROR(NvError_DmaCommunicationError, 0x00030001, "the DMA controller had failed to communicate with the target")
+NVERROR(NvError_DmaOpNotFinished, 0x00030002, "the DMA operation has not completed")
+NVERROR(NvError_DmaChannelNotAvailable, 0x00030003, "the requested DMA channel is not available")
+NVERROR(NvError_InvalidSourceId, 0x00030004, "invalid source ID")
+NVERROR(NvError_InvalidDestinationId, 0x00030005, "invalid destination ID")
+
+/* NvOs error codes */
+NVERROR(NvError_FileWriteFailed, 0x00040000, "the file write operation failed")
+NVERROR(NvError_FileReadFailed, 0x00040001, "the file read operation failed")
+NVERROR(NvError_EndOfFile, 0x00040002, "the end of file has been reached")
+NVERROR(NvError_FileOperationFailed, 0x00040003, "the file operation has failed")
+NVERROR(NvError_DirOperationFailed, 0x00040004, "the directory operation has failed")
+NVERROR(NvError_EndOfDirList, 0x00040005, "there are no more entries in the directory")
+NVERROR(NvError_ConfigVarNotFound, 0x00040006, "the configuration variable is not present")
+NVERROR(NvError_InvalidConfigVar, 0x00040007, "the configuration variable is corrupted")
+NVERROR(NvError_LibraryNotFound, 0x00040008, "the dynamic library was not found for open")
+NVERROR(NvError_SymbolNotFound, 0x00040009, "the symbol in a dyanmic library was not found")
+NVERROR(NvError_MemoryMapFailed, 0x0004000a, "the memory mapping operation failed")
+NVERROR(NvError_MutexCreateFailed, 0x0004000b, "the mutex create operation failed")
+NVERROR(NvError_SemaphoreCreateFailed, 0x0004000c, "the semaphore create operation failed")
+NVERROR(NvError_ThreadCreateFailed, 0x0004000d, "the thread create operation failed")
+NVERROR(NvError_SharedMemAllocFailed, 0x0004000e, "the shared memory allocation operation failed")
+
+/* NvBoard error codes */
+NVERROR(NvError_I2CNotAcknowledged, 0x00050000, "I2C acknowledge was not received")
+NVERROR(NvError_KernelDriverNotFound, 0x00050001, "unable to find kernel driver")
+NVERROR(NvError_KernelDriverBadVersion, 0x00050002, "the kernel driver is out of date")
+NVERROR(NvError_KernelDriverIOFailed, 0x00050003, "the driver operation failed")
+NVERROR(NvError_ModeMismatched, 0x00050004, "conflicting board mode")
+NVERROR(NvError_VoltageOutsideRange, 0x00050005, "requested voltage is outside valid range")
+NVERROR(NvError_EventNotEnabled, 0x00050006, "the event is not enabled")
+NVERROR(NvError_EventBusy, 0x00050007, "the event is busy")
+NVERROR(NvError_InterruptInitFailed, 0x00050008, "error initializing interrupts")
+
+/* NvIrq error codes */
+NVERROR(NvError_EventNotFound, 0x00060000, "no event found")
+
+/* Nv2D error codes */
+NVERROR(NvError_InvalidSurface, 0x00070000, "invalid surface")
+NVERROR(NvError_RopNotSupported, 0x00070001, "rop not supported")
+NVERROR(NvError_SurfaceNotSupported, 0x00070002, "surface is not supported")
+NVERROR(NvError_BitmapNotSupported, 0x00070003, "bitmap is not supported")
+
+/* NvPower error codes */
+NVERROR(NvError_ResourceAlreadyInUse, 0x00080000, "resource already in use")
+NVERROR(NvError_ResourceNotInUse, 0x00080001, "resource not in use")
+NVERROR(NvError_ResourceInUse, 0x00080002, "resource is in use")
+
+/* UART error codes */
+NVERROR(NvError_UartOverrun, 0x00090000, "overrun occurred when receiving the data")
+NVERROR(NvError_UartFraming, 0x00090001, "data received had framing error")
+NVERROR(NvError_UartParity, 0x00090002, "data received had parity error")
+NVERROR(NvError_UartFifoError, 0x00090003, "FIFO error occurred during receive/transmit")
+NVERROR(NvError_UartBreakReceived, 0x00090004, "received break signal")
+NVERROR(NvError_UartTransmit, 0x00090005, "UART transmit error")
+
+/* NvRm error code */
+NVERROR(NvError_RmInitFailed, 0x000a0000, "rm failed to initialize")
+NVERROR(NvError_RmChannelInitFailure, 0x000a0001, "channel init failed")
+NVERROR(NvError_RmStreamInitFailure, 0x000a0002, "stream init failed")
+NVERROR(NvError_RmSyncPointAllocFailure, 0x000a0003, "sync point alloc failed")
+NVERROR(NvError_RmStreamFlushFailure, 0x000a0004, "stream flush failed")
+
+/* NvIsp error codes */
+NVERROR(NvError_ChannelAllocFailed, 0x000B0000, "channel allocation failed")
+NVERROR(NvError_NoConnectedImager, 0x000B0001, "no imager connected")
+NVERROR(NvError_UnsupportedResolution, 0x000B0002, "unsupported resolution")
+NVERROR(NvError_I2CCommunicationError, 0x000B0003, "i2c communication failed")
+NVERROR(NvError_IspConfigFileParseError, 0x000B0004, "isp config file parse error")
+NVERROR(NvError_IspBusy, 0x000B0005, "isp 3A algorithm busy")
+NVERROR(NvError_TooDark, 0x000B0006, "image too dark for 3A operation")
+
+/* NvTest error codes */
+NVERROR(NvError_TestApplicationFailed, 0x000c0000, "the test application failed")
+NVERROR(NvError_TestNoUserInput, 0x000c0001, "no user input available")
+NVERROR(NvError_TestCommandLineError, 0x000c0002, "command line parsing error")
+
+/* NvCam error codes */
+NVERROR(NvError_VmAllocFailed, 0x000D0000, "virtual machine allocation failed")
+NVERROR(NvError_ScriptAccessFailed, 0x000D0001, "unable to access script")
+NVERROR(NvError_GettingComponentFailed, 0x000D0002, "getting component failed")
+NVERROR(NvError_VmBufferAllocFailed, 0x000D0003, "vm buffer allocation failed")
+NVERROR(NvError_CameraScriptNotPresent, 0x000D0004, "camera script not present")
+NVERROR(NvError_IllegalBayerValues, 0x000D0005, "illegal bayer values")
+NVERROR(NvError_ColorFormatNotSupported, 0x000D0006, "color format not supported")
+
+/* USBF error codes */
+NVERROR(NvError_UsbfTxfrActive, 0x000E0000, "The endpoint has an active transfer in progress.")
+NVERROR(NvError_UsbfTxfrComplete, 0x000E0001, "The endpoint has a completed transfer that has not been cleared.")
+NVERROR(NvError_UsbfEpStalled, 0x000E0002, "The endpoint has been placed in a halted or stalled state.")
+NVERROR(NvError_UsbfEpError, 0x000E0003, "The last transfer started on this endpoint failed to complete.")
+
+/* ^^^ ADD ALL NEW ERRORS RIGHT ABOVE HERE ^^^ */
+
+NVERROR(NvErrorNotImplemented, 0x00000001, "remove me later!")
+NVERROR(NvErrorNotSupported, 0x00000002, "remove me later!")
+NVERROR(NvErrorNotInitialized, 0x00000003, "remove me later!")
+NVERROR(NvErrorBadParameter, 0x00000004, "remove me later!")
+NVERROR(NvErrorTimeout, 0x00000005, "remove me later!")
+NVERROR(NvErrorInsufficientMemory, 0x00000006, "remove me later!")
+NVERROR(NvErrorReadOnlyAttribute, 0x00000007, "remove me later!")
+NVERROR(NvErrorInvalidState, 0x00000008, "remove me later!")
+NVERROR(NvErrorInvalidAddress, 0x00000009, "remove me later!")
+NVERROR(NvErrorInvalidSize, 0x0000000A, "remove me later!")
+NVERROR(NvErrorBadValue, 0x0000000B, "remove me later!")
+
+/* surface specific error codes */
+NVERROR(NvErrorInsufficientVideoMemory, 0x00010000, "remove me later!")
+NVERROR(NvErrorBadSurfaceColorScheme, 0x00010001, "remove me later!")
+
+/* display specific error codes */
+NVERROR(NvErrorDisplayIncompatible, 0x00020000, "remove me later!")
+NVERROR(NvErrorNoCompatibleMode, 0x00020001, "remove me later!")
+NVERROR(NvErrorModeNotSupported, 0x00020002, "remove me later!")
+NVERROR(NvErrorControllerActive, 0x00020003, "remove me later!")
+NVERROR(NvErrorDisplayAlreadyAttached, 0x00020004, "remove me later!")
+NVERROR(NvErrorDetachDisplayFirst, 0x00020005, "remove me later!")
+NVERROR(NvErrorTooManyDisplays, 0x00020006, "remove me later!")
+NVERROR(NvErrorNoDisplaysAttached, 0x00020007, "remove me later!")
+NVERROR(NvErrorAlreadySuspended, 0x00020008, "remove me later!")
+NVERROR(NvErrorNotSuspended, 0x00020009, "remove me later!")
+NVERROR(NvErrorEmptyColorKeyRange, 0x00020010, "remove me later!")
+NVERROR(NvErrorNoMode, 0x00020011, "remove me later!")
+NVERROR(NvErrorNotInVerticalBlank, 0x00020012, "remove me later!")
+
+/* DMA specific error codes */
+NVERROR(NvErrorDmaTargetNotLocked, 0x00030000, "remove me later!")
+NVERROR(NvErrorDmaCommunicationError, 0x00030001, "remove me later!")
+NVERROR(NvErrorDmaOpNotFinished, 0x00030002, "remove me later!")
+NVERROR(NvErrorDmaChannelNotAvailable, 0x00030003, "remove me later!")
+NVERROR(NvErrorInvalidSourceId, 0x00030004, "remove me later!")
+NVERROR(NvErrorInvalidDestinationId, 0x00030005, "remove me later!")
+
+/* NvOs error codes */
+NVERROR(NvErrorFileWriteFailed, 0x00040000, "remove me later!")
+NVERROR(NvErrorFileReadFailed, 0x00040001, "remove me later!")
+NVERROR(NvErrorEndOfFile, 0x00040002, "remove me later!")
+NVERROR(NvErrorFileOperationFailed, 0x00040003, "remove me later!")
+NVERROR(NvErrorDirOperationFailed, 0x00040004, "remove me later!")
+NVERROR(NvErrorEndOfDirList, 0x00040005, "remove me later!")
+NVERROR(NvErrorConfigVarNotFound, 0x00040006, "remove me later!")
+NVERROR(NvErrorInvalidConfigVar, 0x00040007, "remove me later!")
+NVERROR(NvErrorLibraryNotFound, 0x00040008, "remove me later!")
+NVERROR(NvErrorSymbolNotFound, 0x00040009, "remove me later!")
+NVERROR(NvErrorMemoryMapFailed, 0x0004000a, "remove me later!")
+NVERROR(NvErrorMutexCreateFailed, 0x0004000b, "remove me later!")
+NVERROR(NvErrorSemaphoreCreateFailed, 0x0004000c, "remove me later!")
+NVERROR(NvErrorThreadCreateFailed, 0x0004000d, "remove me later!")
+NVERROR(NvErrorSharedMemAllocFailed, 0x0004000e, "remove me later!")
+
+/* NvBoard error codes */
+NVERROR(NvErrorI2CNotAcknowledged, 0x00050000, "remove me later!")
+NVERROR(NvErrorKernelDriverNotFound, 0x00050001, "remove me later!")
+NVERROR(NvErrorKernelDriverBadVersion, 0x00050002, "remove me later!")
+NVERROR(NvErrorKernelDriverIOFailed, 0x00050003, "remove me later!")
+NVERROR(NvErrorModeMismatched, 0x00050004, "remove me later!")
+NVERROR(NvErrorVoltageOutsideRange, 0x00050005, "remove me later!")
+NVERROR(NvErrorEventNotEnabled, 0x00050006, "remove me later!")
+NVERROR(NvErrorEventBusy, 0x00050007, "remove me later!")
+NVERROR(NvErrorInterruptInitFailed, 0x00050008, "remove me later!")
+
+/* NvIrq error codes */
+NVERROR(NvErrorEventNotFound, 0x00060000, "remove me later!")
+
+/* Nv2D error codes */
+NVERROR(NvErrorInvalidSurface, 0x00070000, "remove me later!")
+NVERROR(NvErrorRopNotSupported, 0x00070001, "remove me later!")
+NVERROR(NvErrorSurfaceNotSupported, 0x00070002, "remove me later!")
+NVERROR(NvErrorBitmapNotSupported, 0x00070003, "remove me later!")
+
+/* NvPower error codes */
+NVERROR(NvErrorResourceAlreadyInUse, 0x00080000, "remove me later!")
+NVERROR(NvErrorResourceNotInUse, 0x00080001, "remove me later!")
+NVERROR(NvErrorResourceInUse, 0x00080002, "remove me later!")
+
+/* UART error codes */
+NVERROR(NvErrorUartOverrun, 0x00090000, "remove me later!")
+NVERROR(NvErrorUartFraming, 0x00090001, "remove me later!")
+NVERROR(NvErrorUartParity, 0x00090002, "remove me later!")
+NVERROR(NvErrorUartFifoError, 0x00090003, "remove me later!")
+NVERROR(NvErrorUartBreakReceived, 0x00090004, "remove me later!")
+NVERROR(NvErrorUartTransmit, 0x00090005, "remove me later!")
+
+/* NvRm error code */
+NVERROR(NvErrorRmInitFailed, 0x000a0000, "remove me later!")
+NVERROR(NvErrorRmChannelInitFailure, 0x000a0001, "remove me later!")
+NVERROR(NvErrorRmStreamInitFailure, 0x000a0002, "remove me later!")
+NVERROR(NvErrorRmSyncPointAllocFailure, 0x000a0003, "remove me later!")
+NVERROR(NvErrorRmStreamFlushFailure, 0x000a0004, "remove me later!")
+
+/* NvIsp error codes */
+NVERROR(NvErrorChannelAllocFailed, 0x000B0000, "remove me later!")
+NVERROR(NvErrorNoConnectedImager, 0x000B0001, "remove me later!")
+NVERROR(NvErrorUnsupportedResolution, 0x000B0002, "remove me later!")
+NVERROR(NvErrorI2CCommunicationError, 0x000B0003, "remove me later!")
+NVERROR(NvErrorIspConfigFileParseError, 0x000B0004, "remove me later!")
+NVERROR(NvErrorIspBusy, 0x000B0005, "remove me later!")
+NVERROR(NvErrorTooDark, 0x000B0006, "remove me later!")
+
+/* NvTest error codes */
+NVERROR(NvErrorTestApplicationFailed, 0x000c0000, "remove me later!")
+NVERROR(NvErrorTestNoUserInput, 0x000c0001, "remove me later!")
+NVERROR(NvErrorTestCommandLineError, 0x000c0002, "remove me later!")
+
+/* NvCam error codes */
+NVERROR(NvErrorVmAllocFailed, 0x000D0000, "remove me later!")
+NVERROR(NvErrorScriptAccessFailed, 0x000D0001, "remove me later!")
+NVERROR(NvErrorGettingComponentFailed, 0x000D0002, "remove me later!")
+NVERROR(NvErrorVmBufferAllocFailed, 0x000D0003, "remove me later!")
+NVERROR(NvErrorCameraScriptNotPresent, 0x000D0004, "remove me later!")
+NVERROR(NvErrorIllegalBayerValues, 0x000D0005, "remove me later!")
+NVERROR(NvErrorColorFormatNotSupported, 0x000D0006, "remove me later!")
+
+/* USBF error codes */
+NVERROR(NvErrorUsbfTxfrActive, 0x000E0000, "remove me later!")
+NVERROR(NvErrorUsbfTxfrComplete, 0x000E0001, "remove me later!")
+NVERROR(NvErrorUsbfEpStalled, 0x000E0002, "remove me later!")
+NVERROR(NvErrorUsbfEpError, 0x000E0003, "remove me later!")
+
+
diff --git a/Start_WM/test6/inc/nvime.h b/Start_WM/test6/inc/nvime.h
new file mode 100755
index 00000000..e533f47f
--- /dev/null
+++ b/Start_WM/test6/inc/nvime.h
@@ -0,0 +1,849 @@
+/*
+ * Copyright (c) 2006 - 2007 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software and related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an express
+ * license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/*
+ * nvime.h
+ *
+ * A collection of image enhancing functions that utilize the GoForce
+ * h/w. This file contains the common routines that are used by all
+ * image enhancing functions, as well as the APIs/enums/defines that are
+ * specific to all image enhancing functions.
+ *
+ * PLEASE NOTE: NvIme is not thread-safe. All API calls must be made in
+ * a single thread, or the application must explicitly protect each NvIme
+ * call with its own mutex. Any other usage is not guaranteed to work.
+ */
+
+#ifndef NVIME
+#define NVIME
+
+#include "nvtypes.h"
+#include "GFRm.h"
+#include "GFGx.h"
+#include "GFVx.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct NvImeStruct_t *NvImeHandle;
+
+typedef enum {
+ NVIME_OK=0,
+ NVIME_OUT_OF_MEMORY=1,
+ NVIME_INIT_FAILED=2,
+ NVIME_INVALID_HANDLE=3,
+ NVIME_SURFACE_INDEX_OUT_OF_RANGE=4,
+ NVIME_INVALID_SURFACE=5,
+ NVIME_ILLEGAL_SURFACE_BASE=6,
+ NVIME_ILLEGAL_SURFACE_STRIDE=7,
+ NVIME_INVALID_ROTATION=8,
+ NVIME_INVALID_COORD=9,
+ NVIME_MISSING_SURFACE=10,
+ NVIME_INVALID_KERNEL=11,
+ NVIME_INVALID_KERNEL_SIZE=12,
+ NVIME_INVALID_PIXFMT=13,
+ NVIME_INVALID_LUT=14,
+ NVIME_UNSPECIFIED_OPERATION=15,
+ NVIME_UNSUPPORTED_OPERATION=16,
+ NVIME_OPERATION_FAILED=17,
+ NVIME_INVALID_FLAG=18,
+ NVIME_INVALID_GET=19,
+ NVIME_INVALID_SCALE=20,
+ NVIME_INVALID_BIAS=21,
+ NVIME_ILLEGAL_CSC_VALUES=22,
+ NVIME_ILLEGAL_COEFF=23,
+ NVIME_ILLEGAL_COEFF_ARRAY_SIZE=24,
+} NvImeStatus;
+
+
+// NvImeOpen()
+//
+// Initialize the library and return a handle to pass into all future
+// API calls into this library.
+
+NvImeStatus NvImeOpen(GFRmHandle hRm, NvImeHandle *phIme);
+
+
+// NvImeClose()
+//
+// Close down the library and relinquish all held resources.
+
+void NvImeClose(NvImeHandle *phIme);
+
+
+// NvImeSetSourceSurface()
+//
+// Set a source surface. "index" can be in 0..NVIME_MAX_SOURCE_SURFACES-1.
+// Because each source surface will be read as a texture by the 3D unit,
+// each must abide by 3D's texture alignment restrictions. These
+// restrictions are:
+//
+// SB1) Base of surface must begin at an aligned memory address. Use
+// NvIme_GetIntegerv(NVIME__GET_SRC_SURF_ALIGNMENT_BYTES)
+// to get this value.
+//
+// SB2) Stride must be a multiple of
+// NvIme_GetIntegerv(NVIME__GET_SRC_SURF_STRIDE_BYTES)
+//
+// SB3) Stride must be a power of two
+//
+// SB4) Width must be between
+// NvIme_GetIntegerv(NVIME__GET_SRC_SURF_MIN_WIDTH_PIXELS) and
+// NvIme_GetIntegerv(NVIME__GET_SRC_SURF_MAX_WIDTH_PIXELS)
+//
+// SB5) Height must be between
+// NvIme_GetIntegerv(NVIME__GET_SRC_SURF_MIN_HEIGHT_PIXELS) and
+// NvIme_GetIntegerv(NVIME__GET_SRC_SURF_MAX_HEIGHT_PIXELS)
+//
+// Even though the 3D unit only understands textures that are powers of
+// two in width and height, the width and height of the data contained
+// within the source surfaces do NOT need to actually be a powers of two
+// in size. Likewise, the height of the surface does not need to be a
+// power of two (although the width always must be).
+//
+// If the width of the source data is not a power of two, then in addition
+// to the above texture alignment restrictions, the following must be true:
+//
+// SBW1) Memory between the end of the data in a row and the end of the
+// row must be allowed to be overwritten by this library. Because
+// the 3D texture unit does bilinear interpolation, this library
+// will need to replicate the last column of data out to the next
+// (M/2) columns over, where M is the width of the kernel used.
+// If width + (M/2) crosses over a power of two boundary, the
+// adjusted width need only be as large as the power of two
+// boundary.
+//
+// If the height of the source data is not a power of two, then in addition
+// to the above texture alignment restrictions, the following must be true:
+//
+// SBH1) The height of the source surface does *not* need to be a power
+// of two.
+//
+// SBH2) The height of the source surface needs to be large enough for the
+// library to replicate the last row to the next (N/2) rows down,
+// where N is the height of the kernel used. This area must be
+// allowed to be overwritten by this library. If height + (N/2)
+// crosses over a power of two boundary, the adjusted height need
+// only be as large as the power of two boundary.
+//
+// Note that some image enhancing operations will only work on certain
+// source pixel formats. The NvImeProcessRect() call will return an
+// error code on a source pixel format mismatch.
+
+#define NVIME_MAX_SOURCE_SURFACES 5
+NvImeStatus NvImeSetSourceSurface(NvImeHandle hIme,
+ NvU32 index,
+ GFRMSURFACE *sourceSurface);
+
+
+// NvImeSetDestSurface()
+//
+// Set the destination surface. Because the destination surface will be
+// written by the 3D unit, each surface must abide by 3D's surface
+// alignment restrictions. These restrictions are:
+//
+// DB1) Base of surface must begin at an aligned memory address. Use
+// NvIme_GetIntegerv(NVIME__GET_DST_SURF_ALIGNMENT_BYTES)
+// to get this value.
+//
+// DB2) Stride must be a multiple of
+// NvIme_GetIntegerv(NVIME__GET_DST_SURF_STRIDE_BYTES)
+//
+// DB3) Width must be between
+// NvIme_GetIntegerv(NVIME__GET_DST_SURF_MIN_WIDTH_PIXELS) and
+// NvIme_GetIntegerv(NVIME__GET_DST_SURF_MAX_WIDTH_PIXELS)
+//
+// DB4) Height must be between
+// NvIme_GetIntegerv(NVIME__GET_DST_SURF_MIN_HEIGHT_PIXELS) and
+// NvIme_GetIntegerv(NVIME__GET_DST_SURF_MAX_HEIGHT_PIXELS)
+//
+// "rotation" specifies how to rotate the source surfaces onto the
+// destination surface as part of the rendering process. "rotation"
+// must be one of GFGx's fast rotation modes. Specifically these are:
+//
+// +---+---+ +---+---+
+// GFGXEX2_FAST_ROTATE_IDENTITY | 0 | 1 | | 0 | 1 |
+// +---+---+ --> +---+---+
+// | 2 | 3 | | 2 | 3 |
+// +---+---+ +---+---+
+//
+// +---+---+ +---+---+
+// GFGXEX2_FAST_ROTATE_ROT_90 | 0 | 1 | | 1 | 3 |
+// +---+---+ --> +---+---+
+// | 2 | 3 | | 0 | 2 |
+// +---+---+ +---+---+
+//
+// +---+---+ +---+---+
+// GFGXEX2_FAST_ROTATE_ROT_180 | 0 | 1 | | 3 | 2 |
+// +---+---+ --> +---+---+
+// | 2 | 3 | | 1 | 0 |
+// +---+---+ +---+---+
+//
+// +---+---+ +---+---+
+// GFGXEX2_FAST_ROTATE_ROT_270 | 0 | 1 | | 2 | 0 |
+// +---+---+ --> +---+---+
+// | 2 | 3 | | 3 | 1 |
+// +---+---+ +---+---+
+//
+// +---+---+ +---+---+
+// GFGXEX2_FAST_ROTATE_FLIP_X | 0 | 1 | | 1 | 0 |
+// +---+---+ --> +---+---+
+// | 2 | 3 | | 3 | 2 |
+// +---+---+ +---+---+
+//
+// +---+---+ +---+---+
+// GFGXEX2_FAST_ROTATE_FLIP_Y | 0 | 1 | | 2 | 3 |
+// +---+---+ --> +---+---+
+// | 2 | 3 | | 0 | 1 |
+// +---+---+ +---+---+
+//
+// +---+---+ +---+---+
+// GFGXEX2_FAST_ROTATE_TRANS_LR | 0 | 1 | | 0 | 2 |
+// +---+---+ --> +---+---+
+// | 2 | 3 | | 1 | 3 |
+// +---+---+ +---+---+
+//
+// +---+---+ +---+---+
+// GFGXEX2_FAST_ROTATE_TRANS_RL | 0 | 1 | | 3 | 1 |
+// +---+---+ --> +---+---+
+// | 2 | 3 | | 2 | 0 |
+// +---+---+ +---+---+
+//
+// Note that some image enhancing operations will only work on certain
+// destination pixel formats. The NvImeProcessRect() call will return an
+// error code on a destination pixel format mismatch.
+
+NvImeStatus NvImeSetDestSurface(NvImeHandle hIme,
+ GFRMSURFACE *destSurface,
+ NvU32 rotation);
+
+
+// NvImeSetVxBltCSCCoeff()
+//
+// Set the Vx's color space conversion coefficients in the channel that
+// NvIme is using. This API is nothing more than a pass-through to
+// GFVxBltSetCSCCoeff(). However, it does need to be called if CSCCoeffs
+// are desired to be changed. If GFVxBltSetCSCCoeff() is called directly
+// by the application, the Vx issued commands in that channel will pick
+// up the CSCCoeffs, but NvIme will not see them.
+NvImeStatus NvImeSetVxBltCSCCoeff(NvImeHandle hIme,
+ GFVXCSCCOEF *pCoef,
+ NvU32 option);
+
+
+// NvImeProcessRect()
+//
+// Render using the current algorithm. Application must call an NvIme
+// API not contained within this header file that registers the algorithm
+// to render with.
+//
+// "srcCoords" points to "numSrcCoords" GFRECTs. "srcCoords[i]" describes
+// the region to use from the i'th sourceSurface. "dstCoord" points to a
+// single GFRECT. If a coord extends beyond the size of the surface it
+// refers to, it will be clamped to the surface boundaries.
+//
+// The range of pixels referred to in "dstCoord" and each "srcCoords[i]"
+// do not have to match. Scaling up and down is supported. The quality
+// of scaling up and down can vary with the particular image enhancing
+// algorithm used.
+//
+// flags is used to pass down optional parameters to the renderer.
+//
+// NVIME_PR_FLAGS_DITHER_OUTPUT: dither color output to destination
+// surface. This flag has no effect if destSurface->ColorFormat
+// is GF_SURFACE_ARGB8888.
+
+#define NVIME_PR_FLAGS_DITHER_OUTPUT (1<<0)
+
+NvImeStatus NvImeProcessRect(NvImeHandle hIme,
+ NvU32 numSrcCoords,
+ GFRECT *srcCoords,
+ GFRECT *dstCoord,
+ NvU32 flags);
+
+// NvImeFinish()
+//
+// A blocking call that does not return until all previously called
+// NvIme commands are complete.
+
+void NvImeFinish(NvImeHandle hIme);
+
+
+//
+// Kernel sizes
+//
+// When kernels are specified, they use row major order. For example a
+// 3x3 kernel with weights arranged like so:
+//
+// w00 w01 w02
+// w10 w11 w12
+// w20 w21 w22
+//
+// would be specified in memory in the following order:
+//
+// w00 w01 w02 w10 w11 w12 w20 w21 w22
+
+typedef enum {
+ NVIME_KERNEL_SIZE_1x1=0,
+ NVIME_KERNEL_SIZE_3x1=1,
+ NVIME_KERNEL_SIZE_5x1=2,
+} NvImeKernelSize;
+
+
+//
+// Pixel formats
+//
+
+#define NVIME_COMPONENT_MASK(a) \
+ (((1U << NVIME_PIXFMT_##a##_BITS) - 1) << NVIME_PIXFMT_##a##_SHIFT)
+
+#define NVIME_PIXFMT_L8_LUMINANCE_BITS 8
+#define NVIME_PIXFMT_L8_LUMINANCE_SHIFT 0
+#define NVIME_PIXFMT_L8_LUMINANCE_MASK NVIME_COMPONENT_MASK(L8_LUMINANCE)
+
+#define NVIME_PIXFMT_RGB565_BLUE_BITS 5
+#define NVIME_PIXFMT_RGB565_BLUE_SHIFT 0
+#define NVIME_PIXFMT_RGB565_BLUE_MASK NVIME_COMPONENT_MASK(RGB565_BLUE)
+#define NVIME_PIXFMT_RGB565_GREEN_BITS 6
+#define NVIME_PIXFMT_RGB565_GREEN_SHIFT 5
+#define NVIME_PIXFMT_RGB565_GREEN_MASK NVIME_COMPONENT_MASK(RGB565_GREEN)
+#define NVIME_PIXFMT_RGB565_RED_BITS 5
+#define NVIME_PIXFMT_RGB565_RED_SHIFT 11
+#define NVIME_PIXFMT_RGB565_RED_MASK NVIME_COMPONENT_MASK(RGB565_RED)
+
+#define NVIME_PIXFMT_RGB888_BLUE_BITS 8
+#define NVIME_PIXFMT_RGB888_BLUE_SHIFT 0
+#define NVIME_PIXFMT_RGB888_BLUE_MASK NVIME_COMPONENT_MASK(RGB888_BLUE)
+#define NVIME_PIXFMT_RGB888_GREEN_BITS 8
+#define NVIME_PIXFMT_RGB888_GREEN_SHIFT 8
+#define NVIME_PIXFMT_RGB888_GREEN_MASK NVIME_COMPONENT_MASK(RGB888_GREEN)
+#define NVIME_PIXFMT_RGB888_RED_BITS 8
+#define NVIME_PIXFMT_RGB888_RED_SHIFT 16
+#define NVIME_PIXFMT_RGB888_RED_MASK NVIME_COMPONENT_MASK(RGB888_RED)
+
+#define NVIME_PIXFMT_ARGB8888_BLUE_BITS 8
+#define NVIME_PIXFMT_ARGB8888_BLUE_SHIFT 0
+#define NVIME_PIXFMT_ARGB8888_BLUE_MASK NVIME_COMPONENT_MASK(ARGB8888_BLUE)
+#define NVIME_PIXFMT_ARGB8888_GREEN_BITS 8
+#define NVIME_PIXFMT_ARGB8888_GREEN_SHIFT 8
+#define NVIME_PIXFMT_ARGB8888_GREEN_MASK NVIME_COMPONENT_MASK(ARGB8888_GREEN)
+#define NVIME_PIXFMT_ARGB8888_RED_BITS 8
+#define NVIME_PIXFMT_ARGB8888_RED_SHIFT 16
+#define NVIME_PIXFMT_ARGB8888_RED_MASK NVIME_COMPONENT_MASK(ARGB8888_RED)
+#define NVIME_PIXFMT_ARGB8888_ALPHA_SHIFT 24
+#define NVIME_PIXFMT_ARGB8888_ALPHA_MASK NVIME_COMPONENT_MASK(ARGB8888_ALPHA)
+
+#define NVIME_PIXFMT_BAYER10_BITS 10
+#define NVIME_PIXFMT_BAYER10_SHIFT 0
+#define NVIME_PIXFMT_BAYER10_MASK NVIME_COMPONENT_MASK(BAYER10)
+
+#define NVIME_PIXFMT_BAYER12_BITS 12
+#define NVIME_PIXFMT_BAYER12_SHIFT 0
+#define NVIME_PIXFMT_BAYER12_MASK NVIME_COMPONENT_MASK(BAYER12)
+
+#define NVIME_PIXFMT_BAYER14_BITS 14
+#define NVIME_PIXFMT_BAYER14_SHIFT 0
+#define NVIME_PIXFMT_BAYER14_MASK NVIME_COMPONENT_MASK(BAYER14)
+
+#define NVIME_PIXFMT_BAYER3D_LO_BITS 7
+#define NVIME_PIXFMT_BAYER3D_LO_SHIFT 0
+#define NVIME_PIXFMT_BAYER3D_LO_MASK NVIME_COMPONENT_MASK(BAYER3D_LO)
+#define NVIME_PIXFMT_BAYER3D_HI_BITS 7
+#define NVIME_PIXFMT_BAYER3D_HI_SHIFT 8
+#define NVIME_PIXFMT_BAYER3D_HI_MASK NVIME_COMPONENT_MASK(BAYER3D_HI)
+
+typedef enum {
+ NVIME_PIXFMT_L8=0, // L=Luminance (R8=L8, G8=L8, B8=L8)
+ NVIME_PIXFMT_RGB565=1,
+ NVIME_PIXFMT_RGB888=2,
+ NVIME_PIXFMT_ARGB8888=3,
+ NVIME_PIXFMT_BAYER10=4,
+ NVIME_PIXFMT_BAYER12=5,
+ NVIME_PIXFMT_BAYER14=6,
+ NVIME_PIXFMT_BAYER3D=7,
+} NvImePixelFormat;
+
+
+//
+// LUT values
+//
+
+#define NVIME_LUT_ENTRIES 256
+
+
+//
+// Scale factors
+//
+
+typedef enum {
+ NVIME_SCALE_1_0=0,
+ NVIME_SCALE_2_0=1,
+ NVIME_SCALE_4_0=2,
+} NvImeScaleFactor;
+
+
+/*
+ * Below are APIs used to control the sharpening image enhancement
+ * operation. Sharpening takes in a YUV420p source surface and outputs
+ * to a destination surface of type RGB565, ARGB8888 or YUV420p.
+ * ====================================================================
+ */
+
+// NvImeSharpenGetIntegerv()
+//
+// Return the value or values of a selected parameter that apply to
+// the YUV420p sharpen image enhancing operation.
+//
+// NVIME_SHARPEN_GET_SRC_SURF_ALIGNMENT_BYTES
+// NVIME_SHARPEN_GET_DST_SURF_ALIGNMENT_BYTES
+//
+// "params" returns 1 value, the SOURCE/DEST surface's starting
+// address must be aligned to this value.
+//
+// NVIME_SHARPEN_GET_SRC_SURF_STRIDE_BYTES
+// NVIME_SHARPEN_GET_DST_SURF_STRIDE_BYTES
+//
+// "params" returns 1 value, the SOURCE/DEST surface's stride must
+// be a multiple of this value.
+//
+// NVIME_SHARPEN_GET_SRC_SURF_MIN_WIDTH_PIXELS
+// NVIME_SHARPEN_GET_DST_SURF_MIN_WIDTH_PIXELS
+//
+// "params" returns 1 value, the SOURCE/DEST surface's width in
+// pixels must be greater than or equal to this value.
+//
+// NVIME_SHARPEN_GET_SRC_SURF_MAX_WIDTH_PIXELS
+// NVIME_SHARPEN_GET_DST_SURF_MAX_WIDTH_PIXELS
+//
+// "params" returns 1 value, the SOURCE/DEST surface's width in
+// pixels must be less than or equal to this value.
+//
+// NVIME_SHARPEN_GET_SRC_SURF_MIN_HEIGHT_PIXELS
+// NVIME_SHARPEN_GET_DST_SURF_MIN_HEIGHT_PIXELS
+//
+// "params" returns 1 value, the SOURCE/DEST surface's height in
+// pixels must be greater than or equal to this value.
+//
+// NVIME_SHARPEN_GET_SRC_SURF_MAX_HEIGHT_PIXELS
+// NVIME_SHARPEN_GET_DST_SURF_MAX_HEIGHT_PIXELS
+//
+// "params" returns 1 value, the SOURCE/DEST surface's height in
+// pixels must be less than or equal to this value.
+
+typedef enum {
+ NVIME_SHARPEN_GET_SRC_SURF_ALIGNMENT_BYTES=0,
+ NVIME_SHARPEN_GET_SRC_SURF_STRIDE_BYTES=1,
+ NVIME_SHARPEN_GET_SRC_SURF_MIN_WIDTH_PIXELS=2,
+ NVIME_SHARPEN_GET_SRC_SURF_MAX_WIDTH_PIXELS=3,
+ NVIME_SHARPEN_GET_SRC_SURF_MIN_HEIGHT_PIXELS=4,
+ NVIME_SHARPEN_GET_SRC_SURF_MAX_HEIGHT_PIXELS=5,
+ NVIME_SHARPEN_GET_DST_SURF_ALIGNMENT_BYTES=6,
+ NVIME_SHARPEN_GET_DST_SURF_STRIDE_BYTES=7,
+ NVIME_SHARPEN_GET_DST_SURF_MIN_WIDTH_PIXELS=8,
+ NVIME_SHARPEN_GET_DST_SURF_MAX_WIDTH_PIXELS=9,
+ NVIME_SHARPEN_GET_DST_SURF_MIN_HEIGHT_PIXELS=10,
+ NVIME_SHARPEN_GET_DST_SURF_MAX_HEIGHT_PIXELS=11,
+} NvImeSharpenGet;
+
+NvImeStatus NvImeSharpenGetIntegerv(NvImeHandle hIme,
+ NvImeSharpenGet name,
+ int *params);
+
+
+// NvImeSharpenParams()
+//
+// Specify sharpen parameters to use during subsequent call to
+// NvImeProcessRect().
+//
+// When NvImeProcessRect() is called with sharpening in effect, there
+// are additional restrictions are applied:
+//
+// 1) Only sourceSurfaces[0] is used. Which means that numSrcCoords
+// must be 1. Stretching sub-regions of a surface is not
+// supported. Because pixels will be replicated as needed to
+// provide a buffer for the filter kernel, if one were to use
+// a sub-region of a surface, valid data would be over-written.
+// dstCoord can have arbitrary values that allow scaling within
+// destSurface.
+//
+// 2) sourceSurfaces[0]->ColorFormat must be one of:
+//
+// GF_SURFACE_YUV420
+// GF_SURFACE_JPEGDEC
+// GF_SURFACE_MPEGDEC
+//
+// 3) destSurface->ColorFormat must be one of:
+//
+// GF_SURFACE_RGB565
+// GF_SURFACE_ARGB8888
+// GF_SURFACE_YUV420
+// GF_SURFACE_JPEGDEC
+// GF_SURFACE_MPEGDEC
+//
+// 4) The rotation value must be GFGXEX2_FAST_ROTATE_IDENTITY (any
+// desired rotation must be performed after this library has
+// finished its processing).
+//
+// The sharpening algorithm is described as follows:
+//
+// 1) The Y data in sourceSurfaces[0] is replicated as needed. The
+// number of pixels replicated at the end of each row will be:
+//
+// MAX( (M/2), distance to next power-of-two )
+//
+// where M is the width of the kernel. Note that if
+// sourceSurfaces[0]'s width is a power-of-two, then the distance
+// to the next power-of-two will be zero, and no pixels will be
+// replicated.
+//
+// The number of pixels replicated at the bottom of each column
+// will be:
+//
+// MAX( (N/2), distance to next power-of-two )
+//
+// where N is the height of the kernel. Note that if
+// sourceSurfaces[0]'s height is a power-of-two, then the distance
+// to the next power-of-two will be zero, and no pixels will be
+// replicated.
+//
+// 2) If destSurface->ColorFormat is GF_SURFACE_RGB565 or
+// GF_SURFACE_ARGB8888, then a 2D StretchBlit is performed on
+// sourceSurfaces[0] to destSurface. The full range of
+// sourceSurfaces[0] will be scaled to the region indicated by
+// dstCoord within destSurface.
+//
+// If destSurface->ColorFormat is GF_SURFACE_YUV420,
+// GF_SURFACE_JPEGDEC or GF_SURFACE_MPEGDEC then no StretchBlit
+// will be performed. The 3D stage of the algorithm will write
+// the destination directly without blending to an RGB surface.
+//
+// 3) For each pixel in the region within destSurface specified by
+// dstCoord, the 3D unit will perform a number of texture reads from
+// sourceSurfaces[0] that matches the size of the kernel. Each
+// texture read will be bilinearly filtered. The texture reads will
+// be multiplied times the S1.8 kernel weights, summed together,
+// scaled by one of 1.0, 2.0 or 4.0, a bias is added, and the result
+// is clamped to the 0.0 to 1.0 range (note that intermediate values
+// that exceed the h/w's S1.8 numeric range will be clamped to S1.8).
+// The final clamped value will index into the provided LUT, which
+// contains biased color values.
+//
+// When destSurface->ColorFormat is GF_SURFACE_RGB565 or ARGB8888:
+//
+// Each color channel from the LUT value will be multiplied by
+// 2.0 and then have 1.0 subtracted from it. These unbiased
+// colors will be added to the pixel in destSurface.
+//
+// When destSurface->ColorFormat is GF_SURFACE_YUV420,
+// GF_SURFACE_JPEGDEC or GF_SURFACE_MPEGDEC:
+//
+// The red color channel from the LUT value will be multiplied
+// by 2.0 and then have 1.0 subtracted from it. This unbiased
+// color will be added to the Y value from sourceSurfaces[0]
+// and be written to the Y pixel in destSurface. The U and V
+// pixels in destSurface will be scaled by the 3D h/w using a
+// 2x2 filter. No sharpening is applied to the U and V pixels.
+//
+// Below is a psuedo-code approximation for this part of the algorithm:
+//
+// // for each pixel
+// for ( y=dstCoord->top ; x<=dstCoord->bottom ; y++ ) {
+// for ( x=dstCoord->left ; x<=dstCoord->right ; x++ ) {
+//
+// // get proper indices for sourceSurfaces[0]
+// srcX = sourcesSurfaces[0].width * x/destSurface.width;
+// srcY = sourcesSurfaces[0].height * y/destSurface.height;
+//
+// // for each kernel entry
+// idx = 0;
+// for ( ky=0 ; ky 1.0) idx = 1.0;
+//
+// if ((destSurface->ColorFormat == GF_SURFACE_YUV420) ||
+// (destSurface->ColorFormat == GF_SURFACE_JPEGDEC) ||
+// (destSurface->ColorFormat == GF_SURFACE_MPEGDEC)) {
+// // write the color value
+// dstColor[x,y] = srcColor[srcX, srcY] +
+// 2.0 * lut[NVIME_LUT_ENTRIES * idx] - 1.0;
+// } else {
+// // update color value
+// dstColor[x,y] += 2.0 * lut[NVIME_LUT_ENTRIES * idx] - 1.0;
+// }
+// }
+// }
+//
+// The supported kernel sizes are:
+//
+// NVIME_KERNEL_SIZE_1x1
+// NVIME_KERNEL_SIZE_3x1
+// NVIME_KERNEL_SIZE_5x1
+//
+// Each value in the kernel must be in S1.8 format, which means values
+// between -2 inclusive and +2 exclusive in increments of 1/256 are
+// representable.
+//
+// The LUT must contain NVIME_LUT_ENTRIES entries, each of size NvU32.
+// The supported LUT formats are:
+//
+// NVIME_PIXFMT_L8
+// NVIME_PIXFMT_RGB888
+//
+// Refer to the NVIME_PIXFMT_* macros for appropriate color channel bit
+// positions. When destSurface->ColorFormat is GF_SURFACE_YUV420,
+// GF_SURFACE_JPEGDEC or GF_SURFACE_MPEGDEC the Y buffer is processed
+// directly without going through an RGB space. Because the Y buffer is
+// monochrome, only the red channel of an RGB888 LUT will be used when
+// the destSurface->ColorFormat is GF_SURFACE_YUV420, GF_SURFACE_JPEGDEC
+// or GF_SURFACE_MPEGDEC.
+//
+// The finalScale parameter can be any of NVIME_SCALE_1_0, NVIME_SCALE_2_0,
+// or NVIME_SCALE_4_0.
+//
+// The finalBias parameter must be in S1.8 format.
+
+NvImeStatus
+NvImeSharpenParams(NvImeHandle hIme,
+ NvImeKernelSize kernelSize,
+ NvU32 *kernel,
+ NvImePixelFormat lutFormat,
+ NvU32 *lut,
+ NvImeScaleFactor finalScale,
+ NvU32 finalBias);
+
+
+/*
+ * Below are APIs used to control the anti-vignetting (also known as
+ * lens correction) image enhancement operation. Anti-vignetting takes
+ * in a BAYER3D source surface and outputs either BAYER10, BAYER12 or
+ * BAYER14 data to the same source surface. BAYER3D is format that has
+ * 14bits of data like BAYER14, but has unused bits at positions 8 and 16.
+ * So if your 16bits of data looked like --dcba9876543210, these would
+ * be stored in BAYER3D as -dcba987-6543210.
+ * ====================================================================
+ */
+
+// NvImeAntivigGetIntegerv()
+//
+// Return the value or values of a selected parameter that apply to
+// the BAYER3D anti-vignetting image operation.
+//
+// NVIME_ANTIVIG_GET_SURF_ALIGNMENT_BYTES
+//
+// "params" returns 1 value, the SOURCE/DEST surface's starting
+// address must be aligned to this value.
+//
+// NVIME_ANTIVIG_GET_SURF_STRIDE_BYTES
+//
+// "params" returns 1 value, the SOURCE/DEST surface's stride must
+// be a multiple of this value.
+//
+// NVIME_ANTIVIG_GET_SURF_MIN_WIDTH_PIXELS
+//
+// "params" returns 1 value, the SOURCE/DEST surface's width in
+// pixels must be greater than or equal to this value.
+//
+// NVIME_ANTIVIG_GET_SURF_MAX_WIDTH_PIXELS
+//
+// "params" returns 1 value, the SOURCE/DEST surface's width in
+// pixels must be less than or equal to this value.
+//
+// NVIME_ANTIVIG_GET_SURF_MIN_HEIGHT_PIXELS
+//
+// "params" returns 1 value, the SOURCE/DEST surface's height in
+// pixels must be greater than or equal to this value.
+//
+// NVIME_ANTIVIG_GET_SURF_MAX_HEIGHT_PIXELS
+//
+// "params" returns 1 value, the SOURCE/DEST surface's height in
+// pixels must be less than or equal to this value.
+//
+// NVIME_ANTIVIG_GET_COEFF_ARRAY_MIN_WIDTH
+//
+// "params" returns 1 value, the minimum "widthCoeffArrays" that
+// can be passed into NvImeAntivigParams.
+//
+// NVIME_ANTIVIG_GET_COEFF_ARRAY_MAX_WIDTH
+//
+// "params" returns 1 value, the maximum "widthCoeffArrays" that
+// can be passed into NvImeAntivigParams.
+//
+// NVIME_ANTIVIG_GET_COEFF_ARRAY_MIN_HEIGHT
+//
+// "params" returns 1 value, the minimum "heightCoeffArrays" that
+// can be passed into NvImeAntivigParams.
+//
+// NVIME_ANTIVIG_GET_COEFF_ARRAY_MAX_HEIGHT
+//
+// "params" returns 1 value, the maximum "heightCoeffArrays" that
+// can be passed into NvImeAntivigParams.
+
+typedef enum {
+ NVIME_ANTIVIG_GET_SURF_ALIGNMENT_BYTES=0,
+ NVIME_ANTIVIG_GET_SURF_STRIDE_BYTES=1,
+ NVIME_ANTIVIG_GET_SURF_MIN_WIDTH_PIXELS=2,
+ NVIME_ANTIVIG_GET_SURF_MAX_WIDTH_PIXELS=3,
+ NVIME_ANTIVIG_GET_SURF_MIN_HEIGHT_PIXELS=4,
+ NVIME_ANTIVIG_GET_SURF_MAX_HEIGHT_PIXELS=5,
+ NVIME_ANTIVIG_GET_COEFF_ARRAY_MIN_WIDTH=6,
+ NVIME_ANTIVIG_GET_COEFF_ARRAY_MAX_WIDTH=7,
+ NVIME_ANTIVIG_GET_COEFF_ARRAY_MIN_HEIGHT=8,
+ NVIME_ANTIVIG_GET_COEFF_ARRAY_MAX_HEIGHT=9,
+} NvImeAntivigGet;
+
+NvImeStatus NvImeAntivigGetIntegerv(NvImeHandle hIme,
+ NvImeAntivigGet name,
+ int *params);
+
+
+// NvImeAntivigParams()
+//
+// Specify anti-vignetting parameters to use during subsequent call to
+// NvImeProcessRect().
+//
+// When NvImeProcessRect() is called with anti-vignetting in effect,
+// there are additional restrictions that are applied:
+//
+// 1) Only sourceSurfaces[0] is used. Which means that numSrcCoords
+// must be 1.
+//
+// 2) sourceSurfaces[0]->ColorFormat must be GF_SURFACE_BAYER16.
+// The actual data contained in the surface must be in the
+// BAYER3D format. BAYER3D has 14 bits of data, where bits 13
+// and 7 are ignored. So if your data value is --dcba9876543210,
+// that would be stored in BAYER3D format as -dcba987-6543210.
+//
+// 3) The contents of the structure pointed to by destSurface must
+// be equal to the contents of the structure pointed to by
+// sourceSurfaces[0].
+//
+// 4) The contents of the structure pointed to by dstCoord must be
+// equal to the contents of the structure pointed to by
+// srcCoords[0].
+//
+// 5) The rotation value must be GFGXEX2_FAST_ROTATE_IDENTITY (any
+// desired rotation must be performed after this library has
+// finished its processing).
+//
+// The anti-vignetting algorithm is described below:
+//
+// 1) The 4 passed in coefficient arrays are scanned looking for the
+// largest gain value. The largest gain is used to determine
+// whether the overall coefficient range is in [0.0 .. 2.0],
+// [0.0 .. 4.0], [0.0 .. 8.0] or [0.0 .. 16.0]. The lower the
+// maximum gain, the more precise the output will be. Here is
+// a table showing the output format as a function of the maximum
+// gain value:
+//
+// Maximum gain Output pixel format
+// ------------- -------------------
+// [0.0 .. 2.0] BAYER14
+// [0.0 .. 4.0] BAYER12
+// [0.0 .. 8.0] BAYER12
+// [0.0 .. 16.0] BAYER10
+//
+// 2) After the maximum gain has been determined, the coefficient
+// arrays are divided by their maximum value rounded up to a power
+// of 2, and stored in an 8bit value.
+//
+// 3) When NvImeProcessRect is called, the 8bit gain values for the
+// appropriate 00, 01, 10, 11 pixel are bilinearly interpolated.
+// The result is multiplied times the BAYER3D pixel value from
+// the source surface and then written back in place in a
+// BAYER10/12/14 format.
+//
+// 4) NvImeProcessRect can process an entire BAYER3D buffer at a time,
+// or a horizontal swath of the buffer. This is to support large
+// buffers (like 5Mpixel) where it may not be practical (or even
+// possible) to have multiple buffers residing in memory at the same
+// time.
+//
+// NvImeAntivigAdjustScanline() modifies the access pattern of the
+// 8bit gain values as if srcCoords[0].top were scanlineBias larger.
+// This shifts the accesses down.
+//
+// For example, suppose you had a 2048x64 BAYER3D surface which is
+// used to hold 32 pixel high swaths of a 2048x2048 surface in
+// a double buffered manner. You would process the buffer like so:
+//
+// srcCoordsLow.top = 0;
+// srcCoordsLow.left = 0;
+// srcCoordsLow.right = 2047;
+// srcCoordsLow.bottom = 31;
+//
+// srcCoordsHigh.top = 32;
+// srcCoordsHigh.left = 0;
+// srcCoordsHigh.right = 2047;
+// srcCoordsHigh.bottom = 63;
+//
+// // Fill SourceSurface[0] rows [0..31] with camera rows [0..31]
+// NvImeAntivigAdjustScanline(hIme, 0);
+// NvImeProcessRects(hIme, 1, &srcCoordsLow, &srcCoordsLow, 0);
+//
+// // Fill SourceSurface[0] rows [32..63] with camera rows [32..63]
+// NvImeProcessRects(hIme, 1, &srcCoordsHigh, &srcCoordsHigh, 0);
+//
+// // Fill SourceSurface[0] rows [0..31] with camera rows [64..95]
+// NvImeAntivigAdjustScanline(hIme, 32);
+// NvImeProcessRects(hIme, 1, &srcCoordsLow, &srcCoordsLow, 0);
+//
+// // Fill SourceSurface[0] rows [32..63] with camera rows [96..127]
+// NvImeProcessRects(hIme, 1, &srcCoordsHigh, &srcCoordsHigh, 0);
+//
+// // Fill SourceSurface[0] rows [0..31] with camera rows [128..159]
+// NvImeAntivigAdjustScanline(hIme, 64);
+// NvImeProcessRects(hIme, 1, &srcCoordsLow, &srcCoordsLow, 0);
+//
+// // Fill SourceSurface[0] rows [32..63] with camera rows [160..191]
+// NvImeProcessRects(hIme, 1, &srcCoordsHigh, &srcCoordsHigh, 0);
+//
+// // and so on...
+
+NvImeStatus
+NvImeAntivigParams(NvImeHandle hIme,
+ NvU32 widthCoeffArrays,
+ NvU32 heightCoeffArrays,
+ float *coeffsPix00,
+ float *coeffsPix01,
+ float *coeffsPix10,
+ float *coeffsPix11,
+ NvU32 totalSurfaceWidth,
+ NvU32 totalSurfaceHeight,
+ NvImePixelFormat *outFormat);
+
+NvImeStatus
+NvImeAntivigAdjustScanline(NvImeHandle hIme, NvU32 scanlineBias);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* NVIME */
diff --git a/Start_WM/test6/inc/nvirq.h b/Start_WM/test6/inc/nvirq.h
new file mode 100755
index 00000000..d3bf5d8b
--- /dev/null
+++ b/Start_WM/test6/inc/nvirq.h
@@ -0,0 +1,144 @@
+/*
+ * Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an express
+ * license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+#ifndef NVIRQ_H
+#define NVIRQ_H
+
+/** NvIrq - Interrupt abstraction layer:
+
+ This provides a simple interface for querying and masking abstract interrupt
+ events. The interface is designed to be used inside of the OEM's ISR or IST.
+
+ NvIrq needs NvOsPhysicalMemMap and NvOsPhysicalMemUnmap (Only uncached
+ write-through functionality is used). NvOsSharedMem* is needed if NvIrq
+ isn't initialized as a singleton.
+
+ NvIrq is not thread-safe.
+ */
+
+#include "nvcommon.h"
+#include "nverror.h"
+#include "nvboard.h"
+
+/** NvIrqChannel enum defines available I/O channels. No two I/O operations can
+ safely occur at the same time on a channel. (This is only important in
+ indirect addressing. In direct address I/O operators are atomic and there
+ is no concept of channels).
+ */
+typedef enum
+{
+ /* Channel used while not in ISR. This channel is used by all user-mode code. */
+ NvIrqChannel_Normal,
+
+ /* Channel used in ISR context */
+ NvIrqChannel_Isr
+} NvIrqChannel;
+
+/* NvIrqInterruptPortInfo struct describes the MMIO layout of the interrupt
+ status registers */
+typedef struct NvIrqInterruptPortInfo_t
+{
+ /* Offset of status register */
+ NvU32 statusOffset;
+
+ /* Offset of mask register */
+ NvU32 maskOffset;
+} NvIrqInterruptPortInfo;
+
+/** NvIrqInit - Method to initialize the NvIrq API.
+
+ This method is to be called before any other NvIrq methods can be used.
+
+ If NvIrq is not initialized as a singleton, NvIrq will put its state in
+ shared memory.
+ */
+NvError
+NvIrqInit( const NvBoardMode *pMode, const NvBoardApertures *pApertures,
+ NvBool singleton );
+
+/** NvIrqDeInit - Method to deinitialize the NvIrq API.
+ */
+void
+NvIrqDeInit( void );
+
+/** NvIrqPostChipInit - To be called after the chip is intialized.
+
+ This method should be called during NvBoardPostChipInit. If NvIrqInit succeeds
+ NvIrqEnableInterrupt() should be used to unmask the global interrupt line.
+ */
+NvError
+NvIrqPostChipInit( NvIrqChannel channel );
+
+/** NvIrqPreChipDeInit - To be called before chip is shutdown.
+
+ This method should be called during NvBoardPreChipDeInit. NvIrqDisableInterrupt()
+ should be called before invoking this method.
+ */
+void
+NvIrqPreChipDeInit( NvIrqChannel channel );
+
+/** NvIrqFastScan - Method to quickly check if interrupt is pending
+
+ This method is faster than NvIrqScanForEvent. It only checks whether an
+ interrupt is pending or not. NvIrqScanForEvent should be called from an
+ IST to do the actual decoding. This is useful when ISR latency is
+ important.
+
+ If an interrupt is pending the global SCxx interrupt line is masked
+ and should reenabled using NvIrqEnableInterrupt after NvIrqScanForEvent
+ is called.
+ */
+NvBool
+NvIrqFastScan( NvIrqChannel channel );
+
+/** NvIrqScanForEvent - Method to check SCxx for pending events.
+
+ This method should be called from an ISR or IST. If a pending event is
+ found, the event is masked. Once an upper layer clears the source of
+ the event in hardware, the event can be reenabled.
+
+ @retval NvSuccess - on success
+ NvErrorEventNotFound - no event found
+ */
+NvError
+NvIrqScanForEvent( NvIrqChannel channel, NvDeviceEvent *event );
+
+/** NvIrqIsEventPending - Check whether the event is pending
+ */
+NvBool
+NvIrqIsEventPending( NvIrqChannel channel, NvDeviceEvent event );
+
+/** NvIrqEnableInterrupt - Method to unmask global interrupt line
+ */
+void
+NvIrqEnableInterrupt( NvIrqChannel channel );
+
+/** NvIrqDisableInterrupt - Method to mask global interrupt line
+ */
+void
+NvIrqDisableInterrupt( NvIrqChannel channel );
+
+/** NvIrqEnableEvent - Method to unmask an event
+ */
+void
+NvIrqEnableEvent( NvIrqChannel channel, NvDeviceEvent event );
+
+/** NvIrqDisableEvent - Method to mask an event
+ */
+void
+NvIrqDisableEvent( NvIrqChannel channel, NvDeviceEvent event );
+
+/** NvIrqQueryInterruptPortInfo - Method to query interrupt port info. Calling
+ this method should be strongly avoided.
+ */
+NvError
+NvIrqQueryInterruptPortInfo( NvIrqInterruptPortInfo *pPortInfo );
+
+#endif // NVIRQ_H
diff --git a/Start_WM/test6/inc/nvtypes.h b/Start_WM/test6/inc/nvtypes.h
new file mode 100755
index 00000000..ba01db2d
--- /dev/null
+++ b/Start_WM/test6/inc/nvtypes.h
@@ -0,0 +1,258 @@
+ /***************************************************************************\
+|* *|
+|* Copyright 1993-1998 NVIDIA, Corporation. All rights reserved. *|
+|* *|
+|* NOTICE TO USER: The source code is copyrighted under U.S. and *|
+|* international laws. Users and possessors of this source code are *|
+|* hereby granted a nonexclusive, royalty-free copyright license to *|
+|* use this code in individual and commercial software. *|
+|* *|
+|* Any use of this source code must include, in the user documenta- *|
+|* tion and internal comments to the code, notices to the end user *|
+|* as follows: *|
+|* *|
+|* Copyright 1993-1998 NVIDIA, Corporation. All rights reserved. *|
+|* *|
+|* NVIDIA, CORPORATION MAKES NO REPRESENTATION ABOUT THE SUITABILITY *|
+|* OF THIS SOURCE CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" *|
+|* WITHOUT EXPRESS OR IMPLIED WARRANTY OF ANY KIND. NVIDIA, CORPOR- *|
+|* ATION DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOURCE CODE, *|
+|* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGE- *|
+|* MENT, AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL *|
+|* NVIDIA, CORPORATION BE LIABLE FOR ANY SPECIAL, INDIRECT, INCI- *|
+|* DENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RE- *|
+|* SULTING 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 SOURCE CODE. *|
+|* *|
+|* U.S. Government End Users. This source code is a "commercial *|
+|* item," as that term is defined at 48 C.F.R. 2.101 (OCT 1995), *|
+|* consisting of "commercial computer software" and "commercial *|
+|* computer software documentation," as such terms are used in *|
+|* 48 C.F.R. 12.212 (SEPT 1995) and is provided to the U.S. Govern- *|
+|* ment only as a commercial end item. Consistent with 48 C.F.R. *|
+|* 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (JUNE 1995), *|
+|* all U.S. Government End Users acquire the source code with only *|
+|* those rights set forth herein. *|
+|* *|
+ \***************************************************************************/
+
+
+ /***************************************************************************\
+|* *|
+|* NV Architecture Interface *|
+|* *|
+|* defines common widths used to access hardware in of NVIDIA's *|
+|* Unified Media Architecture (TM). *|
+|* *|
+ \***************************************************************************/
+
+
+#ifndef NVTYPES_INCLUDED
+#define NVTYPES_INCLUDED
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "cpuopsys.h"
+
+#define NVRM_64 1
+#if defined(NV_64_BITS)
+#define NVRM_TRUE64 1
+#endif
+
+ /***************************************************************************\
+|* Typedefs *|
+ \***************************************************************************/
+
+typedef unsigned char NvV8; /* "void": enumerated or multiple fields */
+typedef unsigned short NvV16; /* "void": enumerated or multiple fields */
+typedef unsigned char NvU8; /* 0 to 255 */
+typedef unsigned short NvU16; /* 0 to 65535 */
+typedef signed char NvS8; /* -128 to 127 */
+typedef signed short NvS16; /* -32768 to 32767 */
+typedef signed int NvS32; /* -2147483648 to 2147483647 */
+typedef float NvF32; /* IEEE Single Precision (S1E8M23) */
+typedef double NvF64; /* IEEE Double Precision (S1E11M52) */
+
+/* mainly for 64-bit linux, where long is 64 bits
+ * and win9x, where int is 16 bit.
+ */
+#if (defined(NV_UNIX) || defined(vxworks) || defined(NV_WINDOWS_CE) || \
+ defined(__arm) || defined(__IAR_SYSTEMS_ICC__) || defined(NV_QNX) || \
+ defined(NV_INTEGRITY) || defined(NV_MODS) || defined(__GNUC__) ) && \
+ !defined(NV_MACINTOSH)
+typedef unsigned int NvV32; /* "void": enumerated or multiple fields */
+typedef unsigned int NvU32; /* 0 to 4294967295 */
+#else
+typedef unsigned long NvV32; /* "void": enumerated or multiple fields */
+typedef unsigned long NvU32; /* 0 to 4294967295 */
+#endif
+
+/* 64-bit types for compilers that support them, plus some obsolete variants */
+#if defined(__GNUC__) || defined(__arm) || defined(__IAR_SYSTEMS_ICC__) || defined(__ghs__) || defined(_WIN64)
+typedef unsigned long long NvU64; /* 0 to 18446744073709551615 */
+typedef long long NvS64; /* 2^-63 to 2^63-1 */
+#else
+typedef unsigned __int64 NvU64; /* 0 to 18446744073709551615 */
+typedef __int64 NvS64; /* 2^-63 to 2^63-1 */
+#endif
+
+/* Boolean type */
+enum { NV_FALSE = 0, NV_TRUE = 1 };
+typedef NvU8 NvBool;
+
+/* Macros to extract the low and high parts of a 64-bit unsigned integer */
+/* Also designed to work if someone happens to pass in a 32-bit integer */
+#define NvU64_HI32(n) ((NvU32)(((NvU64)(n)) >> 32))
+#define NvU64_LO32(n) ((NvU32)((NvU64)(n)))
+#define NvU40_HI32(n) ((NvU32)((((NvU64)(n))>>8)&0xffffffff))
+#define NvU40_HI24of32(n) ((NvU32)((((NvU64)(n)& 0xffffffff))&0xffffff00))
+
+ /***************************************************************************\
+|* *|
+|* 64 bit type definitions for use in interface structures. *|
+|* *|
+ \***************************************************************************/
+
+#if defined(NV_64_BITS)
+
+typedef void* NvP64; /* 64 bit void pointer */
+typedef NvU64 NvUPtr; /* pointer sized unsigned int */
+
+#define NvP64_VALUE(n) (n)
+
+#else
+
+typedef NvU64 NvP64; /* 64 bit void pointer */
+typedef NvU32 NvUPtr; /* pointer sized unsigned int */
+
+#define NvP64_VALUE(n) ((void *)(NvUPtr)(n))
+
+#endif
+
+// XXX Obsolete -- get rid of me...
+typedef NvP64 NvP64_VALUE_T;
+typedef NvUPtr NV_UINTPTR_T;
+#define NvP64_LVALUE(n) (n)
+#define NvP64_SELECTOR(n) (0)
+
+/* Useful macro to hide required double cast */
+#define NV_PTR_TO_NvP64(n) (NvP64)(NV_UINTPTR_T)(n)
+
+/* obsolete stuff */
+/* MODS needs to be able to build without these definitions because they collide
+ with some definitions used in mdiag. */
+#ifndef DONT_DEFINE_U032
+typedef NvV8 V008;
+typedef NvV16 V016;
+typedef NvV32 V032;
+typedef NvU8 U008;
+typedef NvU16 U016;
+typedef NvU32 U032;
+typedef NvS8 S008;
+typedef NvS16 S016;
+typedef NvS32 S032;
+#endif
+#if defined(MACOS) || defined(macintosh) || defined(__APPLE_CC__) || defined(NV_MODS) || defined(MINIRM) || defined(NV_UNIX) || defined (NV_QNX)
+/* more obsolete stuff */
+/* need to provide these on macos9 and macosX */
+#if defined(__APPLE_CC__) /* gross but Apple osX already claims ULONG */
+#undef ULONG // just in case
+#define ULONG unsigned long
+#else
+typedef unsigned long ULONG;
+#endif
+typedef unsigned char *PUCHAR;
+#endif
+
+#if !defined(NV_PTR)
+ /* Supports 32bit libraries on Win64
+ See drivers\opengl\include\nvFirst.h for explanation */
+#define NV_PTR
+#define CAST_NV_PTR(p) p
+#endif
+
+/* Aligns fields in structs so they match up between 32 and 64 bit builds */
+/* XXX Mac still uses structures without alignment -- needs to be fixed */
+#if (defined(__GNUC__) || defined(NV_QNX)) && !defined(NV_MACINTOSH)
+#define NV_ALIGN_BYTES(size) __attribute__ ((aligned (size)))
+#elif defined(__arm)
+#define NV_ALIGN_BYTES(size) __align(ALIGN)
+#else
+// XXX This is dangerously nonportable! We really shouldn't provide a default
+// version of this that doesn't do anything.
+#define NV_ALIGN_BYTES(size)
+#endif
+
+// NV_DECLARE_ALIGNED() can be used on all platforms.
+// This macro form accounts for the fact that __declspec on Windows is required
+// before the variable type,
+// and NV_ALIGN_BYTES is required after the variable name.
+#if defined(NV_WINDOWS)
+#define NV_DECLARE_ALIGNED(TYPE_VAR, ALIGN) __declspec(align(ALIGN)) TYPE_VAR
+#elif defined(__GNUC__) || defined(NV_QNX)
+#define NV_DECLARE_ALIGNED(TYPE_VAR, ALIGN) TYPE_VAR __attribute__ ((aligned (ALIGN)))
+#elif defined(__arm)
+#define NV_DECLARE_ALIGNED(TYPE_VAR, ALIGN) __align(ALIGN) TYPE_VAR
+#endif
+
+
+/***************************************************************************\
+|* Function Declaration Types *|
+ \***************************************************************************/
+
+// stretching the meaning of "nvtypes", but this seems to least offensive
+// place to re-locate these from nvos.h which cannot be included by a number
+// of builds that need them
+
+#if defined(NV_WINDOWS)
+
+ #define NV_INLINE __inline
+
+ #if _MSC_VER >= 1200
+ #define NV_FORCEINLINE __forceinline
+ #else
+ #define NV_FORCEINLINE __inline
+ #endif
+
+ #define NV_APIENTRY __stdcall
+ #define NV_FASTCALL __fastcall
+ #define NV_CDECLCALL __cdecl
+ #define NV_STDCALL __stdcall
+
+#else // defined(NV_WINDOWS)
+
+ #if defined(__GNUC__) || defined(__INTEL_COMPILER)
+ #define NV_INLINE __inline__
+ #elif defined (macintosh)
+ #define NV_INLINE inline
+ #elif defined(__arm)
+ #define NV_INLINE __inline
+ #else
+ #define NV_INLINE
+ #endif
+
+ #if defined(__GNUC__)
+ // GCC 3.1 and beyond support the always_inline function attribute.
+ #if (__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
+ #define NV_FORCEINLINE __inline__ __attribute__((always_inline))
+ #else
+ #define NV_FORCEINLINE __inline__
+ #endif
+ #else /* defined(__GNUC__) */
+ #define NV_FORCEINLINE NV_INLINE
+ #endif
+
+ #define NV_APIENTRY
+ #define NV_FASTCALL
+ #define NV_CDECLCALL
+ #define NV_STDCALL
+
+#endif // defined(NV_WINDOWS)
+
+#ifdef __cplusplus
+};
+#endif
+
+#endif /* NVTYPES_INCLUDED */
diff --git a/Start_WM/test6/inc/vssver2.scc b/Start_WM/test6/inc/vssver2.scc
new file mode 100755
index 00000000..aaf2f386
Binary files /dev/null and b/Start_WM/test6/inc/vssver2.scc differ
diff --git a/Start_WM/test6/lib/Release/libgfsdk.lib b/Start_WM/test6/lib/Release/libgfsdk.lib
new file mode 100755
index 00000000..f5f0c3a5
Binary files /dev/null and b/Start_WM/test6/lib/Release/libgfsdk.lib differ
diff --git a/Start_WM/test6/stdafx.cpp b/Start_WM/test6/stdafx.cpp
new file mode 100755
index 00000000..104854fa
--- /dev/null
+++ b/Start_WM/test6/stdafx.cpp
@@ -0,0 +1,8 @@
+// stdafx.cpp : source file that includes just the standard includes
+// test6.pch will be the pre-compiled header
+// stdafx.obj will contain the pre-compiled type information
+
+#include "stdafx.h"
+
+// TODO: reference any additional headers you need in STDAFX.H
+// and not in this file
diff --git a/Start_WM/test6/stdafx.h b/Start_WM/test6/stdafx.h
new file mode 100755
index 00000000..2c3dc089
--- /dev/null
+++ b/Start_WM/test6/stdafx.h
@@ -0,0 +1,56 @@
+// stdafx.h : include file for standard system include files,
+// or project specific include files that are used frequently, but
+// are changed infrequently
+//
+
+#pragma once
+
+#pragma comment(linker, "/nodefaultlib:libc.lib")
+#pragma comment(linker, "/nodefaultlib:libcd.lib")
+
+// NOTE - this value is not strongly correlated to the Windows CE OS version being targeted
+#define WINVER _WIN32_WCE
+
+#include
+#if defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP)
+#define SHELL_AYGSHELL
+#endif
+
+#ifdef _CE_DCOM
+#define _ATL_APARTMENT_THREADED
+#endif
+
+#include
+
+#include
+#pragma comment(lib, "aygshell.lib")
+
+
+
+#include
+#include
+
+#if defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP)
+#ifndef _DEVICE_RESOLUTION_AWARE
+#define _DEVICE_RESOLUTION_AWARE
+#endif
+#endif
+
+#ifdef _DEVICE_RESOLUTION_AWARE
+#include "DeviceResolutionAware.h"
+#endif
+
+#if _WIN32_WCE < 0x500 && ( defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP) )
+ #pragma comment(lib, "ccrtrtti.lib")
+ #ifdef _X86_
+ #if defined(_DEBUG)
+ #pragma comment(lib, "libcmtx86d.lib")
+ #else
+ #pragma comment(lib, "libcmtx86.lib")
+ #endif
+ #endif
+#endif
+
+#include
+
+// TODO: reference additional headers your program requires here
diff --git a/Start_WM/test6/test6.cpp b/Start_WM/test6/test6.cpp
new file mode 100755
index 00000000..1769c2eb
--- /dev/null
+++ b/Start_WM/test6/test6.cpp
@@ -0,0 +1,127 @@
+// test6.cpp : Defines the entry point for the console application.
+//
+
+#include "stdafx.h"
+#include "windows.h"
+#include "wingdi.h"
+#include "GF.h"
+#include "GFGx.h"
+#include "GFDx.h"
+#include "GFVx.h"
+#include "GFDiag.h"
+#include
+#include
+
+// Rotation related defines
+#define H_FLIP_BIT 0x00000001
+#define V_FLIP_BIT 0x00000002
+#define XYSWAP_BIT 0x00000004
+#define ROT_IDENTIY 0x0
+#define ROT_90 (XYSWAP_BIT | H_FLIP_BIT)
+#define ROT_180 (H_FLIP_BIT | V_FLIP_BIT)
+#define ROT_270 (XYSWAP_BIT | V_FLIP_BIT)
+#define ROT_H_FLIP (H_FLIP_BIT)
+#define ROT_V_FLIP (V_FLIP_BIT)
+#define ROT_XYSWAP (XYSWAP_BIT)
+#define ROT_SWAP_X_Y (XYSWAP_BIT | H_FLIP_BIT | V_FLIP_BIT)
+
+// Overlay options
+#define NO_OVERLAY 0
+#define RGB565_WITH_VXBLT 1
+#define ARGB8888_WITH_VXBLT 2
+#define YUV_WITH_FR 3 //(FR = fast rotate)
+
+#define COLOR_KEY (255<<16 | 0<<8 | 255)//RGB888
+
+//kbm gui 2.2 ݿ
+#define BLEND_KEY (5<<16 | 18<<8 | 41)//RGB888
+//#define BLEND_KEY (37<<16 | 54<<8 | 84)//RGB888
+
+#define BACKGROUND_RGB565 (0<<11 | 0<<5 | 0)//RGB565
+
+#define ALPHA_VALUE (165<<16 |165<<8 | 165)
+#define OVERLAY_SURF 2
+
+#define DBGERROR 1
+#define DBGINFO 2
+
+#define DEFAULT_LCD_WIDTH 800
+#define DEFAULT_LCD_HEIGHT 480
+
+FILE *fp;
+int tpos=0;
+void text_d(LPWSTR s){
+
+ fwprintf(fp, L"debug: %s \n",s);
+
+ HDC hd=GetDC(0);
+ RECT r;
+ r.left=0;
+ r.top=tpos;
+ r.right=480;
+ r.bottom=800;
+ if (!tpos){Rectangle(hd,0,0,480,800);}
+ tpos+=25;
+ DrawText(hd,s,wcslen(s),&r,0);
+ if (tpos>700){tpos=0;}
+
+}
+int _tmain(int argc, _TCHAR* argv[])
+{
+
+ if (( fp= fopen("log10.txt", "w")) == NULL) {
+ printf("He .\n");
+ }
+
+
+ text_d(L"Started");
+ GFRECT destRect;
+ GFRECT srcRect;
+ GFRECT srcXYRect; // src rect for an xyswapped src image
+ GF_RETTYPE status;
+ GFRMSURFACEREQUEST surfReq;
+ GFDXPROPERTY DxProp;// Dx Specific
+ NvU32 width, height, bpp, stride, startAddr;
+ GFRmHandle pm=GFRmOpen( NULL );
+ GFDxHandle px;
+ GFDxOpen(pm, &(px), GF_STATE_DEFAULT, NULL);
+
+
+ GFDxGetAttribute(px ,LCD_MAIN, GFDX_ATTR_STARTADDR, &startAddr);
+ WCHAR buff[200];
+ wsprintf(buff,L"%x",startAddr);
+ text_d(L"startAddr");
+ text_d(buff);
+ text_d(L"fix");
+ //GFDxSetAttributeWithCS
+ startAddr=0x2000000;
+ GFDxSetAttributeWithCS(px ,LCD_MAIN, GFDX_ATTR_STARTADDR, startAddr);
+ wsprintf(buff,L"%x",startAddr);
+ text_d(L"startAddr");
+ text_d(buff);
+
+
+
+
+
+
+
+return 0;
+ text_d(L"Starting Haret\n");
+ SHELLEXECUTEINFO ShExecInfo = {0};
+ ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
+ ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS;
+ ShExecInfo.hwnd = NULL;
+ ShExecInfo.lpVerb = L"open";
+ ShExecInfo.lpFile = L"\\Storage Card\\Android\\haret.exe";
+ ShExecInfo.lpParameters = NULL;
+//WCHAR strExePath [MAX_PATH];
+//GetModuleFileNameW (NULL, strExePath, MAX_PATH);
+
+ ShExecInfo.lpDirectory = NULL;
+ ShExecInfo.nShow = SW_SHOW;
+ ShExecInfo.hInstApp = NULL;
+ ShellExecuteEx(&ShExecInfo);
+ return 0;
+}
+
diff --git a/Start_WM/test6/test6.vcproj b/Start_WM/test6/test6.vcproj
new file mode 100755
index 00000000..7e6efd0e
--- /dev/null
+++ b/Start_WM/test6/test6.vcproj
@@ -0,0 +1,453 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/kernel-2.6.33/.config b/kernel-2.6.33/.config
index 9597c933..207ae7a1 100644
--- a/kernel-2.6.33/.config
+++ b/kernel-2.6.33/.config
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.33
-# Sat Sep 11 11:04:54 2010
+# Fri Oct 15 21:48:21 2010
#
CONFIG_ARM=y
CONFIG_HAVE_PWM=y
@@ -65,15 +65,16 @@ CONFIG_LOG_BUF_SHIFT=17
CONFIG_GROUP_SCHED=y
CONFIG_FAIR_GROUP_SCHED=y
CONFIG_RT_GROUP_SCHED=y
-CONFIG_USER_SCHED=y
-# CONFIG_CGROUP_SCHED is not set
+# CONFIG_USER_SCHED is not set
+CONFIG_CGROUP_SCHED=y
CONFIG_CGROUPS=y
# CONFIG_CGROUP_DEBUG is not set
-# CONFIG_CGROUP_NS is not set
-# CONFIG_CGROUP_FREEZER is not set
-# CONFIG_CGROUP_DEVICE is not set
-# CONFIG_CPUSETS is not set
-# CONFIG_CGROUP_CPUACCT is not set
+CONFIG_CGROUP_NS=y
+CONFIG_CGROUP_FREEZER=y
+CONFIG_CGROUP_DEVICE=y
+CONFIG_CPUSETS=y
+CONFIG_PROC_PID_CPUSET=y
+CONFIG_CGROUP_CPUACCT=y
# CONFIG_RESOURCE_COUNTERS is not set
CONFIG_SYSFS_DEPRECATED=y
CONFIG_SYSFS_DEPRECATED_V2=y
@@ -196,7 +197,7 @@ CONFIG_DEFAULT_IOSCHED="cfq"
# CONFIG_INLINE_WRITE_UNLOCK_IRQ is not set
# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set
# CONFIG_MUTEX_SPIN_ON_OWNER is not set
-# CONFIG_FREEZER is not set
+CONFIG_FREEZER=y
#
# System Type
@@ -301,12 +302,14 @@ CONFIG_ARCH_PXA=y
# CONFIG_PXA_SHARPSL is not set
# CONFIG_ARCH_PXA_ESERIES is not set
CONFIG_MACH_G900=y
+CONFIG_G900_CORE=y
CONFIG_G900_KBR=y
CONFIG_G900_BUTTON=y
CONFIG_G900_LEDS=y
CONFIG_G900_PHONE=y
CONFIG_G900_POWER_BUTTON=y
-CONFIG_G900_FLASH=y
+CONFIG_G900_UDC=y
+# CONFIG_G900_FLASH is not set
CONFIG_PXA27x=y
CONFIG_PXA_SSP=y
CONFIG_PLAT_PXA=y
@@ -1094,8 +1097,7 @@ CONFIG_FB_TILEBLITTING=y
#
# CONFIG_FB_S1D13XXX is not set
# CONFIG_FB_PXA is not set
-# CONFIG_FB_G900 is not set
-CONFIG_FB_G900_NEW=y
+CONFIG_FB_G900=y
# CONFIG_FB_MBX is not set
# CONFIG_FB_W100 is not set
# CONFIG_FB_VIRTUAL is not set
diff --git a/kernel-2.6.33/arch/arm/configs/g900_defconfig b/kernel-2.6.33/arch/arm/configs/g900_defconfig
index 9b572309..b6f6c7d7 100644
--- a/kernel-2.6.33/arch/arm/configs/g900_defconfig
+++ b/kernel-2.6.33/arch/arm/configs/g900_defconfig
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.33
-# Sat Sep 11 04:31:01 2010
+# Thu Sep 23 19:37:32 2010
#
CONFIG_ARM=y
CONFIG_HAVE_PWM=y
@@ -65,15 +65,16 @@ CONFIG_LOG_BUF_SHIFT=17
CONFIG_GROUP_SCHED=y
CONFIG_FAIR_GROUP_SCHED=y
CONFIG_RT_GROUP_SCHED=y
-CONFIG_USER_SCHED=y
-# CONFIG_CGROUP_SCHED is not set
+# CONFIG_USER_SCHED is not set
+CONFIG_CGROUP_SCHED=y
CONFIG_CGROUPS=y
# CONFIG_CGROUP_DEBUG is not set
-# CONFIG_CGROUP_NS is not set
-# CONFIG_CGROUP_FREEZER is not set
-# CONFIG_CGROUP_DEVICE is not set
-# CONFIG_CPUSETS is not set
-# CONFIG_CGROUP_CPUACCT is not set
+CONFIG_CGROUP_NS=y
+CONFIG_CGROUP_FREEZER=y
+CONFIG_CGROUP_DEVICE=y
+CONFIG_CPUSETS=y
+CONFIG_PROC_PID_CPUSET=y
+CONFIG_CGROUP_CPUACCT=y
# CONFIG_RESOURCE_COUNTERS is not set
CONFIG_SYSFS_DEPRECATED=y
CONFIG_SYSFS_DEPRECATED_V2=y
@@ -85,7 +86,7 @@ CONFIG_USER_NS=y
CONFIG_PID_NS=y
CONFIG_NET_NS=y
CONFIG_BLK_DEV_INITRD=y
-CONFIG_INITRAMFS_SOURCE="../ramfs-android/"
+CONFIG_INITRAMFS_SOURCE="../ramfs-android"
CONFIG_INITRAMFS_ROOT_UID=0
CONFIG_INITRAMFS_ROOT_GID=0
CONFIG_RD_GZIP=y
@@ -104,6 +105,7 @@ CONFIG_EMBEDDED=y
CONFIG_UID16=y
CONFIG_SYSCTL_SYSCALL=y
CONFIG_KALLSYMS=y
+CONFIG_KALLSYMS_ALL=y
# CONFIG_KALLSYMS_EXTRA_PASS is not set
CONFIG_HOTPLUG=y
CONFIG_PRINTK=y
@@ -137,6 +139,7 @@ CONFIG_HAVE_CLK=y
#
# GCOV-based kernel profiling
#
+# CONFIG_GCOV_KERNEL is not set
# CONFIG_SLOW_WORK is not set
CONFIG_HAVE_GENERIC_DMA_COHERENT=y
CONFIG_SLABINFO=y
@@ -194,7 +197,7 @@ CONFIG_DEFAULT_IOSCHED="cfq"
# CONFIG_INLINE_WRITE_UNLOCK_IRQ is not set
# CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE is not set
# CONFIG_MUTEX_SPIN_ON_OWNER is not set
-# CONFIG_FREEZER is not set
+CONFIG_FREEZER=y
#
# System Type
@@ -389,7 +392,7 @@ CONFIG_KEXEC=y
#
CONFIG_CPU_FREQ=y
CONFIG_CPU_FREQ_TABLE=y
-# CONFIG_CPU_FREQ_DEBUG is not set
+CONFIG_CPU_FREQ_DEBUG=y
CONFIG_CPU_FREQ_STAT=y
CONFIG_CPU_FREQ_STAT_DETAILS=y
CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y
@@ -427,7 +430,8 @@ CONFIG_HAVE_AOUT=y
# Power management options
#
CONFIG_PM=y
-# CONFIG_PM_DEBUG is not set
+CONFIG_PM_DEBUG=y
+CONFIG_PM_VERBOSE=y
# CONFIG_SUSPEND is not set
CONFIG_HAS_WAKELOCK=y
CONFIG_HAS_EARLYSUSPEND=y
@@ -538,13 +542,14 @@ CONFIG_WEXT_SPY=y
CONFIG_CFG80211=y
CONFIG_NL80211_TESTMODE=y
CONFIG_CFG80211_DEVELOPER_WARNINGS=y
-# CONFIG_CFG80211_REG_DEBUG is not set
+CONFIG_CFG80211_REG_DEBUG=y
CONFIG_CFG80211_DEFAULT_PS=y
+CONFIG_CFG80211_DEBUGFS=y
CONFIG_WIRELESS_OLD_REGULATORY=y
CONFIG_CFG80211_WEXT=y
CONFIG_WIRELESS_EXT_SYSFS=y
CONFIG_LIB80211=y
-# CONFIG_LIB80211_DEBUG is not set
+CONFIG_LIB80211_DEBUG=y
CONFIG_MAC80211=y
# CONFIG_MAC80211_RC_PID is not set
# CONFIG_MAC80211_RC_MINSTREL is not set
@@ -553,6 +558,7 @@ CONFIG_MAC80211=y
CONFIG_MAC80211_RC_DEFAULT=""
CONFIG_MAC80211_MESH=y
# CONFIG_MAC80211_LEDS is not set
+# CONFIG_MAC80211_DEBUGFS is not set
# CONFIG_MAC80211_DEBUG_MENU is not set
# CONFIG_WIMAX is not set
CONFIG_RFKILL=y
@@ -575,10 +581,13 @@ CONFIG_FW_LOADER=y
# CONFIG_FIRMWARE_IN_KERNEL is not set
CONFIG_EXTRA_FIRMWARE="libertas/gspi8385_hlp.bin libertas/gspi8385.bin"
CONFIG_EXTRA_FIRMWARE_DIR="../FW"
+CONFIG_DEBUG_DRIVER=y
+CONFIG_DEBUG_DEVRES=y
# CONFIG_SYS_HYPERVISOR is not set
# CONFIG_CONNECTOR is not set
CONFIG_MTD=y
-# CONFIG_MTD_DEBUG is not set
+CONFIG_MTD_DEBUG=y
+CONFIG_MTD_DEBUG_VERBOSE=3
# CONFIG_MTD_TESTS is not set
# CONFIG_MTD_CONCAT is not set
# CONFIG_MTD_PARTITIONS is not set
@@ -641,19 +650,7 @@ CONFIG_MTD_PHYSMAP=y
# CONFIG_MTD_DOC2000 is not set
# CONFIG_MTD_DOC2001 is not set
# CONFIG_MTD_DOC2001PLUS is not set
-CONFIG_MTD_NAND=y
-# CONFIG_MTD_NAND_VERIFY_WRITE is not set
-# CONFIG_MTD_NAND_ECC_SMC is not set
-# CONFIG_MTD_NAND_MUSEUM_IDS is not set
-# CONFIG_MTD_NAND_GPIO is not set
-CONFIG_MTD_NAND_IDS=y
-CONFIG_MTD_NAND_DISKONCHIP=m
-# CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADVANCED is not set
-CONFIG_MTD_NAND_DISKONCHIP_PROBE_ADDRESS=0
-# CONFIG_MTD_NAND_DISKONCHIP_BBTWRITE is not set
-# CONFIG_MTD_NAND_SHARPSL is not set
-# CONFIG_MTD_NAND_PLATFORM is not set
-# CONFIG_MTD_ALAUDA is not set
+# CONFIG_MTD_NAND is not set
# CONFIG_MTD_ONENAND is not set
#
@@ -771,7 +768,7 @@ CONFIG_LIBERTAS=y
# CONFIG_LIBERTAS_USB is not set
# CONFIG_LIBERTAS_SDIO is not set
CONFIG_LIBERTAS_SPI=m
-# CONFIG_LIBERTAS_DEBUG is not set
+CONFIG_LIBERTAS_DEBUG=y
# CONFIG_P54_COMMON is not set
# CONFIG_RT2X00 is not set
# CONFIG_WL12XX is not set
@@ -956,6 +953,7 @@ CONFIG_I2C_PXA=y
# CONFIG_I2C_DEBUG_BUS is not set
# CONFIG_I2C_DEBUG_CHIP is not set
CONFIG_SPI=y
+CONFIG_SPI_DEBUG=y
CONFIG_SPI_MASTER=y
#
@@ -979,6 +977,7 @@ CONFIG_SPI_SPIDEV=y
# CONFIG_PPS is not set
CONFIG_ARCH_REQUIRE_GPIOLIB=y
CONFIG_GPIOLIB=y
+CONFIG_DEBUG_GPIO=y
CONFIG_GPIO_SYSFS=y
#
@@ -1154,7 +1153,9 @@ CONFIG_SND_JACK=y
CONFIG_SND_SUPPORT_OLD_API=y
CONFIG_SND_VERBOSE_PROCFS=y
CONFIG_SND_VERBOSE_PRINTK=y
-# CONFIG_SND_DEBUG is not set
+CONFIG_SND_DEBUG=y
+CONFIG_SND_DEBUG_VERBOSE=y
+CONFIG_SND_PCM_XRUN_DEBUG=y
CONFIG_SND_VMASTER=y
# CONFIG_SND_RAWMIDI_SEQ is not set
# CONFIG_SND_OPL3_LIB_SEQ is not set
@@ -1237,7 +1238,7 @@ CONFIG_USB_ARCH_HAS_HCD=y
CONFIG_USB_ARCH_HAS_OHCI=y
# CONFIG_USB_ARCH_HAS_EHCI is not set
CONFIG_USB=y
-# CONFIG_USB_DEBUG is not set
+CONFIG_USB_DEBUG=y
CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
#
@@ -1288,7 +1289,7 @@ CONFIG_USB_ACM=m
# also be needed; see USB_STORAGE Help for more info
#
CONFIG_USB_STORAGE=m
-# CONFIG_USB_STORAGE_DEBUG is not set
+CONFIG_USB_STORAGE_DEBUG=y
CONFIG_USB_STORAGE_DATAFAB=m
CONFIG_USB_STORAGE_FREECOM=m
CONFIG_USB_STORAGE_ISD200=m
@@ -1383,7 +1384,9 @@ CONFIG_USB_SERIAL_GENERIC=y
# CONFIG_USB_ISIGHTFW is not set
# CONFIG_USB_VST is not set
CONFIG_USB_GADGET=y
+# CONFIG_USB_GADGET_DEBUG is not set
# CONFIG_USB_GADGET_DEBUG_FILES is not set
+CONFIG_USB_GADGET_DEBUG_FS=y
CONFIG_USB_GADGET_VBUS_DRAW=100
CONFIG_USB_GADGET_SELECTED=y
# CONFIG_USB_GADGET_AT91 is not set
@@ -1734,14 +1737,60 @@ CONFIG_FRAME_WARN=1024
# CONFIG_MAGIC_SYSRQ is not set
# CONFIG_STRIP_ASM_SYMS is not set
# CONFIG_UNUSED_SYMBOLS is not set
-# CONFIG_DEBUG_FS is not set
+CONFIG_DEBUG_FS=y
# CONFIG_HEADERS_CHECK is not set
-# CONFIG_DEBUG_KERNEL is not set
+CONFIG_DEBUG_KERNEL=y
+# CONFIG_DEBUG_SHIRQ is not set
+# CONFIG_DETECT_SOFTLOCKUP is not set
+# CONFIG_DETECT_HUNG_TASK is not set
+# CONFIG_SCHED_DEBUG is not set
+# CONFIG_SCHEDSTATS is not set
+# CONFIG_TIMER_STATS is not set
+CONFIG_DEBUG_OBJECTS=y
+CONFIG_DEBUG_OBJECTS_SELFTEST=y
+CONFIG_DEBUG_OBJECTS_FREE=y
+CONFIG_DEBUG_OBJECTS_TIMERS=y
+CONFIG_DEBUG_OBJECTS_WORK=y
+CONFIG_DEBUG_OBJECTS_ENABLE_DEFAULT=1
+CONFIG_DEBUG_SLAB=y
+CONFIG_DEBUG_SLAB_LEAK=y
+# CONFIG_DEBUG_KMEMLEAK is not set
+CONFIG_DEBUG_PREEMPT=y
+# CONFIG_DEBUG_RT_MUTEXES is not set
+# CONFIG_RT_MUTEX_TESTER is not set
+CONFIG_DEBUG_SPINLOCK=y
+CONFIG_DEBUG_MUTEXES=y
+CONFIG_DEBUG_LOCK_ALLOC=y
+CONFIG_PROVE_LOCKING=y
+CONFIG_LOCKDEP=y
+CONFIG_LOCK_STAT=y
+CONFIG_DEBUG_LOCKDEP=y
+CONFIG_TRACE_IRQFLAGS=y
+CONFIG_DEBUG_SPINLOCK_SLEEP=y
+# CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set
+CONFIG_STACKTRACE=y
+# CONFIG_DEBUG_KOBJECT is not set
CONFIG_DEBUG_BUGVERBOSE=y
-# CONFIG_DEBUG_MEMORY_INIT is not set
+CONFIG_DEBUG_INFO=y
+# CONFIG_DEBUG_VM is not set
+CONFIG_DEBUG_WRITECOUNT=y
+CONFIG_DEBUG_MEMORY_INIT=y
+CONFIG_DEBUG_LIST=y
+CONFIG_DEBUG_SG=y
+CONFIG_DEBUG_NOTIFIERS=y
+CONFIG_DEBUG_CREDENTIALS=y
+CONFIG_BOOT_PRINTK_DELAY=y
+# CONFIG_RCU_TORTURE_TEST is not set
CONFIG_RCU_CPU_STALL_DETECTOR=y
+# CONFIG_BACKTRACE_SELF_TEST is not set
+# CONFIG_DEBUG_BLOCK_EXT_DEVT is not set
+# CONFIG_DEBUG_FORCE_WEAK_PER_CPU is not set
+# CONFIG_FAULT_INJECTION is not set
# CONFIG_LATENCYTOP is not set
# CONFIG_SYSCTL_SYSCALL_CHECK is not set
+CONFIG_DEBUG_PAGEALLOC=y
+CONFIG_WANT_PAGE_DEBUG_FLAGS=y
+CONFIG_PAGE_POISONING=y
CONFIG_HAVE_FUNCTION_TRACER=y
CONFIG_TRACING_SUPPORT=y
CONFIG_FTRACE=y
@@ -1758,10 +1807,17 @@ CONFIG_BRANCH_PROFILE_NONE=y
# CONFIG_KMEMTRACE is not set
# CONFIG_WORKQUEUE_TRACER is not set
# CONFIG_BLK_DEV_IO_TRACE is not set
+CONFIG_DYNAMIC_DEBUG=y
# CONFIG_SAMPLES is not set
CONFIG_HAVE_ARCH_KGDB=y
+# CONFIG_KGDB is not set
CONFIG_ARM_UNWIND=y
-# CONFIG_DEBUG_USER is not set
+CONFIG_DEBUG_USER=y
+CONFIG_DEBUG_ERRORS=y
+CONFIG_DEBUG_STACK_USAGE=y
+CONFIG_DEBUG_LL=y
+CONFIG_EARLY_PRINTK=y
+# CONFIG_DEBUG_ICEDCC is not set
# CONFIG_OC_ETM is not set
#
@@ -1891,8 +1947,6 @@ CONFIG_ZLIB_INFLATE=y
CONFIG_LZO_COMPRESS=y
CONFIG_LZO_DECOMPRESS=y
CONFIG_DECOMPRESS_GZIP=y
-CONFIG_REED_SOLOMON=m
-CONFIG_REED_SOLOMON_DEC16=y
CONFIG_HAS_IOMEM=y
CONFIG_HAS_IOPORT=y
CONFIG_HAS_DMA=y
diff --git a/kernel-2.6.33/arch/arm/mach-pxa/g900/Kconfig b/kernel-2.6.33/arch/arm/mach-pxa/g900/Kconfig
index 007a153a..70ce3a5a 100755
--- a/kernel-2.6.33/arch/arm/mach-pxa/g900/Kconfig
+++ b/kernel-2.6.33/arch/arm/mach-pxa/g900/Kconfig
@@ -8,6 +8,11 @@ config MACH_G900
select HAVE_PWM
select GPIO_SYSFS
+config G900_CORE
+ tristate "Tohiba G900 core"
+ depends on MACH_G900
+ help
+ This selection enables Tohiba G900 core support.
config G900_KBR
tristate "G900 Keyboard"
@@ -44,6 +49,14 @@ config G900_POWER_BUTTON
---help---
This is a POWER Buttons driver for G900
+
+config G900_UDC
+ bool "USB Device Controller support"
+ depends on MACH_G900 && USB_PXA27X
+ help
+ Enables Tohiba G900 specific USB detection
+
+
config G900_FLASH
tristate "G900 mDOC G4 flash Experemental"
depends on MACH_G900
diff --git a/kernel-2.6.33/arch/arm/mach-pxa/g900/Makefile b/kernel-2.6.33/arch/arm/mach-pxa/g900/Makefile
index feb4b907..a8249e51 100755
--- a/kernel-2.6.33/arch/arm/mach-pxa/g900/Makefile
+++ b/kernel-2.6.33/arch/arm/mach-pxa/g900/Makefile
@@ -1,8 +1,10 @@
-obj-$(CONFIG_MACH_G900) += g900.o
+obj-$(CONFIG_MACH_G900) += g900.o g900_pm.o
+obj-$(CONFIG_G900_CORE) += g900_core.o
obj-$(CONFIG_G900_KBR) += g900_keyboard.o
obj-$(CONFIG_G900_BUTTON) += g900_buttons.o
obj-$(CONFIG_G900_POWER_BUTTON) += g900_pwr_btn.o
obj-$(CONFIG_G900_LEDS) += g900_leds.o
+obj-$(CONFIG_G900_UDC) += g900_udc.o
obj-$(CONFIG_G900_PHONE) += g900_msm6280.o
#obj-$(CONFIG_G900_FLASH) += ttfs/
obj-m += ttfs/
diff --git a/kernel-2.6.33/arch/arm/mach-pxa/g900/docg3.c b/kernel-2.6.33/arch/arm/mach-pxa/g900/docg3.c
new file mode 100755
index 00000000..e0389d99
--- /dev/null
+++ b/kernel-2.6.33/arch/arm/mach-pxa/g900/docg3.c
@@ -0,0 +1,356 @@
+
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+
+#define DoC_G3_IO 0x0800
+
+#define DoC_G3_ChipID 0x1000
+#define DoC_G3_DeviceIdSelect 0x100a
+#define DoC_G3_Ctrl 0x100c
+
+#define DoC_G3_CtrlConfirm 0x1072
+#define DoC_G3_ReadAddress 0x101a
+#define DoC_G3_FlashSelect 0x1032
+#define DoC_G3_FlashCmd 0x1034
+#define DoC_G3_FlashAddr 0x1036
+#define DoC_G3_FlashCtrl 0x1038
+#define DoC_G3_Nop 0x103e
+
+#define DOC_MODE_RESET 0x0
+#define DOC_MODE_NORMAL 0x1
+#define DOC_MODE_MDWREN 0x4
+
+
+#define DoC_G3_ID 0x200
+
+#define CMD_FLASH_RESET 0xff
+#define DoC_G3_IOREMAP_LEN 0x8000
+
+static unsigned long doc_config_location = 0xffffffff;
+
+
+#define DOCG3_MAJOR 254
+#define DOCG3_MINOR 0
+
+int major,minor;
+#define SECTOR_SIZE 0x200
+#define NUM_SECTOR 0xffff
+#define CHIP_SIZE (0xffff*0x100)
+
+module_param(doc_config_location, ulong, 0);
+MODULE_PARM_DESC(doc_config_location, "Physical memory address at which to probe for DiskOnChipG3");
+
+#define ReadDOC(adr,reg) ((unsigned char)(*(volatile __u32 *)(((unsigned long)adr)+((reg)))))
+#define ReadDOC_16(adr,reg) ((__u16)(*(volatile __u32 *)(((unsigned long)adr)+((reg)))))
+#define ReadDOC_32(adr,reg) ((__u32)(*(volatile __u32 *)(((unsigned long)adr)+((reg)))))
+#define WriteDOC(d, adr, reg) do{ *(volatile __u16 *)(((unsigned long)adr)+((reg))) = (__u16)d; wmb();} while(0)
+#define WriteDOC_8(d, adr, reg) do{ *(volatile unsigned char *)(((unsigned long)adr)+((reg))) = (unsigned char)d; wmb();} while(0)
+
+
+struct doc_g3_dev {
+ void __iomem *virtaddr;
+ unsigned long physaddr;
+
+ struct cdev cdev;
+};
+struct doc_g3_dev *g3;
+static void docg3_nop(struct doc_g3_dev *g3) {
+ WriteDOC(0xff,g3->virtaddr,DoC_G3_Nop);
+}
+
+
+static void docg3_wait_flash_completion(struct doc_g3_dev *g3) {
+ __u32 c;
+ int i=0;
+ docg3_nop(g3);
+ docg3_nop(g3);
+ docg3_nop(g3);
+ docg3_nop(g3);
+ /* Prepare read */
+ WriteDOC(g3->physaddr+DoC_G3_FlashCtrl,g3->virtaddr,DoC_G3_ReadAddress);
+ c =ReadDOC(g3->virtaddr,DoC_G3_FlashCtrl);
+ while(((c & 0x01) != 0x01) && (i++<300)) {
+ //printk("%x(%x) ",c,c<<31);
+ c =ReadDOC(g3->virtaddr,DoC_G3_FlashCtrl);
+ }
+// printk("\n");
+}
+
+static void docg3_flash_select(struct doc_g3_dev *g3,unsigned char f) {
+ WriteDOC(f,g3->virtaddr,DoC_G3_FlashSelect);
+}
+
+static void docg3_flash_cmd(struct doc_g3_dev *g3,unsigned char c) {
+ WriteDOC(c,g3->virtaddr,DoC_G3_FlashCmd);
+ docg3_nop(g3);
+ docg3_nop(g3);
+}
+
+static void docg3_reset(struct doc_g3_dev *g3) {
+ WriteDOC( DOC_MODE_RESET|DOC_MODE_MDWREN,g3->virtaddr,DoC_G3_Ctrl);
+ WriteDOC(~( DOC_MODE_RESET|DOC_MODE_MDWREN),g3->virtaddr, DoC_G3_CtrlConfirm);
+
+
+ WriteDOC( DOC_MODE_NORMAL|DOC_MODE_MDWREN,g3->virtaddr,DoC_G3_Ctrl);
+ WriteDOC( ~(DOC_MODE_NORMAL|DOC_MODE_MDWREN),g3->virtaddr, DoC_G3_CtrlConfirm);
+
+}
+
+static void docg3_set_read_offset(struct doc_g3_dev *g3,unsigned char offset) {
+ WriteDOC_8(offset,g3->virtaddr,DoC_G3_FlashAddr);
+ docg3_nop(g3);
+}
+static void docg3_set_read_addr(struct doc_g3_dev *g3, unsigned int addr) {
+ unsigned char tmp;
+
+ tmp = (unsigned char) (addr & 0xFF);
+ //printk("%s: (%x,%x) %x ",__FUNCTION__,addr,offset,tmp);
+ WriteDOC_8(tmp,g3->virtaddr,DoC_G3_FlashAddr);
+
+ tmp = (unsigned char) ((addr>>8) & 0xFF);
+ //printk("%x ",tmp);
+ WriteDOC_8(tmp,g3->virtaddr,DoC_G3_FlashAddr);
+
+ tmp = (unsigned char) ((addr>>16) & 0xFF);
+ //printk("%x ",tmp);
+ WriteDOC_8(tmp,g3->virtaddr,DoC_G3_FlashAddr);
+ docg3_nop(g3);
+ //docg3_set_read_offset(g3,offset);
+ //printk("%x\n",offset);
+}
+
+static void docg3_enable_stuff(struct doc_g3_dev *g3) {
+ WriteDOC(0x8a0f,g3->virtaddr,0x1040);
+ docg3_nop(g3);
+ docg3_nop(g3);
+ docg3_nop(g3);
+ docg3_nop(g3);
+ docg3_nop(g3);
+}
+
+// Read the num the 512 bytes block of the chip flash
+static void docg3_read_sector(struct doc_g3_dev *g3,int chip,int num,unsigned int *buf) {
+ unsigned int tmp,i,addr;
+ addr= num%0x40 + 0x80*(num/0x40);
+ //printk("docg3_read_sector: %x %x %x\n",chip, num, addr);
+ do {
+ docg3_flash_select(g3,0x00);
+ docg3_flash_cmd(g3,CMD_FLASH_RESET);
+ docg3_wait_flash_completion(g3);
+
+ docg3_nop(g3);
+
+ docg3_flash_select(g3,0x09);
+ docg3_flash_cmd(g3,0xa2);
+ docg3_flash_cmd(g3,0x22);
+
+
+ docg3_flash_select(g3,0xe);
+ docg3_flash_cmd(g3,0);
+ docg3_flash_select(g3,0x12);
+ if((0x0|addr)==(0x40|addr)) printk("loop for %x\n",addr);
+
+ docg3_flash_cmd(g3,0x60);
+ docg3_set_read_addr(g3,0x0|addr);
+
+
+ docg3_flash_cmd(g3,0x60);
+ docg3_set_read_addr(g3,0x40|addr);
+
+
+ //docg3_set_read_addr(g3,0x80,0x80);
+ WriteDOC_8(g3->physaddr+DoC_G3_FlashCtrl,g3->virtaddr,DoC_G3_ReadAddress);
+ tmp = ReadDOC(g3->virtaddr,DoC_G3_FlashCtrl);
+ //printk("%x %x\n",tmp,tmp & 0x06);
+ } while(tmp & 0x06); //TODO: timeout
+
+ docg3_flash_cmd(g3,0x30);
+ docg3_wait_flash_completion(g3);
+ docg3_flash_cmd(g3,0x05);
+ if(addr & 1)
+ docg3_set_read_offset(g3,0x84); // second block ?
+ else
+ docg3_set_read_offset(g3,0x00); // second block ?
+
+ docg3_flash_cmd(g3,0xe0);
+ docg3_enable_stuff(g3);
+
+ WriteDOC(g3->physaddr+DoC_G3_IO,g3->virtaddr,DoC_G3_ReadAddress);
+
+ for(i=0;i<128;i++) {
+ tmp = ReadDOC_32(g3->virtaddr, DoC_G3_IO+4);
+ buf[i] = tmp;
+ }
+
+
+}
+
+int docg3_open(struct inode *inode, struct file *filp)
+{
+ printk("docg3_open\n");
+ //dev = container_of(inode->i_cdev, struct doc_g3_dev, cdev);
+ filp->private_data = g3; /* for other methods */
+
+ return 0; /* success */
+}
+
+int docg3_release(struct inode *inode, struct file *filp)
+{
+ printk("docg3_release\n");
+ return 0;
+}
+
+int docg3_ioctl(struct inode *inode, struct file *filp,
+ unsigned int cmd, unsigned long arg)
+{
+ return -ENOTTY;
+}
+
+ssize_t docg3_read(struct file *filp, char __user *buf, size_t count,
+ loff_t *f_pos)
+{
+ struct doc_g3_dev *dev = filp->private_data;
+ int block=0;
+ int chip=0;
+ int n=SECTOR_SIZE;
+ unsigned int buffer[128];
+ loff_t cur = filp->f_pos;
+ //printk("docg3_read: %d offset: %llx\n",count,filp->f_pos);
+
+ //chip = ((unsigned int)filp->f_pos) / CHIP_SIZE; //todo
+ if(cur >= 0x4000000) {
+ printk("Failed for %llx %x\n",filp->f_pos,count);
+ return -EIO;
+ }
+ if((cur + count) > 0x4000000 ) {
+ printk("truncating %llx %x",cur,count);
+ count = 0x4000000 - cur;
+ printk(" to %x\n",count);
+ }
+ // TODO:
+ // separate reques if over a chip change.
+ do {
+ block = (cur - chip * CHIP_SIZE) / SECTOR_SIZE;
+ //printk("docg3_read: %x %x %x\n",chip,block,(( int)filp->f_pos));
+
+ //if(block> NUM_SECTOR) return -EFAULT;
+
+ docg3_read_sector(dev,chip,block,buffer);
+
+ if(count < SECTOR_SIZE) n = count;
+ if (copy_to_user(buf,buffer,n))
+ return -EFAULT;
+ //printk("return %d (requested %d)\n",n,count);
+ *f_pos+=n;
+ count-=n;
+ buf +=n;
+ cur +=n;
+
+ }while (count >= SECTOR_SIZE );
+
+ return cur - filp->f_pos;
+
+
+}
+
+
+loff_t docg3_llseek(struct file *filp, loff_t off, int whence)
+{
+ loff_t newpos;
+ printk("docg3_seek\n");
+ switch(whence) {
+ case 0: /* SEEK_SET */
+ newpos = off;
+ break;
+
+ case 1: /* SEEK_CUR */
+ newpos = filp->f_pos + off;
+ break;
+
+ default:
+ return -EINVAL;
+ }
+ if (newpos < 0) return -EINVAL;
+ filp->f_pos = newpos;
+ return newpos;
+}
+
+
+struct file_operations docg3_fops = {
+ .owner = THIS_MODULE,
+ .llseek = docg3_llseek,
+ .read = docg3_read,
+ .ioctl = docg3_ioctl,
+ .open = docg3_open,
+ .release = docg3_release,
+};
+
+
+static int __init init_docg3(void)
+{
+ static struct doc_g3_dev s_g3;
+ unsigned int chipId;
+ int i;
+ dev_t dev=0;
+
+
+ register_chrdev(DOCG3_MAJOR,"docG3",&docg3_fops);
+ dev = MKDEV(DOCG3_MAJOR,DOCG3_MINOR);
+
+ g3=&s_g3;
+ g3->physaddr = doc_config_location;
+ g3->virtaddr = ioremap(g3->physaddr, DoC_G3_IOREMAP_LEN);
+ if(!g3->virtaddr ) {
+ printk(KERN_ERR "DoC_G3 ioremap failed\n");
+ return -EIO;
+ }
+
+ //devfs_mk_cdev(dev, S_IFCHR|S_IRUSR|S_IWUSR|S_IRGRP,"DocG3");
+ cdev_init(&g3->cdev,&docg3_fops);
+ g3->cdev.owner= THIS_MODULE;
+ g3->cdev.ops = &docg3_fops;
+ i = cdev_add(&g3->cdev,MKDEV(DOCG3_MAJOR,DOCG3_MINOR),1);
+ if(i)
+ printk("cdev_add failed\n");
+
+ docg3_reset(g3);
+
+ WriteDOC(g3->physaddr+DoC_G3_ChipID,g3->virtaddr,DoC_G3_ReadAddress);
+ chipId = ReadDOC_16(g3->virtaddr, DoC_G3_ChipID);
+ printk("Doc_G3: chip id=%x\n",chipId);
+ if(chipId != DoC_G3_ID) return -1;
+
+
+ printk("Starting flash stuff\n");
+
+ WriteDOC(g3->physaddr+DoC_G3_ChipID,g3->virtaddr,DoC_G3_DeviceIdSelect);
+ WriteDOC(0x39,g3->virtaddr,DoC_G3_FlashCtrl);
+
+ printk("end\n");
+ return 0;
+}
+
+static void __exit cleanup_docg3(void)
+{
+ cdev_del(&g3->cdev);
+ unregister_chrdev_region(MKDEV(DOCG3_MAJOR,DOCG3_MINOR),1);
+}
+
+module_init(init_docg3);
+module_exit(cleanup_docg3);
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Thomas Cougnard ");
+MODULE_DESCRIPTION("Test modules for Diskonchip G3 device description\n");
diff --git a/kernel-2.6.33/arch/arm/mach-pxa/g900/g900.c b/kernel-2.6.33/arch/arm/mach-pxa/g900/g900.c
index f82aeee3..6eb9e79c 100755
--- a/kernel-2.6.33/arch/arm/mach-pxa/g900/g900.c
+++ b/kernel-2.6.33/arch/arm/mach-pxa/g900/g900.c
@@ -328,42 +328,12 @@ uhcrhda : 0x04001102 = 00000100 00000000 00001011 00000010
[ 494.563518] pxa27x_ohci_select_pmm write
[ 494.574646] uhcrhda: 0x04000b02
[
-
-
-
-
-
*/
-
-
-/******************************************************************************
- * USB Gadget (UDC)
- ******************************************************************************/
-
- static struct pxa2xx_udc_mach_info g900_udc_info __initdata = {
-// .udc_is_connected = is_usb_connected,
- .gpio_vbus = GPIO40_nUSB_DETECT,
-// .gpio_vbus = GPIO41_USB_P2_7,
-// .gpio_pullup = GPIO93_USB_ENABLE,
- .gpio_pullup = GPIO75_USB_ENABLE,
-// .udc_command = g900_udc_command,
-};
-
-
-struct gpio_vbus_mach_info gpio_vbus_data = {
- .gpio_vbus = GPIO40_nUSB_DETECT,
- .gpio_vbus_inverted = 1,
- .gpio_pullup = -1,
-};
-
-
static void __init usb_init(void)
{
printk(KERN_INFO "pxa_set_ohci_info\n");
pxa_set_ohci_info(&g900_ohci_platform_data);
- printk(KERN_INFO "pxa_set_udc_info\n");
- pxa_set_udc_info(&g900_udc_info);
}
@@ -583,7 +553,9 @@ static struct platform_device g900_button = {
static struct platform_device g900_pwr_button = {
.name = "g900-power-button",
};
-
+static struct platform_device g900_udc = {
+ .name = "g900-udc",
+};
static struct platform_device g900_sound = {
@@ -614,6 +586,17 @@ static struct platform_device wm9713_codec =
},
};
#endif
+
+/* Core Hardware Functions */
+
+struct platform_device g900_core = {
+ .name = "g900-core",
+ .id = 0,
+ .dev = {
+ .platform_data = NULL,
+ },
+};
+
static struct platform_device *g900_devices[] __initdata = {
&g900_keyboard,
&g900_button,
@@ -621,6 +604,8 @@ static struct platform_device *g900_devices[] __initdata = {
&g900_ts,
&pxa2xx_pcm,
&g900_sound,
+ &g900_core,
+ &g900_udc,
//&g900_flash,
};
diff --git a/kernel-2.6.33/arch/arm/mach-pxa/g900/g900_core.c b/kernel-2.6.33/arch/arm/mach-pxa/g900/g900_core.c
new file mode 100755
index 00000000..c4a3953a
--- /dev/null
+++ b/kernel-2.6.33/arch/arm/mach-pxa/g900/g900_core.c
@@ -0,0 +1,159 @@
+/* Core Hardware driver for G900
+ *
+ * Copyright (c) 2010 Angell Fear
+ *
+ * 2005-03-29 SDG Systems, LLC
+ * 2005-03-29 Todd Blumer Converted basic structure to support hx4700
+ * 2005-04-30 Todd Blumer Add IRDA code from H2200
+ */
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+
+
+
+static int g900_bootloader = 0; /* Is the stock G900 bootloader installed? */
+
+#ifdef CONFIG_PM
+
+void g900_pm_init(void);
+
+static int g900_suspend(struct platform_device *dev, pm_message_t state)
+{
+ /* Turn off external clocks here */
+
+ /* None =( */
+
+ /* Wake up enable. */
+ /* PWER : 0x80031209 = 10000000 00000011 00010010 00001001 */
+ PWER = PWER_GPIO0
+ | PWER_GPIO3 /* Power button */
+ | PWER_GPIO9 /* Keyboard open */
+ | PWER_GPIO12 /* SD detect */
+ | PWER_GPIO(16) | PWER_GPIO(17) /* gpio53 ??? */
+ | PWER_RTC;
+ /* Wake up on falling edge. */
+ /* PFER : 0x00001209 = 00000000 00000000 00010010 00001001 */
+ PFER = PWER_GPIO0
+ | PWER_GPIO3
+ | PWER_GPIO9
+ | PWER_GPIO12;
+
+ /* Wake up on rising edge. */
+ /* PRER : 0x00001200 = 00000000 00000000 00010010 00000000 */
+ PRER = PWER_GPIO9
+ | PWER_GPIO12;
+
+ /* 3.6864 MHz oscillator power-down enable */
+ /*
+ Universal
+PCFR = PCFR_OPDE | PCFR_PI2CEN | PCFR_GPROD | PCFR_GPR_EN;
+ g900
+PCFR : 0x000080b1 = 00000000 00000000 10000000 10110001
+ */
+ PCFR = PCFR_OPDE | PCFR_GPR_EN | PCFR_DC_EN | PCFR_RO;
+
+ /* htc universal
+ PGSR0 = 0x09088004;
+ PGSR1 = 0x00020002;
+ PGSR2 = 0x8001c000;
+ PGSR3 = 0x00106284;
+ */
+ PGSR0 = 0x08000000;
+ PGSR1 = 0x00158802;
+ PGSR2 = 0x00014000;
+ PGSR3 = 0x00600000;
+ PSLR = 0xcc000000;
+
+
+#if 0
+ /*
+ * If we're using bootldr and not the stock HTC bootloader,
+ * we want to wake up periodically to see if the charge is full while
+ * it is suspended. We do this with the OS timer 4 in the pxa270.
+ */
+ if (!g900_bootloader) {
+ OMCR4 = 0x4b; /* Periodic, self-resetting, 1-second timer */
+ OSMR4 = 5; /* Wake up bootldr after x seconds so it can
+ figure out what to do with the LEDs. */
+ OIER |= 0x10; /* Enable interrupt source for Timer 4 */
+ OSCR4 = 0; /* This starts the timer */
+ }
+#endif
+
+ return 0;
+}
+
+static int g900_resume(struct platform_device *dev)
+{
+
+ return 0;
+}
+#else
+# define g900_suspend NULL
+# define g900_resume NULL
+#endif
+
+static int
+g900_core_probe( struct platform_device *dev )
+{
+
+ printk( KERN_NOTICE "Toshiba G900 Core Hardware Driver\n" );
+
+ printk("Using stock Toshiba G900 first stage bootloader\n");
+ g900_bootloader = 1;
+
+ g900_pm_init();
+
+ return 0;
+}
+
+static int
+g900_core_remove( struct platform_device *dev )
+{
+
+ return 0;
+}
+
+static struct platform_driver g900_core_driver = {
+ .driver = {
+ .name = "g900-core",
+ },
+ .probe = g900_core_probe,
+ .remove = g900_core_remove,
+ .suspend = g900_suspend,
+ .resume = g900_resume,
+};
+
+static int __init
+g900_core_init( void )
+{
+ return platform_driver_register( &g900_core_driver );
+}
+
+
+static void __exit
+g900_core_exit( void )
+{
+ platform_driver_unregister( &g900_core_driver );
+}
+
+module_init( g900_core_init );
+module_exit( g900_core_exit );
+
+MODULE_AUTHOR("Angell Fear");
+MODULE_DESCRIPTION("Toshiba G900 Core Hardware Driver");
+MODULE_LICENSE("GPL");
+
diff --git a/kernel-2.6.33/arch/arm/mach-pxa/g900/g900_flash.c b/kernel-2.6.33/arch/arm/mach-pxa/g900/g900_flash.c
new file mode 100755
index 00000000..e617a6ff
--- /dev/null
+++ b/kernel-2.6.33/arch/arm/mach-pxa/g900/g900_flash.c
@@ -0,0 +1,363 @@
+
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+//#include
+#include
+#include
+#include
+
+
+#define DoC_G3_IO 0x0800
+
+#define DoC_G3_ChipID 0x1000
+#define DoC_G3_DeviceIdSelect 0x100a
+#define DoC_G3_Ctrl 0x100c
+
+#define DoC_G3_CtrlConfirm 0x1072
+#define DoC_G3_ReadAddress 0x101a
+#define DoC_G3_FlashSelect 0x1032
+#define DoC_G3_FlashCmd 0x1034
+#define DoC_G3_FlashAddr 0x1036
+#define DoC_G3_FlashCtrl 0x1038
+#define DoC_G3_Nop 0x103e
+
+#define DOC_MODE_RESET 0x0
+#define DOC_MODE_NORMAL 0x1
+#define DOC_MODE_MDWREN 0x4
+
+
+#define DoC_G3_ID 0x200
+
+#define CMD_FLASH_RESET 0xff
+#define DoC_G3_IOREMAP_LEN 0x8000
+
+static unsigned long doc_config_location = 0x00000000;
+
+#define LOG_TAG "DOC: "
+#define dprintk(x...) printk(LOG_TAG x)
+
+#define DOCG3_MAJOR 254
+#define DOCG3_MINOR 0
+
+int major,minor;
+#define SECTOR_SIZE 0x200
+#define NUM_SECTOR 0xffff
+#define CHIP_SIZE (0xffff*0x100)
+
+module_param(doc_config_location, ulong, 0);
+MODULE_PARM_DESC(doc_config_location, "Physical memory address at which to probe for DiskOnChipG3");
+
+#define ReadDOC(adr,reg) ((unsigned char)(*(volatile __u32 *)(((unsigned long)adr)+((reg)))))
+#define ReadDOC_16(adr,reg) ((__u16)(*(volatile __u32 *)(((unsigned long)adr)+((reg)))))
+#define ReadDOC_32(adr,reg) ((__u32)(*(volatile __u32 *)(((unsigned long)adr)+((reg)))))
+#define WriteDOC(d, adr, reg) do{ *(volatile __u16 *)(((unsigned long)adr)+((reg))) = (__u16)d; wmb();} while(0)
+#define WriteDOC_8(d, adr, reg) do{ *(volatile unsigned char *)(((unsigned long)adr)+((reg))) = (unsigned char)d; wmb();} while(0)
+
+
+struct doc_g3_dev {
+ void __iomem *virtaddr;
+ unsigned long physaddr;
+
+ struct cdev cdev;
+};
+struct doc_g3_dev *g3;
+static void docg3_nop(struct doc_g3_dev *g3) {
+ WriteDOC(0xff,g3->virtaddr,DoC_G3_Nop);
+}
+
+
+static void docg3_wait_flash_completion(struct doc_g3_dev *g3) {
+ __u32 c;
+ int i=0;
+ docg3_nop(g3);
+ docg3_nop(g3);
+ docg3_nop(g3);
+ docg3_nop(g3);
+ /* Prepare read */
+ WriteDOC(g3->physaddr+DoC_G3_FlashCtrl,g3->virtaddr,DoC_G3_ReadAddress);
+ c =ReadDOC(g3->virtaddr,DoC_G3_FlashCtrl);
+ printk(LOG_TAG "docg3_wait_flash_completion ");
+ while(((c & 0x01) != 0x01) && (i++<300)) {
+ printk("%x(%x) ",c,c<<31);
+ c =ReadDOC(g3->virtaddr,DoC_G3_FlashCtrl);
+ }
+ printk("\n");
+}
+
+static void docg3_flash_select(struct doc_g3_dev *g3,unsigned char f) {
+ WriteDOC(f,g3->virtaddr,DoC_G3_FlashSelect);
+}
+
+static void docg3_flash_cmd(struct doc_g3_dev *g3,unsigned char c) {
+ WriteDOC(c,g3->virtaddr,DoC_G3_FlashCmd);
+ docg3_nop(g3);
+ docg3_nop(g3);
+}
+
+static void docg3_reset(struct doc_g3_dev *g3) {
+ WriteDOC( DOC_MODE_RESET|DOC_MODE_MDWREN,g3->virtaddr,DoC_G3_Ctrl);
+ WriteDOC(~( DOC_MODE_RESET|DOC_MODE_MDWREN),g3->virtaddr, DoC_G3_CtrlConfirm);
+
+
+ WriteDOC( DOC_MODE_NORMAL|DOC_MODE_MDWREN,g3->virtaddr,DoC_G3_Ctrl);
+ WriteDOC( ~(DOC_MODE_NORMAL|DOC_MODE_MDWREN),g3->virtaddr, DoC_G3_CtrlConfirm);
+
+}
+
+static void docg3_set_read_offset(struct doc_g3_dev *g3,unsigned char offset) {
+ WriteDOC_8(offset,g3->virtaddr,DoC_G3_FlashAddr);
+ docg3_nop(g3);
+}
+static void docg3_set_read_addr(struct doc_g3_dev *g3, unsigned int addr) {
+ unsigned char tmp;
+
+ tmp = (unsigned char) (addr & 0xFF);
+ //printk(LOG_TAG "%s: (%x,%x) %x ", __FUNCTION__,addr,offset,tmp);
+ WriteDOC_8(tmp,g3->virtaddr,DoC_G3_FlashAddr);
+
+ tmp = (unsigned char) ((addr>>8) & 0xFF);
+ printk(LOG_TAG "%x ",tmp);
+ WriteDOC_8(tmp,g3->virtaddr,DoC_G3_FlashAddr);
+
+ tmp = (unsigned char) ((addr>>16) & 0xFF);
+ printk(LOG_TAG "%x ",tmp);
+ WriteDOC_8(tmp,g3->virtaddr,DoC_G3_FlashAddr);
+ docg3_nop(g3);
+ //docg3_set_read_offset(g3,offset);
+ //printk("%x\n",offset);
+}
+
+static void docg3_enable_stuff(struct doc_g3_dev *g3) {
+ WriteDOC(0x8a0f,g3->virtaddr,0x1040);
+ docg3_nop(g3);
+ docg3_nop(g3);
+ docg3_nop(g3);
+ docg3_nop(g3);
+ docg3_nop(g3);
+}
+
+// Read the num the 512 bytes block of the chip flash
+static void docg3_read_sector(struct doc_g3_dev *g3,int chip,int num,unsigned int *buf) {
+ unsigned int tmp,i,addr;
+ addr= num%0x40 + 0x80*(num/0x40);
+ //printk("docg3_read_sector: %x %x %x\n",chip, num, addr);
+ do {
+ docg3_flash_select(g3,0x00);
+ docg3_flash_cmd(g3,CMD_FLASH_RESET);
+ docg3_wait_flash_completion(g3);
+
+ docg3_nop(g3);
+
+ docg3_flash_select(g3,0x09);
+ docg3_flash_cmd(g3,0xa2);
+ docg3_flash_cmd(g3,0x22);
+
+
+ docg3_flash_select(g3,0xe);
+ docg3_flash_cmd(g3,0);
+ docg3_flash_select(g3,0x12);
+ if((0x0|addr)==(0x40|addr)) printk(LOG_TAG "loop for %x\n",addr);
+
+ docg3_flash_cmd(g3,0x60);
+ docg3_set_read_addr(g3,0x0|addr);
+
+
+ docg3_flash_cmd(g3,0x60);
+ docg3_set_read_addr(g3,0x40|addr);
+
+
+ //docg3_set_read_addr(g3,0x80,0x80);
+ WriteDOC_8(g3->physaddr+DoC_G3_FlashCtrl,g3->virtaddr,DoC_G3_ReadAddress);
+ tmp = ReadDOC(g3->virtaddr,DoC_G3_FlashCtrl);
+ //printk("%x %x\n",tmp,tmp & 0x06);
+ } while(tmp & 0x06); //TODO: timeout
+
+ docg3_flash_cmd(g3,0x30);
+ docg3_wait_flash_completion(g3);
+ docg3_flash_cmd(g3,0x05);
+ if(addr & 1)
+ docg3_set_read_offset(g3,0x84); // second block ?
+ else
+ docg3_set_read_offset(g3,0x00); // second block ?
+
+ docg3_flash_cmd(g3,0xe0);
+ docg3_enable_stuff(g3);
+
+ WriteDOC(g3->physaddr+DoC_G3_IO,g3->virtaddr,DoC_G3_ReadAddress);
+
+ for(i=0;i<128;i++) {
+ tmp = ReadDOC_32(g3->virtaddr, DoC_G3_IO+4);
+ buf[i] = tmp;
+ }
+
+
+}
+
+int docg3_open(struct inode *inode, struct file *filp)
+{
+ printk(LOG_TAG "docg3_open\n");
+ //dev = container_of(inode->i_cdev, struct doc_g3_dev, cdev);
+ filp->private_data = g3; /* for other methods */
+
+ return 0; /* success */
+}
+
+int docg3_release(struct inode *inode, struct file *filp)
+{
+ printk(LOG_TAG "docg3_release\n");
+ return 0;
+}
+
+int docg3_ioctl(struct inode *inode, struct file *filp,
+ unsigned int cmd, unsigned long arg)
+{
+ return -ENOTTY;
+}
+
+ssize_t docg3_read(struct file *filp, char __user *buf, size_t count,
+ loff_t *f_pos)
+{
+ struct doc_g3_dev *dev = filp->private_data;
+ int block=0;
+ int chip=0;
+ int n=SECTOR_SIZE;
+ unsigned int buffer[128];
+ loff_t cur = filp->f_pos;
+ printk(LOG_TAG "docg3_read: %d offset: %llx\n",count,filp->f_pos);
+
+ //chip = ((unsigned int)filp->f_pos) / CHIP_SIZE; //todo
+ if(cur >= 0x4000000) {
+ printk(LOG_TAG "Failed for %llx %x\n",filp->f_pos,count);
+ return -EIO;
+ }
+ if((cur + count) > 0x4000000 ) {
+ printk(LOG_TAG "truncating %llx %x",cur,count);
+ count = 0x4000000 - cur;
+ printk(LOG_TAG " to %x\n",count);
+ }
+ // TODO:
+ // separate reques if over a chip change.
+ do {
+ block = (cur - chip * CHIP_SIZE) / SECTOR_SIZE;
+ printk(LOG_TAG "docg3_read: %x %x %x\n",chip,block,(( int)filp->f_pos));
+
+ //if(block> NUM_SECTOR) return -EFAULT;
+
+ docg3_read_sector(dev,chip,block,buffer);
+
+ if(count < SECTOR_SIZE) n = count;
+ if (copy_to_user(buf,buffer,n))
+ return -EFAULT;
+ printk(LOG_TAG "return %d (requested %d)\n",n,count);
+ *f_pos+=n;
+ count-=n;
+ buf +=n;
+ cur +=n;
+
+ }while (count >= SECTOR_SIZE );
+
+ return cur - filp->f_pos;
+
+
+}
+
+
+loff_t docg3_llseek(struct file *filp, loff_t off, int whence)
+{
+ loff_t newpos;
+ printk(LOG_TAG "docg3_seek\n");
+ switch(whence) {
+ case 0: /* SEEK_SET */
+ newpos = off;
+ break;
+
+ case 1: /* SEEK_CUR */
+ newpos = filp->f_pos + off;
+ break;
+
+ default:
+ return -EINVAL;
+ }
+ if (newpos < 0) return -EINVAL;
+ filp->f_pos = newpos;
+ return newpos;
+}
+
+
+struct file_operations docg3_fops = {
+ .owner = THIS_MODULE,
+ .llseek = docg3_llseek,
+ .read = docg3_read,
+ .ioctl = docg3_ioctl,
+ .open = docg3_open,
+ .release = docg3_release,
+};
+
+
+static int __init init_docg3(void)
+{
+ static struct doc_g3_dev s_g3;
+ unsigned int chipId;
+ int i;
+ dev_t dev=0;
+
+
+ register_chrdev(DOCG3_MAJOR,"docG3",&docg3_fops);
+ dev = MKDEV(DOCG3_MAJOR,DOCG3_MINOR);
+
+ g3=&s_g3;
+ g3->physaddr = doc_config_location;
+ g3->virtaddr = ioremap(g3->physaddr, DoC_G3_IOREMAP_LEN);
+ if(!g3->virtaddr ) {
+ printk(KERN_ERR LOG_TAG "DoC_G3 ioremap failed\n");
+ return -EIO;
+ }
+
+ print_hex_dump_bytes(LOG_TAG , DUMP_PREFIX_ADDRESS, g3->virtaddr, 0x2000);
+
+
+
+ //devfs_mk_cdev(dev, S_IFCHR|S_IRUSR|S_IWUSR|S_IRGRP,"DocG3");
+ cdev_init(&g3->cdev,&docg3_fops);
+ g3->cdev.owner= THIS_MODULE;
+ g3->cdev.ops = &docg3_fops;
+ i = cdev_add(&g3->cdev,MKDEV(DOCG3_MAJOR,DOCG3_MINOR),1);
+ if(i)
+ printk(LOG_TAG "cdev_add failed\n");
+
+ docg3_reset(g3);
+
+ WriteDOC(g3->physaddr+DoC_G3_ChipID,g3->virtaddr,DoC_G3_ReadAddress);
+ chipId = ReadDOC_16(g3->virtaddr, DoC_G3_ChipID);
+ printk(LOG_TAG "Doc_G3: chip id=%x\n",chipId);
+ if(chipId != DoC_G3_ID) return -1;
+
+
+ printk(LOG_TAG "Starting flash stuff\n");
+
+ WriteDOC(g3->physaddr+DoC_G3_ChipID,g3->virtaddr,DoC_G3_DeviceIdSelect);
+ WriteDOC(0x39,g3->virtaddr,DoC_G3_FlashCtrl);
+
+ printk(LOG_TAG "end\n");
+ return 0;
+}
+
+static void __exit cleanup_docg3(void)
+{
+ cdev_del(&g3->cdev);
+ unregister_chrdev_region(MKDEV(DOCG3_MAJOR,DOCG3_MINOR),1);
+}
+
+module_init(init_docg3);
+module_exit(cleanup_docg3);
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Thomas Cougnard ");
+MODULE_DESCRIPTION("Test modules for Diskonchip G3 device description\n");
diff --git a/kernel-2.6.33/arch/arm/mach-pxa/g900/g900_pm.c b/kernel-2.6.33/arch/arm/mach-pxa/g900/g900_pm.c
new file mode 100755
index 00000000..1545ab23
--- /dev/null
+++ b/kernel-2.6.33/arch/arm/mach-pxa/g900/g900_pm.c
@@ -0,0 +1,77 @@
+/*
+ *
+ * Copyright (C) 2010 Angell Fear
+ * Based on MyPal 716 power management support for the original HTC IPL in DoC G3
+ *
+ * Use consistent with the GNU GPL is permitted, provided that this
+ * copyright notice is preserved in its entirety in all copies and
+ * derived works.
+ *
+ * Copyright (C) 2005 Pawel Kolodziejski
+ *
+ */
+
+#include
+#include
+#include
+#include
+
+#include
+#include
+#include
+#include
+#include
+
+#ifdef CONFIG_PM
+
+static u32 *addr_a0040000;
+static u32 *addr_a0040004;
+static u32 *addr_a0040008;
+static u32 *addr_a004000c;
+
+#if 0
+static u32 save_a0040000;
+static u32 save_a0040004;
+static u32 save_a0040008;
+static u32 save_a004000c;
+
+static void g900_suspend(suspend_state_t state)
+{
+ save_a0040000 = *addr_a0040000;
+ save_a0040004 = *addr_a0040004;
+ save_a0040008 = *addr_a0040008;
+ save_a004000c = *addr_a004000c;
+
+ /* jump to PSPR */
+ *addr_a0040000 = 0xe3a00101; // mov r0, #0x40000000
+ *addr_a0040004 = 0xe380060f; // orr r0, r0, #0x0f000000
+ *addr_a0040008 = 0xe3800008; // orr r0, r0, #8
+ *addr_a004000c = 0xe590f000; // ldr pc, [r0]
+}
+
+static void g900_pm_resume(void)
+{
+ *addr_a0040000 = save_a0040000;
+ *addr_a0040004 = save_a0040004;
+ *addr_a0040008 = save_a0040008;
+ *addr_a004000c = save_a004000c;
+}
+
+#endif
+
+static struct platform_suspend_ops g900_pm_ops = {
+ .prepare = pxa_pm_prepare,
+ .finish = pxa_pm_finish,
+ .enter = pxa_pm_enter,
+ .valid = suspend_valid_only_mem,
+};
+
+
+void g900_pm_init(void) {
+ addr_a0040000 = phys_to_virt(0xa0040000);
+ addr_a0040004 = phys_to_virt(0xa0040004);
+ addr_a0040008 = phys_to_virt(0xa0040008);
+ addr_a004000c = phys_to_virt(0xa004000c);
+ suspend_set_ops(&g900_pm_ops);
+}
+#endif /* CONFIG_PM */
diff --git a/kernel-2.6.33/arch/arm/mach-pxa/g900/g900_udc.c b/kernel-2.6.33/arch/arm/mach-pxa/g900/g900_udc.c
new file mode 100755
index 00000000..cde27c97
--- /dev/null
+++ b/kernel-2.6.33/arch/arm/mach-pxa/g900/g900_udc.c
@@ -0,0 +1,260 @@
+#include
+#include
+#include
+#include
+
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+
+static int g900_udc_is_connected(void)
+{
+ printk("g900_udc_is_connected = %d\n", gpio_get_value(GPIO40_nUSB_DETECT));
+ return (gpio_get_value(GPIO40_nUSB_DETECT) != 0);
+}
+
+static void g900_udc_command(int command)
+{
+ printk("g900_udc_command enter, command = %d\n", command);
+ switch (command)
+ {
+ case PXA2XX_UDC_CMD_DISCONNECT:
+ break;
+ case PXA2XX_UDC_CMD_CONNECT:
+ break;
+ default:
+ printk("%s: unknown command '%d'.", __FUNCTION__, command);
+ }
+}
+#if 0
+struct gpio_vbus_mach_info gpio_vbus_data = {
+ .gpio_vbus = GPIO40_nUSB_DETECT,
+ .gpio_vbus_inverted = 1,
+ .gpio_pullup = -1,
+};
+#endif
+
+static struct pxa2xx_udc_mach_info g900_udc_info = {
+// .udc_is_connected = g900_udc_is_connected,
+ .gpio_vbus = GPIO40_nUSB_DETECT,
+// .gpio_vbus = GPIO41_USB_P2_7,
+// .gpio_pullup = GPIO93_USB_ENABLE,
+ .gpio_pullup = GPIO75_USB_ENABLE,
+// .udc_command = g900_udc_command,
+};
+
+
+
+
+
+
+//################################
+
+#ifdef CONFIG_USB_ANDROID
+#include
+
+static char *usb_functions_ums[] = {
+ "usb_mass_storage",
+};
+
+static char *usb_functions_ums_adb[] = {
+ "usb_mass_storage",
+ "adb",
+};
+
+static char *usb_functions_rndis[] = {
+ "rndis",
+};
+
+static char *usb_functions_rndis_adb[] = {
+ "rndis",
+ "adb",
+};
+
+#ifdef CONFIG_USB_ANDROID_DIAG
+static char *usb_functions_adb_diag[] = {
+ "usb_mass_storage",
+ "adb",
+ "diag",
+};
+#endif
+
+static char *usb_functions_all[] = {
+#ifdef CONFIG_USB_ANDROID_RNDIS
+ "rndis",
+#endif
+#ifdef CONFIG_USB_ANDROID_MASS_STORAGE
+ "usb_mass_storage",
+#endif
+#ifdef CONFIG_USB_ANDROID_ADB
+ "adb",
+#endif
+#ifdef CONFIG_USB_ANDROID_ACM
+ "acm",
+#endif
+#ifdef CONFIG_USB_ANDROID_DIAG
+ "diag",
+#endif
+};
+
+static struct android_usb_product usb_products[] = {
+ {
+ .product_id = 0x4e11,
+ .num_functions = ARRAY_SIZE(usb_functions_ums),
+ .functions = usb_functions_ums,
+ },
+ {
+ .product_id = 0x4e12,
+ .num_functions = ARRAY_SIZE(usb_functions_ums_adb),
+ .functions = usb_functions_ums_adb,
+ },
+ {
+ .product_id = 0x4e13,
+ .num_functions = ARRAY_SIZE(usb_functions_rndis),
+ .functions = usb_functions_rndis,
+ },
+ {
+ .product_id = 0x4e14,
+ .num_functions = ARRAY_SIZE(usb_functions_rndis_adb),
+ .functions = usb_functions_rndis_adb,
+ },
+#ifdef CONFIG_USB_ANDROID_DIAG
+ {
+ .product_id = 0x4e17,
+ .num_functions = ARRAY_SIZE(usb_functions_adb_diag),
+ .functions = usb_functions_adb_diag,
+ },
+#endif
+};
+
+static struct usb_mass_storage_platform_data mass_storage_pdata = {
+ .nluns = 1,
+ .vendor = "Google, Inc.",
+ .product = "Nexus One",
+ .release = 0x0100,
+};
+
+static struct platform_device usb_mass_storage_device = {
+ .name = "usb_mass_storage",
+ .id = -1,
+ .dev = {
+ .platform_data = &mass_storage_pdata,
+ },
+};
+
+#ifdef CONFIG_USB_ANDROID_RNDIS
+static struct usb_ether_platform_data rndis_pdata = {
+ /* ethaddr is filled by board_serialno_setup */
+ .vendorID = 0x18d1,
+ .vendorDescr = "Google, Inc.",
+};
+
+static struct platform_device rndis_device = {
+ .name = "rndis",
+ .id = -1,
+ .dev = {
+ .platform_data = &rndis_pdata,
+ },
+};
+#endif
+
+static struct android_usb_platform_data android_usb_pdata = {
+ .vendor_id = 0x18d1,
+ .product_id = 0x4e11,
+ .version = 0x0100,
+ .product_name = "Nexus One",
+ .manufacturer_name = "Google, Inc.",
+ .num_products = ARRAY_SIZE(usb_products),
+ .products = usb_products,
+ .num_functions = ARRAY_SIZE(usb_functions_all),
+ .functions = usb_functions_all,
+};
+
+static struct platform_device android_usb_device = {
+ .name = "android_usb",
+ .id = -1,
+ .dev = {
+ .platform_data = &android_usb_pdata,
+ },
+};
+
+
+static struct platform_device *g900_udc_devices[] __initdata = {
+#ifdef CONFIG_USB_ANDROID_MASS_STORAGE
+ &usb_mass_storage_device,
+#endif
+#ifdef CONFIG_USB_ANDROID_RNDIS
+ &rndis_device,
+#endif
+ &android_usb_device,
+};
+
+void __init add_usb_devices(void)
+{
+
+ platform_add_devices(g900_udc_devices,ARRAY_SIZE(g900_udc_devices));
+
+}
+
+
+
+
+
+#endif
+
+//#############################
+
+
+
+
+static int g900_udc_probe(struct platform_device *pdev)
+{
+ printk("******Probing Toshiba g900 UDC*****\n");
+ pxa_set_udc_info(&g900_udc_info);
+ return 0;
+}
+
+static int g900_udc_remove(struct platform_device *pdev)
+{
+ return 0;
+}
+
+static struct platform_driver g900_udc_driver = {
+ .driver = {
+ .name = "g900-udc",
+ },
+ .probe = g900_udc_probe,
+ .remove = g900_udc_remove,
+ //.suspend = g900_udc_suspend,
+ //.resume = g900_udc_resume,
+};
+
+static int __init g900_udc_init(void)
+{
+ if (!machine_is_g900()) return -ENODEV;
+ platform_driver_register(&g900_udc_driver);
+#ifdef CONFIG_USB_ANDROID
+ add_usb_devices();
+#endif
+ return 0;
+
+}
+
+static void __exit g900_udc_exit(void)
+{
+ return;
+}
+
+module_init(g900_udc_init);
+module_exit(g900_udc_exit);
+
+MODULE_AUTHOR("Xiao Huang BDevGetProperty( BDevHandle, pBDevProp )
+
+/** Initializes the SD device and run-time support structure.
+ @param BDevHandle (#GFBDevHandle) Handle to the Block Device API
+ @param pDrvInfo (#GFDRV_INFO) run-time support struct
+
+ This creates and assigns a #GFDRV_INFO into
+ the given BDevHandle (actually a #BDEVSDTABLE).
+ Read and Write functions are assinged into the #GFDRV_INFO which
+ should be used by higher-level file systems to access the SD
+ device.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Error
+ */
+#define GFBDevMount( BDevHandle, pDrvInfo ) \
+ ((PGFBDEVTABLE)BDevHandle)->BDevMount( BDevHandle, pDrvInfo )
+
+/** Uninitializes the SD device.
+ @param BDevHandle (#GFBDevHandle) Handle to the Block Device API
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Error
+ */
+#define GFBDevUnmount( BDevHandle ) \
+ ((PGFBDEVTABLE)BDevHandle)->BDevUnmount( BDevHandle )
+
+/*@}*/
+/*@}*/
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* GF_BDEV_H */
+
diff --git a/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFBitmap.h b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFBitmap.h
new file mode 100755
index 00000000..22286e00
--- /dev/null
+++ b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFBitmap.h
@@ -0,0 +1,45 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/*
+ * File: GFBitmap.h
+ * GFSDK Bitmap header file.
+ */
+
+
+#ifndef __GFBITMAP_H__
+#define __GFBITMAP_H__
+
+/* Bitmap Color Format - Follow Surface Format GF_SURFACE_xxx */
+#define GF_BITMAP_YUV420 0x00000001
+#define GF_BITMAP_YUV422 0x00000002
+#define GF_BITMAP_YUYV (GF_BITMAP_YUV422|0x00000004)
+#define GF_BITMAP_YVYU (GF_BITMAP_YUV422|0x00000008)
+#define GF_BITMAP_UYVY (GF_BITMAP_YUV422|0x00000010)
+#define GF_BITMAP_VYUY (GF_BITMAP_YUV422|0x00000020)
+#define GF_BITMAP_MPEGDEC (GF_BITMAP_YUV420|0x00000040)
+#define GF_BITMAP_RGB565 0x00010000
+#define GF_BITMAP_RGB8 0x00070000
+#define GF_BITMAP_ARGB8888 0x00030000
+#define GF_BITMAP_ARGB6666 0x000F0000
+
+/* Bitmap */
+typedef struct _GFBITMAP
+{
+ NvU16 width;
+ NvU16 height;
+ NvS32 stride;
+ NvU32 format;
+ NvU8 bpp; // Bits per pixel
+ NvU8 reserved;
+ NvU16 offset; // Offset from beginning of bitmap to data
+ NvU8 data; // Real data starts from "Offset" location
+} GFBITMAP, *PGFBITMAP;
+
+#endif /* __GFBITMAP_H__ */
diff --git a/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFCamera.h b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFCamera.h
new file mode 100755
index 00000000..f7730b5a
--- /dev/null
+++ b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFCamera.h
@@ -0,0 +1,367 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/** @file GFCamera.h
+ GFSDK Camera API header file.
+*/
+
+#ifndef __CAMERA_H__
+#define __CAMERA_H__
+
+#include "GF.h"
+#include "GFVx.h"
+#include "GFCameraScr.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+/** @addtogroup groupCamera CameraAPI Camera API
+
+ @ref pageCameraAppNotes
+
+ @ref pageCameraAppNotes1
+
+
+*/
+/*@{*/
+
+
+/* Helper Macros - Do not assume bytes are properly aligned! */
+#ifndef MAKENvU8S16
+#define MAKENvU8S16( data16 ) \
+ (NvU8)((data16) & 0xFF), (NvU8)(((data16) >> 8) & 0xFF)
+#endif /* MAKENvU8S16 */
+#ifndef MAKENvU8S32
+#define MAKENvU8S32( data32 ) \
+ (NvU8)((data32) & 0xFF), \
+ (NvU8)(((data32) >> 8) & 0xFF), \
+ (NvU8)(((data32) >> 16) & 0xFF), \
+ (NvU8)(((data32) >> 24) & 0xFF)
+#endif /* MAKENvU8S32 */
+#ifndef MAKE16
+#define MAKE16( ptr ) \
+ ((NvU16)(*ptr) | ((NvU16)(*(ptr+1)) << 8))
+#endif /* MAKE16 */
+#ifndef MAKE32
+#define MAKE32( ptr ) \
+ ((NvU32)MAKE16( ptr ) | (NvU32)MAKE16( (ptr+2) ) << 16)
+#endif /* MAKE32 */
+
+/* GFCAMERA instruction (special) */
+#define GFCAMERA_NONE 0x00
+#define GFCAMERA_NORMAL_WRITE 0x01
+#define GFCAMERA_DELAY_MSEC 0x02
+#define GFCAMERA_NEED_MCLOCK 0x03
+
+/* GFCameraSetResolution Options */
+#define GFCAMERA_POWERON_OPTION 0x00000001
+
+/* GFCAMERA Error codes */
+#define GFCAM_ERROR_ILLEGAL_PARAMETER (GFCAM_ERROR | 0x00000001L)
+#define GFCAM_ERROR_ALLOC_FAILED (GFCAM_ERROR | 0x00000002L)
+#define GFCAM_ERROR_VM_ALLOC_FAILED (GFCAM_ERROR | 0x00000003L)
+#define GFCAM_ERROR_SCRIPT_ACCESS_FAILED (GFCAM_ERROR | 0x00000004L)
+#define GFCAM_ERROR_NATIVE_FUNCTION_FAILED (GFCAM_ERROR | 0x00000005L)
+#define GFCAM_ERROR_GETTING_COMPONENT (GFCAM_ERROR | 0x00000006L)
+#define GFCAM_ERROR_VM_BUFFER_ALLOC_FAILED (GFCAM_ERROR | 0x00000007L)
+#define GFCAM_ERROR_CAMERA_SCRIPT_NOT_PRESENT (GFCAM_ERROR | 0x00000008L)
+#define GFCAM_ERROR_FUNCTION_NOT_SUPPORTED (GFCAM_ERROR | 0x00000009L)
+
+/* GFCAMERAINSTRTYPE */
+typedef struct _GFCAMERAINSTRTYPE
+{
+ NvU16 skip; // IMPORTANT: Multiple instructions
+ // must be in ascending skip order
+ NvU8 type;
+ NvU16 size;
+ NvU32 data;
+} GFCAMERAINSTRTYPE, *PGFCAMERAINSTRTYPE;
+
+/* GFCAMERABAYERINFO - BayerInfo struct */
+typedef struct _GFCAMERABAYERINFO
+{
+ NvU16 ScanWidth;
+ NvU16 ScanHeight;
+
+ NvU16 ActiveLineStart;
+ NvU16 ActiveLineWidth;
+ NvU16 ActiveFrameStart;
+ NvU16 ActiveFrameHeight;
+ NvU8 hSyncEdge;
+ NvU8 vSyncEdge;
+ NvU16 bayerSel;
+
+} GFCAMERABAYERINFO, *PGFCAMERABAYERINFO;
+
+/* GFCAMERARESOLUTIONTYPE - Resolution struct */
+typedef struct _GFCAMERARESOLUTIONTYPE
+{
+ NvU16 x;
+ NvU16 y;
+ NvU8 numInstr;
+ GFCAMERAINSTRTYPE *pInstr;
+ GFCAMERABAYERINFO *pBayerInfo;
+} GFCAMERARESOLUTIONTYPE, *PGFCAMERARESOLUTIONTYPE;
+
+
+
+/* GFCAMERATABLETYPE - Camera Table */
+#define GFCAMERA_NAME_SIZE 32
+typedef struct _GFCAMERATABLETYPE
+{
+ NvU16 id;
+ NvU16 ver;
+ NvU32 scriptSubID;
+ char name[GFCAMERA_NAME_SIZE];
+ // variable name char string always
+ // ends with a '0'
+ NvU32 VIPFlag;
+ NvU32 VIPNewTiming;
+ NvU32 VIPColorFormat;
+ NvU8 VIPHOffset;
+ NvU8 VIPVOffset;
+ NvU8 numI2CBytes; //bytes per transfer/packet
+ NvU8 numRes;
+ GFCAMERARESOLUTIONTYPE *pResData;
+ NvU16 initDataSize;
+ NvU8 *pInitData;
+// GFCAMERABAYERINFO *pBayerInfo;
+ struct _GFCAMERATABLETYPE *pNext;
+} GFCAMERATABLETYPE, *PGFCAMERATABLETYPE;
+
+// Typesafe functions for opening and closing this component
+GF_RETTYPE GFCameraOpen(GFRmHandle hRm, GFCameraHandle *phCamera,
+ GF_STATE_TYPE state, GFRmChHandle hCh);
+void GFCameraClose(GFCameraHandle *phCamera);
+
+/** This routine returns the camera's properties and capabilities.
+ These properties are returned in the GFPROPERTY structure.
+
+ @param CameraHandle (#GFCameraHandle) Handle to CameraAPI
+ @param pProp (PGFPROPERTY) Pointer to GFPROPERTY structure.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ @see GFPROPERTY
+*/
+GF_RETTYPE GFCameraGetProperty(GFCameraHandle CameraHandle,
+ PGFPROPERTY pProp);
+
+/** This routine programs the camera's registers based on the data
+ contained in the camera table.
+
+ @param CameraHandle (#GFCameraHandle) Handle to CameraAPI
+ @param pCamera (PGFCAMERATABLETYPE) Pointer to camera entry.
+ @param resX (NvU16) Horizontal resolution
+ @param resY (NvU16) Vertical resolution
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ @see PGFCAMERATABLETYPE
+*/
+GF_RETTYPE GFCameraSetup(GFCameraHandle CameraHandle,
+ PGFCAMERATABLETYPE pCamera,
+ NvU16 resX,
+ NvU16 resY );
+
+/** This routine programs the camera's registers for a resolution change.
+ The main difference from GFCameraSetup() is the lack of camera power on.
+
+ @param CameraHandle (#GFCameraHandle) Handle to CameraAPI
+ @param pCamera (PGFCAMERATABLETYPE) Pointer to camera entry.
+ @param resX (NvU16) Horizontal resolution
+ @param resY (NvU16) Vertical resolution
+ @param poweron (NvU32) flag indicates whether camera power on should be executed
+ @param option (NvU32) flag passed to camera script SetResolution function
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ @see PGFCAMERATABLETYPE
+*/
+GF_RETTYPE GFCameraSetResolution(GFCameraHandle CameraHandle,
+ PGFCAMERATABLETYPE pCamera,
+ NvU16 resX,
+ NvU16 resY,
+ NvU32 poweron,
+ NvU32 option);
+
+/** This routine allocates the run-time camera table structure from the
+ camera scripts.
+
+ @param CameraHandle (#GFCameraHandle) Handle to CameraAPI
+ @param *pTable (NvU8) Pointer to camera configuration table, ignored for GFSDK SC15.
+ Camera configurations are passed via scripts.
+ @param *ppCamera (PGFCAMERATABLETYPE) Returns pointer to linked list of camera description tables
+
+ @return On success the number of cameras in the linked list is returned. This can be 0.
+ On failure an error code is returned. To distinguish between success and failure,
+ use macro #ISGFERROR() or #ISGFSUCCESS().
+
+ @see PGFCAMERATABLETYPE
+*/
+GF_RETTYPE GFCameraTableAlloc(GFCameraHandle CameraHandle,
+ NvU8 *pTable,
+ PGFCAMERATABLETYPE *ppCamera);
+
+/** This routine frees the camera table structure created by
+ GFCameraTableAlloc().
+
+ @param CameraHandle (#GFCameraHandle) Handle to CameraAPI
+ @param *ppCamera (PGFCAMERATABLETYPE) Pointer to camera entry.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ @see PGFCAMERATABLETYPE
+*/
+GF_RETTYPE GFCameraTableFree(GFCameraHandle CameraHandle,
+ PGFCAMERATABLETYPE *ppCamera);
+
+GF_RETTYPE GFCameraTableDump(GFCameraHandle CameraHandle,
+ PGFCAMERATABLETYPE pCamera);
+
+/** This routine finds a camera that is contained in the camera table structure.
+ It does so using various parameters that refer to entries in the table.
+
+ @param CameraHandle (#GFCameraHandle) Handle to CameraAPI
+ @param *pCamera (PGFCAMERATABLETYPE) Pointer to camera entry.
+ @param *pWanted (PGFCAMERATABLETYPE) Pointer to the found PGFCAMERATABLETYPE structure.
+ @param id (NvU32) Unique I2C slave ID for the camera.
+ @param *name (Char) pointer to name.
+ @param resX (NvU16) Horizontal resolution
+ @param resY (NvU16) Vertical resolution
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+*/
+GF_RETTYPE GFCameraFind(GFCameraHandle CameraHandle,
+ PGFCAMERATABLETYPE pCamera,
+ PGFCAMERATABLETYPE *pWanted,
+ NvU32 id,
+ char *name,
+ NvU16 resX,
+ NvU16 resY );
+
+/** This routine scans for a camera that is contained in the
+ table structure created by GFCameraTableAlloc().
+
+ @param CameraHandle (#GFCameraHandle) Handle to CameraAPI
+ @param *pTable (NvU8) Pointer to camera table.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+*/
+GF_RETTYPE GFCameraScan(GFCameraHandle CameraHandle,
+ PGFCAMERATABLETYPE pCamera);
+
+/** This routine uses the script subID parameter to find a camera
+ that is contained in the camera table structure.
+
+ @param CameraHandle (#GFCameraHandle) Handle to CameraAPI
+ @param *pCamera (PGFCAMERATABLETYPE) Pointer to camera entry.
+ @param *pWanted (PGFCAMERATABLETYPE) Pointer to the found PGFCAMERATABLETYPE structure.
+ @param subID (NvU32) Camera script subID.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+*/
+GF_RETTYPE GFCameraScriptFind(GFCameraHandle CameraHandle,
+ PGFCAMERATABLETYPE pCamera,
+ PGFCAMERATABLETYPE *pWanted,
+ NvU32 subID);
+
+/** This routine calls the camera script function to operate on a user defined
+ camera attribute. A shared buffer is used to pass parameters to and from
+ the camera script function.
+
+ The shared buffer and may contain data used by the script function
+ to perform the requested operation. The first data should indicate
+ the primary setting of the operation. The convention is to use ranges
+ that are normalized from 0 to 100. Where specific data is required,
+ that data must match that which is allowable by the camera in use.
+ If not, the error code GFCAM_ERROR_ILLEGAL_PARAMETER is returned.
+
+ The attribute may be one of the defined flags listed below.
+ GFCAMERA_CAMERACONTROL_PAN
+ GFCAMERA_CAMERACONTROL_TILT
+ GFCAMERA_CAMERACONTROL_ROLL
+ GFCAMERA_CAMERACONTROL_ZOOM
+ GFCAMERA_CAMERACONTROL_EXPOSURE
+ GFCAMERA_CAMERACONTROL_IRIS
+ GFCAMERA_CAMERACONTROL_FOCUS
+ GFCAMERA_CAMERACONTROL_FLASH
+ GFCAMERA_VIDEOPROCAMP_BRIGHTNESS
+ GFCAMERA_VIDEOPROCAMP_CONTRAST
+ GFCAMERA_VIDEOPROCAMP_HUE
+ GFCAMERA_VIDEOPROCAMP_SATURATION
+ GFCAMERA_VIDEOPROCAMP_SHARPNESS
+ GFCAMERA_VIDEOPROCAMP_GAMMA
+ GFCAMERA_VIDEOPROCAMP_COLORENABLE
+ GFCAMERA_VIDEOPROCAMP_WHITEBALANCE
+ GFCAMERA_VIDEOPROCAMP_BACKLIGHT_COMPENSATION
+ GFCAMERA_VIDEOPROCAMP_GAIN
+
+
+ @param CameraHandle (#GFCameraHandle) Handle to CameraAPI
+ @param *pCamera (PGFCAMERATABLETYPE) Pointer to camera entry.
+ @param attribute (NvU32) Attribute flag indicates operation.
+ @param *sharedBuffer (NvU32) pointer to a shared buffer.
+ @param bufferSize (NvU32) Size of shared buffer.
+ @param *readValue (NvU32) pointer to the returned value from the camera script function.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+ @retval #GFCAM_ERROR_FUNCTION_NOT_SUPPORTED Attribute not supported
+ @retval #GFCAM_ERROR_ILLEGAL_PARAMETER Parameter out of range
+
+*/
+GF_RETTYPE GFCameraScriptSetAttribute(GFCameraHandle CameraHandle,
+ PGFCAMERATABLETYPE pCamera,
+ NvU32 attribute,
+ NvU32 *sharedBuffer,
+ NvU32 bufferSize,
+ NvU32 *readValue);
+
+/** This routine uses the camera script function to execute a powerup or
+ powerdown sequence.
+
+ @param CameraHandle (#GFCameraHandle) Handle to CameraAPI
+ @param *pCamera (PGFCAMERATABLETYPE) Pointer to camera entry.
+ @param poweron (NvU32) If set to '0' execute powerdown, if '1', execute powerup.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+*/
+GF_RETTYPE GFCameraPower(GFCameraHandle CameraHandle,
+ PGFCAMERATABLETYPE pCamera,
+ NvU32 poweron);
+
+/*@}*/
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+/** @page pageCameraAppNotes CameraAPI Application Notes
+
+ @section pageCameraAppNotes1 Todo
+
+*/
+
+#endif /* __CAMERA_H__ */
+
diff --git a/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFCameraScr.h b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFCameraScr.h
new file mode 100755
index 00000000..b34eb21b
--- /dev/null
+++ b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFCameraScr.h
@@ -0,0 +1,40 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+#if !defined (__GFCAMERASCR_INC__)
+#define __GFCAMERASCR_INC__
+
+/* Camera Script error codes */
+#define GFCAMERA_NOT_SUPPORTED 0x80000000 //return error code for attribute
+#define GFCAMERA_PARAMETER_ERROR 0x80000001 //return out of range parameter
+
+/** Camera script attribute flags, for camera control functions
+ @see GFCameraScriptSetAttribute()
+*/
+#define GFCAMERA_CAMERACONTROL_PAN 0x00000001
+#define GFCAMERA_CAMERACONTROL_TILT 0x00000002
+#define GFCAMERA_CAMERACONTROL_ROLL 0x00000003
+#define GFCAMERA_CAMERACONTROL_ZOOM 0x00000004
+#define GFCAMERA_CAMERACONTROL_EXPOSURE 0x00000005
+#define GFCAMERA_CAMERACONTROL_IRIS 0x00000006
+#define GFCAMERA_CAMERACONTROL_FOCUS 0x00000007
+#define GFCAMERA_CAMERACONTROL_FLASH 0x00000008
+#define GFCAMERA_VIDEOPROCAMP_BRIGHTNESS 0x00000009
+#define GFCAMERA_VIDEOPROCAMP_CONTRAST 0x0000000a
+#define GFCAMERA_VIDEOPROCAMP_HUE 0x0000000b
+#define GFCAMERA_VIDEOPROCAMP_SATURATION 0x0000000c
+#define GFCAMERA_VIDEOPROCAMP_SHARPNESS 0x0000000d
+#define GFCAMERA_VIDEOPROCAMP_GAMMA 0x0000000e
+#define GFCAMERA_VIDEOPROCAMP_COLORENABLE 0x0000000f
+#define GFCAMERA_VIDEOPROCAMP_WHITEBALANCE 0x00000010
+#define GFCAMERA_VIDEOPROCAMP_BACKLIGHT_COMPENSATION 0x00000011
+#define GFCAMERA_VIDEOPROCAMP_GAIN 0x00000012
+
+#endif
+
diff --git a/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFDef.h b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFDef.h
new file mode 100755
index 00000000..c7a9df55
--- /dev/null
+++ b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFDef.h
@@ -0,0 +1,254 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/*
+ * File: GFDef.h
+ * GFSDK Definition header file
+ */
+
+#ifndef __GFDEF_H__
+#define __GFDEF_H__
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+#include "GFDefScr.h"
+
+/* Register field manipulation using xxx_RANGE macros defined in hardware
+ * header files.
+ */
+#define GF_LOWBIT(x) (0?x)
+#define GF_HIGHBIT(x) (1?x)
+#define GF_SIZE(x) (GF_HIGHBIT(x)-GF_LOWBIT(x)+1)
+#define GF_SHIFT(x) ((0?x)%32)
+#define GF_MASK(x) (0xFFFFFFFFUL>>(31-((1?x)%32)+((0?x)%32)))
+#define GF_BITS(val, x) (((val) & GF_MASK(x))<> GF_SHIFT(d##_##r##_0_##f##_RANGE))& GF_MASK(d##_##r##_0_##f##_RANGE))
+
+#define GF_FLD_SET_DRF_NUM(d,r,f,n,v) ((v & ~GF_SHIFTMASK(d##_##r##_0_##f##_RANGE)) | GF_DRF_NUM(d,r,f,n))
+#define GF_FLD_SET_DRF_DEF(d,r,f,c,v) (((v) & ~GF_SHIFTMASK(d##_##r##_0_##f##_RANGE)) | GF_DRF_DEF(d,r,f,c))
+
+#define GF_RESETVAL(d,r) (d##_##r##_0_RESET_VAL)
+
+#define OP_DRF_DEF(o,f,c) ((o##_##f##_##c) << GF_SHIFT(o##_##f##_RANGE))
+#define OP_DRF_NUM(o,f,n) (((n)& GF_MASK(o##_##f##_RANGE))<< GF_SHIFT(o##_##f##_RANGE))
+#define OP_DRF_VAL(o,f,v) (((v)>> GF_SHIFT(o##_##f##_RANGE))& GF_MASK(o##_##f##_RANGE))
+
+#define OP_FLD_SET_DRF_NUM(o,f,n,v) ((v & ~GF_SHIFTMASK(o##_##f##_RANGE)) | GF_DRF_NUM(o,f,n))
+#define OP_FLD_SET_DRF_DEF(o,f,c,v) (((v) & ~GF_SHIFTMASK(o##_##f##_RANGE)) | GF_DRF_DEF(o,f,c))
+
+/* Default Return Codes */
+/* - All errors has MSB set, indicate a negative val. */
+
+/** Macro to test if an error code of type GF_RETTYPE signals failure.
+ @param code (GF_RETTYPE) Error code
+ @return Evaluates to \a true on failure, \a false on success.
+*/
+#define ISGFERROR(code) ((GF_RETTYPE)(code) < GF_SUCCESS)
+
+/** Macro to test if an error code of type GF_RETTYPE signals success.
+ @param code (GF_RETTYPE) Error code
+ @return Evaluates to \a true on success, \a false on failure.
+*/
+#define ISGFSUCCESS(code) ((GF_RETTYPE)(code) >= GF_SUCCESS)
+
+/** Common error code: Generic error. */
+#define GF_ERROR 0x80000000L
+/** Common error code: Success (not an error). */
+#define GF_SUCCESS 0x00000000L
+/** Common error code: Busy (not an error). */
+#define GF_ERROR_BUSY 0x80000001L
+/** Common error code: Out of memory. This can be CPU heap memory, or GPU memory. */
+#define GF_ERROR_OUT_MEMORY 0x80000003L
+/** Common error code: Bad parameter. */
+#define GF_ERROR_BAD_PARAMETER 0x80000005L
+
+
+#define GF_COMPONENT_ERROR_SHIFT 24
+/** Macro to reverse bits of the 7 bit component ID.
+ See GF_RETTYPE for explanation.
+*/
+#define GF_COMPONENT_REVERSE(c) ((((c)&64)>>6)|(((c)&32)>>4)|(((c)&16)>>2)|((c)&8)|(((c)&4)<<2)|(((c)&2)<<4)|(((c)&1)<<6))
+
+#define GX_ERROR (GF_COMPONENT_REVERSE(GF_GXAPI)<
+
+/** Utility macro */
+#define CHECK_STATUS_CLEANUP(f) \
+ do { \
+ if(ISGFERROR( ( status = (f) ) )) \
+ goto Cleanup; \
+ } while(0)
+
+
+
+#if !defined(NV_MODS)
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/*
+ * READ THIS FIRST:
+ *
+ * None of these funtions should be called directly by an application. The
+ * macros below should be used instead.
+ */
+
+/** Diag context structure */
+typedef struct _GFDIAGCONTEXT
+{
+ NvU32 processID;
+ NvU32 threadID;
+} GFDIAGCONTEXT, *PGFDIAGCONTEXT;
+
+
+/** Public exposed DIAG API functions in the table */
+typedef struct _GFDIAGTABLE
+{
+ /**
+ @see GF_DIAG_INITIALIZE
+ */
+ GF_RETTYPE ( *DiagInitialize)( GFDiagHandle DiagHandle, int argc, char **argv );
+
+ /**
+ @see GF_DIAG_GET_VERSION
+ */
+ GF_RETTYPE ( *DiagGetVersion)( GFDiagHandle DiagHandle, char *versionStr, int bufferLen );
+
+ /**
+ @see GF_DIAG_SET_RENDER_SURFACE
+ */
+ GF_RETTYPE ( *DiagSetRenderSurface)( GFDiagHandle DiagHandle, PGFRMSURFACE surface );
+
+ /**
+ @see GF_DIAG_SET_IDLE_CHIP_CALLBACK
+ */
+ GF_RETTYPE ( *DiagSetIdleChipCallback)( GFDiagHandle DiagHandle,
+ GF_RETTYPE (*pIdleCallback)(void *idleCallbackData), void *data );
+
+ /**
+ @see GF_DIAG_FRAME_DONE
+ */
+ GF_RETTYPE ( *DiagFrameDone)( GFDiagHandle DiagHandle );
+
+ /**
+ @see GF_DIAG_CLEANUP
+ */
+ GF_RETTYPE ( *DiagCleanup)( GFDiagHandle DiagHandle );
+
+ /**
+ @see GF_DIAG_RUN_TEST
+ */
+ GF_RETTYPE (* DiagRunTest)( GFDiagHandle DiagHandle, char *testName,
+ const char *pCmdLine, NvU8 flag, GFDiagHandle *pDiagChildHandle );
+
+ /**
+ @see GF_DIAG_WAIT_FOR_TEST
+ */
+ GF_RETTYPE (* DiagWaitForTest)( GFDiagHandle DiagHandle );
+
+ /**
+ @see GF_DIAG_PRINT
+ */
+ GF_RETTYPE (* DiagPrint)( GFDiagHandle DiagHandle, const char *msg );
+
+ /**
+ @see GF_DIAG_GET_CONTEXT
+ */
+ GF_RETTYPE (* DiagGetContext)( GFDiagHandle DiagHandle, GFDIAGCONTEXT *pContext );
+} GFDIAGTABLE, *PGFDIAGTABLE;
+
+/*
+*****************************************************************************
+* MACROS - Apps should use these to communicate with GFDiag
+*****************************************************************************
+*/
+
+// Function documentation goes here to bypass #ifdef problems
+
+/** @name Functions
+@{*/
+
+/** @def GF_DIAG_MAIN
+ Replace your standard definition of "int main" with with this macro
+ for use with GFDiag.
+
+ @param unused1 (int) Unused -- obsolete argument, to be removed
+ @param unused2 (char**) Unused -- obsolete argument, to be removed
+ @param testName (char*) Name of the test
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+*/
+
+/** @def GF_DIAG_INITIALIZE
+ Control things like storing vs checking, HW vs SW crcs via this function.
+
+ @param DiagHandle (#GFDiagHandle) Handle to Diag
+ @param argc (int) Argument count
+ @param argv (char**) Argument data
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ Will read in the stored CRCs if applicable.
+*/
+
+/** @def GF_DIAG_GET_VERSION
+ Query the GFDiag version.
+
+ @param DiagHandle (#GFDiagHandle) Handle to Diag
+ @param str (char*) Pointer to a buffer that will be filled with the GFDiag version
+ @param len (int) Length of the buffer, versionStr
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ The application allocates a buffer and passes it
+ (along with its length) to GFDiag.
+*/
+
+/** @def GF_DIAG_SET_IDLE_CHIP_CALLBACK
+Allow the test to idle the chip in its own way.
+
+ @param DiagHandle (#GFDiagHandle) Handle to Diag
+ @param callbackFn (GF_RETTYPE (void *idleCallbackData)) Function pointer to call on idle
+ @param callbackData (void*) Data to pass to pIdleCallback when it is called
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+*/
+
+/** @def GF_DIAG_SET_RENDER_SURFACE
+ Tell GFDiag what surface we want to CRC etc.
+
+ @param DiagHandle (#GFDiagHandle) Handle to Diag
+ @param surface (#PGFRMSURFACE) Surface we want to CRC
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+*/
+
+/** @def GF_DIAG_FRAME_DONE
+ Announce the completion of a frame.
+
+ @param DiagHandle (#GFDiagHandle) Handle to Diag
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ GFDiag has the option to:
+
+ Calculate a CRC on the primary surface. This function calls the callback
+ function set by GFDiagSetIdleChipCallback (or a default if no idle chip
+ callback is supplied) to idle the chip before calculating CRCs
+
+ In "storing mode" this will store the CRC in some DB that gets written
+ to file later.
+
+ In "checking mode" this checks the CRC against the one we read in from file.
+*/
+
+/** @def GF_DIAG_CLEANUP
+ Perform any necessary cleanup operations before the test exits and write
+ CRCs to file if applicable.
+
+ @param DiagHandle (#GFDiagHandle) Handle to Diag
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+*/
+
+/** @def GF_DIAG_PRINT
+ Prints to GFDiag.
+
+ @param DiagHandle (#GFDiagHandle) Handle to Diag
+ @param x (const char*) Message to print
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+*/
+
+/** @def GF_DIAG_RUN_TEST
+Starts a test executing.
+
+ @param DiagHandle (#GFDiagHandle) Handle to Diag
+ @param testName (char*) Name of the test to execute
+ @param pCmdLine (const char*) The command line to execute the test
+ @param flag (NvU8) This is an option specifying how the test should be run. May contain one of: GF_DIAG_RUN_NEW_PROCESS, GF_DIAG_RUN_NEW_THREAD or GF_DIAG_RUN_NORMAL
+ @param pDiagChildHandle (#GFDiagHandle) This is a pointer to a GFDiagHandle that will be filled in with the handle of the child process
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+*/
+
+/** @def GF_DIAG_WAIT_FOR_TEST
+ Waits for test to complete, return value will be result of test.
+
+ @param DiagHandle (#GFDiagHandle) Handle to Diag of test to run (probably the handle placed in pDiagChildHandle from GF_DAIG_RUN_TEST)
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ @see GF_DIAG_RUN_TEST
+*/
+
+/** @def GF_DIAG_GET_CONTEXT
+Gets context from GFDiag.
+
+ @param DiagHandle (#GFDiagHandle) Handle to Diag
+ @param pContext (#GFDIAGCONTEXT) Points to a structure that will be filled with the current context
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+*/
+
+/** @def GF_DIAG_PRINTF
+ Format prints a message.
+
+ @param x (bracketed printf string) Message to print
+*/
+
+/*@}*/
+
+/* Run flags */
+
+/** Test is run in same thread */
+#define GF_DIAG_RUN_NORMAL 1
+#define GF_DIAG_RUN_NEW_THREAD 2
+#define GF_DIAG_RUN_NEW_PROCESS 4
+
+
+/** @def GF_DIAG_CRC_STATUS
+ Helper macro to check the status of a call to GF_DIAG_FRAME_DONE
+ and increment a fail count if the status was a failure.
+
+ eg:
+ @code GF_DIAG_CRC_STATUS(GF_DIAG_FRAME_DONE("DxTest"), GF_Diag_CrcFailCount);
+ @endcode
+
+ @param status The status of a call to GF_DIAG_FRAME_DONE
+ @param gf_diag_crcFailCount The var containing the current failure count
+
+ @see GF_DIAG_FRAME_DONE
+*/
+#define GF_DIAG_CRC_STATUS(status, gf_diag_crcFailCount)
+
+#ifdef GF_DIAG_ENABLED
+
+/*
+ * See doxygen comments above for info on the following macros
+ */
+#define GF_DIAG_MAIN(unused1, unused2, testName) \
+ int TestMain(int argc, char *argv[], GFDiagHandle handle)
+
+#define GF_DIAG_INITIALIZE(handle, argc, argv) \
+ ((PGFDIAGTABLE)handle)->DiagInitialize((handle), (argc), (argv))
+
+#define GF_DIAG_GET_VERSION(handle, str, len) \
+ ((PGFDIAGTABLE)handle)->DiagGetVersion((handle), (str), (len))
+
+#define GF_DIAG_SET_IDLE_CHIP_CALLBACK(handle, callbackFn, callbackData) \
+ ((PGFDIAGTABLE)handle)->DiagSetIdleChipCallback(handle, callbackFn, callbackData)
+
+#define GF_DIAG_SET_RENDER_SURFACE(handle, surface) \
+ ((PGFDIAGTABLE)handle)->DiagSetRenderSurface((handle), (surface))
+
+#define GF_DIAG_FRAME_DONE(handle) \
+ ((PGFDIAGTABLE)handle)->DiagFrameDone((handle))
+
+#define GF_DIAG_CLEANUP(handle) \
+ ((PGFDIAGTABLE)handle)->DiagCleanup((handle))
+
+#define GF_DIAG_PRINT(handle, x) \
+ ((PGFDIAGTABLE)handle)->DiagPrint(handle, x)
+
+#define GF_DIAG_RUN_TEST(handle, testName, pCmdLine, flag, pDiagChildHandle) \
+ ((PGFDIAGTABLE)handle)->DiagRunTest(handle, testName, pCmdLine, flag, pDiagChildHandle)
+
+#define GF_DIAG_WAIT_FOR_TEST(handle) \
+ ((PGFDIAGTABLE)handle)->DiagWaitForTest(handle)
+
+#define GF_DIAG_GET_CONTEXT(handle, pContext) \
+ ((PGFDIAGTABLE)handle)->DiagGetContext(handle, pContext)
+
+
+static void
+GFDiagPrintf( GFDiagHandle handle, const char *fmt, ... )
+{
+ char buf[1024];
+ va_list list;
+
+ va_start(list, fmt);
+
+ GFSprintfVAL(buf, fmt, list);
+
+ GF_DIAG_PRINT(handle, buf);
+
+ va_end(list);
+}
+
+#define GF_DIAG_PRINTF(x) GFDiagPrintf x
+
+#else
+
+/*
+ * Do this exactly like nvplat...so this will have an OS specific
+ * implementation in the final GFDiag.h
+ */
+#if NVOS_IS_LINUX || NVOS_IS_WINDOWS
+#define GF_DIAG_MAIN(unused1, unused2, testName) \
+ int TestMain(int argc, char *argv[])
+#define GF_DIAG_MAIN_DEFAULT_1ARG(unused1, unused2, testName, arg1) \
+ int TestMain(int argc, char *argv[])
+#define GF_DIAG_MAIN_DEFAULT_2ARGS(unused1, unused2, testName, arg1, arg2) \
+ int TestMain(int argc, char *argv[])
+#define GF_DIAG_MAIN_DEFAULT_3ARGS(unused1, unused2, testName, arg1, arg2, arg3) \
+ int TestMain(int argc, char *argv[])
+#else
+#define GF_DIAG_MAIN(unused1, unused2, testName) \
+ int argc = 1; \
+ char *argv[] = { #testName }; \
+ int main()
+#define GF_DIAG_MAIN_DEFAULT_1ARG(unused1, unused2, testName, arg1) \
+ int argc = 2; \
+ char *argv[] = { #testName, arg1 }; \
+ int main()
+#define GF_DIAG_MAIN_DEFAULT_2ARGS(unused1, unused2, testName, arg1, arg2) \
+ int argc = 3; \
+ char *argv[] = { #testName, arg1, arg2 }; \
+ int main()
+#define GF_DIAG_MAIN_DEFAULT_3ARGS(unused1, unused2, testName, arg1, arg2, arg3) \
+ int argc = 4; \
+ char *argv[] = { #testName, arg1, arg2, arg3 }; \
+ int main()
+#endif
+
+#define GF_DIAG_INITIALIZE(testName, argc, argv) GF_SUCCESS
+#define GF_DIAG_CLEANUP(testName) GF_SUCCESS
+
+/* These should be removed once all the Apps & MODS are updated */
+#define GF_DIAG_GET_VERSION(testName, str, len) GF_SUCCESS
+#define GF_DIAG_SET_IDLE_CHIP_CALLBACK(testName, callbackFn, callbackData) GF_SUCCESS
+#define GF_DIAG_SET_RENDER_SURFACE(testName, surface) GF_SUCCESS
+#define GF_DIAG_FRAME_DONE(testName) GF_SUCCESS
+#define GF_DIAG_PRINT(handle, x) GF_SUCCESS
+#define GF_DIAG_RUN_TEST(handle, testName, pCmdLine, flag, pDiagChildHandle) GF_SUCCESS
+#define GF_DIAG_WAIT_FOR_TEST(handle) GF_SUCCESS
+#define GF_DIAG_GET_CONTEXT(handle, pContext) GF_SUCCESS
+
+#define GF_DIAG_PRINTF(x) GFPrintf x
+
+#endif /* GF_DIAG_ENABLED */
+
+#ifdef __cplusplus
+}
+#endif
+
+/* NV_MODS */
+#else
+
+/* GFDiag is always enabled in NV_MODS builds */
+#define GF_DIAG_ENABLED 1
+
+#ifndef INCLUDED_GFMODS_H
+#include "../GFMods/src/GFMods.h"
+#endif
+
+#endif /* NV_MODS */
+
+#define CHECK_STATUS_MSG(f,TEXT) \
+ do { \
+ if(ISGFERROR( ( status = (f) ) )) \
+ { \
+ GF_DIAG_PRINTF((TEXT)); \
+ } \
+ } while(0)
+
+
+#define CHECK_STATUS_CLEANUP_MSG(f , TEXT) \
+ do { \
+ if(ISGFERROR( ( status = (f) ) )) \
+ { \
+ GF_DIAG_PRINTF(TEXT); \
+ goto Cleanup; \
+ } \
+ } while(0)
+
+#define CHECK_STATUS_AND_DISPLAY_CLEANUP_MSG(f , TEXT) \
+ do { \
+ if(ISGFERROR( ( status = (f) ) )) \
+ { \
+ GF_DIAG_PRINTF((TEXT,f)); \
+ goto Cleanup; \
+ } \
+ } while(0)
+#endif /* __GFDIAG_H__ */
diff --git a/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFDispCmdData.h b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFDispCmdData.h
new file mode 100755
index 00000000..5106900b
--- /dev/null
+++ b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFDispCmdData.h
@@ -0,0 +1,1740 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+#if !defined __GFDISPCMDDATA_H__
+#define __GFDISPCMDDATA_H__
+
+// Display Signal Options 0
+
+#define GF_DEFAULT_TABLE 0x01 // Display Default Table Support
+#define GF_DXAPI_SUPPORT 0x02 // DxAPI Support
+#define GF_FMARK_SUPPORT 0x04 // FMARK Supported by panel
+
+#define GFSDXAPI_PROC0 0x80000000 // PROC0 in Display DxAPI table in Script
+#define GFSDXAPI_PROC1 0x80000001 // PROC1 in Display DxAPI table in Script
+#define GFSDXAPI_PROC2 0x80000002 // PROC2 in Display DxAPI table in Script
+#define GFSDXAPI_PROC3 0x80000003 // PROC3 in Display DxAPI table in Script
+#define GFSDXAPI_PROC4 0x80000004 // PROC4 in Display DxAPI table in Script
+#define GFSDXAPI_PROC5 0x80000005 // PROC5 in Display DxAPI table in Script
+#define GFSDXAPI_PROC6 0x80000006 // PROC6 in Display DxAPI table in Script
+#define GFSDXAPI_PROC7 0x80000007 // PROC7 in Display DxAPI table in Script
+#define GFSDXAPI_PROC8 0x80000008 // PROC8 in Display DxAPI table in Script
+#define GFSDXAPI_PROC9 0x80000009 // PROC9 in Display DxAPI table in Script
+#define GFSDXAPI_PROC10 0x8000000A // PROC10 in Display DxAPI table in Script
+#define GFSDXAPI_PROC11 0x8000000B // PROC11 in Display DxAPI table in Script
+#define GFSDXAPI_PROC12 0x8000000C // PROC12 in Display DxAPI table in Script
+#define GFSDXAPI_PROC13 0x8000000D // PROC13 in Display DxAPI table in Script
+#define GFSDXAPI_PROC14 0x8000000E // PROC14 in Display DxAPI table in Script
+#define GFSDXAPI_PROC15 0x8000000F // PROC14 in Display DxAPI table in Script
+#define GFSDXAPI_PROC16 0x80000010 // PROC16 in Display DxAPI table in Script
+#define GFSDXAPI_PROC17 0x80000011 // PROC17 in Display DxAPI table in Script
+#define GFSDXAPI_PROC18 0x80000012 // PROC18 in Display DxAPI table in Script
+#define GFSDXAPI_PROC19 0x80000013 // PROC19 in Display DxAPI table in Script
+#define GFSDXAPI_PROC20 0x80000014 // PROC20 in Display DxAPI table in Script
+#define GFSDXAPI_PROC21 0x80000015 // PROC21 in Display DxAPI table in Script
+#define GFSDXAPI_PROC22 0x80000016 // PROC22 in Display DxAPI table in Script
+#define GFSDXAPI_PROC23 0x80000017 // PROC23 in Display DxAPI table in Script
+#define GFSDXAPI_PROC24 0x80000018 // PROC24 in Display DxAPI table in Script
+#define GFSDXAPI_PROC25 0x80000019 // PROC25 in Display DxAPI table in Script
+#define GFSDXAPI_PROC26 0x8000001A // PROC26 in Display DxAPI table in Script
+#define GFSDXAPI_PROC27 0x8000001B // PROC27 in Display DxAPI table in Script
+#define GFSDXAPI_PROC28 0x8000001C // PROC28 in Display DxAPI table in Script
+#define GFSDXAPI_PROC29 0x8000001D // PROC29 in Display DxAPI table in Script
+#define GFSDXAPI_PROC30 0x8000001E // PROC30 in Display DxAPI table in Script
+#define GFSDXAPI_PROC31 0x8000001F // PROC31 in Display DxAPI table in Script
+#define GFSDXAPI_PROC_END 0x8000FFFF // PROC End in Display DxAPI table in Script
+
+#define OFFSET_DISP_SIGNAL_OPTIONS0 0x00000101
+
+#define GFSCMD_H_PULSE0 0x00088101
+#define GFSCMD_H_PULSE1 0x000A8101
+#define GFSCMD_H_PULSE2 0x000C8101
+#define GFSCMD_V_PULSE0 0x00108101
+#define GFSCMD_V_PULSE1 0x00128101
+#define GFSCMD_V_PULSE2 0x00138101
+#define GFSCMD_V_PULSE3 0x00148101
+#define GFSCMD_M0 0x00188101
+#define GFSCMD_M1 0x001A8101
+
+#define GF_H_PULSE0_DISABLE 0x00000000
+#define GF_H_PULSE0_ENABLE 0x00000100
+#define GF_H_PULSE1_DISABLE 0x00000000
+#define GF_H_PULSE1_ENABLE 0x00000400
+#define GF_H_PULSE2_DISABLE 0x00000000
+#define GF_H_PULSE2_ENABLE 0x00001000
+#define GF_V_PULSE0_DISABLE 0x00000000
+#define GF_V_PULSE0_ENABLE 0x00010000
+#define GF_V_PULSE1_DISABLE 0x00000000
+#define GF_V_PULSE1_ENABLE 0x00040000
+#define GF_V_PULSE2_DISABLE 0x00000000
+#define GF_V_PULSE2_ENABLE 0x00080000
+#define GF_V_PULSE3_DISABLE 0x00000000
+#define GF_V_PULSE3_ENABLE 0x00100000
+#define GF_M0_DISABLE 0x00000000
+#define GF_M0_ENABLE 0x01000000
+#define GF_M1_DISABLE 0x00000000
+#define GF_M1_ENABLE 0x02000000
+
+
+// Display Signal Options 1
+
+#define OFFSET_DISP_SIGNAL_OPTIONS1 0x00000102
+#define GFSCMD_DI 0x00108102
+#define GFSCMD_PP 0x00128102
+
+#define GF_DI_DISABLE 0x00000000
+#define GF_DI_ENABLE 0x00010000
+#define GF_PP_DISABLE 0x00000000
+#define GF_PP_ENABLE 0x00040000
+
+#define OFFSET_H_PULSE0_CONTROL 0x0000010c
+
+#define GFSCMD_H_PULSE0_MODE 0x0003810c
+#define GFSCMD_H_PULSE0_POLARITY 0x0004810c
+#define GFSCMD_H_PULSE0_V_QUAL 0x0006810c
+#define GFSCMD_H_PULSE0_LAST 0x0008810c
+
+#define GF_H_PULSE0_MODE_NORMAL 0x00000000
+#define GF_H_PULSE0_MODE_ONE_CLOCK 0x00000008
+#define GF_H_PULSE0_POLARITY_HIGH 0x00000000
+#define GF_H_PULSE0_POLARITY_LOW 0x00000010
+#define GF_H_PULSE0_V_QUAL_ALWAYS 0x00000000
+#define GF_H_PULSE0_V_QUAL_VACTIVE 0x00000080
+#define GF_H_PULSE0_V_QUAL_VACTIVE1 0x000000A0
+#define GF_H_PULSE0_LAST_START_A 0x00000000
+#define GF_H_PULSE0_LAST_END_A 0x00000100
+#define GF_H_PULSE0_LAST_START_B 0x00000200
+#define GF_H_PULSE0_LAST_END_B 0x00000300
+#define GF_H_PULSE0_LAST_START_C 0x00000400
+#define GF_H_PULSE0_LAST_END_C 0x00000500
+#define GF_H_PULSE0_LAST_START_D 0x00000600
+#define GF_H_PULSE0_LAST_END_D 0x00000700
+
+#define OFFSET_H_PULSE0_POSITION_A 0x0000010d
+#define GFSCMD_H_PULSE0_POSITION_A 0x0000810d
+
+#define OFFSET_H_PULSE1_CONTROL 0x00000111
+
+#define GFSCMD_H_PULSE1_MODE 0x00038111
+#define GFSCMD_H_PULSE1_POLARITY 0x00048111
+#define GFSCMD_H_PULSE1_V_QUAL 0x00068111
+#define GFSCMD_H_PULSE1_LAST 0x00088111
+
+#define GF_H_PULSE1_MODE_NORMAL 0x00000000
+#define GF_H_PULSE1_MODE_ONE_CLOCK 0x00000008
+#define GF_H_PULSE1_POLARITY_HIGH 0x00000000
+#define GF_H_PULSE1_POLARITY_LOW 0x00000010
+#define GF_H_PULSE1_V_QUAL_ALWAYS 0x00000000
+#define GF_H_PULSE1_V_QUAL_VACTIVE 0x00000080
+#define GF_H_PULSE1_V_QUAL_VACTIVE1 0x000000A0
+#define GF_H_PULSE1_LAST_START_A 0x00000000
+#define GF_H_PULSE1_LAST_END_A 0x00000100
+#define GF_H_PULSE1_LAST_START_B 0x00000200
+#define GF_H_PULSE1_LAST_END_B 0x00000300
+#define GF_H_PULSE1_LAST_START_C 0x00000400
+#define GF_H_PULSE1_LAST_END_C 0x00000500
+#define GF_H_PULSE1_LAST_START_D 0x00000600
+#define GF_H_PULSE1_LAST_END_D 0x00000700
+
+#define OFFSET_H_PULSE1_POSITION_A 0x00000112
+#define GFSCMD_H_PULSE1_POSITION_A 0x00008112
+
+#define OFFSET_H_PULSE2_CONTROL 0x00000116
+#define GFSCMD_H_PULSE2_MODE 0x00038116
+#define GFSCMD_H_PULSE2_POLARITY 0x00048116
+#define GFSCMD_H_PULSE2_V_QUAL 0x00068116
+#define GFSCMD_H_PULSE2_LAST 0x00088116
+
+#define GF_H_PULSE2_MODE_NORMAL 0x00000000
+#define GF_H_PULSE2_MODE_ONE_CLOCK 0x00000008
+#define GF_H_PULSE2_POLARITY_HIGH 0x00000000
+#define GF_H_PULSE2_POLARITY_LOW 0x00000010
+#define GF_H_PULSE2_V_QUAL_ALWAYS 0x00000000
+#define GF_H_PULSE2_V_QUAL_VACTIVE 0x00000080
+#define GF_H_PULSE2_V_QUAL_VACTIVE1 0x000000A0
+#define GF_H_PULSE2_LAST_START_A 0x00000000
+#define GF_H_PULSE2_LAST_END_A 0x00000100
+#define GF_H_PULSE2_LAST_START_B 0x00000200
+#define GF_H_PULSE2_LAST_END_B 0x00000300
+#define GF_H_PULSE2_LAST_START_C 0x00000400
+#define GF_H_PULSE2_LAST_END_C 0x00000500
+#define GF_H_PULSE2_LAST_START_D 0x00000600
+#define GF_H_PULSE2_LAST_END_D 0x00000700
+
+#define OFFSET_H_PULSE2_POSITION_A 0x00000117
+#define GFSCMD_H_PULSE2_POSITION_A 0x00008117
+
+#define GFSCMD_V_PULSE0_POLARITY 0x0004811b
+#define GFSCMD_V_PULSE0_DELAY_CNTRL 0x0006811b
+#define GFSCMD_V_PULSE0_LAST 0x0008811b
+
+#define GF_V_PULSE0_POLARITY_HIGH 0x00000000
+#define GF_V_PULSE0_POLARITY_LOW 0x00000010
+#define GF_V_PULSE0_NODELAY 0x00000000
+#define GF_V_PULSE0_DELAY 0x00000040
+#define GF_V_PULSE0_DELAY1 0x00000080
+#define GF_V_PULSE0_LAST_START_A 0x00000000
+#define GF_V_PULSE0_LAST_END_A 0x00000100
+#define GF_V_PULSE0_LAST_START_B 0x00000200
+#define GF_V_PULSE0_LAST_END_B 0x00000300
+#define GF_V_PULSE0_LAST_START_C 0x00000400
+#define GF_V_PULSE0_LAST_END_C 0x00000500
+
+#define OFFSET_V_PULSE0_POSITION_A 0x0000011c
+#define GFSCMD_V_PULSE0_POSITION_A 0x0000811c
+
+#define GF_V_PULSE0_START_A 0x00000000
+#define GF_V_PULSE0_END_A 0x00010000
+
+#define GFSCMD_V_PULSE1_POLARITY 0x0004811f
+#define GFSCMD_V_PULSE1_DELAY_CNTRL 0x0006811f
+#define GFSCMD_V_PULSE1_LAST 0x0008811f
+
+#define GF_V_PULSE1_POLARITY_HIGH 0x00000000
+#define GF_V_PULSE1_POLARITY_LOW 0x00000010
+#define GF_V_PULSE1_NODELAY 0x00000000
+#define GF_V_PULSE1_DELAY1 0x00000040
+#define GF_V_PULSE1_DELAY2 0x00000080
+#define GF_V_PULSE1_LAST_START_A 0x00000000
+#define GF_V_PULSE1_LAST_END_A 0x00000100
+#define GF_V_PULSE1_LAST_START_B 0x00000200
+#define GF_V_PULSE1_LAST_END_B 0x00000300
+#define GF_V_PULSE1_LAST_START_C 0x00000400
+#define GF_V_PULSE1_LAST_END_C 0x00000500
+
+#define OFFSET_V_PULSE1_POSITION_A 0x00000120
+#define GFSCMD_V_PULSE1_POSITION_A 0x00008120
+
+#define OFFSET_M0_CONTROL 0x00000127
+#define GFSCMD_M0_CLOCK_SELECT 0x00008127
+#define GFSCMD_M0_PHASE_CONTROL 0x00048127
+#define GFSCMD_M0_PHASE_RESET 0x00068127
+#define GFSCMD_M0_POLARITY 0x00078127
+#define GFSCMD_M0_PERIOD 0x00088127
+#define GFSCMD_M0_H_POSITION 0x00108127
+
+#define GF_M0_CLOCK_SELECT_PCLK 0x00000000
+#define GF_M0_CLOCK_SELECT_LCLK 0x00000002
+#define GF_M0_CLOCK_SELECT_FCLK 0x00000003
+#define GF_M0_PHASE_CONTROL_FREE_RUN 0x00000000
+#define GF_M0_PHASE_CONTROL_VACTIVE_RESTART 0x00000020
+#define GF_M0_PHASE_CONTROL_FRAME_INVERT 0x00000030
+#define GF_M0_PHASE_RESET_NOT_RESET 0x00000000
+#define GF_M0_PHASE_RESET_RESET 0x00000040
+#define GF_M0_POLARITY_HIGH 0x00000000
+#define GF_M0_POLARITY_LOW 0x00000080
+#define GF_M0_PERIOD_VAL 0x00000100
+#define GF_M0_H_POSITION_VAL 0x00010000
+
+#define OFFSET_M1_CONTROL 0x00000128
+#define GFSCMD_M1_CLOCK_SELECT 0x00008128
+#define GFSCMD_M1_PHASE_CONTROL 0x00048128
+#define GFSCMD_M1_PHASE_RESET 0x00068128
+#define GFSCMD_M1_POLARITY 0x00078128
+#define GFSCMD_M1_PERIOD 0x00088128
+#define GFSCMD_M1_H_POSITION 0x00108128
+
+#define GF_M1_CLOCK_SELECT_PCLK 0x00000000
+#define GF_M1_CLOCK_SELECT_LCLK 0x00000002
+#define GF_M1_CLOCK_SELECT_FCLK 0x00000003
+#define GF_M1_PHASE_CONTROL_FREE_RUN 0x00000000
+#define GF_M1_PHASE_CONTROL_VACTIVE_RESTART 0x00000020
+#define GF_M1_PHASE_CONTROL_FRAME_INVERT 0x00000030
+#define GF_M1_PHASE_RESET_NOT_RESET 0x00000000
+#define GF_M1_PHASE_RESET_RESET 0x00000040
+#define GF_M1_POLARITY_HIGH 0x00000000
+#define GF_M1_POLARITY_LOW 0x00000080
+#define GF_M1_PERIOD_VAL 0x00000100
+#define GF_M1_H_POSITION_VAL 0x00010000
+
+#define GF_DISP_CLOCK_CONTROL_0 0x0000012f
+
+#define GFSCMD_SHIFT_CLK_DIVIDER 0x0000812f
+#define GFSCMD_PIXEL_CLK_DIVIDER 0x0008812f
+
+//#define GF_SHCLKD_1_256_VAL 0x00000000
+#define GF_PCD1 0x00000000
+#define GF_PCD1H 0x00000100
+#define GF_PCD2 0x00000200
+#define GF_PCD3 0x00000300
+#define GF_PCD4 0x00000400
+#define GF_PCD6 0x00000500
+#define GF_PCD8 0x00000600
+#define GF_PCD9 0x00000700
+#define GF_PCD12 0x00000800
+#define GF_PCD16 0x00000900
+#define GF_PCD13 0x00000a00
+#define GF_PCD18 0x00000b00
+#define GF_PCD24 0x00000c00
+
+#define OFFSET_DISP_INTERFACE_CONTROL 0x00000130
+#define GFSCMD_DISP_DATA_FORMAT 0x00008130
+
+#define GFSCMD_DISP_DATA_ALIGNMENT 0x00088130
+#define GFSCMD_DISP_DATA_ORDER 0x00098130
+
+#define GF_DF1P1C_PRLL 0x00000000
+#define GF_DF1P2C24B_PRLL 0x00000001
+#define GF_DF1P2C18B_PRLL 0x00000002
+#define GF_DF1P2C16B_PRLL 0x00000003
+#define GF_DF1CNL_SRL 0x00000004
+#define GF_DF2CNL_SRL 0x00000005
+#define GF_DF3CNL_SRL 0x00000006
+#define GF_DF_SPI 0x00000007
+#define GF_MSB 0x00000000
+#define GF_LSB 0x00000100
+#define GF_RED_BLUE 0x00000000
+#define GF_BLUE_RED 0x00000200
+
+#define OFFSET_DISP_COLOR_CONTROL 0x00000131
+#define GFSCMD_BASE_COLOR_SIZE 0x00008131
+#define GFSCMD_DITHER_CONTROL 0x00088131
+#define GFSCMD_ORD_DITHER_ROTATION 0x000C8131
+#define GFSCMD_DISP_COLOR_SWAP 0x00108131
+#define GFSCMD_BLANK_COLOR 0x00118131
+#define GFSCMD_NON_BASE_COLOR 0x00128131
+#define GFSCMD_LCD_MD0 0x00188131
+
+#define GF_BASE666 0x00000000
+#define GF_BASE111 0x00000001
+#define GF_BASE222 0x00000002
+#define GF_BASE333 0x00000003
+#define GF_BASE444 0x00000004
+#define GF_BASE555 0x00000005
+#define GF_BASE565 0x00000006
+#define GF_BASE332 0x00000007
+#define GF_BASE888 0x00000008
+#define GF_DISABLE 0x00000000
+#define GF_ORDERED 0x00000200
+#define GF_ERRDIFF 0x00000300
+#define GF_ORD_DITHER_ROTATION_VAL 0x00000000
+#define GF_SWAP_RGB 0x00000000
+#define GF_SWAP_BGR 0x00010000
+#define GF_BLANK_ZERO 0x00000000
+#define GF_BLANK_ONES 0x00020000
+#define GF_NON_BASE_ZERO 0x00000000
+#define GF_NON_BASE_ONES 0x00040000
+#define GF_LCD_MD0_LOW 0x00000000
+#define GF_LCD_MD0_HIGH 0x01000000
+
+
+#define OFFSET_SHIFT_CLOCK_OPTIONS 0x00000132
+
+#define GFSCMD_SC0_H_QUALIFIER 0x00008132
+#define GFSCMD_SC0_V_QUALIFIER 0x00038132
+#define GFSCMD_SC0_CLK_DIVIDER 0x00068132
+#define GFSCMD_SC1_H_QUALIFIER 0x00108132
+#define GFSCMD_SC1_V_QUALIFIER 0x00138132
+#define GFSCMD_SC1_CLK_DIVIDER 0x00158132
+
+#define GF_SC0_H_DISABLE 0x00000000
+#define GF_SC0_H_NO_HQUAL 0x00000001
+#define GF_SC0_H_HACTIVE 0x00000002
+#define GF_SC0_H_EXT_HACTIVE 0x00000003
+#define GF_SC0_H_HPULSE0 0x00000004
+#define GF_SC0_H_EXT_HPULSE0 0x00000005
+#define GF_SC0_V_NO_VQUAL 0x00000000
+#define GF_SC0_V_RESERVED 0x00000008
+#define GF_SC0_V_VACTIVE 0x00000010
+#define GF_SC0_V_EXT_VACTIVE 0x00000018
+#define GF_SC0_V_VPULSE0 0x00000020
+#define GF_SC0_V_EXT_VPULSE0 0x00000028
+#define GF_SC0_DIV1 0x00000000
+#define GF_SC0_DIV2 0x00000040
+#define GF_SC0_DIV4 0x00000080
+
+#define GF_SC1_H_DISABLE 0x00000000
+#define GF_SC1_H_NO_HQUAL 0x00010000
+#define GF_SC1_H_HACTIVE 0x00020000
+#define GF_SC1_H_EXT_HACTIVE 0x00030000
+#define GF_SC1_H_HPULSE1 0x00040000
+#define GF_SC1_H_EXT_HPULSE1 0x00050000
+#define GF_SC1_V_NO_VQUAL 0x00000000
+#define GF_SC1_V_RESERVED 0x00080000
+#define GF_SC1_V_VACTIVE 0x00100000
+#define GF_SC1_V_EXT_VACTIVE 0x00180000
+#define GF_SC1_V_VPULSE1 0x00200000
+#define GF_SC1_V_EXT_VPULSE1 0x00280000
+#define GF_SC1_DIV1 0x00000000
+#define GF_SC1_DIV2 0x00400000
+#define GF_SC1_DIV4 0x00800000
+
+#define OFFSET_DATA_ENABLE_OPTIONS 0x00000133
+
+#define GFSCMD_DE_SELECT_ACTIVE 0x00008133
+#define GFSCMD_DE_CONTROL 0x00038133
+
+#define GF_DE_ACTIVE_ALL_LINES 0x00000000
+#define GF_DE_ACTIVE_NOBLANK 0x00000001
+#define GF_DE_ONECLK 0x00000000
+#define GF_DE_NORMAL 0x00000004
+#define GF_DE_ONE_CLK_PRECD_ACTIVE 0x00000008
+#define GF_DE_ONE_PIXEL_CLK_EARLY 0x0000000C
+
+
+#define OFFSET_SERIAL_INTERFACE_OPTIONS 0x00000134
+#define GFSCMD_SDT_STP_MODE 0x00008134
+#define GFSCMD_SDT_STP_DURATION 0x00028134
+#define GFSCMD_STH_DURATION 0x00068134
+#define GFSCMD_STP_CONTRO 0x00078134
+
+#define GF_SDT_STP_DISABLE 0x00000000
+#define GF_SDT_STP_RESERVED 0x00000001
+#define GF_SDT_STP_ENABLE_DUP 0x00000002
+#define GF_SDT_STP_ENABLE 0x00000003
+#define GF_SDT_STP_DURATION_VAL 0x00000000
+#define GF_ONE_CLOCK 0x00000000
+#define GF_TWO_CLOCK 0x00000040
+#define GF_STP_NORMAL 0x00000000
+#define GF_STP_EXTENDED 0x00000080
+
+
+#define OFFSET_LCD_LSPI_OPTIONS 0x00000135
+#define GFSCMD_LCD_SPI_CS_MAIN 0x00008135
+#define GFSCMD_LCD_SPI_DC 0x00018135
+#define GFSCMD_SPI_CS_CONTROL_LCD_IS_SPI 0x00028135
+#define GFSCMD_LCD_SPI_DIRECTION_LSB2MSB 0x00048135
+
+#define GF_CS_MAIN 0x00000000
+#define GF_CS_SUB 0x00000001
+#define GF_LDC_LOW 0x00000000
+#define GF_LDC_HIGH 0x00000002
+#define GF_LCD_IS_SPI 0x00000000
+#define GF_LCD_SPI 0x00000004
+#define GF_IS_SPI 0x00000008
+#define GF_FORCED 0x0000000C
+#define GF_MSB2LSB 0x00000000
+#define GF_LSB2MSB 0x00000010
+
+
+#define OFFSET_SIGNAL_RAISE 0x00000005
+#define GFSCMD_SIGNAL_RAISE_VECTOR 0x00008005
+#define GFSCMD_SIGNAL_RAISE_SELECT 0x00088005
+#define GFSCMD_SIGNAL_RAISE_CHANNEL_ID 0x00108005
+
+#define GF_RAISE_VECTOR_VAL 0x00000000
+#define GF_RAISE_NONE 0x00000000
+#define GF_RAISE_FRAME_END 0x00000100
+#define GF_RAISE_VBLANK 0x00000200
+#define GF_RAISE_VPULSE3 0x00000300
+#define GF_RAISE_CHANNEL_ID_VAL 0x00000000
+
+
+#define OFFSET_SIGNAL_REFCOUNT 0x00000006
+#define GFSCMD_SIGNAL_REFCOUNT_VECTOR 0x00008006
+#define GFSCMD_SIGNAL_REFCOUNT_SELECT 0x00108006
+
+#define GF_REFCOUNT_VECTOR_VAL 0x00000000
+#define GF_REFCOUNT_NONE 0x00000000
+#define GF_REFCOUNT_FRAME_END 0x00010000
+
+
+
+// Display Power Control
+
+#define OFFSET_DISPLAY_POWER_CONTROL 0x00000009
+#define GFSCMD_PW0_CONTROL 0x00008009
+#define GFSCMD_PW1_CONTROL 0x00028009
+#define GFSCMD_PW2_CONTROL 0x00048009
+#define GFSCMD_PW3_CONTROL 0x00068009
+#define GFSCMD_PW4_CONTROL 0x00088009
+#define GFSCMD_PM0_CONTROL 0x00108009
+#define GFSCMD_PM1_CONTROL 0x00128009
+#define GFSCMD_SPI_CONTROL 0x00188009
+#define GFSCMD_HSPI_CONTROL 0x00198009
+
+#define GF_PW0_DISABLE 0x00000000
+#define GF_PW0_ENABLE 0x00000001
+#define GF_PW1_DISABLE 0x00000000
+#define GF_PW1_ENABLE 0x00000004
+#define GF_PW2_DISABLE 0x00000000
+#define GF_PW2_ENABLE 0x00000010
+#define GF_PW3_DISABLE 0x00000000
+#define GF_PW3_ENABLE 0x00000040
+#define GF_PW4_DISABLE 0x00000000
+#define GF_PW4_ENABLE 0x00010000
+#define GF_PM0_DISABLE 0x00000000
+#define GF_PM0_ENABLE 0x00040000
+#define GF_PM1_DISABLE 0x00000000
+#define GF_PM1_ENABLE 0x00400000
+#define GF_SPI_DISABLE 0x00000000
+#define GF_SPI_ENABLE 0x01000000
+#define GF_HSPI_DISABLE 0x00000000
+#define GF_HSPI_ENABLE 0x02000000
+
+// Pin Output Enable registers
+
+#define OFFSET_PIN_OUTPUT_ENABLE0 0x00000802
+#define GFSCMD_LD0_PIN_OUTPUT 0x00008802
+#define GFSCMD_LD1_PIN_OUTPUT 0x00028802
+#define GFSCMD_LD2_PIN_OUTPUT 0x00048802
+#define GFSCMD_LD3_PIN_OUTPUT 0x00068802
+#define GFSCMD_LD4_PIN_OUTPUT 0x00088802
+#define GFSCMD_LD5_PIN_OUTPUT 0x000a8802
+#define GFSCMD_LD6_PIN_OUTPUT 0x000c8802
+#define GFSCMD_LD7_PIN_OUTPUT 0x000e8802
+#define GFSCMD_LD8_PIN_OUTPUT 0x00108802
+#define GFSCMD_LD9_PIN_OUTPUT 0x00128802
+#define GFSCMD_LD10_PIN_OUTPUT 0x00148802
+#define GFSCMD_LD11_PIN_OUTPUT 0x00168802
+#define GFSCMD_LD12_PIN_OUTPUT 0x00188802
+#define GFSCMD_LD13_PIN_OUTPUT 0x001a8802
+#define GFSCMD_LD14_PIN_OUTPUT 0x001c8802
+#define GFSCMD_LD15_PIN_OUTPUT 0x001e8802
+#define GFSCMD_LD0_LD15_PIN_OUTPUT 0x00208802
+
+
+#define GF_LD0_OUTPUT_ENABLE 0x00000000
+#define GF_LD0_OUTPUT_DISABLE 0x00000001
+#define GF_LD1_OUTPUT_ENABLE 0x00000000
+#define GF_LD1_OUTPUT_DISABLE 0x00000004
+#define GF_LD2_OUTPUT_ENABLE 0x00000000
+#define GF_LD2_OUTPUT_DISABLE 0x00000010
+#define GF_LD3_OUTPUT_ENABLE 0x00000000
+#define GF_LD3_OUTPUT_DISABLE 0x00000040
+#define GF_LD4_OUTPUT_ENABLE 0x00000000
+#define GF_LD4_OUTPUT_DISABLE 0x00000100
+#define GF_LD5_OUTPUT_ENABLE 0x00000000
+#define GF_LD5_OUTPUT_DISABLE 0x00000400
+#define GF_LD6_OUTPUT_ENABLE 0x00000000
+#define GF_LD6_OUTPUT_DISABLE 0x00001000
+#define GF_LD7_OUTPUT_ENABLE 0x00000000
+#define GF_LD7_OUTPUT_DISABLE 0x00004000
+#define GF_LD8_OUTPUT_ENABLE 0x00000000
+#define GF_LD8_OUTPUT_DISABLE 0x00010000
+#define GF_LD9_OUTPUT_ENABLE 0x00000000
+#define GF_LD9_OUTPUT_DISABLE 0x00040000
+#define GF_LD10_OUTPUT_ENABLE 0x00000000
+#define GF_LD10_OUTPUT_DISABLE 0x00100000
+#define GF_LD11_OUTPUT_ENABLE 0x00000000
+#define GF_LD11_OUTPUT_DISABLE 0x00400000
+#define GF_LD12_OUTPUT_ENABLE 0x00000000
+#define GF_LD12_OUTPUT_DISABLE 0x01000000
+#define GF_LD13_OUTPUT_ENABLE 0x00000000
+#define GF_LD13_OUTPUT_DISABLE 0x04000000
+#define GF_LD14_OUTPUT_ENABLE 0x00000000
+#define GF_LD14_OUTPUT_DISABLE 0x10000000
+#define GF_LD15_OUTPUT_ENABLE 0x00000000
+#define GF_LD15_OUTPUT_DISABLE 0x40000000
+#define GF_LD0_LD15_OUTPUT_ENABLE 0x00000000
+#define GF_LD0_LD15_OUTPUT_DISABLE 0x55555555
+
+
+#define OFFSET_PIN_OUTPUT_ENABLE1 0x00000803
+#define GFSCMD_LD16_PIN_OUTPUT 0x00008803
+#define GFSCMD_LD17_PIN_OUTPUT 0x00028803
+#define GFSCMD_LPW0_PIN_OUTPUT 0x00108803
+#define GFSCMD_LPW1_PIN_OUTPUT 0x00128803
+#define GFSCMD_LPW2_PIN_OUTPUT 0x00148803
+#define GFSCMD_LSC0_PIN_OUTPUT 0x00188803
+#define GFSCMD_LSC1_PIN_OUTPUT 0x001a8803
+#define GFSCMD_LVS_PIN_OUTPUT 0x001c8803
+#define GFSCMD_LHS_PIN_OUTPUT 0x001e8803
+#define GFSCMD_LD16_LD17_PIN_OUTPUT 0x00208803
+
+#define GF_LD16_OUTPUT_ENABLE 0x00000000
+#define GF_LD16_OUTPUT_DISABLE 0x00000001
+#define GF_LD17_OUTPUT_ENABLE 0x00000000
+#define GF_LD17_OUTPUT_DISABLE 0x00000004
+#define GF_LPW0_OUTPUT_ENABLE 0x00000000
+#define GF_LPW0_OUTPUT_DISABLE 0x00010000
+#define GF_LPW1_OUTPUT_ENABLE 0x00000000
+#define GF_LPW1_OUTPUT_DISABLE 0x00040000
+#define GF_LPW2_OUTPUT_ENABLE 0x00000000
+#define GF_LPW2_OUTPUT_DISABLE 0x00100000
+#define GF_LSC0_OUTPUT_ENABLE 0x00000000
+#define GF_LSC0_OUTPUT_DISABLE 0x01000000
+#define GF_LSC1_OUTPUT_ENABLE 0x00000000
+#define GF_LSC1_OUTPUT_DISABLE 0x04000000
+#define GF_LVS_OUTPUT_ENABLE 0x00000000
+#define GF_LVS_OUTPUT_DISABLE 0x10000000
+#define GF_LHS_OUTPUT_ENABLE 0x00000000
+#define GF_LHS_OUTPUT_DISABLE 0x40000000
+#define GF_LD16_LD17_OUTPUT_ENABLE 0x00000000
+#define GF_LD16_LD17_OUTPUT_DISABLE 0x00000005
+
+
+#define DC_PIN_OUTPUT_ENABLE2 0x00000804
+#define GFSCMD_LHP0_PIN_OUTPUT 0x00008804
+#define GFSCMD_LHP1_PIN_OUTPUT 0x00028804
+#define GFSCMD_LHP2_PIN_OUTPUT 0x00048804
+#define GFSCMD_LVP0_PIN_OUTPUT 0x00088804
+#define GFSCMD_LVP1_PIN_OUTPUT 0x000A8804
+#define GFSCMD_LM0_PIN_OUTPUT 0x00108804
+#define GFSCMD_LM1_PIN_OUTPUT 0x00128804
+#define GFSCMD_LDI_PIN_OUTPUT 0x00148804
+#define GFSCMD_LPP_PIN_OUTPUT 0x00168804
+
+#define GF_LHP0_OUTPUT_ENABLE 0x00000000
+#define GF_LHP0_OUTPUT_DISABLE 0x00000001
+#define GF_LHP1_OUTPUT_ENABLE 0x00000000
+#define GF_LHP1_OUTPUT_DISABLE 0x00000004
+#define GF_LHP2_OUTPUT_ENABLE 0x00000000
+#define GF_LHP2_OUTPUT_DISABLE 0x00000010
+#define GF_LVP0_OUTPUT_ENABLE 0x00000000
+#define GF_LVP0_OUTPUT_DISABLE 0x00000100
+#define GF_LVP1_OUTPUT_ENABLE 0x00000000
+#define GF_LVP1_OUTPUT_DISABLE 0x00000404
+#define GF_LM0_OUTPUT_ENABLE 0x00000000
+#define GF_LM0_OUTPUT_DISABLE 0x00010000
+#define GF_LM1_OUTPUT_ENABLE 0x00000000
+#define GF_LM1_OUTPUT_DISABLE 0x00040000
+#define GF_LDI_OUTPUT_ENABLE 0x00000000
+#define GF_LDI_OUTPUT_DISABLE 0x00100000
+#define GF_LPP_OUTPUT_ENABLE 0x00000000
+#define GF_LPP_OUTPUT_DISABLE 0x00400000
+
+#define OFFSET_OUTPUT_ENABLE3 0x00000805
+#define GFSCMD_LSCK_PIN_OUTPUT 0x00008805
+#define GFSCMD_LSDA_PIN_OUTPUT 0x00028805
+#define GFSCMD_LCSN_PIN_OUTPUT 0x00048805
+#define GFSCMD_LDC_PIN_OUTPUT 0x00068805
+#define GFSCMD_LSPI_PIN_OUTPUT 0x00088805
+
+#define GF_LSCK_OUTPUT_ENABLE 0x00000000
+#define GF_LSCK_OUTPUT_DISABLE 0x00000001
+#define GF_LSDA_OUTPUT_ENABLE 0x00000000
+#define GF_LSDA_OUTPUT_DISABLE 0x00000004
+#define GF_LCSN_OUTPUT_ENABLE 0x00000000
+#define GF_LCSN_OUTPUT_DISABLE 0x00000010
+#define GF_LDC_OUTPUT_ENABLE 0x00000000
+#define GF_LDC_OUTPUT_DISABLE 0x00000040
+#define GF_LSPI_OUTPUT_ENABLE 0x00000000
+#define GF_LSPI_OUTPUT_DISABLE 0x00000100
+
+
+// Pin Output Polarity registers
+
+#define OFFSET_PIN_OUTPUT_POLARITY0 0x00000806
+#define GFSCMD_LD0_PIN_POLARITY 0x00008806
+#define GFSCMD_LD1_PIN_POLARITY 0x00028806
+#define GFSCMD_LD2_PIN_POLARITY 0x00048806
+#define GFSCMD_LD3_PIN_POLARITY 0x00068806
+#define GFSCMD_LD4_PIN_POLARITY 0x00088806
+#define GFSCMD_LD5_PIN_POLARITY 0x000a8806
+#define GFSCMD_LD6_PIN_POLARITY 0x000c8806
+#define GFSCMD_LD7_PIN_POLARITY 0x000e8806
+#define GFSCMD_LD8_PIN_POLARITY 0x00108806
+#define GFSCMD_LD9_PIN_POLARITY 0x00128806
+#define GFSCMD_LD10_PIN_POLARITY 0x00148806
+#define GFSCMD_LD11_PIN_POLARITY 0x00168806
+#define GFSCMD_LD12_PIN_POLARITY 0x00188806
+#define GFSCMD_LD13_PIN_POLARITY 0x001a8806
+#define GFSCMD_LD14_PIN_POLARITY 0x001c8806
+#define GFSCMD_LD15_PIN_POLARITY 0x001e8806
+#define GFSCMD_LD0_LD15_PIN_POLARITY 0x00208806
+
+
+#define GF_LD0_POLARITY_HIGH 0x00000000
+#define GF_LD0_POLARITY_LOW 0x00000001
+#define GF_LD1_POLARITY_HIGH 0x00000000
+#define GF_LD1_POLARITY_LOW 0x00000004
+#define GF_LD2_POLARITY_HIGH 0x00000000
+#define GF_LD2_POLARITY_LOW 0x00000010
+#define GF_LD3_POLARITY_HIGH 0x00000000
+#define GF_LD3_POLARITY_LOW 0x00000040
+#define GF_LD4_POLARITY_HIGH 0x00000000
+#define GF_LD4_POLARITY_LOW 0x00000100
+#define GF_LD5_POLARITY_HIGH 0x00000000
+#define GF_LD5_POLARITY_LOW 0x00000400
+#define GF_LD6_POLARITY_HIGH 0x00000000
+#define GF_LD6_POLARITY_LOW 0x00001000
+#define GF_LD7_POLARITY_HIGH 0x00000000
+#define GF_LD7_POLARITY_LOW 0x00004000
+#define GF_LD8_POLARITY_HIGH 0x00000000
+#define GF_LD8_POLARITY_LOW 0x00010000
+#define GF_LD9_POLARITY_HIGH 0x00000000
+#define GF_LD9_POLARITY_LOW 0x00040000
+#define GF_LD10_POLARITY_HIGH 0x00000000
+#define GF_LD10_POLARITY_LOW 0x00100000
+#define GF_LD11_POLARITY_HIGH 0x00000000
+#define GF_LD11_POLARITY_LOW 0x00400000
+#define GF_LD12_POLARITY_HIGH 0x00000000
+#define GF_LD12_POLARITY_LOW 0x01000000
+#define GF_LD13_POLARITY_HIGH 0x00000000
+#define GF_LD13_POLARITY_LOW 0x04000000
+#define GF_LD14_POLARITY_HIGH 0x00000000
+#define GF_LD14_POLARITY_LOW 0x10000000
+#define GF_LD15_POLARITY_HIGH 0x00000000
+#define GF_LD15_POLARITY_LOW 0x40000000
+#define GF_LD0_LD15_POLARITY_HIGH 0x00000000
+#define GF_LD0_LD15_POLARITY_LOW 0x55555555
+
+#define OFFSET_PIN_OUTPUT_POLARITY1 0x00000807
+#define GFSCMD_LD16_PIN_POLARITY 0x00008807
+#define GFSCMD_LD17_PIN_POLARITY 0x00028807
+#define GFSCMD_LPW0_PIN_POLARITY 0x00108807
+#define GFSCMD_LPW1_PIN_POLARITY 0x00128807
+#define GFSCMD_LPW2_PIN_POLARITY 0x00148807
+#define GFSCMD_LSC0_PIN_POLARITY 0x00188807
+#define GFSCMD_LSC1_PIN_POLARITY 0x001a8807
+#define GFSCMD_LVS_PIN_POLARITY 0x001c8807
+#define GFSCMD_LHS_PIN_POLARITY 0x001e8807
+#define GFSCMD_LD16_LD17_PIN_POLARITY 0x00208807
+
+#define GF_LD16_POLARITY_HIGH 0x00000000
+#define GF_LD16_POLARITY_LOW 0x00000001
+#define GF_LD17_POLARITY_HIGH 0x00000000
+#define GF_LD17_POLARITY_LOW 0x00000004
+#define GF_LPW0_POLARITY_HIGH 0x00000000
+#define GF_LPW0_POLARITY_LOW 0x00010000
+#define GF_LPW1_POLARITY_HIGH 0x00000000
+#define GF_LPW1_POLARITY_LOW 0x00040000
+#define GF_LPW2_POLARITY_HIGH 0x00000000
+#define GF_LPW2_POLARITY_LOW 0x00100000
+#define GF_LSC0_POLARITY_HIGH 0x00000000
+#define GF_LSC0_POLARITY_LOW 0x01000000
+#define GF_LSC1_POLARITY_HIGH 0x00000000
+#define GF_LSC1_POLARITY_LOW 0x04000000
+#define GF_LVS_POLARITY_HIGH 0x00000000
+#define GF_LVS_POLARITY_LOW 0x10000000
+#define GF_LHS_POLARITY_HIGH 0x00000000
+#define GF_LHS_POLARITY_LOW 0x40000000
+#define GF_LD16_LD17_POLARITY_HIGH 0x00000000
+#define GF_LD16_LD17_POLARITY_LOW 0x00000005
+
+#define DC_PIN_OUTPUT_POLARITY2 0x00000808
+#define GFSCMD_LHP0_PIN_POLARITY 0x00008808
+#define GFSCMD_LHP1_PIN_POLARITY 0x00028808
+#define GFSCMD_LHP2_PIN_POLARITY 0x00048808
+#define GFSCMD_LVP0_PIN_POLARITY 0x00088808
+#define GFSCMD_LVP1_PIN_POLARITY 0x000A8808
+#define GFSCMD_LM0_PIN_POLARITY 0x00108808
+#define GFSCMD_LM1_PIN_POLARITY 0x00128808
+#define GFSCMD_LDI_PIN_POLARITY 0x00148808
+#define GFSCMD_LPP_PIN_POLARITY 0x00168808
+
+#define GF_LHP0_POLARITY_HIGH 0x00000000
+#define GF_LHP0_POLARITY_LOW 0x00000001
+#define GF_LHP1_POLARITY_HIGH 0x00000000
+#define GF_LHP1_POLARITY_LOW 0x00000004
+#define GF_LHP2_POLARITY_HIGH 0x00000000
+#define GF_LHP2_POLARITY_LOW 0x00000010
+#define GF_LVP0_POLARITY_HIGH 0x00000000
+#define GF_LVP0_POLARITY_LOW 0x00000100
+#define GF_LVP1_POLARITY_HIGH 0x00000000
+#define GF_LVP1_POLARITY_LOW 0x00000404
+#define GF_LM0_POLARITY_HIGH 0x00000000
+#define GF_LM0_POLARITY_LOW 0x00010000
+#define GF_LM1_POLARITY_HIGH 0x00000000
+#define GF_LM1_POLARITY_LOW 0x00040000
+#define GF_LDI_POLARITY_HIGH 0x00000000
+#define GF_LDI_POLARITY_LOW 0x00100000
+#define GF_LPP_POLARITY_HIGH 0x00000000
+#define GF_LPP_POLARITY_LOW 0x00400000
+
+#define OFFSET_OUTPUT_POLARITY3 0x00000809
+#define GFSCMD_LSCK_PIN_POLARITY 0x00008809
+#define GFSCMD_LSDA_PIN_POLARITY 0x00028809
+#define GFSCMD_LCSN_PIN_POLARITY 0x00048809
+#define GFSCMD_LDC_PIN_POLARITY 0x00068809
+#define GFSCMD_LSPI_PIN_POLARITY 0x00088809
+
+#define GF_LSCK_POLARITY_HIGH 0x00000000
+#define GF_LSCK_POLARITY_LOW 0x00000001
+#define GF_LSDA_POLARITY_HIGH 0x00000000
+#define GF_LSDA_POLARITY_LOW 0x00000004
+#define GF_LCSN_POLARITY_HIGH 0x00000000
+#define GF_LCSN_POLARITY_LOW 0x00000010
+#define GF_LDC_POLARITY_HIGH 0x00000000
+#define GF_LDC_POLARITY_LOW 0x00000040
+#define GF_LSPI_POLARITY_HIGH 0x00000000
+#define GF_LSPI_POLARITY_LOW 0x00000100
+
+// Pin Output data registers
+
+#define OFFSET_PIN_OUTPUT_DATA0 0x0000080a
+#define GFSCMD_LD0_PIN_OUTPUT_DATA 0x0000880a
+#define GFSCMD_LD1_PIN_OUTPUT_DATA 0x0002880a
+#define GFSCMD_LD2_PIN_OUTPUT_DATA 0x0004880a
+#define GFSCMD_LD3_PIN_OUTPUT_DATA 0x0006880a
+#define GFSCMD_LD4_PIN_OUTPUT_DATA 0x0008880a
+#define GFSCMD_LD5_PIN_OUTPUT_DATA 0x000a880a
+#define GFSCMD_LD6_PIN_OUTPUT_DATA 0x000c880a
+#define GFSCMD_LD7_PIN_OUTPUT_DATA 0x000e880a
+#define GFSCMD_LD8_PIN_OUTPUT_DATA 0x0010880a
+#define GFSCMD_LD9_PIN_OUTPUT_DATA 0x0012880a
+#define GFSCMD_LD10_PIN_OUTPUT_DATA 0x0014880a
+#define GFSCMD_LD11_PIN_OUTPUT_DATA 0x0016880a
+#define GFSCMD_LD12_PIN_OUTPUT_DATA 0x0018880a
+#define GFSCMD_LD13_PIN_OUTPUT_DATA 0x001a880a
+#define GFSCMD_LD14_PIN_OUTPUT_DATA 0x001c880a
+#define GFSCMD_LD15_PIN_OUTPUT_DATA 0x001e880a
+#define GFSCMD_LD0_LD15_PIN_OUTPUT_DATA 0x0020880a
+
+
+#define GF_LD0_DATA_LOW 0x00000002
+#define GF_LD0_DATA_HIGH 0x00000003
+#define GF_LD1_DATA_LOW 0x00000008
+#define GF_LD1_DATA_HIGH 0x0000000c
+#define GF_LD2_DATA_LOW 0x00000020
+#define GF_LD2_DATA_HIGH 0x00000030
+#define GF_LD3_DATA_LOW 0x00000080
+#define GF_LD3_DATA_HIGH 0x000000c0
+#define GF_LD4_DATA_LOW 0x00000200
+#define GF_LD4_DATA_HIGH 0x00000300
+#define GF_LD5_DATA_LOW 0x00000800
+#define GF_LD5_DATA_HIGH 0x00000c00
+#define GF_LD6_DATA_LOW 0x00002000
+#define GF_LD6_DATA_HIGH 0x00003000
+#define GF_LD7_DATA_LOW 0x00008000
+#define GF_LD7_DATA_HIGH 0x0000c000
+#define GF_LD8_DATA_LOW 0x00020000
+#define GF_LD8_DATA_HIGH 0x00030000
+#define GF_LD9_DATA_LOW 0x00080000
+#define GF_LD9_DATA_HIGH 0x000c0000
+#define GF_LD10_DATA_LOW 0x00200000
+#define GF_LD10_DATA_HIGH 0x00300000
+#define GF_LD11_DATA_LOW 0x00800000
+#define GF_LD11_DATA_HIGH 0x00c00000
+#define GF_LD12_DATA_LOW 0x02000000
+#define GF_LD12_DATA_HIGH 0x03000000
+#define GF_LD13_DATA_LOW 0x08000000
+#define GF_LD13_DATA_HIGH 0x0c000000
+#define GF_LD14_DATA_LOW 0x20000000
+#define GF_LD14_DATA_HIGH 0x30000000
+#define GF_LD15_DATA_LOW 0x80000000
+#define GF_LD15_DATA_HIGH 0xc0000000
+#define GF_LD0_LD15_DATA_LOW 0xaaaaaaaa
+#define GF_LD0_LD15_DATA_HIGH 0xffffffff
+
+#define OFFSET_PIN_OUTPUT_DATA1 0x0000080b
+#define GFSCMD_LD16_PIN_OUTPUT_DATA 0x0000880b
+#define GFSCMD_LD17_PIN_OUTPUT_DATA 0x0002880b
+#define GFSCMD_LPW0_PIN_OUTPUT_DATA 0x0010880b
+#define GFSCMD_LPW1_PIN_OUTPUT_DATA 0x0012880b
+#define GFSCMD_LPW2_PIN_OUTPUT_DATA 0x0014880b
+#define GFSCMD_LSC0_PIN_OUTPUT_DATA 0x0018880b
+#define GFSCMD_LSC1_PIN_OUTPUT_DATA 0x001a880b
+#define GFSCMD_LVS_PIN_OUTPUT_DATA 0x001c880b
+#define GFSCMD_LHS_PIN_OUTPUT_DATA 0x001e880b
+#define GFSCMD_LD16_LD17_PIN_OUTPUT_DATA 0x0020880b
+
+#define GF_LD16_DATA_LOW 0x00000002
+#define GF_LD16_DATA_HIGH 0x00000003
+#define GF_LD17_DATA_LOW 0x00000008
+#define GF_LD17_DATA_HIGH 0x0000000c
+#define GF_LPW0_DATA_LOW 0x00020000
+#define GF_LPW0_DATA_HIGH 0x00030000
+#define GF_LPW1_DATA_LOW 0x00080000
+#define GF_LPW1_DATA_HIGH 0x000c0000
+#define GF_LPW2_DATA_LOW 0x00200000
+#define GF_LPW2_DATA_HIGH 0x00300000
+#define GF_LSC0_DATA_LOW 0x02000000
+#define GF_LSC0_DATA_HIGH 0x03000000
+#define GF_LSC1_DATA_LOW 0x08000000
+#define GF_LSC1_DATA_HIGH 0x0c000000
+#define GF_LVS_DATA_LOW 0x20000000
+#define GF_LVS_DATA_HIGH 0x30000000
+#define GF_LHS_DATA_LOW 0x80000000
+#define GF_LHS_DATA_HIGH 0xc0000000
+#define GF_LD16_LD17_DATA_LOW 0x0000000a
+#define GF_LD16_LD17_DATA_HIGH 0x0000000f
+
+
+#define OFFSET_PIN_OUTPUT_DATA2 0x0000080c
+#define GFSCMD_LHP0_PIN_OUTPUT_DATA 0x0000880c
+#define GFSCMD_LHP1_PIN_OUTPUT_DATA 0x0002880c
+#define GFSCMD_LHP2_PIN_OUTPUT_DATA 0x0004880c
+#define GFSCMD_LVP0_PIN_OUTPUT_DATA 0x0008880c
+#define GFSCMD_LVP1_PIN_OUTPUT_DATA 0x000A880c
+#define GFSCMD_LM0_PIN_OUTPUT_DATA 0x0010880c
+#define GFSCMD_LM1_PIN_OUTPUT_DATA 0x0012880c
+#define GFSCMD_LDI_PIN_OUTPUT_DATA 0x0014880c
+#define GFSCMD_LPP_PIN_OUTPUT_DATA 0x0016880c
+
+#define GF_LHP0_DATA_LOW 0x00000002
+#define GF_LHP0_DATA_HIGH 0x00000003
+#define GF_LHP1_DATA_LOW 0x00000008
+#define GF_LHP1_DATA_HIGH 0x0000000c
+#define GF_LHP2_DATA_LOW 0x00000020
+#define GF_LHP2_DATA_HIGH 0x00000030
+#define GF_LVP0_DATA_LOW 0x00000200
+#define GF_LVP0_DATA_HIGH 0x00000300
+#define GF_LVP1_DATA_LOW 0x00000800
+#define GF_LVP1_DATA_HIGH 0x00000c00
+#define GF_LM0_DATA_LOW 0x00020000
+#define GF_LM0_DATA_HIGH 0x00030000
+#define GF_LM1_DATA_LOW 0x00080000
+#define GF_LM1_DATA_HIGH 0x000c0000
+#define GF_LDI_DATA_LOW 0x00200000
+#define GF_LDI_DATA_HIGH 0x00300000
+#define GF_LPP_DATA_LOW 0x00800000
+#define GF_LPP_DATA_HIGH 0x00c00000
+
+#define OFFSET_OUTPUT_DATA3 0x0000080d
+#define GFSCMD_LSCK_PIN_OUTPUT_DATA 0x0000880d
+#define GFSCMD_LSDA_PIN_OUTPUT_DATA 0x0002880d
+#define GFSCMD_LCSN_PIN_OUTPUT_DATA 0x0004880d
+#define GFSCMD_LDC_PIN_OUTPUT_DATA 0x0006880d
+#define GFSCMD_LSPI_PIN_OUTPUT_DATA 0x0008880d
+
+#define GF_LSCK_DATA_LOW 0x00000002
+#define GF_LSCK_DATA_HIGH 0x00000003
+#define GF_LSDA_DATA_LOW 0x00000008
+#define GF_LSDA_DATA_HIGH 0x0000000c
+#define GF_LCSN_DATA_LOW 0x00000020
+#define GF_LCSN_DATA_HIGH 0x00000030
+#define GF_LDC_DATA_LOW 0x00000080
+#define GF_LDC_DATA_HIGH 0x000000c0
+#define GF_LSPI_DATA_LOW 0x00000200
+#define GF_LSPI_DATA_HIGH 0x00000300
+
+// Pin Input Enable
+
+#define GFSCMD_LSPI_PIN_INPUT 0x00088811
+#define GF_LSPI_INPUT_ENABLE 0x00000000
+#define GF_LSPI_INPUT_DISABLE 0x00000100
+
+#define GFSCMD_LDC_PIN_INPUT 0x00088411
+#define GF_LDC_INPUT_ENABLE 0x00000000
+#define GF_LDC_INPUT_DISABLE 0x00000040
+
+#define GFSCMD_LPP_PIN_INPUT 0x00168811
+#define GF_LPP_INPUT_ENABLE 0x00000000
+#define GF_LPP_INPUT_DISABLE 0x00400000
+
+// Pin Output Select
+
+#define DC_PIN_OUTPUT_SELECT0 0x00000814
+#define GFSCMD_LD0_OUTPUT_SELECT 0x00008814
+#define GFSCMD_LD1_OUTPUT_SELECT 0x00048814
+#define GFSCMD_LD2_OUTPUT_SELECT 0x00088814
+#define GFSCMD_LD3_OUTPUT_SELECT 0x000C8814
+#define GFSCMD_LD4_OUTPUT_SELECT 0x00108814
+#define GFSCMD_LD5_OUTPUT_SELECT 0x00148814
+#define GFSCMD_LD6_OUTPUT_SELECT 0x00188814
+#define GFSCMD_LD7_OUTPUT_SELECT 0x001C8814
+#define GFSCMD_LD0_LD7_OUTPUT_SELECT 0x00208814
+
+#define GF_LD0_PIN_FOR_LD0 0
+#define GF_LD0_PIN_FOR_LD0_OUT 1
+#define GF_LD0_PIN_FOR_SC_ 4
+#define GF_LD1_PIN_FOR_LD1 0
+#define GF_LD1_PIN_FOR_LD1_OUT 1
+#define GF_LD1_PIN_FOR_SC 4
+#define GF_LD2_PIN_FOR_LD2 0
+#define GF_LD2_PIN_FOR_LD2_OUT 1
+#define GF_LD2_PIN_FOR_SD0_ 4
+#define GF_LD3_PIN_FOR_LD3 0
+#define GF_LD3_PIN_FOR_LD3_OUT 1
+#define GF_LD3_PIN_FOR_SD0 4
+#define GF_LD4_PIN_FOR_LD4 0
+#define GF_LD4_PIN_FOR_LD4_OUT 1
+#define GF_LD4_PIN_FOR_SD1_ 4
+#define GF_LD5_PIN_FOR_LD5 0
+#define GF_LD5_PIN_FOR_LD5_OUT 1
+#define GF_LD5_PIN_FOR_SD1 4
+#define GF_LD6_PIN_FOR_LD6 0
+#define GF_LD6_PIN_FOR_LD6_OUT 1
+#define GF_LD6_PIN_FOR_STH 4
+#define GF_LD7_PIN_FOR_LD7 0
+#define GF_LD7_PIN_FOR_LD7_OUT 1
+#define GF_LD7_PIN_FOR_SDT 4
+#define GF_LD0_LD7_PIN_FOR_LD0_LD7 0x00000000
+#define GF_LD0_LD7_PIN_FOR_LD0_LD7_OUT 0x11111111
+#define GF_LD0_LD7_PIN_FOR_LPD0_LPD7_OUT 0x22222222
+
+#define DC_PIN_OUTPUT_SELECT1 0x00000815
+#define GFSCMD_LD8_OUTPUT_SELECT 0x00008815
+#define GFSCMD_LD9_OUTPUT_SELECT 0x00048815
+#define GFSCMD_LD10_OUTPUT_SELECT 0x00088815
+#define GFSCMD_LD11_OUTPUT_SELECT 0x000C8815
+#define GFSCMD_LD12_OUTPUT_SELECT 0x00108815
+#define GFSCMD_LD13_OUTPUT_SELECT 0x00148815
+#define GFSCMD_LD14_OUTPUT_SELECT 0x00188815
+#define GFSCMD_LD15_OUTPUT_SELECT 0x001C8815
+#define GFSCMD_LD8_LD15_OUTPUT_SELECT 0x00208815
+
+#define GF_LD8_PIN_FOR_LD8 0
+#define GF_LD8_PIN_FOR_LD8_OUT 1
+#define GF_LD8_PIN_FOR_LPD8_OUT 2
+#define GF_LD8_PIN_FOR_STP 4
+#define GF_LD9_PIN_FOR_LD9 0
+#define GF_LD9_PIN_FOR_LD9_OUT 1
+#define GF_LD9_PIN_FOR_LPD9_OUT 2
+#define GF_LD9_PIN_FOR_SD2_ 4
+#define GF_LD10_PIN_FOR_LD10 0
+#define GF_LD10_PIN_FOR_LD10_OUT 1
+#define GF_LD10_PIN_FOR_SD2 4
+#define GF_LD11_PIN_FOR_LD11 0
+#define GF_LD11_PIN_FOR_LD11_OUT 1
+#define GF_LD12_PIN_FOR_LD12 0
+#define GF_LD12_PIN_FOR_LD12_OUT 1
+#define GF_LD13_PIN_FOR_LD13 0
+#define GF_LD13_PIN_FOR_LD13_OUT 1
+#define GF_LD14_PIN_FOR_LD14 0
+#define GF_LD14_PIN_FOR_LD14_OUT 1
+#define GF_LD15_PIN_FOR_LD15 0
+#define GF_LD15_PIN_FOR_LD15_OUT 1
+#define GF_LD8_LD15_PIN_FOR_LD8_LD15 0x00000000
+#define GF_LD8_LD15_PIN_FOR_LD8_LD15_OUT 0x11111111
+#define GF_LD8_LD15_PIN_FOR_LPD8_LPD15_OUT 0x22222222
+
+#define DC_PIN_OUTPUT_SELECT2 0x00000816
+#define GFSCMD_LD16_OUTPUT_SELECT 0x00008816
+#define GFSCMD_LD17_OUTPUT_SELECT 0x00048816
+
+#define GF_LD16_PIN_FOR_LD16 0
+#define GF_LD16_PIN_FOR_LD16_OUT 1
+#define GF_LD17_PIN_FOR_LD17 0
+#define GF_LD17_PIN_FOR_LD17_OUT 1
+
+#define OFFSET_PIN_OUTPUT_SELECT3 0x00000817
+#define GFSCMD_LPW0_OUTPUT_SELECT 0x00008817
+#define GFSCMD_LPW1_OUTPUT_SELECT 0x00048817
+#define GFSCMD_LPW2_OUTPUT_SELECT 0x00088817
+#define GFSCMD_LSC0_OUTPUT_SELECT 0x00108817
+#define GFSCMD_LSC1_OUTPUT_SELECT 0x00148817
+#define GFSCMD_LVS_OUTPUT_SELECT 0x00188817
+#define GFSCMD_LHS_OUTPUT_SELECT 0x001c8817
+
+#define GF_LPW0_PIN_FOR_PW0 0
+#define GF_LPW0_PIN_FOR_PW0_OUT 1
+#define GF_LPW0_PIN_FOR_PW1 2
+#define GF_LPW0_PIN_FOR_PM0 3
+#define GF_LPW0_PIN_FOR_PW2 4
+#define GF_LPW1_PIN_FOR_PW1 0
+#define GF_LPW1_PIN_FOR_PW1_OUT 1
+#define GF_LPW1_PIN_FOR_PW2 2
+#define GF_LPW1_PIN_FOR_PM1 3
+#define GF_LPW1_PIN_FOR_PW3 4
+#define GF_LPW2_PIN_FOR_PW2 0
+#define GF_LPW2_PIN_FOR_PW2_OUT 1
+#define GF_LPW2_PIN_FOR_PW3 2
+#define GF_LPW2_PIN_FOR_PM0 3
+#define GF_LPW2_PIN_FOR_PW4 4
+#define GF_LSC0_PIN_FOR_LSC0 0
+#define GF_LSC0_PIN_FOR_LSC0_OUT 1
+#define GF_LSC1_PIN_FOR_LSC1 0
+#define GF_LSC1_PIN_FOR_LSC1_OUT 1
+#define GF_LSC1_PIN_FOR_LSC1_DE 2
+#define GF_LVS_PIN_FOR_VSYNC 0
+#define GF_LVS_PIN_FOR_LVS_OUT 1
+#define GF_LVS_PIN_FOR_PM1 3
+#define GF_LHS_PIN_FOR_HSYNC 0
+#define GF_LHS_PIN_FOR_LHS_OUT 1
+#define GF_LHS_PIN_FOR_PM0 3
+
+#define OFSSET_PIN_OUTPUT_SELECT4 0x00000818
+#define GFSCMD_LHP0_OUTPUT_SELECT 0x00008818
+#define GFSCMD_LHP1_OUTPUT_SELECT 0x00048818
+#define GFSCMD_LHP2_OUTPUT_SELECT 0x00088818
+#define GFSCMD_LVP0_OUTPUT_SELECT 0x00108818
+#define GFSCMD_LVP1_OUTPUT_SELECT 0x00148818
+
+#define GF_LHP0_PIN_FOR_LHP0 0
+#define GF_LHP0_PIN_FOR_LHP0_OUT 1
+#define GF_LHP0_PIN_FOR_LD21 2
+#define GF_LHP0_PIN_FOR_PM0 3
+#define GF_LHP1_PIN_FOR_LHP1 0
+#define GF_LHP1_PIN_FOR_LHP1_OUT 1
+#define GF_LHP1_PIN_FOR_LD18 2
+#define GF_LHP1_PIN_FOR_PM1 3
+#define GF_LHP2_PIN_FOR_LHP2 0
+#define GF_LHP2_PIN_FOR_LHP2_OUT 1
+#define GF_LHP2_PIN_FOR_LD19 2
+#define GF_LHP2_PIN_FOR_PM0 3
+#define GF_LHP2_PIN_FOR_LVP2 4
+#define GF_LVP0_PIN_FOR_LVP0 0
+#define GF_LVP0_PIN_FOR_LVP0_OUT 1
+#define GF_LVP0_PIN_FOR_PM0 3
+#define GF_LVP1_PIN_FOR_LVP1 0
+#define GF_LVP1_PIN_FOR_LVP1_OUT 1
+#define GF_LVP1_PIN_FOR_LD20 2
+#define GF_LVP1_PIN_FOR_PM1 3
+#define GF_LVP1_PIN_FOR_PW4 4
+
+#define OFFSET_PIN_OUTPUT_SELECT5 0x00000819
+#define GFSCMD_LM0_OUTPUT_SELECT 0x00008819
+#define GFSCMD_LM1_OUTPUT_SELECT 0x00048819
+#define GFSCMD_LDI_OUTPUT_SELECT 0x00088819
+#define GFSCMD_LPP_OUTPUT_SELECT 0x000c8819
+
+#define GF_LM0_PIN_FOR_LM0 0
+#define GF_LM0_PIN_FOR_LM0_OUT 1
+#define GF_LM0_PIN_FOR_SCS 2
+#define GF_LM0_PIN_FOR_PM0 3
+#define GF_LM0_PIN_FOR_LVP2 4
+#define GF_LM1_PIN_FOR_M1 0
+#define GF_LM1_PIN_FOR_LM1_OUT 1
+#define GF_LM1_PIN_FOR_LD21 2
+#define GF_LM1_PIN_FOR_PM1 3
+#define GF_LM1_PIN_FOR_LVP3 4
+#define GF_LDI_PIN_FOR_DI 0
+#define GF_LDI_PIN_FOR_LDI_OUT 1
+#define GF_LDI_PIN_FOR_LD22 2
+#define GF_LDI_PIN_FOR_PM0 3
+#define GF_LDI_PIN_FOR_SCS 4
+#define GF_LPP_PIN_FOR_PP 0
+#define GF_LPP_PIN_FOR_LPP_OUT 1
+#define GF_LPP_PIN_FOR_LD23 2
+#define GF_LPP_PIN_FOR_PM1 3
+#define GF_LPP_PIN_FOR_LVP3 4
+
+#define OFFSET_PIN_OUTPUT_SELECT6 0x0000081a
+#define GFSCMD_LSCK_OUTPUT_SELECT 0x0000881a
+#define GFSCMD_LSDA_OUTPUT_SELECT 0x0004881a
+#define GFSCMD_LCSN_OUTPUT_SELECT 0x0008881a
+#define GFSCMD_LDC_OUTPUT_SELECT 0x000c881a
+#define GFSCMD_LSPI_OUTPUT_SELECT 0x0010881a
+
+#define GF_LSCK_PIN_FOR_SCK 0
+#define GF_LSCK_PIN_FOR_LSCK_OUT 1
+#define GF_LSCK_PIN_FOR_PM0 3
+#define GF_LSDA_PIN_FOR_SDA 0
+#define GF_LSDA_PIN_FOR_LSDA_OUT 1
+#define GF_LSDA_PIN_FOR_SCS 2
+#define GF_LSDA_PIN_FOR_PM1 3
+#define GF_LCS_PIN_FOR_MCS 0
+#define GF_LCS_PIN_FOR_LCS_OUT 1
+#define GF_LCS_PIN_FOR_PM0 3
+#define GF_LDC_PIN_FOR_SDC 0
+#define GF_LDC_PIN_FOR_LDC_OUT 1
+#define GF_LDC_PIN_FOR_LD22 2
+#define GF_LDC_PIN_FOR_PM1 3
+#define GF_LSPI_PIN_FOR_SPI 0
+#define GF_LSPI_PIN_FOR_LSPI_OUT 1
+#define GF_LSPI_PIN_FOR_DE 2
+#define GF_LSPI_PIN_FOR_PM0 3
+#define GF_LSPI_PIN_FOR_PCLK 4
+
+
+//#define OFFSET_PIN_MISC_CONTROL 0x0000081b
+//#define DISP_CLOCK_OUTPUT_MASK
+//#define DISP_CLOCK_OUTPUT_SHIFT
+//#define DISP_CLOCK_OUTPUT_DISABLE
+//#define DISP_CLOCK_OUTPUT_ENABLE
+
+#define OFFSET_PM0_CONTROL 0x0000081c
+#define GFSCMD_PM0_CLOCK_SELECT 0x0000881c
+#define GFSCMD_PM0_CLOCK_DIVIDER 0x0004881c
+#define GFSCMD_PM0_PERIOD 0x0012881c
+
+#define GF_PM0_SHIFT_CLOCK 0x00000000
+#define GF_PM0_PIXEL_CLOCK 0x00000001
+#define GF_PM0_LINE_CLOCK 0x00000002
+#define GF_PM0_FRAME_CLOCK 0x00000003
+#define GF_PM0_CLOCK_DIVIDER_VAL 0x00000010
+#define GF_PM0_PERIOD_VAL 0x00040000
+
+#define OFFSET_PM0_DUTY_CYCLE 0x0000081d
+#define GFSCMD_PM0_DUTY_CYCLE 0x0000881d
+
+#define GF_PM0_DUTY_CYCLE_VAL 0x00000000
+
+#define OFFSET_PM1_CONTROL 0x0000081e
+#define GFSCMD_PM1_CLOCK_SELECT 0x0000881e
+#define GFSCMD_PM1_CLOCK_DIVIDER 0x0004881e
+#define GFSCMD_PM1_PERIOD 0x0012881e
+
+#define GF_PM1_SHIFT_CLOCK 0x00000000
+#define GF_PM1_PIXEL_CLOCK 0x00000001
+#define GF_PM1_LINE_CLOCK 0x00000002
+#define GF_PM1_FRAME_CLOCK 0x00000003
+#define GF_PM1_CLOCK_DIVIDER_VAL 0x00000010
+#define GF_PM1_PERIOD_VAL 0x00040000
+
+#define OFFSET_PM1_DUTY_CYCLE 0x0000081f
+#define GFSCMD_PM1_DUTY_CYCLE 0x0000881f
+
+#define GF_PM1_DUTY_CYCLE_VAL 0x00000000
+
+////////////////////////
+#define OFFSET_SPI_CONTROL 0x00000820
+#define GFSCMD_SPI_SERIAL_CLK_CONTROL 0x00008820
+#define GFSCMD_SPI_DATA_DIRECTION 0x00038820
+#define GFSCMD_SPI_BITS_PER_CYCLE 0x00048820
+#define GFSCMD_SPI_CLK_DIVIDER_1_32 0x00108820
+#define GFSCMD_SPI_STATUS 0x00188820
+
+#define GF_SPI_1SCLK_CS_RISING_EDGE_ACTV 0x00000000
+#define GF_SPI_2SCLK_CS_RISING_EDGE_ACTV 0x00000001
+#define GF_SPI_1SCLK_CS_FALLING_EDGE_ACTV 0x00000002
+#define GF_SPI_2SCLK_CS_FALLING_EDGE_ACTV 0x00000003
+#define GF_SPI_MSB2LSB 0x00000000
+#define GF_SPI_LSB2MSB 0x00000008
+#define GF_SPI8 0x00000000
+#define GF_SPI8DC 0x00000010
+#define GF_SPI12 0x00000020
+#define GF_SPI16 0x00000030
+#define GF_SPI16DC 0x00000040
+#define GF_START_BYTE_PLUS_SPI16 0x00000050
+#define GF_SPI18 0x00000060
+#define GF_SPI24 0x00000070
+//#define GF_SPI_CLK_DIVIDER_1_32_VAL
+#define GF_SPI_STATUS_DISABLE 0x00000000
+#define GF_STATUS_ENABLE_HOST_SPI 0x01000000
+#define GF_STATUS_ENABLE_HOST_IS_SPI 0x02000000
+#define GF_STATUS_ENABLE_ALL_SPI_CYCL 0x03000000
+
+//#define OFFSET_HSPI_START_BYTE 0x00000821
+#define GFSCMD_HSPI_DATA_START_BYTE 0x00008821
+#define GFSCMD_HSPI_START_BYTE 0x00008821
+//#define GFSCMD_HSPI_COMMAND_START_BYTE 0x00088821
+
+//#define OFFSET_HSPI_WRITE_DATA_CD 0x00000822
+#define GFSCMD_HSPI_WRITE_DATA_A 0x00008822
+#define GFSCMD_HSPI_WRITE_DATA_B 0x00088822
+#define GFSCMD_HSPI_WRITE_DATA_AB 0x00208822
+
+//#define OFFSET_HSPI_WRITE_DATA_CD 0x00000823
+#define GFSCMD_HSPI_WRITE_DATA_C 0x00008823
+#define GFSCMD_HSPI_WRITE_DATA_D 0x00088823
+#define GFSCMD_HSPI_WRITE_DATA_CD 0x00208823
+
+#define GF_HSPI_CMD_CYCLE1 0
+#define GF_HSPI_CMD_CYCLE2 0
+#define GF_HSPI_CMD_CYCLE3 0
+#define GF_HSPI_CMD_CYCLE4 0
+
+#define GF_HSPI_DATA_CYCLE1 1
+#define GF_HSPI_DATA_CYCLE2 2
+#define GF_HSPI_DATA_CYCLE3 4
+#define GF_HSPI_DATA_CYCLE4 8
+
+#define GF_HSPI_MAIN_CS_CYCLE1 1
+#define GF_HSPI_MAIN_CS_CYCLE2 2
+#define GF_HSPI_MAIN_CS_CYCLE3 4
+#define GF_HSPI_MAIN_CS_CYCLE4 8
+
+#define GF_HSPI_SUB_CS_CYCLE1 1
+#define GF_HSPI_SUB_CS_CYCLE2 2
+#define GF_HSPI_SUB_CS_CYCLE3 4
+#define GF_HSPI_SUB_CS_CYCLE4 8
+
+//////////////////////////
+
+#if 0
+// LCD SPI interface signals
+
+#define DC_P_LCD_SPI_OPTIONS 0x00000135
+#define GF_LCD_SPI_CS 0x00008135
+#define GF_LCD_SPI_DC 0x00018135
+#define GF_SPI_CS_CONTROL 0x00028135
+#define GF_LCD_SPI_DIRECTION 0x00048135
+
+#define GF_LCD_SPI_CS_MAIN 0x00000000
+#define GF_LCD_SPI_CS_SUB 0x00000001
+#define GF_LCD_SPI_DC_LOW 0x00000000
+#define GF_LCD_SPI_DC_HIGH 0x00000002
+#define GF_SPI_CS_CONTROL_LCD_IS_SPI 0x00000000
+#define GF_SPI_CS_CONTROL_LCD_SPI 0x00000004
+#define GF_SPI_CS_CONTROL_IS_SPI 0x00000008
+#define GF_SPI_CS_CONTROL_FORCED 0x0000000C
+#define GF_LCD_SPI_DIRECTION_MSB2LSB 0x00000000
+#define GF_LCD_SPI_DIRECTION_LSB2MSB 0x00000010
+#endif
+
+// Class: Initialization Sequence (IS)
+
+#define OFSSET_P_INIT_SEQ_CONTROL 0x00000141
+#define GFSCMD_SEND_INIT_SEQUENCE 0x00008141
+#define GFSCMD_INIT_SEQUENCE_MODE_PLCD 0x00018141
+#define GFSCMD_INIT_SEQ_DC_SIGNAL_NODC 0x00048141
+#define GFSCMD_INIT_SEQ_DC_CONTROL 0x00078141
+#define GFSCMD_FRAME_INIT_SEQ_CYCLES 0x00088141
+
+#define GF_SEND_INIT_SEQUENCE_DISABLE 0x00000000
+#define GF_SEND_INIT_SEQUENCE_ENABLE 0x00000001
+#define GF_INIT_SEQUENCE_MODE_PLCD_INIT 0x00000000
+#define GF_INIT_SEQUENCE_MODE_SPI_INIT 0x00000002
+#define GF_INIT_SEQ_SIGNAL_NODC 0x00000000
+#define GF_INIT_SEQ_SIGNAL_VSYNC 0x00000010
+#define GF_INIT_SEQ_SIGNAL_VPULSE0 0x00000020
+#define GF_INIT_SEQ_SIGNAL_VPULSE1 0x00000030
+#define GF_INIT_SEQ_SIGNAL_VPULSE2 0x00000040
+#define GF_INIT_SEQ_SIGNAL_VPULSE3 0x00000050
+#define GF_INIT_SEQ_CONTROL 0x00000080
+
+//#define GF_FRAME_INIT_SEQ_CYCLES 0x00000100
+
+
+// SPI Init Sequence Write Data bits 31-0
+#define DC_P_SPI_INIT_SEQ_DATA_A 0x00000142
+#define GFSCMD_SPI_INIT_SEQ_DATA_A 0x00008142
+
+// SPI Init Sequence Write Data bits 63-32
+#define DC_P_SPI_INIT_SEQ_DATA_B 0x00000143
+#define GFSCMD_SPI_INIT_SEQ_DATA_B 0x00008143
+
+// SPI Init Sequence Write Data bits 95-64
+#define DC_P_SPI_INIT_SEQ_DATA_C 0x00000144
+#define GFSCMD_SPI_INIT_SEQ_DATA_C 0x00008144
+
+// SPI Init Sequence Write Data bits 127-96
+#define DC_P_SPI_INIT_SEQ_DATA_D 0x00000145
+#define GFSCMD_SPI_INIT_SEQ_DATA_D 0x00008145
+
+#define OFFSET_DISPLAY_COMMAND 0x00000003
+#define GFSCMD_DISPLAY_CTRL_MODE 0x00058003
+
+#define GF_CTRL_MODE_STOP 0x00000000
+#define GF_CTRL_MODE_C_DISPLAY 0x00000020
+#define GF_CTRL_MODE_NC_DISPLAY 0x00000040
+#define GF_CTRL_MODE_NOCHANGE 0x000000C0
+
+
+/* Other Commands */
+
+#define GF_NO_DATA 0x00000000
+#define GFSCMD_LVDD_ON 0x01020000
+#define GFSCMD_LVDD_OFF 0x01020001
+
+#define GFSCMD_RESET_LHP2 0x0104880c
+#define GFSCMD_RESET_LVP0 0x0108880c
+#define GFSCMD_MS_DELAY 0x01005A5A
+#define GFSCMD_WAIT_VBLANK 0x01005555
+#define GFSCMD_END_OF_TABLE 0x0100ffff
+#define GFSCMD_I2C_A_PAL_PLL2_CLK 0x0100F000
+
+#define GFSDEFAULT_CMD 0x10000000 // Default settings
+#define GFSDEFAULT_BACKLIGHT0 0x10000001
+#define GF_ON_LPW2 0x00000000
+#define GF_ON_LPW0 0x00000001
+
+#define GFSDEFAULT_BACKLIGHT1 0x10000002
+#define GF_ON_LM1 0x00000000
+#define GF_ON_LPW1 0x00000001
+
+#define GFPDRV_CMD 0x20000000
+#define GFHOST_CMD 0x40000000
+#define GFSCMD_PANEL_PKT_HEADER_START 0x40000000
+
+#define GF_DLY_AFTR_DATA_SENT_MASK 0x00002000
+#define GF_A_2MS_DLY_AFTR_DATA_SENT 0x00000000
+#define GF_A_NO_DLY_AFTR_DATA_SENT 0x00002000
+
+#define GF_RAISE_WAIT_AFTR_DATA_SENT_MASK 0x00001000
+#define GF_A_RAISE_WAIT_AFTR_DATA_SENT 0x00001000
+
+#define GF_DATA_BURST_MASK 0x000000ff
+#define GF_A_DATA_BURST0 0x00000000
+#define GF_A_DATA_BURST1 0x00000001
+#define GF_A_DATA_BURST2 0x00000002
+#define GF_A_DATA_BURST3 0x00000003
+#define GF_A_DATA_BURST4 0x00000004
+#define GF_A_DATA_BURST5 0x00000005
+#define GF_A_DATA_BURST6 0x00000006
+#define GF_A_DATA_BURST7 0x00000007
+#define GF_A_DATA_BURST8 0x00000008
+
+#define GF_CS_MASK 0x000f0000
+#define GF_A_MCS_ACTVH 0x00010000
+#define GF_A_MCS_ACTVL 0x00020000
+#define GF_A_SCS_ACTVH 0x00030000
+#define GF_A_SCS_ACTVL 0x00040000
+
+#define GF_RS_DC_MASK 0x00f00000
+#define GF_A_RS_DC_IXH_DATAL 0x00100000
+#define GF_A_RS_DC_IXL_DATAL 0x00200000
+#define GF_A_RS_DC_IXL_DATAH 0x00300000
+#define GF_A_RS_DC_IXH_DATAH 0x00400000
+
+#define GF_IFACE_MASK 0x00008f00
+#define GF_A_IFACE_PRLL 0x00008000
+
+#define GF_A_IFACE_PRLL_8 0x00008100
+#define GF_A_IFACE_PRLL_9 0x00008200
+#define GF_A_IFACE_PRLL_16 0x00008300
+#define GF_A_IFACE_PRLL_18 0x00008400
+#define GF_A_IFACE_SPI_8 0x00000100
+#define GF_A_IFACE_SPI_8DC 0x00000200
+#define GF_A_IFACE_SPI_12 0x00000300
+#define GF_A_IFACE_SPI_16 0x00000400
+#define GF_A_IFACE_SPI_16DC 0x00000500
+#define GF_A_IFACE_SPI_16_START8 0x00000600
+#define GF_A_IFACE_SPI_18 0x00000700
+#define GF_A_IFACE_SPI_24 0x00000800
+#define GF_A_IF_LSB_ALINED 0x00004000
+#define GF_A_IF_MSB_ALINED 0x00000000
+#define GF_IF_ALINED_MASK 0x00004000
+
+#define GF_CLK_PER_PIXEL_MASK 0x3f000000
+#define GF_A_1CLK_PIXEL 0x01000000
+#define GF_A_2CLK_PIXEL 0x02000000
+#define GF_A_3CLK_PIXEL 0x03000000
+#define GF_A_4CLK_PIXEL 0x04000000
+#define GF_A_24CLK_PIXEL 0x18000000
+
+// Parellel
+#define GF_A_DATA_VLD_MASK 0xC0000000
+#define GF_A_DATA_VLD_CLK_RISE 0x40000000
+#define GF_A_DATA_VLD_CLK_FALL 0x80000000
+
+// Serial
+
+#define GF_SPI_SCLK_CS_EDGE_ACTV_MASK 0xC0000000
+#define GF_A_SPI_1SCLK_CS_RISING_EDGE_ACTV 0x40000000
+#define GF_A_SPI_2SCLK_CS_RISING_EDGE_ACTV 0x00000000
+#define GF_A_SPI_1SCLK_CS_FALLING_EDGE_ACTV 0xC0000000
+#define GF_A_SPI_2SCLK_CS_FALLING_EDGE_ACTV 0x80000000
+
+#define GF_A_SPI_CS_ACTVH 0x00010000
+#define GF_A_SPI_CS_ACTVL 0x00020000
+
+#define GF_SPI_RS_DC_MASK 0x00f00000
+#define GF_A_SPI_RS_DC_IXH_DATAL 0x00100000
+#define GF_A_SPI_RS_DC_IXL_DATAL 0x00200000
+#define GF_A_SPI_RS_DC_IXL_DATAH 0x00300000
+#define GF_A_SPI_RS_DC_IXH_DATAH 0x00400000
+
+
+#define GF_B_ 0x00000000
+#define GF_C_ 0x00000000
+
+#define GF_SPI_DATA_START_BYTE 0x00000000
+#define GF_SPI_CMD_START_BYTE 0x00000000
+#define GF_PANEL_DRV_CMD_DATA ~0x0000ffff
+#define GFSCMD_PANEL_PKT_HEADER_END 0x40008000
+
+#define GFPERIODIC_CMD 0x4000C000
+#define GFSCMD_PERIODIC_PKT_HEADER_START 0x4000C000
+#define GFSCMD_PERIODIC_PKT_HEADER_SIZE 0x0000000A
+
+#define GF_IS_PERDC_MSB9_LSB9_SWAP_MASK 0x00800000
+#define GF_IS_PERDC_MSB9_LSB9_SWAP 0x00800000
+
+#define GF_IS_PERDC_PARLL_CYCLE_MASK 0x0000000f
+#define GF_IS_PERDC_PARLL_CYCLE0 0x00000000
+#define GF_IS_PERDC_PARLL_CYCLE1 0x00000001
+#define GF_IS_PERDC_PARLL_CYCLE2 0x00000002
+#define GF_IS_PERDC_PARLL_CYCLE3 0x00000003
+#define GF_IS_PERDC_PARLL_CYCLE4 0x00000004
+#define GF_IS_PERDC_PARLL_CYCLE5 0x00000005
+#define GF_IS_PERDC_PARLL_CYCLE6 0x00000006
+#define GF_IS_PERDC_PARLL_CYCLE7 0x00000007
+#define GF_IS_PERDC_PARLL_CYCLE8 0x00000008
+#define GF_IS_PERDC_PARLL_CYCLE9 0x00000009
+#define GF_IS_PERDC_PARLL_CYCLE10 0x0000000A
+#define GF_IS_PERDC_PARLL_CYCLE11 0x0000000B
+#define GF_IS_PERDC_PARLL_CYCLE12 0x0000000C
+
+#define GF_IS_PERDC_PARLL_IF_MASK 0xf0000000
+#define GF_IS_PERDC_PARLL_IF_8 0x00000000
+#define GF_IS_PERDC_PARLL_IF_9 0x10000000
+#define GF_IS_PERDC_PARLL_IF_18 0x20000000
+#define GF_IS_PERDC_PARLL_IF_16 0x30000000
+
+#define GF_IS_PERDC_PARLL_MAX_DATA_MASK 0x0000ff00
+#define GF_IS_PERDC_PARLL_MAX_DATA_IF_8 0x00005900
+#define GF_IS_PERDC_PARLL_MAX_DATA_IF_9 0x00005900
+#define GF_IS_PERDC_PARLL_MAX_DATA_IF_16 0x00006B00
+#define GF_IS_PERDC_PARLL_MAX_DATA_IF_18 0x00006B00
+
+#define GFIS_PRLL_EN_RS_DC_C 0
+#define GFIS_PRLL_EN_RS_DC_D 0
+
+#define GFIS_PRLL_ENBLE_LSC0_18_CYCLE_1_D (1 << (108-96))
+#define GFIS_PRLL_ENBLE_LSC0_18_CYCLE_2_D (1 << (111-96))
+#define GFIS_PRLL_ENBLE_LSC0_18_CYCLE_3_D (1 << (114-96))
+#define GFIS_PRLL_ENBLE_LSC0_18_CYCLE_4_D (1 << (117-96))
+#define GFIS_PRLL_ENBLE_LSC0_18_CYCLE_5_D (1 << (120-96))
+#define GFIS_PRLL_ENBLE_LSC0_18_CYCLE_6_D (1 << (123-96))
+
+#define GFIS_PRLL_ENBLE_LSC1_18_CYCLE_1_D (1 << (109-96))
+#define GFIS_PRLL_ENBLE_LSC1_18_CYCLE_2_D (1 << (112-96))
+#define GFIS_PRLL_ENBLE_LSC1_18_CYCLE_3_D (1 << (115-96))
+#define GFIS_PRLL_ENBLE_LSC1_18_CYCLE_4_D (1 << (118-96))
+#define GFIS_PRLL_ENBLE_LSC1_18_CYCLE_5_D (1 << (121-96))
+#define GFIS_PRLL_ENBLE_LSC1_18_CYCLE_6_D (1 << (124-96))
+
+#define GFIS_PRLL_RS_CD_18_CYCLE_1_H_D (1 << (110-96))
+#define GFIS_PRLL_RS_CD_18_CYCLE_1_L_D 0x00000000
+#define GFIS_PRLL_RS_CD_18_CYCLE_2_H_D (1 << (113-96))
+#define GFIS_PRLL_RS_CD_18_CYCLE_2_L_D 0x00000000
+#define GFIS_PRLL_RS_CD_18_CYCLE_3_H_D (1 << (116-96))
+#define GFIS_PRLL_RS_CD_18_CYCLE_3_L_D 0x00000000
+#define GFIS_PRLL_RS_CD_18_CYCLE_4_H_D (1 << (119-96))
+#define GFIS_PRLL_RS_CD_18_CYCLE_4_L_D 0x00000000
+#define GFIS_PRLL_RS_CD_18_CYCLE_5_H_D (1 << (122-96))
+#define GFIS_PRLL_RS_CD_18_CYCLE_5_L_D 0x00000000
+#define GFIS_PRLL_RS_CD_18_CYCLE_6_H_D (1 << (125-96))
+#define GFIS_PRLL_RS_CD_18_CYCLE_6_L_D 0x00000000
+
+#define GFIS_PRLL_ENBLE_LSC0_9_CYCLE_1_C (1 << (90-64))
+#define GFIS_PRLL_ENBLE_LSC0_9_CYCLE_2_C (1 << (93-64))
+#define GFIS_PRLL_ENBLE_LSC0_9_CYCLE_3_D (1 << (96-96))
+#define GFIS_PRLL_ENBLE_LSC0_9_CYCLE_4_D (1 << (99-96))
+#define GFIS_PRLL_ENBLE_LSC0_9_CYCLE_5_D (1 << (102-96))
+#define GFIS_PRLL_ENBLE_LSC0_9_CYCLE_6_D (1 << (105-96))
+#define GFIS_PRLL_ENBLE_LSC0_9_CYCLE_7_D (1 << (108-96))
+#define GFIS_PRLL_ENBLE_LSC0_9_CYCLE_8_D (1 << (111-96))
+#define GFIS_PRLL_ENBLE_LSC0_9_CYCLE_9_D (1 << (114-96))
+#define GFIS_PRLL_ENBLE_LSC0_9_CYCLE_10_D (1 << (117-96))
+
+#define GFIS_PRLL_ENBLE_LSC1_9_CYCLE_1_C (1 << (91-64))
+#define GFIS_PRLL_ENBLE_LSC1_9_CYCLE_2_C (1 << (94-64))
+#define GFIS_PRLL_ENBLE_LSC1_9_CYCLE_3_D (1 << (97-96))
+#define GFIS_PRLL_ENBLE_LSC1_9_CYCLE_4_D (1 << (100-96))
+#define GFIS_PRLL_ENBLE_LSC1_9_CYCLE_5_D (1 << (103-96))
+#define GFIS_PRLL_ENBLE_LSC1_9_CYCLE_6_D (1 << (106-96))
+#define GFIS_PRLL_ENBLE_LSC1_9_CYCLE_7_D (1 << (109-96))
+#define GFIS_PRLL_ENBLE_LSC1_9_CYCLE_8_D (1 << (112-96))
+#define GFIS_PRLL_ENBLE_LSC1_9_CYCLE_9_D (1 << (115-96))
+#define GFIS_PRLL_ENBLE_LSC1_9_CYCLE_10_D (1 << (118-96))
+
+#define GFIS_PRLL_RS_CD_9_CYCLE_1_H_C (1 << (92-64))
+#define GFIS_PRLL_RS_CD_9_CYCLE_1_L_C 0x00000000
+#define GFIS_PRLL_RS_CD_9_CYCLE_2_H_C (1 << (95-64))
+#define GFIS_PRLL_RS_CD_9_CYCLE_2_L_C 0x00000000
+#define GFIS_PRLL_RS_CD_9_CYCLE_3_H_D (1 << (98-96))
+#define GFIS_PRLL_RS_CD_9_CYCLE_3_L_D 0x00000000
+#define GFIS_PRLL_RS_CD_9_CYCLE_4_H_D (1 << (101-96))
+#define GFIS_PRLL_RS_CD_9_CYCLE_4_L_D 0x00000000
+#define GFIS_PRLL_RS_CD_9_CYCLE_5_H_D (1 << (104-96))
+#define GFIS_PRLL_RS_CD_9_CYCLE_5_L_D 0x00000000
+#define GFIS_PRLL_RS_CD_9_CYCLE_6_H_D (1 << (107-96))
+#define GFIS_PRLL_RS_CD_9_CYCLE_6_L_D 0x00000000
+#define GFIS_PRLL_RS_CD_9_CYCLE_7_H_D (1 << (110-96))
+#define GFIS_PRLL_RS_CD_9_CYCLE_7_L_D 0x00000000
+#define GFIS_PRLL_RS_CD_9_CYCLE_8_H_D (1 << (113-96))
+#define GFIS_PRLL_RS_CD_9_CYCLE_8_L_D 0x00000000
+#define GFIS_PRLL_RS_CD_9_CYCLE_9_H_D (1 << (116-96))
+#define GFIS_PRLL_RS_CD_9_CYCLE_9_L_D 0x00000000
+#define GFIS_PRLL_RS_CD_9_CYCLE_10_H_D (1 << (119-96))
+#define GFIS_PRLL_RS_CD_9_CYCLE_10_L_D 0x00000000
+
+// Serial
+
+#define GF_IS_PERDC_SERIAL_CYCLE_MASK 0x0000000f
+#define GF_IS_PERDC_SERIAL_CYCLE0 0x00000000
+#define GF_IS_PERDC_SERIAL_CYCLE1 0x00000001
+#define GF_IS_PERDC_SERIAL_CYCLE2 0x00000002
+#define GF_IS_PERDC_SERIAL_CYCLE3 0x00000003
+#define GF_IS_PERDC_SERIAL_CYCLE4 0x00000004
+#define GF_IS_PERDC_SERIAL_CYCLE5 0x00000005
+#define GF_IS_PERDC_SERIAL_CYCLE6 0x00000006
+#define GF_IS_PERDC_SERIAL_CYCLE7 0x00000007
+#define GF_IS_PERDC_SERIAL_CYCLE8 0x00000008
+#define GF_IS_PERDC_SERIAL_CYCLE9 0x00000009
+#define GF_IS_PERDC_SERIAL_CYCLE10 0x0000000A
+#define GF_IS_PERDC_SERIAL_CYCLE11 0x0000000B
+#define GF_IS_PERDC_SERIAL_CYCLE12 0x0000000C
+
+#define GF_IS_PERDC_SERIAL_IF_MASK 0xf0000000
+#define GF_IS_PERDC_SERIAL_IF_8 0x80000000
+#define GF_IS_PERDC_SERIAL_IF_9 0x90000000
+#define GF_IS_PERDC_SERIAL_IF_12 0xA0000000
+#define GF_IS_PERDC_SERIAL_IF_16 0xB0000000
+#define GF_IS_PERDC_SERIAL_IF_18 0xC0000000
+#define GF_IS_PERDC_SERIAL_IF_24 0xD0000000
+
+#define GF_IS_PERDC_SERIAL_MAX_DATA_MASK 0x0000ff00
+#define GF_IS_PERDC_SERIAL_MAX_DATA_IF_8 0x00005900
+#define GF_IS_PERDC_SERIAL_MAX_DATA_IF_9 0x00005900
+#define GF_IS_PERDC_SERIAL_MAX_DATA_IF_12 0x00006A00
+#define GF_IS_PERDC_SERIAL_MAX_DATA_IF_16 0x00006B00
+#define GF_IS_PERDC_SERIAL_MAX_DATA_IF_18 0x00006C00
+#define GF_IS_PERDC_SERIAL_MAX_DATA_IF_24 0x00006D00
+
+#define GFIS_SERIAL_EN_RS_DC_C 0
+#define GFIS_SERIAL_EN_RS_DC_D 0
+
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_24_CYCLE_1_D (1 << (96-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_24_CYCLE_2_D (1 << (98-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_24_CYCLE_3_D (1 << (100-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_24_CYCLE_4_D (1 << (102-96))
+
+#define GFIS_SERIAL_RS_CD_24_CYCLE_1_H_D (1 << (97-96))
+#define GFIS_SERIAL_RS_CD_24_CYCLE_1_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_24_CYCLE_2_H_D (1 << (99-96))
+#define GFIS_SERIAL_RS_CD_24_CYCLE_2_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_24_CYCLE_3_H_D (1 << (101-96))
+#define GFIS_SERIAL_RS_CD_24_CYCLE_3_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_24_CYCLE_4_H_D (1 << (103-96))
+#define GFIS_SERIAL_RS_CD_24_CYCLE_4_L_D 0x00000000
+
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_18_CYCLE_1_D (1 << (108-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_18_CYCLE_2_D (1 << (110-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_18_CYCLE_3_D (1 << (112-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_18_CYCLE_4_D (1 << (114-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_18_CYCLE_5_D (1 << (116-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_18_CYCLE_6_D (1 << (118-96))
+
+#define GFIS_SERIAL_RS_CD_18_CYCLE_1_H_D (1 << (109-96))
+#define GFIS_SERIAL_RS_CD_18_CYCLE_1_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_18_CYCLE_2_H_D (1 << (111-96))
+#define GFIS_SERIAL_RS_CD_18_CYCLE_2_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_18_CYCLE_3_H_D (1 << (113-96))
+#define GFIS_SERIAL_RS_CD_18_CYCLE_3_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_18_CYCLE_4_H_D (1 << (115-96))
+#define GFIS_SERIAL_RS_CD_18_CYCLE_4_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_18_CYCLE_5_H_D (1 << (117-96))
+#define GFIS_SERIAL_RS_CD_18_CYCLE_5_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_18_CYCLE_6_H_D (1 << (119-96))
+#define GFIS_SERIAL_RS_CD_18_CYCLE_6_L_D 0x00000000
+
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_16_CYCLE_1_D (1 << (112-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_16_CYCLE_2_D (1 << (114-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_16_CYCLE_3_D (1 << (116-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_16_CYCLE_4_D (1 << (118-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_16_CYCLE_5_D (1 << (120-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_16_CYCLE_6_D (1 << (122-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_16_CYCLE_7_D (1 << (124-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_16_CYCLE_7_D (1 << (124-96))
+
+#define GFIS_SERIAL_RS_CD_16_CYCLE_1_H_D (1 << (113-96))
+#define GFIS_SERIAL_RS_CD_16_CYCLE_1_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_16_CYCLE_2_H_D (1 << (115-96))
+#define GFIS_SERIAL_RS_CD_16_CYCLE_2_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_16_CYCLE_3_H_D (1 << (117-96))
+#define GFIS_SERIAL_RS_CD_16_CYCLE_3_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_16_CYCLE_4_H_D (1 << (119-96))
+#define GFIS_SERIAL_RS_CD_16_CYCLE_4_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_16_CYCLE_5_H_D (1 << (121-96))
+#define GFIS_SERIAL_RS_CD_16_CYCLE_5_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_16_CYCLE_6_H_D (1 << (123-96))
+#define GFIS_SERIAL_RS_CD_16_CYCLE_6_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_16_CYCLE_7_H_D (1 << (125-96))
+#define GFIS_SERIAL_RS_CD_16_CYCLE_7_L_D 0x00000000
+
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_12_CYCLE_1_D (1 << (109-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_12_CYCLE_2_D (1 << (111-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_12_CYCLE_3_D (1 << (113-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_12_CYCLE_4_D (1 << (115-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_12_CYCLE_5_D (1 << (117-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_12_CYCLE_6_D (1 << (119-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_12_CYCLE_7_D (1 << (121-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_12_CYCLE_8_D (1 << (123-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_12_CYCLE_9_D (1 << (125-96))
+
+#define GFIS_SERIAL_RS_CD_12_CYCLE_1_H_D (1 << (110-96))
+#define GFIS_SERIAL_RS_CD_12_CYCLE_1_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_12_CYCLE_2_H_D (1 << (112-96))
+#define GFIS_SERIAL_RS_CD_12_CYCLE_2_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_12_CYCLE_3_H_D (1 << (114-96))
+#define GFIS_SERIAL_RS_CD_12_CYCLE_3_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_12_CYCLE_4_H_D (1 << (116-96))
+#define GFIS_SERIAL_RS_CD_12_CYCLE_4_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_12_CYCLE_5_H_D (1 << (118-96))
+#define GFIS_SERIAL_RS_CD_12_CYCLE_5_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_12_CYCLE_6_H_D (1 << (120-96))
+#define GFIS_SERIAL_RS_CD_12_CYCLE_6_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_12_CYCLE_7_H_D (1 << (122-96))
+#define GFIS_SERIAL_RS_CD_12_CYCLE_7_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_12_CYCLE_8_H_D (1 << (124-96))
+#define GFIS_SERIAL_RS_CD_12_CYCLE_8_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_12_CYCLE_9_H_D (1 << (126-96))
+#define GFIS_SERIAL_RS_CD_12_CYCLE_9_L_D 0x00000000
+
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_9_CYCLE_1_D (1 << (99-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_9_CYCLE_2_D (1 << (101-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_9_CYCLE_3_D (1 << (103-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_9_CYCLE_4_D (1 << (105-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_9_CYCLE_5_D (1 << (107-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_9_CYCLE_6_D (1 << (109-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_9_CYCLE_7_D (1 << (111-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_9_CYCLE_8_D (1 << (113-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_9_CYCLE_9_D (1 << (115-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_9_CYCLE_10_D (1 << (117-96))
+
+#define GFIS_SERIAL_RS_CD_9_CYCLE_1_H_D (1 << (100-96))
+#define GFIS_SERIAL_RS_CD_9_CYCLE_1_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_9_CYCLE_2_H_D (1 << (102-96))
+#define GFIS_SERIAL_RS_CD_9_CYCLE_2_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_9_CYCLE_3_H_D (1 << (104-96))
+#define GFIS_SERIAL_RS_CD_9_CYCLE_3_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_9_CYCLE_4_H_D (1 << (106-96))
+#define GFIS_SERIAL_RS_CD_9_CYCLE_4_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_9_CYCLE_5_H_D (1 << (108-96))
+#define GFIS_SERIAL_RS_CD_9_CYCLE_5_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_9_CYCLE_6_H_D (1 << (110-96))
+#define GFIS_SERIAL_RS_CD_9_CYCLE_6_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_9_CYCLE_7_H_D (1 << (112-96))
+#define GFIS_SERIAL_RS_CD_9_CYCLE_7_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_9_CYCLE_8_H_D (1 << (114-96))
+#define GFIS_SERIAL_RS_CD_9_CYCLE_8_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_9_CYCLE_9_H_D (1 << (116-96))
+#define GFIS_SERIAL_RS_CD_9_CYCLE_9_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_9_CYCLE_10_H_D (1 << (118-96))
+#define GFIS_SERIAL_RS_CD_9_CYCLE_10_L_D 0x00000000
+
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_8_CYCLE_1_D (1 << (96-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_8_CYCLE_2_D (1 << (98-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_8_CYCLE_3_D (1 << (100-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_8_CYCLE_4_D (1 << (102-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_8_CYCLE_5_D (1 << (104-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_8_CYCLE_6_D (1 << (106-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_8_CYCLE_7_D (1 << (108-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_8_CYCLE_8_D (1 << (110-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_8_CYCLE_9_D (1 << (112-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_8_CYCLE_10_D (1 << (114-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_8_CYCLE_11_D (1 << (116-96))
+#define GFIS_SERIAL_ENBLE_LMSCS_LSSCS_8_CYCLE_12_D (1 << (118-96))
+
+#define GFIS_SERIAL_RS_CD_8_CYCLE_1_H_D (1 << (97-96))
+#define GFIS_SERIAL_RS_CD_8_CYCLE_1_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_8_CYCLE_2_H_D (1 << (99-96))
+#define GFIS_SERIAL_RS_CD_8_CYCLE_2_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_8_CYCLE_3_H_D (1 << (101-96))
+#define GFIS_SERIAL_RS_CD_8_CYCLE_3_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_8_CYCLE_4_H_D (1 << (103-96))
+#define GFIS_SERIAL_RS_CD_8_CYCLE_4_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_8_CYCLE_5_H_D (1 << (105-96))
+#define GFIS_SERIAL_RS_CD_8_CYCLE_5_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_8_CYCLE_6_H_D (1 << (107-96))
+#define GFIS_SERIAL_RS_CD_8_CYCLE_6_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_8_CYCLE_7_H_D (1 << (109-96))
+#define GFIS_SERIAL_RS_CD_8_CYCLE_7_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_8_CYCLE_8_H_D (1 << (111-96))
+#define GFIS_SERIAL_RS_CD_8_CYCLE_8_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_8_CYCLE_9_H_D (1 << (113-96))
+#define GFIS_SERIAL_RS_CD_8_CYCLE_9_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_8_CYCLE_10_H_D (1 << (115-96))
+#define GFIS_SERIAL_RS_CD_8_CYCLE_10_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_8_CYCLE_11_H_D (1 << (117-96))
+#define GFIS_SERIAL_RS_CD_8_CYCLE_11_L_D 0x00000000
+#define GFIS_SERIAL_RS_CD_8_CYCLE_12_H_D (1 << (119-96))
+#define GFIS_SERIAL_RS_CD_8_CYCLE_12_L_D 0x00000000
+
+#define GFSCMD_PERIODIC_PKT_HEADER_END 0x4000E000
+
+#define GFSCMD_I2C_PKT_HEADER_START 0x4000A000
+
+#define GF_I2C_DATA_BURST_MASK 0x000000ff
+#define GF_I2C_A_DATA_BURST0 0x00000000
+#define GF_I2C_A_DATA_BURST1 0x00000001
+#define GF_I2C_A_DATA_BURST2 0x00000002
+#define GF_I2C_A_DATA_BURST3 0x00000003
+#define GF_I2C_A_DATA_BURST4 0x00000004
+#define GF_I2C_A_DATA_BURST5 0x00000005
+#define GF_I2C_A_DATA_BURST6 0x00000006
+#define GF_I2C_A_DATA_BURST7 0x00000007
+#define GF_I2C_A_DATA_BURST8 0x00000008
+
+#define GF_HW_SW_I2C_MASK 0x00000300
+#define GF_HW_I2C 0x00000000
+#define GF_SW_I2C 0x00000100
+#define GF_I2C_B_WRITE_ID 0x00000000
+#define GF_I2C_C_READ_ID 0x00000000
+#define GFSCMD_I2C_PKT_HEADER_END 0x4000B000
+
+
+//SDIO GPIOs
+
+#define GFSCMD_GPIO_SD_INIT 0x00008f00 //One time Init SD GPIO
+#define GF_NO_DATA 0x00000000
+
+#define GFSCMD_GPIO_SD_PIN_SDGP0 0x00008f01
+#define GFSCMD_GPIO_SD_PIN_SDGP1 0x00018f01
+#define GFSCMD_GPIO_SD_PIN_CMD 0x00028f02
+#define GFSCMD_GPIO_SD_PIN_CLK 0x00038f02
+#define GFSCMD_GPIO_SD_PIN_DATA0 0x00048f00
+#define GFSCMD_GPIO_SD_PIN_DATA1 0x00048f01
+#define GFSCMD_GPIO_SD_PIN_DATA2 0x00048f02
+#define GFSCMD_GPIO_SD_PIN_DATA3 0x00048f03
+
+#define GF_GPIO_PIN_OUTPUT_ENABLE 0x00000000
+#define GF_GPIO_PIN_INPUT_ENABLE 0x00000001
+#define GF_GPIO_PIN_DISABLE 0x00000002
+#define GF_GPIO_PIN_HIGH 0x00000003
+#define GF_GPIO_PIN_LOW 0x00000004
+
+#endif //__GFDISPCMDDATA_H__
diff --git a/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFDx.h b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFDx.h
new file mode 100755
index 00000000..cca38e76
--- /dev/null
+++ b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFDx.h
@@ -0,0 +1,1847 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/** @file GFDx.h
+ GFSDK Display Initialization API header file.
+ */
+
+#ifndef GF_DX_H
+#define GF_DX_H
+
+#include "GFDispCmdData.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+/** @addtogroup groupDx DxAPI Display Initialization API
+
+ @ref pageDxAppNotes
+
+
+*/
+/*@{*/
+
+/** GFDxAPI color info to be used during programming GFDxErase*/
+#define GFDX_COLOR_RED 0xF800F800
+#define GFDX_COLOR_GREEN 0x07E007E0
+#define GFDX_COLOR_BLUE 0x001F001F
+
+
+
+/** GFDxAPI error code: Function not supported. */
+#define GFDX_ERROR_NO_SUPPORT (GFDX_ERROR | 2)
+/** GFDxAPI error code: Invalid attribute ID for GFDxSetAttribute() / GFDxGetAttribute(). */
+#define GFDX_ERROR_INVALID_ATTRIBUTE (GFDX_ERROR | 6)
+
+/**
+ This struct is used by GFDxGetProperty().
+ * */
+typedef struct _GFDXPROPERTY
+{
+ /** standard GF property, following info is available as cap */
+ GFPROPERTY Prop;
+ /** Not supported */
+ NvU16 LcdWidth;
+ /** Not supported */
+ NvU16 LcdHeight;
+ /** Not supported */
+ NvU16 LcdIndex;
+ /** Not supported */
+ char LcdName[18];
+ /** Not supported */
+ NvU16 SubLcdWidth;
+ /** Not supported */
+ NvU16 SubLcdHeight;
+ /** Not supported */
+ NvU16 SubLcdIndex;
+ /** Not supported */
+ char SubLcdName[18];
+
+} GFDXPROPERTY, *PGFDXPROPERTY;
+
+#define DC_P_A_BLEND_2WIN_B DC_P_B_BLEND_2WIN_A
+#define DC_P_A_BLEND_2WIN_C DC_P_B_BLEND_2WIN_C
+
+#define DC_P_C_BLEND_2WIN_A DC_P_B_BLEND_2WIN_A
+#define DC_P_C_BLEND_2WIN_B DC_P_B_BLEND_2WIN_C
+
+//#define DC_P_B_BLEND_2WIN_B DC_P_B_BLEND_2WIN_C
+#define P_B_CKEY_ENABLE_2WIN_B_CKEY0 P_B_CKEY_ENABLE_2WIN_C_CKEY0
+#define P_B_CKEY_ENABLE_2WIN_B_CKEY1 P_B_CKEY_ENABLE_2WIN_C_CKEY1
+#define P_B_BLEND_CONTROL_2WIN_B_MASK P_B_BLEND_CONTROL_2WIN_C_MASK
+#define P_B_BLEND_CONTROL_2WIN_B_ALPHA_WEIGHT P_B_BLEND_CONTROL_2WIN_C_ALPHA_WEIGHT
+#define P_B_BLEND_CONTROL_2WIN_B_DEPENDENT_WEIGHT P_B_BLEND_CONTROL_2WIN_C_DEPENDENT_WEIGHT
+#define P_B_BLEND_WEIGHT0_2WIN_B_MASK P_B_BLEND_WEIGHT0_2WIN_C_MASK
+#define P_B_BLEND_WEIGHT0_2WIN_B_SHIFT P_B_BLEND_WEIGHT0_2WIN_C_SHIFT
+#define P_B_BLEND_WEIGHT1_2WIN_B_MASK P_B_BLEND_WEIGHT1_2WIN_C_MASK
+#define P_B_BLEND_WEIGHT1_2WIN_B_SHIFT P_B_BLEND_WEIGHT1_2WIN_C_SHIFT
+
+//#define DC_P_B_BLEND_3WIN_AB DC_P_B_BLEND_3WIN_AC
+#define DC_P_A_BLEND_3WIN_BC DC_P_B_BLEND_3WIN_AC
+#define P_B_CKEY_ENABLE_3WIN_AB_CKEY0 P_B_CKEY_ENABLE_3WIN_AC_CKEY0
+#define P_B_CKEY_ENABLE_3WIN_AB_CKEY1 P_B_CKEY_ENABLE_3WIN_AC_CKEY1
+#define P_B_BLEND_CONTROL_3WIN_AB_MASK P_B_BLEND_CONTROL_3WIN_AC_MASK
+#define P_B_BLEND_CONTROL_3WIN_AB_ALPHA_WEIGHT P_B_BLEND_CONTROL_3WIN_AC_ALPHA_WEIGHT
+#define P_B_BLEND_CONTROL_3WIN_AB_DEPENDENT_WEIGHT P_B_BLEND_CONTROL_3WIN_AC_DEPENDENT_WEIGHT
+#define P_B_BLEND_WEIGHT0_3WIN_AB_MASK P_B_BLEND_WEIGHT0_3WIN_AC_MASK
+#define P_B_BLEND_WEIGHT0_3WIN_AB_SHIFT P_B_BLEND_WEIGHT0_3WIN_AC_SHIFT
+#define P_B_BLEND_WEIGHT1_3WIN_AB_MASK P_B_BLEND_WEIGHT1_3WIN_AC_MASK
+#define P_B_BLEND_WEIGHT1_3WIN_AB_SHIFT P_B_BLEND_WEIGHT1_3WIN_AC_SHIFT
+
+//#define DC_P_B_BLEND_3WIN_BC DC_P_B_BLEND_3WIN_AC
+#define DC_P_C_BLEND_3WIN_AB DC_P_B_BLEND_3WIN_AC
+#define P_B_CKEY_ENABLE_3WIN_BC_CKEY0 P_B_CKEY_ENABLE_3WIN_AC_CKEY0
+#define P_B_CKEY_ENABLE_3WIN_BC_CKEY1 P_B_CKEY_ENABLE_3WIN_AC_CKEY1
+#define P_B_BLEND_CONTROL_3WIN_BC_MASK P_B_BLEND_CONTROL_3WIN_AC_MASK
+#define P_B_BLEND_CONTROL_3WIN_BC_ALPHA_WEIGHT P_B_BLEND_CONTROL_3WIN_AC_ALPHA_WEIGHT
+#define P_B_BLEND_CONTROL_3WIN_BC_DEPENDENT_WEIGHT P_B_BLEND_CONTROL_3WIN_AC_DEPENDENT_WEIGHT
+#define P_B_BLEND_WEIGHT0_3WIN_BC_MASK P_B_BLEND_WEIGHT0_3WIN_AC_MASK
+#define P_B_BLEND_WEIGHT0_3WIN_BC_SHIFT P_B_BLEND_WEIGHT0_3WIN_AC_SHIFT
+#define P_B_BLEND_WEIGHT1_3WIN_BC_MASK P_B_BLEND_WEIGHT1_3WIN_AC_MASK
+#define P_B_BLEND_WEIGHT1_3WIN_BC_SHIFT P_B_BLEND_WEIGHT1_3WIN_AC_SHIFT
+
+/**
+ Definition of attribute ids for Set/GetAttributes()
+ */
+typedef enum _GFDXATTRIBUTES
+ {
+ /** Width of the LCD fixed (240 for a 240x320 panel) */
+ GFDX_ATTR_LCDWIDTH,
+ /** Height of the LCD fixed (320 for a 240x320 panel) */
+ GFDX_ATTR_LCDHEIGHT,
+ /** NVIDIA panel index, This function overwrites environment panel Index setting */
+ GFDX_ATTR_LCDTYPE,
+ /** Name of the panel (upto 16 chars,"PHILIPS_LP7123A") */
+ GFDX_ATTR_LCDNAME,
+ /** Width of the display area usually same as LCDWIDTH,
+ Parameters: W[15:0] */
+ GFDX_ATTR_WIDTH,
+ /** Height of the display area, can be less if emulating smaller size,
+ Parameters: H[15:0] */
+ GFDX_ATTR_HEIGHT,
+ /** set/gets width height together to avoid artifacts,
+ Parameters: W[15:0], H[31:16] */
+ GFDX_ATTR_WH_WA,
+ /** set/gets x, y start position of window A,
+ Parameters: X[15:0], Y[31:16] */
+ GFDX_ATTR_XY_POS_WA,
+ /** Color Depth Bits per pixel: 1,2,4,8,12,15(RGB555),16(RGB565), 32(ARGB888),
+ GFDX_COLOR_DEPTH_YCbCr422,
+ GFDX_COLOR_DEPTH_YUV422,
+ GFDX_COLOR_DEPTH_YCbCr420P,
+ GFDX_COLOR_DEPTH_YUV420P,
+ GFDX_COLOR_DEPTH_YUV422P,
+ GFDX_COLOR_DEPTH_YCbCr422P,
+ GFDX_COLOR_DEPTH_YCbCr422R,
+ GFDX_COLOR_DEPTH_YUV422R,
+ GFDX_COLOR_DEPTH_YCbCr422RA,
+ GFDX_COLOR_DEPTH_YUV422RA,
+ */
+ GFDX_ATTR_BPP_WA,
+ /** On/Off Horizontal & Vertical Pixel Doubling for window A,
+ Parameters: GFDXA_PIX_DBL_H, GFDXA_PIX_DBL_V or 0-Disable */
+ GFDX_ATTR_PIXEL_DBL_WA,
+ /** Start Address for Window A Buffer 0 */
+ GFDX_ATTR_ADDR_WA_B0,
+ /** Start Address for Window A Buffer 1 */
+ GFDX_ATTR_ADDR_WA_B1,
+ /** Stride for Window A Buffer 0 */
+ GFDX_ATTR_STRIDE_WA_B0,
+ /** Stride for Window A Buffer 1 */
+ GFDX_ATTR_STRIDE_WA_B1,
+ /** Enable/Disable Windows A, Parameters: 1-Enable 0-Disable */
+ GFDX_ATTR_ENABLE_WA,
+ /** Enable/Disable Buf0, Buf1, VI, GE Double Buffer (see def),
+ Parameters: GFDXA_DB_BUF0, GFDXA_DB_BUF1, GFDXA_DB_GE, GFDXA_DB_VI,
+ GFDXA_DB_EPP, GFDXA_DB_MPEGE, GFDXA_DB_HOST
+ */
+ GFDX_ATTR_DBL_BUF_WA,
+ /** Sets/Gets GC Rotate bits for window A, for internal use only */
+ GFDX_ATTR_ROTATE_BIT_WA,
+ /** Set/Get H Direction Increment/Decrement for window A, for internal use only */
+ GFDX_ATTR_H_DIRECTION_WA,
+ /** Set/Get V Direction Increment/Decrement for window A, for internal use only */
+ GFDX_ATTR_V_DIRECTION_WA,
+ /** Enable/Disable Palette for WinA */
+ GFDX_ATTR_PALETTE_EN_WA,
+ /** Set/Get Palette 666 R[31-24], G[23-16], B[15-8], Index[7-0] WinA */
+ GFDX_ATTR_PALETTE_WA,
+ /** Set/Get Palette 888 R[31-24], G[23-16], B[15-8], Index[7-0] WinA */
+ GFDX_ATTR_PALETTE888_WA,
+ /** Enable/Disable DV WinA ,
+ Parameters: GFDX_ATTR_DV_ENABLE, GFDX_ATTR_DV_DISABLE
+ */
+ GFDX_ATTR_DV_CONTROL_EN_WA,
+ /** Set/Get DV Control R[26-24], G[18-16], B[10-8] WinA */
+ GFDX_ATTR_DV_CONTROL_WA,
+ /** Color Key0 Lower range for overlay, there are two sets of color keys KEY0 & KEY1,
+ Parameters: R[23-16],G[15-8],B[7-0], Each KEY has Lower and Upper range */
+ GFDX_ATTR_COLOR_KEY0_LOWER_RANGE,
+ /** Color Key0 Upper range for overlay, there are two sets of color keys KEY0 & KEY1,
+ Parameters: R[23-16],G[15-8],B[7-0], Each KEY has Lower and Upper range */
+ GFDX_ATTR_COLOR_KEY0_UPPER_RANGE,
+ /** Color Key1 Lower range for overlay, there are two sets of color keys KEY0 & KEY1,
+ Parameters: R[23-16],G[15-8],B[7-0], Each KEY has Lower and Upper range */
+ GFDX_ATTR_COLOR_KEY1_LOWER_RANGE,
+ /** Color Key1 Upper range for overlay, there are two sets of color keys KEY0 & KEY1,
+ Parameters: R[23-16],G[15-8],B[7-0], Each KEY has Lower and Upper range */
+ GFDX_ATTR_COLOR_KEY1_UPPER_RANGE,
+ /** Color Key enbled but pixel color is not in range,
+ Parameters: GFDXA_BLEND_CONTROL_NOKEY_ALPHA_WEIGHT else 0 for Fix Weight */
+ GFDX_ATTR_COLOR_NOKEY_WA,
+ /** Weight0 for Color Key not match area,
+ Parameters: Weight0 value[7:0], if 1-bit Alpha Weight0 value = 0 */
+ GFDX_ATTR_COLOR_NOKEY_WEIGHT0_WA,
+ /** Weight1 for Color Key not match area,
+ Parameters: Weight1 value[7:0], if 1-bit Alpha Weight1 value = 1 */
+ GFDX_ATTR_COLOR_NOKEY_WEIGHT1_WA,
+ /** Color Key0 Enble/Disable for WinA,
+ Parameters: GFDXA_BLEND_COLOR_KEY0_ENABLE or GFDXA_BLEND_COLOR_KEY0_DISABLE */
+ GFDX_ATTR_COLOR_KEY0_1WIN_WA,
+ /** Color Key1 Enble/Disable for WinA,
+ Parameters: GFDXA_BLEND_COLOR_KEY1_ENABLE or GFDXA_BLEND_COLOR_KEY1_DISABLE */
+ GFDX_ATTR_COLOR_KEY1_1WIN_WA,
+ /** Blend Control for WinA where does not Overlap with other Window,
+ Parameters: GFDXA_BLEND_CONTROL_nWIN_ALPHA_WEIGHT or 0 for Fix Weight */
+ GFDX_ATTR_COLOR_1WIN_WA,
+ /** Win Blend Weight0 for CKey disabled or CKey enabled w key match area or 1-bit Alpha, Alpha 0 uses Weight0,
+ Parameters: Weight0 value[7:0], if 1-bit Alpha Weight0 value = 0 */
+ GFDX_ATTR_COLOR_1WIN_WEIGHT0_WA,
+ /** Win Blend Weight1 for CKey disabled or CKey enabled w key match area or 1-bit Alpha, Alpha 1 uses Weight1,
+ Parameters: Weight1 value[7:0], if 1-bit Alpha Weight1 value = 1 */
+ GFDX_ATTR_COLOR_1WIN_WEIGHT1_WA,
+ /** Color Key0 Enble/Disable for WinA, Overlap with WinB,
+ Parameters: GFDXA_BLEND_COLOR_KEY0_ENABLE (if 2WIN_A_CKEY1 enbled then ENABLE_2WIN_A_CKEY01
+ else 2WIN_A_CKEY0)
+ GFDXA_BLEND_COLOR_KEY0_DISABLE (if 2WIN_A_CKEY1 enbled then ENABLE_2WIN_A_CKEY1
+ else 2WIN_A_NOKEY)
+ */
+ GFDX_ATTR_COLOR_KEY0_2WIN_B_WA,
+ /** Color Key1 Enble/Disable for WinA, Overlap with WinB,
+ Parameters: GFDXA_BLEND_COLOR_KEY1_ENABLE (if 2WIN_A_CKEY1 enbled then ENABLE_2WIN_A_CKEY01
+ else 2WIN_A_CKEY1)
+ GFDXA_BLEND_COLOR_KEY1_DISABLE (if 2WIN_A_CKEY1 enbled then ENABLE_2WIN_A_CKEY0
+ else 2WIN_A_NOKEY)
+ */
+ GFDX_ATTR_COLOR_KEY1_2WIN_B_WA,
+ /** Blend Control for WinA area that overlap with WinB only
+ Parameters: GFDXA_BLEND_CONTROL_nWIN_ALPHA_WEIGHT or GFDXA_BLEND_CONTROL_nWIN_DEPENDENT_WEIGHT
+ or 0 for FIX WEIGHT
+ */
+ GFDX_ATTR_COLOR_2WIN_B_WA,
+ /** Win Blend Weight0 for CKey disabled or CKey enabled w key match area or 1-bit Alpha, Alpha 0 uses Weight0
+ Parameters: Weight0 value[7:0], if 1-bit Alpha Weight0 value = 0 */
+ GFDX_ATTR_COLOR_2WIN_B_WEIGHT0_WA,
+ /** Win Blend Weight1 for CKey disabled or CKey enabled w key match area or 1-bit Alpha, Alpha 1 uses Weight1
+ Parameters: Weight1 value[7:0], if 1-bit Alpha Weight1 value = 1 */
+ GFDX_ATTR_COLOR_2WIN_B_WEIGHT1_WA,
+ /** Color Key0 Enble/Disable for WinA, Overlap with WinC
+ Parameters: GFDXA_BLEND_COLOR_KEY0_ENABLE (if 2WIN_A_CKEY1 enbled then ENABLE_2WIN_A_CKEY01
+ else 2WIN_A_CKEY0)
+ GFDXA_BLEND_COLOR_KEY0_DISABLE (if 2WIN_A_CKEY1 enbled then ENABLE_2WIN_A_CKEY1
+ else 2WIN_A_NOKEY)
+ */
+ GFDX_ATTR_COLOR_KEY0_2WIN_C_WA,
+ /** Color Key1 Enble/Disable for WinA, Overlap with WinC
+ Parameters: GFDXA_BLEND_COLOR_KEY1_ENABLE (if 2WIN_A_CKEY1 enbled then ENABLE_2WIN_A_CKEY01
+ else 2WIN_A_CKEY1)
+ GFDXA_BLEND_COLOR_KEY1_DISABLE (if 2WIN_A_CKEY1 enbled then ENABLE_2WIN_A_CKEY0
+ else 2WIN_A_NOKEY)
+ */
+ GFDX_ATTR_COLOR_KEY1_2WIN_C_WA,
+ /** Blend Control for WinA area that overlap with WinC only
+ Parameters: GFDXA_BLEND_CONTROL_nWIN_ALPHA_WEIGHT or GFDXA_BLEND_CONTROL_nWIN_DEPENDENT_WEIGHT
+ or 0 for FIX WEIGHT
+ */
+ GFDX_ATTR_COLOR_2WIN_C_WA,
+ /** Win Blend Weight0 for CKey disabled or CKey enabled w key match area or 1-bit Alpha, Alpha 0 uses Weight0
+ Parameters: Weight0 value[7:0], if 1-bit Alpha Weight0 value = 0 */
+ GFDX_ATTR_COLOR_2WIN_C_WEIGHT0_WA,
+ /** Win Blend Weight1 for CKey disabled or CKey enabled w key match area or 1-bit Alpha, Alpha 1 uses Weight1
+ Parameters: Weight1 value[7:0], if 1-bit Alpha Weight1 value = 1 */
+ GFDX_ATTR_COLOR_2WIN_C_WEIGHT1_WA,
+ /** Color Key0 Enble/Disable for WinA, Overlap with WinA & WinC Only
+ Parameters: GFDXA_BLEND_COLOR_KEY0_ENABLE (if 3WIN_AC_CKEY1 enbled then ENABLE_3WIN_AC_CKEY01
+ else 3WIN_AC_CKEY0)
+ GFDXA_BLEND_COLOR_KEY0_DISABLE (if 3WIN_AC_CKEY1 enbled then ENABLE_3WIN_AC_CKEY1
+ else 3WIN_AC_NOKEY)
+ */
+ GFDX_ATTR_COLOR_KEY0_3WIN_BC_WA,
+ /** Color Key1 Enble/Disable for WinA, Overlap with WinA & WinC
+ Parameters: GFDXA_BLEND_COLOR_KEY1_ENABLE (if 3WIN_AC_CKEY1 enbled then ENABLE_3WIN_AC_CKEY01
+ else 3WIN_AC_CKEY1)
+ GFDXA_BLEND_COLOR_KEY1_DISABLE (if 3WIN_AC_CKEY1 enbled then ENABLE_3WIN_AC_CKEY0
+ else 3WIN_AC_NOKEY)
+ */
+ GFDX_ATTR_COLOR_KEY1_3WIN_BC_WA,
+ /** Blend Control for WinA area that overlap with WinA & WinC only
+ Parameters: GFDXA_BLEND_CONTROL_nWIN_ALPHA_WEIGHT or GFDXA_BLEND_CONTROL_nWIN_DEPENDENT_WEIGHT
+ or 0 for FIX WEIGHT
+ */
+ GFDX_ATTR_COLOR_3WIN_BC_WA,
+ /** Win Blend Weight0 for CKey disabled or CKey enabled w key match area or 1-bit Alpha, Alpha 0 uses Weight0
+ Parameters: Weight0 value[7:0], if 1-bit Alpha Weight0 value = 0 */
+ GFDX_ATTR_COLOR_3WIN_BC_WEIGHT0_WA,
+ /** Win Blend Weight1 for CKey disabled or CKey enabled w key match area or 1-bit Alpha, Alpha 1 uses Weight1
+ Parameters: Weight1 value[7:0], if 1-bit Alpha Weight1 value = 1 */
+ GFDX_ATTR_COLOR_3WIN_BC_WEIGHT1_WA,
+ /** set/gets width height together to avoid artifacts */
+ GFDX_ATTR_WH_WB,
+ /** set/gets source width height together to avoid artifacts,
+ Parameters: W[15:0], H[31:16] */
+ GFDX_ATTR_SRC_WH_WB,
+ /** set/gets x, y start position of window B,
+ Parameters: X[15:0], Y[31:16] */
+ GFDX_ATTR_XY_POS_WB,
+ /** Color Depth Bits per pixel: 1,2,4,8,12,15(RGB555),16(RGB565), 32(ARGB888),
+ GFDX_COLOR_DEPTH_YCbCr422,
+ GFDX_COLOR_DEPTH_YUV422,
+ GFDX_COLOR_DEPTH_YCbCr420P,
+ GFDX_COLOR_DEPTH_YUV420P,
+ GFDX_COLOR_DEPTH_YUV422P,
+ GFDX_COLOR_DEPTH_YCbCr422P,
+ GFDX_COLOR_DEPTH_YCbCr422R,
+ GFDX_COLOR_DEPTH_YUV422R,
+ GFDX_COLOR_DEPTH_YCbCr422RA,
+ GFDX_COLOR_DEPTH_YUV422RA,
+ */
+ GFDX_ATTR_BPP_WB,
+ /** On/Off Horizontal & Vertical Pixel Doubling for Window B,
+ Parameters: GFDXA_PIX_DBL_H, GFDXA_PIX_DBL_V or 0-Disable */
+ GFDX_ATTR_PIXEL_DBL_WB,
+ /** Upscales/Downscales window */
+ GFDX_ATTR_SCALE_WB,
+ /** Start Address for Window B Buffer 0 */
+ GFDX_ATTR_ADDR_WB_B0,
+ /** U Start Address for Window B Buffer 0 */
+ GFDX_ATTR_ADDR_U_WB_B0,
+ /** V Start Address for Window B Buffer 0 */
+ GFDX_ATTR_ADDR_V_WB_B0,
+ /** Stride for Window B Buffer 0 */
+ GFDX_ATTR_STRIDE_WB_B0,
+ /** UV Stride for Window B Buffer 0 */
+ GFDX_ATTR_STRIDE_UV_WB_B0,
+ /** Start Address for Window B Buffer 1 */
+ GFDX_ATTR_ADDR_WB_B1,
+ /** U Start Address for Window B Buffer 1 */
+ GFDX_ATTR_ADDR_U_WB_B1,
+ /** V Start Address for Window B Buffer 1 */
+ GFDX_ATTR_ADDR_V_WB_B1,
+ /** Stride for Window B Buffer 1 */
+ GFDX_ATTR_STRIDE_WB_B1,
+ /** UV Stride for Window B Buffer 1 */
+ GFDX_ATTR_STRIDE_UV_WB_B1,
+ /** Enable/Disable Windows B, Parameters: 1-Enable 0-Disable */
+ GFDX_ATTR_ENABLE_WB,
+ /** Enable/Disable Buf0, Buf1, VI, GE Double Buffer (see def),
+ Parameters: GFDXA_DB_BUF0, GFDXA_DB_BUF1, GFDXA_DB_GE, GFDXA_DB_VI,
+ GFDXA_DB_EPP, GFDXA_DB_MPEGE, GFDXA_DB_HOST
+ */
+ GFDX_ATTR_DBL_BUF_WB,
+ /** Sets/Gets GC Rotate bits for window B, for internal use only */
+ GFDX_ATTR_ROTATE_BIT_WB,
+ /** Set/Get H Direction Increment/Decrement for window B, for internal use only */
+ GFDX_ATTR_H_DIRECTION_WB,
+ /** Set/Get V Direction Increment/Decrement for window B, for internal use only */
+ GFDX_ATTR_V_DIRECTION_WB,
+ /** Enable/Disable Palette for WinB */
+ GFDX_ATTR_PALETTE_EN_WB,
+ /** Set/Get Palette 666 R[31-24], G[23-16], B[15-8], Index[7-0] WinB */
+ GFDX_ATTR_PALETTE_WB,
+ /** Set/Get Palette 888 R[31-24], G[23-16], B[15-8], Index[7-0] WinB */
+ GFDX_ATTR_PALETTE888_WB,
+ /** Enable/Disable DV WinB ,
+ Parameters: GFDX_ATTR_DV_ENABLE, GFDX_ATTR_DV_DISABLE
+ */
+ GFDX_ATTR_DV_CONTROL_EN_WB,
+ /** Set/Get DV Control R[26-24], G[18-16], B[10-8] WinB */
+ GFDX_ATTR_DV_CONTROL_WB,
+ /** Color Key enbled but pixel color is not in range
+ Parameters: GFDXA_BLEND_CONTROL_NOKEY_ALPHA_WEIGHT else 0 for Fix Weight */
+ GFDX_ATTR_COLOR_NOKEY_WB,
+ /** Weight0 for Color Key not match area
+ Parameters: Weight0 value[7:0], if 1-bit Alpha Weight0 value = 0 */
+ GFDX_ATTR_COLOR_NOKEY_WEIGHT0_WB,
+ /** Weight1 for Color Key not match area
+ Parameters: Weight1 value[7:0], if 1-bit Alpha Weight1 value = 1 */
+ GFDX_ATTR_COLOR_NOKEY_WEIGHT1_WB,
+ /** Color Key0 Enble/Disable for WinB
+ Parameters: GFDXA_BLEND_COLOR_KEY0_ENABLE or GFDXA_BLEND_COLOR_KEY0_DISABLE */
+ GFDX_ATTR_COLOR_KEY0_1WIN_WB,
+ /** Color Key1 Enble/Disable for WinB
+ Parameters: GFDXA_BLEND_COLOR_KEY1_ENABLE or GFDXA_BLEND_COLOR_KEY1_DISABLE */
+ GFDX_ATTR_COLOR_KEY1_1WIN_WB,
+ /** Blend Control for WinB where does not Overlap with other Window
+ Parameters: GFDXA_BLEND_CONTROL_nWIN_ALPHA_WEIGHT or 0 for Fix Weight */
+ GFDX_ATTR_COLOR_1WIN_WB,
+ /** Win Blend Weight0 for CKey disabled or CKey enabled w key match area or 1-bit Alpha, Alpha 0 uses Weight0
+ Parameters: Weight0 value[7:0], if 1-bit Alpha Weight0 value = 0 */
+ GFDX_ATTR_COLOR_1WIN_WEIGHT0_WB,
+ /** Win Blend Weight1 for CKey disabled or CKey enabled w key match area or 1-bit Alpha, Alpha 1 uses Weight1
+ Parameters: Weight1 value[7:0], if 1-bit Alpha Weight1 value = 1 */
+ GFDX_ATTR_COLOR_1WIN_WEIGHT1_WB,
+ /** Color Key0 Enble/Disable for WinB, Overlap with WinA
+ Parameters: GFDXA_BLEND_COLOR_KEY0_ENABLE (if 2WIN_B_CKEY1 enbled then ENABLE_2WIN_B_CKEY01
+ else 2WIN_B_CKEY0)
+ GFDXA_BLEND_COLOR_KEY0_DISABLE (if 2WIN_B_CKEY1 enbled then ENABLE_2WIN_B_CKEY1
+ else 2WIN_B_NOKEY)
+ */
+ GFDX_ATTR_COLOR_KEY0_2WIN_A_WB,
+ /** Color Key1 Enble/Disable for WinB, Overlap with WinA
+ Parameters: GFDXA_BLEND_COLOR_KEY1_ENABLE (if 2WIN_B_CKEY1 enbled then ENABLE_2WIN_B_CKEY01
+ else 2WIN_B_CKEY1)
+ GFDXA_BLEND_COLOR_KEY1_DISABLE (if 2WIN_B_CKEY1 enbled then ENABLE_2WIN_B_CKEY0
+ else 2WIN_B_NOKEY)
+ */
+ GFDX_ATTR_COLOR_KEY1_2WIN_A_WB,
+ /** Blend Control for WinB where does not Overlap with other Window
+ Parameters: GFDXA_BLEND_CONTROL_nWIN_ALPHA_WEIGHT or GFDXA_BLEND_CONTROL_nWIN_DEPENDENT_WEIGHT
+ or 0 for FIX WEIGHT
+ */
+ GFDX_ATTR_COLOR_2WIN_A_WB,
+ /** Win Blend Weight0 for CKey disabled or CKey enabled w key match area or 1-bit Alpha, Alpha 0 uses Weight0
+ Parameters: Weight0 value[7:0], if 1-bit Alpha Weight0 value = 0 */
+ GFDX_ATTR_COLOR_2WIN_A_WEIGHT0_WB,
+ /** Win Blend Weight1 for CKey disabled or CKey enabled w key match area or 1-bit Alpha, Alpha 1 uses Weight1
+ Parameters: Weight1 value[7:0], if 1-bit Alpha Weight1 value = 1 */
+ GFDX_ATTR_COLOR_2WIN_A_WEIGHT1_WB,
+ /** Color Key0 Enble/Disable for WinB, Overlap with WinC
+ Parameters: GFDXA_BLEND_COLOR_KEY0_ENABLE (if 2WIN_B_CKEY1 enbled then ENABLE_2WIN_B_CKEY01
+ else 2WIN_B_CKEY0)
+ GFDXA_BLEND_COLOR_KEY0_DISABLE (if 2WIN_B_CKEY1 enbled then ENABLE_2WIN_B_CKEY1
+ else 2WIN_B_NOKEY)
+ */
+ GFDX_ATTR_COLOR_KEY0_2WIN_C_WB,
+ /** Color Key1 Enble/Disable for WinB, Overlap with WinC
+ Parameters: GFDXA_BLEND_COLOR_KEY1_ENABLE (if 2WIN_B_CKEY1 enbled then ENABLE_2WIN_B_CKEY01
+ else 2WIN_B_CKEY1)
+ GFDXA_BLEND_COLOR_KEY1_DISABLE (if 2WIN_B_CKEY1 enbled then ENABLE_2WIN_B_CKEY0
+ else 2WIN_B_NOKEY)
+ */
+ GFDX_ATTR_COLOR_KEY1_2WIN_C_WB,
+ /** Blend Control for WinB area that overlap with WinC only
+ Parameters: GFDXA_BLEND_CONTROL_nWIN_ALPHA_WEIGHT or GFDXA_BLEND_CONTROL_nWIN_DEPENDENT_WEIGHT
+ or 0 for FIX WEIGHT
+ */
+ GFDX_ATTR_COLOR_2WIN_C_WB,
+ /** Win Blend Weight0 for CKey disabled or CKey enabled w key match area or 1-bit Alpha, Alpha 0 uses Weight0
+ Parameters: Weight0 value[7:0], if 1-bit Alpha Weight0 value = 0 */
+ GFDX_ATTR_COLOR_2WIN_C_WEIGHT0_WB,
+ /** Win Blend Weight1 for CKey disabled or CKey enabled w key match area or 1-bit Alpha, Alpha 1 uses Weight1
+ Parameters: Weight1 value[7:0], if 1-bit Alpha Weight1 value = 1 */
+ GFDX_ATTR_COLOR_2WIN_C_WEIGHT1_WB,
+ /** Color Key0 Enble/Disable for WinB, Overlap with WinA & WinC Only
+ Parameters: GFDXA_BLEND_COLOR_KEY0_ENABLE (if 3WIN_BC_CKEY1 enbled then ENABLE_3WIN_BC_CKEY01
+ else 3WIN_BC_CKEY0)
+ GFDXA_BLEND_COLOR_KEY0_DISABLE (if 3WIN_BC_CKEY1 enbled then ENABLE_3WIN_BC_CKEY1
+ else 3WIN_BC_NOKEY)
+ */
+ GFDX_ATTR_COLOR_KEY0_3WIN_AC_WB,
+ /** Color Key1 Enble/Disable for WinB, Overlap with WinA & WinC
+ Parameters: GFDXA_BLEND_COLOR_KEY1_ENABLE (if 3WIN_BC_CKEY1 enbled then ENABLE_3WIN_BC_CKEY01
+ else 3WIN_BC_CKEY1)
+ GFDXA_BLEND_COLOR_KEY1_DISABLE (if 3WIN_BC_CKEY1 enbled then ENABLE_3WIN_BC_CKEY0
+ else 3WIN_BC_NOKEY)
+ */
+ GFDX_ATTR_COLOR_KEY1_3WIN_AC_WB,
+ /** Blend Control for WinB area that overlap with WinA & WinC only
+ Parameters: GFDXA_BLEND_CONTROL_nWIN_ALPHA_WEIGHT or GFDXA_BLEND_CONTROL_nWIN_DEPENDENT_WEIGHT
+ or 0 for FIX WEIGHT
+ */
+ GFDX_ATTR_COLOR_3WIN_AC_WB,
+ /** Win Blend Weight0 for CKey disabled or CKey enabled w key match area or 1-bit Alpha, Alpha 0 uses Weight0
+ Parameters: Weight0 value[7:0], if 1-bit Alpha Weight0 value = 0 */
+ GFDX_ATTR_COLOR_3WIN_AC_WEIGHT0_WB,
+ /** Win Blend Weight1 for CKey disabled or CKey enabled w key match area or 1-bit Alpha, Alpha 1 uses Weight1
+ Parameters: Weight1 value[7:0], if 1-bit Alpha Weight1 value = 1 */
+ GFDX_ATTR_COLOR_3WIN_AC_WEIGHT1_WB,
+
+ /** set/gets width height together to avoid artifacts */
+ GFDX_ATTR_WH_WC,
+ /** set/gets source width height together to avoid artifacts,
+ Parameters: W[15:0], H[31:16] */
+ GFDX_ATTR_SRC_WH_WC,
+ /** set/gets x, y start position of window C,
+ Parameters: X[15:0], Y[31:16] */
+ GFDX_ATTR_XY_POS_WC,
+ /** Color Depth Bits per pixel: 1,2,4,8,12,15(RGB555),16(RGB565), 32(ARGB888),
+ GFDX_COLOR_DEPTH_YCbCr422,
+ GFDX_COLOR_DEPTH_YUV422,
+ GFDX_COLOR_DEPTH_YCbCr420P,
+ GFDX_COLOR_DEPTH_YUV420P,
+ GFDX_COLOR_DEPTH_YUV422P,
+ GFDX_COLOR_DEPTH_YCbCr422P,
+ GFDX_COLOR_DEPTH_YCbCr422R,
+ GFDX_COLOR_DEPTH_YUV422R,
+ GFDX_COLOR_DEPTH_YCbCr422RA,
+ GFDX_COLOR_DEPTH_YUV422RA,
+ */
+ GFDX_ATTR_BPP_WC,
+ /** Set Trigger for encode window, 0- Disable, 1- Enable, 2-single Shot*/
+ GFDX_ATTR_TRIGGER_WENC,
+ /** On/Off Horizontal & Vertical Pixel Doubling for Window C,
+ Parameters: GFDXA_PIX_DBL_H, GFDXA_PIX_DBL_V or 0-Disable */
+ GFDX_ATTR_PIXEL_DBL_WC,
+ /** Upscales/Downscales window */
+ GFDX_ATTR_SCALE_WC,
+ /** Start Address for window C Buffer 0 */
+ GFDX_ATTR_ADDR_WC_B0,
+ /** U Start Address for window C Buffer 0 */
+ GFDX_ATTR_ADDR_U_WC_B0,
+ /** V Start Address for window C Buffer 0 */
+ GFDX_ATTR_ADDR_V_WC_B0,
+ /** Stride for window C Buffer 0 */
+ GFDX_ATTR_STRIDE_WC_B0,
+ /** UV Stride for window C Buffer 0 */
+ GFDX_ATTR_STRIDE_UV_WC_B0,
+ /** Start Address for window C Buffer 1 */
+ GFDX_ATTR_ADDR_WC_B1,
+ /** U Start Address for window C Buffer 1 */
+ GFDX_ATTR_ADDR_U_WC_B1,
+ /** V Start Address for window C Buffer 1 */
+ GFDX_ATTR_ADDR_V_WC_B1,
+ /** Stride for window C Buffer 1 */
+ GFDX_ATTR_STRIDE_WC_B1,
+ /** UV Stride for window C Buffer 1 */
+ GFDX_ATTR_STRIDE_UV_WC_B1,
+ /** Enable/Disable Windows C, Parameters: 1-Enable 0-Disable */
+ GFDX_ATTR_ENABLE_WC,
+ /** Enable/Disable Buf0, Buf1, VI, GE Double Buffer (see def),
+ Parameters: GFDXA_DB_BUF0, GFDXA_DB_BUF1, GFDXA_DB_GE, GFDXA_DB_VI,
+ GFDXA_DB_EPP, GFDXA_DB_MPEGE, GFDXA_DB_HOST
+ */
+ GFDX_ATTR_DBL_BUF_WC,
+ /** Sets/Gets GC Rotate bits for window C, for internal use only */
+ GFDX_ATTR_ROTATE_BIT_WC,
+ /** Set/Get H Direction Increment/Decrement for window C, for internal use only */
+ GFDX_ATTR_H_DIRECTION_WC,
+ /** Set/Get V Direction Increment/Decrement for window C, for internal use only */
+ GFDX_ATTR_V_DIRECTION_WC,
+ /** Enable/Disable Palette for WinC */
+ GFDX_ATTR_PALETTE_EN_WC,
+ /** Set/Get Palette 666 R[31-24], G[23-16], B[15-8], Index[7-0] WinC */
+ GFDX_ATTR_PALETTE_WC,
+ /** Set/Get Palette 888 R[31-24], G[23-16], B[15-8], Index[7-0] WinC */
+ GFDX_ATTR_PALETTE888_WC,
+ /** Enable/Disable DV WinC,
+ Parameters: GFDX_ATTR_DV_ENABLE, GFDX_ATTR_DV_DISABLE
+ */
+ GFDX_ATTR_DV_CONTROL_EN_WC,
+ /** Set/Get DV Control R[26-24], G[18-16], B[10-8] WinA */
+ GFDX_ATTR_DV_CONTROL_WC,
+ /** Color Key enbled but pixel color is not in range
+ Parameters: GFDXA_BLEND_CONTROL_NOKEY_ALPHA_WEIGHT else 0 for Fix Weight */
+ GFDX_ATTR_COLOR_NOKEY_WC,
+ /** Weight0 for Color Key not match area
+ Parameters: Weight0 value[7:0], if 1-bit Alpha Weight0 value = 0 */
+ GFDX_ATTR_COLOR_NOKEY_WEIGHT0_WC,
+ /** Weight1 for Color Key not match area
+ Parameters: Weight1 value[7:0], if 1-bit Alpha Weight1 value = 1 */
+ GFDX_ATTR_COLOR_NOKEY_WEIGHT1_WC,
+ /** Color Key0 Enble/Disable for WinC
+ Parameters: GFDXA_BLEND_COLOR_KEY0_ENABLE or GFDXA_BLEND_COLOR_KEY0_DISABLE */
+ GFDX_ATTR_COLOR_KEY0_1WIN_WC,
+ /** Color Key1 Enble/Disable for WinC
+ Parameters: GFDXA_BLEND_COLOR_KEY1_ENABLE or GFDXA_BLEND_COLOR_KEY1_DISABLE */
+ GFDX_ATTR_COLOR_KEY1_1WIN_WC,
+ /** Blend Control for WinC where does not Overlap with other Window
+ Parameters: GFDXA_BLEND_CONTROL_nWIN_ALPHA_WEIGHT or 0 for Fix Weight */
+ GFDX_ATTR_COLOR_1WIN_WC,
+ /** Win Blend Weight0 for CKey disabled or CKey enabled w key match area or 1-bit Alpha, Alpha 0 uses Weight0
+ Parameters: Weight0 value[7:0], if 1-bit Alpha Weight0 value = 0 */
+ GFDX_ATTR_COLOR_1WIN_WEIGHT0_WC,
+ /** Win Blend Weight1 for CKey disabled or CKey enabled w key match area or 1-bit Alpha, Alpha 1 uses Weight1
+ Parameters: Weight1 value[7:0], if 1-bit Alpha Weight1 value = 1 */
+ GFDX_ATTR_COLOR_1WIN_WEIGHT1_WC,
+ /** Color Key0 Enble/Disable for WinC, Overlap with WinA
+ Parameters: GFDXA_BLEND_COLOR_KEY0_ENABLE (if 2WIN_C_CKEY1 enbled then ENABLE_2WIN_C_CKEY01
+ else 2WIN_C_CKEY0)
+ GFDXA_BLEND_COLOR_KEY0_DISABLE (if 2WIN_C_CKEY1 enbled then ENABLE_2WIN_C_CKEY1
+ else 2WIN_C_NOKEY)
+ */
+ GFDX_ATTR_COLOR_KEY0_2WIN_A_WC,
+ /** Color Key1 Enble/Disable for WinC, Overlap with WinA
+ Parameters: GFDXA_BLEND_COLOR_KEY1_ENABLE (if 2WIN_C_CKEY1 enbled then ENABLE_2WIN_C_CKEY01
+ else 2WIN_C_CKEY1)
+ GFDXA_BLEND_COLOR_KEY1_DISABLE (if 2WIN_C_CKEY1 enbled then ENABLE_2WIN_C_CKEY0
+ else 2WIN_C_NOKEY)
+ */
+ GFDX_ATTR_COLOR_KEY1_2WIN_A_WC,
+ /** Blend Control for WinC area that overlap with WinA only
+ Parameters: GFDXA_BLEND_CONTROL_nWIN_ALPHA_WEIGHT or GFDXA_BLEND_CONTROL_nWIN_DEPENDENT_WEIGHT
+ or 0 for FIX WEIGHT
+ */
+ GFDX_ATTR_COLOR_2WIN_A_WC,
+ /** Win Blend Weight0 for CKey disabled or CKey enabled w key match area or 1-bit Alpha, Alpha 0 uses Weight0
+ Parameters: Weight0 value[7:0], if 1-bit Alpha Weight0 value = 0 */
+ GFDX_ATTR_COLOR_2WIN_A_WEIGHT0_WC,
+ /** Win Blend Weight1 for CKey disabled or CKey enabled w key match area or 1-bit Alpha, Alpha 1 uses Weight1
+ Parameters: Weight1 value[7:0], if 1-bit Alpha Weight1 value = 1 */
+ GFDX_ATTR_COLOR_2WIN_A_WEIGHT1_WC,
+ /** Color Key0 Enble/Disable for WinC, Overlap with WinB
+ Parameters: GFDXA_BLEND_COLOR_KEY0_ENABLE (if 2WIN_C_CKEY1 enbled then ENABLE_2WIN_C_CKEY01
+ else 2WIN_C_CKEY0)
+ GFDXA_BLEND_COLOR_KEY0_DISABLE (if 2WIN_C_CKEY1 enbled then ENABLE_2WIN_C_CKEY1
+ else 2WIN_C_NOKEY)
+ */
+ GFDX_ATTR_COLOR_KEY0_2WIN_B_WC,
+ /** Color Key1 Enble/Disable for WinC, Overlap with WinB
+ Parameters: GFDXA_BLEND_COLOR_KEY1_ENABLE (if 2WIN_C_CKEY1 enbled then ENABLE_2WIN_C_CKEY01
+ else 2WIN_C_CKEY1)
+ GFDXA_BLEND_COLOR_KEY1_DISABLE (if 2WIN_C_CKEY1 enbled then ENABLE_2WIN_C_CKEY0
+ else 2WIN_C_NOKEY)
+ */
+ GFDX_ATTR_COLOR_KEY1_2WIN_B_WC,
+ /** Blend Control for WinC area that overlap with WinB only
+ Parameters: GFDXA_BLEND_CONTROL_nWIN_ALPHA_WEIGHT or GFDXA_BLEND_CONTROL_nWIN_DEPENDENT_WEIGHT
+ or 0 for FIX WEIGHT
+ */
+ GFDX_ATTR_COLOR_2WIN_B_WC,
+ /** Win Blend Weight0 for CKey disabled or CKey enabled w key match area or 1-bit Alpha, Alpha 0 uses Weight0
+ Parameters: Weight0 value[7:0], if 1-bit Alpha Weight0 value = 0 */
+ GFDX_ATTR_COLOR_2WIN_B_WEIGHT0_WC,
+ /** Win Blend Weight1 for CKey disabled or CKey enabled w key match area or 1-bit Alpha, Alpha 1 uses Weight1
+ Parameters: Weight1 value[7:0], if 1-bit Alpha Weight1 value = 1 */
+ GFDX_ATTR_COLOR_2WIN_B_WEIGHT1_WC,
+ /** Color Key0 Enble/Disable for WinC, Overlap with WinA & WinB Only
+ Parameters: GFDXA_BLEND_COLOR_KEY0_ENABLE (if 3WIN_AB_CKEY1 enbled then ENABLE_3WIN_AB_CKEY01
+ else 3WIN_AB_CKEY0)
+ GFDXA_BLEND_COLOR_KEY0_DISABLE (if 3WIN_AB_CKEY1 enbled then ENABLE_3WIN_AB_CKEY1
+ else 3WIN_AB_NOKEY)
+ */
+ GFDX_ATTR_COLOR_KEY0_3WIN_AB_WC,
+ /** Color Key1 Enble/Disable for WinC, Overlap with WinA & WinB
+ Parameters: GFDXA_BLEND_COLOR_KEY1_ENABLE (if 3WIN_AB_CKEY1 enbled then ENABLE_3WIN_AB_CKEY01
+ else 3WIN_AB_CKEY1)
+ GFDXA_BLEND_COLOR_KEY1_DISABLE (if 3WIN_AB_CKEY1 enbled then ENABLE_3WIN_AB_CKEY0
+ else 3WIN_AB_NOKEY)
+ */
+ GFDX_ATTR_COLOR_KEY1_3WIN_AB_WC,
+ /** Blend Control for WinC area that overlap with WinA & WinB only
+ Parameters: GFDXA_BLEND_CONTROL_nWIN_ALPHA_WEIGHT or GFDXA_BLEND_CONTROL_nWIN_DEPENDENT_WEIGHT
+ or 0 for FIX WEIGHT
+ */
+ GFDX_ATTR_COLOR_3WIN_AB_WC,
+ /** Win Blend Weight0 for CKey disabled or CKey enabled w key match area or 1-bit Alpha, Alpha 0 uses Weight0
+ Parameters: Weight0 value[7:0], if 1-bit Alpha Weight0 value = 0 */
+ GFDX_ATTR_COLOR_3WIN_AB_WEIGHT0_WC,
+ /** Win Blend Weight1 for CKey disabled or CKey enabled w key match area or 1-bit Alpha, Alpha 1 uses Weight1
+ Parameters: Weight1 value[7:0], if 1-bit Alpha Weight1 value = 1 */
+ GFDX_ATTR_COLOR_3WIN_AB_WEIGHT1_WC,
+ /** GC Color Key for overlay, Not supported */
+ GFDX_ATTR_COLOR_KEY,
+ /** GC Color Key Mask for overlay, Not supported */
+ GFDX_ATTR_COLOR_KEY_MASK,
+ /** Set overlap type (see def), Not supported */
+ GFDX_ATTR_OVERLAP_TYPE,
+ /** Gets VDisplay End for GE Start Window programming, Not supported */
+ GFDX_ATTR_V_DISPLAY_END,
+ /** Gets range for clock divider L=0:H=15 */
+ GFDX_ATTR_PWM0_CLK_RANGE,
+ /** Gets range for duty cycle L=0:H=255 */
+ GFDX_ATTR_PWM0_DTY_RANGE,
+ /** Controls Backlight0 clock divider for PWM0 Bits[5:0] */
+ GFDX_ATTR_PWM0_CLOCK,
+ /** Controls Backlight0 duty cycle for PWM0 Bits[7:0] */
+ GFDX_ATTR_PWM0_DUTYCY,
+ /** Gets range for clock divider L=0:H=15 */
+ GFDX_ATTR_PWM1_CLK_RANGE,
+ /** Gets range for duty cycle L=0:H=255 */
+ GFDX_ATTR_PWM1_DTY_RANGE,
+ /** Controls Backlight1 clock divider for PWM1 Bits[5:0] */
+ GFDX_ATTR_PWM1_CLOCK,
+ /** Controls Backlight1 duty cycle for PWM1 Bits[7:0] */
+ GFDX_ATTR_PWM1_DUTYCY,
+ /** LCD Type 0-Main Lcd, 1-Sub Lcd */
+ GFDX_ATTR_DISP_TYPE,
+ /** SW register 1 for program usage */
+ GFDX_ATTR_SW_REG_1,
+ /** SW register 2 for program usage */
+ GFDX_ATTR_SW_REG_2,
+ /** set/gets width height of screen encode window,
+ Parameters: W[15:0], H[31:16] */
+ GFDX_ATTR_WH_WENC,
+ /** set/gets x, y start position of screen encode window,
+ Parameters: X[15:0], Y[31:16] */
+ GFDX_ATTR_XY_POS_WENC,
+ /** Enable/Disable screen encode window. Parameters: 1-Enable 0-Disable.
+ * Please note that this sets the encode rate to its maximum value of
+ * 1.000 so if you plan to change it after enabling,
+ * use attribute GFDX_ATTR_WENC_RATE. */
+ GFDX_ATTR_ENABLE_WENC,
+ /** Get Device ID & Rev, Not supported */
+ GFDX_ATTR_DEVICE_INFO,
+ /** Enable CRC, Set Wait 1 or 2 VSync
+ Parameters: GFDXA_CRC_WAIT_VSYNC1, GFDXA_CRC_WAIT_VSYNC2, GFDXA_CRC_DISABLE
+ */
+ GFDX_ATTR_CRC_ENABLE,
+ /** Get Check Sum */
+ GFDX_ATTR_CRC_CHECK_SUM,
+ /** Not supported, Not supported */
+ GFDX_ATTR_HC_SHAPE,
+ /** load Hardware Cursor Image, Not supported */
+ GFDX_ATTR_HC_SHAPE_EXT,
+ /** set cursor hot spot, Not supported */
+ GFDX_ATTR_HC_HOTSPOT,
+ /** set foreground and background color, Not supported */
+ GFDX_ATTR_HC_COLOR,
+ /** Set Hardware Cursor new Position, Not supported */
+ GFDX_ATTR_HC_POSITION,
+ /** Enable, Disable Hardware Cursor, Not supported */
+ GFDX_ATTR_HC_SHOW,
+ /** free internal buffer, Not supported */
+ GFDX_ATTR_HC_RELEASE,
+ /** Set Start or Stop Frame
+ Parameters: GFDX_MAIN_START, GFDX_MAIN_STOP, GFDX_SUB_START, GFDX_SUB_STOP
+ */
+ GFDX_ATTR_STOP_START,
+ /** Set Start or Stop Frame
+ Parameters: GFDX_MAIN_ONE_FRAME, GFDX_SUB_ONE_FRAME
+ */
+ GFDX_ATTR_SEND_ONE_FRAME,
+ /** Set No change */
+ GFDX_ATTR_NOCHANGE,
+ /** Get Pre Init LCD Resolution Bit[0-15] Width, Bit[16-31] Height*/
+ GFDX_ATTR_PRE_INIT_LCD_RES,
+ /** NVIDIA panel index internal to API use */
+ GFDX_ATTR_INTERNAL_LCDTYPE,
+ /** Setting this attribute will bypass any hardware writes in DxAPI which go through
+ * the GFDX_CHANNEL_xx macros. The runtime environment GFSDK_DXINIT_BYPASS uses
+ * this attribue to disable hardware writes during DxSetDisplay().
+ * Parameters: GFDX_SET_WRITE_SHADOW or GFDX_CLR_WRITE_SHADOW
+ */
+ GFDX_ATTR_WRITE_SHADOW_ONLY,
+ /** Backlight0 ON GPIO LPW2 Low */
+ GFDX_ATTR_BACKLIGHT0_ON,
+ /** Backlight1 ON GPIO LM1 Low */
+ GFDX_ATTR_BACKLIGHT1_ON,
+ /** Backlight0 OFF GPIO LPW2 High */
+ GFDX_ATTR_BACKLIGHT0_OFF,
+ /** Backlight1 OFF GPIO LM1 High*/
+ GFDX_ATTR_BACKLIGHT1_OFF,
+ /** configure BACKLIGHT0 as GPIO on LPW2*/
+ GFDX_ATTR_BACKLIGHT0_CONFIGURE_GPIO,
+ /** configure BACKLIGHT1 as GPIO on LM1*/
+ GFDX_ATTR_BACKLIGHT1_CONFIGURE_GPIO,
+ /** configure BACKLIGHT0 as PWM on LPW2*/
+ GFDX_ATTR_BACKLIGHT0_CONFIGURE_PWM,
+ /** configure BACKLIGHT1 as PWM on LM1 */
+ GFDX_ATTR_BACKLIGHT1_CONFIGURE_PWM,
+
+ /** Set Stop Frame Options,
+ Parameters: GFDX_MAIN_STOP_POLARITY_HIGH, GFDX_MAIN_STOP_POLARITY_LOW, GFDX_SUB_STOP_POLARITY_HIGH
+ GFDX_SUB_STOP_POLARITY_LOW, GFDX_MAIN_STOP_INPUT_PIN_ENABLE, GFDX_MAIN_STOP_INPUT_PIN_DISABLE,
+ GFDX_SUB_STOP_INPUT_PIN_ENABLE, GFDX_SUB_STOP_INPUT_PIN_DISABLE, GFDX_STOP_WINDOW_A_NC_ENABLE,
+ GFDX_STOP_WINDOW_A_NC_DISABLE, GFDX_STOP_WINDOW_B_NC_ENABLE, GFDX_STOP_WINDOW_B_NC_DISABLE,
+ GFDX_STOP_WINDOW_B_NC_ENABLE, GFDX_STOP_WINDOW_B_NC_DISABLE
+ */
+ GFDX_ATTR_STOP_FRAME_OPTIONS,
+ /** Set Non Continuos Display */
+ GFDX_ATTR_NC_DISPLAY,
+ /** Horizontal and Vertical Filter Support Window B
+ Parameters: GFDX_H_FILTER_ENABLE, GFDX_H_FILTER_DISABLE, GFDX_V_FILTER_ENABLE, GFDX_V_FILTER_DISABLE
+ */
+ GFDX_ATTR_H_V_FILTER_WB,
+ /** Horizontal and Vertical Filter Support Window C
+ Parameters: GFDX_H_FILTER_ENABLE, GFDX_H_FILTER_DISABLE, GFDX_V_FILTER_ENABLE, GFDX_V_FILTER_DISABLE
+ */
+ GFDX_ATTR_H_V_FILTER_WC,
+
+ /** Get Supported Display Script Options
+ Parameters: GFDX_DEFAULT_TABLE, GFDX_DXAPI_SUPPORT, GFDX_FMARK_SUPPORT
+ */
+ GFDX_ATTR_DISPLAY_SCRIPT_OPTIONS,
+ /** Rate of window decode output frames when sending continuously.
+ * please note that the rate is overwritten with the maximum value (i.e. 1.000
+ * which is represented by a fixed point fraction 16.16) if you use attribute
+ * GFDX_ATTR_ENABLE_WENC, so you need to overwrite with this attribute.
+ * Parameters: any number between 0x0 and 0x10000 (i.e. 0.0 an 1.000)
+ */
+ GFDX_ATTR_WENC_RATE
+
+} GFDXATTRIBUTES;
+
+// Stop Frame Options
+#define GFDX_MAIN_STOP_POLARITY_HIGH 0x00000001
+#define GFDX_MAIN_STOP_POLARITY_LOW 0x80000001
+#define GFDX_MAIN_STOP_INPUT_PIN_ENABLE 0x00000002
+#define GFDX_MAIN_STOP_INPUT_PIN_DISABLE 0x80000002
+
+#define GFDX_SUB_STOP_POLARITY_HIGH 0x00000004
+#define GFDX_SUB_STOP_POLARITY_LOW 0x80000004
+#define GFDX_SUB_STOP_INPUT_PIN_ENABLE 0x00000006
+#define GFDX_SUB_STOP_INPUT_PIN_DISABLE 0x80000006
+
+#define GFDX_STOP_WINDOW_A_NC_ENABLE 0x00000010
+#define GFDX_STOP_WINDOW_A_NC_DISABLE 0x80000010
+#define GFDX_STOP_WINDOW_B_NC_ENABLE 0x00000011
+#define GFDX_STOP_WINDOW_B_NC_DISABLE 0x80000011
+#define GFDX_STOP_WINDOW_C_NC_ENABLE 0x00000012
+#define GFDX_STOP_WINDOW_C_NC_DISABLE 0x80000012
+
+// Horizontal and Vertical Filter Support Window B & C
+
+#define GFDX_H_FILTER_ENABLE 0x00000100
+#define GFDX_H_FILTER_DISABLE 0x80000100
+#define GFDX_V_FILTER_ENABLE 0x00004000
+#define GFDX_V_FILTER_DISABLE 0x80004000
+#define GFDX_V_FILTER_OPTIMIZE_ENABLE 0x00010000
+#define GFDX_V_FILTER_OPTIMIZE_DISABLE 0x80010000
+
+// Display Script Options
+
+#define GFDX_DEFAULT_TABLE 0x00000001
+#define GFDX_DXAPI_SUPPORT 0x00000002
+#define GFDX_FMARK_SUPPORT 0x00000004
+
+
+/** Attribute value for GFDX_ATTR_WRITE_SHADOW_ONLY.
+ * Setting this attribute will disable all channel hardware writes in DxAPI.
+ * The runtime environment GFSDK_DXINIT_BYPASS uses this attribue to disable
+ * hardware writes in DxSetDisplay().
+ */
+#define GFDX_SET_WRITE_SHADOW 0x00000001
+/** Attribute value for GFDX_ATTR_WRITE_SHADOW_ONLY.
+ * This attribute is used to clear the effect of #GFDX_SET_WRITE_SHADOW.
+ * It must be used explicitly to re-enable hardware writes in DxAPI.
+ */
+#define GFDX_CLR_WRITE_SHADOW 0x80000001
+
+
+
+#define GFDX_COLOR_DEPTH_YCbCr422 (16UL | 0x80000000)
+#define GFDX_COLOR_DEPTH_YUV422 (17UL | 0x80000000)
+#define GFDX_COLOR_DEPTH_YCbCr420P (18UL | 0x80000000)
+#define GFDX_COLOR_DEPTH_YUV420P (19UL | 0x80000000)
+#define GFDX_COLOR_DEPTH_YCbCr422P (20UL | 0x80000000)
+#define GFDX_COLOR_DEPTH_YUV422P (21UL | 0x80000000)
+#define GFDX_COLOR_DEPTH_YCbCr422R (22UL | 0x80000000)
+#define GFDX_COLOR_DEPTH_YUV422R (23UL | 0x80000000)
+#define GFDX_COLOR_DEPTH_YCbCr422RA (24UL | 0x80000000)
+#define GFDX_COLOR_DEPTH_YUV422RA (25UL | 0x80000000)
+
+#define GFDX_SWAP_MASK 0x000f0000
+#define GFDX_NO_SWAP 0x00000000
+#define GFDX_BYTE_SWAP 0x00010000
+#define GFDX_ORDER_SWAP 0x00020000
+#define GFDX_WORD_SWAP 0x00030000
+
+#define GFDX_COLOR_DEPTH_YUV422_YVYU (17UL | 0x80000000 | GFDX_NO_SWAP)
+#define GFDX_COLOR_DEPTH_YUV422_VYUY (17UL | 0x80000000 | GFDX_BYTE_SWAP)
+#define GFDX_COLOR_DEPTH_YUV422_UYVY (17UL | 0x80000000 | GFDX_ORDER_SWAP)
+#define GFDX_COLOR_DEPTH_YUV422_YUYV (17UL | 0x80000000 | GFDX_WORD_SWAP)
+
+#define GFDX_COLOR_DEPTH_YCbCr422_YVYU (16UL | 0x80000000 | GFDX_NO_SWAP)
+#define GFDX_COLOR_DEPTH_YCbCr422_VYUY (16UL | 0x80000000 | GFDX_BYTE_SWAP)
+#define GFDX_COLOR_DEPTH_YCbCr422_UYVY (16UL | 0x80000000 | GFDX_ORDER_SWAP)
+#define GFDX_COLOR_DEPTH_YCbCr422_YUYV (16UL | 0x80000000 | GFDX_WORD_SWAP)
+
+
+// Horizontal Filter Coefficients
+
+#define GF_H_P00C0 0x0
+#define GF_H_P00C1 (0x0 << 3 )
+#define GF_H_P00C2 (0x80 << 8 )
+#define GF_H_P00C3 (0x0 << 16)
+#define GF_H_P00C4 (0x0 << 24)
+#define GF_H_P00C5 (0x0 << 29)
+#define GF_H_P00CX GF_H_P00C0|GF_H_P00C1|GF_H_P00C2|GF_H_P00C3|GF_H_P00C4|GF_H_P00C5
+
+#define GF_H_P01C0 0x1
+#define GF_H_P01C1 (0x1c << 3 )
+#define GF_H_P01C2 (0x7c << 8 )
+#define GF_H_P01C3 (0x8 << 16)
+#define GF_H_P01C4 (0x1e << 24)
+#define GF_H_P01C5 (0x1 << 29)
+#define GF_H_P01CX GF_H_P01C0|GF_H_P01C1|GF_H_P01C2|GF_H_P01C3|GF_H_P01C4|GF_H_P01C5
+
+#define GF_H_P02C0 0x1
+#define GF_H_P02C1 (0x18 << 3 )
+#define GF_H_P02C2 (0x7a << 8 )
+#define GF_H_P02C3 (0x11 << 16)
+#define GF_H_P02C4 (0x1b << 24)
+#define GF_H_P02C5 (0x1 << 29)
+#define GF_H_P02CX GF_H_P02C0|GF_H_P02C1|GF_H_P02C2|GF_H_P02C3|GF_H_P02C4|GF_H_P02C5
+
+#define GF_H_P03C0 0x2
+#define GF_H_P03C1 (0x15 << 3 )
+#define GF_H_P03C2 (0x73 << 8 )
+#define GF_H_P03C3 (0x1b << 16)
+#define GF_H_P03C4 (0x19 << 24)
+#define GF_H_P03C5 (0x2 << 29)
+#define GF_H_P03CX GF_H_P03C0|GF_H_P03C1|GF_H_P03C2|GF_H_P03C3|GF_H_P03C4|GF_H_P03C5
+
+#define GF_H_P04C0 0x2
+#define GF_H_P04C1 (0x13 << 3 )
+#define GF_H_P04C2 (0x6d << 8 )
+#define GF_H_P04C3 (0x25 << 16)
+#define GF_H_P04C4 (0x17 << 24)
+#define GF_H_P04C5 (0x2 << 29)
+#define GF_H_P04CX GF_H_P04C0|GF_H_P04C1|GF_H_P04C2|GF_H_P04C3|GF_H_P04C4|GF_H_P04C5
+
+#define GF_H_P05C0 0x3
+#define GF_H_P05C1 (0x11 << 3 )
+#define GF_H_P05C2 (0x66 << 8 )
+#define GF_H_P05C3 (0x2f << 16)
+#define GF_H_P05C4 (0x15 << 24)
+#define GF_H_P05C5 (0x2 << 29)
+#define GF_H_P05CX GF_H_P05C0|GF_H_P05C1|GF_H_P05C2|GF_H_P05C3|GF_H_P05C4|GF_H_P05C5
+
+#define GF_H_P06C0 0x3
+#define GF_H_P06C1 (0x11 << 3 )
+#define GF_H_P06C2 (0x5e << 8 )
+#define GF_H_P06C3 (0x38 << 16)
+#define GF_H_P06C4 (0x13 << 24)
+#define GF_H_P06C5 (0x3 << 29)
+#define GF_H_P06CX GF_H_P06C0|GF_H_P06C1|GF_H_P06C2|GF_H_P06C3|GF_H_P06C4|GF_H_P06C5
+
+#define GF_H_P07C0 0x3
+#define GF_H_P07C1 (0x10 << 3 )
+#define GF_H_P07C2 (0x55 << 8 )
+#define GF_H_P07C3 (0x43 << 16)
+#define GF_H_P07C4 (0x12 << 24)
+#define GF_H_P07C5 (0x3 << 29)
+#define GF_H_P07CX GF_H_P07C0|GF_H_P07C1|GF_H_P07C2|GF_H_P07C3|GF_H_P07C4|GF_H_P07C5
+
+#define GF_H_P08C0 0x3
+#define GF_H_P08C1 (0x11 << 3 )
+#define GF_H_P08C2 (0x4c << 8 )
+#define GF_H_P08C3 (0x4c << 16)
+#define GF_H_P08C4 (0x11 << 24)
+#define GF_H_P08C5 (0x3 << 29)
+#define GF_H_P08CX GF_H_P08C0|GF_H_P08C1|GF_H_P08C2|GF_H_P08C3|GF_H_P08C4|GF_H_P08C5
+
+#define GF_H_P09C0 0x3
+#define GF_H_P09C1 (0x12 << 3 )
+#define GF_H_P09C2 (0x43 << 8 )
+#define GF_H_P09C3 (0x55 << 16)
+#define GF_H_P09C4 (0x10 << 24)
+#define GF_H_P09C5 (0x3 << 29)
+#define GF_H_P09CX GF_H_P09C0|GF_H_P09C1|GF_H_P09C2|GF_H_P09C3|GF_H_P09C4|GF_H_P09C5
+
+#define GF_H_P0AC0 0x3
+#define GF_H_P0AC1 (0x13 << 3 )
+#define GF_H_P0AC2 (0x38 << 8 )
+#define GF_H_P0AC3 (0x5e << 16)
+#define GF_H_P0AC4 (0x11 << 24)
+#define GF_H_P0AC5 (0x3 << 29)
+#define GF_H_P0ACX GF_H_P0AC0|GF_H_P0AC1|GF_H_P0AC2|GF_H_P0AC3|GF_H_P0AC4|GF_H_P0AC5
+
+#define GF_H_P0BC0 0x2
+#define GF_H_P0BC1 (0x15 << 3 )
+#define GF_H_P0BC2 (0x2f << 8 )
+#define GF_H_P0BC3 (0x66 << 16)
+#define GF_H_P0BC4 (0x11 << 24)
+#define GF_H_P0BC5 (0x3 << 29)
+#define GF_H_P0BCX GF_H_P0BC0|GF_H_P0BC1|GF_H_P0BC2|GF_H_P0BC3|GF_H_P0BC4|GF_H_P0BC5
+
+#define GF_H_P0CC0 0x2
+#define GF_H_P0CC1 (0x17 << 3 )
+#define GF_H_P0CC2 (0x25 << 8 )
+#define GF_H_P0CC3 (0x6d << 16)
+#define GF_H_P0CC4 (0x13 << 24)
+#define GF_H_P0CC5 (0x2 << 29)
+#define GF_H_P0CCX GF_H_P0CC0|GF_H_P0CC1|GF_H_P0CC2|GF_H_P0CC3|GF_H_P0CC4|GF_H_P0CC5
+
+#define GF_H_P0DC0 0x2
+#define GF_H_P0DC1 (0x19 << 3 )
+#define GF_H_P0DC2 (0x1b << 8 )
+#define GF_H_P0DC3 (0x73 << 16)
+#define GF_H_P0DC4 (0x15 << 24)
+#define GF_H_P0DC5 (0x2 << 29)
+#define GF_H_P0DCX GF_H_P0DC0|GF_H_P0DC1|GF_H_P0DC2|GF_H_P0DC3|GF_H_P0DC4|GF_H_P0DC5
+
+#define GF_H_P0EC0 0x1
+#define GF_H_P0EC1 (0x1b << 3 )
+#define GF_H_P0EC2 (0x11 << 8 )
+#define GF_H_P0EC3 (0x7a << 16)
+#define GF_H_P0EC4 (0x18 << 24)
+#define GF_H_P0EC5 (0x1 << 29)
+#define GF_H_P0ECX GF_H_P0EC0|GF_H_P0EC1|GF_H_P0EC2|GF_H_P0EC3|GF_H_P0EC4|GF_H_P0EC5
+
+#define GF_H_P0FC0 0x1
+#define GF_H_P0FC1 (0x1e << 3 )
+#define GF_H_P0FC2 (0x8 << 8 )
+#define GF_H_P0FC3 (0x7c << 16)
+#define GF_H_P0FC4 (0x1c << 24)
+#define GF_H_P0FC5 (0x1 << 29)
+#define GF_H_P0FCX GF_H_P0FC0|GF_H_P0FC1|GF_H_P0FC2|GF_H_P0FC3|GF_H_P0FC4|GF_H_P0FC5
+
+// Vertical Filter Coefficients
+#define GF_V_P00C0 0x80
+#define GF_V_P01C0 0x78
+#define GF_V_P02C0 0x70
+#define GF_V_P03C0 0x68
+#define GF_V_P04C0 0x60
+#define GF_V_P05C0 0x58
+#define GF_V_P06C0 0x50
+#define GF_V_P07C0 0x48
+#define GF_V_P08C0 0x40
+#define GF_V_P09C0 0x38
+#define GF_V_P0AC0 0x30
+#define GF_V_P0BC0 0x28
+#define GF_V_P0CC0 0x20
+#define GF_V_P0DC0 0x18
+#define GF_V_P0EC0 0x10
+#define GF_V_P0FC0 0x8
+
+/** Hardware Cursor definition */
+typedef struct _HC_COLOR
+{
+ NvU32 foreground;
+ NvU32 background;
+} HC_COLOR, *PHC_COLOR;
+
+typedef struct _HC_POSITION
+{
+ NvU32 x;
+ NvU32 y;
+} HC_POSITION, *PHC_POSITION;
+
+typedef struct _HC_HOTSPOT
+{
+ NvU32 x;
+ NvU32 y;
+} HC_HOTSPOT, *PHC_HOTSPOT;
+
+enum
+{
+ CD64X64,
+ CD32X32
+};
+
+typedef struct _HC_MASK
+{
+ NvU32 *data;
+ NvU32 size;
+ NvU32 dimension;
+} HC_MASK, *PHC_MASK;
+
+typedef struct _DisplayTimingEntry
+{
+ /** Horizontal Ref. Need not to be changed, set 0 for default setting */
+ NvU16 usHRef;
+ /** Vertical Ref. Need not to be changed, set 0 for default setting */
+ NvU16 usVRef;
+ /** Horizontal Sync Width, set 0 for default setting */
+ NvU16 usHSyncWidth;
+ /** Vertical Sync Width, set 0 for default setting */
+ NvU16 usVSyncWidth;
+ /** Horizontal Back Porch, set 0 for default setting */
+ NvU16 usHBackPorch;
+ /** Vertical Back Porch, set 0 for default setting */
+ NvU16 usVBackPorch;
+ /** Horizontal Active, Set same as Window Width */
+ NvU16 usHActive;
+ /** Vertical Active, Set same as Window Height */
+ NvU16 usVActive;
+ /** Horizontal Total, set 0 for default setting */
+ NvU16 usHTotal;
+ /** Vertical Total, set 0 for default setting */
+ NvU16 usVTotal;
+ /** Window Width */
+ NvU16 usPanelVX;
+ /** Window Height */
+ NvU16 usPanelVY;
+ /** Window Start X Position */
+ NvU16 usPosX;
+ /** Window Start Y Position */
+ NvU16 usPosY;
+ /** Window Sel 0-WinA (GFDX_DISPTMG_SEL_WINA), 1-WinB (GFDX_DISPTMG_SEL_WINB) */
+ NvU16 SelWin;
+ NvU16 Reserved1;
+ NvU16 Reserved2;
+ NvU16 Reserved3;
+} DISPLAYTIMINGENTRY, *PDISPLAYTIMINGENTRY;
+
+// Display Timing
+
+#define GFDX_DISPTMG_SEL_WINA 0
+#define GFDX_DISPTMG_SEL_WINB 1
+
+/** redefine some of the constants for compatibility */
+#define GFDX_ATTR_WIDTH_HEIGHT GFDX_ATTR_WH_WA
+#define GFDX_ATTR_XY_POSITION GFDX_ATTR_XY_POS_WA
+#define GFDX_ATTR_BPP GFDX_ATTR_BPP_WA
+#define GFDX_ATTR_PIXEL_DOUBLE GFDX_ATTR_PIXEL_DBL_WA
+#define GFDX_ATTR_STARTADDR GFDX_ATTR_ADDR_WA_B0
+#define GFDX_ATTR_STRIDE GFDX_ATTR_STRIDE_WA_B0
+
+/** definition of GFDX_ATTR_PIXEL_DOUBLE */
+#define GFDXA_PIX_DBL_H 0x01 /* Horizontal pixel doubling on */
+#define GFDXA_PIX_DBL_V 0x02 /* Vertical pixel doubling on */
+
+/** definition of GFDX_ATTR_DOUBLE_BUF control (0,2,1,3 is same as hw) */
+#define GFDXA_DB_BUF0 0x00 /* GC display buffer address is from buf0 */
+#define GFDXA_DB_BUF1 0x02 /* GC display buffer address is from buf1 */
+#define GFDXA_DB_HOST 0x06 /* GC display buffer address is from Host */
+#define GFDXA_DB_GE 0x01 /* GC display buffer address is from GE */
+#define GFDXA_DB_VI 0x03 /* GC display buffer address is from VI */
+#define GFDXA_DB_EPP 0x04
+#define GFDXA_DB_MPEGE 0x05
+
+/** definition of GFDX_ATTR_ROTATE_BIT_W? */
+#define GFDXA_ROTATE_BITS_0 0x00000000 // no rotation, x+,y+,startAddr = 0
+#define GFDXA_ROTATE_BITS_90 0x00000500 // +90 (anti-clock), x-, y+, start= stride-3 (TL)
+#define GFDXA_ROTATE_BITS_180 0x00000300 // +180(anti-clock), x-, y-, start= height*stride-3 (BR)
+#define GFDXA_ROTATE_BITS_270 0x00000600 // +270(anti-clock), x+, y-, start= (height-1)*stride (BL)
+
+/** definition of Color Key and Alpha Blending*/
+#define GFDXA_BLEND_CONTROL_NOKEY_ALPHA_WEIGHT 0x00000001
+
+#define GFDXA_BLEND_COLOR_KEY0_ENABLE 0x00000001
+#define GFDXA_BLEND_COLOR_KEY1_ENABLE 0x00000002
+#define GFDXA_BLEND_COLOR_KEY0_DISABLE 0x00000000
+#define GFDXA_BLEND_COLOR_KEY1_DISABLE 0x00000000
+#define GFDXA_BLEND_CONTROL_nWIN_ALPHA_WEIGHT 0x00000004
+#define GFDXA_BLEND_CONTROL_nWIN_DEPENDENT_WEIGHT 0x00000008
+
+/** Disable CRC capture. */
+#define GFDXA_CRC_DISABLE 0x00000000
+/** Wait for 1 VSYNC and capture CRC for one frame. */
+#define GFDXA_CRC_WAIT_VSYNC1 0x00000001
+/** Wait for 2 VSYNC and capture CRC for one frame. */
+#define GFDXA_CRC_WAIT_VSYNC2 0x00000003
+
+/** Set Direction for Rotation*/
+#define GFDX_ATTR_H_DIRECTION_DECREMENT 0x00000001
+#define GFDX_ATTR_H_DIRECTION_INCREMENT 0x00000000
+#define GFDX_ATTR_V_DIRECTION_DECREMENT 0x00000004
+#define GFDX_ATTR_V_DIRECTION_INCREMENT 0x00000000
+
+/** definition of Palette Enable/Disable*/
+#define GFDX_ATTR_PALETTE_ENABLE 0x00010000
+#define GFDX_ATTR_PALETTE_DISABLE 0x00000000
+#define GFDX_ATTR_DV_ENABLE 0x00100000
+#define GFDX_ATTR_DV_DISABLE 0x00000000
+
+#define GFDX_ATTR_WENC_DISABLE 0x00000000
+#define GFDX_ATTR_WENC_ENABLE 0x00000001
+#define GFDX_ATTR_WENC_TRIG_DISABLE 0x00000000
+#define GFDX_ATTR_WENC_TRIG_ENABLE 0x00000001
+#define GFDX_ATTR_WENC_TRIG_ONE_SHOT 0x00000002
+
+/** Read CRC Check Sum */
+#define GFDXA_CRC_READ_CHECK_SUM 0x00000001
+
+/**
+ Sub-LCD support
+ */
+#define LCD_MAIN 0
+#define LCD_SUB 1
+#define MAX_LCD 2
+
+/**
+ Start-Stop Frame support
+ */
+#define GFDX_MAIN_START 0x00000001
+#define GFDX_MAIN_STOP 0x00000002
+#define GFDX_SUB_START 0x00000003
+#define GFDX_SUB_STOP 0x00000004
+#define GFDX_MAIN_ONE_FRAME 0x00000001
+#define GFDX_SUB_ONE_FRAME 0x00000002
+
+#define GF_DISPLAY_NORMAL 0x00000000
+#define GF_DISPLAY_PARTIAL 0x00000001
+
+#ifdef PROJECT_SEC_G1
+#define GF_DISPLAY_NTSC_V570 0x00000002
+#define GF_DISPLAY_NTSC_V490 0x00000003
+#define GF_DISPLAY_NTSC_V700 0x00000004
+#define GF_DISPLAY_PAL 0x00000005
+#endif
+
+/**
+ DxEnableDisplay support
+ */
+#define GF_PANEL_DRV_ONOFF 0x00000100
+#define GF_PANEL_DRV_SLP_WKUP 0x00000200
+
+/**
+ Clock selections, profile and options
+ */
+#define GFDX_OSC 0x00000001
+#define GFDX_ROSC 0x00000002
+#define GFDX_PLL1 0x00000003
+#define GFDX_PLL_QUERY 0x80000000
+#define GFDX_POWER 0x00010000
+#define GFDX_PERFORMANCE 0x00020000
+
+/**
+ Option for GFDxVSync: Waits until vertical blank (default).
+ */
+#define GFDX_VSYNC_WAIT 0x0000
+/**
+ Option for GFDxVSync: Checks and immediately returns vertical blank status.
+ Returns GF_SUCCESS if in vertical blank, else returns GF_ERROR.
+ */
+#define GFDX_VSYNC_CHECK 0x0001
+/**
+ Option for GFDxVSync: Puts Wait token in the command FIFO and the CPU returns
+ immediately. Uses FRAME_END interrupt bit.
+ */
+#define GFDX_VSYNC_HW_WAIT 0x0002
+/**
+ Option for GFDxVSync: Raise and wait in the command fifo for VBLANK.
+ */
+#define GFDX_VBLANK_HW_WAIT 0x0003
+/**
+ Option for GFDxVSync: Raise and wait in the command fifo for VPULSE3.
+ */
+#define GFDX_VPULSE3_HW_WAIT 0x0004
+
+/** Dx Hardware has multiple windows (some registers are replicated per
+ window - the window must be exlicitly selected to write to the correct
+ register in the window). Use this enum to select which window
+ to write to for APIs that support this - window selection is mostly
+ done through the attribute name, eg: _WA, _WB, etc.
+ */
+typedef enum _GFDXWINDOWSELECT
+{
+ DX_WINDOW_SELECT_NONE = 0,
+ DX_WINDOW_SELECT_NORMAL = 1, /* all windows */
+ DX_WINDOW_SELECT_A = 2,
+ DX_WINDOW_SELECT_B = 4,
+ DX_WINDOW_SELECT_C = 8
+} GFDXWINDOWSELECT;
+
+/** Color Space Conversion coefficients. Use GFDxSetCSCCoeff() and
+ GFDxGetCSCCoeff() to write/read the coefficients to/from hardware.
+ */
+typedef struct _GFDXCSCCOEFF
+{
+ NvU32 YOF;
+ NvU32 KYRGB;
+ NvU32 KUR;
+ NvU32 KVR;
+ NvU32 KUG;
+ NvU32 KVG;
+ NvU32 KUB;
+ NvU32 KVB;
+} GFDXCSCCOEF;
+
+typedef struct _DXSCRIPTCMD
+{
+ NvU32 ScriptCmdType; /** Script Command */
+ NvU32 DataBurstCount; /** Burst count 0-255, not Valid for GFSCMD */
+ NvU32 PanelDriverCmd; /** Valid Only if ScriptCmdType = GFPDRV_CMD */
+ NvU32 *PanelIndexData; /** Data pointer */
+ NvU32 GFData; /** Valid only if ScriptCmdType is GFSCMD */
+ NvU32 reserved1;
+} DXSCRIPTCMD, *PDXSCRIPTCMD;
+
+typedef struct _GFLCDTABLE {
+ /** For usage see GFDxSetDisplay()*/
+ GF_RETTYPE (* DxSetDisplay)(GFDxHandle DxHandle, int lcdSel, NvU32 ulStartAddr,
+ NvU32 ulStride, unsigned bpp);
+ /** For usage see GFDxEnableDisplay()*/
+ GF_RETTYPE (* DxEnableDisplay)(GFDxHandle DxHandle, int lcdSel, unsigned bOn);
+ /** For usage see GFDxSetAttribute()*/
+ GF_RETTYPE (* DxSetAttribute)(GFDxHandle DxHandle, int lcdSel, unsigned aid, NvU32 attr);
+ /** For usage see GFDxGetAttribute()*/
+ GF_RETTYPE (* DxGetAttribute)(GFDxHandle DxHandle, int lcdSel, unsigned aid, NvU32 *attr);
+ /** For usage see GFDxSetAttributeWithCS()*/
+ GF_RETTYPE (* DxSetAttributeWithCS)(GFDxHandle DxHandle, int lcdSel, unsigned aid, NvU32 attr);
+ /** For usage see GFDxGetAttributeWithCS()*/
+ GF_RETTYPE (* DxGetAttributeWithCS)(GFDxHandle DxHandle, int lcdSel, unsigned aid, NvU32 *attr);
+ /** For usage see GFDxRotate()*/
+ GF_RETTYPE (* DxRotate)(GFDxHandle DxHandle, int lcdSel, unsigned nRotate, NvU32 ulStartAddr);
+ /** For usage see GFDxErase()*/
+ GF_RETTYPE (* DxErase)(GFDxHandle DxHandle, int lcdSel, NvU32 ulStartAddr, NvU32 color);
+ /** For usage see GFDxSwitchLCD()*/
+ GF_RETTYPE (* DxSwitchLCD)(GFDxHandle DxHandle, int lcdSel, int Option);
+ /** LCD Configurations */
+ void * pLcdConfig;
+ /** For usage see GFDxScriptCmd()*/
+ GF_RETTYPE (* DxScriptCmd)(GFDxHandle DxHandle, int lcdSel, PDXSCRIPTCMD pDxScriptCmd, NvU32 Option);
+ /** For usage see GFDxScriptCmdWithCS()*/
+ GF_RETTYPE (* DxScriptCmdWithCS)(GFDxHandle DxHandle, int lcdSel, PDXSCRIPTCMD pDxScriptCmd, NvU32 Option);
+ /** For usage see GFDxDisplayTiming()*/
+ GF_RETTYPE (* DxDisplayTiming)(GFDxHandle DxHandle, int lcdSel, PDISPLAYTIMINGENTRY pDxTiming, NvU32 Option);
+ /** For usage see GFDxDisplayTimingWithCS()*/
+ GF_RETTYPE (* DxDisplayTimingWithCS)(GFDxHandle DxHandle, int lcdSel, PDISPLAYTIMINGENTRY pDxTiming, NvU32 Option);
+ /** For usage see GFDxSetDisplayEx()*/
+ GF_RETTYPE (* DxSetDisplayEx)(GFDxHandle DxHandle, int lcdSel, NvU32 ulStartAddr,
+ NvU32 ulStride, unsigned bpp, unsigned bOn);
+} GFLCDTABLE;
+
+/* Publicly exposed DX API function table */
+typedef struct _GFDXTABLE
+{
+ /** For usage see GFDxGetProperty()*/
+ GF_RETTYPE (* DxGetProperty)(GFDxHandle DxHandle, PGFDXPROPERTY pDxProp);
+ /** For usage see GFDxVSync()*/
+ GF_RETTYPE (* DxVSync)(GFDxHandle DxHandle, NvU16 option);
+ /** For usage see GFDxSetDisplayWithCS()*/
+ GF_RETTYPE (* DxSetDisplayWithCS)(GFDxHandle DxHandle, int lcdSel,
+ NvU32 ulStartAddr, NvU32 ulStride, unsigned bpp);
+ /** For usage see GFDxEnableDisplayWithCS()*/
+ GF_RETTYPE (* DxEnableDisplayWithCS)(GFDxHandle DxHandle, int lcdSel,
+ unsigned bOn);
+// Removed to make the WinCE dll binary compatible with SC4 dll.
+// GF_RETTYPE (* DxHSync)(GFDxHandle DxHandle, NvU16 option);
+
+ /** For per LCD functions. ()*/
+ GFLCDTABLE Lcd[MAX_LCD];
+ /** For usage see GFDxEraseWithCS()*/
+ GF_RETTYPE (* DxEraseWithCS)(GFDxHandle DxHandle, int lcdSel,
+ NvU32 ulStartAddr, NvU32 color);
+ /** For usage see GFDxSetCSCCoeff()*/
+ GF_RETTYPE (* DxSetCSCCoeff)( GFDxHandle DxHandle, GFDXWINDOWSELECT window,
+ GFDXCSCCOEF *coef );
+ /** For usage see GFDxGetCSCCoeff()*/
+ GF_RETTYPE (* DxGetCSCCoeff)( GFDxHandle DxHandle, GFDXWINDOWSELECT window,
+ GFDXCSCCOEF *coef );
+ /** For usage see GFDxVSyncWithCS()*/
+ GF_RETTYPE (* DxVSyncWithCS)(GFDxHandle DxHandle, NvU16 option);
+ /** For usage see GFDxSetCSCCoeffWithCS()*/
+ GF_RETTYPE (* DxSetCSCCoeffWithCS)( GFDxHandle DxHandle, GFDXWINDOWSELECT window,
+ GFDXCSCCOEF *coef );
+ /** For usage see GFDxGetCSCCoeffWithCS()*/
+ GF_RETTYPE (* DxGetCSCCoeffWithCS)( GFDxHandle DxHandle, GFDXWINDOWSELECT window,
+ GFDXCSCCOEF *coef );
+ /** For usage see GFDxSetDisplayExWithCS()*/
+ GF_RETTYPE (* DxSetDisplayExWithCS)(GFDxHandle DxHandle, int lcdSel,
+ NvU32 ulStartAddr, NvU32 ulStride, unsigned bpp, unsigned bOn);
+} GFDXTABLE, *PGFDXTABLE;
+
+/** Filter coefficients */
+typedef struct GFDxHorizontalFilter_t
+{
+ NvU32 filter[16];
+} GFDxHorizontalFilter;
+
+typedef struct GFDxVerticalFilter_t
+{
+ NvU32 filter[16];
+} GFDxVerticalFilter;
+
+/**
+ Typesafe function for opening Dx component.
+ This function is implicitly called by the resource manager (GFRm) in response
+ to an applications call to GFRmComponentGet() for the GFDxAPI
+ component. It is not supposed to be called by an application. It is included
+ here only for the purpose of GFDxAPI source code customization.
+
+ @param hrm (GFRmHandle) Handle to Rm component.
+ @param phDx (GFDxHandle *) Handle to Dx component.
+ @param state (GF_STATE_TYPE)
+ @param hCh (GFRmChHandle) Handle to Channel.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+ */
+GF_RETTYPE GFDxOpen(GFRmHandle hRm, GFDxHandle *phDx,
+ GF_STATE_TYPE state, GFRmChHandle hCh);
+
+/**
+ Typesafe function for closing Dx component.
+ This function is implicitly called by the resource manager (GFRm) in response
+ to an applications call to GFRmComponentGet() for the GFDxAPI
+ component. It is included here only for the purpose of GFDxAPI source code
+ customization.
+
+ @param phDx (GFDxHandle *) Handle to Dx component.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+ *
+*/
+void GFDxClose(GFDxHandle *phDx);
+
+/**
+ This funtion returns the fixed properties of the display hardware.
+
+ @param DxHandle (GFDxHandle) Handle to Dx Component
+ @param pDxProp (PGFDXPROPERTY) See #GFDXPROPERTY
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+ */
+#define GFDxGetProperty( handle, pDxProp ) \
+ ((PGFDXTABLE)handle)->DxGetProperty( handle, pDxProp )
+
+/**
+ This functions waits for a vertical sync and returns to the caller.
+ IMPORTANT NOTE: This function is now identical to the WithCS version
+ of it (i.e. it has Critical Sections and is multi-thread safe) as the
+ WithCS version is being phased out.
+
+ @param DxHandle (GFDxHandle) Handle to Dx Component.
+ @param option (NvU16) Search for Option for GFDxVSync for more info.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+ */
+#define GFDxVSync(handle, option) \
+ ((PGFDXTABLE)handle)->DxVSync( handle, option )
+
+/**
+ IMPORTANT NOTE: This function is being phased out. The critical
+ section functionality now exists in GFDxVSync().
+ */
+#define GFDxVSyncWithCS(handle, option) \
+ ((PGFDXTABLE)handle)->DxVSyncWithCS( handle, option )
+
+/**
+ IMPORTANT NOTE: This function is not available.
+ */
+#define GFDxHSync(handle, option) \
+ ((PGFDXTABLE)handle)->DxHSync( handle, option )
+
+/**
+ This function initializes the main LCD or sub-LCD display.
+ IMPORTANT NOTE: This function is now identical to the WithCS version
+ of it (i.e. it has Critical Sections and is multi-thread safe) as the
+ WithCS version is being phased out.
+
+ @param Handle (DxHandle) Handle to Dx Component.
+ @param lcdSel (int) 0 for LCD_MAIN.
+ 1 for LCD_SUB.
+ @param ulStartAddr (NvU32) display start address for main or sub-LCD (should be set to 0).
+ GFDxSetAttribute() should be called to set the display start
+ address for the main LCD or sub-LCD.
+ @param ulStride (NvU32) Default stride if 0; otherwise use the passed value.
+ GFDxSetAttribute() should be called to set the display stride
+ for the main LCD or sub-LCD.
+ @param bpp (unsigned) Default should be 16 bits/pixel for main LCD or sub-LCD.
+ GFDxSetAttribute() should be called to set the display bpp for
+ the main LCD or sub-LCD.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+ */
+#define GFDxSetDisplay( handle, lcdSel, ulStartAddr, ulStride, bpp ) \
+ ((PGFDXTABLE)handle)->Lcd[lcdSel].DxSetDisplay( handle, lcdSel, ulStartAddr, ulStride, bpp )
+
+/**
+ IMPORTANT NOTE: This function is being phased out. The critical
+ section functionality now exists in GFDxSetDisplay().
+ */
+#define GFDxSetDisplayWithCS( handle, lcdSel, ulStartAddr, ulStride, bpp ) \
+ ((PGFDXTABLE)handle)->DxSetDisplayWithCS( handle, lcdSel, ulStartAddr, \
+ ulStride, bpp )
+
+/**
+ This function initializes the main LCD or sub-LCD display.
+ IMPORTANT NOTE: This function extends GFDxSetDisplay() function by adding an option to enable/disable
+ the LCD display.
+
+ @param Handle (DxHandle) Handle to Dx Component.
+ @param lcdSel (int) 0 for LCD_MAIN.
+ 1 for LCD_SUB.
+ @param ulStartAddr (NvU32) display start address for main or sub-LCD (should be set to 0).
+ GFDxSetAttribute() should be called to set the display start
+ address for the main LCD or sub-LCD.
+ @param ulStride (NvU32) Default stride if 0; otherwise use the passed value.
+ GFDxSetAttribute() should be called to set the display stride
+ for the main LCD or sub-LCD.
+ @param bpp (unsigned) Default should be 16 bits/pixel for main LCD or sub-LCD.
+ GFDxSetAttribute() should be called to set the display bpp for
+ the main LCD or sub-LCD.
+ @param bOn (unsigned) 1 to Enable Display,
+ 0 to disable Display.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+ */
+#define GFDxSetDisplayEx( handle, lcdSel, ulStartAddr, ulStride, bpp, bOn ) \
+ ((PGFDXTABLE)handle)->Lcd[lcdSel].DxSetDisplayEx( handle, lcdSel, ulStartAddr, ulStride, bpp, bOn )
+
+/**
+ IMPORTANT NOTE: This function is being phased out. The critical
+ section functionality now exists in GFDxSetDisplayEx().
+ */
+#define GFDxSetDisplayExWithCS( handle, lcdSel, ulStartAddr, ulStride, bpp, bOn ) \
+ ((PGFDXTABLE)handle)->DxSetDisplayExWithCS( handle, lcdSel, ulStartAddr, \
+ ulStride, bpp, On)
+
+/**
+ This function enables/disables LCD display with proper power sequencing.
+ IMPORTANT NOTE: This function is now identical to the WithCS version
+ of it (i.e. it has Critical Sections and is multi-thread safe) as the
+ WithCS version is being phased out.
+
+ @param Handle (DxHandle) Handle to Dx Component.
+ @param lcdSel (int) 0 for LCD_MAIN.
+ 1 for LCD_SUB.
+ @param bOn (unsigned) Bit0: 1 to Enable Display,
+ 0 to disable Display.
+ Also Option for Panel Driver On/Off
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+ */
+#define GFDxEnableDisplay( handle, lcdSel, bOn ) \
+ ((PGFDXTABLE)handle)->Lcd[lcdSel].DxEnableDisplay( handle, lcdSel, bOn )
+
+/**
+ IMPORTANT NOTE: This function is being phased out. The critical
+ section functionality now exists in GFDxEnableDisplay().
+ */
+#define GFDxEnableDisplayWithCS( handle, lcdSel, bOn ) \
+ ((PGFDXTABLE)handle)->DxEnableDisplayWithCS( handle, lcdSel, bOn )
+
+/**
+ GFDxSetAttribute() sets the display attributes for a main panel or
+ subpanel. All the GFDxAPI attributes should be set after the
+ GFDxSetDisplay()
+ IMPORTANT NOTE: This function is now identical to the WithCS version
+ of it (i.e. it has Critical Sections and is multi-thread safe) as the
+ WithCS version is being phased out.
+
+ @param DxHandle (GFDxHandle) Handle to Dx Component.
+ @param lcdSel (int) 0 for LCD_MAIN.
+ 1 for LCD_SUB.
+ @param aid (unsigned) Attribute IDs. See #GFDXATTRIBUTES Enumeration Type
+ @param attr (NvU32) Attribute value for main LCD or sub-LCD. Should be
+ written with attribute ID in aid.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+ */
+#define GFDxSetAttribute( handle, lcdSel, aid, attr) \
+ ((PGFDXTABLE)handle)->Lcd[lcdSel].DxSetAttribute( handle, lcdSel, aid, attr )
+
+/**
+ Execute script command from DxApiTable. Send cmd/data to panel.
+ IMPORTANT NOTE: This function is now identical to the WithCS version
+ of it (i.e. it has Critical Sections and is multi-thread safe) as the
+ WithCS version is being phased out.
+
+ @param DxHandle (GFDxHandle) Handle to Dx Component.
+ @param lcdSel (int) 0 for LCD_MAIN.
+ 1 for LCD_SUB.
+ @param ScriptCmdType (PDXSCRIPTCMD) Script Command
+ @param Option (NvU32) Reserved, not used.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+ */
+#define GFDxScriptCmd( handle, lcdSel, pDxScriptCmd, Option) \
+ ((PGFDXTABLE)handle)->Lcd[lcdSel].DxScriptCmd( handle, lcdSel, pDxScriptCmd, Option )
+
+/**
+ IMPORTANT NOTE: This function is being phased out. The critical
+ section functionality now exists in GFDxScriptCmd().
+ */
+#define GFDxScriptCmdWithCS( handle, lcdSel, pDxScriptCmd, Option) \
+ ((PGFDXTABLE)handle)->Lcd[lcdSel].DxScriptCmdWithCS( handle, lcdSel, pDxScriptCmd, Option )
+
+/** Sets the timing registers.
+ IMPORTANT NOTE: This function is now identical to the WithCS version
+ of it (i.e. it has Critical Sections and is multi-thread safe) as the
+ WithCS version is being phased out.
+
+ @param DxHandle (GFDxHandle) Handle to Dx Component.
+ @param lcdSel (int) 0 for LCD_MAIN.
+ 1 for LCD_SUB.
+ @param pDxTiming (PDISPLAYTIMINGENTRY) See #PDISPLAYTIMINGENTRY.
+ @param Option (NvU32) GF_DISPLAY_PARTIAL or GF_DISPLAY_NORMAL.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+ */
+#define GFDxDisplayTiming( handle, lcdSel, pDxTiming, Option) \
+ ((PGFDXTABLE)handle)->Lcd[lcdSel].DxDisplayTiming( handle, lcdSel, pDxTiming, Option )
+
+/**
+ IMPORTANT NOTE: This function is being phased out. The critical
+ section functionality now exists in GFDxDisplayTiming().
+ */
+#define GFDxDisplayTimingWithCS( handle, lcdSel, pDxTiming, Option) \
+ ((PGFDXTABLE)handle)->Lcd[lcdSel].DxDisplayTimingWithCS( handle, lcdSel, pDxTiming, Option )
+
+/**
+ This function returns the bit depth, the destination stride, the start address,
+ the associated surface of the display buffer, or the graphics command
+ execution control. The location of the returned attribute value is pointed to by
+ attr.
+ IMPORTANT NOTE: This function is now identical to the WithCS version
+ of it (i.e. it has Critical Sections and is multi-thread safe) as the
+ WithCS version is being phased out.
+
+ @param DxHandle (GFDxHandle) Handle to Dx Component.
+ @param lcdSel (int) 0 for LCD_MAIN.
+ 1 for LCD_SUB.
+ @param aid (unsigned) Attribute ID. see #GFDXATTRIBUTES.
+ @param attr (NvU32 *) pointer to attribute value.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+ */
+#define GFDxGetAttribute( handle, lcdSel, aid, pAttr) \
+ ((PGFDXTABLE)handle)->Lcd[lcdSel].DxGetAttribute( handle, lcdSel, aid, pAttr )
+
+/**
+ IMPORTANT NOTE: This function is being phased out. The critical
+ section functionality now exists in GFDxSetAttribute().
+ */
+#define GFDxSetAttributeWithCS( handle, lcdSel, aid, attr) \
+ ((PGFDXTABLE)handle)->Lcd[lcdSel].DxSetAttributeWithCS( handle, lcdSel, aid, attr )
+
+/**
+ IMPORTANT NOTE: This function is being phased out. The critical
+ section functionality now exists in GFDxGetAttribute().
+ */
+#define GFDxGetAttributeWithCS( handle, lcdSel, aid, pAttr) \
+ ((PGFDXTABLE)handle)->Lcd[lcdSel].DxGetAttributeWithCS( handle, lcdSel, aid, pAttr )
+
+/**
+ IMPORTANT NOTE: this function is not available.
+ */
+#define GFDxRotate( handle, lcdSel, nRotate, ulStartAddr ) \
+ ((PGFDXTABLE)handle)->Lcd[lcdSel].DxRotate( handle, lcdSel, nRotate, ulStartAddr )
+
+/**
+ This function clears the main or subdisplay screen with the given color. It also
+ clears the display buffer of the main or subpanel window. Window A buffer 0
+ is used as a display buffer.
+ IMPORTANT NOTE: This function is now identical to the WithCS version
+ of it (i.e. it has Critical Sections and is multi-thread safe) as the
+ WithCS version is being phased out.
+
+ @param DxHandle (GFDxHandle) Handle to Dx Component.
+ @param lcdSel (int) 0 for LCD_MAIN.
+ 1 for LCD_SUB.
+ @param ulStartAddr (NvU32) Start Address. (The offset in bytes of the
+ display frame buffer.)
+ @param color (NvU32) Clear screen with this color. The 32-bit value
+ has a 16-bit color duplicated in the upper and
+ lower parts.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+ */
+#define GFDxErase( handle, lcdSel, ulStartAddr, color ) \
+ ((PGFDXTABLE)handle)->Lcd[lcdSel].DxErase( handle, lcdSel, ulStartAddr, color )
+
+/**
+ IMPORTANT NOTE: This function is being phased out. The critical
+ section functionality now exists in GFDxErase().
+ */
+#define GFDxEraseWithCS( handle, lcdSel, ulStartAddr, color ) \
+ ((PGFDXTABLE)handle)->DxEraseWithCS( handle, lcdSel, ulStartAddr, color )
+
+/**
+ This function enables swithcing between the main LCD and sub-LCD.
+ IMPORTANT NOTE: This function has critical sections and is thread-safe.
+
+ @param DxHandle (GFDxHandle) Handle to Dx Component.
+ @param lcdSel (int) 0 for LCD_MAIN.
+ 1 for LCD_SUB.
+ @param Option (NvU32) 0 for switch (Must be set to 0)
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+ */
+#define GFDxSwitchLCD( handle, lcdSel, Option ) \
+ ((PGFDXTABLE)handle)->Lcd[lcdSel].DxSwitchLCD( handle, lcdSel, Option )
+
+/**
+ This function sets the hardware Color Space Conversion (CSC) Coefficients.
+ IMPORTANT NOTE: This function is now identical to the WithCS version
+ of it (i.e. it has Critical Sections and is multi-thread safe) as the
+ WithCS version is being phased out.
+
+ @param DxHandle (GFDxHandle) Handle to Dx Component.
+ @param window (GFDXWINDOWSELECT) Controller window. see #GFDXWINDOWSELECT.
+ @param coef (GFDXCSCCOEF *) CSC coefficients. see #GFDXCSCCOEF.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+ */
+#define GFDxSetCSCCoeff( handle, window, coef ) \
+ ((PGFDXTABLE)handle)->DxSetCSCCoeff( handle, window, coef )
+
+/**
+ This function gets the hardware Color Space Conversion (CSC) Coefficients.
+ IMPORTANT NOTE: This function is now identical to the WithCS version
+ of it (i.e. it has Critical Sections and is multi-thread safe) as the
+ WithCS version is being phased out.
+
+ @param DxHandle (GFDxHandle) Handle to Dx Component.
+ @param window (GFDXWINDOWSELECT) Controller window. see #GFDXWINDOWSELECT.
+ @param coef (GFDXCSCCOEF *) CSC coefficients. see #GFDXCSCCOEF.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+ */
+#define GFDxGetCSCCoeff( handle, window, coef ) \
+ ((PGFDXTABLE)handle)->DxGetCSCCoeff( handle, window, coef )
+
+/**
+ IMPORTANT NOTE: This function is being phased out. The critical
+ section functionality now exists in GFDxSetCSCCoeff().
+ */
+#define GFDxSetCSCCoeffWithCS( handle, window, coef ) \
+ ((PGFDXTABLE)handle)->DxSetCSCCoeffWithCS( handle, window, coef )
+
+/**
+ IMPORTANT NOTE: This function is being phased out. The critical
+ section functionality now exists in GFDxGetCSCCoeff().
+ */
+#define GFDxGetCSCCoeffWithCS( handle, window, coef ) \
+ ((PGFDXTABLE)handle)->DxGetCSCCoeffWithCS( handle, window, coef )
+/*@}*/
+
+/** GFDxSetDefaultPanelMode - sets the default mode for multi-mode panels.
+
+ @param handle A handle to a Dx instance
+ @param mode The panel mode
+
+ Some panels support multiple modes. To support mode switching, the
+ default panel mode must be known.
+ */
+GF_RETTYPE
+GFDxSetDefaultPanelMode( GFDxHandle handle, NvU32 mode );
+
+/** GFDxSwitchPanelMode - switch from the current mode to a new mode.
+
+ @param handle A handle to a Dx instance
+ @param mode The panel mode
+
+ This switches from the current mode to a new mode. This calls a display
+ script with the name "SwitchMode__to_" where x is the current mode
+ and y is the new mode.
+ */
+GF_RETTYPE
+GFDxSwitchPanelMode( GFDxHandle handle, NvU32 mode );
+
+/** GFDxSPIRegEnable - enable register reads and writes over SPI.
+
+ @param handle A handle to a Dx instance
+ @param enable Either enable or disable register read/writes.
+
+ Enabling SPI register reads/writes may change the pin mapping which
+ may prevent the rest of the display api from behaving properly (pixel
+ data may no longer output to the panel). Disabling will restore
+ the pin mapping.
+ */
+void
+GFDxSpiRegEnable( GFDxHandle handle, NvBool enable );
+
+/** GFDxSPIRegWrite - write a 16 bit register over SPI.
+
+ @param handle A handle to a Dx instance
+ @param address The address to write
+ @param data The data to write
+ */
+GF_RETTYPE
+GFDxSpiRegWrite( GFDxHandle handle, NvU16 address, NvU16 data );
+
+/** GFDxSPIRegRead - read a 16 bit register over SPI.
+
+ @param handle A handle to a Dx instance
+ @param address The address to read from
+ @param data The data to read (out param)
+ */
+GF_RETTYPE
+GFDxSpiRegRead( GFDxHandle handle, NvU16 address, NvU16 *data );
+
+/** GFDxSpiPixelInit - send init sequence to the panel and setup the pixel
+ write hardware.
+
+ @param handle A handle to a Dx instance
+ @param seq_data_a The first 32 bits of init data
+ @param seq_data_b The second 32 bits of init data
+ @param seq_data_c The third 32 bits of init data
+ @param seq_data_d The fourth 32 bits of init data
+
+ Note that this only support SPI16 mode, msb2lsb data ordering.
+
+ Some panels may need the init sequence before every frame, in which
+ case, this should always be called before GFDxSpiPixelWrite().
+ */
+GF_RETTYPE
+GFDxSpiPixelInit( GFDxHandle handle, NvU32 seq_data_a,
+ NvU32 seq_data_b, NvU32 seq_data_c, NvU32 seq_data_d );
+
+/** GFDxSpiPixelWrite - writes the given pixel to the panel over SPI.
+
+ @param handle A handle to a Dx instance
+ @param pixel The pixels to write
+ */
+GF_RETTYPE
+GFDxSpiPixelWrite( GFDxHandle handle, NvUPtr pixels );
+
+/** GFDxSpiScript - send commands to the spi hardware via an in-memory script.
+
+ @param handle A handle to a Dx instance
+ @param script The script to execute
+ */
+GF_RETTYPE
+GFDxSpiScript( GFDxHandle handle, NvU32 *script );
+
+/** GFDxSetPixelClock - sets the pixel clock divider in half step increments.
+
+ @param handle A handle to the Dx instance
+ @param divider The pixel clock divider (actually shift clock - pixel clock
+ will be the same as shift clock)
+
+ Note: the divider is in half step increments: 1 = 1, 2 = 1.5, 3 = 2, etc.
+ */
+GF_RETTYPE
+GFDxSetPixelClock( GFDxHandle handle, NvU32 divider );
+
+/** GFDxGetPixelClock - gets the current shift clock divider value.
+
+ @param handle A handle to the Dx instance
+ @param divider The pixel clock divider (actually shift clock - pixel clock
+ will be the same as shift clock)
+
+ */
+GF_RETTYPE
+GFDxGetPixelClock( GFDxHandle handle, NvU32 *divider );
+
+/** GFDxSetFilter - sets the window filtering coefficients.
+
+ @param handle A handle to the Dx instance
+ @param window The target window for the new coefficients
+ @param hfilter The horizontal filtering coefficients
+ @param vfilter The vertical filtering coefficients
+
+ Window A does NOT support filtering.
+ Window C only supports horizontal filtering (the vfilter param must be
+ null)
+ Window B supports both h and v filtering
+
+ Passing null to both h and v filter will disabling filtering.
+
+ DX_WINDOW_SELECT_NONE and DX_WINDOW_SELECT_NORMAL should not be used.
+ */
+GF_RETTYPE
+GFDxSetFilter( GFDxHandle handle, GFDXWINDOWSELECT window,
+ GFDxHorizontalFilter *hfilter, GFDxVerticalFilter *vfilter );
+
+#ifdef PROJECT_SEC_G1
+/** GFDxSetFilter - sets the clock and timing to support focus TV encoder.
+
+ @param handle A handle to the Dx instance
+ @param option The Normal/NTSC/PAL mode to set
+ */
+GF_RETTYPE
+GFDxSetMode( GFDxHandle handle, NvU32 option );
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+/** @page pageDxAppNotes DxAPI Application Notes
+
+ @section pageDxAppNotes1 Todo
+
+*/
+
+#endif /* GF_DX_H */
diff --git a/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFEPP.h b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFEPP.h
new file mode 100755
index 00000000..36d28219
--- /dev/null
+++ b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFEPP.h
@@ -0,0 +1,89 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/** @file GFEPP.h
+ GFSDK EPP API
+*/
+
+#ifndef __GFEPP_H__
+#define __GFEPP_H__
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+/** @addtogroup groupEPP EPPAPI EPP API
+*/
+/*@{*/
+
+typedef struct _GFEPPBUFFERINFO
+{
+ NvU32 flag;
+ PGFRECT pSrcRect;
+ void *pLine;
+ NvU32 alphaValue;
+ NvU32 numofSurfs;
+ PGFRMSURFACE *ppSurf;
+} GFEPPBUFFERINFO, *PEPPBUFFERINFO;
+
+
+// Typesafe functions for opening and closing this component
+GF_RETTYPE GFEPPOpen(GFRmHandle hRm, GFEPPHandle *phEPP,
+ GF_STATE_TYPE state, GFRmChHandle hCh);
+void GFEPPClose(GFEPPHandle *phEPP);
+
+GF_RETTYPE GFEPPSetBuffers(GFEPPHandle EPPHandle, PEPPBUFFERINFO pBuf);
+GF_RETTYPE GFEPPRaiseBuffer(GFEPPHandle EPPHandle, NvU32, NvU32* pCmdS, NvU32* pIndex);
+GF_RETTYPE GFEPPRaiseFrame(GFEPPHandle EPPHandle, NvU32, NvU32* pCmdS, NvU32* pIndex);
+
+
+#define EPPBUFFERINFO_FLAG_SRC_VI 0x00000001
+ //incoming video from VI
+#define EPPBUFFERINFO_FLAG_SRC_SB 0x00000002
+ //incoming video from SB
+#define EPPBUFFERINFO_FLAG_SRC_GC 0x00000003
+ //incoming video from display
+#define EPPBUFFERINFO_FLAG_SRC_MASK 0x0000000F
+
+#define EPPBUFFERINFO_FLAG_SRC_VI_YUV444 0x00000010
+ //incoming video from VI
+#define EPPBUFFERINFO_FLAG_SRC_VI_BAYER 0x00000020
+ //incoming video from VI, Raw Bayer data
+#define EPPBUFFERINFO_FLAG_SRC_VI_RGB 0x00000030
+ //incoming video from VI, Raw RGB data
+#define EPPBUFFERINFO_FLAG_SRC_VI_MASK 0x000000F0
+
+#define EPPBUFFERINFO_FLAG_PRE_PROC 0x00000100
+ //pre process filter enable
+#define EPPBUFFERINFO_FLAG_AVERAGE 0x00000200
+ //enable average for 420 planar or 444 to 422 conversion.
+#define EPPBUFFERINFO_FLAG_C_SIGN 0x00000400
+ //chroma sign
+#define EPPBUFFERINFO_FLAG_DMA 0x00000800
+ //enable DMA
+#define EPPBUFFERINFO_FLAG_DUP 0x00001000
+ //duplicate
+#define EPPBUFFERINFO_FLAG_H_DIRECTION 0x00002000
+#define EPPBUFFERINFO_FLAG_V_DIRECTION 0x00004000
+#define EPPBUFFERINFO_FLAG_XY_SWAP 0x00008000
+
+#define EPPBUFFERINFO_FLAG_SRC_SB_YUV 0x00010000
+#define EPPBUFFERINFO_FLAG_SRC_SB_RGB 0x00020000
+#define EPPBUFFERINFO_FLAG_SRC_SB_MASK 0x000F0000
+
+ //BE CAREFUL WITH THE STRIDE PROGRAMMING!
+
+/*@}*/
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // _GFEPP_H_
diff --git a/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFFDev.h b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFFDev.h
new file mode 100755
index 00000000..6826085b
--- /dev/null
+++ b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFFDev.h
@@ -0,0 +1,321 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/** @file GFFDev.h
+ GFSDK File Device API header file.
+*/
+
+#ifndef __GFFDEV_H__
+#define __GFFDEV_H__
+
+#include "nvtypes.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+/** @addtogroup groupFDev FDevAPI File Device API
+
+ @ref pageFDevAppNotes
+
+ @ref pageFDevAppNotes1
+
+
+*/
+/*@{*/
+
+/** FDev capability flag.
+ @see GFFDevMount()
+ */
+#define GFFDEV_CAP_STANDARD 0x00010000 /**< Standard C Library */
+
+/** FDev capability flag.
+ @see GFFDevMount()
+ */
+#define GFFDEV_CAP_DEVICE_SD 0x00000001 /**< SD Device Supported */
+
+/** FDev capability flag.
+ @see GFFDevMount()
+ */
+#define GFFDEV_CAP_FAT 0x00020000 /**< Fat FileSystem */
+
+/** FDev capability flag.
+ @see GFFDevMount()
+ */
+#define GFFDEV_CAP_DEVICE_MASK 0x00000FFF
+
+/** FDev capability flag - default on the selected OS.
+ Linux, Windows -> Standard, else -> SD
+ @see GFFDevMount()
+ */
+#if !NVOS_IS_WINDOWS && !NVOS_IS_LINUX
+#define GFFDEV_CAP_DEFAULT_FOR_OS GFFDEV_CAP_DEVICE_SD
+#else
+#define GFFDEV_CAP_DEFAULT_FOR_OS GFFDEV_CAP_STANDARD
+#endif
+
+/** Parameter enum for GFFDevSeekFile.
+ @see GFFDevSeekFile
+ */
+typedef enum
+{
+ GFFDEV_SEEK_SET = 0, /**< Set fileHandle relative to beginning of file */
+ GFFDEV_SEEK_CUR, /**< Set fileHandle relative to specified offset location */
+ GFFDEV_SEEK_END /**< Set fileHandle relative to end of file */
+} GFFDEVSEEKTYPE;
+
+/** Public File Info structure.
+ Matches Microsoft's struct _finddata_t .
+
+ @see FDevFindFirstFile()
+ @see FDevFindNextFile()
+ */
+typedef struct _GFFDEVFILEINFO
+{
+ unsigned attrib;
+ NvU32 time_create; /**< -1 for FAT file systems */
+ NvU32 time_access; /**< -1 for FAT file systems */
+ NvU32 time_write;
+ NvU32 size;
+ char name[260];
+} GFFDEVFILEINFO, *PGFFDEVFILEINFO;
+
+// Typesafe functions for opening and closing this component
+GF_RETTYPE GFFDevOpen(GFRmHandle hRm, GFFDevHandle *phFDev,
+ GF_STATE_TYPE state, GFRmChHandle hCh);
+void GFFDevClose(GFFDevHandle *phFDev);
+
+/** @name Functions
+@{*/
+
+/** Mounts a filesystem.
+ @param FDevHandle (#GFFDevHandle) Handle to FDev API
+ @param capType (NvU32) capability type
+
+ The filesystem pointed to by #FDevHandle will be mounted based on
+ the #capType.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Error
+ */
+GF_RETTYPE GFFDevMount(GFFDevHandle FDevHandle, NvU32 capType);
+
+/** Unmounts a mounted filesystem.
+ @param FDevHandle (#GFFDevHandle) Handle to FDev API
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Error
+*/
+GF_RETTYPE GFFDevUnmount(GFFDevHandle FDevHandle);
+
+/** Opens a file.
+ @param FDevHandle (#GFFDevHandle) Handle to FDev API
+ @param fileName (const char *) name of the file
+ @param fileSpec (const char *) read/write/etc flags
+ @param pFileHandle (#GFFDevFileHandle) Pointer to the handle of the opened file -
+ will be filled in by #GFFDevOpenFile()
+
+ Opens a file on the mounted filesystem with #fileName. Open flags,
+ given by #fileSpec, are the same as libc's fopen.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Error
+ */
+GF_RETTYPE GFFDevOpenFile(GFFDevHandle FDevhandle,
+ const char *fileName,
+ const char *fileSpec,
+ GFFDevFileHandle *pFileHandle);
+
+/** Closes an open file.
+ @param FDevHandle (#GFFDevHandle) Handle to FDev API
+ @param pFileHandle (#GFFDevFileHandle *) Pointer to the open file
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Error
+ */
+GF_RETTYPE GFFDevCloseFile(GFFDevHandle FDevhandle,
+ GFFDevFileHandle *pFileHandle);
+
+/** Reads data from a file.
+ @param FDevHandle (#GFFDevHandle) Handle to FDev API
+ @param fileHandle (#GFFDevFileHandle) Handle to the open file
+ @param pReadBuf (void *) Buffer for file bytes
+ @param pCount (NvU32 *) Pointer to number of bytes to read, will be
+ written to the actual number of bytes read.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Error
+ */
+GF_RETTYPE GFFDevReadFile(GFFDevHandle FDevhandle,
+ GFFDevFileHandle fileHandle,
+ void * pReadBuf,
+ NvU32 *pCount);
+
+/** Writes data to an open file.
+ @param FDevHandle (#GFFDevHandle) Handle to FDev API
+ @param fileHandle (#GFFDevFileHandle) Handle to open file
+ @param pWriteBuf (void *) pointer to bytes to write to the file
+ @param pCount (NvU32 *) pointer to number of bytes to write, will
+ be written to actual number of bytes written.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Error
+ */
+GF_RETTYPE GFFDevWriteFile(GFFDevHandle FDevHandle,
+ GFFDevFileHandle fileHandle,
+ void * pWriteBuf,
+ NvU32 *pCount );
+
+/** Sets the file read/write position.
+ @param FDevHandle (#GFFDevHandle) Handle to FDev API
+ @param fileHandle (#GFFDevFileHandle) Handle to open file
+ @param offset (NvS32) offset to be used with #where
+ @param where (#GFFDEVSEEKTYPE) file offset base
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Error
+ */
+GF_RETTYPE GFFDevSeekFile(GFFDevHandle FDevHandle,
+ GFFDevFileHandle fileHandle,
+ NvS32 offset,
+ GFFDEVSEEKTYPE where);
+
+/** Gets the current file position.
+ @param FDevHandle (#GFFDevHandle) Handle to FDev API
+ @param fileHandle (#GFFDevFileHandle) Handle to open file
+ @param pOffset (NvU32 *) pointer to offset, will be filled in
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Error
+ */
+GF_RETTYPE GFFDevTellFile(GFFDevHandle FDevHandle,
+ GFFDevFileHandle fileHandle,
+ NvU32 *pOffset);
+
+/** Gets the file size.
+ @param FDevHandle (#GFFDevHandle) Handle to FDev API
+ @param fileName (#GFFDevFileHandle) Handle of open file
+ @param pSize (NvU32 *) pointer to file size, will be filled in.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Error
+ */
+GF_RETTYPE GFFDevGetFileSize(GFFDevHandle FDevHandle,
+ const char *fileName,
+ NvU32 *pSize);
+
+/** Renames a file.
+ @param FDevHandle (#GFFDevHandle) Handle to FDev API
+ @param oldFileName (const char *) name of existing file
+ @param newFileName (const char *) name to which to rename the file
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Error
+ */
+GF_RETTYPE GFFDevRenameFile(GFFDevHandle FDevHandle,
+ const char *oldFileName,
+ const char *newFileName);
+
+/** Removes a file from the filesystem
+ @param FDevHandle (#GFFDevHandle) Handle to FDev API
+ @param fileName (#GFFDevFileHandle) Handle of open file
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Error
+ */
+GF_RETTYPE GFFDevDeleteFile(GFFDevHandle FDevHandle,
+ const char *fileName);
+
+/** Gets the first file in a directory.
+ @param FDevHandle (#GFFDevHandle) Handle to FDev API
+ @param dirName (const char *) Name of the directory to enumerate
+ @param pFileInfo (#GFFDEVFILEINFO *) pointer to the file info for the
+ first file
+ @param pDirHandle (#GFFDevDirHandle *) pointer to the handle to the directory
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Error
+ */
+GF_RETTYPE GFFDevFindFirstFile(GFFDevHandle FDevHandle,
+ const char *dirName,
+ GFFDEVFILEINFO *pFileInfo,
+ GFFDevDirHandle *pDirHandle);
+
+/** Gets the next file in the directory.
+ @param FDevHandle (#GFFDevHandle) Handle to FDev API
+ @param pFileInfo (#GFFDEVFILEINFO *) pointer ot the info for the next file
+ @param pDirHandle (#GFFDevDirHandle *) pointer to the directory handle
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Error
+ */
+GF_RETTYPE GFFDevFindNextFile(GFFDevHandle FDevHandle,
+ GFFDEVFILEINFO *pFileInfo,
+ GFFDevDirHandle *pDirHandle);
+
+/** Closes the directory.
+ @param FDevHandle (#GFFDevHandle) Handle to FDev API
+ @param pDirHandle (#GFFDevDirHandle *) pointer to the directory handle
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Error
+ */
+GF_RETTYPE GFFDevFindCloseFile(GFFDevHandle FDevHandle,
+ GFFDevDirHandle *pdirHandle);
+
+/** Flushes all buffered data to the file.
+ @param FDevHandle (#GFFDevHandle) Handle to FDev API
+ @param fileName (#GFFDevFileHandle) Handle of open file
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Error
+ */
+GF_RETTYPE GFFDevFlushFile(GFFDevHandle FDevHandle,
+ GFFDevFileHandle fileHandle);
+
+/** Gets the filesystem blocks for the file.
+ @param FDevHandle (#GFFDevHandle) Handle to FDev API
+ @param fileName (#GFFDevFileHandle) Handle of open file
+ @param size (NvU32) size of the file
+ @param ppBlockList (#PGFBLOCKLIST *) block list to be allocated
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Error
+ */
+GF_RETTYPE GFFDevBlockListAlloc(GFFDevHandle FDevHandle,
+ GFFDevFileHandle fileHandle,
+ NvU32 size,
+ PGFBLOCKLIST *ppBlockList );
+
+/** Gets the FDev API properties
+ @param FDevHandle (#GFFDevHandle) Handle to FDev API
+ @param pBlockList (#PGFBLOCKLIST) Block list to deallocate
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Error
+ */
+GF_RETTYPE GFFDevBlockListFree(GFFDevHandle FDevHandle,
+ PGFBLOCKLIST pBlockList );
+
+/*@}*/
+/*@}*/
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+/** @page pageFDevAppNotes FDevAPI Application Notes
+
+ @section pageFDevAppNotes1 Todo
+
+*/
+
+#endif /* __GFFDEV_H__ */
+
diff --git a/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFGx.h b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFGx.h
new file mode 100755
index 00000000..5a974df4
--- /dev/null
+++ b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFGx.h
@@ -0,0 +1,1927 @@
+/*
+ * Copyright (c) 2005 - 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software and related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an express
+ * license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+/** @file GFGx.h
+ GFSDK Graphics API header file.
+*/
+
+#ifndef __GFGx_H__
+#define __GFGx_H__
+
+#include "GFRm.h"
+
+/* GFGxAPI error codes */
+#include "GFGxError.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+
+/** @addtogroup groupGx GxAPI Graphics API
+*/
+ /*
+ @ref pageGxAppNotes
+
+
+ */
+
+/*@{*/
+
+/**** GX CAPABILITIES DEFINITIONS ****/
+
+/** GFGxAPI capability definition : bitblt support.
+ @see GFGxGetProperty()
+*/
+#define GFGX_CAP_BLT 0x00000001UL // BitBlt
+/** GFGxAPI capability definition : linedraw support.
+ @see GFGxGetProperty()
+*/
+#define GFGX_CAP_LINE 0x00000002UL // Line draw
+/** GFGxAPI capability definition : clipping support.
+ @see GFGxGetProperty()
+*/
+#define GFGX_CAP_CLIP 0x00000004UL // Clipping
+/** GFGxAPI capability definition : stretchblt support.
+ @see GFGxGetProperty()
+*/
+#define GFGX_CAP_STRETCHBLT 0x00000008UL // StretchBlt
+/** GFGxAPI capability definition : alphablending support.
+ @see GFGxGetProperty()
+*/
+#define GFGX_CAP_ALPHABLENDING 0x00000010UL // Alpha blending
+/** GFGxAPI capability definition : alphablending and transparency support.
+ @see GFGxGetProperty()
+*/
+#define GFGX_CAP_ALPHA_COLOR_CMP 0x00000020UL // Alpha blending
+
+/* NEW CAPABILITY FLAGS */
+
+/** GFGxAPI capability definition : fast rotation support.
+ @see GFGxGetProperty()
+*/
+#define GFGX_CAP_FAST_ROTATION 0x00000040UL // Fast Rotation
+
+/** GFGxAPI capability definition : inside clipping support.
+ @see GFGxGetProperty()
+*/
+#define GFGX_CAP_CLIPPING_INSIDE 0x00000100UL // Inside Clipping
+/** GFGxAPI capability definition : fadeblt support.
+ @see GFGxGetProperty()
+*/
+#define GFGX_CAP_FADE_BLT 0x00000200UL // Fade Blt
+
+/** GFGxAPI capability definition : color pattern support.
+ @see GFGxGetProperty()
+*/
+#define GFGX_CAP_COLOR_PATTERN 0x00001000UL // Color Pattern
+/** GFGxAPI capability definition : color pattern transparency support.
+ @see GFGxGetProperty()
+*/
+#define GFGX_CAP_CLR_PAT_TRANSPARENT 0x00002000UL // Color Pattern Transparency
+/** GFGxAPI capability definition : alphablending and fading support.
+ @see GFGxGetProperty()
+*/
+#define GFGX_CAP_ALPHA_AND_FADING 0x00004000UL // ALpha Blending & fading
+/** GFGxAPI capability definition : 1BPP alpha plane support.
+ @see GFGxGetProperty()
+*/
+#define GFGX_CAP_ALPHA_PLANAR_1BPP 0x00008000UL // Planar 1 BPP Alpha
+/** GFGxAPI capability definition : 2BPP alpha plane support.
+ @see GFGxGetProperty()
+*/
+#define GFGX_CAP_ALPHA_PLANAR_2BPP 0x00010000UL // Planar 2 BPP Alpha
+/** GFGxAPI capability definition : 4BPP alpha plane support.
+ @see GFGxGetProperty()
+*/
+#define GFGX_CAP_ALPHA_PLANAR_4BPP 0x00020000UL // Planar 4 BPP Alpha
+/** GFGxAPI capability definition : 8BPP alpha plane support.
+ @see GFGxGetProperty()
+*/
+#define GFGX_CAP_ALPHA_PLANAR_8BPP 0x00040000UL // Planar 8 BPP Alpha
+/** GFGxAPI capability definition : SRC4DST4BPP alpha plane support.
+ @see GFGxGetProperty()
+*/
+#define GFGX_CAP_ALPHA_PLANAR_SRC4DST4 0x00080000UL // Planar 44 BPP Alpha
+ // 8 bpp plane, src * 4 + dst*4
+/** GFGxAPI capability definition : 32BPP to 16BPP alphablending support.
+ @see GFGxGetProperty()
+*/
+#define GFGX_CAP_ALPHA_PLANAR_32BLEND16 0x00200000UL // 32 bits source blending
+/** GFGxAPI capability definition : src 1555 alphablending support.
+ @see GFGxGetProperty()
+*/
+#define GFGX_CAP_ALPHA_SRC1555 0x00400000UL // Src alpha 1555
+/** GFGxAPI capability definition : src 4444 alphablending support.
+ @see GFGxGetProperty()
+*/
+#define GFGX_CAP_ALPHA_SRC4444 0x00800000UL // Src alpha 4444
+/** GFGxAPI capability definition : src fixed alphablending support.
+ @see GFGxGetProperty()
+*/
+#define GFGX_CAP_ALPHA_FIXED 0x01000000UL // Fixed alpha
+
+/**** CLIPPING FLAGS ****/
+
+/* disable clipping */
+/** GFGxAPI CLIPPING flags : disable clipping.
+ @see GFGxSetClip()
+*/
+#define GFGX_SETCLIP_DISABLE 0x00000000UL
+
+/* enable clipping */
+/** GFGxAPI CLIPPING flags : enable clipping.
+ @see GFGxSetClip()
+*/
+#define GFGX_SETCLIP_ENABLE 0x00000001UL
+
+/* set clipping rectangle */
+/** GFGxAPI CLIPPING flags : set clipping rectangle.
+ @see GFGxSetClip()
+*/
+#define GFGX_SETCLIP_SETRECT 0x00000002UL
+
+/* set inside clipping - default is outside clipping*/
+/** GFGxAPI CLIPPING flags : set inside clipping, default is outside.
+ @see GFGxSetClip()
+*/
+#define GFGX_SETCLIP_INSIDE 0x00000004UL
+
+
+/**** LINE DRAW FLAGS ****/
+
+/* don't draw last pixel */
+/** GFGxAPI LINE DRAW flags : do not draw last pixel.
+ @see GFGxLine()
+*/
+#define GFGX_LINE_NOT_DRAW_LAST_PIXEL 0x00000001UL
+
+/**** BITBLT - SOURCE FLAGS ****/
+
+/* source is screen */
+/** GFGxAPI BITBLT Source flags : source comes from video mem.
+ @see GFGxBlt()
+*/
+#define GFGX_BLT_SRC_VIDEO 0x00000000UL
+
+/* color source in system memory */
+/** GFGxAPI BITBLT Source flags : colour source comes from system mem.
+ @see GFGxBlt()
+*/
+#define GFGX_BLT_SRC_SYSMEM_COLOR 0x00000001UL
+
+/* mono source in system memory */
+/** GFGxAPI BITBLT Source flags : mono source comes from system mem.
+ @see GFGxBlt()
+*/
+#define GFGX_BLT_SRC_SYSMEM_MONO 0x00000002UL
+
+/* source is solid color */
+/** GFGxAPI BITBLT Source flags : source is solid (unique color).
+ @see GFGxBlt()
+*/
+#define GFGX_BLT_SRC_SOLID 0x00000004UL
+
+
+/**** BITBLT - PATTERN FLAGS ****/
+
+/* pattern is mono */
+/** GFGxAPI BITBLT Pattern flags : pattern is mono.
+ @see GFGxBlt()
+*/
+#define GFGX_BLT_PAT_MONO 0x00000008UL
+
+/* pattern is color */
+/** GFGxAPI BITBLT Pattern flags : pattern is color.
+ @see GFGxBlt()
+*/
+#define GFGX_BLT_PAT_COLOR 0x00000010UL
+
+/* pattern is solid color */
+/** GFGxAPI BITBLT Pattern flags : pattern is solid (unique color).
+ @see GFGxBlt()
+*/
+#define GFGX_BLT_PAT_SOLID 0x00000020UL
+
+/* pattern is cached */
+/** GFGxAPI BITBLT Pattern flags : pattern is cached in video mem.
+ The pattern ID for the cached pattern is returned in the pPatID
+ field in GFGXBLTPARAM sruct. User needs to make sure that a valid
+ pointer is passed in pPatID.
+ @see GFGxBlt()
+*/
+#define GFGX_BLT_PAT_CACHE 0x00000040UL
+
+
+/**** BITBLT - MODE FLAGS ****/
+/**** Linear / XY Mode / Surface Flag ****/
+
+/* XY Mode Blt */
+/** GFGxAPI BITBLT Mode flags : X/Y mode is used.
+ @see GFGxBlt()
+*/
+#define GFGX_BLT_MODE_XY 0x00000000UL
+
+/* Linear Mode Blt */
+/** GFGxAPI BITBLT Mode flags : linear mode is used.
+ @see GFGxBlt()
+*/
+#define GFGX_BLT_MODE_LINEAR 0x00000080UL
+
+/* Surface to Surface blt */
+/** GFGxAPI BITBLT Mode flags : surface to surface mode is used.
+ @see GFGxBlt()
+*/
+#define GFGX_BLT_SURFACE 0x00000100UL
+
+
+/**** BITBLT - CLIPPING FLAGS ****/
+
+/* enable clipping */
+/** GFGxAPI BITBLT Clipping flags : enable clipping.
+ @see GFGxBlt()
+*/
+#define GFGX_BLT_CLIP 0x00000200UL
+
+/**** BITBLT - SOURCE TRANSPARENCY FLAGS ****/
+
+/* color source transparent blt (if source pixel matches colorCompare,
+do not overwrite) */
+/** GFGxAPI BITBLT Source Transparency flags : enable color source transparency
+ (if source pixel matches colorCompare, do not overwrite).
+ @see GFGxBlt()
+*/
+#define GFGX_BLT_TRANSPARENT_SRC_COLOR 0x00000400UL
+
+/* color source inverse transparent blt (if source pixel matches
+colorCompare, overwrite) */
+/** GFGxAPI BITBLT Source Transparency flags : enable color source inverse
+ transparency (if source pixel matches colorCompare, overwrite).
+ @see GFGxBlt()
+*/
+#define GFGX_BLT_TRANSPARENT_SRC_COLOR_INV 0x08000000UL
+
+
+/* mono source transparent blt (if source bit is 0, no
+overwrite on corresponding destination location) */
+/** GFGxAPI BITBLT Source Transparency flags : enable mono source transparency
+ (if source bit is 0, no overwrite on corresponding destination location).
+ @see GFGxBlt()
+*/
+#define GFGX_BLT_TRANSPARENT_SRC_MONO 0x00000800UL
+
+/* mono source inverted transparent blt (if source bit
+is 1, no overwrite on corresponding destination location) */
+/** GFGxAPI BITBLT Source Transparency flags : enable mono source inverse
+ transparency (if source bit is 1, no overwrite on corresponding destination
+ location).
+ @see GFGxBlt()
+*/
+#define GFGX_BLT_TRANSPARENT_SRC_MONO_INV 0x00001000UL
+
+
+/**** BITBLT - DESTINATION TRANSPARENCY FLAGS ****/
+
+/* destination transparent blt (if destination pixel matches colorCompare,
+overwrite) */
+/** GFGxAPI BITBLT Destination Transparency flags : enable destination
+ transparency (if destination pixel matches colorCompare, overwrite).
+ @see GFGxBlt()
+*/
+#define GFGX_BLT_TRANSPARENT_DST 0x00002000UL
+
+/* destination transparent inverse blt (if destination pixel matches
+colorCompare, donot overwrite) */
+/** GFGxAPI BITBLT Destination Transparency flags : enable destination inverse
+ transparency (if destination pixel matches colorCompare, do not overwrite).
+ @see GFGxBlt()
+*/
+#define GFGX_BLT_TRANSPARENT_DST_INV 0x10000000UL
+
+/**** BITBLT - PATTERN TRANSPARENCY FLAGS ****/
+
+/* Mono pattern transparent Blt */
+/** GFGxAPI BITBLT Pattern Transparency flags : enable mono pattern transparency
+ (if pattern bit is 0, no overwrite on corresponding destination location).
+ @see GFGxBlt()
+*/
+#define GFGX_BLT_TRANSPARENT_PAT_MONO 0x00004000UL
+
+/* Mono pattern inverted transparent Blt */
+/** GFGxAPI BITBLT Pattern Transparency flags : enable mono pattern inverse
+ transparency (if pattern bit is 1, no overwrite on corresponding destination
+ location).
+ @see GFGxBlt()
+*/
+#define GFGX_BLT_TRANSPARENT_PAT_MONO_INV 0x00008000UL
+
+/* Color pattern transparency Blt */
+/** GFGxAPI BITBLT Pattern Transparency flags : enable color pattern transparency
+ (if pattern pixel matches colorCompare, do not overwrite).
+ @see GFGxBlt()
+*/
+#define GFGX_BLT_TRANSPARENT_PAT_COLOR 0x00010000UL
+
+/* Color pattern transparency Blt */
+/** GFGxAPI BITBLT Pattern Transparency flags : enable color pattern inverse
+ transparency (if pattern pixel matches colorCompare, overwrite).
+ @see GFGxBlt()
+*/
+#define GFGX_BLT_TRANSPARENT_PAT_COLOR_INV 0x20000000UL
+
+/**** Fade Blt ****/
+/** GFGxAPI BITBLT flags : enable fade blt.
+ @see GFGxBlt()
+*/
+#define GFGX_BLT_FADE_BLT 0x00020000UL
+
+/* Enable alpha blending */
+/** GFGxAPI BITBLT flags : enable alphablending.
+ @see GFGxBlt()
+*/
+#define GFGX_BLT_ALPHA_BLENDING 0x00080000UL
+
+
+
+/**** ALPHABLENDING FLAGS ****/
+
+/* Fixed alpha operation */
+/** GFGxAPI BITBLT Alphablending flags : alpha mode is fixed value.
+ @see GFGxBlt()
+*/
+#define GFGX_BLT_ALPHA_FIXED ( 0x00200000UL)
+
+/* Inverse Fixed alpha */
+/** GFGxAPI BITBLT Alphablending flags : alpha mode is inverse fixed value.
+ @see GFGxBlt()
+*/
+#define GFGX_BLT_ALPHA_FIXED_INV (0x00400000UL)
+
+/* Source alpha ARGB1555 */
+/** GFGxAPI BITBLT Alphablending flags : alpha mode is source ARGB1555.
+ @see GFGxBlt()
+*/
+#define GFGX_BLT_ALPHA_SRC_1555_T (0x00800000UL)
+
+/* Inverse Source alpha ARGB1555 */
+/** GFGxAPI BITBLT Alphablending flags : alpha mode is inverse source ARGB1555.
+ @see GFGxBlt()
+*/
+#define GFGX_BLT_ALPHA_SRC_1555_T_INV (0x01000000UL)
+
+/* Source alpha ARGB4444 */
+/** GFGxAPI BITBLT Alphablending flags : alpha mode is source ARGB4444.
+ @see GFGxBlt()
+*/
+#define GFGX_BLT_ALPHA_SRC_4444 (0x02000000UL)
+
+/* Inverse Source ARGB4444 */
+/** GFGxAPI BITBLT Alphablending flags : alpha mode is inverse source ARGB4444.
+ @see GFGxBlt()
+*/
+#define GFGX_BLT_ALPHA_SRC_4444_INV (0x04000000UL)
+
+/* new flags */
+
+/** GFGxAPI BITBLT Alphablending mask.
+ @see GFGxBlt()
+*/
+#define GFGXEX1_MASK 0x3FFFFFFF
+
+/* Fixed alpha operation */
+/** GFGxAPI BITBLT Alphablending flags : alpha mode is fixed value.
+ @see GFGxBlt()
+*/
+#define GFGXEX1_BLT_ALPHA_FIXED (0x40000000 | 0x00000001UL)
+
+/* Inverse Fixed alpha */
+/** GFGxAPI BITBLT Alphablending flags : alpha mode is inverse fixed value.
+ @see GFGxBlt()
+*/
+#define GFGXEX1_BLT_ALPHA_FIXED_INV (0x40000000 | 0x00000002UL)
+
+/* Source alpha ARGB1555 */
+/** GFGxAPI BITBLT Alphablending flags : alpha mode is source ARGB1555.
+ @see GFGxBlt()
+*/
+#define GFGXEX1_BLT_ALPHA_SRC_1555_T (0x40000000 | 0x00000004UL)
+
+/* Inverse Source alpha ARGB1555 */
+/** GFGxAPI BITBLT Alphablending flags : alpha mode is inverse source ARGB1555.
+ @see GFGxBlt()
+*/
+#define GFGXEX1_BLT_ALPHA_SRC_1555_T_INV (0x40000000 | 0x00000008UL)
+
+/* Source alpha ARGB4444 */
+/** GFGxAPI BITBLT Alphablending flags : alpha mode is source ARGB4444.
+ @see GFGxBlt()
+*/
+#define GFGXEX1_BLT_ALPHA_SRC_4444 (0x40000000 | 0x00000010UL)
+
+/* Inverse Source ARGB4444 */
+/** GFGxAPI BITBLT Alphablending flags : alpha mode is inverse source ARGB4444.
+ @see GFGxBlt()
+*/
+#define GFGXEX1_BLT_ALPHA_SRC_4444_INV (0x40000000 | 0x00000020UL)
+
+/* Source alpha ARGB8888 */
+/** GFGxAPI BITBLT Alphablending flags : alpha mode is source ARGB8888.
+ @see GFGxBlt()
+*/
+#define GFGXEX1_BLT_ALPHA_SRC_8888 (0x40000000 | 0x00000040UL)
+
+/* Inverse source alpha ARGB8888 */
+/** GFGxAPI BITBLT Alphablending flags : alpha mode is inverse source ARGB8888.
+ @see GFGxBlt()
+*/
+#define GFGXEX1_BLT_ALPHA_SRC_8888_INV (0x40000000 | 0x00000080UL)
+
+/* Destination alpha ARGB8888 */
+/** GFGxAPI BITBLT Alphablending flags : alpha mode is destination ARGB8888.
+ @see GFGxBlt()
+*/
+#define GFGXEX1_BLT_ALPHA_DST_8888 (0x40000000 | 0x00000100UL)
+
+/* Inverse Destination alpha 8888 */
+/** GFGxAPI BITBLT Alphablending flags : alpha mode is inverse destination ARGB8888.
+ @see GFGxBlt()
+*/
+#define GFGXEX1_BLT_ALPHA_DST_8888_INV (0x40000000 | 0x00000200UL)
+
+/* Planar 1BPP alpha blending */
+/** GFGxAPI BITBLT Alphablending flags : alpha mode is 1BPP planar.
+ @see GFGxBlt()
+*/
+#define GFGXEX1_BLT_PLANAR_1BPP (0x40000000 | 0x00000400UL )
+
+/* Planar 1BPP Inv alpha blending */
+/** GFGxAPI BITBLT Alphablending flags : alpha mode is inverse 1BPP planar.
+ @see GFGxBlt()
+*/
+#define GFGXEX1_BLT_PLANAR_1BPP_INV (0x40000000 | 0x00000800UL)
+
+/* Planar 2BPP alpha blending */
+/** GFGxAPI BITBLT Alphablending flags : alpha mode is 2BPP planar.
+ @see GFGxBlt()
+*/
+#define GFGXEX1_BLT_PLANAR_2BPP (0x40000000 | 0x00001000UL)
+
+/* Planar 2BPP Inv alpha blending */
+/** GFGxAPI BITBLT Alphablending flags : alpha mode is inverse 2BPP planar.
+ @see GFGxBlt()
+*/
+#define GFGXEX1_BLT_PLANAR_2BPP_INV (0x40000000 | 0x00002000UL)
+
+/* Planar 4BPP alpha Blending */
+/** GFGxAPI BITBLT Alphablending flags : alpha mode is 4BPP planar.
+ @see GFGxBlt()
+*/
+#define GFGXEX1_BLT_PLANAR_4BPP (0x40000000 | 0x00004000UL)
+
+/* Planar 4BPP Inv alpha Blending */
+/** GFGxAPI BITBLT Alphablending flags : alpha mode is inverse 4BPP planar.
+ @see GFGxBlt()
+*/
+#define GFGXEX1_BLT_PLANAR_4BPP_INV (0x40000000 | 0x00008000UL)
+
+/* Planar 8BPP alpha Blending */
+/** GFGxAPI BITBLT Alphablending flags : alpha mode is 8BPP planar.
+ @see GFGxBlt()
+*/
+#define GFGXEX1_BLT_PLANAR_8BPP (0x40000000 | 0x00010000UL)
+
+/* Planar 8Bpp Inv alpha Blending */
+/** GFGxAPI BITBLT Alphablending flags : alpha mode is inverse 8BPP planar.
+ @see GFGxBlt()
+*/
+#define GFGXEX1_BLT_PLANAR_8BPP_INV (0x40000000 | 0x00020000UL)
+
+/* Planar 44BPP alpha blending */
+/** GFGxAPI BITBLT Alphablending flags : alpha mode is SRC4DST4BPP planar.
+ @see GFGxBlt()
+*/
+#define GFGXEX1_BLT_PLANAR_44BPP (0x40000000 | 0x00040000UL)
+
+/* Planar 32 bpp src blending 16 bpp dst */
+/** GFGxAPI BITBLT Alphablending flags : alpha mode is 32BPP src to 16BPP dst.
+ @see GFGxBlt()
+*/
+#define GFGXEX1_BLT_PLANAR_32BPP16 (0x40000000 | 0x00080000UL)
+
+/*Planar Inv 32 bpp src blending 16 bpp dst */
+/** GFGxAPI BITBLT Alphablending flags : alpha mode is inverse 32BPP src to
+ 16BPP dst.
+ @see GFGxBlt()
+*/
+#define GFGXEX1_BLT_PLANAR_32BPP16_INV (0x40000000 | 0x00100000UL)
+
+/* Alpha planar is already in video mem, no need to transfer it from sys mem */
+#define GFGXEX1_BLT_PLANAR_NOTRANSFER (0x40000000 | 0x00200000UL)
+
+/**** FAST ROTATION FLAGS ****/
+/** GFGxAPI BITBLT Fast Rotation mask.
+ @see GFGxFastRotate()
+*/
+#define GFGXEX2_MASK 0x3FFFFFFF
+
+/* Fast Rotation Modes */
+
+/* Square (in place rotation) */
+/** GFGxAPI BITBLT Fast Rotation flags : dst is same than src.
+ @see GFGxFastRotate()
+*/
+#define GFGXEX2_FAST_ROTATE_SQUARE (0x80000000 | 0x00000001UL)
+
+/* Source to Destination Rotation ( 2 buffers) */
+/** GFGxAPI BITBLT Fast Rotation flags : dst is different than src.
+ @see GFGxFastRotate()
+*/
+#define GFGXEX2_FAST_ROTATE_SRC_DST_COPY (0x80000000 | 0x00000002UL)
+
+/* Disable Fast Rotation */
+/** GFGxAPI BITBLT Fast Rotation flags : disable fast rotation.
+ @see GFGxFastRotate()
+*/
+#define GFGXEX2_FAST_ROTATE_DISABLE (0x80000000 | 0x00000004UL)
+
+/* Fast Rotation Types */
+
+/* Flip-X */
+/** GFGxAPI BITBLT Fast Rotation flags : FLIP-X transformation.
+ @see GFGxFastRotate()
+*/
+#define GFGXEX2_FAST_ROTATE_FLIP_X (0x80000000 | 0x00000008UL)
+
+/* Flip-Y */
+/** GFGxAPI BITBLT Fast Rotation flags : FLIP-Y transformation.
+ @see GFGxFastRotate()
+*/
+#define GFGXEX2_FAST_ROTATE_FLIP_Y (0x80000000 | 0x00000010UL)
+
+/* Trans-LR */
+/** GFGxAPI BITBLT Fast Rotation flags : TRANSPOSE LEFT-RIGHT transformation.
+ @see GFGxFastRotate()
+*/
+#define GFGXEX2_FAST_ROTATE_TRANS_LR (0x80000000 | 0x00000020UL)
+
+/* Trans-RL */
+/** GFGxAPI BITBLT Fast Rotation flags : TRANSPOSE RIGHT-LEFT transformation.
+ @see GFGxFastRotate()
+*/
+#define GFGXEX2_FAST_ROTATE_TRANS_RL (0x80000000 | 0x00000040UL)
+
+/* 90 deg Rotation */
+/** GFGxAPI BITBLT Fast Rotation flags : 90 rotation.
+ @see GFGxFastRotate()
+*/
+#define GFGXEX2_FAST_ROTATE_ROT_90 (0x80000000 | 0x00000080UL)
+
+/* 180 deg Rotation */
+/** GFGxAPI BITBLT Fast Rotation flags : 180 rotation.
+ @see GFGxFastRotate()
+*/
+#define GFGXEX2_FAST_ROTATE_ROT_180 (0x80000000 | 0x00000100UL)
+
+/* 270 deg Rotation */
+/** GFGxAPI BITBLT Fast Rotation flags : 270 rotation.
+ @see GFGxFastRotate()
+*/
+#define GFGXEX2_FAST_ROTATE_ROT_270 (0x80000000 | 0x00000200UL)
+
+/* Identity */
+/** GFGxAPI BITBLT Fast Rotation flags : identity transformation.
+ @see GFGxFastRotate()
+*/
+#define GFGXEX2_FAST_ROTATE_IDENTITY (0x80000000 | 0x00000400UL)
+
+
+/** GFGXAPI STRETCHBLT flag in GFGXBLTPARAM struct
+ This flag waits for the StretchBlt engine to be idle.
+ If enabled it will block the CPU thread until the StretchBlt is done.
+ It is effective only for GFGxStretchBlt().
+ For other api's it is ignored.
+ @see GFGxBlt()
+*/
+#define GFGX_STRETCHBLT_WAITFOR_FINISH 0x00100000UL
+
+
+/*
+ * Definition of attribute ids for Set/GetAttributes()
+ */
+
+/** GFGxAPI attributes definition.
+ @see GFGxGetAttribute(), GFGxSetAttribute()
+*/
+typedef enum _GFGXATTRIBUTES
+ {
+ /** Current bits per pixel. */
+ GFGX_ATTR_BPP,
+ /** Frame buffer line width in bytes. */
+ GFGX_ATTR_STRIDE,
+ /** Ptr to start address of the display frame buffer. */
+ GFGX_ATTR_ADDR_PTR,
+ /** Start address offset. */
+ GFGX_ATTR_ADDR,
+ /** Surface for GFGxAPI operations. */
+ GFGX_ATTR_SURFACE,
+ /** Palette RGB888. */
+ GFGX_ATTR_PALETTE_RGB888
+} GFGXATTRIBUTES;
+
+/* Blt parameter struct */
+/** GFGxAPI BLT parameter structure.
+ @see GFGxBlt()
+*/
+typedef struct _GFGXBLTPARAM
+{
+ /** Destination x in pixels (relative to left). */
+ NvS16 dx;
+ /** Destination y in scan lines (relative to top). */
+ NvS16 dy;
+ /** Width of the source rectangle in pixels. */
+ NvS16 w;
+ /** Height of the source rectangle in pixels. */
+ NvS16 h;
+ /** Source x in pixels (relative to left). */
+ NvS16 sx;
+ /** Source y in scan lines (relative to top). */
+ NvS16 sy;
+ /** Width of the source rectangle in pixels (for Stretch Blt only). */
+ NvS16 sw;
+ /** Height of the source rectangle in scan lines (for Stretch Blt only). */
+ NvS16 sh;
+ /** Color depth */
+ NvU16 bpp;
+ /** Number of bytes per scanline for bitmap. */
+ NvS16 stride;
+ /** Foreground color (used if pixel data is 1 on 1BPP source bitmap). */
+ NvU32 fgColor;
+ /** Background color (used if pixel data is 0 on 1BPP source bitmap). */
+ NvU32 bgColor;
+ /** Pointer to source bitmap. */
+ NvU8 *pBits;
+ /** Pattern offset in x direction. */
+ NvS16 px;
+ /** Pattern offset in y direction. */
+ NvS16 py;
+ /** Pattern foreground color (used if pixel data is 1 on 1BPP pattern bitmap).*/
+ NvU32 patFgColor;
+ /** Pattern background color (used if pixel data is 0 on 1BPP pattern bitmap).*/
+ NvU32 patBgColor;
+ /** Pattern color key for transparent blt.*/
+ NvU32 patColorCmp;
+ /** Pointer to pattern bitmap. */
+ NvU8 *pPatBits;
+ /** Number of bytes per scanline for pattern. */
+ NvU32 patStride;
+ /** Width of pattern. */
+ NvU32 patW;
+ /** Height of pattern. */
+ NvU32 patH;
+
+ /** pointer to Pattern ID when GFGX_BLT_PAT_CACHE flag is set. */
+ /** GFGxBlt() will return the patID in this field */
+ NvU32 *pPatID;
+
+ // Miscellaneous parameters
+ /** Color key for transparent blt. */
+ NvU32 colorCompare;
+ /** Main flags setting. */
+ NvU32 flags;
+ /** Raster operation code (ROP3). */
+ NvU16 rop3;
+
+ // Surface parameters
+ /** Pointer to dst surface pointer. */
+ PGFRMSURFACE *ppDestSurf;
+ /** Pointer to src surface pointer. */
+ PGFRMSURFACE *ppSrcSurf;
+ /** Source start address. */
+ NvU32 srcStartAddr;
+ /** Destination start address. */
+ NvU32 dstStartAddr;
+ /** Number of bytes per scanline for destination. */
+ NvS16 dstStride;
+
+ // alpha blending parameters
+ /** Alpha value for GFGX_BLT_ALPHA_FIXED or alphaFg for GFGX_BLT_ALPHA_SRC_1555_T. */
+ NvU16 alpha;
+ /** Background alpha for GFGX_BLT_ALPHA_SRC_1555_T. */
+ NvU16 alphaBg;
+ /** Pointer to alpha plane. */
+ NvU8 *pAlphaplane;
+
+ // Fading parameters
+ /** Fading coefficient. */
+ NvU32 fadeCoeff;
+ /** Fading offset. */
+ NvU32 fadeOffset;
+
+ /** Alphablending flag. */
+ NvU32 flagex1;
+
+ /** Fast rotation flag. */
+ NvU32 flagex2;
+
+} GFGXBLTPARAM;
+
+
+/** @name Functions
+@{*/
+
+/** This function returns version and capabilities of API and hardware.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param pGxProp (PGFPROPERTY) Pointer to property structure to be filled in
+
+ @retval #GF_SUCCESS pGxProp filled in successfully
+ @retval #GF_ERROR Some error occured
+
+ The #GFPROPERTY structure passed with parameter pGxProp will be
+ filled in on successfull return.
+
+ The GFPROPERTY::Capability field will hold a combination of flagbits
+ indicating capabilities specific to the GFGxAPI :
+
+
+ #GFGX_CAP_BLT
+ BitBlt supported.
+ #GFGX_CAP_LINE
+ Line Draw supported.
+ #GFGX_CAP_CLIP
+ Clipping supported.
+ #GFGX_CAP_STRETCHBLT
+ Stretchblt supported.
+ #GFGX_CAP_ALPHABLENDING
+ Alphablending supported.
+ #GFGX_CAP_ALPHA_COLOR_CMP
+ Alphablending and transparency supported.
+ #GFGX_CAP_FAST_ROTATION
+ Fast rotation supported.
+ #GFGX_CAP_CLIPPING_INSIDE
+ Inside clipping supported.
+ #GFGX_CAP_FADE_BLT
+ Fadeblt supported.
+ #GFGX_CAP_COLOR_PATTERN
+ Color pattern supported.
+ #GFGX_CAP_CLR_PAT_TRANSPARENT
+ Color pattern transparency supported.
+ #GFGX_CAP_ALPHA_AND_FADING
+ Alphablending and fading supported.
+ #GFGX_CAP_ALPHA_PLANAR_1BPP
+ 1BPP alpha planar supported.
+ #GFGX_CAP_ALPHA_PLANAR_2BPP
+ 2BPP alpha plane supported.
+ #GFGX_CAP_ALPHA_PLANAR_4BPP
+ 4BPP alpha plane supported.
+ #GFGX_CAP_ALPHA_PLANAR_8BPP
+ 8BPP alpha plane supported.
+ #GFGX_CAP_ALPHA_PLANAR_SRC4DST4
+ SRC4DST4BPP alpha plane supported.
+ #GFGX_CAP_ALPHA_PLANAR_32BLEND16
+ 32BPP to 16BPP alphablending supported.
+ #GFGX_CAP_ALPHA_SRC1555
+ Src 1555 alphablending supported.
+ #GFGX_CAP_ALPHA_SRC4444
+ Src 4444 alphablending supported.
+ #GFGX_CAP_ALPHA_FIXED
+ Src fixed alphablending supported.
+
+
+ It is recommended, but not mandatory, that you call this function to query
+ for the GFGxAPI version and capabilities before proceeding to call any of
+ the other GFGxAPI functions.
+
+ @see GFPROPERTY
+*/
+GF_RETTYPE GFGxGetProperty(GFGxHandle GxHandle,
+ PGFPROPERTY pGxProp);
+/** This function fills a rectangle in video memory with the specified solid color.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param x,y (NvS16) left-top corner of the rectangle (x in pixels, y in scan lines)
+ @param w,h (NvS16) width & height of the rectangle (w in pixels, h in scan lines)
+ @param color (NvU32) color to be filled (8BPP index, or 16BPP-32BPP TrueColor)
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+
+ @see GFGxFillRectEx()
+*/
+GF_RETTYPE GFGxFillRect(GFGxHandle GxHandle,
+ NvS16 x, NvS16 y,
+ NvS16 w, NvS16 h,
+ NvU32 color);
+/** This function is commonly used in scrolling an image in video memory. It copies
+ a rectangular image in the video memory to another location in the same video
+ memory.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param dx,dy (NvS16) left-top corner of destination rectangle (dx in pixels, dy in scan lines)
+ @param w,h (NvS16) width & height of rectangles (w in pixels, h in scan lines)
+ @param sx,sy (NvS16) left-top corner of source rectangle (sx in pixels, sy in scan lines)
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ GFGxCopyRect() checks for the destruction of the copied image in video memory
+ caused by overlapping source and destination locations.
+
+ Also, if the destination for the rectangle exceeds the limit of the video memory,
+ wrapping is done in hardware and no error code is returned.
+
+
+ @see GFGxCopyRectEx(), GFGxCopyRectDirect()
+*/
+GF_RETTYPE GFGxCopyRect(GFGxHandle GxHandle,
+ NvS16 dx, NvS16 dy,
+ NvS16 w, NvS16 h,
+ NvS16 sx, NvS16 sy);
+
+/** This function copies a source bitmap from system memory to the video memory.
+ The source bitmap is specified in monochrome (1BPP) pixels.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param dx,dy (NvS16) left-top corner of destination rectangle (dx in pixels, dy in scan lines)
+ @param w,h (NvS16) width & height of the rectangle in pixels and scan lines
+ @param sx,sy (NvS16) left-top corner of source rectangle (sx in pixels, sy in scan lines)
+ @param fgColor (NvU16) color applied to source data bit 1 (The color depth should be same as the frame buffer)
+ @param bgColor (NvU16) color applied to source data bit 0 (The color depth should be same as the frame buffer)
+ @param srcStride (NvS16) source stride in bytes
+ @param pMonoBits (NvU8*) pointer to monochome (1bpp) bitmap
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+
+ @see GFGxCopyTransMonoBitmap()
+*/
+GF_RETTYPE GFGxCopyMonoBitmap( GFGxHandle GxHandle,
+ NvS16 dx, NvS16 dy,
+ NvS16 w, NvS16 h,
+ NvS16 sx, NvS16 sy,
+ NvU32 fgColor, NvU32 bgColor,
+ NvS16 srcStride,
+ NvU8 *pMonoBits);
+/** This function copies the bitmap from video memory to system memory.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param dx,dy (NvS16) left-top corner of destination rectangle (dx in pixels, dy in scan lines)
+ @param w,h (NvS16) width & height of the rectangle in pixels and scan lines
+ @param sx,sy (NvS16) left-top corner of source rectangle (sx in pixels, sy in scan lines)
+ @param dstStride (NvS16) destination stride in bytes
+ @param pDstAddr (NvU8*) pointer to destination buffer
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+*/
+GF_RETTYPE GFGxReadBlt( GFGxHandle GxHandle,
+ NvS16 dx, NvS16 dy,
+ NvS16 w, NvS16 h,
+ NvS16 sx, NvS16 sy,
+ NvS16 dstStride,
+ NvU8 *pDstStartAddr);
+/** This function copies a source bitmap from system memory to the video memory.
+ The source bitmap is specified in monochrome (1BPP) pixels and can be transparent.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param dx,dy (NvS16) left-top corner of destination rectangle
+ @param w,h (NvS16) width & height of the rectangle in pixels and scan lines
+ @param sx,sy (NvS16) left-top corner of source rectangle
+ @param color (NvU16) color applied to non-transparent source data bit
+ @param srcStride (NvS16) source stride in bytes
+ @param pMonoBits (NvU8*) pointer to monochome (1bpp) bitmap
+ @param selectTrans (NvS16) transparency select: 0 or 1
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ This function is similar to GFGxCopyMonoBitmap() except for the selectTrans parameter.
+ This parameter indicates whether bit data equal to 0 or 1 is going to be transparent.
+ This function could be used for drawing a transparent text string or character.
+
+
+ @see GFGxCopyMonoBitmap()
+*/
+GF_RETTYPE GFGxCopyTransMonoBitmap( GFGxHandle GxHandle,
+ NvS16 dx, NvS16 dy,
+ NvS16 w, NvS16 h,
+ NvS16 sx, NvS16 sy,
+ NvU32 color,
+ NvS16 srcStride,
+ NvU8 *pMonoBits,
+ NvS16 selectTrans );
+/** This function is used to blit/blend a given source rectangle to/with the given
+ destination location in the video memory.
+
+ Overlap rectangles are handled properly. Source and destination rectangles must
+ have same size.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param pBltParam (#GFGXBLTPARAM*) refer to structure definition
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+
+ This routine is more generic. It supports System Memory to Video Memory Blts and
+ Video to Video Memory Blts involving Source and Pattern data.The Source and Pattern
+ data can be either Color or Monochrome(1 Bpp). Monochrome Blts are supported by performing
+ a Monochrome to Color Expansion.
+
+ Tiling mode is also supported for Mono Patttern Blts. The size of the pattern in this case
+ should be 16x16. Tiling is not supported for Color Patterns.
+
+ The following features can also be enabled during Blts :
+
+ - Color Source and Mono Source Transparency
+ - Destination Transparency,
+ - Color Pattern and Mono Pattern Transparency
+ - Alphablending ( Both Planar and Source Alpha)
+ - Fading
+ - Microsoft Windows compatible ROP3
+ - Clipping
+
+ GFGxBlt() supports both raster operations and alpha blending operations.The two types
+ of operations are mutually exclusive.
+
+ Please refer to the supported GFGxBlt() flags starting with GFGX_BLT_* and GFGXEX1_BLT_*.
+
+
+ @see GFGxCopyRect(), GFGxCopyRectDirect(), GFGxBltSurface(), GFGxCopyMonoBitmap(),
+ GFGxCopyTransMonoBitmap(), GFGxCopyColorBitmap()
+*/
+GF_RETTYPE GFGxBlt( GFGxHandle GxHandle,
+ const GFGXBLTPARAM *pBltParam );
+
+/**
+ This function performs a surface-to-surface blit. The color depth of the source
+ surface must match that of the destination. Also, the width and height of the
+ source must be the same as the destination's width and height.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param ppDestSurf (#PGFRMSURFACE*) pointer to destination surface pointer
+ @param ppSrcSurf (#PGFRMSURFACE) pointer so source surface pointer
+ @param w,h (NvS16) width & height of the rectangle in pixels and scan lines
+ @param rop3 (NvU16) raster operation code
+ @param srcStartAddr (NvU32) start address relative to the source surface
+ @param dstStartAddr (NvU32) start address relative to the destination surface
+ @param flags (NvU32) Transparent blit flag. See Below
+ @param colorCompare (NvU32) color key for transparent blit. If there is no transparent blit, colorCompare = 0
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ Transparent blit flag is one of the following:
+ - GFGX_BLT_TRANSPARENT_SRC_COLOR
+ - GFGX_BLT_TRANSPARENT_SRC_MONO
+ - GFGX_BLT_TRANSPARENT_SRC_MONO_INV
+ - GFGX_BLT_TRANSPARENT_DST
+ - GFGX_BLT_TRANSPARENT_PAT_COLOR
+ - GFGX_BLT_TRANSPARENT_PAT_COLOR_INV
+ - GFGX_BLT_TRANSPARENT_PAT_MONO
+ - GFGX_BLT_TRANSPARENT_PAT_MONO_INV
+ Refer to GFGX_BLT_X flag definitions for further information. If no transparent blit, flag = 0
+
+ Alphablending is not supported.
+
+
+ @see GFGxCopyRect(), GFGxCopyRectDirect(), GFGxBltSurface(), GFGxCopyMonoBitmap(),
+ GFGxCopyTransMonoBitmap(), GFGxCopyColorBitmap()
+*/
+GF_RETTYPE GFGxBltSurface( GFGxHandle GxHandle, PGFRMSURFACE *ppDestSurf,
+ PGFRMSURFACE *ppSrcSurf,
+ NvS16 w, NvS16 h, NvU16 rop3,
+ NvU32 srcStartAddr, NvU32 dstStartAddr,
+ NvU32 flags, NvU32 colorCompare);
+
+/** This function copies a source bitmap from system memory to the video memory.
+ The source bitmap's color depth must match the destination's video memory's color depth.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param dx,dy (NvS16) left-top corner of destination rectangle
+ @param w,h (NvS16) width & height of the rectangle in pixels and scan lines
+ @param sx,sy (NvS16) left-top corner of source rectangle
+ @param srcStride (NvS16) source stride in bytes, must be pixel size aligned
+ @param pColorBits (NvU8*) pointer to color bitmap
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+
+ @see GFGxCopyMonoBitmap()
+*/
+GF_RETTYPE GFGxCopyColorBitmap( GFGxHandle GxHandle,
+ NvS16 dx, NvS16 dy,
+ NvS16 w, NvS16 h,
+ NvS16 sx, NvS16 sy,
+ NvS16 srcStride,
+ NvU8 *pColorBits );
+
+/** This function draws a line from a point x1, y1 to another point x2, y2 with a specified color
+ and ROP2 code. GFGxSetClip() should be called before calling GFGxLine(). If clipping is needed,
+ it is assumed that clipping is enabled and clipping rectangle was set by GFGxSetClip(). If
+ clipping is not set, the line wraps if it is too long, and no error code is returned.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param x1,y1 (NvU16) (x,y) destination point coords (in pixels, scan lines)
+ @param x2,y2 (NvU16) (x,y) source point coords in (pixels, scan lines)
+ @param rop2 (NvU16) ROP2 code
+ @param color (NvU16) color key for transparent blt or pattern color
+ @param flags (NvU16) refer to GFGX_LINE_X flag definitions
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ Set flags to GFGX_LINE_NOT_DRAW_LAST_PIXEL if the last pixel is not to be
+ drawn.
+
+*/
+GF_RETTYPE GFGxLine( GFGxHandle GxHandle,
+ NvU16 x1, NvU16 y1, NvU16 x2, NvU16 y2,
+ NvU16 rop2, NvU32 color, NvU16 flags );
+
+/** This function enables or disables clipping and also sets the clipping rectangle for subsequent
+ blit and line drawing functions.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param pClipRect (#PGFRECT) pointer to the clipping rectangle
+ @param clipFlag (NvU32) See below
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ Set clipFlag to one of the following:
+ - GFGX_SETCLIP_DISABLE
+ - GFGX_SETCLIP_ENABLE
+ - GFGX_SETCLIP_SETRECT
+ Refer to GFGX_SETCLIP_X flag definitions
+
+ Clipping Sample Code
+ // Initialize clipping and rectangle parameters.
+ clipRect.top = 10;
+ clipRect.left = 10;
+ clipRect.right = 60;
+ clipRect.bottom = 60;
+ // Set the clipping rectangle and enable clipping.
+ GFGxSetClip( GxHandle, &clipRect, (GFGX_SETCLIP_SETRECT|
+ GFGX_SETCLIP_ENABLE) );
+ // Call drawing function: Rectangle Fill, Pattern Fill, etc.
+ GFGXFillRect( GxHandle, 20, 20, 30, 30, 0x07E0 );
+ // Disable clipping.
+ GFGxSetClip( GxHandle, NULL, GFGX_SETCLIP_DISABLE );
+
+
+*/
+GF_RETTYPE GFGxSetClip( GFGxHandle GxHandle,
+ PGFRECT pClipRect, NvU32 clipFlag);
+
+/** This function ensures synchronization between 2D operations and others modules operations.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param timeout (NvU32) obsolete parameter
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ When several modules share the same channel (like 3D,2D), it may be necessary to
+ synchronize the command flow with the 2D module execution. Putting a GFGxNotBusy()
+ call after a 2D operation ensures that commands which follow the 2D command are
+ executed after full completion of the 2D command.
+
+ As opposed to GFGxWaitNotBusy(), this function doesn't block the CPU thread.
+ Graphics engine may not be idle when returning from the function. Control returns
+ to the CPU right after a wait command is placed in the graphics engine command FIFO.
+ The GoForce hardware begins executing the commands following the engine idle
+ command only after the graphics engine becomes idle.
+
+
+ @see GFGxWaitNotBusy()
+*/
+GF_RETTYPE GFGxNotBusy( GFGxHandle GxHandle,
+ NvU32 timeout );
+/** This function sets the new value into the palette entry at index location.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param palVal (NvU32) New palette entry value
+ @param index (NvU16) Index of the palette entry
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ The index value ranges from [0..255] inclusively. Parameter palVal is in RGB format,
+ where bits [0-7] represent the red value, bits [8-15] the green value, and bits [16-23]
+ the blue value.
+
+ When this function is called, the physical palette entry is modified permanently.
+
+ This function is used only for the 8-bits per-pixel mode and does not apply to the RGB 16 and
+ 32-bits mode.
+
+
+ @see GFGxGetPal(), GFGxSetPalRange(), GFGxGetPalRange()
+*/
+GF_RETTYPE GFGxSetPal(GFGxHandle GxHandle,
+ NvU32 palVal, NvU16 index);
+
+/** This function sets the a range of new values pointed by pPalRange into the palette entries
+ starting at startIndex location and ending at endIndex inclusively.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param pPalRange (NvU32*) Pointer to a range of palette entry values
+ @param startIndex (NvU16) Starting index of palette entries
+ @param endIndex (NvU16) Ending index of palette entries
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ The index value ranges from [0..255] inclusively. Each palette entry value is in RGB format,
+ where bits [0-7] represent the red value, bits [8-15] the green value, and bits [16-23]
+ the blue value.
+
+ When this function is called, the physical palette entry is modified permanently.
+
+ This function is used only for the 8-bits per-pixel mode and does not apply to the RGB 16 and
+ 32-bits mode.
+
+
+ @see GFGxGetPal(), GFGxSetPalRange(), GFGxGetPalRange()
+*/
+GF_RETTYPE GFGxSetPalRange(GFGxHandle GxHandle,
+ NvU32 * palRange,
+ NvU16 startIndex, NvU16 endIndex);
+
+/** This function returns the palette entry value at index location.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param pPalVal (NvU32*) pointer to palette entry value
+ @param index (NvU16) index of the palette entry
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ The index value ranges from [0..255] inclusively. The returned palette entry value is stored
+ in the location pointed to by pPalVal.
+
+ This function is used only for the 8-bits per-pixel mode and does not apply to the RGB 16 and
+ 32-bits mode.
+
+
+ @see GFGxSetPal(), GFGxSetPalRange(), GFGxGetPalRange()
+*/
+GF_RETTYPE GFGxGetPal(GFGxHandle GxHandle,
+ NvU32 * pPalVal,
+ NvU16 index);
+/** This function returns the palette entry values starting from location startIndex to endIndex
+ inclusively.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param pPalArray (NvU32*) Pointer to a range of palette entry values
+ @param startIndex (NvU16) Starting index of palette entries
+ @param endIndex (NvU16) Ending index of palette entries
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ The index value ranges from [0..255] inclusively. The returned values are stored into
+ variables pointed to by pPalArray.
+
+ This function is used only for the 8-bits per-pixel mode and does not apply to the RGB 16 and
+ 32-bits mode.
+
+
+ @see GFGxSetPal(), GFGxGetPal(), GFGxSetPalRange()
+*/
+
+GF_RETTYPE GFGxGetPalRange(GFGxHandle GxHandle,
+ NvU32 * pPalArray,
+ NvU16 startIndex, NvU16 endIndex);
+/** This function transfers a color bitmap of exact full screen size from system memory to video memory.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param pBltParam (#GFGXBLTPARAM*) refere to structure definition
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+
+ @see GFGxBlt()
+*/
+
+GF_RETTYPE GFGxBltFullScreen(GFGxHandle GxHandle,
+ const GFGXBLTPARAM *pBltParam);
+/** This function copies a rectangular image in the video memory to another location in the same video
+ memory without taking care of overlapping cases.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param dx,dy (NvS16) left-top corner of destination rectangle
+ @param w,h (NvS16) width & height of rectangles
+ @param sx,sy (NvS16) left-top corner of source rectangle
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ This is a special case of GxCopyRect(). It does not check on destructions of copied image
+ on video memory due to overlapping source and destination locations.
+
+
+ @see GFGxCopyRectEx(), GFGxCopyRect()
+*/
+GF_RETTYPE GFGxCopyRectDirect(GFGxHandle GxHandle,
+ NvS16 dx, NvS16 dy,
+ NvS16 w, NvS16 h,
+ NvS16 sx, NvS16 sy);
+/** This function copies a source bitmap from system memory to the video memory with
+ certain restrictions.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param bitmapPtr (NvU32*) Pointer to color bitmap
+ @param size_in_bytes (NvU16) Total bytes to transfer
+ @param rect (#GFRECT) Destination rectangle
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ This is a special case of GxCopyColorBitmap(). Conditions below must be verified :
+ - The source bitmap pointer, pColorBits, has to be a 32-bit (DWORD) aligned address.
+ - The size of each line of the source bitmap must be 64-bits (8 bytes, QWORD) aligned.
+ - There must not be any skipping bytes between lines.
+ - Total bitmap size has to be smaller than or equal to 2K (2048) bytes.
+ - The source bitmap's color depth MUST match the destination video memory's color depth.
+
+
+ @see GxCopyColorBitmap()
+*/
+GF_RETTYPE GFGxCopyPackedColorBitmap(GFGxHandle GxHandle,
+ NvU32 *pColorBits,
+ NvU16 bitmapSize,
+ GFRECT rect);
+/** This function sets a given attribute.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param aid (NvU32) Attribute id, such as width, height etc
+ @param attr (NvU32) Attribute value
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ Attribute id can be one of the following :
+
+ #GFGX_ATTR_BPP
+ Current bits per pixel.
+ #GFGX_ATTR_STRIDE
+ Frame buffer line width in bytes.
+ #GFGX_ATTR_ADDR_PTR
+ Ptr to start address of the display frame buffer.
+ #GFGX_ATTR_ADDR
+ Start address offset.
+ #GFGX_ATTR_SURFACE
+ Surface for GFGxAPI operations.
+ #GFGX_ATTR_PALETTE_RGB888
+ Palette RGB888.
+
+
+
+ @see GFGxGetAttribute()
+*/
+
+GF_RETTYPE GFGxSetAttribute(GFGxHandle GxHandle,
+ NvU32 aid,NvU32 attr);
+/** This function gets an attribute. Certain attributes are fixed.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param aid (NvU32) attribute id, such as width, height etc
+ @param attr (NvU32*) pointer to returned attribute value
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ Attribute id can be one of the following :
+
+
+ #GFGX_ATTR_BPP
+ Current bits per pixel.
+ #GFGX_ATTR_STRIDE
+ Frame buffer line width in bytes.
+ #GFGX_ATTR_ADDR_PTR
+ Ptr to start address of the display frame buffer.
+ #GFGX_ATTR_ADDR
+ Start address offset.
+ #GFGX_ATTR_SURFACE
+ Surface for GFGxAPI operations.
+ #GFGX_ATTR_PALETTE_RGB888
+ Palette RGB888.
+
+
+ @see GFGxSetAttribute()
+*/
+GF_RETTYPE GFGxGetAttribute(GFGxHandle GxHandle,
+ NvU32 aid, NvU32 *attr);
+/** This function checks whether the graphics engine is busy or idle.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param timeout (NvU32) obsolete parameter
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ The function will wait until the graphics engine is idle. For example, if you want
+ to write to the frame buffer but the graphics engine is busy the function can be used
+ to wait until it is idle.
+
+ As opposed to GFGxNotBusy(), this function blocks the CPU thread while waiting for
+ the graphics engine to become idle.
+
+
+ @see GFGxNotBusy()
+*/
+GF_RETTYPE GFGxWaitNotBusy( GFGxHandle GxHandle,
+ NvU32 timeout );
+/** This function is used to stretch or shrink an image, which can be in system memory or video memory.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param pBltParam (#GFGXBLTPARAM*) refere to structure definition
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ The function has these limitations :
+ - supports 16 and 32BPP color depths,
+
+ @see GFGxBlt()
+*/
+
+GF_RETTYPE GFGxStretchBlt( GFGxHandle GxHandle,
+ const GFGXBLTPARAM *pBltParam );
+/*******************************New API's based on enhancing old API's****************************/
+
+/** This function fills a rectangle in the video memory with the specified solid color.
+ Video memory location is specified by the surface parameter.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param pSurf (#PGFRMSURFACE) pointer to destination surface
+ @param x,y (NvS16) left-top corner of the rectangle
+ @param w,h (NvS16) width & height of the rectangle
+ @param color (NvU32) color to be filled (8BPP index, or 16BPP-32BPP TrueColor)
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+
+ @see GFGxFillRect()
+*/
+ /* Old API's with enhancement */
+GF_RETTYPE GFGxFillRectEx(GFGxHandle GxHandle,
+ PGFRMSURFACE pSurf,
+ NvS16 x, NvS16 y,
+ NvS16 w, NvS16 h,
+ NvU32 color);
+/** This function copies a rectangular image in the video memory to another location in the same
+ video memory. It is commonly used in scrolling an image in video memory.
+ Video memory location is specified by the surface parameter.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param pSurf (#PGFRMSURFACE) pointer to destination surface
+ @param dx,dy (NvS16) left-top corner of destination rectangle
+ @param w,h (NvS16) width & height of rectangles
+ @param sx,sy (NvS16) left-top corner of source rectangle
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ GFGxCopyRectEx() checks for the destruction of the copied image in video memory
+ caused by overlapping source and destination locations. Also, if the destination
+ for the rectangle exceeds the limit of the video memory, wrapping is done in hardware
+ and no error code is returned.
+
+
+ @see GFGxCopyRect(), GFGxCopyRectDirect()
+*/
+GF_RETTYPE GFGxCopyRectEx(GFGxHandle GxHandle,
+ PGFRMSURFACE pSurf,
+ NvS16 dx, NvS16 dy,
+ NvS16 w, NvS16 h,
+ NvS16 sx, NvS16 sy);
+/** This function copies a source bitmap from system memory to the video memory.
+ The source bitmap is specified in monochrome (1BPP) pixels.
+ Video memory location is specified by the surface parameter.
+
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param pSurf (#PGFRMSURFACE) pointer to destination surface
+ @param dx,dy (NvS16) left-top corner of destination rectangle
+ @param w,h (NvS16) width & height of the rectangle in pixels and scan lines
+ @param sx,sy (NvS16) left-top corner of source rectangle
+ @param fgColor (NvU16) color applied to source data bit 1
+ @param bgColor (NvU16) color applied to source data bit 0
+ @param srcStride (NvS16) source stride in bytes
+ @param pMonoBits (NvU8*) pointer to monochome (1bpp) bitmap
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+
+ @see GFGxCopyTransMonoBitmap()
+*/
+GF_RETTYPE GFGxCopyMonoBitmapEx( GFGxHandle GxHandle,
+ PGFRMSURFACE pSurf,
+ NvS16 dx, NvS16 dy,
+ NvS16 w, NvS16 h,
+ NvS16 sx, NvS16 sy,
+ NvU32 fgColor, NvU32 bgColor,
+ NvS16 srcStride,
+ NvU8 *pMonoBits);
+/** This function copies a source bitmap from system memory to the video memory.
+ The source bitmap is specified in monochrome (1BPP) pixels and can be transparent.
+ Video memory location is specified by the surface parameter.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param pSurf (#PGFRMSURFACE) pointer to destination surface
+ @param dx,dy (NvS16) left-top corner of destination rectangle
+ @param w,h (NvS16) width & height of the rectangle in pixels and scan lines
+ @param sx,sy (NvS16) left-top corner of source rectangle
+ @param color (NvU16) color applied to non-transparent source data bit
+ @param srcStride (NvS16) source stride in bytes
+ @param pMonoBits (NvU8*) pointer to monochome (1bpp) bitmap
+ @param selectTrans (NvS16) transparency select: 0 or 1
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ This function is similar to GFGxCopyMonoBitmapEx() except for the selectTrans
+ parameter. This parameter indicates whether bit data equal to 0 or 1 is going to be
+ transparent.
+
+ This function could be used for drawing a transparent text string or character.
+
+
+ @see GFGxCopyMonoBitmapEx()
+*/
+GF_RETTYPE GFGxCopyTransMonoBitmapEx( GFGxHandle GxHandle,
+ PGFRMSURFACE pSurf,
+ NvS16 dx, NvS16 dy,
+ NvS16 w, NvS16 h,
+ NvS16 sx, NvS16 sy,
+ NvU32 color,
+ NvS16 srcStride,
+ NvU8 *pMonoBits,
+ NvS16 selectTrans);
+
+/** This function copies a source bitmap from system memory to the video memory.
+ The source bitmap's color depth must match the destination's video memory's color depth.
+ Video memory location is specified by the surface parameter.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param pSurf (#PGFRMSURFACE) pointer to destination surface
+ @param dx,dy (NvS16) left-top corner of destination rectangle
+ @param w,h (NvS16) width & height of the rectangle in pixels and scan lines
+ @param sx,sy (NvS16) left-top corner of source rectangle
+ @param srcStride (NvS16) source stride in bytes, must be pixel size aligned
+ @param pColorBits (NvU8*) pointer to color bitmap
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+
+ @see GFGxCopyMonoBitmap()
+*/
+GF_RETTYPE GFGxCopyColorBitmapEx( GFGxHandle GxHandle,
+ PGFRMSURFACE pSurf,
+ NvS16 dx, NvS16 dy,
+ NvS16 w, NvS16 h,
+ NvS16 sx, NvS16 sy,
+ NvS16 srcStride,
+ NvU8 *pColorBits
+ );
+
+/** This function draws a line from a point x1, y1 to another point x2, y2 with a specified color
+ and ROP2 code.
+ Video memory location is specified by the surface parameter.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param pSurf (#PGFRMSURFACE) pointer to destination surface
+ @param x1,y1 (NvU16) (x,y) destination point coords
+ @param x2,y2 (NvU16) (x,y) source point coords
+ @param rop2 (NvU16) ROP2 code
+ @param color (NvU16) color key for transparent blt or pattern color
+ @param flags (NvU16) refere to GFGX_LINE_X flag definitions
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+
+ @see GFGxLine()
+*/
+GF_RETTYPE GFGxLineEx( GFGxHandle GxHandle,
+ PGFRMSURFACE pSurf,
+ NvU16 x1, NvU16 y1,
+ NvU16 x2, NvU16 y2,
+ NvU16 rop2, NvU32 color,
+ NvU16 flags);
+
+GF_RETTYPE GFGxBltFullScreenEx(GFGxHandle GxHandle,
+ PGFRMSURFACE pSurf,
+ const GFGXBLTPARAM *pBltParam);
+/** This function copies a rectangular image in the video memory to another location in the same video
+ memory without taking care of overlapping cases.
+ Video memory location is specified by the surface parameter.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param pSurf (#PGFRMSURFACE) pointer to destination surface
+ @param dx,dy (NvS16) left-top corner of destination rectangle
+ @param w,h (NvS16) width & height of rectangles
+ @param sx,sy (NvS16) left-top corner of source rectangle
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ This is a special case of GxCopyRect(). It does not check on destructions
+ of copied image on video memory due to overlapping source and destination locations.
+
+
+ @see GFGxCopyRectEx(), GFGxCopyRect(), GFGxCopyRectDirect()
+*/
+GF_RETTYPE GFGxCopyRectDirectEx(GFGxHandle GxHandle,
+ PGFRMSURFACE pSurfNvS16,
+ NvS16 dx, NvS16 dy,
+ NvS16 w, NvS16 h,
+ NvS16 sx, NvS16 sy);
+
+/** This function copies a source bitmap from system memory to the video memory with
+ certain restrictions.
+ Video memory location is specified by the surface parameter.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param pSurf (#PGFRMSURFACE) pointer to destination surface
+ @param pColorBits (NvU32*) pointer to color bitmap
+ @param bitmapSize (NvU16) total bytes to transfer
+ @param rect (#GFRECT) destination rectangle
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ This is a special case of GxCopyColorBitmap(). Conditions below must be verified :
+ - The source bitmap pointer, pColorBits, has to be a 32-bit (DWORD) aligned address.
+ - The size of each line of the source bitmap must be 64-bits (8 bytes, QWORD) aligned.
+ - There must not be any skipping bytes between lines.
+ - Total bitmap size has to be smaller than or equal to 2K (2048) bytes.
+ - The source bitmap's color depth MUST match the destination video memory's color depth.
+
+
+ @see GxCopyColorBitmap(), GFGxCopyPackedColorBitmap()
+*/
+GF_RETTYPE GFGxCopyPackedColorBitmapEx( GFGxHandle GxHandle,
+ PGFRMSURFACE pSurf,
+ NvU32 *pColorBits,
+ NvU16 bitmapSize,
+ GFRECT rect
+/** This function performs a surface-to-surface blit. The color depth of the source
+ surface must match that of the destination. Also, the width and height of the
+ source must be the same as the destination's width and height.
+ Alphablending parameters can be specified.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param ppDestSurf (#PGFRMSURFACE*)pointer to destination surface pointer
+ @param ppSrcSurf (#PGFRMSURFACE) pointer so source surface pointer
+ @param w,h (NvS16) width & height of the rectangle in pixels and scan lines
+ @param rop3 (NvU16) raster operation code
+ @param srcStartAddr (NvU32) start address relative to the source surface
+ @param dstStartAddr (NvU32) start address relative to the destination surface
+ @param flags (NvU32) refer to GFGX_BLT_X flag definitions
+ @param flagex1 (NvU32) refer to alphablending flag definitions GFGXEX1_BLT_X
+ @param colorCompare (NvU32) color key for transparent blit
+ @param alpha (NvU16) alpha value for GFGX_BLT_ALPHA_FIXED or alphaFg
+ @param alphaBg (NvU16) background alpha
+
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+
+ @see GFGxCopyRect(), GFGxCopyRectDirect(), GFGxBltSurface(), GFGxCopyMonoBitmap(),
+ GFGxCopyTransMonoBitmap(), GFGxCopyColorBitmap()
+*/ );
+GF_RETTYPE GFGxBltSurfaceEx( GFGxHandle GxHandle, PGFRMSURFACE *ppDestSurf,
+ PGFRMSURFACE *ppSrcSurf,
+ NvS16 w, NvS16 h, NvU16 rop3,
+ NvU32 srcStartAddr, NvU32 dstStartAddr,
+ NvU32 flags, NvU32 flagex1, NvU32 colorCompare,
+ NvU16 alpha, NvU16 alphaBg);
+
+ /* New API's based on new features */
+
+/*******************************New API's based on New Features***********************************/
+
+/** This function is used to transform a given source rectangle to the given destination
+ location in the video memory.
+
+ Rotation takes place in counterclockwise direction.
+
+ Destination rectangle can be same than source rectangle or different.
+ Both source and destination must be in video memory.
+
+ Common input data requirements :
+
+ - the data buffer must be aligned on all edges (top, bottom, left, right), which also implies
+ that stride is multiple of 16 bytes,
+ - the base address of both source and destination must be aligned at a 128-bit word aligned,
+ - in GFGX_BLT_SURFACE mode, source and destination must be same format : GF_SURFACE_RGB8,
+ GF_SURFACE_RGB565, GF_SURFACE_ARGB8888, or GF_SURFACE_YUV420,
+ - GFGX_BLT_MODE_LINEAR and X/Y modes are also supported for GF_SURFACE_RGB8, GF_SURFACE_RGB565
+ and GF_SURFACE_ARGB8888,
+ - width and height must be multiple of 16 pixels in 8bpp mode, 8 in 16bpp and 4 in 32bpp for
+ GF_SURFACE_RGB8, GF_SURFACE_RGB565 and GF_SURFACE_ARGB8888 surfaces,
+ - in GFGXEX2_FAST_ROTATE_SQUARE mode, width should be equal to height for 90, 270,
+ TRANS_LR and TRANS_RL modes. Also the destination surface should be same as source
+ surface.
+
+ Specific GF_SURFACE_YUV420 input data requirements :
+
+ - only GFGX_BLT_SURFACE mode is supported, with no offsets defined for both source and
+ destination (dstStartAddr = srcStartAddr = 0).
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param pBltParam (#GFGXBLTPARAM*) refere to structure definition
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+
+ This function can be used the same way than GFGxBlt, adding flagex2 information.
+
+ The following transformations are supported :
+
+
+
+ #GFGXEX2_FAST_ROTATE_FLIP_X
+ FLIP-X.
+ #GFGXEX2_FAST_ROTATE_FLIP_Y
+ FLIP-Y.
+ #GFGXEX2_FAST_ROTATE_TRANS_LR
+ TRANSPOSE LEFT-RIGHT.
+ #GFGXEX2_FAST_ROTATE_TRANS_RL
+ TRANSPOSE RIGHT-LEFT.
+ #GFGXEX2_FAST_ROTATE_ROT_90
+ 90 rotation.
+ #GFGXEX2_FAST_ROTATE_ROT_180
+ 180 rotation.
+ #GFGXEX2_FAST_ROTATE_ROT_270
+ 270 rotation.
+
+
+
+ @see GFGxBlt()
+*/
+GF_RETTYPE GFGxFastRotate(GFGxHandle GxHandle,
+ const GFGXBLTPARAM *pBltParam);
+/** This function copies a source bitmap from system memory to the video memory.
+ The source bitmap's color depth must match the destination's video memory's color depth.
+ Source transparency is supported.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param dx,dy (NvS16) left-top corner of destination rectangle
+ @param w,h (NvS16) width & height of the rectangle in pixels and scan lines
+ @param sx,sy (NvS16) left-top corner of source rectangle
+ @param srcStride (NvS16) source stride in bytes, must be pixel size aligned
+ @param pColorBits (NvU8*) pointer to color bitmap
+ @param pSrcColorKey (NvU32*) pointer to source color key. If NULL no transparency.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+
+ @see GFGxCopyMonoBitmap(), GFGxCopyColorBitmap()
+*/
+GF_RETTYPE GFGxCopyTransColorBitmap(GFGxHandle GxHandle,
+ NvS16 dx,
+ NvS16 dy,
+ NvS16 w,
+ NvS16 h,
+ NvS16 sx,
+ NvS16 sy,
+ NvS16 srcStride,
+ NvU8 *pColorBits,
+ NvU32 *pSrcColorKey);
+/** This function copies a source bitmap from system memory to the video memory with a mono
+ pattern buffer combination.
+ The source bitmap's color depth must match the destination's video memory's color depth.
+ Source and mono pattern transparencies are supported.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param dx,dy (NvS16) left-top corner of destination rectangle
+ @param w,h (NvS16) width & height of the rectangle in pixels and scan lines
+ @param sx,sy (NvS16) left-top corner of source rectangle
+ @param srcStride (NvS16) source stride in bytes, must be pixel size aligned
+ @param pColorBits (NvU8*) pointer to color bitmap
+ @param pSrcColorKey (NvU32*) pointer to source color key. If NULL no transparency.
+ @param rop3 (NvU8) raster operation code
+ @param pPatBuffer (NvU8*) pointer to pattern buffer
+ @param patFgColor (NvU32) pattern foreground color
+ @param patBgColor (NvU32) pattern background color
+ @param patW, patH (NvU32) width & height of pattern buffer
+ @param patStride (NvU32) pattern stride in bytes
+ @param pSelectPatTrans (NvU16*) pointer to pattern color key. If NULL no transparency.
+
+ Depending of pattern size, replicated mode is used or not.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+
+ @see GFGxCopyTransColorBitmap(), GFGxCopyColorBitmap()
+*/
+GF_RETTYPE GFGxCopyTransColorBitmapWithMonoPattern(GFGxHandle GxHandle,
+ NvS16 dx,
+ NvS16 dy,
+ NvS16 w,
+ NvS16 h,
+ NvS16 sx,
+ NvS16 sy,
+ NvS16 srcStride,
+ NvU8 *pColorBits,
+ NvU32 *pSrcColorKey,
+ NvU8 rop3,
+ NvU8 *pPatBuffer,
+ NvU32 patFgColor,
+ NvU32 patBgColor,
+ NvU32 patW,
+ NvU32 patH,
+ NvU32 patStride,
+ NvU16 *pSelectPatTrans);
+/** This function copies a source bitmap from system memory to the video memory with a colour
+ pattern buffer combination.
+ The source bitmap and pattern's color depth must match the destination's video memory's color depth.
+ Source and color pattern transparencies are supported.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param dx,dy (NvS16) left-top corner of destination rectangle
+ @param w,h (NvS16) width & height of the rectangle in pixels and scan lines
+ @param sx,sy (NvS16) left-top corner of source rectangle
+ @param srcStride (NvS16) source stride in bytes, must be pixel size aligned
+ @param pColorBits (NvU8*) pointer to color bitmap
+ @param pSrcColorKey (NvU32*) pointer to source color key. If NULL no transparency.
+ @param rop3 (NvU8) raster operation code
+ @param pPatBuffer (NvU8*) pointer to pattern buffer
+ @param patW, patH (NvU32) width & height of pattern buffer
+ @param patStride (NvU32) pattern stride in bytes
+ @param pPatColorKey (NvU32*) pointer to pattern color key. If NULL no transparency.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+
+ @see GFGxCopyTransColorBitmap(), GFGxCopyColorBitmap(), GFGxCopyTransColorBitmapWithMonoPattern()
+*/
+GF_RETTYPE GFGxCopyTransColorBitmapWithColorPattern(GFGxHandle GxHandle,
+ NvS16 dx,
+ NvS16 dy,
+ NvS16 w,
+ NvS16 h,
+ NvS16 sx,
+ NvS16 sy,
+ NvS16 srcStride,
+ NvU8 *pColorBits,
+ NvU32 *pSrcColorKey,
+ NvU8 rop3,
+ NvU8 *pPatBuffer,
+ NvU32 patW,
+ NvU32 patH,
+ NvU32 patStride,
+ NvU32 *pPatColorKey);
+/** This function copies a source bitmap from system memory to the video memory with a mono
+ pattern buffer combination.
+ The source bitmap and pattern are mono (1BPP).
+ Mono source and mono pattern transparencies are supported.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param dx,dy (NvS16) left-top corner of destination rectangle
+ @param w,h (NvS16) width & height of the rectangle in pixels and scan lines
+ @param sx,sy (NvS16) left-top corner of source rectangle
+ @param srcFgColor (NvU32) source foreground color
+ @param srcBgColor (NvU32) source background color
+ @param srcStride (NvS16) source stride in bytes
+ @param pMonoBits (NvU8*) pointer to source bitmap
+ @param pSelectSrcTrans (NvU16*) pointer to source color key. If NULL no transparency.
+ @param rop3 (NvU8) raster operation code
+ @param pPatBuffer (NvU8*) pointer to pattern buffer
+ @param patFgColor (NvU32) pattern foreground color
+ @param patBgColor (NvU32) pattern background color
+ @param patW, patH (NvU32) width & height of pattern buffer
+ @param patStride (NvU32) pattern stride in bytes
+ @param pSelectPatTrans (NvU16*) pointer to pattern color key. If NULL no transparency.
+
+ Depending of pattern size, replicated mode is used or not.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+
+ @see GFGxCopyTransColorBitmap(), GFGxCopyTransMonoBitmap()
+*/
+GF_RETTYPE GFGxCopyTransMonoBitmapWithMonoPattern(GFGxHandle GxHandle,
+ NvS16 dx,
+ NvS16 dy,
+ NvS16 w,
+ NvS16 h,
+ NvS16 sx,
+ NvS16 sy,
+ NvU32 srcFgColor,
+ NvU32 srcBgColor,
+ NvS16 srcStride,
+ NvU8 *pMonoBits,
+ NvU16 *pSelectSrcTrans,
+ NvU8 rop3,
+ NvU8 *pPatBuffer,
+ NvU32 patFgColor,
+ NvU32 patBgColor,
+ NvU32 patW,
+ NvU32 patH,
+ NvU32 patStride,
+ NvU16 *pSelectPatTrans);
+/** This function copies a source bitmap from system memory to the video memory with a color
+ pattern buffer combination.
+ The source bitmap is mono (1BPP).
+ Mono source and color pattern transparencies are supported.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+ @param dx,dy (NvS16) left-top corner of destination rectangle
+ @param w,h (NvS16) width & height of the rectangle in pixels and scan lines
+ @param sx,sy (NvS16) left-top corner of source rectangle
+ @param srcFgColor (NvU32) source foreground color
+ @param srcBgColor (NvU32) source background color
+ @param srcStride (NvS16) source stride in bytes
+ @param pMonoBits (NvU8*) pointer to source bitmap
+ @param pSelectSrcTrans (NvU16*) pointer to source color key. If NULL no transparency.
+ @param rop3 (NvU8) raster operation code
+ @param pPatBuffer (NvU8*) pointer to pattern buffer
+ @param patW, patH (NvU32) width & height of pattern buffer
+ @param patStride (NvU32) pattern stride in bytes
+ @param pPatColorKey (NvU32*) pointer to pattern color key. If NULL no transparency.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+
+ @see GFGxCopyTransMonoBitmap(), GFGxCopyTransMonoBitmapWithMonoPattern()
+*/
+GF_RETTYPE GFGxCopyTransMonoBitmapWithColorPattern(GFGxHandle GxHandle,
+ NvS16 dx,
+ NvS16 dy,
+ NvS16 w,
+ NvS16 h,
+ NvS16 sx,
+ NvS16 sy,
+ NvU32 srcFgColor,
+ NvU32 srcBgColor,
+ NvS16 srcStride,
+ NvU8 *pMonoBits,
+ NvU16 *pSelectSrcTrans,
+ NvU8 rop3,
+ NvU8 *pPatBuffer,
+ NvU32 patW,
+ NvU32 patH,
+ NvU32 patStride,
+ NvU32 *pPatColorKey);
+
+/** This function purges the graphics cache used to store pattern buffers when
+ GFGX_BLT_PAT_CACHE is used.
+
+ @param GxHandle (#GFGxHandle) Handle to GFGxAPI
+
+ @retval #GF_SUCCESS Success
+ @retval #GFGX_ERROR_NULL_PARAMETER Invalid GxHandle
+
+ @see GFGxBlt()
+*/
+GF_RETTYPE GFGxCachePurge(GFGxHandle GxHandle);
+
+// Typesafe functions for opening and closing this component
+GF_RETTYPE GFGxOpen(GFRmHandle hRm, GFGxHandle *phGx,
+ GF_STATE_TYPE state, GFRmChHandle hCh);
+void GFGxClose(GFGxHandle *phGx);
+
+/*@}*/
+/*@}*/
+
+#ifdef __cplusplus
+}
+#endif
+
+/** @page pageGxAppNotes GxAPI Application Notes
+
+ @section pageGxAppNotes1 Todo
+
+*/
+
+#endif // _GFGx_H_
diff --git a/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFGxError.h b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFGxError.h
new file mode 100755
index 00000000..64e84624
--- /dev/null
+++ b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFGxError.h
@@ -0,0 +1,46 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/*
+ * File: GFGxError.h
+ * GFSDK Gx Graphics API header file.
+ */
+
+#ifndef __GFGXERROR_H__
+#define __GFGXERROR_H__
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+/** GFGxAPI error code: Bad parameter. */
+#define GFGX_ERROR_ILLEGAL_PARAMETER (GFGX_ERROR | 0x00000001L)
+#define GFGX_ERROR_NULL_SURFACE (GFGX_ERROR | 0x00000002L)
+/** GFGxAPI error code: Color depth not supported. */
+#define GFGX_ERROR_COLORDEPTH_NOT_SUPPORTED (GFGX_ERROR | 0x00000003L)
+#define GFGX_ERROR_ILLEGAL_ALPHA_MODE (GFGX_ERROR | 0x00000004L)
+#define GFGX_ERROR_ILLEGAL_ROTATION_FLAG (GFGX_ERROR | 0x00000005L)
+#define GFGX_ERROR_GETTING_COMPONENT (GFGX_ERROR | 0x00000006L)
+#define GFGX_ERROR_NO_PRIMARY_SURFACE (GFGX_ERROR | 0x00000007L)
+#define GFGX_ERROR_NO_COLORCONVERT_SUPPORT (GFGX_ERROR | 0x00000008L)
+#define GFGX_ERROR_NULL_PARAMETER (GFGX_ERROR | 0x00000009L)
+/** GFGxAPI error code: Function not supported. */
+#define GFGX_ERROR_NOT_SUPPORTED (GFGX_ERROR | 0x0000000AL)
+
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // __GFGXERROR_H__
+
+
+
diff --git a/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFI2C.h b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFI2C.h
new file mode 100755
index 00000000..458a21c0
--- /dev/null
+++ b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFI2C.h
@@ -0,0 +1,314 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/** @file GFI2C.h
+ GFSDK I2C API header file.
+*/
+
+#ifndef __I2C_H__
+#define __I2C_H__
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+/** @addtogroup groupI2C I2CAPI I2C API
+*/
+/*@{*/
+
+/** GFI2C Error code: Function was passed an illegal parameter. */
+#define GFI2C_ERROR_ILLEGAL_PARAMETER (GFI2C_ERROR | 0x00000001L)
+/** GFI2C Error code: I2C slave device did not respond with ack signal. */
+#define GFI2C_ERROR_ACKNOWLEDGE_FAILURE (GFI2C_ERROR | 0x00000002L)
+/** GFI2C Error code: Polling routine generated a timeout error. */
+#define GFI2C_ERROR_TIMEOUT_ERROR (GFI2C_ERROR | 0x00000003L)
+
+/** Enum specifies attribute ids for GFI2CSetAttribute()
+ @see GFI2CSetAttribute()
+*/
+typedef enum _GFI2CATTRIBUTES
+{
+ GFI2C_ATTR_PULLUP, /**< Set internal I2C pullups, see GFI2C_ATTR_PULLUP_FLAGS. */
+ GFI2C_ATTR_SW, /**< Set to use GPIO for SW I2C */
+ GFI2C_ATTR_HW, /**< Set to use HW I2C (default) */
+ GFI2C_ATTR_TIMING, /**< I2C timing mode, valid for GFI2C_ATTR_HW mode only, see GFI2C_TIMING */
+ GFI2C_ATTR_RESPTIMEOUT /**< Set I2C Ack response timeout in ms */
+
+} GFI2CATTRIBUTES;
+
+/** Flag bits for for GFI2C_ATTR_PULLUP attribute.
+
+ Usage example:
+
+ attr = (SP_SCL_PULLUP_DISABLE | SP_SDA_PULLUP_DISABLE)
+ GFI2CSetAttribute(I2CHandle, GFI2C_ATTR_PULLUP, attr)
+
+
+ @see GFI2CSetAttribute(), GFI2CATTRIBUTES
+*/
+typedef enum _GFI2C_ATTR_PULLUP_FLAGS
+{
+ SDA_PULLDOWN_DISABLE = 0, //!< Flag to disable I2C data pull down
+ SDA_PULLDOWN_ENABLE = 1, //!< Flag to enable I2C data pull down
+ SDA_PULLUP_DISABLE = 0, //!< Flag to disable I2C data pull up
+ SDA_PULLUP_ENABLE = 1, //!< Flag to enable I2C data pull up
+ SCL_PULLDOWN_DISABLE = 0, //!< Flag to disable I2C clock pull down
+ SCL_PULLDOWN_ENABLE = 1, //!< Flag to enable I2C clock pull down
+ SCL_PULLUP_DISABLE = 0, //!< Flag to disable I2C data pull up
+ SCL_PULLUP_ENABLE = 0, //!< Flag to enable I2C clock pull up
+ SCL_DEFAULT = 0, //!< Flag sets I2C clock back to default
+ SDA_DEFAULT = 0 //!< Flag sets I2C data back to default
+
+} GFI2C_ATTR_PULLUP_FLAGS;
+
+/** Timing modes for GFI2C_ATTR_TIMING attribute.
+
+ The timing mode has effect for I2C HW mode (GFI2C_ATTR_HW) only.
+
+ It affects the programming of IC_IC_CONFIG_0/THDCTL and
+ IC_TCOMMAND_0/SPEED_CTL registers.
+*/
+typedef enum _GFI2C_TIMING
+{
+ /** Standard timing (default).
+ IC_TCOMMAND_0, SPEED_CTL is programmed to STD_MODE (standard timing).
+ */
+ GFI2C_TIMING_STANDARD = 0,
+
+ /** Fast mode with 2 clocks extended hold time.
+ IC_TCOMMAND_0, SPEED_CTL is programmed to FAST_MODE.
+ IC_IC_CONFIG_0, THDCTL is programmed to b'10 (add 2 clocks to hold time).
+ */
+ GFI2C_TIMING_FASTADD2CLK
+
+} GFI2C_TIMING;
+
+typedef struct _GFI2CTABLE
+{
+ GF_RETTYPE (* I2CWrite)( GFI2CHandle I2CHandle,
+ NvU32 slaveAddr,
+ NvU8 *pDataBytes,
+ NvU32 len,
+ NvU32 delayInMSec );
+
+ GF_RETTYPE (* I2CRead)( GFI2CHandle I2CHandle,
+ NvU32 slaveAddr,
+ NvU8 *pDataBytes,
+ NvU32 len,
+ NvU32 delayInMSec );
+
+ GF_RETTYPE (* I2CRestartRead)( GFI2CHandle I2CHandle,
+ NvU32 slaveAddr,
+ NvU32 index,
+ NvU8 *pDataBytes,
+ NvU32 len,
+ NvU32 delayInMSec );
+
+ GF_RETTYPE (* I2CScan)( GFI2CHandle I2CHandle,
+ NvU16 slaveAddr );
+
+ GF_RETTYPE (* I2CPowerSwitch)( GFI2CHandle I2CHandle, NvU8 status);
+
+ GF_RETTYPE (* I2CGetProperty)( GFI2CHandle I2CHandle,
+ PGFPROPERTY pI2CProp );
+
+ GF_RETTYPE (* I2CSetAttribute)(GFI2CHandle I2CHandle, NvU32 aid, NvU32 attr);
+ GF_RETTYPE (* I2CSetClock)( GFI2CHandle I2CHandle, NvU32 selectclock);
+ GF_RETTYPE (* I2CWritePrepare)( GFI2CHandle I2CHandle,
+ NvU32 slaveAddr,
+ NvU32 *pData,
+ NvU32 len,
+ NvU32 *pBuffer,
+ NvU32 *bufferSize);
+ GF_RETTYPE (* I2CRestartWrite)( GFI2CHandle I2CHandle,
+ NvU32 slaveAddr1,
+ NvU8 *pIndexBytes,
+ NvU32 lenIndex,
+ NvU32 slaveAddr2,
+ NvU8 *pDataBytes,
+ NvU32 lenData,
+ NvU32 delayInMSec );
+
+} GFI2CTABLE, *PGFI2CTABLE;
+
+/** Open GFI2C component.
+ @param hRm RM handle
+ @param phI2C Returns I2C component handle on success
+ @param state Channel allocation mode
+ @param hCh Channel to use, or NULL to allocate new
+*/
+GF_RETTYPE GFI2COpen(GFRmHandle hRm, GFI2CHandle *phI2C, GF_STATE_TYPE state, GFRmChHandle hCh);
+
+/** Close GFi@c component.
+ @param phI2C I2C component handle, will be reset to NULL. Can be NULL.
+*/
+void GFI2CClose(GFI2CHandle *phI2C);
+
+/** This routine writes out len bytes of data during one I2C transfer.
+
+ @param I2CHandle (#GFI2CHandle) Handle to I2CAPI
+ @param slaveAddr (NvU32) I2C address of slave device
+ @param pDataBytes (NvU8) Pointer to data bytes to be written
+ @param len (NvU32) Number of bytes of data to be written
+ @param delayInMSec (NvU32) Optional delay inserted after transfer
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+*/
+#define GFI2CWrite(I2CHandle, slaveAddr, pDataBytes, len, delayInMSec) \
+ ((PGFI2CTABLE)I2CHandle)->I2CWrite(I2CHandle, slaveAddr, pDataBytes, len, delayInMSec)
+
+/** This routine reads len bytes of data during one I2C transfer. A typical I2C slave
+ device requires its address already be set by a preceding GFI2CWrite() function.
+ These functions should be executed together with no other activity in between.
+
+ @param I2CHandle (#GFI2CHandle) Handle to I2CAPI
+ @param slaveAddr (NvU32) I2C address of slave device
+ @param pDataBytes (NvU8) Pointer to data bytes read from device
+ @param len (NvU32) Number of bytes of data to be read
+ @param delayInMSec (NvU32) Optional delay inserted after transfer
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+*/
+#define GFI2CRead(I2CHandle, slaveAddr, pDataBytes, len, delayInMSec) \
+ ((PGFI2CTABLE)I2CHandle)->I2CRead(I2CHandle, slaveAddr, pDataBytes, len, delayInMSec)
+
+/** This function reads in len or fewer bytes of data from an I2C slave device. It differs
+ from the GFI2CRead() function in that it does so with a combination of an I2C write and
+ read. There is an I2C write of the slave address and index byte then followed by a START
+ condition. There is no STOP condition in-between the write and read transactions.
+
+ @param I2CHandle (#GFI2CHandle) Handle to I2CAPI
+ @param slaveAddr (NvU32) I2C address of slave device
+ @param index (NvU32) 2nd byte index of slave device register
+ @param pDataBytes (NvU8) Pointer to data bytes read from device
+ @param len (NvU32) Number of bytes of data to be read
+ @param delayInMSec (NvU32) Optional delay inserted after transfer
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+*/
+#define GFI2CRestartRead(I2CHandle, slaveAddr, index, pDataBytes, len, delayInMSec) \
+ ((PGFI2CTABLE)I2CHandle)->I2CRestartRead(I2CHandle, slaveAddr, index, pDataBytes, len, delayInMSec)
+
+/** This routine writes out a I2C slave address and checks for an ACK.
+
+ @param I2CHandle (#GFI2CHandle) Handle to I2CAPI
+ @param slaveAddr (NvU32) I2C address of slave device
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+*/
+#define GFI2CScan(I2CHandle, slaveAddr) \
+ ((PGFI2CTABLE)I2CHandle)->I2CScan(I2CHandle, slaveAddr)
+
+/** This function has been replaced by camera scripting. Camera power is now
+ controlled by a function in the camera scripts.
+*/
+#define GFI2CPowerSwitch(I2CHandle, status) \
+ ((PGFI2CTABLE)I2CHandle)->I2CPowerSwitch(I2CHandle, status)
+
+/** This routine sets various I2C attributes. The aid parameter passes an
+ enumeration GFI2CATTRIBUTES that selects the attribute operation. Each
+ attribute has a set of defined values passed in the parameter attr, that
+ it will operate on.
+
+ @param I2CHandle (#GFI2CHandle) Handle to I2CAPI
+ @param aid (NvU32) attribute flag
+ @param attr (NvU32) attribute data value
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ @see GFI2CATTRIBUTES
+
+*/
+#define GFI2CSetAttribute( I2CHandle, aid, attr) \
+ ((PGFI2CTABLE)I2CHandle)->I2CSetAttribute(I2CHandle, aid, attr )
+
+/** This routine sets the I2C clock output on the SCL pin. The parameter
+ selectclock specifies the new I2C clock in kilohertz. The default
+ is 100. If selectclock = 0, then the default will be set.
+
+ @param I2CHandle (#GFI2CHandle) Handle to I2CAPI
+ @param selectclock (NvU32) new clock value in kHz.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+*/
+#define GFI2CSetClock(I2CHandle, selectclock) \
+ ((PGFI2CTABLE)I2CHandle)->I2CSetClock(I2CHandle, selectclock)
+
+/** This routine Provide properties about I2C.
+
+ @param I2CHandle (#GFI2CHandle) Handle to I2CAPI
+ @param pProp (GFPROPERTY) pointer to GFPROPERTY struct.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+*/
+#define GFI2CGetProperty(I2CHandle, pProp) \
+ ((PGFI2CTABLE)I2CHandle)->I2CGetProperty(I2CHandle, pProp)
+
+/** This function prepares a buffer that contains the command sequence for an
+ I2C write. This may concatenated onto another command sequence and written
+ to the channel as a combination of two transactions.
+
+ @param I2CHandle (#GFI2CHandle) Handle to I2CAPI
+ @param slaveAddr (NvU32) I2C address of slave device
+ @param pData (NvU8) Pointer to data bytes to be written
+ @param len (NvU32) Number of bytes of data to be read
+ @param pBuffer (NvU8) Pointer to command sequence for I2C write
+ @param bufferSize (NvU32) Number of commands returned
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+*/
+#define GFI2CWritePrepare(I2CHandle, slaveAddr, pData, len, pBuffer, bufferSize) \
+ ((PGFI2CTABLE)I2CHandle)->I2CWritePrepare(I2CHandle, slaveAddr, pData, len, pBuffer, bufferSize)
+
+/** This function writes lenData bytes of data to an I2C slave device. It differs
+ from the GFI2CWrite() function in that it does so with a combination of two I2C writes
+ There is an I2C write of the slave address and index bytes then followed by a START
+ condition. There is no STOP condition in-between the write and write transactions.
+
+ @param I2CHandle (#GFI2CHandle) Handle to I2CAPI
+ @param slaveAddr1 (NvU32) I2C address of 1st slave device
+ @param pDataIndex (NvU8) Pointer to index data to be written to the 1st device
+ @param lenIndex (NvU32) index data length
+ @param slaveAddr2 (NvU32) I2C address of 2nd slave device
+ @param pDataBytes (NvU8) Pointer to data bytes written to 2nd device
+ @param lenData (NvU32) Number of bytes of data to be read
+ @param delayInMSec (NvU32) Optional delay inserted after transfer
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+*/
+#define GFI2CRestartWrite(I2CHandle, slaveAddr1, pIndexBytes, lenIndex, \
+ slaveAddr2, pDataBytes, lenData, delayInMSec) \
+ ((PGFI2CTABLE)I2CHandle)->I2CRestartWrite(I2CHandle, slaveAddr1, pIndexBytes, lenIndex, \
+ slaveAddr2, pDataBytes, lenData, delayInMSec)
+
+/*@}*/
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __I2C_H__ */
+
diff --git a/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFI2S.h b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFI2S.h
new file mode 100755
index 00000000..bbfd876e
--- /dev/null
+++ b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFI2S.h
@@ -0,0 +1,49 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/*
+* File: GFi2s.h
+* I2S header file.
+*/
+
+
+#ifndef __I2S_H__
+#define __I2S_H__
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+// Typesafe functions for opening and closing this component
+GF_RETTYPE GFI2SOpen(GFRmHandle hRm, GFI2SHandle *phI2S,
+ GF_STATE_TYPE state, GFRmChHandle hCh);
+void GFI2SClose(GFI2SHandle *phI2S);
+
+GF_RETTYPE GFI2SSetTransmitBuffer(GFI2SHandle I2SHandle,
+ NvU32 startAddr,
+ NvU32 sizeBytes,
+ NvU32 numBuffers);
+
+GF_RETTYPE GFI2SSetTransmitState(GFI2SHandle I2SHandle,
+ NvU32 state);
+
+GF_RETTYPE GFI2SSetReceiveBuffer(GFI2SHandle I2SHandle,
+ NvU32 startAddr,
+ NvU32 sizeBytes,
+ NvU32 numBuffers);
+
+GF_RETTYPE GFI2SSetReceiveState(GFI2SHandle I2SHandle,
+ NvU32 state);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __I2S_H__ */
diff --git a/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFINTx.h b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFINTx.h
new file mode 100755
index 00000000..2b45eb76
--- /dev/null
+++ b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFINTx.h
@@ -0,0 +1,114 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/** @file GFINTx.h
+ GFSDK Interrupt API header file.
+*/
+
+#ifndef __GFINTx_H__
+#define __GFINTx_H__
+
+#include "GFRmOEM.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+/** @addtogroup groupINTx INTxAPI Interrupt API
+*/
+/*@{*/
+
+#define GF_INTR_START 0
+#define GF_INTR_END 15
+
+/* Embedded memory controller interrupt */
+#define GF_EMC_INTR (15)
+
+/* MC interrupt. */
+#define GF_MC_INTR (14)
+
+/* SD interrupt. */
+#define GF_SD_INTR (13)
+
+/* I2C interrupt. */
+#define GF_IC_INTR (12)
+
+/* I2s interrupt. */
+#define GF_I2S_INTR (11)
+
+/* Display interrupt. */
+#define GF_DISPLAY_INTR (10)
+
+/* 3d interrupt. */
+#define GF_GR3D_INTR (9)
+
+/* 2d interrupt. */
+#define GF_GR2D_INTR (8)
+
+/* DSP interrupt. */
+#define GF_DSP_INTR (7)
+
+/* ISP interrupt. */
+#define GF_ISP_INTR (6)
+
+/* SDGP1 input falling edge interrupt. */
+#define GF_EPP_INTR (5)
+
+/* VI interrupt. */
+#define GF_VI_INTR (4)
+
+/* JPEG Encoder interrupt. */
+#define GF_JPEGE_INTR (3)
+
+/* Mpeg Encoder interrupt. */
+#define GF_ME_INTR (2)
+
+/* Graphics MPD interrupt. */
+#define GF_GRMPD_INTR (1)
+
+/* Host interface interrupt. */
+#define GF_HOST_INTR (0)
+
+// Typesafe functions for opening and closing this component
+GF_RETTYPE GFINTxOpen(GFRmHandle hRm, GFINTxHandle *phINTx,
+ GF_STATE_TYPE state, GFRmChHandle hCh);
+void GFINTxClose(GFINTxHandle *phINTx);
+
+/* ### Helper Macros ### */
+GF_RETTYPE GFINTxGetProperty(GFINTxHandle INTxHandle,
+ PGFPROPERTY pINTxProp);
+
+
+GF_RETTYPE GFINTxDisable(GFINTxHandle INTxHandle,
+ NvU32 idInt);
+
+GF_RETTYPE GFINTxEnable(GFINTxHandle INTxHandle,
+ NvU32 idInt);
+
+/** Wait for system level interrupt request.
+ @param handle Handle to INTx API
+ @param idInt System level interrupt ID
+ @param timeout Timeout in miliseconds, or 0 to wait endlessly
+ @retval GF_SUCCESS Interrupt request received
+ @retval GF_WAIT_TIME_OUT Timeout without interrupt request received
+*/
+GF_RETTYPE GFINTxWaitForIRQ(GFINTxHandle INTxHandle,
+ NvU32 idInt,
+ NvU32 timeout);
+
+/*@}*/
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // __GFINTx_H__
+/* End of file. */
+
diff --git a/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFIsp.h b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFIsp.h
new file mode 100755
index 00000000..b3c7e512
--- /dev/null
+++ b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFIsp.h
@@ -0,0 +1,1654 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/** @file GFIsp.h
+ GFSDK Image Signal Processing API header file.
+*/
+
+#ifndef _GF_ISP__
+#define _GF_ISP__
+
+//#define DVS_DEVELOPMENT
+
+#include "GFCamera.h"
+#include "GFVx.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+/** @addtogroup groupIsp IspAPI Image Signal Processing API
+
+ As image resolution increases (three megapixels and up), image signal
+ processing inside the imager module becomes complex and costly, and the
+ required bandwidth to transfer processed data to the GPU increases.
+
+ One solution to this problem is to incorporate image signal processing (ISP1)
+ capabilities inside the GPU, and let the imager send raw Bayer Pattern Data
+ from the CMOS or CCD sensor to the GPU. This reduces bandwidth as ISP
+ programming is easier and much faster compared to having the ISP unit
+ inside the imager.
+
+ The ISP pipeline consists of various stages of image processing operations to
+ enhance the image so that its digital representation is as close to the natural
+ look as possible. The ISP pipeline consists of the following stages:
+ - Optical Black Compensation (OB)
+ - De-Knee Linearization
+ - Lens Shading Compensation
+ - White Balance Gain Adjustment (M1, M2, M3 statistics gathering)
+ - Bad Pixel Compensation
+ - Noise Reduction
+ - Demosaicing
+ - Edge Enhancement (M4 statistics gathering)
+ - Color Noise Reduction
+ - Color Correction
+ - Gamma Correction
+ - RGB to YUV conversion
+
+ Besides these pipeline stages, the ISP module also provides a statistics
+ collection mechanism that can be applied to multiple regions of the image.
+ Image statistics information can be used to compute Auto Exposure (AE),
+ Auto White Balance (AWB) and Auto Focus (AF).
+
+ The GFISPAPI sets up parameters for each pipeline functional block. If
+ needed, the user can also choose to bypass each individual functional block.
+ Once all blocks are set up, image data flows through them automatically.
+
+ Figure 1, "Block Diagram of the ISP Interface," shows the ISP with
+ respect to other input blocks such as video input (VI) and the encoder
+ preprocessor (EPP).
+
+ @image html ISPFigure1.bmp
+
+ Figure 2, "Internal ISP Data Flow," shows the data flow inside the
+ ISP.
+
+ @image html ISPFigure2.bmp
+
+*/
+/*@{*/
+
+/** @defgroup groupIspCapability ISP Capability Flags
+ These flags represent the various capabilities of the ISP.
+ @see GFISPPROPERTY
+*/
+/*@{*/
+
+/** IspAPI property flag: Bayer format input supported.
+ @see GFISPGetProperty()
+*/
+#define GFISP_CAP_FORMAT_BAYER 0x00000001
+
+/** IspAPI property flag: Stacked format input supported.
+ @see GFISPGetProperty()
+*/
+#define GFISP_CAP_FORMAT_STACKED 0x00000002
+
+/** IspAPI property flag: Three optical black regions supported.
+ @see GFISPGetProperty(), GFISPOBCONTROL
+*/
+#define GFISP_CAP_THREE_OB_REGIONS 0x00000004
+
+/** IspAPI property flag: Four optical black regions supported.
+ @see GFISPGetProperty(), GFISPOBCONTROL
+*/
+#define GFISP_CAP_FOUR_OB_REGIONS 0x00000008
+
+/** IspAPI property flag: Frame-based optical black supported.
+ @see GFISPGetProperty(), GFISPOBCONTROL
+*/
+#define GFISP_CAP_FRAME_OB 0x00000010
+
+/** IspAPI property flag: Line-based optical black supported.
+ @see GFISPGetProperty(), GFISPOBCONTROL
+*/
+#define GFISP_CAP_LINE_OB 0x00000020
+
+/** IspAPI property flag: Column-based optical black supported.
+ @see GFISPGetProperty()
+*/
+#define GFISP_CAP_COLUMN_OB 0x00000040
+
+/** IspAPI property flag: Deknee (input linearization) supported.
+ @see GFISPGetProperty(), GFISPDEKNEECONTROL
+*/
+#define GFISP_CAP_DE_KNEE 0x00000100
+
+/** IspAPI property flag: Lens shading supported.
+ @see GFISPGetProperty(), GFISPLENSSHADING
+*/
+#define GFISP_CAP_LENSSHADING 0x00000200
+
+/** IspAPI property flag: White balance supported.
+ @see GFISPGetProperty(), GFISPWBCONTROL
+*/
+#define GFISP_CAP_WB 0x00000400
+
+/** IspAPI property flag: Demosaic supported.
+ @see GFISPGetProperty(), GFISPDEMOSAICCONTROL
+*/
+#define GFISP_CAP_DEMOSIAC 0x00000800
+
+/** IspAPI property flag: Edge enhancement supported.
+ @see GFISPGetProperty(), GFISPEDGEENHANCECONTROL
+*/
+#define GFISP_CAP_EDGEENHANCE 0x00001000
+
+/** IspAPI property flag: Bad pixel concealment supported.
+ @see GFISPGetProperty(), GFISPBADPIXELCONTROL
+*/
+#define GFISP_CAP_BADPIXEL 0x00002000
+
+/** IspAPI property flag: Noise reduction supported.
+ @see GFISPGetProperty(), GFISPNOISECONTROL1
+*/
+#define GFISP_CAP_NOISEREDUCTION1 0x00004000
+
+/** IspAPI property flag: Color noise reduction supported.
+ @see GFISPGetProperty(), GFISPNOISECONTROL2
+*/
+#define GFISP_CAP_NOISEREDUCTION2 0x00008000
+
+/** IspAPI property flag: Color correction supported.
+ @see GFISPGetProperty(), GFISPCOLORCORRECTION
+*/
+#define GFISP_CAP_COLORCORRECTION 0x00100000
+
+/** IspAPI property flag: Gamma correction supported.
+ @see GFISPGetProperty(), GFISPGAMMACONTROL
+*/
+#define GFISP_CAP_GAMMACORRECTION 0x00200000
+
+/** IspAPI property flag: YUV conversion supported.
+ @see GFISPGetProperty(), GFISPYUVCONVERSION
+*/
+#define GFISP_CAP_YUVCONVERSION 0x00400000
+
+/** IspAPI property flag: M1 window statistics supported.
+ @see GFISPGetProperty(), GFISPM1WINDOW
+*/
+#define GFISP_CAP_M1 0x01000000
+
+/** IspAPI property flag: M2 window statistics supported.
+ @see GFISPGetProperty(), GFISPM2WINDOW
+*/
+#define GFISP_CAP_M2 0x02000000
+
+/** IspAPI property flag: M3 window statistics supported.
+ @see GFISPGetProperty(), GFISPM3WINDOW
+*/
+#define GFISP_CAP_M3 0x04000000
+
+/** IspAPI property flag: M4 window statistics supported.
+ @see GFISPGetProperty(), GFISPM4WINDOW
+*/
+#define GFISP_CAP_M4 0x08000000
+
+/** IspAPI property flag: Negative effect supported.
+ @see GFISPGetProperty()
+*/
+#define GFISP_CAP_NEGATIVEEFFECT 0x80000000
+/*@}*/
+
+//#define MANUAL_ENABLE_WAIT_FOR_OUTPUT_END 1
+
+/** Struct for ISP version and capabilities.
+ @see GFISPGetProperty
+*/
+typedef struct _GFISPPROPERTY
+{
+ NvU32 size; /**< Actual size of GFISPPROPERTY data structure. */
+ NvU32 version; /**< Version of GFISPAPI. */
+
+ NvU32 cap; /**< Combination of @ref groupIspCapability. Each bit corresponds to one ISP capability. */
+ NvU32 maxWidth, /**< Maximum supported image width. */
+ maxHeight; /**< Maximum image height. */
+ NvU32 supportedScriptVersion; /**< Version of script supported by ISP API. Incorrect script version may cause some API calls to fail. */
+} GFISPPROPERTY, *PGFISPPROPERTY;
+
+
+/** Definition of attribute ids for GFISPGetAttribute() and GFISPSetAttribute().
+*/
+typedef enum _GFISPATTRIBUTES {
+ GFISP_ATTR_ENABLE_ISP, /**< The master switch of ISP. 1 = Enable ISP processing, 0 = Disable */
+ GFISP_ATTR_ENABLE_OB, /**< The master switch for optical black. 1 = Enable OB, 0 = Disable */
+ GFISP_ATTR_ENABLE_SENSOR_MANUAL_OB, /**< The master switch for SENSOR Manual optical black. 1 = Enable OB, 0 = Disable */
+ GFISP_ATTR_ENABLE_SENSOR_AUTO_OB, /**< The master switch for SENSOR Auto optical black. 1 = Enable OB, 0 = Disable */
+ GFISP_ATTR_ENABLE_FOB, /**< Switch for frame based optical black. 1 = Enable frame based optical black, 0 = Disable */
+ GFISP_ATTR_ENABLE_FOB_SELFRESET, /**< Switch for self-reset for frame based optical black. 1 = Enable (reset every frame), 0 = Disable */
+ GFISP_ATTR_ENABLE_FOB_TEMPORAL, /**< Switch for temporal filtering for frame based optical black. 1 = Enable temporal filtering, 0 = Disable */
+ GFISP_ATTR_ENABLE_LOB, /**< Switch for line based optical black. 1 = Enable line based OB, 0 = Disable */
+ GFISP_ATTR_ENABLE_DEKNEE, /**< Switch for deknee. 1 = Enable deknee, 0 = Disable */
+ GFISP_ATTR_ENABLE_LENS_SHADING, /**< Switch for lens shading correction. 1 = Enable lens shading correction, 0 = Disable */
+ GFISP_ATTR_ENABLE_WB, /**< The master switch for white balance. 1 = Enable white balance, 0 = Disable */
+ GFISP_ATTR_ENABLE_AWB, /**< Switch for built-in automatic white balance. 1 = Automatic/dynamic (real-time) white balance, 0 = Preprogrammed mode white balance */
+ GFISP_ATTR_AWB_HOLD, /**< Switch to pause automatic white balance. Only effective when GFISP_ATTR_ENABLE_AWB=1. 1 = Start applying current AWB gain value to all future frames, 0 = Restore normal AWB mode */
+ GFISP_ATTR_ENABLE_DEMOSAIC, /**< Switch for demosaic processing. 1 = Enable demosaic processing, 0 = Disable */
+ GFISP_ATTR_ENABLE_EDGE_ENHANCE, /**< Switch for edge enhancement. 1 = Enable edge enhancement, 0 = Disable */
+ GFISP_ATTR_ENABLE_NOISE_CONTROL1, /**< Switch for noise control 1. Noise control method 1 is built in the demosaic unit. 1 = Enable noise control 1, 0 = Disable */
+ GFISP_ATTR_ENABLE_BAD_PIXEL, /**< Switch for bad pixel concealment. 1 = Enable bad pixel detection and concealment, 0 = Disable */
+ GFISP_ATTR_ENABLE_COLOR_CORRECTION, /**< Switch for color correction. 1 = Enable color correction, 0 = Disable */
+ GFISP_ATTR_ENABLE_NOISE_CONTROL2, /**< Switch for noise control 2. Noise control method 2 is built in the color correction unit. 1 = Enable noise control 2, 0 = Disable */
+ GFISP_ATTR_ENABLE_GAMMA_CORRECTION, /**< Switch for gamma correction. 1 = Enable gamma correction, 0 = Disable */
+ GFISP_ATTR_ENABLE_YUV_CONVERSION, /**< Switch for RGB to YUV conversion. 1 = Enable RGB-YUV conversion, 0 = Disable */
+ GFISP_ATTR_ENABLE_NEGATIVE_EFFECT, /**< Switch for negative effect. 1 = Negate whole output image, 0 = Normal image */
+ GFISP_ATTR_ENABLE_M2, /**< Switch for M2 statistics. 1 = Enable M2 statistics gathering, 0 = Disable */
+ GFISP_ATTR_ENABLE_M3, /**< Switch for M3 statistics. 1 = Enable M3 statistics gathering, 0 = Disable */
+ GFISP_ATTR_ENABLE_M4, /**< Switch for M4 statistics. 1 = Enable M4 statistics gathering, 0 = Disable */
+ GFISP_ATTR_ENABLE_STATS_RAISE, /**< Switch for statistics raise. 1 = Generate raise vector when statistics gathering is complete, 0 = Disable */
+ GFISP_ATTR_ENABLE_STATS_INT, /**< Switch for statistics interrupt. 1 = Generate interrupt when statistics gathering is complete, 0 = Disable */
+ GFISP_ATTR_STATS_LINE_END, /**< The line at which statistics gathering is complete. When the line counter reaches STATS_LINE_END, the raise vector and/or interrupt are generated (if enabled). */
+#ifdef MANUAL_ENABLE_WAIT_FOR_OUTPUT_END
+ GFISP_ATTR_ENABLE_WAIT_FOR_OUTPUT_END, /**< Temporary used to enable wait for OUTPUT_END. 1 = Wait for output end, 0 = Disable */
+#endif
+ /* Special effects */
+ GFISP_ATTR_ENABLE_EMBOSS, /**< Switch for emboss special effect. 1 = Enable emboss special effect, 0 = Disable */
+ GFISP_ATTR_ENABLE_SOLARIZE, /**< Switch for solarize special effect. 1 = Enable solarize special effect, 0 = Disable */
+ GFISP_ATTR_ENABLE_SEPIA, /**< Switch for sepia special effect. 1 = Enable sepia special effect, 0 = Disable */
+ GFISP_ATTR_ENABLE_MONOCHROME, /**< Switch for monochrome special effect. 1 = Enable monochrome special effect, 0 = Disable */
+ /* Video settings */
+ GFISP_ATTR_CONTRAST, /**< Contrast control. Acts as offset for Y data. Range is [0, 128]. */
+ GFISP_ATTR_BRIGHTNESS, /**< Brightness control. Modifies slope of Y data. Range is [0, 256]. */
+ GFISP_ATTR_HUE, /**< Hue control. Modifies slope of UV data. Range is [0, 128]. */
+ GFISP_ATTR_SATURATION_U, /**< Hue control. Modifies slope of UV data. Range is [0, 256]. */
+ GFISP_ATTR_SATURATION_V, /**< Hue control. Modifies slope of UV data. Range is [0, 256]. */
+ /* Software 3A control */
+ GFISP_ATTR_ENABLE_3A_AE, /**< Switch for software auto exposure. 1 = Enable auto exposure and disable sensor exposure, 0 = Disable */
+ GFISP_ATTR_ENABLE_3A_AWB, /**< Switch for software auto white balance. 1 = Enable auto white balance and disable sensor exposure, 0 = Disable */
+ GFISP_ATTR_ENABLE_3A_AF, /**< Switch for software auto focus. 1 = Enable auto focus and disable sensor auto focus, 0 = Disable */
+
+ GFISP_ATTR_ENABLE_SENSOR_AE, /**< Switch for sensor auto exposure. 1 = Enable sensor auto exposure and disable software expoture, 0 = Disable */
+ GFISP_ATTR_ENABLE_SENSOR_AWB, /**< Switch for sensor auto white balance. 1 = Enable sensor auto white balance and disable software white balance, 0 = Disable */
+ GFISP_ATTR_ENABLE_SENSOR_AF, /**< Switch for sensor auto focus. 1 = Enable sensor auto focus and disable software auto focus, 0 = Disable */
+ GFISP_ATTR_ENABLE_AUTO_CC_VIVIDITY /**< Flag for auto vividity. 1 = Enable auto vividity, 0 = Disable auto vividity*/
+} GFISPATTRIBUTES;
+
+
+/** Definition of parameter ids and data structures for #GFISPGetParameter and #GFISPSetParameter.
+*/
+typedef enum _GFISPPARAMETERS {
+ GFISP_PARA_TIMING, /**< Get/Set timing parameters. @see GFISPIMGTIMING */
+ GFISP_PARA_M1WINDOW, /**< Get/Set M1 statistics parameters. @see GFISPM1WINDOW */
+ GFISP_PARA_M2WINDOW, /**< Get/Set M2 statistics parameters. @see GFISPM2WINDOW */
+ GFISP_PARA_M3WINDOW, /**< Get/Set M3 statistics parameters. @see GFISPM3WINDOW */
+ GFISP_PARA_M4WINDOW, /**< Get/Set M4 statistics parameters. @see GFISPM4WINDOW */
+ GFISP_PARA_OB, /**< Get/Set optical black parameters. @see GFISPOBCONTROL */
+ GFISP_PARA_DEKNEE, /**< Get/Set deknee parameters. @see GFISPDEKNEECONTROL */
+ GFISP_PARA_LENSSHADING, /**< Get/Set lens shading parameters. @see GFISPLENSSHADING */
+ GFISP_PARA_WB, /**< Get/Set white balance parameters. @see GFISPWBCONTROL */
+ GFISP_PARA_DEMOSAIC, /**< Get/Set demosaic parameters. @see GFISPDEMOSAICCONTROL */
+ GFISP_PARA_EDGEENHANCE, /**< Get/Set edge enhancement parameters. @see GFISPEDGEENHANCECONTROL */
+ GFISP_PARA_NOISECONTROL1, /**< Get/Set noise control 1 parameters. @see GFISPNOISECONTROL1 */
+ GFISP_PARA_NOISECONTROL2, /**< Get/Set noise control 2 parameters. @see GFISPNOISECONTROL2 */
+ GFISP_PARA_BADPIXEL, /**< Get/Set bad pixel parameters. @see GFISPBADPIXELCONTROL */
+ GFISP_PARA_COLORCORRECT, /**< Get/Set color correction parameters. @see GFISPCOLORCORRECTION */
+ GFISP_PARA_GAMMACORRECT, /**< Get/Set gamma correction parameters. @see GFISPGAMMACONTROL */
+ GFISP_PARA_YUVCONVERT, /**< Get/Set YUV conversion parameters. @see GFISPYUVCONVERSION */
+ GFISP_PARA_SETMODE, /**< Get/Set ISP mode as specified in script. @see GFISPSETMODE */
+ GFISP_PARA_3A_AE, /**< Get/Set 3A AE parameters. @see GFISP3AAE */
+ GFISP_PARA_3A_AWB, /**< Get/Set 3A AWB parameters. @see GFISP3AAWB */
+ GFISP_PARA_3A_AF , /**< Get/Set 3A AF parameters. @see GFISP3AAF */
+ GFISP_PARA_3A_PREV_MODE_AWB,
+ GFISP_PARA_3A_AWB_SAT_Y_LIMITS,
+ GFISP_PARA_3A_FRAME_RATE_LOW_LIMIT,
+ GFISP_PARA_3A_FRAME_RATE_HIGH_LIMIT,
+ GFISP_PARA_3A_FRAME_RATE_CHOICE,
+ GFISP_PARA_ISO_SENSITIVITY, /**< Get/Set ISO Sensitivity for 3AAE. */
+ GFISP_PARA_REDUCE_GAIN_COMPRESS_GAMMA, /**< Reduce/Restore sensor gain and compensate gain change through Gamma curve Compression/Restoration.
+ To be used only with SetParameter fn. @see GFISPGAINGAMMACTRL */
+ GFISP_PARA_IMAGE_STABILIZATION, /**< Set Image Stabilization. 1 = Enable Image Stabilization, 0 = Disable */
+ GFISP_PARA_EXPOSURE_CONTROL, /**< Get/Set exposure control parameters. @see GFISPEXPOSURECONTROL */
+ GFISP_PARA_EXPOSURE, /**< Get/Set exposure manually. @see GFISPMANUALEXPOSURE */
+ GFISP_ISP_SENSOR_CAPABILITY, /**< ISP 3A Capability >*/
+ GFISP_PARA_SENSOR_REGISTER /**< SENSOR Register Read wrtie parameter>*/
+
+} GFISPPARAMETERS;
+
+/** Number of fractional bits of fixed point parameters.
+ All fixed point parameters are in u8.8 format or 2's complement
+ s7.8 format regardless of internal precision to simplify the
+ interface and keep it consistent across chip revisions.
+ Generic macros have been provided to convert to and
+ from floating point format on systems that support it. For
+ actual range and precision of individual parameters, see the
+ description of that parameter.
+*/
+#define GFISP_FIXEDPOINTPARAMETER_FBITS 8
+/** Total number of bits of fixed point parameters.
+ All fixed point parameters are in u8.8 format or 2's complement
+ s7.8 format regardless of internal precision to simplify the
+ interface and keep it consistent across chip revisions.
+ Generic macros have been provided to convert to and
+ from floating point format on systems that support it. For
+ actual range and precision of individual parameters, see the
+ description of that parameter.
+*/
+#define GFISP_FIXEDPOINTPARAMETER_BITS 16
+/** Macro to convert floating point to fixed point.
+ All fixed point parameters are in u8.8 format or 2's complement
+ s7.8 format regardless of internal precision to simplify the
+ interface and keep it consistent across chip revisions.
+ Generic macros have been provided to convert to and
+ from floating point format on systems that support it. For
+ actual range and precision of individual parameters, see the
+ description of that parameter.
+*/
+#define GFISP_CONVERT_FLOAT_TO_FIXED_SIGNED(x) ((NvS16)(x * (2 << GFISP_FIXEDPOINTPARAMETER_FBITS)))
+/** Macro to convert floating point to fixed point.
+ All fixed point parameters are in u8.8 format or 2's complement
+ s7.8 format regardless of internal precision to simplify the
+ interface and keep it consistent across chip revisions.
+ Generic macros have been provided to convert to and
+ from floating point format on systems that support it. For
+ actual range and precision of individual parameters, see the
+ description of that parameter.
+*/
+#define GFISP_CONVERT_FLOAT_TO_FIXED_UNSIGNED(x) ((NvU16)(x * (2 << GFISP_FIXEDPOINTPARAMETER_FBITS)))
+/** Macro to convert fixed point to floating point.
+ All fixed point parameters are in u8.8 format or 2's complement
+ s7.8 format regardless of internal precision to simplify the
+ interface and keep it consistent across chip revisions.
+ Generic macros have been provided to convert to and
+ from floating point format on systems that support it. For
+ actual range and precision of individual parameters, see the
+ description of that parameter.
+*/
+#define GFISP_CONVERT_FIXED_TO_FLOAT(x) (((float)x) / (2 << GFISP_FIXEDPOINTPARAMETER_FBITS))
+
+
+/** Enum for which pixel of the R, G, G, B pattern the active frame starts on.
+ @see GFISPIMGTIMING
+*/
+typedef enum
+{
+ GFISP_RGGB = 0,
+ GFISP_GRBG = 1,
+ GFISP_GBRG = 2,
+ GFISP_BGGR = 3
+} GFISP_BAYERPATTERN_SEL;
+
+/** Timing Generator Control.
+
+ Whole timing frame consists of scanned part and idle parts (void periods in between lines
+ and frames). Overall scanned image frame is specified by H_SCAN_SIZE and V_SCAN_SIZE which
+ includes H and V blank periods. Line and pixel counters are set to 1 at transitions of active
+ edge of V and H sync input pulses. Note that coordinate in the whole frame starts with
+ (1,1) instead of (0,0).
+
+ In horizotal direction, H sync active edge indicates start of scan line and it initiates
+ pixel count from 1 to H_SCAN_SIZE (end of line). After H_SCAN_SIZE pixels are received,
+ the ISP module goes into void period, in which it waits for next arrival of H sync active
+ edge. In practice, H blank period is composed of inactive period during H_SCAN SIZE and the
+ void period in between end of line and start next line.
+
+ Same applies to vertical direction.
+
+ Active part (non-blanking part) consists of "optical black" lines at top and bottom of the
+ image frame and left and right of image line, and active lines with active pixels in the
+ middle.
+
+ @see GFISPGetParameter, GFISPSetParameter
+*/
+typedef struct _GFISPIMGTIMING
+{
+ NvU16 hScanSize, /**< Number of pixel clock periods per scan line (including H blanking). */
+ vScanSize; /**< Number of line periods per scan frame (including V blanking). */
+ NvU8 hSyncEdge, /**< Active edge selection for horizontal sync. 0 = positive transition, 1 = negative transition. */
+ vSyncEdge; /**< Active edge selection for vertical sync. 0 = positive transition, 1 = negative transition. */
+ GFISP_BAYERPATTERN_SEL bayerSel; /**< Bayer timing format. Specifies which pixel of the R, G, G, B pattern the active frame starts on. */
+
+ GFRECT ActiveRect; /**< Active image area. */
+ GFRECT OutputRect; /**< Output image area. */
+} GFISPIMGTIMING, *PGFISPIMGTIMING;
+
+
+/** Enum for the number of samples to take across the M1 statistics window.
+ @see GFISPM1WINDOW
+*/
+typedef enum
+{
+ GFISP_M1SAMPLE32 = 0,
+ GFISP_M1SAMPLE64 = 1
+} GFISP_M1_SAMPLE_SEL;
+
+/** M1 statistics window control.
+
+ The GFISPAPI provides four methods that programmers can use to gather
+ statistics on pixel values. Based on the values, the programmer can take
+ appropriate compensating action as needed. The four methods are M1
+ Window, M2 Window, M3 Window, and M4 Window.
+
+ This structure describes the M1 Window method, which measures average/
+ peak pixel values inside the specified area. It returns eight valuesfour
+ values (RGGB) represent average pixels, and four values represent peak
+ pixels. The measurement result can be used for white balance, either
+ automatically by AWB or manually by the programmer.
+
+ Refer to the function #GFISPReadMWindowValues() for reading the
+ measured values.
+
+ @see GFISPGetParameter, GFISPSetParameter, GFISPReadMWindowValues
+*/
+typedef struct _GFISPM1WINDOW
+{
+ GFRECT M1WindowRect; /**< M1 Window size/position. */
+ GFISP_M1_SAMPLE_SEL horzSampSel, /**< Horizontal sample density. */
+ vertSampSel; /**< Vertical sample density. */
+ NvU16 PeakMax; /**< Maximum limit of peak detection. */
+ NvU16 TemporalFilterStrength; /**< Selects temporal filter coefficients. Valid range is [0-7]. Value 0 effectively turns off temporal filter. */
+} GFISPM1WINDOW, *PGFISPM1WINDOW;
+
+
+/** M2 statistics window control.
+
+ The GFISPAPI provides four methods that programmers can use to gather
+ statistics on pixel values. Based on the values, the programmer can take
+ appropriate compensating action as needed. The four methods are M1
+ Window, M2 Window, M3 Window, and M4 Window.
+
+ This structure describes the M2 Window method for gathering statistics on
+ pixel values. The M2 Window method measures the number of pixels at
+ specified ranges inside a specified area. A histogram with four bins is
+ generated.
+
+ Refer to the function #GFISPReadMWindowValues() for reading the
+ measured values.
+
+ @see GFISPGetParameter, GFISPSetParameter, GFISPReadMWindowValues, GFISP_ATTR_ENABLE_M2
+*/
+typedef struct _GFISPM2WINDOW
+{
+ GFRECT M2WindowRect; /**< M2 Window size/pos. */
+ NvU16 HistBinL1, /**< Cut point of 1st bin. */
+ HistBinL2, /**< Cut point of 2nd bin. */
+ HistBinL3; /**< Cut point of 3rd bin. */
+ NvU16 reserved;
+} GFISPM2WINDOW, *PGFISPM2WINDOW;
+
+
+/** M3 statistics window control.
+
+ The GFISPAPI provides four methods that programmers can use to gather
+ statistics on pixel values. Based on the values, the programmer can take
+ appropriate compensating action as needed. The four methods are M1
+ Window, M2 Window, M3 Window, and M4 Window.
+
+ This structure describes the M3 Window method for gathering statistics on
+ pixel values, The M3 Window method generates a group of pixel samples
+ from the specified area. Each sub-window generates one 32-bit value.
+
+ The horizontal interval of M3 sub-windows is derived from M3 window
+ line width divided by M3 window horizontal count, rounded down.
+
+ The vertical interval of M3 sub-windows is derived from M3 window
+ frame height divided by M3 window vertical count, rounded down.
+
+ Refer to the function #GFISPReadMWindowValues() for reading the
+ measured values.
+
+ @see GFISPGetParameter, GFISPSetParameter, GFISPReadMWindowValues, GFISP_ATTR_ENABLE_M3
+*/
+typedef struct _GFISPM3WINDOW
+{
+ GFRECT M3WindowRect; /**< M3 Window size/pos. */
+ NvU8 SubWindowCountH, /**< Number of sub-windows in horizontal direction. Can be {16,32,64}. */
+ SubWindowCountV; /**< Number of sub-windows in vertical direction. Can be {16,32,64}. */
+ NvU16 SubWindowWidth, /**< Width of sub-windows. Can be {2,4,8,16,32}. */
+ SubWindowHeight; /**< Height of sub-windows. Can be {2,4,8,16,32}. */
+ NvU16 reserved;
+} GFISPM3WINDOW, *PGFISPM3WINDOW;
+
+
+/** M4 statistics window control.
+
+ The GFISPAPI provides four methods that programmers can use to gather
+ statistics on pixel values. Based on the values, the programmer can take
+ appropriate compensating action as needed. The four methods are M1
+ Window, M2 Window, M3 Window, and M4 Window.
+
+ This structure describes the M4 Window method for gathering statistics on
+ pixel values. The M4 Window method takes statistical measurements for
+ auto-focus control. It generates two values for each sub-window. One value
+ represents the high frequency factor inside the sub-window. The other value
+ represents sub-window luminance.
+
+ There are {1, 2, 3, 4, 6, 9} sub-windows in {1,2,3}x{1,2,3} configurations.
+
+ SC15 implementation has the following constraints
+ * SubWindowintervalH >= SubWindowWidth
+ * SubWindowintervalV >= SubWindowHeight
+
+ Refer to the function #GFISPReadMWindowValues() for reading the
+ measured values.
+
+ @see GFISPGetParameter, GFISPSetParameter, GFISPReadMWindowValues, GFISP_ATTR_ENABLE_M4
+*/
+typedef struct _GFISPM4WINDOW
+{
+ NvU32 Left, /**< Specifies left of first M4 sub-window. */
+ Top; /**< Specifies top of first M4 sub-window. */
+ NvU8 SubWindowCountH, /**< Specifies the number of sub-windows in the horizontal direction. Can be {1,2,3}. */
+ SubWindowCountV; /**< Specifies the number of sub-windows in the vertical direction. Can be {1,2,3}. */
+ NvU16 SubWindowWidth, /**< Specifies the width of each sub-window. */
+ SubWindowHeight; /**< Specifies the height of each sub-window. */
+ NvU16 SubWindowIntervalH, /**< Specifies the horizontal interval of sub-windows. */
+ SubWindowIntervalV; /**< Specifies the vertical interval of sub-windows. */
+ NvU8 CoreLimit; /**< Top limit of noise coring for M4 statistics gathering. Valid range is [0-63]. */
+ NvU8 reserved;
+} GFISPM4WINDOW, *PGFISPM4WINDOW;
+
+
+/** Enum for the Optical Black Mode.
+ @see GFISPOBCONTROL
+*/
+typedef enum
+{
+ OB_MODE_FRAME = 0,
+ OB_MODE_AVG_FRAME_LINE = 1,
+ OB_MODE_LINE = 2
+} GFISP_OB_MODE_SEL;
+
+
+/** Optical black control.
+
+ The very first ISP operation to be applied to the input pixel signal is to
+ establish "black" level. This anchors signal activities to a black reference level,
+ or "zero" level.
+
+ There are two methods of accomplishing optical blacking. One method is
+ performed on each frame and is called Frame-based Optical Blacking (FOB).
+ The other method is performed on each scan line and is called Line-based
+ Optical Blacking (LOB).
+
+ Under FOB, optical black level can be established in one of two ways--by
+ setting it manually, or more commonly by letting the ISP measure it
+ automatically. In the automatic method the user can specify black regions
+ which surround the active imaging area. The pixel levels from these regions
+ are used to determine the input signal level of reference black, which is
+ mapped to "zero" level in the subsequent pixel processing.
+
+ LOB is applied to each scan line and is used to detect and compensate for
+ fluctuations in the imager input signal level of reference black.
+
+ The user can choose to use either FOB, or LOB, or both.
+
+ Four optical black regions are defined through 16 coordinates.
+
+ If ISP's OB capability is GFISP_CAP_THREE_OB_REGIONS, then:
+ - Only six of the 16 OB coordinates are used:
+ - OBTopRegionStartV, OBTopRegionHeight,
+ - OBLeftRegionStartH, OBLeftRegionWidth,
+ - OBBottomRegionStartV, OBBottomRegionHeight
+ - Right OB region is not supported.
+ - Top region width is assumed equal to input width.
+ - Left region height is assumed equal to input height.
+ - Bottom region width is assumed equal to input width.
+ - Bottom region is only used if GFISP_ATTR_ENABLE_FOB_SELFRESET is disabled.
+
+ If ISP's OB capability is GFISP_CAP_FOUR_OB_REGIONS, then all sixteen
+ OB coordinates are used.
+
+ @see GFISPGetParameter, GFISPSetParameter, GFISP_ATTR_ENABLE_FOB, GFISP_ATTR_ENABLE_FOB_SELFRESET, GFISP_ATTR_ENABLE_FOB_TEMPORAL, GFISP_ATTR_ENABLE_MANUALOB, GFISP_ATTR_ENABLE_LOB
+*/
+typedef struct _GFISPOBCONTROL
+{
+ NvU32 OBTopRegionStartV, OBTopRegionHeight, OBTopRegionStartH, OBTopRegionWidth;
+ NvU32 OBBottomRegionStartV, OBBottomRegionHeight, OBBottomRegionStartH, OBBottomRegionWidth;
+ NvU32 OBLeftRegionStartV, OBLeftRegionHeight, OBLeftRegionStartH, OBLeftRegionWidth;
+ NvU32 OBRightRegionStartV, OBRightRegionHeight, OBRightRegionStartH, OBRightRegionWidth;
+
+ NvU8 FOBCoef; /**< Filter coefficient of FOB acquisition. Valid range is [0-15]. */
+ NvU8 TOBCoef; /**< Temporal filter coefficient of FOB temporal filter. Valid range is [0-15]. */
+
+ NvU8 LOBWidth; /**< Width used for LOB. Valid values are {2, 4, 8}. */
+
+ NvU8 FOBAdjust; /**< Manual adjustment applied to the black level. Valid range is [0, 63]. */
+ GFISP_OB_MODE_SEL OBMode; /**< Optical black mode vales {frame, avg of frame + line, line } */
+} GFISPOBCONTROL, *PGFISPOBCONTROL;
+
+
+/** This structure describes one approximated linear segment for deknee.
+ @see GFISPDEKNEECONTROL
+*/
+typedef struct _GFISPDEKNEEENTRY
+{
+ NvU16 start; /**< Start of a range. */
+ NvU16 slope; /**< Slope of the linear. Unsigned fixed point format. Valid range is [0, 3 63/64] with precision of 1/64. */
+} GFISPDEKNEEENTRY, *PGFISPDEKNEEENTRY;
+
+/** Deknee control.
+
+ Imagers tend to show some degree of non-linearity in their light-to-electric
+ transfer characteristics. Deknee unit attempts to improve the linearity.
+
+ NVIDIA ISP implements Deknee as a piece-wise linear approximation of up
+ to 16 segments.
+
+ This structure describes the start and slope values for the Deknee look-up
+ table. The caller may choose to divide the table into 4, 8, or 16 linear segments
+ (4, 8, or 16 entries in the table).
+
+ @see GFISPGetParameter, GFISPSetParameter, GFISP_ATTR_ENABLE_DEKNEE
+*/
+typedef struct _GFISPDEKNEECONTROL
+{
+ NvU32 nEntries; /**< Number of entries in the pEntry table. Valid values are {4,8,16}. */
+ GFISPDEKNEEENTRY *pEntries; /**< Deknee entry table. */
+} GFISPDEKNEECONTROL, *PGFISPDEKNEECONTROL;
+
+
+/** Lens shading compensation control.
+
+ An optical lens in front of the imager tends to introduce shading and
+ unevenness in the strength of incident light. It is strongest at the center and
+ diminishes as the distance from the center increases. Actual shading
+ characteristics vary depending on the choice of optics.
+
+ This structure describes a method for compensating for this shading by
+ applying varying levels of gain to the pixel signal in the reverse function of
+ the shading.
+
+ The GFISPAPI implements this as a second degree quadratic equation for
+ each color component at H and V:
+
+ F = 1 + X * (Coef1 + Coef2 *X)
+
+ @see GFISPGetParameter, GFISPSetParameter, GFISP_ATTR_ENABLE_LENS_SHADING
+*/
+typedef struct _GFISPLENSHADING
+{
+ NvU16 hCenter, /**< Horizontal center point of camera lens. */
+ vCenter; /**< Vertical center point of camera lens. */
+
+ NvU16 rHorzCoef1, /**< First order coefficient for Horizontal Red. Unsigned fixed point format. Valid range is [0, 7 63/64] with precision of 1/64. */
+ rHorzCoef2; /**< Second order coefficient for Horizontal Red. Unsigned fixed point format. Valid range is [0, 7 63/64] with precision of 1/64. */
+ NvU16 rVertCoef1, /**< First order coefficient for Vertical Red. Unsigned fixed point format. Valid range is [0, 7 63/64] with precision of 1/64. */
+ rVertCoef2; /**< Second order coefficient for Vertical Red. Unsigned fixed point format. Valid range is [0, 7 63/64] with precision of 1/64. */
+ NvU16 gHorzCoef1, /**< First order coefficient for Horizontal Green. Unsigned fixed point format. Valid range is [0, 7 63/64] with precision of 1/64. */
+ gHorzCoef2; /**< Second order coefficient for Horizontal Green. Unsigned fixed point format. Valid range is [0, 7 63/64] with precision of 1/64. */
+ NvU16 gVertCoef1, /**< First order coefficient for Vertical Green. Unsigned fixed point format. Valid range is [0, 7 63/64] with precision of 1/64. */
+ gVertCoef2; /**< Second order coefficient for Vertical Green. Unsigned fixed point format. Valid range is [0, 7 63/64] with precision of 1/64. */
+ NvU16 bHorzCoef1, /**< First order coefficient for Horizontal Blue. Unsigned fixed point format. Valid range is [0, 7 63/64] with precision of 1/64. */
+ bHorzCoef2; /**< Second order coefficient for Horizontal Blue. Unsigned fixed point format. Valid range is [0, 7 63/64] with precision of 1/64. */
+ NvU16 bVertCoef1, /**< First order coefficient for Vertical Blue. Unsigned fixed point format. Valid range is [0, 7 63/64] with precision of 1/64. */
+ bVertCoef2; /**< Second order coefficient for Vertical Blue. Unsigned fixed point format. Valid range is [0, 7 63/64] with precision of 1/64. */
+} GFISPLENSSHADING, *PGFISPLENSSHADING;
+
+
+
+/** White balance control.
+
+ White Values
+
+ RGB component signal levels are balanced to render white objects as white.
+ This is a normalization step of electronic signal of RGB color primaries.
+ Depending on the "color temperature" of the white reference, the relative
+ strength of RGB tri-stimulus values vary. In the electric signal, ER/EG/EB
+ corresponding to the RGB tri-stimulus values are normalized so that white (of
+ 100% strength) is represented by ER = EG = EB = 1. The original image in front
+ of the imager is reproduced only when a display device does precise reverse
+ conversion, which is a purely ideal case. Otherwise, the original image is
+ rendered in different shades of colors depending on the reference white for
+ which the display device is tuned.
+
+ Gray Values
+
+ RGB pixel values that represent "gray" objects may be obtained in various
+ ways. For example, a picture frame can be filled with a "white" object, or
+ average values for a large number of pixels can be calculated, or a set of
+ average values collected in many sampling spotscan be used to represent the
+ approximated "gray" object.
+
+ Gain Factors and White Balance
+
+ Digital gain values are dedicated to each of the four color channels (R, Gr, Gb,
+ B).
+
+ Depending on how to set gain factors, there are two ways to use White
+ Balance. A commonly used method is called Dynamic WB, or AWB. Under
+ AWB, gain values are updated automatically by ISP internal AWB control
+ based on the average values and peak values in {R, G1, G2, B} color channels.
+ Refer to #GFISP_PARA_M1WINDOW.
+
+ - If the frame exposure is high ("Top" level, controlled by ThresholdT2M/
+ ThresholdM2T), gains are calculated from the average RGrGbB values.
+ - If the frame exposure is low ("Bottom" level, controlled by
+ ThresholdM2B/ThresholdB2M), gains are calculated from peak
+ RGrGbB values.
+ - If the frame exposure is in the middle range, gains are calculated from
+ both average and peak values.
+
+ Under AWB, the user can send a command to freeze the current gain value by
+ setting GFISP_ATTR_AWB_HOLD to 1. Then the current AWB gain value is
+ applied to all future frames.
+
+ The other method is called pre-programmed WB or Static WB. It sets preprogrammed
+ gain values and applies them all time. Under this mode, the
+ programmer determines the proper gain values based on the M1/M3
+ measurement window output.
+
+ @see GFISPGetParameter, GFISPSetParameter, GFISP_ATTR_ENABLE_WB, GFISP_ATTR_ENABLE_AWB,
+ GFISP_ATTR_AWB_HOLD, GFISPM1WINDOW
+*/
+typedef struct _GFISPWBCONTROL
+{
+ // Static WB.
+ NvU16 RGain, /**< Static gain factor for Red. Only effective when GFISP_ATTR_ENABLE_AWB==0. */
+ GrGain, /**< Static gain factor for Green on Red. Only effective when GFISP_ATTR_ENABLE_AWB==0. */
+ BGain, /**< Static gain factor for Blue. Only effective when GFISP_ATTR_ENABLE_AWB==0. */
+ GbGain; /**< Static gain factor for Green on Blue. Only effective when GFISP_ATTR_ENABLE_AWB==0. */
+
+ // Both statis and auto WB.
+ NvU16 TopClipLimit; /**< Lower limit of gain based clipping. Effective for both Static WB and Auto WB. Value 0 effectively turns off Top-clipping. */
+
+ // Auto WB.
+ NvU16 PeakRef; /**< White reference level for gain adjustment. Only effective when GFISP_ATTR_ENABLE_AWB==1. */
+
+ NvU16 RGainMax, RGainMin; /**< Max/Min Gain factor for Red. Only effective when GFISP_ATTR_ENABLE_AWB==1. */
+ NvU16 GGainMax, GGainMin; /**< Max/Min Gain factor for Green. Only effective when GFISP_ATTR_ENABLE_AWB==1. */
+ NvU16 BGainMax, BGainMin; /**< Max/Min Gain factor for Blue. Only effective when GFISP_ATTR_ENABLE_AWB==1. */
+
+ NvU16 ThresholdT2M, /**< Top-to-Middle transition level. Only effective when GFISP_ATTR_ENABLE_AWB==1. */
+ ThresholdM2T, /**< Middle-to-Top transition level. Only effective when GFISP_ATTR_ENABLE_AWB==1. */
+ ThresholdM2B, /**< Middle-to-Bottom transition level. Only effective when GFISP_ATTR_ENABLE_AWB==1. */
+ ThresholdB2M; /**< Bottom-to-Middle transition level. Only effective when GFISP_ATTR_ENABLE_AWB==1. */
+
+} GFISPWBCONTROL, *PGFISPWBCONTROL;
+
+
+/** Demosaic mode enum for #GFISPDEMOSAICCONTROL.
+*/
+typedef enum
+{
+ GFISP_DM3X3 = 0, // 3x3 one-shot demosaicing
+ GFISP_DM3X3BPNR = 1, // 3x3 demosaicing/bad-pixel/noise-reduction
+ GFISP_DM5X5 = 2, // 5x5 one-shot demosaicing
+ GFISP_DM5X5BP = 3, // 5x5 demosaicing/bad-pixel
+ GFISP_DM5X5BPNR = 4 // 5x5 demosaicing/bad-pixel/noise-reduction
+} GFISP_DEMOSAIC_MODE_SEL;
+
+/** Demosaic control.
+
+ This structure controls the demosaic process, which uses 2D interpolation to
+ convert Bayer format R/G/B pixel signals obtained from the imager to
+ generate R/G/B component values.
+
+ Under the SC15 hardware implementation, the Demosaic unit is built with
+ bad pixel (BP) and noise reduction (NR) control inside, so picking demosaic
+ mode affects bad pixel and noise reduction control. Unless limited by
+ memory bandwidth, programmers should always pick BPNR modes. Otherwise, BP
+ and NR features are not available, even if you try to turn on BP or NR
+ controls with GFISPSetAttribute().
+
+ @see GFISPGetParameter, GFISPSetParameter, GFISP_ATTR_ENABLE_DEMOSAIC,
+ GFISPBADPIXELCONTROL, GFISPNOISECONTROL1
+*/
+typedef struct _GFISPDEMOSAICCONTROL
+{
+ GFISP_DEMOSAIC_MODE_SEL DemosaicMode; /**< Demosaic mode selection. */
+} GFISPDEMOSAICCONTROL, *PGFISPDEMOSAICCONTROL;
+
+
+/** Coring limit scaling selection enum for #GFISPEDGEENHANCECONTROL. */
+typedef enum
+{
+ GFISP_GCLIMIT_SCALE_4 = 0, // range [1,4.5]
+ GFISP_GCLIMIT_SCALE_8 = 1, // range [1,8.5]
+ GFISP_GCLIMIT_SCALE_16= 2, // range [1,16.5]
+ GFISP_GCLIMIT_SCALE_32= 3 // range [1,32.5]
+} GFISP_GCORINGLIMIT_SCALE_SEL;
+
+/** Edge enhancement control.
+
+ This structure controls the edge enhancement process, accomplished by the
+ following:
+ -# Extracting the high frequency component (HF) of the pixel
+ -# Amplifying HF if the extracted value is "large" (that is, coring)
+ -# Adding the amplified HF back to the Y channel of the pixel.
+
+ In the SC15 implementation, edge enhancement control resides in the
+ Demosaic unit. It is effective only if DM3X3BPNR, DM5X5NR, or DM5X5BPNR
+ demosaic mode is selected. The threshold that's used for coring is not a predetermined
+ fixed value, but instead is adaptive depending on the brightness
+ level. If the pixel surround is bright (more visible), the coring threshold will
+ be larger, which means only stronger edges are enhanced. Weaker edges are
+ considered more noise-prone and therefore are not enhanced.
+
+ Two control parameters are used to determine the adaptive coring threshold:
+ GCoringLimit and GCoreScaleSel.
+
+ @see GFISPGetParameter, GFISPSetParameter, GFISP_ATTR_ENABLE_EDGE_ENHANCE
+*/
+typedef struct _GFISPEDGEENHANCECONTROL
+{
+ NvU16 StrengthLevel; /**< How heavily the edge enhancement is applied. Unsigned fixed-point format. Valid range is [0, 3 7/8] with a precision of 1/8, plus [4, 15 1/2] with a precision of 1/2. */
+
+ NvU16 GCoringLimit; /**< Minimum coring level. The coring level increases when the pixel's surrounding brightness level goes up. Valid range is [0-63]. */
+ GFISP_GCORINGLIMIT_SCALE_SEL GCoringScaleSel; /**< Scaling factor of GCoringLimit. Specifies the influence of the brightness level to the coring level. The higher the GCoreScaleSel is, the larger the coring level grows under the same brightness. */
+} GFISPEDGEENHANCECONTROL, *PGFISPEDGEENHANCECONTROL;
+
+
+/** Noise Reduction 1 control.
+
+ There are two noise reduction functions in ISP datapath:
+ -# 3D noise reduction
+ -# False color reduction
+
+ GFISPNOISECONTROL1 applies to the first method.
+ It resides in Demosaic unit along with edge enhancement. It is effective
+ only if DM3X3BPNR, DM5X5NR, or DM5X5BPNR demosaic mode is selected.
+
+ This method reduces noise not only in the image plane but also in the
+ intensity domain. In other words, low pass filtering is applied to pixels that
+ have a similar pixel value and are also close to the same location.
+ FilterStrengthLevel defines the filter kernel size on the intensity
+ domain. Larger FilterStrengthLevel generates a smoother but blurry
+ image.
+
+ @see GFISPGetParameter, GFISPSetParameter, GFISP_ATTR_ENABLE_NOISE_CONTROL1
+*/
+typedef struct _GFISPNOISECONTROL1
+{
+ NvU16 FilterStrengthLevel; /**< Weighted average scaling factor. Valid range is [0,7]. */
+} GFISPNOISECONTROL1, *PGFISPNOISECONTROL1;
+
+
+/** Noise Reduction 2 control.
+
+ There are two noise reduction functions in ISP datapath:
+ -# 3D noise reduction
+ -# False color reduction
+
+ GFISPNOISECONTROL2 applies to the second method.
+ It resides in color correction unit.
+
+ This method reduces the colorfulness of pixels at shadow region or at edges
+ to de-emphasize color noise and color aliasing effects. HighLimit and
+ TransitionWidth specify the pixels that will undergo the color reduction.
+ If the luminance level of the pixel is larger than (HighLimit +
+ TransitionWidth), the pixel's colorfulness is intact. If the luminance level
+ is smaller than HighLimit, the colorfulness is reduced to a minimum (i.e., no
+ color correction is applied). Pixels with luminance levels between these limits
+ pass through an intermediate colorfulness reduction factor. CCScaleFactor
+ specifies how much color reduction should be applied at edge pixels. Larger
+ CCScaleFactor creates a more noticeable color reduction at the edges.
+
+ @see GFISPGetParameter, GFISPSetParameter, GFISP_ATTR_ENABLE_NOISE_CONTROL2
+*/
+typedef struct _GFISPNOISECONTROL2
+{
+ NvU16 HighLimit; /**< Upper-limit level of noise reduction curve. */
+ NvU16 TransitionWidth; /**< Width of noise reduction curve. Valid values are {16, 32, 64, 128}. */
+ NvU16 CCScaleFactor; /**< Slope of noise reduction curve. Unsigned fixed point format. Valid range is [0, 31]. */
+} GFISPNOISECONTROL2, *PGFISPNOISECONTROL2;
+
+
+
+/** Bad pixel control.
+
+ This structure controls a method to conceal bad pixels.
+
+ The process resides in the Demosaic unit along with edge enhancement
+ and noise control 1. It is effective only if DM3X3BPNR or DM5X5BPNR demosaic
+ mode is selected.
+
+ If a pixel value deviates greatly from its surrounding pixels, the pixel is
+ considered to be a bad pixel. The deviation is defined in terms of the
+ percentage of the average value of the surrounding pixels.
+
+ Two ratio coefficients are used:
+ - If the pixel is within a flat area, LowCoef is used,
+ - If the pixel is at an edge region, UpCoef is used.
+ If the average of the surrounding pixels is lower than DarkLevel, it is
+ considered to be at a shadow region, and DarkLevel instead of the average
+ value will be used to calculate the deviation threshold.
+
+ @see GFISPGetParameter, GFISPSetParameter, GFISP_ATTR_ENABLE_BAD_PIXEL
+*/
+typedef struct _GFISPBADPIXELCONTROL
+{
+ NvU16 DarkLevel; /**< Bad-pixel dark level. */
+ NvU16 UpCoef, /**< Coefficient for upper threshold. Unsigned fixed point format. Valid range is [0, 1 7/8] with precision of 1/8. */
+ LowCoef; /**< Coefficient for lower threshold. Unsigned fixed point format. Valid range is [0, 1 7/8] with precision of 1/8. */
+} GFISPBADPIXELCONTROL, *PGFISPBADPIXELCONTROL;
+
+
+/** Color correction control.
+
+ This structure controls the color correction process.
+
+ In a strict sense, the color correction module transforms a given color space
+ (based on the optical characteristics of the imager) to a specific color space
+ such as described by the CCIR 601 standard. The color component signals are
+ then handled according to that standard color space from that point on.
+
+ For high-end cameras, color correction is used to match some sensitive colors
+ such as flesh tone to a desired shade of colors, and is handled primarily by
+ experts who know what they are doing.
+
+ In practice, there may be a simpler means with fewer control parameters,
+ where the color shade of images is adjusted to suit the viewer's taste. So, gain
+ and offset of R, G, and B pixels are individually adjusted.
+
+ GFISP color correction consists of 3x3 matrix factors for the camera RGB
+ (cRGB) to standard RGB (sRGB) conversion. Subjective adjustment of color
+ can also be included.
+ - Coefficients on the main diagonal are unsigned. Valid range is [0, 7 255/256].
+ - Off-diagonal coefficients are unsigned. Valid range is [-7 255/256, 7 255/256].
+
+ @see GFISPGetParameter, GFISPSetParameter, GFISP_ATTR_ENABLE_COLOR_CORRECTION
+*/
+typedef struct _GFISPCOLORCORRECTION
+{
+ NvU16 R2R; /**< Red-to-red coefficient. Unsigned fixed point format. Valid range is [0, 7 255/256]. */
+ NvS16 R2G; /**< Red-to-green coefficient. Signed fixed point format. Valid range is [-7 255/256, 7 255/256]. */
+ NvS16 R2B; /**< Red-to-blue coefficient. Signed fixed point format. Valid range is [-7 255/256, 7 255/256]. */
+ NvS16 G2R; /**< Green-to-red coefficient. Signed fixed point format. Valid range is [-7 255/256, 7 255/256]. */
+ NvU16 G2G; /**< Green-to-green coefficient. Unsigned fixed point format. Valid range is [0, 7 255/256]. */
+ NvS16 G2B; /**< Green-to-blue coefficient. Signed fixed point format. Valid range is [-7 255/256, 7 255/256]. */
+ NvS16 B2R; /**< Blue-to-red coefficient. Signed fixed point format. Valid range is [-7 255/256, 7 255/256]. */
+ NvS16 B2G; /**< Blue-to-green coefficient. Signed fixed point format. Valid range is [-7 255/256, 7 255/256]. */
+ NvU16 B2B; /**< Blue-to-blue coefficient. Unsigned fixed point format. Valid range is [0, 7 255/256]. */
+ NvS16 Vividity; /**< Multiplier to boost the diagonal elements. Signed fixed point format. Valid Range [-64/256, 64/256]. */
+ NvS16 VividityScaleFactor; /**< Multiplier to boost the diagonal elements. Signed fixed point format. Valid Range [-OffDiagona/64, OffDiagonal/64]. */
+ NvU16 GainStart; /**< Starting Gain for Auto Vividity . */
+ NvU16 GainEnd; /**< End Gain for Auto Vividity. */
+} GFISPCOLORCORRECTION, *PGFISPCOLORCORRECTION;
+
+
+/** This structure describes one approximated linear segment for gamma.
+ @see GFISPGAMMACONTROL
+*/
+typedef struct _GFISPGAMMAENTRY
+{
+ NvU16 inputStart; /**< Input start value of line segment. Valid range is [0, 1023]. */
+ NvU16 outputStart; /**< Output start value of line segment. Valid range is [0, 255]. */
+ NvS16 slope; /**< Slope of the line segment. Signed fixed point format. Valid range is [-7 63/64, 7 63/64]. */
+ NvU16 reserved;
+} GFISPGAMMAENTRY, *PGFISPGAMMAENTRY;
+
+/** Gamma correction control.
+
+ This structure controls the gamma correction process.
+
+ Gamma correction applies non-linear characteristics to compensate for the
+ non-linear characteristics of display devices such as cathode ray tubes driven
+ by R, G, B primary color signals. So, in a strict sense, this must be applied to
+ R, G, B signals.
+
+ In SC15 implementation, gamma correction is approximated using up to 16
+ line segments. Each line entry must be provided in ascending order (within
+ the input range).
+
+ @see GFISPGetParameter, GFISPSetParameter, GFISP_ATTR_ENABLE_GAMMA_CORRECTION
+*/
+typedef struct _GFISPGAMMACONTROL
+{
+ NvU32 nEntries; /**< Number of entries in the pEntries table. Valid range is [1-16]. */
+ GFISPGAMMAENTRY *pEntries; /**< Gamma entry table. */
+} GFISPGAMMACONTROL, *PGFISPGAMMACONTROL;
+
+
+/** Y signal range selection enum for #GFISPYUVCONVERSION.
+*/
+typedef enum
+{
+ GFISP_YRANGE_FULL = 0, /**< Range of [0,255]. */
+ GFISP_YRANGE_NEARFULL = 1, /**< Rage of [1,254] (exclude 00 and FF). */
+ GFISP_YRANGE_ITU601 = 2 /**< ITU601 standard. */
+} GFISP_YRANGE_SEL;
+
+/** RGB to YUV conversion control.
+ This structure controls the YUV conversion process, which converts RGB
+ color space to corresponding YUV color space, based on the 3x3 matrix.
+
+ {Y, U, V} shall have offset values that are not shown in the formula above.
+*/
+typedef struct _GFISPYUVCONVERSION
+{
+ GFISP_YRANGE_SEL YRangeSel; /**< YUV output signal range. */
+ NvS16 YOff; /**< Y value offset. Valid range is [-128, 127]. */
+
+ // 3x3 YUV conversion matrix.
+ // G2Y is unsigned fixed point format. Valid range is [0, 1 255/256].
+ // R2Y and B2Y are unsigned fixed point format. Valid range is [0, 255/256].
+ // R2U, G2U, B2U, R2V, G2V, B2V are signed fixed point format.
+ // Valid range is [-255/256, 255/256].
+ NvS16 R2Y; /**< Red-to-Y coefficient. Unsigned fixed point format. Valid range is [0, 255/256]. */
+ NvS16 G2Y; /**< Green-to-Y coefficient. Unsigned fixed point format. Valid range is [0, 1 255/256]. */
+ NvS16 B2Y; /**< Blue-to-Y coefficient. Unsigned fixed point format. Valid range is [0, 1 255/256]. */
+ NvS16 R2U; /**< Red-to-U coefficient. Signed fixed point format. Valid range is [-255/256, 255/256]. */
+ NvS16 G2U; /**< Green-to-U coefficient. Signed fixed point format. Valid range is [-255/256, 255/256]. */
+ NvS16 B2U; /**< Blue-to-U coefficient. Signed fixed point format. Valid range is [-255/256, 255/256]. */
+ NvS16 R2V; /**< Red-to-V coefficient. Signed fixed point format. Valid range is [-255/256, 255/256]. */
+ NvS16 G2V; /**< Green-to-V coefficient. Signed fixed point format. Valid range is [-255/256, 255/256]. */
+ NvS16 B2V; /**< Blue-to-V coefficient. Signed fixed point format. Valid range is [-255/256, 255/256]. */
+} GFISPYUVCONVERSION, *PGFISPYUVCONVERSION;
+
+/** Isp set mode
+ This structure set ISP parameters to the specified mode, as specidied in the ISP script.
+*/
+typedef struct _GFISPSETMODE
+{
+ NvS32 Mode; /**< Mode number. */
+} GFISPSETMODE, *PGFISPSETMODE;
+
+/** 3A AE parameter
+ These enum contains 3A AE control parameters.
+*/
+
+typedef enum
+{
+ GFISP_AE_FRAME_CHOICE_FIXED = 0, /**< fixed frame rate. At lowlux AE will use only digital gain to increase brightness */
+ GFISP_AE_FRAME_CHOICE_FLEXIBLE = 1 /**< At lowlux AE will increase frame height first (i.e., lower frame rate) to increase brightness Frame height is bounded by FrameHeight at GFISP_AE_SENSORINFO. */
+}GFISP_AE_FRAME_CHOICE;
+
+typedef enum
+{
+ GFISP_AE_METERING_CHOICE_EVALUATIVE = 0, /**< calculate luminance average by propriotary algorithm */
+ GFISP_AE_METERING_CHOICE_SPOT = 1, /**< calculate luminance average from center window only */
+ GFISP_AE_METERING_CHOICE_CENTER = 2, /**< GFISP_AE_METERING_CHOICE_CENTER: calculate luminance average from weighted sum of center window and whole frame */
+ GFISP_AE_METERING_CHOICE_MATRIX = 3 /**< calculate luminance average from weighted sum of 3x3 sub-windows */
+}GFISP_AE_METERING_CHOICE;
+
+typedef enum
+{
+ GFISP_AE_ANTIFLICKER_CHOICE_50HZ = 0, /**< use AEStep_50Hz in GFISP_AE_SENSORINFO as exposure steps */
+ GFISP_AE_ANTIFLICKER_CHOICE_60HZ = 1, /**< use AEStep_60Hz in GFISP_AE_SENSORINFO as exposure steps */
+ GFISP_AE_ANTIFLICKER_CHOICE_MANUAL = 2, /**< use ManualAntiFlickerStep in GFISP_AE_CONTROL1 as exposure steps */
+ GFISP_AE_ANTIFLICKER_CHOICE_AUTO = 3 /**< enable auto anti-flickering */
+}GFISP_AE_ANTIFLICKER_CHOICE;
+
+/** 3A AE parameter
+ This structure contains 3A AE parameters.
+*/
+typedef struct _GFISP3AAE
+{
+ NvU16 AETarget; /**< [0..255]. Target average luminance value for AE convergence. Higher value renders brighter image. */
+ NvU16 AEToleranceIn; /**< [0..255]. Convergence tolerance from AESTATE_OUT to AESTATE_IN */
+ NvU16 AEToleranceOut; /**< [0..255]. Convergence tolerance from AESTATE_OUT to AESTATE_IN. Normally AEToleranceOut >= AEToleranceIn */
+ GFISP_AE_FRAME_CHOICE FrameRateChoice; /**< GFISP_AE_FRAME_CHOICE */
+ GFISP_AE_METERING_CHOICE MeteringChoice; /**< GFISP_AE_METERING_CHOICE */
+ GFISP_AE_ANTIFLICKER_CHOICE AntiFlickerChoice; /**< GFISP_AE_ANTIFLICKER_CHOICE */
+ NvU8 ConvergeSpeed; /**< [1..15]. AE convergence speed. 1 being the fastest (immediate update) */
+ NvS32 Status; /**< 3A AE Status. Read only */
+
+ NvU32 ManualAntiFlickerStep; // manual exposure step. Used when AntiFlickerChoice=GFISP_AE_ANTIFLICKER_CHOICE_MANUAL
+ NvS32 CenterWeight, FrameWeight; // weights for MeteringChoice=GFISP_AE_METERING_CHOICE_CENTER
+ NvS32 Metering11, Metering12, Metering13,// weights for MeteringChoice=GFISP_AE_METERING_CHOICE_MATRIX
+ Metering21, Metering22, Metering23,
+ Metering31, Metering32, Metering33;
+ NvU16 AdditionalLumaIncreaseForFlatScene;// [0..255]. give final exposure additional increase if scene is flat.
+ NvU16 BacklightTbright; // [0..255]. Threshold for determining "bright regions" (for backlight checking)
+ NvU16 BacklightTdark; // [0..255]. Threshold for determining "dark regions" (for backlight checking)
+ NvU16 TOverexposed; // [0..255]. Threshold for determining overexposed condition.
+ NvU16 TDark; // [0..255]. Threshold for determining dark condition.
+ NvU8 AutoNoiseControl; /**< Auto Noise Control */
+} GFISP3AAE, *PGFISP3AAE;
+
+/* Exposure parameter USED for Manual Exposure and Gain settings
+*/
+typedef struct _GFISPEXPOSURECONTROL
+{
+ NvU32 MaxFrameHeight; // longest exposure time allowed. >= DefaultFrameHeight, in unit
+ // of per scanline.
+ // For constant framerate application, set MaxFrameHeight=FrameHeight.
+
+ NvU32 DefaultFrameHeight; // sensor's default time difference betwee two consecutive VSYNC pulses,
+ // in unit of per scanline.
+ NvU32 DefaultFrameHeightIS; // Limit the frame height corresponding to ET of 1/60 sec
+
+ NvU16 MaxGain; // [1..128]. max digital gains allowed. Normally set to 2 (=200%)
+ // if anti-flickering is on. If larger sensitivity boost is needed
+ // at lowlux condition set MaxGain to higher value.
+ NvU16 MinGain; //Minimum Exposure Gain in ISP Format
+
+ NvU16 MaxGainIS; // max digital gain allowed in the case of image stabilization
+
+}GFISPEXPOSURECONTROL, *PGFISPEXPOSURECONTROL;
+
+/* Manual Exposure and Gain settings
+*/
+typedef struct _GFISPMANUALEXPOSURE
+{
+ NvU32 Exposure; // exposure time
+ NvU32 Gain; // digital gain
+}GFISPMANUALEXPOSURE, *PGFISPMANUALEXPOSURE;
+
+
+/** 3A AWB parameter
+ This structure contains 3A AWB parameters.
+*/
+
+typedef enum
+{
+ GFISP_AWB_WBMODE_CLOUDY = 0, /**<: for cloudy conditions (7,000K - 8,000K) */
+ GFISP_AWB_WBMODE_SUNNY = 1, /**<: for sunny conditions (5,500K - 6,000K) */
+ GFISP_AWB_WBMODE_FLASH = 2, /**<: for strobe or xenon flashes (~5,000K) */
+ GFISP_AWB_WBMODE_FLUORESCENT = 3, /**<: for indoor office conditions (~3,000K) */
+ GFISP_AWB_WBMODE_INCANDESCENT = 4, /**<: for indoor home conditions (~2,800K) */
+}GFISP_AWB_WBCUSTOM;
+
+typedef enum
+{
+ GFISP_AWB_COPLEXITY_HIGH = 0, /***/
+ GFISP_AWB_COPLEXITY_MEDIUM = 1, /***/
+ GFISP_AWB_COPLEXITY_LOW = 2 /***/
+}GFISP_AWB_COMPLEXITY;
+
+typedef struct _GFISP3AAWB
+{
+ NvU8 fWBCustom; // =0 when WB Custom Setting OFF
+ // =1 when WB Custom Setting ON
+ GFISP_AWB_WBCUSTOM WBCustomK; // Choose one of the defined illum class when fWBCustom=1
+ // GFISP_AWB_WBMODE_CLOUDY = 0, /**<: for cloudy conditions (7,000K - 8,000K) */
+ // GFISP_AWB_WBMODE_SUNNY = 1, /**<: for sunny conditions (5,500K - 6,000K) */
+ // GFISP_AWB_WBMODE_FLASH = 2 /**<: for strobe or xenon flashes (~5,000K) */
+ // GFISP_AWB_WBMODE_FLUORESCENT = 3, /**<: for indoor office conditions (~3,000K) */
+ // GFISP_AWB_WBMODE_INCANDESCENT = 4, /**<: for indoor home conditions (~2,800K) */
+ // Must be < NumWBCustom
+
+ GFISP_AWB_COMPLEXITY ComplexityMode;
+ NvS8 WBShift; /**< Moves up or down illuminant class. For white balance bracketing. */
+ /**< timing and stability control */
+ NvU8 ConvergeSpeed; /**< [0..6], 6 being the fastest (immediate update) */
+ NvU8 ToleranceIn; /**< [0..255], tolerance for convergence. */
+ NvU8 ToleranceOut; /**< [0..255], threshold for triggering new AWB update. Normally ToleranceIn < ToleranceOut, and both toelrances are small (e.g., 5 to 10). */
+ NvU32 FilterCoefficient; /**< [0-20] Filter coefficient used for scene change detection . */
+ NvU32 M3FilterCoefficient; /**< [0-60] Filter coefficient used for temporal low pass filtering of M3 Buffer . */
+ NvU32 UseM3LPFilter; /**< Flag for M3 Low Pass Filter. 1 = Enable LPF, 0 = Disable */
+ NvU32 KXYCorrelation; /**< To be used for scene change detection. */
+
+ NvS32 Status; /**< 3A AWB Status. Read only */
+} GFISP3AAWB, *PGFISP3AAWB;
+
+typedef enum
+{
+ GFISP_AFSTATE_IN = 0,
+ GFISP_AFSTATE_OUT = 1,
+ GFISP_AFSTATE_INIT = 2
+}GFISP_AF_STATE;
+
+typedef enum
+{
+ GFISP_AF_TYPE_CENTER = 1,
+ GFISP_AF_TYPE_AUTO_EVALUATE = 2,
+ GFISP_AF_TYPE_FACE_PRIORITY = 3
+}GFISP_AF_TYPE;
+
+typedef enum
+{
+ GFISP_AF_MODE_CONTINUOUS = 0,
+ GFISP_AF_MODE_SINGLE = 1
+}GFISP_AF_MODE;
+
+/** 3A AF parameter
+ This structure contains 3A AF parameters.
+*/
+typedef struct _GFISP3AAF
+{
+ GFISP_AF_STATE Status; /**< 3A AF Status. Read only */
+ GFISP_AF_MODE Mode;
+ NvU8 Speed;
+ NvU8 LockTillAE;
+ NvU8 LockTillAWB;
+ NvU8 TakeSnapshot;
+} GFISP3AAF, *PGFISP3AAF;
+
+/** ISP 3A Capability.
+To get the 3A capability for a particular sensor.
+*/
+typedef struct _GFISPSENSORCAPABILITY
+{
+ NvU8 AWBCapability; /***/
+ NvU8 AECapability; /***/
+ NvU8 AFCapability; /***/
+ NvU8 ManualOBCapability; /***/
+ NvU8 AutoOBCapability; /***/
+}GFISPSENSORCAPABILITY, *PGFISPSENSORCAPABILITY;
+
+
+
+typedef enum
+{
+ GFISP_SENSOR_I2C_8_BIT_REGISTER = 0,
+ GFISP_SENSOR_I2C_16_BIT_REGISTER = 1,
+} REGISTERTYPE;
+
+typedef struct _GFISPSENSORRWREGISTER
+{
+ REGISTERTYPE RegisterType; //0: 8-bit register , 1: 16-bit register
+ NvU32 Addr; /**< Address : data read-write address>*/
+ NvU32 Data; /**< Value of data at that address >*/
+}GFISPSENSORRWREGISTER, *PGFISPSENSORRWREGISTER;
+
+/** 3A algorithm type
+ These enum contains 3A algorithm type required for checking convergence.
+*/
+typedef enum
+{
+ GFISP_CB_REGISTER_3A_AWB = 0,
+ GFISP_CB_REGISTER_3A_AE = 1,
+ GFISP_CB_REGISTER_3A_AF = 2
+} GFISP3ATYPE;
+
+/** Enabling or disabling the "gain reduction and gamma compression" property for reducing noise introduced due to high gain
+* in case of Image Stabilization.
+*/
+typedef enum
+{
+ GFISP_REDUCE_GAIN_COMPRESS_GAMMA_ON,
+ GFISP_REDUCE_GAIN_COMPRESS_GAMMA_OFF
+} GFISPGAINGAMMACTRL;
+/** Public exposed ISP API function table. See @ref groupIspFunctions. */
+typedef struct _GFISPTABLE
+{
+ GF_RETTYPE (* ISPGetProperty) ( GFIspHandle ISPHandle, PGFISPPROPERTY pIspProp );
+
+#if defined(DVS_DEVELOPMENT)
+ GF_RETTYPE (* ISPSetup) ( GFIspHandle ISPHandle, GFVxHandle VxHandle, PGFCAMERARESOLUTIONTYPE pCameraResolution, GFVXBLT vxBlt );
+#else
+ GF_RETTYPE (* ISPSetup) ( GFIspHandle ISPHandle, PGFCAMERARESOLUTIONTYPE pCameraResolution );
+#endif
+
+ GF_RETTYPE (* ISPSetResolution) ( GFIspHandle ISPHandle, PGFCAMERARESOLUTIONTYPE pCameraResolution );
+
+ GF_RETTYPE (* ISPGetAttribute) ( GFIspHandle ISPHandle,
+ GFISPATTRIBUTES aid,
+ NvU32 *attr);
+ GF_RETTYPE (* ISPSetAttribute) ( GFIspHandle ISPHandle,
+ GFISPATTRIBUTES aid,
+ NvU32 attr);
+
+ GF_RETTYPE (* ISPSetAttributeToDefault) (GFIspHandle ISPHandle, GFISPATTRIBUTES aid);
+
+ GF_RETTYPE (* ISPGetParameter) ( GFIspHandle ISPHandle,
+ GFISPPARAMETERS pid,
+ NvU32 *pSize,
+ void *pPara);
+ GF_RETTYPE (* ISPSetParameter) ( GFIspHandle ISPHandle,
+ GFISPPARAMETERS pid,
+ NvU32 size,
+ void *pPara);
+
+ GF_RETTYPE (* ISPSetParameterToDefault) (GFIspHandle ISPHandle, GFISPPARAMETERS pid);
+
+ GF_RETTYPE (* ISPTriggerMWindowGather) (GFIspHandle ISPHandle);
+
+ GF_RETTYPE (* ISPReadMWindowValues) ( GFIspHandle ISPHandle,
+ NvS32 szM1Buffer,
+ NvU32 *pM1Buffer,
+ NvS32 szM2Buffer,
+ NvU32 *pM2Buffer,
+ NvS32 szM3Buffer,
+ NvU32 *pM3Buffer,
+ NvS32 szM4Buffer,
+ NvU32 *pM4Buffer);
+
+ GF_RETTYPE (* ISPOEMScriptFunc) (GFIspHandle ISPHandle,
+ NvU32 ScriptFuncTag,
+ NvU32 size,
+ NvU32 *pBuffer);
+
+ GF_RETTYPE (* ISP3APeriodicTrigger)(GFIspHandle ISPHandle);
+
+ GF_RETTYPE (* ISPAeBracketingSetET) (NvS32 mode, NvU32 *pRetExposure, NvS32 *pRetGain);
+
+ GF_RETTYPE (* ISPAwbBracketingSetIllum) (NvS32 mode, NvU16 *pRetCCT);
+
+ GF_RETTYPE (* ISPRegister3ACallback) (GFIspHandle ISPHandle, GFISP3ATYPE type, void (*func)(void *), void *pParameter);
+
+} GFISPTABLE, *PGFISPTABLE;
+
+// Typesafe functions for opening and closing this component
+GF_RETTYPE GFIspOpen(GFRmHandle hRm, GFIspHandle *phIsp,
+ GF_STATE_TYPE state, GFRmChHandle hCh);
+void GFIspClose(GFIspHandle *phIsp);
+
+/** @defgroup groupIspFunctions ISP Function macros
+ These function macros represent the function calls for GFISPAPI.
+*/
+/*@{*/
+
+/** Returns information about the GFISPAPI.
+
+ @param handle Valid handle to GFISPAPI component.
+ @param pIspProp Pointer to a #GFISPPROPERTY struct.
+ For the sake of future expansion, the caller should put the size of
+ the structure into the #GFISPPROPERTY::size field; GFISPAPI will not
+ fill the structure beyond this size.
+
+ @retval GF_SUCCESS Success
+ @retval GFISP_ERROR_SIZE_TOO_SMALL Error: size parameter is too small to fit even partial results.
+
+ This function returns information about the GFISPAPI, including the
+ following:
+ - GFISPAPI module version
+ - ISP capability
+ - ISP limit parameters
+ It is good practice to use this function to query for the API version and
+ capabilities before using other GFISPAPI functions.
+
+ @see GFISPPROPERTY, groupIspCapability
+*/
+#define GFISPGetProperty( handle, pIspProp ) \
+ ((PGFISPTABLE)handle)->ISPGetProperty( handle, pIspProp )
+
+/** Sets up the ISP API for use with a particular camera.
+
+ @param handle Valid handle to GFISPAPI component.
+ @param pCameraResolution Pointer to a #GFCAMERARESOLUTIONTYPE structure
+ with valid BayerInfo.
+
+ @retval GF_SUCCESS Success
+ @retval GFISP_ERROR_BAD_HANDLE #handle is invalid.
+ @retval GFISP_ERROR_ILLEGAL_PARAMETER One or more parameters is NULL or out-of-range.
+
+ You must call GFISPGetProperty before calling any other ISP API functions,
+ with the exception of GFISPGetProperty. This function initializes ISP
+ to work with a particular resolution of camera.
+
+*/
+#if defined(DVS_DEVELOPMENT)
+#define GFISPSetup( handle, vxhandle, pCameraResolution, vxBlt ) \
+ ((PGFISPTABLE)handle)->ISPSetup( handle, vxhandle, pCameraResolution, vxBlt )
+#else
+#define GFISPSetup( handle, pCameraResolution ) \
+ ((PGFISPTABLE)handle)->ISPSetup( handle, pCameraResolution )
+#endif
+
+/** Resizes/repositions all windows based on resolution data.
+
+ @param handle Valid handle to GFISPAPI component.
+ @param pCameraResolution Pointer to a #GFCAMERARESOLUTIONTYPE structure
+ with valid BayerInfo.
+
+ @retval GF_SUCCESS Success
+ @retval GFISP_ERROR_BAD_HANDLE #handle is invalid.
+ @retval GFISP_ERROR_ILLEGAL_PARAMETER One or more parameters is NULL or out-of-range.
+ @retval GFISP_ERROR_CALL_SETUP_FIRST The application did not call GFISPSetup() prior to calling this function.
+
+ This function resizes and repositions the windows for several ISP parameters
+ based on the provided BayerInfo struct. Affected parameters are:
+ - Timing
+ - M1-M4 statistics windows
+ - Optical black regions
+ - Lens shading center point
+
+*/
+#define GFISPSetResolution( handle, pCameraResolution ) \
+ ((PGFISPTABLE)handle)->ISPSetResolution( handle, pCameraResolution )
+
+/** Get an attribute of the GFISPAPI.
+
+ @param handle Valid handle to GFISPAPI component.
+ @param aid Attribute ID. One of #GFISPATTRIBUTES enumeration type.
+ @param pAttrData Pointer to an #NvU32 to be filled with the attribute value.
+
+ @retval GF_SUCCESS Success
+ @retval GFISP_ERROR_BAD_HANDLE #handle is invalid.
+ @retval GFISP_ERROR_ILLEGAL_PARAMETER One or more parameters is NULL or out-of-range.
+ @retval GFISP_ERROR_CALL_SETUP_FIRST The application did not call GFISPSetup() prior to calling this function.
+
+ @see GFISPATTRIBUTES
+*/
+#define GFISPGetAttribute( handle, aid, pAttrData ) \
+ ((PGFISPTABLE)handle)->ISPGetAttribute( handle, aid, pAttrData )
+
+/** Set an attribute of the GFISPAPI.
+
+ @param handle Valid handle to GFISPAPI component.
+ @param aid Attribute ID. A #GFISPATTRIBUTES enumeration type value.
+ @param attrData Pointer to an #NvU32 to be filled with the attribute value.
+
+ @retval GF_SUCCESS Success
+ @retval GFISP_ERROR_BAD_HANDLE #handle is invalid.
+ @retval GFISP_ERROR_ILLEGAL_PARAMETER One or more parameters is NULL or out-of-range.
+ @retval GFISP_ERROR_CALL_SETUP_FIRST The application did not call GFISPSetup() prior to calling this function.
+
+ Under the NVIDIA ISP implementation, certain ISP functions can be turned
+ on or off independent of parameter settings. In most cases, this function
+ simply switches certain ISP functions on or off.
+
+ To set parameters for specific ISP functions, see GFISPSetParameter().
+
+ @see GFISPATTRIBUTES
+*/
+#define GFISPSetAttribute( handle, aid, attrData ) \
+ ((PGFISPTABLE)handle)->ISPSetAttribute( handle, aid, attrData )
+
+/** Set an attribute of the GFISPAPI to its default value.
+
+ @param handle Valid handle to GFISPAPI component.
+ @param aid Attribute ID. A #GFISPATTRIBUTES enumeration type value.
+
+ @retval GF_SUCCESS Success
+ @retval GFISP_ERROR_BAD_HANDLE #handle is invalid.
+ @retval GFISP_ERROR_ILLEGAL_PARAMETER One or more parameters is NULL or out-of-range.
+ @retval GFISP_ERROR_CALL_SETUP_FIRST The application did not call GFISPSetup() prior to calling this function.
+
+ @see GFISPATTRIBUTES
+*/
+#define GFISPSetAttributeToDefault( handle, aid ) \
+ ((PGFISPTABLE)handle)->ISPSetAttributeToDefault( handle, aid )
+
+/** Get parameters for a given ISP functional block.
+
+ @param handle Valid handle to GFISPAPI component.
+ @param pid Parameter ID. A #GFISPPARAMETERS enumeration type value.
+ @param pSize Pointer to an #NvU32 to be filled with the parameter size. Can be NULL.
+ @param pPara Pointer to a certain GFISPAPI data structure, depending on #pid. Can be NULL.
+
+ @retval GF_SUCCESS Success
+ @retval GFISP_ERROR_BAD_HANDLE #handle is invalid.
+ @retval GFISP_ERROR_ILLEGAL_PARAMETER One or more parameters is NULL or out-of-range.
+ @retval GFISP_ERROR_CALL_SETUP_FIRST The application did not call GFISPSetup() prior to calling this function.
+
+ @see GFISPPARAMETERS
+*/
+#define GFISPGetParameter( handle, pid, pSize, pPara ) \
+ ((PGFISPTABLE)handle)->ISPGetParameter( handle, pid, pSize, pPara )
+
+/** Set parameters for a given ISP functional block.
+
+ @param handle Valid handle to GFISPAPI component.
+ @param pid Parameter ID. A #GFISPPARAMETERS enumeration type value.
+ @param size #NvU32 with actual size of GFISPAPI structure pointed to by #pPara.
+ @param pPara Pointer to a certain GFISPAPI data structure, depending on #pid.
+
+ @retval GF_SUCCESS Success
+ @retval GFISP_ERROR_BAD_HANDLE #handle is invalid.
+ @retval GFISP_ERROR_ILLEGAL_PARAMETER One or more parameters is NULL or out-of-range.
+ @retval GFISP_ERROR_SIZE_TOO_SMALL #size parameter is too small
+ @retval GFISP_ERROR_CALL_SETUP_FIRST The application did not call GFISPSetup() prior to calling this function.
+
+ @see GFISPPARAMETERS
+*/
+#define GFISPSetParameter( handle, pid, size, pPara ) \
+ ((PGFISPTABLE)handle)->ISPSetParameter( handle, pid, size, pPara )
+
+/** Set parameters for a given ISP functional block to their default value.
+
+ @param handle Valid handle to GFISPAPI component.
+ @param pid Parameter ID. A #GFISPPARAMETERS enumeration type value.
+
+ @retval GF_SUCCESS Success
+ @retval GFISP_ERROR_BAD_HANDLE #handle is invalid.
+ @retval GFISP_ERROR_ILLEGAL_PARAMETER One or more parameters is NULL or out-of-range.
+ @retval GFISP_ERROR_CALL_SETUP_FIRST The application did not call GFISPSetup() prior to calling this function.
+
+ @see GFISPPARAMETERS
+*/
+#define GFISPSetParameterToDefault( handle, pid ) \
+ ((PGFISPTABLE)handle)->ISPSetParameterToDefault( handle, pid )
+
+/** Triggers MWindow statistics to be gathered on the next frame.
+
+ @param handle Valid handle to GFISPAPI component.
+
+ @retval GF_SUCCESS Success
+ @retval GFISP_ERROR_BAD_HANDLE #handle is invalid.
+ @retval GFISP_ERROR_CALL_SETUP_FIRST The application did not call GFISPSetup() prior to calling this function.
+
+ This function will trigger MWindow statistics to be gathered for
+ any of the M2, M3, M4 statistics that are turned on. M1 statistics
+ are constantly gathered. The statistics will become available at
+ the end of the next frame, and can be read by calling
+ GFISPReadMWindowValues().
+
+ Calling GFISPTriggerMWindowGather implicitly sets
+ #GFISP_ATTR_ENABLE_STATS_INT to 1.
+
+ @see GFISPReadMWindowValues
+*/
+#define GFISPTriggerMWindowGather( handle ) \
+ ((PGFISPTABLE)handle)->ISPTriggerMWindowGather( handle )
+
+/** Reads gathered MWindow statistics if they are ready.
+
+ @param handle Valid handle to GFISPAPI component.
+ @param szM1Buffer Maximum size of M1Buffer provided by caller (in bytes). The
+ GFISPAPI fills the buffer as much as it can. If zero, the GFISPAPI
+ doesn't fill the M1Buffer.
+ @param pM1Buffer Array of 8 data. First four 32-bit values will be filled with average
+ RGGB pixel values. Next four values will be filled with peak pixel values.
+ Can be NULL, then the GFISPAPI doesn't fill M1Buffer.
+ @param szM2Buffer Maximum size of M2Buffer provided by caller (in bytes). The
+ GFISPAPI fills the buffer as much as it can. If zero, the GFISPAPI
+ doesn't fill the M2Buffer.
+ @param pM2Buffer Array of 16 data. Data is arranged in 32-bit words as follows:
+ {R1, Gr1, Gb1, B1,
+ R2, Gr2, Gb2, B2, ...}
+ Can be NULL, then the GFISPAPI doesn't fill M2Buffer.
+ @param szM3Buffer Maximum size of M3Buffer provided by caller (in bytes). The
+ GFISPAPI fills the buffer as much as it can. If zero, the GFISPAPI
+ doesn't fill the M3Buffer.
+ @param pM3Buffer Array to hold pixel samples. The size matches the M3 Window specification.
+ The data is arranged as follows:
+ {R1, R2, R3, R4},
+ {Gr1, Gr2, Gr3, Gr4},
+ {Gb1, Gb2, Gb3, Gb4},
+ {B1, B2, B3, B4},
+ {R5, R6, R7, R8},
+ ...
+ Can be NULL, then the GFISPAPI doesn't fill M3Buffer.
+ @param szM4Buffer Maximum size of M4Buffer provided by caller (in bytes). The
+ GFISPAPI fills the buffer as much as it can. If zero, the GFISPAPI
+ doesn't fill the M4Buffer.
+ @param pM4Buffer Array of 2*M4WindowNumber data. Data is arranged as follows:
+ {HF1, Luma1, HF2, Luma2, ...}
+ Can be NULL, then the GFISPAPI doesn't fill M4Buffer.
+
+ @retval GF_SUCCESS Success
+ @retval GFISP_ERROR_BAD_HANDLE #handle is invalid.
+ @retval GFISP_ERROR_STATISTICS_NOT_READY M2/M3/M4 statistics not ready.
+ @retval GFISP_ERROR_CALL_SETUP_FIRST The application did not call GFISPSetup() prior to calling this function.
+
+ Call this function to read the MWindow values gathered by the last call to
+ GFISPTriggerMWindowGather(). The user may either poll for statistics ready
+ by checking the return code, or use the interrupt mechanism to only call
+ GFISPReadMWindowValues once the statistics are ready.
+
+ After the statistics are gathered, they will remain available for reading
+ until the next call to GFISPTriggerMWindowGather().
+
+ M1 statistics are gathered every frame regardless of whether
+ GFISPTriggerMWindowGather() has been called. The user can read
+ the last frame's M1 statistics without ever triggering a gather by
+ passing 0 and NULL for the M2-M4 parameters to GFISPReadMWindowValues().
+
+ @see GFISPTriggerMWindowGather
+*/
+#define GFISPReadMWindowValues( handle, szM1Buffer, pM1Buffer, \
+ szM2Buffer, pM2Buffer, szM3Buffer, pM3Buffer, szM4Buffer, pM4Buffer ) \
+ ((PGFISPTABLE)handle)->ISPReadMWindowValues( handle, szM1Buffer, pM1Buffer, \
+ szM2Buffer, pM2Buffer, szM3Buffer, pM3Buffer, szM4Buffer, pM4Buffer )
+
+/** Call Oem function defined in ISP script.
+
+ @param handle Valid handle to GFISPAPI component.
+ @param ScriptFuncTag Function tag used by the script.
+ @param size Number of entries in the buffer pointed to by #pBuffer.
+ @param pBuffer Point to a @param #NvU32 buffer that will be passed to script function.
+ Use it to send parameter to script function and get data back.
+
+ @retval GF_SUCCESS Success
+ @retval GFISP_ERROR_BAD_HANDLE #handle is invalid.
+ @retval GFISP_ERROR_CALL_SETUP_FIRST The application did not call GFISPSetup() prior to calling this function.
+
+ Call this function to access script function OemScriptFunc().
+*/
+#define GFISPOEMScriptFunc( handle, ScriptFuncTag, size, pBuffer ) \
+ ((PGFISPTABLE)handle)->ISPOEMScriptFunc( handle, ScriptFuncTag, size, pBuffer )
+
+/** Trigger periodic software 3A function.
+
+ @param handle Valid handle to GFISPAPI component.
+ @retval GF_SUCCESS Success
+ @retval GFISP_ERROR_BAD_HANDLE #handle is invalid.
+ @retval GFISP_ERROR_CALL_SETUP_FIRST The application did not call GFISPSetup() prior to calling this function.
+
+ Call this function at every vertical blank to trigger periodic software 3A function
+*/
+#define GFISP3APeriodicTrigger( handle ) \
+ ((PGFISPTABLE)handle)->ISP3APeriodicTrigger( handle )
+
+/** Exposure Bracketing Function
+ @param handle Valid handle to GFISPAPI component
+ @param mode Range: 0 Exposure value output by AC Algo
+ -1 Less by one-third stop than AC Output
+ 1 More by one-third stop than AC Output
+ @param.pRetExpsoure Expsoure at current mode is returned through this pointer
+ @param pGain Gain at current mode is returned through this pointer
+ @retval GF_SUCCESS or GF_ERROR
+
+ Call this function three times with different modes each time in order to record images with exposure bracketing
+*/
+#define GFISPAeBracketingSetET(handle, mode, pRetExposure, pRetGain) \
+ ((PGFISPTABLE)handle)->ISPAeBracketingSetET( mode, pRetExposure, pRetGain )
+
+/** White Balance Bracketing Function
+ @param handle Valid handle to GFISPAPI component
+ @param mode Range: 0 Exposure value output by AC Algo
+ -1 Less by one Illuminant than AC Output
+ 1 More by one Illuminant than AC Output
+ @param pRetCCT Color Temprature at current mode is returned through this pointer
+ @retval GF_SUCCESS or GF_ERROR
+
+ Call this function three times with different modes each time in order to record images with White Balance bracketing
+*/
+#define GFISPAwbBracketingSetIllum(handle, mode, pRetCCT) \
+ ((PGFISPTABLE)handle)->ISPAwbBracketingSetIllum( mode, pRetCCT )
+
+/** Register callback function for the convergence of software Auto White balance
+
+ @param handle Valid handle to GFISPAPI component.
+ @param algoType whether AWB, AE or AF
+ @param func Pointer to the callback function
+ @param pParameter pointer to the argument of function call
+ @retval GF_SUCCESS Success
+ @retval GFISP_ERROR_BAD_HANDLE #handle is invalid.
+ @retval GFISP_ERROR If invalid function pointer is passed
+
+ Call this function when application wants to know whether the auto white balance algorithm is converged or not.
+ When algorithm converges it calls the function func which is registered as callback function.
+*/
+#define GFISPRegister3ACallback(handle, algoType, func, pParameter) \
+ ((PGFISPTABLE)handle)->ISPRegister3ACallback( handle, algoType, func, pParameter )
+
+/*@}*/ // End function macros
+
+/*@}*/ // End ISP API Doxygen
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* _GF_ISP__ */
diff --git a/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFIspError.h b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFIspError.h
new file mode 100755
index 00000000..4f173424
--- /dev/null
+++ b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFIspError.h
@@ -0,0 +1,37 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/*
+ * File: GFIspError.h
+ * GFSDK Image Signal Processor API error code header file.
+ */
+
+#ifndef __GFISPERROR_H__
+#define __GFISPERROR_H__
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+#define GFISP_ERROR_ILLEGAL_PARAMETER (GFISP_ERROR | 0x00000001L)
+#define GFISP_ERROR_BAD_HANDLE (GFISP_ERROR | 0x00000002L)
+#define GFISP_ERROR_SIZE_TOO_SMALL (GFISP_ERROR | 0x00000003L)
+#define GFISP_ERROR_STATISTICS_NOT_READY (GFISP_ERROR | 0x00000004L)
+#define GFISP_ERROR_CALL_SETUP_FIRST (GFISP_ERROR | 0x00000005L)
+#define GFISP_ERROR_OUT_OF_MEMORY (GFISP_ERROR | 0x00000006L)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // __GFISPERROR_H__
+
+
+
diff --git a/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFJxDec.h b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFJxDec.h
new file mode 100755
index 00000000..879f10ed
--- /dev/null
+++ b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFJxDec.h
@@ -0,0 +1,508 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/** @file GFJxDec.h
+GFSDK JPEG Decode API header file.
+*/
+#ifndef _GF_JPEG_DEC__
+#define _GF_JPEG_DEC__
+
+#include "nvtypes.h"
+#include "GFVx.h"
+
+#ifdef __cplusplus
+extern "C" { // only need to export C interface if
+ // used by C++ source code
+#endif
+
+/** @addtogroup groupJx JxDecAPI JPEG Decoder API
+*/
+ /*
+ @ref pageGxAppNotes
+
+
+ */
+
+/*@{*/
+
+// JXDECCapFlags
+
+/** JxDecAPI property flag: Support for Sequential encoded JPEG.
+ @see GFJxDecGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_JXDEC_CAP_SEQUENTIAL_DCT 0x00000001
+
+/** JxDecAPI property flag: Support for Progressive encoded JPEG.
+ @see GFJxDecGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_JXDEC_CAP_PROGRESS_DCT 0x00000002
+
+/** JxDecAPI property flag: Support for lossless encoded JPEG.
+ @see GFJxDecGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_JXDEC_CAP_LOSSLESS 0x00000004
+
+/** JxDecAPI property flag: Support for hierarchical encoded JPEG.
+ @see GFJxDecGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_JXDEC_CAP_HIERARCHICAL 0x00000008
+
+/** JxDecAPI property flag: Support for 8 bits encoded JPEG.
+ @see GFJxDecGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_JXDEC_CAP_8_BIT 0x00000010
+
+/** JxDecAPI property flag: "No" Support for 12 bits encoded JPEG Presently.
+ @see GFJxDecGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_JXDEC_CAP_12_BIT 0x00000020
+
+/** JxDecAPI property flag: Support for Interleaved mode.
+ @see GFJxDecGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_JXDEC_CAP_INTERLEAVE 0x00000040
+
+/** JxDecAPI property flag: "No" Support presently for Interleaved mode.
+ @see GFJxDecGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_JXDEC_CAP_NO_INTERLEAVE 0x00000080
+
+/** JxDecAPI property flag: Support for Huffman Coding.
+ @see GFJxDecGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_JXDEC_CAP_HUFFMAN 0x00000100
+
+/** JxDecAPI property flag: No Support for Arithematic Coding presently.
+ @see GFJxDecGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_JXDEC_CAP_ARITHMETIC 0x00000200
+
+/** JxDecAPI property flag: No Support for Interchange format coding.
+ @see GFJxDecGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_JXDEC_CAP_INTERCHANGE 0x00000400
+
+/** JxDecAPI property flag: Support for Pixel Based Cropping(MCU based Cropping).
+ @see GFJxDecGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_JXDEC_CAP_CROPPING 0x00001000
+
+/** JxDecAPI property flag: Support for YUV444 encoded JPEG images.
+ @see GFJxDecGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_JXDEC_CAP_YUV444 0x00002000
+
+/** JxDecAPI property flag: Support for YUV422 encoded JPEG images.
+ @see GFJxDecGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_JXDEC_CAP_YUV422 0x00004000
+
+/** JxDecAPI property flag: YUV422 Rotation Supported.
+ @see GFJxDecGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_JXDEC_CAP_ROTATED_YUV422 0x00008000
+
+/** JxDecAPI property flag: Support for YUV420 encoded JPEG images.
+ @see GFJxDecGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_JXDEC_CAP_YUV420 0x00010000
+
+/** JxDecAPI property flag: Support for Gray Scale encoded JPEG images.
+ @see GFJxDecGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_JXDEC_CAP_GRAY_SCALE 0x00020000
+
+/** JxDecAPI property flag: Support for Extended RGB format 24/32 bpp.
+ @see GFJxDecGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_JXDEC_CAP_EXTEND_RGB 0x00040000
+
+/** JxDecAPI property flag: Support for YUV420 output decoded format.
+ @see GFJxDecGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_JXDEC_CAP_420_OUTPUT 0x00080000
+
+/** JxDecAPI property flag: Support for YUV422 output decoded format.
+ @see GFJxDecGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_JXDEC_CAP_422_OUTPUT 0x00100000
+
+/** Image source dimensions and color format of the input JPEG to be decoded.
+ This structure is passed as parameter to GFJxDecGetImageInfo().
+
+ @see GFRMSURFACE::ColorFormat, GFJxDecGetImageInfo()
+*/
+typedef struct _GFJXDECIMAGEINFO
+{
+ NvU32 IIFlag; /**< Deprecated, do not use.
+ This variable is set to the same error code as returned by GFJxDecGetImageInfo().
+ @deprecated
+ */
+ NvU32 Width; /**< Width of the input image */
+ NvU32 Height; /**< Height of the input image */
+ NvU32 ColorFormat; /**< Color Format of input image (YUV420, YUV422, ...)
+ @see GFRMSURFACE.ColorFormat */
+}GFJXDECIMAGEINFO, *PGFJXDECIMAGEINFO;
+
+/** GFJxDecStart parameter structure.
+ This structure specifies target surface, scaling, source
+ and destination cropping for the decode operation.
+
+ @see GFJxDecStart()
+*/
+typedef struct _GFJXDECSTART
+{
+ NvU32 SFlag; /**< Deprecated, do not use. @deprecated */
+ PGFRMSURFACE pDestSurf; /**< Destination Surface to hold the decoded image.
+ The color format of the surface controls the output color format.
+ If no destination cropping rectangle is given, the decoded picture
+ is scaled to match the surface size.
+ */
+ PGFRECT pCroppingRect; /**< Source cropping area to be decoded, or NULL for no cropping.
+ Top-left position of the cropping rectangle must be aligned
+ to an MCU boundary.
+ */
+ PGFRECT pDestRect; /**< Destination cropping area, or NULL for no cropping.
+ If a destination cropping rectangle is given, the decoded picture
+ will be scaled to fit this rectangle.
+ */
+ NvU32 Error; /**< Deprecated, do not use.
+ This variable will be set to the same value as returned by GFJxDecStart().
+ @deprecated
+ */
+} GFJXDECSTART, *PGFJXDECSTART;
+
+
+//SFlag: not used anymore. Cropping is decided on whether
+//the pCroppingRect is NULL or not
+#define GF_JXDEC_SFLAG_CROPPING 0
+
+/** GF_DECODER_IDLE is returned if hardware decoder is idle by GFJxDecGetStatus().
+ @see GFJxDecGetStatus()
+*/
+#define GF_DECODER_IDLE 0x00000001
+
+/** GF_DECODER_BUSY is returned if hardware decoder is busy by GFJxDecGetStatus().
+ @see GFJxDecGetStatus()
+*/
+#define GF_DECODER_BUSY 0x00000002
+
+
+/** JxDecAPI Pass JX_DEC_SET_READBITSTREAM to GFJxDecSet to register call back function
+@see GFJxDecSet()
+*/
+#define JX_DEC_SET_READBITSTREAM 1
+
+/** Structure holding the callback function pointer.
+ Used in registering the callback function
+*/
+typedef struct _GFJXDECCALLBACK
+{
+ void *pPara; /**< Not used anymore */
+ NvU32 (*pCallBack)(void * pPara, NvU8 ** ppBuffer, NvS32 * BufferLength);
+ /**<
+ Application callback function pointer.
+ Register a callback function for fetching JPEG Image data.
+
+ @param *pPara Not used anymore
+ @param ppBuffer Buffer Pointer
+ @param BufferLength Buffer Length in bytes, 0 if no bytes read.
+
+ @retval The number of bytes read successfully, 0 if no bytes read.
+ */
+
+}GFJXDECCALLBACK, *PGFJXDECCALLBACK;
+
+/** Structure holding the callback function pointer.
+ Used in registering the callback function
+*/
+typedef struct _GFJXDECGETIMAGECALLBACK
+{
+ void *pPara;
+ /**< pPara is a parameter passed from application,
+ and application wants API to call back with this parameter
+ */
+ NvU32 (*pCallBack)(void * pPara, PGFRMSURFACE pImageSurf, PGFRECT pImageRect, NvU32 uiImageFlag);
+ /**<
+ Application callback function pointer.
+ Register a callback function for fetching decoded JPEG Image data.
+
+ @param *pPara Parameter to pass on to application callback function
+ @param pImageSurf Surface Pointer
+ @param pImageRect Source rectangle
+ @param uiImageFlag
+
+ #JX_DEC_IF_LAST_PORTION_IMAGE
+ This is the last portion of decoded image
+
+ @retval 0
+ */
+}GFJXDECGETIMAGECALLBACK, *PGFJXDECGETIMAGECALLBACK;
+
+
+/** This is the last portion of the Image.
+ @see GFJXDECGETIMAGECALLBACK
+*/
+#define JX_DEC_IF_LAST_PORTION_IMAGE 0x00000001 //this is the last portion of decoded image
+
+//Attribute uiFeature
+
+/** Set get decoded image call back(inorder to dump the decoded YUV from JPEG).
+ @see GFJXDECGETIMAGECALLBACK, GFJxDecGetImageInfo
+*/
+#define JX_DEC_GETIMAGE 0x00000001
+
+/** Pass JX_DEC_GETIMAGE_COLORFORMAT with GFJxDecGetAttribute to get JPEG image color format. */
+#define JX_DEC_GETIMAGE_COLORFORMAT 0x00000002
+
+
+/** Call this function get the JxDec Component's handle.
+ @param hRm (#GFRmHandle) Handle to the Resource Manager
+ @param phJxDec (#GFJxDECHandle) Pointer to the JxDecAPI Handle
+ @param state Set to Default state.
+ @param hCh (#GFRmChHandle) Channel Handle
+ @retval #GF_SUCCESS JxDec component registered successfully
+ @retval #GF_ERROR Some error occured
+*/
+GF_RETTYPE GFJxDecOpen(GFRmHandle hRm, GFJxDecHandle *phJxDec, GF_STATE_TYPE state, GFRmChHandle hCh);
+
+
+/** The function releases the JxDec's Component handle.
+ @param phJxDec (#GFJxDECHandle) Pointer to the JxDecAPI Handle
+*/
+void GFJxDecClose(GFJxDecHandle *phJxDec);
+
+/** This function returns version and capabilities of JPEG decoder.
+
+ @param hJxDec Handle to JxDecAPI
+ @param pJXProp Pointer to property structure to be filled in
+
+ @retval #GF_SUCCESS \a pJXProp filled in successfully
+ @retval #GF_ERROR Some error occured
+
+ @see GFPROPERTY
+*/
+GF_RETTYPE GFJxDecGetProperty(GFJxDecHandle hJxDec, PGFPROPERTY pJXProp);
+
+/** This function returns the status of the JPEG Decoder
+
+ @param hJxDec Handle to JxDecAPI
+ @param pStatus Returns status, GF_DECODER_BUSY or GF_DECODER_IDLE.
+*/
+GF_RETTYPE GFJxDecGetStatus(GFJxDecHandle hJxDec, NvU32* pStatus);
+
+/** The funtion gets the information about the input image and fills it into the pInfo
+
+ If the function fails, it will return an error code describing the failure cause.
+
+ @param hJxDec Handle to JxDecAPI
+ @param pInfo Pointer to Image Information structure to be filled in
+
+ @retval GF_SUCCESS \a pInfo filled in successfully
+ @retval GF_JXDEC_IFLAG_INVALID_MARKER Invalid Marker in JPEG file
+ @retval GF_JXDEC_IFLAG_INVALID_HDR_LEN Invalid header (marker) length in JPEG file
+ @retval GF_JXDEC_IFLAG_INVALID_SIG Invalid Image Signature(eg: JFIF, AVI, ..) in JPEG file
+ @retval GF_JXDEC_IFLAG_INVALID_DQT Invalid Quantization Table in JPEG file
+ @retval GF_JXDEC_IFLAG_INVALID_DHT Invalid Huffman Tables in JPEG file
+ @retval GF_JXDEC_IFLAG_INVALID_VALUE Invalid image parameters (eg: width, height , ...) in JPEG file
+ @retval GF_JXDEC_IFLAG_INVALID_FORMAT Invalid format in JPEG file
+ @retval GF_JXDEC_IFLAG_PROGRESSIVE_MARKER Invalid Marker in JPEG file
+ @see GFJXDECIMAGEINFO
+*/
+GF_RETTYPE GFJxDecGetImageInfo(GFJxDecHandle hJxDec, PGFJXDECIMAGEINFO pInfo);
+
+/** This function sets up a callback function
+ @param hJxDec Handle to JxDecAPI
+ @param uiFeature Feature ID to set
+ @param pInfo Feature specific parameter
+
+
+ \a uiFeature
+ \a pInfo interpretation
+ Meaning
+ JX_DEC_SET_READBITSTREAM
+ GFJXDECCALLBACK*
+ Set up Jpeg bitstream feed callback
+
+
+ @retval #GF_SUCCESS If successful
+ @retval #GFJXD_ERROR_INVALID_PARAMETER Invalid parameter
+
+ @see GFJXDECCALLBACK
+*/
+GF_RETTYPE GFJxDecSet(GFJxDecHandle hJxDec, NvU32 uiFeature, void* pInfo);
+
+/** Set attributes for the decoder.
+ @param hJxDec Handle to JxDecAPI,
+ @param attrID Attribute ID to be set
+ @param pInfo Attruvyte specific parameter
+
+
+ #JX_DEC_GETIMAGE
+ Get the YUV decoded JPEG image into a file, Sets the decoder image callback
+ #JX_DEC_GETIMAGE_COLORFORMAT
+ Set get decoded image color format.
+
+
+ @retval #GF_SUCCESS
+*/
+GF_RETTYPE GFJxDecSetAttribute(GFJxDecHandle hJxDec, NvU32 attrID, NvU32* pInfo);
+
+/** Gets attributes for the decoder
+ @param hJxDec Handle to JxDecAPI,
+ @param attrID Attribute ID to read
+ @param pInfo Pointer to block returning attribute specific data
+
+ #JX_DEC_GETIMAGE
+ Get the YUV decoded JPEG image into a file, Sets the decoder image callback
+ #JX_DEC_GETIMAGE_COLORFORMAT
+ Set get decoded image color format.
+
+*/
+GF_RETTYPE GFJxDecGetAttribute(GFJxDecHandle hJxDec, NvU32 attrID, NvU32* pInfo);
+
+/** Setup JxDecAPI for JPEG decoding a frame.
+
+ If GFJxDecStart() fails, it will return an error code describing the failure cause.
+ If GFJxDecStart() succeeded, GFJxDecEnd() must be called later.
+
+ @param hJxDec Handle to JxDecAPI
+ @param pStart Pointer to #GFJXDECSTART parameter structure.
+
+ @retval GF_SUCCESS Success
+ @retval GFRM_ERROR_OUT_MEMORY Not enough free GPU or system memory
+ @retval GF_JXDEC_NOT_SUPPORT_DESTSURFACE_FORMAT Destination Surface format not supported by the decoder
+ @retval GF_JXDEC_DECODER_WIDTH_TOO_BIG Image source width exceeds max decoder width
+ @retval GF_JXDEC_DECODER_HEIGHT_TOO_BIG Image source height exceeds max decoder height
+
+ @see GFJXDECSTART, GFJxDecSetAttribute(),GFJxDecEnd()
+*/
+GF_RETTYPE GFJxDecStart(GFJxDecHandle hJxDec, PGFJXDECSTART pStart);
+
+/** Decode the image
+ @param hJxDec Handle to JxDecAPI
+ @param uiFlag Reserved, must be 0.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ @see GFJxDecGetImageInfo(), GFJxDecStart(), GFJxDecSetAttribute(), GFJxDecEnd()
+
+*/
+GF_RETTYPE GFJxDecDecodeImage(GFJxDecHandle hJxDec, NvU32 uiFlag);
+
+/** End or cancel decoding a frame.
+ Must be called only, if GFJxDecStart() has been called before.
+ @param hJxDec Handle to JxDecAPI
+*/
+GF_RETTYPE GFJxDecEnd(GFJxDecHandle hJxDec);
+
+
+/** GFJxDecAPI Error Codes. */
+enum
+{
+ /** GFJxDecAPI API called with invalid parameters. */
+ GFJXD_ERROR_INVALID_PARAMETER = GFJXD_ERROR,
+
+ /** Operation not supported. */
+ GFJXD_ERROR_NOT_SUPPORTED,
+
+ /** Encountered incomplete bitstream during decoding. */
+ GFJXD_ERROR_INCOMPLETE_BITSTREAM,
+
+ /** GFJxDecStart() return code: Can't support this destination surface type.
+ @see GFJXDECSTART, GFJxDecStart()
+ */
+ GF_JXDEC_NOT_SUPPORT_DESTSURFACE_FORMAT,
+
+ /** GFJxDecStart() return code: Image width is too big for hardware decoder to handle
+ @see GFJXDECSTART, GFJxDecStart()
+ */
+ GF_JXDEC_DECODER_WIDTH_TOO_BIG,
+
+ /** GFJxDecStart() return code: Image height is too big for hardware decoder to handle
+ @see GFJXDECSTART, GFJxDecStart()
+ */
+ GF_JXDEC_DECODER_HEIGHT_TOO_BIG,
+
+ /** GFJxDecGetImageInfo() return code: If set then the input marker is Invalid,
+ if unset its a valid marker.
+ @see GFJXDECIMAGEINFO, GFJxDecGetImageInfo()
+ */
+ GF_JXDEC_IFLAG_INVALID_MARKER,
+
+ /** GFJxDecGetImageInfo() return code: If set then the Header Length is Invalid,
+ if unset its a valid header length.
+ @see GFJXDECIMAGEINFO, GFJxDecGetImageInfo()
+ */
+ GF_JXDEC_IFLAG_INVALID_HDR_LEN,
+
+ /** GFJxDecGetImageInfo() return code: If set then the Signature(eg: JFIF, AVI, ..) is Invalid,
+ if unset its a valid signature.
+ @see GFJXDECIMAGEINFO, GFJxDecGetImageInfo()
+ */
+ GF_JXDEC_IFLAG_INVALID_SIG,
+
+ /** GFJxDecGetImageInfo() return code: If set then the there occured an error in reading the Quantization Table,
+ if unset the Quantization Table was read clean.
+ @see GFJXDECIMAGEINFO, GFJxDecGetImageInfo()
+ */
+ GF_JXDEC_IFLAG_INVALID_DQT,
+
+ /** GFJxDecGetImageInfo() return code: If set then the Huffman Tables were not loaded properly
+ if unset Huffman Tables were loaded.
+ @see GFJXDECIMAGEINFO, GFJxDecGetImageInfo()
+ */
+ GF_JXDEC_IFLAG_INVALID_DHT,
+
+ /** GFJxDecGetImageInfo() return code: If set then there was an invalid value(eg : erroneous/incomplete bitstream) in the stream,
+ if unset its a valid Iflag.
+ @see GFJXDECIMAGEINFO, GFJxDecGetImageInfo()
+ */
+ GF_JXDEC_IFLAG_INVALID_VALUE,
+
+ /** GFJxDecGetImageInfo() return code: If set then the progressive marker not supported,
+ if unset its a valid marker.
+ @see GFJXDECIMAGEINFO, GFJxDecGetImageInfo()
+ */
+
+ GF_JXDEC_IFLAG_PROGRESSIVE_MARKER,
+ /** GFJxDecGetImageInfo() return code: If set then there was an invalid header format encountered in the stream,
+ if unset its a valid Iflag.
+ @see GFJXDECIMAGEINFO, GFJxDecGetImageInfo()
+ */
+ GF_JXDEC_IFLAG_INVALID_FORMAT
+};
+
+
+/** @page pageJxDecAppNotes JxDecAPI Application Notes
+ @section pageJxDecAppNotes Programming Sequence
+
+ The following procedure requires that GFRmOpen() is called first to start GFSDK usage.
+ -# Call GFJxDecOpen() to obtain JxDecHandle which will be passed to different functions of JxDecAPI.
+ -# Query the properties through GFJxDecGetProperty() to check whether the desired JxDec features can be supported.
+ -# Call GFRmSurfaceAlloc() to allocate one surface to hold the decoded image.
+ -# Register the call back function using GFJxDecSet()
+ -# Call GFJxDecGetImageInfo() to get the JPEG image information, such as width and height.
+ -# GFJxDecStart() is the next function to call. This function will setup the decoder.
+ -# Call GFJxDecDecodeImage() to do the real decoding.
+ -# After the whole bitstream has been fed, call GFJxDecEnd() to end the decoding process.
+ -# Release surface by calling GFRmSurfaceFree().
+ -# Release JPEG decoder by calling GFJxDecClose().
+*/
+
+/*@}*/
+
+#ifdef __cplusplus
+}
+#endif
+#endif
+
diff --git a/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFJxEnc.h b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFJxEnc.h
new file mode 100755
index 00000000..c5170b44
--- /dev/null
+++ b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFJxEnc.h
@@ -0,0 +1,1306 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/** @file GFJxEnc.h
+ GFSDK JPEG Encode API header file.
+*/
+
+#ifndef _GF_JPEG_ENC__
+#define _GF_JPEG_ENC__
+
+#include "GF.h"
+#include "GFRm.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+/** @addtogroup groupJxEnc JxEncAPI JPEG Encoder API
+
+ @ref pageJxEncAppNotes
+
+ @ref pageJxEncAppNotes1
+
+
+*/
+/*@{*/
+
+/** JxEncAPI property flag: JPEG quantization table is programmable.
+ @see GFJxEncGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_JX_ENC_CAP_QTABLE 0x00000001
+
+/** JxEncAPI property flag: Interrupt data capture mode and polling mode
+ supported, if this flag is off then only polling mode is supported.
+ @see GFJxEncGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_JX_ENC_CAP_INTERRUPT 0x00000004
+
+/** JxEncAPI property flag: Digital zoom supported.
+ @see GFJxEncGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_JX_ENC_CAP_DIGITAL_ZOOM 0x00000008
+
+/** JxEncAPI property flag: Motion JPEG mode supported.
+ @see GFJxEncGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_JX_ENC_CAP_MOTION_JPEG 0x00000010
+
+/** JxEncAPI property flag: Rate control supported.
+ @see GFJxEncGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_JX_ENC_CAP_RATE_CONTROL 0x00000020
+
+/** JxEncAPI property flag: Planar YUV422 data supported.
+ @see GFJxEncGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_JX_ENC_CAP_422_PLANAR 0x00000040
+
+/** JxEncAPI property flag: Rotation supported.
+ @see GFJxEncGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_JX_ENC_CAP_ROTATION 0x00000080
+
+
+/** Image source/target dimensions and data source for JPEG encoding.
+
+ This structure is passed as parameter to GFJxEncStart() and describes
+ data source, source cropping rectangle and destination image size.
+
+ The surface the application wants to encode is pSrcSurf. If the application
+ wants to encode an image from a camera or to re-encode a JPEG bitstream,
+ this field should be set to NULL. If the application wants to encode an
+ image from the display, this field should point to the primary surface. If
+ an application wants to encode an existing image, it must create a system
+ memory surface to hold the image and set this field to the system memory
+ surface.
+
+ @see GFJxEncStart()
+*/
+typedef struct _GFJXENCSTART
+{
+ PGFRMSURFACE pSrcSurf;/**< Surface to encode,
+ NULL for camera or re-encode JPEG
+ */
+ PGFRECT pSrcRect; /**< Source image area need to encode */
+ NvU32 DestWidth; /**< Final encoded image width */
+ NvU32 DestHeight; /**< Final encode image height */
+ NvU32 uiOptions; /**< Bitmask of flags to control encoding
+
+ #GF_CAPT_BITSTREAM
+ If set only bitstream is output, if
+ unset JFIF header will be added
+
+ #GF_CAPT_PIECE_MEAL
+ Piecemeal encoding @todo clarify
+ meaning
+
+
+ */
+ NvU32 Error; /**< Returns detailed error code on GFJxEncStart() failure
+
+ #GF_CAPT_ERROR_VIDEO_MEMORY_NOT_BIG_ENOUGH
+ Not enough free video memory, try to release
+ unnecessary video surfaces
+ #GF_CAPT_ERROR_WRONG_CONFIG
+ Wrong input parameters, for example srcRect
+ size greater than pSrcSurf dimensions
+ #GF_CAPT_ERROR_NO_CALLBACK
+ No callback function available
+
+ */
+} GFJXENCSTART, *PGFJXENCSTART;
+
+/** JxEncAPI GFJXENCSTART::uiOptions flagbit: If set only bitstream is output,
+ if unset JFIF header will be added.
+ @see GFJXENCSTART, GFJxEncStart()
+*/
+#define GF_CAPT_BITSTREAM 1
+
+/** JxEncAPI GFJXENCSTART::uiOptions flagbit: Piecemeal encoding
+ @todo clarify meaning
+ @see GFJXENCSTART, GFJxEncStart()
+*/
+#define GF_CAPT_PIECE_MEAL 2
+
+/** JxEncAPI GFJXENCSTART::Error return code: Not enough free video memory.
+ Try to release unnecessary video surfaces.
+ @see GFJXENCSTART, GFJxEncStart()
+*/
+#define GF_CAPT_ERROR_VIDEO_MEMORY_NOT_BIG_ENOUGH 1
+
+/** JxEncAPI GFJXENCSTART::Error return code: Wrong input parameters.
+ E.g. srcRect size greater than pSrcSurf dimensions.
+ @see GFJXENCSTART, GFJxEncStart()
+*/
+#define GF_CAPT_ERROR_WRONG_CONFIG 2
+
+/** JxEncAPI GFJXENCSTART::Error return code: No callback function available.
+ @todo clarify
+ @see GFJXENCSTART, GFJxEncStart()
+*/
+#define GF_CAPT_ERROR_NO_CALLBACK 4
+
+/** Descriptor for JPEG encode buffers.
+ This structure describes a buffer and its fill status for encoded
+ JPEG data or raw YUV transfered from the JPEG encoder to the
+ application. It is used with GFJxEncCapture() and GFJxEncFetchImage()
+ in either polling or callback data fetch mode.
+
+ @see GFJxEncCapture(), GFJxEncFetchImage(), GFJxEncPRComplete()
+*/
+typedef struct _GFJXENC_BUF {
+ NvU8 *pBuf; /**< Pointer to the buffer */
+ NvU32 bufSize; /**< Size of the buffer in bytes */
+ NvU32 nBytesCaptured; /**< Number of bytes captured,
+ app initializes to 0
+ */
+} GFJXENC_BUF, *PGFJXENC_BUF;
+
+/** Fetch buffer descriptor for use with GFJxEncFetchImage().
+ This data structure is used by GFJxEncInterruptHandler() to fetch encoded
+ image data when IntType is GFJX_ENC_STREAM_BUF_INTR or GFJX_ENC_DONE_INTR.
+*/
+typedef struct _GFJXENC_FETCH_BUF{
+ PGFJXENC_BUF pBuf;
+ NvU32 numOfBuf;
+ NvU32 status;
+} GFJXENC_FETCH_BUF, *PGFJXENC_FETCH_BUF;
+
+
+/** JxEncAPI data fetch status code: All data of the current frame was fetched.
+ @see GFJxEncFetchImage(), GFJxEncCapture()
+*/
+#define JXENC_DATA_COMPLETE 0x1
+
+/** JxEncAPI data fetch status code: Data was fetched only partially.
+ The application should make more calls to GFJxEncFetchImage() to fetch
+ the rest.
+ @see GFJxEncFetchImage(), GFJxEncCapture()
+*/
+#define JXENC_MORE_FETCH 0x2
+
+/** JxEncAPI data fetch status code: New frame was encoded and is ready to
+ fetch.
+ @see GFJxEncFetchImage(), GFJxEncCapture()
+*/
+#define JXENC_NEW_FRAME 0x8
+
+/** JxEncAPI data fetch status code: Time out error occured while encoded data is fetching.
+ fetch.
+ @see GFJxEncFetchImage(), GFJxEncCapture()
+*/
+#define JXENC_TIME_OUT 0x10
+
+// definition of uiFeature for GFJxEncSetAttribute
+//the following definations are for set only
+
+/** JxEncAPI attribute: Choose preset QTable, coefficients in luma and chroma
+ Qtable are all 1.
+
+ Interpretation of associated data block: None.
+
+ Attribute is set-only.
+
+ @see GFJxEncSetAttribute(), GFJxEncGetAttribute()
+*/
+#define JX_ENC_SET_100QUALITY 0
+
+/** JxEncAPI attribute: Choose preset QTable, standard Qtable A and B,
+ divided by 2.
+
+ Interpretation of associated data block: None.
+
+ Attribute is set-only.
+
+ @see GFJxEncSetAttribute(), GFJxEncGetAttribute()
+*/
+#define JX_ENC_SET_85QUALITY 1
+
+/** JxEncAPI attribute: Choose preset QTable, standard Qtable A and B.
+
+ Interpretation of associated data block: None.
+
+ Attribute is set-only.
+ @see GFJxEncSetAttribute(), GFJxEncGetAttribute()
+*/
+#define JX_ENC_SET_75QUALITY 2
+
+/** JxEncAPI attribute: Choose preset QTable, standard Qtable C and D.
+
+ Interpretation of associated data block: None.
+
+ Attribute is set-only.
+
+ @see GFJxEncSetAttribute(), GFJxEncGetAttribute()
+*/
+#define JX_ENC_SET_50QUALITY 3
+
+/** JxEncAPI attribute: Choose preset QTable, standard Qtable C and D,
+ multiplied by 2.
+
+ Interpretation of associated data block: None.
+
+ Attribute is set-only.
+
+ @see GFJxEncSetAttribute(), GFJxEncGetAttribute()
+*/
+#define JX_ENC_SET_25QUALITY 4
+
+/** JxEncAPI attribute: Choose preset QTable, standard Qtable C and D,
+ multiplied by 4.
+
+ Interpretation of associated data block: None.
+
+ Attribute is set-only.
+
+ @see GFJxEncSetAttribute(), GFJxEncGetAttribute()
+*/
+#define JX_ENC_SET_12QUALITY 5
+
+//the following definations can be used for set and get
+
+/** JxEncAPI attribute: Set custom luma QTable.
+
+ Interpretation of associated data block:
+ A table of 64 16-bit (type NvU16) entries with quantization coefficients
+ to be used for luma MCU's.
+
+ Attribute can be set and get.
+
+ @see GFJxEncSetAttribute(), GFJxEncGetAttribute()
+*/
+#define JX_ENC_LQTABLE 6
+
+/** JxEncAPI attribute: Set custom chroma QTable.
+
+ Interpretation of associated data block:
+ A table of 64 16-bit (type NvU16) entries with quantization coefficients
+ to be used for chroma MCU's.
+
+ Attribute can be set and get.
+
+ @see GFJxEncSetAttribute(), GFJxEncGetAttribute()
+*/
+#define JX_ENC_CQTABLE 7
+
+/** JxEncAPI attribute: Decimation filter enable/disable.
+
+ Interpretation of associated data block:
+
+ NvU32 decimation enable
+ 0 = disable
+ 1 = enable
+
+
+ Attribute can be set and get.
+
+ @see GFJxEncSetAttribute(), GFJxEncGetAttribute()
+*/
+#define JX_ENC_FILTER 8
+
+/** JxEncAPI attribute: Huffman bit stuffing.
+
+ Interpretation of associated data block:
+
+ NvU32 Huffman stuffing enable
+ 0 = disable
+ 1 = enable
+
+
+ Attribute can be set and get.
+ @see GFJxEncSetAttribute(), GFJxEncGetAttribute()
+*/
+#define JX_ENC_HUFF_BSTUFF 13
+
+/** JxEncAPI attribute: Motion JPEG capturing mode enable/disable.
+
+ Interpretation of associated data block:
+
+ NvU32 Motion JPEG capturing mode enable
+ 0 = disable
+ 1 = enable
+
+
+ Attribute can be set and get.
+ @see GFJxEncSetAttribute(), GFJxEncGetAttribute()
+*/
+#define JX_ENC_MOTION_JPEG 14
+
+/** JxEncAPI attribute: Raw data capturing mode enable/disable.
+
+ Interpretation of associated data block:
+
+ NvU32 Raw data capturing mode enable
+ 0 = disable
+ 1 = enable
+
+
+ Attribute can be set and get.
+ @see GFJxEncSetAttribute(), GFJxEncGetAttribute()
+*/
+#define JX_ENC_RAW_DATA 15
+
+/** JxEncAPI attribute: Re-encode a JPEG bitstream.
+
+ Registration of callback function for JPEG re-encode application:
+
+ #PGFJXDECCALLBACK structure
+
+
+ Attribute is set only.
+ @see GFJxEncSetAttribute(), GFJxEncGetAttribute()
+*/
+#define JX_ENC_BITSTREAM 16
+
+/** JxEncAPI attribute: JPEG encoding colour format.
+
+ Only YUV420 and YUV422 encoding is supported. The JPEG encoder converts
+ the incoming image to the configured colour format, and then encodes it
+ in the JPEG bitstream.
+
+ Only YUV420 and YUV422 are
+ valid.
+
+ Interpretation of associated data block:
+
+ NvU32 Colour format identifier, one of:
+ #GF_SURFACE_PLANAR_YUV422
+ #GF_SURFACE_YUV420
+
+
+ Attribute can be set and get.
+ @see GFJxEncSetAttribute(), GFJxEncGetAttribute(), GFRMSURFACE::ColorFormat
+*/
+#define JX_ENC_ENCODE_FORMAT 17
+
+/** JxEncAPI attribute: Maximum JPEG byte size.
+
+ The JPEG encoder will not generate a JPEG bitstream larger than this.
+
+ Interpretation of associated data block:
+
+ NvU32 Maximum size in bytes
+
+
+ Attribute can be set and get.
+ @see GFJxEncSetAttribute(), GFJxEncGetAttribute()
+*/
+#define JX_ENC_MAX_SIZE 18
+
+/** JxEncAPI attribute: Camera focal point.
+
+ Image area which is close to the focal point will be encoded with higher
+ quality. Takes effect only when #JX_ENC_MAX_SIZE is set.
+
+ Interpretation of associated data block:
+
+ NvU32 Focal point X position
+ NvU32 Focal point Y position
+
+
+ Attribute can be set and get.
+ @see GFJxEncSetAttribute(), GFJxEncGetAttribute(), #JX_ENC_DEGRADATION,
+ #JX_ENC_MAX_SIZE
+*/
+#define JX_ENC_FOCAL_POINT 19
+
+/** JxEncAPI attribute: Image quality degradation from focal point.
+
+ Image areas further from the focal point get encoded with fewer bits.
+ The number of bits is linearly degraded based on the percentage of
+ degradation in the X and Y directions. This attribute takes effect only
+ when JX_ENC_MAX_SIZE is set.
+
+ Interpretation of associated data block:
+
+ NvU32 X direction degradation percentage
+ NvU32 Y direction degradation percentage
+
+
+ Attribute can be set and get.
+ @see GFJxEncSetAttribute(), GFJxEncGetAttribute(), #JX_ENC_FOCAL_POINT,
+ #JX_ENC_MAX_SIZE
+*/
+#define JX_ENC_DEGRADATION 20
+
+/** JxEncAPI attribute: JPEG encode rotation and flip control.
+
+ Interpretation of associated data block:
+
+ NvU32 Rotation and flip control, one of the following constants
+ #JX_ENC_ROTATE_0
+ #JX_ENC_ROTATE_90
+ #JX_ENC_ROTATE_180
+ #JX_ENC_ROTATE_270
+ optionally logically ORed with zero or more of the following flags
+ #JX_ENC_H_FLIP
+ #JX_ENC_V_FLIP
+
+
+ Default is #JX_ENC_ROTATE_0.
+
+ Attribute can be set and get.
+ @see GFJxEncSetAttribute(), GFJxEncGetAttribute()
+*/
+#define JX_ENC_ROTATION 21
+
+/** JxEncAPI attribute: Rotation and flip control for rartial rotation API.
+
+ Enables and configures the partial rotation engine for partially rotated
+ JPEG encoding. Partially rotated JPEG encoding allows for rotated encoding
+ of large image sizes with a small image capture buffer.
+
+ Interpretation of associated data block:
+
+ NvU32 Rotation and flip control, one of the following constants
+ #JX_PRENC_ROTATE_UNSET - reset and disable partial rotation engine
+ #JX_ENC_ROTATE_0
+ #JX_ENC_ROTATE_90
+ #JX_ENC_ROTATE_180
+ #JX_ENC_ROTATE_270
+ if not #JX_PRENC_ROTATE_UNSET optionally logically ORed with zero or
+ more of the following flags
+ #JX_ENC_H_FLIP
+ #JX_ENC_V_FLIP
+
+
+ Attribute can be set and get.
+ @see GFJxEncSetAttribute(), GFJxEncGetAttribute()
+*/
+#define JX_ENC_PARTIAL_ROTATE 22
+
+/** JxEncAPI attribute: Bypass FIFO.
+
+ Interpretation of associated data block:
+
+ NvU32 Raw data capturing mode enable
+ 0 = Fetching encoded data through DMA FIFO
+ 1 = Fetching encoded data directly through output buffer not through
+ DMA FIFO
+
+
+ Attribute can be set and get.
+ @see GFJxEncSetAttribute(), GFJxEncGetAttribute()
+*/
+#define JX_ENC_BYPASS_FIFO 23
+
+/** JxEncAPI attribute: Piece-Meal encoding.
+
+ Interpretation of associated data block:
+
+ NvU32 Piece-Meal encoding enable
+ 0 = enable
+ 1 = disable
+
+
+ Attribute is get only.
+ @see GFJxEncSetAttribute(), GFJxEncGetAttribute()
+*/
+#define JX_ENC_PIECE_MEAL 24
+
+/** JxEncAPI attribute: Fetch Low bitstream.
+
+ Registration of callback function for fetching raw data stream from JPEG encoder:
+
+ #PGFJXDECCALLBACK structure
+
+
+ Attribute is set only.
+ @see GFJxEncSetAttribute(), GFJxEncGetAttribute()
+*/
+
+#define JX_ENC_RAW_DATA_STREAM 25
+
+/** JxEncAPI attribute: Fetch Low JPEG bitstream.
+
+ Registration of callback function for fetching JPEG raw data stream from JPEG encoder:
+
+ #PGFJXDECCALLBACK structure
+
+
+ Attribute is set only.
+ @see GFJxEncSetAttribute(), GFJxEncGetAttribute()
+*/
+
+#define JX_ENC_RAW_JPEG_CAPTURE 26
+
+/** JxEncAPI attribute: Set Timeout value
+
+
+ Interpretation of associated data block:
+
+ NvU32 timeout timeout value
+ 0 = no timeout
+ > 0 = timeout value
+
+
+ Attribute is set only.
+ @see GFJxEncSetAttribute(), GFJxEncGetAttribute()
+*/
+
+#define JX_ENC_TIMEOUT_CONF 27
+
+/** JxEncAPI attribute: Stop preview enable/disable.
+
+ Interpretation of associated data block:
+
+ NvU32 Stop preview mode enable
+ 0 = disable
+ 1 = enable
+
+
+ Attribute can be set and get.
+ @see GFJxEncSetAttribute(), GFJxEncGetAttribute()
+*/
+
+#define JX_ENC_STOP_PREVIEW 28
+
+
+/** Option for attributes #JX_ENC_ROTATION, #JX_ENC_PARTIAL_ROTATE:
+ Non-rotated JPEG encode.
+ @see #JX_ENC_ROTATION, #JX_ENC_PARTIAL_ROTATE, GFJxEncSetAttribute(),
+ GFJxEncGetAttribute()
+*/
+
+#define JX_ENC_ROTATE_0 0x0
+
+/** Option for attributes #JX_ENC_ROTATION, #JX_ENC_PARTIAL_ROTATE:
+ JPEG encode rotated 90 degrees.
+ @see #JX_ENC_ROTATION, #JX_ENC_PARTIAL_ROTATE, GFJxEncSetAttribute(),
+ GFJxEncGetAttribute()
+*/
+#define JX_ENC_ROTATE_90 0x1
+
+/** Option for attributes #JX_ENC_ROTATION, #JX_ENC_PARTIAL_ROTATE:
+ JPEG encode rotated 180 degrees.
+ @see #JX_ENC_ROTATION, #JX_ENC_PARTIAL_ROTATE, GFJxEncSetAttribute(),
+ GFJxEncGetAttribute()
+*/
+#define JX_ENC_ROTATE_180 0x2
+
+/** Option for attributes #JX_ENC_ROTATION, #JX_ENC_PARTIAL_ROTATE:
+ JPEG encode rotated 270 degrees.
+ @see #JX_ENC_ROTATION, #JX_ENC_PARTIAL_ROTATE, GFJxEncSetAttribute(),
+ GFJxEncGetAttribute()
+*/
+#define JX_ENC_ROTATE_270 0x3
+
+/** Option for attributes #JX_ENC_ROTATION, #JX_ENC_PARTIAL_ROTATE:
+ JPEG encode horizontally flipped.
+ @see #JX_ENC_ROTATION, #JX_ENC_PARTIAL_ROTATE, GFJxEncSetAttribute(),
+ GFJxEncGetAttribute()
+*/
+#define JX_ENC_H_FLIP 0x10
+
+/** Option for attributes #JX_ENC_ROTATION, #JX_ENC_PARTIAL_ROTATE:
+ JPEG encode vertically flipped.
+ @see #JX_ENC_ROTATION, #JX_ENC_PARTIAL_ROTATE, GFJxEncSetAttribute(),
+ GFJxEncGetAttribute()
+*/
+#define JX_ENC_V_FLIP 0x20
+
+/** Option for attribute #JX_ENC_PARTIAL_ROTATE: Reset and disable partial
+ rotation.
+ Pass this to GFJxEncSetAttribute() for attribute #JX_ENC_PARTIAL_ROTATE
+ to unset the Partial Rotation Flag and reset the PR Engine.
+ @see #JX_ENC_PARTIAL_ROTATE, GFJxEncSetAttribute(), GFJxEncGetAttribute()
+*/
+#define JX_ENC_ROTATE_UNSET 0xff
+
+typedef void (*GFJX_ENC_CALLBACK)(void *userData);
+
+/** JxEncAPI interrupt operation types.
+ Constants to specify operation for a call to GFJxEncInterruptControl().
+ @see GFJX_ENC_INTERRUPT_TYPE, GFJxEncInterruptControl()
+*/
+typedef enum
+{
+ /** Enable interrupt/status assertion for an interrupt type. */
+ GFJX_ENC_INTERRUPT_ENABLE,
+
+ /** Disable interrupt/status assertion for an interrupt type. */
+ GFJX_ENC_INTERRUPT_DISABLE,
+
+ /** Clear interrupt/status assertion for an interrupt type. */
+ GFJX_ENC_INTERRUPT_CLEAR,
+
+ /** Query for interrupt/status assertion for an interrupt type. */
+ GFJX_ENC_INTERRUPT_QUERY_STATUS,
+
+ /** Set DMA FIFO threshold. */
+ GFJX_ENC_INTERRUPT_SET_DMA_FIFO_THRESHOLD,
+
+ /** Get DMA FIFO threshold. */
+ GFJX_ENC_INTERRUPT_GET_DMA_FIFO_THRESHOLD,
+
+ /** Set strean buffer threshold. */
+ GFJX_ENC_INTERRUPT_SET_BUF_THRESHOLD,
+
+ /** Get strean buffer threshold. */
+ GFJX_ENC_INTERRUPT_GET_BUF_THRESHOLD
+
+} GFJX_ENC_INTERRUPT_OPERATION_TYPE;
+
+
+/** JxEncAPI interrupt types.
+ @see GFJX_ENC_INTERRUPT_OPERATION_TYPE, GFJxEncInterruptControl()
+*/
+typedef enum
+{
+ /** JPEG read DMA FIFO low threshold.
+ Interrupt/status is asserted if the JPEG read DMA FIFO status is less
+ than the JPEG read DMA FIFO threshold value.
+ */
+ GFJX_ENC_DMA_FIFO_LOW_INTR = 0,
+
+ /** JPEG read DMA FIFO high threshold.
+ Interrupt/status is asserted if the JPEG read DMA FIFO status is
+ greater than or equal to the JPEG read DMA FIFO threshold value.
+ */
+ GFJX_ENC_DMA_FIFO_HIGH_INTR = 0x1,
+
+ /** Stream buffer threshold interrupt. */
+ GFJX_ENC_STREAM_BUF_INTR = 0x2,
+
+ /** Main buffer end hit interrupt. */
+ GFJX_ENC_MAIN_BUF_HIT_INTR = 0x4,
+
+ /** Encoding done interrupt. */
+ GFJX_ENC_DONE_INTR = 0x8,
+
+ /** Encoded stream transfer done interrupt. */
+ GFJX_ENC_TRANSFER_DONE_INTR = 0x10,
+
+ /** Maximum bit count hit interrupt. */
+ GFJX_ENC_MAX_BIT_HIT_INTR = 0x20,
+
+ /** Circular buffer overflow interrupt. */
+ GFJX_ENC_CIR_BUF_OVERFLOW_INTR = 0x40
+
+} GFJX_ENC_INTERRUPT_TYPE;
+
+/** JxEncAPI virtual function pointer table. */
+typedef struct _GFJXENCTABLE
+{
+ GF_RETTYPE (* JxEncGetProperty)(GFJxEncHandle hJxEnc, PGFPROPERTY pJXProp);
+ GF_RETTYPE (* JxEncSetAttribute)(GFJxEncHandle hJxEnc,
+ NvU32 uiFeature, NvU32* pInfo);
+ GF_RETTYPE (* JxEncGetAttribute)(GFJxEncHandle hJxEnc,
+ NvU32 uiFeature, NvU32* pInfo);
+ GF_RETTYPE (* JxEncStart)(GFJxEncHandle hJxEnc, PGFJXENCSTART pStart);
+ GF_RETTYPE (* JxEncFetchImage)(GFJxEncHandle hJxEnc,
+ PGFJXENC_BUF aBuf, NvU32 nBuf, NvU32 *pStatus);
+ GF_RETTYPE (* JxEncEnd)(GFJxEncHandle hJxEnc);
+ GF_RETTYPE (* JxEncSetupInterrupt)(GFJxEncHandle hJxEnc,
+ void (*Inter)(void *), void *IPara);
+ GF_RETTYPE (* JxEncCapture)(GFJxEncHandle hJxEnc,
+ PGFJXENC_BUF aBuf, NvU32 nBuf, NvU32 *pStatus);
+ GF_RETTYPE (* JxEncInterruptControl)(GFJxEncHandle hJxEnc,
+ GFJX_ENC_INTERRUPT_TYPE IntType, GFJX_ENC_INTERRUPT_OPERATION_TYPE op,
+ void * pData);
+ GF_RETTYPE (* JxEncInterruptHandler)(GFJxEncHandle hJxEnc,
+ GFJX_ENC_INTERRUPT_TYPE IntType, void * pData); // Reserved.
+ GF_RETTYPE (*JxEncPRComplete)(GFJxEncHandle hJxEnc,
+ PGFJXENC_BUF inBuf,NvU32 inBufNum,PGFJXENC_BUF outBuf,
+ NvU32 outBufNum,PGFJXENC_BUF dcacBuf,NvU32 dcacBufNum);
+ GF_RETTYPE (*JxEncBracket)(GFJxEncHandle hJxEnc,
+ GFJX_ENC_CALLBACK before,
+ GFJX_ENC_CALLBACK after,
+ void *userData);
+} GFJXENCTABLE, *PGFJXENCTABLE;
+
+#ifdef PROJECT_SEC_G1
+// Attribute constant and data structure for EXIF
+#define JX_ENC_SET_EXIF_INFO 30
+
+typedef struct _GFJXENCEXIFINFO
+{
+ NvS8 CameraMaker[32];
+ NvS8 CameraModel[40];
+ NvS8 FirmwareVersion[5];
+ NvU32 FNumberNum;
+ NvU32 FNumberDenom;
+ NvS32 ExpBiasNum;
+ NvS32 ExpBiasDenom;
+ NvU16 WhiteBalance;
+ NvU32 DigitalZoomNum;
+ NvU32 DigitalZoomDenom;
+} GFJXENCEXIFINFO;
+#endif
+
+// Typesafe functions for opening and closing this component
+GF_RETTYPE GFJxEncOpen(GFRmHandle hRm, GFJxEncHandle *phJxEnc,
+ GF_STATE_TYPE state, GFRmChHandle hCh);
+void GFJxEncClose(GFJxEncHandle *phJxEnc);
+
+/* #### JxEnc Helper macros. Maybe useful for backward compatible API. #### */
+
+/** @name Functions
+@{*/
+
+/** This function returns version and capabilities of API and hardware.
+
+ @param hJxEnc (#GFJxEncHandle) Handle to JxEncAPI
+ @param pJXProp (PGFPROPERTY) Pointer to property structure to be filled in
+
+ @retval #GF_SUCCESS \a pJXProp filled in successfully
+ @retval #GF_ERROR Some error occured
+
+ The #GFPROPERTY structure passed with parameter \a pJXProp will be
+ filled in on successfull return. The GFPROPERTY::Capability field
+ will hold a combination of flagbits indicating capabilities specific
+ to the JxEncAPI:
+
+
+ #GF_JX_ENC_CAP_QTABLE
+ JPEG quantization table is programmable.
+ #GF_JX_ENC_CAP_INTERRUPT
+ Interrupt data capture mode and polling mode supported,
+ if this flag is off then only polling mode is supported.
+ #GF_JX_ENC_CAP_DIGITAL_ZOOM
+ Digital zoom supported.
+ #GF_JX_ENC_CAP_MOTION_JPEG
+ Motion JPEG mode supported.
+ #GF_JX_ENC_CAP_RATE_CONTROL
+ Rate control supported.
+ #GF_JX_ENC_CAP_422_PLANAR
+ Planar YUV422 data supported.
+ #GF_JX_ENC_CAP_ROTATION
+ Rotation supported.
+
+
+ It is a good practice to call this function to query for the API version
+ and its capabilities before using the rest of the JxEncAPI functions.
+
+ @see GFPROPERTY
+*/
+#define GFJxEncGetProperty(hJxEnc, pJXProp) \
+ ((PGFJXENCTABLE)hJxEnc)->JxEncGetProperty(hJxEnc, pJXProp)
+
+/** Set configuration of a feature of the JPEG encoder hardware.
+
+ @param hJxEnc (#GFJxEncHandle) Handle to JxEncAPI
+ @param uiFeature (NvU32) Feature type identifier, see table.
+ @param pInfo (NvU32*) Pointer to feature specific input parameter block.
+ Pointer type will be reinterpreted according to
+ feature type.
+
+ @retval #GF_SUCCESS Configuration changed successfully
+ @retval #GF_ERROR Some error occured
+
+ The feature to be set is identified with parameter \a uiFeature,
+ specific input parameters are passed via a block in parameter \a pInfo.
+ The contents of this data block is interpreted depending on the
+ feature to be set.
+
+ The following features are defined, for the data to be provided in
+ \a pInfo see the individual attribute's documentation.
+
+
+ \b Attribute \b Direction \b Synopsis
+ #JX_ENC_SET_100QUALITY set
+ Choose preset QTable, coefficients in luma
+ and chroma Qtable are all 1.
+ #JX_ENC_SET_85QUALITY set
+ Choose preset QTable, standard Qtable A and B,
+ divided by 2.
+ #JX_ENC_SET_75QUALITY set
+ Choose preset QTable, standard Qtable A and B.
+ #JX_ENC_SET_50QUALITY set
+ Choose preset QTable, standard Qtable C and D.
+ #JX_ENC_SET_25QUALITY set
+ Choose preset QTable, standard Qtable C and D,
+ multiplied by 2.
+ #JX_ENC_SET_12QUALITY set
+ Choose preset QTable, standard Qtable C and D,
+ multiplied by 4.
+ #JX_ENC_LQTABLE set, get
+ Set custom luma QTable.
+ #JX_ENC_CQTABLE set, get
+ Set custom chroma QTable.
+ #JX_ENC_FILTER set, get
+ Decimation filter enable/disable.
+ #JX_ENC_HUFF_BSTUFF set, get
+ Huffman bit stuffing.
+ #JX_ENC_MOTION_JPEG set, get
+ Motion JPEG capturing mode enable/disable.
+ #JX_ENC_RAW_DATA set, get
+ Raw data capturing mode enable/disable.
+ #JX_ENC_BITSTREAM set
+ Re-encode a JPEG bitstream.
+ #JX_ENC_ENCODE_FORMAT set, get
+ JPEG encoding colour format.
+ #JX_ENC_MAX_SIZE set, get
+ Maximum JPEG byte size.
+ #JX_ENC_FOCAL_POINT set, get
+ Camera focal point.
+ #JX_ENC_DEGRADATION set, get
+ Image quality degradation from focal point.
+ #JX_ENC_ROTATION set, get
+ JPEG encode rotation and flip control.
+ #JX_ENC_PARTIAL_ROTATE set, get
+ Rotation and flip control for Partial Rotation API.
+ #JX_ENC_BYPASS_FIFO set, get
+ Bypass FIFO.
+ #JX_ENC_PIECE_MEAL get
+ Piece-Meal encoding.
+ #JX_ENC_STOP_PREVIEW set, get
+ Stop preview mode enable/disable.
+ #JX_ENC_RAW_JPEG_CAPTURE set
+ Fetch Low JPEG bitstream.
+ #JX_ENC_RAW_DATA_STREAM set
+ Fetch Low bitstream.
+ #JX_ENC_TIMEOUT_CONF set, get
+ Set Timeout value.
+
+
+ Most of the time an application should only set a quantization table for
+ luminance or chrominance. These quantization tables are in the same format
+ as standard quantization tables (1 to 255). Other features are hardware
+ dependent.
+
+ @see GFJxEncGetAttribute()
+*/
+#define GFJxEncSetAttribute(hJxEnc, uiFeature, pInfo) \
+ ((PGFJXENCTABLE)hJxEnc)->JxEncSetAttribute(hJxEnc, uiFeature, pInfo)
+
+/** Get current configuration of a feature of the JPEG encoder hardware.
+
+ @param hJxEnc (#GFJxEncHandle) Handle to JxEncAPI
+ @param uiFeature (NvU32) Feature type identifier,
+ see table in GFJxEncSetAttribute().
+ @param pInfo (NvU32*) Pointer to feature specific input parameter block.
+ Pointer type will be reinterpreted according to
+ feature type.
+
+ @retval #GF_SUCCESS \a pInfo filled in successfully
+ @retval #GF_ERROR Some error occured
+
+ @see GFJxEncSetAttribute()
+*/
+#define GFJxEncGetAttribute(hJxEnc, uiFeature, pInfo) \
+ ((PGFJXENCTABLE)hJxEnc)->JxEncGetAttribute(hJxEnc, uiFeature, pInfo)
+
+/** Setup JxEncAPI for JPEG encoding.
+
+ @param hJxEnc (#GFJxEncHandle) Handle to JxEncAPI
+ @param pStart (#PGFJXENCSTART) Pointer to #GFJXENCSTART structure for
+ definition of encode source and destination
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured, check GFJXENCSTART::Error for
+ detailed error reason code.
+
+ Before starting capture, the application should call this function to setup
+ the encoder. Once this function has been called, the application can use
+ GFJxEncCapture() to capture as many frames as desired. JxEncCapture()
+ starts and optionally fetches data for a frame. JxEncFetchImageData()
+ fetches the image data to host CPU side. An application should keep calling
+ it until all encoded data is processed. Finally GFJxEncEnd() has to be
+ called to release the encoder.
+
+ Parameter \a pStart passes a #GFJXENCSTART structure describing image data
+ source, source cropping area, and destination size.
+
+ Encoding is from one of the following sources:
+ - VI (Camera, cropping and scale up/down is done via VxVIPSet(),
+ Rotation/flip is done via JxEncSelectEPPRotation() )
+ - Screen encoding (GC, source is primary surface)
+ - Bitstream encoding. This is used to re-encode a JPEG bit stream, and
+ invokes JxDecAPI internally to decode the existing bitstream.
+ The following options are available for bitstream re-encoding:
+ - Crop image size
+ - Scale up
+ - Change QTables
+ - Apply rate control
+ - Rotation (0, 90, 180, 270, H-Flip, V-Flip)
+
+ On failure an error reason code is returned in field GFJXENCSTART::Error of
+ parameter \a pStart.
+
+ @see GFJXENCSTART, GFJxEncSetAttribute(), GFJxEncCapture(),
+ GFJxEncFetchImage(), GFJxEncEnd()
+*/
+#define GFJxEncStart(hJxEnc, pStart) \
+ ((PGFJXENCTABLE)hJxEnc)->JxEncStart(hJxEnc, pStart)
+
+/** Polls JxEncAPI for data fetch from JPEG encoder.
+
+ @param hJxEnc (#GFJxEncHandle) Handle to JxEncAPI
+ @param aBuf (#PGFJXENC_BUF) Pointer to array of #GFJXENC_BUF structures
+ @param nBuf (NvU32) Number of pointers passed with \a aBuf.
+ @param pStatus (NvU32) Returns data fetch status, see table
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ Captures the JPEG encoded bit stream in the given application owned
+ buffers. Capturing the encoded image can be done in polling or interrupt
+ mode. This function should be called after GFJxEncCapture(). It is usually
+ called from either the application's fetching poll loop, or the interrupt
+ callback routine set up with GFJxEncSetupInterrupt().
+
+ The application must fill all the fields in the referenced buffer
+ structures and must make sure each PGFJXENC_BUF::nBytesCaptured is set
+ to 0. The PGFJXENC_BUF::nBytesCaptured field is updated by the JXEncAPI
+ to show the actual number of bytes captured. JXEncAPI keeps filling the
+ buffers in the array until it exhausts all the buffers. If all the buffers
+ are exhausted and there is more data to be copied, the function returns
+ and sets \a pStatus to #JXENC_MORE_FETCH. The application should then keep
+ calling GFJxEncFetchImage() to fetch the remaining data. Each buffer in
+ the array should be a multiple of 64 bytes for best performance.
+
+ The status of the data fetch is returned in \a pStatus as one of the
+ following reason codes:
+
+
+ #JXENC_DATA_COMPLETE All data of the current frame was
+ fetched.
+ #JXENC_MORE_FETCH Data was fetched only partially.
+ The application should make more calls to GFJxEncFetchImage() to
+ fetch the rest.
+ #JXENC_NEW_FRAME A new frame was encoded and is ready
+ to fetch.
+ #JXENC_TIME_OUT Timeout on GFJxEncFetchImage
+
+
+
+ @see GFJxEncCapture(), GFJxEncSetupInterrupt(), #GFJXENC_BUF
+*/
+#define GFJxEncFetchImage(hJxEnc, aBuf, nBuf, pStatus) \
+ ((PGFJXENCTABLE)hJxEnc)->JxEncFetchImage(hJxEnc, aBuf, nBuf, pStatus)
+
+/** Polls JxEncAPI for data fetch from JPEG encoder.
+
+ @param hJxEnc (#GFJxEncHandle) Handle to JxEncAPI
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ This function disables the encoder and releases internal resources related
+ to the current capture.
+
+ @see GFJxEncStart()
+*/
+#define GFJxEncEnd(hJxEnc) \
+ ((PGFJXENCTABLE)hJxEnc)->JxEncEnd(hJxEnc)
+
+/** Register a callback function for fetching encoded JPEG data.
+
+ @param hJxEnc (#GFJxEncHandle) Handle to JxEncAPI
+ @param Inter (void(*)(void *)) Application callback function pointer
+ @param IPara (void*) Parameter to pass on to application callback function
+
+ @retval #GF_SUCCESS Callback installed successfully
+ @retval #GF_ERROR Some error occured
+
+ This function can be used to register a callback function for fetching
+ encoded JPEG data. This function must be called before GFJxEncCapture().
+ The callback function must meet the following prototype:
+
+
+ void InterruptCallback(void* lPara);
+
+
+ Whenever encoding is triggered, JXEncAPI calls the registered interrupt
+ callback function, passing on the application defined parameter \a IPara.
+
+ Inside the callback function, the application can call GFJxEncFetchImage()
+ to portionally fetch the encoded datastream.
+
+ If no callback function shall be used, the application could alternatively
+ use a polling scheme.
+
+ @see GFJxEncCapture()
+*/
+#define GFJxEncSetupInterrupt(hJxEnc, Inter, IPara) \
+ ((PGFJXENCTABLE)hJxEnc)->JxEncSetupInterrupt(hJxEnc, Inter, IPara)
+
+/** Trigger JPEG encoder for one frame and optionally display capture preview.
+
+ @param hJxEnc (#GFJxEncHandle) Handle to JxEncAPI
+ @param aBuf (#PGFJXENC_BUF) Pointer to array #GFJXENC_BUF structures
+ @param nBuf (NvU32) Number of pointers passed with \a aBuf, if
+ passing 0 then the function is non-blocking
+ @param pStatus (NvU32) Returns data fetch status, for reason codes
+ see table at GFJxEncFetchImage()
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ Triggers the JPEG encoder for a frame and optionally displays the same
+ frame in a preview window in decimated form.
+
+ Encoded data can be fetched via a polling scheme or via an interrupt
+ handler set up with GFJxEncSetupInterrupt(). In any case
+ GFJxEncFetchImage() is used to transfer encoded data to application
+ buffers.
+
+ If application set up an interrupt handler to fetch encoded data, then
+ \a nBuf should be passed as 0.
+
+ This function can optionally fetch data right after triggering encoding to
+ buffers provided via \a aBuf. This will block the CPU until all data is
+ returned or buffer space is exhausted. If \a nBuf is 0, the function
+ returns right away and \a pStatus is updated to #JXENC_NEW_FRAME to
+ indicate data is pending. The application should then call
+ GFJxEncFetchImage() either from an interrupt handler or from same thread to
+ fetch the encoded/raw data.
+
+ If \a nBuf is not 0, it specifies the number of buffers in the array
+ \a aBuf. The function will block until it runs out of buffers. It
+ will return #JXENC_MORE_FETCH in parameter \a pStatus if more data is
+ available. The application must call GFJxEncFetchImage() to fetch the
+ remaining data. See GFJxEncFetchImage() for information on return
+ status codes and how the passed buffers are handled.
+
+ JPEG Encoding from camera or raw data capture from camera happens in
+ realtime, so if the internal circular buffer in GPU memory is not big
+ enough then GFJxEncFetchImage() should be called more fequently to empty
+ the outputBuf and avoid buffer overflows.
+
+ @see GFJxEncSetupInterrupt(), GFJxEncFetchImage(), #GFJXENC_BUF
+*/
+#define GFJxEncCapture(hJxEnc, aBuf, nBuf, pStatus) \
+ ((PGFJXENCTABLE)hJxEnc)->JxEncCapture(hJxEnc, aBuf, nBuf, pStatus)
+
+/** JxEncAPI Component-level interrupt control.
+
+ @param hJxEnc (#GFJxEncHandle) Handle to JxEncAPI
+ @param IntType (#GFJX_ENC_INTERRUPT_TYPE) JxEncAPI interrupt type
+ @param op (#GFJX_ENC_INTERRUPT_OPERATION_TYPE) GFJxEncAPI interrupt
+ operation
+ @param pData (void*) Pointer to input or output data block, see table
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+ @retval #GF_ERROR_BAD_PARAMETER Invalid parameters
+
+ The following operations (parameter op ) are defined for this call.
+
+ Operation #GFJX_ENC_INTERRUPT_ENABLE
+
+ Enable status/interrupt generation for interrupts of type specified by
+ \a IntType.
+
+ Depending on the interrupt type additional action and the parameter
+ \a pData is interpreted as following:
+
+
+ #GFJX_ENC_DMA_FIFO_LOW_INTR
+ JPEG read DMA FIFO status/interrupt generation is put into low
+ threshold mode, i.e. interrupt/status is asserted if the JPEG
+ read DMA FIFO status is less than the threshold value.
+
+ \a pData points to block containing:
+ NvU32 DMA FIFO low threshold value in range 0..15
+
+ \a pData can be NULL to leave the threshold value unchanged.
+
+
+
+ #GFJX_ENC_DMA_FIFO_HIGH_INTR
+ JPEG read DMA FIFO status/interrupt generation is put into
+ high threshold mode, i.e. interrupt/status is asserted if the
+ JPEG read DMA FIFO status is greater than or equal toless than
+ the threshold value.
+
+ \a pData points to block containing:
+ NvU32 DMA FIFO high threshold value in range 0..15
+
+ \a pData can be NULL to leave the threshold value unchanged.
+
+
+
+ #GFJX_ENC_STREAM_BUF_INTR
+ \a pData points to block containing:
+ NvU32 JPEG stream buffer threshold value in bytes, must
+ be multiple of 8
+
+ \a pData can be NULL to leave the threshold value unchanged.
+
+
+
+ otherwise
+ \a pData is ignored
+
+
+
+ Operation #GFJX_ENC_INTERRUPT_DISABLE
+
+ Disable status/interrupt generation for interrupts of type specified by
+ \a IntType.
+
+ Operation #GFJX_ENC_INTERRUPT_CLEAR
+
+ Clear status/interrupt assertion for interrupt of type specified by
+ \a IntType.
+
+ Operation #GFJX_ENC_INTERRUPT_QUERY_STATUS
+
+ Return current status/interrupt assertion for interrupt of type
+ specified by \a IntType. The state is returned in the block referenced
+ by \a pData.
+
+ Interpretation of associated data block \a pData
+
+ NvU32 Interrupt/status assertion state, one of:
+ GF_INTERRUPT_ON_STATUS_TRUE = asserted
+ GF_INTERRUPT_ON_STATUS_FALSE = not asserted
+
+
+ Operation #GFJX_ENC_INTERRUPT_SET_DMA_FIFO_THRESHOLD
+
+ Set DMA FIFO threshold value that controls interrupt/status assertion
+ for interrupt types #GFJX_ENC_DMA_FIFO_LOW_INTR and
+ #GFJX_ENC_DMA_FIFO_HIGH_INTR.
+
+ Interpretation of associated data block \a pData
+
+ NvU32 DMA FIFO threshold value in range 0..15
+
+
+ Operation #GFJX_ENC_INTERRUPT_GET_DMA_FIFO_THRESHOLD
+
+ Return DMA FIFO threshold value that controls interrupt/status
+ assertion for interrupt types #GFJX_ENC_DMA_FIFO_LOW_INTR and
+ #GFJX_ENC_DMA_FIFO_HIGH_INTR.
+
+ Interpretation of associated data block \a pData
+
+ NvU32 DMA FIFO threshold value in range 0..15
+
+
+ Operation #GFJX_ENC_INTERRUPT_SET_BUF_THRESHOLD
+
+ Set JPEG stream buffer threshold value that controls interrupt/status
+ assertion for interrupt type #GFJX_ENC_STREAM_BUF_INTR.
+
+ Interpretation of associated data block \a pData
+
+ NvU32 DMA read buffer threshold value in bytes, must be multiple of 8
+
+
+ Operation #GFJX_ENC_INTERRUPT_GET_BUF_THRESHOLD
+
+ Return JPEG stream buffer threshold value that controls
+ interrupt/status assertion for interrupt type
+ #GFJX_ENC_STREAM_BUF_INTR.
+
+ Interpretation of associated data block \a pData
+
+ NvU32 DMA read buffer threshold value in bytes, must be multiple of 8
+
+
+ @see GFJX_ENC_INTERRUPT_TYPE, GFJX_ENC_INTERRUPT_OPERATION_TYPE
+*/
+#define GFJxEncInterruptControl(hJxEnc, IntType, op, pData)\
+ ((PGFJXENCTABLE)hJxEnc)->JxEncInterruptControl(hJxEnc, IntType, op, pData)
+
+/** Standard interrupt handler for fetching encoded JPEG data.
+
+ @param hJxEnc (#GFJxEncHandle) Handle to JxEncAPI
+ @param IntType (#GFJX_ENC_INTERRUPT_TYPE) JxEncAPI interrupt type
+ @param pData (void*) Pointer to input or output data block,
+ depending on \a IntType. See table.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+
+ \a IntType Interpretation of \a pData
+ #GFJX_ENC_STREAM_BUF_INTR, GFJX_ENC_DONE_INTR
+ #PGFJXENC_FETCH_BUF
+
+
+ Usually this callback is not used, because the interrupt service thread
+ at the application level can call GFJxEncFetchImage() directly to
+ complete the task of fetching encoded data.
+
+ @todo clarify
+ @see GFJxEncFetchImage()
+*/
+#define GFJxEncInterruptHandler(hJxEnc, IntType, pData)\
+ ((PGFJXENCTABLE)hJxEnc)->JxEncInterruptHandler(hJxEnc, IntType, pData)
+
+/** Generate final JPEG bitstream from a partially rotated bitstream.
+
+ @param hJxEnc (#GFJxEncHandle) Handle to JxEncAPI
+ @param inBuf (#PGFJXENC_BUF) Pointer to array of #GFJXENC_BUF structs
+ holding fragmented input bitstream
+ @param inBufNum (NvU32) Size of array \a inBuf
+ @param outBuf (#PGFJXENC_BUF) Pointer to array of #GFJXENC_BUF structs
+ to output fragmented JPEG bitstream
+ @param outBufNum (NvU32) Size of array \a outBuf
+ @param dcacBuf (#PGFJXENC_BUF) ?
+ @param dcacBufNum (NvU32) Size of array \a dcacBuf
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ @todo clarify
+*/
+#define GFJxEncPRComplete(hJxEnc,inBuf,inBufNum,outBuf,outBufNum,dcacBuf,dcacBufNum)\
+ ((PGFJXENCTABLE)hJxEnc)->JxEncPRComplete(hJxEnc,inBuf,inBufNum,outBuf,outBufNum,dcacBuf,dcacBufNum)
+
+/** Provide callbacks for immediately before and after any encode events.
+ These will be called by JxEncode() when it is invoked.
+ Calling this routine a second time will overwrite previously set
+ values.
+
+ @param hJxEnc (#GFJxEncHandle) Handle to JxEncAPI
+ @param before (#GFJX_ENC_CALLBACK) proc to call before capture
+ @param after (#GFJX_ENC_CALLBACK) proc to call after capture
+ @param userData (void *) data to be supplied to before() and
+ after() when they are invoked.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+*/
+#define GFJxEncBracket(hJxEnc, before, after, userData) \
+ ((PGFJXENCTABLE)hJxEnc)->JxEncBracket(hJxEnc, before, after, userData)
+
+/*@}*/
+/*@}*/
+ /** @page pageJxEncAppNotes JxEncAPI Application Notes
+
+ @section pageJxEncAppNotes1 Programming Sequence
+
+ The following procedure requires that GFRmOpen() is called first to start GFSDK usage.
+ The description is for a typical case where encoding of a still image being captured
+ from a camera is done and preview shown on the display.
+
+ 1. In case of camera encoding, setup the camera & initialize VIP.
+
+ 2. Obtain the handle specific to JPEG encoder by calling GFJxEncOpen().
+
+ 3. Call GFRmSurfaceAlloc() to allocate one referance surface for encoding purposes.
+
+ 4. Call GFJxEncSetAttribute() if specific features need to be set,
+ such as encoding width, encoding height, rotation, quality factor, etc.
+
+ 5. Start the encoding by calling GFJxEncStart().
+
+ 6. If the current source image is from the CPU, the application should call GFJxEncFeedImage()
+ to feed the image to the GFJxEncAPI via GFJxEncCapture().
+
+ 7. The application should fetch the encoded stream by calling GFJxEncFetchImage().
+ Application should keep it calling till whole encoded data is out.
+
+ 8. For exiting, free all relevent resources and call GFJxEncEnd() to free the JPEG encoder component.
+
+ */
+#ifdef __cplusplus
+} // only need to export C interface if
+ // used by C++ source code
+#endif
+
+#endif //_GF_JPEG_ENC__
diff --git a/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFMinimalIsp.h b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFMinimalIsp.h
new file mode 100755
index 00000000..5f5546d3
--- /dev/null
+++ b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFMinimalIsp.h
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2007 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an express
+ * license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+#ifndef __GFMINIMALISP_H_
+#define __GFMINIMALISP_H_
+
+#include "GF.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+GF_RETTYPE GFMinimalIspOpen(GFRmHandle hRm, GFMinimalIspHandle *phIsp,
+ GF_STATE_TYPE state, GFRmChHandle hCh);
+void GFMinimalIspClose(GFMinimalIspHandle *phIsp);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFMmProc.h b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFMmProc.h
new file mode 100755
index 00000000..1489db73
--- /dev/null
+++ b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFMmProc.h
@@ -0,0 +1,1766 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/** @file GFMmProc.h
+ GFSDK Multimedia Processor API header file.
+*/
+
+#ifndef __GFMmProc_H__
+#define __GFMmProc_H__
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+/** @addtogroup groupMmProc MmProcAPI Multimedia Processor API
+*/
+/*@{*/
+
+// Typesafe functions for opening and closing this component
+GF_RETTYPE GFMmProcOpen(GFRmHandle hRm, GFMmProcHandle *phMmProc,
+ GF_STATE_TYPE state, GFRmChHandle hCh);
+void GFMmProcClose(GFRmHandle hRm, GFMmProcHandle *phMmProc);
+
+//*****************************************************************************
+//*****************************************************************************
+//
+// Packages
+//
+//*****************************************************************************
+//*****************************************************************************
+
+//
+// These defines are used to import or remove functionality within the audio
+// engine.
+//
+//#define GFMMPROC_BASIC_AUDIO
+
+//
+// Adds audio controls to the package beyond basic playback.
+//
+//#define GFMMPROC_BASIC_AUDIO
+
+//
+// Adds advanced multimedia processing and functionality.
+//
+// NOTE: Currently the advanced feature set requires the basic level of audio
+// support. This requirement may not be present in future revisions.
+//
+//#define GFMMPROC_BASIC_AUDIO
+//#define GFMMPROC_ADVANCED
+
+//
+// Adds 3D audio controls (requires GFMMPROC_ADVANCED).
+//
+//#define GFMMPROC_BASIC_AUDIO
+//#define GFMMPROC_ADVANCED
+//#define GFMMPROC_ADVANCED_3D_AUDIO_CONTROLS
+
+//
+// Adds advanced controls (requires GFMMPROC_ADVANCED).
+//
+//#define GFMMPROC_BASIC_AUDIO
+//#define GFMMPROC_ADVANCED
+//#define GFMMPROC_ADVANCED_CONTROLS
+
+//
+// Adds global effect audio controls (requires GFMMPROC_ADVANCED_CONTROLS).
+//
+//#define GFMMPROC_BASIC_AUDIO
+//#define GFMMPROC_ADVANCED
+//#define GFMMPROC_ADVANCED_CONTROLS
+//#define GFMMPROC_ADVANCED_AUDIO_EFFECT_CONTROLS
+
+
+//*****************************************************************************
+//*****************************************************************************
+//
+// Defines
+//
+//*****************************************************************************
+//*****************************************************************************
+
+#if defined GFMMPROC_BASIC_AUDIO || defined GFMMPROC_ADVANCED
+#define GFMMPROC_TIME_UNITS_PER_SECOND 1000000
+#endif
+
+typedef GF_HANDLE GFMMPROC_OBJECT;
+
+
+//*****************************************************************************
+// Object
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_OBJECT_TABLE
+{
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+} GFMMPROC_OBJECT_TABLE;
+
+#define GFMMPROC_OBJECT_DEFAULT_STR "Object"
+#define GFMMPROC_OBJECT_MANAGER_STR "Manager"
+#define GFMMPROC_OBJECT_GLOBAL_MANAGER_STR "GlobalManager"
+#define GFMMPROC_OBJECT_PLAYER_STR "Player"
+#define GFMMPROC_OBJECT_SOUND_SOURCE_3D_STR "SoundSource3D"
+#define GFMMPROC_OBJECT_SPECTATOR_STR "Spectator"
+#define GFMMPROC_OBJECT_MODULE_STR "Module"
+#define GFMMPROC_OBJECT_MEDIA_PROCESSOR_STR "MediaProcessor"
+#define GFMMPROC_OBJECT_CODEC_STR "Codec"
+
+#define GFMMPROC_CONTROL_DEFAULT_STR "Control"
+#define GFMMPROC_CONTROL_MIDI_STR "MIDI"
+#define GFMMPROC_CONTROL_PITCH_STR "Pitch"
+#define GFMMPROC_CONTROL_RATE_STR "Rate"
+#define GFMMPROC_CONTROL_RECORD_STR "Record"
+#define GFMMPROC_CONTROL_STOP_TIME_STR "StopTime"
+#define GFMMPROC_CONTROL_TEMPO_STR "Tempo"
+#define GFMMPROC_CONTROL_TONE_STR "Tone"
+#define GFMMPROC_CONTROL_VOLUME_STR "Volume"
+
+#define GFMMPROC_CONTROL_AUDIO_FORMAT_STR "AudioFormat"
+#define GFMMPROC_CONTROL_EFFECT_STR "Effect"
+#define GFMMPROC_CONTROL_EFFECT_ORDER_STR "EffectOrder"
+#define GFMMPROC_CONTROL_FORMAT_STR "Format"
+#define GFMMPROC_CONTROL_MIDI_CHANNEL_STR "MIDIChannel"
+#define GFMMPROC_CONTROL_PAN_STR "Pan"
+#define GFMMPROC_CONTROL_PRIORITY_STR "Priority"
+
+#define GFMMPROC_CONTROL_COMMIT_STR "Commit"
+#define GFMMPROC_CONTROL_ORIENTATION_STR "Orientation"
+#define GFMMPROC_CONTROL_DIRECTIVITY_STR "Directivity"
+#define GFMMPROC_CONTROL_DISTANCE_ATTENUATION_STR "DistanceAttenuation"
+#define GFMMPROC_CONTROL_DOPPLER_STR "Doppler"
+#define GFMMPROC_CONTROL_LOCATION_STR "Location"
+#define GFMMPROC_CONTROL_MACROSCOPIC_STR "Macroscopic"
+#define GFMMPROC_CONTROL_OBSTRUCTION_STR "Obstruction"
+#define GFMMPROC_CONTROL_3DCOEFFICIENTS_STR "3DCoefficients"
+
+#define GFMMPROC_CONTROL_EFFECT_AUDIO_VIRTUALIZER_STR "AudioVirtualizer"
+#define GFMMPROC_CONTROL_EFFECT_ACOUSTIC_ECHO_CANCELLATION_STR "AcousticEchoCancellation"
+#define GFMMPROC_CONTROL_EFFECT_SBC_STR "SBC"
+#define GFMMPROC_CONTROL_EFFECT_SBR_STR "SBR"
+#define GFMMPROC_CONTROL_EFFECT_DRC_STR "DRC"
+#define GFMMPROC_CONTROL_EFFECT_CHORUS_STR "Chorus"
+#define GFMMPROC_CONTROL_EFFECT_EQUALIZER_STR "Equalizer"
+#define GFMMPROC_CONTROL_EFFECT_REVERB_STR "Reverb"
+#define GFMMPROC_CONTROL_REVERB_SOURCE_STR "ReverbSource"
+
+
+#define GFMmProcObjectIsInstance(handle, objectType) \
+ ((GFMMPROC_OBJECT_TABLE*)handle)->MmProcObjectIsInstance(handle, objectType)
+
+GF_HANDLE GFMmProcObjectAlloc(GFMmProcHandle component, const char* objectType);
+void GFMmProcObjectFree(GF_HANDLE handle);
+
+#if defined GFMMPROC_BASIC_AUDIO || defined GFMMPROC_ADVANCED
+
+typedef GF_HANDLE GFMMPROC_STREAM;
+
+//*****************************************************************************
+// Stream
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_STREAM_TABLE
+{
+ void (*MmProcStreamClose)(GFMMPROC_STREAM handle);
+ NvS32 (*MmProcStreamGetBuffer)(GFMMPROC_STREAM handle, NvU32 tag, void** descriptor, void** buffer);
+ void (*MmProcStreamReleaseBuffer)(GFMMPROC_STREAM handle, NvU32 tag, NvU32 status, NvU32 size);
+ void (*MmProcStreamReset)(GFMMPROC_STREAM handle);
+
+} GFMMPROC_STREAM_TABLE;
+
+#define GFMMPROC_STREAM_END_OF_MEDIA 0x00000001
+
+#define GFMmProcStreamClose(handle) \
+ ((GFMMPROC_STREAM_TABLE*)handle)->MmProcStreamClose(handle)
+#define GFMmProcStreamGetBuffer(handle, tag, descriptor, buffer) \
+ ((GFMMPROC_STREAM_TABLE*)handle)->MmProcStreamGetBuffer(handle, tag, descriptor, buffer)
+#define GFMmProcStreamReleaseBuffer(handle, tag, status, size) \
+ ((GFMMPROC_STREAM_TABLE*)handle)->MmProcStreamReleaseBuffer(handle, tag, status, size)
+#define GFMmProcStreamReset(handle) \
+ ((GFMMPROC_STREAM_TABLE*)handle)->MmProcStreamReset(handle)
+
+#endif // #if defined GFMMPROC_BASIC_AUDIO || defined GFMMPROC_ADVANCED
+
+
+
+//*****************************************************************************
+//*****************************************************************************
+//
+//
+// GFMMPROC_BASIC_AUDIO
+//
+//
+//*****************************************************************************
+//*****************************************************************************
+
+#if defined GFMMPROC_BASIC_AUDIO
+
+typedef GFMMPROC_OBJECT GFMMPROC_CONTROL;
+typedef GF_HANDLE GFMMPROC_CONTROLLABLE;
+typedef GFMMPROC_OBJECT GFMMPROC_MANAGER;
+typedef GFMMPROC_CONTROLLABLE GFMMPROC_PLAYER;
+typedef GF_HANDLE GFMMPROC_PLAYER_LISTENER;
+typedef GF_HANDLE GFMMPROC_TIME_BASE;
+typedef enum {
+ GFMMPROC_CODEC_TYPE_UNSPECIFIED = 0,
+ GFMMPROC_CODEC_TYPE_I2S,
+ GFMMPROC_CODEC_TYPE_AC97
+} GFMMPROC_CODEC_TYPE;
+
+//*****************************************************************************
+// Control
+//*****************************************************************************
+//
+typedef GFMMPROC_OBJECT_TABLE GFMMPROC_CONTROL_TABLE;
+
+
+//*****************************************************************************
+// Controllable
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_CONTROLLABLE_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+ GFMMPROC_CONTROL (*MmProcControllableGetControl)(GFMMPROC_CONTROLLABLE handle, char* controlType);
+ GFMMPROC_CONTROL* (*MmProcControllableGetControls)(GFMMPROC_CONTROLLABLE handle);
+
+} GFMMPROC_CONTROLLABLE_TABLE;
+
+#define GFMmProcControllableGetControl(handle, controlType) \
+ ((GFMMPROC_CONTROLLABLE_TABLE*)handle)->MmProcControllableGetControl(handle, controlType)
+#define GFMmProcControllableGetControls(handle) \
+ ((GFMMPROC_CONTROLLABLE_TABLE*)handle)->MmProcControllableGetControls(handle)
+
+
+//*****************************************************************************
+// Manager
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_MANAGER_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+ GFMMPROC_PLAYER (*MmProcManagerCreatePlayer)(GFMMPROC_MANAGER handle, char* locator);
+// GFMMPROC_PLAYER (*MmProcManagerCreatePlayerForDataSource)(GFMMPROC_MANAGER handle, DataSource source);
+ GFMMPROC_PLAYER (*MmProcManagerCreatePlayerForStream)(GFMMPROC_MANAGER handle, GFMMPROC_STREAM stream, char* contentType);
+ char* (*MmProcManagerGetSupportedContentTypes)(GFMMPROC_MANAGER handle, char* protocol);
+ char* (*MmProcManagerGetSupportedProtocols)(GFMMPROC_MANAGER handle, char* contentType);
+ GFMMPROC_TIME_BASE (*MmProcManagerGetSystemTimeBase)(GFMMPROC_MANAGER handle);
+ void (*MmProcManagerPlayTone)(GFMMPROC_MANAGER handle, NvU32 note, NvU32 duration, NvU32 volume);
+ void (*MmProcManagerProcess)(GFMMPROC_MANAGER handle);
+ GFMMPROC_CODEC_TYPE (*MmProcManagerGetCodecType)(GFMMPROC_MANAGER handle);
+ void (*MmProcManagerCodecWrite)(GFMMPROC_MANAGER handle, NvU32 offset, NvU32 value);
+ NvU32 (*MmProcManagerCodecRead)(GFMMPROC_MANAGER handle, NvU32 offset);
+
+} GFMMPROC_MANAGER_TABLE;
+
+#define GFMMPROC_MANAGER_MIDI_DEVICE_LOCATOR "device://midi"
+#define GFMMPROC_MANAGER_TONE_DEVICE_LOCATOR "device://tone"
+
+#define GFMmProcManagerCreatePlayer(handle, locator) \
+ ((GFMMPROC_MANAGER_TABLE*)handle)->MmProcManagerCreatePlayer(handle, locator)
+//#define GFMmProcManagerCreatePlayerForDataSource(handle, source) Add multiline delineator here
+// ((GFMMPROC_MANAGER_TABLE*)handle)->MmProcManagerCreatePlayerForDataSource(handle, source)
+#define GFMmProcManagerCreatePlayerForStream(handle, stream, contentType) \
+ ((GFMMPROC_MANAGER_TABLE*)handle)->MmProcManagerCreatePlayerForStream(handle, stream, contentType)
+#define GFMmProcManagerGetSupportedContentTypes(handle, protocol) \
+ ((GFMMPROC_MANAGER_TABLE*)handle)->MmProcManagerGetSupportedContentTypes(handle, protocol)
+#define GFMmProcManagerGetSupportedProtocols(handle, contentType) \
+ ((GFMMPROC_MANAGER_TABLE*)handle)->MmProcManagerGetSupportedProtocols(handle, contentType)
+#define GFMmProcManagerGetSystemTimeBase(handle) \
+ ((GFMMPROC_MANAGER_TABLE*)handle)->MmProcManagerGetSystemTimeBase(handle)
+#define GFMmProcManagerPlayTone(handle, note, duration, volume) \
+ ((GFMMPROC_MANAGER_TABLE*)handle)->MmProcManagerPlayTone(handle, note, duration, volume)
+#define GFMmProcManagerProcess(handle) \
+ ((GFMMPROC_MANAGER_TABLE*)handle)->MmProcManagerProcess(handle)
+#define MmProcManagerGetCodecType(handle) \
+ ((GFMMPROC_MANAGER_TABLE*)handle)->MmProcManagerGetCodecType(handle)
+#define MmProcManagerCodecWrite(handle, offset, value) \
+ ((GFMMPROC_MANAGER_TABLE*)handle)->MmProcManagerCodecWrite(handle, offset, value)
+#define MmProcManagerCodecRead(handle, offset) \
+ ((GFMMPROC_MANAGER_TABLE*)handle)->MmProcManagerCodecRead(handle, offset)
+
+
+//*****************************************************************************
+// Player
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_PLAYER_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+ //
+ // Controllable Methods
+ //
+ GFMMPROC_CONTROL (*MmProcControllableGetControl)(GFMMPROC_CONTROLLABLE handle, char* controlType);
+ GFMMPROC_CONTROL* (*MmProcControllableGetControls)(GFMMPROC_CONTROLLABLE handle);
+
+ void (*MmProcPlayerAddPlayerListener)(GFMMPROC_PLAYER handle, GFMMPROC_PLAYER_LISTENER playerListener);
+ void (*MmProcPlayerClose)(GFMMPROC_PLAYER handle);
+ void (*MmProcPlayerDeallocate)(GFMMPROC_PLAYER handle);
+ char* (*MmProcPlayerGetContentType)(GFMMPROC_PLAYER handle);
+ NvS64 (*MmProcPlayerGetDuration)(GFMMPROC_PLAYER handle);
+ NvS64 (*MmProcPlayerGetMediaTime)(GFMMPROC_PLAYER handle);
+ NvU32 (*MmProcPlayerGetState)(GFMMPROC_PLAYER handle);
+ GFMMPROC_TIME_BASE (*MmProcPlayerGetTimeBase)(GFMMPROC_PLAYER handle);
+ NvU32 (*MmProcPlayerPrefetch)(GFMMPROC_PLAYER handle);
+ void (*MmProcPlayerPull)(GFMMPROC_PLAYER handle, NvS32 allow);
+ void (*MmProcPlayerRealize)(GFMMPROC_PLAYER handle);
+ void (*MmProcPlayerRemovePlayerListener)(GFMMPROC_PLAYER handle, GFMMPROC_PLAYER_LISTENER playerListener);
+ void (*MmProcPlayerSetLoopCount)(GFMMPROC_PLAYER handle, NvS32 count);
+ NvS64 (*MmProcPlayerSetMediaTime)(GFMMPROC_PLAYER handle, NvS64 now);
+ void (*MmProcPlayerSetTimeBase)(GFMMPROC_PLAYER handle, GFMMPROC_TIME_BASE master);
+ void (*MmProcPlayerStart)(GFMMPROC_PLAYER handle);
+ void (*MmProcPlayerStop)(GFMMPROC_PLAYER handle);
+
+} GFMMPROC_PLAYER_TABLE;
+
+#define GFMMPROC_PLAYER_UNREALIZED 100
+#define GFMMPROC_PLAYER_REALIZED 200
+#define GFMMPROC_PLAYER_PREFETCHED 300
+#define GFMMPROC_PLAYER_STARTED 400
+#define GFMMPROC_PLAYER_CLOSED 0
+#define GFMMPROC_PLAYER_TIME_UNKNOWN -1
+
+#define GFMmProcPlayerAddPlayerListener(handle, playerListener) \
+ ((GFMMPROC_PLAYER_TABLE*)handle)->MmProcPlayerAddPlayerListener(handle, playerListener)
+#define GFMmProcPlayerClose(handle) \
+ ((GFMMPROC_PLAYER_TABLE*)handle)->MmProcPlayerClose(handle)
+#define GFMmProcPlayerDeallocate(handle) \
+ ((GFMMPROC_PLAYER_TABLE*)handle)->MmProcPlayerDeallocate(handle)
+#define GFMmProcPlayerGetContentType(handle) \
+ ((GFMMPROC_PLAYER_TABLE*)handle)->MmProcPlayerGetContentType(handle)
+#define GFMmProcPlayerGetDuration(handle) \
+ ((GFMMPROC_PLAYER_TABLE*)handle)->MmProcPlayerGetDuration(handle)
+#define GFMmProcPlayerGetMediaTime(handle) \
+ ((GFMMPROC_PLAYER_TABLE*)handle)->MmProcPlayerGetMediaTime(handle)
+#define GFMmProcPlayerGetState(handle) \
+ ((GFMMPROC_PLAYER_TABLE*)handle)->MmProcPlayerGetState(handle)
+#define GFMmProcPlayerGetTimeBase(handle) \
+ ((GFMMPROC_PLAYER_TABLE*)handle)->MmProcPlayerGetTimeBase(handle)
+#define GFMmProcPlayerPrefetch(handle) \
+ ((GFMMPROC_PLAYER_TABLE*)handle)->MmProcPlayerPrefetch(handle)
+#define GFMmProcPlayerPull(handle, allow) \
+ ((GFMMPROC_PLAYER_TABLE*)handle)->MmProcPlayerPull(handle, allow)
+#define GFMmProcPlayerRealize(handle) \
+ ((GFMMPROC_PLAYER_TABLE*)handle)->MmProcPlayerRealize(handle)
+#define GFMmProcPlayerRemovePlayerListener(handle, playerListener) \
+ ((GFMMPROC_PLAYER_TABLE*)handle)->MmProcPlayerRemovePlayerListener(handle, playerListener)
+#define GFMmProcPlayerSetLoopCount(handle, count) \
+ ((GFMMPROC_PLAYER_TABLE*)handle)->MmProcPlayerSetLoopCount(handle, count)
+#define GFMmProcPlayerSetMediaTime(handle, now) \
+ ((GFMMPROC_PLAYER_TABLE*)handle)->MmProcPlayerSetMediaTime(handle, now)
+#define GFMmProcPlayerSetTimeBase(handle, master) \
+ ((GFMMPROC_PLAYER_TABLE*)handle)->MmProcPlayerSetMediaTime(handle, master)
+#define GFMmProcPlayerStart(handle) \
+ ((GFMMPROC_PLAYER_TABLE*)handle)->MmProcPlayerStart(handle)
+#define GFMmProcPlayerStop(handle) \
+ ((GFMMPROC_PLAYER_TABLE*)handle)->MmProcPlayerStop(handle)
+
+
+//*****************************************************************************
+// PlayerListener
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_PLAYER_LISTENER_TABLE
+{
+ void (*MmProcPlayerListenerPlayerUpdate)(GFMMPROC_PLAYER_LISTENER handle, GFMMPROC_PLAYER player, const char* event, void* eventData);
+
+} GFMMPROC_PLAYER_LISTENER_TABLE;
+
+#define GFMMPROC_PLAYER_LISTENER_BUFFERING_STARTED "bufferingStarted"
+#define GFMMPROC_PLAYER_LISTENER_BUFFERING_STOPPED "bufferingStopped"
+#define GFMMPROC_PLAYER_LISTENER_CLOSED "closed"
+#define GFMMPROC_PLAYER_LISTENER_END_OF_MEDIA "endOfMedia"
+#define GFMMPROC_PLAYER_LISTENER_DEVICE_AVAILABLE "deviceAvailable"
+#define GFMMPROC_PLAYER_LISTENER_DEVICE_UNAVAILABLE "deviceUnavailable"
+#define GFMMPROC_PLAYER_LISTENER_DURATION_UPDATED "durationUpdated"
+#define GFMMPROC_PLAYER_LISTENER_ERROR "error"
+#define GFMMPROC_PLAYER_LISTENER_FORMAT_CHANGED "formatChanged"
+#define GFMMPROC_PLAYER_LISTENER_RECORD_ERROR "recordError"
+#define GFMMPROC_PLAYER_LISTENER_RECORD_STARTED "recordStarted"
+#define GFMMPROC_PLAYER_LISTENER_RECORD_STOPPED "recordStopped"
+#define GFMMPROC_PLAYER_LISTENER_STARTED "started"
+#define GFMMPROC_PLAYER_LISTENER_STOPPED "stopped"
+#define GFMMPROC_PLAYER_LISTENER_STOPPED_AT_TIME "stoppedAtTime"
+#define GFMMPROC_PLAYER_LISTENER_VOLUME_CHANGED "volumeChanged"
+
+#define GFMmProcPlayerListenerPlayerUpdate(handle, player, event, eventData) \
+ ((GFMMPROC_PLAYER_LISTENER_TABLE*)handle)->MmProcPlayerListenerPlayerUpdate(handle, player, event, eventData)
+
+
+//*****************************************************************************
+// TimeBase
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_TIME_BASE_TABLE
+{
+ NvU32 (*MmProcTimeBaseGetTime)(GFMMPROC_TIME_BASE handle);
+
+} GFMMPROC_TIME_BASE_TABLE;
+
+#define GFMmProcTimeBaseGetTime(handle) \
+ ((GFMMPROC_TIME_BASE_TABLE*)handle)->MmProcTimeBaseGetTime(handle)
+
+
+
+//*****************************************************************************
+//*****************************************************************************
+//
+//
+// GFMMPROC_BASIC_AUDIO_CONTROLS
+//
+//
+//*****************************************************************************
+//*****************************************************************************
+
+#if defined GFMMPROC_BASIC_AUDIO_CONTROLS
+
+typedef GFMMPROC_CONTROL GFMMPROC_CONTROL_MIDI;
+typedef GFMMPROC_CONTROL GFMMPROC_CONTROL_PITCH;
+typedef GFMMPROC_CONTROL GFMMPROC_CONTROL_RATE;
+typedef GFMMPROC_CONTROL GFMMPROC_CONTROL_RECORD;
+typedef GFMMPROC_CONTROL GFMMPROC_CONTROL_STOP_TIME;
+typedef GFMMPROC_CONTROL GFMMPROC_CONTROL_TEMPO;
+typedef GFMMPROC_CONTROL GFMMPROC_CONTROL_TONE;
+typedef GFMMPROC_CONTROL GFMMPROC_CONTROL_VOLUME;
+
+
+
+//*****************************************************************************
+// MIDIControl
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_CONTROL_MIDI_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+ NvS32* (*MmProcControlMidiGetBankList)(GFMMPROC_CONTROL_MIDI hande, NvS32 custom);
+ NvS8 (*MmProcControlMidiGetChannelVolume)(GFMMPROC_CONTROL_MIDI hande, NvU8 channel);
+ char* (*MmProcControlMidiGetKeyName)(GFMMPROC_CONTROL_MIDI hande, NvS32 bank, NvS32 program, NvS32 key);
+ NvS32* (*MmProcControlMidiGetProgram)(GFMMPROC_CONTROL_MIDI hande, NvU8 channel);
+ NvS32* (*MmProcControlMidiGetProgramList)(GFMMPROC_CONTROL_MIDI hande, NvS32 bank);
+ char* (*MmProcControlMidiGetProgramName)(GFMMPROC_CONTROL_MIDI hande, NvS32 bank, NvS32 program);
+ NvS32 (*MmProcControlMidiIsBankQuerySupported)(GFMMPROC_CONTROL_MIDI hande);
+ NvS32 (*MmProcControlMidiLongMidiEvent)(GFMMPROC_CONTROL_MIDI hande, NvS8* data, NvS32 offset, NvS32 length);
+ void (*MmProcControlMidiShortMidiEvent)(GFMMPROC_CONTROL_MIDI hande, NvS32 type, NvS32 data1, NvS32 data2);
+
+} GFMMPROC_CONTROL_MIDI_TABLE;
+
+#define GFMMPROC_CONTROL_MIDI_CONTROL_CHANGE 176
+#define GFMMPROC_CONTROL_MIDI_NOTE_ON 144
+
+#define GFMmProcControlMidiGetBankList(handle, custom) \
+ ((GFMMPROC_CONTROL_MIDI_TABLE*)handle)->MmProcControlMidiGetBankList(handle, custom)
+#define GFMmProcControlMidiGetChannelVolume(handle, channel) \
+ ((GFMMPROC_CONTROL_MIDI_TABLE*)handle)->MmProcControlMidiGetChannelVolume(handle, channel)
+#define GFMmProcControlMidiGetKeyName(handle, bank, program, key) \
+ ((GFMMPROC_CONTROL_MIDI_TABLE*)handle)->MmProcControlMidiGetKeyName(handle, bank, program, key)
+#define GFMmProcControlMidiGetProgram(handle, channel) \
+ ((GFMMPROC_CONTROL_MIDI_TABLE*)handle)->MmProcControlMidiGetProgram(handle, channel)
+#define GFMmProcControlMidiGetProgramList(handle, bank) \
+ ((GFMMPROC_CONTROL_MIDI_TABLE*)handle)->MmProcControlMidiGetProgramList(handle, bank)
+#define GFMmProcControlMidiGetProgramName(handle, bank, program) \
+ ((GFMMPROC_CONTROL_MIDI_TABLE*)handle)->MmProcControlMidiGetProgramName(handle, bank, program)
+#define GFMmProcControlMidiIsBankQuerySupported(handle) \
+ ((GFMMPROC_CONTROL_MIDI_TABLE*)handle)->MmProcControlMidiIsBankQuerySupported(handle)
+#define GFMmProcControlMidiLongMidiEvent(handle) \
+ ((GFMMPROC_CONTROL_MIDI_TABLE*)handle)->MmProcControlMidiLongMidiEvent(handle, data, offset, length)
+#define GFMmProcControlMidiShortMidiEvent(handle, type, data1, data2) \
+ ((GFMMPROC_CONTROL_MIDI_TABLE*)handle)->(handle, type, data1, data2)
+
+
+//*****************************************************************************
+// PitchControl
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_CONTROL_PITCH_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+ NvS32 (*MmProcControlPitchGetMaxPitch)(GFMMPROC_CONTROL_PITCH handle);
+ NvS32 (*MmProcControlPitchGetMinPitch)(GFMMPROC_CONTROL_PITCH handle);
+ NvS32 (*MmProcControlPitchGetPitch)(GFMMPROC_CONTROL_PITCH handle);
+ NvS32 (*MmProcControlPitchSetPitch)(GFMMPROC_CONTROL_PITCH handle, NvS32 millisemitones);
+
+} GFMMPROC_CONTROL_PITCH_TABLE;
+
+#define GFMmProcControlPitchGetMaxPitch(handle) \
+ ((GFMMPROC_CONTROL_PITCH_TABLE*)handle)->MmProcControlPitchGetMaxPitch(handle)
+#define GFMmProcControlPitchGetMinPitch(handle) \
+ ((GFMMPROC_CONTROL_PITCH_TABLE*)handle)->MmProcControlPitchGetMinPitch(handle)
+#define GFMmProcControlPitchGetPitch(handle) \
+ ((GFMMPROC_CONTROL_PITCH_TABLE*)handle)->MmProcControlPitchGetPitch(handle)
+#define GFMmProcControlPitchSetPitch(handle, millisemitones) \
+ ((GFMMPROC_CONTROL_PITCH_TABLE*)handle)->MmProcControlPitchSetPitch(handle, millisemitones)
+
+
+//*****************************************************************************
+// RateControl
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_CONTROL_RATE_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+ NvS32 (*MmProcControlRateGetMaxRate)(GFMMPROC_CONTROL_RATE handle);
+ NvS32 (*MmProcControlRateGetMinRate)(GFMMPROC_CONTROL_RATE handle);
+ NvS32 (*MmProcControlRateGetRate)(GFMMPROC_CONTROL_RATE handle);
+ NvS32 (*MmProcControlRateSetRate)(GFMMPROC_CONTROL_RATE handle, NvS32 millirate);
+
+} GFMMPROC_CONTROL_RATE_TABLE;
+
+#define GFMmProcControlRateGetMaxRate(handle) \
+ ((GFMMPROC_CONTROL_RATE_TABLE*)handle)->MmProcControlRateGetMaxRate(handle)
+#define GFMmProcControlRateGetMinRate(handle) \
+ ((GFMMPROC_CONTROL_RATE_TABLE*)handle)->MmProcControlRateGetMinRate(handle)
+#define GFMmProcControlRateGetRate(handle) \
+ ((GFMMPROC_CONTROL_RATE_TABLE*)handle)->MmProcControlRateGetRate(handle)
+#define GFMmProcControlRateSetRate(handle, millirate) \
+ ((GFMMPROC_CONTROL_RATE_TABLE*)handle)->MmProcControlRateSetRate(handle, millirate)
+
+
+//*****************************************************************************
+// RecordControl
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_CONTROL_RECORD_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+ void (*MmProcControlRecordCommit)(GFMMPROC_CONTROL_RECORD handle);
+ char* (*MmProcControlRecordGetContentType)(GFMMPROC_CONTROL_RECORD handle);
+ void (*MmProcControlRecordSetRecordLocation)(GFMMPROC_CONTROL_RECORD handle, char* locator);
+ void (*MmProcControlRecordSetRecordStream)(GFMMPROC_CONTROL_RECORD handle, GFMMPROC_STREAM stream, char* contentType);
+ NvS32 (*MmProcControlRecordSetRecordSizeLimit)(GFMMPROC_CONTROL_RECORD handle, NvS32 size);
+ void (*MmProcControlRecordStartRecord)(GFMMPROC_CONTROL_RECORD handle);
+ void (*MmProcControlRecordStopRecord)(GFMMPROC_CONTROL_RECORD handle);
+ void (*MmProcControlRecordReset)(GFMMPROC_CONTROL_RECORD handle);
+
+} GFMMPROC_CONTROL_RECORD_TABLE;
+
+#define GFMmProcControlRecordCommit(handle) \
+ ((GFMMPROC_CONTROL_RECORD_TABLE*)handle)->MmProcControlRecordCommit(handle)
+#define GFMmProcControlRecordGetContentType(handle) \
+ ((GFMMPROC_CONTROL_RECORD_TABLE*)handle)->MmProcControlRecordGetContentType(handle)
+#define GFMmProcControlRecordSetRecordLocation(handle, locator) \
+ ((GFMMPROC_CONTROL_RECORD_TABLE*)handle)->MmProcControlRecordSetRecordLocation(handle, locator)
+#define GFMmProcControlRecordSetRecordStream(handle, stream, contentType) \
+ ((GFMMPROC_CONTROL_RECORD_TABLE*)handle)->MmProcControlRecordSetRecordStream(handle, stream, contentType)
+#define GFMmProcControlRecordSetRecordSizeLimit(handle, size) \
+ ((GFMMPROC_CONTROL_RECORD_TABLE*)handle)->MmProcControlRecordSetRecordSizeLimit(handle, size)
+#define GFMmProcControlRecordStartRecord(handle) \
+ ((GFMMPROC_CONTROL_RECORD_TABLE*)handle)->MmProcControlRecordStartRecord(handle)
+#define GFMmProcControlRecordStopRecord(handle) \
+ ((GFMMPROC_CONTROL_RECORD_TABLE*)handle)->MmProcControlRecordStopRecord(handle)
+#define GFMmProcControlRecordReset(handle) \
+ ((GFMMPROC_CONTROL_RECORD_TABLE*)handle)->MmProcControlRecordReset(handle)
+
+
+//*****************************************************************************
+// StopTimeControl
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_CONTROL_STOP_TIME_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+ NvS64 (*MmProcControlStopTimeGetStopTime)(GFMMPROC_CONTROL_STOP_TIME handle);
+ void (*MmProcControlStopTimeSetStopTime)(GFMMPROC_CONTROL_STOP_TIME handle, NvS64 stopTime);
+
+} GFMMPROC_CONTROL_STOP_TIME_TABLE;
+
+#define GFMMPROC_CONTROL_STOP_TIME_RESET -1
+
+#define GFMmProcControlStopTimeGetStopTime(handle) \
+ (GFMMPROC_CONTROL_STOP_TIME_TABLE*)handle)->MmProcControlStopTimeGetStopTime(handle)
+#define GFMmProcControlStopTimeSetStopTime(handle, stopTime) \
+ ((GFMMPROC_CONTROL_STOP_TIME_TABLE*)handle)->MmProcControlStopTimeSetStopTime(handle, stopTime)
+
+
+//*****************************************************************************
+// TempoControl
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_CONTROL_TEMPO_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+ //
+ // Rate Methods
+ //
+ NvS32 (*MmProcControlRateGetMaxRate)(GFMMPROC_CONTROL_RATE handle);
+ NvS32 (*MmProcControlRateGetMinRate)(GFMMPROC_CONTROL_RATE handle);
+ NvS32 (*MmProcControlRateGetRate)(GFMMPROC_CONTROL_RATE handle);
+ NvS32 (*MmProcControlRateSetRate)(GFMMPROC_CONTROL_RATE handle, NvS32 millirate);
+
+ NvS32 (*MmProcControlTempoGetTempo)(GFMMPROC_CONTROL_TEMPO handle);
+ NvS32 (*MmProcControlTempoSetTempo)(GFMMPROC_CONTROL_TEMPO handle, NvS32 millitempo);
+
+} GFMMPROC_CONTROL_TEMPO_TABLE;
+
+#define GFMmProcControlTempoGetTempo(handle) \
+ ((GFMMPROC_CONTROL_TEMPO_TABLE*)handle)->MmProcControlTempoGetTempo(handle)
+#define GFMmProcControlTempoSetTempo(handle) \
+ ((GFMMPROC_CONTROL_TEMPO_TABLE*)handle)->MmProcControlTempoSetTempo(handle, millitempo)
+
+
+//*****************************************************************************
+// ToneControl
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_CONTROL_TONE_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+ void (*MmProcControlToneSetSequence)(GFMMPROC_CONTROL_TONE handle, NvS8* sequence);
+
+} GFMMPROC_CONTROL_TONE_TABLE;
+
+#define GFMMPROC_CONTROL_TONE_VERSION -2
+#define GFMMPROC_CONTROL_TONE_TEMPO -3
+#define GFMMPROC_CONTROL_TONE_RESOLUTION -4
+#define GFMMPROC_CONTROL_TONE_BLOCK_START -5
+#define GFMMPROC_CONTROL_TONE_BLOCK_END -6
+#define GFMMPROC_CONTROL_TONE_PLAY_BLOCK -7
+#define GFMMPROC_CONTROL_TONE_SET_VOLUME -8
+#define GFMMPROC_CONTROL_TONE_REPEAT -9
+#define GFMMPROC_CONTROL_TONE_C4 60
+#define GFMMPROC_CONTROL_TONE_SILENCE -1
+
+#define GFMmProcControlToneSetSequence(handle, sequence) \
+ ((GFMMPROC_CONTROL_TONE_TABLE*)handle)->MmProcControlToneSetSequence(handle, sequence)
+
+
+//*****************************************************************************
+// VolumeControl
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_CONTROL_VOLUME_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+ NvS32 (*MmProcControlVolumeGetLevel)(GFMMPROC_CONTROL_VOLUME handle);
+ NvS32 (*MmProcControlVolumeIsMuted)(GFMMPROC_CONTROL_VOLUME handle);
+ NvS32 (*MmProcControlVolumeSetLevel)(GFMMPROC_CONTROL_VOLUME handle, NvS32 level);
+ void (*MmProcControlVolumeSetMute)(GFMMPROC_CONTROL_VOLUME handle, NvS32 mute);
+
+} GFMMPROC_CONTROL_VOLUME_TABLE;
+
+#define GFMmProcControlVolumeGetLevel(handle) \
+ ((GFMMPROC_CONTROL_VOLUME_TABLE*)handle)->MmProcControlVolumeGetLevel(handle)
+#define GFMmProcControlVolumeIsMuted(handle) \
+ ((GFMMPROC_CONTROL_VOLUME_TABLE*)handle)->MmProcControlVolumeIsMuted(handle)
+#define GFMmProcControlVolumeSetLevel(handle, level) \
+ ((GFMMPROC_CONTROL_VOLUME_TABLE*)handle)->MmProcControlVolumeSetLevel(handle, level)
+#define GFMmProcControlVolumeSetMute(handle, mute) \
+ ((GFMMPROC_CONTROL_VOLUME_TABLE*)handle)->MmProcControlVolumeSetMute(handle, mute)
+
+
+#endif // GFMMPROC_BASIC_AUDIO_CONTROLS
+
+#endif // GFMMPROC_BASIC_AUDIO
+
+
+
+//*****************************************************************************
+//*****************************************************************************
+//
+//
+// GFMMPROC_ADVANCED
+//
+//
+//*****************************************************************************
+//*****************************************************************************
+
+#if defined GFMMPROC_ADVANCED
+
+typedef GF_HANDLE GFMMPROC_MODULE;
+typedef GFMMPROC_MODULE GFMMPROC_EFFECT_MODULE;
+typedef GFMMPROC_MANAGER GFMMPROC_GLOBAL_MANAGER;
+typedef GFMMPROC_CONTROLLABLE GFMMPROC_MEDIA_PROCESSOR;
+typedef GF_HANDLE GFMMPROC_MEDIA_PROCESSOR_LISTENER;
+typedef GFMMPROC_CONTROLLABLE GFMMPROC_SPECTATOR;
+typedef GFMMPROC_MODULE GFMMPROC_SOUND_SOURCE_3D;
+
+
+//*****************************************************************************
+// Module
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_MODULE_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+ //
+ // Controllable Methods
+ //
+ GFMMPROC_CONTROL (*MmProcControllableGetControl)(GFMMPROC_CONTROLLABLE handle, char* controlType);
+ GFMMPROC_CONTROL* (*MmProcControllableGetControls)(GFMMPROC_CONTROLLABLE handle);
+
+ void (*MmProcModuleAddMIDIChannel)(GFMMPROC_MODULE handle, GFMMPROC_PLAYER player, NvS32 channel);
+ void (*MmProcModuleAddPlayer)(GFMMPROC_MODULE handle, GFMMPROC_PLAYER player);
+ void (*MmProcModuleRemoveMIDIChannel)(GFMMPROC_MODULE handle, GFMMPROC_PLAYER player, NvS32 channel);
+ void (*MmProcModuleRemovePlayer)(GFMMPROC_MODULE handle, GFMMPROC_PLAYER player);
+
+} GFMMPROC_MODULE_TABLE;
+
+#define GFMmProcModuleAddMIDIChannel(handle, player, channel) \
+ ((GFMMPROC_MODULE_TABLE*)handle)->MmProcModuleAddMIDIChannel(handle, player, channel)
+#define GFMmProcModuleAddPlayer(handle, player) \
+ ((GFMMPROC_MODULE_TABLE*)handle)->MmProcModuleAddPlayer(handle, player)
+#define GFMmProcModuleGetControl(handle, controlType) \
+ ((GFMMPROC_MODULE_TABLE*)handle)->MmProcModuleGetControl(handle, controlType)
+#define GFMmProcModuleGetControls(handle) \
+ ((GFMMPROC_MODULE_TABLE*)handle)->MmProcModuleGetControls(handle)
+#define GFMmProcModuleRemoveMIDIChannel(handle, player, channel) \
+ ((GFMMPROC_MODULE_TABLE*)handle)->MmProcModuleRemoveMIDIChannel(handle, player, channel)
+#define GFMmProcModuleRemovePlayer(handle, player) \
+ ((GFMMPROC_MODULE_TABLE*)handle)->MmProcModuleRemovePlayer(handle, player)
+
+
+//*****************************************************************************
+// EffectModule
+//*****************************************************************************
+//
+typedef GFMMPROC_MODULE_TABLE GFMMPROC_EFFECT_MODULE_TABLE;
+
+
+//*****************************************************************************
+// GlobalManager
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_GLOBAL_MANAGER_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+ //
+ // Manager Methods
+ //
+ GFMMPROC_PLAYER (*MmProcManagerCreatePlayer)(GFMMPROC_MANAGER handle, char* locator);
+// GFMMPROC_PLAYER (*MmProcManagerCreatePlayerForDataSource)(GFMMPROC_MANAGER handle, DataSource source);
+ GFMMPROC_PLAYER (*MmProcManagerCreatePlayerForStream)(GFMMPROC_MANAGER handle, GFMMPROC_STREAM stream, char* type);
+ char* (*MmProcManagerGetSupportedContentTypes)(GFMMPROC_MANAGER handle, char* protocol);
+ char* (*MmProcManagerGetSupportedProtocols)(GFMMPROC_MANAGER handle, char* contentType);
+ GFMMPROC_TIME_BASE (*MmProcManagerGetSystemTimeBase)(GFMMPROC_MANAGER handle);
+ void (*MmProcManagerPlayTone)(GFMMPROC_MANAGER handle, NvU32 note, NvU32 duration, NvU32 volume);
+ void (*MmProcManagerProcess)(GFMMPROC_MANAGER handle);
+ GFMMPROC_CODEC_TYPE (*MmProcManagerGetCodecType)(GFMMPROC_MANAGER handle);
+ void (*MmProcManagerCodecWrite)(GFMMPROC_MANAGER handle, NvU32 offset, NvU32 value);
+ NvU32 (*MmProcManagerCodecRead)(GFMMPROC_MANAGER handle, NvU32 offset);
+
+ GFMMPROC_EFFECT_MODULE (*MmProcGlobalManagerCreateEffectModule)(GFMMPROC_GLOBAL_MANAGER handle);
+ GFMMPROC_MEDIA_PROCESSOR (*MmProcGlobalManagerCreateMediaProcessor)(GFMMPROC_GLOBAL_MANAGER handle);
+ GFMMPROC_SOUND_SOURCE_3D (*MmProcGlobalManagerCreateSoundSource3D)(GFMMPROC_GLOBAL_MANAGER handle);
+ GFMMPROC_CONTROL (*MmProcGlobalManagerGetControl)(GFMMPROC_GLOBAL_MANAGER handle, char* controlType);
+ GFMMPROC_CONTROL* (*MmProcGlobalManagerGetControls)(GFMMPROC_GLOBAL_MANAGER handle);
+ GFMMPROC_SPECTATOR (*MmProcGlobalManagerGetSpectator)(GFMMPROC_GLOBAL_MANAGER handle);
+ char* (*MmProcGlobalManagerGetSupportedMediaProcessorInputTypes)(GFMMPROC_GLOBAL_MANAGER handle);
+ NvS32 (*MmProcGlobalManagerGetUnitsPerMeter)(GFMMPROC_GLOBAL_MANAGER handle);
+ void (*MmProcGlobalManagerSetUnitsPerMeter)(GFMMPROC_GLOBAL_MANAGER handle, NvS32 newScalingFactor);
+
+} GFMMPROC_GLOBAL_MANAGER_TABLE;
+
+#define GFMmProcGlobalManagerCreateEffectModule(handle) \
+ ((GFMMPROC_GLOBAL_MANAGER_TABLE*)handle)->MmProcGlobalManagerCreateEffectModule(handle)
+#define GFMmProcGlobalManagerCreateMediaProcessor(handle) \
+ ((GFMMPROC_GLOBAL_MANAGER_TABLE*)handle)->MmProcGlobalManagerCreateMediaProcessor(handle)
+#define GFMmProcGlobalManagerCreateSoundSource3D(handle) \
+ ((GFMMPROC_GLOBAL_MANAGER_TABLE*)handle)->MmProcGlobalManagerCreateSoundSource3D(handle)
+#define GFMmProcGlobalManagerGetControl(handle, controlType) \
+ ((GFMMPROC_GLOBAL_MANAGER_TABLE*)handle)->MmProcGlobalManagerGetControl(handle, controlType)
+#define GFMmProcGlobalManagerGetControls(handle) \
+ ((GFMMPROC_GLOBAL_MANAGER_TABLE*)handle)->MmProcGlobalManagerGetControls(handle)
+#define GFMmProcGlobalManagerGetSpectator(handle) \
+ ((GFMMPROC_GLOBAL_MANAGER_TABLE*)handle)->MmProcGlobalManagerGetSpectator(handle)
+#define GFMmProcGlobalManagerGetSupportedMediaProcessorInputTypes(handle) \
+ ((GFMMPROC_GLOBAL_MANAGER_TABLE*)handle)->MmProcGlobalManagerGetSupportedMediaProcessorInputTypes(handle)
+#define GFMmProcGlobalManagerGetUnitsPerMeter(handle) \
+ ((GFMMPROC_GLOBAL_MANAGER_TABLE*)handle)->MmProcGlobalManagerGetUnitsPerMeter(handle)
+#define GFMmProcGlobalManagerSetUnitsPerMeter(handle, newScalingFactor) \
+ ((GFMMPROC_GLOBAL_MANAGER_TABLE*)handle)->MmProcGlobalManagerSetUnitsPerMeter(handle, newScalingFactor)
+
+
+//*****************************************************************************
+// MediaProcessor
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_MEDIA_PROCESSOR_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+ //
+ // Controllable Methods
+ //
+ GFMMPROC_CONTROL (*MmProcControllableGetControl)(GFMMPROC_CONTROLLABLE handle, char* controlType);
+ GFMMPROC_CONTROL* (*MmProcControllableGetControls)(GFMMPROC_CONTROLLABLE handle);
+
+ void (*MmProcMediaProcessorAbort)(GFMMPROC_MEDIA_PROCESSOR handle);
+ void (*MmProcMediaProcessorAddMediaProcessorListener)(GFMMPROC_MEDIA_PROCESSOR handle,
+ GFMMPROC_MEDIA_PROCESSOR_LISTENER mediaProcessorListener);
+ void (*MmProcMediaProcessorComplete)(GFMMPROC_MEDIA_PROCESSOR handle);
+ NvS32 (*MmProcMediaProcessorGetProgress)(GFMMPROC_MEDIA_PROCESSOR handle);
+ void (*MmProcMediaProcessorRemoveMediaProcessorListener)(GFMMPROC_MEDIA_PROCESSOR handle,
+ GFMMPROC_MEDIA_PROCESSOR_LISTENER mediaProcessorListener);
+ void (*MmProcMediaProcessorStart)(GFMMPROC_MEDIA_PROCESSOR handle);
+ void (*MmProcMediaProcessorStop)(GFMMPROC_MEDIA_PROCESSOR handle);
+ GFMMPROC_PLAYER (*MmProcMediaProcessorSetInput)(GFMMPROC_MEDIA_PROCESSOR handle, GFMMPROC_STREAM input, char* contentType, NvS32 length);
+ GFMMPROC_PLAYER (*MmProcMediaProcessorSetOutput)(GFMMPROC_MEDIA_PROCESSOR handle, GFMMPROC_STREAM output, char* contentType);
+
+} GFMMPROC_MEDIA_PROCESSOR_TABLE;
+
+#define GFMMPROC_MEDIA_PROCESSOR_UNKNOWN -1
+
+#define GFMmProcMediaProcessorAbort(handle) \
+ ((GFMMPROC_MEDIA_PROCESSOR_TABLE*)handle)->MmProcMediaProcessorAbort(handle)
+#define GFMmProcMediaProcessorAddMediaProcessorListener(handle, mediaProcessorListener) \
+ ((GFMMPROC_MEDIA_PROCESSOR_TABLE*)handle)->MmProcMediaProcessorAddMediaProcessorListener(handle, mediaProcessorListener)
+#define GFMmProcMediaProcessorComplete(handle) \
+ ((GFMMPROC_MEDIA_PROCESSOR_TABLE*)handle)->MmProcMediaProcessorComplete(handle)
+#define GFMmProcMediaProcessorGetProgress(handle) \
+ ((GFMMPROC_MEDIA_PROCESSOR_TABLE*)handle)->MmProcMediaProcessorGetProgress(handle)
+#define GFMmProcMediaProcessorRemoveMediaProcessorListener(handle, mediaProcessorListener) \
+ ((GFMMPROC_MEDIA_PROCESSOR_TABLE*)handle)->MmProcMediaProcessorRemoveMediaProcessorListener(handle, mediaProcessorListener)
+#define GFMmProcMediaProcessorStart(handle) \
+ ((GFMMPROC_MEDIA_PROCESSOR_TABLE*)handle)->MmProcMediaProcessorStart(handle)
+#define GFMmProcMediaProcessorStop(handle) \
+ ((GFMMPROC_MEDIA_PROCESSOR_TABLE*)handle)->MmProcMediaProcessorStop(handle)
+#define GFMmProcMediaProcessorSetInput(handle, input, contentType, length) \
+ ((GFMMPROC_MEDIA_PROCESSOR_TABLE*)handle)->MmProcMediaProcessorSetInput(handle, input, contentType, length)
+#define GFMmProcMediaProcessorSetOutput(handle, output, contentType) \
+ ((GFMMPROC_MEDIA_PROCESSOR_TABLE*)handle)->MmProcMediaProcessorSetOutput(handle, output, contentType)
+
+
+//*****************************************************************************
+// MediaProcessorListener
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_MEDIA_PROCESSOR_LISTENER_TABLE
+{
+ void (*MmProcMediaProcessorListenerMediaProcessorUpdate)(GFMMPROC_MEDIA_PROCESSOR_LISTENER handle,
+ GFMMPROC_MEDIA_PROCESSOR processor, char* event,
+ void* eventData);
+
+} GFMMPROC_MEDIA_PROCESSOR_LISTENER_TABLE;
+
+#define GFMMPROC_MEDIA_PROCESSOR_LISTENER_PROCESSING_COMPLETED "processingCompleted"
+#define GFMMPROC_MEDIA_PROCESSOR_LISTENER_PROCESSING_ERROR "processingError"
+
+#define GFMmProcMediaProcessorListenerMediaProcessorUpdate(handle, processor, event, eventData) \
+ ((GFMMPROC_MEDIA_PROCESSOR_LISTENER_TABLE*)handle)->MmProcMediaProcessorListenerMediaProcessorUpdate(handle, processor, event, eventData)
+
+
+//*****************************************************************************
+// Spectator
+//*****************************************************************************
+//
+typedef GFMMPROC_CONTROLLABLE_TABLE GFMMPROC_SPECTATOR_TABLE;
+
+
+//*****************************************************************************
+// SoundSource3D
+//*****************************************************************************
+//
+typedef GFMMPROC_MODULE_TABLE GFMMPROC_SOUND_SOURCE_3D_TABLE;
+
+
+
+//*****************************************************************************
+//*****************************************************************************
+//
+//
+// GFMMPROC_ADVANCED_3D_AUDIO_CONTROLS
+//
+//
+//*****************************************************************************
+//*****************************************************************************
+
+#if defined GFMMPROC_ADVANCED_3D_AUDIO_CONTROLS
+
+typedef GFMMPROC_CONTROL GFMMPROC_CONTROL_COMMIT;
+typedef GFMMPROC_CONTROL GFMMPROC_CONTROL_ORIENTATION;
+typedef GFMMPROC_CONTROL_ORIENTATION GFMMPROC_CONTROL_DIRECTIVITY;
+typedef GFMMPROC_CONTROL GFMMPROC_CONTROL_DISTANCE_ATTENUATION;
+typedef GFMMPROC_CONTROL GFMMPROC_CONTROL_DOPPLER;
+typedef GFMMPROC_CONTROL GFMMPROC_CONTROL_LOCATION;
+typedef GFMMPROC_CONTROL_ORIENTATION GFMMPROC_CONTROL_MACROSCOPIC;
+typedef GFMMPROC_CONTROL GFMMPROC_CONTROL_OBSTRUCTION;
+
+#include "GFAudio.h"
+
+//*****************************************************************************
+// CommitControl
+//*****************************************************************************
+typedef struct _GFMMPROC_CONTROL_COMMIT_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+ void (*MmProcControlCommitCommit)(GFMMPROC_CONTROL_COMMIT handle);
+ NvS32 (*MmProcControlCommitIsDeferred)(GFMMPROC_CONTROL_COMMIT handle);
+ void (*MmProcControlCommitSetDeferred)(GFMMPROC_CONTROL_COMMIT handle, NvS32 deferred);
+
+} GFMMPROC_CONTROL_COMMIT_TABLE;
+
+#define GFMmProcControlCommitCommit(handle) \
+ ((GFMMPROC_CONTROL_COMMIT_TABLE*)handle)->MmProcControlCommitCommit(handle)
+#define GFMmProcControlCommitIsDeferred(handle) \
+ ((GFMMPROC_CONTROL_COMMIT_TABLE*)handle)->MmProcControlCommitIsDeferred(handle)
+#define GFMmProcControlCommitSetDeferred(handle, deferred) \
+ ((GFMMPROC_CONTROL_COMMIT_TABLE*)handle)->MmProcControlCommitSetDeferred(handle, deferred)
+
+
+
+//*****************************************************************************
+// OrientationControl
+//*****************************************************************************
+typedef struct _GFMMPROC_CONTROL_ORIENTATION_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+ void (*MmProcControlOrientationGetOrientation)(GFMMPROC_CONTROL_ORIENTATION handle,
+ NvVectorS32* frontVector, NvVectorS32* aboveVector);
+ void (*MmProcControlOrientationSetOrientation)(GFMMPROC_CONTROL_ORIENTATION handle,
+ NvVectorS32 frontVector, NvVectorS32 aboveVector);
+
+} GFMMPROC_CONTROL_ORIENTATION_TABLE;
+
+#define GFMmProcControlOrientationGetOrientation(handle, frontVector, aboveVector) \
+ ((GFMMPROC_CONTROL_ORIENTATION_TABLE*)handle)->MmProcControlOrientationGetOrientation(handle, frontVector, aboveVector)
+#define GFMmProcControlOrientationSetOrientation(handle, frontVector, aboveVector) \
+ ((GFMMPROC_CONTROL_ORIENTATION_TABLE*)handle)->MmProcControlOrientationSetOrientation(handle, frontVector, aboveVector)
+
+
+//*****************************************************************************
+// DirectivityControl
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_CONTROL_DIRECTIVITY_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+ //
+ // Orientation Methods
+ //
+ void (*MmProcControlOrientationGetOrientation)(GFMMPROC_CONTROL_ORIENTATION handle,
+ NvVectorS32* frontVector, NvVectorS32* aboveVector);
+ void (*MmProcControlOrientationSetOrientation)(GFMMPROC_CONTROL_ORIENTATION handle,
+ NvVectorS32 frontVector, NvVectorS32 aboveVector);
+
+ void (*MmProcControlDirectivityGetParameters)(GFMMPROC_CONTROL_DIRECTIVITY handle, NvVectorS32* vector);
+ void (*MmProcControlDirectivitySetParameters)(GFMMPROC_CONTROL_DIRECTIVITY handle,
+ NvS32 minAngle, NvS32 maxAngle, NvS32 rearLevel);
+
+} GFMMPROC_CONTROL_DIRECTIVITY_TABLE;
+
+#define GFMmProcControlDirectivityGetParameters(handle, vector) \
+ ((GFMMPROC_CONTROL_DIRECTIVITY_TABLE*)handle)->MmProcControlDirectivityGetParameters(handle, vector)
+#define GFMmProcControlDirectivitySetParameters(handle, minAngle, maxAngle, rearLevel) \
+ ((GFMMPROC_CONTROL_DIRECTIVITY_TABLE*)handle)->MmProcControlDirectivitySetParameters(handle, minAngle, maxAngle, rearLevel)
+
+
+//*****************************************************************************
+// DistanceAttenuationControl
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_CONTROL_DISTANCE_ATTENUATION_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+ NvS32 (*MmProcControlDistanceAttenuationGetMaxDistance)(GFMMPROC_CONTROL_DISTANCE_ATTENUATION handle);
+ NvS32 (*MmProcControlDistanceAttenuationGetMinDistance)(GFMMPROC_CONTROL_DISTANCE_ATTENUATION handle);
+ NvS32 (*MmProcControlDistanceAttenuationGetMuteAfterMax)(GFMMPROC_CONTROL_DISTANCE_ATTENUATION handle);
+ NvS32 (*MmProcControlDistanceAttenuationGetRolloffFactor)(GFMMPROC_CONTROL_DISTANCE_ATTENUATION handle);
+ void (*MmProcControlDistanceAttenuationSetParameters)(GFMMPROC_CONTROL_DISTANCE_ATTENUATION handle,
+ NvS32 minDistance, NvS32 maxDistance,
+ NvS32 muteAfterMax, NvS32 rolloffFactor);
+
+} GFMMPROC_CONTROL_DISTANCE_ATTENUATION_TABLE;
+
+#define GFMmProcControlDistanceAttenuationGetMaxDistance(handle) \
+ ((GFMMPROC_CONTROL_DISTANCE_ATTENUATION_TABLE*)handle)->MmProcControlDistanceAttenuationGetMaxDistance(handle)
+#define GFMmProcControlDistanceAttenuationGetMinDistance(handle) \
+ ((GFMMPROC_CONTROL_DISTANCE_ATTENUATION_TABLE*)handle)->MmProcControlDistanceAttenuationGetMinDistance(handle)
+#define GFMmProcControlDistanceAttenuationGetMuteAfterMax(handle) \
+ ((GFMMPROC_CONTROL_DISTANCE_ATTENUATION_TABLE*)handle)->MmProcControlDistanceAttenuationGetMuteAfterMax(handle)
+#define GFMmProcControlDistanceAttenuationGetRolloffFactor(handle) \
+ ((GFMMPROC_CONTROL_DISTANCE_ATTENUATION_TABLE*)handle)->MmProcControlDistanceAttenuationGetRolloffFactor(handle)
+#define GFMmProcControlDistanceAttenuationSetParameters(handle, minDistance, maxDistance, muteAfterMax, rolloffFactor) \
+ ((GFMMPROC_CONTROL_DISTANCE_ATTENUATION_TABLE*)handle)->MmProcControlDistanceAttenuationSetParameters(handle, minDistance, maxDistance, muteAfterMax, rolloffFactor)
+
+
+//*****************************************************************************
+// DopplerControl
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_CONTROL_DOPPLER_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+ void (*MmProcControlDopplerGetVelocityCartesian)(GFMMPROC_CONTROL_DOPPLER handle, NvVectorS32* vector);
+ NvS32 (*MmProcControlDopplerIsEnabled)(GFMMPROC_CONTROL_DOPPLER handle);
+ void (*MmProcControlDopplerSetEnabled)(GFMMPROC_CONTROL_DOPPLER handle, NvS32 dopplerEnabled);
+ void (*MmProcControlDopplerSetVelocityCartesian)(GFMMPROC_CONTROL_DOPPLER handle, NvVectorS32 vector);
+ void (*MmProcControlDopplerSetVelocitySpherical)(GFMMPROC_CONTROL_DOPPLER handle,
+ NvS32 azimuth, NvS32 elevation, NvS32 radius);
+
+} GFMMPROC_CONTROL_DOPPLER_TABLE;
+
+#define GFMmProcControlDopplerGetVelocityCartesian(handle, vector) \
+ ((GFMMPROC_CONTROL_DOPPLER_TABLE*)handle)->MmProcControlDopplerGetVelocityCartesian(handle, vector)
+#define GFMmProcControlDopplerIsEnabled(handle) \
+ ((GFMMPROC_CONTROL_DOPPLER_TABLE*)handle)->MmProcControlDopplerIsEnabled(handle)
+#define GFMmProcControlDopplerSetEnabled(handle, dopplerEnabled) \
+ ((GFMMPROC_CONTROL_DOPPLER_TABLE*)handle)->MmProcControlDopplerSetEnabled(handle, dopplerEnabled)
+#define GFMmProcControlDopplerSetVelocityCartesian(handle, vector) \
+ ((GFMMPROC_CONTROL_DOPPLER_TABLE*)handle)->MmProcControlDopplerSetVelocityCartesian(handle, vector)
+#define GFMmProcControlDopplerSetVelocitySpherical(handle, azimuth, elevation, radius) \
+ ((GFMMPROC_CONTROL_DOPPLER_TABLE*)handle)->MmProcControlDopplerSetVelocitySpherical(handle, azimuth, elevation, radius)
+
+
+//*****************************************************************************
+// LocationControl
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_CONTROL_LOCATION_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+ void (*MmProcControlLocationGetCartesian)(GFMMPROC_CONTROL_LOCATION handle, NvVectorS32* vector);
+ void (*MmProcControlLocationSetCartesian)(GFMMPROC_CONTROL_LOCATION handle, NvVectorS32 vector);
+ void (*MmProcControlLocationSetSpherical)(GFMMPROC_CONTROL_LOCATION handle, NvS32 azimuth, NvS32 elevation, NvS32 radius);
+ void (*MmProcControlLocationSetCoefficients)(GFMMPROC_CONTROL_LOCATION handle,GFMMPROC_SOUND_SOURCE_3D SS3D,GFMMPROC_SPECTATOR spec, NvS32 CurrVec[],NvS32 TargVec[]);
+ void (*MmProcControlLocationGetCoefficients)(GFMMPROC_CONTROL_LOCATION handle, void* Coeff);
+
+} GFMMPROC_CONTROL_LOCATION_TABLE;
+
+#define GFMmProcControlLocationGetCartesian(handle, vector) \
+ ((GFMMPROC_CONTROL_LOCATION_TABLE*)handle)->MmProcControlLocationGetCartesian(handle, vector)
+#define GFMmProcControlLocationSetCartesian(handle, vector) \
+ ((GFMMPROC_CONTROL_LOCATION_TABLE*)handle)->MmProcControlLocationSetCartesian(handle, vector)
+#define GFMmProcControlLocationSetSpherical(handle, azimuth, elevation, radius) \
+ ((GFMMPROC_CONTROL_LOCATION_TABLE*)handle)->MmProcControlLocationSetSpherical(handle, azimuth, elevation, radius)
+#define GFMmProcControlLocationSetCoefficients(handle, SS3D,spec, CurrVec,TargVec) \
+ ((GFMMPROC_CONTROL_LOCATION_TABLE*)handle)->MmProcControlLocationSetCoefficients(handle, SS3D,spec, CurrVec,TargVec)
+#define GFMmProcControlLocationGetCoefficients(handle,pCoeff)\
+ ((GFMMPROC_CONTROL_LOCATION_TABLE*)handle)->MmProcControlLocationGetCoefficients(handle,pCoeff)
+
+//*****************************************************************************
+// MacroscopicControl
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_CONTROL_MACROSCOPIC_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+ //
+ // Orientation Methods
+ //
+ void (*MmProcControlOrientationGetOrientation)(GFMMPROC_CONTROL_ORIENTATION handle,
+ NvVectorS32* frontVector, NvVectorS32* aboveVector);
+ void (*MmProcControlOrientationSetOrientation)(GFMMPROC_CONTROL_ORIENTATION handle,
+ NvVectorS32 frontVector, NvVectorS32 aboveVector);
+
+ void (*MmProcControlMacroscopicGetSize)(GFMMPROC_CONTROL_MACROSCOPIC handle, NvVectorS32* vector);
+ void (*MmProcControlMacroscopicSetSize)(GFMMPROC_CONTROL_MACROSCOPIC handle, NvVectorS32 vector);
+
+} GFMMPROC_CONTROL_MACROSCOPIC_TABLE;
+
+#define GFMmProcControlMacroscopicGetSize(handle, vector) \
+ ((GFMMPROC_CONTROL_MACROSCOPIC_TABLE*)handle)->MmProcControlMacroscopicGetSize(handle, vector)
+#define GFMmProcControlMacroscopicSetSize(handle, vector) \
+ ((GFMMPROC_CONTROL_MACROSCOPIC_TABLE*)handle)->MmProcControlMacroscopicSetSize(handle, vector)
+
+
+//*****************************************************************************
+// ObstructionControl
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_CONTROL_OBSTRUCTION_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+ NvS32 (*MmProcControlObstructionGetHFLevel)(GFMMPROC_CONTROL_OBSTRUCTION handle);
+ NvS32 (*MmProcControlObstructionGetLevel)(GFMMPROC_CONTROL_OBSTRUCTION handle);
+ void (*MmProcControlObstructionSetHFLevel)(GFMMPROC_CONTROL_OBSTRUCTION handle, NvS32 HFLevel);
+ void (*MmProcControlObstructionSetLevel)(GFMMPROC_CONTROL_OBSTRUCTION handle, NvS32 level);
+
+} GFMMPROC_CONTROL_OBSTRUCTION_TABLE;
+
+#define GFMmProcControlObstructionGetHFLevel(handle) \
+ ((GFMMPROC_CONTROL_OBSTRUCTION_TABLE*)handle)->MmProcControlObstructionGetHFLevel(handle)
+#define GFMmProcControlObstructionGetLevel(handle) \
+ ((GFMMPROC_CONTROL_OBSTRUCTION_TABLE*)handle)->MmProcControlObstructionGetLevel(handle)
+#define GFMmProcControlObstructionSetHFLevel(handle, HFLevel) \
+ ((GFMMPROC_CONTROL_OBSTRUCTION_TABLE*)handle)->MmProcControlObstructionSetHFLevel(handle, HFLevel)
+#define GFMmProcControlObstructionSetLevel(handle, level) \
+ ((GFMMPROC_CONTROL_OBSTRUCTION_TABLE*)handle)->MmProcControlObstructionSetLevel(handle, level)
+
+
+#endif // GFMMPROC_ADVANCED_3D_AUDIO_CONTROLS
+
+
+
+
+//*****************************************************************************
+//*****************************************************************************
+//
+//
+// GFMMPROC_ADVANCED_CONTROLS
+//
+//
+//*****************************************************************************
+//*****************************************************************************
+
+#if defined GFMMPROC_ADVANCED_CONTROLS
+
+typedef GFMMPROC_CONTROL GFMMPROC_CONTROL_AUDIO_FORMAT;
+typedef GFMMPROC_CONTROL GFMMPROC_CONTROL_EFFECT;
+typedef GFMMPROC_CONTROL GFMMPROC_CONTROL_EFFECT_ORDER;
+typedef GFMMPROC_CONTROL GFMMPROC_CONTROL_FORMAT;
+typedef GFMMPROC_CONTROL GFMMPROC_CONTROL_MIDI_CHANNEL;
+typedef GFMMPROC_CONTROL GFMMPROC_CONTROL_PAN;
+typedef GFMMPROC_CONTROL GFMMPROC_CONTROL_PRIORITY;
+
+
+
+//*****************************************************************************
+// FormatControl
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_CONTROL_FORMAT_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+ NvS32 (*MmProcControlFormatGetEstimatedBitRate)(GFMMPROC_CONTROL_FORMAT handle);
+ char* (*MmProcControlFormatGetFormat)(GFMMPROC_CONTROL_FORMAT handle);
+ NvS32 (*MmProcControlFormatGetIntParameterValue)(GFMMPROC_CONTROL_FORMAT handle, char* parameter);
+ NvS32 (*MmProcControlFormatGetMetadataOverride)(GFMMPROC_CONTROL_FORMAT handle);
+ NvS32 (*MmProcControlFormatGetMetadataSupportMode)(GFMMPROC_CONTROL_FORMAT handle);
+ char* (*MmProcControlFormatGetStrParameterValue)(GFMMPROC_CONTROL_FORMAT handle, char* parameter);
+ char* (*MmProcControlFormatGetSupportedFormats)(GFMMPROC_CONTROL_FORMAT handle);
+ NvS32* (*MmProcControlFormatGetSupportedIntParameterRange)(GFMMPROC_CONTROL_FORMAT handle, char* parameter);
+ char* (*MmProcControlFormatGetSupportedIntParameters)(GFMMPROC_CONTROL_FORMAT handle);
+ char* (*MmProcControlFormatGetSupportedMetadataKeys)(GFMMPROC_CONTROL_FORMAT handle);
+ char* (*MmProcControlFormatGetSupportedStrParameters)(GFMMPROC_CONTROL_FORMAT handle);
+ char* (*MmProcControlFormatGetSupportedStrParameterValues)(GFMMPROC_CONTROL_FORMAT handle, char* parameter);
+ void (*MmProcControlFormatSetFormat)(GFMMPROC_CONTROL_FORMAT handle, char* format);
+ void (*MmProcControlFormatSetMetadata)(GFMMPROC_CONTROL_FORMAT handle, char* key, char* value);
+ void (*MmProcControlFormatSetMetadataOverride)(GFMMPROC_CONTROL_FORMAT handle, NvS32 override);
+ void (*MmProcControlFormatSetParameterStr)(GFMMPROC_CONTROL_FORMAT handle, char* parameter, char* value);
+ NvS32 (*MmProcControlFormatSetParameterInt)(GFMMPROC_CONTROL_FORMAT handle, char* parameter, NvS32 value);
+
+} GFMMPROC_CONTROL_FORMAT_TABLE;
+
+#define GFMMPROC_CONTROL_FORMAT_METADATA_NOT_SUPPORTED 0
+#define GFMMPROC_CONTROL_FORMAT_METADATA_SUPPORTED_FIXED_KEYS 1
+#define GFMMPROC_CONTROL_FORMAT_METADATA_SUPPORTED_FREE_KEYS 2
+
+#define GFMMPROC_CONTROL_FORMAT_PARAM_BITRATE "bitrate"
+#define GFMMPROC_CONTROL_FORMAT_PARAM_BITRATE_TYPE "bitrate type"
+#define GFMMPROC_CONTROL_FORMAT_PARAM_BITS_PER_SAMPLE "bits per sample"
+#define GFMMPROC_CONTROL_FORMAT_PARAM_CHANNELS "channels"
+#define GFMMPROC_CONTROL_FORMAT_PARAM_FRAMERATE "frame rate"
+#define GFMMPROC_CONTROL_FORMAT_PARAM_QUALITY "quality"
+#define GFMMPROC_CONTROL_FORMAT_PARAM_SAMPLERATE "sample rate"
+#define GFMMPROC_CONTROL_FORMAT_PARAM_TRACK "track"
+#define GFMMPROC_CONTROL_FORMAT_PARAM_TRACKS_AVAILABLE "tracks available"
+#define GFMMPROC_CONTROL_FORMAT_PARAM_VERSION_TYPE "version type"
+
+#define GFMMPROC_CONTROL_FORMAT_TRACK_ALL -1
+#define GFMMPROC_CONTROL_FORMAT_TRACK_DEFAULT 0
+#define GFMMPROC_CONTROL_FORMAT_TRACK_ONE 1
+
+
+#define GFMmProcControlFormatGetEstimatedBitRate(handle) \
+ ((GFMMPROC_CONTROL_FORMAT_TABLE*)handle)->MmProcControlFormatGetEstimatedBitRate(handle)
+#define GFMmProcControlFormatGetFormat(handle) \
+ ((GFMMPROC_CONTROL_FORMAT_TABLE*)handle)->MmProcControlFormatGetFormat(handle)
+#define GFMmProcControlFormatGetIntParameterValue(handle, parameter) \
+ ((GFMMPROC_CONTROL_FORMAT_TABLE*)handle)->MmProcControlFormatGetIntParameterValue(handle, parameter)
+#define GFMmProcControlFormatGetMetadataOverride(handle) \
+ ((GFMMPROC_CONTROL_FORMAT_TABLE*)handle)->MmProcControlFormatGetMetadataOverride(handle)
+#define GFMmProcControlFormatGetMetadataSupportMode(handle) \
+ ((GFMMPROC_CONTROL_FORMAT_TABLE*)handle)->MmProcControlFormatGetMetadataSupportMode(handle)
+#define GFMmProcControlFormatGetStrParameterValue(handle, parameter) \
+ ((GFMMPROC_CONTROL_FORMAT_TABLE*)handle)->MmProcControlFormatGetStrParameterValue(handle, parameter)
+#define GFMmProcControlFormatGetSupportedFormats(handle) \
+ ((GFMMPROC_CONTROL_FORMAT_TABLE*)handle)->MmProcControlFormatGetSupportedFormats(handle)
+#define GFMmProcControlFormatGetSupportedIntParameterRange(handle, parameter) \
+ ((GFMMPROC_CONTROL_FORMAT_TABLE*)handle)->MmProcControlFormatGetSupportedIntParameterRange(handle, parameter)
+#define GFMmProcControlFormatGetSupportedIntParameters(handle) \
+ ((GFMMPROC_CONTROL_FORMAT_TABLE*)handle)->MmProcControlFormatGetSupportedIntParameters(handle)
+#define GFMmProcControlFormatGetSupportedMetadataKeys(handle) \
+ ((GFMMPROC_CONTROL_FORMAT_TABLE*)handle)->MmProcControlFormatGetSupportedMetadataKeys(handle)
+#define GFMmProcControlFormatGetSupportedStrParameters(handle) \
+ ((GFMMPROC_CONTROL_FORMAT_TABLE*)handle)->MmProcControlFormatGetSupportedStrParameters(handle)
+#define GFMmProcControlFormatGetSupportedStrParameterValues(handle, parameter) \
+ ((GFMMPROC_CONTROL_FORMAT_TABLE*)handle)->MmProcControlFormatGetSupportedStrParameterValues(handle, parameter)
+#define GFMmProcControlFormatSetFormat(handle, format) \
+ ((GFMMPROC_CONTROL_FORMAT_TABLE*)handle)->MmProcControlFormatSetFormat(handle, format)
+#define GFMmProcControlFormatSetMetadata(handle, key, value) \
+ ((GFMMPROC_CONTROL_FORMAT_TABLE*)handle)->MmProcControlFormatSetMetadata(handle, key, value)
+#define GFMmProcControlFormatSetMetadataOverride(handle, override) \
+ ((GFMMPROC_CONTROL_FORMAT_TABLE*)handle)->MmProcControlFormatSetMetadataOverride(handle, override)
+#define GFMmProcControlFormatSetParameterStr(handle, parameter, value) \
+ ((GFMMPROC_CONTROL_FORMAT_TABLE*)handle)->MmProcControlFormatSetParameterStr(handle, parameter, value)
+#define GFMmProcControlFormatSetParameterInt(handle, parameter, value) \
+ ((GFMMPROC_CONTROL_FORMAT_TABLE*)handle)->MmProcControlFormatSetParameterInt(handle, parameter, value)
+
+
+
+//*****************************************************************************
+// AudioFormatControl
+//*****************************************************************************
+//
+typedef GFMMPROC_CONTROL_FORMAT_TABLE GFMMPROC_CONTROL_AUDIO_FORMAT_TABLE;
+
+
+//*****************************************************************************
+// EffectControl
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_CONTROL_EFFECT_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+ char* (*MmProcControlEffectGetPreset)(GFMMPROC_CONTROL_EFFECT handle);
+ char** (*MmProcControlEffectGetPresetNames)(GFMMPROC_CONTROL_EFFECT handle);
+ NvS32 (*MmProcControlEffectGetScope)(GFMMPROC_CONTROL_EFFECT handle);
+ NvS32 (*MmProcControlEffectIsEnabled)(GFMMPROC_CONTROL_EFFECT handle);
+ NvS32 (*MmProcControlEffectIsEnforced)(GFMMPROC_CONTROL_EFFECT handle);
+ void (*MmProcControlEffectSetEnabled)(GFMMPROC_CONTROL_EFFECT handle, NvS32 enable);
+ void (*MmProcControlEffectSetEnforced)(GFMMPROC_CONTROL_EFFECT handle, NvS32 enforced);
+ void (*MmProcControlEffectSetPreset)(GFMMPROC_CONTROL_EFFECT handle, char* preset);
+ void (*MmProcControlEffectSetScope)(GFMMPROC_CONTROL_EFFECT handle, NvS32 scope);
+
+} GFMMPROC_CONTROL_EFFECT_TABLE;
+
+#define GFMMPROC_CONTROL_EFFECT_SCOPE_LIVE_ONLY 1
+#define GFMMPROC_CONTROL_EFFECT_SCOPE_RECORD_ONLY 2
+#define GFMMPROC_CONTROL_EFFECT_SCOPE_LIVE_AND_RECORD 3
+
+#define GFMmProcControlEffectGetPreset(handle) \
+ ((GFMMPROC_CONTROL_EFFECT_TABLE*)handle)->MmProcControlEffectGetPreset(handle)
+#define GFMmProcControlEffectGetPresetNames(handle) \
+ ((GFMMPROC_CONTROL_EFFECT_TABLE*)handle)->MmProcControlEffectGetPresetNames(handle)
+#define GFMmProcControlEffectGetScope(handle) \
+ ((GFMMPROC_CONTROL_EFFECT_TABLE*)handle)->MmProcControlEffectGetScope(handle)
+#define GFMmProcControlEffectIsEnabled(handle) \
+ ((GFMMPROC_CONTROL_EFFECT_TABLE*)handle)->MmProcControlEffectIsEnabled(handle)
+#define GFMmProcControlEffectIsEnforced(handle) \
+ ((GFMMPROC_CONTROL_EFFECT_TABLE*)handle)->MmProcControlEffectIsEnforced(handle)
+#define GFMmProcControlEffectSetEnabled(handle, enable) \
+ ((GFMMPROC_CONTROL_EFFECT_TABLE*)handle)->MmProcControlEffectSetEnabled(handle, enable)
+#define GFMmProcControlEffectSetEnforced(handle, enforced) \
+ ((GFMMPROC_CONTROL_EFFECT_TABLE*)handle)->MmProcControlEffectSetEnforced(handle, enforced)
+#define GFMmProcControlEffectSetPreset(handle, preset) \
+ ((GFMMPROC_CONTROL_EFFECT_TABLE*)handle)->MmProcControlEffectSetPreset(handle, preset)
+#define GFMmProcControlEffectSetScope(handle, scope) \
+ ((GFMMPROC_CONTROL_EFFECT_TABLE*)handle)->MmProcControlEffectSetScope(handle, scope)
+
+
+//*****************************************************************************
+// EffectOrderControl
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_CONTROL_EFFECT_ORDER_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+ NvS32 (*MmProcControlEffectOrderGetEffectOrder)(GFMMPROC_CONTROL_EFFECT_ORDER handle, GFMMPROC_CONTROL_EFFECT effect);
+ GFMMPROC_CONTROL_EFFECT (*MmProcControlEffectOrderGetEffectOrders)(GFMMPROC_CONTROL_EFFECT_ORDER handle);
+ NvS32 (*MmProcControlEffectOrderSetEffectOrder)(GFMMPROC_CONTROL_EFFECT_ORDER handle, GFMMPROC_CONTROL_EFFECT effect, NvS32 order);
+
+} GFMMPROC_CONTROL_EFFECT_ORDER_TABLE;
+
+#define GFMmProcControlEffectOrderGetEffectOrder(handle, effect) \
+ ((GFMMPROC_CONTROL_EFFECT_ORDER_TABLE*)handle)->(handle, effect)
+#define GFMmProcControlEffectOrderGetEffectOrders(handle) \
+ ((GFMMPROC_CONTROL_EFFECT_ORDER_TABLE*)handle)->MmProcControlEffectOrderGetEffectOrders(handle)
+#define GFMmProcControlEffectOrderSetEffectOrder(handle, effect, order) \
+ ((GFMMPROC_CONTROL_EFFECT_ORDER_TABLE*)handle)->MmProcControlEffectOrderSetEffectOrder(handle, effect, order)
+
+
+//*****************************************************************************
+// MIDIChannelControl
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_CONTROL_MIDI_CHANNEL_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+ GFMMPROC_CONTROL (*MmProcControlMidiChannelGetChannelControl)(GFMMPROC_CONTROL_MIDI_CHANNEL handle, char* controlType, NvS32 channel);
+ GFMMPROC_CONTROL* (*MmProcControlMidiChannelGetChannelControls)(GFMMPROC_CONTROL_MIDI_CHANNEL handle, NvS32 channel);
+
+} GFMMPROC_CONTROL_MIDI_CHANNEL_TABLE;
+
+#define GFMmProcControlMidiChannelGetChannelControl(handle, controlType, channel) \
+ ((GFMMPROC_CONTROL_MIDI_CHANNEL_TABLE*)handle)->MmProcControlMidiChannelGetChannelControl(handle, controlType, channel)
+#define GFMmProcControlMidiChannelGetChannelControls(handle, channel) \
+ ((GFMMPROC_CONTROL_MIDI_CHANNEL_TABLE*)handle)->MmProcControlMidiChannelGetChannelControls(handle, channel)
+
+
+//*****************************************************************************
+// PanControl
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_CONTROL_PAN_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+ NvS32 (*MmProcControlPanGetPan)(GFMMPROC_CONTROL_PAN handle);
+ NvS32 (*MmProcControlPanSetPan)(GFMMPROC_CONTROL_PAN handle, NvS32 pan);
+
+} GFMMPROC_CONTROL_PAN_TABLE;
+
+#define GFMmProcControlPanGetPan(handle) \
+ ((GFMMPROC_CONTROL_PAN_TABLE*)handle)->MmProcControlPanGetPan(handle)
+#define GFMmProcControlPanSetPan(handle, pan) \
+ ((GFMMPROC_CONTROL_PAN_TABLE*)handle)->MmProcControlPanSetPan(handle, pan)
+
+
+//*****************************************************************************
+// PriorityControl
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_CONTROL_PRIORITY_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+ NvS32 (*MmProcControlPriorityGetPriority)(GFMMPROC_CONTROL_PRIORITY handle);
+ void (*MmProcControlPrioritySetPriority)(GFMMPROC_CONTROL_PRIORITY handle, NvS32 level);
+
+} GFMMPROC_CONTROL_PRIORITY_TABLE;
+
+#define GFMmProcControlPriorityGetPriority(handle) \
+ ((GFMMPROC_CONTROL_PRIORITY_TABLE*)handle)->MmProcControlPriorityGetPriority(handle)
+#define GFMmProcControlPrioritySetPriority(handle, level) \
+ ((GFMMPROC_CONTROL_PRIORITY_TABLE*)handle)->MmProcControlPrioritySetPriority(handle, level)
+
+
+
+//*****************************************************************************
+//*****************************************************************************
+//
+//
+// GFMMPROC_ADVANCED_AUDIO_EFFECT_CONTROLS
+//
+//
+//*****************************************************************************
+//*****************************************************************************
+
+#if defined GFMMPROC_ADVANCED_AUDIO_EFFECT_CONTROLS
+
+typedef GFMMPROC_CONTROL_EFFECT GFMMPROC_CONTROL_EFFECT_AUDIO_VIRTUALIZER;
+typedef GFMMPROC_CONTROL_EFFECT GFMMPROC_CONTROL_EFFECT_ACOUSTIC_ECHO_CANCELLATION;
+typedef GFMMPROC_CONTROL_EFFECT GFMMPROC_CONTROL_EFFECT_CHORUS;
+typedef GFMMPROC_CONTROL_EFFECT GFMMPROC_CONTROL_EFFECT_EQUALIZER;
+typedef GFMMPROC_CONTROL_EFFECT GFMMPROC_CONTROL_EFFECT_REVERB;
+typedef GFMMPROC_CONTROL_EFFECT GFMMPROC_CONTROL_EFFECT_DRC;
+typedef GFMMPROC_CONTROL GFMMPROC_CONTROL_REVERB_SOURCE;
+
+//*****************************************************************************
+// AudioVirtualizerControl
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_CONTROL_EFFECT_AUDIO_VIRTUALIZER_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+ char* (*MmProcControlEffectGetPreset)(GFMMPROC_CONTROL_EFFECT handle);
+ char** (*MmProcControlEffectGetPresetNames)(GFMMPROC_CONTROL_EFFECT handle);
+ NvS32 (*MmProcControlEffectGetScope)(GFMMPROC_CONTROL_EFFECT handle);
+ NvS32 (*MmProcControlEffectIsEnabled)(GFMMPROC_CONTROL_EFFECT handle);
+ NvS32 (*MmProcControlEffectIsEnforced)(GFMMPROC_CONTROL_EFFECT handle);
+ void (*MmProcControlEffectSetEnabled)(GFMMPROC_CONTROL_EFFECT handle, NvS32 enable);
+ void (*MmProcControlEffectSetEnforced)(GFMMPROC_CONTROL_EFFECT handle, NvS32 enforced);
+ void (*MmProcControlEffectSetPreset)(GFMMPROC_CONTROL_EFFECT handle, char* preset);
+ void (*MmProcControlEffectSetScope)(GFMMPROC_CONTROL_EFFECT handle, NvS32 scope);
+
+ NvS32 (*MmProcControlEffectAudioVirtualizerGetSpread)(GFMMPROC_CONTROL_EFFECT_AUDIO_VIRTUALIZER handle);
+ void (*MmProcControlEffectAudioVirtualizerSetSpread)(GFMMPROC_CONTROL_EFFECT_AUDIO_VIRTUALIZER handle, NvS32 width);
+
+} GFMMPROC_CONTROL_EFFECT_AUDIO_VIRTUALIZER_TABLE;
+
+#define GFMmProcControlEffectAudioVirtualizerGetSpread(handle) \
+ ((GFMMPROC_CONTROL_EFFECT_AUDIO_VIRTUALIZER_TABLE*)handle)->MmProcControlEffectAudioVirtualizerGetSpread(handle)
+#define GFMmProcControlEffectAudioVirtualizerSetSpread(handle, width) \
+ ((GFMMPROC_CONTROL_EFFECT_AUDIO_VIRTUALIZER_TABLE*)handle)->MmProcControlEffectAudioVirtualizerSetSpread(handle, width)
+
+
+//*****************************************************************************
+// AcousticEchoCancellationControl
+//*****************************************************************************
+//
+typedef GFMMPROC_CONTROL_EFFECT_TABLE GFMMPROC_CONTROL_EFFECT_ACOUSTIC_ECHO_CANCELLATION_TABLE;
+
+//*****************************************************************************
+// SBCControl
+//*****************************************************************************
+//
+typedef GFMMPROC_CONTROL_EFFECT_TABLE GFMMPROC_CONTROL_EFFECT_SBC_TABLE;
+
+//*****************************************************************************
+// SBRControl
+//*****************************************************************************
+//
+typedef GFMMPROC_CONTROL_EFFECT_TABLE GFMMPROC_CONTROL_EFFECT_SBR_TABLE;
+
+
+//*****************************************************************************
+// ChorusControl
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_CONTROL_EFFECT_CHORUS_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+ char* (*MmProcControlEffectGetPreset)(GFMMPROC_CONTROL_EFFECT handle);
+ char** (*MmProcControlEffectGetPresetNames)(GFMMPROC_CONTROL_EFFECT handle);
+ NvS32 (*MmProcControlEffectGetScope)(GFMMPROC_CONTROL_EFFECT handle);
+ NvS32 (*MmProcControlEffectIsEnabled)(GFMMPROC_CONTROL_EFFECT handle);
+ NvS32 (*MmProcControlEffectIsEnforced)(GFMMPROC_CONTROL_EFFECT handle);
+ void (*MmProcControlEffectSetEnabled)(GFMMPROC_CONTROL_EFFECT handle, NvS32 enable);
+ void (*MmProcControlEffectSetEnforced)(GFMMPROC_CONTROL_EFFECT handle, NvS32 enforced);
+ void (*MmProcControlEffectSetPreset)(GFMMPROC_CONTROL_EFFECT handle, char* preset);
+ void (*MmProcControlEffectSetScope)(GFMMPROC_CONTROL_EFFECT handle, NvS32 scope);
+
+ NvS32 (*MmProcControlEffectChorusGetAverageDelay)(GFMMPROC_CONTROL_EFFECT_CHORUS handle);
+ NvS32 (*MmProcControlEffectChorusGetMaxAverageDelay)(GFMMPROC_CONTROL_EFFECT_CHORUS handle);
+ NvS32 (*MmProcControlEffectChorusGetMaxModulationDepth)(GFMMPROC_CONTROL_EFFECT_CHORUS handle);
+ NvS32 (*MmProcControlEffectChorusGetMaxModulationRate)(GFMMPROC_CONTROL_EFFECT_CHORUS handle);
+ NvS32 (*MmProcControlEffectChorusGetMinModulationRate)(GFMMPROC_CONTROL_EFFECT_CHORUS handle);
+ NvS32 (*MmProcControlEffectChorusGetModulationDepth)(GFMMPROC_CONTROL_EFFECT_CHORUS handle);
+ NvS32 (*MmProcControlEffectChorusGetModulationRate)(GFMMPROC_CONTROL_EFFECT_CHORUS handle);
+ NvS32 (*MmProcControlEffectChorusGetWetLevel)(GFMMPROC_CONTROL_EFFECT_CHORUS handle);
+ void (*MmProcControlEffectChorusSetAverageDelay)(GFMMPROC_CONTROL_EFFECT_CHORUS handle, NvS32 delay);
+ void (*MmProcControlEffectChorusSetModulationDepth)(GFMMPROC_CONTROL_EFFECT_CHORUS handle, NvS32 depth);
+ void (*MmProcControlEffectChorusSetModulationRate)(GFMMPROC_CONTROL_EFFECT_CHORUS handle, NvS32 rate);
+ NvS32 (*MmProcControlEffectChorusSetWetLevel)(GFMMPROC_CONTROL_EFFECT_CHORUS handle, NvS32 level);
+
+} GFMMPROC_CONTROL_EFFECT_CHORUS_TABLE;
+
+#define GFMmProcControlEffectChorusGetAverageDelay(handle) \
+ ((GFMMPROC_CONTROL_EFFECT_CHORUS_TABLE*)handle)->MmProcControlEffectChorusGetAverageDelay(handle)
+#define GFMmProcControlEffectChorusGetMaxAverageDelay(handle) \
+ ((GFMMPROC_CONTROL_EFFECT_CHORUS_TABLE*)handle)->MmProcControlEffectChorusGetMaxAverageDelay(handle)
+#define GFMmProcControlEffectChorusGetMaxModulationDepth(handle) \
+ ((GFMMPROC_CONTROL_EFFECT_CHORUS_TABLE*)handle)->MmProcControlEffectChorusGetMaxModulationDepth(handle)
+#define GFMmProcControlEffectChorusGetMaxModulationRate(handle) \
+ ((GFMMPROC_CONTROL_EFFECT_CHORUS_TABLE*)handle)->MmProcControlEffectChorusGetMaxModulationRate(handle)
+#define GFMmProcControlEffectChorusGetMinModulationRate(handle) \
+ ((GFMMPROC_CONTROL_EFFECT_CHORUS_TABLE*)handle)->MmProcControlEffectChorusGetMinModulationRate(handle)
+#define GFMmProcControlEffectChorusGetModulationDepth(handle) \
+ ((GFMMPROC_CONTROL_EFFECT_CHORUS_TABLE*)handle)->MmProcControlEffectChorusGetModulationDepth(handle)
+#define GFMmProcControlEffectChorusGetModulationRate(handle) \
+ ((GFMMPROC_CONTROL_EFFECT_CHORUS_TABLE*)handle)->MmProcControlEffectChorusGetModulationRate(handle)
+#define GFMmProcControlEffectChorusGetWetLevel(handle) \
+ ((GFMMPROC_CONTROL_EFFECT_CHORUS_TABLE*)handle)->MmProcControlEffectChorusGetWetLevel(handle)
+#define GFMmProcControlEffectChorusSetAverageDelay(handle, delay) \
+ ((GFMMPROC_CONTROL_EFFECT_CHORUS_TABLE*)handle)->MmProcControlEffectChorusSetAverageDelay(handle, delay)
+#define GFMmProcControlEffectChorusSetModulationDepth(handle, depth) \
+ ((GFMMPROC_CONTROL_EFFECT_CHORUS_TABLE*)handle)->MmProcControlEffectChorusSetModulationDepth(handle, depth)
+#define GFMmProcControlEffectChorusSetModulationRate(handle, rate) \
+ ((GFMMPROC_CONTROL_EFFECT_CHORUS_TABLE*)handle)->MmProcControlEffectChorusSetModulationRate(handle, rate)
+#define GFMmProcControlEffectChorusSetWetLevel(handle, level) \
+ ((GFMMPROC_CONTROL_EFFECT_CHORUS_TABLE*)handle)->MmProcControlEffectChorusSetWetLevel(handle, level)
+
+
+//*****************************************************************************
+// EqualizerControl
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_CONTROL_EFFECT_EQUALIZER_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+ char* (*MmProcControlEffectGetPreset)(GFMMPROC_CONTROL_EFFECT handle);
+ char** (*MmProcControlEffectGetPresetNames)(GFMMPROC_CONTROL_EFFECT handle);
+ NvS32 (*MmProcControlEffectGetScope)(GFMMPROC_CONTROL_EFFECT handle);
+ NvS32 (*MmProcControlEffectIsEnabled)(GFMMPROC_CONTROL_EFFECT handle);
+ NvS32 (*MmProcControlEffectIsEnforced)(GFMMPROC_CONTROL_EFFECT handle);
+ void (*MmProcControlEffectSetEnabled)(GFMMPROC_CONTROL_EFFECT handle, NvS32 enable);
+ void (*MmProcControlEffectSetEnforced)(GFMMPROC_CONTROL_EFFECT handle, NvS32 enforced);
+ void (*MmProcControlEffectSetPreset)(GFMMPROC_CONTROL_EFFECT handle, char* preset);
+ void (*MmProcControlEffectSetScope)(GFMMPROC_CONTROL_EFFECT handle, NvS32 scope);
+
+ NvS32 (*MmProcControlEffectEqualizerGetBand)(GFMMPROC_CONTROL_EFFECT_EQUALIZER handle, NvS32 frequency);
+ NvS32 (*MmProcControlEffectEqualizerGetBandLevel)(GFMMPROC_CONTROL_EFFECT_EQUALIZER handle, NvS32 band);
+ NvS32 (*MmProcControlEffectEqualizerGetBass)(GFMMPROC_CONTROL_EFFECT_EQUALIZER handle);
+ NvS32 (*MmProcControlEffectEqualizerGetCenterFreq)(GFMMPROC_CONTROL_EFFECT_EQUALIZER handle, NvS32 band);
+ NvS32 (*MmProcControlEffectEqualizerGetMaxBandLevel)(GFMMPROC_CONTROL_EFFECT_EQUALIZER handle);
+ NvS32 (*MmProcControlEffectEqualizerGetMinBandLevel)(GFMMPROC_CONTROL_EFFECT_EQUALIZER handle);
+ NvS32 (*MmProcControlEffectEqualizerGetNumberOfBands)(GFMMPROC_CONTROL_EFFECT_EQUALIZER handle);
+ NvS32 (*MmProcControlEffectEqualizerGetTreble)(GFMMPROC_CONTROL_EFFECT_EQUALIZER handle);
+ void (*MmProcControlEffectEqualizerSetBandLevel)(GFMMPROC_CONTROL_EFFECT_EQUALIZER handle, NvS32 level, NvS32 band);
+ NvS32 (*MmProcControlEffectEqualizerSetBass)(GFMMPROC_CONTROL_EFFECT_EQUALIZER handle, NvS32 level);
+ NvS32 (*MmProcControlEffectEqualizerSetTreble)(GFMMPROC_CONTROL_EFFECT_EQUALIZER handle, NvS32 level);
+ NvS32 (*MmProcControlEffectEqualizerSetBandX)(GFMMPROC_CONTROL_EFFECT_EQUALIZER handle, NvS32 *levelptr);
+
+} GFMMPROC_CONTROL_EFFECT_EQUALIZER_TABLE;
+
+#define GFMMPROC_CONTROL_EFFECT_EQUALIZER_UNDEFINED -1004
+
+#define GFMmProcControlEffectEqualizerGetBand(handle, frequency) \
+ ((GFMMPROC_CONTROL_EFFECT_EQUALIZER_TABLE*)handle)->(handle, frequency)
+#define GFMmProcControlEffectEqualizerGetBandLevel(handle, band) \
+ ((GFMMPROC_CONTROL_EFFECT_EQUALIZER_TABLE*)handle)->MmProcControlEffectEqualizerGetBandLevel(handle, band)
+#define GFMmProcControlEffectEqualizerGetBass(handle) \
+ ((GFMMPROC_CONTROL_EFFECT_EQUALIZER_TABLE*)handle)->MmProcControlEffectEqualizerGetBass(handle)
+#define GFMmProcControlEffectEqualizerGetCenterFreq(handle, band) \
+ ((GFMMPROC_CONTROL_EFFECT_EQUALIZER_TABLE*)handle)->MmProcControlEffectEqualizerGetCenterFreq(handle, band)
+#define GFMmProcControlEffectEqualizerGetMaxBandLevel(handle) \
+ ((GFMMPROC_CONTROL_EFFECT_EQUALIZER_TABLE*)handle)->MmProcControlEffectEqualizerGetMaxBandLevel(handle)
+#define GFMmProcControlEffectEqualizerGetMinBandLevel(handle) \
+ ((GFMMPROC_CONTROL_EFFECT_EQUALIZER_TABLE*)handle)->MmProcControlEffectEqualizerGetMinBandLevel(handle)
+#define GFMmProcControlEffectEqualizerGetNumberOfBands(handle) \
+ ((GFMMPROC_CONTROL_EFFECT_EQUALIZER_TABLE*)handle)->MmProcControlEffectEqualizerGetNumberOfBands(handle)
+#define GFMmProcControlEffectEqualizerGetTreble(handle) \
+ ((GFMMPROC_CONTROL_EFFECT_EQUALIZER_TABLE*)handle)->MmProcControlEffectEqualizerGetTreble(handle)
+#define GFMmProcControlEffectEqualizerSetBandLevel(handle, level, band) \
+ ((GFMMPROC_CONTROL_EFFECT_EQUALIZER_TABLE*)handle)->MmProcControlEffectEqualizerSetBandLevel(handle, level, band)
+#define GFMmProcControlEffectEqualizerSetBass(handle, level) \
+ ((GFMMPROC_CONTROL_EFFECT_EQUALIZER_TABLE*)handle)->MmProcControlEffectEqualizerSetBass(handle, level)
+#define GFMmProcControlEffectEqualizerSetTreble(handle, level) \
+ ((GFMMPROC_CONTROL_EFFECT_EQUALIZER_TABLE*)handle)->MmProcControlEffectEqualizerSetTreble(handle, level)
+#define GFMmProcControlEffectEqualizerSetBandX(handle, levelptr) \
+ ((GFMMPROC_CONTROL_EFFECT_EQUALIZER_TABLE*)handle)->MmProcControlEffectEqualizerSetBandX(handle, levelptr)
+
+
+//*****************************************************************************
+// Dynamic Range Control (DRC)
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_CONTROL_EFFECT_DRC_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+
+ char* (*MmProcControlEffectGetPreset)(GFMMPROC_CONTROL_EFFECT handle);
+ char** (*MmProcControlEffectGetPresetNames)(GFMMPROC_CONTROL_EFFECT handle);
+ NvS32 (*MmProcControlEffectGetScope)(GFMMPROC_CONTROL_EFFECT handle);
+ NvS32 (*MmProcControlEffectIsEnabled)(GFMMPROC_CONTROL_EFFECT handle);
+ NvS32 (*MmProcControlEffectIsEnforced)(GFMMPROC_CONTROL_EFFECT handle);
+ void (*MmProcControlEffectSetEnabled)(GFMMPROC_CONTROL_EFFECT handle, NvS32 enable);
+ void (*MmProcControlEffectSetEnforced)(GFMMPROC_CONTROL_EFFECT handle, NvS32 enforced);
+ void (*MmProcControlEffectSetPreset)(GFMMPROC_CONTROL_EFFECT handle, char* preset);
+ void (*MmProcControlEffectSetScope)(GFMMPROC_CONTROL_EFFECT handle, NvS32 scope);
+
+ NvS32 (*MmProcControlEffectDRCGetDRCEnable)(GFMMPROC_CONTROL_EFFECT_DRC handle);
+ void (*MmProcControlEffectDRCSetDRCEnable)(GFMMPROC_CONTROL_EFFECT_DRC handle, NvS32 Param);
+ NvS32 (*MmProcControlEffectDRCGetNoiseGateTh)(GFMMPROC_CONTROL_EFFECT_DRC handle);
+ void (*MmProcControlEffectDRCSetNoiseGateTh)(GFMMPROC_CONTROL_EFFECT_DRC handle, NvS32 Param);
+ NvS32 (*MmProcControlEffectDRCGetLowerCompTh)(GFMMPROC_CONTROL_EFFECT_DRC handle);
+ void (*MmProcControlEffectDRCSetLowerCompTh)(GFMMPROC_CONTROL_EFFECT_DRC handle, NvS32 Param);
+ NvS32 (*MmProcControlEffectDRCGetUpperCompTh)(GFMMPROC_CONTROL_EFFECT_DRC handle);
+ void (*MmProcControlEffectDRCSetUpperCompTh)(GFMMPROC_CONTROL_EFFECT_DRC handle, NvS32 Param);
+ NvS32 (*MmProcControlEffectDRCGetClipTh)(GFMMPROC_CONTROL_EFFECT_DRC handle);
+ void (*MmProcControlEffectDRCSetClipTh)(GFMMPROC_CONTROL_EFFECT_DRC handle, NvS32 Param);
+} GFMMPROC_CONTROL_EFFECT_DRC_TABLE;
+
+#define GFMmProcControlEffectDRCGetDRCEnable(handle) \
+ ((GFMMPROC_CONTROL_EFFECT_DRC_TABLE*)handle)->MmProcControlEffectDRCGetDRCEnable(handle)
+#define GFMmProcControlEffectDRCSetDRCEnable(handle, Param) \
+ ((GFMMPROC_CONTROL_EFFECT_DRC_TABLE*)handle)->MmProcControlEffectDRCSetDRCEnable(handle, Param)
+#define GFMmProcControlEffectDRCGetNoiseGateTh(handle) \
+ ((GFMMPROC_CONTROL_EFFECT_DRC_TABLE*)handle)->MmProcControlEffectDRCGetNoiseGateTh(handle)
+#define GFMmProcControlEffectDRCSetNoiseGateTh(handle, Param) \
+ ((GFMMPROC_CONTROL_EFFECT_DRC_TABLE*)handle)->MmProcControlEffectDRCSetNoiseGateTh(handle, Param)
+#define GFMmProcControlEffectDRCGetLowerCompTh(handle) \
+ ((GFMMPROC_CONTROL_EFFECT_DRC_TABLE*)handle)->MmProcControlEffectDRCGetLowerCompTh(handle)
+#define GFMmProcControlEffectDRCSetLowerCompTh(handle, Param) \
+ ((GFMMPROC_CONTROL_EFFECT_DRC_TABLE*)handle)->MmProcControlEffectDRCSetLowerCompTh(handle, Param)
+#define GFMmProcControlEffectDRCGetUpperCompTh(handle) \
+ ((GFMMPROC_CONTROL_EFFECT_DRC_TABLE*)handle)->MmProcControlEffectDRCGetUpperCompTh(handle)
+#define GFMmProcControlEffectDRCSetUpperCompTh(handle, Param) \
+ ((GFMMPROC_CONTROL_EFFECT_DRC_TABLE*)handle)->MmProcControlEffectDRCSetUpperCompTh(handle, Param)
+#define GFMmProcControlEffectDRCGetClipTh(handle) \
+ ((GFMMPROC_CONTROL_EFFECT_DRC_TABLE*)handle)->MmProcControlEffectDRCGetClipTh(handle)
+#define GFMmProcControlEffectDRCSetClipTh(handle, Param) \
+ ((GFMMPROC_CONTROL_EFFECT_DRC_TABLE*)handle)->MmProcControlEffectDRCSetClipTh(handle, Param)
+
+
+
+
+//*****************************************************************************
+// ReverbControl
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_CONTROL_EFFECT_REVERB_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+ char* (*MmProcControlEffectGetPreset)(GFMMPROC_CONTROL_EFFECT handle);
+ char** (*MmProcControlEffectGetPresetNames)(GFMMPROC_CONTROL_EFFECT handle);
+ NvS32 (*MmProcControlEffectGetScope)(GFMMPROC_CONTROL_EFFECT handle);
+ NvS32 (*MmProcControlEffectIsEnabled)(GFMMPROC_CONTROL_EFFECT handle);
+ NvS32 (*MmProcControlEffectIsEnforced)(GFMMPROC_CONTROL_EFFECT handle);
+ void (*MmProcControlEffectSetEnabled)(GFMMPROC_CONTROL_EFFECT handle, NvS32 enable);
+ void (*MmProcControlEffectSetEnforced)(GFMMPROC_CONTROL_EFFECT handle, NvS32 enforced);
+ void (*MmProcControlEffectSetPreset)(GFMMPROC_CONTROL_EFFECT handle, char* preset);
+ void (*MmProcControlEffectSetScope)(GFMMPROC_CONTROL_EFFECT handle, NvS32 scope);
+
+ NvS32 (*MmProcControlEffectReverbGetReverbLevel)(GFMMPROC_CONTROL_EFFECT_REVERB handle);
+ NvS32 (*MmProcControlEffectReverbGetReverbTime)(GFMMPROC_CONTROL_EFFECT_REVERB handle);
+ NvS32 (*MmProcControlEffectReverbSetReverbLevel)(GFMMPROC_CONTROL_EFFECT_REVERB handle, NvS32 level);
+ void (*MmProcControlEffectReverbSetReverbTime)(GFMMPROC_CONTROL_EFFECT_REVERB handle, NvS32 time);
+
+} GFMMPROC_CONTROL_EFFECT_REVERB_TABLE;
+
+#define GFMmProcControlEffectReverbGetReverbLevel(handle) \
+ ((GFMMPROC_CONTROL_EFFECT_REVERB_TABLE*)handle)->MmProcControlEffectReverbGetReverbLevel(handle)
+#define GFMmProcControlEffectReverbGetReverbTime(handle) \
+ ((GFMMPROC_CONTROL_EFFECT_REVERB_TABLE*)handle)->MmProcControlEffectReverbGetReverbTime(handle)
+#define GFMmProcControlEffectReverbSetReverbLevel(handle, level) \
+ ((GFMMPROC_CONTROL_EFFECT_REVERB_TABLE*)handle)->MmProcControlEffectReverbSetReverbLevel(handle, level)
+#define GFMmProcControlEffectReverbSetReverbTime(handle, time) \
+ ((GFMMPROC_CONTROL_EFFECT_REVERB_TABLE*)handle)->MmProcControlEffectReverbSetReverbTime(handle, time)
+
+
+//*****************************************************************************
+// ReverbSourceControl
+//*****************************************************************************
+//
+typedef struct _GFMMPROC_CONTROL_REVERB_SOURCE_TABLE
+{
+ //
+ // Object Methods
+ //
+ NvS32 (*MmProcObjectIsInstance)(GF_HANDLE handle, const char* objectType);
+
+ NvS32 (*MmProcControlReverbSourceGetRoomLevel)(GFMMPROC_CONTROL_REVERB_SOURCE handle);
+ void (*MmProcControlReverbSourceSetRoomLevel)(GFMMPROC_CONTROL_REVERB_SOURCE handle, NvS32 level);
+
+} GFMMPROC_CONTROL_REVERB_SOURCE_TABLE;
+
+#define GFMMPROC_CONTROL_REVERB_SOURCE_DISCONNECT -2147483648
+
+#define GFMmProcControlReverbSourceGetRoomLevel(handle) \
+ ((GFMMPROC_CONTROL_REVERB_SOURCE_TABLE*)handle)->MmProcControlReverbSourceGetRoomLevel(handle)
+#define GFMmProcControlReverbSourceSetRoomLevel(handle, level) \
+ ((GFMMPROC_CONTROL_REVERB_SOURCE_TABLE*)handle)->MmProcControlReverbSourceSetRoomLevel(handle, level)
+
+
+
+#endif // GFMMPROC_ADVANCED_AUDIO_EFFECT_CONTROLS
+
+#endif // GFMMPROC_ADVANCED_CONTROLS
+
+#endif // GFMMPROC_ADVANCED
+
+/*@}*/
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
diff --git a/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFMxDec.h b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFMxDec.h
new file mode 100755
index 00000000..78cc7c5c
--- /dev/null
+++ b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFMxDec.h
@@ -0,0 +1,727 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+*
+* NVIDIA Corporation and its licensors retain all intellectual property
+* and proprietary rights in and to this software, related documentation
+* and any modifications thereto. Any use, reproduction, disclosure or
+* distribution of this software and related documentation without an
+* express license agreement from NVIDIA Corporation is strictly prohibited.
+*/
+
+/** @file GFMxDec.h
+GFSDK MPEG Decode API header file.
+*/
+
+#ifndef _GF_MPEG_DEC__
+#define _GF_MPEG_DEC__
+
+#include "nvtypes.h"
+#include "GFVx.h"
+#include "GFDef.h"
+
+#ifdef __cplusplus
+extern "C" { // only need to export C interface if
+ // used by C++ source code
+#endif
+
+ /** @addtogroup groupMxDec MxDecAPI MPEG Decode API
+
+ @ref pageMxDecAppNotes
+
+ @ref pageMxDecAppNotes1
+
+
+ */
+ /*@{*/
+
+ /****************************************************************************************************/
+ // MXDECCapFlags
+ /** MxDecAPI property flag: Support for Simple Profile.
+ @see GFMXDECTABLE::MxDecGetProperty, GFPROPERTY::Capability
+ */
+#define GF_MXDEC_CAP_SIMPLE 0x00000001
+ /** MxDecAPI property flag: Support for simple profile.
+ @see GFMXDECTABLE::MxDecGetProperty, GFPROPERTY::Capability
+ */
+
+#define GF_MXDEC_CAP_SCALE 0x00000002
+ /** MxDecAPI property flag: Support for simple scale profile.
+ @see GFMXDECTABLE::MxDecGetProperty, GFPROPERTY::Capability
+ */
+
+#define GF_MXDEC_CAP_CORE 0x00000004
+ /** MxDecAPI property flag: Support for CORE profile.
+ @see GFMXDECTABLE::MxDecGetProperty, GFPROPERTY::Capability
+ */
+
+#define GF_MXDEC_CAP_MAIN 0x00000008
+ /** MxDecAPI property flag: Support for MAIN profile.
+ @see GFMXDECTABLE::MxDecGetProperty, GFPROPERTY::Capability
+ */
+
+ /** MxDecAPI property flag: Support for N_bit profile.
+ @see GFMXDECTABLE::MxDecGetProperty, GFPROPERTY::Capability
+ */
+#define GF_MXDEC_CAP_N_BIT 0x00000010
+
+ /** MxDecAPI property flag: Support for LEVEL 1.
+ @see GFMXDECTABLE::MxDecGetProperty, GFPROPERTY::Capability
+ */
+#define GF_MXDEC_CAP_LEVEL1 0x00000100
+
+ /** MxDecAPI property flag: Support for LEVEL 2.
+ @see GFMXDECTABLE::MxDecGetProperty, GFPROPERTY::Capability
+ */
+#define GF_MXDEC_CAP_LEVEL2 0x00000200
+
+ /** MxDecAPI property flag: Support for LEVEL 3.
+ @see GFMXDECTABLE::MxDecGetProperty, GFPROPERTY::Capability
+ */
+#define GF_MXDEC_CAP_LEVEL3 0x00000400
+
+ /** MxDecAPI property flag: Support for LEVEL 4.
+ @see GFMXDECTABLE::MxDecGetProperty, GFPROPERTY::Capability
+ */
+#define GF_MXDEC_CAP_LEVEL4 0x00000800
+
+ /** MxDecAPI property flag: Support for Post Processing's de-blocking.
+ @see GFMXDECTABLE::MxDecGetProperty, GFPROPERTY::Capability
+ */
+#define GF_MXDEC_CAP_DB 0x00001000
+
+ /** MxDecAPI property flag: Support for Post Processing's de-ringing.
+ @see GFMXDECTABLE::MxDecGetProperty, GFPROPERTY::Capability
+ */
+#define GF_MXDEC_CAP_DR 0x00002000
+
+ /****************************************************************************************************/
+ /** This structure holds the video object plane (VOP) information. */
+ typedef struct _GFMXDECVOP
+ {
+ NvU32 uiVOPinfo; /**< Set new VOP information */
+ NvU32 uiFFORWARD; /**< FCODE_FORWARD, ignore this value if it is I frame */
+ PGFRMSURFACE pRef; /**< Reference VOP, ignore this item, if current VOP is an I */
+ PGFRMSURFACE pCur; /**< Current VOP */
+ PGFRECT pRefRect; /**< Specifies a rectangular area within the pRef surface for the
+ GFMxDecAPI to use with the reference image. This field only takes
+ effect when MXDEC_VOP_SPECIFY_REFSURF_RECT is set. The rectangles
+ top and left should be aligned by the application, which should call
+ GFMxDecGetAttribute() with MXDEC_ATTR_MP4_DEC_VOP_RECT_TOP_ALIGNMENT
+ and MXDEC_ATTR_MP4_DEC_VOP_RECT_LEFT_ALIGNMENT to get the required
+ alignment. The rectangle's width and height should exactly match the
+ image width and height that is encoded in the bit stream. */
+
+ PGFRECT pCurRect; /**< Specifies a rectangular area of the pCur surface within which the
+ GFMxDecAPI should place the decoded image output. This field only takes
+ effect if MXDEC_VOP_SPECIFY_CURSURF_RECT is set. The rectangles top and
+ left should be aligned by the application, which should call GFMxDecGetAttribute()
+ with MXDEC_ATTR_MP4_DEC_VOP_RECT_TOP_ALIGNMENT and
+ MXDEC_ATTR_MP4_DEC_VOP_RECT_LEFT_ALIGNMENT to get the required alignment.
+ The rectangle's width and height should exactly match the image width and
+ height that is encoded in the bit stream. */
+ }GFMXDECVOP, *PGFMXDECVOP;
+
+ /****************************************************************************************************/
+ //uiVOPinfo values
+ /** GFMXDECVOP::uiVOPinfo : If set, this is P VOP. If unset, it is I VOP.
+ @see GFMXDECVOP, GFMXDECTABLE::MxDecSetVOP */
+#define MXDEC_VOP_P_VOP 0x1
+
+ /** GFMXDECVOP::uiVOPinfo : This parameter comes as a part of the bitstream.
+ This indicates that rounding should be performed while doing Motion Compensation.
+ @see GFMXDECVOP, GFMXDECTABLE::MxDecSetVOP */
+#define MXDEC_VOP_ROUNDING_ONE 0x2
+
+ /** GFMXDECVOP::uiVOPinfo : If set, this bitstream is short video header format.
+ @see GFMXDECVOP, GFMXDECTABLE::MxDecSetVOP */
+#define MXDEC_VOP_SHORT_HEADER 0x4
+
+ /** GFMXDECVOP::uiVOPinfo : If set, If this flag is set, pRefSurfRect must be set.
+ GFMxDec will reference image in pRefSurfRect area of pRef surface. Otherwise, GFMxDec will reference the whole pRef surface area.
+ @see GFMXDECVOP, GFMXDECTABLE::MxDecSetVOP */
+#define MXDEC_VOP_SPECIFY_REFSURF_RECT 0x8
+
+ /** GFMXDECVOP::uiVOPinfo : If this flag is set, pCurSurfRect must be set. GFMxDec will output decoded image to
+ pCurSurfRect area of pCur surface. Otherwise, GFMxDec will output to pCur surface starting from top left corner , the width and
+ height are equal to pCur surface width and height.
+ @see GFMXDECVOP, GFMXDECTABLE::MxDecSetVOP */
+#define MXDEC_VOP_SPECIFY_CURSURF_RECT 0x10
+
+ /****************************************************************************************************/
+ /** This structure holds the postprocessing information. */
+ typedef struct _GFMXDECPP
+ {
+ PGFRMSURFACE* pDestSurf; /**< Pointer to an array of surfaces that will hold the result from Post Processing
+ pointer to an array of surfaces to accommodate auto post processing. */
+ PGFRMSURFACE* pSrcSurf; /**< Pointer to an array of surfaces to be post processed pointer to an array of surfaces
+ to accommodate auto post processing. */
+ PGFRECT pRect; /**< Rectangular area to be processed for both source and destination surfaces.
+ @see GFRECT */
+ NvU32 numofDestSurf; /**< Number of Destination Surfaces. If MXDEC_PP_AUTO flag is set, this parameter must be filled. */
+ NvU32 numofSrcSurf; /**< Number of Source Surfaces. If MXDEC_PP_AUTO flag is set, this parameter must be filled. */
+ NvU8 * lpQuantiser; /**< Pointer to array of quantization steps (QPs) for macroblocks in
+ the source VOP. The GFMxDecAPI automatically saved the last
+ two decoded VOPs QP tables. The application may not need to
+ reload the table if it can make sure the source VOP is one of the
+ last decoded VOPs. This field must be filled if
+ MXDEC_PP_RELOAD_QUANTIZER is set. */
+ NvU32 PPOption; /**< Post-processing option. */
+ /**<
+ #MXDEC_PP_DB_ON
+ Turn on DeBlocking filter for this frame
+ #MXDEC_PP_DR_ON
+ Turn on DeRinging filter for this frame
+ #MXDEC_PP_AUTO
+ Auto trigger Post Processing by Hardware
+ #MXDEC_PP_RELOAD_QUANTIZER
+ Reload the source VOP's qunantizers
+ #MXDEC_PP_OP_ASYNC
+ Enables ASYNC mode
+
+ */
+ } GFMXDECPP, *PGFMXDECPP;
+
+ /****************************************************************************************************/
+ // PPOption
+ /** GFMXDECPP::PPOption : Turn on DeBlocking filter for this frame.
+ @see GFMXDECPP, GFMXDECTABLE::MxDecPostProcessing */
+#define MXDEC_PP_DB_ON 0x1
+
+ /** GFMXDECPP::PPOption : Turn on DeRinging filter for this frame.
+ @see GFMXDECPP, GFMXDECTABLE::MxDecPostProcessing */
+#define MXDEC_PP_DR_ON 0x2
+
+ /** GFMXDECPP::PPOption : Auto trigger Post Processing by Hardware.
+ @see GFMXDECPP, GFMXDECTABLE::MxDecPostProcessing */
+#define MXDEC_PP_AUTO 0x4
+
+ /** GFMXDECPP::PPOption : Reload the source VOP's qunantizers.
+ @see GFMXDECPP, GFMXDECTABLE::MxDecPostProcessing */
+#define MXDEC_PP_RELOAD_QUANTIZER 0x8
+
+ /** GFMXDECPP::PPOption : enables ASYN mode. GFMxDecPostProcessing()
+ will return after pushing the commands but without waiting for them to
+ complete. This option is useful to achieve some paralellism because
+ post-processed frame is usually not used right away for rendering. So
+ there is enough time for hardware to complete the decoding before this
+ frame will be used by app. It is ok to call PostProcessing even when
+ decoding of this frame is not complete. Inside GPU, hardware synchronizes
+ with the decoder.
+ @see GFMXDECPP, GFMXDECTABLE::MxDecPostProcessing */
+#define MXDEC_PP_OP_ASYNC 0x00000010
+
+ /****************************************************************************************************/
+ //pStatus
+ /** Argument pStatus in GFMxDecGetStatus() : GFMxDecGetStatus() can be called by the application to indicate whether 1 frame
+ has been decoded or not.
+ @see GFMXDECTABLE::MxDecGetStatus */
+#define GF_DECODER_FRAME_DONE 0x00000010
+
+ /** Argument pStatus in GFMxDecGetStatus() : GFMxDecGetStatus() can be called by the application to indicate whether post-processing
+ engine is done with the frame or not.
+ @see GFMXDECTABLE::MxDecGetStatus */
+#define GF_DECODER_PP_FRAME_DONE 0x00000020
+
+ /****************************************************************************************************/
+ /** GFMxDecSet::uiFeature : Application sets this attribute to register a callback function and
+ its correpnding parameter to read bitstream data */
+#define MXDEC_SET_READBITSTREAM 1
+
+ /** GFMxDecSet::uiFeature Application needs to set this flag in order to send MPEG4 bitstream data in Prefill Mode;
+ When this is set:
+ - application does not need to register any bitstream-read callback function as data will be fed upfront.
+ - application needs to set an attribute MXDEC_ATTR_PRE_DETERMINED_BOUNDARY to indicate that data will be fed on frame boundary.
+ @see GFMXDECTABLE::MxDecSet */
+#define GFMXDEC_OPTION_PREFILLBUFFER 0x00000002
+
+ /****************************************************************************************************/
+ /** Structure holding the callback function pointer.
+ Used in registering the callback function
+ The callback function is a function which the API calls to request a portion of the bit stream from the application.
+ @see GFMXDECTABLE::MxDecSet
+ */
+ typedef struct _GFMXDECCALLBACK
+ {
+ void *pPara; /**< pPara is a parameter passed from application and the application
+ wants the API to callback with this parameter. */
+ NvU32 (*pCallBack)(void * pPara, NvU8 ** ppBuffer, NvS32 * BufferLength, NvU32 uFlag);
+ /**<
+ Application callback function pointer.
+ Register a callback function for fetching MPEG stream data.
+
+ If application set MXDEC_ATTR_PRE_DETERMINED_BOUNDARY, application should
+ return MXDEC_BOUNDARY_REACHED when the boundary is detected.
+ If APP does not set MXDEC_ATTR_PRE_DETERMINED_BOUNDARY, 0 should be returned.
+
+ @param *pPara Parameter to pass on to application callback function
+ @param ppBuffer Buffer Pointer
+ @param BufferLength Parameter to pass on to application callback function
+ @param uFlag Flag for reading bitstream backward/forward.
+
+ #MXDEC_READ_BITSTREAM_FORWARD
+ Read bitstream in forward direction
+ #MXDEC_READ_BITSTREAM_BACKWARD
+ Read bitstream in backward direction
+
+
+ @retval The number of bytes read successfully, 0 if no bytes read.
+ */
+ }GFMXDECCALLBACK, *PGFMXDECCALLBACK;
+
+ /****************************************************************************************************/
+ /** Returned by application when MXDEC_ATTR_PRE_DETERMINED_BOUNDARY is set and boundary is detected. */
+#define MXDEC_BOUNDARY_REACHED 0x00000001
+
+ // for backward/forward reading bitstream flags
+ /** Read bitstream in forward direction.
+ @see GFMXDECCALLBACK
+ */
+#define MXDEC_READ_BITSTREAM_FORWARD 0x00000002
+
+ /** Read bitstream in backward direction.
+ @see GFMXDECCALLBACK
+ */
+#define MXDEC_READ_BITSTREAM_BACKWARD 0x00000003
+
+ /****************************************************************************************************/
+ //uiVOLinfo
+ /** GFMXDECMP4SETVOL::uiVOLinfo : If set indicates that VOL is in short header format.
+ @see GFMXDECMP4SETVOL*/
+#define MXDEC_MP4_SET_SHORT_HEADER 0x00000001
+
+ /****************************************************************************************************/
+ /** This structure hold information of the PreFill buffer.
+ */
+ typedef struct _GFMXDECPREFILLBUFFER
+ {
+ NvU8* pPreFillBuffer; /**< Input, Prefill buffer pointer filled by application. */
+ NvU32 PreFillBufferLength; /**< Input, Length of pref-fill buffer. */
+ NvU32 PreFillBufferBytesConsumed; /**< Output, Amount of bytes consumed by the component. */
+ NvU32 prefill_enabled; /**< Flag to identify if prefill buffer is supplied by application. */
+ } GFMXDECPREFILLBUFFER;
+
+ /****************************************************************************************************/
+ /** This structure hold the information needed for decoding a Video Object Layer (VOL).
+ @see GFMXDECTABLE::MxDecMP4DecVOL */
+ typedef struct _GFMXDECMP4DECVOL
+ {
+ NvU32 uiVOLinfo; /**< Indicates format of the VOL. Set by API. */
+ /**<
+ #MXDEC_MP4_SHORT_HEADER
+ Short header format detected
+ #MXDEC_MP4_DATA_PARTITION
+ Data Partitioning mode detected
+ #MXDEC_MP4_PROFILE_LEVEL
+ Profile and level field is valid
+ #MXDEC_MP4_PRIORITY
+ Priority field is valid
+ #MXDEC_MP4_VSOTYPE
+ Visual object type field is valid
+ #MXDEC_MP4_VIDEO_SIGNAL
+ VideoFormat and VideoRange fields are valid
+ #MXDEC_MP4_COLOR_DESCRIPTION
+ Color, Transfer and Matrix fields are valid
+ #MXDEC_MP4_VOID
+ VObjectID field is valid
+ #MXDEC_MP4_VOLID
+ VOLID field is valid
+
+ */
+ NvU32 uiWidth; /**< Display width, set by API */
+ NvU32 uiHeight; /**< Display height, set by API */
+ unsigned int Profile; /**< Mpeg4 Profile. Set by API.*/
+ /**<
+ #MXDEC_MP4_SIMPLE_PROFILE Profile is simple profile
+ #MXDEC_MP4_ADVANCE_SIMPLE_PROFILE Profile is advance simple profile
+
+ */
+ unsigned int Level; /**< Mpeg4 Level. Set by API. */
+ unsigned int VObjectID; /**< Video Object ID. Set by API. */
+ unsigned int VOLID; /**< Video Object Layer ID. Set by API. */
+ unsigned int Priority; /**< Priority(of what (???)). Set by API. */
+ unsigned int VSOType; /**< VSO(full form(???)) Type. Set by API. */
+ unsigned int VideoFormat; /**< Video Format (what are the possible values (???)). Set by API. */
+ unsigned int VideoRange; /**< Video Range. Set by API. */
+ unsigned int Color; /**< Color primaries. */
+ unsigned int Transfer; /**< Transfer charateristics. */
+ unsigned int Matrix; /**< Matrix coefficients(???). */
+ GFMXDECPREFILLBUFFER prefill;
+ }GFMXDECMP4DECVOL, *PGFMXDECMP4DECVOL;
+
+ /****************************************************************************************************/
+ //uiVOLinfo
+ /** GFMXDECMP4DECVOL::uiVOLinfo : Short header format detected.
+ @see GFMXDECMP4DECVOL, GFMXDECTABLE::MxDecMP4DecVOL */
+#define MXDEC_MP4_SHORT_HEADER 0x00000001
+
+ /** GFMXDECMP4DECVOL::uiVOLinfo : Data Partitioning mode detected.
+ @see GFMXDECMP4DECVOL, GFMXDECTABLE::MxDecMP4DecVOL */
+#define MXDEC_MP4_DATA_PARTITION 0x00000002
+
+ /** GFMXDECMP4DECVOL::uiVOLinfo : Profile and level field is valid.
+ @see GFMXDECMP4DECVOL, GFMXDECTABLE::MxDecMP4DecVOL */
+#define MXDEC_MP4_PROFILE_LEVEL 0x00000004
+
+ /** GFMXDECMP4DECVOL::uiVOLinfo : Priority field is valid.
+ @see GFMXDECMP4DECVOL, GFMXDECTABLE::MxDecMP4DecVOL */
+#define MXDEC_MP4_PRIORITY 0x00000008
+
+ /** GFMXDECMP4DECVOL::uiVOLinfo : Visual object type field is valid.
+ @see GFMXDECMP4DECVOL, GFMXDECTABLE::MxDecMP4DecVOL */
+#define MXDEC_MP4_VSOTYPE 0x00000010
+
+ /** GFMXDECMP4DECVOL::uiVOLinfo : VideoFormat and VideoRange fields are valid.
+ @see GFMXDECMP4DECVOL, GFMXDECTABLE::MxDecMP4DecVOL */
+#define MXDEC_MP4_VIDEO_SIGNAL 0x00000020
+
+ /** GFMXDECMP4DECVOL::uiVOLinfo : Color, Transfer and Matrix fields are valid.
+ @see GFMXDECMP4DECVOL, GFMXDECTABLE::MxDecMP4DecVOL */
+#define MXDEC_MP4_COLOR_DESCRIPTION 0x00000040
+
+ /** GFMXDECMP4DECVOL::uiVOLinfo : VObjectID field is valid.
+ @see GFMXDECMP4DECVOL, GFMXDECTABLE::MxDecMP4DecVOL */
+#define MXDEC_MP4_VOID 0x00000080
+
+ /** GFMXDECMP4DECVOL::uiVOLinfo : VOLID field is valid.
+ @see GFMXDECMP4DECVOL, GFMXDECTABLE::MxDecMP4DecVOL */
+#define MXDEC_MP4_VOLID 0x00000100
+
+ /****************************************************************************************************/
+ //Profile
+ /** GFMXDECMP4DECVOL::Profile : Profile is simple profile.
+ @see GFMXDECMP4DECVOL, GFMXDECTABLE::MxDecMP4DecVOL */
+#define MXDEC_MP4_SIMPLE_PROFILE 0x00000000
+
+ /** GFMXDECMP4DECVOL::Profile : Profile is advance simple profile.
+ @see GFMXDECMP4DECVOL, GFMXDECTABLE::MxDecMP4DecVOL */
+#define MXDEC_MP4_ADVANCE_SIMPLE_PROFILE 0x00000009
+
+ /****************************************************************************************************/
+ //resync options
+ /** Argument ResyncOption for GFMXDECTABLE::MxDecMP4DecResync : Resync to next nearest VOL.
+ @see GFMXDECTABLE::MxDecMP4DecResync */
+#define MXDEC_MP4_RESYNC_FORWARD_NEAREST_VOL 0x1
+
+ /** Argument ResyncOption for GFMXDECTABLE::MxDecMP4DecResync : Resync to next nearest VOP.
+ @see GFMXDECTABLE::MxDecMP4DecResync */
+#define MXDEC_MP4_RESYNC_FORWARD_NEAREST_VOP 0x2
+
+ /** Argument ResyncOption for GFMXDECTABLE::MxDecMP4DecResync : Resync to next nearest I-VOP.
+ @see GFMXDECTABLE::MxDecMP4DecResync */
+#define MXDEC_MP4_RESYNC_FORWARD_NEAREST_I_VOP 0x4
+
+ /** Argument ResyncOption for GFMXDECTABLE::MxDecMP4DecResync : Resync to next VOL.
+ @see GFMXDECTABLE::MxDecMP4DecResync */
+#define MXDEC_MP4_RESYNC_FORWARD_NEXT_VOL 0x8
+
+ /** Argument ResyncOption for GFMXDECTABLE::MxDecMP4DecResync : Resync to next VOL.
+ @see GFMXDECTABLE::MxDecMP4DecResync */
+#define MXDEC_MP4_RESYNC_FORWARD_NEXT_VOP 0x10
+
+ /** Argument ResyncOption for GFMXDECTABLE::MxDecMP4DecResync : Resync to next I-VOP.
+ @see GFMXDECTABLE::MxDecMP4DecResync */
+#define MXDEC_MP4_RESYNC_FORWARD_NEXT_I_VOP 0x20
+
+ /** Argument ResyncOption for GFMXDECTABLE::MxDecMP4DecResync : Resync to previous nearest VOL.
+ @see GFMXDECTABLE::MxDecMP4DecResync */
+#define MXDEC_MP4_RESYNC_BACKWARD_NEAREST_VOL 0x40
+
+ /** Argument ResyncOption for GFMXDECTABLE::MxDecMP4DecResync : Resync to previous nearest VOP.
+ @see GFMXDECTABLE::MxDecMP4DecResync */
+#define MXDEC_MP4_RESYNC_BACKWARD_NEAREST_VOP 0x80
+
+ /** Argument ResyncOption for GFMXDECTABLE::MxDecMP4DecResync : Resync to previous nearest I-VOP.
+ @see GFMXDECTABLE::MxDecMP4DecResync */
+#define MXDEC_MP4_RESYNC_BACKWARD_NEAREST_I_VOP 0x100
+
+ /** Argument ResyncOption for GFMXDECTABLE::MxDecMP4DecResync : Resync to previous VOL.
+ @see GFMXDECTABLE::MxDecMP4DecResync */
+#define MXDEC_MP4_RESYNC_BACKWARD_PREVIOUS_VOL 0x200
+
+ /** Argument ResyncOption for GFMXDECTABLE::MxDecMP4DecResync : Resync to previous VOP.
+ @see GFMXDECTABLE::MxDecMP4DecResync */
+#define MXDEC_MP4_RESYNC_BACKWARD_PREVIOUS_VOP 0x400
+
+ /** Argument ResyncOption for GFMXDECTABLE::MxDecMP4DecResync : Resync to previous I-VOP.
+ @see GFMXDECTABLE::MxDecMP4DecResync */
+#define MXDEC_MP4_RESYNC_BACKWARD_PREVIOUS_I_VOP 0x800
+
+ /****************************************************************************************************/
+ /** This structure hold the information needed for decoding a Video Object Plane (VOP).
+ @see GFMXDECTABLE::MxDecMP4DecVOP */
+ typedef struct _GFMXDECMP4DECVOP
+ {
+ PGFRMSURFACE pRef; /**< Reference VOP, ignore this item, if current VOP is an I. Set by application. */
+ PGFRMSURFACE pCur; /**< Current VOP. Set by application. */
+ PGFRECT pRefRect; /**< Reference rectangle. Set by application.
+ pRefRect specifies a rectangle area for GFMxDec to reference the reference image.
+ This rectangle area should be within the pRef surface. The rectangle top, left should
+ be aligned by application. Application should call GFMxDecGetAttribute() with
+ MXDEC_ATTR_MP4_DEC_VOP_RECT_TOP_ALIGNMENT and MXDEC_ATTR_MP4_DEC_VOP_RECT_LEFT_ALIGNMENT
+ attributions to get the required alignment. This rectangle's width and height should
+ exactly match with the image width and height which has been coded in bit stream. If
+ pRefRect is NULL, GFMxDec will use pRef surface width and height as reference image dimension.
+ */
+ PGFRECT pCurRect; /**< Current rectangle. Set by application.
+ pCurRect specifies a rectangle area for GFMxDec to output the decoded image.
+ This field only take effect when MXDEC_MP4_DEC_VOP_SPECIFY_REFSURF_RECT flag is set.
+ This rectangle area should be within the pCur surface. The rectangle top, left should be
+ aligned by application. Application should call GFMxDecGetAttribute() with
+ MXDEC_ATTR_MP4_DEC_VOP_RECT_TOP_ALIGNMENT and MXDEC_ATTR_MP4_DEC_VOP_RECT_LEFT_ALIGNMENT
+ attributions to get the required alignment. This rectangle's width and height should exactly
+ match with the image width and height which has been coded in bit stream. If pCurRect is NULL,
+ GFMxDec will use pCur surface dimension as decoded image dimension.
+ */
+ NvU32 uiVOPinfo; /**< Get current VOP information. Set by API.
+ #MXDEC_MP4_VOP_P VOP is coded as P-VOP
+ #MXDEC_MP4_NOT_CODED VOP is not coded
+ (???)What about I-VOP? (???)
+ */
+ NvU32 uiTimeStamp; /**< Time to display this VOP, in milliseconds. Set by API. */
+ NvU8 *pMBInfo; /**< Pointer to array where information of whether the MB is decoded or not is stored.
+ Each element will tell if this corresponding MB is wrong. Set by API. */
+ NvU32 uiVOPOption; /**< Must be used to set ASYNC option */
+
+ GFMXDECPREFILLBUFFER prefill;
+ }GFMXDECMP4DECVOP, *PGFMXDECMP4DECVOP;
+
+ /** GFMXDECMP4DECVOP::uiVOPOption: enables ASYNC mode. GFMxDecMP4DecVOP()
+ will return after pushing the commands but without waiting for them to
+ complete. This option is useful to achieve some paralellism because
+ decoded frame is usually not used right away for rendering. So
+ there is enough time for hardware to complete the decoding before this
+ frame will be used by app. It is ok to call PostProcessing even when
+ decoding of this frame is not complete. Inside GPU, hardware synchronizes
+ with the decoder. */
+#define MXDEC_MP4DECVOP_OP_ASYNC 0x00000001
+
+
+ /****************************************************************************************************/
+ //uiVOPinfo
+ /** GFMXDECMP4DECVOP::uiVOPinfo : VOP is coded as P-VOP.
+ @see GFMXDECMP4DECVOP */
+#define MXDEC_MP4_VOP_P 0x00000001
+
+ /** GFMXDECMP4DECVOP::uiVOPinfo : VOP is not coded.
+ @see GFMXDECMP4DECVOP */
+#define MXDEC_MP4_NOT_CODED 0x00000002 //Not coded VOP
+
+ /****************************************************************************************************/
+ //when GF_ERROR is return check the following flag
+ /** This flag is set when atleast one MB is wrong. If application has setup pMBinfo, it can check which MB is wrong. */
+#define MXDEC_MP4_BAD_MB 0x00010000
+
+ /****************************************************************************************************/
+
+#define MXDEC_ATTR_PRE_DETERMINED_BOUNDARY 0x00000001
+ /**< MxDecAPI Attribute : Application will determine the decoding boundary, for MPEG4, this boundary means VOL
+ and VOP boundary. For certain file formats, those boundary information are stored in the video file, application
+ can easily use those information to determine the boundary. If APP wants API to detect the boundary, application
+ should not disable this attribute. This is mainly for streaming case, where application does not have those handy
+ boundary information. API will automatically detect those boundaries. Application does not need to parse the
+ bitstream to detect those boundaries.\n
+ Value to be passed to GFMxDecSetAttribute for setting this attribute:
+ *pInfo == 1 Application will determine the decoding boudary
+ *pInfo == 0 Application will not determine the decoding boudary
+ @see GFMXDECTABLE::MxDecSetAttribute
+ */
+
+#define MXDEC_ATTR_MP4_DEC_VOP_RECT_TOP_ALIGNMENT 0x00000002
+ /**< MxDecAPI Attribute : This attribute only can be used for GFMxDecGetAttribute. If application wants to set pDestRect
+ in GFMXDECVOP or GFMXDECMP4DECVOP, application must use this attribute to get alignment information and align the rectangle
+ top & left corner accordingly. Value returned by GFMxDecGetAttribute:\n
+ *pInfo: Top field alignment in term of lines
+ @see GFMXDECTABLE::MxDecGetAttribute
+ */
+
+#define MXDEC_ATTR_MP4_DEC_VOP_RECT_LEFT_ALIGNMENT 0x00000003
+ /**< MxDecAPI Attribute : This attribute only can be used for GFMxDecGetAttribute. If application wants to set pDestRect
+ in GFMXDECVOP or GFMXDECMP4DECVOP, application must use those attributes to get alignment information and align the rectangle
+ top & left corner accordinately. Value returned by GFMxDecGetAttrubute:\n
+ *pInfo: left field alignment in term of pixels
+ @see GFMXDECTABLE::MxDecGetAttribute
+ */
+
+#define GF_MXDEC_ATTR_DEC_ENABLE_RAISE_WAIT 0x00000004
+ /**< MxDecAPI Attribute : This attribute only can be used for GFMxDecSetAttribute.
+ Value passed to GFMxDecSetAttribute:\n
+
+ *pInfo == 1
+ Raisevectors are allocated per Surface.\n
+ There will be 2 (3 if PostProcessing is ON) sets of raise-wait happening\n
+ 1) Decoder raises On_Frame_Decoded, and VxBlt waits.\n
+ 2) (If enabled in APP) PostProcessing API raises On_PP_Frame_Done, and VxBlt waits.\n
+ 3) VxBlt raises On_Bltted, and Decoder waits.
+ *pInfo == 0 (Default)
+ We do not allocate surface raise vectors but a single raise vector.\n
+ 1) In Decoder, we poll Frame_done, and return only after its done.\n
+ 2) In PostProcessing we poll PP_Frame_done, and return only after its done.\n
+ 3) It is observed that Frame_done & PP_Frame_done bits are affected only if raise is done on those.\n
+ Thats why single raise vector is still needed. This raise vector is not in any suface but in MxDecHandle.
+
+ @see GFMXDECTABLE::MxDecSetAttribute
+ */
+
+#define MXDEC_ATTR_DISABLE_EC 0x00000005
+ /**< MxDecAPI Attribute : Application can disable Error Concealment (EC) by setting this attribute. By default, EC is enabled.
+ Decoder has The Error Robustness (ER) and Concealment (EC) for mpeg4 decoding.
+
+ Error Robustness (Always ON) :
+ The ER means the code will detect any error in the bitstream at proper places and will still proceed ahead for decoding the
+ remaining stream, for posible non-errored data.
+
+ Error Concealment (Default ON): Can be disabled by this very attribute MXDEC_ATTR_DISABLE_EC.
+ EC means, the decoder will try to use previously decoded information to simulate the lost data. The below steps of EC:
+
+ Lost Motion Vector recovery and concealment:
+ 1. Rational interpolation: Predict the lost MV from the current frame
+ 2. Use MV from prev frame
+ 3. Use MV from step 3 and 4, to reconstruct 2 sets of the texture data for lost MB.
+
+ @see GFMXDECTABLE::MxDecSetAttribute */
+
+#define MXDEC_ATTR_MP4_DEC_GET_MBERR_MAP_MATRIX 0x00000006
+ /**< MxDecAPI Attribute : This attribute only can be used for GFMxDecGetAttribute. If application wants to get MB error map for
+ till recently decoded frame. Input parameter is a character array pMBErrMapMatrix of size "number of MBs in a frame". On returning
+ this call fills this char array with 1s & 0s. 1: MB correctly decoded & 0: MB corrupted. This is cumulative err map till this call
+ is made. In this API call after copying the err map to the char array, internal map is resit to all clean MBs. \n
+ Interpretation of block referenced by \a pInfo parameter:
+
+ NvU8 * pMBErrMapMatrix
+
+ @see GFMXDECTABLE::MxDecGetAttribute
+ */
+
+ /****************************************************************************************************/
+
+ /** Typesafe function for opening this component.
+
+ @param hRm (GFRmHandle) Handle specific to Resource Manager API
+ @param phMxDec (GFMxDecHandle *) Pointer to handle specific to MxDecAPI
+ @param state (GF_STATE_TYPE) The state is used to decide if a new ChHandle is to be allocated for MxDec component or not.
+ The values that state can take are:
+ #GF_STATE_DEFAULT
+ #GF_STATE_NEW_OR_SHARE
+ #GF_STATE_NEW_ONLY
+ #GF_STATE_SHARE_ONLY
+
+ @param hCh (GFRmChHandle) Resource Manager Channel Handle
+
+ @retval GF_SUCCESS : If successful
+ @retval GF_ERROR : If error occured
+ */
+ /**< Typesafe functions for opening and closing this component.
+ This API also checks for hardware resources needed through GFRmHwResourceConstraint().
+ Trying to open a second video instance will fail due to existing open context.
+ */
+
+GF_RETTYPE GFMxDecOpen(GFRmHandle hRm, GFMxDecHandle *phMxDec,
+ GF_STATE_TYPE state, GFRmChHandle hCh);
+
+ /** Typesafe function for opening this component.
+
+ @param phMxDec (GFMxDecHandle *) Pointer to handle specific to MxDecAPI
+
+ Close the video instance.
+ */
+void GFMxDecClose(GFMxDecHandle *phMxDec);
+
+GF_RETTYPE GFMxDecGetProperty (GFMxDecHandle MxHandle, PGFPROPERTY pMXProp);
+GF_RETTYPE GFMxDecPostProcessing (GFMxDecHandle pdec, PGFMXDECPP pP);
+GF_RETTYPE GFMxDecSetAttribute (GFMxDecHandle pdec, NvU32 uiFeature, NvU32 *pInfo);
+GF_RETTYPE GFMxDecGetAttribute (GFMxDecHandle pdec, NvU32 uiFeature, NvU32 *pInfo);
+GF_RETTYPE GFMxDecSet (GFMxDecHandle pdec, NvU32 uiFeature, void *pInfo);
+GF_RETTYPE GFMxDecMP4DecVOL (GFMxDecHandle pdec, PGFMXDECMP4DECVOL pVOL);
+GF_RETTYPE GFMxDecMP4DecVOP (GFMxDecHandle pdec, PGFMXDECMP4DECVOP pVOP);
+GF_RETTYPE GFMxDecMP4DecResync (GFMxDecHandle pdec, NvU32 ResyncOption);
+
+ //return value
+#define GFMXDEC_ERROR_NOT_SUPPORT_FORMAT (GFMXD_ERROR | 0x00000001)
+ /**< This error is returned when the input file format is not supported by the decoder. */
+#define GFMXDEC_ERROR_HEADER_DAMAGED (GFMXD_ERROR | 0x00000002)
+ /**< This error is returned when the header of the mpeg4 stream is damaged. */
+#define GFMXDEC_ERROR_NO_VOL_HEADER (GFMXD_ERROR | 0x00000003)
+ /**< This error is returned when no Video Object Layer (VOL) header is detected. */
+#define GFMXDEC_ERROR_NOT_ENOUGH_SYSTEM_MEM (GFMXD_ERROR | 0x00000004)
+ /**< This error is returned when system is out of memory. */
+
+ //return value
+#define GFMXDEC_ERROR_DETECTED_VOL (GFMXD_ERROR | 0x00000005)
+ /**< This error is returned when VOL was detected while decoding VOP. */
+#define GFMXDEC_ERROR_END_OF_FILE (GFMXD_ERROR | 0x00000006)
+ /**< This error is returned when end of file is reached. */
+#define GFMXDEC_ERROR_CORRUPTED_VOP (GFMXD_ERROR | 0x00000007)
+ /**< This error is returned when the VOP is corrupted and cannot be recovered. */
+
+ //return value
+#define GFMXDEC_ERROR_RESYNC_END_OF_FILE (GFMXD_ERROR | 0x00000008)
+ /**< This error is returned when end of file is reached while looking for resync marker. */
+#define GFMXDEC_ERROR_RESYNC_DETECTED_VOL (GFMXD_ERROR | 0x00000009)
+ /**< This error is returned when a VOL start is detected while searching for VOP resync marker. */
+#define GFMXDECMP4_DSP_TIMEOUT (GFMXD_ERROR | 0x00000010)
+ /**< This error is returned when DSP does not return anything for a predetermined timeout period. This error indicates possibility of DSP hang. */
+#define GFMXDEC_ERROR_START_CODE (GFMXD_ERROR | 0x00000011)
+ /**< This error is returned when no start code is found in a chunk of data. */
+
+ /*@}*/
+
+ /** @page pageMxDecAppNotes MxDecAPI Application Notes
+ @section pageMxDecAppNotes1 Programming Sequence
+
+ The following procedure requires that GFRmOpen() is called first to start
+ GFSDK usage.
+
+
+ 1. Initialize the display panel by using GFRmIxInit().\n
+
+ 2. Open the display component by calling GFDxOpen() to get the GFMxDecAPI Dxhandle.\n
+
+ 3. Initialize the display start address, stride and bits per pixel using GFDxSetDisplay().\n
+
+ 4. Get the various attributes of the display panel (width, height, etc) using GFDxGetAttribute().\n
+
+ 5. For clearing the screen, open the graphics component using GFGxOpen() and use GFGxFillRect() for filling the screen with
+ some color (say, black).\n
+
+ 6. Open the FDev component for performing file I/O using GFFDevOpen() and mount it using GFFDevMount().\n
+
+ 7. Open the Vx component using GFVxOpen() and get the GFVxAPI VxHandle. \n
+
+ 8. Query the properties with GFVxGetProperty() to see whether this GFVxAPI version supports MPEG decoding.\n
+
+ 9. If it supports MPEG decoding, call GFMxDecOpen() to get the GFMxDecAPI MxHandle.\n
+
+ 10. Call GFMxDecGetProperty() to query properties. Check whether this GFMxDAPI version can support the desired
+ MPEG profile and level.\n
+
+ 11. If the properties check out, call GFRmSurfaceAlloc() to allocate at least one reference surface and one
+ current surface for decoding purposes.\n
+
+ 12. If the postprocessing engine is needed, allocate one surface to hold the postprocessing results.\n
+
+ 13. For display purposes, the decoder application could call GFVxBlt() for the following two scenarios. \n
+ (a) Performing color space conversion and then a stretch blit to the primary surface directly. \n
+ (b) Blitting to the overlay surface.\n
+ Please refer to the latest GFVxAPI document for additional information. \n
+
+ 14. The decoder application should decode VOP-by-VOP. Call GFMxDecSetVOP() to set up the VOPs characteristics.\n
+
+ 15. After the decoder application has decoded enough macroblocks, call GFMxDecSetMBs() to trigger the hardware
+ to decode those macroblocks until all macroblocks in the current VOP are finished. GFMxDecSetMBs() may initiate
+ the postprocessing engine or video engine automatically.\n
+
+ 16. Before exiting the application, the decoder application should call GFRmSurfaceFree() to free the surfaces
+ that have been allocated. \n
+
+ 17. Call GFMxClose() with the MxHandle to release the resources of the decoder module.\n
+
+ 18. Similarly, call the close functions of the other components which have been opened.\n
+
+ */
+
+#ifdef __cplusplus
+} // only need to export C interface if
+// used by C++ source code
+#endif
+
+#endif
+
diff --git a/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFMxDecH264.h b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFMxDecH264.h
new file mode 100755
index 00000000..351ca7ca
--- /dev/null
+++ b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFMxDecH264.h
@@ -0,0 +1,1536 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+*
+* NVIDIA Corporation and its licensors retain all intellectual property
+* and proprietary rights in and to this software, related documentation
+* and any modifications thereto. Any use, reproduction, disclosure or
+* distribution of this software and related documentation without an
+* express license agreement from NVIDIA Corporation is strictly prohibited.
+*/
+
+/** @file GFMxDecH264.h
+GFSDK H264 Decode API header file.
+*/
+
+#ifndef _GF_MPEG_DEC_H264__
+#define _GF_MPEG_DEC_H264__
+
+#include "nvtypes.h"
+#include "GFVx.h"
+#include "GFDef.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+ /** @addtogroup groupMxDecH264 MxDecH264API H264 Decode API
+
+ The H.264/AVC decoder API handles H.264/AVC baseline-compliant bit
+ streams for this version, but has been defined to handle all of the three
+ profiles for future expansion.
+
+ The H.264/AVC decoder API has two sets of APIa high level API and a low
+ level API.
+
+ Using the High Level API
+
+ The high level API has a built-in entropy decoder. It decodes the bit stream
+ and performs error concealment if the bit stream has an error. This high level
+ API calls the low level API internally. When using the high level API, the
+ application can ignore the low level API.
+
+ The MxDecH264API high level functions include the following:
+ - GFMxDecH264DecSequence()
+ - GFMxDecH264DecPicture()
+ - GFMxDecH264Set()
+ - GFMxDecH264DecSEI()
+ - GFMxDecH264DecNewFrameNum()
+
+ Using the Low Level API
+
+ The low level API is essentially a macroblock decoder engine. It decodes
+ macroblock by macroblock. When using the low level API, the application
+ needs to handle the entropy decoding and error concealment. The low level
+ API assumes that the information passed from caller is correct, and does not
+ have any error concealment functionality build in. The application which
+ called the low level API must make sure that no macroblocks are missing for
+ any picture.
+
+ The MxDecH264API low level functions include the following:
+ - GFMxDecH264SetSequence()
+ - GFMxDecH264SetPicture()
+ - GFMxDecH264SetSlice()
+ - GFMxDecH264SetMBs()
+
+ Application Notes
+
+
+ @ref pageMxDecH264AppNotes
+
+ @ref pageMxDecH264AppNotes1
+ @ref pageMxDecH264AppNotes2
+
+
+ */
+ /*@{*/
+
+ /** MxDecH264API property flag: Baseline profile supported.
+ @see GFMxDecH264GetProperty(), GFPROPERTY::Capability
+ */
+#define GF_MXDEC_H264_CAP_BASELINE 0x00000001UL
+
+ /** MxDecH264API property flag: Main profile supported.
+ @see GFMxDecH264GetProperty(), GFPROPERTY::Capability
+ */
+#define GF_MXDEC_H264_CAP_MAIN 0x00000002UL
+
+ /** MxDecH264API property flag: Extended profile supported.
+ @see GFMxDecH264GetProperty(), GFPROPERTY::Capability
+ */
+#define GF_MXDEC_H264_CAP_EXTENDED 0x00000004UL
+
+ /** MxDecH264API property flag: LEVEL 1 supported.
+ @see GFMxDecH264GetProperty(), GFPROPERTY::Capability
+ */
+#define GF_MXDEC_H264_CAP_LEVEL10 0x00000100UL
+
+ /** MxDecH264API property flag: LEVEL 1.1 supported.
+ @see GFMxDecH264GetProperty(), GFPROPERTY::Capability
+ */
+#define GF_MXDEC_H264_CAP_LEVEL11 0x00000200UL
+
+ /** MxDecH264API property flag: LEVEL 1.2 supported.
+ @see GFMxDecH264GetProperty(), GFPROPERTY::Capability
+ */
+#define GF_MXDEC_H264_CAP_LEVEL12 0x00000400UL
+
+ /** MxDecH264API property flag: LEVEL 1.3 supported.
+ @see GFMxDecH264GetProperty(), GFPROPERTY::Capability
+ */
+#define GF_MXDEC_H264_CAP_LEVEL13 0x00000800UL
+
+ /** MxDecH264API property flag: LEVEL 2 supported.
+ @see GFMxDecH264GetProperty(), GFPROPERTY::Capability
+ */
+#define GF_MXDEC_H264_CAP_LEVEL20 0x00001000UL
+
+ /** MxDecH264API property flag: LEVEL 2.1 supported.
+ @see GFMxDecH264GetProperty(), GFPROPERTY::Capability
+ */
+#define GF_MXDEC_H264_CAP_LEVEL21 0x00002000UL
+
+ /** MxDecH264API property flag: LEVEL 2.2 supported.
+ @see GFMxDecH264GetProperty(), GFPROPERTY::Capability
+ */
+#define GF_MXDEC_H264_CAP_LEVEL22 0x00004000UL
+
+ /** MxDecH264API property flag: LEVEL 3 supported.
+ @see GFMxDecH264GetProperty(), GFPROPERTY::Capability
+ */
+#define GF_MXDEC_H264_CAP_LEVEL30 0x00008000UL
+
+ /** MxDecH264API property flag: LEVEL 3.1 supported.
+ @see GFMxDecH264GetProperty(), GFPROPERTY::Capability
+ */
+#define GF_MXDEC_H264_CAP_LEVEL31 0x00010000UL
+
+ /** MxDecH264API property flag: LEVEL 3.2 supported.
+ @see GFMxDecH264GetProperty(), GFPROPERTY::Capability
+ */
+#define GF_MXDEC_H264_CAP_LEVEL32 0x00020000UL
+
+ /** MxDecH264API property flag: LEVEL 4 supported.
+ @see GFMxDecH264GetProperty(), GFPROPERTY::Capability
+ */
+#define GF_MXDEC_H264_CAP_LEVEL40 0x00040000UL
+
+ /** MxDecH264API property flag: LEVEL 4.1 supported.
+ @see GFMxDecH264GetProperty(), GFPROPERTY::Capability
+ */
+#define GF_MXDEC_H264_CAP_LEVEL41 0x00080000UL
+
+ /** MxDecH264API property flag: LEVEL 4.2 supported.
+ @see GFMxDecH264GetProperty(), GFPROPERTY::Capability
+ */
+#define GF_MXDEC_H264_CAP_LEVEL42 0x00100000UL
+
+ /** MxDecH264API property flag: LEVEL 5 supported.
+ @see GFMxDecH264GetProperty(), GFPROPERTY::Capability
+ */
+#define GF_MXDEC_H264_CAP_LEVEL50 0x00200000UL
+
+ /** MxDecH264API property flag: LEVEL 5.1 supported.
+ @see GFMxDecH264GetProperty(), GFPROPERTY::Capability
+ */
+#define GF_MXDEC_H264_CAP_LEVEL51 0x00400000UL
+
+ /** MxDecH264API property flag: Post Processing de-blocking supported.
+ @see GFMxDecH264GetProperty(), GFPROPERTY::Capability
+ */
+#define GF_MXDEC_H264_CAP_DB 0x01000000UL
+
+ /** MxDecH264API property flag: Post Processing de-ringing supported.
+ @see GFMxDecH264GetProperty(), GFPROPERTY::Capability
+ */
+#define GF_MXDEC_H264_CAP_DR 0x02000000UL
+
+ /** VUI Parameters for GFMXDECH264DECSEQUENCE
+ */
+ typedef struct _GFMXDECH264DECVUI
+ {
+ NvU32 num_units_in_tick;
+ NvU32 time_scale;
+ NvU32 fixed_frame_rate_flag;
+ }GFMXDECH264DECVUI, *PGFMXDECH264DECVUI;
+
+ /** Parameter structure for MxDecH264DecSequence().
+ Both input and output parameters are passed via this structure to MxDecH264DecSequence().
+ @see MxDecH264DecSequence()
+ */
+ typedef struct _GFMXDECH264DECSEQUENCE
+ {
+ NvU32 uiSequenceOption; /**< Input flags, see GFMXDECH264_DECSEQUENCEOPTION_* */
+ NvU32 SequenceInfo; /**< Output flags, see GF_MXDEC_H264_DEC_SEQUENCE_* */
+ NvU16 profile_idc; /**< Output, H264 profile ID */
+ NvU16 level_idc; /**< Output, H264 level ID */
+ NvU16 seq_parameter_set_id;/** PicOrderCnt(CurrPic)
+ Greater than 1 specifies that the pan-scan rectangle information persists until
+ - A new coded video sequence begins
+ - A picture in an access unit containing a pan-scan rectangle SEI message with the
+ same value of pan_scan_rect_id is output having
+ (PicOrderCnt() > PicOrderCnt(CurrPic)) && (PicOrderCnt()<= PicOrderCnt(CurrPic) + pan_scan_rect_repetition_period )
+ */
+ } GFMXDECH264DECSEIPANSCAN, *PGFMXDECH264DECSEIPANSCAN;
+
+ typedef struct _GFMXDECH264DECSEISUBSEQLAYER
+ {
+ NvU32 num_sub_seq_layers_minus1; /**< Output, Specifies the number of sub-sequence layers in the sequence */
+ NvU32 accurate_statistics_flag; /**< Output, This flag when equal to 1 indicates that the values of average_bit_rate and
+ average_frame_rate are rounded from statistically correct values.
+ When equal to 0 indicates that the average_bit_rate and the average_frame_rate are estimates
+ and may deviate somewhat from the correct values.
+ */
+ NvU32 average_bit_rate; /**< Output, Indicates the average bit rate in units of 1000 bits per second. */
+ NvU32 average_frame_rate; /**< Output, Indicates the average frame rate in units of frames/(256 seconds). */
+ } GFMXDECH264DECSEISUBSEQLAYER, *PGFMXDECH264DECSEISUBSEQLAYER;
+
+ typedef struct _GFMXDECH264DECSEISUBSEQ
+ {
+ NvU32 sub_seq_layer_num; /**< Output, Identifies the sub-sequence layer number of the target sub-sequence */
+ NvU32 sub_seq_id; /**< Output, Identifies the target sub-sequence. */
+ NvU32 duration_flag; /**< Output, Equal to 0 indicates that the duration of the target sub-sequence is not specified. */
+ NvU32 sub_seq_duration; /**< Output, Specifies the duration of the target sub-sequence in clock ticks of a 90-kHz clock. */
+ NvU32 average_rate_flag; /**< Output, equal to 0 indicates that the average bit rate and the average frame rate of the target
+ sub-sequence are unspecified
+ */
+ NvU32 accurate_statistics_flag; /**< Output, Same as accurate_statistics_flag in _GFMXDECH264DECSEISUBSEQLAYER*/
+ NvU32 average_bit_rate; /**< Output, Indicates the average bit rate in (1000 bits)/second of the target sub-sequence.*/
+ NvU32 average_frame_rate; /**< Output, Indicates the average frame rate in units of frames/(256 seconds) of the target sub-sequence.*/
+ NvU32 num_referenced_subseqs; /**< Output, Specifies the number of sub-sequences that contain pictures that are used as reference pictures
+ for inter prediction in the pictures of the target sub-sequence.
+ */
+ NvU32 ref_sub_seq_layer_num;
+ NvU32 ref_sub_seq_id;
+ NvU32 ref_sub_seq_direction; /**< Output, ref_sub_seq_layer_num, ref_sub_seq_id, and ref_sub_seq_direction identify the sub-sequence
+ that contains pictures that are used as reference pictures for inter prediction in the pictures
+ of the target sub-sequence.
+ */
+ } GFMXDECH264DECSEISUBSEQ, *PGFMXDECH264DECSEISUBSEQ;
+
+
+
+ /** ulBitMask, ulBitpayloadType: Application will set the corresponding bit of ulBitMask depending upon its requirement of the
+ particular payload type of SEI Message.
+ H264 Decoder API will set the corresponding bit of ulBitpayloadType depending upon the availability of the
+ particular payload type indicated by ulBitMask flag in the SEI NAL unit.
+
+ @see ulBitpayloadType, ulBitMask in _GFMXDECH264DECSEI
+ */
+
+ /** Bit 0: SEI message for buffering period.
+ */
+#define GF_MXDEC_H264_SEI_MESSAGE_BUFFERING_PERIOD 0x00000001UL
+
+ /** Bit 1: SEI message for picture timing.
+ */
+#define GF_MXDEC_H264_SEI_MESSAGE_PICTURE_TIMING 0x00000002UL
+
+ /** Bit 2: SEI message for Pan Scan Rect.
+ */
+#define GF_MXDEC_H264_SEI_MESSAGE_PAN_SCAN 0x00000004UL
+
+ /** Bit 11: SEI message for Sequence Layer Characterization.
+ */
+#define GF_MXDEC_H264_SEI_MESSAGE_SEQ_LAYER_CHARECTERIZATION 0x00000800UL
+
+ /** Bit 12: SEI message for Sequence Characterization.
+ */
+#define GF_MXDEC_H264_SEI_MESSAGE_SEQ_CHARECTERIZATION 0x00001000UL
+
+ /** Parameter structure for MxDecH264DecSEI().
+ Both input and output parameters are passed via this structure to MxDecH264DecSEI().
+ @see MxDecH264DecSEI()
+ */
+ typedef struct _GFMXDECH264DECSEI
+ {
+ NvU32 payloadType; /**< Output, Specifies the type of SEI payload */
+ NvU32 payloadSize; /**< Output, Specifies the number of bytes in SEI payload */
+ GFMXDECH264DECSEIBUFFERINGPERIOD buffperiod; /**< Output, Complete information after parsing the buffering period message of SEI NAL unit
+ GFMXDECH264DECSEIBUFFERINGPERIOD structure
+ */
+ GFMXDECH264DECSEIPICTIMING pictiming; /**< Output, Complete information after parsing the pic_timing message of SEI NAL unit
+ GFMXDECH264DECSEIPICTIMING structure
+ */
+ GFMXDECH264DECSEIPANSCAN panscan; /**< Output, Complete information after parsing the Pan Scan message of SEI NAL unit
+ GFMXDECH264DECSEIPANSCAN structure
+ */
+ GFMXDECH264DECSEISUBSEQLAYER subseqlayer; /**< Output, Complete information after parsing the sub-Seqlayer message of SEI NAL unit
+ GFMXDECH264DECSEISUBSEQLAYER structure
+ */
+ GFMXDECH264DECSEISUBSEQ subseq; /**< Output, Complete information after parsing the sub-Seqlayer message of SEI NAL unit
+ GFMXDECH264DECSEISUBSEQ structure
+ */
+ NvU8 *pPreFillBuffer; /**< Input, Pointer bitstream for sequence header to decode */
+ NvU32 PreFillBufferLength;/**< Input, Length of bitstream in bytes, must cover the entire sequence header */
+ NvU32 ulBitpayloadType; /**< Output, Each Bit Informs a particular SEI message required by the application
+ so that the H264 decoder only parses that message related data stream
+ */
+ NvU32 ulBitMask; /**< Input, Each Masking Bit indicated which information is required by the application */
+ } GFMXDECH264DECSEI, *PGFMXDECH264DECSEI;
+
+ /** GFMXDECH264DECSEQUENCE::SequenceInfo ouput flagbit: constraint_set0_flag is on in the bitstream.
+ */
+#define GF_MXDEC_H264_DEC_SEQUENCE_CONSTRAINT_SET0_FLAG 0x00000001
+
+ /** GFMXDECH264DECSEQUENCE::SequenceInfo ouput flagbit: constraint_set1_flag is on in the bitstream.
+ */
+#define GF_MXDEC_H264_DEC_SEQUENCE_CONSTRAINT_SET1_FLAG 0x00000002
+
+ /** GFMXDECH264DECSEQUENCE::SequenceInfo ouput flagbit: constraint_set2_flag is on in the bitstream.
+ */
+#define GF_MXDEC_H264_DEC_SEQUENCE_CONSTRAINT_SET2_FLAG 0x00000004
+
+ /** GFMXDECH264DECSEQUENCE::SequenceInfo output flagbit: Frame cropping.
+ If this flag is set GFMXDECH264DECSEQUENCE::CroppingRect contains a valid
+ frame cropping rectangle.
+ */
+#define GF_MXDEC_H264_DEC_SEQUENCE_FRAME_CROPPING_FLAG 0x00000008
+
+ /** GFMXDECH264DECSEQUENCE::uiSequenceOption input flagbit: Bitstream is passed with GFMxDecH264DecSequence().
+ If this flag is set bitstream data is passed with the call to GFMxDecH264DecSequence()
+ instead via the read bitstrem callback. This can be used only with boundary detection
+ on application level. The bitstream data is passed via GFMXDECH264DECSEQUENCE::pPreFillBuffer and
+ GFMXDECH264DECSEQUENCE::PreFillBufferLength.
+ */
+#define GFMXDECH264_DECSEQUENCEOPTION_PREFILLBUFFER 0x00000001
+
+#define GFMXDECH264_MAX_NUM_REF_FRAMES 17
+ typedef struct
+ {
+ NvU32 POC;
+ NvU8 isNotDisplayed;
+ NvU8 RetainDuringDPBFlush;
+ NvU8 status;
+ }GFMXDECH264_DPB_DATA;
+
+
+ /** Parameter structure for MxDecH264DecPicture().
+ Both input and output parameters are passed via this structure to MxDecH264DecPicture().
+ @see MxDecH264DecPicture()
+ */
+ typedef struct _GFMXDECH264DECPICTURE
+ {
+ NvU32 uiPictureOption; /**< Input flagbits, see GF_MXDEC_H264_DEC_PICTURE_SPECIFY_*. */
+ PGFRECT pPictureRect; /**< Input, Target rectangle.
+ GFMXDECH264DECPICTURE::pPictureRect specifies a rectangle on the
+ output surface for GFMxDec to output the decoded image.
+
+ This field only take effect when MXDEC_H264_DEC_PICTURE_SPECIFY_SURF_RECT
+ flag is set.
+
+ The rectangle must be within the surface. The rectangle's top and
+ left position must be aligned by application. Call GFMxDecGetAttribute()
+ with #MXDEC_ATTR_H264_DEC_PICTURE_RECT_TOP_ALIGNMENT and
+ #MXDEC_ATTR_H264_DEC_PICTURE_RECT_LEFT_ALIGNMENT to read the alignment
+ requirements. The rectangle's width and height must match the video frame
+ width and height as returned from MxDecH264DecSequence() in
+ GFMXDECH264DECSEQUENCE::pic_width and GFMXDECH264DECSEQUENCE::pic_height.
+
+ Note: Feature not yet implemented.
+ */
+ NvU32 uiPictureInfo; /**< Output flags, see GF_MXDEC_H264_DEC_PICTURE_*. */
+ PGFRMSURFACE reconstructedSurf; /**< Output, Surface holding the decoded picture.
+ If frame is not decoded then reconstructedSurf will not get initialsed i.e. NULL
+ So VXBLT is called if the reconstructedSurf is not NULL.
+ */
+ NvU32 uiPictureOrderCount; /**< Output */
+ NvU32 uiTimeStamp; /**< Output, frame timestamp in miliseconds, valid only if GF_MXDEC_H264_DEC_PICTURE_TIME_STAMP set. */
+ NvU8 * pMBInfo; /**< Output, each element tells the particular MB is wrong or not. */
+ NvU32 UsedAsReference; /**< Output */
+ NvU8* pPreFillBuffer; /**< Input, Pointer bitstream for frame to decode
+ The bitstream pointer needs to be 4-bytes aligned.
+ */
+ NvU32 PreFillBufferLength; /**< Input, Length of bitstream in bytes, must cover the entire frame */
+ NvU32 PreFillBufferBytesConsumed; /**< Output, Amount of bytes consumed by the component */
+ NvU16 flushDPB; /**< Output, set to !=0 by the decoder when it encounters a memory_management_control_operation = 5
+ indication in the bitstream. The application should display (if the
+ NoOutputofPriorPics flag is not set) and flush the entire DPB, i.e remove
+ all previously stored frames from DPB.
+ Current frame should not be displayed/flushed.
+
+ See \a NoOutputofPriorPics for more info.
+ */
+ NvU16 NoOutputofPriorPics; /**< Output, set by the decoder when it encounters a no_output_of_prior_pics_flag in
+ the bitstream. If this set, then flushDPB will also be set. The application
+ should flush the entire DPB, i.e remove all previously stored frames from DPB.
+ Current frame should not be displayed/flushed.
+
+ Summary:
+
+ NoOutputofPriorPics flushDPB Applications response
+ 1 1 Remove all previously stored frames. No display.
+ 0 1 Display all previously stored frames and then remove from DPB.
+ 0 0 Normal operation of decoder.
+
+ */
+ NvU32 ReconSurfaceNumber; /**< Index of reconstructed surface, this is an index into GFMXDECH264SURFLIST::surfList[].
+ valid only if GFMXDECH264DECPICTURE::reconstructedSurf is not NULL.
+ Invalid for streams with picture reordering.
+ */
+ GFMXDECH264_DPB_DATA dpb_data[GFMXDECH264_MAX_NUM_REF_FRAMES];
+ } GFMXDECH264DECPICTURE, *PGFMXDECH264DECPICTURE;
+
+ //uiPictureOption
+
+ /** GFMXDECH264DECPICTURE::uiPictureOption input flagbit: Use target rectangle.
+ If this flag is set, the GFMXDECH264DECPICTURE::pPictureRect will point to
+ a rectangle on the output surface, where the reconstructed frame is placed.
+ */
+#define GF_MXDEC_H264_DEC_PICTURE_SPECIFY_SURF_RECT 0x00000001
+
+ /** GFMXDECH264DECPICTURE::uiPictureOption input flagbit: Bitstream is passed with MxDecH264DecPicture().
+ If this flag is set bitstream data is passed with the call to MxDecH264DecPicture()
+ instead via the read bitstrem callback. This can be used only with frame boundary detection
+ on application level. The bitstream data is passed via GFMXDECH264DECPICTURE::pPreFillBuffer and
+ GFMXDECH264DECPICTURE::PreFillBufferLength.
+ */
+#define GF_MXDEC_H264_DEC_PICTURE_SPECIFY_PREFILLBUFFER 0x00000002
+
+ //PictureInfo:
+
+ /** GFMXDECH264DECSEQUENCE::PictureInfo output flagbit: Current picture is IDR.
+ */
+#define GF_MXDEC_H264_DEC_PICTURE_IDR 0x00000001
+
+ /** GFMXDECH264DECSEQUENCE::PictureInfo output flagbit: GFMXDECH264DECSEQUENCE::uiTimeStamp field is valid.
+ */
+#define GF_MXDEC_H264_DEC_PICTURE_TIME_STAMP 0x00000002
+
+ /** GFMXDECH264DECSEQUENCE::PictureInfo output flagbit: Decoded picture has at least one corrupted macroblock.
+ */
+#define GF_MXDEC_H264_DEC_PICTURE_BAD_MB 0x00000004
+
+ /** GFMXDECH264DECSEQUENCE::PictureInfo output flagbit:
+ Required by the application to decide whether post processing should be applied for a particular frame
+ DeblockingFlag is set, when Deblocking Filtering is disabled for all the slices
+ DeblockingFlag is reset even if deblocking filtering is enabled for atleast one slice
+ */
+#define GF_MXDEC_H264_DEC_PICTURE_DEBLOCKING_FILTER 0x00000008
+
+ typedef struct _GFMXDECH264SEQUENCE
+ {
+ NvU32 SequenceInfo;
+ NvU16 pic_width_in_mbs_minus1;
+ NvU16 pic_height_in_map_units_minus1;
+ } GFMXDECH264SEQUENCE, *PGFMXDECH264SEQUENCE;
+ //PictureInfo:
+#define GF_MXDEC_H264_SEQUENCE_FRAME_MB_ONLY_FLAG 0x00000001
+ //if frame_mb_only_flag is on, this flag must be on
+#define GF_MXDEC_H264_SEQUENCE_MB_ADAPTIVE_FRAME_FIELD_FLAG 0x00000002
+ //if mb_adaptive_frame_filed_flag is on, this flag must be on
+#define GF_MXDEC_H264_SEQUENCE_DIRECT_8X8_INFERENCE_FLAG 0x00000004
+ //if direct_8x8_inference_flag is on, this flag must be on
+
+
+ typedef struct _GFMXDECH264PICTURE
+ {
+ NvU32 PictureInfo;
+ PGFRMSURFACE reconstructedSurf; //surface to hold the decoded picture
+ PGFRECT pRect;
+ NvU8 weighted_bidpred_idc;
+ NvS8 chroma_qp_index_offset;
+ } GFMXDECH264PICTURE, *PGFMXDECH264PICTURE;
+ //PictureInfo:
+#define GF_MXDEC_H264_PICTURE_WEIGHTED_PRED_FLAG 0x00000001
+ //if weighted_pred_flag is on, this flag must be on
+#define GF_MXDEC_H264_PICTURE_DEBLOCKING_FILTER_CONTROL_PRESENT_FLAG 0x00000002
+ //if deblocing_filter_control_present_flag is on, this flag must be on
+#define GF_MXDEC_H264_PICTURE_CONSTRAINED_INTRA_PRED_FLAG 0x00000004
+ //if constrained_intra_pred_flag is on, this flag must be on
+#define GF_MXDEC_H264_PICTURE_IDR 0x00000008
+#define GF_MXDEC_H264_PICTURE_SPECIFY_SURFACE_RECT 0x00000010
+ // If this flag is set, pRect must be set. GFMxDec will reference image
+ // in pRect area of reference surface and output the decoded image in
+ // the pRect area of reconstructedSurf. Otherwise, GFMxDec will use
+ // the whole surface area.
+
+
+ typedef struct _GFMXDECH264WEIGHT
+ {
+ NvS8 luma_weight;
+ NvS8 luma_offset;
+ NvS8 Cb_weight;
+ NvS8 Cb_offset;
+ NvS8 Cr_weight;
+ NvS8 Cr_offset;
+ } GFMXDECH264WEIGHT, *PGFMXDECH264WEIGHT;
+
+
+
+ typedef struct _GFMXDECH264SLICE
+ {
+ NvU32 SliceInfo;
+ NvU16 first_mb_in_slice;
+ NvU16 reserved;
+ NvU8 slice_type;
+ NvU8 num_ref_idx_l0_active_minues1;
+ NvU8 num_ref_idx_l1_active_minues1;
+ NvU8 disable_deblocking_filter_idc ;
+ NvU8 slice_alpha_c0_offset_div2;
+ NvU8 slice_beta_offset_div2;
+ PGFRMSURFACE ref_l0_surfaces[16];
+ PGFRMSURFACE ref_l1_surfaces[16];
+ GFMXDECH264WEIGHT weighttableL0[16];
+ GFMXDECH264WEIGHT weighttableL1[16];
+ } GFMXDECH264SLICE, *PGFMXDECH264SLICE;
+ //SliceInfo:
+#define GF_MXDEC_H264_SLICE_FILED_PIC_FLAG 0x01
+ //when filed_pic_flag is on, this flag must be set
+#define GF_MXDEC_H264_SLICE_BOTTOM_FILED_FLAG 0x02
+ //when bottom_field_flag is on, this flag must be set
+#define GF_MXDEC_H264_SLICE_DIRECT_SPATIAL_MV_PRED_FLAG 0x04
+ //when DIRECT_SPATIAL_MV_PRED_FLAG is on, this flag must be set
+
+
+ typedef struct _GFMXDECH264I4X4LPREDMODE
+ {
+ NvU32 uiPredMode0to7; //Luma4X4 Blk 0 to 7's prediction modes.
+ NvU32 uiPredMode8to15; //Luma4X4 Blk 8 to 15's prediction modes.
+ } GFMXDECH264I4X4LPREDMODE, *PGFMXDECH264I4X4LPREDMODE;
+
+ typedef struct _GFMXDECH264MV
+ {
+ NvS16 Horizontal;
+ //Horizonal motion vector component.
+ NvS16 Vertical;
+ //Vertical motion vector component
+ } GFMXDECH264MV, *PGFMXDECH264MV;
+
+
+ typedef struct _GFMXDECH264REFIDX
+ {
+ NvU8 Ref_idx_l0[4]; //PartIdx's reference index
+ NvU8 Ref_idx_l1[4]; //PartIdx's reference index
+ } GFMXDECH264REFIDX, *PGFMXDECH264REFIDX;
+
+
+ typedef struct _GFMXDECH264SUBMBTYPE
+ {
+ NvU8 sub_mb_type[4]; //PartIdx's sub_mb_type
+ } GFMXDECH264SUBMBTYPE, *PGFMXDECH264SUBMBTYPE;
+
+
+ typedef struct _GFMXDECH264MB
+ {
+ NvU16 uiTotalSize;
+ //Total size in bytes for current macroblock, including this structure
+ //itself and necessary following structure behind of this structure.
+ //Reference the data following GFMXDECH264MB.
+ NvU16 uiTotalCOEFs;// total Coefs for this macroblock
+ NvU32 curMBAddress; // current macroblock address
+ NvU8 MBInfo;
+ // this is the mb_type in bit stream and mb_field_decoding_flag
+ NvU8 uiQP; //this is QPy
+ NvU8 coded_block_pattern;
+ //This field is only valid when current macroblock is not Intra_16x16
+ NvU8 Intra_chroma_pred_mode;
+ //This field is valid only when current macroblock is Intra
+ GFMXDECH264SUBMBTYPE sub_mb_type;
+ union
+ {
+ GFMXDECH264I4X4LPREDMODE I4X4LPredMode; //Intra_4X4 only
+ GFMXDECH264REFIDX RefIdx; //Inter only
+ } mode; // TODO: Name this better
+ NvS32 numCoefsPerSubMB[32];
+ NvS16 index;
+ } GFMXDECH264MB, *PGFMXDECH264MB;
+
+ //MBInfo:
+#define GF_MXDEC_H264_MB_FILED_DECODING_ENABLE 0x80
+ //when mb_field_decoding_flag is on, this flag must be set
+#define GF_MXDEC_H264_MB_SKIP_MB 0x40
+ //skip MB
+
+ //The data following GFMXDECH264MB:
+ //If current macroblock is skipped macroblock, no further data is needed.
+
+ //If current macroblock is IPCM, there are 384 bytes following GFMXDECH264MB.
+
+ //If current macroblock is Inter macroblock, and is using picture list 0 only,
+ //necessary number of GFMXDECH264MV are following. If current macroblock is
+ //using picture list 1 only, necessary number of GFMXDECH264MV are following.
+ //If current macroblock is using both picture list 0 and list 1, necessary
+ //number of GFMXDECH264MV for list 0, and necessary number of GFMXDECH264MV
+ //for list 1 are following GFMXDECH264MB.
+
+ //For both Intra and Inter macroblock, the last portion of data which follows
+ //GFMXDECH264MB is GFMXDECH264MB.uiTotalCOEFs of GFMXDECH264COEF.
+
+
+
+ // definition for attribute
+
+ /** GFMxDecH264 Attribute: Application will determine the decoding boundaries.
+ For H.264/AVC, this boundary means sequence and picture boundary. For certain file formats,
+ those boundary information are stored in a meta data file. Alternatively the application
+ could parse NAL unit boundaries from the H264 stream and determine decoding units.
+ If application wants GFMxDecH264 to detect the boundary, it should not enable this
+ attribute.
+
+ If prefill mode (see #GFMXDECH264_DECSEQUENCEOPTION_PREFILLBUFFER) is used,
+ this attribute must be enabled. Disabled by default.
+
+ Interpretation of block referenced by \a pInfo parameter:
+
+ NvU32 1: APP will determine the decoding boudary
+ 0: APP will not determine the decoding boundary
+
+
+ @see GFMxDecH264GetAttribute(), GFMxDecH264SetAttribute()
+ */
+#define GF_MXDEC_H264_ATTR_PRE_DETERMINED_BOUNDARY 0x00000001
+
+ /** GFMxDecH264 Attribute: Enforce display ordering for sequences containing out of order frames.
+
+ Disabled by default.
+
+ Interpretation of block referenced by \a pInfo parameter:
+
+ NvU32 !=0: Enable reordering
+ 0: Disable reordering
+
+
+ @see GFMxDecH264GetAttribute(), GFMxDecH264SetAttribute()
+ */
+#define GF_MXDEC_H264_ATTR_DISPLAY_REORDERING 0x00000002
+
+#define GF_MXDEC_H264_ATTR_DSP_STREAM_BUFFERING 0x00000003
+ //This Attribute only can be used for GFMxDecH264SetAttribute
+ //If the Application wants to set the mode DSP_STREAM_BUFFERING in H264Decoder, enable the #define DSP_STREAM_BUFFERING in App,
+ //then APP will enable the attribute by calling the GFMxDecH264SetAttribute.
+ //this attribute is used to pass the buffer details, from Application to the host side of GFSDK H264 component.
+
+ /** GFMxDecH264 Attribute: Enable decode surface locking in MxDecH264DecPicture().
+
+ MxDecH264DecPicture() returns the decoded surface number in GFMXDECH264DECPICTURE::ReconSurfaceNumber,
+ which is an index into the decode surface list GFMXDECH264SURFLIST::surfList[] set via
+ #GF_MXDEC_H264_SET_SURFACE_LIST. If surface locking is enabled, MxDecH264DecPicture() will
+ automatically 'lock' the returned surface and exclude it from its list of
+ surfaces used for further decoding. GFMxDecH264 can still read from a locked surface
+ (for reference frames), but it will not overwrite it. The application must not
+ write into a locked surface, since it still may be used as reference frame.
+
+ This locking mechanism is intended for usecases, where the application directly displays
+ the decode surface as video overlay. See also @ref pageMxDecH264AppNotes2
+
+ With surface locking enable, each successfully decoded surface has to be unlocked by the
+ application with GFMxDecH264Set / #GF_MXDEC_H264_SET_UNLOCK_SURFACE.
+
+ Since locked surfaces cannot be used for decoding, the number of decoding surfaces
+ set with #GF_MXDEC_H264_SET_SURFACE_LIST must be R+1+N, where R is the maximum number of
+ reference frames and N the maximum number of simultaneously locked surfaces.
+ Otherwise MxDecH264DecPicture() may fail.
+
+ Disabled by default.
+
+ Interpretation of block referenced by \a pInfo parameter:
+
+ NvU32 !=0: Enable surface locking
+ 0: Disable surface locking
+
+
+ @see GFMxDecH264GetAttribute(), GFMxDecH264SetAttribute(), GF_MXDEC_H264_SET_UNLOCK_SURFACE, @ref pageMxDecH264AppNotes2
+ */
+#define GF_MXDEC_H264_ATTR_SURFACE_LOCKING 0x00000004
+
+ /** GFMxDecH264 Attribute: Get H264 decoder's DSP handle.
+
+ Interpretation of block referenced by \a pInfo parameter:
+
+ NvU32 DSP handle
+
+
+ GFMxDecH264GetAttribute() returns error GFMXDECH264_ERROR_INVALID_STATE, if DSP side not initialized.
+ Can be get only.
+
+ @internal
+ @see GFMxDecH264GetAttribute()
+ */
+#define GF_MXDEC_H264_ATTR_GETDSPHANDLE 0x00000005
+
+#define GF_MXDEC_H264_ATTR_DEC_PICTURE_RECT_TOP_ALIGNMENT 0x00000007
+ //This attribute only can be used for GFMxDecGetAttribute
+ //If application wants to set pDestRect in GFMXDECPICTURE or GFMXDECH264DECPICTURE,
+ //application must use this attributes to get allignment information and
+ //align the rectangle top & left corner accordinately.
+ //*pInfo: top fieled alignment in term of lines
+
+#define GF_MXDEC_H264_ATTR_DEC_PICTURE_RECT_LEFT_ALIGNMENT 0x00000008
+ //This attribute only can be used for GFMxDecGetAttribute
+ //If application wants to set pDestRect in GFMXDECH264PICTURE or GFMXDECH264DECPICTURE,
+ //application must use those attributes to get allignment information and
+ //align the rectangle top & left corner accordinately.
+ //*pInfo: left fieled alignment in term of pixels
+
+#define GF_MXDEC_H264_ATTR_DEC_ENABLE_RAISE_WAIT 0x00000009
+ /*
+ * This attribute only can be used for GFMxDecSetAttribute
+ * if (*pInfo == 1)
+ * {
+ * Raisevectors are allocated per Surface.
+ * There will be 2 (3 if PostProcessing is ON) sets of raise-wait happening
+ * 1) Decoder raises On_Frame_Decoded, and VxBlt waits.
+ * 2) (If enabled in APP) PostProcessing API raises On_PP_Frame_Done, and VxBlt waits.
+ * 3) VxBlt raises On_Bltted, and Decoder waits.
+ * }
+ * else // DEFAULT
+ * {
+ * We do not allocate surface raise vectors but a single raise vector
+ * - In Decoder, we poll Frame_done, and return only after its done
+ * - In PostProcessing we poll PP_Frame_done, and return only after its done
+ * - I observed that Frame_done & PP_Frame_done bits are affected only if raise is done on those. Thats why single raise vector is still needed.
+ * This raise vector is not in any suface but in pdec.
+ * }
+ */
+
+#define GF_MXDEC_H264_ATTR_LEN_OF_NALSIZE 0x0000000a
+ /*To support the decoding of .264 stream where NAL size appears instead of StartCode
+ This is to get the length of the NAL size value*/
+#define GF_MXDEC_H264_ATTR_NALSIZE_DECODING 0x0000000b
+ /* To support runtime decision making between the start code decoding and NAL size decoding*/
+
+
+ /** GFMxDecH264 Attribute: Indicate to the H264 decoder that surfaces have
+ already been allocated by the Application before the sps is decoded.
+ Interpretation of block referenced by \a pInfo parameter:
+
+ NvU32 (Height << 16)| (Width)
+
+
+ Can be set only.
+ */
+#define GF_MXDEC_H264_ATTR_SURFACE_ALLOCATED 0x0000000c
+
+ /** GFMxDecH264 Attribute: Set number of maximum supported reference frames.
+
+ Interpretation of block referenced by \a pInfo parameter:
+
+ NvU32 Number of reference frames
+
+
+ This can be called before or after GFMxDecH264Set(GF_MXDEC_H264_SET_SURFACE_LIST).
+ The number of reference frames must be smaller than the number of surfaces
+ set via GFMxDecH264Set(GF_MXDEC_H264_SET_SURFACE_LIST).
+
+ If this attribute is not set, the number of supported reference frames will be
+ equal to one less the number of surfaces set in GFMxDecH264Set(GF_MXDEC_H264_SET_SURFACE_LIST).
+
+ Can be set only.
+
+ @see GF_MXDEC_H264_SET_SURFACE_LIST
+ */
+#define GF_MXDEC_H264_ATTR_MAXREFFRAMES 0x0000000d
+
+ /** GFMxDecH264 Attribute: Get Error Map Matrix for MBs in last decoded frame.
+
+ This attribute only can be used for GFMxDecGetAttribute. If application wants to get MB error map for
+ till recently decoded frame. Input parameter is a character array pMBErrMapMatrix of size "number of MBs in a frame". On returning
+ this call fills this char array with 1s & 0s. 1: MB correctly decoded & 0: MB corrupted. This is cumulative err map till this call
+ is made. In this API call after copying the err map to the char array, internal map is reset to all clean MBs.
+ Internal map is reset to all clean MBs also when I or SI slice is found.
+
+ Interpretation of block referenced by \a pInfo parameter:
+
+ NvU8 * pMBErrMapMatrix
+
+
+ @internal
+ @see GFMxDecH264GetAttribute()
+ */
+#define GF_MXDEC_H264_ATTR_GET_MBERR_MAP_MATRIX 0x0000000e
+
+/** GFMxDecH264 Attribute: Set Error Concealment (EC) Mode ON or OFF.
+
+ EC is Dynamically ON by default.
+
+ Interpretation of block referenced by \a pInfo parameter:
+
+ NvU32 !=0: Enable EC
+ 0: Disable EC
+
+
+ @see GFMxDecH264SetAttribute()
+*/
+#define GF_MXDEC_H264_ATTR_SWITCH_EC_MODE 0x0000000f
+
+/** GFMxDecH264 Attribute: Set Single Slice Per Frame Mode ON or OFF.
+
+ By default multiple slices per frame is assumed.
+
+ Interpretation of block referenced by \a pInfo parameter:
+
+ NvU32 !=0: Single slice per frame
+ 0: Multiple slices per frame
+
+
+ @see GFMxDecH264SetAttribute()
+*/
+#define GF_MXDEC_H264_ATTR_SINGLE_SLICE_PER_FRAME 0x00000010
+
+
+
+/** GFMxDecH264 Attribute: Put the h264 decoder in the TSPlayer
+ mode. This has to be done first, and sets up the h264 decoder to cooperate
+ with the TS Demux task on the AVP. Does nothing when decode is on the
+ host
+*/
+#define GF_MXDEC_H264_ATTR_SET_TSPLAYER_MODE 0x00000011
+
+
+/** Parameter structure for MxDecH264PostProcessing().
+ Both input and output parameters are passed via this structure to MxDecH264PostProcessing().
+ @see MxDecH264PostProcessing()
+*/
+
+ typedef struct _GFMXDECHH264PP
+ {
+ PGFRMSURFACE* pDestSurf;/**< input,
+ pointer to an array of surfaces that will
+ hold the result from Post Processing
+ pointer to an array of surfaces to
+ accommodate auto post processing
+ */
+ PGFRMSURFACE* pSrcSurf; /**< input,
+ pointer to an array of surfaces to be //post processed
+ pointer to an array of surfaces to
+ accommodate auto post processing
+ */
+ PGFRECT pRect; /**< input,
+ Rectangle area to be processed for both
+ src and dest surface
+ */
+
+ NvU32 numofDestSurf; /**< input,
+ If MXDEC_PP_AUTO flag is set, this
+ parameter must be filled
+ */
+ NvU32 numofSrcSurf; /**< input,
+ If MXDEC_PP_AUTO flag is set, this
+ parameter must be filled
+ */
+ NvU8 * lpQuantiser; /**< input,
+ point to array of QPs for Macro Blocks in
+ the source VOP. GFMX automatically saved
+ the last two decoded VOP's QP tables,
+ Decoder application may not need to reload
+ the table if it can make sure the source
+ VOP is the one within the last decoded
+ VOPs. If MXDEC_PP_RELOAD_QUANTIZER is set,
+ this field must be filled.
+ */
+ NvU32 PPOption; /**
+ NvS32 >0 Surface index which was returned in GFMXDECH264DECPICTURE::ReconSurfaceNumber.
+ NvS32 -1 Reset all locked surfaces to unlocked
+ NvS32 -2 Reserved for internal use
+
+
+ @see GF_MXDEC_H264_ATTR_SURFACE_LOCKING
+ */
+#define GF_MXDEC_H264_SET_UNLOCK_SURFACE 3
+
+ /** GFMxDecH264Set() feature ID: Sync host side H264 state from DSP side.
+ @internal
+ */
+#define GF_MXDEC_H264_SET_SYNC_WITH_DSP 4
+
+ /** GFMxDecH264Set() feature ID: Set or reset DSP idle callback.
+ Can be called on DSP side only.
+ \a pInfo is a pointer to a #GFMXDECH264CALLBACK structure.
+ @internal
+ */
+#define GF_MXDEC_H264_SET_DSPIDLEHANDLER 5
+
+/** GFMxDecH264Set() feature ID: Allow the DSP message poll thread to wake up and terminate.
+ Can be called on Host side only.
+ \a pInfo is ignored.
+ @internal
+*/
+#define GF_MXDEC_H264_SET_EXITDSPMSGTHREAD 6
+
+ /** Parameter structure for GFMxDecH264Set() feature #GF_MXDEC_H264_SET_DSPIDLEHANDLER.
+ @internal
+ */
+ typedef struct _GFMXDECH264DSPIDLECALLBACK
+ {
+ /** Application defined parameter to forward to GFMXDECH264DSPIDLECALLBACK::pCallBack. */
+ void *pPara;
+
+ /** Callback function, which is called from AVP idle loop.
+ @param pPara Application defined parameter, forwarded from GFMXDECH264DSPIDLECALLBACK::pPara
+ */
+ void (*pCallBack)(void* pPara);
+
+ } GFMXDECH264DSPIDLECALLBACK;
+
+
+ /** Parameter structure for GFMxDecH264Set() feature #GF_MXDEC_H264_SET_READBITSTREAM. */
+ typedef struct _GFMXDECH264CALLBACK
+ {
+ /** Application defined parameter to forward to GFMXDECH264CALLBACK::pCallBack. */
+ void *pPara;
+
+ /** Callback function, which is called by MxDecH264 to fetch a portion of bitstream data.
+ @param pPara Application defined parameter, forwarded from GFMXDECH264CALLBACK::pPara
+ @param ppBuffer Callback returns address of the next portion of stream data in \a *ppBuffer
+ @param pBufferLength Callback returns number of bytes in \a ppBuffer in \a *pBufferLength
+ @param uFlag Specifies scan stream direction
+
+ GF_MXDEC_H264_READ_BITSTREAM_FORWARD Forward scan
+ GF_MXDEC_H264_READ_BITSTREAM_BACKWARD Backward scan
+
+
+ @return If the #MXDEC_ATTR_PRE_DETERMINED_BOUNDARY attribute is set, the callback
+ should return #GF_MXDEC_H264_BOUNDARY_REACHED when a frame boundary is
+ detected, or 0 if no boundary is detected.
+ If the #MXDEC_ATTR_PRE_DETERMINED_BOUNDARY attribute is not set, the callback
+ should return 0.
+ */
+ NvU32 (*pCallBack)(void* pPara, NvU8** ppBuffer, NvS32* pBufferLength, NvU32 uFlag);
+
+ }GFMXDECH264CALLBACK, *PGFMXDECH264CALLBACK;
+
+
+
+ /** GFMXDECH264CALLBACK::pCallBack return code */
+#define GF_MXDEC_H264_BOUNDARY_REACHED 0x00000001
+ /** GFMXDECH264CALLBACK::pCallBack uFlag value: Stream forward scan. */
+#define GF_MXDEC_H264_READ_BITSTREAM_FORWARD 0x00000002
+ /** GFMXDECH264CALLBACK::pCallBack uFlag value: Stream backward scan. */
+#define GF_MXDEC_H264_READ_BITSTREAM_BACKWARD 0x00000003
+
+ /** Maximum number of surface pointers GFMXDECH264SURFLIST::surfList[]. */
+#define MXDEC_H264_NUM_SURFACES 17
+
+ /** Parameter structure for GFMxDecH264Set() feature #GF_MXDEC_H264_SET_READBITSTREAM. */
+ typedef struct _GFMXDECH264SURFLIST
+ {
+ /** Number of valid surfaces in GFMXDECH264SURFLIST::surfList[].
+ The number of valid surfaces includes reference, decode surfaces and optional buffer frames.
+ Must be within range 1 and 17.
+ */
+ NvU32 numSurfs;
+
+ /** Surface pointer list.
+
+ Assuming N is the number of reference frames, the first N+1 surfaces
+ in this list will be used as reference and decode surfaces. The currently
+ decoded surface can refer to the N remaining surfaces in this set as
+ reference frames.
+
+ If surface locking mode (#GF_MXDEC_H264_ATTR_SURFACE_LOCKING) is enabled,
+ The remaining M = numSurfs - (N+1) surfaces are used as extra surfaces,
+ to fascilate pre-buffered decoding.
+ */
+ PGFRMSURFACE surfList[MXDEC_H264_NUM_SURFACES];
+
+ }GFMXDECH264SURFLIST, *PGFMXDECH264SURFLIST;
+
+
+ typedef enum
+ {
+ GFMX_DEC_H264_INTERRUPT_ENABLE,
+ GFMX_DEC_H264_INTERRUPT_DISABLE,
+ GFMX_DEC_H264_INTERRUPT_CLEAR
+ } GFMX_DEC_H264_INTERRUPT_OPERATION_TYPE; // Interrupt operation.
+
+ typedef enum
+ {
+ GFMX_DEC_H264_DSP_COMMAND_INTR,
+ GFMX_DEC_H264_POST_PROCESSING_DONE_INTR,
+ GFMX_DEC_H264_DECODE_DONE_INTR
+ } GFMX_DEC_H264_INTERRUPT_TYPE;
+
+ typedef struct _GFMXDECH264TABLE
+ {
+ GF_RETTYPE (* MxDecH264GetProperty)(GFMxDecH264Handle hMxDecH264, PGFPROPERTY pMXProp );
+ GF_RETTYPE (* MxDecH264GetStatus)(GFMxDecH264Handle hMxDecH264, NvU32 * pStatus);
+ GF_RETTYPE (* MxDecH264DecSequence)(GFMxDecH264Handle hMxDecH264, PGFMXDECH264DECSEQUENCE pSequence);
+ GF_RETTYPE (* MxDecH264DecPicture)(GFMxDecH264Handle hMxDecH264, PGFMXDECH264DECPICTURE pPicture);
+ GF_RETTYPE (* MxDecH264SetSequence)(GFMxDecH264Handle hMxDecH264, PGFMXDECH264SEQUENCE pSequence);
+ GF_RETTYPE (* MxDecH264SetPicture)(GFMxDecH264Handle hMxDecH264, PGFMXDECH264PICTURE pPicture);
+ GF_RETTYPE (* MxDecH264SetSlice)(GFMxDecH264Handle hMxDecH264, PGFMXDECH264SLICE pSlice);
+ GF_RETTYPE (* MxDecH264SetMBs)(GFMxDecH264Handle hMxDecH264, PGFMXDECH264MB pMBs);
+ GF_RETTYPE (* MxDecH264PostProcessing)(GFMxDecH264Handle hMxDecH264, PGFMXDECH264PP pP);
+ GF_RETTYPE (* MxDecH264SetAttribute)(GFMxDecH264Handle hMxDecH264, NvU32 uiFeature, NvU32* pInfo);
+ GF_RETTYPE (* MxDecH264GetAttribute)(GFMxDecH264Handle hMxDecH264, NvU32 uiFeature, NvU32* pInfo);
+ GF_RETTYPE (* MxDecH264Set)(GFMxDecH264Handle hMxDecH264, NvU32 uiFeature, void * pInfo);
+ GF_RETTYPE (* MxDecH264InterruptControl)(GFMxDecH264Handle hMxDecH264,
+ GFMX_DEC_H264_INTERRUPT_TYPE IntType, GFMX_DEC_H264_INTERRUPT_OPERATION_TYPE op,
+ void * pData);
+ GF_RETTYPE (* MxDecH264InterruptHandler)(GFMxDecH264Handle hMxDecH264,
+ GFMX_DEC_H264_INTERRUPT_TYPE IntType, void * pData); // Reserved.
+ GF_RETTYPE (* MxDecH264DSPPoll)(GFMxDecH264Handle hMxDecH264, NvU32 timeout);
+ GF_RETTYPE (* MxDecH264DecSEI)(GFMxDecH264Handle hMxDecH264, PGFMXDECH264DECSEI pSEI);
+ GF_RETTYPE (* MxDecH264DecNewFrameNum)(GFMxDecH264Handle hMxDecH264,NvU8* VideoBuffPtr,NvU32 VideoBufferLength);
+ } GFMXDECH264TABLE, *PGFMXDECH264TABLE;
+
+ /**< Typesafe functions for opening and closing this component.
+ This API also checks for hardware resources needed through GFRmHwResourceConstraint().
+ Trying to open a second video instance will fail due to existing open context.
+ */
+GF_RETTYPE GFMxDecH264Open(GFRmHandle hRm, GFMxDecH264Handle *phMxDecH264,
+ GF_STATE_TYPE state, GFRmChHandle hCh);
+
+ /**< Close the video instance.
+ */
+void GFMxDecH264Close(GFMxDecH264Handle *phMxDecH264);
+
+#if NVCPU_IS_XTENSA
+#define MXDH264OFFSET sizeof(GFMXDECH264TABLE)
+#else
+#define MXDH264OFFSET 0
+#endif
+
+
+ /** GFMxDecH264 error code: GFMxDecH264DecSequence() encountered end of bitstream.
+ @see GFMxDecH264DecSequence()
+ */
+#define GFMXDECH264_ERROR_SEQUENCE_END_OF_FILE (GFMXDH264_ERROR | 0x00000001)
+
+ /** GFMxDecH264 error code: GFMxDecH264DecSequence() bitstream format not supported.
+ The sequence header specifies a bitstream format, that is not supported. Most likely
+ reason for this error is that the H.264 profile is not supported.
+ @see GFMxDecH264DecSequence()
+ */
+#define GFMXDECH264_ERROR_SEQUENCE_NOT_SUPPORTED (GFMXDH264_ERROR | 0x00000002)
+
+ /** GFMxDecH264 error code: GFMxDecH264DecSequence() encountered out of GPU memory error.
+ The application can try to free GPU memory and call GFMxDecH264DecSequence() again.
+ @see GFMxDecH264DecSequence()
+ */
+#define GFMXDECH264_ERROR_SEQUENCE_NOT_ENOUGH_MEM (GFMXDH264_ERROR | 0x00000003)
+
+ /** GFMxDecH264 error code: GFMxDecH264DecPicture() encountered sequence header.
+ The application should call GFMxDecH264DecSequence() in response to this return code,
+ to decode the sequence header.
+ @see GFMxDecH264DecPicture(), GFMxDecH264DecSequence()
+ */
+#define GFMXDECH264_ERROR_PICTURE_DETECTED_SEQUENCE (GFMXDH264_ERROR | 0x00000004)
+
+ /** GFMxDecH264 error code: GFMxDecH264DecPicture() encountered end of bitstream.
+ @see GFMxDecH264DecPicture()
+ */
+#define GFMXDECH264_ERROR_PICTURE_END_OF_FILE (GFMXDH264_ERROR | 0x00000005)
+
+ /** GFMxDecH264 error code: GFMxDecH264DecPicture() encountered an unrecoverable bitstream error.
+ The application should call GFMxDecH264DecPicture() again, MxDecH264 will then
+ scan for the next frame boundary and try to decode this frame.
+ @see GFMxDecH264DecPicture()
+ */
+#define GFMXDECH264_ERROR_PICTURE_CORRUPTED_PICTURE (GFMXDH264_ERROR | 0x00000006)
+
+ /** GFMxDecH264 error code: GFMxDecH264DecPicture() encountered out of GPU memory error.
+ The application can try to free GPU memory and call GFMxDecH264DecPicture() again.
+ @see GFMxDecH264DecPicture()
+ */
+#define GFMXDECH264_ERROR_PICTURE_NOT_ENOUGH_MEM (GFMXDH264_ERROR | 0x00000007)
+
+ /** GFMxDecH264 error code: GFMxDecH264DecPicture() returns status to inform application
+ whether picture parameter set is not initialized, which may happen either when picture
+ parameter set is absent or corrupted. pic_parameter_set_id is checked for negative value.
+ */
+#define GFMXDECH264_ERROR_PICTURE_PARAMETER_SET_NOT_INITIALIZED (GFMXDH264_ERROR | 0x00000008)
+
+ /** GFMxDecH264 error code: GFMxDecH264DecPicture() returns error status to inform application
+ that picture parameter set is corrupted.
+ */
+#define GFMXDECH264_ERROR_PICTURE_PARAMETER_SET_CORRUPTED (GFMXDH264_ERROR | 0x00000009)
+
+ /** GFMxDecH264 error code: GFMxDecH264 API was used in invalid state of the decoder.
+ */
+#define GFMXDECH264_ERROR_INVALID_STATE (GFMXDH264_ERROR | 0x0000000A)
+
+ /** GFMxDecH264 error code: GFMxDecH264DecPicture() returns status to inform application that
+ all the surfaces where it could decode are locked.
+ */
+#define GFMXDECH264_ERROR_PICTURE_ALL_SURFACES_LOCKED (GFMXDH264_ERROR | 0x0000000B)
+
+ /*For DecPic timeout on DSP side.*/
+#define GFMXDECH264_ERROR_MXDEC_PIC_TIMEOUT (GFMXDH264_ERROR + 0x0000000C)
+
+
+ /** GFMxDecH264 error code: GFMxDecH264DecSEI() is not supported in bitstream callback mode.
+ @see GFMxDecH264DecSEI()
+ */
+#define GFMXDECH264_ERROR_SEI_NOT_SUPPORTED_FOR_BITSTREAM_CALLBACK_MODE (GFMXDH264_ERROR | 0x0000000D)
+
+ /** GFMxDecH264 error code: GFMxDecH264DecSEI() encountered end of bitstream.
+ @see GFMxDecH264DecSEI()
+ */
+#define GFMXDECH264_ERROR_SEI_END_OF_FILE (GFMXDH264_ERROR | 0x0000000E)
+
+ /** GFMxDecH264 error code: GFMxDecH264DecSEI() cannot decode this NAL Unit as its not SEI.
+ @see GFMxDecH264DecSEI()
+ */
+#define GFMXDECH264_ERROR_SEI_NOT_SEI_RBSP (GFMXDH264_ERROR | 0x0000000F)
+
+ /** GFMxDecH264 error code: GFMxDecH264DecSEI() Timed out on DSP side.
+ @see GFMxDecH264DecSEI()
+ */
+#define GFMXDECH264_ERROR_SEI_TIMEOUT (GFMXDH264_ERROR | 0x00000010)
+
+ /** GFMxDecH264 error code: GFMxDecH264DecNewFrameNum() cannot decode this NAL Unit as
+ it does not contain frame number information.
+ @see GFMxDecH264DecNewFrameNum()
+ */
+#define GFMXDECH264_ERROR_DECFRAMENUM_NOTSUPPORTED (GFMXDH264_ERROR | 0x00000011)
+
+ /* #### MxDecH264 Helper macros. Maybe useful for backward compatible API. #### */
+
+ /** This function returns version and capabilities of API and hardware.
+
+ @param hMxDecH264 (GFMxDecH264Handle) Handle to MxDecH264 component
+ @param pMXProp (PGFPROPERTY) Pointer to property structure to be filled in
+
+ @retval #GF_SUCCESS \a pJXProp filled in successfully
+ @retval #GF_ERROR Some error occured
+
+ The #GFPROPERTY structure passed with parameter \a pMXProp will be
+ filled in on successfull return. The GFPROPERTY::Capability field
+ will hold a combination of flagbits indicating capabilities specific
+ to the MxDecH264API:
+
+
+ #GF_MXDEC_H264_CAP_BASELINE
+ Baseline profile supported
+ #GF_MXDEC_H264_CAP_MAIN
+ Main profile supported
+ #GF_MXDEC_H264_CAP_EXTENDED
+ Extended profile supported
+ #GF_MXDEC_H264_CAP_LEVEL10
+ LEVEL 1.0 supported
+ #GF_MXDEC_H264_CAP_LEVEL11
+ LEVEL 1.1 supported
+ #GF_MXDEC_H264_CAP_LEVEL12
+ LEVEL 1.2 supported
+ #GF_MXDEC_H264_CAP_LEVEL13
+ LEVEL 1.3 supported
+ #GF_MXDEC_H264_CAP_LEVEL20
+ LEVEL 2.0 supported
+ #GF_MXDEC_H264_CAP_LEVEL21
+ LEVEL 2.1 supported
+ #GF_MXDEC_H264_CAP_LEVEL22
+ LEVEL 2.2 supported
+ #GF_MXDEC_H264_CAP_LEVEL30
+ LEVEL 3.0 supported
+ #GF_MXDEC_H264_CAP_LEVEL31
+ LEVEL 3.1 supported
+ #GF_MXDEC_H264_CAP_LEVEL32
+ LEVEL 3.2 supported
+ #GF_MXDEC_H264_CAP_LEVEL40
+ LEVEL 4.0 supported
+ #GF_MXDEC_H264_CAP_LEVEL41
+ LEVEL 4.1 supported
+ #GF_MXDEC_H264_CAP_LEVEL42
+ LEVEL 4.2 supported
+ #GF_MXDEC_H264_CAP_LEVEL50
+ LEVEL 5.0 supported
+ #GF_MXDEC_H264_CAP_LEVEL51
+ LEVEL 5.1 supported
+ #GF_MXDEC_H264_CAP_DB
+ Post Processing de-blocking supported
+ #GF_MXDEC_H264_CAP_DR
+ Post Processing de-ringing supported
+
+
+ It is a good practice to call this function to query for the API version
+ and its capabilities before using the rest of the MxDecH264API functions.
+
+ @see GFPROPERTY
+ */
+#define GFMxDecH264GetProperty(hMxDecH264, pMXProp) \
+ ((PGFMXDECH264TABLE)((NvU32)hMxDecH264+MXDH264OFFSET))->MxDecH264GetProperty(hMxDecH264, pMXProp)
+
+#define GFMxDecH264GetStatus(hMxDecH264, pStatus) \
+ ((PGFMXDECH264TABLE)((NvU32)hMxDecH264+MXDH264OFFSET))->MxDecH264GetStatus(hMxDecH264, pStatus)
+
+ /** Decode sequence header.
+
+ @param hMxDecH264 (GFMxDecH264Handle) Handle to MxDecH264 component
+ @param pSequence (PGFMXDECH264DECSEQUENCE) Pointer to #GFMXDECH264DECSEQUENCE parameter structure
+
+ @retval GF_SUCCESS Sequence header was decoded successfully
+
+ NAL units with nal_unit_type = 7 should be passed to GFMxDecH264DecSequence(). Such NAL units
+ contain Sequence Parameter Set (SPS). The nal_ref_idc should be a non-zero value.
+
+ This function will be called whenever a sequence header is found in the bitstream, decode
+ it and return its characteristics.
+
+ @see GFMXDECH264DECSEQUENCE
+ */
+#define GFMxDecH264DecSequence(hMxDecH264, pSequence)\
+ ((PGFMXDECH264TABLE)((NvU32)hMxDecH264+MXDH264OFFSET))->MxDecH264DecSequence(hMxDecH264, pSequence)
+
+ /** Decode a picture.
+
+ @param hMxDecH264 (GFMxDecH264Handle) Handle to MxDecH264 component
+ @param pPicture (PGFMXDECH264DECPICTURE) Pointer to #GFMXDECH264DECPICTURE parameter structure
+
+ @retval GF_SUCCESS Frame was decoded successfully
+ @retval GFMXDECH264_ERROR_PICTURE_DETECTED_SEQUENCE Sequence header detected
+ @retval GFMXDECH264_ERROR_PICTURE_END_OF_FILE End of stream encountered
+ @retval GFMXDECH264_ERROR_PICTURE_CORRUPTED_PICTURE Unrecoverable bitstream error during frame decode
+ @retval GFMXDECH264_ERROR_PICTURE_NOT_ENOUGH_MEM Out of GPU memory
+
+ All NAL units with nal_unit_type other than 7, should be passed to GFMxDecH264DecPicture().
+ In specific, for nal_unit_type value as 8, the NAL Unit contains a Picture Parameter Set (PPS) and
+ for nal_unit_type ranging between 1 and 5, the NAL units contain coded slices.
+
+ GFMxDecH264DecPicture decodes one picture from the bit stream. If GFMxDecH264DecPicture detects an
+ error, it will perform error concealment. If the error is not concealable, GFMxDecH264DecPicture returns
+ the error back to the application.
+ If the current stream position is not on the start of a frame, the function scans forward until a frame
+ start or sequence header is detected.
+
+ For actions to take on the particular return codes, refer to the return code documentation.
+
+ @see GFMXDECH264DECPICTURE
+ */
+#define GFMxDecH264DecPicture(hMxDecH264, pPicture)\
+ ((PGFMXDECH264TABLE)((NvU32)hMxDecH264+MXDH264OFFSET))->MxDecH264DecPicture(hMxDecH264, pPicture)
+
+
+ /** Decode a SEI rbsp.
+
+ @param hMxDecH264 (GFMxDecH264Handle) Handle to MxDecH264 component
+ @param pSEI (PGFMXDECH264DECSEI) Pointer to #GFMXDECH264DECSEI parameter structure
+
+ @retval GF_SUCCESS SEI rbsp was decoded successfully
+ @retval GFMXDECH264_ERROR_SEI_NOT_SUPPORTED_FOR_BITSTREAM_CALLBACK_MODE This API is not supported in bitstream callback mode
+ @retval GFMXDECH264_ERROR_PICTURE_END_OF_FILE End of stream encountered
+ @retval GFMXDECH264_ERROR_SEI_NOT_SEI_RBSP cannot decode this NAL Unit as its not SEI
+
+ All NAL units with nal_unit_type 6 can be passed to GFMxDecH264DecSEI() for decoding in prefill mode.
+
+ GFMxDecH264DecSEI decodes SEI rbsp.
+
+ For actions to take on the particular return codes, refer to the return code documentation.
+
+ @see GFMXDECH264DECSEI
+ */
+#define GFMxDecH264DecSEI(hMxDecH264, pSEI)\
+ ((PGFMXDECH264TABLE)((NvU32)hMxDecH264+MXDH264OFFSET))->MxDecH264DecSEI(hMxDecH264, pSEI)
+
+
+ /** Decode slice header and extract framenumber.
+
+ @param hMxDecH264 (GFMxDecH264Handle) Handle to MxDecH264 component
+ @param VideoBuffPtr Pointer to bitstream
+ @param VideoBufferLength Length of bitstream data available in the buffer
+
+ @retval framenum Framenumber of current nal unit data
+ @retval GFMXDECH264_ERROR_DECFRAMENUM_NOTSUPPORTED Nal unit type not supported
+
+ NAL units with nal_unit_type 1 and 5 can be passed to parse slice header and extract
+ framenumber.
+ This function can be used in prefill buffer mode to find all nal units which
+ belongs to same frame before calling GFMxDecH264DecPicture.
+
+ */
+
+
+#define GFMxDecH264DecNewFrameNum(hMxDecH264,VideoBuffPtr,VideoBufferLength) \
+ ((PGFMXDECH264TABLE)((NvU32)hMxDecH264+MXDH264OFFSET))->MxDecH264DecNewFrameNum(hMxDecH264,VideoBuffPtr,VideoBufferLength)
+
+
+#define GFMxDecH264SetSequence(hMxDecH264, pSequence)\
+ ((PGFMXDECH264TABLE)((NvU32)hMxDecH264+MXDH264OFFSET))->MxDecH264SetSequence(hMxDecH264, pSequence)
+
+#define GFMxDecH264SetPicture(hMxDecH264, pPicture)\
+ ((PGFMXDECH264TABLE)((NvU32)hMxDecH264+MXDH264OFFSET))->MxDecH264SetPicture(hMxDecH264, pPicture)
+
+#define GFMxDecH264SetSlice(hMxDecH264, pSlice)\
+ ((PGFMXDECH264TABLE)((NvU32)hMxDecH264+MXDH264OFFSET))->MxDecH264SetSlice(hMxDecH264, pSlice)
+
+#define GFMxDecH264SetMBs(hMxDecH264, pMBs) \
+ ((PGFMXDECH264TABLE)((NvU32)hMxDecH264+MXDH264OFFSET))->MxDecH264SetMBs(hMxDecH264, pMBs)
+
+/** Post Processing on a decoded YUV surface.
+ @param hMxDecH264 (GFMxDecH264Handle) Handle to MxDecH264 component
+ @param pP (PGFMXDECH264PP) Pointer to #GFMXDECH264PP parameter structure
+
+ @retval GF_SUCCESS Applied post processing on decoded surface successfully
+
+ GFMxDecH264PostProcessing() function can perform DeRinging and DeBlocking or DeBlocking only on a decoded YUV surface data.
+
+ GFMXDECH264DECSEQUENCE::PictureInfo output flagbit (GF_MXDEC_H264_DEC_PICTURE_DEBLOCKING_FILTER)
+ is set by the API if H264 bit stream does not have in-the-loop DeBlocking.
+ This means app can perform out-of-the-loop DeBlocking by calling GFMxDecH264PostProcessing().
+ If H264 bit stream has in-the-loop processing then hardware H264 decoder will perform in-the-loop DeBlokcing
+ and API resets this flag to zero to indicate that app should not perform DeBlocking.
+
+ GFMxDecH264PostProcessing can be called any time. we need decoded YUV surface data and Qp values for each MB.
+ If video is decoded by our hardware decoder then Qp values are saved in the internal SRAM for the last frame.
+
+
+ @see GFMXDECH264PP
+
+*/
+
+
+
+#define GFMxDecH264PostProcessing(hMxDecH264, pP) \
+ ((PGFMXDECH264TABLE)((NvU32)hMxDecH264+MXDH264OFFSET))->MxDecH264PostProcessing(hMxDecH264, pP)
+
+#define GFMxDecH264SetAttribute(hMxDecH264, uiFeature, pInfo) \
+ ((PGFMXDECH264TABLE)((NvU32)hMxDecH264+MXDH264OFFSET))->MxDecH264SetAttribute(hMxDecH264, uiFeature, pInfo)
+
+#define GFMxDecH264GetAttribute(hMxDecH264, uiFeature, pInfo) \
+ ((PGFMXDECH264TABLE)((NvU32)hMxDecH264+MXDH264OFFSET))->MxDecH264GetAttribute(hMxDecH264, uiFeature, pInfo)
+
+ /** Set various runtime parameters.
+
+ @param hMxDecH264 (GFMxDecH264Handle) Handle to MxDecH264 component
+ @param uiFeature (NvU32) ID of feature to set
+ @param pInfo (void*) Feature specific data
+
+ @retval GF_SUCCESS Success
+ @retval GF_FAILURE Failure
+
+ The following features identified by parameter \a uiFeature can be set, see documentation
+ for the individual \a uiFeature IDs for interpretation of data in parameter \a pInfo:
+
+ uiFeature Meaning pInfo interpretation
+ #GF_MXDEC_H264_SET_READBITSTREAM
+ Set up a stream callback function.GFMxDec calls
+ that callback function to request a portion of the bit stream from the application.
+ #GFMXDECH264CALLBACK *
+ #GF_MXDEC_H264_SET_SURFACE_LIST
+ Set a list of surfaces for to be used to store reference and decode frames.
+ #GFMXDECH264SURFLIST *
+ #GF_MXDEC_H264_SET_UNLOCK_SURFACE
+ Unlock one or all locked surface.
+ NvS32
+
+ */
+#define GFMxDecH264Set(hMxDecH264, uiFeature, pInfo) \
+ ((PGFMXDECH264TABLE)((NvU32)hMxDecH264+MXDH264OFFSET))->MxDecH264Set(hMxDecH264, uiFeature, pInfo)
+
+#define GFMxDecH264InterruptControl(hMxDecH264, IntType, op, pData)\
+ ((PGFMXDECH264TABLE)((NvU32)hMxDecH264+MXDH264OFFSET))->MxDecH264InterruptControl(hMxDecH264, IntType, op, pData)
+
+#define GFMxDecH264InterruptHandler(hMxDecH264, IntType, pData)\
+ ((PGFMXDECH264TABLE)((NvU32)hMxDecH264+MXDH264OFFSET))->MxDecH264InterruptHandler(hMxDecH264, IntType, pData)
+
+#define GFMxDecH264DSPPoll(MxHandle, timeout)\
+ ((PGFMXDECH264TABLE)((NvU32)MxHandle+MXDH264OFFSET))->MxDecH264DSPPoll(MxHandle, timeout)
+
+ //Use the following flags in the setattribute function for the picture boundary mode.
+ //If you wish to send the sequence header separately from the first frame use the first flag(SEPARATE_SEQUENCE_HEADER)
+ //else use the second flag.
+#define GFMXDECH264_SEPARATE_SEQUENCE_HEADER 0x1
+#define GFMXDECH264_COMBINED_SEQUENCE_HEADER 0x2
+
+
+ /*@}*/
+
+ /** @page pageMxDecH264AppNotes MxDecH264API Application Notes
+
+ @section pageMxDecH264AppNotes1 Programming Sequence
+
+ Todo
+
+ @section pageMxDecH264AppNotes2 Decode Surface Locking
+
+ The H264 decoder can operate in a surface locking mode, which is activated by
+ attribute #GF_MXDEC_H264_ATTR_SURFACE_LOCKING. In this mode, GFMxDecH264DecPicture()
+ will automatically 'lock' the current surface with the decoded frame, and exclude it
+ from its surface pool available for decoding new frames.
+
+ Surface locking is intended for usecases, were the decode surface is directly used as overlay.
+ For the duration it is displayed as overlay, the locked state ensures, that it won't be
+ overwritten. With this mechanism H264 decode and screen update can run in independent thread
+ contexts.
+
+ If a surface from the pool is locked, it can still be used as a reference frame.
+ However it will never be reused and overwritten during a succeeding call to
+ GFMxDecH264DecPicture().
+
+ The application can re-add the locked surface to the set of writable surfaces by
+ calling GFMxDecH264Set / GF_MXDEC_H264_SET_UNLOCK_SURFACE.
+
+ A locked surface is identified on return from GFMxDecH264DecPicture() via
+ GFMXDECH264DECPICTURE::ReconSurfaceNumber. This ID needs to be passed later to
+ GF_MXDEC_H264_SET_UNLOCK_SURFACE to perform the unlocking.
+
+ The application has to ensure that at least + 1 surfaces
+ in the pool stay unlocked. If GFMxDecH264DecPicture() is called with unsufficient
+ free surfaces, error GFMXDECH264_ERROR_PICTURE_ALL_SURFACES_LOCKED will be returned.
+
+ The number of surfaces set via GFMxDecH264Set / GF_MXDEC_H264_SET_SURFACE_LIST /
+ GFMXDECH264SURFLIST::surfList must be at least N+1+M, where N is the number of reference
+ frames and M the maximum allowed number of simulteneously locked surfaces.
+
+ The lock-state of all surfaces can be reset via GFMxDecH264Set / GF_MXDEC_H264_SET_UNLOCK_SURFACE
+ passing -1 as surface ID.
+ */
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
diff --git a/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFMxDecRV9.h b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFMxDecRV9.h
new file mode 100755
index 00000000..a341d500
--- /dev/null
+++ b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFMxDecRV9.h
@@ -0,0 +1,853 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/** @file GFMxDecRV9.h
+ GFSDK RV9 Decode API header file.
+*/
+
+#ifndef _GF_MPEG_DEC_RV9__
+#define _GF_MPEG_DEC_RV9__
+
+#include "nvtypes.h"
+#include "GFVx.h"
+
+#ifdef __cplusplus
+extern "C" { // only need to export C interface if
+ // used by C++ source code
+#endif
+/** @addtogroup group MxDecRV9API
+*/
+/*@{*/
+
+
+// MXDECRV9 CapabilityEx Flag
+#define GF_MXDEC_RV9_CAPEx_USE_DSP 0x00000001
+// Whenever DSP is used for decoding
+// Surace type should be = GF_SURFACE_VIDEO_MEMORY
+// Surface hint type = GF_MEMORY_HINT_BOTTOM_UP
+// In case of Host Used for decoding
+// Surace type = GF_SURFACE_SYSTEM_MEMORY
+// Surface hint type = 0
+// MXDECRV9CapFlags
+/************************************************************************************************************/
+
+/** Argument "GFPROPERTY pMXProp" for MxDecRV9GetProperty().\n
+ Application returns the properties, in GFPROPERTY structure \n
+@see GFMXDECRV9TABLE::MxDecRV9GetProperty , GFPROPERTY::Capability
+*/
+#define GF_MXDEC_RV9_CAP_SIMPLE 0x00000001
+
+/** Argument "GFPROPERTY pMXProp" for MxDecRV9GetProperty().\n
+ Application returns the properties, in GFPROPERTY structure \n
+@see GFMXDECRV9TABLE::MxDecRV9GetProperty , GFPROPERTY::Capability
+*/
+#define GF_MXDEC_RV9_CAP_MEDIUM 0x00000002
+
+/** Argument "GFPROPERTY pMXProp" for MxDecRV9GetProperty().\n
+ Application returns the properties, in GFPROPERTY structure \n
+@see GFMXDECRV9TABLE::MxDecRV9GetProperty , GFPROPERTY::Capability
+*/
+#define GF_MXDEC_RV9_CAP_COMPLEX 0x00000004
+
+/** Argument "GFPROPERTY pMXProp" for MxDecRV9GetProperty().\n
+ Application returns the properties, in GFPROPERTY structure \n
+@see GFMXDECRV9TABLE::MxDecRV9GetProperty , GFPROPERTY::Capability
+*/
+#define GF_MXDEC_RV9_CAP_LEVEL1 0x00000100
+
+/** Argument "GFPROPERTY pMXProp" for MxDecRV9GetProperty().\n
+ Application returns the properties, in GFPROPERTY structure \n
+@see GFMXDECRV9TABLE::MxDecRV9GetProperty , GFPROPERTY::Capability
+*/
+#define GF_MXDEC_RV9_CAP_LEVEL2 0x00000200
+
+/** Argument "GFPROPERTY pMXProp" for MxDecRV9GetProperty().\n
+ Application returns the properties, in GFPROPERTY structure \n
+@see GFMXDECRV9TABLE::MxDecRV9GetProperty , GFPROPERTY::Capability
+*/
+#define GF_MXDEC_RV9_CAP_LEVEL3 0x00000400
+
+/** Argument "GFPROPERTY pMXProp" for MxDecRV9GetProperty().\n
+ Application returns the properties, in GFPROPERTY structure \n
+@see GFMXDECRV9TABLE::MxDecRV9GetProperty , GFPROPERTY::Capability
+*/
+#define GF_MXDEC_RV9_CAP_LEVEL4 0x00000800
+
+/** Argument "GFPROPERTY pMXProp" for MxDecRV9GetProperty().\n
+ Application returns the properties, in GFPROPERTY structure \n
+@see GFMXDECRV9TABLE::MxDecRV9GetProperty , GFPROPERTY::Capability
+*/
+#define GF_MXDEC_RV9_CAP_DB 0x00001000
+
+/** Argument "GFPROPERTY pMXProp" for MxDecRV9GetProperty().\n
+ Application returns the properties, in GFPROPERTY structure \n
+@see GFMXDECRV9TABLE::MxDecRV9GetProperty , GFPROPERTY::Capability
+*/
+#define GF_MXDEC_RV9_CAP_DR 0x00002000
+/*********************************************************************************************************************/
+
+
+
+ /** This structure holds various informations each of the frame to be decoded .
+This structure is passed as parameter to GFMXDECRV9TABLE::MxDecRV9DecodeFrame.
+*/
+
+typedef struct _GFMXDECRV9FRAME
+{
+
+
+ NvU32 uiFrameOption; /**< uiFrameOption values
+
+ #GF_MXDEC_RV9_DEC_FRAME_SPECIFY_SURF_RECT
+ specify rect area to hold the reconstructed image.
+
+ */
+ PGFRECT pFrameRect; /**< not in use */
+ NvU32 uiFrameType; /**< set new frame type information
+
+ #GF_MXDEC_RV9_DISPLAY_FRAME
+ #GF_MXDEC_RV9_KEY_FRAME
+ #GF_MXDEC_RV9_P_FRAME
+ #GF_MXDEC_RV9_B_FRAME
+ #GF_MXDEC_RV9_DONT_DISPLAY_FRAME
+ #GF_MXDEC_RV9_ERRONEOUS_FRAME
+
+ */
+ PGFRMSURFACE pReconstructedSurf;/**< This is the surface to hold the decoded picture */
+ NvU32 uiFrameSequenceCount; /**< set by GFMxDecRV9API */
+ NvU32 uiTimeStamp; /**< in terms of millisecond */
+ NvU8* pPreFillBuffer; /**< Input, Pointer bitstream for frame to decode */
+ NvU32 PreFillBufferLength; /**< Input, Length of bitstream in bytes, must cover the entire frame */
+
+}GFMXDECRV9FRAME, *PGFMXDECRV9FRAME;
+
+//uiFrameOption
+/******************************************************************************************/
+/** uiFrameOption for GFMXDECRV9FRAME passed as an argument in MxDecRV9DecodeFrame(). \n
+specify rect area to hold the reconstructed image.\n
+@see GFMXDECRV9FRAME, GFMXDECRV9TABLE::MxDecRV9DecodeFrame.
+*/
+#define GF_MXDEC_RV9_DEC_FRAME_SPECIFY_SURF_RECT 0x00000001
+
+//uiFrameType values
+
+/******************************************************************************************/
+/** uiFrameType values for GFMXDECRV9FRAME set by MxDecRV9DecodeFrame(). \n
+
+@see GFMXDECRV9FRAME, GFMXDECRV9TABLE::MxDecRV9DecodeFrame
+*/
+#define GF_MXDEC_RV9_DISPLAY_FRAME 0x0
+
+/** uiFrameType values for GFMXDECRV9FRAME set by MxDecRV9DecodeFrame(). \n
+ The decoded Frame is I-frame.
+@see GFMXDECRV9FRAME, GFMXDECRV9TABLE::MxDecRV9DecodeFrame
+*/
+#define GF_MXDEC_RV9_KEY_FRAME 0x1
+
+/** uiFrameType values for GFMXDECRV9FRAME set by MxDecRV9DecodeFrame(). \n
+The Decoded Frame is P-frame.
+@see GFMXDECRV9FRAME, GFMXDECRV9TABLE::MxDecRV9DecodeFrame
+*/
+#define GF_MXDEC_RV9_P_FRAME 0x2
+
+/** uiFrameType values for GFMXDECRV9FRAME set by MxDecRV9DecodeFrame(). \n
+ The decoded Frame is B-frame.
+@see GFMXDECRV9FRAME, GFMXDECRV9TABLE::MxDecRV9DecodeFrame
+*/
+#define GF_MXDEC_RV9_B_FRAME 0x4
+
+/** uiFrameType values for GFMXDECRV9FRAME passed as an argument in MxDecRV9DecodeFrame(). \n
+
+@see GFMXDECRV9FRAME, GFMXDECRV9TABLE::MxDecRV9DecodeFrame
+*/
+#define GF_MXDEC_RV9_DONT_DISPLAY_FRAME 0x8
+
+/** uiFrameType values for GFMXDECRV9FRAME passed as an argument in MxDecRV9DecodeFrame(). \n
+ Decode frame is Erroneous
+@see GFMXDECRV9FRAME, GFMXDECRV9TABLE::MxDecRV9DecodeFrame
+*/
+#define GF_MXDEC_RV9_ERRONEOUS_FRAME 0x16
+/***********************************************************************************************************************/
+
+/** This structure holds various informations needed for Post Processing of decoded frame .
+This structure is passed as parameter to MxDecRV9PostProcessing().
+*/
+typedef struct _GFMXDECRV9PP
+{
+ PGFRMSURFACE pPPSurf;
+ /**< pointer to surface that will
+ hold the result from Post Processing
+ */
+ PGFRECT pPPRect;
+ /**< Rectangle area to be processed for both
+ source and destination surface
+ */
+
+ PGFRMSURFACE pSrcSurf;
+ /**< pointer to surface that will
+ hold the result from Post Processing
+ */
+ PGFRECT pSrcRect;
+ /**< Rectangle area to be processed for both
+ source and destination surface
+ */
+} GFMXDECRV9PP, *PGFMXDECRV9PP;
+
+// PPOption
+#define GF_MXDEC_RV9_PP_SM_OFF 0x0 //Turn OFF Smoothing filter for this frame
+#define GF_MXDEC_RV9_PP_SM_ON 0x1 //Turn ON Smoothing filter for this frame
+#define GF_MXDEC_RV9_PP_DR_ON 0x2 //Turn ON DeRinging filter for this frame
+
+
+// Hardware Status
+/************************************************************************************************************/
+
+#define GF_DECODER_FRAME_DONE 0x00000010
+
+
+
+#define GF_DECODER_PP_FRAME_DONE 0x00000020
+
+/*********************************************************************************************************/
+#define GF_DECODER_PP_FRAME_RV9 0x00000040//
+
+
+/** Attribute MxDecRV9Set::uiFeature.\n
+ Application sets this attribute to register a callback function and
+ its correpnding parameter to read bitstream data .
+@see GFMXDECRV9TABLE::MxDecRV9Set, pInfo should be a pointer to PGFMXDECRV9CALLBACK \n
+*/
+#define GF_MXDEC_RV9_SET_READBITSTREAM 0x1
+
+
+
+/** Attribute MxDecRV9Set::uiFeature \n
+ This will setup the surface list, including all of the ref surface and one reconstructed one. \n
+@see GFMXDECRV9TABLE::MxDecRV9Set, pInfo should a pointer PGFMXDECRV9SURFLIST
+*/
+#define GF_MXDEC_RV9_SET_SURFACE_LIST 0x2
+
+
+
+/** Attribute MxDecRV9Set::uiFeature \n
+ This will Set the GFMxDecRV9API to decode the RV8 stream
+ By default GFMxDecRV9API will assume the stream to be RV9 stream\n
+@see GFMXDECRV9TABLE::MxDecRV9Set
+*/
+#define GF_MXDEC_RV9_BITSTREAM_RV8 0x4
+
+
+/** Attribute GFMxDecRV9SetAttribute::uiFeature and GFMxDecRV9GetAttribute::uiFeature \n
+ Application will determine the decoding boundary, for RV9, this boundary means VOL
+ and VOP boundary. For certain file formats, those boundary information are
+ stored in the video file, APP can easily use those information to determine
+ the boundary.
+ If APP wants API to detect the boundary,App should not disable this attribute. This is mainly for streaming case, APP does
+ not have those handy boundary information. API will automatically detects those
+ boundaries. APP does not need to parse the bitstream to detect those boundaries.\n
+ *pInfo: 1: APP will determine the decoding boudary\n
+ *pInfo: 0: APP will not determine the decoding boundary \n
+@see GFMXDECRV9TABLE::MxDecRV9SetAttribute
+*/
+#define GF_MXDEC_RV9_ATTR_PRE_DETERMINED_BOUNDARY 0x00000001
+
+
+
+/** Attribute GFMxDecRV9GetAttribute::uiFeature \n
+ This attribute only can be used for GFMxDecGetAttribute
+ If application wants to set pDestRect in GFMXDECVOP or GFMXDECMP4DECVOP,
+ application must use this attributes to get allignment information and
+ align the rectangle top & left corner accordinately.\n
+ *pInfo: top fieled alignment in term of lines \n
+@see GFMXDECRV9TABLE::MxDecRV9GetAttribute
+*/
+#define GF_MXDEC_ATTR_RV9_DEC_FRAME_RECT_TOP_ALIGNMENT 0x00000002
+
+
+
+/** Attribute GFMxDecRV9GetAttribute::uiFeature \n
+ This attribute only can be used for GFMxDecGetAttribute
+ If application wants to set pDestRect in GFMXDECVOP or GFMXDECMP4DECVOP,
+ application must use those attributes to get allignment information and
+ align the rectangle top & left corner accordinately.\n
+ *pInfo: left fieled alignment in term of pixels\n
+
+@see GFMXDECRV9TABLE::MxDecRV9GetAttribute
+*/
+#define GF_MXDEC_ATTR_RV9_DEC_FRAME_RECT_LEFT_ALIGNMENT 0x00000003
+
+
+/** Attribute GFMxDecRV9SetAttribute::uiFeature and GFMxDecRV9GetAttribute::uiFeature \n
+ Application will fill the buffer and push the data to the decoder.
+*/
+#define GF_MXDEC_RV9_ATTR_PREFILLBUFFER 0x00000008
+
+/********************************************************************************************************/
+
+/** Structure holding the callback function pointer.
+Used in registering the callback function
+The callback function is a function which the API calls to request a portion of the bit stream from the application.
+@see GFMXDECRV9TABLE::MxDecRV9Set
+*/
+
+
+
+typedef struct _GFMXDECRV9CALLBACK
+{
+ void *pPara;/**< pPara is a parameter passed from APP,
+ and APP wants API to call back with this parameter
+ */
+ NvU32 (*pCallBack)(void * pPara, NvU8 ** ppBuffer, NvU32 * BufferLength,NvU32 uFlag);
+ /**< Application callback function pointer.
+ Register a callback function for fetching RV9 data.
+
+ @param *pPara Parameter to pass on to application callback function
+ @param ppBuffer Buffer Pointer
+ @param BufferLength Parameter to pass on to application callback function
+
+ If APP set GF_MXDEC_RV9_ATTR_PRE_DETERMINED_BOUNDARY,
+ APP should return GF_MXDEC_RV9HD_BOUNDARY_REACHED when the boundary is
+ detected.
+ If APP does not set GF_MXDEC_RV9_ATTR_PRE_DETERMINED_BOUNDARY,
+ 0 should be returned.
+ */
+
+}GFMXDECRV9CALLBACK, *PGFMXDECRV9CALLBACK;
+
+#define GF_MXDEC_RV9HD_ENDOFFILE 0x00000200
+#define GF_MXDEC_RV9HD_APP_DETECT_BOUNDARY 0x00001000
+#define GF_MXDEC_RV9HD_BOUNDARY_REACHED 0x00002000
+#define GF_MXDEC_RV9HD_ENDOFFILE_REACHED 0x00004000
+#define GF_MXDEC_RV9HD_APP_PREFILLBUFFER 0x00008000
+#define GF_MXDEC_RV9HD_BEGININGOFFILE_REACHED 0x00010000
+
+
+
+/** MxDecRV9API GFMXDECRV9CALLBACK::(*pCallBack)(, , ,uFlag)\n
+ for reading bitstream in forward direction
+@see GFMXDECRV9CALLBACK
+*/
+#define GF_MXDEC_RV9_READ_BITSTREAM_FORWARD 0x00000002
+
+/** MxDecRV9API GFMXDECRV9CALLBACK::(*pCallBack)(, , ,uFlag) \n
+ for reading bitstream in reverse direction.
+@see GFMXDECRV9CALLBACK
+*/
+#define GF_MXDEC_RV9_READ_BITSTREAM_BACKWARD 0x00000003
+
+//Resync options :
+
+/** MxDecRV9API GFMxDecRV9Resync( ,ResyncOption)\n
+ Resynchronize forward to the nearest I frame. If the GFMxDecRV9API is right
+ before an I frame, GFMxDecRV9Resync() returns immediately. Otherwise,
+ GFMxDecRV9Resync() moves forward, parsing bits until it reaches the first bit of the next I frame.
+@see ResyncOption, GFMXDECRV9TABLE::MxDecRV9Resync
+*/
+
+#define GF_MXDEC_RV9_RESYNC_FORWARD_NEAREST_I_FRAME 0x00000001
+
+/** MxDecRV9API GFMxDecRV9Resync(,ResyncOption)\n
+ Resynchronize backward to the nearest I frame.
+ GFMxDecRV9Resync() moves backward, parsing bits until it reaches the first bit of the previous I frame.
+@see ResyncOption, GFMXDECRV9TABLE::MxDecRV9Resync
+*/
+#define GF_MXDEC_RV9_RESYNC_BACKWARD_NEAREST_I_FRAME 0x00000002
+
+/** MxDecRV9API GFMxDecRV9Resync(,ResyncOption)\n
+ Resynchronize backward to the nearest P frame.
+ GFMxDecRV9Resync() moves backward, parsing bits until it reaches the first bit of the previous P frame.
+@see ResyncOption, GFMXDECRV9TABLE::MxDecRV9Resync
+*/
+#define GF_MXDEC_RV9_RESYNC_BACKWARD_NEAREST_P_FRAME 0x00000004
+
+
+
+/** this macro is used in GFMXDECRV9SURFLIST structure \n
+ Reference surfaces for RV9 decoder. */
+#define GF_MXDEC_RV9_NUM_SURFACES 3
+
+/** This structure is used to Set up a list of surfaces for RV9
+ decoder .
+*/
+
+typedef struct _GFMXDECRV9SURFLIST
+{
+
+ PGFRMSURFACE SurfList[GF_MXDEC_RV9_NUM_SURFACES];
+ /**< an array of PGFRMSURFACE
+ @see #GF_MXDEC_RV9_NUM_SURFACES
+ */
+
+
+}GFMXDECRV9SURFLIST, *PGFMXDECRV9SURFLIST;
+
+/** This structure is passed to MxDecRV9DecodePictureHeader() function, which sets
+ different fields of this structure.
+*/
+typedef struct _GFMXDECRV9PICHDR
+{
+ NvU32 uiRV8StreamInfo;
+ /**< set by GFMxDecRV9API. Valid only if it is RV8 stream
+
+ #GF_MXDEC_RV8_UMV
+ Unrestricted Motion Vector
+ #GF_MXDEC_RV8_DF
+ In loop Deblocking filter
+ #GF_MXDEC_RV8_SS
+ Slice Structured
+ #GF_MXDEC_RV8_RPR
+ Reference Picture Resampling
+ #GF_MXDEC_RV8_ROUND
+ Round off for half pixel motion compensation
+
+ */
+ NvU32 uiRV9StreamInfo;
+ /**< set by GFMxDecRV9API. Valid only if it is RV9 stream
+
+ #GF_MXDEC_RV9_INTERLACE
+ Interlaced mode used
+ #GF_MXDEC_RV9_DF_PASS_THRU
+ In loop Deblocking filter is disabled
+
+ */
+ NvU32 uiWidth; /**< Video width */
+ NvU32 uiHeight; /**< Video height */
+ NvU32 uiTR; /**< Temporal reference in milliseconds */
+
+}GFMXDECRV9PICHDR, *PGFMXDECRV9PICHDR;
+
+//uiRV8StreamInfo
+
+/** MxDecRV9API GFMXDECRV9PICHDR::uiRV8StreamInfo \n
+ Unrestricted Motion Vector.
+@see GFMXDECRV9PICHDR, GFMXDECRV9TABLE::MxDecRV9DecodePictureHeader
+*/
+#define GF_MXDEC_RV8_UMV 0x00000001
+
+/** MxDecRV9API GFMXDECRV9PICHDR::uiRV8StreamInfo \n
+ In loop Deblocking filter.
+@see GFMXDECRV9PICHDR, GFMXDECRV9TABLE::MxDecRV9DecodePictureHeader
+*/
+#define GF_MXDEC_RV8_DF 0x00000002
+
+/** MxDecRV9API GFMXDECRV9PICHDR::uiRV8StreamInfo\n
+ Slice Structured.
+@see GFMXDECRV9PICHDR, GFMXDECRV9TABLE::MxDecRV9DecodePictureHeader
+*/
+#define GF_MXDEC_RV8_SS 0x00000004
+
+/** MxDecRV9API GFMXDECRV9PICHDR::uiRV8StreamInfo \n
+ Reference Picture Resampling.
+@see GFMXDECRV9PICHDR, GFMXDECRV9TABLE::MxDecRV9DecodePictureHeader
+*/
+#define GF_MXDEC_RV8_RPR 0x00000008
+
+/** MxDecRV9API GFMXDECRV9PICHDR::uiRV8StreamInfo \n
+ Round off for half pixel motion compensation.
+@see GFMXDECRV9PICHDR, GFMXDECRV9TABLE::MxDecRV9DecodePictureHeader
+*/
+#define GF_MXDEC_RV8_ROUND 0x00000010
+
+//uiRV9StreamInfo
+
+/** MxDecRV9API GFMXDECRV9PICHDR::uiRV9StreamInfo \n
+ Interlaced mode used.
+@see GFMXDECRV9PICHDR, GFMXDECRV9TABLE::MxDecRV9DecodePictureHeader
+*/
+#define GF_MXDEC_RV9_INTERLACE 0x00000001
+
+/** MxDecRV9API GFMXDECRV9PICHDR::uiRV9StreamInfo \n
+ In loop Deblocking filter is disabled.
+@see GFMXDECRV9PICHDR, GFMXDECRV9TABLE::MxDecRV9DecodePictureHeader
+*/
+#define GF_MXDEC_RV9_DF_PASS_THRU 0x00000002
+
+//resync options
+//TBD
+
+//when GF_ERROR is return check the following flag
+#define GF_MXDEC_RV9_BAD_MB 0x00010000 //there is at least one MB is wrong
+ //if APP set up pMBInfo, APP can check which MB is wrong
+
+/** MxDecRV9API interrupt operation types.
+Constants to specify operation for a call to MxDecRV9InterruptControl().
+@see GF_MXDEC_RV9_INTERRUPT_OPERATION_TYPE, GFMXDECRV9TABLE::MxDecRV9InterruptControl
+*/
+typedef enum
+{
+ /** Enable interrupt/status assertion for an interrupt type. */
+ GF_MXDEC_RV9_INTERRUPT_ENABLE,
+
+ /** Disable interrupt/status assertion for an interrupt type. */
+ GF_MXDEC_RV9_INTERRUPT_DISABLE,
+
+ /** Clear interrupt/status assertion for an interrupt type. */
+ GF_MXDEC_RV9_INTERRUPT_CLEAR
+} GF_MXDEC_RV9_INTERRUPT_OPERATION_TYPE; // Interrupt operation.
+
+
+
+/** MxDecRV9API interrupt types.
+@see GF_MXDEC_RV9_INTERRUPT_TYPE, GFMXDECRV9TABLE::MxDecRV9InterruptControl and GFMXDECRV9TABLE::MxDecRV9InterruptHandler
+*/
+typedef enum
+{
+ /** Interrupt type is DSP Command Interrupt */
+ GF_MXDEC_RV9_DSP_COMMAND_INTR,
+
+ /** Interrupt type Post Processing done */
+ GF_MXDEC_RV9_POST_PROCESSING_DONE_INTR,
+
+ /** Interrupt type is Decoding done Interrupt */
+ GF_MXDEC_RV9_DECODE_DONE_INTR
+} GF_MXDEC_RV9_INTERRUPT_TYPE;
+
+/** MxDecRV9API virtual function pointer table. */
+typedef struct _GFMXDECRV9TABLE
+{
+
+ /** This function returns version and capabilities of API and hardware.
+
+ @param hMxDecRV9 (GFMxDecRV9Handle) Handle specific to MxDecRV9API
+ @param pMXProp (PGFPROPERTY) Pointer to GFPROPERTY structure to be filled in
+
+ @retval GF_SUCCESS \a pMXProp filled in successfully
+ @retval GF_ERROR Some error occured
+
+ The GFPROPERTY structure passed with parameter \a pMXProp will be
+ filled in on successfull return. The GFPROPERTY::Capability field
+ will hold a combination of flagbits indicating capabilities specific
+ to the MxDecRV9API:
+
+
+ #GF_MXDEC_RV9_CAP_SIMPLE
+ support simple profile.
+ #GF_MXDEC_RV9_CAP_MEDIUM
+ support medium profile.
+ #GF_MXDEC_RV9_CAP_COMPLEX
+ support complex profile
+ #GF_MXDEC_RV9_CAP_LEVEL1
+ support LEVEL 1.
+ #GF_MXDEC_RV9_CAP_LEVEL2
+ support LEVEL 2.
+ #GF_MXDEC_RV9_CAP_LEVEL3
+ support LEVEL 3.
+ #GF_MXDEC_RV9_CAP_LEVEL4
+ support LEVEL 4.
+ #GF_MXDEC_RV9_CAP_DB
+ support Post Processing's smoothing filter for RV8 streams.
+ #GF_MXDEC_RV9_CAP_DR
+ support Post Processing's de-ringing.
+
+
+ It is a good practice to call this function to query for the API version
+ and its capabilities before using the rest of the MxDecRV9API functions.
+
+ @see GFPROPERTY
+*/
+ GF_RETTYPE (* MxDecRV9GetProperty)(GFMxDecRV9Handle hMxDecRV9, PGFPROPERTY pMXProp );
+
+
+
+ GF_RETTYPE (* MxDecRV9GetStatus)(GFMxDecRV9Handle hMxDecRV9, NvU32 * pStatus);
+
+
+ /** This function applies the postprocessing filters to the source surface and outputs
+ the new image to the destitation surface.
+ @param hMxDecRV9 (GFMxDecRV9Handle) Handle specific to MxDecRV9API
+ @param pP (#PGFMXDECRV9PP) Pointer to the PGFMXDECRV9PP.
+ @retval GF_SUCCESS \a if successful
+ @retval GF_ERROR Some error occured
+ GF_ERROR Return values for the above function
+
+ @see PGFMXDECRV9PP
+*/
+ GF_RETTYPE (* MxDecRV9PostProcessing)(GFMxDecRV9Handle hMxDecRV9, PGFMXDECRV9PP pP);
+
+
+ /** This function sets the MxDecRV9API options.
+ @param hMxDecRV9 (GFMxDecRV9Handle) Handle specific to MxDecRV9API
+ @param uiFeature :
+
+ #GF_MXDEC_RV9_ATTR_PRE_DETERMINED_BOUNDARY
+ will determine the VOL and VOP boundary, for RV9.
+ #GF_MXDEC_RV9_ATTR_PREFILLBUFFER
+ App will fill the buffer and push the data to the decoder.
+
+ @param pInfo Pointer to the information buffer.
+ @retval GF_SUCCESS \a if successful
+ @retval GF_ERROR Some error occured
+
+*/
+ GF_RETTYPE (* MxDecRV9SetAttribute)(GFMxDecRV9Handle hMxDecRV9, NvU32 uiFeature, NvU32* pInfo);
+
+
+ /** This function gets the MxDecRV9API options.
+ @param hMxDecRV9 (GFMxDecRV9Handle) Handle specific to MxDecRV9API
+ @param uiFeature :
+
+ #GF_MXDEC_ATTR_RV9_DEC_FRAME_RECT_TOP_ALIGNMENT
+ #GF_MXDEC_ATTR_RV9_DEC_FRAME_RECT_LEFT_ALIGNMENT
+ #GF_MXDEC_RV9_ATTR_PRE_DETERMINED_BOUNDARY
+ #GF_MXDEC_RV9_ATTR_PREFILLBUFFER
+
+ @param pInfo Pointer to the information buffer.
+ @retval GF_SUCCESS \a if successful
+ @retval GF_ERROR Some error occured
+
+*/
+ GF_RETTYPE (* MxDecRV9GetAttribute)(GFMxDecRV9Handle hMxDecRV9, NvU32 uiFeature, NvU32* pInfo);
+
+
+ /** This function sets the MxDecRV9API options.
+ @param hMxDecRV9 (GFMxDecRV9Handle) Handle specific to MxDecRV9API
+ @param uiFeature :
+
+ #GF_MXDEC_RV9_SET_READBITSTREAM
+ will Set up readbitstream call back function.
+ #GF_MXDEC_RV9_SET_SURFACE_LIST
+ will setup the surface list, including all of the ref surface and one reconstructed one.
+ #GF_MXDEC_RV9_BITSTREAM_RV8
+ will Set the GFMxDecRV9API to decode the RV8 stream.
+
+ @param pInfo Pointer to the information buffer.
+ @retval GF_SUCCESS \a if successful
+ @retval GF_ERROR Some error occured
+
+*/
+ GF_RETTYPE (* MxDecRV9Set)(GFMxDecRV9Handle hMxDecRV9, NvU32 uiFeature, void * pInfo);
+
+
+
+
+/** This function Decodes the picture header and gives the related information in
+ PictureHeader.
+ @param hMxDecRV9 (GFMxDecRV9Handle) Handle specific to MxDecRV9API
+ @param pPictureHeader Pointer to the #GFMXDECRV9PICHDR.
+ @retval GF_SUCCESS \a if it successfully decodes the Header
+ @retval GF_ERROR Some error occured
+ GF_ERROR Return values for the above function
+
+ #GF_ERROR_RV9DECPICTUREHDR_DETECTED
+ There is a sequence header in the bit stream.
+ Application need to decide this sequence is an error or this
+ is intended to be in the bit stream.
+ #GF_ERROR_RV9DECPICTUREHDR_END_OF_FILE
+ No more bit stream from application.
+ #GF_ERROR_RV9DECPICTUREHDR_CORRUPTED
+ GFMxDecRV9DecPicture encounters an un-recoverable error
+ in the bit stream. Application should call GFMxDecRV9Resync
+ API to skip this picture.
+ #GF_ERROR_RV9DECPICTUREHDR_NOT_ENOUGH_MEM
+ There is not enough memory.
+
+
+ @see GFMXDECRV9PICHDR
+*/
+ GF_RETTYPE (* MxDecRV9DecodePictureHeader)(GFMxDecRV9Handle hMxDecRV9, PGFMXDECRV9PICHDR pPictureHeader);
+
+
+ /** This function decodes one frame from the bitstream.
+ @param hMxDecRV9 (GFMxDecRV9Handle) Handle specific to MxDecRV9API
+ @param pFrame pointer to #PGFMXDECRV9FRAME
+ @retval GF_SUCCESS \a if successful
+ @retval #GF_MXDEC_RV9_FRAMEDEC_EOF_REACHED \a No more bit streams from the application.
+
+*/
+ GF_RETTYPE (* MxDecRV9DecodeFrame)(GFMxDecRV9Handle hMxDecRV9, PGFMXDECRV9FRAME pFrame);
+
+
+
+/** GFMxDecRV9Resync re-synchronizes to a specific position of a bit stream..
+ @param hMxDecRV9 (GFMxDecRV9Handle) Handle specific to MxDecRV9API
+ @param ResyncOption :
+
+ #GF_MXDEC_RV9_RESYNC_FORWARD_NEAREST_I_FRAME.
+ Resynchronize forward to the nearest I frame.
+ #GF_MXDEC_RV9_RESYNC_BACKWARD_NEAREST_I_FRAME.
+ Resynchronize backward to the nearest I frame.
+ #GF_MXDEC_RV9_RESYNC_BACKWARD_NEAREST_P_FRAME.
+ Resynchronize backward to the nearest P frame.
+
+ @retval GF_SUCCESS \a if successful
+ @retval GF_ERROR Some error occured
+
+*/
+ GF_RETTYPE (* MxDecRV9Resync)(GFMxDecRV9Handle hMxDecRV9, NvU32 ResyncOption);
+
+
+
+
+ GF_RETTYPE (* MxDecRV9InterruptControl)(GFMxDecRV9Handle hMxDecRV9,
+ GF_MXDEC_RV9_INTERRUPT_TYPE IntType, GF_MXDEC_RV9_INTERRUPT_OPERATION_TYPE op,
+ void * pData);
+
+
+
+ /** This function provides component-level interrupt control for the
+ MxDecRV9API. It is optional because an interrupt service thread (IST) at the
+ application level can call the MxDecRV9API to complete the task.
+ @param hMxDecRV9(GFMxDecRV9Handle) Handle specific to MxDecRV9API
+ @param IntType MxDecRV9API interrupt type as defined in
+ #GF_MXDEC_RV9_INTERRUPT_TYPE
+ @param pData Pointer to data being passed in or out.
+ @retval GF_SUCCESS \a if successful.
+ @retval GF_ERROR Some error occured.
+
+*/
+ GF_RETTYPE (* MxDecRV9InterruptHandler)(GFMxDecRV9Handle hMxDecRV9,
+ GF_MXDEC_RV9_INTERRUPT_TYPE IntType, void * pData); // Reserved.
+
+} GFMXDECRV9TABLE, *PGFMXDECRV9TABLE;
+
+// Typesafe functions for opening and closing this component
+GF_RETTYPE GFMxDecRV9Open(GFRmHandle hRm, GFMxDecRV9Handle *phMxDecRV9,
+ GF_STATE_TYPE state, GFRmChHandle hCh);
+void GFMxDecRV9Close(GFMxDecRV9Handle *phMxDecRV9);
+
+#if NVCPU_IS_XTENSA
+#define MXDRV9OFFSET sizeof(GFMXDECRV9TABLE)
+#else
+#define MXDRV9OFFSET 0
+#endif
+
+
+//ERROR return values for the GFMxDecRV9DecodePictureHeader()
+
+/** ERROR return values for the GFMxDecRV9DecodePictureHeader() \n
+ There is a sequence header in the bit stream.
+ Application need to decide this sequence is an error or this
+ is intended to be in the bit stream.
+ @see GFMXDECRV9TABLE::MxDecRV9DecodePictureHeader
+*/
+#define GF_ERROR_RV9DECPICTUREHDR_DETECTED 0x00000001
+
+
+/**ERROR return values for the GFMxDecRV9DecodePictureHeader() \n
+ No more bit stream from application.
+ @see GFMXDECRV9TABLE::MxDecRV9DecodePictureHeader
+*/
+#define GF_ERROR_RV9DECPICTUREHDR_END_OF_FILE 0x00000002
+
+
+/** ERROR return values for the GFMxDecRV9DecodePictureHeader() \n
+ GFMxDecRV9DecPicture encounters an un-recoverable error
+ in the bit stream. Application should call GFMxDecRV9Resync
+ API to skip this picture.
+ @see GFMXDECRV9TABLE::MxDecRV9DecodePictureHeader
+*/
+#define GF_ERROR_RV9DECPICTUREHDR_CORRUPTED 0x00000003
+
+/**ERROR return values for the GFMxDecRV9DecodePictureHeader() \n
+ There is not enough memory.
+*/
+#define GF_ERROR_RV9DECPICTUREHDR_NOT_ENOUGH_MEM 0x00000004
+
+//ERROR return values for MxDecRV9DecodeFrame()
+/** ERROR return values for MxDecRV9DecodeFrame()\n
+ API returns this error when End of file is reached,i.e No more bit stream from application.
+ once this ERROR is returned, the application should provide more media files to decode or
+ exit gracefully.*/
+#define GF_MXDEC_RV9_FRAMEDEC_EOF_REACHED 0x00000001
+
+/* #### MxDecRV9API Helper macros. Maybe useful for backward compatible API. #### */
+
+
+/* #### MxDecRV9 Helper macros. Maybe useful for backward compatible API. #### */
+#define GFMxDecRV9GetProperty(hMxDecRV9, pMXProp) \
+ ((PGFMXDECRV9TABLE)((NvU32)hMxDecRV9+MXDRV9OFFSET))->MxDecRV9GetProperty(hMxDecRV9, pMXProp)
+
+#define GFMxDecRV9GetStatus(hMxDecRV9, pStatus) \
+ ((PGFMXDECRV9TABLE)((NvU32)hMxDecRV9+MXDRV9OFFSET))->MxDecRV9GetStatus(hMxDecRV9, pStatus)
+
+#define GFMxDecRV9DecodePictureHeader(hMxDecRV9, pPictureHeader)\
+ ((PGFMXDECRV9TABLE)((NvU32)hMxDecRV9+MXDRV9OFFSET))->MxDecRV9DecodePictureHeader(hMxDecRV9, pPictureHeader)
+
+#define GFMxDecRV9PostProcessing(hMxDecRV9, pP) \
+ ((PGFMXDECRV9TABLE)((NvU32)hMxDecRV9+MXDRV9OFFSET))->MxDecRV9PostProcessing(hMxDecRV9, pP);
+
+#define GFMxDecRV9SetAttribute(hMxDecRV9, uiFeature, pInfo) \
+ ((PGFMXDECRV9TABLE)((NvU32)hMxDecRV9+MXDRV9OFFSET))->MxDecRV9SetAttribute(hMxDecRV9, uiFeature, pInfo)
+
+#define GFMxDecRV9GetAttribute(hMxDecRV9, uiFeature, pInfo) \
+ ((PGFMXDECRV9TABLE)((NvU32)hMxDecRV9+MXDRV9OFFSET))->MxDecRV9GetAttribute(hMxDecRV9, uiFeature, pInfo)
+
+#define GFMxDecRV9Set(hMxDecRV9, uiFeature, pInfo) \
+ ((PGFMXDECRV9TABLE)((NvU32)hMxDecRV9+MXDRV9OFFSET))->MxDecRV9Set(hMxDecRV9, uiFeature, pInfo)
+
+#define GFMxDecRV9DecodeFrame(hMxDecRV9, pFrame) \
+ ((PGFMXDECRV9TABLE)((NvU32)hMxDecRV9+MXDRV9OFFSET))->MxDecRV9DecodeFrame(hMxDecRV9, pFrame)
+
+#define GFMxDecRV9Resync(hMxDecRV9, ResyncOption) \
+ ((PGFMXDECRV9TABLE)((NvU32)hMxDecRV9+MXDRV9OFFSET))->MxDecRV9Resync(hMxDecRV9, ResyncOption)
+
+#define GFMxDecRV9InterruptControl(hMxDecRV9, IntType, op, pData)\
+ ((PGFMXDECRV9TABLE)((NvU32)hMxDecRV9+MXDRV9OFFSET))->MxDecRV9InterruptControl(hMxDecRV9, IntType, op, pData)
+
+#define GFMxDecRV9InterruptHandler(hMxDecRV9, IntType, pData)\
+ ((PGFMXDECRV9TABLE)((NvU32)hMxDecRV9+MXDRV9OFFSET))->MxDecRV9InterruptHandler(hMxDecRV9, IntType, pData)
+
+
+
+/*@}*/
+/*@}*/
+
+
+/** @page pageMxDecRV9AppNotes MxDecRV9API Application Notes
+ @section pageMxDecRV9AppNotes1 Programming Sequence
+
+ The following procedure requires that GFRmOpen() is called first to start
+ GFSDK usage.
+
+
+
+ 1. Call GFMxDecRV9Open() to obtain RV9Handle. This handle will be passed to different functions of MxDecRV9API.
+
+ 2. Call GFMxDecRV9GetProperty()to querry the properties.Check whether this
+ MxDecRV9API version can support the desired RV9 profile and level.
+
+ 3. Set different attributes of RV9 decoder using GFMxDecRV9SetAttribute(),
+ #GFMXDECRV9TABLE::MxDecRV9SetAttribute.
+
+ 4. Decode the picture header using GFMxDecRV9DecodePictureHeader(),
+ #GFMXDECRV9TABLE::MxDecRV9DecodePictureHeader.
+
+ 5. call GFRmSurfaceAlloc() to allocate at least one reference surface and one
+ current surface for decoding purposes.
+
+ 6. If the postprocessing engine is needed, allocate one surface to hold the
+ postprocessing results.
+
+ 7. For display purposes, the decoder application could call GFVxBlt() for
+ the following two scenarios. Please refer to the latest GFVxAPI document
+ for additional information.
+ Performing color space conversion and then a stretch blit to the primary surface directly.
+ Blitting to the overlay surface.
+
+ 8. The decoder application should decode on frame by frame basis. Call GFMxDecRV9DecodeFrame() to decode each frame.
+ once GF_MXDEC_RV9_FRAMEDEC_EOF_REACHED is returnd by API, application should exit gracefully.
+ #GFMXDECRV9TABLE::MxDecRV9DecodeFrame
+
+ 9. If Post processing is enabled , call GFMxDecRV9PostProcessing().
+ #GFMXDECRV9TABLE::MxDecRV9PostProcessing
+
+ 10. Before exiting the application, the decoder application should call
+ GFRmSurfaceFree() to free the surfaces that have been allocated.
+
+ 11. Call GFMxDecRV9Close() with RV9Handle to release the resources of the decoder module.
+
+*/
+
+
+#ifdef __cplusplus
+} // only need to export C interface if
+ // used by C++ source code
+#endif
+
+#endif
diff --git a/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFMxDecVC1.h b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFMxDecVC1.h
new file mode 100755
index 00000000..da28a6ec
--- /dev/null
+++ b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFMxDecVC1.h
@@ -0,0 +1,732 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/** @file GFMxDecVC1.h
+GFSDK VC1 Decode API header file.
+*/
+
+#ifndef _GF_MPEG_DEC_VC1__
+#define _GF_MPEG_DEC_VC1__
+
+#include "nvtypes.h"
+#include "GFVx.h"
+#include "GFDef.h"
+
+#ifdef __cplusplus
+extern "C" { // only need to export C interface if
+ // used by C++ source code
+#endif
+
+ /** @addtogroup groupMxDecVC1 MxDecVC1API VC1 Decode API
+ The VC1 decoder API handles WMV simple profile-compliant bit
+ streams for this version, but has been defined to handle all of the three
+ profiles for future expansion.
+
+ The VC1 decoder API has two sets of APIa high level API and a low
+ level API.
+
+ Using the High Level API
+
+ The high level API has a built-in entropy decoder. It decodes the bit stream.
+ This high level API calls the low level API internally. When using the high level API, the
+ application can ignore the low level API.
+
+ The MxDecVC1API high level functions include the following:
+ - GFMxDecVC1DecSequenceLayer()
+ - GFMxDecVC1DecPicture()
+ - GFMxDecVC1Set()
+
+ Using the Low Level API
+
+ The low level API is essentially a macroblock decoder engine. It decodes
+ macroblock by macroblock. When using the low level API, the application
+ needs to handle the entropy decoding. The low level
+ API assumes that the information passed from caller is correct, and does not
+ have any error concealment functionality build in. The application which
+ called the low level API must make sure that no macroblocks are missing for
+ any picture.
+
+ The MxDecVC1API low level functions include the following:
+ - GFMxDecVC1SetPicture()
+ - GFMxDecVC1SetMBs()
+ - GFMxDecVC1SetPicture()
+
+
+ @ref pageMxDecVC1AppNotes
+
+ @ref pageMxDecVC1AppNotes1
+
+
+ */
+ /*@{*/
+
+ // MXDECVC1CapFlags
+
+ /** MxDecVC1API property flag: Simple profile supported.
+ @see GFMxDecVC1GetProperty(), GFPROPERTY::Capability
+ */
+#define GF_MXDEC_VC1_CAP_SIMPLE 0x00000001
+
+ /** MxDecVC1API property flag: Main profile supported.
+ @see GFMxDecVC1GetProperty(), GFPROPERTY::Capability
+ */
+#define GF_MXDEC_VC1_CAP_MAIN 0x00000002
+
+ /** MxDecVC1API property flag: Extended profile supported.
+ @see GFMxDecVC1GetProperty(), GFPROPERTY::Capability
+ */
+#define GF_MXDEC_VC1_CAP_ADVANCE 0x00000004
+
+ /** MxDecVC1API property flag: Low LEVEL supported.
+ @see GFMxDecVC1GetProperty(), GFPROPERTY::Capability
+ */
+#define GF_MXDEC_VC1_CAP_LOWLEVEL 0x00000008
+
+ /** MxDecVC1API property flag: Medium LEVEL supported.
+ @see GFMxDecVC1GetProperty(), GFPROPERTY::Capability
+ */
+#define GF_MXDEC_VC1_CAP_MEDIUMLEVEL 0x00000010
+
+ /** MxDecVC1API property flag: High LEVEL supported.
+ @see GFMxDecVC1GetProperty(), GFPROPERTY::Capability
+ */
+#define GF_MXDEC_VC1_CAP_HIGHLEVEL 0x00000100
+
+ /** MxDecVC1API property flag: LEVEL 0 supported.
+ @see GFMxDecVC1GetProperty(), GFPROPERTY::Capability
+ */
+#define GF_MXDEC_VC1_CAP_LEVEL0 0x00000200
+
+ /** MxDecVC1API property flag: LEVEL 1 supported.
+ @see GFMxDecVC1GetProperty(), GFPROPERTY::Capability
+ */
+#define GF_MXDEC_VC1_CAP_LEVEL1 0x00000400
+
+ /** MxDecVC1API property flag: LEVEL 2 supported.
+ @see GFMxDecVC1GetProperty(), GFPROPERTY::Capability
+ */
+#define GF_MXDEC_VC1_CAP_LEVEL2 0x00000800
+
+ /** MxDecVC1API property flag: LEVEL 3 supported.
+ @see GFMxDecVC1GetProperty(), GFPROPERTY::Capability
+ */
+#define GF_MXDEC_VC1_CAP_LEVEL3 0x00001000
+
+ /** MxDecVC1API property flag: LEVEL 4 supported.
+ @see GFMxDecVC1GetProperty(), GFPROPERTY::Capability
+ */
+#define GF_MXDEC_VC1_CAP_LEVEL4 0x00002000
+
+
+ /**Enable the DSP side profiling */
+//#define GF_ENABLE_PROFILER 1
+
+// to divert the code for checking the non-working of hw modules as of now
+#define USE_HW_MODULES
+
+ /** Parameter structure for MxDecVC1DecSequenceLayer().
+ Both input and output parameters are passed via this structure to MxDecVC1DecSequenceLayer().
+ @see MxDecVC1DecSequenceLayer()
+ */
+
+
+ typedef struct _GFMXDECVC1DECSEQUENCELAYER
+ {
+
+ NvU32 uiSequenceOption; /**< Input flags, see GFMXDECVC1_DECSEQUENCEOPTION_* */
+ NvU8 ucSequenceLayerInfo; /**< SequenceLayerInfo Definition */
+ NvU16 usWidth; /**< Horizontal size of the coded picture in pixels */
+ NvU16 usHeight; /**< Vertical size of the coded picture in pixels */
+ NvU8 ucProfile; /**< Profile of the sequence */
+ NvU8 ucLevel; /**< Level of the sequence */
+ NvU32 uiHRDRate; /**< Peak transmission rate R in bits per second */
+ NvU32 uiHRDBufferSize; /**< Buffer size B in milliseconds. */
+ NvU32 uiFrameRate; /**< Rounding frame rate of the encoded clips */
+ NvU8* pPreFillBuffer; /**< Input, Pointer bitstream for sequence header to decode */
+ NvU32 PreFillBufferLength; /**< Input, Length of bitstream in bytes, must cover the entire sequence header */
+ NvU32 PreFillBufferBytesConsumed;/**< Output, Amount of bytes consumed by the component */
+
+ } GFMXDECVC1DECSEQUENCELAYER, *PGFMXDECVC1DECSEQUENCELAYER;
+
+ //SequenceLayerInfo:
+#define MXDEC_VC1_CONSTANT_BITRATE 0x00000001 /**< Flag is set when the sequence is encoded at constant bitrate */
+#define MXDEC_VC1_MULTIRESOLUTION 0x00000002 /**< Flag indicating that the frames can be coded at smaller */
+ //resolution. Resolution change is allowed only on I pictures.
+ //Information of the picture
+
+ /** GFMXDECVC1DECSEQUENCELAYER::uiSequenceOption input flagbit: Bitstream is passed with GFMxDecVC1DecSequenceLayer().
+ If this flag is set bitstream data is passed with the call to GFMxDecVC1DecSequenceLayer()
+ instead via the read bitstrem callback. This can be used only with boundary detection
+ on application level. The bitstream data is passed via GFMXDECVC1DECSEQUENCELAYER::pPreFillBuffer and
+ GFMXDECVC1DECSEQUENCELAYER::PreFillBufferLength.
+ */
+#define GFMXDECVC1_DECSEQUENCEOPTION_PREFILLBUFFER 0x00000001
+
+
+ /** Parameter structure for MxDecVC1DecPicture().
+ Both input and output parameters are passed via this structure to MxDecVC1DecPicture().
+ @see MxDecVC1DecPicture()
+ */
+ typedef struct _GFMXDECVC1DECPICTURE
+ {
+ /**< the following fields are set by app */
+ NvU32 uiPictureOption; /**< Set by application. Set to 0 for this version.*/
+ PGFRMSURFACE pRef; /**< Reference Picture Surface */
+ PGFRMSURFACE pCur; /**< Current Picture Surface */
+ PGFRECT pRefRect; /**< pRefSurfRect specified a rectangular area within
+ the pRef surface, and GFMxDecVC1 references the
+ image in the pRefSurfRect area of the pRef surface.
+ If pRefSurfRect is NULL, entire pRef surface is referred.*/
+
+ PGFRECT pCurRect; /**pCurSurfRect specified a rectangular area within
+ the pCur surface, and GFMxDecVC1 references the
+ image in the pCurSurfRect area of the pCur surface.
+ If CurSurfRect is NULL, entire pCur surface is referred.
+ */
+
+ /**< the following fields are set by MxDecVC1DecPicture API */
+ NvU32 uiPictureInfo; /**< Current Picture Information. */
+
+ NvU8* pPreFillBuffer; /**< Input, Pointer bitstream for frame to decode */
+ NvU32 PreFillBufferLength; /**< Input, Length of bitstream in bytes, must cover the entire frame */
+ NvU32 PreFillBufferBytesConsumed; /**< Output, Amount of bytes consumed by the component */
+
+ NvU32 uiTimeStamp; /**< Value Specified in Picture Layer Header.*/
+ NvU8 * pMBInfo; /**< each element tells the particular MB is wrong or not.*/
+
+#ifdef GF_ENABLE_PROFILER
+
+ NvU32 DSPTimers[10];
+#endif
+
+ } GFMXDECVC1DECPICTURE, *PGFMXDECVC1DECPICTURE;
+
+ //PictureInfo:
+#define MXDEC_VC1_DEC_PICTURE_P 0x00000001 //Flag is set when current Picture is P type
+#define MXDEC_VC1_DEC_NOT_CODED 0x00000010 //Flag is set when current picture is not coded.
+
+//uiPictureOption
+
+/** GFMXDECVC1DECPICTURE::uiPictureOption input flagbit: Use target rectangle.
+ If this flag is set, the GFMXDECVC1DECPICTURE::pPictureRect will point to
+ a rectangle on the output surface, where the reconstructed frame is placed.
+*/
+#define GF_MXDEC_VC1_DEC_PICTURE_SPECIFY_SURF_RECT 0x00000001
+
+/** GFMXDECVC1DECPICTURE::uiPictureOption input flagbit: Bitstream is passed with MxDecVC1DecPicture().
+ If this flag is set bitstream data is passed with the call to MxDecVC1DecPicture()
+ instead via the read bitstrem callback. This can be used only with frame boundary detection
+ on application level. The bitstream data is passed via GFMXDECVC1DECPICTURE::pPreFillBuffer and
+ GFMXDECVC1DECPICTURE::PreFillBufferLength.
+*/
+#define GF_MXDEC_VC1_DEC_PICTURE_SPECIFY_PREFILLBUFFER 0x00000002
+
+/** GFMXDECVC1DECPICTURE::uiPictureOption input flagbit: If This Flag is Set Reading of
+ .rcv wrapper will be skipped for each picture.
+*/
+#define GF_MXDEC_VC1_DEC_PICTURE_SPECIFY_SKIP_RCV_WRAPPER 0x00000004
+
+ /**Low level API Picture structure
+ */
+ typedef struct _GFMXDECVC1PICTURE
+ {
+ NvU32 PictureInfo; /**< Current Picture Information defined in
+ //GFMXDECVC1PICTURE Definitions */
+ PGFRMSURFACE pRef; /**< Reference Picture Surface */
+ PGFRMSURFACE pCur; /**< Current Picture Surface */
+ PGFRECT pRefRect; /**< pRefSurfRect specified a rectangular area
+ within the pRef surface, and GFMxDecVC1
+ references the image in the pRefSurfRect
+ area of the pRef surface. If pRefSurfRect is NULL,
+ entire pRef surface is referred. */
+ PGFRECT pCurRect; /**< pCurSurfRect specified a rectangular area
+ within the pCur surface, and GFMxDecVC1
+ references the image in the pCurSurfRect
+ area of the pRef surface. If pCurSurfRect is NULL,
+ entire pCur surface is referred. */
+
+ } GFMXDECVC1PICTURE, *PGFMXDECVC1PICTURE;
+ //PictureInfo:
+#define MXDEC_VC1_PICTURE_P_PICTURE 0x00000001
+ //Indicates a P Picture when set otherwise a I Picture
+#define MXDEC_VC1_PICTURE_SPECIFY_REFSURF_RECT 0x00000002
+ //If this Flag is set, pRefSurfRect must be set, and GFMxDecVC1
+ //references the image in the pRefSurfRect area of the pRef surface.
+ //Otherwise entire pRef surface is referred.
+#define MXDEC_VC1_PICTURE_SPECIFY_CURSURF_RECT 0x00000004
+ //If this Flag is set, pCurSurfRect must be set, and GFMxDecVC1 outputs
+ //the decoded image in the pCurSurfRect area of the pCur surface.
+ //Otherwise entire pCur surface is referred.
+#define MXDEC_VC1_PICTURE_ROUNDING_ONE 0x00000008
+ //PICTURE_ROUNDING_TYPE is one
+
+
+ /**motion vector information for current macroblock*/
+
+ typedef struct _GFMXDECVC1VECTOR
+ {
+ NvS16 sH_MV_DATA; /**< Horizonal motion vector data. */
+ NvS16 sV_MV_DATA; /**< Vertical motion vector data. */
+ } GFMXDECVC1VECTOR, *PGFMXDECVC1VECTOR;
+
+ /**coefficient information for macroblock*/
+
+ typedef struct _GFMXDECVC1COEF
+ {
+ NvU8 uiLAST; /**< This last non-zero coefficient in current block */
+ NvU8 uiRUN; /**< How many zeroes precede this coefficient */
+ NvS16 iLEVEL; /**< This coefficient's level value */
+ } GFMXDECVC1COEF, *PGFMXDECVC1COEF;
+
+ /**macroblock information*/
+
+ typedef struct _GFMXDECVC1MB
+ {
+ NvU16 uiX; /**< MB's x position in the picture*/
+ NvU16 uiY; /**< MB's y position in the picture*/
+ NvU32 uiMBInfo; /**< MacroBlock characteristics*/
+ NvU32 uiBlkType[6]; /**< Block characteristics*/
+ NvU8 uiBlkCoded[6]; /**< Block characteristics*/
+ NvU8 uiBlkNZC[6]; /**< Block characteristics*/
+ NvU8 ucFirstCodedBlk; /**< First Coded Block in Macroblock*/
+ NvU16 uiQuantiser; /**< current MB's quantiser*/
+ GFMXDECVC1VECTOR Vector[4]; /**< motion vector zero ~ three*/
+ NvU32 uiNumofCoef; /**< number of GFMXDECVC1COEF //structures for current MB*/
+
+ } GFMXDECVC1MB, *PGFMXDECVC1MB;
+
+ //MBInfo:
+#define MXDEC_VC1_MB_TYPE_INTER 0x1 //inter mb
+
+ /*Quantiser Type of MacroBlock */
+#define MXDEC_VC1_MB_NON_UNIFORM_QUANTISER 0x2 //Non Uniform Quantiser
+
+
+#define MXDEC_VC1_MB_AC_PRED_ON 0x80 //AC prediction is on
+#define MXDEC_VC1_MB_FIELDTX 0x100
+#define MXDEC_VC1_MB_MV_1_MVS 0x200 //1 motion vector coded
+#define MXDEC_VC1_MB_MV_4_MVS 0x400 //4 motion vector coded
+#define MXDEC_VC1_MB_SKIPPED 0x800 //Macro Block not coded
+
+ /* Motion vector direction bits [15:14] */
+#define MXDEC_VC1_MB_DIRECT 0x1000
+#define MXDEC_VC1_MB_FORWARD 0x2000
+#define MXDEC_VC1_MB_BACKWARD 0x4000
+
+#define MXDEC_VC1_MB_AUTO_DISPLAY 0x8000
+#define MXDEC_VC1_MB_OVERLAP 0x10000
+
+
+#define MXDEC_VC1_MB_MV_MODE1MV_HALF_PEL_BILINEAR 0x20000
+#define MXDEC_VC1_MB_MV_MODE1MV_HALF_PEL 0x40000
+#define MXDEC_VC1_MB_MV_MODE_MIXED_MV 0x100000
+#define MXDEC_VC1_MB_MV_MODE_INTENSITY_COMP 0x200000
+
+#define MXDEC_VC1_MB_MV_RANGE_64_32 0x400000
+#define MXDEC_VC1_MB_MV_RANGE_128_64 0x800000
+#define MXDEC_VC1_MB_MV_RANGE_512_128 0x1000000
+#define MXDEC_VC1_MB_MV_RANGE_1024_256 0x2000000
+
+
+ //uiBlkInfo
+#define MXDEC_VC1_BLK_CODED 0x1
+
+
+#define MXDEC_VC1_BLK_INTER 0x2
+#define MXDEC_VC1_BLK_INTER8X8 0x4
+#define MXDEC_VC1_BLK_INTER8X4 0x8
+#define MXDEC_VC1_BLK_INTER4X8 0x10
+#define MXDEC_VC1_BLK_INTER4X4 0x20
+#define MXDEC_VC1_BLK_INTER_ANY 0x40
+
+#define MXDEC_VC1_BLK_INTRA 0x80
+#define MXDEC_VC1_BLK_INTRA_TOP 0x100
+#define MXDEC_VC1_BLK_INTRA_LEFT 0x200
+
+
+#define MXDEC_VC1_SUBBLK_0 0x1
+#define MXDEC_VC1_SUBBLK_1 0x2
+#define MXDEC_VC1_SUBBLK_2 0x4
+#define MXDEC_VC1_SUBBLK_3 0x8
+
+
+
+ //After GFMX decodes this Macro Block, it will auto trigger video engine to display
+ //this VOP if decoder application set auto blt on through GFVxBlt.
+ //If MXDEC_MB_AUTO_PP and MXDEC_MA_AUTO_DISPLAY both on, //GFMX will trigger Post Processing first, then trigger display engine.
+
+
+ // definition for attribute
+
+ /** GFMxDecVC1 Attribute: Application will determine the decoding boundary, this boundary
+ means sequence and picture layer boundary.
+ Interpretation of block referenced by \a pInfo parameter:
+
+ NvU32 1: APP will determine the decoding boudary
+ 0: APP will not determine the decoding boundary
+
+
+ @see GFMxDecVC1GetAttribute(), GFMxDecVC1SetAttribute()
+ */
+#define GF_MXDEC_VC1_ATTR_PRE_DETERMINED_BOUNDARY 0x00000001
+
+ /** GFMxDecVC1 Attribute: This attribute only can be used for GFMxDecGetAttribute
+ If application wants to set pDestRect in GFMXDECPICTURE or GFMXDECVC1DECPICTURE,
+ application must use this attributes to get allignment information and
+ align the rectangle top & left corner accordinately.
+ *pInfo: top fieled alignment in term of lines
+ */
+#define GF_MXDEC_VC1_ATTR_DEC_PICTURE_RECT_TOP_ALIGNMENT 0x00000010
+
+ /** GFMxDecVC1 Attribute: This attribute only can be used for GFMxDecVC1GetAttribute
+ If application wants to set pDestRect in GFMXDECVC1PICTURE or GFMXDECVC1DECPICTURE,
+ application must use those attributes to get allignment information and
+ align the rectangle top & left corner accordinately.
+ *pInfo: left fieled alignment in term of pixels
+ */
+#define GF_MXDEC_VC1_ATTR_DEC_PICTURE_RECT_LEFT_ALIGNMENT 0x00000011
+
+ /** GFMxDecVC1 Attribute: Save decoder internal state information. This attribute only can be used for GFMxDecVC1GetAttribute
+ *pInfo: state handle
+ */
+#define GF_MXDEC_VC1_ATTR_DEC_SAVE_STATE 0x00000012
+
+ /** GFMxDecVC1 Attribute: Restore decoder internal state information. This attribute only can be used for GFMxDecVC1SetAttribute
+ *pInfo: state handle
+ */
+#define GF_MXDEC_VC1_ATTR_DEC_RESTORE_STATE 0x00000013
+
+ /** GFMxDecVC1 Attribute: Delete particular state handle. This attribute only can be used for GFMxDecVC1SetAttribute
+ *pInfo: state handle
+ */
+#define GF_MXDEC_VC1_ATTR_DEC_DELETE_STATE 0x00000014
+
+#define GF_MXDEC_VC1_ATTR_DEC_ENABLE_RAISE_WAIT 0x00000015
+ //Use this attribute to enable RaiseWait mechanish. This is required for OpenMax application.
+ //Decoder works in FRAME_DONE polling mode by default.This attribute only can be used for GFMxDecVC1SetAttribute
+ //*pInfo: state handle.
+
+ typedef struct _GFMXDECVC1PP
+ {
+ PGFRMSURFACE* pDestSurf;/**< pointer to an array of surfaces that will
+ hold the result from Post Processing
+ pointer to an array of surfaces to
+ accommodate auto post processing
+ */
+ PGFRMSURFACE* pSrcSurf; /**< pointer to an array of surfaces to be //post processed
+ pointer to an array of surfaces to
+ accommodate auto post processing
+ */
+ PGFRECT pRect; /**< Rectangle area to be processed for both
+ src and dest surface
+ */
+ NvU32 numofDestSurf; /**< If MXDEC_PP_AUTO flag is set, this
+ parameter must be filled
+ */
+ NvU32 numofSrcSurf; /**< If MXDEC_PP_AUTO flag is set, this
+ parameter must be filled
+ */
+ NvU8 * lpQuantiser; /**< point to array of QPs for Macro Blocks in
+ the source VOP. GFMX automatically saved
+ the last two decoded VOP's QP tables,
+ Decoder application may not need to reload
+ the table if it can make sure the source
+ VOP is the one within the last decoded
+ VOPs. If MXDEC_PP_RELOAD_QUANTIZER is set,
+ this field must be filled.
+ */
+ NvU32 PPOption; /**
+ GF_MXDEC_VC1_READ_BITSTREAM_FORWARD Forward scan
+ GF_MXDEC_VC1_READ_BITSTREAM_BACKWARD Backward scan
+
+
+ @return If the #MXDEC_ATTR_PRE_DETERMINED_BOUNDARY attribute is set, the callback
+ should return #GF_MXDEC_VC1_BOUNDARY_REACHED when a frame boundary is
+ detected, or 0 if no boundary is detected.
+ If the #MXDEC_ATTR_PRE_DETERMINED_BOUNDARY attribute is not set, the callback
+ should return 0.
+ */
+
+ /**pPara is a parameter passed from APP,
+ and APP wants API to call back with this parameter */
+
+ NvU32 (*pCallBack)(void * pPara, NvU8 ** ppBuffer, NvS32 * BufferLength, NvU32 uFlag);
+ /** If APP set GF_MXDEC_ATTR_PRE_DETERMINED_BOUNDARY,
+ APP should return GF_MXDEC_VC1_BOUNDARY_REACHED when the boundary is
+ detected.
+ If APP does not set GF_MXDEC_ATTR_PRE_DETERMINED_BOUNDARY,
+ 0 should be returned. */
+
+ }GFMXDECVC1CALLBACK, *PGFMXDECVC1CALLBACK;
+
+ /** GFMXDECVC1CALLBACK::pCallBack return code */
+#define GF_MXDEC_VC1_BOUNDARY_REACHED 0x00000001
+ /** GFMXDECVC1CALLBACK::pCallBack uFlag value: Stream forward scan. */
+#define GF_MXDEC_VC1_READ_BITSTREAM_FORWARD 0x00000002
+ /** GFMXDECVC1CALLBACK::pCallBack uFlag value: Stream backward scan. */
+#define GF_MXDEC_VC1_READ_BITSTREAM_BACKWARD 0x00000003
+
+
+
+ typedef enum
+ {
+ GFMX_DEC_VC1_INTERRUPT_ENABLE,
+ GFMX_DEC_VC1_INTERRUPT_DISABLE,
+ GFMX_DEC_VC1_INTERRUPT_CLEAR
+ } GFMX_DEC_VC1_INTERRUPT_OPERATION_TYPE; // Interrupt operation.
+
+ typedef enum
+ {
+ GFMX_DEC_VC1_DECODE_DONE_INTR,
+ GFMX_DEC_VC1_POST_PROCESSING_DONE_INTR,
+ GFMX_DEC_VC1_DSP_COMMAND_INTR,
+ } GFMX_DEC_VC1_INTERRUPT_TYPE;
+
+ typedef struct _GFMXDECVC1TABLE
+ {
+ GF_RETTYPE (* MxDecVC1GetProperty)(GFMxDecVC1Handle hMxDecVC1, PGFPROPERTY pMXProp );
+ GF_RETTYPE (* MxDecVC1GetStatus)(GFMxDecVC1Handle hMxDecVC1, NvU32 * pStatus);
+ GF_RETTYPE (* MxDecVC1DecSequenceLayer)(GFMxDecVC1Handle hMxDecVC1, PGFMXDECVC1DECSEQUENCELAYER pSequenceLayer);
+ GF_RETTYPE (* MxDecVC1DecPicture)(GFMxDecVC1Handle hMxDecVC1, PGFMXDECVC1DECPICTURE pPicture);
+ GF_RETTYPE (* MxDecVC1SetPicture)(GFMxDecVC1Handle hMxDecVC1, PGFMXDECVC1PICTURE pPicture);
+ GF_RETTYPE (* MxDecVC1SetMBs)(GFMxDecVC1Handle hMxDecVC1, PGFMXDECVC1MB pMBs);
+ GF_RETTYPE (* MxDecVC1SetAttribute)(GFMxDecVC1Handle hMxDecVC1, NvU32 uiFeature, NvU32* pInfo);
+ GF_RETTYPE (* MxDecVC1GetAttribute)(GFMxDecVC1Handle hMxDecVC1, NvU32 uiFeature, NvU32* pInfo);
+ GF_RETTYPE (* MxDecVC1Set)(GFMxDecVC1Handle hMxDecVC1, NvU32 uiFeature, void * pInfo);
+ GF_RETTYPE (* MxDecVC1InterruptControl)(GFMxDecVC1Handle hMxDecVC1,
+ GFMX_DEC_VC1_INTERRUPT_TYPE IntType, GFMX_DEC_VC1_INTERRUPT_OPERATION_TYPE op,
+ void * pData);
+ GF_RETTYPE (* MxDecVC1InterruptHandler)(GFMxDecVC1Handle hMxDecVC1,
+ GFMX_DEC_VC1_INTERRUPT_TYPE IntType, void * pData); // Reserved.
+ GF_RETTYPE (* MxDecVC1DecResync)(GFMxDecVC1Handle hMxDecVC1, NvU32 ResyncOption);
+ } GFMXDECVC1TABLE, *PGFMXDECVC1TABLE;
+
+// Typesafe functions for opening and closing this component
+GF_RETTYPE GFMxDecVC1Open(GFRmHandle hRm, GFMxDecVC1Handle *phMxDecVC1,
+ GF_STATE_TYPE state, GFRmChHandle hCh);
+void GFMxDecVC1Close(GFMxDecVC1Handle *phMxDecVC1);
+
+#if NVCPU_IS_XTENSA
+#define MXDVC1OFFSET sizeof(GFMXDECVC1TABLE)
+#else
+#define MXDVC1OFFSET 0
+#endif
+
+ /** #### MxDecVC1 Helper macros. Maybe useful for backward compatible API. ####
+ It is a good practice to call this function to query for the API version
+ and its capabilities before using the rest of the MxDecVC1API functions.
+
+ @see GFPROPERTY
+ */
+
+#define GFMxDecVC1GetProperty(hMxDecVC1, pMXProp) \
+ ((PGFMXDECVC1TABLE)((NvU32)hMxDecVC1+MXDVC1OFFSET))->MxDecVC1GetProperty(hMxDecVC1, pMXProp)
+
+#define GFMxDecVC1GetStatus(hMxDecVC1, pStatus) \
+ ((PGFMXDECVC1TABLE)((NvU32)hMxDecVC1+MXDVC1OFFSET))->MxDecVC1GetStatus(hMxDecVC1, pStatus)
+
+ /** Decode sequence header.
+
+ @param hMxDecVC1 (GFMxDecVC1Handle) Handle to MxDecVC1 component
+ @param pSequence (PGFMXDECVC1DECSEQUENCELAYER) Pointer to #GFMXDECVC1DECSEQUENCELAYER parameter structure
+
+ @retval GF_SUCCESS Sequence header was decoded successfully
+
+ This function will be called whenever a sequence header is found in the bitstream, decode
+ it and return its characteristics.
+
+ @see GFMXDECVC1DECSEQUENCELAYER
+ */
+#define GFMxDecVC1DecSequenceLayer(hMxDecVC1, pSequenceLayer)\
+ ((PGFMXDECVC1TABLE)((NvU32)hMxDecVC1+MXDVC1OFFSET))->MxDecVC1DecSequenceLayer(hMxDecVC1, pSequenceLayer)
+
+
+ //return value
+ /** GFMxDecVC1 error code: GFMxDecVC1DecSequenceLayer() encountered end of bitstream.
+ @see GFMxDecVC1DecSequenceLayer()
+ */
+#define GFMXDECVC1_SEQUENCELAYER_ERROR_END_OF_FILE (GFMXDVC1_ERROR | 0x00000001)
+
+ /** GFMxDecVC1 error code: GFMxDecVC1DecSequenceLayer() bitstream format not supported.
+ The sequence header specifies a bitstream format, that is not supported. Most likely
+ reason for this error is that the VC1 profile is not supported.
+ @see GFMxDecVC1DecSequenceLayer()
+ */
+#define GFMXDECVC1_SEQUENCELAYER_ERROR_NOT_SUPPORT_FORMAT (GFMXDVC1_ERROR | 0x00000002)
+
+ /** GFMxDecVC1 error code: GFMxDecVC1DecSequenceLayer() bitstream format is damaged due to
+ erroroneous stream.
+ @see GFMxDecVC1DecSequenceLayer()
+ */
+#define GFMXDECVC1_SEQUENCELAYER_ERROR_HEADER_DAMAGED (GFMXDVC1_ERROR | 0x00000003)
+
+ /** GFMxDecVC1 error code: GFMxDecVC1DecSequenceLayer() encountered out of GPU memory error.
+ The application can try to free GPU memory and call GFMxDecVC1DecSequenceLayer() again.
+ @see GFMxDecVC1DecSequenceLayer()
+ */
+#define GFMXDECVC1_SEQUENCELAYER_ERROR_NOT_ENOUGH_SYSTEM_MEM (GFMXDVC1_ERROR | 0x00000004)
+
+
+ /** Decode a picture.
+
+ @param GFMxDecVC1 (GFMxDecVC1Handle) Handle to MxDecVC1 component
+ @param pPicture (PGFMXDECVC1DECPICTURE) Pointer to #GFMXDECVC1DECPICTURE parameter structure
+
+ @retval GF_SUCCESS Frame was decoded successfully
+ @retval GFMXDECVC1_PICTURE_ERROR_END_OF_FILE End of stream encountered
+ @retval GFMXDECVC1_PICTURE_ERROR_CORRUPTED_PICTURE Unrecoverable bitstream error during frame decode
+ @retval GFMXDECVC1_PICTURE_ERROR_NOT_ENOUGH_SYSTEM_MEM Out of GPU memory
+ @retval GFMXDECVC1_ERROR_RESYNC_END_OF_FILE Resync was found at end of bitstream.
+ @retval GFMXDECVC1_ERROR_P_PICTURE_FOUND_AT_START instead of Inter frame, intra was found in beginning.
+ @retval GFMXDECVC1_ERROR_DSP_TIMEOUT AVP times out
+
+ GFMxDecVC1DecPicture decodes one picture from the bit stream. If GFMxDecVC1DecPicture detects an
+ error, GFMxDecVC1DecPicture returns the error back to the application.
+ If the current stream position is not on the start of a frame, the function scans forward until a frame
+ start or sequence header is detected.
+
+ @see GFMXDECVC1DECPICTURE
+ */
+#define GFMxDecVC1DecPicture(hMxDecVC1, pPicture)\
+ ((PGFMXDECVC1TABLE)((NvU32)hMxDecVC1+MXDVC1OFFSET))->MxDecVC1DecPicture(hMxDecVC1, pPicture)
+
+ //return value
+ /** GFMxDecVC1 error code: GFMxDecVC1DecPicture() encountered end of bitstream.
+ @see GFMxDecVC1DecPicture()
+ */
+#define GFMXDECVC1_PICTURE_ERROR_END_OF_FILE (GFMXDVC1_ERROR | 0x00000005)
+
+ /** GFMxDecVC1 error code: GFMxDecVC1DecPicture() encountered an unrecoverable bitstream error.
+ The application should call GFMxDecVC1DecResync() again, MxDecVC1 will then
+ scan for the next frame boundary and try to decode this frame.
+ @see GFMxDecVC1DecPicture()
+ */
+#define GFMXDECVC1_PICTURE_ERROR_CORRUPTED_PICTURE (GFMXDVC1_ERROR | 0x00000006)
+
+ /** GFMxDecVC1 error code: GFMxDecVC1DecPicture() encountered out of GPU memory error.
+ System memory is not enough to decode Picture. The application can try to free GPU memory and call
+ GFMxDecVC1DecPicture() again.
+ @see GFMxDecVC1DecPicture()
+ */
+#define GFMXDECVC1_PICTURE_ERROR_NOT_ENOUGH_SYSTEM_MEM (GFMXDVC1_ERROR | 0x00000007)
+
+ /** GFMxDecVC1 error code: GFMxDecVC1DecPicture() upon calling GFMxDecVC1DecResync()
+ encountered end of bitstream.
+ @see GFMxDecVC1DecPicture()
+ */
+#define GFMXDECVC1_ERROR_RESYNC_END_OF_FILE (GFMXDVC1_ERROR | 0x00000008)
+
+ /** GFMxDecVC1 error code: GFMxDecVC1DecPicture() got a
+ "P" frame without it's prior reference frame
+ @see GFMxDecVC1DecPicture()
+ */
+#define GFMXDECVC1_ERROR_P_PICTURE_FOUND_AT_START (GFMXDVC1_ERROR | 0x00000009)
+
+ /** GFMxDecVC1 error code: GFMxDecVC1DecPicture() DSP times out while decoding.
+ @see GFMxDecVC1DecPicture()
+ */
+#define GFMXDECVC1_ERROR_DSP_TIMEOUT (GFMXDVC1_ERROR | 0x0000000a) // dsp hang workaround :(
+
+#define GFMxDecVC1SetPicture(hMxDecVC1, pPicture)\
+ ((PGFMXDECVC1TABLE)((NvU32)hMxDecVC1+MXDVC1OFFSET))->MxDecVC1SetPicture(hMxDecVC1, pPicture)
+
+#define GFMxDecVC1SetMBs(hMxDecVC1, pMBs) \
+ ((PGFMXDECVC1TABLE)((NvU32)hMxDecVC1+MXDVC1OFFSET))->MxDecVC1SetMBs(hMxDecVC1, pMBs);
+
+#define GFMxDecVC1SetAttribute(hMxDecVC1, uiFeature, pInfo) \
+ ((PGFMXDECVC1TABLE)((NvU32)hMxDecVC1+MXDVC1OFFSET))->MxDecVC1SetAttribute(hMxDecVC1, uiFeature, pInfo)
+
+#define GFMxDecVC1GetAttribute(hMxDecVC1, uiFeature, pInfo) \
+ ((PGFMXDECVC1TABLE)((NvU32)hMxDecVC1+MXDVC1OFFSET))->MxDecVC1GetAttribute(hMxDecVC1, uiFeature, pInfo)
+
+#define GFMxDecVC1Set(hMxDecVC1, uiFeature, pInfo) \
+ ((PGFMXDECVC1TABLE)((NvU32)hMxDecVC1+MXDVC1OFFSET))->MxDecVC1Set(hMxDecVC1, uiFeature, pInfo)
+
+#define GFMxDecVC1DecResync(hMxDecVC1, ResyncOption) \
+ ((PGFMXDECVC1TABLE)((NvU32)hMxDecVC1+MXDVC1OFFSET))->MxDecVC1DecResync(hMxDecVC1, ResyncOption)
+
+#define GFMxDecVC1InterruptControl(hMxDecVC1, IntType, op, pData)\
+ ((PGFMXDECVC1TABLE)((NvU32)hMxDecVC1+MXDVC1OFFSET))->MxDecVC1InterruptControl(hMxDecVC1, IntType, op, pData)
+
+#define GFMxDecVC1InterruptHandler(hMxDecVC1, IntType, pData)\
+ ((PGFMXDECVC1TABLE)((NvU32)hMxDecVC1+MXDVC1OFFSET))->MxDecVC1InterruptHandler(hMxDecVC1, IntType, pData)
+
+
+ //resynch value
+#define MXDEC_VC1_RESYNC_FORWARD_NEXT_PICTURE 0x00000001
+ // resync to next picture
+#define MXDEC_VC1_RESYNC_FORWARD_NEXT_I_PICTURE 0x00000002
+ // resync to next I Picture
+#define MXDEC_VC1_RESYNC_BACKWARD_PREVIOUS_PICTURE 0x00000004
+ // resync to next picture
+#define MXDEC_VC1_RESYNC_BACKWARD_PREVIOUS_I_PICTURE 0x00000008
+ // resync to next I Picture
+
+ //return value
+#define VC1DECRESYNC_END_OF_FILE 0x00000002 // end of file whie resync
+
+ /*@}*/
+
+ /** @page pageMxDecVC1AppNotes MxDecVC1API Application Notes
+
+ @section pageMxDecVC1AppNotes1 Programming Sequence
+
+ Todo
+ */
+
+
+#ifdef __cplusplus
+} // only need to export C interface if
+// used by C++ source code
+#endif
+
+#endif
+
+
diff --git a/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFMxDemTS.h b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFMxDemTS.h
new file mode 100755
index 00000000..3dbca68e
--- /dev/null
+++ b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFMxDemTS.h
@@ -0,0 +1,725 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/** @file GFMxDemTS.h
+ GFSDK MPEG2 Transport Stream API (host) header file.
+*/
+
+#ifndef _GF_MPEG_TS__
+#define _GF_MPEG_TS__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/** @addtogroup groupMxDemTS MxDemTSAPI MPEG2 Transport Stream Demux API
+
+ This GFSDK component allows to create MPEG TS demux parsers either running
+ on the host or DSP side. TS data can be pushed from the application,
+ or be streamed from VIP.
+
+ The are multiple types of parser objects, see also GFMXDEMTSPARSERTYPE:
+
+ GFMXDEMTSPARSERTYPE_HOST - demux running on host
+ GFMXDEMTSPARSERTYPE_DSP - demux running on DSP
+ GFMXDEMTSPARSERTYPE_DSPAVSYNC - demux running on DSP with additional AVSync functionality
+
+
+ Programming Sequence for Parsers running on Host, TS data from host
+
+ - Call GFMxDemTSParserCreate(), in parameter structure GFMXDEMTSPARSERREQUEST pass
+ parameters #GFMXDEMTSPARSERTYPE_HOST and #GFMXDEMTSPARSERDATASOURCE_PUSH,
+ pass callback functions to handle demuxed substreams
+ - Poll GFMxDemTSParserPushData() to pass the incoming TS stream
+ - Call GFMxDemTSParserDestroy() to destroy parser object
+
+ Programming Sequence for Parsers running on DSP, TS data from host
+
+ - Call GFMxDemTSParserCreate(), in parameter structure GFMXDEMTSPARSERREQUEST pass
+ parameters #GFMXDEMTSPARSERTYPE_DSP and #GFMXDEMTSPARSERDATASOURCE_PUSH,
+ pass callback functions to handle demuxed substreams
+ - Poll GFMxDemTSParserPushData() to pass the incoming TS stream
+ - Call GFMxDemTSParserDestroy() to destroy parser object
+ - Destroy the DSP message handling thread
+
+ Programming Sequence for Parser running on DSP, TS data from VIP
+
+ Only one parser at a time can be created to capture data from VIP.
+ For this mode the parser must run on DSP.
+*/
+/*@{*/
+
+/** GFMxDemTSParser Maximum number of supported Services.
+ For ISDB-T 1seg, the max is 8 according to ARIB TR-B14, p7-28
+*/
+#define GFMXDEMTS_MAX_SERVICE_NO 8
+
+/** GFMxDemTSParser Maximum number of supported Audio PES.
+ For ISDB-T 1seg, the max is 2.
+*/
+#define GFMXDEMTS_MAX_AUDIO_PID_NO 2
+
+/** Get TS Audio PID.
+ For detail see #GFMXDEMTSPARSERAUDIOPIDLIST.
+ @param audio (NvU32) Combined type and ID value
+ */
+#define GFMXDEMTS_GET_AUDIO_PID(audio) (audio & 0x1FFFU) // Get the lower 13 bits
+
+/** Get TS Service Type.
+ For detail see #GFMXDEMTSPARSERAUDIOPIDLIST.
+ @param service (NvU32) Combined type and ID value
+*/
+#define GFMXDEMTS_GET_AUDIO_TYPE(audio) (audio >> 16)
+
+/** TS Audio Pid List. */
+typedef struct _GFMXDEMTSPARSERAUDIOPIDLIST
+{
+ NvU32 uAudioPidList[GFMXDEMTS_MAX_AUDIO_PID_NO]; //!< low 16 bits Audio PID, high 16 bits Audio Type
+ NvU32 uNoOfAudioPids; //!< Number valid entries in uAudioPidList[]
+
+} GFMXDEMTSPARSERAUDIOPIDLIST;
+
+/** Get TS Service ID.
+ For detail see #GFMXDEMTSPARSERPMTPIDLIST.
+ @param service (NvU32) Combined type and ID value
+*/
+#define GFMXDEMTS_GET_PMT_PID(service) ((((NvU32)(service) & 0xffff00) >> 8) | 0x1FC8)
+
+/** Get TS Service Type.
+ For detail see #GFMXDEMTSPARSERPMTPIDLIST.
+ @param service (NvU32) Combined type and ID value
+*/
+#define GFMXDEMTS_GET_PMT_PID_TYPE(service) ((NvU32)(service) & 0x0000ff)
+
+/** TS Service List.
+ */
+typedef struct _GFMXDEMTSPARSERPMTPIDLIST
+{
+ /** Array of services:
+ Array entries format:
+
+ 32 24 23 8 7 0
+ +---------+------------------------------+----------------+
+ | Invalid | Service ID |Service Type |
+ +---------+------------------------------+----------------+
+
+ */
+ NvU32 uPmtPidList[GFMXDEMTS_MAX_SERVICE_NO];
+
+ /** Number of valid entries in GFMXDEMTSPARSERPMTPIDLIST::uPmtPidList[]. */
+ NvU32 uNoOfServices;
+
+} GFMXDEMTSPARSERPMTPIDLIST;
+
+
+/** TS parser types, parameter values for GFMXDEMTSPARSEREQUEST. */
+typedef enum
+{
+ /** Parser running on host system.
+
+ Parser objects of this type run the TS demux on the host system.
+ In contrast to GFMXDEMTSPARSERTYPE_DSP no hardware resources are involved,
+ and any number of parser objects of this type can be created.
+
+ TS data source is always of type GFMXDEMTSPARSERDATASOURCE_PUSH, i.e.
+ it is provided by the application via GFMxDemTSParserProcessData().
+ */
+ GFMXDEMTSPARSERTYPE_HOST = 0,
+
+ /** Parser running on DSP.
+
+ Parser objects of this type will instanciate a task on the DSP
+ to perform the demux processing. Demuxed data is returned to the host.
+ Demuxed audio data can optionally be processed entirely on DSP side
+ via GFMXDEMTSPARSERREQUEST::pAudioBufDesc.
+
+ This parser type is intended for verifying demux functionality.
+
+ TS data can be provided either from the host (GFMXDEMTSPARSERDATASOURCE_PUSH),
+ or acquired automatically from VIP (GFMXDEMTSPARSERDATASOURCE_VIP2DSP).
+ */
+ GFMXDEMTSPARSERTYPE_DSP,
+
+ /** Parser running on DSP with attached AVSync object.
+
+ Parser objects of this type will instanciate 2 tasks on the DSP,
+ one to perform the demux processing, and one to decode AV-synced H264 video.
+ Audio is processed on DSP side via GFMXDEMTSPARSERREQUEST::pAudioBufDesc.
+
+ TS data can be provided either from the host (GFMXDEMTSPARSERDATASOURCE_PUSH),
+ or acquired automatically from VIP (GFMXDEMTSPARSERDATASOURCE_VIP2DSP).
+ */
+ GFMXDEMTSPARSERTYPE_DSPAVSYNC
+
+} GFMXDEMTSPARSERTYPE;
+
+/** TS data sources, parameter values for GFMXDEMTSPARSEREQUEST. */
+typedef enum
+{
+ /** TS data is pushed by the application.
+
+ TS data is fed from the application via function calls to
+ GFMxDemTSParserProcessData().
+ */
+ GFMXDEMTSPARSERDATASOURCE_PUSH = 0,
+
+ /** TS data is intercepted by the DSP task directly from VIP.
+
+ The TS parser task running on the DSP will open the VIP in Type-A
+ interface mode to receive TS data via an interrupt handler.
+
+ This setting can be used only for parsers running on the DSP
+ (#GFMXDEMTSPARSERTYPE is GFMXDEMTSPARSERTYPE_DSP).
+ */
+ GFMXDEMTSPARSERDATASOURCE_VIP2DSP
+
+} GFMXDEMTSPARSERDATASOURCE;
+
+/** TS Parser object states. */
+typedef enum
+{
+ GFMXDEMTSDSPPARSERSTATE_INSTANTIATED=0, //!< Parser object instanciated, but not initialized
+ GFMXDEMTSDSPPARSERSTATE_READY, //!< Parser object initialized, ready to parse
+ GFMXDEMTSDSPPARSERSTATE_ERROR, //!< Parser object dead due to unrecoverable error (out of mem, etc)
+ GFMXDEMTSDSPPARSERSTATE_SHUTDOWN, //!< Parser object initialized, ready to parse, but shutdown initiated
+ GFMXDEMTSDSPPARSERSTATE_PAUSE //!< Parser object paused
+
+} GFMXDEMTSPARSERSTATE;
+
+/** TS Parser demux status bits. */
+typedef enum
+{
+ GFMXDEMTSPARSERSTATUS_PMT_READY = 0x01,
+ GFMXDEMTSPARSERSTATUS_NIT_READY = 0x02,
+ GFMXDEMTSPARSERSTATUS_VIDEO_FOUND = 0x04,
+ GFMXDEMTSPARSERSTATUS_AUDIO_FOUND = 0x08,
+ // if the number of status goes beyond 8, please change m_uStatus to 16 bits or 32 bits in #CNvTransportParser
+
+} GFMXDEMTSPARSERSTATUS;
+
+/** Parameter structure for GFMxDemTSParserGetStatus(). */
+typedef struct
+{
+ GFMXDEMTSPARSERSTATE state; //!< Parser object state
+ NvU32 status; //!< Parser status bitmask, see #GFMXDEMTSPARSERSTATUS
+ NvU32 frameDropCount; //!< Counts dropped frames in AVSync
+
+} GFMxDemTSParserStatus;
+
+/** TS parser notify reasoncodes for GFMXDEMTSPARSERREQUEST::OnNotify callback. */
+typedef enum
+{
+ /** Incoming TS starved. */
+ GFMXDEMTSPARSERNOTIFY_TSSTARVED = 0,
+
+ /** Overflow of TS data coming from VIP. */
+ GFMXDEMTSPARSERNOTIFY_TSOVERFLOW,
+
+ /** Underflow in audio buffer at demux output side. */
+ GFMXDEMTSPARSERNOTIFY_AUDIOUNDERFLOW,
+
+ /** Overflow in audio buffer at demux output side. */
+ GFMXDEMTSPARSERNOTIFY_AUDIOOVERFLOW,
+
+ /** Underflow in video buffer at demux output side. */
+ GFMXDEMTSPARSERNOTIFY_VIDEOUNDERFLOW,
+
+ /** Overflow in video buffer at demux output side. */
+ GFMXDEMTSPARSERNOTIFY_VIDEOOVERFLOW,
+
+ /** Parser detected PMT change.
+ Associated data:
+
+ NvU32 new PMT PID
+ = 2*max ADTS frame size.
+ */
+ NvU32 AudioBufferSize;
+
+ /** Size of video demux buffer to claim in GPU memory.
+ This field is used only for parsers of type GFMXDEMTSPARSERTYPE_DSP and GFMXDEMTSPARSERTYPE_DSPAVSYNC.
+ Size must be power of 2 and <=2^24 bytes.
+ Optimum size depends on H264 bitrate, and should big enough to hold multiple NAL units.
+ */
+ NvU32 VideoBufferSize;
+
+ /** DSP-side handle (address to GFMXDECH264TABLE) of initialized GFMxDecH264 instance.
+ This address is in DSP address space.
+
+ This field is used only for parsers of type GFMXDEMTSPARSERTYPE_DSPAVSYNC.
+
+ @internal
+ */
+ NvU32 MxDecH264DSPHandle;
+
+ /** Video section callback.
+ Ignored for parser type GFMXDEMTSPARSERTYPE_DSPAVSYNC.
+ @param user Application defined parameter, forwarded from GFMXDEMTSPARSERREQUEST::user
+ @param pllPTS Pointer to PTS, or NULL if not existent
+ @param pllDTS Pointer to DTS, or NULL if not existent
+ */
+ GF_RETTYPE (*OnVideoData)(void* user, NvU8* pBytes, NvU32 cbBytes, NvU32 StreamID, NvS64* pllPTS, NvS64* pllDTS, int bPesStart);
+
+ /** Audio section callback, or NULL to use shared DSP buffer.
+
+ Can be NULL for parser type GFMXDEMTSPARSERTYPE_DSP.
+ Ignored for parser type GFMXDEMTSPARSERTYPE_DSPAVSYNC.
+
+ @param user Application defined parameter, forwarded from GFMXDEMTSPARSERREQUEST::user
+ @param pllPTS Pointer to PTS, or NULL if not existent
+ @param pllDTS Pointer to DTS, or NULL if not existent
+ */
+ GF_RETTYPE (*OnAudioData)(void* user, NvU8* pBytes, NvU32 cbBytes, NvU32 StreamID, NvS64* pllPTS, NvS64* pllDTS, int bPesStart);
+
+ /** PCR (Program Clock Reference) callback.
+ @param user Application defined parameter, forwarded from GFMXDEMTSPARSERREQUEST::user
+ @param llPCRBase Clock
+ @param llPCRExt Clock
+ @param uDiscontinuity discontinuity flag
+ */
+ void (*OnPCR)(void* user, NvS64 llPCRBase, NvU32 llPCRExt, NvU32 uDiscontinuity);
+
+ /** Parser object error and status notify callback.
+ @param user Application defined parameter, forwarded from GFMXDEMTSPARSERREQUEST::user
+ @param notifycode Notify reasoncode, see GFMXDEMTSPARSERNOTIFY
+ @param data Data specific to a notifycode
+ */
+ void (*OnNotify)(void* user, NvU32 notifycode, void* data);
+
+ /** Frame Decoded Callback
+ Will be called in sync with PTS of the frame. The passed surface will be locked, and the
+ application must unlock it later via GFMxDecH264Set() with feature ID GF_MXDEC_H264_SET_UNLOCK_SURFACE.
+ @param user Application defined parameter, forwarded from INvTransportParserCallback::user
+ @param surfaceID surface id
+ @param resolution high 16 bit for xres, low 16 bit for yres
+ @param pPTS Pointer to PTS of this frame
+ @param flags Flag bitmask, bit 0 set validity of PAN Scan Info
+ @param PanTopLeft Top-Left Offset for PAN Scan Rect, low 16 bit signed X, top 16 bit signed Y
+ @param PanBottomRight Bottom-Right Offset for PAN Scan Rect , low 16 bit signed X, top 16 bit signed Y
+ @param FrameType I/P Frame Type
+ */
+ void (*OnFrameDecoded)(void* user, NvU32 sufaceID, NvU32 resolution, NvS64* pPTS, NvU32 flags, NvU32 PanTopLeft, NvU32 PanBottomRight, NvU32 FrameType);
+
+ /** TS data callback
+ @param user Application defined parameter, forwarded from GFMXDEMTSPARSERREQUEST::user
+ @param data TS data
+ @param size TS data size
+ */
+ void (*OnTS)(void* user, NvU8* data, NvU32 size);
+
+ /** Application private data, will be forwarded to callbacks */
+ void* user;
+
+ /** Returns address of circular buffer descriptor shared with audio decoder.
+ This address is in DSP address space.
+ This member is valid only, if GFMXDEMTSPARSERREQUEST::OnAudioData is NULL,
+ and if the parser is of type GFMXDEMTSPARSERTYPE_DSP.
+ */
+ GF_RM_DSP_CIRCBUFFER* pAudioBufDesc;
+
+} GFMXDEMTSPARSERREQUEST;
+
+/** H264 Frame Type, the value is equal to Nal Type*/
+typedef enum
+{
+ MXDEMTS_H264_FRAME_IDR = 5,
+ MXDEMTS_H264_FRAME_P = 1,
+ MXDEMTS_H264_FRAME_INVALID = 0,
+} MXDEMTS_H264_FRAME_TYPE;
+
+// Typesafe functions for opening and closing this component
+GF_RETTYPE GFMxDemTSOpen(GFRmHandle hRm, GFMxDemTSHandle *phMxDemTS,
+ GF_STATE_TYPE state, GFRmChHandle hCh);
+void GFMxDemTSClose(GFMxDemTSHandle *phMxDemTS);
+
+/** Create a TS parser.
+
+ This function creates a TS parser running on the host.
+
+ @param TsHandle Handle to TS component
+ @param pParserReq Parameter structure
+ @param pParserHandle Returns handle on success, unchanged on failure
+
+ @retval GF_SUCCESS Success
+ @retval GF_ERROR_OUT_MEMORY Out of memory
+ @retval GFMXDEMTS_ERROR_CREATEDSPPARSER Failed to create parse object on DSP side
+ @retval GFMXDEMTS_ERROR_NODSPSUPPORT No DSP support in GFSDK
+*/
+GF_RETTYPE GFMxDemTSParserCreate(GFMxDemTSHandle TsHandle, GFMXDEMTSPARSERREQUEST* pParserReq, GFMxDemTSParserHandle* pParserHandle);
+
+/** Destroy TS parser.
+
+ Destroy an TS parser object previously created with GFMxDemTSParserCreate().
+ Save to call on NULL handle.
+
+ @param TsHandle Handle to TS component
+ @param pParserHandle Pointer to parser handle, will be reset to NULL on exit
+*/
+void GFMxDemTSParserDestroy(GFMxDemTSHandle TsHandle, GFMxDemTSParserHandle* pParserHandle);
+
+/** Process a section of the TS stream.
+
+ The input Transport Stream is parsed and the section type handlers passed
+ with GFMXDEMTSPARSERREQUEST are called as their sections are encountered in
+ the stream.
+
+ A call of this function is usually triggered by an interrupt to feed the next
+ portion of an incoming Transport Stream.
+
+ On each call of this function at least 188 byte (TS packet size) must be passed.
+ The Transport Stream is parsed in entities of 188 byte packets. If the passed buffer
+ contains an incomplete packet at the end, it will be copied to an internal buffer
+ and automatically combined with the second part on the next function call.
+
+ Thus it is not required to pass in buffers aligned to TS packet starts, and the
+ buffer must not be a multiple of 188 bytes (TS packet size). However
+ doing so will guarant maximum demux performance since copying around incomplete packets
+ can be avoided.
+
+ This function may only be called for parses created with #GFMXDEMTSPARSERDATASOURCE_PUSH.
+
+ @param TsHandle Handle to TS component
+ @param ParserHandle Parser handle
+ @param pData Pointer to buffer containing TS, the buffer must contain
+ at least 188 bytes of stream data. Buffer start does not
+ need to be aligned with the start of an TS package.
+ @param pSize Pointer to buffer size, must be 188 or larger, will be updated
+ on exit with the number of bytes in the buffer, which where consumed.
+ If the parser was created on the DSP, this size must
+ not exceed the buffersize passed in GFMXDEMTSPARSERREQUEST::TSBufferSize.
+ On success GFMxDemTSParserPushData() will always consume all data,
+ on failure *pSize returns the number of bytes that were successfully
+ consumed before the failure occured.
+ @param timeout Time in ms to wait until DSP parser object gets ready to accept new data,
+ or 0 to block forever, (NvU32)-1 to return immediately if busy.
+ Ignored for DSP objects created with #GFMXDEMTSPARSERTYPE_HOST.
+
+ @retval GF_SUCCESS Success
+ @retval GF_WAIT_TIME_OUT Timeout before data could be sent to DSP
+ @retval GF_ERROR_BUSY DSP was busy and data was not sent, call again,
+ returned only if \a timeout was (NvU32)-1
+*/
+GF_RETTYPE GFMxDemTSParserPushData(GFMxDemTSHandle TsHandle, GFMxDemTSParserHandle ParserHandle, NvU8* pData, NvU32* pSize, NvU32 timeout);
+
+/** (Re-)Start VIP TS data capture and demux on DSP.
+
+ This function can be used only for parsers created as #GFMXDEMTSPARSERDATASOURCE_VIP2DSP.
+
+ @param TsHandle Handle to TS component
+ @param ParserHandle Parser handle
+
+ @retval GF_SUCCESS Success
+*/
+GF_RETTYPE GFMxDemTSParserDSPStart(GFMxDemTSHandle TsHandle, GFMxDemTSParserHandle ParserHandle);
+
+/** Pause VIP TS data capture and demux on DSP.
+
+ This function can be used only for parsers created as #GFMXDEMTSPARSERDATASOURCE_VIP2DSP.
+
+ @param TsHandle Handle to TS component
+ @param ParserHandle Parser handle
+ @param onOff Indicate Pause on or off
+
+ @retval GF_SUCCESS Success
+*/
+GF_RETTYPE GFMxDemTSParserDSPPause(GFMxDemTSHandle TsHandle, GFMxDemTSParserHandle ParserHandle, NvU32 onOff);
+
+/** Step to the next Frame.
+
+ @param TsHandle Handle to TS component
+ @param ParserHandle Parser handle
+
+ @retval GF_SUCCESS Success
+*/
+GF_RETTYPE GFMxDemTSParserDSPNextFrame(GFMxDemTSHandle TsHandle, GFMxDemTSParserHandle ParserHandle);
+
+/** Step to the next I Frame.
+
+ @param TsHandle Handle to TS component
+ @param ParserHandle Parser handle
+
+ @retval GF_SUCCESS Success
+*/
+GF_RETTYPE GFMxDemTSParserDSPNextIFrame(GFMxDemTSHandle TsHandle, GFMxDemTSParserHandle ParserHandle);
+
+/** Get TS PmtPid List
+
+ @param TsHandle Handle to TS component
+ @param ParserHandle Parser handle
+ @param pPmtPidList Returns PMT PID List in current TS, with Service ID and Service Type combined
+
+ @retval GF_SUCCESS Success
+ @retval GFMXDEMTS_ERROR_SERVICESLISTUNAVAILABLE NIT/PAT has not been parsed yet.
+
+ @see GFMxDemTSSetPmtPid()
+*/
+GF_RETTYPE GFMxDemTSParserGetPmtPidList(GFMxDemTSHandle TsHandle, GFMxDemTSParserHandle ParserHandle, GFMXDEMTSPARSERPMTPIDLIST *pPmtPidList);
+
+/** Set TS Service
+
+ PMT PID is set without any check. if the new PMT PID is successfully set, a
+ #GFMXDEMTSPARSERNOTIFY_TSPMTCHANGED notify will be sent to the caller application.
+
+ @param TsHandle Handle to TS component
+ @param ParserHandle Parser handle
+ @param uPmtPid uPmtPid to be set
+
+ @retval GF_SUCCESS Success *
+ @see GFMxDemTSGetPmtPidList()
+ */
+GF_RETTYPE GFMxDemTSParserSetPmtPid(GFMxDemTSHandle TsHandle, GFMxDemTSParserHandle ParserHandle, NvU32 uPmtPid);
+
+/** Get Active PmtPid
+
+ @param TsHandle Handle to TS component
+ @param ParserHandle Parser handle
+ @param pServiceID pointer to Active PmtPid.
+
+ @retval GF_SUCCESS Success *
+ */
+GF_RETTYPE GFMxDemTSParserGetActivePmtPid(GFMxDemTSHandle TsHandle, GFMxDemTSParserHandle ParserHandle, NvU32* pPmtPid);
+
+/** Get TS AudioPid List
+
+ @param TsHandle Handle to TS component
+ @param ParserHandle Parser handle
+ @param pAudioPidList Returns AUDIO PID List in current TS, with PID and Type combined
+
+ @retval GF_SUCCESS Success
+ @retval GFMXDEMTS_ERROR_AUDIOPIDLISTUNAVAILABLE NIT/PAT has not been parsed yet.
+
+ @see GFMxDemTSSetAudioPid()
+*/
+GF_RETTYPE GFMxDemTSParserGetAudioPidList(GFMxDemTSHandle TsHandle, GFMxDemTSParserHandle ParserHandle, GFMXDEMTSPARSERAUDIOPIDLIST *pAudioPidList);
+
+/** Set TS Audio Pid
+
+ @param TsHandle Handle to TS component
+ @param ParserHandle Parser handle
+ @param uAudioPid uAudioPid to be set
+
+ @retval GF_SUCCESS Success
+ @retval GFMXDEMTS_ERROR_AUDIOPIDUNAVAILABLE
+ @see GFMxDemTSGetAudioPidList()
+ */
+GF_RETTYPE GFMxDemTSParserSetAudioPid(GFMxDemTSHandle TsHandle, GFMxDemTSParserHandle ParserHandle, NvU32 uAudioPid);
+
+/** Get Active AudioPid
+
+ Audio PID is set if this AUDIO PID exists in current streams. Otherwise return an error
+
+ @param TsHandle Handle to TS component
+ @param ParserHandle Parser handle
+ @param pAudioPid pointer to Active AudioPid.
+
+ @retval GF_SUCCESS Success
+ */
+GF_RETTYPE GFMxDemTSParserGetActiveAudioPid(GFMxDemTSHandle TsHandle, GFMxDemTSParserHandle ParserHandle, NvU32* pAudioPid);
+
+/** Reset All Table Version
+
+ Reset all Table Versions, including PAT, NIT, and PMT.
+ For reset only PMT table version, see GFMxDemTSParserResetPmtTableVersion
+
+ @param TsHandle Handle to TS component
+ @param ParserHandle Parser handle
+
+ @retval GF_SUCCESS Success
+ */
+GF_RETTYPE GFMxDemTSParserResetAllTableVersions(GFMxDemTSHandle TsHandle, GFMxDemTSParserHandle ParserHandle);
+
+/** Reset PMT Table Version
+
+ To reset all table version, see GFMxDemTSParserResetAllTableVersion
+
+ @param TsHandle Handle to TS component
+ @param ParserHandle Parser handle
+
+ @retval GF_SUCCESS Success
+ */
+GF_RETTYPE GFMxDemTSParserResetPmtTableVersion(GFMxDemTSHandle TsHandle, GFMxDemTSParserHandle ParserHandle);
+
+/** Set Play Speed
+
+ Just used for normal play, for trick play, see xxx.
+
+ @param TsHandle Handle to TS component
+ @param ParserHandle Parser handle
+ @param PlaySpeed Play speed to set in 1.0 * 10^6.
+ A value of 100000 plays at 100% of the current sample rate. 100100 plays at 1.1%,
+ 100010 plays at 100.01%, the smallest increment 100001 plays at 100.001%.
+ Number less than 100000 will slow down the stream in the same way.
+ @retval GF_SUCCESS Success
+ */
+GF_RETTYPE GFMxDemTSParserSetPlaySpeed(GFMxDemTSHandle TsHandle, GFMxDemTSParserHandle ParserHandle, NvU32 PlaySpeed);
+
+/** Set VIP Capture
+
+ @deprecated Do not use, will be removed from public API
+
+ @param TsHandle Handle to TS component
+ @param VxHandle the Vx handle for setting VIP
+ @retval GF_SUCCESS Success *
+ */
+GF_RETTYPE GFMxDemTSSetVIP(GFMxDemTSHandle TsHandle, GFVxHandle VxHandle);
+
+/** VIP Capture on Host Side
+
+ @deprecated Do not use, will be removed from public API
+
+ it captures VIP data from host side, instead of DSP side.
+ For VIP Capture from DSP side, see #GFMXDEMTSPARSERREQUEST (GFMXDEMTSPARSERDATASOURCE_VIP2DSP)
+
+ @param TsHandle Handle to TS component
+ @param pBuf Buffer to host VIP data
+ @param pBufSize Maximum buf size for input, and Number bytes captured for output
+ @retval GF_SUCCESS Success *
+ */
+GF_RETTYPE GFMxDemTSPollVIP(GFMxDemTSHandle TsHandle, NvU8* pBuf, NvU32 *pBufSize);
+
+/** Close VIP Capture
+
+ @deprecated Do not use, will be removed from public API
+
+ @param TsHandle Handle to TS component
+ @param VxHandle the Vx handle for setting VIP
+ @retval GF_SUCCESS Success *
+ */
+void GFMxDemTSCloseVIP(GFMxDemTSHandle TsHandle, GFVxHandle VxHandle);
+
+/** Get demux object state and status.
+
+ Check Parser Status, can be called any time on the parser.
+
+ @param TsHandle Handle to TS component
+ @param ParserHandle Parser handle
+ @param pStatus Returns parser object state and status.
+
+ Bits 0-7 Parser status bitmask, see #GFMXDEMTSPARSERSTATUS
+ Bits 8-24 reserved for extension
+ Bits 23-31 Parser state, see #GFMXDEMTSPARSERSTATE
+
+ @retval GF_SUCCESS Success
+ @retval GFRM_ERROR_BAD_PARAMETER Invalid parser handle passed
+ */
+GF_RETTYPE GFMxDemTSParserGetStatus(GFMxDemTSHandle TsHandle, GFMxDemTSParserHandle ParserHandle, GFMxDemTSParserStatus* pStatus);
+
+/** Clear Demux Buffers.
+
+ This will clear demux input TS buffers. For parsers of type
+ GFMXDEMTSPARSERTYPE_DSPAVSYNC it will also clear ES (video and audio) output buffers.
+
+ @param TsHandle Handle to TS component
+ @param ParserHandle Parser handle
+ @retval GF_SUCCESS Success
+ */
+GF_RETTYPE GFMxDemTSParserClearBuffers(GFMxDemTSHandle TsHandle, GFMxDemTSParserHandle ParserHandle);
+
+/** Enable or disable TS data to be returned from DSP to host.
+
+ If disabled the GFMXDEMTSPARSERREQUEST::OnTS callback won't be called anymore.
+ This function has effect for parsers with datasource GFMXDEMTSPARSERDATASOURCE_VIP2DSP only.
+
+ @param TsHandle Handle to TS component
+ @param ParserHandle Parser handle
+ @param enable 0 to disable, !=0 to enable
+ @retval GF_SUCCESS Success
+ */
+GF_RETTYPE GFMxDemTSParserDSPEnableOnTS(GFMxDemTSHandle TsHandle, GFMxDemTSParserHandle ParserHandle, int enable);
+
+/** GFMxDemTSAPI Error code: Create Parser object on DSP failed.
+ @see GFMxDemTSParserCreate()
+*/
+#define GFMXDEMTS_ERROR_CREATEDSPPARSER (GFMXDEMTS_ERROR + 0)
+
+/** GFMxDemTSAPI Error code: GFSDK not setup for DSP support.
+ @see GFMxDemTSParserCreate()
+*/
+#define GFMXDEMTS_ERROR_NODSPSUPPORT (GFMXDEMTS_ERROR + 1)
+
+/** GFMxDemTSAPI Error code: GFMxDemTSGetPmtPidList() called when NIT/PAT not parsed yet.
+ @see GFMxDemTSGetPmtPidList()
+*/
+#define GFMXDEMTS_ERROR_SERVICESLISTUNAVAILABLE (GFMXDEMTS_ERROR + 2)
+
+/** GFMxDemTSAPI Error code: GFMxDemTSSetPmtPid() when a wrong PMT PID is passed.
+ @see GFMxDemTSSetPmtPid()
+*/
+#define GFMXDEMTS_ERROR_SERVICEUNAVAILABLE (GFMXDEMTS_ERROR + 3)
+
+/** GFMxDemTSAPI Error code: GFMxDemTSGetAudioPidList() called when PMT does not parsed yet, or
+ there is no Audio in current service.
+ @see GFMxDemTSGetAudioPidList()
+*/
+#define GFMXDEMTS_ERROR_AUDIOPIDLISTUNAVAILABLE (GFMXDEMTS_ERROR + 4)
+
+/** GFMxDemTSAPI Error code: GFMxDemTSSetAudioPid() when a wrong Audio PID is passed.
+ @see GFMxDemTSSetAudioPid()
+*/
+#define GFMXDEMTS_ERROR_AUDIOPIDUNAVAILABLE (GFMXDEMTS_ERROR + 5)
+
+/** GFMxDemTSAPI Error code: Signal frame decoded.
+ @internal
+*/
+#define GFMXDEMTS_ERROR_AVSYNCFRAMEDECODED (GFMXDEMTS_ERROR + 6)
+
+/** GFMxDemTSAPI Error code: Cannot claim VIP.
+ @see GFMxDemTSParserCreate()
+*/
+#define GFMXDEMTS_ERROR_VIPUNAVAILABLE (GFMXDEMTS_ERROR + 7)
+
+/** GFMxDemTSAPI Error code: GFMxDemTSParserGetActivePmtPid() called when there is pending PMT PID to be set.
+ @see GFMxDemTSParserGetActivePmtPid()
+*/
+#define GFMXDEMTS_ERROR_GETSERVICEPMTPID (GFMXDEMTS_ERROR + 8)
+
+/** GFMxDemTSAPI Semaphore IDs.
+ These IDs can be used in the RmCreateSemaphore implementation of the
+ OS porting layer to identify GFMxDemTSAPI semaphores.
+*/
+typedef enum
+{
+ GFMXDEMTS_SEMAPHORE_TSBUF = GF_MXDEMTSAPI<<24
+
+} GFMXDEMTS_SEMAPHORE;
+
+/*@}*/
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _GF_MPEG_TS__ */
diff --git a/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFMxEnc.h b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFMxEnc.h
new file mode 100755
index 00000000..74d4bee7
--- /dev/null
+++ b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFMxEnc.h
@@ -0,0 +1,795 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+*
+* NVIDIA Corporation and its licensors retain all intellectual property
+* and proprietary rights in and to this software, related documentation
+* and any modifications thereto. Any use, reproduction, disclosure or
+* distribution of this software and related documentation without an
+* express license agreement from NVIDIA Corporation is strictly prohibited.
+*/
+
+/** @file GFMxEnc.h
+GFSDK MPEG Encode API header file.
+*/
+
+// The following ifdef block is the standard way of creating macros which make exporting
+// from a DLL simpler. All files within this DLL are compiled with the GFMXENC_EXPORTS
+// symbol defined on the command line. this symbol should not be defined on any project
+// that uses this DLL. This way any other project whose source files include this file see
+// GFMXENC_API functions as being imported from a DLL, wheras this DLL sees symbols
+// defined with this macro as being exported.
+#ifndef _GF_MPEG_ENC__
+#define _GF_MPEG_ENC__
+
+#include "GFVx.h"
+#include "GFDef.h"
+
+/** @addtogroup groupMxEnc GFMxEncAPI MPEG4 Encode API
+
+ @ref pageMxEncAppNotes
+
+ @ref pageMxEncAppNotes1
+
+
+*/
+/*@{*/
+
+/** MxEncAPI property flag: Support Simple Profile.
+ @see GFMxEncGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_MXENC_CAP_SIMPLE 0x00000001 //Support Simple Profile
+/** MxEncAPI property flag: Support Simple Scale Profile.
+ @see GFMxEncGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_MXENC_CAP_SCALE 0x00000002 //Support Simple Scale Profile
+/** MxEncAPI property flag: Support CORE Profile.
+ @see GFMxEncGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_MXENC_CAP_CORE 0x00000004 //Support CORE Profile
+/** MxEncAPI property flag: Support MAIN Profile.
+ @see GFMxEncGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_MXENC_CAP_MAIN 0x00000008 //Support MAIN Profile
+/** MxEncAPI property flag: Support N_bit profile.
+ @see GFMxEncGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_MXENC_CAP_N_BIT 0x00000010 //Support N_bit Profile
+/** MxEncAPI property flag: Support LEVEL 1.
+ @see GFMxEncGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_MXENC_CAP_LEVEL1 0x00000100 //Support LEVEL 1
+/** MxEncAPI property flag: Support LEVEL 2.
+ @see GFMxEncGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_MXENC_CAP_LEVEL2 0x00000200 //Support LEVEL 2
+/** MxEncAPI property flag: Support LEVEL 3.
+ @see GFMxEncGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_MXENC_CAP_LEVEL3 0x00000400 //Support LEVEL 3
+/** MxEncAPI property flag: Support LEVEL 4.
+ @see GFMxEncGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_MXENC_CAP_LEVEL4 0x00000800 //Support LEVEL 4
+/** MxEncAPI property flag: Support Data Partitioning Mode.
+ @see GFMxEncGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_MXENC_CAP_DATA_PARTITIONING 0x00001000 //Support Data Partitioning Mode
+/** MxEncAPI property flag: Support RVLC Mode.
+ @see GFMxEncGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_MXENC_CAP_RVLC 0x00002000 //Support RVLC Mode
+/** MxEncAPI property flag: Support Rate Control.
+ @see GFMxEncGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_MXENC_CAP_RATE_CONTROL 0x00004000
+//support rate control
+/** MxEncAPI property flag: Support Intra MacroBlock Refreshing.
+ @see GFMxEncGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_MXENC_CAP_IMRF 0x000008000 //Support Intra Macroblock Refreshing
+/** MxEncAPI property flag: Support Rotation.
+ @see GFMxEncGetProperty(), GFPROPERTY::Capability
+*/
+#define GF_MXENC_CAP_ROTATION 0x000010000 //Support Rotation
+
+/** GFMxEncSetVOL parameter struct. */
+typedef struct _GFMXENCVOL
+{
+ NvU32 uiVOLInfo; /**< VOL characteristics */
+ /**<
+
+ #GF_MXENC_VOL_SHORT_VIDEO_HEADER
+ #GF_MXENC_VOL_BYPASS_VLC
+ #GF_MXENC_VOL_RESYNC_MARK_ENABLE
+ #GF_MXENC_VOL_DATA_PARTITION_ENABLE
+ #GF_MXENC_VOL_REVERSIBLE_VLC_ENABLE
+ #GF_MXENC_VOL_RATE_CONTROL_ENABLE
+ #GF_MXENC_VOL_STUFFING_ENABLE
+ #GF_MXENC_VOL_AUTO_IMRF_ENABLE
+ #GF_MXENC_VOL_MC_IMRF_ENABLE
+ #GF_MXENC_VOL_THUMBNAIL_ENABLE
+
+ */
+ PGFRMSURFACE pSrcSurf;/**< Surface to encode*/
+ PGFRECT pSrcRect; /**
+ #GF_MXENC_VOP_4MV_ENABLE
+ #GF_MXENC_VOP_HALF_PEL_ENABLE
+ #GF_MXENC_VOP_PACKET_BASED_ON_MB_NUM
+ #GF_MXENC_VOP_AC_PRE_ALWAYS_ON
+ #GF_MXENC_VOP_AC_PRE_DYNAMICALLY_ON
+ #GF_MXENC_VOP_CHANGE_EXPECTED_SIZE
+ #GF_MXENC_VOP_CHANGE_INITQP
+ #GF_MXENC_VOP_CHANGE_MIN_MAX_QP
+ #GF_MXENC_VOP_4MV_ENABLE
+ #GF_MXENC_VOP_REDUCE_FRAME_RATE
+ #GF_MXENC_VOP_ENCODE_I_ASAP
+ #GF_MXENC_VOP_IMRF_CONTROL_IP_RATIO
+ #GF_MXENC_VOP_LOAD_IMRF_COUNTER_RANGE
+ #GF_MXENC_VOP_LOAD_IMRF_MATRIX
+ #GF_MXENC_VOP_TIMESTAMP_CPU
+ #GF_MXENC_VOP_TIMESTAMP_VI
+ #GF_MXENC_VOP_CHANGE_MAX_QP_RELIEF
+
+ */
+
+ NvU16 uiPacketSize; /**< If GF_MXENC_VOP_PACKET_BASED_ON_MB_NUM flag is on, this field tells the number of macroblocks in a packet. Otherwise, this field tells number of bytes in a packet.*/
+ NvU16 uiIntra_DC_VLC_Thr; /**< Intra DC VLC Threshold*/
+ NvU16 uiHECNum; /**< Frequency to inset HEC marker. 0 means no HEC marker at all. 1~7 means to insert HEC after 1~7 resync marker(s).*/
+ NvU16 uiExpectedISize; /**< If next encoded VOP is I, this field tells GFMxEncAPI the size of bit stream which application expects in number of DWORD.*/
+ NvU16 uiExpectedPSize; /**< If next encoded VOP is P, this field tells GFMxEnc the size of bit stream which application expects in number of DWORD.*/
+ NvU16 uiInitialIQP; /**< Initial QP value for I VOP*/
+ NvU16 uiInitialPQP; /**< Initial QP value for P VOP */
+
+ NvU16 uiMaxIQP; /**< Max QP value for I VOP*/
+ NvU16 uiMinIQP; /**< Min QP value for I VOP */
+
+ NvU16 uiMaxPQP; /**< Max QP value for P VOP*/
+ NvU16 uiMinPQP; /**< Min QP value for P VOP */
+ NvU16 uiMaxQPRelief; /**< Max qp Relief*/
+
+ NvU16 uiNumofP; /**< Number of consecutive P VOPs between two I VOPs.*/
+ NvU16 uiRNumerator; /**< Desired Framerate value. This field must be filled if flag GF_MXENC_VOP_REDUCE_FRAME_RATE is on.*/
+ NvU16 uiRDenominator; /**< Camera Framerate. This field must be filled if flag GF_MXENC_VOP_REDUCE_FRAME_RATE is on.*/
+
+ NvU8 uiIMRFIMinValue; /**< Those values will take effect only when GF_MXENC_VOP_LOAD_IMRF_COUNTER_RANGE flag is set. Whenever an I VOP is encoded, MxEnc will generate a random number in this range for each macroblock.*/
+ NvU8 uiIMRFIMaxValue; /**< Those values will take effect only when GF_MXENC_VOP_LOAD_IMRF_COUNTER_RANGE flag is set. Whenever an I VOP is encoded, MxEnc will generate a random number in this range for each macroblock.*/
+ NvU8 uiIMRFPMinValue; /**< Those values will take effect only when GF_MXENC_VOP_LOAD_IMRF_COUNTER_RANGE flag is set. Whenever a Macro Block counter is reduced to 0, an Intra Macro Block will be generated by MxEnc. MxEnc will generate a random number in this range for this macroblock.*/
+ NvU8 uiIMRFPMaxValue; /**< Those values will take effect only when GF_MXENC_VOP_LOAD_IMRF_COUNTER_RANGE flag is set. Whenever a Macro Block counter is reduced to 0, an Intra Macro Block will be generated by MxEnc. MxEnc will generate a random number in this range for this macroblock.*/
+ NvU8 uiIMRFDefaultCounter; /**< This value will be used as the new counter when the refresh counter in the matrix is decreased to 0.*/
+ NvU8* pMIRFMatrix; /**< Pointer to an array that holds counter for each Macro Block. When this counter is decreased to 0, one Intra Macro Block will be inserted.*/
+
+ NvU32 uiTimeStampModel; /**< Time Stamp Model (VI or CPU).
+
+ #GF_MXENC_VOP_TIMESTAMP_CPU
+ #GF_MXENC_VOP_TIMESTAMP_VI
+
+ */
+
+}GFMXENCVOP, *PGFMXENCVOP;
+
+//uiVOPInfo:
+/**GFMXENCVOP::uiVOPInfo: Enable 4 motion vectors, GFMxEnc will pick 1 MV or 4 MV, depends on which mode is more efficient.*/
+#define GF_MXENC_VOP_4MV_ENABLE 0x00000001
+
+/**GFMXENCVOP::uiVOPInfo : Enable Half Pel Motion Estimation search*/
+#define GF_MXENC_VOP_HALF_PEL_ENABLE 0x00000002
+
+/**GFMXENCVOP::uiVOPInfo:New packet based on the number of MBs. Not the length of the bit stream*/
+#define GF_MXENC_VOP_PACKET_BASED_ON_MB_NUM 0x00000004
+
+/**GFMXENCVOP::uiVOPInfo:AC prediction always on*/
+#define GF_MXENC_VOP_AC_PRE_ALWAYS_ON 0x00000008
+
+/**GFMXENCVOP::uiVOPInfo:AC prediction dynamically on*/
+#define GF_MXENC_VOP_AC_PRE_DYNAMICALLY_ON 0x00000010
+
+/**GFMXENCVOP::uiVOPInfo : Change the expected size for I and P encoded frames. uiExpectedISize, uiExpectedPSize must be filled*/
+#define GF_MXENC_VOP_CHANGE_EXPECTED_SIZE 0x00000020
+
+/**GFMXENCVOP::uiVOPInfo : Change the initial QP for I and P. uiInitialIQP, uiInitialPQP must be filled*/
+#define GF_MXENC_VOP_CHANGE_INITQP 0x00000040
+
+/**GFMXENCVOP::uiVOPInfo : Change the Min and Max QP for I and P frames. uiMaxIQP, uiMinIQP, uiMaxPQP, uiMinPQP must be filled*/
+#define GF_MXENC_VOP_CHANGE_MIN_MAX_QP 0x00000080
+
+/**GFMXENCVOP::uiVOPInfo : Reduce the frame rate by skipping certain frames. uiRNumerator and uiRDenominator must be set.*/
+#define GF_MXENC_VOP_REDUCE_FRAME_RATE 0x00000100
+
+/**GFMXENCVOP::uiVOPInfo : Encode I VOP as soon as possible*/
+#define GF_MXENC_VOP_ENCODE_I_ASAP 0x00000200
+
+/**GFMXENCVOP::uiVOPInfo : Number of P VOPs between two I VOPs controlled by intra macro block refreshing. If this flag is off, it is controlled by uiNumofP*/
+#define GF_MXENC_VOP_IMRF_CONTROL_IP_RATIO 0x00000400
+
+/**GFMXENCVOP::uiVOPInfo : Application can change the counter range by setting this flag and give the range in uiIMRFIMinValue, uiIMRFIMaxValue, uiIMRFPMinValue and uiIMRFPMaxValue. Application only can turn on this flag when GF_MXENC_VOL_AUTO_IMRF_ENABLE is on.*/
+#define GF_MXENC_VOP_LOAD_IMRF_COUNTER_RANGE 0x00000800
+
+/**GFMXENCVOP::uiVOPInfo : Application must fill in uiIMRFDefaultCounter and pIMRFMatrix when this flag is on. Application only can turn on this flag when GF_MXENC_VOL_MC_IMRF_ENABLE flag is on.*/
+#define GF_MXENC_VOP_LOAD_IMRF_MATRIX 0x00001000
+
+/**GFMXENCVOP::uiVOPInfo : Timestamp is provided by CPU*/
+#define GF_MXENC_VOP_TIMESTAMP_CPU 0x00010000
+
+/**GFMXENCVOP::uiVOPInfo: Timestamp is generated by VI*/
+#define GF_MXENC_VOP_TIMESTAMP_VI 0x00020000
+
+/**GFMXENCVOP::uiVOPInfo : Change MAX QP RELIEF value for Rate Control Algorithm*/
+#define GF_MXENC_VOP_CHANGE_MAX_QP_RELIEF 0x00100000
+
+/**typedef struct _GFMXENCRCC*/
+
+typedef struct _GFMXENCRCC
+{
+ NvU16 uiIQP; /**
+ #MXENC_VOP_P_VOP
+ #MXENC_VOP_MORE_FETCH
+ #MXENC_VOP_PORTION_PACKET
+ #MXENC_VOP_MORE_VOP
+ #MXENC_VOP_BEGIN_VOP
+ #MXENC_VOP_END_VOP
+ #MXENC_VOP_BUFFER_OVERFLOW
+
+ */
+ NvU32 uiAverageQP; /**
+ #GF_MXENC_CAP_SIMPLE
+ #GF_MXENC_CAP_SCALE
+ #GF_MXENC_CAP_CORE
+ #GF_MXENC_CAP_MAIN
+ #GF_MXENC_CAP_N_BIT
+ #GF_MXENC_CAP_LEVEL1
+ #GF_MXENC_CAP_LEVEL2
+ #GF_MXENC_CAP_LEVEL3
+ #GF_MXENC_CAP_LEVEL4
+ #GF_MXENC_CAP_DATA_PARTITIONING
+ #GF_MXENC_CAP_RVLC
+ #GF_MXENC_CAP_RATE_CONTROL
+ #GF_MXENC_CAP_IMRF
+ #GF_MXENC_CAP_ROTATION
+
+
+ @retval GF_SUCCESS : If successful.
+ @retval GF_ERROR : If error.
+ @see GFMxEncAPI_Error_Codes
+
+ It is a good practice to call this function to query for the API version
+ and its capabilities before using the rest of the MxEncAPI functions.
+*/
+
+GF_RETTYPE GFMxEncGetStatus(GFMxEncHandle hMxEnc, NvU32 * pStatus);
+/**< This function returns the hardware encoders status.
+
+ @param MXhandle (GFMxEncHandle) Handle specific to the GFMxEncAPI.
+ @param pStatus (NvU32 * ) @see GFMxEncGetStatus Definitions.
+
+ @retval GF_SUCCESS : If successful.
+ @retval GF_ERROR : If error.
+ @see GFMxEncAPI_Error_Codes
+*/
+//pStatus
+/**GFMxEncGetStatus Definitions : If hardware encoder is busy encoding VOPs*/
+#define GF_ENCODER_BUSY 0x00000001
+
+/**GFMxEncGetStatus Definitions : At least one VOP is ready for fetching */
+#define GF_ENCODER_VOP_READY 0x00000002
+
+
+GF_RETTYPE GFMxEncSetVOL(GFMxEncHandle hMxEnc, PGFMXENCVOL pVOL);
+/**< This function sets the characteristics of a new video object layer (VOL) and
+tells the GFMxEncAPI the VOL information. The GFMxEncAPI does not
+generate a VOL bit stream. The application needs to prepare a VOL by itself.
+
+ @param hMxEnc (GFMxEncHandle) Handle specific to the GFMxEncAPI.
+ @param pStatus (PGFMXENCVOL ) Set new VOL information.
+
+ @retval GF_SUCCESS : If successful.
+ @retval GF_ERROR : If error.
+ @see GFMxEncAPI_Error_Codes
+*/
+
+
+
+GF_RETTYPE GFMxEncSetVOP(GFMxEncHandle hMxEnc, PGFMXENCVOP pVOP);
+/**< This function sets the characteristics of a new video object plane (VOP). This
+function should be called after GFMxEncSetVOL() and before
+GFMxEncStart(). If the application decides to change any VOP information
+during the encoding time (after GFMxEncStart()), the application can call
+this function to pass the new VOP information to the GFMxEncAPI.
+Otherwise, the application should not call this function, allowing the
+GFMxEncAPI to reduce overhead.
+
+ @param hMxEnc (GFMxEncHandle) Handle specific to the GFMxEncAPI.
+ @param pStatus (PGFMXENCVOP ) Set new VOP information.
+
+ @retval GF_SUCCESS : If successful.
+ @retval GF_ERROR : If error.
+ @see GFMxEncAPI_Error_Codes
+*/
+
+
+
+GF_RETTYPE GFMxEncRateControlConfig(GFMxEncHandle hMxEnc, PGFMXENCRCC pRCC);
+/**< This function initializes the GFMxEncAPI rate control block. This function is
+optional for application because the GFMxEncAPI automatically initializes
+the rate control block.
+
+ @param hMxEnc (GFMxEncHandle) Handle specific to the GFMxEncAPI.
+ @param pStatus (PGFMXENCRCC ) Set rate control information..
+
+ @retval GF_SUCCESS : If successful.
+ @retval GF_ERROR : If error.
+ @see GFMxEncAPI_Error_Codes
+*/
+
+
+GF_RETTYPE GFMxEncFeedImage(GFMxEncHandle hMxEnc,
+ PGFMXENCFEEDIMAGE pFeedImage);
+/**< The application can call this function if the application has the source image to feed to the encoder.
+This function should not be called if the image comes directly from the video
+input port (VIP), for example, from a camera.
+
+ @param hMxEnc (GFMxEncHandle) Handle specific to the GFMxEncAPI.
+ @param pStatus (PGFMXENCFEEDIMAGE ) New image information.
+
+ @retval GF_SUCCESS : If successful.
+ @retval GF_ERROR : If error.
+ @see GFMxEncAPI_Error_Codes
+*/
+
+
+
+GF_RETTYPE GFMxEncFetchImage(GFMxEncHandle hMxEnc,PGFMXENCFETCHVOP pFetchVOP);
+/**< An application should call this function to fetch the encoded VOP bit stream
+or encoded raw data. If the source image is from the host, the application
+should call this function after GFMxEncFeedImage(). If the source image is
+from a video camera connected to the VIP and the application is using a
+polling scheme, the application should call this function at least at the
+cameras frame rate.
+
+ @param hMxEnc (GFMxEncHandle) Handle specific to the GFMxEncAPI.
+ @param pStatus (PGFMXENCFETCHVOP ) Structure to hold encoded VOP information.
+
+ @retval GF_SUCCESS : If successful.
+ @retval GF_ERROR : If error.
+ @see GFMxEncAPI_Error_Codes
+*/
+
+
+GF_RETTYPE GFMxEncStart(GFMxEncHandle hMxEnc);
+/**< This function starts the GFMxEncAPI module for encoding the bit stream.
+The GFMxEncAPI assumes the first VOP it outputs is the first VOP in the
+current VOL.
+
+ @param hMxEnc (GFMxEncHandle) Handle specific to the GFMxEncAPI.
+
+ @retval GF_SUCCESS : If successful.
+ @retval GF_ERROR : If error.
+ @see GFMxEncAPI_Error_Codes
+*/
+
+GF_RETTYPE GFMxEncPause(GFMxEncHandle hMxEnc);
+/**< This function pauses the encoding process until GFMxEncPause() is called
+again to Resume encoding, or GFMxEncStop() is called to totally stop encoding.
+
+ @param hMxEnc (GFMxEncHandle) Handle specific to the GFMxEncAPI.
+
+ @retval GF_SUCCESS : If successful.
+ @retval GF_ERROR : If error.
+ @see GFMxEncAPI_Error_Codes
+*/
+
+GF_RETTYPE GFMxEncStop(GFMxEncHandle hMxEnc);
+/**< This function stops the encoding process.
+
+ @param hMxEnc (GFMxEncHandle) Handle specific to the GFMxEncAPI.
+
+ @retval GF_SUCCESS : If successful.
+ @retval GF_ERROR : If error.
+ @see GFMxEncAPI_Error_Codes
+*/
+
+GF_RETTYPE GFMxEncSetupInterrupt(GFMxEncHandle hMxEnc,void (*Inter)(void *), void * IPara);
+/**< An application can use this function to set up the interrupt callback function.
+This function must be called before GFMxEncStart().
+If this function returns GF_SUCCESS, whenever a VOP is ready the
+GFMxEncAPI calls the interrupt callback function. Inside of the callback
+function, the application can call GFMxEncSetVOP() if it is needed, and call
+GFMxEncFetchImage() to fetch the encoded VOP.
+If GF_ERROR is returned, the application should use a polling scheme.
+
+
+ @param hMxEnc (GFMxEncHandle) Handle specific to the GFMxEncAPI.
+ @param (*Inter)(void *) (void) Pointer to encoder applications interrupt callback function.
+ @param IPara (void *) Pointer to parameter of encoder applications interrupt callback function.
+
+ @retval GF_SUCCESS : If successful.
+ @retval GF_ERROR : If error.
+ @see GFMxEncAPI_Error_Codes
+*/
+
+
+GF_RETTYPE GFMxEncSetAttribute(GFMxEncHandle hMxEnc, NvU32 uiFeature, NvU32* pInfo);
+/**< This function sets a feature of the MPEG encoder hardware.
+
+ @param hMxEnc (GFMxEncHandle) Handle specific to the GFMxEncAPI.
+ @param uiFeature (NvU32) @see GFMxEncSetAttribute Definitions
+ @param pInfo (NvU32*) Pointer to the information buffer.
+
+ @retval GF_SUCCESS : If successful.
+ @retval GF_ERROR : If error.
+ @see GFMxEncAPI_Error_Codes
+
+ GFMxEncSetAttribute_Definitions:
+
+ #MXENC_ATTR_KEEP_PREV_ENCODING_INTERNAL_RESOURCE
+ #MXENC_PREVIEW_ROTATE_BUFFER
+ #MXENC_GET_PREVIEW_BUFFER
+ #MXENC_ENABLE_INTERRUPT_MODE
+
+
+ MXENC_ENABLE_INTERRUPT_MODE MXENC_GET_PREVIEW_BUFFER MXENC_PREVIEW_ROTATE_BUFFER MXENC_ATTR_KEEP_PREV_ENCODING_INTERNAL_RESOURCE
+*/
+
+
+GF_RETTYPE GFMxEncGetAttribute(GFMxEncHandle hMxEnc, NvU32 uiFeature, NvU32* pInfo);
+/**< This function gets a feature of the MPEG encoder hardware..
+
+ @param hMxEnc (GFMxEncHandle) Handle specific to the GFMxEncAPI.
+ @param uiFeature (NvU32) see GFMxEncGetAttribute_Definitions below.
+ @param pInfo (NvU32*) Pointer to the information buffer.
+
+
+ @retval GF_SUCCESS : If successful.
+ @retval GF_ERROR : If error.
+ @see GFMxEncAPI_Error_Codes
+
+
+
+GFMxEncGetAttribute_Definitions:
+GF4800 and subsequent generation of GPUs have rotator block which can rotate
+video frame before encoding. In a normal mode a Encoder doesn't need to
+capture whole video frame before encoding but in rotation mode, it needs to
+capture full video frame (YUV4:2:0) before encoding. This means rotation
+mode requires more memory.
+This option can be used to enable rotation with 4 basic modes which can be
+ORed with two h-flip and v-flip options.
+Total of 8 unique combination of rotation modes are available.
+*pInfo rotation degree used with MXENC_ATTR_ROTATION
+
+
+ #MXENC_ATTR_ROTATION
+ #MXENC_ATTR_ROTATE_0
+ #MXENC_ATTR_ROTATE_90
+ #MXENC_ATTR_ROTATE_180
+ #MXENC_ATTR_ROTATE_270
+ #MXENC_ATTR_H_FLIP
+ #MXENC_ATTR_V_FLIP
+
+
+
+
+
+*/
+
+/** @name GFMxEncGetAttribute_Definitions
+*/
+//@{
+
+/**GFMxEncGetAttribute_Definitions:
+*/
+
+/**GFMxEncGetAttribute_Definitions::MXENC_ATTR_ROTATION*/
+#define MXENC_ATTR_ROTATION 1
+/**GFMxEncGetAttribute_Definitions::MXENC_ATTR_ROTATE_0*/
+#define MXENC_ATTR_ROTATE_0 0x0
+/**GFMxEncGetAttribute_Definitions::MXENC_ATTR_ROTATE_90*/
+#define MXENC_ATTR_ROTATE_90 0x1
+/**GFMxEncGetAttribute_Definitions::MXENC_ATTR_ROTATE_180*/
+#define MXENC_ATTR_ROTATE_180 0x2
+/**GFMxEncGetAttribute_Definitions::MXENC_ATTR_ROTATE_270*/
+#define MXENC_ATTR_ROTATE_270 0x3
+/**GFMxEncGetAttribute_Definitions::MXENC_ATTR_H_FLIP*/
+#define MXENC_ATTR_H_FLIP 0x10
+/**GFMxEncGetAttribute_Definitions::MXENC_ATTR_V_FLIP*/
+#define MXENC_ATTR_V_FLIP 0x20
+//@}
+
+
+
+GF_RETTYPE GFMxEncInterruptControl(GFMxEncHandle MxHandle);
+/**< This function enables the MxEnc interrupt.
+
+ @param hMxEnc (GFMxEncHandle) Handle specific to the GFMxEncAPI.
+
+ @retval GF_SUCCESS : If successful.
+ @retval GF_ERROR : If error.
+ @see GFMxEncAPI_Error_Codes
+*/
+
+/** @name GFMxEncAPI_Error_Codes
+*/
+//@{
+
+/** GFMXE_SUCCESS*/
+#define GFMXE_SUCCESS GF_SUCCESS
+/** GFMXE_ERROR_NOT_SUPPORT_FORMAT */
+#define GFMXE_ERROR_NOT_SUPPORT_FORMAT (GFMXE_ERROR | 0x00000001)
+/** GFMXE_ERROR_INVALID_PARAMETER */
+#define GFMXE_ERROR_INVALID_PARAMETER (GFMXE_ERROR | 0x00000002)
+/** GFMXE_ERROR_NOT_ENOUGH_EMBEDDED_MEM */
+#define GFMXE_ERROR_NOT_ENOUGH_EMBEDDED_MEM (GFMXE_ERROR | 0x00000003)
+/** GFMXE_ERROR_SET_ATTRIBUTE_FAILED */
+#define GFMXE_ERROR_SET_ATTRIBUTE_FAILED (GFMXE_ERROR | 0x00000004)
+
+//@}
+
+
+ /*@}*/
+
+ /** @page pageMxEncAppNotes MxEncAPI Application Notes
+
+ @section pageMxEncAppNotes1 Programming Sequence
+
+ Todo
+ */
+
+#ifdef __cplusplus
+} // only need to export C interface if
+// used by C++ source code
+#endif
+
+#endif //#ifndef _GF_MPEG_ENC__
diff --git a/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFMxEncH264.h b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFMxEncH264.h
new file mode 100755
index 00000000..f4f81228
--- /dev/null
+++ b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFMxEncH264.h
@@ -0,0 +1,788 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+*
+* NVIDIA Corporation and its licensors retain all intellectual property
+* and proprietary rights in and to this software, related documentation
+* and any modifications thereto. Any use, reproduction, disclosure or
+* distribution of this software and related documentation without an
+* express license agreement from NVIDIA Corporation is strictly prohibited.
+*/
+
+/** @file GFMxEncH264.h
+GFSDK H264 Encode API header file.
+*/
+
+// The following ifdef block is the standard way of creating macros which make exporting
+// from a DLL simpler. All files within this DLL are compiled with the GFMXENC_EXPORTS
+// symbol defined on the command line. this symbol should not be defined on any project
+// that uses this DLL. This way any other project whose source files include this file see
+// GFMXENC_API functions as being imported from a DLL, wheras this DLL sees symbols
+// defined with this macro as being exported.
+#ifndef _GF_MPEG_ENC_H264__
+#define _GF_MPEG_ENC_H264__
+
+#include "GFVx.h"
+
+#include "GFDef.h"
+
+/** @addtogroup groupMxEncH264 MxEncH264API H264 Encode API
+
+ @ref pageMxEncH264AppNotes
+
+ @ref pageMxEncH264AppNotes1
+
+
+*/
+/*@{*/
+
+/** @name GFMxEncH264 API Property Caps */
+//@{
+/** MxEncH264API property flag: Support baseline Profile.
+@see MxEncH264GetProperty(), GFPROPERTY::Capability
+*/
+#define GF_MXENC_H264_CAP_BASELINE 0x00000001 //support baseline profile
+/** MxEncH264API property flag: Support Main Profile.
+@see MxEncH264GetProperty(), GFPROPERTY::Capability
+*/
+#define GF_MXENC_H264_CAP_MAIN 0x00000002 //support main profile
+/** MxEncH264API property flag: Support extended Profile.
+@see MxEncH264GetProperty(), GFPROPERTY::Capability
+*/
+#define GF_MXENC_H264_CAP_EXTENDED 0x00000004 //support extended profile
+/** MxEncH264API property flag: Support high 10 Profile.
+@see MxEncH264GetProperty(), GFPROPERTY::Capability
+*/
+#define GF_MXENC_H264_CAP_HIGH10 0x00000008 //support high 10 profile
+/** MxEncH264API property flag: Support high 422 Profile.
+@see MxEncH264GetProperty(), GFPROPERTY::Capability
+*/
+#define GF_MXENC_H264_CAP_HIGH422 0x00000010 //support high 422 profile
+/** MxEncH264API property flag: Support high 444 Profile.
+@see MxEncH264GetProperty(), GFPROPERTY::Capability
+*/
+#define GF_MXENC_H264_CAP_HIGH444 0x00000020 //support high 444 profile
+/** MxEncH264API property flag: Level_IDC following H.264 spec definition.
+@see MxEncH264GetProperty(), GFPROPERTY::Capability
+*/
+#define GF_MXENC_H264_CAP_LEVEL_IDC(Capability) \
+ ((Capability >> 12) & 0xfff)//Level_IDC following H.264 spec definition
+/** MxEncH264API property flag: Support data partitioning mode.
+@see MxEncH264GetProperty(), GFPROPERTY::Capability
+*/
+#define GF_MXENC_H264_CAP_DATA_PARTITIONING 0x10000000 //support data partitioning mode
+/** MxEncH264API property flag: Support rate control.
+@see MxEncH264GetProperty(), GFPROPERTY::Capability
+*/
+#define GF_MXENC_H264_CAP_RATE_CONTROL 0x20000000 //support rate control
+/** MxEncH264API property flag: Support intra macro block refreshing.
+@see MxEncH264GetProperty(), GFPROPERTY::Capability
+*/
+#define GF_MXENC_H264_CAP_IMRF 0x40000000 //support intra macro block refreshing
+/** MxEncH264API property flag: Support rotation.
+@see MxEncH264GetProperty(), GFPROPERTY::Capability
+*/
+#define GF_MXENC_H264_CAP_ROTATION 0x80000000 //support rotation
+
+//@}
+
+
+
+
+/**typedef struct GFMXENCH264SETSEQUENCE_TAG*/
+typedef struct GFMXENCH264SETSEQUENCE_TAG
+{
+ NvU32 SequenceInfo; /**< Sequence characteristics */
+ /**<
+
+ #GF_MXENC_H264_SEQUENCE_CONSTRAINT_SET0_FLAG
+ #GF_MXENC_H264_SEQUENCE_CONSTRAINT_SET1_FLAG
+ #GF_MXENC_H264_SEQUENCE_CONSTRAINT_SET2_FLAG
+ #GF_MXENC_H264_SEQUENCE_DELTA_PIC_ORDER_ALWAYS_ZERO_FLAG
+ #GF_MXENC_H264_SEQUENCE_FRAME_MBS_ONLY_FLAG
+ #GF_MXENC_H264_SEQUENCE_RATE_CONTROL_ENABLE
+ #GF_MXENC_H264_SEQUENCE_AUTO_IMRF_ENABLE
+ #GF_MXENC_H264_SEQUENCE_MC_IMRF_ENABLE
+ #GF_MXENC_H264_SEQUENCE_REALTIME_ENCODE
+ #GF_MXENC_H264_SEQUENCE_DEBLK_I_SLICE
+
+ */
+ NvU32 profile_idc; /**
+ #GF_MXENC_H264_PICTURE_CHANGE_INIT_QP
+ #GF_MXENC_H264_PICTURE_REDUCE_FRAME_RATE
+ #GF_MXENC_H264_PICTURE_ENCODE_IDR_ASAP
+ #GF_MXENC_H264_PICTURE_CHANGE_MIN_MAX_QP
+ #GF_MXENC_H264_PICTURE_LOAD_IMRF_COUNTER_RANGE
+ #GF_MXENC_H264_PICTURE_LOAD_IMRF_MATRIX
+ #GF_MXENC_H264_PICTURE_4MV_ENABLE
+ #GF_MXENC_H264_PICTURE_HALF_PEL_ENABLE
+ #GF_MXENC_H264_PICTURE_DEBLK_FILTER_ENABLE
+ #GF_MXENC_H264_PICTURE_MULTI_SLICE_ENABLE
+
+ */
+ NvU32 numofSlicesGroup; /**< Number of slice groups, default value = 0 */
+ NvU32 sliceGroupMapType; /**< default value is 0 , interleaved slice groups */
+ NvU32 num_of_ref_idx_10_active; /**< Specifies the maximum reference index for reference picture list 0 ,default value is 0 */
+ NvU32 num_of_ref_idx_11_active; /**< Default value is 0 */
+ NvS32 pic_init_qp; /**< Initial value of the slice QP*/
+ NvS32 pic_init_qs; /**< Initial value of the slice QS */
+ NvS32 chroma_qp_index_offset; /**< Specifies the offset that shall be added to QPY and QSY for addressing the table of QPC values. The value of chroma_qp_index_offset shall be in the range of -12 to +12, inclusive. */
+ NvU32 uiMaxIDRQP; /**< Max QP value for IDR */
+ NvU32 uiMinIDRQP; /**< Min QP value for IDR */
+
+ NvU32 uiMaxNONIDRQP; /**< Max QP value for non-IDR picture */
+ NvU32 uiMinNONIDRQP; /**< Min QP value for non-IDR picture */
+
+ NvU32 SliceAlpha; /**< Aplha value for Deblocking */
+ NvU32 SliceBeta; /**< Beta value for Deblocking */
+
+ /**< Packetisation for H264*/
+ NvU32 uiPacketCtrlDisable; /**< Disables the packet mode control */
+ NvU32 uiPacketMode; /**< If 1 ,then in macroblock mode else in bytes mode, bytes mode not supported */
+ NvU32 uiPacketSize; /**< Packet size in MBs or bytes, packet size in bytes is not supported, Value can range from zero to the number of MBs in a frame */
+
+ NvU32 uiNumofPicBetween2IDRs; /**< Number of P frames in between consecutive I Frames */
+ NvU32 uiRNumerator; /**< Desired Framerate value. This field must be filled if flag GF_MXENC_H264_PICTURE_REDUCE_FRAME_RATE is on. */
+ NvU32 uiRDenominator; /**< Camera Framerate. This field must be filled if flag F_MXENC_H264_PICTURE_REDUCE_FRAME_RATE is on. */
+ NvU32 uiIMRFIMinValue; /**< Those values will take effect only when GF_MXENC_H264_PICTURE_LOAD_IMRF_COUNTER_RANGE flag is set. Whenever an I frame is encoded, MxEncH264 will generate a random number in this range for each macroblock */
+ NvU32 uiIMRFIMaxValue; /**< Those values will take effect only when GF_MXENC_H264_PICTURE_LOAD_IMRF_COUNTER_RANGE flag is set. Whenever an I frame is encoded, MxEncH264 will generate a random number in this range for each macroblock. */
+ NvU32 uiIMRFPMinValue; /**< Those values will take effect only when GF_MXENC_H264_PICTURE_LOAD_IMRF_COUNTER_RANGE flag is set. Whenever a Macro Block counter is reduced to 0, an Intra Macro Block will be generated by MxEncH264. MxEncH264 will generate a random number in this range for this macroblock. */
+ NvU32 uiIMRFPMaxValue; /**< Those values will take effect only when GF_MXENC_H264_PICTURE_LOAD_IMRF_COUNTER_RANGE flag is set. Whenever a Macro Block counter is reduced to 0, an Intra Macro Block will be generated by MxEncH264. MxEncH264 will generate a random number in this range for this macroblock. */
+ NvU32 uiIMRFDefaultCounter; /**< This value will be used as the new counter when the refresh counter in the matrix is decreased to 0. */
+ NvU8 *pIMRFMatrix; /**< Pointer to an array that holds counter for each Macro Block. When this counter is decreased to 0, one Intra Macro Block will be inserted.*/
+
+
+} GFMXENCH264SETPICTURE, *PGFMXENCH264SETPICTURE;
+
+/** @name GFMxEncH264 API Setpicture::PictureInfo */
+//@{
+/**GFMXENCH264SETPICTURE::PictureInfo: When application enables this flag, application must set pic_init_qp, pic_init_qs and chroma_qp_index_offset.*/
+#define GF_MXENC_H264_PICTURE_CHANGE_INIT_QP 0x00000001
+
+/**GFMXENCH264SETPICTURE::PictureInfo:Reduce the frame rate by skipping certain frames, Must set uiRNumerator and uiRDenominator.*/
+#define GF_MXENC_H264_PICTURE_REDUCE_FRAME_RATE 0x00000002
+
+/**GFMXENCH264SETPICTURE::PictureInfo: Encode IDR as soon as possible .*/
+#define GF_MXENC_H264_PICTURE_ENCODE_IDR_ASAP 0x00000004
+
+/**GFMXENCH264SETPICTURE::PictureInfo:When application set this flag, application must set uiMaxIDRQP, uiMinIDRQP, uiMaxNONIDRQP and uiMinNONIDRQP .*/
+#define GF_MXENC_H264_PICTURE_CHANGE_MIN_MAX_QP 0x00000008
+
+/**GFMXENCH264SETPICTURE::PictureInfo:Application changes the counter range by setting this, flag and giving the range in uiIMRFIMinValue uiIMRFIMaxValue, uiIMRFPMinValue, and uiIMRFPMaxValue, Applications can turn on this flag only when GF_MXENC_H264_SEQUENCE_AUTO_IMRF_ENABLE is on.*/
+#define GF_MXENC_H264_PICTURE_LOAD_IMRF_COUNTER_RANGE 0x00000010
+
+/**GFMXENCH264SETPICTURE::PictureInfo: Application must fill in uiIMRFDefaultCounter and pIMRFMatrix if this flag is on, Application can turn on flag only if GF_MXENC_H264_PICTURE_MC_IMRF_ENABLE is on .*/
+#define GF_MXENC_H264_PICTURE_LOAD_IMRF_MATRIX 0x00000020
+
+/**GFMXENCH264SETPICTURE::PictureInfo: Enable 4 motion vectors, GFMxEncH264 will pick 1 MV or 4 MV, depends on which mode is more efficient.*/
+#define GF_MXENC_H264_PICTURE_4MV_ENABLE 0x00000040
+
+/**GFMXENCH264SETPICTURE::PictureInfo: Enable half pel motion estimation search.*/
+#define GF_MXENC_H264_PICTURE_HALF_PEL_ENABLE 0x00000080
+
+/**GFMXENCH264SETPICTURE::PictureInfo: Enable Deblocking.*/
+#define GF_MXENC_H264_PICTURE_DEBLK_FILTER_ENABLE 0x00000100
+
+/**GFMXENCH264SETPICTURE::PictureInfo: Enable Multi Slicing. Mutli-slicing is not supported*/
+#define GF_MXENC_H264_PICTURE_MULTI_SLICE_ENABLE 0x00000200
+//@}
+
+/** typedef struct GFMXENCH264RCC_TAG */
+typedef struct GFMXENCH264RCC_TAG
+{
+ NvU16 uiIQP; /**
+ #GF_MXENC_H264_NALS_SEQUENCE_PARAMETER_SET
+ #GF_MXENC_H264_NALS_PICTURE_PARAMETER_SET
+ #GF_MXENC_H264_NALS_IDR_PIC
+ #GF_MXENC_H264_NALS_NON_IDR_PIC
+ #GF_MXENC_H264_NALS_BEGIN_ACCESS_UNIT
+ #GF_MXENC_H264_NALS_PARTIAL_ACCESS_UNIT
+ #GF_MXENC_H264_NALS_END_ACCESS_UNIT
+ #GF_MXENC_H264_NALS_DATA_NOT_READY
+ #GF_MXENC_H264_NALS_MORE_FETCH
+ #GF_MXENC_H264_NALS_MORE_NALS
+
+ */
+ NvU32 uiTime; /**< In milliseconds, the encoded picture's time stamp. First picture may start from 0. */
+ NvU32 uiFetchedSize; /**< Number of available bytes */
+}GFMXENCH264FETCHNALS, *PGFMXENCH264FETCHNALS;
+
+/** @name GFMXENCH264FETCHNALS::uiNALsInfo definitions */
+//@{
+
+/**GFMXENCH264FETCHNALS::uiNALsInfo:Current NAL unit is a Sequence Parameter Set. */
+#define GF_MXENC_H264_NALS_SEQUENCE_PARAMETER_SET 0x00000001
+
+/**GFMXENCH264FETCHNALS::uiNALsInfo:Current NAL unit is a Picture Parameter Set. */
+#define GF_MXENC_H264_NALS_PICTURE_PARAMETER_SET 0x00000002
+
+/**GFMXENCH264FETCHNALS::uiNALsInfo:Current NAL unit belongs to an IDR Pic. */
+#define GF_MXENC_H264_NALS_IDR_PIC 0x00000004
+
+/**GFMXENCH264FETCHNALS::uiNALsInfo:Current NAL unit belongs to a Non-IDR Pic. */
+#define GF_MXENC_H264_NALS_NON_IDR_PIC 0x00000008
+
+/**GFMXENCH264FETCHNALS::uiNALsInfo:Current data is the start of a new Access Unit. */
+#define GF_MXENC_H264_NALS_BEGIN_ACCESS_UNIT 0x00000010
+
+/**GFMXENCH264FETCHNALS::uiNALsInfo:Current data is a Partial Access Unit. */
+#define GF_MXENC_H264_NALS_PARTIAL_ACCESS_UNIT 0x00000020
+
+/**GFMXENCH264FETCHNALS::uiNALsInfo:Current data is the End of the Access Unit. */
+#define GF_MXENC_H264_NALS_END_ACCESS_UNIT 0x00000040
+
+/**GFMXENCH264FETCHNALS::uiNALsInfo:Data of current NAL is not ready yet.*/
+#define GF_MXENC_H264_NALS_DATA_NOT_READY 0x00000080
+
+/**GFMXENCH264FETCHNALS::uiNALsInfo: Present NAL unit is larger than application's buffer size. Call FetchNALs again to get remaining data.*/
+#define GF_MXENC_H264_NALS_MORE_FETCH 0x00000100
+
+/** GFMXENCH264FETCHNALS::uiNALsInfo: More NALs are encoded and ready to be fetched by the application. */
+#define GF_MXENC_H264_NALS_MORE_NALS 0x00000200
+
+//@}
+
+/** @name GFMxEncH264SetAttribute Definitions */
+//@{
+
+/**GFMxEncH264SetAttribute_Definitions::MXENC_H264_ATTR_ROTATION:
+GF4800 and subsequent generation of GPUs have rotator block which can rotate
+video frame before encoding. In a normal mode a Encoder doesn't need to
+capture whole video frame before encoding but in rotation mode, it needs to
+capture full video frame (YUV4:2:0) before encoding. This means rotation
+mode requires more memory.
+This option can be used to enable rotation with 4 basic modes which can be
+ORed with two h-flip and v-flip options.
+Total of 8 unique combination of rotation modes are available.
+*pInfo rotation degree used with MXENC_ATTR_ROTATION
+*/
+#define MXENC_H264_ATTR_ROTATION 1
+
+#define MXENC_H264_ATTR_ROTATE_0 0x0 /**< No rotation */
+#define MXENC_H264_ATTR_ROTATE_90 0x1 /**< Rotate by 90 degree */
+#define MXENC_H264_ATTR_ROTATE_180 0x2 /**< Rotate by 180 degree */
+#define MXENC_H264_ATTR_ROTATE_270 0x3 /**< Rotate by 270 degree */
+#define MXENC_H264_ATTR_H_FLIP 0x10 /**< Flip horizontally */
+#define MXENC_H264_ATTR_V_FLIP 0x20 /**< Flip vertically */
+
+/**GFMxEncH264SetAttribute_Definitions:MXENC_H264_INTRAREFRESH_MODE
+This option allows you to change the INTRA REFRESH mode while encoding is in progress.
+With this option, the application can switch/Turn ON MXENC_H264_INTRAREFRESH_AUTO or
+MXENC_H264_INTRAREFRESH_MC. After switching to MXENC_H264_INTRAREFRESH_MC mode, the application
+has to call GFMxEncH264SetPicture() with pPicture:pIMRFMatrix specifying the Intra Refresh pattern
+*/
+#define MXENC_H264_INTRAREFRESH_MODE 2
+#define MXENC_H264_INTRAREFRESH_AUTO 0x1 /**< Set Intrarefresh pattern in Auto mode */
+#define MXENC_H264_INTRAREFRESH_MC 0x2 /**< Set Intrarefresh pattern in Motion Compensated mode */
+
+//@}
+
+/** typedef enum GFMX_ENC_H264_INTERRUPT_OPERATION_TYPE : Set Interrupt Operation to perform */
+typedef enum
+{
+ GFMX_ENC_H264_INTERRUPT_ENABLE, /**< Enable Interrupt */
+ GFMX_ENC_H264_INTERRUPT_DISABLE, /**< Disable Interrupt */
+ GFMX_ENC_H264_INTERRUPT_CLEAR /**< Clear Interrupt */
+} GFMX_ENC_H264_INTERRUPT_OPERATION_TYPE; // Interrupt operation.
+
+/** typedef enum GFMX_ENC_H264_INTERRUPT_TYPE : Interrupt type*/
+typedef enum
+{
+ GFMX_ENC_H264_FRAME_ENCODE_DONE_INTR /**< Frame Encode Done Interrupt */
+} GFMX_ENC_H264_INTERRUPT_TYPE;
+
+
+#ifdef __cplusplus
+extern "C" { // only need to export C interface if
+ // used by C++ source code
+#endif
+
+ /** MxEncH264API virtual function pointer table.
+ These functions serve as the entry point to the MxEncH264API from the application.
+ */
+ typedef struct _GFMXEncH264TABLE
+ {
+ GF_RETTYPE (* MxEncH264GetProperty)(GFMxEncH264Handle hMxEncH264, PGFPROPERTY pMXProp );
+ /**< This function returns a variety of information, including the version of the
+ GFMxEncH264API encoder module. It is a good practice to call this function to query
+ for the GFMxEncH264API version and its capabilities before using the rest of the
+ GFMxEncH264API functions.
+
+ @param hMxEncH264 (GFMxEncH264Handle) Handle specific to the GFMxEncH264API.
+ @param pMXProp (PGFPROPERTY) Pointer to GFPROPERTY.
+ MxEncH264API property flag below.
+
+ MxEncH264API property flag:
+
+ #GF_MXENC_H264_CAP_BASELINE
+ #GF_MXENC_H264_CAP_MAIN
+ #GF_MXENC_H264_CAP_EXTENDED
+ #GF_MXENC_H264_CAP_HIGH10
+ #GF_MXENC_H264_CAP_HIGH422
+ #GF_MXENC_H264_CAP_HIGH444
+ #GF_MXENC_H264_CAP_LEVEL_IDC
+ #GF_MXENC_H264_CAP_DATA_PARTITIONING
+ #GF_MXENC_H264_CAP_RATE_CONTROL
+ #GF_MXENC_H264_CAP_IMRF
+ #GF_MXENC_H264_CAP_ROTATION
+
+
+ @retval GF_SUCCESS : If successful.
+ @retval GF_ERROR : If error.
+ @see GFMxEncH264API_Error_Codes
+
+ It is a good practice to call this function to query for the API version
+ and its capabilities before using the rest of the MxEncH264API functions.
+ */
+
+ GF_RETTYPE (* MxEncH264GetStatus)(GFMxEncH264Handle hMxEncH264, NvU32 * pStatus);
+ /**< This function returns the hardware encoders status.
+
+ @param hMxEncH264 (GFMxEncH264Handle) Handle specific to the GFMxEncH264API.
+ @param pStatus (NvU32 * ) Status returned by the encoder. @see GFMxEncH264GetStatus Definitions.
+
+ @retval GF_SUCCESS : If successful.
+ @retval GF_ERROR : If error.
+ @see GFMxEncH264API_Error_Codes
+ */
+
+ GF_RETTYPE (* MxEncH264SetSequence)(GFMxEncH264Handle hMxEncH264, PGFMXENCH264SETSEQUENCE pSequence);
+ /**< This function sets the characteristics of a new H264 video sequence and
+ tells the GFMxEncH264API the sequence information. The GFMxEncH264API does not
+ generate a sequence bit stream. The application needs to prepare a sequence by itself.
+
+ @param hMxEncH264 (GFMxEncH264Handle) Handle specific to the GFMxEncH264API.
+ @param pSequence (PGFMXENCH264SETSEQUENCE ) Set new sequence information.
+
+ @retval GF_SUCCESS : If successful.
+ @retval GF_ERROR : If error.
+ @see GFMxEncH264API_Error_Codes
+ */
+
+ GF_RETTYPE (* MxEncH264SetPicture)(GFMxEncH264Handle hMxEncH264, PGFMXENCH264SETPICTURE pPicture);
+ /**< This function sets the characteristics of a new picture. This
+ function should be called after GFMxEncH264SetSequence() and before
+ GFMxEncH264Start(). If the application decides to change any picture information
+ during the encoding time (after GFMxEncH264Start()), the application can call
+ this function to pass the new picture information to the GFMxEncH264API.
+ Otherwise, the application should not call this function, allowing the
+ GFMxEncH264API to reduce overhead.
+
+ @paramhMxEncH264 (GFMxEncH264Handle) Handle specific to the GFMxEncH264API.
+ @param pPicture (PGFMXENCH264SETPICTURE ) Set new picture information.
+
+ @retval GF_SUCCESS : If successful.
+ @retval GF_ERROR : If error.
+ @see GFMxEncH264API_Error_Codes
+ */
+
+ GF_RETTYPE (* MxEncH264RateControlConfig)(GFMxEncH264Handle hMxEncH264, PGFMXENCH264RCC pRCC);
+ /**< This function initializes the GFMxEncH264API rate control block. This function is
+ optional for application because the GFMxEncH264API automatically initializes
+ the rate control block.
+
+ @param hMxEncH264 (GFMxEncH264Handle) Handle specific to the GFMxEncH264API.
+ @param pRCC (PGFMXENCH264RCC ) Set rate control information..
+
+ @retval GF_SUCCESS : If successful.
+ @retval GF_ERROR : If error.
+ @see GFMxEncH264API_Error_Codes
+ */
+
+ GF_RETTYPE (* MxEncH264FeedImage)(GFMxEncH264Handle hMxEncH264,
+ PGFMXENCH264FEEDIMAGE pFeedImage);
+ /**< The application can call this function if the application has the source image to feed to the encoder.
+ This function should not be called if the image comes directly from the video
+ input port (VIP), for example, from a camera.
+
+ @param hMxEncH264 (GFMxEncH264Handle) Handle specific to the GFMxEncH264API.
+ @param pStatus (PGFMXENCH264FEEDIMAGE ) New image information.
+
+ @retval GF_SUCCESS : If successful.
+ @retval GF_ERROR : If error.
+ @see GFMxEncH264API_Error_Codes
+ */
+
+ GF_RETTYPE (* MxEncH264FetchNALs)(GFMxEncH264Handle hMxEncH264,
+ PGFMXENCH264FETCHNALS pFetchNALs);
+ /**< An application should call this function to fetch the encoded NAL bit stream
+ or encoded raw data. If the source image is from the host, the application
+ should call this function after GFMxEnch264FeedImage(). If the source image is
+ from a video camera connected to the VIP and the application is using a
+ polling scheme, the application should call this function at least at the
+ cameras frame rate.
+
+ @param hMxEncH264 (GFMxEncH264Handle) Handle specific to the GFMxEncH264API.
+ @param pFetchNALs (PGFMXENCH264FETCHNALS ) Structure to hold encoded NAL information.
+
+ @retval GF_SUCCESS : If successful.
+ @retval GF_ERROR : If error.
+ @see GFMxEncH264API_Error_Codes
+ */
+
+ GF_RETTYPE (* MxEncH264Start)(GFMxEncH264Handle hMxEncH264);
+ /**< This function starts the GFMxEncH264API module for encoding the bit stream.
+
+ @param hMxEncH264 (GFMxEncH264Handle) Handle specific to the GFMxEncH264API.
+
+ @retval GF_SUCCESS : If successful.
+ @retval GF_ERROR : If error.
+ @see GFMxEncH264API_Error_Codes
+ */
+ GF_RETTYPE (* MxEncH264Pause)(GFMxEncH264Handle hMxEncH264);
+ /**< This function pauses the encoding process until GFMxEnch264Pause() is called
+ again to Resume encoding, or GFMxEncH264Stop() is called to totally stop encoding.
+
+ @param hMxEnc (GFMxEncH264Handle) Handle specific to the GFMxEncH264API.
+
+ @retval GF_SUCCESS : If successful.
+ @retval GF_ERROR : If error.
+ @see GFMxEncH264API_Error_Codes
+ */
+
+ GF_RETTYPE (* MxEncH264Stop)(GFMxEncH264Handle hMxEncH264);
+ /**< This function stops the encoding process.
+
+ @param hMxEncH264 (GFMxEncH264Handle) Handle specific to the GFMxEncH264API.
+
+ @retval GF_SUCCESS : If successful.
+ @retval GF_ERROR : If error.
+ @see GFMxEncH264API_Error_Codes
+ */
+
+ GF_RETTYPE (* MxEncH264SetupInterrupt)(GFMxEncH264Handle hMxEncH264,
+ void (*Inter)(void *), void * IPara);
+ /**< An application can use this function to set up the interrupt callback function.
+
+
+ @param hMxEncH264 (GFMxEncH264Handle) Handle specific to the GFMxEncH264API.
+ @param (*Inter)(void *) (void) Pointer to encoder applications interrupt callback function.
+ @param IPara (void *) Pointer to parameter of encoder applications interrupt callback function.
+
+ @retval GF_SUCCESS : If successful.
+ @retval GF_ERROR : If error.
+ @see GFMxEncH264API_Error_Codes
+ */
+
+ GF_RETTYPE (* MxEncH264SetAttribute)(GFMxEncH264Handle hMxEncH264, NvU32 uiFeature, NvU32* pInfo);
+ /**< This function sets a feature of the H264 encoder.
+
+ @param hMxEncH264 (GFMxEncH264Handle) Handle specific to the GFMxEncH264API.
+ @param uiFeature (NvU32) @see GFMxEncH264SetAttribute Definitions
+ @param pInfo (NvU32*) Pointer to the information buffer.
+
+ @retval GF_SUCCESS : If successful.
+ @retval GF_ERROR : If error.
+ @see GFMxEncH264API_Error_Codes
+
+ GFMxEncH264SetAttribute_Definitions:
+
+ #MXENC_H264_ATTR_ROTATION
+ #MXENC_H264_INTRAREFRESH_MODE
+
+
+
+ */
+ GF_RETTYPE (* MxEncH264GetAttribute)(GFMxEncH264Handle hMxEncH264, NvU32 uiFeature, NvU32* pInfo);
+ /**< This function gets a feature of the H264 encoder.
+
+ @param hMxEnc (GFMxEncH264Handle) Handle specific to the GFMxEncH264API.
+ @param uiFeature (NvU32) see GFMxEncH264GetAttribute_Definitions below.
+ @param pInfo (NvU32*) Pointer to the information buffer.
+
+
+ @retval GF_SUCCESS : If successful.
+ @retval GF_ERROR : If error.
+ @see GFMxEncAPI_Error_Codes
+
+ */
+
+ }GFMXENCH264TABLE, *PGFMXENCH264TABLE;
+
+ // Typesafe functions for opening and closing this component
+ GF_RETTYPE GFMxEncH264Open(GFRmHandle hRm, GFMxEncH264Handle *phMxEncH264,
+ GF_STATE_TYPE state, GFRmChHandle hCh);
+ /**< Typesafe function for opening the H264 Encoder component.
+
+ @param hRm (GFRmHandle) RM Handle got from GFRmOpen.
+ @param phMxEncH264 (GFMxEncH264Handle *) Handle specific to the GFMxEncH264API is returned in this.
+ @param state (GF_STATE_TYPE) .
+ @param hCh (GFRmChHandle) Channel handle
+ */
+
+ void GFMxEncH264Close(GFMxEncH264Handle *phMxEncH264);
+ /**< Typesafe function for closing the H264 Encoder component.
+
+ @param phMxEncH264 (GFMxEncH264Handle *) Pointer to handle specific to H264 encoder component.
+ */
+
+ /** @name GFMxEncH264GetStatus Definitions */
+ //@{
+#define GF_ENCODER_BUSY 0x00000001 /**< Encoder is busy */
+#define GF_ENCODER_VOP_READY 0x00000002 /**< At least one VOP is ready for fetching */
+ //@}
+
+/** @name GFMxEncH264API Helper Macros. */
+ //@{
+
+#define GFMxEncH264GetProperty(hMxEncH264, pMXProp) \
+ ((PGFMXENCH264TABLE)hMxEncH264)->MxEncH264GetProperty(hMxEncH264, pMXProp)
+ /**< Helper macro for GFMxEncH264API.
+ @see GFMXENCH264TABLE::MxEncH264GetProperty
+ */
+
+#define GFMxEncH264GetStatus(hMxEncH264, pStatus) \
+ ((PGFMXENCH264TABLE)hMxEncH264)->MxEncH264GetStatus(hMxEncH264, pStatus)
+ /**< Helper macro for GFMxEncH264API.
+ @see GFMXENCH264TABLE::MxEncH264GetStatus
+ */
+
+#define GFMxEncH264SetSequence(hMxEncH264, pSequence) \
+ ((PGFMXENCH264TABLE)hMxEncH264)->MxEncH264SetSequence(hMxEncH264, pSequence)
+ /**< Helper macro for GFMxEncH264API.
+ @see GFMXENCH264TABLE::MxEncH264SetSequence
+ */
+
+#define GFMxEncH264SetPicture(hMxEncH264, pPicture)\
+ ((PGFMXENCH264TABLE)hMxEncH264)->MxEncH264SetPicture(hMxEncH264, pPicture)
+ /**< Helper macro for GFMxEncH264API.
+ @see GFMXENCH264TABLE::MxEncH264SetPicture
+ */
+
+#define GFMxEncH264RateControlConfig(hMxEncH264, pRCC)\
+ ((PGFMXENCH264TABLE)hMxEncH264)->MxEncH264RateControlConfig(hMxEncH264, pRCC)
+ /**< Helper macro for GFMxEncH264API.
+ @see GFMXENCH264TABLE::MxEncH264RateControlConfig
+ */
+
+#define GFMxEncH264FeedImage(hMxEncH264, pFeedImage)\
+ ((PGFMXENCH264TABLE)hMxEncH264)->MxEncH264FeedImage(hMxEncH264, pFeedImage)
+ /**< Helper macro for GFMxEncH264API.
+ @see GFMXENCH264TABLE::MxEncH264FeedImage
+ */
+
+#define GFMxEncH264FetchNALs(hMxEncH264, pFetchNALs)\
+ ((PGFMXENCH264TABLE)hMxEncH264)->MxEncH264FetchNALs(hMxEncH264, pFetchNALs)
+ /**< Helper macro for GFMxEncH264API.
+ @see GFMXENCH264TABLE::MxEncH264FetchNALs
+ */
+
+#define GFMxEncH264Start(hMxEncH264)\
+ ((PGFMXENCH264TABLE)hMxEncH264)->MxEncH264Start(hMxEncH264)
+ /**< Helper macro for GFMxEncH264API.
+ @see GFMXENCH264TABLE::MxEncH264Start
+ */
+
+#define GFMxEncH264Pause(hMxEncH264)\
+ ((PGFMXENCH264TABLE)hMxEncH264)->MxEncH264Pause(hMxEncH264)
+ /**< Helper macro for GFMxEncH264API.
+ @see GFMXENCH264TABLE::MxEncH264Pause
+ */
+
+#define GFMxEncH264Stop(hMxEncH264)\
+ ((PGFMXENCH264TABLE)hMxEncH264)->MxEncH264Stop(hMxEncH264)
+ /**< Helper macro for GFMxEncH264API.
+ @see GFMXENCH264TABLE::MxEncH264Stop
+ */
+
+#define GFMxEncH264SetupInterrupt(hMxEncH264, Inter,IPara)\
+ ((PGFMXENCH264TABLE)hMxEncH264)->MxEncH264SetupInterrupt(hMxEncH264, Inter,IPara)
+ /**< Helper macro for GFMxEncH264API.
+ @see GFMXENCH264TABLE::MxEncH264SetupInterrupt
+ */
+
+#define GFMxEncH264SetAttribute(hMxEncH264, uiFeature, pInfo) \
+ ((PGFMXENCH264TABLE)hMxEncH264)->MxEncH264SetAttribute(hMxEncH264, uiFeature, pInfo)
+ /**< Helper macro for GFMxEncH264API.
+ @see GFMXENCH264TABLE::MxEncH264SetAttribute
+ */
+
+#define GFMxEncH264GetAttribute(hMxEncH264, uiFeature, pInfo) \
+ ((PGFMXENCH264TABLE)hMxEncH264)->MxEncH264GetAttribute(hMxEncH264, uiFeature, pInfo)
+ /**< Helper macro for GFMxEncH264API.
+ @see GFMXENCH264TABLE::MxEncH264GetAttribute
+ */
+
+ //@}
+
+ /** @name GFMxEncH264API_Error_Codes
+ */
+ //@{
+
+ /** GFMXEH264_SUCCESS*/
+#define GFMXEH264_SUCCESS GF_SUCCESS
+ /** GGFMXEH264_ERROR_NOT_SUPPORT_FORMAT*/
+#define GFMXEH264_ERROR_NOT_SUPPORT_FORMAT (GFMXEH264_ERROR | 0x00000001)
+ /** GFMXEH264_ERROR_INVALID_PARAMETER*/
+#define GFMXEH264_ERROR_INVALID_PARAMETER (GFMXEH264_ERROR | 0x00000002)
+ /** GFMXEH264_ERROR_NOT_ENOUGH_EMBEDDED_MEM*/
+#define GFMXEH264_ERROR_NOT_ENOUGH_EMBEDDED_MEM (GFMXEH264_ERROR | 0x00000003)
+ //@}
+
+
+ /*@}*/
+
+ /** @page pageMxEncH264AppNotes MxEncH264API Application Notes
+
+ @section pageMxEncH264AppNotes1 Programming Sequence
+
+ The following procedure requires that GFRmOpen() is called first to start GFSDK usage. The description is for a typical case
+ where encoding of video being captured from a camera is done and preview shown on the display.
+
+ 1. Initialize the display panel by using GFRmIxInit().\n
+
+ 2. Open the display component by calling GFDxOpen() to get the GFMxDecAPI Dxhandle.\n
+
+ 3. Initialize the display start address, stride and bits per pixel using GFDxSetDisplay().\n
+
+ 4. Get the various attributes of the display panel (width, height, etc) using GFDxGetAttribute().\n
+
+ 5. For clearing the screen, open the graphics component using GFGxOpen() and use GFGxFillRect() for filling the screen with
+ some color (say, green).\n
+
+ 6. Open the Vx component using GFVxOpen() and get the GFVxAPI VxHandle. \n
+
+ 7. Setup the camera. \n
+
+ 8. Initialize VIP. \n
+
+ 9. Obtain the handle specific to H264 encoder by calling GFMxEncH264Open(). \n
+
+ 10. Call GFMxEncH264GetProperty() to query properties. Check whether this version can support the desired H264 profile and level. \n
+
+ 11. If supported, call GFRmSurfaceAlloc() to allocate one surface for encoding purposes. \n
+
+ 12. Call GFMxEncH264SetAttribute() if specific features need to be set. \n
+
+ 13. Call GFMxEncH264SetSequence() for configuring the characteristics of a new H264 video sequence. \n
+
+ 14. Call GFMxEncH264SetPicture() for setting the characteristics of a new picture. \n
+
+ 15. If the current source image is from the CPU, the application should call GFMxEncH264FeedImage() to feed the
+ image to the GFMxEncH264API. If the current source image is coming from the VIP (for example. camera input), the
+ application should skip the GFMxEncH264FeedImage() call.
+
+ 16. If the application uses an interrupt scheme, it must implement a callback function and set it up using GFMxEncH264SetupInterrupt.
+ Inside of the callback function, the application should call GFMxEncH264FetchNALs() to retrieve the encoded NALs. \n
+
+ 17. Start the encoding by calling GFMxEncH264Start(). \n
+
+ 18. The application should periodically call the callback function to get the data from the encoder. \n
+
+ 19. The encoder can be paused by calling GFMxEncH264Pause() and can be resumed by calling GFMxEncH264Pause() again. \n
+
+ 20. Before exiting, call GFMxEncH264Stop() to stop the encoder. \n
+
+ 21. Call the callback function after waiting for some time to get the data for the last frame encoded. \n
+
+ 22. Free all relevent resources and call GFMxEncH264Close() to free the H264 encoder component. \n
+
+ */
+
+#ifdef __cplusplus
+} // only need to export C interface if
+// used by C++ source code
+#endif
+
+#endif //#ifndef _GF_MPEG_ENC_H264__
diff --git a/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFOSx.h b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFOSx.h
new file mode 100755
index 00000000..f3f48b0d
--- /dev/null
+++ b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFOSx.h
@@ -0,0 +1,39 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/** @file GFOSx.h
+ GFSDK OS Abstraction API header file.
+*/
+
+#ifndef __GFOSx_H__
+#define __GFOSx_H__
+
+#include "GFRmOEM.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+/** @addtogroup groupOSx OSxAPI OS Abstraction API
+*/
+/*@{*/
+
+// Typesafe functions for opening and closing this component
+GF_RETTYPE GFOSxOpen(GFRmHandle hRm, GFOSxHandle *phOSx,
+ GF_STATE_TYPE state, GFRmChHandle hCh);
+void GFOSxClose(GFOSxHandle *phOSx);
+
+/*@}*/
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // _GFOSx_H_
diff --git a/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFOption.h b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFOption.h
new file mode 100755
index 00000000..c54f0d7e
--- /dev/null
+++ b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFOption.h
@@ -0,0 +1,140 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/** @file GFOption.h
+ GFSDK (Compile-time) Option header file.
+ Contains user level options and selected compile-time options.
+*/
+
+#ifndef __GFOPTION_H__
+#define __GFOPTION_H__
+
+#include "cpuopsys.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+
+/***************************************************************************
+ * Hardware Dependent Options and Compile-time selections
+ ***************************************************************************/
+
+/** @name Device ID options and compile-time selection
+ @anchor DeviceIDs
+ #GF_DEVICE_ID_DEFAULT option is for selecting any ID.
+@{*/
+
+#define GF_DEVICE_ID_DEFAULT 0x0000
+#define GF_DEVICE_ID_SC11 0x0011
+#define GF_DEVICE_ID_SC15 0x0015
+#define GF_DEVICE_ID_SC14 0x0014
+
+#ifndef GF_DEVICE_ID
+#define GF_DEVICE_ID GF_DEVICE_ID_SC15
+ // Primary chip id
+#endif /* GF_DEVICE_ID */
+
+#define GF_DEVICE_ID_MASK 0x0000FFFF
+#define GF_DEVICE_ID_SHIFT 0
+#define GF_DEVICE_ID_VALUE( val ) \
+ (((val) >> GF_DEVICE_ID_SHIFT) & GF_DEVICE_ID_MASK)
+/*@}*/
+
+/** @name Device Revision options and compile-time selection
+ @anchor DeviceRevisions
+ #GF_DEVICE_REV_DEFAULT is for selecting any revision.
+ Always use 16bit when referring Device Revision only.
+@{*/
+#define GF_REV_A1 0x00A1
+#define GF_REV_A2 0x00A2
+#define GF_REV_A3 0x00A3
+#define GF_REV_A4 0x00A4
+
+#define GF_DEVICE_REV_DEFAULT 0x0000
+#ifndef GF_DEVICE_REV
+#define GF_DEVICE_REV GF_DEVICE_REV_DEFAULT
+ //!< Primary chip revision
+#endif /* GF_DEVICE_REV */
+
+#define GF_DEVICE_REV_MASK 0x0000FFFF
+#define GF_DEVICE_REV_SHIFT 16
+#define GF_DEVICE_REV_VALUE( val ) \
+ (((val) >> GF_DEVICE_REV_SHIFT) & GF_DEVICE_REV_MASK)
+
+/*@}*/
+
+#if defined(NVCPU_XTENSA)
+
+// On DSP, we always use direct addressing.
+#define GF_DEVICE_ADDRESS_DEFAULT GF_DEVICE_ADDRESS_DIRECT
+#define GF_DEVICE_ADDRESS GF_DEVICE_ADDRESS_DIRECT
+
+#else
+
+// On host CPU, direct & indirect addressing are available in runtime. Default
+// is direct addressing.
+#ifndef GF_DEVICE_ADDRESS_DEFAULT
+#define GF_DEVICE_ADDRESS_DEFAULT GF_DEVICE_ADDRESS_DIRECT
+#endif /* GF_DEVICE_ADDRESS_DEFAULT */
+
+#ifndef GF_DEVICE_ADDRESS
+#define GF_DEVICE_ADDRESS ( GF_DEVICE_ADDRESS_DIRECT \
+ | GF_DEVICE_ADDRESS_INDIRECT16 \
+ | GF_DEVICE_ADDRESS_INDIRECT8 \
+ | GF_DEVICE_ADDRESS_INDIRECT32)
+#endif /* GF_DEVICE_ADDRESS */
+
+#endif
+
+
+
+/***************************************************************************
+ * Operating system Dependent Options
+ ***************************************************************************/
+
+/* The bootloader has already initialized the chip and display. To avoid
+ * writing the hardware again (which can cause screen flicker and other
+ * symptoms that the customer doesn't like), define this variable to 1.
+ */
+#ifndef GF_BOOTLOADER_PRESENT
+#define GF_BOOTLOADER_PRESENT 0
+#endif
+
+
+
+
+// If we're compiling for the bootloader right now, of course the
+// bootloader cannot be present
+#ifdef GF_BOOT_LIB
+#undef GF_BOOTLOADER_PRESENT
+#define GF_BOOTLOADER_PRESENT 0
+#endif
+
+/**************************************************************************
+ * GFSDK Library Auto Compiler Options
+ * Attempts to set up enough options if none is specified by Build Project.
+ **************************************************************************/
+
+// XXX We should get rid of NV_DEBUG, so we don't have both DEBUG and NV_DEBUG
+#if defined(NV_WINDOWS) && !defined(NV_WINDOWS_CE)
+#ifdef _DEBUG
+#ifndef NV_DEBUG
+#define NV_DEBUG 1
+#endif
+#endif
+#endif
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __GFOPTION_H__ */
+
diff --git a/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFRm.h b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFRm.h
new file mode 100755
index 00000000..6669abcd
--- /dev/null
+++ b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFRm.h
@@ -0,0 +1,2039 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/** @file GFRm.h
+ GFSDK Resource Manager API header file.
+*/
+
+#ifndef __GFRM_H__
+#define __GFRM_H__
+
+#include "GF.h"
+#include "GFRmError.h"
+
+/** @addtogroup groupRm RmAPI Resource Manager API
+
+ @ref pageRmAppNotes
+
+
+*/
+/*@{*/
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+#include "GFRmScr.h"
+
+/** Hardware Module IDs.
+ List of all the modules in the SCXX chips.
+*/
+typedef enum
+{
+#define GFRM_MODULE(x,y) MODID_##x,
+#include "gfrm_module_ids.h"
+#undef GFRM_MODULE
+ GFNUMOFMODULEIDS
+} eGFModuleIDs;
+
+/** @name Power Planes/Islands
+ List of all the power planes in the SCXX chips.
+@{*/
+
+/** Power Plane ID: Core Power Plane. */
+#define GFPPID_AOCVDD 0x00000001
+
+/** Power Plane ID: Video Codec Power Plane. */
+#define GFPPID_VECVDD 0x00000002
+
+/** Power Plane ID: SRAM Power Plane. */
+#define GFPPID_MMCVDD 0x00000004
+
+/** Power Plane ID: 3D Power Plane. */
+#define GFPPID_TDCVDD 0x00000008
+
+/** Power Plane ID: SRAM I/O Power Plane. */
+#define GFPPID_EMVDD 0x00000010
+
+/** Power Plane ID: Mostly Bus Interface Power Plane. */
+#define GFPPID_HVDD 0x00000020
+
+/** Power Plane ID: Video I/O Power Plane. */
+#define GFPPID_VVDD 0x00000040
+
+/** Power Plane ID: LCD I/O Power Plane. */
+#define GFPPID_LVDD 0x00000080
+
+/** Power Plane ID: Audio I/O Power Plane. */
+#define GFPPID_ACVDD 0x00000100
+
+/** Power Plane ID: SD I/O Power Plane. */
+#define GFPPID_SDVDD 0x00000200
+
+/** Power Plane ID: Oscillator Power Plane. */
+#define GFPPID_AVDDOSC 0x00000400
+
+/** Power Plane ID: PLL1 Power Plane. */
+#define GFPPID_AVDDP1 0x00000800
+
+/** Power Plane ID: PLL2 Power Plane. */
+#define GFPPID_AVDDP2 0x00001000
+
+/** Power Plane ID: DRAM Power Plane. */
+#define GFPPID_DRAM 0x00002000
+
+/** Number of power plane IDs. */
+#define GFNUMOFPPIDS 14
+
+/*@}*/
+
+/** @name States for Component Manager and general services
+@{*/
+
+/** State for registering Component.
+ @see GF_STATE_TYPE, GFRmComponentGet().
+*/
+#define GF_STATE_REGISTER 0x00000001
+
+/** State for unregistering Component.
+ @see GF_STATE_TYPE, GFRmComponentRelease().
+ */
+#define GF_STATE_UNREGISTER 0x00000002
+
+/** State for unregistering all Components (internal used only).
+ @see GF_STATE_TYPE, GFRmComponentRelease().
+ */
+#define GF_STATE_UNREGISTER_ALL 0x00000004
+
+/** General Enable State.
+ @see GF_STATE_TYPE.
+*/
+#define GF_STATE_ENABLE 0x00000008
+
+/** General Disable State.
+ @see GF_STATE_TYPE.
+*/
+#define GF_STATE_DISABLE 0x00000010
+
+/** General Done State.
+ @see GF_STATE_TYPE.
+*/
+#define GF_STATE_DONE 0x00000020
+
+/** State for instantiating a new or share Component.
+ @see GF_STATE_TYPE, GFRmComponentGet().
+ */
+#define GF_STATE_NEW_OR_SHARE 0x00000100
+
+/** State for instantiating a new Component only.
+ @see GF_STATE_TYPE, GFRmComponentGet().
+ */
+#define GF_STATE_NEW_ONLY 0x00000200
+
+/** State for instantiating a share Component only.
+ @see GF_STATE_TYPE, GFRmComponentGet().
+ */
+#define GF_STATE_SHARE_ONLY 0x00000400
+
+/** State indicating special Block Device Component (internal use).
+ @see GF_STATE_TYPE, GFRmComponentGet().
+ */
+#define GF_STATE_BLOCK_DEVICE 0x80000000
+
+/** Default Component instantiation State.
+ @see GF_STATE_TYPE, GFRmComponentGet().
+ */
+#define GF_STATE_DEFAULT GF_STATE_NEW_OR_SHARE
+
+/** Mask for the regular States.
+ @see GF_STATE_TYPE.
+*/
+#define GF_STATE_MASK 0x000000FF
+
+/*@}*/
+
+
+/** Attributes ID/Values.
+ @see GFRmGetAttribute(), GFRmSetAttribute().
+*/
+typedef enum
+{
+ /** Attribute for changing device bus addressing (direct/indirect) mode. */
+ GF_ATTRIB_DEVICE_ADDRESS,
+
+ /** Attribute for mapped/virtual/usable I/O base address. */
+ GF_ATTRIB_IO_MAP_BASE,
+
+ /** Attribute for mapped/virtual/usable embedded memory base. */
+ GF_ATTRIB_EMBEDDED_MEM_MAP_BASE,
+
+ /** Attribute for initial embedded internal memory size. */
+ GF_ATTRIB_INIT_EMBEDDED_MEM_TOTAL,
+
+ /** Attribute for initial available embedded internal memory size. */
+ GF_ATTRIB_INIT_EMBEDDED_MEM_AVAIL,
+
+ /** Attribute for initial embedded extended memory size. */
+ GF_ATTRIB_INIT_EXT_EMBEDDED_MEM_TOTAL,
+
+ /** Attribute for user specific object 0. */
+ GF_ATTRIB_USER_OBJECT_0,
+
+ /** Attribute for user specific object 1. */
+ GF_ATTRIB_USER_OBJECT_1,
+
+ /** Attribute for user specific object 2. */
+ GF_ATTRIB_USER_OBJECT_2,
+
+ /** Attribute for user specific object 3. */
+ GF_ATTRIB_USER_OBJECT_3,
+
+ /** Attribute for swapping memory allocation with shared embedded memory
+ MAX CHUNK scheme. For advanced user only. */
+ GF_ATTRIB_SWAP_SHARE_MEMORY_ALLOC_ON_MAX_CHUNK,
+
+ /** Get device information structure.
+ GFRmGetAttribute() parameter \a AttribData is of type PGFRMDEVICEINFO.
+ */
+ GF_ATTRIB_DEVICE_INFO_STRUCT,
+
+ /** For internal use only. */
+ GF_ATTRIB_RMC_FLAG,
+
+ /** Enable/Disable Hardware Resource Constraint. */
+ GF_ATTRIB_HW_RESOURCE_CONSTRAINT,
+
+ /** Enable embedded extended memory. */
+ GF_ATTRIB_ENABLE_EXTENDED_MEMORY,
+
+ /** Disable RMC trace, closing any log files that might be opened */
+ GF_ATTRIB_DISABLE_RMC_TRACE,
+
+ /** Set/Clr surface with absolute rotation option. */
+ GF_ATTRIB_SURFACE_ABSOLUTE_ROTATE,
+
+ /** Primary surface freeing policy. */
+ GF_ATTRIB_PRIMSURF_FREEING_POLICY,
+
+ /** Primary surface allocation policy. */
+ GF_ATTRIB_PRIMSURF_ALLOCATION_POLICY,
+
+ /** Internal use. */
+ GF_ATTRIB_EFUSE_PRODUCT_SKU_ID,
+
+ /** Internal use. */
+ GF_ATTRIB_MAIN_PANEL_INDEX,
+
+ /** GFRm attribute: Set DSP2Host communication mode.
+
+ This attribute can be used to control how components wait
+ for messages from the DSP. The following options for \a AttribData are available:
+ - #GF_ATTRIB_DSPCOMMODE_POLLING -- Register polling.
+ This mode is intended for debuging only, since it allows only one client
+ to use DSP2Host interrupts.
+ - #GF_ATTRIB_DSPCOMMODE_EVENT -- Receive DSP2Host messages via an interrupt framework.
+ This mode requires an ISR/IST to be setup, that handles DSP interrupts and calls
+ GFRmDispatchMessage().
+
+ The default setting is register polling.
+
+ Attribute can be get and set.
+
+ @see GFRmSetAttribute(), GFRmGetAttribute(), GFRmQueueSetHandler(), GFRmDispatchMessage()
+ */
+ GF_ATTRIB_DSPCOMMODE,
+
+ /** Set surface for DSP debug console output.
+
+ This sets a surface which will be used to output text from the DSP debug console.
+ The DSP XRM must be initialized before this function can be called.
+
+ GFRmSetAttribute() parameter \a AttribData is of type #PGFRMSURFACE and defines a pointer to a
+ surface descriptor.
+
+ @retval GF_SUCCESS Successfully send message
+ @retval GF_WAIT_TIME_OUT Timeout sending message
+ @retval GFRM_ERROR_BAD_PARAMETER Bad parameters, e.g. surface color format is not supported
+
+ @see GFRmSetAttribute()
+
+ Attribute can be set only.
+ */
+ GF_ATTRIB_DSPCONSOLE_SURFACE,
+
+ /** Internal use. */
+ GF_ATTRIB_USE_CAMERA_SCRIPT,
+
+ /** Internal use. */
+ GF_ATTRIB_DEVICE_TYPE,
+
+ /** Timeout in ms for RM IST to wait for interrupts.
+ Set to 0 to disable timeout, default setting is 1000 ms.
+ GFRmSetAttribute() parameter \a AttribData is of type NvU32 and defines timout in ms.
+ */
+ GF_ATTRIB_INTX_TIMEOUT,
+
+ /** Enable debug printout for GPU memory allocations.
+
+ GFRmSetAttribute() parameter \a AttribData is of type NvU32,
+ - 0 means disable log (default)
+ - !=0 means enable log
+
+ This GFRmSetAttribute() call always succeeds.
+
+ @see GFRmSetAttribute()
+
+ Attribute can be set only.
+ */
+ GF_ATTRIB_GPUMEM_ENABLELOG
+
+} GF_ATTRIBUTE_TYPE;
+
+/** DSP2Host communication modes, polling.
+ @see GF_ATTRIB_DSPCOMMODE
+*/
+#define GF_ATTRIB_DSPCOMMODE_POLLING 0
+/** DSP2Host communication modes, OS event synchronization.
+ @see GF_ATTRIB_DSPCOMMODE
+*/
+#define GF_ATTRIB_DSPCOMMODE_EVENT 1
+
+/** GFSDK (low-level) device interface type. (Read Only)
+ * @see GF_ATTRIB_DEVICE_TYPE.
+ **/
+#define GF_ATTRIB_DEVICE_TYPE_HARDWARE 0x00000000
+#define GF_ATTRIB_DEVICE_TYPE_SIMULATOR 0x00001000
+
+
+/** @name Component Types
+
+@{*/
+
+/** Component Type: EPP Component.
+ @anchor ComponentTypes
+*/
+#define GF_EPPAPI 0x00000001L
+
+/** Component Type: Gx (2D) API Component. */
+#define GF_GXAPI 0x00000002L
+
+/** Component Type: Vx (general Video and Video Input Port) API Component. */
+#define GF_VXAPI 0x00000003L
+
+/** Component Type: JxE (JPEG Encode) API Component. */
+#define GF_JXEAPI 0x00000004L
+
+/** Component Type: JxE (JPEG Decode) API Component. */
+#define GF_JXDAPI 0x00000005L
+
+/** Component Type: MxE (MPEG Encode) API Component. */
+#define GF_MXEAPI 0x00000006L
+
+/** Component Type: MxD (MPEG Decode) API Component. */
+#define GF_MXDAPI 0x00000007L
+
+// 0x8 is unused
+
+/** Component Type: Dx (Display and Flat Panel) API Component. */
+#define GF_DXAPI 0x00000009L
+
+// 0xA is unused
+
+/** Component Type: ISP (Image Signal Processing) API Component. */
+#define GF_ISPAPI 0x0000000BL
+
+/** Component Type: FDev (Pseudo File System/Device) API Component. */
+#define GF_FDEVAPI 0x0000000CL
+
+/** Component Type: BDevSD (SD Block Device) Component. */
+#define GF_BDEVSDAPI 0x0000000DL
+
+// 0xE is unused
+// 0xF is unused
+
+/** Component Type: OSx (Operating System) API COmponent */
+#define GF_OSXAPI 0x00000010L
+
+/** Component Type: I2C API Component */
+#define GF_I2CAPI 0x00000011L
+
+/** Component Type: I2S API COmponent */
+#define GF_I2SAPI 0x00000012L
+
+/** Component Type: MMProc (Audio) API COmponent */
+#define GF_MMPROCAPI 0x00000013L
+
+/** Component Type: CAM (Camera) API Component */
+#define GF_CAMAPI 0x00000014L
+
+/** Component Type: 3D API Component */
+#define GF_3DAPI 0x00000015L
+
+/** Component Type: INTx (Interrupt) API COmponent */
+#define GF_INTXAPI 0x00000016L
+
+/** Component Type: MXDH264 (H264 Decoder) API COmponent */
+#define GF_MXDH264API 0x00000017L
+
+/** Component Type: MXEH264 (H264 Encoder) API Component */
+#define GF_MXEH264API 0x00000018L
+
+/** Component Type: RM (Resource Manager) Services (listed only for return status). */
+#define GF_RMAPI 0x00000019L
+
+/** Component Type: GxFB (Gx/2D API with Frame Buffer rendering) API. Internal Use. */
+#define GF_GXFBAPI 0x0000001AL
+
+/** MXDRV9 (RV9 Decoder) API COmponent */
+#define GF_MXDRV9API 0x0000001BL
+
+/** Component Type: MXDVC1 (VC1 Decoder) API Component */
+#define GF_MXDVC1API 0x0000001CL
+
+/** Component Type: MXDEMTS (MPEG TS Demux) API Component */
+#define GF_MXDEMTSAPI 0x0000001DL
+
+/** Component Type: Minimal ISP API Component (NvIsp) */
+#define GF_MINIMALISPAPI 0x0000001EL
+
+/** Component Type: NvISP API Component ID -- only used for GF_TRACE */
+#define NV_ISPAPI 0x0000001FL
+
+/*@}*/
+
+/** NULL driver related. Internal use. */
+#define GF_USE_NULL_DRIVER 0x1
+
+/** NULL driver related. Internal use. */
+#define GF_USE_HW_DRIVER 0x2
+
+
+/** @name Hardware Resources
+ @anchor HardwareResources
+ Flags 'hwEngineReq' in GFRmHwResourceConstraint(). (not working yet).
+ @see GFRmHwResourceConstraint().
+@{*/
+
+/** Hardware resource flag: MPEG Decoder Engine. */
+#define GF_HWR_MPEGD 0x00000001
+
+/** Hardware resource flag: JPEG Decoder is same as MPEG Decoder Engine. */
+#define GF_HWR_JPEGD 0x00000001
+
+/** Hardware resource flag: MPEG Encoder Engine. */
+#define GF_HWR_MPEGE 0x00000002
+
+/** Hardware resource flag: JPEG Encoder shares FrontEnd and BackEnd with JPEG Enc Engine. */
+#define GF_HWR_JPEGE 0x00000002
+
+/** Hardware resource flag: Video Input Port. */
+#define GF_HWR_VIP 0x00000004
+
+/** Hardware resource flag: EPP */
+#define GF_HWR_EPP 0x00000008
+
+
+
+/** Options for GFRmHwResourceConstraint().
+ (not working yet!)
+ @see GFRmHwResourceConstraint().
+*/
+typedef enum
+{
+ /** check availability and allocate hardware resource. */
+ GF_HRC_ALLOCATE,
+
+ /** free hardware resource. */
+ GF_HRC_FREE,
+
+ /** check availability of hardware resource. */
+ GF_HRC_CHECK
+} GF_HRC_OPTIONS;
+
+/*@}*/
+
+/** Component ID structure. */
+typedef struct _GFRMCOMPONENTID
+{
+ NvU32 ComponentType; /**< Component Type, see @ref ComponentTypes. */
+ GFRmChHandle CxtHandle;
+} GFRMCOMPONENTID, *PGFRMCOMPONENTID;
+
+/* Component */
+
+/* forward declaration */
+typedef struct _GFRMCOMPONENT GFRMCOMPONENT, *PGFRMCOMPONENT;
+
+typedef GF_HANDLE (* GFOPENFUNCTIONTYPE)(GFRmHandle pRm, GFRmChHandle);
+typedef GF_RETTYPE (* GFCLOSEFUNCTIONTYPE)(GF_HANDLE *);
+
+/** Component Registration structure.
+ Internal use.
+ @internal
+*/
+struct _GFRMCOMPONENT
+{
+ GFRMCOMPONENTID id; /**< Structure defining component. */
+ GFOPENFUNCTIONTYPE Open; /**< Component Open callback. Called from GFRmComponentGet(). */
+ GFCLOSEFUNCTIONTYPE Close; /**< Component Close callback. Called from GFRmComponentRelease(). */
+};
+
+
+/** @name Surface Types
+ @anchor SurfaceTypes
+ @see GFRmSurfaceAlloc().
+@{*/
+
+/** Surface Type: Surface rotation orientation at 0 degree. */
+#define GF_SURFACE_ROTATE_0 0x00000000
+
+/** Surface Type: Surface rotation orientation at 90 degree (relative to _ROTATE_0). */
+#define GF_SURFACE_ROTATE_90 0x10000000
+
+/** Surface Type: Surface rotation orientation at 180 degree (relative to _ROTATE_0). */
+#define GF_SURFACE_ROTATE_180 0x20000000
+
+/** Surface Type: Surface rotation orientation at 270 degree (relative to _ROTATE_0). */
+#define GF_SURFACE_ROTATE_270 0x30000000
+
+/*
+ * GF_SURFACE_H_FLIP and GF_SURFACE_V_FLIP can be ORed with above 4 rotation
+ * options to create 16 combinations but in reality there are only 8 unique
+ * combinations.
+ */
+
+/** Surface Type: Horizontal Flip. You can or'ed this flag with _ROTATE_ flag above too. */
+#define GF_SURFACE_H_FLIP 0x40000000
+
+/** Surface Type: Vertical Flip. You can or'ed this flag with _ROTATE_ flag above too. */
+#define GF_SURFACE_V_FLIP 0x80000000
+
+/** Surface Type: internal use. */
+#define GF_SURFACE_ROTATE_MASK 0xF0000000
+
+/** Surface Type: internal use. */
+#define GF_SURFACE_PLANAR_ROTATE_MASK 0x30000000
+
+/** Surface Type: internal use. */
+#define GF_SURFACE_ROTATE_SHIFT 28 // bits[31:28]
+
+/** Surface Type: internal use. */
+#define GF_SURFACE_ROTATE_WRAP 8
+
+/** Surface Type: Primary Surface (default rotate orientation). */
+#define GF_SURFACE_PRIMARY 0x00000001 //primary surface
+
+/** Surface Type: Primary Surface with 0 degree rotation. */
+#define GF_SURFACE_PRIMARY_0 (GF_SURFACE_PRIMARY| GF_SURFACE_ROTATE_0)
+
+/** Surface Type: Primary Surface with 90 degree rotation. */
+#define GF_SURFACE_PRIMARY_90 (GF_SURFACE_PRIMARY| GF_SURFACE_ROTATE_90)
+
+/** Surface Type: Primary Surface with 180 degree rotation. */
+#define GF_SURFACE_PRIMARY_180 (GF_SURFACE_PRIMARY| GF_SURFACE_ROTATE_180)
+
+/** Surface Type: Primary Surface with 180 degree rotation. */
+#define GF_SURFACE_PRIMARY_270 (GF_SURFACE_PRIMARY| GF_SURFACE_ROTATE_270)
+
+/** Surface Type: Overlay Surface. */
+#define GF_SURFACE_OVERLAY 0x00000002
+
+/** Surface Type: Surface to reside in embedded (video) memory. */
+#define GF_SURFACE_VIDEO_MEMORY 0x00000004
+
+/** Surface Type: Surface to reside in system memory. */
+#define GF_SURFACE_SYSTEM_MEMORY 0x00000008
+
+/** Surface Type: Sub primary surface (for Sub LCD). */
+#define GF_SURFACE_PRIMARY_SUB 0x00000100 //Sub primary surface
+
+/** Surface Type: Surface to be allocated from "share" embedded memory for
+ advanced use only.
+ Cannot be used with #GF_SURFACE_PRIMARY.
+ No effect with #GF_SURFACE_SYSTEM_MEMORY.
+*/
+#define GF_SURFACE_SHARE 0x00001000
+
+/** Surface Type: Allocate surface with pre-allocated memory handle. */
+#define GF_SURFACE_PREALLOCATED_MEM 0x00002000
+
+/** Request to use new API */
+#define GF_SURFACE_NEW_API 0x01000000
+
+/*
+ * Note: GF_SURFACE_ROTATE_ refers to caller's view of current logical
+ * orientation relative to Primary Surface. And Primary surface is
+ * always set to GF_SURFACE_ROTATE_0 even though physical LCD Display
+ * panel may require different physical orientation.
+ */
+
+/*@}*/
+
+/** @name Surface Hints
+ @anchor SurfaceHints
+ @see GFRmSurfaceAlloc().
+@{*/
+
+/** Surface Hint: Alloc from highest possible position. */
+#define GF_SURFACE_HINT_TOP_DOWN 0x1
+
+/** Surface Hint: Alloc from lowest possible position. */
+#define GF_SURFACE_HINT_BOTTOM_UP 0x2
+
+/** Surface Hint: Alloc max chunck of memory. */
+#define GF_SURFACE_HINT_MAX_CHUNK 0x4
+
+/** Surface Hint: Try allocations from external memory first before internal memory */
+#define GF_SURFACE_HINT_EXT_MEMORY_PREFERRED 0x8
+
+/** Surface Hint: Try allocations only from external memory. */
+#define GF_SURFACE_HINT_EXT_MEMORY_ONLY 0x10
+
+/** Surface Hint: Try allocations only from internal memory. */
+#define GF_SURFACE_HINT_INT_MEMORY_ONLY 0x20
+
+/** Surface Hint: Alloc from embedded memory, YUV in the same contiguous memory.
+ Valid only for GF_SURFACE_YUV420.
+*/
+#define GF_SURFACE_HINT_CONTIGUOUS_MEMORY 0x40
+
+/** Surface Hint: Try allocations from internal memory first before external memory */
+#define GF_SURFACE_HINT_INT_MEMORY_PREFERRED 0x80
+
+/** Surface Hint: Hints to align stride to 4 bytes - default for YUV422 */
+#define GF_SURFACE_HINT_STRIDE_ALIGN4 0x100
+
+/** Surface Hint: Hints to align stride to 8 bytes */
+#define GF_SURFACE_HINT_STRIDE_ALIGN8 0x200
+
+/** Surface Hint: Hints to align stride to 16 bytes */
+#define GF_SURFACE_HINT_STRIDE_ALIGN16 0x400
+
+/** Surface Hint: Hints to align stride to 32 bytes */
+#define GF_SURFACE_HINT_STRIDE_ALIGN32 0x800
+
+/** Surface Hint: Surface will be used for direct read by the applications */
+#define GF_SURFACE_NEED_DIRECT_CPU_READ 0x1000
+
+/** Surface Hint: Surface will be used for direct write by the applications */
+#define GF_SURFACE_NEED_DIRECT_CPU_WRITE 0x2000
+
+/** Surface Hint: Surface will be used for direct access by the applications
+ both read and write actions are allowed
+ */
+#define GF_SURFACE_NEED_DIRECT_CPU_ACCESS \
+ (GF_SURFACE_NEED_DIRECT_CPU_READ | GF_SURFACE_NEED_DIRECT_CPU_WRITE)
+/*@}*/
+
+/** @name Primary surface allocation and freeing policies
+ @see GFRmSetAttribute().
+@{*/
+
+/** Any avaliable memory. Use with GF_ATTRIB_PRIMSURF_ALLOCATION_POLICY. */
+#define GF_ATTRIB_PRIMSURF_ALLOCP_NONE 0x0
+
+/** Allocate Primary surface from embedded extended memory.
+ Use with GF_ATTRIB_PRIMSURF_ALLOCATION_POLICY.
+*/
+#define GF_ATTRIB_PRIMSURF_ALLOCP_USE_EXT_MEM 0x1
+
+/** Allocate Primary surface from internal memory (SRAM).
+ Use with GF_ATTRIB_PRIMSURF_ALLOCATION_POLICY.
+*/
+#define GF_ATTRIB_PRIMSURF_ALLOCP_USE_INT_MEM 0x2
+
+/** Use with GF_ATTRIB_PRIMSURF_FREEING_POLICY. */
+#define GF_ATTRIB_PRIMSURF_FREEP_NONE 0x0
+
+/** Never free, Default policy. Use with GF_ATTRIB_PRIMSURF_FREEING_POLICY. */
+#define GF_ATTRIB_PRIMSURF_FREEP_NEVER_FREE 0x0
+
+/** Free when the ref count is zero. Use with GF_ATTRIB_PRIMSURF_FREEING_POLICY. */
+#define GF_ATTRIB_PRIMSURF_FREEP_FREE_ON_EMPTY 0x1
+
+/** Force free. Use with GF_ATTRIB_PRIMSURF_FREEING_POLICY. */
+#define GF_ATTRIB_PRIMSURF_FREEP_FORCE_FREE 0x2
+
+/*@}*/
+
+/** Surface structure.
+ @see GFRmSurfaceAlloc(), GFRmSurfaceFree().
+*/
+typedef struct _GFRMSURFACE
+{
+ NvU32 width; /**< Width in pixels. */
+ NvU32 height; /**< Height in lines. */
+ NvU32 SurfaceType; /**< Surface type, see @ref SurfaceTypes. */
+ NvU32 ColorFormat; /**< Surface color format, see @ref SurfaceTypes. */
+
+ NvU32 YStride; /**< Stride for RGB, YUV422 surfaces, or Y plane. */
+ NvU32 UStride; /**< U plane stride */
+ NvU32 VStride; /**< V plane stride */
+
+ GFRmMemHandle YMemHandle; /**< Opaque handle for RGB, YUV422 surface, or Y plane memory. */
+ GFRmMemHandle VMemHandle; /**< Opaque handle for V plane memory. */
+ GFRmMemHandle UMemHandle; /**< Opaque handle for U plane memory. */
+
+ NvU32 YOffset; /**< Physical address of RGB, YUV422 surfae, or Y plane. */
+ NvU32 UOffset; /**< Physical address of U plane. */
+ NvU32 VOffset; /**< Physical address of U plane. */
+
+ /* Direct addressable pointer to the memory region. Don't
+ use these pointers, unless you want to run only in
+ "direct addressing mode". Instead, use handles for reading
+ or writing to the memory from the host, and offsets for
+ programming the hardware registers. */
+
+ NvU8 *pY; /**< Pointer to non-planar surface or Y plane of YUV420, valid only for direct addressing. */
+ NvU8 *pU; /**< for YUV420 surface, valid only for direct addressing. */
+ NvU8 *pV; /**< for YUV420 surface, valid only for direct addressing. */
+
+ NvU32 memUsed; /**< Total number of bytes used by surfaces. */
+
+ //void *reserved; // Reserved. Do not modify
+} GFRMSURFACE, *PGFRMSURFACE;
+
+/** Surface Request
+ @see GFRmSurfaceAlloc(), GFRmSurfaceFree().
+*/
+typedef struct _GFRMSURFACEREQUEST
+{
+ NvU32 width; /**< Width in pixels. */
+ NvU32 height; /**< Height in lines. */
+ NvU32 SurfaceType;/**< Surface type, see @ref SurfaceTypes. */
+ NvU32 ColorFormat;/**< Surface color format, see @ref SurfaceTypes. */
+ NvU32 hint; /**< Allocation hint or 0, see @ref SurfaceHints. */
+ NvU8 *pMem; /**< Pointer to pre-allocated memory from which
+ to allocate the surface planes. */
+ NvU32 memSize; /**< Size of pre-allocated Y plane memory. */
+ NvU32 id; /**< User defined ID to track allocated block, debugging use */
+
+ /* Reserved for future */
+ /* GF_RETTYPE (* pSurfaceCallBack)
+ ( GFRmHandle RmHandle, PGFRMSURFACE pSurface); */
+ /* Reserved for future */
+ /* PGFRMSURFACE pSurfaceShare; */
+} GFRMSURFACEREQUEST, *PGFRMSURFACEREQUEST;
+
+/** Device Info */
+typedef struct _GFRMDEVICEINFO
+{
+ NvU32 MinorRev;
+ NvU32 MajorRev;
+ NvU32 ChipID;
+ NvU32 Family;
+} GFRMDEVICEINFO, *PGFRMDEVICEINFO;
+
+/** @name Surface Update Flags
+ @anchor SurfaceUpdateFlags
+ @see GFRmSurfaceUpdate()
+@{*/
+
+/** GFRmSurfaceUpdate() attribute type: Update surface rotation.
+
+ The following values are valid for parameter \a data of GFRmSurfaceUpdate():
+
+ #GF_SURFACE_ROTATE_0
+ #GF_SURFACE_ROTATE_90
+ #GF_SURFACE_ROTATE_180
+ #GF_SURFACE_ROTATE_270
+
+
+ @see GFRmSurfaceUpdate()
+*/
+#define GF_SURFACE_UPDATE_ROTATE 0x00000001
+
+/** GFRmSurfaceUpdate() attribute type: Update surface width.
+
+ Meaning of parameter \a data of GFRmSurfaceUpdate():
+ New surface width in pixels.
+
+ The number of bytes required for the new width must not exceed the
+ surface stride. It is the responsibility of the caller to ensure this.
+
+ @see GFRmSurfaceUpdate()
+*/
+#define GF_SURFACE_UPDATE_WIDTH 0x00000002
+
+/** GFRmSurfaceUpdate() attribute type: Update surface height.
+
+ Meaning of parameter \a data of GFRmSurfaceUpdate():
+ New surface height in line.
+
+ The set height * surface stride must not exceed the memory allocated
+ for the surface. It is the responsibility of the caller to ensure this.
+
+ @see GFRmSurfaceUpdate()
+*/
+#define GF_SURFACE_UPDATE_HEIGHT 0x00000003
+
+/** GFRmSurfaceUpdate() attribute type: Update surface width and stride.
+
+ Meaning of parameter \a data of GFRmSurfaceUpdate():
+ New surface width in pixels.
+
+ YStride, UStride, and VStride will be updated automatically according
+ to alignment requirements. Supported colour formats:
+ - GF_SURFACE_YUV420
+
+ @see GFRmSurfaceUpdate()
+*/
+#define GF_SURFACE_UPDATE_WIDTH_STRIDE 0x00000004
+
+/*@}*/
+
+
+/** @name Memory types
+ @anchor MemoryTypes
+ @see GFRMMEMORYREQUEST, GFRmMemHandleAlloc()
+@{*/
+
+/** Memory Type: Host system memory. */
+#define GF_MEMORY_SYSTEM 0x01
+/** Memory Type: Any GPU memory */
+#define GF_MEMORY_EMBEDDED 0x02
+/** Memory Type: Memory mapped memory. */
+#define GF_MEMORY_MEMMAPPED 0x04
+/** Memory Type: External GPU memory only. */
+#define GF_MEMORY_EMBEDDED_EXT_ONLY GF_MEMORY_EMBEDDED_EXT
+#define GF_MEMORY_EMBEDDED_EXT 0x08
+/** Memory Type: Internal GPU memory only. */
+#define GF_MEMORY_EMBEDDED_INT_ONLY GF_MEMORY_EMBEDDED_INT
+#define GF_MEMORY_EMBEDDED_INT 0x10
+/** Memory type: Internal or external memory with preference to internal memory. */
+#define GF_MEMORY_EMBEDDED_INT_PREFERRED 0x20
+/** Memory type: External or internal memory with preference to external memory. */
+#define GF_MEMORY_EMBEDDED_EXT_PREFERRED 0x40
+/** Memory type: Direct Read access */
+#define GF_MEMORY_DIRECT_CPU_READ_ACCESS 0x80
+/** Memory type: Direct Write access */
+#define GF_MEMORY_DIRECT_CPU_WRITE_ACCESS 0x100
+
+/** Memory type: Direct Read/Write access */
+#define GF_MEMORY_DIRECT_CPU_ACCESS (GF_MEMORY_DIRECT_CPU_WRITE_ACCESS | GF_MEMORY_DIRECT_CPU_READ_ACCESS)
+
+/*@}*/
+
+/** @name Memory Share Types
+ @anchor MemoryShare
+ @see GFRMMEMORYREQUEST, GFRmMemHandleAlloc()
+@{*/
+
+/** Memory Share Flag: Internal use, used in GFRmMemInfo only. */
+#define GF_MEMORY_SHARE 0x80
+
+/*@}*/
+
+/** @name Memory Alignment
+ @anchor MemoryAlignment
+ @see GFRMMEMORYREQUEST, GFRmMemHandleAlloc()
+@{*/
+
+/** Memory alignment types, must match log2 of alignment size. */
+enum
+{
+ GF_MEMORY_ALIGN_NONE = 0, /**< Memory Alignment: Don't care. */
+ GF_MEMORY_ALIGN2, /**< Memory Alignment: Aligned to 2 byte boundary. */
+ GF_MEMORY_ALIGN4, /**< Memory Alignment: Aligned to 4 byte boundary. */
+ GF_MEMORY_ALIGN8, /**< Memory Alignment: Aligned to 8 byte boundary. */
+ GF_MEMORY_ALIGN16, /**< Memory Alignment: Aligned to 16 byte boundary. */
+ GF_MEMORY_ALIGN32, /**< Memory Alignment: Aligned to 32 byte boundary. */
+ GF_MEMORY_ALIGN64, /**< Memory Alignment: Aligned to 64 byte boundary. */
+ GF_MEMORY_ALIGN128, /**< Memory Alignment: Aligned to 128 byte boundary. */
+ GF_MEMORY_ALIGN256, /**< Memory Alignment: Aligned to 256 byte boundary. */
+ GF_MEMORY_ALIGN512, /**< Memory Alignment: Aligned to 512 byte boundary. */
+ GF_MEMORY_ALIGN1024, /**< Memory Alignment: Aligned to 1024 byte boundary. */
+ GF_MEMORY_ALIGN2048, /**< Memory Alignment: Aligned to 2048 byte boundary. */
+ GF_MEMORY_ALIGN4096, /**< Memory Alignment: Aligned to 4096 byte boundary. */
+ GF_MEMORY_ALIGN_DSP = 0xFF /**< Memory Alignment: Aligned properly for DSP cacheline size. */
+};
+
+/*@}*/
+
+/** @name Memory Allocation Hints
+ @anchor MemoryHints
+ @see GFRMMEMORYREQUEST, GFRmMemHandleAlloc()
+@{*/
+/* Memory Hint - Follow Surface Hint */
+/** Memory Allocation Hint: Allocate from high to low addresses. */
+#define GF_MEMORY_HINT_TOP_DOWN GF_SURFACE_HINT_TOP_DOWN
+/** Memory Allocation Hint: Allocate from low to high addresses. */
+#define GF_MEMORY_HINT_BOTTOM_UP GF_SURFACE_HINT_BOTTOM_UP
+/** Memory Allocation Hint: Allocate from maximum available chunk. */
+#define GF_MEMORY_HINT_MAX_CHUNK GF_SURFACE_HINT_MAX_CHUNK
+/** Memory Allocation Hint: Allocate at fixed address. */
+#define GF_MEMORY_HINT_FIXED (GF_MEMORY_HINT_MAX_CHUNK << 1)
+/** Memory Allocation Hint: Allocate for 3D. */
+#define GF_MEMORY_HINT_3D (GF_MEMORY_HINT_MAX_CHUNK << 2)
+
+/* These options are for DRAM as extended memory. This option specifies
+ * bank the buffer should come from. This will avoid
+ * bank clobbering between two buffers that are accessed in lock
+ * step.
+ */
+
+/** Memory Allocation Hint: Allocate from even banks in external memory. */
+#define GF_MEMORY_HINT_EVEN_BANK (GF_MEMORY_HINT_MAX_CHUNK << 3)
+/** Memory Allocation Hint: Allocate from odd banks in external memory. */
+#define GF_MEMORY_HINT_ODD_BANK (GF_MEMORY_HINT_MAX_CHUNK << 4)
+/*@}*/
+
+/** Memory allocation request.
+ @see GFRmMemHandleAlloc()
+*/
+typedef struct _GFRMMEMORYREQUEST
+{
+ NvU32 length; /**< Size in bytes. */
+ NvU32 hint; /**< Allocation hint or 0, see @ref MemoryHints. */
+ struct
+ {
+ NvU16 type; /**< Memory type, see @ref MemoryTypes. */
+ NvU8 share; /**< Share flags or 0, see @ref MemoryShare. */
+ NvU8 align; /**< Alignment flags, see @ref MemoryAlignment. */
+ }
+ flag;
+ NvU32 id; /**< User defined ID to track allocated block, debugging use */
+} GFRMMEMORYREQUEST, *PGFRMMEMORYREQUEST;
+
+/** OS Critical Section bits 0-15 are general purpose use
+bit 16-31 are for internal use */
+#define GF_CRITICAL_SECTION_HW 0x00000001
+/** RM internal use */
+#define GF_CRITICAL_SECTION_SW2 0x00000004
+/** RM internal use */
+#define GF_CRITICAL_SECTION_SW4 0x00000010
+/** I2C critical section */
+#define GF_CRITICAL_SECTION_I2C 0x00000020
+/** RM All channel lock, internal use */
+#define GF_CRITICAL_SECTION_ALL_CHANNELS 0x00000040
+
+/** Ix internal use */
+#define GF_CRITICAL_SECTION_SW8 0x00000100
+
+/** RM DSP to Host communication, internal use */
+#define GF_CRITICAL_SECTION_D2H 0x00000200
+
+/** The SHUTDOWN_DSP lock protects the race between
+ * UpdateDSPFreq/DSPDisable and HandleInterrupt (IST).
+ * (Update and DSPDisable turn off the DSP, HandleInt reads
+ * DSP regs)
+ */
+#define GF_CRITICAL_SECTION_SHUTDOWN_DSP 0x00000400
+/** The DSP lock protects the race between
+ * AddTask and RemoveTask.
+ */
+#define GF_CRITICAL_SECTION_DSP 0x00000401
+
+/** Define the ID for the kernel semaphore */
+#define GF_DSP_KERNEL_SEM_ID 0x0CAFEFAD
+
+/** Shared memory lock - used for internal purposes */
+#define GF_CRITICAL_SECTION_SHM 0x00000800
+
+/** RM Host to DSP communication, internal use */
+#define GF_CRITICAL_SECTION_H2D 0x00001000
+
+/** Rm internal use: lock for channel structures */
+#define GF_CRITICAL_SECTION_CHSTRUCT 0x00004000
+
+/** Dx internal use */
+#define GF_CRITICAL_SECTION_DX 0x00008000
+
+/** Vx internal use */
+#define GF_CRITICAL_SECTION_VX 0x00000080
+
+#ifdef PROJECT_SEC_G1
+/** JxDec internal use */
+#define GF_CRITICAL_SECTION_JXDEC 0x00002000
+#endif
+
+/** Rm internal use: lock for DSP messages */
+#define GF_CRITICAL_SECTION_DSPMSG_MIN 0x00010000
+#define GF_CRITICAL_SECTION_DSPMSG_MAX 0x20000000
+
+/** Audio Shared Memory lock - used for multiprocess OS */
+#define GF_CRITICAL_SECTION_SWAUDIO 0x10002000
+
+/** Maximiun id */
+#define GF_CRITICAL_SECTION_SWMAX 0x00010000
+
+/** OS IRQ Callback */
+typedef void (* GFRMOSIRQCALLBACK)( void *pData );
+
+struct _GFRMCOMMONSTRUCT;
+struct _GFRMENVIRONMENTVARIABLES;
+struct _GFRMEXTDATASTRUCT;
+
+/** Definition of Ix powerplane operations
+ */
+typedef enum _GFIX_POWERPLANE_OP_TYPE
+ {
+ GFIX_POWERPLANE_OP_ENABLE = 0,
+ GFIX_POWERPLANE_OP_DISABLE,
+ GFIX_POWERPLANE_OP_QUERY
+} GFIX_POWERPLANE_OP_TYPE;
+
+/** Configuration structure that may be passed to GFRmOpen().
+ See GFRmOpen() for details.
+*/
+typedef struct _GFRMOPENSTRUCT
+{
+ NvU32 isFirstProcess;
+ NvU32 isDeviceMapped;
+ GF_RETTYPE retStatus; //!< Return error reason code, in case GFRmOpen() fails
+
+ /** Declare which driver HW or NULL driver to use.
+ This is for GFSDK compiled for NULL driver case.
+ */
+ NvU32 useDriver;
+} GFRMOPENSTRUCT;
+
+/** @name Interface Manager Returned Functions
+@{*/
+
+/** Write a 32-bit register in the device.
+
+ @param base I/O base address
+ @param offset Offset of register
+ @param data Data to write
+ */
+typedef void (*GF_FUNC_WRITE_32BIT)(void * base, NvU32 offset, NvU32 data);
+
+/** Read a 32-bit register in the device.
+
+ @param base I/O base address
+ @param offset Offset of register
+
+ @retval #NvU32 register value
+ */
+typedef NvU32 (*GF_FUNC_READ_32BIT)(void * base, NvU32 offset);
+
+/*@}*/
+
+/** Interface Options for Read/Write Embedded FIFO (for Jx/Mx APIs) */
+#define GF_EMBFIFO_SWAP_BYTE 0x00000001
+#define GF_EMBFIFO_SWAP_WORD 0x00000002
+
+/** Interface FIFO flags */
+/** Front-End FIFO */
+#define GF_FIFO_FEND 0x00000001
+/** GE (2D/Primary) FIFO */
+#define GF_FIFO_SRC 0x00000002
+
+/** Interface Helper macro to generate Address Pointer */
+#define GFMAKEADDR(base, offset) (void *)base, offset
+
+/** Utility Debug Flag */
+#define GF_DEBUG_DEFAULT 0
+
+/** 4th argument for GFRmOSGetTickCount */
+#define GF_USEC_TICKS 0
+#define GF_MSEC_TICKS 1
+#define GF_SEC_TICKS 2
+
+/** Flags for the Context manager GF_CTX_DEFAULT, GF_CTX_NEW */
+#define GF_CTX_DEFAULT 1
+#define GF_CTX_NEW 2
+#define GF_CTX_SHARED 3
+
+/*
+ ########################################################################
+ * Function Prototypes for GFSDK Resource Manager (RM) Services
+ ########################################################################
+ */
+
+/* Object Manager */
+
+/** GFRmOpen - Starts Resource Manager and GFSDK.
+
+ @param RmOpenHandle Must be NULL.
+ @return Resource manager handle, or NULL on failure.
+
+ This must be called prior using any GFSDK component APIs and RM services.
+ This function can be called multiple times, for each successfull call
+ the application must also call GFRmClose().
+
+ If this function fails, and a pointer to an open structure is passed in
+ \a RmOpenHandle, the a failure reasoncode will be returned in GF_OPEN_RETTYPE::retStatus.
+*/
+GFRmHandle GFRmOpen(GFRMOPENSTRUCT *RmOpenHandle);
+
+/** GFRmClose - Ends Resource Manager and GFSDK.
+
+ @param pRmHandle Ptr to RmHandle to be closed.
+ @retval GF_RETTYPE #GF_SUCCESS if successful.
+ #GF_ERROR on error.
+
+ All GFSDK resources will be freed related to this process.
+ Calls to GFRmOpen are reference counted, GFDSK will be closed only for
+ the last call to this function.
+ */
+void GFRmClose(GFRmHandle *pRmHandle);
+
+/** GFRmCleanUp - Frees resources allocated to a terminated Resource Manager session.
+
+ @param RmProcessID RM Process ID to clean up after.
+ @retval GF_RETTYPE #GF_SUCCESS if successful.
+ #GF_ERROR on error.
+
+ All GFSDK resources will be freed related to this
+ process.
+ */
+GF_RETTYPE
+GFRmCleanUp( GFRmHandle RmHandle, NvU32 RmProcessID );
+
+// FIXME: ripped off from the API doc. GFRmRecover is not implemented as of
+// yet - there's null implementation in GFRmObj.c.
+/** GFRmRecover - Handles ESD failures.
+
+ @param RmHandle The handle to the Resource Manager.
+ @param option
+ @retval GF_RETTYPE #GF_SUCCESS if successful.
+ #GF_ERROR on error.
+
+ This function is used to recover from an ESD (electrostatic discharge)
+ failure. If the system software finds that the GoForce processor is not
+ responding, the software uses the CPU GPIO to reset the GoForce processor
+ and then calls this function. GFRmRecover() only calls Recover()
+ functions of registered components. For example, the GFDxAPI and GFGxAPI
+ have registered Recover() functions that can bring the GoForce processor
+ back from the reset to normal working mode.
+ */
+GF_RETTYPE
+GFRmRecover( GFRmHandle RmHandle, NvU32 option );
+
+/** GFRmGetProperty - Returns properties of RM.
+
+ @param pRmProp Caller passes ptr to GFPROPERTY that will be filled
+ upon return.
+
+ @retval #GF_SUCCESS if successful.
+ */
+GF_RETTYPE
+GFRmGetProperty( GFRmHandle RmHandle,
+ GFPROPERTY *pRmProp );
+
+/** GFRmSetAttribute - Sets RM attribute.
+
+ @param AttribType Attribute to get of type #GF_ATTRIBUTE_TYPE.
+ @param AttribData Data specific to AttribType.
+
+ @retval #GF_SUCCESS if successful.
+ */
+GF_RETTYPE
+GFRmSetAttribute(GFRmHandle RmHandle,
+ GF_ATTRIBUTE_TYPE AttribType,
+ NvU32 AttribData);
+
+/** GFRmGetAttribute - Gets RM attribute.
+
+ @param AttribType Attribute to get of type #GF_ATTRIBUTE_TYPE.
+ @param AttribData Data specific to AttribType.
+ See GF_ATTRIBUTE_TYPE for interpretation.
+ May pass input and/or output parameters.
+
+ @retval #GF_SUCCESS if successful.
+ */
+GF_RETTYPE
+GFRmGetAttribute(GFRmHandle RmHandle,
+ GF_ATTRIBUTE_TYPE AttribType,
+ NvU32 *pAttribData);
+
+/** Claim or release a hardware resource.
+
+ The GoForce GPU has a few hardware engines which are used by
+ different component API. If a component API is using that hardware
+ engine, then other API component should not be allowed to use that
+ engine. For example we have MPEG Decoder engine in the hardware which
+ is used by GFMxDecAPI and GFJxDecAPI components. If one of the API is
+ using MPEGD Engine and app/system software tries to use other engines,
+ it should not be allowed.
+ For SC4/SC5/SC10/SC12 GPU, we have following constraints:
+ GFMxDecAPI MPEGD, optional Auto Trigger SB
+ GFJxDecAPI MPEGD, optional Auto Trigger SB
+ Both of these component API share same engine so we should only allow
+ one component to be opened at a time.
+
+ GFMxEncAPI MPEGE, EPP (planar converter)
+ GFJxEncAPI JPEGE, EPP (planar converter)
+ Both of these component API share same fron-end planar converter so we
+ should only allow one component to be opened.
+
+ StetchBlt is represented by VxBlt(). SB has one context where auto
+ trigger SB can be set. Manual SB command uses same context for manual
+ command and then restores the auto context.
+ There is no need to check for manual VxBlt().
+ Autotrigger need checking but it is difficult to check in the VxBlt()
+ function.
+
+ This function only deals with Component level constraints.
+ Constraint checking can be enabled if GF_ATTRIB_HW_RESOURCE_CONSTRAINT.
+
+ @param RmHandle Handle to the resource manager.
+ @param options Action code
+ @param hwEngineReq Flag bitmask specifying 0 or more HW engines, see @ref HardwareResources
+
+ @retval GF_SUCCESS Hardware resource is available.
+ @retval GFRM_ERROR_HWRESOURCE_NOT_AVAILABLE Hardware resource is not available.
+ @retval GFRM_ERROR_BAD_PARAMETER Bad parameters passed
+*/
+GF_RETTYPE
+GFRmHwResourceConstraint( GFRmHandle RmHandle,
+ GF_HRC_OPTIONS options,
+ NvU32 hwEngineReq );
+
+/* Context Manager */
+
+/** GFRmContextGet - Retrieves either a default or new context.
+
+ @param RmHandle Handle to the resource manager.
+ @param flags #GF_CTX_DEFAULT or #GF_CTX_NEW
+ @param pContext Pointer to the retreived context.
+
+ @retval #GF_SUCCESS on success.
+ @retval #GF_ERROR on error.
+ */
+GF_RETTYPE
+GFRmContextGet( GFRmHandle RmHandle,
+ NvU32 flags,
+ GFRmChHandle *pContext);
+
+/** GFRmChFree - Free a channel (same thing as a context).
+
+ @param hRm Resource manager handle.
+ @param phCh Pointer to the channel handle.
+
+ @see GFRmContextGet
+ */
+void GFRmChFree(GFRmHandle hRm, GFRmChHandle *phCh);
+
+
+/* Component Manager */
+
+/** GFRmComponentRegister - Register Component with Resource Manager
+
+ @param pComponent Ptr to component to be registerd.
+ @param RegisterState Parameter of type GF_STATE_TYPE.
+ Usually, GF_STATE_REGISTER is passed.
+
+ @retval #GF_SUCCESS on success.
+ @retval #GF_ERROR on error.
+
+ */
+GF_RETTYPE
+GFRmComponentRegister( GFRmHandle RmHandle,
+ GFRMCOMPONENT *pComponent,
+ GF_STATE_TYPE RegisterState );
+
+/** GFRmComponentGet - Gets a registered component, associated with the passed
+ context.
+
+ @param ComponentType Desired component type.
+ @param state Parameter of type #GF_STATE_TYPE.
+ @param pComponent Ptr to Handle to component available.
+ NULL if not available.
+ @param hCh Context Handle. Can be allocated by a call to
+ #GFRmContextGet function.
+
+ @retval #GF_SUCCESS on success.
+ @retval #GF_ERROR on error.
+
+ Depending on the requested state, a newly instantiated component or
+ a shared component is returned. GF_STATE_DEFAULT is the default option
+ for the state parameter. If the hCh passed is NULL, then a default
+ context is associalted with the component.
+
+ */
+GF_RETTYPE
+GFRmComponentGet(GFRmHandle hRm,
+ NvU32 ComponentType,
+ GF_HANDLE *pComponent,
+ GF_STATE_TYPE state,
+ GFRmChHandle hCh);
+
+/** GFRmComponentRelease - Releases the specified component handle.
+
+ @param hRm Handle to the resource manager.
+ @param phComponent Pointer to component handle to be released.
+
+ The handle pointed to by phComponent will be cleared to NULL as a side
+ effect of calling this function. Also, this function has no effect if
+ the handle pointed to by phComponent is already NULL, so it is not
+ necessary to check whether a component handle is NULL before releasing it.
+ */
+void GFRmComponentRelease(GFRmHandle hRm, GF_HANDLE *phComponent);
+
+/* Surface Manager */
+
+/** GFRmSurfaceAlloc - Allocate a Surface without synchronization.
+
+ @param pSurfaceReq Pointer to surface request structure #GFRMSURFACEREQUEST.
+ @param ppSurface Pointer to surface pointer.
+
+ @retval #GF_SUCCESS on success.
+ @retval #GF_ERROR on error.
+ @retval #GF_OUT_OF_MEMORY when low on memory.
+ */
+GF_RETTYPE
+GFRmSurfaceAlloc( GFRmHandle RmHandle,
+ GFRMSURFACEREQUEST *pSurfaceReq,
+ PGFRMSURFACE *ppSurface );
+
+/** GFRmSurfaceFree - Frees an allocated surface.
+
+ @param ppSurface Pointer to surface pointer.
+
+ *ppSurface is cleared to NULL.
+ */
+void
+GFRmSurfaceFree(GFRmHandle hRm,
+ PGFRMSURFACE *ppSurface);
+
+/** GFRmSurfaceQueryPrimaryInfo - Make a query on Primary Surface.
+
+ @param ppSurface Pointer to Primary surface pointer.
+ @param pRotate Ptr to current Rotation orientation.
+ @retval GF_RETTYPE #GF_SUCCESS on success.
+ #GF_ERROR on error.
+
+ Returned surface pointer is for quick reference only and is a
+ pointer to transient structure. In other words, this will not
+ increment the reference count as GFRmSurfaceAlloc does.
+ */
+GF_RETTYPE
+GFRmSurfaceQueryPrimaryInfo( GFRmHandle RmHandle,
+ PGFRMSURFACE *ppSurface,
+ NvU32 *pRotate,
+ NvU32 subSurfaceType );
+
+/** Update surface attributes.
+
+ @param ppSurface Pointer to Primary surface pointer.
+ @param type Type of attribute to update:
+
+ #GF_SURFACE_UPDATE_ROTATE Set surface rotation
+ #GF_SURFACE_UPDATE_WIDTH Set surface width
+ #GF_SURFACE_UPDATE_HEIGHT Set surface height
+
+ @param data Data specific to the type.
+
+ @retval #GF_SUCCESS on success.
+ @retval #GF_ERROR on error.
+
+ Currently only one update flag is defined #GF_SURFACE_UPDATE_ROTATE
+
+ */
+GF_RETTYPE
+GFRmSurfaceUpdate( GFRmHandle RmHandle,
+ PGFRMSURFACE pSurface,
+ NvU32 type,
+ NvU32 data );
+
+/* Memory Manager */
+
+/** Allocate a linear piece of internal memory block.
+
+ @param pMemoryReq Pointer to Memory Request struct #GFRMMEMORYREQUEST.
+ @param pMemHandle A Pointer to the memory handle.
+
+ @retval #GF_SUCCESS on success.
+ @retval #GF_ERROR on error.
+ */
+GF_RETTYPE
+GFRmMemHandleAlloc(GFRmHandle RmHandle,
+ GFRMMEMORYREQUEST *pMemoryReq,
+ GFRmMemHandle *pMemHandle );
+
+/** Frees an allocated internal memory block.
+
+ @param phMem A Pointer to the memory handle.
+ */
+void
+GFRmMemHandleFree(GFRmHandle hRm,
+ GFRmMemHandle *phMem);
+
+/** Current memory info. Only supports embedded memory.
+
+ @param pTotalFree Pointer to NvU32 holding total free memoory available.
+ @param flag Type of memory. Can be one the
+ #GF_MEMORY_EMBEDDED
+ #GF_MEMORY_EMBEDDED_EXT
+ #GF_MEMORY_EMBEDDED_INT
+ @param pMaxChunk Size of the max chunk.
+
+ @retval #GF_SUCCESS on success.
+ @retval #GF_ERROR on error.
+
+ GF_MEMORY_EMBEDDED returns the free memory available in both internal
+ and external memory.
+ */
+GF_RETTYPE
+GFRmMemInfo (GFRmHandle RmHandle,
+ NvU32 *pTotalFree,
+ NvU32 *pMaxChunk,
+ NvU32 flag );
+
+
+/** Get an handle for the entire internal memory. Used for debugging purposes
+ only.
+*/
+GFRmMemHandle GFRmMemGetIntMemHandle(GFRmHandle RmHandle);
+
+/** Get an handle for the entire external memory. Used for debugging purposes
+ only.
+*/
+GFRmMemHandle GFRmMemGetExtMemHandle(GFRmHandle RmHandle);
+
+/** Handle to offset(sc15 view of hw address) conversion.
+ */
+NvU32 GFRmMemGetOffset(GFRmMemHandle hMem);
+
+/** Handle to DSP offset(DSP address address map) conversion.
+ */
+NvU32 GFRmMemGetDSPOffset(GFRmMemHandle hMem);
+
+/** Handle to virtual address conversion.
+
+ Returned pointer cannot be dereferenced excpet in direct
+ addressing mode.
+ */
+void *GFRmMemGetPointer(GFRmMemHandle hMem);
+
+/** Get the DSP address with a particular caching attribute for a given memory
+ handle.
+ */
+NvU32 GFRmMemGetUncachedDSPAddr(GFRmMemHandle hMem);
+NvU32 GFRmMemGetWriteBackDSPAddr(GFRmMemHandle hMem);
+NvU32 GFRmMemGetWriteThroughDSPAddr(GFRmMemHandle hMem);
+
+/** Memory Handle reverse lookup from offset.
+
+ This can be used only for the embedded memory.
+ */
+GF_RETTYPE
+GFRmMemOffsetToHandle(GFRmHandle RmHandle, NvU32 offset, GFRmMemHandle *MemHandle);
+
+/** Converts offset to virtual address.
+
+ @param offset Hardware offset as seen by the SCxx chip.
+ @param ppMemory Pointer to Virtual address.
+
+ */
+GF_RETTYPE
+GFRmMemOffsetToVirt(GFRmHandle RmHandle, NvU32 offset, void **ppMemory);
+
+/** Converts virtual to offset (SCxx hw view)
+
+ @param offset Hardware offset SCxx view.
+ @param ppMemory Virtual address.
+ */
+GF_RETTYPE
+GFRmMemVirtToOffset(GFRmHandle RmHandle, void *ppMemory, NvU32 *offset);
+
+/** Test if the memory offset is from external memory.
+
+ Returns NV_TRUE if the offset is comming from
+ external memory, otherwise NV_FALSE.
+ */
+NvBool
+GFRmIsExternalMemoryOffset(GFRmHandle RmHandle,
+ NvU32 offset);
+
+/** Test if the memory handle is from external memory.
+
+ Returns NV_TRUE if the handle is comming from
+ external memory, otherwise NV_FALSE.
+ */
+NvBool
+GFRmIsExternalMemoryHandle(GFRmHandle RmHandle,
+ GFRmMemHandle memhandle);
+
+/** Test if the memory offset is valid.
+ @return NV_TRUE if valid, or NV_FALSE otherwise.
+ */
+NvBool GFRmIsMemoryOffsetValid(GFRmHandle hRm, NvU32 Offset);
+
+/** Test for bufferoverflows in allocated GPU memory.
+ This does nothing for release builds. In GFSDK debug build
+ each GPU memory block will be guarded by leading and trailing
+ 8 byte marker sequences:
+
+ Start of block: 0x0D,0xF0,0xAD,0xDE,0x0D,0xF0,0xAD,0xDE
+ End of block: 0xDE,0xAD,0xFO,0xOD,0xDE,0xAD,0xFO,0xOD
+
+ This call checks if these guard markers have been overwritten
+ @return Index of corrupted memory block, or -1 if all are ok.
+*/
+int GFRmMemEmbVerify(GFRmHandle RmHandle);
+
+/* CPU bound memory fill functions:
+ These functions will use CPU cycles to write 16 to 32-bit fixed data
+ pattern into GPU memory. These API's will use user specified channel
+ apperture to access memory directly and are equipped with Lock and Unlock
+ routines to be thread safe.
+*/
+
+/** Fill memory with fixed data pattern on a particular channel.
+ Function locks and unlocks the channel automatically.
+ @param ChHandle User-specified channel to use.
+ @param memHandle GPU memory handle to write fixed 32-bit data.
+ @param offset Byte offset relative to memHandle block,
+ must be 32-bit aligned.
+ @param fill 32-bit fixed data pattern.
+ @param words Number of DWORDs to write.
+*/
+void
+GFRmChMemFill32(GFRmChHandle ChHandle, GFRmMemHandle memHandle, NvU32 offset,
+ NvU32 fill, NvU32 words);
+
+/** Fill memory with fixed data pattern on a particular channel.
+ Function locks and unlocks the channel automatically.
+ @param ChHandle User-specified channel to use.
+ @param memHandle GPU memory handle to write fixed 16-bit data.
+ @param offset Byte offset relative to memHandle block,
+ must be 32-bit aligned.
+ @param fill 16-bit fixed data pattern.
+ @param words Number of DWORDs to write.
+*/
+void
+GFRmChMemFill16(GFRmChHandle ChHandle, GFRmMemHandle memHandle, NvU32 offset,
+ NvU16 fill, NvU32 words);
+
+/** Save/Restore functions - These functions Save embedded memory to system memory.
+ * This memory can then be restored back to sys mem when required. These functions
+ * are used during DeepPowerDown.
+ */
+GF_RETTYPE GFRmSaveMemory(GFRmHandle pRm,
+ void *sysMemPtr,
+ NvU32 memSize);
+
+GF_RETTYPE GFRmRestoreMemory(GFRmHandle pRm,
+ void *sysMemPtr,
+ NvU32 memSize);
+
+/* Linear video memory functions:
+
+ These functions are used for transferring system memory to video memory,
+ filling video memory, and video memory to video memory operations. These
+ set of functions use the "1d" engine in hardware. All operations use
+ channels and will be synchronized with other commands. Optionally each
+ operation can be passed a flag to insert a "clear/raise/wait" sequence
+ which will guarantee that the operation has completed before processing
+ more commands in the command stream. For example, if a texture is being
+ downloaded, it is useful that the download be complete prior to some other
+ engine (3d maybe) using this memory.
+
+ Prior to using functions, the 1d engine must be enabled. Disabling
+ will cause the channel passed in to be idled. This is required by hardware
+ so that the command processors state can be updated when the 1d engine
+ has its clock disabled and put into reset.
+
+*/
+
+
+/** Callback prototype for GFRmChLinearSetDMACallback(). */
+typedef void (*GF_FUNC_DMA_CALLBACK)(void *dstAddr, void *srcAddr, NvU32 lengthInWords);
+
+/** Setup an DMA callback for downloading data to SRAM.
+ *
+ * This function allows for the user to to setup a DMA callback when
+ * downloading code to the frame buffer.
+ *
+ * The callback function should return AFTER all data has been transferred to
+ * the device. The downloader writes all data to the framebuffer through
+ * the registered frame buffer window. This window is 4KBytes in length,
+ * so there will be a callback once for each 4Kbytes (or less to handle alignment
+ * constraints).
+ *
+ * Also, it is possible for downloads to be occuring on multiple channels
+ * concurrently, which means that this Callback function must be able to
+ * handle calls from different threads, and do whatever arbitration is required.
+ *
+ * For indirect addressing modes, inside the GFSDK a semaphore will be taken
+ * and held for the duration of this transaction, as multiple threads cannot
+ * access the device concurrently when using an indirect addressing model.
+ *
+ * @param ChHandle The channel that will be used for the download (channel aperture is used)
+ * @param dmaCallback Pointer to the callback function that is called to do the download
+ */
+GF_RETTYPE
+GFRmChLinearSetDMACallback(GFRmChHandle ChHandle,
+ GF_FUNC_DMA_CALLBACK dmaCallback);
+
+/** Flag for GFRmChLinearSysToVidMemcpy(): use a clear/raise/wait. */
+#define GF_RM_LINEAR_USE_CRW 0x01
+
+/** Flag for GFRmChLinearSysToVidMemcpy(): don't synchronize with channel's pushbuffer. */
+#define GF_RM_LINEAR_NO_PB_SYNC 0x02
+
+/** Enable 1D engine for GFRmChLinear* functions.
+ *
+ * Call before using any GFRmChLinear* function. This enables the hardware that is
+ * used for these functions. Internally there is a reference count, so it is safe
+ * to call this multiple times.
+ *
+ * @param ChHandle Any valid channel handle should work.
+ * @see GFRmChLinearDisable()
+ */
+
+GF_RETTYPE
+GFRmChLinearEnable(GFRmChHandle ChHandle);
+
+
+/** Disable 1D engine for GFRmChLinear* functions.
+ *
+ * When the internal reference count reaches zero, the accelerator's clocks will be turned
+ * off to save power
+ *
+ * @param ChHandle Any valid channel should work.
+ * @see GFRmChLinearEnable()
+ */
+
+GF_RETTYPE
+GFRmChLinearDisable(GFRmChHandle ChHandle);
+
+
+
+/** Downloads a system memory buffer to the GPU memory buffer.
+ *
+ * The main reason for using this is that
+ * the copy to video memory is serialized with other operations. A typical use would be something
+ * like: 3d-driver issues draw commands that use a texture. 3d-driver issues a clear/raise/wait to
+ * know when draw is complete. 3d-driver issues a download to update the texture.
+ *
+ * @param pCtx : Current context (channel)
+ * @param memHandle : Handle returned from the memory allocator
+ * @param dstOffset : Offset from the beginning of the block referenced in memHandle
+ * @param pSrc : Source memory address in system memory
+ * @param len : Length in bytes to copy
+ * @param flags : Flags to optionally modify copy behavior
+ *
+ * flags can be one of:
+ *
+ * GF_RM_LINEAR_USE_CRW -- use a clear/raise/wait to make the operation finish prior to other command
+ * in the command stream being executed.
+ * GF_RM_LINEAR_NO_PB_SYNC -- This means the download does not need to be synchronous with the pushbuffer
+ * and the RM can optionally use different more efficient path
+ * than the pushbuffer.
+ *
+ * @return Returns GF_SUCCESS on success
+ */
+GF_RETTYPE
+GFRmChLinearSysToVidMemcpy(GFRmChHandle pCtx,
+ GFRmMemHandle memHandle,
+ NvU32 dstOffset,
+ void *srcPtr,
+ NvU32 bytes,
+ NvU32 flags);
+
+/** Fills a region of GPU memory with a constant value, by memory handle.
+ *
+ * @param ctx Current context (or channel)
+ * @param memHandle Handle to the memory to fill
+ * @param dstOffset Offset inside the memory handle
+ * @param data32 The value being replicated in memory. This value is
+ * interpreted differently depending on the align parameter.
+ * if align==4 all of data32 is used
+ * if align==2 lower 16-bits of data32 is used
+ * if align==1 lower 8-bits of data32 is used
+ *
+ * @param bytes Number of bytes to fill
+ * @param align must 1,2,4
+ * @param flags Can be 0 or GF_RM_LINEAR_USE_CRW
+ */
+GF_RETTYPE
+GFRmChLinearVidMemFill(GFRmChHandle ctx,
+ GFRmMemHandle memHandle,
+ NvU32 dstOffset,
+ NvU32 data32,
+ NvU32 bytes,
+ NvU32 align,
+ NvU32 flags);
+
+/** Copies memory within GPU memory, by memory handle.
+ *
+ * @param ctx The channel handle
+ * @param dstMemHandle memory handle returned from memalloc
+ * @param dstOffset Offset from the beginning of dstMemHandle
+ * @param srcMemhandle memory handle of the src memory
+ * @param srcOffset Offset from the beginning of srcMemHandle
+ * @param bytes Number of bytes to be copied.
+ * @param flags Must be 0 or GF_RM_LINEAR_USE_CRW
+ *
+ */
+GF_RETTYPE
+GFRmChLinearVidMemcpy(GFRmChHandle ctx,
+ GFRmMemHandle dstMemHandle,
+ NvU32 dstOffset,
+ GFRmMemHandle srcMemHandle,
+ NvU32 srcOffset,
+ NvU32 bytes,
+ NvU32 flags);
+
+
+/** @name OS Manager
+@{*/
+
+/** Enter Critical section, extended version.
+ @param id GF_CRITICAL_SECTION_xxx
+ */
+void GFRmOSEnterCSExt(GFRmHandle hRm, NvU32 id);
+
+/** Exit Critical section, extended version.
+ @param id GF_CRITICAL_SECTION_xxx
+ */
+void GFRmOSExitCSExt(GFRmHandle hRm, NvU32 id);
+
+/** Enter Hardware Access Critical section.
+ */
+void GFRmOSEnterCS(GFRmHandle hRm);
+
+/** Exit Hardware Access Critical section.
+ */
+void GFRmOSExitCS(GFRmHandle hRm);
+
+/** Waits for some number of milliseconds.
+ @param msec Number of milliseconds to wait.
+ */
+void GFRmOSWaitMSec(NvU32 msec);
+
+/** Get the current OS tick counter.
+ @return Low 32 bits of millisecond counter.
+*/
+NvU32 GFRmGetTickCountMSec(void);
+
+/** Get the current OS tick counter.
+
+ NOTE: This function is NOT guaranteed to exist on all
+ platforms. Drivers should NOT call this function; it's
+ meant only for benchmarking.
+
+ @return 64 bit microsecond counter.
+ */
+NvU64 GFRmGetTickCountUSec(void);
+
+/** Waits for a keypress with a timeout, and returns the key.
+
+ @param timeOutMSec (NvU32) Milliseconds to wait for the keypress.
+ @retval (int) The code for the key, or zero if we timed out.
+ */
+int GFRmWaitKey(NvU32 timeOutMSec);
+
+/*@}*/
+
+/** @name Read/Write functions
+
+ We provide APIs to read and write GPU registers and memory, independent of
+ which bus addressing mode is in use (direct or indirect, 16 or 32).
+
+ WARNING: These functions are not safe in all cases.
+ 1. They do not take into account handshake mode. With fixed timings it may
+ be unsafe, for example, to use GFRmMemRd/Wr32 to access external memory.
+ 2. They do not take into account limitations on the # of address bits. On
+ some direct addressing platforms, not all the address bits are wired up,
+ so it is impossible to directly access all of memory. For example, it
+ may be unsafe to use GFRmMemRd/Wr32 to access external memory.
+ 3. Some buses do not have full byte enable support. It is possible that
+ GFRmMemWr08, for example, may clobber the other byte in the word.
+
+ It is believed that the first two pitfalls only apply to external memory.
+ You can probably use these APIs safely to access internal memory, subject to
+ caveat (3) (i.e. you should stick to 16-bit or 32-bit writes). For external
+ memory, "use at your own risk."
+
+@{*/
+
+/** Read or write an 8-, 16-, or 32-bit register in the device. */
+NvU8 GFRmRegRd08(GFRmHandle hRm, NvU32 offset);
+NvU16 GFRmRegRd16(GFRmHandle hRm, NvU32 offset);
+NvU32 GFRmRegRd32(GFRmHandle hRm, NvU32 offset);
+void GFRmRegWr08(GFRmHandle hRm, NvU32 offset, NvU8 data);
+void GFRmRegWr16(GFRmHandle hRm, NvU32 offset, NvU16 data);
+void GFRmRegWr32(GFRmHandle hRm, NvU32 offset, NvU32 data);
+
+/** Read or write 8, 16, or 32 bits of data to a given offset in a block of memory.
+ Offset is relative to the memory handle AND not the absolute one.
+ */
+NvU8 GFRmMemRd08(GFRmHandle hRm, GFRmMemHandle hMem, NvU32 offset);
+NvU16 GFRmMemRd16(GFRmHandle hRm, GFRmMemHandle hMem, NvU32 offset);
+NvU32 GFRmMemRd32(GFRmHandle hRm, GFRmMemHandle hMem, NvU32 offset);
+void GFRmMemWr08(GFRmHandle hRm, GFRmMemHandle hMem, NvU32 offset, NvU8 data);
+void GFRmMemWr16(GFRmHandle hRm, GFRmMemHandle hMem, NvU32 offset, NvU16 data);
+void GFRmMemWr32(GFRmHandle hRm, GFRmMemHandle hMem, NvU32 offset, NvU32 data);
+
+/** Read or write a region of a block of memory. Size is in bytes */
+void GFRmMemRead(GFRmHandle hRm, GFRmMemHandle hMem, NvU32 offset,
+ void *pDst, NvU32 size);
+void GFRmMemWrite(GFRmHandle hRm, GFRmMemHandle hMem, NvU32 offset,
+ const void *pSrc, NvU32 size);
+
+/** Fill a block of memory with a given 8-, 16-, or 32-bit word. Size is in words, not bytes */
+void GFRmMemFill08(GFRmHandle hRm, GFRmMemHandle hMem,
+ NvU32 offset, NvU32 size, NvU8 data);
+void GFRmMemFill16(GFRmHandle hRm, GFRmMemHandle hMem,
+ NvU32 offset, NvU32 size, NvU16 data);
+void GFRmMemFill32(GFRmHandle hRm, GFRmMemHandle hMem,
+ NvU32 offset, NvU32 size, NvU32 data);
+
+/** Write to a FIFO in the chip. */
+void GFRmFifoWrite(GFRmHandle hRm, const void *srcPtr,
+ NvU32 dstOffset, NvU32 sizeIn32bits);
+
+/** Waits for the host to idle.
+
+ @retval GF_SUCCESS on success
+ @retval GF_ERROR on error
+*/
+GF_RETTYPE
+GFRmWaitForHostIdle( GFRmHandle RmHandle );
+
+/*@}*/
+
+/** Dispatch DSP2Host messages.
+
+ This function can be called from an IST in response to the DSP2Host
+ interrupt. It will perform the following sequence:
+
+ - read the DSP2Host message from the DSP2Host registers, i.e. GFRmGetMessage()
+ - identify DSP task from the task ID in message parameter 0
+ - add the message to that task's queue
+ - set an event registered with that task to notify it about the new message
+ - clear DSP2Host interrupt register, i.e. GFRmClearDspCommInterrupt()
+
+ If the task ID from the message is unknown, the interrupt is still cleared,
+ but the message is ignored.
+
+ @param ChHandle Channel to use, should be the protected channel (GF_PROTECTED_CHANNEL)
+ @return Returns the DSP task ID the received message belonged to, or 0 if unknown
+*/
+NvU32 GFRmDispatchMessage(GFRmChHandle ChHandle);
+NvU32 GFRmDispatchMessageDual(GFRmChHandle ChHandle, NvU32 dspModule);
+
+/** Descriptor for circular buffer in DSP memory.
+ This structure is intended for shared use between DSP tasks.
+
+ If GF_RM_DSP_CBUFFER::wr == GF_RM_DSP_CBUFFER::rd, the circular buffer is empty.
+ If GF_RM_DSP_CBUFFER::wr != GF_RM_DSP_CBUFFER::rd, the buffer contains
+ (wr>=rd)?wr-rd:size+wr-rd bytes of data, starting at offset rd, wrapping on the buffer end.
+*/
+typedef struct _GFRM_DSP_CIRCBUFFER
+{
+ NvU8* adr; //!< buffer address, DSP address space in GPU memory
+ NvU32 size; //!< Buffer size in bytes
+ NvU32 wr; //!< Current write offset relative to buffer address
+ NvU32 rd; //!< Current read offset relative to buffer address
+ NvU32 userData[4]; //!< User defined, specific depending on usage
+
+} GF_RM_DSP_CIRCBUFFER;
+
+
+/*
+ * Pins that can be used as GPIOs once the corresponding module
+ * has been enabled
+ */
+typedef enum {
+
+ /* SD PINS */
+ GPIO_SD_PIN_DATA0 = 1,
+ GPIO_SD_PIN_DATA1,
+ GPIO_SD_PIN_DATA2,
+ GPIO_SD_PIN_DATA3,
+ GPIO_SD_PIN_CLK,
+ GPIO_SD_PIN_CMD,
+ GPIO_SD_PIN_SDGP0,
+ GPIO_SD_PIN_SDGP1,
+
+ /* VI PINS */
+ GPIO_VI_PIN_VD0,
+ GPIO_VI_PIN_VD1,
+ GPIO_VI_PIN_VD2,
+ GPIO_VI_PIN_VD3,
+ GPIO_VI_PIN_VD4,
+ GPIO_VI_PIN_VD5,
+ GPIO_VI_PIN_VD6,
+ GPIO_VI_PIN_VD7,
+ GPIO_VI_PIN_VD8,
+ GPIO_VI_PIN_VD9,
+ GPIO_VI_PIN_VD10,
+ GPIO_VI_PIN_VD11,
+ GPIO_VI_PIN_VSCK,
+ GPIO_VI_PIN_VHS,
+ GPIO_VI_PIN_VVS,
+ GPIO_VI_PIN_VGP0,
+ GPIO_VI_PIN_VGP1,
+ GPIO_VI_PIN_VGP2,
+ GPIO_VI_PIN_VGP3,
+ GPIO_VI_PIN_VGP4,
+ GPIO_VI_PIN_VGP5,
+ GPIO_VI_PIN_VGP6
+
+} GFGPIOPin;
+
+/*
+ * I/O options for pins
+ */
+typedef enum {
+ GPIO_OPTION_DISABLE = 1,
+ GPIO_OPTION_INPUT,
+ GPIO_OPTION_OUTPUT
+} GFGPIOOption;
+
+/*
+ * Enable/Disable I/O for GPIOS
+ */
+typedef enum {
+ GPIO_MODE_DISABLE = 1,
+ GPIO_MODE_ENABLE
+} GFGPIOMode;
+
+/*
+ * Pin groups whose selects are tied together
+ */
+typedef enum {
+ GPIO_SD_PINGRP_D0_CLK_CMD = 1,
+ GPIO_SD_PINGRP_D1_D2
+} GFGPIOPinGrp;
+
+/*
+ * Pin select for GPIOS
+ */
+typedef enum {
+ GPIO_SELECT_GPIO = 1,
+ GPIO_SELECT_FUNC
+} GFGPIOSelect;
+
+/**
+ *
+ * Sets all the pins of a specific module to GPIO mode
+ *
+ * @param RmHandle Handle specific to the GFRm
+ * @param modid Module
+ *
+ * @return GF_SUCCESS on success
+ *
+ */
+GF_RETTYPE
+GFRmGPIOEnable(GFRmHandle RmHandle, eGFModuleIDs modid);
+
+/**
+ * Initializes the GPIO API
+ *
+ *
+ * @param RmHandle Handle specific to the GFRm
+ * @param modid Module
+ *
+ * @return GF_SUCCESS on success
+ *
+ */
+GF_RETTYPE
+GFRmGPIODisable(GFRmHandle RmHandle, eGFModuleIDs modid);
+
+/**
+ *
+ * Modifies the pin's input/output modes
+ *
+ * @param ChHandle Channel to write to modules through
+ * @param pin Pin to set
+ * @param options One of GPIO_OPTION_DISABLE (ignores mode),
+ * GPIO_OPTION_INPUT, GPIO_OPTION_OUTPUT
+ * @param mode One of GPIO_MODE_ENABLE, GPIO_MODE_DISABLE
+ *
+ * @return GF_SUCCESS on success
+ *
+ */
+GF_RETTYPE
+GFRmGPIOSetPinMode(GFRmChHandle ChHandle, GFGPIOPin pin, GFGPIOOption option, GFGPIOMode mode);
+
+/**
+ *
+ * Sets a particular pin's output select
+ *
+ * @param ChHandle Channel to write to modules through
+ * @param pin Pin to set
+ * @param select One of GPIO_SELECT_GPIO, GPIO_SELECT_FUNC
+ *
+ * @return GF_SUCCESS on success
+ *
+ */
+GF_RETTYPE
+GFRmGPIOSetPinSelect(GFRmChHandle ChHandle, GFGPIOPin pin, GFGPIOSelect select);
+
+/**
+ *
+ * Sets a particular pin group's output select
+ *
+ * @param ChHandle Channel to write to modules through
+ * @param group Pin group to set
+ * @param select One of GPIO_SELECT_GPIO, GPIO_SELECT_FUNC
+ *
+ * @return GF_SUCCESS on success
+ *
+ */
+GF_RETTYPE
+GFRmGPIOSetPinGrpSelect(GFRmChHandle ChHandle, GFGPIOPinGrp group, GFGPIOSelect select);
+
+/**
+ *
+ * Sets the status (high/low) of a pin
+ *
+ * @param ChHandle Channel to write to modules through
+ * @param pin Pin to set
+ * @param value Value to write to pin
+ *
+ */
+void
+GFRmGPIOSetPin(GFRmChHandle ChHandle, GFGPIOPin pin, NvU8 value);
+
+/**
+ * Gets the status (high/low) of a pin
+ *
+ * @param ChHandle Channel to write to modules through
+ * @param pin Pin to set
+ *
+ * @return Status (high/low) of pin
+ *
+ */
+NvU32
+GFRmGPIOGetPin(GFRmChHandle ChHandle, GFGPIOPin pin);
+
+/** @ name Bootflags
+ List of flags inidicating all the devices which are booted
+@{*/
+
+/** Chip is initalized in other words IxInit is called */
+#define GFRM_BOOT_IXINIT 0x1
+
+/** Display is initalized */
+#define GFRM_BOOT_DXINIT 0x2
+
+/*@}*/
+
+/**
+ * Writes to some scratch register with a log of all the components which are
+ * initalized. GFRM_BOOT_* are passed as bootflags.
+ */
+GF_RETTYPE GFRmBootPostInit(GFRmHandle hRm, NvU32 bootflags);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+/*@}*/
+
+/** @page pageRmAppNotes RmAPI Application Notes
+
+ @section pageRmAppNotes1 Todo
+
+*/
+
+#endif /* __GFRM_H__ */
+
diff --git a/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFRmError.h b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFRmError.h
new file mode 100755
index 00000000..7295b9f2
--- /dev/null
+++ b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFRmError.h
@@ -0,0 +1,68 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/** @file GFRmError.h
+ GFSDK Resource Manager API error code header file.
+*/
+
+#ifndef __GFRMERROR_H__
+#define __GFRMERROR_H__
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+/** GFRM error code: Function not supported. */
+#define GFRM_ERROR_NO_SUPPORT (GFRM_ERROR | 0x02)
+/** GFRM error code: Out of memory. */
+#define GFRM_ERROR_OUT_MEMORY (GFRM_ERROR | 0x03)
+/** GFRM error code: Operation on primary surface, but primary surface not set. */
+#define GFRM_ERROR_NO_PRIMARY_SURFACE (GFRM_ERROR | 0x04)
+/** GFRM error code: Bad parameters. */
+#define GFRM_ERROR_BAD_PARAMETER (GFRM_ERROR | 0x05)
+/** GFRM error code: Out of memory in DSP XRM heap. */
+#define GFRM_ERROR_XRM_OUTMEMORY (GFRM_ERROR | 0x06)
+/** GFRM error code: GFRM memory manager is not initialized. */
+#define GFRM_ERROR_MEM_MANAGER_NOT_INITIALIZED (GFRM_ERROR | 0x07)
+/** GFRM error code: DSP2Host message queue overflow. */
+#define GFRM_ERROR_QUEUE_OVERFLOW (GFRM_ERROR | 0x08)
+/** GFRM error code: DSP2Host message queue empty (not an error). */
+#define GFRM_ERROR_QUEUE_EMPTY (GFRM_ERROR | 0x09)
+/** GFRM error code: DSP2Host message with unknown task ID received. */
+#define GFRM_ERROR_QUEUE_UNKNOWNTASK (GFRM_ERROR | 0x0A)
+/** GFRM error code: Error getting GPU base address. */
+#define GFRM_ERROR_IXOPEN_GETADDRESS (GFRM_ERROR | 0x0C)
+/** GFRM error code: Error opening file. */
+#define GFRM_ERROR_FILE_OPEN_FAILED (GFRM_ERROR | 0x0D)
+/** GFRM error code: Cannot create XRM task. */
+#define GFRM_ERROR_XRM_CREATETASK (GFRM_ERROR | 0x0E)
+/** GFRM error code: GFRmOSEventWait() failed. */
+#define GF_WAIT_ERROR (GFRM_ERROR | 0x0F)
+/** GFRM error code: GFRmOSEventWait() timed out, the event was not set. */
+#define GF_WAIT_TIME_OUT (GFRM_ERROR | 0x10)
+/** GFRM error code: RmEnableModule tried to enable a module that doesn't exist. */
+#define GFRM_ERROR_MODULE_NOT_EXIST (GFRM_ERROR | 0x11)
+/** GFRM error code: HW Resource not available on GFRmHwResourceConstraint(). */
+#define GFRM_ERROR_HWRESOURCE_NOT_AVAILABLE (GFRM_ERROR | 0x12)
+/** GFRM error code: Host2DSP task message queue overflow. */
+#define GFRM_ERROR_XRM_QUEUE_OVERFLOW (GFRM_ERROR | 0x13)
+/** GFRM error code: Host2DSP task message queue empty. */
+#define GFRM_ERROR_XRM_QUEUE_EMPTY (GFRM_ERROR | 0x14)
+/** GFRM error code: File not found */
+#define GFRM_ERROR_FILE_NOT_FOUND (GFRM_ERROR | 0x15)
+/** GFRM error code: Create semaphore */
+#define GFRM_ERROR_CREATE_SEMAPHORE (GFRM_ERROR | 0x16)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // __GFRMERROR_H__
+
diff --git a/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFRmHelp.h b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFRmHelp.h
new file mode 100755
index 00000000..82c1fa5a
--- /dev/null
+++ b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFRmHelp.h
@@ -0,0 +1,515 @@
+/*
+ * Copyright 2003 NVIDIA Corporation. All Rights Reserved.
+ *
+ * BY INSTALLING THE SOFTWARE THE USER AGREES TO THE TERMS BELOW.
+ *
+ * User agrees to use the software under carefully controlled conditions
+ * and to inform all employees and contractors who have access to the software
+ * that the source code of the software is confidential and proprietary
+ * information of NVIDIA and is licensed to user as such. User acknowledges
+ * and agrees that protection of the source code is essential and user shall
+ * retain the source code in strict confidence.User shall restrict access to
+ * the source code of the software to those employees and contractors of user
+ * who have agreed to be bound by a confidentiality obligation which
+ * incorporates the protections and restrictions substantially set forth
+ * herein, and who have a need to access the source code in order to carry out
+ * the business purpose between NVIDIA and user. The software provided
+ * herewith to user may only be used so long as the software is used solely
+ * with NVIDIA products and no other third party products (hardware or
+ * software). The software must carry the NVIDIA copyright notice shown
+ * above. User must not disclose, copy, duplicate, reproduce, modify,
+ * publicly display, create derivative works of the software other than as
+ * expressly authorized herein. User must not under any circumstances,
+ * distribute or in any way disseminate the information contained in the
+ * source code and/or the source code itself to third parties except as
+ * expressly agreed to by NVIDIA. In the event that user discovers any bugs
+ * in the software, such bugs must be reported to NVIDIA and any fixes may be
+ * inserted into the source code of the software by NVIDIA only. User shall
+ * not modify the source code of the software in any way. User shall be fully
+ * responsible for the conduct of all of its employees, contractors and
+ * representatives who may in any way violate these restrictions.
+ *
+ * NO WARRANTY
+ * THE ACCOMPANYING SOFTWARE (INCLUDING OBJECT AND SOURCE CODE) PROVIDED BY
+ * NVIDIA TO USER IS PROVIDED "AS IS." NVIDIA DISCLAIMS ALL WARRANTIES,
+ * EXPRESS, IMPLIED OR STATUTORY, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ * WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT.
+
+ * LIMITATION OF LIABILITY
+ * NVIDIA SHALL NOT BE LIABLE TO USER, USERS CUSTOMERS, OR ANY OTHER PERSON
+ * OR ENTITY CLAIMING THROUGH OR UNDER USER FOR ANY LOSS OF PROFITS, INCOME,
+ * SAVINGS, OR ANY OTHER CONSEQUENTIAL, INCIDENTAL, SPECIAL, PUNITIVE, DIRECT
+ * OR INDIRECT DAMAGES (WHETHER IN AN ACTION IN CONTRACT, TORT OR BASED ON A
+ * WARRANTY), EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGES. THESE LIMITATIONS SHALL APPLY NOTWITHSTANDING ANY FAILURE OF THE
+ * ESSENTIAL PURPOSE OF ANY LIMITED REMEDY. IN NO EVENT SHALL NVIDIAS
+ * AGGREGATE LIABILITY TO USER OR ANY OTHER PERSON OR ENTITY CLAIMING THROUGH
+ * OR UNDER USER EXCEED THE AMOUNT OF MONEY ACTUALLY PAID BY USER TO NVIDIA
+ * FOR THE SOFTWARE PROVIDED HEREWITH.
+ */
+
+/*
+ * File: GFRmHelp.inl
+ * GFSDK Resource Manager Helper Manager inline header file.
+ * #### The helper functions are highly dependent on Operating System ####
+ * #### and Compiler. A number of these functions are macros that ####
+ * #### maps to corresonding operating system functions directly. ####
+ */
+
+#ifndef __GFRMHelp_INL__
+#define __GFRMHelp_INL__
+
+#include "nvtypes.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+/* Defined in GFRMHelp.c */
+extern int GFStricmp(char *, char *);
+extern int GFStrincmp(char *, char *, int);
+
+extern void *GFMalloc(int);
+extern void GFFree(void *ptr);
+
+#if NVOS_IS_WINDOWS_CE
+
+#ifndef __KERNEL__
+#include
+#include
+#endif // __KERNEL__
+
+/* String Helper functions */
+#define GFStrcpy(p1, p2) strcpy(p1, p2)
+#define GFStrncpy(p1, p2, p3) strncpy(p1, p2, p3)
+#define GFStrcat(p1, p2) strcat(p1, p2)
+#define GFStrncat(p1, p2, p3) strncat(p1, p2, p3)
+#define GFStrlen(p1) strlen(p1)
+#define GFStrchr(p1, p2) strchr(p1, p2)
+#define GFStrcmp(p1, p2) strcmp(p1, p2)
+#define GFStrncmp(p1, p2, p3) strncmp(p1, p2, p3)
+#define GFStrtok(p1, p2) strtok(p1, p2)
+#define GFStrstr(p1, p2) strstr(p1, p2)
+#define GFSscanf(p1, p2, p3) sscanf(p1, p2, p3)
+#define GFToupper(p1) toupper(p1)
+#define GFTolower(p1) tolower(p1)
+#define GFAtoi(p1) atoi(p1)
+
+// convert char string to wchar_t
+// p1 = src string of type char
+// p2 = dst string of type wchar_t
+// p3 = size of dst string in wchar_t unit
+#define GFStrConvert(p1, p2, p3) \
+ MultiByteToWideChar(CP_ACP, 0, p1, -1, p2, p3);
+
+// convert wchar_t string to char
+// p1 = src string of type wchar_t
+// p2 = dst string of type char
+// p3 = size of dst string in char unit
+#define GFWStrConvert(p1, p2, p3) \
+ WideCharToMultiByte(CP_ACP, 0, p1, -1, p2, p3, NULL, NULL)
+
+/* Standard Helper functions */
+#define GFStrtol(p1, p2, p3) strtol(p1, p2, p3)
+#define GFStrtod(p1, p2) strtod(p1, p2)
+
+/* Memory Helper functions */
+#define GFMemcpy( p1, p2, p3 ) memcpy( p1, p2, p3 )
+#define GFMemmove( p1, p2, p3 ) memmove( p1, p2, p3 )
+#define GFMemcmp( p1, p2, p3 ) memcmp( p1, p2, p3 )
+#define GFMemset( p1, p2, p3 ) memset( p1, p2, p3 )
+
+#if defined(GF_ENABLE_RMC_TRACE)
+void GFRmRMCTrace(const char *printf_format, ...);
+void GFRmRMCVTrace(const char *printf_format, va_list ap);
+#define GFRMCTrace(a) GFRmRMCTrace a
+#define GFRMCVTrace(a) GFRmRMCVTrace a
+#else
+#define GFRMCTrace(a)
+#define GFRMCVTrace(a)
+#endif
+
+/* Debug Helper functions */
+#if !defined(PROJECT_SEC_G1) || defined(DEBUG)
+#define GFPrintf printf
+#else
+#define GFPrintf
+#endif
+#define GFSprintf sprintf
+#define GFSprintfVAL vsprintf
+#define GFPrintfVAL vprintf
+
+#ifdef DEBUG
+extern void RmDebugBreak(void);
+#define GFDEBUG_ASSERT(x) if(!(x)) \
+ { \
+ GFPrintf(" Assert at Line no: %d in %s ", \
+ __LINE__, __FILE__); \
+ RmDebugBreak(); \
+ }
+#endif
+
+#elif NVOS_IS_LINUX
+
+#ifndef __KERNEL__
+void RmDebugBreak(void);
+#ifdef DEBUG
+#define GFDEBUG_ASSERT(x) if(!(x)) \
+ { \
+ GFPrintf(" Assert at Line no: %d in %s ", \
+ __LINE__, __FILE__); \
+ RmDebugBreak(); \
+ }
+#endif
+
+#include
+#define GFToupper toupper
+#define GFTolower tolower
+
+#include
+#ifndef GF_XTENSA_RM_TASK
+#include
+#endif
+#define GFMemcpy memcpy
+#define GFMemmove memmove
+#define GFMemset memset
+#define GFMemcmp memcmp
+#define GFStrchr strchr
+#define GFStrcmp strcmp
+#define GFStrcpy strcpy
+#define GFStrncpy strncpy
+#define GFStrlen strlen
+#define GFStrcat strcat
+#define GFStrncmp strncmp
+#define GFStrtok strtok
+#define GFStrstr strstr
+#define GFSscanf sscanf
+
+#include
+#define GFPrintf printf
+#define GFSprintf sprintf
+#define GFSprintfVAL vsprintf
+#define GFPrintf printf
+#define GFSprintf sprintf
+#define GFSprintfVAL vsprintf
+#define GFPrintfVAL vprintf
+
+#include
+#define GFStrtol strtol
+#define GFStrtod strtod
+#define GFAtoi atoi
+#include
+
+/* Add or overload RMCTrace function here */
+#if defined(GF_ENABLE_RMC_TRACE)
+#include
+void GFRmRMCTrace(const char *printf_format, ...);
+void GFRmRMCVTrace(const char *printf_format, va_list ap);
+#define GFRMCTrace(a) GFRmRMCTrace a
+#define GFRMCVTrace(a) GFRmRMCVTrace a
+#else
+#define GFRMCTrace(a)
+#define GFRMCVTrace(a)
+#endif
+
+#else /* kernel mode */
+
+#include
+#include
+
+#include
+#define GFToupper toupper
+#define GFTolower tolower
+
+#include
+#define GFMemcpy memcpy
+#define GFMemmove memmove
+#define GFMemset memset
+#define GFStrcpy strcpy
+#define GFStrncpy strncpy
+#define GFStrlen strlen
+#define GFMemcmp memcmp
+#define GFStrcmp strcmp
+#define GFStrncmp strncmp
+#define GFStrcat strcat
+#define GFStrncat strncat
+
+#define GFStrstr strstr
+#define GFSscanf sscanf
+
+#define GFPrintf printk
+#define GFSprintf sprintf
+#define GFSprintfVAL vsprintf
+#define GFPrintfVAL vprintf
+#define GFAtoi atoi
+
+#if defined(GF_ENABLE_RMC_TRACE)
+#include
+void GFRmRMCTrace(const char *printf_format, ...);
+void GFRmRMCVTrace(const char *printf_format, va_list ap);
+#define GFRMCTrace(a) GFRmRMCTrace a
+#define GFRMCVTrace(a) GFRmRMCVTrace a
+#else
+#define GFRMCTrace(a)
+#define GFRMCVTrace(a)
+#endif
+
+#endif /* KERNEL */
+
+#elif NVOS_IS_WINDOWS
+
+#include
+#include
+#include
+#include
+
+/* String functions */
+#define GFStrcpy(p1, p2) strcpy(p1, p2)
+#define GFStrncpy(p1, p2, p3) strncpy(p1, p2, p3)
+#define GFStrcat(p1, p2) strcat(p1, p2)
+#define GFStrncat(p1, p2, p3) strncat(p1, p2, p3)
+#define GFStrstr(p1, p2) strstr(p1, p2)
+#define GFSscanf(p1, p2, p3) sscanf(p1, p2, p3)
+#define GFStrlen(p1) strlen(p1)
+#define GFStrchr(p1, p2) strchr(p1, p2)
+#define GFStrcmp(p1, p2) strcmp(p1, p2)
+#define GFStrncmp(p1, p2, p3) strncmp(p1, p2, p3)
+#define GFStrtok(p1, p2) strtok(p1, p2)
+#define GFToupper(p1) toupper(p1)
+#define GFTolower(p1) tolower(p1)
+#define GFStrConvert(p1, p2, p3) \
+ strcpy(p2,p1)
+// MultiByteToWideChar( CP_ACP, 0, p1, -1, p2, p3 );
+ // convert char string to Wide
+ // p1 = src string of type char
+ // p2 = dst string of type wchar_t
+ // p3 = size of dst string in wchar_t unit
+
+/* Standard Helper functions */
+#define GFStrtol(p1, p2, p3) strtol(p1, p2, p3)
+#define GFStrtod(p1, p2) strtod(p1, p2)
+
+/* Memory Helper functions */
+#define GFMemcpy( p1, p2, p3 ) memcpy( p1, p2, p3 )
+#define GFMemmove( p1, p2, p3 ) memmove( p1, p2, p3 )
+#define GFMemcmp( p1, p2, p3 ) memcmp( p1, p2, p3 )
+#define GFMemset( p1, p2, p3 ) memset( p1, p2, p3 )
+
+#define GFAtoi( p1 ) atoi( p1 )
+/* Debug Helper functions */
+#if !defined(PROJECT_SEC_G1) || defined(DEBUG)
+#define GFPrintf printf
+#else
+#define GFPrintf
+#endif
+#define GFSprintf sprintf
+#define GFSprintfVAL vsprintf
+#define GFPrintfVAL vprintf
+
+#if defined(GF_ENABLE_RMC_TRACE)
+void GFRmRMCTrace(const char *printf_format, ...);
+void GFRmRMCVTrace(const char *printf_format, va_list ap);
+#define GFRMCTrace(a) GFRmRMCTrace a
+#define GFRMCVTrace(a) GFRmRMCVTrace a
+#else
+#define GFRMCTrace(a)
+#define GFRMCVTrace(a)
+#endif
+
+void RmDebugBreak(void);
+#ifdef DEBUG
+#define GFDEBUG_ASSERT(x) if(!(x)) \
+ { \
+ GFPrintf(" Assert at Line no: %d in %s ", \
+ __LINE__, __FILE__); \
+ RmDebugBreak(); \
+ }
+#endif
+
+// Operating system running on the Xtensa
+#elif NVCPU_IS_XTENSA
+
+#include
+
+/* Memory Helper functions */
+#define GFMemcpy( p1, p2, p3 ) memcpy(p1, p2, p3)
+#define GFMemset( p1, p2, p3 ) memset(p1, p2, p3)
+
+#define GFRMCTrace(a)
+#define GFRMCVTrace(a)
+
+#else
+
+#include
+#include
+#include
+#include
+#include
+
+/* String functions */
+extern char GFToupper(char);
+extern char GFTolower(char);
+
+extern int GFAtoi(const char *);
+
+extern void *GFMemcpy(void *, const void *, int);
+extern void *GFMemmove(void *, const void *, int);
+extern void *GFMemset(void *, int, int);
+extern int GFMemcmp(void *, void *, int);
+
+extern char *GFStrcpy(char *, const char *);
+extern char *GFStrncpy(char *, const char *, int);
+
+extern char *GFStrcat(char *, const char *);
+extern char *GFStrncat(char *, const char *, int);
+
+extern int GFStrlen(const char *);
+
+extern char *GFStrchr(const char *,int);
+extern char *GFStrrchr(const char *,int);
+
+extern int GFStrcmp(const char *, const char *);
+extern int GFStrncmp(const char *, const char *, int);
+
+extern char *GFStrstr(const char * string1, const char * string2);
+extern int GFSscanf(char * string1, const char * string2, ...);
+
+extern char *GFStrtok(char *, const char *);
+
+extern long GFStrtol(const char *, char **, int);
+extern double GFStrtod(const char *, char **);
+
+extern int GFPrintf(const char *, ... );
+extern int GFSprintf(char * , const char *, ... );
+extern int GFSprintfVAL(char *, const char *, va_list);
+extern int GFPrintfVAL(const char *, va_list);
+
+#define GFStrConvert(p1, p2, p3) GFStrncpy(p1, p2, p3)
+
+#if defined(GF_ENABLE_RMC_TRACE)
+#define GFRMCTrace(a) printf a
+#define GFRMCVTrace(a) vprintf a
+#else
+#define GFRMCTrace(a)
+#define GFRMCVTrace(a)
+#endif
+
+#ifdef DEBUG
+#define GFDEBUG_ASSERT(x) if(!(x)) \
+ { \
+ GFPrintf(" Assert at Line no: %d in %s ", \
+ __LINE__, __FILE__); \
+ }
+#endif
+
+#endif /* GF_OS */
+
+/* Virtual Key Mappings for Specific OS */
+#if NVOS_IS_LINUX
+/* Virtual Keys */
+#define GF_VKEY_BACK 27
+#define GF_VKEY_FORWARD 13
+#define GF_VKEY_UP 65
+#define GF_VKEY_LEFT 68
+#define GF_VKEY_RIGHT 67
+#define GF_VKEY_DOWN 66
+#define GF_VKEY_SEND 46
+#define GF_VKEY_END 44
+#define GF_VKEY_0 48
+#define GF_VKEY_1 49
+#define GF_VKEY_2 50
+#define GF_VKEY_3 51
+#define GF_VKEY_4 52
+#define GF_VKEY_5 53
+#define GF_VKEY_6 54
+#define GF_VKEY_7 55
+#define GF_VKEY_8 56
+#define GF_VKEY_9 57
+#define GF_VKEY_STAR 42
+#define GF_VKEY_POUND 35
+
+#elif NVOS_IS_WINDOWS_CE
+
+/* Virtual Keys */
+#define GF_VKEY_BACK 27
+#define GF_VKEY_FORWARD 13
+#define GF_VKEY_UP 72
+#define GF_VKEY_LEFT 75
+#define GF_VKEY_RIGHT 77
+#define GF_VKEY_DOWN 80
+#define GF_VKEY_SEND 46
+#define GF_VKEY_END 44
+#define GF_VKEY_0 48
+#define GF_VKEY_1 49
+#define GF_VKEY_2 50
+#define GF_VKEY_3 51
+#define GF_VKEY_4 52
+#define GF_VKEY_5 53
+#define GF_VKEY_6 54
+#define GF_VKEY_7 55
+#define GF_VKEY_8 56
+#define GF_VKEY_9 57
+#define GF_VKEY_STAR 42
+#define GF_VKEY_POUND 35
+
+#elif NVOS_IS_WINDOWS
+/* Virtual Keys */
+#define GF_VKEY_BACK 27
+#define GF_VKEY_FORWARD 13
+#define GF_VKEY_UP 72
+#define GF_VKEY_LEFT 75
+#define GF_VKEY_RIGHT 77
+#define GF_VKEY_DOWN 80
+#define GF_VKEY_SEND 46
+#define GF_VKEY_END 44
+#define GF_VKEY_0 48
+#define GF_VKEY_1 49
+#define GF_VKEY_2 50
+#define GF_VKEY_3 51
+#define GF_VKEY_4 52
+#define GF_VKEY_5 53
+#define GF_VKEY_6 54
+#define GF_VKEY_7 55
+#define GF_VKEY_8 56
+#define GF_VKEY_9 57
+#define GF_VKEY_STAR 42
+#define GF_VKEY_POUND 35
+
+#else
+
+/* Virtual Keys */
+#define GF_VKEY_BACK 2
+#define GF_VKEY_FORWARD 3
+#define GF_VKEY_UP 4
+#define GF_VKEY_LEFT 5
+#define GF_VKEY_RIGHT 6
+#define GF_VKEY_DOWN 7
+#define GF_VKEY_SEND 8
+#define GF_VKEY_END 9
+#define GF_VKEY_0 10
+#define GF_VKEY_1 11
+#define GF_VKEY_2 12
+#define GF_VKEY_3 13
+#define GF_VKEY_4 14
+#define GF_VKEY_5 15
+#define GF_VKEY_6 16
+#define GF_VKEY_7 17
+#define GF_VKEY_8 18
+#define GF_VKEY_9 19
+#define GF_VKEY_STAR 20
+#define GF_VKEY_POUND 21
+
+#endif /* GF_OS */
+
+#ifndef GFDEBUG_ASSERT
+#define GFDEBUG_ASSERT(x) do {} while (0)
+#endif /* GFDEBUG_ASSERT */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __GFRMHelp_INL__ */
+
diff --git a/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFRmHelp.inl b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFRmHelp.inl
new file mode 100755
index 00000000..4612fce2
--- /dev/null
+++ b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFRmHelp.inl
@@ -0,0 +1,626 @@
+/*
+ * Copyright 2003 NVIDIA Corporation. All Rights Reserved.
+ *
+ * BY INSTALLING THE SOFTWARE THE USER AGREES TO THE TERMS BELOW.
+ *
+ * User agrees to use the software under carefully controlled conditions
+ * and to inform all employees and contractors who have access to the software
+ * that the source code of the software is confidential and proprietary
+ * information of NVIDIA and is licensed to user as such. User acknowledges
+ * and agrees that protection of the source code is essential and user shall
+ * retain the source code in strict confidence. User shall restrict access to
+ * the source code of the software to those employees and contractors of user
+ * who have agreed to be bound by a confidentiality obligation which
+ * incorporates the protections and restrictions substantially set forth
+ * herein, and who have a need to access the source code in order to carry out
+ * the business purpose between NVIDIA and user. The software provided
+ * herewith to user may only be used so long as the software is used solely
+ * with NVIDIA products and no other third party products (hardware or
+ * software). The software must carry the NVIDIA copyright notice shown
+ * above. User must not disclose, copy, duplicate, reproduce, modify,
+ * publicly display, create derivative works of the software other than as
+ * expressly authorized herein. User must not under any circumstances,
+ * distribute or in any way disseminate the information contained in the
+ * source code and/or the source code itself to third parties except as
+ * expressly agreed to by NVIDIA. In the event that user discovers any bugs
+ * in the software, such bugs must be reported to NVIDIA and any fixes may be
+ * inserted into the source code of the software by NVIDIA only. User shall
+ * not modify the source code of the software in any way. User shall be fully
+ * responsible for the conduct of all of its employees, contractors and
+ * representatives who may in any way violate these restrictions.
+ *
+ * NO WARRANTY
+ * THE ACCOMPANYING SOFTWARE (INCLUDING OBJECT AND SOURCE CODE) PROVIDED BY
+ * NVIDIA TO USER IS PROVIDED "AS IS." NVIDIA DISCLAIMS ALL WARRANTIES,
+ * EXPRESS, IMPLIED OR STATUTORY, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ * WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT.
+
+ * LIMITATION OF LIABILITY
+ * NVIDIA SHALL NOT BE LIABLE TO USER, USERS CUSTOMERS, OR ANY OTHER PERSON
+ * OR ENTITY CLAIMING THROUGH OR UNDER USER FOR ANY LOSS OF PROFITS, INCOME,
+ * SAVINGS, OR ANY OTHER CONSEQUENTIAL, INCIDENTAL, SPECIAL, PUNITIVE, DIRECT
+ * OR INDIRECT DAMAGES (WHETHER IN AN ACTION IN CONTRACT, TORT OR BASED ON A
+ * WARRANTY), EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGES. THESE LIMITATIONS SHALL APPLY NOTWITHSTANDING ANY FAILURE OF THE
+ * ESSENTIAL PURPOSE OF ANY LIMITED REMEDY. IN NO EVENT SHALL NVIDIAS
+ * AGGREGATE LIABILITY TO USER OR ANY OTHER PERSON OR ENTITY CLAIMING THROUGH
+ * OR UNDER USER EXCEED THE AMOUNT OF MONEY ACTUALLY PAID BY USER TO NVIDIA
+ * FOR THE SOFTWARE PROVIDED HEREWITH.
+ */
+
+/*
+ * File: GFRmHelp.inl
+ * GFSDK Resource Manager Helper Manager inline header file.
+ * #### The helper functions are highly dependent on Operating System ####
+ * #### and Compiler. A number of these functions are macros that ####
+ * #### maps to corresonding operating system functions directly. ####
+ */
+
+#ifndef __GFRMHelp_INL__
+#define __GFRMHelp_INL__
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+/*
+ * Define the macro GFRMHELP_IMPORTFUNC to import the helper functions
+ * referenced in GFSDK. Typically Target OS provides definitions for these
+ * functions. Sample definitions are provided in file RMHelpGeneric.c.
+ */
+
+#if defined(GFRMHELP_ABSTRACTION)
+extern char GFAToupper(char);
+extern char GFATolower(char);
+
+extern void *GFMalloc(int);
+extern void GFFree(void *ptr);
+
+extern void *GFMemcpy(void *, const void *, int);
+extern void *GFMemmove(void *, const void *, int);
+extern void *GFMemset(void *, int, int);
+extern int GFMemcmp(void *, void *, int);
+
+extern char *GFAStrcpy(char *, const char *);
+extern char *GFAStrncpy(char *, const char *, int);
+
+extern char *GFAStrcat(char *, const char *);
+extern char *GFAStrncat(char *, const char *, int);
+
+extern char *GFAStrstr(const char * string1, const char * string2);
+extern int GFASscanf(char * string1, const char * string2, ...);
+
+extern int GFAStrlen(const char *);
+
+extern char *GFAStrchr(const char *,int);
+
+extern int GFAStrcmp(const char *, const char *);
+extern int GFAStrncmp(const char *, const char *, int);
+
+extern char *GFAStrtok(char *, const char *);
+
+extern long GFAStrtol(const char *, char **, int);
+extern double GFAStrtod(const char *, char **);
+
+extern int GFAPrintf(const char *, ... );
+
+#if defined(GF_ENABLE_RMC_TRACE)
+void GFRmRMCTrace(const char *printf_format, ...);
+#define GFRMCTrace(a) GFRmRMCTrace a
+#else
+#define GFRMCTrace(a)
+#endif
+
+#else
+
+/* Defined in GFRMHelp.c */
+extern int GFAStricmp(char *, char *);
+extern int GFAStrincmp(char *, char *, int);
+
+
+#if defined(NV_WINDOWS_CE)
+
+#ifndef __KERNEL__
+#include
+#include
+#include
+#endif // __KERNEL__
+
+/* String Helper functions */
+#define GFAStrcpy(p1, p2) strcpy(p1, p2)
+#define GFAStrncpy(p1, p2, p3) strncpy(p1, p2, p3)
+#define GFAStrcat(p1, p2) strcat(p1, p2)
+#define GFAStrncat(p1, p2, p3) strncat(p1, p2, p3)
+#define GFAStrlen(p1) strlen(p1)
+#define GFAStrchr(p1, p2) strchr(p1, p2)
+#define GFAStrcmp(p1, p2) strcmp(p1, p2)
+#define GFAStrncmp(p1, p2, p3) strncmp(p1, p2, p3)
+#define GFAStrtok(p1, p2) strtok(p1, p2)
+#define GFAStrstr(p1, p2) strstr(p1, p2)
+#define GFASscanf(p1, p2, p3) sscanf(p1, p2, p3)
+#define GFAToupper(p1) toupper(p1)
+#define GFATolower(p1) tolower(p1)
+#define GFAAtoi(p1) atoi(p1)
+
+// convert char string to wchar_t
+// p1 = src string of type char
+// p2 = dst string of type wchar_t
+// p3 = size of dst string in wchar_t unit
+#define GFAStrConvert(p1, p2, p3) \
+ MultiByteToWideChar(CP_ACP, 0, p1, -1, p2, p3);
+
+// convert wchar_t string to char
+// p1 = src string of type wchar_t
+// p2 = dst string of type char
+// p3 = size of dst string in char unit
+#define GFWStrConvert(p1, p2, p3) \
+ WideCharToMultiByte(CP_ACP, 0, p1, -1, p2, p3, NULL, NULL)
+
+/* Standard Helper functions */
+#define GFAStrtol(p1, p2, p3) strtol(p1, p2, p3)
+#define GFAStrtod(p1, p2) strtod(p1, p2)
+
+/* Memory Helper functions */
+#define GFMalloc( p1 ) malloc( p1 )
+#define GFFree( p1 ) free( p1 )
+#define GFMemcpy( p1, p2, p3 ) memcpy( p1, p2, p3 )
+#define GFMemmove( p1, p2, p3 ) memmove( p1, p2, p3 )
+#define GFMemcmp( p1, p2, p3 ) memcmp( p1, p2, p3 )
+#define GFMemset( p1, p2, p3 ) memset( p1, p2, p3 )
+
+#if defined(GF_ENABLE_RMC_TRACE)
+void GFRmRMCTrace(const char *printf_format, ...);
+void GFRmRMCVTrace(const char *printf_format, va_list ap);
+#define GFRMCTrace(a) GFRmRMCTrace a
+#define GFRMCVTrace(a) GFRmRMCVTrace a
+#else
+#define GFRMCTrace(a)
+#define GFRMCVTrace(a)
+#endif
+
+/* Debug Helper functions */
+#define GFAPrintf printf
+#define GFASprintf sprintf
+#define GFASprintfVAL vsprintf
+#define GFAPrintfVAL vprintf
+
+#ifdef DEBUG
+extern void RmDebugBreak(void);
+#define GFDEBUG_ASSERT(x) if(!(x)) \
+ { \
+ GFPrintf(" Assert at Line no: %d in %s ", \
+ __LINE__, __FILE__); \
+ RmDebugBreak(); \
+ }
+#endif
+
+#elif defined(NV_LINUX)
+
+#ifndef __KERNEL__
+#ifdef DEBUG
+#include
+#define GFDEBUG_ASSERT(x) assert(x)
+#endif
+
+
+#define __declspec(x)
+
+#include
+#define GFMalloc malloc
+#define GFFree free
+
+#include
+#define GFAToupper toupper
+#define GFATolower tolower
+
+#include
+#ifndef GF_XTENSA_RM_TASK
+#include
+#endif
+#define GFMemcpy memcpy
+#define GFMemmove memmove
+#define GFMemset memset
+#define GFMemcmp memcmp
+#define GFAStrcmp strcmp
+#define GFAStrcpy strcpy
+#define GFAStrncpy strncpy
+#define GFAStrlen strlen
+#define GFAStrcat strcat
+#define GFAStrncmp strncmp
+#define GFAStrtok strtok
+#define GFAStrstr strstr
+#define GFASscanf sscanf
+
+#include
+#define GFAPrintf printf
+#define GFASprintf sprintf
+#define GFASprintfVAL vsprintf
+#define GFAPrintf printf
+#define GFASprintf sprintf
+#define GFASprintfVAL vsprintf
+#define GFAPrintfVAL vprintf
+
+#include
+#define GFAStrtol strtol
+#define GFAStrtod strtod
+#define GFAAtoi atoi
+#include
+
+/* Add or overload RMCTrace function here */
+#if defined(GF_ENABLE_RMC_TRACE)
+#include
+void GFRmRMCTrace(const char *printf_format, ...);
+void GFRmRMCVTrace(const char *printf_format, va_list ap);
+#define GFRMCTrace(a) GFRmRMCTrace a
+#define GFRMCVTrace(a) GFRmRMCVTrace a
+#else
+#define GFRMCTrace(a)
+#define GFRMCVTrace(a)
+#endif
+
+#else /* kernel mode */
+
+#include
+#include
+#define GFMalloc(x) kmalloc((x), GFP_KERNEL)
+#define GFFree kfree
+
+#include
+#define GFAToupper toupper
+#define GFATolower tolower
+
+#include
+#define GFMemcpy memcpy
+#define GFMemmove memmove
+#define GFMemset memset
+#define GFAStrcpy strcpy
+#define GFAStrncpy strncpy
+#define GFAStrlen strlen
+#define GFMemcmp memcmp
+#define GFAStrcmp strcmp
+#define GFAStrncmp strncmp
+#define GFAStrcat strcat
+#define GFAStrncat strncat
+
+#define GFAStrstr strstr
+#define GFASscanf sscanf
+
+#define GFAPrintf printk
+#define GFASprintf sprintf
+#define GFASprintfVAL vsprintf
+#define GFAPrintfVAL vprintf
+#define GFAAtoi atoi
+
+#if defined(GF_ENABLE_RMC_TRACE)
+#include
+void GFRmRMCTrace(const char *printf_format, ...);
+void GFRmRMCVTrace(const char *printf_format, va_list ap);
+#define GFRMCTrace(a) GFRmRMCTrace a
+#define GFRMCVTrace(a) GFRmRMCVTrace a
+#else
+#define GFRMCTrace(a)
+#define GFRMCVTrace(a)
+#endif
+
+#endif /* KERNEL */
+
+#elif defined(NV_WINDOWS)
+
+#include
+#include
+#include
+#include
+#include
+#include
+
+/* String functions */
+#define GFAStrcpy(p1, p2) strcpy(p1, p2)
+#define GFAStrncpy(p1, p2, p3) strncpy(p1, p2, p3)
+#define GFAStrcat(p1, p2) strcat(p1, p2)
+#define GFAStrncat(p1, p2, p3) strncat(p1, p2, p3)
+#define GFAStrstr(p1, p2) strstr(p1, p2)
+#define GFASscanf(p1, p2, p3) sscanf(p1, p2, p3)
+#define GFAStrlen(p1) strlen(p1)
+#define GFAStrchr(p1, p2) strchr(p1, p2)
+#define GFAStrcmp(p1, p2) strcmp(p1, p2)
+#define GFAStrncmp(p1, p2, p3) strncmp(p1, p2, p3)
+#define GFAStrtok(p1, p2) strtok(p1, p2)
+#define GFAToupper(p1) toupper(p1)
+#define GFATolower(p1) tolower(p1)
+#define GFAStrConvert(p1, p2, p3) \
+ strcpy(p2,p1)
+// MultiByteToWideChar( CP_ACP, 0, p1, -1, p2, p3 );
+ // convert char string to Wide
+ // p1 = src string of type char
+ // p2 = dst string of type wchar_t
+ // p3 = size of dst string in wchar_t unit
+
+/* Standard Helper functions */
+#define GFAStrtol(p1, p2, p3) strtol(p1, p2, p3)
+#define GFAStrtod(p1, p2) strtod(p1, p2)
+
+/* Memory Helper functions */
+#define GFMalloc( p1 ) malloc( p1 )
+#define GFFree( p1 ) free( p1 )
+#define GFMemcpy( p1, p2, p3 ) memcpy( p1, p2, p3 )
+#define GFMemmove( p1, p2, p3 ) memmove( p1, p2, p3 )
+#define GFMemcmp( p1, p2, p3 ) memcmp( p1, p2, p3 )
+#define GFMemset( p1, p2, p3 ) memset( p1, p2, p3 )
+
+#define GFAAtoi( p1 ) atoi( p1 )
+/* Debug Helper functions */
+#define GFAPrintf printf
+#define GFASprintf sprintf
+#define GFASprintfVAL vsprintf
+#define GFAPrintfVAL vprintf
+
+#if defined(GF_ENABLE_RMC_TRACE)
+void GFRmRMCTrace(const char *printf_format, ...);
+void GFRmRMCVTrace(const char *printf_format, va_list ap);
+#define GFRMCTrace(a) GFRmRMCTrace a
+#define GFRMCVTrace(a) GFRmRMCVTrace a
+#else
+#define GFRMCTrace(a)
+#define GFRMCVTrace(a)
+#endif
+
+#ifdef DEBUG
+#include "assert.h"
+#define GFDEBUG_ASSERT( x ) assert( x )
+#endif
+
+// Operating system running on the Xtensa
+#elif defined(NVCPU_XTENSA)
+
+#include
+
+#define GFAAtoi(p1)
+/* String functions */
+#define GFAStrcpy(p1, p2) strcpy(p1, p2)
+#define GFAStrncpy(p1, p2, p3)
+#define GFAStrcat(p1, p2)
+#define GFAStrncat(p1, p2, p3)
+#define GFAStrlen(p1)
+#define GFAStrchr(p1, p2)
+#define GFAStrcmp(p1, p2)
+#define GFAStrncmp(p1, p2, p3)
+
+#define GFAStrstr(p1, p2)
+#define GFASscanf(p1, p2, p3)
+
+#define GFAStrncmp(p1, p2, p3)
+#define GFAStrtok(p1, p2)
+#define GFAToupper(p1)
+#define GFATolower(p1)
+#define GFAStrConvert(p1, p2, p3)
+#define GFAAtoi(p1)
+
+/* Standard Helper functions */
+#define GFAStrtol(p1, p2, p3)
+#define GFAStrtod(p1, p2)
+
+/* Memory Helper functions */
+#define GFMalloc( p1 )
+#define GFFree( p1 )
+#define GFMemcpy( p1, p2, p3 ) memcpy(p1, p2, p3)
+#define GFMemmove( p1, p2, p3 ) memmove(p1, p2, p3)
+#define GFMemcmp( p1, p2, p3 ) memcmp(p1, p2, p3)
+#define GFMemset( p1, p2, p3 ) memset(p1, p2, p3)
+
+/* Debug Helper functions */
+#define GFAPrintf
+#define GFASprintf
+#define GFASprintfVAL
+#define GFAPrintfVAL
+
+#define GFRMCTrace(a)
+#define GFRMCVTrace(a)
+
+#else
+
+#include
+#include
+#include
+#include
+#include
+
+/* String functions */
+extern char GFAToupper(char);
+extern char GFATolower(char);
+
+extern int GFAAtoi(const char *);
+//#define GFMalloc( p1 ) malloc( p1 )
+//#define GFFree( p1 ) free( p1 )
+extern void *GFMalloc(int);
+extern void GFFree(void *);
+
+extern void *GFMemcpy(void *, const void *, int);
+extern void *GFMemmove(void *, const void *, int);
+extern void *GFMemset(void *, int, int);
+extern int GFMemcmp(void *, void *, int);
+
+extern char *GFAStrcpy(char *, const char *);
+extern char *GFAStrncpy(char *, const char *, int);
+
+extern char *GFAStrcat(char *, const char *);
+extern char *GFAStrncat(char *, const char *, int);
+
+extern int GFAStrlen(const char *);
+
+extern char *GFAStrchr(const char *,int);
+extern char *GFAStrrchr(const char *,int);
+
+extern int GFAStrcmp(const char *, const char *);
+extern int GFAStrncmp(const char *, const char *, int);
+
+extern char *GFAStrstr(const char * string1, const char * string2);
+extern int GFASscanf(char * string1, const char * string2, ...);
+
+extern char *GFAStrtok(char *, const char *);
+
+extern long GFAStrtol(const char *, char **, int);
+extern double GFAStrtod(const char *, char **);
+
+extern int GFAPrintf(const char *, ... );
+extern int GFASprintf(char * , const char *, ... );
+extern int GFASprintfVAL(char *, const char *, va_list);
+extern int GFAPrintfVAL(const char *, va_list);
+
+#define GFAStrConvert(p1, p2, p3) GFAStrncpy(p1, p2, p3)
+
+#if defined(GF_ENABLE_RMC_TRACE)
+#define GFRMCTrace(a) printf a
+#define GFRMCVTrace(a) vprintf a
+#else
+#define GFRMCTrace(a)
+#define GFRMCVTrace(a)
+#endif
+
+#ifdef DEBUG
+#define GFDEBUG_ASSERT(x) if(!(x)) \
+ { \
+ GFPrintf(" Assert at Line no: %d in %s ", \
+ __LINE__, __FILE__); \
+ }
+#endif
+
+#endif /* GF_OS */
+
+#endif /* GFRMHELP_ABSTRACTION */
+
+
+#define GFStrcpy GFAStrcpy
+#define GFStrncpy GFAStrncpy
+#define GFStrcat GFAStrcat
+#define GFStrncat GFAStrncat
+#define GFStrlen GFAStrlen
+#define GFStrchr GFAStrchr
+#define GFStrrchr GFAStrrchr
+#define GFStrstr GFAStrstr
+#define GFStrcmp GFAStrcmp
+#define GFStricmp GFAStricmp
+#define GFStrincmp GFAStrincmp
+#define GFStrncmp GFAStrncmp
+#define GFStrtok GFAStrtok
+#define GFToupper GFAToupper
+#define GFTolower GFATolower
+#define GFStrConvert GFAStrConvert
+#define GFPrintf GFAPrintf
+#define GFSprintf GFASprintf
+#define GFSprintfVAL GFASprintfVAL
+#define GFPrintfVAL GFAPrintfVAL
+#define GFStrtol GFAStrtol
+#define GFStrtod GFAStrtod
+#define GFSscanf GFASscanf
+#define GFAtoi GFAAtoi
+
+
+/* Virtual Key Mappings for Specific OS */
+#if defined(NV_LINUX)
+/* Virtual Keys */
+#define GF_VKEY_BACK 27
+#define GF_VKEY_FORWARD 13
+#define GF_VKEY_UP 65
+#define GF_VKEY_LEFT 68
+#define GF_VKEY_RIGHT 67
+#define GF_VKEY_DOWN 66
+#define GF_VKEY_SEND 46
+#define GF_VKEY_END 44
+#define GF_VKEY_0 48
+#define GF_VKEY_1 49
+#define GF_VKEY_2 50
+#define GF_VKEY_3 51
+#define GF_VKEY_4 52
+#define GF_VKEY_5 53
+#define GF_VKEY_6 54
+#define GF_VKEY_7 55
+#define GF_VKEY_8 56
+#define GF_VKEY_9 57
+#define GF_VKEY_STAR 42
+#define GF_VKEY_POUND 35
+
+#elif defined(NV_WINDOWS_CE)
+
+/* Virtual Keys */
+#define GF_VKEY_BACK 27
+#define GF_VKEY_FORWARD 13
+#define GF_VKEY_UP 72
+#define GF_VKEY_LEFT 75
+#define GF_VKEY_RIGHT 77
+#define GF_VKEY_DOWN 80
+#define GF_VKEY_SEND 46
+#define GF_VKEY_END 44
+#define GF_VKEY_0 48
+#define GF_VKEY_1 49
+#define GF_VKEY_2 50
+#define GF_VKEY_3 51
+#define GF_VKEY_4 52
+#define GF_VKEY_5 53
+#define GF_VKEY_6 54
+#define GF_VKEY_7 55
+#define GF_VKEY_8 56
+#define GF_VKEY_9 57
+#define GF_VKEY_STAR 42
+#define GF_VKEY_POUND 35
+
+#elif defined(NV_WINDOWS)
+/* Virtual Keys */
+#define GF_VKEY_BACK 27
+#define GF_VKEY_FORWARD 13
+#define GF_VKEY_UP 72
+#define GF_VKEY_LEFT 75
+#define GF_VKEY_RIGHT 77
+#define GF_VKEY_DOWN 80
+#define GF_VKEY_SEND 46
+#define GF_VKEY_END 44
+#define GF_VKEY_0 48
+#define GF_VKEY_1 49
+#define GF_VKEY_2 50
+#define GF_VKEY_3 51
+#define GF_VKEY_4 52
+#define GF_VKEY_5 53
+#define GF_VKEY_6 54
+#define GF_VKEY_7 55
+#define GF_VKEY_8 56
+#define GF_VKEY_9 57
+#define GF_VKEY_STAR 42
+#define GF_VKEY_POUND 35
+
+#else
+
+/* Virtual Keys */
+#define GF_VKEY_BACK 2
+#define GF_VKEY_FORWARD 3
+#define GF_VKEY_UP 4
+#define GF_VKEY_LEFT 5
+#define GF_VKEY_RIGHT 6
+#define GF_VKEY_DOWN 7
+#define GF_VKEY_SEND 8
+#define GF_VKEY_END 9
+#define GF_VKEY_0 10
+#define GF_VKEY_1 11
+#define GF_VKEY_2 12
+#define GF_VKEY_3 13
+#define GF_VKEY_4 14
+#define GF_VKEY_5 15
+#define GF_VKEY_6 16
+#define GF_VKEY_7 17
+#define GF_VKEY_8 18
+#define GF_VKEY_9 19
+#define GF_VKEY_STAR 20
+#define GF_VKEY_POUND 21
+
+#endif /* GF_OS */
+
+#ifndef GFDEBUG_ASSERT
+#define GFDEBUG_ASSERT(x) do {} while (0)
+#endif /* GFDEBUG_ASSERT */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __GFRMHelp_INL__ */
+
diff --git a/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFRmIx.h b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFRmIx.h
new file mode 100755
index 00000000..c2dddd0d
--- /dev/null
+++ b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFRmIx.h
@@ -0,0 +1,654 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/** @file GFRmIx.h
+ Chip Initialization API header file.
+*/
+
+#ifndef __GFRMIX_H__
+#define __GFRMIX_H__
+
+#include "GFRm.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+/** @addtogroup groupRmIx Chip Initialization API
+*/
+/*@{*/
+
+/* GPIO configurations
+ * Host GPIO1~GPIO7 correspond to HGP0~HGP6, C32KHZ.
+ * When configured as output, it is necessay to select output as data or
+ * Clocks or interrupt.
+ * GFIX_GPIO_CFG_OUTPUT can Or with GFIX_GPIO_CFG_OUTPUT_SEL_*
+ */
+
+/* Host GPIO type enum */
+typedef enum
+{
+ GFIX_GPIO0 = 0,
+ GFIX_GPIO1,
+ GFIX_GPIO2,
+ GFIX_GPIO3,
+ GFIX_GPIO4,
+ GFIX_GPIO5,
+ GFIX_GPIO6,
+ GFIX_GPIO7
+} GFIX_GPIO_TYPE;
+
+/* Host GPIO operations. */
+#define GFIX_GPIO_GET_INPUT_ENABLE 0x80000000UL
+#define GFIX_GPIO_GET_OUT_PUT_ENABLE 0x40000000UL
+#define GFIX_GPIO_SET_DATA 0x20000000UL
+#define GFIX_GPIO_CLR_DATA 0x10000000UL
+#define GFIX_GPIO_GET_DATA 0x08000000UL
+
+#define GFIX_GPIO_SET_INPUT_ENABLE 0x04000000UL
+#define GFIX_GPIO_CLR_INPUT_ENABLE 0x02000000UL
+#define GFIX_GPIO_SET_OUTPUT_ENABLE 0x01000000UL
+#define GFIX_GPIO_CLR_OUTPUT_ENABLE 0x00800000UL
+
+/*
+ * GPIO output select data, configure the pin as data output.
+ * Meaningful for pin0~pin4(HGP0~HGP4)
+ */
+
+#define GFIX_GPIO_CFG_OUTPUT_SEL_DATA 0x00000000
+
+/*
+ * GPIO output select interrupt, configure the pin as interrupt output.
+ * Meaningful for pin3(HGP3) only
+ */
+#define GFIX_GPIO_CFG_OUTPUT_SEL_INTR 0x00000040
+
+/*
+ * GPIO output select RDY signal
+ * Meaningful for pin4(HGP4) only
+ */
+#define GFIX_GPIO_CFG_OUTPUT_SEL_RDY 0x00000100
+
+/*
+ * For pin5 and pin6(HGP5, HGP6), config output clock or data on HGP5 and HGP6.
+ *
+ */
+#define GFIX_GPIO_CFG_OUTPUT_SEL_HGP56_CLK 0x00000800
+#define GFIX_GPIO_CFG_OUTPUT_SEL_HGP56_DATA 0x00000000
+
+/*
+ * For pin5(HGP5)
+ * select monitor clock to HGP5
+ */
+#define GFIX_GPIO_CFG_OUTPUT_SEL_HGP5_PLL1 0x00000000
+#define GFIX_GPIO_CFG_OUTPUT_SEL_HGP5_PLL2 0x00001000
+#define GFIX_GPIO_CFG_OUTPUT_SEL_HGP5_PLLCOSC 0x00002000
+#define GFIX_GPIO_CFG_OUTPUT_SEL_HGP5_PLLROSC 0x00003000
+
+/*
+ * For pin6(HGP6)
+ * select monitor clock to HGP6
+ */
+#define GFIX_GPIO_CFG_OUTPUT_SEL_HGP6_PLL2 0x00000000
+#define GFIX_GPIO_CFG_OUTPUT_SEL_HGP6_DCFCLK 0x00004000
+#define GFIX_GPIO_CFG_OUTPUT_SEL_HGP6_MCCLK 0x00008000
+#define GFIX_GPIO_CFG_OUTPUT_SEL_HGP6_DSPCLK 0x0000C000
+
+/*
+ * For pin7(C32KHZ)
+ */
+#define GFIX_GPIO_CFG_OUTPUT_SEL_C32KHZ 0x00000000
+
+/*
+ * Definition of attribute ids for Set/GetAttributes()
+ */
+typedef enum _GFIX_ATTR_TYPE
+ {
+ GFIX_ATTR_NONE = 0,
+ GFIX_ATTR_DEVICE_INFO,
+ GFIX_ATTR_DEVICE_INFO_STRUCT, /* Get Device ID & Rev */
+ GFIX_ATTR_EFUSE_PRODUCT_SKU_ID,
+ GFIX_ATTR_DRAM_SELF_REFRESH,
+ GFIX_ATTR_DRAM_DEEP_POWER_DOWN
+} GFIX_ATTR_TYPE;
+
+/*
+ * Definition of module frequency types.
+ */
+typedef enum _GFIX_MODULEFREQ_TYPE
+ {
+ GFIX_MODULEFREQ_OPTIMAL = 0,
+ GFIX_MODULEFREQ_MINIMUM,
+ GFIX_MODULEFREQ_MAXIMUM,
+ GFIX_MODULEFREQ_REQUESTED,
+ GFIX_MODULEFREQ_ACTUAL
+} GFIX_MODULEFREQ_TYPE;
+
+/*
+ * Definition of module operations.
+ */
+#define GFIX_DISABLECLOCK 0x00000001
+#define GFIX_ENABLECLOCK 0x00000002
+#define GFIX_SPECIAL 0x00000004
+#define GFIX_FORCEDISABLECLOCK 0x00000008
+#define GFIX_FORCEENABLECLOCK 0x00000010
+#define GFIX_DYNAMICSWITCH 0x00000020
+
+#define GFIX_FORCEDISABLEMODULE 0x00010000
+#define GFIX_FORCEENABLEMODULE 0x00020000
+
+/*
+ * Clock selections, profile and options
+ */
+enum
+{
+#define GFRM_CLOCK(x, y) GFIX_##x,
+#define GFRM_CLOCK_PLL(x, y) GFIX_##x,
+#include "gfrm_clock_ids.h"
+#undef GFRM_CLOCK
+#undef GFRM_CLOCK_PLL
+ GFNUMOFCLOCKIDS
+};
+
+enum
+{
+#define GFRM_CLOCK(x, y) (1 << GFIX_##x )|
+#define GFRM_CLOCK_PLL(x, y) (1 << GFIX_##x )|
+ GFIX_ALL_CLOCKS =
+#include "gfrm_clock_ids.h"
+ 0, // | 0 to GFIX_ALL_CLOCKS
+#undef GFRM_CLOCK
+#undef GFRM_CLOCK_PLL
+
+#define GFRM_CLOCK(x, y) (1 << GFIX_##x )|
+#define GFRM_CLOCK_PLL(x, y)
+ GFIX_NO_PLLS =
+#include "gfrm_clock_ids.h"
+ 0, // | 0 to GFIX_NO_PLLS
+#undef GFRM_CLOCK
+#undef GFRM_CLOCK_PLL
+
+#define GFRM_CLOCK(x, y)
+#define GFRM_CLOCK_PLL(x, y) (1 << GFIX_##x )|
+ GFIX_ONLY_PLLS =
+#include "gfrm_clock_ids.h"
+ 0, // | 0 to GFIX_NO_PLLS
+#undef GFRM_CLOCK
+#undef GFRM_CLOCK_PLL
+
+ GFIX_N_CLOCKSOURCES = GFNUMOFCLOCKIDS,
+ GFIX_NO_CLOCK = 0xFFFFFFFF,
+ GFIX_PLL_QUERY = 0x80000000
+};
+
+#define GFIX_POWER 0x00010000
+#define GFIX_PERFORMANCE 0x00020000
+
+#define GFIX_DEFAULTSLK 0x00000000
+#define GFIX_HIGHESTSLK 0x00000001
+
+/** Module clock profile */
+typedef struct _GFIXMODULECONFIG
+{
+ NvU8 clockSelection; /**< Selection mode */
+ NvU32 minFrequency; /**< Lowest frequency allowed */
+ NvU32 optimalFrequency; /**< Optimal frequency */
+ NvU32 maxFrequency; /**< Max frequency */
+ NvU32 sourceClocks; /**< Bitfield of valid source clocks */
+} GFIXMODULECONFIG, *PGFIXMODULECONFIG;
+
+/** Module state */
+ typedef struct _GFIXMODULESTATE
+{
+ NvU32 clkRefCount; /**< Reference counter used in GFRmIxEnableModuleClock */
+ NvU32 clkSelect; /**< Clock selected for module (only valid when clkRefCount is non-zero) */
+ /**< If clkSelect==GFIX_NO_CLOCK no clock is selected by this module */
+ NvU32 enableRefCount; /**< Reference counter used in GFRmIxEnableModule */
+} GFIXMODULESTATE, *PGFIXMODULESTATE;
+
+
+/** typedef for callback when the module is disabled */
+
+typedef GF_RETTYPE (*GF_FUNC_RMIX_CALLBACK)(void *handle);
+
+/** Initializes the chip
+
+ @param RmHandle (#GFRmHandle) Handle specific to the GFRm
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ GFRmIxInit() is the first function which touches the hardware, there are no
+ hardware accesses before GFRmIxInit(). It initializes some module's clocks
+ and as well as taking some modules out of reset. It also initializes
+ device-control registers.
+
+ @see GFRmIxDeInit()
+*/
+GF_RETTYPE
+GFRmIxInit( GFRmHandle RmHandle );
+
+/** De-initializes the chip
+
+ @param RmHandle (#GFRmHandle) Handle specific to the GFRm
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ GFRmIxDeInit() does the reverse of GFRmIxInit(), it shut downs the chip.
+ All modules are put back in reset and clocks turned off.
+
+ @see GFRmIxInit()
+*/
+GF_RETTYPE
+GFRmIxDeInit( GFRmHandle RmHandle );
+
+/** This function enables a module's clock
+
+ @param RmHandle (#GFRmHandle) Handle specific to the GFRm
+ @param modid (#eGFModuleIDs) ID of the module
+ @param option (NvU32) Bit field of options, GFIX_ENABLECLOCK,
+ GFIX_DISABLECLOCK, GFIX_FORCEENABLECLOCK,
+ GFIX_FORCEDISABLECLOCK, GFIX_DYNAMICSWITCH, GFIX_SPECIAL
+ @param special (NvU32) Specifies a module specific setting, only used when
+ option contains GFIX_SPECIAL
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ This function enables and disables a module's clock as well as enables the
+ module's source clock. There are two types of enables, the normal enable
+ and the force enable. When doing a normal enable the module's clock enable
+ reference count is increased as well as a call to GFRmIxEnableClockSource()
+ which ensures the module's source clock is enabled. When doing a force
+ enable/disable the modules reference counter is not touched,
+ GFRmIxEnableClockSource() is called which increases/deceases the source's
+ reference count. If the operation is to enable and the clock is currently
+ disabled, for the both normal enable and force disable GFRmIxEnableModuleClock
+ will attempt to find the best clock source and divider for the module.
+
+ Some modules support a dynamic clock divider, that is the clock doesn't have
+ to be turned off before reprogramming the divider. To switch a module's
+ frequency that supports dynamic dividers without first turning the module
+ off set option to GFIX_DYNAMICSWITCH. GFRmIxEnableModuleClock will attempt
+ to find the closest frequency to the desired without changing clock sources.
+
+ Some modules have special clock configurations such as VI, GFIX_SPECIAL can
+ be specified along with GFIX_ENABLECLOCK or by itself to configure the special
+ option for the module.
+*/
+GF_RETTYPE
+GFRmIxEnableModuleClock( GFRmHandle RmHandle,
+ eGFModuleIDs modid,
+ NvU32 option,
+ NvU32 special );
+
+/** Same as GFRmIxEnableModuleClock, but takes a callback
+ function which will be called when the refcount goes
+ to zero.
+
+ @param func Callback funtion of type GFRmIxEnableModuleClock
+ @param arg used as an argument to when callback function is called.
+
+ @see GFRmIxEnableModuleClock()
+*/
+GF_RETTYPE
+GFRmIxEnableModuleClockEx( GFRmHandle RmHandle,
+ eGFModuleIDs modid,
+ NvU32 option,
+ NvU32 special,
+ GF_FUNC_RMIX_CALLBACK func,
+ void *arg);
+
+/** Enables a module
+
+ @param RmHandle (#GFRmHandle) Handle specific to the GFRm
+ @param modid (#eGFModuleIDs) ID of the module
+ @param option (NvU32) If option is nonzero the module will be enabled
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ This function takes a module out of reset. Each module has a reference
+ count which is used to keep track of how many outstanding enables the
+ module has. The module will not be disabled until the reference counter
+ is returned to zero.
+*/
+GF_RETTYPE
+GFRmIxEnableModule( GFRmHandle RmHandle,
+ eGFModuleIDs modid,
+ NvU32 option );
+
+/** Same as GFRmIxEnableModule() but calls the passing in callback
+ function when the refcount of the module goes to zero.
+
+ @param callback Callback function of type GF_FUNC_RMIX_CALLBACK
+ @param arg Argument passed to the callback function.
+
+ @see GFRmIxEnableModule()
+*/
+GF_RETTYPE
+GFRmIxEnableModuleEx( GFRmHandle RmHandle,
+ eGFModuleIDs modid,
+ NvU32 option,
+ GF_FUNC_RMIX_CALLBACK callback,
+ void *arg
+ );
+
+/** Changes frequency of a clock.
+
+ @param RmHandle (#GFRmHandle) Handle specific to the GFRm
+ @param option (NvU32) GFIX_PLL1, GFIX_PLL2, GFIX_ROSC, GFIX_OSC,
+ GFIX_REFCLK0, GFIX_REFCLK1 or GFIX_PLL_QUERY
+ @param pFrequency (NvU32*) Pointer to 32-bit value in KHz to get three
+ digit MHz precision. Returns with newly set
+ current frequency.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+ @retval #GF_ERROR_BAD_PARAMETER Bad parameter passed
+
+ This function sets a clock to a certain frequency. If the clock cannot meet
+ the requested frequency then the closest one will be chosen. For the PLLs
+ this function determines the closest dividers to arrive at the requested
+ frequency. To determine the frequency that will be chosen without actually
+ setting it GFIX_PLL_QUERY can be Or'ed along with the clock ID.
+
+ Some clocks only have one frequency that never changes; this function must
+ still be called at least once to allow the internal logic to know what the
+ frequency of the clock is. To disable the selection of a clock by a module,
+ a clock can be disabled by setting its frequency to zero; this will remove
+ it from consideration for all modules.
+
+ This function will fail if a module is already using the clock.
+
+ @see GFRmIxGetFrequency()
+*/
+GF_RETTYPE
+GFRmIxSetFrequency( GFRmHandle RmHandle,
+ NvU32 option,
+ NvU32 *pFrequency );
+
+/** Retrieves frequency of a clock.
+
+ @param RmHandle (#GFRmHandle) Handle specific to the GFRm
+ @param option (NvU32) GFIX_PLL1, GFIX_PLL2, GFIX_ROSC, GFIX_OSC,
+ GFIX_REFCLK0, GFIX_REFCLK1
+ @param pFrequency (NvU32*) Pointer to 32-bit value in KHz to get three
+ digit MHz precision. Returns with currently
+ set frequency.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+ @retval #GF_ERROR_BAD_PARAMETER Bad parameter passed
+
+ @see GFRmIxSetFrequency()
+*/
+GF_RETTYPE
+GFRmIxGetFrequency( GFRmHandle RmHandle,
+ NvU32 option,
+ NvU32 *pFrequency );
+
+/** Sets the requested frequency of the module.
+
+ @param RmHandle (#GFRmHandle) Handle specific to the GFRm
+ @param modid (#eGFModuleIDs) ID of the module
+ @param frequency (NvU32) 32-bit value in KHz to get three digit MHz
+ precision
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ This function sets the requested frequency of a module, this value must
+ lie between the minimum and maximum frequencies specified in
+ GFRmIxSetModuleConfig(). This value is cached and used when
+ GFRmIxEnableModuleClock() is called attempting to enable the clock to the
+ module.
+
+ @see GFRmIxSetModuleConfig()
+*/
+GF_RETTYPE
+GFRmIxSetModuleFrequency( GFRmHandle RmHandle,
+ eGFModuleIDs modid,
+ NvU32 frequency );
+
+/** This function is used to retrieve clock frequency information about a module.
+
+ @param RmHandle (#GFRmHandle) Handle specific to the GFRm
+ @param modid (#eGFModuleIDs) ID of the module
+ @param type (#GFIX_MODULEFREQ_TYPE) Type of frequency
+ @param pFrequency (NvU32*) Pointer to 32-bit value in KHz to get three digit
+ MHz precision. Returns with currently frequency.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+*/
+GF_RETTYPE
+GFRmIxGetModuleFrequency( GFRmHandle RmHandle,
+ eGFModuleIDs modid,
+ GFIX_MODULEFREQ_TYPE type,
+ NvU32 *pFrequency );
+
+/** This function enables and disables power plane(s).
+
+ @param RmHandle (#GFRmHandle) Handle specific to the GFRm
+ @param ppID (NvU32) ID of power plane (More then one can be Or'ed to perform
+ operation in parallel)
+ @param operation (#GFIX_POWERPLANE_OP_TYPE) Operation to perform on the
+ power planes
+ @param states (NvU32*) Ptr to 32 bit value to store the resulting bit
+ field of a GFIX_POWERPLANE_OP_QUERY operation.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+ @retval #GF_ERROR_BAD_PARAMETER Bad parameter passed
+
+ This function enables and disables power plane(s), multiple power planes can
+ be disabled in one function call. There is two versions of this functions
+ specified with the compilation flag GF_EXTERNAL_POWERPLANE_LOGIC. If this
+ flag is set to 1 then all the power plane logic is done in the platform code,
+ if 0 then all the logic is done in Ix.
+
+ When internal power plane logic is chosen, each power plane has a reference
+ count. If the power plane is to be enabled or disabled, GFRmIxPowerPlane()
+ will call out to RmPowerPlane(), which will perform platform specific enabling.
+*/
+GF_RETTYPE
+GFRmIxPowerPlane( GFRmHandle RmHandle,
+ NvU32 ppID,
+ GFIX_POWERPLANE_OP_TYPE operation,
+ NvU32 *states );
+
+/** Enable and disables clock sources.
+
+ @param RmHandle (#GFRmHandle) Handle specific to the GFRm
+ @param clockid (NvU32) ID of the clock
+ @param state (NvU32) 0 for disable, 1 for enable
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ This function enables and disables a clock's source. A reference counter is
+ used to ensure the clock's source won't be disabled until there is a matching
+ number of enable and disable operations. If a clocks source is to be enabled
+ or disabled, GFRmIxEnableClockSource() will call out to RmEnableClockSource()
+ to do the platform specific enabling or disabling.
+*/
+GF_RETTYPE
+GFRmIxEnableClockSource( GFRmHandle RmHandle,
+ NvU32 clockid,
+ NvU32 state );
+
+/** This function sets the list of reference clocks that a PLL may choose.
+
+ @param RmHandle (#GFRmHandle) Handle specific to the GFRm
+ @param option (NvU32) GFIX_PLL1, GFIX_PLL2
+ @param clocks (NvU32) Bitfield of clocks. (1<
+
+ 0 -> audio structs can be locate anywhere, dspcore will be allocated anywhere (default)
+ 1 -> audio structs must be allocated in internal SRAM, dspcore will be allocated anywhere
+ 0xMM -> MM is a 8 bit wide bitmask: b'10XXYYZZ (i.e. 0x80 | b'XXYYZZ)
+
+ XX controls allocation of dspcore DSP image (about 100 kB)
+ YY to control allocation of GfSgl (about 90 kB, not required for encoding=ADTSINTERNAL)
+ ZZ controls allocation of GfGlobalParameters struct (about 36 kB)
+
+ bitmask meaning:
+ b'00 no special requirement
+ b'01 force internal SRAM
+ b'10 force external SRAM
+ b'11 unused
+
+ */
+
+ NvU32 AudioRecordEnable; //!< GFSDK_AUDIO_REC_ENABLE, Enable SC15 I2S Record, default : 0
+ NvU32 AudioNoI2C; //!< Disable codec I2C access in GFAudioAPI
+ char I2SCodecInit[RM_ENV_MAXLEN]; //!< Codec init addr/data sequence comma delimited zero padded 32 bit hex values "xxxxxxxx,xxxxxxxx,..." up to 128 chars
+ char I2SCodecReset[RM_ENV_MAXLEN]; //!< Codec reset addr/data sequence comma delimited zero padded 32 bit hex values "xxxxxxxx,xxxxxxxx,..." up to 128 chars
+ //!< I2S "aaaaddrr" aaaa - i2s slave address, dd - 8 bit data, rr 7 bit i2s register
+ //!< AC97 "aaaadddd" aaaa - ac97 register address, dddd - 16 bit data value
+ NvU32 I2SCodecEnableSMCLK;
+ NvU32 SCInterfaceMode;
+
+ NvU32 perfMode3D; // 3D perf mode.
+ NvU32 DxInitBypass; // This is used to tell DxSetDisplay() to initialize the
+ // software state without touching the hardware
+ NvU32 noDCPreLoadCtx;
+ NvU32 nulldriver2D;
+#if NVOS_IS_WINDOWS_CE
+ NvU32 BackupMemory;
+#endif
+ NvU32 IndirectAddrSet;
+} GFRMENVIRONMENTVARIABLES, *PGFRMENVIRONMENTVARIABLES;
+
+/* Rm Public Services for platform only. May depend on GFPlat.h */
+enum
+{
+ RM_EXTDATA_INIT_TYPE = 0
+};
+
+enum
+{
+ RM_EXTDATA_INIT_SCRIPT = 0,
+ RM_EXTDATA_RM_SCRIPT,
+ RM_EXTDATA_CAMERA_SCRIPT,
+ RM_EXTDATA_ENVVARS_SCRIPT,
+ RM_EXTDATA_DISPLAY_SCRIPT,
+ RM_EXTDATA_DISPLAY_SUB_SCRIPT,
+ RM_EXTDATA_AUTOCTRL_SCRIPT,
+ RM_EXTDATA_AVP_IMAGE_AUDIO_AVP1,
+ RM_EXTDATA_AVP_IMAGE_MP3_AVP1,
+ RM_EXTDATA_AVP_IMAGE_SBC_AVP1,
+ RM_EXTDATA_AVP_IMAGE_AAC_AVP1,
+ RM_EXTDATA_AVP_IMAGE_EAAC_AVP1,
+ RM_EXTDATA_AVP_IMAGE_AACLPSBR_AVP1,
+ RM_EXTDATA_AVP_IMAGE_AMRNB_AVP1,
+ RM_EXTDATA_AVP_IMAGE_AMRWB_AVP1,
+ RM_EXTDATA_AVP_IMAGE_WMA_AVP1,
+ RM_EXTDATA_AVP_IMAGE_AUDIO_AVP2,
+ RM_EXTDATA_AVP_IMAGE_MP3_AVP2,
+ RM_EXTDATA_AVP_IMAGE_SBC_AVP2,
+ RM_EXTDATA_AVP_IMAGE_AAC_AVP2,
+ RM_EXTDATA_AVP_IMAGE_EAAC_AVP2,
+ RM_EXTDATA_AVP_IMAGE_AACLPSBR_AVP2,
+ RM_EXTDATA_AVP_IMAGE_AMRNB_AVP2,
+ RM_EXTDATA_AVP_IMAGE_AMRWB_AVP2,
+ RM_EXTDATA_AVP_IMAGE_WMA_AVP2,
+ RM_EXTDATA_AVP_IMAGE_H264DEC_AVP1,
+ RM_EXTDATA_AVP_IMAGE_H264DEC_AVP2,
+ RM_EXTDATA_AVP_IMAGE_MP4DEC_AVP1,
+ RM_EXTDATA_AVP_IMAGE_MP4DEC_AVP2,
+ RM_EXTDATA_AVP_IMAGE_JPEGDEC_AVP1,
+ RM_EXTDATA_AVP_IMAGE_JPEGDEC_AVP2,
+ RM_EXTDATA_AVP_IMAGE_H264ENC_AVP1,
+ RM_EXTDATA_AVP_IMAGE_H264ENC_AVP2,
+ RM_EXTDATA_AVP_IMAGE_VC1DEC_AVP1,
+ RM_EXTDATA_AVP_IMAGE_VC1DEC_AVP2,
+ RM_EXTDATA_AVP_IMAGE_RV9DEC_AVP1,
+ RM_EXTDATA_AVP_IMAGE_RV9DEC_AVP2,
+ RM_EXTDATA_AVP_IMAGE_ISP3A_AE_AF_AVP1,
+ RM_EXTDATA_AVP_IMAGE_ISP3A_AWB_AVP1,
+ RM_EXTDATA_AVP_IMAGE_ISP3A_DVS_AVP1,
+ RM_EXTDATA_AVP_IMAGE_BEATNIK_AVP1,
+ RM_EXTDATA_AVP_IMAGE_BEATNIK_AVP2,
+ RM_EXTDATA_AVP_IMAGE_KERNEL_AVP1,
+ RM_EXTDATA_AVP_IMAGE_KERNEL_AVP2,
+ RM_EXTDATA_AVP_IMAGE_DSP_UNITTESTS,
+ RM_EXTDATA_AVP_IMAGE_TSDEM_AVP1, //!< SC15 version of GFMxDemTS DSP image
+ RM_EXTDATA_AVP_IMAGE_TSDEM_AVP2, //!< SC14 version of GFMxDemTS DSP image
+ RM_EXTDATA_AVP_IMAGE_ISP_AVP1
+};
+
+enum
+{
+ RM_EXTDATA_FILE = 0,
+ RM_EXTDATA_FILE_WITH_SUBID,
+};
+
+#define DEFAULTSCRIPTNAME "default"
+
+#define RM_EXTDATA_READ 1 // Read in data
+#define RM_EXTDATA_USEBUFFER 4 // RmAccessExternalData shouldn't handle
+ // allocation of buffer, the data is to
+ // be placed at the orginal buffer address
+#define RM_EXTDATA_SIZE 8 // Query the size of the data
+#define RM_EXTDATA_FILENAME 0x10 // return script file name
+#define RM_EXTDATA_NAME 0x20 // return name of script without prefix and sub ID
+#define RM_EXTDATA_IDLIST 0x40 // return array of script sub ID
+
+/* Fields in struct PGFRMEXTDATASTRUCT
+ * dataType : Type of the data
+ * dataID : ID of the data
+ * subID : Sub ID of script
+ * buffer : Pointer to pointer of the data address
+ * size : Address to store the resulting size. During a read operation if size
+ * is non-zero the amount of bytes read in will be stored there. If size
+ * or the value pointed to by size is zero all the data represented by
+ * dataID will be read in.
+ * option : flag that will change what is returned in buffer and size.
+ */
+typedef struct _GFRMEXTDATASTRUCT
+{
+ NvU32 dataType; // type of data
+ NvU32 dataID; // ID of data
+ NvU32 subID; // sub ID of data
+ void ** buffer;
+ NvU32 * size;
+ NvU32 option;
+} GFRMEXTDATASTRUCT, *PGFRMEXTDATASTRUCT;
+
+
+ /** This function is called to get value from curent environment.
+
+ @param envName environment name in env table
+ @param envType environment type
+ RM_ENV_DECIMAL // String should be parsed as a decimal
+ RM_ENV_HEX // String should be parsed as a hexadecimal
+ RM_ENV_CHAR // String should be parsed as a character
+ RM_ENV_STRING // String used as-is.
+ @param parsedval converted value. Only available while environment type is RM_ENV_DECIMAL or RM_ENV_HEX
+ @return a pointer to the environment table entry containing varname.
+ */
+// char * ReadEnvVars( const char *envName, int envType, NvU32 *parsedval);
+GF_RETTYPE nvGetConfigUint32(const char *name, NvU32 *value);
+
+GF_RETTYPE nvGetConfigString( const char *envName, char **value);
+
+/** Retrieves the Process id of the current process.
+
+ @param RmGetProcessID Pointer to NvU32 for returning the prcess id,
+
+ @return GF_SUCCESS If the platforms support some sort of get process id API
+ @return GF_ERROR. if not support
+*/
+GF_RETTYPE RmGetProcessID( NvU32 *RmProcessID );
+
+/* Thread, Mutex, Event and Semaphore opaque handles */
+typedef struct GFMutex_t *GFMutex;
+typedef struct GFSemaphore_t *GFSemaphore;
+typedef struct GFEvent_t *GFEvent;
+typedef struct GFThread_t *GFThread;
+
+/* Rm platform functions for OS abstraction */
+
+/** Create Mutex object.
+
+ @param id - Mutex identiifer. Used to cretate named objects. If the
+ id is 0, un named object is created.
+
+ @return Handle to the event object, or 0 on failure.
+*/
+GFMutex RmCreateMutex( NvU32 id );
+
+/** Lock mutex object, blocks until mutex can be taken. Must always succeed if
+ given a valid mutex handle.
+
+ @param mutex Mutex handle
+*/
+void RmLockMutex(GFMutex mutex);
+
+/** Unlock mutex object. Must always succeed if given a valid mutex handle.
+
+ @param mutex Mutex handle
+*/
+void RmUnlockMutex(GFMutex mutex);
+
+/** Destroy mutex object. Must always succeed if given a valid mutex handle.
+ Must not crash (should do nothing) if given a NULL handle.
+
+ @param mutex Mutex handle.
+*/
+void RmDestroyMutex(GFMutex mutex );
+
+/** Create semaphore object.
+
+ @param id - Semaphore identifer. Used to create named objects. If the
+ id is 0, unnamed object is created.
+
+ @param InitCount (NvU32) Initial count of semaphore. This value must be
+ greater than zero.
+ @param MaxCount (NvU32) Maximum count of semaphore. This value must be
+ greater than zero.
+
+ @return Handle to semaphore object, or 0 on failure
+*/
+GFSemaphore RmCreateSemaphore(NvU32 id, NvU32 InitCount, NvU32 MaxCount);
+
+/** Destroy semaphore object. Must always succeed if given a valid semaphore
+ handle. Must not crash (should do nothing) if given a NULL handle.
+
+ @param sem Semaphore handle
+*/
+void RmDestroySemaphore(GFSemaphore sem);
+
+/** Signal semaphore object. This function increments the semaphore's counter.
+ Must always succeed if given a valid semaphore handle.
+
+ @param sem Semaphore handle
+*/
+void RmSignalSemaphore(GFSemaphore sem);
+
+/** Wait on semaphore.
+ Function blocks while semaphore's count is 0. Once the count is non-zero,
+ the count is decremented by one and function returns. If timeout is passed
+ as 0, the function does not block.
+
+ @param sem Semaphore handle
+ @param timeout Timeout in miliseconds, 0 for non-blocking, (NvU32)-1 for infinite wait.
+ @retutn GF_SUCCESS indicates that the semaphore was taken successfully, GF_WAIT_TIME_OUT
+ indicates timeout, any other return value indicates error.
+*/
+GF_RETTYPE RmWaitOnSemaphore(GFSemaphore sem, NvU32 timeout);
+
+
+/** Create event object.
+
+ @return Handle to event object, or NULL on failure
+*/
+GFEvent RmCreateEvent(void);
+
+/** Sets the event object to the signaled state. Must always succeed if given
+ a valid event handle.
+
+ @param event Event handle
+*/
+void RmSetEvent( GFEvent event );
+
+/** Resets the event object to the nonsignaled state. Must always succeed if
+ given a valid event handle.
+
+ @param event Event handle
+*/
+void RmResetEvent( GFEvent event );
+
+/** Function blocks until the event is signaled.
+
+ @param event Event handle.
+ @param msec Milli seconds to wait.
+
+ @retval GF_WAIT_GET_OBJECT Event was signaled, and the event object was acquired.
+ @retval GF_WAIT_TIME_OUT Timeout before event was signaled
+ @retval GF_WAIT_ERROR An error occured.
+*/
+GF_RETTYPE RmWaitForEvent(GFEvent event, NvU32 msec );
+
+
+/** Destroys the event object. Must always succeed if given a valid event
+ handle. Must not crash (should do nothing) if given a NULL handle.
+
+ @param event Event Handle. This is the handler returned by
+ the call to RmCreateEvent function.
+*/
+void RmDestroyEvent( GFEvent event );
+
+/** Creates a thread to execute within the calling process.
+
+ @param func (NvU32 (*)(void *)) Pointer to a function to be executed
+ by the thread.
+ @param data (void *) Pointer to variable to be passed to the thread
+
+ @return Handle to thread on success, otherwise 0 is returned.
+*/
+GFThread RmCreateThread(NvU32 (*StartFunction)(void *), void *data);
+
+/** Blocks until the specified thread terminates, then frees system resources
+ associated with the thread. Must always succeed if given a valid thread
+ handle. Must not crash (should do nothing) if given a NULL handle.
+
+ @param ThreadHandle Thread handle retruned by RmCreateThread call
+*/
+void RmJoinThread(GFThread ThreadHandle);
+
+/** Yield execution to other threads. This will be called inside spin loops
+ that are waiting for the hardware to finish something.
+*/
+void RmYield(void);
+
+/** Get full path of extended script data. Assume the script data is at same directory as bootload module.
+ @param modulename (char *)Bootloader module name. If the script data is not at same directory as module, could be NULL.
+ @param fullpath (char *)Pointer to extened script data path.
+
+ @return GF_SUCCESS to signal success, or error code to signal failure
+*/
+GF_RETTYPE
+ RmGetExtDataPath(char *modulename, char *fullpath );
+
+/* File and File Search opaque handles */
+typedef struct GFFile_t *GFFile;
+typedef struct GFFileSearch_t *GFFileSearch;
+
+/** Searches a directory for a file whose name matches the specified file name.
+ It examines subdirectory names as well as file names
+ @param filePath (char *) Pointer to a null-terminated string that specifies a valid directory or path and file name,
+ which can contain wildcard characters (* and ?)
+ @param filename (char *) pointer to the full path file/dir which match this search.
+
+ @return If the function succeeds, the return value is a search handle used in a subsequent call to RmFindNextFile or RmFindClose,
+ NULL if the function failed.
+*/
+GFFileSearch RmFindFirstFile(const char *filePath, char *fileName);
+
+/** Continues a file search from a previous call to the RmFindFirstFile function.
+ @param hFind (GFFileSearch ) Search handle returned by a previous call to the RmFindFirstFile function.
+ @param filename (char *) pointer to the filename with full path which match this search.
+ @return GF_SUCCESS to signal success, or error code to signal failure
+*/
+GF_RETTYPE RmFindNextFile(GFFileSearch hFind, char *fileName);
+
+/** Closes the specified search handle. Must always succeed if given a valid
+ search handle. Must not crash (should do nothing) if given a NULL handle.
+
+ @param hFind (GFFileSearch) Search handle returned by a previous call to the RmFindFirstFile function.
+*/
+void RmFindClose(GFFileSearch hFind);
+
+/** Open file.
+ @param filename (const char *) Filename
+ @param fileSpec (const char *) Type of access permitted
+ @return Handle to the open file. A NULL pointer value indicates an error.
+*/
+GFFile RmFileOpen(const char *fileName, const char *fileSpec);
+
+/** Close file. Must always succeed if given a valid file handle. Must not
+ crash (should do nothing) if given a NULL handle.
+
+ @param fp Handle that RmFileOpen() returned
+*/
+void RmFileClose(GFFile fp);
+
+/** Read data from file.
+ @param buffer (void *) Storage location for data
+ @param lSize (NvU32) Item size in bytes
+ @param lCount(NvU32) Maximum number of items to be read
+ @param fp (GFFile) Pointer that RmFileOpen() returned
+ @return Number of full items actually read, 0 if nothing is read out.
+*/
+GF_RETTYPE RmFileRead(void *buffer, NvU32 lSize, NvU32 lCount, GFFile fp);
+
+/** Get file size.
+ @param fp(GFFile ) Pointer that RmFileOpen() returned
+ @return Current file size in bytes.
+*/
+GF_RETTYPE RmFileSize(GFFile fp);
+
+/** Platform abstraction for millisecond sleep.
+
+ @param msec Milliseconds to sleep.
+ */
+void RmWaitMSec(NvU32 msec);
+
+/** Waits for a keypress with a timeout, and returns the key.
+
+ @param timeOutMSec Milliseconds to wait for the keypress.
+ @retval The code for the key, or zero if we timed out.
+ */
+int RmWaitKey(NvU32 timeOutMSec);
+
+/** Get the current OS tick counter.
+ @return Low 32 bits of millisecond counter.
+*/
+NvU32 RmGetTickCountMSec(void);
+
+/** Get the current OS tick counter.
+
+ NOTE: This function is NOT guaranteed to exist on all
+ platforms. Drivers should NOT call this function; it's
+ meant only for benchmarking.
+
+ @return (NvU64) 64 bit microsecond counter.
+ */
+NvU64 RmGetTickCountUSec(void);
+
+/** SetupPlatform - It is called by RmSetupPlatform to setup any platform specific stuff.
+
+ @param pOutput (PGFRMSETUPPLATFORM) output structure. Used to pass variables to high layer function RmSetupPlatform
+ @param penv (PGFRMENVIRONMENTVARIABLES) pass Environment Variable Configuration structure
+
+ @return GF_SUCCESS to signal success, or error code to signal failure
+
+*/
+GF_RETTYPE SetupPlatform( PGFRMSETUPPLATFORM pOutput, PGFRMENVIRONMENTVARIABLES penv );
+
+/** Called by RmExitPlatform to exit and clean-up any platform specific stuff, if any
+
+ @param pUserObject0 (void *) Pointer to user specified object 0 from high layer function RmExitPlatform
+
+ @return GF_SUCCESS to signal success, or error code to signal failure
+*/
+GF_RETTYPE ExitPlatform( void *pUserObject0);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __GFRMOEM_H__ */
diff --git a/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFRmRDMA.h b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFRmRDMA.h
new file mode 100755
index 00000000..151ec65d
--- /dev/null
+++ b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFRmRDMA.h
@@ -0,0 +1,411 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/** @File: GFRmRDMA.h
+ GFSDK Read DMA memmory manager.
+
+ */
+
+#ifndef __GFRMRDMA_H__
+#define __GFRMRDMA_H__
+
+#include "GF.h"
+
+/** @addtogroup groupRDMA RDMA ReadDMA API
+
+ @ref pageRDMAAppNotes
+
+*/
+
+/*@{*/
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+
+
+/** eGFRmRDMAClientID: Enumeration of client id's. SC15 has 4
+ RDMA (Read DMA) FIFO's. Modules specified below can be
+ attached to the RDMA FIFO's. See @
+ */
+typedef enum
+{
+ RDMA_CLID_CPU = 0,
+ RDMA_CLID_DSP,
+ RDMA_CLID_I2S,
+ RDMA_CLID_SD,
+ RDMA_CLID_MPEGE,
+ RDMA_CLID_JPEGE,
+ RDMA_CLID_EPP,
+ RDMA_CLID_VI,
+ RDMA_CLIDS
+} eGFRmRDMAClientID;
+
+/** RDMA buffer header.
+
+ For non-rectangular (or linear) reads
+ RDMA expects a header in the memory. The header formart is as specified
+ below. GFRmRDMAReadHeader function returns the header in this format.
+
+ @See GFRmRDMAReadHeader()
+ */
+
+typedef struct _RDMA_BUF_HEADER
+{
+ NvU32 bufferSize;
+ NvU32 raiseVector;
+ NvU32 channel;
+ NvU8 raiseEnable;
+ NvU8 frameStart;
+ NvU8 frameEnd;
+ NvU8 largeHdr;
+ NvU32 extHeader;
+
+} RDMA_BUFFER_HEADER, *pRDMA_BUFFER_HEADER;
+
+
+/* RDMA flags */
+
+/** RDMA_NONRECT::flags and RDMA_RECT::flags flagbit:
+ No byte swap.
+*/
+#define GF_RDMA_FLAGS_SWAP_NONE 0x00000000
+
+/** RDMA_NONRECT::flags and RDMA_RECT::flags flagbit:
+ Swap bytes in a word. example: 0xaabbccdd to 0xbbaaddcc.
+*/
+#define GF_RDMA_FLAGS_SWAP_BYTE_IN_WORD 0x00000001
+
+/** RDMA_NONRECT::flags and RDMA_RECT::flags flagbit:
+ Swap bytes in dword: 0xaabbccdd to 0xddccbbaa.
+*/
+#define GF_RDMA_FLAGS_SWAP_BYTE_IN_DWORD 0x00000002
+
+/** RDMA_NONRECT::flags and RDMA_RECT::flags flagbit:
+ Swap word in dword example: 0xaabbccdd to 0xccddaabb.
+*/
+#define GF_RDMA_FLAGS_SWAP_WORD_IN_DWORD 0x00000003
+
+/** RDMA_NONRECT::flags and RDMA_RECT::flags bitmask:
+ mask out byte swap options GF_RDMA_FLAGS_SWAP_*.
+*/
+#define GF_RDMA_FLAGS_SWAP_MASK 0x00000003
+
+/** RDMA_NONRECT::flags and RDMA_RECT::flags flagbit:
+ Tells the RDMA engine to output header. Will output a header into the data stream,
+ which has to be read with GFRmRDMAReadHeader() before calling GFRmRDMARead().
+ This flag is relevant only in non-rectangular reads.
+ */
+#define GF_RDMA_FLAGS_STR_HEADER 0x00010000
+
+/** RDMA_RECT
+ Setup information for the RDMA.
+ */
+typedef struct _RDMA_RECT
+{
+ /** physical addess of the buffer in the SC15 Memory view. 32-bit alignment
+ * required. */
+ NvU32 baseOffset;
+
+ /** client id. See @eGFRmRDMAClientID */
+ eGFRmRDMAClientID clid;
+
+ /** buffers/stride/width/lines of the rectangular buffer.
+
+ Need to comply with the following constraints provided
+ by the hardware
+ - if width is not a multiple of 4 bytes (one word):
+ - stride equals width, stride should be the exact stride in bytes (eg. line_stride[1:0] not equal to 0)
+ - if stride is bigger than width, stride should be rounded down to the nearest word
+ (eg. line_stride[1:0] should be zero)
+
+ For example: width = 42 bytes, stride = 82 -> stride should be programmed to 80
+ width = 42 bytes, stride = 42 -> stride should be programmed to 42
+ */
+ NvU32 buffers;
+ NvU32 stride;
+ NvU32 width;
+ NvU32 lines;
+
+ /* use the RDMA flags defined above as GF_RDMS_FLAGS_* */
+ NvU32 flags; //!< Flagbits, see GF_RDMA_FLAGS_*
+
+ /* Timeout in msec. If <=0, then no timeout */
+ NvU32 timeout;
+
+} RDMA_RECT, *pRDMA_RECT;
+
+/** RDMA_NONRECT
+
+ Setup structure for non-rectangular reads.
+
+ */
+typedef struct _RDMA_NONRECT
+{
+ /** Physical addess of the buffer in the GPU address space. Needs to be
+ * 32-bit aligned. */
+ NvU32 baseOffset;
+
+ /** client id. See @eGFRmRDMAClientID */
+ eGFRmRDMAClientID clid;
+
+ NvU32 buffers;
+ NvU32 stride;
+
+ /* use the RDMA flags defined above as GF_RDMS_FLAGS_* */
+ NvU32 flags; //!< Flagbits, see GF_RDMA_FLAGS_*
+
+ /* Timeout in msec. If =0, then no timeout */
+ NvU32 timeout;
+
+} RDMA_NONRECT, *pRDMA_NONRECT;
+
+
+/** There are four read dma channels, the RM manages the allocation/
+ freeing of these channels. This function allocates a channel.
+
+ @param RmHandle Handle to the Rm allocated via call to GFRmOpen.
+ @param DmaHandle Pointer to an allocated handle.
+
+ @retval GF_SUCCESS if a RDMA channel is available, and returns
+ RDMA handle on allocation.
+
+ The release function will return GF_ERROR
+ if the read dma is already released.
+ */
+
+GF_RETTYPE
+GFRmRDMAAlloc(GFRmHandle RmHandle, GFRmRdmaHandle *DmaHandle);
+
+/** There are four read dma channels, the RM manages the allocation/
+ freeing of these channels. This function frees an allocated
+ channel.
+
+ @param hRm Handle to the Rm allocated via call to GFRmOpen.
+ @param phDma Pointer to the DMA handle to be released.
+ */
+void
+GFRmRDMARelease(GFRmHandle hRm, GFRmRdmaHandle *phDma);
+
+/** Setup non-rectangular RDMA.
+
+ When the flag GF_RDMA_FLAGS_STR_HEADER is set, buffer header is written to the
+ memory by the RDMA client. So, when the cpu reads the data, buffer
+ header comes first and then the data. Buffer header has the information
+ of buffer, like its size etc.
+
+
+ So, an example sequence would be
+ - Call setup with GF_RDMA_FLAGS_STR_HEADER flag set.
+ - Read header with the GFRmRDMAReadHeader(...)
+ - Read buffer size of data with GFRmRDMARead() funtion.
+ Buffer size is in the buffer header.
+
+ If this flag is not set, then the there is no buffer header.
+ In this case it is assumed that the the size of the buffer is prefixed
+ and known to the module API writers.
+
+ So, an example sequence would be
+ - Call setup GF_RDMA_FLAGS_STR_HEADER flag not set.
+ - Read buffer size of data with GFRmRDMARead() funtion.
+ Buffer size is known to the callers.
+
+ baseOffset of pReq structure needs to be 32-bit aligned.
+
+ @param DmaHandle Handle returned by @GFRmRDMAAlloc function.
+ @param pReq Populated RDMA req structure. See @RDMA_NONRECT
+*/
+
+GF_RETTYPE
+GFRmRDMASetupNONRect(GFRmRdmaHandle DmaHandle, pRDMA_NONRECT pReq);
+
+/** Setup RDMA for rectangular read.
+
+ Requirement:
+ baseOffset of pReq structure needs to be 32-bit aligned.
+
+ @param DmaHandle Handle returned by @GFRmRDMAAlloc function.
+ @param pReq Populated RDMA req structure. See @RDMA_RECT
+*/
+GF_RETTYPE
+GFRmRDMASetupRect(GFRmRdmaHandle DmaHandle, pRDMA_RECT pReq);
+
+/** Reads the RDMA FIFO status register and returns the
+ available number of FIFO slots. A slot is 32-bit.
+
+ @param DmaHandle Handle returned by @GFRmRDMAAlloc function.
+ */
+NvU32 GFRmRDMAFIFOAvailIn32Bits(GFRmRdmaHandle DmaHandle);
+
+/** Reads memory from SC15 internal/external
+ memory to the system memory pointed by the dstAddr. Need
+ to pass the same rectangular attributes passed, when the
+ RDMA is setup.
+
+ @param DmaHandle Handle returned by @GFRmRDMAAlloc function.
+ @param dstAddr aligned or non-aligned dest pointer. Aligned
+ pointer results in faster reads.
+ @param width Width in bytes to read.
+ @param height Height of the rectangular region.
+
+ @retval Returns GF_SUCCESS or GF_ERROR.
+ */
+
+GF_RETTYPE
+GFRmRDMARectRead(GFRmRdmaHandle DmaHandle, void *dstAddr, NvU32 width, NvU32 height);
+
+
+/** Reads memory from SC15 internal/external
+ memory to the system memory pointed by the dstAddr.
+
+ @param DmaHandle Handle returned by @GFRmRDMAAlloc function.
+ @param dstAddr aligned or non-aligned dest pointer. Aligned
+ pointer results in faster reads.
+ @param sizeInBytes Number of bytes to read.
+
+ @retval Returns GF_SUCCESS or GF_ERROR.
+ */
+
+GF_RETTYPE
+GFRmRDMARead(GFRmRdmaHandle DmaHandle, void *dstAddr, NvU32 sizeInBytes);
+
+/** Reads buffer header. Once this info is read
+ API's will know how much data to read or expect.
+
+ @param DmaHandle Handle returned by @GFRmRDMAAlloc function.
+ @param header Pointer to RDMA header structure. See @RDMA_BUFFER_HEADER
+ */
+GF_RETTYPE
+GFRmRDMAReadHeader(GFRmRdmaHandle DmaHandle, pRDMA_BUFFER_HEADER header);
+
+
+/** Cleanup the RDMA FIFO, by reading out any extra DOWRDS
+ GFRmRDMARead might not have read.
+
+ In general this function need not be used.
+ */
+
+GF_RETTYPE
+GFRmRDMACleanup(GFRmRdmaHandle DmaHandle);
+
+
+/** Gets the actual RDMA channel number from the DMA handle. This is
+ usefull for DSP development. Host code allocates the DMAHandle
+ gets the DMA number from that and creates the DMA handle on the
+ DSP side using GFXRmRDMAAlloc function. GFXRmRDMAAlloc needs to
+ know what DMA channel to use.
+
+ @param DmaHandle RDMA handle.
+ @param dmaNumber RDMA channel number used the handle.
+
+*/
+
+void
+GFRmRDMAGetPortNumber(GFRmRdmaHandle DmaHandle, NvU32 *portNumber);
+
+#if NVCPU_IS_XTENSA
+
+// In XRM, it is expected that the dma handle is allocated on
+// the Host side, and just the dma number is passed into code
+// running on the Xtensa. These functions will setup a
+// DMA handle that can used in the XRM.
+
+
+GF_RETTYPE
+GFXRmRDMAAlloc(NvU32 dmaNumber, GFRmRdmaHandle *DmaHandle);
+
+
+GF_RETTYPE
+GFXRmRDMARelease(GFRmRdmaHandle *DmaHandle);
+
+#endif // NVCPU_IS_XTENSA
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+
+/*@}*/
+
+/** @page pageRDMAAppNotes RDMA Application Notes
+
+ General information about RDMA - RDMA is read DMA hw block. Unlike
+ traditional DMA, sw reads the data from the FIFO to system memory. This is
+ becasuse SC15 cannot bus master and write directly to the system memory.
+ RDMA will be faster becasue the data is buffered by the HOST1x Block and sw
+ reads back data in a tight loop.
+
+ SC15 RDMA supports 2 modes - Linear(AKA NON-Rect) and Rect mode.
+ In both modes the sequence of programming same - setup and then read the data.
+
+ RDMA setup is 2 step process.
+ - RDMA need to know which client will trigger the RDMA. It also need to other
+ parameters like which varies for linear and RECT modes.
+ In rect reads software has to setup the stride/width/number of lines.
+ This information is needed to describe a buffer. In case of non-rect
+ read a buffer header is expected, which describes the buffer. In both
+ cases one need to specify the number of buffers.
+
+ - Client module also need to be setup, as it notifies the RDMA hw block when
+ the data is ready. This step is not needed for CPU triggered case, as the
+ data is already available in the memory.
+
+ Sample program sequence:
+
+ Setup RDMA
+ Setup Client side register (example - vi, SD etc...). Not needed when
+ setup for CLID CPU.
+
+ wait till the data is available ()
+ {
+ Read the data(..)
+ }
+
+ Amount of data to read is either known a-priori (RECT mode) or read from
+ the header (linear mode).
+
+
+ As described ealier RDMA supports 2 modes
+
+ Linear RDMA - RDMA expects a header in the memory right before the data, when
+ it is triggered. That header describes the length and the attributes of the
+ buffer.
+
+ Depending on how the RDMA is setup, buffer header will be/will not be
+ (i.e RDMA_BUFFER_HEADER struct) readout. see #GF_RDMA_FLAGS_STR_HEADER
+
+ When the header is returned the usage looks like
+
+ RDMA_BUFFER_HEADER header;
+ GFRmRDMAReadHeader(...,&header);
+ While (header->bufferSize)
+ {
+ ...
+ GFRmReadRDMA(...)
+ }
+
+ In this mode, it is important is to note that RDMA expect the buffer header
+ in the memory. So, this is not good for CPU triggerd case, as in that case
+ CPU should somehow write the buffer header to read the data already present
+ in the embedded memory.
+
+ Rect RDMA - In this mode, there is no concept of buffer header. Exact size
+ should be programmed in the RDMA registers when the Setup is done. So, sw
+ should know how much data to pull out. Requests for data more than available
+ will result in timeout errors.
+
+ A guideline: if an engine already generated the buffer for you, then use
+ non-rectangular read. Otherwise, use rect read.
+
+*/
+
+#endif /* __GFRMRDMA_H__ */
diff --git a/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFRmScr.h b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFRmScr.h
new file mode 100755
index 00000000..1678ba09
--- /dev/null
+++ b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFRmScr.h
@@ -0,0 +1,59 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+#if !defined (__GFRMSCR_INC__)
+#define __GFRMSCR_INC__
+
+/* Surface ColorFormat - Follow GFBITMAP type (GF_BITMAP_xxx) */
+
+#define GF_SURFACE_YUV420 1
+#define GF_SURFACE_YUV422 2
+#define GF_SURFACE_YUV444 4
+#define GF_SURFACE_ROTATED_YUV422 8
+
+#define GF_SURFACE_YUYV (GF_SURFACE_YUV422|0x00000004)
+#define GF_SURFACE_YVYU (GF_SURFACE_YUV422|0x00000008)
+#define GF_SURFACE_UYVY (GF_SURFACE_YUV422|0x00000010)
+#define GF_SURFACE_VYUY (GF_SURFACE_YUV422|0x00000020)
+#define GF_SURFACE_MPEGDEC (GF_SURFACE_YUV420|0x00000040)
+
+
+/** Image is for encoding purpose. Must combine with particular YUV format. */
+#define GF_SURFACE_MPEGENC 0x00000080
+#define GF_SURFACE_JPEGDEC (GF_SURFACE_YUV420|0x00000100)
+
+/** Image is for encoding purpose. Must combine with particular YUV format. */
+#define GF_SURFACE_JPEGENC 0x00000200
+#define GF_SURFACE_PLANAR_YUV422 0x400
+#define GF_SURFACE_RGB565 0x00010000
+
+/** Used for 18 bpp (MSB bits) (18bpp MSB bits) case. */
+#define GF_SURFACE_RGB888 0x00020000
+#define GF_SURFACE_ARGB8888 0x00030000
+#define GF_SURFACE_ARGB1555 0x00040000
+#define GF_SURFACE_ARGB4444 0x00050000
+
+/** Used for 18 bpp (LSB bits). */
+#define GF_SURFACE_RGB666 0x00060000
+
+/** 8bpp surface. */
+#define GF_SURFACE_RGB8 0x00070000
+#define GF_SURFACE_RGB_MASK 0x000F0000
+
+/** Bayer 8bit ColorFormat. */
+#define GF_SURFACE_BAYER8 0x00100000
+
+/** Bayer 16bit ColorFormat. */
+#define GF_SURFACE_BAYER16 0x00200000
+#define GF_SURFACE_ABGR8888 0x00400000
+
+/** YUV422 rotated averaging. */
+#define GF_SURFACE_PLANAR_YUV422RA 0x00800000
+
+#endif
diff --git a/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFTrace.h b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFTrace.h
new file mode 100755
index 00000000..4d50b3bd
--- /dev/null
+++ b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFTrace.h
@@ -0,0 +1,304 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/* GFTrace.h: Tracing utility for GFSDK libraries.
+ *
+ * Features a suite of conditionally compilied tracing macros:
+ *
+ * GF_TRACE( a ): for "don't care" tracing - will be mapped
+ * to the DEBUG priority.
+ *
+ * And several others, each with a different priority.
+ *
+ * GF_TRACE_CRITICAL( a )
+ * GF_TRACE_WARNING( a )
+ * GF_TRACE_NORMAL( a )
+ * GF_TRACE_VERBOSE( a )
+ * GF_TRACE_DEBUG( a )
+ *
+ * The trace macro parameter is treated as a printf style argument
+ * list, so it should be wrapped in double-parenthesis, such as:
+ *
+ * GF_TRACE(("Register value is: %x", reg));
+ *
+ * Tracing is either handled via priorities (normal tracing).
+ * Tracing supports logging to a file (defaulting to "gfsdk.log")
+ */
+
+#ifndef GF_RMTRACE_H
+#define GF_RMTRACE_H
+
+/* Required for compilation:
+ *
+ * GF_TRACE_COMPONENTID [id]
+ * 'id' is a number 0 to GF_TRACE_COMPONENT_MAX. Tracing priorities
+ * and thresholds are set via the component id.
+ *
+ * Example usage of this header file:
+ *
+ * #define GF_TRACE_COMPONENTID GF_GXAPI
+ * #define GF_TRACE_ENABLE 1
+ * #include "GFTrace.h"
+ *
+ * void
+ * foo( NvU32 x )
+ * {
+ * GF_TRACE_DEBUG(("foo called with: %x", x ));
+ * }
+ *
+ */
+
+#ifndef GF_TRACE_COMPONENTID
+#error "GF_TRACE_COMPONENTID must be defined."
+#endif
+
+#include
+#include "GFRm.h"
+
+/* see GFRm.h for available component ids */
+
+/* Compiliation options:
+ *
+ * GF_TRACE_ENABLE [0|1]
+ * If zero, will remove tracing for that file.
+ *
+ * GF_TRACE_GLOBAL_DISABLE
+ * If this is defined and set to 1 - tracing is force globally disabled.
+ * If not defined will be controlled by the GF_TRACE_ENABLE macro.
+ *
+ * GF_TRACE_GLOBAL_ENABLE
+ * If this is defined and set to 1 - tracing is force globally enabled.
+ * If not defined will be controlled by the GF_TRACE_ENABLE macro and
+ * GF_TRACE_GLOBAL_DISABLE macros.
+ *
+ * So, the precedence is GF_TRACE_GLOBAL_ENABLE > GF_TRACE_GLOBAL_DISABLE >
+ * GF_TRACE_ENABLE
+ *
+ * GF_TRACE_COMPONENTID_MAX [max]
+ * The maximum number of component ids that may exist for tracing.
+ *
+ * GF_TRACE_MESSAGESIZE_MAX [max]
+ * The maximum length of a tracing message, in bytes.
+ *
+ * GF_TRACE_DECORATE [0|1]
+ * Automatically add a newline, componentname and process ID to
+ * the output.
+ */
+
+/* default for component id max */
+#ifndef GF_TRACE_COMPONENTID_MAX
+#define GF_TRACE_COMPONENTID_MAX 32
+#endif
+
+/* default for message size max */
+#ifndef GF_TRACE_MESSAGESIZE_MAX
+#define GF_TRACE_MESSAGESIZE_MAX 256
+#endif
+
+/* default for decoration is 1 */
+#ifndef GF_TRACE_DECORATE
+#define GF_TRACE_DECORATE 1
+#endif
+
+#if defined(NV_MODS)
+
+/* By default enable everything for MODS */
+#undef GF_TRACE_ENABLE
+#define GF_TRACE_ENABLE 1
+
+#ifndef INCLUDED_GFMODS_H
+#include "GFMods.h"
+#endif
+
+#endif /* NV_MODS */
+
+#if defined(GF_TRACE_GLOBAL_ENABLE) && defined(GF_TRACE_GLOBAL_DISABLE)
+#error "Both GF_TRACE_GLOBAL_DISABLE and GF_TRACE_GLOBAL_ENABLE cannot be defined"
+#endif
+
+/* global overrides */
+#ifdef GF_TRACE_GLOBAL_ENABLE
+ #undef GF_TRACE_ENABLE
+ #define GF_TRACE_ENABLE 1
+#endif
+
+#ifdef GF_TRACE_GLOBAL_DISABLE
+ #undef GF_TRACE_ENABLE
+ #define GF_TRACE_ENABLE 0
+#endif
+
+/* Several priorities from which to choose. Use the
+ * GFRmTrace*Threshold functions to limit tracing output.
+ * By deafult, all messages will be traced in a Debug build,
+ * only Warning, and Critical in a Release build.
+ *
+ * The priority numbers should exactly match the printing
+ * priorities in MODS.
+ */
+#define GF_TRACE_PRI_CRITICAL 5
+#define GF_TRACE_PRI_WARNING 4
+#define GF_TRACE_PRI_NORMAL 3
+#define GF_TRACE_PRI_VERBOSE 2
+#define GF_TRACE_PRI_DEBUG 1
+
+/* Returns the current tracing threshold.
+ */
+NvU32
+GFRmTraceGetThreshold( NvU32 componentId );
+
+/* Sets the current tracing threshold. All messages with an equal-to or
+ * greater-than priority will be traced.
+ */
+void
+GFRmTraceSetThreshold( NvU32 componentId, NvU32 thresh );
+
+/* Gets the current tracing priority.
+ */
+NvU32
+GFRmTraceGetPriority( NvU32 componentId );
+
+/* Sets the current tracing priority for the given component.
+ */
+void
+GFRmTraceSetPriority( NvU32 componentId, NvU32 pri );
+
+/* Trace a message. Takes variable arguments that exactly match those
+ * of the libc printf family. Messages may or may not be controlled
+ * via a priority mechanism.
+ */
+void
+GFRmTrace( NvU32 componentId, NvU32 priority, const char *msg, va_list args );
+
+/* Tracing may be controlled via run-time as well as compile-time.
+ * The run-time options that are available (to be passed into
+ * GFRmTraceConfigure as the option flag) are:
+ *
+ * GF_TRACE_OPT_OUTPUT [ioname]
+ * The output device of normal tracing. Defaults to stdout.
+ * 'value' is a char *, max len is 256. Should be null-terminated.
+ * May be "default" or a filename.
+ *
+ * GF_TRACE_OPT_COMPONENT_ENABLE [id] [0|1]
+ * Component that have compiled in tracing can be turned off or
+ * back on. The configure value is a pointer to an array of two
+ * integers, the first is id, the second is the enable/disable.
+ *
+ * GF_TRACE_OPT_DECORATE [id] [0|1]
+ * Automatically add a newline and component id to the output.
+ * 1 for on, 0 for off. 'id' is the component id.
+ */
+#define GF_TRACE_OPT_OUTPUT 0
+#define GF_TRACE_OPT_COMPONENT_ENABLE 1
+#define GF_TRACE_OPT_DECORATE 2
+
+/* Open the trace file. Called by GFRmOpen */
+GF_RETTYPE GFRmTraceOpen(void);
+
+/* Closes the trace file. Called by GFRmClose */
+void GFRmTraceClose(void);
+
+/* Run-time configuration for tracing. See the GF_TRACE_OPT
+ * flags for 'value' documentation. All configuration settings
+ * assigned via GFRmTraceConfigure() are global across all component
+ * ids, and should be synchronized if accessed by multiple threads.
+ *
+ * Returns 0 on failure, 1 otherwise.
+ */
+NvU32
+GFRmTraceConfigure( int option, void *value );
+
+/* Returns a nice name for the component id.
+ * Note that this will always be defined (never compiled out).
+ */
+const char *
+GFRmTraceGetComponentName( NvU32 componentId );
+
+#if !GF_TRACE_ENABLE || NVCPU_IS_XTENSA
+
+#define GF_TRACE( a )
+#define GF_TRACE_CRITICAL( a )
+#define GF_TRACE_WARNING( a )
+#define GF_TRACE_NORMAL( a )
+#define GF_TRACE_VERBOSE( a )
+#define GF_TRACE_DEBUG( a )
+
+#else /* tracing is enabled */
+
+static NV_INLINE void GFRmTraceWithPriority(const char *msg, ...)
+{
+ va_list list;
+ NvU32 priority = 0;
+
+ va_start( list, msg );
+
+ priority = GFRmTraceGetPriority( GF_TRACE_COMPONENTID );
+
+#if !defined(NV_MODS)
+ GFRmTrace( GF_TRACE_COMPONENTID, priority, msg, list );
+#else
+ GFModsTrace( GF_TRACE_COMPONENTID, priority, msg, list );
+#endif
+ va_end( list );
+}
+
+/* component id will be defined to be -1 for the trace implementation.
+ * Each client must define component id before including this file.
+ *
+ * For a MODS build, GFRmTraceWithPriority() must call ModsDrvVPrintf().
+ * See main/diag/mods/include/modsdrv.h for details. ModsDrvVPrintf()
+ * is called via GFModsTrace().
+ */
+#if GF_TRACE_COMPONENTID >= 0
+
+#define GF_TRACE( a ) \
+ do \
+ { \
+ GFRmTraceSetPriority( GF_TRACE_COMPONENTID, GF_TRACE_PRI_DEBUG ); \
+ GFRmTraceWithPriority a; \
+ } while( 0 )
+
+#define GF_TRACE_CRITICAL( a ) \
+ do \
+ { \
+ GFRmTraceSetPriority( GF_TRACE_COMPONENTID, GF_TRACE_PRI_CRITICAL ); \
+ GFRmTraceWithPriority a; \
+ } while( 0 )
+
+#define GF_TRACE_WARNING( a ) \
+ do \
+ { \
+ GFRmTraceSetPriority( GF_TRACE_COMPONENTID, GF_TRACE_PRI_WARNING ); \
+ GFRmTraceWithPriority a; \
+ } while( 0 )
+
+#define GF_TRACE_NORMAL( a ) \
+ do \
+ { \
+ GFRmTraceSetPriority( GF_TRACE_COMPONENTID, GF_TRACE_PRI_NORMAL ); \
+ GFRmTraceWithPriority a; \
+ } while( 0 )
+
+#define GF_TRACE_VERBOSE( a ) \
+ do \
+ { \
+ GFRmTraceSetPriority( GF_TRACE_COMPONENTID, GF_TRACE_PRI_VERBOSE ); \
+ GFRmTraceWithPriority a; \
+ } while( 0 )
+
+#define GF_TRACE_DEBUG( a ) \
+ do \
+ { \
+ GFRmTraceSetPriority( GF_TRACE_COMPONENTID, GF_TRACE_PRI_DEBUG ); \
+ GFRmTraceWithPriority a; \
+ } while( 0 )
+#endif /* componentid check */
+
+#endif /* enable trace */
+
+#endif /* GFRMTRACE_H */
diff --git a/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFTypes.h b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFTypes.h
new file mode 100755
index 00000000..49145b10
--- /dev/null
+++ b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFTypes.h
@@ -0,0 +1,65 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/*
+ * File: GFTypes.h
+ * GFSDK standard data types.
+ */
+
+#ifndef __GFTYPES_H__
+#define __GFTYPES_H__
+
+#include "nvtypes.h"
+
+#ifndef NULL
+#ifdef __cplusplus
+#define NULL 0
+#else
+#define NULL ((void *)0)
+#endif
+#endif
+
+/* Misc Helper macros on data types (deal with byte-endianness later ) */
+#ifndef MAKENvU32
+#define MAKENvU32(dataLo16, dataHi16) \
+ (NvU32)(((NvU32)(dataHi16) << 16) | (NvU32)(dataLo16))
+#endif /* MAKENvU32 */
+
+#ifndef MAKENvU16
+#define MAKENvU16(dataLo8, dataHi8) \
+ (NvU16)(((NvU16)(dataHi8) << 8) | (NvU16)(dataLo8))
+#endif /* MAKENvU16 */
+
+#if defined(__arm)
+# define GFALIGN8 __align(1)
+# define GFALIGN16 __align(2)
+# define GFALIGN32 __align(4)
+#elif defined(__IAR_SYSTEMS_ICC__)
+# define GFALIGN8
+# define GFALIGN16
+# define GFALIGN32
+#elif defined(NV_LINUX)
+# define GFALIGN8
+# define GFALIGN16 __attribute__ ((aligned (2)))
+# define GFALIGN32 __attribute__ ((aligned (4)))
+#elif defined(NVCPU_XTENSA)
+# define GFALIGN8
+# define GFALIGN16 __attribute__ ((aligned (2)))
+# define GFALIGN32 __attribute__ ((aligned (4)))
+#elif defined(NV_WINDOWS)
+# define GFALIGN8
+# define GFALIGN16
+# define GFALIGN32
+#else
+# define GFALIGN8
+# define GFALIGN16
+# define GFALIGN32
+#endif
+
+#endif /* __GFTYPES_H__ */
diff --git a/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFVersion.h b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFVersion.h
new file mode 100755
index 00000000..399900be
--- /dev/null
+++ b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFVersion.h
@@ -0,0 +1,24 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/*
+ * File: GFVersion.h
+ * GFSDK build version header file.
+ */
+
+#ifndef __GFVERSION_H__
+#define __GFVERSION_H__
+
+#define GF_MAJOR_VERSION 0x0017
+#define GF_MINOR_VERSION 0x0100
+#define GF_BUILD_NUMBER 1039
+
+
+#endif /* __GFVERSION_H__ */
+
diff --git a/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFVx.h b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFVx.h
new file mode 100755
index 00000000..5af9e634
--- /dev/null
+++ b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFVx.h
@@ -0,0 +1,3028 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/** @file GFVx.h
+ GFSDK Video API header file.
+*/
+
+#ifndef __GFVX_H__
+#define __GFVX_H__
+
+#include "GFRm.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+#include "GFVxScr.h"
+
+/** @addtogroup groupVx VxAPI Video API
+
+ @ref pageVxOverview
+
+ @ref pageVxOverview1
+ @ref pageVxOverview2
+ @ref pageVxOverview3
+
+ @ref pageVxAppNotes
+
+
+*/
+/*@{*/
+
+/* GFVX Property Capability */
+
+/** VxAPI property flag: Color space conversion supported.
+ @see GFVxGetProperty(), GFPROPERTY::Capability
+*/
+#define GFVX_CAP_CSC 0x00000001
+
+/** VxAPI property flag: VIP functions available.
+ @see GFVxGetProperty(), GFPROPERTY::Capability
+*/
+#define GFVX_CAP_VIP 0x00000002
+
+/** VxAPI property flag: Enlarge source image via VIP supported.
+ @see GFVxGetProperty(), GFPROPERTY::Capability
+*/
+#define GFVX_CAP_ENLARGE 0x00000004
+
+/** VxAPI property flag: Shrink source image via VIP supported.
+ @see GFVxGetProperty(), GFPROPERTY::Capability
+*/
+#define GFVX_CAP_SHRINK 0x00000008
+
+/** VxAPI property flag: Overlay supported.
+ The GoForce processor version supports overlay display.
+ @see GFVxGetProperty(), GFPROPERTY::Capability
+*/
+#define GFVX_CAP_OVERLAY 0x00000020
+
+/** VxAPI property flag: MPEG4 decoder supported.
+ @see GFVxGetProperty(), GFPROPERTY::Capability
+*/
+#define GFVX_CAP_MPEGDEC 0x00000040
+
+/** VxAPI property flag: MPEG4 encoder supported.
+ @see GFVxGetProperty(), GFPROPERTY::Capability
+*/
+#define GFVX_CAP_MPEGENC 0x00000080
+
+/** VxAPI property flag: JPEG decoder supported.
+ @see GFVxGetProperty(), GFPROPERTY::Capability
+*/
+#define GFVX_CAP_JPEGDEC 0x00000100
+
+/** VxAPI property flag: JPEG encoder supported.
+ @see GFVxGetProperty(), GFPROPERTY::Capability
+*/
+#define GFVX_CAP_JPEGENC 0x00000200
+
+/** VxAPI property flag: Alpha blending supported.
+ @version SC12 and above only.
+ @see GFVxGetProperty(), GFPROPERTY::Capability
+*/
+#define GFVX_CAP_ALPHA_BLEND 0x00000400
+
+/** VxAPI property flag: Extended RGB format 32 bpp supported.
+ @version SC12 above only.
+ @see GFVxGetProperty(), GFPROPERTY::Capability
+*/
+#define GFVX_CAP_EXTEND_RGB 0x00000800
+
+/** VxAPI property flag: Variable sized data camera interface (Type A/B/C)
+ supported. See section @ref pageVxOverview2 for information on Type A/B/C
+ camera interfaces.
+ @version SC12 and above only.
+ @see GFVxGetProperty(), GFPROPERTY::Capability,
+*/
+#define GFVX_CAP_ENCODE_TYPE 0x00001000
+
+/** VxAPI property flag: Bayer type camera interface supported.
+ @version SC15 and above only.
+ @see GFVxGetProperty(), GFPROPERTY::Capability,
+*/
+#define GFVX_CAP_BAYER_TYPE 0x00002000 // support bayer type input
+
+/** VxAPI property flag: YUV Overlay supported.
+ @version SC15 and above only.
+ @see GFVxGetProperty(), GFPROPERTY::Capability
+*/
+#define GFVX_CAP_OVERLAY_YUV 0x00004000
+
+/** VxAPI property flag: Overlay with scaling supported.
+ @version SC15 and above only.
+ @see GFVxGetProperty(), GFPROPERTY::Capability
+*/
+#define GFVX_CAP_OVERLAY_SCALE 0x00008000
+
+/** VxAPI property flag: Multiple Overlay supported.
+ @version SC15 and above only.
+ @see GFVxGetProperty(), GFPROPERTY::Capability
+*/
+#define GFVX_CAP_OVERLAY_MULTIPLE 0x00010000
+
+/** VxAPI property flag: Per pixel alpha supported.
+ Used when application wants to use weight (overlay and blend)
+ defined in pixels alpha bits.
+ @version SC15 and above only.
+ @see GFVxGetProperty(), GFPROPERTY::Capability
+*/
+#define GFVX_CAP_PER_PIXEL_ALPHA 0x00020000
+
+/** VxAPI GFVXBLT::BltOption flagbit: Disable VSync wait.
+ Disable GFVxBlt() synchronization with VSync. The default behaviour of
+ GFVxBlt() is to wait for VSync to prevent display flicker. Note that
+ if the display is disabled there is no VSync signal and GFVxBlt()
+ would block.
+ @see GFVXBLT, GFVxBlt()
+*/
+#define GFVX_BLT_DISABLE_WAIT_VSYNC 0x00000080
+
+/** VxAPI GFVXBLT::BltOption flagbit: Source color key.
+ GFVxBlt() compares each pixel of the source surface with the color key.
+ If the colors match, the pixel is not copied to the destination surface.
+
+ The source color key option is not very useful when scaling is used.
+
+ @see GFVXBLT, GFVxBlt()
+*/
+#define GFVX_BLT_SRC_KEY 0x00000100
+
+/** VxAPI GFVXBLT::BltOption flagbit: Auto-blit at end of VIP frame.
+ If this flag is set, GFVxBlt() configures blit parameters for
+ VIP auto-blit. VIP auto-blit can be used to fire stretch blit automatically
+ at the end of the video input frame from the video input port (VIP). This
+ requires double buffering of the input and output of stretch blit. The use
+ of this flag is to be combined with GFVxVIPUpdate() flag
+ #GFVX_VIP_AUTO_TRIGER_BLT.
+ @see GFVXBLT, GFVxBlt(), #GFVX_VIP_AUTO_TRIGER_BLT
+*/
+#define GFVX_AUTO_BLT 0x00000400
+
+/** VxAPI GFVXBLT::BltOption flagbit: Auto-blit at end of VIP frame.
+ This flag is the same as #GFVX_AUTO_BLT
+ @version SC15 and above only
+ @see GFVXBLT, GFVxBlt(), #GFVX_VIP_AUTO_TRIGER_BLT, #GFVX_AUTO_BLT
+*/
+#define GFVX_BLT_AUTO_VI 0x00000400
+
+/** VxAPI GFVXBLT::BltOption flagbit: Auto-display destination surface.
+ The application does not need call GFVxFlip() to show the surface.
+ With the auto-display option, the VI module triggers stretch blit which
+ in turn sends the destination surface's buffer address to the display
+ controller (GC). VI input data goes into double buffers which become the
+ stretch blit source, the output of stretch blit is also double buffered.
+ @see GFVXBLT, GFVxBlt()
+*/
+#define GFVX_AUTO_DISPLAY 0x00000800
+
+/** VxAPI GFVXBLT::BltOption flagbit: Auto-display destination surface.
+ This flag is the same as #GFVX_AUTO_DISPLAY
+ @version SC15 and above only
+ @see GFVXBLT, GFVxBlt(), #GFVX_AUTO_DISPLAY
+*/
+#define GFVX_BLT_AUTO_DISPLAY 0x00000800
+
+/** VxAPI GFVXBLT::BltOption flagbit: Set up parameters for partial blit
+ If this flag is set, GFVxBlt() configures blit parameters for
+ partial blit. The partial blit works only with circular buffers and
+ source and destination format are not YUV planar format.
+ @see GFVXBLT, GFVxBlt()
+*/
+#define GFVX_BLT_PARTIAL 0x00001000
+
+/** VxAPI GFVXBLT::BltOption flagbit: Trigger partial blit
+ If this flag is set, GFVxBlt() will blit buffer specified
+ in buffer index option of circular buffers to destination surface.
+ The use of this flag is to be combined with GFVxBlt() flag
+ #GFVX_BLT_PARTIAL.
+ @see GFVXBLT, GFVxBlt(), #GFVX_BLT_PARTIAL
+*/
+#define GFVX_BLT_PARTIAL_TRIGGER 0x00002000
+
+/** VxAPI GFVXBLT::BltOption flagbit: Blit without rotation
+ If this flag is set, GFVxBlt() blits without rotation
+ @see GFVXBLT, GFVxBlt()
+*/
+#define GFVX_BLT_ROTATE_0 0x00004000
+
+/** VxAPI GFVXBLT::BltOption flagbit: Blit with 90 degree rotation
+ If this flag is set, GFVxBlt() blits with 90 degree rotation
+ Currently, SC15 doesn't support this feature. However, this flag
+ can be combined with flag GFVX_BLT_H_FLIP to blit with XY swap
+ @see GFVXBLT, GFVxBlt()
+*/
+#define GFVX_BLT_ROTATE_90 0x00008000
+
+/** VxAPI GFVXBLT::BltOption flagbit: Blit with 180 degree rotation
+ If this flag is set, GFVxBlt() blits with 180 degree rotation
+ Currently, SC15 doesn't support this feature.
+ @see GFVXBLT, GFVxBlt()
+*/
+#define GFVX_BLT_ROTATE_180 0x00010000
+
+/** VxAPI GFVXBLT::BltOption flagbit: Blit with 270 degree rotation
+ If this flag is set, GFVxBlt() blits with 270 degree rotation
+ Currently, SC15 doesn't support this feature. However, this flag
+ can be combined with flag GFVX_BLT_V_FLIP to blit with XY swap
+ @see GFVXBLT, GFVxBlt()
+*/
+#define GFVX_BLT_ROTATE_270 0x00020000
+
+/** VxAPI GFVXBLT::BltOption flagbit: Blit with horizontal flip
+ If this flag is set, GFVxBlt() blits with horizontal flip
+ Currently, SC15 doesn't support this feature.
+ @see GFVXBLT, GFVxBlt()
+*/
+#define GFVX_BLT_H_FLIP 0x00040000
+
+/** VxAPI GFVXBLT::BltOption flagbit: Blit with vertical flip
+ If this flag is set, GFVxBlt() blits with vertical flip
+ Currently, SC15 doesn't support this feature
+ @see GFVXBLT, GFVxBlt()
+*/
+#define GFVX_BLT_V_FLIP 0x00080000
+
+/** VxAPI GFVXBLT::BltOption flagbit: Auto-display destination surface
+ using overlay window 2. This is exactly identical to #GFVX_AUTO_DISPLAY
+ except that it uses overlay window 2 instead of overlay window 1 (default).
+
+ @version SC15 and above only
+ @see GFVXBLT, GFVxBlt()
+*/
+#define GFVX_AUTO_DISPLAY_OVERLAY2 0x00100000
+
+/** VxAPI GFVXBLT::BltOption flagbit: Auto-display destination surface
+ using overlay window 2. This flag is the same as #GFVX_AUTO_DISPLAY_OVERLAY2
+ @version SC15 and above only
+ @see GFVXBLT, GFVxBlt(), #GFVX_AUTO_DISPLAY_OVERLAY2
+*/
+#define GFVX_BLT_AUTO_DISPLAY_OVERLAY2 0x00100000
+
+/** VxAPI GFVXBLT::BltOption flagbit: Enables full range in color spce conversion
+ 0<= Y <=255, -128<= U <=127, -128<= V <=127
+ YUV-->RGB conversion formula:
+ R = 1.000Y + 1.402V
+ G = 1.000Y - 0.344U - 0.714V
+ B = 1.000Y + 1.772U
+ This option is useful for decoded video from movies.
+ When this flag is not set, uses CCIR601 range (16-235) as follows:
+ 16<= Y <=235, 16<= U <=240, 16<= V <=240
+ YUV-->RGB conversion formula:
+ R = 1.164(Y-16) + 1.596(Cr-128)
+ G = 1.164(Y-16) - 0.391(Cb-128) - 0.813(Cr-128)
+ B= 1.164(Y-16) + 2.018(Cb-128)
+ This option is useful for video from camera.
+ @version SC15 and above only
+ @see GFVXBLT, GFVxBlt()
+*/
+#define GFVX_BLT_CSC_FULL_RANGE 0x00200000
+
+/** VxAPI GFVXBLT::BltOption flagbit: Enable camera VSync wait.
+ Enable GFVxBlt() synchronization with camera VSync. Note that
+ if the camera is disabled there is no VSync signal and GFVxBlt()
+ would block.
+ @see GFVXBLT, GFVxBlt()
+*/
+#define GFVX_BLT_ENABLE_WAIT_CAMERA_VSYNC 0x00400000
+
+/** VxAPI GFVXBLT::BltOption flagbit: Disable vertical and horizontal filters
+ By default, the vertical and horizontal filters are enabled. If this flag
+ is set, GFVxBlt() blits with filters disabled
+ @see GFVXBLT, GFVxBlt()
+*/
+#define GFVX_BLT_DISABLE_FILTERS 0x00800000
+
+/** VxAPI option parameter of routines GFVxBltSetCSCCoefff()
+ and GFVxVIPSetCSCCoeff() to use CCIR601 range
+
+ CSC_USE_CCIR601_RANGE (16-235) as follows:
+ 16<= Y <=235, 16<= U <=240, 16<= V <=240
+ YUV-->RGB conversion formula:
+
+ R = sat(KYRGB*(Y + YOF) + KUR*U + KVR*V)
+ G = sat(KYRGB*(Y + YOF) + KUG*U + KVG*V)
+ B = sat(KYRGB*(Y + YOF) + KUB*U + KVB*V)
+
+ The CSC coefficients are:
+
+ KYRGB, KUR, KVR 1.1644 0.0000 1.5960
+ KYRGB, KUG, KVG = 1.1644 -0.3918 -0.8130
+ KYRGB, KUB, KVB 1.1644 2.0172 0.0000
+
+ and YOF = -16.0000
+ This option is useful for video from camera.
+
+ @see GFVxBltSetCSCCoeff(), GFVxVIPSetCSCCoeff()
+*/
+#define GFVX_SET_CSC_USE_CCIR601_RANGE 0x00800000
+
+/** VxAPI option parameter of routines GFVxBltSetCSCCoefff()
+ and GFVxVIPSetCSCCoeff() to use full range in color space conversion
+
+ CSC_USE_FULL_RANGE
+ 0<= Y <=255, -128<= U <=127, -128<= V <=127
+ YUV-->RGB conversion formula:
+
+ R = sat(KYRGB*(Y + YOF) + KUR*U + KVR*V)
+ G = sat(KYRGB*(Y + YOF) + KUG*U + KVG*V)
+ B = sat(KYRGB*(Y + YOF) + KUB*U + KVB*V)
+
+ The CSC coefficients are:
+
+ KYRGB, KUR, KVR 1.0000 0.0000 1.4020
+ KYRGB, KUG, KVG = 1.0000 -0.3440 -0.7140
+ KYRGB, KUB, KVB 1.0000 1.7720 0.0000
+
+ and YOF = 0.0000
+ This option is useful for decoded video from movies.
+ @see GFVxBltSetCSCCoeff(), GFVxVIPSetCSCCoeff()
+*/
+#define GFVX_SET_CSC_USE_FULL_RANGE 0x01000000
+
+/** VxAPI option parameter of routines GFVxBltSetCSCCoefff()
+ and GFVxVIPSetCSCCoeff() to use user defined range
+ provided in option parameter pCoeff pointer to GFVXCSCCOEF struct
+
+ @see GFVxBltSetCSCCoeff(), GFVxVIPSetCSCCoeff()
+*/
+#define GFVX_SET_CSC_USE_USER_DEFINED_RANGE 0x02000000
+/** Structure to control GFVxBlt() behaviour.
+ @see GFVxBlt()
+*/
+
+typedef struct _GFVXBLT
+{
+ PGFRMSURFACE *ppDestSurf; /**< Pointer to an array of destination
+ surfaces of identical dimensions.
+
+ For passing scaled YUV output data to
+ the planar block as input to the
+ JPEG/MPEG encoder, pass an array containing
+ one NULL pointer.
+
+ Destination surface dimensions limitations:
+
+ Minimum stride 0 bytes
+ Minimum width 1
+ Minimum height 1
+ Maximum stride 4095 bytes
+ Maximum width 4064 (YUV)
+ (YUV data restricted by JPEG encoder),
+ 32767 (RGB)
+ (RGB data restricted by stride)
+
+ Maximum height 32766, or unlimited
+ if \a pDestRect is specified
+
+
+ If the destination color format is YUV (pass to
+ JPEG/MPEG EPP, and \a pDestRect is not specified,
+ the surface width must be a multiple of 2.
+ */
+ PGFRMSURFACE *ppSrcSurf; /**< Pointer to an array of source surfaces
+ of identical dimensions.
+ Source surface dimensions limitations:
+
+ Minimum stride 0 bytes
+ Minimum width 1
+ Minimum height 1
+ Maximum stride 4095 bytes
+ Maximum width
+ 16383 (SC15),
+ 2032 (SC12),
+ 496 (SC5, RGB or YUV422), 512 (SC5),
+ 496 (SC10, SC4),
+ 312 (SC3 and below),
+ or unlimited if \a pSrcRect is specified
+
+ Maximum height 32766, or unlimited
+ if \a pDestRect is specified
+
+ */
+ PGFRECT pDestRect; /**< Destination rectangle, or NULL to blit
+ scaled to the size of the entire target
+ surface (size of first surface in
+ \a ppDestSurf is used).
+ Destination cropping rectangle limitations:
+
+ Minimum width 1
+ Minimum height 1
+ Maximum width 4064 (YUV),
+ 32767 (RGB)
+
+ Maximum height 32766
+
+
+ If the destination color format is YUV (pass to
+ JPEG/MPEG EPP), the destination cropping rectangle's
+ width must be a multiple of 2.
+ */
+ PGFRECT pSrcRect; /**< Source cropping rectangle, or NULL for
+ no cropping and blit the entire source
+ surface (size of first surface in
+ \a ppSrcSurf is used).
+ Source cropping rectangle limitations:
+
+ Minimum width 1
+ Minimum height 1
+ Maximum width
+ 16383 (SC15),
+ 2032 (SC12),
+ 496 (SC5, RGB or YUV422), 512 (SC5),
+ 496 (SC10, SC4),
+ 312 (SC3 and below)
+
+ Maximum height 32766
+
+ */
+ NvU32 numofDestSurf;/**< Number of destination surfaces in array
+ \a ppDestSurf, used only if
+ #GFVX_AUTO_BLT flag set
+ */
+ NvU32 numofSrcSurf; /**< Number of source surfaces in array
+ \a ppSrcSurf, used only if
+ #GFVX_AUTO_BLT flag or #GFVX_BLT_PARTIAL flag set
+ */
+ NvU32 colorKey; /**< Color key value in RGB888 format */
+ NvU32 BltOption; /**< Flag bitmask:
+
+ #GFVX_BLT_DISABLE_WAIT_VSYNC
+ Disable VSync
+
+ #GFVX_BLT_SRC_KEY
+ Source color key
+
+ #GFVX_AUTO_BLT
+ Auto-blit at end of VIP frame
+
+ #GFVX_AUTO_DISPLAY
+ Auto-show destination surface
+ #GFVX_AUTO_DISPLAY_OVERLAY2
+ Auto-show destination surface from overlay window 2
+
+ #GFVX_BLT_PARTIAL
+ Configure partial blit parameters
+
+ #GFVX_BLT_PARTIAL_TRIGGER
+ Trigger partial blit at end of circular buffer
+
+ #GFVX_BLT_ENABLE_WAIT_CAMERA_VSYNC
+ Enable wait for camera VSYNC
+
+
+ */
+ // Fill The following fields if GFVX_BLT_PARTIAL_TRIGGER is set in BltOption
+ NvU32 FrameStart; /* @Notify start of frame.
+ Used only if #GFVX_BLT_PARTIAL_TRIGGER is set
+ in \a BltOption.
+ */
+ NvU32 FrameEnd; /* @Notify end of frame.
+ Used only if #GFVX_BLT_PARTIAL_TRIGGER is set
+ in \a BltOption.
+ */
+ NvU32 BufferIndex; /* @Specify which buffer of circular buffers is blitted.
+ Used only if #GFVX_BLT_PARTIAL_TRIGGER is set
+ in \a BltOption.
+ */
+} GFVXBLT, *PGFVXBLT;
+
+/** VxAPI GFVXFLIP::FlipOption flagbit: Flip uses second overlay window.
+
+ By default, VxFlip associates foreground and background surfaces
+ to first overlay window and flips them. However, the application can override
+ the default behavior and use second overlay window by using this flag in FlipOption.
+
+ This option should be used only if second overlay surface has been
+ previously set using UpdateOverlay(). .
+
+ @version SC15 and above only
+ @see GFVXFLIP, GFVxFlip()
+*/
+#define GFVX_FLIP_OVERLAY2 0x00000001
+
+/** Structure to control GFVxFlip() behaviour.
+ @see GFVxFlip()
+*/
+typedef struct _GFVXFLIP
+{
+ PGFRMSURFACE pBackGroundSurf; /**< Pointer to the surface to be flipped
+ to the background. This surface will
+ not be seen anymore after the
+ GFVxFlip() call.
+ */
+ PGFRMSURFACE pForeGroundSurf; /**< Pointer to the surface to be flipped
+ to the foreground. This surface will
+ be seen after the GFVxFlip() call.
+ */
+ NvU32 FlipOption;
+ /**< Flagbit mask controlling flip:
+
+ 0
+ Default. Flip uses first overlay window
+ GFVX_FLIP_SECOND_OVERLAY
+ Flip uses second overlay window
+
+ */
+} GFVXFLIP, *PGFVXFLIP;
+
+
+/** VxAPI GFVXUPDATEOVERLAY::UpdateOption flagbit: Overlay without rotation.
+ @see GFVXUPDATEOVERLAY, GFVxUpdateOverlay()
+*/
+#define GFVX_UO_ROTATE_0 GF_SURFACE_ROTATE_0
+
+/** VxAPI GFVXUPDATEOVERLAY::UpdateOption flagbit: Overlay with 180 degree rotation.
+ @see GFVXUPDATEOVERLAY, GFVxUpdateOverlay()
+*/
+#define GFVX_UO_ROTATE_180 GF_SURFACE_ROTATE_180
+
+/** VxAPI GFVXUPDATEOVERLAY::UpdateOption flagbit: Overlay with horizontal
+ flip.
+ @see GFVXUPDATEOVERLAY, GFVxUpdateOverlay()
+*/
+#define GFVX_UO_H_FLIP 0x00000010
+
+/** VxAPI GFVXUPDATEOVERLAY::UpdateOption flagbit: Overlay with vertical
+ flip.
+ @see GFVXUPDATEOVERLAY, GFVxUpdateOverlay()
+*/
+#define GFVX_UO_V_FLIP 0x00000020
+
+/** VxAPI GFVXUPDATEOVERLAY::UpdateOption flagbit: Source color keying.
+
+ A pixel from the source (overlay) surface is displayed only if pixel
+ color from the source surface matches the color key in
+ GFVXUPDATEOVERLAY::ColorKey.
+
+ Source color keying is not useful for video overlay, because changing
+ video is the source.
+
+ @see GFVXUPDATEOVERLAY, GFVxUpdateOverlay(), GFVX_UO_DEST_COLOR_KEY
+*/
+#define GFVX_UO_SRC_COLOR_KEY 0x00010000
+
+/** VxAPI GFVXUPDATEOVERLAY::UpdateOption flagbit: Destination color keying.
+
+ A pixel from the source (overlay) surface is displayed only if pixel
+ color from the destination surface matches the color key in
+ GFVXUPDATEOVERLAY::ColorKey.
+
+ @see GFVXUPDATEOVERLAY, GFVxUpdateOverlay(), GFVX_UO_SRC_COLOR_KEY
+*/
+#define GFVX_UO_DEST_COLOR_KEY 0x00020000
+
+/** VxAPI GFVXUPDATEOVERLAY::UpdateOption flagbit: Alpha blending.
+ Enable alpha blending. Alpha value is used from
+ GFVXUPDATEOVERLAY::AlphaValue.
+
+ As AlphaVal increases, the weight of source (overlay) window increases
+ until the window reaches its maximum weight of 0xFF.
+
+ Even though AlphaVal is a 32 bit number, alpha value can only be a 8 bit value.
+ Application should specify the same value in byte 1 (LSB), 2 and 3 else the API
+ will fail.
+
+ @see GFVXUPDATEOVERLAY, GFVxUpdateOverlay()
+*/
+#define GFVX_UO_ALPHA_BLENDING 0x00040000
+
+/** VxAPI GFVXUPDATEOVERLAY::UpdateOption flagbit: Overlay based on
+ destination alpha only.
+
+ If destination is in 1-bit alpha format (eg ARGB1555), GFVXUPDATEOVERLAY::ColorKey bit[24]
+ contains the alpha value. GFVxUpdateOverlay() compares this value with
+ the target surface's alpha and ignores the RGB value. Overlay (source) surface
+ shows up in portions of the screen where the two match.
+
+ @see GFVXUPDATEOVERLAY, GFVxUpdateOverlay()
+*/
+#define GFVX_UO_COLOR_KEY_ALPHA_ONLY 0x00080000
+
+/** VxAPI GFVXUPDATEOVERLAY::UpdateOption flagbit: Overlay based on
+ destination alpha and color
+
+ If destination is in 1-bit alpha format (eg ARGB1555),
+ GFVXUPDATEOVERLAY::ColorKey bit [24] contains alpha and
+ GFVXUPDATEOVERLAY::ColorKey bit [23:0] contains RGB color values.
+ GFVxUpdateOverlay() compares the key's alpha value and
+ color values with destination surface pixels.
+
+ Overlay (source) surface shows up in portions of the screen where both
+ alpha and color values match.
+
+ If neither #GFVX_UO_COLOR_KEY_ALPHA_ONLY nor #GFVX_UO_COLOR_KEY_ALPHA_COLOR are
+ set, GFVxUpdateOverlay() assumes the RGB values in
+ GFVXUPDATEOVERLAY::ColorKey to be valid and compares the RGB value with
+ surface's RGB value. Depending upon whether #GFVX_UO_SRC_COLOR_KEY or
+ #GFVX_UO_DEST_COLOR_KEY is defined, RGB value is compared with source or
+ destination pixels. If neither #GFVX_UO_SRC_COLOR_KEY nor #GFVX_UO_DEST_COLOR_KEY
+ is defined, overlay(source) surface is overlayed on top of destination surface
+ without any match. #GFVX_UO_COLOR_KEY_ALPHA_ONLY nor #GFVX_UO_COLOR_KEY_ALPHA_COLOR
+ if defined, are ignored.
+
+ @see GFVXUPDATEOVERLAY, GFVxUpdateOverlay()
+*/
+#define GFVX_UO_COLOR_KEY_ALPHA_COLOR 0x00100000
+
+/** VxAPI GFVXUPDATEOVERLAY::UpdateOption flagbit: Alpha blending based on
+ destination alpha.
+
+ If destination is in 1-bit alpha format (eg ARGB1555),
+ GFVXUPDATEOVERLAY::BlendingColorKey bit [24] contains an alpha value.
+ GFVxUpdateOverlay() compares this value with the destination surface's
+ alpha only and ignores the RGB value.
+
+ If the two match, GFVXUPDATEOVERLAY::AlphaValue determines the weight
+ of source surface.
+
+ @see GFVXUPDATEOVERLAY, GFVxUpdateOverlay()
+*/
+#define GFVX_UO_BLD_COLOR_KEY_ALPHA_ONLY 0x00200000
+
+/** VxAPI GFVXUPDATEOVERLAY::UpdateOption flagbit: Alpha blending based on
+ destination alpha and color
+
+ If destination is in 1-bit alpha format (eg ARGB1555),
+ GFVXUPDATEOVERLAY::BlendingColorKey bit [24] contains an alpha value and
+ GFVXUPDATEOVERLAY::BlendingColorKey bit [23:0] contains RGB values.
+ GFVxUpdateOverlay() compares alpha value and color value with the
+ destination surface's alpha and color value.
+
+ Source and destination pixels appear blended in portions of the screen where both
+ alpha and color values match. GFVXUPDATEOVERLAY::AlphaValue determines the weight
+ of source surface.
+
+ If neither #GFVX_UO_BLD_COLOR_KEY_ALPHA_ONLY nor #GFVX_UO_BLD_COLOR_KEY_ALPHA_COLOR
+ are set, GFVxUpdateOverlay() assumes the RGB portion in the key to be
+ valid and compares the RGB value with the surface's RGB value.
+
+ @see GFVXUPDATEOVERLAY, GFVxUpdateOverlay()
+*/
+#define GFVX_UO_BLD_COLOR_KEY_ALPHA_COLOR 0x00400000
+
+/** VxAPI GFVXUPDATEOVERLAY::UpdateOption flagbit: Enable Second overlay window
+
+ SC15 supports two overlay windows. This flag is used to enable
+ the second overlay window.
+
+ @version SC15 and above only
+ @see GFVXUPDATEOVERLAY, GFVxUpdateOverlay()
+*/
+#define GFVX_UO_OVERLAY2 0x00800000
+
+/** VxAPI GFVXUPDATEOVERLAY::UpdateOption flagbit: Show this overlay window on top
+
+ When more than one overlay windows are enabled and their destination rectangles
+ overlap, this flag can be defined to indicate which overlay window should appear
+ on top.
+
+ By default, first overlay window will appear on top if destination
+ rectangles for the two windows overlap. However, application can override the
+ default behavior by specifying #GFVX_UO_ACTIVETOP flag in relevant windows's
+ UpdateOption.
+
+ @version SC15 and above only
+ @see GFVXUPDATEOVERLAY, GFVxUpdateOverlay()
+*/
+#define GFVX_UO_ACTIVETOP 0x01000000
+
+/** VxAPI GFVXUPDATEOVERLAY::UpdateOption flagbit: Overlay and Blend weight
+ comes from per-pixel alpha channel.
+
+ @version SC15 and above only
+ @see GFVXUPDATEOVERLAY, GFVxUpdateOverlay()
+*/
+#define GFVX_UO_COLOR_KEY_PER_PIXEL_ALPHA 0x02000000
+
+/** VxAPI GFVXUPDATEOVERLAY::UpdateOption flagbit: Enable digital vibrance for
+ overlay.
+
+ If this bit is set in UpdateOption, then dvRed, dvGreen and dvBlue must be
+ set in UpdateOverlay structure for overlay window.
+
+ If this bit is set in UpdateOption2, then dvRed2, dvGreen2 and dvBlue2 must be
+ set in UpdateOverlay structure for overlay2 window.
+
+ @version SC15 and above only
+ @see GFVXUPDATEOVERLAY, GFVxUpdateOverlay()
+*/
+#define GFVX_UO_DIGITAL_VIBRANCE 0x04000000
+
+/** VxAPI GFVXUPDATEOVERLAY::UpdateOption2 flagbit: Enable AlphaValue2
+
+ If this bit is set in UpdateOption2, then the alpha value is used
+ from GFVXUPDATEOVERLAY::AlphaValue2
+
+ @version SC15 and above only
+ @see GFVXUPDATEOVERLAY, GFVxUpdateOverlay()
+*/
+#define GFVX_UO_USE_ALPHAVALUE2 0x08000000
+
+/** Structure for controlling GFVxUpdateOverlay() behaviour.
+ @see GFVxUpdateOverlay()
+*/
+typedef struct _GFVXUPDATEOVERLAY
+{
+ PGFRMSURFACE pDestSurf; /**< Destination surface pointer */
+ PGFRMSURFACE pSrcSurf; /**< Source surface pointer, if this pointer
+ is NULL, disable overlay.
+ */
+ PGFRECT pDestRect; /**< Destination rectangle */
+ PGFRECT pSrcRect; /**< Source rectangle */
+ NvU32 ColorKey; /**< Color key value in ARGB32 format.
+ Color keying takes effect only when
+ #GFVX_UO_SRC_COLOR_KEY or
+ #GFVX_UO_DEST_COLOR_KEY is set.
+ */
+ NvU32 UpdateOption;
+ /**< Flagbit mask controlling rotation, color keying:
+
+ #GFVX_UO_ROTATE_0
+ Overlay without rotation
+ #GFVX_UO_ROTATE_180
+ Overlay with 180 degree rotation
+ #GFVX_UO_H_FLIP
+ Overlay with horizontal flip
+ #GFVX_UO_V_FLIP
+ Overlay with vertical flip
+ #GFVX_UO_SRC_COLOR_KEY
+ Source color keying
+ #GFVX_UO_DEST_COLOR_KEY
+ Destination color keying
+ #GFVX_UO_ALPHA_BLENDING
+ Alpha blending
+ #GFVX_UO_COLOR_KEY_ALPHA_ONLY
+ Overlay based on destination alpha
+ #GFVX_UO_COLOR_KEY_ALPHA_COLOR
+ Overlay based on destination alpha and color
+ #GFVX_UO_BLD_COLOR_KEY_ALPHA_ONLY
+ Alpha Blending based on destination alpha
+ #GFVX_UO_BLD_COLOR_KEY_ALPHA_COLOR
+ Alpha Blending based on destination alpha and color
+ #GFVX_UO_OVERLAY2
+ Enable second overlay window
+ #GFVX_UO_ACTIVETOP
+ Show this overlay window on top
+ #GFVX_UO_DIGITAL_VIBRANCE
+ Enable digital vibrance for first overlay window
+
+ */
+ NvU32 BlendingColorKey;
+ /**< Blending color key value in ARGB32 format.
+ Value takes effect only when #GFVX_UO_ALPHA_BLENDING and
+ (#GFVX_UO_SRC_COLOR_KEY or #GFVX_UO_DEST_COLOR_KEY)
+ are set.
+ */
+ NvU32 AlphaValue;
+ /**< Alpha value for blending overlay.
+ Alpha value is used to do blending when
+ blending color key matches. Even though AlphaVal
+ is a 32 bit number, alpha value can only be a 8 bit value.
+ Application should specify the same value in byte 1 (LSB),
+ 2 and 3 else the API will fail.
+ */
+
+ PGFRMSURFACE pDestSurf2; /**< Destination surface pointer for second overlay */
+ PGFRMSURFACE pSrcSurf2; /**< Source surface pointer for second overlay,
+ if this pointer is NULL, disable second overlay.
+ */
+ PGFRECT pDestRect2; /**< Destination rectangle for second overlay */
+ PGFRECT pSrcRect2; /**< Source rectangle for second overlay */
+ NvU32 UpdateOption2;
+ /**< Flagbit mask controlling rotation, color keying for second overlay:
+
+ #GFVX_UO_ROTATE_0
+ Overlay without rotation
+ #GFVX_UO_ROTATE_180
+ Overlay with 180 degree rotation
+ #GFVX_UO_H_FLIP
+ Overlay with horizontal flip
+ #GFVX_UO_V_FLIP
+ Overlay with vertical flip
+ #GFVX_UO_SRC_COLOR_KEY
+ Source color keying
+ #GFVX_UO_DEST_COLOR_KEY
+ Destination color keying
+ #GFVX_UO_ALPHA_BLENDING
+ Alpha blending
+ #GFVX_UO_COLOR_KEY_ALPHA_ONLY
+ Overlay based on destination alpha
+ #GFVX_UO_COLOR_KEY_ALPHA_COLOR
+ Overlay based on destination alpha and color
+ #GFVX_UO_BLD_COLOR_KEY_ALPHA_ONLY
+ Alpha Blending based on destination alpha
+ #GFVX_UO_BLD_COLOR_KEY_ALPHA_COLOR
+ Alpha Blending based on destination alpha and color
+ #GFVX_UO_ACTIVETOP
+ Show this overlay window on top
+ #GFVX_UO_DIGITAL_VIBRANCE
+ Enable digital vibrance for second overlay window
+
+ */
+ NvU8 dvRed; /**< Digital vibrance amplification factor for R overlay.
+ It is configured via GFVxUpdateOverlay(),
+ GFVXUPDATEOVERLAY::dvRed's valid value range
+ is 1 to 100.
+ */
+ NvU8 dvGreen; /**< Digital vibrance amplification factor for G overlay.
+ It is configured via GFVxUpdateOverlay(),
+ GFVXUPDATEOVERLAY::dvGreen's valid value range
+ is 1 to 100.
+ */
+ NvU8 dvBlue; /**< Digital vibrance amplification factor for B overlay.
+ It is configured via GFVxUpdateOverlay(),
+ GFVXUPDATEOVERLAY::dvBlue's valid value range
+ is 1 to 100.
+ */
+ NvU8 dvRed2; /**< Digital vibrance amplification factor for R overlay2.
+ It is configured via GFVxUpdateOverlay(),
+ GFVXUPDATEOVERLAY::dvRed2's valid value range
+ is 1 to 100.
+ */
+ NvU8 dvGreen2; /**< Digital vibrance amplification factor for G overlay2.
+ It is configured via GFVxUpdateOverlay(),
+ GFVXUPDATEOVERLAY::dvGreen2's valid value range
+ is 1 to 100.
+ */
+ NvU8 dvBlue2; /**< Digital vibrance amplification factor for B overlay2.
+ It is configured via GFVxUpdateOverlay(),
+ GFVXUPDATEOVERLAY::dvBlue2's valid value range
+ is 1 to 100.
+ */
+ NvU32 AlphaValue2;
+ /**< Alpha value for blending Window C overlay.
+ Same restriction as for GFVXUPDATEOVERLAY::AlphaValue apply.
+ */
+
+} GFVXUPDATEOVERLAY, *PGFVXUPDATEOVERLAY;
+
+
+/** Parameter structure for GFVxVIPFeedImage().
+ This structure describes the image data that is to be fed to the VIP
+ via the CPU host.
+ @see GFVxVIPFeedImage()
+*/
+typedef struct _GFVXVIPFEEDIMAGE
+{
+ PGFRMSURFACE pSurf; /**< Surface to feed data from, must be in a YUV
+ format and accessible by the host CPU
+ */
+ PGFRECT pSrcRect; /**< Source clipping rectangle for data feeding, or
+ NULL for no clipping
+ */
+} GFVXVIPFEEDIMAGE, *PGFVXVIPFEEDIMAGE;
+
+
+/** VxAPI GFVXVIPPROPERTY::Flag flagbit: VIP supports image shrinking.
+ @see GFVXVIPPROPERTY, GFVxVIPGetProperty(), GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_CAP_SHRINK 0x00000001
+
+/** VxAPI GFVXVIPPROPERTY::Flag flagbit: VIP supports image enlarging.
+ @see GFVXVIPPROPERTY, GFVxVIPGetProperty(), GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_CAP_ENLARGE 0x00000002
+
+/** VxAPI GFVXVIPPROPERTY::Flag flagbit: Parallel video input supported.
+ @see GFVXVIPPROPERTY, GFVxVIPGetProperty(), GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_CAP_PARALLEL 0x00000004
+
+/** VxAPI GFVXVIPPROPERTY::Flag flagbit: Serial video input supported.
+ @see GFVXVIPPROPERTY, GFVxVIPGetProperty(), GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_CAP_SERIAL 0x00000008
+
+/** VxAPI GFVXVIPPROPERTY::Flag flagbit: Vertical and horizontal flip supported
+ for VIP output RGB image.
+ @see GFVXVIPPROPERTY, GFVxVIPGetProperty(), GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_CAP_RGB_VH_FLIP 0x00000010
+
+/** VxAPI GFVXVIPPROPERTY::Flag flagbit: VIP can supply VClock and VHSync
+ signals to the camera chip.
+ @see GFVXVIPPROPERTY, GFVxVIPGetProperty(), GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_CAP_OUTPUT_VCLOCK_VHSYNC 0x00000020
+
+/** VxAPI GFVXVIPPROPERTY::Flag flagbit: VIP can supply a master clock to the
+ camera chip.
+ @see GFVXVIPPROPERTY, GFVxVIPGetProperty(), GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_CAP_OUTPUT_MASTER_CLOCK 0x00000040
+
+/** VxAPI GFVXVIPPROPERTY::Flag flagbit: VIP can accept a JPEG bitstream from
+ a camera with type A interface.
+ See section @ref pageVxOverview2 for description of type A, B, and C
+ interfaces.
+ @see GFVXVIPPROPERTY, GFVxVIPGetProperty(), GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_CAP_TYPE_A 0x00000080
+
+/** VxAPI GFVXVIPPROPERTY::Flag flagbit: VIP can accept a JPEG bitstream from
+ a camera with type B interface.
+ See section @ref pageVxOverview2 for description of type A, B, and C
+ interfaces.
+ @see GFVXVIPPROPERTY, GFVxVIPGetProperty(), GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_CAP_TYPE_B 0x00000100
+
+/** VxAPI GFVXVIPPROPERTY::Flag flagbit: VIP can accept a JPEG bitstream from
+ a camera with type C interface.
+ See section @ref pageVxOverview2 for description of type A, B, and C
+ interfaces.
+ @see GFVXVIPPROPERTY, GFVxVIPGetProperty(), GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_CAP_TYPE_C 0x00000200
+
+/** VxAPI GFVXVIPPROPERTY::Flag flagbit: VIP can accept Bayer format input.
+ @version SC15 and above
+ @see GFVXVIPPROPERTY, GFVxVIPGetProperty(), GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_CAP_BAYER 0x00000400
+
+/** VxAPI GFVXVIPPROPERTY::Flag flagbit: VIP can accept RGB565 format input.
+ @version SC15 and above
+ @see GFVXVIPPROPERTY, GFVxVIPGetProperty(), GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_CAP_RGB565 0x00000800
+
+/** VxAPI GFVXVIPPROPERTY::Flag flagbit: VIP can accept RGB888 format input.
+ @version SC15 and above
+ @see GFVXVIPPROPERTY, GFVxVIPGetProperty(), GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_CAP_RGB888 0x00001000
+
+/** VxAPI GFVXVIPPROPERTY::Flag flagbit: VIP can accept RGB444 format input.
+ @version SC15 and above
+ @see GFVXVIPPROPERTY, GFVxVIPGetProperty(), GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_CAP_RGB444 0x00002000
+
+/** VxAPI GFVXVIPPROPERTY::Flag flagbit: VIP can accept YUV420NP format input.
+ @version SC15 and above
+ @see GFVXVIPPROPERTY, GFVxVIPGetProperty(), GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_CAP_YUV420NP 0x00004000
+
+/** VxAPI GFVXVIPPROPERTY::Flag flagbit: VIP can accept JPEG image from camera
+ through type C_RAW interface. See section @ref pageVxOverview2.
+ @version SC15 and above
+ @see GFVXVIPPROPERTY, GFVxVIPGetProperty(), GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_CAP_TYPE_C_RAW 0x00008000
+
+/** Structure used by GFVxVIPGetProperty() to describe VIP capabilities.
+ @see GFVxVIPGetProperty()
+*/
+typedef struct _GFVXVIPPROPERTY
+{
+ NvU32 Flag; /**< Flag bitmask describing VIP capabilities:
+
+ #GFVX_VIP_CAP_SHRINK
+ VIP supports image shrinking
+ #GFVX_VIP_CAP_ENLARGE
+ VIP supports image enlarging
+ #GFVX_VIP_CAP_PARALLEL
+ Parallel video input supported
+ #GFVX_VIP_CAP_SERIAL
+ Serial video input supported
+ #GFVX_VIP_CAP_RGB_VH_FLIP
+ Vertical and horizontal flip supported for VIP
+ output RGB image
+ #GFVX_VIP_CAP_OUTPUT_VCLOCK_VHSYNC
+ VIP can supply VClock and VHSync signals to the
+ camera chip
+ #GFVX_VIP_CAP_OUTPUT_MASTER_CLOCK
+ VIP can supply a master clock to the
+ camera chip
+ #GFVX_VIP_CAP_TYPE_A
+ VIP can accept a JPEG bitstream from a camera with
+ type A interface
+ #GFVX_VIP_CAP_TYPE_B
+ VIP can accept a JPEG bitstream from a camera with
+ type B interface
+ #GFVX_VIP_CAP_TYPE_C
+ VIP can accept a JPEG bitstream from a camera with
+ type C interface
+ #GFVX_VIP_CAP_BAYER
+ VIP can accept Bayer format input
+ #GFVX_VIP_CAP_RGB565
+ VIP can accept RGB565 format input
+ #GFVX_VIP_CAP_RGB888
+ VIP can accept RGB888 format input
+ #GFVX_VIP_CAP_RGB444
+ VIP can accept RGB444 format input
+ #GFVX_VIP_CAP_YUV420NP
+ VIP can accept YUV420NP format input
+ #GFVX_VIP_CAP_TYPE_C_RAW
+ VIP can accept JPEG image from Camera through
+ type C_RAW interface
+
+ */
+ NvU32 DestFormat;/**< Supported color formats at VIP output, the returned
+ value is a logically OR'ed combination of the
+ following surface identifiers:
+
+ #GF_SURFACE_YUYV
+ YUV422 in YUYV order
+ #GF_SURFACE_YVYU
+ YUV422 in YVYU order
+ #GF_SURFACE_UYVY
+ YUV422 in UYVY order
+ #GF_SURFACE_VYUY
+ YUV422 in VYUY order
+ #GF_SURFACE_RGB565
+ RGB565, 16 bpp
+ #GF_SURFACE_RGB888
+ RGB888, 24 bpp
+ #GF_SURFACE_ARGB8888
+ ARGB8888, 32 bpp
+
+ To check if a specific colour format is
+ supported, logically AND \a DestFormat against the
+ format identifier and compare it as below:
+
+ if ((DestFormat & GF_SURFACE_RGB565) == GF_SURFACE_RGB565)
+ {
+ // RGB565 is supported
+ }
+
+ */
+ NvU32 HMaxNumerator; /**< Maximum horizontal numerator for VI
+ decimation. VI decimation is configured via
+ GFVxVIPSetVIP(), GFVXVIPINFO::HNumerator's
+ valid value range is 1 to \a HMaxNumerator.
+ */
+ NvU32 HMaxDenominator; /**< Maximum horizontal denominator for VI
+ decimation. VI decimation is configured via
+ GFVxVIPSetVIP(), GFVXVIPINFO::HDenominator's
+ valid value range is 1 to \a HMaxDenominator.
+ */
+ NvU32 VMaxNumerator; /**< Maximum vertical numerator for VI decimation.
+ VI decimation is configured via
+ GFVxVIPSetVIP(), GFVXVIPINFO::VNumerator's
+ valid value range is 1 to \a VMaxNumerator.
+ */
+ NvU32 VMaxDenominator; /**< Maximum vertical denominator for VI decimation.
+ VI decimation is configured via
+ GFVxVIPSetVIP(), GFVXVIPINFO::VDenominator's
+ valid value range is 1 to \a VMaxDenominator.
+ */
+} GFVXVIPPROPERTY, *PGFVXVIPPROPERTY;
+
+
+/** Structure used to describe the input frame size if input data format is Bayer.
+ This structure is not used when input source is VIP.
+ @see
+*/
+typedef struct _GFVXBAYERINPUTFRAME
+{
+ NvU16 Width; /**< Host Input source width. */
+ NvU16 Height; /**< Host Input source height. */
+} GFVXBAYERINPUTFRAME, *PGFVXBAYERINPUTFRAME;
+
+/** Structure used to describe ISP scan size if input data format is Bayer.
+ Scan size is camera specific.
+
+ The application should populate this structure with
+ values filled by GFCameraSetup() in GFCAMERATABLETYPE::GFCAMERARESOLUTIONTYPE::pBayerInfo.
+ The application should also configure ISP with values in
+ GFCAMERATABLETYPE::GFCAMERARESOLUTIONTYPE::pBayerInfo::ScanWidth and
+ GFCAMERATABLETYPE::GFCAMERARESOLUTIONTYPE::pBayerInfo::ScanHeight.
+
+ This structure is used only when input source is VIP and input data format is Bayer.
+
+ @see GFISPIMGTIMING
+*/
+typedef struct _GFVXBAYERSCANSIZE
+{
+ NvU16 HScan; /**< VIP input signal horizontal scan size. */
+ NvU16 VScan; /**< VIP input signal vertical scan size. */
+} GFVXBAYERSCANSIZE, *PGFVXBAYERSCANSIZE;
+
+/** Structure used to describe ISP Active Area if input data format is Bayer.
+ Active Area is camera specific.
+
+ The application should populate this structure with
+ values filled by GFCameraSetup() in GFCAMERATABLETYPE::GFCAMERARESOLUTIONTYPE::pBayerInfo.
+ The application should also configure ISP with values in
+ GFCAMERATABLETYPE::GFCAMERARESOLUTIONTYPE::pBayerInfo::ActiveFrameStart,
+ GFCAMERATABLETYPE::GFCAMERARESOLUTIONTYPE::pBayerInfo::ActiveLineStart,
+ GFCAMERATABLETYPE::GFCAMERARESOLUTIONTYPE::pBayerInfo::ActiveFrameHeight and
+ GFCAMERATABLETYPE::GFCAMERARESOLUTIONTYPE::pBayerInfo::ActiveLineWidth.
+
+ Active Area rectangle should fall inside the Scan Size.
+ This structure is used only when input source is VIP and input data format is Bayer.
+
+ @see GFISPIMGTIMING
+*/
+typedef struct _GFVXBAYERACTIVEAREA
+{
+ NvU16 LineStart; /**< VIP input signal horizontal active offset. */
+ NvU16 FrameStart; /**< VIP input signal vertical active offset. */
+ NvU16 LineWidth; /**< VIP input signal horizontal active width. */
+ NvU16 FrameHeight; /**< VIP input signal vertical active height. */
+} GFVXBAYERACTIVEAREA, *PGFVXBAYERACTIVEAREA;
+
+/** Structure used to describe ISP Output Area if input data format is Bayer.
+
+ This structure is not used by VI. It is used to configure ISP.
+ Output Area rectangle can be equal to or less than Active Area rectangle.
+ This structure is used only when input source is VIP and input data format is Bayer.
+
+ @see GFISPIMGTIMING
+*/
+typedef struct _GFVXBAYEROUTPUTAREA
+{
+ NvU16 LineStart; /**< VIP input signal horizontal output offset. */
+ NvU16 FrameStart; /**< VIP input signal vertical output offset. */
+ NvU16 LineWidth; /**< VIP input signal horizontal output width. */
+ NvU16 FrameHeight; /**< VIP input signal vertical output height. */
+} GFVXBAYEROUTPUTAREA, *PGFVXBAYEROUTPUTAREA;
+
+
+/** Structure used to describe the rectangles needed by ISP to properly process Bayer input from camera.
+ This structure is used only when input source is VIP and input data format is Bayer.
+
+ @see GFVXBAYERINPUTFRAME, GFVXBAYERSCANSIZE, GFVXBAYERACTIVEAREA, GFVXBAYEROUTPUTAREA
+*/
+typedef struct _GFVXBAYERINFO
+{
+ PGFVXBAYERINPUTFRAME pInputFrameSize; /**< For VIP input, this field is not used.
+ */
+ PGFVXBAYERSCANSIZE pScanSize; /**< ISP Scan Size.
+ Scan size is camera specific. This field is set
+ by GFCameraAPI in GFCAMERARESOLUTIONTYPE::pBayerInfo.
+ */
+ PGFVXBAYERACTIVEAREA pActiveArea; /**< ISP Active Area.
+ Active Area is camera specific. This field is set
+ by GFCameraAPI in
+ GFCAMERATABLETYPE::GFCAMERARESOLUTIONTYPE::pBayerInfo.
+ Active Area rectangle should fall inside the Scan Size.
+ */
+ PGFVXBAYEROUTPUTAREA pOutputArea; /**< ISP Output Area. This field is not used by VI.
+ Output Area rectangle can be equal to or less than
+ Active Area rectangle.
+ */
+ NvU8 DemosaicKernelSize; /**< For VIP input, this field is not used.
+ */
+ NvU16 IspDownscaleUsed; /**< Use Isp downscale (Only for sc17 and above)
+ */
+} GFVXBAYERINFO, *PGFVXBAYERINFO;
+
+
+///////////Cindy: Following is CSI defination.
+
+/* flags optoins */
+
+/** Pixel Parser stream is from CSI A
+*/
+#define GFVX_CSI_SOURCE_CSI_A 0x00000001
+
+/** Pixel Parser stream is from CSI B
+*/
+#define GFVX_CSI_SOURCE_CSI_B 0x00000002
+
+/** Pixel Parser stream is from HOST
+*/
+#define GFVX_CSI_SOURCE_HOST 0x00000004
+
+/** Pixel Parser stream is from VIP
+*/
+#define GFVX_CSI_SOURCE_VIP 0x00000008
+
+/** Pixel Parser A enable
+*/
+#define GFVX_CSI_PPA_ENABLE 0x00000010
+
+/** Pixel Parser B enable
+*/
+#define GFVX_CSI_PPA_DISABLE 0x00000020
+
+//#define GFVX_CSI_PPA_MASK 0x00000030
+
+/** Pixel Parser A enable
+*/
+#define GFVX_CSI_PPB_ENABLE 0x00000040
+
+/** Pixel Parser B enable
+*/
+#define GFVX_CSI_PPB_DISABLE 0x00000080
+
+//#define GFVX_CSI_PPB_MASK 0x000000C0
+
+/** whether packet header is sent in the beginning of packet or not. payload only mode: no header
+*/
+#define GFVX_CSI_PACKET_HEADER_ENABLE 0x00000100
+
+/** Check data_type and Virtural_Channel_ID or not
+*/
+#define GFVX_CSI_DATA_IDENTIFIER_ENABLE 0x00000200
+
+/** check WordCount from header or register
+*/
+#define GFVX_CSI_WORD_COUNT_SELECT_HEADER 0x00000400
+
+/** check ECC from header
+*/
+#define GFVX_CSI_HEADER_EC_DISABLE 0x00000800
+
+/** pad short line with 0
+*/
+#define GFVX_CSI_LINE_PAD_NONE 0x00001000
+
+/** pad short line with 1
+*/
+#define GFVX_CSI_LINE_PAD_1 0x00002000
+
+/** pad short frame with 0
+*/
+#define GFVX_CSI_FRAME_PAD_NONE 0x00004000
+
+/** pad short frame with 1
+*/
+#define GFVX_CSI_FRAME_PAD_1 0x00008000
+
+/** 2 bytes CRC Check enable
+*/
+#define GFVX_CSI_CRC_CHECK 0x00010000
+
+/** Embedded data enable
+*/
+#define GFVX_CSI_EMBEDDED_DATA_ENABLE 0x00020000
+
+/** enable timeout checking
+*/
+#define GFVX_CSI_LINE_TIMEOUT_ENABLE 0x00040000
+
+#define GFVX_CSI_VSYNC_START_MARK_VSYNC 0x00080000
+
+#define GFVX_CSI_VI_HSYNC_CONTROL 0x00100000
+
+#define GFVX_CSI_VI_VSYNC_CONTROL 0x00200000
+
+
+typedef struct _GFVXCSISET
+{
+ NvU32 flags; /** flag options see above */
+ NvU32 HOffset; /**< VIP input signal horizontal offset. */
+ NvU32 HActive; /**< VIP input signal horizontal active width. */
+ NvU32 VOffset; /**< VIP input signal vertical offset. */
+ NvU32 VActive; /**< VIP input signal vertical active height.*/
+ NvU32 ColorFormat; /** convert to data type*/
+
+// PIXEL_STREAM_PPA_COMMAND:
+ NvU32 StartMarkerFrameMin; //CSI_PPA_START_MARKER_FRAME_MIN; /** comment */
+ NvU32 StartMarkerFrameMax; //CSI_PPA_START_MARKER_FRAME_MAX; /** comment */
+
+// PIXEL_STREAM_A_CONTROL0:
+ NvU32 VirtualChannelID; //CSI_PPA_VIRTUAL_CHANNEL_ID; /** stream virtual ID number */
+ NvU32 OutputFormatOpt; //CSI_PPA_OUTPUT_FORMAT_OPTIONS; /** output format */
+
+// PIXEL_STREAM_A_CONTROL1:
+ NvU32 TopFieldFrame; //CSI_PPA_TOP_FIELD_FRAME; /** camera spec */
+ NvU32 TopFieldFrameMask; //CSI_PPA_TOP_FIELD_FRAME_MASK; /** camera sepc */
+
+// PIXEL_STREAM_A_GAP:
+ NvU32 LineMinGap; //PPA_LINE_MIN_GAP; /** gap between lines */
+ NvU32 FrameMinGap; //PPA_FRAME_MIN_GAP; /** gat between frames */
+
+// PIXEL_STREAM_A_EXPECTED_FRAME:
+ NvU32 LineTimeOutMaxClock; //PPA_MAX_CLOCKS; /** line time out value */
+
+} GFVXCSISET, *PGFVXCSISET;
+
+/* CSI data types
+ *` Set by camera script to match
+ * stream supplied by camera
+ */
+
+#define GFVX_CSI_DATA_YUV420_8 (24UL)
+#define GFVX_CSI_DATA_YUV420_10 (25UL)
+#define GFVX_CSI_DATA_LEG_YUV420_8 (26UL)
+#define GFVX_CSI_DATA_YUV420CSPS_8 (28UL)
+#define GFVX_CSI_DATA_YUV420CSPS_10 (29UL)
+#define GFVX_CSI_DATA_YUV422_8 (30UL)
+#define GFVX_CSI_DATA_YUV422_10 (31UL)
+#define GFVX_CSI_DATA_RGB444 (32UL)
+#define GFVX_CSI_DATA_RGB555 (33UL)
+#define GFVX_CSI_DATA_RGB565 (34UL)
+#define GFVX_CSI_DATA_RGB666 (35UL)
+#define GFVX_CSI_DATA_RGB888 (36UL)
+#define GFVX_CSI_DATA_RAW6 (40UL)
+#define GFVX_CSI_DATA_RAW7 (41UL)
+#define GFVX_CSI_DATA_RAW8 (42UL)
+#define GFVX_CSI_DATA_RAW10 (43UL)
+#define GFVX_CSI_DATA_RAW12 (44UL)
+#define GFVX_CSI_DATA_RAW14 (45UL)
+#define GFVX_CSI_DATA_ARB_DT1 (48UL)
+#define GFVX_CSI_DATA_ARB_DT2 (49UL)
+#define GFVX_CSI_DATA_ARB_DT3 (50UL)
+#define GFVX_CSI_DATA_ARB_DT4 (51UL)
+
+
+/** OutputFormatOpt */
+#define GFVX_CSI_OUTPUT_FORMAT_OPTIONS_ARBITRARY (0UL)
+#define GFVX_CSI_OUTPUT_FORMAT_OPTIONS_PIXEL (1UL)
+#define GFVX_CSI_OUTPUT_FORMAT_OPTIONS_PIXEL_REP (2UL)
+#define GFVX_CSI_OUTPUT_FORMAT_OPTIONS_STORE (3UL)
+
+#define GFVX_INTERNAL_DEBUG 0x10000000
+
+// Below defines are used only when input source is HOST and input format is Bayer
+// Since this is not a valid customer use case, we will not add Doxygen comments to these defines
+
+// Minimum padding requirement for ISP
+#define MIN_SCANSIZE_WIDTH_DIFF 20
+#define MIN_SCANSIZE_HEIGHT_DIFF 10
+
+// The actual minimum padding has not been determined;
+// however, 30 padding on all sides is not enough for
+// Demosaic mode 4 (5X5BPNR) with M3 statistics gathering.
+// 35 on right + 15 on top/left/bottom seems to
+// work fine.
+#define MIN_ACTIVE_AREA_LEFT_PADDING 15
+#define MIN_ACTIVE_AREA_RIGHT_PADDING 35
+#define MIN_ACTIVE_AREA_TOP_PADDING 15
+#define MIN_ACTIVE_AREA_BOTTOM_PADDING 15
+
+// Active Rect must be a few pixels larger than Output Rect to avoid
+// a halo effect where the outer pixels are wrong.
+#define MIN_OUTPUT_AREA_PADDING_3X3 2
+#define MIN_OUTPUT_AREA_PADDING_5X5 3
+
+
+/** Parameter structure passed to GFVxVIPSetVIP().
+ @see GFVxVIPSetVIP()
+*/
+typedef struct _GFVXVIPINFO
+{
+ NvU32 Flag;
+ /**< Flag bitmask, OR'ed combination of:
+
+ #GFVX_VIP_PARALLEL_INPUT
+ 8-bit/clock video data
+ #GFVX_VIP_SERIAL_INPUT
+ Serial input
+ #GFVX_VIP_HVSYNC_IN_STREAM
+ VHSYNC and VVSYNC in the data stream
+ #GFVX_VIP_EXTERNAL_VHSYNC
+ Camera VHSYNC asserted by external signal
+ #GFVX_VIP_INTERNAL_VHSYNC
+ Camera VHSYNC generated by GoForce chip
+ #GFVX_VIP_EXTERNAL_VCLK
+ VCLK generated externally
+ #GFVX_VIP_INTERNAL_VCLK
+ VCLK generated by GoForce chip
+ #GFVX_VIP_DETECT_FIELD
+ Detect field 0 or 1, will not work for internal VHSYNC
+ (#GFVX_VIP_INTERNAL_VHSYNC)
+
+ #GFVX_VIP_RGB_H_FLIP
+ Horizontal flip
+ #GFVX_VIP_RGB_V_FLIP
+ Vertical flip
+ #GFVX_VIP_HOST_IMAGE
+ CPU feeds image to VIP
+ #GFVX_VIP_CHANGE_DEFAULT_TIMING
+ Change the default timing for VHSYNC and VCLK
+ #GFVX_VIP_ASK_FOR_MCLOCK
+ Camera master clock provided by GoForce chip
+ #GFVX_VIP_TYPE_A
+ VIP input type A interface
+ #GFVX_VIP_TYPE_B
+ VIP input type B interface
+ #GFVX_VIP_TYPE_C
+ VIP input type C interface
+ #GFVX_VIP_DEST_BYTE_SWAP
+ Enable destination byte swap for YUV/RGB data written to
+ preview surface
+
+ #GFVX_VIP_TYPE_C_RAW
+ Do not remove the 0xFF, 0x02 sequence when camera is
+ running at type C interface
+
+ #GFVX_VIP_VIP_ROTATE_0
+ VI output without rotation
+ #GFVX_VIP_VIP_ROTATE_90
+ VI output with 90 degree rotation
+ #GFVX_VIP_VIP_ROTATE_180
+ VI output with 180 degree rotation
+ #GFVX_VIP_VIP_ROTATE_270
+ VI output with 270 degree rotation
+ #GFVX_VIP_RGB565
+ RGB565 input to EPP
+ #GFVX_VIP_RGB888
+ RGB888 input to EPP
+ #GFVX_VIP_RGB444
+ RGB444 input to EPP
+ #GFVX_VIP_BYPASS_MCLOCK_PIN
+ Bypass any manipulation on internal master clock generation
+ output pin
+
+ #GFVX_VIP_BYPASS_NON_MCLOCK_PINS
+ Bypass any manipulation on VCLK, VHSYNC, and VID[7:0] pins
+
+ #GFVX_VIP_PRE_GENERATE_MCLOCK
+ Pre-generation of master clock
+
+ */
+ NvU32 HOffset; /**< VIP input signal horizontal offset. */
+ NvU32 HActive; /**< VIP input signal horizontal active width. */
+ NvU32 VOffset; /**< VIP input signal vertical offset. */
+ NvU32 VActive; /**< VIP input signal vertical active height. */
+ NvU32 ColorFormat; /**< VIP input color format identifier, see
+ GFRMSURFACE::ColorFormat.
+ */
+ NvU32 SerialDelay; /**< VIP serial input delay, reserved for future
+ use.
+ */
+ NvU32 NewTiming; /**< Flag bitmask configuring VIP input timing, used
+ only if flag #GFVX_VIP_CHANGE_DEFAULT_TIMING
+ set, OR'ed combination of:
+
+ #GFVX_VIP_PDL_FALLING_VCLK
+ Parallel data latched at falling edge
+ of VCLK (default is rising edge)
+
+ #GFVX_VIP_SDL_RISING_VCLK
+ Serial data lacthed at rising edge of
+ VCLK (default is falling edge)
+
+ #GFVX_VIP_VHSYNC_ACTIVE_LOW
+ VHSYNC active low (default is active
+ high)
+
+ #GFVX_VIP_VVSYNC_ACTIVE_LOW
+ VVSYNC active low (default is active
+ high)
+
+ #GFVX_VIP_VHSYNC_ACTIVE_EDGE_LEAD
+ VHSYNC active leading edge (default
+ is trailing edge)
+
+ #GFVX_VIP_VVSYNC_ACTIVE_EDGE_LEAD
+ VVSYNC active leading edge (default
+ is trailing edge)
+
+ #GFVX_VIP_SFRAME_ACTIVE_LOW
+ Serial video frame sync active low,
+ falling edge indicates start of data
+ frame (default is active high, rising
+ edge indicates start of data frame)
+
+ #GFVX_VIP_SFRAME_SIZE_16
+ Serial video input is 16 bit per frame
+ (default is 8 bit per frame)
+
+ #GFVX_VIP_FILED_0_BOTTOM
+ Field 0 is bottom/even field
+ (default is top/odd field)
+
+ #GFVX_VIP_VCLK_OUTPUT_ACTIVE_LOW
+ VCLK output from GoForce chip active
+ low (default is active high)
+
+
+ */
+ NvU32 HNumerator; /**< VI decimation horizontal numerator, number of
+ pixels to keep from a group of incoming
+ pixels.
+ */
+ NvU32 HDenominator;/**< VI decimation horizontal denominator, group
+ size.
+ */
+ NvU32 VNumerator; /**< VI decimation vertical numerator, number of
+ lines to keep from a group of incoming lines.
+ */
+ NvU32 VDenominator;/**< VI decimation vertical numerator, group
+ size.
+ */
+ NvU32 MClockFreq; /**< Master clock frequency supplied to camera from
+ GoForce chip, used only if
+ #GFVX_VIP_ASK_FOR_MCLOCK set.
+ */
+ NvU32 VClockFreq; /**< Clock frequency required for VIP input signal.
+ */
+
+ // Fill The following fields if GFVX_VIP_INTERNAL_VHSYNC is set in Flag
+ NvU32 VHPulseWidth; /**< VHSYNC pulse width in number of VCLK cycles,
+ valid range is 1 to 8. Used only if
+ #GFVX_VIP_INTERNAL_VHSYNC is set.
+ */
+ NvU32 VHPulsePeriod;/**< VHSYNC pulse period in number of VCLK cycles,
+ valid range 32 to 2048. Used only if
+ #GFVX_VIP_INTERNAL_VHSYNC is set.
+ */
+ NvU32 VVPulseWidth; /**< VVSYNC pulse width in number of VCLK cycles
+ valid range is 1 to 8. Used only if
+ #GFVX_VIP_INTERNAL_VHSYNC is set.
+ */
+ NvU32 VVPulsePeriod;/**< VVSYNC pulse period in number of VCLK
+ valid range 32 to 1024. Used only if
+ #GFVX_VIP_INTERNAL_VHSYNC is set.
+ */
+ NvU32 VVDelay; /**< Number of VCLK cycles from the leading edge
+ of VHSYNC to the leading edge of VVSYNC,
+ valid range is -2 to 13. Used only if
+ #GFVX_VIP_INTERNAL_VHSYNC is set.
+ */
+ PGFVXBAYERINFO pBayerInfo; /**< Structure used to describe the rectangles needed by ISP
+ to properly process Bayer input from camera. This
+ structure is used only when input source is VIP and
+ input data format is Bayer.
+ */
+ PGFVXCSISET pCSIInfo; /** Structure used to describe CSI stream info. Only used when input source is CSI stream
+ */
+} GFVXVIPINFO, *PGFVXVIPINFO;
+
+
+/** VxAPI GFVXVIPUPDATE::UpdateOption action: Start VIP data feeding.
+ @see GFVXVIPUPDATE, GFVxVIPUpdate()
+*/
+#define GFVX_VIP_START 0x00000001
+
+/** VxAPI GFVXVIPUPDATE::UpdateOption action: Stop VIP data feeding.
+ @see GFVXVIPUPDATE, GFVxVIPUpdate()
+*/
+#define GFVX_VIP_STOP 0x00000002
+
+/** VxAPI GFVXVIPUPDATE::UpdateOption action: Start VIP data feeding with
+ synchronized auto-display surface after a frame is captured from VIP.
+ If no output surface is set (GFVXVIPUPDATE::ppSurf is NULL), this action
+ behaves in the same way as #GFVX_VIP_START.
+ @see GFVXVIPUPDATE, GFVxVIPUpdate()
+*/
+#define GFVX_VIP_AUTO_FLIP (0x00000004 | GFVX_VIP_START)
+
+/** VxAPI GFVXVIPUPDATE::UpdateOption action: Start VIP data feeding with
+ synchronized auto-blit from VIP output surface to another surface.
+
+ Parameters for the blit have to be set up separately via GFVxBlt() with
+ flag #GFVX_AUTO_BLT. Auto-blit is triggered after a complete frame has
+ been captured from VIP.
+
+ If no output surface is set (GFVXVIPUPDATE::ppSurf is NULL), this action
+ behaves in the same way as #GFVX_VIP_START.
+
+ Once auto-blit has been enabled it can be disabled with GFVxVIPUpdate()
+ action identifier #GFVX_VIP_AUTO_TRIGER_BLT_OFF.
+
+ @see GFVXVIPUPDATE, GFVxVIPUpdate(), #GFVX_VIP_AUTO_TRIGER_BLT_OFF,
+ #GFVX_AUTO_BLT
+*/
+#define GFVX_VIP_AUTO_TRIGER_BLT (0x00000008 | GFVX_VIP_START)
+
+/** VxAPI GFVXVIPUPDATE::UpdateOption action: Stop auto-blit that has been
+ enabled earlier via #GFVX_VIP_AUTO_TRIGER_BLT.
+
+ Note that this action only disables auto-blit. It does not disable the
+ VIP data feed. If also VIP is to be disabled, GFVxVIPUpdate() has to be
+ called again with action #GFVX_VIP_STOP.
+
+ @see GFVXVIPUPDATE, GFVxVIPUpdate()
+*/
+#define GFVX_VIP_AUTO_TRIGER_BLT_OFF 0x00000010
+
+/** VxAPI GFVXVIPUPDATE::UpdateOption action: Start VIP data feeding with
+ synchronized auto-display surface after a frame is captured from VIP.
+ Second Overlay Window is used instead of first.
+ If no output surface is set (GFVXVIPUPDATE::ppSurf is NULL), this action
+ behaves in the same way as #GFVX_VIP_START.
+
+ @version SC15 and above only
+ @see GFVXVIPUPDATE, GFVxVIPUpdate()
+*/
+#define GFVX_VIP_AUTO_FLIP_OVERLAY2 (0x00000020 | GFVX_VIP_START)
+
+/** VxAPI GFVXVIPUPDATE::UpdateOption action: Capture one frame in VIP buffer
+ if it is combined with flag #GFVX_VIP_START
+
+ @version SC15 and above only
+ @see GFVXVIPUPDATE, GFVxVIPUpdate()
+*/
+#define GFVX_VIP_CAPTURE_ONE_FRAME 0x00000040
+
+/** VxAPI GFVXVIPUPDATE::UpdateOption action: Restart VIP without changes VI
+ state after stop VI
+
+ @version SC15 and above only
+ @see GFVXVIPUPDATE, GFVxVIPUpdate()
+*/
+#define GFVX_VIP_RESTART 0x00000080
+
+/** Parameter structure for GFVxVIPUpdate().
+ @see GFVxVIPUpdate()
+*/
+typedef struct _GFVXVIPUPDATE
+{
+ PGFRMSURFACE *ppSurf; /**< Pointer to an array of VIP output surfaces
+ pointers, or NULL to feed to MPEG/JPEG without
+ display.
+ */
+ NvU32 numofSurf; /**< Number of surface pointers in \a ppSurf, valid
+ range is 1 to 2.
+ */
+ NvU16 XStart; /**< Destination surface X position for the output
+ from VIP
+ */
+ NvU16 YStart; /**< Destination surface Y position for the output
+ from VIP
+ */
+ NvU32 UpdateOption;
+ /**< Action identifier, one of:
+
+ #GFVX_VIP_START
+ Start VIP data feeding
+ #GFVX_VIP_STOP
+ Stop VIP data feeding
+ #GFVX_VIP_AUTO_FLIP
+ Start VIP data feeding and enable
+ auto-display of the last VIP target
+ surface
+
+ #GFVX_VIP_AUTO_TRIGER_BLT
+ Start VIP data feeding and enable
+ auto-blit from the last target surface
+ to additional surfaces
+
+ #GFVX_VIP_AUTO_TRIGER_BLT_OFF
+ Disable auto-blit
+
+ */
+} GFVXVIPUPDATE, *PGFVXVIPUPDATE;
+
+/** VxAPI VxBlt operation modes.
+ Constants to specify SB mode for a call to GFVxBltSetCSCCoeff().
+ @see GFVxBltSetCSCCoeff(), GFVxBltGetCSCCoeff()
+*/
+typedef enum
+{
+ /** Host full frame stretchblt trigger */
+ GFVX_BLT_FULL_MODE,
+
+ /** Host partial frame stretchblt trigger */
+ GFVX_BLT_PARTIAL_MODE,
+
+ /** Auto stretchblt trigger from VI */
+ GFVX_BLT_AUTO_VI_MODE
+} GFVXBLTMODE;
+
+/** VxAPI component level interrupt operation types.
+ Constants to specify operation for a call to GFVxInterruptControl().
+ @see GFVX_INTERRUPT_TYPE, GFVxInterruptControl()
+*/
+typedef enum
+{
+ /** Enable interrupt/status assertion for an interrupt type. */
+ GFVX_INTERRUPT_ENABLE,
+
+ /** Disable interrupt/status assertion for an interrupt type. */
+ GFVX_INTERRUPT_DISABLE,
+
+ /** Clear interrupt/status assertion for an interrupt type. */
+ GFVX_INTERRUPT_CLEAR,
+
+ /** Query for interrupt/status assertion for an interrupt type. */
+ GFVX_INTERRUPT_QUERY_STATUS,
+
+ /** Set Y-FIFO threshold. */
+ GFVX_INTERRUPT_SET_Y_FIFO_THRESHOLD,
+
+ /** Get Y-FIFO threshold. */
+ GFVX_INTERRUPT_GET_Y_FIFO_THRESHOLD,
+
+ /** Set V-counter threshold. */
+ GFVX_INTERRUPT_SET_V_COUNTER_THRESHOLD,
+
+ /** Get V-counter threshold. */
+ GFVX_INTERRUPT_GET_V_COUNTER_THRESHOLD,
+
+ /** Get all bits of VI interrupt status register. */
+ GFVX_INTERRUPT_GET_ALL_STATUS,
+
+ /** Clear all VI interrupt status bits. */
+ GFVX_INTERRUPT_CLEAR_ON_ALL_STATUS
+
+} GFVX_INTERRUPT_OPERATION_TYPE;
+
+/** VxAPI interrupt types.
+ @see GFVX_INTERRUPT_OPERATION_TYPE, GFVxInterruptControl()
+*/
+typedef enum
+{
+ /** VID[8] pin rising edge interrupt. */
+ GFVX_VD8PIN_RISING_EDGE_INTR = 0x0100001,
+ /** VID[9] pin rising edge interrupt. */
+ GFVX_VD9PIN_RISING_EDGE_INTR = 0x0100002,
+ /** VID[10] pin rising edge interrupt. */
+ GFVX_VD10PIN_RISING_EDGE_INTR = 0x0100004,
+ /** VID[11] pin rising edge interrupt. */
+ GFVX_VD11PIN_RISING_EDGE_INTR = 0x0100008,
+ /** VGP[4] pin rising edge interrupt. */
+ GFVX_VGP4PIN_RISING_EDGE_INTR = 0x0100010,
+ /** VGP[5] pin rising edge interrupt. */
+ GFVX_VGP5PIN_RISING_EDGE_INTR = 0x0100020,
+ /** VGP[6] pin rising edge interrupt. */
+ GFVX_VGP6PIN_RISING_EDGE_INTR = 0x0100040,
+ /** VHSYNC pin rising edge interrupt. */
+ GFVX_VHSYNC_RISING_EDGE_INTR = 0x0100080,
+ /** VVSYNC pin rising edge interrupt. */
+ GFVX_VVSYNC_RISING_EDGE_INTR = 0x0100100,
+
+ /** Vertical counter threshold interrupt. */
+ GFVX_VERTICAL_COUNTER_THRESHOLD_INTR = 0x0000200,
+ /** Y-FIFO threshold int. */
+ GFVX_Y_FIFO_THRESHOLD_INTR = 0x0000400,
+ /** Buffer done first output interrupt. */
+ GFVX_BUFFER_FIRST_OUTPUT_INTR = 0x0000800,
+ /** Frame done first output interr upt. */
+ GFVX_FRAME_FIRST_OUTPUT_INTR = 0x0001000,
+ /** Buffer done second output interrupt. */
+ GFVX_BUFFER_SECOND_OUTPUT_INTR = 0x0002000,
+ /** Frame done second output interrupt. */
+ GFVX_FRAME_SECOND_OUTPUT_INTR = 0x0004000,
+ /** VI to EPP error interrupt. */
+ GFVX_EPP_ERROR_INTR = 0x0008000,
+ /** YUV420PA error interrupt. */
+ GFVX_YUV420PA_ERROR_INTR = 0x0010000,
+ /** First output peer stall interrupt. */
+ GFVX_FIRST_OUTPUT_PEER_STALL_INTR = 0x0020000,
+ /** Second output peer stall interrupt. */
+ GFVX_SECOND_OUTPUT_PEER_STALL_INTR = 0x0040000,
+ /** DMA stall interrupt. */
+ GFVX_DMA_STALL_INTR = 0x0080000,
+
+
+ /** VD[8] pin falling edge interrupt. */
+ GFVX_VD8PIN_FALLING_EDGE_INTR = 0x0000001,
+ /** VD[9] pin falling edge interrupt. */
+ GFVX_VD9PIN_FALLING_EDGE_INTR = 0x0000002,
+ /** VD[10] pin falling edge interrupt. */
+ GFVX_VD10PIN_FALLING_EDGE_INTR = 0x0000004,
+ /** VD[11] pin falling edge interrupt. */
+ GFVX_VD11PIN_FALLING_EDGE_INTR = 0x0000008,
+ /** VGP[4] pin falling edge interrupt. */
+ GFVX_VGP4PIN_FALLING_EDGE_INTR = 0x0000010,
+ /** VGP[5] pin falling edge interrupt. */
+ GFVX_VGP5PIN_FALLING_EDGE_INTR = 0x0000020,
+ /** VGP[6] pin falling edge interrupt. */
+ GFVX_VGP6PIN_FALLING_EDGE_INTR = 0x0000040,
+ /** VHSYNC pin falling edge interrupt. */
+ GFVX_VHSYNC_FALLING_EDGE_INTR = 0x0000080,
+ /** VVSYNC pin falling edge interrupt. */
+ GFVX_VVSYNC_FALLING_EDGE_INTR = 0x0000100,
+
+ /** VD[8] pin rising edge interrupt. */
+ GFVX_VD8PIN_RISING_LEVEL_INTR = 0x1100001,
+ /** VD[9] pin rising edge interrupt. */
+ GFVX_VD9PIN_RISING_LEVEL_INTR = 0x1100002,
+ /** VD[10] pin rising edge interrupt. */
+ GFVX_VD10PIN_RISING_LEVEL_INTR = 0x1100004,
+ /** VD[11] pin rising edge interrupt. */
+ GFVX_VD11PIN_RISING_LEVEL_INTR = 0x1100008,
+ /** VGP[4] pin rising edge interrupt. */
+ GFVX_VGP4PIN_RISING_LEVEL_INTR = 0x1100010,
+ /** VGP[5] pin rising edge interrupt. */
+ GFVX_VGP5PIN_RISING_LEVEL_INTR = 0x1100020,
+ /** VGP[6] pin rising edge interrupt. */
+ GFVX_VGP6PIN_RISING_LEVEL_INTR = 0x1100040,
+ /** VHSYNC pin rising edge interrupt. */
+ GFVX_VHSYNC_RISING_LEVEL_INTR = 0x1100080,
+ /** VVSYNC pin rising edge interrupt. */
+ GFVX_VVSYNC_RISING_LEVEL_INTR = 0x1100100,
+
+ /** VD[8] pin falling level interrupt. */
+ GFVX_VD8PIN_FALLING_LEVEL_INTR = 0x1000001,
+ /** VD[9] pin falling level interrupt. */
+ GFVX_VD9PIN_FALLING_LEVEL_INTR = 0x1000002,
+ /** VD[10] pin falling level interrupt. */
+ GFVX_VD10PIN_FALLING_LEVEL_INTR = 0x1000004,
+ /** VD[11] pin falling level interrupt. */
+ GFVX_VD11PIN_FALLING_LEVEL_INTR = 0x1000008,
+ /** VGP[4] pin falling level interrupt. */
+ GFVX_VGP4PIN_FALLING_LEVEL_INTR = 0x1000010,
+ /** VGP[5] pin falling level interrupt. */
+ GFVX_VGP5PIN_FALLING_LEVEL_INTR = 0x1000020,
+ /** VGP[6] pin falling level interrupt. */
+ GFVX_VGP6PIN_FALLING_LEVEL_INTR = 0x1000040,
+ /** VHSYNC pin falling level interrupt. */
+ GFVX_VHSYNC_FALLING_LEVEL_INTR = 0x1000080,
+ /** VVSYNC pin falling level interrupt. */
+ GFVX_VVSYNC_FALLING_LEVEL_INTR = 0x1000100
+
+} GFVX_INTERRUPT_TYPE;
+
+/** VxAPI related attributes.
+ @see GFVxGetAttribute()
+*/
+typedef enum _GFVXATTRIBUTES
+{
+ /** VxAPI attribute: Video input interrupt status.
+ Use this attribute with GFVxGetAttribute() to read the current video
+ input interrupt status.
+
+ Interpretation of associated attribute value:
+
+ NvU32 Bitmask with interrupt status
+ For bitpositions see the VI status register in the GoForce
+ technical manual (Register VI11 on SC12)
+
+
+ Attribute is get only.
+
+ @see GFVxGetAttribute()
+ */
+ GFVX_ATTR_VIDEO_BUF,
+
+ /** VxAPI attribute: Video VIP input status.
+ Use this attribute with GFVxGetAttribute() to read the current number
+ of frames received
+ */
+
+ GFVX_ATTR_VIP_INPUT_FRAME_COUNT,
+
+ /** VxAPI attribute: Video VIP input status.
+ Use this attribute with GFVxGetAttribute() to read the current number
+ of lines received
+ */
+
+ GFVX_ATTR_VIP_INPUT_LINE_COUNT,
+
+} GFVXATTRIBUTES;
+
+/** YUV Color Space Conversion (CSC) coefficients.
+ Parameter structure for GFVxVIPSetCSCCoeff(), GFVxBltSetCSCCoeff(),
+ GFVxVIPGetCSCCoeff(), and GFVxBltGetCSCCoeff()
+
+ YUV color space conversion is used when converting from a YUV formatted
+ surface to RGB formatted surface. The YUV color space conversion formular
+ appears as follows:
+
+ R = sat(KYRGB*(Y + YOF) + KUR*U + KVR*V)
+ G = sat(KYRGB*(Y + YOF) + KUG*U + KVG*V)
+ B = sat(KYRGB*(Y + YOF) + KUB*U + KVB*V)
+
+ By default, the YUV color space conversion coefficients are:
+
+ KYRGB, KUR, KVR 1.1644 0.0000 1.5960
+ KYRGB, KUG, KVG = 1.1644 -0.3918 -0.8130
+ KYRGB, KUB, KVB 1.1644 2.0172 0.0000
+
+ and YOF = -16.0000
+
+ The value corresponding to each of these YUV color space conversion
+ coefficients is a Q16 (signed 15.16 fixed point value).
+
+ For examples:
+ YOF = -16.0000, the value corresponding is 0xFFF00000
+ KYRGB = 1.1644, the value corresponding is 0x00012A16
+ KVR = 1.5960, the value corresponding is 0x00019893
+ KUG = -0.3918, the value corresponding is 0xFFFF9BB3
+ KVG = -0.8130, the value corresponding is 0xFFFF2FE0
+ KUB = 2.0172, the value corresponding is 0x00020467
+*/
+typedef struct _GFVXCSCCOEF
+{
+ NvU32 YOF;
+ NvU32 KYRGB;
+ NvU32 KUR;
+ NvU32 KVR;
+ NvU32 KUG;
+ NvU32 KVG;
+ NvU32 KUB;
+ NvU32 KVB;
+} GFVXCSCCOEF;
+
+
+// Typesafe functions for opening and closing this component
+GF_RETTYPE GFVxOpen(GFRmHandle hRm, GFVxHandle *phVx,
+ GF_STATE_TYPE state, GFRmChHandle hCh);
+void GFVxClose(GFVxHandle *phVx);
+
+/** @name Functions
+@{*/
+
+/** This function returns version and capabilities of API and hardware.
+
+ @param VxHandle (#GFVxHandle) Handle to VxAPI
+ @param pVXProp (#PGFPROPERTY) Pointer to property structure to be
+ filled in
+
+ @retval #GF_SUCCESS \a pJXProp filled in successfully
+ @retval #GF_ERROR Some error occured
+
+ This function returns information about the VxAPI, including the following:
+ - VxAPI module version
+ - VIP support
+ - Overlay support
+ - MPEG decoding and encoding
+ - JPEG decoding and encoding
+
+ The #GFPROPERTY structure passed with parameter \a pVXProp will be
+ filled in on successfull return. The #GFPROPERTY::Capability field
+ will hold a combination of flagbits indicating capabilities specific
+ to the VxAPI:
+
+
+ #GFVX_CAP_CSC Color space conversion supported
+ #GFVX_CAP_VIP VIP functions available
+ #GFVX_CAP_ENLARGE Enlarge source image supported
+ #GFVX_CAP_SHRINK Shrink source image supported
+ #GFVX_CAP_COLOR_CONTROL Color control supported
+ #GFVX_CAP_OVERLAY Overlay supported
+ #GFVX_CAP_MPEGDEC MPEG4 decoder supported
+ #GFVX_CAP_MPEGENC MPEG4 encoder supported
+ #GFVX_CAP_JPEGDEC JPEG decoder supported
+ #GFVX_CAP_JPEGENC JPEG encoder supported
+ #GFVX_CAP_ALPHA_BLEND Alpha blending supported
+ #GFVX_CAP_EXTEND_RGB
+ Extended RGB format 32 bpp supported
+ #GFVX_CAP_OVERLAY_YUV YUV overlay supported
+ #GFVX_CAP_OVERLAY_SCALE Overlay with scaling supported
+ #GFVX_CAP_OVERLAY_MULTIPLE Multiple overlay supported
+
+ #GFVX_CAP_ENCODE_TYPE
+ Variable sized data camera interface (Type A/B/C) supported
+
+
+
+ It is a good practice to call this function to query for the API version
+ and its capabilities before using the rest of the JxDecAPI functions.
+
+ @see GFPROPERTY
+*/
+GF_RETTYPE GFVxGetProperty(GFVxHandle VxHandle, PGFPROPERTY pVvProp);
+
+/** Stretch-blit rectangular area from source to destination surface.
+
+ @param VxHandle (#GFVxHandle) Handle to VxAPI
+ @param pBlt (#PGFVXBLT) Pointer to #GFVXBLT structure
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ This function copies a rectangular area from a source surface to a
+ rectangle in the destination surface. If source and destination
+ rectangles differ in size, the GPU's stretch blit (SB) unit scales the
+ source data to fit the destination rectangle. If the source and destination
+ surfaces have different color formats, GFVxBlt() provides limited color
+ format conversions.
+
+ Source and Destination surfaces have to be in GPU memory. Source surfaces
+ can be in YUV420, YUV422, or RGB565 format. Destination surfaces can be
+ in RGB565, RGB888 (SC12), or ARGB8888 (SC12 SC15) format. YUV output can also
+ be routed to EPP for encoding.
+
+ Color format conversions from a YUV420 or YUV422 source are supported for these
+ destination formats:
+ - RGB565
+ - ARGB8888 (SC12 SC15)
+ - RGB888 (SC12)
+
+ A #GFVXBLT control structure is passed with parameter \a pBlt.
+ GFVXBLT::ppDestSurf points to an array of destination surface pointers,
+ with the number of pointers in this array specified by
+ GFVXBLT::numofDestSurf. GFVXBLT::ppSrcSurf points to an array of source
+ surface pointers, with the size of this array specified by
+ GFVXBLT::numofSrcSurf.
+
+ When the destination surface pointer is NULL, output of SB goes
+ to EPP for encoding.
+
+ See #GFVXBLT for minimum and maximum specifications of source and destination
+ rectangle sizes.
+
+ Instant Blit Mode
+
+ In this mode of operation, the blit is executed immediately via the command
+ FIFO. It is always performed from the first surface in GFVXBLT::ppSrcSurf
+ to the first surface in GFVXBLT::ppDestSurf. Other pointers in these
+ arrays are ignored.
+
+ Auto Blit Mode
+
+ VxBlt() can be used to enable auto-blit mode (flag #GFVX_AUTO_BLT
+ in GFVXBLT::BltOption). Whenever the end of a frame coming from VIP is
+ reached, SB will be fired automatically with the parameters set in GFVXBLT.
+ Auto-blit mode remains set until it is reset by another auto-blit command.
+ During auto-blit mode, manual SB commands should save and restore SB
+ registers (SC12 and below). This is not required for SC15 and above because
+ they have three hardware contexts: one for auto-blit, one for host trigger
+ (manual SB commands) and one for host partial trigger.
+
+ The first time auto-blit is fired, the first surface in GFVXBLT::ppSrcSurf
+ is copied to the first surface in GFVXBLT::ppDestSurf. In subsequent blits,
+ the source and destination arrays are walked through subsequently. If
+ there is only one surface in the GFVXBLT::ppSrcSurf or GFVXBLT::ppDestSurf
+ arrays, only this one is used.
+
+ Note that VxBlt() only sets auto-blit parameters. It is actually enabled by
+ GFVxVIPUpdate() using action #GFVX_VIP_AUTO_TRIGER_BLT, or GFMxDecSetMBs().
+
+ Auto Display
+
+ If auto-display (#GFVX_AUTO_DISPLAY or #GFVX_AUTO_DISPLAY_OVERLAY2) is on,
+ GFVxBlt() automatically shows the destination surface on the screen.
+ The application does not need to call GFVxFlip() to show the surface.
+ Auto-display can be combined with both auto-blit and instant-blit modes.
+
+ Color Keying
+
+ If source color keying (#GFVX_BLT_SRC_KEY) is set, all pixels from the
+ source surface matching GFVXBLT::colorKey are transparent (not copied).
+
+ VSync Synchronisation
+
+ By default all blits are synchronized to display VSync. Note that blits
+ may block, if the display is disabled. Flag #GFVX_BLT_DISABLE_WAIT_VSYNC
+ can be used to disable VSync synchronisation.
+
+ @see GFVXBLT
+*/
+GF_RETTYPE GFVxBlt(GFVxHandle VxHandle, PGFVXBLT pBlt);
+
+/** Activate surface for display.
+
+ @param VxHandle (#GFVxHandle) Handle to VxAPI
+ @param pFlip (#PGFVXFLIP) Pointer to #GFVXFLIP structure
+
+ @retval #GF_SUCCESS Success
+ @retval GFVX_ERROR_COLORFORMAT_NOT_SUPPORTED If ColorFormat is unsupported
+
+ This function changes the display buffer address from one surface to
+ another.
+
+ This function displays #GFVXFLIP::pForeGroundSurf. If
+ GFVXFLIP::pForeGroundSurf is an overlay surface, this function displays
+ that surface to the destination rectangle that has been set by
+ GFVxUpdateOverlay().
+
+ If GFVXFLIP::pForeGroundSurf is not an overlay surface, this function
+ displays the entire surface. In this case GFVxFlip() can show either the
+ primary surface or an offscreen surface on the display screen.
+
+ If there is only one surface for primary or overlay, GFVxFlip() should not
+ be called.
+
+ @see GFVXFLIP
+*/
+GF_RETTYPE GFVxFlip(GFVxHandle VxHandle, PGFVXFLIP pFlip);
+
+/** Configure properties of overlay (WinB) display.
+
+ @param VxHandle (#GFVxHandle) Handle to VxAPI
+ @param pOverlay (#PGFVXUPDATEOVERLAY) Pointer to #GFVXUPDATEOVERLAY structure
+
+ @retval #GF_SUCCESS Success
+ @retval GFVX_ERROR_SURFACETYPE_NOT_SUPPORTED If Source SurfaceType is unsupported
+ @retval GFVX_ERROR_COLORFORMAT_NOT_SUPPORTED If Source ColorFormat is unsupported
+ @retval GFVX_ERROR_ILLEGAL_ALPHA_VALUE If Alpha Value is incorrect
+
+ This function controls overlay (WinB) display, setting the following
+ features:
+ - Destination and source rectangle areas
+ - Rotation for overlay surface
+ - Color keying
+ - Alphablending Color Key (GoForce 4800 and above)
+ - Foreground and Background alpha values. (GoForce 4800 and above)
+ - Destination surface color format (RGB888, ARGB8888 for GoForce 4800 and
+ above)
+
+ SC15 supports the following overlay surface orientations - 0 degree rotated,
+ 180 degree rotated, horizont flip, vertical flip. Overlay surface orientation
+ is always relative to the orientaton of primary surface. For eg. if primary
+ surface is 180 degree rotated and requested overlay surface orientation is
+ 0 degree rotated, then overlay surface will be 180 degree rotated.
+
+ This function supports the following source surface type - GF_SURFACE_OVERLAY.
+ It supports the following source surface colorformats - RGB565, ARGB8888, ARGB1555,
+ ARGB4444.
+
+ In order to work around a hardware bug in SC12, in which the GC displays
+ pixels at the end of the line that are 64 pixels back from the end of
+ the line, the overlay window width will be aligned to 4-pixels.
+
+ If GFVXUPDATEOVERLAY::pSrcSurf is NULL then overlay display is disabled.
+
+ This function will have no effect, if the GoForce media processor version
+ does not support overlays. This can be checked via the #GFVX_CAP_OVERLAY
+ attribute with GFVxGetProperty().
+
+ Color Keying
+
+ With color keying pixels from the overlay surface can be masked (made
+ transparent). It can be enabled in different modes of operation by setting
+ one of the following flags in GFVXUPDATEOVERLAY::UpdateOption:
+ - #GFVX_UO_SRC_COLOR_KEY
+ - #GFVX_UO_DEST_COLOR_KEY
+
+ The color key is passed in GFVXUPDATEOVERLAY::ColorKey. Refer to the flags'
+ documentation for details on modes of operation.
+
+ An exotic color which does not conflict with other colors of a use-case
+ should be selected as the color key. Color keying for overlay display is
+ processed on the fly, no pixels in the surfaces are overwritten.
+
+ If destination is in 1-bit alpha format (eg ARGB1555), application can
+ use two additional flags - #GFVX_UO_COLOR_KEY_ALPHA_ONLY and
+ #GFVX_UO_COLOR_KEY_ALPHA_COLOR. Refer to the flags'
+ documentation for details on modes of operation.
+
+ Alpha Blending
+
+ Overlay display with alpha blending can be enabled by setting
+ flag #GFVX_UO_ALPHA_BLENDING.
+
+ Setting flag #GFVX_UO_ALPHA_BLENDING lets the overlay surface to appear
+ blended with the destination surface using the alpha value passed in
+ GFVXUPDATEOVERLAY::AlphaValue. Refer to the flags' documentation for details
+ on how to define AlphaVal.
+
+ If destination is in 1-bit alpha format (eg ARGB1555), application can
+ use two additional flags - #GFVX_UO_BLD_COLOR_KEY_ALPHA_ONLY and
+ #GFVX_UO_BLD_COLOR_KEY_ALPHA_COLOR. Refer to the flags'
+ documentation for details on modes of operation.
+
+ Just like overlay colorkey, an exotic color which does not conflict with
+ other colors of a use-case should be selected as the blending color key.
+ Blending is processed on the fly, no pixels in the surfaces are overwritten.
+
+ If #GFVX_UO_DEST_COLOR_KEY is set, alpha blending enabled, and the
+ destination pixel color matches BlendingColorKey, the following equation
+ is used to generate the final pixel:
+
+ src * AlphaValue + dest * (1-AlphaValue)
+
+ Otherwise, the original pixel is not updated.
+
+ Alpha blending is supported only on GoForce 4800 and above.
+
+ SC15 supports alphablending with the following restriction - You cannot alpha-match
+ (alpha-blend) in non-key-match areas, at the same time you alpha-blend in key-match areas.
+ In other words, the following flag combinations will not work -
+
+ #GFVX_UO_DEST_COLOR_KEY|#GFVX_UO_ALPHA_BLENDING|#GFVX_UO_BLD_COLOR_KEY_ALPHA_ONLY
+ #GFVX_UO_DEST_COLOR_KEY|#GFVX_UO_COLOR_KEY_ALPHA_COLOR|#GFVX_UO_ALPHA_BLENDING|#GFVX_UO_BLD_COLOR_KEY_ALPHA_ONLY
+ #GFVX_UO_DEST_COLOR_KEY|#GFVX_UO_COLOR_KEY_ALPHA_ONLY|#GFVX_UO_ALPHA_BLENDING
+ #GFVX_UO_DEST_COLOR_KEY|#GFVX_UO_COLOR_KEY_ALPHA_ONLY|#GFVX_UO_ALPHA_BLENDING|#GFVX_UO_BLD_COLOR_KEY_ALPHA_COLOR
+
+ @see GFVXUPDATEOVERLAY
+*/
+GF_RETTYPE GFVxUpdateOverlay(GFVxHandle VxHandle,
+ PGFVXUPDATEOVERLAY pOverlay);
+
+/** Feed image data from host to VIP.
+
+ @param VxHandle (#GFVxHandle) Handle to VxAPI
+ @param pImage (#PGFVXVIPFEEDIMAGE) Pointer to #GFVXVIPFEEDIMAGE parameter
+ structure
+
+ @retval #GF_SUCCESS Success
+ @retval GFVX_ERROR_COLORFORMAT_NOT_SUPPORTED If Source ColorFormat is unsupported
+
+ This function feeds an image from the CPU host via the VI source FIFO to
+ the VIP. It supports YUV420, YUV422 (YUYV, YVYU, UYVY, VYUY), YUV422 planar and
+ Bayer (8, 12) formats.
+
+ For an YUV420 image, it feeds Y-Fifo, U-Fifo, V-Fifo interleaved at 32 bit.
+ For an YUV422 image, it feeds the Y-Fifo only.
+
+ This function is intended to be used for feeding YUV data to the JPEG
+ encoder, or for feeding input for VIP preview display (GFVxVIPSetVIP()
+ and GFVxVIPUpdate()). YUV data for MPEG encoding is fed with
+ GFMxEncFeedImage().
+
+ Parameter \a pImage passes a surface containing source image data and an
+ optional source clipping rectangle. Surface data has to reside in memory
+ accessible by the host CPU, e.g. a surface allocated as type
+ #GF_SURFACE_SYSTEM_MEMORY.
+
+ @see GFVXVIPFEEDIMAGE, GFVX_VIP_HOST_IMAGE
+*/
+GF_RETTYPE GFVxVIPFeedImage(GFVxHandle VxHandle,
+ PGFVXVIPFEEDIMAGE pImage);
+
+/** Setup partial feed image data from host to VIP.
+
+ @param VxHandle (#GFVxHandle) Handle to VxAPI
+ @param colorFormat Color format of feed image surface
+ @param width Width of feed image
+ @param height Height of feed image
+
+ @retval #GF_SUCCESS Success
+ @retval GFVX_ERROR_ILLEGAL_PARAMETER If width and height values are incorrect
+ @retval GFVX_ERROR_COLORFORMAT_NOT_SUPPORTED If color format of feed image surface is unsupported
+
+ This function setups partial feed image from the CPU host via the VI source FIFO to
+ the VIP. It supports YUV420, YUV422 (YUYV, YVYU, UYVY, VYUY), YUV422 planar formats.
+ The partial image data is fed with
+ GFVxVIPPartialFeedImage().
+
+ @see GFVxVIPPartialFeedImage, GFVX_VIP_HOST_IMAGE
+*/
+GF_RETTYPE GFVxVIPPartialFeedImageSetup(GFVxHandle VxHandle,
+ NvU32 colorFormat,
+ NvU32 width,
+ NvU32 height);
+
+/** Feed partial image data from host to VIP.
+
+ @param VxHandle (#GFVxHandle) Handle to VxAPI
+ @param pSrcSurf Pointer to source feed image surface
+ @param pSrcRect Pointer to a clip rectangle from source feed image surface
+
+ @retval #GF_SUCCESS Success
+ @retval GFVX_ERROR_ILLEGAL_PARAMETER If pSrcSurf is NULL
+
+ This function feeds a partial image from the CPU host via the VI source FIFO to
+ the VIP. It supports YUV420, YUV422 (YUYV, YVYU, UYVY, VYUY), YUV422 planar formats.
+
+ For an YUV420 image, it feeds Y-Fifo, U-Fifo, V-Fifo interleaved at 32 bit.
+ For an YUV422 image, it feeds the Y-Fifo only.
+
+ This function is intended to be used for feeding partial YUV data to the JPEG
+ encoder, or for feeding partial input for VIP preview display (GFVxVIPSetVIP()
+ and GFVxVIPUpdate()). YUV data for MPEG encoding is fed with
+ GFMxEncFeedImage().
+
+ Parameter \a pSrcRect is an optional source clipping rectangle.
+ Surface data has to reside in memory accessible by the host CPU,
+ e.g. a surface allocated as type
+ #GF_SURFACE_SYSTEM_MEMORY.
+*/
+GF_RETTYPE GFVxVIPPartialFeedImage(GFVxHandle VxHandle,
+ PGFRMSURFACE pSrcSurf,
+ PGFRECT pSrcRect);
+
+/** Put video unit into sleep mode.
+ @param VxHandle (#GFVxHandle) Handle to VxAPI
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ @note Not implemented by default, this function is intended to be
+ implemented only in GFSDK ports to platforms that are in need of
+ this feature.
+
+ @see GFVxWakeup()
+*/
+GF_RETTYPE GFVxSleep(GFVxHandle VxHandle);
+
+/** Wake up video unit from sleep mode.
+ @param VxHandle (#GFVxHandle) Handle to VxAPI
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ @note Not implemented by default, this function is intended to be
+ implemented only in GFSDK ports to platforms that are in need of
+ this feature.
+
+ @see GFVxSleep()
+*/
+GF_RETTYPE GFVxWakeup(GFVxHandle VxHandle);
+
+/** This function enumerates capabilities of the Video Input Port (VIP).
+
+ @param VxHandle (#GFVxHandle) Handle to VxAPI
+ @param pVIPProp (#PGFVXVIPPROPERTY) Pointer to #GFVXVIPPROPERTY structure
+ to be filled in
+
+ @retval #GF_SUCCESS \a pVIPProp filled in successfully
+ @retval #GF_ERROR Some error occured
+
+ The #GFPROPERTY structure passed with parameter \a pVIPProp will be
+ filled in on successfull return.
+
+ The following GoForce VIP features are described by this function:
+ - Image decimation (scaling) limits
+ - Image flipping
+ - Video input interface type
+
+ Parameters that are passed with a #GFVXVIPINFO structure to GFVxVIPSetVIP()
+ must be within the limits returned by this function.
+
+ @see GFVXVIPPROPERTY, GFVxVIPSetVIP(), GFVXVIPINFO
+*/
+GF_RETTYPE GFVxVIPGetProperty(GFVxHandle VxHandle,
+ PGFVXVIPPROPERTY pVIPProp);
+
+/** Configure video input to VIP.
+
+ @param VxHandle (#GFVxHandle) Handle to VxAPI
+ @param pVIPInfo (#PGFVXVIPINFO) Pointer to GFVXVIPINFO parameter structure
+
+ @retval #GF_SUCCESS Success
+ @retval GFVX_ERROR_ILLEGAL_BAYER_VALUES If values in BayerInfo structure are incorrect
+ @retval GFVX_ERROR_COLORFORMAT_NOT_SUPPORTED If Source ColorFormat is unsupported
+
+ The following VIP properties can be configured using this function, see
+ #GFVXVIPINFO for details:
+ - Data source and format (CPU host or video input)
+ - VIP input cropping rectangle
+ - Image decimation
+ - Input (camera) color format
+
+ After configuring video input, the flow of data has to be explicitly
+ enabled with GFVxVIPUpdate().
+
+ See GFVxVIPGetProperty() for how to test for VIP capabilities at runtime.
+
+ This function returns GFVX_ERROR_COLORFORMAT_NOT_SUPPORTED error if color format
+ is not supported. Supported color formats for HOST input are - YUV422, YUV422 Planar,
+ YUV420 and Bayer (8 and 12). YUV420 is not supported if input source is VIP.
+
+ @see GFVXVIPINFO, GFVxVIPUpdate(), GFVxVIPGetProperty()
+*/
+GF_RETTYPE GFVxVIPSetVIP(GFVxHandle VxHandle,
+ PGFVXVIPINFO pVIPInfo);
+
+/** Enable or disable video feeding through VIP.
+
+ @param VxHandle (#GFVxHandle) Handle to VxAPI
+ @param pUpdate (#GFVXVIPUPDATE) Pointer to a #GFVXVIPUPDATE structure
+
+ @retval #GF_SUCCESS Success
+ @retval GFVX_ERROR_COLORFORMAT_NOT_SUPPORTED If Source ColorFormat is unsupported
+
+ This function enables or disables data feeding through VIP after it has
+ been configured with GFVxVIPSetVIP().
+
+ The action to be performed by this function is defined by the action
+ identifier passed in GFVXVIPUPDATE::UpdateOption of parameter \a pUpdate.
+
+ #GFVX_VIP_START
+
+ Enable VIP data feeding
+
+ The structure passed via \a pUpdate controls the output of the VIP, setting
+ the following parameters:
+ - Destination surface(s) (single or double buffered)
+ - Top-left corner the output video is written to the destination surfaces
+
+ GFVXVIPUPDATE::ppSurf passes an array of 1 or 2 destination surfaces to
+ capture the incoming video stream. If 2 surfaces are passed, the VIP target
+ surface is flipped after each frame of VIP input if #GFVX_VIP_AUTO_FLIP or
+ #GFVX_VIP_AUTO_FLIP_OVERLAY2 flag is specified.
+
+ Color space conversion (CSC) is performed depending on the output surface
+ color formats:
+ - #GF_SURFACE_RGB565 (16 bpp): VI CSC is used.
+ - #GF_SURFACE_ARGB8888 (32 bpp): VI CSC is used, only available for SC12
+ and above
+ - #GF_SURFACE_YUV422: (32 bits per two pixels): No CSC is used, data from
+ the VIP is stored as is in memory
+ - any other format is considered to be YUV422, and the data is stored as is
+
+ If GFVXVIPUPDATE::ppSurf is NULL, data flow through the VIP is still enabled.
+ Data from the VIP is not written to target surfaces, but is is fed to the
+ MPEG or JPEG encoder pre-processor. This mode of operation is useful for the
+ following two cases:
+ - There is not enough memory for JPEG encoding. The application could turn
+ off the screen, enable this mode, and let the JPEG encoder utilize screen
+ memory (the primary surface).
+ - In single-shot mode, the application does not want to display the video
+ image on the screen after enabling the JPEG encoder, thus allowing faster
+ captures and power savings, and freeing bandwidth. After the image is
+ captured, the application enables the JPEG decoder to decode the captured
+ image and shows it on the screen.
+
+
+ #GFVX_VIP_AUTO_FLIP
+
+ Enable VIP data feeding with auto-display
+
+ Behaviour is identical to #GFVX_VIP_START, additionally auto-display of the
+ last captured VIP frame is enabled. It is recommended to use this feature
+ in double buffer mode, passing 2 surfaces in GFVXVIPUPDATE::ppSurf.
+
+
+ #GFVX_VIP_AUTO_FLIP_OVERLAY2
+
+ Enable VIP data feeding with auto-display from overlay window2
+
+ If surfaces to be flipped are overlay surfaces, they are associated with
+ first overlay surface unless #GFVX_VIP_AUTO_FLIP_OVERLAY2 flag is defined.
+ This flag should be used only if UpdateOverlay has been previously called
+ with #GFVX_UO_OVERLAY2 UpdateOption and VxFlip has been called with
+ #GFVX_FLIP_OVERLAY2 FlipOption.
+
+
+
+ #GFVX_VIP_AUTO_TRIGER_BLT
+
+ Enable VIP data feeding with auto-blit
+
+ Behaviour is identical to #GFVX_VIP_START, additionally auto-blit of the
+ last captured VIP frame is enabled. It is recommended to use this feature
+ in double buffer mode, passing 2 surfaces in GFVXVIPUPDATE::ppSurf.
+
+ If #GFVX_VIP_AUTO_FLIP and #GFVX_VIP_AUTO_TRIGER_BLT are required at the
+ same time, these two action identifiers can be logically OR'ed and passed
+ in GFVXVIPUPDATE::UpdateOption.
+
+
+ #GFVX_VIP_STOP
+
+ Disable VIP data feeding
+
+ Stop data feeding through VIP. All other flags and parameters passed in
+ \a pUpdate are ignored.
+
+
+ #GFVX_VIP_AUTO_TRIGER_BLT_OFF
+
+ Disable VIP auto-blit
+
+ Stop auto-blit that has been enabled earlier with this function via
+ #GFVX_VIP_AUTO_TRIGER_BLT. This does not disable VIP data feed.
+
+
+
+ This function returns GFVX_ERROR_COLORFORMAT_NOT_SUPPORTED error if destination
+ surface color format is not supported. Supported destination color formats are -
+ RGB565, ARGB8888, YUV422, YUV422P, YUV420P and YUV420PA.
+
+ @see GFVXVIPUPDATE, GFVxVIPSetVIP()
+*/
+GF_RETTYPE GFVxVIPUpdate(GFVxHandle VxHandle,
+ PGFVXVIPUPDATE pUpdate);
+
+/** Manipulate GPIO signals on VIP.
+
+ @param VxHandle (#GFVxHandle) Handle to VxAPI
+ @param gpio (#GFVX_VIP_GPIO_TYPE) Signal (pin) to manipulate
+ @param operation (NvU32) Operation type, one of:
+
+ #GF_GPIO_SET_INPUT_ENABLE
+ Input enable set to 1
+ #GF_GPIO_CLR_INPUT_ENABLE
+ Input enable clr to 0.
+ #GF_GPIO_GET_INPUT_ENABLE
+ Get input enable.
+ #GF_GPIO_SET_OUTPUT_ENABLE
+ Output enable set to 1.
+ #GF_GPIO_CLR_OUTPUT_ENABLE
+ Output enable clr to 0.
+ #GF_GPIO_GET_OUTPUT_ENABLE
+ Get output enable.
+ #GF_GPIO_SET_DATA
+ Output data set to 1.
+ #GF_GPIO_CLR_DATA
+ Output data clr to 0.
+ #GF_GPIO_GET_DATA Get output data.
+
+ @param pGPIOStatus (#PGFGPIOSTATUS) Pointer to #GFGPIOSTATUS structure
+ returning pin status
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ This function manipulates the GPIO signals on the video input port (VIP).
+ The supported operations are clearing to 0, setting to 1, and getting the
+ status of the input enable, output enable, and data bits.
+
+ @see GFGPIOSTATUS, GFVX_VIP_GPIO_TYPE
+*/
+GF_RETTYPE GFVxVIPGPIO(GFVxHandle VxHandle,
+ GFGPIOPin gpio,
+ NvU32 operation,
+ PGFGPIOSTATUS pGPIOStatus);
+
+/** VxAPI component-level interrupt control.
+
+ @param VxHandle (#GFVxHandle) Handle to VxAPI
+ @param IntType (#GFVX_INTERRUPT_TYPE) VxAPI interrupt type
+ @param op (#GFVX_INTERRUPT_OPERATION_TYPE) VxAPI interrupt operation
+ @param pData (void*) Pointer to input or output data block, depending
+ on interrupt type and operation
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+ @retval #GFVX_ERROR_NO_SUPPORT Operation not supported
+
+ Interpretation of the datablock passed with \a pData depends on the
+ interrupt operation. The following operations (parameter op )
+ are defined for this call,
+
+
+ #GFVX_INTERRUPT_ENABLE
+ Enable interrupt/status assertion for interrupt type \a IntType.
+ \a pData is ignored.
+
+
+ #GFVX_INTERRUPT_DISABLE
+ Disable interrupt/status assertion for interrupt type \a IntType.
+ \a pData is ignored.
+
+
+ #GFVX_INTERRUPT_DISABLE
+ Clear interrupt/status assertion for interrupt type \a IntType.
+ \a pData is ignored.
+
+
+ #GFVX_INTERRUPT_QUERY_STATUS
+ Query for interrupt/status assertion for interrupt type \a IntType.
+
+ Interpretation of associated data block \a pData:
+
+ NvU32 Interrupt/status assertion state, one of:
+ GF_INTERRUPT_ON_STATUS_TRUE = asserted
+ GF_INTERRUPT_ON_STATUS_FALSE = not asserted
+
+
+
+ #GFVX_INTERRUPT_SET_Y_FIFO_THRESHOLD,
+ #GFVX_INTERRUPT_GET_Y_FIFO_THRESHOLD
+
+ Set or get DMA FIFO threshold value that controls interrupt/status
+ assertion for interrupt type #GFVX_Y_FIFO_THRESHOLD_INTR. If the
+ number of filled locations in the Y-FIFO is greater or equal
+ than the programmed value, #GFVX_Y_FIFO_THRESHOLD_INTR is asserted.
+ Note that the threshold value must not be changed within a frame.
+
+ Parameter \a IntType is ignored.
+
+ Interpretation of associated data block \a pData:
+
+ NvU32 Y-FIFO threshold value in range 0..31
+
+
+
+ #GFVX_INTERRUPT_SET_V_COUNTER_THRESHOLD,
+ #GFVX_INTERRUPT_GET_V_COUNTER_THRESHOLD
+
+ Set or get threshold value that controls interrupt/status assertion
+ for interrupt type #GFVX_VERTICAL_COUNTER_THRESHOLD_INTR. If the
+ vertical scanline position for data from parallel video input is
+ greater or equal than the programmed value,
+ #GFVX_VERTICAL_COUNTER_THRESHOLD_INTRis asserted.
+
+ Parameter \a IntType is ignored.
+
+ Interpretation of associated data block \a pData:
+
+ NvU32 Vertical counter threshold value in range 0..4095
+
+
+
+ #GFVX_INTERRUPT_GET_ALL_STATUS
+ Get VI interrupt status bitmask.
+
+ Parameter \a IntType is ignored.
+
+ Interpretation of associated data block \a pData:
+
+ NvU32 Interrupt status bitmask,
+ Logically OR'ed combination of:
+ #GFVX_VID0PIN_RISING_EDGE_INTR
+ #GFVX_VID1PIN_RISING_EDGE_INTR
+ #GFVX_VID2PIN_RISING_EDGE_INTR
+ #GFVX_VID3PIN_RISING_EDGE_INTR
+ #GFVX_VID4PIN_RISING_EDGE_INTR
+ #GFVX_VID5PIN_RISING_EDGE_INTR
+ #GFVX_VID6PIN_RISING_EDGE_INTR
+ #GFVX_VID7PIN_RISING_EDGE_INTR
+ #GFVX_VERTICAL_COUNTER_THRESHOLD_INTR
+ #GFVX_VHSYNC_RISING_INTR
+ #GFVX_VVSYNC_RISING_INTR
+ #GFVX_VIDEO_IN_FIELD_DATA_RECV_INTR
+ #GFVX_EARLY_VIDEO_INTR
+ #GFVX_Y_FIFO_THRESHOLD_INTR
+
+
+
+ #GFVX_INTERRUPT_CLEAR_ON_ALL_STATUS
+ Clear VI interrupt assertions.
+
+ Parameter \a IntType is ignored.
+
+ Interpretation of associated data block \a pData:
+
+ NvU32 Interrupt status bitmask,
+ set bit = clear this interrupt assertion
+ unset bit = leave unchanged
+
+ Valid bits which can be logically OR'ed:
+ #GFVX_VID0PIN_RISING_EDGE_INTR
+ #GFVX_VID1PIN_RISING_EDGE_INTR
+ #GFVX_VID2PIN_RISING_EDGE_INTR
+ #GFVX_VID3PIN_RISING_EDGE_INTR
+ #GFVX_VID4PIN_RISING_EDGE_INTR
+ #GFVX_VID5PIN_RISING_EDGE_INTR
+ #GFVX_VID6PIN_RISING_EDGE_INTR
+ #GFVX_VID7PIN_RISING_EDGE_INTR
+ #GFVX_VERTICAL_COUNTER_THRESHOLD_INTR
+ #GFVX_VHSYNC_RISING_INTR
+ #GFVX_VVSYNC_RISING_INTR
+ #GFVX_VIDEO_IN_FIELD_DATA_RECV_INTR
+ #GFVX_EARLY_VIDEO_INTR
+ #GFVX_Y_FIFO_THRESHOLD_INTR
+
+
+
+
+
+ @see GFVX_INTERRUPT_TYPE, GFVX_INTERRUPT_OPERATION_TYPE,
+ GFVxInterruptHandler()
+*/
+GF_RETTYPE GFVxInterruptControl(GFVxHandle VxHandle,
+ GFVX_INTERRUPT_TYPE IntType, GFVX_INTERRUPT_OPERATION_TYPE op,
+ void * pData);
+
+/** Get information about a feature of the VxAPI.
+
+ @param VxHandle (#GFVxHandle) Handle to VxAPI
+ @param aid (NvU32) Attribute type identifier, see table.
+ @param pAttr (NvU32*) Returns 32 bit attribute value, see attribute
+ type documentation for interpretation
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+
+ \b Attribute \b Direction \b Synopsis
+
+ #GFVX_ATTR_VIDEO_BUF
+ get
+ Video input interrupt status
+
+
+
+
+ @see GFVxSetAttribute()
+*/
+GF_RETTYPE GFVxGetAttribute(GFVxHandle VxHandle, NvU32 aid, NvU32 *attr);
+
+/** Reset VI to a reset state.
+
+ @param VxHandle (#GFVxHandle) Handle to VxAPI
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+*/
+GF_RETTYPE GFVxReset(GFVxHandle);
+
+/** This function waits until the next camera vsync has occurred.
+ It is implemented with interrupt mode. Therefore, it assumes that
+ interrupt platform has already supported or taken care,
+ otherwise it will wait forever for interrupt event
+
+ @param VxHandle (#GFVxHandle) Handle to VxAPI
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+*/
+GF_RETTYPE GFVxWaitCameraVSync(GFVxHandle);
+
+/** This function ensures synchronization between StretchBlt operations and others
+ modules operations.
+
+ @param VxHandle (#GFVxHandle) Handle to GFVxAPI
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ When several modules share the same channel (like SB,JxDec,MxDec),
+ it may be necessary to synchronize the command flow with the StretchBlt (SB)
+ module execution. Putting a GFVxBltNotBusy() call after a SB operation ensures
+ that commands which follow the SB command are executed after full completion
+ of the SB command.
+
+ As opposed to GFVxBltWaitNotBusy(), this function doesn't block the CPU thread.
+ stretchblt engine may not be idle when returning from the function. Control returns
+ to the CPU right after a wait command is placed in the stretchblt engine command FIFO.
+ The GoForce hardware begins executing the commands following the StretchBlt engine idle
+ command only after the stretchblt engine becomes idle.
+
+ @see GFVxBltWaitNotBusy()
+*/
+GF_RETTYPE GFVxBltNotBusy(GFVxHandle VxHandle);
+
+/** This function checks whether the stretchblt engine is busy or idle.
+
+ @param VxHandle (#GFVxHandle) Handle to GFVxAPI
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+ The function will wait until the stretchblt engine is idle. For example, if you want
+ to stretchblt to the frame buffer but the stretchblt engine is busy the function can
+ be used to wait until it is idle.
+
+ As opposed to GFVxBltNotBusy(), this function blocks the CPU thread while waiting for
+ the stretchblt engine to become idle.
+
+ @see GFVxBltNotBusy()
+
+*/
+GF_RETTYPE GFVxBltWaitNotBusy(GFVxHandle VxHandle);
+
+/** This function sets the current state stretchblt color space converion (CSC)
+ coefficients that will be programmed to GPU after calling GFVxBlt to do
+ YUV color space conversion to RGB.
+ How to use this routine:
+ - GFVxBltGetCSCCoeff() to get default YUV CSC coefficients, save them
+ - GFVxBltSetCSCCoeff() to change to new YUV CSC coefficients
+ - GFVxBlt() to stretchblt image with your new YUV CSC coefficients to RGB,
+ then done whatever
+ - GFVxBltSetCSCCoeff() to restore back default YUV CSC coefficients
+
+ @param VxHandle (#GFVxHandle) Handle to GFVxAPI
+ @param pCoef (GFVXCSCCOEF*) Pointer to #GFVXCSCCOEF structure
+ @param option (NvU32) Option type, one of:
+
+ - #GFVX_SET_CSC_USE_CCIR601_RANGE -- Use CCIR601 range.
+ This option will ignore parameter pCoef. It will use
+ pre-defined CSC CCIR601 coefficients values.
+ - #GFVX_SET_CSC_USE_FULL_RANGE -- Use color full range.
+ This option will ignore parameter pCoef. It will use
+ pre-defined CSC full range coefficients values.
+ - #GFVX_SET_CSC_USE_USER_DEFINED_RANGE -- Use user defined range.
+ This option will require parameter pCoef. It will use
+ CSC coefficients values provided from pCoef.
+
+ @param sbMode (#GFVXBLTMODE) StretchBlt mode, one of:
+
+ - GFVX_BLT_FULL_MODE: Host full frame stretchblt trigger
+ - GFVX_BLT_PARTIAL_MODE: Host partial frame stretchblt trigger
+ - GFVX_BLT_AUTO_VI_MODE: Auto stretchblt trigger from VI
+
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+*/
+GF_RETTYPE GFVxBltSetCSCCoeff(GFVxHandle VxHandle,
+ GFVXCSCCOEF *pCoef,
+ NvU32 option,
+ GFVXBLTMODE sbMode);
+
+/** This function sets the current state VI color space converion (CSC)
+ coefficients that will be programmed to GPU after calling GFVxVIPUpdate
+ to do YUV color space conversion to RGB.
+ How to use this routine:
+ - GFVxVIPGetCSCCoeff() to get default YUV CSC coefficients, save them
+ - GFVxVIPSetCSCCoeff() to change to new YUV CSC coefficients
+ - GFVxVIPUpdate() to preview image with your new YUV CSC coefficients to RGB
+ - GFVxVIPSetCSCCoeff() to restore back default YUV CSC coefficients
+
+ @param VxHandle (#GFVxHandle) Handle to GFVxAPI
+ @param pCoef (#GFVXCSCCOEF*) Pointer to #GFVXCSCCOEF structure
+ @param option (NvU32) Option type, one of:
+
+ - #GFVX_SET_CSC_USE_CCIR601_RANGE -- Use CCIR601 range.
+ This option will ignore parameter pCoef. It will use
+ pre-defined CSC CCIR601 coefficients values.
+ - #GFVX_SET_CSC_USE_FULL_RANGE -- Use color full range.
+ This option will ignore parameter pCoef. It will use
+ pre-defined CSC full range coefficients values.
+ - #GFVX_SET_CSC_USE_USER_DEFINED_RANGE -- Use user defined range.
+ This option will require parameter pCoef. It will use
+ CSC coefficients values provided from pCoef.
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+*/
+GF_RETTYPE GFVxVIPSetCSCCoeff(GFVxHandle VxHandle, GFVXCSCCOEF *pCoef, NvU32 option);
+
+/** This function gets the current state stretchblt color space conversion (CSC)
+ coefficients
+
+ @param VxHandle (#GFVxHandle) Handle to GFVxAPI
+ @param pCoef (#GFVXCSCCOEF*) Pointer to #GFVXCSCCOEF structure
+ @param sbMode (#GFVXBLTMODE) StretchBlt mode, one of:
+ - GFVX_BLT_FULL_MODE: Host full frame stretchblt trigger
+ - GFVX_BLT_PARTIAL_MODE: Host partial frame stretchblt trigger
+ - GFVX_BLT_AUTO_VI_MODE: Auto stretchblt trigger from VI
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+*/
+GF_RETTYPE GFVxBltGetCSCCoeff(GFVxHandle VxHandle, GFVXCSCCOEF *pCoef, GFVXBLTMODE sbMode);
+
+/** This function gets the current state VI color space conversion (CSC) coefficients
+
+ @param VxHandle (#GFVxHandle) Handle to GFVxAPI
+ @param pCoef (#GFVXCSCCOEF*) Pointer to #GFVXCSCCOEF structure
+
+ @retval #GF_SUCCESS Success
+ @retval #GF_ERROR Some error occured
+
+*/
+GF_RETTYPE GFVxVIPGetCSCCoeff(GFVxHandle VxHandle, GFVXCSCCOEF *pCoef);
+
+/** @page pageVxOverview VxAPI Overview
+
+ The GFVxAPI is an abstraction layer for both the Video Scalar (StretchBlt)
+ and the Video Input (VI) module. The Video Scalar provides color space
+ conversion (CSC) and smooth scaling of video. The VI module, which connects
+ to the Video Input Port (VIP), accepts data from the VIP or the host CPU
+ through a FIFO mechanism.
+
+ Video data, either decimated or not, can be sent from the VI to JPEG or
+ MPEG encoder, and at the same time can go to memory through CSC for previewing,
+ again either decimated or not. If a decimator is used in both the preview and
+ the encoder paths, it has to have same decimation factor.
+
+ Video data can also be sent to EPP. RGB565, RGB444 and RGB888 data goes directly
+ and YUV422 data, pre or post decimated, is first converted to YUV444 by VI
+ before sending to EPP.
+
+ If data coming from VIP is in Bayer format, VI first sends this data to ISP.
+ After processing, ISP returns YUV444 data to VI. VI converts output of ISP to
+ YUV422 before sending it to core for decimation or to memory or both.
+
+ There are also options to crop, mirror and/or flip video data.
+
+ The Video Scalar and the VI module accept YUV (4:2:2 or 4:2:0) and
+ RGB (565) data as input. YUV data can be converted to YUV planar data or
+ RGB data (RGB:565 for all processors, and RGB:888 or ARGB:8888 for GoForce
+ 3D 4800). RGB data can be scaled, but cannot be converted to YUV, for all
+ processors up to the GoForce 3D 4800.
+
+ @section pageVxOverview1 Video Sources
+
+ The video source for the VI module can be the host CPU or a camera
+ connected to the VIP. The video source for the Video Scalar can be the
+ video memory surface or the output of the JPEG or MPEG decoder through a
+ circular buffer. The GFVxAPI functions that deal only with the VIP have VIP
+ in their function names.
+
+ @section pageVxOverview2 Video Camera Interface
+
+ Usually a video camera connected through the VIP generates YUV 422 data
+ (CCIR656 format) which can be encoded by the NVIDIA GPU. Some cameras
+ generate JPEG-encoded images directly, and the GFSDK can be configured to
+ accept those JPEG-encoded bit streams.
+
+ To control the JPEG input stream, VIP of newer NVIDIA GPUs supports the
+ following camera interface protocols for variably sized bitstream data:
+ - Type A interface : VHSync and VVSync length can be variable, and
+ VVClk should be kept running. (SC12 only)
+ - Type B interface : VHSync and VVSync length can be variable, and
+ VVClk can be stopped during the image transfer period. (SC12 only)
+ - Type C interface : VHSync and VVSync length are fixed, and VVClk
+ should be kept running. The camera can insert 0xff in the image as
+ padding.
+
+ @section pageVxOverview3 Video Coordinate Systems (Regular and Rotated)
+
+ A destination coordinate is always the same as a screen coordinate. The
+ source coordinate stays the same, even if there is rotation.
+*/
+
+/** @page pageVxAppNotes VxAPI Application Notes
+
+ @section pageVxAppNotes1 Programming Sequence
+
+ The easiest way to learn the VxAPI is by referring to the demonstration
+ application source code that come with the GFSDK package. A new application
+ can be started by creating a project at the same directory level as the
+ demo application source directory. This way the same directory tree
+ structure can be maintained. The general sequence for programming the
+ VxAPI is as follows:
+
+ -# Make sure that the build project or file has the right paths to the
+ library and header files. Use relative directory addressing if possible.
+ The GFSDK/Inc directory must be included.
+ -# Include GFVx.h in the source file. This header is all that is needed to
+ access the exposed API functions.
+ -# Call GFRmOpen() before any other GFSDK functions (including the VxAPI).
+ -# Use the handle returned from the Resource Manager in the previous step
+ to call GFRmComponentGet() with #GF_VXAPI as the ComponentType in the
+ #GFRMCOMPONENT structure. The returned handle is the one to use
+ throughout all VxAPI calls.
+ -# To better utilize VxAPI functions, it is a good idea to call
+ GFVxGetProperty() to determine the version that you are using and the
+ available video memory.
+ -# Make calls to the appropriate VxAPI functions. Always remember to pass
+ the same #GFVxHandle returned from GFRmComponentGet().
+ -# When all the VxAPI calls are completed, call GFRmComponentRelease().
+ -# When exiting the application, call RmClose() to release everything
+ associated with the GFSDK.
+*/
+
+//////////////////Raw Capture Defination //////////////////////////
+/** Descriptor for raw data fetch buffers.
+ This structure describes a buffer and its fill status for Raw YUV transfered
+ from RDMA to the application.
+ It is used with GFVxRawCapture() and GFVxRawCaptureFetchImage()
+ in either polling or callback data fetch mode.
+
+ @see GFVxCapture(), GFVxRawCaptureFetchImage()
+*/
+typedef struct _GFVX_BUF {
+ NvU8 *pBuf; /**< Pointer to the buffer */
+ NvU32 bufSize; /**< Size of the buffer in bytes */
+ NvU32 nBytesCaptured; /**< Number of bytes captured,
+ app initializes to 0
+ */
+} GFVX_BUF, *PGFVX_BUF;
+
+
+/** Image source/target dimensions and data source for Raw data capturing.
+
+ This structure is passed as parameter to GFVxRawCaptureStart() and describes
+ data source, source cropping rectangle and destination image size.
+
+ @see GFVxRawCaptureStart()
+*/
+typedef struct _GFVXRAWINFO
+{
+ PGFRMSURFACE pSrcSurf;/**< Surface to encode,
+ NULL for camera.
+ */
+ PGFRECT pSrcRect; /**< Source image area need to capture */
+ NvU32 DestWidth; /**< Final output data width */
+ NvU32 DestHeight; /**< Final output data height */
+ NvU32 uiOptions; /**< Bitmask of flags to control capturing
+
+ */
+ NvU32 Error; /**< Returns detailed error code on GFVxRawCaptureStart() failure
+
+ #GF_CAPT_ERROR_VIDEO_MEMORY_NOT_BIG_ENOUGH
+ Not enough free video memory, try to release
+ unnecessary video surfaces
+ #GF_CAPT_ERROR_WRONG_CONFIG
+ Wrong input parameters, for example srcRect
+ size greater than pSrcSurf dimensions
+ #GF_CAPT_ERROR_NO_CALLBACK
+ No callback function available
+
+ */
+ NvU32 colorFormat;
+} GFVXRAWINFO, *PGFVXRAWINFO;
+
+/** GFVXRAWINFO uiOptions:
+*/
+#define RAWCAPTURE_ATTR_RAW_DATA 0x00000010
+#define RAWCAPTURE_ATTR_RAW_JPEG_CAPTURE 0x00000020
+#define RAWCAPTURE_ATTR_RAW_DATA_STREAM 0x00000030
+
+/** Raw data capture APIs
+*/
+GF_RETTYPE GFVxRawCaptureStart( GFVxHandle VxHandle,
+ PGFVXRAWINFO pStart);
+
+GF_RETTYPE GFVxRawCaptureSetupInterrupt(GFVxHandle VxHandle,
+ void (*Inter)(void *), void *IPara);
+
+GF_RETTYPE GFVxRawCapture (GFVxHandle VxHandle,
+ PGFVX_BUF aBuf, NvU32 nBuf, NvU32 *pStatus );
+
+GF_RETTYPE GFVxRawCaptureFetchImage (GFVxHandle pVx,
+ PGFVX_BUF aBuf, NvU32 nBuf, NvU32 *pStatus );
+
+GF_RETTYPE GFVxRawCaptureEnd( GFVxHandle pVx );
+
+//uiFrameStatus;
+
+/** Raw Capture data fetch status code: All data of the current frame was fetched.
+ @see GFVxRawCaptureFetchImage(), GFVxRawCapture()
+*/
+#define RAWCAPTURE_DATA_COMPLETE 0x1
+
+/** Raw Capture data fetch status code: Data was fetched only partially.
+ The application should make more calls to GFVxRawCaptureFetchImage() to fetch
+ the rest.
+ @see GFVxRawCaptureFetchImage(), GFVxRawCapture()
+*/
+#define RAWCAPTURE_MORE_FETCH 0x2
+
+/** Raw Capture data fetch status code: New frame was captured and is ready to
+ fetch.
+ @see GFVxRawCaptureFetchImage(), GFVxRawCapture()
+*/
+#define RAWCAPTURE_NEW_FRAME 0x8
+
+/** Raw Capture data fetch status code: Time out error occured while output data is fetching.
+ fetch.
+ @see GFVxRawCaptureFetchImage(), GFVxRawCapture()
+*/
+#define RAWCAPTURE_TIME_OUT 0x10
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __GFVX_H__ */
+
+
diff --git a/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFVxError.h b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFVxError.h
new file mode 100755
index 00000000..7f81f255
--- /dev/null
+++ b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFVxError.h
@@ -0,0 +1,42 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/** @file GFVxError.h
+ GFVxAPI error codes
+*/
+
+#ifndef __GFVXERROR_H__
+#define __GFVXERROR_H__
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+#define GFVX_ERROR_GET_COMPONENT (GFVX_ERROR | 0x00000001L)
+/** GFVxAPI error code: Function not supported. */
+#define GFVX_ERROR_NO_SUPPORT (GFVX_ERROR | 0x00000002L)
+#define GFVX_ERROR_COLORFORMAT_NOT_SUPPORTED (GFVX_ERROR | 0x00000003L)
+#define GFVX_ERROR_SURFACETYPE_NOT_SUPPORTED (GFVX_ERROR | 0x00000004L)
+#define GFVX_ERROR_ILLEGAL_ALPHA_VALUE (GFVX_ERROR | 0x00000005L)
+#define GFVX_ERROR_ILLEGAL_BAYER_VALUES (GFVX_ERROR | 0x00000006L)
+#define GFVX_ERROR_ILLEGAL_PARAMETER (GFVX_ERROR | 0x00000007L)
+#define GFVX_ERROR_DRIVER_NOT_SUPPORTED (GFVX_ERROR | 0x00000008L)
+#define GFVX_ERROR_FLAG_NOT_SUPPORTED (GFVX_ERROR | 0x00000009L)
+#define GFVX_ERROR_FAIL_ALLOCATE_MEMORY (GFVX_ERROR | 0x0000000AL)
+#define GFVX_ERROR_ILLEGAL_VALUE (GFVX_ERROR | 0x0000000BL)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // __GFVXERROR_H__
+
+
+
diff --git a/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFVxScr.h b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFVxScr.h
new file mode 100755
index 00000000..394a33ef
--- /dev/null
+++ b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFVxScr.h
@@ -0,0 +1,311 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+#if !defined (__GFVXSCR_INC__)
+#define __GFVXSCR_INC__
+
+/** VxAPI GFVXVIPINFO::Flag flagbit: 8-bit/clock video data.
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_PARALLEL_INPUT 0x00000001
+
+/** VxAPI GFVXVIPINFO::Flag flagbit: Serial input.
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_SERIAL_INPUT 0x00000002
+
+/** VxAPI GFVXVIPINFO::Flag flagbit: VHSYNC and VVSYNC in the data stream.
+ If this flag is set, vertical and horizontal sync for the camera picture
+ is contained in the data stream going into the data port of the VIP.
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_HVSYNC_IN_STREAM 0x00000004
+
+/** VxAPI GFVXVIPINFO::Flag flagbit: Camera VHSYNC asserted by external signal.
+ If this flag is set, vertical and horizontal sync for the camera picture
+ is asserted to the GoForce chip by external signals, usually coming from
+ the camera chip.
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_EXTERNAL_VHSYNC 0x00000008
+
+/** VxAPI GFVXVIPINFO::Flag flagbit: Camera VHSYNC generated by GoForce chip.
+ If this flag is set, vertical and horizontal sync is generated by the
+ GoForce chip, and not contained in the data stream. The following members
+ of GFVXVIPINFO have to be set to define the timing:
+ - GFVXVIPINFO::VHPulseWidth
+ - GFVXVIPINFO::VHPulsePeriod
+ - GFVXVIPINFO::VVPulseWidth
+ - GFVXVIPINFO::VVPulsePeriod
+ - GFVXVIPINFO::VVDelay
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_INTERNAL_VHSYNC 0x00000010
+
+/** VxAPI GFVXVIPINFO::Flag flagbit: VCLK generated externally.
+ If this flag is set, camera VCLK is provided from an external source,
+ and VLCK will be selected as clock source for VI module.
+ @see GFVXVIPINFO, GFVxVIPSetVIP(), GFVX_VIP_EXTERNAL_VCLK_PRESERVE_CLKSEL
+*/
+#define GFVX_VIP_EXTERNAL_VCLK 0x00000020
+
+/** VxAPI GFVXVIPINFO::Flag flagbit: VCLK generated by GoForce chip.
+ If this flag is set, camera VCLK is provided by the GoForce chip.
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_INTERNAL_VCLK 0x00000040
+
+/** VxAPI GFVXVIPINFO::Flag flagbit: Detect field 0 or 1, will not work for
+ internal VHSYNC (#GFVX_VIP_INTERNAL_VHSYNC).
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_DETECT_FIELD 0x00000080
+
+/** VxAPI GFVXVIPINFO::Flag flagbit: Horizontal flip.
+ Flip VIP image horizontally.
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_RGB_H_FLIP 0x00000100
+
+/** VxAPI GFVXVIPINFO::Flag flagbit: Vertical flip.
+ Flip VIP image vertically.
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_RGB_V_FLIP 0x00000200
+
+/** VxAPI GFVXVIPINFO::Flag flagbit: CPU feeds image to VIP.
+ This flag indicates to the VIP, that image data is fed from the
+ host interface.
+ @see GFVXVIPINFO, GFVxVIPSetVIP(), GFVxVIPFeedImage()
+*/
+#define GFVX_VIP_HOST_IMAGE 0x00000400
+
+/** VxAPI GFVXVIPINFO::Flag flagbit: Change the default timing for VHSYNC and
+ VCLK. If this flag is set, VHSYNC and VCLK timing characteristics such as
+ polarity, active edge, serial frame polarity, size, field info are
+ overridden with GFVxVIPSetVIP() by the parameters passed in
+ GFVXVIPINFO::NewTiming.
+
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_CHANGE_DEFAULT_TIMING 0x00000800
+
+/** VxAPI GFVXVIPINFO::Flag flagbit: Camera master clock provided by GoForce
+ chip. When this flag is set, GFVXVIPINFO::MClockFreq must be set to the
+ ideal clock which the camera wants. Internally the best matching frequency
+ is provided to the camera.
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_ASK_FOR_MCLOCK 0x00001000
+
+/** VxAPI GFVXVIPINFO::Flag flagbit: VIP input type A interface.
+ @see GFVXVIPINFO, GFVxVIPSetVIP(), pageVxOverview2
+*/
+#define GFVX_VIP_TYPE_A 0x00002000
+
+/** VxAPI GFVXVIPINFO::Flag flagbit: VIP input type B interface.
+ @see GFVXVIPINFO, GFVxVIPSetVIP(), pageVxOverview2
+*/
+#define GFVX_VIP_TYPE_B 0x00004000
+
+/** VxAPI GFVXVIPINFO::Flag flagbit: VIP input type C interface.
+ @see GFVXVIPINFO, GFVxVIPSetVIP(), pageVxOverview2
+*/
+#define GFVX_VIP_TYPE_C 0x00008000
+
+/** VxAPI GFVXVIPINFO::Flag flagbit: Camera is running at type C interface
+ and do not remove the 0xFF, 0x02 sequence.
+ @see GFVXVIPINFO, GFVxVIPSetVIP(), pageVxOverview2
+*/
+#define GFVX_VIP_TYPE_C_RAW 0x00010000
+
+/** VxAPI GFVXVIPINFO::Flag flagbit: Enable destination byte swap for YUV/RGB
+ data written to preview surface.
+
+ This flag enables byte swap for 32 bit words of data coming from VIP and
+ going to a target RGB or YUV422 surface. The sequence of 4 byte groups in
+ (LSB)b0 b1 b2 b3(MSB) order is swapped to
+ (LSB)b1 b0 b3 b2(MSB).
+
+ This flag only affects data written to a preview surface, i.e. VIP image
+ capture enabled with GFVxVIPSetVIP() and GFVxVIPUpdate(). It does not
+ affect raw data going to the JPEG/MPEG encoder.
+
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_DEST_BYTE_SWAP 0x00020000
+
+/** VxAPI GFVXVIPINFO::Flag flagbit: VI output without rotation
+ Rotate VIP image 0 degree
+ @version SC15 and above
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_ROTATE_0 0x00040000
+
+/** VxAPI GFVXVIPINFO::Flag flagbit: VI output with 90 degree rotation
+ Rotate VIP image 90 degree
+ @version SC15 and above
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_ROTATE_90 0x00080000
+
+/** VxAPI GFVXVIPINFO::Flag flagbit: VI output with 180 degree rotation
+ Rotate VIP image 180 degree
+ @version SC15 and above
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_ROTATE_180 0x00100000
+
+/** VxAPI GFVXVIPINFO::Flag flagbit: VI output with 270 degree rotation
+ Rotate VIP image 270 degree
+ @version SC15 and above
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_ROTATE_270 0x00200000
+
+/** VxAPI GFVXVIPINFO::Flag flagbit: RGB565 input to EPP.
+ @todo clarify
+ @version SC15 and above
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_RGB565 0x00400000
+
+/** VxAPI GFVXVIPINFO::Flag flagbit: RGB888 input to EPP.
+ @todo clarify
+ @version SC15 and above
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_RGB888 0x00800000
+
+/** VxAPI GFVXVIPINFO::Flag flagbit: RGB444 input to EPP.
+ @todo clarify
+ @version SC15 and above
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_RGB444 0x01000000
+
+/** VxAPI GFVXVIPINFO::Flag flagbit: Preserve VI clock source but enable external VLCK pad.
+ This flag can be used in combination with GFVX_VIP_EXTERNAL_VCLK to enable
+ an external clock on VLCK, but keep the VI module clocksource.
+ @version SC15 and above
+ @see GFVXVIPINFO, GFVxVIPSetVIP(), GFVX_VIP_EXTERNAL_VCLK
+*/
+#define GFVX_VIP_EXTERNAL_VCLK_PRESERVE_CLKSEL 0x02000000
+
+/** VxAPI GFVXVIPINFO::Flag flagbit: VIP input type D interface.
+ @version SC17 and above
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_TYPE_D 0x04000000
+
+#define GFVX_VIP_CSI_ENABLE 0x08000000
+
+/** VxAPI GFVXVIPINFO::Flag flagbit: Bypass any manipulation on internal master
+ clock generation output pin.
+
+ This flag is mutually exclusive to #GFVX_VIP_PRE_GENERATE_MCLOCK and
+ #GFVX_VIP_ASK_FOR_MCLOCK.
+
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_BYPASS_MCLOCK_PIN 0x20000000
+
+/** VxAPI GFVXVIPINFO::Flag flagbit: Bypass any manipulation on VCLK, VHSYNC,
+ and VID[7:0] pins.
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_BYPASS_NON_MCLOCK_PINS 0x40000000
+
+/** VxAPI GFVXVIPINFO::Flag flagbit: Pre-generation of master clock.
+ Useful for scanning the I2C bus for a camera.
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_PRE_GENERATE_MCLOCK 0x80000000
+
+/**
+ Bypass ISP mode.
+*/
+#define GFVX_VIP_BYPASS_ISP 0x10000000
+
+/** VxAPI GFVXVIPINFO::NewTiming flagbit: Parallel data latched at falling edge
+ of VCLK (default is rising edge).
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_PDL_FALLING_VCLK 0x00000001
+
+/** VxAPI GFVXVIPINFO::NewTiming flagbit: Serial data lacthed at rising edge of
+ VCLK (default is falling edge).
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_SDL_RISING_VCLK 0x00000001
+
+/** VxAPI GFVXVIPINFO::NewTiming flagbit: VHSYNC active low (default is active
+ high).
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_VHSYNC_ACTIVE_LOW 0x00000002
+
+/** VxAPI GFVXVIPINFO::NewTiming flagbit: VVSYNC active low (default is active
+ high).
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_VVSYNC_ACTIVE_LOW 0x00000004
+
+/** VxAPI GFVXVIPINFO::NewTiming flagbit: VHSYNC active leading edge (default
+ is trailing edge).
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_VHSYNC_ACTIVE_EDGE_LEAD 0x00000008
+
+/** VxAPI GFVXVIPINFO::NewTiming flagbit: VVSYNC active leading edge (default
+ is trailing edge).
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_VVSYNC_ACTIVE_EDGE_LEAD 0x00000010
+
+/** VxAPI GFVXVIPINFO::NewTiming flagbit: Serial video frame sync active low,
+ falling edge indicates start of data frame (default is active high, rising
+ edge indicates start of data frame).
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_SFRAME_ACTIVE_LOW 0x00000020
+
+/** VxAPI GFVXVIPINFO::NewTiming flagbit: Serial video input is 16 bit per
+ frame (default is 8 bit per frame).
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_SFRAME_SIZE_16 0x00000040
+
+/** VxAPI GFVXVIPINFO::NewTiming flagbit: Field 0 is bottom/even field
+ (default is top/odd field).
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_FILED_0_BOTTOM 0x00000080
+
+/** VxAPI GFVXVIPINFO::NewTiming flagbit: VCLK output from GoForce chip active
+ low (default is active high).
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_VCLK_OUTPUT_ACTIVE_LOW 0x00000100
+
+#define GFVX_VIP_VHSYNC_ACTIVE_LOW_RESET 0x00000200
+
+/** VxAPI GFVXVIPINFO::NewTiming flagbit: VVSYNC reset active low (default is active
+ high).
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+#define GFVX_VIP_VVSYNC_ACTIVE_LOW_RESET 0x00000400
+
+/** VxAPI GFVXVIPINFO::NewTiming flagbit: VHSYNC reset active leading edge (default
+ is trailing edge).
+ @see GFVXVIPINFO, GFVxVIPSetVIP()
+*/
+
+
+#endif
diff --git a/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/cpuopsys.h b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/cpuopsys.h
new file mode 100755
index 00000000..daa89a73
--- /dev/null
+++ b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/cpuopsys.h
@@ -0,0 +1,309 @@
+
+/*! \brief
+ * Define compile time symbols for CPU type and operating system type.
+ * This file should only contain preprocessor commands so that
+ * there are no dependencies on other files.
+ *
+ * cpuopsys.h
+ *
+ * Copyright (c) 2001, Nvidia Corporation. All rights reserved.
+ */
+
+/*!
+ * Uniform names are defined for compile time options to distinguish
+ * CPU types and Operating systems.
+ * Distinctions between CPU and OpSys should be orthogonal.
+ *
+ * These uniform names have initially been defined by keying off the
+ * makefile/build names defined for builds in the OpenGL group.
+ * Getting the uniform names defined for other builds may require
+ * different qualifications.
+ *
+ * The file is placed here to allow for the possibility of all driver
+ * components using the same naming convention for conditional compilation.
+ */
+
+#ifndef __cpuopsys_h_
+#define __cpuopsys_h_
+
+/*****************************************************************************/
+// Define all OS/CPU-Chip related symbols
+
+// ***** DOS variations
+#if defined(__DJGPP__)
+# define NV_DOS
+#endif
+
+// ***** WINDOWS variations
+#if defined(_WIN32) || defined(_WIN16)
+# define NV_WINDOWS
+
+# if defined(_WIN32_WINNT)
+# define NV_WINDOWS_NT
+# elif defined(_WIN32_WCE)
+# define NV_WINDOWS_CE
+# elif !defined(NV_MODS)
+# define NV_WINDOWS_9X
+# endif
+#endif // _WIN32 || defined(_WIN16)
+
+// ***** Unix variations
+#if defined(__linux__) && !defined(NV_LINUX)
+# define NV_LINUX
+#endif // defined(__linux__)
+
+// SunOS + gcc
+#if defined(__sun__) && defined(__svr4__)
+# define NV_SUNOS
+#endif // defined(__sun__) && defined(__svr4__)
+
+// SunOS + Sun Compiler (named SunPro, Studio or Forte)
+#if defined(__SUNPRO_C) || defined(__SUNPRO_CC)
+# define NV_SUNPRO_C
+# define NV_SUNOS
+# define __FUNCTION__ __func__
+# define NV_OPENGL_THREAD_UNSAFE // XXX To start with
+#endif // defined(_SUNPRO_C) || defined(__SUNPRO_CC)
+
+#if defined(__FreeBSD__)
+# define NV_BSD
+#endif // defined(__FreeBSD__)
+
+// XXXar don't define NV_UNIX on MacOSX or vxworks or dos or QNX
+#if (defined(__unix__) || defined(__unix) ) && !defined(macosx) && !defined(vxworks) && !defined(__DJGPP__) && !defined(NV_UNIX) && !defined(__QNX__) && !defined(__QNXNTO__)// XXX until removed from Makefiles
+# define NV_UNIX
+#endif // defined(__unix__)
+
+#if (defined(__QNX__) || defined(__QNXNTO__)) && !defined(NV_QNX)
+# define NV_QNX
+#endif
+
+// ***** Apple variations
+#if defined(macintosh) || defined(__APPLE__)
+# define NV_MACINTOSH
+# if defined(__MACH__)
+# define NV_MACINTOSH_OSX
+# if !defined(NV_MODS)
+# define NV_MACOSX_OPENGL
+# endif
+# else
+# define NV_MACINTOSH_OS9
+# endif
+# if defined(__LP64__)
+# define NV_MACINTOSH_64
+# endif
+#endif // defined(macintosh)
+
+// ***** VxWorks
+// Tornado 2.21 is gcc 2.96 and #defines __vxworks.
+// Tornado 2.02 is gcc 2.7.2 and doesn't define any OS symbol, so we rely on
+// the build system #defining vxworks.
+#if defined(__vxworks) || defined(vxworks)
+# define NV_VXWORKS
+# if (CPU==PENTIUM)
+# define NV_VXWORKS_PENTIUM
+# elif (CPU==PPC604)
+# define NV_VXWORKS_PPC604
+# endif
+#endif
+
+// ***** Integrity OS
+#if defined(__INTEGRITY)
+# if !defined(NV_INTEGRITY)
+# define NV_INTEGRITY
+# endif
+#endif
+
+// ***** Processor type variations
+// Note: The prefix NV_CPU_* is taken by \\sw\main\sdk\nvidia\inc\Nvcm.h
+
+#if ((defined(_M_IX86) || defined(__i386__) || defined(__i386)) && !defined(NVCPU_X86)) // XXX until removed from Makefiles
+ // _M_IX86 for windows, __i386__ for Linux (or any x86 using gcc)
+ // __i386 for Studio compiler on Solaris x86
+# define NVCPU_X86 // any IA32 machine (not x86-64)
+#endif
+
+#if defined(_WIN32) && defined(_M_IA64)
+# define NVCPU_IA64_WINDOWS // any IA64 for Windows opsys
+#endif
+#if defined(NV_LINUX) && defined(__ia64__)
+# define NVCPU_IA64_LINUX // any IA64 for Linux opsys
+#endif
+#if defined(NVCPU_IA64_WINDOWS) || defined(NVCPU_IA64_LINUX) || defined(IA64)
+# define NVCPU_IA64 // any IA64 for any opsys
+#endif
+
+#if (defined(NV_MACINTOSH) && !(defined(__i386__) || defined(__x86_64__))) || defined(__PPC__) || defined(__ppc)
+# ifndef NVCPU_PPC
+# define NVCPU_PPC // any PowerPC architecture
+# endif
+# ifndef NV_BIG_ENDIAN
+# define NV_BIG_ENDIAN
+# endif
+#endif
+
+#if defined(__x86_64) || defined(AMD64) || defined(_M_AMD64)
+# define NVCPU_X86_64 // any x86-64 for any opsys
+#endif
+
+#if defined(__arm__) && !defined(NVCPU_ARM)
+# define NVCPU_ARM
+#endif
+
+#if defined(__XSCALE__)
+#define NVCPU_XSCALE // for XSCALE ARM processors
+#endif
+
+#if defined(__SH4__)
+# ifndef NVCPU_SH4
+# define NVCPU_SH4 // Renesas (formerly Hitachi) SH4
+# endif
+#endif
+
+// For Xtensa processors
+#if defined(__XTENSA__)
+# define NVCPU_XTENSA
+# if defined(__XTENSA_EB__)
+# define NV_BIG_ENDIAN
+# endif
+#endif
+
+
+// Other flavors of CPU type should be determined at run-time.
+// For example, an x86 architecture with/without SSE.
+// If it can compile, then there's no need for a compile time option.
+// For some current GCC limitations, these may be fixed by using the Intel
+// compiler for certain files in a Linux build.
+
+
+#if defined(NVCPU_IA64) || defined(NVCPU_X86_64)
+# define NV_64_BITS // all architectures where pointers are 64 bits
+#else
+ // we assume 32 bits. I don't see a need for NV_16_BITS.
+#endif
+
+// NOTE: NV_INT64_OK is not needed in the OpenGL driver for any platform
+// we care about these days. The only consideration is that Linux does not
+// have a 64-bit divide on the server. To get around this, we convert the
+// expression to (double) for the division.
+#if (!(defined(macintosh) || defined(vxworks) || defined(__INTEL_COMPILER)) || defined(NV_LINUX)) && !defined(NV_INT64_OK)
+#define NV_INT64_OK
+#endif
+
+// For verification-only features not intended to be included in normal drivers
+#if defined(NV_MODS) && defined(DEBUG) && !defined(NV_DOS)
+#define NV_VERIF_FEATURES
+#endif
+
+
+/*
+ * New, safer family of #define's -- these ones use 0 vs. 1 rather than
+ * defined/!defined. This is advantageous because if you make a typo, say:
+ *
+ * #if NVCPU_IS_BIG_ENDAIN // Oops! Endian is misspelled
+ *
+ * ...some compilers can give you a warning telling you that you screwed up.
+ * The compiler can also give you a warning if you forget to #include
+ * "cpuopsys.h" in your code before the point where you try to use these
+ * conditionals.
+ *
+ * Also, the names have been prefixed in more cases with "CPU" or "OS" for
+ * increased clarity. You can tell the names apart from the old ones because
+ * they all use "_IS_" in the name.
+ *
+ * Finally, these can be used in "if" statements and not just in #if's. For
+ * example:
+ *
+ * if (NVCPU_IS_BIG_ENDIAN) x = Swap32(x);
+ *
+ * Maybe some day in the far-off future these can replace the old #define's.
+ */
+#if defined(NV_WINDOWS)
+#define NVOS_IS_WINDOWS 1
+#else
+#define NVOS_IS_WINDOWS 0
+#endif
+#if defined(NV_WINDOWS_CE)
+#define NVOS_IS_WINDOWS_CE 1
+#else
+#define NVOS_IS_WINDOWS_CE 0
+#endif
+#if defined(NV_LINUX)
+#define NVOS_IS_LINUX 1
+#else
+#define NVOS_IS_LINUX 0
+#endif
+#if defined(NV_UNIX)
+#define NVOS_IS_UNIX 1
+#else
+#define NVOS_IS_UNIX 0
+#endif
+#if defined(NV_QNX)
+#define NVOS_IS_QNX 1
+#else
+#define NVOS_IS_QNX 0
+#endif
+#if defined(NV_MACINTOSH)
+#define NVOS_IS_MACINTOSH 1
+#else
+#define NVOS_IS_MACINTOSH 0
+#endif
+#if defined(NV_VXWORKS)
+#define NVOS_IS_VXWORKS 1
+#else
+#define NVOS_IS_VXWORKS 0
+#endif
+#if defined(NV_INTEGRITY)
+#define NVOS_IS_INTEGRITY 1
+#else
+#define NVOS_IS_INTEGRITY 0
+#endif
+#if defined(NVCPU_X86)
+#define NVCPU_IS_X86 1
+#else
+#define NVCPU_IS_X86 0
+#endif
+#if defined(NVCPU_IA64)
+#define NVCPU_IS_IA64 1
+#else
+#define NVCPU_IS_IA64 0
+#endif
+#if defined(NVCPU_X86_64)
+#define NVCPU_IS_X86_64 1
+#else
+#define NVCPU_IS_X86_64 0
+#endif
+#if defined(NVCPU_PPC)
+#define NVCPU_IS_PPC 1
+#else
+#define NVCPU_IS_PPC 0
+#endif
+#if defined(NVCPU_ARM)
+#define NVCPU_IS_ARM 1
+#else
+#define NVCPU_IS_ARM 0
+#endif
+#if defined(NVCPU_SH4)
+#define NVCPU_IS_SH4 1
+#else
+#define NVCPU_IS_SH4 0
+#endif
+#if defined(NVCPU_XTENSA)
+#define NVCPU_IS_XTENSA 1
+#else
+#define NVCPU_IS_XTENSA 0
+#endif
+#if defined(NV_BIG_ENDIAN)
+#define NVCPU_IS_BIG_ENDIAN 1
+#else
+#define NVCPU_IS_BIG_ENDIAN 0
+#endif
+#if defined(NV_64_BITS)
+#define NVCPU_IS_64_BITS 1
+#else
+#define NVCPU_IS_64_BITS 0
+#endif
+
+/*****************************************************************************/
+
+#endif /* __cpuopsys_h_ */
diff --git a/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/gfrm_clock_ids.h b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/gfrm_clock_ids.h
new file mode 100755
index 00000000..bd0d1209
--- /dev/null
+++ b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/gfrm_clock_ids.h
@@ -0,0 +1,22 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/** @file clock_ids.h
+ Clock List & string names
+*/
+
+GFRM_CLOCK(OSC,"osc")
+GFRM_CLOCK(ROSC,"rosc")
+GFRM_CLOCK_PLL(PLL1,"pll1")
+GFRM_CLOCK_PLL(PLL2,"pll2")
+GFRM_CLOCK(REFCLK0,"refclk0")
+GFRM_CLOCK(REFCLK1,"refclk1")
+GFRM_CLOCK(REFCLK2,"refclk2")
+GFRM_CLOCK_PLL(PLL3,"pll3")
+
diff --git a/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/gfrm_module_ids.h b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/gfrm_module_ids.h
new file mode 100755
index 00000000..fb644b13
--- /dev/null
+++ b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/gfrm_module_ids.h
@@ -0,0 +1,56 @@
+/* Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an
+ * express license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/** @file module_ids.h
+ Module List & string names
+*/
+
+
+GFRM_MODULE(HOST1X, "host1x")
+GFRM_MODULE(MPD,"mpd")
+GFRM_MODULE(ME,"me")
+GFRM_MODULE(JPEGE,"jpege")
+GFRM_MODULE(VI,"vi")
+GFRM_MODULE(EPP,"epp")
+GFRM_MODULE(ISP,"isp")
+GFRM_MODULE(DSPCORE,"dspcore")
+GFRM_MODULE(GR2D,"gr2d")
+GFRM_MODULE(GR3D,"gr3d")
+GFRM_MODULE(DISPLAY,"display")
+GFRM_MODULE(I2S,"i2s")
+GFRM_MODULE(IC,"ic")
+GFRM_MODULE(SD,"sd")
+GFRM_MODULE(MC,"mc")
+GFRM_MODULE(EMC,"emc")
+GFRM_MODULE(DSP,"dsp")
+GFRM_MODULE(EFUSE,"efuse")
+GFRM_MODULE(AUDIO,"audio")
+GFRM_MODULE(TVO,"tvo")
+GFRM_MODULE(DISPLAYB,"displayb")
+GFRM_MODULE(I2SB,"i2sb")
+GFRM_MODULE(DSPB,"dspb")
+GFRM_MODULE(CVE,"cve")
+GFRM_MODULE(DSPBCORE,"dspbcore")
+GFRM_MODULE(CSI,"csi")
+GFRM_MODULE(TVDAC,"tvdac")
+GFRM_MODULE(APB,"apb")
+GFRM_MODULE(RESET, "reset")
+GFRM_MODULE(SPROM, "sprom")
+GFRM_MODULE(GPIO, "gpio")
+GFRM_MODULE(CLK, "clk")
+GFRM_MODULE(UART, "uart")
+GFRM_MODULE(UART2, "uart2")
+GFRM_MODULE(UART3, "uart3")
+GFRM_MODULE(TIMER, "timer")
+GFRM_MODULE(KBC, "kbc")
+GFRM_MODULE(DMA, "dma")
+GFRM_MODULE(USB, "usb")
+GFRM_MODULE(CEATA, "ceata")
+GFRM_MODULE(FLASH, "flash")
+GFRM_MODULE(XHOST, "xhost")
diff --git a/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/nvboard.h b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/nvboard.h
new file mode 100755
index 00000000..9277a904
--- /dev/null
+++ b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/nvboard.h
@@ -0,0 +1,619 @@
+/*
+ * Copyright (c) 2006 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an express
+ * license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+#ifndef NVBOARD_H
+#define NVBOARD_H
+
+#include "nvcommon.h"
+#include "nverror.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+/** NvBoard - Board Support Package
+
+ NvBoard is designed to decouple customer platform specifics from generic
+ binary only drivers.
+
+ The interface must be thread-safe.
+ */
+
+typedef struct NvBoardAperture_t
+{
+ /* Physical Address */
+ NvPhysAddr address;
+
+ /* Size of Aperture */
+ NvU32 size;
+} NvBoardAperture;
+
+typedef struct NvBoardApertureIO_t
+{
+ void ( *Write8 )( void *pAddress, NvU8 data );
+ void ( *Write16 )( void *pAddress, NvU16 data );
+ void ( *Write32 )( void *pAddress, NvU32 data );
+ void ( *Write64 )( void *pAddress, NvU64 data );
+ NvU8 ( *Read8 )( void *pAddress );
+ NvU16 ( *Read16 )( void *pAddress );
+ NvU32 ( *Read32 )( void *pAddress );
+ NvU64 ( *Read64 )( void *pAddress );
+} NvBoardApertureIO;
+
+typedef struct NvBoardApertures_t
+{
+ NvBoardAperture hostInterface;
+
+ /* pIO is null unless the apertures cannot be dereferenced */
+ NvBoardApertureIO *pIO;
+} NvBoardApertures;
+
+typedef enum
+{
+ /* Bus type A */
+ NvBoardBusType_A,
+
+ /* Bus type C */
+ NvBoardBusType_C,
+
+ NvBoardBusType_Forceword = 0x7fffffff,
+} NvBoardBusType;
+
+typedef enum
+{
+ /* Direct Addressing */
+ NvBoardBusAddressing_Direct,
+
+ /* Indirect Addressing */
+ NvBoardBusAddressing_Indirect,
+
+ NvBoardBusAddressing_Forceword = 0x7fffffff,
+} NvBoardBusAddressing;
+
+typedef enum
+{
+ /* 16-bit bus */
+ NvBoardBusWidth_16,
+
+ /* 32-bit bus */
+ NvBoardBusWidth_32,
+
+ NvBoardBusWidth_Forceword = 0x7fffffff,
+} NvBoardBusWidth;
+
+typedef enum
+{
+ /* Handshake mode. */
+ NvBoardBusMode_Handshake,
+
+ /* Fixed cycle mode. */
+ NvBoardBusMode_FixedCycle,
+
+ NvBoardBusMode_Forceword = 0x7fffffff,
+} NvBoardBusMode;
+
+typedef enum
+{
+ /* Asynchronous. */
+ NvBoardBusSynchronization_Asynchronous,
+
+ /* Synchronous. */
+ NvBoardBusSynchronization_Synchronous,
+
+ NvBoardBusSynchronization_Forceword = 0x7fffffff,
+} NvBoardBusSynchronization;
+
+typedef enum
+{
+ /* Active low. */
+ NvBoardBusReadyPolarity_ActiveLow,
+
+ /* Active high. */
+ NvBoardBusReadyPolarity_ActiveHigh,
+
+ NvBoardBusReadyPolarity_Forceword = 0x7fffffff,
+} NvBoardBusReadyPolarity;
+
+typedef struct NvBoardMode_t
+{
+ NvBoardBusAddressing GPUaddressing; // Bus perspective from GPU
+ NvBoardBusWidth GPUwidth;
+ NvBoardBusAddressing CPUaddressing; // Bus perspective from CPU
+ NvBoardBusWidth CPUwidth;
+ NvBoardBusType type;
+ NvBoardBusMode mode;
+ NvBoardBusSynchronization synchronization;
+ NvBoardBusReadyPolarity readyPolarity;
+} NvBoardMode;
+
+/** Stateless methods. Methods can be called before NvBoardInit */
+
+/** NvBoardListSupportedModes - Method to enumerate the modes of the board
+
+ Two calls should be made to this method.
+
+ On the first call, the method populates the number of modes, for the
+ display. When this call is issued pMode should be NULL.
+
+ On the second call, the length of the pMode array is indicated by
+ the value of *pNum. When pNum is less than the number of modes the
+ method populates the pMode array with only the first pNum modes.
+ When is more than the number of modes, the method populates the
+ pMode array with the number of modes and writes the number of modes
+ into pNum.
+
+ The first mode enumerated by this method is the recommended / default mode
+ for the display.
+
+ @param pNum unsigned integer value indicating the number of modes in
+ the array pMode.
+
+ @param pMode pointer to an array of mode structures, where the size of
+ the array is determined by the value in pNum.
+
+ @retval NvSuccess - on success
+ NvErrorBadParameter - when at least one parameter is incorrect
+ */
+NvError
+NvBoardListSupportedModes( NvU32 *pNum, NvBoardMode *pMode );
+
+/** Library Initialization */
+
+/** NvBoardInit - platform initialization. Typically chip select is configured here.
+
+ NvBoardInit uses a reference counter. The first invocation performs the
+ initialization, all future calls increment the counter. The counter is
+ decremented by NvBoardDeInit.
+
+ This method is to be called before any other NvBoard methods can be used.
+
+ @param pMode pointer to structure containing a mode to set on the board.
+ If mode is null, the recommended mode will be chosen.
+ */
+NvError
+NvBoardInit( const NvBoardMode *pMode );
+
+/** NvBoardDeInit - platform deinitialization.
+ */
+void
+NvBoardDeInit( void );
+
+/** Wince platform resume control */
+NvError
+NvBoardResume( void );
+
+/** Wince platform suspend control */
+NvError
+NvBoardSuspend( void );
+
+/** SD card detect status when card detect pin is connected to CPU GPIO pin */
+NvError
+nvBoardSDCardDetectStatus(NvU32 *bCardInserted);
+
+/** SD card detect sysintr number if card detect pin is connected to CPU GPIO pin*/
+NvError
+nvBoardSDCardDetectSysintr(NvU32 *dwSysintr);
+
+/** SD card socket power pin configuration
+ In general, this pin is connected to CPU GPIO pin, and we need to configure
+ GPIO input/output mode and setup default value
+*/
+NvError
+nvBoardSDSocketPowerInit(void);
+
+/** SD card socket power control*/
+NvError
+nvBoardSDSocketPowerOnOff(NvU32 SDPowerOn);
+
+/** Camera(VI) interface power plane control*/
+NvError
+nvBoardVIPowerOnOff(NvU32 VIPowerOn);
+
+/** OEM specific powerOn related calls after NV backlight ON.
+
+ @retval ERROR_SUCCESS on success or appropriate wince error
+ codes.
+*/
+NvError
+nvBoard_PostOEMBacklightOn(void);
+
+/** OEM specific powerOff related calls after NV backlight Off.
+
+ @retval ERROR_SUCCESS on success or appropriate wince error
+ codes.
+*/
+NvError
+nvBoard_PostOEMBacklightOff(void);
+
+/** NvBoardGetApertures - get apertures
+ */
+NvError
+NvBoardGetApertures( NvBoardApertures *pApertures );
+
+/** NvBoardGetMode - get current mode
+ */
+NvError
+NvBoardGetMode( NvBoardMode *pMode );
+
+/** Device Events -- Abstraction for interrupts */
+
+/* NvDeviceEvent enumerates the types of events. NvBoard implementors should not
+ hardcode event names. The only enumerated value that should be used in the
+ implementation of NvBoard is NvDeviceEvent_Num.
+ */
+typedef enum NvDeviceEvent_t
+{
+ /* NOTE: Currently using unabstracted events until INTx is removed. */
+ NvDeviceEvent_HOST = 0,
+ NvDeviceEvent_GRMPD,
+ NvDeviceEvent_ME,
+ NvDeviceEvent_JPEGE,
+ NvDeviceEvent_VI,
+ NvDeviceEvent_EPP,
+ NvDeviceEvent_ISP,
+ NvDeviceEvent_DSP,
+ NvDeviceEvent_GR2D,
+ NvDeviceEvent_GR3D,
+ NvDeviceEvent_DISPLAY,
+ NvDeviceEvent_I2S,
+ NvDeviceEvent_IC,
+ NvDeviceEvent_SD,
+ NvDeviceEvent_MC,
+ NvDeviceEvent_EMC,
+
+ /* NUM should always be the 2nd last enumerated value */
+ NvDeviceEvent_Num,
+
+ NvDeviceEvent_Forceword = 0x7fffffff,
+} NvDeviceEvent;
+
+/** NvBoardEnableEvent - Method to enable an event
+
+ If the event is fired before a client is waiting, the event will be remembered
+ for the next NvBoardWaitForEvent invocation.
+ */
+NvError
+NvBoardEnableEvent( NvDeviceEvent event );
+
+/** NvBoardDisableEvent - Method to disable an event
+ */
+void
+NvBoardDisableEvent( NvDeviceEvent event );
+
+/** NvBoardWaitForEvent - This method blocks until the event is fired
+
+ Each event may only have one client waiting on it. If more than one client
+ needs to be notified of an event, a broadcast layer will need to be
+ developed on top of this API.
+
+ Once an event is fired, it is disabled. To reenable the event use
+ NvBoardEnableEvent.
+*/
+NvError
+NvBoardWaitForEvent( NvDeviceEvent event );
+
+/** NvBoardWaitForEventWithTimeOut - NvBoardWaitForEvent with a timeout
+
+ @param timeOut Unit is milliseconds
+ */
+NvError
+NvBoardWaitForEventWithTimeOut( NvDeviceEvent event, NvU32 timeOut );
+
+/** I2C I/O */
+
+/** NvBoardI2CWrite - I2C write operation. Implementing this function is optional.
+ */
+NvError
+NvBoardI2CWrite( NvU32 addr, const void *ptr, NvU32 size );
+
+/** NvBoardI2CRead - I2C read operation. Implementing this function is optional.
+ */
+NvError
+NvBoardI2CRead( NvU32 addr, void *ptr, NvU32 size );
+
+/** Voltage and power control */
+
+typedef enum NvBoardPowerPlane_t
+{
+ NvBoardPowerPlane_AOCVDD = 0,
+ NvBoardPowerPlane_VECVDD,
+ NvBoardPowerPlane_MMCVDD,
+ NvBoardPowerPlane_TDCVDD,
+ NvBoardPowerPlane_VVDD,
+ NvBoardPowerPlane_EMVDD,
+ NvBoardPowerPlane_ACVDD,
+ NvBoardPowerPlane_LVDD,
+ NvBoardPowerPlane_HVDD,
+ NvBoardPowerPlane_AUXVDD,
+ NvBoardPowerPlane_R1CVDD,
+ NvBoardPowerPlane_SDVDD,
+ NvBoardPowerPlane_DRAM,
+
+ NvBoardPowerPlane_Forceword = 0x7fffffff,
+} NvBoardPowerPlane;
+
+typedef enum NvBoardClock_t
+{
+ NvBoardClock_PLL1 = 0,
+ NvBoardClock_PLL2,
+ NvBoardClock_COSC,
+ NvBoardClock_ROSC,
+ NvBoardClock_REF1,
+ NvBoardClock_REF2,
+
+ NvBoardClock_Forceword = 0x7fffffff,
+} NvBoardClock;
+
+/** NvBoardSetVoltage - change voltage of hardware block
+
+ @param voltage Unit is millivolts
+ */
+NvError
+NvBoardSetVoltage( NvBoardPowerPlane block, NvU32 voltage );
+
+/** NvBoardGetVoltage - get voltage of hardware block
+
+ @param voltage Unit is millivolts
+ */
+NvError
+NvBoardGetVoltage( NvBoardPowerPlane plane, NvU32 *voltage );
+
+/** NvBoardPowerOn - enable power to block
+ */
+NvError
+NvBoardPowerOn( NvBoardPowerPlane plane );
+
+/** NvBoardPowerOff - disable power to block
+ */
+NvError
+NvBoardPowerOff( NvBoardPowerPlane plane );
+
+/** NvBoardClockOn - enable clock
+ */
+NvError
+NvBoardClockOn( NvBoardClock clock );
+
+/** NvBoardClockOff - disable clock
+ */
+NvError
+NvBoardClockOff( NvBoardClock clock );
+
+/** NvBoardSetFrequency - set frequency of clock
+
+ @param frequency unit is KHz
+ */
+NvError
+NvBoardSetFrequency( NvBoardClock clock, NvU32 frequency );
+
+
+/** Platfrom specific debug function. This like an ioctl to the platfrom
+ sepcific code.
+ */
+void NvBoardDebug(void *p, NvU32 op, NvU32 arg);
+
+/** Event notification */
+
+typedef enum
+{
+ NvBoardDeviceType_Silicon,
+ NvBoardDeviceType_Emulator,
+ NvBoardDeviceType_Forceword = 0x7fffffff,
+} NvBoardDeviceType;
+
+typedef struct NvBoardDeviceInfo_t
+{
+ NvU32 MinorRev;
+ NvU32 MajorRev;
+ NvU32 ChipID;
+ NvU32 Family;
+ NvBoardDeviceType Type;
+} NvBoardDeviceInfo;
+
+/** NvBoardPostChipInit - Called after the chip is intialized.
+
+ Chip specific timings can be programmed at this point.
+
+ NvIrqPostChipInit should be called here.
+ */
+NvError
+NvBoardPostChipInit( NvBoardDeviceInfo *deviceInfo );
+
+/** NvBoardPreChipDeInit - Called before chip is shutdown.
+
+ NvIrqPreChipDeInit should be called here.
+ */
+NvError
+NvBoardPreChipDeInit( void );
+
+/** NvBoardClockSwitch - Clock switch handling
+
+ @param frequency Unit is kHz
+ */
+NvError
+NvBoardClockSwitch( NvU32 frequency );
+
+typedef enum NvBoardStateEvent_t
+{
+#ifdef NV_WINDOWS_CE
+ NvBoardStateEvent_PreDeviceInit,
+ NvBoardStateEvent_PostDeviceInit,
+ NvBoardStateEvent_PrePanelInit,
+ NvBoardStateEvent_PostPanelInit,
+ NvBoardStateEvent_PreSetMode,
+ NvBoardStateEvent_PostSetMode,
+ NvBoardStateEvent_PreDisplayInit,
+ NvBoardStateEvent_PostDisplayInit,
+ NvBoardStateEvent_PreOEMPowerHandlerVideoPowerOff,
+ NvBoardStateEvent_PostOEMPowerHandlerVideoPowerOff,
+ NvBoardStateEvent_PreOEMPowerHandlerVideoPowerOn,
+ NvBoardStateEvent_PostOEMPowerHandlerVideoPowerOn,
+#endif
+
+ NvBoardStateEvent_Forceword = 0x7fffffff,
+} NvBoardStateEvent;
+
+/** NvBoardGlobalStateNotification - Called during global state transitions
+
+ Only used on Windows CE at the moment.
+ */
+NvError
+NvBoardGlobalStateNotification( NvBoardStateEvent event );
+
+void
+NvBoardOsWaitUS( NvU32 usec );
+
+void
+NvBoardOsSleepMS( NvU32 msec );
+
+typedef struct NvBoardOsMutex_t *NvBoardOsMutex;
+typedef struct NvBoardOsSemaphore_t *NvBoardOsSemaphore;
+typedef struct NvBoardOsThread_t *NvBoardOsThread;
+
+NvError
+NvBoardOsMutexCreate( const char *key, NvBoardOsMutex *mutex );
+
+void
+NvBoardOsMutexLock( NvBoardOsMutex mutex );
+
+void
+NvBoardOsMutexUnlock( NvBoardOsMutex mutex );
+
+void
+NvBoardOsMutexDestroy( NvBoardOsMutex mutex );
+
+typedef struct NvBoardOsSharedMemDescriptor_t *NvBoardOsSharedMemDescriptor;
+
+NvError
+NvBoardOsSharedMemAlloc( const char *key, size_t size,
+ NvBoardOsSharedMemDescriptor *descriptor );
+
+NvError
+NvBoardOsSharedMemMap( NvBoardOsSharedMemDescriptor descriptor, size_t offset,
+ size_t size, void **ptr );
+
+void
+NvBoardOsSharedMemUnmap( void *ptr, size_t size );
+
+void
+NvBoardOsSharedMemFree( NvBoardOsSharedMemDescriptor descriptor );
+
+void
+NvBoardOsMemset( void *s, NvU8 c, size_t size );
+
+int
+NvBoardOsMemcmp( const void *s1, const void *s2, size_t size );
+
+#define NVBOARDOS_KEY_MAX 128
+
+#define NVBOARDOS_MEM_NONE 0x0
+#define NVBOARDOS_MEM_READ 0x1
+#define NVBOARDOS_MEM_WRITE 0x2
+#define NVBOARDOS_MEM_EXECUTE 0x4
+#define NVBOARDOS_MEM_READ_WRITE ( NVBOARDOS_MEM_READ | NVBOARDOS_MEM_WRITE )
+
+typedef enum
+{
+ NvBoardOsMemAttribute_Uncached = 0,
+ NvBoardOsMemAttribute_WriteBack = 1,
+ NvBoardOsMemAttribute_WriteCombined = 2,
+
+ NvBoardOsMemAttribute_Force32 = 0x7FFFFFFF
+} NvBoardOsMemAttribute;
+
+NvError
+NvBoardOsPhysicalMemMap( NvPhysAddr phys, size_t size,
+ NvBoardOsMemAttribute attrib, NvU32 flags, void **ptr );
+
+
+void
+NvBoardOsPhysicalMemUnmap( void *ptr, size_t size );
+
+NvError
+NvBoardOsMemoryAlloc(void **ptr, size_t size);
+
+void
+NvBoardOsMemoryFree(void *ptr, size_t size);
+
+NvError
+NvBoardOsGetConfigU32( const char *name, NvU32 *value );
+
+void *
+NvBoardOsAlloc( size_t size );
+
+void
+NvBoardOsFree( void *ptr );
+
+typedef void (*NvBoardOsThreadFunction)( void *args );
+
+NvError
+NvBoardOsThreadCreate( const char *name, NvBoardOsThreadFunction function,
+ void *args, NvBoardOsThread *thread );
+
+void
+NvBoardOsThreadJoin( NvBoardOsThread thread );
+
+void
+NvBoardOsThreadYield( void );
+
+NvError
+NvBoardOsSemaphoreCreate( const char *key, NvBoardOsSemaphore *semaphore,
+ NvU32 value );
+
+void
+NvBoardOsSemaphoreWait( NvBoardOsSemaphore semaphore );
+
+void
+NvBoardOsSemaphoreSignal( NvBoardOsSemaphore semaphore );
+
+void
+NvBoardOsSemaphoreDestroy( NvBoardOsSemaphore semaphore );
+
+NvError
+nvBoard_PreDisplayInit(void);
+
+NvError
+nvBoard_PostDisplayInit(void);
+
+NvError
+nvBoard_PrePanelInit(void);
+
+NvError
+nvBoard_PostPanelInit(void);
+
+NvError
+nvBoard_PreDeviceInit(void);
+
+NvError
+nvBoard_PostDeviceInit(void);
+
+NvError
+nvBoard_PreSetMode(void);
+
+NvError
+nvBoard_PostSetMode(void);
+
+NvError
+nvBoard_PreOEMPowerHandlerVideoPowerOff(void);
+
+NvError
+nvBoard_PostOEMPowerHandlerVideoPowerOff(void);
+
+NvError
+nvBoard_PreOEMPowerHandlerVideoPowerOn(void);
+
+NvError
+nvBoard_PostOEMPowerHandlerVideoPowerOn(void);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // NVBOARD_H
diff --git a/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/nvcommon.h b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/nvcommon.h
new file mode 100755
index 00000000..ab79088f
--- /dev/null
+++ b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/nvcommon.h
@@ -0,0 +1,153 @@
+/*
+ * Copyright (c) 2006 - 2007 NVIDIA Corporation. All Rights Reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an express
+ * license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+#ifndef NVCOMMON_H
+#define NVCOMMON_H
+
+#include "nvtypes.h"
+
+// Include headers that provide NULL, size_t, offsetof, and [u]intptr_t. In the
+// event that the toolchain doesn't provide these, provide them ourselves.
+#include
+#if NVOS_IS_WINDOWS_CE
+typedef int intptr_t;
+typedef unsigned int uintptr_t;
+#elif (NVOS_IS_LINUX && !defined(__KERNEL__)) || defined(__arm)
+#include
+#endif
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+/** nvcommon.h contains standard definitions used by various interfaces
+ */
+
+/** A physical address */
+#if NVOS_IS_WINDOWS
+typedef NvU64 NvPhysAddr;
+#else
+typedef NvU32 NvPhysAddr;
+#endif
+
+// For historical reasons that are hard to fix, nvtypes.h has an incorrect
+// definition of NV_ALIGN_BYTES for Windows and Macintosh, and for other
+// unsupported compilers like IAR. Provide a correct macro, which we call
+// NV_ALIGN. This can be removed if and when nvtypes.h is fixed.
+// Alternatively, we could use NV_DECLARE_ALIGNED...
+#if NVOS_IS_WINDOWS
+#define NV_ALIGN(size) __declspec(align(size))
+#elif defined(__GNUC__) || NVOS_IS_QNX
+#define NV_ALIGN(size) __attribute__ ((aligned (size)))
+#elif defined(__arm)
+#define NV_ALIGN(size) __align(size)
+#endif
+
+/**
+ * This macro wraps its argument with the equivalent of "#ifdef DEBUG", but also
+ * can be used where #ifdef's can't, like inside a macro.
+ */
+#if defined(DEBUG)
+#define NV_DEBUG_CODE(x) x
+#else
+#define NV_DEBUG_CODE(x)
+#endif
+
+/** Macro for determining the size of an array */
+#define NV_ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
+
+/** Macro for taking min or max of a pair of numbers */
+#define NV_MIN(a,b) (((a) < (b)) ? (a) : (b))
+#define NV_MAX(a,b) (((a) > (b)) ? (a) : (b))
+
+/**
+ * By convention, we use this value to represent an infinite wait interval in
+ * APIs that expect a timeout argument. A value of zero should not be
+ * interpreted as infinite -- it should be interpreted as "time out immediately
+ * and simply check whether the event has already happened."
+ */
+enum { NV_WAIT_INFINITE = 0xFFFFFFFF };
+
+/**
+ * Union that can be used to view a 32-bit word as your choice of a 32-bit
+ * unsigned integer, a 32-bit signed integer, or an IEEE single-precision float.
+ * Here is an example of how you might use it to extract the (integer) bitwise
+ * representation of a floating-point number:
+ * NvData32 data;
+ * data.f = 1.0f;
+ * printf("%x", data.u);
+ */
+typedef union NvData32Rec
+{
+ NvU32 u;
+ NvS32 i;
+ NvF32 f;
+} NvData32;
+
+/** NvPoint structure is used to determine a location on a 2-dimensional
+ object, where the coordinate (0,0) is located at the top-left of the
+ object. The values of x and y are in pixels.
+ */
+typedef struct _NvPoint_t
+{
+ /** horizontal location of the point */
+ NvS32 x;
+
+ /** vertical location of the point */
+ NvS32 y;
+
+} NvPoint;
+
+
+/** NvRect structure is used to define a 2-dimensional rectangle
+ where the rectangle is bottom right exclusive (i.e. the right most
+ column, and the bottom row of the rectangle is not included)
+ */
+typedef struct _NvRect_t
+{
+ /** left column of a rectangle */
+ NvS32 left;
+
+ /** top row of a rectangle*/
+ NvS32 top;
+
+ /** right column of a rectangle */
+ NvS32 right;
+
+ /** bottom row of a rectangle */
+ NvS32 bottom;
+
+} NvRect;
+
+
+/** NvSize structure is used to define a 2-dimensional surface
+ where the surface is determined by it's height and width in
+ pixels
+ */
+typedef struct _NvSize_t
+{
+ /* width of the surface in pixels */
+ NvS32 width;
+
+ /* height of the surface in pixels */
+ NvS32 height;
+
+} NvSize;
+
+
+/** NvDeviceHandle is an opaque handle to a device
+ */
+typedef struct NvDeviceStruct_t *NvDeviceHandle;
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* NVCOMMON_H */
diff --git a/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/nverror.h b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/nverror.h
new file mode 100755
index 00000000..6ef69080
--- /dev/null
+++ b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/nverror.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2006 NVIDIA Corporation. All Rights Reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an express
+ * license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+#ifndef NVERROR_H
+#define NVERROR_H
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+/* NvError_t enumeration contains ALL return / error codes. Error codes
+ are specifically explicit to make it easy to identify where an error
+ came from.
+
+ All error codes are derived from the macros in NvErrVal.h
+ */
+typedef enum _NvError_t
+{
+
+#ifdef NVERROR
+#undef NVERROR
+#endif /* NVERROR */
+
+#define NVERROR(_name_, _value_, _desc_) _name_ = _value_,
+
+ /* header included for macro expansion of error codes */
+ #include "nverrval.h"
+
+ /* bogus error code used to padd the enum to 32bits */
+ NvErrorMax = 0x7FFFFFFF
+
+#undef NVERROR
+
+} NvError;
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* NVERROR_H */
+
diff --git a/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/nverrval.h b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/nverrval.h
new file mode 100755
index 00000000..2045dd83
--- /dev/null
+++ b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/nverrval.h
@@ -0,0 +1,277 @@
+/*
+ * Copyright (c) 2006 NVIDIA Corporation. All Rights Reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software, related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an express
+ * license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/* NvErrVal.h is a header used for macro expansion of the errors defined for
+ the Nv methods & interfaces.
+
+ This header is NOT protected from being included multiple times, as it is
+ used for C pre-processor macro expansion of error codes, and the
+ descriptions of those error codes.
+
+ Each error code has a unique name, description and value to make it easier
+ for developers to identify the source of a failure. Thus there are no
+ generic or unknown error codes.
+*/
+
+/* common error codes */
+NVERROR(NvSuccess, 0x00000000, "success")
+NVERROR(NvError_NotImplemented, 0x00000001, "method or interface is not implemented")
+NVERROR(NvError_NotSupported, 0x00000002, "requested operation is not supported")
+NVERROR(NvError_NotInitialized, 0x00000003, "method or interface is not initialized")
+NVERROR(NvError_BadParameter, 0x00000004, "bad parameter to method or interface")
+NVERROR(NvError_Timeout, 0x00000005, "not completed in the expected time")
+NVERROR(NvError_InsufficientMemory, 0x00000006, "insufficient system memory")
+NVERROR(NvError_ReadOnlyAttribute, 0x00000007, "cannot write a read-only attribute")
+NVERROR(NvError_InvalidState, 0x00000008, "module is in invalid state to perform the requested operation")
+NVERROR(NvError_InvalidAddress, 0x00000009, "invalid address")
+NVERROR(NvError_InvalidSize, 0x0000000A, "invalid size")
+NVERROR(NvError_BadValue, 0x0000000B, "illegal value specified for parameter")
+
+/* surface specific error codes */
+NVERROR(NvError_InsufficientVideoMemory, 0x00010000, "insufficient video memory")
+NVERROR(NvError_BadSurfaceColorScheme, 0x00010001, "this surface scheme is not supported in the current controller")
+
+/* display specific error codes */
+NVERROR(NvError_DisplayIncompatible, 0x00020000, "display incompatible with method or interface")
+NVERROR(NvError_NoCompatibleMode, 0x00020001, "no compatible mode exists for the attached displays")
+NVERROR(NvError_ModeNotSupported, 0x00020002, "the mode is not supported by the display or controller")
+NVERROR(NvError_ControllerActive, 0x00020003, "the controller is active and cannot perform the operation")
+NVERROR(NvError_DisplayAlreadyAttached, 0x00020004, "the display is already attached to the controller")
+NVERROR(NvError_DetachDisplayFirst, 0x00020005, "the display is already attached to another controller")
+NVERROR(NvError_TooManyDisplays, 0x00020006, "the controller has not enough free display slots")
+NVERROR(NvError_NoDisplaysAttached, 0x00020007, "there are no displays attached to this controller")
+NVERROR(NvError_AlreadySuspended, 0x00020008, "the controller is already suspended")
+NVERROR(NvError_NotSuspended, 0x00020009, "the controller is not suspended, so cannot resume it")
+NVERROR(NvError_EmptyColorKeyRange, 0x00020010, "color key range that was set is empty")
+NVERROR(NvError_NoMode, 0x00020011, "controller is not driving a mode, cannot perform the selected action")
+NVERROR(NvError_NotInVerticalBlank, 0x00020012, "controller is not in vertical blank")
+
+/* DMA specific error codes */
+NVERROR(NvError_DmaTargetNotLocked, 0x00030000, "client does not have a lock for this target DMA controller")
+NVERROR(NvError_DmaCommunicationError, 0x00030001, "the DMA controller had failed to communicate with the target")
+NVERROR(NvError_DmaOpNotFinished, 0x00030002, "the DMA operation has not completed")
+NVERROR(NvError_DmaChannelNotAvailable, 0x00030003, "the requested DMA channel is not available")
+NVERROR(NvError_InvalidSourceId, 0x00030004, "invalid source ID")
+NVERROR(NvError_InvalidDestinationId, 0x00030005, "invalid destination ID")
+
+/* NvOs error codes */
+NVERROR(NvError_FileWriteFailed, 0x00040000, "the file write operation failed")
+NVERROR(NvError_FileReadFailed, 0x00040001, "the file read operation failed")
+NVERROR(NvError_EndOfFile, 0x00040002, "the end of file has been reached")
+NVERROR(NvError_FileOperationFailed, 0x00040003, "the file operation has failed")
+NVERROR(NvError_DirOperationFailed, 0x00040004, "the directory operation has failed")
+NVERROR(NvError_EndOfDirList, 0x00040005, "there are no more entries in the directory")
+NVERROR(NvError_ConfigVarNotFound, 0x00040006, "the configuration variable is not present")
+NVERROR(NvError_InvalidConfigVar, 0x00040007, "the configuration variable is corrupted")
+NVERROR(NvError_LibraryNotFound, 0x00040008, "the dynamic library was not found for open")
+NVERROR(NvError_SymbolNotFound, 0x00040009, "the symbol in a dyanmic library was not found")
+NVERROR(NvError_MemoryMapFailed, 0x0004000a, "the memory mapping operation failed")
+NVERROR(NvError_MutexCreateFailed, 0x0004000b, "the mutex create operation failed")
+NVERROR(NvError_SemaphoreCreateFailed, 0x0004000c, "the semaphore create operation failed")
+NVERROR(NvError_ThreadCreateFailed, 0x0004000d, "the thread create operation failed")
+NVERROR(NvError_SharedMemAllocFailed, 0x0004000e, "the shared memory allocation operation failed")
+
+/* NvBoard error codes */
+NVERROR(NvError_I2CNotAcknowledged, 0x00050000, "I2C acknowledge was not received")
+NVERROR(NvError_KernelDriverNotFound, 0x00050001, "unable to find kernel driver")
+NVERROR(NvError_KernelDriverBadVersion, 0x00050002, "the kernel driver is out of date")
+NVERROR(NvError_KernelDriverIOFailed, 0x00050003, "the driver operation failed")
+NVERROR(NvError_ModeMismatched, 0x00050004, "conflicting board mode")
+NVERROR(NvError_VoltageOutsideRange, 0x00050005, "requested voltage is outside valid range")
+NVERROR(NvError_EventNotEnabled, 0x00050006, "the event is not enabled")
+NVERROR(NvError_EventBusy, 0x00050007, "the event is busy")
+NVERROR(NvError_InterruptInitFailed, 0x00050008, "error initializing interrupts")
+
+/* NvIrq error codes */
+NVERROR(NvError_EventNotFound, 0x00060000, "no event found")
+
+/* Nv2D error codes */
+NVERROR(NvError_InvalidSurface, 0x00070000, "invalid surface")
+NVERROR(NvError_RopNotSupported, 0x00070001, "rop not supported")
+NVERROR(NvError_SurfaceNotSupported, 0x00070002, "surface is not supported")
+NVERROR(NvError_BitmapNotSupported, 0x00070003, "bitmap is not supported")
+
+/* NvPower error codes */
+NVERROR(NvError_ResourceAlreadyInUse, 0x00080000, "resource already in use")
+NVERROR(NvError_ResourceNotInUse, 0x00080001, "resource not in use")
+NVERROR(NvError_ResourceInUse, 0x00080002, "resource is in use")
+
+/* UART error codes */
+NVERROR(NvError_UartOverrun, 0x00090000, "overrun occurred when receiving the data")
+NVERROR(NvError_UartFraming, 0x00090001, "data received had framing error")
+NVERROR(NvError_UartParity, 0x00090002, "data received had parity error")
+NVERROR(NvError_UartFifoError, 0x00090003, "FIFO error occurred during receive/transmit")
+NVERROR(NvError_UartBreakReceived, 0x00090004, "received break signal")
+NVERROR(NvError_UartTransmit, 0x00090005, "UART transmit error")
+
+/* NvRm error code */
+NVERROR(NvError_RmInitFailed, 0x000a0000, "rm failed to initialize")
+NVERROR(NvError_RmChannelInitFailure, 0x000a0001, "channel init failed")
+NVERROR(NvError_RmStreamInitFailure, 0x000a0002, "stream init failed")
+NVERROR(NvError_RmSyncPointAllocFailure, 0x000a0003, "sync point alloc failed")
+NVERROR(NvError_RmStreamFlushFailure, 0x000a0004, "stream flush failed")
+
+/* NvIsp error codes */
+NVERROR(NvError_ChannelAllocFailed, 0x000B0000, "channel allocation failed")
+NVERROR(NvError_NoConnectedImager, 0x000B0001, "no imager connected")
+NVERROR(NvError_UnsupportedResolution, 0x000B0002, "unsupported resolution")
+NVERROR(NvError_I2CCommunicationError, 0x000B0003, "i2c communication failed")
+NVERROR(NvError_IspConfigFileParseError, 0x000B0004, "isp config file parse error")
+NVERROR(NvError_IspBusy, 0x000B0005, "isp 3A algorithm busy")
+NVERROR(NvError_TooDark, 0x000B0006, "image too dark for 3A operation")
+
+/* NvTest error codes */
+NVERROR(NvError_TestApplicationFailed, 0x000c0000, "the test application failed")
+NVERROR(NvError_TestNoUserInput, 0x000c0001, "no user input available")
+NVERROR(NvError_TestCommandLineError, 0x000c0002, "command line parsing error")
+
+/* NvCam error codes */
+NVERROR(NvError_VmAllocFailed, 0x000D0000, "virtual machine allocation failed")
+NVERROR(NvError_ScriptAccessFailed, 0x000D0001, "unable to access script")
+NVERROR(NvError_GettingComponentFailed, 0x000D0002, "getting component failed")
+NVERROR(NvError_VmBufferAllocFailed, 0x000D0003, "vm buffer allocation failed")
+NVERROR(NvError_CameraScriptNotPresent, 0x000D0004, "camera script not present")
+NVERROR(NvError_IllegalBayerValues, 0x000D0005, "illegal bayer values")
+NVERROR(NvError_ColorFormatNotSupported, 0x000D0006, "color format not supported")
+
+/* USBF error codes */
+NVERROR(NvError_UsbfTxfrActive, 0x000E0000, "The endpoint has an active transfer in progress.")
+NVERROR(NvError_UsbfTxfrComplete, 0x000E0001, "The endpoint has a completed transfer that has not been cleared.")
+NVERROR(NvError_UsbfEpStalled, 0x000E0002, "The endpoint has been placed in a halted or stalled state.")
+NVERROR(NvError_UsbfEpError, 0x000E0003, "The last transfer started on this endpoint failed to complete.")
+
+/* ^^^ ADD ALL NEW ERRORS RIGHT ABOVE HERE ^^^ */
+
+NVERROR(NvErrorNotImplemented, 0x00000001, "remove me later!")
+NVERROR(NvErrorNotSupported, 0x00000002, "remove me later!")
+NVERROR(NvErrorNotInitialized, 0x00000003, "remove me later!")
+NVERROR(NvErrorBadParameter, 0x00000004, "remove me later!")
+NVERROR(NvErrorTimeout, 0x00000005, "remove me later!")
+NVERROR(NvErrorInsufficientMemory, 0x00000006, "remove me later!")
+NVERROR(NvErrorReadOnlyAttribute, 0x00000007, "remove me later!")
+NVERROR(NvErrorInvalidState, 0x00000008, "remove me later!")
+NVERROR(NvErrorInvalidAddress, 0x00000009, "remove me later!")
+NVERROR(NvErrorInvalidSize, 0x0000000A, "remove me later!")
+NVERROR(NvErrorBadValue, 0x0000000B, "remove me later!")
+
+/* surface specific error codes */
+NVERROR(NvErrorInsufficientVideoMemory, 0x00010000, "remove me later!")
+NVERROR(NvErrorBadSurfaceColorScheme, 0x00010001, "remove me later!")
+
+/* display specific error codes */
+NVERROR(NvErrorDisplayIncompatible, 0x00020000, "remove me later!")
+NVERROR(NvErrorNoCompatibleMode, 0x00020001, "remove me later!")
+NVERROR(NvErrorModeNotSupported, 0x00020002, "remove me later!")
+NVERROR(NvErrorControllerActive, 0x00020003, "remove me later!")
+NVERROR(NvErrorDisplayAlreadyAttached, 0x00020004, "remove me later!")
+NVERROR(NvErrorDetachDisplayFirst, 0x00020005, "remove me later!")
+NVERROR(NvErrorTooManyDisplays, 0x00020006, "remove me later!")
+NVERROR(NvErrorNoDisplaysAttached, 0x00020007, "remove me later!")
+NVERROR(NvErrorAlreadySuspended, 0x00020008, "remove me later!")
+NVERROR(NvErrorNotSuspended, 0x00020009, "remove me later!")
+NVERROR(NvErrorEmptyColorKeyRange, 0x00020010, "remove me later!")
+NVERROR(NvErrorNoMode, 0x00020011, "remove me later!")
+NVERROR(NvErrorNotInVerticalBlank, 0x00020012, "remove me later!")
+
+/* DMA specific error codes */
+NVERROR(NvErrorDmaTargetNotLocked, 0x00030000, "remove me later!")
+NVERROR(NvErrorDmaCommunicationError, 0x00030001, "remove me later!")
+NVERROR(NvErrorDmaOpNotFinished, 0x00030002, "remove me later!")
+NVERROR(NvErrorDmaChannelNotAvailable, 0x00030003, "remove me later!")
+NVERROR(NvErrorInvalidSourceId, 0x00030004, "remove me later!")
+NVERROR(NvErrorInvalidDestinationId, 0x00030005, "remove me later!")
+
+/* NvOs error codes */
+NVERROR(NvErrorFileWriteFailed, 0x00040000, "remove me later!")
+NVERROR(NvErrorFileReadFailed, 0x00040001, "remove me later!")
+NVERROR(NvErrorEndOfFile, 0x00040002, "remove me later!")
+NVERROR(NvErrorFileOperationFailed, 0x00040003, "remove me later!")
+NVERROR(NvErrorDirOperationFailed, 0x00040004, "remove me later!")
+NVERROR(NvErrorEndOfDirList, 0x00040005, "remove me later!")
+NVERROR(NvErrorConfigVarNotFound, 0x00040006, "remove me later!")
+NVERROR(NvErrorInvalidConfigVar, 0x00040007, "remove me later!")
+NVERROR(NvErrorLibraryNotFound, 0x00040008, "remove me later!")
+NVERROR(NvErrorSymbolNotFound, 0x00040009, "remove me later!")
+NVERROR(NvErrorMemoryMapFailed, 0x0004000a, "remove me later!")
+NVERROR(NvErrorMutexCreateFailed, 0x0004000b, "remove me later!")
+NVERROR(NvErrorSemaphoreCreateFailed, 0x0004000c, "remove me later!")
+NVERROR(NvErrorThreadCreateFailed, 0x0004000d, "remove me later!")
+NVERROR(NvErrorSharedMemAllocFailed, 0x0004000e, "remove me later!")
+
+/* NvBoard error codes */
+NVERROR(NvErrorI2CNotAcknowledged, 0x00050000, "remove me later!")
+NVERROR(NvErrorKernelDriverNotFound, 0x00050001, "remove me later!")
+NVERROR(NvErrorKernelDriverBadVersion, 0x00050002, "remove me later!")
+NVERROR(NvErrorKernelDriverIOFailed, 0x00050003, "remove me later!")
+NVERROR(NvErrorModeMismatched, 0x00050004, "remove me later!")
+NVERROR(NvErrorVoltageOutsideRange, 0x00050005, "remove me later!")
+NVERROR(NvErrorEventNotEnabled, 0x00050006, "remove me later!")
+NVERROR(NvErrorEventBusy, 0x00050007, "remove me later!")
+NVERROR(NvErrorInterruptInitFailed, 0x00050008, "remove me later!")
+
+/* NvIrq error codes */
+NVERROR(NvErrorEventNotFound, 0x00060000, "remove me later!")
+
+/* Nv2D error codes */
+NVERROR(NvErrorInvalidSurface, 0x00070000, "remove me later!")
+NVERROR(NvErrorRopNotSupported, 0x00070001, "remove me later!")
+NVERROR(NvErrorSurfaceNotSupported, 0x00070002, "remove me later!")
+NVERROR(NvErrorBitmapNotSupported, 0x00070003, "remove me later!")
+
+/* NvPower error codes */
+NVERROR(NvErrorResourceAlreadyInUse, 0x00080000, "remove me later!")
+NVERROR(NvErrorResourceNotInUse, 0x00080001, "remove me later!")
+NVERROR(NvErrorResourceInUse, 0x00080002, "remove me later!")
+
+/* UART error codes */
+NVERROR(NvErrorUartOverrun, 0x00090000, "remove me later!")
+NVERROR(NvErrorUartFraming, 0x00090001, "remove me later!")
+NVERROR(NvErrorUartParity, 0x00090002, "remove me later!")
+NVERROR(NvErrorUartFifoError, 0x00090003, "remove me later!")
+NVERROR(NvErrorUartBreakReceived, 0x00090004, "remove me later!")
+NVERROR(NvErrorUartTransmit, 0x00090005, "remove me later!")
+
+/* NvRm error code */
+NVERROR(NvErrorRmInitFailed, 0x000a0000, "remove me later!")
+NVERROR(NvErrorRmChannelInitFailure, 0x000a0001, "remove me later!")
+NVERROR(NvErrorRmStreamInitFailure, 0x000a0002, "remove me later!")
+NVERROR(NvErrorRmSyncPointAllocFailure, 0x000a0003, "remove me later!")
+NVERROR(NvErrorRmStreamFlushFailure, 0x000a0004, "remove me later!")
+
+/* NvIsp error codes */
+NVERROR(NvErrorChannelAllocFailed, 0x000B0000, "remove me later!")
+NVERROR(NvErrorNoConnectedImager, 0x000B0001, "remove me later!")
+NVERROR(NvErrorUnsupportedResolution, 0x000B0002, "remove me later!")
+NVERROR(NvErrorI2CCommunicationError, 0x000B0003, "remove me later!")
+NVERROR(NvErrorIspConfigFileParseError, 0x000B0004, "remove me later!")
+NVERROR(NvErrorIspBusy, 0x000B0005, "remove me later!")
+NVERROR(NvErrorTooDark, 0x000B0006, "remove me later!")
+
+/* NvTest error codes */
+NVERROR(NvErrorTestApplicationFailed, 0x000c0000, "remove me later!")
+NVERROR(NvErrorTestNoUserInput, 0x000c0001, "remove me later!")
+NVERROR(NvErrorTestCommandLineError, 0x000c0002, "remove me later!")
+
+/* NvCam error codes */
+NVERROR(NvErrorVmAllocFailed, 0x000D0000, "remove me later!")
+NVERROR(NvErrorScriptAccessFailed, 0x000D0001, "remove me later!")
+NVERROR(NvErrorGettingComponentFailed, 0x000D0002, "remove me later!")
+NVERROR(NvErrorVmBufferAllocFailed, 0x000D0003, "remove me later!")
+NVERROR(NvErrorCameraScriptNotPresent, 0x000D0004, "remove me later!")
+NVERROR(NvErrorIllegalBayerValues, 0x000D0005, "remove me later!")
+NVERROR(NvErrorColorFormatNotSupported, 0x000D0006, "remove me later!")
+
+/* USBF error codes */
+NVERROR(NvErrorUsbfTxfrActive, 0x000E0000, "remove me later!")
+NVERROR(NvErrorUsbfTxfrComplete, 0x000E0001, "remove me later!")
+NVERROR(NvErrorUsbfEpStalled, 0x000E0002, "remove me later!")
+NVERROR(NvErrorUsbfEpError, 0x000E0003, "remove me later!")
+
+
diff --git a/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/nvime.h b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/nvime.h
new file mode 100755
index 00000000..e533f47f
--- /dev/null
+++ b/kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/nvime.h
@@ -0,0 +1,849 @@
+/*
+ * Copyright (c) 2006 - 2007 NVIDIA Corporation. All rights reserved.
+ *
+ * NVIDIA Corporation and its licensors retain all intellectual property
+ * and proprietary rights in and to this software and related documentation
+ * and any modifications thereto. Any use, reproduction, disclosure or
+ * distribution of this software and related documentation without an express
+ * license agreement from NVIDIA Corporation is strictly prohibited.
+ */
+
+/*
+ * nvime.h
+ *
+ * A collection of image enhancing functions that utilize the GoForce
+ * h/w. This file contains the common routines that are used by all
+ * image enhancing functions, as well as the APIs/enums/defines that are
+ * specific to all image enhancing functions.
+ *
+ * PLEASE NOTE: NvIme is not thread-safe. All API calls must be made in
+ * a single thread, or the application must explicitly protect each NvIme
+ * call with its own mutex. Any other usage is not guaranteed to work.
+ */
+
+#ifndef NVIME
+#define NVIME
+
+#include "nvtypes.h"
+#include "GFRm.h"
+#include "GFGx.h"
+#include "GFVx.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct NvImeStruct_t *NvImeHandle;
+
+typedef enum {
+ NVIME_OK=0,
+ NVIME_OUT_OF_MEMORY=1,
+ NVIME_INIT_FAILED=2,
+ NVIME_INVALID_HANDLE=3,
+ NVIME_SURFACE_INDEX_OUT_OF_RANGE=4,
+ NVIME_INVALID_SURFACE=5,
+ NVIME_ILLEGAL_SURFACE_BASE=6,
+ NVIME_ILLEGAL_SURFACE_STRIDE=7,
+ NVIME_INVALID_ROTATION=8,
+ NVIME_INVALID_COORD=9,
+ NVIME_MISSING_SURFACE=10,
+ NVIME_INVALID_KERNEL=11,
+ NVIME_INVALID_KERNEL_SIZE=12,
+ NVIME_INVALID_PIXFMT=13,
+ NVIME_INVALID_LUT=14,
+ NVIME_UNSPECIFIED_OPERATION=15,
+ NVIME_UNSUPPORTED_OPERATION=16,
+ NVIME_OPERATION_FAILED=17,
+ NVIME_INVALID_FLAG=18,
+ NVIME_INVALID_GET=19,
+ NVIME_INVALID_SCALE=20,
+ NVIME_INVALID_BIAS=21,
+ NVIME_ILLEGAL_CSC_VALUES=22,
+ NVIME_ILLEGAL_COEFF=23,
+ NVIME_ILLEGAL_COEFF_ARRAY_SIZE=24,
+} NvImeStatus;
+
+
+// NvImeOpen()
+//
+// Initialize the library and return a handle to pass into all future
+// API calls into this library.
+
+NvImeStatus NvImeOpen(GFRmHandle hRm, NvImeHandle *phIme);
+
+
+// NvImeClose()
+//
+// Close down the library and relinquish all held resources.
+
+void NvImeClose(NvImeHandle *phIme);
+
+
+// NvImeSetSourceSurface()
+//
+// Set a source surface. "index" can be in 0..NVIME_MAX_SOURCE_SURFACES-1.
+// Because each source surface will be read as a texture by the 3D unit,
+// each must abide by 3D's texture alignment restrictions. These
+// restrictions are:
+//
+// SB1) Base of surface must begin at an aligned memory address. Use
+// NvIme_GetIntegerv(NVIME__GET_SRC_SURF_ALIGNMENT_BYTES)
+// to get this value.
+//
+// SB2) Stride must be a multiple of
+// NvIme_GetIntegerv(NVIME__GET_SRC_SURF_STRIDE_BYTES)
+//
+// SB3) Stride must be a power of two
+//
+// SB4) Width must be between
+// NvIme_GetIntegerv(NVIME_