123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131 |
- /****************************************************************************
- *
- * Copyright (c) 2005 - 2014 by Vivante Corp. All rights reserved.
- *
- * The material in this file is confidential and contains trade secrets
- * of Vivante Corporation. This is proprietary information owned by
- * Vivante Corporation. No part of this work may be disclosed,
- * reproduced, copied, transmitted, or used in any way for any purpose,
- * without the express written permission of Vivante Corporation.
- *
- *****************************************************************************/
- #ifndef __gc_hal_driver_h_
- #define __gc_hal_driver_h_
- #include "gc_hal_enum.h"
- #include "gc_hal_types.h"
- #if gcdENABLE_VG
- #include "gc_hal_driver_vg.h"
- #endif
- #ifdef __cplusplus
- extern "C" {
- #endif
- /******************************************************************************\
- ******************************* I/O Control Codes ******************************
- \******************************************************************************/
- #define gcvHAL_CLASS "galcore"
- #define IOCTL_GCHAL_INTERFACE 30000
- #define IOCTL_GCHAL_KERNEL_INTERFACE 30001
- #define IOCTL_GCHAL_TERMINATE 30002
- /******************************************************************************\
- ********************************* Command Codes ********************************
- \******************************************************************************/
- typedef enum _gceHAL_COMMAND_CODES
- {
- /* Generic query. */
- gcvHAL_QUERY_VIDEO_MEMORY,
- gcvHAL_QUERY_CHIP_IDENTITY,
- /* Contiguous memory. */
- gcvHAL_ALLOCATE_NON_PAGED_MEMORY,
- gcvHAL_FREE_NON_PAGED_MEMORY,
- gcvHAL_ALLOCATE_CONTIGUOUS_MEMORY,
- gcvHAL_FREE_CONTIGUOUS_MEMORY,
- /* Video memory allocation. */
- gcvHAL_ALLOCATE_VIDEO_MEMORY, /* Enforced alignment. */
- gcvHAL_ALLOCATE_LINEAR_VIDEO_MEMORY, /* No alignment. */
- gcvHAL_RELEASE_VIDEO_MEMORY,
- /* Physical-to-logical mapping. */
- gcvHAL_MAP_MEMORY,
- gcvHAL_UNMAP_MEMORY,
- /* Logical-to-physical mapping. */
- gcvHAL_MAP_USER_MEMORY,
- gcvHAL_UNMAP_USER_MEMORY,
- /* Surface lock/unlock. */
- gcvHAL_LOCK_VIDEO_MEMORY,
- gcvHAL_UNLOCK_VIDEO_MEMORY,
- /* Event queue. */
- gcvHAL_EVENT_COMMIT,
- gcvHAL_USER_SIGNAL,
- gcvHAL_SIGNAL,
- gcvHAL_WRITE_DATA,
- gcvHAL_COMMIT,
- gcvHAL_STALL,
- gcvHAL_READ_REGISTER,
- gcvHAL_WRITE_REGISTER,
- gcvHAL_GET_PROFILE_SETTING,
- gcvHAL_SET_PROFILE_SETTING,
- gcvHAL_READ_ALL_PROFILE_REGISTERS,
- gcvHAL_PROFILE_REGISTERS_2D,
- #if VIVANTE_PROFILER_PERDRAW
- gcvHAL_READ_PROFILER_REGISTER_SETTING,
- #endif
- /* Power management. */
- gcvHAL_SET_POWER_MANAGEMENT_STATE,
- gcvHAL_QUERY_POWER_MANAGEMENT_STATE,
- gcvHAL_GET_BASE_ADDRESS,
- gcvHAL_SET_IDLE, /* reserved */
- /* Queries. */
- gcvHAL_QUERY_KERNEL_SETTINGS,
- /* Reset. */
- gcvHAL_RESET,
- /* Map physical address into handle. */
- gcvHAL_MAP_PHYSICAL,
- /* Debugger stuff. */
- gcvHAL_DEBUG,
- /* Cache stuff. */
- gcvHAL_CACHE,
- /* TimeStamp */
- gcvHAL_TIMESTAMP,
- /* Database. */
- gcvHAL_DATABASE,
- /* Version. */
- gcvHAL_VERSION,
- /* Chip info */
- gcvHAL_CHIP_INFO,
- /* Process attaching/detaching. */
- gcvHAL_ATTACH,
- gcvHAL_DETACH,
- /* Composition. */
- gcvHAL_COMPOSE,
- /* Set timeOut value */
- gcvHAL_SET_TIMEOUT,
- /* Frame database. */
- gcvHAL_GET_FRAME_INFO,
- gcvHAL_QUERY_COMMAND_BUFFER,
- gcvHAL_COMMIT_DONE,
- /* GPU and event dump */
- gcvHAL_DUMP_GPU_STATE,
- gcvHAL_DUMP_EVENT,
- /* Virtual command buffer. */
- gcvHAL_ALLOCATE_VIRTUAL_COMMAND_BUFFER,
- gcvHAL_FREE_VIRTUAL_COMMAND_BUFFER,
- /* FSCALE_VAL. */
- gcvHAL_SET_FSCALE_VALUE,
- gcvHAL_GET_FSCALE_VALUE,
- gcvHAL_NAME_VIDEO_MEMORY,
- gcvHAL_IMPORT_VIDEO_MEMORY,
- /* Reset time stamp. */
- gcvHAL_QUERY_RESET_TIME_STAMP,
- /* Multi-GPU read/write. */
- gcvHAL_READ_REGISTER_EX,
- gcvHAL_WRITE_REGISTER_EX,
- /* Sync point operations. */
- gcvHAL_SYNC_POINT,
- /* Create native fence and return its fd. */
- gcvHAL_CREATE_NATIVE_FENCE,
- /* Destory MMU. */
- gcvHAL_DESTROY_MMU,
- /* Shared buffer. */
- gcvHAL_SHBUF,
- /* Config power management. */
- gcvHAL_CONFIG_POWER_MANAGEMENT,
- /* Connect a video node to an OS native fd. */
- gcvHAL_GET_VIDEO_MEMORY_FD,
- }
- gceHAL_COMMAND_CODES;
- /******************************************************************************\
- ****************************** Interface Structure *****************************
- \******************************************************************************/
- #define gcdMAX_PROFILE_FILE_NAME 128
- /* Kernel settings. */
- typedef struct _gcsKERNEL_SETTINGS
- {
- /* Used RealTime signal between kernel and user. */
- gctINT signal;
- }
- gcsKERNEL_SETTINGS;
- /* gcvHAL_QUERY_CHIP_IDENTITY */
- typedef struct _gcsHAL_QUERY_CHIP_IDENTITY * gcsHAL_QUERY_CHIP_IDENTITY_PTR;
- typedef struct _gcsHAL_QUERY_CHIP_IDENTITY
- {
- /* Chip model. */
- gceCHIPMODEL chipModel;
- /* Revision value.*/
- gctUINT32 chipRevision;
- /* Supported feature fields. */
- gctUINT32 chipFeatures;
- /* Supported minor feature fields. */
- gctUINT32 chipMinorFeatures;
- /* Supported minor feature 1 fields. */
- gctUINT32 chipMinorFeatures1;
- /* Supported minor feature 2 fields. */
- gctUINT32 chipMinorFeatures2;
- /* Supported minor feature 3 fields. */
- gctUINT32 chipMinorFeatures3;
- /* Supported minor feature 4 fields. */
- gctUINT32 chipMinorFeatures4;
- /* Supported minor feature 5 fields. */
- gctUINT32 chipMinorFeatures5;
- /* Number of streams supported. */
- gctUINT32 streamCount;
- /* Total number of temporary registers per thread. */
- gctUINT32 registerMax;
- /* Maximum number of threads. */
- gctUINT32 threadCount;
- /* Number of shader cores. */
- gctUINT32 shaderCoreCount;
- /* Size of the vertex cache. */
- gctUINT32 vertexCacheSize;
- /* Number of entries in the vertex output buffer. */
- gctUINT32 vertexOutputBufferSize;
- /* Number of pixel pipes. */
- gctUINT32 pixelPipes;
- /* Number of instructions. */
- gctUINT32 instructionCount;
- /* Number of constants. */
- gctUINT32 numConstants;
- /* Buffer size */
- gctUINT32 bufferSize;
- /* Number of varyings */
- gctUINT32 varyingsCount;
- /* Supertile layout style in hardware */
- gctUINT32 superTileMode;
- #if gcdMULTI_GPU
- /* Number of 3D GPUs */
- gctUINT32 gpuCoreCount;
- #endif
- /* Special control bits for 2D chip. */
- gctUINT32 chip2DControl;
- /* Product ID */
- gctUINT32 productID;
- /* Special ECO bits */
- gceECO_FLAG ecoFlags;
- }
- gcsHAL_QUERY_CHIP_IDENTITY;
- /* gcvHAL_COMPOSE. */
- typedef struct _gcsHAL_COMPOSE * gcsHAL_COMPOSE_PTR;
- typedef struct _gcsHAL_COMPOSE
- {
- /* Composition state buffer. */
- gctUINT64 physical;
- gctUINT64 logical;
- gctUINT offset;
- gctUINT size;
- /* Composition end signal. */
- gctUINT64 process;
- gctUINT64 signal;
- /* User signals. */
- gctUINT64 userProcess;
- gctUINT64 userSignal1;
- gctUINT64 userSignal2;
- #if defined(__QNXNTO__)
- /* Client pulse side-channel connection ID. */
- gctINT32 coid;
- /* Set by server. */
- gctINT32 rcvid;
- #endif
- }
- gcsHAL_COMPOSE;
- typedef struct _gcsHAL_INTERFACE
- {
- /* Command code. */
- gceHAL_COMMAND_CODES command;
- /* Hardware type. */
- gceHARDWARE_TYPE hardwareType;
- /* Status value. */
- gceSTATUS status;
- /* Handle to this interface channel. */
- gctUINT64 handle;
- /* Pid of the client. */
- gctUINT32 pid;
- /* Union of command structures. */
- union _u
- {
- /* gcvHAL_GET_BASE_ADDRESS */
- struct _gcsHAL_GET_BASE_ADDRESS
- {
- /* Physical memory address of internal memory. */
- OUT gctUINT32 baseAddress;
- }
- GetBaseAddress;
- /* gcvHAL_QUERY_VIDEO_MEMORY */
- struct _gcsHAL_QUERY_VIDEO_MEMORY
- {
- /* Physical memory address of internal memory. Just a name. */
- OUT gctUINT32 internalPhysical;
- /* Size in bytes of internal memory. */
- OUT gctUINT64 internalSize;
- /* Physical memory address of external memory. Just a name. */
- OUT gctUINT32 externalPhysical;
- /* Size in bytes of external memory.*/
- OUT gctUINT64 externalSize;
- /* Physical memory address of contiguous memory. Just a name. */
- OUT gctUINT32 contiguousPhysical;
- /* Size in bytes of contiguous memory.*/
- OUT gctUINT64 contiguousSize;
- }
- QueryVideoMemory;
- /* gcvHAL_QUERY_CHIP_IDENTITY */
- gcsHAL_QUERY_CHIP_IDENTITY QueryChipIdentity;
- /* gcvHAL_MAP_MEMORY */
- struct _gcsHAL_MAP_MEMORY
- {
- /* Physical memory address to map. Just a name on Linux/Qnx. */
- IN gctUINT32 physical;
- /* Number of bytes in physical memory to map. */
- IN gctUINT64 bytes;
- /* Address of mapped memory. */
- OUT gctUINT64 logical;
- }
- MapMemory;
- /* gcvHAL_UNMAP_MEMORY */
- struct _gcsHAL_UNMAP_MEMORY
- {
- /* Physical memory address to unmap. Just a name on Linux/Qnx. */
- IN gctUINT32 physical;
- /* Number of bytes in physical memory to unmap. */
- IN gctUINT64 bytes;
- /* Address of mapped memory to unmap. */
- IN gctUINT64 logical;
- }
- UnmapMemory;
- /* gcvHAL_ALLOCATE_LINEAR_VIDEO_MEMORY */
- struct _gcsHAL_ALLOCATE_LINEAR_VIDEO_MEMORY
- {
- /* Number of bytes to allocate. */
- IN OUT gctUINT bytes;
- /* Buffer alignment. */
- IN gctUINT alignment;
- /* Type of allocation. */
- IN gceSURF_TYPE type;
- /* Flag of allocation. */
- IN gctUINT32 flag;
- /* Memory pool to allocate from. */
- IN OUT gcePOOL pool;
- /* Allocated video memory. */
- OUT gctUINT32 node;
- }
- AllocateLinearVideoMemory;
- /* gcvHAL_ALLOCATE_VIDEO_MEMORY */
- struct _gcsHAL_ALLOCATE_VIDEO_MEMORY
- {
- /* Width of rectangle to allocate. */
- IN OUT gctUINT width;
- /* Height of rectangle to allocate. */
- IN OUT gctUINT height;
- /* Depth of rectangle to allocate. */
- IN gctUINT depth;
- /* Format rectangle to allocate in gceSURF_FORMAT. */
- IN gceSURF_FORMAT format;
- /* Type of allocation. */
- IN gceSURF_TYPE type;
- /* Memory pool to allocate from. */
- IN OUT gcePOOL pool;
- /* Allocated video memory. */
- OUT gctUINT32 node;
- }
- AllocateVideoMemory;
- /* gcvHAL_RELEASE_VIDEO_MEMORY */
- struct _gcsHAL_RELEASE_VIDEO_MEMORY
- {
- /* Allocated video memory. */
- IN gctUINT32 node;
- #ifdef __QNXNTO__
- /* TODO: This is part of the unlock - why is it here? */
- /* Mapped logical address to unmap in user space. */
- OUT gctUINT64 memory;
- /* Number of bytes to allocated. */
- OUT gctUINT64 bytes;
- #endif
- }
- ReleaseVideoMemory;
- /* gcvHAL_LOCK_VIDEO_MEMORY */
- struct _gcsHAL_LOCK_VIDEO_MEMORY
- {
- /* Allocated video memory. */
- IN gctUINT32 node;
- /* Cache configuration. */
- /* Only gcvPOOL_CONTIGUOUS and gcvPOOL_VIRUTAL
- ** can be configured */
- IN gctBOOL cacheable;
- /* Hardware specific address. */
- OUT gctUINT32 address;
- /* Mapped logical address. */
- OUT gctUINT64 memory;
- /* Customer priviate handle*/
- OUT gctUINT32 gid;
- /* Bus address of a contiguous video node. */
- OUT gctUINT64 physicalAddress;
- }
- LockVideoMemory;
- /* gcvHAL_UNLOCK_VIDEO_MEMORY */
- struct _gcsHAL_UNLOCK_VIDEO_MEMORY
- {
- /* Allocated video memory. */
- IN gctUINT64 node;
- /* Type of surface. */
- IN gceSURF_TYPE type;
- /* Flag to unlock surface asynchroneously. */
- IN OUT gctBOOL asynchroneous;
- }
- UnlockVideoMemory;
- /* gcvHAL_ALLOCATE_NON_PAGED_MEMORY */
- struct _gcsHAL_ALLOCATE_NON_PAGED_MEMORY
- {
- /* Number of bytes to allocate. */
- IN OUT gctUINT64 bytes;
- /* Physical address of allocation. Just a name. */
- OUT gctUINT32 physical;
- /* Logical address of allocation. */
- OUT gctUINT64 logical;
- }
- AllocateNonPagedMemory;
- /* gcvHAL_FREE_NON_PAGED_MEMORY */
- struct _gcsHAL_FREE_NON_PAGED_MEMORY
- {
- /* Number of bytes allocated. */
- IN gctUINT64 bytes;
- /* Physical address of allocation. Just a name. */
- IN gctUINT32 physical;
- /* Logical address of allocation. */
- IN gctUINT64 logical;
- }
- FreeNonPagedMemory;
- /* gcvHAL_ALLOCATE_NON_PAGED_MEMORY */
- struct _gcsHAL_ALLOCATE_VIRTUAL_COMMAND_BUFFER
- {
- /* Number of bytes to allocate. */
- IN OUT gctUINT64 bytes;
- /* Physical address of allocation. Just a name. */
- OUT gctUINT32 physical;
- /* Logical address of allocation. */
- OUT gctUINT64 logical;
- }
- AllocateVirtualCommandBuffer;
- /* gcvHAL_FREE_NON_PAGED_MEMORY */
- struct _gcsHAL_FREE_VIRTUAL_COMMAND_BUFFER
- {
- /* Number of bytes allocated. */
- IN gctUINT64 bytes;
- /* Physical address of allocation. Just a name. */
- IN gctUINT32 physical;
- /* Logical address of allocation. */
- IN gctUINT64 logical;
- }
- FreeVirtualCommandBuffer;
- /* gcvHAL_EVENT_COMMIT. */
- struct _gcsHAL_EVENT_COMMIT
- {
- /* Event queue in gcsQUEUE. */
- IN gctUINT64 queue;
- #if gcdMULTI_GPU
- IN gceCORE_3D_MASK chipEnable;
- IN gceMULTI_GPU_MODE gpuMode;
- #endif
- }
- Event;
- /* gcvHAL_COMMIT */
- struct _gcsHAL_COMMIT
- {
- /* Context buffer object gckCONTEXT. */
- IN gctUINT64 context;
- /* Command buffer gcoCMDBUF. */
- IN gctUINT64 commandBuffer;
- /* State delta buffer in gcsSTATE_DELTA. */
- gctUINT64 delta;
- /* Event queue in gcsQUEUE. */
- IN gctUINT64 queue;
- #if gcdMULTI_GPU
- IN gceCORE_3D_MASK chipEnable;
- IN gceMULTI_GPU_MODE gpuMode;
- #endif
- }
- Commit;
- /* gcvHAL_MAP_USER_MEMORY */
- struct _gcsHAL_MAP_USER_MEMORY
- {
- /* Base address of user memory to map. */
- IN gctUINT64 memory;
- /* Physical address of user memory to map. */
- IN gctUINT32 physical;
- /* Size of user memory in bytes to map. */
- IN gctUINT64 size;
- /* Info record required by gcvHAL_UNMAP_USER_MEMORY. Just a name. */
- OUT gctUINT32 info;
- /* Physical address of mapped memory. */
- OUT gctUINT32 address;
- }
- MapUserMemory;
- /* gcvHAL_UNMAP_USER_MEMORY */
- struct _gcsHAL_UNMAP_USER_MEMORY
- {
- /* Base address of user memory to unmap. */
- IN gctUINT64 memory;
- /* Size of user memory in bytes to unmap. */
- IN gctUINT64 size;
- /* Info record returned by gcvHAL_MAP_USER_MEMORY. Just a name. */
- IN gctUINT32 info;
- /* Physical address of mapped memory as returned by
- gcvHAL_MAP_USER_MEMORY. */
- IN gctUINT32 address;
- }
- UnmapUserMemory;
- #if !USE_NEW_LINUX_SIGNAL
- /* gcsHAL_USER_SIGNAL */
- struct _gcsHAL_USER_SIGNAL
- {
- /* Command. */
- gceUSER_SIGNAL_COMMAND_CODES command;
- /* Signal ID. */
- IN OUT gctINT id;
- /* Reset mode. */
- IN gctBOOL manualReset;
- /* Wait timedout. */
- IN gctUINT32 wait;
- /* State. */
- IN gctBOOL state;
- }
- UserSignal;
- #endif
- /* gcvHAL_SIGNAL. */
- struct _gcsHAL_SIGNAL
- {
- /* Signal handle to signal gctSIGNAL. */
- IN gctUINT64 signal;
- /* Reserved gctSIGNAL. */
- IN gctUINT64 auxSignal;
- /* Process owning the signal gctHANDLE. */
- IN gctUINT64 process;
- #if defined(__QNXNTO__)
- /* Client pulse side-channel connection ID. Set by client in gcoOS_CreateSignal. */
- IN gctINT32 coid;
- /* Set by server. */
- IN gctINT32 rcvid;
- #endif
- /* Event generated from where of pipeline */
- IN gceKERNEL_WHERE fromWhere;
- }
- Signal;
- /* gcvHAL_WRITE_DATA. */
- struct _gcsHAL_WRITE_DATA
- {
- /* Address to write data to. */
- IN gctUINT32 address;
- /* Data to write. */
- IN gctUINT32 data;
- }
- WriteData;
- /* gcvHAL_ALLOCATE_CONTIGUOUS_MEMORY */
- struct _gcsHAL_ALLOCATE_CONTIGUOUS_MEMORY
- {
- /* Number of bytes to allocate. */
- IN OUT gctUINT64 bytes;
- /* Hardware address of allocation. */
- OUT gctUINT32 address;
- /* Physical address of allocation. Just a name. */
- OUT gctUINT32 physical;
- /* Logical address of allocation. */
- OUT gctUINT64 logical;
- }
- AllocateContiguousMemory;
- /* gcvHAL_FREE_CONTIGUOUS_MEMORY */
- struct _gcsHAL_FREE_CONTIGUOUS_MEMORY
- {
- /* Number of bytes allocated. */
- IN gctUINT64 bytes;
- /* Physical address of allocation. Just a name. */
- IN gctUINT32 physical;
- /* Logical address of allocation. */
- IN gctUINT64 logical;
- }
- FreeContiguousMemory;
- /* gcvHAL_READ_REGISTER */
- struct _gcsHAL_READ_REGISTER
- {
- /* Logical address of memory to write data to. */
- IN gctUINT32 address;
- /* Data read. */
- OUT gctUINT32 data;
- }
- ReadRegisterData;
- /* gcvHAL_WRITE_REGISTER */
- struct _gcsHAL_WRITE_REGISTER
- {
- /* Logical address of memory to write data to. */
- IN gctUINT32 address;
- /* Data read. */
- IN gctUINT32 data;
- }
- WriteRegisterData;
- #if gcdMULTI_GPU
- /* gcvHAL_READ_REGISTER_EX */
- struct _gcsHAL_READ_REGISTER_EX
- {
- /* Logical address of memory to write data to. */
- IN gctUINT32 address;
- IN gctUINT32 coreSelect;
- /* Data read. */
- OUT gctUINT32 data[gcdMULTI_GPU];
- }
- ReadRegisterDataEx;
- /* gcvHAL_WRITE_REGISTER_EX */
- struct _gcsHAL_WRITE_REGISTER_EX
- {
- /* Logical address of memory to write data to. */
- IN gctUINT32 address;
- IN gctUINT32 coreSelect;
- /* Data read. */
- IN gctUINT32 data[gcdMULTI_GPU];
- }
- WriteRegisterDataEx;
- #endif
- #if VIVANTE_PROFILER
- /* gcvHAL_GET_PROFILE_SETTING */
- struct _gcsHAL_GET_PROFILE_SETTING
- {
- /* Enable profiling */
- OUT gctBOOL enable;
- }
- GetProfileSetting;
- /* gcvHAL_SET_PROFILE_SETTING */
- struct _gcsHAL_SET_PROFILE_SETTING
- {
- /* Enable profiling */
- IN gctBOOL enable;
- }
- SetProfileSetting;
- #if VIVANTE_PROFILER_PERDRAW
- /* gcvHAL_READ_PROFILER_REGISTER_SETTING */
- struct _gcsHAL_READ_PROFILER_REGISTER_SETTING
- {
- /*Should Clear Register*/
- IN gctBOOL bclear;
- }
- SetProfilerRegisterClear;
- #endif
- /* gcvHAL_READ_ALL_PROFILE_REGISTERS */
- struct _gcsHAL_READ_ALL_PROFILE_REGISTERS
- {
- #if VIVANTE_PROFILER_CONTEXT
- /* Context buffer object gckCONTEXT. Just a name. */
- IN gctUINT32 context;
- #endif
- /* Data read. */
- OUT gcsPROFILER_COUNTERS counters;
- }
- RegisterProfileData;
- /* gcvHAL_PROFILE_REGISTERS_2D */
- struct _gcsHAL_PROFILE_REGISTERS_2D
- {
- /* Data read in gcs2D_PROFILE. */
- OUT gctUINT64 hwProfile2D;
- }
- RegisterProfileData2D;
- #endif
- /* Power management. */
- /* gcvHAL_SET_POWER_MANAGEMENT_STATE */
- struct _gcsHAL_SET_POWER_MANAGEMENT
- {
- /* Data read. */
- IN gceCHIPPOWERSTATE state;
- }
- SetPowerManagement;
- /* gcvHAL_QUERY_POWER_MANAGEMENT_STATE */
- struct _gcsHAL_QUERY_POWER_MANAGEMENT
- {
- /* Data read. */
- OUT gceCHIPPOWERSTATE state;
- /* Idle query. */
- OUT gctBOOL isIdle;
- }
- QueryPowerManagement;
- /* gcvHAL_QUERY_KERNEL_SETTINGS */
- struct _gcsHAL_QUERY_KERNEL_SETTINGS
- {
- /* Settings.*/
- OUT gcsKERNEL_SETTINGS settings;
- }
- QueryKernelSettings;
- /* gcvHAL_MAP_PHYSICAL */
- struct _gcsHAL_MAP_PHYSICAL
- {
- /* gcvTRUE to map, gcvFALSE to unmap. */
- IN gctBOOL map;
- /* Physical address. */
- IN OUT gctUINT64 physical;
- }
- MapPhysical;
- /* gcvHAL_DEBUG */
- struct _gcsHAL_DEBUG
- {
- /* If gcvTRUE, set the debug information. */
- IN gctBOOL set;
- IN gctUINT32 level;
- IN gctUINT32 zones;
- IN gctBOOL enable;
- IN gceDEBUG_MESSAGE_TYPE type;
- IN gctUINT32 messageSize;
- /* Message to print if not empty. */
- IN gctCHAR message[80];
- }
- Debug;
- /* gcvHAL_CACHE */
- struct _gcsHAL_CACHE
- {
- IN gceCACHEOPERATION operation;
- IN gctUINT64 process;
- IN gctUINT64 logical;
- IN gctUINT64 bytes;
- IN gctUINT32 node;
- }
- Cache;
- /* gcvHAL_TIMESTAMP */
- struct _gcsHAL_TIMESTAMP
- {
- /* Timer select. */
- IN gctUINT32 timer;
- /* Timer request type (0-stop, 1-start, 2-send delta). */
- IN gctUINT32 request;
- /* Result of delta time in microseconds. */
- OUT gctINT32 timeDelta;
- }
- TimeStamp;
- /* gcvHAL_DATABASE */
- struct _gcsHAL_DATABASE
- {
- /* Set to gcvTRUE if you want to query a particular process ID.
- ** Set to gcvFALSE to query the last detached process. */
- IN gctBOOL validProcessID;
- /* Process ID to query. */
- IN gctUINT32 processID;
- /* Information. */
- OUT gcuDATABASE_INFO vidMem;
- OUT gcuDATABASE_INFO nonPaged;
- OUT gcuDATABASE_INFO contiguous;
- OUT gcuDATABASE_INFO gpuIdle;
- /* Detail information about video memory. */
- OUT gcuDATABASE_INFO vidMemPool[3];
- }
- Database;
- /* gcvHAL_VERSION */
- struct _gcsHAL_VERSION
- {
- /* Major version: N.n.n. */
- OUT gctINT32 major;
- /* Minor version: n.N.n. */
- OUT gctINT32 minor;
- /* Patch version: n.n.N. */
- OUT gctINT32 patch;
- /* Build version. */
- OUT gctUINT32 build;
- }
- Version;
- /* gcvHAL_CHIP_INFO */
- struct _gcsHAL_CHIP_INFO
- {
- /* Chip count. */
- OUT gctINT32 count;
- /* Chip types. */
- OUT gceHARDWARE_TYPE types[gcdCHIP_COUNT];
- }
- ChipInfo;
- /* gcvHAL_ATTACH */
- struct _gcsHAL_ATTACH
- {
- /* Handle of context buffer object. */
- OUT gctUINT32 context;
- /* Number of states in the buffer. */
- OUT gctUINT64 stateCount;
- /* Map context buffer to user or not. */
- IN gctBOOL map;
- /* Physical of context buffer. */
- OUT gctUINT32 physicals[2];
- /* Physical of context buffer. */
- OUT gctUINT64 logicals[2];
- /* Bytes of context buffer. */
- OUT gctUINT32 bytes;
- }
- Attach;
- /* gcvHAL_DETACH */
- struct _gcsHAL_DETACH
- {
- /* Context buffer object gckCONTEXT. Just a name. */
- IN gctUINT32 context;
- }
- Detach;
- /* gcvHAL_COMPOSE. */
- gcsHAL_COMPOSE Compose;
- /* gcvHAL_GET_FRAME_INFO. */
- struct _gcsHAL_GET_FRAME_INFO
- {
- /* gcsHAL_FRAME_INFO* */
- OUT gctUINT64 frameInfo;
- }
- GetFrameInfo;
- /* gcvHAL_SET_TIME_OUT. */
- struct _gcsHAL_SET_TIMEOUT
- {
- gctUINT32 timeOut;
- }
- SetTimeOut;
- #if gcdENABLE_VG
- /* gcvHAL_COMMIT */
- struct _gcsHAL_VGCOMMIT
- {
- /* Context buffer. gcsVGCONTEXT_PTR */
- IN gctUINT64 context;
- /* Command queue. gcsVGCMDQUEUE_PTR */
- IN gctUINT64 queue;
- /* Number of entries in the queue. */
- IN gctUINT entryCount;
- /* Task table. gcsTASK_MASTER_TABLE_PTR */
- IN gctUINT64 taskTable;
- }
- VGCommit;
- /* gcvHAL_QUERY_COMMAND_BUFFER */
- struct _gcsHAL_QUERY_COMMAND_BUFFER
- {
- /* Command buffer attributes. */
- OUT gcsCOMMAND_BUFFER_INFO information;
- }
- QueryCommandBuffer;
- #endif
- struct _gcsHAL_SET_FSCALE_VALUE
- {
- IN gctUINT value;
- }
- SetFscaleValue;
- struct _gcsHAL_GET_FSCALE_VALUE
- {
- OUT gctUINT value;
- OUT gctUINT minValue;
- OUT gctUINT maxValue;
- }
- GetFscaleValue;
- struct _gcsHAL_NAME_VIDEO_MEMORY
- {
- IN gctUINT32 handle;
- OUT gctUINT32 name;
- }
- NameVideoMemory;
- struct _gcsHAL_IMPORT_VIDEO_MEMORY
- {
- IN gctUINT32 name;
- OUT gctUINT32 handle;
- }
- ImportVideoMemory;
- struct _gcsHAL_QUERY_RESET_TIME_STAMP
- {
- OUT gctUINT64 timeStamp;
- }
- QueryResetTimeStamp;
- struct _gcsHAL_SYNC_POINT
- {
- /* Command. */
- gceSYNC_POINT_COMMAND_CODES command;
- /* Sync point. */
- IN OUT gctUINT64 syncPoint;
- /* From where. */
- IN gceKERNEL_WHERE fromWhere;
- /* Signaled state. */
- OUT gctBOOL state;
- }
- SyncPoint;
- struct _gcsHAL_CREATE_NATIVE_FENCE
- {
- /* Signal id to dup. */
- IN gctUINT64 syncPoint;
- /* Native fence file descriptor. */
- OUT gctINT fenceFD;
- }
- CreateNativeFence;
- struct _gcsHAL_DESTROY_MMU
- {
- /* Mmu object. */
- IN gctUINT64 mmu;
- }
- DestroyMmu;
- struct _gcsHAL_SHBUF
- {
- gceSHBUF_COMMAND_CODES command;
- /* Shared buffer. */
- IN OUT gctUINT64 id;
- /* User data to be shared. */
- IN gctUINT64 data;
- /* Data size. */
- IN OUT gctUINT32 bytes;
- }
- ShBuf;
- struct _gcsHAL_CONFIG_POWER_MANAGEMENT
- {
- IN gctBOOL enable;
- }
- ConfigPowerManagement;
- struct _gcsHAL_GET_VIDEO_MEMORY_FD
- {
- IN gctUINT32 handle;
- OUT gctINT fd;
- }
- GetVideoMemoryFd;
- }
- u;
- }
- gcsHAL_INTERFACE;
- #ifdef __cplusplus
- }
- #endif
- #endif /* __gc_hal_driver_h_ */
|