mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 03:40:35 +09:00
RK3368 GPU: Rogue Q Init for 4.19.
1、Change Android sync to sync_file 2、Fixup compile error on 4.19 3、Fixup some crash on 4.19 4、Fixup some clang waring 5、Fixup clang warning Change-Id: Ie59a9252116f6e7cc97f5f9b9a25ae6d5d5f82b1 Signed-off-by: Li Huang <putin.li@rock-chips.com>
This commit is contained in:
@@ -126,4 +126,6 @@ source "drivers/staging/axis-fifo/Kconfig"
|
||||
|
||||
source "drivers/staging/erofs/Kconfig"
|
||||
|
||||
source "drivers/staging/imgtec/Kconfig"
|
||||
|
||||
endif # STAGING
|
||||
|
||||
@@ -53,3 +53,4 @@ obj-$(CONFIG_SOC_MT7621) += mt7621-dts/
|
||||
obj-$(CONFIG_STAGING_GASKET_FRAMEWORK) += gasket/
|
||||
obj-$(CONFIG_XIL_AXIS_FIFO) += axis-fifo/
|
||||
obj-$(CONFIG_EROFS_FS) += erofs/
|
||||
obj-$(CONFIG_POWERVR_ROGUE_N) += imgtec/
|
||||
|
||||
@@ -701,7 +701,7 @@ typedef struct
|
||||
struct device *psDev;
|
||||
int iInterruptID;
|
||||
void *pvData;
|
||||
PFN_LISR pfnLISR;
|
||||
SYS_PFN_LISR pfnLISR;
|
||||
} LISR_DATA;
|
||||
|
||||
static void ApolloInterruptHandler(void* pvData)
|
||||
@@ -713,7 +713,7 @@ static void ApolloInterruptHandler(void* pvData)
|
||||
PVRSRV_ERROR SysInstallDeviceLISR(IMG_HANDLE hSysData,
|
||||
IMG_UINT32 ui32IRQ,
|
||||
const IMG_CHAR *pszName,
|
||||
PFN_LISR pfnLISR,
|
||||
SYS_PFN_LISR pfnLISR,
|
||||
void *pvData,
|
||||
IMG_HANDLE *phLISRData)
|
||||
{
|
||||
|
||||
@@ -86,12 +86,12 @@
|
||||
#define PVR_LINUX_PHYSMEM_MAX_ALLOC_ORDER_NUM 2
|
||||
#define PVR_LINUX_KMALLOC_ALLOCATION_THRESHOLD 16384
|
||||
#define SUPPORT_KERNEL_SRVINIT
|
||||
#define SUPPORT_NATIVE_FENCE_SYNC
|
||||
#define SUPPORT_NATIVE_FENCE_SYNC
|
||||
#define PVR_DRM_NAME "pvr"
|
||||
#define DEVICE_MEMSETCPY_ALIGN_IN_BYTES 16
|
||||
#define ANDROID
|
||||
#define SUPPORT_ION
|
||||
#define PVR_ANDROID_ION_HEADER "../drivers/staging/android/ion/ion.h"
|
||||
#define PVR_ANDROID_ION_PRIV_HEADER "../drivers/staging/android/ion/ion_priv.h"
|
||||
#define PVR_ANDROID_ION_HEADER "../drivers/staging/android/ion_legency/ion.h"
|
||||
#define PVR_ANDROID_ION_PRIV_HEADER "../drivers/staging/android/ion_legency/ion_priv.h"
|
||||
#define PVR_ANDROID_ION_USE_SG_LENGTH
|
||||
#define PVR_ANDROID_SYNC_HEADER "../drivers/staging/android/sync.h"
|
||||
|
||||
@@ -93,7 +93,7 @@ const struct dev_pm_ops pvr_pm_ops = {
|
||||
};
|
||||
|
||||
|
||||
static int pvr_drm_load(struct drm_device *ddev, unsigned long flags)
|
||||
int pvr_drm_load(struct drm_device *ddev, unsigned long flags)
|
||||
{
|
||||
struct _PVRSRV_DEVICE_NODE_ *dev_node;
|
||||
enum PVRSRV_ERROR srv_err;
|
||||
@@ -105,8 +105,12 @@ static int pvr_drm_load(struct drm_device *ddev, unsigned long flags)
|
||||
* The equivalent is done for PCI modesetting drivers by
|
||||
* drm_get_pci_dev()
|
||||
*/
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0)
|
||||
if (ddev->platformdev)
|
||||
platform_set_drvdata(ddev->platformdev, ddev);
|
||||
#else
|
||||
dev_set_drvdata(ddev->dev, ddev);
|
||||
#endif
|
||||
|
||||
srv_err = PVRSRVDeviceCreate(ddev->dev, &dev_node);
|
||||
if (srv_err != PVRSRV_OK) {
|
||||
@@ -137,7 +141,7 @@ err_exit:
|
||||
return err;
|
||||
}
|
||||
|
||||
static int pvr_drm_unload(struct drm_device *ddev)
|
||||
void pvr_drm_unload(struct drm_device *ddev)
|
||||
{
|
||||
DRM_DEBUG_DRIVER("device %p\n", ddev->dev);
|
||||
|
||||
@@ -146,7 +150,7 @@ static int pvr_drm_unload(struct drm_device *ddev)
|
||||
PVRSRVDeviceDestroy(ddev->dev_private);
|
||||
ddev->dev_private = NULL;
|
||||
|
||||
return 0;
|
||||
//return 0;
|
||||
}
|
||||
|
||||
static int pvr_drm_open(struct drm_device *ddev, struct drm_file *dfile)
|
||||
@@ -268,8 +272,13 @@ const struct drm_driver pvr_drm_generic_driver = {
|
||||
.driver_features = DRIVER_MODESET | DRIVER_RENDER,
|
||||
|
||||
.dev_priv_size = 0,
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 10, 0))
|
||||
.load = NULL,
|
||||
.unload = NULL,
|
||||
#else
|
||||
.load = pvr_drm_load,
|
||||
.unload = pvr_drm_unload,
|
||||
#endif
|
||||
.open = pvr_drm_open,
|
||||
.postclose = pvr_drm_release,
|
||||
|
||||
|
||||
@@ -55,6 +55,9 @@ struct vm_area_struct;
|
||||
extern const struct dev_pm_ops pvr_pm_ops;
|
||||
extern const struct drm_driver pvr_drm_generic_driver;
|
||||
|
||||
int pvr_drm_load(struct drm_device *ddev, unsigned long flags);
|
||||
void pvr_drm_unload(struct drm_device *ddev);
|
||||
|
||||
#if defined(PDUMP)
|
||||
int dbgdrv_init(void);
|
||||
void dbgdrv_cleanup(void);
|
||||
|
||||
@@ -103,67 +103,54 @@ MODULE_PARM_DESC(num_devices,
|
||||
|
||||
static int pvr_devices_register(void)
|
||||
{
|
||||
#if defined(MODULE) && !defined(PVR_LDM_PLATFORM_PRE_REGISTERED)
|
||||
struct platform_device_info pvr_dev_info = {
|
||||
.name = SYS_RGX_DEV_NAME,
|
||||
.id = -2,
|
||||
#if defined(NO_HARDWARE)
|
||||
/* Not all cores have 40 bit physical support, but this
|
||||
* will work unless > 32 bit address is returned on those cores.
|
||||
* In the future this will be fixed more correctly.
|
||||
*/
|
||||
.dma_mask = DMA_BIT_MASK(40),
|
||||
#else
|
||||
.dma_mask = DMA_BIT_MASK(32),
|
||||
#endif
|
||||
};
|
||||
unsigned int i;
|
||||
|
||||
BUG_ON(pvr_num_devices == 0 || pvr_num_devices > MAX_DEVICES);
|
||||
|
||||
pvr_devices = kmalloc_array(pvr_num_devices, sizeof(*pvr_devices),
|
||||
GFP_KERNEL);
|
||||
if (!pvr_devices)
|
||||
return -ENOMEM;
|
||||
|
||||
for (i = 0; i < pvr_num_devices; i++) {
|
||||
pvr_devices[i] = platform_device_register_full(&pvr_dev_info);
|
||||
if (IS_ERR(pvr_devices[i])) {
|
||||
DRM_ERROR("unable to register device %u (err=%ld)\n",
|
||||
i, PTR_ERR(pvr_devices[i]));
|
||||
pvr_devices[i] = NULL;
|
||||
return -ENODEV;
|
||||
}
|
||||
}
|
||||
#endif /* defined(MODULE) && !defined(PVR_LDM_PLATFORM_PRE_REGISTERED) */
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void pvr_devices_unregister(void)
|
||||
{
|
||||
#if defined(MODULE) && !defined(PVR_LDM_PLATFORM_PRE_REGISTERED)
|
||||
unsigned int i;
|
||||
|
||||
BUG_ON(!pvr_devices);
|
||||
|
||||
for (i = 0; i < pvr_num_devices && pvr_devices[i]; i++)
|
||||
platform_device_unregister(pvr_devices[i]);
|
||||
|
||||
kfree(pvr_devices);
|
||||
pvr_devices = NULL;
|
||||
#endif /* defined(MODULE) && !defined(PVR_LDM_PLATFORM_PRE_REGISTERED) */
|
||||
}
|
||||
|
||||
static int pvr_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct drm_device *ddev;
|
||||
int ret;
|
||||
|
||||
DRM_DEBUG_DRIVER("device %p\n", &pdev->dev);
|
||||
|
||||
//zxl:print gpu version on boot time
|
||||
printk("PVR_K: sys.gpvr.version=%s\n",RKVERSION);
|
||||
ddev = drm_dev_alloc(&pvr_drm_platform_driver, &pdev->dev);
|
||||
if (IS_ERR(ddev))
|
||||
return PTR_ERR(ddev);
|
||||
|
||||
//zxl:print gpu version on boot time
|
||||
printk("PVR_K: sys.gpvr.version=%s\n", RKVERSION);
|
||||
|
||||
gpsPVRLDMDev = pdev;
|
||||
|
||||
return drm_platform_init(&pvr_drm_platform_driver, pdev);
|
||||
/*
|
||||
* The load callback, called from drm_dev_register, is deprecated,
|
||||
* because of potential race conditions. Calling the function here,
|
||||
* before calling drm_dev_register, avoids those potential races.
|
||||
*/
|
||||
BUG_ON(pvr_drm_platform_driver.load != NULL);
|
||||
ret = pvr_drm_load(ddev, 0);
|
||||
if (ret)
|
||||
goto err_drm_dev_unref;
|
||||
|
||||
ret = drm_dev_register(ddev, 0);
|
||||
if (ret)
|
||||
goto err_drm_dev_unload;
|
||||
|
||||
return 0;
|
||||
|
||||
err_drm_dev_unload:
|
||||
pvr_drm_unload(ddev);
|
||||
err_drm_dev_unref:
|
||||
drm_dev_unref(ddev);
|
||||
return ret;
|
||||
|
||||
//gpsPVRLDMDev = pdev;
|
||||
|
||||
//return drm_platform_init(&pvr_drm_platform_driver, pdev);
|
||||
}
|
||||
|
||||
static int pvr_remove(struct platform_device *pdev)
|
||||
@@ -172,8 +159,19 @@ static int pvr_remove(struct platform_device *pdev)
|
||||
|
||||
DRM_DEBUG_DRIVER("device %p\n", &pdev->dev);
|
||||
|
||||
drm_put_dev(ddev);
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0))
|
||||
drm_dev_unregister(ddev);
|
||||
|
||||
/* The unload callback, called from drm_dev_unregister, is
|
||||
* deprecated. Call the unload function directly.
|
||||
*/
|
||||
BUG_ON(pvr_drm_platform_driver.unload != NULL);
|
||||
pvr_drm_unload(ddev);
|
||||
|
||||
drm_dev_put(ddev);
|
||||
#else
|
||||
drm_put_dev(ddev);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
2366
drivers/staging/imgtec/pvr_sync_file.c
Normal file
2366
drivers/staging/imgtec/pvr_sync_file.c
Normal file
File diff suppressed because it is too large
Load Diff
@@ -150,6 +150,8 @@ ccflags-$(CONFIG_POWERVR_ROGUE_PDUMP) += -DPDUMP=1
|
||||
# Android native synchronisation
|
||||
pvrsrvkm-$(CONFIG_SYNC) += ../pvr_sync.o
|
||||
|
||||
pvrsrvkm-$(CONFIG_SYNC_FILE) += ../pvr_sync_file.o
|
||||
|
||||
# Generated bridge code
|
||||
pvrsrvkm-y += generated/mm_bridge/server_mm_bridge.o
|
||||
pvrsrvkm-y += generated/mm_bridge/client_mm_direct_bridge.o
|
||||
|
||||
@@ -45,7 +45,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0))
|
||||
#include <linux/sw_sync.h>
|
||||
#else
|
||||
#include <../drivers/staging/android/sw_sync.h>
|
||||
//Warning
|
||||
//#include <../drivers/staging/android/sw_sync.h>
|
||||
#endif
|
||||
#include <linux/file.h>
|
||||
#include <linux/fs.h>
|
||||
@@ -285,7 +286,7 @@ static INLINE void CacheOpStatExecLogHeader(IMG_CHAR szBuffer[PVR_MAX_DEBUG_MESS
|
||||
|
||||
static INLINE void CacheOpStatExecLogWrite(DLLIST_NODE *psNode)
|
||||
{
|
||||
CACHEOP_WORK_ITEM *psCacheOpWorkItem;
|
||||
CACHEOP_WORK_ITEM *psCacheOpWorkItem = NULL;
|
||||
IMG_UINT64 ui64ExecuteTime;
|
||||
IMG_UINT64 ui64QueuedTime;
|
||||
IMG_INT32 i32WriteOffset;
|
||||
@@ -591,7 +592,7 @@ static INLINE void CacheOpCPURangeBased(PVRSRV_DEVICE_NODE *psDevNode,
|
||||
IMG_CPU_PHYADDR sCpuPhyAddrEnd;
|
||||
IMG_CPU_PHYADDR sCpuPhyAddrStart;
|
||||
IMG_DEVMEM_SIZE_T uiRelFlushSize;
|
||||
IMG_DEVMEM_OFFSET_T uiRelFlushOffset;
|
||||
IMG_DEVMEM_OFFSET_T uiRelFlushOffset = 0;
|
||||
IMG_DEVMEM_SIZE_T uiNextPgAlignedOffset;
|
||||
|
||||
/* These quantities allows us to perform cache operations
|
||||
@@ -599,7 +600,6 @@ static INLINE void CacheOpCPURangeBased(PVRSRV_DEVICE_NODE *psDevNode,
|
||||
perform more than is necessary */
|
||||
PVR_ASSERT(uiPgAlignedOffset < uiCLAlignedEndOffset);
|
||||
uiRelFlushSize = (IMG_DEVMEM_SIZE_T)guiOSPageSize;
|
||||
uiRelFlushOffset = 0;
|
||||
|
||||
if (uiCLAlignedStartOffset > uiPgAlignedOffset)
|
||||
{
|
||||
@@ -1705,7 +1705,13 @@ PVRSRV_ERROR CacheOpSetTimeline (IMG_INT32 i32Timeline)
|
||||
return PVRSRV_ERROR_INVALID_PARAMS;
|
||||
}
|
||||
|
||||
sw_sync_timeline_inc(psFile->private_data, 1);
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0)
|
||||
sw_sync_timeline_inc(psFile->private_data, 1);
|
||||
#else
|
||||
//Warning
|
||||
//if (0 != sw_sync_ioctl_inc(psFile->private_data, count))
|
||||
// printk("PVR SW_SYNC_IOC_INC failed \n");
|
||||
#endif
|
||||
fput(psFile);
|
||||
|
||||
eError = PVRSRV_OK;
|
||||
@@ -1985,6 +1991,12 @@ PVRSRV_ERROR CacheOpExec (PMR *psPMR,
|
||||
}
|
||||
|
||||
eError = CacheOpRangeBased(psPMR, uiOffset, uiSize, uiCacheOp, &bUsedGlobalFlush);
|
||||
if (eError != PVRSRV_OK) {
|
||||
PVR_DPF((CACHEOP_DPFL,
|
||||
"%s: CacheOpRangeBased failed (%u)",
|
||||
__FUNCTION__, eError));
|
||||
}
|
||||
|
||||
#if defined(CACHEOP_DEBUG)
|
||||
sCacheOpWorkItem.bUMF = IMG_FALSE;
|
||||
sCacheOpWorkItem.bRBF = !bUsedGlobalFlush;
|
||||
|
||||
84
drivers/staging/imgtec/rogue/connection_data.h
Normal file
84
drivers/staging/imgtec/rogue/connection_data.h
Normal file
@@ -0,0 +1,84 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
|
||||
/* --------------------------------------------------------------------------------------------------------
|
||||
* File: connection_data.h
|
||||
* --------------------------------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef __CONNECTION_DATA_H__
|
||||
#define __CONNECTION_DATA_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------------------
|
||||
* Include Files
|
||||
* ---------------------------------------------------------------------------------------------------------
|
||||
*/
|
||||
// #include <linux/kernel.h>
|
||||
|
||||
#include "handle.h"
|
||||
#include "img_types.h"
|
||||
#include "pvrsrv_cleanup.h"
|
||||
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------------------
|
||||
* Macros Definition
|
||||
* ---------------------------------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------------------
|
||||
* Types and Structures Definition
|
||||
* ---------------------------------------------------------------------------------------------------------
|
||||
*/
|
||||
typedef struct _CONNECTION_DATA_ {
|
||||
PVRSRV_HANDLE_BASE *psHandleBase;
|
||||
PROCESS_HANDLE_BASE *psProcessHandleBase;
|
||||
struct _SYNC_CONNECTION_DATA_ *psSyncConnectionData;
|
||||
struct _PDUMP_CONNECTION_DATA_ *psPDumpConnectionData;
|
||||
|
||||
/* Holds the client flags supplied at connection time */
|
||||
IMG_UINT32 ui32ClientFlags;
|
||||
|
||||
/*
|
||||
* OS specific data can be stored via this handle.
|
||||
* See osconnection_server.h for a generic mechanism
|
||||
* for initialising this field.
|
||||
*/
|
||||
IMG_HANDLE hOsPrivateData;
|
||||
|
||||
IMG_PID pid;
|
||||
|
||||
void *hSecureData;
|
||||
|
||||
IMG_HANDLE hProcessStats;
|
||||
|
||||
IMG_HANDLE hClientTLStream;
|
||||
|
||||
/* Structure which is hooked into the cleanup thread work list */
|
||||
PVRSRV_CLEANUP_THREAD_WORK sCleanupThreadFn;
|
||||
|
||||
/* List navigation for deferred freeing of connection data */
|
||||
struct _CONNECTION_DATA_ **ppsThis;
|
||||
struct _CONNECTION_DATA_ *psNext;
|
||||
} CONNECTION_DATA;
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------------------
|
||||
* Global Functions' Prototype
|
||||
* ---------------------------------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------------------
|
||||
* Inline Functions Implementation
|
||||
* ---------------------------------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __CONNECTION_DATA_H__ */
|
||||
|
||||
@@ -48,6 +48,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#include "img_types.h"
|
||||
#include "handle.h"
|
||||
#include "pvrsrv_cleanup.h"
|
||||
#include "connection_data.h"
|
||||
|
||||
/* Variable used to hold in memory the timeout for the current time slice*/
|
||||
extern IMG_UINT64 gui64TimesliceLimit;
|
||||
@@ -56,39 +57,6 @@ extern IMG_UINT32 gui32HandleDataFreeCounter;
|
||||
/* Set the maximum time the freeing of the resources can keep the lock */
|
||||
#define CONNECTION_DEFERRED_CLEANUP_TIMESLICE_NS 3000 * 1000 /* 3ms */
|
||||
|
||||
typedef struct _CONNECTION_DATA_
|
||||
{
|
||||
PVRSRV_HANDLE_BASE *psHandleBase;
|
||||
PROCESS_HANDLE_BASE *psProcessHandleBase;
|
||||
struct _SYNC_CONNECTION_DATA_ *psSyncConnectionData;
|
||||
struct _PDUMP_CONNECTION_DATA_ *psPDumpConnectionData;
|
||||
|
||||
/* Holds the client flags supplied at connection time */
|
||||
IMG_UINT32 ui32ClientFlags;
|
||||
|
||||
/*
|
||||
* OS specific data can be stored via this handle.
|
||||
* See osconnection_server.h for a generic mechanism
|
||||
* for initialising this field.
|
||||
*/
|
||||
IMG_HANDLE hOsPrivateData;
|
||||
|
||||
IMG_PID pid;
|
||||
|
||||
void *hSecureData;
|
||||
|
||||
IMG_HANDLE hProcessStats;
|
||||
|
||||
IMG_HANDLE hClientTLStream;
|
||||
|
||||
/* Structure which is hooked into the cleanup thread work list */
|
||||
PVRSRV_CLEANUP_THREAD_WORK sCleanupThreadFn;
|
||||
|
||||
/* List navigation for deferred freeing of connection data */
|
||||
struct _CONNECTION_DATA_ **ppsThis;
|
||||
struct _CONNECTION_DATA_ *psNext;
|
||||
} CONNECTION_DATA;
|
||||
|
||||
#include "osconnection_server.h"
|
||||
|
||||
PVRSRV_ERROR PVRSRVConnectionConnect(void **ppvPrivData, void *pvOSData);
|
||||
|
||||
@@ -45,6 +45,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#define __DEVICE_H__
|
||||
|
||||
|
||||
#include "pvrsrv_device_node.h"
|
||||
#include "lock_types.h"
|
||||
#include "devicemem_heapcfg.h"
|
||||
#include "mmu_common.h"
|
||||
#include "ra.h" /* RA_ARENA */
|
||||
@@ -66,98 +68,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
struct pvr_buffer_sync_context;
|
||||
#endif
|
||||
|
||||
typedef struct _PVRSRV_POWER_DEV_TAG_ PVRSRV_POWER_DEV;
|
||||
|
||||
#if defined(PVRSRV_ENABLE_FULL_SYNC_TRACKING)
|
||||
struct SYNC_RECORD;
|
||||
#endif
|
||||
|
||||
/*********************************************************************/ /*!
|
||||
@Function AllocUFOCallback
|
||||
@Description Device specific callback for allocation of an UFO block
|
||||
|
||||
@Input psDeviceNode Pointer to device node to allocate
|
||||
the UFO for.
|
||||
@Output ppsMemDesc Pointer to pointer for the memdesc of
|
||||
the allocation
|
||||
@Output pui32SyncAddr FW Base address of the UFO block
|
||||
@Output puiSyncPrimBlockSize Size of the UFO block
|
||||
|
||||
@Return PVRSRV_OK if allocation was successful
|
||||
*/
|
||||
/*********************************************************************/
|
||||
typedef PVRSRV_ERROR (*AllocUFOBlockCallback)(struct _PVRSRV_DEVICE_NODE_ *psDeviceNode,
|
||||
DEVMEM_MEMDESC **ppsMemDesc,
|
||||
IMG_UINT32 *pui32SyncAddr,
|
||||
IMG_UINT32 *puiSyncPrimBlockSize);
|
||||
|
||||
/*********************************************************************/ /*!
|
||||
@Function FreeUFOCallback
|
||||
@Description Device specific callback for freeing of an UFO
|
||||
|
||||
@Input psDeviceNode Pointer to device node that the UFO block was
|
||||
allocated from.
|
||||
@Input psMemDesc Pointer to pointer for the memdesc of
|
||||
the UFO block to free.
|
||||
*/
|
||||
/*********************************************************************/
|
||||
typedef void (*FreeUFOBlockCallback)(struct _PVRSRV_DEVICE_NODE_ *psDeviceNode,
|
||||
DEVMEM_MEMDESC *psMemDesc);
|
||||
|
||||
typedef struct _PVRSRV_DEVICE_IDENTIFIER_
|
||||
{
|
||||
/* Pdump memory and register bank names */
|
||||
IMG_CHAR *pszPDumpDevName;
|
||||
IMG_CHAR *pszPDumpRegName;
|
||||
} PVRSRV_DEVICE_IDENTIFIER;
|
||||
|
||||
typedef struct _DEVICE_MEMORY_INFO_
|
||||
{
|
||||
/* heap count. Doesn't include additional heaps from PVRSRVCreateDeviceMemHeap */
|
||||
IMG_UINT32 ui32HeapCount;
|
||||
|
||||
/* Blueprints for creating new device memory contexts */
|
||||
IMG_UINT32 uiNumHeapConfigs;
|
||||
DEVMEM_HEAP_CONFIG *psDeviceMemoryHeapConfigArray;
|
||||
DEVMEM_HEAP_BLUEPRINT *psDeviceMemoryHeap;
|
||||
} DEVICE_MEMORY_INFO;
|
||||
|
||||
|
||||
typedef struct _PG_HANDLE_
|
||||
{
|
||||
union
|
||||
{
|
||||
void *pvHandle;
|
||||
IMG_UINT64 ui64Handle;
|
||||
}u;
|
||||
/*Order of the corresponding allocation */
|
||||
IMG_UINT32 ui32Order;
|
||||
} PG_HANDLE;
|
||||
|
||||
#define MMU_BAD_PHYS_ADDR (0xbadbad00badULL)
|
||||
typedef struct __DUMMY_PAGE__
|
||||
{
|
||||
/*Page handle for the dummy page allocated (UMA/LMA)*/
|
||||
PG_HANDLE sDummyPageHandle;
|
||||
POS_LOCK psDummyPgLock;
|
||||
ATOMIC_T atRefCounter;
|
||||
/*Dummy page size in terms of log2 */
|
||||
IMG_UINT32 ui32Log2DummyPgSize;
|
||||
IMG_UINT64 ui64DummyPgPhysAddr;
|
||||
#if defined(PDUMP)
|
||||
#define DUMMY_PAGE ("DUMMY_PAGE")
|
||||
IMG_HANDLE hPdumpDummyPg;
|
||||
#endif
|
||||
} PVRSRV_DUMMY_PAGE ;
|
||||
|
||||
typedef enum _PVRSRV_DEVICE_STATE_
|
||||
{
|
||||
PVRSRV_DEVICE_STATE_UNDEFINED = 0,
|
||||
PVRSRV_DEVICE_STATE_INIT,
|
||||
PVRSRV_DEVICE_STATE_ACTIVE,
|
||||
PVRSRV_DEVICE_STATE_DEINIT,
|
||||
PVRSRV_DEVICE_STATE_BAD,
|
||||
} PVRSRV_DEVICE_STATE;
|
||||
|
||||
typedef enum _PVRSRV_DEVICE_HEALTH_STATUS_
|
||||
{
|
||||
@@ -176,207 +92,6 @@ typedef enum _PVRSRV_DEVICE_HEALTH_REASON_
|
||||
PVRSRV_DEVICE_HEALTH_REASON_QUEUE_STALLED
|
||||
} PVRSRV_DEVICE_HEALTH_REASON;
|
||||
|
||||
typedef PVRSRV_ERROR (*FN_CREATERAMBACKEDPMR)(struct _PVRSRV_DEVICE_NODE_ *psDevNode,
|
||||
IMG_DEVMEM_SIZE_T uiSize,
|
||||
IMG_DEVMEM_SIZE_T uiChunkSize,
|
||||
IMG_UINT32 ui32NumPhysChunks,
|
||||
IMG_UINT32 ui32NumVirtChunks,
|
||||
IMG_UINT32 *pui32MappingTable,
|
||||
IMG_UINT32 uiLog2PageSize,
|
||||
PVRSRV_MEMALLOCFLAGS_T uiFlags,
|
||||
const IMG_CHAR *pszAnnotation,
|
||||
PMR **ppsPMRPtr);
|
||||
|
||||
typedef struct _PVRSRV_DEVICE_NODE_
|
||||
{
|
||||
PVRSRV_DEVICE_IDENTIFIER sDevId;
|
||||
|
||||
PVRSRV_DEVICE_STATE eDevState;
|
||||
ATOMIC_T eHealthStatus; /* Holds values from PVRSRV_DEVICE_HEALTH_STATUS */
|
||||
ATOMIC_T eHealthReason; /* Holds values from PVRSRV_DEVICE_HEALTH_REASON */
|
||||
|
||||
IMG_HANDLE *hDebugTable;
|
||||
|
||||
/* device specific MMU attributes */
|
||||
MMU_DEVICEATTRIBS *psMMUDevAttrs;
|
||||
/* device specific MMU firmware atrributes, used only in some devices*/
|
||||
MMU_DEVICEATTRIBS *psFirmwareMMUDevAttrs;
|
||||
|
||||
/* lock for power state transitions */
|
||||
POS_LOCK hPowerLock;
|
||||
/* current system device power state */
|
||||
PVRSRV_SYS_POWER_STATE eCurrentSysPowerState;
|
||||
PVRSRV_POWER_DEV *psPowerDev;
|
||||
|
||||
/*
|
||||
callbacks the device must support:
|
||||
*/
|
||||
|
||||
FN_CREATERAMBACKEDPMR pfnCreateRamBackedPMR[PVRSRV_DEVICE_PHYS_HEAP_LAST];
|
||||
|
||||
PVRSRV_ERROR (*pfnDevPxAlloc)(struct _PVRSRV_DEVICE_NODE_ *psDevNode, size_t uiSize,
|
||||
PG_HANDLE *psMemHandle, IMG_DEV_PHYADDR *psDevPAddr);
|
||||
|
||||
void (*pfnDevPxFree)(struct _PVRSRV_DEVICE_NODE_ *psDevNode, PG_HANDLE *psMemHandle);
|
||||
|
||||
PVRSRV_ERROR (*pfnDevPxMap)(struct _PVRSRV_DEVICE_NODE_ *psDevNode, PG_HANDLE *pshMemHandle,
|
||||
size_t uiSize, IMG_DEV_PHYADDR *psDevPAddr,
|
||||
void **pvPtr);
|
||||
|
||||
void (*pfnDevPxUnMap)(struct _PVRSRV_DEVICE_NODE_ *psDevNode,
|
||||
PG_HANDLE *psMemHandle, void *pvPtr);
|
||||
|
||||
PVRSRV_ERROR (*pfnDevPxClean)(struct _PVRSRV_DEVICE_NODE_ *psDevNode,
|
||||
PG_HANDLE *pshMemHandle,
|
||||
IMG_UINT32 uiOffset,
|
||||
IMG_UINT32 uiLength);
|
||||
|
||||
IMG_UINT32 uiMMUPxLog2AllocGran;
|
||||
|
||||
void (*pfnMMUCacheInvalidate)(struct _PVRSRV_DEVICE_NODE_ *psDevNode,
|
||||
IMG_HANDLE hDeviceData,
|
||||
MMU_LEVEL eLevel,
|
||||
IMG_BOOL bUnmap);
|
||||
|
||||
PVRSRV_ERROR (*pfnMMUCacheInvalidateKick)(struct _PVRSRV_DEVICE_NODE_ *psDevNode,
|
||||
IMG_UINT32 *pui32NextMMUInvalidateUpdate,
|
||||
IMG_BOOL bInterrupt);
|
||||
|
||||
IMG_UINT32 (*pfnMMUCacheGetInvalidateCounter)(struct _PVRSRV_DEVICE_NODE_ *psDevNode);
|
||||
|
||||
|
||||
void (*pfnDumpDebugInfo)(struct _PVRSRV_DEVICE_NODE_ *psDevNode);
|
||||
|
||||
PVRSRV_ERROR (*pfnUpdateHealthStatus)(struct _PVRSRV_DEVICE_NODE_ *psDevNode,
|
||||
IMG_BOOL bIsTimerPoll);
|
||||
|
||||
PVRSRV_ERROR (*pfnResetHWRLogs)(struct _PVRSRV_DEVICE_NODE_ *psDevNode);
|
||||
|
||||
/* Method to drain device HWPerf packets from firmware buffer to host buffer */
|
||||
PVRSRV_ERROR (*pfnServiceHWPerf)(struct _PVRSRV_DEVICE_NODE_ *psDevNode);
|
||||
|
||||
PVRSRV_ERROR (*pfnDeviceVersionString)(struct _PVRSRV_DEVICE_NODE_ *psDevNode, IMG_CHAR **ppszVersionString);
|
||||
|
||||
PVRSRV_ERROR (*pfnDeviceClockSpeed)(struct _PVRSRV_DEVICE_NODE_ *psDevNode, IMG_PUINT32 pui32RGXClockSpeed);
|
||||
|
||||
PVRSRV_ERROR (*pfnSoftReset)(struct _PVRSRV_DEVICE_NODE_ *psDevNode, IMG_UINT64 ui64ResetValue1, IMG_UINT64 ui64ResetValue2);
|
||||
|
||||
#if defined(SUPPORT_KERNEL_SRVINIT) && defined(RGXFW_ALIGNCHECKS)
|
||||
PVRSRV_ERROR (*pfnAlignmentCheck)(struct _PVRSRV_DEVICE_NODE_ *psDevNode, IMG_UINT32 ui32FWAlignChecksSize, IMG_UINT32 aui32FWAlignChecks[]);
|
||||
#endif
|
||||
IMG_BOOL (*pfnCheckDeviceFeature)(struct _PVRSRV_DEVICE_NODE_ *psDevNode, IMG_UINT64 ui64FeatureMask);
|
||||
|
||||
IMG_INT32 (*pfnGetDeviceFeatureValue)(struct _PVRSRV_DEVICE_NODE_ *psDevNode, IMG_UINT64 ui64FeatureMask);
|
||||
|
||||
PVRSRV_DEVICE_CONFIG *psDevConfig;
|
||||
|
||||
/* device post-finalise compatibility check */
|
||||
PVRSRV_ERROR (*pfnInitDeviceCompatCheck) (struct _PVRSRV_DEVICE_NODE_*);
|
||||
|
||||
/* information about the device's address space and heaps */
|
||||
DEVICE_MEMORY_INFO sDevMemoryInfo;
|
||||
|
||||
/* device's shared-virtual-memory heap size */
|
||||
IMG_UINT64 ui64GeneralSVMHeapSize;
|
||||
|
||||
/* private device information */
|
||||
void *pvDevice;
|
||||
|
||||
|
||||
|
||||
#if defined(SUPPORT_GPUVIRT_VALIDATION)
|
||||
RA_ARENA *psOSidSubArena[GPUVIRT_VALIDATION_NUM_OS];
|
||||
#endif
|
||||
|
||||
|
||||
#define PVRSRV_MAX_RA_NAME_LENGTH (50)
|
||||
RA_ARENA **apsLocalDevMemArenas;
|
||||
IMG_CHAR **apszRANames;
|
||||
IMG_UINT32 ui32NumOfLocalMemArenas;
|
||||
|
||||
#if defined(SUPPORT_PVRSRV_GPUVIRT)
|
||||
IMG_CHAR szKernelFwRAName[RGXFW_NUM_OS][PVRSRV_MAX_RA_NAME_LENGTH];
|
||||
RA_ARENA *psKernelFwMemArena[RGXFW_NUM_OS];
|
||||
IMG_UINT32 uiKernelFwRAIdx;
|
||||
RA_BASE_T ui64RABase[RGXFW_NUM_OS];
|
||||
#endif
|
||||
|
||||
IMG_UINT32 ui32RegisteredPhysHeaps;
|
||||
PHYS_HEAP **papsRegisteredPhysHeaps;
|
||||
|
||||
/*
|
||||
* Pointers to the device's physical memory heap(s)
|
||||
* The first entry (apsPhysHeap[PVRSRV_DEVICE_PHYS_HEAP_GPU_LOCAL]) will be used for allocations
|
||||
* where the PVRSRV_MEMALLOCFLAG_CPU_LOCAL flag is not set. Normally this will be an LMA heap
|
||||
* (but the device configuration could specify a UMA heap here, if desired)
|
||||
* The second entry (apsPhysHeap[PVRSRV_DEVICE_PHYS_HEAP_CPU_LOCAL]) will be used for allocations
|
||||
* where the PVRSRV_MEMALLOCFLAG_CPU_LOCAL flag is set. Normally this will be a UMA heap
|
||||
* (but the configuration could specify an LMA heap here, if desired)
|
||||
* The third entry (apsPhysHeap[PVRSRV_DEVICE_PHYS_HEAP_FW_LOCAL]) will be used for allocations
|
||||
* where the PVRSRV_MEMALLOCFLAG_FW_LOCAL flag is set; this is used when SUPPORT_PVRSRV_GPUVIRT is enabled
|
||||
* The device configuration will always specify two physical heap IDs - in the event of the device
|
||||
* only using one physical heap, both of these IDs will be the same, and hence both pointers below
|
||||
* will also be the same; when SUPPORT_PVRSRV_GPUVIRT is enabled the device configuration specifies
|
||||
* three physical heap IDs, the last being for PVRSRV_DEVICE_PHYS_HEAP_FW_LOCAL allocations
|
||||
*/
|
||||
PHYS_HEAP *apsPhysHeap[PVRSRV_DEVICE_PHYS_HEAP_LAST];
|
||||
|
||||
struct _PVRSRV_DEVICE_NODE_ *psNext;
|
||||
struct _PVRSRV_DEVICE_NODE_ **ppsThis;
|
||||
|
||||
/* Functions for notification about memory contexts */
|
||||
PVRSRV_ERROR (*pfnRegisterMemoryContext)(struct _PVRSRV_DEVICE_NODE_ *psDeviceNode,
|
||||
MMU_CONTEXT *psMMUContext,
|
||||
IMG_HANDLE *hPrivData);
|
||||
void (*pfnUnregisterMemoryContext)(IMG_HANDLE hPrivData);
|
||||
|
||||
/* Functions for allocation/freeing of UFOs */
|
||||
AllocUFOBlockCallback pfnAllocUFOBlock; /*!< Callback for allocation of a block of UFO memory */
|
||||
FreeUFOBlockCallback pfnFreeUFOBlock; /*!< Callback for freeing of a block of UFO memory */
|
||||
|
||||
#if defined(SUPPORT_BUFFER_SYNC)
|
||||
struct pvr_buffer_sync_context *psBufferSyncContext;
|
||||
#endif
|
||||
|
||||
IMG_HANDLE hSyncServerNotify;
|
||||
POS_LOCK hSyncServerListLock;
|
||||
DLLIST_NODE sSyncServerSyncsList;
|
||||
|
||||
#if defined(PVRSRV_ENABLE_FULL_SYNC_TRACKING)
|
||||
IMG_HANDLE hSyncServerRecordNotify;
|
||||
POS_LOCK hSyncServerRecordLock;
|
||||
DLLIST_NODE sSyncServerRecordList;
|
||||
struct SYNC_RECORD *apsSyncServerRecordsFreed[PVRSRV_FULL_SYNC_TRACKING_HISTORY_LEN];
|
||||
IMG_UINT32 uiSyncServerRecordFreeIdx;
|
||||
#endif
|
||||
|
||||
PSYNC_PRIM_CONTEXT hSyncPrimContext;
|
||||
|
||||
PVRSRV_CLIENT_SYNC_PRIM *psSyncPrim;
|
||||
/* With this sync-prim we make sure the MMU cache is flushed
|
||||
* before we free the page table memory */
|
||||
PVRSRV_CLIENT_SYNC_PRIM *psMMUCacheSyncPrim;
|
||||
IMG_UINT32 ui32NextMMUInvalidateUpdate;
|
||||
|
||||
IMG_HANDLE hCmdCompNotify;
|
||||
IMG_HANDLE hDbgReqNotify;
|
||||
IMG_HANDLE hHtbDbgReqNotify;
|
||||
IMG_HANDLE hAppHintDbgReqNotify;
|
||||
|
||||
PVRSRV_DUMMY_PAGE sDummyPage;
|
||||
|
||||
DLLIST_NODE sMemoryContextPageFaultNotifyListHead;
|
||||
|
||||
#if defined(PDUMP)
|
||||
/* device-level callback which is called when pdump.exe starts.
|
||||
* Should be implemented in device-specific init code, e.g. rgxinit.c
|
||||
*/
|
||||
PVRSRV_ERROR (*pfnPDumpInitDevice)(struct _PVRSRV_DEVICE_NODE_ *psDeviceNode);
|
||||
/* device-level callback to return pdump ID associated to a memory context */
|
||||
IMG_UINT32 (*pfnMMUGetContextID)(IMG_HANDLE hDevMemContext);
|
||||
#endif
|
||||
} PVRSRV_DEVICE_NODE;
|
||||
|
||||
PVRSRV_ERROR IMG_CALLCONV PVRSRVDeviceFinalise(PVRSRV_DEVICE_NODE *psDeviceNode,
|
||||
IMG_BOOL bInitSuccessful);
|
||||
|
||||
|
||||
@@ -48,13 +48,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
#include "img_types.h"
|
||||
#include "pvrsrv_error.h"
|
||||
#include "connection_data.h"
|
||||
|
||||
|
||||
|
||||
/* FIXME: Find a better way of defining _PVRSRV_DEVICE_NODE_ */
|
||||
struct _PVRSRV_DEVICE_NODE_;
|
||||
/* FIXME: Find a better way of defining _CONNECTION_DATA_ */
|
||||
struct _CONNECTION_DATA_;
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@@ -44,6 +44,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#include <stddef.h>
|
||||
#include <asm/uaccess.h>
|
||||
|
||||
#include "osfunc.h"
|
||||
#include "img_defs.h"
|
||||
|
||||
#include "cache_km.h"
|
||||
|
||||
@@ -44,6 +44,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#include <stddef.h>
|
||||
#include <asm/uaccess.h>
|
||||
|
||||
#include "osfunc.h"
|
||||
#include "img_defs.h"
|
||||
|
||||
#include "devicemem_history_server.h"
|
||||
|
||||
@@ -44,6 +44,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#include <stddef.h>
|
||||
#include <asm/uaccess.h>
|
||||
|
||||
#include "osfunc.h"
|
||||
#include "img_defs.h"
|
||||
|
||||
#include "physmem_dmabuf.h"
|
||||
|
||||
@@ -44,6 +44,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#include <stddef.h>
|
||||
#include <asm/uaccess.h>
|
||||
|
||||
#include "osfunc.h"
|
||||
#include "img_defs.h"
|
||||
|
||||
#include "htbserver.h"
|
||||
|
||||
@@ -44,6 +44,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#include <stddef.h>
|
||||
#include <asm/uaccess.h>
|
||||
|
||||
#include "osfunc.h"
|
||||
#include "img_defs.h"
|
||||
|
||||
#include "devicemem.h"
|
||||
|
||||
@@ -44,6 +44,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#include <stddef.h>
|
||||
#include <asm/uaccess.h>
|
||||
|
||||
#include "osfunc.h"
|
||||
#include "img_defs.h"
|
||||
|
||||
#include "devicemem_server.h"
|
||||
|
||||
@@ -44,6 +44,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#include <stddef.h>
|
||||
#include <asm/uaccess.h>
|
||||
|
||||
#include "osfunc.h"
|
||||
#include "img_defs.h"
|
||||
|
||||
#include "devicemem_server.h"
|
||||
|
||||
@@ -44,6 +44,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#include <stddef.h>
|
||||
#include <asm/uaccess.h>
|
||||
|
||||
#include "osfunc.h"
|
||||
#include "img_defs.h"
|
||||
|
||||
#include "tlserver.h"
|
||||
|
||||
@@ -44,6 +44,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#include <stddef.h>
|
||||
#include <asm/uaccess.h>
|
||||
|
||||
#include "osfunc.h"
|
||||
#include "img_defs.h"
|
||||
|
||||
#include "rgxcompute.h"
|
||||
|
||||
@@ -44,6 +44,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#include <stddef.h>
|
||||
#include <asm/uaccess.h>
|
||||
|
||||
#include "osfunc.h"
|
||||
#include "img_defs.h"
|
||||
|
||||
#include "rgxhwperf.h"
|
||||
|
||||
@@ -44,6 +44,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#include <stddef.h>
|
||||
#include <asm/uaccess.h>
|
||||
|
||||
#include "osfunc.h"
|
||||
#include "img_defs.h"
|
||||
|
||||
#include "rgxkicksync.h"
|
||||
|
||||
@@ -44,6 +44,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#include <stddef.h>
|
||||
#include <asm/uaccess.h>
|
||||
|
||||
#include "osfunc.h"
|
||||
#include "img_defs.h"
|
||||
|
||||
#include "rgxray.h"
|
||||
|
||||
@@ -44,6 +44,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#include <stddef.h>
|
||||
#include <asm/uaccess.h>
|
||||
|
||||
#include "osfunc.h"
|
||||
#include "img_defs.h"
|
||||
|
||||
#include "rgxta3d.h"
|
||||
|
||||
@@ -44,6 +44,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#include <stddef.h>
|
||||
#include <asm/uaccess.h>
|
||||
|
||||
#include "osfunc.h"
|
||||
#include "img_defs.h"
|
||||
|
||||
#include "rgxtdmtransfer.h"
|
||||
|
||||
@@ -44,6 +44,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#include <stddef.h>
|
||||
#include <asm/uaccess.h>
|
||||
|
||||
#include "osfunc.h"
|
||||
#include "img_defs.h"
|
||||
|
||||
#include "rgxtransfer.h"
|
||||
|
||||
@@ -44,6 +44,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#include <stddef.h>
|
||||
#include <asm/uaccess.h>
|
||||
|
||||
#include "osfunc.h"
|
||||
#include "img_defs.h"
|
||||
|
||||
#include "ri_server.h"
|
||||
|
||||
@@ -44,6 +44,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#include <stddef.h>
|
||||
#include <asm/uaccess.h>
|
||||
|
||||
#include "osfunc.h"
|
||||
#include "img_defs.h"
|
||||
|
||||
#include "srvcore.h"
|
||||
|
||||
@@ -44,6 +44,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#include <stddef.h>
|
||||
#include <asm/uaccess.h>
|
||||
|
||||
#include "osfunc.h"
|
||||
#include "img_defs.h"
|
||||
|
||||
#include "sync.h"
|
||||
|
||||
@@ -44,6 +44,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#include <stddef.h>
|
||||
#include <asm/uaccess.h>
|
||||
|
||||
#include "osfunc.h"
|
||||
#include "img_defs.h"
|
||||
|
||||
#include "sync.h"
|
||||
|
||||
@@ -53,6 +53,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#include "osfunc.h"
|
||||
#include "handle.h"
|
||||
#include "handle_impl.h"
|
||||
#include "allocmem.h"
|
||||
|
||||
@@ -117,6 +117,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
* no parent.
|
||||
*/
|
||||
|
||||
#include "lock_types.h"
|
||||
#include "img_types.h"
|
||||
#include "hash.h"
|
||||
|
||||
|
||||
@@ -45,10 +45,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#define _HASH_H_
|
||||
|
||||
/* include5/ */
|
||||
#include "pvrsrv_error.h"
|
||||
#include "img_types.h"
|
||||
|
||||
/* services/client/include/ or services/server/include/ */
|
||||
#include "osfunc.h"
|
||||
// #include "osfunc.h"
|
||||
|
||||
#if defined (__cplusplus)
|
||||
extern "C" {
|
||||
|
||||
@@ -79,7 +79,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/* services/server/include/ */
|
||||
#include "pmr.h"
|
||||
// #include "pmr.h"
|
||||
#include "pdump.h"
|
||||
#include "pmr_impl.h"
|
||||
#include "pvrsrv_memallocflags.h"
|
||||
#include "powervr/mem_types.h"
|
||||
#include "pdumpdefs.h"
|
||||
|
||||
|
||||
/* include/ */
|
||||
#include "img_types.h"
|
||||
|
||||
@@ -40,6 +40,7 @@ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/ /**************************************************************************/
|
||||
|
||||
#include "osfunc.h"
|
||||
#include "connection_server.h"
|
||||
#include "osconnection_server.h"
|
||||
|
||||
|
||||
@@ -44,7 +44,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#ifndef _OSCONNECTION_SERVER_H_
|
||||
#define _OSCONNECTION_SERVER_H_
|
||||
|
||||
#include "handle.h"
|
||||
// #include "handle.h"
|
||||
#include "pvrsrv_device_node.h"
|
||||
|
||||
|
||||
#if defined(__linux__) || defined(__QNXNTO__) || defined(INTEGRITY_OS)
|
||||
|
||||
@@ -60,6 +60,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#include <linux/capability.h>
|
||||
#include <asm/uaccess.h>
|
||||
#include <linux/spinlock.h>
|
||||
|
||||
#include <linux/sched/clock.h>
|
||||
|
||||
|
||||
#if defined(PVR_LINUX_MISR_USING_WORKQUEUE) || \
|
||||
defined(PVR_LINUX_MISR_USING_PRIVATE_WORKQUEUE) || \
|
||||
defined(PVR_LINUX_TIMERS_USING_WORKQUEUES) || \
|
||||
@@ -68,7 +72,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#include <linux/workqueue.h>
|
||||
#endif
|
||||
#include <linux/kthread.h>
|
||||
#include <asm/atomic.h>
|
||||
#include <linux/atomic.h>
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 5, 0))
|
||||
#include <linux/pfn_t.h>
|
||||
#include <linux/pfn.h>
|
||||
@@ -172,10 +176,10 @@ PVRSRV_ERROR OSPhyContigPagesAlloc(PVRSRV_DEVICE_NODE *psDevNode, size_t uiSize,
|
||||
void OSPhyContigPagesFree(PVRSRV_DEVICE_NODE *psDevNode, PG_HANDLE *psMemHandle)
|
||||
{
|
||||
struct page *psPage = (struct page*) psMemHandle->u.pvHandle;
|
||||
IMG_UINT32 uiSize, uiPageCount=0;
|
||||
//IMG_UINT32 uiPageCount=0;
|
||||
|
||||
uiPageCount = (1 << psMemHandle->ui32Order);
|
||||
uiSize = (uiPageCount * PAGE_SIZE);
|
||||
//uiPageCount = (1 << psMemHandle->ui32Order);
|
||||
//uiSize = (uiPageCount * PAGE_SIZE);
|
||||
|
||||
#if defined(PVRSRV_ENABLE_PROCESS_STATS)
|
||||
#if !defined(PVRSRV_ENABLE_MEMORY_STATS)
|
||||
@@ -489,7 +493,12 @@ static inline IMG_UINT64 KClockns64(void)
|
||||
{
|
||||
ktime_t sTime = ktime_get();
|
||||
|
||||
//ktime_t in 4.19 is defined s64, on 4.4 is defined union ktime.
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0)
|
||||
return sTime.tv64;
|
||||
#else
|
||||
return sTime;
|
||||
#endif
|
||||
}
|
||||
|
||||
PVRSRV_ERROR OSClockMonotonicns64(IMG_UINT64 *pui64Time)
|
||||
@@ -1230,6 +1239,8 @@ IMG_HANDLE OSAddTimer(PFN_TIMER_FUNC pfnTimerFunc, void *pvData, IMG_UINT32 ui32
|
||||
psTimerCBData->ui32Delay = ((HZ * ui32MsTimeout) < 1000)
|
||||
? 1
|
||||
: ((HZ * ui32MsTimeout) / 1000);
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 14, 0)
|
||||
/* initialise object */
|
||||
init_timer(&psTimerCBData->sTimer);
|
||||
|
||||
@@ -1237,6 +1248,10 @@ IMG_HANDLE OSAddTimer(PFN_TIMER_FUNC pfnTimerFunc, void *pvData, IMG_UINT32 ui32
|
||||
psTimerCBData->sTimer.function = (void *)OSTimerCallbackWrapper;
|
||||
psTimerCBData->sTimer.data = (uintptr_t)psTimerCBData;
|
||||
|
||||
#else
|
||||
timer_setup(&psTimerCBData->sTimer, (void *)OSTimerCallbackWrapper, 0);
|
||||
#endif
|
||||
|
||||
return (IMG_HANDLE)(uintptr_t)(ui32i + 1);
|
||||
}
|
||||
|
||||
@@ -1498,19 +1513,19 @@ PVRSRV_ERROR OSCopyFromUser(void *pvProcess,
|
||||
|
||||
IMG_BOOL OSAccessOK(IMG_VERIFY_TEST eVerification, void *pvUserPtr, size_t ui32Bytes)
|
||||
{
|
||||
IMG_INT linuxType;
|
||||
//IMG_INT linuxType;
|
||||
|
||||
if (eVerification == PVR_VERIFY_READ)
|
||||
{
|
||||
linuxType = VERIFY_READ;
|
||||
//linuxType = VERIFY_READ;
|
||||
}
|
||||
else
|
||||
{
|
||||
PVR_ASSERT(eVerification == PVR_VERIFY_WRITE);
|
||||
linuxType = VERIFY_WRITE;
|
||||
//linuxType = VERIFY_WRITE;
|
||||
}
|
||||
|
||||
return access_ok(linuxType, pvUserPtr, ui32Bytes);
|
||||
return access_ok(NULL, pvUserPtr, ui32Bytes);
|
||||
}
|
||||
|
||||
IMG_UINT64 OSDivide64r64(IMG_UINT64 ui64Divident, IMG_UINT32 ui32Divisor, IMG_UINT32 *pui32Remainder)
|
||||
@@ -1759,7 +1774,7 @@ PVRSRV_ERROR OSChangeSparseMemCPUAddrMap(void **psPageArray,
|
||||
*/
|
||||
#endif
|
||||
}
|
||||
eError = PVRSRV_OK;
|
||||
//eError = PVRSRV_OK;
|
||||
}
|
||||
|
||||
if ((psVMA->vm_flags & VM_MIXEDMAP) || bIsLMA)
|
||||
|
||||
@@ -107,7 +107,7 @@ PVRSRV_ERROR OSCPUOperation(PVRSRV_CACHE_OP uiCacheOp)
|
||||
PVR_DPF((PVR_DBG_ERROR,
|
||||
"%s: Global cache operation type %d is invalid",
|
||||
__FUNCTION__, uiCacheOp));
|
||||
eError = PVRSRV_ERROR_INVALID_PARAMS;
|
||||
//eError = PVRSRV_ERROR_INVALID_PARAMS;
|
||||
PVR_ASSERT(0);
|
||||
break;
|
||||
}
|
||||
@@ -121,13 +121,13 @@ void OSFlushCPUCacheRangeKM(PVRSRV_DEVICE_NODE *psDevNode,
|
||||
IMG_CPU_PHYADDR sCPUPhysStart,
|
||||
IMG_CPU_PHYADDR sCPUPhysEnd)
|
||||
{
|
||||
struct dma_map_ops *dma_ops = get_dma_ops(psDevNode->psDevConfig->pvOSDevice);
|
||||
const struct dma_map_ops *dma_ops = get_dma_ops(psDevNode->psDevConfig->pvOSDevice);
|
||||
|
||||
PVR_UNREFERENCED_PARAMETER(pvVirtStart);
|
||||
PVR_UNREFERENCED_PARAMETER(pvVirtEnd);
|
||||
|
||||
dma_ops->sync_single_for_device(NULL, sCPUPhysStart.uiAddr, sCPUPhysEnd.uiAddr - sCPUPhysStart.uiAddr, DMA_TO_DEVICE);
|
||||
dma_ops->sync_single_for_cpu(NULL, sCPUPhysStart.uiAddr, sCPUPhysEnd.uiAddr - sCPUPhysStart.uiAddr, DMA_FROM_DEVICE);
|
||||
dma_ops->sync_single_for_device(psDevNode->psDevConfig->pvOSDevice, sCPUPhysStart.uiAddr, sCPUPhysEnd.uiAddr - sCPUPhysStart.uiAddr, DMA_TO_DEVICE);
|
||||
dma_ops->sync_single_for_cpu(psDevNode->psDevConfig->pvOSDevice, sCPUPhysStart.uiAddr, sCPUPhysEnd.uiAddr - sCPUPhysStart.uiAddr, DMA_FROM_DEVICE);
|
||||
}
|
||||
|
||||
void OSCleanCPUCacheRangeKM(PVRSRV_DEVICE_NODE *psDevNode,
|
||||
@@ -136,12 +136,12 @@ void OSCleanCPUCacheRangeKM(PVRSRV_DEVICE_NODE *psDevNode,
|
||||
IMG_CPU_PHYADDR sCPUPhysStart,
|
||||
IMG_CPU_PHYADDR sCPUPhysEnd)
|
||||
{
|
||||
struct dma_map_ops *dma_ops = get_dma_ops(psDevNode->psDevConfig->pvOSDevice);
|
||||
const struct dma_map_ops *dma_ops = get_dma_ops(psDevNode->psDevConfig->pvOSDevice);
|
||||
|
||||
PVR_UNREFERENCED_PARAMETER(pvVirtStart);
|
||||
PVR_UNREFERENCED_PARAMETER(pvVirtEnd);
|
||||
|
||||
dma_ops->sync_single_for_device(NULL, sCPUPhysStart.uiAddr, sCPUPhysEnd.uiAddr - sCPUPhysStart.uiAddr, DMA_TO_DEVICE);
|
||||
dma_ops->sync_single_for_device(psDevNode->psDevConfig->pvOSDevice, sCPUPhysStart.uiAddr, sCPUPhysEnd.uiAddr - sCPUPhysStart.uiAddr, DMA_TO_DEVICE);
|
||||
}
|
||||
|
||||
void OSInvalidateCPUCacheRangeKM(PVRSRV_DEVICE_NODE *psDevNode,
|
||||
@@ -150,12 +150,12 @@ void OSInvalidateCPUCacheRangeKM(PVRSRV_DEVICE_NODE *psDevNode,
|
||||
IMG_CPU_PHYADDR sCPUPhysStart,
|
||||
IMG_CPU_PHYADDR sCPUPhysEnd)
|
||||
{
|
||||
struct dma_map_ops *dma_ops = get_dma_ops(psDevNode->psDevConfig->pvOSDevice);
|
||||
const struct dma_map_ops *dma_ops = get_dma_ops(psDevNode->psDevConfig->pvOSDevice);
|
||||
|
||||
PVR_UNREFERENCED_PARAMETER(pvVirtStart);
|
||||
PVR_UNREFERENCED_PARAMETER(pvVirtEnd);
|
||||
|
||||
dma_ops->sync_single_for_cpu(NULL, sCPUPhysStart.uiAddr, sCPUPhysEnd.uiAddr - sCPUPhysStart.uiAddr, DMA_FROM_DEVICE);
|
||||
dma_ops->sync_single_for_cpu(psDevNode->psDevConfig->pvOSDevice, sCPUPhysStart.uiAddr, sCPUPhysEnd.uiAddr - sCPUPhysStart.uiAddr, DMA_FROM_DEVICE);
|
||||
}
|
||||
|
||||
PVRSRV_CACHE_OP_ADDR_TYPE OSCPUCacheOpAddressType(PVRSRV_CACHE_OP uiCacheOp)
|
||||
|
||||
@@ -81,7 +81,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
* and using our dmabuf.
|
||||
*/
|
||||
|
||||
static int PVRDmaBufOpsAttach(struct dma_buf *psDmaBuf, struct device *psDev,
|
||||
static int PVRDmaBufOpsAttach(struct dma_buf *psDmaBuf,
|
||||
struct dma_buf_attachment *psAttachment)
|
||||
{
|
||||
return -ENOSYS;
|
||||
@@ -123,8 +123,13 @@ static const struct dma_buf_ops sPVRDmaBufOps =
|
||||
.map_dma_buf = PVRDmaBufOpsMap,
|
||||
.unmap_dma_buf = PVRDmaBufOpsUnmap,
|
||||
.release = PVRDmaBufOpsRelease,
|
||||
.kmap_atomic = PVRDmaBufOpsKMap,
|
||||
.kmap = PVRDmaBufOpsKMap,
|
||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0))
|
||||
//.map_atomic = PVRDmaBufOpsKMap,
|
||||
.map = PVRDmaBufOpsKMap,
|
||||
#else
|
||||
.kmap_atomic = PVRDmaBufOpsKMap,
|
||||
.kmap = PVRDmaBufOpsKMap,
|
||||
#endif
|
||||
.mmap = PVRDmaBufOpsMMap,
|
||||
};
|
||||
|
||||
@@ -553,7 +558,6 @@ PhysmemCreateNewDmaBufBackedPMR(PVRSRV_DEVICE_NODE *psDevNode,
|
||||
|
||||
psPrivData->ui32PhysPageCount = ui32PageCount;
|
||||
psPrivData->psSgTable = table;
|
||||
ui32PageCount = 0;
|
||||
sg = table->sgl;
|
||||
uiSglOffset = 0;
|
||||
|
||||
|
||||
@@ -57,6 +57,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#define _SRVSRV_PMR_H_
|
||||
|
||||
/* include/ */
|
||||
#include "pvrsrv_device_node.h"
|
||||
#include "img_types.h"
|
||||
#include "pdumpdefs.h"
|
||||
#include "pvrsrv_error.h"
|
||||
@@ -69,6 +70,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
/* services/server/include/ */
|
||||
#include "pmr_impl.h"
|
||||
#include "physheap.h"
|
||||
#include "connection_data.h"
|
||||
|
||||
#define PMR_MAX_TRANSLATION_STACK_ALLOC (32)
|
||||
|
||||
@@ -96,9 +98,6 @@ typedef struct _PMR_EXPORT_ PMR_EXPORT;
|
||||
|
||||
typedef struct _PMR_PAGELIST_ PMR_PAGELIST;
|
||||
|
||||
typedef struct _CONNECTION_DATA_ CONNECTION_DATA;
|
||||
typedef struct _PVRSRV_DEVICE_NODE_ PVRSRV_DEVICE_NODE;
|
||||
|
||||
/*
|
||||
* PMRCreatePMR
|
||||
*
|
||||
|
||||
@@ -48,6 +48,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#define _SRVSRV_PMR_IMPL_H_
|
||||
|
||||
/* include/ */
|
||||
#include "powervr/mem_types.h"
|
||||
#include "pvrsrv_memallocflags.h"
|
||||
#include "img_types.h"
|
||||
#include "pvrsrv_error.h"
|
||||
|
||||
|
||||
@@ -43,14 +43,13 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#ifndef POWER_H
|
||||
#define POWER_H
|
||||
|
||||
#include "device.h"
|
||||
#include "img_defs.h"
|
||||
#include "img_types.h"
|
||||
#include "pvrsrv_device.h"
|
||||
#include "pvrsrv_error.h"
|
||||
#include "servicesext.h"
|
||||
|
||||
typedef struct _PVRSRV_DEVICE_NODE_ PVRSRV_DEVICE_NODE;
|
||||
|
||||
#if !defined(SUPPORT_KERNEL_SRVINIT)
|
||||
typedef enum _PVRSRV_INIT_SERVER_STATE_
|
||||
{
|
||||
@@ -76,8 +75,6 @@ PVRSRVSetInitServerState(PVRSRV_INIT_SERVER_STATE eInitServerState,
|
||||
* Power management
|
||||
*****************************************************************************/
|
||||
|
||||
typedef struct _PVRSRV_POWER_DEV_TAG_ PVRSRV_POWER_DEV;
|
||||
|
||||
typedef IMG_BOOL (*PFN_SYS_DEV_IS_DEFAULT_STATE_OFF)(PVRSRV_POWER_DEV *psPowerDevice);
|
||||
|
||||
IMG_IMPORT IMG_BOOL IsSystemStatePowered(PVRSRV_DEVICE_NODE *psDeviceNode);
|
||||
|
||||
81
drivers/staging/imgtec/rogue/psync_checkpoint.h
Normal file
81
drivers/staging/imgtec/rogue/psync_checkpoint.h
Normal file
@@ -0,0 +1,81 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
|
||||
/* --------------------------------------------------------------------------------------------------------
|
||||
* File: psync_checkpoint.h
|
||||
* --------------------------------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __PSYNC_CHECKPOINT_H__
|
||||
#define __PSYNC_CHECKPOINT_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------------------
|
||||
* Include Files
|
||||
* ---------------------------------------------------------------------------------------------------------
|
||||
*/
|
||||
#include "psync_checkpoint_context.h"
|
||||
#include "sync_checkpoint_internal_fw.h"
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------------------
|
||||
* Macros Definition
|
||||
* ---------------------------------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------------------
|
||||
* Types and Structures Definition
|
||||
* ---------------------------------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
typedef struct _SYNC_CHECKPOINT_BLOCK_ {
|
||||
ATOMIC_T hRefCount; /*!< Ref count for this sync block */
|
||||
_SYNC_CHECKPOINT_CONTEXT *psContext; /*!< Our copy of the services connection */
|
||||
PVRSRV_DEVICE_NODE *psDevNode;
|
||||
IMG_UINT32 ui32SyncBlockSize; /*!< Size of the sync checkpoint block */
|
||||
IMG_UINT32 ui32FirmwareAddr; /*!< Firmware address */
|
||||
DEVMEM_MEMDESC *hMemDesc; /*!< DevMem allocation for block */
|
||||
volatile IMG_UINT32 *pui32LinAddr; /*!< Server-code CPU mapping */
|
||||
IMG_UINT64 uiSpanBase; /*!< Base of this import (FW DevMem) in the span RA */
|
||||
DLLIST_NODE sListNode; /*!< List node for the sync chkpt block list */
|
||||
} SYNC_CHECKPOINT_BLOCK;
|
||||
|
||||
// .CP :
|
||||
typedef struct _SYNC_CHECKPOINT_ {
|
||||
/* A sync checkpoint is assigned a unique ID, to avoid any confusion should
|
||||
* the same memory be re-used later for a different checkpoint
|
||||
*/
|
||||
IMG_UINT32 ui32UID; /*!< Unique ID assigned to sync checkpoint (to distinguish checkpoints if memory is re-used)*/
|
||||
ATOMIC_T hRefCount; /*!< Ref count for this sync */
|
||||
ATOMIC_T hEnqueuedCCBCount; /*!< Num times sync has been put in CCBs */
|
||||
SYNC_CHECKPOINT_BLOCK *psSyncCheckpointBlock; /*!< Synchronisation block this checkpoint is allocated on */
|
||||
IMG_UINT64 uiSpanAddr; /*!< Span address of the sync */
|
||||
volatile _SYNC_CHECKPOINT_FW_OBJ *psSyncCheckpointFwObj; /*!< CPU view of the data held in the sync block */
|
||||
IMG_CHAR azName[SYNC_CHECKPOINT_NAME_SIZE]; /*!< Name of the checkpoint */
|
||||
#if defined(PVRSRV_ENABLE_FULL_SYNC_TRACKING)
|
||||
PSYNC_CHECKPOINT_RECORD_HANDLE hRecord; /*!< Sync record handle */
|
||||
#endif
|
||||
DLLIST_NODE sListNode; /*!< List node for the sync chkpt list */
|
||||
} _SYNC_CHECKPOINT;
|
||||
typedef struct _SYNC_CHECKPOINT *PSYNC_CHECKPOINT;
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------------------
|
||||
* Global Functions' Prototype
|
||||
* ---------------------------------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------------------
|
||||
* Inline Functions Implementation
|
||||
* ---------------------------------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __PSYNC_CHECKPOINT_H__ */
|
||||
|
||||
76
drivers/staging/imgtec/rogue/psync_checkpoint_context.h
Normal file
76
drivers/staging/imgtec/rogue/psync_checkpoint_context.h
Normal file
@@ -0,0 +1,76 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
|
||||
/* --------------------------------------------------------------------------------------------------------
|
||||
* File: psync_checkpoint_context.h
|
||||
* --------------------------------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __PSYNC_CHECKPOINT_CONTEXT_H__
|
||||
#define __PSYNC_CHECKPOINT_CONTEXT_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------------------
|
||||
* Include Files
|
||||
* ---------------------------------------------------------------------------------------------------------
|
||||
*/
|
||||
#include <linux/kernel.h>
|
||||
|
||||
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------------------
|
||||
* Macros Definition
|
||||
* ---------------------------------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#define SYNC_CHECKPOINT_MAX_CLASS_NAME_LEN 32
|
||||
|
||||
#define SYNC_CHECKPOINT_NAME_SIZE SYNC_CHECKPOINT_MAX_CLASS_NAME_LEN
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------------------
|
||||
* Types and Structures Definition
|
||||
* ---------------------------------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
typedef struct _SYNC_CHECKPOINT_CONTEXT_ {
|
||||
PVRSRV_DEVICE_NODE *psDevNode;
|
||||
IMG_CHAR azName[SYNC_CHECKPOINT_NAME_SIZE]; /*!< Name of the RA */
|
||||
RA_ARENA *psSubAllocRA; /*!< RA context */
|
||||
IMG_CHAR azSpanName[SYNC_CHECKPOINT_NAME_SIZE]; /*!< Name of the span RA */
|
||||
RA_ARENA *psSpanRA; /*!< RA used for span management of SubAllocRA */
|
||||
ATOMIC_T hRefCount; /*!< Ref count for this context */
|
||||
ATOMIC_T hCheckpointCount; /*!< Checkpoint count for this context */
|
||||
POS_LOCK hCheckpointListLock; /*!< Checkpoint list lock */
|
||||
DLLIST_NODE sCheckpointList; /*!< List of checkpoints created on this context */
|
||||
IMG_HANDLE hCheckpointNotify; /*!< Handle for debug notifier callback */
|
||||
#if defined(PVRSRV_ENABLE_FULL_SYNC_TRACKING)
|
||||
POS_LOCK hCheckpointRecordLock;
|
||||
DLLIST_NODE sCheckpointRecordList;
|
||||
struct SYNC_CHECKPOINT_RECORD *apsCheckpointRecordsFreed[PVRSRV_FULL_SYNC_TRACKING_HISTORY_LEN];
|
||||
IMG_UINT32 uiCheckpointRecordFreeIdx;
|
||||
IMG_HANDLE hCheckpointRecordNotify;
|
||||
#endif
|
||||
} _SYNC_CHECKPOINT_CONTEXT;
|
||||
typedef struct _SYNC_CHECKPOINT_CONTEXT *PSYNC_CHECKPOINT_CONTEXT;
|
||||
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------------------
|
||||
* Global Functions' Prototype
|
||||
* ---------------------------------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------------------
|
||||
* Inline Functions Implementation
|
||||
* ---------------------------------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __PSYNC_CHECKPOINT_CONTEXT_H__ */
|
||||
|
||||
@@ -68,39 +68,6 @@ static struct mutex gDebugFSLock;
|
||||
Statistic entry read functions
|
||||
*/ /**************************************************************************/
|
||||
|
||||
#if defined(PVRSRV_ENABLE_MEMTRACK_STATS_FILE)
|
||||
typedef struct _PVR_DEBUGFS_RAW_DRIVER_STAT_
|
||||
{
|
||||
OS_STATS_PRINT_FUNC *pfStatsPrint;
|
||||
PVR_DEBUGFS_ENTRY_DATA *pvDebugFsEntry;
|
||||
} PVR_DEBUGFS_RAW_DRIVER_STAT;
|
||||
#endif
|
||||
|
||||
typedef struct _PVR_DEBUGFS_DRIVER_STAT_
|
||||
{
|
||||
void *pvData;
|
||||
OS_STATS_PRINT_FUNC *pfnStatsPrint;
|
||||
PVRSRV_INC_STAT_MEM_REFCOUNT_FUNC *pfnIncStatMemRefCount;
|
||||
PVRSRV_DEC_STAT_MEM_REFCOUNT_FUNC *pfnDecStatMemRefCount;
|
||||
IMG_UINT32 ui32RefCount;
|
||||
PVR_DEBUGFS_ENTRY_DATA *pvDebugFSEntry;
|
||||
} PVR_DEBUGFS_DRIVER_STAT;
|
||||
|
||||
typedef struct _PVR_DEBUGFS_DIR_DATA_
|
||||
{
|
||||
struct dentry *psDir;
|
||||
PVR_DEBUGFS_DIR_DATA *psParentDir;
|
||||
IMG_UINT32 ui32RefCount;
|
||||
} PVR_DEBUGFS_DIR_DATA;
|
||||
|
||||
typedef struct _PVR_DEBUGFS_ENTRY_DATA_
|
||||
{
|
||||
struct dentry *psEntry;
|
||||
PVR_DEBUGFS_DIR_DATA *psParentDir;
|
||||
IMG_UINT32 ui32RefCount;
|
||||
PVR_DEBUGFS_DRIVER_STAT *psStatData;
|
||||
} PVR_DEBUGFS_ENTRY_DATA;
|
||||
|
||||
typedef struct _PVR_DEBUGFS_PRIV_DATA_
|
||||
{
|
||||
const struct seq_operations *psReadOps;
|
||||
|
||||
@@ -61,11 +61,35 @@ typedef IMG_UINT32 (PVRSRV_DEC_STAT_MEM_REFCOUNT_FUNC)(void *pvStatPtr);
|
||||
typedef IMG_UINT32 (PVRSRV_INC_FSENTRY_PVDATA_REFCNT_FN)(void *pvData);
|
||||
typedef IMG_UINT32 (PVRSRV_DEC_FSENTRY_PVDATA_REFCNT_FN)(void *pvData);
|
||||
|
||||
typedef struct _PVR_DEBUGFS_DIR_DATA_ PVR_DEBUGFS_DIR_DATA;
|
||||
typedef struct _PVR_DEBUGFS_ENTRY_DATA_ PVR_DEBUGFS_ENTRY_DATA;
|
||||
typedef struct _PVR_DEBUGFS_DRIVER_STAT_ PVR_DEBUGFS_DRIVER_STAT;
|
||||
typedef struct _PVR_DEBUGFS_DIR_DATA_ {
|
||||
struct dentry *psDir;
|
||||
struct _PVR_DEBUGFS_DIR_DATA_ *psParentDir;
|
||||
IMG_UINT32 ui32RefCount;
|
||||
} PVR_DEBUGFS_DIR_DATA;
|
||||
|
||||
struct _PVR_DEBUGFS_ENTRY_DATA_;
|
||||
|
||||
typedef struct _PVR_DEBUGFS_DRIVER_STAT_ {
|
||||
void *pvData;
|
||||
OS_STATS_PRINT_FUNC *pfnStatsPrint;
|
||||
PVRSRV_INC_STAT_MEM_REFCOUNT_FUNC *pfnIncStatMemRefCount;
|
||||
PVRSRV_DEC_STAT_MEM_REFCOUNT_FUNC *pfnDecStatMemRefCount;
|
||||
IMG_UINT32 ui32RefCount;
|
||||
struct _PVR_DEBUGFS_ENTRY_DATA_ *pvDebugFSEntry;
|
||||
} PVR_DEBUGFS_DRIVER_STAT;
|
||||
|
||||
typedef struct _PVR_DEBUGFS_ENTRY_DATA_ {
|
||||
struct dentry *psEntry;
|
||||
PVR_DEBUGFS_DIR_DATA *psParentDir;
|
||||
IMG_UINT32 ui32RefCount;
|
||||
PVR_DEBUGFS_DRIVER_STAT *psStatData;
|
||||
} PVR_DEBUGFS_ENTRY_DATA;
|
||||
|
||||
#if defined(PVRSRV_ENABLE_MEMTRACK_STATS_FILE)
|
||||
typedef struct _PVR_DEBUGFS_RAW_DRIVER_STAT_ PVR_DEBUGFS_RAW_DRIVER_STAT;
|
||||
typedef struct _PVR_DEBUGFS_RAW_DRIVER_STAT_ {
|
||||
OS_STATS_PRINT_FUNC *pfStatsPrint;
|
||||
PVR_DEBUGFS_ENTRY_DATA *pvDebugFsEntry;
|
||||
} PVR_DEBUGFS_RAW_DRIVER_STAT;
|
||||
#endif
|
||||
|
||||
int PVRDebugFSInit(void);
|
||||
|
||||
@@ -70,8 +70,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
#include "pvrsrv_device.h"
|
||||
#include "syscommon.h"
|
||||
#include "rgxdevice.h"
|
||||
#include "rgxinit.h"
|
||||
#include "rgxdevice.h"
|
||||
#include "pvr_dvfs_device.h"
|
||||
#include "power.h"
|
||||
|
||||
@@ -247,7 +247,7 @@ static int GetOPPValues(struct device *dev,
|
||||
#if defined(CHROMIUMOS_WORKAROUNDS_KERNEL318)
|
||||
unsigned long *freq_table;
|
||||
#else
|
||||
unsigned int *freq_table;
|
||||
unsigned long *freq_table;
|
||||
#endif
|
||||
|
||||
/* Start RCU read-side critical section to access device opp_list. */
|
||||
@@ -478,7 +478,6 @@ PVRSRV_ERROR InitDVFS(PVRSRV_DEVICE_NODE *psDeviceNode)
|
||||
if (eError != PVRSRV_OK)
|
||||
{
|
||||
PVR_DPF((PVR_DBG_ERROR,"PVRSRVInit: Failed to suspend DVFS"));
|
||||
eError = eError;
|
||||
goto err_exit;
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,10 @@ Command Complete Notifier Interface
|
||||
*/ /***************************************************************************/
|
||||
|
||||
typedef IMG_HANDLE PVRSRV_CMDCOMP_HANDLE;
|
||||
#ifndef _CMDCOMPNOTIFY_PFN_
|
||||
typedef void (*PFN_CMDCOMP_NOTIFY)(PVRSRV_CMDCOMP_HANDLE hCmdCompHandle);
|
||||
#define _CMDCOMPNOTIFY_PFN_
|
||||
#endif
|
||||
|
||||
/**************************************************************************/ /*!
|
||||
@Function PVRSRVCmdCompleteInit
|
||||
@@ -147,12 +150,19 @@ Debug Notifier Interface
|
||||
struct _PVRSRV_DEVICE_NODE_;
|
||||
|
||||
typedef IMG_HANDLE PVRSRV_DBGREQ_HANDLE;
|
||||
#ifndef _DUMPDEBUG_PRINTF_FUNC_
|
||||
typedef void (DUMPDEBUG_PRINTF_FUNC)(void *pvDumpDebugFile,
|
||||
const IMG_CHAR *pszFormat, ...);
|
||||
#define _DUMPDEBUG_PRINTF_FUNC_
|
||||
#endif
|
||||
|
||||
#ifndef _PFN_DBGREQ_NOTIFY_
|
||||
typedef void (*PFN_DBGREQ_NOTIFY)(PVRSRV_DBGREQ_HANDLE hDebugRequestHandle,
|
||||
IMG_UINT32 ui32VerbLevel,
|
||||
DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
|
||||
void *pvDumpDebugFile);
|
||||
#define _PFN_DBGREQ_NOTIFY_
|
||||
#endif
|
||||
|
||||
|
||||
/**************************************************************************/ /*!
|
||||
|
||||
@@ -42,7 +42,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#ifndef __PVR_UACCESS_H__
|
||||
#define __PVR_UACCESS_H__
|
||||
|
||||
#include <asm/uaccess.h>
|
||||
#include <linux/uaccess.h>
|
||||
|
||||
static inline unsigned long pvr_copy_to_user(void __user *pvTo, const void *pvFrom, unsigned long ulBytes)
|
||||
{
|
||||
|
||||
@@ -43,6 +43,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#ifndef PVRSRV_CLEANUP_H
|
||||
#define PVRSRV_CLEANUP_H
|
||||
|
||||
#include "dllist.h"
|
||||
|
||||
typedef PVRSRV_ERROR (*CLEANUP_THREAD_FN)(void *pvParam);
|
||||
|
||||
/* typical number of times a caller should want the work to be retried in case
|
||||
|
||||
338
drivers/staging/imgtec/rogue/pvrsrv_device_node.h
Normal file
338
drivers/staging/imgtec/rogue/pvrsrv_device_node.h
Normal file
@@ -0,0 +1,338 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
|
||||
/* --------------------------------------------------------------------------------------------------------
|
||||
* File: pvrsrv_device_node.h
|
||||
* --------------------------------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef __PVRSRV_DEVICE_NODE_H__
|
||||
#define __PVRSRV_DEVICE_NODE_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------------------
|
||||
* Include Files
|
||||
* ---------------------------------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include "powervr/sync_external.h"
|
||||
#include "ra.h"
|
||||
#include "devicemem_heapcfg.h"
|
||||
#include "pvrsrv_device.h"
|
||||
#include "mmu_common.h"
|
||||
#include "img_types.h"
|
||||
#include "lock_types.h"
|
||||
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------------------
|
||||
* Macros Definition
|
||||
* ---------------------------------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------------------
|
||||
* Types and Structures Definition
|
||||
* ---------------------------------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
typedef struct _PG_HANDLE_ {
|
||||
union {
|
||||
void *pvHandle;
|
||||
IMG_UINT64 ui64Handle;
|
||||
} u;
|
||||
/*Order of the corresponding allocation */
|
||||
IMG_UINT32 ui32Order;
|
||||
} PG_HANDLE;
|
||||
|
||||
typedef PVRSRV_ERROR (*FN_CREATERAMBACKEDPMR)(struct _PVRSRV_DEVICE_NODE_ *psDevNode,
|
||||
IMG_DEVMEM_SIZE_T uiSize,
|
||||
IMG_DEVMEM_SIZE_T uiChunkSize,
|
||||
IMG_UINT32 ui32NumPhysChunks,
|
||||
IMG_UINT32 ui32NumVirtChunks,
|
||||
IMG_UINT32 *pui32MappingTable,
|
||||
IMG_UINT32 uiLog2PageSize,
|
||||
PVRSRV_MEMALLOCFLAGS_T uiFlags,
|
||||
const IMG_CHAR *pszAnnotation,
|
||||
PMR **ppsPMRPtr);
|
||||
|
||||
|
||||
typedef struct _PVRSRV_POWER_DEV_TAG_ PVRSRV_POWER_DEV;
|
||||
|
||||
typedef enum _PVRSRV_DEVICE_STATE_ {
|
||||
PVRSRV_DEVICE_STATE_UNDEFINED = 0,
|
||||
PVRSRV_DEVICE_STATE_INIT,
|
||||
PVRSRV_DEVICE_STATE_ACTIVE,
|
||||
PVRSRV_DEVICE_STATE_DEINIT,
|
||||
PVRSRV_DEVICE_STATE_BAD,
|
||||
} PVRSRV_DEVICE_STATE;
|
||||
|
||||
typedef struct _PVRSRV_DEVICE_IDENTIFIER_ {
|
||||
/* Pdump memory and register bank names */
|
||||
IMG_CHAR *pszPDumpDevName;
|
||||
IMG_CHAR *pszPDumpRegName;
|
||||
} PVRSRV_DEVICE_IDENTIFIER;
|
||||
|
||||
typedef struct _DEVICE_MEMORY_INFO_ {
|
||||
/* heap count. Doesn't include additional heaps from PVRSRVCreateDeviceMemHeap */
|
||||
IMG_UINT32 ui32HeapCount;
|
||||
|
||||
/* Blueprints for creating new device memory contexts */
|
||||
IMG_UINT32 uiNumHeapConfigs;
|
||||
DEVMEM_HEAP_CONFIG *psDeviceMemoryHeapConfigArray;
|
||||
DEVMEM_HEAP_BLUEPRINT *psDeviceMemoryHeap;
|
||||
} DEVICE_MEMORY_INFO;
|
||||
|
||||
/*********************************************************************/ /*!
|
||||
@Function AllocUFOCallback
|
||||
@Description Device specific callback for allocation of an UFO block
|
||||
|
||||
@Input psDeviceNode Pointer to device node to allocate
|
||||
the UFO for.
|
||||
@Output ppsMemDesc Pointer to pointer for the memdesc of
|
||||
the allocation
|
||||
@Output pui32SyncAddr FW Base address of the UFO block
|
||||
@Output puiSyncPrimBlockSize Size of the UFO block
|
||||
|
||||
@Return PVRSRV_OK if allocation was successful
|
||||
*/
|
||||
/*********************************************************************/
|
||||
typedef PVRSRV_ERROR (*AllocUFOBlockCallback)(struct _PVRSRV_DEVICE_NODE_ *psDeviceNode,
|
||||
DEVMEM_MEMDESC **ppsMemDesc,
|
||||
IMG_UINT32 *pui32SyncAddr,
|
||||
IMG_UINT32 *puiSyncPrimBlockSize);
|
||||
|
||||
/*********************************************************************/ /*!
|
||||
@Function FreeUFOCallback
|
||||
@Description Device specific callback for freeing of an UFO
|
||||
|
||||
@Input psDeviceNode Pointer to device node that the UFO block was
|
||||
allocated from.
|
||||
@Input psMemDesc Pointer to pointer for the memdesc of
|
||||
the UFO block to free.
|
||||
*/
|
||||
/*********************************************************************/
|
||||
typedef void (*FreeUFOBlockCallback)(struct _PVRSRV_DEVICE_NODE_ *psDeviceNode,
|
||||
DEVMEM_MEMDESC *psMemDesc);
|
||||
|
||||
typedef struct __DUMMY_PAGE__ {
|
||||
/*Page handle for the dummy page allocated (UMA/LMA)*/
|
||||
PG_HANDLE sDummyPageHandle;
|
||||
POS_LOCK psDummyPgLock;
|
||||
ATOMIC_T atRefCounter;
|
||||
/*Dummy page size in terms of log2 */
|
||||
IMG_UINT32 ui32Log2DummyPgSize;
|
||||
IMG_UINT64 ui64DummyPgPhysAddr;
|
||||
#if defined(PDUMP)
|
||||
#define DUMMY_PAGE ("DUMMY_PAGE")
|
||||
IMG_HANDLE hPdumpDummyPg;
|
||||
#endif
|
||||
} PVRSRV_DUMMY_PAGE ;
|
||||
|
||||
// .CP :
|
||||
typedef struct _PVRSRV_DEVICE_NODE_ {
|
||||
PVRSRV_DEVICE_IDENTIFIER sDevId;
|
||||
|
||||
PVRSRV_DEVICE_STATE eDevState;
|
||||
ATOMIC_T eHealthStatus; /* Holds values from PVRSRV_DEVICE_HEALTH_STATUS */
|
||||
ATOMIC_T eHealthReason; /* Holds values from PVRSRV_DEVICE_HEALTH_REASON */
|
||||
|
||||
IMG_HANDLE *hDebugTable;
|
||||
|
||||
/* device specific MMU attributes */
|
||||
MMU_DEVICEATTRIBS *psMMUDevAttrs;
|
||||
/* device specific MMU firmware atrributes, used only in some devices*/
|
||||
MMU_DEVICEATTRIBS *psFirmwareMMUDevAttrs;
|
||||
|
||||
/* lock for power state transitions */
|
||||
POS_LOCK hPowerLock;
|
||||
/* current system device power state */
|
||||
PVRSRV_SYS_POWER_STATE eCurrentSysPowerState;
|
||||
PVRSRV_POWER_DEV *psPowerDev;
|
||||
|
||||
/*
|
||||
callbacks the device must support:
|
||||
*/
|
||||
|
||||
FN_CREATERAMBACKEDPMR pfnCreateRamBackedPMR[PVRSRV_DEVICE_PHYS_HEAP_LAST];
|
||||
|
||||
PVRSRV_ERROR (*pfnDevPxAlloc)(struct _PVRSRV_DEVICE_NODE_ *psDevNode, size_t uiSize,
|
||||
PG_HANDLE *psMemHandle, IMG_DEV_PHYADDR *psDevPAddr);
|
||||
|
||||
void (*pfnDevPxFree)(struct _PVRSRV_DEVICE_NODE_ *psDevNode, PG_HANDLE *psMemHandle);
|
||||
|
||||
PVRSRV_ERROR (*pfnDevPxMap)(struct _PVRSRV_DEVICE_NODE_ *psDevNode, PG_HANDLE *pshMemHandle,
|
||||
size_t uiSize, IMG_DEV_PHYADDR *psDevPAddr,
|
||||
void **pvPtr);
|
||||
|
||||
void (*pfnDevPxUnMap)(struct _PVRSRV_DEVICE_NODE_ *psDevNode,
|
||||
PG_HANDLE *psMemHandle, void *pvPtr);
|
||||
|
||||
PVRSRV_ERROR (*pfnDevPxClean)(struct _PVRSRV_DEVICE_NODE_ *psDevNode,
|
||||
PG_HANDLE *pshMemHandle,
|
||||
IMG_UINT32 uiOffset,
|
||||
IMG_UINT32 uiLength);
|
||||
|
||||
IMG_UINT32 uiMMUPxLog2AllocGran;
|
||||
|
||||
void (*pfnMMUCacheInvalidate)(struct _PVRSRV_DEVICE_NODE_ *psDevNode,
|
||||
IMG_HANDLE hDeviceData,
|
||||
MMU_LEVEL eLevel,
|
||||
IMG_BOOL bUnmap);
|
||||
|
||||
PVRSRV_ERROR (*pfnMMUCacheInvalidateKick)(struct _PVRSRV_DEVICE_NODE_ *psDevNode,
|
||||
IMG_UINT32 *pui32NextMMUInvalidateUpdate,
|
||||
IMG_BOOL bInterrupt);
|
||||
|
||||
IMG_UINT32 (*pfnMMUCacheGetInvalidateCounter)(struct _PVRSRV_DEVICE_NODE_ *psDevNode);
|
||||
|
||||
void (*pfnDumpDebugInfo)(struct _PVRSRV_DEVICE_NODE_ *psDevNode);
|
||||
|
||||
PVRSRV_ERROR (*pfnUpdateHealthStatus)(struct _PVRSRV_DEVICE_NODE_ *psDevNode,
|
||||
IMG_BOOL bIsTimerPoll);
|
||||
|
||||
PVRSRV_ERROR (*pfnResetHWRLogs)(struct _PVRSRV_DEVICE_NODE_ *psDevNode);
|
||||
|
||||
/* Method to drain device HWPerf packets from firmware buffer to host buffer */
|
||||
PVRSRV_ERROR (*pfnServiceHWPerf)(struct _PVRSRV_DEVICE_NODE_ *psDevNode);
|
||||
|
||||
PVRSRV_ERROR (*pfnDeviceVersionString)(struct _PVRSRV_DEVICE_NODE_ *psDevNode, IMG_CHAR **ppszVersionString);
|
||||
|
||||
PVRSRV_ERROR (*pfnDeviceClockSpeed)(struct _PVRSRV_DEVICE_NODE_ *psDevNode, IMG_PUINT32 pui32RGXClockSpeed);
|
||||
|
||||
PVRSRV_ERROR (*pfnSoftReset)(struct _PVRSRV_DEVICE_NODE_ *psDevNode, IMG_UINT64 ui64ResetValue1, IMG_UINT64 ui64ResetValue2);
|
||||
|
||||
#if defined(SUPPORT_KERNEL_SRVINIT) && defined(RGXFW_ALIGNCHECKS)
|
||||
PVRSRV_ERROR (*pfnAlignmentCheck)(struct _PVRSRV_DEVICE_NODE_ *psDevNode, IMG_UINT32 ui32FWAlignChecksSize, IMG_UINT32 aui32FWAlignChecks[]);
|
||||
#endif
|
||||
IMG_BOOL (*pfnCheckDeviceFeature)(struct _PVRSRV_DEVICE_NODE_ *psDevNode, IMG_UINT64 ui64FeatureMask);
|
||||
|
||||
IMG_INT32 (*pfnGetDeviceFeatureValue)(struct _PVRSRV_DEVICE_NODE_ *psDevNode, IMG_UINT64 ui64FeatureMask);
|
||||
|
||||
PVRSRV_DEVICE_CONFIG *psDevConfig;
|
||||
|
||||
/* device post-finalise compatibility check */
|
||||
PVRSRV_ERROR (*pfnInitDeviceCompatCheck)(struct _PVRSRV_DEVICE_NODE_ *);
|
||||
|
||||
/* information about the device's address space and heaps */
|
||||
DEVICE_MEMORY_INFO sDevMemoryInfo;
|
||||
|
||||
/* device's shared-virtual-memory heap size */
|
||||
IMG_UINT64 ui64GeneralSVMHeapSize;
|
||||
|
||||
/* private device information */
|
||||
void *pvDevice;
|
||||
|
||||
|
||||
|
||||
#if defined(SUPPORT_GPUVIRT_VALIDATION)
|
||||
RA_ARENA *psOSidSubArena[GPUVIRT_VALIDATION_NUM_OS];
|
||||
#endif
|
||||
|
||||
|
||||
#define PVRSRV_MAX_RA_NAME_LENGTH (50)
|
||||
RA_ARENA **apsLocalDevMemArenas;
|
||||
IMG_CHAR **apszRANames;
|
||||
IMG_UINT32 ui32NumOfLocalMemArenas;
|
||||
|
||||
#if defined(SUPPORT_PVRSRV_GPUVIRT)
|
||||
IMG_CHAR szKernelFwRAName[RGXFW_NUM_OS][PVRSRV_MAX_RA_NAME_LENGTH];
|
||||
RA_ARENA *psKernelFwMemArena[RGXFW_NUM_OS];
|
||||
IMG_UINT32 uiKernelFwRAIdx;
|
||||
RA_BASE_T ui64RABase[RGXFW_NUM_OS];
|
||||
#endif
|
||||
|
||||
IMG_UINT32 ui32RegisteredPhysHeaps;
|
||||
PHYS_HEAP **papsRegisteredPhysHeaps;
|
||||
|
||||
/*
|
||||
* Pointers to the device's physical memory heap(s)
|
||||
* The first entry (apsPhysHeap[PVRSRV_DEVICE_PHYS_HEAP_GPU_LOCAL]) will be used for allocations
|
||||
* where the PVRSRV_MEMALLOCFLAG_CPU_LOCAL flag is not set. Normally this will be an LMA heap
|
||||
* (but the device configuration could specify a UMA heap here, if desired)
|
||||
* The second entry (apsPhysHeap[PVRSRV_DEVICE_PHYS_HEAP_CPU_LOCAL]) will be used for allocations
|
||||
* where the PVRSRV_MEMALLOCFLAG_CPU_LOCAL flag is set. Normally this will be a UMA heap
|
||||
* (but the configuration could specify an LMA heap here, if desired)
|
||||
* The third entry (apsPhysHeap[PVRSRV_DEVICE_PHYS_HEAP_FW_LOCAL]) will be used for allocations
|
||||
* where the PVRSRV_MEMALLOCFLAG_FW_LOCAL flag is set; this is used when SUPPORT_PVRSRV_GPUVIRT is enabled
|
||||
* The device configuration will always specify two physical heap IDs - in the event of the device
|
||||
* only using one physical heap, both of these IDs will be the same, and hence both pointers below
|
||||
* will also be the same; when SUPPORT_PVRSRV_GPUVIRT is enabled the device configuration specifies
|
||||
* three physical heap IDs, the last being for PVRSRV_DEVICE_PHYS_HEAP_FW_LOCAL allocations
|
||||
*/
|
||||
PHYS_HEAP *apsPhysHeap[PVRSRV_DEVICE_PHYS_HEAP_LAST];
|
||||
|
||||
struct _PVRSRV_DEVICE_NODE_ *psNext;
|
||||
struct _PVRSRV_DEVICE_NODE_ **ppsThis;
|
||||
|
||||
/* Functions for notification about memory contexts */
|
||||
PVRSRV_ERROR (*pfnRegisterMemoryContext)(struct _PVRSRV_DEVICE_NODE_ *psDeviceNode,
|
||||
MMU_CONTEXT *psMMUContext,
|
||||
IMG_HANDLE *hPrivData);
|
||||
void (*pfnUnregisterMemoryContext)(IMG_HANDLE hPrivData);
|
||||
|
||||
/* Functions for allocation/freeing of UFOs */
|
||||
AllocUFOBlockCallback pfnAllocUFOBlock; /*!< Callback for allocation of a block of UFO memory */
|
||||
FreeUFOBlockCallback pfnFreeUFOBlock; /*!< Callback for freeing of a block of UFO memory */
|
||||
|
||||
#if defined(SUPPORT_BUFFER_SYNC)
|
||||
struct pvr_buffer_sync_context *psBufferSyncContext;
|
||||
#endif
|
||||
|
||||
IMG_HANDLE hSyncServerNotify;
|
||||
POS_LOCK hSyncServerListLock;
|
||||
DLLIST_NODE sSyncServerSyncsList;
|
||||
|
||||
#if defined(PVRSRV_ENABLE_FULL_SYNC_TRACKING)
|
||||
IMG_HANDLE hSyncServerRecordNotify;
|
||||
POS_LOCK hSyncServerRecordLock;
|
||||
DLLIST_NODE sSyncServerRecordList;
|
||||
struct SYNC_RECORD *apsSyncServerRecordsFreed[PVRSRV_FULL_SYNC_TRACKING_HISTORY_LEN];
|
||||
IMG_UINT32 uiSyncServerRecordFreeIdx;
|
||||
#endif
|
||||
|
||||
PSYNC_PRIM_CONTEXT hSyncPrimContext;
|
||||
|
||||
PVRSRV_CLIENT_SYNC_PRIM *psSyncPrim;
|
||||
/* With this sync-prim we make sure the MMU cache is flushed
|
||||
* before we free the page table memory */
|
||||
PVRSRV_CLIENT_SYNC_PRIM *psMMUCacheSyncPrim;
|
||||
IMG_UINT32 ui32NextMMUInvalidateUpdate;
|
||||
|
||||
IMG_HANDLE hCmdCompNotify;
|
||||
IMG_HANDLE hDbgReqNotify;
|
||||
IMG_HANDLE hHtbDbgReqNotify;
|
||||
IMG_HANDLE hAppHintDbgReqNotify;
|
||||
|
||||
PVRSRV_DUMMY_PAGE sDummyPage;
|
||||
|
||||
DLLIST_NODE sMemoryContextPageFaultNotifyListHead;
|
||||
|
||||
#if defined(PDUMP)
|
||||
/* device-level callback which is called when pdump.exe starts.
|
||||
* Should be implemented in device-specific init code, e.g. rgxinit.c
|
||||
*/
|
||||
PVRSRV_ERROR (*pfnPDumpInitDevice)(struct _PVRSRV_DEVICE_NODE_ *psDeviceNode);
|
||||
/* device-level callback to return pdump ID associated to a memory context */
|
||||
IMG_UINT32 (*pfnMMUGetContextID)(IMG_HANDLE hDevMemContext);
|
||||
#endif
|
||||
} PVRSRV_DEVICE_NODE;
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------------------
|
||||
* Global Functions' Prototype
|
||||
* ---------------------------------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------------------
|
||||
* Inline Functions Implementation
|
||||
* ---------------------------------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __PVRSRV_DEVICE_NODE_H__ */
|
||||
|
||||
@@ -1276,7 +1276,7 @@ void RGXHWPerfHostDeInit(void)
|
||||
if (gpsRgxDevInfo && gpsRgxDevInfo->hLockHWPerfHostStream)
|
||||
{
|
||||
OSLockDestroy(gpsRgxDevInfo->hLockHWPerfHostStream);
|
||||
gpsRgxDevInfo->hLockHWPerfHostStream = IMG_FALSE;
|
||||
gpsRgxDevInfo->hLockHWPerfHostStream = NULL;
|
||||
}
|
||||
|
||||
/* Clear global RGX device reference */
|
||||
|
||||
@@ -46,7 +46,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
being otherwise cluttered by the contents of the latter */
|
||||
|
||||
#ifndef _SRVKM_RGXMIPSMMUINIT_H_
|
||||
#define _SRVKM_RGXMMIPSMUINIT_H_
|
||||
#define _SRVKM_RGXMIPSMMUINIT_H_
|
||||
|
||||
#include "device.h"
|
||||
#include "img_types.h"
|
||||
|
||||
@@ -249,7 +249,7 @@ void SysDevDeInit(PVRSRV_DEVICE_CONFIG *psDevConfig)
|
||||
PVRSRV_ERROR SysInstallDeviceLISR(IMG_HANDLE hSysData,
|
||||
IMG_UINT32 ui32IRQ,
|
||||
const IMG_CHAR *pszName,
|
||||
PFN_LISR pfnLISR,
|
||||
SYS_PFN_LISR pfnLISR,
|
||||
void *pvData,
|
||||
IMG_HANDLE *phLISRData)
|
||||
{
|
||||
|
||||
@@ -62,7 +62,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
rem = do_div(t, USEC_PER_SEC); \
|
||||
})
|
||||
|
||||
void trace_fence_update_enabled_callback(void);
|
||||
int trace_fence_update_enabled_callback(void);
|
||||
void trace_fence_update_disabled_callback(void);
|
||||
|
||||
TRACE_EVENT_FN(rogue_fence_update,
|
||||
@@ -105,7 +105,7 @@ TRACE_EVENT_FN(rogue_fence_update,
|
||||
trace_fence_update_disabled_callback
|
||||
);
|
||||
|
||||
void trace_fence_check_enabled_callback(void);
|
||||
int trace_fence_check_enabled_callback(void);
|
||||
void trace_fence_check_disabled_callback(void);
|
||||
|
||||
TRACE_EVENT_FN(rogue_fence_check,
|
||||
|
||||
70
drivers/staging/imgtec/rogue/server_sync_primitive.h
Normal file
70
drivers/staging/imgtec/rogue/server_sync_primitive.h
Normal file
@@ -0,0 +1,70 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 */
|
||||
|
||||
/* --------------------------------------------------------------------------------------------------------
|
||||
* File: server_sync_primitive.h
|
||||
* --------------------------------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
#ifndef __SERVER_SYNC_PRIMITIVE_H__
|
||||
#define __SERVER_SYNC_PRIMITIVE_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------------------
|
||||
* Include Files
|
||||
* ---------------------------------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include "lock_types.h"
|
||||
#include "dllist.h"
|
||||
#include "powervr/sync_external.h"
|
||||
#include "pvrsrv_device_node.h"
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------------------
|
||||
* Macros Definition
|
||||
* ---------------------------------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------------------
|
||||
* Types and Structures Definition
|
||||
* ---------------------------------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
struct _SERVER_SYNC_PRIMITIVE_ {
|
||||
PVRSRV_DEVICE_NODE *psDevNode;
|
||||
PVRSRV_CLIENT_SYNC_PRIM *psSync;
|
||||
IMG_UINT32 ui32NextOp;
|
||||
IMG_UINT32 ui32RefCount;
|
||||
IMG_UINT32 ui32UID;
|
||||
IMG_UINT32 ui32LastSyncRequesterID;
|
||||
DLLIST_NODE sNode;
|
||||
/* PDump only data */
|
||||
IMG_BOOL bSWOperation;
|
||||
IMG_BOOL bSWOpStartedInCaptRange;
|
||||
IMG_UINT32 ui32LastHWUpdate;
|
||||
IMG_BOOL bPDumped;
|
||||
POS_LOCK hLock;
|
||||
IMG_CHAR szClassName[SYNC_MAX_CLASS_NAME_LEN];
|
||||
};
|
||||
typedef struct _SERVER_SYNC_PRIMITIVE_ SERVER_SYNC_PRIMITIVE;
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------------------
|
||||
* Global Functions' Prototype
|
||||
* ---------------------------------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
/* ---------------------------------------------------------------------------------------------------------
|
||||
* Inline Functions Implementation
|
||||
* ---------------------------------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __SERVER_SYNC_PRIMITIVE_H__ */
|
||||
|
||||
@@ -44,6 +44,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#ifndef _SYNC_CHECKPOINT_
|
||||
#define _SYNC_CHECKPOINT_
|
||||
|
||||
#include "psync_checkpoint.h"
|
||||
#include "psync_checkpoint_context.h"
|
||||
#include "img_types.h"
|
||||
#include "pvrsrv_error.h"
|
||||
#include "pvrsrv_sync_km.h"
|
||||
@@ -53,13 +55,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
#include "device_connection.h"
|
||||
|
||||
typedef struct _PVRSRV_DEVICE_NODE_ PVRSRV_DEVICE_NODE;
|
||||
|
||||
typedef struct _SYNC_CHECKPOINT_CONTEXT *PSYNC_CHECKPOINT_CONTEXT;
|
||||
|
||||
typedef struct _SYNC_CHECKPOINT *PSYNC_CHECKPOINT;
|
||||
|
||||
|
||||
/*************************************************************************/ /*!
|
||||
@Function SyncCheckpointContextCreate
|
||||
|
||||
|
||||
@@ -45,11 +45,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#ifndef _SYNC_CHECKPOINT_EXTERNAL_
|
||||
#define _SYNC_CHECKPOINT_EXTERNAL_
|
||||
|
||||
#define SYNC_CHECKPOINT_MAX_CLASS_NAME_LEN 32
|
||||
|
||||
typedef struct _SYNC_CHECKPOINT_CONTEXT *PSYNC_CHECKPOINT_CONTEXT;
|
||||
|
||||
typedef struct _SYNC_CHECKPOINT *PSYNC_CHECKPOINT;
|
||||
#include "psync_checkpoint.h"
|
||||
#include "psync_checkpoint_context.h"
|
||||
|
||||
/* PVRSRV_SYNC_CHECKPOINT states.
|
||||
* The OS native sync implementation should call pfnIsSignalled() to determine if a
|
||||
|
||||
@@ -45,6 +45,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#ifndef __SYNC_CHECKPOINT__
|
||||
#define __SYNC_CHECKPOINT__
|
||||
|
||||
#include "pvrsrv_device_node.h"
|
||||
#include "psync_checkpoint.h"
|
||||
#include "psync_checkpoint_context.h"
|
||||
#include "img_types.h"
|
||||
#include "sync_checkpoint_internal_fw.h"
|
||||
#include "sync_checkpoint.h"
|
||||
@@ -53,8 +56,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#include "lock.h"
|
||||
#include "devicemem.h"
|
||||
|
||||
typedef struct _PVRSRV_DEVICE_NODE_ PVRSRV_DEVICE_NODE;
|
||||
|
||||
#if defined(PVRSRV_ENABLE_FULL_SYNC_TRACKING)
|
||||
struct SYNC_CHECKPOINT_RECORD;
|
||||
#endif
|
||||
@@ -62,62 +63,9 @@ struct SYNC_CHECKPOINT_RECORD;
|
||||
/*
|
||||
Private structures
|
||||
*/
|
||||
#define SYNC_CHECKPOINT_NAME_SIZE SYNC_CHECKPOINT_MAX_CLASS_NAME_LEN
|
||||
|
||||
typedef struct _SYNC_CHECKPOINT_CONTEXT_
|
||||
{
|
||||
PVRSRV_DEVICE_NODE *psDevNode;
|
||||
IMG_CHAR azName[SYNC_CHECKPOINT_NAME_SIZE]; /*!< Name of the RA */
|
||||
RA_ARENA *psSubAllocRA; /*!< RA context */
|
||||
IMG_CHAR azSpanName[SYNC_CHECKPOINT_NAME_SIZE]; /*!< Name of the span RA */
|
||||
RA_ARENA *psSpanRA; /*!< RA used for span management of SubAllocRA */
|
||||
ATOMIC_T hRefCount; /*!< Ref count for this context */
|
||||
ATOMIC_T hCheckpointCount; /*!< Checkpoint count for this context */
|
||||
POS_LOCK hCheckpointListLock; /*!< Checkpoint list lock */
|
||||
DLLIST_NODE sCheckpointList; /*!< List of checkpoints created on this context */
|
||||
IMG_HANDLE hCheckpointNotify; /*!< Handle for debug notifier callback */
|
||||
#if defined(PVRSRV_ENABLE_FULL_SYNC_TRACKING)
|
||||
POS_LOCK hCheckpointRecordLock;
|
||||
DLLIST_NODE sCheckpointRecordList;
|
||||
struct SYNC_CHECKPOINT_RECORD *apsCheckpointRecordsFreed[PVRSRV_FULL_SYNC_TRACKING_HISTORY_LEN];
|
||||
IMG_UINT32 uiCheckpointRecordFreeIdx;
|
||||
IMG_HANDLE hCheckpointRecordNotify;
|
||||
#endif
|
||||
} _SYNC_CHECKPOINT_CONTEXT;
|
||||
|
||||
typedef struct _SYNC_CHECKPOINT_BLOCK_
|
||||
{
|
||||
ATOMIC_T hRefCount; /*!< Ref count for this sync block */
|
||||
_SYNC_CHECKPOINT_CONTEXT *psContext; /*!< Our copy of the services connection */
|
||||
PVRSRV_DEVICE_NODE *psDevNode;
|
||||
IMG_UINT32 ui32SyncBlockSize; /*!< Size of the sync checkpoint block */
|
||||
IMG_UINT32 ui32FirmwareAddr; /*!< Firmware address */
|
||||
DEVMEM_MEMDESC *hMemDesc; /*!< DevMem allocation for block */
|
||||
volatile IMG_UINT32 *pui32LinAddr; /*!< Server-code CPU mapping */
|
||||
IMG_UINT64 uiSpanBase; /*!< Base of this import (FW DevMem) in the span RA */
|
||||
DLLIST_NODE sListNode; /*!< List node for the sync chkpt block list */
|
||||
} SYNC_CHECKPOINT_BLOCK;
|
||||
|
||||
typedef struct SYNC_CHECKPOINT_RECORD* PSYNC_CHECKPOINT_RECORD_HANDLE;
|
||||
|
||||
typedef struct _SYNC_CHECKPOINT_
|
||||
{
|
||||
/* A sync checkpoint is assigned a unique ID, to avoid any confusion should
|
||||
* the same memory be re-used later for a different checkpoint
|
||||
*/
|
||||
IMG_UINT32 ui32UID; /*!< Unique ID assigned to sync checkpoint (to distinguish checkpoints if memory is re-used)*/
|
||||
ATOMIC_T hRefCount; /*!< Ref count for this sync */
|
||||
ATOMIC_T hEnqueuedCCBCount; /*!< Num times sync has been put in CCBs */
|
||||
SYNC_CHECKPOINT_BLOCK *psSyncCheckpointBlock; /*!< Synchronisation block this checkpoint is allocated on */
|
||||
IMG_UINT64 uiSpanAddr; /*!< Span address of the sync */
|
||||
volatile _SYNC_CHECKPOINT_FW_OBJ *psSyncCheckpointFwObj; /*!< CPU view of the data held in the sync block */
|
||||
IMG_CHAR azName[SYNC_CHECKPOINT_NAME_SIZE]; /*!< Name of the checkpoint */
|
||||
#if defined(PVRSRV_ENABLE_FULL_SYNC_TRACKING)
|
||||
PSYNC_CHECKPOINT_RECORD_HANDLE hRecord; /*!< Sync record handle */
|
||||
#endif
|
||||
DLLIST_NODE sListNode; /*!< List node for the sync chkpt list */
|
||||
} _SYNC_CHECKPOINT;
|
||||
|
||||
/*************************************************************************/ /*!
|
||||
@Function SyncCheckpointGetFirmwareAddr
|
||||
|
||||
|
||||
@@ -80,24 +80,6 @@ struct _SYNC_PRIMITIVE_BLOCK_
|
||||
PRGXFWIF_UFO_ADDR uiFWAddr; /*!< The firmware address of the sync prim block */
|
||||
};
|
||||
|
||||
struct _SERVER_SYNC_PRIMITIVE_
|
||||
{
|
||||
PVRSRV_DEVICE_NODE *psDevNode;
|
||||
PVRSRV_CLIENT_SYNC_PRIM *psSync;
|
||||
IMG_UINT32 ui32NextOp;
|
||||
IMG_UINT32 ui32RefCount;
|
||||
IMG_UINT32 ui32UID;
|
||||
IMG_UINT32 ui32LastSyncRequesterID;
|
||||
DLLIST_NODE sNode;
|
||||
/* PDump only data */
|
||||
IMG_BOOL bSWOperation;
|
||||
IMG_BOOL bSWOpStartedInCaptRange;
|
||||
IMG_UINT32 ui32LastHWUpdate;
|
||||
IMG_BOOL bPDumped;
|
||||
POS_LOCK hLock;
|
||||
IMG_CHAR szClassName[SYNC_MAX_CLASS_NAME_LEN];
|
||||
};
|
||||
|
||||
struct _SERVER_SYNC_EXPORT_
|
||||
{
|
||||
SERVER_SYNC_PRIMITIVE *psSync;
|
||||
|
||||
@@ -41,6 +41,7 @@ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/ /***************************************************************************/
|
||||
|
||||
#include "server_sync_primitive.h"
|
||||
#include "img_types.h"
|
||||
#include "device.h"
|
||||
#include "devicemem.h"
|
||||
@@ -52,7 +53,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#define _SYNC_SERVER_H_
|
||||
|
||||
typedef struct _SERVER_OP_COOKIE_ SERVER_OP_COOKIE;
|
||||
typedef struct _SERVER_SYNC_PRIMITIVE_ SERVER_SYNC_PRIMITIVE;
|
||||
typedef struct _SYNC_PRIMITIVE_BLOCK_ SYNC_PRIMITIVE_BLOCK;
|
||||
typedef struct _SERVER_SYNC_EXPORT_ SERVER_SYNC_EXPORT;
|
||||
typedef struct _SYNC_CONNECTION_DATA_ SYNC_CONNECTION_DATA;
|
||||
|
||||
@@ -44,8 +44,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#ifndef _SYNC_SERVER_INTERNAL_H_
|
||||
#define _SYNC_SERVER_INTERNAL_H_
|
||||
|
||||
#include "server_sync_primitive.h"
|
||||
#include "img_types.h"
|
||||
|
||||
typedef struct _SERVER_SYNC_PRIMITIVE_ SERVER_SYNC_PRIMITIVE;
|
||||
|
||||
#endif /*_SYNC_SERVER_INTERNAL_H_ */
|
||||
|
||||
@@ -50,7 +50,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#include "pvrsrv_device.h"
|
||||
#include "pvrsrv_error.h"
|
||||
|
||||
typedef IMG_BOOL (*PFN_LISR)(void *pvData);
|
||||
typedef IMG_BOOL (*SYS_PFN_LISR)(void *pvData);
|
||||
|
||||
/**************************************************************************/ /*!
|
||||
@Function SysDevInit
|
||||
@@ -107,7 +107,7 @@ PVRSRV_ERROR SysDebugInfo(PVRSRV_DEVICE_CONFIG *psDevConfig,
|
||||
PVRSRV_ERROR SysInstallDeviceLISR(IMG_HANDLE hSysData,
|
||||
IMG_UINT32 ui32IRQ,
|
||||
const IMG_CHAR *pszName,
|
||||
PFN_LISR pfnLISR,
|
||||
SYS_PFN_LISR pfnLISR,
|
||||
void *pvData,
|
||||
IMG_HANDLE *phLISRData);
|
||||
|
||||
|
||||
@@ -66,9 +66,11 @@ bool trace_rogue_are_fence_checks_traced(void)
|
||||
* simply a no-op, there is no harm in it.
|
||||
*/
|
||||
|
||||
void trace_fence_update_enabled_callback(void)
|
||||
int trace_fence_update_enabled_callback(void)
|
||||
{
|
||||
fence_update_event_enabled = true;
|
||||
//Warning
|
||||
return 0;
|
||||
}
|
||||
|
||||
void trace_fence_update_disabled_callback(void)
|
||||
@@ -76,9 +78,11 @@ void trace_fence_update_disabled_callback(void)
|
||||
fence_update_event_enabled = false;
|
||||
}
|
||||
|
||||
void trace_fence_check_enabled_callback(void)
|
||||
int trace_fence_check_enabled_callback(void)
|
||||
{
|
||||
fence_check_event_enabled = true;
|
||||
//Warning
|
||||
return 0;
|
||||
}
|
||||
|
||||
void trace_fence_check_disabled_callback(void)
|
||||
|
||||
@@ -91,7 +91,10 @@ struct SYNC_PRIM_CONTEXT;
|
||||
|
||||
/* pvr_notifier.h */
|
||||
|
||||
#ifndef _CMDCOMPNOTIFY_PFN_
|
||||
typedef void (*PFN_CMDCOMP_NOTIFY)(void *hCmdCompHandle);
|
||||
#define _CMDCOMPNOTIFY_PFN_
|
||||
#endif
|
||||
enum PVRSRV_ERROR PVRSRVRegisterCmdCompleteNotify(void **phNotify,
|
||||
PFN_CMDCOMP_NOTIFY pfnCmdCompleteNotify, void *hPrivData);
|
||||
enum PVRSRV_ERROR PVRSRVUnregisterCmdCompleteNotify(void *hNotify);
|
||||
@@ -111,13 +114,20 @@ void PVRSRVCheckStatus(void *hCmdCompCallerHandle);
|
||||
#define DEBUG_REQUEST_VERBOSITY_HIGH 2
|
||||
#define DEBUG_REQUEST_VERBOSITY_MAX DEBUG_REQUEST_VERBOSITY_HIGH
|
||||
|
||||
#ifndef _DUMPDEBUG_PRINTF_FUNC_
|
||||
typedef void (DUMPDEBUG_PRINTF_FUNC)(void *pvDumpDebugFile,
|
||||
const char *fmt, ...) __printf(2, 3);
|
||||
#define _DUMPDEBUG_PRINTF_FUNC_
|
||||
#endif
|
||||
|
||||
#ifndef _PFN_DBGREQ_NOTIFY_
|
||||
typedef void (*PFN_DBGREQ_NOTIFY) (void *hDebugRequestHandle,
|
||||
__u32 ui32VerbLevel,
|
||||
DUMPDEBUG_PRINTF_FUNC *pfnDumpDebugPrintf,
|
||||
void *pvDumpDebugFile);
|
||||
#define _PFN_DBGREQ_NOTIFY_
|
||||
#endif
|
||||
|
||||
enum PVRSRV_ERROR PVRSRVRegisterDbgRequestNotify(void **phNotify,
|
||||
struct _PVRSRV_DEVICE_NODE_ *psDevNode,
|
||||
PFN_DBGREQ_NOTIFY pfnDbgRequestNotify,
|
||||
|
||||
Reference in New Issue
Block a user