fb fix, ts fix, flash ttfs experemental
This commit is contained in:
BIN
Start_WM/test6.ncb
Executable file
BIN
Start_WM/test6.ncb
Executable file
Binary file not shown.
30
Start_WM/test6.sln
Executable file
30
Start_WM/test6.sln
Executable file
@@ -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
|
||||
BIN
Start_WM/test6.suo
Executable file
BIN
Start_WM/test6.suo
Executable file
Binary file not shown.
43
Start_WM/test6/inc/GF.h
Executable file
43
Start_WM/test6/inc/GF.h
Executable file
@@ -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__ */
|
||||
|
||||
39
Start_WM/test6/inc/GF3D.h
Executable file
39
Start_WM/test6/inc/GF3D.h
Executable file
@@ -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__ */
|
||||
168
Start_WM/test6/inc/GFAudio.h
Executable file
168
Start_WM/test6/inc/GFAudio.h
Executable file
@@ -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
|
||||
|
||||
189
Start_WM/test6/inc/GFBDev.h
Executable file
189
Start_WM/test6/inc/GFBDev.h
Executable file
@@ -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 */
|
||||
|
||||
45
Start_WM/test6/inc/GFBitmap.h
Executable file
45
Start_WM/test6/inc/GFBitmap.h
Executable file
@@ -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__ */
|
||||
367
Start_WM/test6/inc/GFCamera.h
Executable file
367
Start_WM/test6/inc/GFCamera.h
Executable file
@@ -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
|
||||
<ul>
|
||||
<li> @ref pageCameraAppNotes
|
||||
<ul>
|
||||
<li> @ref pageCameraAppNotes1
|
||||
</ul>
|
||||
</ul>
|
||||
*/
|
||||
/*@{*/
|
||||
|
||||
|
||||
/* 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__ */
|
||||
|
||||
40
Start_WM/test6/inc/GFCameraScr.h
Executable file
40
Start_WM/test6/inc/GFCameraScr.h
Executable file
@@ -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
|
||||
|
||||
254
Start_WM/test6/inc/GFDef.h
Executable file
254
Start_WM/test6/inc/GFDef.h
Executable file
@@ -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(x))
|
||||
#define GF_SHIFTMASK(x) (GF_MASK(x)<< (GF_SHIFT(x)))
|
||||
|
||||
#define GF_DRF_DEF(d,r,f,c) ((d##_##r##_0_##f##_##c) << GF_SHIFT(d##_##r##_0_##f##_RANGE))
|
||||
#define GF_DRF_NUM(d,r,f,n) (((n)& GF_MASK(d##_##r##_0_##f##_RANGE))<< GF_SHIFT(d##_##r##_0_##f##_RANGE))
|
||||
#define GF_DRF_VAL(d,r,f,v) (((v)>> 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)<<GF_COMPONENT_ERROR_SHIFT)
|
||||
#define VX_ERROR (GF_COMPONENT_REVERSE(GF_VXAPI)<<GF_COMPONENT_ERROR_SHIFT)
|
||||
#define JXD_ERROR (GF_COMPONENT_REVERSE(GF_JXDAPI)<<GF_COMPONENT_ERROR_SHIFT)
|
||||
#define MXE_ERROR (GF_COMPONENT_REVERSE(GF_MXEAPI)<<GF_COMPONENT_ERROR_SHIFT)
|
||||
#define MXD_ERROR (GF_COMPONENT_REVERSE(GF_MXDAPI)<<GF_COMPONENT_ERROR_SHIFT)
|
||||
#define DX_ERROR (GF_COMPONENT_REVERSE(GF_DXAPI)<<GF_COMPONENT_ERROR_SHIFT)
|
||||
#define ISP_ERROR (GF_COMPONENT_REVERSE(GF_ISPAPI)<<GF_COMPONENT_ERROR_SHIFT)
|
||||
#define BDEVSD_ERROR (GF_COMPONENT_REVERSE(GF_BDEVSDAPI)<<GF_COMPONENT_ERROR_SHIFT)
|
||||
#define I2C_ERROR (GF_COMPONENT_REVERSE(GF_I2CAPI)<<GF_COMPONENT_ERROR_SHIFT)
|
||||
#define MMPROC_ERROR (GF_COMPONENT_REVERSE(GF_MMPROCAPI)<<GF_COMPONENT_ERROR_SHIFT)
|
||||
#define CAM_ERROR (GF_COMPONENT_REVERSE(GF_CAMAPI)<<GF_COMPONENT_ERROR_SHIFT)
|
||||
#define MINISP_ERROR (GF_COMPONENT_REVERSE(GF_MINIMALISPAPI)<<GF_COMPONENT_ERROR_SHIFT)
|
||||
#define MXDH264_ERROR (GF_COMPONENT_REVERSE(GF_MXDH264API)<<GF_COMPONENT_ERROR_SHIFT)
|
||||
#define MXEH264_ERROR (GF_COMPONENT_REVERSE(GF_MXEH264API)<<GF_COMPONENT_ERROR_SHIFT)
|
||||
#define MXDHVC1_ERROR (GF_COMPONENT_REVERSE(GF_MXDVC1API)<<GF_COMPONENT_ERROR_SHIFT)
|
||||
#define MXDEMTS_ERROR (GF_COMPONENT_REVERSE(GF_MXDEMTSAPI)<<GF_COMPONENT_ERROR_SHIFT)
|
||||
#define RM_ERROR (GF_COMPONENT_REVERSE(GF_RMAPI)<<GF_COMPONENT_ERROR_SHIFT)
|
||||
|
||||
#define GFGX_ERROR (GF_ERROR | GX_ERROR)
|
||||
#define GFVX_ERROR (GF_ERROR | VX_ERROR)
|
||||
#define GFJXD_ERROR (GF_ERROR | JXD_ERROR)
|
||||
#define GFMXE_ERROR (GF_ERROR | MXE_ERROR)
|
||||
#define GFMXD_ERROR (GF_ERROR | MXD_ERROR)
|
||||
#define GFDX_ERROR (GF_ERROR | DX_ERROR)
|
||||
#define GFISP_ERROR (GF_ERROR | ISP_ERROR)
|
||||
#define GFBDEVSD_ERROR (GF_ERROR | BDEVSD_ERROR)
|
||||
#define GFI2C_ERROR (GF_ERROR | I2C_ERROR)
|
||||
#define GFMMPROC_ERROR (GF_ERROR | MMPROC_ERROR)
|
||||
#define GFCAM_ERROR (GF_ERROR | CAM_ERROR)
|
||||
#define GFMXDH264_ERROR (GF_ERROR | MXDH264_ERROR)
|
||||
#define GFMXEH264_ERROR (GF_ERROR | MXEH264_ERROR)
|
||||
#define GFMXDVC1_ERROR (GF_ERROR | MXDHVC1_ERROR)
|
||||
#define GFMXDEMTS_ERROR (GF_ERROR | MXDEMTS_ERROR)
|
||||
#define GFRM_ERROR (GF_ERROR | RM_ERROR)
|
||||
|
||||
|
||||
/* Function and Handle */
|
||||
/** GFSDK error code.
|
||||
GFSDK error codes are signed 32 bit values formed by combining the following 3 bitfields:
|
||||
- bit 31 (sign) : set (0x80000000) indicating error
|
||||
- bit 30-24 : 7 bit GFSDK component ID, in reversed bit order
|
||||
- bit 23-0 : component local error codes
|
||||
GFSDK component IDs are numbered contineously starting at 0.
|
||||
Component local error codes are also numbered contineously starting at 0.
|
||||
Using the 7 bit component ID in reverse bit order will asure set bits in
|
||||
positions 31-24 in the combined error code to be top-aligned. Set bits in
|
||||
the local error code positions 23-0 will be bottom-aligned. With this scheme
|
||||
combined error codes are likely to fit into ARM immediate constants,
|
||||
saving code size and execution time when error constants are accessed.
|
||||
*/
|
||||
typedef NvS32 GF_RETTYPE;
|
||||
|
||||
/** GFSDK handles to opaque structures. */
|
||||
typedef void *GF_HANDLE;
|
||||
typedef struct GFMinimalIspStruct_t *GFMinimalIspHandle;
|
||||
typedef struct GF3DStruct_t *GF3DHandle;
|
||||
typedef struct GFBDevStruct_t *GFBDevHandle;
|
||||
typedef struct GFCameraStruct_t *GFCameraHandle;
|
||||
typedef struct GFDiagStruct_t *GFDiagHandle;
|
||||
typedef struct GFDxStruct_t *GFDxHandle;
|
||||
typedef struct GFEPPStruct_t *GFEPPHandle;
|
||||
typedef struct GFFDevStruct_t *GFFDevHandle;
|
||||
typedef struct GFFDevDirStruct_t *GFFDevDirHandle;
|
||||
typedef struct GFFDevFileStruct_t *GFFDevFileHandle;
|
||||
typedef struct GFGxStruct_t *GFGxHandle;
|
||||
typedef struct GFI2CStruct_t *GFI2CHandle;
|
||||
typedef struct GFI2SStruct_t *GFI2SHandle;
|
||||
typedef struct GFINTxStruct_t *GFINTxHandle;
|
||||
typedef struct GFIspStruct_t *GFIspHandle;
|
||||
typedef struct GFJxDecStruct_t *GFJxDecHandle;
|
||||
typedef struct GFJxEncStruct_t *GFJxEncHandle;
|
||||
typedef struct GFMmProcStruct_t *GFMmProcHandle;
|
||||
typedef struct GFMxDecStruct_t *GFMxDecHandle;
|
||||
typedef struct GFMxDecH264Struct_t *GFMxDecH264Handle;
|
||||
typedef struct GFMxDecRV9Struct_t *GFMxDecRV9Handle;
|
||||
typedef struct GFMxDecVC1Struct_t *GFMxDecVC1Handle;
|
||||
typedef struct GFMxDemTSStruct_t *GFMxDemTSHandle;
|
||||
typedef struct GFMxDemTSParserStruct_t *GFMxDemTSParserHandle;
|
||||
typedef struct GFMxEncStruct_t *GFMxEncHandle;
|
||||
typedef struct GFMxEncH264Struct_t *GFMxEncH264Handle;
|
||||
typedef struct GFOSxStruct_t *GFOSxHandle;
|
||||
typedef struct GFRmStruct_t *GFRmHandle;
|
||||
typedef struct GFRmChStruct_t *GFRmChHandle;
|
||||
typedef struct _GF_RM_DSP_TASK *GFRmDspTaskHandle;
|
||||
typedef struct GFRmMemStruct_t *GFRmMemHandle;
|
||||
typedef struct GFRmVmStruct_t *GFRmVmHandle;
|
||||
typedef struct GFRmRdmaStruct_t *GFRmRdmaHandle;
|
||||
typedef struct GFVxStruct_t *GFVxHandle;
|
||||
|
||||
|
||||
#ifdef GF_XTENSA_RM_TASK
|
||||
#define ATTRIBUTE(a) __attribute__(a)
|
||||
#else
|
||||
#define ATTRIBUTE(a)
|
||||
#endif
|
||||
|
||||
|
||||
/** GFSDK Component Property Structure. */
|
||||
typedef struct _GFPROPERTY
|
||||
{
|
||||
NvU32 Capability; //!< Individual component's capability
|
||||
NvU32 CapabilityEx; //!< Individual component's extended capability
|
||||
} GFPROPERTY, *PGFPROPERTY;
|
||||
|
||||
/** Rectangle Structure. */
|
||||
typedef struct _GFRECT
|
||||
{
|
||||
NvU16 top; //!< Top edge, inclusive
|
||||
NvU16 left; //!< Left edge, inclusive
|
||||
NvU16 right; //!< Right edge, inclusive
|
||||
NvU16 bottom; //!< Bottom edge, inclusive
|
||||
} GFRECT, *PGFRECT;
|
||||
|
||||
/** Component level interrupt status. */
|
||||
typedef enum
|
||||
{
|
||||
GF_INTERRUPT_OFF_STATUS_FALSE, /**< Component level interrupt is disabled,
|
||||
the interrupt status is false.
|
||||
*/
|
||||
GF_INTERRUPT_ON_STATUS_FALSE, /**< Component level interrupt is enabled,
|
||||
the interrupt status is false.
|
||||
*/
|
||||
GF_INTERRUPT_OFF_STATUS_TRUE, /**< Component level interrupt is disabled,
|
||||
the interrupt status is true.
|
||||
*/
|
||||
GF_INTERRUPT_ON_STATUS_TRUE /**< Component level interrupt is enabled,
|
||||
the interrupt status is true.
|
||||
*/
|
||||
} GF_INTERRUPT_STATUS_TYPE;
|
||||
|
||||
/** GPIO status descriptor.
|
||||
|
||||
This structure is to return GPIO pin status after a call to GFDxFPGPIO(),
|
||||
GFVxVIPGPIO(), or GFIxSDGPIO(). These operations are for common GPIO
|
||||
manipulations of the input enable, output enable, output select and data bits
|
||||
in the various WMP modules. The bits can be set to 1 or cleared to 0, and their
|
||||
status can be obtained.
|
||||
|
||||
@see GFDxFPGPIO(), GFVxVIPGPIO(), GFIxSDGPIO()
|
||||
*/
|
||||
|
||||
/* GFGPIOSTATUS - GPIO Status */
|
||||
typedef struct _GFGPIOSTATUS
|
||||
{
|
||||
NvU32 in_data; /**< Input data bit */
|
||||
NvU32 in_enable; /**< Input enable bit */
|
||||
NvU32 out_enable; /**< Output enable bit */
|
||||
NvU32 out_data; /**< Output data bit */
|
||||
NvU32 out_select; /**< Output select bit */
|
||||
} GFGPIOSTATUS, *PGFGPIOSTATUS;
|
||||
|
||||
/* GFBLOCKLIST - Block list */
|
||||
typedef struct _GFBLOCKLIST
|
||||
{
|
||||
NvU32 blockIndex; // Index of block
|
||||
NvU32 blockCount; // Number of blocks to this index, value of 0
|
||||
// marks last block
|
||||
} GFBLOCKLIST, *PGFBLOCKLIST;
|
||||
|
||||
/** States for Component Manager and general services.
|
||||
@see GFRmComponentGet(), GFRmComponentRelease().
|
||||
*/
|
||||
typedef NvU32 GF_STATE_TYPE;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __GFDEF_H__ */
|
||||
|
||||
81
Start_WM/test6/inc/GFDefScr.h
Executable file
81
Start_WM/test6/inc/GFDefScr.h
Executable file
@@ -0,0 +1,81 @@
|
||||
/* 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 (__GFDEFSCR_INC__)
|
||||
#define __GFDEFSCR_INC__
|
||||
|
||||
/* GPIO Operations (Set, Clear, Get) */
|
||||
|
||||
/** GPIO Operation: Input enable set to 1.
|
||||
@see GFGPIOSTATUS, GFDxFPGPIO(), GFVxVIPGPIO(), GFIxSDGPIO()
|
||||
*/
|
||||
#define GF_GPIO_SET_INPUT_ENABLE 0x00000001
|
||||
|
||||
/** GPIO Operation: Input enable clr to 0.
|
||||
@see GFGPIOSTATUS, GFDxFPGPIO(), GFVxVIPGPIO(), GFIxSDGPIO()
|
||||
*/
|
||||
#define GF_GPIO_CLR_INPUT_ENABLE 0x00000002
|
||||
|
||||
/** GPIO Operation: Get input enable.
|
||||
@see GFGPIOSTATUS, GFDxFPGPIO(), GFVxVIPGPIO(), GFIxSDGPIO()
|
||||
*/
|
||||
#define GF_GPIO_GET_INPUT_ENABLE 0x00000004
|
||||
|
||||
/** GPIO Operation: Output enable set to 1.
|
||||
@see GFGPIOSTATUS, GFDxFPGPIO(), GFVxVIPGPIO(), GFIxSDGPIO()
|
||||
*/
|
||||
#define GF_GPIO_SET_OUTPUT_ENABLE 0x00000010
|
||||
|
||||
/** GPIO Operation: Output enable clr to 0.
|
||||
@see GFGPIOSTATUS, GFDxFPGPIO(), GFVxVIPGPIO(), GFIxSDGPIO()
|
||||
*/
|
||||
#define GF_GPIO_CLR_OUTPUT_ENABLE 0x00000020
|
||||
|
||||
/** GPIO Operation: Get output enable.
|
||||
@see GFGPIOSTATUS, GFDxFPGPIO(), GFVxVIPGPIO(), GFIxSDGPIO()
|
||||
*/
|
||||
#define GF_GPIO_GET_OUTPUT_ENABLE 0x00000040
|
||||
|
||||
/** GPIO Operation: Output data set to 1.
|
||||
@see GFGPIOSTATUS, GFDxFPGPIO(), GFVxVIPGPIO(), GFIxSDGPIO()
|
||||
*/
|
||||
#define GF_GPIO_SET_DATA 0x00000100
|
||||
|
||||
/** GPIO Operation: Output data clr to 0.
|
||||
@see GFGPIOSTATUS, GFDxFPGPIO(), GFVxVIPGPIO(), GFIxSDGPIO()
|
||||
*/
|
||||
#define GF_GPIO_CLR_DATA 0x00000200
|
||||
|
||||
/** GPIO Operation: Get input data.
|
||||
@see GFGPIOSTATUS, GFDxFPGPIO(), GFVxVIPGPIO(), GFIxSDGPIO()
|
||||
*/
|
||||
#define GF_GPIO_GET_DATA 0x00000400
|
||||
|
||||
/** GPIO Operation: Get output data.
|
||||
@see GFGPIOSTATUS, GFDxFPGPIO(), GFVxVIPGPIO(), GFIxSDGPIO()
|
||||
*/
|
||||
#define GF_GPIO_GET_OUTPUT_DATA 0x00001000
|
||||
|
||||
/** GPIO Operation: Output select set to 1.
|
||||
@see GFGPIOSTATUS, GFDxFPGPIO(), GFVxVIPGPIO(), GFIxSDGPIO()
|
||||
*/
|
||||
#define GF_GPIO_SET_OUTPUT_SELECT 0x00100000
|
||||
|
||||
/** GPIO Operation: Output select clr to 0.
|
||||
@see GFGPIOSTATUS, GFDxFPGPIO(), GFVxVIPGPIO(), GFIxSDGPIO()
|
||||
*/
|
||||
#define GF_GPIO_CLR_OUTPUT_SELECT 0x00200000
|
||||
|
||||
/** GPIO Operation: Output select get.
|
||||
@see GFGPIOSTATUS, GFDxFPGPIO(), GFVxVIPGPIO(), GFIxSDGPIO()
|
||||
*/
|
||||
#define GF_GPIO_GET_OUTPUT_SELECT 0x00400000
|
||||
|
||||
#endif
|
||||
|
||||
442
Start_WM/test6/inc/GFDiag.h
Executable file
442
Start_WM/test6/inc/GFDiag.h
Executable file
@@ -0,0 +1,442 @@
|
||||
/* 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 GFDiag.h
|
||||
* @brief GFSDK module for diagnostics
|
||||
* GFDiag is a testing framework which includes functionality
|
||||
* for running sets of different tests and is mostly for internal
|
||||
* use.
|
||||
*
|
||||
* Apps should use the GF_DIAG_* macros to communicate with GFDiag
|
||||
* All GFDiag API calls take the DiagHandle as the first arg. Useful for
|
||||
* error messages, and MODS needs some way to identify what test is talking
|
||||
* to it.
|
||||
*/
|
||||
|
||||
#ifndef __GFDIAG_H__
|
||||
#define __GFDIAG_H__
|
||||
|
||||
#include "GFRm.h"
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
/** 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__ */
|
||||
1740
Start_WM/test6/inc/GFDispCmdData.h
Executable file
1740
Start_WM/test6/inc/GFDispCmdData.h
Executable file
File diff suppressed because it is too large
Load Diff
1847
Start_WM/test6/inc/GFDx.h
Executable file
1847
Start_WM/test6/inc/GFDx.h
Executable file
File diff suppressed because it is too large
Load Diff
89
Start_WM/test6/inc/GFEPP.h
Executable file
89
Start_WM/test6/inc/GFEPP.h
Executable file
@@ -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_
|
||||
321
Start_WM/test6/inc/GFFDev.h
Executable file
321
Start_WM/test6/inc/GFFDev.h
Executable file
@@ -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
|
||||
<ul>
|
||||
<li> @ref pageFDevAppNotes
|
||||
<ul>
|
||||
<li> @ref pageFDevAppNotes1
|
||||
</ul>
|
||||
</ul>
|
||||
*/
|
||||
/*@{*/
|
||||
|
||||
/** 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__ */
|
||||
|
||||
1927
Start_WM/test6/inc/GFGx.h
Executable file
1927
Start_WM/test6/inc/GFGx.h
Executable file
File diff suppressed because it is too large
Load Diff
46
Start_WM/test6/inc/GFGxError.h
Executable file
46
Start_WM/test6/inc/GFGxError.h
Executable file
@@ -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__
|
||||
|
||||
|
||||
|
||||
314
Start_WM/test6/inc/GFI2C.h
Executable file
314
Start_WM/test6/inc/GFI2C.h
Executable file
@@ -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:
|
||||
<pre>
|
||||
attr = (SP_SCL_PULLUP_DISABLE | SP_SDA_PULLUP_DISABLE)
|
||||
GFI2CSetAttribute(I2CHandle, GFI2C_ATTR_PULLUP, attr)
|
||||
</pre>
|
||||
|
||||
@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__ */
|
||||
|
||||
49
Start_WM/test6/inc/GFI2S.h
Executable file
49
Start_WM/test6/inc/GFI2S.h
Executable file
@@ -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__ */
|
||||
114
Start_WM/test6/inc/GFINTx.h
Executable file
114
Start_WM/test6/inc/GFINTx.h
Executable file
@@ -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. */
|
||||
|
||||
1654
Start_WM/test6/inc/GFIsp.h
Executable file
1654
Start_WM/test6/inc/GFIsp.h
Executable file
File diff suppressed because it is too large
Load Diff
37
Start_WM/test6/inc/GFIspError.h
Executable file
37
Start_WM/test6/inc/GFIspError.h
Executable file
@@ -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__
|
||||
|
||||
|
||||
|
||||
508
Start_WM/test6/inc/GFJxDec.h
Executable file
508
Start_WM/test6/inc/GFJxDec.h
Executable file
@@ -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
|
||||
*/
|
||||
/* <ul>
|
||||
<li> @ref pageGxAppNotes
|
||||
<ul>
|
||||
<li> @ref pageGxAppNotes1
|
||||
</ul>
|
||||
</ul>
|
||||
*/
|
||||
|
||||
/*@{*/
|
||||
|
||||
// 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
|
||||
<table>
|
||||
<tr><td>#JX_DEC_IF_LAST_PORTION_IMAGE</td>
|
||||
<td>This is the last portion of decoded image</td></tr>
|
||||
</table>
|
||||
@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
|
||||
|
||||
<table>
|
||||
<tr><th>\a uiFeature</th>
|
||||
<th>\a pInfo interpretation</th>
|
||||
<th>Meaning</th></tr>
|
||||
<tr><td>JX_DEC_SET_READBITSTREAM</td>
|
||||
<td>GFJXDECCALLBACK*</td>
|
||||
<td>Set up Jpeg bitstream feed callback</td></tr>
|
||||
</table>
|
||||
|
||||
@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
|
||||
|
||||
<table>
|
||||
<tr><td>#JX_DEC_GETIMAGE </td>
|
||||
<td>Get the YUV decoded JPEG image into a file, Sets the decoder image callback</td></tr>
|
||||
<tr><td>#JX_DEC_GETIMAGE_COLORFORMAT </td>
|
||||
<td>Set get decoded image color format.</td></tr>
|
||||
</table>
|
||||
|
||||
@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
|
||||
<table>
|
||||
<tr><td>#JX_DEC_GETIMAGE </td>
|
||||
<td>Get the YUV decoded JPEG image into a file, Sets the decoder image callback</td></tr>
|
||||
<tr><td>#JX_DEC_GETIMAGE_COLORFORMAT </td>
|
||||
<td>Set get decoded image color format.</td></tr>
|
||||
</table>
|
||||
*/
|
||||
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
|
||||
|
||||
1306
Start_WM/test6/inc/GFJxEnc.h
Executable file
1306
Start_WM/test6/inc/GFJxEnc.h
Executable file
File diff suppressed because it is too large
Load Diff
29
Start_WM/test6/inc/GFMinimalIsp.h
Executable file
29
Start_WM/test6/inc/GFMinimalIsp.h
Executable file
@@ -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
|
||||
1766
Start_WM/test6/inc/GFMmProc.h
Executable file
1766
Start_WM/test6/inc/GFMmProc.h
Executable file
File diff suppressed because it is too large
Load Diff
727
Start_WM/test6/inc/GFMxDec.h
Executable file
727
Start_WM/test6/inc/GFMxDec.h
Executable file
@@ -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
|
||||
<ul>
|
||||
<li> @ref pageMxDecAppNotes
|
||||
<ul>
|
||||
<li> @ref pageMxDecAppNotes1
|
||||
</ul>
|
||||
</ul>
|
||||
*/
|
||||
/*@{*/
|
||||
|
||||
/****************************************************************************************************/
|
||||
// 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 rectangle<6C>s
|
||||
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 rectangle<6C>s 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 VOP<4F>s 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. */
|
||||
/**< <table>
|
||||
<tr><td>#MXDEC_PP_DB_ON</td>
|
||||
<td>Turn on DeBlocking filter for this frame</td></tr>
|
||||
<tr><td>#MXDEC_PP_DR_ON</td>
|
||||
<td>Turn on DeRinging filter for this frame</td></tr>
|
||||
<tr><td>#MXDEC_PP_AUTO</td>
|
||||
<td>Auto trigger Post Processing by Hardware</td></tr>
|
||||
<tr><td>#MXDEC_PP_RELOAD_QUANTIZER</td>
|
||||
<td>Reload the source VOP's qunantizers</td></tr>
|
||||
<tr><td>#MXDEC_PP_OP_ASYNC</td>
|
||||
<td>Enables ASYNC mode</td></tr>
|
||||
</table>
|
||||
*/
|
||||
} 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.
|
||||
<table>
|
||||
<tr><td>#MXDEC_READ_BITSTREAM_FORWARD</td>
|
||||
<td>Read bitstream in forward direction</td></tr>
|
||||
<tr><td>#MXDEC_READ_BITSTREAM_BACKWARD</td>
|
||||
<td>Read bitstream in backward direction</td></tr>
|
||||
</table>
|
||||
|
||||
@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. */
|
||||
/**< <table>
|
||||
<tr><td>#MXDEC_MP4_SHORT_HEADER</td>
|
||||
<td>Short header format detected</td></tr>
|
||||
<tr><td>#MXDEC_MP4_DATA_PARTITION</td>
|
||||
<td>Data Partitioning mode detected</td></tr>
|
||||
<tr><td>#MXDEC_MP4_PROFILE_LEVEL</td>
|
||||
<td>Profile and level field is valid</td></tr>
|
||||
<tr><td>#MXDEC_MP4_PRIORITY</td>
|
||||
<td>Priority field is valid</td></tr>
|
||||
<tr><td>#MXDEC_MP4_VSOTYPE</td>
|
||||
<td>Visual object type field is valid</td></tr>
|
||||
<tr><td>#MXDEC_MP4_VIDEO_SIGNAL</td>
|
||||
<td>VideoFormat and VideoRange fields are valid</td></tr>
|
||||
<tr><td>#MXDEC_MP4_COLOR_DESCRIPTION</td>
|
||||
<td>Color, Transfer and Matrix fields are valid</td></tr>
|
||||
<tr><td>#MXDEC_MP4_VOID</td>
|
||||
<td>VObjectID field is valid</td></tr>
|
||||
<tr><td>#MXDEC_MP4_VOLID</td>
|
||||
<td>VOLID field is valid</td></tr>
|
||||
</table>
|
||||
*/
|
||||
NvU32 uiWidth; /**< Display width, set by API */
|
||||
NvU32 uiHeight; /**< Display height, set by API */
|
||||
unsigned int Profile; /**< Mpeg4 Profile. Set by API.*/
|
||||
/**< <table>
|
||||
<tr><td>#MXDEC_MP4_SIMPLE_PROFILE</td><td>Profile is simple profile</td></tr>
|
||||
<tr><td>#MXDEC_MP4_ADVANCE_SIMPLE_PROFILE</td><td>Profile is advance simple profile</td></tr>
|
||||
</table>
|
||||
*/
|
||||
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.
|
||||
<table><tr><td>#MXDEC_MP4_VOP_P</td><td>VOP is coded as P-VOP</td></tr>
|
||||
<tr><td>#MXDEC_MP4_NOT_CODED</td><td>VOP is not coded</td></tr>
|
||||
<tr><td>(???)What about I-VOP?</td><td>(???)</td></tr></table>
|
||||
*/
|
||||
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:
|
||||
<table><tr><td>*pInfo == 1</td><td>Application will determine the decoding boudary</td></tr>
|
||||
<tr><td>*pInfo == 0</td><td>Application will not determine the decoding boudary</td></tr></table>
|
||||
@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
|
||||
<table>
|
||||
<tr><td>*pInfo == 1</td>
|
||||
<td>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.</td></tr>
|
||||
<tr><td>*pInfo == 0 (Default)</td>
|
||||
<td>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.</td></tr>
|
||||
</table>
|
||||
@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:
|
||||
<pre>
|
||||
NvU8 * pMBErrMapMatrix
|
||||
</pre>
|
||||
@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:
|
||||
<table><tr><td>#GF_STATE_DEFAULT</td></tr>
|
||||
<tr><td>#GF_STATE_NEW_OR_SHARE</td></tr>
|
||||
<tr><td>#GF_STATE_NEW_ONLY</td></tr>
|
||||
<tr><td>#GF_STATE_SHARE_ONLY</td></tr></table>
|
||||
|
||||
@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 VOP<4F>s 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
|
||||
|
||||
1536
Start_WM/test6/inc/GFMxDecH264.h
Executable file
1536
Start_WM/test6/inc/GFMxDecH264.h
Executable file
File diff suppressed because it is too large
Load Diff
853
Start_WM/test6/inc/GFMxDecRV9.h
Executable file
853
Start_WM/test6/inc/GFMxDecRV9.h
Executable file
@@ -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
|
||||
<table>
|
||||
<tr><td>#GF_MXDEC_RV9_DEC_FRAME_SPECIFY_SURF_RECT</td>
|
||||
<td>specify rect area to hold the reconstructed image.</td></tr>
|
||||
<table>
|
||||
*/
|
||||
PGFRECT pFrameRect; /**< not in use */
|
||||
NvU32 uiFrameType; /**< set new frame type information
|
||||
<table>
|
||||
<tr><td>#GF_MXDEC_RV9_DISPLAY_FRAME</td>
|
||||
<tr><td>#GF_MXDEC_RV9_KEY_FRAME</td>
|
||||
<tr><td>#GF_MXDEC_RV9_P_FRAME</td>
|
||||
<tr><td>#GF_MXDEC_RV9_B_FRAME</td>
|
||||
<tr><td>#GF_MXDEC_RV9_DONT_DISPLAY_FRAME</td>
|
||||
<tr><td>#GF_MXDEC_RV9_ERRONEOUS_FRAME</td>
|
||||
</table>
|
||||
*/
|
||||
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
|
||||
<table>
|
||||
<tr><td>#GF_MXDEC_RV8_UMV</td>
|
||||
<td>Unrestricted Motion Vector</td></tr>
|
||||
<tr><td>#GF_MXDEC_RV8_DF</td>
|
||||
<td>In loop Deblocking filter</td></tr>
|
||||
<tr><td>#GF_MXDEC_RV8_SS</td>
|
||||
<td>Slice Structured </td></tr>
|
||||
<tr><td>#GF_MXDEC_RV8_RPR</td>
|
||||
<td>Reference Picture Resampling</td></tr>
|
||||
<tr><td>#GF_MXDEC_RV8_ROUND</td>
|
||||
<td>Round off for half pixel motion compensation</td></tr>
|
||||
</table>
|
||||
*/
|
||||
NvU32 uiRV9StreamInfo;
|
||||
/**< set by GFMxDecRV9API. Valid only if it is RV9 stream
|
||||
<table>
|
||||
<tr><td>#GF_MXDEC_RV9_INTERLACE</td>
|
||||
<td>Interlaced mode used</td></tr>
|
||||
<tr><td>#GF_MXDEC_RV9_DF_PASS_THRU</td>
|
||||
<td>In loop Deblocking filter is disabled</td></tr>
|
||||
</table>
|
||||
*/
|
||||
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:
|
||||
|
||||
<table>
|
||||
<tr><td>#GF_MXDEC_RV9_CAP_SIMPLE </td>
|
||||
<td>support simple profile.</td></tr>
|
||||
<tr><td>#GF_MXDEC_RV9_CAP_MEDIUM </td>
|
||||
<td>support medium profile.</td></tr>
|
||||
<tr><td>#GF_MXDEC_RV9_CAP_COMPLEX </td>
|
||||
<td>support complex profile</td></tr>
|
||||
<tr><td>#GF_MXDEC_RV9_CAP_LEVEL1</td>
|
||||
<td>support LEVEL 1.</td></tr>
|
||||
<tr><td>#GF_MXDEC_RV9_CAP_LEVEL2 </td>
|
||||
<td>support LEVEL 2.</td></tr>
|
||||
<tr><td>#GF_MXDEC_RV9_CAP_LEVEL3 </td>
|
||||
<td>support LEVEL 3.</td></tr>
|
||||
<tr><td>#GF_MXDEC_RV9_CAP_LEVEL4 </td>
|
||||
<td>support LEVEL 4.</td></tr>
|
||||
<tr><td>#GF_MXDEC_RV9_CAP_DB </td>
|
||||
<td>support Post Processing's smoothing filter for RV8 streams.</td></tr>
|
||||
<tr><td>#GF_MXDEC_RV9_CAP_DR </td>
|
||||
<td>support Post Processing's de-ringing.</td></tr>
|
||||
</table>
|
||||
|
||||
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 :
|
||||
<table>
|
||||
<tr><td>#GF_MXDEC_RV9_ATTR_PRE_DETERMINED_BOUNDARY </td>
|
||||
<td>will determine the VOL and VOP boundary, for RV9.</td></tr>
|
||||
<tr><td>#GF_MXDEC_RV9_ATTR_PREFILLBUFFER</td>
|
||||
<td>App will fill the buffer and push the data to the decoder.</td></tr>
|
||||
</table>
|
||||
@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 :
|
||||
<table>
|
||||
<tr><td>#GF_MXDEC_ATTR_RV9_DEC_FRAME_RECT_TOP_ALIGNMENT </td>
|
||||
<tr><td>#GF_MXDEC_ATTR_RV9_DEC_FRAME_RECT_LEFT_ALIGNMENT</td>
|
||||
<tr><td>#GF_MXDEC_RV9_ATTR_PRE_DETERMINED_BOUNDARY </td>
|
||||
<tr><td>#GF_MXDEC_RV9_ATTR_PREFILLBUFFER</td>
|
||||
</table>
|
||||
@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 :
|
||||
<table>
|
||||
<tr><td>#GF_MXDEC_RV9_SET_READBITSTREAM </td>
|
||||
<td>will Set up readbitstream call back function.</td></tr>
|
||||
<tr><td>#GF_MXDEC_RV9_SET_SURFACE_LIST</td>
|
||||
<td>will setup the surface list, including all of the ref surface and one reconstructed one.</td></tr>
|
||||
<tr><td>#GF_MXDEC_RV9_BITSTREAM_RV8 </td>
|
||||
<td>will Set the GFMxDecRV9API to decode the RV8 stream.</td></tr>
|
||||
</table>
|
||||
@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
|
||||
<table>
|
||||
<tr><td>#GF_ERROR_RV9DECPICTUREHDR_DETECTED </td>
|
||||
<td>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.</td></tr>
|
||||
<tr><td>#GF_ERROR_RV9DECPICTUREHDR_END_OF_FILE </td>
|
||||
<td>No more bit stream from application.</td></tr>
|
||||
<tr><td>#GF_ERROR_RV9DECPICTUREHDR_CORRUPTED </td>
|
||||
<td>GFMxDecRV9DecPicture encounters an un-recoverable error
|
||||
in the bit stream. Application should call GFMxDecRV9Resync
|
||||
API to skip this picture.</td></tr>
|
||||
<tr><td>#GF_ERROR_RV9DECPICTUREHDR_NOT_ENOUGH_MEM </td>
|
||||
<td>There is not enough memory.</td></tr>
|
||||
</table>
|
||||
|
||||
@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 :
|
||||
<table>
|
||||
<tr><td>#GF_MXDEC_RV9_RESYNC_FORWARD_NEAREST_I_FRAME.</td>
|
||||
<td>Resynchronize forward to the nearest I frame.</td></tr>
|
||||
<tr><td>#GF_MXDEC_RV9_RESYNC_BACKWARD_NEAREST_I_FRAME.</td>
|
||||
<td>Resynchronize backward to the nearest I frame.</td></tr>
|
||||
<tr><td>#GF_MXDEC_RV9_RESYNC_BACKWARD_NEAREST_P_FRAME.</td>
|
||||
<td>Resynchronize backward to the nearest P frame.<td><tr>
|
||||
<table>
|
||||
@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
|
||||
<20>#GF_MXDEC_RV9_INTERRUPT_TYPE<50>
|
||||
@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.
|
||||
<tr><td>Performing color space conversion and then a stretch blit to the primary surface directly.</td>
|
||||
<td>Blitting to the overlay surface.<td><tr>
|
||||
|
||||
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
|
||||
732
Start_WM/test6/inc/GFMxDecVC1.h
Executable file
732
Start_WM/test6/inc/GFMxDecVC1.h
Executable file
@@ -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 API<50>a high level API and a low
|
||||
level API.
|
||||
|
||||
<b>Using the High Level API</b>
|
||||
|
||||
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()
|
||||
|
||||
<b>Using the Low Level API</b>
|
||||
|
||||
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()
|
||||
|
||||
<ul>
|
||||
<li> @ref pageMxDecVC1AppNotes
|
||||
<ul>
|
||||
<li> @ref pageMxDecVC1AppNotes1
|
||||
</ul>
|
||||
</ul>
|
||||
*/
|
||||
/*@{*/
|
||||
|
||||
// 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:
|
||||
<pre>
|
||||
NvU32 1: APP will determine the decoding boudary
|
||||
0: APP will not determine the decoding boundary
|
||||
</pre>
|
||||
|
||||
@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; /**<input*/
|
||||
} GFMXDECVC1PP, *PGFMXDECVC1PP;
|
||||
|
||||
// PPOption
|
||||
#define MXDEC_VC1_PP_DB_ON 0x1 //Turn on DeBlocking filter for this frame
|
||||
#define MXDEC_VC1_PP_DR_ON 0x2 //Turn on DeRinging filter for this frame
|
||||
#define MXDEC_VC1_PP_AUTO 0x4 //Auto trigger Post Processing by Hardware
|
||||
#define MXDEC_VC1_PP_RELOAD_QUANTIZER 0x8 //Reload the source VOP's qunantizers
|
||||
|
||||
|
||||
|
||||
// Hardware Status
|
||||
#define GF_DECODER_FRAME_DONE 0x00000010
|
||||
//if hardware decoder is done with one frame
|
||||
#define GF_DECODER_PP_FRAME_DONE 0x00000020
|
||||
//if post processing engine is done with one frame
|
||||
|
||||
/** GFMxDecVC1Set() feature ID: Set up read stream callback function.
|
||||
\a pInfo is a pointer to a #GFMXDECVC1CALLBACK structure.
|
||||
|
||||
Set up readbitstream call back function
|
||||
pInfo should be a pointer to PGFMXDECVC1CALLBACK
|
||||
*/
|
||||
#define GF_MXDEC_VC1_SET_READBITSTREAM 1
|
||||
|
||||
/** GFMxDecVC1Set() feature ID: setup the surface list, including all of the
|
||||
ref surface and one reconstructed one
|
||||
pInfo should a pointer PGFMXDECVC1SURFLIST
|
||||
*/
|
||||
#define GF_MXDEC_VC1_SET_SURFACE_LIST 2
|
||||
|
||||
typedef struct _GFMXDECVC1CALLBACK
|
||||
{
|
||||
/** Application defined parameter to forward to GFMXDECVC1CALLBACK::pCallBack. */
|
||||
void *pPara;
|
||||
|
||||
/** Callback function, which is called by MxDecVC1 to fetch a portion of bitstream data.
|
||||
@param pPara Application defined parameter, forwarded from GFMXDECVC1CALLBACK::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
|
||||
<table>
|
||||
<tr><td>GF_MXDEC_VC1_READ_BITSTREAM_FORWARD </td><td>Forward scan</td></tr>
|
||||
<tr><td>GF_MXDEC_VC1_READ_BITSTREAM_BACKWARD</td><td>Backward scan</td></tr>
|
||||
</table>
|
||||
|
||||
@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
|
||||
|
||||
|
||||
725
Start_WM/test6/inc/GFMxDemTS.h
Executable file
725
Start_WM/test6/inc/GFMxDemTS.h
Executable file
@@ -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:
|
||||
<pre>
|
||||
GFMXDEMTSPARSERTYPE_HOST - demux running on host
|
||||
GFMXDEMTSPARSERTYPE_DSP - demux running on DSP
|
||||
GFMXDEMTSPARSERTYPE_DSPAVSYNC - demux running on DSP with additional AVSync functionality
|
||||
</pre>
|
||||
|
||||
<b>Programming Sequence for Parsers running on Host, TS data from host</b>
|
||||
|
||||
- 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
|
||||
|
||||
<b>Programming Sequence for Parsers running on DSP, TS data from host</b>
|
||||
|
||||
- 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
|
||||
|
||||
<b>Programming Sequence for Parser running on DSP, TS data from VIP</b>
|
||||
|
||||
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:
|
||||
<pre>
|
||||
32 24 23 8 7 0
|
||||
+---------+------------------------------+----------------+
|
||||
| Invalid | Service ID |Service Type |
|
||||
+---------+------------------------------+----------------+
|
||||
</pre>
|
||||
*/
|
||||
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:
|
||||
<pre>
|
||||
NvU32 new PMT PID
|
||||
</pre
|
||||
*/
|
||||
GFMXDEMTSPARSERNOTIFY_TSPMTCHANGED,
|
||||
|
||||
/** Number of GFMXDEMTSPARSERNOTIFY codes. */
|
||||
GFMXDEMTSPARSERNOTIFYCOUNT
|
||||
|
||||
} GFMXDEMTSPARSERNOTIFY;
|
||||
|
||||
/** Parameter structure for GFMxDemTSParserCreate(). */
|
||||
typedef struct _GFMXDEMTSPARSEREQUEST
|
||||
{
|
||||
/** Specifies type of parser. */
|
||||
GFMXDEMTSPARSERTYPE type;
|
||||
|
||||
/** Specifies source of TS data stream. */
|
||||
GFMXDEMTSPARSERDATASOURCE datasource;
|
||||
|
||||
/** Size of TS input buffer to claim in GPU memory.
|
||||
This field is used only for parsers of type GFMXDEMTSPARSERTYPE_DSP and GFMXDEMTSPARSERTYPE_DSPAVSYNC.
|
||||
Must be 188 bytes minimum, and a multiple of 188 bytes. Internally two buffers
|
||||
of this size will be claimed in GPU memory to capture the input TS.
|
||||
*/
|
||||
NvU32 TSBufferSize;
|
||||
|
||||
/** Size of audio 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.
|
||||
Size depends on ADTS bitrate, and must be >= 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.
|
||||
<table>
|
||||
<tr><td>Bits 0-7 </td><td>Parser status bitmask, see #GFMXDEMTSPARSERSTATUS</td></tr>
|
||||
<tr><td>Bits 8-24 </td><td>reserved for extension</td></tr>
|
||||
<tr><td>Bits 23-31</td><td>Parser state, see #GFMXDEMTSPARSERSTATE</td></tr>
|
||||
</table>
|
||||
@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__ */
|
||||
795
Start_WM/test6/inc/GFMxEnc.h
Executable file
795
Start_WM/test6/inc/GFMxEnc.h
Executable file
@@ -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
|
||||
<ul>
|
||||
<li> @ref pageMxEncAppNotes
|
||||
<ul>
|
||||
<li> @ref pageMxEncAppNotes1
|
||||
</ul>
|
||||
</ul>
|
||||
*/
|
||||
/*@{*/
|
||||
|
||||
/** 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 */
|
||||
/**<
|
||||
<table>
|
||||
<tr><td>#GF_MXENC_VOL_SHORT_VIDEO_HEADER</td></tr>
|
||||
<tr><td>#GF_MXENC_VOL_BYPASS_VLC</td></tr>
|
||||
<tr><td>#GF_MXENC_VOL_RESYNC_MARK_ENABLE</td></tr>
|
||||
<tr><td>#GF_MXENC_VOL_DATA_PARTITION_ENABLE</td></tr>
|
||||
<tr><td>#GF_MXENC_VOL_REVERSIBLE_VLC_ENABLE</td></tr>
|
||||
<tr><td>#GF_MXENC_VOL_RATE_CONTROL_ENABLE</td></tr>
|
||||
<tr><td>#GF_MXENC_VOL_STUFFING_ENABLE</td></tr>
|
||||
<tr><td>#GF_MXENC_VOL_AUTO_IMRF_ENABLE</td></tr>
|
||||
<tr><td>#GF_MXENC_VOL_MC_IMRF_ENABLE</td></tr>
|
||||
<tr><td>#GF_MXENC_VOL_THUMBNAIL_ENABLE</td></tr>
|
||||
</table>
|
||||
*/
|
||||
PGFRMSURFACE pSrcSurf;/**< Surface to encode*/
|
||||
PGFRECT pSrcRect; /**<Source image area to encode*/
|
||||
NvU16 VOPWidth; /**< Width in pixel*/
|
||||
NvU16 VOPHeight; /**<Height in pixel*/
|
||||
float fFrameRate; /**<FrameRate per second*/
|
||||
NvU16 uiMaxBitRate; /**<Kbits/second*/
|
||||
NvU32 uiBufferSize; /**<Size in DWORDs.This buffer size is used by the Rate Control Algorithm .*/
|
||||
NvU32 uiTimeIncResolution; /**<For Non-SVH(Short Video Header) mode only*/
|
||||
PGFRMSURFACE pEncSurf;/**< Reference Surface for encoder*/
|
||||
PGFRMSURFACE pThumbnailSurface;/**< Surface to store the thumbnail of first encoded frame*/
|
||||
}GFMXENCVOL, *PGFMXENCVOL;
|
||||
|
||||
//uiVOLInfo:
|
||||
/**GFMXENCVOL::uiVOLInfo : GFMxEncAPI should generate Short Video Header(SVH) format VOP.If this flag is off, GFMxEncAPI should generate Non-SVH(Non Short Video Header) format VOP.*/
|
||||
#define GF_MXENC_VOL_SHORT_VIDEO_HEADER 0x00000001
|
||||
|
||||
/**GFMXENCVOL::uiVOLInfo : GFMxEncAPI should output raw data, bypass VLC.If this flag is off, GFMxEnc should output VLC bit stream*/
|
||||
#define GF_MXENC_VOL_BYPASS_VLC 0x00000002
|
||||
|
||||
/**GFMXENCVOL::uiVOLInfo : Enable Resync Marker*/
|
||||
#define GF_MXENC_VOL_RESYNC_MARK_ENABLE 0x00000004
|
||||
|
||||
/**GFMXENCVOL::uiVOLInfo : Enable Data Partition*/
|
||||
#define GF_MXENC_VOL_DATA_PARTITION_ENABLE 0x00000008
|
||||
|
||||
/**GFMXENCVOL::uiVOLInfo : Enable Reversible VLC Mode*/
|
||||
#define GF_MXENC_VOL_REVERSIBLE_VLC_ENABLE 0x00000010
|
||||
|
||||
/**GFMXENCVOL::uiVOLInfo:Enable Rate Control Algorithm*/
|
||||
#define GF_MXENC_VOL_RATE_CONTROL_ENABLE 0x00000020
|
||||
|
||||
/**GFMXENCVOL::uiVOLInfo:Stuff more bits to prevent buffer under flow*/
|
||||
#define GF_MXENC_VOL_STUFFING_ENABLE (0x00000040|GF_MXENC_VOL_RATE_CONTROL_ENABLE)
|
||||
|
||||
/**GFMXENCVOL::uiVOLInfo : Enable Intra Macroblock Refreshing. This mode could run automatically without application's interaction. Application could change the macroblock's counter range by calling GFMxEncSetVOP if desired */
|
||||
#define GF_MXENC_VOL_AUTO_IMRF_ENABLE 0x00000080
|
||||
|
||||
/**GFMXENCVOL::uiVOLInfo : Enable Intra Macroblock Refreshing with customized counter matrix from application.
|
||||
When this flag is on, Application must call GFMxEncSetVOP to setup Intra Macroblock Refresh counter matrix. */
|
||||
#define GF_MXENC_VOL_MC_IMRF_ENABLE 0x00000100
|
||||
|
||||
/**GFMXENCVOL::uiVOLInfo : Enable First Frame Thumbnail.It stores the thumbnail of first encoded frame in the surface given by Application.
|
||||
Height and width of thumbnail is equal to height and width of surface provided.
|
||||
Thumbnail can be encoded after GFMxEncStart function call*/
|
||||
#define GF_MXENC_VOL_THUMBNAIL_ENABLE 0x00000200
|
||||
|
||||
/** GFMxEncSetVOP parameter struct. */
|
||||
typedef struct _GFMXENCVOP
|
||||
{
|
||||
NvU32 uiVOPInfo; /**<VOP characteristics bitmask
|
||||
<table>
|
||||
<tr><td>#GF_MXENC_VOP_4MV_ENABLE</td></tr>
|
||||
<tr><td>#GF_MXENC_VOP_HALF_PEL_ENABLE</td></tr>
|
||||
<tr><td>#GF_MXENC_VOP_PACKET_BASED_ON_MB_NUM</td></tr>
|
||||
<tr><td>#GF_MXENC_VOP_AC_PRE_ALWAYS_ON</td></tr>
|
||||
<tr><td>#GF_MXENC_VOP_AC_PRE_DYNAMICALLY_ON</td></tr>
|
||||
<tr><td>#GF_MXENC_VOP_CHANGE_EXPECTED_SIZE</td></tr>
|
||||
<tr><td>#GF_MXENC_VOP_CHANGE_INITQP</td></tr>
|
||||
<tr><td>#GF_MXENC_VOP_CHANGE_MIN_MAX_QP</td></tr>
|
||||
<tr><td>#GF_MXENC_VOP_4MV_ENABLE</td></tr>
|
||||
<tr><td>#GF_MXENC_VOP_REDUCE_FRAME_RATE</td></tr>
|
||||
<tr><td>#GF_MXENC_VOP_ENCODE_I_ASAP</td></tr>
|
||||
<tr><td>#GF_MXENC_VOP_IMRF_CONTROL_IP_RATIO</td></tr>
|
||||
<tr><td>#GF_MXENC_VOP_LOAD_IMRF_COUNTER_RANGE</td></tr>
|
||||
<tr><td>#GF_MXENC_VOP_LOAD_IMRF_MATRIX</td></tr>
|
||||
<tr><td>#GF_MXENC_VOP_TIMESTAMP_CPU</td></tr>
|
||||
<tr><td>#GF_MXENC_VOP_TIMESTAMP_VI</td></tr>
|
||||
<tr><td>#GF_MXENC_VOP_CHANGE_MAX_QP_RELIEF</td></tr>
|
||||
</table>
|
||||
*/
|
||||
|
||||
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).
|
||||
<table>
|
||||
<tr><td>#GF_MXENC_VOP_TIMESTAMP_CPU</td></tr>
|
||||
<tr><td>#GF_MXENC_VOP_TIMESTAMP_VI</td></tr>
|
||||
</table>
|
||||
*/
|
||||
|
||||
}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; /**<Regular QP value for I*/
|
||||
NvU16 uiMinIQP; /**<Minimum QP value for I*/
|
||||
NvU16 uiMaxIQP; /**<Maximum QP value for I*/
|
||||
NvU16 uiMinISize; /**<Minimum I VOP size in DWORD*/
|
||||
NvU16 uiMaxISize; /**<Maximum I VOP size in DWORD*/
|
||||
NvU16 uiSuggestedISize; /**<Suggested I VOP size in DWORD*/
|
||||
|
||||
NvU16 uiPQP; /**<Regular QP value for P*/
|
||||
NvU16 uiMinPQP; /**<Minimum QP value for P*/
|
||||
NvU16 uiMaxPQP; /**<Maximum QP value for P*/
|
||||
NvU16 uiMinPSize; /**<Minimum P VOP size in DWORD*/
|
||||
NvU16 uiMaxPSize; /**<Maximum P VOP size in DWORD*/
|
||||
NvU16 uiSuggestedPSize; /**<Suggested P VOP size in DWORD*/
|
||||
|
||||
NvU16 uiUnderFlowThr; /**<Underflow threshold in DWORD*/
|
||||
NvU16 uiOverFlowThr; /**<Overflow threshold in DWORD*/
|
||||
NvU16 uiSkipVOPThr; /**<Skip VOP if the buffer over this threshold*/
|
||||
}GFMXENCRCC, *PGFMXENCRCC;
|
||||
|
||||
|
||||
/**typedef struct _GFMXENCFEEDIMAGE*/
|
||||
typedef struct _GFMXENCFEEDIMAGE
|
||||
{
|
||||
NvU32 uiTime; /**<Time stamp value in milliseconds, first VOP may start from 0*/
|
||||
PGFRMSURFACE pImgSurf;/**<Image surface to be encoded. GFMxEncAPI only supports YUV420/UYVY color type for this surface */
|
||||
}GFMXENCFEEDIMAGE, *PGFMXENCFEEDIMAGE;
|
||||
|
||||
#define GF_MXENC_DEFAULT_WAIT 50
|
||||
#define GF_MXENC_DEFAULT_NOWAIT -1
|
||||
|
||||
/**typedef struct _GFMXENCFETCHVOP*/
|
||||
typedef struct _GFMXENCFETCHVOP
|
||||
{
|
||||
//Filled by the Application
|
||||
void *pBuf;/**< If GF_MXENC_VOL_BYPASS_VLC is set, the data in this buffer is GFMxEnc Compressed Format Bit Stream; otherwise the data in this buffer is MPEG4 compliant bit stream. Please refer to Programming Guidlines for this format.*/
|
||||
NvU32 uiSizeofBuf; /**<Number of bytes in pBuf*/
|
||||
NvU16 *pPacketLengthBuf; /**<To hold each packet data */
|
||||
|
||||
NvU32 uiSizeofPLB; /**<Size of PacketLengthBuf in number of NvU16s */
|
||||
NvU32 uiUTContentSize;/**<Un-transferred content size.The size of bit stream that has not been transferred out yet to the application bit stream buffer.
|
||||
Number of DWORD. Valid only when application enable rate control.
|
||||
For source image from CPU case,application need set this field based on ideal transfer rate, since application may flush out the whole buffer before feeding and fetching another VOP.
|
||||
If more than half of uiBufferSize in GFMXENCVOL has not been transferred out, GFMXEnc will start reducing bit rate. If less than half, GFMXEnc will start increasing bit rate.*/
|
||||
NvU32 uiTimeOut; /**< in milliseconds
|
||||
-1: do not wait return immediately
|
||||
else waits for the specified msecs */
|
||||
//Filled by GFMxEncAPI
|
||||
NvU32 uiVOPInfo; /**< VOP INFO.
|
||||
<table>
|
||||
<tr><td>#MXENC_VOP_P_VOP</td></tr>
|
||||
<tr><td>#MXENC_VOP_MORE_FETCH</td></tr>
|
||||
<tr><td>#MXENC_VOP_PORTION_PACKET</td></tr>
|
||||
<tr><td>#MXENC_VOP_MORE_VOP</td></tr>
|
||||
<tr><td>#MXENC_VOP_BEGIN_VOP</td></tr>
|
||||
<tr><td>#MXENC_VOP_END_VOP</td></tr>
|
||||
<tr><td>#MXENC_VOP_BUFFER_OVERFLOW</td></tr>
|
||||
</table>
|
||||
*/
|
||||
NvU32 uiAverageQP; /**<Average QP for current frame*/
|
||||
NvU32 uiTime; /**<Encoded VOP's time stamp in milliseconds. First VOP may start from 0*/
|
||||
NvU32 uiFetchedSize; /**<Number of available bytes in pBuf */
|
||||
NvU32 uiPLBSize; /**<Number of available NvU16s in pPacketLengthBuf */
|
||||
|
||||
}GFMXENCFETCHVOP, *PGFMXENCFETCHVOP;
|
||||
|
||||
/**GFMXENCFETCHVOP::uiVOPInfo:The ecncoded frame is P VOP, if this flag is off, this VOP is I VOP*/
|
||||
#define MXENC_VOP_P_VOP 0x1
|
||||
|
||||
/**GFMXENCFETCHVOP::uiVOPInfo : GFMxEncAPI only fed partial VOP data in pBuf. Application need more calling to fetch the rest of data*/
|
||||
#define MXENC_VOP_MORE_FETCH 0x2
|
||||
|
||||
/**GFMXENCFETCHVOP::uiVOPInfo:The last packet in pBuf only contain partial of packet data, the last entry in pPacketLengthBuf is the size of this partial packet data size.Application need more calling to fetch the rest of data*/
|
||||
#define MXENC_VOP_PORTION_PACKET (0x4 |MXENC_VOP_MORE_FETCH)
|
||||
|
||||
/**GFMXENCFETCHVOP::uiVOPInfo : More VOPs are ready in GFMxEncAPI internal buffer. Application need to fetch as soon as possible */
|
||||
#define MXENC_VOP_MORE_VOP 0x8
|
||||
|
||||
/**GFMXENCFETCHVOP::uiVOPInfo : Fetched data is the begining chunk of new encoded VOP*/
|
||||
#define MXENC_VOP_BEGIN_VOP 0x10
|
||||
|
||||
/**GFMXENCFETCHVOP::uiVOPInfo : Fetched data is the last chunk of the encoded VOP*/
|
||||
#define MXENC_VOP_END_VOP 0x20
|
||||
|
||||
/**GFMXENCFETCHVOP::uiVOPInfo : Buffer Overflow flag for high level application*/
|
||||
#define MXENC_VOP_BUFFER_OVERFLOW 0x40
|
||||
|
||||
/** @name GFMxEncSetAttribute_Definitions
|
||||
*/
|
||||
//@{
|
||||
|
||||
/**GFMxEncSetAttribute_Definitions*/
|
||||
|
||||
/**GFMxEncSetAttribute_Definitions::MXENC_ATTR_KEEP_PREV_ENCODING_INTERNAL_RESOURCE:
|
||||
To avoid fragmentation of memory, use this flag to keep internal memory
|
||||
allocated.
|
||||
*pInfo = 1, application wants GFMxEnc to re-use previous encoding process'
|
||||
internal resources, those resources refers to some internal buffers.
|
||||
If the attribute is on, the new encoding process need more resources,
|
||||
GFMxEnc will release previous internal resource and relocate new resources.
|
||||
If the new encoding process need equal or less resources, GFMxEnc will use
|
||||
previous' internal resource. If there is no previous encoding process at all,
|
||||
GFMxEnc will alloc new resources.
|
||||
*pInfo = 0, Release previous encoding process' internal resource if GFMxEnc has.
|
||||
Alloc new resources for current encoding process.
|
||||
Make sure that you allocate memory for big size encoding and
|
||||
then use this flag to reuse that memory for smaller size.
|
||||
*/
|
||||
#define MXENC_ATTR_KEEP_PREV_ENCODING_INTERNAL_RESOURCE 2
|
||||
|
||||
/**GFMxEncSetAttribute_Definitions::MXENC_PREVIEW_ROTATE_BUFFER:
|
||||
GF4800 supports rotation for video encoding. In the rotated mode,
|
||||
full frame of video has to be captured before encoder can start encoding.
|
||||
The YUV4:2:0 data in the rotated buffer can be used for previewing also.
|
||||
This option can be used to enable the preview from these buffers.
|
||||
In rotated mode, Encoder has to be on, even for preview.
|
||||
VI auto trigger will not work if VI is not writing to a YUV4:2:2 memory buf.
|
||||
GF4800 hardware has two issues:
|
||||
-In order to get video thru rotator, encoder has to be on.
|
||||
-In order to use auto VI trigger for SB, VI has to get YUV4:2:2 data to
|
||||
the memory buffer.
|
||||
To overcome these issues, we have put some work-around in the MxEncAPI.
|
||||
MxEncPause(): In the rotated mode, app should call this function right
|
||||
after video input Vsync to avoid tearing in the recording.
|
||||
*pInfo = 1 to enable preview from the rotated buffers.
|
||||
*pInfo = 0 to disable this mode (normal mode)
|
||||
This option can only be used when MXENC_ATTR_ROTATION is set and/or
|
||||
GFMxEncSetVOL() option GF_MXENC_VOL_PREPARE_ROTATION is set.
|
||||
*/
|
||||
|
||||
#define MXENC_PREVIEW_ROTATE_BUFFER 3
|
||||
|
||||
/**GFMxEncSetAttribute_Definitions::MXENC_GET_PREVIEW_BUFFER:
|
||||
Rotate buffers are allocated by the API in the GPU memory.
|
||||
Preview is normally done by App using GFVxBlt() to convert an off-screen YUV
|
||||
surface to an on-screen RGB rectangular area.
|
||||
MXENC_GET_PREVIEW_BUFFER option is used in GFMxEncGetAttribute() to obtain
|
||||
the address (GFRmSurface) of the rotated buffers which is allocated by
|
||||
GFMxEncAPI. These surfaces should be passed to GFVxBlt() to display camera
|
||||
data. App must not delete these surfaces. These will be freed by GFMxEncAPI.
|
||||
This option is available in only when MXENC_PREVIEW_ROTATE_BUFFER is on.
|
||||
*/
|
||||
|
||||
#define MXENC_GET_PREVIEW_BUFFER 4
|
||||
|
||||
/**GFMxEncSetAttribute_Definitions::MXENC_ENABLE_INTERRUPT_MODE:
|
||||
Interrupt mode is supported in MxEncAPI, which will enable to generate the interrupt at the end of each frame encode.
|
||||
The bitstream will be then read from the DMA buffer and written to the host buffer.
|
||||
MXENC_ENABLE_INTERRUPT_MODE option is used in GFMxEncGetAttribute() to enable
|
||||
interrupt support by GFMxEncAPI.
|
||||
*/
|
||||
#define MXENC_ENABLE_INTERRUPT_MODE 8
|
||||
|
||||
#define MXENC_ATTR_TIMESTAMP 12
|
||||
|
||||
#define MXENC_ATTR_TIMEINC_FIELD 0x7F
|
||||
#define MXENC_ATTR_MODULOTIMEBSE_SHIFT 8
|
||||
#define MXENC_ATTR_MODESWITCH_SHIFT 9
|
||||
#define MXENC_ATTR_MODESWITCH_FIELD 512
|
||||
#define MXENC_ATTR_MODULOTIMEBSE_FIELD 256
|
||||
|
||||
#define MXENC_ATTR_INTRAREFRESH_MODE 16
|
||||
|
||||
/**GFMxEncSetAttribute_Definitions::MXENC_ATTR_ZOOMENABLE:
|
||||
To enable zoom capability of the GFMxEncAPI driver. This attribute needs to be SET by the client application,
|
||||
if the application wants to zoom the encoded video. See application notes for more information about programming
|
||||
zoom in GFMxEncAPI.
|
||||
*/
|
||||
#define MXENC_ATTR_ZOOMENABLE 32
|
||||
|
||||
|
||||
/**GFMxEncSetAttribute_Definitions::MXENC_ATTR_ZOOM:
|
||||
This attribute needs to be set whenever the client application wants to perform 2x, 3x or 4x zoom.
|
||||
It is mandatory for the client application to call GFMxEncPause() before and after
|
||||
GFMxEncSetAttribute() is called with MXENC_ATTR_ZOOM option. See application notes for more information about programming
|
||||
zoom in GFMxEncAPI.
|
||||
*/
|
||||
#define MXENC_ATTR_ZOOM 64
|
||||
|
||||
#define MXENC_ATTR_INTRAREFRESH_AUTO 1
|
||||
#define MXENC_ATTR_INTRAREFRESH_MC 2
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GFMX_ENC_INTERRUPT_ENABLE,
|
||||
GFMX_ENC_INTERRUPT_DISABLE,
|
||||
GFMX_ENC_INTERRUPT_CLEAR
|
||||
} GFMX_ENC_INTERRUPT_OPERATION_TYPE; // Interrupt operation.
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GFMX_ENC_FRAME_ENCODE_DONE_INTR
|
||||
} GFMX_ENC_INTERRUPT_TYPE;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" { // only need to export C interface if
|
||||
// used by C++ source code
|
||||
#endif
|
||||
|
||||
// Typesafe functions for opening and closing this component
|
||||
GF_RETTYPE GFMxEncOpen(GFRmHandle hRm, GFMxEncHandle *phMxEnc,
|
||||
GF_STATE_TYPE state, GFRmChHandle hCh);
|
||||
void GFMxEncClose(GFMxEncHandle *phMxEnc);
|
||||
|
||||
|
||||
|
||||
GF_RETTYPE GFMxEncGetProperty(GFMxEncHandle hMxEnc, PGFPROPERTY pMXProp);
|
||||
/**< This function returns a variety of information, including the version of the
|
||||
GFMxEncAPI encoder module. It is a good practice to call this function to query
|
||||
for the GFMxEncAPI version and its capabilities before using the rest of the
|
||||
GFMxEncAPI functions.
|
||||
|
||||
@param MXhandle (GFMxEncHandle) Handle specific to the GFMxEncAPI.
|
||||
@param pMXProp (PGFPROPERTY) Pointer to GFPROPERTY.
|
||||
MxEncAPI property flag below.
|
||||
|
||||
MxEncAPI property flag:
|
||||
<table>
|
||||
<tr><td>#GF_MXENC_CAP_SIMPLE</td></tr>
|
||||
<tr><td>#GF_MXENC_CAP_SCALE</td></tr>
|
||||
<tr><td>#GF_MXENC_CAP_CORE</td></tr>
|
||||
<tr><td>#GF_MXENC_CAP_MAIN</td></tr>
|
||||
<tr><td>#GF_MXENC_CAP_N_BIT</td></tr>
|
||||
<tr><td>#GF_MXENC_CAP_LEVEL1</td></tr>
|
||||
<tr><td>#GF_MXENC_CAP_LEVEL2</td></tr>
|
||||
<tr><td>#GF_MXENC_CAP_LEVEL3</td></tr>
|
||||
<tr><td>#GF_MXENC_CAP_LEVEL4</td></tr>
|
||||
<tr><td>#GF_MXENC_CAP_DATA_PARTITIONING</td></tr>
|
||||
<tr><td>#GF_MXENC_CAP_RVLC</td></tr>
|
||||
<tr><td>#GF_MXENC_CAP_RATE_CONTROL</td></tr>
|
||||
<tr><td>#GF_MXENC_CAP_IMRF</td></tr>
|
||||
<tr><td>#GF_MXENC_CAP_ROTATION</td></tr>
|
||||
</table>
|
||||
|
||||
@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 encoder<65>s 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
|
||||
camera<EFBFBD>s 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 application<6F>s interrupt callback function.
|
||||
@param IPara (void *) Pointer to parameter of encoder application<6F>s 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:
|
||||
<table>
|
||||
<tr><td>#MXENC_ATTR_KEEP_PREV_ENCODING_INTERNAL_RESOURCE</td></tr>
|
||||
<tr><td>#MXENC_PREVIEW_ROTATE_BUFFER</td></tr>
|
||||
<tr><td>#MXENC_GET_PREVIEW_BUFFER</td></tr>
|
||||
<tr><td>#MXENC_ENABLE_INTERRUPT_MODE</td></tr>
|
||||
</table>
|
||||
|
||||
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
|
||||
|
||||
<table>
|
||||
<tr><td>#MXENC_ATTR_ROTATION</td></tr>
|
||||
<tr><td>#MXENC_ATTR_ROTATE_0</td></tr>
|
||||
<tr><td>#MXENC_ATTR_ROTATE_90</td></tr>
|
||||
<tr><td>#MXENC_ATTR_ROTATE_180</td></tr>
|
||||
<tr><td>#MXENC_ATTR_ROTATE_270</td></tr>
|
||||
<tr><td>#MXENC_ATTR_H_FLIP</td></tr>
|
||||
<tr><td>#MXENC_ATTR_V_FLIP</td></tr>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
|
||||
*/
|
||||
|
||||
/** @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__
|
||||
788
Start_WM/test6/inc/GFMxEncH264.h
Executable file
788
Start_WM/test6/inc/GFMxEncH264.h
Executable file
@@ -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
|
||||
<ul>
|
||||
<li> @ref pageMxEncH264AppNotes
|
||||
<ul>
|
||||
<li> @ref pageMxEncH264AppNotes1
|
||||
</ul>
|
||||
</ul>
|
||||
*/
|
||||
/*@{*/
|
||||
|
||||
/** @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 */
|
||||
/**<
|
||||
<table>
|
||||
<tr><td>#GF_MXENC_H264_SEQUENCE_CONSTRAINT_SET0_FLAG</td></tr>
|
||||
<tr><td>#GF_MXENC_H264_SEQUENCE_CONSTRAINT_SET1_FLAG</td></tr>
|
||||
<tr><td>#GF_MXENC_H264_SEQUENCE_CONSTRAINT_SET2_FLAG </td></tr>
|
||||
<tr><td>#GF_MXENC_H264_SEQUENCE_DELTA_PIC_ORDER_ALWAYS_ZERO_FLAG</td></tr>
|
||||
<tr><td>#GF_MXENC_H264_SEQUENCE_FRAME_MBS_ONLY_FLAG </td></tr>
|
||||
<tr><td>#GF_MXENC_H264_SEQUENCE_RATE_CONTROL_ENABLE</td></tr>
|
||||
<tr><td>#GF_MXENC_H264_SEQUENCE_AUTO_IMRF_ENABLE</td></tr>
|
||||
<tr><td>#GF_MXENC_H264_SEQUENCE_MC_IMRF_ENABLE</td></tr>
|
||||
<tr><td>#GF_MXENC_H264_SEQUENCE_REALTIME_ENCODE</td></tr>
|
||||
<tr><td>#GF_MXENC_H264_SEQUENCE_DEBLK_I_SLICE</td></tr>
|
||||
</table>
|
||||
*/
|
||||
NvU32 profile_idc; /**<Profile IDC, Baseline profile*/
|
||||
NvU32 level_idc; /**<Level IDC, Level 1.3 */
|
||||
NvU32 seq_parameter_set_id; /**<Sequence Parameter set ID */
|
||||
NvU32 log2_max_frame_num_minus_4; /**< Specifies the value of the variable MaxFrameNum, default value is 4*/
|
||||
NvU32 pic_order_cnt_type; /**<Specifies the method to decode picture order count, default value is 0 */
|
||||
NvU32 log2_max_pic_order_cnt_lsb_minus_4; /**< only available when pic_order_cnt_type is 0 */
|
||||
NvU32 offset_for_non_ref_pic; /**< only available when pic_order_cnt_type is 1 */
|
||||
NvU32 offset_for_top_to_bottom_field; /**< only available when pic_order_cnt_type is 1 */
|
||||
NvU32 num_ref_frames_in_pic_order_cnt_cycle; /**< only available when pic_order_cnt_type is 1 */
|
||||
NvU32 *poffset_for_ref_frame; /**<only available when pic_order_cnt_type is 1 */
|
||||
|
||||
NvU32 num_ref_frames; /**<Number of reference frames */
|
||||
PGFRMSURFACE *pSurfaces; /**< List of the surfaces of the reference frames */
|
||||
|
||||
NvU32 pic_width; /**< Picture Width in pixel*/
|
||||
NvU32 pic_height; /**< Picture Height in pixel*/
|
||||
PGFRMSURFACE pSrcSurf; /**< Surface to be encoded. If the source image is from a camera, set this field to NULL.*/
|
||||
PGFRECT pSrcRect; /**<Source image area to encode*/
|
||||
float fFrameRate; /**<Frame rate per second. This is the real input frame rate. For example, if encoding image is from camera, fFrameRate should be the camera frame rate. Not the encoded bit stream's frame rate.*/
|
||||
NvU32 uiMaxBitRate; /**<Kbits/second*/
|
||||
NvU32 uiBufferSize; /**<Size in DWORDs. This buffer is created and managed by the application to temporarily hold the encoded bitstream before transferring the bitstream out.*/
|
||||
NvU32 uiTimeIncResolution; /**<Time increment resolution */
|
||||
}GFMXENCH264SETSEQUENCE, *PGFMXENCH264SETSEQUENCE;
|
||||
|
||||
/** @name GFMxEncH264 API Setsequence::SequenceInfo */
|
||||
//@{
|
||||
/**GFMXENCH264SETSEQUENCE::SequenceInfo :The encoded bitstream is compliant to constraint set0 .*/
|
||||
#define GF_MXENC_H264_SEQUENCE_CONSTRAINT_SET0_FLAG 0x00000001
|
||||
|
||||
/**GFMXENCH264SETSEQUENCE::SequenceInfo :The encoded bitstream is compliant to constraint set1 .*/
|
||||
#define GF_MXENC_H264_SEQUENCE_CONSTRAINT_SET1_FLAG 0x00000002
|
||||
|
||||
/**GFMXENCH264SETSEQUENCE::SequenceInfo :The encoded bitstream is compliant to constraint set2 .*/
|
||||
#define GF_MXENC_H264_SEQUENCE_CONSTRAINT_SET2_FLAG 0x00000004
|
||||
|
||||
/**GFMXENCH264SETSEQUENCE::SequenceInfo :Equal to 1 specifies that delta_pic_order_cnt[0] and delta_pic_order_cnt[1] are not present in the slice header and shall be inferred to zero .*/
|
||||
#define GF_MXENC_H264_SEQUENCE_DELTA_PIC_ORDER_ALWAYS_ZERO_FLAG 0x00000008
|
||||
|
||||
/**GFMXENCH264SETSEQUENCE::SequenceInfo :Equal to 1 specifies that every coded picture of the video sequence is a coded frame containing only frame macroblocks .*/
|
||||
#define GF_MXENC_H264_SEQUENCE_FRMAE_MBS_ONLY_FLAG 0x00000010
|
||||
|
||||
/**GFMXENCH264SETSEQUENCE::SequenceInfo :When set, it enables sequence rate control .*/
|
||||
#define GF_MXENC_H264_SEQUENCE_RATE_CONTROL_ENABLE 0x00000020
|
||||
|
||||
/**GFMXENCH264SETSEQUENCE::SequenceInfo : Enable intra Macro Block refreshing. This mode could run automatically, without any APPs interaction. APPs could change the macroblocks, counter range by calling GFMxEncH264SetPicture if desired.*/
|
||||
#define GF_MXENC_H264_SEQUENCE_AUTO_IMRF_ENABLE 0x00000040
|
||||
|
||||
/**GFMXENCH264SETSEQUENCE::SequenceInfo : Enable intra macro block refreshing with customized counter matrix from APP, When this flag is on, Apps must call GFMxEnc264SetPicture to setup intra macro block, refresh counter matrix .*/
|
||||
#define GF_MXENC_H264_SEQUENCE_MC_IMRF_ENABLE 0x00000080
|
||||
|
||||
/**GFMXENCH264SETSEQUENCE::SequenceInfo : Inform firmware for realtime encode.*/
|
||||
#define GF_MXENC_H264_SEQUENCE_REALTIME_ENCODE 0x00000100
|
||||
|
||||
/**GFMXENCH264SETSEQUENCE::SequenceInfo : Turn off/on deblocking for I-frames, since I frames inherently have large cyclecount, and adding deblocking may cause a frameskip .*/
|
||||
#define GF_MXENC_H264_SEQUENCE_DEBLK_I_SLICE 0x00000200
|
||||
|
||||
//@}
|
||||
|
||||
|
||||
/** typedef struct GFMXENCH264SETPICTURE_TAG */
|
||||
typedef struct GFMXENCH264SETPICTURE_TAG
|
||||
{
|
||||
NvU32 PictureInfo; /**<Picture characteristics */
|
||||
/**<
|
||||
<table>
|
||||
<tr><td>#GF_MXENC_H264_PICTURE_CHANGE_INIT_QP</td></tr>
|
||||
<tr><td>#GF_MXENC_H264_PICTURE_REDUCE_FRAME_RATE</td></tr>
|
||||
<tr><td>#GF_MXENC_H264_PICTURE_ENCODE_IDR_ASAP </td></tr>
|
||||
<tr><td>#GF_MXENC_H264_PICTURE_CHANGE_MIN_MAX_QP</td></tr>
|
||||
<tr><td>#GF_MXENC_H264_PICTURE_LOAD_IMRF_COUNTER_RANGE</td></tr>
|
||||
<tr><td>#GF_MXENC_H264_PICTURE_LOAD_IMRF_MATRIX </td></tr>
|
||||
<tr><td>#GF_MXENC_H264_PICTURE_4MV_ENABLE</td></tr>
|
||||
<tr><td>#GF_MXENC_H264_PICTURE_HALF_PEL_ENABLE</td></tr>
|
||||
<tr><td>#GF_MXENC_H264_PICTURE_DEBLK_FILTER_ENABLE</td></tr>
|
||||
<tr><td>#GF_MXENC_H264_PICTURE_MULTI_SLICE_ENABLE</td></tr>
|
||||
</table>
|
||||
*/
|
||||
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; /**<Regular QP value for I*/
|
||||
NvU16 uiMinIQP; /**<Minimum QP value for I*/
|
||||
NvU16 uiMaxIQP; /**<Maximum QP value for I*/
|
||||
NvU16 uiMinISize; /**<Minimum I picture size in DWORD*/
|
||||
NvU16 uiMaxISize; /**<Maximum I picture size in DWORD*/
|
||||
NvU16 uiSuggestedISize; /**<Suggested I picture size in DWORD*/
|
||||
|
||||
NvU16 uiPQP; /**<Regular QP value for P*/
|
||||
NvU16 uiMinPQP; /**<Minimum QP value for P*/
|
||||
NvU16 uiMaxPQP; /**<Maximum QP value for P*/
|
||||
NvU16 uiMinPSize; /**<Minimum P picture size in DWORD*/
|
||||
NvU16 uiMaxPSize; /**<Maximum P picture size in DWORD*/
|
||||
NvU16 uiSuggestedPSize; /**<Suggested P picture size in DWORD*/
|
||||
|
||||
NvU16 uiUnderFlowThr; /**<Underflow threshold in DWORD*/
|
||||
NvU16 uiOverFlowThr; /**<Overflow threshold in DWORD*/
|
||||
NvU16 uiSkipVOPThr; /**<Skip VOP if the buffer over this threshold*/
|
||||
}GFMXENCH264RCC, *PGFMXENCH264RCC;
|
||||
|
||||
|
||||
/**typedef struct GFMXENCH264FEEDIMAGE_TAG*/
|
||||
typedef struct GFMXENCH264FEEDIMAGE_TAG
|
||||
{
|
||||
NvU32 uiTime; /**< Frame time in milliseconds, First picture may start from 0. */
|
||||
PGFRMSURFACE pImgSurf; /**< Image to be encoded, GFMxEncH264FeedImage can support the GF_SURFACE_YUV420, GF_SURFACE_YUYV, GF_SURFACE_YVYU, GF_SURFACE_UYVY, and GF_SURFACE_VYUY formats. */
|
||||
}GFMXENCH264FEEDIMAGE, *PGFMXENCH264FEEDIMAGE;
|
||||
|
||||
/**typedef struct GFMXENCH264FETCHNALS_TAG*/
|
||||
typedef struct GFMXENCH264FETCHNALS_TAG
|
||||
{
|
||||
//Filled by Application
|
||||
void *pBuf; /**< GFMxEncH264API fills this buffer with H264 encoded bitstream, must be 32 bit aligned */
|
||||
NvU32 uiSizeofBuf; /**< Size of pBuf */
|
||||
NvU16 *pNALsLengthBuf; /**< NAL unit length in bytes. If encoder application wants know each NAL unit's size, this field should be set. If this field is NULL, the GFMxEncAPI does not output any NAL unit size information */
|
||||
NvU32 uiTimeOut; /**< In milliseconds. If 0, return immediately if there is no NAL unit ready. If -1, wait until NAL unit is ready*/
|
||||
|
||||
//Filled in by the GFMxEncH264API
|
||||
NvU32 uiNALsInfo; /**< Information on NAL unit returned by GFMxEncH264FetchNALs() function. */
|
||||
/**<
|
||||
<table>
|
||||
<tr><td>#GF_MXENC_H264_NALS_SEQUENCE_PARAMETER_SET</td></tr>
|
||||
<tr><td>#GF_MXENC_H264_NALS_PICTURE_PARAMETER_SET</td></tr>
|
||||
<tr><td>#GF_MXENC_H264_NALS_IDR_PIC </td></tr>
|
||||
<tr><td>#GF_MXENC_H264_NALS_NON_IDR_PIC</td></tr>
|
||||
<tr><td>#GF_MXENC_H264_NALS_BEGIN_ACCESS_UNIT</td></tr>
|
||||
<tr><td>#GF_MXENC_H264_NALS_PARTIAL_ACCESS_UNIT</td></tr>
|
||||
<tr><td>#GF_MXENC_H264_NALS_END_ACCESS_UNIT</td></tr>
|
||||
<tr><td>#GF_MXENC_H264_NALS_DATA_NOT_READY</td></tr>
|
||||
<tr><td>#GF_MXENC_H264_NALS_MORE_FETCH</td></tr>
|
||||
<tr><td>#GF_MXENC_H264_NALS_MORE_NALS</td></tr>
|
||||
</table>
|
||||
*/
|
||||
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:
|
||||
<table>
|
||||
<tr><td>#GF_MXENC_H264_CAP_BASELINE</td></tr>
|
||||
<tr><td>#GF_MXENC_H264_CAP_MAIN</td></tr>
|
||||
<tr><td>#GF_MXENC_H264_CAP_EXTENDED</td></tr>
|
||||
<tr><td>#GF_MXENC_H264_CAP_HIGH10</td></tr>
|
||||
<tr><td>#GF_MXENC_H264_CAP_HIGH422</td></tr>
|
||||
<tr><td>#GF_MXENC_H264_CAP_HIGH444</td></tr>
|
||||
<tr><td>#GF_MXENC_H264_CAP_LEVEL_IDC</td></tr>
|
||||
<tr><td>#GF_MXENC_H264_CAP_DATA_PARTITIONING </td></tr>
|
||||
<tr><td>#GF_MXENC_H264_CAP_RATE_CONTROL</td></tr>
|
||||
<tr><td>#GF_MXENC_H264_CAP_IMRF</td></tr>
|
||||
<tr><td>#GF_MXENC_H264_CAP_ROTATION</td></tr>
|
||||
</table>
|
||||
|
||||
@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 encoder<65>s 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
|
||||
camera<72>s 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 application<6F>s interrupt callback function.
|
||||
@param IPara (void *) Pointer to parameter of encoder application<6F>s 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:
|
||||
<table>
|
||||
<tr><td>#MXENC_H264_ATTR_ROTATION</td></tr>
|
||||
<tr><td>#MXENC_H264_INTRAREFRESH_MODE</td></tr>
|
||||
</table>
|
||||
|
||||
|
||||
*/
|
||||
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__
|
||||
39
Start_WM/test6/inc/GFOSx.h
Executable file
39
Start_WM/test6/inc/GFOSx.h
Executable file
@@ -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_
|
||||
140
Start_WM/test6/inc/GFOption.h
Executable file
140
Start_WM/test6/inc/GFOption.h
Executable file
@@ -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__ */
|
||||
|
||||
2039
Start_WM/test6/inc/GFRm.h
Executable file
2039
Start_WM/test6/inc/GFRm.h
Executable file
File diff suppressed because it is too large
Load Diff
68
Start_WM/test6/inc/GFRmError.h
Executable file
68
Start_WM/test6/inc/GFRmError.h
Executable file
@@ -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__
|
||||
|
||||
515
Start_WM/test6/inc/GFRmHelp.h
Executable file
515
Start_WM/test6/inc/GFRmHelp.h
Executable file
@@ -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, USER<45>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<49>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: 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 <string.h>
|
||||
#include <stdlib.h>
|
||||
#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 <ctype.h>
|
||||
#define GFToupper toupper
|
||||
#define GFTolower tolower
|
||||
|
||||
#include <string.h>
|
||||
#ifndef GF_XTENSA_RM_TASK
|
||||
#include <strings.h>
|
||||
#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 <stdio.h>
|
||||
#define GFPrintf printf
|
||||
#define GFSprintf sprintf
|
||||
#define GFSprintfVAL vsprintf
|
||||
#define GFPrintf printf
|
||||
#define GFSprintf sprintf
|
||||
#define GFSprintfVAL vsprintf
|
||||
#define GFPrintfVAL vprintf
|
||||
|
||||
#include <stdlib.h>
|
||||
#define GFStrtol strtol
|
||||
#define GFStrtod strtod
|
||||
#define GFAtoi atoi
|
||||
#include <unistd.h>
|
||||
|
||||
/* Add or overload RMCTrace function here */
|
||||
#if defined(GF_ENABLE_RMC_TRACE)
|
||||
#include <stdarg.h>
|
||||
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 <linux/kernel.h>
|
||||
#include <linux/slab.h>
|
||||
|
||||
#include <linux/ctype.h>
|
||||
#define GFToupper toupper
|
||||
#define GFTolower tolower
|
||||
|
||||
#include <linux/string.h>
|
||||
#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 <stdarg.h>
|
||||
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 <ctype.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
/* 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 <string.h>
|
||||
|
||||
/* 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 <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
/* 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__ */
|
||||
|
||||
626
Start_WM/test6/inc/GFRmHelp.inl
Executable file
626
Start_WM/test6/inc/GFRmHelp.inl
Executable file
@@ -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, USER<45>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<49>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: 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 <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <malloc.h>
|
||||
#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 <assert.h>
|
||||
#define GFDEBUG_ASSERT(x) assert(x)
|
||||
#endif
|
||||
|
||||
|
||||
#define __declspec(x)
|
||||
|
||||
#include <stdlib.h>
|
||||
#define GFMalloc malloc
|
||||
#define GFFree free
|
||||
|
||||
#include <ctype.h>
|
||||
#define GFAToupper toupper
|
||||
#define GFATolower tolower
|
||||
|
||||
#include <string.h>
|
||||
#ifndef GF_XTENSA_RM_TASK
|
||||
#include <strings.h>
|
||||
#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 <stdio.h>
|
||||
#define GFAPrintf printf
|
||||
#define GFASprintf sprintf
|
||||
#define GFASprintfVAL vsprintf
|
||||
#define GFAPrintf printf
|
||||
#define GFASprintf sprintf
|
||||
#define GFASprintfVAL vsprintf
|
||||
#define GFAPrintfVAL vprintf
|
||||
|
||||
#include <stdlib.h>
|
||||
#define GFAStrtol strtol
|
||||
#define GFAStrtod strtod
|
||||
#define GFAAtoi atoi
|
||||
#include <unistd.h>
|
||||
|
||||
/* Add or overload RMCTrace function here */
|
||||
#if defined(GF_ENABLE_RMC_TRACE)
|
||||
#include <stdarg.h>
|
||||
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 <linux/kernel.h>
|
||||
#include <linux/slab.h>
|
||||
#define GFMalloc(x) kmalloc((x), GFP_KERNEL)
|
||||
#define GFFree kfree
|
||||
|
||||
#include <linux/ctype.h>
|
||||
#define GFAToupper toupper
|
||||
#define GFATolower tolower
|
||||
|
||||
#include <linux/string.h>
|
||||
#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 <stdarg.h>
|
||||
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 <conio.h>
|
||||
#include <ctype.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <malloc.h>
|
||||
#include <stdio.h>
|
||||
|
||||
/* 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 <string.h>
|
||||
|
||||
#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 <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <ctype.h>
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
/* 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__ */
|
||||
|
||||
654
Start_WM/test6/inc/GFRmIx.h
Executable file
654
Start_WM/test6/inc/GFRmIx.h
Executable file
@@ -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<<GFIX_OSC), (1<<GFIX_ROSC),
|
||||
(1<<GFIX_REFCLK0), (1<<GFIX_REFCLK1)
|
||||
|
||||
@retval #GF_SUCCESS Success
|
||||
@retval #GF_ERROR Some error occured
|
||||
*/
|
||||
GF_RETTYPE
|
||||
GFRmIxSetPLLReferenceClocks( GFRmHandle RmHandle,
|
||||
NvU32 option,
|
||||
NvU32 clocks );
|
||||
|
||||
/** This function sets the bounds and clocking profile of the modules.
|
||||
|
||||
@param RmHandle (#GFRmHandle) Handle specific to the GFRm
|
||||
@param modid (NvU32) ID of the module
|
||||
@param pConfig (#GFIXMODULECONFIG*) Pointer to module configuration
|
||||
|
||||
@retval #GF_SUCCESS Success
|
||||
@retval #GF_ERROR Some error occured
|
||||
|
||||
While this function may be called while the module's clock is enabled,
|
||||
it will not affect the current clock settings of the module but all new
|
||||
Ix calls dealing with the module will follow the configuration set by
|
||||
this function.
|
||||
|
||||
@see GFRmIxGetModuleConfig()
|
||||
*/
|
||||
GF_RETTYPE
|
||||
GFRmIxSetModuleConfig( GFRmHandle RmHandle,
|
||||
eGFModuleIDs modid,
|
||||
GFIXMODULECONFIG *pConfig );
|
||||
|
||||
/** This function retrieves the module's configuration
|
||||
|
||||
@param RmHandle (#GFRmHandle) Handle specific to the GFRm
|
||||
@param modid (NvU32) ID of the module
|
||||
@param pConfig (#GFIXMODULECONFIG*) Pointer to module configuration
|
||||
|
||||
@retval #GF_SUCCESS Success
|
||||
@retval #GF_ERROR Some error occured
|
||||
|
||||
@see GFRmIxSetModuleConfig()
|
||||
*/
|
||||
GF_RETTYPE
|
||||
GFRmIxGetModuleConfig( GFRmHandle RmHandle,
|
||||
eGFModuleIDs modid,
|
||||
GFIXMODULECONFIG *pConfig );
|
||||
|
||||
/** This function can perform a master clock enable and disable.
|
||||
|
||||
@param RmHandle (#GFRmHandle) Handle specific to the GFRm
|
||||
@param option (NvU32) 0 for master disable
|
||||
|
||||
@retval #GF_SUCCESS Success
|
||||
@retval #GF_ERROR Some error occured
|
||||
|
||||
When doing a master disable all module's clocks currently enabled are
|
||||
disabled. To restore the system to its previous state a master enable
|
||||
should be performed.
|
||||
|
||||
@see GFRmIxEnableModuleClock()
|
||||
*/
|
||||
GF_RETTYPE
|
||||
GFRmIxEnableClock( GFRmHandle RmHandle,
|
||||
NvU32 option );
|
||||
|
||||
/** This function is used to query information about a module's state.
|
||||
|
||||
@param RmHandle (#GFRmHandle) Handle specific to the GFRm
|
||||
@param modid (#eGFModuleIDs) ID of the module
|
||||
@param pState (#GFIXMODULESTATE*) Pointer to GFIXMODULESTATE structure to
|
||||
be filled in
|
||||
|
||||
@retval #GF_SUCCESS Success
|
||||
@retval #GF_ERROR Some error occured
|
||||
*/
|
||||
GF_RETTYPE
|
||||
GFRmIxGetModuleState( GFRmHandle RmHandle,
|
||||
eGFModuleIDs modid,
|
||||
GFIXMODULESTATE *pState );
|
||||
|
||||
/** This function forces the selection of a certain clock by a module.
|
||||
|
||||
@param RmHandle (#GFRmHandle) Handle specific to the GFRm
|
||||
@param modid (#eGFModuleIDs) ID of the module
|
||||
@param clockid (#NvU32) ID of the clock
|
||||
|
||||
The clock most be a valid clock for the module (the list of valid clocks
|
||||
for a module are set using GFRmIxSetModuleConfig()). This function most
|
||||
be called before the module's clock is enabled or the function call will
|
||||
fail.
|
||||
|
||||
@retval #GF_SUCCESS Success
|
||||
@retval #GF_ERROR Some error occured
|
||||
|
||||
@see GFRmIxSetModuleConfig()
|
||||
*/
|
||||
GF_RETTYPE
|
||||
GFRmIxSelectModuleClock( GFRmHandle RmHandle,
|
||||
eGFModuleIDs modid,
|
||||
NvU32 clockid );
|
||||
|
||||
/** This function sets the PAD calibration register for various modules.
|
||||
|
||||
@param RmHandle (#GFRmHandle) Handle specific to the GFRm
|
||||
@param padType (#NvU32) Type of PAD to modify
|
||||
@param value (#NvU32) Value to write to PAD register
|
||||
|
||||
ctrlType is one of: 0=VI, 1=Host 2=MEM 3=LCD 4=SD 5=Audio
|
||||
|
||||
@retval #GF_SUCCESS Success
|
||||
@retval #GF_ERROR Invalid ctrlType
|
||||
*/
|
||||
GF_RETTYPE
|
||||
GFRmIxSetPADCal( GFRmHandle RmHandle,
|
||||
NvU32 padType,
|
||||
NvU32 value);
|
||||
|
||||
/** This function sets the PAD control register for various modules.
|
||||
|
||||
@param RmHandle (#GFRmHandle) Handle specific to the GFRm
|
||||
@param padType (#NvU32) Type of PAD to modify
|
||||
@param value (#NvU32) Value to write to PAD register
|
||||
|
||||
ctrlType is one of: 0=VI, 1=Host 2=EMC 3=LCD 4=SD 5=Audio
|
||||
|
||||
@retval #GF_SUCCESS Success
|
||||
@retval #GF_ERROR Invalid ctrlType
|
||||
*/
|
||||
GF_RETTYPE
|
||||
GFRmIxSetPADCtrl( GFRmHandle RmHandle,
|
||||
NvU32 padType,
|
||||
NvU32 value);
|
||||
|
||||
GF_RETTYPE
|
||||
GFRmIxGPIO( GFRmHandle RmHandle,
|
||||
GFIX_GPIO_TYPE gpio,
|
||||
NvU32 operation,
|
||||
PGFGPIOSTATUS pGPIOStatus);
|
||||
|
||||
GF_RETTYPE
|
||||
GFRmIxGetProperty( GFRmHandle RmHandle,
|
||||
PGFPROPERTY pProp );
|
||||
|
||||
GF_RETTYPE
|
||||
GFRmIxSetAttribute( GFRmHandle RmHandle,
|
||||
GFIX_ATTR_TYPE attrType,
|
||||
NvU32 attrData );
|
||||
|
||||
GF_RETTYPE
|
||||
GFRmIxGetAttribute( GFRmHandle RmHandle,
|
||||
GFIX_ATTR_TYPE attrType,
|
||||
NvU32 *pAttrData );
|
||||
|
||||
/*@}*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // _GFIX_H_
|
||||
|
||||
551
Start_WM/test6/inc/GFRmOEM.h
Executable file
551
Start_WM/test6/inc/GFRmOEM.h
Executable file
@@ -0,0 +1,551 @@
|
||||
/* Copyright (c) 2003 - 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 GFRmOEM.h
|
||||
|
||||
GFSDK Resource Manager Platform (Public to OEM/System builders) header file.
|
||||
*/
|
||||
|
||||
#ifndef __GFRMOEM_H__
|
||||
#define __GFRMOEM_H__
|
||||
|
||||
#include "GF.h"
|
||||
#include "GFRm.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#define GF_HW_DRIVER 0
|
||||
#define GF_NULL_DRIVER 1
|
||||
|
||||
#define GF_MAP_IO 0
|
||||
#define GF_MAP_MEM 1
|
||||
#define GF_MAP_EXTMEM 2
|
||||
#define GF_MAP_MMIO 3
|
||||
|
||||
#define RM_ENV_INVALID_VOLTAGE 100000
|
||||
|
||||
#define RM_ENV_MAXLEN 128
|
||||
|
||||
/** RM SetupPlatform output variable structure. */
|
||||
typedef struct _GFRMSETUPPLATFORM
|
||||
{
|
||||
void * pUserObject0; //Pointer to user specified object 0 to high layer function RmSetupPlatform
|
||||
void * pUserObject1; //Pointer to user specified object 1 to high layer function RmSetupPlatform
|
||||
NvU32 DriverType; //Driver type.
|
||||
NvU32 cs_base_address; //cs base address.
|
||||
}GFRMSETUPPLATFORM, *PGFRMSETUPPLATFORM;
|
||||
|
||||
/** RM Environment Variable Configuration. */
|
||||
typedef struct _GFRMENVIRONMENTVARIABLES
|
||||
{
|
||||
NvU32 BusWidth; //!< Width of the Bus
|
||||
char BusType; //!< Setting for Bus Type a/A/b/B/c/C
|
||||
char AddrType; //!< Setting for Addr Type d/D/i/I
|
||||
char CPUAddrType; //!< Setting for CPU Addr Type d/D/i/I
|
||||
NvU32 Pll1Frequency; //!< PLL1 frequency in KHz
|
||||
NvU32 Pll2Frequency; //!< PLL2 frequency in KHz
|
||||
NvU32 Pll3Frequency; //!< PLL3 frequency in KHz
|
||||
NvU32 RefClk0Frequency; //!< RefClk0 frequency in KHz
|
||||
struct {
|
||||
NvU32 GR2D; //!< 2D graphics engine clock frequency
|
||||
NvU32 GR3D; //!< 3D graphics engine clock frequency
|
||||
NvU32 MC; //!< Memory controller clock frequency
|
||||
NvU32 EMC; //!< External memory clock frequency
|
||||
NvU32 HOST1X; //!< Host1x controller clock frequency
|
||||
} ModuleFrequencies;
|
||||
NvU32 VCO1MaxFrequency; //!< Max frequency of VCO 1
|
||||
NvU32 VCO2MaxFrequency; //!< Max frequency of VCO 2
|
||||
char Term[RM_ENV_MAXLEN]; //!< Sets raw key input
|
||||
NvU32 ScriptDebugger; //!< Script Debugger Enable
|
||||
char ScriptSourcePath[RM_ENV_MAXLEN]; //!< Path to script source directory
|
||||
char ExtDataPath[RM_ENV_MAXLEN]; //!< Path to external data directory
|
||||
NvU32 ExtMemType; //!< Type of Extended memory (0=no EMC init, if
|
||||
//!< non-zero it initializes the EMC with EMC entry
|
||||
//!< (ExtMemType-1)
|
||||
NvU32 ExtMemSize; //!< Size of Extended memory
|
||||
NvU32 ExtMemOffsetMB; //!< Extended memory offset from the base.
|
||||
|
||||
NvU32 IntMemSize; //!< internal memory size
|
||||
NvU32 IntMemOffset; //!< internal memory offset.
|
||||
|
||||
NvU32 IxInitBypassScripts;//!< Bypass reading RM.amx and initialization.amx
|
||||
NvU32 CrystalOscBypass; //!< Runs COSC in bypass mode
|
||||
NvU32 PushBufferSize; //!< Default push buffer size
|
||||
char RMCTraceFileName[RM_ENV_MAXLEN]; //!< RMC trace file name.
|
||||
char Sync; //!< Sync/async for bus mode s/S/a/A
|
||||
char Handshake; //!< Hand shake for bus mode y/Y/n/N
|
||||
char Ready; //!< Ready activehigh/low for bus mode l/L/h/H
|
||||
NvU32 ASDBGREGb20; //!< Controls bit 20 in ASDBGREG
|
||||
NvU32 MPanelIndex; //!< Index of main panel
|
||||
NvU32 PanelIndex1; //!< Index of second panel (0 for no panel)
|
||||
NvU32 AOCVDD; //!< AOCVDD
|
||||
NvU32 VECVDD; //!< VECVDD
|
||||
NvU32 MMCVDD; //!< MMCVDD
|
||||
NvU32 TDCVDD; //!< TDCVDD
|
||||
NvU32 VVDD; //!< VVDD
|
||||
NvU32 EMVDD; //!< EMVDD
|
||||
NvU32 ACVDD; //!< ACVDD
|
||||
NvU32 LVDD; //!< LVDD
|
||||
NvU32 SDVDD; //!< SDVDD
|
||||
NvU32 HVDD; //!< HVDD
|
||||
NvU32 AUXVDD; //!< AUXVDD
|
||||
NvU32 R1CVDD; //!< R1CVDD
|
||||
NvU32 PowerControl; //!< GFSDK_POWER_CONTROL_ENABLE
|
||||
NvU32 UseDSP; //!< GFSDK_USE_DSP
|
||||
NvU32 IspUseDSP; //!< GFSDK_ISP_USE_DSP, nonzero to run ISP on DSP
|
||||
NvU32 COSCFreq; //!< COSC_FREQ
|
||||
NvU32 PrimarySurfMemType; //!< Primary Surface in ext mem
|
||||
NvU32 MemCheck; //!< GPU memory bufferoverflow checking in GFSDK debug builds, 0=off 1=on (default)
|
||||
NvU32 MemLog; //!< Log GPU memory allocations on STDIO, 0=off (default) 1=on
|
||||
NvU32 UseCameraScript; //!< Camera Script number
|
||||
NvU32 DynamicDSPFreq; //!< 1 to enable dynamic DSP clock frequency, 0 to disable
|
||||
|
||||
NvU32 H264DecUseDSP; //!< GFSDK_H264_DEC_USE_DSP, nonzero to run H264 decode VLD on DSP
|
||||
NvU32 MP4DecUseDSP; //!< GFSDK_MP4_DEC_USE_DSP, nonzero to run MP4 decode VLD on DSP
|
||||
NvU32 VC1DecUseDSP; //!< GFSDK_VC1_DEC_USE_DSP, nonzero to run VC1 decode VLD on DSP
|
||||
NvU32 RV9DecUseDSP; //!< GFSDK_RV9_DEC_USE_DSP, nonzero to run RV9 decode VLD on DSP
|
||||
NvU32 JPGDecUseDSP; //!< GFSDK_JPG_DEC_USE_DSP, nonzero to run JPG decode VLD on DSP
|
||||
NvU32 H264DecCodeMemType; //!< GFSDK_H264DEC_CODE_MEMTYPE, H264 dec DSP code, 1 forces EXTERNAL memory, 2 forces INTERNAL, 0 does not matter
|
||||
NvU32 H264DecDataMemType; //!< GFSDK_H264DEC_CODE_MEMTYPE, H264 dec DSP data, 1 forces EXTERNAL memory, 2 forces INTERNAL, 0 does not matter
|
||||
NvU32 MP4DecCodeMemType; //!< GFSDK_MP4DEC_CODE_MEMTYPE, MP4 dec DSP code, 1 forces EXTERNAL memory, 2 forces INTERNAL, 0 does not matter
|
||||
NvU32 MP4DecDataMemType; //!< GFSDK_MP4DEC_CODE_MEMTYPE, MP4 dec DSP data, 1 forces EXTERNAL memory, 2 forces INTERNAL, 0 does not matter
|
||||
NvU32 VC1DecCodeMemType; //!< GFSDK_H264DEC_CODE_MEMTYPE, VC1 dec DSP code, 1 forces EXTERNAL memory, 2 forces INTERNAL, 0 does not matter
|
||||
NvU32 VC1DecDataMemType; //!< GFSDK_H264DEC_CODE_MEMTYPE, VC1 dec DSP data, 1 forces EXTERNAL memory, 2 forces INTERNAL, 0 does not matter
|
||||
NvU32 H264EncCodeMemType; //!< GFSDK_H264ENC_CODE_MEMTYPE, H264 enc DSP data, 1 forces EXTERNAL memory, 2 forces INTERNAL, 0 does not matter
|
||||
|
||||
NvU32 I2SCodecMasterMode; //!< GFSDK_I2SCODEC_MASTERMODE, I2SCODEC Master Mode, 0-I2S Slave, 1-I2S Master, 2-AC97 standard, 3-AC97 SMCLK, default 0
|
||||
NvU32 I2SCodecFsyncDivider;//!< GFSDK_I2SCODEC_FSYNCDIV, I2SCODEC FSYNC Divider: valid value : 4,8,16,32,64,128, default 128
|
||||
NvU32 I2SCodecFsyncPreDivider;//!< GFSDK_I2SCODEC_FSYNCPREDIV, I2SCODEC FSYNC Predivider: valid value : 1,2,3,5 default 2
|
||||
NvU32 I2SCodecFrquency; //!< GFSDK_I2SCODEC_FREQUENCY, I2SCODEC Frequency, default : 12288
|
||||
NvU32 I2SCodecSCLKDIV; //!< GFSDK_I2SCODEC_SCLK_DIV, I2SCODEC SCLK divider setting, default : 0
|
||||
NvU32 AudioSampleRate; //!< GFSDK_AUDIO_SAMPLERATE, Output Audio Samplerate, default : 48000
|
||||
NvU32 AudioRecordSampleRate; //!< GFSDK_AUDIO_REC_SAMPLERATE, Input Audio Samplerate, default : 0 (use output rate)
|
||||
NvU32 AudioRequireInternalMemory;
|
||||
/**< GFSDK_AUDIO_REQUIRE_INTERNAL_MEMORY, Controls audio memory allocation: <br>
|
||||
<pre>
|
||||
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
|
||||
</pre>
|
||||
*/
|
||||
|
||||
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__ */
|
||||
411
Start_WM/test6/inc/GFRmRDMA.h
Executable file
411
Start_WM/test6/inc/GFRmRDMA.h
Executable file
@@ -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
|
||||
<ul>
|
||||
<li> @ref pageRDMAAppNotes
|
||||
</ul>
|
||||
*/
|
||||
|
||||
/*@{*/
|
||||
|
||||
#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__ */
|
||||
59
Start_WM/test6/inc/GFRmScr.h
Executable file
59
Start_WM/test6/inc/GFRmScr.h
Executable file
@@ -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
|
||||
304
Start_WM/test6/inc/GFTrace.h
Executable file
304
Start_WM/test6/inc/GFTrace.h
Executable file
@@ -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 <stdarg.h>
|
||||
#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 */
|
||||
65
Start_WM/test6/inc/GFTypes.h
Executable file
65
Start_WM/test6/inc/GFTypes.h
Executable file
@@ -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__ */
|
||||
24
Start_WM/test6/inc/GFVersion.h
Executable file
24
Start_WM/test6/inc/GFVersion.h
Executable file
@@ -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__ */
|
||||
|
||||
3028
Start_WM/test6/inc/GFVx.h
Executable file
3028
Start_WM/test6/inc/GFVx.h
Executable file
File diff suppressed because it is too large
Load Diff
42
Start_WM/test6/inc/GFVxError.h
Executable file
42
Start_WM/test6/inc/GFVxError.h
Executable file
@@ -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__
|
||||
|
||||
|
||||
|
||||
311
Start_WM/test6/inc/GFVxScr.h
Executable file
311
Start_WM/test6/inc/GFVxScr.h
Executable file
@@ -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
|
||||
<code>(LSB)b0 b1 b2 b3(MSB)</code> order is swapped to
|
||||
<code>(LSB)b1 b0 b3 b2(MSB)</code>.
|
||||
|
||||
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
|
||||
309
Start_WM/test6/inc/cpuopsys.h
Executable file
309
Start_WM/test6/inc/cpuopsys.h
Executable file
@@ -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_ */
|
||||
22
Start_WM/test6/inc/gfrm_clock_ids.h
Executable file
22
Start_WM/test6/inc/gfrm_clock_ids.h
Executable file
@@ -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")
|
||||
|
||||
56
Start_WM/test6/inc/gfrm_module_ids.h
Executable file
56
Start_WM/test6/inc/gfrm_module_ids.h
Executable file
@@ -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")
|
||||
619
Start_WM/test6/inc/nvboard.h
Executable file
619
Start_WM/test6/inc/nvboard.h
Executable file
@@ -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
|
||||
153
Start_WM/test6/inc/nvcommon.h
Executable file
153
Start_WM/test6/inc/nvcommon.h
Executable file
@@ -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 <stddef.h>
|
||||
#if NVOS_IS_WINDOWS_CE
|
||||
typedef int intptr_t;
|
||||
typedef unsigned int uintptr_t;
|
||||
#elif (NVOS_IS_LINUX && !defined(__KERNEL__)) || defined(__arm)
|
||||
#include <stdint.h>
|
||||
#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 */
|
||||
50
Start_WM/test6/inc/nverror.h
Executable file
50
Start_WM/test6/inc/nverror.h
Executable file
@@ -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 */
|
||||
|
||||
277
Start_WM/test6/inc/nverrval.h
Executable file
277
Start_WM/test6/inc/nverrval.h
Executable file
@@ -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!")
|
||||
|
||||
|
||||
849
Start_WM/test6/inc/nvime.h
Executable file
849
Start_WM/test6/inc/nvime.h
Executable file
@@ -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<op>_GetIntegerv(NVIME_<op>_GET_SRC_SURF_ALIGNMENT_BYTES)
|
||||
// to get this value.
|
||||
//
|
||||
// SB2) Stride must be a multiple of
|
||||
// NvIme<op>_GetIntegerv(NVIME_<op>_GET_SRC_SURF_STRIDE_BYTES)
|
||||
//
|
||||
// SB3) Stride must be a power of two
|
||||
//
|
||||
// SB4) Width must be between
|
||||
// NvIme<op>_GetIntegerv(NVIME_<op>_GET_SRC_SURF_MIN_WIDTH_PIXELS) and
|
||||
// NvIme<op>_GetIntegerv(NVIME_<op>_GET_SRC_SURF_MAX_WIDTH_PIXELS)
|
||||
//
|
||||
// SB5) Height must be between
|
||||
// NvIme<op>_GetIntegerv(NVIME_<op>_GET_SRC_SURF_MIN_HEIGHT_PIXELS) and
|
||||
// NvIme<op>_GetIntegerv(NVIME_<op>_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<op>_GetIntegerv(NVIME_<op>_GET_DST_SURF_ALIGNMENT_BYTES)
|
||||
// to get this value.
|
||||
//
|
||||
// DB2) Stride must be a multiple of
|
||||
// NvIme<op>_GetIntegerv(NVIME_<op>_GET_DST_SURF_STRIDE_BYTES)
|
||||
//
|
||||
// DB3) Width must be between
|
||||
// NvIme<op>_GetIntegerv(NVIME_<op>_GET_DST_SURF_MIN_WIDTH_PIXELS) and
|
||||
// NvIme<op>_GetIntegerv(NVIME_<op>_GET_DST_SURF_MAX_WIDTH_PIXELS)
|
||||
//
|
||||
// DB4) Height must be between
|
||||
// NvIme<op>_GetIntegerv(NVIME_<op>_GET_DST_SURF_MIN_HEIGHT_PIXELS) and
|
||||
// NvIme<op>_GetIntegerv(NVIME_<op>_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<kernelHeight ; ky++ ) {
|
||||
// for ( kx=0 ; kx<kernelWidth ; kx++ ) {
|
||||
//
|
||||
// // even though this appears to be point-sampling,
|
||||
// // the 3D h/w does do a bilinear filter when
|
||||
// // reading srcColor
|
||||
// idx += srcColor[srcX + kx - (int)(kernelWidth/2),
|
||||
// srcY + ky - (int)(kernelHeight/2)] *
|
||||
// kernel[ky*kernelWidth + kx];
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// // scale idx
|
||||
// switch (finalScale) {
|
||||
// case NVIME_SCALE_2_0 : idx *= 2.0; break;
|
||||
// case NVIME_SCALE_4_0 : idx *= 4.0; break;
|
||||
// default : break;
|
||||
// }
|
||||
// idx += finalBias;
|
||||
//
|
||||
// // clamp idx
|
||||
// if (idx < 0.0) idx = 0.0;
|
||||
// if (idx > 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 */
|
||||
144
Start_WM/test6/inc/nvirq.h
Executable file
144
Start_WM/test6/inc/nvirq.h
Executable file
@@ -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
|
||||
258
Start_WM/test6/inc/nvtypes.h
Executable file
258
Start_WM/test6/inc/nvtypes.h
Executable file
@@ -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 *|
|
||||
|* *|
|
||||
|* <nvtypes.h> 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 */
|
||||
BIN
Start_WM/test6/inc/vssver2.scc
Executable file
BIN
Start_WM/test6/inc/vssver2.scc
Executable file
Binary file not shown.
BIN
Start_WM/test6/lib/Release/libgfsdk.lib
Executable file
BIN
Start_WM/test6/lib/Release/libgfsdk.lib
Executable file
Binary file not shown.
8
Start_WM/test6/stdafx.cpp
Executable file
8
Start_WM/test6/stdafx.cpp
Executable file
@@ -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
|
||||
56
Start_WM/test6/stdafx.h
Executable file
56
Start_WM/test6/stdafx.h
Executable file
@@ -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 <ceconfig.h>
|
||||
#if defined(WIN32_PLATFORM_PSPC) || defined(WIN32_PLATFORM_WFSP)
|
||||
#define SHELL_AYGSHELL
|
||||
#endif
|
||||
|
||||
#ifdef _CE_DCOM
|
||||
#define _ATL_APARTMENT_THREADED
|
||||
#endif
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#include <aygshell.h>
|
||||
#pragma comment(lib, "aygshell.lib")
|
||||
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <tchar.h>
|
||||
|
||||
#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 <altcecrt.h>
|
||||
|
||||
// TODO: reference additional headers your program requires here
|
||||
127
Start_WM/test6/test6.cpp
Executable file
127
Start_WM/test6/test6.cpp
Executable file
@@ -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 <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
// 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 <20>ݿ<EFBFBD>
|
||||
#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 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>.\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;
|
||||
}
|
||||
|
||||
453
Start_WM/test6/test6.vcproj
Executable file
453
Start_WM/test6/test6.vcproj
Executable file
@@ -0,0 +1,453 @@
|
||||
<?xml version="1.0" encoding="windows-1251"?>
|
||||
<VisualStudioProject
|
||||
ProjectType="Visual C++"
|
||||
Version="9,00"
|
||||
Name="test6"
|
||||
ProjectGUID="{C7D031E8-B513-4310-A29D-E50069448615}"
|
||||
RootNamespace="test6"
|
||||
Keyword="Win32Proj"
|
||||
TargetFrameworkVersion="196613"
|
||||
>
|
||||
<Platforms>
|
||||
<Platform
|
||||
Name="Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
|
||||
/>
|
||||
<Platform
|
||||
Name="Pocket PC 2003 (ARMV4)"
|
||||
/>
|
||||
</Platforms>
|
||||
<ToolFiles>
|
||||
</ToolFiles>
|
||||
<Configurations>
|
||||
<Configuration
|
||||
Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
|
||||
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
ExecutionBucket="7"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="".\test6\inc""
|
||||
PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES);WINCE;DEBUG;_CONSOLE;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
|
||||
MinimalRebuild="true"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="2"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES)"
|
||||
Culture="1033"
|
||||
AdditionalIncludeDirectories="$(IntDir)"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalOptions=" /subsystem:windowsce,5.01"
|
||||
AdditionalDependencies="libgfsdk.lib"
|
||||
OutputFile="$(OutDir)/test6.exe"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories="".\test6\lib\Release""
|
||||
DelayLoadDLLs="$(NOINHERIT)"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(OutDir)/test6.pdb"
|
||||
SubSystem="0"
|
||||
StackReserveSize="65536"
|
||||
StackCommitSize="4096"
|
||||
EntryPointSymbol="mainWCRTStartup"
|
||||
RandomizedBaseAddress="1"
|
||||
DataExecutionPrevention="0"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCodeSignTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
<DeploymentTool
|
||||
ForceDirty="-1"
|
||||
RemoteDirectory=""
|
||||
RegisterOutput="0"
|
||||
AdditionalFiles=""
|
||||
/>
|
||||
<DebuggerTool
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
|
||||
OutputDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
ExecutionBucket="7"
|
||||
Optimization="2"
|
||||
FavorSizeOrSpeed="2"
|
||||
PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES);WINCE;_CONSOLE;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
|
||||
RuntimeLibrary="0"
|
||||
UsePrecompiledHeader="2"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES)"
|
||||
Culture="1033"
|
||||
AdditionalIncludeDirectories="$(IntDir)"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalOptions=" /subsystem:windowsce,5.01"
|
||||
OutputFile="$(OutDir)/test6.exe"
|
||||
LinkIncremental="1"
|
||||
DelayLoadDLLs="$(NOINHERIT)"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(OutDir)/test6.pdb"
|
||||
SubSystem="0"
|
||||
StackReserveSize="65536"
|
||||
StackCommitSize="4096"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
EntryPointSymbol="mainWCRTStartup"
|
||||
RandomizedBaseAddress="1"
|
||||
DataExecutionPrevention="0"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCodeSignTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
<DeploymentTool
|
||||
ForceDirty="-1"
|
||||
RemoteDirectory=""
|
||||
RegisterOutput="0"
|
||||
AdditionalFiles=""
|
||||
/>
|
||||
<DebuggerTool
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Debug|Pocket PC 2003 (ARMV4)"
|
||||
OutputDirectory="Pocket PC 2003 (ARMV4)\$(ConfigurationName)"
|
||||
IntermediateDirectory="Pocket PC 2003 (ARMV4)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TargetEnvironment="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
ExecutionBucket="7"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="".\test6\inc""
|
||||
PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES);WINCE;DEBUG;_CONSOLE;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
|
||||
MinimalRebuild="true"
|
||||
RuntimeLibrary="1"
|
||||
UsePrecompiledHeader="2"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="_DEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES)"
|
||||
Culture="1033"
|
||||
AdditionalIncludeDirectories="$(IntDir)"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalOptions=" /subsystem:windowsce,5.01"
|
||||
AdditionalDependencies="libgfsdk.lib"
|
||||
OutputFile="$(OutDir)/test6.exe"
|
||||
LinkIncremental="2"
|
||||
AdditionalLibraryDirectories="".\test6\lib\Release""
|
||||
DelayLoadDLLs="$(NOINHERIT)"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(OutDir)/test6.pdb"
|
||||
SubSystem="0"
|
||||
StackReserveSize="65536"
|
||||
StackCommitSize="4096"
|
||||
EntryPointSymbol="mainWCRTStartup"
|
||||
RandomizedBaseAddress="1"
|
||||
DataExecutionPrevention="0"
|
||||
TargetMachine="0"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCodeSignTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
<DeploymentTool
|
||||
ForceDirty="-1"
|
||||
RemoteDirectory=""
|
||||
RegisterOutput="0"
|
||||
AdditionalFiles=""
|
||||
/>
|
||||
<DebuggerTool
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release|Pocket PC 2003 (ARMV4)"
|
||||
OutputDirectory="Pocket PC 2003 (ARMV4)\$(ConfigurationName)"
|
||||
IntermediateDirectory="Pocket PC 2003 (ARMV4)\$(ConfigurationName)"
|
||||
ConfigurationType="1"
|
||||
CharacterSet="1"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
TargetEnvironment="1"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
ExecutionBucket="7"
|
||||
Optimization="2"
|
||||
FavorSizeOrSpeed="2"
|
||||
PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES);WINCE;_CONSOLE;$(ARCHFAM);$(_ARCHFAM_);_UNICODE;UNICODE"
|
||||
RuntimeLibrary="0"
|
||||
UsePrecompiledHeader="2"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="3"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
PreprocessorDefinitions="NDEBUG;_WIN32_WCE=$(CEVER);UNDER_CE;$(PLATFORMDEFINES)"
|
||||
Culture="1033"
|
||||
AdditionalIncludeDirectories="$(IntDir)"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalOptions=" /subsystem:windowsce,5.01"
|
||||
OutputFile="$(OutDir)/test6.exe"
|
||||
LinkIncremental="1"
|
||||
DelayLoadDLLs="$(NOINHERIT)"
|
||||
GenerateDebugInformation="true"
|
||||
ProgramDatabaseFile="$(OutDir)/test6.pdb"
|
||||
SubSystem="0"
|
||||
StackReserveSize="65536"
|
||||
StackCommitSize="4096"
|
||||
OptimizeReferences="2"
|
||||
EnableCOMDATFolding="2"
|
||||
EntryPointSymbol="mainWCRTStartup"
|
||||
RandomizedBaseAddress="1"
|
||||
DataExecutionPrevention="0"
|
||||
TargetMachine="0"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCodeSignTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
<DeploymentTool
|
||||
ForceDirty="-1"
|
||||
RemoteDirectory=""
|
||||
RegisterOutput="0"
|
||||
AdditionalFiles=""
|
||||
/>
|
||||
<DebuggerTool
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
<Files>
|
||||
<Filter
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
|
||||
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\stdafx.cpp"
|
||||
>
|
||||
<FileConfiguration
|
||||
Name="Debug|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Windows Mobile 5.0 Pocket PC SDK (ARMV4I)"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Debug|Pocket PC 2003 (ARMV4)"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
<FileConfiguration
|
||||
Name="Release|Pocket PC 2003 (ARMV4)"
|
||||
>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
UsePrecompiledHeader="1"
|
||||
/>
|
||||
</FileConfiguration>
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\test6.cpp"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Header Files"
|
||||
Filter="h;hpp;hxx;hm;inl;inc;xsd"
|
||||
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
|
||||
>
|
||||
<File
|
||||
RelativePath=".\stdafx.h"
|
||||
>
|
||||
</File>
|
||||
</Filter>
|
||||
<Filter
|
||||
Name="Resource Files"
|
||||
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
|
||||
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
|
||||
>
|
||||
</Filter>
|
||||
</Files>
|
||||
<Globals>
|
||||
</Globals>
|
||||
</VisualStudioProject>
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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/
|
||||
|
||||
356
kernel-2.6.33/arch/arm/mach-pxa/g900/docg3.c
Executable file
356
kernel-2.6.33/arch/arm/mach-pxa/g900/docg3.c
Executable file
@@ -0,0 +1,356 @@
|
||||
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/rslib.h>
|
||||
#include <linux/moduleparam.h>
|
||||
#include <asm/io.h>
|
||||
#include <asm/semaphore.h>
|
||||
#include <linux/fs.h>
|
||||
#include <linux/cdev.h>
|
||||
#include <asm/uaccess.h>
|
||||
|
||||
|
||||
#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 <tgnard@free.fr>");
|
||||
MODULE_DESCRIPTION("Test modules for Diskonchip G3 device description\n");
|
||||
@@ -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,
|
||||
};
|
||||
|
||||
|
||||
159
kernel-2.6.33/arch/arm/mach-pxa/g900/g900_core.c
Executable file
159
kernel-2.6.33/arch/arm/mach-pxa/g900/g900_core.c
Executable file
@@ -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 <linux/module.h>
|
||||
#include <linux/version.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/pm.h>
|
||||
#include <linux/irq.h>
|
||||
|
||||
#include <asm/io.h>
|
||||
#include <mach/irqs.h>
|
||||
#include <mach/mfp-pxa27x.h>
|
||||
#include <mach/pxa2xx-regs.h>
|
||||
#include <mach/pm.h>
|
||||
#include <mach/g900-gpio.h>
|
||||
|
||||
|
||||
|
||||
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");
|
||||
|
||||
363
kernel-2.6.33/arch/arm/mach-pxa/g900/g900_flash.c
Executable file
363
kernel-2.6.33/arch/arm/mach-pxa/g900/g900_flash.c
Executable file
@@ -0,0 +1,363 @@
|
||||
|
||||
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/rslib.h>
|
||||
#include <linux/moduleparam.h>
|
||||
#include <asm/io.h>
|
||||
//#include <asm/semaphore.h>
|
||||
#include <linux/fs.h>
|
||||
#include <linux/cdev.h>
|
||||
#include <asm/uaccess.h>
|
||||
|
||||
|
||||
#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 <tgnard@free.fr>");
|
||||
MODULE_DESCRIPTION("Test modules for Diskonchip G3 device description\n");
|
||||
77
kernel-2.6.33/arch/arm/mach-pxa/g900/g900_pm.c
Executable file
77
kernel-2.6.33/arch/arm/mach-pxa/g900/g900_pm.c
Executable file
@@ -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 <linux/kernel.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/pm.h>
|
||||
|
||||
#include <asm/mach-types.h>
|
||||
#include <mach/hardware.h>
|
||||
#include <mach/mfp-pxa27x.h>
|
||||
#include <mach/pxa2xx-regs.h>
|
||||
#include <mach/pm.h>
|
||||
|
||||
#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 */
|
||||
260
kernel-2.6.33/arch/arm/mach-pxa/g900/g900_udc.c
Executable file
260
kernel-2.6.33/arch/arm/mach-pxa/g900/g900_udc.c
Executable file
@@ -0,0 +1,260 @@
|
||||
#include <linux/module.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/device.h>
|
||||
#include <linux/platform_device.h>
|
||||
|
||||
|
||||
#include <mach/gpio.h>
|
||||
#include <asm/mach-types.h>
|
||||
#include <mach/hardware.h>
|
||||
#include <mach/mfp-pxa27x.h>
|
||||
#include <mach/pxa2xx-regs.h>
|
||||
#include <mach/udc.h>
|
||||
#include <mach/g900-gpio.h>
|
||||
|
||||
#include <linux/usb/gpio_vbus.h>
|
||||
|
||||
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 <linux/usb/android_composite.h>
|
||||
|
||||
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 <reed.huang@gmail.com");
|
||||
MODULE_DESCRIPTION("Asus g900 UDC support");
|
||||
MODULE_LICENSE("GPL");
|
||||
43
kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GF.h
Executable file
43
kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GF.h
Executable file
@@ -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__ */
|
||||
|
||||
39
kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GF3D.h
Executable file
39
kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GF3D.h
Executable file
@@ -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__ */
|
||||
168
kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFAudio.h
Executable file
168
kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFAudio.h
Executable file
@@ -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
|
||||
|
||||
189
kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFBDev.h
Executable file
189
kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFBDev.h
Executable file
@@ -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 */
|
||||
|
||||
45
kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFBitmap.h
Executable file
45
kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFBitmap.h
Executable file
@@ -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__ */
|
||||
367
kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFCamera.h
Executable file
367
kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFCamera.h
Executable file
@@ -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
|
||||
<ul>
|
||||
<li> @ref pageCameraAppNotes
|
||||
<ul>
|
||||
<li> @ref pageCameraAppNotes1
|
||||
</ul>
|
||||
</ul>
|
||||
*/
|
||||
/*@{*/
|
||||
|
||||
|
||||
/* 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__ */
|
||||
|
||||
40
kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFCameraScr.h
Executable file
40
kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFCameraScr.h
Executable file
@@ -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
|
||||
|
||||
254
kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFDef.h
Executable file
254
kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFDef.h
Executable file
@@ -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(x))
|
||||
#define GF_SHIFTMASK(x) (GF_MASK(x)<< (GF_SHIFT(x)))
|
||||
|
||||
#define GF_DRF_DEF(d,r,f,c) ((d##_##r##_0_##f##_##c) << GF_SHIFT(d##_##r##_0_##f##_RANGE))
|
||||
#define GF_DRF_NUM(d,r,f,n) (((n)& GF_MASK(d##_##r##_0_##f##_RANGE))<< GF_SHIFT(d##_##r##_0_##f##_RANGE))
|
||||
#define GF_DRF_VAL(d,r,f,v) (((v)>> 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)<<GF_COMPONENT_ERROR_SHIFT)
|
||||
#define VX_ERROR (GF_COMPONENT_REVERSE(GF_VXAPI)<<GF_COMPONENT_ERROR_SHIFT)
|
||||
#define JXD_ERROR (GF_COMPONENT_REVERSE(GF_JXDAPI)<<GF_COMPONENT_ERROR_SHIFT)
|
||||
#define MXE_ERROR (GF_COMPONENT_REVERSE(GF_MXEAPI)<<GF_COMPONENT_ERROR_SHIFT)
|
||||
#define MXD_ERROR (GF_COMPONENT_REVERSE(GF_MXDAPI)<<GF_COMPONENT_ERROR_SHIFT)
|
||||
#define DX_ERROR (GF_COMPONENT_REVERSE(GF_DXAPI)<<GF_COMPONENT_ERROR_SHIFT)
|
||||
#define ISP_ERROR (GF_COMPONENT_REVERSE(GF_ISPAPI)<<GF_COMPONENT_ERROR_SHIFT)
|
||||
#define BDEVSD_ERROR (GF_COMPONENT_REVERSE(GF_BDEVSDAPI)<<GF_COMPONENT_ERROR_SHIFT)
|
||||
#define I2C_ERROR (GF_COMPONENT_REVERSE(GF_I2CAPI)<<GF_COMPONENT_ERROR_SHIFT)
|
||||
#define MMPROC_ERROR (GF_COMPONENT_REVERSE(GF_MMPROCAPI)<<GF_COMPONENT_ERROR_SHIFT)
|
||||
#define CAM_ERROR (GF_COMPONENT_REVERSE(GF_CAMAPI)<<GF_COMPONENT_ERROR_SHIFT)
|
||||
#define MINISP_ERROR (GF_COMPONENT_REVERSE(GF_MINIMALISPAPI)<<GF_COMPONENT_ERROR_SHIFT)
|
||||
#define MXDH264_ERROR (GF_COMPONENT_REVERSE(GF_MXDH264API)<<GF_COMPONENT_ERROR_SHIFT)
|
||||
#define MXEH264_ERROR (GF_COMPONENT_REVERSE(GF_MXEH264API)<<GF_COMPONENT_ERROR_SHIFT)
|
||||
#define MXDHVC1_ERROR (GF_COMPONENT_REVERSE(GF_MXDVC1API)<<GF_COMPONENT_ERROR_SHIFT)
|
||||
#define MXDEMTS_ERROR (GF_COMPONENT_REVERSE(GF_MXDEMTSAPI)<<GF_COMPONENT_ERROR_SHIFT)
|
||||
#define RM_ERROR (GF_COMPONENT_REVERSE(GF_RMAPI)<<GF_COMPONENT_ERROR_SHIFT)
|
||||
|
||||
#define GFGX_ERROR (GF_ERROR | GX_ERROR)
|
||||
#define GFVX_ERROR (GF_ERROR | VX_ERROR)
|
||||
#define GFJXD_ERROR (GF_ERROR | JXD_ERROR)
|
||||
#define GFMXE_ERROR (GF_ERROR | MXE_ERROR)
|
||||
#define GFMXD_ERROR (GF_ERROR | MXD_ERROR)
|
||||
#define GFDX_ERROR (GF_ERROR | DX_ERROR)
|
||||
#define GFISP_ERROR (GF_ERROR | ISP_ERROR)
|
||||
#define GFBDEVSD_ERROR (GF_ERROR | BDEVSD_ERROR)
|
||||
#define GFI2C_ERROR (GF_ERROR | I2C_ERROR)
|
||||
#define GFMMPROC_ERROR (GF_ERROR | MMPROC_ERROR)
|
||||
#define GFCAM_ERROR (GF_ERROR | CAM_ERROR)
|
||||
#define GFMXDH264_ERROR (GF_ERROR | MXDH264_ERROR)
|
||||
#define GFMXEH264_ERROR (GF_ERROR | MXEH264_ERROR)
|
||||
#define GFMXDVC1_ERROR (GF_ERROR | MXDHVC1_ERROR)
|
||||
#define GFMXDEMTS_ERROR (GF_ERROR | MXDEMTS_ERROR)
|
||||
#define GFRM_ERROR (GF_ERROR | RM_ERROR)
|
||||
|
||||
|
||||
/* Function and Handle */
|
||||
/** GFSDK error code.
|
||||
GFSDK error codes are signed 32 bit values formed by combining the following 3 bitfields:
|
||||
- bit 31 (sign) : set (0x80000000) indicating error
|
||||
- bit 30-24 : 7 bit GFSDK component ID, in reversed bit order
|
||||
- bit 23-0 : component local error codes
|
||||
GFSDK component IDs are numbered contineously starting at 0.
|
||||
Component local error codes are also numbered contineously starting at 0.
|
||||
Using the 7 bit component ID in reverse bit order will asure set bits in
|
||||
positions 31-24 in the combined error code to be top-aligned. Set bits in
|
||||
the local error code positions 23-0 will be bottom-aligned. With this scheme
|
||||
combined error codes are likely to fit into ARM immediate constants,
|
||||
saving code size and execution time when error constants are accessed.
|
||||
*/
|
||||
typedef NvS32 GF_RETTYPE;
|
||||
|
||||
/** GFSDK handles to opaque structures. */
|
||||
typedef void *GF_HANDLE;
|
||||
typedef struct GFMinimalIspStruct_t *GFMinimalIspHandle;
|
||||
typedef struct GF3DStruct_t *GF3DHandle;
|
||||
typedef struct GFBDevStruct_t *GFBDevHandle;
|
||||
typedef struct GFCameraStruct_t *GFCameraHandle;
|
||||
typedef struct GFDiagStruct_t *GFDiagHandle;
|
||||
typedef struct GFDxStruct_t *GFDxHandle;
|
||||
typedef struct GFEPPStruct_t *GFEPPHandle;
|
||||
typedef struct GFFDevStruct_t *GFFDevHandle;
|
||||
typedef struct GFFDevDirStruct_t *GFFDevDirHandle;
|
||||
typedef struct GFFDevFileStruct_t *GFFDevFileHandle;
|
||||
typedef struct GFGxStruct_t *GFGxHandle;
|
||||
typedef struct GFI2CStruct_t *GFI2CHandle;
|
||||
typedef struct GFI2SStruct_t *GFI2SHandle;
|
||||
typedef struct GFINTxStruct_t *GFINTxHandle;
|
||||
typedef struct GFIspStruct_t *GFIspHandle;
|
||||
typedef struct GFJxDecStruct_t *GFJxDecHandle;
|
||||
typedef struct GFJxEncStruct_t *GFJxEncHandle;
|
||||
typedef struct GFMmProcStruct_t *GFMmProcHandle;
|
||||
typedef struct GFMxDecStruct_t *GFMxDecHandle;
|
||||
typedef struct GFMxDecH264Struct_t *GFMxDecH264Handle;
|
||||
typedef struct GFMxDecRV9Struct_t *GFMxDecRV9Handle;
|
||||
typedef struct GFMxDecVC1Struct_t *GFMxDecVC1Handle;
|
||||
typedef struct GFMxDemTSStruct_t *GFMxDemTSHandle;
|
||||
typedef struct GFMxDemTSParserStruct_t *GFMxDemTSParserHandle;
|
||||
typedef struct GFMxEncStruct_t *GFMxEncHandle;
|
||||
typedef struct GFMxEncH264Struct_t *GFMxEncH264Handle;
|
||||
typedef struct GFOSxStruct_t *GFOSxHandle;
|
||||
typedef struct GFRmStruct_t *GFRmHandle;
|
||||
typedef struct GFRmChStruct_t *GFRmChHandle;
|
||||
typedef struct _GF_RM_DSP_TASK *GFRmDspTaskHandle;
|
||||
typedef struct GFRmMemStruct_t *GFRmMemHandle;
|
||||
typedef struct GFRmVmStruct_t *GFRmVmHandle;
|
||||
typedef struct GFRmRdmaStruct_t *GFRmRdmaHandle;
|
||||
typedef struct GFVxStruct_t *GFVxHandle;
|
||||
|
||||
|
||||
#ifdef GF_XTENSA_RM_TASK
|
||||
#define ATTRIBUTE(a) __attribute__(a)
|
||||
#else
|
||||
#define ATTRIBUTE(a)
|
||||
#endif
|
||||
|
||||
|
||||
/** GFSDK Component Property Structure. */
|
||||
typedef struct _GFPROPERTY
|
||||
{
|
||||
NvU32 Capability; //!< Individual component's capability
|
||||
NvU32 CapabilityEx; //!< Individual component's extended capability
|
||||
} GFPROPERTY, *PGFPROPERTY;
|
||||
|
||||
/** Rectangle Structure. */
|
||||
typedef struct _GFRECT
|
||||
{
|
||||
NvU16 top; //!< Top edge, inclusive
|
||||
NvU16 left; //!< Left edge, inclusive
|
||||
NvU16 right; //!< Right edge, inclusive
|
||||
NvU16 bottom; //!< Bottom edge, inclusive
|
||||
} GFRECT, *PGFRECT;
|
||||
|
||||
/** Component level interrupt status. */
|
||||
typedef enum
|
||||
{
|
||||
GF_INTERRUPT_OFF_STATUS_FALSE, /**< Component level interrupt is disabled,
|
||||
the interrupt status is false.
|
||||
*/
|
||||
GF_INTERRUPT_ON_STATUS_FALSE, /**< Component level interrupt is enabled,
|
||||
the interrupt status is false.
|
||||
*/
|
||||
GF_INTERRUPT_OFF_STATUS_TRUE, /**< Component level interrupt is disabled,
|
||||
the interrupt status is true.
|
||||
*/
|
||||
GF_INTERRUPT_ON_STATUS_TRUE /**< Component level interrupt is enabled,
|
||||
the interrupt status is true.
|
||||
*/
|
||||
} GF_INTERRUPT_STATUS_TYPE;
|
||||
|
||||
/** GPIO status descriptor.
|
||||
|
||||
This structure is to return GPIO pin status after a call to GFDxFPGPIO(),
|
||||
GFVxVIPGPIO(), or GFIxSDGPIO(). These operations are for common GPIO
|
||||
manipulations of the input enable, output enable, output select and data bits
|
||||
in the various WMP modules. The bits can be set to 1 or cleared to 0, and their
|
||||
status can be obtained.
|
||||
|
||||
@see GFDxFPGPIO(), GFVxVIPGPIO(), GFIxSDGPIO()
|
||||
*/
|
||||
|
||||
/* GFGPIOSTATUS - GPIO Status */
|
||||
typedef struct _GFGPIOSTATUS
|
||||
{
|
||||
NvU32 in_data; /**< Input data bit */
|
||||
NvU32 in_enable; /**< Input enable bit */
|
||||
NvU32 out_enable; /**< Output enable bit */
|
||||
NvU32 out_data; /**< Output data bit */
|
||||
NvU32 out_select; /**< Output select bit */
|
||||
} GFGPIOSTATUS, *PGFGPIOSTATUS;
|
||||
|
||||
/* GFBLOCKLIST - Block list */
|
||||
typedef struct _GFBLOCKLIST
|
||||
{
|
||||
NvU32 blockIndex; // Index of block
|
||||
NvU32 blockCount; // Number of blocks to this index, value of 0
|
||||
// marks last block
|
||||
} GFBLOCKLIST, *PGFBLOCKLIST;
|
||||
|
||||
/** States for Component Manager and general services.
|
||||
@see GFRmComponentGet(), GFRmComponentRelease().
|
||||
*/
|
||||
typedef NvU32 GF_STATE_TYPE;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#endif /* __GFDEF_H__ */
|
||||
|
||||
81
kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFDefScr.h
Executable file
81
kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFDefScr.h
Executable file
@@ -0,0 +1,81 @@
|
||||
/* 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 (__GFDEFSCR_INC__)
|
||||
#define __GFDEFSCR_INC__
|
||||
|
||||
/* GPIO Operations (Set, Clear, Get) */
|
||||
|
||||
/** GPIO Operation: Input enable set to 1.
|
||||
@see GFGPIOSTATUS, GFDxFPGPIO(), GFVxVIPGPIO(), GFIxSDGPIO()
|
||||
*/
|
||||
#define GF_GPIO_SET_INPUT_ENABLE 0x00000001
|
||||
|
||||
/** GPIO Operation: Input enable clr to 0.
|
||||
@see GFGPIOSTATUS, GFDxFPGPIO(), GFVxVIPGPIO(), GFIxSDGPIO()
|
||||
*/
|
||||
#define GF_GPIO_CLR_INPUT_ENABLE 0x00000002
|
||||
|
||||
/** GPIO Operation: Get input enable.
|
||||
@see GFGPIOSTATUS, GFDxFPGPIO(), GFVxVIPGPIO(), GFIxSDGPIO()
|
||||
*/
|
||||
#define GF_GPIO_GET_INPUT_ENABLE 0x00000004
|
||||
|
||||
/** GPIO Operation: Output enable set to 1.
|
||||
@see GFGPIOSTATUS, GFDxFPGPIO(), GFVxVIPGPIO(), GFIxSDGPIO()
|
||||
*/
|
||||
#define GF_GPIO_SET_OUTPUT_ENABLE 0x00000010
|
||||
|
||||
/** GPIO Operation: Output enable clr to 0.
|
||||
@see GFGPIOSTATUS, GFDxFPGPIO(), GFVxVIPGPIO(), GFIxSDGPIO()
|
||||
*/
|
||||
#define GF_GPIO_CLR_OUTPUT_ENABLE 0x00000020
|
||||
|
||||
/** GPIO Operation: Get output enable.
|
||||
@see GFGPIOSTATUS, GFDxFPGPIO(), GFVxVIPGPIO(), GFIxSDGPIO()
|
||||
*/
|
||||
#define GF_GPIO_GET_OUTPUT_ENABLE 0x00000040
|
||||
|
||||
/** GPIO Operation: Output data set to 1.
|
||||
@see GFGPIOSTATUS, GFDxFPGPIO(), GFVxVIPGPIO(), GFIxSDGPIO()
|
||||
*/
|
||||
#define GF_GPIO_SET_DATA 0x00000100
|
||||
|
||||
/** GPIO Operation: Output data clr to 0.
|
||||
@see GFGPIOSTATUS, GFDxFPGPIO(), GFVxVIPGPIO(), GFIxSDGPIO()
|
||||
*/
|
||||
#define GF_GPIO_CLR_DATA 0x00000200
|
||||
|
||||
/** GPIO Operation: Get input data.
|
||||
@see GFGPIOSTATUS, GFDxFPGPIO(), GFVxVIPGPIO(), GFIxSDGPIO()
|
||||
*/
|
||||
#define GF_GPIO_GET_DATA 0x00000400
|
||||
|
||||
/** GPIO Operation: Get output data.
|
||||
@see GFGPIOSTATUS, GFDxFPGPIO(), GFVxVIPGPIO(), GFIxSDGPIO()
|
||||
*/
|
||||
#define GF_GPIO_GET_OUTPUT_DATA 0x00001000
|
||||
|
||||
/** GPIO Operation: Output select set to 1.
|
||||
@see GFGPIOSTATUS, GFDxFPGPIO(), GFVxVIPGPIO(), GFIxSDGPIO()
|
||||
*/
|
||||
#define GF_GPIO_SET_OUTPUT_SELECT 0x00100000
|
||||
|
||||
/** GPIO Operation: Output select clr to 0.
|
||||
@see GFGPIOSTATUS, GFDxFPGPIO(), GFVxVIPGPIO(), GFIxSDGPIO()
|
||||
*/
|
||||
#define GF_GPIO_CLR_OUTPUT_SELECT 0x00200000
|
||||
|
||||
/** GPIO Operation: Output select get.
|
||||
@see GFGPIOSTATUS, GFDxFPGPIO(), GFVxVIPGPIO(), GFIxSDGPIO()
|
||||
*/
|
||||
#define GF_GPIO_GET_OUTPUT_SELECT 0x00400000
|
||||
|
||||
#endif
|
||||
|
||||
442
kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFDiag.h
Executable file
442
kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFDiag.h
Executable file
@@ -0,0 +1,442 @@
|
||||
/* 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 GFDiag.h
|
||||
* @brief GFSDK module for diagnostics
|
||||
* GFDiag is a testing framework which includes functionality
|
||||
* for running sets of different tests and is mostly for internal
|
||||
* use.
|
||||
*
|
||||
* Apps should use the GF_DIAG_* macros to communicate with GFDiag
|
||||
* All GFDiag API calls take the DiagHandle as the first arg. Useful for
|
||||
* error messages, and MODS needs some way to identify what test is talking
|
||||
* to it.
|
||||
*/
|
||||
|
||||
#ifndef __GFDIAG_H__
|
||||
#define __GFDIAG_H__
|
||||
|
||||
#include "GFRm.h"
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
/** 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__ */
|
||||
1740
kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFDispCmdData.h
Executable file
1740
kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFDispCmdData.h
Executable file
File diff suppressed because it is too large
Load Diff
1847
kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFDx.h
Executable file
1847
kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFDx.h
Executable file
File diff suppressed because it is too large
Load Diff
89
kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFEPP.h
Executable file
89
kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFEPP.h
Executable file
@@ -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_
|
||||
321
kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFFDev.h
Executable file
321
kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFFDev.h
Executable file
@@ -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
|
||||
<ul>
|
||||
<li> @ref pageFDevAppNotes
|
||||
<ul>
|
||||
<li> @ref pageFDevAppNotes1
|
||||
</ul>
|
||||
</ul>
|
||||
*/
|
||||
/*@{*/
|
||||
|
||||
/** 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__ */
|
||||
|
||||
1927
kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFGx.h
Executable file
1927
kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFGx.h
Executable file
File diff suppressed because it is too large
Load Diff
46
kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFGxError.h
Executable file
46
kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFGxError.h
Executable file
@@ -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__
|
||||
|
||||
|
||||
|
||||
314
kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFI2C.h
Executable file
314
kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFI2C.h
Executable file
@@ -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:
|
||||
<pre>
|
||||
attr = (SP_SCL_PULLUP_DISABLE | SP_SDA_PULLUP_DISABLE)
|
||||
GFI2CSetAttribute(I2CHandle, GFI2C_ATTR_PULLUP, attr)
|
||||
</pre>
|
||||
|
||||
@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__ */
|
||||
|
||||
49
kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFI2S.h
Executable file
49
kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFI2S.h
Executable file
@@ -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__ */
|
||||
114
kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFINTx.h
Executable file
114
kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFINTx.h
Executable file
@@ -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. */
|
||||
|
||||
1654
kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFIsp.h
Executable file
1654
kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFIsp.h
Executable file
File diff suppressed because it is too large
Load Diff
37
kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFIspError.h
Executable file
37
kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFIspError.h
Executable file
@@ -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__
|
||||
|
||||
|
||||
|
||||
508
kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFJxDec.h
Executable file
508
kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFJxDec.h
Executable file
@@ -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
|
||||
*/
|
||||
/* <ul>
|
||||
<li> @ref pageGxAppNotes
|
||||
<ul>
|
||||
<li> @ref pageGxAppNotes1
|
||||
</ul>
|
||||
</ul>
|
||||
*/
|
||||
|
||||
/*@{*/
|
||||
|
||||
// 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
|
||||
<table>
|
||||
<tr><td>#JX_DEC_IF_LAST_PORTION_IMAGE</td>
|
||||
<td>This is the last portion of decoded image</td></tr>
|
||||
</table>
|
||||
@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
|
||||
|
||||
<table>
|
||||
<tr><th>\a uiFeature</th>
|
||||
<th>\a pInfo interpretation</th>
|
||||
<th>Meaning</th></tr>
|
||||
<tr><td>JX_DEC_SET_READBITSTREAM</td>
|
||||
<td>GFJXDECCALLBACK*</td>
|
||||
<td>Set up Jpeg bitstream feed callback</td></tr>
|
||||
</table>
|
||||
|
||||
@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
|
||||
|
||||
<table>
|
||||
<tr><td>#JX_DEC_GETIMAGE </td>
|
||||
<td>Get the YUV decoded JPEG image into a file, Sets the decoder image callback</td></tr>
|
||||
<tr><td>#JX_DEC_GETIMAGE_COLORFORMAT </td>
|
||||
<td>Set get decoded image color format.</td></tr>
|
||||
</table>
|
||||
|
||||
@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
|
||||
<table>
|
||||
<tr><td>#JX_DEC_GETIMAGE </td>
|
||||
<td>Get the YUV decoded JPEG image into a file, Sets the decoder image callback</td></tr>
|
||||
<tr><td>#JX_DEC_GETIMAGE_COLORFORMAT </td>
|
||||
<td>Set get decoded image color format.</td></tr>
|
||||
</table>
|
||||
*/
|
||||
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
|
||||
|
||||
1306
kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFJxEnc.h
Executable file
1306
kernel-2.6.33/arch/arm/mach-pxa/g900/gf5500/inc/GFJxEnc.h
Executable file
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user