aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLCPD Auto Merger2020-06-19 15:33:57 -0500
committerLCPD Auto Merger2020-06-19 15:33:57 -0500
commit68f160383714b291431d734133a416eacc193a0a (patch)
treee9e75ce351b735039a1c0b35c19e80dc1229bcea
parentca80e2ad4700d85df39c095f83d108064bb9c2ff (diff)
parentccf5eae2002900c7dae1a1ef83b10d435b962f76 (diff)
downloadkernel-ti-android-linux-5.4.y.tar.gz
kernel-ti-android-linux-5.4.y.tar.xz
kernel-ti-android-linux-5.4.y.zip
Merged TI feature ti_android into ti-android-linux-5.4.yti-android-linux-5.4.y
TI-Feature: ti_android TI-Branch: android-feature-ti-linux-5.4.y * 'android-feature-ti-linux-5.4.y' of ssh://bitbucket.itg.ti.com/android/kernel: drivers: gpu: Add PowerVR SGX544 driver Signed-off-by: LCPD Auto Merger <lcpd_integration@list.ti.com>
-rw-r--r--drivers/gpu/Makefile1
-rw-r--r--drivers/gpu/pvr/Kconfig7
-rw-r--r--drivers/gpu/pvr/Makefile70
-rw-r--r--drivers/gpu/pvr/config_kernel_am57x.h53
-rw-r--r--drivers/gpu/pvr/include4/dbgdrvif.h382
-rw-r--r--drivers/gpu/pvr/include4/img_defs.h227
-rw-r--r--drivers/gpu/pvr/include4/img_types.h231
-rw-r--r--drivers/gpu/pvr/include4/kernel_types.h136
-rw-r--r--drivers/gpu/pvr/include4/pdumpdefs.h127
-rw-r--r--drivers/gpu/pvr/include4/pvr_debug.h283
-rw-r--r--drivers/gpu/pvr/include4/pvr_sync_user.h137
-rw-r--r--drivers/gpu/pvr/include4/pvrmodule.h48
-rw-r--r--drivers/gpu/pvr/include4/pvrversion.h68
-rw-r--r--drivers/gpu/pvr/include4/services.h1641
-rw-r--r--drivers/gpu/pvr/include4/servicesext.h980
-rw-r--r--drivers/gpu/pvr/include4/sgx_options.h245
-rw-r--r--drivers/gpu/pvr/include4/sgxapi_km.h554
-rw-r--r--drivers/gpu/pvr/include4/sgxscript.h108
-rw-r--r--drivers/gpu/pvr/services4/include/env/linux/pvr_drm_shared.h76
-rw-r--r--drivers/gpu/pvr/services4/include/ion_sys_private.h50
-rw-r--r--drivers/gpu/pvr/services4/include/kernelbuffer.h97
-rw-r--r--drivers/gpu/pvr/services4/include/kerneldisplay.h239
-rw-r--r--drivers/gpu/pvr/services4/include/pdump.h51
-rw-r--r--drivers/gpu/pvr/services4/include/pvr_bridge.h1693
-rw-r--r--drivers/gpu/pvr/services4/include/pvr_bridge_km.h422
-rw-r--r--drivers/gpu/pvr/services4/include/pvrmmap.h73
-rw-r--r--drivers/gpu/pvr/services4/include/pvrsrv_errors.h311
-rw-r--r--drivers/gpu/pvr/services4/include/servicesint.h616
-rw-r--r--drivers/gpu/pvr/services4/include/sgx_bridge.h577
-rw-r--r--drivers/gpu/pvr/services4/include/sgx_mkif_km.h476
-rw-r--r--drivers/gpu/pvr/services4/include/sgx_ukernel_status_codes.h998
-rw-r--r--drivers/gpu/pvr/services4/include/sgxinfo.h341
-rw-r--r--drivers/gpu/pvr/services4/srvkm/bridged/bridged_pvr_bridge.c5029
-rw-r--r--drivers/gpu/pvr/services4/srvkm/bridged/bridged_pvr_bridge.h257
-rw-r--r--drivers/gpu/pvr/services4/srvkm/bridged/bridged_support.c113
-rw-r--r--drivers/gpu/pvr/services4/srvkm/bridged/bridged_support.h68
-rw-r--r--drivers/gpu/pvr/services4/srvkm/bridged/sgx/bridged_sgx_bridge.c3058
-rw-r--r--drivers/gpu/pvr/services4/srvkm/bridged/sgx/bridged_sgx_bridge.h61
-rw-r--r--drivers/gpu/pvr/services4/srvkm/common/buffer_manager.c3485
-rw-r--r--drivers/gpu/pvr/services4/srvkm/common/deviceclass.c2945
-rw-r--r--drivers/gpu/pvr/services4/srvkm/common/deviceid.h51
-rw-r--r--drivers/gpu/pvr/services4/srvkm/common/devicemem.c3492
-rw-r--r--drivers/gpu/pvr/services4/srvkm/common/handle.c2548
-rw-r--r--drivers/gpu/pvr/services4/srvkm/common/hash.c739
-rw-r--r--drivers/gpu/pvr/services4/srvkm/common/lists.c159
-rw-r--r--drivers/gpu/pvr/services4/srvkm/common/mem.c175
-rw-r--r--drivers/gpu/pvr/services4/srvkm/common/mem_debug.c276
-rw-r--r--drivers/gpu/pvr/services4/srvkm/common/metrics.c209
-rw-r--r--drivers/gpu/pvr/services4/srvkm/common/osfunc_common.c48
-rw-r--r--drivers/gpu/pvr/services4/srvkm/common/pdump_common.c3117
-rw-r--r--drivers/gpu/pvr/services4/srvkm/common/perproc.c398
-rw-r--r--drivers/gpu/pvr/services4/srvkm/common/power.c999
-rw-r--r--drivers/gpu/pvr/services4/srvkm/common/pvrsrv.c1896
-rw-r--r--drivers/gpu/pvr/services4/srvkm/common/queue.c1763
-rw-r--r--drivers/gpu/pvr/services4/srvkm/common/ra.c2217
-rw-r--r--drivers/gpu/pvr/services4/srvkm/common/refcount.c760
-rw-r--r--drivers/gpu/pvr/services4/srvkm/common/resman.c990
-rw-r--r--drivers/gpu/pvr/services4/srvkm/common/ttrace.c601
-rw-r--r--drivers/gpu/pvr/services4/srvkm/devices/sgx/mmu.c4734
-rw-r--r--drivers/gpu/pvr/services4/srvkm/devices/sgx/mmu.h501
-rw-r--r--drivers/gpu/pvr/services4/srvkm/devices/sgx/pb.c493
-rw-r--r--drivers/gpu/pvr/services4/srvkm/devices/sgx/sgx_bridge_km.h254
-rw-r--r--drivers/gpu/pvr/services4/srvkm/devices/sgx/sgxconfig.h645
-rw-r--r--drivers/gpu/pvr/services4/srvkm/devices/sgx/sgxinfokm.h631
-rw-r--r--drivers/gpu/pvr/services4/srvkm/devices/sgx/sgxinit.c3642
-rw-r--r--drivers/gpu/pvr/services4/srvkm/devices/sgx/sgxkick.c811
-rw-r--r--drivers/gpu/pvr/services4/srvkm/devices/sgx/sgxpower.c666
-rw-r--r--drivers/gpu/pvr/services4/srvkm/devices/sgx/sgxreset.c824
-rw-r--r--drivers/gpu/pvr/services4/srvkm/devices/sgx/sgxtransfer.c1007
-rw-r--r--drivers/gpu/pvr/services4/srvkm/devices/sgx/sgxutils.c1976
-rw-r--r--drivers/gpu/pvr/services4/srvkm/devices/sgx/sgxutils.h195
-rw-r--r--drivers/gpu/pvr/services4/srvkm/env/linux/Kbuild.mk194
-rw-r--r--drivers/gpu/pvr/services4/srvkm/env/linux/Linux.mk45
-rw-r--r--drivers/gpu/pvr/services4/srvkm/env/linux/dma_fence_sync_native_server.c94
-rw-r--r--drivers/gpu/pvr/services4/srvkm/env/linux/dmabuf.c328
-rw-r--r--drivers/gpu/pvr/services4/srvkm/env/linux/dmabuf.h98
-rw-r--r--drivers/gpu/pvr/services4/srvkm/env/linux/env_data.h93
-rw-r--r--drivers/gpu/pvr/services4/srvkm/env/linux/env_perproc.h79
-rw-r--r--drivers/gpu/pvr/services4/srvkm/env/linux/event.c413
-rw-r--r--drivers/gpu/pvr/services4/srvkm/env/linux/event.h48
-rw-r--r--drivers/gpu/pvr/services4/srvkm/env/linux/ion.c580
-rw-r--r--drivers/gpu/pvr/services4/srvkm/env/linux/ion.h73
-rw-r--r--drivers/gpu/pvr/services4/srvkm/env/linux/linkage.h77
-rw-r--r--drivers/gpu/pvr/services4/srvkm/env/linux/lma_heap_ion.h45
-rw-r--r--drivers/gpu/pvr/services4/srvkm/env/linux/lock.h56
-rw-r--r--drivers/gpu/pvr/services4/srvkm/env/linux/mm.c2770
-rw-r--r--drivers/gpu/pvr/services4/srvkm/env/linux/mm.h675
-rw-r--r--drivers/gpu/pvr/services4/srvkm/env/linux/mmap.c1666
-rw-r--r--drivers/gpu/pvr/services4/srvkm/env/linux/mmap.h232
-rw-r--r--drivers/gpu/pvr/services4/srvkm/env/linux/module.c1289
-rw-r--r--drivers/gpu/pvr/services4/srvkm/env/linux/mutex.c163
-rw-r--r--drivers/gpu/pvr/services4/srvkm/env/linux/mutex.h100
-rw-r--r--drivers/gpu/pvr/services4/srvkm/env/linux/mutils.c179
-rw-r--r--drivers/gpu/pvr/services4/srvkm/env/linux/mutils.h128
-rw-r--r--drivers/gpu/pvr/services4/srvkm/env/linux/osfunc.c4955
-rw-r--r--drivers/gpu/pvr/services4/srvkm/env/linux/osperproc.c154
-rw-r--r--drivers/gpu/pvr/services4/srvkm/env/linux/pdump.c855
-rw-r--r--drivers/gpu/pvr/services4/srvkm/env/linux/private_data.h91
-rw-r--r--drivers/gpu/pvr/services4/srvkm/env/linux/proc.c1052
-rw-r--r--drivers/gpu/pvr/services4/srvkm/env/linux/proc.h95
-rw-r--r--drivers/gpu/pvr/services4/srvkm/env/linux/pvr_bridge_k.c761
-rw-r--r--drivers/gpu/pvr/services4/srvkm/env/linux/pvr_counting_timeline.c161
-rw-r--r--drivers/gpu/pvr/services4/srvkm/env/linux/pvr_counting_timeline.h27
-rw-r--r--drivers/gpu/pvr/services4/srvkm/env/linux/pvr_debug.c522
-rw-r--r--drivers/gpu/pvr/services4/srvkm/env/linux/pvr_dma_fence.h59
-rw-r--r--drivers/gpu/pvr/services4/srvkm/env/linux/pvr_drm.c808
-rw-r--r--drivers/gpu/pvr/services4/srvkm/env/linux/pvr_drm.h185
-rw-r--r--drivers/gpu/pvr/services4/srvkm/env/linux/pvr_fence.c1721
-rw-r--r--drivers/gpu/pvr/services4/srvkm/env/linux/pvr_fence.h254
-rw-r--r--drivers/gpu/pvr/services4/srvkm/env/linux/pvr_linux_fence.c1590
-rw-r--r--drivers/gpu/pvr/services4/srvkm/env/linux/pvr_linux_fence.h83
-rw-r--r--drivers/gpu/pvr/services4/srvkm/env/linux/pvr_sw_fence.c141
-rw-r--r--drivers/gpu/pvr/services4/srvkm/env/linux/pvr_sw_fence.h19
-rw-r--r--drivers/gpu/pvr/services4/srvkm/env/linux/pvr_sync.c1516
-rw-r--r--drivers/gpu/pvr/services4/srvkm/env/linux/pvr_sync.h201
-rw-r--r--drivers/gpu/pvr/services4/srvkm/env/linux/pvr_sync_common.c379
-rw-r--r--drivers/gpu/pvr/services4/srvkm/env/linux/pvr_sync_common.h91
-rw-r--r--drivers/gpu/pvr/services4/srvkm/env/linux/pvr_sync_dma_fence.c832
-rw-r--r--drivers/gpu/pvr/services4/srvkm/env/linux/pvr_uaccess.h96
-rw-r--r--drivers/gpu/pvr/services4/srvkm/env/linux/pvrsrv_sync_server.h30
-rw-r--r--drivers/gpu/pvr/services4/srvkm/env/linux/systrace.c381
-rw-r--r--drivers/gpu/pvr/services4/srvkm/env/linux/systrace.h70
-rw-r--r--drivers/gpu/pvr/services4/srvkm/hwdefs/mnemedefs.h117
-rw-r--r--drivers/gpu/pvr/services4/srvkm/hwdefs/ocpdefs.h308
-rw-r--r--drivers/gpu/pvr/services4/srvkm/hwdefs/sgx520defs.h555
-rw-r--r--drivers/gpu/pvr/services4/srvkm/hwdefs/sgx530defs.h542
-rw-r--r--drivers/gpu/pvr/services4/srvkm/hwdefs/sgx531defs.h601
-rw-r--r--drivers/gpu/pvr/services4/srvkm/hwdefs/sgx535defs.h739
-rw-r--r--drivers/gpu/pvr/services4/srvkm/hwdefs/sgx540defs.h605
-rw-r--r--drivers/gpu/pvr/services4/srvkm/hwdefs/sgx543_v1.164defs.h1396
-rw-r--r--drivers/gpu/pvr/services4/srvkm/hwdefs/sgx543defs.h1487
-rw-r--r--drivers/gpu/pvr/services4/srvkm/hwdefs/sgx544defs.h1487
-rw-r--r--drivers/gpu/pvr/services4/srvkm/hwdefs/sgx545defs.h1290
-rw-r--r--drivers/gpu/pvr/services4/srvkm/hwdefs/sgxdefs.h116
-rw-r--r--drivers/gpu/pvr/services4/srvkm/hwdefs/sgxerrata.h484
-rw-r--r--drivers/gpu/pvr/services4/srvkm/hwdefs/sgxfeaturedefs.h290
-rw-r--r--drivers/gpu/pvr/services4/srvkm/hwdefs/sgxmmu.h99
-rw-r--r--drivers/gpu/pvr/services4/srvkm/hwdefs/sgxmpdefs.h387
-rw-r--r--drivers/gpu/pvr/services4/srvkm/include/buffer_manager.h640
-rw-r--r--drivers/gpu/pvr/services4/srvkm/include/device.h409
-rw-r--r--drivers/gpu/pvr/services4/srvkm/include/devicemem.h52
-rw-r--r--drivers/gpu/pvr/services4/srvkm/include/dmabuf_sync.h69
-rw-r--r--drivers/gpu/pvr/services4/srvkm/include/handle.h547
-rw-r--r--drivers/gpu/pvr/services4/srvkm/include/hash.h277
-rw-r--r--drivers/gpu/pvr/services4/srvkm/include/ion_sync.h73
-rw-r--r--drivers/gpu/pvr/services4/srvkm/include/lists.h353
-rw-r--r--drivers/gpu/pvr/services4/srvkm/include/metrics.h146
-rw-r--r--drivers/gpu/pvr/services4/srvkm/include/osfunc.h802
-rw-r--r--drivers/gpu/pvr/services4/srvkm/include/osperproc.h94
-rw-r--r--drivers/gpu/pvr/services4/srvkm/include/pdump_int.h100
-rw-r--r--drivers/gpu/pvr/services4/srvkm/include/pdump_km.h446
-rw-r--r--drivers/gpu/pvr/services4/srvkm/include/pdump_osfunc.h385
-rw-r--r--drivers/gpu/pvr/services4/srvkm/include/perfkm.h53
-rw-r--r--drivers/gpu/pvr/services4/srvkm/include/perproc.h141
-rw-r--r--drivers/gpu/pvr/services4/srvkm/include/power.h140
-rw-r--r--drivers/gpu/pvr/services4/srvkm/include/queue.h154
-rw-r--r--drivers/gpu/pvr/services4/srvkm/include/ra.h290
-rw-r--r--drivers/gpu/pvr/services4/srvkm/include/refcount.h293
-rw-r--r--drivers/gpu/pvr/services4/srvkm/include/resman.h153
-rw-r--r--drivers/gpu/pvr/services4/srvkm/include/services_headers.h68
-rw-r--r--drivers/gpu/pvr/services4/srvkm/include/srvkm.h273
-rw-r--r--drivers/gpu/pvr/services4/srvkm/include/ttrace.h200
-rw-r--r--drivers/gpu/pvr/services4/srvkm/include/ttrace_common.h151
-rw-r--r--drivers/gpu/pvr/services4/srvkm/include/ttrace_tokens.h135
-rw-r--r--drivers/gpu/pvr/services4/system/include/syscommon.h390
-rw-r--r--drivers/gpu/pvr/services4/system/omap/oemfuncs.h80
-rw-r--r--drivers/gpu/pvr/services4/system/omap/sgxfreq.c846
-rw-r--r--drivers/gpu/pvr/services4/system/omap/sgxfreq.h122
-rw-r--r--drivers/gpu/pvr/services4/system/omap/sgxfreq_activeidle.c206
-rw-r--r--drivers/gpu/pvr/services4/system/omap/sgxfreq_cool.c216
-rw-r--r--drivers/gpu/pvr/services4/system/omap/sgxfreq_on3demand.c295
-rw-r--r--drivers/gpu/pvr/services4/system/omap/sgxfreq_onoff.c205
-rw-r--r--drivers/gpu/pvr/services4/system/omap/sgxfreq_userspace.c149
-rw-r--r--drivers/gpu/pvr/services4/system/omap/sysconfig.c1261
-rw-r--r--drivers/gpu/pvr/services4/system/omap/sysconfig.h124
-rw-r--r--drivers/gpu/pvr/services4/system/omap/sysinfo.h73
-rw-r--r--drivers/gpu/pvr/services4/system/omap/syslocal.h262
-rw-r--r--drivers/gpu/pvr/services4/system/omap/sysutils.c63
-rw-r--r--drivers/gpu/pvr/services4/system/omap/sysutils_linux.c721
-rw-r--r--drivers/video/Kconfig2
-rw-r--r--ti_config_fragments/android.cfg3
181 files changed, 111670 insertions, 0 deletions
diff --git a/drivers/gpu/Makefile b/drivers/gpu/Makefile
index 835c88318cec..6bff8b67dc0c 100644
--- a/drivers/gpu/Makefile
+++ b/drivers/gpu/Makefile
@@ -6,3 +6,4 @@ obj-$(CONFIG_TEGRA_HOST1X) += host1x/
6obj-y += drm/ vga/ 6obj-y += drm/ vga/
7obj-$(CONFIG_IMX_IPUV3_CORE) += ipu-v3/ 7obj-$(CONFIG_IMX_IPUV3_CORE) += ipu-v3/
8obj-$(CONFIG_TRACE_GPU_MEM) += trace/ 8obj-$(CONFIG_TRACE_GPU_MEM) += trace/
9obj-y += pvr/
diff --git a/drivers/gpu/pvr/Kconfig b/drivers/gpu/pvr/Kconfig
new file mode 100644
index 000000000000..fb3592fe79b4
--- /dev/null
+++ b/drivers/gpu/pvr/Kconfig
@@ -0,0 +1,7 @@
1config PVR_SGX544
2 tristate "PowerVR SGX544"
3 depends on PREEMPT
4 depends on SYNC_FILE
5 default n
6 help
7 Support for the PowerVR SGX544 3D core on AM57x
diff --git a/drivers/gpu/pvr/Makefile b/drivers/gpu/pvr/Makefile
new file mode 100644
index 000000000000..d22e339408c0
--- /dev/null
+++ b/drivers/gpu/pvr/Makefile
@@ -0,0 +1,70 @@
1ifneq ($(CONFIG_PVR_SGX544), )
2ccflags-y += -include $(srctree)/drivers/gpu/pvr/config_kernel_am57x.h
3endif
4
5ccflags-y += \
6 -D__linux__ \
7 -I $(srctree)/drivers/gpu/pvr/include4 \
8 -I $(srctree)/drivers/gpu/pvr/services4/include \
9 -I $(srctree)/drivers/gpu/pvr/services4/system/omap \
10 -I $(srctree)/drivers/gpu/pvr/services4/system/include \
11 -I $(srctree)/drivers/gpu/pvr/services4/srvkm/bridged \
12 -I $(srctree)/drivers/gpu/pvr/services4/srvkm/bridged/sgx \
13 -I $(srctree)/drivers/gpu/pvr/services4/srvkm/common \
14 -I $(srctree)/drivers/gpu/pvr/services4/srvkm/devices/sgx \
15 -I $(srctree)/drivers/gpu/pvr/services4/srvkm/env/linux \
16 -I $(srctree)/drivers/gpu/pvr/services4/srvkm/include \
17 -I $(srctree)/drivers/gpu/pvr/services4/srvkm/hwdefs
18
19pvrsrvkm-y += \
20 services4/srvkm/bridged/bridged_pvr_bridge.o \
21 services4/srvkm/bridged/bridged_support.o \
22 services4/srvkm/bridged/sgx/bridged_sgx_bridge.o \
23 services4/srvkm/common/buffer_manager.o \
24 services4/srvkm/common/devicemem.o \
25 services4/srvkm/common/handle.o \
26 services4/srvkm/common/hash.o \
27 services4/srvkm/common/lists.o \
28 services4/srvkm/common/mem.o \
29 services4/srvkm/common/mem_debug.o \
30 services4/srvkm/common/metrics.o \
31 services4/srvkm/common/osfunc_common.o \
32 services4/srvkm/common/pdump_common.o \
33 services4/srvkm/common/perproc.o \
34 services4/srvkm/common/power.o \
35 services4/srvkm/common/pvrsrv.o \
36 services4/srvkm/common/ra.o \
37 services4/srvkm/common/refcount.o \
38 services4/srvkm/common/resman.o \
39 services4/srvkm/devices/sgx/mmu.o \
40 services4/srvkm/devices/sgx/pb.o \
41 services4/srvkm/devices/sgx/sgxinit.o \
42 services4/srvkm/devices/sgx/sgxkick.o \
43 services4/srvkm/devices/sgx/sgxpower.o \
44 services4/srvkm/devices/sgx/sgxreset.o \
45 services4/srvkm/devices/sgx/sgxtransfer.o \
46 services4/srvkm/devices/sgx/sgxutils.o \
47 services4/srvkm/env/linux/dmabuf.o \
48 services4/srvkm/env/linux/dma_fence_sync_native_server.o \
49 services4/srvkm/env/linux/event.o \
50 services4/srvkm/env/linux/mmap.o \
51 services4/srvkm/env/linux/mm.o \
52 services4/srvkm/env/linux/module.o \
53 services4/srvkm/env/linux/mutex.o \
54 services4/srvkm/env/linux/mutils.o \
55 services4/srvkm/env/linux/osfunc.o \
56 services4/srvkm/env/linux/osperproc.o \
57 services4/srvkm/env/linux/pdump.o \
58 services4/srvkm/env/linux/proc.o \
59 services4/srvkm/env/linux/pvr_bridge_k.o \
60 services4/srvkm/env/linux/pvr_counting_timeline.o \
61 services4/srvkm/env/linux/pvr_debug.o \
62 services4/srvkm/env/linux/pvr_fence.o \
63 services4/srvkm/env/linux/pvr_linux_fence.o \
64 services4/srvkm/env/linux/pvr_sw_fence.o \
65 services4/srvkm/env/linux/pvr_sync_common.o \
66 services4/system/omap/sysconfig.o \
67 services4/system/omap/sysutils.o \
68
69obj-$(CONFIG_PVR_SGX544) += pvrsrvkm.o
70obj-$(CONFIG_PVR_SGX544_AM654) += pvrsrvkm.o
diff --git a/drivers/gpu/pvr/config_kernel_am57x.h b/drivers/gpu/pvr/config_kernel_am57x.h
new file mode 100644
index 000000000000..3d48ceac21d3
--- /dev/null
+++ b/drivers/gpu/pvr/config_kernel_am57x.h
@@ -0,0 +1,53 @@
1#define SGX_FEATURE_MP_CORE_COUNT 2
2#define LINUX
3#define PVR_BUILD_DIR "omap_android"
4#define PVR_BUILD_TYPE "release"
5#define PVRSRV_MODNAME "pvrsrvkm"
6#define SGXCORE 544
7#define SGX544
8#define SUPPORT_SGX544
9#define SUPPORT_SGX
10#define SGX_CORE_REV 116
11#define TRANSFER_QUEUE
12#define PVR_SECURE_HANDLES
13#define SUPPORT_LISR_MISR_SYNC
14#define PVR_LINUX_MEM_AREA_POOL_MAX_PAGES 10800
15#define PVR_LINUX_MEM_AREA_USE_VMAP
16#define PVR_LINUX_MEM_AREA_POOL_ALLOW_SHRINK
17#define RELEASE
18#define SUPPORT_PERCONTEXT_PB
19#define SUPPORT_HW_RECOVERY
20#define SUPPORT_SGX_HWPERF
21#define SUPPORT_SGX_LOW_LATENCY_SCHEDULING
22#define SUPPORT_MEMINFO_IDS
23#define SUPPORT_SGX_NEW_STATUS_VALS
24#define SUPPORT_DBGDRV_EVENT_OBJECTS
25#define SGX_FEATURE_SYSTEM_CACHE
26#define SGX_FEATURE_MP
27#define SYS_USING_INTERRUPTS
28#define PVRSRV_NEW_PVR_DPF
29#define PVRSRV_NEED_PVR_DPF
30#define SUPPORT_DMABUF
31#define IMG_ADDRSPACE_PHYSADDR_BITS 32
32#define SUPPORT_LINUX_X86_WRITECOMBINE
33#define SUPPORT_LINUX_X86_PAT
34#define SGX_DYNAMIC_TIMING_INFO
35#define SYS_CUSTOM_POWERLOCK_WRAP
36#define PVR_LINUX_USING_WORKQUEUES
37#define PVR_LINUX_MISR_USING_PRIVATE_WORKQUEUE
38#define PVR_LINUX_TIMERS_USING_WORKQUEUES
39#define LDM_PLATFORM
40#define PVR_LDM_DEVICE_TREE
41#define PVR_LDM_PLATFORM_PRE_REGISTERED
42#define PVR_LDM_PLATFORM_PRE_REGISTERED_DEV "pvrsrvkm"
43#define PVR_LDM_DRIVER_REGISTRATION_NAME "pvrsrvkm"
44#define SUPPORT_LARGE_GENERAL_HEAP
45#define ANDROID
46#define PVR_ANDROID_NATIVE_WINDOW_HAS_FENCE
47#define SUPPORT_ION_HEADER "../drivers/staging/android/ion/ion.h"
48#define SUPPORT_ION_PRIV_HEADER "../drivers/staging/android/ion/ion_priv.h"
49#define SUPPORT_ION_USE_SG_LENGTH
50#define PVR_NO_OMAP_TIMER
51#define VS_PRODUCT_VERSION 5
52#define SUPPORT_DC_CMDCOMPLETE_WHEN_NO_LONGER_DISPLAYED
53#define SUPPORT_TI_VERSION_STRING
diff --git a/drivers/gpu/pvr/include4/dbgdrvif.h b/drivers/gpu/pvr/include4/dbgdrvif.h
new file mode 100644
index 000000000000..b5edb5a7e02b
--- /dev/null
+++ b/drivers/gpu/pvr/include4/dbgdrvif.h
@@ -0,0 +1,382 @@
1/*************************************************************************/ /*!
2@Title Debug driver
3@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
4@Description Debug Driver Interface
5@License Dual MIT/GPLv2
6
7The contents of this file are subject to the MIT license as set out below.
8
9Permission is hereby granted, free of charge, to any person obtaining a copy
10of this software and associated documentation files (the "Software"), to deal
11in the Software without restriction, including without limitation the rights
12to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13copies of the Software, and to permit persons to whom the Software is
14furnished to do so, subject to the following conditions:
15
16The above copyright notice and this permission notice shall be included in
17all copies or substantial portions of the Software.
18
19Alternatively, the contents of this file may be used under the terms of
20the GNU General Public License Version 2 ("GPL") in which case the provisions
21of GPL are applicable instead of those above.
22
23If you wish to allow use of your version of this file only under the terms of
24GPL, and not to allow others to use your version of this file under the terms
25of the MIT license, indicate your decision by deleting the provisions above
26and replace them with the notice and other provisions required by GPL as set
27out in the file called "GPL-COPYING" included in this distribution. If you do
28not delete the provisions above, a recipient may use your version of this file
29under the terms of either the MIT license or GPL.
30
31This License is also included in this distribution in the file called
32"MIT-COPYING".
33
34EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
35PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
36BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
37PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
38COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
39IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
40CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
41*/ /**************************************************************************/
42
43#ifndef _DBGDRVIF_
44#define _DBGDRVIF_
45
46
47#if defined(__linux__)
48
49#define FILE_DEVICE_UNKNOWN 0
50#define METHOD_BUFFERED 0
51#define FILE_ANY_ACCESS 0
52
53#define CTL_CODE( DeviceType, Function, Method, Access ) (Function)
54#define MAKEIOCTLINDEX(i) ((i) & 0xFFF)
55
56#else
57
58#include "ioctldef.h"
59
60#endif
61
62/*****************************************************************************
63 Stream mode stuff.
64*****************************************************************************/
65#define DEBUG_CAPMODE_FRAMED 0x00000001UL
66#define DEBUG_CAPMODE_CONTINUOUS 0x00000002UL
67#define DEBUG_CAPMODE_HOTKEY 0x00000004UL
68
69#define DEBUG_OUTMODE_STANDARDDBG 0x00000001UL
70#define DEBUG_OUTMODE_MONO 0x00000002UL
71#define DEBUG_OUTMODE_STREAMENABLE 0x00000004UL
72#define DEBUG_OUTMODE_ASYNC 0x00000008UL
73#define DEBUG_OUTMODE_SGXVGA 0x00000010UL
74
75#define DEBUG_FLAGS_USE_NONPAGED_MEM 0x00000001UL
76#define DEBUG_FLAGS_NO_BUF_EXPANDSION 0x00000002UL
77#define DEBUG_FLAGS_ENABLESAMPLE 0x00000004UL
78#define DEBUG_FLAGS_READONLY 0x00000008UL
79#define DEBUG_FLAGS_WRITEONLY 0x00000010UL
80
81#define DEBUG_FLAGS_TEXTSTREAM 0x80000000UL
82
83/*****************************************************************************
84 Debug level control. Only bothered with the first 12 levels, I suspect you
85 get the idea...
86*****************************************************************************/
87#define DEBUG_LEVEL_0 0x00000001UL
88#define DEBUG_LEVEL_1 0x00000003UL
89#define DEBUG_LEVEL_2 0x00000007UL
90#define DEBUG_LEVEL_3 0x0000000FUL
91#define DEBUG_LEVEL_4 0x0000001FUL
92#define DEBUG_LEVEL_5 0x0000003FUL
93#define DEBUG_LEVEL_6 0x0000007FUL
94#define DEBUG_LEVEL_7 0x000000FFUL
95#define DEBUG_LEVEL_8 0x000001FFUL
96#define DEBUG_LEVEL_9 0x000003FFUL
97#define DEBUG_LEVEL_10 0x000007FFUL
98#define DEBUG_LEVEL_11 0x00000FFFUL
99
100#define DEBUG_LEVEL_SEL0 0x00000001UL
101#define DEBUG_LEVEL_SEL1 0x00000002UL
102#define DEBUG_LEVEL_SEL2 0x00000004UL
103#define DEBUG_LEVEL_SEL3 0x00000008UL
104#define DEBUG_LEVEL_SEL4 0x00000010UL
105#define DEBUG_LEVEL_SEL5 0x00000020UL
106#define DEBUG_LEVEL_SEL6 0x00000040UL
107#define DEBUG_LEVEL_SEL7 0x00000080UL
108#define DEBUG_LEVEL_SEL8 0x00000100UL
109#define DEBUG_LEVEL_SEL9 0x00000200UL
110#define DEBUG_LEVEL_SEL10 0x00000400UL
111#define DEBUG_LEVEL_SEL11 0x00000800UL
112
113/*****************************************************************************
114 IOCTL values.
115*****************************************************************************/
116#define DEBUG_SERVICE_IOCTL_BASE 0x800UL
117#define DEBUG_SERVICE_CREATESTREAM CTL_CODE(FILE_DEVICE_UNKNOWN, DEBUG_SERVICE_IOCTL_BASE + 0x01, METHOD_BUFFERED, FILE_ANY_ACCESS)
118#define DEBUG_SERVICE_DESTROYSTREAM CTL_CODE(FILE_DEVICE_UNKNOWN, DEBUG_SERVICE_IOCTL_BASE + 0x02, METHOD_BUFFERED, FILE_ANY_ACCESS)
119#define DEBUG_SERVICE_GETSTREAM CTL_CODE(FILE_DEVICE_UNKNOWN, DEBUG_SERVICE_IOCTL_BASE + 0x03, METHOD_BUFFERED, FILE_ANY_ACCESS)
120#define DEBUG_SERVICE_WRITESTRING CTL_CODE(FILE_DEVICE_UNKNOWN, DEBUG_SERVICE_IOCTL_BASE + 0x04, METHOD_BUFFERED, FILE_ANY_ACCESS)
121#define DEBUG_SERVICE_READSTRING CTL_CODE(FILE_DEVICE_UNKNOWN, DEBUG_SERVICE_IOCTL_BASE + 0x05, METHOD_BUFFERED, FILE_ANY_ACCESS)
122#define DEBUG_SERVICE_WRITE CTL_CODE(FILE_DEVICE_UNKNOWN, DEBUG_SERVICE_IOCTL_BASE + 0x06, METHOD_BUFFERED, FILE_ANY_ACCESS)
123#define DEBUG_SERVICE_READ CTL_CODE(FILE_DEVICE_UNKNOWN, DEBUG_SERVICE_IOCTL_BASE + 0x07, METHOD_BUFFERED, FILE_ANY_ACCESS)
124#define DEBUG_SERVICE_SETDEBUGMODE CTL_CODE(FILE_DEVICE_UNKNOWN, DEBUG_SERVICE_IOCTL_BASE + 0x08, METHOD_BUFFERED, FILE_ANY_ACCESS)
125#define DEBUG_SERVICE_SETDEBUGOUTMODE CTL_CODE(FILE_DEVICE_UNKNOWN, DEBUG_SERVICE_IOCTL_BASE + 0x09, METHOD_BUFFERED, FILE_ANY_ACCESS)
126#define DEBUG_SERVICE_SETDEBUGLEVEL CTL_CODE(FILE_DEVICE_UNKNOWN, DEBUG_SERVICE_IOCTL_BASE + 0x0A, METHOD_BUFFERED, FILE_ANY_ACCESS)
127#define DEBUG_SERVICE_SETFRAME CTL_CODE(FILE_DEVICE_UNKNOWN, DEBUG_SERVICE_IOCTL_BASE + 0x0B, METHOD_BUFFERED, FILE_ANY_ACCESS)
128#define DEBUG_SERVICE_GETFRAME CTL_CODE(FILE_DEVICE_UNKNOWN, DEBUG_SERVICE_IOCTL_BASE + 0x0C, METHOD_BUFFERED, FILE_ANY_ACCESS)
129#define DEBUG_SERVICE_OVERRIDEMODE CTL_CODE(FILE_DEVICE_UNKNOWN, DEBUG_SERVICE_IOCTL_BASE + 0x0D, METHOD_BUFFERED, FILE_ANY_ACCESS)
130#define DEBUG_SERVICE_DEFAULTMODE CTL_CODE(FILE_DEVICE_UNKNOWN, DEBUG_SERVICE_IOCTL_BASE + 0x0E, METHOD_BUFFERED, FILE_ANY_ACCESS)
131#define DEBUG_SERVICE_GETSERVICETABLE CTL_CODE(FILE_DEVICE_UNKNOWN, DEBUG_SERVICE_IOCTL_BASE + 0x0F, METHOD_BUFFERED, FILE_ANY_ACCESS)
132#define DEBUG_SERVICE_WRITE2 CTL_CODE(FILE_DEVICE_UNKNOWN, DEBUG_SERVICE_IOCTL_BASE + 0x10, METHOD_BUFFERED, FILE_ANY_ACCESS)
133#define DEBUG_SERVICE_WRITESTRINGCM CTL_CODE(FILE_DEVICE_UNKNOWN, DEBUG_SERVICE_IOCTL_BASE + 0x11, METHOD_BUFFERED, FILE_ANY_ACCESS)
134#define DEBUG_SERVICE_WRITECM CTL_CODE(FILE_DEVICE_UNKNOWN, DEBUG_SERVICE_IOCTL_BASE + 0x12, METHOD_BUFFERED, FILE_ANY_ACCESS)
135#define DEBUG_SERVICE_SETMARKER CTL_CODE(FILE_DEVICE_UNKNOWN, DEBUG_SERVICE_IOCTL_BASE + 0x13, METHOD_BUFFERED, FILE_ANY_ACCESS)
136#define DEBUG_SERVICE_GETMARKER CTL_CODE(FILE_DEVICE_UNKNOWN, DEBUG_SERVICE_IOCTL_BASE + 0x14, METHOD_BUFFERED, FILE_ANY_ACCESS)
137#define DEBUG_SERVICE_ISCAPTUREFRAME CTL_CODE(FILE_DEVICE_UNKNOWN, DEBUG_SERVICE_IOCTL_BASE + 0x15, METHOD_BUFFERED, FILE_ANY_ACCESS)
138#define DEBUG_SERVICE_WRITELF CTL_CODE(FILE_DEVICE_UNKNOWN, DEBUG_SERVICE_IOCTL_BASE + 0x16, METHOD_BUFFERED, FILE_ANY_ACCESS)
139#define DEBUG_SERVICE_READLF CTL_CODE(FILE_DEVICE_UNKNOWN, DEBUG_SERVICE_IOCTL_BASE + 0x17, METHOD_BUFFERED, FILE_ANY_ACCESS)
140#define DEBUG_SERVICE_WAITFOREVENT CTL_CODE(FILE_DEVICE_UNKNOWN, DEBUG_SERVICE_IOCTL_BASE + 0x18, METHOD_BUFFERED, FILE_ANY_ACCESS)
141#define DEBUG_SERVICE_SETCONNNOTIFY CTL_CODE(FILE_DEVICE_UNKNOWN, DEBUG_SERVICE_IOCTL_BASE + 0x19, METHOD_BUFFERED, FILE_ANY_ACCESS)
142
143
144typedef enum _DBG_EVENT_
145{
146 DBG_EVENT_STREAM_DATA = 1
147} DBG_EVENT;
148
149
150/*****************************************************************************
151 In/Out Structures
152*****************************************************************************/
153typedef struct _DBG_IN_CREATESTREAM_
154{
155 union
156 {
157 IMG_CHAR *pszName;
158 IMG_UINT64 ui64Name;
159 } u;
160 IMG_UINT32 ui32Pages;
161 IMG_UINT32 ui32CapMode;
162 IMG_UINT32 ui32OutMode;
163}DBG_IN_CREATESTREAM, *PDBG_IN_CREATESTREAM;
164
165typedef struct _DBG_IN_FINDSTREAM_
166{
167 union
168 {
169 IMG_CHAR *pszName;
170 IMG_UINT64 ui64Name;
171 }u;
172 IMG_BOOL bResetStream;
173}DBG_IN_FINDSTREAM, *PDBG_IN_FINDSTREAM;
174
175typedef struct _DBG_IN_WRITESTRING_
176{
177 union
178 {
179 IMG_CHAR *pszString;
180 IMG_UINT64 ui64String;
181 } u;
182 IMG_SID hStream;
183 IMG_UINT32 ui32Level;
184}DBG_IN_WRITESTRING, *PDBG_IN_WRITESTRING;
185
186typedef struct _DBG_IN_READSTRING_
187{
188 union
189 {
190 IMG_CHAR *pszString;
191 IMG_UINT64 ui64String;
192 } u;
193 IMG_SID hStream;
194 IMG_UINT32 ui32StringLen;
195} DBG_IN_READSTRING, *PDBG_IN_READSTRING;
196
197typedef struct _DBG_IN_SETDEBUGMODE_
198{
199 IMG_SID hStream;
200 IMG_UINT32 ui32Mode;
201 IMG_UINT32 ui32Start;
202 IMG_UINT32 ui32End;
203 IMG_UINT32 ui32SampleRate;
204} DBG_IN_SETDEBUGMODE, *PDBG_IN_SETDEBUGMODE;
205
206typedef struct _DBG_IN_SETDEBUGOUTMODE_
207{
208 IMG_SID hStream;
209 IMG_UINT32 ui32Mode;
210} DBG_IN_SETDEBUGOUTMODE, *PDBG_IN_SETDEBUGOUTMODE;
211
212typedef struct _DBG_IN_SETDEBUGLEVEL_
213{
214 IMG_SID hStream;
215 IMG_UINT32 ui32Level;
216} DBG_IN_SETDEBUGLEVEL, *PDBG_IN_SETDEBUGLEVEL;
217
218typedef struct _DBG_IN_SETFRAME_
219{
220 IMG_SID hStream;
221 IMG_UINT32 ui32Frame;
222} DBG_IN_SETFRAME, *PDBG_IN_SETFRAME;
223
224typedef struct _DBG_IN_WRITE_
225{
226 union
227 {
228 IMG_UINT8 *pui8InBuffer;
229 IMG_UINT64 ui64InBuffer;
230 } u;
231 IMG_SID hStream;
232 IMG_UINT32 ui32Level;
233 IMG_UINT32 ui32TransferSize;
234} DBG_IN_WRITE, *PDBG_IN_WRITE;
235
236typedef struct _DBG_IN_READ_
237{
238 union
239 {
240 IMG_UINT8 *pui8OutBuffer;
241 IMG_UINT64 ui64OutBuffer;
242 } u;
243 IMG_SID hStream;
244 IMG_BOOL bReadInitBuffer;
245 IMG_UINT32 ui32OutBufferSize;
246} DBG_IN_READ, *PDBG_IN_READ;
247
248typedef struct _DBG_IN_OVERRIDEMODE_
249{
250 IMG_SID hStream;
251 IMG_UINT32 ui32Mode;
252} DBG_IN_OVERRIDEMODE, *PDBG_IN_OVERRIDEMODE;
253
254typedef struct _DBG_IN_ISCAPTUREFRAME_
255{
256 IMG_SID hStream;
257 IMG_BOOL bCheckPreviousFrame;
258} DBG_IN_ISCAPTUREFRAME, *PDBG_IN_ISCAPTUREFRAME;
259
260typedef struct _DBG_IN_SETMARKER_
261{
262 IMG_SID hStream;
263 IMG_UINT32 ui32Marker;
264} DBG_IN_SETMARKER, *PDBG_IN_SETMARKER;
265
266typedef struct _DBG_IN_WRITE_LF_
267{
268 union
269 {
270 IMG_UINT8 *pui8InBuffer;
271 IMG_UINT64 ui64InBuffer;
272 } u;
273 IMG_UINT32 ui32Flags;
274 IMG_SID hStream;
275 IMG_UINT32 ui32Level;
276 IMG_UINT32 ui32BufferSize;
277} DBG_IN_WRITE_LF, *PDBG_IN_WRITE_LF;
278
279/*
280 Flags for above struct
281*/
282#define WRITELF_FLAGS_RESETBUF 0x00000001UL
283
284/*
285 Common control structure (don't duplicate control in main stream
286 and init phase stream).
287*/
288typedef struct _DBG_STREAM_CONTROL_
289{
290 IMG_BOOL bInitPhaseComplete; /*!< init phase has finished */
291 IMG_UINT32 ui32Flags; /*!< flags (see DEBUG_FLAGS above) */
292
293 IMG_UINT32 ui32CapMode; /*!< capturing mode framed/hot key */
294 IMG_UINT32 ui32OutMode; /*!< output mode, e.g. files */
295 IMG_UINT32 ui32DebugLevel;
296 IMG_UINT32 ui32DefaultMode;
297 IMG_UINT32 ui32Start; /*!< first capture frame */
298 IMG_UINT32 ui32End; /*!< last frame */
299 IMG_UINT32 ui32Current; /*!< current frame */
300 IMG_UINT32 ui32SampleRate; /*!< capture frequency */
301 IMG_UINT32 ui32Reserved;
302} DBG_STREAM_CONTROL, *PDBG_STREAM_CONTROL;
303/*
304 Per-buffer control structure.
305*/
306#define MAX_STREAM_NAME_LENGTH 30
307typedef struct _DBG_STREAM_
308{
309 struct _DBG_STREAM_ *psNext;
310 struct _DBG_STREAM_ *psInitStream;
311 DBG_STREAM_CONTROL *psCtrl;
312 IMG_BOOL bCircularAllowed;
313 IMG_PVOID pvBase;
314 IMG_UINT32 ui32Size;
315 IMG_UINT32 ui32RPtr;
316 IMG_UINT32 ui32WPtr;
317 IMG_UINT32 ui32DataWritten;
318 IMG_UINT32 ui32Marker; /*!< marker for file splitting */
319 IMG_UINT32 ui32InitPhaseWOff; /*!< snapshot offset for init phase end for follow-on pdump */
320 IMG_CHAR szName[MAX_STREAM_NAME_LENGTH]; /* Give this a size, some compilers don't like [] */
321} DBG_STREAM,*PDBG_STREAM;
322
323/*
324 * Allows dbgdrv to notify services when events happen, e.g. pdump.exe starts.
325 * (better than resetting psDevInfo->psKernelCCBInfo->ui32CCBDumpWOff = 0
326 * in SGXGetClientInfoKM.)
327 */
328typedef struct _DBGKM_CONNECT_NOTIFIER_
329{
330 IMG_VOID (IMG_CALLCONV *pfnConnectNotifier) (IMG_VOID);
331} DBGKM_CONNECT_NOTIFIER, *PDBGKM_CONNECT_NOTIFIER;
332
333/*****************************************************************************
334 Kernel mode service table
335*****************************************************************************/
336typedef struct _DBGKM_SERVICE_TABLE_
337{
338 IMG_UINT32 ui32Size;
339 IMG_VOID * (IMG_CALLCONV *pfnCreateStream) (IMG_CHAR * pszName,IMG_UINT32 ui32CapMode,IMG_UINT32 ui32OutMode,IMG_UINT32 ui32Flags,IMG_UINT32 ui32Pages);
340 IMG_VOID (IMG_CALLCONV *pfnDestroyStream) (PDBG_STREAM psStream);
341 IMG_VOID * (IMG_CALLCONV *pfnFindStream) (IMG_CHAR * pszName, IMG_BOOL bResetInitBuffer);
342 IMG_UINT32 (IMG_CALLCONV *pfnWriteString) (PDBG_STREAM psStream,IMG_CHAR * pszString,IMG_UINT32 ui32Level);
343 IMG_UINT32 (IMG_CALLCONV *pfnReadString) (PDBG_STREAM psStream,IMG_CHAR * pszString,IMG_UINT32 ui32Limit);
344 IMG_UINT32 (IMG_CALLCONV *pfnWriteBIN) (PDBG_STREAM psStream,IMG_UINT8 *pui8InBuf,IMG_UINT32 ui32InBuffSize,IMG_UINT32 ui32Level);
345 IMG_UINT32 (IMG_CALLCONV *pfnReadBIN) (PDBG_STREAM psStream,IMG_BOOL bReadInitBuffer, IMG_UINT32 ui32OutBufferSize,IMG_UINT8 *pui8OutBuf);
346 IMG_VOID (IMG_CALLCONV *pfnSetCaptureMode) (PDBG_STREAM psStream,IMG_UINT32 ui32CapMode,IMG_UINT32 ui32Start,IMG_UINT32 ui32Stop,IMG_UINT32 ui32SampleRate);
347 IMG_VOID (IMG_CALLCONV *pfnSetOutputMode) (PDBG_STREAM psStream,IMG_UINT32 ui32OutMode);
348 IMG_VOID (IMG_CALLCONV *pfnSetDebugLevel) (PDBG_STREAM psStream,IMG_UINT32 ui32DebugLevel);
349 IMG_VOID (IMG_CALLCONV *pfnSetFrame) (PDBG_STREAM psStream,IMG_UINT32 ui32Frame);
350 IMG_UINT32 (IMG_CALLCONV *pfnGetFrame) (PDBG_STREAM psStream);
351 IMG_VOID (IMG_CALLCONV *pfnOverrideMode) (PDBG_STREAM psStream,IMG_UINT32 ui32Mode);
352 IMG_VOID (IMG_CALLCONV *pfnDefaultMode) (PDBG_STREAM psStream);
353 IMG_UINT32 (IMG_CALLCONV *pfnDBGDrivWrite2) (PDBG_STREAM psStream,IMG_UINT8 *pui8InBuf,IMG_UINT32 ui32InBuffSize,IMG_UINT32 ui32Level);
354 IMG_UINT32 (IMG_CALLCONV *pfnWriteStringCM) (PDBG_STREAM psStream,IMG_CHAR * pszString,IMG_UINT32 ui32Level);
355 IMG_UINT32 (IMG_CALLCONV *pfnWriteBINCM) (PDBG_STREAM psStream,IMG_UINT8 *pui8InBuf,IMG_UINT32 ui32InBuffSize,IMG_UINT32 ui32Level);
356 IMG_VOID (IMG_CALLCONV *pfnSetMarker) (PDBG_STREAM psStream,IMG_UINT32 ui32Marker);
357 IMG_UINT32 (IMG_CALLCONV *pfnGetMarker) (PDBG_STREAM psStream);
358 IMG_VOID (IMG_CALLCONV *pfnStartInitPhase) (PDBG_STREAM psStream);
359 IMG_VOID (IMG_CALLCONV *pfnStopInitPhase) (PDBG_STREAM psStream);
360 IMG_BOOL (IMG_CALLCONV *pfnIsCaptureFrame) (PDBG_STREAM psStream, IMG_BOOL bCheckPreviousFrame);
361 IMG_UINT32 (IMG_CALLCONV *pfnWriteLF) (PDBG_STREAM psStream, IMG_UINT8 *pui8InBuf, IMG_UINT32 ui32InBuffSize, IMG_UINT32 ui32Level, IMG_UINT32 ui32Flags);
362 IMG_UINT32 (IMG_CALLCONV *pfnReadLF) (PDBG_STREAM psStream, IMG_UINT32 ui32OutBuffSize, IMG_UINT8 *pui8OutBuf);
363 IMG_UINT32 (IMG_CALLCONV *pfnGetStreamOffset) (PDBG_STREAM psStream);
364 IMG_VOID (IMG_CALLCONV *pfnSetStreamOffset) (PDBG_STREAM psStream, IMG_UINT32 ui32StreamOffset);
365 IMG_BOOL (IMG_CALLCONV *pfnIsLastCaptureFrame) (PDBG_STREAM psStream);
366 IMG_VOID (IMG_CALLCONV *pfnWaitForEvent) (DBG_EVENT eEvent);
367 IMG_VOID (IMG_CALLCONV *pfnSetConnectNotifier) (DBGKM_CONNECT_NOTIFIER fn_notifier);
368 IMG_UINT32 (IMG_CALLCONV *pfnWritePersist) (PDBG_STREAM psStream,IMG_UINT8 *pui8InBuf,IMG_UINT32 ui32InBuffSize,IMG_UINT32 ui32Level);
369} DBGKM_SERVICE_TABLE, *PDBGKM_SERVICE_TABLE;
370
371#if defined(__linux__)
372/*****************************************************************************
373 Function to export service table from debug driver to the PDUMP component.
374*****************************************************************************/
375IMG_VOID DBGDrvGetServiceTable(DBGKM_SERVICE_TABLE **fn_table);
376#endif
377
378
379#endif
380/*****************************************************************************
381 End of file (DBGDRVIF.H)
382*****************************************************************************/
diff --git a/drivers/gpu/pvr/include4/img_defs.h b/drivers/gpu/pvr/include4/img_defs.h
new file mode 100644
index 000000000000..9350cf68b353
--- /dev/null
+++ b/drivers/gpu/pvr/include4/img_defs.h
@@ -0,0 +1,227 @@
1/*************************************************************************/ /*!
2@Title Common header containing type definitions for portability
3@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
4@Description Contains variable and structure definitions. Any platform
5 specific types should be defined in this file.
6@License Dual MIT/GPLv2
7
8The contents of this file are subject to the MIT license as set out below.
9
10Permission is hereby granted, free of charge, to any person obtaining a copy
11of this software and associated documentation files (the "Software"), to deal
12in the Software without restriction, including without limitation the rights
13to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14copies of the Software, and to permit persons to whom the Software is
15furnished to do so, subject to the following conditions:
16
17The above copyright notice and this permission notice shall be included in
18all copies or substantial portions of the Software.
19
20Alternatively, the contents of this file may be used under the terms of
21the GNU General Public License Version 2 ("GPL") in which case the provisions
22of GPL are applicable instead of those above.
23
24If you wish to allow use of your version of this file only under the terms of
25GPL, and not to allow others to use your version of this file under the terms
26of the MIT license, indicate your decision by deleting the provisions above
27and replace them with the notice and other provisions required by GPL as set
28out in the file called "GPL-COPYING" included in this distribution. If you do
29not delete the provisions above, a recipient may use your version of this file
30under the terms of either the MIT license or GPL.
31
32This License is also included in this distribution in the file called
33"MIT-COPYING".
34
35EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
36PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
37BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
38PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
39COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
40IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
41CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
42*/ /**************************************************************************/
43#if !defined (__IMG_DEFS_H__)
44#define __IMG_DEFS_H__
45
46#include "img_types.h"
47
48typedef enum img_tag_TriStateSwitch
49{
50 IMG_ON = 0x00,
51 IMG_OFF,
52 IMG_IGNORE
53
54} img_TriStateSwitch, * img_pTriStateSwitch;
55
56#define IMG_SUCCESS 0
57
58#define IMG_NO_REG 1
59
60#if defined (NO_INLINE_FUNCS)
61 #define INLINE
62 #define FORCE_INLINE
63#else
64#if defined (__cplusplus)
65 #define INLINE inline
66 #define FORCE_INLINE inline
67#else
68#if !defined(INLINE)
69 #define INLINE __inline
70#endif
71 #define FORCE_INLINE static __inline
72#endif
73#endif
74
75
76/* Use this in any file, or use attributes under GCC - see below */
77#ifndef PVR_UNREFERENCED_PARAMETER
78#define PVR_UNREFERENCED_PARAMETER(param) (param) = (param)
79#endif
80
81/* The best way to supress unused parameter warnings using GCC is to use a
82 * variable attribute. Place the unref__ between the type and name of an
83 * unused parameter in a function parameter list, eg `int unref__ var'. This
84 * should only be used in GCC build environments, for example, in files that
85 * compile only on Linux. Other files should use UNREFERENCED_PARAMETER */
86#ifdef __GNUC__
87#define unref__ __attribute__ ((unused))
88#else
89#define unref__
90#endif
91
92/*
93 Wide character definitions
94*/
95#ifndef _TCHAR_DEFINED
96#if defined(UNICODE)
97typedef unsigned short TCHAR, *PTCHAR, *PTSTR;
98#else /* #if defined(UNICODE) */
99typedef char TCHAR, *PTCHAR, *PTSTR;
100#endif /* #if defined(UNICODE) */
101#define _TCHAR_DEFINED
102#endif /* #ifndef _TCHAR_DEFINED */
103
104
105 #if defined(__linux__) || defined(__QNXNTO__) || defined(__METAG)
106
107 #define IMG_CALLCONV
108 #define IMG_INTERNAL __attribute__((visibility("hidden")))
109 #define IMG_EXPORT __attribute__((visibility("default")))
110 #define IMG_IMPORT
111 #define IMG_RESTRICT __restrict__
112 #if defined(USE_64BIT_COMPAT)
113 #define IMG_COMPAT __attribute__ ((packed))
114 #else
115 #define IMG_COMPAT
116 #endif
117
118 #else
119 #error("define an OS")
120 #endif
121
122// Use default definition if not overridden
123#ifndef IMG_ABORT
124 #define IMG_ABORT() abort()
125#endif
126
127#ifndef IMG_MALLOC
128 #define IMG_MALLOC(A) malloc (A)
129#endif
130
131#ifndef IMG_FREE
132 #define IMG_FREE(A) free (A)
133#endif
134
135#define IMG_CONST const
136
137#if defined(__GNUC__)
138#define IMG_FORMAT_PRINTF(x,y) __attribute__((format(printf,x,y)))
139#else
140#define IMG_FORMAT_PRINTF(x,y)
141#endif
142
143/*
144 * Cleanup request defines
145 */
146#define CLEANUP_WITH_POLL IMG_FALSE
147#define FORCE_CLEANUP IMG_TRUE
148
149#if defined (_WIN64)
150#define IMG_UNDEF (~0ULL)
151#else
152#define IMG_UNDEF (~0UL)
153#endif
154
155/*
156 Do the right thing when using printf to output cpu addresses,
157 depending on architecture.
158 */
159#if defined (_WIN64)
160 #define UINTPTR_FMT "%016llX"
161#else
162 #if defined (__x86_64__)
163 #define UINTPTR_FMT "%016lX"
164 #else
165 #define UINTPTR_FMT "%08lX"
166 #endif
167#endif
168
169/*
170 Similarly for DEV_ and SYS_ PHYSADDRs, but this is dependent on 32/36-bit MMU
171 capability, in addition to host architecture.
172 */
173#if IMG_ADDRSPACE_PHYSADDR_BITS == 32
174 #if defined(IMG_UINT32_IS_ULONG)
175 #define CPUPADDR_FMT "%08lX"
176 #define DEVPADDR_FMT "%08lX"
177 #define SYSPADDR_FMT "%08lX"
178 #else
179 #define CPUPADDR_FMT "%08X"
180 #define DEVPADDR_FMT "%08X"
181 #define SYSPADDR_FMT "%08X"
182 #endif
183#else
184 #if defined(__x86_64__)
185 #define CPUPADDR_FMT "%016lX"
186 #define DEVPADDR_FMT "%016lX"
187 #define SYSPADDR_FMT "%016lX"
188 #else
189
190 #define CPUPADDR_FMT "%016llX"
191 #define DEVPADDR_FMT "%016llX"
192 #define SYSPADDR_FMT "%016llX"
193 #endif
194#endif
195
196/*
197 Define a printf format macro for the length property of the format-specifier
198 for size_t, that allows avoidance of C99 dependency on compilers that don't
199 support this, while still ensuring that whatever the size of size_t (eg 32,
200 64 bit Linux builds, or Win32/64 builds), a size_t (or IMG_SIZE_T) can be
201 passed to printf-type functions without a cast.
202*/
203#if defined LINUX
204 /* Use C99 format specifier where possible */
205 #define SIZE_T_FMT_LEN "z"
206#elif defined _WIN64
207 #define SIZE_T_FMT_LEN "I"
208#else
209 #define SIZE_T_FMT_LEN "l" /* May need to be updated as required, for other OSs */
210#endif
211
212
213#if defined (__x86_64__)
214 #define IMG_UINT64_FMT "l"
215#else
216 #define IMG_UINT64_FMT "ll" /* May need to be updated as required, for other OSs */
217#endif
218
219/*
220 Some versions of MSVC don't have snprintf, vsnprintf in their CRTs.
221 Remap to the deprecated unix compatibility versions.
222*/
223
224#endif /* #if !defined (__IMG_DEFS_H__) */
225/*****************************************************************************
226 End of file (IMG_DEFS.H)
227*****************************************************************************/
diff --git a/drivers/gpu/pvr/include4/img_types.h b/drivers/gpu/pvr/include4/img_types.h
new file mode 100644
index 000000000000..6d2761c93a32
--- /dev/null
+++ b/drivers/gpu/pvr/include4/img_types.h
@@ -0,0 +1,231 @@
1/*************************************************************************/ /*!
2@Title Global types for use by IMG APIs
3@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
4@Description Defines type aliases for use by IMG APIs.
5@License Dual MIT/GPLv2
6
7The contents of this file are subject to the MIT license as set out below.
8
9Permission is hereby granted, free of charge, to any person obtaining a copy
10of this software and associated documentation files (the "Software"), to deal
11in the Software without restriction, including without limitation the rights
12to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13copies of the Software, and to permit persons to whom the Software is
14furnished to do so, subject to the following conditions:
15
16The above copyright notice and this permission notice shall be included in
17all copies or substantial portions of the Software.
18
19Alternatively, the contents of this file may be used under the terms of
20the GNU General Public License Version 2 ("GPL") in which case the provisions
21of GPL are applicable instead of those above.
22
23If you wish to allow use of your version of this file only under the terms of
24GPL, and not to allow others to use your version of this file under the terms
25of the MIT license, indicate your decision by deleting the provisions above
26and replace them with the notice and other provisions required by GPL as set
27out in the file called "GPL-COPYING" included in this distribution. If you do
28not delete the provisions above, a recipient may use your version of this file
29under the terms of either the MIT license or GPL.
30
31This License is also included in this distribution in the file called
32"MIT-COPYING".
33
34EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
35PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
36BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
37PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
38COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
39IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
40CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
41*/ /**************************************************************************/
42#ifndef __IMG_TYPES_H__
43#define __IMG_TYPES_H__
44
45#if defined(LINUX) && defined(__KERNEL__)
46 #include "kernel_types.h"
47#elif defined(LINUX) || defined(__QNXNTO__) || defined(__METAG)
48 #include <stddef.h> /* NULL */
49 #include <stdint.h> /* intX_t/uintX_t, format specifiers */
50 #include <limits.h> /* INT_MIN, etc */
51#else
52 #error C99 support not set up for this build
53#endif
54
55/* define all address space bit depths: */
56/* CPU virtual address space defaults to 32bits */
57#if !defined(IMG_ADDRSPACE_CPUVADDR_BITS)
58#define IMG_ADDRSPACE_CPUVADDR_BITS 32
59#endif
60
61/* Physical address space defaults to 32bits */
62#if !defined(IMG_ADDRSPACE_PHYSADDR_BITS)
63#define IMG_ADDRSPACE_PHYSADDR_BITS 32
64#endif
65
66typedef unsigned int IMG_UINT, *IMG_PUINT;
67typedef signed int IMG_INT, *IMG_PINT;
68
69typedef uint8_t IMG_UINT8, *IMG_PUINT8;
70typedef uint8_t IMG_BYTE, *IMG_PBYTE;
71typedef int8_t IMG_INT8, *IMG_PINT8;
72typedef char IMG_CHAR, *IMG_PCHAR;
73
74typedef uint16_t IMG_UINT16, *IMG_PUINT16;
75typedef int16_t IMG_INT16, *IMG_PINT16;
76typedef uint32_t IMG_UINT32, *IMG_PUINT32;
77typedef int32_t IMG_INT32, *IMG_PINT32;
78
79#define IMG_UINT32_MAX UINT32_MAX
80
81typedef uint64_t IMG_UINT64, *IMG_PUINT64;
82typedef int64_t IMG_INT64, *IMG_PINT64;
83
84#if !(defined(LINUX) && defined (__KERNEL__))
85/* Linux kernel mode does not use floating point */
86typedef float IMG_FLOAT, *IMG_PFLOAT;
87typedef double IMG_DOUBLE, *IMG_PDOUBLE;
88#endif
89
90typedef enum tag_img_bool
91{
92 IMG_FALSE = 0,
93 IMG_TRUE = 1,
94 IMG_FORCE_ALIGN = 0x7FFFFFFF
95} IMG_BOOL, *IMG_PBOOL;
96
97typedef void IMG_VOID, *IMG_PVOID;
98
99typedef IMG_INT32 IMG_RESULT;
100
101#if defined(_WIN64)
102 typedef unsigned __int64 IMG_UINTPTR_T;
103 typedef signed __int64 IMG_INTPTR_T;
104 typedef signed __int64 IMG_PTRDIFF_T;
105 typedef IMG_UINT64 IMG_SIZE_T;
106#else
107#if defined (__x86_64__) || !defined(USE_64BIT_COMPAT) || defined (__KERNEL__)
108 typedef size_t IMG_SIZE_T;
109#else
110 typedef IMG_UINT64 IMG_SIZE_T;
111#endif
112 typedef uintptr_t IMG_UINTPTR_T;
113#endif
114
115#if defined(LINUX) && defined (__KERNEL__)
116 typedef IMG_PVOID IMG_HANDLE;
117#elif defined(LINUX)
118 #if defined(USE_64BIT_COMPAT)
119 typedef IMG_UINT64 IMG_HANDLE;
120 #else
121 typedef IMG_UINT32 IMG_HANDLE;
122 #endif
123#else
124typedef void *IMG_HANDLE;
125#endif
126
127typedef void** IMG_HVOID, * IMG_PHVOID;
128
129#define IMG_NULL 0
130
131/* services/stream ID */
132typedef IMG_UINTPTR_T IMG_SID;
133
134typedef IMG_UINTPTR_T IMG_EVENTSID;
135
136/*
137 * Address types.
138 * All types used to refer to a block of memory are wrapped in structures
139 * to enforce some degree of type safety, i.e. a IMG_DEV_VIRTADDR cannot
140 * be assigned to a variable of type IMG_DEV_PHYADDR because they are not the
141 * same thing.
142 *
143 * There is an assumption that the system contains at most one non-cpu mmu,
144 * and a memory block is only mapped by the MMU once.
145 *
146 * Different devices could have offset views of the physical address space.
147 *
148 */
149
150
151/*
152 *
153 * +------------+ +------------+ +------------+ +------------+
154 * | CPU | | DEV | | DEV | | DEV |
155 * +------------+ +------------+ +------------+ +------------+
156 * | | | |
157 * | PVOID |IMG_DEV_VIRTADDR |IMG_DEV_VIRTADDR |
158 * | \-------------------/ |
159 * | | |
160 * +------------+ +------------+ |
161 * | MMU | | MMU | |
162 * +------------+ +------------+ |
163 * | | |
164 * | | |
165 * | | |
166 * +--------+ +---------+ +--------+
167 * | Offset | | (Offset)| | Offset |
168 * +--------+ +---------+ +--------+
169 * | | IMG_DEV_PHYADDR |
170 * | | |
171 * | | IMG_DEV_PHYADDR |
172 * +---------------------------------------------------------------------+
173 * | System Address bus |
174 * +---------------------------------------------------------------------+
175 *
176 */
177
178typedef IMG_PVOID IMG_CPU_VIRTADDR;
179
180/* device virtual address */
181typedef struct _IMG_DEV_VIRTADDR
182{
183 /* device virtual addresses are 32bit for now */
184 IMG_UINT32 uiAddr;
185#define IMG_CAST_TO_DEVVADDR_UINT(var) (IMG_UINT32)(var)
186
187} IMG_DEV_VIRTADDR;
188
189typedef IMG_UINT32 IMG_DEVMEM_SIZE_T;
190
191/* cpu physical address */
192typedef struct _IMG_CPU_PHYADDR
193{
194 /* variable sized type (32,64) */
195#if IMG_ADDRSPACE_PHYSADDR_BITS == 32
196 /* variable sized type (32,64) */
197 IMG_UINT32 uiAddr;
198#else
199 IMG_UINT64 uiAddr;
200#endif
201} IMG_CPU_PHYADDR;
202
203/* device physical address */
204typedef struct _IMG_DEV_PHYADDR
205{
206#if IMG_ADDRSPACE_PHYSADDR_BITS == 32
207 /* variable sized type (32,64) */
208 IMG_UINT32 uiAddr;
209#else
210 IMG_UINT64 uiAddr;
211#endif
212} IMG_DEV_PHYADDR;
213
214/* system physical address */
215typedef struct _IMG_SYS_PHYADDR
216{
217 /* variable sized type (32,64) */
218#if IMG_ADDRSPACE_PHYSADDR_BITS == 32
219 /* variable sized type (32,64) */
220 IMG_UINT32 uiAddr;
221#else
222 IMG_UINT64 uiAddr;
223#endif
224} IMG_SYS_PHYADDR;
225
226#include "img_defs.h"
227
228#endif /* __IMG_TYPES_H__ */
229/******************************************************************************
230 End of file (img_types.h)
231******************************************************************************/
diff --git a/drivers/gpu/pvr/include4/kernel_types.h b/drivers/gpu/pvr/include4/kernel_types.h
new file mode 100644
index 000000000000..b53da1966b84
--- /dev/null
+++ b/drivers/gpu/pvr/include4/kernel_types.h
@@ -0,0 +1,136 @@
1/*************************************************************************/ /*!
2@Title C99-compatible types and definitions for Linux kernel code
3@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
4@License Dual MIT/GPLv2
5
6The contents of this file are subject to the MIT license as set out below.
7
8Permission is hereby granted, free of charge, to any person obtaining a copy
9of this software and associated documentation files (the "Software"), to deal
10in the Software without restriction, including without limitation the rights
11to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12copies of the Software, and to permit persons to whom the Software is
13furnished to do so, subject to the following conditions:
14
15The above copyright notice and this permission notice shall be included in
16all copies or substantial portions of the Software.
17
18Alternatively, the contents of this file may be used under the terms of
19the GNU General Public License Version 2 ("GPL") in which case the provisions
20of GPL are applicable instead of those above.
21
22If you wish to allow use of your version of this file only under the terms of
23GPL, and not to allow others to use your version of this file under the terms
24of the MIT license, indicate your decision by deleting the provisions above
25and replace them with the notice and other provisions required by GPL as set
26out in the file called "GPL-COPYING" included in this distribution. If you do
27not delete the provisions above, a recipient may use your version of this file
28under the terms of either the MIT license or GPL.
29
30This License is also included in this distribution in the file called
31"MIT-COPYING".
32
33EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
34PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
35BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
36PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
37COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
38IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
39CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
40*/ /**************************************************************************/
41
42#include <linux/kernel.h>
43
44/* Limits of specified-width integer types */
45
46/* S8_MIN, etc were added in kernel version 3.14. The other versions are for
47 * earlier kernels. They can be removed once older kernels don't need to be
48 * supported.
49 */
50#ifdef S8_MIN
51 #define INT8_MIN S8_MIN
52#else
53 #define INT8_MIN (-128)
54#endif
55
56#ifdef S8_MAX
57 #define INT8_MAX S8_MAX
58#else
59 #define INT8_MAX 127
60#endif
61
62#ifdef U8_MAX
63 #define UINT8_MAX U8_MAX
64#else
65 #define UINT8_MAX 0xFF
66#endif
67
68#ifdef S16_MIN
69 #define INT16_MIN S16_MIN
70#else
71 #define INT16_MIN (-32768)
72#endif
73
74#ifdef S16_MAX
75 #define INT16_MAX S16_MAX
76#else
77 #define INT16_MAX 32767
78#endif
79
80#ifdef U16_MAX
81 #define UINT16_MAX U16_MAX
82#else
83 #define UINT16_MAX 0xFFFF
84#endif
85
86#ifdef S32_MIN
87 #define INT32_MIN S32_MIN
88#else
89 #define INT32_MIN (-2147483647 - 1)
90#endif
91
92#ifdef S32_MAX
93 #define INT32_MAX S32_MAX
94#else
95 #define INT32_MAX 2147483647
96#endif
97
98#ifdef U32_MAX
99 #define UINT32_MAX U32_MAX
100#else
101 #define UINT32_MAX 0xFFFFFFFF
102#endif
103
104#ifdef S64_MIN
105 #define INT64_MIN S64_MIN
106#else
107 #define INT64_MIN (-9223372036854775807LL)
108#endif
109
110#ifdef S64_MAX
111 #define INT64_MAX S64_MAX
112#else
113 #define INT64_MAX 9223372036854775807LL
114#endif
115
116#ifdef U64_MAX
117 #define UINT64_MAX U64_MAX
118#else
119 #define UINT64_MAX 0xFFFFFFFFFFFFFFFFULL
120#endif
121
122/* Macros for integer constants */
123#define INT8_C S8_C
124#define UINT8_C U8_C
125#define INT16_C S16_C
126#define UINT16_C U16_C
127#define INT32_C S32_C
128#define UINT32_C U32_C
129#define INT64_C S64_C
130#define UINT64_C U64_C
131
132/* Format conversion of integer types <inttypes.h> */
133/* Only define PRIX64 for the moment, as this is the only format macro that
134 * img_types.h needs.
135 */
136#define PRIX64 "llX"
diff --git a/drivers/gpu/pvr/include4/pdumpdefs.h b/drivers/gpu/pvr/include4/pdumpdefs.h
new file mode 100644
index 000000000000..2ba36c37fb88
--- /dev/null
+++ b/drivers/gpu/pvr/include4/pdumpdefs.h
@@ -0,0 +1,127 @@
1/*************************************************************************/ /*!
2@Title PDUMP definitions header
3@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
4@Description PDUMP definitions header
5@License Dual MIT/GPLv2
6
7The contents of this file are subject to the MIT license as set out below.
8
9Permission is hereby granted, free of charge, to any person obtaining a copy
10of this software and associated documentation files (the "Software"), to deal
11in the Software without restriction, including without limitation the rights
12to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13copies of the Software, and to permit persons to whom the Software is
14furnished to do so, subject to the following conditions:
15
16The above copyright notice and this permission notice shall be included in
17all copies or substantial portions of the Software.
18
19Alternatively, the contents of this file may be used under the terms of
20the GNU General Public License Version 2 ("GPL") in which case the provisions
21of GPL are applicable instead of those above.
22
23If you wish to allow use of your version of this file only under the terms of
24GPL, and not to allow others to use your version of this file under the terms
25of the MIT license, indicate your decision by deleting the provisions above
26and replace them with the notice and other provisions required by GPL as set
27out in the file called "GPL-COPYING" included in this distribution. If you do
28not delete the provisions above, a recipient may use your version of this file
29under the terms of either the MIT license or GPL.
30
31This License is also included in this distribution in the file called
32"MIT-COPYING".
33
34EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
35PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
36BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
37PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
38COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
39IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
40CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
41*/ /**************************************************************************/
42#if !defined (__PDUMPDEFS_H__)
43#define __PDUMPDEFS_H__
44
45typedef enum _PDUMP_PIXEL_FORMAT_
46{
47 PVRSRV_PDUMP_PIXEL_FORMAT_UNSUPPORTED = 0,
48 PVRSRV_PDUMP_PIXEL_FORMAT_RGB8 = 1,
49 PVRSRV_PDUMP_PIXEL_FORMAT_RGB332 = 2,
50 PVRSRV_PDUMP_PIXEL_FORMAT_KRGB555 = 3,
51 PVRSRV_PDUMP_PIXEL_FORMAT_RGB565 = 4,
52 PVRSRV_PDUMP_PIXEL_FORMAT_ARGB4444 = 5,
53 PVRSRV_PDUMP_PIXEL_FORMAT_ARGB1555 = 6,
54 PVRSRV_PDUMP_PIXEL_FORMAT_RGB888 = 7,
55 PVRSRV_PDUMP_PIXEL_FORMAT_ARGB8888 = 8,
56 PVRSRV_PDUMP_PIXEL_FORMAT_YUV8 = 9,
57 PVRSRV_PDUMP_PIXEL_FORMAT_AYUV4444 = 10,
58 PVRSRV_PDUMP_PIXEL_FORMAT_VY0UY1_8888 = 11,
59 PVRSRV_PDUMP_PIXEL_FORMAT_UY0VY1_8888 = 12,
60 PVRSRV_PDUMP_PIXEL_FORMAT_Y0UY1V_8888 = 13,
61 PVRSRV_PDUMP_PIXEL_FORMAT_Y0VY1U_8888 = 14,
62 PVRSRV_PDUMP_PIXEL_FORMAT_YUV888 = 15,
63 PVRSRV_PDUMP_PIXEL_FORMAT_UYVY10101010 = 16,
64 PVRSRV_PDUMP_PIXEL_FORMAT_VYAUYA8888 = 17,
65 PVRSRV_PDUMP_PIXEL_FORMAT_AYUV8888 = 18,
66 PVRSRV_PDUMP_PIXEL_FORMAT_AYUV2101010 = 19,
67 PVRSRV_PDUMP_PIXEL_FORMAT_YUV101010 = 20,
68 PVRSRV_PDUMP_PIXEL_FORMAT_PL12Y8 = 21,
69 PVRSRV_PDUMP_PIXEL_FORMAT_YUV_IMC2 = 22,
70 PVRSRV_PDUMP_PIXEL_FORMAT_YUV_YV12 = 23,
71 PVRSRV_PDUMP_PIXEL_FORMAT_YUV_PL8 = 24,
72 PVRSRV_PDUMP_PIXEL_FORMAT_YUV_PL12 = 25,
73 PVRSRV_PDUMP_PIXEL_FORMAT_422PL12YUV8 = 26,
74 PVRSRV_PDUMP_PIXEL_FORMAT_420PL12YUV8 = 27,
75 PVRSRV_PDUMP_PIXEL_FORMAT_PL12Y10 = 28,
76 PVRSRV_PDUMP_PIXEL_FORMAT_422PL12YUV10 = 29,
77 PVRSRV_PDUMP_PIXEL_FORMAT_420PL12YUV10 = 30,
78 PVRSRV_PDUMP_PIXEL_FORMAT_ABGR8888 = 31,
79 PVRSRV_PDUMP_PIXEL_FORMAT_BGRA8888 = 32,
80 PVRSRV_PDUMP_PIXEL_FORMAT_ARGB8332 = 33,
81 PVRSRV_PDUMP_PIXEL_FORMAT_RGB555 = 34,
82 PVRSRV_PDUMP_PIXEL_FORMAT_F16 = 35,
83 PVRSRV_PDUMP_PIXEL_FORMAT_F32 = 36,
84 PVRSRV_PDUMP_PIXEL_FORMAT_L16 = 37,
85 PVRSRV_PDUMP_PIXEL_FORMAT_L32 = 38,
86 PVRSRV_PDUMP_PIXEL_FORMAT_RGBA8888 = 39,
87 PVRSRV_PDUMP_PIXEL_FORMAT_ABGR4444 = 40,
88 PVRSRV_PDUMP_PIXEL_FORMAT_RGBA4444 = 41,
89 PVRSRV_PDUMP_PIXEL_FORMAT_BGRA4444 = 42,
90 PVRSRV_PDUMP_PIXEL_FORMAT_ABGR1555 = 43,
91 PVRSRV_PDUMP_PIXEL_FORMAT_RGBA5551 = 44,
92 PVRSRV_PDUMP_PIXEL_FORMAT_BGRA5551 = 45,
93 PVRSRV_PDUMP_PIXEL_FORMAT_BGR565 = 46,
94 PVRSRV_PDUMP_PIXEL_FORMAT_A8 = 47,
95
96 PVRSRV_PDUMP_PIXEL_FORMAT_FORCE_I32 = 0x7fffffff
97
98} PDUMP_PIXEL_FORMAT;
99
100typedef enum _PDUMP_MEM_FORMAT_
101{
102 PVRSRV_PDUMP_MEM_FORMAT_STRIDE = 0,
103 PVRSRV_PDUMP_MEM_FORMAT_RESERVED = 1,
104 PVRSRV_PDUMP_MEM_FORMAT_TILED = 8,
105 PVRSRV_PDUMP_MEM_FORMAT_TWIDDLED = 9,
106 PVRSRV_PDUMP_MEM_FORMAT_HYBRID = 10,
107
108 PVRSRV_PDUMP_MEM_FORMAT_FORCE_I32 = 0x7fffffff
109} PDUMP_MEM_FORMAT;
110
111typedef enum _PDUMP_POLL_OPERATOR
112{
113 PDUMP_POLL_OPERATOR_EQUAL = 0,
114 PDUMP_POLL_OPERATOR_LESS = 1,
115 PDUMP_POLL_OPERATOR_LESSEQUAL = 2,
116 PDUMP_POLL_OPERATOR_GREATER = 3,
117 PDUMP_POLL_OPERATOR_GREATEREQUAL = 4,
118 PDUMP_POLL_OPERATOR_NOTEQUAL = 5,
119 PDUMP_POLL_OPERATOR_FORCE_I32 = 0x7fffffff
120} PDUMP_POLL_OPERATOR;
121
122
123#endif /* __PDUMPDEFS_H__ */
124
125/*****************************************************************************
126 End of file (pdumpdefs.h)
127*****************************************************************************/
diff --git a/drivers/gpu/pvr/include4/pvr_debug.h b/drivers/gpu/pvr/include4/pvr_debug.h
new file mode 100644
index 000000000000..be78c7735ee3
--- /dev/null
+++ b/drivers/gpu/pvr/include4/pvr_debug.h
@@ -0,0 +1,283 @@
1/*************************************************************************/ /*!
2@Title PVR Debug Declarations
3@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
4@Description Provides debug functionality
5@License Dual MIT/GPLv2
6
7The contents of this file are subject to the MIT license as set out below.
8
9Permission is hereby granted, free of charge, to any person obtaining a copy
10of this software and associated documentation files (the "Software"), to deal
11in the Software without restriction, including without limitation the rights
12to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13copies of the Software, and to permit persons to whom the Software is
14furnished to do so, subject to the following conditions:
15
16The above copyright notice and this permission notice shall be included in
17all copies or substantial portions of the Software.
18
19Alternatively, the contents of this file may be used under the terms of
20the GNU General Public License Version 2 ("GPL") in which case the provisions
21of GPL are applicable instead of those above.
22
23If you wish to allow use of your version of this file only under the terms of
24GPL, and not to allow others to use your version of this file under the terms
25of the MIT license, indicate your decision by deleting the provisions above
26and replace them with the notice and other provisions required by GPL as set
27out in the file called "GPL-COPYING" included in this distribution. If you do
28not delete the provisions above, a recipient may use your version of this file
29under the terms of either the MIT license or GPL.
30
31This License is also included in this distribution in the file called
32"MIT-COPYING".
33
34EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
35PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
36BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
37PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
38COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
39IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
40CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
41*/ /**************************************************************************/
42#ifndef __PVR_DEBUG_H__
43#define __PVR_DEBUG_H__
44
45
46#include "img_types.h"
47
48
49#if defined (__cplusplus)
50extern "C" {
51#endif
52
53#define PVR_MAX_DEBUG_MESSAGE_LEN (512)
54
55/* These are privately used by pvr_debug, use the PVR_DBG_ defines instead */
56#define DBGPRIV_FATAL 0x001UL
57#define DBGPRIV_ERROR 0x002UL
58#define DBGPRIV_BUFFERED 0x004UL
59#define DBGPRIV_WARNING 0x008UL
60#define DBGPRIV_MESSAGE 0x010UL
61#define DBGPRIV_VERBOSE 0x020UL
62#define DBGPRIV_CALLTRACE 0x040UL
63#define DBGPRIV_ALLOC 0x080UL
64#define DBGPRIV_DBGDRV_MESSAGE 0x100UL
65
66#define DBGPRIV_DBGLEVEL_COUNT 9
67
68#if !defined(PVRSRV_NEED_PVR_ASSERT) && defined(DEBUG)
69#define PVRSRV_NEED_PVR_ASSERT
70#endif
71
72#if defined(PVRSRV_NEED_PVR_ASSERT) && !defined(PVRSRV_NEED_PVR_DPF)
73#define PVRSRV_NEED_PVR_DPF
74#endif
75
76#if !defined(PVRSRV_NEED_PVR_TRACE) && (defined(DEBUG) || defined(TIMING))
77#define PVRSRV_NEED_PVR_TRACE
78#endif
79
80/* PVR_ASSERT() and PVR_DBG_BREAK handling */
81
82#if defined(PVRSRV_NEED_PVR_ASSERT)
83
84#if defined(LINUX) && defined(__KERNEL__)
85/* In Linux kernel mode, use BUG() directly. This produces the correct
86 filename and line number in the panic message. */
87#define PVR_ASSERT(EXPR) do \
88 { \
89 if (!(EXPR)) \
90 { \
91 PVRSRVDebugPrintf(DBGPRIV_FATAL, __FILE__, __LINE__, \
92 "Debug assertion failed!"); \
93 BUG(); \
94 } \
95 } while (0)
96
97#else /* defined(LINUX) && defined(__KERNEL__) */
98
99IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVDebugAssertFail(const IMG_CHAR *pszFile,
100 IMG_UINT32 ui32Line);
101
102#if defined(LINUX)
103 #define PVR_ASSERT(EXPR) do \
104 { \
105 if (!(EXPR)) \
106 PVRSRVDebugAssertFail(__FILE__, __LINE__); \
107 } while (0)
108#else
109 #if defined (__QNXNTO__)
110 #define PVR_ASSERT(EXPR) if (!(EXPR)) PVRSRVDebugAssertFail(__FILE__, __LINE__);
111 #else
112 #define PVR_ASSERT(EXPR) if (!(EXPR)) PVRSRVDebugAssertFail(__FILE__, __LINE__)
113 #endif
114#endif
115
116#endif /* defined(LINUX) && defined(__KERNEL__) */
117
118
119 #if defined(LINUX) && defined(__KERNEL__)
120 #define PVR_DBG_BREAK BUG()
121 #else
122 #define PVR_DBG_BREAK PVRSRVDebugAssertFail(__FILE__, __LINE__)
123 #endif
124
125#else /* defined(PVRSRV_NEED_PVR_ASSERT) */
126
127 #define PVR_ASSERT(EXPR)
128 #define PVR_DBG_BREAK
129
130#endif /* defined(PVRSRV_NEED_PVR_ASSERT) */
131
132
133/* PVR_DPF() handling */
134
135#if defined(PVRSRV_NEED_PVR_DPF)
136
137#if defined(PVRSRV_NEW_PVR_DPF)
138
139 /* New logging mechanism */
140 #define PVR_DBG_FATAL DBGPRIV_FATAL
141 #define PVR_DBG_ERROR DBGPRIV_ERROR
142 #define PVR_DBG_BUFFERED DBGPRIV_BUFFERED
143 #define PVR_DBG_WARNING DBGPRIV_WARNING
144 #define PVR_DBG_MESSAGE DBGPRIV_MESSAGE
145 #define PVR_DBG_VERBOSE DBGPRIV_VERBOSE
146 #define PVR_DBG_CALLTRACE DBGPRIV_CALLTRACE
147 #define PVR_DBG_ALLOC DBGPRIV_ALLOC
148 #define PVR_DBGDRIV_MESSAGE DBGPRIV_DBGDRV_MESSAGE
149
150 /* These levels are always on with PVRSRV_NEED_PVR_DPF */
151 #define __PVR_DPF_0x001UL(x...) PVRSRVDebugPrintf(DBGPRIV_FATAL, x)
152 #define __PVR_DPF_0x002UL(x...) PVRSRVDebugPrintf(DBGPRIV_ERROR, x)
153 #define __PVR_DPF_0x004UL(x...) PVRSRVDebugPrintf(DBGPRIV_BUFFERED, x)
154
155 /* Some are compiled out completely in release builds */
156#if defined(DEBUG)
157 #define __PVR_DPF_0x008UL(x...) PVRSRVDebugPrintf(DBGPRIV_WARNING, x)
158 #define __PVR_DPF_0x010UL(x...) PVRSRVDebugPrintf(DBGPRIV_MESSAGE, x)
159 #define __PVR_DPF_0x020UL(x...) PVRSRVDebugPrintf(DBGPRIV_VERBOSE, x)
160 #define __PVR_DPF_0x040UL(x...) PVRSRVDebugPrintf(DBGPRIV_CALLTRACE, x)
161 #define __PVR_DPF_0x080UL(x...) PVRSRVDebugPrintf(DBGPRIV_ALLOC, x)
162 #define __PVR_DPF_0x100UL(x...) PVRSRVDebugPrintf(DBGPRIV_DBGDRV_MESSAGE, x)
163
164#elif defined(PVR_DBGPRIV_LEVEL)
165
166#if (PVR_DBGPRIV_LEVEL >= DBGPRIV_WARNING)
167 #define __PVR_DPF_0x008UL(x...) PVRSRVDebugPrintf(DBGPRIV_WARNING, x)
168#else
169 #define __PVR_DPF_0x008UL(x...)
170#endif
171
172#if (PVR_DBGPRIV_LEVEL >= DBGPRIV_MESSAGE)
173 #define __PVR_DPF_0x010UL(x...) PVRSRVDebugPrintf(DBGPRIV_MESSAGE, x)
174#else
175 #define __PVR_DPF_0x010UL(x...)
176#endif
177
178#if (PVR_DBGPRIV_LEVEL >= DBGPRIV_VERBOSE)
179 #define __PVR_DPF_0x020UL(x...) PVRSRVDebugPrintf(DBGPRIV_VERBOSE, x)
180#else
181 #define __PVR_DPF_0x020UL(x...)
182#endif
183
184#if (PVR_DBGPRIV_LEVEL >= DBGPRIV_CALLTRACE)
185 #define __PVR_DPF_0x040UL(x...) PVRSRVDebugPrintf(DBGPRIV_CALLTRACE, x)
186#else
187 #define __PVR_DPF_0x040UL(x...)
188#endif
189
190#if (PVR_DBGPRIV_LEVEL >= DBGPRIV_ALLOC)
191 #define __PVR_DPF_0x080UL(x...) PVRSRVDebugPrintf(DBGPRIV_ALLOC, x)
192#else
193 #define __PVR_DPF_0x080UL(x...)
194#endif
195
196#if (PVR_DBGPRIV_LEVEL >= DBGPRIV_DBGDRV_MESSAGE)
197 #define __PVR_DPF_0x100UL(x...) PVRSRVDebugPrintf(DBGPRIV_DBGDRV_MESSAGE, x)
198#else
199 #define __PVR_DPF_0x100UL(x...)
200#endif
201
202#else
203 #define __PVR_DPF_0x008UL(x...)
204 #define __PVR_DPF_0x010UL(x...)
205 #define __PVR_DPF_0x020UL(x...)
206 #define __PVR_DPF_0x040UL(x...)
207 #define __PVR_DPF_0x080UL(x...)
208 #define __PVR_DPF_0x100UL(x...)
209#endif
210
211 /* Translate the different log levels to separate macros
212 * so they can each be compiled out.
213 */
214#if defined(DEBUG)
215 #define __PVR_DPF(lvl, x...) __PVR_DPF_ ## lvl (__FILE__, __LINE__, x)
216#else
217 #define __PVR_DPF(lvl, x...) __PVR_DPF_ ## lvl ("", 0, x)
218#endif
219
220 /* Get rid of the double bracketing */
221 #define PVR_DPF(x) __PVR_DPF x
222
223#else /* defined(PVRSRV_NEW_PVR_DPF) */
224
225 /* Old logging mechanism */
226 #define PVR_DBG_FATAL DBGPRIV_FATAL,__FILE__, __LINE__
227 #define PVR_DBG_ERROR DBGPRIV_ERROR,__FILE__, __LINE__
228 #define PVR_DBG_WARNING DBGPRIV_WARNING,__FILE__, __LINE__
229 #define PVR_DBG_MESSAGE DBGPRIV_MESSAGE,__FILE__, __LINE__
230 #define PVR_DBG_VERBOSE DBGPRIV_VERBOSE,__FILE__, __LINE__
231 #define PVR_DBG_CALLTRACE DBGPRIV_CALLTRACE,__FILE__, __LINE__
232 #define PVR_DBG_ALLOC DBGPRIV_ALLOC,__FILE__, __LINE__
233 #define PVR_DBG_BUFFERED DBGPRIV_BUFFERED,__FILE__, __LINE__
234 #define PVR_DBGDRIV_MESSAGE DBGPRIV_DBGDRV_MESSAGE, "", 0
235
236 #define PVR_DPF(X) PVRSRVDebugPrintf X
237
238#endif /* defined(PVRSRV_NEW_PVR_DPF) */
239
240IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVDebugPrintf(IMG_UINT32 ui32DebugLevel,
241 const IMG_CHAR *pszFileName,
242 IMG_UINT32 ui32Line,
243 const IMG_CHAR *pszFormat,
244 ...) IMG_FORMAT_PRINTF(4, 5);
245
246#if defined(PVR_DBGPRIV_LEVEL) && defined(SUPPORT_ANDROID_PLATFORM)
247IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVDebugPrintfSetLevel(IMG_UINT32 ui32DebugLevel);
248#endif
249
250IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVDebugPrintfDumpCCB(void);
251
252#else /* defined(PVRSRV_NEED_PVR_DPF) */
253
254 #define PVR_DPF(X)
255
256#endif /* defined(PVRSRV_NEED_PVR_DPF) */
257
258/* PVR_TRACE() handling */
259
260#if defined(PVRSRV_NEED_PVR_TRACE)
261
262 #define PVR_TRACE(X) PVRSRVTrace X
263
264IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVTrace(const IMG_CHAR* pszFormat, ... )
265 IMG_FORMAT_PRINTF(1, 2);
266
267#else /* defined(PVRSRV_NEED_PVR_TRACE) */
268
269 #define PVR_TRACE(X)
270
271#endif /* defined(PVRSRV_NEED_PVR_TRACE) */
272
273
274#if defined (__cplusplus)
275}
276#endif
277
278#endif /* __PVR_DEBUG_H__ */
279
280/******************************************************************************
281 End of file (pvr_debug.h)
282******************************************************************************/
283
diff --git a/drivers/gpu/pvr/include4/pvr_sync_user.h b/drivers/gpu/pvr/include4/pvr_sync_user.h
new file mode 100644
index 000000000000..a44293f28862
--- /dev/null
+++ b/drivers/gpu/pvr/include4/pvr_sync_user.h
@@ -0,0 +1,137 @@
1/*************************************************************************/ /*!
2@File pvr_sync_user.h
3@Title Userspace definitions to use the kernel sync driver
4@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
5@Description Version numbers and strings for PVR Consumer services
6 components.
7@License Dual MIT/GPLv2
8
9The contents of this file are subject to the MIT license as set out below.
10
11Permission is hereby granted, free of charge, to any person obtaining a copy
12of this software and associated documentation files (the "Software"), to deal
13in the Software without restriction, including without limitation the rights
14to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15copies of the Software, and to permit persons to whom the Software is
16furnished to do so, subject to the following conditions:
17
18The above copyright notice and this permission notice shall be included in
19all copies or substantial portions of the Software.
20
21Alternatively, the contents of this file may be used under the terms of
22the GNU General Public License Version 2 ("GPL") in which case the provisions
23of GPL are applicable instead of those above.
24
25If you wish to allow use of your version of this file only under the terms of
26GPL, and not to allow others to use your version of this file under the terms
27of the MIT license, indicate your decision by deleting the provisions above
28and replace them with the notice and other provisions required by GPL as set
29out in the file called "GPL-COPYING" included in this distribution. If you do
30not delete the provisions above, a recipient may use your version of this file
31under the terms of either the MIT license or GPL.
32
33This License is also included in this distribution in the file called
34"MIT-COPYING".
35
36EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
37PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
38BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
39PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
40COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
41IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
42CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
43*/ /**************************************************************************/
44
45#ifndef _PVR_SYNC_USER_H_
46#define _PVR_SYNC_USER_H_
47
48#include <linux/ioctl.h>
49
50#ifdef __KERNEL__
51#include "sgxapi_km.h"
52#else
53#include "sgxapi.h"
54#endif
55
56#include "servicesext.h" // PVRSRV_SYNC_DATA
57#include "img_types.h"
58
59/* This matches the sw_sync create ioctl data */
60struct PVR_SYNC_CREATE_IOCTL_DATA
61{
62 /* Input: Name of this sync pt. Passed to base sync driver. */
63 char name[32];
64
65 /* Input: An fd from a previous call to ALLOC ioctl. Cannot be <0. */
66 __s32 allocdSyncInfo;
67
68 /* Output: An fd returned from the CREATE ioctl. */
69 __s32 fence;
70};
71
72struct PVR_SYNC_ALLOC_IOCTL_DATA
73{
74 /* Output: An fd returned from the ALLOC ioctl */
75 __s32 fence;
76
77 /* Output: IMG_TRUE if the timeline looked idle at alloc time */
78 __u32 bTimelineIdle;
79};
80
81#define PVR_SYNC_DEBUG_MAX_POINTS 3
82
83typedef struct
84{
85 /* Output: A globally unique stamp/ID for the sync */
86 IMG_UINT64 ui64Stamp;
87
88 /* Output: The WOP snapshot for the sync */
89 IMG_UINT32 ui32WriteOpsPendingSnapshot;
90}
91PVR_SYNC_DEBUG;
92
93struct PVR_SYNC_DEBUG_IOCTL_DATA
94{
95 /* Input: Fence to acquire debug for */
96 int iFenceFD;
97
98 /* Output: Number of points merged into this fence */
99 IMG_UINT32 ui32NumPoints;
100
101 struct
102 {
103 /* Output: Metadata for sync point */
104 PVR_SYNC_DEBUG sMetaData;
105
106 /* Output: 'Live' sync information. */
107 PVRSRV_SYNC_DATA sSyncData;
108 }
109 sSync[PVR_SYNC_DEBUG_MAX_POINTS];
110};
111
112struct PVR_SYNC_RENAME_IOCTL_DATA
113{
114 /* Input: Name of timeline. */
115 IMG_CHAR szName[32];
116};
117
118#define PVR_SYNC_IOC_MAGIC 'W'
119
120#define PVR_SYNC_IOC_CREATE_FENCE \
121 _IOWR(PVR_SYNC_IOC_MAGIC, 0, struct PVR_SYNC_CREATE_IOCTL_DATA)
122
123#define PVR_SYNC_IOC_DEBUG_FENCE \
124 _IOWR(PVR_SYNC_IOC_MAGIC, 1, struct PVR_SYNC_DEBUG_IOCTL_DATA)
125
126#define PVR_SYNC_IOC_ALLOC_FENCE \
127 _IOWR(PVR_SYNC_IOC_MAGIC, 2, struct PVR_SYNC_ALLOC_IOCTL_DATA)
128
129#define PVR_SYNC_IOC_RENAME \
130 _IOWR(PVR_SYNC_IOC_MAGIC, 3, struct PVR_SYNC_RENAME_IOCTL_DATA)
131
132#define PVR_SYNC_IOC_FORCE_SW_ONLY \
133 _IO(PVR_SYNC_IOC_MAGIC, 4)
134
135#define PVRSYNC_MODNAME "pvr_sync"
136
137#endif /* _PVR_SYNC_USER_H_ */
diff --git a/drivers/gpu/pvr/include4/pvrmodule.h b/drivers/gpu/pvr/include4/pvrmodule.h
new file mode 100644
index 000000000000..267c7b687487
--- /dev/null
+++ b/drivers/gpu/pvr/include4/pvrmodule.h
@@ -0,0 +1,48 @@
1/*************************************************************************/ /*!
2@Title Module Author and License.
3@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
4@License Dual MIT/GPLv2
5
6The contents of this file are subject to the MIT license as set out below.
7
8Permission is hereby granted, free of charge, to any person obtaining a copy
9of this software and associated documentation files (the "Software"), to deal
10in the Software without restriction, including without limitation the rights
11to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12copies of the Software, and to permit persons to whom the Software is
13furnished to do so, subject to the following conditions:
14
15The above copyright notice and this permission notice shall be included in
16all copies or substantial portions of the Software.
17
18Alternatively, the contents of this file may be used under the terms of
19the GNU General Public License Version 2 ("GPL") in which case the provisions
20of GPL are applicable instead of those above.
21
22If you wish to allow use of your version of this file only under the terms of
23GPL, and not to allow others to use your version of this file under the terms
24of the MIT license, indicate your decision by deleting the provisions above
25and replace them with the notice and other provisions required by GPL as set
26out in the file called "GPL-COPYING" included in this distribution. If you do
27not delete the provisions above, a recipient may use your version of this file
28under the terms of either the MIT license or GPL.
29
30This License is also included in this distribution in the file called
31"MIT-COPYING".
32
33EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
34PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
35BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
36PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
37COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
38IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
39CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
40*/ /**************************************************************************/
41
42#ifndef _PVRMODULE_H_
43#define _PVRMODULE_H_
44
45MODULE_AUTHOR("Imagination Technologies Ltd. <gpl-support@imgtec.com>");
46MODULE_LICENSE("Dual MIT/GPL");
47
48#endif /* _PVRMODULE_H_ */
diff --git a/drivers/gpu/pvr/include4/pvrversion.h b/drivers/gpu/pvr/include4/pvrversion.h
new file mode 100644
index 000000000000..b2457fee628e
--- /dev/null
+++ b/drivers/gpu/pvr/include4/pvrversion.h
@@ -0,0 +1,68 @@
1/*************************************************************************/ /*!
2@File
3@Title Version numbers and strings.
4@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
5@Description Version numbers and strings for PVR Consumer services
6 components.
7@License Dual MIT/GPLv2
8
9The contents of this file are subject to the MIT license as set out below.
10
11Permission is hereby granted, free of charge, to any person obtaining a copy
12of this software and associated documentation files (the "Software"), to deal
13in the Software without restriction, including without limitation the rights
14to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15copies of the Software, and to permit persons to whom the Software is
16furnished to do so, subject to the following conditions:
17
18The above copyright notice and this permission notice shall be included in
19all copies or substantial portions of the Software.
20
21Alternatively, the contents of this file may be used under the terms of
22the GNU General Public License Version 2 ("GPL") in which case the provisions
23of GPL are applicable instead of those above.
24
25If you wish to allow use of your version of this file only under the terms of
26GPL, and not to allow others to use your version of this file under the terms
27of the MIT license, indicate your decision by deleting the provisions above
28and replace them with the notice and other provisions required by GPL as set
29out in the file called "GPL-COPYING" included in this distribution. If you do
30not delete the provisions above, a recipient may use your version of this file
31under the terms of either the MIT license or GPL.
32
33This License is also included in this distribution in the file called
34"MIT-COPYING".
35
36EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
37PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
38BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
39PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
40COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
41IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
42CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
43*/ /**************************************************************************/
44
45#ifndef _PVRVERSION_H_
46#define _PVRVERSION_H_
47
48#define PVR_STR(X) #X
49#define PVR_STR2(X) PVR_STR(X)
50
51#define PVRVERSION_MAJ 1
52#define PVRVERSION_MIN 17
53
54#define PVRVERSION_FAMILY "sgxddk"
55#define PVRVERSION_BRANCHNAME "1.17"
56#define PVRVERSION_BUILD 4948957
57#define PVRVERSION_BSCONTROL "SGX_DDK_Android"
58
59#define PVRVERSION_STRING "SGX_DDK_Android sgxddk 1.17@" PVR_STR2(PVRVERSION_BUILD)
60#define PVRVERSION_STRING_SHORT "1.17@" PVR_STR2(PVRVERSION_BUILD) ""
61
62#define COPYRIGHT_TXT "Copyright (c) Imagination Technologies Ltd. All Rights Reserved."
63
64#define PVRVERSION_BUILD_HI 494
65#define PVRVERSION_BUILD_LO 8957
66#define PVRVERSION_STRING_NUMERIC PVR_STR2(PVRVERSION_MAJ) "." PVR_STR2(PVRVERSION_MIN) "." PVR_STR2(PVRVERSION_BUILD_HI) "." PVR_STR2(PVRVERSION_BUILD_LO)
67
68#endif /* _PVRVERSION_H_ */
diff --git a/drivers/gpu/pvr/include4/services.h b/drivers/gpu/pvr/include4/services.h
new file mode 100644
index 000000000000..7ee931810322
--- /dev/null
+++ b/drivers/gpu/pvr/include4/services.h
@@ -0,0 +1,1641 @@
1/*************************************************************************/ /*!
2@Title Services API Header
3@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
4@Description Exported services API details
5@License Dual MIT/GPLv2
6
7The contents of this file are subject to the MIT license as set out below.
8
9Permission is hereby granted, free of charge, to any person obtaining a copy
10of this software and associated documentation files (the "Software"), to deal
11in the Software without restriction, including without limitation the rights
12to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13copies of the Software, and to permit persons to whom the Software is
14furnished to do so, subject to the following conditions:
15
16The above copyright notice and this permission notice shall be included in
17all copies or substantial portions of the Software.
18
19Alternatively, the contents of this file may be used under the terms of
20the GNU General Public License Version 2 ("GPL") in which case the provisions
21of GPL are applicable instead of those above.
22
23If you wish to allow use of your version of this file only under the terms of
24GPL, and not to allow others to use your version of this file under the terms
25of the MIT license, indicate your decision by deleting the provisions above
26and replace them with the notice and other provisions required by GPL as set
27out in the file called "GPL-COPYING" included in this distribution. If you do
28not delete the provisions above, a recipient may use your version of this file
29under the terms of either the MIT license or GPL.
30
31This License is also included in this distribution in the file called
32"MIT-COPYING".
33
34EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
35PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
36BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
37PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
38COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
39IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
40CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
41*/ /**************************************************************************/
42
43#ifndef __SERVICES_H__
44#define __SERVICES_H__
45
46#if defined (__cplusplus)
47extern "C" {
48#endif
49
50#include "img_defs.h"
51#include "servicesext.h"
52#include "pdumpdefs.h"
53
54
55/* The comment below is the front page for code-generated doxygen documentation */
56/*!
57 ******************************************************************************
58 @mainpage
59 This document details the APIs and implementation of the Consumer Services.
60 It is intended to be used in conjunction with the Consumer Services
61 Software Architectural Specification and the Consumer Services Software
62 Functional Specification.
63 *****************************************************************************/
64
65/******************************************************************************
66 * #defines
67 *****************************************************************************/
68
69/* 4k page size definition */
70#define PVRSRV_4K_PAGE_SIZE 4096UL
71
72#define PVRSRV_MAX_CMD_SIZE 1024/*!< max size in bytes of a command */
73
74#define PVRSRV_MAX_DEVICES 16 /*!< Largest supported number of devices on the system */
75
76#define EVENTOBJNAME_MAXLENGTH (64)
77
78/*
79 Flags associated with memory allocation
80 (bits 0-11)
81*/
82#define PVRSRV_MEM_READ (1U<<0)
83#define PVRSRV_MEM_WRITE (1U<<1)
84#define PVRSRV_MEM_CACHE_CONSISTENT (1U<<2)
85#define PVRSRV_MEM_NO_SYNCOBJ (1U<<3)
86#define PVRSRV_MEM_INTERLEAVED (1U<<4)
87#define PVRSRV_MEM_DUMMY (1U<<5)
88#define PVRSRV_MEM_EDM_PROTECT (1U<<6)
89#define PVRSRV_MEM_ZERO (1U<<7)
90#define PVRSRV_MEM_USER_SUPPLIED_DEVVADDR (1U<<8)
91#define PVRSRV_MEM_RAM_BACKED_ALLOCATION (1U<<9)
92#define PVRSRV_MEM_NO_RESMAN (1U<<10)
93#define PVRSRV_MEM_EXPORTED (1U<<11)
94
95/*
96 Heap Attribute flags
97 (bits 12-23)
98*/
99#define PVRSRV_HAP_CACHED (1U<<12)
100#define PVRSRV_HAP_UNCACHED (1U<<13)
101#define PVRSRV_HAP_WRITECOMBINE (1U<<14)
102#define PVRSRV_HAP_CACHETYPE_MASK (PVRSRV_HAP_CACHED|PVRSRV_HAP_UNCACHED|PVRSRV_HAP_WRITECOMBINE)
103#define PVRSRV_HAP_KERNEL_ONLY (1U<<15)
104#define PVRSRV_HAP_SINGLE_PROCESS (1U<<16)
105#define PVRSRV_HAP_MULTI_PROCESS (1U<<17)
106#define PVRSRV_HAP_FROM_EXISTING_PROCESS (1U<<18)
107#define PVRSRV_HAP_NO_CPU_VIRTUAL (1U<<19)
108#define PVRSRV_HAP_MAPTYPE_MASK (PVRSRV_HAP_KERNEL_ONLY \
109 |PVRSRV_HAP_SINGLE_PROCESS \
110 |PVRSRV_HAP_MULTI_PROCESS \
111 |PVRSRV_HAP_FROM_EXISTING_PROCESS \
112 |PVRSRV_HAP_NO_CPU_VIRTUAL)
113
114/*
115 Allows user allocations to override heap attributes
116 (Bits shared with heap flags)
117*/
118#define PVRSRV_MEM_CACHED PVRSRV_HAP_CACHED
119#define PVRSRV_MEM_UNCACHED PVRSRV_HAP_UNCACHED
120#define PVRSRV_MEM_WRITECOMBINE PVRSRV_HAP_WRITECOMBINE
121
122/*
123 Backing store flags (defined internally)
124 (bits 24-26)
125*/
126#define PVRSRV_MEM_BACKINGSTORE_FIELD_SHIFT (24)
127
128/*
129 Per allocation/mapping flags
130 (bits 27-30)
131 */
132#define PVRSRV_MAP_NOUSERVIRTUAL (1UL<<27)
133#define PVRSRV_MEM_XPROC (1U<<28)
134/* Bit 29 is unused */
135#define PVRSRV_MEM_ALLOCATENONCACHEDMEM (1UL<<30)
136
137/*
138 Internal allocation/mapping flags
139 (bit 31)
140*/
141#define PVRSRV_MEM_SPARSE (1U<<31)
142
143
144/*
145 * How much context we lose on a (power) mode change
146 */
147#define PVRSRV_NO_CONTEXT_LOSS 0 /*!< Do not lose state on power down */
148#define PVRSRV_SEVERE_LOSS_OF_CONTEXT 1 /*!< lose state on power down */
149#define PVRSRV_PRE_STATE_CHANGE_MASK 0x80 /*!< power state change mask */
150
151
152/*
153 * Device cookie defines
154 */
155#define PVRSRV_DEFAULT_DEV_COOKIE (1) /*!< default device cookie */
156
157
158/*
159 * Misc Info. present flags
160 */
161#define PVRSRV_MISC_INFO_TIMER_PRESENT (1U<<0)
162#define PVRSRV_MISC_INFO_CLOCKGATE_PRESENT (1U<<1)
163#define PVRSRV_MISC_INFO_MEMSTATS_PRESENT (1U<<2)
164#define PVRSRV_MISC_INFO_GLOBALEVENTOBJECT_PRESENT (1U<<3)
165#define PVRSRV_MISC_INFO_DDKVERSION_PRESENT (1U<<4)
166#define PVRSRV_MISC_INFO_CPUCACHEOP_PRESENT (1U<<5)
167#define PVRSRV_MISC_INFO_FREEMEM_PRESENT (1U<<6)
168#define PVRSRV_MISC_INFO_GET_REF_COUNT_PRESENT (1U<<7)
169#define PVRSRV_MISC_INFO_GET_PAGE_SIZE_PRESENT (1U<<8)
170#define PVRSRV_MISC_INFO_FORCE_SWAP_TO_SYSTEM_PRESENT (1U<<9)
171
172#define PVRSRV_MISC_INFO_RESET_PRESENT (1U<<31)
173
174/* PDUMP defines */
175#define PVRSRV_PDUMP_MAX_FILENAME_SIZE 20
176#define PVRSRV_PDUMP_MAX_COMMENT_SIZE 200
177
178
179/*
180 Flags for PVRSRVChangeDeviceMemoryAttributes call.
181*/
182#define PVRSRV_CHANGEDEVMEM_ATTRIBS_CACHECOHERENT 0x00000001
183
184/*
185 Flags for PVRSRVMapExtMemory and PVRSRVUnmapExtMemory
186 ALTERNATEVA - Used when mapping multiple virtual addresses to the same physical address. Set this flag on extra maps.
187 PHYSCONTIG - Physical pages are contiguous (unused)
188*/
189#define PVRSRV_MAPEXTMEMORY_FLAGS_ALTERNATEVA 0x00000001
190#define PVRSRV_MAPEXTMEMORY_FLAGS_PHYSCONTIG 0x00000002
191
192/*
193 Flags for PVRSRVModifySyncOps
194 WO_INC - Used to increment "WriteOpsPending/complete of sync info"
195 RO_INC - Used to increment "ReadOpsPending/complete of sync info"
196 RO2_INC - Used to increment "ReadOps2Pending/complete of sync info"
197*/
198#define PVRSRV_MODIFYSYNCOPS_FLAGS_WO_INC (1U<<0)
199#define PVRSRV_MODIFYSYNCOPS_FLAGS_RO_INC (1U<<1)
200#define PVRSRV_MODIFYSYNCOPS_FLAGS_RO2_INC (1U<<2)
201
202/*
203 Flags for Services connection.
204 Allows to define per-client policy for Services
205*/
206#define SRV_FLAGS_PERSIST 0x1
207#define SRV_FLAGS_PDUMP_ACTIVE 0x2
208
209/*
210 Pdump flags which are accessible to Services clients
211*/
212#define PVRSRV_PDUMP_FLAGS_CONTINUOUS 0x1
213
214
215/******************************************************************************
216 * Enums
217 *****************************************************************************/
218
219/*!
220 ******************************************************************************
221 * List of known device types.
222 *****************************************************************************/
223typedef enum _PVRSRV_DEVICE_TYPE_
224{
225 PVRSRV_DEVICE_TYPE_UNKNOWN = 0 ,
226 PVRSRV_DEVICE_TYPE_MBX1 = 1 ,
227 PVRSRV_DEVICE_TYPE_MBX1_LITE = 2 ,
228
229 PVRSRV_DEVICE_TYPE_M24VA = 3,
230 PVRSRV_DEVICE_TYPE_MVDA2 = 4,
231 PVRSRV_DEVICE_TYPE_MVED1 = 5,
232 PVRSRV_DEVICE_TYPE_MSVDX = 6,
233
234 PVRSRV_DEVICE_TYPE_SGX = 7,
235
236 PVRSRV_DEVICE_TYPE_VGX = 8,
237
238 /* 3rd party devices take ext type */
239 PVRSRV_DEVICE_TYPE_EXT = 9,
240
241 PVRSRV_DEVICE_TYPE_LAST = 9,
242
243 PVRSRV_DEVICE_TYPE_FORCE_I32 = 0x7fffffff
244
245} PVRSRV_DEVICE_TYPE;
246
247#define HEAP_ID( _dev_ , _dev_heap_idx_ ) ( ((_dev_)<<24) | ((_dev_heap_idx_)&((1<<24)-1)) )
248#define HEAP_IDX( _heap_id_ ) ( (_heap_id_)&((1<<24) - 1 ) )
249#define HEAP_DEV( _heap_id_ ) ( (_heap_id_)>>24 )
250
251/* common undefined heap ID define */
252#define PVRSRV_UNDEFINED_HEAP_ID (~0LU)
253
254/*!
255 ******************************************************************************
256 * User Module type
257 *****************************************************************************/
258typedef enum
259{
260 IMG_EGL = 0x00000001,
261 IMG_OPENGLES1 = 0x00000002,
262 IMG_OPENGLES2 = 0x00000003,
263 IMG_D3DM = 0x00000004,
264 IMG_SRV_UM = 0x00000005,
265 IMG_OPENVG = 0x00000006,
266 IMG_SRVCLIENT = 0x00000007,
267 IMG_VISTAKMD = 0x00000008,
268 IMG_VISTA3DNODE = 0x00000009,
269 IMG_VISTAMVIDEONODE = 0x0000000A,
270 IMG_VISTAVPBNODE = 0x0000000B,
271 IMG_OPENGL = 0x0000000C,
272 IMG_D3D = 0x0000000D,
273#if defined(SUPPORT_GRAPHICS_HAL) || defined(SUPPORT_COMPOSER_HAL)
274 IMG_ANDROID_HAL = 0x0000000E,
275#endif
276#if defined(SUPPORT_OPENCL)
277 IMG_OPENCL = 0x0000000F,
278#endif
279
280 IMG_MODULE_UNDEF = 0xFFFFFFFF
281} IMG_MODULE_ID;
282
283
284#define APPHINT_MAX_STRING_SIZE 256
285
286/*!
287 ******************************************************************************
288 * IMG data types
289 *****************************************************************************/
290typedef enum
291{
292 IMG_STRING_TYPE = 1,
293 IMG_FLOAT_TYPE ,
294 IMG_UINT_TYPE ,
295 IMG_INT_TYPE ,
296 IMG_FLAG_TYPE
297}IMG_DATA_TYPE;
298
299
300/******************************************************************************
301 * Structure definitions.
302 *****************************************************************************/
303
304/*!
305 * Forward declaration
306 */
307typedef struct _PVRSRV_DEV_DATA_ *PPVRSRV_DEV_DATA;
308
309/*!
310 ******************************************************************************
311 * Device identifier structure
312 *****************************************************************************/
313typedef struct _PVRSRV_DEVICE_IDENTIFIER_
314{
315 PVRSRV_DEVICE_TYPE eDeviceType; /*!< Identifies the type of the device */
316 PVRSRV_DEVICE_CLASS eDeviceClass; /*!< Identifies more general class of device - display/3d/mpeg etc */
317 IMG_UINT32 ui32DeviceIndex; /*!< Index of the device within the system */
318#if defined(USE_64BIT_COMPAT)
319 IMG_UINT32 ui32Padding;
320#endif
321#if defined(PDUMP)
322 IMG_CHAR *pszPDumpDevName; /*!< Pdump memory bank name */
323 IMG_CHAR *pszPDumpRegName; /*!< Pdump register bank name */
324#endif
325
326} PVRSRV_DEVICE_IDENTIFIER;
327
328
329/******************************************************************************
330 * Client dev info
331 ******************************************************************************
332 */
333typedef struct _PVRSRV_CLIENT_DEV_DATA_
334{
335 IMG_UINT32 ui32NumDevices; /*!< Number of services-managed devices connected */
336 PVRSRV_DEVICE_IDENTIFIER asDevID[PVRSRV_MAX_DEVICES]; /*!< Device identifiers */
337 PVRSRV_ERROR (*apfnDevConnect[PVRSRV_MAX_DEVICES])(PPVRSRV_DEV_DATA); /*< device-specific connection callback */
338 PVRSRV_ERROR (*apfnDumpTrace[PVRSRV_MAX_DEVICES])(PPVRSRV_DEV_DATA); /*!< device-specific debug trace callback */
339
340} PVRSRV_CLIENT_DEV_DATA;
341
342
343/*!
344 ******************************************************************************
345 * Kernel Services connection structure
346 *****************************************************************************/
347typedef struct _PVRSRV_CONNECTION_
348{
349 IMG_HANDLE hServices; /*!< UM IOCTL handle */
350 IMG_UINT32 ui32ProcessID; /*!< Process ID for resource locking */
351 PVRSRV_CLIENT_DEV_DATA sClientDevData; /*!< Client device data */
352 IMG_UINT32 ui32SrvFlags; /*!< Per-client Services flags */
353}PVRSRV_CONNECTION;
354
355
356/*!
357 ******************************************************************************
358 * This structure allows the user mode glue code to have an OS independent
359 * set of prototypes.
360 *****************************************************************************/
361typedef struct _PVRSRV_DEV_DATA_
362{
363 IMG_HANDLE hConnection; /*!< Services connection info */
364 IMG_HANDLE hDevCookie; /*!< Dev cookie */
365
366} PVRSRV_DEV_DATA;
367
368/*!
369 ******************************************************************************
370 * address:value update structure
371 *****************************************************************************/
372typedef struct _PVRSRV_MEMUPDATE_
373{
374 IMG_UINT32 ui32UpdateAddr; /*!< Address */
375 IMG_UINT32 ui32UpdateVal; /*!< value */
376} PVRSRV_MEMUPDATE;
377
378/*!
379 ******************************************************************************
380 * address:value register structure
381 *****************************************************************************/
382typedef struct _PVRSRV_HWREG_
383{
384 IMG_UINT32 ui32RegAddr; /*!< Address */
385 IMG_UINT32 ui32RegVal; /*!< value */
386} PVRSRV_HWREG;
387
388/*!
389 ******************************************************************************
390 * Implementation details for memory handling
391 *****************************************************************************/
392typedef struct _PVRSRV_MEMBLK_
393{
394 IMG_DEV_VIRTADDR sDevVirtAddr; /*!< Address of the memory in the IMG MMUs address space */
395 IMG_HANDLE hOSMemHandle; /*!< Stores the underlying memory allocation handle */
396 IMG_HANDLE hOSWrapMem; /*!< FIXME: better way to solve this problem */
397 IMG_HANDLE hBuffer; /*!< Stores the BM_HANDLE for the underlying memory management */
398 IMG_HANDLE hResItem; /*!< handle to resource item for allocate */
399 IMG_SYS_PHYADDR *psIntSysPAddr;
400
401} PVRSRV_MEMBLK;
402
403/*!
404 ******************************************************************************
405 * Memory Management (externel interface)
406 *****************************************************************************/
407#if defined (PVRSRV_DEVMEM_TIME_STATS)
408typedef struct _DEVMEM_UNMAPPING_TIME_STATS_
409{
410 IMG_UINT32 ui32TimeToCPUUnmap;
411 IMG_UINT32 ui32TimeToDevUnmap;
412} DEVMEM_UNMAPPING_TIME_STATS;
413
414typedef struct _PVRSRV_DEVMEM_TIMING_STATS_
415{
416 /* This struct holds time taken to map/unmap device memory into CPU/GPU in microsec granularity */
417 struct
418 {
419 IMG_UINT32 ui32TimeToCPUMap;
420 IMG_UINT32 ui32TimeToDevMap;
421 } sDevMemMapTimes;
422
423 DEVMEM_UNMAPPING_TIME_STATS *psDevMemUnmapTimes; /* User supplied space for "unmap" timings */
424} PVRSRV_DEVMEM_TIMING_STATS;
425#endif
426
427typedef struct _PVRSRV_KERNEL_MEM_INFO_ *PPVRSRV_KERNEL_MEM_INFO;
428
429typedef struct _PVRSRV_CLIENT_MEM_INFO_
430{
431 /* CPU Virtual Address */
432 IMG_PVOID pvLinAddr;
433
434 /* CPU Virtual Address (for kernel mode) */
435 IMG_PVOID pvLinAddrKM;
436
437 /* Device Virtual Address */
438 IMG_DEV_VIRTADDR sDevVAddr;
439
440 /* allocation flags */
441 IMG_UINT32 ui32Flags;
442
443 /* client allocation flags */
444 IMG_UINT32 ui32ClientFlags;
445
446 /* allocation size in bytes */
447 IMG_SIZE_T uAllocSize;
448
449
450 /* ptr to associated client sync info - NULL if no sync */
451 struct _PVRSRV_CLIENT_SYNC_INFO_ *psClientSyncInfo;
452
453 /* handle to client mapping data (OS specific) */
454 IMG_HANDLE hMappingInfo;
455
456 /* handle to kernel mem info */
457 IMG_HANDLE hKernelMemInfo;
458
459 /* resman handle for UM mapping clean-up */
460 IMG_HANDLE hResItem;
461
462#if defined(SUPPORT_MEMINFO_IDS)
463 #if !defined(USE_CODE)
464 /* Globally unique "stamp" for allocation (not re-used until wrap) */
465 IMG_UINT64 ui64Stamp;
466 #else /* !defined(USE_CODE) */
467 IMG_UINT32 dummy1;
468 IMG_UINT32 dummy2;
469 #endif /* !defined(USE_CODE) */
470#endif /* defined(SUPPORT_MEMINFO_IDS) */
471#if defined(SUPPORT_ION)
472 IMG_SIZE_T uiIonBufferSize;
473#endif /* defined(SUPPORT_ION) */
474#if defined(SUPPORT_DMABUF)
475 IMG_SIZE_T uiDmaBufSize;
476#endif /* defined(SUPPORT_ION) */
477
478#if defined (PVRSRV_DEVMEM_TIME_STATS)
479 PVRSRV_DEVMEM_TIMING_STATS sDevMemTimingStats;
480#endif
481
482 /*
483 ptr to next mem info
484 D3D uses psNext for mid-scene texture reload.
485 */
486 struct _PVRSRV_CLIENT_MEM_INFO_ *psNext;
487
488} PVRSRV_CLIENT_MEM_INFO, *PPVRSRV_CLIENT_MEM_INFO;
489
490
491/*!
492 ******************************************************************************
493 * Memory Heap Information
494 *****************************************************************************/
495#define PVRSRV_MAX_CLIENT_HEAPS (32)
496typedef struct _PVRSRV_HEAP_INFO_
497{
498 IMG_UINT32 ui32HeapID;
499#if defined(USE_64BIT_COMPAT)
500 IMG_UINT32 ui32Padding;
501#endif
502 IMG_HANDLE hDevMemHeap;
503 IMG_DEV_VIRTADDR sDevVAddrBase;
504 IMG_UINT32 ui32HeapByteSize;
505 IMG_UINT32 ui32Attribs;
506 IMG_UINT32 ui32XTileStride;
507}PVRSRV_HEAP_INFO;
508
509
510
511
512/*
513 Event Object information structure
514*/
515typedef struct _PVRSRV_EVENTOBJECT_
516{
517 /* globally unique name of the event object */
518 IMG_CHAR szName[EVENTOBJNAME_MAXLENGTH];
519 /* kernel specific handle for the event object */
520 IMG_HANDLE hOSEventKM;
521
522} PVRSRV_EVENTOBJECT;
523
524/*
525 Cache operation type
526*/
527typedef enum
528{
529 PVRSRV_MISC_INFO_CPUCACHEOP_NONE = 0,
530 PVRSRV_MISC_INFO_CPUCACHEOP_CLEAN,
531 PVRSRV_MISC_INFO_CPUCACHEOP_FLUSH,
532 PVRSRV_MISC_INFO_CPUCACHEOP_MAX = 0x7fffffff
533} PVRSRV_MISC_INFO_CPUCACHEOP_TYPE;
534
535/*!
536 ******************************************************************************
537 * Structure to retrieve misc. information from services
538 *****************************************************************************/
539typedef struct _PVRSRV_MISC_INFO_
540{
541 IMG_UINT32 ui32StateRequest; /*!< requested State Flags */
542 IMG_UINT32 ui32StatePresent; /*!< Present/Valid State Flags */
543
544 /*!< SOC Timer register */
545 IMG_VOID *pvSOCTimerRegisterKM;
546 IMG_VOID *pvSOCTimerRegisterUM;
547 IMG_HANDLE hSOCTimerRegisterOSMemHandle;
548 IMG_HANDLE hSOCTimerRegisterMappingInfo;
549
550 /*!< SOC Clock Gating registers */
551 IMG_VOID *pvSOCClockGateRegs;
552 IMG_UINT32 ui32SOCClockGateRegsSize;
553
554 /* Memory Stats/DDK version string depending on ui32StateRequest flags */
555 IMG_CHAR *pszMemoryStr;
556 IMG_UINT32 ui32MemoryStrLen;
557
558 /* global event object */
559 PVRSRV_EVENTOBJECT sGlobalEventObject;//FIXME: should be private to services
560 IMG_HANDLE hOSGlobalEvent;
561
562 /* Note: add misc. items as required */
563 IMG_UINT32 aui32DDKVersion[4];
564
565 /*!< CPU cache flush controls: */
566 struct
567 {
568 /*!< Defer the CPU cache op to the next HW op to be submitted (else flush now) */
569 IMG_BOOL bDeferOp;
570
571 /*!< Type of cache operation to perform */
572 PVRSRV_MISC_INFO_CPUCACHEOP_TYPE eCacheOpType;
573
574 /* This union is a bit unsightly. We need it because we'll use the psMemInfo
575 * directly in the srvclient PVRSRVGetMiscInfo code, and then convert it
576 * to a kernel meminfo if required. Try to not waste space.
577 */
578 union
579 {
580 /*!< Input client meminfo (UM side) */
581 PVRSRV_CLIENT_MEM_INFO *psClientMemInfo;
582
583 /*!< Output kernel meminfo (Bridge+KM side) */
584 IMG_HANDLE hKernelMemInfo;
585 } u;
586
587 /*!< Offset in MemInfo to start cache op */
588 IMG_VOID *pvBaseVAddr;
589
590 /*!< Length of range to perform cache op */
591 IMG_UINT32 ui32Length;
592 } sCacheOpCtl;
593
594 /*!< Meminfo refcount controls: */
595 struct
596 {
597 /* This union is a bit unsightly. We need it because we'll use the psMemInfo
598 * directly in the srvclient PVRSRVGetMiscInfo code, and then convert it
599 * to a kernel meminfo if required. Try to not waste space.
600 */
601 union
602 {
603 /*!< Input client meminfo (UM side) */
604 PVRSRV_CLIENT_MEM_INFO *psClientMemInfo;
605
606 /*!< Output kernel meminfo (Bridge+KM side) */
607 IMG_HANDLE hKernelMemInfo;
608 } u;
609
610 /*!< Resulting refcount */
611 IMG_UINT32 ui32RefCount;
612 } sGetRefCountCtl;
613
614 IMG_UINT32 ui32PageSize;
615} PVRSRV_MISC_INFO;
616
617/*!
618 ******************************************************************************
619 * Synchronisation token
620 *****************************************************************************/
621typedef struct _PVRSRV_SYNC_TOKEN_
622{
623 /* This token is supposed to be passed around as an opaque object
624 - caller should not rely on the internal fields staying the same.
625 The fields are hidden in sPrivate in order to reinforce this. */
626 struct
627 {
628 IMG_HANDLE hKernelSyncInfo;
629 IMG_UINT32 ui32ReadOpsPendingSnapshot;
630 IMG_UINT32 ui32WriteOpsPendingSnapshot;
631 IMG_UINT32 ui32ReadOps2PendingSnapshot;
632 } sPrivate;
633} PVRSRV_SYNC_TOKEN;
634
635
636/******************************************************************************
637 * PVR Client Event handling in Services
638 *****************************************************************************/
639typedef enum _PVRSRV_CLIENT_EVENT_
640{
641 PVRSRV_CLIENT_EVENT_HWTIMEOUT = 0
642} PVRSRV_CLIENT_EVENT;
643
644typedef IMG_VOID (*PFN_QUEUE_COMMAND_COMPLETE)(IMG_HANDLE hCallbackData);
645
646IMG_IMPORT
647PVRSRV_ERROR IMG_CALLCONV PVRSRVClientEvent(IMG_CONST PVRSRV_CLIENT_EVENT eEvent,
648 PVRSRV_DEV_DATA *psDevData,
649 IMG_PVOID pvData);
650
651/******************************************************************************
652 * PVR Services API prototypes.
653 *****************************************************************************/
654IMG_IMPORT
655PVRSRV_ERROR IMG_CALLCONV PVRSRVConnect(PVRSRV_CONNECTION **ppsConnection, IMG_UINT32 ui32SrvFlags);
656
657IMG_IMPORT
658PVRSRV_ERROR IMG_CALLCONV PVRSRVDisconnect(IMG_HANDLE hConnection);
659
660IMG_IMPORT
661PVRSRV_ERROR IMG_CALLCONV PVRSRVEnumerateDevices(IMG_CONST PVRSRV_CONNECTION *psConnection,
662 IMG_UINT32 *puiNumDevices,
663 PVRSRV_DEVICE_IDENTIFIER *puiDevIDs);
664IMG_IMPORT
665PVRSRV_ERROR IMG_CALLCONV PVRSRVAcquireDeviceData(IMG_CONST PVRSRV_CONNECTION *psConnection,
666 IMG_UINT32 uiDevIndex,
667 PVRSRV_DEV_DATA *psDevData,
668 PVRSRV_DEVICE_TYPE eDeviceType);
669IMG_IMPORT
670PVRSRV_ERROR IMG_CALLCONV PVRSRVGetMiscInfo (IMG_HANDLE hConnection, PVRSRV_MISC_INFO *psMiscInfo);
671
672IMG_IMPORT
673PVRSRV_ERROR IMG_CALLCONV PVRSRVReleaseMiscInfo (IMG_HANDLE hConnection, PVRSRV_MISC_INFO *psMiscInfo);
674
675IMG_IMPORT
676PVRSRV_ERROR PVRSRVPollForValue ( const PVRSRV_CONNECTION *psConnection,
677 IMG_HANDLE hOSEvent,
678 volatile IMG_UINT32 *pui32LinMemAddr,
679 IMG_UINT32 ui32Value,
680 IMG_UINT32 ui32Mask,
681 IMG_UINT32 ui32Waitus,
682 IMG_UINT32 ui32Tries);
683
684/* memory APIs */
685IMG_IMPORT
686PVRSRV_ERROR IMG_CALLCONV PVRSRVCreateDeviceMemContext(IMG_CONST PVRSRV_DEV_DATA *psDevData,
687 IMG_HANDLE *phDevMemContext,
688 IMG_UINT32 *pui32SharedHeapCount,
689 PVRSRV_HEAP_INFO *psHeapInfo);
690
691IMG_IMPORT
692PVRSRV_ERROR IMG_CALLCONV PVRSRVDestroyDeviceMemContext(IMG_CONST PVRSRV_DEV_DATA *psDevData,
693 IMG_HANDLE hDevMemContext
694 );
695
696IMG_IMPORT
697PVRSRV_ERROR IMG_CALLCONV PVRSRVGetDeviceMemHeapInfo(IMG_CONST PVRSRV_DEV_DATA *psDevData,
698 IMG_HANDLE hDevMemContext,
699 IMG_UINT32 *pui32SharedHeapCount,
700 PVRSRV_HEAP_INFO *psHeapInfo);
701
702#if defined(PVRSRV_LOG_MEMORY_ALLOCS)
703 #define PVRSRVAllocDeviceMem_log(psDevData, hDevMemHeap, ui32Attribs, ui32Size, ui32Alignment, ppsMemInfo, logStr) \
704 (PVR_TRACE(("PVRSRVAllocDeviceMem(" #psDevData "," #hDevMemHeap "," #ui32Attribs "," #ui32Size "," #ui32Alignment "," #ppsMemInfo ")" \
705 ": " logStr " (size = 0x%lx)", (unsigned long)ui32Size)), \
706 PVRSRVAllocDeviceMem(psDevData, hDevMemHeap, ui32Attribs, ui32Size, ui32Alignment, ppsMemInfo))
707#else
708 #define PVRSRVAllocDeviceMem_log(psDevData, hDevMemHeap, ui32Attribs, ui32Size, ui32Alignment, ppsMemInfo, logStr) \
709 PVRSRVAllocDeviceMem(psDevData, hDevMemHeap, ui32Attribs, ui32Size, ui32Alignment, ppsMemInfo)
710#endif
711
712
713IMG_IMPORT
714PVRSRV_ERROR IMG_CALLCONV PVRSRVAllocDeviceMem2(IMG_CONST PVRSRV_DEV_DATA *psDevData,
715 IMG_HANDLE hDevMemHeap,
716 IMG_UINT32 ui32Attribs,
717 IMG_SIZE_T ui32Size,
718 IMG_SIZE_T ui32Alignment,
719 IMG_PVOID pvPrivData,
720 IMG_UINT32 ui32PrivDataLength,
721 PVRSRV_CLIENT_MEM_INFO **ppsMemInfo);
722
723IMG_IMPORT
724PVRSRV_ERROR IMG_CALLCONV PVRSRVAllocDeviceMem(IMG_CONST PVRSRV_DEV_DATA *psDevData,
725 IMG_HANDLE hDevMemHeap,
726 IMG_UINT32 ui32Attribs,
727 IMG_SIZE_T ui32Size,
728 IMG_SIZE_T ui32Alignment,
729 PVRSRV_CLIENT_MEM_INFO **ppsMemInfo);
730
731IMG_IMPORT
732PVRSRV_ERROR IMG_CALLCONV PVRSRVFreeDeviceMem(IMG_CONST PVRSRV_DEV_DATA *psDevData,
733 PVRSRV_CLIENT_MEM_INFO *psMemInfo);
734
735IMG_IMPORT
736PVRSRV_ERROR IMG_CALLCONV PVRSRVExportDeviceMem(IMG_CONST PVRSRV_DEV_DATA *psDevData,
737 PVRSRV_CLIENT_MEM_INFO *psMemInfo,
738 IMG_HANDLE *phMemInfo
739 );
740
741IMG_IMPORT
742PVRSRV_ERROR IMG_CALLCONV PVRSRVReserveDeviceVirtualMem(IMG_CONST PVRSRV_DEV_DATA *psDevData,
743 IMG_HANDLE hDevMemHeap,
744 IMG_DEV_VIRTADDR *psDevVAddr,
745 IMG_SIZE_T ui32Size,
746 IMG_SIZE_T ui32Alignment,
747 PVRSRV_CLIENT_MEM_INFO **ppsMemInfo);
748IMG_IMPORT
749PVRSRV_ERROR IMG_CALLCONV PVRSRVFreeDeviceVirtualMem(IMG_CONST PVRSRV_DEV_DATA *psDevData,
750 PVRSRV_CLIENT_MEM_INFO *psMemInfo);
751
752IMG_IMPORT
753PVRSRV_ERROR IMG_CALLCONV PVRSRVMapDeviceMemory (IMG_CONST PVRSRV_DEV_DATA *psDevData,
754 IMG_HANDLE hKernelMemInfo,
755 IMG_HANDLE hDstDevMemHeap,
756 PVRSRV_CLIENT_MEM_INFO **ppsDstMemInfo);
757
758IMG_IMPORT
759PVRSRV_ERROR IMG_CALLCONV PVRSRVUnmapDeviceMemory (IMG_CONST PVRSRV_DEV_DATA *psDevData,
760 PVRSRV_CLIENT_MEM_INFO *psMemInfo);
761
762IMG_IMPORT
763PVRSRV_ERROR IMG_CALLCONV PVRSRVMapExtMemory (IMG_CONST PVRSRV_DEV_DATA *psDevData,
764 PVRSRV_CLIENT_MEM_INFO *psMemInfo,
765 IMG_SYS_PHYADDR *psSysPAddr,
766 IMG_UINT32 ui32Flags);
767IMG_IMPORT
768PVRSRV_ERROR IMG_CALLCONV PVRSRVUnmapExtMemory (IMG_CONST PVRSRV_DEV_DATA *psDevData,
769 PVRSRV_CLIENT_MEM_INFO *psMemInfo,
770 IMG_UINT32 ui32Flags);
771
772IMG_IMPORT
773PVRSRV_ERROR IMG_CALLCONV PVRSRVWrapExtMemory(IMG_CONST PVRSRV_DEV_DATA *psDevData,
774 IMG_HANDLE hDevMemContext,
775 IMG_SIZE_T ui32ByteSize,
776 IMG_SIZE_T ui32PageOffset,
777 IMG_BOOL bPhysContig,
778 IMG_SYS_PHYADDR *psSysPAddr,
779 IMG_VOID *pvLinAddr,
780 IMG_UINT32 ui32Flags,
781 PVRSRV_CLIENT_MEM_INFO **ppsMemInfo);
782IMG_IMPORT
783PVRSRV_ERROR IMG_CALLCONV PVRSRVUnwrapExtMemory (IMG_CONST PVRSRV_DEV_DATA *psDevData,
784 PVRSRV_CLIENT_MEM_INFO *psMemInfo);
785
786PVRSRV_ERROR PVRSRVChangeDeviceMemoryAttributes(IMG_CONST PVRSRV_DEV_DATA *psDevData,
787 PVRSRV_CLIENT_MEM_INFO *psClientMemInfo,
788 IMG_UINT32 ui32Attribs);
789
790IMG_IMPORT
791PVRSRV_ERROR IMG_CALLCONV PVRSRVMapPhysToUserSpace(IMG_CONST PVRSRV_DEV_DATA *psDevData,
792 IMG_SYS_PHYADDR sSysPhysAddr,
793 IMG_UINT32 uiSizeInBytes,
794 IMG_PVOID *ppvUserAddr,
795 IMG_UINT32 *puiActualSize,
796 IMG_PVOID *ppvProcess);
797
798IMG_IMPORT
799PVRSRV_ERROR IMG_CALLCONV PVRSRVUnmapPhysToUserSpace(IMG_CONST PVRSRV_DEV_DATA *psDevData,
800 IMG_PVOID pvUserAddr,
801 IMG_PVOID pvProcess);
802
803#if defined(LINUX)
804IMG_IMPORT
805PVRSRV_ERROR IMG_CALLCONV PVRSRVExportDeviceMem2(IMG_CONST PVRSRV_DEV_DATA *psDevData,
806 PVRSRV_CLIENT_MEM_INFO *psMemInfo,
807 IMG_INT *iFd);
808
809IMG_IMPORT
810PVRSRV_ERROR IMG_CALLCONV PVRSRVMapDeviceMemory2(IMG_CONST PVRSRV_DEV_DATA *psDevData,
811 IMG_INT iFd,
812 IMG_HANDLE hDstDevMemHeap,
813 PVRSRV_CLIENT_MEM_INFO **ppsDstMemInfo);
814#endif /* defined(LINUX) */
815
816#if defined(SUPPORT_TEXTURE_ALLOC_NOMAP)
817IMG_IMPORT
818PVRSRV_ERROR IMG_CALLCONV PVRSRVMapDeviceMem(IMG_CONST PVRSRV_DEV_DATA *psDevData, PVRSRV_CLIENT_MEM_INFO *psMemInfo, void **ppvLinAddr);
819
820IMG_IMPORT
821void IMG_CALLCONV PVRSRVUnmapDeviceMem(IMG_CONST PVRSRV_DEV_DATA *psDevData, PVRSRV_CLIENT_MEM_INFO *psMemInfo, void **ppvLinAddr);
822#endif /* defined(SUPPORT_TEXTURE_ALLOC_NOMAP) */
823
824#if defined(SUPPORT_ION)
825PVRSRV_ERROR PVRSRVMapIonHandle(const PVRSRV_DEV_DATA *psDevData,
826 IMG_HANDLE hDevMemHeap,
827 IMG_UINT32 ui32NumFDs,
828 IMG_INT *paiBufferFDs,
829 IMG_UINT32 ui32ChunkCount,
830 IMG_SIZE_T *pauiOffset,
831 IMG_SIZE_T *pauiSize,
832 IMG_UINT32 ui32Attribs,
833 PVRSRV_CLIENT_MEM_INFO **ppsMemInfo);
834
835PVRSRV_ERROR PVRSRVUnmapIonHandle(const PVRSRV_DEV_DATA *psDevData,
836 PVRSRV_CLIENT_MEM_INFO *psMemInfo);
837#endif /* defined (SUPPORT_ION) */
838
839#if defined(SUPPORT_DMABUF)
840IMG_IMPORT
841PVRSRV_ERROR PVRSRVMapDmaBuf(const PVRSRV_DEV_DATA *psDevData,
842 const IMG_HANDLE hDevMemHeap,
843 const IMG_UINT32 ui32Attribs,
844 const IMG_INT iDmaBufFD,
845 const IMG_SIZE_T uiDmaBufOffset,
846 const IMG_SIZE_T uiDmaBufSize,
847 PVRSRV_CLIENT_MEM_INFO **ppsMemInfo,
848 IMG_SIZE_T *puiMemInfoOffset);
849
850IMG_IMPORT
851PVRSRV_ERROR PVRSRVMapFullDmaBuf(const PVRSRV_DEV_DATA *psDevData,
852 const IMG_HANDLE hDevMemHeap,
853 const IMG_UINT32 ui32Attribs,
854 const IMG_INT iDmaBufFD,
855 PVRSRV_CLIENT_MEM_INFO **ppsMemInfo);
856
857IMG_IMPORT
858PVRSRV_ERROR PVRSRVUnmapDmaBuf(const PVRSRV_DEV_DATA *psDevData,
859 PVRSRV_CLIENT_MEM_INFO *psMemInfo);
860#endif /* SUPPORT_DMABUF */
861
862IMG_IMPORT
863PVRSRV_ERROR IMG_CALLCONV PVRSRVAllocDeviceMemSparse(const PVRSRV_DEV_DATA *psDevData,
864 IMG_HANDLE hDevMemHeap,
865 IMG_UINT32 ui32Attribs,
866 IMG_SIZE_T uAlignment,
867 IMG_UINT32 ui32ChunkSize,
868 IMG_UINT32 ui32NumVirtChunks,
869 IMG_UINT32 ui32NumPhysChunks,
870 IMG_BOOL *pabMapChunk,
871 PVRSRV_CLIENT_MEM_INFO **ppsMemInfo);
872
873/******************************************************************************
874 * PVR Allocation Synchronisation Functionality...
875 *****************************************************************************/
876
877typedef enum _PVRSRV_SYNCVAL_MODE_
878{
879 PVRSRV_SYNCVAL_READ = IMG_TRUE,
880 PVRSRV_SYNCVAL_WRITE = IMG_FALSE
881
882} PVRSRV_SYNCVAL_MODE, *PPVRSRV_SYNCVAL_MODE;
883
884typedef IMG_UINT32 PVRSRV_SYNCVAL;
885
886IMG_IMPORT PVRSRV_ERROR PVRSRVWaitForOpsComplete(PPVRSRV_CLIENT_MEM_INFO psMemInfo,
887 PVRSRV_SYNCVAL_MODE eMode, PVRSRV_SYNCVAL OpRequired);
888
889IMG_IMPORT PVRSRV_ERROR PVRSRVWaitForAllOpsComplete(PPVRSRV_CLIENT_MEM_INFO psMemInfo,
890 PVRSRV_SYNCVAL_MODE eMode);
891
892IMG_IMPORT IMG_BOOL PVRSRVTestOpsComplete(PPVRSRV_CLIENT_MEM_INFO psMemInfo,
893 PVRSRV_SYNCVAL_MODE eMode, PVRSRV_SYNCVAL OpRequired);
894
895IMG_IMPORT IMG_BOOL PVRSRVTestAllOpsComplete(PPVRSRV_CLIENT_MEM_INFO psMemInfo,
896 PVRSRV_SYNCVAL_MODE eMode);
897
898IMG_IMPORT IMG_BOOL PVRSRVTestOpsNotComplete(PPVRSRV_CLIENT_MEM_INFO psMemInfo,
899 PVRSRV_SYNCVAL_MODE eMode, PVRSRV_SYNCVAL OpRequired);
900
901IMG_IMPORT IMG_BOOL PVRSRVTestAllOpsNotComplete(PPVRSRV_CLIENT_MEM_INFO psMemInfo,
902 PVRSRV_SYNCVAL_MODE eMode);
903
904IMG_IMPORT PVRSRV_SYNCVAL PVRSRVGetPendingOpSyncVal(PPVRSRV_CLIENT_MEM_INFO psMemInfo,
905 PVRSRV_SYNCVAL_MODE eMode);
906
907#if defined(SUPPORT_PVRSRV_DEVICE_CLASS)
908
909IMG_IMPORT
910PVRSRV_ERROR IMG_CALLCONV PVRSRVMapDeviceClassMemory (IMG_CONST PVRSRV_DEV_DATA *psDevData,
911 IMG_HANDLE hDevMemContext,
912 IMG_HANDLE hDeviceClassBuffer,
913 PVRSRV_CLIENT_MEM_INFO **ppsMemInfo);
914IMG_IMPORT
915PVRSRV_ERROR IMG_CALLCONV PVRSRVUnmapDeviceClassMemory (IMG_CONST PVRSRV_DEV_DATA *psDevData,
916 PVRSRV_CLIENT_MEM_INFO *psMemInfo);
917
918/******************************************************************************
919 * Common Device Class Enumeration
920 *****************************************************************************/
921IMG_IMPORT
922PVRSRV_ERROR IMG_CALLCONV PVRSRVEnumerateDeviceClass(IMG_HANDLE hConnection,
923 PVRSRV_DEVICE_CLASS DeviceClass,
924 IMG_UINT32 *pui32DevCount,
925 IMG_UINT32 *pui32DevID);
926
927/******************************************************************************
928 * Display Device Class API definition
929 *****************************************************************************/
930IMG_IMPORT
931IMG_HANDLE IMG_CALLCONV PVRSRVOpenDCDevice(IMG_CONST PVRSRV_DEV_DATA *psDevData,
932 IMG_UINT32 ui32DeviceID);
933
934IMG_IMPORT
935PVRSRV_ERROR IMG_CALLCONV PVRSRVCloseDCDevice(IMG_CONST PVRSRV_CONNECTION *psConnection, IMG_HANDLE hDevice);
936
937IMG_IMPORT
938PVRSRV_ERROR IMG_CALLCONV PVRSRVEnumDCFormats (IMG_HANDLE hDevice,
939 IMG_UINT32 *pui32Count,
940 DISPLAY_FORMAT *psFormat);
941
942IMG_IMPORT
943PVRSRV_ERROR IMG_CALLCONV PVRSRVEnumDCDims (IMG_HANDLE hDevice,
944 IMG_UINT32 *pui32Count,
945 DISPLAY_FORMAT *psFormat,
946 DISPLAY_DIMS *psDims);
947
948IMG_IMPORT
949PVRSRV_ERROR IMG_CALLCONV PVRSRVGetDCSystemBuffer(IMG_HANDLE hDevice,
950 IMG_HANDLE *phBuffer
951 );
952
953IMG_IMPORT
954PVRSRV_ERROR IMG_CALLCONV PVRSRVGetDCInfo(IMG_HANDLE hDevice,
955 DISPLAY_INFO* psDisplayInfo);
956
957IMG_IMPORT
958PVRSRV_ERROR IMG_CALLCONV PVRSRVCreateDCSwapChain (IMG_HANDLE hDevice,
959 IMG_UINT32 ui32Flags,
960 DISPLAY_SURF_ATTRIBUTES *psDstSurfAttrib,
961 DISPLAY_SURF_ATTRIBUTES *psSrcSurfAttrib,
962 IMG_UINT32 ui32BufferCount,
963 IMG_UINT32 ui32OEMFlags,
964 IMG_UINT32 *pui32SwapChainID,
965 IMG_HANDLE *phSwapChain
966 );
967
968IMG_IMPORT
969PVRSRV_ERROR IMG_CALLCONV PVRSRVDestroyDCSwapChain (IMG_HANDLE hDevice,
970 IMG_HANDLE hSwapChain
971 );
972
973IMG_IMPORT
974PVRSRV_ERROR IMG_CALLCONV PVRSRVSetDCDstRect (IMG_HANDLE hDevice,
975 IMG_HANDLE hSwapChain,
976 IMG_RECT *psDstRect);
977
978IMG_IMPORT
979PVRSRV_ERROR IMG_CALLCONV PVRSRVSetDCSrcRect (IMG_HANDLE hDevice,
980 IMG_HANDLE hSwapChain,
981 IMG_RECT *psSrcRect);
982
983IMG_IMPORT
984PVRSRV_ERROR IMG_CALLCONV PVRSRVSetDCDstColourKey (IMG_HANDLE hDevice,
985 IMG_HANDLE hSwapChain,
986 IMG_UINT32 ui32CKColour);
987
988IMG_IMPORT
989PVRSRV_ERROR IMG_CALLCONV PVRSRVSetDCSrcColourKey (IMG_HANDLE hDevice,
990 IMG_HANDLE hSwapChain,
991 IMG_UINT32 ui32CKColour);
992
993IMG_IMPORT
994PVRSRV_ERROR IMG_CALLCONV PVRSRVGetDCBuffers(IMG_HANDLE hDevice,
995 IMG_HANDLE hSwapChain,
996 IMG_HANDLE *phBuffer
997 );
998
999IMG_IMPORT
1000PVRSRV_ERROR IMG_CALLCONV PVRSRVGetDCBuffers2(IMG_HANDLE hDevice,
1001 IMG_HANDLE hSwapChain,
1002 IMG_HANDLE *phBuffer,
1003 IMG_SYS_PHYADDR *psPhyAddr);
1004
1005IMG_IMPORT
1006PVRSRV_ERROR IMG_CALLCONV PVRSRVSwapToDCBuffer (IMG_HANDLE hDevice,
1007 IMG_HANDLE hBuffer,
1008 IMG_UINT32 ui32ClipRectCount,
1009 IMG_RECT *psClipRect,
1010 IMG_UINT32 ui32SwapInterval,
1011 IMG_HANDLE hPrivateTag
1012 );
1013
1014IMG_IMPORT
1015PVRSRV_ERROR IMG_CALLCONV PVRSRVSwapToDCBuffer2 (IMG_HANDLE hDevice,
1016 IMG_HANDLE hBuffer,
1017 IMG_UINT32 ui32SwapInterval,
1018 PVRSRV_CLIENT_MEM_INFO **ppsMemInfos,
1019 PVRSRV_CLIENT_SYNC_INFO **ppsSyncInfos,
1020 IMG_UINT32 ui32NumMemSyncInfos,
1021 IMG_PVOID pvPrivData,
1022 IMG_UINT32 ui32PrivDataLength,
1023 IMG_HANDLE *phFence);
1024
1025IMG_IMPORT
1026PVRSRV_ERROR IMG_CALLCONV PVRSRVSwapToDCSystem (IMG_HANDLE hDevice,
1027 IMG_HANDLE hSwapChain
1028 );
1029
1030/******************************************************************************
1031 * Buffer Device Class API definition
1032 *****************************************************************************/
1033IMG_IMPORT
1034IMG_HANDLE IMG_CALLCONV PVRSRVOpenBCDevice(IMG_CONST PVRSRV_DEV_DATA *psDevData,
1035 IMG_UINT32 ui32DeviceID);
1036
1037IMG_IMPORT
1038PVRSRV_ERROR IMG_CALLCONV PVRSRVCloseBCDevice(IMG_HANDLE hConnection,
1039 IMG_HANDLE hDevice);
1040
1041IMG_IMPORT
1042PVRSRV_ERROR IMG_CALLCONV PVRSRVGetBCBufferInfo(IMG_HANDLE hDevice,
1043 BUFFER_INFO *psBuffer);
1044
1045IMG_IMPORT
1046PVRSRV_ERROR IMG_CALLCONV PVRSRVGetBCBuffer(IMG_HANDLE hDevice,
1047 IMG_UINT32 ui32BufferIndex,
1048 IMG_HANDLE *phBuffer
1049 );
1050
1051#endif /* #if defined(SUPPORT_PVRSRV_DEVICE_CLASS) */
1052
1053/******************************************************************************
1054 * PDUMP Function prototypes...
1055 *****************************************************************************/
1056IMG_IMPORT
1057PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpInit(IMG_HANDLE hConnection);
1058
1059IMG_IMPORT
1060PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpStartInitPhase(IMG_HANDLE hConnection);
1061
1062IMG_IMPORT
1063PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpStopInitPhase(IMG_HANDLE hConnection);
1064
1065IMG_IMPORT
1066PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpMemPol(IMG_HANDLE hConnection,
1067 PVRSRV_CLIENT_MEM_INFO *psMemInfo,
1068 IMG_UINT32 ui32Offset,
1069 IMG_UINT32 ui32Value,
1070 IMG_UINT32 ui32Mask,
1071 PDUMP_POLL_OPERATOR eOperator,
1072 IMG_UINT32 ui32Flags);
1073
1074IMG_IMPORT
1075PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpSyncPol(IMG_HANDLE hConnection,
1076 PVRSRV_CLIENT_SYNC_INFO *psClientSyncInfo,
1077 IMG_BOOL bIsRead,
1078 IMG_UINT32 ui32Value,
1079 IMG_UINT32 ui32Mask);
1080
1081IMG_IMPORT
1082PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpSyncPol2(IMG_HANDLE hConnection,
1083 PVRSRV_CLIENT_SYNC_INFO *psClientSyncInfo,
1084 IMG_BOOL bIsRead);
1085
1086IMG_IMPORT
1087PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpMem(IMG_HANDLE hConnection,
1088 IMG_PVOID pvAltLinAddr,
1089 PVRSRV_CLIENT_MEM_INFO *psMemInfo,
1090 IMG_UINT32 ui32Offset,
1091 IMG_UINT32 ui32Bytes,
1092 IMG_UINT32 ui32Flags);
1093
1094IMG_IMPORT
1095PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpSync(IMG_HANDLE hConnection,
1096 IMG_PVOID pvAltLinAddr,
1097 PVRSRV_CLIENT_SYNC_INFO *psClientSyncInfo,
1098 IMG_UINT32 ui32Offset,
1099 IMG_UINT32 ui32Bytes);
1100
1101IMG_IMPORT
1102PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpReg(IMG_CONST PVRSRV_DEV_DATA *psDevData,
1103 IMG_CHAR *pszRegRegion,
1104 IMG_UINT32 ui32RegAddr,
1105 IMG_UINT32 ui32RegValue,
1106 IMG_UINT32 ui32Flags);
1107
1108IMG_IMPORT
1109PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpRegPolWithFlags(const PVRSRV_DEV_DATA *psDevData,
1110 IMG_CHAR *pszRegRegion,
1111 IMG_UINT32 ui32RegAddr,
1112 IMG_UINT32 ui32RegValue,
1113 IMG_UINT32 ui32Mask,
1114 IMG_UINT32 ui32Flags);
1115IMG_IMPORT
1116PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpRegPol(const PVRSRV_DEV_DATA *psDevData,
1117 IMG_CHAR *pszRegRegion,
1118 IMG_UINT32 ui32RegAddr,
1119 IMG_UINT32 ui32RegValue,
1120 IMG_UINT32 ui32Mask);
1121
1122IMG_IMPORT
1123PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpPDReg(IMG_HANDLE hConnection,
1124 IMG_UINT32 ui32RegAddr,
1125 IMG_UINT32 ui32RegValue);
1126IMG_IMPORT
1127PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpPDDevPAddr(IMG_HANDLE hConnection,
1128 PVRSRV_CLIENT_MEM_INFO *psMemInfo,
1129 IMG_UINT32 ui32Offset,
1130 IMG_DEV_PHYADDR sPDDevPAddr);
1131
1132#if !defined(USE_CODE)
1133IMG_IMPORT
1134PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpMemPages(IMG_CONST PVRSRV_DEV_DATA *psDevData,
1135 IMG_HANDLE hKernelMemInfo,
1136 IMG_DEV_PHYADDR *pPages,
1137 IMG_UINT32 ui32NumPages,
1138 IMG_DEV_VIRTADDR sDevVAddr,
1139 IMG_UINT32 ui32Start,
1140 IMG_UINT32 ui32Length,
1141 IMG_UINT32 ui32Flags);
1142#endif
1143
1144IMG_IMPORT
1145PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpSetFrame(IMG_HANDLE hConnection,
1146 IMG_UINT32 ui32Frame);
1147
1148IMG_IMPORT
1149PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpComment(IMG_HANDLE hConnection,
1150 IMG_CONST IMG_CHAR *pszComment,
1151 IMG_BOOL bContinuous);
1152
1153IMG_IMPORT
1154PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpCommentf(IMG_HANDLE hConnection,
1155 IMG_BOOL bContinuous,
1156 IMG_CONST IMG_CHAR *pszFormat, ...)
1157#if !defined(USE_CODE)
1158 IMG_FORMAT_PRINTF(3, 4)
1159#endif
1160;
1161
1162IMG_IMPORT
1163PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpCommentWithFlagsf(IMG_HANDLE hConnection,
1164 IMG_UINT32 ui32Flags,
1165 IMG_CONST IMG_CHAR *pszFormat, ...)
1166#if !defined(USE_CODE)
1167 IMG_FORMAT_PRINTF(3, 4)
1168#endif
1169;
1170
1171IMG_IMPORT
1172PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpDriverInfo(IMG_HANDLE hConnection,
1173 IMG_CHAR *pszString,
1174 IMG_BOOL bContinuous);
1175
1176IMG_IMPORT
1177PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpIsCapturing(IMG_HANDLE hConnection,
1178 IMG_BOOL *pbIsCapturing);
1179
1180IMG_IMPORT
1181PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpBitmap(IMG_CONST PVRSRV_DEV_DATA *psDevData,
1182 IMG_CHAR *pszFileName,
1183 IMG_UINT32 ui32FileOffset,
1184 IMG_UINT32 ui32Width,
1185 IMG_UINT32 ui32Height,
1186 IMG_UINT32 ui32StrideInBytes,
1187 IMG_DEV_VIRTADDR sDevBaseAddr,
1188 IMG_HANDLE hDevMemContext,
1189 IMG_UINT32 ui32Size,
1190 PDUMP_PIXEL_FORMAT ePixelFormat,
1191 PDUMP_MEM_FORMAT eMemFormat,
1192 IMG_UINT32 ui32PDumpFlags);
1193
1194IMG_IMPORT
1195PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpRegRead(IMG_CONST PVRSRV_DEV_DATA *psDevData,
1196 IMG_CONST IMG_CHAR *pszRegRegion,
1197 IMG_CONST IMG_CHAR *pszFileName,
1198 IMG_UINT32 ui32FileOffset,
1199 IMG_UINT32 ui32Address,
1200 IMG_UINT32 ui32Size,
1201 IMG_UINT32 ui32PDumpFlags);
1202
1203
1204IMG_IMPORT
1205IMG_BOOL IMG_CALLCONV PVRSRVPDumpIsCapturingTest(IMG_HANDLE hConnection);
1206
1207IMG_IMPORT
1208PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpCycleCountRegRead(IMG_CONST PVRSRV_DEV_DATA *psDevData,
1209 IMG_UINT32 ui32RegOffset,
1210 IMG_BOOL bLastFrame);
1211
1212IMG_IMPORT IMG_HANDLE PVRSRVLoadLibrary(const IMG_CHAR *pszLibraryName);
1213IMG_IMPORT PVRSRV_ERROR PVRSRVUnloadLibrary(IMG_HANDLE hExtDrv);
1214IMG_IMPORT PVRSRV_ERROR PVRSRVGetLibFuncAddr(IMG_HANDLE hExtDrv, const IMG_CHAR *pszFunctionName, IMG_VOID **ppvFuncAddr);
1215
1216IMG_IMPORT IMG_UINT32 PVRSRVClockus (void);
1217IMG_IMPORT IMG_VOID PVRSRVWaitus (IMG_UINT32 ui32Timeus);
1218IMG_IMPORT IMG_VOID PVRSRVReleaseThreadQuanta (void);
1219IMG_IMPORT IMG_UINT32 IMG_CALLCONV PVRSRVGetCurrentProcessID(void);
1220IMG_IMPORT IMG_CHAR * IMG_CALLCONV PVRSRVSetLocale(const IMG_CHAR *pszLocale);
1221
1222
1223
1224
1225
1226IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVCreateAppHintState(IMG_MODULE_ID eModuleID,
1227 const IMG_CHAR *pszAppName,
1228 IMG_VOID **ppvState);
1229IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVFreeAppHintState(IMG_MODULE_ID eModuleID,
1230 IMG_VOID *pvHintState);
1231
1232IMG_IMPORT IMG_BOOL IMG_CALLCONV PVRSRVGetAppHint(IMG_VOID *pvHintState,
1233 const IMG_CHAR *pszHintName,
1234 IMG_DATA_TYPE eDataType,
1235 const IMG_VOID *pvDefault,
1236 IMG_VOID *pvReturn);
1237
1238/******************************************************************************
1239 * Memory API(s)
1240 *****************************************************************************/
1241
1242/* Exported APIs */
1243IMG_IMPORT IMG_PVOID IMG_CALLCONV PVRSRVAllocUserModeMem (IMG_SIZE_T uiSize);
1244IMG_IMPORT IMG_PVOID IMG_CALLCONV PVRSRVCallocUserModeMem (IMG_SIZE_T uiSize);
1245IMG_IMPORT IMG_PVOID IMG_CALLCONV PVRSRVReallocUserModeMem (IMG_PVOID pvBase, IMG_SIZE_T uiNewSize);
1246IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVFreeUserModeMem (IMG_PVOID pvMem);
1247IMG_IMPORT IMG_VOID PVRSRVMemCopy(IMG_VOID *pvDst, const IMG_VOID *pvSrc, IMG_SIZE_T uiSize);
1248IMG_IMPORT IMG_VOID PVRSRVMemSet(IMG_VOID *pvDest, IMG_UINT8 ui8Value, IMG_SIZE_T uiSize);
1249
1250struct _PVRSRV_MUTEX_OPAQUE_STRUCT_;
1251typedef struct _PVRSRV_MUTEX_OPAQUE_STRUCT_ *PVRSRV_MUTEX_HANDLE;
1252
1253
1254#if defined(PVR_DEBUG_MUTEXES)
1255
1256IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV PVRSRVCreateMutex(PVRSRV_MUTEX_HANDLE *phMutex,
1257 IMG_CHAR pszMutexName[],
1258 IMG_CHAR pszFilename[],
1259 IMG_INT iLine);
1260IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV PVRSRVDestroyMutex(PVRSRV_MUTEX_HANDLE hMutex,
1261 IMG_CHAR pszMutexName[],
1262 IMG_CHAR pszFilename[],
1263 IMG_INT iLine);
1264IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVLockMutex(PVRSRV_MUTEX_HANDLE hMutex,
1265 IMG_CHAR pszMutexName[],
1266 IMG_CHAR pszFilename[],
1267 IMG_INT iLine);
1268IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVUnlockMutex(PVRSRV_MUTEX_HANDLE hMutex,
1269 IMG_CHAR pszMutexName[],
1270 IMG_CHAR pszFilename[],
1271 IMG_INT iLine);
1272
1273#define PVRSRVCreateMutex(phMutex) PVRSRVCreateMutex(phMutex, #phMutex, __FILE__, __LINE__)
1274#define PVRSRVDestroyMutex(hMutex) PVRSRVDestroyMutex(hMutex, #hMutex, __FILE__, __LINE__)
1275#define PVRSRVLockMutex(hMutex) PVRSRVLockMutex(hMutex, #hMutex, __FILE__, __LINE__)
1276#define PVRSRVUnlockMutex(hMutex) PVRSRVUnlockMutex(hMutex, #hMutex, __FILE__, __LINE__)
1277
1278#else /* defined(PVR_DEBUG_MUTEXES) */
1279
1280IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV PVRSRVCreateMutex(PVRSRV_MUTEX_HANDLE *phMutex);
1281IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV PVRSRVDestroyMutex(PVRSRV_MUTEX_HANDLE hMutex);
1282IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVLockMutex(PVRSRV_MUTEX_HANDLE hMutex);
1283IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVUnlockMutex(PVRSRV_MUTEX_HANDLE hMutex);
1284
1285#endif /* defined(PVR_DEBUG_MUTEXES) */
1286
1287
1288struct _PVRSRV_RECMUTEX_OPAQUE_STRUCT_;
1289typedef struct _PVRSRV_RECMUTEX_OPAQUE_STRUCT_ *PVRSRV_RECMUTEX_HANDLE;
1290
1291
1292#if defined(PVR_DEBUG_MUTEXES)
1293
1294IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV PVRSRVCreateRecursiveMutex(PVRSRV_RECMUTEX_HANDLE *phMutex,
1295 IMG_CHAR pszMutexName[],
1296 IMG_CHAR pszFilename[],
1297 IMG_INT iLine);
1298IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV PVRSRVDestroyRecursiveMutex(PVRSRV_RECMUTEX_HANDLE hMutex,
1299 IMG_CHAR pszMutexName[],
1300 IMG_CHAR pszFilename[],
1301 IMG_INT iLine);
1302IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVLockRecursiveMutex(PVRSRV_RECMUTEX_HANDLE hMutex,
1303 IMG_CHAR pszMutexName[],
1304 IMG_CHAR pszFilename[],
1305 IMG_INT iLine);
1306IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVUnlockRecursiveMutex(PVRSRV_RECMUTEX_HANDLE hMutex,
1307 IMG_CHAR pszMutexName[],
1308 IMG_CHAR pszFilename[],
1309 IMG_INT iLine);
1310
1311#define PVRSRVCreateRecursiveMutex(phMutex) PVRSRVCreateRecursiveMutex(phMutex, #phMutex, __FILE__, __LINE__)
1312#define PVRSRVDestroyRecursiveMutex(hMutex) PVRSRVDestroyRecursiveMutex(hMutex, #hMutex, __FILE__, __LINE__)
1313#define PVRSRVLockRecursiveMutex(hMutex) PVRSRVLockRecursiveMutex(hMutex, #hMutex, __FILE__, __LINE__)
1314#define PVRSRVUnlockRecursiveMutex(hMutex) PVRSRVUnlockRecursiveMutex(hMutex, #hMutex, __FILE__, __LINE__)
1315
1316#else /* defined(PVR_DEBUG_MUTEXES) */
1317
1318IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV PVRSRVCreateRecursiveMutex(PVRSRV_RECMUTEX_HANDLE *phMutex);
1319IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV PVRSRVDestroyRecursiveMutex(PVRSRV_RECMUTEX_HANDLE hMutex);
1320IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVLockRecursiveMutex(PVRSRV_RECMUTEX_HANDLE hMutex);
1321IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVUnlockRecursiveMutex(PVRSRV_RECMUTEX_HANDLE hMutex);
1322
1323#endif /* defined(PVR_DEBUG_MUTEXES) */
1324
1325/* Non-recursive coarse-grained mutex shared between all threads in a proccess */
1326IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVLockProcessGlobalMutex(void);
1327IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVUnlockProcessGlobalMutex(void);
1328
1329
1330struct _PVRSRV_SEMAPHORE_OPAQUE_STRUCT_;
1331typedef struct _PVRSRV_SEMAPHORE_OPAQUE_STRUCT_ *PVRSRV_SEMAPHORE_HANDLE;
1332
1333
1334 #define IMG_SEMAPHORE_WAIT_INFINITE ((IMG_UINT64)0xFFFFFFFFFFFFFFFFull)
1335
1336
1337#if !defined(USE_CODE)
1338
1339#ifdef INLINE_IS_PRAGMA
1340#pragma inline(PVRSRVCreateSemaphore)
1341#endif
1342static INLINE PVRSRV_ERROR PVRSRVCreateSemaphore(PVRSRV_SEMAPHORE_HANDLE *phSemaphore, IMG_INT iInitialCount)
1343{
1344 PVR_UNREFERENCED_PARAMETER(iInitialCount);
1345 *phSemaphore = 0;
1346 return PVRSRV_OK;
1347}
1348
1349#ifdef INLINE_IS_PRAGMA
1350#pragma inline(PVRSRVDestroySemaphore)
1351#endif
1352static INLINE PVRSRV_ERROR PVRSRVDestroySemaphore(PVRSRV_SEMAPHORE_HANDLE hSemaphore)
1353{
1354 PVR_UNREFERENCED_PARAMETER(hSemaphore);
1355 return PVRSRV_OK;
1356}
1357
1358#ifdef INLINE_IS_PRAGMA
1359#pragma inline(PVRSRVWaitSemaphore)
1360#endif
1361static INLINE PVRSRV_ERROR PVRSRVWaitSemaphore(PVRSRV_SEMAPHORE_HANDLE hSemaphore, IMG_UINT64 ui64TimeoutMicroSeconds)
1362{
1363 PVR_UNREFERENCED_PARAMETER(hSemaphore);
1364 PVR_UNREFERENCED_PARAMETER(ui64TimeoutMicroSeconds);
1365 return PVRSRV_ERROR_INVALID_PARAMS;
1366}
1367
1368#ifdef INLINE_IS_PRAGMA
1369#pragma inline(PVRSRVPostSemaphore)
1370#endif
1371static INLINE IMG_VOID PVRSRVPostSemaphore(PVRSRV_SEMAPHORE_HANDLE hSemaphore, IMG_INT iPostCount)
1372{
1373 PVR_UNREFERENCED_PARAMETER(hSemaphore);
1374 PVR_UNREFERENCED_PARAMETER(iPostCount);
1375}
1376
1377#endif /* !defined(USE_CODE) */
1378
1379
1380/* Non-exported APIs */
1381#if defined(DEBUG) && (defined(__linux__) || defined(__QNXNTO__) )
1382IMG_IMPORT IMG_PVOID IMG_CALLCONV PVRSRVAllocUserModeMemTracking(IMG_SIZE_T ui32Size, IMG_CHAR *pszFileName, IMG_UINT32 ui32LineNumber);
1383
1384IMG_IMPORT IMG_PVOID IMG_CALLCONV PVRSRVCallocUserModeMemTracking(IMG_SIZE_T ui32Size, IMG_CHAR *pszFileName, IMG_UINT32 ui32LineNumber);
1385
1386IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVFreeUserModeMemTracking(IMG_VOID *pvMem);
1387
1388IMG_IMPORT IMG_PVOID IMG_CALLCONV PVRSRVReallocUserModeMemTracking(IMG_VOID *pvMem, IMG_SIZE_T ui32NewSize,
1389 IMG_CHAR *pszFileName, IMG_UINT32 ui32LineNumber);
1390#endif
1391
1392/******************************************************************************
1393 * PVR Event Object API(s)
1394 *****************************************************************************/
1395
1396IMG_IMPORT PVRSRV_ERROR PVRSRVEventObjectWait(const PVRSRV_CONNECTION *psConnection,
1397 IMG_HANDLE hOSEvent
1398 );
1399
1400/*!
1401 ******************************************************************************
1402
1403 @Function PVRSRVCreateSyncInfoModObj
1404
1405 @Description Creates an empty Modification object to be later used by PVRSRVModifyPendingSyncOps
1406
1407 ******************************************************************************/
1408IMG_IMPORT
1409PVRSRV_ERROR IMG_CALLCONV PVRSRVCreateSyncInfoModObj(const PVRSRV_CONNECTION *psConnection,
1410 IMG_HANDLE *phKernelSyncInfoModObj
1411 );
1412
1413/*!
1414 ******************************************************************************
1415
1416 @Function PVRSRVDestroySyncInfoModObj
1417
1418 @Description Destroys a Modification object. Must be empty.
1419
1420 ******************************************************************************/
1421IMG_IMPORT
1422PVRSRV_ERROR IMG_CALLCONV PVRSRVDestroySyncInfoModObj(const PVRSRV_CONNECTION *psConnection,
1423 IMG_HANDLE hKernelSyncInfoModObj
1424 );
1425
1426
1427
1428/*!
1429 ******************************************************************************
1430
1431 @Function PVRSRVModifyPendingSyncOps
1432
1433 @Description Returns PRE-INCREMENTED sync op values. Performs thread safe increment
1434 of sync ops values as specified by ui32ModifyFlags.
1435
1436 PVRSRV_ERROR_RETRY is returned if the supplied modification object
1437 is not empty. This is on the assumption that a different thread
1438 will imminently call PVRSRVModifyCompleteSyncOps. This thread should
1439 sleep before retrying. It should be regarded as an error if no such
1440 other thread exists.
1441
1442 Note that this API has implied locking semantics, as follows:
1443
1444 PVRSRVModifyPendingSyncOps()
1445 - announces an operation on the buffer is "pending", and
1446 conceptually takes a ticket to represent your place in the queue.
1447 - NB: ** exclusive access to the resource is _NOT_ granted at this time **
1448 PVRSRVSyncOpsFlushToModObj()
1449 - ensures you have exclusive access to the resource (conceptually, a LOCK)
1450 - the previously "pending" operation can now be regarded as "in progress"
1451 PVRSRVModifyCompleteSyncOps()
1452 - declares that the previously "in progress" operation is now complete. (UNLOCK)
1453
1454
1455 ******************************************************************************/
1456IMG_IMPORT
1457PVRSRV_ERROR IMG_CALLCONV PVRSRVModifyPendingSyncOps(const PVRSRV_CONNECTION *psConnection,
1458 IMG_HANDLE hKernelSyncInfoModObj,
1459 PVRSRV_CLIENT_SYNC_INFO *psSyncInfo,
1460 IMG_UINT32 ui32ModifyFlags,
1461 IMG_UINT32 *pui32ReadOpsPending,
1462 IMG_UINT32 *pui32WriteOpsPending);
1463
1464/*!
1465 ******************************************************************************
1466
1467 @Function PVRSRVModifyCompleteSyncOps
1468
1469 @Description Performs thread safe increment of sync ops values as specified
1470 by the ui32ModifyFlags that were given to PVRSRVModifyPendingSyncOps.
1471 The supplied Modification Object will become empty.
1472
1473 Note that this API has implied locking semantics, as
1474 described above in PVRSRVModifyPendingSyncOps
1475
1476 ******************************************************************************/
1477IMG_IMPORT
1478PVRSRV_ERROR IMG_CALLCONV PVRSRVModifyCompleteSyncOps(const PVRSRV_CONNECTION *psConnection,
1479 IMG_HANDLE hKernelSyncInfoModObj
1480 );
1481
1482/*!
1483 ******************************************************************************
1484
1485 @Function PVRSRVSyncOpsTakeToken
1486
1487 @Description Takes a "deli-counter" style token for future use with
1488 PVRSRVSyncOpsFlushToToken(). In practice this means
1489 recording a snapshot of the current "pending" values. A
1490 future PVRSRVSyncOpsFlushToToken() will ensure that all
1491 operations that were pending at the time of this
1492 PVRSRVSyncOpsTakeToken() call will be flushed.
1493 Operations may be subsequently queued after this call
1494 and would not be flushed. The caller is required to
1495 provide storage for the token. The token is disposable
1496 - i.e. the caller can simply let the token go out of
1497 scope without telling us... in particular, there is no
1498 obligation to call PVRSRVSyncOpsFlushToToken().
1499 Multiple tokens may be taken. There is no implied
1500 locking with this API.
1501
1502 ******************************************************************************/
1503IMG_IMPORT
1504PVRSRV_ERROR IMG_CALLCONV PVRSRVSyncOpsTakeToken(const PVRSRV_CONNECTION *psConnection,
1505 const PVRSRV_CLIENT_SYNC_INFO *psSyncInfo,
1506 PVRSRV_SYNC_TOKEN *psSyncToken);
1507/*!
1508 ******************************************************************************
1509
1510 @Function PVRSRVSyncOpsFlushToToken
1511
1512 @Description Tests whether the dependencies for a pending sync op modification
1513 have been satisfied. If this function returns PVRSRV_OK, then the
1514 "complete" counts have caught up with the snapshot of the "pending"
1515 values taken when PVRSRVSyncOpsTakeToken() was called.
1516 In the event that the dependencies are not (yet) met,
1517 this call will auto-retry if bWait is specified, otherwise, it will
1518 return PVRSRV_ERROR_RETRY. (Not really an "error")
1519
1520 (auto-retry behaviour not implemented)
1521
1522 ******************************************************************************/
1523IMG_IMPORT
1524PVRSRV_ERROR IMG_CALLCONV PVRSRVSyncOpsFlushToToken(const PVRSRV_CONNECTION *psConnection,
1525 const PVRSRV_CLIENT_SYNC_INFO *psSyncInfo,
1526 const PVRSRV_SYNC_TOKEN *psSyncToken,
1527 IMG_BOOL bWait);
1528/*!
1529 ******************************************************************************
1530
1531 @Function PVRSRVSyncOpsFlushToModObj
1532
1533 @Description Tests whether the dependencies for a pending sync op modification
1534 have been satisfied. If this function returns PVRSRV_OK, then the
1535 "complete" counts have caught up with the snapshot of the "pending"
1536 values taken when PVRSRVModifyPendingSyncOps() was called.
1537 PVRSRVModifyCompleteSyncOps() can then be called without risk of
1538 stalling. In the event that the dependencies are not (yet) met,
1539 this call will auto-retry if bWait is specified, otherwise, it will
1540 return PVRSRV_ERROR_RETRY. (Not really an "error")
1541
1542 Note that this API has implied locking semantics, as
1543 described above in PVRSRVModifyPendingSyncOps
1544
1545 ******************************************************************************/
1546IMG_IMPORT
1547PVRSRV_ERROR IMG_CALLCONV PVRSRVSyncOpsFlushToModObj(const PVRSRV_CONNECTION *psConnection,
1548 IMG_HANDLE hKernelSyncInfoModObj,
1549 IMG_BOOL bWait);
1550
1551/*!
1552 ******************************************************************************
1553
1554 @Function PVRSRVSyncOpsFlushToDelta
1555
1556 @Description Compares the number of outstanding operations (pending count minus
1557 complete count) with the limit specified. If no more than ui32Delta
1558 operations are outstanding, this function returns PVRSRV_OK.
1559 In the event that there are too many outstanding operations,
1560 this call will auto-retry if bWait is specified, otherwise, it will
1561 return PVRSRV_ERROR_RETRY. (Not really an "error")
1562
1563 ******************************************************************************/
1564IMG_IMPORT
1565PVRSRV_ERROR IMG_CALLCONV PVRSRVSyncOpsFlushToDelta(const PVRSRV_CONNECTION *psConnection,
1566 PVRSRV_CLIENT_SYNC_INFO *psClientSyncInfo,
1567 IMG_UINT32 ui32Delta,
1568 IMG_BOOL bWait);
1569
1570/*!
1571 ******************************************************************************
1572
1573 @Function PVRSRVAllocSyncInfo
1574
1575 @Description Creates a Sync Object. Unlike the sync objects created
1576 automatically with "PVRSRVAllocDeviceMem", the sync objects
1577 returned by this function do _not_ have a UM mapping to the
1578 sync data and they do _not_ have the device virtual address
1579 of the "opscomplete" fields. These data are to be deprecated.
1580
1581 ******************************************************************************/
1582
1583IMG_IMPORT
1584PVRSRV_ERROR IMG_CALLCONV PVRSRVAllocSyncInfo(IMG_CONST PVRSRV_DEV_DATA *psDevData,
1585 PVRSRV_CLIENT_SYNC_INFO **ppsSyncInfo);
1586
1587/*!
1588 ******************************************************************************
1589
1590 @Function PVRSRVFreeSyncInfo
1591
1592 @Description Destroys a Sync Object created via
1593 PVRSRVAllocSyncInfo.
1594
1595 ******************************************************************************/
1596
1597IMG_IMPORT
1598PVRSRV_ERROR IMG_CALLCONV PVRSRVFreeSyncInfo(IMG_CONST PVRSRV_DEV_DATA *psDevData,
1599 PVRSRV_CLIENT_SYNC_INFO *psSyncInfo);
1600
1601/*!
1602 *******************