/****************************************************************************
*
-* Copyright (C) 2005 - 2013 by Vivante Corp.
+* Copyright (C) 2005 - 2014 by Vivante Corp.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
*****************************************************************************/
-
#ifndef __gc_hal_driver_h_
#define __gc_hal_driver_h_
#define IOCTL_GCHAL_KERNEL_INTERFACE 30001
#define IOCTL_GCHAL_TERMINATE 30002
+#undef CONFIG_ANDROID_RESERVED_MEMORY_ACCOUNT
/******************************************************************************\
********************************* Command Codes ********************************
\******************************************************************************/
/* Video memory allocation. */
gcvHAL_ALLOCATE_VIDEO_MEMORY, /* Enforced alignment. */
gcvHAL_ALLOCATE_LINEAR_VIDEO_MEMORY, /* No alignment. */
- gcvHAL_FREE_VIDEO_MEMORY,
+ gcvHAL_RELEASE_VIDEO_MEMORY,
/* Physical-to-logical mapping. */
gcvHAL_MAP_MEMORY,
/* Frame database. */
gcvHAL_GET_FRAME_INFO,
- /* Shared info for each process */
- gcvHAL_GET_SHARED_INFO,
- gcvHAL_SET_SHARED_INFO,
gcvHAL_QUERY_COMMAND_BUFFER,
gcvHAL_COMMIT_DONE,
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,
- /* Video memory database */
- gcvHAL_VIDMEM_DATABASE,
+ /* 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;
/* Supported minor feature 4 fields. */
gctUINT32 chipMinorFeatures4;
+ /* Supported minor feature 5 fields. */
+ gctUINT32 chipMinorFeatures5;
+
/* Number of streams supported. */
gctUINT32 streamCount;
/* 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;
}
gcsHAL_QUERY_CHIP_IDENTITY;
/* 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 in gcuVIDMEM_NODE. */
- OUT gctUINT64 node;
+ /* Allocated video memory. */
+ OUT gctUINT32 node;
}
AllocateLinearVideoMemory;
/* Memory pool to allocate from. */
IN OUT gcePOOL pool;
- /* Allocated video memory in gcuVIDMEM_NODE. */
- OUT gctUINT64 node;
+ /* Allocated video memory. */
+ OUT gctUINT32 node;
}
AllocateVideoMemory;
- /* gcvHAL_FREE_VIDEO_MEMORY */
- struct _gcsHAL_FREE_VIDEO_MEMORY
+ /* gcvHAL_RELEASE_VIDEO_MEMORY */
+ struct _gcsHAL_RELEASE_VIDEO_MEMORY
{
- /* Allocated video memory in gcuVIDMEM_NODE. */
- IN gctUINT64 node;
+ /* 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;
+ OUT gctUINT64 memory;
/* Number of bytes to allocated. */
- OUT gctUINT64 bytes;
+ OUT gctUINT64 bytes;
#endif
}
- FreeVideoMemory;
+ ReleaseVideoMemory;
/* gcvHAL_LOCK_VIDEO_MEMORY */
struct _gcsHAL_LOCK_VIDEO_MEMORY
{
- /* Allocated video memory gcuVIDMEM_NODE gcuVIDMEM_NODE. */
- IN gctUINT64 node;
+ /* Allocated video memory. */
+ IN gctUINT32 node;
/* Cache configuration. */
/* Only gcvPOOL_CONTIGUOUS and gcvPOOL_VIRUTAL
** can be configured */
- IN gctBOOL cacheable;
+ IN gctBOOL cacheable;
/* Hardware specific address. */
- OUT gctUINT32 address;
+ OUT gctUINT32 address;
/* Mapped logical address. */
- OUT gctUINT64 memory;
+ 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 gcuVIDMEM_NODE. */
- IN gctUINT64 node;
+ /* Allocated video memory. */
+ IN gctUINT64 node;
/* Type of surface. */
- IN gceSURF_TYPE type;
+ IN gceSURF_TYPE type;
/* Flag to unlock surface asynchroneously. */
- IN OUT gctBOOL asynchroneous;
+ IN OUT gctBOOL asynchroneous;
}
UnlockVideoMemory;
struct _gcsHAL_EVENT_COMMIT
{
/* Event queue in gcsQUEUE. */
- IN gctUINT64 queue;
+ IN gctUINT64 queue;
+
+#if gcdMULTI_GPU
+ IN gceCORE_3D_MASK chipEnable;
+
+ IN gceMULTI_GPU_MODE gpuMode;
+#endif
}
Event;
/* Event queue in gcsQUEUE. */
IN gctUINT64 queue;
+
+#if gcdMULTI_GPU
+ IN gceCORE_3D_MASK chipEnable;
+
+ IN gceMULTI_GPU_MODE gpuMode;
+#endif
}
Commit;
}
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;
-
- /* The profile file name */
- OUT gctCHAR fileName[gcdMAX_PROFILE_FILE_NAME];
}
GetProfileSetting;
{
/* Enable profiling */
IN gctBOOL enable;
-
- /* The profile file name */
- IN gctCHAR fileName[gcdMAX_PROFILE_FILE_NAME];
}
SetProfileSetting;
/* Context buffer object gckCONTEXT. Just a name. */
IN gctUINT32 context;
#endif
+
/* Data read. */
OUT gcsPROFILER_COUNTERS counters;
}
}
RegisterProfileData2D;
#endif
+
/* Power management. */
/* gcvHAL_SET_POWER_MANAGEMENT_STATE */
struct _gcsHAL_SET_POWER_MANAGEMENT
struct _gcsHAL_CACHE
{
IN gceCACHEOPERATION operation;
- /* gctHANDLE */
IN gctUINT64 process;
IN gctUINT64 logical;
IN gctUINT64 bytes;
- /* gcuVIDMEM_NODE_PTR */
- IN gctUINT64 node;
+ IN gctUINT32 node;
}
Cache;
OUT gcuDATABASE_INFO nonPaged;
OUT gcuDATABASE_INFO contiguous;
OUT gcuDATABASE_INFO gpuIdle;
- }
- Database;
- /* gcvHAL_VIDMEM_DATABASE */
- struct _gcsHAL_VIDMEM_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 vidMemResv;
- OUT gcuDATABASE_INFO vidMemCont;
- OUT gcuDATABASE_INFO vidMemVirt;
+ /* Detail information about video memory. */
+ OUT gcuDATABASE_INFO vidMemPool[3];
}
- VidMemDatabase;
+ Database;
/* gcvHAL_VERSION */
struct _gcsHAL_VERSION
/* gcvHAL_ATTACH */
struct _gcsHAL_ATTACH
{
- /* Context buffer object gckCONTEXT. Just a name. */
+ /* 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;
SetTimeOut;
#if gcdENABLE_VG
- /* gcvHAL_COMMIT */
- struct _gcsHAL_VGCOMMIT
- {
- /* Context buffer in gcsVGCONTEXT. */
- IN gctUINT64 context;
-
- /* Command queue in gcsVGCMDQUEUE. */
- IN gctUINT64 queue;
-
- /* Number of entries in the queue. */
- IN gctUINT entryCount;
-
- /* Task table in gcsTASK_MASTER_TABLE. */
- 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_GET_SHARED_INFO
+ /* gcvHAL_COMMIT */
+ struct _gcsHAL_VGCOMMIT
{
- /* Process id. */
- IN gctUINT32 pid;
+ /* Context buffer. gcsVGCONTEXT_PTR */
+ IN gctUINT64 context;
- /* Data id. */
- IN gctUINT32 dataId;
+ /* Command queue. gcsVGCMDQUEUE_PTR */
+ IN gctUINT64 queue;
- /* Data size. */
- IN gctSIZE_T bytes;
+ /* Number of entries in the queue. */
+ IN gctUINT entryCount;
- /* Pointer to save the shared data. */
- OUT gctPOINTER data;
+ /* Task table. gcsTASK_MASTER_TABLE_PTR */
+ IN gctUINT64 taskTable;
}
- GetSharedInfo;
+ VGCommit;
- struct _gcsHAL_SET_SHARED_INFO
+ /* gcvHAL_QUERY_COMMAND_BUFFER */
+ struct _gcsHAL_QUERY_COMMAND_BUFFER
{
- /* Data id. */
- IN gctUINT32 dataId;
-
- /* Data to be shared. */
- IN gctPOINTER data;
-
- /* Data size. */
- IN gctSIZE_T bytes;
+ /* Command buffer attributes. */
+ OUT gcsCOMMAND_BUFFER_INFO information;
}
- SetSharedInfo;
+ QueryCommandBuffer;
+
+#endif
struct _gcsHAL_SET_FSCALE_VALUE
{
}
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;
}
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;
}