From 225123d945a3211361b22888ba320894951b642b Mon Sep 17 00:00:00 2001 From: zxl Date: Wed, 6 Jan 2016 14:05:20 +0800 Subject: [PATCH] RK3368 GPU version Rogue M 1.28 Upload 1.5_ED3776568 DDK to drivers/gpu/rogue_m. Change-Id: If9c88760e3c311f04a1e11c6ec102b1a92b1299f Signed-off-by: zxl --- drivers/gpu/Makefile | 1 + drivers/gpu/rogue_m/GPL-COPYING | 344 ++ drivers/gpu/rogue_m/INSTALL | 58 + drivers/gpu/rogue_m/Kconfig | 6 + drivers/gpu/rogue_m/MIT-COPYING | 41 + drivers/gpu/rogue_m/Makefile | 250 + drivers/gpu/rogue_m/README | 32 + drivers/gpu/rogue_m/build/linux/bits.mk | 125 + drivers/gpu/rogue_m/build/linux/buildvars.mk | 281 ++ drivers/gpu/rogue_m/build/linux/commands.mk | 357 ++ .../rogue_m/build/linux/common/3rdparty.mk | 103 + .../build/linux/common/android/arch.mk | 101 + .../build/linux/common/android/arch_common.mk | 85 + .../linux/common/android/extra_config.mk | 80 + .../build/linux/common/android/features.mk | 312 ++ .../build/linux/common/android/install.sh.tpl | 323 ++ .../build/linux/common/android/paths.mk | 52 + .../linux/common/android/platform_version.mk | 172 + .../gpu/rogue_m/build/linux/common/pvrgdb.mk | 40 + .../rogue_m/build/linux/common/testchip.mk | 70 + .../rogue_m/build/linux/config/compiler.mk | 194 + .../config/compilers/aarch64-linux-android.mk | 12 + .../build/linux/config/compilers/arm-eabi.mk | 2 + .../config/compilers/arm-linux-androideabi.mk | 2 + .../linux/config/compilers/i386-linux-gnu.mk | 2 + .../config/compilers/x86_64-linux-gnu.mk | 29 + .../gpu/rogue_m/build/linux/config/core.mk | 862 ++++ .../gpu/rogue_m/build/linux/config/help.mk | 74 + .../build/linux/config/kernel_version.mk | 100 + .../rogue_m/build/linux/config/preconfig.mk | 157 + drivers/gpu/rogue_m/build/linux/defs.mk | 262 ++ .../build/linux/generic_arm_android/Makefile | 122 + .../build/linux/kbuild/Makefile.template | 95 + .../gpu/rogue_m/build/linux/kbuild/kbuild.mk | 94 + .../build/linux/moduledefs/host_i386.mk | 62 + .../build/linux/moduledefs/host_x86_64.mk | 62 + .../build/linux/moduledefs/target_aarch64.mk | 98 + .../build/linux/moduledefs/target_armv7-a.mk | 103 + .../build/linux/moduledefs/target_i686.mk | 102 + .../build/linux/moduledefs/target_neutral.mk | 44 + .../build/linux/moduledefs/target_x86_64.mk | 100 + .../rogue_m/build/linux/moduledefs_common.mk | 146 + drivers/gpu/rogue_m/build/linux/modules.mk | 48 + .../build/linux/modules/kernel_module.mk | 92 + .../rogue_m/build/linux/pc_android/Makefile | 140 + .../gpu/rogue_m/build/linux/prepare_tree.mk | 56 + drivers/gpu/rogue_m/build/linux/pvrversion.mk | 57 + drivers/gpu/rogue_m/build/linux/scripts.mk | 352 ++ .../build/linux/sunxi_android/Makefile | 89 + .../gpu/rogue_m/build/linux/this_makefile.mk | 68 + .../gpu/rogue_m/build/linux/tools/cc-check.sh | 120 + drivers/gpu/rogue_m/build/linux/toplevel.mk | 303 ++ drivers/gpu/rogue_m/config_kernel.h | 38 + drivers/gpu/rogue_m/config_kernel.mk | 26 + .../common_breakpoint_bridge.h | 158 + .../server_breakpoint_bridge.c | 392 ++ .../common_cachegeneric_bridge.h | 76 + .../server_cachegeneric_bridge.c | 131 + .../generated/cmm_bridge/common_cmm_bridge.h | 115 + .../generated/cmm_bridge/server_cmm_bridge.c | 393 ++ .../client_devicememhistory_bridge.c | 88 + .../common_debugmisc_bridge.h | 139 + .../server_debugmisc_bridge.c | 314 ++ .../client_devicememhistory_bridge.h | 63 + .../common_devicememhistory_bridge.h | 99 + .../server_devicememhistory_bridge.c | 217 + .../dmabuf_bridge/common_dmabuf_bridge.h | 80 + .../dmabuf_bridge/server_dmabuf_bridge.c | 162 + .../generated/dmm_bridge/client_mm_bridge.c | 555 +++ .../generated/dmm_bridge/client_mm_bridge.h | 170 + .../dpdumpmm_bridge/client_pdumpmm_bridge.c | 256 ++ .../dpvrtl_bridge/client_pvrtl_bridge.c | 154 + .../generated/dri_bridge/client_ri_bridge.c | 181 + .../dsync_bridge/client_sync_bridge.c | 492 ++ .../dsync_bridge/client_sync_bridge.h | 161 + .../generated/mm_bridge/common_mm_bridge.h | 530 +++ .../generated/mm_bridge/server_mm_bridge.c | 1699 +++++++ .../pdump_bridge/common_pdump_bridge.h | 125 + .../pdump_bridge/server_pdump_bridge.c | 278 ++ .../common_pdumpctrl_bridge.h | 172 + .../server_pdumpctrl_bridge.c | 288 ++ .../pdumpmm_bridge/client_pdumpmm_bridge.h | 113 + .../pdumpmm_bridge/common_pdumpmm_bridge.h | 245 + .../pdumpmm_bridge/server_pdumpmm_bridge.c | 586 +++ .../pvrtl_bridge/client_pvrtl_bridge.h | 76 + .../pvrtl_bridge/common_pvrtl_bridge.h | 174 + .../pvrtl_bridge/server_pvrtl_bridge.c | 397 ++ .../common_regconfig_bridge.h | 151 + .../server_regconfig_bridge.c | 325 ++ .../rgxcmp_bridge/common_rgxcmp_bridge.h | 206 + .../rgxcmp_bridge/server_rgxcmp_bridge.c | 1060 +++++ .../common_rgxhwperf_bridge.h | 141 + .../server_rgxhwperf_bridge.c | 357 ++ .../rgxinit_bridge/common_rgxinit_bridge.h | 201 + .../rgxinit_bridge/server_rgxinit_bridge.c | 733 +++ .../rgxpdump_bridge/common_rgxpdump_bridge.h | 96 + .../rgxpdump_bridge/server_rgxpdump_bridge.c | 192 + .../rgxta3d_bridge/common_rgxta3d_bridge.h | 531 +++ .../rgxta3d_bridge/server_rgxta3d_bridge.c | 2639 +++++++++++ .../rgxtq_bridge/common_rgxtq_bridge.h | 192 + .../rgxtq_bridge/server_rgxtq_bridge.c | 1713 +++++++ .../generated/ri_bridge/client_ri_bridge.h | 84 + .../generated/ri_bridge/common_ri_bridge.h | 195 + .../generated/ri_bridge/server_ri_bridge.c | 456 ++ .../generated/smm_bridge/common_smm_bridge.h | 115 + .../generated/smm_bridge/server_smm_bridge.c | 281 ++ .../srvcore_bridge/common_srvcore_bridge.h | 387 ++ .../srvcore_bridge/server_srvcore_bridge.c | 867 ++++ .../sync_bridge/common_sync_bridge.h | 481 ++ .../sync_bridge/server_sync_bridge.c | 1548 +++++++ .../common_syncsexport_bridge.h | 114 + .../server_syncsexport_bridge.c | 269 ++ .../common_timerquery_bridge.h | 135 + .../server_timerquery_bridge.c | 283 ++ .../hwdefs/km/configs/rgxconfig_km_1.V.2.0.h | 69 + .../hwdefs/km/configs/rgxconfig_km_1.V.2.20.h | 69 + .../hwdefs/km/configs/rgxconfig_km_1.V.2.30.h | 70 + .../hwdefs/km/configs/rgxconfig_km_1.V.2.5.h | 69 + .../hwdefs/km/configs/rgxconfig_km_1.V.4.12.h | 69 + .../hwdefs/km/configs/rgxconfig_km_1.V.4.15.h | 69 + .../hwdefs/km/configs/rgxconfig_km_1.V.4.19.h | 70 + .../hwdefs/km/configs/rgxconfig_km_1.V.4.5.h | 69 + .../hwdefs/km/configs/rgxconfig_km_1.V.4.6.h | 68 + .../km/configs/rgxconfig_km_12.V.1.20.h | 67 + .../hwdefs/km/configs/rgxconfig_km_4.V.2.51.h | 72 + .../hwdefs/km/configs/rgxconfig_km_4.V.2.52.h | 73 + .../hwdefs/km/configs/rgxconfig_km_4.V.2.57.h | 73 + .../hwdefs/km/configs/rgxconfig_km_4.V.2.58.h | 73 + .../hwdefs/km/configs/rgxconfig_km_4.V.4.53.h | 72 + .../hwdefs/km/configs/rgxconfig_km_4.V.6.62.h | 74 + .../hwdefs/km/configs/rgxconfig_km_5.V.1.46.h | 70 + .../hwdefs/km/configs/rgxconfig_km_8.V.2.34.h | 79 + .../hwdefs/km/configs/rgxconfig_km_8.V.4.38.h | 79 + .../hwdefs/km/cores/rgxcore_km_1.32.4.19.h | 72 + .../hwdefs/km/cores/rgxcore_km_1.33.2.5.h | 72 + .../hwdefs/km/cores/rgxcore_km_1.39.4.19.h | 72 + .../hwdefs/km/cores/rgxcore_km_1.48.2.0.h | 72 + .../hwdefs/km/cores/rgxcore_km_1.72.4.12.h | 71 + .../hwdefs/km/cores/rgxcore_km_1.75.2.20.h | 71 + .../hwdefs/km/cores/rgxcore_km_1.75.2.30.h | 71 + .../hwdefs/km/cores/rgxcore_km_1.76.4.6.h | 73 + .../hwdefs/km/cores/rgxcore_km_1.81.4.15.h | 72 + .../hwdefs/km/cores/rgxcore_km_1.82.4.5.h | 71 + .../hwdefs/km/cores/rgxcore_km_12.5.1.20.h | 71 + .../hwdefs/km/cores/rgxcore_km_4.29.2.51.h | 72 + .../hwdefs/km/cores/rgxcore_km_4.32.2.52.h | 72 + .../hwdefs/km/cores/rgxcore_km_4.40.2.51.h | 72 + .../hwdefs/km/cores/rgxcore_km_4.41.2.57.h | 72 + .../hwdefs/km/cores/rgxcore_km_4.42.4.53.h | 72 + .../hwdefs/km/cores/rgxcore_km_4.43.6.62.h | 72 + .../hwdefs/km/cores/rgxcore_km_4.45.2.58.h | 72 + .../hwdefs/km/cores/rgxcore_km_5.11.1.46.h | 72 + .../hwdefs/km/cores/rgxcore_km_5.9.1.46.h | 72 + .../hwdefs/km/cores/rgxcore_km_8.21.2.34.h | 72 + .../hwdefs/km/cores/rgxcore_km_8.41.4.38.h | 72 + .../gpu/rogue_m/hwdefs/km/rgx_cr_defs_km.h | 3836 ++++++++++++++++ drivers/gpu/rogue_m/hwdefs/km/rgxdefs_km.h | 175 + drivers/gpu/rogue_m/hwdefs/km/rgxmmudefs_km.h | 395 ++ drivers/gpu/rogue_m/include/adf/adf_ext.h | 111 + drivers/gpu/rogue_m/include/cache_external.h | 75 + drivers/gpu/rogue_m/include/dbgdrvif_srv5.h | 264 ++ .../gpu/rogue_m/include/devicemem_typedefs.h | 105 + drivers/gpu/rogue_m/include/img_3dtypes.h | 236 + drivers/gpu/rogue_m/include/img_defs.h | 226 + drivers/gpu/rogue_m/include/img_types.h | 289 ++ drivers/gpu/rogue_m/include/kernel_types.h | 136 + drivers/gpu/rogue_m/include/lock_types.h | 90 + drivers/gpu/rogue_m/include/pdumpdefs.h | 202 + drivers/gpu/rogue_m/include/pvr_debug.h | 478 ++ .../gpu/rogue_m/include/pvr_fd_sync_kernel.h | 114 + drivers/gpu/rogue_m/include/pvrmodule.h | 48 + .../gpu/rogue_m/include/pvrsrv_device_types.h | 112 + drivers/gpu/rogue_m/include/pvrsrv_devmem.h | 577 +++ drivers/gpu/rogue_m/include/pvrsrv_error.h | 61 + drivers/gpu/rogue_m/include/pvrsrv_errors.h | 329 ++ .../rogue_m/include/pvrsrv_memallocflags.h | 528 +++ drivers/gpu/rogue_m/include/pvrversion.h | 91 + drivers/gpu/rogue_m/include/rgx_common.h | 146 + drivers/gpu/rogue_m/include/rgx_heaps.h | 98 + drivers/gpu/rogue_m/include/rgx_hwperf_km.h | 385 ++ .../gpu/rogue_m/include/rgx_memallocflags.h | 49 + drivers/gpu/rogue_m/include/rgx_meta.h | 352 ++ drivers/gpu/rogue_m/include/rgx_options_km.h | 192 + drivers/gpu/rogue_m/include/rgxscript.h | 179 + drivers/gpu/rogue_m/include/ri_typedefs.h | 55 + drivers/gpu/rogue_m/include/services.h | 1337 ++++++ drivers/gpu/rogue_m/include/servicesext.h | 195 + drivers/gpu/rogue_m/include/sync_external.h | 79 + .../include/system/rgx_tc/apollo_regs.h | 159 + .../rogue_m/include/system/rgx_tc/pdp_regs.h | 75 + .../include/system/rgx_tc/tcf_clk_ctrl.h | 808 ++++ .../rogue_m/include/system/rgx_tc/tcf_pll.h | 311 ++ .../include/system/rgx_tc/tcf_rgbpdp_regs.h | 559 +++ .../kernel/drivers/staging/imgtec/Kbuild.mk | 84 + .../kernel/drivers/staging/imgtec/Linux.mk | 69 + .../drivers/staging/imgtec/adf_common.c | 564 +++ .../drivers/staging/imgtec/adf_common.h | 76 + .../kernel/drivers/staging/imgtec/adf_fbdev.c | 882 ++++ .../kernel/drivers/staging/imgtec/adf_pdp.c | 1192 +++++ .../kernel/drivers/staging/imgtec/adf_sunxi.c | 1612 +++++++ .../kernel/drivers/staging/imgtec/adf_sunxi.h | 84 + .../kernel/drivers/staging/imgtec/apollo.c | 1578 +++++++ .../drivers/staging/imgtec/apollo_drv.h | 111 + .../drivers/staging/imgtec/ion_lma_heap.c | 257 ++ .../drivers/staging/imgtec/ion_lma_heap.h | 52 + .../kernel/drivers/staging/imgtec/pvr_sync.c | 2330 ++++++++++ .../kernel/drivers/staging/imgtec/pvr_sync.h | 86 + .../staging/imgtec/services_kernel_client.h | 152 + .../rogue_m/services/include/cache_defines.h | 52 + .../services/include/env/linux/ion_sys.h | 76 + .../include/env/linux/pvr_bridge_io.h | 57 + .../gpu/rogue_m/services/include/mm_common.h | 50 + drivers/gpu/rogue_m/services/include/pdump.h | 76 + .../gpu/rogue_m/services/include/physheap.h | 124 + .../gpu/rogue_m/services/include/pvr_bridge.h | 305 ++ .../services/include/pvr_bridge_client.h | 81 + drivers/gpu/rogue_m/services/include/pvr_tl.h | 192 + .../rogue_m/services/include/pvr_tlcommon.h | 193 + .../gpu/rogue_m/services/include/rgx_bridge.h | 156 + .../gpu/rogue_m/services/include/rgx_fwif.h | 474 ++ .../include/rgx_fwif_alignchecks_km.h | 86 + .../rogue_m/services/include/rgx_fwif_km.h | 860 ++++ .../include/rgx_fwif_resetframework.h | 68 + .../services/include/rgx_fwif_shared.h | 528 +++ .../services/include/rgx_pdump_panics.h | 67 + .../rogue_m/services/include/rgx_tq_shared.h | 63 + .../gpu/rogue_m/services/include/rgxapi_km.h | 192 + .../services/include/shared/allocmem.h | 81 + .../rogue_m/services/include/shared/hash.h | 229 + .../rogue_m/services/include/shared/lock.h | 169 + .../gpu/rogue_m/services/include/shared/ra.h | 205 + .../services/server/common/cache_generic.c | 58 + .../server/common/connection_server.c | 297 ++ .../server/common/devicemem_heapcfg.c | 135 + .../server/common/devicemem_history_server.c | 225 + .../services/server/common/devicemem_server.c | 732 +++ .../rogue_m/services/server/common/handle.c | 2125 +++++++++ .../rogue_m/services/server/common/lists.c | 135 + .../services/server/common/mmu_common.c | 3244 +++++++++++++ .../services/server/common/pdump_common.c | 2933 ++++++++++++ .../services/server/common/pdump_mmu.c | 1008 ++++ .../services/server/common/pdump_physmem.c | 479 ++ .../rogue_m/services/server/common/physheap.c | 275 ++ .../rogue_m/services/server/common/physmem.c | 130 + .../services/server/common/physmem_lma.c | 1104 +++++ .../gpu/rogue_m/services/server/common/pmr.c | 2786 +++++++++++ .../rogue_m/services/server/common/power.c | 1300 ++++++ .../services/server/common/process_stats.c | 2515 ++++++++++ .../rogue_m/services/server/common/pvrsrv.c | 2850 ++++++++++++ .../services/server/common/ri_server.c | 1298 ++++++ .../rogue_m/services/server/common/srvcore.c | 791 ++++ .../services/server/common/sync_server.c | 2029 ++++++++ .../rogue_m/services/server/common/tlintern.c | 329 ++ .../rogue_m/services/server/common/tlserver.c | 389 ++ .../rogue_m/services/server/common/tlstream.c | 930 ++++ .../server/devices/rgx/debugmisc_server.c | 141 + .../server/devices/rgx/debugmisc_server.h | 75 + .../server/devices/rgx/rgxbreakpoint.c | 269 ++ .../server/devices/rgx/rgxbreakpoint.h | 136 + .../services/server/devices/rgx/rgxccb.c | 1660 +++++++ .../services/server/devices/rgx/rgxccb.h | 170 + .../services/server/devices/rgx/rgxcompute.c | 590 +++ .../services/server/devices/rgx/rgxcompute.h | 183 + .../services/server/devices/rgx/rgxdebug.c | 3113 +++++++++++++ .../services/server/devices/rgx/rgxdebug.h | 166 + .../services/server/devices/rgx/rgxdevice.h | 422 ++ .../services/server/devices/rgx/rgxfwutils.c | 4062 +++++++++++++++++ .../services/server/devices/rgx/rgxfwutils.h | 720 +++ .../server/devices/rgx/rgxheapconfig.h | 181 + .../services/server/devices/rgx/rgxhwperf.c | 1760 +++++++ .../services/server/devices/rgx/rgxhwperf.h | 114 + .../services/server/devices/rgx/rgxinit.c | 3189 +++++++++++++ .../services/server/devices/rgx/rgxinit.h | 276 ++ .../services/server/devices/rgx/rgxmem.c | 681 +++ .../services/server/devices/rgx/rgxmem.h | 89 + .../services/server/devices/rgx/rgxmmuinit.c | 990 ++++ .../services/server/devices/rgx/rgxmmuinit.h | 60 + .../services/server/devices/rgx/rgxpdump.c | 133 + .../services/server/devices/rgx/rgxpdump.h | 112 + .../services/server/devices/rgx/rgxpower.c | 1353 ++++++ .../services/server/devices/rgx/rgxpower.h | 216 + .../server/devices/rgx/rgxregconfig.c | 227 + .../server/devices/rgx/rgxregconfig.h | 123 + .../services/server/devices/rgx/rgxsync.c | 198 + .../services/server/devices/rgx/rgxsync.h | 80 + .../services/server/devices/rgx/rgxta3d.c | 3574 +++++++++++++++ .../services/server/devices/rgx/rgxta3d.h | 478 ++ .../services/server/devices/rgx/rgxtimecorr.c | 306 ++ .../services/server/devices/rgx/rgxtimecorr.h | 125 + .../server/devices/rgx/rgxtimerquery.c | 243 + .../server/devices/rgx/rgxtimerquery.h | 129 + .../services/server/devices/rgx/rgxtransfer.c | 1127 +++++ .../services/server/devices/rgx/rgxtransfer.h | 164 + .../services/server/devices/rgx/rgxutils.c | 287 ++ .../services/server/devices/rgx/rgxutils.h | 69 + .../services/server/env/linux/Kbuild.mk | 581 +++ .../services/server/env/linux/Linux.mk | 46 + .../services/server/env/linux/allocmem.c | 253 + .../server/env/linux/devicemem_mmap_stub.c | 135 + .../services/server/env/linux/driverlock.h | 57 + .../server/env/linux/env_connection.h | 107 + .../services/server/env/linux/env_data.h | 56 + .../rogue_m/services/server/env/linux/event.c | 361 ++ .../rogue_m/services/server/env/linux/event.h | 48 + .../services/server/env/linux/handle_idr.c | 445 ++ .../services/server/env/linux/linkage.h | 72 + .../rogue_m/services/server/env/linux/mm.c | 107 + .../rogue_m/services/server/env/linux/mm.h | 86 + .../rogue_m/services/server/env/linux/mmap.c | 546 +++ .../services/server/env/linux/module.c | 635 +++ .../services/server/env/linux/module_common.c | 495 ++ .../services/server/env/linux/module_common.h | 88 + .../server/env/linux/osconnection_server.c | 132 + .../services/server/env/linux/osfunc.c | 2097 +++++++++ .../services/server/env/linux/osfunc_arm.c | 173 + .../services/server/env/linux/osfunc_arm64.c | 116 + .../services/server/env/linux/osfunc_x86.c | 141 + .../server/env/linux/ossecure_export.c | 189 + .../rogue_m/services/server/env/linux/pdump.c | 462 ++ .../server/env/linux/physmem_dmabuf.c | 718 +++ .../server/env/linux/physmem_osmem_linux.c | 2061 +++++++++ .../server/env/linux/physmem_osmem_linux.h | 49 + .../env/linux/physmem_tdmetacode_linux.c | 386 ++ .../server/env/linux/physmem_tdsecbuf_linux.c | 385 ++ .../services/server/env/linux/private_data.h | 53 + .../services/server/env/linux/pvr_bridge_k.c | 839 ++++ .../services/server/env/linux/pvr_debug.c | 1386 ++++++ .../services/server/env/linux/pvr_debugfs.c | 857 ++++ .../services/server/env/linux/pvr_debugfs.h | 91 + .../services/server/env/linux/pvr_gputrace.c | 414 ++ .../services/server/env/linux/pvr_gputrace.h | 96 + .../services/server/env/linux/pvr_uaccess.h | 106 + .../server/env/linux/rogue_trace_events.h | 158 + .../services/server/env/linux/trace_events.c | 79 + .../services/server/env/linux/trace_events.h | 87 + .../services/server/include/cache_generic.h | 52 + .../server/include/connection_server.h | 107 + .../server/include/debug_request_ids.h | 55 + .../rogue_m/services/server/include/device.h | 301 ++ .../server/include/devicemem_heapcfg.h | 150 + .../server/include/devicemem_history_server.h | 95 + .../server/include/devicemem_server.h | 362 ++ .../server/include/devicemem_server_utils.h | 191 + .../rogue_m/services/server/include/handle.h | 220 + .../services/server/include/handle_impl.h | 89 + .../rogue_m/services/server/include/lists.h | 336 ++ .../services/server/include/mmu_common.h | 587 +++ .../server/include/osconnection_server.h | 89 + .../rogue_m/services/server/include/osfunc.h | 467 ++ .../services/server/include/ossecure_export.h | 52 + .../services/server/include/pdump_km.h | 731 +++ .../services/server/include/pdump_mmu.h | 175 + .../services/server/include/pdump_osfunc.h | 352 ++ .../services/server/include/pdump_physmem.h | 212 + .../server/include/pdump_symbolicaddr.h | 55 + .../rogue_m/services/server/include/physmem.h | 102 + .../services/server/include/physmem_dmabuf.h | 77 + .../services/server/include/physmem_lma.h | 84 + .../services/server/include/physmem_osmem.h | 114 + .../gpu/rogue_m/services/server/include/pmr.h | 823 ++++ .../services/server/include/pmr_impl.h | 180 + .../rogue_m/services/server/include/power.h | 160 + .../services/server/include/process_stats.h | 168 + .../services/server/include/pvr_dvfs.h | 141 + .../rogue_m/services/server/include/pvrsrv.h | 515 +++ .../services/server/include/pvrsrv_cleanup.h | 76 + .../services/server/include/pvrsrv_device.h | 193 + .../services/server/include/ri_server.h | 87 + .../services/server/include/secure_export.h | 65 + .../rogue_m/services/server/include/srvcore.h | 203 + .../rogue_m/services/server/include/srvkm.h | 193 + .../services/server/include/sync_server.h | 345 ++ .../server/include/sync_server_internal.h | 55 + .../services/server/include/tlintern.h | 273 ++ .../services/server/include/tlserver.h | 83 + .../services/server/include/tlstream.h | 331 ++ .../services/shared/common/devicemem.c | 2054 +++++++++ .../services/shared/common/devicemem_pdump.c | 323 ++ .../services/shared/common/devicemem_utils.c | 698 +++ .../rogue_m/services/shared/common/dllist.c | 81 + .../gpu/rogue_m/services/shared/common/hash.c | 708 +++ .../services/shared/common/mem_utils.c | 257 ++ .../gpu/rogue_m/services/shared/common/ra.c | 1357 ++++++ .../gpu/rogue_m/services/shared/common/sync.c | 1959 ++++++++ .../rogue_m/services/shared/common/tlclient.c | 365 ++ .../shared/common/uniq_key_splay_tree.c | 244 + .../shared/common/uniq_key_splay_tree.h | 95 + .../shared/devices/rgx/rgx_compat_bvnc.c | 150 + .../shared/devices/rgx/rgx_compat_bvnc.h | 96 + .../services/shared/include/cache_internal.h | 58 + .../services/shared/include/devicemem.h | 559 +++ .../shared/include/devicemem_history_shared.h | 57 + .../services/shared/include/devicemem_mmap.h | 108 + .../services/shared/include/devicemem_pdump.h | 343 ++ .../services/shared/include/devicemem_utils.h | 388 ++ .../rogue_m/services/shared/include/dllist.h | 248 + .../rogue_m/services/shared/include/sync.h | 399 ++ .../services/shared/include/sync_internal.h | 125 + .../services/shared/include/tlclient.h | 169 + .../system/rgx_linux_apollo/Kbuild.mk | 50 + .../system/rgx_linux_apollo/sysconfig.c | 733 +++ .../system/rgx_linux_apollo/sysinfo.h | 66 + .../services/system/rgx_nohw/Kbuild.mk | 46 + .../services/system/rgx_nohw/sysconfig.c | 258 ++ .../services/system/rgx_nohw/sysconfig.h | 68 + .../services/system/rgx_nohw/sysinfo.h | 71 + .../services/system/rgx_sunxi/Kbuild.mk | 49 + .../system/rgx_sunxi/ion_support_sunxi.c | 75 + .../services/system/rgx_sunxi/sunxi_init.c | 462 ++ .../services/system/rgx_sunxi/sunxi_init.h | 57 + .../services/system/rgx_sunxi/sysconfig.c | 260 ++ .../services/system/rgx_sunxi/sysconfig.h | 66 + .../services/system/rgx_sunxi/sysinfo.h | 61 + .../system/common/ion_support_generic.c | 161 + .../gpu/rogue_m/system/common/pci_support.c | 658 +++ .../gpu/rogue_m/system/include/ion_support.h | 46 + .../gpu/rogue_m/system/include/pci_support.h | 74 + .../gpu/rogue_m/system/include/syscommon.h | 173 + drivers/gpu/rogue_m/system/rk3368/Kbuild.mk | 49 + drivers/gpu/rogue_m/system/rk3368/rk_init.c | 2150 +++++++++ drivers/gpu/rogue_m/system/rk3368/rk_init.h | 179 + drivers/gpu/rogue_m/system/rk3368/sysconfig.c | 264 ++ drivers/gpu/rogue_m/system/rk3368/sysconfig.h | 72 + drivers/gpu/rogue_m/system/rk3368/sysinfo.h | 71 + .../tools/services/debug/dbgdriv/Kbuild.mk | 50 + .../tools/services/debug/dbgdriv/Linux.mk | 45 + .../services/debug/dbgdriv/common/dbgdriv.c | 1572 +++++++ .../services/debug/dbgdriv/common/dbgdriv.h | 114 + .../debug/dbgdriv/common/dbgdriv_ioctl.h | 58 + .../services/debug/dbgdriv/common/handle.c | 141 + .../services/debug/dbgdriv/common/hostfunc.h | 102 + .../services/debug/dbgdriv/common/ioctl.c | 308 ++ .../services/debug/dbgdriv/linux/hostfunc.c | 328 ++ .../tools/services/debug/dbgdriv/linux/main.c | 373 ++ .../tools/services/debug/include/linuxsrv.h | 69 + drivers/video/Kconfig | 2 + 436 files changed, 160130 insertions(+) create mode 100644 drivers/gpu/rogue_m/GPL-COPYING create mode 100644 drivers/gpu/rogue_m/INSTALL create mode 100644 drivers/gpu/rogue_m/Kconfig create mode 100644 drivers/gpu/rogue_m/MIT-COPYING create mode 100644 drivers/gpu/rogue_m/Makefile create mode 100644 drivers/gpu/rogue_m/README create mode 100644 drivers/gpu/rogue_m/build/linux/bits.mk create mode 100644 drivers/gpu/rogue_m/build/linux/buildvars.mk create mode 100644 drivers/gpu/rogue_m/build/linux/commands.mk create mode 100644 drivers/gpu/rogue_m/build/linux/common/3rdparty.mk create mode 100644 drivers/gpu/rogue_m/build/linux/common/android/arch.mk create mode 100644 drivers/gpu/rogue_m/build/linux/common/android/arch_common.mk create mode 100644 drivers/gpu/rogue_m/build/linux/common/android/extra_config.mk create mode 100644 drivers/gpu/rogue_m/build/linux/common/android/features.mk create mode 100644 drivers/gpu/rogue_m/build/linux/common/android/install.sh.tpl create mode 100644 drivers/gpu/rogue_m/build/linux/common/android/paths.mk create mode 100644 drivers/gpu/rogue_m/build/linux/common/android/platform_version.mk create mode 100644 drivers/gpu/rogue_m/build/linux/common/pvrgdb.mk create mode 100644 drivers/gpu/rogue_m/build/linux/common/testchip.mk create mode 100644 drivers/gpu/rogue_m/build/linux/config/compiler.mk create mode 100644 drivers/gpu/rogue_m/build/linux/config/compilers/aarch64-linux-android.mk create mode 100644 drivers/gpu/rogue_m/build/linux/config/compilers/arm-eabi.mk create mode 100644 drivers/gpu/rogue_m/build/linux/config/compilers/arm-linux-androideabi.mk create mode 100644 drivers/gpu/rogue_m/build/linux/config/compilers/i386-linux-gnu.mk create mode 100644 drivers/gpu/rogue_m/build/linux/config/compilers/x86_64-linux-gnu.mk create mode 100644 drivers/gpu/rogue_m/build/linux/config/core.mk create mode 100644 drivers/gpu/rogue_m/build/linux/config/help.mk create mode 100644 drivers/gpu/rogue_m/build/linux/config/kernel_version.mk create mode 100644 drivers/gpu/rogue_m/build/linux/config/preconfig.mk create mode 100644 drivers/gpu/rogue_m/build/linux/defs.mk create mode 100644 drivers/gpu/rogue_m/build/linux/generic_arm_android/Makefile create mode 100644 drivers/gpu/rogue_m/build/linux/kbuild/Makefile.template create mode 100644 drivers/gpu/rogue_m/build/linux/kbuild/kbuild.mk create mode 100644 drivers/gpu/rogue_m/build/linux/moduledefs/host_i386.mk create mode 100644 drivers/gpu/rogue_m/build/linux/moduledefs/host_x86_64.mk create mode 100644 drivers/gpu/rogue_m/build/linux/moduledefs/target_aarch64.mk create mode 100644 drivers/gpu/rogue_m/build/linux/moduledefs/target_armv7-a.mk create mode 100644 drivers/gpu/rogue_m/build/linux/moduledefs/target_i686.mk create mode 100644 drivers/gpu/rogue_m/build/linux/moduledefs/target_neutral.mk create mode 100644 drivers/gpu/rogue_m/build/linux/moduledefs/target_x86_64.mk create mode 100644 drivers/gpu/rogue_m/build/linux/moduledefs_common.mk create mode 100644 drivers/gpu/rogue_m/build/linux/modules.mk create mode 100644 drivers/gpu/rogue_m/build/linux/modules/kernel_module.mk create mode 100644 drivers/gpu/rogue_m/build/linux/pc_android/Makefile create mode 100644 drivers/gpu/rogue_m/build/linux/prepare_tree.mk create mode 100644 drivers/gpu/rogue_m/build/linux/pvrversion.mk create mode 100644 drivers/gpu/rogue_m/build/linux/scripts.mk create mode 100644 drivers/gpu/rogue_m/build/linux/sunxi_android/Makefile create mode 100644 drivers/gpu/rogue_m/build/linux/this_makefile.mk create mode 100644 drivers/gpu/rogue_m/build/linux/tools/cc-check.sh create mode 100644 drivers/gpu/rogue_m/build/linux/toplevel.mk create mode 100644 drivers/gpu/rogue_m/config_kernel.h create mode 100644 drivers/gpu/rogue_m/config_kernel.mk create mode 100644 drivers/gpu/rogue_m/generated/breakpoint_bridge/common_breakpoint_bridge.h create mode 100644 drivers/gpu/rogue_m/generated/breakpoint_bridge/server_breakpoint_bridge.c create mode 100644 drivers/gpu/rogue_m/generated/cachegeneric_bridge/common_cachegeneric_bridge.h create mode 100644 drivers/gpu/rogue_m/generated/cachegeneric_bridge/server_cachegeneric_bridge.c create mode 100644 drivers/gpu/rogue_m/generated/cmm_bridge/common_cmm_bridge.h create mode 100644 drivers/gpu/rogue_m/generated/cmm_bridge/server_cmm_bridge.c create mode 100644 drivers/gpu/rogue_m/generated/ddevicememhistory_bridge/client_devicememhistory_bridge.c create mode 100644 drivers/gpu/rogue_m/generated/debugmisc_bridge/common_debugmisc_bridge.h create mode 100644 drivers/gpu/rogue_m/generated/debugmisc_bridge/server_debugmisc_bridge.c create mode 100644 drivers/gpu/rogue_m/generated/devicememhistory_bridge/client_devicememhistory_bridge.h create mode 100644 drivers/gpu/rogue_m/generated/devicememhistory_bridge/common_devicememhistory_bridge.h create mode 100644 drivers/gpu/rogue_m/generated/devicememhistory_bridge/server_devicememhistory_bridge.c create mode 100644 drivers/gpu/rogue_m/generated/dmabuf_bridge/common_dmabuf_bridge.h create mode 100644 drivers/gpu/rogue_m/generated/dmabuf_bridge/server_dmabuf_bridge.c create mode 100644 drivers/gpu/rogue_m/generated/dmm_bridge/client_mm_bridge.c create mode 100644 drivers/gpu/rogue_m/generated/dmm_bridge/client_mm_bridge.h create mode 100644 drivers/gpu/rogue_m/generated/dpdumpmm_bridge/client_pdumpmm_bridge.c create mode 100644 drivers/gpu/rogue_m/generated/dpvrtl_bridge/client_pvrtl_bridge.c create mode 100644 drivers/gpu/rogue_m/generated/dri_bridge/client_ri_bridge.c create mode 100644 drivers/gpu/rogue_m/generated/dsync_bridge/client_sync_bridge.c create mode 100644 drivers/gpu/rogue_m/generated/dsync_bridge/client_sync_bridge.h create mode 100644 drivers/gpu/rogue_m/generated/mm_bridge/common_mm_bridge.h create mode 100644 drivers/gpu/rogue_m/generated/mm_bridge/server_mm_bridge.c create mode 100644 drivers/gpu/rogue_m/generated/pdump_bridge/common_pdump_bridge.h create mode 100644 drivers/gpu/rogue_m/generated/pdump_bridge/server_pdump_bridge.c create mode 100644 drivers/gpu/rogue_m/generated/pdumpctrl_bridge/common_pdumpctrl_bridge.h create mode 100644 drivers/gpu/rogue_m/generated/pdumpctrl_bridge/server_pdumpctrl_bridge.c create mode 100644 drivers/gpu/rogue_m/generated/pdumpmm_bridge/client_pdumpmm_bridge.h create mode 100644 drivers/gpu/rogue_m/generated/pdumpmm_bridge/common_pdumpmm_bridge.h create mode 100644 drivers/gpu/rogue_m/generated/pdumpmm_bridge/server_pdumpmm_bridge.c create mode 100644 drivers/gpu/rogue_m/generated/pvrtl_bridge/client_pvrtl_bridge.h create mode 100644 drivers/gpu/rogue_m/generated/pvrtl_bridge/common_pvrtl_bridge.h create mode 100644 drivers/gpu/rogue_m/generated/pvrtl_bridge/server_pvrtl_bridge.c create mode 100644 drivers/gpu/rogue_m/generated/regconfig_bridge/common_regconfig_bridge.h create mode 100644 drivers/gpu/rogue_m/generated/regconfig_bridge/server_regconfig_bridge.c create mode 100644 drivers/gpu/rogue_m/generated/rgxcmp_bridge/common_rgxcmp_bridge.h create mode 100644 drivers/gpu/rogue_m/generated/rgxcmp_bridge/server_rgxcmp_bridge.c create mode 100644 drivers/gpu/rogue_m/generated/rgxhwperf_bridge/common_rgxhwperf_bridge.h create mode 100644 drivers/gpu/rogue_m/generated/rgxhwperf_bridge/server_rgxhwperf_bridge.c create mode 100644 drivers/gpu/rogue_m/generated/rgxinit_bridge/common_rgxinit_bridge.h create mode 100644 drivers/gpu/rogue_m/generated/rgxinit_bridge/server_rgxinit_bridge.c create mode 100644 drivers/gpu/rogue_m/generated/rgxpdump_bridge/common_rgxpdump_bridge.h create mode 100644 drivers/gpu/rogue_m/generated/rgxpdump_bridge/server_rgxpdump_bridge.c create mode 100644 drivers/gpu/rogue_m/generated/rgxta3d_bridge/common_rgxta3d_bridge.h create mode 100644 drivers/gpu/rogue_m/generated/rgxta3d_bridge/server_rgxta3d_bridge.c create mode 100644 drivers/gpu/rogue_m/generated/rgxtq_bridge/common_rgxtq_bridge.h create mode 100644 drivers/gpu/rogue_m/generated/rgxtq_bridge/server_rgxtq_bridge.c create mode 100644 drivers/gpu/rogue_m/generated/ri_bridge/client_ri_bridge.h create mode 100644 drivers/gpu/rogue_m/generated/ri_bridge/common_ri_bridge.h create mode 100644 drivers/gpu/rogue_m/generated/ri_bridge/server_ri_bridge.c create mode 100644 drivers/gpu/rogue_m/generated/smm_bridge/common_smm_bridge.h create mode 100644 drivers/gpu/rogue_m/generated/smm_bridge/server_smm_bridge.c create mode 100644 drivers/gpu/rogue_m/generated/srvcore_bridge/common_srvcore_bridge.h create mode 100644 drivers/gpu/rogue_m/generated/srvcore_bridge/server_srvcore_bridge.c create mode 100644 drivers/gpu/rogue_m/generated/sync_bridge/common_sync_bridge.h create mode 100644 drivers/gpu/rogue_m/generated/sync_bridge/server_sync_bridge.c create mode 100644 drivers/gpu/rogue_m/generated/syncsexport_bridge/common_syncsexport_bridge.h create mode 100644 drivers/gpu/rogue_m/generated/syncsexport_bridge/server_syncsexport_bridge.c create mode 100644 drivers/gpu/rogue_m/generated/timerquery_bridge/common_timerquery_bridge.h create mode 100644 drivers/gpu/rogue_m/generated/timerquery_bridge/server_timerquery_bridge.c create mode 100644 drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_1.V.2.0.h create mode 100644 drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_1.V.2.20.h create mode 100644 drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_1.V.2.30.h create mode 100644 drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_1.V.2.5.h create mode 100644 drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_1.V.4.12.h create mode 100644 drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_1.V.4.15.h create mode 100644 drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_1.V.4.19.h create mode 100644 drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_1.V.4.5.h create mode 100644 drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_1.V.4.6.h create mode 100644 drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_12.V.1.20.h create mode 100644 drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_4.V.2.51.h create mode 100644 drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_4.V.2.52.h create mode 100644 drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_4.V.2.57.h create mode 100644 drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_4.V.2.58.h create mode 100644 drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_4.V.4.53.h create mode 100644 drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_4.V.6.62.h create mode 100644 drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_5.V.1.46.h create mode 100644 drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_8.V.2.34.h create mode 100644 drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_8.V.4.38.h create mode 100644 drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_1.32.4.19.h create mode 100644 drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_1.33.2.5.h create mode 100644 drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_1.39.4.19.h create mode 100644 drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_1.48.2.0.h create mode 100644 drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_1.72.4.12.h create mode 100644 drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_1.75.2.20.h create mode 100644 drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_1.75.2.30.h create mode 100644 drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_1.76.4.6.h create mode 100644 drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_1.81.4.15.h create mode 100644 drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_1.82.4.5.h create mode 100644 drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_12.5.1.20.h create mode 100644 drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_4.29.2.51.h create mode 100644 drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_4.32.2.52.h create mode 100644 drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_4.40.2.51.h create mode 100644 drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_4.41.2.57.h create mode 100644 drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_4.42.4.53.h create mode 100644 drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_4.43.6.62.h create mode 100644 drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_4.45.2.58.h create mode 100644 drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_5.11.1.46.h create mode 100644 drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_5.9.1.46.h create mode 100644 drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_8.21.2.34.h create mode 100644 drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_8.41.4.38.h create mode 100644 drivers/gpu/rogue_m/hwdefs/km/rgx_cr_defs_km.h create mode 100644 drivers/gpu/rogue_m/hwdefs/km/rgxdefs_km.h create mode 100644 drivers/gpu/rogue_m/hwdefs/km/rgxmmudefs_km.h create mode 100644 drivers/gpu/rogue_m/include/adf/adf_ext.h create mode 100644 drivers/gpu/rogue_m/include/cache_external.h create mode 100644 drivers/gpu/rogue_m/include/dbgdrvif_srv5.h create mode 100644 drivers/gpu/rogue_m/include/devicemem_typedefs.h create mode 100644 drivers/gpu/rogue_m/include/img_3dtypes.h create mode 100644 drivers/gpu/rogue_m/include/img_defs.h create mode 100644 drivers/gpu/rogue_m/include/img_types.h create mode 100644 drivers/gpu/rogue_m/include/kernel_types.h create mode 100644 drivers/gpu/rogue_m/include/lock_types.h create mode 100644 drivers/gpu/rogue_m/include/pdumpdefs.h create mode 100644 drivers/gpu/rogue_m/include/pvr_debug.h create mode 100644 drivers/gpu/rogue_m/include/pvr_fd_sync_kernel.h create mode 100644 drivers/gpu/rogue_m/include/pvrmodule.h create mode 100644 drivers/gpu/rogue_m/include/pvrsrv_device_types.h create mode 100644 drivers/gpu/rogue_m/include/pvrsrv_devmem.h create mode 100644 drivers/gpu/rogue_m/include/pvrsrv_error.h create mode 100644 drivers/gpu/rogue_m/include/pvrsrv_errors.h create mode 100644 drivers/gpu/rogue_m/include/pvrsrv_memallocflags.h create mode 100644 drivers/gpu/rogue_m/include/pvrversion.h create mode 100644 drivers/gpu/rogue_m/include/rgx_common.h create mode 100644 drivers/gpu/rogue_m/include/rgx_heaps.h create mode 100644 drivers/gpu/rogue_m/include/rgx_hwperf_km.h create mode 100644 drivers/gpu/rogue_m/include/rgx_memallocflags.h create mode 100644 drivers/gpu/rogue_m/include/rgx_meta.h create mode 100644 drivers/gpu/rogue_m/include/rgx_options_km.h create mode 100644 drivers/gpu/rogue_m/include/rgxscript.h create mode 100644 drivers/gpu/rogue_m/include/ri_typedefs.h create mode 100644 drivers/gpu/rogue_m/include/services.h create mode 100644 drivers/gpu/rogue_m/include/servicesext.h create mode 100644 drivers/gpu/rogue_m/include/sync_external.h create mode 100644 drivers/gpu/rogue_m/include/system/rgx_tc/apollo_regs.h create mode 100644 drivers/gpu/rogue_m/include/system/rgx_tc/pdp_regs.h create mode 100644 drivers/gpu/rogue_m/include/system/rgx_tc/tcf_clk_ctrl.h create mode 100644 drivers/gpu/rogue_m/include/system/rgx_tc/tcf_pll.h create mode 100644 drivers/gpu/rogue_m/include/system/rgx_tc/tcf_rgbpdp_regs.h create mode 100644 drivers/gpu/rogue_m/kernel/drivers/staging/imgtec/Kbuild.mk create mode 100644 drivers/gpu/rogue_m/kernel/drivers/staging/imgtec/Linux.mk create mode 100644 drivers/gpu/rogue_m/kernel/drivers/staging/imgtec/adf_common.c create mode 100644 drivers/gpu/rogue_m/kernel/drivers/staging/imgtec/adf_common.h create mode 100644 drivers/gpu/rogue_m/kernel/drivers/staging/imgtec/adf_fbdev.c create mode 100644 drivers/gpu/rogue_m/kernel/drivers/staging/imgtec/adf_pdp.c create mode 100644 drivers/gpu/rogue_m/kernel/drivers/staging/imgtec/adf_sunxi.c create mode 100644 drivers/gpu/rogue_m/kernel/drivers/staging/imgtec/adf_sunxi.h create mode 100644 drivers/gpu/rogue_m/kernel/drivers/staging/imgtec/apollo.c create mode 100644 drivers/gpu/rogue_m/kernel/drivers/staging/imgtec/apollo_drv.h create mode 100644 drivers/gpu/rogue_m/kernel/drivers/staging/imgtec/ion_lma_heap.c create mode 100644 drivers/gpu/rogue_m/kernel/drivers/staging/imgtec/ion_lma_heap.h create mode 100644 drivers/gpu/rogue_m/kernel/drivers/staging/imgtec/pvr_sync.c create mode 100644 drivers/gpu/rogue_m/kernel/drivers/staging/imgtec/pvr_sync.h create mode 100644 drivers/gpu/rogue_m/kernel/drivers/staging/imgtec/services_kernel_client.h create mode 100644 drivers/gpu/rogue_m/services/include/cache_defines.h create mode 100644 drivers/gpu/rogue_m/services/include/env/linux/ion_sys.h create mode 100644 drivers/gpu/rogue_m/services/include/env/linux/pvr_bridge_io.h create mode 100644 drivers/gpu/rogue_m/services/include/mm_common.h create mode 100644 drivers/gpu/rogue_m/services/include/pdump.h create mode 100644 drivers/gpu/rogue_m/services/include/physheap.h create mode 100644 drivers/gpu/rogue_m/services/include/pvr_bridge.h create mode 100644 drivers/gpu/rogue_m/services/include/pvr_bridge_client.h create mode 100644 drivers/gpu/rogue_m/services/include/pvr_tl.h create mode 100644 drivers/gpu/rogue_m/services/include/pvr_tlcommon.h create mode 100644 drivers/gpu/rogue_m/services/include/rgx_bridge.h create mode 100644 drivers/gpu/rogue_m/services/include/rgx_fwif.h create mode 100644 drivers/gpu/rogue_m/services/include/rgx_fwif_alignchecks_km.h create mode 100644 drivers/gpu/rogue_m/services/include/rgx_fwif_km.h create mode 100644 drivers/gpu/rogue_m/services/include/rgx_fwif_resetframework.h create mode 100644 drivers/gpu/rogue_m/services/include/rgx_fwif_shared.h create mode 100644 drivers/gpu/rogue_m/services/include/rgx_pdump_panics.h create mode 100644 drivers/gpu/rogue_m/services/include/rgx_tq_shared.h create mode 100644 drivers/gpu/rogue_m/services/include/rgxapi_km.h create mode 100644 drivers/gpu/rogue_m/services/include/shared/allocmem.h create mode 100644 drivers/gpu/rogue_m/services/include/shared/hash.h create mode 100644 drivers/gpu/rogue_m/services/include/shared/lock.h create mode 100644 drivers/gpu/rogue_m/services/include/shared/ra.h create mode 100644 drivers/gpu/rogue_m/services/server/common/cache_generic.c create mode 100644 drivers/gpu/rogue_m/services/server/common/connection_server.c create mode 100644 drivers/gpu/rogue_m/services/server/common/devicemem_heapcfg.c create mode 100644 drivers/gpu/rogue_m/services/server/common/devicemem_history_server.c create mode 100644 drivers/gpu/rogue_m/services/server/common/devicemem_server.c create mode 100644 drivers/gpu/rogue_m/services/server/common/handle.c create mode 100644 drivers/gpu/rogue_m/services/server/common/lists.c create mode 100644 drivers/gpu/rogue_m/services/server/common/mmu_common.c create mode 100644 drivers/gpu/rogue_m/services/server/common/pdump_common.c create mode 100644 drivers/gpu/rogue_m/services/server/common/pdump_mmu.c create mode 100644 drivers/gpu/rogue_m/services/server/common/pdump_physmem.c create mode 100644 drivers/gpu/rogue_m/services/server/common/physheap.c create mode 100644 drivers/gpu/rogue_m/services/server/common/physmem.c create mode 100644 drivers/gpu/rogue_m/services/server/common/physmem_lma.c create mode 100644 drivers/gpu/rogue_m/services/server/common/pmr.c create mode 100644 drivers/gpu/rogue_m/services/server/common/power.c create mode 100644 drivers/gpu/rogue_m/services/server/common/process_stats.c create mode 100644 drivers/gpu/rogue_m/services/server/common/pvrsrv.c create mode 100644 drivers/gpu/rogue_m/services/server/common/ri_server.c create mode 100644 drivers/gpu/rogue_m/services/server/common/srvcore.c create mode 100644 drivers/gpu/rogue_m/services/server/common/sync_server.c create mode 100644 drivers/gpu/rogue_m/services/server/common/tlintern.c create mode 100644 drivers/gpu/rogue_m/services/server/common/tlserver.c create mode 100644 drivers/gpu/rogue_m/services/server/common/tlstream.c create mode 100644 drivers/gpu/rogue_m/services/server/devices/rgx/debugmisc_server.c create mode 100644 drivers/gpu/rogue_m/services/server/devices/rgx/debugmisc_server.h create mode 100644 drivers/gpu/rogue_m/services/server/devices/rgx/rgxbreakpoint.c create mode 100644 drivers/gpu/rogue_m/services/server/devices/rgx/rgxbreakpoint.h create mode 100644 drivers/gpu/rogue_m/services/server/devices/rgx/rgxccb.c create mode 100644 drivers/gpu/rogue_m/services/server/devices/rgx/rgxccb.h create mode 100644 drivers/gpu/rogue_m/services/server/devices/rgx/rgxcompute.c create mode 100644 drivers/gpu/rogue_m/services/server/devices/rgx/rgxcompute.h create mode 100644 drivers/gpu/rogue_m/services/server/devices/rgx/rgxdebug.c create mode 100644 drivers/gpu/rogue_m/services/server/devices/rgx/rgxdebug.h create mode 100644 drivers/gpu/rogue_m/services/server/devices/rgx/rgxdevice.h create mode 100644 drivers/gpu/rogue_m/services/server/devices/rgx/rgxfwutils.c create mode 100644 drivers/gpu/rogue_m/services/server/devices/rgx/rgxfwutils.h create mode 100644 drivers/gpu/rogue_m/services/server/devices/rgx/rgxheapconfig.h create mode 100644 drivers/gpu/rogue_m/services/server/devices/rgx/rgxhwperf.c create mode 100644 drivers/gpu/rogue_m/services/server/devices/rgx/rgxhwperf.h create mode 100644 drivers/gpu/rogue_m/services/server/devices/rgx/rgxinit.c create mode 100644 drivers/gpu/rogue_m/services/server/devices/rgx/rgxinit.h create mode 100644 drivers/gpu/rogue_m/services/server/devices/rgx/rgxmem.c create mode 100644 drivers/gpu/rogue_m/services/server/devices/rgx/rgxmem.h create mode 100644 drivers/gpu/rogue_m/services/server/devices/rgx/rgxmmuinit.c create mode 100644 drivers/gpu/rogue_m/services/server/devices/rgx/rgxmmuinit.h create mode 100644 drivers/gpu/rogue_m/services/server/devices/rgx/rgxpdump.c create mode 100644 drivers/gpu/rogue_m/services/server/devices/rgx/rgxpdump.h create mode 100644 drivers/gpu/rogue_m/services/server/devices/rgx/rgxpower.c create mode 100644 drivers/gpu/rogue_m/services/server/devices/rgx/rgxpower.h create mode 100644 drivers/gpu/rogue_m/services/server/devices/rgx/rgxregconfig.c create mode 100644 drivers/gpu/rogue_m/services/server/devices/rgx/rgxregconfig.h create mode 100644 drivers/gpu/rogue_m/services/server/devices/rgx/rgxsync.c create mode 100644 drivers/gpu/rogue_m/services/server/devices/rgx/rgxsync.h create mode 100644 drivers/gpu/rogue_m/services/server/devices/rgx/rgxta3d.c create mode 100644 drivers/gpu/rogue_m/services/server/devices/rgx/rgxta3d.h create mode 100644 drivers/gpu/rogue_m/services/server/devices/rgx/rgxtimecorr.c create mode 100644 drivers/gpu/rogue_m/services/server/devices/rgx/rgxtimecorr.h create mode 100644 drivers/gpu/rogue_m/services/server/devices/rgx/rgxtimerquery.c create mode 100644 drivers/gpu/rogue_m/services/server/devices/rgx/rgxtimerquery.h create mode 100644 drivers/gpu/rogue_m/services/server/devices/rgx/rgxtransfer.c create mode 100644 drivers/gpu/rogue_m/services/server/devices/rgx/rgxtransfer.h create mode 100644 drivers/gpu/rogue_m/services/server/devices/rgx/rgxutils.c create mode 100644 drivers/gpu/rogue_m/services/server/devices/rgx/rgxutils.h create mode 100644 drivers/gpu/rogue_m/services/server/env/linux/Kbuild.mk create mode 100644 drivers/gpu/rogue_m/services/server/env/linux/Linux.mk create mode 100644 drivers/gpu/rogue_m/services/server/env/linux/allocmem.c create mode 100644 drivers/gpu/rogue_m/services/server/env/linux/devicemem_mmap_stub.c create mode 100644 drivers/gpu/rogue_m/services/server/env/linux/driverlock.h create mode 100644 drivers/gpu/rogue_m/services/server/env/linux/env_connection.h create mode 100644 drivers/gpu/rogue_m/services/server/env/linux/env_data.h create mode 100644 drivers/gpu/rogue_m/services/server/env/linux/event.c create mode 100644 drivers/gpu/rogue_m/services/server/env/linux/event.h create mode 100644 drivers/gpu/rogue_m/services/server/env/linux/handle_idr.c create mode 100644 drivers/gpu/rogue_m/services/server/env/linux/linkage.h create mode 100644 drivers/gpu/rogue_m/services/server/env/linux/mm.c create mode 100644 drivers/gpu/rogue_m/services/server/env/linux/mm.h create mode 100644 drivers/gpu/rogue_m/services/server/env/linux/mmap.c create mode 100644 drivers/gpu/rogue_m/services/server/env/linux/module.c create mode 100644 drivers/gpu/rogue_m/services/server/env/linux/module_common.c create mode 100644 drivers/gpu/rogue_m/services/server/env/linux/module_common.h create mode 100644 drivers/gpu/rogue_m/services/server/env/linux/osconnection_server.c create mode 100644 drivers/gpu/rogue_m/services/server/env/linux/osfunc.c create mode 100644 drivers/gpu/rogue_m/services/server/env/linux/osfunc_arm.c create mode 100644 drivers/gpu/rogue_m/services/server/env/linux/osfunc_arm64.c create mode 100644 drivers/gpu/rogue_m/services/server/env/linux/osfunc_x86.c create mode 100644 drivers/gpu/rogue_m/services/server/env/linux/ossecure_export.c create mode 100644 drivers/gpu/rogue_m/services/server/env/linux/pdump.c create mode 100644 drivers/gpu/rogue_m/services/server/env/linux/physmem_dmabuf.c create mode 100644 drivers/gpu/rogue_m/services/server/env/linux/physmem_osmem_linux.c create mode 100644 drivers/gpu/rogue_m/services/server/env/linux/physmem_osmem_linux.h create mode 100644 drivers/gpu/rogue_m/services/server/env/linux/physmem_tdmetacode_linux.c create mode 100644 drivers/gpu/rogue_m/services/server/env/linux/physmem_tdsecbuf_linux.c create mode 100644 drivers/gpu/rogue_m/services/server/env/linux/private_data.h create mode 100644 drivers/gpu/rogue_m/services/server/env/linux/pvr_bridge_k.c create mode 100644 drivers/gpu/rogue_m/services/server/env/linux/pvr_debug.c create mode 100644 drivers/gpu/rogue_m/services/server/env/linux/pvr_debugfs.c create mode 100644 drivers/gpu/rogue_m/services/server/env/linux/pvr_debugfs.h create mode 100644 drivers/gpu/rogue_m/services/server/env/linux/pvr_gputrace.c create mode 100644 drivers/gpu/rogue_m/services/server/env/linux/pvr_gputrace.h create mode 100644 drivers/gpu/rogue_m/services/server/env/linux/pvr_uaccess.h create mode 100644 drivers/gpu/rogue_m/services/server/env/linux/rogue_trace_events.h create mode 100644 drivers/gpu/rogue_m/services/server/env/linux/trace_events.c create mode 100644 drivers/gpu/rogue_m/services/server/env/linux/trace_events.h create mode 100644 drivers/gpu/rogue_m/services/server/include/cache_generic.h create mode 100644 drivers/gpu/rogue_m/services/server/include/connection_server.h create mode 100644 drivers/gpu/rogue_m/services/server/include/debug_request_ids.h create mode 100644 drivers/gpu/rogue_m/services/server/include/device.h create mode 100644 drivers/gpu/rogue_m/services/server/include/devicemem_heapcfg.h create mode 100644 drivers/gpu/rogue_m/services/server/include/devicemem_history_server.h create mode 100644 drivers/gpu/rogue_m/services/server/include/devicemem_server.h create mode 100644 drivers/gpu/rogue_m/services/server/include/devicemem_server_utils.h create mode 100644 drivers/gpu/rogue_m/services/server/include/handle.h create mode 100644 drivers/gpu/rogue_m/services/server/include/handle_impl.h create mode 100644 drivers/gpu/rogue_m/services/server/include/lists.h create mode 100644 drivers/gpu/rogue_m/services/server/include/mmu_common.h create mode 100644 drivers/gpu/rogue_m/services/server/include/osconnection_server.h create mode 100644 drivers/gpu/rogue_m/services/server/include/osfunc.h create mode 100644 drivers/gpu/rogue_m/services/server/include/ossecure_export.h create mode 100644 drivers/gpu/rogue_m/services/server/include/pdump_km.h create mode 100644 drivers/gpu/rogue_m/services/server/include/pdump_mmu.h create mode 100644 drivers/gpu/rogue_m/services/server/include/pdump_osfunc.h create mode 100644 drivers/gpu/rogue_m/services/server/include/pdump_physmem.h create mode 100644 drivers/gpu/rogue_m/services/server/include/pdump_symbolicaddr.h create mode 100644 drivers/gpu/rogue_m/services/server/include/physmem.h create mode 100644 drivers/gpu/rogue_m/services/server/include/physmem_dmabuf.h create mode 100644 drivers/gpu/rogue_m/services/server/include/physmem_lma.h create mode 100644 drivers/gpu/rogue_m/services/server/include/physmem_osmem.h create mode 100644 drivers/gpu/rogue_m/services/server/include/pmr.h create mode 100644 drivers/gpu/rogue_m/services/server/include/pmr_impl.h create mode 100644 drivers/gpu/rogue_m/services/server/include/power.h create mode 100644 drivers/gpu/rogue_m/services/server/include/process_stats.h create mode 100644 drivers/gpu/rogue_m/services/server/include/pvr_dvfs.h create mode 100644 drivers/gpu/rogue_m/services/server/include/pvrsrv.h create mode 100644 drivers/gpu/rogue_m/services/server/include/pvrsrv_cleanup.h create mode 100644 drivers/gpu/rogue_m/services/server/include/pvrsrv_device.h create mode 100644 drivers/gpu/rogue_m/services/server/include/ri_server.h create mode 100644 drivers/gpu/rogue_m/services/server/include/secure_export.h create mode 100644 drivers/gpu/rogue_m/services/server/include/srvcore.h create mode 100644 drivers/gpu/rogue_m/services/server/include/srvkm.h create mode 100644 drivers/gpu/rogue_m/services/server/include/sync_server.h create mode 100644 drivers/gpu/rogue_m/services/server/include/sync_server_internal.h create mode 100644 drivers/gpu/rogue_m/services/server/include/tlintern.h create mode 100644 drivers/gpu/rogue_m/services/server/include/tlserver.h create mode 100644 drivers/gpu/rogue_m/services/server/include/tlstream.h create mode 100644 drivers/gpu/rogue_m/services/shared/common/devicemem.c create mode 100644 drivers/gpu/rogue_m/services/shared/common/devicemem_pdump.c create mode 100644 drivers/gpu/rogue_m/services/shared/common/devicemem_utils.c create mode 100644 drivers/gpu/rogue_m/services/shared/common/dllist.c create mode 100644 drivers/gpu/rogue_m/services/shared/common/hash.c create mode 100644 drivers/gpu/rogue_m/services/shared/common/mem_utils.c create mode 100644 drivers/gpu/rogue_m/services/shared/common/ra.c create mode 100644 drivers/gpu/rogue_m/services/shared/common/sync.c create mode 100644 drivers/gpu/rogue_m/services/shared/common/tlclient.c create mode 100644 drivers/gpu/rogue_m/services/shared/common/uniq_key_splay_tree.c create mode 100644 drivers/gpu/rogue_m/services/shared/common/uniq_key_splay_tree.h create mode 100644 drivers/gpu/rogue_m/services/shared/devices/rgx/rgx_compat_bvnc.c create mode 100644 drivers/gpu/rogue_m/services/shared/devices/rgx/rgx_compat_bvnc.h create mode 100644 drivers/gpu/rogue_m/services/shared/include/cache_internal.h create mode 100644 drivers/gpu/rogue_m/services/shared/include/devicemem.h create mode 100644 drivers/gpu/rogue_m/services/shared/include/devicemem_history_shared.h create mode 100644 drivers/gpu/rogue_m/services/shared/include/devicemem_mmap.h create mode 100644 drivers/gpu/rogue_m/services/shared/include/devicemem_pdump.h create mode 100644 drivers/gpu/rogue_m/services/shared/include/devicemem_utils.h create mode 100644 drivers/gpu/rogue_m/services/shared/include/dllist.h create mode 100644 drivers/gpu/rogue_m/services/shared/include/sync.h create mode 100644 drivers/gpu/rogue_m/services/shared/include/sync_internal.h create mode 100644 drivers/gpu/rogue_m/services/shared/include/tlclient.h create mode 100644 drivers/gpu/rogue_m/services/system/rgx_linux_apollo/Kbuild.mk create mode 100644 drivers/gpu/rogue_m/services/system/rgx_linux_apollo/sysconfig.c create mode 100644 drivers/gpu/rogue_m/services/system/rgx_linux_apollo/sysinfo.h create mode 100644 drivers/gpu/rogue_m/services/system/rgx_nohw/Kbuild.mk create mode 100644 drivers/gpu/rogue_m/services/system/rgx_nohw/sysconfig.c create mode 100644 drivers/gpu/rogue_m/services/system/rgx_nohw/sysconfig.h create mode 100644 drivers/gpu/rogue_m/services/system/rgx_nohw/sysinfo.h create mode 100644 drivers/gpu/rogue_m/services/system/rgx_sunxi/Kbuild.mk create mode 100644 drivers/gpu/rogue_m/services/system/rgx_sunxi/ion_support_sunxi.c create mode 100644 drivers/gpu/rogue_m/services/system/rgx_sunxi/sunxi_init.c create mode 100644 drivers/gpu/rogue_m/services/system/rgx_sunxi/sunxi_init.h create mode 100644 drivers/gpu/rogue_m/services/system/rgx_sunxi/sysconfig.c create mode 100644 drivers/gpu/rogue_m/services/system/rgx_sunxi/sysconfig.h create mode 100644 drivers/gpu/rogue_m/services/system/rgx_sunxi/sysinfo.h create mode 100644 drivers/gpu/rogue_m/system/common/ion_support_generic.c create mode 100644 drivers/gpu/rogue_m/system/common/pci_support.c create mode 100644 drivers/gpu/rogue_m/system/include/ion_support.h create mode 100644 drivers/gpu/rogue_m/system/include/pci_support.h create mode 100644 drivers/gpu/rogue_m/system/include/syscommon.h create mode 100644 drivers/gpu/rogue_m/system/rk3368/Kbuild.mk create mode 100644 drivers/gpu/rogue_m/system/rk3368/rk_init.c create mode 100644 drivers/gpu/rogue_m/system/rk3368/rk_init.h create mode 100644 drivers/gpu/rogue_m/system/rk3368/sysconfig.c create mode 100644 drivers/gpu/rogue_m/system/rk3368/sysconfig.h create mode 100644 drivers/gpu/rogue_m/system/rk3368/sysinfo.h create mode 100644 drivers/gpu/rogue_m/tools/services/debug/dbgdriv/Kbuild.mk create mode 100644 drivers/gpu/rogue_m/tools/services/debug/dbgdriv/Linux.mk create mode 100644 drivers/gpu/rogue_m/tools/services/debug/dbgdriv/common/dbgdriv.c create mode 100644 drivers/gpu/rogue_m/tools/services/debug/dbgdriv/common/dbgdriv.h create mode 100644 drivers/gpu/rogue_m/tools/services/debug/dbgdriv/common/dbgdriv_ioctl.h create mode 100644 drivers/gpu/rogue_m/tools/services/debug/dbgdriv/common/handle.c create mode 100644 drivers/gpu/rogue_m/tools/services/debug/dbgdriv/common/hostfunc.h create mode 100644 drivers/gpu/rogue_m/tools/services/debug/dbgdriv/common/ioctl.c create mode 100644 drivers/gpu/rogue_m/tools/services/debug/dbgdriv/linux/hostfunc.c create mode 100644 drivers/gpu/rogue_m/tools/services/debug/dbgdriv/linux/main.c create mode 100644 drivers/gpu/rogue_m/tools/services/debug/include/linuxsrv.h diff --git a/drivers/gpu/Makefile b/drivers/gpu/Makefile index e9ed439a5b65..f203eac28637 100644 --- a/drivers/gpu/Makefile +++ b/drivers/gpu/Makefile @@ -4,3 +4,4 @@ obj-$(CONFIG_TEGRA_HOST1X) += host1x/ obj-y += drm/ vga/ obj-$(CONFIG_IMX_IPUV3_CORE) += ipu-v3/ +obj-$(CONFIG_POWERVR_ROGUE_M) += rogue_m/ diff --git a/drivers/gpu/rogue_m/GPL-COPYING b/drivers/gpu/rogue_m/GPL-COPYING new file mode 100644 index 000000000000..83d1261af023 --- /dev/null +++ b/drivers/gpu/rogue_m/GPL-COPYING @@ -0,0 +1,344 @@ +------------------------------------------------------------------------- + + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + Appendix: How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) 19yy + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. + +------------------------------------------------------------------------- + diff --git a/drivers/gpu/rogue_m/INSTALL b/drivers/gpu/rogue_m/INSTALL new file mode 100644 index 000000000000..1af75389b211 --- /dev/null +++ b/drivers/gpu/rogue_m/INSTALL @@ -0,0 +1,58 @@ +Rogue Embedded Systems DDK for the Linux kernel. +Copyright (C) Imagination Technologies Ltd. All rights reserved. +====================================================================== + +This file covers how to build and install the Imagination Technologies +Rogue DDK for the Linux kernel. For full details, see the relevant platform +guide. + + +Build System Environment Variables +------------------------------------------- + +The Rogue DDK Build scripts depend on a number of environment variables +being setup before compilation or installation of DDK software can +commence: + +$DISCIMAGE +The DDK Build scripts install files to the location specified by the +DISCIMAGE environment variable. To do so, they need to know where the +target system image resides: +$ export DISCIMAGE=/path/to/filesystem +If you are building on the target system, you can set this to '/'. + +$KERNELDIR +When building the Rogue DDK kernel module, the build needs access +to the headers of the Linux kernel. +If you are building on the target machine, you can set this as follows: +$ export KERNELDIR=/usr/src/linux-headers-`uname -r` + +$CROSS_COMPILE +If you intend on targeting a platform that is different from your build +machine (e.g.,if you are compiling on an x86 but targeting ARM) you need +to set the CROSS_COMPILE variable so that the build system uses the correct +compiler. E.g., +$ export CROSS_COMPILE=arm-linux-gnueabi- + + +Build and Install Instructions +------------------------------------------- + +The Rogue DDK configures different target builds within directories under +build/linux/. + +The most interesting build targets are: + + build Makes everything + clobber Removes all binaries for all builds as well. + install Runs the install script generated by the build. + +The following variables may be set on the command line to influence a build. + + BUILD The type of build being performed. + Alternatives are release, timing or debug. + +To build for, change to the appropriate target directory, e.g.: +$ cd eurasiacon/build/linux/ +$ make BUILD=debug +$ sudo make install diff --git a/drivers/gpu/rogue_m/Kconfig b/drivers/gpu/rogue_m/Kconfig new file mode 100644 index 000000000000..ca76515a35b2 --- /dev/null +++ b/drivers/gpu/rogue_m/Kconfig @@ -0,0 +1,6 @@ +config POWERVR_ROGUE_M + tristate "PowerVR Rogue M" + help + Driver for PowerVR Rogue M hardware. Say Y here if your SoC contains + a PowerVR Rogue GPU. For more information, see + . diff --git a/drivers/gpu/rogue_m/MIT-COPYING b/drivers/gpu/rogue_m/MIT-COPYING new file mode 100644 index 000000000000..0cbd14e06cbc --- /dev/null +++ b/drivers/gpu/rogue_m/MIT-COPYING @@ -0,0 +1,41 @@ + +This software is Copyright (C) Imagination Technologies Ltd. + +You may use, distribute and copy this software under the terms of the MIT +license displayed below. + +----------------------------------------------------------------------------- + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, this Software may be used under the terms of the GNU General +Public License Version 2 ("GPL") in which case the provisions of GPL are +applicable instead of those above. + +If you wish to allow use of your version of this Software only under the terms +of GPL, and not to allow others to use your version of this file under the +terms of the MIT license, indicate your decision by deleting from each file +the provisions above and replace them with the notice and other provisions +required by GPL as set out in the file called "GPL-COPYING" included in this +distribution. If you do not delete the provisions above, a recipient may use +your version of this file under the terms of either the MIT license or GPL. + +----------------------------------------------------------------------------- + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +----------------------------------------------------------------------------- diff --git a/drivers/gpu/rogue_m/Makefile b/drivers/gpu/rogue_m/Makefile new file mode 100644 index 000000000000..c990871ee4ce --- /dev/null +++ b/drivers/gpu/rogue_m/Makefile @@ -0,0 +1,250 @@ +include drivers/gpu/rogue_m/config_kernel.mk + +obj-$(CONFIG_POWERVR_ROGUE_M) += pvrsrvkm.o + +ccflags-y += -include $(srctree)/drivers/gpu/rogue_m/config_kernel.h \ + -Idrivers/gpu/rogue_m \ + -Idrivers/gpu/rogue_m/hwdefs \ + -Idrivers/gpu/rogue_m/hwdefs/km \ + -Idrivers/gpu/rogue_m/system/include \ + -Idrivers/gpu/rogue_m/system/common \ + -Idrivers/gpu/rogue_m/system/$(PVR_SYSTEM) \ + -Idrivers/gpu/rogue_m/services/server/include \ + -Idrivers/gpu/rogue_m/include \ + -Idrivers/gpu/rogue_m/services/include \ + -Idrivers/gpu/rogue_m/services/include/shared \ + -Idrivers/gpu/rogue_m/services/shared/include \ + -Idrivers/gpu/rogue_m/services/shared/devices/rgx \ + -Idrivers/gpu/rogue_m/services/server/env/linux \ + -Idrivers/gpu/rogue_m/kernel/drivers/staging/imgtec \ + -Idrivers/gpu/rogue_m/services/include/env/linux \ + -Idrivers/gpu/rogue_m/services/server/devices/rgx + +tmp := $(addprefix -I,$(wildcard $(srctree)/drivers/gpu/rogue_m/generated/*)) +ccflags-y += $(tmp) + +######## +pvrsrvkm-y += \ + services/server/env/linux/event.o \ + services/server/env/linux/mm.o \ + services/server/env/linux/mmap.o \ + services/server/env/linux/module.o \ + services/server/env/linux/module_common.o \ + services/server/env/linux/devicemem_mmap_stub.o \ + services/server/env/linux/osfunc.o \ + services/server/env/linux/allocmem.o \ + services/server/env/linux/osconnection_server.o \ + services/server/env/linux/pdump.o \ + services/server/env/linux/physmem_osmem_linux.o \ + services/server/env/linux/pvr_debugfs.o \ + services/server/env/linux/pvr_bridge_k.o \ + services/server/env/linux/pvr_debug.o \ + services/server/env/linux/physmem_tdmetacode_linux.o \ + services/server/env/linux/physmem_tdsecbuf_linux.o \ + services/server/common/devicemem_heapcfg.o \ + services/shared/common/devicemem.o \ + services/shared/common/devicemem_utils.o \ + services/shared/common/mem_utils.o \ + services/shared/common/hash.o \ + services/shared/common/ra.o \ + services/shared/common/sync.o \ + services/shared/common/dllist.o \ + services/server/common/devicemem_server.o \ + services/server/common/handle.o \ + services/server/common/lists.o \ + services/server/common/mmu_common.o \ + services/server/common/connection_server.o \ + services/server/common/physheap.o \ + services/server/common/physmem.o \ + services/server/common/physmem_lma.o \ + services/server/common/pmr.o \ + services/server/common/power.o \ + services/server/common/process_stats.o \ + services/server/common/pvrsrv.o \ + services/server/common/srvcore.o \ + services/server/common/sync_server.o \ + services/server/common/tlintern.o \ + services/shared/common/tlclient.o \ + services/server/common/tlserver.o \ + services/server/common/tlstream.o \ + services/shared/common/uniq_key_splay_tree.o \ + services/server/devices/rgx/rgxsync.o + +ifeq ($(SUPPORT_DISPLAY_CLASS),1) +pvrsrvkm-y += \ + services/server/common/dc_server.o \ + services/server/common/scp.o +endif + +ifeq ($(PVR_RI_DEBUG),1) +pvrsrvkm-y += services/server/common/ri_server.o +endif + +ifeq ($(PVR_HANDLE_BACKEND),generic) +pvrsrvkm-y += services/server/common/handle_generic.o +else +ifeq ($(PVR_HANDLE_BACKEND),idr) +pvrsrvkm-y += services/server/env/linux/handle_idr.o +endif +endif + +ifeq ($(SUPPORT_GPUTRACE_EVENTS),1) +pvrsrvkm-y += services/server/env/linux/pvr_gputrace.o +endif + + +pvrsrvkm-$(CONFIG_X86) += services/server/env/linux/osfunc_x86.o +pvrsrvkm-$(CONFIG_ARM) += services/server/env/linux/osfunc_arm.o +pvrsrvkm-$(CONFIG_ARM64) += services/server/env/linux/osfunc_arm64.o +pvrsrvkm-$(CONFIG_METAG) += osfunc_metag.o +pvrsrvkm-$(CONFIG_MIPS) += osfunc_mips.o +pvrsrvkm-$(CONFIG_EVENT_TRACING) += services/server/env/linux/trace_events.o + + +ifeq ($(PDUMP),1) +pvrsrvkm-y += \ + services/server/common/pdump_common.o \ + services/server/common/pdump_mmu.o \ + services/server/common/pdump_physmem.o \ + services/shared/common/devicemem_pdump.o +endif + +pvrsrvkm-y += \ + services/server/devices/rgx/rgxinit.o \ + services/server/devices/rgx/rgxdebug.o \ + services/server/devices/rgx/rgxhwperf.o \ + services/server/devices/rgx/rgxmem.o \ + services/server/devices/rgx/rgxta3d.o \ + services/server/devices/rgx/rgxcompute.o \ + services/server/devices/rgx/rgxccb.o \ + services/server/devices/rgx/rgxmmuinit.o \ + services/server/devices/rgx/rgxpower.o \ + services/server/devices/rgx/rgxtransfer.o \ + services/server/devices/rgx/rgxutils.o \ + services/server/devices/rgx/rgxfwutils.o \ + services/server/devices/rgx/rgxbreakpoint.o \ + services/server/devices/rgx/debugmisc_server.o \ + services/shared/devices/rgx/rgx_compat_bvnc.o \ + services/server/devices/rgx/rgxregconfig.o \ + services/server/devices/rgx/rgxtimerquery.o \ + services/server/devices/rgx/rgxtimecorr.o + +ifeq ($(SUPPORT_RAY_TRACING),1) +pvrsrvkm-y += rgxray.o +endif + +ifeq ($(PDUMP),1) +pvrsrvkm-y += services/server/devices/rgx/rgxpdump.o +endif + +ifeq ($(SUPPORT_NATIVE_FENCE_SYNC),1) +pvrsrvkm-y += \ + kernel/drivers/staging/imgtec/pvr_sync.o +endif + +pvrsrvkm-y += \ + generated/mm_bridge/server_mm_bridge.o \ + generated/dmm_bridge/client_mm_bridge.o \ + generated/pdumpmm_bridge/server_pdumpmm_bridge.o \ + generated/dpdumpmm_bridge/client_pdumpmm_bridge.o \ + generated/cmm_bridge/server_cmm_bridge.o \ + generated/pdump_bridge/server_pdump_bridge.o \ + generated/rgxtq_bridge/server_rgxtq_bridge.o \ + generated/rgxinit_bridge/server_rgxinit_bridge.o \ + generated/rgxta3d_bridge/server_rgxta3d_bridge.o \ + generated/rgxcmp_bridge/server_rgxcmp_bridge.o \ + generated/srvcore_bridge/server_srvcore_bridge.o \ + generated/sync_bridge/server_sync_bridge.o \ + generated/dsync_bridge/client_sync_bridge.o \ + generated/breakpoint_bridge/server_breakpoint_bridge.o \ + generated/debugmisc_bridge/server_debugmisc_bridge.o \ + generated/rgxpdump_bridge/server_rgxpdump_bridge.o \ + generated/pvrtl_bridge/server_pvrtl_bridge.o \ + generated/dpvrtl_bridge/client_pvrtl_bridge.o \ + generated/rgxhwperf_bridge/server_rgxhwperf_bridge.o \ + generated/regconfig_bridge/server_regconfig_bridge.o \ + generated/timerquery_bridge/server_timerquery_bridge.o \ + generated/pdumpctrl_bridge/server_pdumpctrl_bridge.o + +ifeq ($(PVR_RI_DEBUG),1) +pvrsrvkm-y += \ + generated/ri_bridge/server_ri_bridge.o \ + generated/dri_bridge/client_ri_bridge.o +endif + +ifeq ($(SUPPORT_DISPLAY_CLASS),1) +pvrsrvkm-y += \ + generated/dc_bridge/server_dc_bridge.o +endif + +ifeq ($(SUPPORT_RAY_TRACING),1) +pvrsrvkm-y += generated/rgxray_bridge/server_rgxray_bridge.o +endif + +ifeq ($(CACHEFLUSH_TYPE),CACHEFLUSH_GENERIC) +pvrsrvkm-y += \ + services/server/common/cache_generic.o \ + generated/cachegeneric_bridge/server_cachegeneric_bridge.o +endif + +ifeq ($(SUPPORT_SECURE_EXPORT),1) +pvrsrvkm-y += \ + services/server/env/linux/ossecure_export.o \ + generated/smm_bridge/server_smm_bridge.o \ + generated/syncsexport_bridge/server_syncsexport_bridge.o +endif +ifeq ($(SUPPORT_INSECURE_EXPORT),1) +pvrsrvkm-y += \ + generated/syncexport_bridge/server_syncexport_bridge.o +endif + +ifeq ($(SUPPORT_ION),1) +pvrsrvkm-y += generated/dmabuf_bridge/server_dmabuf_bridge.o +pvrsrvkm-y += services/server/env/linux/physmem_dmabuf.o +endif # SUPPORT_ION + +#ccflags-y += \ +# -mno-soft-float + +#dc_pdp-y += \ +# dc_pdp/dc_pdp.o \ +# dc_pdp/pdp_osfuncs.o \ +# dc_osfuncs.o + +pvrsrvkm-y += \ + system/$(PVR_SYSTEM)/sysconfig.o +# system/common/pci_support.o + +ifeq ($(PVR_SYSTEM),rgx_tc) +pvrsrvkm-y += system/$(PVR_SYSTEM)/apollo_flasher_linux.o +endif + +ifeq ($(PVR_SYSTEM),rk3368) +pvrsrvkm-y += system/$(PVR_SYSTEM)/rk_init.o +endif + +#ifneq ($(SUPPORT_DRM),1) +#pvrsrvkm-y += system/common/interrupt_support.o +#endif + +ifeq ($(SUPPORT_ION),1) +ifeq ($(LMA),1) +# For LMA, use the TC-specific ion heap. +pvrsrvkm-y += \ + system/$(PVR_SYSTEM)/ion_support.o \ + system/common/ion_lma_heap.o +else +# For UMA, use the generic ion support code, which creates heaps from system +# memory. +#pvrsrvkm-y += \ +# system/common/ion_support_generic.o +endif # LMA +endif # SUPPORT_ION + +dbgdrv-y += \ + tools/services/debug/dbgdriv/common/dbgdriv.o \ + tools/services/debug/dbgdriv/common/ioctl.o \ + tools/services/debug/dbgdriv/common/handle.o \ + tools/services/debug/dbgdriv/linux/main.o \ + tools/services/debug/dbgdriv/linux/hostfunc.o + diff --git a/drivers/gpu/rogue_m/README b/drivers/gpu/rogue_m/README new file mode 100644 index 000000000000..8579ae18896c --- /dev/null +++ b/drivers/gpu/rogue_m/README @@ -0,0 +1,32 @@ +Rogue Embedded Systems DDK for Linux kernel. +Copyright (C) Imagination Technologies Ltd. All rights reserved. +====================================================================== + + +About +------------------------------------------- + +This is the Imagination Technologies Rogue DDK for the Linux kernel. + + +License +------------------------------------------- + +You may use, distribute and copy this software under the terms of the MIT +license. Details of this license can be found in the file "MIT-COPYING". + +Alternatively, you may use, distribute and copy this software under the terms +of the GNU General Public License version 2. The full GNU General Public +License version 2 can be found in the file "GPL-COPYING". + + +Build and Install Instructions +------------------------------------------- + +For details see the "INSTALL" file and the platform guide. + +Contact information: +------------------------------------------- + +Imagination Technologies Ltd. +Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK diff --git a/drivers/gpu/rogue_m/build/linux/bits.mk b/drivers/gpu/rogue_m/build/linux/bits.mk new file mode 100644 index 000000000000..e993c636d2d3 --- /dev/null +++ b/drivers/gpu/rogue_m/build/linux/bits.mk @@ -0,0 +1,125 @@ +########################################################################### ### +#@Title Useful special targets which don't build anything +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +ifneq ($(filter dumpvar-%,$(MAKECMDGOALS)),) +dumpvar-%: ; +$(foreach _var_to_dump,$(patsubst dumpvar-%,%,$(filter dumpvar-%,$(MAKECMDGOALS))),$(info $(if $(filter undefined,$(origin $(_var_to_dump))),# $$($(_var_to_dump)) is not set,$(_var_to_dump) := $($(_var_to_dump))))) +endif + +ifneq ($(filter whereis-%,$(MAKECMDGOALS)),) +whereis-%: ; +$(foreach _module_to_find,$(patsubst whereis-%,%,$(filter whereis-%,$(MAKECMDGOALS))),$(info $(if $(INTERNAL_MAKEFILE_FOR_MODULE_$(_module_to_find)),$(INTERNAL_MAKEFILE_FOR_MODULE_$(_module_to_find)),# No module $(_module_to_find)))) +endif + +ifneq ($(filter whatis-%,$(MAKECMDGOALS)),) +whatis-$(HOST_OUT)/%: ; +whatis-$(TARGET_PRIMARY_OUT)/%: ; +whatis-$(TARGET_NEUTRAL_OUT)/%: ; +$(foreach _file_to_find,$(patsubst whatis-%,%,$(filter whatis-%,$(MAKECMDGOALS))),$(info $(strip $(foreach _m,$(ALL_MODULES),$(if $(filter $(_file_to_find),$(INTERNAL_TARGETS_FOR_$(_m))),$(_file_to_find) is in $(_m) which is defined in $(INTERNAL_MAKEFILE_FOR_MODULE_$(_m)),))))) +endif + +.PHONY: ls-modules +ls-modules: + @: $(foreach _m,$(ALL_MODULES),$(info $($(_m)_type) $(_m) $(patsubst $(TOP)/%,%,$(INTERNAL_MAKEFILE_FOR_MODULE_$(_m))))) + +.PHONY: ls-types +ls-types: + @: $(info $(sort $(patsubst host_%,%,$(foreach _m,$(ALL_MODULES),$($(_m)_type))))) + +ifeq ($(strip $(MAKECMDGOALS)),visualise) +FORMAT ?= xlib +GRAPHVIZ ?= neato +visualise: $(OUT)/MAKE_RULES.dot + $(GRAPHVIZ) -T$(FORMAT) -o $(OUT)/MAKE_RULES.$(FORMAT) $< +$(OUT)/MAKE_RULES.dot: $(OUT)/MAKE_RULES + perl $(MAKE_TOP)/tools/depgraph.pl -t $(TOP) -g $(firstword $(GRAPHVIZ)) $(OUT)/MAKE_RULES >$(OUT)/MAKE_RULES.dot +$(OUT)/MAKE_RULES: $(ALL_MAKEFILES) + -$(MAKE) -C $(TOP) -f $(MAKE_TOP)/toplevel.mk TOP=$(TOP) OUT=$(OUT) ls-modules -qp >$(OUT)/MAKE_RULES 2>&1 +else +visualise: + @: $(error visualise specified along with other goals. This is not supported) +endif + +.PHONY: help confighelp +help: + @echo 'Build targets' + @echo ' make, make build Build all components of the build' + @echo ' make components Build only the user-mode components' + @echo ' make kbuild Build only the kernel-mode components' + @echo " make docs Build the build's supporting documentation" + @echo ' make MODULE Build the module MODULE and all of its dependencies' + @echo ' make binary_.../target/libsomething.so' + @echo ' Build a particular file (including intermediates)' + @echo 'Variables' + @echo ' make V=1 ... Print the commands that are executed' + @echo ' make W=1 ... Enable extra compiler warnings' + @echo ' make D=opt ... Set build system debug option (D=help for a list)' + @echo ' make OUT=dir ... Place output+intermediates in specified directory' + @echo ' make CHECK=cmd ... Check source with static analyser or other tool' + @echo ' EXCLUDED_APIS=... List of APIs to remove from the build' + @echo ' make SOMEOPTION=1 ... Set configuration options (see "make confighelp")' + @echo ' Defaults are set by $(PVR_BUILD_DIR)/Makefile' + @echo 'Clean targets' + @echo ' make clean Remove output files for the current build' + @echo ' make clobber As "make clean", but remove build config too' + @echo ' make clean-MODULE Clean (or clobber) only files for MODULE' + @echo '' + @echo 'Special targets' + @echo ' make whereis-MODULE Show the path to the Linux.mk defining MODULE' + @echo ' make whatis-FILE Show which module builds an output FILE' + @echo ' make ls-modules List all modules defined by makefiles' + +# This rule runs in the configuration stage, in config/help.mk. Make a dummy +# target here to suppress "no rule to make target 'confighelp' messages. +confighelp: ; + +ifneq ($(filter help,$(D)),) +empty := +space := $(empty) $(empty) +$(info Debug options) +$(info $(space)D=modules dump module info) +$(info $(space)D=config dump all config options + type and origin) +$(info $(space)D=freeze-config prevent config changes) +$(info $(space)D=config-changes dump diffs when config changes) +$(info $(space)D=nobuild stop before running the main build) +$(info Options can be combined: make D=freeze-config,config-changes) +$(error D=help given) +endif diff --git a/drivers/gpu/rogue_m/build/linux/buildvars.mk b/drivers/gpu/rogue_m/build/linux/buildvars.mk new file mode 100644 index 000000000000..54cd79f42c2b --- /dev/null +++ b/drivers/gpu/rogue_m/build/linux/buildvars.mk @@ -0,0 +1,281 @@ +########################################################################### ### +#@Title Define global variables +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@Description This file is read once at the start of the build, after reading +# in config.mk. It should define the non-MODULE_* variables used +# in commands, like ALL_CFLAGS +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +# NOTE: You must *not* use the cc-option et al macros in COMMON_FLAGS, +# COMMON_CFLAGS or COMMON_USER_FLAGS. These flags are shared between +# host and target, which might use compilers with different capabilities. + +# ANOTHER NOTE: All flags here must be architecture-independent (i.e. no +# -march or toolchain include paths) + +# These flags are used for kernel, User C and User C++ +# +COMMON_FLAGS := -W -Wall + +# Some GCC warnings are C only, so we must mask them from C++ +# +COMMON_CFLAGS := $(COMMON_FLAGS) \ + -Wdeclaration-after-statement -Wno-format-zero-length \ + -Wmissing-prototypes -Wstrict-prototypes + +# User C and User C++ optimization control. Does not affect kernel. +# +ifeq ($(BUILD),debug) +COMMON_USER_FLAGS := -O0 +else +OPTIM ?= -O2 +ifeq ($(USE_LTO),1) +COMMON_USER_FLAGS := $(OPTIM) -flto +else +COMMON_USER_FLAGS := $(OPTIM) +endif +endif + +# GCOV support for user-mode coverage statistics +# +ifeq ($(GCOV_BUILD),on) +COMMON_USER_FLAGS += -fprofile-arcs -ftest-coverage +endif + +# Driver has not yet been audited for aliasing issues +# +COMMON_USER_FLAGS += -fno-strict-aliasing + +# We always enable debugging. Either the release binaries are stripped +# and the symbols put in the symbolpackage, or we're building debug. +# +COMMON_USER_FLAGS += -g + +# User C and User C++ warning flags +# +COMMON_USER_FLAGS += \ + -Wpointer-arith -Wunused-parameter \ + -Wmissing-format-attribute + +# Additional warnings, and optional warnings. +# +TESTED_TARGET_USER_FLAGS := \ + $(call cc-option,-Wno-missing-field-initializers) \ + $(call cc-option,-fdiagnostics-show-option) \ + $(call cc-option,-Wno-self-assign) \ + $(call cc-option,-Wno-parentheses-equality) +TESTED_HOST_USER_FLAGS := \ + $(call host-cc-option,-Wno-missing-field-initializers) \ + $(call host-cc-option,-fdiagnostics-show-option) \ + $(call host-cc-option,-Wno-self-assign) \ + $(call host-cc-option,-Wno-parentheses-equality) + +# These flags are clang-specific. +# -Wno-unused-command-line-argument works around a buggy interaction +# with ccache, see https://bugzilla.samba.org/show_bug.cgi?id=8118 +# -fcolor-diagnostics force-enables colored error messages which +# get disabled when ccache is piped through ccache. +# +TESTED_TARGET_USER_FLAGS += \ + $(call cc-option,-Qunused-arguments) \ + $(call cc-option,-fcolor-diagnostics) +TESTED_HOST_USER_FLAGS += \ + $(call host-cc-option,-Qunused-arguments) \ + $(call host-cc-option,-fcolor-diagnostics) + +ifeq ($(W),1) +TESTED_TARGET_USER_FLAGS += \ + $(call cc-option,-Wbad-function-cast) \ + $(call cc-option,-Wcast-qual) \ + $(call cc-option,-Wcast-align) \ + $(call cc-option,-Wconversion) \ + $(call cc-option,-Wdisabled-optimization) \ + $(call cc-option,-Wlogical-op) \ + $(call cc-option,-Wmissing-declarations) \ + $(call cc-option,-Wmissing-include-dirs) \ + $(call cc-option,-Wnested-externs) \ + $(call cc-option,-Wold-style-definition) \ + $(call cc-option,-Woverlength-strings) \ + $(call cc-option,-Wpacked) \ + $(call cc-option,-Wpacked-bitfield-compat) \ + $(call cc-option,-Wpadded) \ + $(call cc-option,-Wredundant-decls) \ + $(call cc-option,-Wshadow) \ + $(call cc-option,-Wswitch-default) \ + $(call cc-option,-Wvla) \ + $(call cc-option,-Wwrite-strings) +TESTED_HOST_USER_FLAGS += \ + $(call host-cc-option,-Wbad-function-cast) \ + $(call host-cc-option,-Wcast-qual) \ + $(call host-cc-option,-Wcast-align) \ + $(call host-cc-option,-Wconversion) \ + $(call host-cc-option,-Wdisabled-optimization) \ + $(call host-cc-option,-Wlogical-op) \ + $(call host-cc-option,-Wmissing-declarations) \ + $(call host-cc-option,-Wmissing-include-dirs) \ + $(call host-cc-option,-Wnested-externs) \ + $(call host-cc-option,-Wold-style-definition) \ + $(call host-cc-option,-Woverlength-strings) \ + $(call host-cc-option,-Wpacked) \ + $(call host-cc-option,-Wpacked-bitfield-compat) \ + $(call host-cc-option,-Wpadded) \ + $(call host-cc-option,-Wredundant-decls) \ + $(call host-cc-option,-Wshadow) \ + $(call host-cc-option,-Wswitch-default) \ + $(call host-cc-option,-Wvla) \ + $(call host-cc-option,-Wwrite-strings) +endif + +TESTED_TARGET_USER_FLAGS += \ + $(call cc-optional-warning,-Wunused-but-set-variable) \ + $(call cc-optional-warning,-Wtypedef-redefinition) +TESTED_HOST_USER_FLAGS += \ + $(call host-cc-optional-warning,-Wunused-but-set-variable) \ + $(call host-cc-optional-warning,-Wtypedef-redefinition) + +KBUILD_FLAGS := \ + -Wno-unused-parameter -Wno-sign-compare + +TESTED_KBUILD_FLAGS := \ + $(call kernel-cc-option,-Wmissing-include-dirs) \ + $(call kernel-cc-option,-Wno-type-limits) \ + $(call kernel-cc-option,-Wno-pointer-arith) \ + $(call kernel-cc-option,-Wno-aggregate-return) \ + $(call kernel-cc-option,-Wno-unused-but-set-variable) \ + $(call kernel-cc-optional-warning,-Wbad-function-cast) \ + $(call kernel-cc-optional-warning,-Wcast-qual) \ + $(call kernel-cc-optional-warning,-Wcast-align) \ + $(call kernel-cc-optional-warning,-Wconversion) \ + $(call kernel-cc-optional-warning,-Wdisabled-optimization) \ + $(call kernel-cc-optional-warning,-Wlogical-op) \ + $(call kernel-cc-optional-warning,-Wmissing-declarations) \ + $(call kernel-cc-optional-warning,-Wmissing-include-dirs) \ + $(call kernel-cc-optional-warning,-Wnested-externs) \ + $(call kernel-cc-optional-warning,-Wno-missing-field-initializers) \ + $(call kernel-cc-optional-warning,-Wold-style-definition) \ + $(call kernel-cc-optional-warning,-Woverlength-strings) \ + $(call kernel-cc-optional-warning,-Wpacked) \ + $(call kernel-cc-optional-warning,-Wpacked-bitfield-compat) \ + $(call kernel-cc-optional-warning,-Wpadded) \ + $(call kernel-cc-optional-warning,-Wredundant-decls) \ + $(call kernel-cc-optional-warning,-Wshadow) \ + $(call kernel-cc-optional-warning,-Wswitch-default) \ + $(call kernel-cc-optional-warning,-Wvla) \ + $(call kernel-cc-optional-warning,-Wwrite-strings) + +# User C only +# +ALL_CFLAGS := \ + $(COMMON_USER_FLAGS) $(COMMON_CFLAGS) $(TESTED_TARGET_USER_FLAGS) \ + $(SYS_CFLAGS) +ALL_HOST_CFLAGS := \ + $(COMMON_USER_FLAGS) $(COMMON_CFLAGS) $(TESTED_HOST_USER_FLAGS) + +# User C++ only +# +ALL_CXXFLAGS := \ + -fno-rtti -fno-exceptions \ + $(COMMON_USER_FLAGS) $(COMMON_FLAGS) $(TESTED_TARGET_USER_FLAGS) \ + $(SYS_CXXFLAGS) +ALL_HOST_CXXFLAGS := \ + -fno-rtti -fno-exceptions \ + $(COMMON_USER_FLAGS) $(COMMON_FLAGS) $(TESTED_HOST_USER_FLAGS) + +# Workaround for some target clangs that don't support -O0 w/ PIC. +# +ifeq ($(cc-is-clang),true) +ALL_CFLAGS := $(patsubst -O0,-O1,$(ALL_CFLAGS)) +ALL_CXXFLAGS := $(patsubst -O0,-O1,$(ALL_CXXFLAGS)) +endif + +# Add GCOV_DIR just for target +# +ifeq ($(GCOV_BUILD),on) +ifneq ($(GCOV_DIR),) +ALL_CFLAGS += -fprofile-dir=$(GCOV_DIR) +ALL_CXXFLAGS += -fprofile-dir=$(GCOV_DIR) +endif +endif + +# Kernel C only +# +ALL_KBUILD_CFLAGS := $(COMMON_CFLAGS) $(KBUILD_FLAGS) $(TESTED_KBUILD_FLAGS) + +# User C and C++ +# +# NOTE: ALL_HOST_LDFLAGS should probably be using -rpath-link too, and if we +# ever need to support building host shared libraries, it's required. +# +# We can't use it right now because we want to support non-GNU-compatible +# linkers like the Darwin 'ld' which doesn't support -rpath-link. +# +# For the same reason (Darwin 'ld') don't bother checking for text +# relocations in host binaries. +# +ALL_HOST_LDFLAGS := +ALL_LDFLAGS := -Wl,--warn-shared-textrel + +ifeq ($(GCOV_BUILD),on) +ALL_LDFLAGS += -fprofile-arcs +ALL_HOST_LDFLAGS += -fprofile-arcs +endif + +ALL_LDFLAGS += $(SYS_LDFLAGS) + +# This variable contains a list of all modules built by kbuild +ALL_KBUILD_MODULES := + +# This variable contains a list of all modules which contain C++ source files +ALL_CXX_MODULES := + +# Toolchain triple for cross environment +CROSS_TRIPLE := $(patsubst %-,%,$(CROSS_COMPILE)) + +ifneq ($(TOOLCHAIN),) +$(warning **********************************************) +$(warning The TOOLCHAIN option has been removed, but) +$(warning you have it set (via $(origin TOOLCHAIN))) +$(warning **********************************************) +endif + +# We need the glibc version to generate the cache names for LLVM and XOrg components. +ifeq ($(CROSS_COMPILE),) +LIBC_VERSION_PROBE := $(shell ldd $(shell which true) | awk '/libc.so/{print $$3'} ) +LIBC_VERSION := $(shell $(LIBC_VERSION_PROBE)| tr -d '(),' | head -1) +endif diff --git a/drivers/gpu/rogue_m/build/linux/commands.mk b/drivers/gpu/rogue_m/build/linux/commands.mk new file mode 100644 index 000000000000..3ab5fcb2fe54 --- /dev/null +++ b/drivers/gpu/rogue_m/build/linux/commands.mk @@ -0,0 +1,357 @@ +########################################################################### ### +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +# from-one-* recipes make a thing from one source file, so they use $<. Others +# use $(MODULE_something) instead of $^ + +# We expect that MODULE_*FLAGS contains all the flags we need, including the +# flags for all modules (like $(ALL_CFLAGS) and $(ALL_HOST_CFLAGS)), and +# excluding flags for include search dirs or for linking libraries. The +# exceptions are ALL_EXE_LDFLAGS and ALL_LIB_LDFLAGS, since they depend on the +# type of thing being linked, so they appear in the commands below + +define host-o-from-one-c +$(if $(V),,@echo " HOST_CC " $(call relative-to-top,$<)) +$(MODULE_CC) -MD -MF $(patsubst %.o,%.d,$@) -c $(MODULE_CFLAGS) \ + $(MODULE_INCLUDE_FLAGS) -include $(CONFIG_H) $< -o $@ +endef + +define target-o-from-one-c +$(if $(V),,@echo " CC " $(call relative-to-top,$<)) +$(MODULE_CC) -MD -MF $(patsubst %.o,%.d,$@) -c $(MODULE_CFLAGS) \ + $(MODULE_INCLUDE_FLAGS) -include $(CONFIG_H) $< -o $@ +endef + +define host-o-from-one-cxx +$(if $(V),,@echo " HOST_CXX" $(call relative-to-top,$<)) +$(MODULE_CXX) -MD -MF $(patsubst %.o,%.d,$@) -c $(MODULE_CXXFLAGS) \ + $(MODULE_INCLUDE_FLAGS) -include $(CONFIG_H) $< -o $@ +endef + +define target-o-from-one-cxx +$(if $(V),,@echo " CXX " $(call relative-to-top,$<)) +$(MODULE_CXX) -MD -MF $(patsubst %.o,%.d,$@) -c $(MODULE_CXXFLAGS) \ + $(MODULE_INCLUDE_FLAGS) -include $(CONFIG_H) $< -o $@ +endef + +define host-executable-from-o +$(if $(V),,@echo " HOST_LD " $(call relative-to-top,$@)) +$(MODULE_CC) $(MODULE_LDFLAGS) \ + -o $@ $(sort $(MODULE_ALL_OBJECTS)) $(MODULE_LIBRARY_DIR_FLAGS) \ + $(MODULE_LIBRARY_FLAGS) +endef + +define host-executable-cxx-from-o +$(if $(V),,@echo " HOST_LD " $(call relative-to-top,$@)) +$(MODULE_CXX) $(MODULE_LDFLAGS) \ + -o $@ $(sort $(MODULE_ALL_OBJECTS)) $(MODULE_LIBRARY_DIR_FLAGS) \ + $(MODULE_LIBRARY_FLAGS) +endef + +define target-executable-from-o +$(if $(V),,@echo " LD " $(call relative-to-top,$@)) +$(MODULE_CC) \ + $(MODULE_EXE_LDFLAGS) $(MODULE_LDFLAGS) -o $@ \ + $(MODULE_EXE_CRTBEGIN) $(MODULE_ALL_OBJECTS) $(MODULE_EXE_CRTEND) \ + $(MODULE_LIBRARY_DIR_FLAGS) $(MODULE_LIBRARY_FLAGS) $(MODULE_LIBGCC) +endef + +define target-executable-cxx-from-o +$(if $(V),,@echo " LD " $(call relative-to-top,$@)) +$(MODULE_CXX) \ + $(MODULE_EXE_LDFLAGS) $(MODULE_LDFLAGS) -o $@ \ + $(MODULE_EXE_CRTBEGIN) $(MODULE_ALL_OBJECTS) $(MODULE_EXE_CRTEND) \ + $(MODULE_LIBRARY_DIR_FLAGS) $(MODULE_LIBRARY_FLAGS) $(MODULE_LIBGCC) +endef + +define target-shared-library-from-o +$(if $(V),,@echo " LD " $(call relative-to-top,$@)) +$(MODULE_CC) -shared -Wl,-Bsymbolic \ + $(MODULE_LIB_LDFLAGS) $(MODULE_LDFLAGS) -o $@ \ + $(MODULE_LIB_CRTBEGIN) $(MODULE_ALL_OBJECTS) $(MODULE_LIB_CRTEND) \ + $(MODULE_LIBRARY_DIR_FLAGS) $(MODULE_LIBRARY_FLAGS) $(MODULE_LIBGCC) +endef + +define host-shared-library-from-o +$(if $(V),,@echo " HOST_LD " $(call relative-to-top,$@)) +$(MODULE_CC) -shared -Wl,-Bsymbolic \ + $(MODULE_LDFLAGS) -o $@ \ + $(sort $(MODULE_ALL_OBJECTS)) \ + $(MODULE_LIBRARY_DIR_FLAGS) $(MODULE_LIBRARY_FLAGS) +endef + +# If there were any C++ source files in a shared library, we use one of +# these recipes, which run the C++ compiler to link the final library +define target-shared-library-cxx-from-o +$(if $(V),,@echo " LD " $(call relative-to-top,$@)) +$(MODULE_CXX) -shared -Wl,-Bsymbolic \ + $(MODULE_LIB_LDFLAGS) $(MODULE_LDFLAGS) -o $@ \ + $(MODULE_LIB_CRTBEGIN) $(MODULE_ALL_OBJECTS) $(MODULE_LIB_CRTEND) \ + $(MODULE_LIBRARY_DIR_FLAGS) $(MODULE_LIBRARY_FLAGS) $(MODULE_LIBGCC) +endef + +define host-shared-library-cxx-from-o +$(if $(V),,@echo " HOST_LD " $(call relative-to-top,$@)) +$(MODULE_CXX) -shared -Wl,-Bsymbolic \ + $(MODULE_LDFLAGS) -o $@ \ + $(sort $(MODULE_ALL_OBJECTS)) \ + $(MODULE_LIBRARY_DIR_FLAGS) $(MODULE_LIBRARY_FLAGS) +endef + +define host-copy-debug-information +$(HOST_OBJCOPY) --only-keep-debug $@ $(basename $@).dbg +endef + +define host-strip-debug-information +$(HOST_STRIP) --strip-unneeded $@ +endef + +define host-add-debuglink +$(if $(V),,@echo " DBGLINK " $(call relative-to-top,$(basename $@).dbg)) +$(HOST_OBJCOPY) --add-gnu-debuglink=$(basename $@).dbg $@ +endef + +define target-copy-debug-information +$(OBJCOPY) --only-keep-debug $@ $(basename $@).dbg +endef + +define target-strip-debug-information +$(STRIP) --strip-unneeded $@ +endef + +define target-add-debuglink +$(if $(V),,@echo " DBGLINK " $(call relative-to-top,$(basename $@).dbg)) +$(OBJCOPY) --add-gnu-debuglink=$(basename $@).dbg $@ +endef + +define host-static-library-from-o +$(if $(V),,@echo " HOST_AR " $(call relative-to-top,$@)) +$(HOST_AR) cru $@ $(sort $(MODULE_ALL_OBJECTS)) +endef + +define target-static-library-from-o +$(if $(V),,@echo " AR " $(call relative-to-top,$@)) +$(AR) cru $@ $(sort $(MODULE_ALL_OBJECTS)) +endef + +define tab-c-from-y +$(if $(V),,@echo " BISON " $(call relative-to-top,$<)) +$(BISON) $(MODULE_BISON_FLAGS) -o $@ -d $< +endef + +define l-c-from-l +$(if $(V),,@echo " FLEX " $(call relative-to-top,$<)) +$(FLEX) $(MODULE_FLEX_FLAGS) -o$@ $< +endef + +define l-cc-from-l +$(if $(V),,@echo " FLEXXX " $(call relative-to-top,$<)) +$(FLEXXX) $(MODULE_FLEXXX_FLAGS) -o$@ $< +endef + +define clean-dirs +$(if $(V),,@echo " RM " $(call relative-to-top,$(MODULE_DIRS_TO_REMOVE))) +$(RM) -rf $(MODULE_DIRS_TO_REMOVE) +endef + +define make-directory +$(MKDIR) -p $@ +endef + +ifeq ($(DISABLE_CHECK_EXPORTS),) +define check-exports +endef +else +define check-exports +endef +endif + +# Check a source file with the program specified in $(CHECK). +# If $(CHECK) is empty, don't do anything. +ifeq ($(CHECK),) +check-src := +else +define check-src-1 +$(if $(V),,@echo " CHECK " $(call relative-to-top,$<)) +$(if $(IGNORE_CHECK_ERRORS),-,)$(CHECK) $(MODULE_INCLUDE_FLAGS) \ + $(if $(CHECK_NO_CONFIG_H),,-include $(CONFIG_H)) \ + $(filter -D%,$(MODULE_CFLAGS)) \ + $(CHECKFLAGS) $< +endef +# If CHECK_ONLY is set, only check files matching a Make pattern. +# e.g. CHECK_ONLY=opengles1/%.c +define check-src +$(if $(and $(if $(CHECK_ONLY),$(filter $(CHECK_ONLY),$<),true), \ + $(if $(CHECK_EXCLUDE),$(filter-out $(CHECK_EXCLUDE),$<),true)),$(check-src-1),@:) +endef +endif + +# Programs used in recipes + +BISON ?= bison +CC ?= gcc +CC_SECONDARY ?= $(CC) +CROSS_COMPILE_SECONDARY ?= $(CROSS_COMPILE) +CXX ?= g++ +CXX_SECONDARY ?= $(CXX) +HOST_CC ?= gcc +HOST_CXX ?= g++ +JAR ?= jar +JAVA ?= java +JAVAC ?= javac +PYTHON ?= python +ZIP ?= zip + +ifeq ($(USE_CCACHE),1) +CCACHE ?= ccache +endif +ifeq ($(USE_DISTCC),1) +DISTCC ?= distcc +endif + +# Define CHMOD and CC_CHECK first so we can use cc-is-clang +# +override CHMOD := $(if $(V),,@)chmod +override CC_CHECK := $(if $(V),,@)$(MAKE_TOP)/tools/cc-check.sh + +# If clang is detected, the compiler name is invariant but CROSS_COMPILE +# is reflected in the use of -target. For GCC this is always encoded into +# the binary. If CROSS_COMPILE is not set we can skip this. +# +# If we're doing a build with multiple target architectures, we might need +# two separate compilers to build binaries for each architecture. In this +# case, CROSS_COMPILE and CROSS_COMPILE_SECONDARY are the cross compiler +# prefix for the two compilers - $(CC) and $(CC_SECONDARY). +# +# Set the secondary compiler first before we overwrite $(CC). +# + +ifneq ($(CROSS_COMPILE_SECONDARY),) + ifeq ($(cc-is-clang),true) + override CC_SECONDARY := \ + $(CC_SECONDARY) \ + -target $(patsubst %-,%,$(CROSS_COMPILE_SECONDARY)) \ + -B$(dir $(shell which $(CROSS_COMPILE_SECONDARY)gcc)) + override CXX_SECONDARY := \ + $(CXX_SECONDARY) \ + -target $(patsubst %-,%,$(CROSS_COMPILE_SECONDARY)) \ + -B$(dir $(shell which $(CROSS_COMPILE_SECONDARY)gcc)) + else + ifeq ($(origin CC_SECONDARY),file) + override CC_SECONDARY := $(CROSS_COMPILE_SECONDARY)$(CC_SECONDARY) + endif + ifeq ($(origin CXX_SECONDARY),file) + override CXX_SECONDARY := $(CROSS_COMPILE_SECONDARY)$(CXX_SECONDARY) + endif + endif +endif + +# Apply compiler wrappers and V=1 handling +override CC_SECONDARY := $(if $(V),,@)$(CCACHE)$(DISTCC) $(CC_SECONDARY) +override CXX_SECONDARY := $(if $(V),,@)$(CCACHE)$(DISTCC) $(CXX_SECONDARY) + +ifneq ($(CROSS_COMPILE),) + ifeq ($(cc-is-clang),true) + override CC := \ + $(CC) \ + -target $(patsubst %-,%,$(CROSS_COMPILE)) \ + -B$(dir $(shell which $(CROSS_COMPILE)gcc)) + override CXX := \ + $(CXX) \ + -target $(patsubst %-,%,$(CROSS_COMPILE)) \ + -B$(dir $(shell which $(CROSS_COMPILE)gcc)) + else + ifeq ($(origin CC),file) + override CC := $(CROSS_COMPILE)$(CC) + endif + ifeq ($(origin CXX),file) + override CXX := $(CROSS_COMPILE)$(CXX) + endif + endif +else + $(if $(CROSS_COMPILE_SECONDARY),$(error CROSS_COMPILE_SECONDARY is set but CROSS_COMPILE is empty)) +endif + +# Apply compiler wrappers and V=1 handling +override CC := $(if $(V),,@)$(CCACHE)$(DISTCC) $(CC) +override CXX := $(if $(V),,@)$(CCACHE)$(DISTCC) $(CXX) + +override AR := $(if $(V),,@)$(CROSS_COMPILE)ar +override BISON := $(if $(V),,@)$(BISON) +override BZIP2 := $(if $(V),,@)bzip2 -9 +override CAT := $(if $(V),,@)cat +override CHECK := $(if $(CHECK),$(if $(V),,@)$(CHECK),) +override CP := $(if $(V),,@)cp +override ECHO := $(if $(V),,@)echo +override FLEX := $(if $(V),,@)flex +override FLEXXX := $(if $(V),,@)flex++ +override GREP := $(if $(V),,@)grep +override HOST_AR := $(if $(V),,@)ar +override HOST_CC := $(if $(V),,@)$(CCACHE) $(HOST_CC) +override HOST_CXX := $(if $(V),,@)$(CCACHE) $(HOST_CXX) +override HOST_OBJCOPY := $(if $(V),,@)objcopy +override HOST_STRIP := $(if $(V),,@)strip +override INSTALL := $(if $(V),,@)install +override JAR := $(if $(V),,@)$(JAR) +override JAVA := $(if $(V),,@)$(JAVA) +override JAVAC := $(if $(V),,@)$(JAVAC) +override LN := $(if $(V),,@)ln -f -s +override M4 := $(if $(V),,@)m4 +override MKDIR := $(if $(V),,@)mkdir +override MV := $(if $(V),,@)mv +override OBJCOPY := $(if $(V),,@)$(CROSS_COMPILE)objcopy +override PERL := $(if $(V),,@)perl +override PSC := $(if $(V),,@)$(HOST_OUT)/psc_standalone +override PYTHON := $(if $(V),,@)$(PYTHON) +override RANLIB := $(if $(V),,@)$(CROSS_COMPILE)ranlib +override RM := $(if $(V),,@)rm -f +override ROGUEASM := $(if $(V),,@)$(HOST_OUT)/rogueasm +override SED := $(if $(V),,@)sed +override STRIP := $(if $(V),,@)$(CROSS_COMPILE)strip +override TAR := $(if $(V),,@)tar +override TOUCH := $(if $(V),,@)touch +override TEST := $(if $(V),,@)test +override VHD2INC := $(if $(V),,@)$(HOST_OUT)/vhd2inc +override XXD := $(if $(V),,@)xxd +override ZIP := $(if $(V),,@)$(ZIP) + +ifeq ($(SUPPORT_NEUTRINO_PLATFORM),1) +include $(MAKE_TOP)/common/neutrino/commands_neutrino.mk +endif diff --git a/drivers/gpu/rogue_m/build/linux/common/3rdparty.mk b/drivers/gpu/rogue_m/build/linux/common/3rdparty.mk new file mode 100644 index 000000000000..fb58e1e57b30 --- /dev/null +++ b/drivers/gpu/rogue_m/build/linux/common/3rdparty.mk @@ -0,0 +1,103 @@ +########################################################################### ### +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +########################################################################### ### +# Display class drivers +########################################################################### ### + +ifeq ($(DISPLAY_CONTROLLER),dc_example) +$(eval $(call TunableKernelConfigC,DC_EXAMPLE_WIDTH,)) +$(eval $(call TunableKernelConfigC,DC_EXAMPLE_HEIGHT,)) +$(eval $(call TunableKernelConfigC,DC_EXAMPLE_DPI,)) +$(eval $(call TunableKernelConfigC,DC_EXAMPLE_BIT_DEPTH,)) +$(eval $(call TunableKernelConfigC,DC_EXAMPLE_FBC_MODE,)) +$(eval $(call TunableKernelConfigC,DC_EXAMPLE_MEMORY_LAYOUT,)) +endif + +ifeq ($(DISPLAY_CONTROLLER),dc_fbdev) +$(eval $(call TunableKernelConfigC,DC_FBDEV_REFRESH,)) + +$(eval $(call TunableKernelConfigC,DC_FBDEV_FORCE_XRGB8888,,\ +Force the dc_fbdev display driver to use XRGB8888. This is necessary_\ +when the underlying Linux framebuffer driver does not ignore alpha_\ +meaning an alpha value of 0 results in nothing being displayed._\ +)) + +$(eval $(call TunableKernelConfigC,DC_FBDEV_NUM_PREFERRED_BUFFERS,,\ +The maximum number of display buffers the dc_fbdev display driver_\ +supports. The underlying Linux framebuffer driver must be capable_\ +of allocating sufficient memory for the number of buffers chosen._\ +)) +endif + +ifeq ($(DISPLAY_CONTROLLER),dc_pdp) +$(eval $(call TunableKernelConfigC,DCPDP_WIDTH,)) +$(eval $(call TunableKernelConfigC,DCPDP_HEIGHT,)) +$(eval $(call TunableKernelConfigC,DCPDP_DPI,)) +$(eval $(call TunableKernelConfigC,DCPDP_DYNAMIC_GTF_TIMING,1)) +$(eval $(call TunableKernelConfigC,DCPDP_NO_INTERRUPTS,)) +endif + +ifeq ($(DISPLAY_CONTROLLER),adf_pdp) +$(eval $(call TunableKernelConfigC,ADF_PDP_WIDTH,)) +$(eval $(call TunableKernelConfigC,ADF_PDP_HEIGHT,)) +endif + +########################################################################### ### +# DRM display drivers +########################################################################### ### + +ifeq ($(DISPLAY_CONTROLLER),drm_fbdev) +$(eval $(call TunableKernelConfigC,DRM_FBDEV_FORCE_XRGB8888,,\ +Force the drm_fbdev display driver to use XRGB8888. This is necessary_\ +when the underlying Linux framebuffer driver does not ignore alpha_\ +meaning an alpha value of 0 results in nothing being displayed._\ +)) + +$(eval $(call TunableKernelConfigC,DRM_FBDEV_NUM_PREFERRED_BUFFERS,,\ +The maximum number of display buffers the drm_fbdev display driver_\ +supports. The underlying Linux framebuffer driver must be capable_\ +of allocating sufficient memory for the number of buffers chosen._\ +)) + +$(eval $(call TunableKernelConfigC,DRM_FBDEV_SET_BPP,,\ +Set the number of bits per pixel to a particular value.\ +)) +endif diff --git a/drivers/gpu/rogue_m/build/linux/common/android/arch.mk b/drivers/gpu/rogue_m/build/linux/common/android/arch.mk new file mode 100644 index 000000000000..fd3446972afd --- /dev/null +++ b/drivers/gpu/rogue_m/build/linux/common/android/arch.mk @@ -0,0 +1,101 @@ +########################################################################### ### +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +include ../common/android/platform_version.mk + +# Now we have included the platform_version.mk file, we know we have a +# correctly configured OUT_DIR and can probe it to figure out our +# architecture. For backwards compatibility with KitKat, use the deprecated +# ro.product.cpu.abi (primary architecture) property instead of abilist64. + +$(eval $(subst #,$(newline),$(shell cat $(BUILD_PROP) | \ + grep '^ro.product.cpu.abi=\|^ro.product.cpu.abilist32=' | \ + sed -e 's,ro.product.cpu.abi=,JNI_CPU_ABI=,' \ + -e 's,ro.product.cpu.abilist32=,JNI_CPU_ABI_2ND=,' | \ + tr ',' ' ' | tr '\n' '#'))) + +# If ARCH is set, use that to remap to an "Android" ARCH.. +ANDROID_ARCH := $(filter arm arm64 mips mips64 x86 x86_64,$(ARCH)) + +# x86 is special and has another legacy ARCH name which is remapped +ifeq ($(ARCH),i386) +ANDROID_ARCH := x86 +endif + +ifeq ($(ANDROID_ARCH),) +# ..otherwise, try to use the ABI list to figure it out. +ifneq ($(filter armeabi-v7a armeabi,$(JNI_CPU_ABI)),) +ANDROID_ARCH=arm +else ifneq ($(filter arm64-v8a,$(JNI_CPU_ABI)),) +ANDROID_ARCH=arm64 +else ifneq ($(filter mips,$(JNI_CPU_ABI)),) +ANDROID_ARCH=mips +else ifneq ($(filter mips64,$(JNI_CPU_ABI)),) +ANDROID_ARCH=mips64 +else ifneq ($(filter x86,$(JNI_CPU_ABI)),) +ANDROID_ARCH=x86 +else ifneq ($(filter x86_64,$(JNI_CPU_ABI)),) +ANDROID_ARCH=x86_64 +else +$(error ARCH not set and JNI_CPU_ABI=$(JNI_CPU_ABI) was not remappable) +endif +endif + +JNI_CPU_ABI := $(word 1,$(JNI_CPU_ABI)) +JNI_CPU_ABI_2ND := $(word 1,$(JNI_CPU_ABI_2ND)) + +include ../common/android/arch_common.mk + +ifneq ($(filter arm arm64 mips mips64,$(ANDROID_ARCH)),) +LDM_PLATFORM ?= 1 +endif + +ifneq ($(filter x86 x86_64,$(ANDROID_ARCH)),) +KERNEL_CROSS_COMPILE ?= undef +endif + +ifneq ($(filter arm64 mips64 x86_64,$(ANDROID_ARCH)),) +PVR_ANDROID_ARCH_IS_64BIT := 1 +ifeq ($(MULTIARCH),) +$(warning *** 64-bit architecture detected. Enabling MULTIARCH=1.) +$(warning *** If you want a 64-bit only build, use MULTIARCH=64only.) +export MULTIARCH := 1 +endif +endif diff --git a/drivers/gpu/rogue_m/build/linux/common/android/arch_common.mk b/drivers/gpu/rogue_m/build/linux/common/android/arch_common.mk new file mode 100644 index 000000000000..280a12861db9 --- /dev/null +++ b/drivers/gpu/rogue_m/build/linux/common/android/arch_common.mk @@ -0,0 +1,85 @@ +########################################################################### ### +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +SYS_CFLAGS := \ + -fno-short-enums \ + -funwind-tables \ + -D__linux__ +SYS_INCLUDES := \ + -isystem $(ANDROID_ROOT)/bionic/libc/include \ + -isystem $(ANDROID_ROOT)/bionic/libc/kernel/uapi \ + -isystem $(ANDROID_ROOT)/bionic/libm/include \ + -isystem $(ANDROID_ROOT)/bionic/libthread_db/include \ + -isystem $(ANDROID_ROOT)/external/libunwind/include \ + -isystem $(ANDROID_ROOT)/frameworks/base/include \ + -isystem $(ANDROID_ROOT)/hardware/libhardware/include \ + -isystem $(ANDROID_ROOT)/system/core/include \ + -isystem $(ANDROID_ROOT)/system/core/include/sync \ + -isystem $(ANDROID_ROOT)/system/core/adf/libadf/include \ + -isystem $(ANDROID_ROOT)/system/core/adf/libadfhwc/include \ + -isystem $(ANDROID_ROOT)/system/core/libsync/include \ + -isystem $(ANDROID_ROOT)/system/core/libsync \ + -isystem $(ANDROID_ROOT)/system/media/camera/include + +ifneq ($(wildcard $(ANDROID_ROOT)/external/boringssl/src/include),) +SYS_INCLUDES += \ + -isystem $(ANDROID_ROOT)/external/boringssl/src/include +else +SYS_INCLUDES += \ + -isystem $(ANDROID_ROOT)/external/openssl/include +endif + +# Obsolete libc includes +SYS_INCLUDES += \ + -isystem $(ANDROID_ROOT)/bionic/libc/kernel/common \ + -isystem $(ANDROID_ROOT)/bionic/libc/kernel/arch-$(ANDROID_ARCH) + +# The following include is a workaround for ICS 4.0.4 partial directory change +SYS_INCLUDES += \ + -isystem $(ANDROID_ROOT)/frameworks/base/native/include \ + -isystem $(ANDROID_ROOT)/frameworks/native/include + +ifeq ($(_CLANG),true) +SYS_INCLUDES := \ + -nostdinc $(SYS_INCLUDES) \ + -isystem $(ANDROID_ROOT)/external/clang/lib/Headers +endif + +OPTIM := -O2 diff --git a/drivers/gpu/rogue_m/build/linux/common/android/extra_config.mk b/drivers/gpu/rogue_m/build/linux/common/android/extra_config.mk new file mode 100644 index 000000000000..40c0703cc6fe --- /dev/null +++ b/drivers/gpu/rogue_m/build/linux/common/android/extra_config.mk @@ -0,0 +1,80 @@ +########################################################################### ### +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +$(eval $(call UserConfigMake,libpthread_ldflags,)) +$(eval $(call UserConfigMake,librt_ldflags,)) +# On versions of Android prior to L, remap the use of libc++ to a combination +# of stlport and libstdc++. Not every module written in C++ in the DDK needs +# the STL, but linking it should be harmless (and most modules do need it). +ifneq ($(is_at_least_lollipop),1) +$(eval $(call UserConfigMake,libc++_ldflags,-lstlport -lstdc++)) +endif + +$(eval $(call UserConfigMake,TARGET_ROOT,$(TARGET_ROOT))) +$(eval $(call UserConfigMake,TARGET_DEVICE,$(TARGET_DEVICE))) + +$(eval $(call BothConfigMake,SUPPORT_ANDROID_PLATFORM,1)) + +$(eval $(call BothConfigC,ANDROID,)) + +$(eval $(call UserConfigC,SUPPORT_ANDROID_PLATFORM,1)) + +# These are set automatically according to the platform version. +$(eval $(call TunableBothConfigC,SUPPORT_NATIVE_FENCE_SYNC,)) + +# These are user-tunable. + + +$(eval $(call TunableBothConfigC,PVR_ANDROID_HAS_SW_INCOMPATIBLE_FRAMEBUFFER,,\ +Enable this to support running Android$(apos)s software GLES renderer_\ +with gralloc from the DDK._\ +)) + + + + +# These are set automatically according to the platform version. +$(eval $(call TunableBothConfigMake,SUPPORT_NATIVE_FENCE_SYNC,)) + +# These are user-tunable. + + + +$(eval $(call TunableKernelConfigC,ADF_FBDEV_NUM_PREFERRED_BUFFERS,)) diff --git a/drivers/gpu/rogue_m/build/linux/common/android/features.mk b/drivers/gpu/rogue_m/build/linux/common/android/features.mk new file mode 100644 index 000000000000..ced4df3b8a50 --- /dev/null +++ b/drivers/gpu/rogue_m/build/linux/common/android/features.mk @@ -0,0 +1,312 @@ +########################################################################### ### +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +# Basic support option tuning for Android +# +SUPPORT_ANDROID_PLATFORM := 1 +SUPPORT_OPENGLES1_V1_ONLY := 1 +DONT_USE_SONAMES := 1 + +# Always print debugging after 5 seconds of no activity +# +CLIENT_DRIVER_DEFAULT_WAIT_RETRIES := 50 + +# Android WSEGL is always the same +# +OPK_DEFAULT := libpvrANDROID_WSEGL.so + +# srvkm is always built +# +KERNEL_COMPONENTS := srvkm + +# Kernel modules are always installed here under Android +# +# Time:2014-08-26 +# Note:change module's path from /system/modules/ to /system/lib/modules/ +# Modifier: zxl +PVRSRV_MODULE_BASEDIR := /system/lib/modules/ + +# Enable secure FD export in Services +# +SUPPORT_SECURE_EXPORT := 1 + +# Disable multi sync support in Services +# +SUPPORT_MULTI_SYNC := 0 + +# It is no longer supported disable this for Android, but we can still +# do so for the Linux DDK, so don't use NonTunableOption. +# +override SUPPORT_ION := 1 + +# Show GPU activity in systrace +# +SUPPORT_GPUTRACE_EVENTS ?= 1 + +############################################################################## +# Unless overridden by the user, assume the RenderScript Compute API level +# matches that of the SDK API_LEVEL. +# +RSC_API_LEVEL ?= $(API_LEVEL) +ifneq ($(findstring $(RSC_API_LEVEL),21 22),) +RSC_API_LEVEL := 20 +endif + +############################################################################## +# JB MR1 introduces cross-process syncs associated with a fd. +# This requires a new enough kernel version to have the base/sync driver. +# +#zxl:Temporarily closed for user build mode(Depend on libgui: LOCAL_CFLAGS += -DDONT_USE_FENCE_SYNC) +EGL_EXTENSION_ANDROID_NATIVE_FENCE_SYNC ?= 1 + +ifeq ($(PDUMP),1) +# PDUMPs won't process if any native synchronization is enabled +override EGL_EXTENSION_ANDROID_NATIVE_FENCE_SYNC := 0 +override SUPPORT_NATIVE_FENCE_SYNC := 0 +override PVR_ANDROID_DEFER_CLEAR := 0 +else +override SUPPORT_NATIVE_FENCE_SYNC := 1 +endif + +############################################################################## +# Handle various platform includes +# +SYS_INCLUDES += \ + -isystem $(ANDROID_ROOT)/external/zlib/src \ + -isystem $(ANDROID_ROOT)/libnativehelper/include/nativehelper +SYS_KHRONOS_INCLUDES += \ + -I$(ANDROID_ROOT)/frameworks/native/opengl/include + +############################################################################## +# Android doesn't use these install script variables. They're still in place +# because the Linux install scripts use them. +# +SHLIB_DESTDIR := not-used +EGL_DESTDIR := not-used + +# Must give our EGL/GLES libraries a globally unique name +# +EGL_BASENAME_SUFFIX := _POWERVR_ROGUE + +############################################################################## +# In K and older, augment the libstdc++ includes with stlport includes. Any +# part of the C++ library not implemented by stlport will be handled by +# linking in libstdc++ too (see extra_config.mk). +# +# On L and newer, don't use stlport OR libstdc++ at all; just use libc++. +# +SYS_CXXFLAGS := -fuse-cxa-atexit $(SYS_CFLAGS) +ifeq ($(is_at_least_lollipop),1) +SYS_INCLUDES += \ + -isystem $(ANDROID_ROOT)/external/libcxx/include +else +SYS_INCLUDES += \ + -isystem $(ANDROID_ROOT)/bionic \ + -isystem $(ANDROID_ROOT)/external/stlport/stlport +endif + +############################################################################## +# ICS requires that at least one driver EGLConfig advertises the +# EGL_RECORDABLE_ANDROID attribute. The platform requires that surfaces +# rendered with this config can be consumed by an OMX video encoder. +# +EGL_EXTENSION_ANDROID_RECORDABLE := 1 + +############################################################################## +# ICS added the EGL_ANDROID_blob_cache extension. Enable support for this +# extension in EGL/GLESv2. +# +EGL_EXTENSION_ANDROID_BLOB_CACHE ?= 1 + +############################################################################## +# Framebuffer target extension is used to find configs compatible with +# the framebuffer +# +EGL_EXTENSION_ANDROID_FRAMEBUFFER_TARGET := 1 + +############################################################################## +# Disable the MEMINFO wrapper pvCpuVirtAddr feature. All Android DDK +# components no longer require it. This enables lazy CPU mappings, which +# improves allocation performance. +# +ifneq ($(PDUMP),1) +PVRSRV_NO_MEMINFO_CPU_VIRT_ADDR ?= 1 +endif + +############################################################################## +# JB added a new corkscrew API for userland backtracing. +# +ifeq ($(is_at_least_lollipop),0) +PVR_ANDROID_HAS_CORKSCREW_API := 1 +endif + +############################################################################## +# This is currently broken on KK. Disable until fixed. +# +SUPPORT_ANDROID_APPHINTS := 0 + +############################################################################## +# KitKat added very provisional/early support for sRGB render targets +# +# (Leaving this optional until the framework makes it mandatory.) +# +PVR_ANDROID_HAS_HAL_PIXEL_FORMAT_sRGB ?= 1 + +############################################################################## +# Switch on ADF support for KitKat MR1 or newer. +# +# Customers using AOSP KitKat MR1 sources need to copy and build the libadf +# and libadfhwc libraries from AOSP master system/core into their device/ +# directories and build the components as dynamic libraries. Examples of how +# to do this are shown in the bundled 'pc_android' and 'generic_arm_android' +# directories in the device package. +# +# Customers using AOSP master do not need to make any changes. +# ADF requires kernel/common derivative kernels >= 3.10. +# +ifeq ($(is_at_least_kitkat_mr1),1) +#SUPPORT_ADF ?= 1 +SUPPORT_DISPLAY_CLASS := 0 +else +SUPPORT_DISPLAY_CLASS ?= 1 +endif + +############################################################################## +# Versions of Android between Cupcake and KitKat MR1 required Java 6. +# +ifeq ($(is_at_least_lollipop),0) +LEGACY_USE_JAVA6 ?= 1 +endif + +############################################################################## +# Versions of Android between ICS and KitKat MR1 used ion .heap_mask instead +# of .heap_id_mask. +# +ifeq ($(is_at_least_lollipop),0) +PVR_ANDROID_HAS_ION_FIELD_HEAP_MASK := 1 +endif + +############################################################################## +# Lollipop supports 64-bit. Configure BCC to emit both 32-bit and 64-bit LLVM +# bitcode in the renderscript driver. +# +ifeq ($(is_at_least_lollipop),1) +PVR_ANDROID_BCC_MULTIARCH_SUPPORT := 1 +endif + +############################################################################## +# Lollipop annotates the cursor allocation with USAGE_CURSOR to enable it to +# be accelerated with special cursor hardware (rather than wasting an +# overlay). This flag stops the DDK from blocking the allocation. +# +ifeq ($(is_at_least_lollipop),1) +PVR_ANDROID_HAS_GRALLOC_USAGE_CURSOR := 1 +endif + +############################################################################## +# Lollipop changed the camera HAL metadata specification to require that +# CONTROL_MAX_REGIONS specifies 3 integers (instead of 1). +# +ifeq ($(is_at_least_lollipop),1) +PVR_ANDROID_CAMERA_CONTROL_MAX_REGIONS_HAS_THREE := 1 +endif + +############################################################################## +# Lollipop adds async versions of the CPU access functions to gralloc. +# +ifeq ($(is_at_least_lollipop),1) +PVR_ANDROID_HAS_GRALLOC_ASYNC_LOCK := 1 +endif + +############################################################################## +# Marshmallow needs --soname turned on +# +ifeq ($(is_at_least_marshmallow),1) +PVR_ANDROID_NEEDS_SONAME ?= 1 +endif + +############################################################################## +# Marshmallow replaces RAW_SENSOR with RAW10, RAW12 and RAW16 +# +ifeq ($(is_at_least_marshmallow),1) +PVR_ANDROID_HAS_HAL_PIXEL_FORMAT_RAWxx := 1 +endif + +############################################################################## +# Marshmallow has redesigned sRGB support +# +ifeq ($(is_at_least_marshmallow),1) +PVR_ANDROID_HAS_SET_BUFFERS_DATASPACE ?= 1 +PVR_ANDROID_HAS_HAL_PIXEL_FORMAT_sRGB := 0 +endif + +############################################################################## +# fenv was rewritten in Marshmallow +# +ifeq ($(is_at_least_marshmallow),1) +PVR_ANDROID_HAS_WORKING_FESETROUND := 1 +endif + +############################################################################## +# Marshmallow renderscript support +# +ifeq ($(is_at_least_marshmallow),1) +# Bump the RenderScript API level to 23 for future versions +# API_LEVEL itself shouldn't be touched. +RSC_API_LEVEL := 23 + +# RenderScript header file was moved in AOSP master +PVR_ANDROID_HAS_RS_INTERNAL_DEFINES := 1 + +# LLVM's MemoryBuffer is now passed via reference +PVR_ANDROID_HAS_RS_MEMBUFFER_REF := 1 + +# RenderScript ScriptGroup API has ScriptGroupBase instead of ScriptGroup +PVR_ANDROID_HAS_SCRIPTGROUPBASE := 1 + +# RenderScript elementData API is generic +PVR_ANDROID_POST_L_HAL := 1 +endif + +# Placeholder for future version handling +# +ifeq ($(is_future_version),1) +-include ../common/android/future_version.mk +endif diff --git a/drivers/gpu/rogue_m/build/linux/common/android/install.sh.tpl b/drivers/gpu/rogue_m/build/linux/common/android/install.sh.tpl new file mode 100644 index 000000000000..b949c8c9146a --- /dev/null +++ b/drivers/gpu/rogue_m/build/linux/common/android/install.sh.tpl @@ -0,0 +1,323 @@ +#!/bin/bash +############################################################################ ### +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +#### ########################################################################### +# Help on how to invoke +# +function usage { + echo "usage: $0 [options...]" + echo "" + echo "Options: -v Verbose mode." + echo " -n Dry-run mode." + echo " -u Uninstall-only mode." + echo " --root Use as the root of the install file system." + echo " (Overrides the DISCIMAGE environment variable.)" + exit 1 +} + +WD=`pwd` +SCRIPT_ROOT=`dirname $0` +cd $SCRIPT_ROOT + +PVRVERSION=[PVRVERSION] +PVRBUILD=[PVRBUILD] +PRIMARY_ARCH="[PRIMARY_ARCH]" +ARCHITECTURES="[ARCHITECTURES]" + +# These destination directories are the same for 32- or 64-bit binaries. +# zxl: change module's path from /system/modules/ to /system/lib/modules/ +MOD_DESTDIR=/system/lib/modules +BIN_DESTDIR=/system/vendor/bin +DATA_DESTDIR=${BIN_DESTDIR} + +# Exit with an error messages. +# $1=blurb +# +function bail { + if [ ! -z "$1" ]; then + echo "$1" >&2 + fi + + echo "" >&2 + echo "Installation failed" >&2 + exit 1 +} + +# Copy all the required files into their appropriate places on the local machine. +function install_locally { + # Define functions required for local installs + + # basic installation function + # $1=fromfile, $2=destfilename, $3=blurb, $4=chmod-flags, $5=chown-flags + # + function install_file { + if [ -z "$DDK_INSTALL_LOG" ]; then + bail "INTERNAL ERROR: Invoking install without setting logfile name" + fi + DESTFILE=${DISCIMAGE}$2 + DESTDIR=`dirname $DESTFILE` + + if [ ! -e $1 ]; then + [ -n "$VERBOSE" ] && echo "skipping file $1 -> $2" + return + fi + + # Destination directory - make sure it's there and writable + # + if [ -d "${DESTDIR}" ]; then + if [ ! -w "${DESTDIR}" ]; then + bail "${DESTDIR} is not writable." + fi + else + $DOIT mkdir -p ${DESTDIR} || bail "Couldn't mkdir -p ${DESTDIR}" + [ -n "$VERBOSE" ] && echo "Created directory `dirname $2`" + fi + + # Delete the original so that permissions don't persist. + # + $DOIT rm -f $DESTFILE + + $DOIT cp -f $1 $DESTFILE || bail "Couldn't copy $1 to $DESTFILE" + $DOIT chmod $4 ${DESTFILE} + + echo "$3 `basename $1` -> $2" + $DOIT echo "file $2" >> $DDK_INSTALL_LOG + } + + # Android-specific targetfs mkdir workarounds + if [ ! -d ${DISCIMAGE}/data ]; then + mkdir ${DISCIMAGE}/data + chown 1000:1000 ${DISCIMAGE}/data + chmod 0771 ${DISCIMAGE}/data + fi + if [ ! -d ${DISCIMAGE}/data/app ]; then + mkdir ${DISCIMAGE}/data/app + chown 1000:1000 ${DISCIMAGE}/data/app + chmod 0771 ${DISCIMAGE}/data/app + fi + + for arch in $ARCHITECTURES; do + if [ ! -d $arch ]; then + echo "Unknown architecture $arch. Aborting" + #exit 1 + fi + + case $arch in + target*64) + SHLIB_DESTDIR=/system/vendor/lib64 + ;; + *) + SHLIB_DESTDIR=/system/vendor/lib + esac + EGL_DESTDIR=${SHLIB_DESTDIR}/egl + + pushd $arch > /dev/null + # Install UM components + if [ -f install_um.sh ]; then + DDK_INSTALL_LOG=$UMLOG + echo "Installing User components for architecture $arch" + $DOIT echo "version $PVRVERSION" > $DDK_INSTALL_LOG + source install_um.sh + echo + fi + popd > /dev/null + done + + pushd $PRIMARY_ARCH > /dev/null + # Install KM components + if [ -f install_km.sh ]; then + DDK_INSTALL_LOG=$KMLOG + echo "Installing Kernel components for architecture $PRIMARY_ARCH" + $DOIT echo "version $PVRVERSION" > $DDK_INSTALL_LOG + source install_km.sh + echo + fi + popd > /dev/null + + $DOIT mkdir -p ${DISCIMAGE}/system/lib/egl + $DOIT cat >${DISCIMAGE}/system/lib/egl/egl.cfg <> $DDK_INSTALL_LOG + + # Create an OLDLOG so old versions of the driver can uninstall. + $DOIT echo "version $PVRVERSION" > $OLDLOG + if [ -f $KMLOG ]; then + tail -n +2 $KMLOG >> $OLDLOG + fi + if [ -f $UMLOG ]; then + tail -n +2 $UMLOG >> $OLDLOG + fi + + # Make sure new logs are newer than $OLDLOG + touch -m -d "last sunday" $OLDLOG +} + +# Read the appropriate install log and delete anything therein. +function uninstall_locally { + # Function to uninstall something. + function do_uninstall { + LOG=$1 + + if [ ! -f $LOG ]; then + echo "Nothing to un-install." + return; + fi + + BAD=0 + VERSION="" + while read type data; do + case $type in + version) + echo "Uninstalling existing version $data" + VERSION="$data" + ;; + link|file) + if [ -z "$VERSION" ]; then + BAD=1; + echo "No version record at head of $LOG" + elif ! $DOIT rm -f ${DISCIMAGE}${data}; then + BAD=1; + else + [ -n "$VERBOSE" ] && echo "Deleted $type $data" + fi + ;; + tree) + ;; + esac + done < $1; + + if [ $BAD = 0 ]; then + echo "Uninstallation completed." + $DOIT rm -f $LOG + else + echo "Uninstallation failed!!!" + fi + } + + if [ -z "$OLDLOG" -o -z "$KMLOG" -o -z "$UMLOG" ]; then + bail "INTERNAL ERROR: Invoking uninstall without setting logfile name" + fi + + # Uninstall anything installed using the old-style install scripts. + LEGACY_LOG=0 + if [ -f $OLDLOG ]; then + if [ -f $KMLOG -a $KMLOG -nt $OLDLOG ]; then + # Last install was new scheme. + rm $OLDLOG + elif [ -f $UMLOG -a $UMLOG -nt $OLDLOG ]; then + # Last install was new scheme. + rm $OLDLOG + else + echo "Uninstalling all components from legacy log." + do_uninstall $OLDLOG + LEGACY_LOG=1 + echo + fi + fi + + if [ $LEGACY_LOG = 0 ]; then + # Uninstall KM components if we are doing a KM install. + if [ -f install_km.sh -a -f $KMLOG ]; then + echo "Uninstalling Kernel components" + do_uninstall $KMLOG + echo + fi + # Uninstall UM components if we are doing a UM install. + if [ -f install_um.sh -a -f $UMLOG ]; then + echo "Uninstalling User components" + do_uninstall $UMLOG + echo + fi + fi +} + +# Work out if there are any special instructions. +# +while [ "$1" ]; do + case "$1" in + -v|--verbose) + VERBOSE=v + ;; + -r|--root) + DISCIMAGE=$2 + shift; + ;; + -u|--uninstall) + UNINSTALL_ONLY=y + ;; + -n) + DOIT=echo + ;; + -h | --help | *) + usage + ;; + esac + shift +done + +if [ ! -z "$DISCIMAGE" ]; then + + if [ ! -d "$DISCIMAGE" ]; then + bail "$0: $DISCIMAGE does not exist." + fi + + echo + if [ $DISCIMAGE == "/" ]; then + echo "Installing PowerVR '$PVRVERSION ($PVRBUILD)' locally" + else + echo "Installing PowerVR '$PVRVERSION ($PVRBUILD)' on $DISCIMAGE" + fi + echo + echo "File system installation root is $DISCIMAGE" + echo + + OLDLOG=$DISCIMAGE/powervr_ddk_install.log + KMLOG=$DISCIMAGE/powervr_ddk_install_km.log + UMLOG=$DISCIMAGE/powervr_ddk_install_um.log + + uninstall_locally + + if [ "$UNINSTALL_ONLY" != "y" ]; then + install_locally + fi + +else + bail "DISCIMAGE must be set for installation to be possible." +fi diff --git a/drivers/gpu/rogue_m/build/linux/common/android/paths.mk b/drivers/gpu/rogue_m/build/linux/common/android/paths.mk new file mode 100644 index 000000000000..6cc7cc7efe97 --- /dev/null +++ b/drivers/gpu/rogue_m/build/linux/common/android/paths.mk @@ -0,0 +1,52 @@ +########################################################################### ### +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +TARGET_BUILD_TYPE ?= release + +HOST_OS ?= linux +HOST_ARCH ?= x86 + +OUT_DIR ?= $(ANDROID_ROOT)/out + +ifeq ($(TARGET_BUILD_TYPE),debug) +TARGET_ROOT := $(OUT_DIR)/debug/target +else +TARGET_ROOT := $(OUT_DIR)/target +endif diff --git a/drivers/gpu/rogue_m/build/linux/common/android/platform_version.mk b/drivers/gpu/rogue_m/build/linux/common/android/platform_version.mk new file mode 100644 index 000000000000..93d4800af094 --- /dev/null +++ b/drivers/gpu/rogue_m/build/linux/common/android/platform_version.mk @@ -0,0 +1,172 @@ +########################################################################### ### +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +# If there's no build.prop file in the expected location, bail out. Tell the +# user which file we were trying to read in case TARGET_DEVICE was not set. +# +BUILD_PROP := $(TARGET_ROOT)/product/$(TARGET_DEVICE)/system/build.prop +ifeq ($(wildcard $(BUILD_PROP)),) +$(warning *** Could not determine Android version. Did you set ANDROID_ROOT,\ +OUT_DIR and TARGET_DEVICE in your environment correctly?) +$(error Error reading $(BUILD_PROP)) +endif + +# Extract version.release and version.codename from the build.prop file. +# If either of the values aren't in the build.prop, the Make variables won't +# be defined, and fallback handling will take place. +# +define newline + + +endef +$(eval $(subst #,$(newline),$(shell cat $(BUILD_PROP) | \ + grep '^ro.build.version.release=\|^ro.build.version.codename=' | \ + sed -e 's,ro.build.version.release=,PLATFORM_RELEASE=,' \ + -e 's,ro.build.version.codename=,PLATFORM_CODENAME=,' | tr '\n' '#'))) + +define release-starts-with +$(shell echo $(PLATFORM_RELEASE) | grep -q ^$(1); \ + [ "$$?" = "0" ] && echo 1 || echo 0) +endef + +# ro.build.version.release contains the version number for release builds, or +# the version codename otherwise. In this case we need to assume that the +# version of Android we're building against has the features that are in the +# final release of that version, so we set PLATFORM_RELEASE to the +# corresponding release number. +# +# NOTE: It's the _string_ ordering that matters here, not the version number +# ordering. You need to make sure that strings that are sub-strings of other +# checked strings appear _later_ in this list. +# +# e.g. 'KitKatMR' starts with 'KitKat', but it is not KitKat. +# +# NOTE: The version codenames for Android stopped after KitKat, don't read +# too much into the below names. They are mostly placeholders/reminders. +# +ifeq ($(call release-starts-with,KitKatMR),1) +PLATFORM_RELEASE := 4.4.1 +else ifeq ($(call release-starts-with,KitKat),1) +PLATFORM_RELEASE := 4.4 +else ifeq ($(call release-starts-with,LollipopMR1),1) +PLATFORM_RELEASE := 5.1 +else ifeq ($(call release-starts-with,Lollipop),1) +PLATFORM_RELEASE := 5.0 +else ifeq ($(call release-starts-with,Marshmallow),1) +PLATFORM_RELEASE := 6.0 +else ifeq ($(PLATFORM_CODENAME),AOSP) +# AOSP (master) will normally have PLATFORM_CODENAME set to AOSP +PLATFORM_RELEASE := 6.0.60 +else ifeq ($(shell echo $(PLATFORM_RELEASE) | grep -qE "[A-Za-z]+"; echo $$?),0) +PLATFORM_RELEASE := 6.1 +endif + +# Workaround for master. Sometimes there is an AOSP version ahead of +# the current master version number, but master still has more features. +# +ifeq ($(PLATFORM_RELEASE),6.0.60) +PLATFORM_RELEASE := 6.1 +is_aosp_master := 1 +endif + +PLATFORM_RELEASE_MAJ := $(shell echo $(PLATFORM_RELEASE) | cut -f1 -d'.') +PLATFORM_RELEASE_MIN := $(shell echo $(PLATFORM_RELEASE) | cut -f2 -d'.') +PLATFORM_RELEASE_PATCH := $(shell echo $(PLATFORM_RELEASE) | cut -f3 -d'.') + +# Not all versions have a patchlevel; fix that up here +# +ifeq ($(PLATFORM_RELEASE_PATCH),) +PLATFORM_RELEASE_PATCH := 0 +endif + +# Macros to help categorize support for features and API_LEVEL for tests. +# +is_at_least_kitkat := \ + $(shell ( test $(PLATFORM_RELEASE_MAJ) -gt 4 || \ + ( test $(PLATFORM_RELEASE_MAJ) -eq 4 && \ + test $(PLATFORM_RELEASE_MIN) -ge 4 ) ) && echo 1 || echo 0) +is_at_least_kitkat_mr1 := \ + $(shell ( test $(PLATFORM_RELEASE_MAJ) -gt 4 || \ + ( test $(PLATFORM_RELEASE_MAJ) -eq 4 && \ + test $(PLATFORM_RELEASE_MIN) -gt 4 ) || \ + ( test $(PLATFORM_RELEASE_MAJ) -eq 4 && \ + test $(PLATFORM_RELEASE_MIN) -eq 4 && \ + test $(PLATFORM_RELEASE_PATCH) -ge 1 ) ) && echo 1 || echo 0) +is_at_least_lollipop := \ + $(shell ( test $(PLATFORM_RELEASE_MAJ) -ge 5 ) && echo 1 || echo 0) +is_at_least_lollipop_mr1 := \ + $(shell ( test $(PLATFORM_RELEASE_MAJ) -gt 5 || \ + ( test $(PLATFORM_RELEASE_MAJ) -eq 5 && \ + test $(PLATFORM_RELEASE_MIN) -gt 0 ) ) && echo 1 || echo 0) +is_at_least_marshmallow := \ + $(shell ( test $(PLATFORM_RELEASE_MAJ) -ge 6 ) && echo 1 || echo 0) + +# Assume "future versions" are >6.0, but we don't really know +is_future_version := \ + $(shell ( test $(PLATFORM_RELEASE_MAJ) -gt 6 || \ + ( test $(PLATFORM_RELEASE_MAJ) -eq 6 && \ + test $(PLATFORM_RELEASE_MIN) -gt 0 ) ) && echo 1 || echo 0) + +# Picking an exact match of API_LEVEL for the platform we're building +# against can avoid compatibility theming and affords better integration. +# +ifeq ($(is_future_version),1) +API_LEVEL := 23 +else ifeq ($(is_at_least_marshmallow),1) +API_LEVEL := 23 +else ifeq ($(is_at_least_lollipop_mr1),1) +API_LEVEL := 22 +else ifeq ($(is_at_least_lollipop),1) +API_LEVEL := 21 +#API_LEVEL := 20 was l-preview +else ifeq ($(is_at_least_kitkat),1) +API_LEVEL := 19 +else +$(error Must build against Android >= 4.4) +endif + +# Each DDK is tested against only a single version of the platform. +# Warn if a different platform version is used. +# +ifeq ($(is_future_version),1) +$(info WARNING: Android version is newer than this DDK supports) +else ifneq ($(is_at_least_kitkat),1) +$(info WARNING: Android version is older than this DDK supports) +endif diff --git a/drivers/gpu/rogue_m/build/linux/common/pvrgdb.mk b/drivers/gpu/rogue_m/build/linux/common/pvrgdb.mk new file mode 100644 index 000000000000..b5f84d41d6c7 --- /dev/null +++ b/drivers/gpu/rogue_m/build/linux/common/pvrgdb.mk @@ -0,0 +1,40 @@ +########################################################################### ### +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + diff --git a/drivers/gpu/rogue_m/build/linux/common/testchip.mk b/drivers/gpu/rogue_m/build/linux/common/testchip.mk new file mode 100644 index 000000000000..80b9672e4ff3 --- /dev/null +++ b/drivers/gpu/rogue_m/build/linux/common/testchip.mk @@ -0,0 +1,70 @@ +########################################################################### ### +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +ifeq ($(RGX_BVNC),1.82.4.5) + $(eval $(call TunableKernelConfigC,TC_APOLLO_ES2,1)) +endif + +ifeq ($(RGX_BVNC),12.4.1.48) + $(eval $(call TunableKernelConfigC,TC_APOLLO_TCF5,1)) +endif + +ifeq ($(RGX_BVNC),4.31.4.55) + $(eval $(call TunableKernelConfigC,TC_APOLLO_BONNIE,1)) +endif + +ifeq ($(PVR_SYSTEM),$(filter $(PVR_SYSTEM),rgx_tc rgx_tc_es2 plato)) +$(eval $(call TunableKernelConfigC,TC_MEMORY_CONFIG,$(TC_MEMORY_CONFIG),\ +Selects the memory configuration to be used. The choices are:_\ +* TC_MEMORY_LOCAL (Rogue and the display controller use local card memory)_\ +* TC_MEMORY_HOST (Rogue and the display controller use system memory)_\ +* TC_MEMORY_HYBRID (Rogue uses system memory and the display controller uses local card memory))) +endif +ifeq ($(PVR_SYSTEM), rgx_linux_apollo) +$(eval $(call BothConfigC,TC_MEMORY_CONFIG,TC_MEMORY_LOCAL)) +$(call $(NonTunableOption,TC_MEMORY_CONFIG)) +endif + +ifeq ($(TC_MEMORY_CONFIG),TC_MEMORY_LOCAL) +LMA := 1 +endif + +$(eval $(call TunableBothConfigC,LMA,)) +$(eval $(call TunableKernelConfigMake,LMA,)) diff --git a/drivers/gpu/rogue_m/build/linux/config/compiler.mk b/drivers/gpu/rogue_m/build/linux/config/compiler.mk new file mode 100644 index 000000000000..c1384eaae16e --- /dev/null +++ b/drivers/gpu/rogue_m/build/linux/config/compiler.mk @@ -0,0 +1,194 @@ +########################################################################### ### +#@File +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +# Check for valid values of $(MULTIARCH). +ifeq ($(strip $(MULTIARCH)),0) +$(error MULTIARCH must be empty to disable multiarch) +endif + +define calculate-compiler-preferred-target + ifeq ($(2),qcc) + $(1)_compiler_preferred_target := qcc + else + $(1)_compiler_preferred_target := $$(shell $(2) -dumpmachine) + ifeq ($$($(1)_compiler_preferred_target),) + $$(warning No output from '$(2) -dumpmachine') + $$(warning Check that the compiler is in your PATH and CROSS_COMPILE is) + $$(warning set correctly.) + $$(error Unable to run compiler '$(2)') + endif + ifneq ($$(filter x86_64-%,$$($(1)_compiler_preferred_target)),) + $(1)_compiler_preferred_target := x86_64-linux-gnu + endif + ifneq ($$(filter i386-% i486-% i686-%,$$($(1)_compiler_preferred_target)),) + $(1)_compiler_preferred_target := i386-linux-gnu + endif + ifneq ($$(filter armv7a-cros-linux-gnueabi,$$($(1)_compiler_preferred_target)),) + $(1)_compiler_preferred_target := arm-linux-gnueabi + endif + endif +endef + +define cross-compiler-name + ifeq ($$(origin CC),file) + $(1) := $(2)$(3) + else + ifeq ($$(_CLANG),true) + $(1) := $(3) -target $$(patsubst %-,%,$(2)) + else + $(1) := $(3) + endif + endif +endef + +# Work out the host compiler architecture +$(eval $(call calculate-compiler-preferred-target,host,$(HOST_CC))) + +ifeq ($(host_compiler_preferred_target),x86_64-linux-gnu) + HOST_PRIMARY_ARCH := host_x86_64 + HOST_32BIT_ARCH := host_i386 + HOST_FORCE_32BIT := -m32 +else +ifeq ($(host_compiler_preferred_target),i386-linux-gnu) + HOST_PRIMARY_ARCH := host_i386 + HOST_32BIT_ARCH := host_i386 +else + $(error Unknown host compiler target architecture $(host_compiler_preferred_target)) +endif +endif + +# Workaround our lack of support for non-Linux HOST_CCs +ifneq ($(HOST_CC_IS_LINUX),1) + $(warning $$(HOST_CC) is non-Linux. Trying to work around.) + override HOST_CC := $(HOST_CC) -D__linux__ + $(eval $(call BothConfigMake,HOST_CC,$(HOST_CC))) +endif + +$(eval $(call BothConfigMake,HOST_PRIMARY_ARCH,$(HOST_PRIMARY_ARCH))) +$(eval $(call BothConfigMake,HOST_32BIT_ARCH,$(HOST_32BIT_ARCH))) +$(eval $(call BothConfigMake,HOST_FORCE_32BIT,$(HOST_FORCE_32BIT))) + +TARGET_ALL_ARCH := +TARGET_PRIMARY_ARCH := +TARGET_SECONDARY_ARCH := + +# Work out the target compiler cross triple, and include the corresponding +# compilers/*.mk file, which sets TARGET_PRIMARY_ARCH and +# TARGET_SECONDARY_ARCH for that compiler. +# +compilers := ../config/compilers +define include-compiler-file + ifeq ($(strip $(1)),) + $$(error empty arg passed to include-compiler-file) + endif + ifeq ($$(wildcard $$(compilers)/$(1).mk),) + $$(warning ******************************************************) + $$(warning Compiler target '$(1)' not recognised) + $$(warning (missing $$(compilers)/$(1).mk file)) + $$(warning ******************************************************) + $$(error Compiler '$(1)' not recognised) + endif + include $$(compilers)/$(1).mk +endef + +# Check the kernel cross compiler to work out which architecture it targets. +# We can then tell if CROSS_COMPILE targets a different architecture. +ifneq ($(origin KERNEL_CROSS_COMPILE),undefined) + # First, calculate the value of KERNEL_CROSS_COMPILE as it would be seen by + # the main build, so we can check it here in the config stage. + $(call one-word-only,KERNEL_CROSS_COMPILE) + _kernel_cross_compile := $(if $(filter undef,$(KERNEL_CROSS_COMPILE)),,$(KERNEL_CROSS_COMPILE)) + # We can take shortcuts with KERNEL_CROSS_COMPILE, as we don't want to + # respect CC and we don't support clang in that part currently. + _kernel_cross_compile := $(_kernel_cross_compile)gcc + # Then check the compiler. + $(eval $(call calculate-compiler-preferred-target,target,$(_kernel_cross_compile))) + $(eval $(call include-compiler-file,$(target_compiler_preferred_target))) + _kernel_primary_arch := $(TARGET_PRIMARY_ARCH) +else + # We can take shortcuts with KERNEL_CROSS_COMPILE, as we don't want to + # respect CC and we don't support clang in that part currently. + _kernel_cross_compile := $(CROSS_COMPILE)gcc + # KERNEL_CROSS_COMPILE will be the same as CROSS_COMPILE, so we don't need + # to do the compatibility check. + _kernel_primary_arch := +endif + +$(eval $(call cross-compiler-name,_cc,$(CROSS_COMPILE),$(CC))) +$(eval $(call cross-compiler-name,_cc_secondary,$(if $(CROSS_COMPILE_SECONDARY),$(CROSS_COMPILE_SECONDARY),$(CROSS_COMPILE)),$(CC_SECONDARY))) +$(eval $(call calculate-compiler-preferred-target,target,$(_cc))) +$(eval $(call include-compiler-file,$(target_compiler_preferred_target))) + +# Sanity check: if KERNEL_CROSS_COMPILE was set, it has to target the same +# architecture as CROSS_COMPILE. +ifneq ($(_kernel_primary_arch),) + ifneq ($(TARGET_PRIMARY_ARCH),$(_kernel_primary_arch)) + $(warning ********************************************************) + $(warning Error: Kernel and user-mode cross compilers build for) + $(warning different targets) + $(warning $(space)$(space)CROSS_COMPILE=$(CROSS_COMPILE)) + $(warning $(space)$(space)$(space)builds for $(TARGET_PRIMARY_ARCH)) + $(warning $(space)$(space)KERNEL_CROSS_COMPILE=$(KERNEL_CROSS_COMPILE)) + $(warning $(space)$(space)$(space)builds for $(_kernel_primary_arch)) + $(warning ********************************************************) + $(error Mismatching kernel and user-mode cross compilers) + endif +endif + +ifneq ($(MULTIARCH),32only) +TARGET_ALL_ARCH += $(TARGET_PRIMARY_ARCH) +endif +ifneq ($(MULTIARCH),64only) +TARGET_ALL_ARCH += $(TARGET_SECONDARY_ARCH) +endif + +$(eval $(call BothConfigMake,TARGET_PRIMARY_ARCH,$(TARGET_PRIMARY_ARCH))) +$(eval $(call BothConfigMake,TARGET_SECONDARY_ARCH,$(TARGET_SECONDARY_ARCH))) +$(eval $(call BothConfigMake,TARGET_ALL_ARCH,$(TARGET_ALL_ARCH))) +$(eval $(call BothConfigMake,TARGET_FORCE_32BIT,$(TARGET_FORCE_32BIT))) + +$(info ******* Multiarch build: $(if $(MULTIARCH),yes,no)) +$(info ******* Primary arch: $(if $(TARGET_PRIMARY_ARCH),$(TARGET_PRIMARY_ARCH),none)) +$(info ******* Secondary arch: $(if $(TARGET_SECONDARY_ARCH),$(TARGET_SECONDARY_ARCH),none)) + +# Find the paths to libgcc for the primary and secondary architectures. +LIBGCC := $(shell $(_cc) -print-libgcc-file-name) +LIBGCC_SECONDARY := $(shell $(_cc_secondary) $(TARGET_FORCE_32BIT) -print-libgcc-file-name) diff --git a/drivers/gpu/rogue_m/build/linux/config/compilers/aarch64-linux-android.mk b/drivers/gpu/rogue_m/build/linux/config/compilers/aarch64-linux-android.mk new file mode 100644 index 000000000000..97136fe6a45d --- /dev/null +++ b/drivers/gpu/rogue_m/build/linux/config/compilers/aarch64-linux-android.mk @@ -0,0 +1,12 @@ +# 64-bit Android AArch64 compiler +TARGET_PRIMARY_ARCH := target_aarch64 +ifeq ($(MULTIARCH),1) + TARGET_SECONDARY_ARCH := target_armv7-a + ifneq ($(MAKECMDGOALS),kbuild) + ifneq ($(COMPONENTS),) + ifeq ($(CROSS_COMPILE_SECONDARY),) + $(error CROSS_COMPILE_SECONDARY must be set for multiarch ARM builds) + endif + endif + endif +endif diff --git a/drivers/gpu/rogue_m/build/linux/config/compilers/arm-eabi.mk b/drivers/gpu/rogue_m/build/linux/config/compilers/arm-eabi.mk new file mode 100644 index 000000000000..d671ba9ccc18 --- /dev/null +++ b/drivers/gpu/rogue_m/build/linux/config/compilers/arm-eabi.mk @@ -0,0 +1,2 @@ +# 32-bit ARM EABI compiler +TARGET_PRIMARY_ARCH := target_armv7-a diff --git a/drivers/gpu/rogue_m/build/linux/config/compilers/arm-linux-androideabi.mk b/drivers/gpu/rogue_m/build/linux/config/compilers/arm-linux-androideabi.mk new file mode 100644 index 000000000000..8aaeaadf43d9 --- /dev/null +++ b/drivers/gpu/rogue_m/build/linux/config/compilers/arm-linux-androideabi.mk @@ -0,0 +1,2 @@ +# 32-bit Android ARM compiler +include $(compilers)/arm-eabi.mk diff --git a/drivers/gpu/rogue_m/build/linux/config/compilers/i386-linux-gnu.mk b/drivers/gpu/rogue_m/build/linux/config/compilers/i386-linux-gnu.mk new file mode 100644 index 000000000000..cd9539c7cf68 --- /dev/null +++ b/drivers/gpu/rogue_m/build/linux/config/compilers/i386-linux-gnu.mk @@ -0,0 +1,2 @@ +# 32-bit x86 compiler +TARGET_PRIMARY_ARCH := target_i686 diff --git a/drivers/gpu/rogue_m/build/linux/config/compilers/x86_64-linux-gnu.mk b/drivers/gpu/rogue_m/build/linux/config/compilers/x86_64-linux-gnu.mk new file mode 100644 index 000000000000..008e86b35a92 --- /dev/null +++ b/drivers/gpu/rogue_m/build/linux/config/compilers/x86_64-linux-gnu.mk @@ -0,0 +1,29 @@ +# 64-bit x86 compiler +TARGET_FORCE_32BIT := -m32 + +ifneq ($(KERNELDIR),) + ifneq ($(ARCH),i386) + ifeq ($(shell grep -q "CONFIG_X86_32=y" $(KERNELDIR)/.config && echo 1 || echo 0),1) + $(warning ******************************************************) + $(warning Your kernel appears to be configured for 32-bit x86,) + $(warning but CROSS_COMPILE (or KERNEL_CROSS_COMPILE) points) + $(warning to a 64-bit compiler.) + $(warning If you want a 32-bit build, either set CROSS_COMPILE) + $(warning to point to a 32-bit compiler, or build with ARCH=i386) + $(warning to force 32-bit mode with your existing compiler.) + $(warning ******************************************************) + $(error Invalid CROSS_COMPILE / kernel architecture combination) + endif # CONFIG_X86_32 + endif # ARCH=i386 +endif # KERNELDIR + +# If ARCH=i386 is set, force a build for 32-bit only, even though we're +# using a 64-bit compiler. +ifeq ($(ARCH),i386) + include $(compilers)/i386-linux-gnu.mk +else + TARGET_PRIMARY_ARCH := target_x86_64 + ifeq ($(MULTIARCH),1) + TARGET_SECONDARY_ARCH := target_i686 + endif # MULTIARCH +endif diff --git a/drivers/gpu/rogue_m/build/linux/config/core.mk b/drivers/gpu/rogue_m/build/linux/config/core.mk new file mode 100644 index 000000000000..4941210cd6db --- /dev/null +++ b/drivers/gpu/rogue_m/build/linux/config/core.mk @@ -0,0 +1,862 @@ +########################################################################### ### +#@File +#@Title Root build configuration. +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +# Configuration wrapper for new build system. This file deals with +# configuration of the build. Add to this file anything that deals +# with switching driver options on/off and altering the defines or +# objects the build uses. +# +# At the end of this file is an exhaustive list of all variables +# that are passed between the platform/config stage and the generic +# build. PLEASE refrain from adding more variables than necessary +# to this stage -- almost all options can go through config.h. +# + +# Sanity check: Make sure preconfig has been included +ifeq ($(TOP),) +$(error TOP not defined: Was preconfig.mk included in root makefile?) +endif + +################################# MACROS #################################### + +ALL_TUNABLE_OPTIONS := + +# This records the config option's help text and default value. Note that +# the help text can't contain a literal comma. Use $(comma) instead. +define RegisterOptionHelp +ALL_TUNABLE_OPTIONS += $(1) +ifeq ($(INTERNAL_DESCRIPTION_FOR_$(1)),) +INTERNAL_DESCRIPTION_FOR_$(1) := $(3) +endif +INTERNAL_CONFIG_DEFAULT_FOR_$(1) := $(2) +$(if $(4),\ + $(error Too many arguments in config option '$(1)' (stray comma in help text?))) +endef + +# Write out a kernel GNU make option. +# +define KernelConfigMake +$$(shell echo "override $(1) := $(2)" >>$(CONFIG_KERNEL_MK).new) +$(if $(filter config,$(D)),$(info KernelConfigMake $(1) := $(2) # $(if $($(1)),$(origin $(1)),default))) +endef + +# Write out a GNU make option for both user & kernel +# +define BothConfigMake +$$(eval $$(call KernelConfigMake,$(1),$(2))) +$$(eval $$(call UserConfigMake,$(1),$(2))) +endef + +# Conditionally write out a kernel GNU make option +# +define _TunableKernelConfigMake +ifneq ($$($(1)),) +ifneq ($$($(1)),0) +$$(eval $$(call KernelConfigMake,$(1),$$($(1)))) +endif +else +ifneq ($(2),) +$$(eval $$(call KernelConfigMake,$(1),$(2))) +endif +endif +endef + +define TunableKernelConfigMake +$$(eval $$(call _TunableKernelConfigMake,$(1),$(2))) +$(call RegisterOptionHelp,$(1),$(2),$(3),$(4)) +endef + +# Conditionally write out a GNU make option for both user & kernel +# +define TunableBothConfigMake +$$(eval $$(call _TunableKernelConfigMake,$(1),$(2))) +$$(eval $$(call _TunableUserConfigMake,$(1),$(2))) +$(call RegisterOptionHelp,$(1),$(2),$(3),$(4)) +endef + +# Write out a kernel-only option +# +define KernelConfigC +$$(shell echo "#define $(1) $(2)" >>$(CONFIG_KERNEL_H).new) +$(if $(filter config,$(D)),$(info KernelConfigC #define $(1) $(2) /* $(if $($(1)),$(origin $(1)),default) */),) +endef + +# Write out an option for both user & kernel +# +define BothConfigC +$$(eval $$(call KernelConfigC,$(1),$(2))) +$$(eval $$(call UserConfigC,$(1),$(2))) +endef + +# Conditionally write out a kernel-only option +# +define _TunableKernelConfigC +ifneq ($$($(1)),) +ifneq ($$($(1)),0) +ifeq ($$($(1)),1) +$$(eval $$(call KernelConfigC,$(1),)) +else +$$(eval $$(call KernelConfigC,$(1),$$($(1)))) +endif +endif +else +ifneq ($(2),) +ifeq ($(2),1) +$$(eval $$(call KernelConfigC,$(1),)) +else +$$(eval $$(call KernelConfigC,$(1),$(2))) +endif +endif +endif +endef + +define TunableKernelConfigC +$$(eval $$(call _TunableKernelConfigC,$(1),$(2))) +ALL_TUNABLE_OPTIONS += $(1) +ifeq ($(INTERNAL_DESCRIPTION_FOR_$(1)),) +INTERNAL_DESCRIPTION_FOR_$(1) := $(3) +endif +INTERNAL_CONFIG_DEFAULT_FOR_$(1) := $(2) +endef + +# Conditionally write out an option for both user & kernel +# +define TunableBothConfigC +$$(eval $$(call _TunableKernelConfigC,$(1),$(2))) +$$(eval $$(call _TunableUserConfigC,$(1),$(2))) +$(call RegisterOptionHelp,$(1),$(2),$(3),$(4)) +endef + +# Use this to mark config options which have to exist, but aren't +# user-tunable. Warn if an attempt is made to change it. +# +define NonTunableOption +$(if $(filter command line environment,$(origin $(1))),\ + $(error Changing '$(1)' is not supported)) +endef + +############################### END MACROS ################################## + +# Check we have a new enough version of GNU make. +# +need := 3.81 +ifeq ($(filter $(need),$(firstword $(sort $(MAKE_VERSION) $(need)))),) +$(error A version of GNU make >= $(need) is required - this is version $(MAKE_VERSION)) +endif + +# Decide whether we need a BVNC +ifneq ($(COMPILER_BVNC_LIST),) + DONT_NEED_RGX_BVNC := 1 +endif + +include ../defs.mk + +# Infer PVR_BUILD_DIR from the directory configuration is launched from. +# Check anyway that such a directory exists. +# +PVR_BUILD_DIR := $(notdir $(abspath .)) +$(call directory-must-exist,$(TOP)/build/linux/$(PVR_BUILD_DIR)) + +# Output directory for configuration, object code, +# final programs/libraries, and install/rc scripts. +# +BUILD ?= release +ifneq ($(filter $(WINDOW_SYSTEM),xorg wayland nullws nulldrmws ews_drm nulladfws ews_adf screen),) +OUT ?= $(TOP)/binary_$(PVR_BUILD_DIR)_$(WINDOW_SYSTEM)_$(BUILD) +else +OUT ?= $(TOP)/binary_$(PVR_BUILD_DIR)_$(BUILD) +endif +override OUT := $(if $(filter /%,$(OUT)),$(OUT),$(TOP)/$(OUT)) + +CONFIG_MK := $(OUT)/config.mk +CONFIG_H := $(OUT)/config.h +CONFIG_KERNEL_MK := $(OUT)/config_kernel.mk +CONFIG_KERNEL_H := $(OUT)/config_kernel.h + +# Convert commas to spaces in $(D). This is so you can say "make +# D=config-changes,freeze-config" and have $(filter config-changes,$(D)) +# still work. +override D := $(subst $(comma),$(space),$(D)) + +# Create the OUT directory +# +$(shell mkdir -p $(OUT)) + +# Some targets don't need information about any modules. If we only specify +# these targets on the make command line, set INTERNAL_CLOBBER_ONLY to +# indicate that toplevel.mk shouldn't read any makefiles +CLOBBER_ONLY_TARGETS := clean clobber help install +INTERNAL_CLOBBER_ONLY := +ifneq ($(strip $(MAKECMDGOALS)),) +INTERNAL_CLOBBER_ONLY := \ +$(if \ + $(strip $(foreach _cmdgoal,$(MAKECMDGOALS),\ + $(if $(filter $(_cmdgoal),$(CLOBBER_ONLY_TARGETS)),,x))),,true) +endif + +# For a clobber-only build, we shouldn't regenerate any config files +ifneq ($(INTERNAL_CLOBBER_ONLY),true) + +-include ../config/user-defs.mk + +# +# Core handling + + +# delete any previous intermediary files +$(shell \ + for file in $(CONFIG_KERNEL_H).new $(CONFIG_KERNEL_MK).new ; do \ + rm -f $$file; \ + done) + +ifeq ($(DONT_NEED_RGX_BVNC),) + # Extract the BNC config name + RGX_BNC_SPLIT := $(subst .,$(space) ,$(RGX_BVNC)) + RGX_BNC := $(word 1,$(RGX_BNC_SPLIT)).V.$(word 3,$(RGX_BNC_SPLIT)).$(word 4,$(RGX_BNC_SPLIT)) + + # Check BVNC core version + ALL_KM_BVNCS := \ + $(patsubst rgxcore_km_%.h,%,\ + $(notdir $(shell ls $(TOP)/hwdefs/km/cores/rgxcore_km_*.h))) + ifeq ($(filter $(RGX_BVNC),$(ALL_KM_BVNCS)),) + $(error Error: Invalid Kernel core RGX_BVNC=$(RGX_BVNC). \ + Valid Kernel core BVNCs: $(subst $(space),$(comma)$(space),$(ALL_KM_BVNCS))) + endif + + # Check if BVNC core file exist + RGX_BVNC_CORE_KM := $(TOP)/hwdefs/km/cores/rgxcore_km_$(RGX_BVNC).h + RGX_BVNC_CORE_KM_HEADER := \"cores/rgxcore_km_$(RGX_BVNC).h\" + # "rgxcore_km_$(RGX_BVNC).h" + ifeq ($(wildcard $(RGX_BVNC_CORE_KM)),) + $(error The file $(RGX_BVNC_CORE_KM) does not exist. \ + Valid BVNCs: $(ALL_KM_BVNCS)) + endif + + # Check BNC config version + ALL_KM_BNCS := \ + $(patsubst rgxconfig_km_%.h,%,\ + $(notdir $(shell ls $(TOP)/hwdefs/km/configs/rgxconfig_km_*.h))) + ifeq ($(filter $(RGX_BNC),$(ALL_KM_BNCS)),) + $(error Error: Invalid Kernel config RGX_BNC=$(RGX_BNC). \ + Valid Kernel config BNCs: $(subst $(space),$(comma)$(space),$(ALL_KM_BNCS))) + endif + + # Check if BNC config file exist + RGX_BNC_CONFIG_KM := $(TOP)/hwdefs/km/configs/rgxconfig_km_$(RGX_BNC).h + RGX_BNC_CONFIG_KM_HEADER := \"configs/rgxconfig_km_$(RGX_BNC).h\" + #"rgxcore_km_$(RGX_BNC).h" + ifeq ($(wildcard $(RGX_BNC_CONFIG_KM)),) + $(error The file $(RGX_BNC_CONFIG_KM) does not exist. \ + Valid BNCs: $(ALL_KM_BNCS)) + endif +endif + +# Enforced dependencies. Move this to an include. +# +SUPPORT_LINUX_USING_WORKQUEUES ?= 1 +ifeq ($(SUPPORT_LINUX_USING_WORKQUEUES),1) +override PVR_LINUX_USING_WORKQUEUES := 1 +override PVR_LINUX_MISR_USING_PRIVATE_WORKQUEUE := 1 +override PVR_LINUX_TIMERS_USING_WORKQUEUES := 1 +else ifeq ($(SUPPORT_LINUX_USING_SHARED_WORKQUEUES),1) +override PVR_LINUX_USING_WORKQUEUES := 1 +override PVR_LINUX_MISR_USING_WORKQUEUE := 1 +override PVR_LINUX_TIMERS_USING_SHARED_WORKQUEUE := 1 +endif + +ifeq ($(NO_HARDWARE),1) +override SYS_USING_INTERRUPTS := 0 +endif + +# Rather than requiring the user to have to define two variables (one quoted, +# one not), make PVRSRV_MODNAME a non-tunable and give it an overridable +# default here. +# +PVRSRV_MODNAME ?= pvrsrvkm + +# Normally builds don't touch these, but we use them to influence the +# components list. Make sure these are defined early enough to make this +# possible. +# +ifeq ($(DONT_NEED_RGX_BVNC),) +# we can only do this stuff if we have a BVNC + SUPPORT_RAY_TRACING := \ + $(shell grep -qw RGX_FEATURE_RAY_TRACING $(RGX_BNC_CONFIG_KM) && echo 1) + +SUPPORT_META_DMA :=\ + $(shell grep -qw RGX_FEATURE_META_DMA $(RGX_BNC_CONFIG_KM) && echo 1) +endif + +# Default place for shared libraries +SHLIB_DESTDIR ?= /usr/lib + +# Build's selected list of components. +# - components.mk is a per-build file that specifies the components that are +# to be built +-include components.mk + +# Set up the host and target compiler. +include ../config/compiler.mk + +# PDUMP needs extra components +# +ifeq ($(PDUMP),1) +ifneq ($(COMPONENTS),) +COMPONENTS += pdump +endif +ifeq ($(SUPPORT_DRM),1) +EXTRA_PVRSRVKM_COMPONENTS += dbgdrv +else +KERNEL_COMPONENTS += dbgdrv +endif +endif + +# HWPerf KM Interface example +# +ifeq ($(SUPPORT_KERNEL_HWPERF_TEST),1) +KERNEL_COMPONENTS += rgxhwpdrv +endif + +# PVRGDB needs extra components +# +ifeq ($(PVRGDB),1) +ifneq ($(COMPONENTS),) +COMPONENTS += pvrdebugger pvrgdb pvrdebugipc +ifneq ($(filter opencl,$(COMPONENTS)),) +COMPONENTS += gdb_ocl_test +endif +endif +override SUPPORT_EXPORTING_MEMORY_CONTEXT := 1 +endif + +# RenderScript Replay needs extra components +ifeq ($(RSCREPLAY),1) +ifneq ($(COMPONENTS),) +COMPONENTS += librscruntime librsccompiler renderscript renderscript_sha1 rscreplay +endif +endif + +$(if $(filter config,$(D)),$(info Build configuration:)) + +################################# CONFIG #################################### + +ifneq ($(SUPPORT_NEUTRINO_PLATFORM), 1) + +# If KERNELDIR is set, write it out to the config.mk, with +# KERNEL_COMPONENTS and KERNEL_ID +# +ifneq ($(strip $(KERNELDIR)),) +PVRSRV_MODULE_BASEDIR ?= /lib/modules/$(KERNEL_ID)/extra/ +$(eval $(call BothConfigMake,KERNELDIR,$(KERNELDIR))) +$(eval $(call BothConfigMake,KERNEL_ID,$(KERNEL_ID))) +$(eval $(call KernelConfigMake,KERNEL_COMPONENTS,$(KERNEL_COMPONENTS))) +$(eval $(call TunableKernelConfigMake,EXTRA_PVRSRVKM_COMPONENTS,,\ +List of components that should be built in to pvrsrvkm.ko$(comma) rather than_\ +forming separate kernel modules._\ +)) + +# If KERNEL_CROSS_COMPILE is set to "undef", this is magically +# equivalent to being unset. If it is unset, we use CROSS_COMPILE +# (which might also be unset). If it is set, use it directly. +ifneq ($(KERNEL_CROSS_COMPILE),undef) +KERNEL_CROSS_COMPILE ?= $(CROSS_COMPILE) +$(eval $(call TunableBothConfigMake,KERNEL_CROSS_COMPILE,)) +endif + +# Check the KERNELDIR has a kernel built and also check that it is +# not 64-bit, which we do not support. +KERNEL_AUTOCONF := \ + $(strip $(wildcard $(KERNELDIR)/include/linux/autoconf.h) \ + $(wildcard $(KERNELDIR)/include/generated/autoconf.h)) +ifeq ($(KERNEL_AUTOCONF),) +$(warning autoconf.h not found in $$(KERNELDIR)/include/linux \ +or $$(KERNELDIR)/include/generated. Check your $$(KERNELDIR) variable \ +and kernel configuration.) +endif +else +$(if $(KERNEL_COMPONENTS),$(warning KERNELDIR is not set. Kernel components cannot be built)) +endif + +endif # !Neutrino + +# Normally this is off for Linux, and only used by Android, but if customers +# are testing their display engines using NULLADFWS, they need to enable it +# for dmabuf support under Linux. The sync header is needed by adf_pdp. +# +SUPPORT_ION ?= 0 +ifneq ($(SUPPORT_ION),0) +# Support kernels built out-of-tree with O=/other/path +# In those cases, KERNELDIR will be O, not the source tree. +ifneq ($(wildcard $(KERNELDIR)/source),) +KSRCDIR := $(KERNELDIR)/source +else +KSRCDIR := $(KERNELDIR) +endif +ifneq ($(wildcard $(KSRCDIR)/drivers/staging/android/ion/ion.h),) +# The kernel has a more recent version of ion, located in drivers/staging. +# Change the default header paths and the behaviour wrt sg_dma_len. +PVR_ANDROID_ION_HEADER := \"../drivers/staging/android/ion/ion.h\" +PVR_ANDROID_ION_PRIV_HEADER := \"../drivers/staging/android/ion/ion_priv.h\" +PVR_ANDROID_ION_USE_SG_LENGTH := 1 +endif +ifneq ($(wildcard $(KSRCDIR)/drivers/staging/android/sync.h),) +# The kernel has a more recent version of the sync driver, located in +# drivers/staging. Change the default header path. +PVR_ANDROID_SYNC_HEADER := \"../drivers/staging/android/sync.h\" +endif +$(eval $(call BothConfigMake,SUPPORT_ION,1)) +$(eval $(call BothConfigC,SUPPORT_ION,)) +$(eval $(call TunableKernelConfigC,PVR_ANDROID_ION_HEADER,\"linux/ion.h\")) +$(eval $(call TunableKernelConfigC,PVR_ANDROID_ION_PRIV_HEADER,\"../drivers/gpu/ion/ion_priv.h\")) +$(eval $(call TunableKernelConfigC,PVR_ANDROID_ION_USE_SG_LENGTH,)) +$(eval $(call TunableKernelConfigC,PVR_ANDROID_SYNC_HEADER,\"linux/sync.h\")) +endif + +$(eval $(call UserConfigC,PVRSRV_MODULE_BASEDIR,\"$(PVRSRV_MODULE_BASEDIR)\")) + +# Ideally configured by platform Makefiles, as necessary +# +ifeq ($(SUPPORT_KERNEL_SRVINIT),1) +$(eval $(call TunableBothConfigMake,RGX_FW_FILENAME,rgx.fw)) +$(eval $(call TunableBothConfigC,RGX_FW_FILENAME,"\"rgx.fw\"")) +endif + + +$(if $(USE_CCACHE),$(if $(USE_DISTCC),$(error\ +Enabling both USE_CCACHE and USE_DISTCC at the same time is not supported))) + +# Invariant options for Linux +# +$(eval $(call BothConfigC,LINUX,)) + +$(eval $(call BothConfigC,PVR_BUILD_DIR,"\"$(PVR_BUILD_DIR)\"")) +$(eval $(call BothConfigC,PVR_BUILD_TYPE,"\"$(BUILD)\"")) +$(eval $(call BothConfigC,PVRSRV_MODNAME,"\"$(PVRSRV_MODNAME)\"")) +$(eval $(call BothConfigMake,PVRSRV_MODNAME,$(PVRSRV_MODNAME))) +$(eval $(call BothConfigMake,PVR_BUILD_DIR,$(PVR_BUILD_DIR))) +$(eval $(call BothConfigMake,PVR_BUILD_TYPE,$(BUILD))) + +$(eval $(call BothConfigC,SUPPORT_RGX,1)) +$(eval $(call UserConfigMake,SUPPORT_RGX,1)) + +# Some of the definitions in stdint.h aren't exposed by default in C++ mode, +# unless these macros are defined. To make sure we get these definitions +# regardless of which files include stdint.h, define them here. +$(eval $(call UserConfigC,__STDC_CONSTANT_MACROS,)) +$(eval $(call UserConfigC,__STDC_FORMAT_MACROS,)) +$(eval $(call UserConfigC,__STDC_LIMIT_MACROS,)) + +$(eval $(call UserConfigC,PVR_TLS_USE_GCC__thread_KEYWORD,)) + +ifneq ($(DISPLAY_CONTROLLER),) +$(eval $(call BothConfigC,DISPLAY_CONTROLLER,$(DISPLAY_CONTROLLER))) +$(eval $(call BothConfigMake,DISPLAY_CONTROLLER,$(DISPLAY_CONTROLLER))) +endif + +$(eval $(call UserConfigC,OPK_DEFAULT,"\"$(OPK_DEFAULT)\"")) +$(eval $(call UserConfigC,OPK_FALLBACK,"\"$(OPK_FALLBACK)\"")) + +$(eval $(call BothConfigMake,PVR_SYSTEM,$(PVR_SYSTEM))) +$(eval $(call KernelConfigMake,PVR_LOADER,$(PVR_LOADER))) + +ifeq ($(MESA_EGL),1) +$(eval $(call UserConfigMake,LIB_IMG_EGL,pvr_dri_support)) +$(eval $(call UserConfigC,LIB_IMG_EGL_NAME,\"libpvr_dri_support.so\")) +else +$(eval $(call UserConfigMake,LIB_IMG_EGL,IMGegl)) +$(eval $(call UserConfigC,LIB_IMG_EGL_NAME,\"libIMGegl.so\")) +endif + +# Build-type dependent options +# +$(eval $(call BothConfigMake,BUILD,$(BUILD))) + +ifeq ($(BUILD),debug) +PVR_RI_DEBUG ?= 1 +SUPPORT_PAGE_FAULT_DEBUG ?= 1 +$(eval $(call BothConfigC,DEBUG,)) +$(eval $(call KernelConfigC,DEBUG_LINUX_MEMORY_ALLOCATIONS,)) +$(eval $(call KernelConfigC,DEBUG_LINUX_MEM_AREAS,)) +$(eval $(call KernelConfigC,DEBUG_LINUX_MMAP_AREAS,)) +$(eval $(call KernelConfigC,DEBUG_BRIDGE_KM,)) +$(eval $(call KernelConfigC,DEBUG_HANDLEALLOC_KM,)) +$(eval $(call UserConfigC,DLL_METRIC,1)) +$(eval $(call TunableBothConfigC,RGXFW_ALIGNCHECKS,1)) +$(eval $(call TunableBothConfigC,PVRSRV_DEBUG_CCB_MAX,)) +else ifeq ($(BUILD),release) +$(eval $(call BothConfigC,RELEASE,)) +$(eval $(call TunableBothConfigMake,DEBUGLINK,1)) +$(eval $(call TunableBothConfigC,RGXFW_ALIGNCHECKS,)) +else ifeq ($(BUILD),timing) +$(eval $(call BothConfigC,TIMING,)) +$(eval $(call UserConfigC,DLL_METRIC,1)) +$(eval $(call TunableBothConfigMake,DEBUGLINK,1)) +else +$(error BUILD= must be either debug, release or timing) +endif + + + +# User-configurable options +# +ifeq ($(DONT_NEED_RGX_BVNC),) + $(eval $(call TunableBothConfigC,RGX_BVNC_CORE_KM_HEADER,)) + $(eval $(call TunableBothConfigC,RGX_BVNC_CORE_HEADER,)) + $(eval $(call TunableBothConfigC,RGX_BNC_CONFIG_KM_HEADER,)) + $(eval $(call TunableBothConfigC,RGX_BNC_CONFIG_HEADER,)) + endif + +$(eval $(call TunableBothConfigC,SUPPORT_DBGDRV_EVENT_OBJECTS,1)) +$(eval $(call TunableBothConfigC,PVR_DBG_BREAK_ASSERT_FAIL,,\ +Enable this to treat PVR_DBG_BREAK as PVR_ASSERT(0)._\ +Otherwise it is ignored._\ +)) +$(eval $(call TunableBothConfigC,PDUMP,,\ +Enable parameter dumping in the driver._\ +This adds code to record the parameters being sent to the hardware for_\ +later analysis._\ +)) +PDUMP_STREAMBUF_SIZE_MB ?= 16 +$(eval $(call TunableBothConfigC,PDUMP_STREAMBUF_MAX_SIZE_MB,$(PDUMP_STREAMBUF_SIZE_MB),)) +$(eval $(call TunableBothConfigC,NO_HARDWARE,,\ +Disable hardware interactions (e.g. register writes) that the driver would_\ +normally perform. A driver built with this option can$(apos)t drive hardware$(comma)_\ +but with PDUMP enabled$(comma) it can capture parameters to be played back later._\ +)) +$(eval $(call TunableBothConfigC,PDUMP_DEBUG_OUTFILES,)) +$(eval $(call TunableBothConfigC,SYS_USING_INTERRUPTS,1)) +$(eval $(call TunableBothConfigC,PVRSRV_NEED_PVR_DPF,,\ +Enable this to turn on PVR_DPF in release builds._\ +)) +$(eval $(call TunableBothConfigC,PVRSRV_NEED_PVR_ASSERT,,\ +Enable this to turn on PVR_ASSERT in release builds._\ +)) +$(eval $(call TunableBothConfigC,PVRSRV_NEED_PVR_TRACE,,\ +Enable this to turn on PVR_TRACE in release builds._\ +)) +$(eval $(call TunableBothConfigC,REFCOUNT_DEBUG,)) +$(eval $(call TunableBothConfigC,DC_DEBUG,)) +$(eval $(call TunableBothConfigC,SCP_DEBUG,)) +$(eval $(call TunableBothConfigC,CACHEFLUSH_TYPE,CACHEFLUSH_GENERIC)) +$(eval $(call TunableBothConfigC,SUPPORT_INSECURE_EXPORT,)) +$(eval $(call TunableBothConfigC,SUPPORT_SECURE_EXPORT,1,\ +Enable support for secure device memory and sync export._\ +This replaces export handles with file descriptors$(comma) which can be passed_\ +between processes to share memory._\ +)) +$(eval $(call TunableBothConfigC,SUPPORT_GPUTRACE_EVENTS,)) +$(eval $(call TunableBothConfigC,SUPPORT_KERNEL_HWPERF,)) +$(eval $(call TunableBothConfigC,SUPPORT_DISPLAY_CLASS,)) +$(eval $(call TunableBothConfigC,PVRSRV_DEBUG_CCB_MAX,)) +$(eval $(call TunableBothConfigC,SUPPORT_TRUSTED_DEVICE,)) +$(eval $(call TunableBothConfigC,SUPPORT_GPUVIRT_VALIDATION,)) +$(eval $(call TunableBothConfigC,GPUVIRT_VALIDATION_NUM_OS,8)) +$(eval $(call TunableBothConfigC,TRUSTED_DEVICE_DEFAULT_ENABLED,)) +$(eval $(call TunableBothConfigC,SUPPORT_EXPORTING_MEMORY_CONTEXT,)) +$(eval $(call TunableBothConfigMake,SUPPORT_USER_REGISTER_CONFIGURATION,)) +$(eval $(call TunableBothConfigC,SUPPORT_USER_REGISTER_CONFIGURATION,)) +$(eval $(call TunableBothConfigC,SUPPORT_VALIDATION,)) +$(eval $(call TunableBothConfigC,FIX_DUSTS_POW_ON_INIT,)) +$(eval $(call TunableBothConfigC,PVR_DVFS,,\ +Enables PVR DVFS implementation to actively change frequency / voltage depending_\ +on current GPU load. Currently only supported on Linux._\ +)) +$(eval $(call TunableBothConfigC,PVR_POWER_ACTOR,,\ +Enables PVR power actor implementation for registration with a kernel configured_\ +with IPA. Enables power counter measurement timer in the FW which is periodicaly_\ +read by the host DVFS in order to operate within a governor set power envelope._\ +)) +$(eval $(call TunableBothConfigC,PVR_POWER_ACTOR_SCALING,,\ +Scaling factor for the dynamic power coefficients._\ +)) +$(eval $(call TunableKernelConfigC,PVR_POWER_ACTOR_DEBUG,,\ +Enable debug logging for power actor._\ +)) +$(eval $(call TunableKernelConfigC,DEBUG_HANDLEALLOC_INFO_KM,)) +$(eval $(call TunableKernelConfigC,SUPPORT_LINUX_X86_WRITECOMBINE,1)) +$(eval $(call TunableKernelConfigC,SUPPORT_LINUX_X86_PAT,1)) +$(eval $(call TunableKernelConfigC,PVRSRV_RESET_ON_HWTIMEOUT,)) +$(eval $(call TunableKernelConfigC,PVR_LINUX_USING_WORKQUEUES,)) +$(eval $(call TunableKernelConfigC,PVR_LINUX_MISR_USING_WORKQUEUE,)) +$(eval $(call TunableKernelConfigC,PVR_LINUX_MISR_USING_PRIVATE_WORKQUEUE,)) +$(eval $(call TunableKernelConfigC,PVR_LINUX_TIMERS_USING_WORKQUEUES,)) +$(eval $(call TunableKernelConfigC,PVR_LINUX_TIMERS_USING_SHARED_WORKQUEUE,)) +$(eval $(call TunableKernelConfigC,PVR_LDM_PLATFORM_PRE_REGISTERED,)) +$(eval $(call TunableKernelConfigC,PVR_LDM_DRIVER_REGISTRATION_NAME,"\"$(PVRSRV_MODNAME)\"")) +$(eval $(call TunableBothConfigC,LDM_PLATFORM,)) +$(eval $(call TunableBothConfigC,LDM_PCI,)) +$(eval $(call TunableBothConfigC,PVRSRV_ENABLE_FULL_SYNC_TRACKING,)) +$(eval $(call TunableKernelConfigC,PVRSRV_FULL_SYNC_TRACKING_HISTORY_LEN,256)) +$(eval $(call TunableKernelConfigC,PVRSRV_ENABLE_FULL_CCB_DUMP,)) +$(eval $(call TunableKernelConfigC,SYNC_DEBUG,)) +$(eval $(call TunableKernelConfigC,SUPPORT_DUMP_CLIENT_CCB_COMMANDS,)) +$(eval $(call TunableKernelConfigC,PVR_LINUX_DONT_USE_RANGE_BASED_INVALIDATE,)) +$(eval $(call TunableKernelConfigC,SUPPORT_MMU_PxE_MAP_ON_DEMAND,)) +$(eval $(call TunableKernelConfigC,SUPPORT_MMU_MODIFICATION_LOGGING,,\ +Enable support for logging of page table modifications. This is as debug_\ +feature for use when debugging page-faults which are showing what look to_\ +be unexpected values. It keeps a history of the last few modifications types_\ +(map/unmap) and the value written during as a result of that operation._\ +)) +$(eval $(call TunableKernelConfigC,SUPPORT_MMU_PAGESIZECONFIG_REFCOUNT,)) +$(eval $(call TunableKernelConfigC,SUPPORT_DC_COMPLETE_TIMEOUT_DEBUG,)) +$(eval $(call TunableKernelConfigC,SUPPORT_SYSTEM_INTERRUPT_HANDLING,,\ +Enable support for system level interrupt handling. This is intended_\ +for use on systems that have two or more levels of interrupt registers_\ +which require the top level register to be cleared by the system layer_\ +because it is not specific to one single device._\ +)) + +$(eval $(call TunableBothConfigC,SUPPORT_PVR_VALGRIND,)) + + +$(eval $(call TunableBothConfigC,PVRSRV_DEVMEM_SAFE_MEMSETCPY,,\ +Enable this to force the use of *DeviceMemSet/Copy in the drvier _\ +instead of the built-in libc functions. These implemenations are device _\ +memory safe and are used by default on AARCH64 platform._\ +)) + +$(eval $(call TunableBothConfigC,PVRSRV_BRIDGE_LOGGING,)) + + + +ifneq ($(SUPPORT_ANDROID_PLATFORM),1) + endif + +ifneq ($(DWARF_DEBUG), 1) + endif + +$(eval $(call TunableBothConfigMake,CACHEFLUSH_TYPE,CACHEFLUSH_GENERIC)) +$(eval $(call TunableBothConfigMake,PDUMP,)) +$(eval $(call TunableBothConfigMake,SUPPORT_INSECURE_EXPORT,)) +$(eval $(call TunableBothConfigMake,SUPPORT_SECURE_EXPORT,1)) +$(eval $(call TunableBothConfigMake,SUPPORT_DISPLAY_CLASS,)) +$(eval $(call TunableBothConfigMake,SUPPORT_RAY_TRACING,)) +$(eval $(call TunableBothConfigC,FORCE_DM_OVERLAP,)) +$(eval $(call TunableBothConfigC,SUPPORT_EXTRA_METASP_DEBUG,)) +$(eval $(call TunableBothConfigC,GPU_UTIL_SLC_STALL_COUNTERS,)) + +$(eval $(call TunableBothConfigMake,SUPPORT_GPUTRACE_EVENTS,)) +$(eval $(call TunableBothConfigMake,SUPPORT_KERNEL_HWPERF,)) + +$(eval $(call TunableBothConfigMake,OPTIM,,\ +Specify the optimisation flags passed to the compiler. Normally this_\ +is autoconfigured based on the build type._\ +)) +$(eval $(call TunableBothConfigC,SUPPORT_PERCONTEXT_FREELIST,1)) +$(eval $(call TunableBothConfigC,SUPPORT_MMU_FREELIST,)) +$(eval $(call TunableBothConfigC,SUPPORT_VFP,)) + +$(eval $(call TunableBothConfigC,SUPPORT_META_SLAVE_BOOT,)) + +$(eval $(call UserConfigC,EGL_BASENAME_SUFFIX,\"$(EGL_BASENAME_SUFFIX)\")) + + + + + +$(eval $(call TunableBothConfigC,PVR_TESTING_UTILS,,\ +Enable this to build in support for testing the PVR Transport Layer API._\ +)) + + +TQ_CAPTURE_PARAMS ?= 1 + +$(eval $(call TunableBothConfigC,TDMETACODE,)) +$(eval $(call TunableBothConfigC,PVR_DPF_ADHOC_DEBUG_ON,)) +$(eval $(call TunableBothConfigC,RGXFW_DEBUG_LOG_GROUP,)) +$(eval $(call TunableBothConfigC,SUPPORT_POWMON_WO_GPIO_PIN,)) + + +$(eval $(call TunableKernelConfigMake,PVR_HANDLE_BACKEND,idr,\ +Specifies the back-end that should be used$(comma) by the Services kernel handle_\ +interface$(comma) to allocate handles. The available backends are:_\ +* generic (OS agnostic)_\ +* idr (Uses the Linux IDR interface)_\ +)) + + +$(eval $(call TunableBothConfigC,PVRSRV_ENABLE_PROCESS_STATS,1,\ +Enable Process Statistics via DebugFS._\ +)) + +$(eval $(call TunableBothConfigC,SUPPORT_SHARED_SLC,,\ +When the SLC is shared the SLC reset is performed by the System layer when \ +calling RGXInitSLC and not the GPU driver. Define this for system layer \ +SLC handling. \ +)) + +# PVR_RI_DEBUG is set to enable RI annotation of devmem allocations +# This is enabled by default for debug builds. +# +$(eval $(call TunableBothConfigMake,PVR_RI_DEBUG,)) +$(eval $(call TunableBothConfigC,PVR_RI_DEBUG,,\ +Enable Resource Information (RI) debug. This logs details of_\ +resource allocations with annotation to help indicate their use._\ +)) + +$(eval $(call TunableBothConfigMake,SUPPORT_PAGE_FAULT_DEBUG,)) +$(eval $(call TunableBothConfigC,SUPPORT_PAGE_FAULT_DEBUG,,\ +Collect information about allocations such as descriptive strings_\ +and timing data for more detailed page fault analysis._\ +)) + +$(eval $(call TunableBothConfigC,PVRSRV_ENABLE_MEMORY_STATS,,\ +Enable Memory allocations to be recorded and published via Process Statistics._\ +)) + +$(eval $(call TunableKernelConfigC,PVRSRV_ENABLE_FW_TRACE_DEBUGFS,,\ +Enable automatic decoding of Firmware Trace via DebugFS._\ +)) + +$(eval $(call TunableBothConfigC,PVR_LINUX_PHYSMEM_MAX_POOL_PAGES,10240)) + +$(eval $(call TunableBothConfigC,PVR_MMAP_USE_VM_INSERT,,\ +If enabled Linux will always use vm_insert_page for CPU mappings._\ +vm_insert_page was found to be slower than remap_pfn_range on ARM kernels_\ +but guarantees full memory accounting for the process that mapped the memory.\ +The slowdown in vm_insert_page is caused by a dcache flush_\ +that is only implemented for ARM and a few other architectures._\ +This tunable can be enabled to debug memory issues. On x86 platforms_\ +we always use vm_insert_page independent of this tunable._\ +)) + +# ARM-Linux specific: +# When allocating uncached or write-combine memory we need to invalidate the +# CPU cache before we can use the acquired pages. +# The threshhold defines at which number of pages we want to do a full +# cache flush instead of invalidating pages one by one. +$(eval $(call TunableBothConfigC,PVR_LINUX_ARM_PAGEALLOC_FLUSH_THRESHOLD, 256)) + +# Choose the threshold at which iterative page-by-page ('n' 1 page allocs) +# allocation is replaced with multiple block (1 'n' page alloc) allocation; +# for PVR_LINUX_PHYSMEM_MAX_ALLOC_ORDER, the valid range is [0:MAX_ORDER-1] +# NOTE: To disable higher-order allocation, set XXX_MAX_ALLOC_ORDER to zero +$(eval $(call TunableBothConfigC,PVR_LINUX_PHYSMEM_MIN_NUM_PAGES, 256 )) +$(eval $(call TunableBothConfigC,PVR_LINUX_PHYSMEM_MAX_ALLOC_ORDER, 2 )) + +# Choose the threshold at which allocation size we want to use vmalloc instead of +# kmalloc. On highly fragmented systems large kmallocs can fail because it requests +# physically contiguous pages. All allocations bigger than this define use vmalloc. +$(eval $(call TunableBothConfigC,PVR_LINUX_KMALLOC_ALLOCATION_THRESHOLD, 16384 )) + +# Tunable RGX_MAX_TA_SYNCS / RGX_MAX_3D_SYNCS to increase the size of sync array in the DDK +# If defined, these macros take up the values as defined in the environment, +# Else, the default value is taken up as defined in include/rgxapi.h +# + +$(eval $(call TunableBothConfigMake,SUPPORT_KERNEL_SRVINIT,)) +$(eval $(call TunableBothConfigC,SUPPORT_KERNEL_SRVINIT,)) + + +$(eval $(call TunableKernelConfigC,PVRSRV_SPLIT_LARGE_OSMEM_ALLOC,,\ +Splits some critical allocations greater than page size into_\ +two allocations: multiple page size and allocation size minus multiple_\ +page size._\ +)) + +$(eval $(call TunableKernelConfigC,PVRSRV_FORCE_SLOWER_VMAP_ON_64BIT_BUILDS,,\ +If enabled, all kernel mappings will use vmap/vunmap._\ +vmap/vunmap is slower than vm_map_ram/vm_unmap_ram and can_\ +even have bad peaks taking up to 100x longer than vm_map_ram._\ +The disadvantage of vm_map_ram is that it can lead to vmalloc space_\ +fragmentation that can lead to vmalloc space exhaustion on 32 bit Linux systems._\ +This flag only affects 64 bit Linux builds, on 32 bit we always default to use vmap_\ +because of the described fragmentation problem._\ +)) + + +$(eval $(call TunableKernelConfigC,PVRSRV_DEBUG_LISR_EXECUTION,,\ +Collect information about the last execution of the LISR in order to_\ +debug interrupt handling timeouts._\ +)) + +endif # INTERNAL_CLOBBER_ONLY + +export INTERNAL_CLOBBER_ONLY +export TOP +export OUT + +MAKE_ETC := -Rr --no-print-directory -C $(TOP) TOP=$(TOP) OUT=$(OUT) \ + -f build/linux/toplevel.mk + +# This must match the default value of MAKECMDGOALS below, and the default +# goal in toplevel.mk +.DEFAULT_GOAL := build + +ifeq ($(MAKECMDGOALS),) +MAKECMDGOALS := build +else +# We can't pass autogen to toplevel.mk +MAKECMDGOALS := $(filter-out autogen,$(MAKECMDGOALS)) +endif + +.PHONY: autogen +autogen: +ifeq ($(INTERNAL_CLOBBER_ONLY),) + @$(MAKE) -s --no-print-directory -C $(TOP) \ + -f build/linux/prepare_tree.mk \ + LDM_PCI=$(LDM_PCI) \ + LDM_PLATFORM=$(LDM_PLATFORM) +else + @: +endif + +include ../config/help.mk + +# This deletes built-in suffix rules. Otherwise the submake isn't run when +# saying e.g. "make thingy.a" +.SUFFIXES: + +# Because we have a match-anything rule below, we'll run the main build when +# we're actually trying to remake various makefiles after they're read in. +# These rules try to prevent that +%.mk: ; +Makefile%: ; +Makefile: ; + +.PHONY: build kbuild install +build kbuild install: autogen + @$(if $(MAKECMDGOALS),$(MAKE) $(MAKE_ETC) $(MAKECMDGOALS) $(eval MAKECMDGOALS :=),:) + +%: autogen + @$(if $(MAKECMDGOALS),$(MAKE) $(MAKE_ETC) $(MAKECMDGOALS) $(eval MAKECMDGOALS :=),:) diff --git a/drivers/gpu/rogue_m/build/linux/config/help.mk b/drivers/gpu/rogue_m/build/linux/config/help.mk new file mode 100644 index 000000000000..4d6ef013bca7 --- /dev/null +++ b/drivers/gpu/rogue_m/build/linux/config/help.mk @@ -0,0 +1,74 @@ +########################################################################### ### +#@File +#@Title Targets for printing config option help +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +define newline + + +endef +empty := + +define abbrev-option-value +$(if $(word 6,$(1)),$(wordlist 1,5,$(1))...,$(1)) +endef + +define print-option-help +# Print the option name and value +$(info $(1) ($(if $($(1)),$(call abbrev-option-value,$($(1))),), default $(if $(INTERNAL_CONFIG_DEFAULT_FOR_$(1)),$(call abbrev-option-value,$(INTERNAL_CONFIG_DEFAULT_FOR_$(1))),))$(if $(INTERNAL_DESCRIPTION_FOR_$(1)),:,)) +# Ensure the config help text ends with a newline +$(and $(INTERNAL_DESCRIPTION_FOR_$(1)),$(if $(filter %_,$(word $(words $(INTERNAL_DESCRIPTION_FOR_$(1))),$(INTERNAL_DESCRIPTION_FOR_$(1)))),,$(eval INTERNAL_DESCRIPTION_FOR_$(1) := $(INTERNAL_DESCRIPTION_FOR_$(1))_ ))) +# Print the config help text +$(info $(empty) $(subst _ ,$(newline) ,$(INTERNAL_DESCRIPTION_FOR_$(1)))) +endef + +.PHONY: confighelp allconfighelp +# Show only the config options that have help text +confighelp: + @: $(foreach _o,$(sort $(ALL_TUNABLE_OPTIONS)),$(if $(INTERNAL_DESCRIPTION_FOR_$(_o)),$(call print-option-help,$(_o)),)) +# Show all the config options +allconfighelp: + @: $(foreach _o,$(sort $(ALL_TUNABLE_OPTIONS)),$(call print-option-help,$(_o))) + + +ifneq ($(filter confighelp-%,$(MAKECMDGOALS)),) +confighelp-%: + @: $(if $(filter $*,$(ALL_TUNABLE_OPTIONS)),$(call print-option-help,$*),$(info $* is not a tunable config option)) +endif diff --git a/drivers/gpu/rogue_m/build/linux/config/kernel_version.mk b/drivers/gpu/rogue_m/build/linux/config/kernel_version.mk new file mode 100644 index 000000000000..35ecceb354a3 --- /dev/null +++ b/drivers/gpu/rogue_m/build/linux/config/kernel_version.mk @@ -0,0 +1,100 @@ +########################################################################### ### +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +$(if $(KERNELDIR),,$(error KERNELDIR must be set to obtain a version)) + +override KERNEL_VERSION := \ + $(shell grep "^VERSION = " $(KERNELDIR)/Makefile | cut -f3 -d' ') +override KERNEL_PATCHLEVEL := \ + $(shell grep "^PATCHLEVEL = " $(KERNELDIR)/Makefile | cut -f3 -d' ') +override KERNEL_SUBLEVEL := \ + $(shell grep "^SUBLEVEL = " $(KERNELDIR)/Makefile | cut -f3 -d' ') +override KERNEL_EXTRAVERSION := \ + $(shell grep "^EXTRAVERSION = " $(KERNELDIR)/Makefile | cut -f3 -d' ') + +# Break the kernel version up into a space separated list +kernel_version_as_list := $(KERNEL_VERSION) \ + $(KERNEL_PATCHLEVEL) \ + $(KERNEL_SUBLEVEL) \ + $(patsubst .%,%,$(KERNEL_EXTRAVERSION)) + +# The base ID doesn't have to be accurate; we only use it for +# feature checks which will not care about extraversion bits +# +override KERNEL_BASE_ID := \ + $(KERNEL_VERSION).$(KERNEL_PATCHLEVEL).$(KERNEL_SUBLEVEL) + +# Try to get the kernel ID from the kernel.release file. +# +KERNEL_ID ?= \ + $(shell cat $(KERNELDIR)/include/config/kernel.release 2>/dev/null) + +# If the kernel ID isn't set yet, try to set it from the UTS_RELEASE +# macro. +# +ifeq ($(strip $(KERNEL_ID)),) +KERNEL_ID := \ + $(shell grep -h '\#define UTS_RELEASE' \ + $(KERNELDIR)/include/linux/* | cut -f3 -d' ' | sed s/\"//g) +endif + +ifeq ($(strip $(KERNEL_ID)),) +KERNEL_ID := \ + $(KERNEL_VERSION).$(KERNEL_PATCHLEVEL).$(KERNEL_SUBLEVEL)$(KERNEL_EXTRAVERSION) +endif + +# Return 1 if the kernel version is at least the value passed to the +# function, else return nothing. +# Examples +# $(call kernel-version-at-least,2,6,35) +# $(call kernel-version-at-least,2,6,35,7) +# +define kernel-version-at-least +$(shell set -- $(kernel_version_as_list) 0 0 0 0; \ + Y=true; \ + for D in $1 $2 $3 $4; \ + do \ + [ $$1 ] || break; \ + [ $$1 -eq $$D ] && { shift; continue; };\ + [ $$1 -lt $$D ] && Y=; \ + break; \ + done; \ + echo $$Y) +endef diff --git a/drivers/gpu/rogue_m/build/linux/config/preconfig.mk b/drivers/gpu/rogue_m/build/linux/config/preconfig.mk new file mode 100644 index 000000000000..041508e9ff12 --- /dev/null +++ b/drivers/gpu/rogue_m/build/linux/config/preconfig.mk @@ -0,0 +1,157 @@ +########################################################################### ### +#@File +#@Title Set up configuration required by build-directory Makefiles +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +# NOTE: Don't put anything in this file that isn't strictly required +# by the build-directory Makefiles. It should go in core.mk otherwise. + +TOP := $(abspath ../../..) + +# Some miscellaneous things to make comma substitutions easier. +apos := '#' +comma := , +empty := +space := $(empty) $(empty) + +ifneq ($(words $(TOP)),1) +$(warning This source tree is located in a path which contains whitespace,) +$(warning which is not supported.) +$(warning ) +$(warning $(space)The root is: $(TOP)) +$(warning ) +$(error Whitespace found in $$(TOP)) +endif + +$(call directory-must-exist,$(TOP)) + +ifneq ($(SUPPORT_NEUTRINO_PLATFORM),1) + +CC_CHECK := ../tools/cc-check.sh +CHMOD := chmod + +# GNU Make has builtin values for CC/CXX which we don't want to trust. This +# is because $(CROSS_COMPILE)$(CC) doesn't always expand to a cross compiler +# toolchain binary name (e.g. most toolchains have 'gcc' but not 'cc'). + +ifeq ($(origin CC),default) + _CC := $(CROSS_COMPILE)gcc + CC := gcc +else + _CLANG := $(shell $(CC_CHECK) --clang --cc $(CC)) + ifeq ($(_CLANG),true) + _CC := $(CC) -target $(patsubst %-,%,$(CROSS_COMPILE)) + else + _CC := $(CC) + endif +endif + +ifeq ($(origin CXX),default) + _CXX := $(CROSS_COMPILE)g++ + CXX := g++ +else + _CLANGXX := $(shell $(CC_CHECK) --clang --cc $(CXX)) + ifeq ($(_CLANGXX),true) + _CXX := $(CXX) -target $(patsubst %-,%,$(CROSS_COMPILE)) + else + _CXX := $(CXX) + endif +endif + +CC_SECONDARY ?= $(CC) +HOST_CC ?= gcc + +# Work out if we are targeting ARM before we start tweaking _CC. +TARGETING_AARCH64 := $(shell \ + $(_CC) -dM -E - /dev/null 2>&1 && echo 1) + +TARGETING_MIPS := $(shell \ + $(_CC) -dM -E - /dev/null 2>&1 && echo 1) + +HOST_CC_IS_LINUX := $(shell \ + $(HOST_CC) -dM -E - /dev/null 2>&1 && echo 1) + +ifneq ($(strip $(KERNELDIR)),) +include ../config/kernel_version.mk +endif + +# The user didn't set CROSS_COMPILE. There's probably nothing wrong +# with that, but we'll let them know anyway. +# +ifeq ($(origin CROSS_COMPILE), undefined) +$(warning CROSS_COMPILE is not set. Target components will be built with the host compiler) +endif + +endif # !Neutrino + +# The user is trying to set one of the old SUPPORT_ options on the +# command line or in the environment. This isn't supported any more +# and will often break the build. The user is generally only trying +# to remove a component from the list of targets to build, so we'll +# point them at the new way of doing this. +define sanity-check-support-option-origin +ifeq ($$(filter undefined file,$$(origin $(1))),) +$$(warning *** Setting $(1) via $$(origin $(1)) is deprecated) +$$(error If you are trying to disable a component, use e.g. EXCLUDED_APIS="opengles1 opengl") +endif +endef +$(foreach _o,SYS_CFLAGS SYS_CXXFLAGS SYS_INCLUDES SYS_EXE_LDFLAGS SYS_LIB_LDFLAGS,$(eval $(call sanity-check-support-option-origin,$(_o)))) + +# Check for words in EXCLUDED_APIS that aren't understood by the +# common/apis/*.mk files. This should be kept in sync with all the tests on +# EXCLUDED_APIS in those files +_excludable_apis := opencl opengl opengles1 opengles3 openrl unittests renderscript scripts composerhal servicestools hwperftools testchiptools rogue2d memtrackhal camerahal sensorhal +_excluded_apis := $(subst $(comma),$(space),$(EXCLUDED_APIS)) + +_unrecognised := $(strip $(filter-out $(_excludable_apis),$(_excluded_apis))) +ifneq ($(_unrecognised),) +$(warning *** Ignoring unrecognised entries in EXCLUDED_APIS: $(_unrecognised)) +$(warning *** EXCLUDED_APIS was set via $(origin EXCLUDED_APIS) to: $(EXCLUDED_APIS)) +$(warning *** Excludable APIs are: $(_excludable_apis)) +endif + +override EXCLUDED_APIS := $(filter $(_excludable_apis), $(_excluded_apis)) + +ifeq ($(SUPPORT_NEUTRINO_PLATFORM),1) +include ../common/neutrino/preconfig_neutrino.mk +endif diff --git a/drivers/gpu/rogue_m/build/linux/defs.mk b/drivers/gpu/rogue_m/build/linux/defs.mk new file mode 100644 index 000000000000..14cf6f64dc77 --- /dev/null +++ b/drivers/gpu/rogue_m/build/linux/defs.mk @@ -0,0 +1,262 @@ +########################################################################### ### +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +define must-be-defined +$(if $(filter undefined,$(origin $(1))),$(error In makefile $(THIS_MAKEFILE): $$($(1)) must be defined),) +endef + +define must-be-nonempty +$(if $(strip $($(1))),,$(error In makefile $(THIS_MAKEFILE): $$($(1)) must contain a value)) +endef + +define directory-must-exist +$(if $(wildcard $(abspath $(1)/)),,$(error Directory $(1) must exist)) +endef + +define one-word-only +$(if $(filter-out $(firstword $($(1))),$($(1))),$(error In makefile $(THIS_MAKEFILE): $$($(1)) must contain only one word),) +endef + +define module-library +$(patsubst lib%.so,%,$(if $($(1)_target),$($(1)_target),$(1).so)) +endef + +# This is done to allow module type makefiles to use $(THIS_MAKEFILE) +define register-module +INTERNAL_MAKEFILE_FOR_MODULE_$(1) := $(THIS_MAKEFILE) +endef + +define process-module-arch +MODULE_ARCH := $$(strip $(2)) +include $$(MAKE_TOP)/moduledefs_common.mk +include $$(MAKE_TOP)/moduledefs/$$(MODULE_ARCH).mk +include $$(MAKE_TOP)/modules/$$(strip $$($$(THIS_MODULE)_type)).mk +.SECONDARY: $$(MODULE_INTERMEDIATES_DIR) +$$(MODULE_INTERMEDIATES_DIR): + $$(make-directory) +MODULE_CLEAN_TARGETS += $$(MODULE_INTERMEDIATES_DIR) +INTERNAL_TARGETS_FOR_$(1) += $$(MODULE_TARGETS) +INTERNAL_CLEAN_TARGETS_FOR_$(1) += $$(MODULE_CLEAN_TARGETS) +INTERNAL_CLOBBER_TARGETS_FOR_$(1) += $$(MODULE_CLEAN_TARGETS) $$(MODULE_CLOBBER_TARGETS) $$(MODULE_TARGETS) +endef + +target_neutral_types := \ + apk \ + bison_parser \ + bridge \ + copy_files \ + custom \ + flex_lexer \ + flexxx_lexer \ + gen_dispatch \ + rsc_scriptc \ + image_header \ + inline_shaders \ + java_archive \ + module_group \ + pds_header \ + rgxfw \ + test_image \ + usc_header \ + rscbitcode_header \ + yuv_test_image + +doc_types := \ + doc \ + doxygen + +define calculate-arch-list +# Work out the target platforms for this module +MODULE_ARCH_LIST := $(2) +ifeq ($$(MODULE_ARCH_LIST),) +ifneq ($$(filter $(1),$(doc_types)),) +MODULE_ARCH_LIST := doc +else +ifneq ($$(filter $(1),$(target_neutral_types)),) +MODULE_ARCH_LIST := target_neutral +else +ifneq ($$(filter $(1),kernel_module),) +MODULE_ARCH_LIST := $(TARGET_PRIMARY_ARCH) +else +MODULE_ARCH_LIST := $(TARGET_ALL_ARCH) +endif +endif +endif +endif +endef + +define process-module +THIS_MODULE := $(1) +THIS_MAKEFILE := $(INTERNAL_MAKEFILE_FOR_MODULE_$(1)) +INTERNAL_TARGETS_FOR_$(1) := +INTERNAL_CLEAN_TARGETS_FOR_$(1) := +INTERNAL_CLOBBER_TARGETS_FOR_$(1) := +include $$(MAKE_TOP)/this_makefile.mk +$$(call must-be-nonempty,THIS_MAKEFILE) +$$(call must-be-nonempty,$(1)_type) +$$(eval $$(call calculate-arch-list,$$($(1)_type),$$($(1)_arch))) +INTERNAL_ARCH_LIST_FOR_$(1) := $$(MODULE_ARCH_LIST) +$$(foreach _m,$$(MODULE_ARCH_LIST),$$(eval $$(call process-module-arch,$(1),$$(_m)))) +endef + +# This can be used by module_type.mk files to indicate that they can't be +# built as host_module_type +define target-build-only +$(if $(filter true,$(MODULE_HOST_BUILD)),$(error In makefile $(THIS_MAKEFILE): Module $(THIS_MODULE) attempted to build a host $(1), which is not supported)) +endef + +define relative-to-top +$(patsubst $(TOP)/%,%,$(1)) +endef + +define cc-check +$(shell \ + CC_CHECK=$(patsubst @%,%,$(CC_CHECK)) && \ + $(patsubst @%,%,$(CHMOD)) +x $$CC_CHECK && \ + $$CC_CHECK --cc "$(1)" --out "$(2)" $(3)) +endef + +define cc-is-clang +$(call cc-check,$(patsubst @%,%,$(CC)),$(OUT),--clang) +endef + +define cc-option +$(call cc-check,$(patsubst @%,%,$(CC)),$(OUT),$(1)) +endef + +define cxx-option +$(call cc-check,$(patsubst @%,%,$(CXX)),$(OUT),$(1)) +endef + +define host-cc-option +$(call cc-check,$(patsubst @%,%,$(HOST_CC)),$(OUT),$(1)) +endef + +define host-cxx-option +$(call cc-check,$(patsubst @%,%,$(HOST_CXX)),$(OUT),$(1)) +endef + +define kernel-cc-option +$(call cc-check,$(KERNEL_CROSS_COMPILE)gcc,$(OUT),$(1)) +endef + +# Turn a particular warning on, or explicitly turn it off, depending on +# the value of W. The "-W" or "-Wno-" part of the warning need not be +# specified. +define cc-optional-warning +$(call cc-option,-W$(if $(W),,no-)$(patsubst -W%,%,$(patsubst -Wno-%,%,$(1)))) +endef + +define host-cc-optional-warning +$(call host-cc-option,-W$(if $(W),,no-)$(patsubst -W%,%,$(patsubst -Wno-%,%,$(1)))) +endef + +define kernel-cc-optional-warning +$(call kernel-cc-option,-W$(if $(W),,no-)$(patsubst -W%,%,$(patsubst -Wno-%,%,$(1)))) +endef + +define module-info-line +$(if $(filter modules,$(D)),$(info [$(THIS_MODULE)] <$(MODULE_ARCH)> $(1)),) +endef + +# $(call if-exists,A,B) => A if A is a file which exists, otherwise B +define if-exists +$(if $(wildcard $(1)),$(1),$(2)) +endef + +# +# Joins a given list of strings together with the given separator. +# +# (1): the list of strings to join +# (2): the separator to use for joining +# +NOOP= +SPACE=$(NOOP) $(NOOP) +define list-join +$(subst $(SPACE),$(2),$(strip $(1))) +endef + +# +# Check if a given path is absolute +# +# $(1): path to check +# $(2): return when true +# $(3): return when false +# +define if-abs-path +$(if $(filter /%,$(1)),$(2),$(3)) +endef + +# +# Add a prefix to every path in a list, when the path isn't absolute. +# +# $(1): prefix to add +# $(2): list of paths +# +define addprefix-ifnot-abs +$(foreach _path,$(2),$(call if-abs-path,$(_path),$(_path),$(1)$(_path))) +endef + +# +# Return the directory part of a path normalized (without trailing slashes) +# +# $(1): Path to normalize +# +define normalized-dir +$(if $(filter /,$(dir $(1))),$(dir $(1)),$(if $(findstring /,$(dir $(1))),$(patsubst %/,%,$(dir $(1))),$(dir $(1)))) +endef + +# Definitions to handle the various suffixes allowed for C++ files. +INTERNAL_CXX_SUFFIXES := .cc .cxx .cpp .c++ +define filter-cxx-files +$(filter $(addprefix %,$(INTERNAL_CXX_SUFFIXES)),$(1)) +endef + +define filter-out-cxx-files +$(filter-out $(addprefix %,$(INTERNAL_CXX_SUFFIXES)),$(1)) +endef + +define objects-from-cxx-files +$(foreach _suffix,$(INTERNAL_CXX_SUFFIXES),$(patsubst %$(_suffix),%.o,$(filter %$(_suffix),$(1)))) +endef + +define unsupported-module-var +$(if $(strip $($(THIS_MODULE)_$(1))),$(error In makefile $(THIS_MAKEFILE): Setting '$(THIS_MODULE)_$(1)' has no effect, because $(THIS_MODULE) has type $($(THIS_MODULE)_type))) +endef diff --git a/drivers/gpu/rogue_m/build/linux/generic_arm_android/Makefile b/drivers/gpu/rogue_m/build/linux/generic_arm_android/Makefile new file mode 100644 index 000000000000..3fb294afadfc --- /dev/null +++ b/drivers/gpu/rogue_m/build/linux/generic_arm_android/Makefile @@ -0,0 +1,122 @@ +########################################################################### ### +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +include ../config/preconfig.mk + +# If a TARGET_PRODUCT is specified but not a TARGET_DEVICE, try to +# derive the TARGET_DEVICE from TARGET_PRODUCT. +# +ifeq ($(TARGET_DEVICE),) +override TARGET_DEVICE := \ + $(patsubst mini_%,%,$(patsubst full_%,%,$(TARGET_PRODUCT))) +ifeq ($(TARGET_DEVICE),arm64_img) +override TARGET_DEVICE := arm64 +endif +ifeq ($(TARGET_DEVICE),armv7a_neon_img) +override TARGET_DEVICE := armv7-a-neon +endif +endif + +ifeq ($(TARGET_DEVICE),) +# Prefer arm64 now for MULTIARCH=1 builds. +# Use TARGET_DEVICE=armv7-a-neon for 32-bit only builds. +override TARGET_DEVICE := arm64 +endif + +ifeq ($(TARGET_DEVICE),armv7-a-neon) +# The 32-bit only Android build is still using separate toolchains for +# kernel and userspace, force this on the DDK side when it's detected. +KERNEL_CROSS_COMPILE ?= arm-eabi- +endif + +ifeq ($(MULTIARCH),1) +override TARGET_DEVICE := rk3368 +else +override TARGET_DEVICE := rk3368_32 +endif +HAL_VARIANT ?= rk3368 +PVR_SYSTEM := rk3368 +NO_HARDWARE := 0 +LDM_PLATFORM := 1 +#RGX_BVNC ?= 1.75.2.30 +#rockchip G6110 +RGX_BVNC ?= 5.9.1.46 + +include ../common/android/paths.mk +include ../common/android/arch.mk +include ../common/android/features.mk + +ifeq ($(SUPPORT_ADF),1) +ifneq ($(is_at_least_lollipop),1) +SYS_INCLUDES += \ + -isystem $(ANDROID_ROOT)/device/img/generic/adf/libadf/include \ + -isystem $(ANDROID_ROOT)/device/img/generic/adf/libadfhwc/include +endif +endif + +PVR_LDM_PLATFORM_PRE_REGISTERED := 1 + +#zxl: build adf_fbdev.ko +ifeq ($(SUPPORT_ADF),1) +ADF_FBDEV ?= adf_fbdev +KERNEL_COMPONENTS += $(ADF_FBDEV) +endif + +ifneq ($(SUPPORT_ADF),1) +ifeq ($(SUPPORT_DC),1) +DISPLAY_CONTROLLER ?= dc_fbdev +KERNEL_COMPONENTS += $(DISPLAY_CONTROLLER) +ifeq ($(DISPLAY_CONTROLLER),dc_example) +DC_EXAMPLE_WIDTH ?= 640 +DC_EXAMPLE_HEIGHT ?= 480 +DC_EXAMPLE_BIT_DEPTH ?= 32 +DC_EXAMPLE_DPI ?= 160 +endif +endif +endif + +#zxl: 3 fb buffer +DC_FBDEV_NUM_PREFERRED_BUFFERS := 3 + +CACHEFLUSH_TYPE ?= CACHEFLUSH_GENERIC + +include ../config/core.mk +include ../common/3rdparty.mk +include ../common/android/extra_config.mk diff --git a/drivers/gpu/rogue_m/build/linux/kbuild/Makefile.template b/drivers/gpu/rogue_m/build/linux/kbuild/Makefile.template new file mode 100644 index 000000000000..6d7fb6ee28f6 --- /dev/null +++ b/drivers/gpu/rogue_m/build/linux/kbuild/Makefile.template @@ -0,0 +1,95 @@ +########################################################################### ### +#@Title Root kernel makefile +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +# This top-level kbuild makefile builds all the Linux kernel modules in the +# DDK. To run kbuild, this makefile is copied to $(TARGET_PRIMARY_OUT)/kbuild/Makefile +# and make is invoked in $(TARGET_PRIMARY_OUT)/kbuild. + +# This makefile doesn't define any kbuild special variables apart from +# ccflags-y and obj-m. The variables for objects are picked up by including +# the kbuild makefile fragments named in $(INTERNAL_KBUILD_MAKEFILES). The +# list of objects that these fragments make is collected in +# $(INTERNAL_KBUILD_OBJECTS) and $(INTERNAL_EXTRA_KBUILD_OBJECTS). These +# variables are set according to the build's $(KERNEL_COMPONENTS) and +# $(EXTRA_PVRSRVKM_COMPONENTS). To add a new kernel module to the build, edit +# these variables in the per-build Makefile. + +include $(OUT)/config_kernel.mk + +.SECONDARY: + +define symlink-source-file +@if [ ! -e $(dir $@) ]; then mkdir -p $(dir $@); fi +@if [ ! -h $@ ]; then ln -sf $< $@; fi +endef + +bridge_base := $(BRIDGE_SOURCE_ROOT) + +$(OUT)/$(TARGET_PRIMARY_ARCH)/kbuild/%.c: $(TOP)/%.c + $(symlink-source-file) + +$(OUT)/$(TARGET_PRIMARY_ARCH)/kbuild/generated/%.c: $(bridge_base)/%.c + $(symlink-source-file) + +$(OUT)/$(TARGET_PRIMARY_ARCH)/kbuild/external/%.c: $(srctree)/%.c + $(symlink-source-file) + +ccflags-y += -D__linux__ -include $(OUT)/config_kernel.h \ + -I$(OUT)/include \ + -I$(TOP)/include \ + -I$(TOP)/hwdefs/km \ + -I$(TOP)/services/include \ + -I$(TOP)/services/include/shared \ + -I$(TOP)/services/shared/include \ + -I$(TOP)/services/shared/common \ + -I$(TOP)/services/system/$(PVR_SYSTEM) \ + -I$(TOP)/services/system/include \ + -I$(TOP)/services/server/common \ + -I$(TOP)/services/server/devices/rgx \ + -I$(TOP)/services/server/env/linux \ + -I$(TOP)/services/server/include + +include $(INTERNAL_KBUILD_MAKEFILES) + +$(if $(pvrsrvkm-y),,$(error pvrsrvkm-y was empty, which could mean that srvkm is missing from $$(KERNEL_COMPONENTS))) +pvrsrvkm-y += $(foreach _m,$(INTERNAL_EXTRA_KBUILD_OBJECTS:.o=),$($(_m)-y)) + +obj-m += $(INTERNAL_KBUILD_OBJECTS) diff --git a/drivers/gpu/rogue_m/build/linux/kbuild/kbuild.mk b/drivers/gpu/rogue_m/build/linux/kbuild/kbuild.mk new file mode 100644 index 000000000000..766cdb3f2713 --- /dev/null +++ b/drivers/gpu/rogue_m/build/linux/kbuild/kbuild.mk @@ -0,0 +1,94 @@ +########################################################################### ### +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +$(TARGET_PRIMARY_OUT)/kbuild/Makefile: $(MAKE_TOP)/kbuild/Makefile.template + @[ ! -e $(dir $@) ] && mkdir -p $(dir $@) || true + $(CP) -f $< $@ + +# We need to make INTERNAL_KBUILD_MAKEFILES absolute because the files will be +# read while chdir'd into $(KERNELDIR) +INTERNAL_KBUILD_MAKEFILES := $(abspath $(foreach _m,$(KERNEL_COMPONENTS) $(EXTRA_PVRSRVKM_COMPONENTS),$(if $(INTERNAL_KBUILD_MAKEFILE_FOR_$(_m)),$(INTERNAL_KBUILD_MAKEFILE_FOR_$(_m)),$(error Unknown kbuild module "$(_m)")))) +INTERNAL_KBUILD_OBJECTS := $(foreach _m,$(KERNEL_COMPONENTS),$(if $(INTERNAL_KBUILD_OBJECTS_FOR_$(_m)),$(INTERNAL_KBUILD_OBJECTS_FOR_$(_m)),$(error BUG: Unknown kbuild module "$(_m)" should have been caught earlier))) +INTERNAL_EXTRA_KBUILD_OBJECTS := $(foreach _m,$(EXTRA_PVRSRVKM_COMPONENTS),$(if $(INTERNAL_KBUILD_OBJECTS_FOR_$(_m)),$(INTERNAL_KBUILD_OBJECTS_FOR_$(_m)),$(error BUG: Unknown kbuild module "$(_m)" should have been caught earlier))) +.PHONY: kbuild kbuild_clean kbuild_check + +kbuild_check: + @: $(if $(strip $(KERNELDIR)),,$(error KERNELDIR must be set)) + @: $(call directory-must-exist,$(KERNELDIR)) + @: $(foreach _m,$(ALL_KBUILD_MODULES),$(if $(wildcard $(abspath $(INTERNAL_KBUILD_MAKEFILE_FOR_$(_m)))),,$(error In makefile $(INTERNAL_MAKEFILE_FOR_MODULE_$(_m)): Module $(_m) requires kbuild makefile $(INTERNAL_KBUILD_MAKEFILE_FOR_$(_m)), which is missing))) + @: $(if $(filter-out command line override,$(origin build)),,$(error Overriding $$(build) (with "make build=...") will break kbuild)) + +# Services server headers are generated as part of running the bridge +# generator, which might be included in KM code. So as well as depending on +# the kbuild Makefile, we need to make kbuild also depend on each bridge +# module (including direct bridges), so that 'make kbuild' in a clean tree +# works. +kbuild: kbuild_check $(TARGET_PRIMARY_OUT)/kbuild/Makefile $(BRIDGES) $(DIRECT_BRIDGES) + $(if $(V),,@)$(MAKE) -Rr --no-print-directory -C $(KERNELDIR) \ + M=$(abspath $(TARGET_PRIMARY_OUT)/kbuild) \ + INTERNAL_KBUILD_MAKEFILES="$(INTERNAL_KBUILD_MAKEFILES)" \ + INTERNAL_KBUILD_OBJECTS="$(INTERNAL_KBUILD_OBJECTS)" \ + INTERNAL_EXTRA_KBUILD_OBJECTS="$(INTERNAL_EXTRA_KBUILD_OBJECTS)" \ + BRIDGE_SOURCE_ROOT=$(abspath $(BRIDGE_SOURCE_ROOT)) \ + TARGET_PRIMARY_ARCH=$(TARGET_PRIMARY_ARCH) \ + CROSS_COMPILE="$(CCACHE) $(KERNEL_CROSS_COMPILE)" \ + EXTRA_CFLAGS="$(ALL_KBUILD_CFLAGS)" \ + CC=$(KERNEL_CROSS_COMPILE)gcc V=$(V) W=$(W) \ + CHECK="$(patsubst @%,%,$(CHECK))" $(if $(CHECK),C=1,) \ + TOP=$(TOP) + @for kernel_module in $(addprefix $(TARGET_PRIMARY_OUT)/kbuild/,$(INTERNAL_KBUILD_OBJECTS:.o=.ko)); do \ + cp $$kernel_module $(TARGET_PRIMARY_OUT); \ + done + +kbuild_clean: kbuild_check $(TARGET_PRIMARY_OUT)/kbuild/Makefile + $(if $(V),,@)$(MAKE) -Rr --no-print-directory -C $(KERNELDIR) \ + M=$(abspath $(TARGET_PRIMARY_OUT)/kbuild) \ + INTERNAL_KBUILD_MAKEFILES="$(INTERNAL_KBUILD_MAKEFILES)" \ + INTERNAL_KBUILD_OBJECTS="$(INTERNAL_KBUILD_OBJECTS)" \ + INTERNAL_EXTRA_KBUILD_OBJECTS="$(INTERNAL_EXTRA_KBUILD_OBJECTS)" \ + BRIDGE_SOURCE_ROOT=$(abspath $(BRIDGE_SOURCE_ROOT)) \ + TARGET_PRIMARY_ARCH=$(TARGET_PRIMARY_ARCH) \ + CROSS_COMPILE="$(CCACHE) $(KERNEL_CROSS_COMPILE)" \ + EXTRA_CFLAGS="$(ALL_KBUILD_CFLAGS)" \ + CC=$(KERNEL_CROSS_COMPILE)gcc V=$(V) W=$(W) \ + TOP=$(TOP) clean + +kbuild_install: install +kbuild: install_script_km diff --git a/drivers/gpu/rogue_m/build/linux/moduledefs/host_i386.mk b/drivers/gpu/rogue_m/build/linux/moduledefs/host_i386.mk new file mode 100644 index 000000000000..b6bb23ff3ad2 --- /dev/null +++ b/drivers/gpu/rogue_m/build/linux/moduledefs/host_i386.mk @@ -0,0 +1,62 @@ +########################################################################### ### +#@File +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +MODULE_HOST_BUILD := true + +MODULE_CC := $(HOST_CC) $(HOST_FORCE_32BIT) +MODULE_CXX := $(HOST_CXX) $(HOST_FORCE_32BIT) + +MODULE_CFLAGS := $(ALL_HOST_CFLAGS) $($(THIS_MODULE)_cflags) $(HOST_FORCE_32BIT) +MODULE_CXXFLAGS := $(ALL_HOST_CXXFLAGS) $($(THIS_MODULE)_cxxflags) $(HOST_FORCE_32BIT) +MODULE_LDFLAGS := $(ALL_HOST_LDFLAGS) -L$(MODULE_OUT) $($(THIS_MODULE)_ldflags) $(HOST_FORCE_32BIT) + +ifneq ($(BUILD),debug) +ifeq ($(USE_LTO),1) +MODULE_LDFLAGS := \ + $(sort $(filter-out -W% -D%,$(ALL_HOST_CFLAGS) $(ALL_HOST_CXXFLAGS))) \ + $(MODULE_LDFLAGS) +endif +endif + +ifeq ($(SUPPORT_NEUTRINO_PLATFORM),1) +include $(MAKE_TOP)/common/neutrino/extra_host.mk +else +endif diff --git a/drivers/gpu/rogue_m/build/linux/moduledefs/host_x86_64.mk b/drivers/gpu/rogue_m/build/linux/moduledefs/host_x86_64.mk new file mode 100644 index 000000000000..4c50c621824c --- /dev/null +++ b/drivers/gpu/rogue_m/build/linux/moduledefs/host_x86_64.mk @@ -0,0 +1,62 @@ +########################################################################### ### +#@File +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +MODULE_HOST_BUILD := true + +MODULE_CC := $(HOST_CC) +MODULE_CXX := $(HOST_CXX) + +MODULE_CFLAGS := $(ALL_HOST_CFLAGS) $($(THIS_MODULE)_cflags) +MODULE_CXXFLAGS := $(ALL_HOST_CXXFLAGS) $($(THIS_MODULE)_cxxflags) +MODULE_LDFLAGS := $(ALL_HOST_LDFLAGS) -L$(MODULE_OUT) $($(THIS_MODULE)_ldflags) + +ifneq ($(BUILD),debug) +ifeq ($(USE_LTO),1) +MODULE_LDFLAGS := \ + $(sort $(filter-out -W% -D%,$(ALL_HOST_CFLAGS) $(ALL_HOST_CXXFLAGS))) \ + $(MODULE_LDFLAGS) +endif +endif + +ifeq ($(SUPPORT_NEUTRINO_PLATFORM),1) +include $(MAKE_TOP)/common/neutrino/extra_host.mk +else +endif diff --git a/drivers/gpu/rogue_m/build/linux/moduledefs/target_aarch64.mk b/drivers/gpu/rogue_m/build/linux/moduledefs/target_aarch64.mk new file mode 100644 index 000000000000..f821ed7dea7e --- /dev/null +++ b/drivers/gpu/rogue_m/build/linux/moduledefs/target_aarch64.mk @@ -0,0 +1,98 @@ +########################################################################### ### +#@File +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +MODULE_CC := $(CC) +MODULE_CXX := $(CXX) + +MODULE_CFLAGS := $(ALL_CFLAGS) $($(THIS_MODULE)_cflags) +MODULE_CXXFLAGS := $(ALL_CXXFLAGS) $($(THIS_MODULE)_cxxflags) +MODULE_LDFLAGS := $(ALL_LDFLAGS) $($(THIS_MODULE)_ldflags) -L$(MODULE_OUT) -Xlinker -rpath-link=$(MODULE_OUT) + +# Since this is a target module, add system-specific include flags. +MODULE_INCLUDE_FLAGS := $(SYS_INCLUDES) $(MODULE_INCLUDE_FLAGS) + +ifneq ($(SUPPORT_ANDROID_PLATFORM),) +_obj := $(TARGET_ROOT)/product/$(TARGET_DEVICE)/obj + +# Linker flags used to find system libraries. +MODULE_SYSTEM_LIBRARY_DIR_FLAGS += \ + -L$(_obj)/lib \ + -Xlinker -rpath-link=$(_obj)/lib \ + -L$(TARGET_ROOT)/product/$(TARGET_DEVICE)/system/lib64 \ + -Xlinker -rpath-link=$(TARGET_ROOT)/product/$(TARGET_DEVICE)/system/lib64 + +# Add architecture-specific Android include flags +MODULE_INCLUDE_FLAGS := \ + -isystem $(ANDROID_ROOT)/bionic/libc/arch-arm64/include \ + -isystem $(ANDROID_ROOT)/bionic/libc/kernel/uapi/asm-arm64 \ + -isystem $(ANDROID_ROOT)/bionic/libm/include/arm64 \ + $(MODULE_INCLUDE_FLAGS) + +MODULE_LDFLAGS += $(MODULE_SYSTEM_LIBRARY_DIR_FLAGS) + +MODULE_EXE_LDFLAGS := \ + -Bdynamic -nostdlib -Wl,-dynamic-linker,/system/bin/linker64 \ + -lc -ldl -lcutils +MODULE_LIB_LDFLAGS := $(MODULE_EXE_LDFLAGS) + +MODULE_EXE_CRTBEGIN := $(_obj)/lib/crtbegin_dynamic.o +MODULE_EXE_CRTEND := $(_obj)/lib/crtend_android.o + +MODULE_LIB_CRTBEGIN := $(_obj)/lib/crtbegin_so.o +MODULE_LIB_CRTEND := $(_obj)/lib/crtend_so.o + +MODULE_LIBGCC := $(LIBGCC) +endif + +ifneq ($(BUILD),debug) +ifeq ($(USE_LTO),1) +MODULE_LDFLAGS := \ + $(sort $(filter-out -W% -D%,$(ALL_CFLAGS) $(ALL_CXXFLAGS))) \ + $(MODULE_LDFLAGS) +endif +endif + +MODULE_ARCH_BITNESS := 64 + +# Neutrino qcc requires "-Wc," prefix for compiler flags +ifeq ($(SUPPORT_NEUTRINO_PLATFORM),1) +include $(MAKE_TOP)/common/neutrino/modify_moduledefs.mk +endif diff --git a/drivers/gpu/rogue_m/build/linux/moduledefs/target_armv7-a.mk b/drivers/gpu/rogue_m/build/linux/moduledefs/target_armv7-a.mk new file mode 100644 index 000000000000..ede0050d25d1 --- /dev/null +++ b/drivers/gpu/rogue_m/build/linux/moduledefs/target_armv7-a.mk @@ -0,0 +1,103 @@ +########################################################################### ### +#@File +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +MODULE_CC := $(CC_SECONDARY) -march=armv7-a -mfloat-abi=softfp +MODULE_CXX := $(CXX_SECONDARY) -march=armv7-a -mfloat-abi=softfp + +ifneq ($(BUILD),debug) +MODULE_CC := $(MODULE_CC) -mthumb +MODULE_CXX := $(MODULE_CXX) -mthumb +endif + +MODULE_CFLAGS := $(ALL_CFLAGS) $($(THIS_MODULE)_cflags) +MODULE_CXXFLAGS := $(ALL_CXXFLAGS) $($(THIS_MODULE)_cxxflags) +MODULE_LDFLAGS := $(ALL_LDFLAGS) $($(THIS_MODULE)_ldflags) -L$(MODULE_OUT) -Xlinker -rpath-link=$(MODULE_OUT) + +# Since this is a target module, add system-specific include flags. +MODULE_INCLUDE_FLAGS := $(SYS_INCLUDES) $(MODULE_INCLUDE_FLAGS) + +ifneq ($(SUPPORT_ANDROID_PLATFORM),) +_obj := $(TARGET_ROOT)/product/$(TARGET_DEVICE)/obj$(if $(MULTIARCH),_arm,) + +# Linker flags used to find system libraries. +MODULE_SYSTEM_LIBRARY_DIR_FLAGS += \ + -L$(_obj)/lib \ + -Xlinker -rpath-link=$(_obj)/lib \ + -L$(TARGET_ROOT)/product/$(TARGET_DEVICE)/system/lib \ + -Xlinker -rpath-link=$(TARGET_ROOT)/product/$(TARGET_DEVICE)/system/lib + +# Add architecture-specific Android include flags +MODULE_INCLUDE_FLAGS := \ + -isystem $(ANDROID_ROOT)/bionic/libc/arch-arm/include \ + -isystem $(ANDROID_ROOT)/bionic/libc/kernel/uapi/asm-arm \ + -isystem $(ANDROID_ROOT)/bionic/libm/include/arm \ + $(MODULE_INCLUDE_FLAGS) + +MODULE_LDFLAGS += $(MODULE_SYSTEM_LIBRARY_DIR_FLAGS) + +MODULE_EXE_LDFLAGS := \ + -Bdynamic -nostdlib -Wl,-dynamic-linker,/system/bin/linker \ + -lc -ldl -lcutils +MODULE_LIB_LDFLAGS := $(MODULE_EXE_LDFLAGS) + +MODULE_EXE_CRTBEGIN := $(_obj)/lib/crtbegin_dynamic.o +MODULE_EXE_CRTEND := $(_obj)/lib/crtend_android.o + +MODULE_LIB_CRTBEGIN := $(_obj)/lib/crtbegin_so.o +MODULE_LIB_CRTEND := $(_obj)/lib/crtend_so.o + +MODULE_LIBGCC := $(LIBGCC_SECONDARY) +endif + +ifneq ($(BUILD),debug) +ifeq ($(USE_LTO),1) +MODULE_LDFLAGS := \ + $(sort $(filter-out -W% -D%,$(ALL_CFLAGS) $(ALL_CXXFLAGS))) \ + $(MODULE_LDFLAGS) +endif +endif + +MODULE_ARCH_BITNESS := 32 + +# Neutrino qcc requires "-Wc," prefix for compiler flags +ifeq ($(SUPPORT_NEUTRINO_PLATFORM),1) +include $(MAKE_TOP)/common/neutrino/modify_moduledefs.mk +endif diff --git a/drivers/gpu/rogue_m/build/linux/moduledefs/target_i686.mk b/drivers/gpu/rogue_m/build/linux/moduledefs/target_i686.mk new file mode 100644 index 000000000000..bf9ff294fd01 --- /dev/null +++ b/drivers/gpu/rogue_m/build/linux/moduledefs/target_i686.mk @@ -0,0 +1,102 @@ +########################################################################### ### +#@File +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +MODULE_CC := $(CC_SECONDARY) $(TARGET_FORCE_32BIT) -march=i686 +MODULE_CXX := $(CXX_SECONDARY) $(TARGET_FORCE_32BIT) -march=i686 + +MODULE_CFLAGS := $(ALL_CFLAGS) $($(THIS_MODULE)_cflags) $(TARGET_FORCE_32BIT) -march=i686 +MODULE_CXXFLAGS := $(ALL_CXXFLAGS) $($(THIS_MODULE)_cxxflags) $(TARGET_FORCE_32BIT) -march=i686 +MODULE_LDFLAGS := $(ALL_LDFLAGS) $($(THIS_MODULE)_ldflags) -L$(MODULE_OUT) -Xlinker -rpath-link=$(MODULE_OUT) $(TARGET_FORCE_32BIT) + +# Since this is a target module, add system-specific include flags. +MODULE_INCLUDE_FLAGS := $(SYS_INCLUDES) $(MODULE_INCLUDE_FLAGS) + +ifneq ($(SUPPORT_ANDROID_PLATFORM),) +_obj := $(TARGET_ROOT)/product/$(TARGET_DEVICE)/obj$(if $(MULTIARCH),_x86,) + +# Linker flags used to find system libraries. +MODULE_SYSTEM_LIBRARY_DIR_FLAGS += \ + -L$(_obj)/lib \ + -Xlinker -rpath-link=$(_obj)/lib \ + -L$(TARGET_ROOT)/product/$(TARGET_DEVICE)/system/lib \ + -Xlinker -rpath-link=$(TARGET_ROOT)/product/$(TARGET_DEVICE)/system/lib + +# Add architecture-specific Android include flags +MODULE_INCLUDE_FLAGS := \ + -isystem $(ANDROID_ROOT)/bionic/libc/arch-x86/include \ + -isystem $(ANDROID_ROOT)/bionic/libc/kernel/uapi/asm-x86 \ + -isystem $(ANDROID_ROOT)/bionic/libm/include/i387 \ + $(MODULE_INCLUDE_FLAGS) + +MODULE_LDFLAGS += $(MODULE_SYSTEM_LIBRARY_DIR_FLAGS) + +MODULE_EXE_LDFLAGS := \ + -Bdynamic -nostdlib -Wl,-dynamic-linker,/system/bin/linker \ + -lc -ldl -lcutils +MODULE_LIB_LDFLAGS := $(MODULE_EXE_LDFLAGS) + +MODULE_EXE_CRTBEGIN := $(_obj)/lib/crtbegin_dynamic.o +MODULE_EXE_CRTEND := $(_obj)/lib/crtend_android.o + +MODULE_LIB_CRTBEGIN := $(_obj)/lib/crtbegin_so.o +MODULE_LIB_CRTEND := $(_obj)/lib/crtend_so.o + +MODULE_LIBGCC := $(LIBGCC_SECONDARY) +else +# On Linux, we currently don't need to specify any flags to find the system +# libraries. +MODULE_SYSTEM_LIBRARY_DIR_FLAGS := +endif + +ifneq ($(BUILD),debug) +ifeq ($(USE_LTO),1) +MODULE_LDFLAGS := \ + $(sort $(filter-out -W% -D%,$(ALL_CFLAGS) $(ALL_CXXFLAGS))) \ + $(MODULE_LDFLAGS) +endif +endif + +MODULE_ARCH_BITNESS := 32 + +# Neutrino qcc requires "-Wc," prefix for compiler flags +ifeq ($(SUPPORT_NEUTRINO_PLATFORM),1) +include $(MAKE_TOP)/common/neutrino/modify_moduledefs.mk +endif diff --git a/drivers/gpu/rogue_m/build/linux/moduledefs/target_neutral.mk b/drivers/gpu/rogue_m/build/linux/moduledefs/target_neutral.mk new file mode 100644 index 000000000000..6b58e5e81387 --- /dev/null +++ b/drivers/gpu/rogue_m/build/linux/moduledefs/target_neutral.mk @@ -0,0 +1,44 @@ +########################################################################### ### +#@File +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +MODULE_BISON_FLAGS := $(ALL_BISON_FLAGS) $($(THIS_MODULE)_bisonflags) +MODULE_FLEX_FLAGS := $(ALL_FLEX_FLAGS) $($(THIS_MODULE)_flexflags) +MODULE_FLEXXX_FLAGS := $(ALL_FLEXXX_FLAGS) $($(THIS_MODULE)_flexxxflags) diff --git a/drivers/gpu/rogue_m/build/linux/moduledefs/target_x86_64.mk b/drivers/gpu/rogue_m/build/linux/moduledefs/target_x86_64.mk new file mode 100644 index 000000000000..ab9d5b20f50b --- /dev/null +++ b/drivers/gpu/rogue_m/build/linux/moduledefs/target_x86_64.mk @@ -0,0 +1,100 @@ +########################################################################### ### +#@File +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +MODULE_CC := $(CC) -march=x86-64 +MODULE_CXX := $(CXX) -march=x86-64 + +MODULE_CFLAGS := $(ALL_CFLAGS) $($(THIS_MODULE)_cflags) -march=x86-64 +MODULE_CXXFLAGS := $(ALL_CXXFLAGS) $($(THIS_MODULE)_cxxflags) -march=x86-64 +MODULE_LDFLAGS := $(ALL_LDFLAGS) $($(THIS_MODULE)_ldflags) -L$(MODULE_OUT) -Xlinker -rpath-link=$(MODULE_OUT) + +# Since this is a target module, add system-specific include flags. +MODULE_INCLUDE_FLAGS := $(SYS_INCLUDES) $(MODULE_INCLUDE_FLAGS) + +ifneq ($(SUPPORT_ANDROID_PLATFORM),) +# Linker flags used to find system libraries. +MODULE_SYSTEM_LIBRARY_DIR_FLAGS += \ + -L$(TARGET_ROOT)/product/$(TARGET_DEVICE)/obj/lib \ + -Xlinker -rpath-link=$(TARGET_ROOT)/product/$(TARGET_DEVICE)/obj/lib \ + -L$(TARGET_ROOT)/product/$(TARGET_DEVICE)/system/lib64 \ + -Xlinker -rpath-link=$(TARGET_ROOT)/product/$(TARGET_DEVICE)/system/lib64 + +# Add architecture-specific Android include flags +MODULE_INCLUDE_FLAGS := \ + -isystem $(ANDROID_ROOT)/bionic/libc/arch-x86_64/include \ + -isystem $(ANDROID_ROOT)/bionic/libc/kernel/uapi/asm-x86 \ + -isystem $(ANDROID_ROOT)/bionic/libm/include/amd64 \ + $(MODULE_INCLUDE_FLAGS) + +MODULE_LDFLAGS += $(MODULE_SYSTEM_LIBRARY_DIR_FLAGS) + +MODULE_EXE_LDFLAGS := \ + -Bdynamic -nostdlib -Wl,-dynamic-linker,/system/bin/linker64 \ + -lc -ldl -lcutils +MODULE_LIB_LDFLAGS := $(MODULE_EXE_LDFLAGS) + +MODULE_EXE_CRTBEGIN := $(TARGET_ROOT)/product/$(TARGET_DEVICE)/obj/lib/crtbegin_dynamic.o +MODULE_EXE_CRTEND := $(TARGET_ROOT)/product/$(TARGET_DEVICE)/obj/lib/crtend_android.o + +MODULE_LIB_CRTBEGIN := $(TARGET_ROOT)/product/$(TARGET_DEVICE)/obj/lib/crtbegin_so.o +MODULE_LIB_CRTEND := $(TARGET_ROOT)/product/$(TARGET_DEVICE)/obj/lib/crtend_so.o + +MODULE_LIBGCC := $(LIBGCC) +else +# On Linux, we currently don't need to specify any flags to find the system +# libraries. +MODULE_SYSTEM_LIBRARY_DIR_FLAGS := +endif + +ifneq ($(BUILD),debug) +ifeq ($(USE_LTO),1) +MODULE_LDFLAGS := \ + $(sort $(filter-out -W% -D%,$(ALL_CFLAGS) $(ALL_CXXFLAGS))) \ + $(MODULE_LDFLAGS) +endif +endif + +MODULE_ARCH_BITNESS := 64 + +# Neutrino qcc requires "-Wc," prefix for compiler flags +ifeq ($(SUPPORT_NEUTRINO_PLATFORM),1) +include $(MAKE_TOP)/common/neutrino/modify_moduledefs.mk +endif diff --git a/drivers/gpu/rogue_m/build/linux/moduledefs_common.mk b/drivers/gpu/rogue_m/build/linux/moduledefs_common.mk new file mode 100644 index 000000000000..7a0c2ccd832e --- /dev/null +++ b/drivers/gpu/rogue_m/build/linux/moduledefs_common.mk @@ -0,0 +1,146 @@ +########################################################################### ### +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +MODULE_OUT := $(RELATIVE_OUT)/$(MODULE_ARCH) +MODULE_INTERMEDIATES_DIR := $(MODULE_OUT)/intermediates/$(THIS_MODULE) + +MODULE_TARGETS := +MODULE_HOST_BUILD := +MODULE_CLEAN_TARGETS := +MODULE_CLOBBER_TARGETS := + +MODULE_CFLAGS := +MODULE_CXXFLAGS := +MODULE_LDFLAGS := +MODULE_BISON_FLAGS := +MODULE_FLEX_FLAGS := +MODULE_FLEXXX_FLAGS := + +MODULE_ARCH_BITNESS := + +# Only allow cflags that do not affect code generation. This is to ensure +# proper binary compatibility when LTO (Link-Time Optimization) is enabled. +# We make exceptions for the below flags which will all fail linkage in +# non-LTO mode if incorrectly specified. +# +# NOTE: Only used by static_library and objects right now. Other module +# types should not be affected by complex code generation flags w/ LTO. +# Set MODULE_CHECK_CFLAGS in the module makefile to enable this check. +MODULE_CHECK_CFLAGS := +MODULE_ALLOWED_CFLAGS := -W% -D% -std=% -fPIC -fPIE -pie -m32 + +# -L flags for library search dirs: these are relative to $(TOP), unless +# they're absolute paths +MODULE_LIBRARY_DIR_FLAGS := $(foreach _path,$($(THIS_MODULE)_libpaths),$(if $(filter /%,$(_path)),-L$(call relative-to-top,$(_path)),-L$(_path))) +# -L options to find system libraries (may be arch-specific) +MODULE_SYSTEM_LIBRARY_DIR_FLAGS := +# -I flags for header search dirs (same rules as for -L) +MODULE_INCLUDE_FLAGS := $(foreach _path,$($(THIS_MODULE)_includes),$(if $(filter /%,$(_path)),-I$(call relative-to-top,$(_path)),-I$(_path))) + +# If the build provides some external khronos include flags, and the module +# hasn't explicitly opted out of path substitution, prepend the system path +# to the DDK khronos header include path. This causes the platform headers +# to override the DDK versions. This is the default behaviour for Android. +ifneq ($(SYS_KHRONOS_INCLUDES),) +ifneq ($($(THIS_MODULE)_force_internal_khronos_headers),1) +MODULE_INCLUDE_FLAGS := $(patsubst -Iinclude/khronos,$(SYS_KHRONOS_INCLUDES) -Iinclude/khronos,$(MODULE_INCLUDE_FLAGS)) +endif +endif + +# These define the rules for finding source files. +# +# - If a name begins with a slash, we strip $(TOP) off the front if it +# begins with $(TOP). This is so that we don't get really long error +# messages from the compiler if the source tree is in a deeply nested +# directory, but we still do get absolute paths if you say "make +# OUT=/tmp/somewhere" +# +# - Otherwise, if a name contains a slash and begins with $(OUT), we leave +# it as it is. This is so you can say "module_src := +# $(TARGET_INTERMEDIATES)/something/generated.c" +# +# - Otherwise, we assume it's a path referring to somewhere under the +# directory containing Linux.mk, and add $(THIS_DIR) to it +# +_SOURCES_WITHOUT_SLASH := \ + $(strip $(foreach _s,$($(THIS_MODULE)_src),$(if $(findstring /,$(_s)),,$(_s)))) +_SOURCES_WITH_SLASH := \ + $(strip $(foreach _s,$($(THIS_MODULE)_src),$(if $(findstring /,$(_s)),$(_s),))) +MODULE_SOURCES := $(addprefix $(THIS_DIR)/,$(_SOURCES_WITHOUT_SLASH)) +MODULE_SOURCES += $(call relative-to-top,$(filter /%,$(_SOURCES_WITH_SLASH))) + +_RELATIVE_SOURCES_WITH_SLASH := \ + $(filter-out /%,$(_SOURCES_WITH_SLASH)) +_OUTDIR_RELATIVE_SOURCES_WITH_SLASH := \ + $(filter $(RELATIVE_OUT)/%,$(_RELATIVE_SOURCES_WITH_SLASH)) +_THISDIR_RELATIVE_SOURCES_WITH_SLASH := \ + $(filter-out $(RELATIVE_OUT)/%,$(_RELATIVE_SOURCES_WITH_SLASH)) +MODULE_SOURCES += $(_OUTDIR_RELATIVE_SOURCES_WITH_SLASH) +MODULE_SOURCES += $(addprefix $(THIS_DIR)/,$(_THISDIR_RELATIVE_SOURCES_WITH_SLASH)) + +# Add generated sources +MODULE_SOURCES += $(addprefix $(MODULE_OUT)/,$($(THIS_MODULE)_src_relative)) + +# MODULE_LIBRARY_FLAGS contains the flags to link each library. The rules +# are: +# +# module_staticlibs := mylib +# module_libs := mylib +# Use -lmylib +# +# module_extlibs := mylib +# Use $(libmylib_ldflags) if that variable is defined (empty counts as +# defined). Otherwise use -lmylib +# +# module_libs := :mylib +# Use -l:mylib.so + +MODULE_LIBRARY_FLAGS := \ + $(addprefix -l, $($(THIS_MODULE)_staticlibs)) \ + $(addprefix -l, $(filter-out :%, $($(THIS_MODULE)_libs))) \ + $(addprefix -l, $(addsuffix .so, $(filter :%,$($(THIS_MODULE)_libs)))) \ + $(foreach _lib,$($(THIS_MODULE)_extlibs),$(if $(filter undefined,$(origin lib$(_lib)_ldflags)),-l$(_lib),$(lib$(_lib)_ldflags))) + +# pkg-config integration; primarily used by X.Org +# We don't support arbitrary CFLAGS yet (just includes) +$(foreach _package,$($(THIS_MODULE)_packages),\ + $(eval MODULE_INCLUDE_FLAGS += `pkg-config --cflags-only-I $(_package)`)\ + $(eval MODULE_LIBRARY_FLAGS += `pkg-config --libs-only-l $(_package)`)\ + $(eval MODULE_LIBRARY_DIR_FLAGS += `pkg-config --libs-only-L $(_package)`)) diff --git a/drivers/gpu/rogue_m/build/linux/modules.mk b/drivers/gpu/rogue_m/build/linux/modules.mk new file mode 100644 index 000000000000..971f21a20a25 --- /dev/null +++ b/drivers/gpu/rogue_m/build/linux/modules.mk @@ -0,0 +1,48 @@ +########################################################################### ### +#@Title Module processing +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +# Bits for processing $(modules) after reading in each Linux.mk + +#$(info ---- $(modules) ----) + +$(foreach _m,$(modules),$(if $(filter $(_m),$(ALL_MODULES)),$(error In makefile $(THIS_MAKEFILE): Duplicate module $(_m) (first seen in $(INTERNAL_MAKEFILE_FOR_MODULE_$(_m))) listed in $$(modules)),$(eval $(call register-module,$(_m))))) + +ALL_MODULES += $(modules) diff --git a/drivers/gpu/rogue_m/build/linux/modules/kernel_module.mk b/drivers/gpu/rogue_m/build/linux/modules/kernel_module.mk new file mode 100644 index 000000000000..9a2ae69c49fe --- /dev/null +++ b/drivers/gpu/rogue_m/build/linux/modules/kernel_module.mk @@ -0,0 +1,92 @@ +########################################################################### ### +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +# Rules for making kernel modules with kbuild. This makefile doesn't define +# any rules that build the modules, it only copies the kbuild Makefile into +# the right place and then invokes kbuild to do the actual build + +$(call target-build-only,kernel module) + +MODULE_KBUILD_DIR := $(MODULE_OUT)/kbuild + +# $(THIS_MODULE)_makefile names the kbuild makefile fragment used to build +# this module's objects +$(call must-be-nonempty,$(THIS_MODULE)_makefile) +MODULE_KBUILD_MAKEFILE := $($(THIS_MODULE)_makefile) + +# $(THIS_MODULE)_target specifies the name of the kernel module +$(call must-be-nonempty,$(THIS_MODULE)_target) +MODULE_TARGETS := $($(THIS_MODULE)_target) +MODULE_KBUILD_OBJECTS := $($(THIS_MODULE)_target:.ko=.o) + +$(call module-info-line,kernel module: $(MODULE_TARGETS)) + +# Unusually, we define $(THIS_MODULE)_install_path if the user didn't, as we +# can't use MODULE_INSTALL_PATH in the scripts.mk logic. +ifeq ($($(THIS_MODULE)_install_path),) +$(THIS_MODULE)_install_path := \ + $${MOD_DESTDIR}/$(patsubst $(MODULE_OUT)/%,%,$(MODULE_TARGETS)) +endif + +MODULE_INSTALL_PATH := $($(THIS_MODULE)_install_path) + +# Here we could maybe include $(MODULE_KBUILD_MAKEFILE) and look at +# $(MODULE_KBUILD_OBJECTS)-y to see which source files might be built + +.PHONY: $(THIS_MODULE) +$(THIS_MODULE): MODULE_KBUILD_MAKEFILE := $(MODULE_KBUILD_MAKEFILE) +$(THIS_MODULE): MODULE_KBUILD_OBJECTS := $(MODULE_KBUILD_OBJECTS) +$(THIS_MODULE): + @echo "kbuild module '$@'" + @echo " MODULE_KBUILD_MAKEFILE := $(MODULE_KBUILD_MAKEFILE)" + @echo " MODULE_KBUILD_OBJECTS := $(MODULE_KBUILD_OBJECTS)" + @echo ' Being built:' $(if $(filter $@,$(KERNEL_COMPONENTS)),"yes (separate module)",$(if $(filter $@,$(EXTRA_PVRSRVKM_COMPONENTS)),"yes (into pvrsrvkm)","no")) + @echo "Module $@ is a kbuild module. Run 'make kbuild' to make it" + @false + +$(MODULE_INTERMEDIATES_DIR)/.install: MODULE_TYPE := $($(THIS_MODULE)_type) +$(MODULE_INTERMEDIATES_DIR)/.install: MODULE_INSTALL_PATH := $(MODULE_INSTALL_PATH) +$(MODULE_INTERMEDIATES_DIR)/.install: MODULE_TARGETS := $(patsubst $(MODULE_OUT)/%,%,$(MODULE_TARGETS)) +$(MODULE_INTERMEDIATES_DIR)/.install: $(THIS_MAKEFILE) | $(MODULE_INTERMEDIATES_DIR) + @echo 'install_file $(MODULE_TARGETS) $(MODULE_INSTALL_PATH) "$(MODULE_TYPE)" 0644 0:0' >$@ + +ALL_KBUILD_MODULES += $(THIS_MODULE) +INTERNAL_KBUILD_MAKEFILE_FOR_$(THIS_MODULE) := $(MODULE_KBUILD_MAKEFILE) +INTERNAL_KBUILD_OBJECTS_FOR_$(THIS_MODULE) := $(MODULE_KBUILD_OBJECTS) diff --git a/drivers/gpu/rogue_m/build/linux/pc_android/Makefile b/drivers/gpu/rogue_m/build/linux/pc_android/Makefile new file mode 100644 index 000000000000..f82bd652d842 --- /dev/null +++ b/drivers/gpu/rogue_m/build/linux/pc_android/Makefile @@ -0,0 +1,140 @@ +########################################################################### ### +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +include ../config/preconfig.mk + +# If a TARGET_PRODUCT is specified but not a TARGET_DEVICE, try to +# derive the TARGET_DEVICE from TARGET_PRODUCT. +# +ifeq ($(TARGET_DEVICE),) +override TARGET_DEVICE := \ + $(patsubst mini_%,%,$(patsubst full_%,%,$(TARGET_PRODUCT))) +endif + +ifeq ($(TARGET_DEVICE),) +override TARGET_DEVICE := pc +endif + +HAL_VARIANT := pc + +RGX_BVNC ?= 1.82.4.5 +# TC BONNIE: +#RGX_BVNC ?= 4.31.4.55 + +include ../common/android/paths.mk +include ../common/android/arch.mk +include ../common/android/features.mk + +ifeq ($(SUPPORT_ADF),1) +ifneq ($(is_at_least_lollipop),1) +SYS_INCLUDES += \ + -isystem $(ANDROID_ROOT)/device/img/pc/adf/libadf/include \ + -isystem $(ANDROID_ROOT)/device/img/pc/adf/libadfhwc/include +endif +endif + +ifeq ($(NO_HARDWARE),1) + LDM_PLATFORM := 1 + PVR_SYSTEM := rgx_nohw + # If we end up using dc_fbdev, Android always wants to be + # triple buffered in when running in pure-software mode. + DC_FBDEV_NUM_PREFERRED_BUFFERS := 3 +else + ifeq ($(SUPPORT_ADF),1) + PVR_LDM_PLATFORM_PRE_REGISTERED := 1 + LMA := 1 + LDM_PLATFORM := 1 + PVR_SYSTEM := rgx_linux_apollo + SUPPORT_SYSTEM_INTERRUPT_HANDLING := 1 + ION_DEFAULT_HEAP_ID_MASK := (1 << (ION_HEAP_TYPE_CUSTOM + 2)) + else + LDM_PCI := 1 + PVR_SYSTEM := rgx_tc + TC_MEMORY_CONFIG := TC_MEMORY_LOCAL + SUPPORT_SYSTEM_INTERRUPT_HANDLING := 1 + endif +endif + +ifeq ($(SUPPORT_ADF),1) + ifneq ($(NO_HARDWARE),1) + DISPLAY_CONTROLLER ?= adf_pdp + endif +else + ifeq ($(NO_HARDWARE),1) + DISPLAY_CONTROLLER ?= dc_example + else + DISPLAY_CONTROLLER ?= dc_pdp + endif +endif + +ifeq ($(DISPLAY_CONTROLLER),adf_pdp) +ADF_PDP_WIDTH ?= 1280 +ADF_PDP_HEIGHT ?= 720 +KERNEL_COMPONENTS += apollo +endif + +KERNEL_COMPONENTS += $(DISPLAY_CONTROLLER) + +CACHEFLUSH_TYPE ?= CACHEFLUSH_X86 + +PVR_ANDROID_DEFER_CLEAR ?= 1 + +ifeq ($(PVR_SYSTEM),rgx_tc) +ifeq ($(TC_MEMORY_CONFIG),TC_MEMORY_LOCAL) +LMA := 1 +# Tell ion that we want memory from the test chip local memory +# heap. The choice of ION_HEAP_TYPE_CUSTOM+1 as the ID is +# arbitrary, but it has to match the one specified in the +# TC-specific ion support code. +ION_DEFAULT_HEAP_ID_MASK := 1 << (ION_HEAP_TYPE_CUSTOM + 1) +endif +endif + +ifeq ($(DISPLAY_CONTROLLER),dc_pdp) +DCPDP_WIDTH ?= 1280 +DCPDP_HEIGHT ?= 720 +DCPDP_NO_INTERRUPTS ?= 1 +endif + +include ../config/core.mk +include ../common/android/extra_config.mk +include ../common/pvrgdb.mk +include ../common/3rdparty.mk +include ../common/testchip.mk diff --git a/drivers/gpu/rogue_m/build/linux/prepare_tree.mk b/drivers/gpu/rogue_m/build/linux/prepare_tree.mk new file mode 100644 index 000000000000..d59314368ee3 --- /dev/null +++ b/drivers/gpu/rogue_m/build/linux/prepare_tree.mk @@ -0,0 +1,56 @@ +########################################################################### ### +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +.PHONY: prepare_tree + +prepare_tree: + +INTERNAL_INCLUDED_PREPARE_HEADERS := +-include build/linux/prepare_headers.mk +ifneq ($(INTERNAL_INCLUDED_PREPARE_HEADERS),true) +missing_headers := $(strip $(shell test ! -e include/pvrversion.h && echo true)) +ifdef missing_headers +$(info ) +$(info ** include/pvrversion.h is missing, and cannot be rebuilt.) +$(info ** Cannot continue.) +$(info ) +$(error Missing headers) +endif +endif diff --git a/drivers/gpu/rogue_m/build/linux/pvrversion.mk b/drivers/gpu/rogue_m/build/linux/pvrversion.mk new file mode 100644 index 000000000000..10c25f3ce072 --- /dev/null +++ b/drivers/gpu/rogue_m/build/linux/pvrversion.mk @@ -0,0 +1,57 @@ +########################################################################### ### +#@Title Extract info from pvrversion.h +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +# Version information +PVRVERSION_H := $(call if-exists,include/pvrversion.h,$(OUT)/include/pvrversion.h) + +ifneq ($(wildcard $(PVRVERSION_H)),) + +# scripts.mk uses these to set the install script's version suffix +PVRVERSION_MAJ := $(shell perl -ne '/\sPVRVERSION_MAJ\s+(\w+)/ and print $$1' $(PVRVERSION_H)) +PVRVERSION_MIN := $(shell perl -ne '/\sPVRVERSION_MIN\s+(\w+)/ and print $$1' $(PVRVERSION_H)) +PVRVERSION_FAMILY := $(shell perl -ne '/\sPVRVERSION_FAMILY\s+"(\S+)"/ and print $$1' $(PVRVERSION_H)) +PVRVERSION_BRANCHNAME := $(shell perl -ne '/\sPVRVERSION_BRANCHNAME\s+"(\S+)"/ and print $$1' $(PVRVERSION_H)) +PVRVERSION_BUILD := $(shell perl -ne '/\sPVRVERSION_BUILD\s+(\w+)/ and print $$1' $(PVRVERSION_H)) + +PVRVERSION_NUM := $(PVRVERSION_MAJ).$(PVRVERSION_MIN).$(PVRVERSION_BUILD) +PVRVERSION := "$(PVRVERSION_FAMILY)_$(PVRVERSION_BRANCHNAME)\@$(PVRVERSION_BUILD)" + +endif diff --git a/drivers/gpu/rogue_m/build/linux/scripts.mk b/drivers/gpu/rogue_m/build/linux/scripts.mk new file mode 100644 index 000000000000..766a8d719af0 --- /dev/null +++ b/drivers/gpu/rogue_m/build/linux/scripts.mk @@ -0,0 +1,352 @@ +########################################################################### ### +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +ifeq ($(SUPPORT_ANDROID_PLATFORM),) + +define if-component + ifneq ($$(filter $(1),$$(COMPONENTS)),) + M4DEFS += $(2) + endif +endef + +define if-kernel-component + ifneq ($$(filter $(1),$$(KERNEL_COMPONENTS)),) + M4DEFS_K += $(2) + endif +endef + +# common.m4 lives here +# +M4FLAGS := -I$(MAKE_TOP)/scripts + +# These defs are required for both KM and UM install script. +M4DEFS_K := \ + -DPVRVERSION="$(PVRVERSION)" \ + -DPVR_BUILD_DIR=$(PVR_BUILD_DIR) \ + -DPVRSRV_MODNAME=$(PVRSRV_MODNAME) + +ifeq ($(SUPPORT_DRM),1) + M4DEFS_K += \ + -DSUPPORT_DRM=1 +endif + +ifeq ($(SUPPORT_DRM_DC_MODULE),1) + M4DEFS_K += \ + -DSUPPORT_DRM_DC_MODULE=1 +endif + +ifeq ($(PDUMP),1) + M4DEFS_K += -DPDUMP=1 +endif + +ifneq ($(DISPLAY_CONTROLLER),) + $(eval $(call if-kernel-component,$(DISPLAY_CONTROLLER),\ + -DDISPLAY_CONTROLLER=$(DISPLAY_CONTROLLER))) +endif + +# These defs are not derived from user variables +# +M4DEFS := \ + -DSOLIB_VERSION=$(PVRVERSION_MAJ).$(PVRVERSION_MIN).$(PVRVERSION_BUILD) + +ifeq ($(SUPPORT_KERNEL_SRVINIT),1) +M4DEFS += \ + -DSUPPORT_KERNEL_SRVINIT=1 \ + -DFW_DESTDIR=$(FW_DESTDIR) \ + -DRGX_FW_FILENAME=$(RGX_FW_FILENAME) +endif + +# XOrg support options are convoluted, so don't bother with if-component. +ifneq ($(filter pvr_video,$(COMPONENTS)),) # This is an X build + M4DEFS += -DSUPPORT_LWS=1 + M4DEFS += -DSUPPORT_XORG=1 + M4DEFS += -DXORG_EXPLICIT_PVR_SERVICES_LOAD=$(XORG_EXPLICIT_PVR_SERVICES_LOAD) + + ifneq ($(XORG_WAYLAND),1) + M4DEFS += -DXORG_WAYLAND=1 + endif + + ifeq ($(LWS_NATIVE),1) + M4DEFS += -DPVR_XORG_DESTDIR=/usr/bin + M4DEFS += -DPVR_CONF_DESTDIR=/etc/X11 + $(eval $(call if-component,opengl_mesa,-DSUPPORT_MESA=1)) + else + M4DEFS += -DLWS_INSTALL_TREE=1 + M4DEFS += -DPVR_XORG_DESTDIR=$(LWS_PREFIX)/bin + M4DEFS += -DPVR_CONF_DESTDIR=$(LWS_PREFIX)/etc/X11 + $(eval $(call if-component,pvr_input, -DSUPPORT_DDX_INPUT=1)) + $(eval $(call if-component,opengl_mesa,-DSUPPORT_LIBGL=1 -DSUPPORT_MESA=1)) + endif +else # This is a non-X build + ifeq ($(WINDOW_SYSTEM),wayland) + M4DEFS += -DSUPPORT_LWS=1 + M4DEFS += -DSUPPORT_WAYLAND=1 + + ifeq ($(LWS_NATIVE),1) + else + M4DEFS += -DLWS_INSTALL_TREE=1 + endif + else # This is a non-X and Wayland build + $(eval $(call if-component,opengl,-DSUPPORT_LIBGL=1)) + endif +endif + +# Map other COMPONENTS on to SUPPORT_ defs +# +$(eval $(call if-component,opengles1,\ + -DSUPPORT_OPENGLES1=1 -DOGLES1_MODULE=$(opengles1_target) \ + -DSUPPORT_OPENGLES1_V1_ONLY=0)) +$(eval $(call if-component,opengles3,\ + -DSUPPORT_OPENGLES3=1 -DOGLES3_MODULE=$(opengles3_target))) +$(eval $(call if-component,egl,\ + -DSUPPORT_LIBEGL=1 -DEGL_MODULE=$(egl_target))) +$(eval $(call if-component,glslcompiler,\ + -DSUPPORT_SOURCE_SHADER=1)) +$(eval $(call if-component,opencl,\ + -DSUPPORT_OPENCL=1)) +$(eval $(call if-component,liboclcompiler,\ + -DSUPPORT_OCL_COMPILER=1)) +$(eval $(call if-component,openrl,\ + -DSUPPORT_OPENRL=1)) +$(eval $(call if-component,renderscript,\ + -DSUPPORT_RSC=1)) +$(eval $(call if-component,renderscript_sha1,\ + -DSUPPORT_RSC_SHA1=1)) +$(eval $(call if-component,librscruntime,\ + -DSUPPORT_RSC_RUNTIME=1)) +$(eval $(call if-component,librsccompiler,\ + -DSUPPORT_RSC_COMPILER=1)) +$(eval $(call if-component,rscreplay,\ + -DSUPPORT_RSC_REPLAY=1)) +$(eval $(call if-component,opengl opengl_mesa,\ + -DSUPPORT_OPENGL=1)) +$(eval $(call if-component,null_ws,\ + -DSUPPORT_NULL_WS=1)) +$(eval $(call if-component,null_drm_ws,\ + -DSUPPORT_NULL_DRM_WS=1 \ + -DSUPPORT_LWS=1 \ + -DLWS_INSTALL_TREE=1)) +$(eval $(call if-component,null_remote,\ + -DSUPPORT_NULL_REMOTE=1)) +$(eval $(call if-component,null_adf_ws,\ + -DSUPPORT_NULL_ADF_WS=1)) +$(eval $(call if-component,ews_ws,\ + -DSUPPORT_EWS=1)) +$(eval $(call if-component,ews_wm,\ + -DSUPPORT_LUA=1)) +$(eval $(call if-component,graphicshal,\ + -DSUPPORT_GRAPHICS_HAL=1)) +$(eval $(call if-component,xeglinfo,\ + -DSUPPORT_XUNITTESTS=1)) +$(eval $(call if-component,pvrgdb,\ + -DPVRGDB=1)) + +ifeq ($(PVR_REMOTE),1) + M4DEFS += -DPVR_REMOTE=1 +endif + +# Build UM script using old scheme using M4 +define create-install-um-script-m4 +$(RELATIVE_OUT)/$(1)/install_um.sh: $(PVRVERSION_H) $(CONFIG_MK) \ + $(MAKE_TOP)/scripts/common.m4 \ + $(MAKE_TOP)/$(PVR_BUILD_DIR)/install_um.sh.m4 \ + | $(RELATIVE_OUT)/$(1) + $$(if $(V),,@echo " GEN " $$(call relative-to-top,$$@)) + $(M4) $(M4FLAGS) $(M4DEFS) $(M4DEFS_K) \ + $(MAKE_TOP)/scripts/common.m4 \ + $(MAKE_TOP)/$(PVR_BUILD_DIR)/install_um.sh.m4 > $$@ +install_script: $(RELATIVE_OUT)/$(1)/install_um.sh +endef + +$(foreach _t,$(TARGET_ALL_ARCH),$(eval $(call create-install-um-script-m4,$(_t)))) + +$(TARGET_PRIMARY_OUT)/rc.pvr: $(PVRVERSION_H) $(CONFIG_MK) $(CONFIG_KERNEL_MK) \ + $(MAKE_TOP)/scripts/rc.pvr.m4 $(MAKE_TOP)/scripts/common.m4 \ + $(MAKE_TOP)/$(PVR_BUILD_DIR)/rc.pvr.m4 \ + | $(TARGET_PRIMARY_OUT) + $(if $(V),,@echo " GEN " $(call relative-to-top,$@)) + $(M4) $(M4FLAGS) $(M4DEFS) $(M4DEFS_K) $(MAKE_TOP)/scripts/rc.pvr.m4 \ + $(MAKE_TOP)/$(PVR_BUILD_DIR)/rc.pvr.m4 > $@ + $(CHMOD) +x $@ +init_script: $(TARGET_PRIMARY_OUT)/rc.pvr + +$(TARGET_PRIMARY_OUT)/udev.pvr: $(CONFIG_KERNEL_MK) \ + $(MAKE_TOP)/scripts/udev.pvr.m4 \ + | $(TARGET_PRIMARY_OUT) + $(if $(V),,@echo " GEN " $(call relative-to-top,$@)) + $(M4) $(M4FLAGS) $(M4DEFS_K) $(MAKE_TOP)/scripts/udev.pvr.m4 > $@ +udev_rules: $(TARGET_PRIMARY_OUT)/udev.pvr + +endif # ifeq ($(SUPPORT_ANDROID_PLATFORM),) + +# This code mimics the way Make processes our implicit/explicit goal list. +# It tries to build up a list of components that were actually built, from +# whence an install script is generated. +# +ifneq ($(MAKECMDGOALS),) +BUILT_UM := $(MAKECMDGOALS) +ifneq ($(filter build services_all components,$(MAKECMDGOALS)),) +BUILT_UM += $(COMPONENTS) +endif +BUILT_UM := $(sort $(filter $(ALL_MODULES) xorg wl,$(BUILT_UM))) +else +BUILT_UM := $(sort $(COMPONENTS)) +endif + +ifneq ($(MAKECMDGOALS),) +BUILT_KM := $(MAKECMDGOALS) +ifneq ($(filter build services_all kbuild,$(MAKECMDGOALS)),) +BUILT_KM += $(KERNEL_COMPONENTS) +endif +BUILT_KM := $(sort $(filter $(ALL_MODULES),$(BUILT_KM))) +else +BUILT_KM := $(sort $(KERNEL_COMPONENTS)) +endif + +INSTALL_UM_MODULES := \ + $(strip $(foreach _m,$(BUILT_UM),\ + $(if $(filter doc module_group,$($(_m)_type)),,\ + $(if $(filter host_%,$($(_m)_arch)),,\ + $(if $($(_m)_install_path),$(_m),\ + $(warning WARNING: UM $(_m)_install_path not defined)))))) + +# Build up a list of installable shared libraries. The shared_library module +# type is specially guaranteed to define $(_m)_target, even if the Linux.mk +# itself didn't. The list is formatted with : pairs e.g. +# "moduleA:libmoduleA.so moduleB:libcustom.so" for later processing. +ALL_SHARED_INSTALLABLE := \ + $(sort $(foreach _a,$(ALL_MODULES),\ + $(if $(filter shared_library,$($(_a)_type)),$(_a):$($(_a)_target),))) + +# Handle implicit install dependencies. Executables and shared libraries may +# be linked against other shared libraries. Avoid requiring the user to +# specify the program's binary dependencies explicitly with $(m)_install_extra +INSTALL_UM_MODULES := \ + $(sort $(INSTALL_UM_MODULES) \ + $(foreach _a,$(ALL_SHARED_INSTALLABLE),\ + $(foreach _m,$(INSTALL_UM_MODULES),\ + $(foreach _l,$($(_m)_libs),\ + $(if $(filter lib$(_l).so,$(word 2,$(subst :, ,$(_a)))),\ + $(word 1,$(subst :, ,$(_a)))))))) + +# Add explicit dependencies that must be installed +INSTALL_UM_MODULES := \ + $(sort $(INSTALL_UM_MODULES) \ + $(foreach _m,$(INSTALL_UM_MODULES),\ + $($(_m)_install_dependencies))) + +define calculate-um-fragments +# Work out which modules are required for this arch. +INSTALL_UM_MODULES_$(1) := \ + $$(strip $$(foreach _m,$(INSTALL_UM_MODULES),\ + $$(if $$(filter $(1),$$(INTERNAL_ARCH_LIST_FOR_$$(_m))),$$(_m)))) + +INSTALL_UM_FRAGMENTS_$(1) := $$(foreach _m,$$(INSTALL_UM_MODULES_$(1)),$(RELATIVE_OUT)/$(1)/intermediates/$$(_m)/.install) + +.PHONY: install_um_$(1)_debug +install_um_$(1)_debug: $$(INSTALL_UM_FRAGMENTS_$(1)) + $(CAT) $$^ +endef + +$(foreach _t,$(TARGET_ALL_ARCH) target_neutral,$(eval $(call calculate-um-fragments,$(_t)))) + +INSTALL_KM_FRAGMENTS := \ + $(strip $(foreach _m,$(BUILT_KM),\ + $(if $(filter-out kernel_module,$($(_m)_type)),,\ + $(if $($(_m)_install_path),\ + $(TARGET_PRIMARY_OUT)/intermediates/$(_m)/.install,\ + $(warning WARNING: KM $(_m)_install_path not defined))))) + +.PHONY: install_km_debug +install_km_debug: $(INSTALL_KM_FRAGMENTS) + $(CAT) $^ + +ifneq ($(INSTALL_KM_FRAGMENTS),) +$(TARGET_PRIMARY_OUT)/install_km.sh: $(INSTALL_KM_FRAGMENTS) $(CONFIG_KERNEL_MK) | $(TARGET_PRIMARY_OUT) + $(if $(V),,@echo " GEN " $(call relative-to-top,$@)) + $(ECHO) KERNELVERSION=$(KERNEL_ID) > $@ +ifeq ($(SUPPORT_ANDROID_PLATFORM),) + $(ECHO) MOD_DESTDIR=/lib/modules/$(KERNEL_ID)/extra >> $@ +endif + $(CAT) $(INSTALL_KM_FRAGMENTS) >> $@ +install_script_km: $(TARGET_PRIMARY_OUT)/install_km.sh +endif + +# Build UM script using new scheme which does not use M4 for anything +# (Only works for Android and target_neutral right now.) +define create-install-um-script +ifneq ($$(INSTALL_UM_FRAGMENTS_$(1)),) +$(RELATIVE_OUT)/$(1)/install_um.sh: $$(INSTALL_UM_FRAGMENTS_$(1)) | $(RELATIVE_OUT)/$(1) + $(if $(V),,@echo " GEN " $$(call relative-to-top,$$@)) + $(CAT) $$(INSTALL_UM_FRAGMENTS_$(1)) > $$@ +install_script: $(RELATIVE_OUT)/$(1)/install_um.sh +endif +endef +$(eval $(call create-install-um-script,target_neutral)) + +ifneq ($(SUPPORT_ANDROID_PLATFORM),) +$(foreach _t,$(TARGET_ALL_ARCH),$(eval $(call create-install-um-script,$(_t)))) +endif + +# Build the top-level install script that drives the install. +ifneq ($(SUPPORT_ANDROID_PLATFORM),) +install_sh_template := $(MAKE_TOP)/common/android/install.sh.tpl +else +install_sh_template := $(MAKE_TOP)/scripts/install.sh.tpl +endif + +$(RELATIVE_OUT)/install.sh: $(PVRVERSION_H) | $(RELATIVE_OUT) +# In customer packages only one of config.mk or config_kernel.mk will exist. +# We can depend on either one, as long as we rebuild the install script when +# the config options it uses change. +$(RELATIVE_OUT)/install.sh: $(call if-exists,$(CONFIG_MK),$(CONFIG_KERNEL_MK)) +$(RELATIVE_OUT)/install.sh: $(install_sh_template) + $(if $(V),,@echo " GEN " $(call relative-to-top,$@)) + $(ECHO) 's/\[PVRVERSION\]/$(subst /,\/,$(PVRVERSION))/g;' > $(RELATIVE_OUT)/install.sh.sed + $(ECHO) 's/\[PVRBUILD\]/$(BUILD)/g;' >> $(RELATIVE_OUT)/install.sh.sed + $(ECHO) 's/\[PRIMARY_ARCH\]/$(TARGET_PRIMARY_ARCH)/g;' >> $(RELATIVE_OUT)/install.sh.sed + $(ECHO) 's/\[ARCHITECTURES\]/$(TARGET_ALL_ARCH)/g;' >> $(RELATIVE_OUT)/install.sh.sed + $(ECHO) 's/\[LWS_PREFIX\]/$(subst /,\/,$(LWS_PREFIX))/g;' >> $(RELATIVE_OUT)/install.sh.sed + $(ECHO) 's/\[SHLIB_DESTDIR\]/$(subst /,\/,$(SHLIB_DESTDIR))/g;' >> $(RELATIVE_OUT)/install.sh.sed + @sed -f $(RELATIVE_OUT)/install.sh.sed $< > $@ + $(CHMOD) +x $@ + $(RM) $(RELATIVE_OUT)/install.sh.sed +install_script: $(RELATIVE_OUT)/install.sh +install_script_km: $(RELATIVE_OUT)/install.sh diff --git a/drivers/gpu/rogue_m/build/linux/sunxi_android/Makefile b/drivers/gpu/rogue_m/build/linux/sunxi_android/Makefile new file mode 100644 index 000000000000..5f22a0eb2a99 --- /dev/null +++ b/drivers/gpu/rogue_m/build/linux/sunxi_android/Makefile @@ -0,0 +1,89 @@ +########################################################################### ### +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +include ../config/preconfig.mk + +# If a TARGET_PRODUCT is specified but not a TARGET_DEVICE, try to +# derive the TARGET_DEVICE from TARGET_PRODUCT. +# + +ifeq ($(TARGET_DEVICE),) +override TARGET_DEVICE := \ + $(patsubst mini_%,%,$(patsubst full_%,%,$(TARGET_PRODUCT))) +ifneq ($(filter kylin_perf kylin_p1,$(TARGET_DEVICE)),) +override TARGET_DEVICE := sun9i +endif +endif + +ifeq ($(TARGET_DEVICE),) +override TARGET_DEVICE := sun9i +endif + +HAL_VARIANT := sun9i +PVR_SYSTEM := rgx_sunxi +LDM_PLATFORM := 1 +SUPPORT_ADF := 1 + +RGX_BVNC = 1.75.2.30 + +KERNEL_CROSS_COMPILE ?= arm-eabi- + +include ../common/android/paths.mk +include ../common/android/arch.mk +include ../common/android/features.mk + +ION_DEFAULT_HEAP_ID_MASK := (1 << ION_HEAP_TYPE_DMA) +ION_FALLBACK_HEAP_ID_MASK := (1 << ION_HEAP_TYPE_CARVEOUT) +ifneq ($(is_at_least_lollipop),1) +SYS_INCLUDES += \ + -isystem $(ANDROID_ROOT)/device/img/sun9i/adf/libadf/include \ + -isystem $(ANDROID_ROOT)/device/img/sun9i/adf/libadfhwc/include +endif + +DISPLAY_CONTROLLER ?= adf_sunxi + +KERNEL_COMPONENTS += $(DISPLAY_CONTROLLER) + +CACHEFLUSH_TYPE ?= CACHEFLUSH_GENERIC + +PDUMP_STREAMBUF_SIZE_MB := 10 + +include ../config/core.mk +include ../common/android/extra_config.mk diff --git a/drivers/gpu/rogue_m/build/linux/this_makefile.mk b/drivers/gpu/rogue_m/build/linux/this_makefile.mk new file mode 100644 index 000000000000..c31200123d0e --- /dev/null +++ b/drivers/gpu/rogue_m/build/linux/this_makefile.mk @@ -0,0 +1,68 @@ +########################################################################### ### +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +# Find out the path of the Linux.mk makefile currently being processed, and +# set paths used by the build rules + +# This magic is used so we can use this_makefile.mk twice: first when reading +# in each Linux.mk, and then again when generating rules. There we set +# $(THIS_MAKEFILE), and $(REMAINING_MAKEFILES) should be empty +ifneq ($(strip $(REMAINING_MAKEFILES)),) + +# Absolute path to the Linux.mk being processed +THIS_MAKEFILE := $(firstword $(REMAINING_MAKEFILES)) + +# The list of makefiles left to process +REMAINING_MAKEFILES := $(wordlist 2,$(words $(REMAINING_MAKEFILES)),$(REMAINING_MAKEFILES)) + +else + +# When generating rules, we should have read in every Linux.mk +$(if $(INTERNAL_INCLUDED_ALL_MAKEFILES),,$(error No makefiles left in $$(REMAINING_MAKEFILES), but $$(INTERNAL_INCLUDED_ALL_MAKEFILES) is not set)) + +endif + +# Path to the directory containing Linux.mk +THIS_DIR := $(patsubst %/,%,$(dir $(THIS_MAKEFILE))) +ifeq ($(strip $(THIS_DIR)),) +$(error Empty $$(THIS_DIR) for makefile "$(THIS_MAKEFILE)") +endif + +modules := diff --git a/drivers/gpu/rogue_m/build/linux/tools/cc-check.sh b/drivers/gpu/rogue_m/build/linux/tools/cc-check.sh new file mode 100644 index 000000000000..773a88f71118 --- /dev/null +++ b/drivers/gpu/rogue_m/build/linux/tools/cc-check.sh @@ -0,0 +1,120 @@ +#!/bin/sh +########################################################################### ### +#@File +#@Title Test the nature of the C compiler. +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +LANG=C +export LANG + +usage() { + echo "usage: $0 [--64] [--clang] --cc CC [--out OUT] [cflag]" + exit 1 +} + +check_clang() { + $CC -Wp,-dM -E - /dev/null 2>&1 + if [ "$?" = "0" ]; then + # Clang must be passed a program with a main() that returns 0. + # It will produce an error if main() is improperly specified. + IS_CLANG=1 + TEST_PROGRAM="int main(void){return 0;}" + else + # If we're not clang, assume we're GCC. GCC needs to be passed + # a program with a faulty return in main() so that another + # warning (unrelated to the flag being tested) is emitted. + # This will cause GCC to warn about the unsupported warning flag. + IS_CLANG=0 + TEST_PROGRAM="int main(void){return;}" + fi +} + +do_cc() { + echo "$TEST_PROGRAM" 2> /dev/null | $CC -W -Wall $3 -xc -c - -o $1 >$2 2>&1 +} + +while [ 1 ]; do + if [ "$1" = "--64" ]; then + [ -z $CLANG ] && BIT_CHECK=1 + elif [ "$1" = "--clang" ]; then + [ -z $BIT_CHECK ] && CLANG=1 + elif [ "$1" = "--cc" ]; then + [ "x$2" = "x" ] && usage + CC="$2" && shift + elif [ "$1" = "--out" ]; then + [ "x$2" = "x" ] && usage + OUT="$2" && shift + elif [ "${1#--}" != "$1" ]; then + usage + else + break + fi + shift +done + +[ "x$CC" = "x" ] && usage +[ "x$CLANG" = "x" -a "x$OUT" = "x" ] && usage +ccof=$OUT/cc-sanity-check +log=${ccof}.log + +check_clang + +if [ "x$BIT_CHECK" = "x1" ]; then + do_cc $ccof $log "" + file $ccof | grep 64-bit >/dev/null 2>&1 + [ "$?" = "0" ] && echo true || echo false +elif [ "x$CLANG" = "x1" ]; then + [ "x$IS_CLANG" = "x1" ] && echo true || echo false +else + [ "x$1" = "x" ] && usage + do_cc $ccof $log $1 + if [ "$?" = "0" ]; then + # compile passed, but was the warning unrecognized? + if [ "x$IS_CLANG" = "x1" ]; then + grep "^warning: unknown warning option '$1'" $log >/dev/null 2>&1 + else + grep -E "(^cc1: warning: unrecognized command line option \"$1\"|^cc1: warning: command line option \"$1\" is valid for C\+\+/ObjC\+\+ but not for C|gcc: unrecognized option '$1')" $log >/dev/null 2>&1 + fi + [ "$?" = "1" ] && echo $1 + fi +fi + +rm -f $ccof $log +exit 0 diff --git a/drivers/gpu/rogue_m/build/linux/toplevel.mk b/drivers/gpu/rogue_m/build/linux/toplevel.mk new file mode 100644 index 000000000000..fba84a1d1dae --- /dev/null +++ b/drivers/gpu/rogue_m/build/linux/toplevel.mk @@ -0,0 +1,303 @@ +########################################################################### ### +#@File +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +# Define the default goal. This masks a previous definition of the default +# goal in config/core.mk, which must match this one +.PHONY: build +build: components + +MAKE_TOP := build/linux +THIS_MAKEFILE := (top-level makefiles) + +include $(MAKE_TOP)/defs.mk + +ifeq ($(OUT),) +$(error Must specify output directory with OUT=) +endif + +ifeq ($(TOP),) +$(error Must specify root of source tree with TOP=) +endif +$(call directory-must-exist,$(TOP)) + +# RELATIVE_OUT is relative only if it's under $(TOP) +RELATIVE_OUT := $(patsubst $(TOP)/%,%,$(OUT)) +CONFIG_MK := $(RELATIVE_OUT)/config.mk +CONFIG_H := $(RELATIVE_OUT)/config.h +CONFIG_KERNEL_MK := $(RELATIVE_OUT)/config_kernel.mk +CONFIG_KERNEL_H := $(RELATIVE_OUT)/config_kernel.h + +# Convert commas to spaces in $(D). This is so you can say "make +# D=config-changes,freeze-config" and have $(filter config-changes,$(D)) +# still work. +comma := , +empty := +space := $(empty) $(empty) +override D := $(subst $(comma),$(space),$(D)) + +ifneq ($(INTERNAL_CLOBBER_ONLY),true) +# Create the out directory +# +$(shell mkdir -p $(OUT)) + +# If these generated files differ from any pre-existing ones, +# replace them, causing affected parts of the driver to rebuild. +# +_want_config_diff := $(filter config-changes,$(D)) +_freeze_config := $(strip $(filter freeze-config,$(D))) +_updated_config_files := $(shell \ + $(if $(_want_config_diff),rm -f $(OUT)/config.diff;,) \ + for file in $(CONFIG_MK) $(CONFIG_H) \ + $(CONFIG_KERNEL_MK) $(CONFIG_KERNEL_H); do \ + diff -U 0 $$file $$file.new \ + >>$(if $(_want_config_diff),$(OUT)/config.diff,/dev/null) 2>/dev/null \ + && rm -f $$file.new \ + || echo $$file; \ + done) + +ifneq ($(_want_config_diff),) +# We send the diff to stderr so it isn't captured by $(shell) +$(shell [ -s $(OUT)/config.diff ] && echo >&2 "Configuration changed in $(RELATIVE_OUT):" && cat >&2 $(OUT)/config.diff) +endif + +ifneq ($(_freeze_config),) +$(if $(_updated_config_files),$(error Configuration change in $(RELATIVE_OUT) prevented by D=freeze-config),) +endif + +# Update the config, if changed +$(foreach _f,$(_updated_config_files), \ + $(shell mv -f $(_f).new $(_f) >/dev/null 2>/dev/null)) + +endif # INTERNAL_CLOBBER_ONLY + +MAKEFLAGS := -Rr --no-print-directory + +ifneq ($(INTERNAL_CLOBBER_ONLY),true) + +# This is so you can say "find $(TOP) -name Linux.mk > /tmp/something; export +# ALL_MAKEFILES=/tmp/something; make" and avoid having to run find. This is +# handy if your source tree is mounted over NFS or something +override ALL_MAKEFILES := $(call relative-to-top,$(if $(strip $(ALL_MAKEFILES)),$(shell cat $(ALL_MAKEFILES)),$(shell find $(TOP) -type f -name Linux.mk -print -o -type d -name '.*' -prune))) +ifeq ($(strip $(ALL_MAKEFILES)),) +$(info ** Unable to find any Linux.mk files under $$(TOP). This could mean that) +$(info ** there are no makefiles, or that ALL_MAKEFILES is set in the environment) +$(info ** and points to a nonexistent or empty file.) +$(error No makefiles) +endif + +else # clobber-only +ALL_MAKEFILES := +endif + +unexport ALL_MAKEFILES + +REMAINING_MAKEFILES := $(ALL_MAKEFILES) +ALL_MODULES := +INTERNAL_INCLUDED_ALL_MAKEFILES := + +ALL_LDFLAGS := + +# Please do not change the format of the following lines +-include $(CONFIG_MK) +-include $(CONFIG_KERNEL_MK) +# OK to change now + +# If we haven't set host/target archs, set some sensible defaults now. +# This allows things like prune.sh to work +ifeq ($(HOST_PRIMARY_ARCH),) +ifneq ($(FORCE_ARCH),) +HOST_PRIMARY_ARCH := host_x86_64 +HOST_32BIT_ARCH := host_i386 + +_ALL_ARCHS := \ + $(filter-out %target_neutral.mk,$(wildcard $(MAKE_TOP)/moduledefs/target_*.mk)) +TARGET_PRIMARY_ARCH := \ + $(patsubst $(MAKE_TOP)/moduledefs/%.mk,%,$(word 1, $(_ALL_ARCHS))) + +TARGET_ALL_ARCH := $(TARGET_PRIMARY_ARCH) +endif +endif + +# Output directory for configuration, object code, +# final programs/libraries, and install/rc scripts. +HOST_OUT := $(RELATIVE_OUT)/$(HOST_PRIMARY_ARCH) +HOST_32BIT_OUT := $(RELATIVE_OUT)/$(HOST_32BIT_ARCH) +TARGET_OUT := $(RELATIVE_OUT)/$(TARGET_PRIMARY_ARCH) +TARGET_PRIMARY_OUT := $(RELATIVE_OUT)/$(TARGET_PRIMARY_ARCH) +TARGET_NEUTRAL_OUT := $(RELATIVE_OUT)/target_neutral +BRIDGE_SOURCE_ROOT := $(call if-exists,$(TOP)/generated,$(TARGET_NEUTRAL_OUT)/intermediates) +GENERATED_CODE_OUT := $(TARGET_NEUTRAL_OUT)/intermediates +DOCS_OUT := $(RELATIVE_OUT)/doc + +# +# neutrino/subst_makefiles.mk must be included after Output directories have been defined, +# because it overrides BRIDGE_SOURCE_ROOT of bridges to be built. If we include this makefile +# earlier, the value of BRIDGE_SOURCE_ROOT set in neutrino/subst_makefiles.mk will be overwritten. +ifeq ($(SUPPORT_NEUTRINO_PLATFORM),1) +include $(MAKE_TOP)/common/neutrino/subst_makefiles.mk +# neutrino/subst_makefiles.mk overrides ALL_MAKEFILES. +# Set REMAINING_MAKEFILES to the new value of ALL_MAKEFILES +REMAINING_MAKEFILES := $(ALL_MAKEFILES) +endif + +# Mark subdirectories of $(OUT) as secondary, and provide rules to create +# them. +OUT_SUBDIRS := $(addprefix $(RELATIVE_OUT)/,$(TARGET_ALL_ARCH)) \ + $(TARGET_NEUTRAL_OUT) $(DOCS_OUT) $(if $(HOST_PRIMARY_ARCH),$(sort $(HOST_OUT) $(HOST_32BIT_OUT))) +.SECONDARY: $(OUT_SUBDIRS) +$(OUT_SUBDIRS): + $(make-directory) + +ifneq ($(INTERNAL_CLOBBER_ONLY),true) +-include $(MAKE_TOP)/pvrversion.mk +ifeq ($(SUPPORT_BUILD_LWS),1) +-include $(MAKE_TOP)/lwsconf.mk +endif +-include $(MAKE_TOP)/llvm.mk +-include $(MAKE_TOP)/common/bridges.mk +endif + +include $(MAKE_TOP)/commands.mk +include $(MAKE_TOP)/buildvars.mk + +HOST_INTERMEDIATES := $(HOST_OUT)/intermediates +TARGET_INTERMEDIATES := $(TARGET_OUT)/intermediates + +ifneq ($(KERNEL_COMPONENTS),) +build: kbuild +endif + +# "make bridges" makes all the modules which are bridges. This is used by +# builds which ship pregenerated bridge headers. +.PHONY: bridges +bridges: $(BRIDGES) $(DIRECT_BRIDGES) + +# Include each Linux.mk, then include modules.mk to save some information +# about each module +include $(foreach _Linux.mk,$(ALL_MAKEFILES),$(MAKE_TOP)/this_makefile.mk $(_Linux.mk) $(MAKE_TOP)/modules.mk) + +ifeq ($(strip $(REMAINING_MAKEFILES)),) +INTERNAL_INCLUDED_ALL_MAKEFILES := true +else +$(error Impossible: $(words $(REMAINING_MAKEFILES)) makefiles were mysteriously ignored when reading $$(ALL_MAKEFILES)) +endif + +# At this point, all Linux.mks have been included. Now generate rules to build +# each module: for each module in $(ALL_MODULES), set per-makefile variables +$(foreach _m,$(ALL_MODULES),$(eval $(call process-module,$(_m)))) + +.PHONY: kbuild install +kbuild install: + +ifneq ($(INTERNAL_CLOBBER_ONLY),true) +-include $(MAKE_TOP)/scripts.mk +-include $(MAKE_TOP)/kbuild/kbuild.mk +endif +# We won't depend on 'build' here so that people can build subsets of +# components and still have the install script attempt to install the +# subset. +install: + @if [ ! -d "$(DISCIMAGE)" ]; then \ + echo; \ + echo "** DISCIMAGE was not set or does not point to a valid directory."; \ + echo "** Cannot continue with install."; \ + echo; \ + exit 1; \ + fi + @if [ ! -f $(RELATIVE_OUT)/install.sh ]; then \ + echo; \ + echo "** install.sh not found in $(RELATIVE_OUT)."; \ + echo "** Cannot continue with install."; \ + echo; \ + exit 1; \ + fi + @cd $(RELATIVE_OUT) && ./install.sh + +.PHONY: uninstall +uninstall: install_script +uninstall: + @if [ ! -d "$(DISCIMAGE)" ]; then \ + echo; \ + echo "** DISCIMAGE was not set or does not point to a valid directory."; \ + echo "** Cannot continue with uninstall."; \ + echo; \ + exit 1; \ + fi + @if [ ! -f $(RELATIVE_OUT)/install.sh ]; then \ + echo; \ + echo "** install.sh not found in $(RELATIVE_OUT)."; \ + echo "** Cannot continue with uninstall."; \ + echo; \ + exit 1; \ + fi + @cd $(RELATIVE_OUT) && ./install.sh -u + +# You can say 'make all_modules' to attempt to make everything, or 'make +# components' to only make the things which are listed (in the per-build +# makefiles) as components of the build. +.PHONY: all_modules all_docs components +all_modules: $(ALL_MODULES) +all_docs: ; +components: $(COMPONENTS) + +# Cleaning +.PHONY: clean clobber +clean: MODULE_DIRS_TO_REMOVE := $(OUT_SUBDIRS) +clean: + $(clean-dirs) +clobber: MODULE_DIRS_TO_REMOVE := $(OUT) +clobber: + $(clean-dirs) + +# Saying 'make clean-MODULE' removes the intermediates for MODULE. +# clobber-MODULE deletes the output files as well +clean-%: + $(if $(V),,@echo " RM " $(call relative-to-top,$(INTERNAL_CLEAN_TARGETS_FOR_$*))) + $(RM) -rf $(INTERNAL_CLEAN_TARGETS_FOR_$*) +clobber-%: + $(if $(V),,@echo " RM " $(call relative-to-top,$(INTERNAL_CLOBBER_TARGETS_FOR_$*))) + $(RM) -rf $(INTERNAL_CLOBBER_TARGETS_FOR_$*) + +include $(MAKE_TOP)/bits.mk + +# D=nobuild stops the build before any recipes are run. This line should +# come at the end of this makefile. +$(if $(filter nobuild,$(D)),$(error D=nobuild given),) diff --git a/drivers/gpu/rogue_m/config_kernel.h b/drivers/gpu/rogue_m/config_kernel.h new file mode 100644 index 000000000000..6303347cc976 --- /dev/null +++ b/drivers/gpu/rogue_m/config_kernel.h @@ -0,0 +1,38 @@ +#define SUPPORT_ION +#define PVR_ANDROID_ION_HEADER "../drivers/staging/android/ion/ion.h" +#define PVR_ANDROID_ION_PRIV_HEADER "../drivers/staging/android/ion/ion_priv.h" +#define PVR_ANDROID_ION_USE_SG_LENGTH +#define PVR_ANDROID_SYNC_HEADER "../drivers/staging/android/sync.h" +#define LINUX +#define PVR_BUILD_DIR "generic_arm_android" +#define PVR_BUILD_TYPE "release" +#define PVRSRV_MODNAME "pvrsrvkm" +#define SUPPORT_RGX 1 +#define RELEASE +#define RGX_BVNC_CORE_KM_HEADER "cores/rgxcore_km_5.9.1.46.h" +#define RGX_BNC_CONFIG_KM_HEADER "configs/rgxconfig_km_5.V.1.46.h" +#define SUPPORT_DBGDRV_EVENT_OBJECTS +#define PDUMP_STREAMBUF_MAX_SIZE_MB 16 +#define SYS_USING_INTERRUPTS +#define CACHEFLUSH_TYPE CACHEFLUSH_GENERIC +#define SUPPORT_SECURE_EXPORT +#define SUPPORT_GPUTRACE_EVENTS +#define GPUVIRT_VALIDATION_NUM_OS 8 +#define SUPPORT_LINUX_X86_WRITECOMBINE +#define SUPPORT_LINUX_X86_PAT +#define PVR_LINUX_USING_WORKQUEUES +#define PVR_LINUX_MISR_USING_PRIVATE_WORKQUEUE +#define PVR_LINUX_TIMERS_USING_WORKQUEUES +#define PVR_LDM_PLATFORM_PRE_REGISTERED +#define PVR_LDM_DRIVER_REGISTRATION_NAME "pvrsrvkm" +#define LDM_PLATFORM +#define PVRSRV_FULL_SYNC_TRACKING_HISTORY_LEN 256 +#define SUPPORT_PERCONTEXT_FREELIST +#define PVRSRV_ENABLE_PROCESS_STATS +#define PVR_LINUX_PHYSMEM_MAX_POOL_PAGES 10240 +#define PVR_LINUX_ARM_PAGEALLOC_FLUSH_THRESHOLD 256 +#define PVR_LINUX_PHYSMEM_MIN_NUM_PAGES 256 +#define PVR_LINUX_PHYSMEM_MAX_ALLOC_ORDER 2 +#define PVR_LINUX_KMALLOC_ALLOCATION_THRESHOLD 16384 +#define ANDROID +#define SUPPORT_NATIVE_FENCE_SYNC diff --git a/drivers/gpu/rogue_m/config_kernel.mk b/drivers/gpu/rogue_m/config_kernel.mk new file mode 100644 index 000000000000..482440c3da6b --- /dev/null +++ b/drivers/gpu/rogue_m/config_kernel.mk @@ -0,0 +1,26 @@ +override HOST_PRIMARY_ARCH := host_x86_64 +override HOST_32BIT_ARCH := host_i386 +override HOST_FORCE_32BIT := -m32 +override TARGET_PRIMARY_ARCH := target_aarch64 +override TARGET_SECONDARY_ARCH := target_armv7-a +override TARGET_ALL_ARCH := target_aarch64 target_armv7-a +override TARGET_FORCE_32BIT := +override KERNELDIR := /work/zxl/project/rk3368_6.0/kernel +override KERNEL_ID := 3.10.0 +override KERNEL_COMPONENTS := srvkm +override KERNEL_CROSS_COMPILE := aarch64-linux-android- +override SUPPORT_ION := 1 +override PVRSRV_MODNAME := pvrsrvkm +override PVR_BUILD_DIR := generic_arm_android +override PVR_BUILD_TYPE := release +override PVR_SYSTEM := rk3368 +override PVR_LOADER := +override BUILD := release +override DEBUGLINK := 1 +override CACHEFLUSH_TYPE := CACHEFLUSH_GENERIC +override SUPPORT_SECURE_EXPORT := 1 +override SUPPORT_GPUTRACE_EVENTS := 1 +override OPTIM := -O2 +override PVR_HANDLE_BACKEND := idr +override SUPPORT_ANDROID_PLATFORM := 1 +override SUPPORT_NATIVE_FENCE_SYNC := 1 diff --git a/drivers/gpu/rogue_m/generated/breakpoint_bridge/common_breakpoint_bridge.h b/drivers/gpu/rogue_m/generated/breakpoint_bridge/common_breakpoint_bridge.h new file mode 100644 index 000000000000..835666d3ff72 --- /dev/null +++ b/drivers/gpu/rogue_m/generated/breakpoint_bridge/common_breakpoint_bridge.h @@ -0,0 +1,158 @@ +/*************************************************************************/ /*! +@File +@Title Common bridge header for breakpoint +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Declares common defines and structures that are used by both + the client and sever side of the bridge for breakpoint +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef COMMON_BREAKPOINT_BRIDGE_H +#define COMMON_BREAKPOINT_BRIDGE_H + +#include "img_types.h" +#include "pvrsrv_error.h" + +#include "rgx_bridge.h" + + +#define PVRSRV_BRIDGE_BREAKPOINT_CMD_FIRST 0 +#define PVRSRV_BRIDGE_BREAKPOINT_RGXSETBREAKPOINT PVRSRV_BRIDGE_BREAKPOINT_CMD_FIRST+0 +#define PVRSRV_BRIDGE_BREAKPOINT_RGXCLEARBREAKPOINT PVRSRV_BRIDGE_BREAKPOINT_CMD_FIRST+1 +#define PVRSRV_BRIDGE_BREAKPOINT_RGXENABLEBREAKPOINT PVRSRV_BRIDGE_BREAKPOINT_CMD_FIRST+2 +#define PVRSRV_BRIDGE_BREAKPOINT_RGXDISABLEBREAKPOINT PVRSRV_BRIDGE_BREAKPOINT_CMD_FIRST+3 +#define PVRSRV_BRIDGE_BREAKPOINT_RGXOVERALLOCATEBPREGISTERS PVRSRV_BRIDGE_BREAKPOINT_CMD_FIRST+4 +#define PVRSRV_BRIDGE_BREAKPOINT_CMD_LAST (PVRSRV_BRIDGE_BREAKPOINT_CMD_FIRST+4) + + +/******************************************* + RGXSetBreakpoint + *******************************************/ + +/* Bridge in structure for RGXSetBreakpoint */ +typedef struct PVRSRV_BRIDGE_IN_RGXSETBREAKPOINT_TAG +{ + IMG_HANDLE hDevNode; + IMG_HANDLE hPrivData; + IMG_UINT32 eFWDataMaster; + IMG_UINT32 ui32BreakpointAddr; + IMG_UINT32 ui32HandlerAddr; + IMG_UINT32 ui32DM; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXSETBREAKPOINT; + + +/* Bridge out structure for RGXSetBreakpoint */ +typedef struct PVRSRV_BRIDGE_OUT_RGXSETBREAKPOINT_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXSETBREAKPOINT; + +/******************************************* + RGXClearBreakpoint + *******************************************/ + +/* Bridge in structure for RGXClearBreakpoint */ +typedef struct PVRSRV_BRIDGE_IN_RGXCLEARBREAKPOINT_TAG +{ + IMG_HANDLE hDevNode; + IMG_HANDLE hPrivData; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXCLEARBREAKPOINT; + + +/* Bridge out structure for RGXClearBreakpoint */ +typedef struct PVRSRV_BRIDGE_OUT_RGXCLEARBREAKPOINT_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXCLEARBREAKPOINT; + +/******************************************* + RGXEnableBreakpoint + *******************************************/ + +/* Bridge in structure for RGXEnableBreakpoint */ +typedef struct PVRSRV_BRIDGE_IN_RGXENABLEBREAKPOINT_TAG +{ + IMG_HANDLE hDevNode; + IMG_HANDLE hPrivData; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXENABLEBREAKPOINT; + + +/* Bridge out structure for RGXEnableBreakpoint */ +typedef struct PVRSRV_BRIDGE_OUT_RGXENABLEBREAKPOINT_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXENABLEBREAKPOINT; + +/******************************************* + RGXDisableBreakpoint + *******************************************/ + +/* Bridge in structure for RGXDisableBreakpoint */ +typedef struct PVRSRV_BRIDGE_IN_RGXDISABLEBREAKPOINT_TAG +{ + IMG_HANDLE hDevNode; + IMG_HANDLE hPrivData; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXDISABLEBREAKPOINT; + + +/* Bridge out structure for RGXDisableBreakpoint */ +typedef struct PVRSRV_BRIDGE_OUT_RGXDISABLEBREAKPOINT_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXDISABLEBREAKPOINT; + +/******************************************* + RGXOverallocateBPRegisters + *******************************************/ + +/* Bridge in structure for RGXOverallocateBPRegisters */ +typedef struct PVRSRV_BRIDGE_IN_RGXOVERALLOCATEBPREGISTERS_TAG +{ + IMG_HANDLE hDevNode; + IMG_UINT32 ui32TempRegs; + IMG_UINT32 ui32SharedRegs; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXOVERALLOCATEBPREGISTERS; + + +/* Bridge out structure for RGXOverallocateBPRegisters */ +typedef struct PVRSRV_BRIDGE_OUT_RGXOVERALLOCATEBPREGISTERS_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXOVERALLOCATEBPREGISTERS; + +#endif /* COMMON_BREAKPOINT_BRIDGE_H */ diff --git a/drivers/gpu/rogue_m/generated/breakpoint_bridge/server_breakpoint_bridge.c b/drivers/gpu/rogue_m/generated/breakpoint_bridge/server_breakpoint_bridge.c new file mode 100644 index 000000000000..e376604d0eae --- /dev/null +++ b/drivers/gpu/rogue_m/generated/breakpoint_bridge/server_breakpoint_bridge.c @@ -0,0 +1,392 @@ +/*************************************************************************/ /*! +@File +@Title Server bridge for breakpoint +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Implements the server side of the bridge for breakpoint +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#include +#include + +#include "img_defs.h" + +#include "rgxbreakpoint.h" + + +#include "common_breakpoint_bridge.h" + +#include "allocmem.h" +#include "pvr_debug.h" +#include "connection_server.h" +#include "pvr_bridge.h" +#include "rgx_bridge.h" +#include "srvcore.h" +#include "handle.h" + +#if defined (SUPPORT_AUTH) +#include "osauth.h" +#endif + +#include + + + + +/* *************************************************************************** + * Server-side bridge entry points + */ + +static IMG_INT +PVRSRVBridgeRGXSetBreakpoint(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_RGXSETBREAKPOINT *psRGXSetBreakpointIN, + PVRSRV_BRIDGE_OUT_RGXSETBREAKPOINT *psRGXSetBreakpointOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevNodeInt = IMG_NULL; + IMG_HANDLE hPrivDataInt = IMG_NULL; + + + + + + + + { + /* Look up the address from the handle */ + psRGXSetBreakpointOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &hDevNodeInt, + psRGXSetBreakpointIN->hDevNode, + PVRSRV_HANDLE_TYPE_DEV_NODE); + if(psRGXSetBreakpointOUT->eError != PVRSRV_OK) + { + goto RGXSetBreakpoint_exit; + } + } + + + { + /* Look up the address from the handle */ + psRGXSetBreakpointOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &hPrivDataInt, + psRGXSetBreakpointIN->hPrivData, + PVRSRV_HANDLE_TYPE_DEV_PRIV_DATA); + if(psRGXSetBreakpointOUT->eError != PVRSRV_OK) + { + goto RGXSetBreakpoint_exit; + } + } + + + psRGXSetBreakpointOUT->eError = + PVRSRVRGXSetBreakpointKM( + hDevNodeInt, + hPrivDataInt, + psRGXSetBreakpointIN->eFWDataMaster, + psRGXSetBreakpointIN->ui32BreakpointAddr, + psRGXSetBreakpointIN->ui32HandlerAddr, + psRGXSetBreakpointIN->ui32DM); + + + + +RGXSetBreakpoint_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXClearBreakpoint(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_RGXCLEARBREAKPOINT *psRGXClearBreakpointIN, + PVRSRV_BRIDGE_OUT_RGXCLEARBREAKPOINT *psRGXClearBreakpointOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevNodeInt = IMG_NULL; + IMG_HANDLE hPrivDataInt = IMG_NULL; + + + + + + + + { + /* Look up the address from the handle */ + psRGXClearBreakpointOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &hDevNodeInt, + psRGXClearBreakpointIN->hDevNode, + PVRSRV_HANDLE_TYPE_DEV_NODE); + if(psRGXClearBreakpointOUT->eError != PVRSRV_OK) + { + goto RGXClearBreakpoint_exit; + } + } + + + { + /* Look up the address from the handle */ + psRGXClearBreakpointOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &hPrivDataInt, + psRGXClearBreakpointIN->hPrivData, + PVRSRV_HANDLE_TYPE_DEV_PRIV_DATA); + if(psRGXClearBreakpointOUT->eError != PVRSRV_OK) + { + goto RGXClearBreakpoint_exit; + } + } + + + psRGXClearBreakpointOUT->eError = + PVRSRVRGXClearBreakpointKM( + hDevNodeInt, + hPrivDataInt); + + + + +RGXClearBreakpoint_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXEnableBreakpoint(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_RGXENABLEBREAKPOINT *psRGXEnableBreakpointIN, + PVRSRV_BRIDGE_OUT_RGXENABLEBREAKPOINT *psRGXEnableBreakpointOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevNodeInt = IMG_NULL; + IMG_HANDLE hPrivDataInt = IMG_NULL; + + + + + + + + { + /* Look up the address from the handle */ + psRGXEnableBreakpointOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &hDevNodeInt, + psRGXEnableBreakpointIN->hDevNode, + PVRSRV_HANDLE_TYPE_DEV_NODE); + if(psRGXEnableBreakpointOUT->eError != PVRSRV_OK) + { + goto RGXEnableBreakpoint_exit; + } + } + + + { + /* Look up the address from the handle */ + psRGXEnableBreakpointOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &hPrivDataInt, + psRGXEnableBreakpointIN->hPrivData, + PVRSRV_HANDLE_TYPE_DEV_PRIV_DATA); + if(psRGXEnableBreakpointOUT->eError != PVRSRV_OK) + { + goto RGXEnableBreakpoint_exit; + } + } + + + psRGXEnableBreakpointOUT->eError = + PVRSRVRGXEnableBreakpointKM( + hDevNodeInt, + hPrivDataInt); + + + + +RGXEnableBreakpoint_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXDisableBreakpoint(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_RGXDISABLEBREAKPOINT *psRGXDisableBreakpointIN, + PVRSRV_BRIDGE_OUT_RGXDISABLEBREAKPOINT *psRGXDisableBreakpointOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevNodeInt = IMG_NULL; + IMG_HANDLE hPrivDataInt = IMG_NULL; + + + + + + + + { + /* Look up the address from the handle */ + psRGXDisableBreakpointOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &hDevNodeInt, + psRGXDisableBreakpointIN->hDevNode, + PVRSRV_HANDLE_TYPE_DEV_NODE); + if(psRGXDisableBreakpointOUT->eError != PVRSRV_OK) + { + goto RGXDisableBreakpoint_exit; + } + } + + + { + /* Look up the address from the handle */ + psRGXDisableBreakpointOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &hPrivDataInt, + psRGXDisableBreakpointIN->hPrivData, + PVRSRV_HANDLE_TYPE_DEV_PRIV_DATA); + if(psRGXDisableBreakpointOUT->eError != PVRSRV_OK) + { + goto RGXDisableBreakpoint_exit; + } + } + + + psRGXDisableBreakpointOUT->eError = + PVRSRVRGXDisableBreakpointKM( + hDevNodeInt, + hPrivDataInt); + + + + +RGXDisableBreakpoint_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXOverallocateBPRegisters(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_RGXOVERALLOCATEBPREGISTERS *psRGXOverallocateBPRegistersIN, + PVRSRV_BRIDGE_OUT_RGXOVERALLOCATEBPREGISTERS *psRGXOverallocateBPRegistersOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevNodeInt = IMG_NULL; + + + + + + + + { + /* Look up the address from the handle */ + psRGXOverallocateBPRegistersOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &hDevNodeInt, + psRGXOverallocateBPRegistersIN->hDevNode, + PVRSRV_HANDLE_TYPE_DEV_NODE); + if(psRGXOverallocateBPRegistersOUT->eError != PVRSRV_OK) + { + goto RGXOverallocateBPRegisters_exit; + } + } + + + psRGXOverallocateBPRegistersOUT->eError = + PVRSRVRGXOverallocateBPRegistersKM( + hDevNodeInt, + psRGXOverallocateBPRegistersIN->ui32TempRegs, + psRGXOverallocateBPRegistersIN->ui32SharedRegs); + + + + +RGXOverallocateBPRegisters_exit: + + return 0; +} + + + +/* *************************************************************************** + * Server bridge dispatch related glue + */ + + +PVRSRV_ERROR InitBREAKPOINTBridge(IMG_VOID); +PVRSRV_ERROR DeinitBREAKPOINTBridge(IMG_VOID); + +/* + * Register all BREAKPOINT functions with services + */ +PVRSRV_ERROR InitBREAKPOINTBridge(IMG_VOID) +{ + + SetDispatchTableEntry(PVRSRV_BRIDGE_BREAKPOINT, PVRSRV_BRIDGE_BREAKPOINT_RGXSETBREAKPOINT, PVRSRVBridgeRGXSetBreakpoint, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_BREAKPOINT, PVRSRV_BRIDGE_BREAKPOINT_RGXCLEARBREAKPOINT, PVRSRVBridgeRGXClearBreakpoint, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_BREAKPOINT, PVRSRV_BRIDGE_BREAKPOINT_RGXENABLEBREAKPOINT, PVRSRVBridgeRGXEnableBreakpoint, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_BREAKPOINT, PVRSRV_BRIDGE_BREAKPOINT_RGXDISABLEBREAKPOINT, PVRSRVBridgeRGXDisableBreakpoint, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_BREAKPOINT, PVRSRV_BRIDGE_BREAKPOINT_RGXOVERALLOCATEBPREGISTERS, PVRSRVBridgeRGXOverallocateBPRegisters, + IMG_NULL, IMG_NULL, + 0, 0); + + + return PVRSRV_OK; +} + +/* + * Unregister all breakpoint functions with services + */ +PVRSRV_ERROR DeinitBREAKPOINTBridge(IMG_VOID) +{ + return PVRSRV_OK; +} + diff --git a/drivers/gpu/rogue_m/generated/cachegeneric_bridge/common_cachegeneric_bridge.h b/drivers/gpu/rogue_m/generated/cachegeneric_bridge/common_cachegeneric_bridge.h new file mode 100644 index 000000000000..8d3fd026b8ab --- /dev/null +++ b/drivers/gpu/rogue_m/generated/cachegeneric_bridge/common_cachegeneric_bridge.h @@ -0,0 +1,76 @@ +/*************************************************************************/ /*! +@File +@Title Common bridge header for cachegeneric +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Declares common defines and structures that are used by both + the client and sever side of the bridge for cachegeneric +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef COMMON_CACHEGENERIC_BRIDGE_H +#define COMMON_CACHEGENERIC_BRIDGE_H + +#include "img_types.h" +#include "pvrsrv_error.h" + +#include "cache_external.h" + + +#define PVRSRV_BRIDGE_CACHEGENERIC_CMD_FIRST 0 +#define PVRSRV_BRIDGE_CACHEGENERIC_CACHEOPQUEUE PVRSRV_BRIDGE_CACHEGENERIC_CMD_FIRST+0 +#define PVRSRV_BRIDGE_CACHEGENERIC_CMD_LAST (PVRSRV_BRIDGE_CACHEGENERIC_CMD_FIRST+0) + + +/******************************************* + CacheOpQueue + *******************************************/ + +/* Bridge in structure for CacheOpQueue */ +typedef struct PVRSRV_BRIDGE_IN_CACHEOPQUEUE_TAG +{ + PVRSRV_CACHE_OP iuCacheOp; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_CACHEOPQUEUE; + + +/* Bridge out structure for CacheOpQueue */ +typedef struct PVRSRV_BRIDGE_OUT_CACHEOPQUEUE_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_CACHEOPQUEUE; + +#endif /* COMMON_CACHEGENERIC_BRIDGE_H */ diff --git a/drivers/gpu/rogue_m/generated/cachegeneric_bridge/server_cachegeneric_bridge.c b/drivers/gpu/rogue_m/generated/cachegeneric_bridge/server_cachegeneric_bridge.c new file mode 100644 index 000000000000..359074ad8be3 --- /dev/null +++ b/drivers/gpu/rogue_m/generated/cachegeneric_bridge/server_cachegeneric_bridge.c @@ -0,0 +1,131 @@ +/*************************************************************************/ /*! +@File +@Title Server bridge for cachegeneric +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Implements the server side of the bridge for cachegeneric +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#include +#include + +#include "img_defs.h" + +#include "cache_generic.h" + + +#include "common_cachegeneric_bridge.h" + +#include "allocmem.h" +#include "pvr_debug.h" +#include "connection_server.h" +#include "pvr_bridge.h" +#include "rgx_bridge.h" +#include "srvcore.h" +#include "handle.h" + +#if defined (SUPPORT_AUTH) +#include "osauth.h" +#endif + +#include + + + + +/* *************************************************************************** + * Server-side bridge entry points + */ + +static IMG_INT +PVRSRVBridgeCacheOpQueue(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_CACHEOPQUEUE *psCacheOpQueueIN, + PVRSRV_BRIDGE_OUT_CACHEOPQUEUE *psCacheOpQueueOUT, + CONNECTION_DATA *psConnection) +{ + + PVR_UNREFERENCED_PARAMETER(psConnection); + + + + + + + psCacheOpQueueOUT->eError = + CacheOpQueue( + psCacheOpQueueIN->iuCacheOp); + + + + + + return 0; +} + + + +/* *************************************************************************** + * Server bridge dispatch related glue + */ + + +PVRSRV_ERROR InitCACHEGENERICBridge(IMG_VOID); +PVRSRV_ERROR DeinitCACHEGENERICBridge(IMG_VOID); + +/* + * Register all CACHEGENERIC functions with services + */ +PVRSRV_ERROR InitCACHEGENERICBridge(IMG_VOID) +{ + + SetDispatchTableEntry(PVRSRV_BRIDGE_CACHEGENERIC, PVRSRV_BRIDGE_CACHEGENERIC_CACHEOPQUEUE, PVRSRVBridgeCacheOpQueue, + IMG_NULL, IMG_NULL, + 0, 0); + + + return PVRSRV_OK; +} + +/* + * Unregister all cachegeneric functions with services + */ +PVRSRV_ERROR DeinitCACHEGENERICBridge(IMG_VOID) +{ + return PVRSRV_OK; +} + diff --git a/drivers/gpu/rogue_m/generated/cmm_bridge/common_cmm_bridge.h b/drivers/gpu/rogue_m/generated/cmm_bridge/common_cmm_bridge.h new file mode 100644 index 000000000000..c0ec88deb311 --- /dev/null +++ b/drivers/gpu/rogue_m/generated/cmm_bridge/common_cmm_bridge.h @@ -0,0 +1,115 @@ +/*************************************************************************/ /*! +@File +@Title Common bridge header for cmm +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Declares common defines and structures that are used by both + the client and sever side of the bridge for cmm +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef COMMON_CMM_BRIDGE_H +#define COMMON_CMM_BRIDGE_H + +#include "img_types.h" +#include "pvrsrv_error.h" + +#include "devicemem_typedefs.h" + + +#define PVRSRV_BRIDGE_CMM_CMD_FIRST 0 +#define PVRSRV_BRIDGE_CMM_DEVMEMINTCTXEXPORT PVRSRV_BRIDGE_CMM_CMD_FIRST+0 +#define PVRSRV_BRIDGE_CMM_DEVMEMINTCTXUNEXPORT PVRSRV_BRIDGE_CMM_CMD_FIRST+1 +#define PVRSRV_BRIDGE_CMM_DEVMEMINTCTXIMPORT PVRSRV_BRIDGE_CMM_CMD_FIRST+2 +#define PVRSRV_BRIDGE_CMM_CMD_LAST (PVRSRV_BRIDGE_CMM_CMD_FIRST+2) + + +/******************************************* + DevmemIntCtxExport + *******************************************/ + +/* Bridge in structure for DevmemIntCtxExport */ +typedef struct PVRSRV_BRIDGE_IN_DEVMEMINTCTXEXPORT_TAG +{ + IMG_HANDLE hDevMemServerContext; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_DEVMEMINTCTXEXPORT; + + +/* Bridge out structure for DevmemIntCtxExport */ +typedef struct PVRSRV_BRIDGE_OUT_DEVMEMINTCTXEXPORT_TAG +{ + IMG_HANDLE hDevMemIntCtxExport; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DEVMEMINTCTXEXPORT; + +/******************************************* + DevmemIntCtxUnexport + *******************************************/ + +/* Bridge in structure for DevmemIntCtxUnexport */ +typedef struct PVRSRV_BRIDGE_IN_DEVMEMINTCTXUNEXPORT_TAG +{ + IMG_HANDLE hDevMemIntCtxExport; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_DEVMEMINTCTXUNEXPORT; + + +/* Bridge out structure for DevmemIntCtxUnexport */ +typedef struct PVRSRV_BRIDGE_OUT_DEVMEMINTCTXUNEXPORT_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DEVMEMINTCTXUNEXPORT; + +/******************************************* + DevmemIntCtxImport + *******************************************/ + +/* Bridge in structure for DevmemIntCtxImport */ +typedef struct PVRSRV_BRIDGE_IN_DEVMEMINTCTXIMPORT_TAG +{ + IMG_HANDLE hDevMemIntCtxExport; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_DEVMEMINTCTXIMPORT; + + +/* Bridge out structure for DevmemIntCtxImport */ +typedef struct PVRSRV_BRIDGE_OUT_DEVMEMINTCTXIMPORT_TAG +{ + IMG_HANDLE hDevMemServerContext; + IMG_HANDLE hPrivData; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DEVMEMINTCTXIMPORT; + +#endif /* COMMON_CMM_BRIDGE_H */ diff --git a/drivers/gpu/rogue_m/generated/cmm_bridge/server_cmm_bridge.c b/drivers/gpu/rogue_m/generated/cmm_bridge/server_cmm_bridge.c new file mode 100644 index 000000000000..5c3fe15b8d97 --- /dev/null +++ b/drivers/gpu/rogue_m/generated/cmm_bridge/server_cmm_bridge.c @@ -0,0 +1,393 @@ +/*************************************************************************/ /*! +@File +@Title Server bridge for cmm +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Implements the server side of the bridge for cmm +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#include +#include + +#include "img_defs.h" + +#include "pmr.h" +#include "devicemem_server.h" + + +#include "common_cmm_bridge.h" + +#include "allocmem.h" +#include "pvr_debug.h" +#include "connection_server.h" +#include "pvr_bridge.h" +#include "rgx_bridge.h" +#include "srvcore.h" +#include "handle.h" + +#if defined (SUPPORT_AUTH) +#include "osauth.h" +#endif + +#include + + +static PVRSRV_ERROR ReleaseDevMemIntCtxExport(IMG_VOID *pvData) +{ + PVR_UNREFERENCED_PARAMETER(pvData); + + return PVRSRV_OK; +} + + +/* *************************************************************************** + * Server-side bridge entry points + */ + +static IMG_INT +PVRSRVBridgeDevmemIntCtxExport(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_DEVMEMINTCTXEXPORT *psDevmemIntCtxExportIN, + PVRSRV_BRIDGE_OUT_DEVMEMINTCTXEXPORT *psDevmemIntCtxExportOUT, + CONNECTION_DATA *psConnection) +{ + DEVMEMINT_CTX * psDevMemServerContextInt = IMG_NULL; + DEVMEMINT_CTX_EXPORT * psDevMemIntCtxExportInt = IMG_NULL; + IMG_HANDLE hDevMemIntCtxExportInt = IMG_NULL; + + + + + + + + { + /* Look up the address from the handle */ + psDevmemIntCtxExportOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psDevMemServerContextInt, + psDevmemIntCtxExportIN->hDevMemServerContext, + PVRSRV_HANDLE_TYPE_DEVMEMINT_CTX); + if(psDevmemIntCtxExportOUT->eError != PVRSRV_OK) + { + goto DevmemIntCtxExport_exit; + } + } + + + psDevmemIntCtxExportOUT->eError = + DevmemIntCtxExport( + psDevMemServerContextInt, + &psDevMemIntCtxExportInt); + /* Exit early if bridged call fails */ + if(psDevmemIntCtxExportOUT->eError != PVRSRV_OK) + { + goto DevmemIntCtxExport_exit; + } + + + /* + * For cases where we need a cross process handle we actually allocate two. + * + * The first one is a connection specific handle and it gets given the real + * release function. This handle does *NOT* get returned to the caller. It's + * purpose is to release any leaked resources when we either have a bad or + * abnormally terminated client. If we didn't do this then the resource + * wouldn't be freed until driver unload. If the resource is freed normally, + * this handle can be looked up via the cross process handle and then + * released accordingly. + * + * The second one is a cross process handle and it gets given a noop release + * function. This handle does get returned to the caller. + */ + psDevmemIntCtxExportOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &hDevMemIntCtxExportInt, + (IMG_VOID *) psDevMemIntCtxExportInt, + PVRSRV_HANDLE_TYPE_DEVMEMINT_CTX_EXPORT, + PVRSRV_HANDLE_ALLOC_FLAG_SHARED + ,(PFN_HANDLE_RELEASE)&DevmemIntCtxUnexport); + if (psDevmemIntCtxExportOUT->eError != PVRSRV_OK) + { + goto DevmemIntCtxExport_exit; + } + + psDevmemIntCtxExportOUT->eError = PVRSRVAllocHandle(KERNEL_HANDLE_BASE, + &psDevmemIntCtxExportOUT->hDevMemIntCtxExport, + (IMG_VOID *) psDevMemIntCtxExportInt, + PVRSRV_HANDLE_TYPE_DEVMEMINT_CTX_EXPORT, + PVRSRV_HANDLE_ALLOC_FLAG_MULTI, + (PFN_HANDLE_RELEASE)&ReleaseDevMemIntCtxExport); + if (psDevmemIntCtxExportOUT->eError != PVRSRV_OK) + { + goto DevmemIntCtxExport_exit; + } + + + +DevmemIntCtxExport_exit: + if (psDevmemIntCtxExportOUT->eError != PVRSRV_OK) + { + if (psDevmemIntCtxExportOUT->hDevMemIntCtxExport) + { + PVRSRV_ERROR eError = PVRSRVReleaseHandle(KERNEL_HANDLE_BASE, + (IMG_HANDLE) psDevmemIntCtxExportOUT->hDevMemIntCtxExport, + PVRSRV_HANDLE_TYPE_DEVMEMINT_CTX_EXPORT); + + /* Releasing the handle should free/destroy/release the resource. This should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + + } + + if (hDevMemIntCtxExportInt) + { + PVRSRV_ERROR eError = PVRSRVReleaseHandle(psConnection->psHandleBase, + hDevMemIntCtxExportInt, + PVRSRV_HANDLE_TYPE_DEVMEMINT_CTX_EXPORT); + + /* Releasing the handle should free/destroy/release the resource. This should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + + /* Avoid freeing/destroying/releasing the resource a second time below */ + psDevMemIntCtxExportInt = IMG_NULL; + } + + if (psDevMemIntCtxExportInt) + { + DevmemIntCtxUnexport(psDevMemIntCtxExportInt); + } + } + + + return 0; +} + +static IMG_INT +PVRSRVBridgeDevmemIntCtxUnexport(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_DEVMEMINTCTXUNEXPORT *psDevmemIntCtxUnexportIN, + PVRSRV_BRIDGE_OUT_DEVMEMINTCTXUNEXPORT *psDevmemIntCtxUnexportOUT, + CONNECTION_DATA *psConnection) +{ + DEVMEMINT_CTX_EXPORT * psDevMemIntCtxExportInt = IMG_NULL; + IMG_HANDLE hDevMemIntCtxExportInt = IMG_NULL; + + PVR_UNREFERENCED_PARAMETER(psConnection); + + + + + + + + psDevmemIntCtxUnexportOUT->eError = + PVRSRVLookupHandle(KERNEL_HANDLE_BASE, + (IMG_VOID **) &psDevMemIntCtxExportInt, + (IMG_HANDLE) psDevmemIntCtxUnexportIN->hDevMemIntCtxExport, + PVRSRV_HANDLE_TYPE_DEVMEMINT_CTX_EXPORT); + PVR_ASSERT(psDevmemIntCtxUnexportOUT->eError == PVRSRV_OK); + + /* + * Find the connection specific handle that represents the same data + * as the cross process handle as releasing it will actually call the + * data's real release function (see the function where the cross + * process handle is allocated for more details). + */ + psDevmemIntCtxUnexportOUT->eError = + PVRSRVFindHandle(psConnection->psHandleBase, + &hDevMemIntCtxExportInt, + psDevMemIntCtxExportInt, + PVRSRV_HANDLE_TYPE_DEVMEMINT_CTX_EXPORT); + PVR_ASSERT(psDevmemIntCtxUnexportOUT->eError == PVRSRV_OK); + + psDevmemIntCtxUnexportOUT->eError = + PVRSRVReleaseHandle(psConnection->psHandleBase, + hDevMemIntCtxExportInt, + PVRSRV_HANDLE_TYPE_DEVMEMINT_CTX_EXPORT); + PVR_ASSERT((psDevmemIntCtxUnexportOUT->eError == PVRSRV_OK) || (psDevmemIntCtxUnexportOUT->eError == PVRSRV_ERROR_RETRY)); + + psDevmemIntCtxUnexportOUT->eError = + PVRSRVReleaseHandle(KERNEL_HANDLE_BASE, + (IMG_HANDLE) psDevmemIntCtxUnexportIN->hDevMemIntCtxExport, + PVRSRV_HANDLE_TYPE_DEVMEMINT_CTX_EXPORT); + if ((psDevmemIntCtxUnexportOUT->eError != PVRSRV_OK) && (psDevmemIntCtxUnexportOUT->eError != PVRSRV_ERROR_RETRY)) + { + PVR_ASSERT(0); + goto DevmemIntCtxUnexport_exit; + } + + + +DevmemIntCtxUnexport_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeDevmemIntCtxImport(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_DEVMEMINTCTXIMPORT *psDevmemIntCtxImportIN, + PVRSRV_BRIDGE_OUT_DEVMEMINTCTXIMPORT *psDevmemIntCtxImportOUT, + CONNECTION_DATA *psConnection) +{ + DEVMEMINT_CTX_EXPORT * psDevMemIntCtxExportInt = IMG_NULL; + DEVMEMINT_CTX * psDevMemServerContextInt = IMG_NULL; + IMG_HANDLE hPrivDataInt = IMG_NULL; + + + + psDevmemIntCtxImportOUT->hDevMemServerContext = IMG_NULL; + + + + + { + /* Look up the address from the handle */ + psDevmemIntCtxImportOUT->eError = + PVRSRVLookupHandle(KERNEL_HANDLE_BASE, + (IMG_VOID **) &psDevMemIntCtxExportInt, + psDevmemIntCtxImportIN->hDevMemIntCtxExport, + PVRSRV_HANDLE_TYPE_DEVMEMINT_CTX_EXPORT); + if(psDevmemIntCtxImportOUT->eError != PVRSRV_OK) + { + goto DevmemIntCtxImport_exit; + } + } + + + psDevmemIntCtxImportOUT->eError = + DevmemIntCtxImport( + psDevMemIntCtxExportInt, + &psDevMemServerContextInt, + &hPrivDataInt); + /* Exit early if bridged call fails */ + if(psDevmemIntCtxImportOUT->eError != PVRSRV_OK) + { + goto DevmemIntCtxImport_exit; + } + + + psDevmemIntCtxImportOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psDevmemIntCtxImportOUT->hDevMemServerContext, + (IMG_VOID *) psDevMemServerContextInt, + PVRSRV_HANDLE_TYPE_DEVMEMINT_CTX, + PVRSRV_HANDLE_ALLOC_FLAG_MULTI + ,(PFN_HANDLE_RELEASE)&DevmemIntCtxDestroy); + if (psDevmemIntCtxImportOUT->eError != PVRSRV_OK) + { + goto DevmemIntCtxImport_exit; + } + + + psDevmemIntCtxImportOUT->eError = PVRSRVAllocSubHandle(psConnection->psHandleBase, + &psDevmemIntCtxImportOUT->hPrivData, + (IMG_VOID *) hPrivDataInt, + PVRSRV_HANDLE_TYPE_DEV_PRIV_DATA, + PVRSRV_HANDLE_ALLOC_FLAG_MULTI + ,psDevmemIntCtxImportOUT->hDevMemServerContext); + if (psDevmemIntCtxImportOUT->eError != PVRSRV_OK) + { + goto DevmemIntCtxImport_exit; + } + + + + +DevmemIntCtxImport_exit: + if (psDevmemIntCtxImportOUT->eError != PVRSRV_OK) + { + if (psDevmemIntCtxImportOUT->hDevMemServerContext) + { + PVRSRV_ERROR eError = PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psDevmemIntCtxImportOUT->hDevMemServerContext, + PVRSRV_HANDLE_TYPE_DEVMEMINT_CTX); + + /* Releasing the handle should free/destroy/release the resource. This should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + + /* Avoid freeing/destroying/releasing the resource a second time below */ + psDevMemServerContextInt = IMG_NULL; + } + + + if (psDevMemServerContextInt) + { + DevmemIntCtxDestroy(psDevMemServerContextInt); + } + } + + + return 0; +} + + + +/* *************************************************************************** + * Server bridge dispatch related glue + */ + + +PVRSRV_ERROR InitCMMBridge(IMG_VOID); +PVRSRV_ERROR DeinitCMMBridge(IMG_VOID); + +/* + * Register all CMM functions with services + */ +PVRSRV_ERROR InitCMMBridge(IMG_VOID) +{ + + SetDispatchTableEntry(PVRSRV_BRIDGE_CMM, PVRSRV_BRIDGE_CMM_DEVMEMINTCTXEXPORT, PVRSRVBridgeDevmemIntCtxExport, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_CMM, PVRSRV_BRIDGE_CMM_DEVMEMINTCTXUNEXPORT, PVRSRVBridgeDevmemIntCtxUnexport, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_CMM, PVRSRV_BRIDGE_CMM_DEVMEMINTCTXIMPORT, PVRSRVBridgeDevmemIntCtxImport, + IMG_NULL, IMG_NULL, + 0, 0); + + + return PVRSRV_OK; +} + +/* + * Unregister all cmm functions with services + */ +PVRSRV_ERROR DeinitCMMBridge(IMG_VOID) +{ + return PVRSRV_OK; +} + diff --git a/drivers/gpu/rogue_m/generated/ddevicememhistory_bridge/client_devicememhistory_bridge.c b/drivers/gpu/rogue_m/generated/ddevicememhistory_bridge/client_devicememhistory_bridge.c new file mode 100644 index 000000000000..21225f7bc61d --- /dev/null +++ b/drivers/gpu/rogue_m/generated/ddevicememhistory_bridge/client_devicememhistory_bridge.c @@ -0,0 +1,88 @@ +/*************************************************************************/ /*! +@Title Direct client bridge for devicememhistory +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#include "client_devicememhistory_bridge.h" +#include "img_defs.h" +#include "pvr_debug.h" + +/* Module specific includes */ +#include "img_types.h" +#include "mm_common.h" + +#include "devicemem_history_server.h" + + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeDevicememHistoryMap(IMG_HANDLE hBridge, + IMG_DEV_VIRTADDR sDevVAddr, + IMG_DEVMEM_SIZE_T uiSize, + const IMG_CHAR *puiText) +{ + PVRSRV_ERROR eError; + PVR_UNREFERENCED_PARAMETER(hBridge); + + + eError = + DevicememHistoryMapKM( + sDevVAddr, + uiSize, + puiText); + + return eError; +} + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeDevicememHistoryUnmap(IMG_HANDLE hBridge, + IMG_DEV_VIRTADDR sDevVAddr, + IMG_DEVMEM_SIZE_T uiSize, + const IMG_CHAR *puiText) +{ + PVRSRV_ERROR eError; + PVR_UNREFERENCED_PARAMETER(hBridge); + + + eError = + DevicememHistoryUnmapKM( + sDevVAddr, + uiSize, + puiText); + + return eError; +} + diff --git a/drivers/gpu/rogue_m/generated/debugmisc_bridge/common_debugmisc_bridge.h b/drivers/gpu/rogue_m/generated/debugmisc_bridge/common_debugmisc_bridge.h new file mode 100644 index 000000000000..ef103fbeb203 --- /dev/null +++ b/drivers/gpu/rogue_m/generated/debugmisc_bridge/common_debugmisc_bridge.h @@ -0,0 +1,139 @@ +/*************************************************************************/ /*! +@File +@Title Common bridge header for debugmisc +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Declares common defines and structures that are used by both + the client and sever side of the bridge for debugmisc +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef COMMON_DEBUGMISC_BRIDGE_H +#define COMMON_DEBUGMISC_BRIDGE_H + +#include "img_types.h" +#include "pvrsrv_error.h" + +#include "devicemem_typedefs.h" +#include "rgx_bridge.h" +#include "pvrsrv_memallocflags.h" + + +#define PVRSRV_BRIDGE_DEBUGMISC_CMD_FIRST 0 +#define PVRSRV_BRIDGE_DEBUGMISC_DEBUGMISCSLCSETBYPASSSTATE PVRSRV_BRIDGE_DEBUGMISC_CMD_FIRST+0 +#define PVRSRV_BRIDGE_DEBUGMISC_RGXDEBUGMISCSETFWLOG PVRSRV_BRIDGE_DEBUGMISC_CMD_FIRST+1 +#define PVRSRV_BRIDGE_DEBUGMISC_RGXDEBUGMISCDUMPFREELISTPAGELIST PVRSRV_BRIDGE_DEBUGMISC_CMD_FIRST+2 +#define PVRSRV_BRIDGE_DEBUGMISC_PHYSMEMIMPORTSECBUF PVRSRV_BRIDGE_DEBUGMISC_CMD_FIRST+3 +#define PVRSRV_BRIDGE_DEBUGMISC_CMD_LAST (PVRSRV_BRIDGE_DEBUGMISC_CMD_FIRST+3) + + +/******************************************* + DebugMiscSLCSetBypassState + *******************************************/ + +/* Bridge in structure for DebugMiscSLCSetBypassState */ +typedef struct PVRSRV_BRIDGE_IN_DEBUGMISCSLCSETBYPASSSTATE_TAG +{ + IMG_HANDLE hDevNode; + IMG_UINT32 ui32Flags; + IMG_BOOL bIsBypassed; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_DEBUGMISCSLCSETBYPASSSTATE; + + +/* Bridge out structure for DebugMiscSLCSetBypassState */ +typedef struct PVRSRV_BRIDGE_OUT_DEBUGMISCSLCSETBYPASSSTATE_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DEBUGMISCSLCSETBYPASSSTATE; + +/******************************************* + RGXDebugMiscSetFWLog + *******************************************/ + +/* Bridge in structure for RGXDebugMiscSetFWLog */ +typedef struct PVRSRV_BRIDGE_IN_RGXDEBUGMISCSETFWLOG_TAG +{ + IMG_HANDLE hDevNode; + IMG_UINT32 ui32RGXFWLogType; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXDEBUGMISCSETFWLOG; + + +/* Bridge out structure for RGXDebugMiscSetFWLog */ +typedef struct PVRSRV_BRIDGE_OUT_RGXDEBUGMISCSETFWLOG_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXDEBUGMISCSETFWLOG; + +/******************************************* + RGXDebugMiscDumpFreelistPageList + *******************************************/ + +/* Bridge in structure for RGXDebugMiscDumpFreelistPageList */ +typedef struct PVRSRV_BRIDGE_IN_RGXDEBUGMISCDUMPFREELISTPAGELIST_TAG +{ + IMG_HANDLE hDevNode; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXDEBUGMISCDUMPFREELISTPAGELIST; + + +/* Bridge out structure for RGXDebugMiscDumpFreelistPageList */ +typedef struct PVRSRV_BRIDGE_OUT_RGXDEBUGMISCDUMPFREELISTPAGELIST_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXDEBUGMISCDUMPFREELISTPAGELIST; + +/******************************************* + PhysmemImportSecBuf + *******************************************/ + +/* Bridge in structure for PhysmemImportSecBuf */ +typedef struct PVRSRV_BRIDGE_IN_PHYSMEMIMPORTSECBUF_TAG +{ + IMG_HANDLE hDevNode; + IMG_DEVMEM_SIZE_T uiSize; + IMG_UINT32 ui32Log2PageSize; + PVRSRV_MEMALLOCFLAGS_T uiFlags; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_PHYSMEMIMPORTSECBUF; + + +/* Bridge out structure for PhysmemImportSecBuf */ +typedef struct PVRSRV_BRIDGE_OUT_PHYSMEMIMPORTSECBUF_TAG +{ + IMG_HANDLE hPMRPtr; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PHYSMEMIMPORTSECBUF; + +#endif /* COMMON_DEBUGMISC_BRIDGE_H */ diff --git a/drivers/gpu/rogue_m/generated/debugmisc_bridge/server_debugmisc_bridge.c b/drivers/gpu/rogue_m/generated/debugmisc_bridge/server_debugmisc_bridge.c new file mode 100644 index 000000000000..09dbc01f72e2 --- /dev/null +++ b/drivers/gpu/rogue_m/generated/debugmisc_bridge/server_debugmisc_bridge.c @@ -0,0 +1,314 @@ +/*************************************************************************/ /*! +@File +@Title Server bridge for debugmisc +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Implements the server side of the bridge for debugmisc +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#include +#include + +#include "img_defs.h" + +#include "devicemem_server.h" +#include "debugmisc_server.h" +#include "pmr.h" +#include "physmem_osmem.h" + + +#include "common_debugmisc_bridge.h" + +#include "allocmem.h" +#include "pvr_debug.h" +#include "connection_server.h" +#include "pvr_bridge.h" +#include "rgx_bridge.h" +#include "srvcore.h" +#include "handle.h" + +#if defined (SUPPORT_AUTH) +#include "osauth.h" +#endif + +#include + + + + +/* *************************************************************************** + * Server-side bridge entry points + */ + +static IMG_INT +PVRSRVBridgeDebugMiscSLCSetBypassState(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_DEBUGMISCSLCSETBYPASSSTATE *psDebugMiscSLCSetBypassStateIN, + PVRSRV_BRIDGE_OUT_DEBUGMISCSLCSETBYPASSSTATE *psDebugMiscSLCSetBypassStateOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevNodeInt = IMG_NULL; + + + + + + + + { + /* Look up the address from the handle */ + psDebugMiscSLCSetBypassStateOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &hDevNodeInt, + psDebugMiscSLCSetBypassStateIN->hDevNode, + PVRSRV_HANDLE_TYPE_DEV_NODE); + if(psDebugMiscSLCSetBypassStateOUT->eError != PVRSRV_OK) + { + goto DebugMiscSLCSetBypassState_exit; + } + } + + + psDebugMiscSLCSetBypassStateOUT->eError = + PVRSRVDebugMiscSLCSetBypassStateKM( + hDevNodeInt, + psDebugMiscSLCSetBypassStateIN->ui32Flags, + psDebugMiscSLCSetBypassStateIN->bIsBypassed); + + + + +DebugMiscSLCSetBypassState_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXDebugMiscSetFWLog(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_RGXDEBUGMISCSETFWLOG *psRGXDebugMiscSetFWLogIN, + PVRSRV_BRIDGE_OUT_RGXDEBUGMISCSETFWLOG *psRGXDebugMiscSetFWLogOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevNodeInt = IMG_NULL; + + + + + + + + { + /* Look up the address from the handle */ + psRGXDebugMiscSetFWLogOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &hDevNodeInt, + psRGXDebugMiscSetFWLogIN->hDevNode, + PVRSRV_HANDLE_TYPE_DEV_NODE); + if(psRGXDebugMiscSetFWLogOUT->eError != PVRSRV_OK) + { + goto RGXDebugMiscSetFWLog_exit; + } + } + + + psRGXDebugMiscSetFWLogOUT->eError = + PVRSRVRGXDebugMiscSetFWLogKM( + hDevNodeInt, + psRGXDebugMiscSetFWLogIN->ui32RGXFWLogType); + + + + +RGXDebugMiscSetFWLog_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXDebugMiscDumpFreelistPageList(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_RGXDEBUGMISCDUMPFREELISTPAGELIST *psRGXDebugMiscDumpFreelistPageListIN, + PVRSRV_BRIDGE_OUT_RGXDEBUGMISCDUMPFREELISTPAGELIST *psRGXDebugMiscDumpFreelistPageListOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevNodeInt = IMG_NULL; + + + + + + + + { + /* Look up the address from the handle */ + psRGXDebugMiscDumpFreelistPageListOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &hDevNodeInt, + psRGXDebugMiscDumpFreelistPageListIN->hDevNode, + PVRSRV_HANDLE_TYPE_DEV_NODE); + if(psRGXDebugMiscDumpFreelistPageListOUT->eError != PVRSRV_OK) + { + goto RGXDebugMiscDumpFreelistPageList_exit; + } + } + + + psRGXDebugMiscDumpFreelistPageListOUT->eError = + PVRSRVRGXDebugMiscDumpFreelistPageListKM( + hDevNodeInt); + + + + +RGXDebugMiscDumpFreelistPageList_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgePhysmemImportSecBuf(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_PHYSMEMIMPORTSECBUF *psPhysmemImportSecBufIN, + PVRSRV_BRIDGE_OUT_PHYSMEMIMPORTSECBUF *psPhysmemImportSecBufOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevNodeInt = IMG_NULL; + PMR * psPMRPtrInt = IMG_NULL; + + + + + + + + { + /* Look up the address from the handle */ + psPhysmemImportSecBufOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &hDevNodeInt, + psPhysmemImportSecBufIN->hDevNode, + PVRSRV_HANDLE_TYPE_DEV_NODE); + if(psPhysmemImportSecBufOUT->eError != PVRSRV_OK) + { + goto PhysmemImportSecBuf_exit; + } + } + + + psPhysmemImportSecBufOUT->eError = + PhysmemNewTDSecureBufPMR( + hDevNodeInt, + psPhysmemImportSecBufIN->uiSize, + psPhysmemImportSecBufIN->ui32Log2PageSize, + psPhysmemImportSecBufIN->uiFlags, + &psPMRPtrInt); + /* Exit early if bridged call fails */ + if(psPhysmemImportSecBufOUT->eError != PVRSRV_OK) + { + goto PhysmemImportSecBuf_exit; + } + + + psPhysmemImportSecBufOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psPhysmemImportSecBufOUT->hPMRPtr, + (IMG_VOID *) psPMRPtrInt, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR, + PVRSRV_HANDLE_ALLOC_FLAG_MULTI + ,(PFN_HANDLE_RELEASE)&PMRUnrefPMR); + if (psPhysmemImportSecBufOUT->eError != PVRSRV_OK) + { + goto PhysmemImportSecBuf_exit; + } + + + + +PhysmemImportSecBuf_exit: + if (psPhysmemImportSecBufOUT->eError != PVRSRV_OK) + { + if (psPMRPtrInt) + { + PMRUnrefPMR(psPMRPtrInt); + } + } + + + return 0; +} + + + +/* *************************************************************************** + * Server bridge dispatch related glue + */ + + +PVRSRV_ERROR InitDEBUGMISCBridge(IMG_VOID); +PVRSRV_ERROR DeinitDEBUGMISCBridge(IMG_VOID); + +/* + * Register all DEBUGMISC functions with services + */ +PVRSRV_ERROR InitDEBUGMISCBridge(IMG_VOID) +{ + + SetDispatchTableEntry(PVRSRV_BRIDGE_DEBUGMISC, PVRSRV_BRIDGE_DEBUGMISC_DEBUGMISCSLCSETBYPASSSTATE, PVRSRVBridgeDebugMiscSLCSetBypassState, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_DEBUGMISC, PVRSRV_BRIDGE_DEBUGMISC_RGXDEBUGMISCSETFWLOG, PVRSRVBridgeRGXDebugMiscSetFWLog, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_DEBUGMISC, PVRSRV_BRIDGE_DEBUGMISC_RGXDEBUGMISCDUMPFREELISTPAGELIST, PVRSRVBridgeRGXDebugMiscDumpFreelistPageList, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_DEBUGMISC, PVRSRV_BRIDGE_DEBUGMISC_PHYSMEMIMPORTSECBUF, PVRSRVBridgePhysmemImportSecBuf, + IMG_NULL, IMG_NULL, + 0, 0); + + + return PVRSRV_OK; +} + +/* + * Unregister all debugmisc functions with services + */ +PVRSRV_ERROR DeinitDEBUGMISCBridge(IMG_VOID) +{ + return PVRSRV_OK; +} + diff --git a/drivers/gpu/rogue_m/generated/devicememhistory_bridge/client_devicememhistory_bridge.h b/drivers/gpu/rogue_m/generated/devicememhistory_bridge/client_devicememhistory_bridge.h new file mode 100644 index 000000000000..c5ae4f754f6d --- /dev/null +++ b/drivers/gpu/rogue_m/generated/devicememhistory_bridge/client_devicememhistory_bridge.h @@ -0,0 +1,63 @@ +/*************************************************************************/ /*! +@File +@Title Client bridge header for devicememhistory +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Exports the client bridge functions for devicememhistory +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef CLIENT_DEVICEMEMHISTORY_BRIDGE_H +#define CLIENT_DEVICEMEMHISTORY_BRIDGE_H + +#include "pvr_bridge_client.h" +#include "pvr_bridge.h" + +#include "common_devicememhistory_bridge.h" + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeDevicememHistoryMap(IMG_HANDLE hBridge, + IMG_DEV_VIRTADDR sDevVAddr, + IMG_DEVMEM_SIZE_T uiSize, + const IMG_CHAR *puiText); + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeDevicememHistoryUnmap(IMG_HANDLE hBridge, + IMG_DEV_VIRTADDR sDevVAddr, + IMG_DEVMEM_SIZE_T uiSize, + const IMG_CHAR *puiText); + + +#endif /* CLIENT_DEVICEMEMHISTORY_BRIDGE_H */ diff --git a/drivers/gpu/rogue_m/generated/devicememhistory_bridge/common_devicememhistory_bridge.h b/drivers/gpu/rogue_m/generated/devicememhistory_bridge/common_devicememhistory_bridge.h new file mode 100644 index 000000000000..62ee4115c663 --- /dev/null +++ b/drivers/gpu/rogue_m/generated/devicememhistory_bridge/common_devicememhistory_bridge.h @@ -0,0 +1,99 @@ +/*************************************************************************/ /*! +@File +@Title Common bridge header for devicememhistory +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Declares common defines and structures that are used by both + the client and sever side of the bridge for devicememhistory +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef COMMON_DEVICEMEMHISTORY_BRIDGE_H +#define COMMON_DEVICEMEMHISTORY_BRIDGE_H + +#include "img_types.h" +#include "pvrsrv_error.h" + +#include "img_types.h" +#include "mm_common.h" + + +#define PVRSRV_BRIDGE_DEVICEMEMHISTORY_CMD_FIRST 0 +#define PVRSRV_BRIDGE_DEVICEMEMHISTORY_DEVICEMEMHISTORYMAP PVRSRV_BRIDGE_DEVICEMEMHISTORY_CMD_FIRST+0 +#define PVRSRV_BRIDGE_DEVICEMEMHISTORY_DEVICEMEMHISTORYUNMAP PVRSRV_BRIDGE_DEVICEMEMHISTORY_CMD_FIRST+1 +#define PVRSRV_BRIDGE_DEVICEMEMHISTORY_CMD_LAST (PVRSRV_BRIDGE_DEVICEMEMHISTORY_CMD_FIRST+1) + + +/******************************************* + DevicememHistoryMap + *******************************************/ + +/* Bridge in structure for DevicememHistoryMap */ +typedef struct PVRSRV_BRIDGE_IN_DEVICEMEMHISTORYMAP_TAG +{ + IMG_DEV_VIRTADDR sDevVAddr; + IMG_DEVMEM_SIZE_T uiSize; + const IMG_CHAR * puiText; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_DEVICEMEMHISTORYMAP; + + +/* Bridge out structure for DevicememHistoryMap */ +typedef struct PVRSRV_BRIDGE_OUT_DEVICEMEMHISTORYMAP_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DEVICEMEMHISTORYMAP; + +/******************************************* + DevicememHistoryUnmap + *******************************************/ + +/* Bridge in structure for DevicememHistoryUnmap */ +typedef struct PVRSRV_BRIDGE_IN_DEVICEMEMHISTORYUNMAP_TAG +{ + IMG_DEV_VIRTADDR sDevVAddr; + IMG_DEVMEM_SIZE_T uiSize; + const IMG_CHAR * puiText; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_DEVICEMEMHISTORYUNMAP; + + +/* Bridge out structure for DevicememHistoryUnmap */ +typedef struct PVRSRV_BRIDGE_OUT_DEVICEMEMHISTORYUNMAP_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DEVICEMEMHISTORYUNMAP; + +#endif /* COMMON_DEVICEMEMHISTORY_BRIDGE_H */ diff --git a/drivers/gpu/rogue_m/generated/devicememhistory_bridge/server_devicememhistory_bridge.c b/drivers/gpu/rogue_m/generated/devicememhistory_bridge/server_devicememhistory_bridge.c new file mode 100644 index 000000000000..95a19e79104e --- /dev/null +++ b/drivers/gpu/rogue_m/generated/devicememhistory_bridge/server_devicememhistory_bridge.c @@ -0,0 +1,217 @@ +/*************************************************************************/ /*! +@File +@Title Server bridge for devicememhistory +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Implements the server side of the bridge for devicememhistory +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#include +#include + +#include "img_defs.h" + +#include "devicemem_history_server.h" + + +#include "common_devicememhistory_bridge.h" + +#include "allocmem.h" +#include "pvr_debug.h" +#include "connection_server.h" +#include "pvr_bridge.h" +#include "rgx_bridge.h" +#include "srvcore.h" +#include "handle.h" + +#if defined (SUPPORT_AUTH) +#include "osauth.h" +#endif + +#include + +#include "lock.h" + + + +/* *************************************************************************** + * Server-side bridge entry points + */ + +static IMG_INT +PVRSRVBridgeDevicememHistoryMap(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_DEVICEMEMHISTORYMAP *psDevicememHistoryMapIN, + PVRSRV_BRIDGE_OUT_DEVICEMEMHISTORYMAP *psDevicememHistoryMapOUT, + CONNECTION_DATA *psConnection) +{ + IMG_CHAR *uiTextInt = IMG_NULL; + + PVR_UNREFERENCED_PARAMETER(psConnection); + + + + + { + uiTextInt = OSAllocMem(DEVICEMEM_HISTORY_TEXT_BUFSZ * sizeof(IMG_CHAR)); + if (!uiTextInt) + { + psDevicememHistoryMapOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto DevicememHistoryMap_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psDevicememHistoryMapIN->puiText, DEVICEMEM_HISTORY_TEXT_BUFSZ * sizeof(IMG_CHAR)) + || (OSCopyFromUser(NULL, uiTextInt, psDevicememHistoryMapIN->puiText, + DEVICEMEM_HISTORY_TEXT_BUFSZ * sizeof(IMG_CHAR)) != PVRSRV_OK) ) + { + psDevicememHistoryMapOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto DevicememHistoryMap_exit; + } + + + + psDevicememHistoryMapOUT->eError = + DevicememHistoryMapKM( + psDevicememHistoryMapIN->sDevVAddr, + psDevicememHistoryMapIN->uiSize, + uiTextInt); + + + + +DevicememHistoryMap_exit: + if (uiTextInt) + OSFreeMem(uiTextInt); + + return 0; +} + +static IMG_INT +PVRSRVBridgeDevicememHistoryUnmap(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_DEVICEMEMHISTORYUNMAP *psDevicememHistoryUnmapIN, + PVRSRV_BRIDGE_OUT_DEVICEMEMHISTORYUNMAP *psDevicememHistoryUnmapOUT, + CONNECTION_DATA *psConnection) +{ + IMG_CHAR *uiTextInt = IMG_NULL; + + PVR_UNREFERENCED_PARAMETER(psConnection); + + + + + { + uiTextInt = OSAllocMem(DEVICEMEM_HISTORY_TEXT_BUFSZ * sizeof(IMG_CHAR)); + if (!uiTextInt) + { + psDevicememHistoryUnmapOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto DevicememHistoryUnmap_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psDevicememHistoryUnmapIN->puiText, DEVICEMEM_HISTORY_TEXT_BUFSZ * sizeof(IMG_CHAR)) + || (OSCopyFromUser(NULL, uiTextInt, psDevicememHistoryUnmapIN->puiText, + DEVICEMEM_HISTORY_TEXT_BUFSZ * sizeof(IMG_CHAR)) != PVRSRV_OK) ) + { + psDevicememHistoryUnmapOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto DevicememHistoryUnmap_exit; + } + + + + psDevicememHistoryUnmapOUT->eError = + DevicememHistoryUnmapKM( + psDevicememHistoryUnmapIN->sDevVAddr, + psDevicememHistoryUnmapIN->uiSize, + uiTextInt); + + + + +DevicememHistoryUnmap_exit: + if (uiTextInt) + OSFreeMem(uiTextInt); + + return 0; +} + + + +/* *************************************************************************** + * Server bridge dispatch related glue + */ + +static POS_LOCK pDEVICEMEMHISTORYBridgeLock; +static IMG_BYTE pbyDEVICEMEMHISTORYBridgeBuffer[56 + 4]; + +PVRSRV_ERROR InitDEVICEMEMHISTORYBridge(IMG_VOID); +PVRSRV_ERROR DeinitDEVICEMEMHISTORYBridge(IMG_VOID); + +/* + * Register all DEVICEMEMHISTORY functions with services + */ +PVRSRV_ERROR InitDEVICEMEMHISTORYBridge(IMG_VOID) +{ + PVR_LOGR_IF_ERROR(OSLockCreate(&pDEVICEMEMHISTORYBridgeLock, LOCK_TYPE_PASSIVE), "OSLockCreate"); + + SetDispatchTableEntry(PVRSRV_BRIDGE_DEVICEMEMHISTORY, PVRSRV_BRIDGE_DEVICEMEMHISTORY_DEVICEMEMHISTORYMAP, PVRSRVBridgeDevicememHistoryMap, + pDEVICEMEMHISTORYBridgeLock, pbyDEVICEMEMHISTORYBridgeBuffer, + 56, 4); + + SetDispatchTableEntry(PVRSRV_BRIDGE_DEVICEMEMHISTORY, PVRSRV_BRIDGE_DEVICEMEMHISTORY_DEVICEMEMHISTORYUNMAP, PVRSRVBridgeDevicememHistoryUnmap, + pDEVICEMEMHISTORYBridgeLock, pbyDEVICEMEMHISTORYBridgeBuffer, + 56, 4); + + + return PVRSRV_OK; +} + +/* + * Unregister all devicememhistory functions with services + */ +PVRSRV_ERROR DeinitDEVICEMEMHISTORYBridge(IMG_VOID) +{ + PVR_LOGR_IF_ERROR(OSLockDestroy(pDEVICEMEMHISTORYBridgeLock), "OSLockDestroy"); + return PVRSRV_OK; +} + diff --git a/drivers/gpu/rogue_m/generated/dmabuf_bridge/common_dmabuf_bridge.h b/drivers/gpu/rogue_m/generated/dmabuf_bridge/common_dmabuf_bridge.h new file mode 100644 index 000000000000..a2fa1d1bf367 --- /dev/null +++ b/drivers/gpu/rogue_m/generated/dmabuf_bridge/common_dmabuf_bridge.h @@ -0,0 +1,80 @@ +/*************************************************************************/ /*! +@File +@Title Common bridge header for dmabuf +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Declares common defines and structures that are used by both + the client and sever side of the bridge for dmabuf +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef COMMON_DMABUF_BRIDGE_H +#define COMMON_DMABUF_BRIDGE_H + +#include "img_types.h" +#include "pvrsrv_error.h" + +#include "pvrsrv_memallocflags.h" + + +#define PVRSRV_BRIDGE_DMABUF_CMD_FIRST 0 +#define PVRSRV_BRIDGE_DMABUF_PHYSMEMIMPORTDMABUF PVRSRV_BRIDGE_DMABUF_CMD_FIRST+0 +#define PVRSRV_BRIDGE_DMABUF_CMD_LAST (PVRSRV_BRIDGE_DMABUF_CMD_FIRST+0) + + +/******************************************* + PhysmemImportDmaBuf + *******************************************/ + +/* Bridge in structure for PhysmemImportDmaBuf */ +typedef struct PVRSRV_BRIDGE_IN_PHYSMEMIMPORTDMABUF_TAG +{ + IMG_INT ifd; + PVRSRV_MEMALLOCFLAGS_T uiFlags; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_PHYSMEMIMPORTDMABUF; + + +/* Bridge out structure for PhysmemImportDmaBuf */ +typedef struct PVRSRV_BRIDGE_OUT_PHYSMEMIMPORTDMABUF_TAG +{ + IMG_HANDLE hPMRPtr; + IMG_DEVMEM_SIZE_T uiSize; + IMG_DEVMEM_ALIGN_T sAlign; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PHYSMEMIMPORTDMABUF; + +#endif /* COMMON_DMABUF_BRIDGE_H */ diff --git a/drivers/gpu/rogue_m/generated/dmabuf_bridge/server_dmabuf_bridge.c b/drivers/gpu/rogue_m/generated/dmabuf_bridge/server_dmabuf_bridge.c new file mode 100644 index 000000000000..f8d8100a20ed --- /dev/null +++ b/drivers/gpu/rogue_m/generated/dmabuf_bridge/server_dmabuf_bridge.c @@ -0,0 +1,162 @@ +/*************************************************************************/ /*! +@File +@Title Server bridge for dmabuf +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Implements the server side of the bridge for dmabuf +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#include +#include + +#include "img_defs.h" + +#include "physmem_dmabuf.h" +#include "pmr.h" + + +#include "common_dmabuf_bridge.h" + +#include "allocmem.h" +#include "pvr_debug.h" +#include "connection_server.h" +#include "pvr_bridge.h" +#include "rgx_bridge.h" +#include "srvcore.h" +#include "handle.h" + +#if defined (SUPPORT_AUTH) +#include "osauth.h" +#endif + +#include + + + + +/* *************************************************************************** + * Server-side bridge entry points + */ + +static IMG_INT +PVRSRVBridgePhysmemImportDmaBuf(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_PHYSMEMIMPORTDMABUF *psPhysmemImportDmaBufIN, + PVRSRV_BRIDGE_OUT_PHYSMEMIMPORTDMABUF *psPhysmemImportDmaBufOUT, + CONNECTION_DATA *psConnection) +{ + PMR * psPMRPtrInt = IMG_NULL; + + + + + + + + psPhysmemImportDmaBufOUT->eError = + PhysmemImportDmaBuf(psConnection, + psPhysmemImportDmaBufIN->ifd, + psPhysmemImportDmaBufIN->uiFlags, + &psPMRPtrInt, + &psPhysmemImportDmaBufOUT->uiSize, + &psPhysmemImportDmaBufOUT->sAlign); + /* Exit early if bridged call fails */ + if(psPhysmemImportDmaBufOUT->eError != PVRSRV_OK) + { + goto PhysmemImportDmaBuf_exit; + } + + + psPhysmemImportDmaBufOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psPhysmemImportDmaBufOUT->hPMRPtr, + (IMG_VOID *) psPMRPtrInt, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR, + PVRSRV_HANDLE_ALLOC_FLAG_MULTI + ,(PFN_HANDLE_RELEASE)&PMRUnrefPMR); + if (psPhysmemImportDmaBufOUT->eError != PVRSRV_OK) + { + goto PhysmemImportDmaBuf_exit; + } + + + + +PhysmemImportDmaBuf_exit: + if (psPhysmemImportDmaBufOUT->eError != PVRSRV_OK) + { + if (psPMRPtrInt) + { + PMRUnrefPMR(psPMRPtrInt); + } + } + + + return 0; +} + + + +/* *************************************************************************** + * Server bridge dispatch related glue + */ + + +PVRSRV_ERROR InitDMABUFBridge(IMG_VOID); +PVRSRV_ERROR DeinitDMABUFBridge(IMG_VOID); + +/* + * Register all DMABUF functions with services + */ +PVRSRV_ERROR InitDMABUFBridge(IMG_VOID) +{ + + SetDispatchTableEntry(PVRSRV_BRIDGE_DMABUF, PVRSRV_BRIDGE_DMABUF_PHYSMEMIMPORTDMABUF, PVRSRVBridgePhysmemImportDmaBuf, + IMG_NULL, IMG_NULL, + 0, 0); + + + return PVRSRV_OK; +} + +/* + * Unregister all dmabuf functions with services + */ +PVRSRV_ERROR DeinitDMABUFBridge(IMG_VOID) +{ + return PVRSRV_OK; +} + diff --git a/drivers/gpu/rogue_m/generated/dmm_bridge/client_mm_bridge.c b/drivers/gpu/rogue_m/generated/dmm_bridge/client_mm_bridge.c new file mode 100644 index 000000000000..47ab7c1689b0 --- /dev/null +++ b/drivers/gpu/rogue_m/generated/dmm_bridge/client_mm_bridge.c @@ -0,0 +1,555 @@ +/*************************************************************************/ /*! +@Title Direct client bridge for mm +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#include "client_mm_bridge.h" +#include "img_defs.h" +#include "pvr_debug.h" + +/* Module specific includes */ +#include "pvrsrv_memallocflags.h" +#include "devicemem_typedefs.h" + +#include "devicemem_server.h" +#include "pmr.h" +#include "devicemem_heapcfg.h" +#include "physmem.h" + + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgePMRExportPMR(IMG_HANDLE hBridge, + IMG_HANDLE hPMR, + IMG_HANDLE *phPMRExport, + IMG_UINT64 *pui64Size, + IMG_UINT32 *pui32Log2Contig, + IMG_UINT64 *pui64Password) +{ + PVRSRV_ERROR eError; + PMR * psPMRInt; + PMR_EXPORT * psPMRExportInt; + PVR_UNREFERENCED_PARAMETER(hBridge); + + psPMRInt = (PMR *) hPMR; + + eError = + PMRExportPMR( + psPMRInt, + &psPMRExportInt, + pui64Size, + pui32Log2Contig, + pui64Password); + + *phPMRExport = psPMRExportInt; + return eError; +} + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgePMRUnexportPMR(IMG_HANDLE hBridge, + IMG_HANDLE hPMRExport) +{ + PVRSRV_ERROR eError; + PMR_EXPORT * psPMRExportInt; + PVR_UNREFERENCED_PARAMETER(hBridge); + + psPMRExportInt = (PMR_EXPORT *) hPMRExport; + + eError = + PMRUnexportPMR( + psPMRExportInt); + + return eError; +} + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgePMRGetUID(IMG_HANDLE hBridge, + IMG_HANDLE hPMR, + IMG_UINT64 *pui64UID) +{ + PVRSRV_ERROR eError; + PMR * psPMRInt; + PVR_UNREFERENCED_PARAMETER(hBridge); + + psPMRInt = (PMR *) hPMR; + + eError = + PMRGetUID( + psPMRInt, + pui64UID); + + return eError; +} + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgePMRMakeServerExportClientExport(IMG_HANDLE hBridge, + DEVMEM_SERVER_EXPORTCOOKIE hPMRServerExport, + IMG_HANDLE *phPMRExportOut, + IMG_UINT64 *pui64Size, + IMG_UINT32 *pui32Log2Contig, + IMG_UINT64 *pui64Password) +{ + PVRSRV_ERROR eError; + DEVMEM_EXPORTCOOKIE * psPMRServerExportInt; + PMR_EXPORT * psPMRExportOutInt; + PVR_UNREFERENCED_PARAMETER(hBridge); + + psPMRServerExportInt = (DEVMEM_EXPORTCOOKIE *) hPMRServerExport; + + eError = + PMRMakeServerExportClientExport( + psPMRServerExportInt, + &psPMRExportOutInt, + pui64Size, + pui32Log2Contig, + pui64Password); + + *phPMRExportOut = psPMRExportOutInt; + return eError; +} + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgePMRUnmakeServerExportClientExport(IMG_HANDLE hBridge, + IMG_HANDLE hPMRExport) +{ + PVRSRV_ERROR eError; + PMR_EXPORT * psPMRExportInt; + PVR_UNREFERENCED_PARAMETER(hBridge); + + psPMRExportInt = (PMR_EXPORT *) hPMRExport; + + eError = + PMRUnmakeServerExportClientExport( + psPMRExportInt); + + return eError; +} + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgePMRImportPMR(IMG_HANDLE hBridge, + IMG_HANDLE hPMRExport, + IMG_UINT64 ui64uiPassword, + IMG_UINT64 ui64uiSize, + IMG_UINT32 ui32uiLog2Contig, + IMG_HANDLE *phPMR) +{ + PVRSRV_ERROR eError; + PMR_EXPORT * psPMRExportInt; + PMR * psPMRInt; + PVR_UNREFERENCED_PARAMETER(hBridge); + + psPMRExportInt = (PMR_EXPORT *) hPMRExport; + + eError = + PMRImportPMR( + psPMRExportInt, + ui64uiPassword, + ui64uiSize, + ui32uiLog2Contig, + &psPMRInt); + + *phPMR = psPMRInt; + return eError; +} + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeDevmemIntCtxCreate(IMG_HANDLE hBridge, + IMG_HANDLE hDeviceNode, + IMG_HANDLE *phDevMemServerContext, + IMG_HANDLE *phPrivData) +{ + PVRSRV_ERROR eError; + IMG_HANDLE hDeviceNodeInt; + DEVMEMINT_CTX * psDevMemServerContextInt; + IMG_HANDLE hPrivDataInt; + PVR_UNREFERENCED_PARAMETER(hBridge); + + hDeviceNodeInt = (IMG_HANDLE) hDeviceNode; + + eError = + DevmemIntCtxCreate( + hDeviceNodeInt, + &psDevMemServerContextInt, + &hPrivDataInt); + + *phDevMemServerContext = psDevMemServerContextInt; + *phPrivData = hPrivDataInt; + return eError; +} + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeDevmemIntCtxDestroy(IMG_HANDLE hBridge, + IMG_HANDLE hDevmemServerContext) +{ + PVRSRV_ERROR eError; + DEVMEMINT_CTX * psDevmemServerContextInt; + PVR_UNREFERENCED_PARAMETER(hBridge); + + psDevmemServerContextInt = (DEVMEMINT_CTX *) hDevmemServerContext; + + eError = + DevmemIntCtxDestroy( + psDevmemServerContextInt); + + return eError; +} + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeDevmemIntHeapCreate(IMG_HANDLE hBridge, + IMG_HANDLE hDevmemCtx, + IMG_DEV_VIRTADDR sHeapBaseAddr, + IMG_DEVMEM_SIZE_T uiHeapLength, + IMG_UINT32 ui32Log2DataPageSize, + IMG_HANDLE *phDevmemHeapPtr) +{ + PVRSRV_ERROR eError; + DEVMEMINT_CTX * psDevmemCtxInt; + DEVMEMINT_HEAP * psDevmemHeapPtrInt; + PVR_UNREFERENCED_PARAMETER(hBridge); + + psDevmemCtxInt = (DEVMEMINT_CTX *) hDevmemCtx; + + eError = + DevmemIntHeapCreate( + psDevmemCtxInt, + sHeapBaseAddr, + uiHeapLength, + ui32Log2DataPageSize, + &psDevmemHeapPtrInt); + + *phDevmemHeapPtr = psDevmemHeapPtrInt; + return eError; +} + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeDevmemIntHeapDestroy(IMG_HANDLE hBridge, + IMG_HANDLE hDevmemHeap) +{ + PVRSRV_ERROR eError; + DEVMEMINT_HEAP * psDevmemHeapInt; + PVR_UNREFERENCED_PARAMETER(hBridge); + + psDevmemHeapInt = (DEVMEMINT_HEAP *) hDevmemHeap; + + eError = + DevmemIntHeapDestroy( + psDevmemHeapInt); + + return eError; +} + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeDevmemIntMapPMR(IMG_HANDLE hBridge, + IMG_HANDLE hDevmemServerHeap, + IMG_HANDLE hReservation, + IMG_HANDLE hPMR, + PVRSRV_MEMALLOCFLAGS_T uiMapFlags, + IMG_HANDLE *phMapping) +{ + PVRSRV_ERROR eError; + DEVMEMINT_HEAP * psDevmemServerHeapInt; + DEVMEMINT_RESERVATION * psReservationInt; + PMR * psPMRInt; + DEVMEMINT_MAPPING * psMappingInt; + PVR_UNREFERENCED_PARAMETER(hBridge); + + psDevmemServerHeapInt = (DEVMEMINT_HEAP *) hDevmemServerHeap; + psReservationInt = (DEVMEMINT_RESERVATION *) hReservation; + psPMRInt = (PMR *) hPMR; + + eError = + DevmemIntMapPMR( + psDevmemServerHeapInt, + psReservationInt, + psPMRInt, + uiMapFlags, + &psMappingInt); + + *phMapping = psMappingInt; + return eError; +} + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeDevmemIntUnmapPMR(IMG_HANDLE hBridge, + IMG_HANDLE hMapping) +{ + PVRSRV_ERROR eError; + DEVMEMINT_MAPPING * psMappingInt; + PVR_UNREFERENCED_PARAMETER(hBridge); + + psMappingInt = (DEVMEMINT_MAPPING *) hMapping; + + eError = + DevmemIntUnmapPMR( + psMappingInt); + + return eError; +} + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeDevmemIntReserveRange(IMG_HANDLE hBridge, + IMG_HANDLE hDevmemServerHeap, + IMG_DEV_VIRTADDR sAddress, + IMG_DEVMEM_SIZE_T uiLength, + IMG_HANDLE *phReservation) +{ + PVRSRV_ERROR eError; + DEVMEMINT_HEAP * psDevmemServerHeapInt; + DEVMEMINT_RESERVATION * psReservationInt; + PVR_UNREFERENCED_PARAMETER(hBridge); + + psDevmemServerHeapInt = (DEVMEMINT_HEAP *) hDevmemServerHeap; + + eError = + DevmemIntReserveRange( + psDevmemServerHeapInt, + sAddress, + uiLength, + &psReservationInt); + + *phReservation = psReservationInt; + return eError; +} + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeDevmemIntUnreserveRange(IMG_HANDLE hBridge, + IMG_HANDLE hReservation) +{ + PVRSRV_ERROR eError; + DEVMEMINT_RESERVATION * psReservationInt; + PVR_UNREFERENCED_PARAMETER(hBridge); + + psReservationInt = (DEVMEMINT_RESERVATION *) hReservation; + + eError = + DevmemIntUnreserveRange( + psReservationInt); + + return eError; +} + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgePhysmemNewRamBackedPMR(IMG_HANDLE hBridge, + IMG_HANDLE hDeviceNode, + IMG_DEVMEM_SIZE_T uiSize, + IMG_DEVMEM_SIZE_T uiChunkSize, + IMG_UINT32 ui32NumPhysChunks, + IMG_UINT32 ui32NumVirtChunks, + IMG_BOOL *pbMappingTable, + IMG_UINT32 ui32Log2PageSize, + PVRSRV_MEMALLOCFLAGS_T uiFlags, + IMG_HANDLE *phPMRPtr) +{ + PVRSRV_ERROR eError; + IMG_HANDLE hDeviceNodeInt; + PMR * psPMRPtrInt; + PVR_UNREFERENCED_PARAMETER(hBridge); + + hDeviceNodeInt = (IMG_HANDLE) hDeviceNode; + + eError = + PhysmemNewRamBackedPMR( + hDeviceNodeInt, + uiSize, + uiChunkSize, + ui32NumPhysChunks, + ui32NumVirtChunks, + pbMappingTable, + ui32Log2PageSize, + uiFlags, + &psPMRPtrInt); + + *phPMRPtr = psPMRPtrInt; + return eError; +} + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgePMRLocalImportPMR(IMG_HANDLE hBridge, + IMG_HANDLE hExtHandle, + IMG_HANDLE *phPMR, + IMG_DEVMEM_SIZE_T *puiSize, + IMG_DEVMEM_ALIGN_T *psAlign) +{ + PVRSRV_ERROR eError; + PMR * psExtHandleInt; + PMR * psPMRInt; + PVR_UNREFERENCED_PARAMETER(hBridge); + + psExtHandleInt = (PMR *) hExtHandle; + + eError = + PMRLocalImportPMR( + psExtHandleInt, + &psPMRInt, + puiSize, + psAlign); + + *phPMR = psPMRInt; + return eError; +} + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgePMRUnrefPMR(IMG_HANDLE hBridge, + IMG_HANDLE hPMR) +{ + PVRSRV_ERROR eError; + PMR * psPMRInt; + PVR_UNREFERENCED_PARAMETER(hBridge); + + psPMRInt = (PMR *) hPMR; + + eError = + PMRUnrefPMR( + psPMRInt); + + return eError; +} + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeDevmemSLCFlushInvalRequest(IMG_HANDLE hBridge, + IMG_HANDLE hDeviceNode, + IMG_HANDLE hPmr) +{ + PVRSRV_ERROR eError; + IMG_HANDLE hDeviceNodeInt; + PMR * psPmrInt; + PVR_UNREFERENCED_PARAMETER(hBridge); + + hDeviceNodeInt = (IMG_HANDLE) hDeviceNode; + psPmrInt = (PMR *) hPmr; + + eError = + DevmemSLCFlushInvalRequest( + hDeviceNodeInt, + psPmrInt); + + return eError; +} + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeDevmemIsVDevAddrValid(IMG_HANDLE hBridge, + IMG_HANDLE hDevmemCtx, + IMG_DEV_VIRTADDR sAddress) +{ + PVRSRV_ERROR eError; + DEVMEMINT_CTX * psDevmemCtxInt; + PVR_UNREFERENCED_PARAMETER(hBridge); + + psDevmemCtxInt = (DEVMEMINT_CTX *) hDevmemCtx; + + eError = + DevmemIntIsVDevAddrValid( + psDevmemCtxInt, + sAddress); + + return eError; +} + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeHeapCfgHeapConfigCount(IMG_HANDLE hBridge, + IMG_HANDLE hDeviceNode, + IMG_UINT32 *pui32NumHeapConfigs) +{ + PVRSRV_ERROR eError; + IMG_HANDLE hDeviceNodeInt; + PVR_UNREFERENCED_PARAMETER(hBridge); + + hDeviceNodeInt = (IMG_HANDLE) hDeviceNode; + + eError = + HeapCfgHeapConfigCount( + hDeviceNodeInt, + pui32NumHeapConfigs); + + return eError; +} + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeHeapCfgHeapCount(IMG_HANDLE hBridge, + IMG_HANDLE hDeviceNode, + IMG_UINT32 ui32HeapConfigIndex, + IMG_UINT32 *pui32NumHeaps) +{ + PVRSRV_ERROR eError; + IMG_HANDLE hDeviceNodeInt; + PVR_UNREFERENCED_PARAMETER(hBridge); + + hDeviceNodeInt = (IMG_HANDLE) hDeviceNode; + + eError = + HeapCfgHeapCount( + hDeviceNodeInt, + ui32HeapConfigIndex, + pui32NumHeaps); + + return eError; +} + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeHeapCfgHeapConfigName(IMG_HANDLE hBridge, + IMG_HANDLE hDeviceNode, + IMG_UINT32 ui32HeapConfigIndex, + IMG_UINT32 ui32HeapConfigNameBufSz, + IMG_CHAR *puiHeapConfigName) +{ + PVRSRV_ERROR eError; + IMG_HANDLE hDeviceNodeInt; + PVR_UNREFERENCED_PARAMETER(hBridge); + + hDeviceNodeInt = (IMG_HANDLE) hDeviceNode; + + eError = + HeapCfgHeapConfigName( + hDeviceNodeInt, + ui32HeapConfigIndex, + ui32HeapConfigNameBufSz, + puiHeapConfigName); + + return eError; +} + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeHeapCfgHeapDetails(IMG_HANDLE hBridge, + IMG_HANDLE hDeviceNode, + IMG_UINT32 ui32HeapConfigIndex, + IMG_UINT32 ui32HeapIndex, + IMG_UINT32 ui32HeapNameBufSz, + IMG_CHAR *puiHeapNameOut, + IMG_DEV_VIRTADDR *psDevVAddrBase, + IMG_DEVMEM_SIZE_T *puiHeapLength, + IMG_UINT32 *pui32Log2DataPageSizeOut, + IMG_UINT32 *pui32Log2ImportAlignmentOut) +{ + PVRSRV_ERROR eError; + IMG_HANDLE hDeviceNodeInt; + PVR_UNREFERENCED_PARAMETER(hBridge); + + hDeviceNodeInt = (IMG_HANDLE) hDeviceNode; + + eError = + HeapCfgHeapDetails( + hDeviceNodeInt, + ui32HeapConfigIndex, + ui32HeapIndex, + ui32HeapNameBufSz, + puiHeapNameOut, + psDevVAddrBase, + puiHeapLength, + pui32Log2DataPageSizeOut, + pui32Log2ImportAlignmentOut); + + return eError; +} + diff --git a/drivers/gpu/rogue_m/generated/dmm_bridge/client_mm_bridge.h b/drivers/gpu/rogue_m/generated/dmm_bridge/client_mm_bridge.h new file mode 100644 index 000000000000..f9d847b5b47f --- /dev/null +++ b/drivers/gpu/rogue_m/generated/dmm_bridge/client_mm_bridge.h @@ -0,0 +1,170 @@ +/*************************************************************************/ /*! +@Title Direct client bridge header for mm +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef CLIENT_MM_BRIDGE_H +#define CLIENT_MM_BRIDGE_H + +#include "common_mm_bridge.h" + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgePMRExportPMR(IMG_HANDLE hBridge, + IMG_HANDLE hPMR, + IMG_HANDLE *phPMRExport, + IMG_UINT64 *pui64Size, + IMG_UINT32 *pui32Log2Contig, + IMG_UINT64 *pui64Password); + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgePMRUnexportPMR(IMG_HANDLE hBridge, + IMG_HANDLE hPMRExport); + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgePMRGetUID(IMG_HANDLE hBridge, + IMG_HANDLE hPMR, + IMG_UINT64 *pui64UID); + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgePMRMakeServerExportClientExport(IMG_HANDLE hBridge, + DEVMEM_SERVER_EXPORTCOOKIE hPMRServerExport, + IMG_HANDLE *phPMRExportOut, + IMG_UINT64 *pui64Size, + IMG_UINT32 *pui32Log2Contig, + IMG_UINT64 *pui64Password); + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgePMRUnmakeServerExportClientExport(IMG_HANDLE hBridge, + IMG_HANDLE hPMRExport); + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgePMRImportPMR(IMG_HANDLE hBridge, + IMG_HANDLE hPMRExport, + IMG_UINT64 ui64uiPassword, + IMG_UINT64 ui64uiSize, + IMG_UINT32 ui32uiLog2Contig, + IMG_HANDLE *phPMR); + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeDevmemIntCtxCreate(IMG_HANDLE hBridge, + IMG_HANDLE hDeviceNode, + IMG_HANDLE *phDevMemServerContext, + IMG_HANDLE *phPrivData); + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeDevmemIntCtxDestroy(IMG_HANDLE hBridge, + IMG_HANDLE hDevmemServerContext); + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeDevmemIntHeapCreate(IMG_HANDLE hBridge, + IMG_HANDLE hDevmemCtx, + IMG_DEV_VIRTADDR sHeapBaseAddr, + IMG_DEVMEM_SIZE_T uiHeapLength, + IMG_UINT32 ui32Log2DataPageSize, + IMG_HANDLE *phDevmemHeapPtr); + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeDevmemIntHeapDestroy(IMG_HANDLE hBridge, + IMG_HANDLE hDevmemHeap); + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeDevmemIntMapPMR(IMG_HANDLE hBridge, + IMG_HANDLE hDevmemServerHeap, + IMG_HANDLE hReservation, + IMG_HANDLE hPMR, + PVRSRV_MEMALLOCFLAGS_T uiMapFlags, + IMG_HANDLE *phMapping); + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeDevmemIntUnmapPMR(IMG_HANDLE hBridge, + IMG_HANDLE hMapping); + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeDevmemIntReserveRange(IMG_HANDLE hBridge, + IMG_HANDLE hDevmemServerHeap, + IMG_DEV_VIRTADDR sAddress, + IMG_DEVMEM_SIZE_T uiLength, + IMG_HANDLE *phReservation); + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeDevmemIntUnreserveRange(IMG_HANDLE hBridge, + IMG_HANDLE hReservation); + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgePhysmemNewRamBackedPMR(IMG_HANDLE hBridge, + IMG_HANDLE hDeviceNode, + IMG_DEVMEM_SIZE_T uiSize, + IMG_DEVMEM_SIZE_T uiChunkSize, + IMG_UINT32 ui32NumPhysChunks, + IMG_UINT32 ui32NumVirtChunks, + IMG_BOOL *pbMappingTable, + IMG_UINT32 ui32Log2PageSize, + PVRSRV_MEMALLOCFLAGS_T uiFlags, + IMG_HANDLE *phPMRPtr); + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgePMRLocalImportPMR(IMG_HANDLE hBridge, + IMG_HANDLE hExtHandle, + IMG_HANDLE *phPMR, + IMG_DEVMEM_SIZE_T *puiSize, + IMG_DEVMEM_ALIGN_T *psAlign); + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgePMRUnrefPMR(IMG_HANDLE hBridge, + IMG_HANDLE hPMR); + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeDevmemSLCFlushInvalRequest(IMG_HANDLE hBridge, + IMG_HANDLE hDeviceNode, + IMG_HANDLE hPmr); + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeDevmemIsVDevAddrValid(IMG_HANDLE hBridge, + IMG_HANDLE hDevmemCtx, + IMG_DEV_VIRTADDR sAddress); + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeHeapCfgHeapConfigCount(IMG_HANDLE hBridge, + IMG_HANDLE hDeviceNode, + IMG_UINT32 *pui32NumHeapConfigs); + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeHeapCfgHeapCount(IMG_HANDLE hBridge, + IMG_HANDLE hDeviceNode, + IMG_UINT32 ui32HeapConfigIndex, + IMG_UINT32 *pui32NumHeaps); + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeHeapCfgHeapConfigName(IMG_HANDLE hBridge, + IMG_HANDLE hDeviceNode, + IMG_UINT32 ui32HeapConfigIndex, + IMG_UINT32 ui32HeapConfigNameBufSz, + IMG_CHAR *puiHeapConfigName); + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeHeapCfgHeapDetails(IMG_HANDLE hBridge, + IMG_HANDLE hDeviceNode, + IMG_UINT32 ui32HeapConfigIndex, + IMG_UINT32 ui32HeapIndex, + IMG_UINT32 ui32HeapNameBufSz, + IMG_CHAR *puiHeapNameOut, + IMG_DEV_VIRTADDR *psDevVAddrBase, + IMG_DEVMEM_SIZE_T *puiHeapLength, + IMG_UINT32 *pui32Log2DataPageSizeOut, + IMG_UINT32 *pui32Log2ImportAlignmentOut); + + +#endif /* CLIENT_MM_BRIDGE_H */ diff --git a/drivers/gpu/rogue_m/generated/dpdumpmm_bridge/client_pdumpmm_bridge.c b/drivers/gpu/rogue_m/generated/dpdumpmm_bridge/client_pdumpmm_bridge.c new file mode 100644 index 000000000000..a6dc4d0a5505 --- /dev/null +++ b/drivers/gpu/rogue_m/generated/dpdumpmm_bridge/client_pdumpmm_bridge.c @@ -0,0 +1,256 @@ +/*************************************************************************/ /*! +@Title Direct client bridge for pdumpmm +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#include "client_pdumpmm_bridge.h" +#include "img_defs.h" +#include "pvr_debug.h" + +/* Module specific includes */ +#include "pdump.h" +#include "pdumpdefs.h" +#include "pvrsrv_memallocflags.h" +#include "devicemem_typedefs.h" + +#include "devicemem_server.h" +#include "pmr.h" +#include "physmem.h" + + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgePMRPDumpLoadMem(IMG_HANDLE hBridge, + IMG_HANDLE hPMR, + IMG_DEVMEM_OFFSET_T uiOffset, + IMG_DEVMEM_SIZE_T uiSize, + IMG_UINT32 ui32PDumpFlags, + IMG_BOOL bbZero) +{ + PVRSRV_ERROR eError; + PMR * psPMRInt; + PVR_UNREFERENCED_PARAMETER(hBridge); + + psPMRInt = (PMR *) hPMR; + + eError = + PMRPDumpLoadMem( + psPMRInt, + uiOffset, + uiSize, + ui32PDumpFlags, + bbZero); + + return eError; +} + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgePMRPDumpLoadMemValue32(IMG_HANDLE hBridge, + IMG_HANDLE hPMR, + IMG_DEVMEM_OFFSET_T uiOffset, + IMG_UINT32 ui32Value, + IMG_UINT32 ui32PDumpFlags) +{ + PVRSRV_ERROR eError; + PMR * psPMRInt; + PVR_UNREFERENCED_PARAMETER(hBridge); + + psPMRInt = (PMR *) hPMR; + + eError = + PMRPDumpLoadMemValue32( + psPMRInt, + uiOffset, + ui32Value, + ui32PDumpFlags); + + return eError; +} + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgePMRPDumpLoadMemValue64(IMG_HANDLE hBridge, + IMG_HANDLE hPMR, + IMG_DEVMEM_OFFSET_T uiOffset, + IMG_UINT64 ui64Value, + IMG_UINT32 ui32PDumpFlags) +{ + PVRSRV_ERROR eError; + PMR * psPMRInt; + PVR_UNREFERENCED_PARAMETER(hBridge); + + psPMRInt = (PMR *) hPMR; + + eError = + PMRPDumpLoadMemValue64( + psPMRInt, + uiOffset, + ui64Value, + ui32PDumpFlags); + + return eError; +} + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgePMRPDumpSaveToFile(IMG_HANDLE hBridge, + IMG_HANDLE hPMR, + IMG_DEVMEM_OFFSET_T uiOffset, + IMG_DEVMEM_SIZE_T uiSize, + IMG_UINT32 ui32ArraySize, + const IMG_CHAR *puiFileName) +{ + PVRSRV_ERROR eError; + PMR * psPMRInt; + PVR_UNREFERENCED_PARAMETER(hBridge); + + psPMRInt = (PMR *) hPMR; + + eError = + PMRPDumpSaveToFile( + psPMRInt, + uiOffset, + uiSize, + ui32ArraySize, + puiFileName); + + return eError; +} + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgePMRPDumpSymbolicAddr(IMG_HANDLE hBridge, + IMG_HANDLE hPMR, + IMG_DEVMEM_OFFSET_T uiOffset, + IMG_UINT32 ui32MemspaceNameLen, + IMG_CHAR *puiMemspaceName, + IMG_UINT32 ui32SymbolicAddrLen, + IMG_CHAR *puiSymbolicAddr, + IMG_DEVMEM_OFFSET_T *puiNewOffset, + IMG_DEVMEM_OFFSET_T *puiNextSymName) +{ + PVRSRV_ERROR eError; + PMR * psPMRInt; + PVR_UNREFERENCED_PARAMETER(hBridge); + + psPMRInt = (PMR *) hPMR; + + eError = + PMR_PDumpSymbolicAddr( + psPMRInt, + uiOffset, + ui32MemspaceNameLen, + puiMemspaceName, + ui32SymbolicAddrLen, + puiSymbolicAddr, + puiNewOffset, + puiNextSymName); + + return eError; +} + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgePMRPDumpPol32(IMG_HANDLE hBridge, + IMG_HANDLE hPMR, + IMG_DEVMEM_OFFSET_T uiOffset, + IMG_UINT32 ui32Value, + IMG_UINT32 ui32Mask, + PDUMP_POLL_OPERATOR eOperator, + IMG_UINT32 ui32PDumpFlags) +{ + PVRSRV_ERROR eError; + PMR * psPMRInt; + PVR_UNREFERENCED_PARAMETER(hBridge); + + psPMRInt = (PMR *) hPMR; + + eError = + PMRPDumpPol32( + psPMRInt, + uiOffset, + ui32Value, + ui32Mask, + eOperator, + ui32PDumpFlags); + + return eError; +} + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgePMRPDumpCBP(IMG_HANDLE hBridge, + IMG_HANDLE hPMR, + IMG_DEVMEM_OFFSET_T uiReadOffset, + IMG_DEVMEM_OFFSET_T uiWriteOffset, + IMG_DEVMEM_SIZE_T uiPacketSize, + IMG_DEVMEM_SIZE_T uiBufferSize) +{ + PVRSRV_ERROR eError; + PMR * psPMRInt; + PVR_UNREFERENCED_PARAMETER(hBridge); + + psPMRInt = (PMR *) hPMR; + + eError = + PMRPDumpCBP( + psPMRInt, + uiReadOffset, + uiWriteOffset, + uiPacketSize, + uiBufferSize); + + return eError; +} + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeDevmemIntPDumpSaveToFileVirtual(IMG_HANDLE hBridge, + IMG_HANDLE hDevmemServerContext, + IMG_DEV_VIRTADDR sAddress, + IMG_DEVMEM_SIZE_T uiSize, + IMG_UINT32 ui32ArraySize, + const IMG_CHAR *puiFileName, + IMG_UINT32 ui32FileOffset, + IMG_UINT32 ui32PDumpFlags) +{ + PVRSRV_ERROR eError; + DEVMEMINT_CTX * psDevmemServerContextInt; + PVR_UNREFERENCED_PARAMETER(hBridge); + + psDevmemServerContextInt = (DEVMEMINT_CTX *) hDevmemServerContext; + + eError = + DevmemIntPDumpSaveToFileVirtual( + psDevmemServerContextInt, + sAddress, + uiSize, + ui32ArraySize, + puiFileName, + ui32FileOffset, + ui32PDumpFlags); + + return eError; +} + diff --git a/drivers/gpu/rogue_m/generated/dpvrtl_bridge/client_pvrtl_bridge.c b/drivers/gpu/rogue_m/generated/dpvrtl_bridge/client_pvrtl_bridge.c new file mode 100644 index 000000000000..252deee81e51 --- /dev/null +++ b/drivers/gpu/rogue_m/generated/dpvrtl_bridge/client_pvrtl_bridge.c @@ -0,0 +1,154 @@ +/*************************************************************************/ /*! +@Title Direct client bridge for pvrtl +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#include "client_pvrtl_bridge.h" +#include "img_defs.h" +#include "pvr_debug.h" + +/* Module specific includes */ +#include "devicemem_typedefs.h" +#include "pvr_tl.h" + +#include "tlserver.h" + + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeTLConnect(IMG_HANDLE hBridge) +{ + PVRSRV_ERROR eError; + + + eError = + TLServerConnectKM(hBridge + ); + return eError; +} + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeTLDisconnect(IMG_HANDLE hBridge) +{ + PVRSRV_ERROR eError; + + + eError = + TLServerDisconnectKM(hBridge + ); + return eError; +} + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeTLOpenStream(IMG_HANDLE hBridge, + IMG_CHAR *puiName, + IMG_UINT32 ui32Mode, + IMG_HANDLE *phSD, + DEVMEM_SERVER_EXPORTCOOKIE *phClientBUFExportCookie) +{ + PVRSRV_ERROR eError; + TL_STREAM_DESC * psSDInt; + DEVMEM_EXPORTCOOKIE * psClientBUFExportCookieInt; + PVR_UNREFERENCED_PARAMETER(hBridge); + + + eError = + TLServerOpenStreamKM( + puiName, + ui32Mode, + &psSDInt, + &psClientBUFExportCookieInt); + + *phSD = psSDInt; + *phClientBUFExportCookie = psClientBUFExportCookieInt; + return eError; +} + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeTLCloseStream(IMG_HANDLE hBridge, + IMG_HANDLE hSD) +{ + PVRSRV_ERROR eError; + TL_STREAM_DESC * psSDInt; + PVR_UNREFERENCED_PARAMETER(hBridge); + + psSDInt = (TL_STREAM_DESC *) hSD; + + eError = + TLServerCloseStreamKM( + psSDInt); + + return eError; +} + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeTLAcquireData(IMG_HANDLE hBridge, + IMG_HANDLE hSD, + IMG_UINT32 *pui32ReadOffset, + IMG_UINT32 *pui32ReadLen) +{ + PVRSRV_ERROR eError; + TL_STREAM_DESC * psSDInt; + PVR_UNREFERENCED_PARAMETER(hBridge); + + psSDInt = (TL_STREAM_DESC *) hSD; + + eError = + TLServerAcquireDataKM( + psSDInt, + pui32ReadOffset, + pui32ReadLen); + + return eError; +} + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeTLReleaseData(IMG_HANDLE hBridge, + IMG_HANDLE hSD, + IMG_UINT32 ui32ReadOffset, + IMG_UINT32 ui32ReadLen) +{ + PVRSRV_ERROR eError; + TL_STREAM_DESC * psSDInt; + PVR_UNREFERENCED_PARAMETER(hBridge); + + psSDInt = (TL_STREAM_DESC *) hSD; + + eError = + TLServerReleaseDataKM( + psSDInt, + ui32ReadOffset, + ui32ReadLen); + + return eError; +} + diff --git a/drivers/gpu/rogue_m/generated/dri_bridge/client_ri_bridge.c b/drivers/gpu/rogue_m/generated/dri_bridge/client_ri_bridge.c new file mode 100644 index 000000000000..1ef8edd907ea --- /dev/null +++ b/drivers/gpu/rogue_m/generated/dri_bridge/client_ri_bridge.c @@ -0,0 +1,181 @@ +/*************************************************************************/ /*! +@Title Direct client bridge for ri +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#include "client_ri_bridge.h" +#include "img_defs.h" +#include "pvr_debug.h" + +/* Module specific includes */ +#include "ri_typedefs.h" + +#include "ri_server.h" + + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeRIWritePMREntry(IMG_HANDLE hBridge, + IMG_HANDLE hPMRHandle, + IMG_UINT32 ui32TextASize, + const IMG_CHAR *puiTextA, + IMG_UINT64 ui64LogicalSize) +{ + PVRSRV_ERROR eError; + PMR * psPMRHandleInt; + PVR_UNREFERENCED_PARAMETER(hBridge); + + psPMRHandleInt = (PMR *) hPMRHandle; + + eError = + RIWritePMREntryKM( + psPMRHandleInt, + ui32TextASize, + puiTextA, + ui64LogicalSize); + + return eError; +} + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeRIWriteMEMDESCEntry(IMG_HANDLE hBridge, + IMG_HANDLE hPMRHandle, + IMG_UINT32 ui32TextBSize, + const IMG_CHAR *puiTextB, + IMG_UINT64 ui64Offset, + IMG_UINT64 ui64Size, + IMG_BOOL bIsImport, + IMG_BOOL bIsExportable, + IMG_HANDLE *phRIHandle) +{ + PVRSRV_ERROR eError; + PMR * psPMRHandleInt; + RI_HANDLE psRIHandleInt; + PVR_UNREFERENCED_PARAMETER(hBridge); + + psPMRHandleInt = (PMR *) hPMRHandle; + + eError = + RIWriteMEMDESCEntryKM( + psPMRHandleInt, + ui32TextBSize, + puiTextB, + ui64Offset, + ui64Size, + bIsImport, + bIsExportable, + &psRIHandleInt); + + *phRIHandle = psRIHandleInt; + return eError; +} + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeRIUpdateMEMDESCAddr(IMG_HANDLE hBridge, + IMG_HANDLE hRIHandle, + IMG_DEV_VIRTADDR sAddr) +{ + PVRSRV_ERROR eError; + RI_HANDLE psRIHandleInt; + PVR_UNREFERENCED_PARAMETER(hBridge); + + psRIHandleInt = (RI_HANDLE) hRIHandle; + + eError = + RIUpdateMEMDESCAddrKM( + psRIHandleInt, + sAddr); + + return eError; +} + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeRIDeleteMEMDESCEntry(IMG_HANDLE hBridge, + IMG_HANDLE hRIHandle) +{ + PVRSRV_ERROR eError; + RI_HANDLE psRIHandleInt; + PVR_UNREFERENCED_PARAMETER(hBridge); + + psRIHandleInt = (RI_HANDLE) hRIHandle; + + eError = + RIDeleteMEMDESCEntryKM( + psRIHandleInt); + + return eError; +} + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeRIDumpList(IMG_HANDLE hBridge, + IMG_HANDLE hPMRHandle) +{ + PVRSRV_ERROR eError; + PMR * psPMRHandleInt; + PVR_UNREFERENCED_PARAMETER(hBridge); + + psPMRHandleInt = (PMR *) hPMRHandle; + + eError = + RIDumpListKM( + psPMRHandleInt); + + return eError; +} + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeRIDumpAll(IMG_HANDLE hBridge) +{ + PVRSRV_ERROR eError; + PVR_UNREFERENCED_PARAMETER(hBridge); + + + eError = + RIDumpAllKM( + ); + return eError; +} + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeRIDumpProcess(IMG_HANDLE hBridge, + IMG_PID ui32Pid) +{ + PVRSRV_ERROR eError; + PVR_UNREFERENCED_PARAMETER(hBridge); + + + eError = + RIDumpProcessKM( + ui32Pid); + + return eError; +} + diff --git a/drivers/gpu/rogue_m/generated/dsync_bridge/client_sync_bridge.c b/drivers/gpu/rogue_m/generated/dsync_bridge/client_sync_bridge.c new file mode 100644 index 000000000000..36e757479a6b --- /dev/null +++ b/drivers/gpu/rogue_m/generated/dsync_bridge/client_sync_bridge.c @@ -0,0 +1,492 @@ +/*************************************************************************/ /*! +@Title Direct client bridge for sync +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#include "client_sync_bridge.h" +#include "img_defs.h" +#include "pvr_debug.h" + +/* Module specific includes */ +#include "pdump.h" +#include "pdumpdefs.h" +#include "devicemem_typedefs.h" + +#include "sync_server.h" +#include "pdump.h" + + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeAllocSyncPrimitiveBlock(IMG_HANDLE hBridge, + IMG_HANDLE hDevNode, + IMG_HANDLE *phSyncHandle, + IMG_UINT32 *pui32SyncPrimVAddr, + IMG_UINT32 *pui32SyncPrimBlockSize, + DEVMEM_SERVER_EXPORTCOOKIE *phExportCookie) +{ + PVRSRV_ERROR eError; + IMG_HANDLE hDevNodeInt; + SYNC_PRIMITIVE_BLOCK * psSyncHandleInt; + DEVMEM_EXPORTCOOKIE * psExportCookieInt; + + hDevNodeInt = (IMG_HANDLE) hDevNode; + + eError = + PVRSRVAllocSyncPrimitiveBlockKM(hBridge + , + hDevNodeInt, + &psSyncHandleInt, + pui32SyncPrimVAddr, + pui32SyncPrimBlockSize, + &psExportCookieInt); + + *phSyncHandle = psSyncHandleInt; + *phExportCookie = psExportCookieInt; + return eError; +} + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeFreeSyncPrimitiveBlock(IMG_HANDLE hBridge, + IMG_HANDLE hSyncHandle) +{ + PVRSRV_ERROR eError; + SYNC_PRIMITIVE_BLOCK * psSyncHandleInt; + PVR_UNREFERENCED_PARAMETER(hBridge); + + psSyncHandleInt = (SYNC_PRIMITIVE_BLOCK *) hSyncHandle; + + eError = + PVRSRVFreeSyncPrimitiveBlockKM( + psSyncHandleInt); + + return eError; +} + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeSyncPrimSet(IMG_HANDLE hBridge, + IMG_HANDLE hSyncHandle, + IMG_UINT32 ui32Index, + IMG_UINT32 ui32Value) +{ + PVRSRV_ERROR eError; + SYNC_PRIMITIVE_BLOCK * psSyncHandleInt; + PVR_UNREFERENCED_PARAMETER(hBridge); + + psSyncHandleInt = (SYNC_PRIMITIVE_BLOCK *) hSyncHandle; + + eError = + PVRSRVSyncPrimSetKM( + psSyncHandleInt, + ui32Index, + ui32Value); + + return eError; +} + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeServerSyncPrimSet(IMG_HANDLE hBridge, + IMG_HANDLE hSyncHandle, + IMG_UINT32 ui32Value) +{ + PVRSRV_ERROR eError; + SERVER_SYNC_PRIMITIVE * psSyncHandleInt; + PVR_UNREFERENCED_PARAMETER(hBridge); + + psSyncHandleInt = (SERVER_SYNC_PRIMITIVE *) hSyncHandle; + + eError = + PVRSRVServerSyncPrimSetKM( + psSyncHandleInt, + ui32Value); + + return eError; +} + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeSyncRecordRemoveByHandle(IMG_HANDLE hBridge, + IMG_HANDLE hhRecord) +{ + PVRSRV_ERROR eError; + SYNC_RECORD_HANDLE pshRecordInt; + PVR_UNREFERENCED_PARAMETER(hBridge); + + pshRecordInt = (SYNC_RECORD_HANDLE) hhRecord; + + eError = + PVRSRVSyncRecordRemoveByHandleKM( + pshRecordInt); + + return eError; +} + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeSyncRecordAdd(IMG_HANDLE hBridge, + IMG_HANDLE *phhRecord, + IMG_HANDLE hhServerSyncPrimBlock, + IMG_UINT32 ui32ui32FwBlockAddr, + IMG_UINT32 ui32ui32SyncOffset, + IMG_BOOL bbServerSync, + IMG_UINT32 ui32ClassNameSize, + const IMG_CHAR *puiClassName) +{ + PVRSRV_ERROR eError; + SYNC_RECORD_HANDLE pshRecordInt; + SYNC_PRIMITIVE_BLOCK * pshServerSyncPrimBlockInt; + PVR_UNREFERENCED_PARAMETER(hBridge); + + pshServerSyncPrimBlockInt = (SYNC_PRIMITIVE_BLOCK *) hhServerSyncPrimBlock; + + eError = + PVRSRVSyncRecordAddKM( + &pshRecordInt, + pshServerSyncPrimBlockInt, + ui32ui32FwBlockAddr, + ui32ui32SyncOffset, + bbServerSync, + ui32ClassNameSize, + puiClassName); + + *phhRecord = pshRecordInt; + return eError; +} + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeServerSyncAlloc(IMG_HANDLE hBridge, + IMG_HANDLE hDevNode, + IMG_HANDLE *phSyncHandle, + IMG_UINT32 *pui32SyncPrimVAddr, + IMG_UINT32 ui32ClassNameSize, + const IMG_CHAR *puiClassName) +{ + PVRSRV_ERROR eError; + IMG_HANDLE hDevNodeInt; + SERVER_SYNC_PRIMITIVE * psSyncHandleInt; + PVR_UNREFERENCED_PARAMETER(hBridge); + + hDevNodeInt = (IMG_HANDLE) hDevNode; + + eError = + PVRSRVServerSyncAllocKM( + hDevNodeInt, + &psSyncHandleInt, + pui32SyncPrimVAddr, + ui32ClassNameSize, + puiClassName); + + *phSyncHandle = psSyncHandleInt; + return eError; +} + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeServerSyncFree(IMG_HANDLE hBridge, + IMG_HANDLE hSyncHandle) +{ + PVRSRV_ERROR eError; + SERVER_SYNC_PRIMITIVE * psSyncHandleInt; + PVR_UNREFERENCED_PARAMETER(hBridge); + + psSyncHandleInt = (SERVER_SYNC_PRIMITIVE *) hSyncHandle; + + eError = + PVRSRVServerSyncFreeKM( + psSyncHandleInt); + + return eError; +} + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeServerSyncQueueHWOp(IMG_HANDLE hBridge, + IMG_HANDLE hSyncHandle, + IMG_BOOL bbUpdate, + IMG_UINT32 *pui32FenceValue, + IMG_UINT32 *pui32UpdateValue) +{ + PVRSRV_ERROR eError; + SERVER_SYNC_PRIMITIVE * psSyncHandleInt; + PVR_UNREFERENCED_PARAMETER(hBridge); + + psSyncHandleInt = (SERVER_SYNC_PRIMITIVE *) hSyncHandle; + + eError = + PVRSRVServerSyncQueueHWOpKM( + psSyncHandleInt, + bbUpdate, + pui32FenceValue, + pui32UpdateValue); + + return eError; +} + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeServerSyncGetStatus(IMG_HANDLE hBridge, + IMG_UINT32 ui32SyncCount, + IMG_HANDLE *phSyncHandle, + IMG_UINT32 *pui32UID, + IMG_UINT32 *pui32FWAddr, + IMG_UINT32 *pui32CurrentOp, + IMG_UINT32 *pui32NextOp) +{ + PVRSRV_ERROR eError; + SERVER_SYNC_PRIMITIVE * *psSyncHandleInt; + PVR_UNREFERENCED_PARAMETER(hBridge); + + psSyncHandleInt = (SERVER_SYNC_PRIMITIVE **) phSyncHandle; + + eError = + PVRSRVServerSyncGetStatusKM( + ui32SyncCount, + psSyncHandleInt, + pui32UID, + pui32FWAddr, + pui32CurrentOp, + pui32NextOp); + + return eError; +} + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeSyncPrimOpCreate(IMG_HANDLE hBridge, + IMG_UINT32 ui32SyncBlockCount, + IMG_HANDLE *phBlockList, + IMG_UINT32 ui32ClientSyncCount, + IMG_UINT32 *pui32SyncBlockIndex, + IMG_UINT32 *pui32Index, + IMG_UINT32 ui32ServerSyncCount, + IMG_HANDLE *phServerSync, + IMG_HANDLE *phServerCookie) +{ + PVRSRV_ERROR eError; + SYNC_PRIMITIVE_BLOCK * *psBlockListInt; + SERVER_SYNC_PRIMITIVE * *psServerSyncInt; + SERVER_OP_COOKIE * psServerCookieInt; + PVR_UNREFERENCED_PARAMETER(hBridge); + + psBlockListInt = (SYNC_PRIMITIVE_BLOCK **) phBlockList; + psServerSyncInt = (SERVER_SYNC_PRIMITIVE **) phServerSync; + + eError = + PVRSRVSyncPrimOpCreateKM( + ui32SyncBlockCount, + psBlockListInt, + ui32ClientSyncCount, + pui32SyncBlockIndex, + pui32Index, + ui32ServerSyncCount, + psServerSyncInt, + &psServerCookieInt); + + *phServerCookie = psServerCookieInt; + return eError; +} + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeSyncPrimOpTake(IMG_HANDLE hBridge, + IMG_HANDLE hServerCookie, + IMG_UINT32 ui32ClientSyncCount, + IMG_UINT32 *pui32Flags, + IMG_UINT32 *pui32FenceValue, + IMG_UINT32 *pui32UpdateValue, + IMG_UINT32 ui32ServerSyncCount, + IMG_UINT32 *pui32ServerFlags) +{ + PVRSRV_ERROR eError; + SERVER_OP_COOKIE * psServerCookieInt; + PVR_UNREFERENCED_PARAMETER(hBridge); + + psServerCookieInt = (SERVER_OP_COOKIE *) hServerCookie; + + eError = + PVRSRVSyncPrimOpTakeKM( + psServerCookieInt, + ui32ClientSyncCount, + pui32Flags, + pui32FenceValue, + pui32UpdateValue, + ui32ServerSyncCount, + pui32ServerFlags); + + return eError; +} + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeSyncPrimOpReady(IMG_HANDLE hBridge, + IMG_HANDLE hServerCookie, + IMG_BOOL *pbReady) +{ + PVRSRV_ERROR eError; + SERVER_OP_COOKIE * psServerCookieInt; + PVR_UNREFERENCED_PARAMETER(hBridge); + + psServerCookieInt = (SERVER_OP_COOKIE *) hServerCookie; + + eError = + PVRSRVSyncPrimOpReadyKM( + psServerCookieInt, + pbReady); + + return eError; +} + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeSyncPrimOpComplete(IMG_HANDLE hBridge, + IMG_HANDLE hServerCookie) +{ + PVRSRV_ERROR eError; + SERVER_OP_COOKIE * psServerCookieInt; + PVR_UNREFERENCED_PARAMETER(hBridge); + + psServerCookieInt = (SERVER_OP_COOKIE *) hServerCookie; + + eError = + PVRSRVSyncPrimOpCompleteKM( + psServerCookieInt); + + return eError; +} + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeSyncPrimOpDestroy(IMG_HANDLE hBridge, + IMG_HANDLE hServerCookie) +{ + PVRSRV_ERROR eError; + SERVER_OP_COOKIE * psServerCookieInt; + PVR_UNREFERENCED_PARAMETER(hBridge); + + psServerCookieInt = (SERVER_OP_COOKIE *) hServerCookie; + + eError = + PVRSRVSyncPrimOpDestroyKM( + psServerCookieInt); + + return eError; +} + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeSyncPrimPDump(IMG_HANDLE hBridge, + IMG_HANDLE hSyncHandle, + IMG_UINT32 ui32Offset) +{ + PVRSRV_ERROR eError; + SYNC_PRIMITIVE_BLOCK * psSyncHandleInt; + PVR_UNREFERENCED_PARAMETER(hBridge); + + psSyncHandleInt = (SYNC_PRIMITIVE_BLOCK *) hSyncHandle; + + eError = + PVRSRVSyncPrimPDumpKM( + psSyncHandleInt, + ui32Offset); + + return eError; +} + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeSyncPrimPDumpValue(IMG_HANDLE hBridge, + IMG_HANDLE hSyncHandle, + IMG_UINT32 ui32Offset, + IMG_UINT32 ui32Value) +{ + PVRSRV_ERROR eError; + SYNC_PRIMITIVE_BLOCK * psSyncHandleInt; + PVR_UNREFERENCED_PARAMETER(hBridge); + + psSyncHandleInt = (SYNC_PRIMITIVE_BLOCK *) hSyncHandle; + + eError = + PVRSRVSyncPrimPDumpValueKM( + psSyncHandleInt, + ui32Offset, + ui32Value); + + return eError; +} + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeSyncPrimPDumpPol(IMG_HANDLE hBridge, + IMG_HANDLE hSyncHandle, + IMG_UINT32 ui32Offset, + IMG_UINT32 ui32Value, + IMG_UINT32 ui32Mask, + PDUMP_POLL_OPERATOR eOperator, + PDUMP_FLAGS_T uiPDumpFlags) +{ + PVRSRV_ERROR eError; + SYNC_PRIMITIVE_BLOCK * psSyncHandleInt; + PVR_UNREFERENCED_PARAMETER(hBridge); + + psSyncHandleInt = (SYNC_PRIMITIVE_BLOCK *) hSyncHandle; + + eError = + PVRSRVSyncPrimPDumpPolKM( + psSyncHandleInt, + ui32Offset, + ui32Value, + ui32Mask, + eOperator, + uiPDumpFlags); + + return eError; +} + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeSyncPrimOpPDumpPol(IMG_HANDLE hBridge, + IMG_HANDLE hServerCookie, + PDUMP_POLL_OPERATOR eOperator, + PDUMP_FLAGS_T uiPDumpFlags) +{ + PVRSRV_ERROR eError; + SERVER_OP_COOKIE * psServerCookieInt; + PVR_UNREFERENCED_PARAMETER(hBridge); + + psServerCookieInt = (SERVER_OP_COOKIE *) hServerCookie; + + eError = + PVRSRVSyncPrimOpPDumpPolKM( + psServerCookieInt, + eOperator, + uiPDumpFlags); + + return eError; +} + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeSyncPrimPDumpCBP(IMG_HANDLE hBridge, + IMG_HANDLE hSyncHandle, + IMG_UINT32 ui32Offset, + IMG_DEVMEM_OFFSET_T uiWriteOffset, + IMG_DEVMEM_SIZE_T uiPacketSize, + IMG_DEVMEM_SIZE_T uiBufferSize) +{ + PVRSRV_ERROR eError; + SYNC_PRIMITIVE_BLOCK * psSyncHandleInt; + PVR_UNREFERENCED_PARAMETER(hBridge); + + psSyncHandleInt = (SYNC_PRIMITIVE_BLOCK *) hSyncHandle; + + eError = + PVRSRVSyncPrimPDumpCBPKM( + psSyncHandleInt, + ui32Offset, + uiWriteOffset, + uiPacketSize, + uiBufferSize); + + return eError; +} + diff --git a/drivers/gpu/rogue_m/generated/dsync_bridge/client_sync_bridge.h b/drivers/gpu/rogue_m/generated/dsync_bridge/client_sync_bridge.h new file mode 100644 index 000000000000..e80501c9638f --- /dev/null +++ b/drivers/gpu/rogue_m/generated/dsync_bridge/client_sync_bridge.h @@ -0,0 +1,161 @@ +/*************************************************************************/ /*! +@Title Direct client bridge header for sync +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef CLIENT_SYNC_BRIDGE_H +#define CLIENT_SYNC_BRIDGE_H + +#include "common_sync_bridge.h" + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeAllocSyncPrimitiveBlock(IMG_HANDLE hBridge, + IMG_HANDLE hDevNode, + IMG_HANDLE *phSyncHandle, + IMG_UINT32 *pui32SyncPrimVAddr, + IMG_UINT32 *pui32SyncPrimBlockSize, + DEVMEM_SERVER_EXPORTCOOKIE *phExportCookie); + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeFreeSyncPrimitiveBlock(IMG_HANDLE hBridge, + IMG_HANDLE hSyncHandle); + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeSyncPrimSet(IMG_HANDLE hBridge, + IMG_HANDLE hSyncHandle, + IMG_UINT32 ui32Index, + IMG_UINT32 ui32Value); + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeServerSyncPrimSet(IMG_HANDLE hBridge, + IMG_HANDLE hSyncHandle, + IMG_UINT32 ui32Value); + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeSyncRecordRemoveByHandle(IMG_HANDLE hBridge, + IMG_HANDLE hhRecord); + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeSyncRecordAdd(IMG_HANDLE hBridge, + IMG_HANDLE *phhRecord, + IMG_HANDLE hhServerSyncPrimBlock, + IMG_UINT32 ui32ui32FwBlockAddr, + IMG_UINT32 ui32ui32SyncOffset, + IMG_BOOL bbServerSync, + IMG_UINT32 ui32ClassNameSize, + const IMG_CHAR *puiClassName); + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeServerSyncAlloc(IMG_HANDLE hBridge, + IMG_HANDLE hDevNode, + IMG_HANDLE *phSyncHandle, + IMG_UINT32 *pui32SyncPrimVAddr, + IMG_UINT32 ui32ClassNameSize, + const IMG_CHAR *puiClassName); + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeServerSyncFree(IMG_HANDLE hBridge, + IMG_HANDLE hSyncHandle); + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeServerSyncQueueHWOp(IMG_HANDLE hBridge, + IMG_HANDLE hSyncHandle, + IMG_BOOL bbUpdate, + IMG_UINT32 *pui32FenceValue, + IMG_UINT32 *pui32UpdateValue); + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeServerSyncGetStatus(IMG_HANDLE hBridge, + IMG_UINT32 ui32SyncCount, + IMG_HANDLE *phSyncHandle, + IMG_UINT32 *pui32UID, + IMG_UINT32 *pui32FWAddr, + IMG_UINT32 *pui32CurrentOp, + IMG_UINT32 *pui32NextOp); + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeSyncPrimOpCreate(IMG_HANDLE hBridge, + IMG_UINT32 ui32SyncBlockCount, + IMG_HANDLE *phBlockList, + IMG_UINT32 ui32ClientSyncCount, + IMG_UINT32 *pui32SyncBlockIndex, + IMG_UINT32 *pui32Index, + IMG_UINT32 ui32ServerSyncCount, + IMG_HANDLE *phServerSync, + IMG_HANDLE *phServerCookie); + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeSyncPrimOpTake(IMG_HANDLE hBridge, + IMG_HANDLE hServerCookie, + IMG_UINT32 ui32ClientSyncCount, + IMG_UINT32 *pui32Flags, + IMG_UINT32 *pui32FenceValue, + IMG_UINT32 *pui32UpdateValue, + IMG_UINT32 ui32ServerSyncCount, + IMG_UINT32 *pui32ServerFlags); + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeSyncPrimOpReady(IMG_HANDLE hBridge, + IMG_HANDLE hServerCookie, + IMG_BOOL *pbReady); + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeSyncPrimOpComplete(IMG_HANDLE hBridge, + IMG_HANDLE hServerCookie); + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeSyncPrimOpDestroy(IMG_HANDLE hBridge, + IMG_HANDLE hServerCookie); + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeSyncPrimPDump(IMG_HANDLE hBridge, + IMG_HANDLE hSyncHandle, + IMG_UINT32 ui32Offset); + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeSyncPrimPDumpValue(IMG_HANDLE hBridge, + IMG_HANDLE hSyncHandle, + IMG_UINT32 ui32Offset, + IMG_UINT32 ui32Value); + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeSyncPrimPDumpPol(IMG_HANDLE hBridge, + IMG_HANDLE hSyncHandle, + IMG_UINT32 ui32Offset, + IMG_UINT32 ui32Value, + IMG_UINT32 ui32Mask, + PDUMP_POLL_OPERATOR eOperator, + PDUMP_FLAGS_T uiPDumpFlags); + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeSyncPrimOpPDumpPol(IMG_HANDLE hBridge, + IMG_HANDLE hServerCookie, + PDUMP_POLL_OPERATOR eOperator, + PDUMP_FLAGS_T uiPDumpFlags); + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeSyncPrimPDumpCBP(IMG_HANDLE hBridge, + IMG_HANDLE hSyncHandle, + IMG_UINT32 ui32Offset, + IMG_DEVMEM_OFFSET_T uiWriteOffset, + IMG_DEVMEM_SIZE_T uiPacketSize, + IMG_DEVMEM_SIZE_T uiBufferSize); + + +#endif /* CLIENT_SYNC_BRIDGE_H */ diff --git a/drivers/gpu/rogue_m/generated/mm_bridge/common_mm_bridge.h b/drivers/gpu/rogue_m/generated/mm_bridge/common_mm_bridge.h new file mode 100644 index 000000000000..0f35c4653584 --- /dev/null +++ b/drivers/gpu/rogue_m/generated/mm_bridge/common_mm_bridge.h @@ -0,0 +1,530 @@ +/*************************************************************************/ /*! +@File +@Title Common bridge header for mm +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Declares common defines and structures that are used by both + the client and sever side of the bridge for mm +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef COMMON_MM_BRIDGE_H +#define COMMON_MM_BRIDGE_H + +#include "img_types.h" +#include "pvrsrv_error.h" + +#include "pvrsrv_memallocflags.h" +#include "devicemem_typedefs.h" + + +#define PVRSRV_BRIDGE_MM_CMD_FIRST 0 +#define PVRSRV_BRIDGE_MM_PMREXPORTPMR PVRSRV_BRIDGE_MM_CMD_FIRST+0 +#define PVRSRV_BRIDGE_MM_PMRUNEXPORTPMR PVRSRV_BRIDGE_MM_CMD_FIRST+1 +#define PVRSRV_BRIDGE_MM_PMRGETUID PVRSRV_BRIDGE_MM_CMD_FIRST+2 +#define PVRSRV_BRIDGE_MM_PMRMAKESERVEREXPORTCLIENTEXPORT PVRSRV_BRIDGE_MM_CMD_FIRST+3 +#define PVRSRV_BRIDGE_MM_PMRUNMAKESERVEREXPORTCLIENTEXPORT PVRSRV_BRIDGE_MM_CMD_FIRST+4 +#define PVRSRV_BRIDGE_MM_PMRIMPORTPMR PVRSRV_BRIDGE_MM_CMD_FIRST+5 +#define PVRSRV_BRIDGE_MM_DEVMEMINTCTXCREATE PVRSRV_BRIDGE_MM_CMD_FIRST+6 +#define PVRSRV_BRIDGE_MM_DEVMEMINTCTXDESTROY PVRSRV_BRIDGE_MM_CMD_FIRST+7 +#define PVRSRV_BRIDGE_MM_DEVMEMINTHEAPCREATE PVRSRV_BRIDGE_MM_CMD_FIRST+8 +#define PVRSRV_BRIDGE_MM_DEVMEMINTHEAPDESTROY PVRSRV_BRIDGE_MM_CMD_FIRST+9 +#define PVRSRV_BRIDGE_MM_DEVMEMINTMAPPMR PVRSRV_BRIDGE_MM_CMD_FIRST+10 +#define PVRSRV_BRIDGE_MM_DEVMEMINTUNMAPPMR PVRSRV_BRIDGE_MM_CMD_FIRST+11 +#define PVRSRV_BRIDGE_MM_DEVMEMINTRESERVERANGE PVRSRV_BRIDGE_MM_CMD_FIRST+12 +#define PVRSRV_BRIDGE_MM_DEVMEMINTUNRESERVERANGE PVRSRV_BRIDGE_MM_CMD_FIRST+13 +#define PVRSRV_BRIDGE_MM_PHYSMEMNEWRAMBACKEDPMR PVRSRV_BRIDGE_MM_CMD_FIRST+14 +#define PVRSRV_BRIDGE_MM_PMRLOCALIMPORTPMR PVRSRV_BRIDGE_MM_CMD_FIRST+15 +#define PVRSRV_BRIDGE_MM_PMRUNREFPMR PVRSRV_BRIDGE_MM_CMD_FIRST+16 +#define PVRSRV_BRIDGE_MM_DEVMEMSLCFLUSHINVALREQUEST PVRSRV_BRIDGE_MM_CMD_FIRST+17 +#define PVRSRV_BRIDGE_MM_DEVMEMISVDEVADDRVALID PVRSRV_BRIDGE_MM_CMD_FIRST+18 +#define PVRSRV_BRIDGE_MM_HEAPCFGHEAPCONFIGCOUNT PVRSRV_BRIDGE_MM_CMD_FIRST+19 +#define PVRSRV_BRIDGE_MM_HEAPCFGHEAPCOUNT PVRSRV_BRIDGE_MM_CMD_FIRST+20 +#define PVRSRV_BRIDGE_MM_HEAPCFGHEAPCONFIGNAME PVRSRV_BRIDGE_MM_CMD_FIRST+21 +#define PVRSRV_BRIDGE_MM_HEAPCFGHEAPDETAILS PVRSRV_BRIDGE_MM_CMD_FIRST+22 +#define PVRSRV_BRIDGE_MM_CMD_LAST (PVRSRV_BRIDGE_MM_CMD_FIRST+22) + + +/******************************************* + PMRExportPMR + *******************************************/ + +/* Bridge in structure for PMRExportPMR */ +typedef struct PVRSRV_BRIDGE_IN_PMREXPORTPMR_TAG +{ + IMG_HANDLE hPMR; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_PMREXPORTPMR; + + +/* Bridge out structure for PMRExportPMR */ +typedef struct PVRSRV_BRIDGE_OUT_PMREXPORTPMR_TAG +{ + IMG_HANDLE hPMRExport; + IMG_UINT64 ui64Size; + IMG_UINT32 ui32Log2Contig; + IMG_UINT64 ui64Password; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PMREXPORTPMR; + +/******************************************* + PMRUnexportPMR + *******************************************/ + +/* Bridge in structure for PMRUnexportPMR */ +typedef struct PVRSRV_BRIDGE_IN_PMRUNEXPORTPMR_TAG +{ + IMG_HANDLE hPMRExport; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_PMRUNEXPORTPMR; + + +/* Bridge out structure for PMRUnexportPMR */ +typedef struct PVRSRV_BRIDGE_OUT_PMRUNEXPORTPMR_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PMRUNEXPORTPMR; + +/******************************************* + PMRGetUID + *******************************************/ + +/* Bridge in structure for PMRGetUID */ +typedef struct PVRSRV_BRIDGE_IN_PMRGETUID_TAG +{ + IMG_HANDLE hPMR; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_PMRGETUID; + + +/* Bridge out structure for PMRGetUID */ +typedef struct PVRSRV_BRIDGE_OUT_PMRGETUID_TAG +{ + IMG_UINT64 ui64UID; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PMRGETUID; + +/******************************************* + PMRMakeServerExportClientExport + *******************************************/ + +/* Bridge in structure for PMRMakeServerExportClientExport */ +typedef struct PVRSRV_BRIDGE_IN_PMRMAKESERVEREXPORTCLIENTEXPORT_TAG +{ + DEVMEM_SERVER_EXPORTCOOKIE hPMRServerExport; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_PMRMAKESERVEREXPORTCLIENTEXPORT; + + +/* Bridge out structure for PMRMakeServerExportClientExport */ +typedef struct PVRSRV_BRIDGE_OUT_PMRMAKESERVEREXPORTCLIENTEXPORT_TAG +{ + IMG_HANDLE hPMRExportOut; + IMG_UINT64 ui64Size; + IMG_UINT32 ui32Log2Contig; + IMG_UINT64 ui64Password; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PMRMAKESERVEREXPORTCLIENTEXPORT; + +/******************************************* + PMRUnmakeServerExportClientExport + *******************************************/ + +/* Bridge in structure for PMRUnmakeServerExportClientExport */ +typedef struct PVRSRV_BRIDGE_IN_PMRUNMAKESERVEREXPORTCLIENTEXPORT_TAG +{ + IMG_HANDLE hPMRExport; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_PMRUNMAKESERVEREXPORTCLIENTEXPORT; + + +/* Bridge out structure for PMRUnmakeServerExportClientExport */ +typedef struct PVRSRV_BRIDGE_OUT_PMRUNMAKESERVEREXPORTCLIENTEXPORT_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PMRUNMAKESERVEREXPORTCLIENTEXPORT; + +/******************************************* + PMRImportPMR + *******************************************/ + +/* Bridge in structure for PMRImportPMR */ +typedef struct PVRSRV_BRIDGE_IN_PMRIMPORTPMR_TAG +{ + IMG_HANDLE hPMRExport; + IMG_UINT64 ui64uiPassword; + IMG_UINT64 ui64uiSize; + IMG_UINT32 ui32uiLog2Contig; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_PMRIMPORTPMR; + + +/* Bridge out structure for PMRImportPMR */ +typedef struct PVRSRV_BRIDGE_OUT_PMRIMPORTPMR_TAG +{ + IMG_HANDLE hPMR; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PMRIMPORTPMR; + +/******************************************* + DevmemIntCtxCreate + *******************************************/ + +/* Bridge in structure for DevmemIntCtxCreate */ +typedef struct PVRSRV_BRIDGE_IN_DEVMEMINTCTXCREATE_TAG +{ + IMG_HANDLE hDeviceNode; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_DEVMEMINTCTXCREATE; + + +/* Bridge out structure for DevmemIntCtxCreate */ +typedef struct PVRSRV_BRIDGE_OUT_DEVMEMINTCTXCREATE_TAG +{ + IMG_HANDLE hDevMemServerContext; + IMG_HANDLE hPrivData; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DEVMEMINTCTXCREATE; + +/******************************************* + DevmemIntCtxDestroy + *******************************************/ + +/* Bridge in structure for DevmemIntCtxDestroy */ +typedef struct PVRSRV_BRIDGE_IN_DEVMEMINTCTXDESTROY_TAG +{ + IMG_HANDLE hDevmemServerContext; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_DEVMEMINTCTXDESTROY; + + +/* Bridge out structure for DevmemIntCtxDestroy */ +typedef struct PVRSRV_BRIDGE_OUT_DEVMEMINTCTXDESTROY_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DEVMEMINTCTXDESTROY; + +/******************************************* + DevmemIntHeapCreate + *******************************************/ + +/* Bridge in structure for DevmemIntHeapCreate */ +typedef struct PVRSRV_BRIDGE_IN_DEVMEMINTHEAPCREATE_TAG +{ + IMG_HANDLE hDevmemCtx; + IMG_DEV_VIRTADDR sHeapBaseAddr; + IMG_DEVMEM_SIZE_T uiHeapLength; + IMG_UINT32 ui32Log2DataPageSize; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_DEVMEMINTHEAPCREATE; + + +/* Bridge out structure for DevmemIntHeapCreate */ +typedef struct PVRSRV_BRIDGE_OUT_DEVMEMINTHEAPCREATE_TAG +{ + IMG_HANDLE hDevmemHeapPtr; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DEVMEMINTHEAPCREATE; + +/******************************************* + DevmemIntHeapDestroy + *******************************************/ + +/* Bridge in structure for DevmemIntHeapDestroy */ +typedef struct PVRSRV_BRIDGE_IN_DEVMEMINTHEAPDESTROY_TAG +{ + IMG_HANDLE hDevmemHeap; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_DEVMEMINTHEAPDESTROY; + + +/* Bridge out structure for DevmemIntHeapDestroy */ +typedef struct PVRSRV_BRIDGE_OUT_DEVMEMINTHEAPDESTROY_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DEVMEMINTHEAPDESTROY; + +/******************************************* + DevmemIntMapPMR + *******************************************/ + +/* Bridge in structure for DevmemIntMapPMR */ +typedef struct PVRSRV_BRIDGE_IN_DEVMEMINTMAPPMR_TAG +{ + IMG_HANDLE hDevmemServerHeap; + IMG_HANDLE hReservation; + IMG_HANDLE hPMR; + PVRSRV_MEMALLOCFLAGS_T uiMapFlags; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_DEVMEMINTMAPPMR; + + +/* Bridge out structure for DevmemIntMapPMR */ +typedef struct PVRSRV_BRIDGE_OUT_DEVMEMINTMAPPMR_TAG +{ + IMG_HANDLE hMapping; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DEVMEMINTMAPPMR; + +/******************************************* + DevmemIntUnmapPMR + *******************************************/ + +/* Bridge in structure for DevmemIntUnmapPMR */ +typedef struct PVRSRV_BRIDGE_IN_DEVMEMINTUNMAPPMR_TAG +{ + IMG_HANDLE hMapping; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_DEVMEMINTUNMAPPMR; + + +/* Bridge out structure for DevmemIntUnmapPMR */ +typedef struct PVRSRV_BRIDGE_OUT_DEVMEMINTUNMAPPMR_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DEVMEMINTUNMAPPMR; + +/******************************************* + DevmemIntReserveRange + *******************************************/ + +/* Bridge in structure for DevmemIntReserveRange */ +typedef struct PVRSRV_BRIDGE_IN_DEVMEMINTRESERVERANGE_TAG +{ + IMG_HANDLE hDevmemServerHeap; + IMG_DEV_VIRTADDR sAddress; + IMG_DEVMEM_SIZE_T uiLength; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_DEVMEMINTRESERVERANGE; + + +/* Bridge out structure for DevmemIntReserveRange */ +typedef struct PVRSRV_BRIDGE_OUT_DEVMEMINTRESERVERANGE_TAG +{ + IMG_HANDLE hReservation; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DEVMEMINTRESERVERANGE; + +/******************************************* + DevmemIntUnreserveRange + *******************************************/ + +/* Bridge in structure for DevmemIntUnreserveRange */ +typedef struct PVRSRV_BRIDGE_IN_DEVMEMINTUNRESERVERANGE_TAG +{ + IMG_HANDLE hReservation; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_DEVMEMINTUNRESERVERANGE; + + +/* Bridge out structure for DevmemIntUnreserveRange */ +typedef struct PVRSRV_BRIDGE_OUT_DEVMEMINTUNRESERVERANGE_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DEVMEMINTUNRESERVERANGE; + +/******************************************* + PhysmemNewRamBackedPMR + *******************************************/ + +/* Bridge in structure for PhysmemNewRamBackedPMR */ +typedef struct PVRSRV_BRIDGE_IN_PHYSMEMNEWRAMBACKEDPMR_TAG +{ + IMG_HANDLE hDeviceNode; + IMG_DEVMEM_SIZE_T uiSize; + IMG_DEVMEM_SIZE_T uiChunkSize; + IMG_UINT32 ui32NumPhysChunks; + IMG_UINT32 ui32NumVirtChunks; + IMG_BOOL * pbMappingTable; + IMG_UINT32 ui32Log2PageSize; + PVRSRV_MEMALLOCFLAGS_T uiFlags; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_PHYSMEMNEWRAMBACKEDPMR; + + +/* Bridge out structure for PhysmemNewRamBackedPMR */ +typedef struct PVRSRV_BRIDGE_OUT_PHYSMEMNEWRAMBACKEDPMR_TAG +{ + IMG_HANDLE hPMRPtr; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PHYSMEMNEWRAMBACKEDPMR; + +/******************************************* + PMRLocalImportPMR + *******************************************/ + +/* Bridge in structure for PMRLocalImportPMR */ +typedef struct PVRSRV_BRIDGE_IN_PMRLOCALIMPORTPMR_TAG +{ + IMG_HANDLE hExtHandle; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_PMRLOCALIMPORTPMR; + + +/* Bridge out structure for PMRLocalImportPMR */ +typedef struct PVRSRV_BRIDGE_OUT_PMRLOCALIMPORTPMR_TAG +{ + IMG_HANDLE hPMR; + IMG_DEVMEM_SIZE_T uiSize; + IMG_DEVMEM_ALIGN_T sAlign; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PMRLOCALIMPORTPMR; + +/******************************************* + PMRUnrefPMR + *******************************************/ + +/* Bridge in structure for PMRUnrefPMR */ +typedef struct PVRSRV_BRIDGE_IN_PMRUNREFPMR_TAG +{ + IMG_HANDLE hPMR; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_PMRUNREFPMR; + + +/* Bridge out structure for PMRUnrefPMR */ +typedef struct PVRSRV_BRIDGE_OUT_PMRUNREFPMR_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PMRUNREFPMR; + +/******************************************* + DevmemSLCFlushInvalRequest + *******************************************/ + +/* Bridge in structure for DevmemSLCFlushInvalRequest */ +typedef struct PVRSRV_BRIDGE_IN_DEVMEMSLCFLUSHINVALREQUEST_TAG +{ + IMG_HANDLE hDeviceNode; + IMG_HANDLE hPmr; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_DEVMEMSLCFLUSHINVALREQUEST; + + +/* Bridge out structure for DevmemSLCFlushInvalRequest */ +typedef struct PVRSRV_BRIDGE_OUT_DEVMEMSLCFLUSHINVALREQUEST_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DEVMEMSLCFLUSHINVALREQUEST; + +/******************************************* + DevmemIsVDevAddrValid + *******************************************/ + +/* Bridge in structure for DevmemIsVDevAddrValid */ +typedef struct PVRSRV_BRIDGE_IN_DEVMEMISVDEVADDRVALID_TAG +{ + IMG_HANDLE hDevmemCtx; + IMG_DEV_VIRTADDR sAddress; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_DEVMEMISVDEVADDRVALID; + + +/* Bridge out structure for DevmemIsVDevAddrValid */ +typedef struct PVRSRV_BRIDGE_OUT_DEVMEMISVDEVADDRVALID_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DEVMEMISVDEVADDRVALID; + +/******************************************* + HeapCfgHeapConfigCount + *******************************************/ + +/* Bridge in structure for HeapCfgHeapConfigCount */ +typedef struct PVRSRV_BRIDGE_IN_HEAPCFGHEAPCONFIGCOUNT_TAG +{ + IMG_HANDLE hDeviceNode; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_HEAPCFGHEAPCONFIGCOUNT; + + +/* Bridge out structure for HeapCfgHeapConfigCount */ +typedef struct PVRSRV_BRIDGE_OUT_HEAPCFGHEAPCONFIGCOUNT_TAG +{ + IMG_UINT32 ui32NumHeapConfigs; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_HEAPCFGHEAPCONFIGCOUNT; + +/******************************************* + HeapCfgHeapCount + *******************************************/ + +/* Bridge in structure for HeapCfgHeapCount */ +typedef struct PVRSRV_BRIDGE_IN_HEAPCFGHEAPCOUNT_TAG +{ + IMG_HANDLE hDeviceNode; + IMG_UINT32 ui32HeapConfigIndex; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_HEAPCFGHEAPCOUNT; + + +/* Bridge out structure for HeapCfgHeapCount */ +typedef struct PVRSRV_BRIDGE_OUT_HEAPCFGHEAPCOUNT_TAG +{ + IMG_UINT32 ui32NumHeaps; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_HEAPCFGHEAPCOUNT; + +/******************************************* + HeapCfgHeapConfigName + *******************************************/ + +/* Bridge in structure for HeapCfgHeapConfigName */ +typedef struct PVRSRV_BRIDGE_IN_HEAPCFGHEAPCONFIGNAME_TAG +{ + IMG_HANDLE hDeviceNode; + IMG_UINT32 ui32HeapConfigIndex; + IMG_UINT32 ui32HeapConfigNameBufSz; + /* Output pointer puiHeapConfigName is also an implied input */ + IMG_CHAR * puiHeapConfigName; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_HEAPCFGHEAPCONFIGNAME; + + +/* Bridge out structure for HeapCfgHeapConfigName */ +typedef struct PVRSRV_BRIDGE_OUT_HEAPCFGHEAPCONFIGNAME_TAG +{ + IMG_CHAR * puiHeapConfigName; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_HEAPCFGHEAPCONFIGNAME; + +/******************************************* + HeapCfgHeapDetails + *******************************************/ + +/* Bridge in structure for HeapCfgHeapDetails */ +typedef struct PVRSRV_BRIDGE_IN_HEAPCFGHEAPDETAILS_TAG +{ + IMG_HANDLE hDeviceNode; + IMG_UINT32 ui32HeapConfigIndex; + IMG_UINT32 ui32HeapIndex; + IMG_UINT32 ui32HeapNameBufSz; + /* Output pointer puiHeapNameOut is also an implied input */ + IMG_CHAR * puiHeapNameOut; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_HEAPCFGHEAPDETAILS; + + +/* Bridge out structure for HeapCfgHeapDetails */ +typedef struct PVRSRV_BRIDGE_OUT_HEAPCFGHEAPDETAILS_TAG +{ + IMG_CHAR * puiHeapNameOut; + IMG_DEV_VIRTADDR sDevVAddrBase; + IMG_DEVMEM_SIZE_T uiHeapLength; + IMG_UINT32 ui32Log2DataPageSizeOut; + IMG_UINT32 ui32Log2ImportAlignmentOut; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_HEAPCFGHEAPDETAILS; + +#endif /* COMMON_MM_BRIDGE_H */ diff --git a/drivers/gpu/rogue_m/generated/mm_bridge/server_mm_bridge.c b/drivers/gpu/rogue_m/generated/mm_bridge/server_mm_bridge.c new file mode 100644 index 000000000000..03e3e338364b --- /dev/null +++ b/drivers/gpu/rogue_m/generated/mm_bridge/server_mm_bridge.c @@ -0,0 +1,1699 @@ +/*************************************************************************/ /*! +@File +@Title Server bridge for mm +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Implements the server side of the bridge for mm +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#include +#include + +#include "img_defs.h" + +#include "devicemem_server.h" +#include "pmr.h" +#include "devicemem_heapcfg.h" +#include "physmem.h" + + +#include "common_mm_bridge.h" + +#include "allocmem.h" +#include "pvr_debug.h" +#include "connection_server.h" +#include "pvr_bridge.h" +#include "rgx_bridge.h" +#include "srvcore.h" +#include "handle.h" + +#if defined (SUPPORT_AUTH) +#include "osauth.h" +#endif + +#include + + +static PVRSRV_ERROR ReleasePMRExport(IMG_VOID *pvData) +{ + PVR_UNREFERENCED_PARAMETER(pvData); + + return PVRSRV_OK; +} +static PVRSRV_ERROR ReleasePMRExportOut(IMG_VOID *pvData) +{ + PVR_UNREFERENCED_PARAMETER(pvData); + + return PVRSRV_OK; +} + + +/* *************************************************************************** + * Server-side bridge entry points + */ + +static IMG_INT +PVRSRVBridgePMRExportPMR(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_PMREXPORTPMR *psPMRExportPMRIN, + PVRSRV_BRIDGE_OUT_PMREXPORTPMR *psPMRExportPMROUT, + CONNECTION_DATA *psConnection) +{ + PMR * psPMRInt = IMG_NULL; + PMR_EXPORT * psPMRExportInt = IMG_NULL; + IMG_HANDLE hPMRExportInt = IMG_NULL; + + + + + + PMRLock(); + + + { + /* Look up the address from the handle */ + psPMRExportPMROUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psPMRInt, + psPMRExportPMRIN->hPMR, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR); + if(psPMRExportPMROUT->eError != PVRSRV_OK) + { + PMRUnlock(); + goto PMRExportPMR_exit; + } + } + + + psPMRExportPMROUT->eError = + PMRExportPMR( + psPMRInt, + &psPMRExportInt, + &psPMRExportPMROUT->ui64Size, + &psPMRExportPMROUT->ui32Log2Contig, + &psPMRExportPMROUT->ui64Password); + /* Exit early if bridged call fails */ + if(psPMRExportPMROUT->eError != PVRSRV_OK) + { + PMRUnlock(); + goto PMRExportPMR_exit; + } + PMRUnlock(); + + + /* + * For cases where we need a cross process handle we actually allocate two. + * + * The first one is a connection specific handle and it gets given the real + * release function. This handle does *NOT* get returned to the caller. It's + * purpose is to release any leaked resources when we either have a bad or + * abnormally terminated client. If we didn't do this then the resource + * wouldn't be freed until driver unload. If the resource is freed normally, + * this handle can be looked up via the cross process handle and then + * released accordingly. + * + * The second one is a cross process handle and it gets given a noop release + * function. This handle does get returned to the caller. + */ + psPMRExportPMROUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &hPMRExportInt, + (IMG_VOID *) psPMRExportInt, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR_EXPORT, + PVRSRV_HANDLE_ALLOC_FLAG_SHARED + ,(PFN_HANDLE_RELEASE)&PMRUnexportPMR); + if (psPMRExportPMROUT->eError != PVRSRV_OK) + { + goto PMRExportPMR_exit; + } + + psPMRExportPMROUT->eError = PVRSRVAllocHandle(KERNEL_HANDLE_BASE, + &psPMRExportPMROUT->hPMRExport, + (IMG_VOID *) psPMRExportInt, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR_EXPORT, + PVRSRV_HANDLE_ALLOC_FLAG_MULTI, + (PFN_HANDLE_RELEASE)&ReleasePMRExport); + if (psPMRExportPMROUT->eError != PVRSRV_OK) + { + goto PMRExportPMR_exit; + } + + + +PMRExportPMR_exit: + if (psPMRExportPMROUT->eError != PVRSRV_OK) + { + if (psPMRExportPMROUT->hPMRExport) + { + PVRSRV_ERROR eError = PVRSRVReleaseHandle(KERNEL_HANDLE_BASE, + (IMG_HANDLE) psPMRExportPMROUT->hPMRExport, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR_EXPORT); + + /* Releasing the handle should free/destroy/release the resource. This should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + + } + + if (hPMRExportInt) + { + PVRSRV_ERROR eError = PVRSRVReleaseHandle(psConnection->psHandleBase, + hPMRExportInt, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR_EXPORT); + + /* Releasing the handle should free/destroy/release the resource. This should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + + /* Avoid freeing/destroying/releasing the resource a second time below */ + psPMRExportInt = IMG_NULL; + } + + if (psPMRExportInt) + { + PMRUnexportPMR(psPMRExportInt); + } + } + + + return 0; +} + +static IMG_INT +PVRSRVBridgePMRUnexportPMR(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_PMRUNEXPORTPMR *psPMRUnexportPMRIN, + PVRSRV_BRIDGE_OUT_PMRUNEXPORTPMR *psPMRUnexportPMROUT, + CONNECTION_DATA *psConnection) +{ + PMR_EXPORT * psPMRExportInt = IMG_NULL; + IMG_HANDLE hPMRExportInt = IMG_NULL; + + PVR_UNREFERENCED_PARAMETER(psConnection); + + + + + PMRLock(); + + + + psPMRUnexportPMROUT->eError = + PVRSRVLookupHandle(KERNEL_HANDLE_BASE, + (IMG_VOID **) &psPMRExportInt, + (IMG_HANDLE) psPMRUnexportPMRIN->hPMRExport, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR_EXPORT); + PVR_ASSERT(psPMRUnexportPMROUT->eError == PVRSRV_OK); + + /* + * Find the connection specific handle that represents the same data + * as the cross process handle as releasing it will actually call the + * data's real release function (see the function where the cross + * process handle is allocated for more details). + */ + psPMRUnexportPMROUT->eError = + PVRSRVFindHandle(psConnection->psHandleBase, + &hPMRExportInt, + psPMRExportInt, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR_EXPORT); + PVR_ASSERT(psPMRUnexportPMROUT->eError == PVRSRV_OK); + + psPMRUnexportPMROUT->eError = + PVRSRVReleaseHandle(psConnection->psHandleBase, + hPMRExportInt, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR_EXPORT); + PVR_ASSERT((psPMRUnexportPMROUT->eError == PVRSRV_OK) || (psPMRUnexportPMROUT->eError == PVRSRV_ERROR_RETRY)); + + psPMRUnexportPMROUT->eError = + PVRSRVReleaseHandle(KERNEL_HANDLE_BASE, + (IMG_HANDLE) psPMRUnexportPMRIN->hPMRExport, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR_EXPORT); + if ((psPMRUnexportPMROUT->eError != PVRSRV_OK) && (psPMRUnexportPMROUT->eError != PVRSRV_ERROR_RETRY)) + { + PVR_ASSERT(0); + PMRUnlock(); + goto PMRUnexportPMR_exit; + } + + PMRUnlock(); + + +PMRUnexportPMR_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgePMRGetUID(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_PMRGETUID *psPMRGetUIDIN, + PVRSRV_BRIDGE_OUT_PMRGETUID *psPMRGetUIDOUT, + CONNECTION_DATA *psConnection) +{ + PMR * psPMRInt = IMG_NULL; + + + + + + PMRLock(); + + + { + /* Look up the address from the handle */ + psPMRGetUIDOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psPMRInt, + psPMRGetUIDIN->hPMR, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR); + if(psPMRGetUIDOUT->eError != PVRSRV_OK) + { + PMRUnlock(); + goto PMRGetUID_exit; + } + } + + + psPMRGetUIDOUT->eError = + PMRGetUID( + psPMRInt, + &psPMRGetUIDOUT->ui64UID); + PMRUnlock(); + + + + +PMRGetUID_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgePMRMakeServerExportClientExport(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_PMRMAKESERVEREXPORTCLIENTEXPORT *psPMRMakeServerExportClientExportIN, + PVRSRV_BRIDGE_OUT_PMRMAKESERVEREXPORTCLIENTEXPORT *psPMRMakeServerExportClientExportOUT, + CONNECTION_DATA *psConnection) +{ + DEVMEM_EXPORTCOOKIE * psPMRServerExportInt = IMG_NULL; + PMR_EXPORT * psPMRExportOutInt = IMG_NULL; + IMG_HANDLE hPMRExportOutInt = IMG_NULL; + + + + + + + + { + /* Look up the address from the handle */ + psPMRMakeServerExportClientExportOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psPMRServerExportInt, + psPMRMakeServerExportClientExportIN->hPMRServerExport, + PVRSRV_HANDLE_TYPE_SERVER_EXPORTCOOKIE); + if(psPMRMakeServerExportClientExportOUT->eError != PVRSRV_OK) + { + goto PMRMakeServerExportClientExport_exit; + } + } + + + psPMRMakeServerExportClientExportOUT->eError = + PMRMakeServerExportClientExport( + psPMRServerExportInt, + &psPMRExportOutInt, + &psPMRMakeServerExportClientExportOUT->ui64Size, + &psPMRMakeServerExportClientExportOUT->ui32Log2Contig, + &psPMRMakeServerExportClientExportOUT->ui64Password); + /* Exit early if bridged call fails */ + if(psPMRMakeServerExportClientExportOUT->eError != PVRSRV_OK) + { + goto PMRMakeServerExportClientExport_exit; + } + + + /* + * For cases where we need a cross process handle we actually allocate two. + * + * The first one is a connection specific handle and it gets given the real + * release function. This handle does *NOT* get returned to the caller. It's + * purpose is to release any leaked resources when we either have a bad or + * abnormally terminated client. If we didn't do this then the resource + * wouldn't be freed until driver unload. If the resource is freed normally, + * this handle can be looked up via the cross process handle and then + * released accordingly. + * + * The second one is a cross process handle and it gets given a noop release + * function. This handle does get returned to the caller. + */ + psPMRMakeServerExportClientExportOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &hPMRExportOutInt, + (IMG_VOID *) psPMRExportOutInt, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR_EXPORT, + PVRSRV_HANDLE_ALLOC_FLAG_SHARED + ,(PFN_HANDLE_RELEASE)&PMRUnmakeServerExportClientExport); + if (psPMRMakeServerExportClientExportOUT->eError != PVRSRV_OK) + { + goto PMRMakeServerExportClientExport_exit; + } + + psPMRMakeServerExportClientExportOUT->eError = PVRSRVAllocHandle(KERNEL_HANDLE_BASE, + &psPMRMakeServerExportClientExportOUT->hPMRExportOut, + (IMG_VOID *) psPMRExportOutInt, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR_EXPORT, + PVRSRV_HANDLE_ALLOC_FLAG_MULTI, + (PFN_HANDLE_RELEASE)&ReleasePMRExportOut); + if (psPMRMakeServerExportClientExportOUT->eError != PVRSRV_OK) + { + goto PMRMakeServerExportClientExport_exit; + } + + + +PMRMakeServerExportClientExport_exit: + if (psPMRMakeServerExportClientExportOUT->eError != PVRSRV_OK) + { + if (psPMRMakeServerExportClientExportOUT->hPMRExportOut) + { + PVRSRV_ERROR eError = PVRSRVReleaseHandle(KERNEL_HANDLE_BASE, + (IMG_HANDLE) psPMRMakeServerExportClientExportOUT->hPMRExportOut, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR_EXPORT); + + /* Releasing the handle should free/destroy/release the resource. This should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + + } + + if (hPMRExportOutInt) + { + PVRSRV_ERROR eError = PVRSRVReleaseHandle(psConnection->psHandleBase, + hPMRExportOutInt, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR_EXPORT); + + /* Releasing the handle should free/destroy/release the resource. This should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + + /* Avoid freeing/destroying/releasing the resource a second time below */ + psPMRExportOutInt = IMG_NULL; + } + + if (psPMRExportOutInt) + { + PMRUnmakeServerExportClientExport(psPMRExportOutInt); + } + } + + + return 0; +} + +static IMG_INT +PVRSRVBridgePMRUnmakeServerExportClientExport(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_PMRUNMAKESERVEREXPORTCLIENTEXPORT *psPMRUnmakeServerExportClientExportIN, + PVRSRV_BRIDGE_OUT_PMRUNMAKESERVEREXPORTCLIENTEXPORT *psPMRUnmakeServerExportClientExportOUT, + CONNECTION_DATA *psConnection) +{ + PMR_EXPORT * psPMRExportInt = IMG_NULL; + IMG_HANDLE hPMRExportInt = IMG_NULL; + + PVR_UNREFERENCED_PARAMETER(psConnection); + + + + + + + + psPMRUnmakeServerExportClientExportOUT->eError = + PVRSRVLookupHandle(KERNEL_HANDLE_BASE, + (IMG_VOID **) &psPMRExportInt, + (IMG_HANDLE) psPMRUnmakeServerExportClientExportIN->hPMRExport, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR_EXPORT); + PVR_ASSERT(psPMRUnmakeServerExportClientExportOUT->eError == PVRSRV_OK); + + /* + * Find the connection specific handle that represents the same data + * as the cross process handle as releasing it will actually call the + * data's real release function (see the function where the cross + * process handle is allocated for more details). + */ + psPMRUnmakeServerExportClientExportOUT->eError = + PVRSRVFindHandle(psConnection->psHandleBase, + &hPMRExportInt, + psPMRExportInt, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR_EXPORT); + PVR_ASSERT(psPMRUnmakeServerExportClientExportOUT->eError == PVRSRV_OK); + + psPMRUnmakeServerExportClientExportOUT->eError = + PVRSRVReleaseHandle(psConnection->psHandleBase, + hPMRExportInt, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR_EXPORT); + PVR_ASSERT((psPMRUnmakeServerExportClientExportOUT->eError == PVRSRV_OK) || (psPMRUnmakeServerExportClientExportOUT->eError == PVRSRV_ERROR_RETRY)); + + psPMRUnmakeServerExportClientExportOUT->eError = + PVRSRVReleaseHandle(KERNEL_HANDLE_BASE, + (IMG_HANDLE) psPMRUnmakeServerExportClientExportIN->hPMRExport, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR_EXPORT); + if ((psPMRUnmakeServerExportClientExportOUT->eError != PVRSRV_OK) && (psPMRUnmakeServerExportClientExportOUT->eError != PVRSRV_ERROR_RETRY)) + { + PVR_ASSERT(0); + goto PMRUnmakeServerExportClientExport_exit; + } + + + +PMRUnmakeServerExportClientExport_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgePMRImportPMR(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_PMRIMPORTPMR *psPMRImportPMRIN, + PVRSRV_BRIDGE_OUT_PMRIMPORTPMR *psPMRImportPMROUT, + CONNECTION_DATA *psConnection) +{ + PMR_EXPORT * psPMRExportInt = IMG_NULL; + PMR * psPMRInt = IMG_NULL; + + + + +#if defined (SUPPORT_AUTH) + psPMRImportPMROUT->eError = OSCheckAuthentication(psConnection, 1); + if (psPMRImportPMROUT->eError != PVRSRV_OK) + { + goto PMRImportPMR_exit; + } +#endif + + PMRLock(); + + + { + /* Look up the address from the handle */ + psPMRImportPMROUT->eError = + PVRSRVLookupHandle(KERNEL_HANDLE_BASE, + (IMG_VOID **) &psPMRExportInt, + psPMRImportPMRIN->hPMRExport, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR_EXPORT); + if(psPMRImportPMROUT->eError != PVRSRV_OK) + { + PMRUnlock(); + goto PMRImportPMR_exit; + } + } + + + psPMRImportPMROUT->eError = + PMRImportPMR( + psPMRExportInt, + psPMRImportPMRIN->ui64uiPassword, + psPMRImportPMRIN->ui64uiSize, + psPMRImportPMRIN->ui32uiLog2Contig, + &psPMRInt); + /* Exit early if bridged call fails */ + if(psPMRImportPMROUT->eError != PVRSRV_OK) + { + PMRUnlock(); + goto PMRImportPMR_exit; + } + PMRUnlock(); + + + psPMRImportPMROUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psPMRImportPMROUT->hPMR, + (IMG_VOID *) psPMRInt, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR, + PVRSRV_HANDLE_ALLOC_FLAG_MULTI + ,(PFN_HANDLE_RELEASE)&PMRUnrefPMR); + if (psPMRImportPMROUT->eError != PVRSRV_OK) + { + goto PMRImportPMR_exit; + } + + + + +PMRImportPMR_exit: + if (psPMRImportPMROUT->eError != PVRSRV_OK) + { + if (psPMRInt) + { + PMRUnrefPMR(psPMRInt); + } + } + + + return 0; +} + +static IMG_INT +PVRSRVBridgeDevmemIntCtxCreate(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_DEVMEMINTCTXCREATE *psDevmemIntCtxCreateIN, + PVRSRV_BRIDGE_OUT_DEVMEMINTCTXCREATE *psDevmemIntCtxCreateOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDeviceNodeInt = IMG_NULL; + DEVMEMINT_CTX * psDevMemServerContextInt = IMG_NULL; + IMG_HANDLE hPrivDataInt = IMG_NULL; + + + + psDevmemIntCtxCreateOUT->hDevMemServerContext = IMG_NULL; + + + + + { + /* Look up the address from the handle */ + psDevmemIntCtxCreateOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &hDeviceNodeInt, + psDevmemIntCtxCreateIN->hDeviceNode, + PVRSRV_HANDLE_TYPE_DEV_NODE); + if(psDevmemIntCtxCreateOUT->eError != PVRSRV_OK) + { + goto DevmemIntCtxCreate_exit; + } + } + + + psDevmemIntCtxCreateOUT->eError = + DevmemIntCtxCreate( + hDeviceNodeInt, + &psDevMemServerContextInt, + &hPrivDataInt); + /* Exit early if bridged call fails */ + if(psDevmemIntCtxCreateOUT->eError != PVRSRV_OK) + { + goto DevmemIntCtxCreate_exit; + } + + + psDevmemIntCtxCreateOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psDevmemIntCtxCreateOUT->hDevMemServerContext, + (IMG_VOID *) psDevMemServerContextInt, + PVRSRV_HANDLE_TYPE_DEVMEMINT_CTX, + PVRSRV_HANDLE_ALLOC_FLAG_MULTI + ,(PFN_HANDLE_RELEASE)&DevmemIntCtxDestroy); + if (psDevmemIntCtxCreateOUT->eError != PVRSRV_OK) + { + goto DevmemIntCtxCreate_exit; + } + + + psDevmemIntCtxCreateOUT->eError = PVRSRVAllocSubHandle(psConnection->psHandleBase, + &psDevmemIntCtxCreateOUT->hPrivData, + (IMG_VOID *) hPrivDataInt, + PVRSRV_HANDLE_TYPE_DEV_PRIV_DATA, + PVRSRV_HANDLE_ALLOC_FLAG_MULTI + ,psDevmemIntCtxCreateOUT->hDevMemServerContext); + if (psDevmemIntCtxCreateOUT->eError != PVRSRV_OK) + { + goto DevmemIntCtxCreate_exit; + } + + + + +DevmemIntCtxCreate_exit: + if (psDevmemIntCtxCreateOUT->eError != PVRSRV_OK) + { + if (psDevmemIntCtxCreateOUT->hDevMemServerContext) + { + PVRSRV_ERROR eError = PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psDevmemIntCtxCreateOUT->hDevMemServerContext, + PVRSRV_HANDLE_TYPE_DEVMEMINT_CTX); + + /* Releasing the handle should free/destroy/release the resource. This should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + + /* Avoid freeing/destroying/releasing the resource a second time below */ + psDevMemServerContextInt = IMG_NULL; + } + + + if (psDevMemServerContextInt) + { + DevmemIntCtxDestroy(psDevMemServerContextInt); + } + } + + + return 0; +} + +static IMG_INT +PVRSRVBridgeDevmemIntCtxDestroy(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_DEVMEMINTCTXDESTROY *psDevmemIntCtxDestroyIN, + PVRSRV_BRIDGE_OUT_DEVMEMINTCTXDESTROY *psDevmemIntCtxDestroyOUT, + CONNECTION_DATA *psConnection) +{ + + + + + + + + + + psDevmemIntCtxDestroyOUT->eError = + PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psDevmemIntCtxDestroyIN->hDevmemServerContext, + PVRSRV_HANDLE_TYPE_DEVMEMINT_CTX); + if ((psDevmemIntCtxDestroyOUT->eError != PVRSRV_OK) && (psDevmemIntCtxDestroyOUT->eError != PVRSRV_ERROR_RETRY)) + { + PVR_ASSERT(0); + goto DevmemIntCtxDestroy_exit; + } + + + +DevmemIntCtxDestroy_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeDevmemIntHeapCreate(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_DEVMEMINTHEAPCREATE *psDevmemIntHeapCreateIN, + PVRSRV_BRIDGE_OUT_DEVMEMINTHEAPCREATE *psDevmemIntHeapCreateOUT, + CONNECTION_DATA *psConnection) +{ + DEVMEMINT_CTX * psDevmemCtxInt = IMG_NULL; + DEVMEMINT_HEAP * psDevmemHeapPtrInt = IMG_NULL; + + + + + + + + { + /* Look up the address from the handle */ + psDevmemIntHeapCreateOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psDevmemCtxInt, + psDevmemIntHeapCreateIN->hDevmemCtx, + PVRSRV_HANDLE_TYPE_DEVMEMINT_CTX); + if(psDevmemIntHeapCreateOUT->eError != PVRSRV_OK) + { + goto DevmemIntHeapCreate_exit; + } + } + + + psDevmemIntHeapCreateOUT->eError = + DevmemIntHeapCreate( + psDevmemCtxInt, + psDevmemIntHeapCreateIN->sHeapBaseAddr, + psDevmemIntHeapCreateIN->uiHeapLength, + psDevmemIntHeapCreateIN->ui32Log2DataPageSize, + &psDevmemHeapPtrInt); + /* Exit early if bridged call fails */ + if(psDevmemIntHeapCreateOUT->eError != PVRSRV_OK) + { + goto DevmemIntHeapCreate_exit; + } + + + psDevmemIntHeapCreateOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psDevmemIntHeapCreateOUT->hDevmemHeapPtr, + (IMG_VOID *) psDevmemHeapPtrInt, + PVRSRV_HANDLE_TYPE_DEVMEMINT_HEAP, + PVRSRV_HANDLE_ALLOC_FLAG_MULTI + ,(PFN_HANDLE_RELEASE)&DevmemIntHeapDestroy); + if (psDevmemIntHeapCreateOUT->eError != PVRSRV_OK) + { + goto DevmemIntHeapCreate_exit; + } + + + + +DevmemIntHeapCreate_exit: + if (psDevmemIntHeapCreateOUT->eError != PVRSRV_OK) + { + if (psDevmemHeapPtrInt) + { + DevmemIntHeapDestroy(psDevmemHeapPtrInt); + } + } + + + return 0; +} + +static IMG_INT +PVRSRVBridgeDevmemIntHeapDestroy(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_DEVMEMINTHEAPDESTROY *psDevmemIntHeapDestroyIN, + PVRSRV_BRIDGE_OUT_DEVMEMINTHEAPDESTROY *psDevmemIntHeapDestroyOUT, + CONNECTION_DATA *psConnection) +{ + + + + + + + + + + psDevmemIntHeapDestroyOUT->eError = + PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psDevmemIntHeapDestroyIN->hDevmemHeap, + PVRSRV_HANDLE_TYPE_DEVMEMINT_HEAP); + if ((psDevmemIntHeapDestroyOUT->eError != PVRSRV_OK) && (psDevmemIntHeapDestroyOUT->eError != PVRSRV_ERROR_RETRY)) + { + PVR_ASSERT(0); + goto DevmemIntHeapDestroy_exit; + } + + + +DevmemIntHeapDestroy_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeDevmemIntMapPMR(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_DEVMEMINTMAPPMR *psDevmemIntMapPMRIN, + PVRSRV_BRIDGE_OUT_DEVMEMINTMAPPMR *psDevmemIntMapPMROUT, + CONNECTION_DATA *psConnection) +{ + DEVMEMINT_HEAP * psDevmemServerHeapInt = IMG_NULL; + DEVMEMINT_RESERVATION * psReservationInt = IMG_NULL; + PMR * psPMRInt = IMG_NULL; + DEVMEMINT_MAPPING * psMappingInt = IMG_NULL; + + + + + + PMRLock(); + + + { + /* Look up the address from the handle */ + psDevmemIntMapPMROUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psDevmemServerHeapInt, + psDevmemIntMapPMRIN->hDevmemServerHeap, + PVRSRV_HANDLE_TYPE_DEVMEMINT_HEAP); + if(psDevmemIntMapPMROUT->eError != PVRSRV_OK) + { + PMRUnlock(); + goto DevmemIntMapPMR_exit; + } + } + + + { + /* Look up the address from the handle */ + psDevmemIntMapPMROUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psReservationInt, + psDevmemIntMapPMRIN->hReservation, + PVRSRV_HANDLE_TYPE_DEVMEMINT_RESERVATION); + if(psDevmemIntMapPMROUT->eError != PVRSRV_OK) + { + PMRUnlock(); + goto DevmemIntMapPMR_exit; + } + } + + + { + /* Look up the address from the handle */ + psDevmemIntMapPMROUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psPMRInt, + psDevmemIntMapPMRIN->hPMR, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR); + if(psDevmemIntMapPMROUT->eError != PVRSRV_OK) + { + PMRUnlock(); + goto DevmemIntMapPMR_exit; + } + } + + + psDevmemIntMapPMROUT->eError = + DevmemIntMapPMR( + psDevmemServerHeapInt, + psReservationInt, + psPMRInt, + psDevmemIntMapPMRIN->uiMapFlags, + &psMappingInt); + /* Exit early if bridged call fails */ + if(psDevmemIntMapPMROUT->eError != PVRSRV_OK) + { + PMRUnlock(); + goto DevmemIntMapPMR_exit; + } + PMRUnlock(); + + + psDevmemIntMapPMROUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psDevmemIntMapPMROUT->hMapping, + (IMG_VOID *) psMappingInt, + PVRSRV_HANDLE_TYPE_DEVMEMINT_MAPPING, + PVRSRV_HANDLE_ALLOC_FLAG_MULTI + ,(PFN_HANDLE_RELEASE)&DevmemIntUnmapPMR); + if (psDevmemIntMapPMROUT->eError != PVRSRV_OK) + { + goto DevmemIntMapPMR_exit; + } + + + + +DevmemIntMapPMR_exit: + if (psDevmemIntMapPMROUT->eError != PVRSRV_OK) + { + if (psMappingInt) + { + DevmemIntUnmapPMR(psMappingInt); + } + } + + + return 0; +} + +static IMG_INT +PVRSRVBridgeDevmemIntUnmapPMR(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_DEVMEMINTUNMAPPMR *psDevmemIntUnmapPMRIN, + PVRSRV_BRIDGE_OUT_DEVMEMINTUNMAPPMR *psDevmemIntUnmapPMROUT, + CONNECTION_DATA *psConnection) +{ + + + + + + PMRLock(); + + + + + psDevmemIntUnmapPMROUT->eError = + PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psDevmemIntUnmapPMRIN->hMapping, + PVRSRV_HANDLE_TYPE_DEVMEMINT_MAPPING); + if ((psDevmemIntUnmapPMROUT->eError != PVRSRV_OK) && (psDevmemIntUnmapPMROUT->eError != PVRSRV_ERROR_RETRY)) + { + PVR_ASSERT(0); + PMRUnlock(); + goto DevmemIntUnmapPMR_exit; + } + + PMRUnlock(); + + +DevmemIntUnmapPMR_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeDevmemIntReserveRange(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_DEVMEMINTRESERVERANGE *psDevmemIntReserveRangeIN, + PVRSRV_BRIDGE_OUT_DEVMEMINTRESERVERANGE *psDevmemIntReserveRangeOUT, + CONNECTION_DATA *psConnection) +{ + DEVMEMINT_HEAP * psDevmemServerHeapInt = IMG_NULL; + DEVMEMINT_RESERVATION * psReservationInt = IMG_NULL; + + + + + + + + { + /* Look up the address from the handle */ + psDevmemIntReserveRangeOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psDevmemServerHeapInt, + psDevmemIntReserveRangeIN->hDevmemServerHeap, + PVRSRV_HANDLE_TYPE_DEVMEMINT_HEAP); + if(psDevmemIntReserveRangeOUT->eError != PVRSRV_OK) + { + goto DevmemIntReserveRange_exit; + } + } + + + psDevmemIntReserveRangeOUT->eError = + DevmemIntReserveRange( + psDevmemServerHeapInt, + psDevmemIntReserveRangeIN->sAddress, + psDevmemIntReserveRangeIN->uiLength, + &psReservationInt); + /* Exit early if bridged call fails */ + if(psDevmemIntReserveRangeOUT->eError != PVRSRV_OK) + { + goto DevmemIntReserveRange_exit; + } + + + psDevmemIntReserveRangeOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psDevmemIntReserveRangeOUT->hReservation, + (IMG_VOID *) psReservationInt, + PVRSRV_HANDLE_TYPE_DEVMEMINT_RESERVATION, + PVRSRV_HANDLE_ALLOC_FLAG_MULTI + ,(PFN_HANDLE_RELEASE)&DevmemIntUnreserveRange); + if (psDevmemIntReserveRangeOUT->eError != PVRSRV_OK) + { + goto DevmemIntReserveRange_exit; + } + + + + +DevmemIntReserveRange_exit: + if (psDevmemIntReserveRangeOUT->eError != PVRSRV_OK) + { + if (psReservationInt) + { + DevmemIntUnreserveRange(psReservationInt); + } + } + + + return 0; +} + +static IMG_INT +PVRSRVBridgeDevmemIntUnreserveRange(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_DEVMEMINTUNRESERVERANGE *psDevmemIntUnreserveRangeIN, + PVRSRV_BRIDGE_OUT_DEVMEMINTUNRESERVERANGE *psDevmemIntUnreserveRangeOUT, + CONNECTION_DATA *psConnection) +{ + + + + + + + + + + psDevmemIntUnreserveRangeOUT->eError = + PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psDevmemIntUnreserveRangeIN->hReservation, + PVRSRV_HANDLE_TYPE_DEVMEMINT_RESERVATION); + if ((psDevmemIntUnreserveRangeOUT->eError != PVRSRV_OK) && (psDevmemIntUnreserveRangeOUT->eError != PVRSRV_ERROR_RETRY)) + { + PVR_ASSERT(0); + goto DevmemIntUnreserveRange_exit; + } + + + +DevmemIntUnreserveRange_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgePhysmemNewRamBackedPMR(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_PHYSMEMNEWRAMBACKEDPMR *psPhysmemNewRamBackedPMRIN, + PVRSRV_BRIDGE_OUT_PHYSMEMNEWRAMBACKEDPMR *psPhysmemNewRamBackedPMROUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDeviceNodeInt = IMG_NULL; + IMG_BOOL *bMappingTableInt = IMG_NULL; + PMR * psPMRPtrInt = IMG_NULL; + + + + + if (psPhysmemNewRamBackedPMRIN->ui32NumVirtChunks != 0) + { + bMappingTableInt = OSAllocMem(psPhysmemNewRamBackedPMRIN->ui32NumVirtChunks * sizeof(IMG_BOOL)); + if (!bMappingTableInt) + { + psPhysmemNewRamBackedPMROUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto PhysmemNewRamBackedPMR_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psPhysmemNewRamBackedPMRIN->pbMappingTable, psPhysmemNewRamBackedPMRIN->ui32NumVirtChunks * sizeof(IMG_BOOL)) + || (OSCopyFromUser(NULL, bMappingTableInt, psPhysmemNewRamBackedPMRIN->pbMappingTable, + psPhysmemNewRamBackedPMRIN->ui32NumVirtChunks * sizeof(IMG_BOOL)) != PVRSRV_OK) ) + { + psPhysmemNewRamBackedPMROUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto PhysmemNewRamBackedPMR_exit; + } + + PMRLock(); + + + { + /* Look up the address from the handle */ + psPhysmemNewRamBackedPMROUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &hDeviceNodeInt, + psPhysmemNewRamBackedPMRIN->hDeviceNode, + PVRSRV_HANDLE_TYPE_DEV_NODE); + if(psPhysmemNewRamBackedPMROUT->eError != PVRSRV_OK) + { + PMRUnlock(); + goto PhysmemNewRamBackedPMR_exit; + } + } + + + psPhysmemNewRamBackedPMROUT->eError = + PhysmemNewRamBackedPMR( + hDeviceNodeInt, + psPhysmemNewRamBackedPMRIN->uiSize, + psPhysmemNewRamBackedPMRIN->uiChunkSize, + psPhysmemNewRamBackedPMRIN->ui32NumPhysChunks, + psPhysmemNewRamBackedPMRIN->ui32NumVirtChunks, + bMappingTableInt, + psPhysmemNewRamBackedPMRIN->ui32Log2PageSize, + psPhysmemNewRamBackedPMRIN->uiFlags, + &psPMRPtrInt); + /* Exit early if bridged call fails */ + if(psPhysmemNewRamBackedPMROUT->eError != PVRSRV_OK) + { + PMRUnlock(); + goto PhysmemNewRamBackedPMR_exit; + } + PMRUnlock(); + + + psPhysmemNewRamBackedPMROUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psPhysmemNewRamBackedPMROUT->hPMRPtr, + (IMG_VOID *) psPMRPtrInt, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR, + PVRSRV_HANDLE_ALLOC_FLAG_MULTI + ,(PFN_HANDLE_RELEASE)&PMRUnrefPMR); + if (psPhysmemNewRamBackedPMROUT->eError != PVRSRV_OK) + { + goto PhysmemNewRamBackedPMR_exit; + } + + + + +PhysmemNewRamBackedPMR_exit: + if (psPhysmemNewRamBackedPMROUT->eError != PVRSRV_OK) + { + if (psPMRPtrInt) + { + PMRUnrefPMR(psPMRPtrInt); + } + } + + if (bMappingTableInt) + OSFreeMem(bMappingTableInt); + + return 0; +} + +static IMG_INT +PVRSRVBridgePMRLocalImportPMR(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_PMRLOCALIMPORTPMR *psPMRLocalImportPMRIN, + PVRSRV_BRIDGE_OUT_PMRLOCALIMPORTPMR *psPMRLocalImportPMROUT, + CONNECTION_DATA *psConnection) +{ + PMR * psExtHandleInt = IMG_NULL; + PMR * psPMRInt = IMG_NULL; + + + + + + PMRLock(); + + + { + /* Look up the address from the handle */ + psPMRLocalImportPMROUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psExtHandleInt, + psPMRLocalImportPMRIN->hExtHandle, + PVRSRV_HANDLE_TYPE_DEVMEM_MEM_IMPORT); + if(psPMRLocalImportPMROUT->eError != PVRSRV_OK) + { + PMRUnlock(); + goto PMRLocalImportPMR_exit; + } + } + + + psPMRLocalImportPMROUT->eError = + PMRLocalImportPMR( + psExtHandleInt, + &psPMRInt, + &psPMRLocalImportPMROUT->uiSize, + &psPMRLocalImportPMROUT->sAlign); + /* Exit early if bridged call fails */ + if(psPMRLocalImportPMROUT->eError != PVRSRV_OK) + { + PMRUnlock(); + goto PMRLocalImportPMR_exit; + } + PMRUnlock(); + + + psPMRLocalImportPMROUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psPMRLocalImportPMROUT->hPMR, + (IMG_VOID *) psPMRInt, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR, + PVRSRV_HANDLE_ALLOC_FLAG_MULTI + ,(PFN_HANDLE_RELEASE)&PMRUnrefPMR); + if (psPMRLocalImportPMROUT->eError != PVRSRV_OK) + { + goto PMRLocalImportPMR_exit; + } + + + + +PMRLocalImportPMR_exit: + if (psPMRLocalImportPMROUT->eError != PVRSRV_OK) + { + if (psPMRInt) + { + PMRUnrefPMR(psPMRInt); + } + } + + + return 0; +} + +static IMG_INT +PVRSRVBridgePMRUnrefPMR(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_PMRUNREFPMR *psPMRUnrefPMRIN, + PVRSRV_BRIDGE_OUT_PMRUNREFPMR *psPMRUnrefPMROUT, + CONNECTION_DATA *psConnection) +{ + + + + + + PMRLock(); + + + + + psPMRUnrefPMROUT->eError = + PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psPMRUnrefPMRIN->hPMR, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR); + if ((psPMRUnrefPMROUT->eError != PVRSRV_OK) && (psPMRUnrefPMROUT->eError != PVRSRV_ERROR_RETRY)) + { + PVR_ASSERT(0); + PMRUnlock(); + goto PMRUnrefPMR_exit; + } + + PMRUnlock(); + + +PMRUnrefPMR_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeDevmemSLCFlushInvalRequest(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_DEVMEMSLCFLUSHINVALREQUEST *psDevmemSLCFlushInvalRequestIN, + PVRSRV_BRIDGE_OUT_DEVMEMSLCFLUSHINVALREQUEST *psDevmemSLCFlushInvalRequestOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDeviceNodeInt = IMG_NULL; + PMR * psPmrInt = IMG_NULL; + + + + + + + + { + /* Look up the address from the handle */ + psDevmemSLCFlushInvalRequestOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &hDeviceNodeInt, + psDevmemSLCFlushInvalRequestIN->hDeviceNode, + PVRSRV_HANDLE_TYPE_DEV_NODE); + if(psDevmemSLCFlushInvalRequestOUT->eError != PVRSRV_OK) + { + goto DevmemSLCFlushInvalRequest_exit; + } + } + + + { + /* Look up the address from the handle */ + psDevmemSLCFlushInvalRequestOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psPmrInt, + psDevmemSLCFlushInvalRequestIN->hPmr, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR); + if(psDevmemSLCFlushInvalRequestOUT->eError != PVRSRV_OK) + { + goto DevmemSLCFlushInvalRequest_exit; + } + } + + + psDevmemSLCFlushInvalRequestOUT->eError = + DevmemSLCFlushInvalRequest( + hDeviceNodeInt, + psPmrInt); + + + + +DevmemSLCFlushInvalRequest_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeDevmemIsVDevAddrValid(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_DEVMEMISVDEVADDRVALID *psDevmemIsVDevAddrValidIN, + PVRSRV_BRIDGE_OUT_DEVMEMISVDEVADDRVALID *psDevmemIsVDevAddrValidOUT, + CONNECTION_DATA *psConnection) +{ + DEVMEMINT_CTX * psDevmemCtxInt = IMG_NULL; + + + + + + + + { + /* Look up the address from the handle */ + psDevmemIsVDevAddrValidOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psDevmemCtxInt, + psDevmemIsVDevAddrValidIN->hDevmemCtx, + PVRSRV_HANDLE_TYPE_DEVMEMINT_CTX); + if(psDevmemIsVDevAddrValidOUT->eError != PVRSRV_OK) + { + goto DevmemIsVDevAddrValid_exit; + } + } + + + psDevmemIsVDevAddrValidOUT->eError = + DevmemIntIsVDevAddrValid( + psDevmemCtxInt, + psDevmemIsVDevAddrValidIN->sAddress); + + + + +DevmemIsVDevAddrValid_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeHeapCfgHeapConfigCount(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_HEAPCFGHEAPCONFIGCOUNT *psHeapCfgHeapConfigCountIN, + PVRSRV_BRIDGE_OUT_HEAPCFGHEAPCONFIGCOUNT *psHeapCfgHeapConfigCountOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDeviceNodeInt = IMG_NULL; + + + + + + + + { + /* Look up the address from the handle */ + psHeapCfgHeapConfigCountOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &hDeviceNodeInt, + psHeapCfgHeapConfigCountIN->hDeviceNode, + PVRSRV_HANDLE_TYPE_DEV_NODE); + if(psHeapCfgHeapConfigCountOUT->eError != PVRSRV_OK) + { + goto HeapCfgHeapConfigCount_exit; + } + } + + + psHeapCfgHeapConfigCountOUT->eError = + HeapCfgHeapConfigCount( + hDeviceNodeInt, + &psHeapCfgHeapConfigCountOUT->ui32NumHeapConfigs); + + + + +HeapCfgHeapConfigCount_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeHeapCfgHeapCount(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_HEAPCFGHEAPCOUNT *psHeapCfgHeapCountIN, + PVRSRV_BRIDGE_OUT_HEAPCFGHEAPCOUNT *psHeapCfgHeapCountOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDeviceNodeInt = IMG_NULL; + + + + + + + + { + /* Look up the address from the handle */ + psHeapCfgHeapCountOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &hDeviceNodeInt, + psHeapCfgHeapCountIN->hDeviceNode, + PVRSRV_HANDLE_TYPE_DEV_NODE); + if(psHeapCfgHeapCountOUT->eError != PVRSRV_OK) + { + goto HeapCfgHeapCount_exit; + } + } + + + psHeapCfgHeapCountOUT->eError = + HeapCfgHeapCount( + hDeviceNodeInt, + psHeapCfgHeapCountIN->ui32HeapConfigIndex, + &psHeapCfgHeapCountOUT->ui32NumHeaps); + + + + +HeapCfgHeapCount_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeHeapCfgHeapConfigName(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_HEAPCFGHEAPCONFIGNAME *psHeapCfgHeapConfigNameIN, + PVRSRV_BRIDGE_OUT_HEAPCFGHEAPCONFIGNAME *psHeapCfgHeapConfigNameOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDeviceNodeInt = IMG_NULL; + IMG_CHAR *puiHeapConfigNameInt = IMG_NULL; + + + psHeapCfgHeapConfigNameOUT->puiHeapConfigName = psHeapCfgHeapConfigNameIN->puiHeapConfigName; + + + if (psHeapCfgHeapConfigNameIN->ui32HeapConfigNameBufSz != 0) + { + puiHeapConfigNameInt = OSAllocMem(psHeapCfgHeapConfigNameIN->ui32HeapConfigNameBufSz * sizeof(IMG_CHAR)); + if (!puiHeapConfigNameInt) + { + psHeapCfgHeapConfigNameOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto HeapCfgHeapConfigName_exit; + } + } + + + + + { + /* Look up the address from the handle */ + psHeapCfgHeapConfigNameOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &hDeviceNodeInt, + psHeapCfgHeapConfigNameIN->hDeviceNode, + PVRSRV_HANDLE_TYPE_DEV_NODE); + if(psHeapCfgHeapConfigNameOUT->eError != PVRSRV_OK) + { + goto HeapCfgHeapConfigName_exit; + } + } + + + psHeapCfgHeapConfigNameOUT->eError = + HeapCfgHeapConfigName( + hDeviceNodeInt, + psHeapCfgHeapConfigNameIN->ui32HeapConfigIndex, + psHeapCfgHeapConfigNameIN->ui32HeapConfigNameBufSz, + puiHeapConfigNameInt); + + + + if ( !OSAccessOK(PVR_VERIFY_WRITE, (IMG_VOID*) psHeapCfgHeapConfigNameOUT->puiHeapConfigName, (psHeapCfgHeapConfigNameIN->ui32HeapConfigNameBufSz * sizeof(IMG_CHAR))) + || (OSCopyToUser(NULL, psHeapCfgHeapConfigNameOUT->puiHeapConfigName, puiHeapConfigNameInt, + (psHeapCfgHeapConfigNameIN->ui32HeapConfigNameBufSz * sizeof(IMG_CHAR))) != PVRSRV_OK) ) + { + psHeapCfgHeapConfigNameOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto HeapCfgHeapConfigName_exit; + } + + +HeapCfgHeapConfigName_exit: + if (puiHeapConfigNameInt) + OSFreeMem(puiHeapConfigNameInt); + + return 0; +} + +static IMG_INT +PVRSRVBridgeHeapCfgHeapDetails(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_HEAPCFGHEAPDETAILS *psHeapCfgHeapDetailsIN, + PVRSRV_BRIDGE_OUT_HEAPCFGHEAPDETAILS *psHeapCfgHeapDetailsOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDeviceNodeInt = IMG_NULL; + IMG_CHAR *puiHeapNameOutInt = IMG_NULL; + + + psHeapCfgHeapDetailsOUT->puiHeapNameOut = psHeapCfgHeapDetailsIN->puiHeapNameOut; + + + if (psHeapCfgHeapDetailsIN->ui32HeapNameBufSz != 0) + { + puiHeapNameOutInt = OSAllocMem(psHeapCfgHeapDetailsIN->ui32HeapNameBufSz * sizeof(IMG_CHAR)); + if (!puiHeapNameOutInt) + { + psHeapCfgHeapDetailsOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto HeapCfgHeapDetails_exit; + } + } + + + + + { + /* Look up the address from the handle */ + psHeapCfgHeapDetailsOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &hDeviceNodeInt, + psHeapCfgHeapDetailsIN->hDeviceNode, + PVRSRV_HANDLE_TYPE_DEV_NODE); + if(psHeapCfgHeapDetailsOUT->eError != PVRSRV_OK) + { + goto HeapCfgHeapDetails_exit; + } + } + + + psHeapCfgHeapDetailsOUT->eError = + HeapCfgHeapDetails( + hDeviceNodeInt, + psHeapCfgHeapDetailsIN->ui32HeapConfigIndex, + psHeapCfgHeapDetailsIN->ui32HeapIndex, + psHeapCfgHeapDetailsIN->ui32HeapNameBufSz, + puiHeapNameOutInt, + &psHeapCfgHeapDetailsOUT->sDevVAddrBase, + &psHeapCfgHeapDetailsOUT->uiHeapLength, + &psHeapCfgHeapDetailsOUT->ui32Log2DataPageSizeOut, + &psHeapCfgHeapDetailsOUT->ui32Log2ImportAlignmentOut); + + + + if ( !OSAccessOK(PVR_VERIFY_WRITE, (IMG_VOID*) psHeapCfgHeapDetailsOUT->puiHeapNameOut, (psHeapCfgHeapDetailsIN->ui32HeapNameBufSz * sizeof(IMG_CHAR))) + || (OSCopyToUser(NULL, psHeapCfgHeapDetailsOUT->puiHeapNameOut, puiHeapNameOutInt, + (psHeapCfgHeapDetailsIN->ui32HeapNameBufSz * sizeof(IMG_CHAR))) != PVRSRV_OK) ) + { + psHeapCfgHeapDetailsOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto HeapCfgHeapDetails_exit; + } + + +HeapCfgHeapDetails_exit: + if (puiHeapNameOutInt) + OSFreeMem(puiHeapNameOutInt); + + return 0; +} + + + +/* *************************************************************************** + * Server bridge dispatch related glue + */ + + +PVRSRV_ERROR InitMMBridge(IMG_VOID); +PVRSRV_ERROR DeinitMMBridge(IMG_VOID); + +/* + * Register all MM functions with services + */ +PVRSRV_ERROR InitMMBridge(IMG_VOID) +{ + + SetDispatchTableEntry(PVRSRV_BRIDGE_MM, PVRSRV_BRIDGE_MM_PMREXPORTPMR, PVRSRVBridgePMRExportPMR, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_MM, PVRSRV_BRIDGE_MM_PMRUNEXPORTPMR, PVRSRVBridgePMRUnexportPMR, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_MM, PVRSRV_BRIDGE_MM_PMRGETUID, PVRSRVBridgePMRGetUID, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_MM, PVRSRV_BRIDGE_MM_PMRMAKESERVEREXPORTCLIENTEXPORT, PVRSRVBridgePMRMakeServerExportClientExport, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_MM, PVRSRV_BRIDGE_MM_PMRUNMAKESERVEREXPORTCLIENTEXPORT, PVRSRVBridgePMRUnmakeServerExportClientExport, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_MM, PVRSRV_BRIDGE_MM_PMRIMPORTPMR, PVRSRVBridgePMRImportPMR, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_MM, PVRSRV_BRIDGE_MM_DEVMEMINTCTXCREATE, PVRSRVBridgeDevmemIntCtxCreate, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_MM, PVRSRV_BRIDGE_MM_DEVMEMINTCTXDESTROY, PVRSRVBridgeDevmemIntCtxDestroy, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_MM, PVRSRV_BRIDGE_MM_DEVMEMINTHEAPCREATE, PVRSRVBridgeDevmemIntHeapCreate, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_MM, PVRSRV_BRIDGE_MM_DEVMEMINTHEAPDESTROY, PVRSRVBridgeDevmemIntHeapDestroy, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_MM, PVRSRV_BRIDGE_MM_DEVMEMINTMAPPMR, PVRSRVBridgeDevmemIntMapPMR, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_MM, PVRSRV_BRIDGE_MM_DEVMEMINTUNMAPPMR, PVRSRVBridgeDevmemIntUnmapPMR, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_MM, PVRSRV_BRIDGE_MM_DEVMEMINTRESERVERANGE, PVRSRVBridgeDevmemIntReserveRange, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_MM, PVRSRV_BRIDGE_MM_DEVMEMINTUNRESERVERANGE, PVRSRVBridgeDevmemIntUnreserveRange, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_MM, PVRSRV_BRIDGE_MM_PHYSMEMNEWRAMBACKEDPMR, PVRSRVBridgePhysmemNewRamBackedPMR, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_MM, PVRSRV_BRIDGE_MM_PMRLOCALIMPORTPMR, PVRSRVBridgePMRLocalImportPMR, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_MM, PVRSRV_BRIDGE_MM_PMRUNREFPMR, PVRSRVBridgePMRUnrefPMR, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_MM, PVRSRV_BRIDGE_MM_DEVMEMSLCFLUSHINVALREQUEST, PVRSRVBridgeDevmemSLCFlushInvalRequest, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_MM, PVRSRV_BRIDGE_MM_DEVMEMISVDEVADDRVALID, PVRSRVBridgeDevmemIsVDevAddrValid, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_MM, PVRSRV_BRIDGE_MM_HEAPCFGHEAPCONFIGCOUNT, PVRSRVBridgeHeapCfgHeapConfigCount, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_MM, PVRSRV_BRIDGE_MM_HEAPCFGHEAPCOUNT, PVRSRVBridgeHeapCfgHeapCount, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_MM, PVRSRV_BRIDGE_MM_HEAPCFGHEAPCONFIGNAME, PVRSRVBridgeHeapCfgHeapConfigName, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_MM, PVRSRV_BRIDGE_MM_HEAPCFGHEAPDETAILS, PVRSRVBridgeHeapCfgHeapDetails, + IMG_NULL, IMG_NULL, + 0, 0); + + + return PVRSRV_OK; +} + +/* + * Unregister all mm functions with services + */ +PVRSRV_ERROR DeinitMMBridge(IMG_VOID) +{ + return PVRSRV_OK; +} + diff --git a/drivers/gpu/rogue_m/generated/pdump_bridge/common_pdump_bridge.h b/drivers/gpu/rogue_m/generated/pdump_bridge/common_pdump_bridge.h new file mode 100644 index 000000000000..816c04c45ee3 --- /dev/null +++ b/drivers/gpu/rogue_m/generated/pdump_bridge/common_pdump_bridge.h @@ -0,0 +1,125 @@ +/*************************************************************************/ /*! +@File +@Title Common bridge header for pdump +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Declares common defines and structures that are used by both + the client and sever side of the bridge for pdump +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef COMMON_PDUMP_BRIDGE_H +#define COMMON_PDUMP_BRIDGE_H + +#include "img_types.h" +#include "pvrsrv_error.h" + +#include "devicemem_typedefs.h" +#include "pdumpdefs.h" + + +#define PVRSRV_BRIDGE_PDUMP_CMD_FIRST 0 +#define PVRSRV_BRIDGE_PDUMP_DEVMEMPDUMPBITMAP PVRSRV_BRIDGE_PDUMP_CMD_FIRST+0 +#define PVRSRV_BRIDGE_PDUMP_PVRSRVPDUMPCOMMENT PVRSRV_BRIDGE_PDUMP_CMD_FIRST+1 +#define PVRSRV_BRIDGE_PDUMP_PVRSRVPDUMPSETFRAME PVRSRV_BRIDGE_PDUMP_CMD_FIRST+2 +#define PVRSRV_BRIDGE_PDUMP_CMD_LAST (PVRSRV_BRIDGE_PDUMP_CMD_FIRST+2) + + +/******************************************* + DevmemPDumpBitmap + *******************************************/ + +/* Bridge in structure for DevmemPDumpBitmap */ +typedef struct PVRSRV_BRIDGE_IN_DEVMEMPDUMPBITMAP_TAG +{ + IMG_HANDLE hDeviceNode; + IMG_CHAR * puiFileName; + IMG_UINT32 ui32FileOffset; + IMG_UINT32 ui32Width; + IMG_UINT32 ui32Height; + IMG_UINT32 ui32StrideInBytes; + IMG_DEV_VIRTADDR sDevBaseAddr; + IMG_HANDLE hDevmemCtx; + IMG_UINT32 ui32Size; + PDUMP_PIXEL_FORMAT ePixelFormat; + IMG_UINT32 ui32AddrMode; + IMG_UINT32 ui32PDumpFlags; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_DEVMEMPDUMPBITMAP; + + +/* Bridge out structure for DevmemPDumpBitmap */ +typedef struct PVRSRV_BRIDGE_OUT_DEVMEMPDUMPBITMAP_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DEVMEMPDUMPBITMAP; + +/******************************************* + PVRSRVPDumpComment + *******************************************/ + +/* Bridge in structure for PVRSRVPDumpComment */ +typedef struct PVRSRV_BRIDGE_IN_PVRSRVPDUMPCOMMENT_TAG +{ + IMG_CHAR * puiComment; + IMG_UINT32 ui32Flags; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_PVRSRVPDUMPCOMMENT; + + +/* Bridge out structure for PVRSRVPDumpComment */ +typedef struct PVRSRV_BRIDGE_OUT_PVRSRVPDUMPCOMMENT_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PVRSRVPDUMPCOMMENT; + +/******************************************* + PVRSRVPDumpSetFrame + *******************************************/ + +/* Bridge in structure for PVRSRVPDumpSetFrame */ +typedef struct PVRSRV_BRIDGE_IN_PVRSRVPDUMPSETFRAME_TAG +{ + IMG_UINT32 ui32Frame; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_PVRSRVPDUMPSETFRAME; + + +/* Bridge out structure for PVRSRVPDumpSetFrame */ +typedef struct PVRSRV_BRIDGE_OUT_PVRSRVPDUMPSETFRAME_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PVRSRVPDUMPSETFRAME; + +#endif /* COMMON_PDUMP_BRIDGE_H */ diff --git a/drivers/gpu/rogue_m/generated/pdump_bridge/server_pdump_bridge.c b/drivers/gpu/rogue_m/generated/pdump_bridge/server_pdump_bridge.c new file mode 100644 index 000000000000..1454dd9a8926 --- /dev/null +++ b/drivers/gpu/rogue_m/generated/pdump_bridge/server_pdump_bridge.c @@ -0,0 +1,278 @@ +/*************************************************************************/ /*! +@File +@Title Server bridge for pdump +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Implements the server side of the bridge for pdump +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#include +#include + +#include "img_defs.h" + +#include "devicemem_server.h" +#include "pdump_km.h" + + +#include "common_pdump_bridge.h" + +#include "allocmem.h" +#include "pvr_debug.h" +#include "connection_server.h" +#include "pvr_bridge.h" +#include "rgx_bridge.h" +#include "srvcore.h" +#include "handle.h" + +#if defined (SUPPORT_AUTH) +#include "osauth.h" +#endif + +#include + + + + +/* *************************************************************************** + * Server-side bridge entry points + */ + +static IMG_INT +PVRSRVBridgeDevmemPDumpBitmap(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_DEVMEMPDUMPBITMAP *psDevmemPDumpBitmapIN, + PVRSRV_BRIDGE_OUT_DEVMEMPDUMPBITMAP *psDevmemPDumpBitmapOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDeviceNodeInt = IMG_NULL; + IMG_CHAR *uiFileNameInt = IMG_NULL; + DEVMEMINT_CTX * psDevmemCtxInt = IMG_NULL; + + + + + + { + uiFileNameInt = OSAllocMem(PVRSRV_PDUMP_MAX_FILENAME_SIZE * sizeof(IMG_CHAR)); + if (!uiFileNameInt) + { + psDevmemPDumpBitmapOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto DevmemPDumpBitmap_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psDevmemPDumpBitmapIN->puiFileName, PVRSRV_PDUMP_MAX_FILENAME_SIZE * sizeof(IMG_CHAR)) + || (OSCopyFromUser(NULL, uiFileNameInt, psDevmemPDumpBitmapIN->puiFileName, + PVRSRV_PDUMP_MAX_FILENAME_SIZE * sizeof(IMG_CHAR)) != PVRSRV_OK) ) + { + psDevmemPDumpBitmapOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto DevmemPDumpBitmap_exit; + } + + + + { + /* Look up the address from the handle */ + psDevmemPDumpBitmapOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &hDeviceNodeInt, + psDevmemPDumpBitmapIN->hDeviceNode, + PVRSRV_HANDLE_TYPE_DEV_NODE); + if(psDevmemPDumpBitmapOUT->eError != PVRSRV_OK) + { + goto DevmemPDumpBitmap_exit; + } + } + + + { + /* Look up the address from the handle */ + psDevmemPDumpBitmapOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psDevmemCtxInt, + psDevmemPDumpBitmapIN->hDevmemCtx, + PVRSRV_HANDLE_TYPE_DEVMEMINT_CTX); + if(psDevmemPDumpBitmapOUT->eError != PVRSRV_OK) + { + goto DevmemPDumpBitmap_exit; + } + } + + + psDevmemPDumpBitmapOUT->eError = + DevmemIntPDumpBitmap( + hDeviceNodeInt, + uiFileNameInt, + psDevmemPDumpBitmapIN->ui32FileOffset, + psDevmemPDumpBitmapIN->ui32Width, + psDevmemPDumpBitmapIN->ui32Height, + psDevmemPDumpBitmapIN->ui32StrideInBytes, + psDevmemPDumpBitmapIN->sDevBaseAddr, + psDevmemCtxInt, + psDevmemPDumpBitmapIN->ui32Size, + psDevmemPDumpBitmapIN->ePixelFormat, + psDevmemPDumpBitmapIN->ui32AddrMode, + psDevmemPDumpBitmapIN->ui32PDumpFlags); + + + + +DevmemPDumpBitmap_exit: + if (uiFileNameInt) + OSFreeMem(uiFileNameInt); + + return 0; +} + +static IMG_INT +PVRSRVBridgePVRSRVPDumpComment(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_PVRSRVPDUMPCOMMENT *psPVRSRVPDumpCommentIN, + PVRSRV_BRIDGE_OUT_PVRSRVPDUMPCOMMENT *psPVRSRVPDumpCommentOUT, + CONNECTION_DATA *psConnection) +{ + IMG_CHAR *uiCommentInt = IMG_NULL; + + PVR_UNREFERENCED_PARAMETER(psConnection); + + + + + { + uiCommentInt = OSAllocMem(PVRSRV_PDUMP_MAX_COMMENT_SIZE * sizeof(IMG_CHAR)); + if (!uiCommentInt) + { + psPVRSRVPDumpCommentOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto PVRSRVPDumpComment_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psPVRSRVPDumpCommentIN->puiComment, PVRSRV_PDUMP_MAX_COMMENT_SIZE * sizeof(IMG_CHAR)) + || (OSCopyFromUser(NULL, uiCommentInt, psPVRSRVPDumpCommentIN->puiComment, + PVRSRV_PDUMP_MAX_COMMENT_SIZE * sizeof(IMG_CHAR)) != PVRSRV_OK) ) + { + psPVRSRVPDumpCommentOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto PVRSRVPDumpComment_exit; + } + + + + psPVRSRVPDumpCommentOUT->eError = + PDumpCommentKM( + uiCommentInt, + psPVRSRVPDumpCommentIN->ui32Flags); + + + + +PVRSRVPDumpComment_exit: + if (uiCommentInt) + OSFreeMem(uiCommentInt); + + return 0; +} + +static IMG_INT +PVRSRVBridgePVRSRVPDumpSetFrame(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_PVRSRVPDUMPSETFRAME *psPVRSRVPDumpSetFrameIN, + PVRSRV_BRIDGE_OUT_PVRSRVPDUMPSETFRAME *psPVRSRVPDumpSetFrameOUT, + CONNECTION_DATA *psConnection) +{ + + + + + + + + psPVRSRVPDumpSetFrameOUT->eError = + PDumpSetFrameKM(psConnection, + psPVRSRVPDumpSetFrameIN->ui32Frame); + + + + + + return 0; +} + + + +/* *************************************************************************** + * Server bridge dispatch related glue + */ + + +PVRSRV_ERROR InitPDUMPBridge(IMG_VOID); +PVRSRV_ERROR DeinitPDUMPBridge(IMG_VOID); + +/* + * Register all PDUMP functions with services + */ +PVRSRV_ERROR InitPDUMPBridge(IMG_VOID) +{ + + SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMP, PVRSRV_BRIDGE_PDUMP_DEVMEMPDUMPBITMAP, PVRSRVBridgeDevmemPDumpBitmap, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMP, PVRSRV_BRIDGE_PDUMP_PVRSRVPDUMPCOMMENT, PVRSRVBridgePVRSRVPDumpComment, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMP, PVRSRV_BRIDGE_PDUMP_PVRSRVPDUMPSETFRAME, PVRSRVBridgePVRSRVPDumpSetFrame, + IMG_NULL, IMG_NULL, + 0, 0); + + + return PVRSRV_OK; +} + +/* + * Unregister all pdump functions with services + */ +PVRSRV_ERROR DeinitPDUMPBridge(IMG_VOID) +{ + return PVRSRV_OK; +} + diff --git a/drivers/gpu/rogue_m/generated/pdumpctrl_bridge/common_pdumpctrl_bridge.h b/drivers/gpu/rogue_m/generated/pdumpctrl_bridge/common_pdumpctrl_bridge.h new file mode 100644 index 000000000000..227bca3eb217 --- /dev/null +++ b/drivers/gpu/rogue_m/generated/pdumpctrl_bridge/common_pdumpctrl_bridge.h @@ -0,0 +1,172 @@ +/*************************************************************************/ /*! +@File +@Title Common bridge header for pdumpctrl +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Declares common defines and structures that are used by both + the client and sever side of the bridge for pdumpctrl +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef COMMON_PDUMPCTRL_BRIDGE_H +#define COMMON_PDUMPCTRL_BRIDGE_H + +#include "img_types.h" +#include "pvrsrv_error.h" + +#include "services.h" + + +#define PVRSRV_BRIDGE_PDUMPCTRL_CMD_FIRST 0 +#define PVRSRV_BRIDGE_PDUMPCTRL_PVRSRVPDUMPISCAPTURING PVRSRV_BRIDGE_PDUMPCTRL_CMD_FIRST+0 +#define PVRSRV_BRIDGE_PDUMPCTRL_PVRSRVPDUMPGETFRAME PVRSRV_BRIDGE_PDUMPCTRL_CMD_FIRST+1 +#define PVRSRV_BRIDGE_PDUMPCTRL_PVRSRVPDUMPSETDEFAULTCAPTUREPARAMS PVRSRV_BRIDGE_PDUMPCTRL_CMD_FIRST+2 +#define PVRSRV_BRIDGE_PDUMPCTRL_PVRSRVPDUMPISLASTCAPTUREFRAME PVRSRV_BRIDGE_PDUMPCTRL_CMD_FIRST+3 +#define PVRSRV_BRIDGE_PDUMPCTRL_PVRSRVPDUMPSTARTINITPHASE PVRSRV_BRIDGE_PDUMPCTRL_CMD_FIRST+4 +#define PVRSRV_BRIDGE_PDUMPCTRL_PVRSRVPDUMPSTOPINITPHASE PVRSRV_BRIDGE_PDUMPCTRL_CMD_FIRST+5 +#define PVRSRV_BRIDGE_PDUMPCTRL_CMD_LAST (PVRSRV_BRIDGE_PDUMPCTRL_CMD_FIRST+5) + + +/******************************************* + PVRSRVPDumpIsCapturing + *******************************************/ + +/* Bridge in structure for PVRSRVPDumpIsCapturing */ +typedef struct PVRSRV_BRIDGE_IN_PVRSRVPDUMPISCAPTURING_TAG +{ + IMG_UINT32 ui32EmptyStructPlaceholder; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_PVRSRVPDUMPISCAPTURING; + + +/* Bridge out structure for PVRSRVPDumpIsCapturing */ +typedef struct PVRSRV_BRIDGE_OUT_PVRSRVPDUMPISCAPTURING_TAG +{ + IMG_BOOL bIsCapturing; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PVRSRVPDUMPISCAPTURING; + +/******************************************* + PVRSRVPDumpGetFrame + *******************************************/ + +/* Bridge in structure for PVRSRVPDumpGetFrame */ +typedef struct PVRSRV_BRIDGE_IN_PVRSRVPDUMPGETFRAME_TAG +{ + IMG_UINT32 ui32EmptyStructPlaceholder; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_PVRSRVPDUMPGETFRAME; + + +/* Bridge out structure for PVRSRVPDumpGetFrame */ +typedef struct PVRSRV_BRIDGE_OUT_PVRSRVPDUMPGETFRAME_TAG +{ + IMG_UINT32 ui32Frame; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PVRSRVPDUMPGETFRAME; + +/******************************************* + PVRSRVPDumpSetDefaultCaptureParams + *******************************************/ + +/* Bridge in structure for PVRSRVPDumpSetDefaultCaptureParams */ +typedef struct PVRSRV_BRIDGE_IN_PVRSRVPDUMPSETDEFAULTCAPTUREPARAMS_TAG +{ + IMG_UINT32 ui32Mode; + IMG_UINT32 ui32Start; + IMG_UINT32 ui32End; + IMG_UINT32 ui32Interval; + IMG_UINT32 ui32MaxParamFileSize; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_PVRSRVPDUMPSETDEFAULTCAPTUREPARAMS; + + +/* Bridge out structure for PVRSRVPDumpSetDefaultCaptureParams */ +typedef struct PVRSRV_BRIDGE_OUT_PVRSRVPDUMPSETDEFAULTCAPTUREPARAMS_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PVRSRVPDUMPSETDEFAULTCAPTUREPARAMS; + +/******************************************* + PVRSRVPDumpIsLastCaptureFrame + *******************************************/ + +/* Bridge in structure for PVRSRVPDumpIsLastCaptureFrame */ +typedef struct PVRSRV_BRIDGE_IN_PVRSRVPDUMPISLASTCAPTUREFRAME_TAG +{ + IMG_UINT32 ui32EmptyStructPlaceholder; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_PVRSRVPDUMPISLASTCAPTUREFRAME; + + +/* Bridge out structure for PVRSRVPDumpIsLastCaptureFrame */ +typedef struct PVRSRV_BRIDGE_OUT_PVRSRVPDUMPISLASTCAPTUREFRAME_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PVRSRVPDUMPISLASTCAPTUREFRAME; + +/******************************************* + PVRSRVPDumpStartInitPhase + *******************************************/ + +/* Bridge in structure for PVRSRVPDumpStartInitPhase */ +typedef struct PVRSRV_BRIDGE_IN_PVRSRVPDUMPSTARTINITPHASE_TAG +{ + IMG_UINT32 ui32EmptyStructPlaceholder; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_PVRSRVPDUMPSTARTINITPHASE; + + +/* Bridge out structure for PVRSRVPDumpStartInitPhase */ +typedef struct PVRSRV_BRIDGE_OUT_PVRSRVPDUMPSTARTINITPHASE_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PVRSRVPDUMPSTARTINITPHASE; + +/******************************************* + PVRSRVPDumpStopInitPhase + *******************************************/ + +/* Bridge in structure for PVRSRVPDumpStopInitPhase */ +typedef struct PVRSRV_BRIDGE_IN_PVRSRVPDUMPSTOPINITPHASE_TAG +{ + IMG_MODULE_ID eModuleID; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_PVRSRVPDUMPSTOPINITPHASE; + + +/* Bridge out structure for PVRSRVPDumpStopInitPhase */ +typedef struct PVRSRV_BRIDGE_OUT_PVRSRVPDUMPSTOPINITPHASE_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PVRSRVPDUMPSTOPINITPHASE; + +#endif /* COMMON_PDUMPCTRL_BRIDGE_H */ diff --git a/drivers/gpu/rogue_m/generated/pdumpctrl_bridge/server_pdumpctrl_bridge.c b/drivers/gpu/rogue_m/generated/pdumpctrl_bridge/server_pdumpctrl_bridge.c new file mode 100644 index 000000000000..19bd010c544d --- /dev/null +++ b/drivers/gpu/rogue_m/generated/pdumpctrl_bridge/server_pdumpctrl_bridge.c @@ -0,0 +1,288 @@ +/*************************************************************************/ /*! +@File +@Title Server bridge for pdumpctrl +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Implements the server side of the bridge for pdumpctrl +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#include +#include + +#include "img_defs.h" + +#include "pdump_km.h" + + +#include "common_pdumpctrl_bridge.h" + +#include "allocmem.h" +#include "pvr_debug.h" +#include "connection_server.h" +#include "pvr_bridge.h" +#include "rgx_bridge.h" +#include "srvcore.h" +#include "handle.h" + +#if defined (SUPPORT_AUTH) +#include "osauth.h" +#endif + +#include + +#include "lock.h" + + + +/* *************************************************************************** + * Server-side bridge entry points + */ + +static IMG_INT +PVRSRVBridgePVRSRVPDumpIsCapturing(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_PVRSRVPDUMPISCAPTURING *psPVRSRVPDumpIsCapturingIN, + PVRSRV_BRIDGE_OUT_PVRSRVPDUMPISCAPTURING *psPVRSRVPDumpIsCapturingOUT, + CONNECTION_DATA *psConnection) +{ + + PVR_UNREFERENCED_PARAMETER(psConnection); + PVR_UNREFERENCED_PARAMETER(psPVRSRVPDumpIsCapturingIN); + + + + + + + psPVRSRVPDumpIsCapturingOUT->eError = + PDumpIsCaptureFrameKM( + &psPVRSRVPDumpIsCapturingOUT->bIsCapturing); + + + + + + return 0; +} + +static IMG_INT +PVRSRVBridgePVRSRVPDumpGetFrame(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_PVRSRVPDUMPGETFRAME *psPVRSRVPDumpGetFrameIN, + PVRSRV_BRIDGE_OUT_PVRSRVPDUMPGETFRAME *psPVRSRVPDumpGetFrameOUT, + CONNECTION_DATA *psConnection) +{ + + PVR_UNREFERENCED_PARAMETER(psPVRSRVPDumpGetFrameIN); + + + + + + + psPVRSRVPDumpGetFrameOUT->eError = + PDumpGetFrameKM(psConnection, + &psPVRSRVPDumpGetFrameOUT->ui32Frame); + + + + + + return 0; +} + +static IMG_INT +PVRSRVBridgePVRSRVPDumpSetDefaultCaptureParams(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_PVRSRVPDUMPSETDEFAULTCAPTUREPARAMS *psPVRSRVPDumpSetDefaultCaptureParamsIN, + PVRSRV_BRIDGE_OUT_PVRSRVPDUMPSETDEFAULTCAPTUREPARAMS *psPVRSRVPDumpSetDefaultCaptureParamsOUT, + CONNECTION_DATA *psConnection) +{ + + PVR_UNREFERENCED_PARAMETER(psConnection); + + + + + + + psPVRSRVPDumpSetDefaultCaptureParamsOUT->eError = + PDumpSetDefaultCaptureParamsKM( + psPVRSRVPDumpSetDefaultCaptureParamsIN->ui32Mode, + psPVRSRVPDumpSetDefaultCaptureParamsIN->ui32Start, + psPVRSRVPDumpSetDefaultCaptureParamsIN->ui32End, + psPVRSRVPDumpSetDefaultCaptureParamsIN->ui32Interval, + psPVRSRVPDumpSetDefaultCaptureParamsIN->ui32MaxParamFileSize); + + + + + + return 0; +} + +static IMG_INT +PVRSRVBridgePVRSRVPDumpIsLastCaptureFrame(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_PVRSRVPDUMPISLASTCAPTUREFRAME *psPVRSRVPDumpIsLastCaptureFrameIN, + PVRSRV_BRIDGE_OUT_PVRSRVPDUMPISLASTCAPTUREFRAME *psPVRSRVPDumpIsLastCaptureFrameOUT, + CONNECTION_DATA *psConnection) +{ + + PVR_UNREFERENCED_PARAMETER(psConnection); + PVR_UNREFERENCED_PARAMETER(psPVRSRVPDumpIsLastCaptureFrameIN); + + + + + + + psPVRSRVPDumpIsLastCaptureFrameOUT->eError = + PDumpIsLastCaptureFrameKM( + ); + + + + + + return 0; +} + +static IMG_INT +PVRSRVBridgePVRSRVPDumpStartInitPhase(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_PVRSRVPDUMPSTARTINITPHASE *psPVRSRVPDumpStartInitPhaseIN, + PVRSRV_BRIDGE_OUT_PVRSRVPDUMPSTARTINITPHASE *psPVRSRVPDumpStartInitPhaseOUT, + CONNECTION_DATA *psConnection) +{ + + PVR_UNREFERENCED_PARAMETER(psConnection); + PVR_UNREFERENCED_PARAMETER(psPVRSRVPDumpStartInitPhaseIN); + + + + + + + psPVRSRVPDumpStartInitPhaseOUT->eError = + PDumpStartInitPhaseKM( + ); + + + + + + return 0; +} + +static IMG_INT +PVRSRVBridgePVRSRVPDumpStopInitPhase(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_PVRSRVPDUMPSTOPINITPHASE *psPVRSRVPDumpStopInitPhaseIN, + PVRSRV_BRIDGE_OUT_PVRSRVPDUMPSTOPINITPHASE *psPVRSRVPDumpStopInitPhaseOUT, + CONNECTION_DATA *psConnection) +{ + + PVR_UNREFERENCED_PARAMETER(psConnection); + + + + + + + psPVRSRVPDumpStopInitPhaseOUT->eError = + PDumpStopInitPhaseKM( + psPVRSRVPDumpStopInitPhaseIN->eModuleID); + + + + + + return 0; +} + + + +/* *************************************************************************** + * Server bridge dispatch related glue + */ + +static POS_LOCK pPDUMPCTRLBridgeLock; +static IMG_BYTE pbyPDUMPCTRLBridgeBuffer[20 + 8]; + +PVRSRV_ERROR InitPDUMPCTRLBridge(IMG_VOID); +PVRSRV_ERROR DeinitPDUMPCTRLBridge(IMG_VOID); + +/* + * Register all PDUMPCTRL functions with services + */ +PVRSRV_ERROR InitPDUMPCTRLBridge(IMG_VOID) +{ + PVR_LOGR_IF_ERROR(OSLockCreate(&pPDUMPCTRLBridgeLock, LOCK_TYPE_PASSIVE), "OSLockCreate"); + + SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMPCTRL, PVRSRV_BRIDGE_PDUMPCTRL_PVRSRVPDUMPISCAPTURING, PVRSRVBridgePVRSRVPDumpIsCapturing, + pPDUMPCTRLBridgeLock, pbyPDUMPCTRLBridgeBuffer, + 20, 8); + + SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMPCTRL, PVRSRV_BRIDGE_PDUMPCTRL_PVRSRVPDUMPGETFRAME, PVRSRVBridgePVRSRVPDumpGetFrame, + pPDUMPCTRLBridgeLock, pbyPDUMPCTRLBridgeBuffer, + 20, 8); + + SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMPCTRL, PVRSRV_BRIDGE_PDUMPCTRL_PVRSRVPDUMPSETDEFAULTCAPTUREPARAMS, PVRSRVBridgePVRSRVPDumpSetDefaultCaptureParams, + pPDUMPCTRLBridgeLock, pbyPDUMPCTRLBridgeBuffer, + 20, 8); + + SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMPCTRL, PVRSRV_BRIDGE_PDUMPCTRL_PVRSRVPDUMPISLASTCAPTUREFRAME, PVRSRVBridgePVRSRVPDumpIsLastCaptureFrame, + pPDUMPCTRLBridgeLock, pbyPDUMPCTRLBridgeBuffer, + 20, 8); + + SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMPCTRL, PVRSRV_BRIDGE_PDUMPCTRL_PVRSRVPDUMPSTARTINITPHASE, PVRSRVBridgePVRSRVPDumpStartInitPhase, + pPDUMPCTRLBridgeLock, pbyPDUMPCTRLBridgeBuffer, + 20, 8); + + SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMPCTRL, PVRSRV_BRIDGE_PDUMPCTRL_PVRSRVPDUMPSTOPINITPHASE, PVRSRVBridgePVRSRVPDumpStopInitPhase, + pPDUMPCTRLBridgeLock, pbyPDUMPCTRLBridgeBuffer, + 20, 8); + + + return PVRSRV_OK; +} + +/* + * Unregister all pdumpctrl functions with services + */ +PVRSRV_ERROR DeinitPDUMPCTRLBridge(IMG_VOID) +{ + PVR_LOGR_IF_ERROR(OSLockDestroy(pPDUMPCTRLBridgeLock), "OSLockDestroy"); + return PVRSRV_OK; +} + diff --git a/drivers/gpu/rogue_m/generated/pdumpmm_bridge/client_pdumpmm_bridge.h b/drivers/gpu/rogue_m/generated/pdumpmm_bridge/client_pdumpmm_bridge.h new file mode 100644 index 000000000000..fdcabc846085 --- /dev/null +++ b/drivers/gpu/rogue_m/generated/pdumpmm_bridge/client_pdumpmm_bridge.h @@ -0,0 +1,113 @@ +/*************************************************************************/ /*! +@File +@Title Client bridge header for pdumpmm +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Exports the client bridge functions for pdumpmm +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef CLIENT_PDUMPMM_BRIDGE_H +#define CLIENT_PDUMPMM_BRIDGE_H + +#include "pvr_bridge_client.h" +#include "pvr_bridge.h" + +#include "common_pdumpmm_bridge.h" + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgePMRPDumpLoadMem(IMG_HANDLE hBridge, + IMG_HANDLE hPMR, + IMG_DEVMEM_OFFSET_T uiOffset, + IMG_DEVMEM_SIZE_T uiSize, + IMG_UINT32 ui32PDumpFlags, + IMG_BOOL bbZero); + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgePMRPDumpLoadMemValue32(IMG_HANDLE hBridge, + IMG_HANDLE hPMR, + IMG_DEVMEM_OFFSET_T uiOffset, + IMG_UINT32 ui32Value, + IMG_UINT32 ui32PDumpFlags); + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgePMRPDumpLoadMemValue64(IMG_HANDLE hBridge, + IMG_HANDLE hPMR, + IMG_DEVMEM_OFFSET_T uiOffset, + IMG_UINT64 ui64Value, + IMG_UINT32 ui32PDumpFlags); + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgePMRPDumpSaveToFile(IMG_HANDLE hBridge, + IMG_HANDLE hPMR, + IMG_DEVMEM_OFFSET_T uiOffset, + IMG_DEVMEM_SIZE_T uiSize, + IMG_UINT32 ui32ArraySize, + const IMG_CHAR *puiFileName); + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgePMRPDumpSymbolicAddr(IMG_HANDLE hBridge, + IMG_HANDLE hPMR, + IMG_DEVMEM_OFFSET_T uiOffset, + IMG_UINT32 ui32MemspaceNameLen, + IMG_CHAR *puiMemspaceName, + IMG_UINT32 ui32SymbolicAddrLen, + IMG_CHAR *puiSymbolicAddr, + IMG_DEVMEM_OFFSET_T *puiNewOffset, + IMG_DEVMEM_OFFSET_T *puiNextSymName); + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgePMRPDumpPol32(IMG_HANDLE hBridge, + IMG_HANDLE hPMR, + IMG_DEVMEM_OFFSET_T uiOffset, + IMG_UINT32 ui32Value, + IMG_UINT32 ui32Mask, + PDUMP_POLL_OPERATOR eOperator, + IMG_UINT32 ui32PDumpFlags); + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgePMRPDumpCBP(IMG_HANDLE hBridge, + IMG_HANDLE hPMR, + IMG_DEVMEM_OFFSET_T uiReadOffset, + IMG_DEVMEM_OFFSET_T uiWriteOffset, + IMG_DEVMEM_SIZE_T uiPacketSize, + IMG_DEVMEM_SIZE_T uiBufferSize); + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeDevmemIntPDumpSaveToFileVirtual(IMG_HANDLE hBridge, + IMG_HANDLE hDevmemServerContext, + IMG_DEV_VIRTADDR sAddress, + IMG_DEVMEM_SIZE_T uiSize, + IMG_UINT32 ui32ArraySize, + const IMG_CHAR *puiFileName, + IMG_UINT32 ui32FileOffset, + IMG_UINT32 ui32PDumpFlags); + + +#endif /* CLIENT_PDUMPMM_BRIDGE_H */ diff --git a/drivers/gpu/rogue_m/generated/pdumpmm_bridge/common_pdumpmm_bridge.h b/drivers/gpu/rogue_m/generated/pdumpmm_bridge/common_pdumpmm_bridge.h new file mode 100644 index 000000000000..8aa4862f6d93 --- /dev/null +++ b/drivers/gpu/rogue_m/generated/pdumpmm_bridge/common_pdumpmm_bridge.h @@ -0,0 +1,245 @@ +/*************************************************************************/ /*! +@File +@Title Common bridge header for pdumpmm +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Declares common defines and structures that are used by both + the client and sever side of the bridge for pdumpmm +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef COMMON_PDUMPMM_BRIDGE_H +#define COMMON_PDUMPMM_BRIDGE_H + +#include "img_types.h" +#include "pvrsrv_error.h" + +#include "pdump.h" +#include "pdumpdefs.h" +#include "pvrsrv_memallocflags.h" +#include "devicemem_typedefs.h" + + +#define PVRSRV_BRIDGE_PDUMPMM_CMD_FIRST 0 +#define PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPLOADMEM PVRSRV_BRIDGE_PDUMPMM_CMD_FIRST+0 +#define PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPLOADMEMVALUE32 PVRSRV_BRIDGE_PDUMPMM_CMD_FIRST+1 +#define PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPLOADMEMVALUE64 PVRSRV_BRIDGE_PDUMPMM_CMD_FIRST+2 +#define PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPSAVETOFILE PVRSRV_BRIDGE_PDUMPMM_CMD_FIRST+3 +#define PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPSYMBOLICADDR PVRSRV_BRIDGE_PDUMPMM_CMD_FIRST+4 +#define PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPPOL32 PVRSRV_BRIDGE_PDUMPMM_CMD_FIRST+5 +#define PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPCBP PVRSRV_BRIDGE_PDUMPMM_CMD_FIRST+6 +#define PVRSRV_BRIDGE_PDUMPMM_DEVMEMINTPDUMPSAVETOFILEVIRTUAL PVRSRV_BRIDGE_PDUMPMM_CMD_FIRST+7 +#define PVRSRV_BRIDGE_PDUMPMM_CMD_LAST (PVRSRV_BRIDGE_PDUMPMM_CMD_FIRST+7) + + +/******************************************* + PMRPDumpLoadMem + *******************************************/ + +/* Bridge in structure for PMRPDumpLoadMem */ +typedef struct PVRSRV_BRIDGE_IN_PMRPDUMPLOADMEM_TAG +{ + IMG_HANDLE hPMR; + IMG_DEVMEM_OFFSET_T uiOffset; + IMG_DEVMEM_SIZE_T uiSize; + IMG_UINT32 ui32PDumpFlags; + IMG_BOOL bbZero; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_PMRPDUMPLOADMEM; + + +/* Bridge out structure for PMRPDumpLoadMem */ +typedef struct PVRSRV_BRIDGE_OUT_PMRPDUMPLOADMEM_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PMRPDUMPLOADMEM; + +/******************************************* + PMRPDumpLoadMemValue32 + *******************************************/ + +/* Bridge in structure for PMRPDumpLoadMemValue32 */ +typedef struct PVRSRV_BRIDGE_IN_PMRPDUMPLOADMEMVALUE32_TAG +{ + IMG_HANDLE hPMR; + IMG_DEVMEM_OFFSET_T uiOffset; + IMG_UINT32 ui32Value; + IMG_UINT32 ui32PDumpFlags; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_PMRPDUMPLOADMEMVALUE32; + + +/* Bridge out structure for PMRPDumpLoadMemValue32 */ +typedef struct PVRSRV_BRIDGE_OUT_PMRPDUMPLOADMEMVALUE32_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PMRPDUMPLOADMEMVALUE32; + +/******************************************* + PMRPDumpLoadMemValue64 + *******************************************/ + +/* Bridge in structure for PMRPDumpLoadMemValue64 */ +typedef struct PVRSRV_BRIDGE_IN_PMRPDUMPLOADMEMVALUE64_TAG +{ + IMG_HANDLE hPMR; + IMG_DEVMEM_OFFSET_T uiOffset; + IMG_UINT64 ui64Value; + IMG_UINT32 ui32PDumpFlags; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_PMRPDUMPLOADMEMVALUE64; + + +/* Bridge out structure for PMRPDumpLoadMemValue64 */ +typedef struct PVRSRV_BRIDGE_OUT_PMRPDUMPLOADMEMVALUE64_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PMRPDUMPLOADMEMVALUE64; + +/******************************************* + PMRPDumpSaveToFile + *******************************************/ + +/* Bridge in structure for PMRPDumpSaveToFile */ +typedef struct PVRSRV_BRIDGE_IN_PMRPDUMPSAVETOFILE_TAG +{ + IMG_HANDLE hPMR; + IMG_DEVMEM_OFFSET_T uiOffset; + IMG_DEVMEM_SIZE_T uiSize; + IMG_UINT32 ui32ArraySize; + const IMG_CHAR * puiFileName; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_PMRPDUMPSAVETOFILE; + + +/* Bridge out structure for PMRPDumpSaveToFile */ +typedef struct PVRSRV_BRIDGE_OUT_PMRPDUMPSAVETOFILE_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PMRPDUMPSAVETOFILE; + +/******************************************* + PMRPDumpSymbolicAddr + *******************************************/ + +/* Bridge in structure for PMRPDumpSymbolicAddr */ +typedef struct PVRSRV_BRIDGE_IN_PMRPDUMPSYMBOLICADDR_TAG +{ + IMG_HANDLE hPMR; + IMG_DEVMEM_OFFSET_T uiOffset; + IMG_UINT32 ui32MemspaceNameLen; + IMG_UINT32 ui32SymbolicAddrLen; + /* Output pointer puiMemspaceName is also an implied input */ + IMG_CHAR * puiMemspaceName; + /* Output pointer puiSymbolicAddr is also an implied input */ + IMG_CHAR * puiSymbolicAddr; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_PMRPDUMPSYMBOLICADDR; + + +/* Bridge out structure for PMRPDumpSymbolicAddr */ +typedef struct PVRSRV_BRIDGE_OUT_PMRPDUMPSYMBOLICADDR_TAG +{ + IMG_CHAR * puiMemspaceName; + IMG_CHAR * puiSymbolicAddr; + IMG_DEVMEM_OFFSET_T uiNewOffset; + IMG_DEVMEM_OFFSET_T uiNextSymName; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PMRPDUMPSYMBOLICADDR; + +/******************************************* + PMRPDumpPol32 + *******************************************/ + +/* Bridge in structure for PMRPDumpPol32 */ +typedef struct PVRSRV_BRIDGE_IN_PMRPDUMPPOL32_TAG +{ + IMG_HANDLE hPMR; + IMG_DEVMEM_OFFSET_T uiOffset; + IMG_UINT32 ui32Value; + IMG_UINT32 ui32Mask; + PDUMP_POLL_OPERATOR eOperator; + IMG_UINT32 ui32PDumpFlags; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_PMRPDUMPPOL32; + + +/* Bridge out structure for PMRPDumpPol32 */ +typedef struct PVRSRV_BRIDGE_OUT_PMRPDUMPPOL32_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PMRPDUMPPOL32; + +/******************************************* + PMRPDumpCBP + *******************************************/ + +/* Bridge in structure for PMRPDumpCBP */ +typedef struct PVRSRV_BRIDGE_IN_PMRPDUMPCBP_TAG +{ + IMG_HANDLE hPMR; + IMG_DEVMEM_OFFSET_T uiReadOffset; + IMG_DEVMEM_OFFSET_T uiWriteOffset; + IMG_DEVMEM_SIZE_T uiPacketSize; + IMG_DEVMEM_SIZE_T uiBufferSize; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_PMRPDUMPCBP; + + +/* Bridge out structure for PMRPDumpCBP */ +typedef struct PVRSRV_BRIDGE_OUT_PMRPDUMPCBP_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PMRPDUMPCBP; + +/******************************************* + DevmemIntPDumpSaveToFileVirtual + *******************************************/ + +/* Bridge in structure for DevmemIntPDumpSaveToFileVirtual */ +typedef struct PVRSRV_BRIDGE_IN_DEVMEMINTPDUMPSAVETOFILEVIRTUAL_TAG +{ + IMG_HANDLE hDevmemServerContext; + IMG_DEV_VIRTADDR sAddress; + IMG_DEVMEM_SIZE_T uiSize; + IMG_UINT32 ui32ArraySize; + const IMG_CHAR * puiFileName; + IMG_UINT32 ui32FileOffset; + IMG_UINT32 ui32PDumpFlags; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_DEVMEMINTPDUMPSAVETOFILEVIRTUAL; + + +/* Bridge out structure for DevmemIntPDumpSaveToFileVirtual */ +typedef struct PVRSRV_BRIDGE_OUT_DEVMEMINTPDUMPSAVETOFILEVIRTUAL_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DEVMEMINTPDUMPSAVETOFILEVIRTUAL; + +#endif /* COMMON_PDUMPMM_BRIDGE_H */ diff --git a/drivers/gpu/rogue_m/generated/pdumpmm_bridge/server_pdumpmm_bridge.c b/drivers/gpu/rogue_m/generated/pdumpmm_bridge/server_pdumpmm_bridge.c new file mode 100644 index 000000000000..4c9e33866464 --- /dev/null +++ b/drivers/gpu/rogue_m/generated/pdumpmm_bridge/server_pdumpmm_bridge.c @@ -0,0 +1,586 @@ +/*************************************************************************/ /*! +@File +@Title Server bridge for pdumpmm +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Implements the server side of the bridge for pdumpmm +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#include +#include + +#include "img_defs.h" + +#include "devicemem_server.h" +#include "pmr.h" +#include "physmem.h" + + +#include "common_pdumpmm_bridge.h" + +#include "allocmem.h" +#include "pvr_debug.h" +#include "connection_server.h" +#include "pvr_bridge.h" +#include "rgx_bridge.h" +#include "srvcore.h" +#include "handle.h" + +#if defined (SUPPORT_AUTH) +#include "osauth.h" +#endif + +#include + + + + +/* *************************************************************************** + * Server-side bridge entry points + */ + +static IMG_INT +PVRSRVBridgePMRPDumpLoadMem(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_PMRPDUMPLOADMEM *psPMRPDumpLoadMemIN, + PVRSRV_BRIDGE_OUT_PMRPDUMPLOADMEM *psPMRPDumpLoadMemOUT, + CONNECTION_DATA *psConnection) +{ + PMR * psPMRInt = IMG_NULL; + + + + + + + + { + /* Look up the address from the handle */ + psPMRPDumpLoadMemOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psPMRInt, + psPMRPDumpLoadMemIN->hPMR, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR); + if(psPMRPDumpLoadMemOUT->eError != PVRSRV_OK) + { + goto PMRPDumpLoadMem_exit; + } + } + + + psPMRPDumpLoadMemOUT->eError = + PMRPDumpLoadMem( + psPMRInt, + psPMRPDumpLoadMemIN->uiOffset, + psPMRPDumpLoadMemIN->uiSize, + psPMRPDumpLoadMemIN->ui32PDumpFlags, + psPMRPDumpLoadMemIN->bbZero); + + + + +PMRPDumpLoadMem_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgePMRPDumpLoadMemValue32(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_PMRPDUMPLOADMEMVALUE32 *psPMRPDumpLoadMemValue32IN, + PVRSRV_BRIDGE_OUT_PMRPDUMPLOADMEMVALUE32 *psPMRPDumpLoadMemValue32OUT, + CONNECTION_DATA *psConnection) +{ + PMR * psPMRInt = IMG_NULL; + + + + + + + + { + /* Look up the address from the handle */ + psPMRPDumpLoadMemValue32OUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psPMRInt, + psPMRPDumpLoadMemValue32IN->hPMR, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR); + if(psPMRPDumpLoadMemValue32OUT->eError != PVRSRV_OK) + { + goto PMRPDumpLoadMemValue32_exit; + } + } + + + psPMRPDumpLoadMemValue32OUT->eError = + PMRPDumpLoadMemValue32( + psPMRInt, + psPMRPDumpLoadMemValue32IN->uiOffset, + psPMRPDumpLoadMemValue32IN->ui32Value, + psPMRPDumpLoadMemValue32IN->ui32PDumpFlags); + + + + +PMRPDumpLoadMemValue32_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgePMRPDumpLoadMemValue64(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_PMRPDUMPLOADMEMVALUE64 *psPMRPDumpLoadMemValue64IN, + PVRSRV_BRIDGE_OUT_PMRPDUMPLOADMEMVALUE64 *psPMRPDumpLoadMemValue64OUT, + CONNECTION_DATA *psConnection) +{ + PMR * psPMRInt = IMG_NULL; + + + + + + + + { + /* Look up the address from the handle */ + psPMRPDumpLoadMemValue64OUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psPMRInt, + psPMRPDumpLoadMemValue64IN->hPMR, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR); + if(psPMRPDumpLoadMemValue64OUT->eError != PVRSRV_OK) + { + goto PMRPDumpLoadMemValue64_exit; + } + } + + + psPMRPDumpLoadMemValue64OUT->eError = + PMRPDumpLoadMemValue64( + psPMRInt, + psPMRPDumpLoadMemValue64IN->uiOffset, + psPMRPDumpLoadMemValue64IN->ui64Value, + psPMRPDumpLoadMemValue64IN->ui32PDumpFlags); + + + + +PMRPDumpLoadMemValue64_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgePMRPDumpSaveToFile(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_PMRPDUMPSAVETOFILE *psPMRPDumpSaveToFileIN, + PVRSRV_BRIDGE_OUT_PMRPDUMPSAVETOFILE *psPMRPDumpSaveToFileOUT, + CONNECTION_DATA *psConnection) +{ + PMR * psPMRInt = IMG_NULL; + IMG_CHAR *uiFileNameInt = IMG_NULL; + + + + + if (psPMRPDumpSaveToFileIN->ui32ArraySize != 0) + { + uiFileNameInt = OSAllocMem(psPMRPDumpSaveToFileIN->ui32ArraySize * sizeof(IMG_CHAR)); + if (!uiFileNameInt) + { + psPMRPDumpSaveToFileOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto PMRPDumpSaveToFile_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psPMRPDumpSaveToFileIN->puiFileName, psPMRPDumpSaveToFileIN->ui32ArraySize * sizeof(IMG_CHAR)) + || (OSCopyFromUser(NULL, uiFileNameInt, psPMRPDumpSaveToFileIN->puiFileName, + psPMRPDumpSaveToFileIN->ui32ArraySize * sizeof(IMG_CHAR)) != PVRSRV_OK) ) + { + psPMRPDumpSaveToFileOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto PMRPDumpSaveToFile_exit; + } + + + + { + /* Look up the address from the handle */ + psPMRPDumpSaveToFileOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psPMRInt, + psPMRPDumpSaveToFileIN->hPMR, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR); + if(psPMRPDumpSaveToFileOUT->eError != PVRSRV_OK) + { + goto PMRPDumpSaveToFile_exit; + } + } + + + psPMRPDumpSaveToFileOUT->eError = + PMRPDumpSaveToFile( + psPMRInt, + psPMRPDumpSaveToFileIN->uiOffset, + psPMRPDumpSaveToFileIN->uiSize, + psPMRPDumpSaveToFileIN->ui32ArraySize, + uiFileNameInt); + + + + +PMRPDumpSaveToFile_exit: + if (uiFileNameInt) + OSFreeMem(uiFileNameInt); + + return 0; +} + +static IMG_INT +PVRSRVBridgePMRPDumpSymbolicAddr(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_PMRPDUMPSYMBOLICADDR *psPMRPDumpSymbolicAddrIN, + PVRSRV_BRIDGE_OUT_PMRPDUMPSYMBOLICADDR *psPMRPDumpSymbolicAddrOUT, + CONNECTION_DATA *psConnection) +{ + PMR * psPMRInt = IMG_NULL; + IMG_CHAR *puiMemspaceNameInt = IMG_NULL; + IMG_CHAR *puiSymbolicAddrInt = IMG_NULL; + + + psPMRPDumpSymbolicAddrOUT->puiMemspaceName = psPMRPDumpSymbolicAddrIN->puiMemspaceName; + psPMRPDumpSymbolicAddrOUT->puiSymbolicAddr = psPMRPDumpSymbolicAddrIN->puiSymbolicAddr; + + + if (psPMRPDumpSymbolicAddrIN->ui32MemspaceNameLen != 0) + { + puiMemspaceNameInt = OSAllocMem(psPMRPDumpSymbolicAddrIN->ui32MemspaceNameLen * sizeof(IMG_CHAR)); + if (!puiMemspaceNameInt) + { + psPMRPDumpSymbolicAddrOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto PMRPDumpSymbolicAddr_exit; + } + } + + if (psPMRPDumpSymbolicAddrIN->ui32SymbolicAddrLen != 0) + { + puiSymbolicAddrInt = OSAllocMem(psPMRPDumpSymbolicAddrIN->ui32SymbolicAddrLen * sizeof(IMG_CHAR)); + if (!puiSymbolicAddrInt) + { + psPMRPDumpSymbolicAddrOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto PMRPDumpSymbolicAddr_exit; + } + } + + + + + { + /* Look up the address from the handle */ + psPMRPDumpSymbolicAddrOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psPMRInt, + psPMRPDumpSymbolicAddrIN->hPMR, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR); + if(psPMRPDumpSymbolicAddrOUT->eError != PVRSRV_OK) + { + goto PMRPDumpSymbolicAddr_exit; + } + } + + + psPMRPDumpSymbolicAddrOUT->eError = + PMR_PDumpSymbolicAddr( + psPMRInt, + psPMRPDumpSymbolicAddrIN->uiOffset, + psPMRPDumpSymbolicAddrIN->ui32MemspaceNameLen, + puiMemspaceNameInt, + psPMRPDumpSymbolicAddrIN->ui32SymbolicAddrLen, + puiSymbolicAddrInt, + &psPMRPDumpSymbolicAddrOUT->uiNewOffset, + &psPMRPDumpSymbolicAddrOUT->uiNextSymName); + + + + if ( !OSAccessOK(PVR_VERIFY_WRITE, (IMG_VOID*) psPMRPDumpSymbolicAddrOUT->puiMemspaceName, (psPMRPDumpSymbolicAddrIN->ui32MemspaceNameLen * sizeof(IMG_CHAR))) + || (OSCopyToUser(NULL, psPMRPDumpSymbolicAddrOUT->puiMemspaceName, puiMemspaceNameInt, + (psPMRPDumpSymbolicAddrIN->ui32MemspaceNameLen * sizeof(IMG_CHAR))) != PVRSRV_OK) ) + { + psPMRPDumpSymbolicAddrOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto PMRPDumpSymbolicAddr_exit; + } + + if ( !OSAccessOK(PVR_VERIFY_WRITE, (IMG_VOID*) psPMRPDumpSymbolicAddrOUT->puiSymbolicAddr, (psPMRPDumpSymbolicAddrIN->ui32SymbolicAddrLen * sizeof(IMG_CHAR))) + || (OSCopyToUser(NULL, psPMRPDumpSymbolicAddrOUT->puiSymbolicAddr, puiSymbolicAddrInt, + (psPMRPDumpSymbolicAddrIN->ui32SymbolicAddrLen * sizeof(IMG_CHAR))) != PVRSRV_OK) ) + { + psPMRPDumpSymbolicAddrOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto PMRPDumpSymbolicAddr_exit; + } + + +PMRPDumpSymbolicAddr_exit: + if (puiMemspaceNameInt) + OSFreeMem(puiMemspaceNameInt); + if (puiSymbolicAddrInt) + OSFreeMem(puiSymbolicAddrInt); + + return 0; +} + +static IMG_INT +PVRSRVBridgePMRPDumpPol32(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_PMRPDUMPPOL32 *psPMRPDumpPol32IN, + PVRSRV_BRIDGE_OUT_PMRPDUMPPOL32 *psPMRPDumpPol32OUT, + CONNECTION_DATA *psConnection) +{ + PMR * psPMRInt = IMG_NULL; + + + + + + + + { + /* Look up the address from the handle */ + psPMRPDumpPol32OUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psPMRInt, + psPMRPDumpPol32IN->hPMR, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR); + if(psPMRPDumpPol32OUT->eError != PVRSRV_OK) + { + goto PMRPDumpPol32_exit; + } + } + + + psPMRPDumpPol32OUT->eError = + PMRPDumpPol32( + psPMRInt, + psPMRPDumpPol32IN->uiOffset, + psPMRPDumpPol32IN->ui32Value, + psPMRPDumpPol32IN->ui32Mask, + psPMRPDumpPol32IN->eOperator, + psPMRPDumpPol32IN->ui32PDumpFlags); + + + + +PMRPDumpPol32_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgePMRPDumpCBP(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_PMRPDUMPCBP *psPMRPDumpCBPIN, + PVRSRV_BRIDGE_OUT_PMRPDUMPCBP *psPMRPDumpCBPOUT, + CONNECTION_DATA *psConnection) +{ + PMR * psPMRInt = IMG_NULL; + + + + + + + + { + /* Look up the address from the handle */ + psPMRPDumpCBPOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psPMRInt, + psPMRPDumpCBPIN->hPMR, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR); + if(psPMRPDumpCBPOUT->eError != PVRSRV_OK) + { + goto PMRPDumpCBP_exit; + } + } + + + psPMRPDumpCBPOUT->eError = + PMRPDumpCBP( + psPMRInt, + psPMRPDumpCBPIN->uiReadOffset, + psPMRPDumpCBPIN->uiWriteOffset, + psPMRPDumpCBPIN->uiPacketSize, + psPMRPDumpCBPIN->uiBufferSize); + + + + +PMRPDumpCBP_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeDevmemIntPDumpSaveToFileVirtual(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_DEVMEMINTPDUMPSAVETOFILEVIRTUAL *psDevmemIntPDumpSaveToFileVirtualIN, + PVRSRV_BRIDGE_OUT_DEVMEMINTPDUMPSAVETOFILEVIRTUAL *psDevmemIntPDumpSaveToFileVirtualOUT, + CONNECTION_DATA *psConnection) +{ + DEVMEMINT_CTX * psDevmemServerContextInt = IMG_NULL; + IMG_CHAR *uiFileNameInt = IMG_NULL; + + + + + if (psDevmemIntPDumpSaveToFileVirtualIN->ui32ArraySize != 0) + { + uiFileNameInt = OSAllocMem(psDevmemIntPDumpSaveToFileVirtualIN->ui32ArraySize * sizeof(IMG_CHAR)); + if (!uiFileNameInt) + { + psDevmemIntPDumpSaveToFileVirtualOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto DevmemIntPDumpSaveToFileVirtual_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psDevmemIntPDumpSaveToFileVirtualIN->puiFileName, psDevmemIntPDumpSaveToFileVirtualIN->ui32ArraySize * sizeof(IMG_CHAR)) + || (OSCopyFromUser(NULL, uiFileNameInt, psDevmemIntPDumpSaveToFileVirtualIN->puiFileName, + psDevmemIntPDumpSaveToFileVirtualIN->ui32ArraySize * sizeof(IMG_CHAR)) != PVRSRV_OK) ) + { + psDevmemIntPDumpSaveToFileVirtualOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto DevmemIntPDumpSaveToFileVirtual_exit; + } + + + + { + /* Look up the address from the handle */ + psDevmemIntPDumpSaveToFileVirtualOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psDevmemServerContextInt, + psDevmemIntPDumpSaveToFileVirtualIN->hDevmemServerContext, + PVRSRV_HANDLE_TYPE_DEVMEMINT_CTX); + if(psDevmemIntPDumpSaveToFileVirtualOUT->eError != PVRSRV_OK) + { + goto DevmemIntPDumpSaveToFileVirtual_exit; + } + } + + + psDevmemIntPDumpSaveToFileVirtualOUT->eError = + DevmemIntPDumpSaveToFileVirtual( + psDevmemServerContextInt, + psDevmemIntPDumpSaveToFileVirtualIN->sAddress, + psDevmemIntPDumpSaveToFileVirtualIN->uiSize, + psDevmemIntPDumpSaveToFileVirtualIN->ui32ArraySize, + uiFileNameInt, + psDevmemIntPDumpSaveToFileVirtualIN->ui32FileOffset, + psDevmemIntPDumpSaveToFileVirtualIN->ui32PDumpFlags); + + + + +DevmemIntPDumpSaveToFileVirtual_exit: + if (uiFileNameInt) + OSFreeMem(uiFileNameInt); + + return 0; +} + + + +/* *************************************************************************** + * Server bridge dispatch related glue + */ + + +PVRSRV_ERROR InitPDUMPMMBridge(IMG_VOID); +PVRSRV_ERROR DeinitPDUMPMMBridge(IMG_VOID); + +/* + * Register all PDUMPMM functions with services + */ +PVRSRV_ERROR InitPDUMPMMBridge(IMG_VOID) +{ + + SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMPMM, PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPLOADMEM, PVRSRVBridgePMRPDumpLoadMem, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMPMM, PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPLOADMEMVALUE32, PVRSRVBridgePMRPDumpLoadMemValue32, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMPMM, PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPLOADMEMVALUE64, PVRSRVBridgePMRPDumpLoadMemValue64, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMPMM, PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPSAVETOFILE, PVRSRVBridgePMRPDumpSaveToFile, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMPMM, PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPSYMBOLICADDR, PVRSRVBridgePMRPDumpSymbolicAddr, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMPMM, PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPPOL32, PVRSRVBridgePMRPDumpPol32, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMPMM, PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPCBP, PVRSRVBridgePMRPDumpCBP, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMPMM, PVRSRV_BRIDGE_PDUMPMM_DEVMEMINTPDUMPSAVETOFILEVIRTUAL, PVRSRVBridgeDevmemIntPDumpSaveToFileVirtual, + IMG_NULL, IMG_NULL, + 0, 0); + + + return PVRSRV_OK; +} + +/* + * Unregister all pdumpmm functions with services + */ +PVRSRV_ERROR DeinitPDUMPMMBridge(IMG_VOID) +{ + return PVRSRV_OK; +} + diff --git a/drivers/gpu/rogue_m/generated/pvrtl_bridge/client_pvrtl_bridge.h b/drivers/gpu/rogue_m/generated/pvrtl_bridge/client_pvrtl_bridge.h new file mode 100644 index 000000000000..5fe114aca405 --- /dev/null +++ b/drivers/gpu/rogue_m/generated/pvrtl_bridge/client_pvrtl_bridge.h @@ -0,0 +1,76 @@ +/*************************************************************************/ /*! +@File +@Title Client bridge header for pvrtl +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Exports the client bridge functions for pvrtl +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef CLIENT_PVRTL_BRIDGE_H +#define CLIENT_PVRTL_BRIDGE_H + +#include "pvr_bridge_client.h" +#include "pvr_bridge.h" + +#include "common_pvrtl_bridge.h" + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeTLConnect(IMG_HANDLE hBridge); + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeTLDisconnect(IMG_HANDLE hBridge); + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeTLOpenStream(IMG_HANDLE hBridge, + IMG_CHAR *puiName, + IMG_UINT32 ui32Mode, + IMG_HANDLE *phSD, + DEVMEM_SERVER_EXPORTCOOKIE *phClientBUFExportCookie); + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeTLCloseStream(IMG_HANDLE hBridge, + IMG_HANDLE hSD); + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeTLAcquireData(IMG_HANDLE hBridge, + IMG_HANDLE hSD, + IMG_UINT32 *pui32ReadOffset, + IMG_UINT32 *pui32ReadLen); + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeTLReleaseData(IMG_HANDLE hBridge, + IMG_HANDLE hSD, + IMG_UINT32 ui32ReadOffset, + IMG_UINT32 ui32ReadLen); + + +#endif /* CLIENT_PVRTL_BRIDGE_H */ diff --git a/drivers/gpu/rogue_m/generated/pvrtl_bridge/common_pvrtl_bridge.h b/drivers/gpu/rogue_m/generated/pvrtl_bridge/common_pvrtl_bridge.h new file mode 100644 index 000000000000..37033e1b744a --- /dev/null +++ b/drivers/gpu/rogue_m/generated/pvrtl_bridge/common_pvrtl_bridge.h @@ -0,0 +1,174 @@ +/*************************************************************************/ /*! +@File +@Title Common bridge header for pvrtl +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Declares common defines and structures that are used by both + the client and sever side of the bridge for pvrtl +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef COMMON_PVRTL_BRIDGE_H +#define COMMON_PVRTL_BRIDGE_H + +#include "img_types.h" +#include "pvrsrv_error.h" + +#include "devicemem_typedefs.h" +#include "pvr_tl.h" + + +#define PVRSRV_BRIDGE_PVRTL_CMD_FIRST 0 +#define PVRSRV_BRIDGE_PVRTL_TLCONNECT PVRSRV_BRIDGE_PVRTL_CMD_FIRST+0 +#define PVRSRV_BRIDGE_PVRTL_TLDISCONNECT PVRSRV_BRIDGE_PVRTL_CMD_FIRST+1 +#define PVRSRV_BRIDGE_PVRTL_TLOPENSTREAM PVRSRV_BRIDGE_PVRTL_CMD_FIRST+2 +#define PVRSRV_BRIDGE_PVRTL_TLCLOSESTREAM PVRSRV_BRIDGE_PVRTL_CMD_FIRST+3 +#define PVRSRV_BRIDGE_PVRTL_TLACQUIREDATA PVRSRV_BRIDGE_PVRTL_CMD_FIRST+4 +#define PVRSRV_BRIDGE_PVRTL_TLRELEASEDATA PVRSRV_BRIDGE_PVRTL_CMD_FIRST+5 +#define PVRSRV_BRIDGE_PVRTL_CMD_LAST (PVRSRV_BRIDGE_PVRTL_CMD_FIRST+5) + + +/******************************************* + TLConnect + *******************************************/ + +/* Bridge in structure for TLConnect */ +typedef struct PVRSRV_BRIDGE_IN_TLCONNECT_TAG +{ + IMG_UINT32 ui32EmptyStructPlaceholder; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_TLCONNECT; + + +/* Bridge out structure for TLConnect */ +typedef struct PVRSRV_BRIDGE_OUT_TLCONNECT_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_TLCONNECT; + +/******************************************* + TLDisconnect + *******************************************/ + +/* Bridge in structure for TLDisconnect */ +typedef struct PVRSRV_BRIDGE_IN_TLDISCONNECT_TAG +{ + IMG_UINT32 ui32EmptyStructPlaceholder; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_TLDISCONNECT; + + +/* Bridge out structure for TLDisconnect */ +typedef struct PVRSRV_BRIDGE_OUT_TLDISCONNECT_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_TLDISCONNECT; + +/******************************************* + TLOpenStream + *******************************************/ + +/* Bridge in structure for TLOpenStream */ +typedef struct PVRSRV_BRIDGE_IN_TLOPENSTREAM_TAG +{ + IMG_CHAR * puiName; + IMG_UINT32 ui32Mode; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_TLOPENSTREAM; + + +/* Bridge out structure for TLOpenStream */ +typedef struct PVRSRV_BRIDGE_OUT_TLOPENSTREAM_TAG +{ + IMG_HANDLE hSD; + DEVMEM_SERVER_EXPORTCOOKIE hClientBUFExportCookie; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_TLOPENSTREAM; + +/******************************************* + TLCloseStream + *******************************************/ + +/* Bridge in structure for TLCloseStream */ +typedef struct PVRSRV_BRIDGE_IN_TLCLOSESTREAM_TAG +{ + IMG_HANDLE hSD; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_TLCLOSESTREAM; + + +/* Bridge out structure for TLCloseStream */ +typedef struct PVRSRV_BRIDGE_OUT_TLCLOSESTREAM_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_TLCLOSESTREAM; + +/******************************************* + TLAcquireData + *******************************************/ + +/* Bridge in structure for TLAcquireData */ +typedef struct PVRSRV_BRIDGE_IN_TLACQUIREDATA_TAG +{ + IMG_HANDLE hSD; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_TLACQUIREDATA; + + +/* Bridge out structure for TLAcquireData */ +typedef struct PVRSRV_BRIDGE_OUT_TLACQUIREDATA_TAG +{ + IMG_UINT32 ui32ReadOffset; + IMG_UINT32 ui32ReadLen; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_TLACQUIREDATA; + +/******************************************* + TLReleaseData + *******************************************/ + +/* Bridge in structure for TLReleaseData */ +typedef struct PVRSRV_BRIDGE_IN_TLRELEASEDATA_TAG +{ + IMG_HANDLE hSD; + IMG_UINT32 ui32ReadOffset; + IMG_UINT32 ui32ReadLen; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_TLRELEASEDATA; + + +/* Bridge out structure for TLReleaseData */ +typedef struct PVRSRV_BRIDGE_OUT_TLRELEASEDATA_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_TLRELEASEDATA; + +#endif /* COMMON_PVRTL_BRIDGE_H */ diff --git a/drivers/gpu/rogue_m/generated/pvrtl_bridge/server_pvrtl_bridge.c b/drivers/gpu/rogue_m/generated/pvrtl_bridge/server_pvrtl_bridge.c new file mode 100644 index 000000000000..89709add54f9 --- /dev/null +++ b/drivers/gpu/rogue_m/generated/pvrtl_bridge/server_pvrtl_bridge.c @@ -0,0 +1,397 @@ +/*************************************************************************/ /*! +@File +@Title Server bridge for pvrtl +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Implements the server side of the bridge for pvrtl +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#include +#include + +#include "img_defs.h" + +#include "tlserver.h" + + +#include "common_pvrtl_bridge.h" + +#include "allocmem.h" +#include "pvr_debug.h" +#include "connection_server.h" +#include "pvr_bridge.h" +#include "rgx_bridge.h" +#include "srvcore.h" +#include "handle.h" + +#if defined (SUPPORT_AUTH) +#include "osauth.h" +#endif + +#include + + + + +/* *************************************************************************** + * Server-side bridge entry points + */ + +static IMG_INT +PVRSRVBridgeTLConnect(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_TLCONNECT *psTLConnectIN, + PVRSRV_BRIDGE_OUT_TLCONNECT *psTLConnectOUT, + CONNECTION_DATA *psConnection) +{ + + PVR_UNREFERENCED_PARAMETER(psTLConnectIN); + + + + + + + psTLConnectOUT->eError = + TLServerConnectKM(psConnection + ); + + + + + + return 0; +} + +static IMG_INT +PVRSRVBridgeTLDisconnect(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_TLDISCONNECT *psTLDisconnectIN, + PVRSRV_BRIDGE_OUT_TLDISCONNECT *psTLDisconnectOUT, + CONNECTION_DATA *psConnection) +{ + + PVR_UNREFERENCED_PARAMETER(psTLDisconnectIN); + + + + + + + psTLDisconnectOUT->eError = + TLServerDisconnectKM(psConnection + ); + + + + + + return 0; +} + +static IMG_INT +PVRSRVBridgeTLOpenStream(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_TLOPENSTREAM *psTLOpenStreamIN, + PVRSRV_BRIDGE_OUT_TLOPENSTREAM *psTLOpenStreamOUT, + CONNECTION_DATA *psConnection) +{ + IMG_CHAR *uiNameInt = IMG_NULL; + TL_STREAM_DESC * psSDInt = IMG_NULL; + DEVMEM_EXPORTCOOKIE * psClientBUFExportCookieInt = IMG_NULL; + + + + psTLOpenStreamOUT->hSD = IMG_NULL; + + + { + uiNameInt = OSAllocMem(PRVSRVTL_MAX_STREAM_NAME_SIZE * sizeof(IMG_CHAR)); + if (!uiNameInt) + { + psTLOpenStreamOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto TLOpenStream_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psTLOpenStreamIN->puiName, PRVSRVTL_MAX_STREAM_NAME_SIZE * sizeof(IMG_CHAR)) + || (OSCopyFromUser(NULL, uiNameInt, psTLOpenStreamIN->puiName, + PRVSRVTL_MAX_STREAM_NAME_SIZE * sizeof(IMG_CHAR)) != PVRSRV_OK) ) + { + psTLOpenStreamOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto TLOpenStream_exit; + } + + + + psTLOpenStreamOUT->eError = + TLServerOpenStreamKM( + uiNameInt, + psTLOpenStreamIN->ui32Mode, + &psSDInt, + &psClientBUFExportCookieInt); + /* Exit early if bridged call fails */ + if(psTLOpenStreamOUT->eError != PVRSRV_OK) + { + goto TLOpenStream_exit; + } + + + psTLOpenStreamOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psTLOpenStreamOUT->hSD, + (IMG_VOID *) psSDInt, + PVRSRV_HANDLE_TYPE_PVR_TL_SD, + PVRSRV_HANDLE_ALLOC_FLAG_MULTI + ,(PFN_HANDLE_RELEASE)&TLServerCloseStreamKM); + if (psTLOpenStreamOUT->eError != PVRSRV_OK) + { + goto TLOpenStream_exit; + } + + + psTLOpenStreamOUT->eError = PVRSRVAllocSubHandle(psConnection->psHandleBase, + &psTLOpenStreamOUT->hClientBUFExportCookie, + (IMG_VOID *) psClientBUFExportCookieInt, + PVRSRV_HANDLE_TYPE_SERVER_EXPORTCOOKIE, + PVRSRV_HANDLE_ALLOC_FLAG_NONE + ,psTLOpenStreamOUT->hSD); + if (psTLOpenStreamOUT->eError != PVRSRV_OK) + { + goto TLOpenStream_exit; + } + + + + +TLOpenStream_exit: + if (psTLOpenStreamOUT->eError != PVRSRV_OK) + { + if (psTLOpenStreamOUT->hSD) + { + PVRSRV_ERROR eError = PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psTLOpenStreamOUT->hSD, + PVRSRV_HANDLE_TYPE_PVR_TL_SD); + + /* Releasing the handle should free/destroy/release the resource. This should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + + /* Avoid freeing/destroying/releasing the resource a second time below */ + psSDInt = IMG_NULL; + } + + + if (psSDInt) + { + TLServerCloseStreamKM(psSDInt); + } + } + + if (uiNameInt) + OSFreeMem(uiNameInt); + + return 0; +} + +static IMG_INT +PVRSRVBridgeTLCloseStream(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_TLCLOSESTREAM *psTLCloseStreamIN, + PVRSRV_BRIDGE_OUT_TLCLOSESTREAM *psTLCloseStreamOUT, + CONNECTION_DATA *psConnection) +{ + + + + + + + + + + psTLCloseStreamOUT->eError = + PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psTLCloseStreamIN->hSD, + PVRSRV_HANDLE_TYPE_PVR_TL_SD); + if ((psTLCloseStreamOUT->eError != PVRSRV_OK) && (psTLCloseStreamOUT->eError != PVRSRV_ERROR_RETRY)) + { + PVR_ASSERT(0); + goto TLCloseStream_exit; + } + + + +TLCloseStream_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeTLAcquireData(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_TLACQUIREDATA *psTLAcquireDataIN, + PVRSRV_BRIDGE_OUT_TLACQUIREDATA *psTLAcquireDataOUT, + CONNECTION_DATA *psConnection) +{ + TL_STREAM_DESC * psSDInt = IMG_NULL; + + + + + + + + { + /* Look up the address from the handle */ + psTLAcquireDataOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psSDInt, + psTLAcquireDataIN->hSD, + PVRSRV_HANDLE_TYPE_PVR_TL_SD); + if(psTLAcquireDataOUT->eError != PVRSRV_OK) + { + goto TLAcquireData_exit; + } + } + + + psTLAcquireDataOUT->eError = + TLServerAcquireDataKM( + psSDInt, + &psTLAcquireDataOUT->ui32ReadOffset, + &psTLAcquireDataOUT->ui32ReadLen); + + + + +TLAcquireData_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeTLReleaseData(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_TLRELEASEDATA *psTLReleaseDataIN, + PVRSRV_BRIDGE_OUT_TLRELEASEDATA *psTLReleaseDataOUT, + CONNECTION_DATA *psConnection) +{ + TL_STREAM_DESC * psSDInt = IMG_NULL; + + + + + + + + { + /* Look up the address from the handle */ + psTLReleaseDataOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psSDInt, + psTLReleaseDataIN->hSD, + PVRSRV_HANDLE_TYPE_PVR_TL_SD); + if(psTLReleaseDataOUT->eError != PVRSRV_OK) + { + goto TLReleaseData_exit; + } + } + + + psTLReleaseDataOUT->eError = + TLServerReleaseDataKM( + psSDInt, + psTLReleaseDataIN->ui32ReadOffset, + psTLReleaseDataIN->ui32ReadLen); + + + + +TLReleaseData_exit: + + return 0; +} + + + +/* *************************************************************************** + * Server bridge dispatch related glue + */ + + +PVRSRV_ERROR InitPVRTLBridge(IMG_VOID); +PVRSRV_ERROR DeinitPVRTLBridge(IMG_VOID); + +/* + * Register all PVRTL functions with services + */ +PVRSRV_ERROR InitPVRTLBridge(IMG_VOID) +{ + + SetDispatchTableEntry(PVRSRV_BRIDGE_PVRTL, PVRSRV_BRIDGE_PVRTL_TLCONNECT, PVRSRVBridgeTLConnect, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_PVRTL, PVRSRV_BRIDGE_PVRTL_TLDISCONNECT, PVRSRVBridgeTLDisconnect, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_PVRTL, PVRSRV_BRIDGE_PVRTL_TLOPENSTREAM, PVRSRVBridgeTLOpenStream, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_PVRTL, PVRSRV_BRIDGE_PVRTL_TLCLOSESTREAM, PVRSRVBridgeTLCloseStream, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_PVRTL, PVRSRV_BRIDGE_PVRTL_TLACQUIREDATA, PVRSRVBridgeTLAcquireData, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_PVRTL, PVRSRV_BRIDGE_PVRTL_TLRELEASEDATA, PVRSRVBridgeTLReleaseData, + IMG_NULL, IMG_NULL, + 0, 0); + + + return PVRSRV_OK; +} + +/* + * Unregister all pvrtl functions with services + */ +PVRSRV_ERROR DeinitPVRTLBridge(IMG_VOID) +{ + return PVRSRV_OK; +} + diff --git a/drivers/gpu/rogue_m/generated/regconfig_bridge/common_regconfig_bridge.h b/drivers/gpu/rogue_m/generated/regconfig_bridge/common_regconfig_bridge.h new file mode 100644 index 000000000000..edda33f4cb4f --- /dev/null +++ b/drivers/gpu/rogue_m/generated/regconfig_bridge/common_regconfig_bridge.h @@ -0,0 +1,151 @@ +/*************************************************************************/ /*! +@File +@Title Common bridge header for regconfig +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Declares common defines and structures that are used by both + the client and sever side of the bridge for regconfig +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef COMMON_REGCONFIG_BRIDGE_H +#define COMMON_REGCONFIG_BRIDGE_H + +#include "img_types.h" +#include "pvrsrv_error.h" + +#include "rgx_bridge.h" + + +#define PVRSRV_BRIDGE_REGCONFIG_CMD_FIRST 0 +#define PVRSRV_BRIDGE_REGCONFIG_RGXSETREGCONFIGPI PVRSRV_BRIDGE_REGCONFIG_CMD_FIRST+0 +#define PVRSRV_BRIDGE_REGCONFIG_RGXADDREGCONFIG PVRSRV_BRIDGE_REGCONFIG_CMD_FIRST+1 +#define PVRSRV_BRIDGE_REGCONFIG_RGXCLEARREGCONFIG PVRSRV_BRIDGE_REGCONFIG_CMD_FIRST+2 +#define PVRSRV_BRIDGE_REGCONFIG_RGXENABLEREGCONFIG PVRSRV_BRIDGE_REGCONFIG_CMD_FIRST+3 +#define PVRSRV_BRIDGE_REGCONFIG_RGXDISABLEREGCONFIG PVRSRV_BRIDGE_REGCONFIG_CMD_FIRST+4 +#define PVRSRV_BRIDGE_REGCONFIG_CMD_LAST (PVRSRV_BRIDGE_REGCONFIG_CMD_FIRST+4) + + +/******************************************* + RGXSetRegConfigPI + *******************************************/ + +/* Bridge in structure for RGXSetRegConfigPI */ +typedef struct PVRSRV_BRIDGE_IN_RGXSETREGCONFIGPI_TAG +{ + IMG_HANDLE hDevNode; + IMG_UINT8 ui8RegPowerIsland; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXSETREGCONFIGPI; + + +/* Bridge out structure for RGXSetRegConfigPI */ +typedef struct PVRSRV_BRIDGE_OUT_RGXSETREGCONFIGPI_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXSETREGCONFIGPI; + +/******************************************* + RGXAddRegconfig + *******************************************/ + +/* Bridge in structure for RGXAddRegconfig */ +typedef struct PVRSRV_BRIDGE_IN_RGXADDREGCONFIG_TAG +{ + IMG_HANDLE hDevNode; + IMG_UINT32 ui32RegAddr; + IMG_UINT64 ui64RegValue; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXADDREGCONFIG; + + +/* Bridge out structure for RGXAddRegconfig */ +typedef struct PVRSRV_BRIDGE_OUT_RGXADDREGCONFIG_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXADDREGCONFIG; + +/******************************************* + RGXClearRegConfig + *******************************************/ + +/* Bridge in structure for RGXClearRegConfig */ +typedef struct PVRSRV_BRIDGE_IN_RGXCLEARREGCONFIG_TAG +{ + IMG_HANDLE hDevNode; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXCLEARREGCONFIG; + + +/* Bridge out structure for RGXClearRegConfig */ +typedef struct PVRSRV_BRIDGE_OUT_RGXCLEARREGCONFIG_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXCLEARREGCONFIG; + +/******************************************* + RGXEnableRegConfig + *******************************************/ + +/* Bridge in structure for RGXEnableRegConfig */ +typedef struct PVRSRV_BRIDGE_IN_RGXENABLEREGCONFIG_TAG +{ + IMG_HANDLE hDevNode; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXENABLEREGCONFIG; + + +/* Bridge out structure for RGXEnableRegConfig */ +typedef struct PVRSRV_BRIDGE_OUT_RGXENABLEREGCONFIG_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXENABLEREGCONFIG; + +/******************************************* + RGXDisableRegConfig + *******************************************/ + +/* Bridge in structure for RGXDisableRegConfig */ +typedef struct PVRSRV_BRIDGE_IN_RGXDISABLEREGCONFIG_TAG +{ + IMG_HANDLE hDevNode; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXDISABLEREGCONFIG; + + +/* Bridge out structure for RGXDisableRegConfig */ +typedef struct PVRSRV_BRIDGE_OUT_RGXDISABLEREGCONFIG_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXDISABLEREGCONFIG; + +#endif /* COMMON_REGCONFIG_BRIDGE_H */ diff --git a/drivers/gpu/rogue_m/generated/regconfig_bridge/server_regconfig_bridge.c b/drivers/gpu/rogue_m/generated/regconfig_bridge/server_regconfig_bridge.c new file mode 100644 index 000000000000..5c23842c1668 --- /dev/null +++ b/drivers/gpu/rogue_m/generated/regconfig_bridge/server_regconfig_bridge.c @@ -0,0 +1,325 @@ +/*************************************************************************/ /*! +@File +@Title Server bridge for regconfig +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Implements the server side of the bridge for regconfig +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#include +#include + +#include "img_defs.h" + +#include "rgxregconfig.h" + + +#include "common_regconfig_bridge.h" + +#include "allocmem.h" +#include "pvr_debug.h" +#include "connection_server.h" +#include "pvr_bridge.h" +#include "rgx_bridge.h" +#include "srvcore.h" +#include "handle.h" + +#if defined (SUPPORT_AUTH) +#include "osauth.h" +#endif + +#include + + + + +/* *************************************************************************** + * Server-side bridge entry points + */ + +static IMG_INT +PVRSRVBridgeRGXSetRegConfigPI(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_RGXSETREGCONFIGPI *psRGXSetRegConfigPIIN, + PVRSRV_BRIDGE_OUT_RGXSETREGCONFIGPI *psRGXSetRegConfigPIOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevNodeInt = IMG_NULL; + + + + + + + + { + /* Look up the address from the handle */ + psRGXSetRegConfigPIOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &hDevNodeInt, + psRGXSetRegConfigPIIN->hDevNode, + PVRSRV_HANDLE_TYPE_DEV_NODE); + if(psRGXSetRegConfigPIOUT->eError != PVRSRV_OK) + { + goto RGXSetRegConfigPI_exit; + } + } + + + psRGXSetRegConfigPIOUT->eError = + PVRSRVRGXSetRegConfigPIKM( + hDevNodeInt, + psRGXSetRegConfigPIIN->ui8RegPowerIsland); + + + + +RGXSetRegConfigPI_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXAddRegconfig(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_RGXADDREGCONFIG *psRGXAddRegconfigIN, + PVRSRV_BRIDGE_OUT_RGXADDREGCONFIG *psRGXAddRegconfigOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevNodeInt = IMG_NULL; + + + + + + + + { + /* Look up the address from the handle */ + psRGXAddRegconfigOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &hDevNodeInt, + psRGXAddRegconfigIN->hDevNode, + PVRSRV_HANDLE_TYPE_DEV_NODE); + if(psRGXAddRegconfigOUT->eError != PVRSRV_OK) + { + goto RGXAddRegconfig_exit; + } + } + + + psRGXAddRegconfigOUT->eError = + PVRSRVRGXAddRegConfigKM( + hDevNodeInt, + psRGXAddRegconfigIN->ui32RegAddr, + psRGXAddRegconfigIN->ui64RegValue); + + + + +RGXAddRegconfig_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXClearRegConfig(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_RGXCLEARREGCONFIG *psRGXClearRegConfigIN, + PVRSRV_BRIDGE_OUT_RGXCLEARREGCONFIG *psRGXClearRegConfigOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevNodeInt = IMG_NULL; + + + + + + + + { + /* Look up the address from the handle */ + psRGXClearRegConfigOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &hDevNodeInt, + psRGXClearRegConfigIN->hDevNode, + PVRSRV_HANDLE_TYPE_DEV_NODE); + if(psRGXClearRegConfigOUT->eError != PVRSRV_OK) + { + goto RGXClearRegConfig_exit; + } + } + + + psRGXClearRegConfigOUT->eError = + PVRSRVRGXClearRegConfigKM( + hDevNodeInt); + + + + +RGXClearRegConfig_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXEnableRegConfig(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_RGXENABLEREGCONFIG *psRGXEnableRegConfigIN, + PVRSRV_BRIDGE_OUT_RGXENABLEREGCONFIG *psRGXEnableRegConfigOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevNodeInt = IMG_NULL; + + + + + + + + { + /* Look up the address from the handle */ + psRGXEnableRegConfigOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &hDevNodeInt, + psRGXEnableRegConfigIN->hDevNode, + PVRSRV_HANDLE_TYPE_DEV_NODE); + if(psRGXEnableRegConfigOUT->eError != PVRSRV_OK) + { + goto RGXEnableRegConfig_exit; + } + } + + + psRGXEnableRegConfigOUT->eError = + PVRSRVRGXEnableRegConfigKM( + hDevNodeInt); + + + + +RGXEnableRegConfig_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXDisableRegConfig(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_RGXDISABLEREGCONFIG *psRGXDisableRegConfigIN, + PVRSRV_BRIDGE_OUT_RGXDISABLEREGCONFIG *psRGXDisableRegConfigOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevNodeInt = IMG_NULL; + + + + + + + + { + /* Look up the address from the handle */ + psRGXDisableRegConfigOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &hDevNodeInt, + psRGXDisableRegConfigIN->hDevNode, + PVRSRV_HANDLE_TYPE_DEV_NODE); + if(psRGXDisableRegConfigOUT->eError != PVRSRV_OK) + { + goto RGXDisableRegConfig_exit; + } + } + + + psRGXDisableRegConfigOUT->eError = + PVRSRVRGXDisableRegConfigKM( + hDevNodeInt); + + + + +RGXDisableRegConfig_exit: + + return 0; +} + + + +/* *************************************************************************** + * Server bridge dispatch related glue + */ + + +PVRSRV_ERROR InitREGCONFIGBridge(IMG_VOID); +PVRSRV_ERROR DeinitREGCONFIGBridge(IMG_VOID); + +/* + * Register all REGCONFIG functions with services + */ +PVRSRV_ERROR InitREGCONFIGBridge(IMG_VOID) +{ + + SetDispatchTableEntry(PVRSRV_BRIDGE_REGCONFIG, PVRSRV_BRIDGE_REGCONFIG_RGXSETREGCONFIGPI, PVRSRVBridgeRGXSetRegConfigPI, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_REGCONFIG, PVRSRV_BRIDGE_REGCONFIG_RGXADDREGCONFIG, PVRSRVBridgeRGXAddRegconfig, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_REGCONFIG, PVRSRV_BRIDGE_REGCONFIG_RGXCLEARREGCONFIG, PVRSRVBridgeRGXClearRegConfig, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_REGCONFIG, PVRSRV_BRIDGE_REGCONFIG_RGXENABLEREGCONFIG, PVRSRVBridgeRGXEnableRegConfig, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_REGCONFIG, PVRSRV_BRIDGE_REGCONFIG_RGXDISABLEREGCONFIG, PVRSRVBridgeRGXDisableRegConfig, + IMG_NULL, IMG_NULL, + 0, 0); + + + return PVRSRV_OK; +} + +/* + * Unregister all regconfig functions with services + */ +PVRSRV_ERROR DeinitREGCONFIGBridge(IMG_VOID) +{ + return PVRSRV_OK; +} + diff --git a/drivers/gpu/rogue_m/generated/rgxcmp_bridge/common_rgxcmp_bridge.h b/drivers/gpu/rogue_m/generated/rgxcmp_bridge/common_rgxcmp_bridge.h new file mode 100644 index 000000000000..81f1c51c7125 --- /dev/null +++ b/drivers/gpu/rogue_m/generated/rgxcmp_bridge/common_rgxcmp_bridge.h @@ -0,0 +1,206 @@ +/*************************************************************************/ /*! +@File +@Title Common bridge header for rgxcmp +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Declares common defines and structures that are used by both + the client and sever side of the bridge for rgxcmp +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef COMMON_RGXCMP_BRIDGE_H +#define COMMON_RGXCMP_BRIDGE_H + +#include "img_types.h" +#include "pvrsrv_error.h" + +#include "rgx_bridge.h" +#include "sync_external.h" +#include "rgx_fwif_shared.h" + + +#define PVRSRV_BRIDGE_RGXCMP_CMD_FIRST 0 +#define PVRSRV_BRIDGE_RGXCMP_RGXCREATECOMPUTECONTEXT PVRSRV_BRIDGE_RGXCMP_CMD_FIRST+0 +#define PVRSRV_BRIDGE_RGXCMP_RGXDESTROYCOMPUTECONTEXT PVRSRV_BRIDGE_RGXCMP_CMD_FIRST+1 +#define PVRSRV_BRIDGE_RGXCMP_RGXKICKCDM PVRSRV_BRIDGE_RGXCMP_CMD_FIRST+2 +#define PVRSRV_BRIDGE_RGXCMP_RGXFLUSHCOMPUTEDATA PVRSRV_BRIDGE_RGXCMP_CMD_FIRST+3 +#define PVRSRV_BRIDGE_RGXCMP_RGXSETCOMPUTECONTEXTPRIORITY PVRSRV_BRIDGE_RGXCMP_CMD_FIRST+4 +#define PVRSRV_BRIDGE_RGXCMP_RGXKICKSYNCCDM PVRSRV_BRIDGE_RGXCMP_CMD_FIRST+5 +#define PVRSRV_BRIDGE_RGXCMP_CMD_LAST (PVRSRV_BRIDGE_RGXCMP_CMD_FIRST+5) + + +/******************************************* + RGXCreateComputeContext + *******************************************/ + +/* Bridge in structure for RGXCreateComputeContext */ +typedef struct PVRSRV_BRIDGE_IN_RGXCREATECOMPUTECONTEXT_TAG +{ + IMG_HANDLE hDevNode; + IMG_UINT32 ui32Priority; + IMG_DEV_VIRTADDR sMCUFenceAddr; + IMG_UINT32 ui32FrameworkCmdize; + IMG_BYTE * psFrameworkCmd; + IMG_HANDLE hPrivData; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXCREATECOMPUTECONTEXT; + + +/* Bridge out structure for RGXCreateComputeContext */ +typedef struct PVRSRV_BRIDGE_OUT_RGXCREATECOMPUTECONTEXT_TAG +{ + IMG_HANDLE hComputeContext; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXCREATECOMPUTECONTEXT; + +/******************************************* + RGXDestroyComputeContext + *******************************************/ + +/* Bridge in structure for RGXDestroyComputeContext */ +typedef struct PVRSRV_BRIDGE_IN_RGXDESTROYCOMPUTECONTEXT_TAG +{ + IMG_HANDLE hComputeContext; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXDESTROYCOMPUTECONTEXT; + + +/* Bridge out structure for RGXDestroyComputeContext */ +typedef struct PVRSRV_BRIDGE_OUT_RGXDESTROYCOMPUTECONTEXT_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXDESTROYCOMPUTECONTEXT; + +/******************************************* + RGXKickCDM + *******************************************/ + +/* Bridge in structure for RGXKickCDM */ +typedef struct PVRSRV_BRIDGE_IN_RGXKICKCDM_TAG +{ + IMG_HANDLE hComputeContext; + IMG_UINT32 ui32ClientFenceCount; + IMG_HANDLE * phClientFenceUFOSyncPrimBlock; + IMG_UINT32 * pui32ClientFenceOffset; + IMG_UINT32 * pui32ClientFenceValue; + IMG_UINT32 ui32ClientUpdateCount; + IMG_HANDLE * phClientUpdateUFOSyncPrimBlock; + IMG_UINT32 * pui32ClientUpdateOffset; + IMG_UINT32 * pui32ClientUpdateValue; + IMG_UINT32 ui32ServerSyncCount; + IMG_UINT32 * pui32ServerSyncFlags; + IMG_HANDLE * phServerSyncs; + IMG_UINT32 ui32CmdSize; + IMG_BYTE * psDMCmd; + IMG_BOOL bbPDumpContinuous; + IMG_UINT32 ui32ExternalJobReference; + IMG_UINT32 ui32InternalJobReference; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXKICKCDM; + + +/* Bridge out structure for RGXKickCDM */ +typedef struct PVRSRV_BRIDGE_OUT_RGXKICKCDM_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXKICKCDM; + +/******************************************* + RGXFlushComputeData + *******************************************/ + +/* Bridge in structure for RGXFlushComputeData */ +typedef struct PVRSRV_BRIDGE_IN_RGXFLUSHCOMPUTEDATA_TAG +{ + IMG_HANDLE hComputeContext; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXFLUSHCOMPUTEDATA; + + +/* Bridge out structure for RGXFlushComputeData */ +typedef struct PVRSRV_BRIDGE_OUT_RGXFLUSHCOMPUTEDATA_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXFLUSHCOMPUTEDATA; + +/******************************************* + RGXSetComputeContextPriority + *******************************************/ + +/* Bridge in structure for RGXSetComputeContextPriority */ +typedef struct PVRSRV_BRIDGE_IN_RGXSETCOMPUTECONTEXTPRIORITY_TAG +{ + IMG_HANDLE hComputeContext; + IMG_UINT32 ui32Priority; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXSETCOMPUTECONTEXTPRIORITY; + + +/* Bridge out structure for RGXSetComputeContextPriority */ +typedef struct PVRSRV_BRIDGE_OUT_RGXSETCOMPUTECONTEXTPRIORITY_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXSETCOMPUTECONTEXTPRIORITY; + +/******************************************* + RGXKickSyncCDM + *******************************************/ + +/* Bridge in structure for RGXKickSyncCDM */ +typedef struct PVRSRV_BRIDGE_IN_RGXKICKSYNCCDM_TAG +{ + IMG_HANDLE hComputeContext; + IMG_UINT32 ui32ClientFenceCount; + IMG_HANDLE * phClientFenceUFOSyncPrimBlock; + IMG_UINT32 * pui32ClientFenceOffset; + IMG_UINT32 * pui32ClientFenceValue; + IMG_UINT32 ui32ClientUpdateCount; + IMG_HANDLE * phClientUpdateUFOSyncPrimBlock; + IMG_UINT32 * pui32ClientUpdateOffset; + IMG_UINT32 * pui32ClientUpdateValue; + IMG_UINT32 ui32ServerSyncCount; + IMG_UINT32 * pui32ServerSyncFlags; + IMG_HANDLE * phServerSyncs; + IMG_UINT32 ui32NumCheckFenceFDs; + IMG_INT32 * pi32CheckFenceFDs; + IMG_INT32 i32UpdateFenceFD; + IMG_BOOL bbPDumpContinuous; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXKICKSYNCCDM; + + +/* Bridge out structure for RGXKickSyncCDM */ +typedef struct PVRSRV_BRIDGE_OUT_RGXKICKSYNCCDM_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXKICKSYNCCDM; + +#endif /* COMMON_RGXCMP_BRIDGE_H */ diff --git a/drivers/gpu/rogue_m/generated/rgxcmp_bridge/server_rgxcmp_bridge.c b/drivers/gpu/rogue_m/generated/rgxcmp_bridge/server_rgxcmp_bridge.c new file mode 100644 index 000000000000..38a88ee94b33 --- /dev/null +++ b/drivers/gpu/rogue_m/generated/rgxcmp_bridge/server_rgxcmp_bridge.c @@ -0,0 +1,1060 @@ +/*************************************************************************/ /*! +@File +@Title Server bridge for rgxcmp +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Implements the server side of the bridge for rgxcmp +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#include +#include + +#include "img_defs.h" + +#include "rgxcompute.h" + + +#include "common_rgxcmp_bridge.h" + +#include "allocmem.h" +#include "pvr_debug.h" +#include "connection_server.h" +#include "pvr_bridge.h" +#include "rgx_bridge.h" +#include "srvcore.h" +#include "handle.h" + +#if defined (SUPPORT_AUTH) +#include "osauth.h" +#endif + +#include + + + + +/* *************************************************************************** + * Server-side bridge entry points + */ + +static IMG_INT +PVRSRVBridgeRGXCreateComputeContext(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_RGXCREATECOMPUTECONTEXT *psRGXCreateComputeContextIN, + PVRSRV_BRIDGE_OUT_RGXCREATECOMPUTECONTEXT *psRGXCreateComputeContextOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevNodeInt = IMG_NULL; + IMG_BYTE *psFrameworkCmdInt = IMG_NULL; + IMG_HANDLE hPrivDataInt = IMG_NULL; + RGX_SERVER_COMPUTE_CONTEXT * psComputeContextInt = IMG_NULL; + + + + + if (psRGXCreateComputeContextIN->ui32FrameworkCmdize != 0) + { + psFrameworkCmdInt = OSAllocMem(psRGXCreateComputeContextIN->ui32FrameworkCmdize * sizeof(IMG_BYTE)); + if (!psFrameworkCmdInt) + { + psRGXCreateComputeContextOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXCreateComputeContext_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXCreateComputeContextIN->psFrameworkCmd, psRGXCreateComputeContextIN->ui32FrameworkCmdize * sizeof(IMG_BYTE)) + || (OSCopyFromUser(NULL, psFrameworkCmdInt, psRGXCreateComputeContextIN->psFrameworkCmd, + psRGXCreateComputeContextIN->ui32FrameworkCmdize * sizeof(IMG_BYTE)) != PVRSRV_OK) ) + { + psRGXCreateComputeContextOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXCreateComputeContext_exit; + } + + + + { + /* Look up the address from the handle */ + psRGXCreateComputeContextOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &hDevNodeInt, + psRGXCreateComputeContextIN->hDevNode, + PVRSRV_HANDLE_TYPE_DEV_NODE); + if(psRGXCreateComputeContextOUT->eError != PVRSRV_OK) + { + goto RGXCreateComputeContext_exit; + } + } + + + { + /* Look up the address from the handle */ + psRGXCreateComputeContextOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &hPrivDataInt, + psRGXCreateComputeContextIN->hPrivData, + PVRSRV_HANDLE_TYPE_DEV_PRIV_DATA); + if(psRGXCreateComputeContextOUT->eError != PVRSRV_OK) + { + goto RGXCreateComputeContext_exit; + } + } + + + psRGXCreateComputeContextOUT->eError = + PVRSRVRGXCreateComputeContextKM(psConnection, + hDevNodeInt, + psRGXCreateComputeContextIN->ui32Priority, + psRGXCreateComputeContextIN->sMCUFenceAddr, + psRGXCreateComputeContextIN->ui32FrameworkCmdize, + psFrameworkCmdInt, + hPrivDataInt, + &psComputeContextInt); + /* Exit early if bridged call fails */ + if(psRGXCreateComputeContextOUT->eError != PVRSRV_OK) + { + goto RGXCreateComputeContext_exit; + } + + + psRGXCreateComputeContextOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psRGXCreateComputeContextOUT->hComputeContext, + (IMG_VOID *) psComputeContextInt, + PVRSRV_HANDLE_TYPE_RGX_SERVER_COMPUTE_CONTEXT, + PVRSRV_HANDLE_ALLOC_FLAG_MULTI + ,(PFN_HANDLE_RELEASE)&PVRSRVRGXDestroyComputeContextKM); + if (psRGXCreateComputeContextOUT->eError != PVRSRV_OK) + { + goto RGXCreateComputeContext_exit; + } + + + + +RGXCreateComputeContext_exit: + if (psRGXCreateComputeContextOUT->eError != PVRSRV_OK) + { + if (psComputeContextInt) + { + PVRSRVRGXDestroyComputeContextKM(psComputeContextInt); + } + } + + if (psFrameworkCmdInt) + OSFreeMem(psFrameworkCmdInt); + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXDestroyComputeContext(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_RGXDESTROYCOMPUTECONTEXT *psRGXDestroyComputeContextIN, + PVRSRV_BRIDGE_OUT_RGXDESTROYCOMPUTECONTEXT *psRGXDestroyComputeContextOUT, + CONNECTION_DATA *psConnection) +{ + + + + + + + + + + psRGXDestroyComputeContextOUT->eError = + PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psRGXDestroyComputeContextIN->hComputeContext, + PVRSRV_HANDLE_TYPE_RGX_SERVER_COMPUTE_CONTEXT); + if ((psRGXDestroyComputeContextOUT->eError != PVRSRV_OK) && (psRGXDestroyComputeContextOUT->eError != PVRSRV_ERROR_RETRY)) + { + PVR_ASSERT(0); + goto RGXDestroyComputeContext_exit; + } + + + +RGXDestroyComputeContext_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXKickCDM(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_RGXKICKCDM *psRGXKickCDMIN, + PVRSRV_BRIDGE_OUT_RGXKICKCDM *psRGXKickCDMOUT, + CONNECTION_DATA *psConnection) +{ + RGX_SERVER_COMPUTE_CONTEXT * psComputeContextInt = IMG_NULL; + SYNC_PRIMITIVE_BLOCK * *psClientFenceUFOSyncPrimBlockInt = IMG_NULL; + IMG_HANDLE *hClientFenceUFOSyncPrimBlockInt2 = IMG_NULL; + IMG_UINT32 *ui32ClientFenceOffsetInt = IMG_NULL; + IMG_UINT32 *ui32ClientFenceValueInt = IMG_NULL; + SYNC_PRIMITIVE_BLOCK * *psClientUpdateUFOSyncPrimBlockInt = IMG_NULL; + IMG_HANDLE *hClientUpdateUFOSyncPrimBlockInt2 = IMG_NULL; + IMG_UINT32 *ui32ClientUpdateOffsetInt = IMG_NULL; + IMG_UINT32 *ui32ClientUpdateValueInt = IMG_NULL; + IMG_UINT32 *ui32ServerSyncFlagsInt = IMG_NULL; + SERVER_SYNC_PRIMITIVE * *psServerSyncsInt = IMG_NULL; + IMG_HANDLE *hServerSyncsInt2 = IMG_NULL; + IMG_BYTE *psDMCmdInt = IMG_NULL; + + + + + if (psRGXKickCDMIN->ui32ClientFenceCount != 0) + { + psClientFenceUFOSyncPrimBlockInt = OSAllocMem(psRGXKickCDMIN->ui32ClientFenceCount * sizeof(SYNC_PRIMITIVE_BLOCK *)); + if (!psClientFenceUFOSyncPrimBlockInt) + { + psRGXKickCDMOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickCDM_exit; + } + hClientFenceUFOSyncPrimBlockInt2 = OSAllocMem(psRGXKickCDMIN->ui32ClientFenceCount * sizeof(IMG_HANDLE)); + if (!hClientFenceUFOSyncPrimBlockInt2) + { + psRGXKickCDMOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickCDM_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickCDMIN->phClientFenceUFOSyncPrimBlock, psRGXKickCDMIN->ui32ClientFenceCount * sizeof(IMG_HANDLE)) + || (OSCopyFromUser(NULL, hClientFenceUFOSyncPrimBlockInt2, psRGXKickCDMIN->phClientFenceUFOSyncPrimBlock, + psRGXKickCDMIN->ui32ClientFenceCount * sizeof(IMG_HANDLE)) != PVRSRV_OK) ) + { + psRGXKickCDMOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXKickCDM_exit; + } + if (psRGXKickCDMIN->ui32ClientFenceCount != 0) + { + ui32ClientFenceOffsetInt = OSAllocMem(psRGXKickCDMIN->ui32ClientFenceCount * sizeof(IMG_UINT32)); + if (!ui32ClientFenceOffsetInt) + { + psRGXKickCDMOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickCDM_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickCDMIN->pui32ClientFenceOffset, psRGXKickCDMIN->ui32ClientFenceCount * sizeof(IMG_UINT32)) + || (OSCopyFromUser(NULL, ui32ClientFenceOffsetInt, psRGXKickCDMIN->pui32ClientFenceOffset, + psRGXKickCDMIN->ui32ClientFenceCount * sizeof(IMG_UINT32)) != PVRSRV_OK) ) + { + psRGXKickCDMOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXKickCDM_exit; + } + if (psRGXKickCDMIN->ui32ClientFenceCount != 0) + { + ui32ClientFenceValueInt = OSAllocMem(psRGXKickCDMIN->ui32ClientFenceCount * sizeof(IMG_UINT32)); + if (!ui32ClientFenceValueInt) + { + psRGXKickCDMOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickCDM_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickCDMIN->pui32ClientFenceValue, psRGXKickCDMIN->ui32ClientFenceCount * sizeof(IMG_UINT32)) + || (OSCopyFromUser(NULL, ui32ClientFenceValueInt, psRGXKickCDMIN->pui32ClientFenceValue, + psRGXKickCDMIN->ui32ClientFenceCount * sizeof(IMG_UINT32)) != PVRSRV_OK) ) + { + psRGXKickCDMOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXKickCDM_exit; + } + if (psRGXKickCDMIN->ui32ClientUpdateCount != 0) + { + psClientUpdateUFOSyncPrimBlockInt = OSAllocMem(psRGXKickCDMIN->ui32ClientUpdateCount * sizeof(SYNC_PRIMITIVE_BLOCK *)); + if (!psClientUpdateUFOSyncPrimBlockInt) + { + psRGXKickCDMOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickCDM_exit; + } + hClientUpdateUFOSyncPrimBlockInt2 = OSAllocMem(psRGXKickCDMIN->ui32ClientUpdateCount * sizeof(IMG_HANDLE)); + if (!hClientUpdateUFOSyncPrimBlockInt2) + { + psRGXKickCDMOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickCDM_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickCDMIN->phClientUpdateUFOSyncPrimBlock, psRGXKickCDMIN->ui32ClientUpdateCount * sizeof(IMG_HANDLE)) + || (OSCopyFromUser(NULL, hClientUpdateUFOSyncPrimBlockInt2, psRGXKickCDMIN->phClientUpdateUFOSyncPrimBlock, + psRGXKickCDMIN->ui32ClientUpdateCount * sizeof(IMG_HANDLE)) != PVRSRV_OK) ) + { + psRGXKickCDMOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXKickCDM_exit; + } + if (psRGXKickCDMIN->ui32ClientUpdateCount != 0) + { + ui32ClientUpdateOffsetInt = OSAllocMem(psRGXKickCDMIN->ui32ClientUpdateCount * sizeof(IMG_UINT32)); + if (!ui32ClientUpdateOffsetInt) + { + psRGXKickCDMOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickCDM_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickCDMIN->pui32ClientUpdateOffset, psRGXKickCDMIN->ui32ClientUpdateCount * sizeof(IMG_UINT32)) + || (OSCopyFromUser(NULL, ui32ClientUpdateOffsetInt, psRGXKickCDMIN->pui32ClientUpdateOffset, + psRGXKickCDMIN->ui32ClientUpdateCount * sizeof(IMG_UINT32)) != PVRSRV_OK) ) + { + psRGXKickCDMOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXKickCDM_exit; + } + if (psRGXKickCDMIN->ui32ClientUpdateCount != 0) + { + ui32ClientUpdateValueInt = OSAllocMem(psRGXKickCDMIN->ui32ClientUpdateCount * sizeof(IMG_UINT32)); + if (!ui32ClientUpdateValueInt) + { + psRGXKickCDMOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickCDM_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickCDMIN->pui32ClientUpdateValue, psRGXKickCDMIN->ui32ClientUpdateCount * sizeof(IMG_UINT32)) + || (OSCopyFromUser(NULL, ui32ClientUpdateValueInt, psRGXKickCDMIN->pui32ClientUpdateValue, + psRGXKickCDMIN->ui32ClientUpdateCount * sizeof(IMG_UINT32)) != PVRSRV_OK) ) + { + psRGXKickCDMOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXKickCDM_exit; + } + if (psRGXKickCDMIN->ui32ServerSyncCount != 0) + { + ui32ServerSyncFlagsInt = OSAllocMem(psRGXKickCDMIN->ui32ServerSyncCount * sizeof(IMG_UINT32)); + if (!ui32ServerSyncFlagsInt) + { + psRGXKickCDMOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickCDM_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickCDMIN->pui32ServerSyncFlags, psRGXKickCDMIN->ui32ServerSyncCount * sizeof(IMG_UINT32)) + || (OSCopyFromUser(NULL, ui32ServerSyncFlagsInt, psRGXKickCDMIN->pui32ServerSyncFlags, + psRGXKickCDMIN->ui32ServerSyncCount * sizeof(IMG_UINT32)) != PVRSRV_OK) ) + { + psRGXKickCDMOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXKickCDM_exit; + } + if (psRGXKickCDMIN->ui32ServerSyncCount != 0) + { + psServerSyncsInt = OSAllocMem(psRGXKickCDMIN->ui32ServerSyncCount * sizeof(SERVER_SYNC_PRIMITIVE *)); + if (!psServerSyncsInt) + { + psRGXKickCDMOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickCDM_exit; + } + hServerSyncsInt2 = OSAllocMem(psRGXKickCDMIN->ui32ServerSyncCount * sizeof(IMG_HANDLE)); + if (!hServerSyncsInt2) + { + psRGXKickCDMOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickCDM_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickCDMIN->phServerSyncs, psRGXKickCDMIN->ui32ServerSyncCount * sizeof(IMG_HANDLE)) + || (OSCopyFromUser(NULL, hServerSyncsInt2, psRGXKickCDMIN->phServerSyncs, + psRGXKickCDMIN->ui32ServerSyncCount * sizeof(IMG_HANDLE)) != PVRSRV_OK) ) + { + psRGXKickCDMOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXKickCDM_exit; + } + if (psRGXKickCDMIN->ui32CmdSize != 0) + { + psDMCmdInt = OSAllocMem(psRGXKickCDMIN->ui32CmdSize * sizeof(IMG_BYTE)); + if (!psDMCmdInt) + { + psRGXKickCDMOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickCDM_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickCDMIN->psDMCmd, psRGXKickCDMIN->ui32CmdSize * sizeof(IMG_BYTE)) + || (OSCopyFromUser(NULL, psDMCmdInt, psRGXKickCDMIN->psDMCmd, + psRGXKickCDMIN->ui32CmdSize * sizeof(IMG_BYTE)) != PVRSRV_OK) ) + { + psRGXKickCDMOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXKickCDM_exit; + } + + + + { + /* Look up the address from the handle */ + psRGXKickCDMOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psComputeContextInt, + psRGXKickCDMIN->hComputeContext, + PVRSRV_HANDLE_TYPE_RGX_SERVER_COMPUTE_CONTEXT); + if(psRGXKickCDMOUT->eError != PVRSRV_OK) + { + goto RGXKickCDM_exit; + } + } + + + { + IMG_UINT32 i; + + for (i=0;iui32ClientFenceCount;i++) + { + { + /* Look up the address from the handle */ + psRGXKickCDMOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psClientFenceUFOSyncPrimBlockInt[i], + hClientFenceUFOSyncPrimBlockInt2[i], + PVRSRV_HANDLE_TYPE_SYNC_PRIMITIVE_BLOCK); + if(psRGXKickCDMOUT->eError != PVRSRV_OK) + { + goto RGXKickCDM_exit; + } + } + + } + } + + { + IMG_UINT32 i; + + for (i=0;iui32ClientUpdateCount;i++) + { + { + /* Look up the address from the handle */ + psRGXKickCDMOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psClientUpdateUFOSyncPrimBlockInt[i], + hClientUpdateUFOSyncPrimBlockInt2[i], + PVRSRV_HANDLE_TYPE_SYNC_PRIMITIVE_BLOCK); + if(psRGXKickCDMOUT->eError != PVRSRV_OK) + { + goto RGXKickCDM_exit; + } + } + + } + } + + { + IMG_UINT32 i; + + for (i=0;iui32ServerSyncCount;i++) + { + { + /* Look up the address from the handle */ + psRGXKickCDMOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psServerSyncsInt[i], + hServerSyncsInt2[i], + PVRSRV_HANDLE_TYPE_SERVER_SYNC_PRIMITIVE); + if(psRGXKickCDMOUT->eError != PVRSRV_OK) + { + goto RGXKickCDM_exit; + } + } + + } + } + + psRGXKickCDMOUT->eError = + PVRSRVRGXKickCDMKM( + psComputeContextInt, + psRGXKickCDMIN->ui32ClientFenceCount, + psClientFenceUFOSyncPrimBlockInt, + ui32ClientFenceOffsetInt, + ui32ClientFenceValueInt, + psRGXKickCDMIN->ui32ClientUpdateCount, + psClientUpdateUFOSyncPrimBlockInt, + ui32ClientUpdateOffsetInt, + ui32ClientUpdateValueInt, + psRGXKickCDMIN->ui32ServerSyncCount, + ui32ServerSyncFlagsInt, + psServerSyncsInt, + psRGXKickCDMIN->ui32CmdSize, + psDMCmdInt, + psRGXKickCDMIN->bbPDumpContinuous, + psRGXKickCDMIN->ui32ExternalJobReference, + psRGXKickCDMIN->ui32InternalJobReference); + + + + +RGXKickCDM_exit: + if (psClientFenceUFOSyncPrimBlockInt) + OSFreeMem(psClientFenceUFOSyncPrimBlockInt); + if (hClientFenceUFOSyncPrimBlockInt2) + OSFreeMem(hClientFenceUFOSyncPrimBlockInt2); + if (ui32ClientFenceOffsetInt) + OSFreeMem(ui32ClientFenceOffsetInt); + if (ui32ClientFenceValueInt) + OSFreeMem(ui32ClientFenceValueInt); + if (psClientUpdateUFOSyncPrimBlockInt) + OSFreeMem(psClientUpdateUFOSyncPrimBlockInt); + if (hClientUpdateUFOSyncPrimBlockInt2) + OSFreeMem(hClientUpdateUFOSyncPrimBlockInt2); + if (ui32ClientUpdateOffsetInt) + OSFreeMem(ui32ClientUpdateOffsetInt); + if (ui32ClientUpdateValueInt) + OSFreeMem(ui32ClientUpdateValueInt); + if (ui32ServerSyncFlagsInt) + OSFreeMem(ui32ServerSyncFlagsInt); + if (psServerSyncsInt) + OSFreeMem(psServerSyncsInt); + if (hServerSyncsInt2) + OSFreeMem(hServerSyncsInt2); + if (psDMCmdInt) + OSFreeMem(psDMCmdInt); + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXFlushComputeData(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_RGXFLUSHCOMPUTEDATA *psRGXFlushComputeDataIN, + PVRSRV_BRIDGE_OUT_RGXFLUSHCOMPUTEDATA *psRGXFlushComputeDataOUT, + CONNECTION_DATA *psConnection) +{ + RGX_SERVER_COMPUTE_CONTEXT * psComputeContextInt = IMG_NULL; + + + + + + + + { + /* Look up the address from the handle */ + psRGXFlushComputeDataOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psComputeContextInt, + psRGXFlushComputeDataIN->hComputeContext, + PVRSRV_HANDLE_TYPE_RGX_SERVER_COMPUTE_CONTEXT); + if(psRGXFlushComputeDataOUT->eError != PVRSRV_OK) + { + goto RGXFlushComputeData_exit; + } + } + + + psRGXFlushComputeDataOUT->eError = + PVRSRVRGXFlushComputeDataKM( + psComputeContextInt); + + + + +RGXFlushComputeData_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXSetComputeContextPriority(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_RGXSETCOMPUTECONTEXTPRIORITY *psRGXSetComputeContextPriorityIN, + PVRSRV_BRIDGE_OUT_RGXSETCOMPUTECONTEXTPRIORITY *psRGXSetComputeContextPriorityOUT, + CONNECTION_DATA *psConnection) +{ + RGX_SERVER_COMPUTE_CONTEXT * psComputeContextInt = IMG_NULL; + + + + + + + + { + /* Look up the address from the handle */ + psRGXSetComputeContextPriorityOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psComputeContextInt, + psRGXSetComputeContextPriorityIN->hComputeContext, + PVRSRV_HANDLE_TYPE_RGX_SERVER_COMPUTE_CONTEXT); + if(psRGXSetComputeContextPriorityOUT->eError != PVRSRV_OK) + { + goto RGXSetComputeContextPriority_exit; + } + } + + + psRGXSetComputeContextPriorityOUT->eError = + PVRSRVRGXSetComputeContextPriorityKM(psConnection, + psComputeContextInt, + psRGXSetComputeContextPriorityIN->ui32Priority); + + + + +RGXSetComputeContextPriority_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXKickSyncCDM(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_RGXKICKSYNCCDM *psRGXKickSyncCDMIN, + PVRSRV_BRIDGE_OUT_RGXKICKSYNCCDM *psRGXKickSyncCDMOUT, + CONNECTION_DATA *psConnection) +{ + RGX_SERVER_COMPUTE_CONTEXT * psComputeContextInt = IMG_NULL; + SYNC_PRIMITIVE_BLOCK * *psClientFenceUFOSyncPrimBlockInt = IMG_NULL; + IMG_HANDLE *hClientFenceUFOSyncPrimBlockInt2 = IMG_NULL; + IMG_UINT32 *ui32ClientFenceOffsetInt = IMG_NULL; + IMG_UINT32 *ui32ClientFenceValueInt = IMG_NULL; + SYNC_PRIMITIVE_BLOCK * *psClientUpdateUFOSyncPrimBlockInt = IMG_NULL; + IMG_HANDLE *hClientUpdateUFOSyncPrimBlockInt2 = IMG_NULL; + IMG_UINT32 *ui32ClientUpdateOffsetInt = IMG_NULL; + IMG_UINT32 *ui32ClientUpdateValueInt = IMG_NULL; + IMG_UINT32 *ui32ServerSyncFlagsInt = IMG_NULL; + SERVER_SYNC_PRIMITIVE * *psServerSyncsInt = IMG_NULL; + IMG_HANDLE *hServerSyncsInt2 = IMG_NULL; + IMG_INT32 *i32CheckFenceFDsInt = IMG_NULL; + + + + + if (psRGXKickSyncCDMIN->ui32ClientFenceCount != 0) + { + psClientFenceUFOSyncPrimBlockInt = OSAllocMem(psRGXKickSyncCDMIN->ui32ClientFenceCount * sizeof(SYNC_PRIMITIVE_BLOCK *)); + if (!psClientFenceUFOSyncPrimBlockInt) + { + psRGXKickSyncCDMOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickSyncCDM_exit; + } + hClientFenceUFOSyncPrimBlockInt2 = OSAllocMem(psRGXKickSyncCDMIN->ui32ClientFenceCount * sizeof(IMG_HANDLE)); + if (!hClientFenceUFOSyncPrimBlockInt2) + { + psRGXKickSyncCDMOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickSyncCDM_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickSyncCDMIN->phClientFenceUFOSyncPrimBlock, psRGXKickSyncCDMIN->ui32ClientFenceCount * sizeof(IMG_HANDLE)) + || (OSCopyFromUser(NULL, hClientFenceUFOSyncPrimBlockInt2, psRGXKickSyncCDMIN->phClientFenceUFOSyncPrimBlock, + psRGXKickSyncCDMIN->ui32ClientFenceCount * sizeof(IMG_HANDLE)) != PVRSRV_OK) ) + { + psRGXKickSyncCDMOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXKickSyncCDM_exit; + } + if (psRGXKickSyncCDMIN->ui32ClientFenceCount != 0) + { + ui32ClientFenceOffsetInt = OSAllocMem(psRGXKickSyncCDMIN->ui32ClientFenceCount * sizeof(IMG_UINT32)); + if (!ui32ClientFenceOffsetInt) + { + psRGXKickSyncCDMOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickSyncCDM_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickSyncCDMIN->pui32ClientFenceOffset, psRGXKickSyncCDMIN->ui32ClientFenceCount * sizeof(IMG_UINT32)) + || (OSCopyFromUser(NULL, ui32ClientFenceOffsetInt, psRGXKickSyncCDMIN->pui32ClientFenceOffset, + psRGXKickSyncCDMIN->ui32ClientFenceCount * sizeof(IMG_UINT32)) != PVRSRV_OK) ) + { + psRGXKickSyncCDMOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXKickSyncCDM_exit; + } + if (psRGXKickSyncCDMIN->ui32ClientFenceCount != 0) + { + ui32ClientFenceValueInt = OSAllocMem(psRGXKickSyncCDMIN->ui32ClientFenceCount * sizeof(IMG_UINT32)); + if (!ui32ClientFenceValueInt) + { + psRGXKickSyncCDMOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickSyncCDM_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickSyncCDMIN->pui32ClientFenceValue, psRGXKickSyncCDMIN->ui32ClientFenceCount * sizeof(IMG_UINT32)) + || (OSCopyFromUser(NULL, ui32ClientFenceValueInt, psRGXKickSyncCDMIN->pui32ClientFenceValue, + psRGXKickSyncCDMIN->ui32ClientFenceCount * sizeof(IMG_UINT32)) != PVRSRV_OK) ) + { + psRGXKickSyncCDMOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXKickSyncCDM_exit; + } + if (psRGXKickSyncCDMIN->ui32ClientUpdateCount != 0) + { + psClientUpdateUFOSyncPrimBlockInt = OSAllocMem(psRGXKickSyncCDMIN->ui32ClientUpdateCount * sizeof(SYNC_PRIMITIVE_BLOCK *)); + if (!psClientUpdateUFOSyncPrimBlockInt) + { + psRGXKickSyncCDMOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickSyncCDM_exit; + } + hClientUpdateUFOSyncPrimBlockInt2 = OSAllocMem(psRGXKickSyncCDMIN->ui32ClientUpdateCount * sizeof(IMG_HANDLE)); + if (!hClientUpdateUFOSyncPrimBlockInt2) + { + psRGXKickSyncCDMOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickSyncCDM_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickSyncCDMIN->phClientUpdateUFOSyncPrimBlock, psRGXKickSyncCDMIN->ui32ClientUpdateCount * sizeof(IMG_HANDLE)) + || (OSCopyFromUser(NULL, hClientUpdateUFOSyncPrimBlockInt2, psRGXKickSyncCDMIN->phClientUpdateUFOSyncPrimBlock, + psRGXKickSyncCDMIN->ui32ClientUpdateCount * sizeof(IMG_HANDLE)) != PVRSRV_OK) ) + { + psRGXKickSyncCDMOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXKickSyncCDM_exit; + } + if (psRGXKickSyncCDMIN->ui32ClientUpdateCount != 0) + { + ui32ClientUpdateOffsetInt = OSAllocMem(psRGXKickSyncCDMIN->ui32ClientUpdateCount * sizeof(IMG_UINT32)); + if (!ui32ClientUpdateOffsetInt) + { + psRGXKickSyncCDMOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickSyncCDM_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickSyncCDMIN->pui32ClientUpdateOffset, psRGXKickSyncCDMIN->ui32ClientUpdateCount * sizeof(IMG_UINT32)) + || (OSCopyFromUser(NULL, ui32ClientUpdateOffsetInt, psRGXKickSyncCDMIN->pui32ClientUpdateOffset, + psRGXKickSyncCDMIN->ui32ClientUpdateCount * sizeof(IMG_UINT32)) != PVRSRV_OK) ) + { + psRGXKickSyncCDMOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXKickSyncCDM_exit; + } + if (psRGXKickSyncCDMIN->ui32ClientUpdateCount != 0) + { + ui32ClientUpdateValueInt = OSAllocMem(psRGXKickSyncCDMIN->ui32ClientUpdateCount * sizeof(IMG_UINT32)); + if (!ui32ClientUpdateValueInt) + { + psRGXKickSyncCDMOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickSyncCDM_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickSyncCDMIN->pui32ClientUpdateValue, psRGXKickSyncCDMIN->ui32ClientUpdateCount * sizeof(IMG_UINT32)) + || (OSCopyFromUser(NULL, ui32ClientUpdateValueInt, psRGXKickSyncCDMIN->pui32ClientUpdateValue, + psRGXKickSyncCDMIN->ui32ClientUpdateCount * sizeof(IMG_UINT32)) != PVRSRV_OK) ) + { + psRGXKickSyncCDMOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXKickSyncCDM_exit; + } + if (psRGXKickSyncCDMIN->ui32ServerSyncCount != 0) + { + ui32ServerSyncFlagsInt = OSAllocMem(psRGXKickSyncCDMIN->ui32ServerSyncCount * sizeof(IMG_UINT32)); + if (!ui32ServerSyncFlagsInt) + { + psRGXKickSyncCDMOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickSyncCDM_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickSyncCDMIN->pui32ServerSyncFlags, psRGXKickSyncCDMIN->ui32ServerSyncCount * sizeof(IMG_UINT32)) + || (OSCopyFromUser(NULL, ui32ServerSyncFlagsInt, psRGXKickSyncCDMIN->pui32ServerSyncFlags, + psRGXKickSyncCDMIN->ui32ServerSyncCount * sizeof(IMG_UINT32)) != PVRSRV_OK) ) + { + psRGXKickSyncCDMOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXKickSyncCDM_exit; + } + if (psRGXKickSyncCDMIN->ui32ServerSyncCount != 0) + { + psServerSyncsInt = OSAllocMem(psRGXKickSyncCDMIN->ui32ServerSyncCount * sizeof(SERVER_SYNC_PRIMITIVE *)); + if (!psServerSyncsInt) + { + psRGXKickSyncCDMOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickSyncCDM_exit; + } + hServerSyncsInt2 = OSAllocMem(psRGXKickSyncCDMIN->ui32ServerSyncCount * sizeof(IMG_HANDLE)); + if (!hServerSyncsInt2) + { + psRGXKickSyncCDMOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickSyncCDM_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickSyncCDMIN->phServerSyncs, psRGXKickSyncCDMIN->ui32ServerSyncCount * sizeof(IMG_HANDLE)) + || (OSCopyFromUser(NULL, hServerSyncsInt2, psRGXKickSyncCDMIN->phServerSyncs, + psRGXKickSyncCDMIN->ui32ServerSyncCount * sizeof(IMG_HANDLE)) != PVRSRV_OK) ) + { + psRGXKickSyncCDMOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXKickSyncCDM_exit; + } + if (psRGXKickSyncCDMIN->ui32NumCheckFenceFDs != 0) + { + i32CheckFenceFDsInt = OSAllocMem(psRGXKickSyncCDMIN->ui32NumCheckFenceFDs * sizeof(IMG_INT32)); + if (!i32CheckFenceFDsInt) + { + psRGXKickSyncCDMOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickSyncCDM_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickSyncCDMIN->pi32CheckFenceFDs, psRGXKickSyncCDMIN->ui32NumCheckFenceFDs * sizeof(IMG_INT32)) + || (OSCopyFromUser(NULL, i32CheckFenceFDsInt, psRGXKickSyncCDMIN->pi32CheckFenceFDs, + psRGXKickSyncCDMIN->ui32NumCheckFenceFDs * sizeof(IMG_INT32)) != PVRSRV_OK) ) + { + psRGXKickSyncCDMOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXKickSyncCDM_exit; + } + + + + { + /* Look up the address from the handle */ + psRGXKickSyncCDMOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psComputeContextInt, + psRGXKickSyncCDMIN->hComputeContext, + PVRSRV_HANDLE_TYPE_RGX_SERVER_COMPUTE_CONTEXT); + if(psRGXKickSyncCDMOUT->eError != PVRSRV_OK) + { + goto RGXKickSyncCDM_exit; + } + } + + + { + IMG_UINT32 i; + + for (i=0;iui32ClientFenceCount;i++) + { + { + /* Look up the address from the handle */ + psRGXKickSyncCDMOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psClientFenceUFOSyncPrimBlockInt[i], + hClientFenceUFOSyncPrimBlockInt2[i], + PVRSRV_HANDLE_TYPE_SYNC_PRIMITIVE_BLOCK); + if(psRGXKickSyncCDMOUT->eError != PVRSRV_OK) + { + goto RGXKickSyncCDM_exit; + } + } + + } + } + + { + IMG_UINT32 i; + + for (i=0;iui32ClientUpdateCount;i++) + { + { + /* Look up the address from the handle */ + psRGXKickSyncCDMOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psClientUpdateUFOSyncPrimBlockInt[i], + hClientUpdateUFOSyncPrimBlockInt2[i], + PVRSRV_HANDLE_TYPE_SYNC_PRIMITIVE_BLOCK); + if(psRGXKickSyncCDMOUT->eError != PVRSRV_OK) + { + goto RGXKickSyncCDM_exit; + } + } + + } + } + + { + IMG_UINT32 i; + + for (i=0;iui32ServerSyncCount;i++) + { + { + /* Look up the address from the handle */ + psRGXKickSyncCDMOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psServerSyncsInt[i], + hServerSyncsInt2[i], + PVRSRV_HANDLE_TYPE_SERVER_SYNC_PRIMITIVE); + if(psRGXKickSyncCDMOUT->eError != PVRSRV_OK) + { + goto RGXKickSyncCDM_exit; + } + } + + } + } + + psRGXKickSyncCDMOUT->eError = + PVRSRVRGXKickSyncCDMKM( + psComputeContextInt, + psRGXKickSyncCDMIN->ui32ClientFenceCount, + psClientFenceUFOSyncPrimBlockInt, + ui32ClientFenceOffsetInt, + ui32ClientFenceValueInt, + psRGXKickSyncCDMIN->ui32ClientUpdateCount, + psClientUpdateUFOSyncPrimBlockInt, + ui32ClientUpdateOffsetInt, + ui32ClientUpdateValueInt, + psRGXKickSyncCDMIN->ui32ServerSyncCount, + ui32ServerSyncFlagsInt, + psServerSyncsInt, + psRGXKickSyncCDMIN->ui32NumCheckFenceFDs, + i32CheckFenceFDsInt, + psRGXKickSyncCDMIN->i32UpdateFenceFD, + psRGXKickSyncCDMIN->bbPDumpContinuous); + + + + +RGXKickSyncCDM_exit: + if (psClientFenceUFOSyncPrimBlockInt) + OSFreeMem(psClientFenceUFOSyncPrimBlockInt); + if (hClientFenceUFOSyncPrimBlockInt2) + OSFreeMem(hClientFenceUFOSyncPrimBlockInt2); + if (ui32ClientFenceOffsetInt) + OSFreeMem(ui32ClientFenceOffsetInt); + if (ui32ClientFenceValueInt) + OSFreeMem(ui32ClientFenceValueInt); + if (psClientUpdateUFOSyncPrimBlockInt) + OSFreeMem(psClientUpdateUFOSyncPrimBlockInt); + if (hClientUpdateUFOSyncPrimBlockInt2) + OSFreeMem(hClientUpdateUFOSyncPrimBlockInt2); + if (ui32ClientUpdateOffsetInt) + OSFreeMem(ui32ClientUpdateOffsetInt); + if (ui32ClientUpdateValueInt) + OSFreeMem(ui32ClientUpdateValueInt); + if (ui32ServerSyncFlagsInt) + OSFreeMem(ui32ServerSyncFlagsInt); + if (psServerSyncsInt) + OSFreeMem(psServerSyncsInt); + if (hServerSyncsInt2) + OSFreeMem(hServerSyncsInt2); + if (i32CheckFenceFDsInt) + OSFreeMem(i32CheckFenceFDsInt); + + return 0; +} + + + +/* *************************************************************************** + * Server bridge dispatch related glue + */ + + +PVRSRV_ERROR InitRGXCMPBridge(IMG_VOID); +PVRSRV_ERROR DeinitRGXCMPBridge(IMG_VOID); + +/* + * Register all RGXCMP functions with services + */ +PVRSRV_ERROR InitRGXCMPBridge(IMG_VOID) +{ + + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXCMP, PVRSRV_BRIDGE_RGXCMP_RGXCREATECOMPUTECONTEXT, PVRSRVBridgeRGXCreateComputeContext, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXCMP, PVRSRV_BRIDGE_RGXCMP_RGXDESTROYCOMPUTECONTEXT, PVRSRVBridgeRGXDestroyComputeContext, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXCMP, PVRSRV_BRIDGE_RGXCMP_RGXKICKCDM, PVRSRVBridgeRGXKickCDM, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXCMP, PVRSRV_BRIDGE_RGXCMP_RGXFLUSHCOMPUTEDATA, PVRSRVBridgeRGXFlushComputeData, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXCMP, PVRSRV_BRIDGE_RGXCMP_RGXSETCOMPUTECONTEXTPRIORITY, PVRSRVBridgeRGXSetComputeContextPriority, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXCMP, PVRSRV_BRIDGE_RGXCMP_RGXKICKSYNCCDM, PVRSRVBridgeRGXKickSyncCDM, + IMG_NULL, IMG_NULL, + 0, 0); + + + return PVRSRV_OK; +} + +/* + * Unregister all rgxcmp functions with services + */ +PVRSRV_ERROR DeinitRGXCMPBridge(IMG_VOID) +{ + return PVRSRV_OK; +} + diff --git a/drivers/gpu/rogue_m/generated/rgxhwperf_bridge/common_rgxhwperf_bridge.h b/drivers/gpu/rogue_m/generated/rgxhwperf_bridge/common_rgxhwperf_bridge.h new file mode 100644 index 000000000000..7e13a6130509 --- /dev/null +++ b/drivers/gpu/rogue_m/generated/rgxhwperf_bridge/common_rgxhwperf_bridge.h @@ -0,0 +1,141 @@ +/*************************************************************************/ /*! +@File +@Title Common bridge header for rgxhwperf +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Declares common defines and structures that are used by both + the client and sever side of the bridge for rgxhwperf +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef COMMON_RGXHWPERF_BRIDGE_H +#define COMMON_RGXHWPERF_BRIDGE_H + +#include "img_types.h" +#include "pvrsrv_error.h" + +#include "rgx_bridge.h" +#include "rgx_hwperf_km.h" + + +#define PVRSRV_BRIDGE_RGXHWPERF_CMD_FIRST 0 +#define PVRSRV_BRIDGE_RGXHWPERF_RGXCTRLHWPERF PVRSRV_BRIDGE_RGXHWPERF_CMD_FIRST+0 +#define PVRSRV_BRIDGE_RGXHWPERF_RGXCONFIGENABLEHWPERFCOUNTERS PVRSRV_BRIDGE_RGXHWPERF_CMD_FIRST+1 +#define PVRSRV_BRIDGE_RGXHWPERF_RGXCTRLHWPERFCOUNTERS PVRSRV_BRIDGE_RGXHWPERF_CMD_FIRST+2 +#define PVRSRV_BRIDGE_RGXHWPERF_RGXCONFIGCUSTOMCOUNTERS PVRSRV_BRIDGE_RGXHWPERF_CMD_FIRST+3 +#define PVRSRV_BRIDGE_RGXHWPERF_CMD_LAST (PVRSRV_BRIDGE_RGXHWPERF_CMD_FIRST+3) + + +/******************************************* + RGXCtrlHWPerf + *******************************************/ + +/* Bridge in structure for RGXCtrlHWPerf */ +typedef struct PVRSRV_BRIDGE_IN_RGXCTRLHWPERF_TAG +{ + IMG_HANDLE hDevNode; + IMG_BOOL bToggle; + IMG_UINT64 ui64Mask; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXCTRLHWPERF; + + +/* Bridge out structure for RGXCtrlHWPerf */ +typedef struct PVRSRV_BRIDGE_OUT_RGXCTRLHWPERF_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXCTRLHWPERF; + +/******************************************* + RGXConfigEnableHWPerfCounters + *******************************************/ + +/* Bridge in structure for RGXConfigEnableHWPerfCounters */ +typedef struct PVRSRV_BRIDGE_IN_RGXCONFIGENABLEHWPERFCOUNTERS_TAG +{ + IMG_HANDLE hDevNode; + IMG_UINT32 ui32ArrayLen; + RGX_HWPERF_CONFIG_CNTBLK * psBlockConfigs; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXCONFIGENABLEHWPERFCOUNTERS; + + +/* Bridge out structure for RGXConfigEnableHWPerfCounters */ +typedef struct PVRSRV_BRIDGE_OUT_RGXCONFIGENABLEHWPERFCOUNTERS_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXCONFIGENABLEHWPERFCOUNTERS; + +/******************************************* + RGXCtrlHWPerfCounters + *******************************************/ + +/* Bridge in structure for RGXCtrlHWPerfCounters */ +typedef struct PVRSRV_BRIDGE_IN_RGXCTRLHWPERFCOUNTERS_TAG +{ + IMG_HANDLE hDevNode; + IMG_BOOL bEnable; + IMG_UINT32 ui32ArrayLen; + IMG_UINT16 * pui16BlockIDs; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXCTRLHWPERFCOUNTERS; + + +/* Bridge out structure for RGXCtrlHWPerfCounters */ +typedef struct PVRSRV_BRIDGE_OUT_RGXCTRLHWPERFCOUNTERS_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXCTRLHWPERFCOUNTERS; + +/******************************************* + RGXConfigCustomCounters + *******************************************/ + +/* Bridge in structure for RGXConfigCustomCounters */ +typedef struct PVRSRV_BRIDGE_IN_RGXCONFIGCUSTOMCOUNTERS_TAG +{ + IMG_HANDLE hDevNode; + IMG_UINT16 ui16CustomBlockID; + IMG_UINT16 ui16NumCustomCounters; + IMG_UINT32 * pui32CustomCounterIDs; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXCONFIGCUSTOMCOUNTERS; + + +/* Bridge out structure for RGXConfigCustomCounters */ +typedef struct PVRSRV_BRIDGE_OUT_RGXCONFIGCUSTOMCOUNTERS_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXCONFIGCUSTOMCOUNTERS; + +#endif /* COMMON_RGXHWPERF_BRIDGE_H */ diff --git a/drivers/gpu/rogue_m/generated/rgxhwperf_bridge/server_rgxhwperf_bridge.c b/drivers/gpu/rogue_m/generated/rgxhwperf_bridge/server_rgxhwperf_bridge.c new file mode 100644 index 000000000000..1639e9b831ff --- /dev/null +++ b/drivers/gpu/rogue_m/generated/rgxhwperf_bridge/server_rgxhwperf_bridge.c @@ -0,0 +1,357 @@ +/*************************************************************************/ /*! +@File +@Title Server bridge for rgxhwperf +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Implements the server side of the bridge for rgxhwperf +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#include +#include + +#include "img_defs.h" + +#include "rgxhwperf.h" + + +#include "common_rgxhwperf_bridge.h" + +#include "allocmem.h" +#include "pvr_debug.h" +#include "connection_server.h" +#include "pvr_bridge.h" +#include "rgx_bridge.h" +#include "srvcore.h" +#include "handle.h" + +#if defined (SUPPORT_AUTH) +#include "osauth.h" +#endif + +#include + + + + +/* *************************************************************************** + * Server-side bridge entry points + */ + +static IMG_INT +PVRSRVBridgeRGXCtrlHWPerf(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_RGXCTRLHWPERF *psRGXCtrlHWPerfIN, + PVRSRV_BRIDGE_OUT_RGXCTRLHWPERF *psRGXCtrlHWPerfOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevNodeInt = IMG_NULL; + + + + + + + + { + /* Look up the address from the handle */ + psRGXCtrlHWPerfOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &hDevNodeInt, + psRGXCtrlHWPerfIN->hDevNode, + PVRSRV_HANDLE_TYPE_DEV_NODE); + if(psRGXCtrlHWPerfOUT->eError != PVRSRV_OK) + { + goto RGXCtrlHWPerf_exit; + } + } + + + psRGXCtrlHWPerfOUT->eError = + PVRSRVRGXCtrlHWPerfKM( + hDevNodeInt, + psRGXCtrlHWPerfIN->bToggle, + psRGXCtrlHWPerfIN->ui64Mask); + + + + +RGXCtrlHWPerf_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXConfigEnableHWPerfCounters(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_RGXCONFIGENABLEHWPERFCOUNTERS *psRGXConfigEnableHWPerfCountersIN, + PVRSRV_BRIDGE_OUT_RGXCONFIGENABLEHWPERFCOUNTERS *psRGXConfigEnableHWPerfCountersOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevNodeInt = IMG_NULL; + RGX_HWPERF_CONFIG_CNTBLK *psBlockConfigsInt = IMG_NULL; + + + + + if (psRGXConfigEnableHWPerfCountersIN->ui32ArrayLen != 0) + { + psBlockConfigsInt = OSAllocMem(psRGXConfigEnableHWPerfCountersIN->ui32ArrayLen * sizeof(RGX_HWPERF_CONFIG_CNTBLK)); + if (!psBlockConfigsInt) + { + psRGXConfigEnableHWPerfCountersOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXConfigEnableHWPerfCounters_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXConfigEnableHWPerfCountersIN->psBlockConfigs, psRGXConfigEnableHWPerfCountersIN->ui32ArrayLen * sizeof(RGX_HWPERF_CONFIG_CNTBLK)) + || (OSCopyFromUser(NULL, psBlockConfigsInt, psRGXConfigEnableHWPerfCountersIN->psBlockConfigs, + psRGXConfigEnableHWPerfCountersIN->ui32ArrayLen * sizeof(RGX_HWPERF_CONFIG_CNTBLK)) != PVRSRV_OK) ) + { + psRGXConfigEnableHWPerfCountersOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXConfigEnableHWPerfCounters_exit; + } + + + + { + /* Look up the address from the handle */ + psRGXConfigEnableHWPerfCountersOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &hDevNodeInt, + psRGXConfigEnableHWPerfCountersIN->hDevNode, + PVRSRV_HANDLE_TYPE_DEV_NODE); + if(psRGXConfigEnableHWPerfCountersOUT->eError != PVRSRV_OK) + { + goto RGXConfigEnableHWPerfCounters_exit; + } + } + + + psRGXConfigEnableHWPerfCountersOUT->eError = + PVRSRVRGXConfigEnableHWPerfCountersKM( + hDevNodeInt, + psRGXConfigEnableHWPerfCountersIN->ui32ArrayLen, + psBlockConfigsInt); + + + + +RGXConfigEnableHWPerfCounters_exit: + if (psBlockConfigsInt) + OSFreeMem(psBlockConfigsInt); + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXCtrlHWPerfCounters(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_RGXCTRLHWPERFCOUNTERS *psRGXCtrlHWPerfCountersIN, + PVRSRV_BRIDGE_OUT_RGXCTRLHWPERFCOUNTERS *psRGXCtrlHWPerfCountersOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevNodeInt = IMG_NULL; + IMG_UINT16 *ui16BlockIDsInt = IMG_NULL; + + + + + if (psRGXCtrlHWPerfCountersIN->ui32ArrayLen != 0) + { + ui16BlockIDsInt = OSAllocMem(psRGXCtrlHWPerfCountersIN->ui32ArrayLen * sizeof(IMG_UINT16)); + if (!ui16BlockIDsInt) + { + psRGXCtrlHWPerfCountersOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXCtrlHWPerfCounters_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXCtrlHWPerfCountersIN->pui16BlockIDs, psRGXCtrlHWPerfCountersIN->ui32ArrayLen * sizeof(IMG_UINT16)) + || (OSCopyFromUser(NULL, ui16BlockIDsInt, psRGXCtrlHWPerfCountersIN->pui16BlockIDs, + psRGXCtrlHWPerfCountersIN->ui32ArrayLen * sizeof(IMG_UINT16)) != PVRSRV_OK) ) + { + psRGXCtrlHWPerfCountersOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXCtrlHWPerfCounters_exit; + } + + + + { + /* Look up the address from the handle */ + psRGXCtrlHWPerfCountersOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &hDevNodeInt, + psRGXCtrlHWPerfCountersIN->hDevNode, + PVRSRV_HANDLE_TYPE_DEV_NODE); + if(psRGXCtrlHWPerfCountersOUT->eError != PVRSRV_OK) + { + goto RGXCtrlHWPerfCounters_exit; + } + } + + + psRGXCtrlHWPerfCountersOUT->eError = + PVRSRVRGXCtrlHWPerfCountersKM( + hDevNodeInt, + psRGXCtrlHWPerfCountersIN->bEnable, + psRGXCtrlHWPerfCountersIN->ui32ArrayLen, + ui16BlockIDsInt); + + + + +RGXCtrlHWPerfCounters_exit: + if (ui16BlockIDsInt) + OSFreeMem(ui16BlockIDsInt); + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXConfigCustomCounters(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_RGXCONFIGCUSTOMCOUNTERS *psRGXConfigCustomCountersIN, + PVRSRV_BRIDGE_OUT_RGXCONFIGCUSTOMCOUNTERS *psRGXConfigCustomCountersOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevNodeInt = IMG_NULL; + IMG_UINT32 *ui32CustomCounterIDsInt = IMG_NULL; + + + + + if (psRGXConfigCustomCountersIN->ui16NumCustomCounters != 0) + { + ui32CustomCounterIDsInt = OSAllocMem(psRGXConfigCustomCountersIN->ui16NumCustomCounters * sizeof(IMG_UINT32)); + if (!ui32CustomCounterIDsInt) + { + psRGXConfigCustomCountersOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXConfigCustomCounters_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXConfigCustomCountersIN->pui32CustomCounterIDs, psRGXConfigCustomCountersIN->ui16NumCustomCounters * sizeof(IMG_UINT32)) + || (OSCopyFromUser(NULL, ui32CustomCounterIDsInt, psRGXConfigCustomCountersIN->pui32CustomCounterIDs, + psRGXConfigCustomCountersIN->ui16NumCustomCounters * sizeof(IMG_UINT32)) != PVRSRV_OK) ) + { + psRGXConfigCustomCountersOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXConfigCustomCounters_exit; + } + + + + { + /* Look up the address from the handle */ + psRGXConfigCustomCountersOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &hDevNodeInt, + psRGXConfigCustomCountersIN->hDevNode, + PVRSRV_HANDLE_TYPE_DEV_NODE); + if(psRGXConfigCustomCountersOUT->eError != PVRSRV_OK) + { + goto RGXConfigCustomCounters_exit; + } + } + + + psRGXConfigCustomCountersOUT->eError = + PVRSRVRGXConfigCustomCountersKM( + hDevNodeInt, + psRGXConfigCustomCountersIN->ui16CustomBlockID, + psRGXConfigCustomCountersIN->ui16NumCustomCounters, + ui32CustomCounterIDsInt); + + + + +RGXConfigCustomCounters_exit: + if (ui32CustomCounterIDsInt) + OSFreeMem(ui32CustomCounterIDsInt); + + return 0; +} + + + +/* *************************************************************************** + * Server bridge dispatch related glue + */ + + +PVRSRV_ERROR InitRGXHWPERFBridge(IMG_VOID); +PVRSRV_ERROR DeinitRGXHWPERFBridge(IMG_VOID); + +/* + * Register all RGXHWPERF functions with services + */ +PVRSRV_ERROR InitRGXHWPERFBridge(IMG_VOID) +{ + + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXHWPERF, PVRSRV_BRIDGE_RGXHWPERF_RGXCTRLHWPERF, PVRSRVBridgeRGXCtrlHWPerf, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXHWPERF, PVRSRV_BRIDGE_RGXHWPERF_RGXCONFIGENABLEHWPERFCOUNTERS, PVRSRVBridgeRGXConfigEnableHWPerfCounters, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXHWPERF, PVRSRV_BRIDGE_RGXHWPERF_RGXCTRLHWPERFCOUNTERS, PVRSRVBridgeRGXCtrlHWPerfCounters, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXHWPERF, PVRSRV_BRIDGE_RGXHWPERF_RGXCONFIGCUSTOMCOUNTERS, PVRSRVBridgeRGXConfigCustomCounters, + IMG_NULL, IMG_NULL, + 0, 0); + + + return PVRSRV_OK; +} + +/* + * Unregister all rgxhwperf functions with services + */ +PVRSRV_ERROR DeinitRGXHWPERFBridge(IMG_VOID) +{ + return PVRSRV_OK; +} + diff --git a/drivers/gpu/rogue_m/generated/rgxinit_bridge/common_rgxinit_bridge.h b/drivers/gpu/rogue_m/generated/rgxinit_bridge/common_rgxinit_bridge.h new file mode 100644 index 000000000000..9097cb59e159 --- /dev/null +++ b/drivers/gpu/rogue_m/generated/rgxinit_bridge/common_rgxinit_bridge.h @@ -0,0 +1,201 @@ +/*************************************************************************/ /*! +@File +@Title Common bridge header for rgxinit +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Declares common defines and structures that are used by both + the client and sever side of the bridge for rgxinit +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef COMMON_RGXINIT_BRIDGE_H +#define COMMON_RGXINIT_BRIDGE_H + +#include "img_types.h" +#include "pvrsrv_error.h" + +#include "rgx_bridge.h" +#include "rgxscript.h" +#include "devicemem_typedefs.h" +#include "rgx_fwif_shared.h" +#include "rgx_fwif.h" + + +#define PVRSRV_BRIDGE_RGXINIT_CMD_FIRST 0 +#define PVRSRV_BRIDGE_RGXINIT_RGXINITALLOCFWIMGMEM PVRSRV_BRIDGE_RGXINIT_CMD_FIRST+0 +#define PVRSRV_BRIDGE_RGXINIT_RGXINITFIRMWARE PVRSRV_BRIDGE_RGXINIT_CMD_FIRST+1 +#define PVRSRV_BRIDGE_RGXINIT_RGXINITLOADFWIMAGE PVRSRV_BRIDGE_RGXINIT_CMD_FIRST+2 +#define PVRSRV_BRIDGE_RGXINIT_RGXINITDEVPART2 PVRSRV_BRIDGE_RGXINIT_CMD_FIRST+3 +#define PVRSRV_BRIDGE_RGXINIT_GPUVIRTPOPULATELMASUBARENAS PVRSRV_BRIDGE_RGXINIT_CMD_FIRST+4 +#define PVRSRV_BRIDGE_RGXINIT_CMD_LAST (PVRSRV_BRIDGE_RGXINIT_CMD_FIRST+4) + + +/******************************************* + RGXInitAllocFWImgMem + *******************************************/ + +/* Bridge in structure for RGXInitAllocFWImgMem */ +typedef struct PVRSRV_BRIDGE_IN_RGXINITALLOCFWIMGMEM_TAG +{ + IMG_HANDLE hDevNode; + IMG_DEVMEM_SIZE_T uiFWCodeLen; + IMG_DEVMEM_SIZE_T uiFWDataLen; + IMG_DEVMEM_SIZE_T uiFWCoremem; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXINITALLOCFWIMGMEM; + + +/* Bridge out structure for RGXInitAllocFWImgMem */ +typedef struct PVRSRV_BRIDGE_OUT_RGXINITALLOCFWIMGMEM_TAG +{ + DEVMEM_SERVER_EXPORTCOOKIE hFWCodeAllocServerExportCookie; + IMG_DEV_VIRTADDR sFWCodeDevVAddrBase; + DEVMEM_SERVER_EXPORTCOOKIE hFWDataAllocServerExportCookie; + IMG_DEV_VIRTADDR sFWDataDevVAddrBase; + DEVMEM_SERVER_EXPORTCOOKIE hFWCorememAllocServerExportCookie; + IMG_DEV_VIRTADDR sFWCorememDevVAddrBase; + RGXFWIF_DEV_VIRTADDR sFWCorememMetaVAddrBase; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXINITALLOCFWIMGMEM; + +/******************************************* + RGXInitFirmware + *******************************************/ + +/* Bridge in structure for RGXInitFirmware */ +typedef struct PVRSRV_BRIDGE_IN_RGXINITFIRMWARE_TAG +{ + IMG_HANDLE hDevNode; + IMG_BOOL bEnableSignatureChecks; + IMG_UINT32 ui32SignatureChecksBufSize; + IMG_UINT32 ui32HWPerfFWBufSizeKB; + IMG_UINT64 ui64HWPerfFilter; + IMG_UINT32 ui32RGXFWAlignChecksSize; + IMG_UINT32 * pui32RGXFWAlignChecks; + IMG_UINT32 ui32ConfigFlags; + IMG_UINT32 ui32LogType; + IMG_UINT32 ui32FilterFlags; + IMG_UINT32 ui32JonesDisableMask; + IMG_UINT32 ui32ui32HWRDebugDumpLimit; + RGXFWIF_COMPCHECKS_BVNC sClientBVNC; + IMG_UINT32 ui32HWPerfCountersDataSize; + RGX_RD_POWER_ISLAND_CONF eRGXRDPowerIslandConf; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXINITFIRMWARE; + + +/* Bridge out structure for RGXInitFirmware */ +typedef struct PVRSRV_BRIDGE_OUT_RGXINITFIRMWARE_TAG +{ + RGXFWIF_DEV_VIRTADDR spsRGXFwInit; + DEVMEM_SERVER_EXPORTCOOKIE hHWPerfDataAllocServerExportCookie; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXINITFIRMWARE; + +/******************************************* + RGXInitLoadFWImage + *******************************************/ + +/* Bridge in structure for RGXInitLoadFWImage */ +typedef struct PVRSRV_BRIDGE_IN_RGXINITLOADFWIMAGE_TAG +{ + IMG_HANDLE hImgDestImport; + IMG_HANDLE hImgSrcImport; + IMG_UINT64 ui64ImgLen; + IMG_HANDLE hSigImport; + IMG_UINT64 ui64SigLen; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXINITLOADFWIMAGE; + + +/* Bridge out structure for RGXInitLoadFWImage */ +typedef struct PVRSRV_BRIDGE_OUT_RGXINITLOADFWIMAGE_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXINITLOADFWIMAGE; + +/******************************************* + RGXInitDevPart2 + *******************************************/ + +/* Bridge in structure for RGXInitDevPart2 */ +typedef struct PVRSRV_BRIDGE_IN_RGXINITDEVPART2_TAG +{ + IMG_HANDLE hDevNode; + RGX_INIT_COMMAND * psInitScript; + RGX_INIT_COMMAND * psDbgScript; + RGX_INIT_COMMAND * psDbgBusScript; + RGX_INIT_COMMAND * psDeinitScript; + IMG_UINT32 ui32ui32KernelCatBaseIdReg; + IMG_UINT32 ui32KernelCatBaseId; + IMG_UINT32 ui32KernelCatBaseReg; + IMG_UINT32 ui32KernelCatBaseWordSize; + IMG_UINT32 ui32KernelCatBaseAlignShift; + IMG_UINT32 ui32KernelCatBaseShift; + IMG_UINT64 ui64KernelCatBaseMask; + IMG_UINT32 ui32DeviceFlags; + IMG_UINT32 ui32RGXActivePMConf; + DEVMEM_SERVER_EXPORTCOOKIE hFWCodeAllocServerExportCookie; + DEVMEM_SERVER_EXPORTCOOKIE hFWDataAllocServerExportCookie; + DEVMEM_SERVER_EXPORTCOOKIE hFWCorememAllocServerExportCookie; + DEVMEM_SERVER_EXPORTCOOKIE hHWPerfDataAllocServerExportCookie; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXINITDEVPART2; + + +/* Bridge out structure for RGXInitDevPart2 */ +typedef struct PVRSRV_BRIDGE_OUT_RGXINITDEVPART2_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXINITDEVPART2; + +/******************************************* + GPUVIRTPopulateLMASubArenas + *******************************************/ + +/* Bridge in structure for GPUVIRTPopulateLMASubArenas */ +typedef struct PVRSRV_BRIDGE_IN_GPUVIRTPOPULATELMASUBARENAS_TAG +{ + IMG_HANDLE hDevNode; + IMG_UINT32 ui32NumElements; + IMG_UINT32 * pui32Elements; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_GPUVIRTPOPULATELMASUBARENAS; + + +/* Bridge out structure for GPUVIRTPopulateLMASubArenas */ +typedef struct PVRSRV_BRIDGE_OUT_GPUVIRTPOPULATELMASUBARENAS_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_GPUVIRTPOPULATELMASUBARENAS; + +#endif /* COMMON_RGXINIT_BRIDGE_H */ diff --git a/drivers/gpu/rogue_m/generated/rgxinit_bridge/server_rgxinit_bridge.c b/drivers/gpu/rogue_m/generated/rgxinit_bridge/server_rgxinit_bridge.c new file mode 100644 index 000000000000..5f0d05df0b0a --- /dev/null +++ b/drivers/gpu/rogue_m/generated/rgxinit_bridge/server_rgxinit_bridge.c @@ -0,0 +1,733 @@ +/*************************************************************************/ /*! +@File +@Title Server bridge for rgxinit +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Implements the server side of the bridge for rgxinit +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#include +#include + +#include "img_defs.h" + +#include "rgxinit.h" + + +#include "common_rgxinit_bridge.h" + +#include "allocmem.h" +#include "pvr_debug.h" +#include "connection_server.h" +#include "pvr_bridge.h" +#include "rgx_bridge.h" +#include "srvcore.h" +#include "handle.h" + +#if defined (SUPPORT_AUTH) +#include "osauth.h" +#endif + +#include + + +static PVRSRV_ERROR ReleaseFWCodeAllocServerExportCookie(IMG_VOID *pvData) +{ + PVR_UNREFERENCED_PARAMETER(pvData); + + return PVRSRV_OK; +} +static PVRSRV_ERROR ReleaseFWDataAllocServerExportCookie(IMG_VOID *pvData) +{ + PVR_UNREFERENCED_PARAMETER(pvData); + + return PVRSRV_OK; +} +static PVRSRV_ERROR ReleaseFWCorememAllocServerExportCookie(IMG_VOID *pvData) +{ + PVR_UNREFERENCED_PARAMETER(pvData); + + return PVRSRV_OK; +} +static PVRSRV_ERROR ReleaseHWPerfDataAllocServerExportCookie(IMG_VOID *pvData) +{ + PVR_UNREFERENCED_PARAMETER(pvData); + + return PVRSRV_OK; +} + + +/* *************************************************************************** + * Server-side bridge entry points + */ + +static IMG_INT +PVRSRVBridgeRGXInitAllocFWImgMem(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_RGXINITALLOCFWIMGMEM *psRGXInitAllocFWImgMemIN, + PVRSRV_BRIDGE_OUT_RGXINITALLOCFWIMGMEM *psRGXInitAllocFWImgMemOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevNodeInt = IMG_NULL; + DEVMEM_EXPORTCOOKIE * psFWCodeAllocServerExportCookieInt = IMG_NULL; + DEVMEM_EXPORTCOOKIE * psFWDataAllocServerExportCookieInt = IMG_NULL; + DEVMEM_EXPORTCOOKIE * psFWCorememAllocServerExportCookieInt = IMG_NULL; + + + + + + + + { + /* Look up the address from the handle */ + psRGXInitAllocFWImgMemOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &hDevNodeInt, + psRGXInitAllocFWImgMemIN->hDevNode, + PVRSRV_HANDLE_TYPE_DEV_NODE); + if(psRGXInitAllocFWImgMemOUT->eError != PVRSRV_OK) + { + goto RGXInitAllocFWImgMem_exit; + } + } + + + psRGXInitAllocFWImgMemOUT->eError = + PVRSRVRGXInitAllocFWImgMemKM( + hDevNodeInt, + psRGXInitAllocFWImgMemIN->uiFWCodeLen, + psRGXInitAllocFWImgMemIN->uiFWDataLen, + psRGXInitAllocFWImgMemIN->uiFWCoremem, + &psFWCodeAllocServerExportCookieInt, + &psRGXInitAllocFWImgMemOUT->sFWCodeDevVAddrBase, + &psFWDataAllocServerExportCookieInt, + &psRGXInitAllocFWImgMemOUT->sFWDataDevVAddrBase, + &psFWCorememAllocServerExportCookieInt, + &psRGXInitAllocFWImgMemOUT->sFWCorememDevVAddrBase, + &psRGXInitAllocFWImgMemOUT->sFWCorememMetaVAddrBase); + /* Exit early if bridged call fails */ + if(psRGXInitAllocFWImgMemOUT->eError != PVRSRV_OK) + { + goto RGXInitAllocFWImgMem_exit; + } + + + psRGXInitAllocFWImgMemOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psRGXInitAllocFWImgMemOUT->hFWCodeAllocServerExportCookie, + (IMG_VOID *) psFWCodeAllocServerExportCookieInt, + PVRSRV_HANDLE_TYPE_SERVER_EXPORTCOOKIE, + PVRSRV_HANDLE_ALLOC_FLAG_NONE + ,(PFN_HANDLE_RELEASE)&ReleaseFWCodeAllocServerExportCookie); + if (psRGXInitAllocFWImgMemOUT->eError != PVRSRV_OK) + { + goto RGXInitAllocFWImgMem_exit; + } + + + psRGXInitAllocFWImgMemOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psRGXInitAllocFWImgMemOUT->hFWDataAllocServerExportCookie, + (IMG_VOID *) psFWDataAllocServerExportCookieInt, + PVRSRV_HANDLE_TYPE_SERVER_EXPORTCOOKIE, + PVRSRV_HANDLE_ALLOC_FLAG_NONE + ,(PFN_HANDLE_RELEASE)&ReleaseFWDataAllocServerExportCookie); + if (psRGXInitAllocFWImgMemOUT->eError != PVRSRV_OK) + { + goto RGXInitAllocFWImgMem_exit; + } + + + psRGXInitAllocFWImgMemOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psRGXInitAllocFWImgMemOUT->hFWCorememAllocServerExportCookie, + (IMG_VOID *) psFWCorememAllocServerExportCookieInt, + PVRSRV_HANDLE_TYPE_SERVER_EXPORTCOOKIE, + PVRSRV_HANDLE_ALLOC_FLAG_NONE + ,(PFN_HANDLE_RELEASE)&ReleaseFWCorememAllocServerExportCookie); + if (psRGXInitAllocFWImgMemOUT->eError != PVRSRV_OK) + { + goto RGXInitAllocFWImgMem_exit; + } + + + + +RGXInitAllocFWImgMem_exit: + if (psRGXInitAllocFWImgMemOUT->eError != PVRSRV_OK) + { + } + + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXInitFirmware(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_RGXINITFIRMWARE *psRGXInitFirmwareIN, + PVRSRV_BRIDGE_OUT_RGXINITFIRMWARE *psRGXInitFirmwareOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevNodeInt = IMG_NULL; + IMG_UINT32 *ui32RGXFWAlignChecksInt = IMG_NULL; + DEVMEM_EXPORTCOOKIE * psHWPerfDataAllocServerExportCookieInt = IMG_NULL; + + + + + if (psRGXInitFirmwareIN->ui32RGXFWAlignChecksSize != 0) + { + ui32RGXFWAlignChecksInt = OSAllocMem(psRGXInitFirmwareIN->ui32RGXFWAlignChecksSize * sizeof(IMG_UINT32)); + if (!ui32RGXFWAlignChecksInt) + { + psRGXInitFirmwareOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXInitFirmware_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXInitFirmwareIN->pui32RGXFWAlignChecks, psRGXInitFirmwareIN->ui32RGXFWAlignChecksSize * sizeof(IMG_UINT32)) + || (OSCopyFromUser(NULL, ui32RGXFWAlignChecksInt, psRGXInitFirmwareIN->pui32RGXFWAlignChecks, + psRGXInitFirmwareIN->ui32RGXFWAlignChecksSize * sizeof(IMG_UINT32)) != PVRSRV_OK) ) + { + psRGXInitFirmwareOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXInitFirmware_exit; + } + + + + { + /* Look up the address from the handle */ + psRGXInitFirmwareOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &hDevNodeInt, + psRGXInitFirmwareIN->hDevNode, + PVRSRV_HANDLE_TYPE_DEV_NODE); + if(psRGXInitFirmwareOUT->eError != PVRSRV_OK) + { + goto RGXInitFirmware_exit; + } + } + + + psRGXInitFirmwareOUT->eError = + PVRSRVRGXInitFirmwareKM( + hDevNodeInt, + &psRGXInitFirmwareOUT->spsRGXFwInit, + psRGXInitFirmwareIN->bEnableSignatureChecks, + psRGXInitFirmwareIN->ui32SignatureChecksBufSize, + psRGXInitFirmwareIN->ui32HWPerfFWBufSizeKB, + psRGXInitFirmwareIN->ui64HWPerfFilter, + psRGXInitFirmwareIN->ui32RGXFWAlignChecksSize, + ui32RGXFWAlignChecksInt, + psRGXInitFirmwareIN->ui32ConfigFlags, + psRGXInitFirmwareIN->ui32LogType, + psRGXInitFirmwareIN->ui32FilterFlags, + psRGXInitFirmwareIN->ui32JonesDisableMask, + psRGXInitFirmwareIN->ui32ui32HWRDebugDumpLimit, + &psRGXInitFirmwareIN->sClientBVNC, + psRGXInitFirmwareIN->ui32HWPerfCountersDataSize, + &psHWPerfDataAllocServerExportCookieInt, + psRGXInitFirmwareIN->eRGXRDPowerIslandConf); + /* Exit early if bridged call fails */ + if(psRGXInitFirmwareOUT->eError != PVRSRV_OK) + { + goto RGXInitFirmware_exit; + } + + + psRGXInitFirmwareOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psRGXInitFirmwareOUT->hHWPerfDataAllocServerExportCookie, + (IMG_VOID *) psHWPerfDataAllocServerExportCookieInt, + PVRSRV_HANDLE_TYPE_SERVER_EXPORTCOOKIE, + PVRSRV_HANDLE_ALLOC_FLAG_NONE + ,(PFN_HANDLE_RELEASE)&ReleaseHWPerfDataAllocServerExportCookie); + if (psRGXInitFirmwareOUT->eError != PVRSRV_OK) + { + goto RGXInitFirmware_exit; + } + + + + +RGXInitFirmware_exit: + if (psRGXInitFirmwareOUT->eError != PVRSRV_OK) + { + } + + if (ui32RGXFWAlignChecksInt) + OSFreeMem(ui32RGXFWAlignChecksInt); + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXInitLoadFWImage(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_RGXINITLOADFWIMAGE *psRGXInitLoadFWImageIN, + PVRSRV_BRIDGE_OUT_RGXINITLOADFWIMAGE *psRGXInitLoadFWImageOUT, + CONNECTION_DATA *psConnection) +{ + PMR * psImgDestImportInt = IMG_NULL; + PMR * psImgSrcImportInt = IMG_NULL; + PMR * psSigImportInt = IMG_NULL; + + + + + + + + { + /* Look up the address from the handle */ + psRGXInitLoadFWImageOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psImgDestImportInt, + psRGXInitLoadFWImageIN->hImgDestImport, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR); + if(psRGXInitLoadFWImageOUT->eError != PVRSRV_OK) + { + goto RGXInitLoadFWImage_exit; + } + } + + + { + /* Look up the address from the handle */ + psRGXInitLoadFWImageOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psImgSrcImportInt, + psRGXInitLoadFWImageIN->hImgSrcImport, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR); + if(psRGXInitLoadFWImageOUT->eError != PVRSRV_OK) + { + goto RGXInitLoadFWImage_exit; + } + } + + + { + /* Look up the address from the handle */ + psRGXInitLoadFWImageOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psSigImportInt, + psRGXInitLoadFWImageIN->hSigImport, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR); + if(psRGXInitLoadFWImageOUT->eError != PVRSRV_OK) + { + goto RGXInitLoadFWImage_exit; + } + } + + + psRGXInitLoadFWImageOUT->eError = + PVRSRVRGXInitLoadFWImageKM( + psImgDestImportInt, + psImgSrcImportInt, + psRGXInitLoadFWImageIN->ui64ImgLen, + psSigImportInt, + psRGXInitLoadFWImageIN->ui64SigLen); + + + + +RGXInitLoadFWImage_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXInitDevPart2(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_RGXINITDEVPART2 *psRGXInitDevPart2IN, + PVRSRV_BRIDGE_OUT_RGXINITDEVPART2 *psRGXInitDevPart2OUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevNodeInt = IMG_NULL; + RGX_INIT_COMMAND *psInitScriptInt = IMG_NULL; + RGX_INIT_COMMAND *psDbgScriptInt = IMG_NULL; + RGX_INIT_COMMAND *psDbgBusScriptInt = IMG_NULL; + RGX_INIT_COMMAND *psDeinitScriptInt = IMG_NULL; + DEVMEM_EXPORTCOOKIE * psFWCodeAllocServerExportCookieInt = IMG_NULL; + DEVMEM_EXPORTCOOKIE * psFWDataAllocServerExportCookieInt = IMG_NULL; + DEVMEM_EXPORTCOOKIE * psFWCorememAllocServerExportCookieInt = IMG_NULL; + DEVMEM_EXPORTCOOKIE * psHWPerfDataAllocServerExportCookieInt = IMG_NULL; + + + + + + { + psInitScriptInt = OSAllocMem(RGX_MAX_INIT_COMMANDS * sizeof(RGX_INIT_COMMAND)); + if (!psInitScriptInt) + { + psRGXInitDevPart2OUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXInitDevPart2_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXInitDevPart2IN->psInitScript, RGX_MAX_INIT_COMMANDS * sizeof(RGX_INIT_COMMAND)) + || (OSCopyFromUser(NULL, psInitScriptInt, psRGXInitDevPart2IN->psInitScript, + RGX_MAX_INIT_COMMANDS * sizeof(RGX_INIT_COMMAND)) != PVRSRV_OK) ) + { + psRGXInitDevPart2OUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXInitDevPart2_exit; + } + + { + psDbgScriptInt = OSAllocMem(RGX_MAX_DEBUG_COMMANDS * sizeof(RGX_INIT_COMMAND)); + if (!psDbgScriptInt) + { + psRGXInitDevPart2OUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXInitDevPart2_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXInitDevPart2IN->psDbgScript, RGX_MAX_DEBUG_COMMANDS * sizeof(RGX_INIT_COMMAND)) + || (OSCopyFromUser(NULL, psDbgScriptInt, psRGXInitDevPart2IN->psDbgScript, + RGX_MAX_DEBUG_COMMANDS * sizeof(RGX_INIT_COMMAND)) != PVRSRV_OK) ) + { + psRGXInitDevPart2OUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXInitDevPart2_exit; + } + + { + psDbgBusScriptInt = OSAllocMem(RGX_MAX_DBGBUS_COMMANDS * sizeof(RGX_INIT_COMMAND)); + if (!psDbgBusScriptInt) + { + psRGXInitDevPart2OUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXInitDevPart2_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXInitDevPart2IN->psDbgBusScript, RGX_MAX_DBGBUS_COMMANDS * sizeof(RGX_INIT_COMMAND)) + || (OSCopyFromUser(NULL, psDbgBusScriptInt, psRGXInitDevPart2IN->psDbgBusScript, + RGX_MAX_DBGBUS_COMMANDS * sizeof(RGX_INIT_COMMAND)) != PVRSRV_OK) ) + { + psRGXInitDevPart2OUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXInitDevPart2_exit; + } + + { + psDeinitScriptInt = OSAllocMem(RGX_MAX_DEINIT_COMMANDS * sizeof(RGX_INIT_COMMAND)); + if (!psDeinitScriptInt) + { + psRGXInitDevPart2OUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXInitDevPart2_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXInitDevPart2IN->psDeinitScript, RGX_MAX_DEINIT_COMMANDS * sizeof(RGX_INIT_COMMAND)) + || (OSCopyFromUser(NULL, psDeinitScriptInt, psRGXInitDevPart2IN->psDeinitScript, + RGX_MAX_DEINIT_COMMANDS * sizeof(RGX_INIT_COMMAND)) != PVRSRV_OK) ) + { + psRGXInitDevPart2OUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXInitDevPart2_exit; + } + + + + { + /* Look up the address from the handle */ + psRGXInitDevPart2OUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &hDevNodeInt, + psRGXInitDevPart2IN->hDevNode, + PVRSRV_HANDLE_TYPE_DEV_NODE); + if(psRGXInitDevPart2OUT->eError != PVRSRV_OK) + { + goto RGXInitDevPart2_exit; + } + } + + + { + /* Look up the address from the handle */ + psRGXInitDevPart2OUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psFWCodeAllocServerExportCookieInt, + psRGXInitDevPart2IN->hFWCodeAllocServerExportCookie, + PVRSRV_HANDLE_TYPE_SERVER_EXPORTCOOKIE); + if(psRGXInitDevPart2OUT->eError != PVRSRV_OK) + { + goto RGXInitDevPart2_exit; + } + } + + + { + /* Look up the address from the handle */ + psRGXInitDevPart2OUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psFWDataAllocServerExportCookieInt, + psRGXInitDevPart2IN->hFWDataAllocServerExportCookie, + PVRSRV_HANDLE_TYPE_SERVER_EXPORTCOOKIE); + if(psRGXInitDevPart2OUT->eError != PVRSRV_OK) + { + goto RGXInitDevPart2_exit; + } + } + + + { + /* Look up the address from the handle */ + psRGXInitDevPart2OUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psFWCorememAllocServerExportCookieInt, + psRGXInitDevPart2IN->hFWCorememAllocServerExportCookie, + PVRSRV_HANDLE_TYPE_SERVER_EXPORTCOOKIE); + if(psRGXInitDevPart2OUT->eError != PVRSRV_OK) + { + goto RGXInitDevPart2_exit; + } + } + + + { + /* Look up the address from the handle */ + psRGXInitDevPart2OUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psHWPerfDataAllocServerExportCookieInt, + psRGXInitDevPart2IN->hHWPerfDataAllocServerExportCookie, + PVRSRV_HANDLE_TYPE_SERVER_EXPORTCOOKIE); + if(psRGXInitDevPart2OUT->eError != PVRSRV_OK) + { + goto RGXInitDevPart2_exit; + } + } + + + psRGXInitDevPart2OUT->eError = + PVRSRVRGXInitDevPart2KM( + hDevNodeInt, + psInitScriptInt, + psDbgScriptInt, + psDbgBusScriptInt, + psDeinitScriptInt, + psRGXInitDevPart2IN->ui32ui32KernelCatBaseIdReg, + psRGXInitDevPart2IN->ui32KernelCatBaseId, + psRGXInitDevPart2IN->ui32KernelCatBaseReg, + psRGXInitDevPart2IN->ui32KernelCatBaseWordSize, + psRGXInitDevPart2IN->ui32KernelCatBaseAlignShift, + psRGXInitDevPart2IN->ui32KernelCatBaseShift, + psRGXInitDevPart2IN->ui64KernelCatBaseMask, + psRGXInitDevPart2IN->ui32DeviceFlags, + psRGXInitDevPart2IN->ui32RGXActivePMConf, + psFWCodeAllocServerExportCookieInt, + psFWDataAllocServerExportCookieInt, + psFWCorememAllocServerExportCookieInt, + psHWPerfDataAllocServerExportCookieInt); + + + psRGXInitDevPart2OUT->eError = + PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psRGXInitDevPart2IN->hFWCodeAllocServerExportCookie, + PVRSRV_HANDLE_TYPE_SERVER_EXPORTCOOKIE); + if ((psRGXInitDevPart2OUT->eError != PVRSRV_OK) && (psRGXInitDevPart2OUT->eError != PVRSRV_ERROR_RETRY)) + { + PVR_ASSERT(0); + goto RGXInitDevPart2_exit; + } + + psRGXInitDevPart2OUT->eError = + PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psRGXInitDevPart2IN->hFWDataAllocServerExportCookie, + PVRSRV_HANDLE_TYPE_SERVER_EXPORTCOOKIE); + if ((psRGXInitDevPart2OUT->eError != PVRSRV_OK) && (psRGXInitDevPart2OUT->eError != PVRSRV_ERROR_RETRY)) + { + PVR_ASSERT(0); + goto RGXInitDevPart2_exit; + } + + psRGXInitDevPart2OUT->eError = + PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psRGXInitDevPart2IN->hFWCorememAllocServerExportCookie, + PVRSRV_HANDLE_TYPE_SERVER_EXPORTCOOKIE); + if ((psRGXInitDevPart2OUT->eError != PVRSRV_OK) && (psRGXInitDevPart2OUT->eError != PVRSRV_ERROR_RETRY)) + { + PVR_ASSERT(0); + goto RGXInitDevPart2_exit; + } + + psRGXInitDevPart2OUT->eError = + PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psRGXInitDevPart2IN->hHWPerfDataAllocServerExportCookie, + PVRSRV_HANDLE_TYPE_SERVER_EXPORTCOOKIE); + if ((psRGXInitDevPart2OUT->eError != PVRSRV_OK) && (psRGXInitDevPart2OUT->eError != PVRSRV_ERROR_RETRY)) + { + PVR_ASSERT(0); + goto RGXInitDevPart2_exit; + } + + + +RGXInitDevPart2_exit: + if (psInitScriptInt) + OSFreeMem(psInitScriptInt); + if (psDbgScriptInt) + OSFreeMem(psDbgScriptInt); + if (psDbgBusScriptInt) + OSFreeMem(psDbgBusScriptInt); + if (psDeinitScriptInt) + OSFreeMem(psDeinitScriptInt); + + return 0; +} + +static IMG_INT +PVRSRVBridgeGPUVIRTPopulateLMASubArenas(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_GPUVIRTPOPULATELMASUBARENAS *psGPUVIRTPopulateLMASubArenasIN, + PVRSRV_BRIDGE_OUT_GPUVIRTPOPULATELMASUBARENAS *psGPUVIRTPopulateLMASubArenasOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevNodeInt = IMG_NULL; + IMG_UINT32 *ui32ElementsInt = IMG_NULL; + + + + + if (psGPUVIRTPopulateLMASubArenasIN->ui32NumElements != 0) + { + ui32ElementsInt = OSAllocMem(psGPUVIRTPopulateLMASubArenasIN->ui32NumElements * sizeof(IMG_UINT32)); + if (!ui32ElementsInt) + { + psGPUVIRTPopulateLMASubArenasOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto GPUVIRTPopulateLMASubArenas_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psGPUVIRTPopulateLMASubArenasIN->pui32Elements, psGPUVIRTPopulateLMASubArenasIN->ui32NumElements * sizeof(IMG_UINT32)) + || (OSCopyFromUser(NULL, ui32ElementsInt, psGPUVIRTPopulateLMASubArenasIN->pui32Elements, + psGPUVIRTPopulateLMASubArenasIN->ui32NumElements * sizeof(IMG_UINT32)) != PVRSRV_OK) ) + { + psGPUVIRTPopulateLMASubArenasOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto GPUVIRTPopulateLMASubArenas_exit; + } + + + + { + /* Look up the address from the handle */ + psGPUVIRTPopulateLMASubArenasOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &hDevNodeInt, + psGPUVIRTPopulateLMASubArenasIN->hDevNode, + PVRSRV_HANDLE_TYPE_DEV_NODE); + if(psGPUVIRTPopulateLMASubArenasOUT->eError != PVRSRV_OK) + { + goto GPUVIRTPopulateLMASubArenas_exit; + } + } + + + psGPUVIRTPopulateLMASubArenasOUT->eError = + PVRSRVGPUVIRTPopulateLMASubArenasKM( + hDevNodeInt, + psGPUVIRTPopulateLMASubArenasIN->ui32NumElements, + ui32ElementsInt); + + + + +GPUVIRTPopulateLMASubArenas_exit: + if (ui32ElementsInt) + OSFreeMem(ui32ElementsInt); + + return 0; +} + + + +/* *************************************************************************** + * Server bridge dispatch related glue + */ + + +PVRSRV_ERROR InitRGXINITBridge(IMG_VOID); +PVRSRV_ERROR DeinitRGXINITBridge(IMG_VOID); + +/* + * Register all RGXINIT functions with services + */ +PVRSRV_ERROR InitRGXINITBridge(IMG_VOID) +{ + + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXINIT, PVRSRV_BRIDGE_RGXINIT_RGXINITALLOCFWIMGMEM, PVRSRVBridgeRGXInitAllocFWImgMem, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXINIT, PVRSRV_BRIDGE_RGXINIT_RGXINITFIRMWARE, PVRSRVBridgeRGXInitFirmware, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXINIT, PVRSRV_BRIDGE_RGXINIT_RGXINITLOADFWIMAGE, PVRSRVBridgeRGXInitLoadFWImage, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXINIT, PVRSRV_BRIDGE_RGXINIT_RGXINITDEVPART2, PVRSRVBridgeRGXInitDevPart2, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXINIT, PVRSRV_BRIDGE_RGXINIT_GPUVIRTPOPULATELMASUBARENAS, PVRSRVBridgeGPUVIRTPopulateLMASubArenas, + IMG_NULL, IMG_NULL, + 0, 0); + + + return PVRSRV_OK; +} + +/* + * Unregister all rgxinit functions with services + */ +PVRSRV_ERROR DeinitRGXINITBridge(IMG_VOID) +{ + return PVRSRV_OK; +} + diff --git a/drivers/gpu/rogue_m/generated/rgxpdump_bridge/common_rgxpdump_bridge.h b/drivers/gpu/rogue_m/generated/rgxpdump_bridge/common_rgxpdump_bridge.h new file mode 100644 index 000000000000..a1d6a35b38a4 --- /dev/null +++ b/drivers/gpu/rogue_m/generated/rgxpdump_bridge/common_rgxpdump_bridge.h @@ -0,0 +1,96 @@ +/*************************************************************************/ /*! +@File +@Title Common bridge header for rgxpdump +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Declares common defines and structures that are used by both + the client and sever side of the bridge for rgxpdump +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef COMMON_RGXPDUMP_BRIDGE_H +#define COMMON_RGXPDUMP_BRIDGE_H + +#include "img_types.h" +#include "pvrsrv_error.h" + +#include "rgx_bridge.h" + + +#define PVRSRV_BRIDGE_RGXPDUMP_CMD_FIRST 0 +#define PVRSRV_BRIDGE_RGXPDUMP_PDUMPTRACEBUFFER PVRSRV_BRIDGE_RGXPDUMP_CMD_FIRST+0 +#define PVRSRV_BRIDGE_RGXPDUMP_PDUMPSIGNATUREBUFFER PVRSRV_BRIDGE_RGXPDUMP_CMD_FIRST+1 +#define PVRSRV_BRIDGE_RGXPDUMP_CMD_LAST (PVRSRV_BRIDGE_RGXPDUMP_CMD_FIRST+1) + + +/******************************************* + PDumpTraceBuffer + *******************************************/ + +/* Bridge in structure for PDumpTraceBuffer */ +typedef struct PVRSRV_BRIDGE_IN_PDUMPTRACEBUFFER_TAG +{ + IMG_HANDLE hDeviceNode; + IMG_UINT32 ui32PDumpFlags; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_PDUMPTRACEBUFFER; + + +/* Bridge out structure for PDumpTraceBuffer */ +typedef struct PVRSRV_BRIDGE_OUT_PDUMPTRACEBUFFER_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PDUMPTRACEBUFFER; + +/******************************************* + PDumpSignatureBuffer + *******************************************/ + +/* Bridge in structure for PDumpSignatureBuffer */ +typedef struct PVRSRV_BRIDGE_IN_PDUMPSIGNATUREBUFFER_TAG +{ + IMG_HANDLE hDeviceNode; + IMG_UINT32 ui32PDumpFlags; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_PDUMPSIGNATUREBUFFER; + + +/* Bridge out structure for PDumpSignatureBuffer */ +typedef struct PVRSRV_BRIDGE_OUT_PDUMPSIGNATUREBUFFER_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PDUMPSIGNATUREBUFFER; + +#endif /* COMMON_RGXPDUMP_BRIDGE_H */ diff --git a/drivers/gpu/rogue_m/generated/rgxpdump_bridge/server_rgxpdump_bridge.c b/drivers/gpu/rogue_m/generated/rgxpdump_bridge/server_rgxpdump_bridge.c new file mode 100644 index 000000000000..648b7db42a99 --- /dev/null +++ b/drivers/gpu/rogue_m/generated/rgxpdump_bridge/server_rgxpdump_bridge.c @@ -0,0 +1,192 @@ +/*************************************************************************/ /*! +@File +@Title Server bridge for rgxpdump +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Implements the server side of the bridge for rgxpdump +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#include +#include + +#include "img_defs.h" + +#include "rgxpdump.h" + + +#include "common_rgxpdump_bridge.h" + +#include "allocmem.h" +#include "pvr_debug.h" +#include "connection_server.h" +#include "pvr_bridge.h" +#include "rgx_bridge.h" +#include "srvcore.h" +#include "handle.h" + +#if defined (SUPPORT_AUTH) +#include "osauth.h" +#endif + +#include + + + + +/* *************************************************************************** + * Server-side bridge entry points + */ + +static IMG_INT +PVRSRVBridgePDumpTraceBuffer(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_PDUMPTRACEBUFFER *psPDumpTraceBufferIN, + PVRSRV_BRIDGE_OUT_PDUMPTRACEBUFFER *psPDumpTraceBufferOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDeviceNodeInt = IMG_NULL; + + + + + + + + { + /* Look up the address from the handle */ + psPDumpTraceBufferOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &hDeviceNodeInt, + psPDumpTraceBufferIN->hDeviceNode, + PVRSRV_HANDLE_TYPE_DEV_NODE); + if(psPDumpTraceBufferOUT->eError != PVRSRV_OK) + { + goto PDumpTraceBuffer_exit; + } + } + + + psPDumpTraceBufferOUT->eError = + PVRSRVPDumpTraceBufferKM( + hDeviceNodeInt, + psPDumpTraceBufferIN->ui32PDumpFlags); + + + + +PDumpTraceBuffer_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgePDumpSignatureBuffer(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_PDUMPSIGNATUREBUFFER *psPDumpSignatureBufferIN, + PVRSRV_BRIDGE_OUT_PDUMPSIGNATUREBUFFER *psPDumpSignatureBufferOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDeviceNodeInt = IMG_NULL; + + + + + + + + { + /* Look up the address from the handle */ + psPDumpSignatureBufferOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &hDeviceNodeInt, + psPDumpSignatureBufferIN->hDeviceNode, + PVRSRV_HANDLE_TYPE_DEV_NODE); + if(psPDumpSignatureBufferOUT->eError != PVRSRV_OK) + { + goto PDumpSignatureBuffer_exit; + } + } + + + psPDumpSignatureBufferOUT->eError = + PVRSRVPDumpSignatureBufferKM( + hDeviceNodeInt, + psPDumpSignatureBufferIN->ui32PDumpFlags); + + + + +PDumpSignatureBuffer_exit: + + return 0; +} + + + +/* *************************************************************************** + * Server bridge dispatch related glue + */ + + +PVRSRV_ERROR InitRGXPDUMPBridge(IMG_VOID); +PVRSRV_ERROR DeinitRGXPDUMPBridge(IMG_VOID); + +/* + * Register all RGXPDUMP functions with services + */ +PVRSRV_ERROR InitRGXPDUMPBridge(IMG_VOID) +{ + + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXPDUMP, PVRSRV_BRIDGE_RGXPDUMP_PDUMPTRACEBUFFER, PVRSRVBridgePDumpTraceBuffer, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXPDUMP, PVRSRV_BRIDGE_RGXPDUMP_PDUMPSIGNATUREBUFFER, PVRSRVBridgePDumpSignatureBuffer, + IMG_NULL, IMG_NULL, + 0, 0); + + + return PVRSRV_OK; +} + +/* + * Unregister all rgxpdump functions with services + */ +PVRSRV_ERROR DeinitRGXPDUMPBridge(IMG_VOID) +{ + return PVRSRV_OK; +} + diff --git a/drivers/gpu/rogue_m/generated/rgxta3d_bridge/common_rgxta3d_bridge.h b/drivers/gpu/rogue_m/generated/rgxta3d_bridge/common_rgxta3d_bridge.h new file mode 100644 index 000000000000..5d87997b3311 --- /dev/null +++ b/drivers/gpu/rogue_m/generated/rgxta3d_bridge/common_rgxta3d_bridge.h @@ -0,0 +1,531 @@ +/*************************************************************************/ /*! +@File +@Title Common bridge header for rgxta3d +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Declares common defines and structures that are used by both + the client and sever side of the bridge for rgxta3d +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef COMMON_RGXTA3D_BRIDGE_H +#define COMMON_RGXTA3D_BRIDGE_H + +#include "img_types.h" +#include "pvrsrv_error.h" + +#include "rgx_bridge.h" +#include "sync_external.h" +#include "rgx_fwif_shared.h" + + +#define PVRSRV_BRIDGE_RGXTA3D_CMD_FIRST 0 +#define PVRSRV_BRIDGE_RGXTA3D_RGXCREATEHWRTDATA PVRSRV_BRIDGE_RGXTA3D_CMD_FIRST+0 +#define PVRSRV_BRIDGE_RGXTA3D_RGXDESTROYHWRTDATA PVRSRV_BRIDGE_RGXTA3D_CMD_FIRST+1 +#define PVRSRV_BRIDGE_RGXTA3D_RGXCREATERENDERTARGET PVRSRV_BRIDGE_RGXTA3D_CMD_FIRST+2 +#define PVRSRV_BRIDGE_RGXTA3D_RGXDESTROYRENDERTARGET PVRSRV_BRIDGE_RGXTA3D_CMD_FIRST+3 +#define PVRSRV_BRIDGE_RGXTA3D_RGXCREATEZSBUFFER PVRSRV_BRIDGE_RGXTA3D_CMD_FIRST+4 +#define PVRSRV_BRIDGE_RGXTA3D_RGXDESTROYZSBUFFER PVRSRV_BRIDGE_RGXTA3D_CMD_FIRST+5 +#define PVRSRV_BRIDGE_RGXTA3D_RGXPOPULATEZSBUFFER PVRSRV_BRIDGE_RGXTA3D_CMD_FIRST+6 +#define PVRSRV_BRIDGE_RGXTA3D_RGXUNPOPULATEZSBUFFER PVRSRV_BRIDGE_RGXTA3D_CMD_FIRST+7 +#define PVRSRV_BRIDGE_RGXTA3D_RGXCREATEFREELIST PVRSRV_BRIDGE_RGXTA3D_CMD_FIRST+8 +#define PVRSRV_BRIDGE_RGXTA3D_RGXDESTROYFREELIST PVRSRV_BRIDGE_RGXTA3D_CMD_FIRST+9 +#define PVRSRV_BRIDGE_RGXTA3D_RGXADDBLOCKTOFREELIST PVRSRV_BRIDGE_RGXTA3D_CMD_FIRST+10 +#define PVRSRV_BRIDGE_RGXTA3D_RGXREMOVEBLOCKFROMFREELIST PVRSRV_BRIDGE_RGXTA3D_CMD_FIRST+11 +#define PVRSRV_BRIDGE_RGXTA3D_RGXCREATERENDERCONTEXT PVRSRV_BRIDGE_RGXTA3D_CMD_FIRST+12 +#define PVRSRV_BRIDGE_RGXTA3D_RGXDESTROYRENDERCONTEXT PVRSRV_BRIDGE_RGXTA3D_CMD_FIRST+13 +#define PVRSRV_BRIDGE_RGXTA3D_RGXKICKTA3D PVRSRV_BRIDGE_RGXTA3D_CMD_FIRST+14 +#define PVRSRV_BRIDGE_RGXTA3D_RGXSETRENDERCONTEXTPRIORITY PVRSRV_BRIDGE_RGXTA3D_CMD_FIRST+15 +#define PVRSRV_BRIDGE_RGXTA3D_RGXGETLASTRENDERCONTEXTRESETREASON PVRSRV_BRIDGE_RGXTA3D_CMD_FIRST+16 +#define PVRSRV_BRIDGE_RGXTA3D_RGXGETPARTIALRENDERCOUNT PVRSRV_BRIDGE_RGXTA3D_CMD_FIRST+17 +#define PVRSRV_BRIDGE_RGXTA3D_RGXKICKSYNCTA PVRSRV_BRIDGE_RGXTA3D_CMD_FIRST+18 +#define PVRSRV_BRIDGE_RGXTA3D_CMD_LAST (PVRSRV_BRIDGE_RGXTA3D_CMD_FIRST+18) + + +/******************************************* + RGXCreateHWRTData + *******************************************/ + +/* Bridge in structure for RGXCreateHWRTData */ +typedef struct PVRSRV_BRIDGE_IN_RGXCREATEHWRTDATA_TAG +{ + IMG_HANDLE hDevNode; + IMG_UINT32 ui32RenderTarget; + IMG_DEV_VIRTADDR sPMMlistDevVAddr; + IMG_DEV_VIRTADDR sVFPPageTableAddr; + IMG_HANDLE * phapsFreeLists; + IMG_UINT32 ui32PPPScreen; + IMG_UINT32 ui32PPPGridOffset; + IMG_UINT64 ui64PPPMultiSampleCtl; + IMG_UINT32 ui32TPCStride; + IMG_DEV_VIRTADDR sTailPtrsDevVAddr; + IMG_UINT32 ui32TPCSize; + IMG_UINT32 ui32TEScreen; + IMG_UINT32 ui32TEAA; + IMG_UINT32 ui32TEMTILE1; + IMG_UINT32 ui32TEMTILE2; + IMG_UINT32 ui32MTileStride; + IMG_UINT32 ui32ui32ISPMergeLowerX; + IMG_UINT32 ui32ui32ISPMergeLowerY; + IMG_UINT32 ui32ui32ISPMergeUpperX; + IMG_UINT32 ui32ui32ISPMergeUpperY; + IMG_UINT32 ui32ui32ISPMergeScaleX; + IMG_UINT32 ui32ui32ISPMergeScaleY; + IMG_UINT16 ui16MaxRTs; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXCREATEHWRTDATA; + + +/* Bridge out structure for RGXCreateHWRTData */ +typedef struct PVRSRV_BRIDGE_OUT_RGXCREATEHWRTDATA_TAG +{ + IMG_HANDLE hCleanupCookie; + IMG_HANDLE hRTACtlMemDesc; + IMG_HANDLE hsHWRTDataMemDesc; + IMG_UINT32 ui32FWHWRTData; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXCREATEHWRTDATA; + +/******************************************* + RGXDestroyHWRTData + *******************************************/ + +/* Bridge in structure for RGXDestroyHWRTData */ +typedef struct PVRSRV_BRIDGE_IN_RGXDESTROYHWRTDATA_TAG +{ + IMG_HANDLE hCleanupCookie; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXDESTROYHWRTDATA; + + +/* Bridge out structure for RGXDestroyHWRTData */ +typedef struct PVRSRV_BRIDGE_OUT_RGXDESTROYHWRTDATA_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXDESTROYHWRTDATA; + +/******************************************* + RGXCreateRenderTarget + *******************************************/ + +/* Bridge in structure for RGXCreateRenderTarget */ +typedef struct PVRSRV_BRIDGE_IN_RGXCREATERENDERTARGET_TAG +{ + IMG_HANDLE hDevNode; + IMG_DEV_VIRTADDR spsVHeapTableDevVAddr; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXCREATERENDERTARGET; + + +/* Bridge out structure for RGXCreateRenderTarget */ +typedef struct PVRSRV_BRIDGE_OUT_RGXCREATERENDERTARGET_TAG +{ + IMG_HANDLE hsRenderTargetMemDesc; + IMG_UINT32 ui32sRenderTargetFWDevVAddr; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXCREATERENDERTARGET; + +/******************************************* + RGXDestroyRenderTarget + *******************************************/ + +/* Bridge in structure for RGXDestroyRenderTarget */ +typedef struct PVRSRV_BRIDGE_IN_RGXDESTROYRENDERTARGET_TAG +{ + IMG_HANDLE hsRenderTargetMemDesc; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXDESTROYRENDERTARGET; + + +/* Bridge out structure for RGXDestroyRenderTarget */ +typedef struct PVRSRV_BRIDGE_OUT_RGXDESTROYRENDERTARGET_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXDESTROYRENDERTARGET; + +/******************************************* + RGXCreateZSBuffer + *******************************************/ + +/* Bridge in structure for RGXCreateZSBuffer */ +typedef struct PVRSRV_BRIDGE_IN_RGXCREATEZSBUFFER_TAG +{ + IMG_HANDLE hDevNode; + IMG_HANDLE hReservation; + IMG_HANDLE hPMR; + PVRSRV_MEMALLOCFLAGS_T uiMapFlags; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXCREATEZSBUFFER; + + +/* Bridge out structure for RGXCreateZSBuffer */ +typedef struct PVRSRV_BRIDGE_OUT_RGXCREATEZSBUFFER_TAG +{ + IMG_HANDLE hsZSBufferKM; + IMG_UINT32 ui32sZSBufferFWDevVAddr; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXCREATEZSBUFFER; + +/******************************************* + RGXDestroyZSBuffer + *******************************************/ + +/* Bridge in structure for RGXDestroyZSBuffer */ +typedef struct PVRSRV_BRIDGE_IN_RGXDESTROYZSBUFFER_TAG +{ + IMG_HANDLE hsZSBufferMemDesc; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXDESTROYZSBUFFER; + + +/* Bridge out structure for RGXDestroyZSBuffer */ +typedef struct PVRSRV_BRIDGE_OUT_RGXDESTROYZSBUFFER_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXDESTROYZSBUFFER; + +/******************************************* + RGXPopulateZSBuffer + *******************************************/ + +/* Bridge in structure for RGXPopulateZSBuffer */ +typedef struct PVRSRV_BRIDGE_IN_RGXPOPULATEZSBUFFER_TAG +{ + IMG_HANDLE hsZSBufferKM; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXPOPULATEZSBUFFER; + + +/* Bridge out structure for RGXPopulateZSBuffer */ +typedef struct PVRSRV_BRIDGE_OUT_RGXPOPULATEZSBUFFER_TAG +{ + IMG_HANDLE hsPopulation; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXPOPULATEZSBUFFER; + +/******************************************* + RGXUnpopulateZSBuffer + *******************************************/ + +/* Bridge in structure for RGXUnpopulateZSBuffer */ +typedef struct PVRSRV_BRIDGE_IN_RGXUNPOPULATEZSBUFFER_TAG +{ + IMG_HANDLE hsPopulation; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXUNPOPULATEZSBUFFER; + + +/* Bridge out structure for RGXUnpopulateZSBuffer */ +typedef struct PVRSRV_BRIDGE_OUT_RGXUNPOPULATEZSBUFFER_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXUNPOPULATEZSBUFFER; + +/******************************************* + RGXCreateFreeList + *******************************************/ + +/* Bridge in structure for RGXCreateFreeList */ +typedef struct PVRSRV_BRIDGE_IN_RGXCREATEFREELIST_TAG +{ + IMG_HANDLE hDevNode; + IMG_UINT32 ui32ui32MaxFLPages; + IMG_UINT32 ui32ui32InitFLPages; + IMG_UINT32 ui32ui32GrowFLPages; + IMG_BOOL bbFreeListCheck; + IMG_DEV_VIRTADDR spsFreeListDevVAddr; + IMG_HANDLE hsFreeListPMR; + IMG_DEVMEM_OFFSET_T uiPMROffset; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXCREATEFREELIST; + + +/* Bridge out structure for RGXCreateFreeList */ +typedef struct PVRSRV_BRIDGE_OUT_RGXCREATEFREELIST_TAG +{ + IMG_HANDLE hCleanupCookie; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXCREATEFREELIST; + +/******************************************* + RGXDestroyFreeList + *******************************************/ + +/* Bridge in structure for RGXDestroyFreeList */ +typedef struct PVRSRV_BRIDGE_IN_RGXDESTROYFREELIST_TAG +{ + IMG_HANDLE hCleanupCookie; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXDESTROYFREELIST; + + +/* Bridge out structure for RGXDestroyFreeList */ +typedef struct PVRSRV_BRIDGE_OUT_RGXDESTROYFREELIST_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXDESTROYFREELIST; + +/******************************************* + RGXAddBlockToFreeList + *******************************************/ + +/* Bridge in structure for RGXAddBlockToFreeList */ +typedef struct PVRSRV_BRIDGE_IN_RGXADDBLOCKTOFREELIST_TAG +{ + IMG_HANDLE hsFreeList; + IMG_UINT32 ui3232NumPages; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXADDBLOCKTOFREELIST; + + +/* Bridge out structure for RGXAddBlockToFreeList */ +typedef struct PVRSRV_BRIDGE_OUT_RGXADDBLOCKTOFREELIST_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXADDBLOCKTOFREELIST; + +/******************************************* + RGXRemoveBlockFromFreeList + *******************************************/ + +/* Bridge in structure for RGXRemoveBlockFromFreeList */ +typedef struct PVRSRV_BRIDGE_IN_RGXREMOVEBLOCKFROMFREELIST_TAG +{ + IMG_HANDLE hsFreeList; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXREMOVEBLOCKFROMFREELIST; + + +/* Bridge out structure for RGXRemoveBlockFromFreeList */ +typedef struct PVRSRV_BRIDGE_OUT_RGXREMOVEBLOCKFROMFREELIST_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXREMOVEBLOCKFROMFREELIST; + +/******************************************* + RGXCreateRenderContext + *******************************************/ + +/* Bridge in structure for RGXCreateRenderContext */ +typedef struct PVRSRV_BRIDGE_IN_RGXCREATERENDERCONTEXT_TAG +{ + IMG_HANDLE hDevNode; + IMG_UINT32 ui32Priority; + IMG_DEV_VIRTADDR sMCUFenceAddr; + IMG_DEV_VIRTADDR sVDMCallStackAddr; + IMG_UINT32 ui32FrameworkCmdize; + IMG_BYTE * psFrameworkCmd; + IMG_HANDLE hPrivData; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXCREATERENDERCONTEXT; + + +/* Bridge out structure for RGXCreateRenderContext */ +typedef struct PVRSRV_BRIDGE_OUT_RGXCREATERENDERCONTEXT_TAG +{ + IMG_HANDLE hRenderContext; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXCREATERENDERCONTEXT; + +/******************************************* + RGXDestroyRenderContext + *******************************************/ + +/* Bridge in structure for RGXDestroyRenderContext */ +typedef struct PVRSRV_BRIDGE_IN_RGXDESTROYRENDERCONTEXT_TAG +{ + IMG_HANDLE hCleanupCookie; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXDESTROYRENDERCONTEXT; + + +/* Bridge out structure for RGXDestroyRenderContext */ +typedef struct PVRSRV_BRIDGE_OUT_RGXDESTROYRENDERCONTEXT_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXDESTROYRENDERCONTEXT; + +/******************************************* + RGXKickTA3D + *******************************************/ + +/* Bridge in structure for RGXKickTA3D */ +typedef struct PVRSRV_BRIDGE_IN_RGXKICKTA3D_TAG +{ + IMG_HANDLE hRenderContext; + IMG_UINT32 ui32ClientTAFenceCount; + IMG_HANDLE * phClientTAFenceSyncPrimBlock; + IMG_UINT32 * pui32ClientTAFenceSyncOffset; + IMG_UINT32 * pui32ClientTAFenceValue; + IMG_UINT32 ui32ClientTAUpdateCount; + IMG_HANDLE * phClientTAUpdateSyncPrimBlock; + IMG_UINT32 * pui32ClientTAUpdateSyncOffset; + IMG_UINT32 * pui32ClientTAUpdateValue; + IMG_UINT32 ui32ServerTASyncPrims; + IMG_UINT32 * pui32ServerTASyncFlags; + IMG_HANDLE * phServerTASyncs; + IMG_UINT32 ui32Client3DFenceCount; + IMG_HANDLE * phClient3DFenceSyncPrimBlock; + IMG_UINT32 * pui32Client3DFenceSyncOffset; + IMG_UINT32 * pui32Client3DFenceValue; + IMG_UINT32 ui32Client3DUpdateCount; + IMG_HANDLE * phClient3DUpdateSyncPrimBlock; + IMG_UINT32 * pui32Client3DUpdateSyncOffset; + IMG_UINT32 * pui32Client3DUpdateValue; + IMG_UINT32 ui32Server3DSyncPrims; + IMG_UINT32 * pui32Server3DSyncFlags; + IMG_HANDLE * phServer3DSyncs; + IMG_HANDLE hPRFenceUFOSyncPrimBlock; + IMG_UINT32 ui32FRFenceUFOSyncOffset; + IMG_UINT32 ui32FRFenceValue; + IMG_UINT32 ui32NumCheckFenceFDs; + IMG_INT32 * pi32CheckFenceFDs; + IMG_INT32 i32UpdateFenceFD; + IMG_UINT32 ui32TACmdSize; + IMG_BYTE * psTACmd; + IMG_UINT32 ui323DPRCmdSize; + IMG_BYTE * ps3DPRCmd; + IMG_UINT32 ui323DCmdSize; + IMG_BYTE * ps3DCmd; + IMG_UINT32 ui32ExternalJobReference; + IMG_UINT32 ui32InternalJobReference; + IMG_BOOL bbLastTAInScene; + IMG_BOOL bbKickTA; + IMG_BOOL bbKickPR; + IMG_BOOL bbKick3D; + IMG_BOOL bbAbort; + IMG_BOOL bbPDumpContinuous; + IMG_HANDLE hRTDataCleanup; + IMG_HANDLE hZBuffer; + IMG_HANDLE hSBuffer; + IMG_BOOL bbCommitRefCountsTA; + IMG_BOOL bbCommitRefCounts3D; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXKICKTA3D; + + +/* Bridge out structure for RGXKickTA3D */ +typedef struct PVRSRV_BRIDGE_OUT_RGXKICKTA3D_TAG +{ + IMG_BOOL bbCommittedRefCountsTA; + IMG_BOOL bbCommittedRefCounts3D; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXKICKTA3D; + +/******************************************* + RGXSetRenderContextPriority + *******************************************/ + +/* Bridge in structure for RGXSetRenderContextPriority */ +typedef struct PVRSRV_BRIDGE_IN_RGXSETRENDERCONTEXTPRIORITY_TAG +{ + IMG_HANDLE hRenderContext; + IMG_UINT32 ui32Priority; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXSETRENDERCONTEXTPRIORITY; + + +/* Bridge out structure for RGXSetRenderContextPriority */ +typedef struct PVRSRV_BRIDGE_OUT_RGXSETRENDERCONTEXTPRIORITY_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXSETRENDERCONTEXTPRIORITY; + +/******************************************* + RGXGetLastRenderContextResetReason + *******************************************/ + +/* Bridge in structure for RGXGetLastRenderContextResetReason */ +typedef struct PVRSRV_BRIDGE_IN_RGXGETLASTRENDERCONTEXTRESETREASON_TAG +{ + IMG_HANDLE hRenderContext; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXGETLASTRENDERCONTEXTRESETREASON; + + +/* Bridge out structure for RGXGetLastRenderContextResetReason */ +typedef struct PVRSRV_BRIDGE_OUT_RGXGETLASTRENDERCONTEXTRESETREASON_TAG +{ + IMG_UINT32 ui32LastResetReason; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXGETLASTRENDERCONTEXTRESETREASON; + +/******************************************* + RGXGetPartialRenderCount + *******************************************/ + +/* Bridge in structure for RGXGetPartialRenderCount */ +typedef struct PVRSRV_BRIDGE_IN_RGXGETPARTIALRENDERCOUNT_TAG +{ + IMG_HANDLE hHWRTDataMemDesc; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXGETPARTIALRENDERCOUNT; + + +/* Bridge out structure for RGXGetPartialRenderCount */ +typedef struct PVRSRV_BRIDGE_OUT_RGXGETPARTIALRENDERCOUNT_TAG +{ + IMG_UINT32 ui32NumPartialRenders; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXGETPARTIALRENDERCOUNT; + +/******************************************* + RGXKickSyncTA + *******************************************/ + +/* Bridge in structure for RGXKickSyncTA */ +typedef struct PVRSRV_BRIDGE_IN_RGXKICKSYNCTA_TAG +{ + IMG_HANDLE hRenderContext; + IMG_UINT32 ui32ClientTAFenceCount; + IMG_HANDLE * phClientTAFenceUFOSyncPrimBlock; + IMG_UINT32 * pui32ClientTAFenceOffset; + IMG_UINT32 * pui32ClientTAFenceValue; + IMG_UINT32 ui32ClientTAUpdateCount; + IMG_HANDLE * phClientTAUpdateUFOSyncPrimBlock; + IMG_UINT32 * pui32ClientTAUpdateOffset; + IMG_UINT32 * pui32ClientTAUpdateValue; + IMG_UINT32 ui32ServerTASyncPrims; + IMG_UINT32 * pui32ServerTASyncFlags; + IMG_HANDLE * phServerTASyncs; + IMG_UINT32 ui32Client3DFenceCount; + IMG_HANDLE * phClient3DFenceUFOSyncPrimBlock; + IMG_UINT32 * pui32Client3DFenceOffset; + IMG_UINT32 * pui32Client3DFenceValue; + IMG_UINT32 ui32Client3DUpdateCount; + IMG_HANDLE * phClient3DUpdateUFOSyncPrimBlock; + IMG_UINT32 * pui32Client3DUpdateOffset; + IMG_UINT32 * pui32Client3DUpdateValue; + IMG_UINT32 ui32Server3DSyncPrims; + IMG_UINT32 * pui32Server3DSyncFlags; + IMG_HANDLE * phServer3DSyncs; + IMG_UINT32 ui32NumCheckFenceFDs; + IMG_INT32 * pi32CheckFenceFDs; + IMG_INT32 i32UpdateFenceFD; + IMG_BOOL bbPDumpContinuous; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXKICKSYNCTA; + + +/* Bridge out structure for RGXKickSyncTA */ +typedef struct PVRSRV_BRIDGE_OUT_RGXKICKSYNCTA_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXKICKSYNCTA; + +#endif /* COMMON_RGXTA3D_BRIDGE_H */ diff --git a/drivers/gpu/rogue_m/generated/rgxta3d_bridge/server_rgxta3d_bridge.c b/drivers/gpu/rogue_m/generated/rgxta3d_bridge/server_rgxta3d_bridge.c new file mode 100644 index 000000000000..be88f6b85307 --- /dev/null +++ b/drivers/gpu/rogue_m/generated/rgxta3d_bridge/server_rgxta3d_bridge.c @@ -0,0 +1,2639 @@ +/*************************************************************************/ /*! +@File +@Title Server bridge for rgxta3d +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Implements the server side of the bridge for rgxta3d +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#include +#include + +#include "img_defs.h" + +#include "rgxta3d.h" + + +#include "common_rgxta3d_bridge.h" + +#include "allocmem.h" +#include "pvr_debug.h" +#include "connection_server.h" +#include "pvr_bridge.h" +#include "rgx_bridge.h" +#include "srvcore.h" +#include "handle.h" + +#if defined (SUPPORT_AUTH) +#include "osauth.h" +#endif + +#include + + + + +/* *************************************************************************** + * Server-side bridge entry points + */ + +static IMG_INT +PVRSRVBridgeRGXCreateHWRTData(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_RGXCREATEHWRTDATA *psRGXCreateHWRTDataIN, + PVRSRV_BRIDGE_OUT_RGXCREATEHWRTDATA *psRGXCreateHWRTDataOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevNodeInt = IMG_NULL; + RGX_FREELIST * *psapsFreeListsInt = IMG_NULL; + IMG_HANDLE *hapsFreeListsInt2 = IMG_NULL; + RGX_RTDATA_CLEANUP_DATA * psCleanupCookieInt = IMG_NULL; + DEVMEM_MEMDESC * psRTACtlMemDescInt = IMG_NULL; + DEVMEM_MEMDESC * pssHWRTDataMemDescInt = IMG_NULL; + + + + psRGXCreateHWRTDataOUT->hCleanupCookie = IMG_NULL; + + + { + psapsFreeListsInt = OSAllocMem(RGXFW_MAX_FREELISTS * sizeof(RGX_FREELIST *)); + if (!psapsFreeListsInt) + { + psRGXCreateHWRTDataOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXCreateHWRTData_exit; + } + hapsFreeListsInt2 = OSAllocMem(RGXFW_MAX_FREELISTS * sizeof(IMG_HANDLE)); + if (!hapsFreeListsInt2) + { + psRGXCreateHWRTDataOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXCreateHWRTData_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXCreateHWRTDataIN->phapsFreeLists, RGXFW_MAX_FREELISTS * sizeof(IMG_HANDLE)) + || (OSCopyFromUser(NULL, hapsFreeListsInt2, psRGXCreateHWRTDataIN->phapsFreeLists, + RGXFW_MAX_FREELISTS * sizeof(IMG_HANDLE)) != PVRSRV_OK) ) + { + psRGXCreateHWRTDataOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXCreateHWRTData_exit; + } + + + + { + /* Look up the address from the handle */ + psRGXCreateHWRTDataOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &hDevNodeInt, + psRGXCreateHWRTDataIN->hDevNode, + PVRSRV_HANDLE_TYPE_DEV_NODE); + if(psRGXCreateHWRTDataOUT->eError != PVRSRV_OK) + { + goto RGXCreateHWRTData_exit; + } + } + + + { + IMG_UINT32 i; + + for (i=0;ieError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psapsFreeListsInt[i], + hapsFreeListsInt2[i], + PVRSRV_HANDLE_TYPE_RGX_FREELIST); + if(psRGXCreateHWRTDataOUT->eError != PVRSRV_OK) + { + goto RGXCreateHWRTData_exit; + } + } + + } + } + + psRGXCreateHWRTDataOUT->eError = + RGXCreateHWRTData( + hDevNodeInt, + psRGXCreateHWRTDataIN->ui32RenderTarget, + psRGXCreateHWRTDataIN->sPMMlistDevVAddr, + psRGXCreateHWRTDataIN->sVFPPageTableAddr, + psapsFreeListsInt, + &psCleanupCookieInt, + &psRTACtlMemDescInt, + psRGXCreateHWRTDataIN->ui32PPPScreen, + psRGXCreateHWRTDataIN->ui32PPPGridOffset, + psRGXCreateHWRTDataIN->ui64PPPMultiSampleCtl, + psRGXCreateHWRTDataIN->ui32TPCStride, + psRGXCreateHWRTDataIN->sTailPtrsDevVAddr, + psRGXCreateHWRTDataIN->ui32TPCSize, + psRGXCreateHWRTDataIN->ui32TEScreen, + psRGXCreateHWRTDataIN->ui32TEAA, + psRGXCreateHWRTDataIN->ui32TEMTILE1, + psRGXCreateHWRTDataIN->ui32TEMTILE2, + psRGXCreateHWRTDataIN->ui32MTileStride, + psRGXCreateHWRTDataIN->ui32ui32ISPMergeLowerX, + psRGXCreateHWRTDataIN->ui32ui32ISPMergeLowerY, + psRGXCreateHWRTDataIN->ui32ui32ISPMergeUpperX, + psRGXCreateHWRTDataIN->ui32ui32ISPMergeUpperY, + psRGXCreateHWRTDataIN->ui32ui32ISPMergeScaleX, + psRGXCreateHWRTDataIN->ui32ui32ISPMergeScaleY, + psRGXCreateHWRTDataIN->ui16MaxRTs, + &pssHWRTDataMemDescInt, + &psRGXCreateHWRTDataOUT->ui32FWHWRTData); + /* Exit early if bridged call fails */ + if(psRGXCreateHWRTDataOUT->eError != PVRSRV_OK) + { + goto RGXCreateHWRTData_exit; + } + + + psRGXCreateHWRTDataOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psRGXCreateHWRTDataOUT->hCleanupCookie, + (IMG_VOID *) psCleanupCookieInt, + PVRSRV_HANDLE_TYPE_RGX_RTDATA_CLEANUP, + PVRSRV_HANDLE_ALLOC_FLAG_MULTI + ,(PFN_HANDLE_RELEASE)&RGXDestroyHWRTData); + if (psRGXCreateHWRTDataOUT->eError != PVRSRV_OK) + { + goto RGXCreateHWRTData_exit; + } + + + psRGXCreateHWRTDataOUT->eError = PVRSRVAllocSubHandle(psConnection->psHandleBase, + &psRGXCreateHWRTDataOUT->hRTACtlMemDesc, + (IMG_VOID *) psRTACtlMemDescInt, + PVRSRV_HANDLE_TYPE_RGX_FW_MEMDESC, + PVRSRV_HANDLE_ALLOC_FLAG_NONE + ,psRGXCreateHWRTDataOUT->hCleanupCookie); + if (psRGXCreateHWRTDataOUT->eError != PVRSRV_OK) + { + goto RGXCreateHWRTData_exit; + } + + + psRGXCreateHWRTDataOUT->eError = PVRSRVAllocSubHandle(psConnection->psHandleBase, + &psRGXCreateHWRTDataOUT->hsHWRTDataMemDesc, + (IMG_VOID *) pssHWRTDataMemDescInt, + PVRSRV_HANDLE_TYPE_RGX_FW_MEMDESC, + PVRSRV_HANDLE_ALLOC_FLAG_NONE + ,psRGXCreateHWRTDataOUT->hCleanupCookie); + if (psRGXCreateHWRTDataOUT->eError != PVRSRV_OK) + { + goto RGXCreateHWRTData_exit; + } + + + + +RGXCreateHWRTData_exit: + if (psRGXCreateHWRTDataOUT->eError != PVRSRV_OK) + { + if (psRGXCreateHWRTDataOUT->hCleanupCookie) + { + PVRSRV_ERROR eError = PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psRGXCreateHWRTDataOUT->hCleanupCookie, + PVRSRV_HANDLE_TYPE_RGX_RTDATA_CLEANUP); + + /* Releasing the handle should free/destroy/release the resource. This should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + + /* Avoid freeing/destroying/releasing the resource a second time below */ + psCleanupCookieInt = IMG_NULL; + } + + + if (psCleanupCookieInt) + { + RGXDestroyHWRTData(psCleanupCookieInt); + } + } + + if (psapsFreeListsInt) + OSFreeMem(psapsFreeListsInt); + if (hapsFreeListsInt2) + OSFreeMem(hapsFreeListsInt2); + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXDestroyHWRTData(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_RGXDESTROYHWRTDATA *psRGXDestroyHWRTDataIN, + PVRSRV_BRIDGE_OUT_RGXDESTROYHWRTDATA *psRGXDestroyHWRTDataOUT, + CONNECTION_DATA *psConnection) +{ + + + + + + + + + + psRGXDestroyHWRTDataOUT->eError = + PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psRGXDestroyHWRTDataIN->hCleanupCookie, + PVRSRV_HANDLE_TYPE_RGX_RTDATA_CLEANUP); + if ((psRGXDestroyHWRTDataOUT->eError != PVRSRV_OK) && (psRGXDestroyHWRTDataOUT->eError != PVRSRV_ERROR_RETRY)) + { + PVR_ASSERT(0); + goto RGXDestroyHWRTData_exit; + } + + + +RGXDestroyHWRTData_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXCreateRenderTarget(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_RGXCREATERENDERTARGET *psRGXCreateRenderTargetIN, + PVRSRV_BRIDGE_OUT_RGXCREATERENDERTARGET *psRGXCreateRenderTargetOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevNodeInt = IMG_NULL; + RGX_RT_CLEANUP_DATA * pssRenderTargetMemDescInt = IMG_NULL; + + + + + + + + { + /* Look up the address from the handle */ + psRGXCreateRenderTargetOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &hDevNodeInt, + psRGXCreateRenderTargetIN->hDevNode, + PVRSRV_HANDLE_TYPE_DEV_NODE); + if(psRGXCreateRenderTargetOUT->eError != PVRSRV_OK) + { + goto RGXCreateRenderTarget_exit; + } + } + + + psRGXCreateRenderTargetOUT->eError = + RGXCreateRenderTarget( + hDevNodeInt, + psRGXCreateRenderTargetIN->spsVHeapTableDevVAddr, + &pssRenderTargetMemDescInt, + &psRGXCreateRenderTargetOUT->ui32sRenderTargetFWDevVAddr); + /* Exit early if bridged call fails */ + if(psRGXCreateRenderTargetOUT->eError != PVRSRV_OK) + { + goto RGXCreateRenderTarget_exit; + } + + + psRGXCreateRenderTargetOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psRGXCreateRenderTargetOUT->hsRenderTargetMemDesc, + (IMG_VOID *) pssRenderTargetMemDescInt, + PVRSRV_HANDLE_TYPE_RGX_FWIF_RENDERTARGET, + PVRSRV_HANDLE_ALLOC_FLAG_MULTI + ,(PFN_HANDLE_RELEASE)&RGXDestroyRenderTarget); + if (psRGXCreateRenderTargetOUT->eError != PVRSRV_OK) + { + goto RGXCreateRenderTarget_exit; + } + + + + +RGXCreateRenderTarget_exit: + if (psRGXCreateRenderTargetOUT->eError != PVRSRV_OK) + { + if (pssRenderTargetMemDescInt) + { + RGXDestroyRenderTarget(pssRenderTargetMemDescInt); + } + } + + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXDestroyRenderTarget(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_RGXDESTROYRENDERTARGET *psRGXDestroyRenderTargetIN, + PVRSRV_BRIDGE_OUT_RGXDESTROYRENDERTARGET *psRGXDestroyRenderTargetOUT, + CONNECTION_DATA *psConnection) +{ + + + + + + + + + + psRGXDestroyRenderTargetOUT->eError = + PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psRGXDestroyRenderTargetIN->hsRenderTargetMemDesc, + PVRSRV_HANDLE_TYPE_RGX_FWIF_RENDERTARGET); + if ((psRGXDestroyRenderTargetOUT->eError != PVRSRV_OK) && (psRGXDestroyRenderTargetOUT->eError != PVRSRV_ERROR_RETRY)) + { + PVR_ASSERT(0); + goto RGXDestroyRenderTarget_exit; + } + + + +RGXDestroyRenderTarget_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXCreateZSBuffer(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_RGXCREATEZSBUFFER *psRGXCreateZSBufferIN, + PVRSRV_BRIDGE_OUT_RGXCREATEZSBUFFER *psRGXCreateZSBufferOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevNodeInt = IMG_NULL; + DEVMEMINT_RESERVATION * psReservationInt = IMG_NULL; + PMR * psPMRInt = IMG_NULL; + RGX_ZSBUFFER_DATA * pssZSBufferKMInt = IMG_NULL; + + + + + + + + { + /* Look up the address from the handle */ + psRGXCreateZSBufferOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &hDevNodeInt, + psRGXCreateZSBufferIN->hDevNode, + PVRSRV_HANDLE_TYPE_DEV_NODE); + if(psRGXCreateZSBufferOUT->eError != PVRSRV_OK) + { + goto RGXCreateZSBuffer_exit; + } + } + + + { + /* Look up the address from the handle */ + psRGXCreateZSBufferOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psReservationInt, + psRGXCreateZSBufferIN->hReservation, + PVRSRV_HANDLE_TYPE_DEVMEMINT_RESERVATION); + if(psRGXCreateZSBufferOUT->eError != PVRSRV_OK) + { + goto RGXCreateZSBuffer_exit; + } + } + + + { + /* Look up the address from the handle */ + psRGXCreateZSBufferOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psPMRInt, + psRGXCreateZSBufferIN->hPMR, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR); + if(psRGXCreateZSBufferOUT->eError != PVRSRV_OK) + { + goto RGXCreateZSBuffer_exit; + } + } + + + psRGXCreateZSBufferOUT->eError = + RGXCreateZSBufferKM( + hDevNodeInt, + psReservationInt, + psPMRInt, + psRGXCreateZSBufferIN->uiMapFlags, + &pssZSBufferKMInt, + &psRGXCreateZSBufferOUT->ui32sZSBufferFWDevVAddr); + /* Exit early if bridged call fails */ + if(psRGXCreateZSBufferOUT->eError != PVRSRV_OK) + { + goto RGXCreateZSBuffer_exit; + } + + + psRGXCreateZSBufferOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psRGXCreateZSBufferOUT->hsZSBufferKM, + (IMG_VOID *) pssZSBufferKMInt, + PVRSRV_HANDLE_TYPE_RGX_FWIF_ZSBUFFER, + PVRSRV_HANDLE_ALLOC_FLAG_MULTI + ,(PFN_HANDLE_RELEASE)&RGXDestroyZSBufferKM); + if (psRGXCreateZSBufferOUT->eError != PVRSRV_OK) + { + goto RGXCreateZSBuffer_exit; + } + + + + +RGXCreateZSBuffer_exit: + if (psRGXCreateZSBufferOUT->eError != PVRSRV_OK) + { + if (pssZSBufferKMInt) + { + RGXDestroyZSBufferKM(pssZSBufferKMInt); + } + } + + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXDestroyZSBuffer(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_RGXDESTROYZSBUFFER *psRGXDestroyZSBufferIN, + PVRSRV_BRIDGE_OUT_RGXDESTROYZSBUFFER *psRGXDestroyZSBufferOUT, + CONNECTION_DATA *psConnection) +{ + + + + + + + + + + psRGXDestroyZSBufferOUT->eError = + PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psRGXDestroyZSBufferIN->hsZSBufferMemDesc, + PVRSRV_HANDLE_TYPE_RGX_FWIF_ZSBUFFER); + if ((psRGXDestroyZSBufferOUT->eError != PVRSRV_OK) && (psRGXDestroyZSBufferOUT->eError != PVRSRV_ERROR_RETRY)) + { + PVR_ASSERT(0); + goto RGXDestroyZSBuffer_exit; + } + + + +RGXDestroyZSBuffer_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXPopulateZSBuffer(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_RGXPOPULATEZSBUFFER *psRGXPopulateZSBufferIN, + PVRSRV_BRIDGE_OUT_RGXPOPULATEZSBUFFER *psRGXPopulateZSBufferOUT, + CONNECTION_DATA *psConnection) +{ + RGX_ZSBUFFER_DATA * pssZSBufferKMInt = IMG_NULL; + RGX_POPULATION * pssPopulationInt = IMG_NULL; + + + + + + + + { + /* Look up the address from the handle */ + psRGXPopulateZSBufferOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &pssZSBufferKMInt, + psRGXPopulateZSBufferIN->hsZSBufferKM, + PVRSRV_HANDLE_TYPE_RGX_FWIF_ZSBUFFER); + if(psRGXPopulateZSBufferOUT->eError != PVRSRV_OK) + { + goto RGXPopulateZSBuffer_exit; + } + } + + + psRGXPopulateZSBufferOUT->eError = + RGXPopulateZSBufferKM( + pssZSBufferKMInt, + &pssPopulationInt); + /* Exit early if bridged call fails */ + if(psRGXPopulateZSBufferOUT->eError != PVRSRV_OK) + { + goto RGXPopulateZSBuffer_exit; + } + + + psRGXPopulateZSBufferOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psRGXPopulateZSBufferOUT->hsPopulation, + (IMG_VOID *) pssPopulationInt, + PVRSRV_HANDLE_TYPE_RGX_POPULATION, + PVRSRV_HANDLE_ALLOC_FLAG_MULTI + ,(PFN_HANDLE_RELEASE)&RGXUnpopulateZSBufferKM); + if (psRGXPopulateZSBufferOUT->eError != PVRSRV_OK) + { + goto RGXPopulateZSBuffer_exit; + } + + + + +RGXPopulateZSBuffer_exit: + if (psRGXPopulateZSBufferOUT->eError != PVRSRV_OK) + { + if (pssPopulationInt) + { + RGXUnpopulateZSBufferKM(pssPopulationInt); + } + } + + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXUnpopulateZSBuffer(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_RGXUNPOPULATEZSBUFFER *psRGXUnpopulateZSBufferIN, + PVRSRV_BRIDGE_OUT_RGXUNPOPULATEZSBUFFER *psRGXUnpopulateZSBufferOUT, + CONNECTION_DATA *psConnection) +{ + + + + + + + + + + psRGXUnpopulateZSBufferOUT->eError = + PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psRGXUnpopulateZSBufferIN->hsPopulation, + PVRSRV_HANDLE_TYPE_RGX_POPULATION); + if ((psRGXUnpopulateZSBufferOUT->eError != PVRSRV_OK) && (psRGXUnpopulateZSBufferOUT->eError != PVRSRV_ERROR_RETRY)) + { + PVR_ASSERT(0); + goto RGXUnpopulateZSBuffer_exit; + } + + + +RGXUnpopulateZSBuffer_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXCreateFreeList(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_RGXCREATEFREELIST *psRGXCreateFreeListIN, + PVRSRV_BRIDGE_OUT_RGXCREATEFREELIST *psRGXCreateFreeListOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevNodeInt = IMG_NULL; + PMR * pssFreeListPMRInt = IMG_NULL; + RGX_FREELIST * psCleanupCookieInt = IMG_NULL; + + + + + + + + { + /* Look up the address from the handle */ + psRGXCreateFreeListOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &hDevNodeInt, + psRGXCreateFreeListIN->hDevNode, + PVRSRV_HANDLE_TYPE_DEV_NODE); + if(psRGXCreateFreeListOUT->eError != PVRSRV_OK) + { + goto RGXCreateFreeList_exit; + } + } + + + { + /* Look up the address from the handle */ + psRGXCreateFreeListOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &pssFreeListPMRInt, + psRGXCreateFreeListIN->hsFreeListPMR, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR); + if(psRGXCreateFreeListOUT->eError != PVRSRV_OK) + { + goto RGXCreateFreeList_exit; + } + } + + + psRGXCreateFreeListOUT->eError = + RGXCreateFreeList( + hDevNodeInt, + psRGXCreateFreeListIN->ui32ui32MaxFLPages, + psRGXCreateFreeListIN->ui32ui32InitFLPages, + psRGXCreateFreeListIN->ui32ui32GrowFLPages, + psRGXCreateFreeListIN->bbFreeListCheck, + psRGXCreateFreeListIN->spsFreeListDevVAddr, + pssFreeListPMRInt, + psRGXCreateFreeListIN->uiPMROffset, + &psCleanupCookieInt); + /* Exit early if bridged call fails */ + if(psRGXCreateFreeListOUT->eError != PVRSRV_OK) + { + goto RGXCreateFreeList_exit; + } + + + psRGXCreateFreeListOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psRGXCreateFreeListOUT->hCleanupCookie, + (IMG_VOID *) psCleanupCookieInt, + PVRSRV_HANDLE_TYPE_RGX_FREELIST, + PVRSRV_HANDLE_ALLOC_FLAG_MULTI + ,(PFN_HANDLE_RELEASE)&RGXDestroyFreeList); + if (psRGXCreateFreeListOUT->eError != PVRSRV_OK) + { + goto RGXCreateFreeList_exit; + } + + + + +RGXCreateFreeList_exit: + if (psRGXCreateFreeListOUT->eError != PVRSRV_OK) + { + if (psCleanupCookieInt) + { + RGXDestroyFreeList(psCleanupCookieInt); + } + } + + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXDestroyFreeList(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_RGXDESTROYFREELIST *psRGXDestroyFreeListIN, + PVRSRV_BRIDGE_OUT_RGXDESTROYFREELIST *psRGXDestroyFreeListOUT, + CONNECTION_DATA *psConnection) +{ + + + + + + + + + + psRGXDestroyFreeListOUT->eError = + PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psRGXDestroyFreeListIN->hCleanupCookie, + PVRSRV_HANDLE_TYPE_RGX_FREELIST); + if ((psRGXDestroyFreeListOUT->eError != PVRSRV_OK) && (psRGXDestroyFreeListOUT->eError != PVRSRV_ERROR_RETRY)) + { + PVR_ASSERT(0); + goto RGXDestroyFreeList_exit; + } + + + +RGXDestroyFreeList_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXAddBlockToFreeList(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_RGXADDBLOCKTOFREELIST *psRGXAddBlockToFreeListIN, + PVRSRV_BRIDGE_OUT_RGXADDBLOCKTOFREELIST *psRGXAddBlockToFreeListOUT, + CONNECTION_DATA *psConnection) +{ + RGX_FREELIST * pssFreeListInt = IMG_NULL; + + + + + + + + { + /* Look up the address from the handle */ + psRGXAddBlockToFreeListOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &pssFreeListInt, + psRGXAddBlockToFreeListIN->hsFreeList, + PVRSRV_HANDLE_TYPE_RGX_FREELIST); + if(psRGXAddBlockToFreeListOUT->eError != PVRSRV_OK) + { + goto RGXAddBlockToFreeList_exit; + } + } + + + psRGXAddBlockToFreeListOUT->eError = + RGXAddBlockToFreeListKM( + pssFreeListInt, + psRGXAddBlockToFreeListIN->ui3232NumPages); + + + + +RGXAddBlockToFreeList_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXRemoveBlockFromFreeList(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_RGXREMOVEBLOCKFROMFREELIST *psRGXRemoveBlockFromFreeListIN, + PVRSRV_BRIDGE_OUT_RGXREMOVEBLOCKFROMFREELIST *psRGXRemoveBlockFromFreeListOUT, + CONNECTION_DATA *psConnection) +{ + RGX_FREELIST * pssFreeListInt = IMG_NULL; + + + + + + + + { + /* Look up the address from the handle */ + psRGXRemoveBlockFromFreeListOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &pssFreeListInt, + psRGXRemoveBlockFromFreeListIN->hsFreeList, + PVRSRV_HANDLE_TYPE_RGX_FREELIST); + if(psRGXRemoveBlockFromFreeListOUT->eError != PVRSRV_OK) + { + goto RGXRemoveBlockFromFreeList_exit; + } + } + + + psRGXRemoveBlockFromFreeListOUT->eError = + RGXRemoveBlockFromFreeListKM( + pssFreeListInt); + + + + +RGXRemoveBlockFromFreeList_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXCreateRenderContext(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_RGXCREATERENDERCONTEXT *psRGXCreateRenderContextIN, + PVRSRV_BRIDGE_OUT_RGXCREATERENDERCONTEXT *psRGXCreateRenderContextOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevNodeInt = IMG_NULL; + IMG_BYTE *psFrameworkCmdInt = IMG_NULL; + IMG_HANDLE hPrivDataInt = IMG_NULL; + RGX_SERVER_RENDER_CONTEXT * psRenderContextInt = IMG_NULL; + + + + + if (psRGXCreateRenderContextIN->ui32FrameworkCmdize != 0) + { + psFrameworkCmdInt = OSAllocMem(psRGXCreateRenderContextIN->ui32FrameworkCmdize * sizeof(IMG_BYTE)); + if (!psFrameworkCmdInt) + { + psRGXCreateRenderContextOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXCreateRenderContext_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXCreateRenderContextIN->psFrameworkCmd, psRGXCreateRenderContextIN->ui32FrameworkCmdize * sizeof(IMG_BYTE)) + || (OSCopyFromUser(NULL, psFrameworkCmdInt, psRGXCreateRenderContextIN->psFrameworkCmd, + psRGXCreateRenderContextIN->ui32FrameworkCmdize * sizeof(IMG_BYTE)) != PVRSRV_OK) ) + { + psRGXCreateRenderContextOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXCreateRenderContext_exit; + } + + + + { + /* Look up the address from the handle */ + psRGXCreateRenderContextOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &hDevNodeInt, + psRGXCreateRenderContextIN->hDevNode, + PVRSRV_HANDLE_TYPE_DEV_NODE); + if(psRGXCreateRenderContextOUT->eError != PVRSRV_OK) + { + goto RGXCreateRenderContext_exit; + } + } + + + { + /* Look up the address from the handle */ + psRGXCreateRenderContextOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &hPrivDataInt, + psRGXCreateRenderContextIN->hPrivData, + PVRSRV_HANDLE_TYPE_DEV_PRIV_DATA); + if(psRGXCreateRenderContextOUT->eError != PVRSRV_OK) + { + goto RGXCreateRenderContext_exit; + } + } + + + psRGXCreateRenderContextOUT->eError = + PVRSRVRGXCreateRenderContextKM(psConnection, + hDevNodeInt, + psRGXCreateRenderContextIN->ui32Priority, + psRGXCreateRenderContextIN->sMCUFenceAddr, + psRGXCreateRenderContextIN->sVDMCallStackAddr, + psRGXCreateRenderContextIN->ui32FrameworkCmdize, + psFrameworkCmdInt, + hPrivDataInt, + &psRenderContextInt); + /* Exit early if bridged call fails */ + if(psRGXCreateRenderContextOUT->eError != PVRSRV_OK) + { + goto RGXCreateRenderContext_exit; + } + + + psRGXCreateRenderContextOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psRGXCreateRenderContextOUT->hRenderContext, + (IMG_VOID *) psRenderContextInt, + PVRSRV_HANDLE_TYPE_RGX_SERVER_RENDER_CONTEXT, + PVRSRV_HANDLE_ALLOC_FLAG_MULTI + ,(PFN_HANDLE_RELEASE)&PVRSRVRGXDestroyRenderContextKM); + if (psRGXCreateRenderContextOUT->eError != PVRSRV_OK) + { + goto RGXCreateRenderContext_exit; + } + + + + +RGXCreateRenderContext_exit: + if (psRGXCreateRenderContextOUT->eError != PVRSRV_OK) + { + if (psRenderContextInt) + { + PVRSRVRGXDestroyRenderContextKM(psRenderContextInt); + } + } + + if (psFrameworkCmdInt) + OSFreeMem(psFrameworkCmdInt); + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXDestroyRenderContext(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_RGXDESTROYRENDERCONTEXT *psRGXDestroyRenderContextIN, + PVRSRV_BRIDGE_OUT_RGXDESTROYRENDERCONTEXT *psRGXDestroyRenderContextOUT, + CONNECTION_DATA *psConnection) +{ + + + + + + + + + + psRGXDestroyRenderContextOUT->eError = + PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psRGXDestroyRenderContextIN->hCleanupCookie, + PVRSRV_HANDLE_TYPE_RGX_SERVER_RENDER_CONTEXT); + if ((psRGXDestroyRenderContextOUT->eError != PVRSRV_OK) && (psRGXDestroyRenderContextOUT->eError != PVRSRV_ERROR_RETRY)) + { + PVR_ASSERT(0); + goto RGXDestroyRenderContext_exit; + } + + + +RGXDestroyRenderContext_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXKickTA3D(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_RGXKICKTA3D *psRGXKickTA3DIN, + PVRSRV_BRIDGE_OUT_RGXKICKTA3D *psRGXKickTA3DOUT, + CONNECTION_DATA *psConnection) +{ + RGX_SERVER_RENDER_CONTEXT * psRenderContextInt = IMG_NULL; + SYNC_PRIMITIVE_BLOCK * *psClientTAFenceSyncPrimBlockInt = IMG_NULL; + IMG_HANDLE *hClientTAFenceSyncPrimBlockInt2 = IMG_NULL; + IMG_UINT32 *ui32ClientTAFenceSyncOffsetInt = IMG_NULL; + IMG_UINT32 *ui32ClientTAFenceValueInt = IMG_NULL; + SYNC_PRIMITIVE_BLOCK * *psClientTAUpdateSyncPrimBlockInt = IMG_NULL; + IMG_HANDLE *hClientTAUpdateSyncPrimBlockInt2 = IMG_NULL; + IMG_UINT32 *ui32ClientTAUpdateSyncOffsetInt = IMG_NULL; + IMG_UINT32 *ui32ClientTAUpdateValueInt = IMG_NULL; + IMG_UINT32 *ui32ServerTASyncFlagsInt = IMG_NULL; + SERVER_SYNC_PRIMITIVE * *psServerTASyncsInt = IMG_NULL; + IMG_HANDLE *hServerTASyncsInt2 = IMG_NULL; + SYNC_PRIMITIVE_BLOCK * *psClient3DFenceSyncPrimBlockInt = IMG_NULL; + IMG_HANDLE *hClient3DFenceSyncPrimBlockInt2 = IMG_NULL; + IMG_UINT32 *ui32Client3DFenceSyncOffsetInt = IMG_NULL; + IMG_UINT32 *ui32Client3DFenceValueInt = IMG_NULL; + SYNC_PRIMITIVE_BLOCK * *psClient3DUpdateSyncPrimBlockInt = IMG_NULL; + IMG_HANDLE *hClient3DUpdateSyncPrimBlockInt2 = IMG_NULL; + IMG_UINT32 *ui32Client3DUpdateSyncOffsetInt = IMG_NULL; + IMG_UINT32 *ui32Client3DUpdateValueInt = IMG_NULL; + IMG_UINT32 *ui32Server3DSyncFlagsInt = IMG_NULL; + SERVER_SYNC_PRIMITIVE * *psServer3DSyncsInt = IMG_NULL; + IMG_HANDLE *hServer3DSyncsInt2 = IMG_NULL; + SYNC_PRIMITIVE_BLOCK * psPRFenceUFOSyncPrimBlockInt = IMG_NULL; + IMG_INT32 *i32CheckFenceFDsInt = IMG_NULL; + IMG_BYTE *psTACmdInt = IMG_NULL; + IMG_BYTE *ps3DPRCmdInt = IMG_NULL; + IMG_BYTE *ps3DCmdInt = IMG_NULL; + RGX_RTDATA_CLEANUP_DATA * psRTDataCleanupInt = IMG_NULL; + RGX_ZSBUFFER_DATA * psZBufferInt = IMG_NULL; + RGX_ZSBUFFER_DATA * psSBufferInt = IMG_NULL; + + + + + if (psRGXKickTA3DIN->ui32ClientTAFenceCount != 0) + { + psClientTAFenceSyncPrimBlockInt = OSAllocMem(psRGXKickTA3DIN->ui32ClientTAFenceCount * sizeof(SYNC_PRIMITIVE_BLOCK *)); + if (!psClientTAFenceSyncPrimBlockInt) + { + psRGXKickTA3DOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickTA3D_exit; + } + hClientTAFenceSyncPrimBlockInt2 = OSAllocMem(psRGXKickTA3DIN->ui32ClientTAFenceCount * sizeof(IMG_HANDLE)); + if (!hClientTAFenceSyncPrimBlockInt2) + { + psRGXKickTA3DOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickTA3D_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickTA3DIN->phClientTAFenceSyncPrimBlock, psRGXKickTA3DIN->ui32ClientTAFenceCount * sizeof(IMG_HANDLE)) + || (OSCopyFromUser(NULL, hClientTAFenceSyncPrimBlockInt2, psRGXKickTA3DIN->phClientTAFenceSyncPrimBlock, + psRGXKickTA3DIN->ui32ClientTAFenceCount * sizeof(IMG_HANDLE)) != PVRSRV_OK) ) + { + psRGXKickTA3DOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXKickTA3D_exit; + } + if (psRGXKickTA3DIN->ui32ClientTAFenceCount != 0) + { + ui32ClientTAFenceSyncOffsetInt = OSAllocMem(psRGXKickTA3DIN->ui32ClientTAFenceCount * sizeof(IMG_UINT32)); + if (!ui32ClientTAFenceSyncOffsetInt) + { + psRGXKickTA3DOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickTA3D_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickTA3DIN->pui32ClientTAFenceSyncOffset, psRGXKickTA3DIN->ui32ClientTAFenceCount * sizeof(IMG_UINT32)) + || (OSCopyFromUser(NULL, ui32ClientTAFenceSyncOffsetInt, psRGXKickTA3DIN->pui32ClientTAFenceSyncOffset, + psRGXKickTA3DIN->ui32ClientTAFenceCount * sizeof(IMG_UINT32)) != PVRSRV_OK) ) + { + psRGXKickTA3DOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXKickTA3D_exit; + } + if (psRGXKickTA3DIN->ui32ClientTAFenceCount != 0) + { + ui32ClientTAFenceValueInt = OSAllocMem(psRGXKickTA3DIN->ui32ClientTAFenceCount * sizeof(IMG_UINT32)); + if (!ui32ClientTAFenceValueInt) + { + psRGXKickTA3DOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickTA3D_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickTA3DIN->pui32ClientTAFenceValue, psRGXKickTA3DIN->ui32ClientTAFenceCount * sizeof(IMG_UINT32)) + || (OSCopyFromUser(NULL, ui32ClientTAFenceValueInt, psRGXKickTA3DIN->pui32ClientTAFenceValue, + psRGXKickTA3DIN->ui32ClientTAFenceCount * sizeof(IMG_UINT32)) != PVRSRV_OK) ) + { + psRGXKickTA3DOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXKickTA3D_exit; + } + if (psRGXKickTA3DIN->ui32ClientTAUpdateCount != 0) + { + psClientTAUpdateSyncPrimBlockInt = OSAllocMem(psRGXKickTA3DIN->ui32ClientTAUpdateCount * sizeof(SYNC_PRIMITIVE_BLOCK *)); + if (!psClientTAUpdateSyncPrimBlockInt) + { + psRGXKickTA3DOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickTA3D_exit; + } + hClientTAUpdateSyncPrimBlockInt2 = OSAllocMem(psRGXKickTA3DIN->ui32ClientTAUpdateCount * sizeof(IMG_HANDLE)); + if (!hClientTAUpdateSyncPrimBlockInt2) + { + psRGXKickTA3DOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickTA3D_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickTA3DIN->phClientTAUpdateSyncPrimBlock, psRGXKickTA3DIN->ui32ClientTAUpdateCount * sizeof(IMG_HANDLE)) + || (OSCopyFromUser(NULL, hClientTAUpdateSyncPrimBlockInt2, psRGXKickTA3DIN->phClientTAUpdateSyncPrimBlock, + psRGXKickTA3DIN->ui32ClientTAUpdateCount * sizeof(IMG_HANDLE)) != PVRSRV_OK) ) + { + psRGXKickTA3DOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXKickTA3D_exit; + } + if (psRGXKickTA3DIN->ui32ClientTAUpdateCount != 0) + { + ui32ClientTAUpdateSyncOffsetInt = OSAllocMem(psRGXKickTA3DIN->ui32ClientTAUpdateCount * sizeof(IMG_UINT32)); + if (!ui32ClientTAUpdateSyncOffsetInt) + { + psRGXKickTA3DOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickTA3D_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickTA3DIN->pui32ClientTAUpdateSyncOffset, psRGXKickTA3DIN->ui32ClientTAUpdateCount * sizeof(IMG_UINT32)) + || (OSCopyFromUser(NULL, ui32ClientTAUpdateSyncOffsetInt, psRGXKickTA3DIN->pui32ClientTAUpdateSyncOffset, + psRGXKickTA3DIN->ui32ClientTAUpdateCount * sizeof(IMG_UINT32)) != PVRSRV_OK) ) + { + psRGXKickTA3DOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXKickTA3D_exit; + } + if (psRGXKickTA3DIN->ui32ClientTAUpdateCount != 0) + { + ui32ClientTAUpdateValueInt = OSAllocMem(psRGXKickTA3DIN->ui32ClientTAUpdateCount * sizeof(IMG_UINT32)); + if (!ui32ClientTAUpdateValueInt) + { + psRGXKickTA3DOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickTA3D_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickTA3DIN->pui32ClientTAUpdateValue, psRGXKickTA3DIN->ui32ClientTAUpdateCount * sizeof(IMG_UINT32)) + || (OSCopyFromUser(NULL, ui32ClientTAUpdateValueInt, psRGXKickTA3DIN->pui32ClientTAUpdateValue, + psRGXKickTA3DIN->ui32ClientTAUpdateCount * sizeof(IMG_UINT32)) != PVRSRV_OK) ) + { + psRGXKickTA3DOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXKickTA3D_exit; + } + if (psRGXKickTA3DIN->ui32ServerTASyncPrims != 0) + { + ui32ServerTASyncFlagsInt = OSAllocMem(psRGXKickTA3DIN->ui32ServerTASyncPrims * sizeof(IMG_UINT32)); + if (!ui32ServerTASyncFlagsInt) + { + psRGXKickTA3DOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickTA3D_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickTA3DIN->pui32ServerTASyncFlags, psRGXKickTA3DIN->ui32ServerTASyncPrims * sizeof(IMG_UINT32)) + || (OSCopyFromUser(NULL, ui32ServerTASyncFlagsInt, psRGXKickTA3DIN->pui32ServerTASyncFlags, + psRGXKickTA3DIN->ui32ServerTASyncPrims * sizeof(IMG_UINT32)) != PVRSRV_OK) ) + { + psRGXKickTA3DOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXKickTA3D_exit; + } + if (psRGXKickTA3DIN->ui32ServerTASyncPrims != 0) + { + psServerTASyncsInt = OSAllocMem(psRGXKickTA3DIN->ui32ServerTASyncPrims * sizeof(SERVER_SYNC_PRIMITIVE *)); + if (!psServerTASyncsInt) + { + psRGXKickTA3DOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickTA3D_exit; + } + hServerTASyncsInt2 = OSAllocMem(psRGXKickTA3DIN->ui32ServerTASyncPrims * sizeof(IMG_HANDLE)); + if (!hServerTASyncsInt2) + { + psRGXKickTA3DOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickTA3D_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickTA3DIN->phServerTASyncs, psRGXKickTA3DIN->ui32ServerTASyncPrims * sizeof(IMG_HANDLE)) + || (OSCopyFromUser(NULL, hServerTASyncsInt2, psRGXKickTA3DIN->phServerTASyncs, + psRGXKickTA3DIN->ui32ServerTASyncPrims * sizeof(IMG_HANDLE)) != PVRSRV_OK) ) + { + psRGXKickTA3DOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXKickTA3D_exit; + } + if (psRGXKickTA3DIN->ui32Client3DFenceCount != 0) + { + psClient3DFenceSyncPrimBlockInt = OSAllocMem(psRGXKickTA3DIN->ui32Client3DFenceCount * sizeof(SYNC_PRIMITIVE_BLOCK *)); + if (!psClient3DFenceSyncPrimBlockInt) + { + psRGXKickTA3DOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickTA3D_exit; + } + hClient3DFenceSyncPrimBlockInt2 = OSAllocMem(psRGXKickTA3DIN->ui32Client3DFenceCount * sizeof(IMG_HANDLE)); + if (!hClient3DFenceSyncPrimBlockInt2) + { + psRGXKickTA3DOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickTA3D_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickTA3DIN->phClient3DFenceSyncPrimBlock, psRGXKickTA3DIN->ui32Client3DFenceCount * sizeof(IMG_HANDLE)) + || (OSCopyFromUser(NULL, hClient3DFenceSyncPrimBlockInt2, psRGXKickTA3DIN->phClient3DFenceSyncPrimBlock, + psRGXKickTA3DIN->ui32Client3DFenceCount * sizeof(IMG_HANDLE)) != PVRSRV_OK) ) + { + psRGXKickTA3DOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXKickTA3D_exit; + } + if (psRGXKickTA3DIN->ui32Client3DFenceCount != 0) + { + ui32Client3DFenceSyncOffsetInt = OSAllocMem(psRGXKickTA3DIN->ui32Client3DFenceCount * sizeof(IMG_UINT32)); + if (!ui32Client3DFenceSyncOffsetInt) + { + psRGXKickTA3DOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickTA3D_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickTA3DIN->pui32Client3DFenceSyncOffset, psRGXKickTA3DIN->ui32Client3DFenceCount * sizeof(IMG_UINT32)) + || (OSCopyFromUser(NULL, ui32Client3DFenceSyncOffsetInt, psRGXKickTA3DIN->pui32Client3DFenceSyncOffset, + psRGXKickTA3DIN->ui32Client3DFenceCount * sizeof(IMG_UINT32)) != PVRSRV_OK) ) + { + psRGXKickTA3DOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXKickTA3D_exit; + } + if (psRGXKickTA3DIN->ui32Client3DFenceCount != 0) + { + ui32Client3DFenceValueInt = OSAllocMem(psRGXKickTA3DIN->ui32Client3DFenceCount * sizeof(IMG_UINT32)); + if (!ui32Client3DFenceValueInt) + { + psRGXKickTA3DOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickTA3D_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickTA3DIN->pui32Client3DFenceValue, psRGXKickTA3DIN->ui32Client3DFenceCount * sizeof(IMG_UINT32)) + || (OSCopyFromUser(NULL, ui32Client3DFenceValueInt, psRGXKickTA3DIN->pui32Client3DFenceValue, + psRGXKickTA3DIN->ui32Client3DFenceCount * sizeof(IMG_UINT32)) != PVRSRV_OK) ) + { + psRGXKickTA3DOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXKickTA3D_exit; + } + if (psRGXKickTA3DIN->ui32Client3DUpdateCount != 0) + { + psClient3DUpdateSyncPrimBlockInt = OSAllocMem(psRGXKickTA3DIN->ui32Client3DUpdateCount * sizeof(SYNC_PRIMITIVE_BLOCK *)); + if (!psClient3DUpdateSyncPrimBlockInt) + { + psRGXKickTA3DOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickTA3D_exit; + } + hClient3DUpdateSyncPrimBlockInt2 = OSAllocMem(psRGXKickTA3DIN->ui32Client3DUpdateCount * sizeof(IMG_HANDLE)); + if (!hClient3DUpdateSyncPrimBlockInt2) + { + psRGXKickTA3DOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickTA3D_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickTA3DIN->phClient3DUpdateSyncPrimBlock, psRGXKickTA3DIN->ui32Client3DUpdateCount * sizeof(IMG_HANDLE)) + || (OSCopyFromUser(NULL, hClient3DUpdateSyncPrimBlockInt2, psRGXKickTA3DIN->phClient3DUpdateSyncPrimBlock, + psRGXKickTA3DIN->ui32Client3DUpdateCount * sizeof(IMG_HANDLE)) != PVRSRV_OK) ) + { + psRGXKickTA3DOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXKickTA3D_exit; + } + if (psRGXKickTA3DIN->ui32Client3DUpdateCount != 0) + { + ui32Client3DUpdateSyncOffsetInt = OSAllocMem(psRGXKickTA3DIN->ui32Client3DUpdateCount * sizeof(IMG_UINT32)); + if (!ui32Client3DUpdateSyncOffsetInt) + { + psRGXKickTA3DOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickTA3D_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickTA3DIN->pui32Client3DUpdateSyncOffset, psRGXKickTA3DIN->ui32Client3DUpdateCount * sizeof(IMG_UINT32)) + || (OSCopyFromUser(NULL, ui32Client3DUpdateSyncOffsetInt, psRGXKickTA3DIN->pui32Client3DUpdateSyncOffset, + psRGXKickTA3DIN->ui32Client3DUpdateCount * sizeof(IMG_UINT32)) != PVRSRV_OK) ) + { + psRGXKickTA3DOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXKickTA3D_exit; + } + if (psRGXKickTA3DIN->ui32Client3DUpdateCount != 0) + { + ui32Client3DUpdateValueInt = OSAllocMem(psRGXKickTA3DIN->ui32Client3DUpdateCount * sizeof(IMG_UINT32)); + if (!ui32Client3DUpdateValueInt) + { + psRGXKickTA3DOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickTA3D_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickTA3DIN->pui32Client3DUpdateValue, psRGXKickTA3DIN->ui32Client3DUpdateCount * sizeof(IMG_UINT32)) + || (OSCopyFromUser(NULL, ui32Client3DUpdateValueInt, psRGXKickTA3DIN->pui32Client3DUpdateValue, + psRGXKickTA3DIN->ui32Client3DUpdateCount * sizeof(IMG_UINT32)) != PVRSRV_OK) ) + { + psRGXKickTA3DOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXKickTA3D_exit; + } + if (psRGXKickTA3DIN->ui32Server3DSyncPrims != 0) + { + ui32Server3DSyncFlagsInt = OSAllocMem(psRGXKickTA3DIN->ui32Server3DSyncPrims * sizeof(IMG_UINT32)); + if (!ui32Server3DSyncFlagsInt) + { + psRGXKickTA3DOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickTA3D_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickTA3DIN->pui32Server3DSyncFlags, psRGXKickTA3DIN->ui32Server3DSyncPrims * sizeof(IMG_UINT32)) + || (OSCopyFromUser(NULL, ui32Server3DSyncFlagsInt, psRGXKickTA3DIN->pui32Server3DSyncFlags, + psRGXKickTA3DIN->ui32Server3DSyncPrims * sizeof(IMG_UINT32)) != PVRSRV_OK) ) + { + psRGXKickTA3DOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXKickTA3D_exit; + } + if (psRGXKickTA3DIN->ui32Server3DSyncPrims != 0) + { + psServer3DSyncsInt = OSAllocMem(psRGXKickTA3DIN->ui32Server3DSyncPrims * sizeof(SERVER_SYNC_PRIMITIVE *)); + if (!psServer3DSyncsInt) + { + psRGXKickTA3DOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickTA3D_exit; + } + hServer3DSyncsInt2 = OSAllocMem(psRGXKickTA3DIN->ui32Server3DSyncPrims * sizeof(IMG_HANDLE)); + if (!hServer3DSyncsInt2) + { + psRGXKickTA3DOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickTA3D_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickTA3DIN->phServer3DSyncs, psRGXKickTA3DIN->ui32Server3DSyncPrims * sizeof(IMG_HANDLE)) + || (OSCopyFromUser(NULL, hServer3DSyncsInt2, psRGXKickTA3DIN->phServer3DSyncs, + psRGXKickTA3DIN->ui32Server3DSyncPrims * sizeof(IMG_HANDLE)) != PVRSRV_OK) ) + { + psRGXKickTA3DOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXKickTA3D_exit; + } + if (psRGXKickTA3DIN->ui32NumCheckFenceFDs != 0) + { + i32CheckFenceFDsInt = OSAllocMem(psRGXKickTA3DIN->ui32NumCheckFenceFDs * sizeof(IMG_INT32)); + if (!i32CheckFenceFDsInt) + { + psRGXKickTA3DOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickTA3D_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickTA3DIN->pi32CheckFenceFDs, psRGXKickTA3DIN->ui32NumCheckFenceFDs * sizeof(IMG_INT32)) + || (OSCopyFromUser(NULL, i32CheckFenceFDsInt, psRGXKickTA3DIN->pi32CheckFenceFDs, + psRGXKickTA3DIN->ui32NumCheckFenceFDs * sizeof(IMG_INT32)) != PVRSRV_OK) ) + { + psRGXKickTA3DOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXKickTA3D_exit; + } + if (psRGXKickTA3DIN->ui32TACmdSize != 0) + { + psTACmdInt = OSAllocMem(psRGXKickTA3DIN->ui32TACmdSize * sizeof(IMG_BYTE)); + if (!psTACmdInt) + { + psRGXKickTA3DOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickTA3D_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickTA3DIN->psTACmd, psRGXKickTA3DIN->ui32TACmdSize * sizeof(IMG_BYTE)) + || (OSCopyFromUser(NULL, psTACmdInt, psRGXKickTA3DIN->psTACmd, + psRGXKickTA3DIN->ui32TACmdSize * sizeof(IMG_BYTE)) != PVRSRV_OK) ) + { + psRGXKickTA3DOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXKickTA3D_exit; + } + if (psRGXKickTA3DIN->ui323DPRCmdSize != 0) + { + ps3DPRCmdInt = OSAllocMem(psRGXKickTA3DIN->ui323DPRCmdSize * sizeof(IMG_BYTE)); + if (!ps3DPRCmdInt) + { + psRGXKickTA3DOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickTA3D_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickTA3DIN->ps3DPRCmd, psRGXKickTA3DIN->ui323DPRCmdSize * sizeof(IMG_BYTE)) + || (OSCopyFromUser(NULL, ps3DPRCmdInt, psRGXKickTA3DIN->ps3DPRCmd, + psRGXKickTA3DIN->ui323DPRCmdSize * sizeof(IMG_BYTE)) != PVRSRV_OK) ) + { + psRGXKickTA3DOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXKickTA3D_exit; + } + if (psRGXKickTA3DIN->ui323DCmdSize != 0) + { + ps3DCmdInt = OSAllocMem(psRGXKickTA3DIN->ui323DCmdSize * sizeof(IMG_BYTE)); + if (!ps3DCmdInt) + { + psRGXKickTA3DOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickTA3D_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickTA3DIN->ps3DCmd, psRGXKickTA3DIN->ui323DCmdSize * sizeof(IMG_BYTE)) + || (OSCopyFromUser(NULL, ps3DCmdInt, psRGXKickTA3DIN->ps3DCmd, + psRGXKickTA3DIN->ui323DCmdSize * sizeof(IMG_BYTE)) != PVRSRV_OK) ) + { + psRGXKickTA3DOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXKickTA3D_exit; + } + + + + { + /* Look up the address from the handle */ + psRGXKickTA3DOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psRenderContextInt, + psRGXKickTA3DIN->hRenderContext, + PVRSRV_HANDLE_TYPE_RGX_SERVER_RENDER_CONTEXT); + if(psRGXKickTA3DOUT->eError != PVRSRV_OK) + { + goto RGXKickTA3D_exit; + } + } + + + { + IMG_UINT32 i; + + for (i=0;iui32ClientTAFenceCount;i++) + { + { + /* Look up the address from the handle */ + psRGXKickTA3DOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psClientTAFenceSyncPrimBlockInt[i], + hClientTAFenceSyncPrimBlockInt2[i], + PVRSRV_HANDLE_TYPE_SYNC_PRIMITIVE_BLOCK); + if(psRGXKickTA3DOUT->eError != PVRSRV_OK) + { + goto RGXKickTA3D_exit; + } + } + + } + } + + { + IMG_UINT32 i; + + for (i=0;iui32ClientTAUpdateCount;i++) + { + { + /* Look up the address from the handle */ + psRGXKickTA3DOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psClientTAUpdateSyncPrimBlockInt[i], + hClientTAUpdateSyncPrimBlockInt2[i], + PVRSRV_HANDLE_TYPE_SYNC_PRIMITIVE_BLOCK); + if(psRGXKickTA3DOUT->eError != PVRSRV_OK) + { + goto RGXKickTA3D_exit; + } + } + + } + } + + { + IMG_UINT32 i; + + for (i=0;iui32ServerTASyncPrims;i++) + { + { + /* Look up the address from the handle */ + psRGXKickTA3DOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psServerTASyncsInt[i], + hServerTASyncsInt2[i], + PVRSRV_HANDLE_TYPE_SERVER_SYNC_PRIMITIVE); + if(psRGXKickTA3DOUT->eError != PVRSRV_OK) + { + goto RGXKickTA3D_exit; + } + } + + } + } + + { + IMG_UINT32 i; + + for (i=0;iui32Client3DFenceCount;i++) + { + { + /* Look up the address from the handle */ + psRGXKickTA3DOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psClient3DFenceSyncPrimBlockInt[i], + hClient3DFenceSyncPrimBlockInt2[i], + PVRSRV_HANDLE_TYPE_SYNC_PRIMITIVE_BLOCK); + if(psRGXKickTA3DOUT->eError != PVRSRV_OK) + { + goto RGXKickTA3D_exit; + } + } + + } + } + + { + IMG_UINT32 i; + + for (i=0;iui32Client3DUpdateCount;i++) + { + { + /* Look up the address from the handle */ + psRGXKickTA3DOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psClient3DUpdateSyncPrimBlockInt[i], + hClient3DUpdateSyncPrimBlockInt2[i], + PVRSRV_HANDLE_TYPE_SYNC_PRIMITIVE_BLOCK); + if(psRGXKickTA3DOUT->eError != PVRSRV_OK) + { + goto RGXKickTA3D_exit; + } + } + + } + } + + { + IMG_UINT32 i; + + for (i=0;iui32Server3DSyncPrims;i++) + { + { + /* Look up the address from the handle */ + psRGXKickTA3DOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psServer3DSyncsInt[i], + hServer3DSyncsInt2[i], + PVRSRV_HANDLE_TYPE_SERVER_SYNC_PRIMITIVE); + if(psRGXKickTA3DOUT->eError != PVRSRV_OK) + { + goto RGXKickTA3D_exit; + } + } + + } + } + + { + /* Look up the address from the handle */ + psRGXKickTA3DOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psPRFenceUFOSyncPrimBlockInt, + psRGXKickTA3DIN->hPRFenceUFOSyncPrimBlock, + PVRSRV_HANDLE_TYPE_SYNC_PRIMITIVE_BLOCK); + if(psRGXKickTA3DOUT->eError != PVRSRV_OK) + { + goto RGXKickTA3D_exit; + } + } + + + if (psRGXKickTA3DIN->hRTDataCleanup) + { + /* Look up the address from the handle */ + psRGXKickTA3DOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psRTDataCleanupInt, + psRGXKickTA3DIN->hRTDataCleanup, + PVRSRV_HANDLE_TYPE_RGX_RTDATA_CLEANUP); + if(psRGXKickTA3DOUT->eError != PVRSRV_OK) + { + goto RGXKickTA3D_exit; + } + } + + + if (psRGXKickTA3DIN->hZBuffer) + { + /* Look up the address from the handle */ + psRGXKickTA3DOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psZBufferInt, + psRGXKickTA3DIN->hZBuffer, + PVRSRV_HANDLE_TYPE_RGX_FWIF_ZSBUFFER); + if(psRGXKickTA3DOUT->eError != PVRSRV_OK) + { + goto RGXKickTA3D_exit; + } + } + + + if (psRGXKickTA3DIN->hSBuffer) + { + /* Look up the address from the handle */ + psRGXKickTA3DOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psSBufferInt, + psRGXKickTA3DIN->hSBuffer, + PVRSRV_HANDLE_TYPE_RGX_FWIF_ZSBUFFER); + if(psRGXKickTA3DOUT->eError != PVRSRV_OK) + { + goto RGXKickTA3D_exit; + } + } + + + psRGXKickTA3DOUT->eError = + PVRSRVRGXKickTA3DKM( + psRenderContextInt, + psRGXKickTA3DIN->ui32ClientTAFenceCount, + psClientTAFenceSyncPrimBlockInt, + ui32ClientTAFenceSyncOffsetInt, + ui32ClientTAFenceValueInt, + psRGXKickTA3DIN->ui32ClientTAUpdateCount, + psClientTAUpdateSyncPrimBlockInt, + ui32ClientTAUpdateSyncOffsetInt, + ui32ClientTAUpdateValueInt, + psRGXKickTA3DIN->ui32ServerTASyncPrims, + ui32ServerTASyncFlagsInt, + psServerTASyncsInt, + psRGXKickTA3DIN->ui32Client3DFenceCount, + psClient3DFenceSyncPrimBlockInt, + ui32Client3DFenceSyncOffsetInt, + ui32Client3DFenceValueInt, + psRGXKickTA3DIN->ui32Client3DUpdateCount, + psClient3DUpdateSyncPrimBlockInt, + ui32Client3DUpdateSyncOffsetInt, + ui32Client3DUpdateValueInt, + psRGXKickTA3DIN->ui32Server3DSyncPrims, + ui32Server3DSyncFlagsInt, + psServer3DSyncsInt, + psPRFenceUFOSyncPrimBlockInt, + psRGXKickTA3DIN->ui32FRFenceUFOSyncOffset, + psRGXKickTA3DIN->ui32FRFenceValue, + psRGXKickTA3DIN->ui32NumCheckFenceFDs, + i32CheckFenceFDsInt, + psRGXKickTA3DIN->i32UpdateFenceFD, + psRGXKickTA3DIN->ui32TACmdSize, + psTACmdInt, + psRGXKickTA3DIN->ui323DPRCmdSize, + ps3DPRCmdInt, + psRGXKickTA3DIN->ui323DCmdSize, + ps3DCmdInt, + psRGXKickTA3DIN->ui32ExternalJobReference, + psRGXKickTA3DIN->ui32InternalJobReference, + psRGXKickTA3DIN->bbLastTAInScene, + psRGXKickTA3DIN->bbKickTA, + psRGXKickTA3DIN->bbKickPR, + psRGXKickTA3DIN->bbKick3D, + psRGXKickTA3DIN->bbAbort, + psRGXKickTA3DIN->bbPDumpContinuous, + psRTDataCleanupInt, + psZBufferInt, + psSBufferInt, + psRGXKickTA3DIN->bbCommitRefCountsTA, + psRGXKickTA3DIN->bbCommitRefCounts3D, + &psRGXKickTA3DOUT->bbCommittedRefCountsTA, + &psRGXKickTA3DOUT->bbCommittedRefCounts3D); + + + + +RGXKickTA3D_exit: + if (psClientTAFenceSyncPrimBlockInt) + OSFreeMem(psClientTAFenceSyncPrimBlockInt); + if (hClientTAFenceSyncPrimBlockInt2) + OSFreeMem(hClientTAFenceSyncPrimBlockInt2); + if (ui32ClientTAFenceSyncOffsetInt) + OSFreeMem(ui32ClientTAFenceSyncOffsetInt); + if (ui32ClientTAFenceValueInt) + OSFreeMem(ui32ClientTAFenceValueInt); + if (psClientTAUpdateSyncPrimBlockInt) + OSFreeMem(psClientTAUpdateSyncPrimBlockInt); + if (hClientTAUpdateSyncPrimBlockInt2) + OSFreeMem(hClientTAUpdateSyncPrimBlockInt2); + if (ui32ClientTAUpdateSyncOffsetInt) + OSFreeMem(ui32ClientTAUpdateSyncOffsetInt); + if (ui32ClientTAUpdateValueInt) + OSFreeMem(ui32ClientTAUpdateValueInt); + if (ui32ServerTASyncFlagsInt) + OSFreeMem(ui32ServerTASyncFlagsInt); + if (psServerTASyncsInt) + OSFreeMem(psServerTASyncsInt); + if (hServerTASyncsInt2) + OSFreeMem(hServerTASyncsInt2); + if (psClient3DFenceSyncPrimBlockInt) + OSFreeMem(psClient3DFenceSyncPrimBlockInt); + if (hClient3DFenceSyncPrimBlockInt2) + OSFreeMem(hClient3DFenceSyncPrimBlockInt2); + if (ui32Client3DFenceSyncOffsetInt) + OSFreeMem(ui32Client3DFenceSyncOffsetInt); + if (ui32Client3DFenceValueInt) + OSFreeMem(ui32Client3DFenceValueInt); + if (psClient3DUpdateSyncPrimBlockInt) + OSFreeMem(psClient3DUpdateSyncPrimBlockInt); + if (hClient3DUpdateSyncPrimBlockInt2) + OSFreeMem(hClient3DUpdateSyncPrimBlockInt2); + if (ui32Client3DUpdateSyncOffsetInt) + OSFreeMem(ui32Client3DUpdateSyncOffsetInt); + if (ui32Client3DUpdateValueInt) + OSFreeMem(ui32Client3DUpdateValueInt); + if (ui32Server3DSyncFlagsInt) + OSFreeMem(ui32Server3DSyncFlagsInt); + if (psServer3DSyncsInt) + OSFreeMem(psServer3DSyncsInt); + if (hServer3DSyncsInt2) + OSFreeMem(hServer3DSyncsInt2); + if (i32CheckFenceFDsInt) + OSFreeMem(i32CheckFenceFDsInt); + if (psTACmdInt) + OSFreeMem(psTACmdInt); + if (ps3DPRCmdInt) + OSFreeMem(ps3DPRCmdInt); + if (ps3DCmdInt) + OSFreeMem(ps3DCmdInt); + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXSetRenderContextPriority(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_RGXSETRENDERCONTEXTPRIORITY *psRGXSetRenderContextPriorityIN, + PVRSRV_BRIDGE_OUT_RGXSETRENDERCONTEXTPRIORITY *psRGXSetRenderContextPriorityOUT, + CONNECTION_DATA *psConnection) +{ + RGX_SERVER_RENDER_CONTEXT * psRenderContextInt = IMG_NULL; + + + + + + + + { + /* Look up the address from the handle */ + psRGXSetRenderContextPriorityOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psRenderContextInt, + psRGXSetRenderContextPriorityIN->hRenderContext, + PVRSRV_HANDLE_TYPE_RGX_SERVER_RENDER_CONTEXT); + if(psRGXSetRenderContextPriorityOUT->eError != PVRSRV_OK) + { + goto RGXSetRenderContextPriority_exit; + } + } + + + psRGXSetRenderContextPriorityOUT->eError = + PVRSRVRGXSetRenderContextPriorityKM(psConnection, + psRenderContextInt, + psRGXSetRenderContextPriorityIN->ui32Priority); + + + + +RGXSetRenderContextPriority_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXGetLastRenderContextResetReason(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_RGXGETLASTRENDERCONTEXTRESETREASON *psRGXGetLastRenderContextResetReasonIN, + PVRSRV_BRIDGE_OUT_RGXGETLASTRENDERCONTEXTRESETREASON *psRGXGetLastRenderContextResetReasonOUT, + CONNECTION_DATA *psConnection) +{ + RGX_SERVER_RENDER_CONTEXT * psRenderContextInt = IMG_NULL; + + + + + + + + { + /* Look up the address from the handle */ + psRGXGetLastRenderContextResetReasonOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psRenderContextInt, + psRGXGetLastRenderContextResetReasonIN->hRenderContext, + PVRSRV_HANDLE_TYPE_RGX_SERVER_RENDER_CONTEXT); + if(psRGXGetLastRenderContextResetReasonOUT->eError != PVRSRV_OK) + { + goto RGXGetLastRenderContextResetReason_exit; + } + } + + + psRGXGetLastRenderContextResetReasonOUT->eError = + PVRSRVRGXGetLastRenderContextResetReasonKM( + psRenderContextInt, + &psRGXGetLastRenderContextResetReasonOUT->ui32LastResetReason); + + + + +RGXGetLastRenderContextResetReason_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXGetPartialRenderCount(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_RGXGETPARTIALRENDERCOUNT *psRGXGetPartialRenderCountIN, + PVRSRV_BRIDGE_OUT_RGXGETPARTIALRENDERCOUNT *psRGXGetPartialRenderCountOUT, + CONNECTION_DATA *psConnection) +{ + DEVMEM_MEMDESC * psHWRTDataMemDescInt = IMG_NULL; + + + + + + + + { + /* Look up the address from the handle */ + psRGXGetPartialRenderCountOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psHWRTDataMemDescInt, + psRGXGetPartialRenderCountIN->hHWRTDataMemDesc, + PVRSRV_HANDLE_TYPE_RGX_FW_MEMDESC); + if(psRGXGetPartialRenderCountOUT->eError != PVRSRV_OK) + { + goto RGXGetPartialRenderCount_exit; + } + } + + + psRGXGetPartialRenderCountOUT->eError = + PVRSRVRGXGetPartialRenderCountKM( + psHWRTDataMemDescInt, + &psRGXGetPartialRenderCountOUT->ui32NumPartialRenders); + + + + +RGXGetPartialRenderCount_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXKickSyncTA(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_RGXKICKSYNCTA *psRGXKickSyncTAIN, + PVRSRV_BRIDGE_OUT_RGXKICKSYNCTA *psRGXKickSyncTAOUT, + CONNECTION_DATA *psConnection) +{ + RGX_SERVER_RENDER_CONTEXT * psRenderContextInt = IMG_NULL; + SYNC_PRIMITIVE_BLOCK * *psClientTAFenceUFOSyncPrimBlockInt = IMG_NULL; + IMG_HANDLE *hClientTAFenceUFOSyncPrimBlockInt2 = IMG_NULL; + IMG_UINT32 *ui32ClientTAFenceOffsetInt = IMG_NULL; + IMG_UINT32 *ui32ClientTAFenceValueInt = IMG_NULL; + SYNC_PRIMITIVE_BLOCK * *psClientTAUpdateUFOSyncPrimBlockInt = IMG_NULL; + IMG_HANDLE *hClientTAUpdateUFOSyncPrimBlockInt2 = IMG_NULL; + IMG_UINT32 *ui32ClientTAUpdateOffsetInt = IMG_NULL; + IMG_UINT32 *ui32ClientTAUpdateValueInt = IMG_NULL; + IMG_UINT32 *ui32ServerTASyncFlagsInt = IMG_NULL; + SERVER_SYNC_PRIMITIVE * *psServerTASyncsInt = IMG_NULL; + IMG_HANDLE *hServerTASyncsInt2 = IMG_NULL; + SYNC_PRIMITIVE_BLOCK * *psClient3DFenceUFOSyncPrimBlockInt = IMG_NULL; + IMG_HANDLE *hClient3DFenceUFOSyncPrimBlockInt2 = IMG_NULL; + IMG_UINT32 *ui32Client3DFenceOffsetInt = IMG_NULL; + IMG_UINT32 *ui32Client3DFenceValueInt = IMG_NULL; + SYNC_PRIMITIVE_BLOCK * *psClient3DUpdateUFOSyncPrimBlockInt = IMG_NULL; + IMG_HANDLE *hClient3DUpdateUFOSyncPrimBlockInt2 = IMG_NULL; + IMG_UINT32 *ui32Client3DUpdateOffsetInt = IMG_NULL; + IMG_UINT32 *ui32Client3DUpdateValueInt = IMG_NULL; + IMG_UINT32 *ui32Server3DSyncFlagsInt = IMG_NULL; + SERVER_SYNC_PRIMITIVE * *psServer3DSyncsInt = IMG_NULL; + IMG_HANDLE *hServer3DSyncsInt2 = IMG_NULL; + IMG_INT32 *i32CheckFenceFDsInt = IMG_NULL; + + + + + if (psRGXKickSyncTAIN->ui32ClientTAFenceCount != 0) + { + psClientTAFenceUFOSyncPrimBlockInt = OSAllocMem(psRGXKickSyncTAIN->ui32ClientTAFenceCount * sizeof(SYNC_PRIMITIVE_BLOCK *)); + if (!psClientTAFenceUFOSyncPrimBlockInt) + { + psRGXKickSyncTAOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickSyncTA_exit; + } + hClientTAFenceUFOSyncPrimBlockInt2 = OSAllocMem(psRGXKickSyncTAIN->ui32ClientTAFenceCount * sizeof(IMG_HANDLE)); + if (!hClientTAFenceUFOSyncPrimBlockInt2) + { + psRGXKickSyncTAOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickSyncTA_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickSyncTAIN->phClientTAFenceUFOSyncPrimBlock, psRGXKickSyncTAIN->ui32ClientTAFenceCount * sizeof(IMG_HANDLE)) + || (OSCopyFromUser(NULL, hClientTAFenceUFOSyncPrimBlockInt2, psRGXKickSyncTAIN->phClientTAFenceUFOSyncPrimBlock, + psRGXKickSyncTAIN->ui32ClientTAFenceCount * sizeof(IMG_HANDLE)) != PVRSRV_OK) ) + { + psRGXKickSyncTAOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXKickSyncTA_exit; + } + if (psRGXKickSyncTAIN->ui32ClientTAFenceCount != 0) + { + ui32ClientTAFenceOffsetInt = OSAllocMem(psRGXKickSyncTAIN->ui32ClientTAFenceCount * sizeof(IMG_UINT32)); + if (!ui32ClientTAFenceOffsetInt) + { + psRGXKickSyncTAOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickSyncTA_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickSyncTAIN->pui32ClientTAFenceOffset, psRGXKickSyncTAIN->ui32ClientTAFenceCount * sizeof(IMG_UINT32)) + || (OSCopyFromUser(NULL, ui32ClientTAFenceOffsetInt, psRGXKickSyncTAIN->pui32ClientTAFenceOffset, + psRGXKickSyncTAIN->ui32ClientTAFenceCount * sizeof(IMG_UINT32)) != PVRSRV_OK) ) + { + psRGXKickSyncTAOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXKickSyncTA_exit; + } + if (psRGXKickSyncTAIN->ui32ClientTAFenceCount != 0) + { + ui32ClientTAFenceValueInt = OSAllocMem(psRGXKickSyncTAIN->ui32ClientTAFenceCount * sizeof(IMG_UINT32)); + if (!ui32ClientTAFenceValueInt) + { + psRGXKickSyncTAOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickSyncTA_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickSyncTAIN->pui32ClientTAFenceValue, psRGXKickSyncTAIN->ui32ClientTAFenceCount * sizeof(IMG_UINT32)) + || (OSCopyFromUser(NULL, ui32ClientTAFenceValueInt, psRGXKickSyncTAIN->pui32ClientTAFenceValue, + psRGXKickSyncTAIN->ui32ClientTAFenceCount * sizeof(IMG_UINT32)) != PVRSRV_OK) ) + { + psRGXKickSyncTAOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXKickSyncTA_exit; + } + if (psRGXKickSyncTAIN->ui32ClientTAUpdateCount != 0) + { + psClientTAUpdateUFOSyncPrimBlockInt = OSAllocMem(psRGXKickSyncTAIN->ui32ClientTAUpdateCount * sizeof(SYNC_PRIMITIVE_BLOCK *)); + if (!psClientTAUpdateUFOSyncPrimBlockInt) + { + psRGXKickSyncTAOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickSyncTA_exit; + } + hClientTAUpdateUFOSyncPrimBlockInt2 = OSAllocMem(psRGXKickSyncTAIN->ui32ClientTAUpdateCount * sizeof(IMG_HANDLE)); + if (!hClientTAUpdateUFOSyncPrimBlockInt2) + { + psRGXKickSyncTAOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickSyncTA_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickSyncTAIN->phClientTAUpdateUFOSyncPrimBlock, psRGXKickSyncTAIN->ui32ClientTAUpdateCount * sizeof(IMG_HANDLE)) + || (OSCopyFromUser(NULL, hClientTAUpdateUFOSyncPrimBlockInt2, psRGXKickSyncTAIN->phClientTAUpdateUFOSyncPrimBlock, + psRGXKickSyncTAIN->ui32ClientTAUpdateCount * sizeof(IMG_HANDLE)) != PVRSRV_OK) ) + { + psRGXKickSyncTAOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXKickSyncTA_exit; + } + if (psRGXKickSyncTAIN->ui32ClientTAUpdateCount != 0) + { + ui32ClientTAUpdateOffsetInt = OSAllocMem(psRGXKickSyncTAIN->ui32ClientTAUpdateCount * sizeof(IMG_UINT32)); + if (!ui32ClientTAUpdateOffsetInt) + { + psRGXKickSyncTAOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickSyncTA_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickSyncTAIN->pui32ClientTAUpdateOffset, psRGXKickSyncTAIN->ui32ClientTAUpdateCount * sizeof(IMG_UINT32)) + || (OSCopyFromUser(NULL, ui32ClientTAUpdateOffsetInt, psRGXKickSyncTAIN->pui32ClientTAUpdateOffset, + psRGXKickSyncTAIN->ui32ClientTAUpdateCount * sizeof(IMG_UINT32)) != PVRSRV_OK) ) + { + psRGXKickSyncTAOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXKickSyncTA_exit; + } + if (psRGXKickSyncTAIN->ui32ClientTAUpdateCount != 0) + { + ui32ClientTAUpdateValueInt = OSAllocMem(psRGXKickSyncTAIN->ui32ClientTAUpdateCount * sizeof(IMG_UINT32)); + if (!ui32ClientTAUpdateValueInt) + { + psRGXKickSyncTAOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickSyncTA_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickSyncTAIN->pui32ClientTAUpdateValue, psRGXKickSyncTAIN->ui32ClientTAUpdateCount * sizeof(IMG_UINT32)) + || (OSCopyFromUser(NULL, ui32ClientTAUpdateValueInt, psRGXKickSyncTAIN->pui32ClientTAUpdateValue, + psRGXKickSyncTAIN->ui32ClientTAUpdateCount * sizeof(IMG_UINT32)) != PVRSRV_OK) ) + { + psRGXKickSyncTAOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXKickSyncTA_exit; + } + if (psRGXKickSyncTAIN->ui32ServerTASyncPrims != 0) + { + ui32ServerTASyncFlagsInt = OSAllocMem(psRGXKickSyncTAIN->ui32ServerTASyncPrims * sizeof(IMG_UINT32)); + if (!ui32ServerTASyncFlagsInt) + { + psRGXKickSyncTAOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickSyncTA_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickSyncTAIN->pui32ServerTASyncFlags, psRGXKickSyncTAIN->ui32ServerTASyncPrims * sizeof(IMG_UINT32)) + || (OSCopyFromUser(NULL, ui32ServerTASyncFlagsInt, psRGXKickSyncTAIN->pui32ServerTASyncFlags, + psRGXKickSyncTAIN->ui32ServerTASyncPrims * sizeof(IMG_UINT32)) != PVRSRV_OK) ) + { + psRGXKickSyncTAOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXKickSyncTA_exit; + } + if (psRGXKickSyncTAIN->ui32ServerTASyncPrims != 0) + { + psServerTASyncsInt = OSAllocMem(psRGXKickSyncTAIN->ui32ServerTASyncPrims * sizeof(SERVER_SYNC_PRIMITIVE *)); + if (!psServerTASyncsInt) + { + psRGXKickSyncTAOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickSyncTA_exit; + } + hServerTASyncsInt2 = OSAllocMem(psRGXKickSyncTAIN->ui32ServerTASyncPrims * sizeof(IMG_HANDLE)); + if (!hServerTASyncsInt2) + { + psRGXKickSyncTAOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickSyncTA_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickSyncTAIN->phServerTASyncs, psRGXKickSyncTAIN->ui32ServerTASyncPrims * sizeof(IMG_HANDLE)) + || (OSCopyFromUser(NULL, hServerTASyncsInt2, psRGXKickSyncTAIN->phServerTASyncs, + psRGXKickSyncTAIN->ui32ServerTASyncPrims * sizeof(IMG_HANDLE)) != PVRSRV_OK) ) + { + psRGXKickSyncTAOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXKickSyncTA_exit; + } + if (psRGXKickSyncTAIN->ui32Client3DFenceCount != 0) + { + psClient3DFenceUFOSyncPrimBlockInt = OSAllocMem(psRGXKickSyncTAIN->ui32Client3DFenceCount * sizeof(SYNC_PRIMITIVE_BLOCK *)); + if (!psClient3DFenceUFOSyncPrimBlockInt) + { + psRGXKickSyncTAOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickSyncTA_exit; + } + hClient3DFenceUFOSyncPrimBlockInt2 = OSAllocMem(psRGXKickSyncTAIN->ui32Client3DFenceCount * sizeof(IMG_HANDLE)); + if (!hClient3DFenceUFOSyncPrimBlockInt2) + { + psRGXKickSyncTAOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickSyncTA_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickSyncTAIN->phClient3DFenceUFOSyncPrimBlock, psRGXKickSyncTAIN->ui32Client3DFenceCount * sizeof(IMG_HANDLE)) + || (OSCopyFromUser(NULL, hClient3DFenceUFOSyncPrimBlockInt2, psRGXKickSyncTAIN->phClient3DFenceUFOSyncPrimBlock, + psRGXKickSyncTAIN->ui32Client3DFenceCount * sizeof(IMG_HANDLE)) != PVRSRV_OK) ) + { + psRGXKickSyncTAOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXKickSyncTA_exit; + } + if (psRGXKickSyncTAIN->ui32Client3DFenceCount != 0) + { + ui32Client3DFenceOffsetInt = OSAllocMem(psRGXKickSyncTAIN->ui32Client3DFenceCount * sizeof(IMG_UINT32)); + if (!ui32Client3DFenceOffsetInt) + { + psRGXKickSyncTAOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickSyncTA_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickSyncTAIN->pui32Client3DFenceOffset, psRGXKickSyncTAIN->ui32Client3DFenceCount * sizeof(IMG_UINT32)) + || (OSCopyFromUser(NULL, ui32Client3DFenceOffsetInt, psRGXKickSyncTAIN->pui32Client3DFenceOffset, + psRGXKickSyncTAIN->ui32Client3DFenceCount * sizeof(IMG_UINT32)) != PVRSRV_OK) ) + { + psRGXKickSyncTAOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXKickSyncTA_exit; + } + if (psRGXKickSyncTAIN->ui32Client3DFenceCount != 0) + { + ui32Client3DFenceValueInt = OSAllocMem(psRGXKickSyncTAIN->ui32Client3DFenceCount * sizeof(IMG_UINT32)); + if (!ui32Client3DFenceValueInt) + { + psRGXKickSyncTAOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickSyncTA_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickSyncTAIN->pui32Client3DFenceValue, psRGXKickSyncTAIN->ui32Client3DFenceCount * sizeof(IMG_UINT32)) + || (OSCopyFromUser(NULL, ui32Client3DFenceValueInt, psRGXKickSyncTAIN->pui32Client3DFenceValue, + psRGXKickSyncTAIN->ui32Client3DFenceCount * sizeof(IMG_UINT32)) != PVRSRV_OK) ) + { + psRGXKickSyncTAOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXKickSyncTA_exit; + } + if (psRGXKickSyncTAIN->ui32Client3DUpdateCount != 0) + { + psClient3DUpdateUFOSyncPrimBlockInt = OSAllocMem(psRGXKickSyncTAIN->ui32Client3DUpdateCount * sizeof(SYNC_PRIMITIVE_BLOCK *)); + if (!psClient3DUpdateUFOSyncPrimBlockInt) + { + psRGXKickSyncTAOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickSyncTA_exit; + } + hClient3DUpdateUFOSyncPrimBlockInt2 = OSAllocMem(psRGXKickSyncTAIN->ui32Client3DUpdateCount * sizeof(IMG_HANDLE)); + if (!hClient3DUpdateUFOSyncPrimBlockInt2) + { + psRGXKickSyncTAOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickSyncTA_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickSyncTAIN->phClient3DUpdateUFOSyncPrimBlock, psRGXKickSyncTAIN->ui32Client3DUpdateCount * sizeof(IMG_HANDLE)) + || (OSCopyFromUser(NULL, hClient3DUpdateUFOSyncPrimBlockInt2, psRGXKickSyncTAIN->phClient3DUpdateUFOSyncPrimBlock, + psRGXKickSyncTAIN->ui32Client3DUpdateCount * sizeof(IMG_HANDLE)) != PVRSRV_OK) ) + { + psRGXKickSyncTAOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXKickSyncTA_exit; + } + if (psRGXKickSyncTAIN->ui32Client3DUpdateCount != 0) + { + ui32Client3DUpdateOffsetInt = OSAllocMem(psRGXKickSyncTAIN->ui32Client3DUpdateCount * sizeof(IMG_UINT32)); + if (!ui32Client3DUpdateOffsetInt) + { + psRGXKickSyncTAOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickSyncTA_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickSyncTAIN->pui32Client3DUpdateOffset, psRGXKickSyncTAIN->ui32Client3DUpdateCount * sizeof(IMG_UINT32)) + || (OSCopyFromUser(NULL, ui32Client3DUpdateOffsetInt, psRGXKickSyncTAIN->pui32Client3DUpdateOffset, + psRGXKickSyncTAIN->ui32Client3DUpdateCount * sizeof(IMG_UINT32)) != PVRSRV_OK) ) + { + psRGXKickSyncTAOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXKickSyncTA_exit; + } + if (psRGXKickSyncTAIN->ui32Client3DUpdateCount != 0) + { + ui32Client3DUpdateValueInt = OSAllocMem(psRGXKickSyncTAIN->ui32Client3DUpdateCount * sizeof(IMG_UINT32)); + if (!ui32Client3DUpdateValueInt) + { + psRGXKickSyncTAOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickSyncTA_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickSyncTAIN->pui32Client3DUpdateValue, psRGXKickSyncTAIN->ui32Client3DUpdateCount * sizeof(IMG_UINT32)) + || (OSCopyFromUser(NULL, ui32Client3DUpdateValueInt, psRGXKickSyncTAIN->pui32Client3DUpdateValue, + psRGXKickSyncTAIN->ui32Client3DUpdateCount * sizeof(IMG_UINT32)) != PVRSRV_OK) ) + { + psRGXKickSyncTAOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXKickSyncTA_exit; + } + if (psRGXKickSyncTAIN->ui32Server3DSyncPrims != 0) + { + ui32Server3DSyncFlagsInt = OSAllocMem(psRGXKickSyncTAIN->ui32Server3DSyncPrims * sizeof(IMG_UINT32)); + if (!ui32Server3DSyncFlagsInt) + { + psRGXKickSyncTAOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickSyncTA_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickSyncTAIN->pui32Server3DSyncFlags, psRGXKickSyncTAIN->ui32Server3DSyncPrims * sizeof(IMG_UINT32)) + || (OSCopyFromUser(NULL, ui32Server3DSyncFlagsInt, psRGXKickSyncTAIN->pui32Server3DSyncFlags, + psRGXKickSyncTAIN->ui32Server3DSyncPrims * sizeof(IMG_UINT32)) != PVRSRV_OK) ) + { + psRGXKickSyncTAOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXKickSyncTA_exit; + } + if (psRGXKickSyncTAIN->ui32Server3DSyncPrims != 0) + { + psServer3DSyncsInt = OSAllocMem(psRGXKickSyncTAIN->ui32Server3DSyncPrims * sizeof(SERVER_SYNC_PRIMITIVE *)); + if (!psServer3DSyncsInt) + { + psRGXKickSyncTAOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickSyncTA_exit; + } + hServer3DSyncsInt2 = OSAllocMem(psRGXKickSyncTAIN->ui32Server3DSyncPrims * sizeof(IMG_HANDLE)); + if (!hServer3DSyncsInt2) + { + psRGXKickSyncTAOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickSyncTA_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickSyncTAIN->phServer3DSyncs, psRGXKickSyncTAIN->ui32Server3DSyncPrims * sizeof(IMG_HANDLE)) + || (OSCopyFromUser(NULL, hServer3DSyncsInt2, psRGXKickSyncTAIN->phServer3DSyncs, + psRGXKickSyncTAIN->ui32Server3DSyncPrims * sizeof(IMG_HANDLE)) != PVRSRV_OK) ) + { + psRGXKickSyncTAOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXKickSyncTA_exit; + } + if (psRGXKickSyncTAIN->ui32NumCheckFenceFDs != 0) + { + i32CheckFenceFDsInt = OSAllocMem(psRGXKickSyncTAIN->ui32NumCheckFenceFDs * sizeof(IMG_INT32)); + if (!i32CheckFenceFDsInt) + { + psRGXKickSyncTAOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickSyncTA_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickSyncTAIN->pi32CheckFenceFDs, psRGXKickSyncTAIN->ui32NumCheckFenceFDs * sizeof(IMG_INT32)) + || (OSCopyFromUser(NULL, i32CheckFenceFDsInt, psRGXKickSyncTAIN->pi32CheckFenceFDs, + psRGXKickSyncTAIN->ui32NumCheckFenceFDs * sizeof(IMG_INT32)) != PVRSRV_OK) ) + { + psRGXKickSyncTAOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXKickSyncTA_exit; + } + + + + { + /* Look up the address from the handle */ + psRGXKickSyncTAOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psRenderContextInt, + psRGXKickSyncTAIN->hRenderContext, + PVRSRV_HANDLE_TYPE_RGX_SERVER_RENDER_CONTEXT); + if(psRGXKickSyncTAOUT->eError != PVRSRV_OK) + { + goto RGXKickSyncTA_exit; + } + } + + + { + IMG_UINT32 i; + + for (i=0;iui32ClientTAFenceCount;i++) + { + { + /* Look up the address from the handle */ + psRGXKickSyncTAOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psClientTAFenceUFOSyncPrimBlockInt[i], + hClientTAFenceUFOSyncPrimBlockInt2[i], + PVRSRV_HANDLE_TYPE_SYNC_PRIMITIVE_BLOCK); + if(psRGXKickSyncTAOUT->eError != PVRSRV_OK) + { + goto RGXKickSyncTA_exit; + } + } + + } + } + + { + IMG_UINT32 i; + + for (i=0;iui32ClientTAUpdateCount;i++) + { + { + /* Look up the address from the handle */ + psRGXKickSyncTAOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psClientTAUpdateUFOSyncPrimBlockInt[i], + hClientTAUpdateUFOSyncPrimBlockInt2[i], + PVRSRV_HANDLE_TYPE_SYNC_PRIMITIVE_BLOCK); + if(psRGXKickSyncTAOUT->eError != PVRSRV_OK) + { + goto RGXKickSyncTA_exit; + } + } + + } + } + + { + IMG_UINT32 i; + + for (i=0;iui32ServerTASyncPrims;i++) + { + { + /* Look up the address from the handle */ + psRGXKickSyncTAOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psServerTASyncsInt[i], + hServerTASyncsInt2[i], + PVRSRV_HANDLE_TYPE_SERVER_SYNC_PRIMITIVE); + if(psRGXKickSyncTAOUT->eError != PVRSRV_OK) + { + goto RGXKickSyncTA_exit; + } + } + + } + } + + { + IMG_UINT32 i; + + for (i=0;iui32Client3DFenceCount;i++) + { + { + /* Look up the address from the handle */ + psRGXKickSyncTAOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psClient3DFenceUFOSyncPrimBlockInt[i], + hClient3DFenceUFOSyncPrimBlockInt2[i], + PVRSRV_HANDLE_TYPE_SYNC_PRIMITIVE_BLOCK); + if(psRGXKickSyncTAOUT->eError != PVRSRV_OK) + { + goto RGXKickSyncTA_exit; + } + } + + } + } + + { + IMG_UINT32 i; + + for (i=0;iui32Client3DUpdateCount;i++) + { + { + /* Look up the address from the handle */ + psRGXKickSyncTAOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psClient3DUpdateUFOSyncPrimBlockInt[i], + hClient3DUpdateUFOSyncPrimBlockInt2[i], + PVRSRV_HANDLE_TYPE_SYNC_PRIMITIVE_BLOCK); + if(psRGXKickSyncTAOUT->eError != PVRSRV_OK) + { + goto RGXKickSyncTA_exit; + } + } + + } + } + + { + IMG_UINT32 i; + + for (i=0;iui32Server3DSyncPrims;i++) + { + { + /* Look up the address from the handle */ + psRGXKickSyncTAOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psServer3DSyncsInt[i], + hServer3DSyncsInt2[i], + PVRSRV_HANDLE_TYPE_SERVER_SYNC_PRIMITIVE); + if(psRGXKickSyncTAOUT->eError != PVRSRV_OK) + { + goto RGXKickSyncTA_exit; + } + } + + } + } + + psRGXKickSyncTAOUT->eError = + PVRSRVRGXKickSyncTAKM( + psRenderContextInt, + psRGXKickSyncTAIN->ui32ClientTAFenceCount, + psClientTAFenceUFOSyncPrimBlockInt, + ui32ClientTAFenceOffsetInt, + ui32ClientTAFenceValueInt, + psRGXKickSyncTAIN->ui32ClientTAUpdateCount, + psClientTAUpdateUFOSyncPrimBlockInt, + ui32ClientTAUpdateOffsetInt, + ui32ClientTAUpdateValueInt, + psRGXKickSyncTAIN->ui32ServerTASyncPrims, + ui32ServerTASyncFlagsInt, + psServerTASyncsInt, + psRGXKickSyncTAIN->ui32Client3DFenceCount, + psClient3DFenceUFOSyncPrimBlockInt, + ui32Client3DFenceOffsetInt, + ui32Client3DFenceValueInt, + psRGXKickSyncTAIN->ui32Client3DUpdateCount, + psClient3DUpdateUFOSyncPrimBlockInt, + ui32Client3DUpdateOffsetInt, + ui32Client3DUpdateValueInt, + psRGXKickSyncTAIN->ui32Server3DSyncPrims, + ui32Server3DSyncFlagsInt, + psServer3DSyncsInt, + psRGXKickSyncTAIN->ui32NumCheckFenceFDs, + i32CheckFenceFDsInt, + psRGXKickSyncTAIN->i32UpdateFenceFD, + psRGXKickSyncTAIN->bbPDumpContinuous); + + + + +RGXKickSyncTA_exit: + if (psClientTAFenceUFOSyncPrimBlockInt) + OSFreeMem(psClientTAFenceUFOSyncPrimBlockInt); + if (hClientTAFenceUFOSyncPrimBlockInt2) + OSFreeMem(hClientTAFenceUFOSyncPrimBlockInt2); + if (ui32ClientTAFenceOffsetInt) + OSFreeMem(ui32ClientTAFenceOffsetInt); + if (ui32ClientTAFenceValueInt) + OSFreeMem(ui32ClientTAFenceValueInt); + if (psClientTAUpdateUFOSyncPrimBlockInt) + OSFreeMem(psClientTAUpdateUFOSyncPrimBlockInt); + if (hClientTAUpdateUFOSyncPrimBlockInt2) + OSFreeMem(hClientTAUpdateUFOSyncPrimBlockInt2); + if (ui32ClientTAUpdateOffsetInt) + OSFreeMem(ui32ClientTAUpdateOffsetInt); + if (ui32ClientTAUpdateValueInt) + OSFreeMem(ui32ClientTAUpdateValueInt); + if (ui32ServerTASyncFlagsInt) + OSFreeMem(ui32ServerTASyncFlagsInt); + if (psServerTASyncsInt) + OSFreeMem(psServerTASyncsInt); + if (hServerTASyncsInt2) + OSFreeMem(hServerTASyncsInt2); + if (psClient3DFenceUFOSyncPrimBlockInt) + OSFreeMem(psClient3DFenceUFOSyncPrimBlockInt); + if (hClient3DFenceUFOSyncPrimBlockInt2) + OSFreeMem(hClient3DFenceUFOSyncPrimBlockInt2); + if (ui32Client3DFenceOffsetInt) + OSFreeMem(ui32Client3DFenceOffsetInt); + if (ui32Client3DFenceValueInt) + OSFreeMem(ui32Client3DFenceValueInt); + if (psClient3DUpdateUFOSyncPrimBlockInt) + OSFreeMem(psClient3DUpdateUFOSyncPrimBlockInt); + if (hClient3DUpdateUFOSyncPrimBlockInt2) + OSFreeMem(hClient3DUpdateUFOSyncPrimBlockInt2); + if (ui32Client3DUpdateOffsetInt) + OSFreeMem(ui32Client3DUpdateOffsetInt); + if (ui32Client3DUpdateValueInt) + OSFreeMem(ui32Client3DUpdateValueInt); + if (ui32Server3DSyncFlagsInt) + OSFreeMem(ui32Server3DSyncFlagsInt); + if (psServer3DSyncsInt) + OSFreeMem(psServer3DSyncsInt); + if (hServer3DSyncsInt2) + OSFreeMem(hServer3DSyncsInt2); + if (i32CheckFenceFDsInt) + OSFreeMem(i32CheckFenceFDsInt); + + return 0; +} + + + +/* *************************************************************************** + * Server bridge dispatch related glue + */ + + +PVRSRV_ERROR InitRGXTA3DBridge(IMG_VOID); +PVRSRV_ERROR DeinitRGXTA3DBridge(IMG_VOID); + +/* + * Register all RGXTA3D functions with services + */ +PVRSRV_ERROR InitRGXTA3DBridge(IMG_VOID) +{ + + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXTA3D, PVRSRV_BRIDGE_RGXTA3D_RGXCREATEHWRTDATA, PVRSRVBridgeRGXCreateHWRTData, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXTA3D, PVRSRV_BRIDGE_RGXTA3D_RGXDESTROYHWRTDATA, PVRSRVBridgeRGXDestroyHWRTData, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXTA3D, PVRSRV_BRIDGE_RGXTA3D_RGXCREATERENDERTARGET, PVRSRVBridgeRGXCreateRenderTarget, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXTA3D, PVRSRV_BRIDGE_RGXTA3D_RGXDESTROYRENDERTARGET, PVRSRVBridgeRGXDestroyRenderTarget, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXTA3D, PVRSRV_BRIDGE_RGXTA3D_RGXCREATEZSBUFFER, PVRSRVBridgeRGXCreateZSBuffer, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXTA3D, PVRSRV_BRIDGE_RGXTA3D_RGXDESTROYZSBUFFER, PVRSRVBridgeRGXDestroyZSBuffer, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXTA3D, PVRSRV_BRIDGE_RGXTA3D_RGXPOPULATEZSBUFFER, PVRSRVBridgeRGXPopulateZSBuffer, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXTA3D, PVRSRV_BRIDGE_RGXTA3D_RGXUNPOPULATEZSBUFFER, PVRSRVBridgeRGXUnpopulateZSBuffer, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXTA3D, PVRSRV_BRIDGE_RGXTA3D_RGXCREATEFREELIST, PVRSRVBridgeRGXCreateFreeList, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXTA3D, PVRSRV_BRIDGE_RGXTA3D_RGXDESTROYFREELIST, PVRSRVBridgeRGXDestroyFreeList, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXTA3D, PVRSRV_BRIDGE_RGXTA3D_RGXADDBLOCKTOFREELIST, PVRSRVBridgeRGXAddBlockToFreeList, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXTA3D, PVRSRV_BRIDGE_RGXTA3D_RGXREMOVEBLOCKFROMFREELIST, PVRSRVBridgeRGXRemoveBlockFromFreeList, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXTA3D, PVRSRV_BRIDGE_RGXTA3D_RGXCREATERENDERCONTEXT, PVRSRVBridgeRGXCreateRenderContext, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXTA3D, PVRSRV_BRIDGE_RGXTA3D_RGXDESTROYRENDERCONTEXT, PVRSRVBridgeRGXDestroyRenderContext, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXTA3D, PVRSRV_BRIDGE_RGXTA3D_RGXKICKTA3D, PVRSRVBridgeRGXKickTA3D, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXTA3D, PVRSRV_BRIDGE_RGXTA3D_RGXSETRENDERCONTEXTPRIORITY, PVRSRVBridgeRGXSetRenderContextPriority, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXTA3D, PVRSRV_BRIDGE_RGXTA3D_RGXGETLASTRENDERCONTEXTRESETREASON, PVRSRVBridgeRGXGetLastRenderContextResetReason, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXTA3D, PVRSRV_BRIDGE_RGXTA3D_RGXGETPARTIALRENDERCOUNT, PVRSRVBridgeRGXGetPartialRenderCount, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXTA3D, PVRSRV_BRIDGE_RGXTA3D_RGXKICKSYNCTA, PVRSRVBridgeRGXKickSyncTA, + IMG_NULL, IMG_NULL, + 0, 0); + + + return PVRSRV_OK; +} + +/* + * Unregister all rgxta3d functions with services + */ +PVRSRV_ERROR DeinitRGXTA3DBridge(IMG_VOID) +{ + return PVRSRV_OK; +} + diff --git a/drivers/gpu/rogue_m/generated/rgxtq_bridge/common_rgxtq_bridge.h b/drivers/gpu/rogue_m/generated/rgxtq_bridge/common_rgxtq_bridge.h new file mode 100644 index 000000000000..807bcec63f77 --- /dev/null +++ b/drivers/gpu/rogue_m/generated/rgxtq_bridge/common_rgxtq_bridge.h @@ -0,0 +1,192 @@ +/*************************************************************************/ /*! +@File +@Title Common bridge header for rgxtq +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Declares common defines and structures that are used by both + the client and sever side of the bridge for rgxtq +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef COMMON_RGXTQ_BRIDGE_H +#define COMMON_RGXTQ_BRIDGE_H + +#include "img_types.h" +#include "pvrsrv_error.h" + +#include "rgx_bridge.h" +#include "sync_external.h" +#include "rgx_fwif_shared.h" + + +#define PVRSRV_BRIDGE_RGXTQ_CMD_FIRST 0 +#define PVRSRV_BRIDGE_RGXTQ_RGXCREATETRANSFERCONTEXT PVRSRV_BRIDGE_RGXTQ_CMD_FIRST+0 +#define PVRSRV_BRIDGE_RGXTQ_RGXDESTROYTRANSFERCONTEXT PVRSRV_BRIDGE_RGXTQ_CMD_FIRST+1 +#define PVRSRV_BRIDGE_RGXTQ_RGXSUBMITTRANSFER PVRSRV_BRIDGE_RGXTQ_CMD_FIRST+2 +#define PVRSRV_BRIDGE_RGXTQ_RGXSETTRANSFERCONTEXTPRIORITY PVRSRV_BRIDGE_RGXTQ_CMD_FIRST+3 +#define PVRSRV_BRIDGE_RGXTQ_RGXKICKSYNCTRANSFER PVRSRV_BRIDGE_RGXTQ_CMD_FIRST+4 +#define PVRSRV_BRIDGE_RGXTQ_CMD_LAST (PVRSRV_BRIDGE_RGXTQ_CMD_FIRST+4) + + +/******************************************* + RGXCreateTransferContext + *******************************************/ + +/* Bridge in structure for RGXCreateTransferContext */ +typedef struct PVRSRV_BRIDGE_IN_RGXCREATETRANSFERCONTEXT_TAG +{ + IMG_HANDLE hDevNode; + IMG_UINT32 ui32Priority; + IMG_DEV_VIRTADDR sMCUFenceAddr; + IMG_UINT32 ui32FrameworkCmdize; + IMG_BYTE * psFrameworkCmd; + IMG_HANDLE hPrivData; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXCREATETRANSFERCONTEXT; + + +/* Bridge out structure for RGXCreateTransferContext */ +typedef struct PVRSRV_BRIDGE_OUT_RGXCREATETRANSFERCONTEXT_TAG +{ + IMG_HANDLE hTransferContext; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXCREATETRANSFERCONTEXT; + +/******************************************* + RGXDestroyTransferContext + *******************************************/ + +/* Bridge in structure for RGXDestroyTransferContext */ +typedef struct PVRSRV_BRIDGE_IN_RGXDESTROYTRANSFERCONTEXT_TAG +{ + IMG_HANDLE hTransferContext; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXDESTROYTRANSFERCONTEXT; + + +/* Bridge out structure for RGXDestroyTransferContext */ +typedef struct PVRSRV_BRIDGE_OUT_RGXDESTROYTRANSFERCONTEXT_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXDESTROYTRANSFERCONTEXT; + +/******************************************* + RGXSubmitTransfer + *******************************************/ + +/* Bridge in structure for RGXSubmitTransfer */ +typedef struct PVRSRV_BRIDGE_IN_RGXSUBMITTRANSFER_TAG +{ + IMG_HANDLE hTransferContext; + IMG_UINT32 ui32PrepareCount; + IMG_UINT32 * pui32ClientFenceCount; + IMG_HANDLE* * phFenceUFOSyncPrimBlock; + IMG_UINT32* * pui32FenceSyncOffset; + IMG_UINT32* * pui32FenceValue; + IMG_UINT32 * pui32ClientUpdateCount; + IMG_HANDLE* * phUpdateUFOSyncPrimBlock; + IMG_UINT32* * pui32UpdateSyncOffset; + IMG_UINT32* * pui32UpdateValue; + IMG_UINT32 * pui32ServerSyncCount; + IMG_UINT32* * pui32ServerSyncFlags; + IMG_HANDLE* * phServerSync; + IMG_UINT32 ui32NumCheckFenceFDs; + IMG_INT32 * pi32CheckFenceFDs; + IMG_INT32 i32UpdateFenceFD; + IMG_UINT32 * pui32CommandSize; + IMG_UINT8* * pui8FWCommand; + IMG_UINT32 * pui32TQPrepareFlags; + IMG_UINT32 ui32ExternalJobReference; + IMG_UINT32 ui32InternalJobReference; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXSUBMITTRANSFER; + + +/* Bridge out structure for RGXSubmitTransfer */ +typedef struct PVRSRV_BRIDGE_OUT_RGXSUBMITTRANSFER_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXSUBMITTRANSFER; + +/******************************************* + RGXSetTransferContextPriority + *******************************************/ + +/* Bridge in structure for RGXSetTransferContextPriority */ +typedef struct PVRSRV_BRIDGE_IN_RGXSETTRANSFERCONTEXTPRIORITY_TAG +{ + IMG_HANDLE hTransferContext; + IMG_UINT32 ui32Priority; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXSETTRANSFERCONTEXTPRIORITY; + + +/* Bridge out structure for RGXSetTransferContextPriority */ +typedef struct PVRSRV_BRIDGE_OUT_RGXSETTRANSFERCONTEXTPRIORITY_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXSETTRANSFERCONTEXTPRIORITY; + +/******************************************* + RGXKickSyncTransfer + *******************************************/ + +/* Bridge in structure for RGXKickSyncTransfer */ +typedef struct PVRSRV_BRIDGE_IN_RGXKICKSYNCTRANSFER_TAG +{ + IMG_HANDLE hTransferContext; + IMG_UINT32 ui32ClientFenceCount; + IMG_HANDLE * phClientFenceUFOSyncPrimBlock; + IMG_UINT32 * pui32ClientFenceSyncOffset; + IMG_UINT32 * pui32ClientFenceValue; + IMG_UINT32 ui32ClientUpdateCount; + IMG_HANDLE * phClientUpdateUFOSyncPrimBlock; + IMG_UINT32 * pui32ClientUpdateSyncOffset; + IMG_UINT32 * pui32ClientUpdateValue; + IMG_UINT32 ui32ServerSyncCount; + IMG_UINT32 * pui32ServerSyncFlags; + IMG_HANDLE * phServerSyncs; + IMG_UINT32 ui32NumCheckFenceFDs; + IMG_INT32 * pi32CheckFenceFDs; + IMG_INT32 i32UpdateFenceFD; + IMG_UINT32 ui32TQPrepareFlags; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXKICKSYNCTRANSFER; + + +/* Bridge out structure for RGXKickSyncTransfer */ +typedef struct PVRSRV_BRIDGE_OUT_RGXKICKSYNCTRANSFER_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXKICKSYNCTRANSFER; + +#endif /* COMMON_RGXTQ_BRIDGE_H */ diff --git a/drivers/gpu/rogue_m/generated/rgxtq_bridge/server_rgxtq_bridge.c b/drivers/gpu/rogue_m/generated/rgxtq_bridge/server_rgxtq_bridge.c new file mode 100644 index 000000000000..f57d77331a38 --- /dev/null +++ b/drivers/gpu/rogue_m/generated/rgxtq_bridge/server_rgxtq_bridge.c @@ -0,0 +1,1713 @@ +/*************************************************************************/ /*! +@File +@Title Server bridge for rgxtq +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Implements the server side of the bridge for rgxtq +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#include +#include + +#include "img_defs.h" + +#include "rgxtransfer.h" + + +#include "common_rgxtq_bridge.h" + +#include "allocmem.h" +#include "pvr_debug.h" +#include "connection_server.h" +#include "pvr_bridge.h" +#include "rgx_bridge.h" +#include "srvcore.h" +#include "handle.h" + +#if defined (SUPPORT_AUTH) +#include "osauth.h" +#endif + +#include + + + + +/* *************************************************************************** + * Server-side bridge entry points + */ + +static IMG_INT +PVRSRVBridgeRGXCreateTransferContext(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_RGXCREATETRANSFERCONTEXT *psRGXCreateTransferContextIN, + PVRSRV_BRIDGE_OUT_RGXCREATETRANSFERCONTEXT *psRGXCreateTransferContextOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevNodeInt = IMG_NULL; + IMG_BYTE *psFrameworkCmdInt = IMG_NULL; + IMG_HANDLE hPrivDataInt = IMG_NULL; + RGX_SERVER_TQ_CONTEXT * psTransferContextInt = IMG_NULL; + + + + + if (psRGXCreateTransferContextIN->ui32FrameworkCmdize != 0) + { + psFrameworkCmdInt = OSAllocMem(psRGXCreateTransferContextIN->ui32FrameworkCmdize * sizeof(IMG_BYTE)); + if (!psFrameworkCmdInt) + { + psRGXCreateTransferContextOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXCreateTransferContext_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXCreateTransferContextIN->psFrameworkCmd, psRGXCreateTransferContextIN->ui32FrameworkCmdize * sizeof(IMG_BYTE)) + || (OSCopyFromUser(NULL, psFrameworkCmdInt, psRGXCreateTransferContextIN->psFrameworkCmd, + psRGXCreateTransferContextIN->ui32FrameworkCmdize * sizeof(IMG_BYTE)) != PVRSRV_OK) ) + { + psRGXCreateTransferContextOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXCreateTransferContext_exit; + } + + + + { + /* Look up the address from the handle */ + psRGXCreateTransferContextOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &hDevNodeInt, + psRGXCreateTransferContextIN->hDevNode, + PVRSRV_HANDLE_TYPE_DEV_NODE); + if(psRGXCreateTransferContextOUT->eError != PVRSRV_OK) + { + goto RGXCreateTransferContext_exit; + } + } + + + { + /* Look up the address from the handle */ + psRGXCreateTransferContextOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &hPrivDataInt, + psRGXCreateTransferContextIN->hPrivData, + PVRSRV_HANDLE_TYPE_DEV_PRIV_DATA); + if(psRGXCreateTransferContextOUT->eError != PVRSRV_OK) + { + goto RGXCreateTransferContext_exit; + } + } + + + psRGXCreateTransferContextOUT->eError = + PVRSRVRGXCreateTransferContextKM(psConnection, + hDevNodeInt, + psRGXCreateTransferContextIN->ui32Priority, + psRGXCreateTransferContextIN->sMCUFenceAddr, + psRGXCreateTransferContextIN->ui32FrameworkCmdize, + psFrameworkCmdInt, + hPrivDataInt, + &psTransferContextInt); + /* Exit early if bridged call fails */ + if(psRGXCreateTransferContextOUT->eError != PVRSRV_OK) + { + goto RGXCreateTransferContext_exit; + } + + + psRGXCreateTransferContextOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psRGXCreateTransferContextOUT->hTransferContext, + (IMG_VOID *) psTransferContextInt, + PVRSRV_HANDLE_TYPE_RGX_SERVER_TQ_CONTEXT, + PVRSRV_HANDLE_ALLOC_FLAG_MULTI + ,(PFN_HANDLE_RELEASE)&PVRSRVRGXDestroyTransferContextKM); + if (psRGXCreateTransferContextOUT->eError != PVRSRV_OK) + { + goto RGXCreateTransferContext_exit; + } + + + + +RGXCreateTransferContext_exit: + if (psRGXCreateTransferContextOUT->eError != PVRSRV_OK) + { + if (psTransferContextInt) + { + PVRSRVRGXDestroyTransferContextKM(psTransferContextInt); + } + } + + if (psFrameworkCmdInt) + OSFreeMem(psFrameworkCmdInt); + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXDestroyTransferContext(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_RGXDESTROYTRANSFERCONTEXT *psRGXDestroyTransferContextIN, + PVRSRV_BRIDGE_OUT_RGXDESTROYTRANSFERCONTEXT *psRGXDestroyTransferContextOUT, + CONNECTION_DATA *psConnection) +{ + + + + + + + + + + psRGXDestroyTransferContextOUT->eError = + PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psRGXDestroyTransferContextIN->hTransferContext, + PVRSRV_HANDLE_TYPE_RGX_SERVER_TQ_CONTEXT); + if ((psRGXDestroyTransferContextOUT->eError != PVRSRV_OK) && (psRGXDestroyTransferContextOUT->eError != PVRSRV_ERROR_RETRY)) + { + PVR_ASSERT(0); + goto RGXDestroyTransferContext_exit; + } + + + +RGXDestroyTransferContext_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXSubmitTransfer(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_RGXSUBMITTRANSFER *psRGXSubmitTransferIN, + PVRSRV_BRIDGE_OUT_RGXSUBMITTRANSFER *psRGXSubmitTransferOUT, + CONNECTION_DATA *psConnection) +{ + RGX_SERVER_TQ_CONTEXT * psTransferContextInt = IMG_NULL; + IMG_UINT32 *ui32ClientFenceCountInt = IMG_NULL; + SYNC_PRIMITIVE_BLOCK * **psFenceUFOSyncPrimBlockInt = IMG_NULL; + IMG_HANDLE **hFenceUFOSyncPrimBlockInt2 = IMG_NULL; + IMG_UINT32 **ui32FenceSyncOffsetInt = IMG_NULL; + IMG_UINT32 **ui32FenceValueInt = IMG_NULL; + IMG_UINT32 *ui32ClientUpdateCountInt = IMG_NULL; + SYNC_PRIMITIVE_BLOCK * **psUpdateUFOSyncPrimBlockInt = IMG_NULL; + IMG_HANDLE **hUpdateUFOSyncPrimBlockInt2 = IMG_NULL; + IMG_UINT32 **ui32UpdateSyncOffsetInt = IMG_NULL; + IMG_UINT32 **ui32UpdateValueInt = IMG_NULL; + IMG_UINT32 *ui32ServerSyncCountInt = IMG_NULL; + IMG_UINT32 **ui32ServerSyncFlagsInt = IMG_NULL; + SERVER_SYNC_PRIMITIVE * **psServerSyncInt = IMG_NULL; + IMG_HANDLE **hServerSyncInt2 = IMG_NULL; + IMG_INT32 *i32CheckFenceFDsInt = IMG_NULL; + IMG_UINT32 *ui32CommandSizeInt = IMG_NULL; + IMG_UINT8 **ui8FWCommandInt = IMG_NULL; + IMG_UINT32 *ui32TQPrepareFlagsInt = IMG_NULL; + + + + + if (psRGXSubmitTransferIN->ui32PrepareCount != 0) + { + ui32ClientFenceCountInt = OSAllocMem(psRGXSubmitTransferIN->ui32PrepareCount * sizeof(IMG_UINT32)); + if (!ui32ClientFenceCountInt) + { + psRGXSubmitTransferOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXSubmitTransfer_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXSubmitTransferIN->pui32ClientFenceCount, psRGXSubmitTransferIN->ui32PrepareCount * sizeof(IMG_UINT32)) + || (OSCopyFromUser(NULL, ui32ClientFenceCountInt, psRGXSubmitTransferIN->pui32ClientFenceCount, + psRGXSubmitTransferIN->ui32PrepareCount * sizeof(IMG_UINT32)) != PVRSRV_OK) ) + { + psRGXSubmitTransferOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXSubmitTransfer_exit; + } + if (psRGXSubmitTransferIN->ui32PrepareCount != 0) + { + IMG_UINT32 ui32Pass=0; + IMG_UINT32 i; + IMG_UINT32 ui32AllocSize=0; + IMG_UINT32 ui32Size; + IMG_UINT8 *pui8Ptr = IMG_NULL; + IMG_UINT32 ui32AllocSize2=0; + IMG_UINT32 ui32Size2; + IMG_UINT8 *pui8Ptr2 = IMG_NULL; + + /* + Two pass loop, 1st find out the size and 2nd allocation and set offsets. + Keeps allocation cost down and simplifies the free path + */ + for (ui32Pass=0;ui32Pass<2;ui32Pass++) + { + ui32Size = psRGXSubmitTransferIN->ui32PrepareCount * sizeof(SYNC_PRIMITIVE_BLOCK * *); + ui32Size2 = psRGXSubmitTransferIN->ui32PrepareCount * sizeof(IMG_HANDLE *); + if (ui32Pass == 0) + { + ui32AllocSize += ui32Size; + ui32AllocSize2 += ui32Size2; + } + else + { + pui8Ptr = OSAllocMem(ui32AllocSize); + if (pui8Ptr == IMG_NULL) + { + psRGXSubmitTransferOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + goto RGXSubmitTransfer_exit; + } + psFenceUFOSyncPrimBlockInt = (SYNC_PRIMITIVE_BLOCK * **) pui8Ptr; + pui8Ptr += ui32Size; + pui8Ptr2 = OSAllocMem(ui32AllocSize2); + if (pui8Ptr2 == IMG_NULL) + { + psRGXSubmitTransferOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + goto RGXSubmitTransfer_exit; + } + hFenceUFOSyncPrimBlockInt2 = (IMG_HANDLE **) pui8Ptr2; + pui8Ptr2 += ui32Size2; + } + + for (i=0;iui32PrepareCount;i++) + { + ui32Size = ui32ClientFenceCountInt[i] * sizeof(SYNC_PRIMITIVE_BLOCK *); + ui32Size2 = ui32ClientFenceCountInt[i] * sizeof(IMG_HANDLE); + if (ui32Size) + { + if (ui32Pass == 0) + { + ui32AllocSize += ui32Size; + ui32AllocSize2 += ui32Size2; + } + else + { + psFenceUFOSyncPrimBlockInt[i] = (SYNC_PRIMITIVE_BLOCK * *) pui8Ptr; + pui8Ptr += ui32Size; + hFenceUFOSyncPrimBlockInt2[i] = (IMG_HANDLE *) pui8Ptr2; + pui8Ptr2 += ui32Size2; + } + } + } + } + } + + { + IMG_UINT32 i; + IMG_HANDLE **psPtr; + + /* Loop over all the pointers in the array copying the data into the kernel */ + for (i=0;iui32PrepareCount;i++) + { + /* Copy the pointer over from the client side */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) &psRGXSubmitTransferIN->phFenceUFOSyncPrimBlock[i], sizeof(IMG_HANDLE **)) + || (OSCopyFromUser(NULL, &psPtr, &psRGXSubmitTransferIN->phFenceUFOSyncPrimBlock[i], + sizeof(IMG_HANDLE **)) != PVRSRV_OK) ) + { + psRGXSubmitTransferOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXSubmitTransfer_exit; + } + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psPtr, (ui32ClientFenceCountInt[i] * sizeof(IMG_HANDLE))) + || (OSCopyFromUser(NULL, (hFenceUFOSyncPrimBlockInt2[i]), psPtr, + (ui32ClientFenceCountInt[i] * sizeof(IMG_HANDLE))) != PVRSRV_OK) ) + { + psRGXSubmitTransferOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXSubmitTransfer_exit; + } + } + } + if (psRGXSubmitTransferIN->ui32PrepareCount != 0) + { + IMG_UINT32 ui32Pass=0; + IMG_UINT32 i; + IMG_UINT32 ui32AllocSize=0; + IMG_UINT32 ui32Size; + IMG_UINT8 *pui8Ptr = IMG_NULL; + + /* + Two pass loop, 1st find out the size and 2nd allocation and set offsets. + Keeps allocation cost down and simplifies the free path + */ + for (ui32Pass=0;ui32Pass<2;ui32Pass++) + { + ui32Size = psRGXSubmitTransferIN->ui32PrepareCount * sizeof(IMG_UINT32 *); + if (ui32Pass == 0) + { + ui32AllocSize += ui32Size; + } + else + { + pui8Ptr = OSAllocMem(ui32AllocSize); + if (pui8Ptr == IMG_NULL) + { + psRGXSubmitTransferOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + goto RGXSubmitTransfer_exit; + } + ui32FenceSyncOffsetInt = (IMG_UINT32 **) pui8Ptr; + pui8Ptr += ui32Size; + } + + for (i=0;iui32PrepareCount;i++) + { + ui32Size = ui32ClientFenceCountInt[i] * sizeof(IMG_UINT32); + if (ui32Size) + { + if (ui32Pass == 0) + { + ui32AllocSize += ui32Size; + } + else + { + ui32FenceSyncOffsetInt[i] = (IMG_UINT32 *) pui8Ptr; + pui8Ptr += ui32Size; + } + } + } + } + } + + { + IMG_UINT32 i; + IMG_UINT32 **psPtr; + + /* Loop over all the pointers in the array copying the data into the kernel */ + for (i=0;iui32PrepareCount;i++) + { + /* Copy the pointer over from the client side */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) &psRGXSubmitTransferIN->pui32FenceSyncOffset[i], sizeof(IMG_UINT32 **)) + || (OSCopyFromUser(NULL, &psPtr, &psRGXSubmitTransferIN->pui32FenceSyncOffset[i], + sizeof(IMG_UINT32 **)) != PVRSRV_OK) ) + { + psRGXSubmitTransferOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXSubmitTransfer_exit; + } + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psPtr, (ui32ClientFenceCountInt[i] * sizeof(IMG_UINT32))) + || (OSCopyFromUser(NULL, (ui32FenceSyncOffsetInt[i]), psPtr, + (ui32ClientFenceCountInt[i] * sizeof(IMG_UINT32))) != PVRSRV_OK) ) + { + psRGXSubmitTransferOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXSubmitTransfer_exit; + } + } + } + if (psRGXSubmitTransferIN->ui32PrepareCount != 0) + { + IMG_UINT32 ui32Pass=0; + IMG_UINT32 i; + IMG_UINT32 ui32AllocSize=0; + IMG_UINT32 ui32Size; + IMG_UINT8 *pui8Ptr = IMG_NULL; + + /* + Two pass loop, 1st find out the size and 2nd allocation and set offsets. + Keeps allocation cost down and simplifies the free path + */ + for (ui32Pass=0;ui32Pass<2;ui32Pass++) + { + ui32Size = psRGXSubmitTransferIN->ui32PrepareCount * sizeof(IMG_UINT32 *); + if (ui32Pass == 0) + { + ui32AllocSize += ui32Size; + } + else + { + pui8Ptr = OSAllocMem(ui32AllocSize); + if (pui8Ptr == IMG_NULL) + { + psRGXSubmitTransferOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + goto RGXSubmitTransfer_exit; + } + ui32FenceValueInt = (IMG_UINT32 **) pui8Ptr; + pui8Ptr += ui32Size; + } + + for (i=0;iui32PrepareCount;i++) + { + ui32Size = ui32ClientFenceCountInt[i] * sizeof(IMG_UINT32); + if (ui32Size) + { + if (ui32Pass == 0) + { + ui32AllocSize += ui32Size; + } + else + { + ui32FenceValueInt[i] = (IMG_UINT32 *) pui8Ptr; + pui8Ptr += ui32Size; + } + } + } + } + } + + { + IMG_UINT32 i; + IMG_UINT32 **psPtr; + + /* Loop over all the pointers in the array copying the data into the kernel */ + for (i=0;iui32PrepareCount;i++) + { + /* Copy the pointer over from the client side */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) &psRGXSubmitTransferIN->pui32FenceValue[i], sizeof(IMG_UINT32 **)) + || (OSCopyFromUser(NULL, &psPtr, &psRGXSubmitTransferIN->pui32FenceValue[i], + sizeof(IMG_UINT32 **)) != PVRSRV_OK) ) + { + psRGXSubmitTransferOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXSubmitTransfer_exit; + } + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psPtr, (ui32ClientFenceCountInt[i] * sizeof(IMG_UINT32))) + || (OSCopyFromUser(NULL, (ui32FenceValueInt[i]), psPtr, + (ui32ClientFenceCountInt[i] * sizeof(IMG_UINT32))) != PVRSRV_OK) ) + { + psRGXSubmitTransferOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXSubmitTransfer_exit; + } + } + } + if (psRGXSubmitTransferIN->ui32PrepareCount != 0) + { + ui32ClientUpdateCountInt = OSAllocMem(psRGXSubmitTransferIN->ui32PrepareCount * sizeof(IMG_UINT32)); + if (!ui32ClientUpdateCountInt) + { + psRGXSubmitTransferOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXSubmitTransfer_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXSubmitTransferIN->pui32ClientUpdateCount, psRGXSubmitTransferIN->ui32PrepareCount * sizeof(IMG_UINT32)) + || (OSCopyFromUser(NULL, ui32ClientUpdateCountInt, psRGXSubmitTransferIN->pui32ClientUpdateCount, + psRGXSubmitTransferIN->ui32PrepareCount * sizeof(IMG_UINT32)) != PVRSRV_OK) ) + { + psRGXSubmitTransferOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXSubmitTransfer_exit; + } + if (psRGXSubmitTransferIN->ui32PrepareCount != 0) + { + IMG_UINT32 ui32Pass=0; + IMG_UINT32 i; + IMG_UINT32 ui32AllocSize=0; + IMG_UINT32 ui32Size; + IMG_UINT8 *pui8Ptr = IMG_NULL; + IMG_UINT32 ui32AllocSize2=0; + IMG_UINT32 ui32Size2; + IMG_UINT8 *pui8Ptr2 = IMG_NULL; + + /* + Two pass loop, 1st find out the size and 2nd allocation and set offsets. + Keeps allocation cost down and simplifies the free path + */ + for (ui32Pass=0;ui32Pass<2;ui32Pass++) + { + ui32Size = psRGXSubmitTransferIN->ui32PrepareCount * sizeof(SYNC_PRIMITIVE_BLOCK * *); + ui32Size2 = psRGXSubmitTransferIN->ui32PrepareCount * sizeof(IMG_HANDLE *); + if (ui32Pass == 0) + { + ui32AllocSize += ui32Size; + ui32AllocSize2 += ui32Size2; + } + else + { + pui8Ptr = OSAllocMem(ui32AllocSize); + if (pui8Ptr == IMG_NULL) + { + psRGXSubmitTransferOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + goto RGXSubmitTransfer_exit; + } + psUpdateUFOSyncPrimBlockInt = (SYNC_PRIMITIVE_BLOCK * **) pui8Ptr; + pui8Ptr += ui32Size; + pui8Ptr2 = OSAllocMem(ui32AllocSize2); + if (pui8Ptr2 == IMG_NULL) + { + psRGXSubmitTransferOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + goto RGXSubmitTransfer_exit; + } + hUpdateUFOSyncPrimBlockInt2 = (IMG_HANDLE **) pui8Ptr2; + pui8Ptr2 += ui32Size2; + } + + for (i=0;iui32PrepareCount;i++) + { + ui32Size = ui32ClientUpdateCountInt[i] * sizeof(SYNC_PRIMITIVE_BLOCK *); + ui32Size2 = ui32ClientUpdateCountInt[i] * sizeof(IMG_HANDLE); + if (ui32Size) + { + if (ui32Pass == 0) + { + ui32AllocSize += ui32Size; + ui32AllocSize2 += ui32Size2; + } + else + { + psUpdateUFOSyncPrimBlockInt[i] = (SYNC_PRIMITIVE_BLOCK * *) pui8Ptr; + pui8Ptr += ui32Size; + hUpdateUFOSyncPrimBlockInt2[i] = (IMG_HANDLE *) pui8Ptr2; + pui8Ptr2 += ui32Size2; + } + } + } + } + } + + { + IMG_UINT32 i; + IMG_HANDLE **psPtr; + + /* Loop over all the pointers in the array copying the data into the kernel */ + for (i=0;iui32PrepareCount;i++) + { + /* Copy the pointer over from the client side */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) &psRGXSubmitTransferIN->phUpdateUFOSyncPrimBlock[i], sizeof(IMG_HANDLE **)) + || (OSCopyFromUser(NULL, &psPtr, &psRGXSubmitTransferIN->phUpdateUFOSyncPrimBlock[i], + sizeof(IMG_HANDLE **)) != PVRSRV_OK) ) + { + psRGXSubmitTransferOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXSubmitTransfer_exit; + } + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psPtr, (ui32ClientUpdateCountInt[i] * sizeof(IMG_HANDLE))) + || (OSCopyFromUser(NULL, (hUpdateUFOSyncPrimBlockInt2[i]), psPtr, + (ui32ClientUpdateCountInt[i] * sizeof(IMG_HANDLE))) != PVRSRV_OK) ) + { + psRGXSubmitTransferOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXSubmitTransfer_exit; + } + } + } + if (psRGXSubmitTransferIN->ui32PrepareCount != 0) + { + IMG_UINT32 ui32Pass=0; + IMG_UINT32 i; + IMG_UINT32 ui32AllocSize=0; + IMG_UINT32 ui32Size; + IMG_UINT8 *pui8Ptr = IMG_NULL; + + /* + Two pass loop, 1st find out the size and 2nd allocation and set offsets. + Keeps allocation cost down and simplifies the free path + */ + for (ui32Pass=0;ui32Pass<2;ui32Pass++) + { + ui32Size = psRGXSubmitTransferIN->ui32PrepareCount * sizeof(IMG_UINT32 *); + if (ui32Pass == 0) + { + ui32AllocSize += ui32Size; + } + else + { + pui8Ptr = OSAllocMem(ui32AllocSize); + if (pui8Ptr == IMG_NULL) + { + psRGXSubmitTransferOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + goto RGXSubmitTransfer_exit; + } + ui32UpdateSyncOffsetInt = (IMG_UINT32 **) pui8Ptr; + pui8Ptr += ui32Size; + } + + for (i=0;iui32PrepareCount;i++) + { + ui32Size = ui32ClientUpdateCountInt[i] * sizeof(IMG_UINT32); + if (ui32Size) + { + if (ui32Pass == 0) + { + ui32AllocSize += ui32Size; + } + else + { + ui32UpdateSyncOffsetInt[i] = (IMG_UINT32 *) pui8Ptr; + pui8Ptr += ui32Size; + } + } + } + } + } + + { + IMG_UINT32 i; + IMG_UINT32 **psPtr; + + /* Loop over all the pointers in the array copying the data into the kernel */ + for (i=0;iui32PrepareCount;i++) + { + /* Copy the pointer over from the client side */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) &psRGXSubmitTransferIN->pui32UpdateSyncOffset[i], sizeof(IMG_UINT32 **)) + || (OSCopyFromUser(NULL, &psPtr, &psRGXSubmitTransferIN->pui32UpdateSyncOffset[i], + sizeof(IMG_UINT32 **)) != PVRSRV_OK) ) + { + psRGXSubmitTransferOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXSubmitTransfer_exit; + } + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psPtr, (ui32ClientUpdateCountInt[i] * sizeof(IMG_UINT32))) + || (OSCopyFromUser(NULL, (ui32UpdateSyncOffsetInt[i]), psPtr, + (ui32ClientUpdateCountInt[i] * sizeof(IMG_UINT32))) != PVRSRV_OK) ) + { + psRGXSubmitTransferOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXSubmitTransfer_exit; + } + } + } + if (psRGXSubmitTransferIN->ui32PrepareCount != 0) + { + IMG_UINT32 ui32Pass=0; + IMG_UINT32 i; + IMG_UINT32 ui32AllocSize=0; + IMG_UINT32 ui32Size; + IMG_UINT8 *pui8Ptr = IMG_NULL; + + /* + Two pass loop, 1st find out the size and 2nd allocation and set offsets. + Keeps allocation cost down and simplifies the free path + */ + for (ui32Pass=0;ui32Pass<2;ui32Pass++) + { + ui32Size = psRGXSubmitTransferIN->ui32PrepareCount * sizeof(IMG_UINT32 *); + if (ui32Pass == 0) + { + ui32AllocSize += ui32Size; + } + else + { + pui8Ptr = OSAllocMem(ui32AllocSize); + if (pui8Ptr == IMG_NULL) + { + psRGXSubmitTransferOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + goto RGXSubmitTransfer_exit; + } + ui32UpdateValueInt = (IMG_UINT32 **) pui8Ptr; + pui8Ptr += ui32Size; + } + + for (i=0;iui32PrepareCount;i++) + { + ui32Size = ui32ClientUpdateCountInt[i] * sizeof(IMG_UINT32); + if (ui32Size) + { + if (ui32Pass == 0) + { + ui32AllocSize += ui32Size; + } + else + { + ui32UpdateValueInt[i] = (IMG_UINT32 *) pui8Ptr; + pui8Ptr += ui32Size; + } + } + } + } + } + + { + IMG_UINT32 i; + IMG_UINT32 **psPtr; + + /* Loop over all the pointers in the array copying the data into the kernel */ + for (i=0;iui32PrepareCount;i++) + { + /* Copy the pointer over from the client side */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) &psRGXSubmitTransferIN->pui32UpdateValue[i], sizeof(IMG_UINT32 **)) + || (OSCopyFromUser(NULL, &psPtr, &psRGXSubmitTransferIN->pui32UpdateValue[i], + sizeof(IMG_UINT32 **)) != PVRSRV_OK) ) + { + psRGXSubmitTransferOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXSubmitTransfer_exit; + } + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psPtr, (ui32ClientUpdateCountInt[i] * sizeof(IMG_UINT32))) + || (OSCopyFromUser(NULL, (ui32UpdateValueInt[i]), psPtr, + (ui32ClientUpdateCountInt[i] * sizeof(IMG_UINT32))) != PVRSRV_OK) ) + { + psRGXSubmitTransferOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXSubmitTransfer_exit; + } + } + } + if (psRGXSubmitTransferIN->ui32PrepareCount != 0) + { + ui32ServerSyncCountInt = OSAllocMem(psRGXSubmitTransferIN->ui32PrepareCount * sizeof(IMG_UINT32)); + if (!ui32ServerSyncCountInt) + { + psRGXSubmitTransferOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXSubmitTransfer_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXSubmitTransferIN->pui32ServerSyncCount, psRGXSubmitTransferIN->ui32PrepareCount * sizeof(IMG_UINT32)) + || (OSCopyFromUser(NULL, ui32ServerSyncCountInt, psRGXSubmitTransferIN->pui32ServerSyncCount, + psRGXSubmitTransferIN->ui32PrepareCount * sizeof(IMG_UINT32)) != PVRSRV_OK) ) + { + psRGXSubmitTransferOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXSubmitTransfer_exit; + } + if (psRGXSubmitTransferIN->ui32PrepareCount != 0) + { + IMG_UINT32 ui32Pass=0; + IMG_UINT32 i; + IMG_UINT32 ui32AllocSize=0; + IMG_UINT32 ui32Size; + IMG_UINT8 *pui8Ptr = IMG_NULL; + + /* + Two pass loop, 1st find out the size and 2nd allocation and set offsets. + Keeps allocation cost down and simplifies the free path + */ + for (ui32Pass=0;ui32Pass<2;ui32Pass++) + { + ui32Size = psRGXSubmitTransferIN->ui32PrepareCount * sizeof(IMG_UINT32 *); + if (ui32Pass == 0) + { + ui32AllocSize += ui32Size; + } + else + { + pui8Ptr = OSAllocMem(ui32AllocSize); + if (pui8Ptr == IMG_NULL) + { + psRGXSubmitTransferOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + goto RGXSubmitTransfer_exit; + } + ui32ServerSyncFlagsInt = (IMG_UINT32 **) pui8Ptr; + pui8Ptr += ui32Size; + } + + for (i=0;iui32PrepareCount;i++) + { + ui32Size = ui32ServerSyncCountInt[i] * sizeof(IMG_UINT32); + if (ui32Size) + { + if (ui32Pass == 0) + { + ui32AllocSize += ui32Size; + } + else + { + ui32ServerSyncFlagsInt[i] = (IMG_UINT32 *) pui8Ptr; + pui8Ptr += ui32Size; + } + } + } + } + } + + { + IMG_UINT32 i; + IMG_UINT32 **psPtr; + + /* Loop over all the pointers in the array copying the data into the kernel */ + for (i=0;iui32PrepareCount;i++) + { + /* Copy the pointer over from the client side */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) &psRGXSubmitTransferIN->pui32ServerSyncFlags[i], sizeof(IMG_UINT32 **)) + || (OSCopyFromUser(NULL, &psPtr, &psRGXSubmitTransferIN->pui32ServerSyncFlags[i], + sizeof(IMG_UINT32 **)) != PVRSRV_OK) ) + { + psRGXSubmitTransferOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXSubmitTransfer_exit; + } + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psPtr, (ui32ServerSyncCountInt[i] * sizeof(IMG_UINT32))) + || (OSCopyFromUser(NULL, (ui32ServerSyncFlagsInt[i]), psPtr, + (ui32ServerSyncCountInt[i] * sizeof(IMG_UINT32))) != PVRSRV_OK) ) + { + psRGXSubmitTransferOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXSubmitTransfer_exit; + } + } + } + if (psRGXSubmitTransferIN->ui32PrepareCount != 0) + { + IMG_UINT32 ui32Pass=0; + IMG_UINT32 i; + IMG_UINT32 ui32AllocSize=0; + IMG_UINT32 ui32Size; + IMG_UINT8 *pui8Ptr = IMG_NULL; + IMG_UINT32 ui32AllocSize2=0; + IMG_UINT32 ui32Size2; + IMG_UINT8 *pui8Ptr2 = IMG_NULL; + + /* + Two pass loop, 1st find out the size and 2nd allocation and set offsets. + Keeps allocation cost down and simplifies the free path + */ + for (ui32Pass=0;ui32Pass<2;ui32Pass++) + { + ui32Size = psRGXSubmitTransferIN->ui32PrepareCount * sizeof(SERVER_SYNC_PRIMITIVE * *); + ui32Size2 = psRGXSubmitTransferIN->ui32PrepareCount * sizeof(IMG_HANDLE *); + if (ui32Pass == 0) + { + ui32AllocSize += ui32Size; + ui32AllocSize2 += ui32Size2; + } + else + { + pui8Ptr = OSAllocMem(ui32AllocSize); + if (pui8Ptr == IMG_NULL) + { + psRGXSubmitTransferOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + goto RGXSubmitTransfer_exit; + } + psServerSyncInt = (SERVER_SYNC_PRIMITIVE * **) pui8Ptr; + pui8Ptr += ui32Size; + pui8Ptr2 = OSAllocMem(ui32AllocSize2); + if (pui8Ptr2 == IMG_NULL) + { + psRGXSubmitTransferOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + goto RGXSubmitTransfer_exit; + } + hServerSyncInt2 = (IMG_HANDLE **) pui8Ptr2; + pui8Ptr2 += ui32Size2; + } + + for (i=0;iui32PrepareCount;i++) + { + ui32Size = ui32ServerSyncCountInt[i] * sizeof(SERVER_SYNC_PRIMITIVE *); + ui32Size2 = ui32ServerSyncCountInt[i] * sizeof(IMG_HANDLE); + if (ui32Size) + { + if (ui32Pass == 0) + { + ui32AllocSize += ui32Size; + ui32AllocSize2 += ui32Size2; + } + else + { + psServerSyncInt[i] = (SERVER_SYNC_PRIMITIVE * *) pui8Ptr; + pui8Ptr += ui32Size; + hServerSyncInt2[i] = (IMG_HANDLE *) pui8Ptr2; + pui8Ptr2 += ui32Size2; + } + } + } + } + } + + { + IMG_UINT32 i; + IMG_HANDLE **psPtr; + + /* Loop over all the pointers in the array copying the data into the kernel */ + for (i=0;iui32PrepareCount;i++) + { + /* Copy the pointer over from the client side */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) &psRGXSubmitTransferIN->phServerSync[i], sizeof(IMG_HANDLE **)) + || (OSCopyFromUser(NULL, &psPtr, &psRGXSubmitTransferIN->phServerSync[i], + sizeof(IMG_HANDLE **)) != PVRSRV_OK) ) + { + psRGXSubmitTransferOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXSubmitTransfer_exit; + } + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psPtr, (ui32ServerSyncCountInt[i] * sizeof(IMG_HANDLE))) + || (OSCopyFromUser(NULL, (hServerSyncInt2[i]), psPtr, + (ui32ServerSyncCountInt[i] * sizeof(IMG_HANDLE))) != PVRSRV_OK) ) + { + psRGXSubmitTransferOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXSubmitTransfer_exit; + } + } + } + if (psRGXSubmitTransferIN->ui32NumCheckFenceFDs != 0) + { + i32CheckFenceFDsInt = OSAllocMem(psRGXSubmitTransferIN->ui32NumCheckFenceFDs * sizeof(IMG_INT32)); + if (!i32CheckFenceFDsInt) + { + psRGXSubmitTransferOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXSubmitTransfer_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXSubmitTransferIN->pi32CheckFenceFDs, psRGXSubmitTransferIN->ui32NumCheckFenceFDs * sizeof(IMG_INT32)) + || (OSCopyFromUser(NULL, i32CheckFenceFDsInt, psRGXSubmitTransferIN->pi32CheckFenceFDs, + psRGXSubmitTransferIN->ui32NumCheckFenceFDs * sizeof(IMG_INT32)) != PVRSRV_OK) ) + { + psRGXSubmitTransferOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXSubmitTransfer_exit; + } + if (psRGXSubmitTransferIN->ui32PrepareCount != 0) + { + ui32CommandSizeInt = OSAllocMem(psRGXSubmitTransferIN->ui32PrepareCount * sizeof(IMG_UINT32)); + if (!ui32CommandSizeInt) + { + psRGXSubmitTransferOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXSubmitTransfer_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXSubmitTransferIN->pui32CommandSize, psRGXSubmitTransferIN->ui32PrepareCount * sizeof(IMG_UINT32)) + || (OSCopyFromUser(NULL, ui32CommandSizeInt, psRGXSubmitTransferIN->pui32CommandSize, + psRGXSubmitTransferIN->ui32PrepareCount * sizeof(IMG_UINT32)) != PVRSRV_OK) ) + { + psRGXSubmitTransferOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXSubmitTransfer_exit; + } + if (psRGXSubmitTransferIN->ui32PrepareCount != 0) + { + IMG_UINT32 ui32Pass=0; + IMG_UINT32 i; + IMG_UINT32 ui32AllocSize=0; + IMG_UINT32 ui32Size; + IMG_UINT8 *pui8Ptr = IMG_NULL; + + /* + Two pass loop, 1st find out the size and 2nd allocation and set offsets. + Keeps allocation cost down and simplifies the free path + */ + for (ui32Pass=0;ui32Pass<2;ui32Pass++) + { + ui32Size = psRGXSubmitTransferIN->ui32PrepareCount * sizeof(IMG_UINT8 *); + if (ui32Pass == 0) + { + ui32AllocSize += ui32Size; + } + else + { + pui8Ptr = OSAllocMem(ui32AllocSize); + if (pui8Ptr == IMG_NULL) + { + psRGXSubmitTransferOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + goto RGXSubmitTransfer_exit; + } + ui8FWCommandInt = (IMG_UINT8 **) pui8Ptr; + pui8Ptr += ui32Size; + } + + for (i=0;iui32PrepareCount;i++) + { + ui32Size = ui32CommandSizeInt[i] * sizeof(IMG_UINT8); + if (ui32Size) + { + if (ui32Pass == 0) + { + ui32AllocSize += ui32Size; + } + else + { + ui8FWCommandInt[i] = (IMG_UINT8 *) pui8Ptr; + pui8Ptr += ui32Size; + } + } + } + } + } + + { + IMG_UINT32 i; + IMG_UINT8 **psPtr; + + /* Loop over all the pointers in the array copying the data into the kernel */ + for (i=0;iui32PrepareCount;i++) + { + /* Copy the pointer over from the client side */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) &psRGXSubmitTransferIN->pui8FWCommand[i], sizeof(IMG_UINT8 **)) + || (OSCopyFromUser(NULL, &psPtr, &psRGXSubmitTransferIN->pui8FWCommand[i], + sizeof(IMG_UINT8 **)) != PVRSRV_OK) ) + { + psRGXSubmitTransferOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXSubmitTransfer_exit; + } + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psPtr, (ui32CommandSizeInt[i] * sizeof(IMG_UINT8))) + || (OSCopyFromUser(NULL, (ui8FWCommandInt[i]), psPtr, + (ui32CommandSizeInt[i] * sizeof(IMG_UINT8))) != PVRSRV_OK) ) + { + psRGXSubmitTransferOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXSubmitTransfer_exit; + } + } + } + if (psRGXSubmitTransferIN->ui32PrepareCount != 0) + { + ui32TQPrepareFlagsInt = OSAllocMem(psRGXSubmitTransferIN->ui32PrepareCount * sizeof(IMG_UINT32)); + if (!ui32TQPrepareFlagsInt) + { + psRGXSubmitTransferOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXSubmitTransfer_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXSubmitTransferIN->pui32TQPrepareFlags, psRGXSubmitTransferIN->ui32PrepareCount * sizeof(IMG_UINT32)) + || (OSCopyFromUser(NULL, ui32TQPrepareFlagsInt, psRGXSubmitTransferIN->pui32TQPrepareFlags, + psRGXSubmitTransferIN->ui32PrepareCount * sizeof(IMG_UINT32)) != PVRSRV_OK) ) + { + psRGXSubmitTransferOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXSubmitTransfer_exit; + } + + + + { + /* Look up the address from the handle */ + psRGXSubmitTransferOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psTransferContextInt, + psRGXSubmitTransferIN->hTransferContext, + PVRSRV_HANDLE_TYPE_RGX_SERVER_TQ_CONTEXT); + if(psRGXSubmitTransferOUT->eError != PVRSRV_OK) + { + goto RGXSubmitTransfer_exit; + } + } + + + { + IMG_UINT32 i; + + for (i=0;iui32PrepareCount;i++) + { + IMG_UINT32 j; + for (j=0;jeError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psFenceUFOSyncPrimBlockInt[i][j], + hFenceUFOSyncPrimBlockInt2[i][j], + PVRSRV_HANDLE_TYPE_SYNC_PRIMITIVE_BLOCK); + if(psRGXSubmitTransferOUT->eError != PVRSRV_OK) + { + goto RGXSubmitTransfer_exit; + } + } + + } + } + } + + { + IMG_UINT32 i; + + for (i=0;iui32PrepareCount;i++) + { + IMG_UINT32 j; + for (j=0;jeError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psUpdateUFOSyncPrimBlockInt[i][j], + hUpdateUFOSyncPrimBlockInt2[i][j], + PVRSRV_HANDLE_TYPE_SYNC_PRIMITIVE_BLOCK); + if(psRGXSubmitTransferOUT->eError != PVRSRV_OK) + { + goto RGXSubmitTransfer_exit; + } + } + + } + } + } + + { + IMG_UINT32 i; + + for (i=0;iui32PrepareCount;i++) + { + IMG_UINT32 j; + for (j=0;jeError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psServerSyncInt[i][j], + hServerSyncInt2[i][j], + PVRSRV_HANDLE_TYPE_SERVER_SYNC_PRIMITIVE); + if(psRGXSubmitTransferOUT->eError != PVRSRV_OK) + { + goto RGXSubmitTransfer_exit; + } + } + + } + } + } + + psRGXSubmitTransferOUT->eError = + PVRSRVRGXSubmitTransferKM( + psTransferContextInt, + psRGXSubmitTransferIN->ui32PrepareCount, + ui32ClientFenceCountInt, + psFenceUFOSyncPrimBlockInt, + ui32FenceSyncOffsetInt, + ui32FenceValueInt, + ui32ClientUpdateCountInt, + psUpdateUFOSyncPrimBlockInt, + ui32UpdateSyncOffsetInt, + ui32UpdateValueInt, + ui32ServerSyncCountInt, + ui32ServerSyncFlagsInt, + psServerSyncInt, + psRGXSubmitTransferIN->ui32NumCheckFenceFDs, + i32CheckFenceFDsInt, + psRGXSubmitTransferIN->i32UpdateFenceFD, + ui32CommandSizeInt, + ui8FWCommandInt, + ui32TQPrepareFlagsInt, + psRGXSubmitTransferIN->ui32ExternalJobReference, + psRGXSubmitTransferIN->ui32InternalJobReference); + + + + +RGXSubmitTransfer_exit: + if (ui32ClientFenceCountInt) + OSFreeMem(ui32ClientFenceCountInt); + if (psFenceUFOSyncPrimBlockInt) + OSFreeMem(psFenceUFOSyncPrimBlockInt); + if (hFenceUFOSyncPrimBlockInt2) + OSFreeMem(hFenceUFOSyncPrimBlockInt2); + if (ui32FenceSyncOffsetInt) + OSFreeMem(ui32FenceSyncOffsetInt); + if (ui32FenceValueInt) + OSFreeMem(ui32FenceValueInt); + if (ui32ClientUpdateCountInt) + OSFreeMem(ui32ClientUpdateCountInt); + if (psUpdateUFOSyncPrimBlockInt) + OSFreeMem(psUpdateUFOSyncPrimBlockInt); + if (hUpdateUFOSyncPrimBlockInt2) + OSFreeMem(hUpdateUFOSyncPrimBlockInt2); + if (ui32UpdateSyncOffsetInt) + OSFreeMem(ui32UpdateSyncOffsetInt); + if (ui32UpdateValueInt) + OSFreeMem(ui32UpdateValueInt); + if (ui32ServerSyncCountInt) + OSFreeMem(ui32ServerSyncCountInt); + if (ui32ServerSyncFlagsInt) + OSFreeMem(ui32ServerSyncFlagsInt); + if (psServerSyncInt) + OSFreeMem(psServerSyncInt); + if (hServerSyncInt2) + OSFreeMem(hServerSyncInt2); + if (i32CheckFenceFDsInt) + OSFreeMem(i32CheckFenceFDsInt); + if (ui32CommandSizeInt) + OSFreeMem(ui32CommandSizeInt); + if (ui8FWCommandInt) + OSFreeMem(ui8FWCommandInt); + if (ui32TQPrepareFlagsInt) + OSFreeMem(ui32TQPrepareFlagsInt); + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXSetTransferContextPriority(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_RGXSETTRANSFERCONTEXTPRIORITY *psRGXSetTransferContextPriorityIN, + PVRSRV_BRIDGE_OUT_RGXSETTRANSFERCONTEXTPRIORITY *psRGXSetTransferContextPriorityOUT, + CONNECTION_DATA *psConnection) +{ + RGX_SERVER_TQ_CONTEXT * psTransferContextInt = IMG_NULL; + + + + + + + + { + /* Look up the address from the handle */ + psRGXSetTransferContextPriorityOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psTransferContextInt, + psRGXSetTransferContextPriorityIN->hTransferContext, + PVRSRV_HANDLE_TYPE_RGX_SERVER_TQ_CONTEXT); + if(psRGXSetTransferContextPriorityOUT->eError != PVRSRV_OK) + { + goto RGXSetTransferContextPriority_exit; + } + } + + + psRGXSetTransferContextPriorityOUT->eError = + PVRSRVRGXSetTransferContextPriorityKM(psConnection, + psTransferContextInt, + psRGXSetTransferContextPriorityIN->ui32Priority); + + + + +RGXSetTransferContextPriority_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXKickSyncTransfer(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_RGXKICKSYNCTRANSFER *psRGXKickSyncTransferIN, + PVRSRV_BRIDGE_OUT_RGXKICKSYNCTRANSFER *psRGXKickSyncTransferOUT, + CONNECTION_DATA *psConnection) +{ + RGX_SERVER_TQ_CONTEXT * psTransferContextInt = IMG_NULL; + SYNC_PRIMITIVE_BLOCK * *psClientFenceUFOSyncPrimBlockInt = IMG_NULL; + IMG_HANDLE *hClientFenceUFOSyncPrimBlockInt2 = IMG_NULL; + IMG_UINT32 *ui32ClientFenceSyncOffsetInt = IMG_NULL; + IMG_UINT32 *ui32ClientFenceValueInt = IMG_NULL; + SYNC_PRIMITIVE_BLOCK * *psClientUpdateUFOSyncPrimBlockInt = IMG_NULL; + IMG_HANDLE *hClientUpdateUFOSyncPrimBlockInt2 = IMG_NULL; + IMG_UINT32 *ui32ClientUpdateSyncOffsetInt = IMG_NULL; + IMG_UINT32 *ui32ClientUpdateValueInt = IMG_NULL; + IMG_UINT32 *ui32ServerSyncFlagsInt = IMG_NULL; + SERVER_SYNC_PRIMITIVE * *psServerSyncsInt = IMG_NULL; + IMG_HANDLE *hServerSyncsInt2 = IMG_NULL; + IMG_INT32 *i32CheckFenceFDsInt = IMG_NULL; + + + + + if (psRGXKickSyncTransferIN->ui32ClientFenceCount != 0) + { + psClientFenceUFOSyncPrimBlockInt = OSAllocMem(psRGXKickSyncTransferIN->ui32ClientFenceCount * sizeof(SYNC_PRIMITIVE_BLOCK *)); + if (!psClientFenceUFOSyncPrimBlockInt) + { + psRGXKickSyncTransferOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickSyncTransfer_exit; + } + hClientFenceUFOSyncPrimBlockInt2 = OSAllocMem(psRGXKickSyncTransferIN->ui32ClientFenceCount * sizeof(IMG_HANDLE)); + if (!hClientFenceUFOSyncPrimBlockInt2) + { + psRGXKickSyncTransferOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickSyncTransfer_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickSyncTransferIN->phClientFenceUFOSyncPrimBlock, psRGXKickSyncTransferIN->ui32ClientFenceCount * sizeof(IMG_HANDLE)) + || (OSCopyFromUser(NULL, hClientFenceUFOSyncPrimBlockInt2, psRGXKickSyncTransferIN->phClientFenceUFOSyncPrimBlock, + psRGXKickSyncTransferIN->ui32ClientFenceCount * sizeof(IMG_HANDLE)) != PVRSRV_OK) ) + { + psRGXKickSyncTransferOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXKickSyncTransfer_exit; + } + if (psRGXKickSyncTransferIN->ui32ClientFenceCount != 0) + { + ui32ClientFenceSyncOffsetInt = OSAllocMem(psRGXKickSyncTransferIN->ui32ClientFenceCount * sizeof(IMG_UINT32)); + if (!ui32ClientFenceSyncOffsetInt) + { + psRGXKickSyncTransferOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickSyncTransfer_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickSyncTransferIN->pui32ClientFenceSyncOffset, psRGXKickSyncTransferIN->ui32ClientFenceCount * sizeof(IMG_UINT32)) + || (OSCopyFromUser(NULL, ui32ClientFenceSyncOffsetInt, psRGXKickSyncTransferIN->pui32ClientFenceSyncOffset, + psRGXKickSyncTransferIN->ui32ClientFenceCount * sizeof(IMG_UINT32)) != PVRSRV_OK) ) + { + psRGXKickSyncTransferOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXKickSyncTransfer_exit; + } + if (psRGXKickSyncTransferIN->ui32ClientFenceCount != 0) + { + ui32ClientFenceValueInt = OSAllocMem(psRGXKickSyncTransferIN->ui32ClientFenceCount * sizeof(IMG_UINT32)); + if (!ui32ClientFenceValueInt) + { + psRGXKickSyncTransferOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickSyncTransfer_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickSyncTransferIN->pui32ClientFenceValue, psRGXKickSyncTransferIN->ui32ClientFenceCount * sizeof(IMG_UINT32)) + || (OSCopyFromUser(NULL, ui32ClientFenceValueInt, psRGXKickSyncTransferIN->pui32ClientFenceValue, + psRGXKickSyncTransferIN->ui32ClientFenceCount * sizeof(IMG_UINT32)) != PVRSRV_OK) ) + { + psRGXKickSyncTransferOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXKickSyncTransfer_exit; + } + if (psRGXKickSyncTransferIN->ui32ClientUpdateCount != 0) + { + psClientUpdateUFOSyncPrimBlockInt = OSAllocMem(psRGXKickSyncTransferIN->ui32ClientUpdateCount * sizeof(SYNC_PRIMITIVE_BLOCK *)); + if (!psClientUpdateUFOSyncPrimBlockInt) + { + psRGXKickSyncTransferOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickSyncTransfer_exit; + } + hClientUpdateUFOSyncPrimBlockInt2 = OSAllocMem(psRGXKickSyncTransferIN->ui32ClientUpdateCount * sizeof(IMG_HANDLE)); + if (!hClientUpdateUFOSyncPrimBlockInt2) + { + psRGXKickSyncTransferOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickSyncTransfer_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickSyncTransferIN->phClientUpdateUFOSyncPrimBlock, psRGXKickSyncTransferIN->ui32ClientUpdateCount * sizeof(IMG_HANDLE)) + || (OSCopyFromUser(NULL, hClientUpdateUFOSyncPrimBlockInt2, psRGXKickSyncTransferIN->phClientUpdateUFOSyncPrimBlock, + psRGXKickSyncTransferIN->ui32ClientUpdateCount * sizeof(IMG_HANDLE)) != PVRSRV_OK) ) + { + psRGXKickSyncTransferOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXKickSyncTransfer_exit; + } + if (psRGXKickSyncTransferIN->ui32ClientUpdateCount != 0) + { + ui32ClientUpdateSyncOffsetInt = OSAllocMem(psRGXKickSyncTransferIN->ui32ClientUpdateCount * sizeof(IMG_UINT32)); + if (!ui32ClientUpdateSyncOffsetInt) + { + psRGXKickSyncTransferOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickSyncTransfer_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickSyncTransferIN->pui32ClientUpdateSyncOffset, psRGXKickSyncTransferIN->ui32ClientUpdateCount * sizeof(IMG_UINT32)) + || (OSCopyFromUser(NULL, ui32ClientUpdateSyncOffsetInt, psRGXKickSyncTransferIN->pui32ClientUpdateSyncOffset, + psRGXKickSyncTransferIN->ui32ClientUpdateCount * sizeof(IMG_UINT32)) != PVRSRV_OK) ) + { + psRGXKickSyncTransferOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXKickSyncTransfer_exit; + } + if (psRGXKickSyncTransferIN->ui32ClientUpdateCount != 0) + { + ui32ClientUpdateValueInt = OSAllocMem(psRGXKickSyncTransferIN->ui32ClientUpdateCount * sizeof(IMG_UINT32)); + if (!ui32ClientUpdateValueInt) + { + psRGXKickSyncTransferOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickSyncTransfer_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickSyncTransferIN->pui32ClientUpdateValue, psRGXKickSyncTransferIN->ui32ClientUpdateCount * sizeof(IMG_UINT32)) + || (OSCopyFromUser(NULL, ui32ClientUpdateValueInt, psRGXKickSyncTransferIN->pui32ClientUpdateValue, + psRGXKickSyncTransferIN->ui32ClientUpdateCount * sizeof(IMG_UINT32)) != PVRSRV_OK) ) + { + psRGXKickSyncTransferOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXKickSyncTransfer_exit; + } + if (psRGXKickSyncTransferIN->ui32ServerSyncCount != 0) + { + ui32ServerSyncFlagsInt = OSAllocMem(psRGXKickSyncTransferIN->ui32ServerSyncCount * sizeof(IMG_UINT32)); + if (!ui32ServerSyncFlagsInt) + { + psRGXKickSyncTransferOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickSyncTransfer_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickSyncTransferIN->pui32ServerSyncFlags, psRGXKickSyncTransferIN->ui32ServerSyncCount * sizeof(IMG_UINT32)) + || (OSCopyFromUser(NULL, ui32ServerSyncFlagsInt, psRGXKickSyncTransferIN->pui32ServerSyncFlags, + psRGXKickSyncTransferIN->ui32ServerSyncCount * sizeof(IMG_UINT32)) != PVRSRV_OK) ) + { + psRGXKickSyncTransferOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXKickSyncTransfer_exit; + } + if (psRGXKickSyncTransferIN->ui32ServerSyncCount != 0) + { + psServerSyncsInt = OSAllocMem(psRGXKickSyncTransferIN->ui32ServerSyncCount * sizeof(SERVER_SYNC_PRIMITIVE *)); + if (!psServerSyncsInt) + { + psRGXKickSyncTransferOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickSyncTransfer_exit; + } + hServerSyncsInt2 = OSAllocMem(psRGXKickSyncTransferIN->ui32ServerSyncCount * sizeof(IMG_HANDLE)); + if (!hServerSyncsInt2) + { + psRGXKickSyncTransferOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickSyncTransfer_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickSyncTransferIN->phServerSyncs, psRGXKickSyncTransferIN->ui32ServerSyncCount * sizeof(IMG_HANDLE)) + || (OSCopyFromUser(NULL, hServerSyncsInt2, psRGXKickSyncTransferIN->phServerSyncs, + psRGXKickSyncTransferIN->ui32ServerSyncCount * sizeof(IMG_HANDLE)) != PVRSRV_OK) ) + { + psRGXKickSyncTransferOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXKickSyncTransfer_exit; + } + if (psRGXKickSyncTransferIN->ui32NumCheckFenceFDs != 0) + { + i32CheckFenceFDsInt = OSAllocMem(psRGXKickSyncTransferIN->ui32NumCheckFenceFDs * sizeof(IMG_INT32)); + if (!i32CheckFenceFDsInt) + { + psRGXKickSyncTransferOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickSyncTransfer_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickSyncTransferIN->pi32CheckFenceFDs, psRGXKickSyncTransferIN->ui32NumCheckFenceFDs * sizeof(IMG_INT32)) + || (OSCopyFromUser(NULL, i32CheckFenceFDsInt, psRGXKickSyncTransferIN->pi32CheckFenceFDs, + psRGXKickSyncTransferIN->ui32NumCheckFenceFDs * sizeof(IMG_INT32)) != PVRSRV_OK) ) + { + psRGXKickSyncTransferOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXKickSyncTransfer_exit; + } + + + + { + /* Look up the address from the handle */ + psRGXKickSyncTransferOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psTransferContextInt, + psRGXKickSyncTransferIN->hTransferContext, + PVRSRV_HANDLE_TYPE_RGX_SERVER_TQ_CONTEXT); + if(psRGXKickSyncTransferOUT->eError != PVRSRV_OK) + { + goto RGXKickSyncTransfer_exit; + } + } + + + { + IMG_UINT32 i; + + for (i=0;iui32ClientFenceCount;i++) + { + { + /* Look up the address from the handle */ + psRGXKickSyncTransferOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psClientFenceUFOSyncPrimBlockInt[i], + hClientFenceUFOSyncPrimBlockInt2[i], + PVRSRV_HANDLE_TYPE_SYNC_PRIMITIVE_BLOCK); + if(psRGXKickSyncTransferOUT->eError != PVRSRV_OK) + { + goto RGXKickSyncTransfer_exit; + } + } + + } + } + + { + IMG_UINT32 i; + + for (i=0;iui32ClientUpdateCount;i++) + { + { + /* Look up the address from the handle */ + psRGXKickSyncTransferOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psClientUpdateUFOSyncPrimBlockInt[i], + hClientUpdateUFOSyncPrimBlockInt2[i], + PVRSRV_HANDLE_TYPE_SYNC_PRIMITIVE_BLOCK); + if(psRGXKickSyncTransferOUT->eError != PVRSRV_OK) + { + goto RGXKickSyncTransfer_exit; + } + } + + } + } + + { + IMG_UINT32 i; + + for (i=0;iui32ServerSyncCount;i++) + { + { + /* Look up the address from the handle */ + psRGXKickSyncTransferOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psServerSyncsInt[i], + hServerSyncsInt2[i], + PVRSRV_HANDLE_TYPE_SERVER_SYNC_PRIMITIVE); + if(psRGXKickSyncTransferOUT->eError != PVRSRV_OK) + { + goto RGXKickSyncTransfer_exit; + } + } + + } + } + + psRGXKickSyncTransferOUT->eError = + PVRSRVRGXKickSyncTransferKM( + psTransferContextInt, + psRGXKickSyncTransferIN->ui32ClientFenceCount, + psClientFenceUFOSyncPrimBlockInt, + ui32ClientFenceSyncOffsetInt, + ui32ClientFenceValueInt, + psRGXKickSyncTransferIN->ui32ClientUpdateCount, + psClientUpdateUFOSyncPrimBlockInt, + ui32ClientUpdateSyncOffsetInt, + ui32ClientUpdateValueInt, + psRGXKickSyncTransferIN->ui32ServerSyncCount, + ui32ServerSyncFlagsInt, + psServerSyncsInt, + psRGXKickSyncTransferIN->ui32NumCheckFenceFDs, + i32CheckFenceFDsInt, + psRGXKickSyncTransferIN->i32UpdateFenceFD, + psRGXKickSyncTransferIN->ui32TQPrepareFlags); + + + + +RGXKickSyncTransfer_exit: + if (psClientFenceUFOSyncPrimBlockInt) + OSFreeMem(psClientFenceUFOSyncPrimBlockInt); + if (hClientFenceUFOSyncPrimBlockInt2) + OSFreeMem(hClientFenceUFOSyncPrimBlockInt2); + if (ui32ClientFenceSyncOffsetInt) + OSFreeMem(ui32ClientFenceSyncOffsetInt); + if (ui32ClientFenceValueInt) + OSFreeMem(ui32ClientFenceValueInt); + if (psClientUpdateUFOSyncPrimBlockInt) + OSFreeMem(psClientUpdateUFOSyncPrimBlockInt); + if (hClientUpdateUFOSyncPrimBlockInt2) + OSFreeMem(hClientUpdateUFOSyncPrimBlockInt2); + if (ui32ClientUpdateSyncOffsetInt) + OSFreeMem(ui32ClientUpdateSyncOffsetInt); + if (ui32ClientUpdateValueInt) + OSFreeMem(ui32ClientUpdateValueInt); + if (ui32ServerSyncFlagsInt) + OSFreeMem(ui32ServerSyncFlagsInt); + if (psServerSyncsInt) + OSFreeMem(psServerSyncsInt); + if (hServerSyncsInt2) + OSFreeMem(hServerSyncsInt2); + if (i32CheckFenceFDsInt) + OSFreeMem(i32CheckFenceFDsInt); + + return 0; +} + + + +/* *************************************************************************** + * Server bridge dispatch related glue + */ + + +PVRSRV_ERROR InitRGXTQBridge(IMG_VOID); +PVRSRV_ERROR DeinitRGXTQBridge(IMG_VOID); + +/* + * Register all RGXTQ functions with services + */ +PVRSRV_ERROR InitRGXTQBridge(IMG_VOID) +{ + + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXTQ, PVRSRV_BRIDGE_RGXTQ_RGXCREATETRANSFERCONTEXT, PVRSRVBridgeRGXCreateTransferContext, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXTQ, PVRSRV_BRIDGE_RGXTQ_RGXDESTROYTRANSFERCONTEXT, PVRSRVBridgeRGXDestroyTransferContext, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXTQ, PVRSRV_BRIDGE_RGXTQ_RGXSUBMITTRANSFER, PVRSRVBridgeRGXSubmitTransfer, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXTQ, PVRSRV_BRIDGE_RGXTQ_RGXSETTRANSFERCONTEXTPRIORITY, PVRSRVBridgeRGXSetTransferContextPriority, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXTQ, PVRSRV_BRIDGE_RGXTQ_RGXKICKSYNCTRANSFER, PVRSRVBridgeRGXKickSyncTransfer, + IMG_NULL, IMG_NULL, + 0, 0); + + + return PVRSRV_OK; +} + +/* + * Unregister all rgxtq functions with services + */ +PVRSRV_ERROR DeinitRGXTQBridge(IMG_VOID) +{ + return PVRSRV_OK; +} + diff --git a/drivers/gpu/rogue_m/generated/ri_bridge/client_ri_bridge.h b/drivers/gpu/rogue_m/generated/ri_bridge/client_ri_bridge.h new file mode 100644 index 000000000000..ec290bf2fca9 --- /dev/null +++ b/drivers/gpu/rogue_m/generated/ri_bridge/client_ri_bridge.h @@ -0,0 +1,84 @@ +/*************************************************************************/ /*! +@File +@Title Client bridge header for ri +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Exports the client bridge functions for ri +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef CLIENT_RI_BRIDGE_H +#define CLIENT_RI_BRIDGE_H + +#include "pvr_bridge_client.h" +#include "pvr_bridge.h" + +#include "common_ri_bridge.h" + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeRIWritePMREntry(IMG_HANDLE hBridge, + IMG_HANDLE hPMRHandle, + IMG_UINT32 ui32TextASize, + const IMG_CHAR *puiTextA, + IMG_UINT64 ui64LogicalSize); + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeRIWriteMEMDESCEntry(IMG_HANDLE hBridge, + IMG_HANDLE hPMRHandle, + IMG_UINT32 ui32TextBSize, + const IMG_CHAR *puiTextB, + IMG_UINT64 ui64Offset, + IMG_UINT64 ui64Size, + IMG_BOOL bIsImport, + IMG_BOOL bIsExportable, + IMG_HANDLE *phRIHandle); + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeRIUpdateMEMDESCAddr(IMG_HANDLE hBridge, + IMG_HANDLE hRIHandle, + IMG_DEV_VIRTADDR sAddr); + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeRIDeleteMEMDESCEntry(IMG_HANDLE hBridge, + IMG_HANDLE hRIHandle); + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeRIDumpList(IMG_HANDLE hBridge, + IMG_HANDLE hPMRHandle); + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeRIDumpAll(IMG_HANDLE hBridge); + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeRIDumpProcess(IMG_HANDLE hBridge, + IMG_PID ui32Pid); + + +#endif /* CLIENT_RI_BRIDGE_H */ diff --git a/drivers/gpu/rogue_m/generated/ri_bridge/common_ri_bridge.h b/drivers/gpu/rogue_m/generated/ri_bridge/common_ri_bridge.h new file mode 100644 index 000000000000..415360d4760a --- /dev/null +++ b/drivers/gpu/rogue_m/generated/ri_bridge/common_ri_bridge.h @@ -0,0 +1,195 @@ +/*************************************************************************/ /*! +@File +@Title Common bridge header for ri +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Declares common defines and structures that are used by both + the client and sever side of the bridge for ri +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef COMMON_RI_BRIDGE_H +#define COMMON_RI_BRIDGE_H + +#include "img_types.h" +#include "pvrsrv_error.h" + +#include "ri_typedefs.h" + + +#define PVRSRV_BRIDGE_RI_CMD_FIRST 0 +#define PVRSRV_BRIDGE_RI_RIWRITEPMRENTRY PVRSRV_BRIDGE_RI_CMD_FIRST+0 +#define PVRSRV_BRIDGE_RI_RIWRITEMEMDESCENTRY PVRSRV_BRIDGE_RI_CMD_FIRST+1 +#define PVRSRV_BRIDGE_RI_RIUPDATEMEMDESCADDR PVRSRV_BRIDGE_RI_CMD_FIRST+2 +#define PVRSRV_BRIDGE_RI_RIDELETEMEMDESCENTRY PVRSRV_BRIDGE_RI_CMD_FIRST+3 +#define PVRSRV_BRIDGE_RI_RIDUMPLIST PVRSRV_BRIDGE_RI_CMD_FIRST+4 +#define PVRSRV_BRIDGE_RI_RIDUMPALL PVRSRV_BRIDGE_RI_CMD_FIRST+5 +#define PVRSRV_BRIDGE_RI_RIDUMPPROCESS PVRSRV_BRIDGE_RI_CMD_FIRST+6 +#define PVRSRV_BRIDGE_RI_CMD_LAST (PVRSRV_BRIDGE_RI_CMD_FIRST+6) + + +/******************************************* + RIWritePMREntry + *******************************************/ + +/* Bridge in structure for RIWritePMREntry */ +typedef struct PVRSRV_BRIDGE_IN_RIWRITEPMRENTRY_TAG +{ + IMG_HANDLE hPMRHandle; + IMG_UINT32 ui32TextASize; + const IMG_CHAR * puiTextA; + IMG_UINT64 ui64LogicalSize; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_RIWRITEPMRENTRY; + + +/* Bridge out structure for RIWritePMREntry */ +typedef struct PVRSRV_BRIDGE_OUT_RIWRITEPMRENTRY_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RIWRITEPMRENTRY; + +/******************************************* + RIWriteMEMDESCEntry + *******************************************/ + +/* Bridge in structure for RIWriteMEMDESCEntry */ +typedef struct PVRSRV_BRIDGE_IN_RIWRITEMEMDESCENTRY_TAG +{ + IMG_HANDLE hPMRHandle; + IMG_UINT32 ui32TextBSize; + const IMG_CHAR * puiTextB; + IMG_UINT64 ui64Offset; + IMG_UINT64 ui64Size; + IMG_BOOL bIsImport; + IMG_BOOL bIsExportable; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_RIWRITEMEMDESCENTRY; + + +/* Bridge out structure for RIWriteMEMDESCEntry */ +typedef struct PVRSRV_BRIDGE_OUT_RIWRITEMEMDESCENTRY_TAG +{ + IMG_HANDLE hRIHandle; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RIWRITEMEMDESCENTRY; + +/******************************************* + RIUpdateMEMDESCAddr + *******************************************/ + +/* Bridge in structure for RIUpdateMEMDESCAddr */ +typedef struct PVRSRV_BRIDGE_IN_RIUPDATEMEMDESCADDR_TAG +{ + IMG_HANDLE hRIHandle; + IMG_DEV_VIRTADDR sAddr; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_RIUPDATEMEMDESCADDR; + + +/* Bridge out structure for RIUpdateMEMDESCAddr */ +typedef struct PVRSRV_BRIDGE_OUT_RIUPDATEMEMDESCADDR_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RIUPDATEMEMDESCADDR; + +/******************************************* + RIDeleteMEMDESCEntry + *******************************************/ + +/* Bridge in structure for RIDeleteMEMDESCEntry */ +typedef struct PVRSRV_BRIDGE_IN_RIDELETEMEMDESCENTRY_TAG +{ + IMG_HANDLE hRIHandle; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_RIDELETEMEMDESCENTRY; + + +/* Bridge out structure for RIDeleteMEMDESCEntry */ +typedef struct PVRSRV_BRIDGE_OUT_RIDELETEMEMDESCENTRY_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RIDELETEMEMDESCENTRY; + +/******************************************* + RIDumpList + *******************************************/ + +/* Bridge in structure for RIDumpList */ +typedef struct PVRSRV_BRIDGE_IN_RIDUMPLIST_TAG +{ + IMG_HANDLE hPMRHandle; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_RIDUMPLIST; + + +/* Bridge out structure for RIDumpList */ +typedef struct PVRSRV_BRIDGE_OUT_RIDUMPLIST_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RIDUMPLIST; + +/******************************************* + RIDumpAll + *******************************************/ + +/* Bridge in structure for RIDumpAll */ +typedef struct PVRSRV_BRIDGE_IN_RIDUMPALL_TAG +{ + IMG_UINT32 ui32EmptyStructPlaceholder; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_RIDUMPALL; + + +/* Bridge out structure for RIDumpAll */ +typedef struct PVRSRV_BRIDGE_OUT_RIDUMPALL_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RIDUMPALL; + +/******************************************* + RIDumpProcess + *******************************************/ + +/* Bridge in structure for RIDumpProcess */ +typedef struct PVRSRV_BRIDGE_IN_RIDUMPPROCESS_TAG +{ + IMG_PID ui32Pid; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_RIDUMPPROCESS; + + +/* Bridge out structure for RIDumpProcess */ +typedef struct PVRSRV_BRIDGE_OUT_RIDUMPPROCESS_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RIDUMPPROCESS; + +#endif /* COMMON_RI_BRIDGE_H */ diff --git a/drivers/gpu/rogue_m/generated/ri_bridge/server_ri_bridge.c b/drivers/gpu/rogue_m/generated/ri_bridge/server_ri_bridge.c new file mode 100644 index 000000000000..ca370d9a1a6c --- /dev/null +++ b/drivers/gpu/rogue_m/generated/ri_bridge/server_ri_bridge.c @@ -0,0 +1,456 @@ +/*************************************************************************/ /*! +@File +@Title Server bridge for ri +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Implements the server side of the bridge for ri +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#include +#include + +#include "img_defs.h" + +#include "ri_server.h" + + +#include "common_ri_bridge.h" + +#include "allocmem.h" +#include "pvr_debug.h" +#include "connection_server.h" +#include "pvr_bridge.h" +#include "rgx_bridge.h" +#include "srvcore.h" +#include "handle.h" + +#if defined (SUPPORT_AUTH) +#include "osauth.h" +#endif + +#include + + + + +/* *************************************************************************** + * Server-side bridge entry points + */ + +static IMG_INT +PVRSRVBridgeRIWritePMREntry(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_RIWRITEPMRENTRY *psRIWritePMREntryIN, + PVRSRV_BRIDGE_OUT_RIWRITEPMRENTRY *psRIWritePMREntryOUT, + CONNECTION_DATA *psConnection) +{ + PMR * psPMRHandleInt = IMG_NULL; + IMG_CHAR *uiTextAInt = IMG_NULL; + + + + + if (psRIWritePMREntryIN->ui32TextASize != 0) + { + uiTextAInt = OSAllocMem(psRIWritePMREntryIN->ui32TextASize * sizeof(IMG_CHAR)); + if (!uiTextAInt) + { + psRIWritePMREntryOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RIWritePMREntry_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRIWritePMREntryIN->puiTextA, psRIWritePMREntryIN->ui32TextASize * sizeof(IMG_CHAR)) + || (OSCopyFromUser(NULL, uiTextAInt, psRIWritePMREntryIN->puiTextA, + psRIWritePMREntryIN->ui32TextASize * sizeof(IMG_CHAR)) != PVRSRV_OK) ) + { + psRIWritePMREntryOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RIWritePMREntry_exit; + } + + + + { + /* Look up the address from the handle */ + psRIWritePMREntryOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psPMRHandleInt, + psRIWritePMREntryIN->hPMRHandle, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR); + if(psRIWritePMREntryOUT->eError != PVRSRV_OK) + { + goto RIWritePMREntry_exit; + } + } + + + psRIWritePMREntryOUT->eError = + RIWritePMREntryKM( + psPMRHandleInt, + psRIWritePMREntryIN->ui32TextASize, + uiTextAInt, + psRIWritePMREntryIN->ui64LogicalSize); + + + + +RIWritePMREntry_exit: + if (uiTextAInt) + OSFreeMem(uiTextAInt); + + return 0; +} + +static IMG_INT +PVRSRVBridgeRIWriteMEMDESCEntry(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_RIWRITEMEMDESCENTRY *psRIWriteMEMDESCEntryIN, + PVRSRV_BRIDGE_OUT_RIWRITEMEMDESCENTRY *psRIWriteMEMDESCEntryOUT, + CONNECTION_DATA *psConnection) +{ + PMR * psPMRHandleInt = IMG_NULL; + IMG_CHAR *uiTextBInt = IMG_NULL; + RI_HANDLE psRIHandleInt = IMG_NULL; + + + + + if (psRIWriteMEMDESCEntryIN->ui32TextBSize != 0) + { + uiTextBInt = OSAllocMem(psRIWriteMEMDESCEntryIN->ui32TextBSize * sizeof(IMG_CHAR)); + if (!uiTextBInt) + { + psRIWriteMEMDESCEntryOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RIWriteMEMDESCEntry_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRIWriteMEMDESCEntryIN->puiTextB, psRIWriteMEMDESCEntryIN->ui32TextBSize * sizeof(IMG_CHAR)) + || (OSCopyFromUser(NULL, uiTextBInt, psRIWriteMEMDESCEntryIN->puiTextB, + psRIWriteMEMDESCEntryIN->ui32TextBSize * sizeof(IMG_CHAR)) != PVRSRV_OK) ) + { + psRIWriteMEMDESCEntryOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RIWriteMEMDESCEntry_exit; + } + + + + { + /* Look up the address from the handle */ + psRIWriteMEMDESCEntryOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psPMRHandleInt, + psRIWriteMEMDESCEntryIN->hPMRHandle, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR); + if(psRIWriteMEMDESCEntryOUT->eError != PVRSRV_OK) + { + goto RIWriteMEMDESCEntry_exit; + } + } + + + psRIWriteMEMDESCEntryOUT->eError = + RIWriteMEMDESCEntryKM( + psPMRHandleInt, + psRIWriteMEMDESCEntryIN->ui32TextBSize, + uiTextBInt, + psRIWriteMEMDESCEntryIN->ui64Offset, + psRIWriteMEMDESCEntryIN->ui64Size, + psRIWriteMEMDESCEntryIN->bIsImport, + psRIWriteMEMDESCEntryIN->bIsExportable, + &psRIHandleInt); + /* Exit early if bridged call fails */ + if(psRIWriteMEMDESCEntryOUT->eError != PVRSRV_OK) + { + goto RIWriteMEMDESCEntry_exit; + } + + + psRIWriteMEMDESCEntryOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psRIWriteMEMDESCEntryOUT->hRIHandle, + (IMG_VOID *) psRIHandleInt, + PVRSRV_HANDLE_TYPE_RI_HANDLE, + PVRSRV_HANDLE_ALLOC_FLAG_MULTI + ,(PFN_HANDLE_RELEASE)&RIDeleteMEMDESCEntryKM); + if (psRIWriteMEMDESCEntryOUT->eError != PVRSRV_OK) + { + goto RIWriteMEMDESCEntry_exit; + } + + + + +RIWriteMEMDESCEntry_exit: + if (psRIWriteMEMDESCEntryOUT->eError != PVRSRV_OK) + { + if (psRIHandleInt) + { + RIDeleteMEMDESCEntryKM(psRIHandleInt); + } + } + + if (uiTextBInt) + OSFreeMem(uiTextBInt); + + return 0; +} + +static IMG_INT +PVRSRVBridgeRIUpdateMEMDESCAddr(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_RIUPDATEMEMDESCADDR *psRIUpdateMEMDESCAddrIN, + PVRSRV_BRIDGE_OUT_RIUPDATEMEMDESCADDR *psRIUpdateMEMDESCAddrOUT, + CONNECTION_DATA *psConnection) +{ + RI_HANDLE psRIHandleInt = IMG_NULL; + + + + + + + + { + /* Look up the address from the handle */ + psRIUpdateMEMDESCAddrOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psRIHandleInt, + psRIUpdateMEMDESCAddrIN->hRIHandle, + PVRSRV_HANDLE_TYPE_RI_HANDLE); + if(psRIUpdateMEMDESCAddrOUT->eError != PVRSRV_OK) + { + goto RIUpdateMEMDESCAddr_exit; + } + } + + + psRIUpdateMEMDESCAddrOUT->eError = + RIUpdateMEMDESCAddrKM( + psRIHandleInt, + psRIUpdateMEMDESCAddrIN->sAddr); + + + + +RIUpdateMEMDESCAddr_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeRIDeleteMEMDESCEntry(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_RIDELETEMEMDESCENTRY *psRIDeleteMEMDESCEntryIN, + PVRSRV_BRIDGE_OUT_RIDELETEMEMDESCENTRY *psRIDeleteMEMDESCEntryOUT, + CONNECTION_DATA *psConnection) +{ + + + + + + + + + + psRIDeleteMEMDESCEntryOUT->eError = + PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psRIDeleteMEMDESCEntryIN->hRIHandle, + PVRSRV_HANDLE_TYPE_RI_HANDLE); + if ((psRIDeleteMEMDESCEntryOUT->eError != PVRSRV_OK) && (psRIDeleteMEMDESCEntryOUT->eError != PVRSRV_ERROR_RETRY)) + { + PVR_ASSERT(0); + goto RIDeleteMEMDESCEntry_exit; + } + + + +RIDeleteMEMDESCEntry_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeRIDumpList(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_RIDUMPLIST *psRIDumpListIN, + PVRSRV_BRIDGE_OUT_RIDUMPLIST *psRIDumpListOUT, + CONNECTION_DATA *psConnection) +{ + PMR * psPMRHandleInt = IMG_NULL; + + + + + + + + { + /* Look up the address from the handle */ + psRIDumpListOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psPMRHandleInt, + psRIDumpListIN->hPMRHandle, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR); + if(psRIDumpListOUT->eError != PVRSRV_OK) + { + goto RIDumpList_exit; + } + } + + + psRIDumpListOUT->eError = + RIDumpListKM( + psPMRHandleInt); + + + + +RIDumpList_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeRIDumpAll(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_RIDUMPALL *psRIDumpAllIN, + PVRSRV_BRIDGE_OUT_RIDUMPALL *psRIDumpAllOUT, + CONNECTION_DATA *psConnection) +{ + + PVR_UNREFERENCED_PARAMETER(psConnection); + PVR_UNREFERENCED_PARAMETER(psRIDumpAllIN); + + + + + + + psRIDumpAllOUT->eError = + RIDumpAllKM( + ); + + + + + + return 0; +} + +static IMG_INT +PVRSRVBridgeRIDumpProcess(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_RIDUMPPROCESS *psRIDumpProcessIN, + PVRSRV_BRIDGE_OUT_RIDUMPPROCESS *psRIDumpProcessOUT, + CONNECTION_DATA *psConnection) +{ + + PVR_UNREFERENCED_PARAMETER(psConnection); + + + + + + + psRIDumpProcessOUT->eError = + RIDumpProcessKM( + psRIDumpProcessIN->ui32Pid); + + + + + + return 0; +} + + + +/* *************************************************************************** + * Server bridge dispatch related glue + */ + + +PVRSRV_ERROR InitRIBridge(IMG_VOID); +PVRSRV_ERROR DeinitRIBridge(IMG_VOID); + +/* + * Register all RI functions with services + */ +PVRSRV_ERROR InitRIBridge(IMG_VOID) +{ + + SetDispatchTableEntry(PVRSRV_BRIDGE_RI, PVRSRV_BRIDGE_RI_RIWRITEPMRENTRY, PVRSRVBridgeRIWritePMREntry, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_RI, PVRSRV_BRIDGE_RI_RIWRITEMEMDESCENTRY, PVRSRVBridgeRIWriteMEMDESCEntry, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_RI, PVRSRV_BRIDGE_RI_RIUPDATEMEMDESCADDR, PVRSRVBridgeRIUpdateMEMDESCAddr, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_RI, PVRSRV_BRIDGE_RI_RIDELETEMEMDESCENTRY, PVRSRVBridgeRIDeleteMEMDESCEntry, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_RI, PVRSRV_BRIDGE_RI_RIDUMPLIST, PVRSRVBridgeRIDumpList, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_RI, PVRSRV_BRIDGE_RI_RIDUMPALL, PVRSRVBridgeRIDumpAll, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_RI, PVRSRV_BRIDGE_RI_RIDUMPPROCESS, PVRSRVBridgeRIDumpProcess, + IMG_NULL, IMG_NULL, + 0, 0); + + + return PVRSRV_OK; +} + +/* + * Unregister all ri functions with services + */ +PVRSRV_ERROR DeinitRIBridge(IMG_VOID) +{ + return PVRSRV_OK; +} + diff --git a/drivers/gpu/rogue_m/generated/smm_bridge/common_smm_bridge.h b/drivers/gpu/rogue_m/generated/smm_bridge/common_smm_bridge.h new file mode 100644 index 000000000000..52c5b1c9aebc --- /dev/null +++ b/drivers/gpu/rogue_m/generated/smm_bridge/common_smm_bridge.h @@ -0,0 +1,115 @@ +/*************************************************************************/ /*! +@File +@Title Common bridge header for smm +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Declares common defines and structures that are used by both + the client and sever side of the bridge for smm +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef COMMON_SMM_BRIDGE_H +#define COMMON_SMM_BRIDGE_H + +#include "img_types.h" +#include "pvrsrv_error.h" + + + +#define PVRSRV_BRIDGE_SMM_CMD_FIRST 0 +#define PVRSRV_BRIDGE_SMM_PMRSECUREEXPORTPMR PVRSRV_BRIDGE_SMM_CMD_FIRST+0 +#define PVRSRV_BRIDGE_SMM_PMRSECUREUNEXPORTPMR PVRSRV_BRIDGE_SMM_CMD_FIRST+1 +#define PVRSRV_BRIDGE_SMM_PMRSECUREIMPORTPMR PVRSRV_BRIDGE_SMM_CMD_FIRST+2 +#define PVRSRV_BRIDGE_SMM_CMD_LAST (PVRSRV_BRIDGE_SMM_CMD_FIRST+2) + + +/******************************************* + PMRSecureExportPMR + *******************************************/ + +/* Bridge in structure for PMRSecureExportPMR */ +typedef struct PVRSRV_BRIDGE_IN_PMRSECUREEXPORTPMR_TAG +{ + IMG_HANDLE hPMR; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_PMRSECUREEXPORTPMR; + + +/* Bridge out structure for PMRSecureExportPMR */ +typedef struct PVRSRV_BRIDGE_OUT_PMRSECUREEXPORTPMR_TAG +{ + IMG_SECURE_TYPE Export; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PMRSECUREEXPORTPMR; + +/******************************************* + PMRSecureUnexportPMR + *******************************************/ + +/* Bridge in structure for PMRSecureUnexportPMR */ +typedef struct PVRSRV_BRIDGE_IN_PMRSECUREUNEXPORTPMR_TAG +{ + IMG_HANDLE hPMR; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_PMRSECUREUNEXPORTPMR; + + +/* Bridge out structure for PMRSecureUnexportPMR */ +typedef struct PVRSRV_BRIDGE_OUT_PMRSECUREUNEXPORTPMR_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PMRSECUREUNEXPORTPMR; + +/******************************************* + PMRSecureImportPMR + *******************************************/ + +/* Bridge in structure for PMRSecureImportPMR */ +typedef struct PVRSRV_BRIDGE_IN_PMRSECUREIMPORTPMR_TAG +{ + IMG_SECURE_TYPE Export; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_PMRSECUREIMPORTPMR; + + +/* Bridge out structure for PMRSecureImportPMR */ +typedef struct PVRSRV_BRIDGE_OUT_PMRSECUREIMPORTPMR_TAG +{ + IMG_HANDLE hPMR; + IMG_DEVMEM_SIZE_T uiSize; + IMG_DEVMEM_ALIGN_T sAlign; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PMRSECUREIMPORTPMR; + +#endif /* COMMON_SMM_BRIDGE_H */ diff --git a/drivers/gpu/rogue_m/generated/smm_bridge/server_smm_bridge.c b/drivers/gpu/rogue_m/generated/smm_bridge/server_smm_bridge.c new file mode 100644 index 000000000000..4fb7d5cf5493 --- /dev/null +++ b/drivers/gpu/rogue_m/generated/smm_bridge/server_smm_bridge.c @@ -0,0 +1,281 @@ +/*************************************************************************/ /*! +@File +@Title Server bridge for smm +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Implements the server side of the bridge for smm +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#include +#include + +#include "img_defs.h" + +#include "pmr.h" +#include "secure_export.h" + + +#include "common_smm_bridge.h" + +#include "allocmem.h" +#include "pvr_debug.h" +#include "connection_server.h" +#include "pvr_bridge.h" +#include "rgx_bridge.h" +#include "srvcore.h" +#include "handle.h" + +#if defined (SUPPORT_AUTH) +#include "osauth.h" +#endif + +#include + + + + +/* *************************************************************************** + * Server-side bridge entry points + */ + +static IMG_INT +PVRSRVBridgePMRSecureExportPMR(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_PMRSECUREEXPORTPMR *psPMRSecureExportPMRIN, + PVRSRV_BRIDGE_OUT_PMRSECUREEXPORTPMR *psPMRSecureExportPMROUT, + CONNECTION_DATA *psConnection) +{ + PMR * psPMRInt = IMG_NULL; + PMR * psPMROutInt = IMG_NULL; + IMG_HANDLE hPMROutInt = IMG_NULL; + CONNECTION_DATA *psSecureConnection; + + + + + + PMRLock(); + + + { + /* Look up the address from the handle */ + psPMRSecureExportPMROUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psPMRInt, + psPMRSecureExportPMRIN->hPMR, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR); + if(psPMRSecureExportPMROUT->eError != PVRSRV_OK) + { + PMRUnlock(); + goto PMRSecureExportPMR_exit; + } + } + + + psPMRSecureExportPMROUT->eError = + PMRSecureExportPMR(psConnection, + psPMRInt, + &psPMRSecureExportPMROUT->Export, + &psPMROutInt, &psSecureConnection); + /* Exit early if bridged call fails */ + if(psPMRSecureExportPMROUT->eError != PVRSRV_OK) + { + PMRUnlock(); + goto PMRSecureExportPMR_exit; + } + PMRUnlock(); + + + psPMRSecureExportPMROUT->eError = PVRSRVAllocHandle(psSecureConnection->psHandleBase, + &hPMROutInt, + (IMG_VOID *) psPMROutInt, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR_SECURE_EXPORT, + PVRSRV_HANDLE_ALLOC_FLAG_SHARED + ,(PFN_HANDLE_RELEASE)&PMRSecureUnexportPMR); + if (psPMRSecureExportPMROUT->eError != PVRSRV_OK) + { + goto PMRSecureExportPMR_exit; + } + + + + +PMRSecureExportPMR_exit: + if (psPMRSecureExportPMROUT->eError != PVRSRV_OK) + { + if (psPMROutInt) + { + PMRSecureUnexportPMR(psPMROutInt); + } + } + + + return 0; +} + +static IMG_INT +PVRSRVBridgePMRSecureUnexportPMR(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_PMRSECUREUNEXPORTPMR *psPMRSecureUnexportPMRIN, + PVRSRV_BRIDGE_OUT_PMRSECUREUNEXPORTPMR *psPMRSecureUnexportPMROUT, + CONNECTION_DATA *psConnection) +{ + + + + + + PMRLock(); + + + + + psPMRSecureUnexportPMROUT->eError = + PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psPMRSecureUnexportPMRIN->hPMR, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR_SECURE_EXPORT); + if ((psPMRSecureUnexportPMROUT->eError != PVRSRV_OK) && (psPMRSecureUnexportPMROUT->eError != PVRSRV_ERROR_RETRY)) + { + PVR_ASSERT(0); + PMRUnlock(); + goto PMRSecureUnexportPMR_exit; + } + + PMRUnlock(); + + +PMRSecureUnexportPMR_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgePMRSecureImportPMR(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_PMRSECUREIMPORTPMR *psPMRSecureImportPMRIN, + PVRSRV_BRIDGE_OUT_PMRSECUREIMPORTPMR *psPMRSecureImportPMROUT, + CONNECTION_DATA *psConnection) +{ + PMR * psPMRInt = IMG_NULL; + + + + + + PMRLock(); + + + psPMRSecureImportPMROUT->eError = + PMRSecureImportPMR( + psPMRSecureImportPMRIN->Export, + &psPMRInt, + &psPMRSecureImportPMROUT->uiSize, + &psPMRSecureImportPMROUT->sAlign); + /* Exit early if bridged call fails */ + if(psPMRSecureImportPMROUT->eError != PVRSRV_OK) + { + PMRUnlock(); + goto PMRSecureImportPMR_exit; + } + PMRUnlock(); + + + psPMRSecureImportPMROUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psPMRSecureImportPMROUT->hPMR, + (IMG_VOID *) psPMRInt, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR, + PVRSRV_HANDLE_ALLOC_FLAG_MULTI + ,(PFN_HANDLE_RELEASE)&PMRUnrefPMR); + if (psPMRSecureImportPMROUT->eError != PVRSRV_OK) + { + goto PMRSecureImportPMR_exit; + } + + + + +PMRSecureImportPMR_exit: + if (psPMRSecureImportPMROUT->eError != PVRSRV_OK) + { + if (psPMRInt) + { + PMRUnrefPMR(psPMRInt); + } + } + + + return 0; +} + + + +/* *************************************************************************** + * Server bridge dispatch related glue + */ + + +PVRSRV_ERROR InitSMMBridge(IMG_VOID); +PVRSRV_ERROR DeinitSMMBridge(IMG_VOID); + +/* + * Register all SMM functions with services + */ +PVRSRV_ERROR InitSMMBridge(IMG_VOID) +{ + + SetDispatchTableEntry(PVRSRV_BRIDGE_SMM, PVRSRV_BRIDGE_SMM_PMRSECUREEXPORTPMR, PVRSRVBridgePMRSecureExportPMR, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_SMM, PVRSRV_BRIDGE_SMM_PMRSECUREUNEXPORTPMR, PVRSRVBridgePMRSecureUnexportPMR, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_SMM, PVRSRV_BRIDGE_SMM_PMRSECUREIMPORTPMR, PVRSRVBridgePMRSecureImportPMR, + IMG_NULL, IMG_NULL, + 0, 0); + + + return PVRSRV_OK; +} + +/* + * Unregister all smm functions with services + */ +PVRSRV_ERROR DeinitSMMBridge(IMG_VOID) +{ + return PVRSRV_OK; +} + diff --git a/drivers/gpu/rogue_m/generated/srvcore_bridge/common_srvcore_bridge.h b/drivers/gpu/rogue_m/generated/srvcore_bridge/common_srvcore_bridge.h new file mode 100644 index 000000000000..c37fb1cd388b --- /dev/null +++ b/drivers/gpu/rogue_m/generated/srvcore_bridge/common_srvcore_bridge.h @@ -0,0 +1,387 @@ +/*************************************************************************/ /*! +@File +@Title Common bridge header for srvcore +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Declares common defines and structures that are used by both + the client and sever side of the bridge for srvcore +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef COMMON_SRVCORE_BRIDGE_H +#define COMMON_SRVCORE_BRIDGE_H + +#include "img_types.h" +#include "pvrsrv_error.h" + +#include "pvrsrv_device_types.h" +#include "cache_external.h" + + +#define PVRSRV_BRIDGE_SRVCORE_CMD_FIRST 0 +#define PVRSRV_BRIDGE_SRVCORE_CONNECT PVRSRV_BRIDGE_SRVCORE_CMD_FIRST+0 +#define PVRSRV_BRIDGE_SRVCORE_DISCONNECT PVRSRV_BRIDGE_SRVCORE_CMD_FIRST+1 +#define PVRSRV_BRIDGE_SRVCORE_ENUMERATEDEVICES PVRSRV_BRIDGE_SRVCORE_CMD_FIRST+2 +#define PVRSRV_BRIDGE_SRVCORE_ACQUIREDEVICEDATA PVRSRV_BRIDGE_SRVCORE_CMD_FIRST+3 +#define PVRSRV_BRIDGE_SRVCORE_RELEASEDEVICEDATA PVRSRV_BRIDGE_SRVCORE_CMD_FIRST+4 +#define PVRSRV_BRIDGE_SRVCORE_INITSRVDISCONNECT PVRSRV_BRIDGE_SRVCORE_CMD_FIRST+5 +#define PVRSRV_BRIDGE_SRVCORE_ACQUIREGLOBALEVENTOBJECT PVRSRV_BRIDGE_SRVCORE_CMD_FIRST+6 +#define PVRSRV_BRIDGE_SRVCORE_RELEASEGLOBALEVENTOBJECT PVRSRV_BRIDGE_SRVCORE_CMD_FIRST+7 +#define PVRSRV_BRIDGE_SRVCORE_EVENTOBJECTOPEN PVRSRV_BRIDGE_SRVCORE_CMD_FIRST+8 +#define PVRSRV_BRIDGE_SRVCORE_EVENTOBJECTWAIT PVRSRV_BRIDGE_SRVCORE_CMD_FIRST+9 +#define PVRSRV_BRIDGE_SRVCORE_EVENTOBJECTCLOSE PVRSRV_BRIDGE_SRVCORE_CMD_FIRST+10 +#define PVRSRV_BRIDGE_SRVCORE_DUMPDEBUGINFO PVRSRV_BRIDGE_SRVCORE_CMD_FIRST+11 +#define PVRSRV_BRIDGE_SRVCORE_GETDEVCLOCKSPEED PVRSRV_BRIDGE_SRVCORE_CMD_FIRST+12 +#define PVRSRV_BRIDGE_SRVCORE_HWOPTIMEOUT PVRSRV_BRIDGE_SRVCORE_CMD_FIRST+13 +#define PVRSRV_BRIDGE_SRVCORE_KICKDEVICES PVRSRV_BRIDGE_SRVCORE_CMD_FIRST+14 +#define PVRSRV_BRIDGE_SRVCORE_RESETHWRLOGS PVRSRV_BRIDGE_SRVCORE_CMD_FIRST+15 +#define PVRSRV_BRIDGE_SRVCORE_SOFTRESET PVRSRV_BRIDGE_SRVCORE_CMD_FIRST+16 +#define PVRSRV_BRIDGE_SRVCORE_CMD_LAST (PVRSRV_BRIDGE_SRVCORE_CMD_FIRST+16) + + +/******************************************* + Connect + *******************************************/ + +/* Bridge in structure for Connect */ +typedef struct PVRSRV_BRIDGE_IN_CONNECT_TAG +{ + IMG_UINT32 ui32Flags; + IMG_UINT32 ui32ClientBuildOptions; + IMG_UINT32 ui32ClientDDKVersion; + IMG_UINT32 ui32ClientDDKBuild; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_CONNECT; + + +/* Bridge out structure for Connect */ +typedef struct PVRSRV_BRIDGE_OUT_CONNECT_TAG +{ + IMG_UINT8 ui8KernelArch; + IMG_UINT32 ui32Log2PageSize; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_CONNECT; + +/******************************************* + Disconnect + *******************************************/ + +/* Bridge in structure for Disconnect */ +typedef struct PVRSRV_BRIDGE_IN_DISCONNECT_TAG +{ + IMG_UINT32 ui32EmptyStructPlaceholder; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_DISCONNECT; + + +/* Bridge out structure for Disconnect */ +typedef struct PVRSRV_BRIDGE_OUT_DISCONNECT_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DISCONNECT; + +/******************************************* + EnumerateDevices + *******************************************/ + +/* Bridge in structure for EnumerateDevices */ +typedef struct PVRSRV_BRIDGE_IN_ENUMERATEDEVICES_TAG +{ + /* Output pointer peDeviceType is also an implied input */ + PVRSRV_DEVICE_TYPE * peDeviceType; + /* Output pointer peDeviceClass is also an implied input */ + PVRSRV_DEVICE_CLASS * peDeviceClass; + /* Output pointer pui32DeviceIndex is also an implied input */ + IMG_UINT32 * pui32DeviceIndex; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_ENUMERATEDEVICES; + + +/* Bridge out structure for EnumerateDevices */ +typedef struct PVRSRV_BRIDGE_OUT_ENUMERATEDEVICES_TAG +{ + IMG_UINT32 ui32NumDevices; + PVRSRV_DEVICE_TYPE * peDeviceType; + PVRSRV_DEVICE_CLASS * peDeviceClass; + IMG_UINT32 * pui32DeviceIndex; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_ENUMERATEDEVICES; + +/******************************************* + AcquireDeviceData + *******************************************/ + +/* Bridge in structure for AcquireDeviceData */ +typedef struct PVRSRV_BRIDGE_IN_ACQUIREDEVICEDATA_TAG +{ + IMG_UINT32 ui32DevIndex; + PVRSRV_DEVICE_TYPE eDeviceType; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_ACQUIREDEVICEDATA; + + +/* Bridge out structure for AcquireDeviceData */ +typedef struct PVRSRV_BRIDGE_OUT_ACQUIREDEVICEDATA_TAG +{ + IMG_HANDLE hDevCookie; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_ACQUIREDEVICEDATA; + +/******************************************* + ReleaseDeviceData + *******************************************/ + +/* Bridge in structure for ReleaseDeviceData */ +typedef struct PVRSRV_BRIDGE_IN_RELEASEDEVICEDATA_TAG +{ + IMG_HANDLE hDevCookie; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_RELEASEDEVICEDATA; + + +/* Bridge out structure for ReleaseDeviceData */ +typedef struct PVRSRV_BRIDGE_OUT_RELEASEDEVICEDATA_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RELEASEDEVICEDATA; + +/******************************************* + InitSrvDisconnect + *******************************************/ + +/* Bridge in structure for InitSrvDisconnect */ +typedef struct PVRSRV_BRIDGE_IN_INITSRVDISCONNECT_TAG +{ + IMG_BOOL bInitSuccesful; + IMG_UINT32 ui32ClientBuildOptions; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_INITSRVDISCONNECT; + + +/* Bridge out structure for InitSrvDisconnect */ +typedef struct PVRSRV_BRIDGE_OUT_INITSRVDISCONNECT_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_INITSRVDISCONNECT; + +/******************************************* + AcquireGlobalEventObject + *******************************************/ + +/* Bridge in structure for AcquireGlobalEventObject */ +typedef struct PVRSRV_BRIDGE_IN_ACQUIREGLOBALEVENTOBJECT_TAG +{ + IMG_UINT32 ui32EmptyStructPlaceholder; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_ACQUIREGLOBALEVENTOBJECT; + + +/* Bridge out structure for AcquireGlobalEventObject */ +typedef struct PVRSRV_BRIDGE_OUT_ACQUIREGLOBALEVENTOBJECT_TAG +{ + IMG_HANDLE hGlobalEventObject; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_ACQUIREGLOBALEVENTOBJECT; + +/******************************************* + ReleaseGlobalEventObject + *******************************************/ + +/* Bridge in structure for ReleaseGlobalEventObject */ +typedef struct PVRSRV_BRIDGE_IN_RELEASEGLOBALEVENTOBJECT_TAG +{ + IMG_HANDLE hGlobalEventObject; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_RELEASEGLOBALEVENTOBJECT; + + +/* Bridge out structure for ReleaseGlobalEventObject */ +typedef struct PVRSRV_BRIDGE_OUT_RELEASEGLOBALEVENTOBJECT_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RELEASEGLOBALEVENTOBJECT; + +/******************************************* + EventObjectOpen + *******************************************/ + +/* Bridge in structure for EventObjectOpen */ +typedef struct PVRSRV_BRIDGE_IN_EVENTOBJECTOPEN_TAG +{ + IMG_HANDLE hEventObject; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_EVENTOBJECTOPEN; + + +/* Bridge out structure for EventObjectOpen */ +typedef struct PVRSRV_BRIDGE_OUT_EVENTOBJECTOPEN_TAG +{ + IMG_HANDLE hOSEvent; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_EVENTOBJECTOPEN; + +/******************************************* + EventObjectWait + *******************************************/ + +/* Bridge in structure for EventObjectWait */ +typedef struct PVRSRV_BRIDGE_IN_EVENTOBJECTWAIT_TAG +{ + IMG_HANDLE hOSEventKM; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_EVENTOBJECTWAIT; + + +/* Bridge out structure for EventObjectWait */ +typedef struct PVRSRV_BRIDGE_OUT_EVENTOBJECTWAIT_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_EVENTOBJECTWAIT; + +/******************************************* + EventObjectClose + *******************************************/ + +/* Bridge in structure for EventObjectClose */ +typedef struct PVRSRV_BRIDGE_IN_EVENTOBJECTCLOSE_TAG +{ + IMG_HANDLE hOSEventKM; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_EVENTOBJECTCLOSE; + + +/* Bridge out structure for EventObjectClose */ +typedef struct PVRSRV_BRIDGE_OUT_EVENTOBJECTCLOSE_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_EVENTOBJECTCLOSE; + +/******************************************* + DumpDebugInfo + *******************************************/ + +/* Bridge in structure for DumpDebugInfo */ +typedef struct PVRSRV_BRIDGE_IN_DUMPDEBUGINFO_TAG +{ + IMG_UINT32 ui32ui32VerbLevel; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_DUMPDEBUGINFO; + + +/* Bridge out structure for DumpDebugInfo */ +typedef struct PVRSRV_BRIDGE_OUT_DUMPDEBUGINFO_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DUMPDEBUGINFO; + +/******************************************* + GetDevClockSpeed + *******************************************/ + +/* Bridge in structure for GetDevClockSpeed */ +typedef struct PVRSRV_BRIDGE_IN_GETDEVCLOCKSPEED_TAG +{ + IMG_HANDLE hDevNode; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_GETDEVCLOCKSPEED; + + +/* Bridge out structure for GetDevClockSpeed */ +typedef struct PVRSRV_BRIDGE_OUT_GETDEVCLOCKSPEED_TAG +{ + IMG_UINT32 ui32ui32ClockSpeed; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_GETDEVCLOCKSPEED; + +/******************************************* + HWOpTimeout + *******************************************/ + +/* Bridge in structure for HWOpTimeout */ +typedef struct PVRSRV_BRIDGE_IN_HWOPTIMEOUT_TAG +{ + IMG_UINT32 ui32EmptyStructPlaceholder; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_HWOPTIMEOUT; + + +/* Bridge out structure for HWOpTimeout */ +typedef struct PVRSRV_BRIDGE_OUT_HWOPTIMEOUT_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_HWOPTIMEOUT; + +/******************************************* + KickDevices + *******************************************/ + +/* Bridge in structure for KickDevices */ +typedef struct PVRSRV_BRIDGE_IN_KICKDEVICES_TAG +{ + IMG_UINT32 ui32EmptyStructPlaceholder; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_KICKDEVICES; + + +/* Bridge out structure for KickDevices */ +typedef struct PVRSRV_BRIDGE_OUT_KICKDEVICES_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_KICKDEVICES; + +/******************************************* + ResetHWRLogs + *******************************************/ + +/* Bridge in structure for ResetHWRLogs */ +typedef struct PVRSRV_BRIDGE_IN_RESETHWRLOGS_TAG +{ + IMG_HANDLE hDevNode; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_RESETHWRLOGS; + + +/* Bridge out structure for ResetHWRLogs */ +typedef struct PVRSRV_BRIDGE_OUT_RESETHWRLOGS_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RESETHWRLOGS; + +/******************************************* + SoftReset + *******************************************/ + +/* Bridge in structure for SoftReset */ +typedef struct PVRSRV_BRIDGE_IN_SOFTRESET_TAG +{ + IMG_HANDLE hDevNode; + IMG_UINT64 ui64ResetValue1; + IMG_UINT64 ui64ResetValue2; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_SOFTRESET; + + +/* Bridge out structure for SoftReset */ +typedef struct PVRSRV_BRIDGE_OUT_SOFTRESET_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_SOFTRESET; + +#endif /* COMMON_SRVCORE_BRIDGE_H */ diff --git a/drivers/gpu/rogue_m/generated/srvcore_bridge/server_srvcore_bridge.c b/drivers/gpu/rogue_m/generated/srvcore_bridge/server_srvcore_bridge.c new file mode 100644 index 000000000000..6b21060ed7c4 --- /dev/null +++ b/drivers/gpu/rogue_m/generated/srvcore_bridge/server_srvcore_bridge.c @@ -0,0 +1,867 @@ +/*************************************************************************/ /*! +@File +@Title Server bridge for srvcore +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Implements the server side of the bridge for srvcore +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#include +#include + +#include "img_defs.h" + +#include "srvcore.h" +#include "pvrsrv.h" + + +#include "common_srvcore_bridge.h" + +#include "allocmem.h" +#include "pvr_debug.h" +#include "connection_server.h" +#include "pvr_bridge.h" +#include "rgx_bridge.h" +#include "srvcore.h" +#include "handle.h" + +#if defined (SUPPORT_AUTH) +#include "osauth.h" +#endif + +#include + + +static PVRSRV_ERROR ReleaseDevCookie(IMG_VOID *pvData) +{ + PVR_UNREFERENCED_PARAMETER(pvData); + + return PVRSRV_OK; +} + + +/* *************************************************************************** + * Server-side bridge entry points + */ + +static IMG_INT +PVRSRVBridgeConnect(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_CONNECT *psConnectIN, + PVRSRV_BRIDGE_OUT_CONNECT *psConnectOUT, + CONNECTION_DATA *psConnection) +{ + + + + + + + + psConnectOUT->eError = + PVRSRVConnectKM(psConnection, + psConnectIN->ui32Flags, + psConnectIN->ui32ClientBuildOptions, + psConnectIN->ui32ClientDDKVersion, + psConnectIN->ui32ClientDDKBuild, + &psConnectOUT->ui8KernelArch, + &psConnectOUT->ui32Log2PageSize); + + + + + + return 0; +} + +static IMG_INT +PVRSRVBridgeDisconnect(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_DISCONNECT *psDisconnectIN, + PVRSRV_BRIDGE_OUT_DISCONNECT *psDisconnectOUT, + CONNECTION_DATA *psConnection) +{ + + PVR_UNREFERENCED_PARAMETER(psConnection); + PVR_UNREFERENCED_PARAMETER(psDisconnectIN); + + + + + + + psDisconnectOUT->eError = + PVRSRVDisconnectKM( + ); + + + + + + return 0; +} + +static IMG_INT +PVRSRVBridgeEnumerateDevices(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_ENUMERATEDEVICES *psEnumerateDevicesIN, + PVRSRV_BRIDGE_OUT_ENUMERATEDEVICES *psEnumerateDevicesOUT, + CONNECTION_DATA *psConnection) +{ + PVRSRV_DEVICE_TYPE *peDeviceTypeInt = IMG_NULL; + PVRSRV_DEVICE_CLASS *peDeviceClassInt = IMG_NULL; + IMG_UINT32 *pui32DeviceIndexInt = IMG_NULL; + + PVR_UNREFERENCED_PARAMETER(psConnection); + PVR_UNREFERENCED_PARAMETER(psEnumerateDevicesIN); + + psEnumerateDevicesOUT->peDeviceType = psEnumerateDevicesIN->peDeviceType; + psEnumerateDevicesOUT->peDeviceClass = psEnumerateDevicesIN->peDeviceClass; + psEnumerateDevicesOUT->pui32DeviceIndex = psEnumerateDevicesIN->pui32DeviceIndex; + + + + { + peDeviceTypeInt = OSAllocMem(PVRSRV_MAX_DEVICES * sizeof(PVRSRV_DEVICE_TYPE)); + if (!peDeviceTypeInt) + { + psEnumerateDevicesOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto EnumerateDevices_exit; + } + } + + + { + peDeviceClassInt = OSAllocMem(PVRSRV_MAX_DEVICES * sizeof(PVRSRV_DEVICE_CLASS)); + if (!peDeviceClassInt) + { + psEnumerateDevicesOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto EnumerateDevices_exit; + } + } + + + { + pui32DeviceIndexInt = OSAllocMem(PVRSRV_MAX_DEVICES * sizeof(IMG_UINT32)); + if (!pui32DeviceIndexInt) + { + psEnumerateDevicesOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto EnumerateDevices_exit; + } + } + + + + + psEnumerateDevicesOUT->eError = + PVRSRVEnumerateDevicesKM( + &psEnumerateDevicesOUT->ui32NumDevices, + peDeviceTypeInt, + peDeviceClassInt, + pui32DeviceIndexInt); + + + + if ( !OSAccessOK(PVR_VERIFY_WRITE, (IMG_VOID*) psEnumerateDevicesOUT->peDeviceType, (PVRSRV_MAX_DEVICES * sizeof(PVRSRV_DEVICE_TYPE))) + || (OSCopyToUser(NULL, psEnumerateDevicesOUT->peDeviceType, peDeviceTypeInt, + (PVRSRV_MAX_DEVICES * sizeof(PVRSRV_DEVICE_TYPE))) != PVRSRV_OK) ) + { + psEnumerateDevicesOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto EnumerateDevices_exit; + } + + if ( !OSAccessOK(PVR_VERIFY_WRITE, (IMG_VOID*) psEnumerateDevicesOUT->peDeviceClass, (PVRSRV_MAX_DEVICES * sizeof(PVRSRV_DEVICE_CLASS))) + || (OSCopyToUser(NULL, psEnumerateDevicesOUT->peDeviceClass, peDeviceClassInt, + (PVRSRV_MAX_DEVICES * sizeof(PVRSRV_DEVICE_CLASS))) != PVRSRV_OK) ) + { + psEnumerateDevicesOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto EnumerateDevices_exit; + } + + if ( !OSAccessOK(PVR_VERIFY_WRITE, (IMG_VOID*) psEnumerateDevicesOUT->pui32DeviceIndex, (PVRSRV_MAX_DEVICES * sizeof(IMG_UINT32))) + || (OSCopyToUser(NULL, psEnumerateDevicesOUT->pui32DeviceIndex, pui32DeviceIndexInt, + (PVRSRV_MAX_DEVICES * sizeof(IMG_UINT32))) != PVRSRV_OK) ) + { + psEnumerateDevicesOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto EnumerateDevices_exit; + } + + +EnumerateDevices_exit: + if (peDeviceTypeInt) + OSFreeMem(peDeviceTypeInt); + if (peDeviceClassInt) + OSFreeMem(peDeviceClassInt); + if (pui32DeviceIndexInt) + OSFreeMem(pui32DeviceIndexInt); + + return 0; +} + +static IMG_INT +PVRSRVBridgeAcquireDeviceData(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_ACQUIREDEVICEDATA *psAcquireDeviceDataIN, + PVRSRV_BRIDGE_OUT_ACQUIREDEVICEDATA *psAcquireDeviceDataOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevCookieInt = IMG_NULL; + + + + + + + + psAcquireDeviceDataOUT->eError = + PVRSRVAcquireDeviceDataKM( + psAcquireDeviceDataIN->ui32DevIndex, + psAcquireDeviceDataIN->eDeviceType, + &hDevCookieInt); + /* Exit early if bridged call fails */ + if(psAcquireDeviceDataOUT->eError != PVRSRV_OK) + { + goto AcquireDeviceData_exit; + } + + + psAcquireDeviceDataOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psAcquireDeviceDataOUT->hDevCookie, + (IMG_VOID *) hDevCookieInt, + PVRSRV_HANDLE_TYPE_DEV_NODE, + PVRSRV_HANDLE_ALLOC_FLAG_SHARED + ,(PFN_HANDLE_RELEASE)&ReleaseDevCookie); + if (psAcquireDeviceDataOUT->eError != PVRSRV_OK) + { + goto AcquireDeviceData_exit; + } + + + + +AcquireDeviceData_exit: + if (psAcquireDeviceDataOUT->eError != PVRSRV_OK) + { + } + + + return 0; +} + +static IMG_INT +PVRSRVBridgeReleaseDeviceData(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_RELEASEDEVICEDATA *psReleaseDeviceDataIN, + PVRSRV_BRIDGE_OUT_RELEASEDEVICEDATA *psReleaseDeviceDataOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevCookieInt = IMG_NULL; + + + + + + + + psReleaseDeviceDataOUT->eError = + PVRSRVReleaseDeviceDataKM( + hDevCookieInt); + + + psReleaseDeviceDataOUT->eError = + PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psReleaseDeviceDataIN->hDevCookie, + PVRSRV_HANDLE_TYPE_DEV_NODE); + if ((psReleaseDeviceDataOUT->eError != PVRSRV_OK) && (psReleaseDeviceDataOUT->eError != PVRSRV_ERROR_RETRY)) + { + PVR_ASSERT(0); + goto ReleaseDeviceData_exit; + } + + + +ReleaseDeviceData_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeInitSrvDisconnect(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_INITSRVDISCONNECT *psInitSrvDisconnectIN, + PVRSRV_BRIDGE_OUT_INITSRVDISCONNECT *psInitSrvDisconnectOUT, + CONNECTION_DATA *psConnection) +{ + + + + + + + + psInitSrvDisconnectOUT->eError = + PVRSRVInitSrvDisconnectKM(psConnection, + psInitSrvDisconnectIN->bInitSuccesful, + psInitSrvDisconnectIN->ui32ClientBuildOptions); + + + + + + return 0; +} + +static IMG_INT +PVRSRVBridgeAcquireGlobalEventObject(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_ACQUIREGLOBALEVENTOBJECT *psAcquireGlobalEventObjectIN, + PVRSRV_BRIDGE_OUT_ACQUIREGLOBALEVENTOBJECT *psAcquireGlobalEventObjectOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hGlobalEventObjectInt = IMG_NULL; + + PVR_UNREFERENCED_PARAMETER(psAcquireGlobalEventObjectIN); + + + + + + + psAcquireGlobalEventObjectOUT->eError = + AcquireGlobalEventObjectServer( + &hGlobalEventObjectInt); + /* Exit early if bridged call fails */ + if(psAcquireGlobalEventObjectOUT->eError != PVRSRV_OK) + { + goto AcquireGlobalEventObject_exit; + } + + + psAcquireGlobalEventObjectOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psAcquireGlobalEventObjectOUT->hGlobalEventObject, + (IMG_VOID *) hGlobalEventObjectInt, + PVRSRV_HANDLE_TYPE_SHARED_EVENT_OBJECT, + PVRSRV_HANDLE_ALLOC_FLAG_MULTI + ,(PFN_HANDLE_RELEASE)&ReleaseGlobalEventObjectServer); + if (psAcquireGlobalEventObjectOUT->eError != PVRSRV_OK) + { + goto AcquireGlobalEventObject_exit; + } + + + + +AcquireGlobalEventObject_exit: + if (psAcquireGlobalEventObjectOUT->eError != PVRSRV_OK) + { + if (hGlobalEventObjectInt) + { + ReleaseGlobalEventObjectServer(hGlobalEventObjectInt); + } + } + + + return 0; +} + +static IMG_INT +PVRSRVBridgeReleaseGlobalEventObject(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_RELEASEGLOBALEVENTOBJECT *psReleaseGlobalEventObjectIN, + PVRSRV_BRIDGE_OUT_RELEASEGLOBALEVENTOBJECT *psReleaseGlobalEventObjectOUT, + CONNECTION_DATA *psConnection) +{ + + + + + + + + + + psReleaseGlobalEventObjectOUT->eError = + PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psReleaseGlobalEventObjectIN->hGlobalEventObject, + PVRSRV_HANDLE_TYPE_SHARED_EVENT_OBJECT); + if ((psReleaseGlobalEventObjectOUT->eError != PVRSRV_OK) && (psReleaseGlobalEventObjectOUT->eError != PVRSRV_ERROR_RETRY)) + { + PVR_ASSERT(0); + goto ReleaseGlobalEventObject_exit; + } + + + +ReleaseGlobalEventObject_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeEventObjectOpen(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_EVENTOBJECTOPEN *psEventObjectOpenIN, + PVRSRV_BRIDGE_OUT_EVENTOBJECTOPEN *psEventObjectOpenOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hEventObjectInt = IMG_NULL; + IMG_HANDLE hOSEventInt = IMG_NULL; + + + + + + + + { + /* Look up the address from the handle */ + psEventObjectOpenOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &hEventObjectInt, + psEventObjectOpenIN->hEventObject, + PVRSRV_HANDLE_TYPE_SHARED_EVENT_OBJECT); + if(psEventObjectOpenOUT->eError != PVRSRV_OK) + { + goto EventObjectOpen_exit; + } + } + + + psEventObjectOpenOUT->eError = + OSEventObjectOpen( + hEventObjectInt, + &hOSEventInt); + /* Exit early if bridged call fails */ + if(psEventObjectOpenOUT->eError != PVRSRV_OK) + { + goto EventObjectOpen_exit; + } + + + psEventObjectOpenOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psEventObjectOpenOUT->hOSEvent, + (IMG_VOID *) hOSEventInt, + PVRSRV_HANDLE_TYPE_EVENT_OBJECT_CONNECT, + PVRSRV_HANDLE_ALLOC_FLAG_MULTI + ,(PFN_HANDLE_RELEASE)&OSEventObjectClose); + if (psEventObjectOpenOUT->eError != PVRSRV_OK) + { + goto EventObjectOpen_exit; + } + + + + +EventObjectOpen_exit: + if (psEventObjectOpenOUT->eError != PVRSRV_OK) + { + if (hOSEventInt) + { + OSEventObjectClose(hOSEventInt); + } + } + + + return 0; +} + +static IMG_INT +PVRSRVBridgeEventObjectWait(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_EVENTOBJECTWAIT *psEventObjectWaitIN, + PVRSRV_BRIDGE_OUT_EVENTOBJECTWAIT *psEventObjectWaitOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hOSEventKMInt = IMG_NULL; + + + + + + + + { + /* Look up the address from the handle */ + psEventObjectWaitOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &hOSEventKMInt, + psEventObjectWaitIN->hOSEventKM, + PVRSRV_HANDLE_TYPE_EVENT_OBJECT_CONNECT); + if(psEventObjectWaitOUT->eError != PVRSRV_OK) + { + goto EventObjectWait_exit; + } + } + + + psEventObjectWaitOUT->eError = + OSEventObjectWait( + hOSEventKMInt); + + + + +EventObjectWait_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeEventObjectClose(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_EVENTOBJECTCLOSE *psEventObjectCloseIN, + PVRSRV_BRIDGE_OUT_EVENTOBJECTCLOSE *psEventObjectCloseOUT, + CONNECTION_DATA *psConnection) +{ + + + + + + + + + + psEventObjectCloseOUT->eError = + PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psEventObjectCloseIN->hOSEventKM, + PVRSRV_HANDLE_TYPE_EVENT_OBJECT_CONNECT); + if ((psEventObjectCloseOUT->eError != PVRSRV_OK) && (psEventObjectCloseOUT->eError != PVRSRV_ERROR_RETRY)) + { + PVR_ASSERT(0); + goto EventObjectClose_exit; + } + + + +EventObjectClose_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeDumpDebugInfo(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_DUMPDEBUGINFO *psDumpDebugInfoIN, + PVRSRV_BRIDGE_OUT_DUMPDEBUGINFO *psDumpDebugInfoOUT, + CONNECTION_DATA *psConnection) +{ + + PVR_UNREFERENCED_PARAMETER(psConnection); + + + + + + + psDumpDebugInfoOUT->eError = + PVRSRVDumpDebugInfoKM( + psDumpDebugInfoIN->ui32ui32VerbLevel); + + + + + + return 0; +} + +static IMG_INT +PVRSRVBridgeGetDevClockSpeed(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_GETDEVCLOCKSPEED *psGetDevClockSpeedIN, + PVRSRV_BRIDGE_OUT_GETDEVCLOCKSPEED *psGetDevClockSpeedOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevNodeInt = IMG_NULL; + + + + + + + + { + /* Look up the address from the handle */ + psGetDevClockSpeedOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &hDevNodeInt, + psGetDevClockSpeedIN->hDevNode, + PVRSRV_HANDLE_TYPE_DEV_NODE); + if(psGetDevClockSpeedOUT->eError != PVRSRV_OK) + { + goto GetDevClockSpeed_exit; + } + } + + + psGetDevClockSpeedOUT->eError = + PVRSRVGetDevClockSpeedKM( + hDevNodeInt, + &psGetDevClockSpeedOUT->ui32ui32ClockSpeed); + + + + +GetDevClockSpeed_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeHWOpTimeout(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_HWOPTIMEOUT *psHWOpTimeoutIN, + PVRSRV_BRIDGE_OUT_HWOPTIMEOUT *psHWOpTimeoutOUT, + CONNECTION_DATA *psConnection) +{ + + PVR_UNREFERENCED_PARAMETER(psConnection); + PVR_UNREFERENCED_PARAMETER(psHWOpTimeoutIN); + + + + + + + psHWOpTimeoutOUT->eError = + PVRSRVHWOpTimeoutKM( + ); + + + + + + return 0; +} + +static IMG_INT +PVRSRVBridgeKickDevices(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_KICKDEVICES *psKickDevicesIN, + PVRSRV_BRIDGE_OUT_KICKDEVICES *psKickDevicesOUT, + CONNECTION_DATA *psConnection) +{ + + PVR_UNREFERENCED_PARAMETER(psConnection); + PVR_UNREFERENCED_PARAMETER(psKickDevicesIN); + + + + + + + psKickDevicesOUT->eError = + PVRSRVKickDevicesKM( + ); + + + + + + return 0; +} + +static IMG_INT +PVRSRVBridgeResetHWRLogs(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_RESETHWRLOGS *psResetHWRLogsIN, + PVRSRV_BRIDGE_OUT_RESETHWRLOGS *psResetHWRLogsOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevNodeInt = IMG_NULL; + + + + + + + + { + /* Look up the address from the handle */ + psResetHWRLogsOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &hDevNodeInt, + psResetHWRLogsIN->hDevNode, + PVRSRV_HANDLE_TYPE_DEV_NODE); + if(psResetHWRLogsOUT->eError != PVRSRV_OK) + { + goto ResetHWRLogs_exit; + } + } + + + psResetHWRLogsOUT->eError = + PVRSRVResetHWRLogsKM( + hDevNodeInt); + + + + +ResetHWRLogs_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeSoftReset(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_SOFTRESET *psSoftResetIN, + PVRSRV_BRIDGE_OUT_SOFTRESET *psSoftResetOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevNodeInt = IMG_NULL; + + + + + + + + { + /* Look up the address from the handle */ + psSoftResetOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &hDevNodeInt, + psSoftResetIN->hDevNode, + PVRSRV_HANDLE_TYPE_DEV_NODE); + if(psSoftResetOUT->eError != PVRSRV_OK) + { + goto SoftReset_exit; + } + } + + + psSoftResetOUT->eError = + PVRSRVSoftResetKM( + hDevNodeInt, + psSoftResetIN->ui64ResetValue1, + psSoftResetIN->ui64ResetValue2); + + + + +SoftReset_exit: + + return 0; +} + + + +/* *************************************************************************** + * Server bridge dispatch related glue + */ + + +PVRSRV_ERROR InitSRVCOREBridge(IMG_VOID); +PVRSRV_ERROR DeinitSRVCOREBridge(IMG_VOID); + +/* + * Register all SRVCORE functions with services + */ +PVRSRV_ERROR InitSRVCOREBridge(IMG_VOID) +{ + + SetDispatchTableEntry(PVRSRV_BRIDGE_SRVCORE, PVRSRV_BRIDGE_SRVCORE_CONNECT, PVRSRVBridgeConnect, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_SRVCORE, PVRSRV_BRIDGE_SRVCORE_DISCONNECT, PVRSRVBridgeDisconnect, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_SRVCORE, PVRSRV_BRIDGE_SRVCORE_ENUMERATEDEVICES, PVRSRVBridgeEnumerateDevices, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_SRVCORE, PVRSRV_BRIDGE_SRVCORE_ACQUIREDEVICEDATA, PVRSRVBridgeAcquireDeviceData, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_SRVCORE, PVRSRV_BRIDGE_SRVCORE_RELEASEDEVICEDATA, PVRSRVBridgeReleaseDeviceData, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_SRVCORE, PVRSRV_BRIDGE_SRVCORE_INITSRVDISCONNECT, PVRSRVBridgeInitSrvDisconnect, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_SRVCORE, PVRSRV_BRIDGE_SRVCORE_ACQUIREGLOBALEVENTOBJECT, PVRSRVBridgeAcquireGlobalEventObject, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_SRVCORE, PVRSRV_BRIDGE_SRVCORE_RELEASEGLOBALEVENTOBJECT, PVRSRVBridgeReleaseGlobalEventObject, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_SRVCORE, PVRSRV_BRIDGE_SRVCORE_EVENTOBJECTOPEN, PVRSRVBridgeEventObjectOpen, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_SRVCORE, PVRSRV_BRIDGE_SRVCORE_EVENTOBJECTWAIT, PVRSRVBridgeEventObjectWait, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_SRVCORE, PVRSRV_BRIDGE_SRVCORE_EVENTOBJECTCLOSE, PVRSRVBridgeEventObjectClose, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_SRVCORE, PVRSRV_BRIDGE_SRVCORE_DUMPDEBUGINFO, PVRSRVBridgeDumpDebugInfo, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_SRVCORE, PVRSRV_BRIDGE_SRVCORE_GETDEVCLOCKSPEED, PVRSRVBridgeGetDevClockSpeed, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_SRVCORE, PVRSRV_BRIDGE_SRVCORE_HWOPTIMEOUT, PVRSRVBridgeHWOpTimeout, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_SRVCORE, PVRSRV_BRIDGE_SRVCORE_KICKDEVICES, PVRSRVBridgeKickDevices, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_SRVCORE, PVRSRV_BRIDGE_SRVCORE_RESETHWRLOGS, PVRSRVBridgeResetHWRLogs, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_SRVCORE, PVRSRV_BRIDGE_SRVCORE_SOFTRESET, PVRSRVBridgeSoftReset, + IMG_NULL, IMG_NULL, + 0, 0); + + + return PVRSRV_OK; +} + +/* + * Unregister all srvcore functions with services + */ +PVRSRV_ERROR DeinitSRVCOREBridge(IMG_VOID) +{ + return PVRSRV_OK; +} + diff --git a/drivers/gpu/rogue_m/generated/sync_bridge/common_sync_bridge.h b/drivers/gpu/rogue_m/generated/sync_bridge/common_sync_bridge.h new file mode 100644 index 000000000000..dc2867452091 --- /dev/null +++ b/drivers/gpu/rogue_m/generated/sync_bridge/common_sync_bridge.h @@ -0,0 +1,481 @@ +/*************************************************************************/ /*! +@File +@Title Common bridge header for sync +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Declares common defines and structures that are used by both + the client and sever side of the bridge for sync +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef COMMON_SYNC_BRIDGE_H +#define COMMON_SYNC_BRIDGE_H + +#include "img_types.h" +#include "pvrsrv_error.h" + +#include "pdump.h" +#include "pdumpdefs.h" +#include "devicemem_typedefs.h" + + +#define PVRSRV_BRIDGE_SYNC_CMD_FIRST 0 +#define PVRSRV_BRIDGE_SYNC_ALLOCSYNCPRIMITIVEBLOCK PVRSRV_BRIDGE_SYNC_CMD_FIRST+0 +#define PVRSRV_BRIDGE_SYNC_FREESYNCPRIMITIVEBLOCK PVRSRV_BRIDGE_SYNC_CMD_FIRST+1 +#define PVRSRV_BRIDGE_SYNC_SYNCPRIMSET PVRSRV_BRIDGE_SYNC_CMD_FIRST+2 +#define PVRSRV_BRIDGE_SYNC_SERVERSYNCPRIMSET PVRSRV_BRIDGE_SYNC_CMD_FIRST+3 +#define PVRSRV_BRIDGE_SYNC_SYNCRECORDREMOVEBYHANDLE PVRSRV_BRIDGE_SYNC_CMD_FIRST+4 +#define PVRSRV_BRIDGE_SYNC_SYNCRECORDADD PVRSRV_BRIDGE_SYNC_CMD_FIRST+5 +#define PVRSRV_BRIDGE_SYNC_SERVERSYNCALLOC PVRSRV_BRIDGE_SYNC_CMD_FIRST+6 +#define PVRSRV_BRIDGE_SYNC_SERVERSYNCFREE PVRSRV_BRIDGE_SYNC_CMD_FIRST+7 +#define PVRSRV_BRIDGE_SYNC_SERVERSYNCQUEUEHWOP PVRSRV_BRIDGE_SYNC_CMD_FIRST+8 +#define PVRSRV_BRIDGE_SYNC_SERVERSYNCGETSTATUS PVRSRV_BRIDGE_SYNC_CMD_FIRST+9 +#define PVRSRV_BRIDGE_SYNC_SYNCPRIMOPCREATE PVRSRV_BRIDGE_SYNC_CMD_FIRST+10 +#define PVRSRV_BRIDGE_SYNC_SYNCPRIMOPTAKE PVRSRV_BRIDGE_SYNC_CMD_FIRST+11 +#define PVRSRV_BRIDGE_SYNC_SYNCPRIMOPREADY PVRSRV_BRIDGE_SYNC_CMD_FIRST+12 +#define PVRSRV_BRIDGE_SYNC_SYNCPRIMOPCOMPLETE PVRSRV_BRIDGE_SYNC_CMD_FIRST+13 +#define PVRSRV_BRIDGE_SYNC_SYNCPRIMOPDESTROY PVRSRV_BRIDGE_SYNC_CMD_FIRST+14 +#define PVRSRV_BRIDGE_SYNC_SYNCPRIMPDUMP PVRSRV_BRIDGE_SYNC_CMD_FIRST+15 +#define PVRSRV_BRIDGE_SYNC_SYNCPRIMPDUMPVALUE PVRSRV_BRIDGE_SYNC_CMD_FIRST+16 +#define PVRSRV_BRIDGE_SYNC_SYNCPRIMPDUMPPOL PVRSRV_BRIDGE_SYNC_CMD_FIRST+17 +#define PVRSRV_BRIDGE_SYNC_SYNCPRIMOPPDUMPPOL PVRSRV_BRIDGE_SYNC_CMD_FIRST+18 +#define PVRSRV_BRIDGE_SYNC_SYNCPRIMPDUMPCBP PVRSRV_BRIDGE_SYNC_CMD_FIRST+19 +#define PVRSRV_BRIDGE_SYNC_CMD_LAST (PVRSRV_BRIDGE_SYNC_CMD_FIRST+19) + + +/******************************************* + AllocSyncPrimitiveBlock + *******************************************/ + +/* Bridge in structure for AllocSyncPrimitiveBlock */ +typedef struct PVRSRV_BRIDGE_IN_ALLOCSYNCPRIMITIVEBLOCK_TAG +{ + IMG_HANDLE hDevNode; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_ALLOCSYNCPRIMITIVEBLOCK; + + +/* Bridge out structure for AllocSyncPrimitiveBlock */ +typedef struct PVRSRV_BRIDGE_OUT_ALLOCSYNCPRIMITIVEBLOCK_TAG +{ + IMG_HANDLE hSyncHandle; + IMG_UINT32 ui32SyncPrimVAddr; + IMG_UINT32 ui32SyncPrimBlockSize; + DEVMEM_SERVER_EXPORTCOOKIE hExportCookie; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_ALLOCSYNCPRIMITIVEBLOCK; + +/******************************************* + FreeSyncPrimitiveBlock + *******************************************/ + +/* Bridge in structure for FreeSyncPrimitiveBlock */ +typedef struct PVRSRV_BRIDGE_IN_FREESYNCPRIMITIVEBLOCK_TAG +{ + IMG_HANDLE hSyncHandle; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_FREESYNCPRIMITIVEBLOCK; + + +/* Bridge out structure for FreeSyncPrimitiveBlock */ +typedef struct PVRSRV_BRIDGE_OUT_FREESYNCPRIMITIVEBLOCK_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_FREESYNCPRIMITIVEBLOCK; + +/******************************************* + SyncPrimSet + *******************************************/ + +/* Bridge in structure for SyncPrimSet */ +typedef struct PVRSRV_BRIDGE_IN_SYNCPRIMSET_TAG +{ + IMG_HANDLE hSyncHandle; + IMG_UINT32 ui32Index; + IMG_UINT32 ui32Value; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_SYNCPRIMSET; + + +/* Bridge out structure for SyncPrimSet */ +typedef struct PVRSRV_BRIDGE_OUT_SYNCPRIMSET_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_SYNCPRIMSET; + +/******************************************* + ServerSyncPrimSet + *******************************************/ + +/* Bridge in structure for ServerSyncPrimSet */ +typedef struct PVRSRV_BRIDGE_IN_SERVERSYNCPRIMSET_TAG +{ + IMG_HANDLE hSyncHandle; + IMG_UINT32 ui32Value; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_SERVERSYNCPRIMSET; + + +/* Bridge out structure for ServerSyncPrimSet */ +typedef struct PVRSRV_BRIDGE_OUT_SERVERSYNCPRIMSET_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_SERVERSYNCPRIMSET; + +/******************************************* + SyncRecordRemoveByHandle + *******************************************/ + +/* Bridge in structure for SyncRecordRemoveByHandle */ +typedef struct PVRSRV_BRIDGE_IN_SYNCRECORDREMOVEBYHANDLE_TAG +{ + IMG_HANDLE hhRecord; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_SYNCRECORDREMOVEBYHANDLE; + + +/* Bridge out structure for SyncRecordRemoveByHandle */ +typedef struct PVRSRV_BRIDGE_OUT_SYNCRECORDREMOVEBYHANDLE_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_SYNCRECORDREMOVEBYHANDLE; + +/******************************************* + SyncRecordAdd + *******************************************/ + +/* Bridge in structure for SyncRecordAdd */ +typedef struct PVRSRV_BRIDGE_IN_SYNCRECORDADD_TAG +{ + IMG_HANDLE hhServerSyncPrimBlock; + IMG_UINT32 ui32ui32FwBlockAddr; + IMG_UINT32 ui32ui32SyncOffset; + IMG_BOOL bbServerSync; + IMG_UINT32 ui32ClassNameSize; + const IMG_CHAR * puiClassName; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_SYNCRECORDADD; + + +/* Bridge out structure for SyncRecordAdd */ +typedef struct PVRSRV_BRIDGE_OUT_SYNCRECORDADD_TAG +{ + IMG_HANDLE hhRecord; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_SYNCRECORDADD; + +/******************************************* + ServerSyncAlloc + *******************************************/ + +/* Bridge in structure for ServerSyncAlloc */ +typedef struct PVRSRV_BRIDGE_IN_SERVERSYNCALLOC_TAG +{ + IMG_HANDLE hDevNode; + IMG_UINT32 ui32ClassNameSize; + const IMG_CHAR * puiClassName; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_SERVERSYNCALLOC; + + +/* Bridge out structure for ServerSyncAlloc */ +typedef struct PVRSRV_BRIDGE_OUT_SERVERSYNCALLOC_TAG +{ + IMG_HANDLE hSyncHandle; + IMG_UINT32 ui32SyncPrimVAddr; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_SERVERSYNCALLOC; + +/******************************************* + ServerSyncFree + *******************************************/ + +/* Bridge in structure for ServerSyncFree */ +typedef struct PVRSRV_BRIDGE_IN_SERVERSYNCFREE_TAG +{ + IMG_HANDLE hSyncHandle; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_SERVERSYNCFREE; + + +/* Bridge out structure for ServerSyncFree */ +typedef struct PVRSRV_BRIDGE_OUT_SERVERSYNCFREE_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_SERVERSYNCFREE; + +/******************************************* + ServerSyncQueueHWOp + *******************************************/ + +/* Bridge in structure for ServerSyncQueueHWOp */ +typedef struct PVRSRV_BRIDGE_IN_SERVERSYNCQUEUEHWOP_TAG +{ + IMG_HANDLE hSyncHandle; + IMG_BOOL bbUpdate; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_SERVERSYNCQUEUEHWOP; + + +/* Bridge out structure for ServerSyncQueueHWOp */ +typedef struct PVRSRV_BRIDGE_OUT_SERVERSYNCQUEUEHWOP_TAG +{ + IMG_UINT32 ui32FenceValue; + IMG_UINT32 ui32UpdateValue; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_SERVERSYNCQUEUEHWOP; + +/******************************************* + ServerSyncGetStatus + *******************************************/ + +/* Bridge in structure for ServerSyncGetStatus */ +typedef struct PVRSRV_BRIDGE_IN_SERVERSYNCGETSTATUS_TAG +{ + IMG_UINT32 ui32SyncCount; + IMG_HANDLE * phSyncHandle; + /* Output pointer pui32UID is also an implied input */ + IMG_UINT32 * pui32UID; + /* Output pointer pui32FWAddr is also an implied input */ + IMG_UINT32 * pui32FWAddr; + /* Output pointer pui32CurrentOp is also an implied input */ + IMG_UINT32 * pui32CurrentOp; + /* Output pointer pui32NextOp is also an implied input */ + IMG_UINT32 * pui32NextOp; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_SERVERSYNCGETSTATUS; + + +/* Bridge out structure for ServerSyncGetStatus */ +typedef struct PVRSRV_BRIDGE_OUT_SERVERSYNCGETSTATUS_TAG +{ + IMG_UINT32 * pui32UID; + IMG_UINT32 * pui32FWAddr; + IMG_UINT32 * pui32CurrentOp; + IMG_UINT32 * pui32NextOp; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_SERVERSYNCGETSTATUS; + +/******************************************* + SyncPrimOpCreate + *******************************************/ + +/* Bridge in structure for SyncPrimOpCreate */ +typedef struct PVRSRV_BRIDGE_IN_SYNCPRIMOPCREATE_TAG +{ + IMG_UINT32 ui32SyncBlockCount; + IMG_HANDLE * phBlockList; + IMG_UINT32 ui32ClientSyncCount; + IMG_UINT32 * pui32SyncBlockIndex; + IMG_UINT32 * pui32Index; + IMG_UINT32 ui32ServerSyncCount; + IMG_HANDLE * phServerSync; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_SYNCPRIMOPCREATE; + + +/* Bridge out structure for SyncPrimOpCreate */ +typedef struct PVRSRV_BRIDGE_OUT_SYNCPRIMOPCREATE_TAG +{ + IMG_HANDLE hServerCookie; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_SYNCPRIMOPCREATE; + +/******************************************* + SyncPrimOpTake + *******************************************/ + +/* Bridge in structure for SyncPrimOpTake */ +typedef struct PVRSRV_BRIDGE_IN_SYNCPRIMOPTAKE_TAG +{ + IMG_HANDLE hServerCookie; + IMG_UINT32 ui32ClientSyncCount; + IMG_UINT32 * pui32Flags; + IMG_UINT32 * pui32FenceValue; + IMG_UINT32 * pui32UpdateValue; + IMG_UINT32 ui32ServerSyncCount; + IMG_UINT32 * pui32ServerFlags; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_SYNCPRIMOPTAKE; + + +/* Bridge out structure for SyncPrimOpTake */ +typedef struct PVRSRV_BRIDGE_OUT_SYNCPRIMOPTAKE_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_SYNCPRIMOPTAKE; + +/******************************************* + SyncPrimOpReady + *******************************************/ + +/* Bridge in structure for SyncPrimOpReady */ +typedef struct PVRSRV_BRIDGE_IN_SYNCPRIMOPREADY_TAG +{ + IMG_HANDLE hServerCookie; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_SYNCPRIMOPREADY; + + +/* Bridge out structure for SyncPrimOpReady */ +typedef struct PVRSRV_BRIDGE_OUT_SYNCPRIMOPREADY_TAG +{ + IMG_BOOL bReady; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_SYNCPRIMOPREADY; + +/******************************************* + SyncPrimOpComplete + *******************************************/ + +/* Bridge in structure for SyncPrimOpComplete */ +typedef struct PVRSRV_BRIDGE_IN_SYNCPRIMOPCOMPLETE_TAG +{ + IMG_HANDLE hServerCookie; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_SYNCPRIMOPCOMPLETE; + + +/* Bridge out structure for SyncPrimOpComplete */ +typedef struct PVRSRV_BRIDGE_OUT_SYNCPRIMOPCOMPLETE_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_SYNCPRIMOPCOMPLETE; + +/******************************************* + SyncPrimOpDestroy + *******************************************/ + +/* Bridge in structure for SyncPrimOpDestroy */ +typedef struct PVRSRV_BRIDGE_IN_SYNCPRIMOPDESTROY_TAG +{ + IMG_HANDLE hServerCookie; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_SYNCPRIMOPDESTROY; + + +/* Bridge out structure for SyncPrimOpDestroy */ +typedef struct PVRSRV_BRIDGE_OUT_SYNCPRIMOPDESTROY_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_SYNCPRIMOPDESTROY; + +/******************************************* + SyncPrimPDump + *******************************************/ + +/* Bridge in structure for SyncPrimPDump */ +typedef struct PVRSRV_BRIDGE_IN_SYNCPRIMPDUMP_TAG +{ + IMG_HANDLE hSyncHandle; + IMG_UINT32 ui32Offset; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_SYNCPRIMPDUMP; + + +/* Bridge out structure for SyncPrimPDump */ +typedef struct PVRSRV_BRIDGE_OUT_SYNCPRIMPDUMP_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_SYNCPRIMPDUMP; + +/******************************************* + SyncPrimPDumpValue + *******************************************/ + +/* Bridge in structure for SyncPrimPDumpValue */ +typedef struct PVRSRV_BRIDGE_IN_SYNCPRIMPDUMPVALUE_TAG +{ + IMG_HANDLE hSyncHandle; + IMG_UINT32 ui32Offset; + IMG_UINT32 ui32Value; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_SYNCPRIMPDUMPVALUE; + + +/* Bridge out structure for SyncPrimPDumpValue */ +typedef struct PVRSRV_BRIDGE_OUT_SYNCPRIMPDUMPVALUE_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_SYNCPRIMPDUMPVALUE; + +/******************************************* + SyncPrimPDumpPol + *******************************************/ + +/* Bridge in structure for SyncPrimPDumpPol */ +typedef struct PVRSRV_BRIDGE_IN_SYNCPRIMPDUMPPOL_TAG +{ + IMG_HANDLE hSyncHandle; + IMG_UINT32 ui32Offset; + IMG_UINT32 ui32Value; + IMG_UINT32 ui32Mask; + PDUMP_POLL_OPERATOR eOperator; + PDUMP_FLAGS_T uiPDumpFlags; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_SYNCPRIMPDUMPPOL; + + +/* Bridge out structure for SyncPrimPDumpPol */ +typedef struct PVRSRV_BRIDGE_OUT_SYNCPRIMPDUMPPOL_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_SYNCPRIMPDUMPPOL; + +/******************************************* + SyncPrimOpPDumpPol + *******************************************/ + +/* Bridge in structure for SyncPrimOpPDumpPol */ +typedef struct PVRSRV_BRIDGE_IN_SYNCPRIMOPPDUMPPOL_TAG +{ + IMG_HANDLE hServerCookie; + PDUMP_POLL_OPERATOR eOperator; + PDUMP_FLAGS_T uiPDumpFlags; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_SYNCPRIMOPPDUMPPOL; + + +/* Bridge out structure for SyncPrimOpPDumpPol */ +typedef struct PVRSRV_BRIDGE_OUT_SYNCPRIMOPPDUMPPOL_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_SYNCPRIMOPPDUMPPOL; + +/******************************************* + SyncPrimPDumpCBP + *******************************************/ + +/* Bridge in structure for SyncPrimPDumpCBP */ +typedef struct PVRSRV_BRIDGE_IN_SYNCPRIMPDUMPCBP_TAG +{ + IMG_HANDLE hSyncHandle; + IMG_UINT32 ui32Offset; + IMG_DEVMEM_OFFSET_T uiWriteOffset; + IMG_DEVMEM_SIZE_T uiPacketSize; + IMG_DEVMEM_SIZE_T uiBufferSize; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_SYNCPRIMPDUMPCBP; + + +/* Bridge out structure for SyncPrimPDumpCBP */ +typedef struct PVRSRV_BRIDGE_OUT_SYNCPRIMPDUMPCBP_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_SYNCPRIMPDUMPCBP; + +#endif /* COMMON_SYNC_BRIDGE_H */ diff --git a/drivers/gpu/rogue_m/generated/sync_bridge/server_sync_bridge.c b/drivers/gpu/rogue_m/generated/sync_bridge/server_sync_bridge.c new file mode 100644 index 000000000000..a7f79c4a90e7 --- /dev/null +++ b/drivers/gpu/rogue_m/generated/sync_bridge/server_sync_bridge.c @@ -0,0 +1,1548 @@ +/*************************************************************************/ /*! +@File +@Title Server bridge for sync +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Implements the server side of the bridge for sync +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#include +#include + +#include "img_defs.h" + +#include "sync_server.h" +#include "pdump.h" + + +#include "common_sync_bridge.h" + +#include "allocmem.h" +#include "pvr_debug.h" +#include "connection_server.h" +#include "pvr_bridge.h" +#include "rgx_bridge.h" +#include "srvcore.h" +#include "handle.h" + +#if defined (SUPPORT_AUTH) +#include "osauth.h" +#endif + +#include + + + + +/* *************************************************************************** + * Server-side bridge entry points + */ + +static IMG_INT +PVRSRVBridgeAllocSyncPrimitiveBlock(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_ALLOCSYNCPRIMITIVEBLOCK *psAllocSyncPrimitiveBlockIN, + PVRSRV_BRIDGE_OUT_ALLOCSYNCPRIMITIVEBLOCK *psAllocSyncPrimitiveBlockOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevNodeInt = IMG_NULL; + SYNC_PRIMITIVE_BLOCK * psSyncHandleInt = IMG_NULL; + DEVMEM_EXPORTCOOKIE * psExportCookieInt = IMG_NULL; + + + + psAllocSyncPrimitiveBlockOUT->hSyncHandle = IMG_NULL; + + + + + { + /* Look up the address from the handle */ + psAllocSyncPrimitiveBlockOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &hDevNodeInt, + psAllocSyncPrimitiveBlockIN->hDevNode, + PVRSRV_HANDLE_TYPE_DEV_NODE); + if(psAllocSyncPrimitiveBlockOUT->eError != PVRSRV_OK) + { + goto AllocSyncPrimitiveBlock_exit; + } + } + + + psAllocSyncPrimitiveBlockOUT->eError = + PVRSRVAllocSyncPrimitiveBlockKM(psConnection, + hDevNodeInt, + &psSyncHandleInt, + &psAllocSyncPrimitiveBlockOUT->ui32SyncPrimVAddr, + &psAllocSyncPrimitiveBlockOUT->ui32SyncPrimBlockSize, + &psExportCookieInt); + /* Exit early if bridged call fails */ + if(psAllocSyncPrimitiveBlockOUT->eError != PVRSRV_OK) + { + goto AllocSyncPrimitiveBlock_exit; + } + + + psAllocSyncPrimitiveBlockOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psAllocSyncPrimitiveBlockOUT->hSyncHandle, + (IMG_VOID *) psSyncHandleInt, + PVRSRV_HANDLE_TYPE_SYNC_PRIMITIVE_BLOCK, + PVRSRV_HANDLE_ALLOC_FLAG_MULTI + ,(PFN_HANDLE_RELEASE)&PVRSRVFreeSyncPrimitiveBlockKM); + if (psAllocSyncPrimitiveBlockOUT->eError != PVRSRV_OK) + { + goto AllocSyncPrimitiveBlock_exit; + } + + + psAllocSyncPrimitiveBlockOUT->eError = PVRSRVAllocSubHandle(psConnection->psHandleBase, + &psAllocSyncPrimitiveBlockOUT->hExportCookie, + (IMG_VOID *) psExportCookieInt, + PVRSRV_HANDLE_TYPE_SERVER_EXPORTCOOKIE, + PVRSRV_HANDLE_ALLOC_FLAG_NONE + ,psAllocSyncPrimitiveBlockOUT->hSyncHandle); + if (psAllocSyncPrimitiveBlockOUT->eError != PVRSRV_OK) + { + goto AllocSyncPrimitiveBlock_exit; + } + + + + +AllocSyncPrimitiveBlock_exit: + if (psAllocSyncPrimitiveBlockOUT->eError != PVRSRV_OK) + { + if (psAllocSyncPrimitiveBlockOUT->hSyncHandle) + { + PVRSRV_ERROR eError = PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psAllocSyncPrimitiveBlockOUT->hSyncHandle, + PVRSRV_HANDLE_TYPE_SYNC_PRIMITIVE_BLOCK); + + /* Releasing the handle should free/destroy/release the resource. This should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + + /* Avoid freeing/destroying/releasing the resource a second time below */ + psSyncHandleInt = IMG_NULL; + } + + + if (psSyncHandleInt) + { + PVRSRVFreeSyncPrimitiveBlockKM(psSyncHandleInt); + } + } + + + return 0; +} + +static IMG_INT +PVRSRVBridgeFreeSyncPrimitiveBlock(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_FREESYNCPRIMITIVEBLOCK *psFreeSyncPrimitiveBlockIN, + PVRSRV_BRIDGE_OUT_FREESYNCPRIMITIVEBLOCK *psFreeSyncPrimitiveBlockOUT, + CONNECTION_DATA *psConnection) +{ + + + + + + + + + + psFreeSyncPrimitiveBlockOUT->eError = + PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psFreeSyncPrimitiveBlockIN->hSyncHandle, + PVRSRV_HANDLE_TYPE_SYNC_PRIMITIVE_BLOCK); + if ((psFreeSyncPrimitiveBlockOUT->eError != PVRSRV_OK) && (psFreeSyncPrimitiveBlockOUT->eError != PVRSRV_ERROR_RETRY)) + { + PVR_ASSERT(0); + goto FreeSyncPrimitiveBlock_exit; + } + + + +FreeSyncPrimitiveBlock_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeSyncPrimSet(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_SYNCPRIMSET *psSyncPrimSetIN, + PVRSRV_BRIDGE_OUT_SYNCPRIMSET *psSyncPrimSetOUT, + CONNECTION_DATA *psConnection) +{ + SYNC_PRIMITIVE_BLOCK * psSyncHandleInt = IMG_NULL; + + + + + + + + { + /* Look up the address from the handle */ + psSyncPrimSetOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psSyncHandleInt, + psSyncPrimSetIN->hSyncHandle, + PVRSRV_HANDLE_TYPE_SYNC_PRIMITIVE_BLOCK); + if(psSyncPrimSetOUT->eError != PVRSRV_OK) + { + goto SyncPrimSet_exit; + } + } + + + psSyncPrimSetOUT->eError = + PVRSRVSyncPrimSetKM( + psSyncHandleInt, + psSyncPrimSetIN->ui32Index, + psSyncPrimSetIN->ui32Value); + + + + +SyncPrimSet_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeServerSyncPrimSet(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_SERVERSYNCPRIMSET *psServerSyncPrimSetIN, + PVRSRV_BRIDGE_OUT_SERVERSYNCPRIMSET *psServerSyncPrimSetOUT, + CONNECTION_DATA *psConnection) +{ + SERVER_SYNC_PRIMITIVE * psSyncHandleInt = IMG_NULL; + + + + + + + + { + /* Look up the address from the handle */ + psServerSyncPrimSetOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psSyncHandleInt, + psServerSyncPrimSetIN->hSyncHandle, + PVRSRV_HANDLE_TYPE_SERVER_SYNC_PRIMITIVE); + if(psServerSyncPrimSetOUT->eError != PVRSRV_OK) + { + goto ServerSyncPrimSet_exit; + } + } + + + psServerSyncPrimSetOUT->eError = + PVRSRVServerSyncPrimSetKM( + psSyncHandleInt, + psServerSyncPrimSetIN->ui32Value); + + + + +ServerSyncPrimSet_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeSyncRecordRemoveByHandle(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_SYNCRECORDREMOVEBYHANDLE *psSyncRecordRemoveByHandleIN, + PVRSRV_BRIDGE_OUT_SYNCRECORDREMOVEBYHANDLE *psSyncRecordRemoveByHandleOUT, + CONNECTION_DATA *psConnection) +{ + + + + + + + + + + psSyncRecordRemoveByHandleOUT->eError = + PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psSyncRecordRemoveByHandleIN->hhRecord, + PVRSRV_HANDLE_TYPE_SYNC_RECORD_HANDLE); + if ((psSyncRecordRemoveByHandleOUT->eError != PVRSRV_OK) && (psSyncRecordRemoveByHandleOUT->eError != PVRSRV_ERROR_RETRY)) + { + PVR_ASSERT(0); + goto SyncRecordRemoveByHandle_exit; + } + + + +SyncRecordRemoveByHandle_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeSyncRecordAdd(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_SYNCRECORDADD *psSyncRecordAddIN, + PVRSRV_BRIDGE_OUT_SYNCRECORDADD *psSyncRecordAddOUT, + CONNECTION_DATA *psConnection) +{ + SYNC_RECORD_HANDLE pshRecordInt = IMG_NULL; + SYNC_PRIMITIVE_BLOCK * pshServerSyncPrimBlockInt = IMG_NULL; + IMG_CHAR *uiClassNameInt = IMG_NULL; + + + + + if (psSyncRecordAddIN->ui32ClassNameSize != 0) + { + uiClassNameInt = OSAllocMem(psSyncRecordAddIN->ui32ClassNameSize * sizeof(IMG_CHAR)); + if (!uiClassNameInt) + { + psSyncRecordAddOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto SyncRecordAdd_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psSyncRecordAddIN->puiClassName, psSyncRecordAddIN->ui32ClassNameSize * sizeof(IMG_CHAR)) + || (OSCopyFromUser(NULL, uiClassNameInt, psSyncRecordAddIN->puiClassName, + psSyncRecordAddIN->ui32ClassNameSize * sizeof(IMG_CHAR)) != PVRSRV_OK) ) + { + psSyncRecordAddOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto SyncRecordAdd_exit; + } + + + + { + /* Look up the address from the handle */ + psSyncRecordAddOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &pshServerSyncPrimBlockInt, + psSyncRecordAddIN->hhServerSyncPrimBlock, + PVRSRV_HANDLE_TYPE_SYNC_PRIMITIVE_BLOCK); + if(psSyncRecordAddOUT->eError != PVRSRV_OK) + { + goto SyncRecordAdd_exit; + } + } + + + psSyncRecordAddOUT->eError = + PVRSRVSyncRecordAddKM( + &pshRecordInt, + pshServerSyncPrimBlockInt, + psSyncRecordAddIN->ui32ui32FwBlockAddr, + psSyncRecordAddIN->ui32ui32SyncOffset, + psSyncRecordAddIN->bbServerSync, + psSyncRecordAddIN->ui32ClassNameSize, + uiClassNameInt); + /* Exit early if bridged call fails */ + if(psSyncRecordAddOUT->eError != PVRSRV_OK) + { + goto SyncRecordAdd_exit; + } + + + psSyncRecordAddOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psSyncRecordAddOUT->hhRecord, + (IMG_VOID *) pshRecordInt, + PVRSRV_HANDLE_TYPE_SYNC_RECORD_HANDLE, + PVRSRV_HANDLE_ALLOC_FLAG_NONE + ,(PFN_HANDLE_RELEASE)&PVRSRVSyncRecordRemoveByHandleKM); + if (psSyncRecordAddOUT->eError != PVRSRV_OK) + { + goto SyncRecordAdd_exit; + } + + + + +SyncRecordAdd_exit: + if (psSyncRecordAddOUT->eError != PVRSRV_OK) + { + if (pshRecordInt) + { + PVRSRVSyncRecordRemoveByHandleKM(pshRecordInt); + } + } + + if (uiClassNameInt) + OSFreeMem(uiClassNameInt); + + return 0; +} + +static IMG_INT +PVRSRVBridgeServerSyncAlloc(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_SERVERSYNCALLOC *psServerSyncAllocIN, + PVRSRV_BRIDGE_OUT_SERVERSYNCALLOC *psServerSyncAllocOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevNodeInt = IMG_NULL; + SERVER_SYNC_PRIMITIVE * psSyncHandleInt = IMG_NULL; + IMG_CHAR *uiClassNameInt = IMG_NULL; + + + + + if (psServerSyncAllocIN->ui32ClassNameSize != 0) + { + uiClassNameInt = OSAllocMem(psServerSyncAllocIN->ui32ClassNameSize * sizeof(IMG_CHAR)); + if (!uiClassNameInt) + { + psServerSyncAllocOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto ServerSyncAlloc_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psServerSyncAllocIN->puiClassName, psServerSyncAllocIN->ui32ClassNameSize * sizeof(IMG_CHAR)) + || (OSCopyFromUser(NULL, uiClassNameInt, psServerSyncAllocIN->puiClassName, + psServerSyncAllocIN->ui32ClassNameSize * sizeof(IMG_CHAR)) != PVRSRV_OK) ) + { + psServerSyncAllocOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto ServerSyncAlloc_exit; + } + + + + { + /* Look up the address from the handle */ + psServerSyncAllocOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &hDevNodeInt, + psServerSyncAllocIN->hDevNode, + PVRSRV_HANDLE_TYPE_DEV_NODE); + if(psServerSyncAllocOUT->eError != PVRSRV_OK) + { + goto ServerSyncAlloc_exit; + } + } + + + psServerSyncAllocOUT->eError = + PVRSRVServerSyncAllocKM( + hDevNodeInt, + &psSyncHandleInt, + &psServerSyncAllocOUT->ui32SyncPrimVAddr, + psServerSyncAllocIN->ui32ClassNameSize, + uiClassNameInt); + /* Exit early if bridged call fails */ + if(psServerSyncAllocOUT->eError != PVRSRV_OK) + { + goto ServerSyncAlloc_exit; + } + + + psServerSyncAllocOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psServerSyncAllocOUT->hSyncHandle, + (IMG_VOID *) psSyncHandleInt, + PVRSRV_HANDLE_TYPE_SERVER_SYNC_PRIMITIVE, + PVRSRV_HANDLE_ALLOC_FLAG_MULTI + ,(PFN_HANDLE_RELEASE)&PVRSRVServerSyncFreeKM); + if (psServerSyncAllocOUT->eError != PVRSRV_OK) + { + goto ServerSyncAlloc_exit; + } + + + + +ServerSyncAlloc_exit: + if (psServerSyncAllocOUT->eError != PVRSRV_OK) + { + if (psSyncHandleInt) + { + PVRSRVServerSyncFreeKM(psSyncHandleInt); + } + } + + if (uiClassNameInt) + OSFreeMem(uiClassNameInt); + + return 0; +} + +static IMG_INT +PVRSRVBridgeServerSyncFree(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_SERVERSYNCFREE *psServerSyncFreeIN, + PVRSRV_BRIDGE_OUT_SERVERSYNCFREE *psServerSyncFreeOUT, + CONNECTION_DATA *psConnection) +{ + + + + + + + + + + psServerSyncFreeOUT->eError = + PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psServerSyncFreeIN->hSyncHandle, + PVRSRV_HANDLE_TYPE_SERVER_SYNC_PRIMITIVE); + if ((psServerSyncFreeOUT->eError != PVRSRV_OK) && (psServerSyncFreeOUT->eError != PVRSRV_ERROR_RETRY)) + { + PVR_ASSERT(0); + goto ServerSyncFree_exit; + } + + + +ServerSyncFree_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeServerSyncQueueHWOp(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_SERVERSYNCQUEUEHWOP *psServerSyncQueueHWOpIN, + PVRSRV_BRIDGE_OUT_SERVERSYNCQUEUEHWOP *psServerSyncQueueHWOpOUT, + CONNECTION_DATA *psConnection) +{ + SERVER_SYNC_PRIMITIVE * psSyncHandleInt = IMG_NULL; + + + + + + + + { + /* Look up the address from the handle */ + psServerSyncQueueHWOpOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psSyncHandleInt, + psServerSyncQueueHWOpIN->hSyncHandle, + PVRSRV_HANDLE_TYPE_SERVER_SYNC_PRIMITIVE); + if(psServerSyncQueueHWOpOUT->eError != PVRSRV_OK) + { + goto ServerSyncQueueHWOp_exit; + } + } + + + psServerSyncQueueHWOpOUT->eError = + PVRSRVServerSyncQueueHWOpKM( + psSyncHandleInt, + psServerSyncQueueHWOpIN->bbUpdate, + &psServerSyncQueueHWOpOUT->ui32FenceValue, + &psServerSyncQueueHWOpOUT->ui32UpdateValue); + + + + +ServerSyncQueueHWOp_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeServerSyncGetStatus(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_SERVERSYNCGETSTATUS *psServerSyncGetStatusIN, + PVRSRV_BRIDGE_OUT_SERVERSYNCGETSTATUS *psServerSyncGetStatusOUT, + CONNECTION_DATA *psConnection) +{ + SERVER_SYNC_PRIMITIVE * *psSyncHandleInt = IMG_NULL; + IMG_HANDLE *hSyncHandleInt2 = IMG_NULL; + IMG_UINT32 *pui32UIDInt = IMG_NULL; + IMG_UINT32 *pui32FWAddrInt = IMG_NULL; + IMG_UINT32 *pui32CurrentOpInt = IMG_NULL; + IMG_UINT32 *pui32NextOpInt = IMG_NULL; + + + psServerSyncGetStatusOUT->pui32UID = psServerSyncGetStatusIN->pui32UID; + psServerSyncGetStatusOUT->pui32FWAddr = psServerSyncGetStatusIN->pui32FWAddr; + psServerSyncGetStatusOUT->pui32CurrentOp = psServerSyncGetStatusIN->pui32CurrentOp; + psServerSyncGetStatusOUT->pui32NextOp = psServerSyncGetStatusIN->pui32NextOp; + + + if (psServerSyncGetStatusIN->ui32SyncCount != 0) + { + psSyncHandleInt = OSAllocMem(psServerSyncGetStatusIN->ui32SyncCount * sizeof(SERVER_SYNC_PRIMITIVE *)); + if (!psSyncHandleInt) + { + psServerSyncGetStatusOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto ServerSyncGetStatus_exit; + } + hSyncHandleInt2 = OSAllocMem(psServerSyncGetStatusIN->ui32SyncCount * sizeof(IMG_HANDLE)); + if (!hSyncHandleInt2) + { + psServerSyncGetStatusOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto ServerSyncGetStatus_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psServerSyncGetStatusIN->phSyncHandle, psServerSyncGetStatusIN->ui32SyncCount * sizeof(IMG_HANDLE)) + || (OSCopyFromUser(NULL, hSyncHandleInt2, psServerSyncGetStatusIN->phSyncHandle, + psServerSyncGetStatusIN->ui32SyncCount * sizeof(IMG_HANDLE)) != PVRSRV_OK) ) + { + psServerSyncGetStatusOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto ServerSyncGetStatus_exit; + } + if (psServerSyncGetStatusIN->ui32SyncCount != 0) + { + pui32UIDInt = OSAllocMem(psServerSyncGetStatusIN->ui32SyncCount * sizeof(IMG_UINT32)); + if (!pui32UIDInt) + { + psServerSyncGetStatusOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto ServerSyncGetStatus_exit; + } + } + + if (psServerSyncGetStatusIN->ui32SyncCount != 0) + { + pui32FWAddrInt = OSAllocMem(psServerSyncGetStatusIN->ui32SyncCount * sizeof(IMG_UINT32)); + if (!pui32FWAddrInt) + { + psServerSyncGetStatusOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto ServerSyncGetStatus_exit; + } + } + + if (psServerSyncGetStatusIN->ui32SyncCount != 0) + { + pui32CurrentOpInt = OSAllocMem(psServerSyncGetStatusIN->ui32SyncCount * sizeof(IMG_UINT32)); + if (!pui32CurrentOpInt) + { + psServerSyncGetStatusOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto ServerSyncGetStatus_exit; + } + } + + if (psServerSyncGetStatusIN->ui32SyncCount != 0) + { + pui32NextOpInt = OSAllocMem(psServerSyncGetStatusIN->ui32SyncCount * sizeof(IMG_UINT32)); + if (!pui32NextOpInt) + { + psServerSyncGetStatusOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto ServerSyncGetStatus_exit; + } + } + + + + + { + IMG_UINT32 i; + + for (i=0;iui32SyncCount;i++) + { + { + /* Look up the address from the handle */ + psServerSyncGetStatusOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psSyncHandleInt[i], + hSyncHandleInt2[i], + PVRSRV_HANDLE_TYPE_SERVER_SYNC_PRIMITIVE); + if(psServerSyncGetStatusOUT->eError != PVRSRV_OK) + { + goto ServerSyncGetStatus_exit; + } + } + + } + } + + psServerSyncGetStatusOUT->eError = + PVRSRVServerSyncGetStatusKM( + psServerSyncGetStatusIN->ui32SyncCount, + psSyncHandleInt, + pui32UIDInt, + pui32FWAddrInt, + pui32CurrentOpInt, + pui32NextOpInt); + + + + if ( !OSAccessOK(PVR_VERIFY_WRITE, (IMG_VOID*) psServerSyncGetStatusOUT->pui32UID, (psServerSyncGetStatusIN->ui32SyncCount * sizeof(IMG_UINT32))) + || (OSCopyToUser(NULL, psServerSyncGetStatusOUT->pui32UID, pui32UIDInt, + (psServerSyncGetStatusIN->ui32SyncCount * sizeof(IMG_UINT32))) != PVRSRV_OK) ) + { + psServerSyncGetStatusOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto ServerSyncGetStatus_exit; + } + + if ( !OSAccessOK(PVR_VERIFY_WRITE, (IMG_VOID*) psServerSyncGetStatusOUT->pui32FWAddr, (psServerSyncGetStatusIN->ui32SyncCount * sizeof(IMG_UINT32))) + || (OSCopyToUser(NULL, psServerSyncGetStatusOUT->pui32FWAddr, pui32FWAddrInt, + (psServerSyncGetStatusIN->ui32SyncCount * sizeof(IMG_UINT32))) != PVRSRV_OK) ) + { + psServerSyncGetStatusOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto ServerSyncGetStatus_exit; + } + + if ( !OSAccessOK(PVR_VERIFY_WRITE, (IMG_VOID*) psServerSyncGetStatusOUT->pui32CurrentOp, (psServerSyncGetStatusIN->ui32SyncCount * sizeof(IMG_UINT32))) + || (OSCopyToUser(NULL, psServerSyncGetStatusOUT->pui32CurrentOp, pui32CurrentOpInt, + (psServerSyncGetStatusIN->ui32SyncCount * sizeof(IMG_UINT32))) != PVRSRV_OK) ) + { + psServerSyncGetStatusOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto ServerSyncGetStatus_exit; + } + + if ( !OSAccessOK(PVR_VERIFY_WRITE, (IMG_VOID*) psServerSyncGetStatusOUT->pui32NextOp, (psServerSyncGetStatusIN->ui32SyncCount * sizeof(IMG_UINT32))) + || (OSCopyToUser(NULL, psServerSyncGetStatusOUT->pui32NextOp, pui32NextOpInt, + (psServerSyncGetStatusIN->ui32SyncCount * sizeof(IMG_UINT32))) != PVRSRV_OK) ) + { + psServerSyncGetStatusOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto ServerSyncGetStatus_exit; + } + + +ServerSyncGetStatus_exit: + if (psSyncHandleInt) + OSFreeMem(psSyncHandleInt); + if (hSyncHandleInt2) + OSFreeMem(hSyncHandleInt2); + if (pui32UIDInt) + OSFreeMem(pui32UIDInt); + if (pui32FWAddrInt) + OSFreeMem(pui32FWAddrInt); + if (pui32CurrentOpInt) + OSFreeMem(pui32CurrentOpInt); + if (pui32NextOpInt) + OSFreeMem(pui32NextOpInt); + + return 0; +} + +static IMG_INT +PVRSRVBridgeSyncPrimOpCreate(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_SYNCPRIMOPCREATE *psSyncPrimOpCreateIN, + PVRSRV_BRIDGE_OUT_SYNCPRIMOPCREATE *psSyncPrimOpCreateOUT, + CONNECTION_DATA *psConnection) +{ + SYNC_PRIMITIVE_BLOCK * *psBlockListInt = IMG_NULL; + IMG_HANDLE *hBlockListInt2 = IMG_NULL; + IMG_UINT32 *ui32SyncBlockIndexInt = IMG_NULL; + IMG_UINT32 *ui32IndexInt = IMG_NULL; + SERVER_SYNC_PRIMITIVE * *psServerSyncInt = IMG_NULL; + IMG_HANDLE *hServerSyncInt2 = IMG_NULL; + SERVER_OP_COOKIE * psServerCookieInt = IMG_NULL; + + + + + if (psSyncPrimOpCreateIN->ui32SyncBlockCount != 0) + { + psBlockListInt = OSAllocMem(psSyncPrimOpCreateIN->ui32SyncBlockCount * sizeof(SYNC_PRIMITIVE_BLOCK *)); + if (!psBlockListInt) + { + psSyncPrimOpCreateOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto SyncPrimOpCreate_exit; + } + hBlockListInt2 = OSAllocMem(psSyncPrimOpCreateIN->ui32SyncBlockCount * sizeof(IMG_HANDLE)); + if (!hBlockListInt2) + { + psSyncPrimOpCreateOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto SyncPrimOpCreate_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psSyncPrimOpCreateIN->phBlockList, psSyncPrimOpCreateIN->ui32SyncBlockCount * sizeof(IMG_HANDLE)) + || (OSCopyFromUser(NULL, hBlockListInt2, psSyncPrimOpCreateIN->phBlockList, + psSyncPrimOpCreateIN->ui32SyncBlockCount * sizeof(IMG_HANDLE)) != PVRSRV_OK) ) + { + psSyncPrimOpCreateOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto SyncPrimOpCreate_exit; + } + if (psSyncPrimOpCreateIN->ui32ClientSyncCount != 0) + { + ui32SyncBlockIndexInt = OSAllocMem(psSyncPrimOpCreateIN->ui32ClientSyncCount * sizeof(IMG_UINT32)); + if (!ui32SyncBlockIndexInt) + { + psSyncPrimOpCreateOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto SyncPrimOpCreate_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psSyncPrimOpCreateIN->pui32SyncBlockIndex, psSyncPrimOpCreateIN->ui32ClientSyncCount * sizeof(IMG_UINT32)) + || (OSCopyFromUser(NULL, ui32SyncBlockIndexInt, psSyncPrimOpCreateIN->pui32SyncBlockIndex, + psSyncPrimOpCreateIN->ui32ClientSyncCount * sizeof(IMG_UINT32)) != PVRSRV_OK) ) + { + psSyncPrimOpCreateOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto SyncPrimOpCreate_exit; + } + if (psSyncPrimOpCreateIN->ui32ClientSyncCount != 0) + { + ui32IndexInt = OSAllocMem(psSyncPrimOpCreateIN->ui32ClientSyncCount * sizeof(IMG_UINT32)); + if (!ui32IndexInt) + { + psSyncPrimOpCreateOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto SyncPrimOpCreate_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psSyncPrimOpCreateIN->pui32Index, psSyncPrimOpCreateIN->ui32ClientSyncCount * sizeof(IMG_UINT32)) + || (OSCopyFromUser(NULL, ui32IndexInt, psSyncPrimOpCreateIN->pui32Index, + psSyncPrimOpCreateIN->ui32ClientSyncCount * sizeof(IMG_UINT32)) != PVRSRV_OK) ) + { + psSyncPrimOpCreateOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto SyncPrimOpCreate_exit; + } + if (psSyncPrimOpCreateIN->ui32ServerSyncCount != 0) + { + psServerSyncInt = OSAllocMem(psSyncPrimOpCreateIN->ui32ServerSyncCount * sizeof(SERVER_SYNC_PRIMITIVE *)); + if (!psServerSyncInt) + { + psSyncPrimOpCreateOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto SyncPrimOpCreate_exit; + } + hServerSyncInt2 = OSAllocMem(psSyncPrimOpCreateIN->ui32ServerSyncCount * sizeof(IMG_HANDLE)); + if (!hServerSyncInt2) + { + psSyncPrimOpCreateOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto SyncPrimOpCreate_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psSyncPrimOpCreateIN->phServerSync, psSyncPrimOpCreateIN->ui32ServerSyncCount * sizeof(IMG_HANDLE)) + || (OSCopyFromUser(NULL, hServerSyncInt2, psSyncPrimOpCreateIN->phServerSync, + psSyncPrimOpCreateIN->ui32ServerSyncCount * sizeof(IMG_HANDLE)) != PVRSRV_OK) ) + { + psSyncPrimOpCreateOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto SyncPrimOpCreate_exit; + } + + + + { + IMG_UINT32 i; + + for (i=0;iui32SyncBlockCount;i++) + { + { + /* Look up the address from the handle */ + psSyncPrimOpCreateOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psBlockListInt[i], + hBlockListInt2[i], + PVRSRV_HANDLE_TYPE_SYNC_PRIMITIVE_BLOCK); + if(psSyncPrimOpCreateOUT->eError != PVRSRV_OK) + { + goto SyncPrimOpCreate_exit; + } + } + + } + } + + { + IMG_UINT32 i; + + for (i=0;iui32ServerSyncCount;i++) + { + { + /* Look up the address from the handle */ + psSyncPrimOpCreateOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psServerSyncInt[i], + hServerSyncInt2[i], + PVRSRV_HANDLE_TYPE_SERVER_SYNC_PRIMITIVE); + if(psSyncPrimOpCreateOUT->eError != PVRSRV_OK) + { + goto SyncPrimOpCreate_exit; + } + } + + } + } + + psSyncPrimOpCreateOUT->eError = + PVRSRVSyncPrimOpCreateKM( + psSyncPrimOpCreateIN->ui32SyncBlockCount, + psBlockListInt, + psSyncPrimOpCreateIN->ui32ClientSyncCount, + ui32SyncBlockIndexInt, + ui32IndexInt, + psSyncPrimOpCreateIN->ui32ServerSyncCount, + psServerSyncInt, + &psServerCookieInt); + /* Exit early if bridged call fails */ + if(psSyncPrimOpCreateOUT->eError != PVRSRV_OK) + { + goto SyncPrimOpCreate_exit; + } + + + psSyncPrimOpCreateOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psSyncPrimOpCreateOUT->hServerCookie, + (IMG_VOID *) psServerCookieInt, + PVRSRV_HANDLE_TYPE_SERVER_OP_COOKIE, + PVRSRV_HANDLE_ALLOC_FLAG_MULTI + ,(PFN_HANDLE_RELEASE)&PVRSRVSyncPrimOpDestroyKM); + if (psSyncPrimOpCreateOUT->eError != PVRSRV_OK) + { + goto SyncPrimOpCreate_exit; + } + + + + +SyncPrimOpCreate_exit: + if (psSyncPrimOpCreateOUT->eError != PVRSRV_OK) + { + if (psServerCookieInt) + { + PVRSRVSyncPrimOpDestroyKM(psServerCookieInt); + } + } + + if (psBlockListInt) + OSFreeMem(psBlockListInt); + if (hBlockListInt2) + OSFreeMem(hBlockListInt2); + if (ui32SyncBlockIndexInt) + OSFreeMem(ui32SyncBlockIndexInt); + if (ui32IndexInt) + OSFreeMem(ui32IndexInt); + if (psServerSyncInt) + OSFreeMem(psServerSyncInt); + if (hServerSyncInt2) + OSFreeMem(hServerSyncInt2); + + return 0; +} + +static IMG_INT +PVRSRVBridgeSyncPrimOpTake(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_SYNCPRIMOPTAKE *psSyncPrimOpTakeIN, + PVRSRV_BRIDGE_OUT_SYNCPRIMOPTAKE *psSyncPrimOpTakeOUT, + CONNECTION_DATA *psConnection) +{ + SERVER_OP_COOKIE * psServerCookieInt = IMG_NULL; + IMG_UINT32 *ui32FlagsInt = IMG_NULL; + IMG_UINT32 *ui32FenceValueInt = IMG_NULL; + IMG_UINT32 *ui32UpdateValueInt = IMG_NULL; + IMG_UINT32 *ui32ServerFlagsInt = IMG_NULL; + + + + + if (psSyncPrimOpTakeIN->ui32ClientSyncCount != 0) + { + ui32FlagsInt = OSAllocMem(psSyncPrimOpTakeIN->ui32ClientSyncCount * sizeof(IMG_UINT32)); + if (!ui32FlagsInt) + { + psSyncPrimOpTakeOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto SyncPrimOpTake_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psSyncPrimOpTakeIN->pui32Flags, psSyncPrimOpTakeIN->ui32ClientSyncCount * sizeof(IMG_UINT32)) + || (OSCopyFromUser(NULL, ui32FlagsInt, psSyncPrimOpTakeIN->pui32Flags, + psSyncPrimOpTakeIN->ui32ClientSyncCount * sizeof(IMG_UINT32)) != PVRSRV_OK) ) + { + psSyncPrimOpTakeOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto SyncPrimOpTake_exit; + } + if (psSyncPrimOpTakeIN->ui32ClientSyncCount != 0) + { + ui32FenceValueInt = OSAllocMem(psSyncPrimOpTakeIN->ui32ClientSyncCount * sizeof(IMG_UINT32)); + if (!ui32FenceValueInt) + { + psSyncPrimOpTakeOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto SyncPrimOpTake_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psSyncPrimOpTakeIN->pui32FenceValue, psSyncPrimOpTakeIN->ui32ClientSyncCount * sizeof(IMG_UINT32)) + || (OSCopyFromUser(NULL, ui32FenceValueInt, psSyncPrimOpTakeIN->pui32FenceValue, + psSyncPrimOpTakeIN->ui32ClientSyncCount * sizeof(IMG_UINT32)) != PVRSRV_OK) ) + { + psSyncPrimOpTakeOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto SyncPrimOpTake_exit; + } + if (psSyncPrimOpTakeIN->ui32ClientSyncCount != 0) + { + ui32UpdateValueInt = OSAllocMem(psSyncPrimOpTakeIN->ui32ClientSyncCount * sizeof(IMG_UINT32)); + if (!ui32UpdateValueInt) + { + psSyncPrimOpTakeOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto SyncPrimOpTake_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psSyncPrimOpTakeIN->pui32UpdateValue, psSyncPrimOpTakeIN->ui32ClientSyncCount * sizeof(IMG_UINT32)) + || (OSCopyFromUser(NULL, ui32UpdateValueInt, psSyncPrimOpTakeIN->pui32UpdateValue, + psSyncPrimOpTakeIN->ui32ClientSyncCount * sizeof(IMG_UINT32)) != PVRSRV_OK) ) + { + psSyncPrimOpTakeOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto SyncPrimOpTake_exit; + } + if (psSyncPrimOpTakeIN->ui32ServerSyncCount != 0) + { + ui32ServerFlagsInt = OSAllocMem(psSyncPrimOpTakeIN->ui32ServerSyncCount * sizeof(IMG_UINT32)); + if (!ui32ServerFlagsInt) + { + psSyncPrimOpTakeOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto SyncPrimOpTake_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psSyncPrimOpTakeIN->pui32ServerFlags, psSyncPrimOpTakeIN->ui32ServerSyncCount * sizeof(IMG_UINT32)) + || (OSCopyFromUser(NULL, ui32ServerFlagsInt, psSyncPrimOpTakeIN->pui32ServerFlags, + psSyncPrimOpTakeIN->ui32ServerSyncCount * sizeof(IMG_UINT32)) != PVRSRV_OK) ) + { + psSyncPrimOpTakeOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto SyncPrimOpTake_exit; + } + + + + { + /* Look up the address from the handle */ + psSyncPrimOpTakeOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psServerCookieInt, + psSyncPrimOpTakeIN->hServerCookie, + PVRSRV_HANDLE_TYPE_SERVER_OP_COOKIE); + if(psSyncPrimOpTakeOUT->eError != PVRSRV_OK) + { + goto SyncPrimOpTake_exit; + } + } + + + psSyncPrimOpTakeOUT->eError = + PVRSRVSyncPrimOpTakeKM( + psServerCookieInt, + psSyncPrimOpTakeIN->ui32ClientSyncCount, + ui32FlagsInt, + ui32FenceValueInt, + ui32UpdateValueInt, + psSyncPrimOpTakeIN->ui32ServerSyncCount, + ui32ServerFlagsInt); + + + + +SyncPrimOpTake_exit: + if (ui32FlagsInt) + OSFreeMem(ui32FlagsInt); + if (ui32FenceValueInt) + OSFreeMem(ui32FenceValueInt); + if (ui32UpdateValueInt) + OSFreeMem(ui32UpdateValueInt); + if (ui32ServerFlagsInt) + OSFreeMem(ui32ServerFlagsInt); + + return 0; +} + +static IMG_INT +PVRSRVBridgeSyncPrimOpReady(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_SYNCPRIMOPREADY *psSyncPrimOpReadyIN, + PVRSRV_BRIDGE_OUT_SYNCPRIMOPREADY *psSyncPrimOpReadyOUT, + CONNECTION_DATA *psConnection) +{ + SERVER_OP_COOKIE * psServerCookieInt = IMG_NULL; + + + + + + + + { + /* Look up the address from the handle */ + psSyncPrimOpReadyOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psServerCookieInt, + psSyncPrimOpReadyIN->hServerCookie, + PVRSRV_HANDLE_TYPE_SERVER_OP_COOKIE); + if(psSyncPrimOpReadyOUT->eError != PVRSRV_OK) + { + goto SyncPrimOpReady_exit; + } + } + + + psSyncPrimOpReadyOUT->eError = + PVRSRVSyncPrimOpReadyKM( + psServerCookieInt, + &psSyncPrimOpReadyOUT->bReady); + + + + +SyncPrimOpReady_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeSyncPrimOpComplete(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_SYNCPRIMOPCOMPLETE *psSyncPrimOpCompleteIN, + PVRSRV_BRIDGE_OUT_SYNCPRIMOPCOMPLETE *psSyncPrimOpCompleteOUT, + CONNECTION_DATA *psConnection) +{ + SERVER_OP_COOKIE * psServerCookieInt = IMG_NULL; + + + + + + + + { + /* Look up the address from the handle */ + psSyncPrimOpCompleteOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psServerCookieInt, + psSyncPrimOpCompleteIN->hServerCookie, + PVRSRV_HANDLE_TYPE_SERVER_OP_COOKIE); + if(psSyncPrimOpCompleteOUT->eError != PVRSRV_OK) + { + goto SyncPrimOpComplete_exit; + } + } + + + psSyncPrimOpCompleteOUT->eError = + PVRSRVSyncPrimOpCompleteKM( + psServerCookieInt); + + + + +SyncPrimOpComplete_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeSyncPrimOpDestroy(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_SYNCPRIMOPDESTROY *psSyncPrimOpDestroyIN, + PVRSRV_BRIDGE_OUT_SYNCPRIMOPDESTROY *psSyncPrimOpDestroyOUT, + CONNECTION_DATA *psConnection) +{ + + + + + + + + + + psSyncPrimOpDestroyOUT->eError = + PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psSyncPrimOpDestroyIN->hServerCookie, + PVRSRV_HANDLE_TYPE_SERVER_OP_COOKIE); + if ((psSyncPrimOpDestroyOUT->eError != PVRSRV_OK) && (psSyncPrimOpDestroyOUT->eError != PVRSRV_ERROR_RETRY)) + { + PVR_ASSERT(0); + goto SyncPrimOpDestroy_exit; + } + + + +SyncPrimOpDestroy_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeSyncPrimPDump(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_SYNCPRIMPDUMP *psSyncPrimPDumpIN, + PVRSRV_BRIDGE_OUT_SYNCPRIMPDUMP *psSyncPrimPDumpOUT, + CONNECTION_DATA *psConnection) +{ + SYNC_PRIMITIVE_BLOCK * psSyncHandleInt = IMG_NULL; + + + + + + + + { + /* Look up the address from the handle */ + psSyncPrimPDumpOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psSyncHandleInt, + psSyncPrimPDumpIN->hSyncHandle, + PVRSRV_HANDLE_TYPE_SYNC_PRIMITIVE_BLOCK); + if(psSyncPrimPDumpOUT->eError != PVRSRV_OK) + { + goto SyncPrimPDump_exit; + } + } + + + psSyncPrimPDumpOUT->eError = + PVRSRVSyncPrimPDumpKM( + psSyncHandleInt, + psSyncPrimPDumpIN->ui32Offset); + + + + +SyncPrimPDump_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeSyncPrimPDumpValue(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_SYNCPRIMPDUMPVALUE *psSyncPrimPDumpValueIN, + PVRSRV_BRIDGE_OUT_SYNCPRIMPDUMPVALUE *psSyncPrimPDumpValueOUT, + CONNECTION_DATA *psConnection) +{ + SYNC_PRIMITIVE_BLOCK * psSyncHandleInt = IMG_NULL; + + + + + + + + { + /* Look up the address from the handle */ + psSyncPrimPDumpValueOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psSyncHandleInt, + psSyncPrimPDumpValueIN->hSyncHandle, + PVRSRV_HANDLE_TYPE_SYNC_PRIMITIVE_BLOCK); + if(psSyncPrimPDumpValueOUT->eError != PVRSRV_OK) + { + goto SyncPrimPDumpValue_exit; + } + } + + + psSyncPrimPDumpValueOUT->eError = + PVRSRVSyncPrimPDumpValueKM( + psSyncHandleInt, + psSyncPrimPDumpValueIN->ui32Offset, + psSyncPrimPDumpValueIN->ui32Value); + + + + +SyncPrimPDumpValue_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeSyncPrimPDumpPol(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_SYNCPRIMPDUMPPOL *psSyncPrimPDumpPolIN, + PVRSRV_BRIDGE_OUT_SYNCPRIMPDUMPPOL *psSyncPrimPDumpPolOUT, + CONNECTION_DATA *psConnection) +{ + SYNC_PRIMITIVE_BLOCK * psSyncHandleInt = IMG_NULL; + + + + + + + + { + /* Look up the address from the handle */ + psSyncPrimPDumpPolOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psSyncHandleInt, + psSyncPrimPDumpPolIN->hSyncHandle, + PVRSRV_HANDLE_TYPE_SYNC_PRIMITIVE_BLOCK); + if(psSyncPrimPDumpPolOUT->eError != PVRSRV_OK) + { + goto SyncPrimPDumpPol_exit; + } + } + + + psSyncPrimPDumpPolOUT->eError = + PVRSRVSyncPrimPDumpPolKM( + psSyncHandleInt, + psSyncPrimPDumpPolIN->ui32Offset, + psSyncPrimPDumpPolIN->ui32Value, + psSyncPrimPDumpPolIN->ui32Mask, + psSyncPrimPDumpPolIN->eOperator, + psSyncPrimPDumpPolIN->uiPDumpFlags); + + + + +SyncPrimPDumpPol_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeSyncPrimOpPDumpPol(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_SYNCPRIMOPPDUMPPOL *psSyncPrimOpPDumpPolIN, + PVRSRV_BRIDGE_OUT_SYNCPRIMOPPDUMPPOL *psSyncPrimOpPDumpPolOUT, + CONNECTION_DATA *psConnection) +{ + SERVER_OP_COOKIE * psServerCookieInt = IMG_NULL; + + + + + + + + { + /* Look up the address from the handle */ + psSyncPrimOpPDumpPolOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psServerCookieInt, + psSyncPrimOpPDumpPolIN->hServerCookie, + PVRSRV_HANDLE_TYPE_SERVER_OP_COOKIE); + if(psSyncPrimOpPDumpPolOUT->eError != PVRSRV_OK) + { + goto SyncPrimOpPDumpPol_exit; + } + } + + + psSyncPrimOpPDumpPolOUT->eError = + PVRSRVSyncPrimOpPDumpPolKM( + psServerCookieInt, + psSyncPrimOpPDumpPolIN->eOperator, + psSyncPrimOpPDumpPolIN->uiPDumpFlags); + + + + +SyncPrimOpPDumpPol_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeSyncPrimPDumpCBP(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_SYNCPRIMPDUMPCBP *psSyncPrimPDumpCBPIN, + PVRSRV_BRIDGE_OUT_SYNCPRIMPDUMPCBP *psSyncPrimPDumpCBPOUT, + CONNECTION_DATA *psConnection) +{ + SYNC_PRIMITIVE_BLOCK * psSyncHandleInt = IMG_NULL; + + + + + + + + { + /* Look up the address from the handle */ + psSyncPrimPDumpCBPOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psSyncHandleInt, + psSyncPrimPDumpCBPIN->hSyncHandle, + PVRSRV_HANDLE_TYPE_SYNC_PRIMITIVE_BLOCK); + if(psSyncPrimPDumpCBPOUT->eError != PVRSRV_OK) + { + goto SyncPrimPDumpCBP_exit; + } + } + + + psSyncPrimPDumpCBPOUT->eError = + PVRSRVSyncPrimPDumpCBPKM( + psSyncHandleInt, + psSyncPrimPDumpCBPIN->ui32Offset, + psSyncPrimPDumpCBPIN->uiWriteOffset, + psSyncPrimPDumpCBPIN->uiPacketSize, + psSyncPrimPDumpCBPIN->uiBufferSize); + + + + +SyncPrimPDumpCBP_exit: + + return 0; +} + + + +/* *************************************************************************** + * Server bridge dispatch related glue + */ + + +PVRSRV_ERROR InitSYNCBridge(IMG_VOID); +PVRSRV_ERROR DeinitSYNCBridge(IMG_VOID); + +/* + * Register all SYNC functions with services + */ +PVRSRV_ERROR InitSYNCBridge(IMG_VOID) +{ + + SetDispatchTableEntry(PVRSRV_BRIDGE_SYNC, PVRSRV_BRIDGE_SYNC_ALLOCSYNCPRIMITIVEBLOCK, PVRSRVBridgeAllocSyncPrimitiveBlock, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_SYNC, PVRSRV_BRIDGE_SYNC_FREESYNCPRIMITIVEBLOCK, PVRSRVBridgeFreeSyncPrimitiveBlock, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_SYNC, PVRSRV_BRIDGE_SYNC_SYNCPRIMSET, PVRSRVBridgeSyncPrimSet, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_SYNC, PVRSRV_BRIDGE_SYNC_SERVERSYNCPRIMSET, PVRSRVBridgeServerSyncPrimSet, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_SYNC, PVRSRV_BRIDGE_SYNC_SYNCRECORDREMOVEBYHANDLE, PVRSRVBridgeSyncRecordRemoveByHandle, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_SYNC, PVRSRV_BRIDGE_SYNC_SYNCRECORDADD, PVRSRVBridgeSyncRecordAdd, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_SYNC, PVRSRV_BRIDGE_SYNC_SERVERSYNCALLOC, PVRSRVBridgeServerSyncAlloc, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_SYNC, PVRSRV_BRIDGE_SYNC_SERVERSYNCFREE, PVRSRVBridgeServerSyncFree, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_SYNC, PVRSRV_BRIDGE_SYNC_SERVERSYNCQUEUEHWOP, PVRSRVBridgeServerSyncQueueHWOp, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_SYNC, PVRSRV_BRIDGE_SYNC_SERVERSYNCGETSTATUS, PVRSRVBridgeServerSyncGetStatus, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_SYNC, PVRSRV_BRIDGE_SYNC_SYNCPRIMOPCREATE, PVRSRVBridgeSyncPrimOpCreate, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_SYNC, PVRSRV_BRIDGE_SYNC_SYNCPRIMOPTAKE, PVRSRVBridgeSyncPrimOpTake, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_SYNC, PVRSRV_BRIDGE_SYNC_SYNCPRIMOPREADY, PVRSRVBridgeSyncPrimOpReady, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_SYNC, PVRSRV_BRIDGE_SYNC_SYNCPRIMOPCOMPLETE, PVRSRVBridgeSyncPrimOpComplete, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_SYNC, PVRSRV_BRIDGE_SYNC_SYNCPRIMOPDESTROY, PVRSRVBridgeSyncPrimOpDestroy, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_SYNC, PVRSRV_BRIDGE_SYNC_SYNCPRIMPDUMP, PVRSRVBridgeSyncPrimPDump, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_SYNC, PVRSRV_BRIDGE_SYNC_SYNCPRIMPDUMPVALUE, PVRSRVBridgeSyncPrimPDumpValue, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_SYNC, PVRSRV_BRIDGE_SYNC_SYNCPRIMPDUMPPOL, PVRSRVBridgeSyncPrimPDumpPol, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_SYNC, PVRSRV_BRIDGE_SYNC_SYNCPRIMOPPDUMPPOL, PVRSRVBridgeSyncPrimOpPDumpPol, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_SYNC, PVRSRV_BRIDGE_SYNC_SYNCPRIMPDUMPCBP, PVRSRVBridgeSyncPrimPDumpCBP, + IMG_NULL, IMG_NULL, + 0, 0); + + + return PVRSRV_OK; +} + +/* + * Unregister all sync functions with services + */ +PVRSRV_ERROR DeinitSYNCBridge(IMG_VOID) +{ + return PVRSRV_OK; +} + diff --git a/drivers/gpu/rogue_m/generated/syncsexport_bridge/common_syncsexport_bridge.h b/drivers/gpu/rogue_m/generated/syncsexport_bridge/common_syncsexport_bridge.h new file mode 100644 index 000000000000..978b1436834e --- /dev/null +++ b/drivers/gpu/rogue_m/generated/syncsexport_bridge/common_syncsexport_bridge.h @@ -0,0 +1,114 @@ +/*************************************************************************/ /*! +@File +@Title Common bridge header for syncsexport +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Declares common defines and structures that are used by both + the client and sever side of the bridge for syncsexport +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef COMMON_SYNCSEXPORT_BRIDGE_H +#define COMMON_SYNCSEXPORT_BRIDGE_H + +#include "img_types.h" +#include "pvrsrv_error.h" + + + +#define PVRSRV_BRIDGE_SYNCSEXPORT_CMD_FIRST 0 +#define PVRSRV_BRIDGE_SYNCSEXPORT_SYNCPRIMSERVERSECUREEXPORT PVRSRV_BRIDGE_SYNCSEXPORT_CMD_FIRST+0 +#define PVRSRV_BRIDGE_SYNCSEXPORT_SYNCPRIMSERVERSECUREUNEXPORT PVRSRV_BRIDGE_SYNCSEXPORT_CMD_FIRST+1 +#define PVRSRV_BRIDGE_SYNCSEXPORT_SYNCPRIMSERVERSECUREIMPORT PVRSRV_BRIDGE_SYNCSEXPORT_CMD_FIRST+2 +#define PVRSRV_BRIDGE_SYNCSEXPORT_CMD_LAST (PVRSRV_BRIDGE_SYNCSEXPORT_CMD_FIRST+2) + + +/******************************************* + SyncPrimServerSecureExport + *******************************************/ + +/* Bridge in structure for SyncPrimServerSecureExport */ +typedef struct PVRSRV_BRIDGE_IN_SYNCPRIMSERVERSECUREEXPORT_TAG +{ + IMG_HANDLE hSyncHandle; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_SYNCPRIMSERVERSECUREEXPORT; + + +/* Bridge out structure for SyncPrimServerSecureExport */ +typedef struct PVRSRV_BRIDGE_OUT_SYNCPRIMSERVERSECUREEXPORT_TAG +{ + IMG_SECURE_TYPE Export; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_SYNCPRIMSERVERSECUREEXPORT; + +/******************************************* + SyncPrimServerSecureUnexport + *******************************************/ + +/* Bridge in structure for SyncPrimServerSecureUnexport */ +typedef struct PVRSRV_BRIDGE_IN_SYNCPRIMSERVERSECUREUNEXPORT_TAG +{ + IMG_HANDLE hExport; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_SYNCPRIMSERVERSECUREUNEXPORT; + + +/* Bridge out structure for SyncPrimServerSecureUnexport */ +typedef struct PVRSRV_BRIDGE_OUT_SYNCPRIMSERVERSECUREUNEXPORT_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_SYNCPRIMSERVERSECUREUNEXPORT; + +/******************************************* + SyncPrimServerSecureImport + *******************************************/ + +/* Bridge in structure for SyncPrimServerSecureImport */ +typedef struct PVRSRV_BRIDGE_IN_SYNCPRIMSERVERSECUREIMPORT_TAG +{ + IMG_SECURE_TYPE Export; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_SYNCPRIMSERVERSECUREIMPORT; + + +/* Bridge out structure for SyncPrimServerSecureImport */ +typedef struct PVRSRV_BRIDGE_OUT_SYNCPRIMSERVERSECUREIMPORT_TAG +{ + IMG_HANDLE hSyncHandle; + IMG_UINT32 ui32SyncPrimVAddr; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_SYNCPRIMSERVERSECUREIMPORT; + +#endif /* COMMON_SYNCSEXPORT_BRIDGE_H */ diff --git a/drivers/gpu/rogue_m/generated/syncsexport_bridge/server_syncsexport_bridge.c b/drivers/gpu/rogue_m/generated/syncsexport_bridge/server_syncsexport_bridge.c new file mode 100644 index 000000000000..095cbd71278e --- /dev/null +++ b/drivers/gpu/rogue_m/generated/syncsexport_bridge/server_syncsexport_bridge.c @@ -0,0 +1,269 @@ +/*************************************************************************/ /*! +@File +@Title Server bridge for syncsexport +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Implements the server side of the bridge for syncsexport +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#include +#include + +#include "img_defs.h" + +#include "sync_server.h" + + +#include "common_syncsexport_bridge.h" + +#include "allocmem.h" +#include "pvr_debug.h" +#include "connection_server.h" +#include "pvr_bridge.h" +#include "rgx_bridge.h" +#include "srvcore.h" +#include "handle.h" + +#if defined (SUPPORT_AUTH) +#include "osauth.h" +#endif + +#include + + + + +/* *************************************************************************** + * Server-side bridge entry points + */ + +static IMG_INT +PVRSRVBridgeSyncPrimServerSecureExport(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_SYNCPRIMSERVERSECUREEXPORT *psSyncPrimServerSecureExportIN, + PVRSRV_BRIDGE_OUT_SYNCPRIMSERVERSECUREEXPORT *psSyncPrimServerSecureExportOUT, + CONNECTION_DATA *psConnection) +{ + SERVER_SYNC_PRIMITIVE * psSyncHandleInt = IMG_NULL; + SERVER_SYNC_EXPORT * psExportInt = IMG_NULL; + IMG_HANDLE hExportInt = IMG_NULL; + CONNECTION_DATA *psSecureConnection; + + + + + + + + { + /* Look up the address from the handle */ + psSyncPrimServerSecureExportOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &psSyncHandleInt, + psSyncPrimServerSecureExportIN->hSyncHandle, + PVRSRV_HANDLE_TYPE_SERVER_SYNC_PRIMITIVE); + if(psSyncPrimServerSecureExportOUT->eError != PVRSRV_OK) + { + goto SyncPrimServerSecureExport_exit; + } + } + + + psSyncPrimServerSecureExportOUT->eError = + PVRSRVSyncPrimServerSecureExportKM(psConnection, + psSyncHandleInt, + &psSyncPrimServerSecureExportOUT->Export, + &psExportInt, &psSecureConnection); + /* Exit early if bridged call fails */ + if(psSyncPrimServerSecureExportOUT->eError != PVRSRV_OK) + { + goto SyncPrimServerSecureExport_exit; + } + + + psSyncPrimServerSecureExportOUT->eError = PVRSRVAllocHandle(psSecureConnection->psHandleBase, + &hExportInt, + (IMG_VOID *) psExportInt, + PVRSRV_HANDLE_TYPE_SERVER_SYNC_EXPORT, + PVRSRV_HANDLE_ALLOC_FLAG_SHARED + ,(PFN_HANDLE_RELEASE)&PVRSRVSyncPrimServerSecureUnexportKM); + if (psSyncPrimServerSecureExportOUT->eError != PVRSRV_OK) + { + goto SyncPrimServerSecureExport_exit; + } + + + + +SyncPrimServerSecureExport_exit: + if (psSyncPrimServerSecureExportOUT->eError != PVRSRV_OK) + { + if (psExportInt) + { + PVRSRVSyncPrimServerSecureUnexportKM(psExportInt); + } + } + + + return 0; +} + +static IMG_INT +PVRSRVBridgeSyncPrimServerSecureUnexport(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_SYNCPRIMSERVERSECUREUNEXPORT *psSyncPrimServerSecureUnexportIN, + PVRSRV_BRIDGE_OUT_SYNCPRIMSERVERSECUREUNEXPORT *psSyncPrimServerSecureUnexportOUT, + CONNECTION_DATA *psConnection) +{ + + + + + + + + + + psSyncPrimServerSecureUnexportOUT->eError = + PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psSyncPrimServerSecureUnexportIN->hExport, + PVRSRV_HANDLE_TYPE_SERVER_SYNC_EXPORT); + if ((psSyncPrimServerSecureUnexportOUT->eError != PVRSRV_OK) && (psSyncPrimServerSecureUnexportOUT->eError != PVRSRV_ERROR_RETRY)) + { + PVR_ASSERT(0); + goto SyncPrimServerSecureUnexport_exit; + } + + + +SyncPrimServerSecureUnexport_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeSyncPrimServerSecureImport(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_SYNCPRIMSERVERSECUREIMPORT *psSyncPrimServerSecureImportIN, + PVRSRV_BRIDGE_OUT_SYNCPRIMSERVERSECUREIMPORT *psSyncPrimServerSecureImportOUT, + CONNECTION_DATA *psConnection) +{ + SERVER_SYNC_PRIMITIVE * psSyncHandleInt = IMG_NULL; + + + + + + + + psSyncPrimServerSecureImportOUT->eError = + PVRSRVSyncPrimServerSecureImportKM( + psSyncPrimServerSecureImportIN->Export, + &psSyncHandleInt, + &psSyncPrimServerSecureImportOUT->ui32SyncPrimVAddr); + /* Exit early if bridged call fails */ + if(psSyncPrimServerSecureImportOUT->eError != PVRSRV_OK) + { + goto SyncPrimServerSecureImport_exit; + } + + + psSyncPrimServerSecureImportOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psSyncPrimServerSecureImportOUT->hSyncHandle, + (IMG_VOID *) psSyncHandleInt, + PVRSRV_HANDLE_TYPE_SERVER_SYNC_PRIMITIVE, + PVRSRV_HANDLE_ALLOC_FLAG_MULTI + ,(PFN_HANDLE_RELEASE)&PVRSRVServerSyncFreeKM); + if (psSyncPrimServerSecureImportOUT->eError != PVRSRV_OK) + { + goto SyncPrimServerSecureImport_exit; + } + + + + +SyncPrimServerSecureImport_exit: + if (psSyncPrimServerSecureImportOUT->eError != PVRSRV_OK) + { + if (psSyncHandleInt) + { + PVRSRVServerSyncFreeKM(psSyncHandleInt); + } + } + + + return 0; +} + + + +/* *************************************************************************** + * Server bridge dispatch related glue + */ + + +PVRSRV_ERROR InitSYNCSEXPORTBridge(IMG_VOID); +PVRSRV_ERROR DeinitSYNCSEXPORTBridge(IMG_VOID); + +/* + * Register all SYNCSEXPORT functions with services + */ +PVRSRV_ERROR InitSYNCSEXPORTBridge(IMG_VOID) +{ + + SetDispatchTableEntry(PVRSRV_BRIDGE_SYNCSEXPORT, PVRSRV_BRIDGE_SYNCSEXPORT_SYNCPRIMSERVERSECUREEXPORT, PVRSRVBridgeSyncPrimServerSecureExport, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_SYNCSEXPORT, PVRSRV_BRIDGE_SYNCSEXPORT_SYNCPRIMSERVERSECUREUNEXPORT, PVRSRVBridgeSyncPrimServerSecureUnexport, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_SYNCSEXPORT, PVRSRV_BRIDGE_SYNCSEXPORT_SYNCPRIMSERVERSECUREIMPORT, PVRSRVBridgeSyncPrimServerSecureImport, + IMG_NULL, IMG_NULL, + 0, 0); + + + return PVRSRV_OK; +} + +/* + * Unregister all syncsexport functions with services + */ +PVRSRV_ERROR DeinitSYNCSEXPORTBridge(IMG_VOID) +{ + return PVRSRV_OK; +} + diff --git a/drivers/gpu/rogue_m/generated/timerquery_bridge/common_timerquery_bridge.h b/drivers/gpu/rogue_m/generated/timerquery_bridge/common_timerquery_bridge.h new file mode 100644 index 000000000000..ffd457ae832e --- /dev/null +++ b/drivers/gpu/rogue_m/generated/timerquery_bridge/common_timerquery_bridge.h @@ -0,0 +1,135 @@ +/*************************************************************************/ /*! +@File +@Title Common bridge header for timerquery +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Declares common defines and structures that are used by both + the client and sever side of the bridge for timerquery +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef COMMON_TIMERQUERY_BRIDGE_H +#define COMMON_TIMERQUERY_BRIDGE_H + +#include "img_types.h" +#include "pvrsrv_error.h" + +#include "rgx_bridge.h" + + +#define PVRSRV_BRIDGE_TIMERQUERY_CMD_FIRST 0 +#define PVRSRV_BRIDGE_TIMERQUERY_RGXBEGINTIMERQUERY PVRSRV_BRIDGE_TIMERQUERY_CMD_FIRST+0 +#define PVRSRV_BRIDGE_TIMERQUERY_RGXENDTIMERQUERY PVRSRV_BRIDGE_TIMERQUERY_CMD_FIRST+1 +#define PVRSRV_BRIDGE_TIMERQUERY_RGXQUERYTIMER PVRSRV_BRIDGE_TIMERQUERY_CMD_FIRST+2 +#define PVRSRV_BRIDGE_TIMERQUERY_RGXCURRENTTIME PVRSRV_BRIDGE_TIMERQUERY_CMD_FIRST+3 +#define PVRSRV_BRIDGE_TIMERQUERY_CMD_LAST (PVRSRV_BRIDGE_TIMERQUERY_CMD_FIRST+3) + + +/******************************************* + RGXBeginTimerQuery + *******************************************/ + +/* Bridge in structure for RGXBeginTimerQuery */ +typedef struct PVRSRV_BRIDGE_IN_RGXBEGINTIMERQUERY_TAG +{ + IMG_HANDLE hDevNode; + IMG_UINT32 ui32QueryId; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXBEGINTIMERQUERY; + + +/* Bridge out structure for RGXBeginTimerQuery */ +typedef struct PVRSRV_BRIDGE_OUT_RGXBEGINTIMERQUERY_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXBEGINTIMERQUERY; + +/******************************************* + RGXEndTimerQuery + *******************************************/ + +/* Bridge in structure for RGXEndTimerQuery */ +typedef struct PVRSRV_BRIDGE_IN_RGXENDTIMERQUERY_TAG +{ + IMG_HANDLE hDevNode; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXENDTIMERQUERY; + + +/* Bridge out structure for RGXEndTimerQuery */ +typedef struct PVRSRV_BRIDGE_OUT_RGXENDTIMERQUERY_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXENDTIMERQUERY; + +/******************************************* + RGXQueryTimer + *******************************************/ + +/* Bridge in structure for RGXQueryTimer */ +typedef struct PVRSRV_BRIDGE_IN_RGXQUERYTIMER_TAG +{ + IMG_HANDLE hDevNode; + IMG_UINT32 ui32QueryId; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXQUERYTIMER; + + +/* Bridge out structure for RGXQueryTimer */ +typedef struct PVRSRV_BRIDGE_OUT_RGXQUERYTIMER_TAG +{ + IMG_UINT64 ui64StartTime; + IMG_UINT64 ui64EndTime; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXQUERYTIMER; + +/******************************************* + RGXCurrentTime + *******************************************/ + +/* Bridge in structure for RGXCurrentTime */ +typedef struct PVRSRV_BRIDGE_IN_RGXCURRENTTIME_TAG +{ + IMG_HANDLE hDevNode; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXCURRENTTIME; + + +/* Bridge out structure for RGXCurrentTime */ +typedef struct PVRSRV_BRIDGE_OUT_RGXCURRENTTIME_TAG +{ + IMG_UINT64 ui64Time; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXCURRENTTIME; + +#endif /* COMMON_TIMERQUERY_BRIDGE_H */ diff --git a/drivers/gpu/rogue_m/generated/timerquery_bridge/server_timerquery_bridge.c b/drivers/gpu/rogue_m/generated/timerquery_bridge/server_timerquery_bridge.c new file mode 100644 index 000000000000..6b64f9d8685a --- /dev/null +++ b/drivers/gpu/rogue_m/generated/timerquery_bridge/server_timerquery_bridge.c @@ -0,0 +1,283 @@ +/*************************************************************************/ /*! +@File +@Title Server bridge for timerquery +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Implements the server side of the bridge for timerquery +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#include +#include + +#include "img_defs.h" + +#include "rgxtimerquery.h" + + +#include "common_timerquery_bridge.h" + +#include "allocmem.h" +#include "pvr_debug.h" +#include "connection_server.h" +#include "pvr_bridge.h" +#include "rgx_bridge.h" +#include "srvcore.h" +#include "handle.h" + +#if defined (SUPPORT_AUTH) +#include "osauth.h" +#endif + +#include + + + + +/* *************************************************************************** + * Server-side bridge entry points + */ + +static IMG_INT +PVRSRVBridgeRGXBeginTimerQuery(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_RGXBEGINTIMERQUERY *psRGXBeginTimerQueryIN, + PVRSRV_BRIDGE_OUT_RGXBEGINTIMERQUERY *psRGXBeginTimerQueryOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevNodeInt = IMG_NULL; + + + + + + + + { + /* Look up the address from the handle */ + psRGXBeginTimerQueryOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &hDevNodeInt, + psRGXBeginTimerQueryIN->hDevNode, + PVRSRV_HANDLE_TYPE_DEV_NODE); + if(psRGXBeginTimerQueryOUT->eError != PVRSRV_OK) + { + goto RGXBeginTimerQuery_exit; + } + } + + + psRGXBeginTimerQueryOUT->eError = + PVRSRVRGXBeginTimerQueryKM( + hDevNodeInt, + psRGXBeginTimerQueryIN->ui32QueryId); + + + + +RGXBeginTimerQuery_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXEndTimerQuery(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_RGXENDTIMERQUERY *psRGXEndTimerQueryIN, + PVRSRV_BRIDGE_OUT_RGXENDTIMERQUERY *psRGXEndTimerQueryOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevNodeInt = IMG_NULL; + + + + + + + + { + /* Look up the address from the handle */ + psRGXEndTimerQueryOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &hDevNodeInt, + psRGXEndTimerQueryIN->hDevNode, + PVRSRV_HANDLE_TYPE_DEV_NODE); + if(psRGXEndTimerQueryOUT->eError != PVRSRV_OK) + { + goto RGXEndTimerQuery_exit; + } + } + + + psRGXEndTimerQueryOUT->eError = + PVRSRVRGXEndTimerQueryKM( + hDevNodeInt); + + + + +RGXEndTimerQuery_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXQueryTimer(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_RGXQUERYTIMER *psRGXQueryTimerIN, + PVRSRV_BRIDGE_OUT_RGXQUERYTIMER *psRGXQueryTimerOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevNodeInt = IMG_NULL; + + + + + + + + { + /* Look up the address from the handle */ + psRGXQueryTimerOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &hDevNodeInt, + psRGXQueryTimerIN->hDevNode, + PVRSRV_HANDLE_TYPE_DEV_NODE); + if(psRGXQueryTimerOUT->eError != PVRSRV_OK) + { + goto RGXQueryTimer_exit; + } + } + + + psRGXQueryTimerOUT->eError = + PVRSRVRGXQueryTimerKM( + hDevNodeInt, + psRGXQueryTimerIN->ui32QueryId, + &psRGXQueryTimerOUT->ui64StartTime, + &psRGXQueryTimerOUT->ui64EndTime); + + + + +RGXQueryTimer_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXCurrentTime(IMG_UINT32 ui32DispatchTableEntry, + PVRSRV_BRIDGE_IN_RGXCURRENTTIME *psRGXCurrentTimeIN, + PVRSRV_BRIDGE_OUT_RGXCURRENTTIME *psRGXCurrentTimeOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevNodeInt = IMG_NULL; + + + + + + + + { + /* Look up the address from the handle */ + psRGXCurrentTimeOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_VOID **) &hDevNodeInt, + psRGXCurrentTimeIN->hDevNode, + PVRSRV_HANDLE_TYPE_DEV_NODE); + if(psRGXCurrentTimeOUT->eError != PVRSRV_OK) + { + goto RGXCurrentTime_exit; + } + } + + + psRGXCurrentTimeOUT->eError = + PVRSRVRGXCurrentTime( + hDevNodeInt, + &psRGXCurrentTimeOUT->ui64Time); + + + + +RGXCurrentTime_exit: + + return 0; +} + + + +/* *************************************************************************** + * Server bridge dispatch related glue + */ + + +PVRSRV_ERROR InitTIMERQUERYBridge(IMG_VOID); +PVRSRV_ERROR DeinitTIMERQUERYBridge(IMG_VOID); + +/* + * Register all TIMERQUERY functions with services + */ +PVRSRV_ERROR InitTIMERQUERYBridge(IMG_VOID) +{ + + SetDispatchTableEntry(PVRSRV_BRIDGE_TIMERQUERY, PVRSRV_BRIDGE_TIMERQUERY_RGXBEGINTIMERQUERY, PVRSRVBridgeRGXBeginTimerQuery, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_TIMERQUERY, PVRSRV_BRIDGE_TIMERQUERY_RGXENDTIMERQUERY, PVRSRVBridgeRGXEndTimerQuery, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_TIMERQUERY, PVRSRV_BRIDGE_TIMERQUERY_RGXQUERYTIMER, PVRSRVBridgeRGXQueryTimer, + IMG_NULL, IMG_NULL, + 0, 0); + + SetDispatchTableEntry(PVRSRV_BRIDGE_TIMERQUERY, PVRSRV_BRIDGE_TIMERQUERY_RGXCURRENTTIME, PVRSRVBridgeRGXCurrentTime, + IMG_NULL, IMG_NULL, + 0, 0); + + + return PVRSRV_OK; +} + +/* + * Unregister all timerquery functions with services + */ +PVRSRV_ERROR DeinitTIMERQUERYBridge(IMG_VOID) +{ + return PVRSRV_OK; +} + diff --git a/drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_1.V.2.0.h b/drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_1.V.2.0.h new file mode 100644 index 000000000000..78a8b4c310d7 --- /dev/null +++ b/drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_1.V.2.0.h @@ -0,0 +1,69 @@ +/*************************************************************************/ /*! +@Title RGX Config BVNC 1.V.2.0 +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef _RGXCONFIG_KM_1_V_2_0_H_ +#define _RGXCONFIG_KM_1_V_2_0_H_ + +/***** Automatically generated file (3/25/2015 5:08:35 AM): Do not edit manually ********************/ +/***** Timestamp: (3/25/2015 5:08:35 AM)************************************************************/ + +#define RGX_BNC_KM_B 1 +#define RGX_BNC_KM_N 2 +#define RGX_BNC_KM_C 0 + +/****************************************************************************** + * DDK Defines + *****************************************************************************/ +#define RGX_FEATURE_NUM_CLUSTERS (2) +#define RGX_FEATURE_SLC_SIZE_IN_BYTES (128*1024) +#define RGX_FEATURE_PHYS_BUS_WIDTH (40) +#define RGX_FEATURE_AXI_ACELITE +#define RGX_FEATURE_SLC_CACHE_LINE_SIZE_BITS (512) +#define RGX_FEATURE_VIRTUAL_ADDRESS_SPACE_BITS (40) +#define RGX_FEATURE_TLA +#define RGX_FEATURE_GS_RTA_SUPPORT +#define RGX_FEATURE_NUM_ISP_IPP_PIPES (3) +#define RGX_FEATURE_META (MTP218) +#define RGX_FEATURE_META_COREMEM_SIZE (0) +#define RGX_FEATURE_COMPUTE + + +#endif /* _RGXCONFIG_1_V_2_0_H_ */ diff --git a/drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_1.V.2.20.h b/drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_1.V.2.20.h new file mode 100644 index 000000000000..ea00da18f486 --- /dev/null +++ b/drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_1.V.2.20.h @@ -0,0 +1,69 @@ +/*************************************************************************/ /*! +@Title RGX Config BVNC 1.V.2.20 +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef _RGXCONFIG_KM_1_V_2_20_H_ +#define _RGXCONFIG_KM_1_V_2_20_H_ + +/***** Automatically generated file (3/25/2015 5:08:35 AM): Do not edit manually ********************/ +/***** Timestamp: (3/25/2015 5:08:35 AM)************************************************************/ + +#define RGX_BNC_KM_B 1 +#define RGX_BNC_KM_N 2 +#define RGX_BNC_KM_C 20 + +/****************************************************************************** + * DDK Defines + *****************************************************************************/ +#define RGX_FEATURE_NUM_CLUSTERS (2) +#define RGX_FEATURE_SLC_SIZE_IN_BYTES (128*1024) +#define RGX_FEATURE_PHYS_BUS_WIDTH (40) +#define RGX_FEATURE_AXI_ACELITE +#define RGX_FEATURE_SLC_CACHE_LINE_SIZE_BITS (512) +#define RGX_FEATURE_VIRTUAL_ADDRESS_SPACE_BITS (40) +#define RGX_FEATURE_TLA +#define RGX_FEATURE_GS_RTA_SUPPORT +#define RGX_FEATURE_NUM_ISP_IPP_PIPES (3) +#define RGX_FEATURE_META (MTP218) +#define RGX_FEATURE_META_COREMEM_SIZE (0) +#define RGX_FEATURE_COMPUTE + + +#endif /* _RGXCONFIG_1_V_2_20_H_ */ diff --git a/drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_1.V.2.30.h b/drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_1.V.2.30.h new file mode 100644 index 000000000000..83e540830517 --- /dev/null +++ b/drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_1.V.2.30.h @@ -0,0 +1,70 @@ +/*************************************************************************/ /*! +@Title RGX Config BVNC 1.V.2.30 +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef _RGXCONFIG_KM_1_V_2_30_H_ +#define _RGXCONFIG_KM_1_V_2_30_H_ + +/***** Automatically generated file (3/25/2015 5:08:35 AM): Do not edit manually ********************/ +/***** Timestamp: (3/25/2015 5:08:35 AM)************************************************************/ + +#define RGX_BNC_KM_B 1 +#define RGX_BNC_KM_N 2 +#define RGX_BNC_KM_C 30 + +/****************************************************************************** + * DDK Defines + *****************************************************************************/ +#define RGX_FEATURE_NUM_CLUSTERS (2) +#define RGX_FEATURE_SLC_SIZE_IN_BYTES (128*1024) +#define RGX_FEATURE_PHYS_BUS_WIDTH (40) +#define RGX_FEATURE_AXI_ACELITE +#define RGX_FEATURE_SLC_CACHE_LINE_SIZE_BITS (512) +#define RGX_FEATURE_VIRTUAL_ADDRESS_SPACE_BITS (40) +#define RGX_FEATURE_TLA +#define RGX_FEATURE_GS_RTA_SUPPORT +#define RGX_FEATURE_NUM_ISP_IPP_PIPES (3) +#define RGX_FEATURE_META (MTP218) +#define RGX_FEATURE_FBCDC_ARCHITECTURE (1) +#define RGX_FEATURE_META_COREMEM_SIZE (0) +#define RGX_FEATURE_COMPUTE + + +#endif /* _RGXCONFIG_1_V_2_30_H_ */ diff --git a/drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_1.V.2.5.h b/drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_1.V.2.5.h new file mode 100644 index 000000000000..35dbddc07f43 --- /dev/null +++ b/drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_1.V.2.5.h @@ -0,0 +1,69 @@ +/*************************************************************************/ /*! +@Title RGX Config BVNC 1.V.2.5 +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef _RGXCONFIG_KM_1_V_2_5_H_ +#define _RGXCONFIG_KM_1_V_2_5_H_ + +/***** Automatically generated file (3/25/2015 5:08:35 AM): Do not edit manually ********************/ +/***** Timestamp: (3/25/2015 5:08:35 AM)************************************************************/ + +#define RGX_BNC_KM_B 1 +#define RGX_BNC_KM_N 2 +#define RGX_BNC_KM_C 5 + +/****************************************************************************** + * DDK Defines + *****************************************************************************/ +#define RGX_FEATURE_NUM_CLUSTERS (2) +#define RGX_FEATURE_SLC_SIZE_IN_BYTES (128*1024) +#define RGX_FEATURE_PHYS_BUS_WIDTH (40) +#define RGX_FEATURE_AXI_ACELITE +#define RGX_FEATURE_SLC_CACHE_LINE_SIZE_BITS (512) +#define RGX_FEATURE_VIRTUAL_ADDRESS_SPACE_BITS (40) +#define RGX_FEATURE_TLA +#define RGX_FEATURE_GS_RTA_SUPPORT +#define RGX_FEATURE_NUM_ISP_IPP_PIPES (3) +#define RGX_FEATURE_META (MTP218) +#define RGX_FEATURE_META_COREMEM_SIZE (0) +#define RGX_FEATURE_COMPUTE + + +#endif /* _RGXCONFIG_1_V_2_5_H_ */ diff --git a/drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_1.V.4.12.h b/drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_1.V.4.12.h new file mode 100644 index 000000000000..be9f47d60911 --- /dev/null +++ b/drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_1.V.4.12.h @@ -0,0 +1,69 @@ +/*************************************************************************/ /*! +@Title RGX Config BVNC 1.V.4.12 +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef _RGXCONFIG_KM_1_V_4_12_H_ +#define _RGXCONFIG_KM_1_V_4_12_H_ + +/***** Automatically generated file (3/25/2015 5:08:35 AM): Do not edit manually ********************/ +/***** Timestamp: (3/25/2015 5:08:35 AM)************************************************************/ + +#define RGX_BNC_KM_B 1 +#define RGX_BNC_KM_N 4 +#define RGX_BNC_KM_C 12 + +/****************************************************************************** + * DDK Defines + *****************************************************************************/ +#define RGX_FEATURE_NUM_CLUSTERS (4) +#define RGX_FEATURE_SLC_SIZE_IN_BYTES (256*1024) +#define RGX_FEATURE_PHYS_BUS_WIDTH (40) +#define RGX_FEATURE_SLC_CACHE_LINE_SIZE_BITS (512) +#define RGX_FEATURE_VIRTUAL_ADDRESS_SPACE_BITS (40) +#define RGX_FEATURE_TLA +#define RGX_FEATURE_GS_RTA_SUPPORT +#define RGX_FEATURE_NUM_ISP_IPP_PIPES (3) +#define RGX_FEATURE_META (MTP218) +#define RGX_FEATURE_FBCDC_ARCHITECTURE (1) +#define RGX_FEATURE_META_COREMEM_SIZE (0) +#define RGX_FEATURE_COMPUTE + + +#endif /* _RGXCONFIG_1_V_4_12_H_ */ diff --git a/drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_1.V.4.15.h b/drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_1.V.4.15.h new file mode 100644 index 000000000000..72386418ac04 --- /dev/null +++ b/drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_1.V.4.15.h @@ -0,0 +1,69 @@ +/*************************************************************************/ /*! +@Title RGX Config BVNC 1.V.4.15 +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef _RGXCONFIG_KM_1_V_4_15_H_ +#define _RGXCONFIG_KM_1_V_4_15_H_ + +/***** Automatically generated file (3/25/2015 5:08:35 AM): Do not edit manually ********************/ +/***** Timestamp: (3/25/2015 5:08:35 AM)************************************************************/ + +#define RGX_BNC_KM_B 1 +#define RGX_BNC_KM_N 4 +#define RGX_BNC_KM_C 15 + +/****************************************************************************** + * DDK Defines + *****************************************************************************/ +#define RGX_FEATURE_NUM_CLUSTERS (4) +#define RGX_FEATURE_SLC_SIZE_IN_BYTES (256*1024) +#define RGX_FEATURE_PHYS_BUS_WIDTH (40) +#define RGX_FEATURE_AXI_ACELITE +#define RGX_FEATURE_SLC_CACHE_LINE_SIZE_BITS (512) +#define RGX_FEATURE_VIRTUAL_ADDRESS_SPACE_BITS (40) +#define RGX_FEATURE_TLA +#define RGX_FEATURE_GS_RTA_SUPPORT +#define RGX_FEATURE_NUM_ISP_IPP_PIPES (3) +#define RGX_FEATURE_META (MTP218) +#define RGX_FEATURE_META_COREMEM_SIZE (0) +#define RGX_FEATURE_COMPUTE + + +#endif /* _RGXCONFIG_1_V_4_15_H_ */ diff --git a/drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_1.V.4.19.h b/drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_1.V.4.19.h new file mode 100644 index 000000000000..34fa658b07e9 --- /dev/null +++ b/drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_1.V.4.19.h @@ -0,0 +1,70 @@ +/*************************************************************************/ /*! +@Title RGX Config BVNC 1.V.4.19 +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef _RGXCONFIG_KM_1_V_4_19_H_ +#define _RGXCONFIG_KM_1_V_4_19_H_ + +/***** Automatically generated file (3/25/2015 5:08:35 AM): Do not edit manually ********************/ +/***** Timestamp: (3/25/2015 5:08:35 AM)************************************************************/ + +#define RGX_BNC_KM_B 1 +#define RGX_BNC_KM_N 4 +#define RGX_BNC_KM_C 19 + +/****************************************************************************** + * DDK Defines + *****************************************************************************/ +#define RGX_FEATURE_NUM_CLUSTERS (4) +#define RGX_FEATURE_SLC_SIZE_IN_BYTES (128*1024) +#define RGX_FEATURE_PHYS_BUS_WIDTH (40) +#define RGX_FEATURE_AXI_ACELITE +#define RGX_FEATURE_SLC_CACHE_LINE_SIZE_BITS (512) +#define RGX_FEATURE_VIRTUAL_ADDRESS_SPACE_BITS (40) +#define RGX_FEATURE_TLA +#define RGX_FEATURE_GS_RTA_SUPPORT +#define RGX_FEATURE_NUM_ISP_IPP_PIPES (3) +#define RGX_FEATURE_META (MTP218) +#define RGX_FEATURE_FBCDC_ARCHITECTURE (1) +#define RGX_FEATURE_META_COREMEM_SIZE (0) +#define RGX_FEATURE_COMPUTE + + +#endif /* _RGXCONFIG_1_V_4_19_H_ */ diff --git a/drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_1.V.4.5.h b/drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_1.V.4.5.h new file mode 100644 index 000000000000..7c52ec49294d --- /dev/null +++ b/drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_1.V.4.5.h @@ -0,0 +1,69 @@ +/*************************************************************************/ /*! +@Title RGX Config BVNC 1.V.4.5 +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef _RGXCONFIG_KM_1_V_4_5_H_ +#define _RGXCONFIG_KM_1_V_4_5_H_ + +/***** Automatically generated file (3/25/2015 5:08:35 AM): Do not edit manually ********************/ +/***** Timestamp: (3/25/2015 5:08:35 AM)************************************************************/ + +#define RGX_BNC_KM_B 1 +#define RGX_BNC_KM_N 4 +#define RGX_BNC_KM_C 5 + +/****************************************************************************** + * DDK Defines + *****************************************************************************/ +#define RGX_FEATURE_NUM_CLUSTERS (4) +#define RGX_FEATURE_SLC_SIZE_IN_BYTES (128*1024) +#define RGX_FEATURE_PHYS_BUS_WIDTH (40) +#define RGX_FEATURE_SLC_CACHE_LINE_SIZE_BITS (512) +#define RGX_FEATURE_VIRTUAL_ADDRESS_SPACE_BITS (40) +#define RGX_FEATURE_TLA +#define RGX_FEATURE_GS_RTA_SUPPORT +#define RGX_FEATURE_NUM_ISP_IPP_PIPES (3) +#define RGX_FEATURE_META (MTP218) +#define RGX_FEATURE_FBCDC_ARCHITECTURE (1) +#define RGX_FEATURE_META_COREMEM_SIZE (0) +#define RGX_FEATURE_COMPUTE + + +#endif /* _RGXCONFIG_1_V_4_5_H_ */ diff --git a/drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_1.V.4.6.h b/drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_1.V.4.6.h new file mode 100644 index 000000000000..a385f5d13e84 --- /dev/null +++ b/drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_1.V.4.6.h @@ -0,0 +1,68 @@ +/*************************************************************************/ /*! +@Title RGX Config BVNC 1.V.4.6 +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef _RGXCONFIG_KM_1_V_4_6_H_ +#define _RGXCONFIG_KM_1_V_4_6_H_ + +/***** Automatically generated file (3/25/2015 5:08:35 AM): Do not edit manually ********************/ +/***** Timestamp: (3/25/2015 5:08:35 AM)************************************************************/ + +#define RGX_BNC_KM_B 1 +#define RGX_BNC_KM_N 4 +#define RGX_BNC_KM_C 6 + +/****************************************************************************** + * DDK Defines + *****************************************************************************/ +#define RGX_FEATURE_NUM_CLUSTERS (4) +#define RGX_FEATURE_SLC_SIZE_IN_BYTES (128*1024) +#define RGX_FEATURE_PHYS_BUS_WIDTH (40) +#define RGX_FEATURE_SLC_CACHE_LINE_SIZE_BITS (512) +#define RGX_FEATURE_VIRTUAL_ADDRESS_SPACE_BITS (40) +#define RGX_FEATURE_TLA +#define RGX_FEATURE_GS_RTA_SUPPORT +#define RGX_FEATURE_NUM_ISP_IPP_PIPES (3) +#define RGX_FEATURE_META (MTP218) +#define RGX_FEATURE_META_COREMEM_SIZE (0) +#define RGX_FEATURE_COMPUTE + + +#endif /* _RGXCONFIG_1_V_4_6_H_ */ diff --git a/drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_12.V.1.20.h b/drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_12.V.1.20.h new file mode 100644 index 000000000000..0f5ef18b2d56 --- /dev/null +++ b/drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_12.V.1.20.h @@ -0,0 +1,67 @@ +/*************************************************************************/ /*! +@Title RGX Config BVNC 12.V.1.20 +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef _RGXCONFIG_KM_12_V_1_20_H_ +#define _RGXCONFIG_KM_12_V_1_20_H_ + +/***** Automatically generated file (3/25/2015 5:08:36 AM): Do not edit manually ********************/ +/***** Timestamp: (3/25/2015 5:08:36 AM)************************************************************/ + +#define RGX_BNC_KM_B 12 +#define RGX_BNC_KM_N 1 +#define RGX_BNC_KM_C 20 + +/****************************************************************************** + * DDK Defines + *****************************************************************************/ +#define RGX_FEATURE_PHYS_BUS_WIDTH (40) +#define RGX_FEATURE_AXI_ACELITE +#define RGX_FEATURE_SLC_CACHE_LINE_SIZE_BITS (512) +#define RGX_FEATURE_NUM_CLUSTERS (1) +#define RGX_FEATURE_VIRTUAL_ADDRESS_SPACE_BITS (40) +#define RGX_FEATURE_NUM_ISP_IPP_PIPES (1) +#define RGX_FEATURE_META (LTP217) +#define RGX_FEATURE_SLC_SIZE_IN_BYTES (0*1024) +#define RGX_FEATURE_META_COREMEM_SIZE (0) +#define RGX_FEATURE_COMPUTE + + +#endif /* _RGXCONFIG_12_V_1_20_H_ */ diff --git a/drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_4.V.2.51.h b/drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_4.V.2.51.h new file mode 100644 index 000000000000..3230b743d1b0 --- /dev/null +++ b/drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_4.V.2.51.h @@ -0,0 +1,72 @@ +/*************************************************************************/ /*! +@Title RGX Config BVNC 4.V.2.51 +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef _RGXCONFIG_KM_4_V_2_51_H_ +#define _RGXCONFIG_KM_4_V_2_51_H_ + +/***** Automatically generated file (3/25/2015 5:08:36 AM): Do not edit manually ********************/ +/***** Timestamp: (3/25/2015 5:08:36 AM)************************************************************/ + +#define RGX_BNC_KM_B 4 +#define RGX_BNC_KM_N 2 +#define RGX_BNC_KM_C 51 + +/****************************************************************************** + * DDK Defines + *****************************************************************************/ +#define RGX_FEATURE_NUM_CLUSTERS (2) +#define RGX_FEATURE_SLC_SIZE_IN_BYTES (128*1024) +#define RGX_FEATURE_PHYS_BUS_WIDTH (40) +#define RGX_FEATURE_AXI_ACELITE +#define RGX_FEATURE_CLUSTER_GROUPING +#define RGX_FEATURE_SLC_CACHE_LINE_SIZE_BITS (512) +#define RGX_FEATURE_VIRTUAL_ADDRESS_SPACE_BITS (40) +#define RGX_FEATURE_TLA +#define RGX_FEATURE_GS_RTA_SUPPORT +#define RGX_FEATURE_NUM_ISP_IPP_PIPES (8) +#define RGX_FEATURE_META (LTP218) +#define RGX_FEATURE_XT_TOP_INFRASTRUCTURE +#define RGX_FEATURE_FBCDC_ARCHITECTURE (2) +#define RGX_FEATURE_META_COREMEM_SIZE (32) +#define RGX_FEATURE_COMPUTE + + +#endif /* _RGXCONFIG_4_V_2_51_H_ */ diff --git a/drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_4.V.2.52.h b/drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_4.V.2.52.h new file mode 100644 index 000000000000..dc439c2621ec --- /dev/null +++ b/drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_4.V.2.52.h @@ -0,0 +1,73 @@ +/*************************************************************************/ /*! +@Title RGX Config BVNC 4.V.2.52 +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef _RGXCONFIG_KM_4_V_2_52_H_ +#define _RGXCONFIG_KM_4_V_2_52_H_ + +/***** Automatically generated file (3/25/2015 5:08:36 AM): Do not edit manually ********************/ +/***** Timestamp: (3/25/2015 5:08:36 AM)************************************************************/ + +#define RGX_BNC_KM_B 4 +#define RGX_BNC_KM_N 2 +#define RGX_BNC_KM_C 52 + +/****************************************************************************** + * DDK Defines + *****************************************************************************/ +#define RGX_FEATURE_NUM_CLUSTERS (2) +#define RGX_FEATURE_SLC_SIZE_IN_BYTES (128*1024) +#define RGX_FEATURE_PHYS_BUS_WIDTH (40) +#define RGX_FEATURE_AXI_ACELITE +#define RGX_FEATURE_CLUSTER_GROUPING +#define RGX_FEATURE_SLC_CACHE_LINE_SIZE_BITS (512) +#define RGX_FEATURE_VIRTUAL_ADDRESS_SPACE_BITS (40) +#define RGX_FEATURE_TLA +#define RGX_FEATURE_GS_RTA_SUPPORT +#define RGX_FEATURE_NUM_ISP_IPP_PIPES (8) +#define RGX_FEATURE_META (LTP218) +#define RGX_FEATURE_XT_TOP_INFRASTRUCTURE +#define RGX_FEATURE_FBCDC_ARCHITECTURE (2) +#define RGX_FEATURE_GPU_VIRTUALISATION +#define RGX_FEATURE_META_COREMEM_SIZE (32) +#define RGX_FEATURE_COMPUTE + + +#endif /* _RGXCONFIG_4_V_2_52_H_ */ diff --git a/drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_4.V.2.57.h b/drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_4.V.2.57.h new file mode 100644 index 000000000000..55f9261fde86 --- /dev/null +++ b/drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_4.V.2.57.h @@ -0,0 +1,73 @@ +/*************************************************************************/ /*! +@Title RGX Config BVNC 4.V.2.57 +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef _RGXCONFIG_KM_4_V_2_57_H_ +#define _RGXCONFIG_KM_4_V_2_57_H_ + +/***** Automatically generated file (3/25/2015 5:08:36 AM): Do not edit manually ********************/ +/***** Timestamp: (3/25/2015 5:08:36 AM)************************************************************/ + +#define RGX_BNC_KM_B 4 +#define RGX_BNC_KM_N 2 +#define RGX_BNC_KM_C 57 + +/****************************************************************************** + * DDK Defines + *****************************************************************************/ +#define RGX_FEATURE_NUM_CLUSTERS (2) +#define RGX_FEATURE_SLC_SIZE_IN_BYTES (128*1024) +#define RGX_FEATURE_PHYS_BUS_WIDTH (40) +#define RGX_FEATURE_AXI_ACELITE +#define RGX_FEATURE_CLUSTER_GROUPING +#define RGX_FEATURE_SLC_CACHE_LINE_SIZE_BITS (512) +#define RGX_FEATURE_VIRTUAL_ADDRESS_SPACE_BITS (40) +#define RGX_FEATURE_TLA +#define RGX_FEATURE_GS_RTA_SUPPORT +#define RGX_FEATURE_NUM_ISP_IPP_PIPES (8) +#define RGX_FEATURE_META (LTP218) +#define RGX_FEATURE_XT_TOP_INFRASTRUCTURE +#define RGX_FEATURE_FBCDC_ARCHITECTURE (2) +#define RGX_FEATURE_GPU_VIRTUALISATION +#define RGX_FEATURE_META_COREMEM_SIZE (32) +#define RGX_FEATURE_COMPUTE + + +#endif /* _RGXCONFIG_4_V_2_57_H_ */ diff --git a/drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_4.V.2.58.h b/drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_4.V.2.58.h new file mode 100644 index 000000000000..8c444333c65e --- /dev/null +++ b/drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_4.V.2.58.h @@ -0,0 +1,73 @@ +/*************************************************************************/ /*! +@Title RGX Config BVNC 4.V.2.58 +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef _RGXCONFIG_KM_4_V_2_58_H_ +#define _RGXCONFIG_KM_4_V_2_58_H_ + +/***** Automatically generated file (3/25/2015 5:08:37 AM): Do not edit manually ********************/ +/***** Timestamp: (3/25/2015 5:08:37 AM)************************************************************/ + +#define RGX_BNC_KM_B 4 +#define RGX_BNC_KM_N 2 +#define RGX_BNC_KM_C 58 + +/****************************************************************************** + * DDK Defines + *****************************************************************************/ +#define RGX_FEATURE_NUM_CLUSTERS (2) +#define RGX_FEATURE_SLC_SIZE_IN_BYTES (128*1024) +#define RGX_FEATURE_PHYS_BUS_WIDTH (40) +#define RGX_FEATURE_AXI_ACELITE +#define RGX_FEATURE_CLUSTER_GROUPING +#define RGX_FEATURE_SLC_CACHE_LINE_SIZE_BITS (512) +#define RGX_FEATURE_VIRTUAL_ADDRESS_SPACE_BITS (40) +#define RGX_FEATURE_TLA +#define RGX_FEATURE_GS_RTA_SUPPORT +#define RGX_FEATURE_NUM_ISP_IPP_PIPES (8) +#define RGX_FEATURE_META (LTP218) +#define RGX_FEATURE_XT_TOP_INFRASTRUCTURE +#define RGX_FEATURE_FBCDC_ARCHITECTURE (2) +#define RGX_FEATURE_GPU_VIRTUALISATION +#define RGX_FEATURE_META_COREMEM_SIZE (32) +#define RGX_FEATURE_COMPUTE + + +#endif /* _RGXCONFIG_4_V_2_58_H_ */ diff --git a/drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_4.V.4.53.h b/drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_4.V.4.53.h new file mode 100644 index 000000000000..2b408a3c5ad6 --- /dev/null +++ b/drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_4.V.4.53.h @@ -0,0 +1,72 @@ +/*************************************************************************/ /*! +@Title RGX Config BVNC 4.V.4.53 +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef _RGXCONFIG_KM_4_V_4_53_H_ +#define _RGXCONFIG_KM_4_V_4_53_H_ + +/***** Automatically generated file (3/25/2015 5:08:36 AM): Do not edit manually ********************/ +/***** Timestamp: (3/25/2015 5:08:36 AM)************************************************************/ + +#define RGX_BNC_KM_B 4 +#define RGX_BNC_KM_N 4 +#define RGX_BNC_KM_C 53 + +/****************************************************************************** + * DDK Defines + *****************************************************************************/ +#define RGX_FEATURE_NUM_CLUSTERS (4) +#define RGX_FEATURE_SLC_SIZE_IN_BYTES (128*1024) +#define RGX_FEATURE_PHYS_BUS_WIDTH (40) +#define RGX_FEATURE_AXI_ACELITE +#define RGX_FEATURE_CLUSTER_GROUPING +#define RGX_FEATURE_SLC_CACHE_LINE_SIZE_BITS (512) +#define RGX_FEATURE_VIRTUAL_ADDRESS_SPACE_BITS (40) +#define RGX_FEATURE_TLA +#define RGX_FEATURE_GS_RTA_SUPPORT +#define RGX_FEATURE_NUM_ISP_IPP_PIPES (8) +#define RGX_FEATURE_META (LTP218) +#define RGX_FEATURE_XT_TOP_INFRASTRUCTURE +#define RGX_FEATURE_FBCDC_ARCHITECTURE (2) +#define RGX_FEATURE_META_COREMEM_SIZE (32) +#define RGX_FEATURE_COMPUTE + + +#endif /* _RGXCONFIG_4_V_4_53_H_ */ diff --git a/drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_4.V.6.62.h b/drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_4.V.6.62.h new file mode 100644 index 000000000000..5ef29d26a864 --- /dev/null +++ b/drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_4.V.6.62.h @@ -0,0 +1,74 @@ +/*************************************************************************/ /*! +@Title RGX Config BVNC 4.V.6.62 +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef _RGXCONFIG_KM_4_V_6_62_H_ +#define _RGXCONFIG_KM_4_V_6_62_H_ + +/***** Automatically generated file (3/25/2015 5:08:36 AM): Do not edit manually ********************/ +/***** Timestamp: (3/25/2015 5:08:36 AM)************************************************************/ + +#define RGX_BNC_KM_B 4 +#define RGX_BNC_KM_N 6 +#define RGX_BNC_KM_C 62 + +/****************************************************************************** + * DDK Defines + *****************************************************************************/ +#define RGX_FEATURE_SLC_SIZE_IN_BYTES (128*1024) +#define RGX_FEATURE_PHYS_BUS_WIDTH (40) +#define RGX_FEATURE_NUM_CLUSTERS (6) +#define RGX_FEATURE_AXI_ACELITE +#define RGX_FEATURE_CLUSTER_GROUPING +#define RGX_FEATURE_SLC_CACHE_LINE_SIZE_BITS (512) +#define RGX_FEATURE_SLC_BANKS (4) +#define RGX_FEATURE_VIRTUAL_ADDRESS_SPACE_BITS (40) +#define RGX_FEATURE_TLA +#define RGX_FEATURE_GS_RTA_SUPPORT +#define RGX_FEATURE_NUM_ISP_IPP_PIPES (8) +#define RGX_FEATURE_META (LTP218) +#define RGX_FEATURE_XT_TOP_INFRASTRUCTURE +#define RGX_FEATURE_FBCDC_ARCHITECTURE (2) +#define RGX_FEATURE_GPU_VIRTUALISATION +#define RGX_FEATURE_META_COREMEM_SIZE (32) +#define RGX_FEATURE_COMPUTE + + +#endif /* _RGXCONFIG_4_V_6_62_H_ */ diff --git a/drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_5.V.1.46.h b/drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_5.V.1.46.h new file mode 100644 index 000000000000..64541c47558c --- /dev/null +++ b/drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_5.V.1.46.h @@ -0,0 +1,70 @@ +/*************************************************************************/ /*! +@Title RGX Config BVNC 5.V.1.46 +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef _RGXCONFIG_KM_5_V_1_46_H_ +#define _RGXCONFIG_KM_5_V_1_46_H_ + +/***** Automatically generated file (3/25/2015 5:08:36 AM): Do not edit manually ********************/ +/***** Timestamp: (3/25/2015 5:08:36 AM)************************************************************/ + +#define RGX_BNC_KM_B 5 +#define RGX_BNC_KM_N 1 +#define RGX_BNC_KM_C 46 + +/****************************************************************************** + * DDK Defines + *****************************************************************************/ +#define RGX_FEATURE_PHYS_BUS_WIDTH (40) +#define RGX_FEATURE_AXI_ACELITE +#define RGX_FEATURE_SLC_CACHE_LINE_SIZE_BITS (512) +#define RGX_FEATURE_NUM_CLUSTERS (1) +#define RGX_FEATURE_VIRTUAL_ADDRESS_SPACE_BITS (40) +#define RGX_FEATURE_SLC_SIZE_IN_BYTES (16*1024) +#define RGX_FEATURE_SLC_BANKS (1) +#define RGX_FEATURE_GS_RTA_SUPPORT +#define RGX_FEATURE_NUM_ISP_IPP_PIPES (1) +#define RGX_FEATURE_META (LTP217) +#define RGX_FEATURE_FBCDC_ARCHITECTURE (1) +#define RGX_FEATURE_META_COREMEM_SIZE (0) +#define RGX_FEATURE_COMPUTE + + +#endif /* _RGXCONFIG_5_V_1_46_H_ */ diff --git a/drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_8.V.2.34.h b/drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_8.V.2.34.h new file mode 100644 index 000000000000..1df1eb712ff6 --- /dev/null +++ b/drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_8.V.2.34.h @@ -0,0 +1,79 @@ +/*************************************************************************/ /*! +@Title RGX Config BVNC 8.V.2.34 +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef _RGXCONFIG_KM_8_V_2_34_H_ +#define _RGXCONFIG_KM_8_V_2_34_H_ + +/***** Automatically generated file (3/25/2015 5:08:37 AM): Do not edit manually ********************/ +/***** Timestamp: (3/25/2015 5:08:37 AM)************************************************************/ + +#define RGX_BNC_KM_B 8 +#define RGX_BNC_KM_N 2 +#define RGX_BNC_KM_C 34 + +/****************************************************************************** + * DDK Defines + *****************************************************************************/ +#define RGX_FEATURE_NUM_CLUSTERS (2) +#define RGX_FEATURE_PHYS_BUS_WIDTH (40) +#define RGX_FEATURE_AXI_ACELITE +#define RGX_FEATURE_CLUSTER_GROUPING +#define RGX_FEATURE_VIRTUAL_ADDRESS_SPACE_BITS (40) +#define RGX_FEATURE_SCALABLE_TE_ARCH (1) +#define RGX_FEATURE_GS_RTA_SUPPORT +#define RGX_FEATURE_NUM_ISP_IPP_PIPES (4) +#define RGX_FEATURE_META (LTP218) +#define RGX_FEATURE_SLC_VIVT +#define RGX_FEATURE_SLC_SIZE_IN_KILOBYTES (128) +#define RGX_FEATURE_SLC_CACHE_LINE_SIZE_BITS (512) +#define RGX_FEATURE_S7_CACHE_HIERARCHY +#define RGX_FEATURE_S7_TOP_INFRASTRUCTURE +#define RGX_FEATURE_SLC_BANKS (2) +#define RGX_FEATURE_META_DMA_CHANNEL_COUNT (4) +#define RGX_FEATURE_FBCDC_ARCHITECTURE (3) +#define RGX_FEATURE_META_COREMEM_BANKS (8) +#define RGX_FEATURE_GPU_VIRTUALISATION +#define RGX_FEATURE_META_DMA +#define RGX_FEATURE_META_COREMEM_SIZE (64) +#define RGX_FEATURE_COMPUTE + + +#endif /* _RGXCONFIG_8_V_2_34_H_ */ diff --git a/drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_8.V.4.38.h b/drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_8.V.4.38.h new file mode 100644 index 000000000000..c2f33659ccc4 --- /dev/null +++ b/drivers/gpu/rogue_m/hwdefs/km/configs/rgxconfig_km_8.V.4.38.h @@ -0,0 +1,79 @@ +/*************************************************************************/ /*! +@Title RGX Config BVNC 8.V.4.38 +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef _RGXCONFIG_KM_8_V_4_38_H_ +#define _RGXCONFIG_KM_8_V_4_38_H_ + +/***** Automatically generated file (3/25/2015 5:08:37 AM): Do not edit manually ********************/ +/***** Timestamp: (3/25/2015 5:08:37 AM)************************************************************/ + +#define RGX_BNC_KM_B 8 +#define RGX_BNC_KM_N 4 +#define RGX_BNC_KM_C 38 + +/****************************************************************************** + * DDK Defines + *****************************************************************************/ +#define RGX_FEATURE_NUM_CLUSTERS (4) +#define RGX_FEATURE_PHYS_BUS_WIDTH (40) +#define RGX_FEATURE_AXI_ACELITE +#define RGX_FEATURE_CLUSTER_GROUPING +#define RGX_FEATURE_VIRTUAL_ADDRESS_SPACE_BITS (40) +#define RGX_FEATURE_SCALABLE_TE_ARCH (1) +#define RGX_FEATURE_GS_RTA_SUPPORT +#define RGX_FEATURE_NUM_ISP_IPP_PIPES (8) +#define RGX_FEATURE_META (LTP218) +#define RGX_FEATURE_SLC_VIVT +#define RGX_FEATURE_SLC_SIZE_IN_KILOBYTES (256) +#define RGX_FEATURE_SLC_CACHE_LINE_SIZE_BITS (512) +#define RGX_FEATURE_S7_CACHE_HIERARCHY +#define RGX_FEATURE_S7_TOP_INFRASTRUCTURE +#define RGX_FEATURE_SLC_BANKS (2) +#define RGX_FEATURE_META_DMA_CHANNEL_COUNT (4) +#define RGX_FEATURE_FBCDC_ARCHITECTURE (3) +#define RGX_FEATURE_META_COREMEM_BANKS (8) +#define RGX_FEATURE_GPU_VIRTUALISATION +#define RGX_FEATURE_META_DMA +#define RGX_FEATURE_META_COREMEM_SIZE (64) +#define RGX_FEATURE_COMPUTE + + +#endif /* _RGXCONFIG_8_V_4_38_H_ */ diff --git a/drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_1.32.4.19.h b/drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_1.32.4.19.h new file mode 100644 index 000000000000..f078e42ab895 --- /dev/null +++ b/drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_1.32.4.19.h @@ -0,0 +1,72 @@ +/*************************************************************************/ /*! +@Title RGX Core BVNC 1.32.4.19 +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef _RGXCORE_KM_1_32_4_19_H_ +#define _RGXCORE_KM_1_32_4_19_H_ + +/***** Automatically generated file (3/4/2015 2:27:37 PM): Do not edit manually ********************/ +/***** Timestamp: (3/4/2015 2:27:37 PM)************************************************************/ +/***** CS: @2615289 ******************************************************************/ + + +/****************************************************************************** + * BVNC = 1.32.4.19 + *****************************************************************************/ +#define RGX_BVNC_KM_B 1 +#define RGX_BVNC_KM_V 32 +#define RGX_BVNC_KM_N 4 +#define RGX_BVNC_KM_C 19 + +/****************************************************************************** + * Errata + *****************************************************************************/ + +#define FIX_HW_BRN_38344 + + + +/****************************************************************************** + * Enhancements + *****************************************************************************/ + + + +#endif /* _RGXCORE_KM_1_32_4_19_H_ */ diff --git a/drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_1.33.2.5.h b/drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_1.33.2.5.h new file mode 100644 index 000000000000..f9939a133a28 --- /dev/null +++ b/drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_1.33.2.5.h @@ -0,0 +1,72 @@ +/*************************************************************************/ /*! +@Title RGX Core BVNC 1.33.2.5 +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef _RGXCORE_KM_1_33_2_5_H_ +#define _RGXCORE_KM_1_33_2_5_H_ + +/***** Automatically generated file (3/4/2015 2:27:36 PM): Do not edit manually ********************/ +/***** Timestamp: (3/4/2015 2:27:36 PM)************************************************************/ +/***** CS: @2106753 ******************************************************************/ + + +/****************************************************************************** + * BVNC = 1.33.2.5 + *****************************************************************************/ +#define RGX_BVNC_KM_B 1 +#define RGX_BVNC_KM_V 33 +#define RGX_BVNC_KM_N 2 +#define RGX_BVNC_KM_C 5 + +/****************************************************************************** + * Errata + *****************************************************************************/ + +#define FIX_HW_BRN_38344 + + + +/****************************************************************************** + * Enhancements + *****************************************************************************/ + + + +#endif /* _RGXCORE_KM_1_33_2_5_H_ */ diff --git a/drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_1.39.4.19.h b/drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_1.39.4.19.h new file mode 100644 index 000000000000..cd293a5f5284 --- /dev/null +++ b/drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_1.39.4.19.h @@ -0,0 +1,72 @@ +/*************************************************************************/ /*! +@Title RGX Core BVNC 1.39.4.19 +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef _RGXCORE_KM_1_39_4_19_H_ +#define _RGXCORE_KM_1_39_4_19_H_ + +/***** Automatically generated file (3/4/2015 2:27:37 PM): Do not edit manually ********************/ +/***** Timestamp: (3/4/2015 2:27:37 PM)************************************************************/ +/***** CS: @2784771 ******************************************************************/ + + +/****************************************************************************** + * BVNC = 1.39.4.19 + *****************************************************************************/ +#define RGX_BVNC_KM_B 1 +#define RGX_BVNC_KM_V 39 +#define RGX_BVNC_KM_N 4 +#define RGX_BVNC_KM_C 19 + +/****************************************************************************** + * Errata + *****************************************************************************/ + +#define FIX_HW_BRN_38344 + + + +/****************************************************************************** + * Enhancements + *****************************************************************************/ + + + +#endif /* _RGXCORE_KM_1_39_4_19_H_ */ diff --git a/drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_1.48.2.0.h b/drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_1.48.2.0.h new file mode 100644 index 000000000000..e970ddbc6d4c --- /dev/null +++ b/drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_1.48.2.0.h @@ -0,0 +1,72 @@ +/*************************************************************************/ /*! +@Title RGX Core BVNC 1.48.2.0 +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef _RGXCORE_KM_1_48_2_0_H_ +#define _RGXCORE_KM_1_48_2_0_H_ + +/***** Automatically generated file (3/4/2015 2:27:36 PM): Do not edit manually ********************/ +/***** Timestamp: (3/4/2015 2:27:36 PM)************************************************************/ +/***** CS: @2523218 ******************************************************************/ + + +/****************************************************************************** + * BVNC = 1.48.2.0 + *****************************************************************************/ +#define RGX_BVNC_KM_B 1 +#define RGX_BVNC_KM_V 48 +#define RGX_BVNC_KM_N 2 +#define RGX_BVNC_KM_C 0 + +/****************************************************************************** + * Errata + *****************************************************************************/ + +#define FIX_HW_BRN_38344 + + + +/****************************************************************************** + * Enhancements + *****************************************************************************/ + + + +#endif /* _RGXCORE_KM_1_48_2_0_H_ */ diff --git a/drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_1.72.4.12.h b/drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_1.72.4.12.h new file mode 100644 index 000000000000..5dc662d88f57 --- /dev/null +++ b/drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_1.72.4.12.h @@ -0,0 +1,71 @@ +/*************************************************************************/ /*! +@Title RGX Core BVNC 1.72.4.12 +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef _RGXCORE_KM_1_72_4_12_H_ +#define _RGXCORE_KM_1_72_4_12_H_ + +/***** Automatically generated file (3/4/2015 2:27:34 PM): Do not edit manually ********************/ +/***** Timestamp: (3/4/2015 2:27:34 PM)************************************************************/ +/***** CS: @2646650 ******************************************************************/ + + +/****************************************************************************** + * BVNC = 1.72.4.12 + *****************************************************************************/ +#define RGX_BVNC_KM_B 1 +#define RGX_BVNC_KM_V 72 +#define RGX_BVNC_KM_N 4 +#define RGX_BVNC_KM_C 12 + +/****************************************************************************** + * Errata + *****************************************************************************/ + + + + +/****************************************************************************** + * Enhancements + *****************************************************************************/ + + + +#endif /* _RGXCORE_KM_1_72_4_12_H_ */ diff --git a/drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_1.75.2.20.h b/drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_1.75.2.20.h new file mode 100644 index 000000000000..ece76e025521 --- /dev/null +++ b/drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_1.75.2.20.h @@ -0,0 +1,71 @@ +/*************************************************************************/ /*! +@Title RGX Core BVNC 1.75.2.20 +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef _RGXCORE_KM_1_75_2_20_H_ +#define _RGXCORE_KM_1_75_2_20_H_ + +/***** Automatically generated file (3/4/2015 2:27:36 PM): Do not edit manually ********************/ +/***** Timestamp: (3/4/2015 2:27:36 PM)************************************************************/ +/***** CS: @2309075 ******************************************************************/ + + +/****************************************************************************** + * BVNC = 1.75.2.20 + *****************************************************************************/ +#define RGX_BVNC_KM_B 1 +#define RGX_BVNC_KM_V 75 +#define RGX_BVNC_KM_N 2 +#define RGX_BVNC_KM_C 20 + +/****************************************************************************** + * Errata + *****************************************************************************/ + + + + +/****************************************************************************** + * Enhancements + *****************************************************************************/ + + + +#endif /* _RGXCORE_KM_1_75_2_20_H_ */ diff --git a/drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_1.75.2.30.h b/drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_1.75.2.30.h new file mode 100644 index 000000000000..f03f0a51d8dd --- /dev/null +++ b/drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_1.75.2.30.h @@ -0,0 +1,71 @@ +/*************************************************************************/ /*! +@Title RGX Core BVNC 1.75.2.30 +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef _RGXCORE_KM_1_75_2_30_H_ +#define _RGXCORE_KM_1_75_2_30_H_ + +/***** Automatically generated file (3/4/2015 2:27:33 PM): Do not edit manually ********************/ +/***** Timestamp: (3/4/2015 2:27:33 PM)************************************************************/ +/***** CS: @2309075 ******************************************************************/ + + +/****************************************************************************** + * BVNC = 1.75.2.30 + *****************************************************************************/ +#define RGX_BVNC_KM_B 1 +#define RGX_BVNC_KM_V 75 +#define RGX_BVNC_KM_N 2 +#define RGX_BVNC_KM_C 30 + +/****************************************************************************** + * Errata + *****************************************************************************/ + + + + +/****************************************************************************** + * Enhancements + *****************************************************************************/ + + + +#endif /* _RGXCORE_KM_1_75_2_30_H_ */ diff --git a/drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_1.76.4.6.h b/drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_1.76.4.6.h new file mode 100644 index 000000000000..1ba40585b7fb --- /dev/null +++ b/drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_1.76.4.6.h @@ -0,0 +1,73 @@ +/*************************************************************************/ /*! +@Title RGX Core BVNC 1.76.4.6 +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef _RGXCORE_KM_1_76_4_6_H_ +#define _RGXCORE_KM_1_76_4_6_H_ + +/***** Automatically generated file (3/4/2015 2:27:34 PM): Do not edit manually ********************/ +/***** Timestamp: (3/4/2015 2:27:34 PM)************************************************************/ +/***** CS: @2318404 ******************************************************************/ + + +/****************************************************************************** + * BVNC = 1.76.4.6 + *****************************************************************************/ +#define RGX_BVNC_KM_B 1 +#define RGX_BVNC_KM_V 76 +#define RGX_BVNC_KM_N 4 +#define RGX_BVNC_KM_C 6 + +/****************************************************************************** + * Errata + *****************************************************************************/ + +#define FIX_HW_BRN_38344 +#define FIX_HW_BRN_42480 + + + +/****************************************************************************** + * Enhancements + *****************************************************************************/ + + + +#endif /* _RGXCORE_KM_1_76_4_6_H_ */ diff --git a/drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_1.81.4.15.h b/drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_1.81.4.15.h new file mode 100644 index 000000000000..c285483b222c --- /dev/null +++ b/drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_1.81.4.15.h @@ -0,0 +1,72 @@ +/*************************************************************************/ /*! +@Title RGX Core BVNC 1.81.4.15 +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef _RGXCORE_KM_1_81_4_15_H_ +#define _RGXCORE_KM_1_81_4_15_H_ + +/***** Automatically generated file (3/4/2015 2:27:36 PM): Do not edit manually ********************/ +/***** Timestamp: (3/4/2015 2:27:36 PM)************************************************************/ +/***** CS: @2373516 ******************************************************************/ + + +/****************************************************************************** + * BVNC = 1.81.4.15 + *****************************************************************************/ +#define RGX_BVNC_KM_B 1 +#define RGX_BVNC_KM_V 81 +#define RGX_BVNC_KM_N 4 +#define RGX_BVNC_KM_C 15 + +/****************************************************************************** + * Errata + *****************************************************************************/ + +#define FIX_HW_BRN_38344 + + + +/****************************************************************************** + * Enhancements + *****************************************************************************/ + + + +#endif /* _RGXCORE_KM_1_81_4_15_H_ */ diff --git a/drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_1.82.4.5.h b/drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_1.82.4.5.h new file mode 100644 index 000000000000..5254ea8fd3cd --- /dev/null +++ b/drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_1.82.4.5.h @@ -0,0 +1,71 @@ +/*************************************************************************/ /*! +@Title RGX Core BVNC 1.82.4.5 +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef _RGXCORE_KM_1_82_4_5_H_ +#define _RGXCORE_KM_1_82_4_5_H_ + +/***** Automatically generated file (3/4/2015 2:27:34 PM): Do not edit manually ********************/ +/***** Timestamp: (3/4/2015 2:27:34 PM)************************************************************/ +/***** CS: @2503111 ******************************************************************/ + + +/****************************************************************************** + * BVNC = 1.82.4.5 + *****************************************************************************/ +#define RGX_BVNC_KM_B 1 +#define RGX_BVNC_KM_V 82 +#define RGX_BVNC_KM_N 4 +#define RGX_BVNC_KM_C 5 + +/****************************************************************************** + * Errata + *****************************************************************************/ + + + + +/****************************************************************************** + * Enhancements + *****************************************************************************/ + + + +#endif /* _RGXCORE_KM_1_82_4_5_H_ */ diff --git a/drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_12.5.1.20.h b/drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_12.5.1.20.h new file mode 100644 index 000000000000..79d82e15108a --- /dev/null +++ b/drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_12.5.1.20.h @@ -0,0 +1,71 @@ +/*************************************************************************/ /*! +@Title RGX Core BVNC 12.5.1.20 +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef _RGXCORE_KM_12_5_1_20_H_ +#define _RGXCORE_KM_12_5_1_20_H_ + +/***** Automatically generated file (4/27/2015 2:03:36 PM): Do not edit manually ********************/ +/***** Timestamp: (4/27/2015 2:03:36 PM)************************************************************/ +/***** CS: @3146507 ******************************************************************/ + + +/****************************************************************************** + * BVNC = 12.5.1.20 + *****************************************************************************/ +#define RGX_BVNC_KM_B 12 +#define RGX_BVNC_KM_V 5 +#define RGX_BVNC_KM_N 1 +#define RGX_BVNC_KM_C 20 + +/****************************************************************************** + * Errata + *****************************************************************************/ + + + + +/****************************************************************************** + * Enhancements + *****************************************************************************/ + + + +#endif /* _RGXCORE_KM_12_5_1_20_H_ */ diff --git a/drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_4.29.2.51.h b/drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_4.29.2.51.h new file mode 100644 index 000000000000..404004d1585b --- /dev/null +++ b/drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_4.29.2.51.h @@ -0,0 +1,72 @@ +/*************************************************************************/ /*! +@Title RGX Core BVNC 4.29.2.51 +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef _RGXCORE_KM_4_29_2_51_H_ +#define _RGXCORE_KM_4_29_2_51_H_ + +/***** Automatically generated file (3/2/2015 6:26:08 PM): Do not edit manually ********************/ +/***** Timestamp: (3/2/2015 6:26:08 PM)************************************************************/ +/***** CS: @2944502 ******************************************************************/ + + +/****************************************************************************** + * BVNC = 4.29.2.51 + *****************************************************************************/ +#define RGX_BVNC_KM_B 4 +#define RGX_BVNC_KM_V 29 +#define RGX_BVNC_KM_N 2 +#define RGX_BVNC_KM_C 51 + +/****************************************************************************** + * Errata + *****************************************************************************/ + +#define FIX_HW_BRN_57193 + + + +/****************************************************************************** + * Enhancements + *****************************************************************************/ + + + +#endif /* _RGXCORE_KM_4_29_2_51_H_ */ diff --git a/drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_4.32.2.52.h b/drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_4.32.2.52.h new file mode 100644 index 000000000000..2c396dc94d5c --- /dev/null +++ b/drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_4.32.2.52.h @@ -0,0 +1,72 @@ +/*************************************************************************/ /*! +@Title RGX Core BVNC 4.32.2.52 +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef _RGXCORE_KM_4_32_2_52_H_ +#define _RGXCORE_KM_4_32_2_52_H_ + +/***** Automatically generated file (3/2/2015 6:26:04 PM): Do not edit manually ********************/ +/***** Timestamp: (3/2/2015 6:26:04 PM)************************************************************/ +/***** CS: @2966609 ******************************************************************/ + + +/****************************************************************************** + * BVNC = 4.32.2.52 + *****************************************************************************/ +#define RGX_BVNC_KM_B 4 +#define RGX_BVNC_KM_V 32 +#define RGX_BVNC_KM_N 2 +#define RGX_BVNC_KM_C 52 + +/****************************************************************************** + * Errata + *****************************************************************************/ + +#define FIX_HW_BRN_57193 + + + +/****************************************************************************** + * Enhancements + *****************************************************************************/ + + + +#endif /* _RGXCORE_KM_4_32_2_52_H_ */ diff --git a/drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_4.40.2.51.h b/drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_4.40.2.51.h new file mode 100644 index 000000000000..98348b224c16 --- /dev/null +++ b/drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_4.40.2.51.h @@ -0,0 +1,72 @@ +/*************************************************************************/ /*! +@Title RGX Core BVNC 4.40.2.51 +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef _RGXCORE_KM_4_40_2_51_H_ +#define _RGXCORE_KM_4_40_2_51_H_ + +/***** Automatically generated file (3/2/2015 6:26:02 PM): Do not edit manually ********************/ +/***** Timestamp: (3/2/2015 6:26:02 PM)************************************************************/ +/***** CS: @3254374 ******************************************************************/ + + +/****************************************************************************** + * BVNC = 4.40.2.51 + *****************************************************************************/ +#define RGX_BVNC_KM_B 4 +#define RGX_BVNC_KM_V 40 +#define RGX_BVNC_KM_N 2 +#define RGX_BVNC_KM_C 51 + +/****************************************************************************** + * Errata + *****************************************************************************/ + +#define FIX_HW_BRN_57193 + + + +/****************************************************************************** + * Enhancements + *****************************************************************************/ + + + +#endif /* _RGXCORE_KM_4_40_2_51_H_ */ diff --git a/drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_4.41.2.57.h b/drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_4.41.2.57.h new file mode 100644 index 000000000000..f9b8c3fdab16 --- /dev/null +++ b/drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_4.41.2.57.h @@ -0,0 +1,72 @@ +/*************************************************************************/ /*! +@Title RGX Core BVNC 4.41.2.57 +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef _RGXCORE_KM_4_41_2_57_H_ +#define _RGXCORE_KM_4_41_2_57_H_ + +/***** Automatically generated file (3/2/2015 6:26:02 PM): Do not edit manually ********************/ +/***** Timestamp: (3/2/2015 6:26:02 PM)************************************************************/ +/***** CS: @3254338 ******************************************************************/ + + +/****************************************************************************** + * BVNC = 4.41.2.57 + *****************************************************************************/ +#define RGX_BVNC_KM_B 4 +#define RGX_BVNC_KM_V 41 +#define RGX_BVNC_KM_N 2 +#define RGX_BVNC_KM_C 57 + +/****************************************************************************** + * Errata + *****************************************************************************/ + +#define FIX_HW_BRN_57193 + + + +/****************************************************************************** + * Enhancements + *****************************************************************************/ + + + +#endif /* _RGXCORE_KM_4_41_2_57_H_ */ diff --git a/drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_4.42.4.53.h b/drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_4.42.4.53.h new file mode 100644 index 000000000000..6e9ded968827 --- /dev/null +++ b/drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_4.42.4.53.h @@ -0,0 +1,72 @@ +/*************************************************************************/ /*! +@Title RGX Core BVNC 4.42.4.53 +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef _RGXCORE_KM_4_42_4_53_H_ +#define _RGXCORE_KM_4_42_4_53_H_ + +/***** Automatically generated file (3/2/2015 6:26:02 PM): Do not edit manually ********************/ +/***** Timestamp: (3/2/2015 6:26:02 PM)************************************************************/ +/***** CS: @3250390 ******************************************************************/ + + +/****************************************************************************** + * BVNC = 4.42.4.53 + *****************************************************************************/ +#define RGX_BVNC_KM_B 4 +#define RGX_BVNC_KM_V 42 +#define RGX_BVNC_KM_N 4 +#define RGX_BVNC_KM_C 53 + +/****************************************************************************** + * Errata + *****************************************************************************/ + +#define FIX_HW_BRN_57193 + + + +/****************************************************************************** + * Enhancements + *****************************************************************************/ + + + +#endif /* _RGXCORE_KM_4_42_4_53_H_ */ diff --git a/drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_4.43.6.62.h b/drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_4.43.6.62.h new file mode 100644 index 000000000000..5bfa76a4c1a7 --- /dev/null +++ b/drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_4.43.6.62.h @@ -0,0 +1,72 @@ +/*************************************************************************/ /*! +@Title RGX Core BVNC 4.43.6.62 +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef _RGXCORE_KM_4_43_6_62_H_ +#define _RGXCORE_KM_4_43_6_62_H_ + +/***** Automatically generated file (3/2/2015 6:26:02 PM): Do not edit manually ********************/ +/***** Timestamp: (3/2/2015 6:26:02 PM)************************************************************/ +/***** CS: @3253129 ******************************************************************/ + + +/****************************************************************************** + * BVNC = 4.43.6.62 + *****************************************************************************/ +#define RGX_BVNC_KM_B 4 +#define RGX_BVNC_KM_V 43 +#define RGX_BVNC_KM_N 6 +#define RGX_BVNC_KM_C 62 + +/****************************************************************************** + * Errata + *****************************************************************************/ + +#define FIX_HW_BRN_57193 + + + +/****************************************************************************** + * Enhancements + *****************************************************************************/ + + + +#endif /* _RGXCORE_KM_4_43_6_62_H_ */ diff --git a/drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_4.45.2.58.h b/drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_4.45.2.58.h new file mode 100644 index 000000000000..66eb624a471b --- /dev/null +++ b/drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_4.45.2.58.h @@ -0,0 +1,72 @@ +/*************************************************************************/ /*! +@Title RGX Core BVNC 4.45.2.58 +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef _RGXCORE_KM_4_45_2_58_H_ +#define _RGXCORE_KM_4_45_2_58_H_ + +/***** Automatically generated file (3/23/2015 2:49:16 PM): Do not edit manually ********************/ +/***** Timestamp: (3/23/2015 2:49:16 PM)************************************************************/ +/***** CS: @3478233 ******************************************************************/ + + +/****************************************************************************** + * BVNC = 4.45.2.58 + *****************************************************************************/ +#define RGX_BVNC_KM_B 4 +#define RGX_BVNC_KM_V 45 +#define RGX_BVNC_KM_N 2 +#define RGX_BVNC_KM_C 58 + +/****************************************************************************** + * Errata + *****************************************************************************/ + +#define FIX_HW_BRN_57193 + + + +/****************************************************************************** + * Enhancements + *****************************************************************************/ + + + +#endif /* _RGXCORE_KM_4_45_2_58_H_ */ diff --git a/drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_5.11.1.46.h b/drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_5.11.1.46.h new file mode 100644 index 000000000000..ef2165512fba --- /dev/null +++ b/drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_5.11.1.46.h @@ -0,0 +1,72 @@ +/*************************************************************************/ /*! +@Title RGX Core BVNC 5.11.1.46 +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef _RGXCORE_KM_5_11_1_46_H_ +#define _RGXCORE_KM_5_11_1_46_H_ + +/***** Automatically generated file (4/2/2015 11:53:03 AM): Do not edit manually ********************/ +/***** Timestamp: (4/2/2015 11:53:03 AM)************************************************************/ +/***** CS: @3485232 ******************************************************************/ + + +/****************************************************************************** + * BVNC = 5.11.1.46 + *****************************************************************************/ +#define RGX_BVNC_KM_B 5 +#define RGX_BVNC_KM_V 11 +#define RGX_BVNC_KM_N 1 +#define RGX_BVNC_KM_C 46 + +/****************************************************************************** + * Errata + *****************************************************************************/ + +#define FIX_HW_BRN_42480 + + + +/****************************************************************************** + * Enhancements + *****************************************************************************/ + + + +#endif /* _RGXCORE_KM_5_11_1_46_H_ */ diff --git a/drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_5.9.1.46.h b/drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_5.9.1.46.h new file mode 100644 index 000000000000..9105e8c4b959 --- /dev/null +++ b/drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_5.9.1.46.h @@ -0,0 +1,72 @@ +/*************************************************************************/ /*! +@Title RGX Core BVNC 5.9.1.46 +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef _RGXCORE_KM_5_9_1_46_H_ +#define _RGXCORE_KM_5_9_1_46_H_ + +/***** Automatically generated file (3/4/2015 2:27:37 PM): Do not edit manually ********************/ +/***** Timestamp: (3/4/2015 2:27:37 PM)************************************************************/ +/***** CS: @2967148 ******************************************************************/ + + +/****************************************************************************** + * BVNC = 5.9.1.46 + *****************************************************************************/ +#define RGX_BVNC_KM_B 5 +#define RGX_BVNC_KM_V 9 +#define RGX_BVNC_KM_N 1 +#define RGX_BVNC_KM_C 46 + +/****************************************************************************** + * Errata + *****************************************************************************/ + +#define FIX_HW_BRN_38344 + + + +/****************************************************************************** + * Enhancements + *****************************************************************************/ + + + +#endif /* _RGXCORE_KM_5_9_1_46_H_ */ diff --git a/drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_8.21.2.34.h b/drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_8.21.2.34.h new file mode 100644 index 000000000000..11fb9bc7d80a --- /dev/null +++ b/drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_8.21.2.34.h @@ -0,0 +1,72 @@ +/*************************************************************************/ /*! +@Title RGX Core BVNC 8.21.2.34 +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef _RGXCORE_KM_8_21_2_34_H_ +#define _RGXCORE_KM_8_21_2_34_H_ + +/***** Automatically generated file (21/04/2015 18:47:55): Do not edit manually ********************/ +/***** Timestamp: (21/04/2015 18:47:55)************************************************************/ +/***** CS: @3480967 ******************************************************************/ + + +/****************************************************************************** + * BVNC = 8.21.2.34 + *****************************************************************************/ +#define RGX_BVNC_KM_B 8 +#define RGX_BVNC_KM_V 21 +#define RGX_BVNC_KM_N 2 +#define RGX_BVNC_KM_C 34 + +/****************************************************************************** + * Errata + *****************************************************************************/ + + + + +/****************************************************************************** + * Enhancements + *****************************************************************************/ +#define HW_ERN_45914 + + + +#endif /* _RGXCORE_KM_8_21_2_34_H_ */ diff --git a/drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_8.41.4.38.h b/drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_8.41.4.38.h new file mode 100644 index 000000000000..5d26a7fac8c1 --- /dev/null +++ b/drivers/gpu/rogue_m/hwdefs/km/cores/rgxcore_km_8.41.4.38.h @@ -0,0 +1,72 @@ +/*************************************************************************/ /*! +@Title RGX Core BVNC 8.41.4.38 +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef _RGXCORE_KM_8_41_4_38_H_ +#define _RGXCORE_KM_8_41_4_38_H_ + +/***** Automatically generated file (5/12/2015 5:46:10 AM): Do not edit manually ********************/ +/***** Timestamp: (5/12/2015 5:46:10 AM)************************************************************/ +/***** CS: @3498807 ******************************************************************/ + + +/****************************************************************************** + * BVNC = 8.41.4.38 + *****************************************************************************/ +#define RGX_BVNC_KM_B 8 +#define RGX_BVNC_KM_V 41 +#define RGX_BVNC_KM_N 4 +#define RGX_BVNC_KM_C 38 + +/****************************************************************************** + * Errata + *****************************************************************************/ + + + + +/****************************************************************************** + * Enhancements + *****************************************************************************/ +#define HW_ERN_45914 + + + +#endif /* _RGXCORE_KM_8_41_4_38_H_ */ diff --git a/drivers/gpu/rogue_m/hwdefs/km/rgx_cr_defs_km.h b/drivers/gpu/rogue_m/hwdefs/km/rgx_cr_defs_km.h new file mode 100644 index 000000000000..6b0c40378b26 --- /dev/null +++ b/drivers/gpu/rogue_m/hwdefs/km/rgx_cr_defs_km.h @@ -0,0 +1,3836 @@ +/*************************************************************************/ /*! +@Title Hardware definition file rgx_cr_defs_km.h +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +/* **** Autogenerated C -- do not edit **** */ + +/* + * Generated by regconv version MAIN@3250555 + * from files: + */ + +#if !defined(__IMG_EXPLICIT_INCLUDE_HWDEFS) +#error This file may only be included if explicitly defined +#endif + +#ifndef _RGX_CR_DEFS_KM_H_ +#define _RGX_CR_DEFS_KM_H_ + +#include "img_types.h" + +#if defined(RGX_FEATURE_S7_TOP_INFRASTRUCTURE) +/* + Register RGX_CR_CLK_CTRL +*/ +#define RGX_CR_CLK_CTRL (0x0000U) +#define RGX_CR_CLK_CTRL_MASKFULL (IMG_UINT64_C(0xFFFFC3003F3F3F0F)) +#if defined(RGX_FEATURE_CLUSTER_GROUPING) +#define RGX_CR_CLK_CTRL_BIF_TEXAS_SHIFT (62U) +#define RGX_CR_CLK_CTRL_BIF_TEXAS_CLRMSK (IMG_UINT64_C(0X3FFFFFFFFFFFFFFF)) +#define RGX_CR_CLK_CTRL_BIF_TEXAS_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_CTRL_BIF_TEXAS_ON (IMG_UINT64_C(0x4000000000000000)) +#define RGX_CR_CLK_CTRL_BIF_TEXAS_AUTO (IMG_UINT64_C(0x8000000000000000)) +#define RGX_CR_CLK_CTRL_IPP_SHIFT (60U) +#define RGX_CR_CLK_CTRL_IPP_CLRMSK (IMG_UINT64_C(0XCFFFFFFFFFFFFFFF)) +#define RGX_CR_CLK_CTRL_IPP_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_CTRL_IPP_ON (IMG_UINT64_C(0x1000000000000000)) +#define RGX_CR_CLK_CTRL_IPP_AUTO (IMG_UINT64_C(0x2000000000000000)) +#endif /* RGX_FEATURE_CLUSTER_GROUPING */ + +#define RGX_CR_CLK_CTRL_FBC_SHIFT (58U) +#define RGX_CR_CLK_CTRL_FBC_CLRMSK (IMG_UINT64_C(0XF3FFFFFFFFFFFFFF)) +#define RGX_CR_CLK_CTRL_FBC_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_CTRL_FBC_ON (IMG_UINT64_C(0x0400000000000000)) +#define RGX_CR_CLK_CTRL_FBC_AUTO (IMG_UINT64_C(0x0800000000000000)) +#define RGX_CR_CLK_CTRL_FBDC_SHIFT (56U) +#define RGX_CR_CLK_CTRL_FBDC_CLRMSK (IMG_UINT64_C(0XFCFFFFFFFFFFFFFF)) +#define RGX_CR_CLK_CTRL_FBDC_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_CTRL_FBDC_ON (IMG_UINT64_C(0x0100000000000000)) +#define RGX_CR_CLK_CTRL_FBDC_AUTO (IMG_UINT64_C(0x0200000000000000)) +#define RGX_CR_CLK_CTRL_FB_TLCACHE_SHIFT (54U) +#define RGX_CR_CLK_CTRL_FB_TLCACHE_CLRMSK (IMG_UINT64_C(0XFF3FFFFFFFFFFFFF)) +#define RGX_CR_CLK_CTRL_FB_TLCACHE_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_CTRL_FB_TLCACHE_ON (IMG_UINT64_C(0x0040000000000000)) +#define RGX_CR_CLK_CTRL_FB_TLCACHE_AUTO (IMG_UINT64_C(0x0080000000000000)) +#define RGX_CR_CLK_CTRL_USCS_SHIFT (52U) +#define RGX_CR_CLK_CTRL_USCS_CLRMSK (IMG_UINT64_C(0XFFCFFFFFFFFFFFFF)) +#define RGX_CR_CLK_CTRL_USCS_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_CTRL_USCS_ON (IMG_UINT64_C(0x0010000000000000)) +#define RGX_CR_CLK_CTRL_USCS_AUTO (IMG_UINT64_C(0x0020000000000000)) +#define RGX_CR_CLK_CTRL_PBE_SHIFT (50U) +#define RGX_CR_CLK_CTRL_PBE_CLRMSK (IMG_UINT64_C(0XFFF3FFFFFFFFFFFF)) +#define RGX_CR_CLK_CTRL_PBE_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_CTRL_PBE_ON (IMG_UINT64_C(0x0004000000000000)) +#define RGX_CR_CLK_CTRL_PBE_AUTO (IMG_UINT64_C(0x0008000000000000)) +#define RGX_CR_CLK_CTRL_MCU_L1_SHIFT (48U) +#define RGX_CR_CLK_CTRL_MCU_L1_CLRMSK (IMG_UINT64_C(0XFFFCFFFFFFFFFFFF)) +#define RGX_CR_CLK_CTRL_MCU_L1_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_CTRL_MCU_L1_ON (IMG_UINT64_C(0x0001000000000000)) +#define RGX_CR_CLK_CTRL_MCU_L1_AUTO (IMG_UINT64_C(0x0002000000000000)) +#define RGX_CR_CLK_CTRL_CDM_SHIFT (46U) +#define RGX_CR_CLK_CTRL_CDM_CLRMSK (IMG_UINT64_C(0XFFFF3FFFFFFFFFFF)) +#define RGX_CR_CLK_CTRL_CDM_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_CTRL_CDM_ON (IMG_UINT64_C(0x0000400000000000)) +#define RGX_CR_CLK_CTRL_CDM_AUTO (IMG_UINT64_C(0x0000800000000000)) +#define RGX_CR_CLK_CTRL_BIF_SHIFT (40U) +#define RGX_CR_CLK_CTRL_BIF_CLRMSK (IMG_UINT64_C(0XFFFFFCFFFFFFFFFF)) +#define RGX_CR_CLK_CTRL_BIF_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_CTRL_BIF_ON (IMG_UINT64_C(0x0000010000000000)) +#define RGX_CR_CLK_CTRL_BIF_AUTO (IMG_UINT64_C(0x0000020000000000)) +#define RGX_CR_CLK_CTRL_TPU_MCU_DEMUX_SHIFT (28U) +#define RGX_CR_CLK_CTRL_TPU_MCU_DEMUX_CLRMSK (IMG_UINT64_C(0XFFFFFFFFCFFFFFFF)) +#define RGX_CR_CLK_CTRL_TPU_MCU_DEMUX_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_CTRL_TPU_MCU_DEMUX_ON (IMG_UINT64_C(0x0000000010000000)) +#define RGX_CR_CLK_CTRL_TPU_MCU_DEMUX_AUTO (IMG_UINT64_C(0x0000000020000000)) +#define RGX_CR_CLK_CTRL_MCU_L0_SHIFT (26U) +#define RGX_CR_CLK_CTRL_MCU_L0_CLRMSK (IMG_UINT64_C(0XFFFFFFFFF3FFFFFF)) +#define RGX_CR_CLK_CTRL_MCU_L0_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_CTRL_MCU_L0_ON (IMG_UINT64_C(0x0000000004000000)) +#define RGX_CR_CLK_CTRL_MCU_L0_AUTO (IMG_UINT64_C(0x0000000008000000)) +#define RGX_CR_CLK_CTRL_TPU_SHIFT (24U) +#define RGX_CR_CLK_CTRL_TPU_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFCFFFFFF)) +#define RGX_CR_CLK_CTRL_TPU_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_CTRL_TPU_ON (IMG_UINT64_C(0x0000000001000000)) +#define RGX_CR_CLK_CTRL_TPU_AUTO (IMG_UINT64_C(0x0000000002000000)) +#define RGX_CR_CLK_CTRL_USC_SHIFT (20U) +#define RGX_CR_CLK_CTRL_USC_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFCFFFFF)) +#define RGX_CR_CLK_CTRL_USC_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_CTRL_USC_ON (IMG_UINT64_C(0x0000000000100000)) +#define RGX_CR_CLK_CTRL_USC_AUTO (IMG_UINT64_C(0x0000000000200000)) +#define RGX_CR_CLK_CTRL_TLA_SHIFT (18U) +#define RGX_CR_CLK_CTRL_TLA_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFF3FFFF)) +#define RGX_CR_CLK_CTRL_TLA_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_CTRL_TLA_ON (IMG_UINT64_C(0x0000000000040000)) +#define RGX_CR_CLK_CTRL_TLA_AUTO (IMG_UINT64_C(0x0000000000080000)) +#define RGX_CR_CLK_CTRL_SLC_SHIFT (16U) +#define RGX_CR_CLK_CTRL_SLC_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFCFFFF)) +#define RGX_CR_CLK_CTRL_SLC_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_CTRL_SLC_ON (IMG_UINT64_C(0x0000000000010000)) +#define RGX_CR_CLK_CTRL_SLC_AUTO (IMG_UINT64_C(0x0000000000020000)) +#define RGX_CR_CLK_CTRL_PDS_SHIFT (12U) +#define RGX_CR_CLK_CTRL_PDS_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFCFFF)) +#define RGX_CR_CLK_CTRL_PDS_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_CTRL_PDS_ON (IMG_UINT64_C(0x0000000000001000)) +#define RGX_CR_CLK_CTRL_PDS_AUTO (IMG_UINT64_C(0x0000000000002000)) +#define RGX_CR_CLK_CTRL_VDM_SHIFT (10U) +#define RGX_CR_CLK_CTRL_VDM_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFF3FF)) +#define RGX_CR_CLK_CTRL_VDM_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_CTRL_VDM_ON (IMG_UINT64_C(0x0000000000000400)) +#define RGX_CR_CLK_CTRL_VDM_AUTO (IMG_UINT64_C(0x0000000000000800)) +#define RGX_CR_CLK_CTRL_PM_SHIFT (8U) +#define RGX_CR_CLK_CTRL_PM_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFCFF)) +#define RGX_CR_CLK_CTRL_PM_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_CTRL_PM_ON (IMG_UINT64_C(0x0000000000000100)) +#define RGX_CR_CLK_CTRL_PM_AUTO (IMG_UINT64_C(0x0000000000000200)) +#define RGX_CR_CLK_CTRL_TSP_SHIFT (2U) +#define RGX_CR_CLK_CTRL_TSP_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFF3)) +#define RGX_CR_CLK_CTRL_TSP_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_CTRL_TSP_ON (IMG_UINT64_C(0x0000000000000004)) +#define RGX_CR_CLK_CTRL_TSP_AUTO (IMG_UINT64_C(0x0000000000000008)) +#define RGX_CR_CLK_CTRL_ISP_SHIFT (0U) +#define RGX_CR_CLK_CTRL_ISP_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFFC)) +#define RGX_CR_CLK_CTRL_ISP_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_CTRL_ISP_ON (IMG_UINT64_C(0x0000000000000001)) +#define RGX_CR_CLK_CTRL_ISP_AUTO (IMG_UINT64_C(0x0000000000000002)) +#endif /* RGX_FEATURE_S7_TOP_INFRASTRUCTURE */ + + +#if !defined(RGX_FEATURE_S7_TOP_INFRASTRUCTURE) +/* + Register RGX_CR_CLK_CTRL +*/ +#define RGX_CR_CLK_CTRL (0x0000U) +#define RGX_CR_CLK_CTRL_MASKFULL (IMG_UINT64_C(0xFFFFFF003F3FFFFF)) +#if defined(RGX_FEATURE_CLUSTER_GROUPING) +#define RGX_CR_CLK_CTRL_BIF_TEXAS_SHIFT (62U) +#define RGX_CR_CLK_CTRL_BIF_TEXAS_CLRMSK (IMG_UINT64_C(0X3FFFFFFFFFFFFFFF)) +#define RGX_CR_CLK_CTRL_BIF_TEXAS_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_CTRL_BIF_TEXAS_ON (IMG_UINT64_C(0x4000000000000000)) +#define RGX_CR_CLK_CTRL_BIF_TEXAS_AUTO (IMG_UINT64_C(0x8000000000000000)) +#define RGX_CR_CLK_CTRL_IPP_SHIFT (60U) +#define RGX_CR_CLK_CTRL_IPP_CLRMSK (IMG_UINT64_C(0XCFFFFFFFFFFFFFFF)) +#define RGX_CR_CLK_CTRL_IPP_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_CTRL_IPP_ON (IMG_UINT64_C(0x1000000000000000)) +#define RGX_CR_CLK_CTRL_IPP_AUTO (IMG_UINT64_C(0x2000000000000000)) +#endif /* RGX_FEATURE_CLUSTER_GROUPING */ + +#define RGX_CR_CLK_CTRL_FBC_SHIFT (58U) +#define RGX_CR_CLK_CTRL_FBC_CLRMSK (IMG_UINT64_C(0XF3FFFFFFFFFFFFFF)) +#define RGX_CR_CLK_CTRL_FBC_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_CTRL_FBC_ON (IMG_UINT64_C(0x0400000000000000)) +#define RGX_CR_CLK_CTRL_FBC_AUTO (IMG_UINT64_C(0x0800000000000000)) +#define RGX_CR_CLK_CTRL_FBDC_SHIFT (56U) +#define RGX_CR_CLK_CTRL_FBDC_CLRMSK (IMG_UINT64_C(0XFCFFFFFFFFFFFFFF)) +#define RGX_CR_CLK_CTRL_FBDC_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_CTRL_FBDC_ON (IMG_UINT64_C(0x0100000000000000)) +#define RGX_CR_CLK_CTRL_FBDC_AUTO (IMG_UINT64_C(0x0200000000000000)) +#define RGX_CR_CLK_CTRL_FB_TLCACHE_SHIFT (54U) +#define RGX_CR_CLK_CTRL_FB_TLCACHE_CLRMSK (IMG_UINT64_C(0XFF3FFFFFFFFFFFFF)) +#define RGX_CR_CLK_CTRL_FB_TLCACHE_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_CTRL_FB_TLCACHE_ON (IMG_UINT64_C(0x0040000000000000)) +#define RGX_CR_CLK_CTRL_FB_TLCACHE_AUTO (IMG_UINT64_C(0x0080000000000000)) +#define RGX_CR_CLK_CTRL_USCS_SHIFT (52U) +#define RGX_CR_CLK_CTRL_USCS_CLRMSK (IMG_UINT64_C(0XFFCFFFFFFFFFFFFF)) +#define RGX_CR_CLK_CTRL_USCS_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_CTRL_USCS_ON (IMG_UINT64_C(0x0010000000000000)) +#define RGX_CR_CLK_CTRL_USCS_AUTO (IMG_UINT64_C(0x0020000000000000)) +#define RGX_CR_CLK_CTRL_PBE_SHIFT (50U) +#define RGX_CR_CLK_CTRL_PBE_CLRMSK (IMG_UINT64_C(0XFFF3FFFFFFFFFFFF)) +#define RGX_CR_CLK_CTRL_PBE_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_CTRL_PBE_ON (IMG_UINT64_C(0x0004000000000000)) +#define RGX_CR_CLK_CTRL_PBE_AUTO (IMG_UINT64_C(0x0008000000000000)) +#define RGX_CR_CLK_CTRL_MCU_L1_SHIFT (48U) +#define RGX_CR_CLK_CTRL_MCU_L1_CLRMSK (IMG_UINT64_C(0XFFFCFFFFFFFFFFFF)) +#define RGX_CR_CLK_CTRL_MCU_L1_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_CTRL_MCU_L1_ON (IMG_UINT64_C(0x0001000000000000)) +#define RGX_CR_CLK_CTRL_MCU_L1_AUTO (IMG_UINT64_C(0x0002000000000000)) +#define RGX_CR_CLK_CTRL_CDM_SHIFT (46U) +#define RGX_CR_CLK_CTRL_CDM_CLRMSK (IMG_UINT64_C(0XFFFF3FFFFFFFFFFF)) +#define RGX_CR_CLK_CTRL_CDM_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_CTRL_CDM_ON (IMG_UINT64_C(0x0000400000000000)) +#define RGX_CR_CLK_CTRL_CDM_AUTO (IMG_UINT64_C(0x0000800000000000)) +#define RGX_CR_CLK_CTRL_SIDEKICK_SHIFT (44U) +#define RGX_CR_CLK_CTRL_SIDEKICK_CLRMSK (IMG_UINT64_C(0XFFFFCFFFFFFFFFFF)) +#define RGX_CR_CLK_CTRL_SIDEKICK_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_CTRL_SIDEKICK_ON (IMG_UINT64_C(0x0000100000000000)) +#define RGX_CR_CLK_CTRL_SIDEKICK_AUTO (IMG_UINT64_C(0x0000200000000000)) +#define RGX_CR_CLK_CTRL_BIF_SIDEKICK_SHIFT (42U) +#define RGX_CR_CLK_CTRL_BIF_SIDEKICK_CLRMSK (IMG_UINT64_C(0XFFFFF3FFFFFFFFFF)) +#define RGX_CR_CLK_CTRL_BIF_SIDEKICK_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_CTRL_BIF_SIDEKICK_ON (IMG_UINT64_C(0x0000040000000000)) +#define RGX_CR_CLK_CTRL_BIF_SIDEKICK_AUTO (IMG_UINT64_C(0x0000080000000000)) +#define RGX_CR_CLK_CTRL_BIF_SHIFT (40U) +#define RGX_CR_CLK_CTRL_BIF_CLRMSK (IMG_UINT64_C(0XFFFFFCFFFFFFFFFF)) +#define RGX_CR_CLK_CTRL_BIF_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_CTRL_BIF_ON (IMG_UINT64_C(0x0000010000000000)) +#define RGX_CR_CLK_CTRL_BIF_AUTO (IMG_UINT64_C(0x0000020000000000)) +#define RGX_CR_CLK_CTRL_TPU_MCU_DEMUX_SHIFT (28U) +#define RGX_CR_CLK_CTRL_TPU_MCU_DEMUX_CLRMSK (IMG_UINT64_C(0XFFFFFFFFCFFFFFFF)) +#define RGX_CR_CLK_CTRL_TPU_MCU_DEMUX_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_CTRL_TPU_MCU_DEMUX_ON (IMG_UINT64_C(0x0000000010000000)) +#define RGX_CR_CLK_CTRL_TPU_MCU_DEMUX_AUTO (IMG_UINT64_C(0x0000000020000000)) +#define RGX_CR_CLK_CTRL_MCU_L0_SHIFT (26U) +#define RGX_CR_CLK_CTRL_MCU_L0_CLRMSK (IMG_UINT64_C(0XFFFFFFFFF3FFFFFF)) +#define RGX_CR_CLK_CTRL_MCU_L0_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_CTRL_MCU_L0_ON (IMG_UINT64_C(0x0000000004000000)) +#define RGX_CR_CLK_CTRL_MCU_L0_AUTO (IMG_UINT64_C(0x0000000008000000)) +#define RGX_CR_CLK_CTRL_TPU_SHIFT (24U) +#define RGX_CR_CLK_CTRL_TPU_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFCFFFFFF)) +#define RGX_CR_CLK_CTRL_TPU_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_CTRL_TPU_ON (IMG_UINT64_C(0x0000000001000000)) +#define RGX_CR_CLK_CTRL_TPU_AUTO (IMG_UINT64_C(0x0000000002000000)) +#define RGX_CR_CLK_CTRL_USC_SHIFT (20U) +#define RGX_CR_CLK_CTRL_USC_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFCFFFFF)) +#define RGX_CR_CLK_CTRL_USC_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_CTRL_USC_ON (IMG_UINT64_C(0x0000000000100000)) +#define RGX_CR_CLK_CTRL_USC_AUTO (IMG_UINT64_C(0x0000000000200000)) +#define RGX_CR_CLK_CTRL_TLA_SHIFT (18U) +#define RGX_CR_CLK_CTRL_TLA_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFF3FFFF)) +#define RGX_CR_CLK_CTRL_TLA_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_CTRL_TLA_ON (IMG_UINT64_C(0x0000000000040000)) +#define RGX_CR_CLK_CTRL_TLA_AUTO (IMG_UINT64_C(0x0000000000080000)) +#define RGX_CR_CLK_CTRL_SLC_SHIFT (16U) +#define RGX_CR_CLK_CTRL_SLC_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFCFFFF)) +#define RGX_CR_CLK_CTRL_SLC_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_CTRL_SLC_ON (IMG_UINT64_C(0x0000000000010000)) +#define RGX_CR_CLK_CTRL_SLC_AUTO (IMG_UINT64_C(0x0000000000020000)) +#define RGX_CR_CLK_CTRL_UVS_SHIFT (14U) +#define RGX_CR_CLK_CTRL_UVS_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFF3FFF)) +#define RGX_CR_CLK_CTRL_UVS_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_CTRL_UVS_ON (IMG_UINT64_C(0x0000000000004000)) +#define RGX_CR_CLK_CTRL_UVS_AUTO (IMG_UINT64_C(0x0000000000008000)) +#define RGX_CR_CLK_CTRL_PDS_SHIFT (12U) +#define RGX_CR_CLK_CTRL_PDS_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFCFFF)) +#define RGX_CR_CLK_CTRL_PDS_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_CTRL_PDS_ON (IMG_UINT64_C(0x0000000000001000)) +#define RGX_CR_CLK_CTRL_PDS_AUTO (IMG_UINT64_C(0x0000000000002000)) +#define RGX_CR_CLK_CTRL_VDM_SHIFT (10U) +#define RGX_CR_CLK_CTRL_VDM_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFF3FF)) +#define RGX_CR_CLK_CTRL_VDM_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_CTRL_VDM_ON (IMG_UINT64_C(0x0000000000000400)) +#define RGX_CR_CLK_CTRL_VDM_AUTO (IMG_UINT64_C(0x0000000000000800)) +#define RGX_CR_CLK_CTRL_PM_SHIFT (8U) +#define RGX_CR_CLK_CTRL_PM_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFCFF)) +#define RGX_CR_CLK_CTRL_PM_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_CTRL_PM_ON (IMG_UINT64_C(0x0000000000000100)) +#define RGX_CR_CLK_CTRL_PM_AUTO (IMG_UINT64_C(0x0000000000000200)) +#define RGX_CR_CLK_CTRL_GPP_SHIFT (6U) +#define RGX_CR_CLK_CTRL_GPP_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFF3F)) +#define RGX_CR_CLK_CTRL_GPP_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_CTRL_GPP_ON (IMG_UINT64_C(0x0000000000000040)) +#define RGX_CR_CLK_CTRL_GPP_AUTO (IMG_UINT64_C(0x0000000000000080)) +#define RGX_CR_CLK_CTRL_TE_SHIFT (4U) +#define RGX_CR_CLK_CTRL_TE_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFCF)) +#define RGX_CR_CLK_CTRL_TE_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_CTRL_TE_ON (IMG_UINT64_C(0x0000000000000010)) +#define RGX_CR_CLK_CTRL_TE_AUTO (IMG_UINT64_C(0x0000000000000020)) +#define RGX_CR_CLK_CTRL_TSP_SHIFT (2U) +#define RGX_CR_CLK_CTRL_TSP_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFF3)) +#define RGX_CR_CLK_CTRL_TSP_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_CTRL_TSP_ON (IMG_UINT64_C(0x0000000000000004)) +#define RGX_CR_CLK_CTRL_TSP_AUTO (IMG_UINT64_C(0x0000000000000008)) +#define RGX_CR_CLK_CTRL_ISP_SHIFT (0U) +#define RGX_CR_CLK_CTRL_ISP_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFFC)) +#define RGX_CR_CLK_CTRL_ISP_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_CTRL_ISP_ON (IMG_UINT64_C(0x0000000000000001)) +#define RGX_CR_CLK_CTRL_ISP_AUTO (IMG_UINT64_C(0x0000000000000002)) +#endif /* !defined(RGX_FEATURE_S7_TOP_INFRASTRUCTURE) */ + + +#if defined(RGX_FEATURE_S7_TOP_INFRASTRUCTURE) +/* + Register RGX_CR_CLK_STATUS +*/ +#define RGX_CR_CLK_STATUS (0x0008U) +#define RGX_CR_CLK_STATUS_MASKFULL (IMG_UINT64_C(0x00000001FF907773)) +#define RGX_CR_CLK_STATUS_MCU_FBTC_SHIFT (32U) +#define RGX_CR_CLK_STATUS_MCU_FBTC_CLRMSK (IMG_UINT64_C(0XFFFFFFFEFFFFFFFF)) +#define RGX_CR_CLK_STATUS_MCU_FBTC_GATED (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_STATUS_MCU_FBTC_RUNNING (IMG_UINT64_C(0x0000000100000000)) +#if defined(RGX_FEATURE_CLUSTER_GROUPING) +#define RGX_CR_CLK_STATUS_BIF_TEXAS_SHIFT (31U) +#define RGX_CR_CLK_STATUS_BIF_TEXAS_CLRMSK (IMG_UINT64_C(0XFFFFFFFF7FFFFFFF)) +#define RGX_CR_CLK_STATUS_BIF_TEXAS_GATED (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_STATUS_BIF_TEXAS_RUNNING (IMG_UINT64_C(0x0000000080000000)) +#define RGX_CR_CLK_STATUS_IPP_SHIFT (30U) +#define RGX_CR_CLK_STATUS_IPP_CLRMSK (IMG_UINT64_C(0XFFFFFFFFBFFFFFFF)) +#define RGX_CR_CLK_STATUS_IPP_GATED (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_STATUS_IPP_RUNNING (IMG_UINT64_C(0x0000000040000000)) +#endif /* RGX_FEATURE_CLUSTER_GROUPING */ + +#define RGX_CR_CLK_STATUS_FBC_SHIFT (29U) +#define RGX_CR_CLK_STATUS_FBC_CLRMSK (IMG_UINT64_C(0XFFFFFFFFDFFFFFFF)) +#define RGX_CR_CLK_STATUS_FBC_GATED (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_STATUS_FBC_RUNNING (IMG_UINT64_C(0x0000000020000000)) +#define RGX_CR_CLK_STATUS_FBDC_SHIFT (28U) +#define RGX_CR_CLK_STATUS_FBDC_CLRMSK (IMG_UINT64_C(0XFFFFFFFFEFFFFFFF)) +#define RGX_CR_CLK_STATUS_FBDC_GATED (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_STATUS_FBDC_RUNNING (IMG_UINT64_C(0x0000000010000000)) +#define RGX_CR_CLK_STATUS_FB_TLCACHE_SHIFT (27U) +#define RGX_CR_CLK_STATUS_FB_TLCACHE_CLRMSK (IMG_UINT64_C(0XFFFFFFFFF7FFFFFF)) +#define RGX_CR_CLK_STATUS_FB_TLCACHE_GATED (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_STATUS_FB_TLCACHE_RUNNING (IMG_UINT64_C(0x0000000008000000)) +#define RGX_CR_CLK_STATUS_USCS_SHIFT (26U) +#define RGX_CR_CLK_STATUS_USCS_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFBFFFFFF)) +#define RGX_CR_CLK_STATUS_USCS_GATED (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_STATUS_USCS_RUNNING (IMG_UINT64_C(0x0000000004000000)) +#define RGX_CR_CLK_STATUS_PBE_SHIFT (25U) +#define RGX_CR_CLK_STATUS_PBE_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFDFFFFFF)) +#define RGX_CR_CLK_STATUS_PBE_GATED (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_STATUS_PBE_RUNNING (IMG_UINT64_C(0x0000000002000000)) +#define RGX_CR_CLK_STATUS_MCU_L1_SHIFT (24U) +#define RGX_CR_CLK_STATUS_MCU_L1_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFEFFFFFF)) +#define RGX_CR_CLK_STATUS_MCU_L1_GATED (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_STATUS_MCU_L1_RUNNING (IMG_UINT64_C(0x0000000001000000)) +#define RGX_CR_CLK_STATUS_CDM_SHIFT (23U) +#define RGX_CR_CLK_STATUS_CDM_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFF7FFFFF)) +#define RGX_CR_CLK_STATUS_CDM_GATED (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_STATUS_CDM_RUNNING (IMG_UINT64_C(0x0000000000800000)) +#define RGX_CR_CLK_STATUS_BIF_SHIFT (20U) +#define RGX_CR_CLK_STATUS_BIF_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFEFFFFF)) +#define RGX_CR_CLK_STATUS_BIF_GATED (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_STATUS_BIF_RUNNING (IMG_UINT64_C(0x0000000000100000)) +#define RGX_CR_CLK_STATUS_TPU_MCU_DEMUX_SHIFT (14U) +#define RGX_CR_CLK_STATUS_TPU_MCU_DEMUX_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFBFFF)) +#define RGX_CR_CLK_STATUS_TPU_MCU_DEMUX_GATED (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_STATUS_TPU_MCU_DEMUX_RUNNING (IMG_UINT64_C(0x0000000000004000)) +#define RGX_CR_CLK_STATUS_MCU_L0_SHIFT (13U) +#define RGX_CR_CLK_STATUS_MCU_L0_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFDFFF)) +#define RGX_CR_CLK_STATUS_MCU_L0_GATED (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_STATUS_MCU_L0_RUNNING (IMG_UINT64_C(0x0000000000002000)) +#define RGX_CR_CLK_STATUS_TPU_SHIFT (12U) +#define RGX_CR_CLK_STATUS_TPU_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFEFFF)) +#define RGX_CR_CLK_STATUS_TPU_GATED (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_STATUS_TPU_RUNNING (IMG_UINT64_C(0x0000000000001000)) +#define RGX_CR_CLK_STATUS_USC_SHIFT (10U) +#define RGX_CR_CLK_STATUS_USC_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFBFF)) +#define RGX_CR_CLK_STATUS_USC_GATED (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_STATUS_USC_RUNNING (IMG_UINT64_C(0x0000000000000400)) +#define RGX_CR_CLK_STATUS_TLA_SHIFT (9U) +#define RGX_CR_CLK_STATUS_TLA_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFDFF)) +#define RGX_CR_CLK_STATUS_TLA_GATED (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_STATUS_TLA_RUNNING (IMG_UINT64_C(0x0000000000000200)) +#define RGX_CR_CLK_STATUS_SLC_SHIFT (8U) +#define RGX_CR_CLK_STATUS_SLC_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFEFF)) +#define RGX_CR_CLK_STATUS_SLC_GATED (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_STATUS_SLC_RUNNING (IMG_UINT64_C(0x0000000000000100)) +#define RGX_CR_CLK_STATUS_PDS_SHIFT (6U) +#define RGX_CR_CLK_STATUS_PDS_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFBF)) +#define RGX_CR_CLK_STATUS_PDS_GATED (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_STATUS_PDS_RUNNING (IMG_UINT64_C(0x0000000000000040)) +#define RGX_CR_CLK_STATUS_VDM_SHIFT (5U) +#define RGX_CR_CLK_STATUS_VDM_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFDF)) +#define RGX_CR_CLK_STATUS_VDM_GATED (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_STATUS_VDM_RUNNING (IMG_UINT64_C(0x0000000000000020)) +#define RGX_CR_CLK_STATUS_PM_SHIFT (4U) +#define RGX_CR_CLK_STATUS_PM_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFEF)) +#define RGX_CR_CLK_STATUS_PM_GATED (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_STATUS_PM_RUNNING (IMG_UINT64_C(0x0000000000000010)) +#define RGX_CR_CLK_STATUS_TSP_SHIFT (1U) +#define RGX_CR_CLK_STATUS_TSP_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFFD)) +#define RGX_CR_CLK_STATUS_TSP_GATED (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_STATUS_TSP_RUNNING (IMG_UINT64_C(0x0000000000000002)) +#define RGX_CR_CLK_STATUS_ISP_SHIFT (0U) +#define RGX_CR_CLK_STATUS_ISP_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFFE)) +#define RGX_CR_CLK_STATUS_ISP_GATED (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_STATUS_ISP_RUNNING (IMG_UINT64_C(0x0000000000000001)) +#endif /* RGX_FEATURE_S7_TOP_INFRASTRUCTURE */ + + +#if !defined(RGX_FEATURE_S7_TOP_INFRASTRUCTURE) +/* + Register RGX_CR_CLK_STATUS +*/ +#define RGX_CR_CLK_STATUS (0x0008U) +#define RGX_CR_CLK_STATUS_MASKFULL (IMG_UINT64_C(0x00000001FFF077FF)) +#define RGX_CR_CLK_STATUS_MCU_FBTC_SHIFT (32U) +#define RGX_CR_CLK_STATUS_MCU_FBTC_CLRMSK (IMG_UINT64_C(0XFFFFFFFEFFFFFFFF)) +#define RGX_CR_CLK_STATUS_MCU_FBTC_GATED (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_STATUS_MCU_FBTC_RUNNING (IMG_UINT64_C(0x0000000100000000)) +#if defined(RGX_FEATURE_CLUSTER_GROUPING) +#define RGX_CR_CLK_STATUS_BIF_TEXAS_SHIFT (31U) +#define RGX_CR_CLK_STATUS_BIF_TEXAS_CLRMSK (IMG_UINT64_C(0XFFFFFFFF7FFFFFFF)) +#define RGX_CR_CLK_STATUS_BIF_TEXAS_GATED (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_STATUS_BIF_TEXAS_RUNNING (IMG_UINT64_C(0x0000000080000000)) +#define RGX_CR_CLK_STATUS_IPP_SHIFT (30U) +#define RGX_CR_CLK_STATUS_IPP_CLRMSK (IMG_UINT64_C(0XFFFFFFFFBFFFFFFF)) +#define RGX_CR_CLK_STATUS_IPP_GATED (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_STATUS_IPP_RUNNING (IMG_UINT64_C(0x0000000040000000)) +#endif /* RGX_FEATURE_CLUSTER_GROUPING */ + +#define RGX_CR_CLK_STATUS_FBC_SHIFT (29U) +#define RGX_CR_CLK_STATUS_FBC_CLRMSK (IMG_UINT64_C(0XFFFFFFFFDFFFFFFF)) +#define RGX_CR_CLK_STATUS_FBC_GATED (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_STATUS_FBC_RUNNING (IMG_UINT64_C(0x0000000020000000)) +#define RGX_CR_CLK_STATUS_FBDC_SHIFT (28U) +#define RGX_CR_CLK_STATUS_FBDC_CLRMSK (IMG_UINT64_C(0XFFFFFFFFEFFFFFFF)) +#define RGX_CR_CLK_STATUS_FBDC_GATED (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_STATUS_FBDC_RUNNING (IMG_UINT64_C(0x0000000010000000)) +#define RGX_CR_CLK_STATUS_FB_TLCACHE_SHIFT (27U) +#define RGX_CR_CLK_STATUS_FB_TLCACHE_CLRMSK (IMG_UINT64_C(0XFFFFFFFFF7FFFFFF)) +#define RGX_CR_CLK_STATUS_FB_TLCACHE_GATED (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_STATUS_FB_TLCACHE_RUNNING (IMG_UINT64_C(0x0000000008000000)) +#define RGX_CR_CLK_STATUS_USCS_SHIFT (26U) +#define RGX_CR_CLK_STATUS_USCS_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFBFFFFFF)) +#define RGX_CR_CLK_STATUS_USCS_GATED (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_STATUS_USCS_RUNNING (IMG_UINT64_C(0x0000000004000000)) +#define RGX_CR_CLK_STATUS_PBE_SHIFT (25U) +#define RGX_CR_CLK_STATUS_PBE_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFDFFFFFF)) +#define RGX_CR_CLK_STATUS_PBE_GATED (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_STATUS_PBE_RUNNING (IMG_UINT64_C(0x0000000002000000)) +#define RGX_CR_CLK_STATUS_MCU_L1_SHIFT (24U) +#define RGX_CR_CLK_STATUS_MCU_L1_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFEFFFFFF)) +#define RGX_CR_CLK_STATUS_MCU_L1_GATED (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_STATUS_MCU_L1_RUNNING (IMG_UINT64_C(0x0000000001000000)) +#define RGX_CR_CLK_STATUS_CDM_SHIFT (23U) +#define RGX_CR_CLK_STATUS_CDM_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFF7FFFFF)) +#define RGX_CR_CLK_STATUS_CDM_GATED (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_STATUS_CDM_RUNNING (IMG_UINT64_C(0x0000000000800000)) +#define RGX_CR_CLK_STATUS_SIDEKICK_SHIFT (22U) +#define RGX_CR_CLK_STATUS_SIDEKICK_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFBFFFFF)) +#define RGX_CR_CLK_STATUS_SIDEKICK_GATED (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_STATUS_SIDEKICK_RUNNING (IMG_UINT64_C(0x0000000000400000)) +#define RGX_CR_CLK_STATUS_BIF_SIDEKICK_SHIFT (21U) +#define RGX_CR_CLK_STATUS_BIF_SIDEKICK_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFDFFFFF)) +#define RGX_CR_CLK_STATUS_BIF_SIDEKICK_GATED (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_STATUS_BIF_SIDEKICK_RUNNING (IMG_UINT64_C(0x0000000000200000)) +#define RGX_CR_CLK_STATUS_BIF_SHIFT (20U) +#define RGX_CR_CLK_STATUS_BIF_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFEFFFFF)) +#define RGX_CR_CLK_STATUS_BIF_GATED (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_STATUS_BIF_RUNNING (IMG_UINT64_C(0x0000000000100000)) +#define RGX_CR_CLK_STATUS_TPU_MCU_DEMUX_SHIFT (14U) +#define RGX_CR_CLK_STATUS_TPU_MCU_DEMUX_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFBFFF)) +#define RGX_CR_CLK_STATUS_TPU_MCU_DEMUX_GATED (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_STATUS_TPU_MCU_DEMUX_RUNNING (IMG_UINT64_C(0x0000000000004000)) +#define RGX_CR_CLK_STATUS_MCU_L0_SHIFT (13U) +#define RGX_CR_CLK_STATUS_MCU_L0_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFDFFF)) +#define RGX_CR_CLK_STATUS_MCU_L0_GATED (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_STATUS_MCU_L0_RUNNING (IMG_UINT64_C(0x0000000000002000)) +#define RGX_CR_CLK_STATUS_TPU_SHIFT (12U) +#define RGX_CR_CLK_STATUS_TPU_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFEFFF)) +#define RGX_CR_CLK_STATUS_TPU_GATED (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_STATUS_TPU_RUNNING (IMG_UINT64_C(0x0000000000001000)) +#define RGX_CR_CLK_STATUS_USC_SHIFT (10U) +#define RGX_CR_CLK_STATUS_USC_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFBFF)) +#define RGX_CR_CLK_STATUS_USC_GATED (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_STATUS_USC_RUNNING (IMG_UINT64_C(0x0000000000000400)) +#define RGX_CR_CLK_STATUS_TLA_SHIFT (9U) +#define RGX_CR_CLK_STATUS_TLA_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFDFF)) +#define RGX_CR_CLK_STATUS_TLA_GATED (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_STATUS_TLA_RUNNING (IMG_UINT64_C(0x0000000000000200)) +#define RGX_CR_CLK_STATUS_SLC_SHIFT (8U) +#define RGX_CR_CLK_STATUS_SLC_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFEFF)) +#define RGX_CR_CLK_STATUS_SLC_GATED (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_STATUS_SLC_RUNNING (IMG_UINT64_C(0x0000000000000100)) +#define RGX_CR_CLK_STATUS_UVS_SHIFT (7U) +#define RGX_CR_CLK_STATUS_UVS_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFF7F)) +#define RGX_CR_CLK_STATUS_UVS_GATED (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_STATUS_UVS_RUNNING (IMG_UINT64_C(0x0000000000000080)) +#define RGX_CR_CLK_STATUS_PDS_SHIFT (6U) +#define RGX_CR_CLK_STATUS_PDS_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFBF)) +#define RGX_CR_CLK_STATUS_PDS_GATED (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_STATUS_PDS_RUNNING (IMG_UINT64_C(0x0000000000000040)) +#define RGX_CR_CLK_STATUS_VDM_SHIFT (5U) +#define RGX_CR_CLK_STATUS_VDM_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFDF)) +#define RGX_CR_CLK_STATUS_VDM_GATED (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_STATUS_VDM_RUNNING (IMG_UINT64_C(0x0000000000000020)) +#define RGX_CR_CLK_STATUS_PM_SHIFT (4U) +#define RGX_CR_CLK_STATUS_PM_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFEF)) +#define RGX_CR_CLK_STATUS_PM_GATED (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_STATUS_PM_RUNNING (IMG_UINT64_C(0x0000000000000010)) +#define RGX_CR_CLK_STATUS_GPP_SHIFT (3U) +#define RGX_CR_CLK_STATUS_GPP_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFF7)) +#define RGX_CR_CLK_STATUS_GPP_GATED (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_STATUS_GPP_RUNNING (IMG_UINT64_C(0x0000000000000008)) +#define RGX_CR_CLK_STATUS_TE_SHIFT (2U) +#define RGX_CR_CLK_STATUS_TE_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFFB)) +#define RGX_CR_CLK_STATUS_TE_GATED (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_STATUS_TE_RUNNING (IMG_UINT64_C(0x0000000000000004)) +#define RGX_CR_CLK_STATUS_TSP_SHIFT (1U) +#define RGX_CR_CLK_STATUS_TSP_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFFD)) +#define RGX_CR_CLK_STATUS_TSP_GATED (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_STATUS_TSP_RUNNING (IMG_UINT64_C(0x0000000000000002)) +#define RGX_CR_CLK_STATUS_ISP_SHIFT (0U) +#define RGX_CR_CLK_STATUS_ISP_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFFE)) +#define RGX_CR_CLK_STATUS_ISP_GATED (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_STATUS_ISP_RUNNING (IMG_UINT64_C(0x0000000000000001)) +#endif /* !defined(RGX_FEATURE_S7_TOP_INFRASTRUCTURE) */ + + +/* + Register RGX_CR_CORE_ID +*/ +#define RGX_CR_CORE_ID (0x0018U) +#define RGX_CR_CORE_ID_MASKFULL (IMG_UINT64_C(0x00000000FFFFFFFF)) +#define RGX_CR_CORE_ID_ID_SHIFT (16U) +#define RGX_CR_CORE_ID_ID_CLRMSK (0X0000FFFFU) +#define RGX_CR_CORE_ID_CONFIG_SHIFT (0U) +#define RGX_CR_CORE_ID_CONFIG_CLRMSK (0XFFFF0000U) + + +/* + Register RGX_CR_CORE_REVISION +*/ +#define RGX_CR_CORE_REVISION (0x0020U) +#define RGX_CR_CORE_REVISION_MASKFULL (IMG_UINT64_C(0x00000000FFFFFFFF)) +#define RGX_CR_CORE_REVISION_DESIGNER_SHIFT (24U) +#define RGX_CR_CORE_REVISION_DESIGNER_CLRMSK (0X00FFFFFFU) +#define RGX_CR_CORE_REVISION_MAJOR_SHIFT (16U) +#define RGX_CR_CORE_REVISION_MAJOR_CLRMSK (0XFF00FFFFU) +#define RGX_CR_CORE_REVISION_MINOR_SHIFT (8U) +#define RGX_CR_CORE_REVISION_MINOR_CLRMSK (0XFFFF00FFU) +#define RGX_CR_CORE_REVISION_MAINTENANCE_SHIFT (0U) +#define RGX_CR_CORE_REVISION_MAINTENANCE_CLRMSK (0XFFFFFF00U) + + +/* + Register RGX_CR_DESIGNER_REV_FIELD1 +*/ +#define RGX_CR_DESIGNER_REV_FIELD1 (0x0028U) +#define RGX_CR_DESIGNER_REV_FIELD1_MASKFULL (IMG_UINT64_C(0x00000000FFFFFFFF)) +#define RGX_CR_DESIGNER_REV_FIELD1_DESIGNER_REV_FIELD1_SHIFT (0U) +#define RGX_CR_DESIGNER_REV_FIELD1_DESIGNER_REV_FIELD1_CLRMSK (00000000U) + + +/* + Register RGX_CR_DESIGNER_REV_FIELD2 +*/ +#define RGX_CR_DESIGNER_REV_FIELD2 (0x0030U) +#define RGX_CR_DESIGNER_REV_FIELD2_MASKFULL (IMG_UINT64_C(0x00000000FFFFFFFF)) +#define RGX_CR_DESIGNER_REV_FIELD2_DESIGNER_REV_FIELD2_SHIFT (0U) +#define RGX_CR_DESIGNER_REV_FIELD2_DESIGNER_REV_FIELD2_CLRMSK (00000000U) + + +/* + Register RGX_CR_CHANGESET_NUMBER +*/ +#define RGX_CR_CHANGESET_NUMBER (0x0040U) +#define RGX_CR_CHANGESET_NUMBER_MASKFULL (IMG_UINT64_C(0xFFFFFFFFFFFFFFFF)) +#define RGX_CR_CHANGESET_NUMBER_CHANGESET_NUMBER_SHIFT (0U) +#define RGX_CR_CHANGESET_NUMBER_CHANGESET_NUMBER_CLRMSK (IMG_UINT64_C(0000000000000000)) + + +/* + Register RGX_CR_CLK_XTPLUS_CTRL +*/ +#define RGX_CR_CLK_XTPLUS_CTRL (0x0080U) +#define RGX_CR_CLK_XTPLUS_CTRL_MASKFULL (IMG_UINT64_C(0x0000000FFFFFFFFF)) +#define RGX_CR_CLK_XTPLUS_CTRL_ASTC_SHIFT (34U) +#define RGX_CR_CLK_XTPLUS_CTRL_ASTC_CLRMSK (IMG_UINT64_C(0XFFFFFFF3FFFFFFFF)) +#define RGX_CR_CLK_XTPLUS_CTRL_ASTC_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_XTPLUS_CTRL_ASTC_ON (IMG_UINT64_C(0x0000000400000000)) +#define RGX_CR_CLK_XTPLUS_CTRL_ASTC_AUTO (IMG_UINT64_C(0x0000000800000000)) +#define RGX_CR_CLK_XTPLUS_CTRL_IPF_SHIFT (32U) +#define RGX_CR_CLK_XTPLUS_CTRL_IPF_CLRMSK (IMG_UINT64_C(0XFFFFFFFCFFFFFFFF)) +#define RGX_CR_CLK_XTPLUS_CTRL_IPF_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_XTPLUS_CTRL_IPF_ON (IMG_UINT64_C(0x0000000100000000)) +#define RGX_CR_CLK_XTPLUS_CTRL_IPF_AUTO (IMG_UINT64_C(0x0000000200000000)) +#define RGX_CR_CLK_XTPLUS_CTRL_COMPUTE_SHIFT (30U) +#define RGX_CR_CLK_XTPLUS_CTRL_COMPUTE_CLRMSK (IMG_UINT64_C(0XFFFFFFFF3FFFFFFF)) +#define RGX_CR_CLK_XTPLUS_CTRL_COMPUTE_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_XTPLUS_CTRL_COMPUTE_ON (IMG_UINT64_C(0x0000000040000000)) +#define RGX_CR_CLK_XTPLUS_CTRL_COMPUTE_AUTO (IMG_UINT64_C(0x0000000080000000)) +#define RGX_CR_CLK_XTPLUS_CTRL_PIXEL_SHIFT (28U) +#define RGX_CR_CLK_XTPLUS_CTRL_PIXEL_CLRMSK (IMG_UINT64_C(0XFFFFFFFFCFFFFFFF)) +#define RGX_CR_CLK_XTPLUS_CTRL_PIXEL_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_XTPLUS_CTRL_PIXEL_ON (IMG_UINT64_C(0x0000000010000000)) +#define RGX_CR_CLK_XTPLUS_CTRL_PIXEL_AUTO (IMG_UINT64_C(0x0000000020000000)) +#define RGX_CR_CLK_XTPLUS_CTRL_VERTEX_SHIFT (26U) +#define RGX_CR_CLK_XTPLUS_CTRL_VERTEX_CLRMSK (IMG_UINT64_C(0XFFFFFFFFF3FFFFFF)) +#define RGX_CR_CLK_XTPLUS_CTRL_VERTEX_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_XTPLUS_CTRL_VERTEX_ON (IMG_UINT64_C(0x0000000004000000)) +#define RGX_CR_CLK_XTPLUS_CTRL_VERTEX_AUTO (IMG_UINT64_C(0x0000000008000000)) +#define RGX_CR_CLK_XTPLUS_CTRL_USCPS_SHIFT (24U) +#define RGX_CR_CLK_XTPLUS_CTRL_USCPS_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFCFFFFFF)) +#define RGX_CR_CLK_XTPLUS_CTRL_USCPS_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_XTPLUS_CTRL_USCPS_ON (IMG_UINT64_C(0x0000000001000000)) +#define RGX_CR_CLK_XTPLUS_CTRL_USCPS_AUTO (IMG_UINT64_C(0x0000000002000000)) +#define RGX_CR_CLK_XTPLUS_CTRL_PDS_SHARED_SHIFT (22U) +#define RGX_CR_CLK_XTPLUS_CTRL_PDS_SHARED_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFF3FFFFF)) +#define RGX_CR_CLK_XTPLUS_CTRL_PDS_SHARED_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_XTPLUS_CTRL_PDS_SHARED_ON (IMG_UINT64_C(0x0000000000400000)) +#define RGX_CR_CLK_XTPLUS_CTRL_PDS_SHARED_AUTO (IMG_UINT64_C(0x0000000000800000)) +#define RGX_CR_CLK_XTPLUS_CTRL_BIF_BLACKPEARL_SHIFT (20U) +#define RGX_CR_CLK_XTPLUS_CTRL_BIF_BLACKPEARL_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFCFFFFF)) +#define RGX_CR_CLK_XTPLUS_CTRL_BIF_BLACKPEARL_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_XTPLUS_CTRL_BIF_BLACKPEARL_ON (IMG_UINT64_C(0x0000000000100000)) +#define RGX_CR_CLK_XTPLUS_CTRL_BIF_BLACKPEARL_AUTO (IMG_UINT64_C(0x0000000000200000)) +#define RGX_CR_CLK_XTPLUS_CTRL_USC_SHARED_SHIFT (18U) +#define RGX_CR_CLK_XTPLUS_CTRL_USC_SHARED_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFF3FFFF)) +#define RGX_CR_CLK_XTPLUS_CTRL_USC_SHARED_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_XTPLUS_CTRL_USC_SHARED_ON (IMG_UINT64_C(0x0000000000040000)) +#define RGX_CR_CLK_XTPLUS_CTRL_USC_SHARED_AUTO (IMG_UINT64_C(0x0000000000080000)) +#define RGX_CR_CLK_XTPLUS_CTRL_GEOMETRY_SHIFT (16U) +#define RGX_CR_CLK_XTPLUS_CTRL_GEOMETRY_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFCFFFF)) +#define RGX_CR_CLK_XTPLUS_CTRL_GEOMETRY_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_XTPLUS_CTRL_GEOMETRY_ON (IMG_UINT64_C(0x0000000000010000)) +#define RGX_CR_CLK_XTPLUS_CTRL_GEOMETRY_AUTO (IMG_UINT64_C(0x0000000000020000)) +#define RGX_CR_CLK_XTPLUS_CTRL_RAST_SHIFT (14U) +#define RGX_CR_CLK_XTPLUS_CTRL_RAST_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFF3FFF)) +#define RGX_CR_CLK_XTPLUS_CTRL_RAST_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_XTPLUS_CTRL_RAST_ON (IMG_UINT64_C(0x0000000000004000)) +#define RGX_CR_CLK_XTPLUS_CTRL_RAST_AUTO (IMG_UINT64_C(0x0000000000008000)) +#define RGX_CR_CLK_XTPLUS_CTRL_UVB_SHIFT (12U) +#define RGX_CR_CLK_XTPLUS_CTRL_UVB_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFCFFF)) +#define RGX_CR_CLK_XTPLUS_CTRL_UVB_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_XTPLUS_CTRL_UVB_ON (IMG_UINT64_C(0x0000000000001000)) +#define RGX_CR_CLK_XTPLUS_CTRL_UVB_AUTO (IMG_UINT64_C(0x0000000000002000)) +#define RGX_CR_CLK_XTPLUS_CTRL_GPP_SHIFT (10U) +#define RGX_CR_CLK_XTPLUS_CTRL_GPP_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFF3FF)) +#define RGX_CR_CLK_XTPLUS_CTRL_GPP_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_XTPLUS_CTRL_GPP_ON (IMG_UINT64_C(0x0000000000000400)) +#define RGX_CR_CLK_XTPLUS_CTRL_GPP_AUTO (IMG_UINT64_C(0x0000000000000800)) +#define RGX_CR_CLK_XTPLUS_CTRL_VDM_PIPE_SHIFT (8U) +#define RGX_CR_CLK_XTPLUS_CTRL_VDM_PIPE_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFCFF)) +#define RGX_CR_CLK_XTPLUS_CTRL_VDM_PIPE_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_XTPLUS_CTRL_VDM_PIPE_ON (IMG_UINT64_C(0x0000000000000100)) +#define RGX_CR_CLK_XTPLUS_CTRL_VDM_PIPE_AUTO (IMG_UINT64_C(0x0000000000000200)) +#define RGX_CR_CLK_XTPLUS_CTRL_VDM_SHIFT (6U) +#define RGX_CR_CLK_XTPLUS_CTRL_VDM_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFF3F)) +#define RGX_CR_CLK_XTPLUS_CTRL_VDM_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_XTPLUS_CTRL_VDM_ON (IMG_UINT64_C(0x0000000000000040)) +#define RGX_CR_CLK_XTPLUS_CTRL_VDM_AUTO (IMG_UINT64_C(0x0000000000000080)) +#define RGX_CR_CLK_XTPLUS_CTRL_TE3_SHIFT (4U) +#define RGX_CR_CLK_XTPLUS_CTRL_TE3_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFCF)) +#define RGX_CR_CLK_XTPLUS_CTRL_TE3_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_XTPLUS_CTRL_TE3_ON (IMG_UINT64_C(0x0000000000000010)) +#define RGX_CR_CLK_XTPLUS_CTRL_TE3_AUTO (IMG_UINT64_C(0x0000000000000020)) +#define RGX_CR_CLK_XTPLUS_CTRL_VCE_SHIFT (2U) +#define RGX_CR_CLK_XTPLUS_CTRL_VCE_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFF3)) +#define RGX_CR_CLK_XTPLUS_CTRL_VCE_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_XTPLUS_CTRL_VCE_ON (IMG_UINT64_C(0x0000000000000004)) +#define RGX_CR_CLK_XTPLUS_CTRL_VCE_AUTO (IMG_UINT64_C(0x0000000000000008)) +#define RGX_CR_CLK_XTPLUS_CTRL_VBS_SHIFT (0U) +#define RGX_CR_CLK_XTPLUS_CTRL_VBS_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFFC)) +#define RGX_CR_CLK_XTPLUS_CTRL_VBS_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_XTPLUS_CTRL_VBS_ON (IMG_UINT64_C(0x0000000000000001)) +#define RGX_CR_CLK_XTPLUS_CTRL_VBS_AUTO (IMG_UINT64_C(0x0000000000000002)) + + +/* + Register RGX_CR_CLK_XTPLUS_STATUS +*/ +#define RGX_CR_CLK_XTPLUS_STATUS (0x0088U) +#define RGX_CR_CLK_XTPLUS_STATUS_MASKFULL (IMG_UINT64_C(0x00000000000000FF)) +#define RGX_CR_CLK_XTPLUS_STATUS_ASTC_SHIFT (7U) +#define RGX_CR_CLK_XTPLUS_STATUS_ASTC_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFF7F)) +#define RGX_CR_CLK_XTPLUS_STATUS_ASTC_GATED (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_XTPLUS_STATUS_ASTC_RUNNING (IMG_UINT64_C(0x0000000000000080)) +#define RGX_CR_CLK_XTPLUS_STATUS_UVB_SHIFT (6U) +#define RGX_CR_CLK_XTPLUS_STATUS_UVB_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFBF)) +#define RGX_CR_CLK_XTPLUS_STATUS_UVB_GATED (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_XTPLUS_STATUS_UVB_RUNNING (IMG_UINT64_C(0x0000000000000040)) +#define RGX_CR_CLK_XTPLUS_STATUS_GPP_SHIFT (5U) +#define RGX_CR_CLK_XTPLUS_STATUS_GPP_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFDF)) +#define RGX_CR_CLK_XTPLUS_STATUS_GPP_GATED (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_XTPLUS_STATUS_GPP_RUNNING (IMG_UINT64_C(0x0000000000000020)) +#define RGX_CR_CLK_XTPLUS_STATUS_VDM_PIPE_SHIFT (4U) +#define RGX_CR_CLK_XTPLUS_STATUS_VDM_PIPE_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFEF)) +#define RGX_CR_CLK_XTPLUS_STATUS_VDM_PIPE_GATED (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_XTPLUS_STATUS_VDM_PIPE_RUNNING (IMG_UINT64_C(0x0000000000000010)) +#define RGX_CR_CLK_XTPLUS_STATUS_VDM_SHIFT (3U) +#define RGX_CR_CLK_XTPLUS_STATUS_VDM_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFF7)) +#define RGX_CR_CLK_XTPLUS_STATUS_VDM_GATED (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_XTPLUS_STATUS_VDM_RUNNING (IMG_UINT64_C(0x0000000000000008)) +#define RGX_CR_CLK_XTPLUS_STATUS_TE3_SHIFT (2U) +#define RGX_CR_CLK_XTPLUS_STATUS_TE3_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFFB)) +#define RGX_CR_CLK_XTPLUS_STATUS_TE3_GATED (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_XTPLUS_STATUS_TE3_RUNNING (IMG_UINT64_C(0x0000000000000004)) +#define RGX_CR_CLK_XTPLUS_STATUS_VCE_SHIFT (1U) +#define RGX_CR_CLK_XTPLUS_STATUS_VCE_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFFD)) +#define RGX_CR_CLK_XTPLUS_STATUS_VCE_GATED (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_XTPLUS_STATUS_VCE_RUNNING (IMG_UINT64_C(0x0000000000000002)) +#define RGX_CR_CLK_XTPLUS_STATUS_VBS_SHIFT (0U) +#define RGX_CR_CLK_XTPLUS_STATUS_VBS_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFFE)) +#define RGX_CR_CLK_XTPLUS_STATUS_VBS_GATED (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_XTPLUS_STATUS_VBS_RUNNING (IMG_UINT64_C(0x0000000000000001)) + + +/* + Register RGX_CR_SOFT_RESET +*/ +#define RGX_CR_SOFT_RESET (0x0100U) +#define RGX_CR_SOFT_RESET_MASKFULL (IMG_UINT64_C(0xFFE7FFFFFFFFFC1D)) +#if defined(RGX_FEATURE_CLUSTER_GROUPING) +#define RGX_CR_SOFT_RESET_PHANTOM3_CORE_SHIFT (63U) +#define RGX_CR_SOFT_RESET_PHANTOM3_CORE_CLRMSK (IMG_UINT64_C(0X7FFFFFFFFFFFFFFF)) +#define RGX_CR_SOFT_RESET_PHANTOM3_CORE_EN (IMG_UINT64_C(0X8000000000000000)) +#define RGX_CR_SOFT_RESET_PHANTOM2_CORE_SHIFT (62U) +#define RGX_CR_SOFT_RESET_PHANTOM2_CORE_CLRMSK (IMG_UINT64_C(0XBFFFFFFFFFFFFFFF)) +#define RGX_CR_SOFT_RESET_PHANTOM2_CORE_EN (IMG_UINT64_C(0X4000000000000000)) +#define RGX_CR_SOFT_RESET_BERNADO2_CORE_SHIFT (61U) +#define RGX_CR_SOFT_RESET_BERNADO2_CORE_CLRMSK (IMG_UINT64_C(0XDFFFFFFFFFFFFFFF)) +#define RGX_CR_SOFT_RESET_BERNADO2_CORE_EN (IMG_UINT64_C(0X2000000000000000)) +#endif /* RGX_FEATURE_CLUSTER_GROUPING */ + +#define RGX_CR_SOFT_RESET_JONES_CORE_SHIFT (60U) +#define RGX_CR_SOFT_RESET_JONES_CORE_CLRMSK (IMG_UINT64_C(0XEFFFFFFFFFFFFFFF)) +#define RGX_CR_SOFT_RESET_JONES_CORE_EN (IMG_UINT64_C(0X1000000000000000)) +#define RGX_CR_SOFT_RESET_TILING_CORE_SHIFT (59U) +#define RGX_CR_SOFT_RESET_TILING_CORE_CLRMSK (IMG_UINT64_C(0XF7FFFFFFFFFFFFFF)) +#define RGX_CR_SOFT_RESET_TILING_CORE_EN (IMG_UINT64_C(0X0800000000000000)) +#define RGX_CR_SOFT_RESET_TE3_SHIFT (58U) +#define RGX_CR_SOFT_RESET_TE3_CLRMSK (IMG_UINT64_C(0XFBFFFFFFFFFFFFFF)) +#define RGX_CR_SOFT_RESET_TE3_EN (IMG_UINT64_C(0X0400000000000000)) +#define RGX_CR_SOFT_RESET_VCE_SHIFT (57U) +#define RGX_CR_SOFT_RESET_VCE_CLRMSK (IMG_UINT64_C(0XFDFFFFFFFFFFFFFF)) +#define RGX_CR_SOFT_RESET_VCE_EN (IMG_UINT64_C(0X0200000000000000)) +#define RGX_CR_SOFT_RESET_VBS_SHIFT (56U) +#define RGX_CR_SOFT_RESET_VBS_CLRMSK (IMG_UINT64_C(0XFEFFFFFFFFFFFFFF)) +#define RGX_CR_SOFT_RESET_VBS_EN (IMG_UINT64_C(0X0100000000000000)) +#if defined(RGX_FEATURE_RAY_TRACING) +#define RGX_CR_SOFT_RESET_DPX1_CORE_SHIFT (55U) +#define RGX_CR_SOFT_RESET_DPX1_CORE_CLRMSK (IMG_UINT64_C(0XFF7FFFFFFFFFFFFF)) +#define RGX_CR_SOFT_RESET_DPX1_CORE_EN (IMG_UINT64_C(0X0080000000000000)) +#define RGX_CR_SOFT_RESET_DPX0_CORE_SHIFT (54U) +#define RGX_CR_SOFT_RESET_DPX0_CORE_CLRMSK (IMG_UINT64_C(0XFFBFFFFFFFFFFFFF)) +#define RGX_CR_SOFT_RESET_DPX0_CORE_EN (IMG_UINT64_C(0X0040000000000000)) +#define RGX_CR_SOFT_RESET_FBA_SHIFT (53U) +#define RGX_CR_SOFT_RESET_FBA_CLRMSK (IMG_UINT64_C(0XFFDFFFFFFFFFFFFF)) +#define RGX_CR_SOFT_RESET_FBA_EN (IMG_UINT64_C(0X0020000000000000)) +#define RGX_CR_SOFT_RESET_SH_SHIFT (50U) +#define RGX_CR_SOFT_RESET_SH_CLRMSK (IMG_UINT64_C(0XFFFBFFFFFFFFFFFF)) +#define RGX_CR_SOFT_RESET_SH_EN (IMG_UINT64_C(0X0004000000000000)) +#define RGX_CR_SOFT_RESET_VRDM_SHIFT (49U) +#define RGX_CR_SOFT_RESET_VRDM_CLRMSK (IMG_UINT64_C(0XFFFDFFFFFFFFFFFF)) +#define RGX_CR_SOFT_RESET_VRDM_EN (IMG_UINT64_C(0X0002000000000000)) +#endif /* RGX_FEATURE_RAY_TRACING */ + +#define RGX_CR_SOFT_RESET_MCU_FBTC_SHIFT (48U) +#define RGX_CR_SOFT_RESET_MCU_FBTC_CLRMSK (IMG_UINT64_C(0XFFFEFFFFFFFFFFFF)) +#define RGX_CR_SOFT_RESET_MCU_FBTC_EN (IMG_UINT64_C(0X0001000000000000)) +#if defined(RGX_FEATURE_CLUSTER_GROUPING) +#define RGX_CR_SOFT_RESET_PHANTOM1_CORE_SHIFT (47U) +#define RGX_CR_SOFT_RESET_PHANTOM1_CORE_CLRMSK (IMG_UINT64_C(0XFFFF7FFFFFFFFFFF)) +#define RGX_CR_SOFT_RESET_PHANTOM1_CORE_EN (IMG_UINT64_C(0X0000800000000000)) +#define RGX_CR_SOFT_RESET_PHANTOM0_CORE_SHIFT (46U) +#define RGX_CR_SOFT_RESET_PHANTOM0_CORE_CLRMSK (IMG_UINT64_C(0XFFFFBFFFFFFFFFFF)) +#define RGX_CR_SOFT_RESET_PHANTOM0_CORE_EN (IMG_UINT64_C(0X0000400000000000)) +#define RGX_CR_SOFT_RESET_BERNADO1_CORE_SHIFT (45U) +#define RGX_CR_SOFT_RESET_BERNADO1_CORE_CLRMSK (IMG_UINT64_C(0XFFFFDFFFFFFFFFFF)) +#define RGX_CR_SOFT_RESET_BERNADO1_CORE_EN (IMG_UINT64_C(0X0000200000000000)) +#define RGX_CR_SOFT_RESET_BERNADO0_CORE_SHIFT (44U) +#define RGX_CR_SOFT_RESET_BERNADO0_CORE_CLRMSK (IMG_UINT64_C(0XFFFFEFFFFFFFFFFF)) +#define RGX_CR_SOFT_RESET_BERNADO0_CORE_EN (IMG_UINT64_C(0X0000100000000000)) +#define RGX_CR_SOFT_RESET_IPP_SHIFT (43U) +#define RGX_CR_SOFT_RESET_IPP_CLRMSK (IMG_UINT64_C(0XFFFFF7FFFFFFFFFF)) +#define RGX_CR_SOFT_RESET_IPP_EN (IMG_UINT64_C(0X0000080000000000)) +#define RGX_CR_SOFT_RESET_BIF_TEXAS_SHIFT (42U) +#define RGX_CR_SOFT_RESET_BIF_TEXAS_CLRMSK (IMG_UINT64_C(0XFFFFFBFFFFFFFFFF)) +#define RGX_CR_SOFT_RESET_BIF_TEXAS_EN (IMG_UINT64_C(0X0000040000000000)) +#define RGX_CR_SOFT_RESET_TORNADO_CORE_SHIFT (41U) +#define RGX_CR_SOFT_RESET_TORNADO_CORE_CLRMSK (IMG_UINT64_C(0XFFFFFDFFFFFFFFFF)) +#define RGX_CR_SOFT_RESET_TORNADO_CORE_EN (IMG_UINT64_C(0X0000020000000000)) +#endif /* RGX_FEATURE_CLUSTER_GROUPING */ + +#define RGX_CR_SOFT_RESET_DUST_H_CORE_SHIFT (40U) +#define RGX_CR_SOFT_RESET_DUST_H_CORE_CLRMSK (IMG_UINT64_C(0XFFFFFEFFFFFFFFFF)) +#define RGX_CR_SOFT_RESET_DUST_H_CORE_EN (IMG_UINT64_C(0X0000010000000000)) +#define RGX_CR_SOFT_RESET_DUST_G_CORE_SHIFT (39U) +#define RGX_CR_SOFT_RESET_DUST_G_CORE_CLRMSK (IMG_UINT64_C(0XFFFFFF7FFFFFFFFF)) +#define RGX_CR_SOFT_RESET_DUST_G_CORE_EN (IMG_UINT64_C(0X0000008000000000)) +#define RGX_CR_SOFT_RESET_DUST_F_CORE_SHIFT (38U) +#define RGX_CR_SOFT_RESET_DUST_F_CORE_CLRMSK (IMG_UINT64_C(0XFFFFFFBFFFFFFFFF)) +#define RGX_CR_SOFT_RESET_DUST_F_CORE_EN (IMG_UINT64_C(0X0000004000000000)) +#define RGX_CR_SOFT_RESET_DUST_E_CORE_SHIFT (37U) +#define RGX_CR_SOFT_RESET_DUST_E_CORE_CLRMSK (IMG_UINT64_C(0XFFFFFFDFFFFFFFFF)) +#define RGX_CR_SOFT_RESET_DUST_E_CORE_EN (IMG_UINT64_C(0X0000002000000000)) +#define RGX_CR_SOFT_RESET_DUST_D_CORE_SHIFT (36U) +#define RGX_CR_SOFT_RESET_DUST_D_CORE_CLRMSK (IMG_UINT64_C(0XFFFFFFEFFFFFFFFF)) +#define RGX_CR_SOFT_RESET_DUST_D_CORE_EN (IMG_UINT64_C(0X0000001000000000)) +#define RGX_CR_SOFT_RESET_DUST_C_CORE_SHIFT (35U) +#define RGX_CR_SOFT_RESET_DUST_C_CORE_CLRMSK (IMG_UINT64_C(0XFFFFFFF7FFFFFFFF)) +#define RGX_CR_SOFT_RESET_DUST_C_CORE_EN (IMG_UINT64_C(0X0000000800000000)) +#define RGX_CR_SOFT_RESET_MMU_SHIFT (34U) +#define RGX_CR_SOFT_RESET_MMU_CLRMSK (IMG_UINT64_C(0XFFFFFFFBFFFFFFFF)) +#define RGX_CR_SOFT_RESET_MMU_EN (IMG_UINT64_C(0X0000000400000000)) +#define RGX_CR_SOFT_RESET_BIF1_SHIFT (33U) +#define RGX_CR_SOFT_RESET_BIF1_CLRMSK (IMG_UINT64_C(0XFFFFFFFDFFFFFFFF)) +#define RGX_CR_SOFT_RESET_BIF1_EN (IMG_UINT64_C(0X0000000200000000)) +#define RGX_CR_SOFT_RESET_GARTEN_SHIFT (32U) +#define RGX_CR_SOFT_RESET_GARTEN_CLRMSK (IMG_UINT64_C(0XFFFFFFFEFFFFFFFF)) +#define RGX_CR_SOFT_RESET_GARTEN_EN (IMG_UINT64_C(0X0000000100000000)) +#define RGX_CR_SOFT_RESET_RASCAL_CORE_SHIFT (31U) +#define RGX_CR_SOFT_RESET_RASCAL_CORE_CLRMSK (IMG_UINT64_C(0XFFFFFFFF7FFFFFFF)) +#define RGX_CR_SOFT_RESET_RASCAL_CORE_EN (IMG_UINT64_C(0X0000000080000000)) +#define RGX_CR_SOFT_RESET_DUST_B_CORE_SHIFT (30U) +#define RGX_CR_SOFT_RESET_DUST_B_CORE_CLRMSK (IMG_UINT64_C(0XFFFFFFFFBFFFFFFF)) +#define RGX_CR_SOFT_RESET_DUST_B_CORE_EN (IMG_UINT64_C(0X0000000040000000)) +#define RGX_CR_SOFT_RESET_DUST_A_CORE_SHIFT (29U) +#define RGX_CR_SOFT_RESET_DUST_A_CORE_CLRMSK (IMG_UINT64_C(0XFFFFFFFFDFFFFFFF)) +#define RGX_CR_SOFT_RESET_DUST_A_CORE_EN (IMG_UINT64_C(0X0000000020000000)) +#define RGX_CR_SOFT_RESET_FB_TLCACHE_SHIFT (28U) +#define RGX_CR_SOFT_RESET_FB_TLCACHE_CLRMSK (IMG_UINT64_C(0XFFFFFFFFEFFFFFFF)) +#define RGX_CR_SOFT_RESET_FB_TLCACHE_EN (IMG_UINT64_C(0X0000000010000000)) +#define RGX_CR_SOFT_RESET_SLC_SHIFT (27U) +#define RGX_CR_SOFT_RESET_SLC_CLRMSK (IMG_UINT64_C(0XFFFFFFFFF7FFFFFF)) +#define RGX_CR_SOFT_RESET_SLC_EN (IMG_UINT64_C(0X0000000008000000)) +#define RGX_CR_SOFT_RESET_TLA_SHIFT (26U) +#define RGX_CR_SOFT_RESET_TLA_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFBFFFFFF)) +#define RGX_CR_SOFT_RESET_TLA_EN (IMG_UINT64_C(0X0000000004000000)) +#define RGX_CR_SOFT_RESET_UVS_SHIFT (25U) +#define RGX_CR_SOFT_RESET_UVS_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFDFFFFFF)) +#define RGX_CR_SOFT_RESET_UVS_EN (IMG_UINT64_C(0X0000000002000000)) +#define RGX_CR_SOFT_RESET_TE_SHIFT (24U) +#define RGX_CR_SOFT_RESET_TE_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFEFFFFFF)) +#define RGX_CR_SOFT_RESET_TE_EN (IMG_UINT64_C(0X0000000001000000)) +#define RGX_CR_SOFT_RESET_GPP_SHIFT (23U) +#define RGX_CR_SOFT_RESET_GPP_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFF7FFFFF)) +#define RGX_CR_SOFT_RESET_GPP_EN (IMG_UINT64_C(0X0000000000800000)) +#define RGX_CR_SOFT_RESET_FBDC_SHIFT (22U) +#define RGX_CR_SOFT_RESET_FBDC_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFBFFFFF)) +#define RGX_CR_SOFT_RESET_FBDC_EN (IMG_UINT64_C(0X0000000000400000)) +#define RGX_CR_SOFT_RESET_FBC_SHIFT (21U) +#define RGX_CR_SOFT_RESET_FBC_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFDFFFFF)) +#define RGX_CR_SOFT_RESET_FBC_EN (IMG_UINT64_C(0X0000000000200000)) +#define RGX_CR_SOFT_RESET_PM_SHIFT (20U) +#define RGX_CR_SOFT_RESET_PM_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFEFFFFF)) +#define RGX_CR_SOFT_RESET_PM_EN (IMG_UINT64_C(0X0000000000100000)) +#define RGX_CR_SOFT_RESET_PBE_SHIFT (19U) +#define RGX_CR_SOFT_RESET_PBE_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFF7FFFF)) +#define RGX_CR_SOFT_RESET_PBE_EN (IMG_UINT64_C(0X0000000000080000)) +#define RGX_CR_SOFT_RESET_USC_SHARED_SHIFT (18U) +#define RGX_CR_SOFT_RESET_USC_SHARED_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFBFFFF)) +#define RGX_CR_SOFT_RESET_USC_SHARED_EN (IMG_UINT64_C(0X0000000000040000)) +#define RGX_CR_SOFT_RESET_MCU_L1_SHIFT (17U) +#define RGX_CR_SOFT_RESET_MCU_L1_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFDFFFF)) +#define RGX_CR_SOFT_RESET_MCU_L1_EN (IMG_UINT64_C(0X0000000000020000)) +#define RGX_CR_SOFT_RESET_BIF_SHIFT (16U) +#define RGX_CR_SOFT_RESET_BIF_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFEFFFF)) +#define RGX_CR_SOFT_RESET_BIF_EN (IMG_UINT64_C(0X0000000000010000)) +#define RGX_CR_SOFT_RESET_CDM_SHIFT (15U) +#define RGX_CR_SOFT_RESET_CDM_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFF7FFF)) +#define RGX_CR_SOFT_RESET_CDM_EN (IMG_UINT64_C(0X0000000000008000)) +#define RGX_CR_SOFT_RESET_VDM_SHIFT (14U) +#define RGX_CR_SOFT_RESET_VDM_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFBFFF)) +#define RGX_CR_SOFT_RESET_VDM_EN (IMG_UINT64_C(0X0000000000004000)) +#if defined(RGX_FEATURE_TESSELLATION) +#define RGX_CR_SOFT_RESET_TESS_SHIFT (13U) +#define RGX_CR_SOFT_RESET_TESS_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFDFFF)) +#define RGX_CR_SOFT_RESET_TESS_EN (IMG_UINT64_C(0X0000000000002000)) +#endif /* RGX_FEATURE_TESSELLATION */ + +#define RGX_CR_SOFT_RESET_PDS_SHIFT (12U) +#define RGX_CR_SOFT_RESET_PDS_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFEFFF)) +#define RGX_CR_SOFT_RESET_PDS_EN (IMG_UINT64_C(0X0000000000001000)) +#define RGX_CR_SOFT_RESET_ISP_SHIFT (11U) +#define RGX_CR_SOFT_RESET_ISP_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFF7FF)) +#define RGX_CR_SOFT_RESET_ISP_EN (IMG_UINT64_C(0X0000000000000800)) +#define RGX_CR_SOFT_RESET_TSP_SHIFT (10U) +#define RGX_CR_SOFT_RESET_TSP_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFBFF)) +#define RGX_CR_SOFT_RESET_TSP_EN (IMG_UINT64_C(0X0000000000000400)) +#define RGX_CR_SOFT_RESET_TPU_MCU_DEMUX_SHIFT (4U) +#define RGX_CR_SOFT_RESET_TPU_MCU_DEMUX_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFEF)) +#define RGX_CR_SOFT_RESET_TPU_MCU_DEMUX_EN (IMG_UINT64_C(0X0000000000000010)) +#define RGX_CR_SOFT_RESET_MCU_L0_SHIFT (3U) +#define RGX_CR_SOFT_RESET_MCU_L0_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFF7)) +#define RGX_CR_SOFT_RESET_MCU_L0_EN (IMG_UINT64_C(0X0000000000000008)) +#define RGX_CR_SOFT_RESET_TPU_SHIFT (2U) +#define RGX_CR_SOFT_RESET_TPU_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFFB)) +#define RGX_CR_SOFT_RESET_TPU_EN (IMG_UINT64_C(0X0000000000000004)) +#define RGX_CR_SOFT_RESET_USC_SHIFT (0U) +#define RGX_CR_SOFT_RESET_USC_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFFE)) +#define RGX_CR_SOFT_RESET_USC_EN (IMG_UINT64_C(0X0000000000000001)) + + +/* + Register RGX_CR_SOFT_RESET2 +*/ +#define RGX_CR_SOFT_RESET2 (0x0108U) +#define RGX_CR_SOFT_RESET2_MASKFULL (IMG_UINT64_C(0x00000000000007FF)) +#define RGX_CR_SOFT_RESET2_ASTC_SHIFT (10U) +#define RGX_CR_SOFT_RESET2_ASTC_CLRMSK (0XFFFFFBFFU) +#define RGX_CR_SOFT_RESET2_ASTC_EN (0X00000400U) +#define RGX_CR_SOFT_RESET2_BLACKPEARL_SHIFT (9U) +#define RGX_CR_SOFT_RESET2_BLACKPEARL_CLRMSK (0XFFFFFDFFU) +#define RGX_CR_SOFT_RESET2_BLACKPEARL_EN (0X00000200U) +#define RGX_CR_SOFT_RESET2_USCPS_SHIFT (8U) +#define RGX_CR_SOFT_RESET2_USCPS_CLRMSK (0XFFFFFEFFU) +#define RGX_CR_SOFT_RESET2_USCPS_EN (0X00000100U) +#define RGX_CR_SOFT_RESET2_IPF_SHIFT (7U) +#define RGX_CR_SOFT_RESET2_IPF_CLRMSK (0XFFFFFF7FU) +#define RGX_CR_SOFT_RESET2_IPF_EN (0X00000080U) +#define RGX_CR_SOFT_RESET2_GEOMETRY_SHIFT (6U) +#define RGX_CR_SOFT_RESET2_GEOMETRY_CLRMSK (0XFFFFFFBFU) +#define RGX_CR_SOFT_RESET2_GEOMETRY_EN (0X00000040U) +#define RGX_CR_SOFT_RESET2_USC_SHARED_SHIFT (5U) +#define RGX_CR_SOFT_RESET2_USC_SHARED_CLRMSK (0XFFFFFFDFU) +#define RGX_CR_SOFT_RESET2_USC_SHARED_EN (0X00000020U) +#define RGX_CR_SOFT_RESET2_PDS_SHARED_SHIFT (4U) +#define RGX_CR_SOFT_RESET2_PDS_SHARED_CLRMSK (0XFFFFFFEFU) +#define RGX_CR_SOFT_RESET2_PDS_SHARED_EN (0X00000010U) +#define RGX_CR_SOFT_RESET2_BIF_BLACKPEARL_SHIFT (3U) +#define RGX_CR_SOFT_RESET2_BIF_BLACKPEARL_CLRMSK (0XFFFFFFF7U) +#define RGX_CR_SOFT_RESET2_BIF_BLACKPEARL_EN (0X00000008U) +#define RGX_CR_SOFT_RESET2_PIXEL_SHIFT (2U) +#define RGX_CR_SOFT_RESET2_PIXEL_CLRMSK (0XFFFFFFFBU) +#define RGX_CR_SOFT_RESET2_PIXEL_EN (0X00000004U) +#define RGX_CR_SOFT_RESET2_COMPUTE_SHIFT (1U) +#define RGX_CR_SOFT_RESET2_COMPUTE_CLRMSK (0XFFFFFFFDU) +#define RGX_CR_SOFT_RESET2_COMPUTE_EN (0X00000002U) +#define RGX_CR_SOFT_RESET2_VERTEX_SHIFT (0U) +#define RGX_CR_SOFT_RESET2_VERTEX_CLRMSK (0XFFFFFFFEU) +#define RGX_CR_SOFT_RESET2_VERTEX_EN (0X00000001U) + + +/* + Register RGX_CR_EVENT_STATUS +*/ +#define RGX_CR_EVENT_STATUS (0x0130U) +#define RGX_CR_EVENT_STATUS_MASKFULL (IMG_UINT64_C(0x000000001FFEFFFF)) +#if defined(RGX_FEATURE_RAY_TRACING) +#define RGX_CR_EVENT_STATUS_DPX_OUT_OF_MEMORY_SHIFT (28U) +#define RGX_CR_EVENT_STATUS_DPX_OUT_OF_MEMORY_CLRMSK (0XEFFFFFFFU) +#define RGX_CR_EVENT_STATUS_DPX_OUT_OF_MEMORY_EN (0X10000000U) +#define RGX_CR_EVENT_STATUS_DPX_MMU_PAGE_FAULT_SHIFT (27U) +#define RGX_CR_EVENT_STATUS_DPX_MMU_PAGE_FAULT_CLRMSK (0XF7FFFFFFU) +#define RGX_CR_EVENT_STATUS_DPX_MMU_PAGE_FAULT_EN (0X08000000U) +#define RGX_CR_EVENT_STATUS_RPM_OUT_OF_MEMORY_SHIFT (26U) +#define RGX_CR_EVENT_STATUS_RPM_OUT_OF_MEMORY_CLRMSK (0XFBFFFFFFU) +#define RGX_CR_EVENT_STATUS_RPM_OUT_OF_MEMORY_EN (0X04000000U) +#define RGX_CR_EVENT_STATUS_FBA_FC3_FINISHED_SHIFT (25U) +#define RGX_CR_EVENT_STATUS_FBA_FC3_FINISHED_CLRMSK (0XFDFFFFFFU) +#define RGX_CR_EVENT_STATUS_FBA_FC3_FINISHED_EN (0X02000000U) +#define RGX_CR_EVENT_STATUS_FBA_FC2_FINISHED_SHIFT (24U) +#define RGX_CR_EVENT_STATUS_FBA_FC2_FINISHED_CLRMSK (0XFEFFFFFFU) +#define RGX_CR_EVENT_STATUS_FBA_FC2_FINISHED_EN (0X01000000U) +#define RGX_CR_EVENT_STATUS_FBA_FC1_FINISHED_SHIFT (23U) +#define RGX_CR_EVENT_STATUS_FBA_FC1_FINISHED_CLRMSK (0XFF7FFFFFU) +#define RGX_CR_EVENT_STATUS_FBA_FC1_FINISHED_EN (0X00800000U) +#define RGX_CR_EVENT_STATUS_FBA_FC0_FINISHED_SHIFT (22U) +#define RGX_CR_EVENT_STATUS_FBA_FC0_FINISHED_CLRMSK (0XFFBFFFFFU) +#define RGX_CR_EVENT_STATUS_FBA_FC0_FINISHED_EN (0X00400000U) +#define RGX_CR_EVENT_STATUS_RDM_FC3_FINISHED_SHIFT (21U) +#define RGX_CR_EVENT_STATUS_RDM_FC3_FINISHED_CLRMSK (0XFFDFFFFFU) +#define RGX_CR_EVENT_STATUS_RDM_FC3_FINISHED_EN (0X00200000U) +#define RGX_CR_EVENT_STATUS_RDM_FC2_FINISHED_SHIFT (20U) +#define RGX_CR_EVENT_STATUS_RDM_FC2_FINISHED_CLRMSK (0XFFEFFFFFU) +#define RGX_CR_EVENT_STATUS_RDM_FC2_FINISHED_EN (0X00100000U) +#define RGX_CR_EVENT_STATUS_RDM_FC1_FINISHED_SHIFT (19U) +#define RGX_CR_EVENT_STATUS_RDM_FC1_FINISHED_CLRMSK (0XFFF7FFFFU) +#define RGX_CR_EVENT_STATUS_RDM_FC1_FINISHED_EN (0X00080000U) +#define RGX_CR_EVENT_STATUS_RDM_FC0_FINISHED_SHIFT (18U) +#define RGX_CR_EVENT_STATUS_RDM_FC0_FINISHED_CLRMSK (0XFFFBFFFFU) +#define RGX_CR_EVENT_STATUS_RDM_FC0_FINISHED_EN (0X00040000U) +#define RGX_CR_EVENT_STATUS_SHG_FINISHED_SHIFT (17U) +#define RGX_CR_EVENT_STATUS_SHG_FINISHED_CLRMSK (0XFFFDFFFFU) +#define RGX_CR_EVENT_STATUS_SHG_FINISHED_EN (0X00020000U) +#endif /* RGX_FEATURE_RAY_TRACING */ + +#define RGX_CR_EVENT_STATUS_USC_TRIGGER_SHIFT (15U) +#define RGX_CR_EVENT_STATUS_USC_TRIGGER_CLRMSK (0XFFFF7FFFU) +#define RGX_CR_EVENT_STATUS_USC_TRIGGER_EN (0X00008000U) +#define RGX_CR_EVENT_STATUS_ZLS_FINISHED_SHIFT (14U) +#define RGX_CR_EVENT_STATUS_ZLS_FINISHED_CLRMSK (0XFFFFBFFFU) +#define RGX_CR_EVENT_STATUS_ZLS_FINISHED_EN (0X00004000U) +#define RGX_CR_EVENT_STATUS_GPIO_ACK_SHIFT (13U) +#define RGX_CR_EVENT_STATUS_GPIO_ACK_CLRMSK (0XFFFFDFFFU) +#define RGX_CR_EVENT_STATUS_GPIO_ACK_EN (0X00002000U) +#define RGX_CR_EVENT_STATUS_GPIO_REQ_SHIFT (12U) +#define RGX_CR_EVENT_STATUS_GPIO_REQ_CLRMSK (0XFFFFEFFFU) +#define RGX_CR_EVENT_STATUS_GPIO_REQ_EN (0X00001000U) +#define RGX_CR_EVENT_STATUS_POWER_ABORT_SHIFT (11U) +#define RGX_CR_EVENT_STATUS_POWER_ABORT_CLRMSK (0XFFFFF7FFU) +#define RGX_CR_EVENT_STATUS_POWER_ABORT_EN (0X00000800U) +#define RGX_CR_EVENT_STATUS_POWER_COMPLETE_SHIFT (10U) +#define RGX_CR_EVENT_STATUS_POWER_COMPLETE_CLRMSK (0XFFFFFBFFU) +#define RGX_CR_EVENT_STATUS_POWER_COMPLETE_EN (0X00000400U) +#define RGX_CR_EVENT_STATUS_MMU_PAGE_FAULT_SHIFT (9U) +#define RGX_CR_EVENT_STATUS_MMU_PAGE_FAULT_CLRMSK (0XFFFFFDFFU) +#define RGX_CR_EVENT_STATUS_MMU_PAGE_FAULT_EN (0X00000200U) +#define RGX_CR_EVENT_STATUS_PM_3D_MEM_FREE_SHIFT (8U) +#define RGX_CR_EVENT_STATUS_PM_3D_MEM_FREE_CLRMSK (0XFFFFFEFFU) +#define RGX_CR_EVENT_STATUS_PM_3D_MEM_FREE_EN (0X00000100U) +#define RGX_CR_EVENT_STATUS_PM_OUT_OF_MEMORY_SHIFT (7U) +#define RGX_CR_EVENT_STATUS_PM_OUT_OF_MEMORY_CLRMSK (0XFFFFFF7FU) +#define RGX_CR_EVENT_STATUS_PM_OUT_OF_MEMORY_EN (0X00000080U) +#define RGX_CR_EVENT_STATUS_TA_TERMINATE_SHIFT (6U) +#define RGX_CR_EVENT_STATUS_TA_TERMINATE_CLRMSK (0XFFFFFFBFU) +#define RGX_CR_EVENT_STATUS_TA_TERMINATE_EN (0X00000040U) +#define RGX_CR_EVENT_STATUS_TA_FINISHED_SHIFT (5U) +#define RGX_CR_EVENT_STATUS_TA_FINISHED_CLRMSK (0XFFFFFFDFU) +#define RGX_CR_EVENT_STATUS_TA_FINISHED_EN (0X00000020U) +#define RGX_CR_EVENT_STATUS_ISP_END_MACROTILE_SHIFT (4U) +#define RGX_CR_EVENT_STATUS_ISP_END_MACROTILE_CLRMSK (0XFFFFFFEFU) +#define RGX_CR_EVENT_STATUS_ISP_END_MACROTILE_EN (0X00000010U) +#define RGX_CR_EVENT_STATUS_PIXELBE_END_RENDER_SHIFT (3U) +#define RGX_CR_EVENT_STATUS_PIXELBE_END_RENDER_CLRMSK (0XFFFFFFF7U) +#define RGX_CR_EVENT_STATUS_PIXELBE_END_RENDER_EN (0X00000008U) +#define RGX_CR_EVENT_STATUS_COMPUTE_FINISHED_SHIFT (2U) +#define RGX_CR_EVENT_STATUS_COMPUTE_FINISHED_CLRMSK (0XFFFFFFFBU) +#define RGX_CR_EVENT_STATUS_COMPUTE_FINISHED_EN (0X00000004U) +#define RGX_CR_EVENT_STATUS_KERNEL_FINISHED_SHIFT (1U) +#define RGX_CR_EVENT_STATUS_KERNEL_FINISHED_CLRMSK (0XFFFFFFFDU) +#define RGX_CR_EVENT_STATUS_KERNEL_FINISHED_EN (0X00000002U) +#define RGX_CR_EVENT_STATUS_TLA_COMPLETE_SHIFT (0U) +#define RGX_CR_EVENT_STATUS_TLA_COMPLETE_CLRMSK (0XFFFFFFFEU) +#define RGX_CR_EVENT_STATUS_TLA_COMPLETE_EN (0X00000001U) + + +/* + Register RGX_CR_TIMER +*/ +#define RGX_CR_TIMER (0x0160U) +#define RGX_CR_TIMER_MASKFULL (IMG_UINT64_C(0x8000FFFFFFFFFFFF)) +#define RGX_CR_TIMER_BIT31_SHIFT (63U) +#define RGX_CR_TIMER_BIT31_CLRMSK (IMG_UINT64_C(0X7FFFFFFFFFFFFFFF)) +#define RGX_CR_TIMER_BIT31_EN (IMG_UINT64_C(0X8000000000000000)) +#define RGX_CR_TIMER_VALUE_SHIFT (0U) +#define RGX_CR_TIMER_VALUE_CLRMSK (IMG_UINT64_C(0XFFFF000000000000)) + + +/* + Register RGX_CR_TLA_STATUS +*/ +#define RGX_CR_TLA_STATUS (0x0178U) +#define RGX_CR_TLA_STATUS_MASKFULL (IMG_UINT64_C(0xFFFFFFFFFFFFFFFF)) +#define RGX_CR_TLA_STATUS_BLIT_COUNT_SHIFT (39U) +#define RGX_CR_TLA_STATUS_BLIT_COUNT_CLRMSK (IMG_UINT64_C(0X0000007FFFFFFFFF)) +#define RGX_CR_TLA_STATUS_REQUEST_SHIFT (7U) +#define RGX_CR_TLA_STATUS_REQUEST_CLRMSK (IMG_UINT64_C(0XFFFFFF800000007F)) +#define RGX_CR_TLA_STATUS_FIFO_FULLNESS_SHIFT (1U) +#define RGX_CR_TLA_STATUS_FIFO_FULLNESS_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFF81)) +#define RGX_CR_TLA_STATUS_BUSY_SHIFT (0U) +#define RGX_CR_TLA_STATUS_BUSY_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFFE)) +#define RGX_CR_TLA_STATUS_BUSY_EN (IMG_UINT64_C(0X0000000000000001)) + + +/* + Register RGX_CR_PM_PARTIAL_RENDER_ENABLE +*/ +#define RGX_CR_PM_PARTIAL_RENDER_ENABLE (0x0338U) +#define RGX_CR_PM_PARTIAL_RENDER_ENABLE_MASKFULL (IMG_UINT64_C(0x0000000000000001)) +#define RGX_CR_PM_PARTIAL_RENDER_ENABLE_OP_SHIFT (0U) +#define RGX_CR_PM_PARTIAL_RENDER_ENABLE_OP_CLRMSK (0XFFFFFFFEU) +#define RGX_CR_PM_PARTIAL_RENDER_ENABLE_OP_EN (0X00000001U) + + +/* + Register RGX_CR_SIDEKICK_IDLE +*/ +#define RGX_CR_SIDEKICK_IDLE (0x03C8U) +#define RGX_CR_SIDEKICK_IDLE_MASKFULL (IMG_UINT64_C(0x000000000000007F)) +#define RGX_CR_SIDEKICK_IDLE_FB_CDC_SHIFT (6U) +#define RGX_CR_SIDEKICK_IDLE_FB_CDC_CLRMSK (0XFFFFFFBFU) +#define RGX_CR_SIDEKICK_IDLE_FB_CDC_EN (0X00000040U) +#define RGX_CR_SIDEKICK_IDLE_MMU_SHIFT (5U) +#define RGX_CR_SIDEKICK_IDLE_MMU_CLRMSK (0XFFFFFFDFU) +#define RGX_CR_SIDEKICK_IDLE_MMU_EN (0X00000020U) +#define RGX_CR_SIDEKICK_IDLE_BIF128_SHIFT (4U) +#define RGX_CR_SIDEKICK_IDLE_BIF128_CLRMSK (0XFFFFFFEFU) +#define RGX_CR_SIDEKICK_IDLE_BIF128_EN (0X00000010U) +#define RGX_CR_SIDEKICK_IDLE_TLA_SHIFT (3U) +#define RGX_CR_SIDEKICK_IDLE_TLA_CLRMSK (0XFFFFFFF7U) +#define RGX_CR_SIDEKICK_IDLE_TLA_EN (0X00000008U) +#define RGX_CR_SIDEKICK_IDLE_GARTEN_SHIFT (2U) +#define RGX_CR_SIDEKICK_IDLE_GARTEN_CLRMSK (0XFFFFFFFBU) +#define RGX_CR_SIDEKICK_IDLE_GARTEN_EN (0X00000004U) +#define RGX_CR_SIDEKICK_IDLE_HOSTIF_SHIFT (1U) +#define RGX_CR_SIDEKICK_IDLE_HOSTIF_CLRMSK (0XFFFFFFFDU) +#define RGX_CR_SIDEKICK_IDLE_HOSTIF_EN (0X00000002U) +#define RGX_CR_SIDEKICK_IDLE_SOCIF_SHIFT (0U) +#define RGX_CR_SIDEKICK_IDLE_SOCIF_CLRMSK (0XFFFFFFFEU) +#define RGX_CR_SIDEKICK_IDLE_SOCIF_EN (0X00000001U) + + +/* + Register RGX_CR_VDM_CONTEXT_STORE_STATUS +*/ +#define RGX_CR_VDM_CONTEXT_STORE_STATUS (0x0430U) +#define RGX_CR_VDM_CONTEXT_STORE_STATUS_MASKFULL (IMG_UINT64_C(0x00000000000000F3)) +#define RGX_CR_VDM_CONTEXT_STORE_STATUS_LAST_PIPE_SHIFT (4U) +#define RGX_CR_VDM_CONTEXT_STORE_STATUS_LAST_PIPE_CLRMSK (0XFFFFFF0FU) +#define RGX_CR_VDM_CONTEXT_STORE_STATUS_NEED_RESUME_SHIFT (1U) +#define RGX_CR_VDM_CONTEXT_STORE_STATUS_NEED_RESUME_CLRMSK (0XFFFFFFFDU) +#define RGX_CR_VDM_CONTEXT_STORE_STATUS_NEED_RESUME_EN (0X00000002U) +#define RGX_CR_VDM_CONTEXT_STORE_STATUS_COMPLETE_SHIFT (0U) +#define RGX_CR_VDM_CONTEXT_STORE_STATUS_COMPLETE_CLRMSK (0XFFFFFFFEU) +#define RGX_CR_VDM_CONTEXT_STORE_STATUS_COMPLETE_EN (0X00000001U) + + +/* + Register RGX_CR_VDM_CONTEXT_STORE_TASK0 +*/ +#define RGX_CR_VDM_CONTEXT_STORE_TASK0 (0x0438U) +#define RGX_CR_VDM_CONTEXT_STORE_TASK0_MASKFULL (IMG_UINT64_C(0xFFFFFFFFFFFFFFFF)) +#define RGX_CR_VDM_CONTEXT_STORE_TASK0_PDS_STATE1_SHIFT (32U) +#define RGX_CR_VDM_CONTEXT_STORE_TASK0_PDS_STATE1_CLRMSK (IMG_UINT64_C(0X00000000FFFFFFFF)) +#define RGX_CR_VDM_CONTEXT_STORE_TASK0_PDS_STATE0_SHIFT (0U) +#define RGX_CR_VDM_CONTEXT_STORE_TASK0_PDS_STATE0_CLRMSK (IMG_UINT64_C(0XFFFFFFFF00000000)) + + +/* + Register RGX_CR_VDM_CONTEXT_STORE_TASK1 +*/ +#define RGX_CR_VDM_CONTEXT_STORE_TASK1 (0x0440U) +#define RGX_CR_VDM_CONTEXT_STORE_TASK1_MASKFULL (IMG_UINT64_C(0x00000000FFFFFFFF)) +#define RGX_CR_VDM_CONTEXT_STORE_TASK1_PDS_STATE2_SHIFT (0U) +#define RGX_CR_VDM_CONTEXT_STORE_TASK1_PDS_STATE2_CLRMSK (00000000U) + + +/* + Register RGX_CR_VDM_CONTEXT_STORE_TASK2 +*/ +#define RGX_CR_VDM_CONTEXT_STORE_TASK2 (0x0448U) +#define RGX_CR_VDM_CONTEXT_STORE_TASK2_MASKFULL (IMG_UINT64_C(0xFFFFFFFFFFFFFFFF)) +#define RGX_CR_VDM_CONTEXT_STORE_TASK2_STREAM_OUT2_SHIFT (32U) +#define RGX_CR_VDM_CONTEXT_STORE_TASK2_STREAM_OUT2_CLRMSK (IMG_UINT64_C(0X00000000FFFFFFFF)) +#define RGX_CR_VDM_CONTEXT_STORE_TASK2_STREAM_OUT1_SHIFT (0U) +#define RGX_CR_VDM_CONTEXT_STORE_TASK2_STREAM_OUT1_CLRMSK (IMG_UINT64_C(0XFFFFFFFF00000000)) + + +/* + Register RGX_CR_VDM_CONTEXT_RESUME_TASK0 +*/ +#define RGX_CR_VDM_CONTEXT_RESUME_TASK0 (0x0450U) +#define RGX_CR_VDM_CONTEXT_RESUME_TASK0_MASKFULL (IMG_UINT64_C(0xFFFFFFFFFFFFFFFF)) +#define RGX_CR_VDM_CONTEXT_RESUME_TASK0_PDS_STATE1_SHIFT (32U) +#define RGX_CR_VDM_CONTEXT_RESUME_TASK0_PDS_STATE1_CLRMSK (IMG_UINT64_C(0X00000000FFFFFFFF)) +#define RGX_CR_VDM_CONTEXT_RESUME_TASK0_PDS_STATE0_SHIFT (0U) +#define RGX_CR_VDM_CONTEXT_RESUME_TASK0_PDS_STATE0_CLRMSK (IMG_UINT64_C(0XFFFFFFFF00000000)) + + +/* + Register RGX_CR_VDM_CONTEXT_RESUME_TASK1 +*/ +#define RGX_CR_VDM_CONTEXT_RESUME_TASK1 (0x0458U) +#define RGX_CR_VDM_CONTEXT_RESUME_TASK1_MASKFULL (IMG_UINT64_C(0x00000000FFFFFFFF)) +#define RGX_CR_VDM_CONTEXT_RESUME_TASK1_PDS_STATE2_SHIFT (0U) +#define RGX_CR_VDM_CONTEXT_RESUME_TASK1_PDS_STATE2_CLRMSK (00000000U) + + +/* + Register RGX_CR_VDM_CONTEXT_RESUME_TASK2 +*/ +#define RGX_CR_VDM_CONTEXT_RESUME_TASK2 (0x0460U) +#define RGX_CR_VDM_CONTEXT_RESUME_TASK2_MASKFULL (IMG_UINT64_C(0xFFFFFFFFFFFFFFFF)) +#define RGX_CR_VDM_CONTEXT_RESUME_TASK2_STREAM_OUT2_SHIFT (32U) +#define RGX_CR_VDM_CONTEXT_RESUME_TASK2_STREAM_OUT2_CLRMSK (IMG_UINT64_C(0X00000000FFFFFFFF)) +#define RGX_CR_VDM_CONTEXT_RESUME_TASK2_STREAM_OUT1_SHIFT (0U) +#define RGX_CR_VDM_CONTEXT_RESUME_TASK2_STREAM_OUT1_CLRMSK (IMG_UINT64_C(0XFFFFFFFF00000000)) + + +/* + Register RGX_CR_CDM_CONTEXT_STORE_STATUS +*/ +#define RGX_CR_CDM_CONTEXT_STORE_STATUS (0x04A0U) +#define RGX_CR_CDM_CONTEXT_STORE_STATUS_MASKFULL (IMG_UINT64_C(0x0000000000000003)) +#define RGX_CR_CDM_CONTEXT_STORE_STATUS_NEED_RESUME_SHIFT (1U) +#define RGX_CR_CDM_CONTEXT_STORE_STATUS_NEED_RESUME_CLRMSK (0XFFFFFFFDU) +#define RGX_CR_CDM_CONTEXT_STORE_STATUS_NEED_RESUME_EN (0X00000002U) +#define RGX_CR_CDM_CONTEXT_STORE_STATUS_COMPLETE_SHIFT (0U) +#define RGX_CR_CDM_CONTEXT_STORE_STATUS_COMPLETE_CLRMSK (0XFFFFFFFEU) +#define RGX_CR_CDM_CONTEXT_STORE_STATUS_COMPLETE_EN (0X00000001U) + + +/* + Register RGX_CR_CDM_CONTEXT_PDS0 +*/ +#define RGX_CR_CDM_CONTEXT_PDS0 (0x04A8U) +#define RGX_CR_CDM_CONTEXT_PDS0_MASKFULL (IMG_UINT64_C(0xFFFFFFF0FFFFFFF0)) +#define RGX_CR_CDM_CONTEXT_PDS0_DATA_ADDR_SHIFT (36U) +#define RGX_CR_CDM_CONTEXT_PDS0_DATA_ADDR_CLRMSK (IMG_UINT64_C(0X0000000FFFFFFFFF)) +#define RGX_CR_CDM_CONTEXT_PDS0_DATA_ADDR_ALIGNSHIFT (4U) +#define RGX_CR_CDM_CONTEXT_PDS0_DATA_ADDR_ALIGNSIZE (16U) +#define RGX_CR_CDM_CONTEXT_PDS0_CODE_ADDR_SHIFT (4U) +#define RGX_CR_CDM_CONTEXT_PDS0_CODE_ADDR_CLRMSK (IMG_UINT64_C(0XFFFFFFFF0000000F)) +#define RGX_CR_CDM_CONTEXT_PDS0_CODE_ADDR_ALIGNSHIFT (4U) +#define RGX_CR_CDM_CONTEXT_PDS0_CODE_ADDR_ALIGNSIZE (16U) + + +#if defined(RGX_FEATURE_PDS_TEMPSIZE8) +/* + Register RGX_CR_CDM_CONTEXT_PDS1 +*/ +#define RGX_CR_CDM_CONTEXT_PDS1 (0x04B0U) +#define RGX_CR_CDM_CONTEXT_PDS1_MASKFULL (IMG_UINT64_C(0x000000007FFFFFFF)) +#define RGX_CR_CDM_CONTEXT_PDS1_PDS_SEQ_DEP_SHIFT (30U) +#define RGX_CR_CDM_CONTEXT_PDS1_PDS_SEQ_DEP_CLRMSK (0XBFFFFFFFU) +#define RGX_CR_CDM_CONTEXT_PDS1_PDS_SEQ_DEP_EN (0X40000000U) +#define RGX_CR_CDM_CONTEXT_PDS1_USC_SEQ_DEP_SHIFT (29U) +#define RGX_CR_CDM_CONTEXT_PDS1_USC_SEQ_DEP_CLRMSK (0XDFFFFFFFU) +#define RGX_CR_CDM_CONTEXT_PDS1_USC_SEQ_DEP_EN (0X20000000U) +#define RGX_CR_CDM_CONTEXT_PDS1_TARGET_SHIFT (28U) +#define RGX_CR_CDM_CONTEXT_PDS1_TARGET_CLRMSK (0XEFFFFFFFU) +#define RGX_CR_CDM_CONTEXT_PDS1_TARGET_EN (0X10000000U) +#define RGX_CR_CDM_CONTEXT_PDS1_UNIFIED_SIZE_SHIFT (22U) +#define RGX_CR_CDM_CONTEXT_PDS1_UNIFIED_SIZE_CLRMSK (0XF03FFFFFU) +#define RGX_CR_CDM_CONTEXT_PDS1_COMMON_SHARED_SHIFT (21U) +#define RGX_CR_CDM_CONTEXT_PDS1_COMMON_SHARED_CLRMSK (0XFFDFFFFFU) +#define RGX_CR_CDM_CONTEXT_PDS1_COMMON_SHARED_EN (0X00200000U) +#define RGX_CR_CDM_CONTEXT_PDS1_COMMON_SIZE_SHIFT (12U) +#define RGX_CR_CDM_CONTEXT_PDS1_COMMON_SIZE_CLRMSK (0XFFE00FFFU) +#define RGX_CR_CDM_CONTEXT_PDS1_TEMP_SIZE_SHIFT (7U) +#define RGX_CR_CDM_CONTEXT_PDS1_TEMP_SIZE_CLRMSK (0XFFFFF07FU) +#define RGX_CR_CDM_CONTEXT_PDS1_DATA_SIZE_SHIFT (1U) +#define RGX_CR_CDM_CONTEXT_PDS1_DATA_SIZE_CLRMSK (0XFFFFFF81U) +#define RGX_CR_CDM_CONTEXT_PDS1_FENCE_SHIFT (0U) +#define RGX_CR_CDM_CONTEXT_PDS1_FENCE_CLRMSK (0XFFFFFFFEU) +#define RGX_CR_CDM_CONTEXT_PDS1_FENCE_EN (0X00000001U) +#endif /* RGX_FEATURE_PDS_TEMPSIZE8 */ + + +#if !defined(RGX_FEATURE_PDS_TEMPSIZE8) +/* + Register RGX_CR_CDM_CONTEXT_PDS1 +*/ +#define RGX_CR_CDM_CONTEXT_PDS1 (0x04B0U) +#define RGX_CR_CDM_CONTEXT_PDS1_MASKFULL (IMG_UINT64_C(0x000000003FFFFFFF)) +#define RGX_CR_CDM_CONTEXT_PDS1_PDS_SEQ_DEP_SHIFT (29U) +#define RGX_CR_CDM_CONTEXT_PDS1_PDS_SEQ_DEP_CLRMSK (0XDFFFFFFFU) +#define RGX_CR_CDM_CONTEXT_PDS1_PDS_SEQ_DEP_EN (0X20000000U) +#define RGX_CR_CDM_CONTEXT_PDS1_USC_SEQ_DEP_SHIFT (28U) +#define RGX_CR_CDM_CONTEXT_PDS1_USC_SEQ_DEP_CLRMSK (0XEFFFFFFFU) +#define RGX_CR_CDM_CONTEXT_PDS1_USC_SEQ_DEP_EN (0X10000000U) +#define RGX_CR_CDM_CONTEXT_PDS1_TARGET_SHIFT (27U) +#define RGX_CR_CDM_CONTEXT_PDS1_TARGET_CLRMSK (0XF7FFFFFFU) +#define RGX_CR_CDM_CONTEXT_PDS1_TARGET_EN (0X08000000U) +#define RGX_CR_CDM_CONTEXT_PDS1_UNIFIED_SIZE_SHIFT (21U) +#define RGX_CR_CDM_CONTEXT_PDS1_UNIFIED_SIZE_CLRMSK (0XF81FFFFFU) +#define RGX_CR_CDM_CONTEXT_PDS1_COMMON_SHARED_SHIFT (20U) +#define RGX_CR_CDM_CONTEXT_PDS1_COMMON_SHARED_CLRMSK (0XFFEFFFFFU) +#define RGX_CR_CDM_CONTEXT_PDS1_COMMON_SHARED_EN (0X00100000U) +#define RGX_CR_CDM_CONTEXT_PDS1_COMMON_SIZE_SHIFT (11U) +#define RGX_CR_CDM_CONTEXT_PDS1_COMMON_SIZE_CLRMSK (0XFFF007FFU) +#define RGX_CR_CDM_CONTEXT_PDS1_TEMP_SIZE_SHIFT (7U) +#define RGX_CR_CDM_CONTEXT_PDS1_TEMP_SIZE_CLRMSK (0XFFFFF87FU) +#define RGX_CR_CDM_CONTEXT_PDS1_DATA_SIZE_SHIFT (1U) +#define RGX_CR_CDM_CONTEXT_PDS1_DATA_SIZE_CLRMSK (0XFFFFFF81U) +#define RGX_CR_CDM_CONTEXT_PDS1_FENCE_SHIFT (0U) +#define RGX_CR_CDM_CONTEXT_PDS1_FENCE_CLRMSK (0XFFFFFFFEU) +#define RGX_CR_CDM_CONTEXT_PDS1_FENCE_EN (0X00000001U) +#endif /* !defined(RGX_FEATURE_PDS_TEMPSIZE8) */ + + +/* + Register RGX_CR_CDM_TERMINATE_PDS +*/ +#define RGX_CR_CDM_TERMINATE_PDS (0x04B8U) +#define RGX_CR_CDM_TERMINATE_PDS_MASKFULL (IMG_UINT64_C(0xFFFFFFF0FFFFFFF0)) +#define RGX_CR_CDM_TERMINATE_PDS_DATA_ADDR_SHIFT (36U) +#define RGX_CR_CDM_TERMINATE_PDS_DATA_ADDR_CLRMSK (IMG_UINT64_C(0X0000000FFFFFFFFF)) +#define RGX_CR_CDM_TERMINATE_PDS_DATA_ADDR_ALIGNSHIFT (4U) +#define RGX_CR_CDM_TERMINATE_PDS_DATA_ADDR_ALIGNSIZE (16U) +#define RGX_CR_CDM_TERMINATE_PDS_CODE_ADDR_SHIFT (4U) +#define RGX_CR_CDM_TERMINATE_PDS_CODE_ADDR_CLRMSK (IMG_UINT64_C(0XFFFFFFFF0000000F)) +#define RGX_CR_CDM_TERMINATE_PDS_CODE_ADDR_ALIGNSHIFT (4U) +#define RGX_CR_CDM_TERMINATE_PDS_CODE_ADDR_ALIGNSIZE (16U) + + +#if defined(RGX_FEATURE_PDS_TEMPSIZE8) +/* + Register RGX_CR_CDM_TERMINATE_PDS1 +*/ +#define RGX_CR_CDM_TERMINATE_PDS1 (0x04C0U) +#define RGX_CR_CDM_TERMINATE_PDS1_MASKFULL (IMG_UINT64_C(0x000000007FFFFFFF)) +#define RGX_CR_CDM_TERMINATE_PDS1_PDS_SEQ_DEP_SHIFT (30U) +#define RGX_CR_CDM_TERMINATE_PDS1_PDS_SEQ_DEP_CLRMSK (0XBFFFFFFFU) +#define RGX_CR_CDM_TERMINATE_PDS1_PDS_SEQ_DEP_EN (0X40000000U) +#define RGX_CR_CDM_TERMINATE_PDS1_USC_SEQ_DEP_SHIFT (29U) +#define RGX_CR_CDM_TERMINATE_PDS1_USC_SEQ_DEP_CLRMSK (0XDFFFFFFFU) +#define RGX_CR_CDM_TERMINATE_PDS1_USC_SEQ_DEP_EN (0X20000000U) +#define RGX_CR_CDM_TERMINATE_PDS1_TARGET_SHIFT (28U) +#define RGX_CR_CDM_TERMINATE_PDS1_TARGET_CLRMSK (0XEFFFFFFFU) +#define RGX_CR_CDM_TERMINATE_PDS1_TARGET_EN (0X10000000U) +#define RGX_CR_CDM_TERMINATE_PDS1_UNIFIED_SIZE_SHIFT (22U) +#define RGX_CR_CDM_TERMINATE_PDS1_UNIFIED_SIZE_CLRMSK (0XF03FFFFFU) +#define RGX_CR_CDM_TERMINATE_PDS1_COMMON_SHARED_SHIFT (21U) +#define RGX_CR_CDM_TERMINATE_PDS1_COMMON_SHARED_CLRMSK (0XFFDFFFFFU) +#define RGX_CR_CDM_TERMINATE_PDS1_COMMON_SHARED_EN (0X00200000U) +#define RGX_CR_CDM_TERMINATE_PDS1_COMMON_SIZE_SHIFT (12U) +#define RGX_CR_CDM_TERMINATE_PDS1_COMMON_SIZE_CLRMSK (0XFFE00FFFU) +#define RGX_CR_CDM_TERMINATE_PDS1_TEMP_SIZE_SHIFT (7U) +#define RGX_CR_CDM_TERMINATE_PDS1_TEMP_SIZE_CLRMSK (0XFFFFF07FU) +#define RGX_CR_CDM_TERMINATE_PDS1_DATA_SIZE_SHIFT (1U) +#define RGX_CR_CDM_TERMINATE_PDS1_DATA_SIZE_CLRMSK (0XFFFFFF81U) +#define RGX_CR_CDM_TERMINATE_PDS1_FENCE_SHIFT (0U) +#define RGX_CR_CDM_TERMINATE_PDS1_FENCE_CLRMSK (0XFFFFFFFEU) +#define RGX_CR_CDM_TERMINATE_PDS1_FENCE_EN (0X00000001U) +#endif /* RGX_FEATURE_PDS_TEMPSIZE8 */ + + +#if !defined(RGX_FEATURE_PDS_TEMPSIZE8) +/* + Register RGX_CR_CDM_TERMINATE_PDS1 +*/ +#define RGX_CR_CDM_TERMINATE_PDS1 (0x04C0U) +#define RGX_CR_CDM_TERMINATE_PDS1_MASKFULL (IMG_UINT64_C(0x000000003FFFFFFF)) +#define RGX_CR_CDM_TERMINATE_PDS1_PDS_SEQ_DEP_SHIFT (29U) +#define RGX_CR_CDM_TERMINATE_PDS1_PDS_SEQ_DEP_CLRMSK (0XDFFFFFFFU) +#define RGX_CR_CDM_TERMINATE_PDS1_PDS_SEQ_DEP_EN (0X20000000U) +#define RGX_CR_CDM_TERMINATE_PDS1_USC_SEQ_DEP_SHIFT (28U) +#define RGX_CR_CDM_TERMINATE_PDS1_USC_SEQ_DEP_CLRMSK (0XEFFFFFFFU) +#define RGX_CR_CDM_TERMINATE_PDS1_USC_SEQ_DEP_EN (0X10000000U) +#define RGX_CR_CDM_TERMINATE_PDS1_TARGET_SHIFT (27U) +#define RGX_CR_CDM_TERMINATE_PDS1_TARGET_CLRMSK (0XF7FFFFFFU) +#define RGX_CR_CDM_TERMINATE_PDS1_TARGET_EN (0X08000000U) +#define RGX_CR_CDM_TERMINATE_PDS1_UNIFIED_SIZE_SHIFT (21U) +#define RGX_CR_CDM_TERMINATE_PDS1_UNIFIED_SIZE_CLRMSK (0XF81FFFFFU) +#define RGX_CR_CDM_TERMINATE_PDS1_COMMON_SHARED_SHIFT (20U) +#define RGX_CR_CDM_TERMINATE_PDS1_COMMON_SHARED_CLRMSK (0XFFEFFFFFU) +#define RGX_CR_CDM_TERMINATE_PDS1_COMMON_SHARED_EN (0X00100000U) +#define RGX_CR_CDM_TERMINATE_PDS1_COMMON_SIZE_SHIFT (11U) +#define RGX_CR_CDM_TERMINATE_PDS1_COMMON_SIZE_CLRMSK (0XFFF007FFU) +#define RGX_CR_CDM_TERMINATE_PDS1_TEMP_SIZE_SHIFT (7U) +#define RGX_CR_CDM_TERMINATE_PDS1_TEMP_SIZE_CLRMSK (0XFFFFF87FU) +#define RGX_CR_CDM_TERMINATE_PDS1_DATA_SIZE_SHIFT (1U) +#define RGX_CR_CDM_TERMINATE_PDS1_DATA_SIZE_CLRMSK (0XFFFFFF81U) +#define RGX_CR_CDM_TERMINATE_PDS1_FENCE_SHIFT (0U) +#define RGX_CR_CDM_TERMINATE_PDS1_FENCE_CLRMSK (0XFFFFFFFEU) +#define RGX_CR_CDM_TERMINATE_PDS1_FENCE_EN (0X00000001U) +#endif /* !defined(RGX_FEATURE_PDS_TEMPSIZE8) */ + + +/* + Register RGX_CR_META_SP_MSLVDATAX +*/ +#define RGX_CR_META_SP_MSLVDATAX (0x0A00U) +#define RGX_CR_META_SP_MSLVDATAX_MASKFULL (IMG_UINT64_C(0x00000000FFFFFFFF)) +#define RGX_CR_META_SP_MSLVDATAX_MSLVDATAX_SHIFT (0U) +#define RGX_CR_META_SP_MSLVDATAX_MSLVDATAX_CLRMSK (00000000U) + + +/* + Register RGX_CR_META_SP_MSLVDATAT +*/ +#define RGX_CR_META_SP_MSLVDATAT (0x0A08U) +#define RGX_CR_META_SP_MSLVDATAT_MASKFULL (IMG_UINT64_C(0x00000000FFFFFFFF)) +#define RGX_CR_META_SP_MSLVDATAT_MSLVDATAT_SHIFT (0U) +#define RGX_CR_META_SP_MSLVDATAT_MSLVDATAT_CLRMSK (00000000U) + + +/* + Register RGX_CR_META_SP_MSLVCTRL0 +*/ +#define RGX_CR_META_SP_MSLVCTRL0 (0x0A10U) +#define RGX_CR_META_SP_MSLVCTRL0_MASKFULL (IMG_UINT64_C(0x00000000FFFFFFFF)) +#define RGX_CR_META_SP_MSLVCTRL0_ADDR_SHIFT (2U) +#define RGX_CR_META_SP_MSLVCTRL0_ADDR_CLRMSK (0X00000003U) +#define RGX_CR_META_SP_MSLVCTRL0_AUTOINCR_SHIFT (1U) +#define RGX_CR_META_SP_MSLVCTRL0_AUTOINCR_CLRMSK (0XFFFFFFFDU) +#define RGX_CR_META_SP_MSLVCTRL0_AUTOINCR_EN (0X00000002U) +#define RGX_CR_META_SP_MSLVCTRL0_RD_SHIFT (0U) +#define RGX_CR_META_SP_MSLVCTRL0_RD_CLRMSK (0XFFFFFFFEU) +#define RGX_CR_META_SP_MSLVCTRL0_RD_EN (0X00000001U) + + +/* + Register RGX_CR_META_SP_MSLVCTRL1 +*/ +#define RGX_CR_META_SP_MSLVCTRL1 (0x0A18U) +#define RGX_CR_META_SP_MSLVCTRL1_MASKFULL (IMG_UINT64_C(0x00000000F7F4003F)) +#define RGX_CR_META_SP_MSLVCTRL1_DEFERRTHREAD_SHIFT (30U) +#define RGX_CR_META_SP_MSLVCTRL1_DEFERRTHREAD_CLRMSK (0X3FFFFFFFU) +#define RGX_CR_META_SP_MSLVCTRL1_LOCK2_INTERLOCK_SHIFT (29U) +#define RGX_CR_META_SP_MSLVCTRL1_LOCK2_INTERLOCK_CLRMSK (0XDFFFFFFFU) +#define RGX_CR_META_SP_MSLVCTRL1_LOCK2_INTERLOCK_EN (0X20000000U) +#define RGX_CR_META_SP_MSLVCTRL1_ATOMIC_INTERLOCK_SHIFT (28U) +#define RGX_CR_META_SP_MSLVCTRL1_ATOMIC_INTERLOCK_CLRMSK (0XEFFFFFFFU) +#define RGX_CR_META_SP_MSLVCTRL1_ATOMIC_INTERLOCK_EN (0X10000000U) +#define RGX_CR_META_SP_MSLVCTRL1_GBLPORT_IDLE_SHIFT (26U) +#define RGX_CR_META_SP_MSLVCTRL1_GBLPORT_IDLE_CLRMSK (0XFBFFFFFFU) +#define RGX_CR_META_SP_MSLVCTRL1_GBLPORT_IDLE_EN (0X04000000U) +#define RGX_CR_META_SP_MSLVCTRL1_COREMEM_IDLE_SHIFT (25U) +#define RGX_CR_META_SP_MSLVCTRL1_COREMEM_IDLE_CLRMSK (0XFDFFFFFFU) +#define RGX_CR_META_SP_MSLVCTRL1_COREMEM_IDLE_EN (0X02000000U) +#define RGX_CR_META_SP_MSLVCTRL1_READY_SHIFT (24U) +#define RGX_CR_META_SP_MSLVCTRL1_READY_CLRMSK (0XFEFFFFFFU) +#define RGX_CR_META_SP_MSLVCTRL1_READY_EN (0X01000000U) +#define RGX_CR_META_SP_MSLVCTRL1_DEFERRID_SHIFT (21U) +#define RGX_CR_META_SP_MSLVCTRL1_DEFERRID_CLRMSK (0XFF1FFFFFU) +#define RGX_CR_META_SP_MSLVCTRL1_DEFERR_SHIFT (20U) +#define RGX_CR_META_SP_MSLVCTRL1_DEFERR_CLRMSK (0XFFEFFFFFU) +#define RGX_CR_META_SP_MSLVCTRL1_DEFERR_EN (0X00100000U) +#define RGX_CR_META_SP_MSLVCTRL1_WR_ACTIVE_SHIFT (18U) +#define RGX_CR_META_SP_MSLVCTRL1_WR_ACTIVE_CLRMSK (0XFFFBFFFFU) +#define RGX_CR_META_SP_MSLVCTRL1_WR_ACTIVE_EN (0X00040000U) +#define RGX_CR_META_SP_MSLVCTRL1_THREAD_SHIFT (4U) +#define RGX_CR_META_SP_MSLVCTRL1_THREAD_CLRMSK (0XFFFFFFCFU) +#define RGX_CR_META_SP_MSLVCTRL1_TRANS_SIZE_SHIFT (2U) +#define RGX_CR_META_SP_MSLVCTRL1_TRANS_SIZE_CLRMSK (0XFFFFFFF3U) +#define RGX_CR_META_SP_MSLVCTRL1_BYTE_ROUND_SHIFT (0U) +#define RGX_CR_META_SP_MSLVCTRL1_BYTE_ROUND_CLRMSK (0XFFFFFFFCU) + + +/* + Register RGX_CR_META_SP_MSLVHANDSHKE +*/ +#define RGX_CR_META_SP_MSLVHANDSHKE (0x0A50U) +#define RGX_CR_META_SP_MSLVHANDSHKE_MASKFULL (IMG_UINT64_C(0x000000000000000F)) +#define RGX_CR_META_SP_MSLVHANDSHKE_INPUT_SHIFT (2U) +#define RGX_CR_META_SP_MSLVHANDSHKE_INPUT_CLRMSK (0XFFFFFFF3U) +#define RGX_CR_META_SP_MSLVHANDSHKE_OUTPUT_SHIFT (0U) +#define RGX_CR_META_SP_MSLVHANDSHKE_OUTPUT_CLRMSK (0XFFFFFFFCU) + + +/* + Register RGX_CR_META_SP_MSLVT0KICK +*/ +#define RGX_CR_META_SP_MSLVT0KICK (0x0A80U) +#define RGX_CR_META_SP_MSLVT0KICK_MASKFULL (IMG_UINT64_C(0x000000000000FFFF)) +#define RGX_CR_META_SP_MSLVT0KICK_MSLVT0KICK_SHIFT (0U) +#define RGX_CR_META_SP_MSLVT0KICK_MSLVT0KICK_CLRMSK (0XFFFF0000U) + + +/* + Register RGX_CR_META_SP_MSLVT0KICKI +*/ +#define RGX_CR_META_SP_MSLVT0KICKI (0x0A88U) +#define RGX_CR_META_SP_MSLVT0KICKI_MASKFULL (IMG_UINT64_C(0x000000000000FFFF)) +#define RGX_CR_META_SP_MSLVT0KICKI_MSLVT0KICKI_SHIFT (0U) +#define RGX_CR_META_SP_MSLVT0KICKI_MSLVT0KICKI_CLRMSK (0XFFFF0000U) + + +/* + Register RGX_CR_META_SP_MSLVT1KICK +*/ +#define RGX_CR_META_SP_MSLVT1KICK (0x0A90U) +#define RGX_CR_META_SP_MSLVT1KICK_MASKFULL (IMG_UINT64_C(0x000000000000FFFF)) +#define RGX_CR_META_SP_MSLVT1KICK_MSLVT1KICK_SHIFT (0U) +#define RGX_CR_META_SP_MSLVT1KICK_MSLVT1KICK_CLRMSK (0XFFFF0000U) + + +/* + Register RGX_CR_META_SP_MSLVT1KICKI +*/ +#define RGX_CR_META_SP_MSLVT1KICKI (0x0A98U) +#define RGX_CR_META_SP_MSLVT1KICKI_MASKFULL (IMG_UINT64_C(0x000000000000FFFF)) +#define RGX_CR_META_SP_MSLVT1KICKI_MSLVT1KICKI_SHIFT (0U) +#define RGX_CR_META_SP_MSLVT1KICKI_MSLVT1KICKI_CLRMSK (0XFFFF0000U) + + +/* + Register RGX_CR_META_SP_MSLVT2KICK +*/ +#define RGX_CR_META_SP_MSLVT2KICK (0x0AA0U) +#define RGX_CR_META_SP_MSLVT2KICK_MASKFULL (IMG_UINT64_C(0x000000000000FFFF)) +#define RGX_CR_META_SP_MSLVT2KICK_MSLVT2KICK_SHIFT (0U) +#define RGX_CR_META_SP_MSLVT2KICK_MSLVT2KICK_CLRMSK (0XFFFF0000U) + + +/* + Register RGX_CR_META_SP_MSLVT2KICKI +*/ +#define RGX_CR_META_SP_MSLVT2KICKI (0x0AA8U) +#define RGX_CR_META_SP_MSLVT2KICKI_MASKFULL (IMG_UINT64_C(0x000000000000FFFF)) +#define RGX_CR_META_SP_MSLVT2KICKI_MSLVT2KICKI_SHIFT (0U) +#define RGX_CR_META_SP_MSLVT2KICKI_MSLVT2KICKI_CLRMSK (0XFFFF0000U) + + +/* + Register RGX_CR_META_SP_MSLVT3KICK +*/ +#define RGX_CR_META_SP_MSLVT3KICK (0x0AB0U) +#define RGX_CR_META_SP_MSLVT3KICK_MASKFULL (IMG_UINT64_C(0x000000000000FFFF)) +#define RGX_CR_META_SP_MSLVT3KICK_MSLVT3KICK_SHIFT (0U) +#define RGX_CR_META_SP_MSLVT3KICK_MSLVT3KICK_CLRMSK (0XFFFF0000U) + + +/* + Register RGX_CR_META_SP_MSLVT3KICKI +*/ +#define RGX_CR_META_SP_MSLVT3KICKI (0x0AB8U) +#define RGX_CR_META_SP_MSLVT3KICKI_MASKFULL (IMG_UINT64_C(0x000000000000FFFF)) +#define RGX_CR_META_SP_MSLVT3KICKI_MSLVT3KICKI_SHIFT (0U) +#define RGX_CR_META_SP_MSLVT3KICKI_MSLVT3KICKI_CLRMSK (0XFFFF0000U) + + +/* + Register RGX_CR_META_SP_MSLVRST +*/ +#define RGX_CR_META_SP_MSLVRST (0x0AC0U) +#define RGX_CR_META_SP_MSLVRST_MASKFULL (IMG_UINT64_C(0x0000000000000001)) +#define RGX_CR_META_SP_MSLVRST_SOFTRESET_SHIFT (0U) +#define RGX_CR_META_SP_MSLVRST_SOFTRESET_CLRMSK (0XFFFFFFFEU) +#define RGX_CR_META_SP_MSLVRST_SOFTRESET_EN (0X00000001U) + + +/* + Register RGX_CR_META_SP_MSLVIRQSTATUS +*/ +#define RGX_CR_META_SP_MSLVIRQSTATUS (0x0AC8U) +#define RGX_CR_META_SP_MSLVIRQSTATUS_MASKFULL (IMG_UINT64_C(0x000000000000000C)) +#define RGX_CR_META_SP_MSLVIRQSTATUS_TRIGVECT3_SHIFT (3U) +#define RGX_CR_META_SP_MSLVIRQSTATUS_TRIGVECT3_CLRMSK (0XFFFFFFF7U) +#define RGX_CR_META_SP_MSLVIRQSTATUS_TRIGVECT3_EN (0X00000008U) +#define RGX_CR_META_SP_MSLVIRQSTATUS_TRIGVECT2_SHIFT (2U) +#define RGX_CR_META_SP_MSLVIRQSTATUS_TRIGVECT2_CLRMSK (0XFFFFFFFBU) +#define RGX_CR_META_SP_MSLVIRQSTATUS_TRIGVECT2_EN (0X00000004U) + + +/* + Register RGX_CR_META_SP_MSLVIRQENABLE +*/ +#define RGX_CR_META_SP_MSLVIRQENABLE (0x0AD0U) +#define RGX_CR_META_SP_MSLVIRQENABLE_MASKFULL (IMG_UINT64_C(0x000000000000000C)) +#define RGX_CR_META_SP_MSLVIRQENABLE_EVENT1_SHIFT (3U) +#define RGX_CR_META_SP_MSLVIRQENABLE_EVENT1_CLRMSK (0XFFFFFFF7U) +#define RGX_CR_META_SP_MSLVIRQENABLE_EVENT1_EN (0X00000008U) +#define RGX_CR_META_SP_MSLVIRQENABLE_EVENT0_SHIFT (2U) +#define RGX_CR_META_SP_MSLVIRQENABLE_EVENT0_CLRMSK (0XFFFFFFFBU) +#define RGX_CR_META_SP_MSLVIRQENABLE_EVENT0_EN (0X00000004U) + + +/* + Register RGX_CR_META_SP_MSLVIRQLEVEL +*/ +#define RGX_CR_META_SP_MSLVIRQLEVEL (0x0AD8U) +#define RGX_CR_META_SP_MSLVIRQLEVEL_MASKFULL (IMG_UINT64_C(0x0000000000000001)) +#define RGX_CR_META_SP_MSLVIRQLEVEL_MODE_SHIFT (0U) +#define RGX_CR_META_SP_MSLVIRQLEVEL_MODE_CLRMSK (0XFFFFFFFEU) +#define RGX_CR_META_SP_MSLVIRQLEVEL_MODE_EN (0X00000001U) + + +/* + Register RGX_CR_MTS_SCHEDULE +*/ +#define RGX_CR_MTS_SCHEDULE (0x0B00U) +#define RGX_CR_MTS_SCHEDULE_MASKFULL (IMG_UINT64_C(0x00000000000001FF)) +#define RGX_CR_MTS_SCHEDULE_HOST_SHIFT (8U) +#define RGX_CR_MTS_SCHEDULE_HOST_CLRMSK (0XFFFFFEFFU) +#define RGX_CR_MTS_SCHEDULE_HOST_BG_TIMER (00000000U) +#define RGX_CR_MTS_SCHEDULE_HOST_HOST (0X00000100U) +#define RGX_CR_MTS_SCHEDULE_PRIORITY_SHIFT (6U) +#define RGX_CR_MTS_SCHEDULE_PRIORITY_CLRMSK (0XFFFFFF3FU) +#define RGX_CR_MTS_SCHEDULE_PRIORITY_PRT0 (00000000U) +#define RGX_CR_MTS_SCHEDULE_PRIORITY_PRT1 (0X00000040U) +#define RGX_CR_MTS_SCHEDULE_PRIORITY_PRT2 (0X00000080U) +#define RGX_CR_MTS_SCHEDULE_PRIORITY_PRT3 (0X000000C0U) +#define RGX_CR_MTS_SCHEDULE_CONTEXT_SHIFT (5U) +#define RGX_CR_MTS_SCHEDULE_CONTEXT_CLRMSK (0XFFFFFFDFU) +#define RGX_CR_MTS_SCHEDULE_CONTEXT_BGCTX (00000000U) +#define RGX_CR_MTS_SCHEDULE_CONTEXT_INTCTX (0X00000020U) +#define RGX_CR_MTS_SCHEDULE_TASK_SHIFT (4U) +#define RGX_CR_MTS_SCHEDULE_TASK_CLRMSK (0XFFFFFFEFU) +#define RGX_CR_MTS_SCHEDULE_TASK_NON_COUNTED (00000000U) +#define RGX_CR_MTS_SCHEDULE_TASK_COUNTED (0X00000010U) +#define RGX_CR_MTS_SCHEDULE_DM_SHIFT (0U) +#define RGX_CR_MTS_SCHEDULE_DM_CLRMSK (0XFFFFFFF0U) +#define RGX_CR_MTS_SCHEDULE_DM_DM0 (00000000U) +#define RGX_CR_MTS_SCHEDULE_DM_DM1 (0X00000001U) +#define RGX_CR_MTS_SCHEDULE_DM_DM2 (0X00000002U) +#define RGX_CR_MTS_SCHEDULE_DM_DM3 (0X00000003U) +#define RGX_CR_MTS_SCHEDULE_DM_DM4 (0X00000004U) +#define RGX_CR_MTS_SCHEDULE_DM_DM5 (0X00000005U) +#define RGX_CR_MTS_SCHEDULE_DM_DM6 (0X00000006U) +#define RGX_CR_MTS_SCHEDULE_DM_DM7 (0X00000007U) +#define RGX_CR_MTS_SCHEDULE_DM_DM_ALL (0X0000000FU) + + +/* + Register RGX_CR_MTS_SCHEDULE1 +*/ +#define RGX_CR_MTS_SCHEDULE1 (0x10B00U) +#define RGX_CR_MTS_SCHEDULE1_MASKFULL (IMG_UINT64_C(0x00000000000001FF)) +#define RGX_CR_MTS_SCHEDULE1_HOST_SHIFT (8U) +#define RGX_CR_MTS_SCHEDULE1_HOST_CLRMSK (0XFFFFFEFFU) +#define RGX_CR_MTS_SCHEDULE1_HOST_BG_TIMER (00000000U) +#define RGX_CR_MTS_SCHEDULE1_HOST_HOST (0X00000100U) +#define RGX_CR_MTS_SCHEDULE1_PRIORITY_SHIFT (6U) +#define RGX_CR_MTS_SCHEDULE1_PRIORITY_CLRMSK (0XFFFFFF3FU) +#define RGX_CR_MTS_SCHEDULE1_PRIORITY_PRT0 (00000000U) +#define RGX_CR_MTS_SCHEDULE1_PRIORITY_PRT1 (0X00000040U) +#define RGX_CR_MTS_SCHEDULE1_PRIORITY_PRT2 (0X00000080U) +#define RGX_CR_MTS_SCHEDULE1_PRIORITY_PRT3 (0X000000C0U) +#define RGX_CR_MTS_SCHEDULE1_CONTEXT_SHIFT (5U) +#define RGX_CR_MTS_SCHEDULE1_CONTEXT_CLRMSK (0XFFFFFFDFU) +#define RGX_CR_MTS_SCHEDULE1_CONTEXT_BGCTX (00000000U) +#define RGX_CR_MTS_SCHEDULE1_CONTEXT_INTCTX (0X00000020U) +#define RGX_CR_MTS_SCHEDULE1_TASK_SHIFT (4U) +#define RGX_CR_MTS_SCHEDULE1_TASK_CLRMSK (0XFFFFFFEFU) +#define RGX_CR_MTS_SCHEDULE1_TASK_NON_COUNTED (00000000U) +#define RGX_CR_MTS_SCHEDULE1_TASK_COUNTED (0X00000010U) +#define RGX_CR_MTS_SCHEDULE1_DM_SHIFT (0U) +#define RGX_CR_MTS_SCHEDULE1_DM_CLRMSK (0XFFFFFFF0U) +#define RGX_CR_MTS_SCHEDULE1_DM_DM0 (00000000U) +#define RGX_CR_MTS_SCHEDULE1_DM_DM1 (0X00000001U) +#define RGX_CR_MTS_SCHEDULE1_DM_DM2 (0X00000002U) +#define RGX_CR_MTS_SCHEDULE1_DM_DM3 (0X00000003U) +#define RGX_CR_MTS_SCHEDULE1_DM_DM4 (0X00000004U) +#define RGX_CR_MTS_SCHEDULE1_DM_DM5 (0X00000005U) +#define RGX_CR_MTS_SCHEDULE1_DM_DM6 (0X00000006U) +#define RGX_CR_MTS_SCHEDULE1_DM_DM7 (0X00000007U) +#define RGX_CR_MTS_SCHEDULE1_DM_DM_ALL (0X0000000FU) + + +/* + Register RGX_CR_MTS_SCHEDULE2 +*/ +#define RGX_CR_MTS_SCHEDULE2 (0x20B00U) +#define RGX_CR_MTS_SCHEDULE2_MASKFULL (IMG_UINT64_C(0x00000000000001FF)) +#define RGX_CR_MTS_SCHEDULE2_HOST_SHIFT (8U) +#define RGX_CR_MTS_SCHEDULE2_HOST_CLRMSK (0XFFFFFEFFU) +#define RGX_CR_MTS_SCHEDULE2_HOST_BG_TIMER (00000000U) +#define RGX_CR_MTS_SCHEDULE2_HOST_HOST (0X00000100U) +#define RGX_CR_MTS_SCHEDULE2_PRIORITY_SHIFT (6U) +#define RGX_CR_MTS_SCHEDULE2_PRIORITY_CLRMSK (0XFFFFFF3FU) +#define RGX_CR_MTS_SCHEDULE2_PRIORITY_PRT0 (00000000U) +#define RGX_CR_MTS_SCHEDULE2_PRIORITY_PRT1 (0X00000040U) +#define RGX_CR_MTS_SCHEDULE2_PRIORITY_PRT2 (0X00000080U) +#define RGX_CR_MTS_SCHEDULE2_PRIORITY_PRT3 (0X000000C0U) +#define RGX_CR_MTS_SCHEDULE2_CONTEXT_SHIFT (5U) +#define RGX_CR_MTS_SCHEDULE2_CONTEXT_CLRMSK (0XFFFFFFDFU) +#define RGX_CR_MTS_SCHEDULE2_CONTEXT_BGCTX (00000000U) +#define RGX_CR_MTS_SCHEDULE2_CONTEXT_INTCTX (0X00000020U) +#define RGX_CR_MTS_SCHEDULE2_TASK_SHIFT (4U) +#define RGX_CR_MTS_SCHEDULE2_TASK_CLRMSK (0XFFFFFFEFU) +#define RGX_CR_MTS_SCHEDULE2_TASK_NON_COUNTED (00000000U) +#define RGX_CR_MTS_SCHEDULE2_TASK_COUNTED (0X00000010U) +#define RGX_CR_MTS_SCHEDULE2_DM_SHIFT (0U) +#define RGX_CR_MTS_SCHEDULE2_DM_CLRMSK (0XFFFFFFF0U) +#define RGX_CR_MTS_SCHEDULE2_DM_DM0 (00000000U) +#define RGX_CR_MTS_SCHEDULE2_DM_DM1 (0X00000001U) +#define RGX_CR_MTS_SCHEDULE2_DM_DM2 (0X00000002U) +#define RGX_CR_MTS_SCHEDULE2_DM_DM3 (0X00000003U) +#define RGX_CR_MTS_SCHEDULE2_DM_DM4 (0X00000004U) +#define RGX_CR_MTS_SCHEDULE2_DM_DM5 (0X00000005U) +#define RGX_CR_MTS_SCHEDULE2_DM_DM6 (0X00000006U) +#define RGX_CR_MTS_SCHEDULE2_DM_DM7 (0X00000007U) +#define RGX_CR_MTS_SCHEDULE2_DM_DM_ALL (0X0000000FU) + + +/* + Register RGX_CR_MTS_SCHEDULE3 +*/ +#define RGX_CR_MTS_SCHEDULE3 (0x30B00U) +#define RGX_CR_MTS_SCHEDULE3_MASKFULL (IMG_UINT64_C(0x00000000000001FF)) +#define RGX_CR_MTS_SCHEDULE3_HOST_SHIFT (8U) +#define RGX_CR_MTS_SCHEDULE3_HOST_CLRMSK (0XFFFFFEFFU) +#define RGX_CR_MTS_SCHEDULE3_HOST_BG_TIMER (00000000U) +#define RGX_CR_MTS_SCHEDULE3_HOST_HOST (0X00000100U) +#define RGX_CR_MTS_SCHEDULE3_PRIORITY_SHIFT (6U) +#define RGX_CR_MTS_SCHEDULE3_PRIORITY_CLRMSK (0XFFFFFF3FU) +#define RGX_CR_MTS_SCHEDULE3_PRIORITY_PRT0 (00000000U) +#define RGX_CR_MTS_SCHEDULE3_PRIORITY_PRT1 (0X00000040U) +#define RGX_CR_MTS_SCHEDULE3_PRIORITY_PRT2 (0X00000080U) +#define RGX_CR_MTS_SCHEDULE3_PRIORITY_PRT3 (0X000000C0U) +#define RGX_CR_MTS_SCHEDULE3_CONTEXT_SHIFT (5U) +#define RGX_CR_MTS_SCHEDULE3_CONTEXT_CLRMSK (0XFFFFFFDFU) +#define RGX_CR_MTS_SCHEDULE3_CONTEXT_BGCTX (00000000U) +#define RGX_CR_MTS_SCHEDULE3_CONTEXT_INTCTX (0X00000020U) +#define RGX_CR_MTS_SCHEDULE3_TASK_SHIFT (4U) +#define RGX_CR_MTS_SCHEDULE3_TASK_CLRMSK (0XFFFFFFEFU) +#define RGX_CR_MTS_SCHEDULE3_TASK_NON_COUNTED (00000000U) +#define RGX_CR_MTS_SCHEDULE3_TASK_COUNTED (0X00000010U) +#define RGX_CR_MTS_SCHEDULE3_DM_SHIFT (0U) +#define RGX_CR_MTS_SCHEDULE3_DM_CLRMSK (0XFFFFFFF0U) +#define RGX_CR_MTS_SCHEDULE3_DM_DM0 (00000000U) +#define RGX_CR_MTS_SCHEDULE3_DM_DM1 (0X00000001U) +#define RGX_CR_MTS_SCHEDULE3_DM_DM2 (0X00000002U) +#define RGX_CR_MTS_SCHEDULE3_DM_DM3 (0X00000003U) +#define RGX_CR_MTS_SCHEDULE3_DM_DM4 (0X00000004U) +#define RGX_CR_MTS_SCHEDULE3_DM_DM5 (0X00000005U) +#define RGX_CR_MTS_SCHEDULE3_DM_DM6 (0X00000006U) +#define RGX_CR_MTS_SCHEDULE3_DM_DM7 (0X00000007U) +#define RGX_CR_MTS_SCHEDULE3_DM_DM_ALL (0X0000000FU) + + +/* + Register RGX_CR_MTS_SCHEDULE4 +*/ +#define RGX_CR_MTS_SCHEDULE4 (0x40B00U) +#define RGX_CR_MTS_SCHEDULE4_MASKFULL (IMG_UINT64_C(0x00000000000001FF)) +#define RGX_CR_MTS_SCHEDULE4_HOST_SHIFT (8U) +#define RGX_CR_MTS_SCHEDULE4_HOST_CLRMSK (0XFFFFFEFFU) +#define RGX_CR_MTS_SCHEDULE4_HOST_BG_TIMER (00000000U) +#define RGX_CR_MTS_SCHEDULE4_HOST_HOST (0X00000100U) +#define RGX_CR_MTS_SCHEDULE4_PRIORITY_SHIFT (6U) +#define RGX_CR_MTS_SCHEDULE4_PRIORITY_CLRMSK (0XFFFFFF3FU) +#define RGX_CR_MTS_SCHEDULE4_PRIORITY_PRT0 (00000000U) +#define RGX_CR_MTS_SCHEDULE4_PRIORITY_PRT1 (0X00000040U) +#define RGX_CR_MTS_SCHEDULE4_PRIORITY_PRT2 (0X00000080U) +#define RGX_CR_MTS_SCHEDULE4_PRIORITY_PRT3 (0X000000C0U) +#define RGX_CR_MTS_SCHEDULE4_CONTEXT_SHIFT (5U) +#define RGX_CR_MTS_SCHEDULE4_CONTEXT_CLRMSK (0XFFFFFFDFU) +#define RGX_CR_MTS_SCHEDULE4_CONTEXT_BGCTX (00000000U) +#define RGX_CR_MTS_SCHEDULE4_CONTEXT_INTCTX (0X00000020U) +#define RGX_CR_MTS_SCHEDULE4_TASK_SHIFT (4U) +#define RGX_CR_MTS_SCHEDULE4_TASK_CLRMSK (0XFFFFFFEFU) +#define RGX_CR_MTS_SCHEDULE4_TASK_NON_COUNTED (00000000U) +#define RGX_CR_MTS_SCHEDULE4_TASK_COUNTED (0X00000010U) +#define RGX_CR_MTS_SCHEDULE4_DM_SHIFT (0U) +#define RGX_CR_MTS_SCHEDULE4_DM_CLRMSK (0XFFFFFFF0U) +#define RGX_CR_MTS_SCHEDULE4_DM_DM0 (00000000U) +#define RGX_CR_MTS_SCHEDULE4_DM_DM1 (0X00000001U) +#define RGX_CR_MTS_SCHEDULE4_DM_DM2 (0X00000002U) +#define RGX_CR_MTS_SCHEDULE4_DM_DM3 (0X00000003U) +#define RGX_CR_MTS_SCHEDULE4_DM_DM4 (0X00000004U) +#define RGX_CR_MTS_SCHEDULE4_DM_DM5 (0X00000005U) +#define RGX_CR_MTS_SCHEDULE4_DM_DM6 (0X00000006U) +#define RGX_CR_MTS_SCHEDULE4_DM_DM7 (0X00000007U) +#define RGX_CR_MTS_SCHEDULE4_DM_DM_ALL (0X0000000FU) + + +/* + Register RGX_CR_MTS_SCHEDULE5 +*/ +#define RGX_CR_MTS_SCHEDULE5 (0x50B00U) +#define RGX_CR_MTS_SCHEDULE5_MASKFULL (IMG_UINT64_C(0x00000000000001FF)) +#define RGX_CR_MTS_SCHEDULE5_HOST_SHIFT (8U) +#define RGX_CR_MTS_SCHEDULE5_HOST_CLRMSK (0XFFFFFEFFU) +#define RGX_CR_MTS_SCHEDULE5_HOST_BG_TIMER (00000000U) +#define RGX_CR_MTS_SCHEDULE5_HOST_HOST (0X00000100U) +#define RGX_CR_MTS_SCHEDULE5_PRIORITY_SHIFT (6U) +#define RGX_CR_MTS_SCHEDULE5_PRIORITY_CLRMSK (0XFFFFFF3FU) +#define RGX_CR_MTS_SCHEDULE5_PRIORITY_PRT0 (00000000U) +#define RGX_CR_MTS_SCHEDULE5_PRIORITY_PRT1 (0X00000040U) +#define RGX_CR_MTS_SCHEDULE5_PRIORITY_PRT2 (0X00000080U) +#define RGX_CR_MTS_SCHEDULE5_PRIORITY_PRT3 (0X000000C0U) +#define RGX_CR_MTS_SCHEDULE5_CONTEXT_SHIFT (5U) +#define RGX_CR_MTS_SCHEDULE5_CONTEXT_CLRMSK (0XFFFFFFDFU) +#define RGX_CR_MTS_SCHEDULE5_CONTEXT_BGCTX (00000000U) +#define RGX_CR_MTS_SCHEDULE5_CONTEXT_INTCTX (0X00000020U) +#define RGX_CR_MTS_SCHEDULE5_TASK_SHIFT (4U) +#define RGX_CR_MTS_SCHEDULE5_TASK_CLRMSK (0XFFFFFFEFU) +#define RGX_CR_MTS_SCHEDULE5_TASK_NON_COUNTED (00000000U) +#define RGX_CR_MTS_SCHEDULE5_TASK_COUNTED (0X00000010U) +#define RGX_CR_MTS_SCHEDULE5_DM_SHIFT (0U) +#define RGX_CR_MTS_SCHEDULE5_DM_CLRMSK (0XFFFFFFF0U) +#define RGX_CR_MTS_SCHEDULE5_DM_DM0 (00000000U) +#define RGX_CR_MTS_SCHEDULE5_DM_DM1 (0X00000001U) +#define RGX_CR_MTS_SCHEDULE5_DM_DM2 (0X00000002U) +#define RGX_CR_MTS_SCHEDULE5_DM_DM3 (0X00000003U) +#define RGX_CR_MTS_SCHEDULE5_DM_DM4 (0X00000004U) +#define RGX_CR_MTS_SCHEDULE5_DM_DM5 (0X00000005U) +#define RGX_CR_MTS_SCHEDULE5_DM_DM6 (0X00000006U) +#define RGX_CR_MTS_SCHEDULE5_DM_DM7 (0X00000007U) +#define RGX_CR_MTS_SCHEDULE5_DM_DM_ALL (0X0000000FU) + + +/* + Register RGX_CR_MTS_SCHEDULE6 +*/ +#define RGX_CR_MTS_SCHEDULE6 (0x60B00U) +#define RGX_CR_MTS_SCHEDULE6_MASKFULL (IMG_UINT64_C(0x00000000000001FF)) +#define RGX_CR_MTS_SCHEDULE6_HOST_SHIFT (8U) +#define RGX_CR_MTS_SCHEDULE6_HOST_CLRMSK (0XFFFFFEFFU) +#define RGX_CR_MTS_SCHEDULE6_HOST_BG_TIMER (00000000U) +#define RGX_CR_MTS_SCHEDULE6_HOST_HOST (0X00000100U) +#define RGX_CR_MTS_SCHEDULE6_PRIORITY_SHIFT (6U) +#define RGX_CR_MTS_SCHEDULE6_PRIORITY_CLRMSK (0XFFFFFF3FU) +#define RGX_CR_MTS_SCHEDULE6_PRIORITY_PRT0 (00000000U) +#define RGX_CR_MTS_SCHEDULE6_PRIORITY_PRT1 (0X00000040U) +#define RGX_CR_MTS_SCHEDULE6_PRIORITY_PRT2 (0X00000080U) +#define RGX_CR_MTS_SCHEDULE6_PRIORITY_PRT3 (0X000000C0U) +#define RGX_CR_MTS_SCHEDULE6_CONTEXT_SHIFT (5U) +#define RGX_CR_MTS_SCHEDULE6_CONTEXT_CLRMSK (0XFFFFFFDFU) +#define RGX_CR_MTS_SCHEDULE6_CONTEXT_BGCTX (00000000U) +#define RGX_CR_MTS_SCHEDULE6_CONTEXT_INTCTX (0X00000020U) +#define RGX_CR_MTS_SCHEDULE6_TASK_SHIFT (4U) +#define RGX_CR_MTS_SCHEDULE6_TASK_CLRMSK (0XFFFFFFEFU) +#define RGX_CR_MTS_SCHEDULE6_TASK_NON_COUNTED (00000000U) +#define RGX_CR_MTS_SCHEDULE6_TASK_COUNTED (0X00000010U) +#define RGX_CR_MTS_SCHEDULE6_DM_SHIFT (0U) +#define RGX_CR_MTS_SCHEDULE6_DM_CLRMSK (0XFFFFFFF0U) +#define RGX_CR_MTS_SCHEDULE6_DM_DM0 (00000000U) +#define RGX_CR_MTS_SCHEDULE6_DM_DM1 (0X00000001U) +#define RGX_CR_MTS_SCHEDULE6_DM_DM2 (0X00000002U) +#define RGX_CR_MTS_SCHEDULE6_DM_DM3 (0X00000003U) +#define RGX_CR_MTS_SCHEDULE6_DM_DM4 (0X00000004U) +#define RGX_CR_MTS_SCHEDULE6_DM_DM5 (0X00000005U) +#define RGX_CR_MTS_SCHEDULE6_DM_DM6 (0X00000006U) +#define RGX_CR_MTS_SCHEDULE6_DM_DM7 (0X00000007U) +#define RGX_CR_MTS_SCHEDULE6_DM_DM_ALL (0X0000000FU) + + +/* + Register RGX_CR_MTS_SCHEDULE7 +*/ +#define RGX_CR_MTS_SCHEDULE7 (0x70B00U) +#define RGX_CR_MTS_SCHEDULE7_MASKFULL (IMG_UINT64_C(0x00000000000001FF)) +#define RGX_CR_MTS_SCHEDULE7_HOST_SHIFT (8U) +#define RGX_CR_MTS_SCHEDULE7_HOST_CLRMSK (0XFFFFFEFFU) +#define RGX_CR_MTS_SCHEDULE7_HOST_BG_TIMER (00000000U) +#define RGX_CR_MTS_SCHEDULE7_HOST_HOST (0X00000100U) +#define RGX_CR_MTS_SCHEDULE7_PRIORITY_SHIFT (6U) +#define RGX_CR_MTS_SCHEDULE7_PRIORITY_CLRMSK (0XFFFFFF3FU) +#define RGX_CR_MTS_SCHEDULE7_PRIORITY_PRT0 (00000000U) +#define RGX_CR_MTS_SCHEDULE7_PRIORITY_PRT1 (0X00000040U) +#define RGX_CR_MTS_SCHEDULE7_PRIORITY_PRT2 (0X00000080U) +#define RGX_CR_MTS_SCHEDULE7_PRIORITY_PRT3 (0X000000C0U) +#define RGX_CR_MTS_SCHEDULE7_CONTEXT_SHIFT (5U) +#define RGX_CR_MTS_SCHEDULE7_CONTEXT_CLRMSK (0XFFFFFFDFU) +#define RGX_CR_MTS_SCHEDULE7_CONTEXT_BGCTX (00000000U) +#define RGX_CR_MTS_SCHEDULE7_CONTEXT_INTCTX (0X00000020U) +#define RGX_CR_MTS_SCHEDULE7_TASK_SHIFT (4U) +#define RGX_CR_MTS_SCHEDULE7_TASK_CLRMSK (0XFFFFFFEFU) +#define RGX_CR_MTS_SCHEDULE7_TASK_NON_COUNTED (00000000U) +#define RGX_CR_MTS_SCHEDULE7_TASK_COUNTED (0X00000010U) +#define RGX_CR_MTS_SCHEDULE7_DM_SHIFT (0U) +#define RGX_CR_MTS_SCHEDULE7_DM_CLRMSK (0XFFFFFFF0U) +#define RGX_CR_MTS_SCHEDULE7_DM_DM0 (00000000U) +#define RGX_CR_MTS_SCHEDULE7_DM_DM1 (0X00000001U) +#define RGX_CR_MTS_SCHEDULE7_DM_DM2 (0X00000002U) +#define RGX_CR_MTS_SCHEDULE7_DM_DM3 (0X00000003U) +#define RGX_CR_MTS_SCHEDULE7_DM_DM4 (0X00000004U) +#define RGX_CR_MTS_SCHEDULE7_DM_DM5 (0X00000005U) +#define RGX_CR_MTS_SCHEDULE7_DM_DM6 (0X00000006U) +#define RGX_CR_MTS_SCHEDULE7_DM_DM7 (0X00000007U) +#define RGX_CR_MTS_SCHEDULE7_DM_DM_ALL (0X0000000FU) + + +/* + Register RGX_CR_MTS_BGCTX_THREAD0_DM_ASSOC +*/ +#define RGX_CR_MTS_BGCTX_THREAD0_DM_ASSOC (0x0B30U) +#define RGX_CR_MTS_BGCTX_THREAD0_DM_ASSOC_MASKFULL (IMG_UINT64_C(0x000000000000FFFF)) +#define RGX_CR_MTS_BGCTX_THREAD0_DM_ASSOC_DM_ASSOC_SHIFT (0U) +#define RGX_CR_MTS_BGCTX_THREAD0_DM_ASSOC_DM_ASSOC_CLRMSK (0XFFFF0000U) + + +/* + Register RGX_CR_MTS_BGCTX_THREAD1_DM_ASSOC +*/ +#define RGX_CR_MTS_BGCTX_THREAD1_DM_ASSOC (0x0B38U) +#define RGX_CR_MTS_BGCTX_THREAD1_DM_ASSOC_MASKFULL (IMG_UINT64_C(0x000000000000FFFF)) +#define RGX_CR_MTS_BGCTX_THREAD1_DM_ASSOC_DM_ASSOC_SHIFT (0U) +#define RGX_CR_MTS_BGCTX_THREAD1_DM_ASSOC_DM_ASSOC_CLRMSK (0XFFFF0000U) + + +/* + Register RGX_CR_MTS_INTCTX_THREAD0_DM_ASSOC +*/ +#define RGX_CR_MTS_INTCTX_THREAD0_DM_ASSOC (0x0B40U) +#define RGX_CR_MTS_INTCTX_THREAD0_DM_ASSOC_MASKFULL (IMG_UINT64_C(0x000000000000FFFF)) +#define RGX_CR_MTS_INTCTX_THREAD0_DM_ASSOC_DM_ASSOC_SHIFT (0U) +#define RGX_CR_MTS_INTCTX_THREAD0_DM_ASSOC_DM_ASSOC_CLRMSK (0XFFFF0000U) + + +/* + Register RGX_CR_MTS_INTCTX_THREAD1_DM_ASSOC +*/ +#define RGX_CR_MTS_INTCTX_THREAD1_DM_ASSOC (0x0B48U) +#define RGX_CR_MTS_INTCTX_THREAD1_DM_ASSOC_MASKFULL (IMG_UINT64_C(0x000000000000FFFF)) +#define RGX_CR_MTS_INTCTX_THREAD1_DM_ASSOC_DM_ASSOC_SHIFT (0U) +#define RGX_CR_MTS_INTCTX_THREAD1_DM_ASSOC_DM_ASSOC_CLRMSK (0XFFFF0000U) + + +#if defined(RGX_FEATURE_S7_TOP_INFRASTRUCTURE) +/* + Register RGX_CR_MTS_GARTEN_WRAPPER_CONFIG +*/ +#define RGX_CR_MTS_GARTEN_WRAPPER_CONFIG (0x0B50U) +#define RGX_CR_MTS_GARTEN_WRAPPER_CONFIG_MASKFULL (IMG_UINT64_C(0x000FF0FFFFFFF701)) +#define RGX_CR_MTS_GARTEN_WRAPPER_CONFIG_FENCE_PC_BASE_SHIFT (44U) +#define RGX_CR_MTS_GARTEN_WRAPPER_CONFIG_FENCE_PC_BASE_CLRMSK (IMG_UINT64_C(0XFFF00FFFFFFFFFFF)) +#define RGX_CR_MTS_GARTEN_WRAPPER_CONFIG_FENCE_ADDR_SHIFT (12U) +#define RGX_CR_MTS_GARTEN_WRAPPER_CONFIG_FENCE_ADDR_CLRMSK (IMG_UINT64_C(0XFFFFFF0000000FFF)) +#define RGX_CR_MTS_GARTEN_WRAPPER_CONFIG_FENCE_PERSISTENCE_SHIFT (9U) +#define RGX_CR_MTS_GARTEN_WRAPPER_CONFIG_FENCE_PERSISTENCE_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFF9FF)) +#define RGX_CR_MTS_GARTEN_WRAPPER_CONFIG_FENCE_SLC_COHERENT_SHIFT (8U) +#define RGX_CR_MTS_GARTEN_WRAPPER_CONFIG_FENCE_SLC_COHERENT_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFEFF)) +#define RGX_CR_MTS_GARTEN_WRAPPER_CONFIG_FENCE_SLC_COHERENT_EN (IMG_UINT64_C(0X0000000000000100)) +#define RGX_CR_MTS_GARTEN_WRAPPER_CONFIG_IDLE_CTRL_SHIFT (0U) +#define RGX_CR_MTS_GARTEN_WRAPPER_CONFIG_IDLE_CTRL_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFFE)) +#define RGX_CR_MTS_GARTEN_WRAPPER_CONFIG_IDLE_CTRL_META (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_MTS_GARTEN_WRAPPER_CONFIG_IDLE_CTRL_MTS (IMG_UINT64_C(0x0000000000000001)) +#endif /* RGX_FEATURE_S7_TOP_INFRASTRUCTURE */ + + +#if !defined(RGX_FEATURE_S7_TOP_INFRASTRUCTURE) +/* + Register RGX_CR_MTS_GARTEN_WRAPPER_CONFIG +*/ +#define RGX_CR_MTS_GARTEN_WRAPPER_CONFIG (0x0B50U) +#define RGX_CR_MTS_GARTEN_WRAPPER_CONFIG_MASKFULL (IMG_UINT64_C(0x0000FFFFFFFFF001)) +#define RGX_CR_MTS_GARTEN_WRAPPER_CONFIG_FENCE_PC_BASE_SHIFT (44U) +#define RGX_CR_MTS_GARTEN_WRAPPER_CONFIG_FENCE_PC_BASE_CLRMSK (IMG_UINT64_C(0XFFFF0FFFFFFFFFFF)) +#define RGX_CR_MTS_GARTEN_WRAPPER_CONFIG_FENCE_DM_SHIFT (40U) +#define RGX_CR_MTS_GARTEN_WRAPPER_CONFIG_FENCE_DM_CLRMSK (IMG_UINT64_C(0XFFFFF0FFFFFFFFFF)) +#define RGX_CR_MTS_GARTEN_WRAPPER_CONFIG_FENCE_ADDR_SHIFT (12U) +#define RGX_CR_MTS_GARTEN_WRAPPER_CONFIG_FENCE_ADDR_CLRMSK (IMG_UINT64_C(0XFFFFFF0000000FFF)) +#define RGX_CR_MTS_GARTEN_WRAPPER_CONFIG_IDLE_CTRL_SHIFT (0U) +#define RGX_CR_MTS_GARTEN_WRAPPER_CONFIG_IDLE_CTRL_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFFE)) +#define RGX_CR_MTS_GARTEN_WRAPPER_CONFIG_IDLE_CTRL_META (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_MTS_GARTEN_WRAPPER_CONFIG_IDLE_CTRL_MTS (IMG_UINT64_C(0x0000000000000001)) +#endif /* !defined(RGX_FEATURE_S7_TOP_INFRASTRUCTURE) */ + + +/* + Register RGX_CR_MTS_INTCTX +*/ +#define RGX_CR_MTS_INTCTX (0x0B98U) +#define RGX_CR_MTS_INTCTX_MASKFULL (IMG_UINT64_C(0x000000003FFFFFFF)) +#define RGX_CR_MTS_INTCTX_DM_HOST_SCHEDULE_SHIFT (22U) +#define RGX_CR_MTS_INTCTX_DM_HOST_SCHEDULE_CLRMSK (0XC03FFFFFU) +#define RGX_CR_MTS_INTCTX_DM_PTR_SHIFT (18U) +#define RGX_CR_MTS_INTCTX_DM_PTR_CLRMSK (0XFFC3FFFFU) +#define RGX_CR_MTS_INTCTX_THREAD_ACTIVE_SHIFT (16U) +#define RGX_CR_MTS_INTCTX_THREAD_ACTIVE_CLRMSK (0XFFFCFFFFU) +#define RGX_CR_MTS_INTCTX_DM_TIMER_SCHEDULE_SHIFT (8U) +#define RGX_CR_MTS_INTCTX_DM_TIMER_SCHEDULE_CLRMSK (0XFFFF00FFU) +#define RGX_CR_MTS_INTCTX_DM_INTERRUPT_SCHEDULE_SHIFT (0U) +#define RGX_CR_MTS_INTCTX_DM_INTERRUPT_SCHEDULE_CLRMSK (0XFFFFFF00U) + + +/* + Register RGX_CR_MTS_BGCTX +*/ +#define RGX_CR_MTS_BGCTX (0x0BA0U) +#define RGX_CR_MTS_BGCTX_MASKFULL (IMG_UINT64_C(0x0000000000003FFF)) +#define RGX_CR_MTS_BGCTX_DM_PTR_SHIFT (10U) +#define RGX_CR_MTS_BGCTX_DM_PTR_CLRMSK (0XFFFFC3FFU) +#define RGX_CR_MTS_BGCTX_THREAD_ACTIVE_SHIFT (8U) +#define RGX_CR_MTS_BGCTX_THREAD_ACTIVE_CLRMSK (0XFFFFFCFFU) +#define RGX_CR_MTS_BGCTX_DM_NONCOUNTED_SCHEDULE_SHIFT (0U) +#define RGX_CR_MTS_BGCTX_DM_NONCOUNTED_SCHEDULE_CLRMSK (0XFFFFFF00U) + + +/* + Register RGX_CR_MTS_BGCTX_COUNTED_SCHEDULE +*/ +#define RGX_CR_MTS_BGCTX_COUNTED_SCHEDULE (0x0BA8U) +#define RGX_CR_MTS_BGCTX_COUNTED_SCHEDULE_MASKFULL (IMG_UINT64_C(0xFFFFFFFFFFFFFFFF)) +#if defined(RGX_FEATURE_RAY_TRACING) +#define RGX_CR_MTS_BGCTX_COUNTED_SCHEDULE_DM7_SHIFT (56U) +#define RGX_CR_MTS_BGCTX_COUNTED_SCHEDULE_DM7_CLRMSK (IMG_UINT64_C(0X00FFFFFFFFFFFFFF)) +#define RGX_CR_MTS_BGCTX_COUNTED_SCHEDULE_DM6_SHIFT (48U) +#define RGX_CR_MTS_BGCTX_COUNTED_SCHEDULE_DM6_CLRMSK (IMG_UINT64_C(0XFF00FFFFFFFFFFFF)) +#endif /* RGX_FEATURE_RAY_TRACING */ + +#define RGX_CR_MTS_BGCTX_COUNTED_SCHEDULE_DM5_SHIFT (40U) +#define RGX_CR_MTS_BGCTX_COUNTED_SCHEDULE_DM5_CLRMSK (IMG_UINT64_C(0XFFFF00FFFFFFFFFF)) +#define RGX_CR_MTS_BGCTX_COUNTED_SCHEDULE_DM4_SHIFT (32U) +#define RGX_CR_MTS_BGCTX_COUNTED_SCHEDULE_DM4_CLRMSK (IMG_UINT64_C(0XFFFFFF00FFFFFFFF)) +#define RGX_CR_MTS_BGCTX_COUNTED_SCHEDULE_DM3_SHIFT (24U) +#define RGX_CR_MTS_BGCTX_COUNTED_SCHEDULE_DM3_CLRMSK (IMG_UINT64_C(0XFFFFFFFF00FFFFFF)) +#define RGX_CR_MTS_BGCTX_COUNTED_SCHEDULE_DM2_SHIFT (16U) +#define RGX_CR_MTS_BGCTX_COUNTED_SCHEDULE_DM2_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFF00FFFF)) +#define RGX_CR_MTS_BGCTX_COUNTED_SCHEDULE_DM1_SHIFT (8U) +#define RGX_CR_MTS_BGCTX_COUNTED_SCHEDULE_DM1_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFF00FF)) +#define RGX_CR_MTS_BGCTX_COUNTED_SCHEDULE_DM0_SHIFT (0U) +#define RGX_CR_MTS_BGCTX_COUNTED_SCHEDULE_DM0_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFF00)) + + +/* + Register RGX_CR_MTS_GPU_INT_STATUS +*/ +#define RGX_CR_MTS_GPU_INT_STATUS (0x0BB0U) +#define RGX_CR_MTS_GPU_INT_STATUS_MASKFULL (IMG_UINT64_C(0x00000000FFFFFFFF)) +#define RGX_CR_MTS_GPU_INT_STATUS_STATUS_SHIFT (0U) +#define RGX_CR_MTS_GPU_INT_STATUS_STATUS_CLRMSK (00000000U) + + +/* + Register RGX_CR_META_BOOT +*/ +#define RGX_CR_META_BOOT (0x0BF8U) +#define RGX_CR_META_BOOT_MASKFULL (IMG_UINT64_C(0x0000000000000001)) +#define RGX_CR_META_BOOT_MODE_SHIFT (0U) +#define RGX_CR_META_BOOT_MODE_CLRMSK (0XFFFFFFFEU) +#define RGX_CR_META_BOOT_MODE_EN (0X00000001U) + + +/* + Register RGX_CR_GARTEN_SLC +*/ +#define RGX_CR_GARTEN_SLC (0x0BB8U) +#define RGX_CR_GARTEN_SLC_MASKFULL (IMG_UINT64_C(0x0000000000000001)) +#define RGX_CR_GARTEN_SLC_FORCE_COHERENCY_SHIFT (0U) +#define RGX_CR_GARTEN_SLC_FORCE_COHERENCY_CLRMSK (0XFFFFFFFEU) +#define RGX_CR_GARTEN_SLC_FORCE_COHERENCY_EN (0X00000001U) + + +#define RGX_CR_ISP_RENDER_DIR_TYPE_MASK (0x00000003U) +/* + Top-left to bottom-right */ +#define RGX_CR_ISP_RENDER_DIR_TYPE_TL2BR (0x00000000U) +/* + Top-right to bottom-left */ +#define RGX_CR_ISP_RENDER_DIR_TYPE_TR2BL (0x00000001U) +/* + Bottom-left to top-right */ +#define RGX_CR_ISP_RENDER_DIR_TYPE_BL2TR (0x00000002U) +/* + Bottom-right to top-left */ +#define RGX_CR_ISP_RENDER_DIR_TYPE_BR2TL (0x00000003U) + + +#define RGX_CR_ISP_RENDER_MODE_TYPE_MASK (0x00000003U) +/* + Normal render */ +#define RGX_CR_ISP_RENDER_MODE_TYPE_NORM (0x00000000U) +/* + Fast 2D render */ +#define RGX_CR_ISP_RENDER_MODE_TYPE_FAST_2D (0x00000002U) +/* + Fast scale render */ +#define RGX_CR_ISP_RENDER_MODE_TYPE_FAST_SCALE (0x00000003U) + + +/* + Register RGX_CR_ISP_RENDER +*/ +#define RGX_CR_ISP_RENDER (0x0F08U) +#define RGX_CR_ISP_RENDER_MASKFULL (IMG_UINT64_C(0x000000000000001F)) +#define RGX_CR_ISP_RENDER_RESUME_SHIFT (4U) +#define RGX_CR_ISP_RENDER_RESUME_CLRMSK (0XFFFFFFEFU) +#define RGX_CR_ISP_RENDER_RESUME_EN (0X00000010U) +#define RGX_CR_ISP_RENDER_DIR_SHIFT (2U) +#define RGX_CR_ISP_RENDER_DIR_CLRMSK (0XFFFFFFF3U) +#define RGX_CR_ISP_RENDER_DIR_TL2BR (00000000U) +#define RGX_CR_ISP_RENDER_DIR_TR2BL (0X00000004U) +#define RGX_CR_ISP_RENDER_DIR_BL2TR (0X00000008U) +#define RGX_CR_ISP_RENDER_DIR_BR2TL (0X0000000CU) +#define RGX_CR_ISP_RENDER_MODE_SHIFT (0U) +#define RGX_CR_ISP_RENDER_MODE_CLRMSK (0XFFFFFFFCU) +#define RGX_CR_ISP_RENDER_MODE_NORM (00000000U) +#define RGX_CR_ISP_RENDER_MODE_FAST_2D (0X00000002U) +#define RGX_CR_ISP_RENDER_MODE_FAST_SCALE (0X00000003U) + + +/* + Register RGX_CR_ISP_CTL +*/ +#define RGX_CR_ISP_CTL (0x0F38U) +#define RGX_CR_ISP_CTL_MASKFULL (IMG_UINT64_C(0x0000000001FFF3FF)) +#define RGX_CR_ISP_CTL_ISP_SAMPLE_POS_MODE_SHIFT (23U) +#define RGX_CR_ISP_CTL_ISP_SAMPLE_POS_MODE_CLRMSK (0XFE7FFFFFU) +#define RGX_CR_ISP_CTL_ISP_SAMPLE_POS_MODE_DX9 (00000000U) +#define RGX_CR_ISP_CTL_ISP_SAMPLE_POS_MODE_DX10 (0X00800000U) +#define RGX_CR_ISP_CTL_ISP_SAMPLE_POS_MODE_OGL (0X01000000U) +#define RGX_CR_ISP_CTL_NUM_TILES_PER_USC_SHIFT (21U) +#define RGX_CR_ISP_CTL_NUM_TILES_PER_USC_CLRMSK (0XFF9FFFFFU) +#define RGX_CR_ISP_CTL_DBIAS_IS_INT_SHIFT (20U) +#define RGX_CR_ISP_CTL_DBIAS_IS_INT_CLRMSK (0XFFEFFFFFU) +#define RGX_CR_ISP_CTL_DBIAS_IS_INT_EN (0X00100000U) +#define RGX_CR_ISP_CTL_OVERLAP_CHECK_MODE_SHIFT (19U) +#define RGX_CR_ISP_CTL_OVERLAP_CHECK_MODE_CLRMSK (0XFFF7FFFFU) +#define RGX_CR_ISP_CTL_OVERLAP_CHECK_MODE_EN (0X00080000U) +#define RGX_CR_ISP_CTL_PT_UPFRONT_DEPTH_DISABLE_SHIFT (18U) +#define RGX_CR_ISP_CTL_PT_UPFRONT_DEPTH_DISABLE_CLRMSK (0XFFFBFFFFU) +#define RGX_CR_ISP_CTL_PT_UPFRONT_DEPTH_DISABLE_EN (0X00040000U) +#define RGX_CR_ISP_CTL_PROCESS_EMPTY_TILES_SHIFT (17U) +#define RGX_CR_ISP_CTL_PROCESS_EMPTY_TILES_CLRMSK (0XFFFDFFFFU) +#define RGX_CR_ISP_CTL_PROCESS_EMPTY_TILES_EN (0X00020000U) +#define RGX_CR_ISP_CTL_SAMPLE_POS_SHIFT (16U) +#define RGX_CR_ISP_CTL_SAMPLE_POS_CLRMSK (0XFFFEFFFFU) +#define RGX_CR_ISP_CTL_SAMPLE_POS_EN (0X00010000U) +#define RGX_CR_ISP_CTL_PIPE_ENABLE_SHIFT (12U) +#define RGX_CR_ISP_CTL_PIPE_ENABLE_CLRMSK (0XFFFF0FFFU) +#define RGX_CR_ISP_CTL_PIPE_ENABLE_PIPE_ONE (00000000U) +#define RGX_CR_ISP_CTL_PIPE_ENABLE_PIPE_TWO (0X00001000U) +#define RGX_CR_ISP_CTL_PIPE_ENABLE_PIPE_THREE (0X00002000U) +#if defined(RGX_FEATURE_CLUSTER_GROUPING) +#define RGX_CR_ISP_CTL_PIPE_ENABLE_PIPE_FOUR (0X00003000U) +#define RGX_CR_ISP_CTL_PIPE_ENABLE_PIPE_FIVE (0X00004000U) +#define RGX_CR_ISP_CTL_PIPE_ENABLE_PIPE_SIX (0X00005000U) +#define RGX_CR_ISP_CTL_PIPE_ENABLE_PIPE_SEVEN (0X00006000U) +#define RGX_CR_ISP_CTL_PIPE_ENABLE_PIPE_EIGHT (0X00007000U) +#endif /* RGX_FEATURE_CLUSTER_GROUPING */ + +#define RGX_CR_ISP_CTL_VALID_ID_SHIFT (4U) +#define RGX_CR_ISP_CTL_VALID_ID_CLRMSK (0XFFFFFC0FU) +#define RGX_CR_ISP_CTL_UPASS_START_SHIFT (0U) +#define RGX_CR_ISP_CTL_UPASS_START_CLRMSK (0XFFFFFFF0U) + + +/* + Register RGX_CR_ISP_STORE0 +*/ +#define RGX_CR_ISP_STORE0 (0x1008U) +#define RGX_CR_ISP_STORE0_MASKFULL (IMG_UINT64_C(0x000000007F3FF3FF)) +#define RGX_CR_ISP_STORE0_ACTIVE_SHIFT (30U) +#define RGX_CR_ISP_STORE0_ACTIVE_CLRMSK (0XBFFFFFFFU) +#define RGX_CR_ISP_STORE0_ACTIVE_EN (0X40000000U) +#define RGX_CR_ISP_STORE0_EOR_SHIFT (29U) +#define RGX_CR_ISP_STORE0_EOR_CLRMSK (0XDFFFFFFFU) +#define RGX_CR_ISP_STORE0_EOR_EN (0X20000000U) +#define RGX_CR_ISP_STORE0_TILE_LAST_SHIFT (28U) +#define RGX_CR_ISP_STORE0_TILE_LAST_CLRMSK (0XEFFFFFFFU) +#define RGX_CR_ISP_STORE0_TILE_LAST_EN (0X10000000U) +#define RGX_CR_ISP_STORE0_MT_SHIFT (24U) +#define RGX_CR_ISP_STORE0_MT_CLRMSK (0XF0FFFFFFU) +#define RGX_CR_ISP_STORE0_TILE_X_SHIFT (12U) +#define RGX_CR_ISP_STORE0_TILE_X_CLRMSK (0XFFC00FFFU) +#define RGX_CR_ISP_STORE0_TILE_Y_SHIFT (0U) +#define RGX_CR_ISP_STORE0_TILE_Y_CLRMSK (0XFFFFFC00U) + + +/* + Register RGX_CR_ISP_STORE1 +*/ +#define RGX_CR_ISP_STORE1 (0x1010U) +#define RGX_CR_ISP_STORE1_MASKFULL (IMG_UINT64_C(0x000000007F3FF3FF)) +#define RGX_CR_ISP_STORE1_ACTIVE_SHIFT (30U) +#define RGX_CR_ISP_STORE1_ACTIVE_CLRMSK (0XBFFFFFFFU) +#define RGX_CR_ISP_STORE1_ACTIVE_EN (0X40000000U) +#define RGX_CR_ISP_STORE1_EOR_SHIFT (29U) +#define RGX_CR_ISP_STORE1_EOR_CLRMSK (0XDFFFFFFFU) +#define RGX_CR_ISP_STORE1_EOR_EN (0X20000000U) +#define RGX_CR_ISP_STORE1_TILE_LAST_SHIFT (28U) +#define RGX_CR_ISP_STORE1_TILE_LAST_CLRMSK (0XEFFFFFFFU) +#define RGX_CR_ISP_STORE1_TILE_LAST_EN (0X10000000U) +#define RGX_CR_ISP_STORE1_MT_SHIFT (24U) +#define RGX_CR_ISP_STORE1_MT_CLRMSK (0XF0FFFFFFU) +#define RGX_CR_ISP_STORE1_TILE_X_SHIFT (12U) +#define RGX_CR_ISP_STORE1_TILE_X_CLRMSK (0XFFC00FFFU) +#define RGX_CR_ISP_STORE1_TILE_Y_SHIFT (0U) +#define RGX_CR_ISP_STORE1_TILE_Y_CLRMSK (0XFFFFFC00U) + + +/* + Register RGX_CR_ISP_STORE2 +*/ +#define RGX_CR_ISP_STORE2 (0x1018U) +#define RGX_CR_ISP_STORE2_MASKFULL (IMG_UINT64_C(0x000000007F3FF3FF)) +#define RGX_CR_ISP_STORE2_ACTIVE_SHIFT (30U) +#define RGX_CR_ISP_STORE2_ACTIVE_CLRMSK (0XBFFFFFFFU) +#define RGX_CR_ISP_STORE2_ACTIVE_EN (0X40000000U) +#define RGX_CR_ISP_STORE2_EOR_SHIFT (29U) +#define RGX_CR_ISP_STORE2_EOR_CLRMSK (0XDFFFFFFFU) +#define RGX_CR_ISP_STORE2_EOR_EN (0X20000000U) +#define RGX_CR_ISP_STORE2_TILE_LAST_SHIFT (28U) +#define RGX_CR_ISP_STORE2_TILE_LAST_CLRMSK (0XEFFFFFFFU) +#define RGX_CR_ISP_STORE2_TILE_LAST_EN (0X10000000U) +#define RGX_CR_ISP_STORE2_MT_SHIFT (24U) +#define RGX_CR_ISP_STORE2_MT_CLRMSK (0XF0FFFFFFU) +#define RGX_CR_ISP_STORE2_TILE_X_SHIFT (12U) +#define RGX_CR_ISP_STORE2_TILE_X_CLRMSK (0XFFC00FFFU) +#define RGX_CR_ISP_STORE2_TILE_Y_SHIFT (0U) +#define RGX_CR_ISP_STORE2_TILE_Y_CLRMSK (0XFFFFFC00U) + + +/* + Register RGX_CR_ISP_RESUME0 +*/ +#define RGX_CR_ISP_RESUME0 (0x1020U) +#define RGX_CR_ISP_RESUME0_MASKFULL (IMG_UINT64_C(0x00000000003FF3FF)) +#define RGX_CR_ISP_RESUME0_TILE_X_SHIFT (12U) +#define RGX_CR_ISP_RESUME0_TILE_X_CLRMSK (0XFFC00FFFU) +#define RGX_CR_ISP_RESUME0_TILE_Y_SHIFT (0U) +#define RGX_CR_ISP_RESUME0_TILE_Y_CLRMSK (0XFFFFFC00U) + + +/* + Register RGX_CR_ISP_RESUME1 +*/ +#define RGX_CR_ISP_RESUME1 (0x1028U) +#define RGX_CR_ISP_RESUME1_MASKFULL (IMG_UINT64_C(0x00000000003FF3FF)) +#define RGX_CR_ISP_RESUME1_TILE_X_SHIFT (12U) +#define RGX_CR_ISP_RESUME1_TILE_X_CLRMSK (0XFFC00FFFU) +#define RGX_CR_ISP_RESUME1_TILE_Y_SHIFT (0U) +#define RGX_CR_ISP_RESUME1_TILE_Y_CLRMSK (0XFFFFFC00U) + + +/* + Register RGX_CR_ISP_RESUME2 +*/ +#define RGX_CR_ISP_RESUME2 (0x1030U) +#define RGX_CR_ISP_RESUME2_MASKFULL (IMG_UINT64_C(0x00000000003FF3FF)) +#define RGX_CR_ISP_RESUME2_TILE_X_SHIFT (12U) +#define RGX_CR_ISP_RESUME2_TILE_X_CLRMSK (0XFFC00FFFU) +#define RGX_CR_ISP_RESUME2_TILE_Y_SHIFT (0U) +#define RGX_CR_ISP_RESUME2_TILE_Y_CLRMSK (0XFFFFFC00U) + + +/* + Register RGX_CR_ISP_STATUS +*/ +#define RGX_CR_ISP_STATUS (0x1038U) +#define RGX_CR_ISP_STATUS_MASKFULL (IMG_UINT64_C(0x0000000000000007)) +#define RGX_CR_ISP_STATUS_SPLIT_MAX_SHIFT (2U) +#define RGX_CR_ISP_STATUS_SPLIT_MAX_CLRMSK (0XFFFFFFFBU) +#define RGX_CR_ISP_STATUS_SPLIT_MAX_EN (0X00000004U) +#define RGX_CR_ISP_STATUS_ACTIVE_SHIFT (1U) +#define RGX_CR_ISP_STATUS_ACTIVE_CLRMSK (0XFFFFFFFDU) +#define RGX_CR_ISP_STATUS_ACTIVE_EN (0X00000002U) +#define RGX_CR_ISP_STATUS_EOR_SHIFT (0U) +#define RGX_CR_ISP_STATUS_EOR_CLRMSK (0XFFFFFFFEU) +#define RGX_CR_ISP_STATUS_EOR_EN (0X00000001U) + + +/* + Register group: RGX_CR_BIF_CAT_BASE, with 8 repeats +*/ +#define RGX_CR_BIF_CAT_BASE_REPEATCOUNT (8) +/* + Register RGX_CR_BIF_CAT_BASE0 +*/ +#define RGX_CR_BIF_CAT_BASE0 (0x1200U) +#define RGX_CR_BIF_CAT_BASE0_MASKFULL (IMG_UINT64_C(0x000000FFFFFFF000)) +#define RGX_CR_BIF_CAT_BASE0_ADDR_SHIFT (12U) +#define RGX_CR_BIF_CAT_BASE0_ADDR_CLRMSK (IMG_UINT64_C(0XFFFFFF0000000FFF)) +#define RGX_CR_BIF_CAT_BASE0_ADDR_ALIGNSHIFT (12U) +#define RGX_CR_BIF_CAT_BASE0_ADDR_ALIGNSIZE (4096U) + + +/* + Register RGX_CR_BIF_CAT_BASE1 +*/ +#define RGX_CR_BIF_CAT_BASE1 (0x1208U) +#define RGX_CR_BIF_CAT_BASE1_MASKFULL (IMG_UINT64_C(0x000000FFFFFFF000)) +#define RGX_CR_BIF_CAT_BASE1_ADDR_SHIFT (12U) +#define RGX_CR_BIF_CAT_BASE1_ADDR_CLRMSK (IMG_UINT64_C(0XFFFFFF0000000FFF)) +#define RGX_CR_BIF_CAT_BASE1_ADDR_ALIGNSHIFT (12U) +#define RGX_CR_BIF_CAT_BASE1_ADDR_ALIGNSIZE (4096U) + + +/* + Register RGX_CR_BIF_CAT_BASE2 +*/ +#define RGX_CR_BIF_CAT_BASE2 (0x1210U) +#define RGX_CR_BIF_CAT_BASE2_MASKFULL (IMG_UINT64_C(0x000000FFFFFFF000)) +#define RGX_CR_BIF_CAT_BASE2_ADDR_SHIFT (12U) +#define RGX_CR_BIF_CAT_BASE2_ADDR_CLRMSK (IMG_UINT64_C(0XFFFFFF0000000FFF)) +#define RGX_CR_BIF_CAT_BASE2_ADDR_ALIGNSHIFT (12U) +#define RGX_CR_BIF_CAT_BASE2_ADDR_ALIGNSIZE (4096U) + + +/* + Register RGX_CR_BIF_CAT_BASE3 +*/ +#define RGX_CR_BIF_CAT_BASE3 (0x1218U) +#define RGX_CR_BIF_CAT_BASE3_MASKFULL (IMG_UINT64_C(0x000000FFFFFFF000)) +#define RGX_CR_BIF_CAT_BASE3_ADDR_SHIFT (12U) +#define RGX_CR_BIF_CAT_BASE3_ADDR_CLRMSK (IMG_UINT64_C(0XFFFFFF0000000FFF)) +#define RGX_CR_BIF_CAT_BASE3_ADDR_ALIGNSHIFT (12U) +#define RGX_CR_BIF_CAT_BASE3_ADDR_ALIGNSIZE (4096U) + + +/* + Register RGX_CR_BIF_CAT_BASE4 +*/ +#define RGX_CR_BIF_CAT_BASE4 (0x1220U) +#define RGX_CR_BIF_CAT_BASE4_MASKFULL (IMG_UINT64_C(0x000000FFFFFFF000)) +#define RGX_CR_BIF_CAT_BASE4_ADDR_SHIFT (12U) +#define RGX_CR_BIF_CAT_BASE4_ADDR_CLRMSK (IMG_UINT64_C(0XFFFFFF0000000FFF)) +#define RGX_CR_BIF_CAT_BASE4_ADDR_ALIGNSHIFT (12U) +#define RGX_CR_BIF_CAT_BASE4_ADDR_ALIGNSIZE (4096U) + + +/* + Register RGX_CR_BIF_CAT_BASE5 +*/ +#define RGX_CR_BIF_CAT_BASE5 (0x1228U) +#define RGX_CR_BIF_CAT_BASE5_MASKFULL (IMG_UINT64_C(0x000000FFFFFFF000)) +#define RGX_CR_BIF_CAT_BASE5_ADDR_SHIFT (12U) +#define RGX_CR_BIF_CAT_BASE5_ADDR_CLRMSK (IMG_UINT64_C(0XFFFFFF0000000FFF)) +#define RGX_CR_BIF_CAT_BASE5_ADDR_ALIGNSHIFT (12U) +#define RGX_CR_BIF_CAT_BASE5_ADDR_ALIGNSIZE (4096U) + + +/* + Register RGX_CR_BIF_CAT_BASE6 +*/ +#define RGX_CR_BIF_CAT_BASE6 (0x1230U) +#define RGX_CR_BIF_CAT_BASE6_MASKFULL (IMG_UINT64_C(0x000000FFFFFFF000)) +#define RGX_CR_BIF_CAT_BASE6_ADDR_SHIFT (12U) +#define RGX_CR_BIF_CAT_BASE6_ADDR_CLRMSK (IMG_UINT64_C(0XFFFFFF0000000FFF)) +#define RGX_CR_BIF_CAT_BASE6_ADDR_ALIGNSHIFT (12U) +#define RGX_CR_BIF_CAT_BASE6_ADDR_ALIGNSIZE (4096U) + + +/* + Register RGX_CR_BIF_CAT_BASE7 +*/ +#define RGX_CR_BIF_CAT_BASE7 (0x1238U) +#define RGX_CR_BIF_CAT_BASE7_MASKFULL (IMG_UINT64_C(0x000000FFFFFFF000)) +#define RGX_CR_BIF_CAT_BASE7_ADDR_SHIFT (12U) +#define RGX_CR_BIF_CAT_BASE7_ADDR_CLRMSK (IMG_UINT64_C(0XFFFFFF0000000FFF)) +#define RGX_CR_BIF_CAT_BASE7_ADDR_ALIGNSHIFT (12U) +#define RGX_CR_BIF_CAT_BASE7_ADDR_ALIGNSIZE (4096U) + + +/* + Register RGX_CR_BIF_CAT_BASE_INDEX +*/ +#define RGX_CR_BIF_CAT_BASE_INDEX (0x1240U) +#define RGX_CR_BIF_CAT_BASE_INDEX_MASKFULL (IMG_UINT64_C(0x0007070707070707)) +#if defined(RGX_FEATURE_RAY_TRACING) +#define RGX_CR_BIF_CAT_BASE_INDEX_RVTX_SHIFT (48U) +#define RGX_CR_BIF_CAT_BASE_INDEX_RVTX_CLRMSK (IMG_UINT64_C(0XFFF8FFFFFFFFFFFF)) +#define RGX_CR_BIF_CAT_BASE_INDEX_RAY_SHIFT (40U) +#define RGX_CR_BIF_CAT_BASE_INDEX_RAY_CLRMSK (IMG_UINT64_C(0XFFFFF8FFFFFFFFFF)) +#endif /* RGX_FEATURE_RAY_TRACING */ + +#define RGX_CR_BIF_CAT_BASE_INDEX_HOST_SHIFT (32U) +#define RGX_CR_BIF_CAT_BASE_INDEX_HOST_CLRMSK (IMG_UINT64_C(0XFFFFFFF8FFFFFFFF)) +#define RGX_CR_BIF_CAT_BASE_INDEX_TLA_SHIFT (24U) +#define RGX_CR_BIF_CAT_BASE_INDEX_TLA_CLRMSK (IMG_UINT64_C(0XFFFFFFFFF8FFFFFF)) +#define RGX_CR_BIF_CAT_BASE_INDEX_CDM_SHIFT (16U) +#define RGX_CR_BIF_CAT_BASE_INDEX_CDM_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFF8FFFF)) +#define RGX_CR_BIF_CAT_BASE_INDEX_PIXEL_SHIFT (8U) +#define RGX_CR_BIF_CAT_BASE_INDEX_PIXEL_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFF8FF)) +#define RGX_CR_BIF_CAT_BASE_INDEX_TA_SHIFT (0U) +#define RGX_CR_BIF_CAT_BASE_INDEX_TA_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFF8)) + + +/* + Register RGX_CR_BIF_PM_CAT_BASE_VCE0 +*/ +#define RGX_CR_BIF_PM_CAT_BASE_VCE0 (0x1248U) +#define RGX_CR_BIF_PM_CAT_BASE_VCE0_MASKFULL (IMG_UINT64_C(0x0FFFFFFFFFFFF003)) +#define RGX_CR_BIF_PM_CAT_BASE_VCE0_INIT_PAGE_SHIFT (40U) +#define RGX_CR_BIF_PM_CAT_BASE_VCE0_INIT_PAGE_CLRMSK (IMG_UINT64_C(0XF00000FFFFFFFFFF)) +#define RGX_CR_BIF_PM_CAT_BASE_VCE0_ADDR_SHIFT (12U) +#define RGX_CR_BIF_PM_CAT_BASE_VCE0_ADDR_CLRMSK (IMG_UINT64_C(0XFFFFFF0000000FFF)) +#define RGX_CR_BIF_PM_CAT_BASE_VCE0_WRAP_SHIFT (1U) +#define RGX_CR_BIF_PM_CAT_BASE_VCE0_WRAP_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFFD)) +#define RGX_CR_BIF_PM_CAT_BASE_VCE0_WRAP_EN (IMG_UINT64_C(0X0000000000000002)) +#define RGX_CR_BIF_PM_CAT_BASE_VCE0_VALID_SHIFT (0U) +#define RGX_CR_BIF_PM_CAT_BASE_VCE0_VALID_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFFE)) +#define RGX_CR_BIF_PM_CAT_BASE_VCE0_VALID_EN (IMG_UINT64_C(0X0000000000000001)) + + +/* + Register RGX_CR_BIF_PM_CAT_BASE_TE0 +*/ +#define RGX_CR_BIF_PM_CAT_BASE_TE0 (0x1250U) +#define RGX_CR_BIF_PM_CAT_BASE_TE0_MASKFULL (IMG_UINT64_C(0x0FFFFFFFFFFFF003)) +#define RGX_CR_BIF_PM_CAT_BASE_TE0_INIT_PAGE_SHIFT (40U) +#define RGX_CR_BIF_PM_CAT_BASE_TE0_INIT_PAGE_CLRMSK (IMG_UINT64_C(0XF00000FFFFFFFFFF)) +#define RGX_CR_BIF_PM_CAT_BASE_TE0_ADDR_SHIFT (12U) +#define RGX_CR_BIF_PM_CAT_BASE_TE0_ADDR_CLRMSK (IMG_UINT64_C(0XFFFFFF0000000FFF)) +#define RGX_CR_BIF_PM_CAT_BASE_TE0_WRAP_SHIFT (1U) +#define RGX_CR_BIF_PM_CAT_BASE_TE0_WRAP_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFFD)) +#define RGX_CR_BIF_PM_CAT_BASE_TE0_WRAP_EN (IMG_UINT64_C(0X0000000000000002)) +#define RGX_CR_BIF_PM_CAT_BASE_TE0_VALID_SHIFT (0U) +#define RGX_CR_BIF_PM_CAT_BASE_TE0_VALID_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFFE)) +#define RGX_CR_BIF_PM_CAT_BASE_TE0_VALID_EN (IMG_UINT64_C(0X0000000000000001)) + + +/* + Register RGX_CR_BIF_PM_CAT_BASE_ALIST0 +*/ +#define RGX_CR_BIF_PM_CAT_BASE_ALIST0 (0x1260U) +#define RGX_CR_BIF_PM_CAT_BASE_ALIST0_MASKFULL (IMG_UINT64_C(0x0FFFFFFFFFFFF003)) +#define RGX_CR_BIF_PM_CAT_BASE_ALIST0_INIT_PAGE_SHIFT (40U) +#define RGX_CR_BIF_PM_CAT_BASE_ALIST0_INIT_PAGE_CLRMSK (IMG_UINT64_C(0XF00000FFFFFFFFFF)) +#define RGX_CR_BIF_PM_CAT_BASE_ALIST0_ADDR_SHIFT (12U) +#define RGX_CR_BIF_PM_CAT_BASE_ALIST0_ADDR_CLRMSK (IMG_UINT64_C(0XFFFFFF0000000FFF)) +#define RGX_CR_BIF_PM_CAT_BASE_ALIST0_WRAP_SHIFT (1U) +#define RGX_CR_BIF_PM_CAT_BASE_ALIST0_WRAP_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFFD)) +#define RGX_CR_BIF_PM_CAT_BASE_ALIST0_WRAP_EN (IMG_UINT64_C(0X0000000000000002)) +#define RGX_CR_BIF_PM_CAT_BASE_ALIST0_VALID_SHIFT (0U) +#define RGX_CR_BIF_PM_CAT_BASE_ALIST0_VALID_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFFE)) +#define RGX_CR_BIF_PM_CAT_BASE_ALIST0_VALID_EN (IMG_UINT64_C(0X0000000000000001)) + + +/* + Register RGX_CR_BIF_PM_CAT_BASE_VCE1 +*/ +#define RGX_CR_BIF_PM_CAT_BASE_VCE1 (0x1268U) +#define RGX_CR_BIF_PM_CAT_BASE_VCE1_MASKFULL (IMG_UINT64_C(0x0FFFFFFFFFFFF003)) +#define RGX_CR_BIF_PM_CAT_BASE_VCE1_INIT_PAGE_SHIFT (40U) +#define RGX_CR_BIF_PM_CAT_BASE_VCE1_INIT_PAGE_CLRMSK (IMG_UINT64_C(0XF00000FFFFFFFFFF)) +#define RGX_CR_BIF_PM_CAT_BASE_VCE1_ADDR_SHIFT (12U) +#define RGX_CR_BIF_PM_CAT_BASE_VCE1_ADDR_CLRMSK (IMG_UINT64_C(0XFFFFFF0000000FFF)) +#define RGX_CR_BIF_PM_CAT_BASE_VCE1_WRAP_SHIFT (1U) +#define RGX_CR_BIF_PM_CAT_BASE_VCE1_WRAP_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFFD)) +#define RGX_CR_BIF_PM_CAT_BASE_VCE1_WRAP_EN (IMG_UINT64_C(0X0000000000000002)) +#define RGX_CR_BIF_PM_CAT_BASE_VCE1_VALID_SHIFT (0U) +#define RGX_CR_BIF_PM_CAT_BASE_VCE1_VALID_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFFE)) +#define RGX_CR_BIF_PM_CAT_BASE_VCE1_VALID_EN (IMG_UINT64_C(0X0000000000000001)) + + +/* + Register RGX_CR_BIF_PM_CAT_BASE_TE1 +*/ +#define RGX_CR_BIF_PM_CAT_BASE_TE1 (0x1270U) +#define RGX_CR_BIF_PM_CAT_BASE_TE1_MASKFULL (IMG_UINT64_C(0x0FFFFFFFFFFFF003)) +#define RGX_CR_BIF_PM_CAT_BASE_TE1_INIT_PAGE_SHIFT (40U) +#define RGX_CR_BIF_PM_CAT_BASE_TE1_INIT_PAGE_CLRMSK (IMG_UINT64_C(0XF00000FFFFFFFFFF)) +#define RGX_CR_BIF_PM_CAT_BASE_TE1_ADDR_SHIFT (12U) +#define RGX_CR_BIF_PM_CAT_BASE_TE1_ADDR_CLRMSK (IMG_UINT64_C(0XFFFFFF0000000FFF)) +#define RGX_CR_BIF_PM_CAT_BASE_TE1_WRAP_SHIFT (1U) +#define RGX_CR_BIF_PM_CAT_BASE_TE1_WRAP_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFFD)) +#define RGX_CR_BIF_PM_CAT_BASE_TE1_WRAP_EN (IMG_UINT64_C(0X0000000000000002)) +#define RGX_CR_BIF_PM_CAT_BASE_TE1_VALID_SHIFT (0U) +#define RGX_CR_BIF_PM_CAT_BASE_TE1_VALID_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFFE)) +#define RGX_CR_BIF_PM_CAT_BASE_TE1_VALID_EN (IMG_UINT64_C(0X0000000000000001)) + + +/* + Register RGX_CR_BIF_PM_CAT_BASE_ALIST1 +*/ +#define RGX_CR_BIF_PM_CAT_BASE_ALIST1 (0x1280U) +#define RGX_CR_BIF_PM_CAT_BASE_ALIST1_MASKFULL (IMG_UINT64_C(0x0FFFFFFFFFFFF003)) +#define RGX_CR_BIF_PM_CAT_BASE_ALIST1_INIT_PAGE_SHIFT (40U) +#define RGX_CR_BIF_PM_CAT_BASE_ALIST1_INIT_PAGE_CLRMSK (IMG_UINT64_C(0XF00000FFFFFFFFFF)) +#define RGX_CR_BIF_PM_CAT_BASE_ALIST1_ADDR_SHIFT (12U) +#define RGX_CR_BIF_PM_CAT_BASE_ALIST1_ADDR_CLRMSK (IMG_UINT64_C(0XFFFFFF0000000FFF)) +#define RGX_CR_BIF_PM_CAT_BASE_ALIST1_WRAP_SHIFT (1U) +#define RGX_CR_BIF_PM_CAT_BASE_ALIST1_WRAP_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFFD)) +#define RGX_CR_BIF_PM_CAT_BASE_ALIST1_WRAP_EN (IMG_UINT64_C(0X0000000000000002)) +#define RGX_CR_BIF_PM_CAT_BASE_ALIST1_VALID_SHIFT (0U) +#define RGX_CR_BIF_PM_CAT_BASE_ALIST1_VALID_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFFE)) +#define RGX_CR_BIF_PM_CAT_BASE_ALIST1_VALID_EN (IMG_UINT64_C(0X0000000000000001)) + + +/* + Register RGX_CR_BIF_MMU_ENTRY_STATUS +*/ +#define RGX_CR_BIF_MMU_ENTRY_STATUS (0x1288U) +#define RGX_CR_BIF_MMU_ENTRY_STATUS_MASKFULL (IMG_UINT64_C(0x000000FFFFFFF0F3)) +#define RGX_CR_BIF_MMU_ENTRY_STATUS_ADDRESS_SHIFT (12U) +#define RGX_CR_BIF_MMU_ENTRY_STATUS_ADDRESS_CLRMSK (IMG_UINT64_C(0XFFFFFF0000000FFF)) +#define RGX_CR_BIF_MMU_ENTRY_STATUS_CAT_BASE_SHIFT (4U) +#define RGX_CR_BIF_MMU_ENTRY_STATUS_CAT_BASE_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFF0F)) +#define RGX_CR_BIF_MMU_ENTRY_STATUS_DATA_TYPE_SHIFT (0U) +#define RGX_CR_BIF_MMU_ENTRY_STATUS_DATA_TYPE_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFFC)) + + +/* + Register RGX_CR_BIF_MMU_ENTRY +*/ +#define RGX_CR_BIF_MMU_ENTRY (0x1290U) +#define RGX_CR_BIF_MMU_ENTRY_MASKFULL (IMG_UINT64_C(0x0000000000000003)) +#define RGX_CR_BIF_MMU_ENTRY_ENABLE_SHIFT (1U) +#define RGX_CR_BIF_MMU_ENTRY_ENABLE_CLRMSK (0XFFFFFFFDU) +#define RGX_CR_BIF_MMU_ENTRY_ENABLE_EN (0X00000002U) +#define RGX_CR_BIF_MMU_ENTRY_PENDING_SHIFT (0U) +#define RGX_CR_BIF_MMU_ENTRY_PENDING_CLRMSK (0XFFFFFFFEU) +#define RGX_CR_BIF_MMU_ENTRY_PENDING_EN (0X00000001U) + + +/* + Register RGX_CR_BIF_CTRL_INVAL +*/ +#define RGX_CR_BIF_CTRL_INVAL (0x12A0U) +#define RGX_CR_BIF_CTRL_INVAL_MASKFULL (IMG_UINT64_C(0x000000000000000F)) +#define RGX_CR_BIF_CTRL_INVAL_TLB1_SHIFT (3U) +#define RGX_CR_BIF_CTRL_INVAL_TLB1_CLRMSK (0XFFFFFFF7U) +#define RGX_CR_BIF_CTRL_INVAL_TLB1_EN (0X00000008U) +#define RGX_CR_BIF_CTRL_INVAL_PC_SHIFT (2U) +#define RGX_CR_BIF_CTRL_INVAL_PC_CLRMSK (0XFFFFFFFBU) +#define RGX_CR_BIF_CTRL_INVAL_PC_EN (0X00000004U) +#define RGX_CR_BIF_CTRL_INVAL_PD_SHIFT (1U) +#define RGX_CR_BIF_CTRL_INVAL_PD_CLRMSK (0XFFFFFFFDU) +#define RGX_CR_BIF_CTRL_INVAL_PD_EN (0X00000002U) +#define RGX_CR_BIF_CTRL_INVAL_PT_SHIFT (0U) +#define RGX_CR_BIF_CTRL_INVAL_PT_CLRMSK (0XFFFFFFFEU) +#define RGX_CR_BIF_CTRL_INVAL_PT_EN (0X00000001U) + + +/* + Register RGX_CR_BIF_CTRL +*/ +#define RGX_CR_BIF_CTRL (0x12A8U) +#define RGX_CR_BIF_CTRL_MASKFULL (IMG_UINT64_C(0x00000000000000FF)) +#define RGX_CR_BIF_CTRL_ENABLE_MMU_QUEUE_BYPASS_SHIFT (7U) +#define RGX_CR_BIF_CTRL_ENABLE_MMU_QUEUE_BYPASS_CLRMSK (0XFFFFFF7FU) +#define RGX_CR_BIF_CTRL_ENABLE_MMU_QUEUE_BYPASS_EN (0X00000080U) +#define RGX_CR_BIF_CTRL_ENABLE_MMU_AUTO_PREFETCH_SHIFT (6U) +#define RGX_CR_BIF_CTRL_ENABLE_MMU_AUTO_PREFETCH_CLRMSK (0XFFFFFFBFU) +#define RGX_CR_BIF_CTRL_ENABLE_MMU_AUTO_PREFETCH_EN (0X00000040U) +#define RGX_CR_BIF_CTRL_PAUSE_MMU_BIF3_SHIFT (5U) +#define RGX_CR_BIF_CTRL_PAUSE_MMU_BIF3_CLRMSK (0XFFFFFFDFU) +#define RGX_CR_BIF_CTRL_PAUSE_MMU_BIF3_EN (0X00000020U) +#define RGX_CR_BIF_CTRL_PAUSE_MMU_BIF2_SHIFT (4U) +#define RGX_CR_BIF_CTRL_PAUSE_MMU_BIF2_CLRMSK (0XFFFFFFEFU) +#define RGX_CR_BIF_CTRL_PAUSE_MMU_BIF2_EN (0X00000010U) +#define RGX_CR_BIF_CTRL_PAUSE_BIF1_SHIFT (3U) +#define RGX_CR_BIF_CTRL_PAUSE_BIF1_CLRMSK (0XFFFFFFF7U) +#define RGX_CR_BIF_CTRL_PAUSE_BIF1_EN (0X00000008U) +#define RGX_CR_BIF_CTRL_PAUSE_MMU_PM_SHIFT (2U) +#define RGX_CR_BIF_CTRL_PAUSE_MMU_PM_CLRMSK (0XFFFFFFFBU) +#define RGX_CR_BIF_CTRL_PAUSE_MMU_PM_EN (0X00000004U) +#define RGX_CR_BIF_CTRL_PAUSE_MMU_BIF1_SHIFT (1U) +#define RGX_CR_BIF_CTRL_PAUSE_MMU_BIF1_CLRMSK (0XFFFFFFFDU) +#define RGX_CR_BIF_CTRL_PAUSE_MMU_BIF1_EN (0X00000002U) +#define RGX_CR_BIF_CTRL_PAUSE_MMU_BIF0_SHIFT (0U) +#define RGX_CR_BIF_CTRL_PAUSE_MMU_BIF0_CLRMSK (0XFFFFFFFEU) +#define RGX_CR_BIF_CTRL_PAUSE_MMU_BIF0_EN (0X00000001U) + + +/* + Register RGX_CR_BIF_FAULT_BANK0_MMU_STATUS +*/ +#define RGX_CR_BIF_FAULT_BANK0_MMU_STATUS (0x12B0U) +#define RGX_CR_BIF_FAULT_BANK0_MMU_STATUS_MASKFULL (IMG_UINT64_C(0x000000000000F775)) +#define RGX_CR_BIF_FAULT_BANK0_MMU_STATUS_CAT_BASE_SHIFT (12U) +#define RGX_CR_BIF_FAULT_BANK0_MMU_STATUS_CAT_BASE_CLRMSK (0XFFFF0FFFU) +#define RGX_CR_BIF_FAULT_BANK0_MMU_STATUS_PAGE_SIZE_SHIFT (8U) +#define RGX_CR_BIF_FAULT_BANK0_MMU_STATUS_PAGE_SIZE_CLRMSK (0XFFFFF8FFU) +#define RGX_CR_BIF_FAULT_BANK0_MMU_STATUS_DATA_TYPE_SHIFT (5U) +#define RGX_CR_BIF_FAULT_BANK0_MMU_STATUS_DATA_TYPE_CLRMSK (0XFFFFFF9FU) +#define RGX_CR_BIF_FAULT_BANK0_MMU_STATUS_FAULT_RO_SHIFT (4U) +#define RGX_CR_BIF_FAULT_BANK0_MMU_STATUS_FAULT_RO_CLRMSK (0XFFFFFFEFU) +#define RGX_CR_BIF_FAULT_BANK0_MMU_STATUS_FAULT_RO_EN (0X00000010U) +#define RGX_CR_BIF_FAULT_BANK0_MMU_STATUS_FAULT_PM_META_RO_SHIFT (2U) +#define RGX_CR_BIF_FAULT_BANK0_MMU_STATUS_FAULT_PM_META_RO_CLRMSK (0XFFFFFFFBU) +#define RGX_CR_BIF_FAULT_BANK0_MMU_STATUS_FAULT_PM_META_RO_EN (0X00000004U) +#define RGX_CR_BIF_FAULT_BANK0_MMU_STATUS_FAULT_SHIFT (0U) +#define RGX_CR_BIF_FAULT_BANK0_MMU_STATUS_FAULT_CLRMSK (0XFFFFFFFEU) +#define RGX_CR_BIF_FAULT_BANK0_MMU_STATUS_FAULT_EN (0X00000001U) + + +/* + Register RGX_CR_BIF_FAULT_BANK0_REQ_STATUS +*/ +#define RGX_CR_BIF_FAULT_BANK0_REQ_STATUS (0x12B8U) +#define RGX_CR_BIF_FAULT_BANK0_REQ_STATUS_MASKFULL (IMG_UINT64_C(0x0007FFFFFFFFFFF0)) +#define RGX_CR_BIF_FAULT_BANK0_REQ_STATUS_RNW_SHIFT (50U) +#define RGX_CR_BIF_FAULT_BANK0_REQ_STATUS_RNW_CLRMSK (IMG_UINT64_C(0XFFFBFFFFFFFFFFFF)) +#define RGX_CR_BIF_FAULT_BANK0_REQ_STATUS_RNW_EN (IMG_UINT64_C(0X0004000000000000)) +#define RGX_CR_BIF_FAULT_BANK0_REQ_STATUS_TAG_SB_SHIFT (44U) +#define RGX_CR_BIF_FAULT_BANK0_REQ_STATUS_TAG_SB_CLRMSK (IMG_UINT64_C(0XFFFC0FFFFFFFFFFF)) +#define RGX_CR_BIF_FAULT_BANK0_REQ_STATUS_TAG_ID_SHIFT (40U) +#define RGX_CR_BIF_FAULT_BANK0_REQ_STATUS_TAG_ID_CLRMSK (IMG_UINT64_C(0XFFFFF0FFFFFFFFFF)) +#define RGX_CR_BIF_FAULT_BANK0_REQ_STATUS_ADDRESS_SHIFT (4U) +#define RGX_CR_BIF_FAULT_BANK0_REQ_STATUS_ADDRESS_CLRMSK (IMG_UINT64_C(0XFFFFFF000000000F)) +#define RGX_CR_BIF_FAULT_BANK0_REQ_STATUS_ADDRESS_ALIGNSHIFT (4U) +#define RGX_CR_BIF_FAULT_BANK0_REQ_STATUS_ADDRESS_ALIGNSIZE (16U) + + +/* + Register RGX_CR_BIF_FAULT_BANK1_MMU_STATUS +*/ +#define RGX_CR_BIF_FAULT_BANK1_MMU_STATUS (0x12C0U) +#define RGX_CR_BIF_FAULT_BANK1_MMU_STATUS_MASKFULL (IMG_UINT64_C(0x000000000000F775)) +#define RGX_CR_BIF_FAULT_BANK1_MMU_STATUS_CAT_BASE_SHIFT (12U) +#define RGX_CR_BIF_FAULT_BANK1_MMU_STATUS_CAT_BASE_CLRMSK (0XFFFF0FFFU) +#define RGX_CR_BIF_FAULT_BANK1_MMU_STATUS_PAGE_SIZE_SHIFT (8U) +#define RGX_CR_BIF_FAULT_BANK1_MMU_STATUS_PAGE_SIZE_CLRMSK (0XFFFFF8FFU) +#define RGX_CR_BIF_FAULT_BANK1_MMU_STATUS_DATA_TYPE_SHIFT (5U) +#define RGX_CR_BIF_FAULT_BANK1_MMU_STATUS_DATA_TYPE_CLRMSK (0XFFFFFF9FU) +#define RGX_CR_BIF_FAULT_BANK1_MMU_STATUS_FAULT_RO_SHIFT (4U) +#define RGX_CR_BIF_FAULT_BANK1_MMU_STATUS_FAULT_RO_CLRMSK (0XFFFFFFEFU) +#define RGX_CR_BIF_FAULT_BANK1_MMU_STATUS_FAULT_RO_EN (0X00000010U) +#define RGX_CR_BIF_FAULT_BANK1_MMU_STATUS_FAULT_PM_META_RO_SHIFT (2U) +#define RGX_CR_BIF_FAULT_BANK1_MMU_STATUS_FAULT_PM_META_RO_CLRMSK (0XFFFFFFFBU) +#define RGX_CR_BIF_FAULT_BANK1_MMU_STATUS_FAULT_PM_META_RO_EN (0X00000004U) +#define RGX_CR_BIF_FAULT_BANK1_MMU_STATUS_FAULT_SHIFT (0U) +#define RGX_CR_BIF_FAULT_BANK1_MMU_STATUS_FAULT_CLRMSK (0XFFFFFFFEU) +#define RGX_CR_BIF_FAULT_BANK1_MMU_STATUS_FAULT_EN (0X00000001U) + + +/* + Register RGX_CR_BIF_FAULT_BANK1_REQ_STATUS +*/ +#define RGX_CR_BIF_FAULT_BANK1_REQ_STATUS (0x12C8U) +#define RGX_CR_BIF_FAULT_BANK1_REQ_STATUS_MASKFULL (IMG_UINT64_C(0x0007FFFFFFFFFFF0)) +#define RGX_CR_BIF_FAULT_BANK1_REQ_STATUS_RNW_SHIFT (50U) +#define RGX_CR_BIF_FAULT_BANK1_REQ_STATUS_RNW_CLRMSK (IMG_UINT64_C(0XFFFBFFFFFFFFFFFF)) +#define RGX_CR_BIF_FAULT_BANK1_REQ_STATUS_RNW_EN (IMG_UINT64_C(0X0004000000000000)) +#define RGX_CR_BIF_FAULT_BANK1_REQ_STATUS_TAG_SB_SHIFT (44U) +#define RGX_CR_BIF_FAULT_BANK1_REQ_STATUS_TAG_SB_CLRMSK (IMG_UINT64_C(0XFFFC0FFFFFFFFFFF)) +#define RGX_CR_BIF_FAULT_BANK1_REQ_STATUS_TAG_ID_SHIFT (40U) +#define RGX_CR_BIF_FAULT_BANK1_REQ_STATUS_TAG_ID_CLRMSK (IMG_UINT64_C(0XFFFFF0FFFFFFFFFF)) +#define RGX_CR_BIF_FAULT_BANK1_REQ_STATUS_ADDRESS_SHIFT (4U) +#define RGX_CR_BIF_FAULT_BANK1_REQ_STATUS_ADDRESS_CLRMSK (IMG_UINT64_C(0XFFFFFF000000000F)) +#define RGX_CR_BIF_FAULT_BANK1_REQ_STATUS_ADDRESS_ALIGNSHIFT (4U) +#define RGX_CR_BIF_FAULT_BANK1_REQ_STATUS_ADDRESS_ALIGNSIZE (16U) + + +/* + Register RGX_CR_BIF_MMU_STATUS +*/ +#define RGX_CR_BIF_MMU_STATUS (0x12D0U) +#define RGX_CR_BIF_MMU_STATUS_MASKFULL (IMG_UINT64_C(0x000000001FFFFFF7)) +#define RGX_CR_BIF_MMU_STATUS_PM_FAULT_SHIFT (28U) +#define RGX_CR_BIF_MMU_STATUS_PM_FAULT_CLRMSK (0XEFFFFFFFU) +#define RGX_CR_BIF_MMU_STATUS_PM_FAULT_EN (0X10000000U) +#define RGX_CR_BIF_MMU_STATUS_PC_DATA_SHIFT (20U) +#define RGX_CR_BIF_MMU_STATUS_PC_DATA_CLRMSK (0XF00FFFFFU) +#define RGX_CR_BIF_MMU_STATUS_PD_DATA_SHIFT (12U) +#define RGX_CR_BIF_MMU_STATUS_PD_DATA_CLRMSK (0XFFF00FFFU) +#define RGX_CR_BIF_MMU_STATUS_PT_DATA_SHIFT (4U) +#define RGX_CR_BIF_MMU_STATUS_PT_DATA_CLRMSK (0XFFFFF00FU) +#define RGX_CR_BIF_MMU_STATUS_STALLED_SHIFT (2U) +#define RGX_CR_BIF_MMU_STATUS_STALLED_CLRMSK (0XFFFFFFFBU) +#define RGX_CR_BIF_MMU_STATUS_STALLED_EN (0X00000004U) +#define RGX_CR_BIF_MMU_STATUS_PAUSED_SHIFT (1U) +#define RGX_CR_BIF_MMU_STATUS_PAUSED_CLRMSK (0XFFFFFFFDU) +#define RGX_CR_BIF_MMU_STATUS_PAUSED_EN (0X00000002U) +#define RGX_CR_BIF_MMU_STATUS_BUSY_SHIFT (0U) +#define RGX_CR_BIF_MMU_STATUS_BUSY_CLRMSK (0XFFFFFFFEU) +#define RGX_CR_BIF_MMU_STATUS_BUSY_EN (0X00000001U) + + +/* + Register RGX_CR_BIF_READS_EXT_STATUS +*/ +#define RGX_CR_BIF_READS_EXT_STATUS (0x1320U) +#define RGX_CR_BIF_READS_EXT_STATUS_MASKFULL (IMG_UINT64_C(0x00000000007FFFFF)) +#define RGX_CR_BIF_READS_EXT_STATUS_MMU_SHIFT (16U) +#define RGX_CR_BIF_READS_EXT_STATUS_MMU_CLRMSK (0XFF80FFFFU) +#define RGX_CR_BIF_READS_EXT_STATUS_BANK1_SHIFT (0U) +#define RGX_CR_BIF_READS_EXT_STATUS_BANK1_CLRMSK (0XFFFF0000U) + + +/* + Register RGX_CR_BIF_READS_INT_STATUS +*/ +#define RGX_CR_BIF_READS_INT_STATUS (0x1328U) +#define RGX_CR_BIF_READS_INT_STATUS_MASKFULL (IMG_UINT64_C(0x00000000007FFFFF)) +#define RGX_CR_BIF_READS_INT_STATUS_MMU_SHIFT (16U) +#define RGX_CR_BIF_READS_INT_STATUS_MMU_CLRMSK (0XFF80FFFFU) +#define RGX_CR_BIF_READS_INT_STATUS_BANK1_SHIFT (0U) +#define RGX_CR_BIF_READS_INT_STATUS_BANK1_CLRMSK (0XFFFF0000U) + + +/* + Register RGX_CR_BIFPM_READS_INT_STATUS +*/ +#define RGX_CR_BIFPM_READS_INT_STATUS (0x1330U) +#define RGX_CR_BIFPM_READS_INT_STATUS_MASKFULL (IMG_UINT64_C(0x000000000000FFFF)) +#define RGX_CR_BIFPM_READS_INT_STATUS_BANK0_SHIFT (0U) +#define RGX_CR_BIFPM_READS_INT_STATUS_BANK0_CLRMSK (0XFFFF0000U) + + +/* + Register RGX_CR_BIFPM_READS_EXT_STATUS +*/ +#define RGX_CR_BIFPM_READS_EXT_STATUS (0x1338U) +#define RGX_CR_BIFPM_READS_EXT_STATUS_MASKFULL (IMG_UINT64_C(0x000000000000FFFF)) +#define RGX_CR_BIFPM_READS_EXT_STATUS_BANK0_SHIFT (0U) +#define RGX_CR_BIFPM_READS_EXT_STATUS_BANK0_CLRMSK (0XFFFF0000U) + + +/* + Register RGX_CR_BIFPM_STATUS_MMU +*/ +#define RGX_CR_BIFPM_STATUS_MMU (0x1350U) +#define RGX_CR_BIFPM_STATUS_MMU_MASKFULL (IMG_UINT64_C(0x00000000000000FF)) +#define RGX_CR_BIFPM_STATUS_MMU_REQUESTS_SHIFT (0U) +#define RGX_CR_BIFPM_STATUS_MMU_REQUESTS_CLRMSK (0XFFFFFF00U) + + +/* + Register RGX_CR_BIF_STATUS_MMU +*/ +#define RGX_CR_BIF_STATUS_MMU (0x1358U) +#define RGX_CR_BIF_STATUS_MMU_MASKFULL (IMG_UINT64_C(0x00000000000000FF)) +#define RGX_CR_BIF_STATUS_MMU_REQUESTS_SHIFT (0U) +#define RGX_CR_BIF_STATUS_MMU_REQUESTS_CLRMSK (0XFFFFFF00U) + + +/* + Register RGX_CR_BIF_FAULT_READ +*/ +#define RGX_CR_BIF_FAULT_READ (0x13E0U) +#define RGX_CR_BIF_FAULT_READ_MASKFULL (IMG_UINT64_C(0x000000FFFFFFFFF0)) +#define RGX_CR_BIF_FAULT_READ_ADDRESS_SHIFT (4U) +#define RGX_CR_BIF_FAULT_READ_ADDRESS_CLRMSK (IMG_UINT64_C(0XFFFFFF000000000F)) +#define RGX_CR_BIF_FAULT_READ_ADDRESS_ALIGNSHIFT (4U) +#define RGX_CR_BIF_FAULT_READ_ADDRESS_ALIGNSIZE (16U) + + +/* + Register RGX_CR_TEXAS_BIF_FAULT_BANK0_MMU_STATUS +*/ +#define RGX_CR_TEXAS_BIF_FAULT_BANK0_MMU_STATUS (0x1430U) +#define RGX_CR_TEXAS_BIF_FAULT_BANK0_MMU_STATUS_MASKFULL (IMG_UINT64_C(0x000000000000F775)) +#define RGX_CR_TEXAS_BIF_FAULT_BANK0_MMU_STATUS_CAT_BASE_SHIFT (12U) +#define RGX_CR_TEXAS_BIF_FAULT_BANK0_MMU_STATUS_CAT_BASE_CLRMSK (0XFFFF0FFFU) +#define RGX_CR_TEXAS_BIF_FAULT_BANK0_MMU_STATUS_PAGE_SIZE_SHIFT (8U) +#define RGX_CR_TEXAS_BIF_FAULT_BANK0_MMU_STATUS_PAGE_SIZE_CLRMSK (0XFFFFF8FFU) +#define RGX_CR_TEXAS_BIF_FAULT_BANK0_MMU_STATUS_DATA_TYPE_SHIFT (5U) +#define RGX_CR_TEXAS_BIF_FAULT_BANK0_MMU_STATUS_DATA_TYPE_CLRMSK (0XFFFFFF9FU) +#define RGX_CR_TEXAS_BIF_FAULT_BANK0_MMU_STATUS_FAULT_RO_SHIFT (4U) +#define RGX_CR_TEXAS_BIF_FAULT_BANK0_MMU_STATUS_FAULT_RO_CLRMSK (0XFFFFFFEFU) +#define RGX_CR_TEXAS_BIF_FAULT_BANK0_MMU_STATUS_FAULT_RO_EN (0X00000010U) +#define RGX_CR_TEXAS_BIF_FAULT_BANK0_MMU_STATUS_FAULT_PM_META_RO_SHIFT (2U) +#define RGX_CR_TEXAS_BIF_FAULT_BANK0_MMU_STATUS_FAULT_PM_META_RO_CLRMSK (0XFFFFFFFBU) +#define RGX_CR_TEXAS_BIF_FAULT_BANK0_MMU_STATUS_FAULT_PM_META_RO_EN (0X00000004U) +#define RGX_CR_TEXAS_BIF_FAULT_BANK0_MMU_STATUS_FAULT_SHIFT (0U) +#define RGX_CR_TEXAS_BIF_FAULT_BANK0_MMU_STATUS_FAULT_CLRMSK (0XFFFFFFFEU) +#define RGX_CR_TEXAS_BIF_FAULT_BANK0_MMU_STATUS_FAULT_EN (0X00000001U) + + +/* + Register RGX_CR_TEXAS_BIF_FAULT_BANK0_REQ_STATUS +*/ +#define RGX_CR_TEXAS_BIF_FAULT_BANK0_REQ_STATUS (0x1438U) +#define RGX_CR_TEXAS_BIF_FAULT_BANK0_REQ_STATUS_MASKFULL (IMG_UINT64_C(0x0007FFFFFFFFFFF0)) +#define RGX_CR_TEXAS_BIF_FAULT_BANK0_REQ_STATUS_RNW_SHIFT (50U) +#define RGX_CR_TEXAS_BIF_FAULT_BANK0_REQ_STATUS_RNW_CLRMSK (IMG_UINT64_C(0XFFFBFFFFFFFFFFFF)) +#define RGX_CR_TEXAS_BIF_FAULT_BANK0_REQ_STATUS_RNW_EN (IMG_UINT64_C(0X0004000000000000)) +#define RGX_CR_TEXAS_BIF_FAULT_BANK0_REQ_STATUS_TAG_SB_SHIFT (44U) +#define RGX_CR_TEXAS_BIF_FAULT_BANK0_REQ_STATUS_TAG_SB_CLRMSK (IMG_UINT64_C(0XFFFC0FFFFFFFFFFF)) +#define RGX_CR_TEXAS_BIF_FAULT_BANK0_REQ_STATUS_TAG_ID_SHIFT (40U) +#define RGX_CR_TEXAS_BIF_FAULT_BANK0_REQ_STATUS_TAG_ID_CLRMSK (IMG_UINT64_C(0XFFFFF0FFFFFFFFFF)) +#define RGX_CR_TEXAS_BIF_FAULT_BANK0_REQ_STATUS_ADDRESS_SHIFT (4U) +#define RGX_CR_TEXAS_BIF_FAULT_BANK0_REQ_STATUS_ADDRESS_CLRMSK (IMG_UINT64_C(0XFFFFFF000000000F)) +#define RGX_CR_TEXAS_BIF_FAULT_BANK0_REQ_STATUS_ADDRESS_ALIGNSHIFT (4U) +#define RGX_CR_TEXAS_BIF_FAULT_BANK0_REQ_STATUS_ADDRESS_ALIGNSIZE (16U) + + +/* + Register RGX_CR_MCU_FENCE +*/ +#define RGX_CR_MCU_FENCE (0x1740U) +#define RGX_CR_MCU_FENCE_MASKFULL (IMG_UINT64_C(0x000007FFFFFFFFE0)) +#define RGX_CR_MCU_FENCE_DM_SHIFT (40U) +#define RGX_CR_MCU_FENCE_DM_CLRMSK (IMG_UINT64_C(0XFFFFF8FFFFFFFFFF)) +#define RGX_CR_MCU_FENCE_DM_VERTEX (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_MCU_FENCE_DM_PIXEL (IMG_UINT64_C(0x0000010000000000)) +#define RGX_CR_MCU_FENCE_DM_COMPUTE (IMG_UINT64_C(0x0000020000000000)) +#if defined(RGX_FEATURE_RAY_TRACING) +#define RGX_CR_MCU_FENCE_DM_RAY_VERTEX (IMG_UINT64_C(0x0000030000000000)) +#define RGX_CR_MCU_FENCE_DM_RAY (IMG_UINT64_C(0x0000040000000000)) +#endif /* RGX_FEATURE_RAY_TRACING */ + +#define RGX_CR_MCU_FENCE_ADDR_SHIFT (5U) +#define RGX_CR_MCU_FENCE_ADDR_CLRMSK (IMG_UINT64_C(0XFFFFFF000000001F)) +#define RGX_CR_MCU_FENCE_ADDR_ALIGNSHIFT (5U) +#define RGX_CR_MCU_FENCE_ADDR_ALIGNSIZE (32U) + + +/* + Register RGX_CR_SLC_CTRL_MISC +*/ +#define RGX_CR_SLC_CTRL_MISC (0x3800U) +#define RGX_CR_SLC_CTRL_MISC_MASKFULL (IMG_UINT64_C(0xFFFFFFFF00FF0105)) +#define RGX_CR_SLC_CTRL_MISC_SCRAMBLE_BITS_SHIFT (32U) +#define RGX_CR_SLC_CTRL_MISC_SCRAMBLE_BITS_CLRMSK (IMG_UINT64_C(0X00000000FFFFFFFF)) +#define RGX_CR_SLC_CTRL_MISC_ADDR_DECODE_MODE_SHIFT (16U) +#define RGX_CR_SLC_CTRL_MISC_ADDR_DECODE_MODE_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFF00FFFF)) +#define RGX_CR_SLC_CTRL_MISC_ADDR_DECODE_MODE_INTERLEAVED_64_BYTE (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_SLC_CTRL_MISC_ADDR_DECODE_MODE_INTERLEAVED_128_BYTE (IMG_UINT64_C(0x0000000000010000)) +#define RGX_CR_SLC_CTRL_MISC_ADDR_DECODE_MODE_SIMPLE_HASH1 (IMG_UINT64_C(0x0000000000100000)) +#define RGX_CR_SLC_CTRL_MISC_ADDR_DECODE_MODE_SIMPLE_HASH2 (IMG_UINT64_C(0x0000000000110000)) +#define RGX_CR_SLC_CTRL_MISC_ADDR_DECODE_MODE_PVR_HASH1 (IMG_UINT64_C(0x0000000000200000)) +#define RGX_CR_SLC_CTRL_MISC_ADDR_DECODE_MODE_PVR_HASH2_SCRAMBLE (IMG_UINT64_C(0x0000000000210000)) +#define RGX_CR_SLC_CTRL_MISC_PAUSE_SHIFT (8U) +#define RGX_CR_SLC_CTRL_MISC_PAUSE_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFEFF)) +#define RGX_CR_SLC_CTRL_MISC_PAUSE_EN (IMG_UINT64_C(0X0000000000000100)) +#define RGX_CR_SLC_CTRL_MISC_ENABLE_LINE_USE_LIMIT_SHIFT (2U) +#define RGX_CR_SLC_CTRL_MISC_ENABLE_LINE_USE_LIMIT_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFFB)) +#define RGX_CR_SLC_CTRL_MISC_ENABLE_LINE_USE_LIMIT_EN (IMG_UINT64_C(0X0000000000000004)) +#define RGX_CR_SLC_CTRL_MISC_BYPASS_BURST_COMBINER_SHIFT (0U) +#define RGX_CR_SLC_CTRL_MISC_BYPASS_BURST_COMBINER_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFFE)) +#define RGX_CR_SLC_CTRL_MISC_BYPASS_BURST_COMBINER_EN (IMG_UINT64_C(0X0000000000000001)) + + +/* + Register RGX_CR_SLC_CTRL_FLUSH_INVAL +*/ +#define RGX_CR_SLC_CTRL_FLUSH_INVAL (0x3818U) +#define RGX_CR_SLC_CTRL_FLUSH_INVAL_MASKFULL (IMG_UINT64_C(0x00000000800007FF)) +#define RGX_CR_SLC_CTRL_FLUSH_INVAL_LAZY_SHIFT (31U) +#define RGX_CR_SLC_CTRL_FLUSH_INVAL_LAZY_CLRMSK (0X7FFFFFFFU) +#define RGX_CR_SLC_CTRL_FLUSH_INVAL_LAZY_EN (0X80000000U) +#if defined(RGX_FEATURE_RAY_TRACING) +#define RGX_CR_SLC_CTRL_FLUSH_INVAL_DM_RAY_VERTEX_SHIFT (10U) +#define RGX_CR_SLC_CTRL_FLUSH_INVAL_DM_RAY_VERTEX_CLRMSK (0XFFFFFBFFU) +#define RGX_CR_SLC_CTRL_FLUSH_INVAL_DM_RAY_VERTEX_EN (0X00000400U) +#define RGX_CR_SLC_CTRL_FLUSH_INVAL_DM_RAY_SHIFT (9U) +#define RGX_CR_SLC_CTRL_FLUSH_INVAL_DM_RAY_CLRMSK (0XFFFFFDFFU) +#define RGX_CR_SLC_CTRL_FLUSH_INVAL_DM_RAY_EN (0X00000200U) +#endif /* RGX_FEATURE_RAY_TRACING */ + +#define RGX_CR_SLC_CTRL_FLUSH_INVAL_DM_FRC_SHIFT (8U) +#define RGX_CR_SLC_CTRL_FLUSH_INVAL_DM_FRC_CLRMSK (0XFFFFFEFFU) +#define RGX_CR_SLC_CTRL_FLUSH_INVAL_DM_FRC_EN (0X00000100U) +#define RGX_CR_SLC_CTRL_FLUSH_INVAL_DM_VXE_SHIFT (7U) +#define RGX_CR_SLC_CTRL_FLUSH_INVAL_DM_VXE_CLRMSK (0XFFFFFF7FU) +#define RGX_CR_SLC_CTRL_FLUSH_INVAL_DM_VXE_EN (0X00000080U) +#define RGX_CR_SLC_CTRL_FLUSH_INVAL_DM_VXD_SHIFT (6U) +#define RGX_CR_SLC_CTRL_FLUSH_INVAL_DM_VXD_CLRMSK (0XFFFFFFBFU) +#define RGX_CR_SLC_CTRL_FLUSH_INVAL_DM_VXD_EN (0X00000040U) +#define RGX_CR_SLC_CTRL_FLUSH_INVAL_DM_HOST_META_SHIFT (5U) +#define RGX_CR_SLC_CTRL_FLUSH_INVAL_DM_HOST_META_CLRMSK (0XFFFFFFDFU) +#define RGX_CR_SLC_CTRL_FLUSH_INVAL_DM_HOST_META_EN (0X00000020U) +#define RGX_CR_SLC_CTRL_FLUSH_INVAL_DM_MMU_SHIFT (4U) +#define RGX_CR_SLC_CTRL_FLUSH_INVAL_DM_MMU_CLRMSK (0XFFFFFFEFU) +#define RGX_CR_SLC_CTRL_FLUSH_INVAL_DM_MMU_EN (0X00000010U) +#define RGX_CR_SLC_CTRL_FLUSH_INVAL_DM_COMPUTE_SHIFT (3U) +#define RGX_CR_SLC_CTRL_FLUSH_INVAL_DM_COMPUTE_CLRMSK (0XFFFFFFF7U) +#define RGX_CR_SLC_CTRL_FLUSH_INVAL_DM_COMPUTE_EN (0X00000008U) +#define RGX_CR_SLC_CTRL_FLUSH_INVAL_DM_PIXEL_SHIFT (2U) +#define RGX_CR_SLC_CTRL_FLUSH_INVAL_DM_PIXEL_CLRMSK (0XFFFFFFFBU) +#define RGX_CR_SLC_CTRL_FLUSH_INVAL_DM_PIXEL_EN (0X00000004U) +#define RGX_CR_SLC_CTRL_FLUSH_INVAL_DM_TA_SHIFT (1U) +#define RGX_CR_SLC_CTRL_FLUSH_INVAL_DM_TA_CLRMSK (0XFFFFFFFDU) +#define RGX_CR_SLC_CTRL_FLUSH_INVAL_DM_TA_EN (0X00000002U) +#define RGX_CR_SLC_CTRL_FLUSH_INVAL_ALL_SHIFT (0U) +#define RGX_CR_SLC_CTRL_FLUSH_INVAL_ALL_CLRMSK (0XFFFFFFFEU) +#define RGX_CR_SLC_CTRL_FLUSH_INVAL_ALL_EN (0X00000001U) + + +/* + Register RGX_CR_SLC_STATUS0 +*/ +#define RGX_CR_SLC_STATUS0 (0x3820U) +#define RGX_CR_SLC_STATUS0_MASKFULL (IMG_UINT64_C(0x0000000000000007)) +#define RGX_CR_SLC_STATUS0_FLUSH_INVAL_PENDING_SHIFT (2U) +#define RGX_CR_SLC_STATUS0_FLUSH_INVAL_PENDING_CLRMSK (0XFFFFFFFBU) +#define RGX_CR_SLC_STATUS0_FLUSH_INVAL_PENDING_EN (0X00000004U) +#define RGX_CR_SLC_STATUS0_INVAL_PENDING_SHIFT (1U) +#define RGX_CR_SLC_STATUS0_INVAL_PENDING_CLRMSK (0XFFFFFFFDU) +#define RGX_CR_SLC_STATUS0_INVAL_PENDING_EN (0X00000002U) +#define RGX_CR_SLC_STATUS0_FLUSH_PENDING_SHIFT (0U) +#define RGX_CR_SLC_STATUS0_FLUSH_PENDING_CLRMSK (0XFFFFFFFEU) +#define RGX_CR_SLC_STATUS0_FLUSH_PENDING_EN (0X00000001U) + + +/* + Register RGX_CR_SLC_CTRL_BYPASS +*/ +#define RGX_CR_SLC_CTRL_BYPASS (0x3828U) +#define RGX_CR_SLC_CTRL_BYPASS_MASKFULL (IMG_UINT64_C(0x000000000FFFFFFF)) +#if defined(RGX_FEATURE_RAY_TRACING) +#define RGX_CR_SLC_CTRL_BYPASS_DM_RAY_VERTEX_SHIFT (27U) +#define RGX_CR_SLC_CTRL_BYPASS_DM_RAY_VERTEX_CLRMSK (0XF7FFFFFFU) +#define RGX_CR_SLC_CTRL_BYPASS_DM_RAY_VERTEX_EN (0X08000000U) +#define RGX_CR_SLC_CTRL_BYPASS_DM_RAY_SHIFT (26U) +#define RGX_CR_SLC_CTRL_BYPASS_DM_RAY_CLRMSK (0XFBFFFFFFU) +#define RGX_CR_SLC_CTRL_BYPASS_DM_RAY_EN (0X04000000U) +#endif /* RGX_FEATURE_RAY_TRACING */ + +#define RGX_CR_SLC_CTRL_BYPASS_REQ_IPF_CPF_SHIFT (25U) +#define RGX_CR_SLC_CTRL_BYPASS_REQ_IPF_CPF_CLRMSK (0XFDFFFFFFU) +#define RGX_CR_SLC_CTRL_BYPASS_REQ_IPF_CPF_EN (0X02000000U) +#define RGX_CR_SLC_CTRL_BYPASS_REQ_TPU_SHIFT (24U) +#define RGX_CR_SLC_CTRL_BYPASS_REQ_TPU_CLRMSK (0XFEFFFFFFU) +#define RGX_CR_SLC_CTRL_BYPASS_REQ_TPU_EN (0X01000000U) +#define RGX_CR_SLC_CTRL_BYPASS_REQ_FBDC_SHIFT (23U) +#define RGX_CR_SLC_CTRL_BYPASS_REQ_FBDC_CLRMSK (0XFF7FFFFFU) +#define RGX_CR_SLC_CTRL_BYPASS_REQ_FBDC_EN (0X00800000U) +#define RGX_CR_SLC_CTRL_BYPASS_REQ_TLA_SHIFT (22U) +#define RGX_CR_SLC_CTRL_BYPASS_REQ_TLA_CLRMSK (0XFFBFFFFFU) +#define RGX_CR_SLC_CTRL_BYPASS_REQ_TLA_EN (0X00400000U) +#define RGX_CR_SLC_CTRL_BYPASS_BYP_CC_N_SHIFT (21U) +#define RGX_CR_SLC_CTRL_BYPASS_BYP_CC_N_CLRMSK (0XFFDFFFFFU) +#define RGX_CR_SLC_CTRL_BYPASS_BYP_CC_N_EN (0X00200000U) +#define RGX_CR_SLC_CTRL_BYPASS_BYP_CC_SHIFT (20U) +#define RGX_CR_SLC_CTRL_BYPASS_BYP_CC_CLRMSK (0XFFEFFFFFU) +#define RGX_CR_SLC_CTRL_BYPASS_BYP_CC_EN (0X00100000U) +#define RGX_CR_SLC_CTRL_BYPASS_REQ_MCU_SHIFT (19U) +#define RGX_CR_SLC_CTRL_BYPASS_REQ_MCU_CLRMSK (0XFFF7FFFFU) +#define RGX_CR_SLC_CTRL_BYPASS_REQ_MCU_EN (0X00080000U) +#define RGX_CR_SLC_CTRL_BYPASS_REQ_PDS_SHIFT (18U) +#define RGX_CR_SLC_CTRL_BYPASS_REQ_PDS_CLRMSK (0XFFFBFFFFU) +#define RGX_CR_SLC_CTRL_BYPASS_REQ_PDS_EN (0X00040000U) +#define RGX_CR_SLC_CTRL_BYPASS_REQ_TPF_SHIFT (17U) +#define RGX_CR_SLC_CTRL_BYPASS_REQ_TPF_CLRMSK (0XFFFDFFFFU) +#define RGX_CR_SLC_CTRL_BYPASS_REQ_TPF_EN (0X00020000U) +#define RGX_CR_SLC_CTRL_BYPASS_REQ_TA_TPC_SHIFT (16U) +#define RGX_CR_SLC_CTRL_BYPASS_REQ_TA_TPC_CLRMSK (0XFFFEFFFFU) +#define RGX_CR_SLC_CTRL_BYPASS_REQ_TA_TPC_EN (0X00010000U) +#define RGX_CR_SLC_CTRL_BYPASS_REQ_IPF_OBJ_SHIFT (15U) +#define RGX_CR_SLC_CTRL_BYPASS_REQ_IPF_OBJ_CLRMSK (0XFFFF7FFFU) +#define RGX_CR_SLC_CTRL_BYPASS_REQ_IPF_OBJ_EN (0X00008000U) +#define RGX_CR_SLC_CTRL_BYPASS_REQ_USC_SHIFT (14U) +#define RGX_CR_SLC_CTRL_BYPASS_REQ_USC_CLRMSK (0XFFFFBFFFU) +#define RGX_CR_SLC_CTRL_BYPASS_REQ_USC_EN (0X00004000U) +#define RGX_CR_SLC_CTRL_BYPASS_REQ_META_SHIFT (13U) +#define RGX_CR_SLC_CTRL_BYPASS_REQ_META_CLRMSK (0XFFFFDFFFU) +#define RGX_CR_SLC_CTRL_BYPASS_REQ_META_EN (0X00002000U) +#define RGX_CR_SLC_CTRL_BYPASS_REQ_HOST_SHIFT (12U) +#define RGX_CR_SLC_CTRL_BYPASS_REQ_HOST_CLRMSK (0XFFFFEFFFU) +#define RGX_CR_SLC_CTRL_BYPASS_REQ_HOST_EN (0X00001000U) +#define RGX_CR_SLC_CTRL_BYPASS_REQ_MMU_PT_SHIFT (11U) +#define RGX_CR_SLC_CTRL_BYPASS_REQ_MMU_PT_CLRMSK (0XFFFFF7FFU) +#define RGX_CR_SLC_CTRL_BYPASS_REQ_MMU_PT_EN (0X00000800U) +#define RGX_CR_SLC_CTRL_BYPASS_REQ_MMU_PD_SHIFT (10U) +#define RGX_CR_SLC_CTRL_BYPASS_REQ_MMU_PD_CLRMSK (0XFFFFFBFFU) +#define RGX_CR_SLC_CTRL_BYPASS_REQ_MMU_PD_EN (0X00000400U) +#define RGX_CR_SLC_CTRL_BYPASS_REQ_MMU_PC_SHIFT (9U) +#define RGX_CR_SLC_CTRL_BYPASS_REQ_MMU_PC_CLRMSK (0XFFFFFDFFU) +#define RGX_CR_SLC_CTRL_BYPASS_REQ_MMU_PC_EN (0X00000200U) +#define RGX_CR_SLC_CTRL_BYPASS_DM_FRC_SHIFT (8U) +#define RGX_CR_SLC_CTRL_BYPASS_DM_FRC_CLRMSK (0XFFFFFEFFU) +#define RGX_CR_SLC_CTRL_BYPASS_DM_FRC_EN (0X00000100U) +#define RGX_CR_SLC_CTRL_BYPASS_DM_VXE_SHIFT (7U) +#define RGX_CR_SLC_CTRL_BYPASS_DM_VXE_CLRMSK (0XFFFFFF7FU) +#define RGX_CR_SLC_CTRL_BYPASS_DM_VXE_EN (0X00000080U) +#define RGX_CR_SLC_CTRL_BYPASS_DM_VXD_SHIFT (6U) +#define RGX_CR_SLC_CTRL_BYPASS_DM_VXD_CLRMSK (0XFFFFFFBFU) +#define RGX_CR_SLC_CTRL_BYPASS_DM_VXD_EN (0X00000040U) +#define RGX_CR_SLC_CTRL_BYPASS_DM_HOST_META_SHIFT (5U) +#define RGX_CR_SLC_CTRL_BYPASS_DM_HOST_META_CLRMSK (0XFFFFFFDFU) +#define RGX_CR_SLC_CTRL_BYPASS_DM_HOST_META_EN (0X00000020U) +#define RGX_CR_SLC_CTRL_BYPASS_DM_MMU_SHIFT (4U) +#define RGX_CR_SLC_CTRL_BYPASS_DM_MMU_CLRMSK (0XFFFFFFEFU) +#define RGX_CR_SLC_CTRL_BYPASS_DM_MMU_EN (0X00000010U) +#define RGX_CR_SLC_CTRL_BYPASS_DM_COMPUTE_SHIFT (3U) +#define RGX_CR_SLC_CTRL_BYPASS_DM_COMPUTE_CLRMSK (0XFFFFFFF7U) +#define RGX_CR_SLC_CTRL_BYPASS_DM_COMPUTE_EN (0X00000008U) +#define RGX_CR_SLC_CTRL_BYPASS_DM_PIXEL_SHIFT (2U) +#define RGX_CR_SLC_CTRL_BYPASS_DM_PIXEL_CLRMSK (0XFFFFFFFBU) +#define RGX_CR_SLC_CTRL_BYPASS_DM_PIXEL_EN (0X00000004U) +#define RGX_CR_SLC_CTRL_BYPASS_DM_TA_SHIFT (1U) +#define RGX_CR_SLC_CTRL_BYPASS_DM_TA_CLRMSK (0XFFFFFFFDU) +#define RGX_CR_SLC_CTRL_BYPASS_DM_TA_EN (0X00000002U) +#define RGX_CR_SLC_CTRL_BYPASS_ALL_SHIFT (0U) +#define RGX_CR_SLC_CTRL_BYPASS_ALL_CLRMSK (0XFFFFFFFEU) +#define RGX_CR_SLC_CTRL_BYPASS_ALL_EN (0X00000001U) + + +/* + Register RGX_CR_SLC_STATUS1 +*/ +#define RGX_CR_SLC_STATUS1 (0x3870U) +#define RGX_CR_SLC_STATUS1_MASKFULL (IMG_UINT64_C(0x800003FF03FFFFFF)) +#define RGX_CR_SLC_STATUS1_PAUSED_SHIFT (63U) +#define RGX_CR_SLC_STATUS1_PAUSED_CLRMSK (IMG_UINT64_C(0X7FFFFFFFFFFFFFFF)) +#define RGX_CR_SLC_STATUS1_PAUSED_EN (IMG_UINT64_C(0X8000000000000000)) +#define RGX_CR_SLC_STATUS1_READS1_SHIFT (32U) +#define RGX_CR_SLC_STATUS1_READS1_CLRMSK (IMG_UINT64_C(0XFFFFFC00FFFFFFFF)) +#define RGX_CR_SLC_STATUS1_READS0_SHIFT (16U) +#define RGX_CR_SLC_STATUS1_READS0_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFC00FFFF)) +#define RGX_CR_SLC_STATUS1_READS1_EXT_SHIFT (8U) +#define RGX_CR_SLC_STATUS1_READS1_EXT_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFF00FF)) +#define RGX_CR_SLC_STATUS1_READS0_EXT_SHIFT (0U) +#define RGX_CR_SLC_STATUS1_READS0_EXT_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFF00)) + + +/* + Register RGX_CR_SLC_IDLE +*/ +#define RGX_CR_SLC_IDLE (0x3898U) +#define RGX_CR_SLC_IDLE_MASKFULL (IMG_UINT64_C(0x00000000000000FF)) +#define RGX_CR_SLC_IDLE_IMGBV4_SHIFT (7U) +#define RGX_CR_SLC_IDLE_IMGBV4_CLRMSK (0XFFFFFF7FU) +#define RGX_CR_SLC_IDLE_IMGBV4_EN (0X00000080U) +#define RGX_CR_SLC_IDLE_CACHE_BANKS_SHIFT (6U) +#define RGX_CR_SLC_IDLE_CACHE_BANKS_CLRMSK (0XFFFFFFBFU) +#define RGX_CR_SLC_IDLE_CACHE_BANKS_EN (0X00000040U) +#define RGX_CR_SLC_IDLE_RBOFIFO_SHIFT (5U) +#define RGX_CR_SLC_IDLE_RBOFIFO_CLRMSK (0XFFFFFFDFU) +#define RGX_CR_SLC_IDLE_RBOFIFO_EN (0X00000020U) +#define RGX_CR_SLC_IDLE_FRC_CONV_SHIFT (4U) +#define RGX_CR_SLC_IDLE_FRC_CONV_CLRMSK (0XFFFFFFEFU) +#define RGX_CR_SLC_IDLE_FRC_CONV_EN (0X00000010U) +#define RGX_CR_SLC_IDLE_VXE_CONV_SHIFT (3U) +#define RGX_CR_SLC_IDLE_VXE_CONV_CLRMSK (0XFFFFFFF7U) +#define RGX_CR_SLC_IDLE_VXE_CONV_EN (0X00000008U) +#define RGX_CR_SLC_IDLE_VXD_CONV_SHIFT (2U) +#define RGX_CR_SLC_IDLE_VXD_CONV_CLRMSK (0XFFFFFFFBU) +#define RGX_CR_SLC_IDLE_VXD_CONV_EN (0X00000004U) +#define RGX_CR_SLC_IDLE_BIF1_CONV_SHIFT (1U) +#define RGX_CR_SLC_IDLE_BIF1_CONV_CLRMSK (0XFFFFFFFDU) +#define RGX_CR_SLC_IDLE_BIF1_CONV_EN (0X00000002U) +#define RGX_CR_SLC_IDLE_CBAR_SHIFT (0U) +#define RGX_CR_SLC_IDLE_CBAR_CLRMSK (0XFFFFFFFEU) +#define RGX_CR_SLC_IDLE_CBAR_EN (0X00000001U) + + +/* + Register RGX_CR_SLC_STATUS2 +*/ +#define RGX_CR_SLC_STATUS2 (0x3908U) +#define RGX_CR_SLC_STATUS2_MASKFULL (IMG_UINT64_C(0x000003FF03FFFFFF)) +#define RGX_CR_SLC_STATUS2_READS3_SHIFT (32U) +#define RGX_CR_SLC_STATUS2_READS3_CLRMSK (IMG_UINT64_C(0XFFFFFC00FFFFFFFF)) +#define RGX_CR_SLC_STATUS2_READS2_SHIFT (16U) +#define RGX_CR_SLC_STATUS2_READS2_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFC00FFFF)) +#define RGX_CR_SLC_STATUS2_READS3_EXT_SHIFT (8U) +#define RGX_CR_SLC_STATUS2_READS3_EXT_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFF00FF)) +#define RGX_CR_SLC_STATUS2_READS2_EXT_SHIFT (0U) +#define RGX_CR_SLC_STATUS2_READS2_EXT_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFF00)) + + +/* + Register RGX_CR_SLC_CTRL_MISC2 +*/ +#define RGX_CR_SLC_CTRL_MISC2 (0x3930U) +#define RGX_CR_SLC_CTRL_MISC2_MASKFULL (IMG_UINT64_C(0x00000000FFFFFFFF)) +#define RGX_CR_SLC_CTRL_MISC2_SCRAMBLE_BITS_SHIFT (0U) +#define RGX_CR_SLC_CTRL_MISC2_SCRAMBLE_BITS_CLRMSK (00000000U) + + +/* + Register RGX_CR_SLC_CROSSBAR_LOAD_BALANCE +*/ +#define RGX_CR_SLC_CROSSBAR_LOAD_BALANCE (0x3938U) +#define RGX_CR_SLC_CROSSBAR_LOAD_BALANCE_MASKFULL (IMG_UINT64_C(0x0000000000000001)) +#define RGX_CR_SLC_CROSSBAR_LOAD_BALANCE_BYPASS_SHIFT (0U) +#define RGX_CR_SLC_CROSSBAR_LOAD_BALANCE_BYPASS_CLRMSK (0XFFFFFFFEU) +#define RGX_CR_SLC_CROSSBAR_LOAD_BALANCE_BYPASS_EN (0X00000001U) + + +/* + Register RGX_CR_PERF_TA_PHASE +*/ +#define RGX_CR_PERF_TA_PHASE (0x6008U) +#define RGX_CR_PERF_TA_PHASE_MASKFULL (IMG_UINT64_C(0x00000000FFFFFFFF)) +#define RGX_CR_PERF_TA_PHASE_COUNT_SHIFT (0U) +#define RGX_CR_PERF_TA_PHASE_COUNT_CLRMSK (00000000U) + + +/* + Register RGX_CR_PERF_3D_PHASE +*/ +#define RGX_CR_PERF_3D_PHASE (0x6010U) +#define RGX_CR_PERF_3D_PHASE_MASKFULL (IMG_UINT64_C(0x00000000FFFFFFFF)) +#define RGX_CR_PERF_3D_PHASE_COUNT_SHIFT (0U) +#define RGX_CR_PERF_3D_PHASE_COUNT_CLRMSK (00000000U) + + +/* + Register RGX_CR_PERF_COMPUTE_PHASE +*/ +#define RGX_CR_PERF_COMPUTE_PHASE (0x6018U) +#define RGX_CR_PERF_COMPUTE_PHASE_MASKFULL (IMG_UINT64_C(0x00000000FFFFFFFF)) +#define RGX_CR_PERF_COMPUTE_PHASE_COUNT_SHIFT (0U) +#define RGX_CR_PERF_COMPUTE_PHASE_COUNT_CLRMSK (00000000U) + + +/* + Register RGX_CR_PERF_TA_CYCLE +*/ +#define RGX_CR_PERF_TA_CYCLE (0x6020U) +#define RGX_CR_PERF_TA_CYCLE_MASKFULL (IMG_UINT64_C(0x00000000FFFFFFFF)) +#define RGX_CR_PERF_TA_CYCLE_COUNT_SHIFT (0U) +#define RGX_CR_PERF_TA_CYCLE_COUNT_CLRMSK (00000000U) + + +/* + Register RGX_CR_PERF_3D_CYCLE +*/ +#define RGX_CR_PERF_3D_CYCLE (0x6028U) +#define RGX_CR_PERF_3D_CYCLE_MASKFULL (IMG_UINT64_C(0x00000000FFFFFFFF)) +#define RGX_CR_PERF_3D_CYCLE_COUNT_SHIFT (0U) +#define RGX_CR_PERF_3D_CYCLE_COUNT_CLRMSK (00000000U) + + +/* + Register RGX_CR_PERF_COMPUTE_CYCLE +*/ +#define RGX_CR_PERF_COMPUTE_CYCLE (0x6030U) +#define RGX_CR_PERF_COMPUTE_CYCLE_MASKFULL (IMG_UINT64_C(0x00000000FFFFFFFF)) +#define RGX_CR_PERF_COMPUTE_CYCLE_COUNT_SHIFT (0U) +#define RGX_CR_PERF_COMPUTE_CYCLE_COUNT_CLRMSK (00000000U) + + +/* + Register RGX_CR_PERF_TA_OR_3D_CYCLE +*/ +#define RGX_CR_PERF_TA_OR_3D_CYCLE (0x6038U) +#define RGX_CR_PERF_TA_OR_3D_CYCLE_MASKFULL (IMG_UINT64_C(0x00000000FFFFFFFF)) +#define RGX_CR_PERF_TA_OR_3D_CYCLE_COUNT_SHIFT (0U) +#define RGX_CR_PERF_TA_OR_3D_CYCLE_COUNT_CLRMSK (00000000U) + + +/* + Register RGX_CR_PERF_INITIAL_TA_CYCLE +*/ +#define RGX_CR_PERF_INITIAL_TA_CYCLE (0x6040U) +#define RGX_CR_PERF_INITIAL_TA_CYCLE_MASKFULL (IMG_UINT64_C(0x00000000FFFFFFFF)) +#define RGX_CR_PERF_INITIAL_TA_CYCLE_COUNT_SHIFT (0U) +#define RGX_CR_PERF_INITIAL_TA_CYCLE_COUNT_CLRMSK (00000000U) + + +/* + Register RGX_CR_PERF_SLC0_READ_STALL +*/ +#define RGX_CR_PERF_SLC0_READ_STALL (0x60B8U) +#define RGX_CR_PERF_SLC0_READ_STALL_MASKFULL (IMG_UINT64_C(0x00000000FFFFFFFF)) +#define RGX_CR_PERF_SLC0_READ_STALL_COUNT_SHIFT (0U) +#define RGX_CR_PERF_SLC0_READ_STALL_COUNT_CLRMSK (00000000U) + + +/* + Register RGX_CR_PERF_SLC0_WRITE_STALL +*/ +#define RGX_CR_PERF_SLC0_WRITE_STALL (0x60C0U) +#define RGX_CR_PERF_SLC0_WRITE_STALL_MASKFULL (IMG_UINT64_C(0x00000000FFFFFFFF)) +#define RGX_CR_PERF_SLC0_WRITE_STALL_COUNT_SHIFT (0U) +#define RGX_CR_PERF_SLC0_WRITE_STALL_COUNT_CLRMSK (00000000U) + + +/* + Register RGX_CR_PERF_SLC1_READ_STALL +*/ +#define RGX_CR_PERF_SLC1_READ_STALL (0x60E0U) +#define RGX_CR_PERF_SLC1_READ_STALL_MASKFULL (IMG_UINT64_C(0x00000000FFFFFFFF)) +#define RGX_CR_PERF_SLC1_READ_STALL_COUNT_SHIFT (0U) +#define RGX_CR_PERF_SLC1_READ_STALL_COUNT_CLRMSK (00000000U) + + +/* + Register RGX_CR_PERF_SLC1_WRITE_STALL +*/ +#define RGX_CR_PERF_SLC1_WRITE_STALL (0x60E8U) +#define RGX_CR_PERF_SLC1_WRITE_STALL_MASKFULL (IMG_UINT64_C(0x00000000FFFFFFFF)) +#define RGX_CR_PERF_SLC1_WRITE_STALL_COUNT_SHIFT (0U) +#define RGX_CR_PERF_SLC1_WRITE_STALL_COUNT_CLRMSK (00000000U) + + +/* + Register RGX_CR_PERF_SLC2_READ_STALL +*/ +#define RGX_CR_PERF_SLC2_READ_STALL (0x6158U) +#define RGX_CR_PERF_SLC2_READ_STALL_MASKFULL (IMG_UINT64_C(0x00000000FFFFFFFF)) +#define RGX_CR_PERF_SLC2_READ_STALL_COUNT_SHIFT (0U) +#define RGX_CR_PERF_SLC2_READ_STALL_COUNT_CLRMSK (00000000U) + + +/* + Register RGX_CR_PERF_SLC2_WRITE_STALL +*/ +#define RGX_CR_PERF_SLC2_WRITE_STALL (0x6160U) +#define RGX_CR_PERF_SLC2_WRITE_STALL_MASKFULL (IMG_UINT64_C(0x00000000FFFFFFFF)) +#define RGX_CR_PERF_SLC2_WRITE_STALL_COUNT_SHIFT (0U) +#define RGX_CR_PERF_SLC2_WRITE_STALL_COUNT_CLRMSK (00000000U) + + +/* + Register RGX_CR_PERF_SLC3_READ_STALL +*/ +#define RGX_CR_PERF_SLC3_READ_STALL (0x6180U) +#define RGX_CR_PERF_SLC3_READ_STALL_MASKFULL (IMG_UINT64_C(0x00000000FFFFFFFF)) +#define RGX_CR_PERF_SLC3_READ_STALL_COUNT_SHIFT (0U) +#define RGX_CR_PERF_SLC3_READ_STALL_COUNT_CLRMSK (00000000U) + + +/* + Register RGX_CR_PERF_SLC3_WRITE_STALL +*/ +#define RGX_CR_PERF_SLC3_WRITE_STALL (0x6188U) +#define RGX_CR_PERF_SLC3_WRITE_STALL_MASKFULL (IMG_UINT64_C(0x00000000FFFFFFFF)) +#define RGX_CR_PERF_SLC3_WRITE_STALL_COUNT_SHIFT (0U) +#define RGX_CR_PERF_SLC3_WRITE_STALL_COUNT_CLRMSK (00000000U) + + +/* + Register RGX_CR_PERF_3D_SPINUP +*/ +#define RGX_CR_PERF_3D_SPINUP (0x6220U) +#define RGX_CR_PERF_3D_SPINUP_MASKFULL (IMG_UINT64_C(0x00000000FFFFFFFF)) +#define RGX_CR_PERF_3D_SPINUP_CYCLES_SHIFT (0U) +#define RGX_CR_PERF_3D_SPINUP_CYCLES_CLRMSK (00000000U) + + +/* + Register RGX_CR_AXI_ACE_LITE_CONFIGURATION +*/ +#define RGX_CR_AXI_ACE_LITE_CONFIGURATION (0x38C0U) +#define RGX_CR_AXI_ACE_LITE_CONFIGURATION_MASKFULL (IMG_UINT64_C(0x0000001FFFFFFFFF)) +#define RGX_CR_AXI_ACE_LITE_CONFIGURATION_DISABLE_COHERENT_WRITELINEUNIQUE_SHIFT (36U) +#define RGX_CR_AXI_ACE_LITE_CONFIGURATION_DISABLE_COHERENT_WRITELINEUNIQUE_CLRMSK (IMG_UINT64_C(0XFFFFFFEFFFFFFFFF)) +#define RGX_CR_AXI_ACE_LITE_CONFIGURATION_DISABLE_COHERENT_WRITELINEUNIQUE_EN (IMG_UINT64_C(0X0000001000000000)) +#define RGX_CR_AXI_ACE_LITE_CONFIGURATION_DISABLE_COHERENT_WRITE_SHIFT (35U) +#define RGX_CR_AXI_ACE_LITE_CONFIGURATION_DISABLE_COHERENT_WRITE_CLRMSK (IMG_UINT64_C(0XFFFFFFF7FFFFFFFF)) +#define RGX_CR_AXI_ACE_LITE_CONFIGURATION_DISABLE_COHERENT_WRITE_EN (IMG_UINT64_C(0X0000000800000000)) +#define RGX_CR_AXI_ACE_LITE_CONFIGURATION_DISABLE_COHERENT_READ_SHIFT (34U) +#define RGX_CR_AXI_ACE_LITE_CONFIGURATION_DISABLE_COHERENT_READ_CLRMSK (IMG_UINT64_C(0XFFFFFFFBFFFFFFFF)) +#define RGX_CR_AXI_ACE_LITE_CONFIGURATION_DISABLE_COHERENT_READ_EN (IMG_UINT64_C(0X0000000400000000)) +#define RGX_CR_AXI_ACE_LITE_CONFIGURATION_ARCACHE_CACHE_MAINTENANCE_SHIFT (30U) +#define RGX_CR_AXI_ACE_LITE_CONFIGURATION_ARCACHE_CACHE_MAINTENANCE_CLRMSK (IMG_UINT64_C(0XFFFFFFFC3FFFFFFF)) +#define RGX_CR_AXI_ACE_LITE_CONFIGURATION_ARCACHE_COHERENT_SHIFT (26U) +#define RGX_CR_AXI_ACE_LITE_CONFIGURATION_ARCACHE_COHERENT_CLRMSK (IMG_UINT64_C(0XFFFFFFFFC3FFFFFF)) +#define RGX_CR_AXI_ACE_LITE_CONFIGURATION_AWCACHE_COHERENT_SHIFT (22U) +#define RGX_CR_AXI_ACE_LITE_CONFIGURATION_AWCACHE_COHERENT_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFC3FFFFF)) +#define RGX_CR_AXI_ACE_LITE_CONFIGURATION_ARDOMAIN_BARRIER_SHIFT (20U) +#define RGX_CR_AXI_ACE_LITE_CONFIGURATION_ARDOMAIN_BARRIER_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFCFFFFF)) +#define RGX_CR_AXI_ACE_LITE_CONFIGURATION_AWDOMAIN_BARRIER_SHIFT (18U) +#define RGX_CR_AXI_ACE_LITE_CONFIGURATION_AWDOMAIN_BARRIER_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFF3FFFF)) +#define RGX_CR_AXI_ACE_LITE_CONFIGURATION_ARDOMAIN_CACHE_MAINTENANCE_SHIFT (16U) +#define RGX_CR_AXI_ACE_LITE_CONFIGURATION_ARDOMAIN_CACHE_MAINTENANCE_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFCFFFF)) +#define RGX_CR_AXI_ACE_LITE_CONFIGURATION_AWDOMAIN_COHERENT_SHIFT (14U) +#define RGX_CR_AXI_ACE_LITE_CONFIGURATION_AWDOMAIN_COHERENT_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFF3FFF)) +#define RGX_CR_AXI_ACE_LITE_CONFIGURATION_ARDOMAIN_COHERENT_SHIFT (12U) +#define RGX_CR_AXI_ACE_LITE_CONFIGURATION_ARDOMAIN_COHERENT_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFCFFF)) +#define RGX_CR_AXI_ACE_LITE_CONFIGURATION_ARDOMAIN_NON_SNOOPING_SHIFT (10U) +#define RGX_CR_AXI_ACE_LITE_CONFIGURATION_ARDOMAIN_NON_SNOOPING_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFF3FF)) +#define RGX_CR_AXI_ACE_LITE_CONFIGURATION_AWDOMAIN_NON_SNOOPING_SHIFT (8U) +#define RGX_CR_AXI_ACE_LITE_CONFIGURATION_AWDOMAIN_NON_SNOOPING_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFCFF)) +#define RGX_CR_AXI_ACE_LITE_CONFIGURATION_ARCACHE_NON_SNOOPING_SHIFT (4U) +#define RGX_CR_AXI_ACE_LITE_CONFIGURATION_ARCACHE_NON_SNOOPING_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFF0F)) +#define RGX_CR_AXI_ACE_LITE_CONFIGURATION_AWCACHE_NON_SNOOPING_SHIFT (0U) +#define RGX_CR_AXI_ACE_LITE_CONFIGURATION_AWCACHE_NON_SNOOPING_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFF0)) + + +/* + Register RGX_CR_POWER_ESTIMATE_RESULT +*/ +#define RGX_CR_POWER_ESTIMATE_RESULT (0x6328U) +#define RGX_CR_POWER_ESTIMATE_RESULT_MASKFULL (IMG_UINT64_C(0x00000000FFFFFFFF)) +#define RGX_CR_POWER_ESTIMATE_RESULT_VALUE_SHIFT (0U) +#define RGX_CR_POWER_ESTIMATE_RESULT_VALUE_CLRMSK (00000000U) + + +/* + Register RGX_CR_OCP_REVINFO +*/ +#define RGX_CR_OCP_REVINFO (0x9000U) +#define RGX_CR_OCP_REVINFO_MASKFULL (IMG_UINT64_C(0x00000007FFFFFFFF)) +#define RGX_CR_OCP_REVINFO_HWINFO_SYSBUS_SHIFT (33U) +#define RGX_CR_OCP_REVINFO_HWINFO_SYSBUS_CLRMSK (IMG_UINT64_C(0XFFFFFFF9FFFFFFFF)) +#define RGX_CR_OCP_REVINFO_HWINFO_MEMBUS_SHIFT (32U) +#define RGX_CR_OCP_REVINFO_HWINFO_MEMBUS_CLRMSK (IMG_UINT64_C(0XFFFFFFFEFFFFFFFF)) +#define RGX_CR_OCP_REVINFO_HWINFO_MEMBUS_EN (IMG_UINT64_C(0X0000000100000000)) +#define RGX_CR_OCP_REVINFO_REVISION_SHIFT (0U) +#define RGX_CR_OCP_REVINFO_REVISION_CLRMSK (IMG_UINT64_C(0XFFFFFFFF00000000)) + + +/* + Register RGX_CR_OCP_SYSCONFIG +*/ +#define RGX_CR_OCP_SYSCONFIG (0x9010U) +#define RGX_CR_OCP_SYSCONFIG_MASKFULL (IMG_UINT64_C(0x0000000000000FFF)) +#define RGX_CR_OCP_SYSCONFIG_DUST2_STANDBY_MODE_SHIFT (10U) +#define RGX_CR_OCP_SYSCONFIG_DUST2_STANDBY_MODE_CLRMSK (0XFFFFF3FFU) +#define RGX_CR_OCP_SYSCONFIG_DUST1_STANDBY_MODE_SHIFT (8U) +#define RGX_CR_OCP_SYSCONFIG_DUST1_STANDBY_MODE_CLRMSK (0XFFFFFCFFU) +#define RGX_CR_OCP_SYSCONFIG_DUST0_STANDBY_MODE_SHIFT (6U) +#define RGX_CR_OCP_SYSCONFIG_DUST0_STANDBY_MODE_CLRMSK (0XFFFFFF3FU) +#define RGX_CR_OCP_SYSCONFIG_RASCAL_STANDBYMODE_SHIFT (4U) +#define RGX_CR_OCP_SYSCONFIG_RASCAL_STANDBYMODE_CLRMSK (0XFFFFFFCFU) +#define RGX_CR_OCP_SYSCONFIG_STANDBY_MODE_SHIFT (2U) +#define RGX_CR_OCP_SYSCONFIG_STANDBY_MODE_CLRMSK (0XFFFFFFF3U) +#define RGX_CR_OCP_SYSCONFIG_IDLE_MODE_SHIFT (0U) +#define RGX_CR_OCP_SYSCONFIG_IDLE_MODE_CLRMSK (0XFFFFFFFCU) + + +/* + Register RGX_CR_OCP_IRQSTATUS_RAW_0 +*/ +#define RGX_CR_OCP_IRQSTATUS_RAW_0 (0x9020U) +#define RGX_CR_OCP_IRQSTATUS_RAW_0_MASKFULL (IMG_UINT64_C(0x0000000000000001)) +#define RGX_CR_OCP_IRQSTATUS_RAW_0_INIT_MINTERRUPT_RAW_SHIFT (0U) +#define RGX_CR_OCP_IRQSTATUS_RAW_0_INIT_MINTERRUPT_RAW_CLRMSK (0XFFFFFFFEU) +#define RGX_CR_OCP_IRQSTATUS_RAW_0_INIT_MINTERRUPT_RAW_EN (0X00000001U) + + +/* + Register RGX_CR_OCP_IRQSTATUS_RAW_1 +*/ +#define RGX_CR_OCP_IRQSTATUS_RAW_1 (0x9028U) +#define RGX_CR_OCP_IRQSTATUS_RAW_1_MASKFULL (IMG_UINT64_C(0x0000000000000001)) +#define RGX_CR_OCP_IRQSTATUS_RAW_1_TARGET_SINTERRUPT_RAW_SHIFT (0U) +#define RGX_CR_OCP_IRQSTATUS_RAW_1_TARGET_SINTERRUPT_RAW_CLRMSK (0XFFFFFFFEU) +#define RGX_CR_OCP_IRQSTATUS_RAW_1_TARGET_SINTERRUPT_RAW_EN (0X00000001U) + + +/* + Register RGX_CR_OCP_IRQSTATUS_RAW_2 +*/ +#define RGX_CR_OCP_IRQSTATUS_RAW_2 (0x9030U) +#define RGX_CR_OCP_IRQSTATUS_RAW_2_MASKFULL (IMG_UINT64_C(0x0000000000000001)) +#define RGX_CR_OCP_IRQSTATUS_RAW_2_RGX_IRQ_RAW_SHIFT (0U) +#define RGX_CR_OCP_IRQSTATUS_RAW_2_RGX_IRQ_RAW_CLRMSK (0XFFFFFFFEU) +#define RGX_CR_OCP_IRQSTATUS_RAW_2_RGX_IRQ_RAW_EN (0X00000001U) + + +/* + Register RGX_CR_OCP_IRQSTATUS_0 +*/ +#define RGX_CR_OCP_IRQSTATUS_0 (0x9038U) +#define RGX_CR_OCP_IRQSTATUS_0_MASKFULL (IMG_UINT64_C(0x0000000000000001)) +#define RGX_CR_OCP_IRQSTATUS_0_INIT_MINTERRUPT_STATUS_SHIFT (0U) +#define RGX_CR_OCP_IRQSTATUS_0_INIT_MINTERRUPT_STATUS_CLRMSK (0XFFFFFFFEU) +#define RGX_CR_OCP_IRQSTATUS_0_INIT_MINTERRUPT_STATUS_EN (0X00000001U) + + +/* + Register RGX_CR_OCP_IRQSTATUS_1 +*/ +#define RGX_CR_OCP_IRQSTATUS_1 (0x9040U) +#define RGX_CR_OCP_IRQSTATUS_1_MASKFULL (IMG_UINT64_C(0x0000000000000001)) +#define RGX_CR_OCP_IRQSTATUS_1_TARGET_SINTERRUPT_STATUS_SHIFT (0U) +#define RGX_CR_OCP_IRQSTATUS_1_TARGET_SINTERRUPT_STATUS_CLRMSK (0XFFFFFFFEU) +#define RGX_CR_OCP_IRQSTATUS_1_TARGET_SINTERRUPT_STATUS_EN (0X00000001U) + + +/* + Register RGX_CR_OCP_IRQSTATUS_2 +*/ +#define RGX_CR_OCP_IRQSTATUS_2 (0x9048U) +#define RGX_CR_OCP_IRQSTATUS_2_MASKFULL (IMG_UINT64_C(0x0000000000000001)) +#define RGX_CR_OCP_IRQSTATUS_2_RGX_IRQ_STATUS_SHIFT (0U) +#define RGX_CR_OCP_IRQSTATUS_2_RGX_IRQ_STATUS_CLRMSK (0XFFFFFFFEU) +#define RGX_CR_OCP_IRQSTATUS_2_RGX_IRQ_STATUS_EN (0X00000001U) + + +/* + Register RGX_CR_OCP_IRQENABLE_SET_0 +*/ +#define RGX_CR_OCP_IRQENABLE_SET_0 (0x9050U) +#define RGX_CR_OCP_IRQENABLE_SET_0_MASKFULL (IMG_UINT64_C(0x0000000000000001)) +#define RGX_CR_OCP_IRQENABLE_SET_0_INIT_MINTERRUPT_ENABLE_SHIFT (0U) +#define RGX_CR_OCP_IRQENABLE_SET_0_INIT_MINTERRUPT_ENABLE_CLRMSK (0XFFFFFFFEU) +#define RGX_CR_OCP_IRQENABLE_SET_0_INIT_MINTERRUPT_ENABLE_EN (0X00000001U) + + +/* + Register RGX_CR_OCP_IRQENABLE_SET_1 +*/ +#define RGX_CR_OCP_IRQENABLE_SET_1 (0x9058U) +#define RGX_CR_OCP_IRQENABLE_SET_1_MASKFULL (IMG_UINT64_C(0x0000000000000001)) +#define RGX_CR_OCP_IRQENABLE_SET_1_TARGET_SINTERRUPT_ENABLE_SHIFT (0U) +#define RGX_CR_OCP_IRQENABLE_SET_1_TARGET_SINTERRUPT_ENABLE_CLRMSK (0XFFFFFFFEU) +#define RGX_CR_OCP_IRQENABLE_SET_1_TARGET_SINTERRUPT_ENABLE_EN (0X00000001U) + + +/* + Register RGX_CR_OCP_IRQENABLE_SET_2 +*/ +#define RGX_CR_OCP_IRQENABLE_SET_2 (0x9060U) +#define RGX_CR_OCP_IRQENABLE_SET_2_MASKFULL (IMG_UINT64_C(0x0000000000000001)) +#define RGX_CR_OCP_IRQENABLE_SET_2_RGX_IRQ_ENABLE_SHIFT (0U) +#define RGX_CR_OCP_IRQENABLE_SET_2_RGX_IRQ_ENABLE_CLRMSK (0XFFFFFFFEU) +#define RGX_CR_OCP_IRQENABLE_SET_2_RGX_IRQ_ENABLE_EN (0X00000001U) + + +/* + Register RGX_CR_OCP_IRQENABLE_CLR_0 +*/ +#define RGX_CR_OCP_IRQENABLE_CLR_0 (0x9068U) +#define RGX_CR_OCP_IRQENABLE_CLR_0_MASKFULL (IMG_UINT64_C(0x0000000000000001)) +#define RGX_CR_OCP_IRQENABLE_CLR_0_INIT_MINTERRUPT_DISABLE_SHIFT (0U) +#define RGX_CR_OCP_IRQENABLE_CLR_0_INIT_MINTERRUPT_DISABLE_CLRMSK (0XFFFFFFFEU) +#define RGX_CR_OCP_IRQENABLE_CLR_0_INIT_MINTERRUPT_DISABLE_EN (0X00000001U) + + +/* + Register RGX_CR_OCP_IRQENABLE_CLR_1 +*/ +#define RGX_CR_OCP_IRQENABLE_CLR_1 (0x9070U) +#define RGX_CR_OCP_IRQENABLE_CLR_1_MASKFULL (IMG_UINT64_C(0x0000000000000001)) +#define RGX_CR_OCP_IRQENABLE_CLR_1_TARGET_SINTERRUPT_DISABLE_SHIFT (0U) +#define RGX_CR_OCP_IRQENABLE_CLR_1_TARGET_SINTERRUPT_DISABLE_CLRMSK (0XFFFFFFFEU) +#define RGX_CR_OCP_IRQENABLE_CLR_1_TARGET_SINTERRUPT_DISABLE_EN (0X00000001U) + + +/* + Register RGX_CR_OCP_IRQENABLE_CLR_2 +*/ +#define RGX_CR_OCP_IRQENABLE_CLR_2 (0x9078U) +#define RGX_CR_OCP_IRQENABLE_CLR_2_MASKFULL (IMG_UINT64_C(0x0000000000000001)) +#define RGX_CR_OCP_IRQENABLE_CLR_2_RGX_IRQ_DISABLE_SHIFT (0U) +#define RGX_CR_OCP_IRQENABLE_CLR_2_RGX_IRQ_DISABLE_CLRMSK (0XFFFFFFFEU) +#define RGX_CR_OCP_IRQENABLE_CLR_2_RGX_IRQ_DISABLE_EN (0X00000001U) + + +/* + Register RGX_CR_OCP_IRQ_EVENT +*/ +#define RGX_CR_OCP_IRQ_EVENT (0x9080U) +#define RGX_CR_OCP_IRQ_EVENT_MASKFULL (IMG_UINT64_C(0x00000000000FFFFF)) +#define RGX_CR_OCP_IRQ_EVENT_TARGETH_RCVD_UNEXPECTED_RDATA_SHIFT (19U) +#define RGX_CR_OCP_IRQ_EVENT_TARGETH_RCVD_UNEXPECTED_RDATA_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFF7FFFF)) +#define RGX_CR_OCP_IRQ_EVENT_TARGETH_RCVD_UNEXPECTED_RDATA_EN (IMG_UINT64_C(0X0000000000080000)) +#define RGX_CR_OCP_IRQ_EVENT_TARGETH_RCVD_UNSUPPORTED_MCMD_SHIFT (18U) +#define RGX_CR_OCP_IRQ_EVENT_TARGETH_RCVD_UNSUPPORTED_MCMD_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFBFFFF)) +#define RGX_CR_OCP_IRQ_EVENT_TARGETH_RCVD_UNSUPPORTED_MCMD_EN (IMG_UINT64_C(0X0000000000040000)) +#define RGX_CR_OCP_IRQ_EVENT_TARGETS_RCVD_UNEXPECTED_RDATA_SHIFT (17U) +#define RGX_CR_OCP_IRQ_EVENT_TARGETS_RCVD_UNEXPECTED_RDATA_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFDFFFF)) +#define RGX_CR_OCP_IRQ_EVENT_TARGETS_RCVD_UNEXPECTED_RDATA_EN (IMG_UINT64_C(0X0000000000020000)) +#define RGX_CR_OCP_IRQ_EVENT_TARGETS_RCVD_UNSUPPORTED_MCMD_SHIFT (16U) +#define RGX_CR_OCP_IRQ_EVENT_TARGETS_RCVD_UNSUPPORTED_MCMD_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFEFFFF)) +#define RGX_CR_OCP_IRQ_EVENT_TARGETS_RCVD_UNSUPPORTED_MCMD_EN (IMG_UINT64_C(0X0000000000010000)) +#define RGX_CR_OCP_IRQ_EVENT_INIT3_IMG_PAGE_BOUNDARY_CROSS_SHIFT (15U) +#define RGX_CR_OCP_IRQ_EVENT_INIT3_IMG_PAGE_BOUNDARY_CROSS_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFF7FFF)) +#define RGX_CR_OCP_IRQ_EVENT_INIT3_IMG_PAGE_BOUNDARY_CROSS_EN (IMG_UINT64_C(0X0000000000008000)) +#define RGX_CR_OCP_IRQ_EVENT_INIT3_RCVD_RESP_ERR_FAIL_SHIFT (14U) +#define RGX_CR_OCP_IRQ_EVENT_INIT3_RCVD_RESP_ERR_FAIL_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFBFFF)) +#define RGX_CR_OCP_IRQ_EVENT_INIT3_RCVD_RESP_ERR_FAIL_EN (IMG_UINT64_C(0X0000000000004000)) +#define RGX_CR_OCP_IRQ_EVENT_INIT3_RCVD_UNUSED_TAGID_SHIFT (13U) +#define RGX_CR_OCP_IRQ_EVENT_INIT3_RCVD_UNUSED_TAGID_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFDFFF)) +#define RGX_CR_OCP_IRQ_EVENT_INIT3_RCVD_UNUSED_TAGID_EN (IMG_UINT64_C(0X0000000000002000)) +#define RGX_CR_OCP_IRQ_EVENT_INIT3_RDATA_FIFO_OVERFILL_SHIFT (12U) +#define RGX_CR_OCP_IRQ_EVENT_INIT3_RDATA_FIFO_OVERFILL_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFEFFF)) +#define RGX_CR_OCP_IRQ_EVENT_INIT3_RDATA_FIFO_OVERFILL_EN (IMG_UINT64_C(0X0000000000001000)) +#define RGX_CR_OCP_IRQ_EVENT_INIT2_IMG_PAGE_BOUNDARY_CROSS_SHIFT (11U) +#define RGX_CR_OCP_IRQ_EVENT_INIT2_IMG_PAGE_BOUNDARY_CROSS_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFF7FF)) +#define RGX_CR_OCP_IRQ_EVENT_INIT2_IMG_PAGE_BOUNDARY_CROSS_EN (IMG_UINT64_C(0X0000000000000800)) +#define RGX_CR_OCP_IRQ_EVENT_INIT2_RCVD_RESP_ERR_FAIL_SHIFT (10U) +#define RGX_CR_OCP_IRQ_EVENT_INIT2_RCVD_RESP_ERR_FAIL_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFBFF)) +#define RGX_CR_OCP_IRQ_EVENT_INIT2_RCVD_RESP_ERR_FAIL_EN (IMG_UINT64_C(0X0000000000000400)) +#define RGX_CR_OCP_IRQ_EVENT_INIT2_RCVD_UNUSED_TAGID_SHIFT (9U) +#define RGX_CR_OCP_IRQ_EVENT_INIT2_RCVD_UNUSED_TAGID_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFDFF)) +#define RGX_CR_OCP_IRQ_EVENT_INIT2_RCVD_UNUSED_TAGID_EN (IMG_UINT64_C(0X0000000000000200)) +#define RGX_CR_OCP_IRQ_EVENT_INIT2_RDATA_FIFO_OVERFILL_SHIFT (8U) +#define RGX_CR_OCP_IRQ_EVENT_INIT2_RDATA_FIFO_OVERFILL_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFEFF)) +#define RGX_CR_OCP_IRQ_EVENT_INIT2_RDATA_FIFO_OVERFILL_EN (IMG_UINT64_C(0X0000000000000100)) +#define RGX_CR_OCP_IRQ_EVENT_INIT1_IMG_PAGE_BOUNDARY_CROSS_SHIFT (7U) +#define RGX_CR_OCP_IRQ_EVENT_INIT1_IMG_PAGE_BOUNDARY_CROSS_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFF7F)) +#define RGX_CR_OCP_IRQ_EVENT_INIT1_IMG_PAGE_BOUNDARY_CROSS_EN (IMG_UINT64_C(0X0000000000000080)) +#define RGX_CR_OCP_IRQ_EVENT_INIT1_RCVD_RESP_ERR_FAIL_SHIFT (6U) +#define RGX_CR_OCP_IRQ_EVENT_INIT1_RCVD_RESP_ERR_FAIL_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFBF)) +#define RGX_CR_OCP_IRQ_EVENT_INIT1_RCVD_RESP_ERR_FAIL_EN (IMG_UINT64_C(0X0000000000000040)) +#define RGX_CR_OCP_IRQ_EVENT_INIT1_RCVD_UNUSED_TAGID_SHIFT (5U) +#define RGX_CR_OCP_IRQ_EVENT_INIT1_RCVD_UNUSED_TAGID_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFDF)) +#define RGX_CR_OCP_IRQ_EVENT_INIT1_RCVD_UNUSED_TAGID_EN (IMG_UINT64_C(0X0000000000000020)) +#define RGX_CR_OCP_IRQ_EVENT_INIT1_RDATA_FIFO_OVERFILL_SHIFT (4U) +#define RGX_CR_OCP_IRQ_EVENT_INIT1_RDATA_FIFO_OVERFILL_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFEF)) +#define RGX_CR_OCP_IRQ_EVENT_INIT1_RDATA_FIFO_OVERFILL_EN (IMG_UINT64_C(0X0000000000000010)) +#define RGX_CR_OCP_IRQ_EVENT_INIT0_IMG_PAGE_BOUNDARY_CROSS_SHIFT (3U) +#define RGX_CR_OCP_IRQ_EVENT_INIT0_IMG_PAGE_BOUNDARY_CROSS_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFF7)) +#define RGX_CR_OCP_IRQ_EVENT_INIT0_IMG_PAGE_BOUNDARY_CROSS_EN (IMG_UINT64_C(0X0000000000000008)) +#define RGX_CR_OCP_IRQ_EVENT_INIT0_RCVD_RESP_ERR_FAIL_SHIFT (2U) +#define RGX_CR_OCP_IRQ_EVENT_INIT0_RCVD_RESP_ERR_FAIL_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFFB)) +#define RGX_CR_OCP_IRQ_EVENT_INIT0_RCVD_RESP_ERR_FAIL_EN (IMG_UINT64_C(0X0000000000000004)) +#define RGX_CR_OCP_IRQ_EVENT_INIT0_RCVD_UNUSED_TAGID_SHIFT (1U) +#define RGX_CR_OCP_IRQ_EVENT_INIT0_RCVD_UNUSED_TAGID_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFFD)) +#define RGX_CR_OCP_IRQ_EVENT_INIT0_RCVD_UNUSED_TAGID_EN (IMG_UINT64_C(0X0000000000000002)) +#define RGX_CR_OCP_IRQ_EVENT_INIT0_RDATA_FIFO_OVERFILL_SHIFT (0U) +#define RGX_CR_OCP_IRQ_EVENT_INIT0_RDATA_FIFO_OVERFILL_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFFE)) +#define RGX_CR_OCP_IRQ_EVENT_INIT0_RDATA_FIFO_OVERFILL_EN (IMG_UINT64_C(0X0000000000000001)) + + +/* + Register RGX_CR_OCP_DEBUG_CONFIG +*/ +#define RGX_CR_OCP_DEBUG_CONFIG (0x9088U) +#define RGX_CR_OCP_DEBUG_CONFIG_MASKFULL (IMG_UINT64_C(0x0000000000000001)) +#define RGX_CR_OCP_DEBUG_CONFIG_REG_SHIFT (0U) +#define RGX_CR_OCP_DEBUG_CONFIG_REG_CLRMSK (0XFFFFFFFEU) +#define RGX_CR_OCP_DEBUG_CONFIG_REG_EN (0X00000001U) + + +/* + Register RGX_CR_OCP_DEBUG_STATUS +*/ +#define RGX_CR_OCP_DEBUG_STATUS (0x9090U) +#define RGX_CR_OCP_DEBUG_STATUS_MASKFULL (IMG_UINT64_C(0x001F1F77FFFFFFFF)) +#define RGX_CR_OCP_DEBUG_STATUS_TARGETH_SDISCACK_SHIFT (51U) +#define RGX_CR_OCP_DEBUG_STATUS_TARGETH_SDISCACK_CLRMSK (IMG_UINT64_C(0XFFE7FFFFFFFFFFFF)) +#define RGX_CR_OCP_DEBUG_STATUS_TARGETH_SCONNECT_SHIFT (50U) +#define RGX_CR_OCP_DEBUG_STATUS_TARGETH_SCONNECT_CLRMSK (IMG_UINT64_C(0XFFFBFFFFFFFFFFFF)) +#define RGX_CR_OCP_DEBUG_STATUS_TARGETH_SCONNECT_EN (IMG_UINT64_C(0X0004000000000000)) +#define RGX_CR_OCP_DEBUG_STATUS_TARGETH_MCONNECT_SHIFT (48U) +#define RGX_CR_OCP_DEBUG_STATUS_TARGETH_MCONNECT_CLRMSK (IMG_UINT64_C(0XFFFCFFFFFFFFFFFF)) +#define RGX_CR_OCP_DEBUG_STATUS_TARGETS_SDISCACK_SHIFT (43U) +#define RGX_CR_OCP_DEBUG_STATUS_TARGETS_SDISCACK_CLRMSK (IMG_UINT64_C(0XFFFFE7FFFFFFFFFF)) +#define RGX_CR_OCP_DEBUG_STATUS_TARGETS_SCONNECT_SHIFT (42U) +#define RGX_CR_OCP_DEBUG_STATUS_TARGETS_SCONNECT_CLRMSK (IMG_UINT64_C(0XFFFFFBFFFFFFFFFF)) +#define RGX_CR_OCP_DEBUG_STATUS_TARGETS_SCONNECT_EN (IMG_UINT64_C(0X0000040000000000)) +#define RGX_CR_OCP_DEBUG_STATUS_TARGETS_MCONNECT_SHIFT (40U) +#define RGX_CR_OCP_DEBUG_STATUS_TARGETS_MCONNECT_CLRMSK (IMG_UINT64_C(0XFFFFFCFFFFFFFFFF)) +#define RGX_CR_OCP_DEBUG_STATUS_TARGETH_BUSY_SHIFT (38U) +#define RGX_CR_OCP_DEBUG_STATUS_TARGETH_BUSY_CLRMSK (IMG_UINT64_C(0XFFFFFFBFFFFFFFFF)) +#define RGX_CR_OCP_DEBUG_STATUS_TARGETH_BUSY_EN (IMG_UINT64_C(0X0000004000000000)) +#define RGX_CR_OCP_DEBUG_STATUS_TARGETH_CMD_FIFO_FULL_SHIFT (37U) +#define RGX_CR_OCP_DEBUG_STATUS_TARGETH_CMD_FIFO_FULL_CLRMSK (IMG_UINT64_C(0XFFFFFFDFFFFFFFFF)) +#define RGX_CR_OCP_DEBUG_STATUS_TARGETH_CMD_FIFO_FULL_EN (IMG_UINT64_C(0X0000002000000000)) +#define RGX_CR_OCP_DEBUG_STATUS_TARGETH_SRESP_ERROR_SHIFT (36U) +#define RGX_CR_OCP_DEBUG_STATUS_TARGETH_SRESP_ERROR_CLRMSK (IMG_UINT64_C(0XFFFFFFEFFFFFFFFF)) +#define RGX_CR_OCP_DEBUG_STATUS_TARGETH_SRESP_ERROR_EN (IMG_UINT64_C(0X0000001000000000)) +#define RGX_CR_OCP_DEBUG_STATUS_TARGETS_BUSY_SHIFT (34U) +#define RGX_CR_OCP_DEBUG_STATUS_TARGETS_BUSY_CLRMSK (IMG_UINT64_C(0XFFFFFFFBFFFFFFFF)) +#define RGX_CR_OCP_DEBUG_STATUS_TARGETS_BUSY_EN (IMG_UINT64_C(0X0000000400000000)) +#define RGX_CR_OCP_DEBUG_STATUS_TARGETS_CMD_FIFO_FULL_SHIFT (33U) +#define RGX_CR_OCP_DEBUG_STATUS_TARGETS_CMD_FIFO_FULL_CLRMSK (IMG_UINT64_C(0XFFFFFFFDFFFFFFFF)) +#define RGX_CR_OCP_DEBUG_STATUS_TARGETS_CMD_FIFO_FULL_EN (IMG_UINT64_C(0X0000000200000000)) +#define RGX_CR_OCP_DEBUG_STATUS_TARGETS_SRESP_ERROR_SHIFT (32U) +#define RGX_CR_OCP_DEBUG_STATUS_TARGETS_SRESP_ERROR_CLRMSK (IMG_UINT64_C(0XFFFFFFFEFFFFFFFF)) +#define RGX_CR_OCP_DEBUG_STATUS_TARGETS_SRESP_ERROR_EN (IMG_UINT64_C(0X0000000100000000)) +#define RGX_CR_OCP_DEBUG_STATUS_INIT3_RESERVED_SHIFT (31U) +#define RGX_CR_OCP_DEBUG_STATUS_INIT3_RESERVED_CLRMSK (IMG_UINT64_C(0XFFFFFFFF7FFFFFFF)) +#define RGX_CR_OCP_DEBUG_STATUS_INIT3_RESERVED_EN (IMG_UINT64_C(0X0000000080000000)) +#define RGX_CR_OCP_DEBUG_STATUS_INIT3_SWAIT_SHIFT (30U) +#define RGX_CR_OCP_DEBUG_STATUS_INIT3_SWAIT_CLRMSK (IMG_UINT64_C(0XFFFFFFFFBFFFFFFF)) +#define RGX_CR_OCP_DEBUG_STATUS_INIT3_SWAIT_EN (IMG_UINT64_C(0X0000000040000000)) +#define RGX_CR_OCP_DEBUG_STATUS_INIT3_MDISCREQ_SHIFT (29U) +#define RGX_CR_OCP_DEBUG_STATUS_INIT3_MDISCREQ_CLRMSK (IMG_UINT64_C(0XFFFFFFFFDFFFFFFF)) +#define RGX_CR_OCP_DEBUG_STATUS_INIT3_MDISCREQ_EN (IMG_UINT64_C(0X0000000020000000)) +#define RGX_CR_OCP_DEBUG_STATUS_INIT3_MDISCACK_SHIFT (27U) +#define RGX_CR_OCP_DEBUG_STATUS_INIT3_MDISCACK_CLRMSK (IMG_UINT64_C(0XFFFFFFFFE7FFFFFF)) +#define RGX_CR_OCP_DEBUG_STATUS_INIT3_SCONNECT_SHIFT (26U) +#define RGX_CR_OCP_DEBUG_STATUS_INIT3_SCONNECT_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFBFFFFFF)) +#define RGX_CR_OCP_DEBUG_STATUS_INIT3_SCONNECT_EN (IMG_UINT64_C(0X0000000004000000)) +#define RGX_CR_OCP_DEBUG_STATUS_INIT3_MCONNECT_SHIFT (24U) +#define RGX_CR_OCP_DEBUG_STATUS_INIT3_MCONNECT_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFCFFFFFF)) +#define RGX_CR_OCP_DEBUG_STATUS_INIT2_RESERVED_SHIFT (23U) +#define RGX_CR_OCP_DEBUG_STATUS_INIT2_RESERVED_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFF7FFFFF)) +#define RGX_CR_OCP_DEBUG_STATUS_INIT2_RESERVED_EN (IMG_UINT64_C(0X0000000000800000)) +#define RGX_CR_OCP_DEBUG_STATUS_INIT2_SWAIT_SHIFT (22U) +#define RGX_CR_OCP_DEBUG_STATUS_INIT2_SWAIT_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFBFFFFF)) +#define RGX_CR_OCP_DEBUG_STATUS_INIT2_SWAIT_EN (IMG_UINT64_C(0X0000000000400000)) +#define RGX_CR_OCP_DEBUG_STATUS_INIT2_MDISCREQ_SHIFT (21U) +#define RGX_CR_OCP_DEBUG_STATUS_INIT2_MDISCREQ_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFDFFFFF)) +#define RGX_CR_OCP_DEBUG_STATUS_INIT2_MDISCREQ_EN (IMG_UINT64_C(0X0000000000200000)) +#define RGX_CR_OCP_DEBUG_STATUS_INIT2_MDISCACK_SHIFT (19U) +#define RGX_CR_OCP_DEBUG_STATUS_INIT2_MDISCACK_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFE7FFFF)) +#define RGX_CR_OCP_DEBUG_STATUS_INIT2_SCONNECT_SHIFT (18U) +#define RGX_CR_OCP_DEBUG_STATUS_INIT2_SCONNECT_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFBFFFF)) +#define RGX_CR_OCP_DEBUG_STATUS_INIT2_SCONNECT_EN (IMG_UINT64_C(0X0000000000040000)) +#define RGX_CR_OCP_DEBUG_STATUS_INIT2_MCONNECT_SHIFT (16U) +#define RGX_CR_OCP_DEBUG_STATUS_INIT2_MCONNECT_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFCFFFF)) +#define RGX_CR_OCP_DEBUG_STATUS_INIT1_RESERVED_SHIFT (15U) +#define RGX_CR_OCP_DEBUG_STATUS_INIT1_RESERVED_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFF7FFF)) +#define RGX_CR_OCP_DEBUG_STATUS_INIT1_RESERVED_EN (IMG_UINT64_C(0X0000000000008000)) +#define RGX_CR_OCP_DEBUG_STATUS_INIT1_SWAIT_SHIFT (14U) +#define RGX_CR_OCP_DEBUG_STATUS_INIT1_SWAIT_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFBFFF)) +#define RGX_CR_OCP_DEBUG_STATUS_INIT1_SWAIT_EN (IMG_UINT64_C(0X0000000000004000)) +#define RGX_CR_OCP_DEBUG_STATUS_INIT1_MDISCREQ_SHIFT (13U) +#define RGX_CR_OCP_DEBUG_STATUS_INIT1_MDISCREQ_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFDFFF)) +#define RGX_CR_OCP_DEBUG_STATUS_INIT1_MDISCREQ_EN (IMG_UINT64_C(0X0000000000002000)) +#define RGX_CR_OCP_DEBUG_STATUS_INIT1_MDISCACK_SHIFT (11U) +#define RGX_CR_OCP_DEBUG_STATUS_INIT1_MDISCACK_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFE7FF)) +#define RGX_CR_OCP_DEBUG_STATUS_INIT1_SCONNECT_SHIFT (10U) +#define RGX_CR_OCP_DEBUG_STATUS_INIT1_SCONNECT_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFBFF)) +#define RGX_CR_OCP_DEBUG_STATUS_INIT1_SCONNECT_EN (IMG_UINT64_C(0X0000000000000400)) +#define RGX_CR_OCP_DEBUG_STATUS_INIT1_MCONNECT_SHIFT (8U) +#define RGX_CR_OCP_DEBUG_STATUS_INIT1_MCONNECT_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFCFF)) +#define RGX_CR_OCP_DEBUG_STATUS_INIT0_RESERVED_SHIFT (7U) +#define RGX_CR_OCP_DEBUG_STATUS_INIT0_RESERVED_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFF7F)) +#define RGX_CR_OCP_DEBUG_STATUS_INIT0_RESERVED_EN (IMG_UINT64_C(0X0000000000000080)) +#define RGX_CR_OCP_DEBUG_STATUS_INIT0_SWAIT_SHIFT (6U) +#define RGX_CR_OCP_DEBUG_STATUS_INIT0_SWAIT_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFBF)) +#define RGX_CR_OCP_DEBUG_STATUS_INIT0_SWAIT_EN (IMG_UINT64_C(0X0000000000000040)) +#define RGX_CR_OCP_DEBUG_STATUS_INIT0_MDISCREQ_SHIFT (5U) +#define RGX_CR_OCP_DEBUG_STATUS_INIT0_MDISCREQ_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFDF)) +#define RGX_CR_OCP_DEBUG_STATUS_INIT0_MDISCREQ_EN (IMG_UINT64_C(0X0000000000000020)) +#define RGX_CR_OCP_DEBUG_STATUS_INIT0_MDISCACK_SHIFT (3U) +#define RGX_CR_OCP_DEBUG_STATUS_INIT0_MDISCACK_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFE7)) +#define RGX_CR_OCP_DEBUG_STATUS_INIT0_SCONNECT_SHIFT (2U) +#define RGX_CR_OCP_DEBUG_STATUS_INIT0_SCONNECT_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFFB)) +#define RGX_CR_OCP_DEBUG_STATUS_INIT0_SCONNECT_EN (IMG_UINT64_C(0X0000000000000004)) +#define RGX_CR_OCP_DEBUG_STATUS_INIT0_MCONNECT_SHIFT (0U) +#define RGX_CR_OCP_DEBUG_STATUS_INIT0_MCONNECT_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFFC)) + + +#define RGX_CR_BIF_TRUST_DM_TYPE_PM_ALIST_SHIFT (6U) +#define RGX_CR_BIF_TRUST_DM_TYPE_PM_ALIST_CLRMSK (0XFFFFFFBFU) +#define RGX_CR_BIF_TRUST_DM_TYPE_PM_ALIST_EN (0X00000040U) +#define RGX_CR_BIF_TRUST_DM_TYPE_HOST_SHIFT (5U) +#define RGX_CR_BIF_TRUST_DM_TYPE_HOST_CLRMSK (0XFFFFFFDFU) +#define RGX_CR_BIF_TRUST_DM_TYPE_HOST_EN (0X00000020U) +#define RGX_CR_BIF_TRUST_DM_TYPE_META_SHIFT (4U) +#define RGX_CR_BIF_TRUST_DM_TYPE_META_CLRMSK (0XFFFFFFEFU) +#define RGX_CR_BIF_TRUST_DM_TYPE_META_EN (0X00000010U) +#define RGX_CR_BIF_TRUST_DM_TYPE_PB_ZLS_SHIFT (3U) +#define RGX_CR_BIF_TRUST_DM_TYPE_PB_ZLS_CLRMSK (0XFFFFFFF7U) +#define RGX_CR_BIF_TRUST_DM_TYPE_PB_ZLS_EN (0X00000008U) +#define RGX_CR_BIF_TRUST_DM_TYPE_PB_TE_SHIFT (2U) +#define RGX_CR_BIF_TRUST_DM_TYPE_PB_TE_CLRMSK (0XFFFFFFFBU) +#define RGX_CR_BIF_TRUST_DM_TYPE_PB_TE_EN (0X00000004U) +#define RGX_CR_BIF_TRUST_DM_TYPE_PB_VCE_SHIFT (1U) +#define RGX_CR_BIF_TRUST_DM_TYPE_PB_VCE_CLRMSK (0XFFFFFFFDU) +#define RGX_CR_BIF_TRUST_DM_TYPE_PB_VCE_EN (0X00000002U) +#define RGX_CR_BIF_TRUST_DM_TYPE_TLA_SHIFT (0U) +#define RGX_CR_BIF_TRUST_DM_TYPE_TLA_CLRMSK (0XFFFFFFFEU) +#define RGX_CR_BIF_TRUST_DM_TYPE_TLA_EN (0X00000001U) + + +#define RGX_CR_BIF_TRUST_DM_MASK (0x0000007FU) + + +/* + Register RGX_CR_BIF_TRUST +*/ +#define RGX_CR_BIF_TRUST (0xA000U) +#define RGX_CR_BIF_TRUST_MASKFULL (IMG_UINT64_C(0x00000000001FFFFF)) +#if defined(RGX_FEATURE_RAY_TRACING) +#define RGX_CR_BIF_TRUST_OTHER_RAY_VERTEX_DM_TRUSTED_SHIFT (20U) +#define RGX_CR_BIF_TRUST_OTHER_RAY_VERTEX_DM_TRUSTED_CLRMSK (0XFFEFFFFFU) +#define RGX_CR_BIF_TRUST_OTHER_RAY_VERTEX_DM_TRUSTED_EN (0X00100000U) +#define RGX_CR_BIF_TRUST_MCU_RAY_VERTEX_DM_TRUSTED_SHIFT (19U) +#define RGX_CR_BIF_TRUST_MCU_RAY_VERTEX_DM_TRUSTED_CLRMSK (0XFFF7FFFFU) +#define RGX_CR_BIF_TRUST_MCU_RAY_VERTEX_DM_TRUSTED_EN (0X00080000U) +#define RGX_CR_BIF_TRUST_OTHER_RAY_DM_TRUSTED_SHIFT (18U) +#define RGX_CR_BIF_TRUST_OTHER_RAY_DM_TRUSTED_CLRMSK (0XFFFBFFFFU) +#define RGX_CR_BIF_TRUST_OTHER_RAY_DM_TRUSTED_EN (0X00040000U) +#define RGX_CR_BIF_TRUST_MCU_RAY_DM_TRUSTED_SHIFT (17U) +#define RGX_CR_BIF_TRUST_MCU_RAY_DM_TRUSTED_CLRMSK (0XFFFDFFFFU) +#define RGX_CR_BIF_TRUST_MCU_RAY_DM_TRUSTED_EN (0X00020000U) +#endif /* RGX_FEATURE_RAY_TRACING */ + +#define RGX_CR_BIF_TRUST_ENABLE_SHIFT (16U) +#define RGX_CR_BIF_TRUST_ENABLE_CLRMSK (0XFFFEFFFFU) +#define RGX_CR_BIF_TRUST_ENABLE_EN (0X00010000U) +#define RGX_CR_BIF_TRUST_DM_TRUSTED_SHIFT (9U) +#define RGX_CR_BIF_TRUST_DM_TRUSTED_CLRMSK (0XFFFF01FFU) +#define RGX_CR_BIF_TRUST_OTHER_COMPUTE_DM_TRUSTED_SHIFT (8U) +#define RGX_CR_BIF_TRUST_OTHER_COMPUTE_DM_TRUSTED_CLRMSK (0XFFFFFEFFU) +#define RGX_CR_BIF_TRUST_OTHER_COMPUTE_DM_TRUSTED_EN (0X00000100U) +#define RGX_CR_BIF_TRUST_MCU_COMPUTE_DM_TRUSTED_SHIFT (7U) +#define RGX_CR_BIF_TRUST_MCU_COMPUTE_DM_TRUSTED_CLRMSK (0XFFFFFF7FU) +#define RGX_CR_BIF_TRUST_MCU_COMPUTE_DM_TRUSTED_EN (0X00000080U) +#define RGX_CR_BIF_TRUST_PBE_COMPUTE_DM_TRUSTED_SHIFT (6U) +#define RGX_CR_BIF_TRUST_PBE_COMPUTE_DM_TRUSTED_CLRMSK (0XFFFFFFBFU) +#define RGX_CR_BIF_TRUST_PBE_COMPUTE_DM_TRUSTED_EN (0X00000040U) +#define RGX_CR_BIF_TRUST_OTHER_PIXEL_DM_TRUSTED_SHIFT (5U) +#define RGX_CR_BIF_TRUST_OTHER_PIXEL_DM_TRUSTED_CLRMSK (0XFFFFFFDFU) +#define RGX_CR_BIF_TRUST_OTHER_PIXEL_DM_TRUSTED_EN (0X00000020U) +#define RGX_CR_BIF_TRUST_MCU_PIXEL_DM_TRUSTED_SHIFT (4U) +#define RGX_CR_BIF_TRUST_MCU_PIXEL_DM_TRUSTED_CLRMSK (0XFFFFFFEFU) +#define RGX_CR_BIF_TRUST_MCU_PIXEL_DM_TRUSTED_EN (0X00000010U) +#define RGX_CR_BIF_TRUST_PBE_PIXEL_DM_TRUSTED_SHIFT (3U) +#define RGX_CR_BIF_TRUST_PBE_PIXEL_DM_TRUSTED_CLRMSK (0XFFFFFFF7U) +#define RGX_CR_BIF_TRUST_PBE_PIXEL_DM_TRUSTED_EN (0X00000008U) +#define RGX_CR_BIF_TRUST_OTHER_VERTEX_DM_TRUSTED_SHIFT (2U) +#define RGX_CR_BIF_TRUST_OTHER_VERTEX_DM_TRUSTED_CLRMSK (0XFFFFFFFBU) +#define RGX_CR_BIF_TRUST_OTHER_VERTEX_DM_TRUSTED_EN (0X00000004U) +#define RGX_CR_BIF_TRUST_MCU_VERTEX_DM_TRUSTED_SHIFT (1U) +#define RGX_CR_BIF_TRUST_MCU_VERTEX_DM_TRUSTED_CLRMSK (0XFFFFFFFDU) +#define RGX_CR_BIF_TRUST_MCU_VERTEX_DM_TRUSTED_EN (0X00000002U) +#define RGX_CR_BIF_TRUST_PBE_VERTEX_DM_TRUSTED_SHIFT (0U) +#define RGX_CR_BIF_TRUST_PBE_VERTEX_DM_TRUSTED_CLRMSK (0XFFFFFFFEU) +#define RGX_CR_BIF_TRUST_PBE_VERTEX_DM_TRUSTED_EN (0X00000001U) + + +/* + Register RGX_CR_SYS_BUS_SECURE +*/ +#define RGX_CR_SYS_BUS_SECURE (0xA100U) +#define RGX_CR_SYS_BUS_SECURE_MASKFULL (IMG_UINT64_C(0x0000000000000001)) +#define RGX_CR_SYS_BUS_SECURE_ENABLE_SHIFT (0U) +#define RGX_CR_SYS_BUS_SECURE_ENABLE_CLRMSK (0XFFFFFFFEU) +#define RGX_CR_SYS_BUS_SECURE_ENABLE_EN (0X00000001U) + + +/* + Register RGX_CR_CLK_CTRL2 +*/ +#define RGX_CR_CLK_CTRL2 (0xD200U) +#define RGX_CR_CLK_CTRL2_MASKFULL (IMG_UINT64_C(0x0000000000000F33)) +#define RGX_CR_CLK_CTRL2_MCU_FBTC_SHIFT (10U) +#define RGX_CR_CLK_CTRL2_MCU_FBTC_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFF3FF)) +#define RGX_CR_CLK_CTRL2_MCU_FBTC_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_CTRL2_MCU_FBTC_ON (IMG_UINT64_C(0x0000000000000400)) +#define RGX_CR_CLK_CTRL2_MCU_FBTC_AUTO (IMG_UINT64_C(0x0000000000000800)) +#if defined(RGX_FEATURE_RAY_TRACING) +#define RGX_CR_CLK_CTRL2_VRDM_SHIFT (8U) +#define RGX_CR_CLK_CTRL2_VRDM_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFCFF)) +#define RGX_CR_CLK_CTRL2_VRDM_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_CTRL2_VRDM_ON (IMG_UINT64_C(0x0000000000000100)) +#define RGX_CR_CLK_CTRL2_VRDM_AUTO (IMG_UINT64_C(0x0000000000000200)) +#define RGX_CR_CLK_CTRL2_SH_SHIFT (4U) +#define RGX_CR_CLK_CTRL2_SH_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFCF)) +#define RGX_CR_CLK_CTRL2_SH_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_CTRL2_SH_ON (IMG_UINT64_C(0x0000000000000010)) +#define RGX_CR_CLK_CTRL2_SH_AUTO (IMG_UINT64_C(0x0000000000000020)) +#define RGX_CR_CLK_CTRL2_FBA_SHIFT (0U) +#define RGX_CR_CLK_CTRL2_FBA_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFFC)) +#define RGX_CR_CLK_CTRL2_FBA_OFF (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_CTRL2_FBA_ON (IMG_UINT64_C(0x0000000000000001)) +#define RGX_CR_CLK_CTRL2_FBA_AUTO (IMG_UINT64_C(0x0000000000000002)) + + +#endif /* RGX_FEATURE_RAY_TRACING */ + +/* + Register RGX_CR_CLK_STATUS2 +*/ +#define RGX_CR_CLK_STATUS2 (0xD208U) +#define RGX_CR_CLK_STATUS2_MASKFULL (IMG_UINT64_C(0x0000000000000015)) +#if defined(RGX_FEATURE_RAY_TRACING) +#define RGX_CR_CLK_STATUS2_VRDM_SHIFT (4U) +#define RGX_CR_CLK_STATUS2_VRDM_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFEF)) +#define RGX_CR_CLK_STATUS2_VRDM_GATED (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_STATUS2_VRDM_RUNNING (IMG_UINT64_C(0x0000000000000010)) +#define RGX_CR_CLK_STATUS2_SH_SHIFT (2U) +#define RGX_CR_CLK_STATUS2_SH_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFFB)) +#define RGX_CR_CLK_STATUS2_SH_GATED (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_STATUS2_SH_RUNNING (IMG_UINT64_C(0x0000000000000004)) +#define RGX_CR_CLK_STATUS2_FBA_SHIFT (0U) +#define RGX_CR_CLK_STATUS2_FBA_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFFE)) +#define RGX_CR_CLK_STATUS2_FBA_GATED (IMG_UINT64_C(0000000000000000)) +#define RGX_CR_CLK_STATUS2_FBA_RUNNING (IMG_UINT64_C(0x0000000000000001)) + + +/* + Register DPX_CR_BIF_FAULT_BANK_MMU_STATUS +*/ +#define DPX_CR_BIF_FAULT_BANK_MMU_STATUS (0xC5C8U) +#define DPX_CR_BIF_FAULT_BANK_MMU_STATUS_MASKFULL (IMG_UINT64_C(0x000000000000F775)) +#define DPX_CR_BIF_FAULT_BANK_MMU_STATUS_CAT_BASE_SHIFT (12U) +#define DPX_CR_BIF_FAULT_BANK_MMU_STATUS_CAT_BASE_CLRMSK (0XFFFF0FFFU) +#define DPX_CR_BIF_FAULT_BANK_MMU_STATUS_PAGE_SIZE_SHIFT (8U) +#define DPX_CR_BIF_FAULT_BANK_MMU_STATUS_PAGE_SIZE_CLRMSK (0XFFFFF8FFU) +#define DPX_CR_BIF_FAULT_BANK_MMU_STATUS_DATA_TYPE_SHIFT (5U) +#define DPX_CR_BIF_FAULT_BANK_MMU_STATUS_DATA_TYPE_CLRMSK (0XFFFFFF9FU) +#define DPX_CR_BIF_FAULT_BANK_MMU_STATUS_FAULT_RO_SHIFT (4U) +#define DPX_CR_BIF_FAULT_BANK_MMU_STATUS_FAULT_RO_CLRMSK (0XFFFFFFEFU) +#define DPX_CR_BIF_FAULT_BANK_MMU_STATUS_FAULT_RO_EN (0X00000010U) +#define DPX_CR_BIF_FAULT_BANK_MMU_STATUS_FAULT_PM_META_RO_SHIFT (2U) +#define DPX_CR_BIF_FAULT_BANK_MMU_STATUS_FAULT_PM_META_RO_CLRMSK (0XFFFFFFFBU) +#define DPX_CR_BIF_FAULT_BANK_MMU_STATUS_FAULT_PM_META_RO_EN (0X00000004U) +#define DPX_CR_BIF_FAULT_BANK_MMU_STATUS_FAULT_SHIFT (0U) +#define DPX_CR_BIF_FAULT_BANK_MMU_STATUS_FAULT_CLRMSK (0XFFFFFFFEU) +#define DPX_CR_BIF_FAULT_BANK_MMU_STATUS_FAULT_EN (0X00000001U) + + +/* + Register DPX_CR_BIF_FAULT_BANK_REQ_STATUS +*/ +#define DPX_CR_BIF_FAULT_BANK_REQ_STATUS (0xC5D0U) +#define DPX_CR_BIF_FAULT_BANK_REQ_STATUS_MASKFULL (IMG_UINT64_C(0x03FFFFFFFFFFFFF0)) +#define DPX_CR_BIF_FAULT_BANK_REQ_STATUS_RNW_SHIFT (57U) +#define DPX_CR_BIF_FAULT_BANK_REQ_STATUS_RNW_CLRMSK (IMG_UINT64_C(0XFDFFFFFFFFFFFFFF)) +#define DPX_CR_BIF_FAULT_BANK_REQ_STATUS_RNW_EN (IMG_UINT64_C(0X0200000000000000)) +#define DPX_CR_BIF_FAULT_BANK_REQ_STATUS_TAG_SB_SHIFT (44U) +#define DPX_CR_BIF_FAULT_BANK_REQ_STATUS_TAG_SB_CLRMSK (IMG_UINT64_C(0XFE000FFFFFFFFFFF)) +#define DPX_CR_BIF_FAULT_BANK_REQ_STATUS_TAG_ID_SHIFT (40U) +#define DPX_CR_BIF_FAULT_BANK_REQ_STATUS_TAG_ID_CLRMSK (IMG_UINT64_C(0XFFFFF0FFFFFFFFFF)) +#define DPX_CR_BIF_FAULT_BANK_REQ_STATUS_ADDRESS_SHIFT (4U) +#define DPX_CR_BIF_FAULT_BANK_REQ_STATUS_ADDRESS_CLRMSK (IMG_UINT64_C(0XFFFFFF000000000F)) +#define DPX_CR_BIF_FAULT_BANK_REQ_STATUS_ADDRESS_ALIGNSHIFT (4U) +#define DPX_CR_BIF_FAULT_BANK_REQ_STATUS_ADDRESS_ALIGNSIZE (16U) + + +#endif /* RGX_FEATURE_RAY_TRACING */ + +/* + Register RGX_CR_MMU_FAULT_STATUS +*/ +#define RGX_CR_MMU_FAULT_STATUS (0xE150U) +#define RGX_CR_MMU_FAULT_STATUS_MASKFULL (IMG_UINT64_C(0xFFFFFFFFFFFFFFFF)) +#define RGX_CR_MMU_FAULT_STATUS_ADDRESS_SHIFT (28U) +#define RGX_CR_MMU_FAULT_STATUS_ADDRESS_CLRMSK (IMG_UINT64_C(0X000000000FFFFFFF)) +#define RGX_CR_MMU_FAULT_STATUS_CONTEXT_SHIFT (20U) +#define RGX_CR_MMU_FAULT_STATUS_CONTEXT_CLRMSK (IMG_UINT64_C(0XFFFFFFFFF00FFFFF)) +#define RGX_CR_MMU_FAULT_STATUS_TAG_SB_SHIFT (12U) +#define RGX_CR_MMU_FAULT_STATUS_TAG_SB_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFF00FFF)) +#define RGX_CR_MMU_FAULT_STATUS_REQ_ID_SHIFT (6U) +#define RGX_CR_MMU_FAULT_STATUS_REQ_ID_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFF03F)) +#define RGX_CR_MMU_FAULT_STATUS_LEVEL_SHIFT (4U) +#define RGX_CR_MMU_FAULT_STATUS_LEVEL_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFCF)) +#define RGX_CR_MMU_FAULT_STATUS_RNW_SHIFT (3U) +#define RGX_CR_MMU_FAULT_STATUS_RNW_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFF7)) +#define RGX_CR_MMU_FAULT_STATUS_RNW_EN (IMG_UINT64_C(0X0000000000000008)) +#define RGX_CR_MMU_FAULT_STATUS_TYPE_SHIFT (1U) +#define RGX_CR_MMU_FAULT_STATUS_TYPE_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFF9)) +#define RGX_CR_MMU_FAULT_STATUS_FAULT_SHIFT (0U) +#define RGX_CR_MMU_FAULT_STATUS_FAULT_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFFE)) +#define RGX_CR_MMU_FAULT_STATUS_FAULT_EN (IMG_UINT64_C(0X0000000000000001)) + + +/* + Register RGX_CR_MMU_FAULT_STATUS_META +*/ +#define RGX_CR_MMU_FAULT_STATUS_META (0xE158U) +#define RGX_CR_MMU_FAULT_STATUS_META_MASKFULL (IMG_UINT64_C(0xFFFFFFFFFFFFFFFF)) +#define RGX_CR_MMU_FAULT_STATUS_META_ADDRESS_SHIFT (28U) +#define RGX_CR_MMU_FAULT_STATUS_META_ADDRESS_CLRMSK (IMG_UINT64_C(0X000000000FFFFFFF)) +#define RGX_CR_MMU_FAULT_STATUS_META_CONTEXT_SHIFT (20U) +#define RGX_CR_MMU_FAULT_STATUS_META_CONTEXT_CLRMSK (IMG_UINT64_C(0XFFFFFFFFF00FFFFF)) +#define RGX_CR_MMU_FAULT_STATUS_META_TAG_SB_SHIFT (12U) +#define RGX_CR_MMU_FAULT_STATUS_META_TAG_SB_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFF00FFF)) +#define RGX_CR_MMU_FAULT_STATUS_META_REQ_ID_SHIFT (6U) +#define RGX_CR_MMU_FAULT_STATUS_META_REQ_ID_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFF03F)) +#define RGX_CR_MMU_FAULT_STATUS_META_LEVEL_SHIFT (4U) +#define RGX_CR_MMU_FAULT_STATUS_META_LEVEL_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFCF)) +#define RGX_CR_MMU_FAULT_STATUS_META_RNW_SHIFT (3U) +#define RGX_CR_MMU_FAULT_STATUS_META_RNW_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFF7)) +#define RGX_CR_MMU_FAULT_STATUS_META_RNW_EN (IMG_UINT64_C(0X0000000000000008)) +#define RGX_CR_MMU_FAULT_STATUS_META_TYPE_SHIFT (1U) +#define RGX_CR_MMU_FAULT_STATUS_META_TYPE_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFF9)) +#define RGX_CR_MMU_FAULT_STATUS_META_FAULT_SHIFT (0U) +#define RGX_CR_MMU_FAULT_STATUS_META_FAULT_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFFE)) +#define RGX_CR_MMU_FAULT_STATUS_META_FAULT_EN (IMG_UINT64_C(0X0000000000000001)) + + +/* + Register RGX_CR_SLC3_CTRL_MISC +*/ +#define RGX_CR_SLC3_CTRL_MISC (0xE200U) +#define RGX_CR_SLC3_CTRL_MISC_MASKFULL (IMG_UINT64_C(0x0000000000000007)) +#define RGX_CR_SLC3_CTRL_MISC_ADDR_DECODE_MODE_SHIFT (0U) +#define RGX_CR_SLC3_CTRL_MISC_ADDR_DECODE_MODE_CLRMSK (0XFFFFFFF8U) +#define RGX_CR_SLC3_CTRL_MISC_ADDR_DECODE_MODE_LINEAR (00000000U) +#define RGX_CR_SLC3_CTRL_MISC_ADDR_DECODE_MODE_IN_PAGE_HASH (0X00000001U) +#define RGX_CR_SLC3_CTRL_MISC_ADDR_DECODE_MODE_FIXED_PVR_HASH (0X00000002U) +#define RGX_CR_SLC3_CTRL_MISC_ADDR_DECODE_MODE_SCRAMBLE_PVR_HASH (0X00000003U) +#define RGX_CR_SLC3_CTRL_MISC_ADDR_DECODE_MODE_WEAVED_HASH (0X00000004U) + + +/* + Register RGX_CR_SLC3_SCRAMBLE +*/ +#define RGX_CR_SLC3_SCRAMBLE (0xE208U) +#define RGX_CR_SLC3_SCRAMBLE_MASKFULL (IMG_UINT64_C(0xFFFFFFFFFFFFFFFF)) +#define RGX_CR_SLC3_SCRAMBLE_BITS_SHIFT (0U) +#define RGX_CR_SLC3_SCRAMBLE_BITS_CLRMSK (IMG_UINT64_C(0000000000000000)) + + +/* + Register RGX_CR_SLC3_SCRAMBLE2 +*/ +#define RGX_CR_SLC3_SCRAMBLE2 (0xE210U) +#define RGX_CR_SLC3_SCRAMBLE2_MASKFULL (IMG_UINT64_C(0xFFFFFFFFFFFFFFFF)) +#define RGX_CR_SLC3_SCRAMBLE2_BITS_SHIFT (0U) +#define RGX_CR_SLC3_SCRAMBLE2_BITS_CLRMSK (IMG_UINT64_C(0000000000000000)) + + +/* + Register RGX_CR_SLC3_SCRAMBLE3 +*/ +#define RGX_CR_SLC3_SCRAMBLE3 (0xE218U) +#define RGX_CR_SLC3_SCRAMBLE3_MASKFULL (IMG_UINT64_C(0xFFFFFFFFFFFFFFFF)) +#define RGX_CR_SLC3_SCRAMBLE3_BITS_SHIFT (0U) +#define RGX_CR_SLC3_SCRAMBLE3_BITS_CLRMSK (IMG_UINT64_C(0000000000000000)) + + +/* + Register RGX_CR_SLC3_SCRAMBLE4 +*/ +#define RGX_CR_SLC3_SCRAMBLE4 (0xE260U) +#define RGX_CR_SLC3_SCRAMBLE4_MASKFULL (IMG_UINT64_C(0xFFFFFFFFFFFFFFFF)) +#define RGX_CR_SLC3_SCRAMBLE4_BITS_SHIFT (0U) +#define RGX_CR_SLC3_SCRAMBLE4_BITS_CLRMSK (IMG_UINT64_C(0000000000000000)) + + +#endif /* _RGX_CR_DEFS_KM_H_ */ + +/***************************************************************************** + End of file (rgx_cr_defs_km.h) +*****************************************************************************/ + diff --git a/drivers/gpu/rogue_m/hwdefs/km/rgxdefs_km.h b/drivers/gpu/rogue_m/hwdefs/km/rgxdefs_km.h new file mode 100644 index 000000000000..83151cf6fcca --- /dev/null +++ b/drivers/gpu/rogue_m/hwdefs/km/rgxdefs_km.h @@ -0,0 +1,175 @@ +/*************************************************************************/ /*! +@Title Rogue hw definitions (kernel mode) +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef _RGXDEFS_KM_H_ +#define _RGXDEFS_KM_H_ + +#include RGX_BVNC_CORE_KM_HEADER +#include RGX_BNC_CONFIG_KM_HEADER + +#define __IMG_EXPLICIT_INCLUDE_HWDEFS +#include "rgx_cr_defs_km.h" +#undef __IMG_EXPLICIT_INCLUDE_HWDEFS + +/****************************************************************************** + * Check for valid B.X.N.C + *****************************************************************************/ +#if !defined(RGX_BVNC_KM_B) || !defined(RGX_BVNC_KM_V) || !defined(RGX_BVNC_KM_N) || !defined(RGX_BVNC_KM_C) +#error "Need to specify BVNC (RGX_BVNC_KM_B, RGX_BVNC_KM_V, RGX_BVNC_KM_N and RGX_BVNC_C)" +#endif + +/* Check core/config compatibility */ +#if (RGX_BVNC_KM_B != RGX_BNC_KM_B) || (RGX_BVNC_KM_N != RGX_BNC_KM_N) || (RGX_BVNC_KM_C != RGX_BNC_KM_C) +#error "BVNC headers are mismatching (KM core/config)" +#endif + +/****************************************************************************** + * RGX Version name + *****************************************************************************/ +#define _RGX_BVNC_ST2(S) #S +#define _RGX_BVNC_ST(S) _RGX_BVNC_ST2(S) +#define RGX_BVNC_KM _RGX_BVNC_ST(RGX_BVNC_KM_B) "." _RGX_BVNC_ST(RGX_BVNC_KM_V) "." _RGX_BVNC_ST(RGX_BVNC_KM_N) "." _RGX_BVNC_ST(RGX_BVNC_KM_C) +#define RGX_BVNC_KM_V_ST _RGX_BVNC_ST(RGX_BVNC_KM_V) + +/****************************************************************************** + * RGX Defines + *****************************************************************************/ + +/* META cores (required for the RGX_FEATURE_META) */ +#define MTP218 (1) +#define MTP219 (2) +#define LTP218 (3) +#define LTP217 (4) + +/* META Core memory feature depending on META variants */ +#define RGX_META_COREMEM_32K (32*1024) +#define RGX_META_COREMEM_48K (48*1024) +#define RGX_META_COREMEM_64K (64*1024) + +#define RGX_META_COREMEM_SIZE (RGX_FEATURE_META_COREMEM_SIZE*1024) + +#if (RGX_FEATURE_META_COREMEM_SIZE != 0) +#define RGX_META_COREMEM (1) +#define RGX_META_COREMEM_CODE (1) +#if !defined(FIX_HW_BRN_50767) +#define RGX_META_COREMEM_DATA (1) +#endif +#endif + +/* ISP requires valid state on all three pipes regardless of the number of + * active pipes/tiles in flight. + */ +#define RGX_MAX_NUM_PIPES 3 + +#define ROGUE_CACHE_LINE_SIZE ((RGX_FEATURE_SLC_CACHE_LINE_SIZE_BITS)/8) + +#define MAX_HW_TA3DCONTEXTS 2 + + +/* useful extra defines for clock ctrl*/ +#define RGX_CR_CLK_CTRL_ALL_ON (IMG_UINT64_C(0x5555555555555555)&RGX_CR_CLK_CTRL_MASKFULL) +#define RGX_CR_CLK_CTRL_ALL_AUTO (IMG_UINT64_C(0xaaaaaaaaaaaaaaaa)&RGX_CR_CLK_CTRL_MASKFULL) + +#define RGX_CR_SOFT_RESET_DUST_n_CORE_EN (RGX_CR_SOFT_RESET_DUST_A_CORE_EN | \ + RGX_CR_SOFT_RESET_DUST_B_CORE_EN | \ + RGX_CR_SOFT_RESET_DUST_C_CORE_EN | \ + RGX_CR_SOFT_RESET_DUST_D_CORE_EN | \ + RGX_CR_SOFT_RESET_DUST_E_CORE_EN | \ + RGX_CR_SOFT_RESET_DUST_F_CORE_EN | \ + RGX_CR_SOFT_RESET_DUST_G_CORE_EN | \ + RGX_CR_SOFT_RESET_DUST_H_CORE_EN) + +/* SOFT_RESET Rascal and DUSTs bits */ +#define RGX_CR_SOFT_RESET_RASCALDUSTS_EN (RGX_CR_SOFT_RESET_RASCAL_CORE_EN | \ + RGX_CR_SOFT_RESET_DUST_n_CORE_EN) + + + +#if defined(RGX_FEATURE_S7_TOP_INFRASTRUCTURE) +/* SOFT_RESET steps as defined in the TRM */ +#define RGX_S7_SOFT_RESET_DUSTS (RGX_CR_SOFT_RESET_DUST_n_CORE_EN) + +#define RGX_S7_SOFT_RESET_JONES (RGX_CR_SOFT_RESET_PM_EN | \ + RGX_CR_SOFT_RESET_VDM_EN | \ + RGX_CR_SOFT_RESET_ISP_EN) + +#define RGX_S7_SOFT_RESET_JONES_ALL (RGX_S7_SOFT_RESET_JONES | \ + RGX_CR_SOFT_RESET_BIF_EN | \ + RGX_CR_SOFT_RESET_SLC_EN | \ + RGX_CR_SOFT_RESET_GARTEN_EN) + +#define RGX_S7_SOFT_RESET2 (RGX_CR_SOFT_RESET2_BLACKPEARL_EN | \ + RGX_CR_SOFT_RESET2_PIXEL_EN | \ + RGX_CR_SOFT_RESET2_COMPUTE_EN | \ + RGX_CR_SOFT_RESET2_VERTEX_EN) +#endif + + +#define RGX_BIF_PM_PHYSICAL_PAGE_ALIGNSHIFT (12) +#define RGX_BIF_PM_PHYSICAL_PAGE_SIZE (1 << RGX_BIF_PM_PHYSICAL_PAGE_ALIGNSHIFT) + +#define RGX_BIF_PM_VIRTUAL_PAGE_ALIGNSHIFT (14) +#define RGX_BIF_PM_VIRTUAL_PAGE_SIZE (1 << RGX_BIF_PM_VIRTUAL_PAGE_ALIGNSHIFT) + +/****************************************************************************** + * WA HWBRNs + *****************************************************************************/ +#if defined(FIX_HW_BRN_36492) + +#undef RGX_CR_SOFT_RESET_SLC_EN +#undef RGX_CR_SOFT_RESET_SLC_CLRMSK +#undef RGX_CR_SOFT_RESET_SLC_SHIFT + +/* Remove the SOFT_RESET_SLC_EN bit from SOFT_RESET_MASKFULL */ +#undef RGX_CR_SOFT_RESET_MASKFULL +#define RGX_CR_SOFT_RESET_MASKFULL IMG_UINT64_C(0x000001FFF7FFFC1D) + +#endif /* FIX_HW_BRN_36492 */ + +#define DPX_MAX_RAY_CONTEXTS 4 /* FIXME should this be in dpx file? */ +#define DPX_MAX_FBA_AP 16 +#define DPX_MAX_FBA_FILTER_WIDTH 24 + +#if !defined(RGX_FEATURE_SLC_SIZE_IN_BYTES) +#define RGX_FEATURE_SLC_SIZE_IN_BYTES (RGX_FEATURE_SLC_SIZE_IN_KILOBYTES * 1024) +#endif + +#endif /* _RGXDEFS_KM_H_ */ diff --git a/drivers/gpu/rogue_m/hwdefs/km/rgxmmudefs_km.h b/drivers/gpu/rogue_m/hwdefs/km/rgxmmudefs_km.h new file mode 100644 index 000000000000..7419db508105 --- /dev/null +++ b/drivers/gpu/rogue_m/hwdefs/km/rgxmmudefs_km.h @@ -0,0 +1,395 @@ +/*************************************************************************/ /*! +@Title Hardware definition file rgxmmudefs_km.h +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +/* **** Autogenerated C -- do not edit **** */ + +/* + * Generated by regconv version MAIN@2782796 + * from files: + * rogue_bif.def + * rogue_bif.def + */ + + +#ifndef _RGXMMUDEFS_KM_H_ +#define _RGXMMUDEFS_KM_H_ + +#include "img_types.h" + +/* + + Encoding of DM (note value 0x6 not used) + +*/ +#define RGX_BIF_DM_ENCODING_VERTEX (0x00000000U) +#define RGX_BIF_DM_ENCODING_PIXEL (0x00000001U) +#define RGX_BIF_DM_ENCODING_COMPUTE (0x00000002U) +#define RGX_BIF_DM_ENCODING_TLA (0x00000003U) +#define RGX_BIF_DM_ENCODING_PB_VCE (0x00000004U) +#define RGX_BIF_DM_ENCODING_PB_TE (0x00000005U) +#define RGX_BIF_DM_ENCODING_META (0x00000007U) +#define RGX_BIF_DM_ENCODING_HOST (0x00000008U) +#define RGX_BIF_DM_ENCODING_PM_ALIST (0x00000009U) + + +/* + + Labelling of fields within virtual address + +*/ +/* +Page Catalogue entry # +*/ +#define RGX_MMUCTRL_VADDR_PC_INDEX_SHIFT (30U) +#define RGX_MMUCTRL_VADDR_PC_INDEX_CLRMSK (IMG_UINT64_C(0XFFFFFF003FFFFFFF)) +/* +Page Directory entry # +*/ +#define RGX_MMUCTRL_VADDR_PD_INDEX_SHIFT (21U) +#define RGX_MMUCTRL_VADDR_PD_INDEX_CLRMSK (IMG_UINT64_C(0XFFFFFFFFC01FFFFF)) +/* +Page Table entry # +*/ +#define RGX_MMUCTRL_VADDR_PT_INDEX_SHIFT (12U) +#define RGX_MMUCTRL_VADDR_PT_INDEX_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFE00FFF)) + + +/* + + Number of entries in a PC + +*/ +#define RGX_MMUCTRL_ENTRIES_PC_VALUE (0x00000400U) + + +/* + + Number of entries in a PD + +*/ +#define RGX_MMUCTRL_ENTRIES_PD_VALUE (0x00000200U) + + +/* + + Number of entries in a PT + +*/ +#define RGX_MMUCTRL_ENTRIES_PT_VALUE (0x00000200U) + + +/* + + Size in bits of the PC entries in memory + +*/ +#define RGX_MMUCTRL_ENTRY_SIZE_PC_VALUE (0x00000020U) + + +/* + + Size in bits of the PD entries in memory + +*/ +#define RGX_MMUCTRL_ENTRY_SIZE_PD_VALUE (0x00000040U) + + +/* + + Size in bits of the PT entries in memory + +*/ +#define RGX_MMUCTRL_ENTRY_SIZE_PT_VALUE (0x00000040U) + + +/* + + Encoding of page size field + +*/ +#define RGX_MMUCTRL_PAGE_SIZE_MASK (0x00000007U) +#define RGX_MMUCTRL_PAGE_SIZE_4KB (0x00000000U) +#define RGX_MMUCTRL_PAGE_SIZE_16KB (0x00000001U) +#define RGX_MMUCTRL_PAGE_SIZE_64KB (0x00000002U) +#define RGX_MMUCTRL_PAGE_SIZE_256KB (0x00000003U) +#define RGX_MMUCTRL_PAGE_SIZE_1MB (0x00000004U) +#define RGX_MMUCTRL_PAGE_SIZE_2MB (0x00000005U) + + +/* + + Range of bits used for 4KB Physical Page + +*/ +#define RGX_MMUCTRL_PAGE_4KB_RANGE_SHIFT (12U) +#define RGX_MMUCTRL_PAGE_4KB_RANGE_CLRMSK (IMG_UINT64_C(0XFFFFFF0000000FFF)) + + +/* + + Range of bits used for 16KB Physical Page + +*/ +#define RGX_MMUCTRL_PAGE_16KB_RANGE_SHIFT (14U) +#define RGX_MMUCTRL_PAGE_16KB_RANGE_CLRMSK (IMG_UINT64_C(0XFFFFFF0000003FFF)) + + +/* + + Range of bits used for 64KB Physical Page + +*/ +#define RGX_MMUCTRL_PAGE_64KB_RANGE_SHIFT (16U) +#define RGX_MMUCTRL_PAGE_64KB_RANGE_CLRMSK (IMG_UINT64_C(0XFFFFFF000000FFFF)) + + +/* + + Range of bits used for 256KB Physical Page + +*/ +#define RGX_MMUCTRL_PAGE_256KB_RANGE_SHIFT (18U) +#define RGX_MMUCTRL_PAGE_256KB_RANGE_CLRMSK (IMG_UINT64_C(0XFFFFFF000003FFFF)) + + +/* + + Range of bits used for 1MB Physical Page + +*/ +#define RGX_MMUCTRL_PAGE_1MB_RANGE_SHIFT (20U) +#define RGX_MMUCTRL_PAGE_1MB_RANGE_CLRMSK (IMG_UINT64_C(0XFFFFFF00000FFFFF)) + + +/* + + Range of bits used for 2MB Physical Page + +*/ +#define RGX_MMUCTRL_PAGE_2MB_RANGE_SHIFT (21U) +#define RGX_MMUCTRL_PAGE_2MB_RANGE_CLRMSK (IMG_UINT64_C(0XFFFFFF00001FFFFF)) + + +/* + + Range of bits used for PT Base Address for 4KB Physical Page + +*/ +#define RGX_MMUCTRL_PT_BASE_4KB_RANGE_SHIFT (12U) +#define RGX_MMUCTRL_PT_BASE_4KB_RANGE_CLRMSK (IMG_UINT64_C(0XFFFFFF0000000FFF)) + + +/* + + Range of bits used for PT Base Address for 16KB Physical Page + +*/ +#define RGX_MMUCTRL_PT_BASE_16KB_RANGE_SHIFT (10U) +#define RGX_MMUCTRL_PT_BASE_16KB_RANGE_CLRMSK (IMG_UINT64_C(0XFFFFFF00000003FF)) + + +/* + + Range of bits used for PT Base Address for 64KB Physical Page + +*/ +#define RGX_MMUCTRL_PT_BASE_64KB_RANGE_SHIFT (8U) +#define RGX_MMUCTRL_PT_BASE_64KB_RANGE_CLRMSK (IMG_UINT64_C(0XFFFFFF00000000FF)) + + +/* + + Range of bits used for PT Base Address for 256KB Physical Page + +*/ +#define RGX_MMUCTRL_PT_BASE_256KB_RANGE_SHIFT (6U) +#define RGX_MMUCTRL_PT_BASE_256KB_RANGE_CLRMSK (IMG_UINT64_C(0XFFFFFF000000003F)) + + +/* + + Range of bits used for PT Base Address for 1MB Physical Page + +*/ +#define RGX_MMUCTRL_PT_BASE_1MB_RANGE_SHIFT (5U) +#define RGX_MMUCTRL_PT_BASE_1MB_RANGE_CLRMSK (IMG_UINT64_C(0XFFFFFF000000001F)) + + +/* + + Range of bits used for PT Base Address for 2MB Physical Page + +*/ +#define RGX_MMUCTRL_PT_BASE_2MB_RANGE_SHIFT (5U) +#define RGX_MMUCTRL_PT_BASE_2MB_RANGE_CLRMSK (IMG_UINT64_C(0XFFFFFF000000001F)) + + +/* + + Format of Page Table data + +*/ +/* +PM/Meta protect bit +*/ +#define RGX_MMUCTRL_PT_DATA_PM_META_PROTECT_SHIFT (62U) +#define RGX_MMUCTRL_PT_DATA_PM_META_PROTECT_CLRMSK (IMG_UINT64_C(0XBFFFFFFFFFFFFFFF)) +#define RGX_MMUCTRL_PT_DATA_PM_META_PROTECT_EN (IMG_UINT64_C(0X4000000000000000)) +/* +Upper part of vp page field +*/ +#define RGX_MMUCTRL_PT_DATA_VP_PAGE_HI_SHIFT (40U) +#define RGX_MMUCTRL_PT_DATA_VP_PAGE_HI_CLRMSK (IMG_UINT64_C(0XC00000FFFFFFFFFF)) +/* +Physical page address +*/ +#define RGX_MMUCTRL_PT_DATA_PAGE_SHIFT (12U) +#define RGX_MMUCTRL_PT_DATA_PAGE_CLRMSK (IMG_UINT64_C(0XFFFFFF0000000FFF)) +/* +Lower part of vp page field +*/ +#define RGX_MMUCTRL_PT_DATA_VP_PAGE_LO_SHIFT (6U) +#define RGX_MMUCTRL_PT_DATA_VP_PAGE_LO_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFF03F)) +/* +Entry pending +*/ +#define RGX_MMUCTRL_PT_DATA_ENTRY_PENDING_SHIFT (5U) +#define RGX_MMUCTRL_PT_DATA_ENTRY_PENDING_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFDF)) +#define RGX_MMUCTRL_PT_DATA_ENTRY_PENDING_EN (IMG_UINT64_C(0X0000000000000020)) +/* +PM Src +*/ +#define RGX_MMUCTRL_PT_DATA_PM_SRC_SHIFT (4U) +#define RGX_MMUCTRL_PT_DATA_PM_SRC_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFEF)) +#define RGX_MMUCTRL_PT_DATA_PM_SRC_EN (IMG_UINT64_C(0X0000000000000010)) +/* +SLC Bypass Ctrl +*/ +#define RGX_MMUCTRL_PT_DATA_SLC_BYPASS_CTRL_SHIFT (3U) +#define RGX_MMUCTRL_PT_DATA_SLC_BYPASS_CTRL_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFF7)) +#define RGX_MMUCTRL_PT_DATA_SLC_BYPASS_CTRL_EN (IMG_UINT64_C(0X0000000000000008)) +/* +Cache Coherency bit +*/ +#define RGX_MMUCTRL_PT_DATA_CC_SHIFT (2U) +#define RGX_MMUCTRL_PT_DATA_CC_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFFB)) +#define RGX_MMUCTRL_PT_DATA_CC_EN (IMG_UINT64_C(0X0000000000000004)) +/* +Read only +*/ +#define RGX_MMUCTRL_PT_DATA_READ_ONLY_SHIFT (1U) +#define RGX_MMUCTRL_PT_DATA_READ_ONLY_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFFD)) +#define RGX_MMUCTRL_PT_DATA_READ_ONLY_EN (IMG_UINT64_C(0X0000000000000002)) +/* +Entry valid +*/ +#define RGX_MMUCTRL_PT_DATA_VALID_SHIFT (0U) +#define RGX_MMUCTRL_PT_DATA_VALID_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFFE)) +#define RGX_MMUCTRL_PT_DATA_VALID_EN (IMG_UINT64_C(0X0000000000000001)) + + +/* + + Format of Page Directory data + +*/ +/* +Entry pending +*/ +#define RGX_MMUCTRL_PD_DATA_ENTRY_PENDING_SHIFT (40U) +#define RGX_MMUCTRL_PD_DATA_ENTRY_PENDING_CLRMSK (IMG_UINT64_C(0XFFFFFEFFFFFFFFFF)) +#define RGX_MMUCTRL_PD_DATA_ENTRY_PENDING_EN (IMG_UINT64_C(0X0000010000000000)) +/* +Page Table base address +*/ +#define RGX_MMUCTRL_PD_DATA_PT_BASE_SHIFT (5U) +#define RGX_MMUCTRL_PD_DATA_PT_BASE_CLRMSK (IMG_UINT64_C(0XFFFFFF000000001F)) +/* +Page Size +*/ +#define RGX_MMUCTRL_PD_DATA_PAGE_SIZE_SHIFT (1U) +#define RGX_MMUCTRL_PD_DATA_PAGE_SIZE_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFF1)) +#define RGX_MMUCTRL_PD_DATA_PAGE_SIZE_4KB (IMG_UINT64_C(0000000000000000)) +#define RGX_MMUCTRL_PD_DATA_PAGE_SIZE_16KB (IMG_UINT64_C(0x0000000000000002)) +#define RGX_MMUCTRL_PD_DATA_PAGE_SIZE_64KB (IMG_UINT64_C(0x0000000000000004)) +#define RGX_MMUCTRL_PD_DATA_PAGE_SIZE_256KB (IMG_UINT64_C(0x0000000000000006)) +#define RGX_MMUCTRL_PD_DATA_PAGE_SIZE_1MB (IMG_UINT64_C(0x0000000000000008)) +#define RGX_MMUCTRL_PD_DATA_PAGE_SIZE_2MB (IMG_UINT64_C(0x000000000000000a)) +/* +Entry valid +*/ +#define RGX_MMUCTRL_PD_DATA_VALID_SHIFT (0U) +#define RGX_MMUCTRL_PD_DATA_VALID_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFFE)) +#define RGX_MMUCTRL_PD_DATA_VALID_EN (IMG_UINT64_C(0X0000000000000001)) + + +/* + + Format of Page Catalogue data + +*/ +/* +Page Catalogue base address +*/ +#define RGX_MMUCTRL_PC_DATA_PD_BASE_SHIFT (4U) +#define RGX_MMUCTRL_PC_DATA_PD_BASE_CLRMSK (0X0000000FU) +#define RGX_MMUCTRL_PC_DATA_PD_BASE_ALIGNSHIFT (12U) +#define RGX_MMUCTRL_PC_DATA_PD_BASE_ALIGNSIZE (4096U) +/* +Entry pending +*/ +#define RGX_MMUCTRL_PC_DATA_ENTRY_PENDING_SHIFT (1U) +#define RGX_MMUCTRL_PC_DATA_ENTRY_PENDING_CLRMSK (0XFFFFFFFDU) +#define RGX_MMUCTRL_PC_DATA_ENTRY_PENDING_EN (0X00000002U) +/* +Entry valid +*/ +#define RGX_MMUCTRL_PC_DATA_VALID_SHIFT (0U) +#define RGX_MMUCTRL_PC_DATA_VALID_CLRMSK (0XFFFFFFFEU) +#define RGX_MMUCTRL_PC_DATA_VALID_EN (0X00000001U) + + +#endif /* _RGXMMUDEFS_KM_H_ */ + +/***************************************************************************** + End of file (rgxmmudefs_km.h) +*****************************************************************************/ + diff --git a/drivers/gpu/rogue_m/include/adf/adf_ext.h b/drivers/gpu/rogue_m/include/adf/adf_ext.h new file mode 100644 index 000000000000..68e972fcb2c1 --- /dev/null +++ b/drivers/gpu/rogue_m/include/adf/adf_ext.h @@ -0,0 +1,111 @@ +/*************************************************************************/ /*! +@File adf_ext.h +@Title IMG extension ioctls and ioctl packages for ADF +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ +/* vi: set ts=8: */ + +#ifndef __ADF_EXT_H__ +#define __ADF_EXT_H__ + +#include + +#define ADF_BUFFER_TRANSFORM_NONE_EXT (0 << 0) +#define ADF_BUFFER_TRANSFORM_FLIP_H_EXT (1 << 0) +#define ADF_BUFFER_TRANSFORM_FLIP_V_EXT (1 << 1) +#define ADF_BUFFER_TRANSFORM_ROT_90_EXT (1 << 2) +#define ADF_BUFFER_TRANSFORM_ROT_180_EXT ((1 << 0) + (1 << 1)) +#define ADF_BUFFER_TRANSFORM_ROT_270_EXT ((1 << 0) + (1 << 1) + (1 << 2)) + +#define ADF_BUFFER_BLENDING_NONE_EXT 0 +#define ADF_BUFFER_BLENDING_PREMULT_EXT 1 +#define ADF_BUFFER_BLENDING_COVERAGE_EXT 2 + +struct adf_buffer_config_ext { + /* Crop applied to surface (BEFORE transformation) */ + struct drm_clip_rect crop; + + /* Region of screen to display surface in (AFTER scaling) */ + struct drm_clip_rect display; + + /* Surface rotation / flip / mirror */ + __u32 transform; + + /* Alpha blending mode e.g. none / premult / coverage */ + __u32 blend_type; + + /* Plane alpha */ + __u8 plane_alpha; + __u8 reserved[3]; +} __packed; + +struct adf_post_ext { + __u32 post_id; + struct adf_buffer_config_ext bufs_ext[]; +} __packed; + +struct adf_validate_config_ext { + __u32 n_interfaces; + __u32 __user *interfaces; + + __u32 n_bufs; + + struct adf_buffer_config __user *bufs; + struct adf_post_ext __user *post_ext; +} __packed; + +/* These shouldn't be stripped by the uapi process in the bionic headers, + * but currently are being. Redefine them so the custom ioctl interface is + * actually useful. Fixed in Lollipop. + */ +#ifndef ADF_IOCTL_TYPE +#define ADF_IOCTL_TYPE 'D' +#endif + +#ifndef ADF_IOCTL_NR_CUSTOM +#define ADF_IOCTL_NR_CUSTOM 128 +#endif + +#define ADF_IOCTL_NR_VALIDATE_IMG (ADF_IOCTL_NR_CUSTOM + 0) + +#define ADF_VALIDATE_CONFIG_EXT \ + _IOW(ADF_IOCTL_TYPE, ADF_IOCTL_NR_VALIDATE_IMG, \ + struct adf_validate_config_ext) + +#endif /* __ADF_EXT_H__ */ diff --git a/drivers/gpu/rogue_m/include/cache_external.h b/drivers/gpu/rogue_m/include/cache_external.h new file mode 100644 index 000000000000..2967f1ead23e --- /dev/null +++ b/drivers/gpu/rogue_m/include/cache_external.h @@ -0,0 +1,75 @@ +/*************************************************************************/ /*! +@File +@Title Services cache management header +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Defines for cache management which are visible internally + and externally +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef _CACHE_EXTERNAL_H_ +#define _CACHE_EXTERNAL_H_ +#include "img_types.h" + +typedef IMG_UINT32 PVRSRV_CACHE_OP; + +#define PVRSRV_CACHE_OP_NONE 0x0 /*!< No operation */ +#define PVRSRV_CACHE_OP_CLEAN 0x1 /*!< Flush w/o invalidate */ +#define PVRSRV_CACHE_OP_INVALIDATE 0x2 /*!< Invalidate w/o flush */ +#define PVRSRV_CACHE_OP_FLUSH 0x3 /*!< Flush w/ invalidate */ + +/* + If we get multiple cache operations before the operation which will + trigger the operation to happen then we need to make sure we do + the right thing. + + Note: PVRSRV_CACHE_OP_INVALIDATE should never be passed into here +*/ +#ifdef INLINE_IS_PRAGMA +#pragma inline(SetCacheOp) +#endif +static INLINE PVRSRV_CACHE_OP SetCacheOp(PVRSRV_CACHE_OP uiCurrent, + PVRSRV_CACHE_OP uiNew) +{ + PVRSRV_CACHE_OP uiRet; + + uiRet = uiCurrent | uiNew; + return uiRet; +} + +#endif /* _CACHE_EXTERNAL_H_ */ diff --git a/drivers/gpu/rogue_m/include/dbgdrvif_srv5.h b/drivers/gpu/rogue_m/include/dbgdrvif_srv5.h new file mode 100644 index 000000000000..4f6135907bcd --- /dev/null +++ b/drivers/gpu/rogue_m/include/dbgdrvif_srv5.h @@ -0,0 +1,264 @@ +/*************************************************************************/ /*! +@File +@Title Debug driver for Services 5 +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Debug Driver Interface +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef _DBGDRVIF_SRV5_ +#define _DBGDRVIF_SRV5_ + +#if defined(_MSC_VER) +#pragma warning(disable:4200) +#endif + +#if defined(__linux__) + +#define FILE_DEVICE_UNKNOWN 0 +#define METHOD_BUFFERED 0 +#define FILE_ANY_ACCESS 0 + +#define CTL_CODE( DeviceType, Function, Method, Access ) (Function) +#define MAKEIOCTLINDEX(i) ((i) & 0xFFF) + +#else + +#include "ioctldef.h" + +#endif + + +/***************************************************************************** + Stream mode stuff. +*****************************************************************************/ +#define DEBUG_CAPMODE_FRAMED 0x00000001UL /* Default capture mode, set when streams created */ +#define DEBUG_CAPMODE_CONTINUOUS 0x00000002UL /* Only set in WDDM, streams created with it set to this mode */ + +#define DEBUG_FLAGS_USE_NONPAGED_MEM 0x00000001UL /* Only set in WDDM */ +#define DEBUG_FLAGS_NO_BUF_EXPANDSION 0x00000002UL +#define DEBUG_FLAGS_READONLY 0x00000008UL +#define DEBUG_FLAGS_WRITEONLY 0x00000010UL +#define DEBUG_FLAGS_CIRCULAR 0x00000020UL + +/***************************************************************************** + IOCTL values. +*****************************************************************************/ +/* IOCTL values defined here so that the windows based OS layer of PDump + in the server can access the GetServiceTable method. + */ +#define DEBUG_SERVICE_IOCTL_BASE 0x800UL +#define DEBUG_SERVICE_GETSERVICETABLE CTL_CODE(FILE_DEVICE_UNKNOWN, DEBUG_SERVICE_IOCTL_BASE + 0x01, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define DEBUG_SERVICE_GETSTREAM CTL_CODE(FILE_DEVICE_UNKNOWN, DEBUG_SERVICE_IOCTL_BASE + 0x02, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define DEBUG_SERVICE_READ CTL_CODE(FILE_DEVICE_UNKNOWN, DEBUG_SERVICE_IOCTL_BASE + 0x03, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define DEBUG_SERVICE_SETMARKER CTL_CODE(FILE_DEVICE_UNKNOWN, DEBUG_SERVICE_IOCTL_BASE + 0x04, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define DEBUG_SERVICE_GETMARKER CTL_CODE(FILE_DEVICE_UNKNOWN, DEBUG_SERVICE_IOCTL_BASE + 0x05, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define DEBUG_SERVICE_WAITFOREVENT CTL_CODE(FILE_DEVICE_UNKNOWN, DEBUG_SERVICE_IOCTL_BASE + 0x06, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define DEBUG_SERVICE_GETFRAME CTL_CODE(FILE_DEVICE_UNKNOWN, DEBUG_SERVICE_IOCTL_BASE + 0x07, METHOD_BUFFERED, FILE_ANY_ACCESS) +#if defined(__QNXNTO__) +#define DEBUG_SERVICE_CREATESTREAM CTL_CODE(FILE_DEVICE_UNKNOWN, DEBUG_SERVICE_IOCTL_BASE + 0x08, METHOD_BUFFERED, FILE_ANY_ACCESS) +#define DEBUG_SERVICE_MAX_API 8 +#else +#define DEBUG_SERVICE_MAX_API 9 +#endif + + +#if defined(_WIN32) +/***************************************************************************** + Debug driver device name +*****************************************************************************/ +#if defined (DBGDRV_MODULE_NAME) +#define REGISTRY_PATH_TO_DEBUG_DRIVER \ + L"\\Registry\\Machine\\System\\CurrentControlSet\\Services\\" DBGDRV_MODULE_NAME +#define DBGDRV_NT_DEVICE_NAME L"\\Device\\" DBGDRV_MODULE_NAME +#define DBGDRV_NT_SYMLINK L"\\DosDevices\\" DBGDRV_MODULE_NAME +#else +#error Debug driver name must be specified +/* +#define DBGDRV_NT_DEVICE_NAME L"\\Device\\VLDbgDrv" +#define DBGDRV_NT_SYMLINK L"\\DosDevices\\VLDBGDRV" +*/ +#endif + +/* symbolic link name */ +#define DBGDRV_WIN32_DEVICE_NAME "\\\\.\\VLDBGDRV" + +#define DBGDRV_WINCE_DEVICE_NAME L"DBD1:" +#endif + +#ifdef __GNUC__ +#define DBG_ALIGN(n) __attribute__ ((aligned (n))) +#else +#define DBG_ALIGN(n) +#endif + +/* A pointer type which is at least 64 bits wide. The fixed width ensures + * consistency in structures between 32 and 64-bit code. + * The UM code (be it 32 or 64 bit) can simply write to the native pointer type (pvPtr). + * 64-bit KM code must read ui32Ptr if in the case of a 32-bit client, otherwise it can + * just read pvPtr if the client is also 64-bit + * + * ui64Ptr ensures the union is 64-bits wide in a 32-bit client. + * + * The union is explicitly 64-bit aligned as it was found gcc on x32 only + * aligns it to 32-bit, as the ABI permits aligning 64-bit types to a 32-bit + * boundary. + */ +typedef union +{ + /* native pointer type for UM to write to */ + IMG_VOID *pvPtr; + /* the pointer written by a 32-bit client */ + IMG_UINT32 ui32Ptr; + /* force the union width */ + IMG_UINT64 ui64Ptr; +} DBG_WIDEPTR DBG_ALIGN(8); + +/* Helper macro for dbgdriv (KM) to get the pointer value from the WIDEPTR type, + * depending on whether the client is 32 or 64-bit. + * + * note: double cast is required to avoid + * 'cast to pointer from integer of different size' warning. + * this is solved by first casting to an integer type. + */ + +#if defined(CONFIG_COMPAT) +#define WIDEPTR_GET_PTR(p, bCompat) (bCompat ? \ + (IMG_VOID *) (IMG_UINTPTR_T) (p).ui32Ptr : \ + (p).pvPtr) +#else +#define WIDEPTR_GET_PTR(p, bCompat) (p).pvPtr +#endif + +typedef enum _DBG_EVENT_ +{ + DBG_EVENT_STREAM_DATA = 1 +} DBG_EVENT; + + +/***************************************************************************** + In/Out Structures +*****************************************************************************/ +#if defined(__QNXNTO__) +typedef struct _DBG_IN_CREATESTREAM_ +{ + union + { + IMG_CHAR *pszName; + IMG_UINT64 ui64Name; + } u; + IMG_UINT32 ui32Pages; + IMG_UINT32 ui32CapMode; + IMG_UINT32 ui32OutMode; +}DBG_IN_CREATESTREAM, *PDBG_IN_CREATESTREAM; + +typedef struct _DBG_OUT_CREATESTREAM_ +{ + IMG_HANDLE phInit; + IMG_HANDLE phMain; + IMG_HANDLE phDeinit; +} DBG_OUT_CREATESTREAM, *PDBG_OUT_CREATESTREAM; +#endif + +typedef struct _DBG_IN_FINDSTREAM_ +{ + DBG_WIDEPTR pszName; + IMG_BOOL bResetStream; +}DBG_IN_FINDSTREAM, *PDBG_IN_FINDSTREAM; + +#define DEBUG_READ_BUFID_MAIN 0 +#define DEBUG_READ_BUFID_INIT 1 +#define DEBUG_READ_BUFID_DEINIT 2 + +typedef struct _DBG_IN_READ_ +{ + DBG_WIDEPTR pui8OutBuffer; + IMG_SID hStream; + IMG_UINT32 ui32BufID; + IMG_UINT32 ui32OutBufferSize; +} DBG_IN_READ, *PDBG_IN_READ; + +typedef struct _DBG_OUT_READ_ +{ + IMG_UINT32 ui32DataRead; + IMG_UINT32 ui32SplitMarker; +} DBG_OUT_READ, *PDBG_OUT_READ; + +typedef struct _DBG_IN_SETMARKER_ +{ + IMG_SID hStream; + IMG_UINT32 ui32Marker; +} DBG_IN_SETMARKER, *PDBG_IN_SETMARKER; + +/* + DBG STREAM abstract types +*/ + +typedef struct _DBG_STREAM_CONTROL_* PDBG_STREAM_CONTROL; +typedef struct _DBG_STREAM_* PDBG_STREAM; + +/* + Lookup identifiers for the GetState method in the KM service table. + */ +#define DBG_GET_STATE_FLAG_IS_READONLY 0x03 + + +/***************************************************************************** + Kernel mode service table +*****************************************************************************/ +typedef struct _DBGKM_SERVICE_TABLE_ +{ + IMG_UINT32 ui32Size; + IMG_BOOL (IMG_CALLCONV *pfnCreateStream) (IMG_CHAR * pszName,IMG_UINT32 ui32Flags,IMG_UINT32 ui32Pages, IMG_HANDLE* phInit, IMG_HANDLE* phMain, IMG_HANDLE* phDeinit); + IMG_VOID (IMG_CALLCONV *pfnDestroyStream) (IMG_HANDLE hInit, IMG_HANDLE hMain, IMG_HANDLE hDeinit); + IMG_UINT32 (IMG_CALLCONV *pfnDBGDrivWrite2) (PDBG_STREAM psStream, IMG_UINT8 *pui8InBuf,IMG_UINT32 ui32InBuffSize); + IMG_VOID (IMG_CALLCONV *pfnSetMarker) (PDBG_STREAM psStream, IMG_UINT32 ui32Marker); + IMG_VOID (IMG_CALLCONV *pfnWaitForEvent) (DBG_EVENT eEvent); + IMG_UINT32 (IMG_CALLCONV *pfnGetCtrlState) (PDBG_STREAM psStream, IMG_UINT32 ui32StateID); + IMG_VOID (IMG_CALLCONV *pfnSetFrame) (IMG_UINT32 ui32Frame); +} DBGKM_SERVICE_TABLE, *PDBGKM_SERVICE_TABLE; + +#if defined(_MSC_VER) +#pragma warning(default:4200) +#endif + +#endif + +/***************************************************************************** + End of file +*****************************************************************************/ diff --git a/drivers/gpu/rogue_m/include/devicemem_typedefs.h b/drivers/gpu/rogue_m/include/devicemem_typedefs.h new file mode 100644 index 000000000000..561d75f88db2 --- /dev/null +++ b/drivers/gpu/rogue_m/include/devicemem_typedefs.h @@ -0,0 +1,105 @@ +/*************************************************************************/ /*! +@File +@Title Device Memory Management +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Client side part of device memory management -- this file + is forked from new_devmem_allocation.h as this one has to + reside in the top level include so that client code is able + to make use of the typedefs. +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef DEVICEMEM_TYPEDEFS_H +#define DEVICEMEM_TYPEDEFS_H + +#include "img_types.h" +#include "pvrsrv_memallocflags.h" + +typedef struct _DEVMEM_CONTEXT_ DEVMEM_CONTEXT; /*!< Convenience typedef for struct _DEVMEM_CONTEXT_ */ +typedef struct _DEVMEM_HEAP_ DEVMEM_HEAP; /*!< Convenience typedef for struct _DEVMEM_HEAP_ */ +typedef struct _DEVMEM_MEMDESC_ DEVMEM_MEMDESC; /*!< Convenience typedef for struct _DEVMEM_MEMDESC_ */ +typedef struct _DEVMEM_PAGELIST_ DEVMEM_PAGELIST; /*!< Convenience typedef for struct _DEVMEM_PAGELIST_ */ +typedef PVRSRV_MEMALLOCFLAGS_T DEVMEM_FLAGS_T; /*!< Conveneince typedef for PVRSRV_MEMALLOCFLAGS_T */ + +typedef IMG_HANDLE /* FIXME: should be a SID */ DEVMEM_EXPORTHANDLE; /*!< Typedef for DeviceMem Export Handle */ +typedef IMG_UINT64 DEVMEM_EXPORTKEY; /*!< Typedef for DeviceMem Export Key */ +typedef IMG_DEVMEM_SIZE_T DEVMEM_SIZE_T; /*!< Typedef for DeviceMem SIZE_T */ +typedef IMG_DEVMEM_LOG2ALIGN_T DEVMEM_LOG2ALIGN_T; /*!< Typdef for DeviceMem LOG2 Alignment */ + +/*! calling code needs all the info in this struct, to be able to pass it around */ +typedef struct +{ + /*! A handle to the PMR. Should be a SID. FIXME: decide whether + this is right... as the PMR would have to be a cross-process + handle */ + IMG_HANDLE hPMRExportHandle; + /*! The "key" to prove we have authorization to use this PMR */ + IMG_UINT64 uiPMRExportPassword; + /*! Size and alignment properties for this PMR. Note, these + numbers are not trusted in kernel, but we need to cache them + client-side in order to allocate from the VM arena. The kernel + will know the actual alignment and size of the PMR and thus + would prevent client code from breaching security here. Ditto + for physmem granularity (aka page size) if this is different + from alignment */ + IMG_DEVMEM_SIZE_T uiSize; + /*! We call this "contiguity guarantee" to be more precise than + calling it "alignment" or "page size", terms which may seem + similar but have different emphasis. The number reported here + is the minimum contiguity guarantee from the creator of the + PMR. Now, there is no requirement to allocate that coarsely + from the RA. The alignment given to the RA simply needs to be + at least as coarse as the device page size for the heap we + ultimately intend to map into. What is important is that the + device MMU data page size is not greater than the minimum + contiguity guarantee from the PMR. This value is reported to + the client in order that it can choose to make early checks and + perhaps decide which heap (in a variable page size scenario) it + would be safe to map this PMR into. For convenience, the + client may choose to use this argument as the alignment of the + virtual range he chooses to allocate, but this is _not_ + necessary and in many cases would be able to get away with a + finer alignment, should the heap into which this PMR will be + mapped support it. */ + IMG_DEVMEM_LOG2ALIGN_T uiLog2ContiguityGuarantee; +} DEVMEM_EXPORTCOOKIE; + +typedef IMG_HANDLE DEVMEM_SERVER_EXPORTCOOKIE; /*!< typedef for DeviceMem Server Export Cookie */ + +#endif /* #ifndef SRVCLIENT_NEW_DEVMEM_ALLOCATION_TYPEDEFS_H */ + diff --git a/drivers/gpu/rogue_m/include/img_3dtypes.h b/drivers/gpu/rogue_m/include/img_3dtypes.h new file mode 100644 index 000000000000..d7ad113d8b77 --- /dev/null +++ b/drivers/gpu/rogue_m/include/img_3dtypes.h @@ -0,0 +1,236 @@ +/*************************************************************************/ /*! +@File +@Title Global 3D types for use by IMG APIs +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Defines 3D types for use by IMG APIs +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef __IMG_3DTYPES_H__ +#define __IMG_3DTYPES_H__ + +/** + * Comparison functions + * This comparison function is defined as: + * A {CmpFunc} B + * A is a reference value, e.g., incoming depth etc. + * B is the sample value, e.g., value in depth buffer. + */ +typedef enum _IMG_COMPFUNC_ +{ + IMG_COMPFUNC_NEVER, /**< The comparison never succeeds */ + IMG_COMPFUNC_LESS, /**< The comparison is a less-than operation */ + IMG_COMPFUNC_EQUAL, /**< The comparison is an equal-to operation */ + IMG_COMPFUNC_LESS_EQUAL, /**< The comparison is a less-than or equal-to + operation */ + IMG_COMPFUNC_GREATER, /**< The comparison is a greater-than operation + */ + IMG_COMPFUNC_NOT_EQUAL, /**< The comparison is a no-equal-to operation + */ + IMG_COMPFUNC_GREATER_EQUAL, /**< The comparison is a greater-than or + equal-to operation */ + IMG_COMPFUNC_ALWAYS, /**< The comparison always succeeds */ +} IMG_COMPFUNC; + +/** + * Stencil op functions + */ +typedef enum _IMG_STENCILOP_ +{ + IMG_STENCILOP_KEEP, /**< Keep original value */ + IMG_STENCILOP_ZERO, /**< Set stencil to 0 */ + IMG_STENCILOP_REPLACE, /**< Replace stencil entry */ + IMG_STENCILOP_INCR_SAT, /**< Increment stencil entry, clamping to max */ + IMG_STENCILOP_DECR_SAT, /**< Decrement stencil entry, clamping to zero */ + IMG_STENCILOP_INVERT, /**< Invert bits in stencil entry */ + IMG_STENCILOP_INCR, /**< Increment stencil entry, + wrapping if necessary */ + IMG_STENCILOP_DECR, /**< Decrement stencil entry, + wrapping if necessary */ +} IMG_STENCILOP; + +/** + * Memory layout enumeration. + * Defines how pixels are layed out within a surface. + */ +typedef enum _IMG_MEMLAYOUT_ +{ + IMG_MEMLAYOUT_STRIDED, /**< Resource is strided, one row at a time */ + IMG_MEMLAYOUT_TWIDDLED, /**< Resource is 2D twiddled, classic style */ + IMG_MEMLAYOUT_3DTWIDDLED, /**< Resource is 3D twiddled, classic style */ + IMG_MEMLAYOUT_TILED, /**< Resource is tiled, tiling config specified elsewhere. */ + IMG_MEMLAYOUT_PAGETILED, /**< Resource is pagetiled */ +} IMG_MEMLAYOUT; + +/** + * Alpha blending allows colours and textures on one surface + * to be blended with transparancy onto another surface. + * These definitions apply to both source and destination blending + * states + */ +typedef enum _IMG_BLEND_ +{ + IMG_BLEND_ZERO = 0, /**< Blend factor is (0,0,0,0) */ + IMG_BLEND_ONE, /**< Blend factor is (1,1,1,1) */ + IMG_BLEND_SRC_COLOUR, /**< Blend factor is the source colour */ + IMG_BLEND_INV_SRC_COLOUR, /**< Blend factor is the inverted source colour + (i.e. 1-src_col) */ + IMG_BLEND_SRC_ALPHA, /**< Blend factor is the source alpha */ + IMG_BLEND_INV_SRC_ALPHA, /**< Blend factor is the inverted source alpha + (i.e. 1-src_alpha) */ + IMG_BLEND_DEST_ALPHA, /**< Blend factor is the destination alpha */ + IMG_BLEND_INV_DEST_ALPHA, /**< Blend factor is the inverted destination + alpha */ + IMG_BLEND_DEST_COLOUR, /**< Blend factor is the destination colour */ + IMG_BLEND_INV_DEST_COLOUR, /**< Blend factor is the inverted destination + colour */ + IMG_BLEND_SRC_ALPHASAT, /**< Blend factor is the alpha saturation (the + minimum of (Src alpha, + 1 - destination alpha)) */ + IMG_BLEND_BLEND_FACTOR, /**< Blend factor is a constant */ + IMG_BLEND_INVBLEND_FACTOR, /**< Blend factor is a constant (inverted)*/ + IMG_BLEND_SRC1_COLOUR, /**< Blend factor is the colour outputted from + the pixel shader */ + IMG_BLEND_INV_SRC1_COLOUR, /**< Blend factor is the inverted colour + outputted from the pixel shader */ + IMG_BLEND_SRC1_ALPHA, /**< Blend factor is the alpha outputted from + the pixel shader */ + IMG_BLEND_INV_SRC1_ALPHA /**< Blend factor is the inverted alpha + outputted from the pixel shader */ +} IMG_BLEND; + +/** + * The arithmetic operation to perform when blending + */ +typedef enum _IMG_BLENDOP_ +{ + IMG_BLENDOP_ADD = 0, /**< Result = (Source + Destination) */ + IMG_BLENDOP_SUBTRACT, /**< Result = (Source - Destination) */ + IMG_BLENDOP_REV_SUBTRACT, /**< Result = (Destination - Source) */ + IMG_BLENDOP_MIN, /**< Result = min (Source, Destination) */ + IMG_BLENDOP_MAX /**< Result = max (Source, Destination) */ +} IMG_BLENDOP; + +/** + * Logical operation to perform when logic ops are enabled + */ +typedef enum _IMG_LOGICOP_ +{ + IMG_LOGICOP_CLEAR = 0, /**< Result = 0 */ + IMG_LOGICOP_SET, /**< Result = -1 */ + IMG_LOGICOP_COPY, /**< Result = Source */ + IMG_LOGICOP_COPY_INVERTED, /**< Result = ~Source */ + IMG_LOGICOP_NOOP, /**< Result = Destination */ + IMG_LOGICOP_INVERT, /**< Result = ~Destination */ + IMG_LOGICOP_AND, /**< Result = Source & Destination */ + IMG_LOGICOP_NAND, /**< Result = ~(Source & Destination) */ + IMG_LOGICOP_OR, /**< Result = Source | Destination */ + IMG_LOGICOP_NOR, /**< Result = ~(Source | Destination) */ + IMG_LOGICOP_XOR, /**< Result = Source ^ Destination */ + IMG_LOGICOP_EQUIV, /**< Result = ~(Source ^ Destination) */ + IMG_LOGICOP_AND_REVERSE, /**< Result = Source & ~Destination */ + IMG_LOGICOP_AND_INVERTED, /**< Result = ~Source & Destination */ + IMG_LOGICOP_OR_REVERSE, /**< Result = Source | ~Destination */ + IMG_LOGICOP_OR_INVERTED /**< Result = ~Source | Destination */ +} IMG_LOGICOP; + +/** + * Type of fog blending supported + */ +typedef enum _IMG_FOGMODE_ +{ + IMG_FOGMODE_NONE, /**< No fog blending - fog calculations are + * based on the value output from the vertex phase */ + IMG_FOGMODE_LINEAR, /**< Linear interpolation */ + IMG_FOGMODE_EXP, /**< Exponential */ + IMG_FOGMODE_EXP2, /**< Exponential squaring */ +} IMG_FOGMODE; + +/** + * Types of filtering + */ +typedef enum _IMG_FILTER_ +{ + IMG_FILTER_DONTCARE, /**< Any filtering mode is acceptable */ + IMG_FILTER_POINT, /**< Point filtering */ + IMG_FILTER_LINEAR, /**< Bi-linear filtering */ + IMG_FILTER_BICUBIC, /**< Bi-cubic filtering */ +} IMG_FILTER; + +/** + * Addressing modes for textures + */ +typedef enum _IMG_ADDRESSMODE_ +{ + IMG_ADDRESSMODE_REPEAT, /**< Texture repeats conintuously */ + IMG_ADDRESSMODE_FLIP, /**< Texture flips on odd integer part */ + IMG_ADDRESSMODE_CLAMP, /**< Texture clamped at 0 or 1 */ + IMG_ADDRESSMODE_FLIPCLAMP, /**< Flipped once, then clampe */ + IMG_ADDRESSMODE_CLAMPBORDER, + IMG_ADDRESSMODE_OGL_CLAMP, + IMG_ADDRESSMODE_OVG_TILEFILL, + IMG_ADDRESSMODE_DONTCARE, +} IMG_ADDRESSMODE; + +/** + * Culling based on winding order of triangle. + */ +typedef enum _IMG_CULLMODE_ +{ + IMG_CULLMODE_NONE, /**< Don't cull */ + IMG_CULLMODE_FRONTFACING, /**< Front facing triangles */ + IMG_CULLMODE_BACKFACING, /**< Back facing triangles */ +} IMG_CULLMODE; + +/** + * Rotation clockwise + */ +typedef enum _IMG_ROTATION_ +{ + IMG_ROTATION_0DEG = 0, + IMG_ROTATION_90DEG = 1, + IMG_ROTATION_180DEG = 2, + IMG_ROTATION_270DEG = 3, + IMG_ROTATION_FLIP_Y = 4 +} IMG_ROTATION; + + +#endif /* __IMG_3DTYPES_H__ */ +/****************************************************************************** + End of file (img_3dtypes.h) +******************************************************************************/ diff --git a/drivers/gpu/rogue_m/include/img_defs.h b/drivers/gpu/rogue_m/include/img_defs.h new file mode 100644 index 000000000000..a4a3c226af07 --- /dev/null +++ b/drivers/gpu/rogue_m/include/img_defs.h @@ -0,0 +1,226 @@ +/*************************************************************************/ /*! +@File +@Title Common header containing type definitions for portability +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Contains variable and structure definitions. Any platform + specific types should be defined in this file. +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#if !defined (__IMG_DEFS_H__) +#define __IMG_DEFS_H__ + +#include + +#include "img_types.h" + +#if defined (NO_INLINE_FUNCS) + #define INLINE + #define FORCE_INLINE +#else +#if defined (__cplusplus) + #define INLINE inline + #define FORCE_INLINE inline +#else +#if !defined(INLINE) + #define INLINE __inline +#endif +#if defined(UNDER_WDDM) && defined(_X86_) + #define FORCE_INLINE __forceinline +#else + #define FORCE_INLINE static __inline +#endif +#endif +#endif + + +/* Use this in any file, or use attributes under GCC - see below */ +#ifndef PVR_UNREFERENCED_PARAMETER +#define PVR_UNREFERENCED_PARAMETER(param) ((void)(param)) +#endif + +/*! Macro used to check structure size and alignment at compile time. */ +#define BLD_ASSERT(expr, file) _impl_ASSERT_LINE(expr,__LINE__,file) +#define _impl_JOIN(a,b) a##b +#define _impl_ASSERT_LINE(expr, line, file) \ + typedef char _impl_JOIN(build_assertion_failed_##file##_,line)[2*!!(expr)-1]; + +/*! Macro to calculate the n-byte aligned value from that supplied rounding up. + * n must be a power of two. + * + * Both arguments should be of a type with the same size otherwise the macro may + * cut off digits, e.g. imagine a 64 bit address in _x and a 32 bit value in _n. + */ +#define PVR_ALIGN(_x, _n) (((_x)+((_n)-1)) & ~((_n)-1)) + + +/* The best way to supress unused parameter warnings using GCC is to use a + * variable attribute. Place the unref__ between the type and name of an + * unused parameter in a function parameter list, eg `int unref__ var'. This + * should only be used in GCC build environments, for example, in files that + * compile only on Linux. Other files should use UNREFERENCED_PARAMETER */ +#ifdef __GNUC__ +#define unref__ __attribute__ ((unused)) +#else +#define unref__ +#endif + +#if defined(_WIN32) + #define IMG_CALLCONV __stdcall + #define IMG_INTERNAL + #define IMG_EXPORT __declspec(dllexport) + #define IMG_RESTRICT __restrict + #define C_CALLCONV __cdecl + + /* IMG_IMPORT is defined as IMG_EXPORT so that headers and implementations match. + * Some compilers require the header to be declared IMPORT, while the implementation is declared EXPORT + */ + #define IMG_IMPORT IMG_EXPORT + +#if defined(UNDER_WDDM) + #ifndef _INC_STDLIB + #if defined (UNDER_MSBUILD) + _CRTIMP __declspec(noreturn) void __cdecl abort(void); + #else + _CRTIMP void __cdecl abort(void); + #endif + #endif + #if defined(EXIT_ON_ABORT) + #define IMG_ABORT() exit(1); + #else + #define IMG_ABORT() abort(); + #endif +// #define IMG_ABORT() img_abort() +#endif /* UNDER_WDDM */ +#else + #if defined(LINUX) || defined(__METAG) || defined(__QNXNTO__) + + #define IMG_CALLCONV + #define C_CALLCONV + #if defined(__linux__) || defined(__QNXNTO__) + #define IMG_INTERNAL __attribute__((visibility("hidden"))) + #else + #define IMG_INTERNAL + #endif + #define IMG_EXPORT __attribute__((visibility("default"))) + #define IMG_IMPORT + #define IMG_RESTRICT __restrict__ + + #else + #error("define an OS") + #endif +#endif + +// Use default definition if not overridden +#ifndef IMG_ABORT + #if defined(EXIT_ON_ABORT) + #define IMG_ABORT() exit(1) + #else + #define IMG_ABORT() abort() + #endif +#endif + +#if defined(__GNUC__) +#define IMG_FORMAT_PRINTF(x,y) __attribute__((format(printf,x,y))) +#else +#define IMG_FORMAT_PRINTF(x,y) +#endif + +#if defined(__GNUC__) +#define IMG_WARN_UNUSED_RESULT __attribute__((warn_unused_result)) +#else +#define IMG_WARN_UNUSED_RESULT +#endif + +#if defined(_MSC_VER) || defined(CC_ARM) + #define IMG_NORETURN __declspec(noreturn) +#else + #if defined(__GNUC__) + #define IMG_NORETURN __attribute__((noreturn)) + #else + #define IMG_NORETURN + #endif +#endif + +#define MAX(a,b) (((a) > (b)) ? (a) : (b)) +#define MIN(a,b) (((a) < (b)) ? (a) : (b)) + +/* Get a structures address from the address of a member */ +#define IMG_CONTAINER_OF(ptr, type, member) \ + (type *) ((IMG_UINT8 *) (ptr) - offsetof(type, member)) + +/* The number of elements in a fixed-sized array, IMGs ARRAY_SIZE macro */ +#define IMG_ARR_NUM_ELEMS(ARR) \ + (sizeof(ARR) / sizeof((ARR)[0])) + +/* To guarantee that __func__ can be used, define it as a macro here if it + isn't already provided by the compiler. */ +#if defined(_MSC_VER) +#define __func__ __FUNCTION__ +#endif + +#if defined(__cplusplus) +/* C++ Specific: + * Disallow use of copy and assignment operator within a class. + * Should be placed under private. */ +#define IMG_DISALLOW_COPY_AND_ASSIGN(C) \ + C(const C&); \ + void operator=(const C&) +#endif + +#if defined(SUPPORT_PVR_VALGRIND) + #if !defined(__METAG) + #include "/usr/include/valgrind/memcheck.h" + + #define VALGRIND_HEADER_PRESENT + + #define VG_MARK_INITIALIZED(pvData,ui32Size) VALGRIND_MAKE_MEM_DEFINED(pvData,ui32Size) + #else + #define VG_MARK_INITIALIZED(pvData,ui32Size) do { } while(0) + #endif +#else + + #define VG_MARK_INITIALIZED(pvData,ui32Size) do { } while(0) +#endif + + +#endif /* #if !defined (__IMG_DEFS_H__) */ +/***************************************************************************** + End of file (IMG_DEFS.H) +*****************************************************************************/ + diff --git a/drivers/gpu/rogue_m/include/img_types.h b/drivers/gpu/rogue_m/include/img_types.h new file mode 100644 index 000000000000..54a752cd9aeb --- /dev/null +++ b/drivers/gpu/rogue_m/include/img_types.h @@ -0,0 +1,289 @@ +/*************************************************************************/ /*! +@File +@Title Global types for use by IMG APIs +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Defines type aliases for use by IMG APIs. +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef __IMG_TYPES_H__ +#define __IMG_TYPES_H__ +#if defined (__cplusplus) +extern "C" { +#endif + +/* To use C99 types and definitions, there are two special cases we need to + * cater for: + * + * - Visual Studio: in VS2010 or later, some standard headers are available, + * and MSVC has its own built-in sized types. We can define the C99 types + * in terms of these. + * + * - Linux kernel code: C99 sized types are defined in , but + * some other features (like macros for constants or printf format + * strings) are missing, so we need to fill in the gaps ourselves. + * + * For other cases (userspace code under Linux, Android or Neutrino, or + * firmware code), we can include the standard headers. + */ +#if defined(_MSC_VER) + #include "msvc_types.h" +#elif defined(LINUX) && defined(__KERNEL__) + #include "kernel_types.h" +#elif defined(LINUX) || defined(__METAG) || defined(__QNXNTO__) + #include /* NULL */ + #include /* intX_t/uintX_t, format specifiers */ + #include /* INT_MIN, etc */ +#else + #error C99 support not set up for this build +#endif + +/* number of bits in the units returned by sizeof */ +#define IMG_CHAR_BIT CHAR_BIT + +typedef unsigned int IMG_UINT, *IMG_PUINT; +typedef int IMG_INT, *IMG_PINT; + +typedef uint8_t IMG_UINT8, *IMG_PUINT8; +typedef uint8_t IMG_BYTE, *IMG_PBYTE; +typedef int8_t IMG_INT8, *IMG_PINT8; +typedef char IMG_CHAR, *IMG_PCHAR; +typedef IMG_CHAR const *IMG_PCCHAR; + +typedef uint16_t IMG_UINT16, *IMG_PUINT16; +typedef int16_t IMG_INT16, *IMG_PINT16; +typedef uint32_t IMG_UINT32, *IMG_PUINT32; +typedef int32_t IMG_INT32, *IMG_PINT32; + +typedef uint64_t IMG_UINT64, *IMG_PUINT64; +typedef int64_t IMG_INT64, *IMG_PINT64; +#define IMG_INT64_C(c) INT64_C(c) +#define IMG_UINT64_C(c) UINT64_C(c) +#define IMG_UINT64_FMTSPECX PRIX64 +#define IMG_UINT64_FMTSPEC PRIu64 + +#define IMG_UINT16_MAX UINT16_MAX +#define IMG_UINT32_MAX UINT32_MAX +#define IMG_UINT64_MAX UINT64_MAX + +typedef IMG_UINT16 const* IMG_PCUINT16; +typedef IMG_INT16 const* IMG_PCINT16; +typedef IMG_UINT32 const* IMG_PCUINT32; +typedef IMG_INT32 const* IMG_PCINT32; + +/* Linux kernel mode does not use floating point */ +typedef float IMG_FLOAT, *IMG_PFLOAT; +typedef double IMG_DOUBLE, *IMG_PDOUBLE; + +typedef union _IMG_UINT32_FLOAT_ +{ + IMG_UINT32 ui32; + IMG_FLOAT f; +} IMG_UINT32_FLOAT; + +typedef int IMG_SECURE_TYPE; + +typedef enum tag_img_bool +{ + IMG_FALSE = 0, + IMG_TRUE = 1, + IMG_FORCE_ALIGN = 0x7FFFFFFF +} IMG_BOOL, *IMG_PBOOL; +typedef IMG_BOOL const* IMG_PCBOOL; + +typedef void IMG_VOID, *IMG_PVOID; +typedef IMG_VOID const* IMG_PCVOID; + +typedef uintptr_t IMG_UINTPTR_T; +typedef size_t IMG_SIZE_T; + +#define IMG_SIZE_T_MAX SIZE_MAX + +#if defined(_MSC_VER) +#define IMG_SIZE_FMTSPEC "%Iu" +#define IMG_SIZE_FMTSPECX "%Ix" +#else +#define IMG_SIZE_FMTSPEC "%zu" +#define IMG_SIZE_FMTSPECX "%zx" +#endif + +typedef IMG_PVOID IMG_HANDLE; + +#define IMG_NULL NULL + +#if defined(LINUX) && defined(__KERNEL__) +/* prints the function name when used with printk */ +#define IMG_PFN_FMTSPEC "%pf" +#else +#define IMG_PFN_FMTSPEC "%p" +#endif + +/* services/stream ID */ +typedef IMG_UINT64 IMG_SID; + +/* Process IDs */ +typedef IMG_UINT32 IMG_PID; + + +/* + * Address types. + * All types used to refer to a block of memory are wrapped in structures + * to enforce some degree of type safety, i.e. a IMG_DEV_VIRTADDR cannot + * be assigned to a variable of type IMG_DEV_PHYADDR because they are not the + * same thing. + * + * There is an assumption that the system contains at most one non-cpu mmu, + * and a memory block is only mapped by the MMU once. + * + * Different devices could have offset views of the physical address space. + * + */ + + +/* + * + * +------------+ +------------+ +------------+ +------------+ + * | CPU | | DEV | | DEV | | DEV | + * +------------+ +------------+ +------------+ +------------+ + * | | | | + * | PVOID |IMG_DEV_VIRTADDR |IMG_DEV_VIRTADDR | + * | \-------------------/ | + * | | | + * +------------+ +------------+ | + * | MMU | | MMU | | + * +------------+ +------------+ | + * | | | + * | | | + * | | | + * +--------+ +---------+ +--------+ + * | Offset | | (Offset)| | Offset | + * +--------+ +---------+ +--------+ + * | | IMG_DEV_PHYADDR | + * | | | + * | | IMG_DEV_PHYADDR | + * +---------------------------------------------------------------------+ + * | System Address bus | + * +---------------------------------------------------------------------+ + * + */ + +typedef IMG_PVOID IMG_CPU_VIRTADDR; + +/* device virtual address */ +typedef struct _IMG_DEV_VIRTADDR +{ + IMG_UINT64 uiAddr; +#define IMG_CAST_TO_DEVVADDR_UINT(var) (IMG_UINT64)(var) + +} IMG_DEV_VIRTADDR; + +typedef IMG_UINT64 IMG_DEVMEM_SIZE_T; +typedef IMG_UINT64 IMG_DEVMEM_ALIGN_T; +typedef IMG_UINT64 IMG_DEVMEM_OFFSET_T; +typedef IMG_UINT32 IMG_DEVMEM_LOG2ALIGN_T; + +#define IMG_DEV_VIRTADDR_FMTSPEC "0x%010" IMG_UINT64_FMTSPECX +#define IMG_DEVMEM_SIZE_FMTSPEC "0x%010" IMG_UINT64_FMTSPECX +#define IMG_DEVMEM_ALIGN_FMTSPEC "0x%010" IMG_UINT64_FMTSPECX +#define IMG_DEVMEM_OFFSET_FMTSPEC "0x%010" IMG_UINT64_FMTSPECX + +/* cpu physical address */ +typedef struct _IMG_CPU_PHYADDR +{ +#if defined(UNDER_WDDM) + IMG_UINTPTR_T uiAddr; +#define IMG_CAST_TO_CPUPHYADDR_UINT(var) (IMG_UINTPTR_T)(var) +#else + IMG_UINT64 uiAddr; +#define IMG_CAST_TO_CPUPHYADDR_UINT(var) (IMG_UINT64)(var) +#endif +} IMG_CPU_PHYADDR; + +/* device physical address */ +typedef struct _IMG_DEV_PHYADDR +{ + IMG_UINT64 uiAddr; +} IMG_DEV_PHYADDR; + +/* system physical address */ +typedef struct _IMG_SYS_PHYADDR +{ +#if defined(UNDER_WDDM) + IMG_UINTPTR_T uiAddr; +#else + IMG_UINT64 uiAddr; +#endif +} IMG_SYS_PHYADDR; + +/* 32-bit device virtual address (e.g. MSVDX) */ +typedef struct _IMG_DEV_VIRTADDR32 +{ + IMG_UINT32 uiAddr; +#define IMG_CAST_TO_DEVVADDR_UINT32(var) (IMG_UINT32)(var) +} IMG_DEV_VIRTADDR32; + +/* + rectangle structure +*/ +typedef struct _IMG_RECT_ +{ + IMG_INT32 x0; + IMG_INT32 y0; + IMG_INT32 x1; + IMG_INT32 y1; +}IMG_RECT; + +typedef struct _IMG_RECT_16_ +{ + IMG_INT16 x0; + IMG_INT16 y0; + IMG_INT16 x1; + IMG_INT16 y1; +}IMG_RECT_16; + +#if defined (__cplusplus) +} +#endif + +#include "img_defs.h" + +#endif /* __IMG_TYPES_H__ */ +/****************************************************************************** + End of file (img_types.h) +******************************************************************************/ + diff --git a/drivers/gpu/rogue_m/include/kernel_types.h b/drivers/gpu/rogue_m/include/kernel_types.h new file mode 100644 index 000000000000..b53da1966b84 --- /dev/null +++ b/drivers/gpu/rogue_m/include/kernel_types.h @@ -0,0 +1,136 @@ +/*************************************************************************/ /*! +@Title C99-compatible types and definitions for Linux kernel code +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#include + +/* Limits of specified-width integer types */ + +/* S8_MIN, etc were added in kernel version 3.14. The other versions are for + * earlier kernels. They can be removed once older kernels don't need to be + * supported. + */ +#ifdef S8_MIN + #define INT8_MIN S8_MIN +#else + #define INT8_MIN (-128) +#endif + +#ifdef S8_MAX + #define INT8_MAX S8_MAX +#else + #define INT8_MAX 127 +#endif + +#ifdef U8_MAX + #define UINT8_MAX U8_MAX +#else + #define UINT8_MAX 0xFF +#endif + +#ifdef S16_MIN + #define INT16_MIN S16_MIN +#else + #define INT16_MIN (-32768) +#endif + +#ifdef S16_MAX + #define INT16_MAX S16_MAX +#else + #define INT16_MAX 32767 +#endif + +#ifdef U16_MAX + #define UINT16_MAX U16_MAX +#else + #define UINT16_MAX 0xFFFF +#endif + +#ifdef S32_MIN + #define INT32_MIN S32_MIN +#else + #define INT32_MIN (-2147483647 - 1) +#endif + +#ifdef S32_MAX + #define INT32_MAX S32_MAX +#else + #define INT32_MAX 2147483647 +#endif + +#ifdef U32_MAX + #define UINT32_MAX U32_MAX +#else + #define UINT32_MAX 0xFFFFFFFF +#endif + +#ifdef S64_MIN + #define INT64_MIN S64_MIN +#else + #define INT64_MIN (-9223372036854775807LL) +#endif + +#ifdef S64_MAX + #define INT64_MAX S64_MAX +#else + #define INT64_MAX 9223372036854775807LL +#endif + +#ifdef U64_MAX + #define UINT64_MAX U64_MAX +#else + #define UINT64_MAX 0xFFFFFFFFFFFFFFFFULL +#endif + +/* Macros for integer constants */ +#define INT8_C S8_C +#define UINT8_C U8_C +#define INT16_C S16_C +#define UINT16_C U16_C +#define INT32_C S32_C +#define UINT32_C U32_C +#define INT64_C S64_C +#define UINT64_C U64_C + +/* Format conversion of integer types */ +/* Only define PRIX64 for the moment, as this is the only format macro that + * img_types.h needs. + */ +#define PRIX64 "llX" diff --git a/drivers/gpu/rogue_m/include/lock_types.h b/drivers/gpu/rogue_m/include/lock_types.h new file mode 100644 index 000000000000..8caf86167079 --- /dev/null +++ b/drivers/gpu/rogue_m/include/lock_types.h @@ -0,0 +1,90 @@ +/*************************************************************************/ /*! +@File lock_types.h +@Title Locking types +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Locking specific enums, defines and structures +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef _LOCK_TYPES_H_ +#define _LOCK_TYPES_H_ + +/* In Linux kernel mode we are using the kernel mutex implementation directly + * with macros. This allows us to use the kernel lockdep feature for lock + * debugging. */ +#if defined(LINUX) && defined(__KERNEL__) + +#include +#include +/* The mutex is defined as a pointer to be compatible with the other code. This + * isn't ideal and usually you wouldn't do that in kernel code. */ +typedef struct mutex *POS_LOCK; +typedef atomic_t ATOMIC_T; + +#else /* defined(LINUX) && defined(__KERNEL__) */ + +typedef struct _OS_LOCK_ *POS_LOCK; +#if defined(LINUX) + typedef struct _OS_ATOMIC {IMG_INT counter;} ATOMIC_T; +#elif defined(__QNXNTO__) + typedef struct _OS_ATOMIC {IMG_INT counter;} ATOMIC_T; +#elif defined(_WIN32) + /* + * Dummy definition. WDDM doesn't use Services, but some headers + * still have to be shared. This is one such case. + */ + typedef struct _OS_ATOMIC {IMG_INT counter;} ATOMIC_T; +#else + #error "Please type-define an atomic lock for this environment" +#endif + +#endif /* defined(LINUX) && defined(__KERNEL__) */ + +typedef enum +{ + LOCK_TYPE_NONE = 0x00, + + LOCK_TYPE_MASK = 0x0F, + LOCK_TYPE_PASSIVE = 0x01, /* Passive level lock e.g. mutex, system may promote to dispatch */ + LOCK_TYPE_DISPATCH = 0x02, /* Dispatch level lock e.g. spin lock, may be used in ISR/MISR */ + + LOCK_TYPE_INSIST_FLAG = 0x80, /* When set caller can guarantee lock not used in ISR/MISR */ + LOCK_TYPE_PASSIVE_ONLY = LOCK_TYPE_INSIST_FLAG | LOCK_TYPE_PASSIVE + +} LOCK_TYPE; +#endif /* _LOCK_TYPES_H_ */ diff --git a/drivers/gpu/rogue_m/include/pdumpdefs.h b/drivers/gpu/rogue_m/include/pdumpdefs.h new file mode 100644 index 000000000000..e6c7f07a077f --- /dev/null +++ b/drivers/gpu/rogue_m/include/pdumpdefs.h @@ -0,0 +1,202 @@ +/*************************************************************************/ /*! +@File +@Title PDUMP definitions header +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description PDUMP definitions header +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#if !defined (__PDUMPDEFS_H__) +#define __PDUMPDEFS_H__ + +/*! PDump Pixel Format Enumeration */ +typedef enum _PDUMP_PIXEL_FORMAT_ +{ + PVRSRV_PDUMP_PIXEL_FORMAT_UNSUPPORTED = 0, + PVRSRV_PDUMP_PIXEL_FORMAT_RGB8 = 1, + PVRSRV_PDUMP_PIXEL_FORMAT_RGB332 = 2, + PVRSRV_PDUMP_PIXEL_FORMAT_KRGB555 = 3, + PVRSRV_PDUMP_PIXEL_FORMAT_RGB565 = 4, + PVRSRV_PDUMP_PIXEL_FORMAT_ARGB4444 = 5, + PVRSRV_PDUMP_PIXEL_FORMAT_ARGB1555 = 6, + PVRSRV_PDUMP_PIXEL_FORMAT_RGB888 = 7, + PVRSRV_PDUMP_PIXEL_FORMAT_ARGB8888 = 8, + PVRSRV_PDUMP_PIXEL_FORMAT_YUV8 = 9, +// PVRSRV_PDUMP_PIXEL_FORMAT_AYUV4444 = 10, + PVRSRV_PDUMP_PIXEL_FORMAT_VY0UY1_8888 = 11, + PVRSRV_PDUMP_PIXEL_FORMAT_UY0VY1_8888 = 12, + PVRSRV_PDUMP_PIXEL_FORMAT_Y0UY1V_8888 = 13, + PVRSRV_PDUMP_PIXEL_FORMAT_Y0VY1U_8888 = 14, + PVRSRV_PDUMP_PIXEL_FORMAT_YUV888 = 15, + PVRSRV_PDUMP_PIXEL_FORMAT_UYVY10101010 = 16, + PVRSRV_PDUMP_PIXEL_FORMAT_VYAUYA8888 = 17, + PVRSRV_PDUMP_PIXEL_FORMAT_AYUV8888 = 18, + PVRSRV_PDUMP_PIXEL_FORMAT_AYUV2101010 = 19, + PVRSRV_PDUMP_PIXEL_FORMAT_YUV101010 = 20, + PVRSRV_PDUMP_PIXEL_FORMAT_PL12Y8 = 21, + PVRSRV_PDUMP_PIXEL_FORMAT_YUV_IMC2 = 22, + PVRSRV_PDUMP_PIXEL_FORMAT_YUV_YV12 = 23, + PVRSRV_PDUMP_PIXEL_FORMAT_YUV_PL8 = 24, + PVRSRV_PDUMP_PIXEL_FORMAT_YUV_PL12 = 25, + PVRSRV_PDUMP_PIXEL_FORMAT_422PL12YUV8 = 26, + PVRSRV_PDUMP_PIXEL_FORMAT_420PL12YUV8 = 27, + PVRSRV_PDUMP_PIXEL_FORMAT_PL12Y10 = 28, + PVRSRV_PDUMP_PIXEL_FORMAT_422PL12YUV10 = 29, + PVRSRV_PDUMP_PIXEL_FORMAT_420PL12YUV10 = 30, + PVRSRV_PDUMP_PIXEL_FORMAT_ABGR8888 = 31, + PVRSRV_PDUMP_PIXEL_FORMAT_BGRA8888 = 32, + PVRSRV_PDUMP_PIXEL_FORMAT_ARGB8332 = 33, + PVRSRV_PDUMP_PIXEL_FORMAT_RGB555 = 34, + PVRSRV_PDUMP_PIXEL_FORMAT_F16 = 35, + PVRSRV_PDUMP_PIXEL_FORMAT_F32 = 36, + PVRSRV_PDUMP_PIXEL_FORMAT_L16 = 37, + PVRSRV_PDUMP_PIXEL_FORMAT_L32 = 38, + PVRSRV_PDUMP_PIXEL_FORMAT_RGBA8888 = 39, + PVRSRV_PDUMP_PIXEL_FORMAT_ABGR4444 = 40, + PVRSRV_PDUMP_PIXEL_FORMAT_RGBA4444 = 41, + PVRSRV_PDUMP_PIXEL_FORMAT_BGRA4444 = 42, + PVRSRV_PDUMP_PIXEL_FORMAT_ABGR1555 = 43, + PVRSRV_PDUMP_PIXEL_FORMAT_RGBA5551 = 44, + PVRSRV_PDUMP_PIXEL_FORMAT_BGRA5551 = 45, + PVRSRV_PDUMP_PIXEL_FORMAT_BGR565 = 46, + PVRSRV_PDUMP_PIXEL_FORMAT_A8 = 47, + PVRSRV_PDUMP_PIXEL_FORMAT_F16F16F16F16 = 49, + PVRSRV_PDUMP_PIXEL_FORMAT_A4 = 50, + PVRSRV_PDUMP_PIXEL_FORMAT_ARGB2101010 = 51, + PVRSRV_PDUMP_PIXEL_FORMAT_RSGSBS888 = 52, + PVRSRV_PDUMP_PIXEL_FORMAT_F32F32F32F32 = 53, + PVRSRV_PDUMP_PIXEL_FORMAT_F16F16 = 54, + PVRSRV_PDUMP_PIXEL_FORMAT_F32F32 = 55, + PVRSRV_PDUMP_PIXEL_FORMAT_F16F16F16 = 56, + PVRSRV_PDUMP_PIXEL_FORMAT_F32F32F32 = 57, + PVRSRV_PDUMP_PIXEL_FORMAT_U8 = 58, + PVRSRV_PDUMP_PIXEL_FORMAT_U8U8 = 59, + PVRSRV_PDUMP_PIXEL_FORMAT_U16 = 60, + PVRSRV_PDUMP_PIXEL_FORMAT_U16U16 = 61, + PVRSRV_PDUMP_PIXEL_FORMAT_U16U16U16U16 = 62, + PVRSRV_PDUMP_PIXEL_FORMAT_U32 = 63, + PVRSRV_PDUMP_PIXEL_FORMAT_U32U32 = 64, + PVRSRV_PDUMP_PIXEL_FORMAT_U32U32U32U32 = 65, + PVRSRV_PDUMP_PIXEL_FORMAT_YUV_YV32 = 66, + + PVRSRV_PDUMP_PIXEL_FORMAT_FORCE_I32 = 0x7fffffff + +} PDUMP_PIXEL_FORMAT; + +/*! PDump addrmode */ +#define PVRSRV_PDUMP_ADDRMODE_MEMFORMAT_SHIFT 0 +#define PVRSRV_PDUMP_ADDRMODE_MEMFORMAT_MASK 0x000000FF + +#define PVRSRV_PDUMP_ADDRMODE_STRIDESENSE_SHIFT 8 +#define PVRSRV_PDUMP_ADDRMODE_STRIDESENSE_NEGATIVE (1 << PVRSRV_PDUMP_ADDRMODE_STRIDESENSE_SHIFT) + +#define PVRSRV_PDUMP_ADDRMODE_BIFTILE_MODE_SHIFT 12 +#define PVRSRV_PDUMP_ADDRMODE_BIFTILE_MODE_MASK 0x000FF000 + +#define PVRSRV_PDUMP_ADDRMODE_FBCMODE_SHIFT 20 +#define PVRSRV_PDUMP_ADDRMODE_FBCMODE_MASK 0x00F00000 + +#define PVRSRV_PDUMP_ADDRMODE_FBCDECOR_SHIFT 24 + +#define PVRSRV_PDUMP_ADDRMODE_FBCCOMPAT_SHIFT 28 +#define PVRSRV_PDUMP_ADDRMODE_FBCCOMPAT_MASK 0xF0000000 + +#define PVRSRV_PDUMP_ADDRMODE_MEMFORMAT_STRIDE (0 << PVRSRV_PDUMP_ADDRMODE_MEMFORMAT_SHIFT) +#define PVRSRV_PDUMP_ADDRMODE_MEMFORMAT_BIFTILE_STRIDE1 (1 << PVRSRV_PDUMP_ADDRMODE_MEMFORMAT_SHIFT) +#define PVRSRV_PDUMP_ADDRMODE_MEMFORMAT_BIFTILE_STRIDE2 (2 << PVRSRV_PDUMP_ADDRMODE_MEMFORMAT_SHIFT) +#define PVRSRV_PDUMP_ADDRMODE_MEMFORMAT_BIFTILE_STRIDE3 (3 << PVRSRV_PDUMP_ADDRMODE_MEMFORMAT_SHIFT) +#define PVRSRV_PDUMP_ADDRMODE_MEMFORMAT_BIFTILE_STRIDE4 (4 << PVRSRV_PDUMP_ADDRMODE_MEMFORMAT_SHIFT) +#define PVRSRV_PDUMP_ADDRMODE_MEMFORMAT_BIFTILE_STRIDE5 (5 << PVRSRV_PDUMP_ADDRMODE_MEMFORMAT_SHIFT) +#define PVRSRV_PDUMP_ADDRMODE_MEMFORMAT_BIFTILE_STRIDE6 (6 << PVRSRV_PDUMP_ADDRMODE_MEMFORMAT_SHIFT) +#define PVRSRV_PDUMP_ADDRMODE_MEMFORMAT_BIFTILE_STRIDE7 (7 << PVRSRV_PDUMP_ADDRMODE_MEMFORMAT_SHIFT) +#define PVRSRV_PDUMP_ADDRMODE_MEMFORMAT_TWIDDLED (9 << PVRSRV_PDUMP_ADDRMODE_MEMFORMAT_SHIFT) +#define PVRSRV_PDUMP_ADDRMODE_MEMFORMAT_PAGETILED (11 << PVRSRV_PDUMP_ADDRMODE_MEMFORMAT_SHIFT) + +#define PVRSRV_PDUMP_ADDRMODE_FBCMODE_NONE (0 << PVRSRV_PDUMP_ADDRMODE_FBCMODE_SHIFT) +#define PVRSRV_PDUMP_ADDRMODE_FBCMODE_8X8_DIRECT (1 << PVRSRV_PDUMP_ADDRMODE_FBCMODE_SHIFT) +#define PVRSRV_PDUMP_ADDRMODE_FBCMODE_16X4_DIRECT (2 << PVRSRV_PDUMP_ADDRMODE_FBCMODE_SHIFT) +#define PVRSRV_PDUMP_ADDRMODE_FBCMODE_32X2_DIRECT (3 << PVRSRV_PDUMP_ADDRMODE_FBCMODE_SHIFT) +#define PVRSRV_PDUMP_ADDRMODE_FBCMODE_8X8_INDIRECT (4 << PVRSRV_PDUMP_ADDRMODE_FBCMODE_SHIFT) +#define PVRSRV_PDUMP_ADDRMODE_FBCMODE_16X4_INDIRECT (5 << PVRSRV_PDUMP_ADDRMODE_FBCMODE_SHIFT) +#define PVRSRV_PDUMP_ADDRMODE_FBCMODE_8X8_INDIRECT_4TILE (6 << PVRSRV_PDUMP_ADDRMODE_FBCMODE_SHIFT) +#define PVRSRV_PDUMP_ADDRMODE_FBCMODE_16X4_INDIRECT_4TILE (7 << PVRSRV_PDUMP_ADDRMODE_FBCMODE_SHIFT) + +#define PVRSRV_PDUMP_ADDRMODE_FBC_DECOR (1 << PVRSRV_PDUMP_ADDRMODE_FBCDECOR_SHIFT) + +#define PVRSRV_PDUMP_ADDRMODE_FBCCOMPAT_BASE (1 << PVRSRV_PDUMP_ADDRMODE_FBCCOMPAT_SHIFT) +#define PVRSRV_PDUMP_ADDRMODE_FBCCOMPAT_ENHANCED (2 << PVRSRV_PDUMP_ADDRMODE_FBCCOMPAT_SHIFT) +#define PVRSRV_PDUMP_ADDRMODE_FBCCOMPAT_V2 (3 << PVRSRV_PDUMP_ADDRMODE_FBCCOMPAT_SHIFT) + +/*! PDump Poll Operator */ +typedef enum _PDUMP_POLL_OPERATOR +{ + PDUMP_POLL_OPERATOR_EQUAL = 0, + PDUMP_POLL_OPERATOR_LESS = 1, + PDUMP_POLL_OPERATOR_LESSEQUAL = 2, + PDUMP_POLL_OPERATOR_GREATER = 3, + PDUMP_POLL_OPERATOR_GREATEREQUAL = 4, + PDUMP_POLL_OPERATOR_NOTEQUAL = 5, +} PDUMP_POLL_OPERATOR; + + +#define PVRSRV_PDUMP_MAX_FILENAME_SIZE 75 /*!< Max length of a pdump log file name */ +#define PVRSRV_PDUMP_MAX_COMMENT_SIZE 350 /*!< Max length of a pdump comment */ + +/*! + PDump MMU type + (Maps to values listed in "PowerVR Tools.Pdump2 Script Functions.doc" Sec 2.13) +*/ +typedef enum +{ + PDUMP_MMU_TYPE_4KPAGE_32BIT_STDTILE = 1, + PDUMP_MMU_TYPE_VARPAGE_32BIT_STDTILE = 2, + PDUMP_MMU_TYPE_4KPAGE_36BIT_EXTTILE = 3, + PDUMP_MMU_TYPE_4KPAGE_32BIT_EXTTILE = 4, + PDUMP_MMU_TYPE_4KPAGE_36BIT_STDTILE = 5, + PDUMP_MMU_TYPE_VARPAGE_40BIT = 6, + PDUMP_MMU_TYPE_VIDEO_40BIT_STDTILE = 7, + PDUMP_MMU_TYPE_VIDEO_40BIT_EXTTILE = 8, + PDUMP_MMU_TYPE_LAST +} PDUMP_MMU_TYPE; + +#endif /* __PDUMPDEFS_H__ */ + +/***************************************************************************** + End of file (pdumpdefs.h) +*****************************************************************************/ + diff --git a/drivers/gpu/rogue_m/include/pvr_debug.h b/drivers/gpu/rogue_m/include/pvr_debug.h new file mode 100644 index 000000000000..ec32e5155ed8 --- /dev/null +++ b/drivers/gpu/rogue_m/include/pvr_debug.h @@ -0,0 +1,478 @@ +/*************************************************************************/ /*! +@File +@Title PVR Debug Declarations +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Provides debug functionality +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef __PVR_DEBUG_H__ +#define __PVR_DEBUG_H__ + +#include "img_types.h" +#include "pvrsrv_error.h" + + +#if defined(_MSC_VER) +# define MSC_SUPPRESS_4127 __pragma(warning(suppress:4127)) +#else +# define MSC_SUPPRESS_4127 +#endif + +#if defined (__cplusplus) +extern "C" { +#endif + +#define PVR_MAX_DEBUG_MESSAGE_LEN (512) /*!< Max length of a Debug Message */ + +/* These are privately used by pvr_debug, use the PVR_DBG_ defines instead */ +#define DBGPRIV_FATAL 0x001UL /*!< Debug-Fatal. Privately used by pvr_debug. */ +#define DBGPRIV_ERROR 0x002UL /*!< Debug-Error. Privately used by pvr_debug. */ +#define DBGPRIV_WARNING 0x004UL /*!< Debug-Warning. Privately used by pvr_debug. */ +#define DBGPRIV_MESSAGE 0x008UL /*!< Debug-Message. Privately used by pvr_debug. */ +#define DBGPRIV_VERBOSE 0x010UL /*!< Debug-Verbose. Privately used by pvr_debug. */ +#define DBGPRIV_CALLTRACE 0x020UL /*!< Debug-CallTrace. Privately used by pvr_debug. */ +#define DBGPRIV_ALLOC 0x040UL /*!< Debug-Alloc. Privately used by pvr_debug. */ +#define DBGPRIV_BUFFERED 0x080UL /*!< Debug-Buffered. Privately used by pvr_debug. */ +#define DBGPRIV_DEBUG 0x100UL /*!< Debug-AdHoc-Debug. Never submitted. Privately used by pvr_debug. */ +#define DBGPRIV_DBGDRV_MESSAGE 0x200UL /*!< Debug-DbgDrivMessage. Privately used by pvr_debug. */ +#define DBGPRIV_LAST 0x200UL /*!< Always set to highest mask value. Privately used by pvr_debug. */ + + +#if !defined(PVRSRV_NEED_PVR_ASSERT) && defined(DEBUG) +#define PVRSRV_NEED_PVR_ASSERT +#endif + +//zxl: Force open debug info. gPVRDebugLevel is defined in pvr_debug.c +//#if defined(PVRSRV_NEED_PVR_ASSERT) && !defined(PVRSRV_NEED_PVR_DPF) +#define PVRSRV_NEED_PVR_DPF +//#endif + +#if !defined(PVRSRV_NEED_PVR_TRACE) && (defined(DEBUG) || defined(TIMING)) +#define PVRSRV_NEED_PVR_TRACE +#endif + +#if defined(__KERNEL__) + IMG_IMPORT const IMG_CHAR *PVRSRVGetErrorStringKM(PVRSRV_ERROR eError); +# define PVRSRVGETERRORSTRING PVRSRVGetErrorStringKM +#else + IMG_IMPORT const IMG_CHAR *PVRSRVGetErrorString(PVRSRV_ERROR eError); +# define PVRSRVGETERRORSTRING PVRSRVGetErrorString +#endif + +/* PVR_ASSERT() and PVR_DBG_BREAK handling */ + +#if defined(PVRSRV_NEED_PVR_ASSERT) + +/* Unfortunately the klocworks static analysis checker doesn't understand our + * ASSERT macros. Thus it reports lots of false positive. Defining our Assert + * macros in a special way when the code is analysed by klocworks avoids + * them. */ +#if defined(__KLOCWORK__) + #define PVR_ASSERT(x) do { if (!(x)) abort(); } while (0) +#else /* ! __KLOCWORKS__ */ + +#if defined(_WIN32) +#define PVR_ASSERT(expr) do \ + { \ + MSC_SUPPRESS_4127 \ + if (!(expr)) \ + { \ + PVRSRVDebugPrintf(DBGPRIV_FATAL, __FILE__, __LINE__,\ + "*** Debug assertion failed!"); \ + __debugbreak(); \ + } \ + MSC_SUPPRESS_4127 \ + } while (0) + +#else + +#if defined(LINUX) && defined(__KERNEL__) +#include +#include + +/* In Linux kernel mode, use BUG() directly. This produces the correct + filename and line number in the panic message. */ +#define PVR_ASSERT(EXPR) do \ + { \ + if (!(EXPR)) \ + { \ + PVRSRVDebugPrintf(DBGPRIV_FATAL, __FILE__, __LINE__, \ + "Debug assertion failed!"); \ + BUG(); \ + } \ + } while (0) + +#else /* defined(LINUX) && defined(__KERNEL__) */ + +IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVDebugAssertFail(const IMG_CHAR *pszFile, + IMG_UINT32 ui32Line, + const IMG_CHAR *pszAssertion) +#if defined(__GNUC__) + __attribute__((noreturn)) +#endif + ; + +#if defined(_MSC_VER) +/* This alternate definition is for MSVC, which warns about do {} while (0) */ +#define PVR_ASSERT(EXPR) MSC_SUPPRESS_4127 \ + if (!(EXPR)) PVRSRVDebugAssertFail(__FILE__, __LINE__) +#else +#define PVR_ASSERT(EXPR) do \ + { \ + if (!(EXPR)) \ + PVRSRVDebugAssertFail(__FILE__, __LINE__, #EXPR); \ + } while (0) +#endif + +#endif /* defined(LINUX) && defined(__KERNEL__) */ +#endif /* __KLOCWORKS__ */ +#endif /* defined(PVRSRV_NEED_PVR_ASSERT)*/ + +#if defined(__KLOCWORK__) + #define PVR_DBG_BREAK do { abort(); } while (0) +#else + #if defined (WIN32) + #define PVR_DBG_BREAK __debugbreak(); /*!< Implementation of PVR_DBG_BREAK for (non-WinCE) Win32 */ + #else + #if defined(PVR_DBG_BREAK_ASSERT_FAIL) + /*!< Implementation of PVR_DBG_BREAK that maps onto PVRSRVDebugAssertFail */ + #if defined(_WIN32) + #define PVR_DBG_BREAK DBG_BREAK + #else + #if defined(LINUX) && defined(__KERNEL__) + #define PVR_DBG_BREAK BUG() + #else + #define PVR_DBG_BREAK PVRSRVDebugAssertFail(__FILE__, __LINE__, "PVR_DBG_BREAK") + #endif + #endif + #else + /*!< Null Implementation of PVR_DBG_BREAK (does nothing) */ + #define PVR_DBG_BREAK + #endif + #endif +#endif + + +#else /* defined(PVRSRV_NEED_PVR_ASSERT) */ + /* Unfortunately the klocworks static analysis checker doesn't understand our + * ASSERT macros. Thus it reports lots of false positive. Defining our Assert + * macros in a special way when the code is analysed by klocworks avoids + * them. */ + #if defined(__KLOCWORK__) + #define PVR_ASSERT(EXPR) do { if (!(EXPR)) abort(); } while (0) + #else + #define PVR_ASSERT(EXPR) (IMG_VOID)(EXPR) /*!< Null Implementation of PVR_ASSERT (does nothing) */ + #endif + + #define PVR_DBG_BREAK /*!< Null Implementation of PVR_DBG_BREAK (does nothing) */ + +#endif /* defined(PVRSRV_NEED_PVR_ASSERT) */ + + +/* PVR_DPF() handling */ + +#if defined(PVRSRV_NEED_PVR_DPF) + + /* New logging mechanism */ + #define PVR_DBG_FATAL DBGPRIV_FATAL + #define PVR_DBG_ERROR DBGPRIV_ERROR + #define PVR_DBG_WARNING DBGPRIV_WARNING + #define PVR_DBG_MESSAGE DBGPRIV_MESSAGE + #define PVR_DBG_VERBOSE DBGPRIV_VERBOSE + #define PVR_DBG_CALLTRACE DBGPRIV_CALLTRACE + #define PVR_DBG_ALLOC DBGPRIV_ALLOC + #define PVR_DBG_BUFFERED DBGPRIV_BUFFERED + #define PVR_DBG_DEBUG DBGPRIV_DEBUG + #define PVR_DBGDRIV_MESSAGE DBGPRIV_DBGDRV_MESSAGE + + /* These levels are always on with PVRSRV_NEED_PVR_DPF */ + #define __PVR_DPF_0x001UL(...) PVRSRVDebugPrintf(DBGPRIV_FATAL, __VA_ARGS__) + #define __PVR_DPF_0x002UL(...) PVRSRVDebugPrintf(DBGPRIV_ERROR, __VA_ARGS__) + #define __PVR_DPF_0x080UL(...) PVRSRVDebugPrintf(DBGPRIV_BUFFERED, __VA_ARGS__) + + /* + The AdHoc-Debug level is only supported when enabled in the local + build environment and may need to be used in both debug and release + builds. An error is generated in the formal build if it is checked in. + */ +#if defined(PVR_DPF_ADHOC_DEBUG_ON) + #define __PVR_DPF_0x100UL(...) PVRSRVDebugPrintf(DBGPRIV_DEBUG, __VA_ARGS__) +#else + /* Use an undefined token here to stop compilation dead in the offending module */ + #define __PVR_DPF_0x100UL(...) __ERROR__PVR_DBG_DEBUG_is_in_use_but_has_not_been_enabled__Note_Debug_DPF_must_not_be_checked_in__Define_PVR_DPF_ADHOC_DEBUG_ON_for_testing +#endif + + /* Some are compiled out completely in release builds */ +#if defined(DEBUG) + #define __PVR_DPF_0x004UL(...) PVRSRVDebugPrintf(DBGPRIV_WARNING, __VA_ARGS__) + #define __PVR_DPF_0x008UL(...) PVRSRVDebugPrintf(DBGPRIV_MESSAGE, __VA_ARGS__) + #define __PVR_DPF_0x010UL(...) PVRSRVDebugPrintf(DBGPRIV_VERBOSE, __VA_ARGS__) + #define __PVR_DPF_0x020UL(...) PVRSRVDebugPrintf(DBGPRIV_CALLTRACE, __VA_ARGS__) + #define __PVR_DPF_0x040UL(...) PVRSRVDebugPrintf(DBGPRIV_ALLOC, __VA_ARGS__) + #define __PVR_DPF_0x200UL(...) PVRSRVDebugPrintf(DBGPRIV_DBGDRV_MESSAGE, __VA_ARGS__) +#else + #define __PVR_DPF_0x004UL(...) + #define __PVR_DPF_0x008UL(...) + #define __PVR_DPF_0x010UL(...) + #define __PVR_DPF_0x020UL(...) + #define __PVR_DPF_0x040UL(...) + #define __PVR_DPF_0x200UL(...) +#endif + + /* Translate the different log levels to separate macros + * so they can each be compiled out. + */ +//zxl: Force open debug info. gPVRDebugLevel is defined in pvr_debug.c +#if 1 + #define __PVR_DPF(lvl, ...) __PVR_DPF_ ## lvl (__FILE__, __LINE__, __VA_ARGS__) +#else + #define __PVR_DPF(lvl, ...) __PVR_DPF_ ## lvl ("", 0, __VA_ARGS__) +#endif + + /* Get rid of the double bracketing */ + #define PVR_DPF(x) __PVR_DPF x + + #define PVR_LOG_ERROR(_rc, _call) \ + PVR_DPF((PVR_DBG_ERROR, "%s() failed (%s) in %s()", _call, PVRSRVGETERRORSTRING(_rc), __func__)); + + #define PVR_LOG_IF_ERROR(_rc, _call) do \ + { if (_rc != PVRSRV_OK) \ + PVR_DPF((PVR_DBG_ERROR, "%s() failed (%s) in %s()", _call, PVRSRVGETERRORSTRING(_rc), __func__)); \ + MSC_SUPPRESS_4127\ + } while (0) + + + #define PVR_LOGR_IF_ERROR(_rc, _call) do \ + { if (_rc != PVRSRV_OK) { \ + PVR_DPF((PVR_DBG_ERROR, "%s() failed (%s) in %s()", _call, PVRSRVGETERRORSTRING(_rc), __func__)); \ + return (_rc); }\ + MSC_SUPPRESS_4127\ + } while (0) + + #define PVR_LOGRN_IF_ERROR(_rc, _call) do \ + { if (_rc != PVRSRV_OK) { \ + PVR_DPF((PVR_DBG_ERROR, "%s() failed (%s) in %s()", _call, PVRSRVGETERRORSTRING(_rc), __func__)); \ + return; }\ + MSC_SUPPRESS_4127\ + } while (0) + + #define PVR_LOGG_IF_ERROR(_rc, _call, _go) do \ + { if (_rc != PVRSRV_OK) { \ + PVR_DPF((PVR_DBG_ERROR, "%s() failed (%s) in %s()", _call, PVRSRVGETERRORSTRING(_rc), __func__)); \ + goto _go; }\ + MSC_SUPPRESS_4127\ + } while (0) + + #define PVR_LOG_IF_FALSE(_expr, _msg) do \ + { if (!(_expr)) \ + PVR_DPF((PVR_DBG_ERROR, "%s in %s()", _msg, __func__)); \ + MSC_SUPPRESS_4127\ + } while (0) + + #define PVR_LOGR_IF_FALSE(_expr, _msg, _rc) do \ + { if (!(_expr)) { \ + PVR_DPF((PVR_DBG_ERROR, "%s in %s()", _msg, __func__)); \ + return (_rc); }\ + MSC_SUPPRESS_4127\ + } while (0) + + #define PVR_LOGG_IF_FALSE(_expr, _msg, _go) do \ + { if (!(_expr)) { \ + PVR_DPF((PVR_DBG_ERROR, "%s in %s()", _msg, __func__)); \ + goto _go; }\ + MSC_SUPPRESS_4127\ + } while (0) + +IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVDebugPrintf(IMG_UINT32 ui32DebugLevel, + const IMG_CHAR *pszFileName, + IMG_UINT32 ui32Line, + const IMG_CHAR *pszFormat, + ...) IMG_FORMAT_PRINTF(4, 5); + +IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVDebugPrintfDumpCCB(void); + +#else /* defined(PVRSRV_NEED_PVR_DPF) */ + + #define PVR_DPF(X) /*!< Null Implementation of PowerVR Debug Printf (does nothing) */ + + #define PVR_LOG_ERROR(_rc, _call) (void)(_rc) + #define PVR_LOG_IF_ERROR(_rc, _call) (void)(_rc) + #define PVR_LOGR_IF_ERROR(_rc, _call) do { if (_rc != PVRSRV_OK) { return (_rc); } MSC_SUPPRESS_4127 } while(0) + #define PVR_LOGRN_IF_ERROR(_rc, _call) do { if (_rc != PVRSRV_OK) { return; } MSC_SUPPRESS_4127 } while(0) + #define PVR_LOGG_IF_ERROR(_rc, _call, _go) do { if (_rc != PVRSRV_OK) { goto _go; } MSC_SUPPRESS_4127 } while(0) + + #define PVR_LOG_IF_FALSE(_expr, _msg) (void)(_expr) + #define PVR_LOGR_IF_FALSE(_expr, _msg, _rc) do { if (!(_expr)) { return (_rc); } MSC_SUPPRESS_4127 } while(0) + #define PVR_LOGG_IF_FALSE(_expr, _msg, _go) do { if (!(_expr)) { goto _go; } MSC_SUPPRESS_4127 } while(0) + + #undef PVR_DPF_FUNCTION_TRACE_ON + +#endif /* defined(PVRSRV_NEED_PVR_DPF) */ + + +#if defined(PVR_DPF_FUNCTION_TRACE_ON) + + #define PVR_DPF_ENTERED \ + PVR_DPF((PVR_DBG_CALLTRACE, "--> %s:%d entered", __func__, __LINE__)) + + #define PVR_DPF_ENTERED1(p1) \ + PVR_DPF((PVR_DBG_CALLTRACE, "--> %s:%d entered (0x%lx)", __func__, __LINE__, ((unsigned long)p1))) + + #define PVR_DPF_RETURN_RC(a) \ + do { int _r = (a); PVR_DPF((PVR_DBG_CALLTRACE, "-< %s:%d returned %d", __func__, __LINE__, (_r))); return (_r); MSC_SUPPRESS_4127 } while (0) + + #define PVR_DPF_RETURN_RC1(a,p1) \ + do { int _r = (a); PVR_DPF((PVR_DBG_CALLTRACE, "-< %s:%d returned %d (0x%lx)", __func__, __LINE__, (_r), ((unsigned long)p1))); return (_r); MSC_SUPPRESS_4127 } while (0) + + #define PVR_DPF_RETURN_VAL(a) \ + do { PVR_DPF((PVR_DBG_CALLTRACE, "-< %s:%d returned with value", __func__, __LINE__ )); return (a); MSC_SUPPRESS_4127 } while (0) + + #define PVR_DPF_RETURN_OK \ + do { PVR_DPF((PVR_DBG_CALLTRACE, "-< %s:%d returned ok", __func__, __LINE__)); return PVRSRV_OK; MSC_SUPPRESS_4127 } while (0) + + #define PVR_DPF_RETURN \ + do { PVR_DPF((PVR_DBG_CALLTRACE, "-< %s:%d returned", __func__, __LINE__)); return; MSC_SUPPRESS_4127 } while (0) + + #if !defined(DEBUG) + #error PVR DPF Function trace enabled in release build, rectify + #endif + +#else /* defined(PVR_DPF_FUNCTION_TRACE_ON) */ + + #define PVR_DPF_ENTERED + #define PVR_DPF_ENTERED1(p1) + #define PVR_DPF_RETURN_RC(a) return (a) + #define PVR_DPF_RETURN_RC1(a,p1) return (a) + #define PVR_DPF_RETURN_VAL(a) return (a) + #define PVR_DPF_RETURN_OK return PVRSRV_OK + #define PVR_DPF_RETURN return + +#endif /* defined(PVR_DPF_FUNCTION_TRACE_ON) */ + + +/* PVR_TRACE() handling */ + +#if defined(PVRSRV_NEED_PVR_TRACE) + + #define PVR_TRACE(X) PVRSRVTrace X /*!< PowerVR Debug Trace Macro */ + /* Empty string implementation that is -O0 build friendly */ + #define PVR_TRACE_EMPTY_LINE() PVR_TRACE(("%s", "")) + +IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVTrace(const IMG_CHAR* pszFormat, ... ) + IMG_FORMAT_PRINTF(1, 2); + +#else /* defined(PVRSRV_NEED_PVR_TRACE) */ + /*! Null Implementation of PowerVR Debug Trace Macro (does nothing) */ + #define PVR_TRACE(X) + +#endif /* defined(PVRSRV_NEED_PVR_TRACE) */ + + +#if defined(PVRSRV_NEED_PVR_ASSERT) +#ifdef INLINE_IS_PRAGMA +#pragma inline(TRUNCATE_64BITS_TO_32BITS) +#endif + INLINE static IMG_UINT32 TRUNCATE_64BITS_TO_32BITS(IMG_UINT64 uiInput) + { + IMG_UINT32 uiTruncated; + + uiTruncated = (IMG_UINT32)uiInput; + PVR_ASSERT(uiInput == uiTruncated); + return uiTruncated; + } + + +#ifdef INLINE_IS_PRAGMA +#pragma inline(TRUNCATE_64BITS_TO_SIZE_T) +#endif + INLINE static IMG_SIZE_T TRUNCATE_64BITS_TO_SIZE_T(IMG_UINT64 uiInput) + { + IMG_SIZE_T uiTruncated; + + uiTruncated = (IMG_SIZE_T)uiInput; + PVR_ASSERT(uiInput == uiTruncated); + return uiTruncated; + } + + +#ifdef INLINE_IS_PRAGMA +#pragma inline(TRUNCATE_SIZE_T_TO_32BITS) +#endif + INLINE static IMG_UINT32 TRUNCATE_SIZE_T_TO_32BITS(IMG_SIZE_T uiInput) + { + IMG_UINT32 uiTruncated; + + uiTruncated = (IMG_UINT32)uiInput; + PVR_ASSERT(uiInput == uiTruncated); + return uiTruncated; + } + + +#else /* defined(PVRSRV_NEED_PVR_ASSERT) */ + #define TRUNCATE_64BITS_TO_32BITS(expr) ((IMG_UINT32)(expr)) + #define TRUNCATE_64BITS_TO_SIZE_T(expr) ((IMG_SIZE_T)(expr)) + #define TRUNCATE_SIZE_T_TO_32BITS(expr) ((IMG_UINT32)(expr)) +#endif /* defined(PVRSRV_NEED_PVR_ASSERT) */ + +/* Macros used to trace calls */ +#if defined(DEBUG) + #define PVR_DBG_FILELINE , __FILE__, __LINE__ + #define PVR_DBG_FILELINE_PARAM , const IMG_CHAR *pszaFile, IMG_UINT32 ui32Line + #define PVR_DBG_FILELINE_ARG , pszaFile, ui32Line + #define PVR_DBG_FILELINE_FMT " %s:%u" + #define PVR_DBG_FILELINE_UNREF() do { PVR_UNREFERENCED_PARAMETER(pszaFile); \ + PVR_UNREFERENCED_PARAMETER(ui32Line); } while(0) +#else + #define PVR_DBG_FILELINE + #define PVR_DBG_FILELINE_PARAM + #define PVR_DBG_FILELINE_ARG + #define PVR_DBG_FILELINE_FMT + #define PVR_DBG_FILELINE_UNREF() +#endif + +#if defined (__cplusplus) +} +#endif + +#endif /* __PVR_DEBUG_H__ */ + +/****************************************************************************** + End of file (pvr_debug.h) +******************************************************************************/ + diff --git a/drivers/gpu/rogue_m/include/pvr_fd_sync_kernel.h b/drivers/gpu/rogue_m/include/pvr_fd_sync_kernel.h new file mode 100644 index 000000000000..11343339cb71 --- /dev/null +++ b/drivers/gpu/rogue_m/include/pvr_fd_sync_kernel.h @@ -0,0 +1,114 @@ +/*************************************************************************/ /*! +@File pvr_fd_sync_kernel.h +@Title Kernel/userspace interface definitions to use the kernel sync + driver +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ +/* vi: set ts=8: */ + + +#ifndef _PVR_FD_SYNC_KERNEL_H_ +#define _PVR_FD_SYNC_KERNEL_H_ + +#include +#include + +#define PVR_SYNC_MAX_QUERY_FENCE_POINTS 14 + +#define PVR_SYNC_IOC_MAGIC 'W' + +#define PVR_SYNC_IOC_CREATE_FENCE \ + _IOWR(PVR_SYNC_IOC_MAGIC, 0, struct pvr_sync_create_fence_ioctl_data) + +#define PVR_SYNC_IOC_ENABLE_FENCING \ + _IOW(PVR_SYNC_IOC_MAGIC, 1, struct pvr_sync_enable_fencing_ioctl_data) + +#define PVR_SYNC_IOC_ALLOC_FENCE \ + _IOWR(PVR_SYNC_IOC_MAGIC, 3, struct pvr_sync_alloc_fence_ioctl_data) + +#define PVR_SYNC_IOC_RENAME \ + _IOWR(PVR_SYNC_IOC_MAGIC, 4, struct pvr_sync_rename_ioctl_data) + +#define PVR_SYNC_IOC_FORCE_SW_ONLY \ + _IO(PVR_SYNC_IOC_MAGIC, 5) + +#define PVRSYNC_MODNAME "pvr_sync" + +struct pvr_sync_alloc_fence_ioctl_data +{ + /* Output */ + int iFenceFd; + int bTimelineIdle; +} +__attribute__((packed, aligned(8))); + +struct pvr_sync_create_fence_ioctl_data +{ + /* Input */ + int iAllocFenceFd; + char szName[32]; + + /* Output */ + int iFenceFd; +} +__attribute__((packed, aligned(8))); + +struct pvr_sync_enable_fencing_ioctl_data +{ + /* Input */ + int bFencingEnabled; +} +__attribute__((packed, aligned(8))); + +struct pvr_sync_pt_info { + /* Output */ + __u32 id; + __u32 ui32FWAddr; + __u32 ui32CurrOp; + __u32 ui32NextOp; + __u32 ui32TlTaken; +} __attribute__((packed, aligned(8))); + +struct pvr_sync_rename_ioctl_data +{ + /* Input */ + char szName[32]; +} __attribute__((packed, aligned(8))); + +#endif /* _PVR_FD_SYNC_KERNEL_H_ */ diff --git a/drivers/gpu/rogue_m/include/pvrmodule.h b/drivers/gpu/rogue_m/include/pvrmodule.h new file mode 100644 index 000000000000..267c7b687487 --- /dev/null +++ b/drivers/gpu/rogue_m/include/pvrmodule.h @@ -0,0 +1,48 @@ +/*************************************************************************/ /*! +@Title Module Author and License. +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef _PVRMODULE_H_ +#define _PVRMODULE_H_ + +MODULE_AUTHOR("Imagination Technologies Ltd. "); +MODULE_LICENSE("Dual MIT/GPL"); + +#endif /* _PVRMODULE_H_ */ diff --git a/drivers/gpu/rogue_m/include/pvrsrv_device_types.h b/drivers/gpu/rogue_m/include/pvrsrv_device_types.h new file mode 100644 index 000000000000..de54d87abf22 --- /dev/null +++ b/drivers/gpu/rogue_m/include/pvrsrv_device_types.h @@ -0,0 +1,112 @@ +/*************************************************************************/ /*! +@File +@Title PowerVR device type definitions +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#if !defined(__PVRSRV_DEVICE_TYPES_H__) +#define __PVRSRV_DEVICE_TYPES_H__ + +#include "img_types.h" + +#define PVRSRV_MAX_DEVICES 16 /*!< Largest supported number of devices on the system */ + +/*! + ****************************************************************************** + * List of known device types. + *****************************************************************************/ +typedef enum PVRSRV_DEVICE_TYPE +{ + PVRSRV_DEVICE_TYPE_UNKNOWN = 0, /*!< Unknown device type */ + PVRSRV_DEVICE_TYPE_MBX1 = 1, /*!< MBX1 */ + PVRSRV_DEVICE_TYPE_MBX1_LITE = 2, /*!< MBX1 Lite */ + PVRSRV_DEVICE_TYPE_M24VA = 3, /*!< M24VA */ + PVRSRV_DEVICE_TYPE_MVDA2 = 4, /*!< MVDA2 */ + PVRSRV_DEVICE_TYPE_MVED1 = 5, /*!< MVED1 */ + PVRSRV_DEVICE_TYPE_MSVDX = 6, /*!< MSVDX */ + PVRSRV_DEVICE_TYPE_SGX = 7, /*!< SGX */ + PVRSRV_DEVICE_TYPE_VGX = 8, /*!< VGX */ + PVRSRV_DEVICE_TYPE_EXT = 9, /*!< 3rd party devices take ext type */ + PVRSRV_DEVICE_TYPE_RGX = 10, /*!< RGX */ + + PVRSRV_DEVICE_TYPE_LAST = 10, /*!< Last device type */ + + PVRSRV_DEVICE_TYPE_FORCE_I32 = 0x7fffffff /*!< Force enum to be 32-bit width */ + +} PVRSRV_DEVICE_TYPE; + + +/*! + ***************************************************************************** + * List of known device classes. + *****************************************************************************/ +typedef enum _PVRSRV_DEVICE_CLASS_ +{ + PVRSRV_DEVICE_CLASS_3D = 0 , /*!< 3D Device Class */ + PVRSRV_DEVICE_CLASS_DISPLAY = 1 , /*!< Display Device Class */ + PVRSRV_DEVICE_CLASS_BUFFER = 2 , /*!< Buffer Class */ + PVRSRV_DEVICE_CLASS_VIDEO = 3 , /*!< Video Device Class */ + + PVRSRV_DEVICE_CLASS_FORCE_I32 = 0x7fffffff /* Force enum to be at least 32-bits wide */ + +} PVRSRV_DEVICE_CLASS; + + +/*! + ****************************************************************************** + * Device identifier structure + *****************************************************************************/ +typedef struct _PVRSRV_DEVICE_IDENTIFIER_ +{ + PVRSRV_DEVICE_TYPE eDeviceType; /*!< Identifies the type of the device */ + PVRSRV_DEVICE_CLASS eDeviceClass; /*!< Identifies more general class of device - display/3d/mpeg etc */ + IMG_UINT32 ui32DeviceIndex; /*!< Index of the device within the system */ + IMG_CHAR *pszPDumpDevName; /*!< Pdump memory bank name */ + IMG_CHAR *pszPDumpRegName; /*!< Pdump register bank name */ + +} PVRSRV_DEVICE_IDENTIFIER; + + +#if defined(__KERNEL__) && defined(ANDROID) && !defined(__GENKSYMS__) +#define __pvrsrv_defined_struct_enum__ +#include +#endif + +#endif /* __PVRSRV_DEVICE_TYPES_H__ */ + diff --git a/drivers/gpu/rogue_m/include/pvrsrv_devmem.h b/drivers/gpu/rogue_m/include/pvrsrv_devmem.h new file mode 100644 index 000000000000..f6967a70a559 --- /dev/null +++ b/drivers/gpu/rogue_m/include/pvrsrv_devmem.h @@ -0,0 +1,577 @@ +/*************************************************************************/ /*! +@File +@Title Device Memory Management core +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Client side part of device memory management -- This + file defines the exposed Services API to core memory management + functions. +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef PVRSRV_DEVMEM_H +#define PVRSRV_DEVMEM_H + +#if defined __cplusplus +extern "C" { +#endif + +#include "img_types.h" +#include "devicemem_typedefs.h" +#include "pdumpdefs.h" +#include "pvrsrv_error.h" +#include "pvrsrv_memallocflags.h" +#include "services.h" /* For PVRSRV_DEV_DATA */ +#include "sync_external.h" + +/* + Device memory contexts, heaps and memory descriptors are passed + through to underlying memory APIs directly, but are to be regarded + as an opaque handle externally. +*/ +typedef DEVMEM_CONTEXT *PVRSRV_DEVMEMCTX; /*!< Device-Mem Client-Side Interface: Typedef for Context Ptr */ +typedef DEVMEM_HEAP *PVRSRV_HEAP; /*!< Device-Mem Client-Side Interface: Typedef for Heap Ptr */ +typedef DEVMEM_MEMDESC *PVRSRV_MEMDESC; /*!< Device-Mem Client-Side Interface: Typedef for Memory Descriptor Ptr */ +typedef DEVMEM_EXPORTCOOKIE PVRSRV_DEVMEM_EXPORTCOOKIE; /*!< Device-Mem Client-Side Interface: Typedef for Export Cookie */ +typedef DEVMEM_FLAGS_T PVRSRV_MEMMAP_FLAGS_T; /*!< Device-Mem Client-Side Interface: Typedef for Memory-Mapping Flags Enum */ +typedef DEVMEM_SERVER_EXPORTCOOKIE PVRSRV_DEVMEM_SERVER_EXPORTCOOKIE; /*!< Device-Mem Client-Side Interface: Typedef for Server Export Cookie */ + +/* N.B. Flags are now defined in pvrsrv_memallocflags.h as they need + to be omnipresent. */ + +/* + * + * API functions + * + */ + +/**************************************************************************/ /*! +@Function PVRSRVCreateDeviceMemContext +@Description Creates a device memory context. There is a one-to-one + correspondence between this context data structure and the top + level MMU page table (known as the Page Catalogue, in the case of a + 3-tier MMU). It is intended that a process with its own virtual + space on the CPU will also have its own virtual space on the GPU. + Thus there is loosely a one-to-one correspondence between process + and device memory context, but this is not enforced at this API. + + Every process must create the device memory context before any + memory allocations are made, and is responsible for freeing all + such allocations before destroying the context + + This is a wrapper function above the "bare-metal" device memory + context creation function which would create just a context and no + heaps. This function will also create the heaps, according to the + heap config that the device specific initialization code has + nominated for use by this API. + + The number of heaps thus created is returned to the caller, such + that the caller can allocate an array and the call in to fetch + details of each heap, or look up the heap with the "Find Heap" API + described below. + + In order to derive the details of the MMU configuration for the + device, and for retrieving the "bridge handle" for communication + internally in services, is is necessary to pass in the + PVRSRV_DEV_DATA object as populated with a prior call to + PVRSRVAcquireDeviceData() +@Input psDev dev data +@Output phCtxOut On success, the returned DevMem Context. The + caller is responsible for providing storage + for this. +@Return PVRSRV_ERROR: PVRSRV_OK on success. Otherwise, a PVRSRV_ + error code +*/ /***************************************************************************/ +extern IMG_IMPORT PVRSRV_ERROR +PVRSRVCreateDeviceMemContext(const PVRSRV_DEV_DATA *psDev, + PVRSRV_DEVMEMCTX *phCtxOut); + +/**************************************************************************/ /*! +@Function PVRSRVDestroyDeviceMemContext +@Description Destroy cannot fail. Well. It shouldn't, assuming the caller + has obeyed the protocol, i.e. has freed all his allocations + beforehand. +@Input hCtx Handle to a DevMem Context +@Return None +*/ /***************************************************************************/ +extern IMG_IMPORT IMG_VOID +PVRSRVDestroyDeviceMemContext(PVRSRV_DEVMEMCTX hCtx); + +/**************************************************************************/ /*! +@Function PVRSRVFindHeapByName +@Description Returns the heap handle for the named heap which is assumed to + exist in this context. PVRSRV_HEAP *phHeapOut, + + N.B. No need for acquire/release semantics here, as when using + this wrapper layer, the heaps are automatically instantiated at + context creation time and destroyed when the context is + destroyed. + + The caller is required to know the heap names already as these + will vary from device to device and from purpose to purpose. +@Input hCtx Handle to a DevMem Context +@Input pszHeapName Name of the heap to look for +@Output phHeapOut a handle to the heap, for use in future calls + to OpenAllocation / AllocDeviceMemory / Map + DeviceClassMemory, etc. (The PVRSRV_HEAP type + to be regarded by caller as an opaque, but + strongly typed, handle) +@Return PVRSRV_ERROR: PVRSRV_OK on success. Otherwise, a PVRSRV_ + error code +*/ /***************************************************************************/ +extern PVRSRV_ERROR +PVRSRVFindHeapByName(PVRSRV_DEVMEMCTX hCtx, + const IMG_CHAR *pszHeapName, + PVRSRV_HEAP *phHeapOut); + +/**************************************************************************/ /*! +@Function PVRSRVDevmemGetHeapBaseDevVAddr +@Description returns the device virtual address of the base of the heap. +@Input hHeap Handle to a Heap +@Output pDevVAddr On success, the device virtual address of the + base of the heap. +@Return PVRSRV_ERROR: PVRSRV_OK on success. Otherwise, a PVRSRV_ + error code +*/ /***************************************************************************/ +PVRSRV_ERROR +PVRSRVDevmemGetHeapBaseDevVAddr(PVRSRV_HEAP hHeap, + IMG_DEV_VIRTADDR *pDevVAddr); + +/**************************************************************************/ /*! +@Function PVRSRVAllocDeviceMem +@Description Allocate memory from the specified heap, acquiring physical + memory from OS as we go and mapping this into + the GPU (mandatorily) and CPU (optionally) + + Size must be a positive integer multiple of alignment, or, to + put it another way, the uiLog2Align LSBs should all be zero, but + at least one other bit should not be. + + Caller to take charge of the PVRSRV_MEMDESC (the memory + descriptor) which is to be regarded as an opaque handle. +@Input hHeap Handle to the heap from which memory will be + allocated +@Input uiSize Amount of memory to be allocated. +@Input uiLog2Align LOG2 of the required alignment +@Input uiMemAllocFlags Allocation Flags +@Input pszText Text to describe the allocation +@Output phMemDescOut On success, the resulting memory descriptor +@Return PVRSRV_OK on success. Otherwise, a PVRSRV_ error code +*/ /***************************************************************************/ +extern PVRSRV_ERROR +PVRSRVAllocDeviceMem(PVRSRV_HEAP hHeap, + IMG_DEVMEM_SIZE_T uiSize, + IMG_DEVMEM_LOG2ALIGN_T uiLog2Align, + PVRSRV_MEMALLOCFLAGS_T uiMemAllocFlags, + IMG_PCHAR pszText, + PVRSRV_MEMDESC *phMemDescOut); + +/**************************************************************************/ /*! +@Function PVRSRVFreeDeviceMem +@Description Free that allocated by PVRSRVAllocDeviceMem (Memory descriptor + will be destroyed) +@Input hMemDesc Handle to the descriptor of the memory to be + freed +@Return None +*/ /***************************************************************************/ +extern IMG_VOID +PVRSRVFreeDeviceMem(PVRSRV_MEMDESC hMemDesc); + +/**************************************************************************/ /*! +@Function PVRSRVAcquireCPUMapping +@Description Causes the allocation referenced by this memory descriptor to be + mapped into cpu virtual memory, if it wasn't already, and the + CPU virtual address returned in the caller-provided location. + + The caller must call PVRSRVReleaseCPUMapping to advise when he + has finished with the mapping. +@Input hMemDesc Handle to the memory descriptor for which a + CPU mapping is required +@Output ppvCpuVirtAddrOut On success, the caller's ptr is set to the + new CPU mapping +@Return PVRSRV_ERROR: PVRSRV_OK on success. Otherwise, a PVRSRV_ + error code +*/ /***************************************************************************/ +extern PVRSRV_ERROR +PVRSRVAcquireCPUMapping(PVRSRV_MEMDESC hMemDesc, + IMG_VOID **ppvCpuVirtAddrOut); + +/**************************************************************************/ /*! +@Function PVRSRVReleaseCPUMapping +@Description Relinquishes the cpu mapping acquired with + PVRSRVAcquireCPUMapping() +@Input hMemDesc Handle of the memory descriptor +@Return None +*/ /***************************************************************************/ +extern IMG_VOID +PVRSRVReleaseCPUMapping(PVRSRV_MEMDESC hMemDesc); + + +/**************************************************************************/ /*! +@Function PVRSRVMapToDevice +@Description Map allocation into the device MMU. This function must only be + called once, any further calls will return + PVRSRV_ERROR_DEVICEMEM_ALREADY_MAPPED + + The caller must call PVRSRVReleaseDeviceMapping when they + are finished with the mapping. + +@Input hMemDesc Handle of the memory descriptor +@Input hHeap Device heap to map the allocation into +@Output psDevVirtAddrOut Device virtual address +@Return PVRSRV_ERROR: PVRSRV_OK on success. Otherwise, a PVRSRV_ + error code +*/ /***************************************************************************/ +extern PVRSRV_ERROR +PVRSRVMapToDevice(PVRSRV_MEMDESC hMemDesc, + PVRSRV_HEAP hHeap, + IMG_DEV_VIRTADDR *psDevVirtAddrOut); + +/**************************************************************************/ /*! +@Function PVRSRVAcquireDeviceMapping +@Description Acquire a reference on the device mapping the allocation. + If the allocation wasn't mapped into the device then + and the device virtual address returned in the + PVRSRV_ERROR_DEVICEMEM_NO_MAPPING will be returned as + PVRSRVMapToDevice must be called first. + + The caller must call PVRSRVReleaseDeviceMapping when they + are finished with the mapping. +@Input hMemDesc Handle to the memory descriptor for which a + device mapping is required +@Output psDevVirtAddrOut On success, the caller's ptr is set to the + new device mapping +@Return PVRSRV_ERROR: PVRSRV_OK on success. Otherwise, a PVRSRV_ + error code +*/ /***************************************************************************/ +extern PVRSRV_ERROR +PVRSRVAcquireDeviceMapping(PVRSRV_MEMDESC hMemDesc, + IMG_DEV_VIRTADDR *psDevVirtAddrOut); + +/**************************************************************************/ /*! +@Function PVRSRVReleaseDeviceMapping +@Description Relinquishes the device mapping acquired with + PVRSRVAcquireDeviceMapping or PVRSRVMapToDevice +@Input hMemDesc Handle of the memory descriptor +@Return None +*/ /***************************************************************************/ +extern IMG_VOID +PVRSRVReleaseDeviceMapping(PVRSRV_MEMDESC hMemDesc); + +/*************************************************************************/ /*! +@Function PVRSRVDevmemLocalImport + +@Description Import a PMR that was created with this connection to services. + +@Input hExtHandle External memory handle + +@Input uiFlags Import flags + +@Output phMemDescPtr Created MemDesc + +@Output puiSizePtr Size of the created MemDesc + +@Return PVRSRV_OK is succesful +*/ +/*****************************************************************************/ +PVRSRV_ERROR PVRSRVDevmemLocalImport(const PVRSRV_CONNECTION *psConnection, + IMG_HANDLE hExtHandle, + PVRSRV_MEMMAP_FLAGS_T uiFlags, + PVRSRV_MEMDESC *phMemDescPtr, + IMG_DEVMEM_SIZE_T *puiSizePtr); + +/*************************************************************************/ /*! +@Function PVRSRVDevmemGetImportUID + +@Description Get the UID of the import that backs this MemDesc + +@Input hMemDesc MemDesc + +@Return UID of import +*/ +/*****************************************************************************/ +PVRSRV_ERROR PVRSRVDevmemGetImportUID(PVRSRV_MEMDESC hMemDesc, + IMG_UINT64 *pui64UID); + +/**************************************************************************/ /*! +@Function PVRSRVAllocExportableDevMem +@Description Allocate memory without mapping into device memory context. This + memory is exported and ready to be mapped into the device memory + context of other processes, or to CPU only with + PVRSRVMapMemoryToCPUOnly(). The caller agrees to later call + PVRSRVFreeUnmappedExportedMemory(). The caller must give the page + size of the heap into which this memory may be subsequently + mapped, or the largest of such page sizes if it may be mapped + into multiple places. This information is to be communicated in + the Log2Align field. + + Size must be a positive integer multiple of the page size +@Input uiLog2Align Log2 of the alignment required +@Input uiSize the amount of memory to be allocated +@Input uiFlags Allocation flags +@Input pszText Text to describe the allocation +@Output hMemDesc +@Return PVRSRV_OK on success. Otherwise, a PVRSRV_ error code +*/ /***************************************************************************/ +PVRSRV_ERROR +PVRSRVAllocExportableDevMem(const PVRSRV_DEV_DATA *psDevData, + IMG_DEVMEM_SIZE_T uiSize, + IMG_DEVMEM_LOG2ALIGN_T uiLog2Align, + PVRSRV_MEMALLOCFLAGS_T uiFlags, + IMG_PCHAR pszText, + PVRSRV_MEMDESC *hMemDesc); + +/**************************************************************************/ /*! +@Function PVRSRVAllocSparseDevMem +@Description Allocate sparse memory without mapping into device memory context. + Sparse memory is used where you have an allocation that has a + logical size (i.e. the amount of VM space it will need when + mapping it into a device) that is larger then the amount of + physical memory that allocation will use. An example of this + is a NPOT texture where the twiddling algorithm requires you + to round the width and height to next POT and so you know there + will be pages that are never accessed. + + This memory is can to be exported and mapped into the device + memory context of other processes, or to CPU. + + Size must be a positive integer multiple of the page size +@Input psDevData Device to allocation the memory for +@Input uiSize The logical size of allocation +@Input uiChunkSize The size of the chunk +@Input ui32NumPhysChunks The number of physical chunks required +@Input ui32NumVirtChunks The number of virtual chunks required +@Input pabMappingTable Mapping table +@Input uiLog2Align Log2 of the required alignment +@Input uiFlags Allocation flags +@Input pszText Text to describe the allocation +@Output hMemDesc +@Return PVRSRV_OK on success. Otherwise, a PVRSRV_ error code +*/ /***************************************************************************/ +PVRSRV_ERROR +PVRSRVAllocSparseDevMem(const PVRSRV_DEV_DATA *psDevData, + IMG_DEVMEM_SIZE_T uiSize, + IMG_DEVMEM_SIZE_T uiChunkSize, + IMG_UINT32 ui32NumPhysChunks, + IMG_UINT32 ui32NumVirtChunks, + IMG_BOOL *pabMappingTable, + IMG_DEVMEM_LOG2ALIGN_T uiLog2Align, + DEVMEM_FLAGS_T uiFlags, + IMG_PCHAR pszText, + PVRSRV_MEMDESC *hMemDesc); + +/**************************************************************************/ /*! +@Function PVRSRVGetLog2PageSize +@Description Just call AFTER setting up the connection to the kernel module + otherwise it will run into an assert. + Gives the log2 of the page size that is currently utilised by + devmem. + +@Return The page size +*/ /***************************************************************************/ + +IMG_UINT32 PVRSRVGetLog2PageSize(void); + +/**************************************************************************/ /*! +@Function PVRSRVGetHeapLog2ImportAlignment +@Description Queries the import alignment of a passed heap. + +@Input hHeap Heap that is queried +@Output puiLog2ImportAlignment Log2 import alignment will be + returned in this + +@Return PVRSRV_OK on success. Otherwise, a PVRSRV error code +*/ /***************************************************************************/ +PVRSRV_ERROR +PVRSRVGetHeapLog2ImportAlignment(PVRSRV_HEAP hHeap, + IMG_UINT32* puiLog2ImportAlignment); + + +/**************************************************************************/ /*! +@Function PVRSRVExport +@Description Given a memory allocation allocated with Devmem_Allocate(), + create a "cookie" that can be passed intact by the caller's own + choice of secure IPC to another process and used as the argument + to "map" to map this memory into a heap in the target processes. + N.B. This can also be used to map into multiple heaps in one + process, though that's not the intention. + + Note, the caller must later call Unexport before freeing the + memory. +@Input hMemDesc handle to the descriptor of the memory to be + exported +@Output phExportCookie On success, a handle to the exported cookie +@Return PVRSRV_ERROR: PVRSRV_OK on success. Otherwise, a PVRSRV_ + error code +*/ /***************************************************************************/ +PVRSRV_ERROR PVRSRVExportDevMem(PVRSRV_MEMDESC hMemDesc, + PVRSRV_DEVMEM_EXPORTCOOKIE *phExportCookie); + +/**************************************************************************/ /*! +@Function DevmemMakeServerExportClientExport +@Description This is a "special case" function for making a server export + cookie which went through the direct bridge into an export + cookie that can be passed through the client bridge. +@Input psConnection Services connection +@Input hServerExportCookie server export cookie +@Output psExportCookie ptr to export cookie +@Return PVRSRV_ERROR: PVRSRV_OK on success. Otherwise, a PVRSRV_ + error code +*/ /***************************************************************************/ +PVRSRV_ERROR +PVRSRVMakeServerExportClientExport(const PVRSRV_CONNECTION *psConnection, + PVRSRV_DEVMEM_SERVER_EXPORTCOOKIE hServerExportCookie, + PVRSRV_DEVMEM_EXPORTCOOKIE *psExportCookie); + +/**************************************************************************/ /*! +@Function DevmemUnmakeServerExportClientExport +@Description Remove any associated resource from the Make operation +@Input psConnection Services connection +@Output psExportCookie ptr to export cookie +@Return PVRSRV_ERROR: PVRSRV_OK on success. Otherwise, a PVRSRV_ + error code +*/ /***************************************************************************/ +PVRSRV_ERROR +PVRSRVUnmakeServerExportClientExport(const PVRSRV_CONNECTION *psConnection, + PVRSRV_DEVMEM_EXPORTCOOKIE *psExportCookie); + +/**************************************************************************/ /*! +@Function PVRSRVUnexport +@Description Undo the export caused by "PVRSRVExport" - note - it doesn't + actually tear down any mapping made by processes that received + the export cookie. It will simply make the cookie null and void + and prevent further mappings. +@Input hMemDesc handle to the descriptor of the memory which + will no longer be exported +@Output phExportCookie On success, the export cookie provided will be + set to null +@Return PVRSRV_ERROR: PVRSRV_OK on success. Otherwise, a PVRSRV_ + error code +*/ /***************************************************************************/ +PVRSRV_ERROR PVRSRVUnexportDevMem(PVRSRV_MEMDESC hMemDesc, + PVRSRV_DEVMEM_EXPORTCOOKIE *phExportCookie); + +/**************************************************************************/ /*! +@Function PVRSRVImportDevMem +@Description Import memory that was previously exported with PVRSRVExport() + into the current process. + + Note: This call only makes the memory accessible to this + process, it doesn't map it into the device or CPU. + +@Input psConnection Connection to services +@Input phExportCookie Ptr to the handle of the export-cookie + identifying +@Output phMemDescOut On Success, a handle to a new memory descriptor + representing the memory as mapped into the + local process address space. +@Input uiFlags Device memory mapping flags +@Input pszText Text to describe the import +@Return PVRSRV_ERROR: PVRSRV_OK on success. Otherwise, a PVRSRV_ + error code +*/ /***************************************************************************/ +PVRSRV_ERROR PVRSRVImportDevMem(const PVRSRV_CONNECTION *psConnection, + PVRSRV_DEVMEM_EXPORTCOOKIE *phExportCookie, + PVRSRV_MEMMAP_FLAGS_T uiFlags, + PVRSRV_MEMDESC *phMemDescOut); + +/**************************************************************************/ /*! +@Function PVRSRVIsDeviceMemAddrValid +@Description Checks if given device virtual memory address is valid + from the GPU's point of view. +@Input hContext handle to memory context +@Input sDevVAddr device 40bit virtual memory address +@Return PVRSRV_OK if address is valid or + PVRSRV_ERROR_INVALID_GPU_ADDR when address is invalid +*/ /***************************************************************************/ +PVRSRV_ERROR PVRSRVIsDeviceMemAddrValid(PVRSRV_DEVMEMCTX hContext, + IMG_DEV_VIRTADDR sDevVAddr); + +#if defined (SUPPORT_EXPORTING_MEMORY_CONTEXT) +/**************************************************************************/ /*! +@Function PVRSRVExportDevmemContext +@Description Export a device memory context to another process + +@Input hCtx Memory context to export +@Output phExport On Success, a export handle that can be passed + to another process and used with + PVRSRVImportDeviceMemContext to import the + memory context +@Return PVRSRV_ERROR: PVRSRV_OK on success. Otherwise, a PVRSRV_ + error code +*/ /***************************************************************************/ +PVRSRV_ERROR +PVRSRVExportDevmemContext(PVRSRV_DEVMEMCTX hCtx, + IMG_HANDLE *phExport); + +/**************************************************************************/ /*! +@Function PVRSRVUnexportDevmemContext +@Description Unexport an exported device memory context + +@Input psConnection Services connection +@Input hExport Export handle created to be unexported + +@Return None +*/ /***************************************************************************/ +IMG_VOID +PVRSRVUnexportDevmemContext(PVRSRV_CONNECTION *psConnection, + IMG_HANDLE hExport); + +/**************************************************************************/ /*! +@Function PVRSRVImportDeviceMemContext +@Description Import an exported device memory context + + Note: The memory context created with this function is not + complete and can only be used with debugger related functions + +@Input psConnection Services connection +@Input hExport Export handle to import +@Output phCtxOut Device memory context + +@Return None +*/ /***************************************************************************/ +PVRSRV_ERROR +PVRSRVImportDeviceMemContext(PVRSRV_CONNECTION *psConnection, + IMG_HANDLE hExport, + PVRSRV_DEVMEMCTX *phCtxOut); + +#endif /* SUPPORT_EXPORTING_MEMORY_CONTEXT */ +#if defined __cplusplus +}; +#endif +#endif /* PVRSRV_DEVMEM_H */ + diff --git a/drivers/gpu/rogue_m/include/pvrsrv_error.h b/drivers/gpu/rogue_m/include/pvrsrv_error.h new file mode 100644 index 000000000000..82ef82a46440 --- /dev/null +++ b/drivers/gpu/rogue_m/include/pvrsrv_error.h @@ -0,0 +1,61 @@ +/*************************************************************************/ /*! +@File pvrsrv_error.h +@Title services error enumerant +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Defines error codes used by any/all services modules +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#if !defined (__PVRSRV_ERROR_H__) +#define __PVRSRV_ERROR_H__ + +/*! + ***************************************************************************** + * Error values + *****************************************************************************/ +typedef enum PVRSRV_ERROR +{ + PVRSRV_OK, +#define PVRE(x) x, +#include "pvrsrv_errors.h" +#undef PVRE + PVRSRV_ERROR_FORCE_I32 = 0x7fffffff + +} PVRSRV_ERROR; + +#endif /* !defined (__PVRSRV_ERROR_H__) */ diff --git a/drivers/gpu/rogue_m/include/pvrsrv_errors.h b/drivers/gpu/rogue_m/include/pvrsrv_errors.h new file mode 100644 index 000000000000..06fa4557ccd6 --- /dev/null +++ b/drivers/gpu/rogue_m/include/pvrsrv_errors.h @@ -0,0 +1,329 @@ +/*************************************************************************/ /*! +@File pvrsrv_errors.h +@Title services error codes +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Defines error codes used by any/all services modules +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +/* Don't add include guards to this file! */ + +PVRE(PVRSRV_ERROR_OUT_OF_MEMORY) +PVRE(PVRSRV_ERROR_TOO_FEW_BUFFERS) +PVRE(PVRSRV_ERROR_INVALID_PARAMS) +PVRE(PVRSRV_ERROR_INIT_FAILURE) +PVRE(PVRSRV_ERROR_CANT_REGISTER_CALLBACK) +PVRE(PVRSRV_ERROR_INVALID_DEVICE) +PVRE(PVRSRV_ERROR_NOT_OWNER) +PVRE(PVRSRV_ERROR_BAD_MAPPING) +PVRE(PVRSRV_ERROR_TIMEOUT) +PVRE(PVRSRV_ERROR_NOT_IMPLEMENTED) +PVRE(PVRSRV_ERROR_FLIP_CHAIN_EXISTS) +PVRE(PVRSRV_ERROR_INVALID_SWAPINTERVAL) +PVRE(PVRSRV_ERROR_SCENE_INVALID) +PVRE(PVRSRV_ERROR_STREAM_ERROR) +PVRE(PVRSRV_ERROR_FAILED_DEPENDENCIES) +PVRE(PVRSRV_ERROR_CMD_NOT_PROCESSED) +PVRE(PVRSRV_ERROR_CMD_TOO_BIG) +PVRE(PVRSRV_ERROR_DEVICE_REGISTER_FAILED) +PVRE(PVRSRV_ERROR_TOOMANYBUFFERS) +PVRE(PVRSRV_ERROR_NOT_SUPPORTED) +PVRE(PVRSRV_ERROR_PROCESSING_BLOCKED) +PVRE(PVRSRV_ERROR_CANNOT_FLUSH_QUEUE) +PVRE(PVRSRV_ERROR_CANNOT_GET_QUEUE_SPACE) +PVRE(PVRSRV_ERROR_CANNOT_GET_RENDERDETAILS) +PVRE(PVRSRV_ERROR_RETRY) +PVRE(PVRSRV_ERROR_DDK_VERSION_MISMATCH) +PVRE(PVRSRV_ERROR_DDK_BUILD_MISMATCH) +PVRE(PVRSRV_ERROR_BUILD_OPTIONS_MISMATCH) +PVRE(PVRSRV_ERROR_BVNC_MISMATCH) +PVRE(PVRSRV_ERROR_META_MISMATCH) +PVRE(PVRSRV_ERROR_UPLOAD_TOO_BIG) +PVRE(PVRSRV_ERROR_INVALID_FLAGS) +PVRE(PVRSRV_ERROR_FAILED_TO_REGISTER_PROCESS) +PVRE(PVRSRV_ERROR_UNABLE_TO_LOAD_LIBRARY) +PVRE(PVRSRV_ERROR_UNABLE_GET_FUNC_ADDR) +PVRE(PVRSRV_ERROR_UNLOAD_LIBRARY_FAILED) +PVRE(PVRSRV_ERROR_BRIDGE_CALL_FAILED) +PVRE(PVRSRV_ERROR_IOCTL_CALL_FAILED) +PVRE(PVRSRV_ERROR_MMU_API_PROTOCOL_ERROR) +PVRE(PVRSRV_ERROR_MMU_CONTEXT_NOT_FOUND) +PVRE(PVRSRV_ERROR_MMU_FAILED_TO_ALLOCATE_PAGETABLES) +PVRE(PVRSRV_ERROR_MMU_FAILED_TO_CREATE_HEAP) +PVRE(PVRSRV_ERROR_MMU_FAILED_TO_MAP_PAGE_TABLE) +PVRE(PVRSRV_ERROR_MMU_FAILED_TO_UNMAP_PAGE_TABLE) +PVRE(PVRSRV_ERROR_MMU_INVALID_PAGE_SIZE_FOR_DEVICE) +PVRE(PVRSRV_ERROR_MMU_LIVE_ALLOCATIONS_IN_HEAP) +PVRE(PVRSRV_ERROR_MMU_RESERVATION_NOT_INSIDE_HEAP) +PVRE(PVRSRV_ERROR_PMR_CLIENT_NOT_TRUSTED) +PVRE(PVRSRV_ERROR_PMR_FAILED_TO_ALLOC_PAGES) +PVRE(PVRSRV_ERROR_PMR_INCOMPATIBLE_CONTIGUITY) +PVRE(PVRSRV_ERROR_PMR_MISMATCHED_ATTRIBUTES) +PVRE(PVRSRV_ERROR_PMR_NOT_PAGE_MULTIPLE) +PVRE(PVRSRV_ERROR_PMR_NOT_PERMITTED) +PVRE(PVRSRV_ERROR_PMR_PMR_ALREADY_OCCUPIED) +PVRE(PVRSRV_ERROR_PMR_UNRECOVERABLE_ERROR) +PVRE(PVRSRV_ERROR_PMR_WRONG_PASSWORD_OR_STALE_PMR) +PVRE(PVRSRV_ERROR_PMR_WRONG_PMR_TYPE) +PVRE(PVRSRV_ERROR_PMR_HAS_BEEN_MAPPED) +PVRE(PVRSRV_ERROR_PMR_BAD_MAPPINGTABLE_SIZE) +PVRE(PVRSRV_ERROR_PMR_BAD_CHUNK_SIZE) +PVRE(PVRSRV_ERROR_PMR_MAPPINGTABLE_MISMATCH) +PVRE(PVRSRV_ERROR_PMR_INVALID_CHUNK) +PVRE(PVRSRV_ERROR_PMR_NO_KERNEL_MAPPING) +PVRE(PVRSRV_ERROR_DEVICEMEM_ALLOCATIONS_REMAIN_IN_HEAP) +PVRE(PVRSRV_ERROR_DEVICEMEM_BAD_IMPORT_SIZE) +PVRE(PVRSRV_ERROR_DEVICEMEM_CANT_EXPORT_SUBALLOCATION) +PVRE(PVRSRV_ERROR_DEVICEMEM_INVALID_HEAP_CONFIG_INDEX) +PVRE(PVRSRV_ERROR_DEVICEMEM_INVALID_HEAP_INDEX) +PVRE(PVRSRV_ERROR_DEVICEMEM_MAP_FAILED) +PVRE(PVRSRV_ERROR_DEVICEMEM_NON_ZERO_USAGE_COUNT) +PVRE(PVRSRV_ERROR_DEVICEMEM_OUT_OF_RANGE) +PVRE(PVRSRV_ERROR_DEVICEMEM_UNABLE_TO_CREATE_ARENA) +PVRE(PVRSRV_ERROR_DEVICEMEM_OUT_OF_DEVICE_VM) +PVRE(PVRSRV_ERROR_DEVICEMEM_ALREADY_MAPPED) +PVRE(PVRSRV_ERROR_DEVICEMEM_NO_MAPPING) +PVRE(PVRSRV_ERROR_DEVICEMEM_INVALID_PMR_FLAGS) +PVRE(PVRSRV_ERROR_INVALID_MMU_TYPE) +PVRE(PVRSRV_ERROR_BUFFER_DEVICE_NOT_FOUND) +PVRE(PVRSRV_ERROR_BUFFER_DEVICE_ALREADY_PRESENT) +PVRE(PVRSRV_ERROR_PCI_DEVICE_NOT_FOUND) +PVRE(PVRSRV_ERROR_PCI_CALL_FAILED) +PVRE(PVRSRV_ERROR_PCI_REGION_TOO_SMALL) +PVRE(PVRSRV_ERROR_PCI_REGION_UNAVAILABLE) +PVRE(PVRSRV_ERROR_BAD_REGION_SIZE_MISMATCH) +PVRE(PVRSRV_ERROR_REGISTER_BASE_NOT_SET) +PVRE(PVRSRV_ERROR_FAILED_TO_ALLOC_USER_MEM) +PVRE(PVRSRV_ERROR_FAILED_TO_ALLOC_VP_MEMORY) +PVRE(PVRSRV_ERROR_FAILED_TO_MAP_SHARED_PBDESC) +PVRE(PVRSRV_ERROR_FAILED_TO_MAP_KERNELVIRTUAL) +PVRE(PVRSRV_ERROR_FAILED_TO_GET_PHYS_ADDR) +PVRE(PVRSRV_ERROR_FAILED_TO_ALLOC_VIRT_MEMORY) +PVRE(PVRSRV_ERROR_FAILED_TO_COPY_VIRT_MEMORY) +PVRE(PVRSRV_ERROR_FAILED_TO_ALLOC_PAGES) +PVRE(PVRSRV_ERROR_FAILED_TO_FREE_PAGES) +PVRE(PVRSRV_ERROR_FAILED_TO_COPY_PAGES) +PVRE(PVRSRV_ERROR_UNABLE_TO_LOCK_PAGES) +PVRE(PVRSRV_ERROR_UNABLE_TO_UNLOCK_PAGES) +PVRE(PVRSRV_ERROR_STILL_MAPPED) +PVRE(PVRSRV_ERROR_MAPPING_NOT_FOUND) +PVRE(PVRSRV_ERROR_PHYS_ADDRESS_EXCEEDS_32BIT) +PVRE(PVRSRV_ERROR_FAILED_TO_MAP_PAGE_TABLE) +PVRE(PVRSRV_ERROR_INVALID_SEGMENT_BLOCK) +PVRE(PVRSRV_ERROR_INVALID_GFXDEVDEVDATA) +PVRE(PVRSRV_ERROR_INVALID_DEVINFO) +PVRE(PVRSRV_ERROR_INVALID_MEMINFO) +PVRE(PVRSRV_ERROR_INVALID_MISCINFO) +PVRE(PVRSRV_ERROR_UNKNOWN_IOCTL) +PVRE(PVRSRV_ERROR_INVALID_CONTEXT) +PVRE(PVRSRV_ERROR_UNABLE_TO_DESTROY_CONTEXT) +PVRE(PVRSRV_ERROR_INVALID_HEAP) +PVRE(PVRSRV_ERROR_INVALID_KERNELINFO) +PVRE(PVRSRV_ERROR_UNKNOWN_POWER_STATE) +PVRE(PVRSRV_ERROR_INVALID_HANDLE_TYPE) +PVRE(PVRSRV_ERROR_INVALID_WRAP_TYPE) +PVRE(PVRSRV_ERROR_INVALID_PHYS_ADDR) +PVRE(PVRSRV_ERROR_INVALID_CPU_ADDR) +PVRE(PVRSRV_ERROR_INVALID_HEAPINFO) +PVRE(PVRSRV_ERROR_INVALID_PERPROC) +PVRE(PVRSRV_ERROR_FAILED_TO_RETRIEVE_HEAPINFO) +PVRE(PVRSRV_ERROR_INVALID_MAP_REQUEST) +PVRE(PVRSRV_ERROR_INVALID_UNMAP_REQUEST) +PVRE(PVRSRV_ERROR_UNABLE_TO_FIND_MAPPING_HEAP) +PVRE(PVRSRV_ERROR_MAPPING_STILL_IN_USE) +PVRE(PVRSRV_ERROR_EXCEEDED_HW_LIMITS) +PVRE(PVRSRV_ERROR_NO_STAGING_BUFFER_ALLOCATED) +PVRE(PVRSRV_ERROR_UNABLE_TO_CREATE_PERPROC_AREA) +PVRE(PVRSRV_ERROR_UNABLE_TO_CREATE_EVENT) +PVRE(PVRSRV_ERROR_UNABLE_TO_ENABLE_EVENT) +PVRE(PVRSRV_ERROR_UNABLE_TO_REGISTER_EVENT) +PVRE(PVRSRV_ERROR_UNABLE_TO_DESTROY_EVENT) +PVRE(PVRSRV_ERROR_UNABLE_TO_CREATE_THREAD) +PVRE(PVRSRV_ERROR_UNABLE_TO_CLOSE_THREAD) +PVRE(PVRSRV_ERROR_THREAD_READ_ERROR) +PVRE(PVRSRV_ERROR_UNABLE_TO_REGISTER_ISR_HANDLER) +PVRE(PVRSRV_ERROR_UNABLE_TO_INSTALL_ISR) +PVRE(PVRSRV_ERROR_UNABLE_TO_UNINSTALL_ISR) +PVRE(PVRSRV_ERROR_ISR_ALREADY_INSTALLED) +PVRE(PVRSRV_ERROR_ISR_NOT_INSTALLED) +PVRE(PVRSRV_ERROR_UNABLE_TO_INITIALISE_INTERRUPT) +PVRE(PVRSRV_ERROR_UNABLE_TO_RETRIEVE_INFO) +PVRE(PVRSRV_ERROR_UNABLE_TO_DO_BACKWARDS_BLIT) +PVRE(PVRSRV_ERROR_UNABLE_TO_CLOSE_SERVICES) +PVRE(PVRSRV_ERROR_UNABLE_TO_REGISTER_CONTEXT) +PVRE(PVRSRV_ERROR_UNABLE_TO_REGISTER_RESOURCE) +PVRE(PVRSRV_ERROR_INVALID_CCB_COMMAND) +PVRE(PVRSRV_ERROR_KERNEL_CCB_FULL) +PVRE(PVRSRV_ERROR_FLIP_FAILED) +PVRE(PVRSRV_ERROR_UNBLANK_DISPLAY_FAILED) +PVRE(PVRSRV_ERROR_TIMEOUT_POLLING_FOR_VALUE) +PVRE(PVRSRV_ERROR_TIMEOUT_WAITING_FOR_CLIENT_CCB) +PVRE(PVRSRV_ERROR_CREATE_RENDER_CONTEXT_FAILED) +PVRE(PVRSRV_ERROR_UNKNOWN_PRIMARY_FRAG) +PVRE(PVRSRV_ERROR_UNEXPECTED_SECONDARY_FRAG) +PVRE(PVRSRV_ERROR_UNEXPECTED_PRIMARY_FRAG) +PVRE(PVRSRV_ERROR_UNABLE_TO_INSERT_FENCE_ID) +PVRE(PVRSRV_ERROR_BLIT_SETUP_FAILED) +PVRE(PVRSRV_ERROR_SUBMIT_NEEDED) +PVRE(PVRSRV_ERROR_PDUMP_NOT_AVAILABLE) +PVRE(PVRSRV_ERROR_PDUMP_BUFFER_FULL) +PVRE(PVRSRV_ERROR_PDUMP_BUF_OVERFLOW) +PVRE(PVRSRV_ERROR_PDUMP_NOT_ACTIVE) +PVRE(PVRSRV_ERROR_INCOMPLETE_LINE_OVERLAPS_PAGES) +PVRE(PVRSRV_ERROR_MUTEX_DESTROY_FAILED) +PVRE(PVRSRV_ERROR_MUTEX_INTERRUPTIBLE_ERROR) +PVRE(PVRSRV_ERROR_INSUFFICIENT_SCRIPT_SPACE) +PVRE(PVRSRV_ERROR_INSUFFICIENT_SPACE_FOR_COMMAND) +PVRE(PVRSRV_ERROR_PROCESS_NOT_INITIALISED) +PVRE(PVRSRV_ERROR_PROCESS_NOT_FOUND) +PVRE(PVRSRV_ERROR_SRV_CONNECT_FAILED) +PVRE(PVRSRV_ERROR_SRV_DISCONNECT_FAILED) +PVRE(PVRSRV_ERROR_DEINT_PHASE_FAILED) +PVRE(PVRSRV_ERROR_INIT2_PHASE_FAILED) +PVRE(PVRSRV_ERROR_UNABLE_TO_FIND_RESOURCE) +PVRE(PVRSRV_ERROR_NO_DC_DEVICES_FOUND) +PVRE(PVRSRV_ERROR_DC_INVALID_MAXDEPTH) +PVRE(PVRSRV_ERROR_UNABLE_TO_OPEN_DC_DEVICE) +PVRE(PVRSRV_ERROR_UNABLE_TO_UNREGISTER_DEVICE) +PVRE(PVRSRV_ERROR_NO_DEVICEDATA_FOUND) +PVRE(PVRSRV_ERROR_NO_DEVICENODE_FOUND) +PVRE(PVRSRV_ERROR_NO_CLIENTNODE_FOUND) +PVRE(PVRSRV_ERROR_FAILED_TO_PROCESS_QUEUE) +PVRE(PVRSRV_ERROR_UNABLE_TO_INIT_TASK) +PVRE(PVRSRV_ERROR_UNABLE_TO_SCHEDULE_TASK) +PVRE(PVRSRV_ERROR_UNABLE_TO_KILL_TASK) +PVRE(PVRSRV_ERROR_UNABLE_TO_ENABLE_TIMER) +PVRE(PVRSRV_ERROR_UNABLE_TO_DISABLE_TIMER) +PVRE(PVRSRV_ERROR_UNABLE_TO_REMOVE_TIMER) +PVRE(PVRSRV_ERROR_UNKNOWN_PIXEL_FORMAT) +PVRE(PVRSRV_ERROR_UNKNOWN_SCRIPT_OPERATION) +PVRE(PVRSRV_ERROR_HANDLE_INDEX_OUT_OF_RANGE) +PVRE(PVRSRV_ERROR_HANDLE_NOT_ALLOCATED) +PVRE(PVRSRV_ERROR_HANDLE_TYPE_MISMATCH) +PVRE(PVRSRV_ERROR_UNABLE_TO_ADD_HANDLE) +PVRE(PVRSRV_ERROR_HANDLE_NOT_SHAREABLE) +PVRE(PVRSRV_ERROR_HANDLE_NOT_FOUND) +PVRE(PVRSRV_ERROR_INVALID_SUBHANDLE) +PVRE(PVRSRV_ERROR_HANDLE_BATCH_IN_USE) +PVRE(PVRSRV_ERROR_HANDLE_BATCH_COMMIT_FAILURE) +PVRE(PVRSRV_ERROR_UNABLE_TO_CREATE_HASH_TABLE) +PVRE(PVRSRV_ERROR_INSERT_HASH_TABLE_DATA_FAILED) +PVRE(PVRSRV_ERROR_UNSUPPORTED_BACKING_STORE) +PVRE(PVRSRV_ERROR_UNABLE_TO_DESTROY_BM_HEAP) +PVRE(PVRSRV_ERROR_UNKNOWN_INIT_SERVER_STATE) +PVRE(PVRSRV_ERROR_NO_FREE_DEVICEIDS_AVAILABLE) +PVRE(PVRSRV_ERROR_INVALID_DEVICEID) +PVRE(PVRSRV_ERROR_DEVICEID_NOT_FOUND) +PVRE(PVRSRV_ERROR_MEMORY_TEST_FAILED) +PVRE(PVRSRV_ERROR_CPUPADDR_TEST_FAILED) +PVRE(PVRSRV_ERROR_COPY_TEST_FAILED) +PVRE(PVRSRV_ERROR_SEMAPHORE_NOT_INITIALISED) +PVRE(PVRSRV_ERROR_UNABLE_TO_RELEASE_CLOCK) +PVRE(PVRSRV_ERROR_CLOCK_REQUEST_FAILED) +PVRE(PVRSRV_ERROR_DISABLE_CLOCK_FAILURE) +PVRE(PVRSRV_ERROR_UNABLE_TO_SET_CLOCK_RATE) +PVRE(PVRSRV_ERROR_UNABLE_TO_ROUND_CLOCK_RATE) +PVRE(PVRSRV_ERROR_UNABLE_TO_ENABLE_CLOCK) +PVRE(PVRSRV_ERROR_UNABLE_TO_GET_CLOCK) +PVRE(PVRSRV_ERROR_UNABLE_TO_GET_PARENT_CLOCK) +PVRE(PVRSRV_ERROR_UNABLE_TO_GET_SYSTEM_CLOCK) +PVRE(PVRSRV_ERROR_UNKNOWN_SGL_ERROR) +PVRE(PVRSRV_ERROR_SYSTEM_POWER_CHANGE_FAILURE) +PVRE(PVRSRV_ERROR_DEVICE_POWER_CHANGE_FAILURE) +PVRE(PVRSRV_ERROR_DEVICE_POWER_CHANGE_DENIED) +PVRE(PVRSRV_ERROR_BAD_SYNC_STATE) +PVRE(PVRSRV_ERROR_CACHEOP_FAILED) +PVRE(PVRSRV_ERROR_UNABLE_TO_SET_CACHE_MODE) +PVRE(PVRSRV_ERROR_FAILED_TO_ALLOC_MMUCONTEXT_ID) +PVRE(PVRSRV_ERROR_PARAMETER_BUFFER_INVALID_ALIGNMENT) +PVRE(PVRSRV_ERROR_UNABLE_TO_ACQUIRE_CONNECTION) +PVRE(PVRSRV_ERROR_UNABLE_TO_RELEASE_CONNECTION) +PVRE(PVRSRV_ERROR_PHYSHEAP_ID_IN_USE) +PVRE(PVRSRV_ERROR_PHYSHEAP_ID_INVALID) +PVRE(PVRSRV_ERROR_HP_REQUEST_TOO_LONG) +PVRE(PVRSRV_ERROR_INVALID_SYNC_PRIM) +PVRE(PVRSRV_ERROR_INVALID_SYNC_PRIM_OP) +PVRE(PVRSRV_ERROR_INVALID_SYNC_CONTEXT) +PVRE(PVRSRV_ERROR_BP_NOT_SET) +PVRE(PVRSRV_ERROR_BP_ALREADY_SET) +PVRE(PVRSRV_ERROR_FEATURE_DISABLED) +PVRE(PVRSRV_ERROR_REG_CONFIG_ENABLED) +PVRE(PVRSRV_ERROR_REG_CONFIG_FULL) +PVRE(PVRSRV_ERROR_REG_CONFIG_INVALID_PI) +PVRE(PVRSRV_ERROR_MEMORY_ACCESS) +PVRE(PVRSRV_ERROR_NO_SYSTEM_BUFFER) +PVRE(PVRSRV_ERROR_DC_INVALID_CONFIG) +PVRE(PVRSRV_ERROR_DC_INVALID_CROP_RECT) +PVRE(PVRSRV_ERROR_DC_INVALID_DISPLAY_RECT) +PVRE(PVRSRV_ERROR_DC_INVALID_BUFFER_DIMS) +PVRE(PVRSRV_ERROR_DC_INVALID_TRANSFORM) +PVRE(PVRSRV_ERROR_DC_INVALID_SCALE) +PVRE(PVRSRV_ERROR_DC_INVALID_CUSTOM) +PVRE(PVRSRV_ERROR_DC_TOO_MANY_PIPES) +PVRE(PVRSRV_ERROR_DC_INVALID_PLANE_ALPHA) +PVRE(PVRSRV_ERROR_NOT_READY) +PVRE(PVRSRV_ERROR_RESOURCE_UNAVAILABLE) +PVRE(PVRSRV_ERROR_UNSUPPORTED_PIXEL_FORMAT) +PVRE(PVRSRV_ERROR_UNSUPPORTED_DIMS) +PVRE(PVRSRV_ERROR_UNSUPPORTED_CACHE_MODE) +PVRE(PVRSRV_ERROR_UNABLE_TO_ADD_TIMER) +PVRE(PVRSRV_ERROR_NOT_FOUND) +PVRE(PVRSRV_ERROR_ALREADY_OPEN) +PVRE(PVRSRV_ERROR_STREAM_MISUSE) +PVRE(PVRSRV_ERROR_STREAM_FULL) +PVRE(PVRSRV_ERROR_PHYSMEM_NOT_ALLOCATED) +PVRE(PVRSRV_ERROR_PBSIZE_ALREADY_MAX) +PVRE(PVRSRV_ERROR_PBSIZE_ALREADY_MIN) +PVRE(PVRSRV_ERROR_INVALID_PB_CONFIG) +PVRE(PVRSRV_ERROR_META_THREAD0_NOT_ENABLED) +PVRE(PVRSRV_ERROR_NOT_AUTHENTICATED) +PVRE(PVRSRV_ERROR_REQUEST_TDMETACODE_PAGES_FAIL) +PVRE(PVRSRV_ERROR_INIT_TDMETACODE_PAGES_FAIL) +PVRE(PVRSRV_ERROR_REQUEST_TDSECUREBUF_PAGES_FAIL) +PVRE(PVRSRV_ERROR_INIT_TDSECUREBUF_PAGES_FAIL) +PVRE(PVRSRV_ERROR_MUTEX_ALREADY_CREATED) +PVRE(PVRSRV_ERROR_DBGTABLE_ALREADY_REGISTERED) +PVRE(PVRSRV_ERROR_ALREADY_EXISTS) +PVRE(PVRSRV_ERROR_UNABLE_TO_SEND_PULSE) +PVRE(PVRSRV_ERROR_TASK_FAILED) +PVRE(PVRSRV_ERROR_DEVICE_IDLE_REQUEST_DENIED) +PVRE(PVRSRV_ERROR_INVALID_GPU_ADDR) +PVRE(PVRSRV_ERROR_INVALID_OFFSET) +PVRE(PVRSRV_ERROR_CCCB_STALLED) +PVRE(PVRSRV_ERROR_BUFFER_TOO_SMALL) +PVRE(PVRSRV_ERROR_INTERNAL_ERROR) diff --git a/drivers/gpu/rogue_m/include/pvrsrv_memallocflags.h b/drivers/gpu/rogue_m/include/pvrsrv_memallocflags.h new file mode 100644 index 000000000000..094f1579b4d9 --- /dev/null +++ b/drivers/gpu/rogue_m/include/pvrsrv_memallocflags.h @@ -0,0 +1,528 @@ +/*************************************************************************/ /*! +@File +@Title Device Memory Management +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description This file defines flags used on memory allocations and mappings + These flags are relevant throughout the memory management + software stack and are specified by users of services and + understood by all levels of the memory management in both + client and server. +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef PVRSRV_MEMALLOCFLAGS_H +#define PVRSRV_MEMALLOCFLAGS_H + +#include "img_types.h" +#if defined(SUPPORT_RGX) +#include "rgx_memallocflags.h" +#endif +typedef IMG_UINT32 PVRSRV_MEMALLOCFLAGS_T; + +/*! + * ********************************************************** + * * * + * * MAPPING FLAGS * + * * * + * ********************************************************** + * + * PVRSRV_MEMALLOCFLAG_GPU_READABLE + * + * This flag affects the device MMU protection flags, and specifies + * that the memory may be read by the GPU (is this always true?) + * + * Typically all device memory allocations would specify this flag. + * + * At the moment, memory allocations without this flag are not supported + * + * This flag will live with the PMR, thus subsequent mappings would + * honour this flag. + * + * This is a dual purpose flag. It specifies that memory is permitted + * to be read by the GPU, and also requests that the allocation is + * mapped into the GPU as a readable mapping + * + * To be clear: + * - When used as an argument on PMR creation; it specifies + * that GPU readable mappings will be _permitted_ + * - When used as an argument to a "map" function: it specifies + * that a GPU readable mapping is _desired_ + * - When used as an argument to "AllocDeviceMem": it specifies + * that the PMR will be created with permission to be mapped + * with a GPU readable mapping, _and_ that this PMR will be + * mapped with a GPU readble mapping. + * This distinction becomes important when (a) we export allocations; + * and (b) when we separate the creation of the PMR from the mapping. + */ +#define PVRSRV_MEMALLOCFLAG_GPU_READABLE (1U<<0) +#define PVRSRV_CHECK_GPU_READABLE(uiFlags) ((uiFlags & PVRSRV_MEMALLOCFLAG_GPU_READABLE) != 0) + +/*! + * PVRSRV_MEMALLOCFLAG_GPU_WRITEABLE + * + * This flag affects the device MMU protection flags, and specifies + * that the memory may be written by the GPU + * + * Using this flag on an allocation signifies that the allocation is + * intended to be written by the GPU. + * + * Omitting this flag causes a read-only mapping. + * + * This flag will live with the PMR, thus subsequent mappings would + * honour this flag. + * + * This is a dual purpose flag. It specifies that memory is permitted + * to be written by the GPU, and also requests that the allocation is + * mapped into the GPU as a writeable mapping (see note above about + * permission vs. mapping mode, and why this flag causes permissions + * to be inferred from mapping mode on first allocation) + * + * N.B. This flag has no relevance to the CPU's MMU mapping, if any, + * and would therefore not enforce read-only mapping on CPU. + */ +#define PVRSRV_MEMALLOCFLAG_GPU_WRITEABLE (1U<<1) /*!< mapped as writeable to the GPU */ +#define PVRSRV_CHECK_GPU_WRITEABLE(uiFlags) ((uiFlags & PVRSRV_MEMALLOCFLAG_GPU_WRITEABLE) != 0) + +#define PVRSRV_MEMALLOCFLAG_GPU_READ_PERMITTED (1U<<2) /*!< can be mapped is GPU readable in another GPU mem context */ +#define PVRSRV_CHECK_GPU_READ_PERMITTED(uiFlags) ((uiFlags & PVRSRV_MEMALLOCFLAG_GPU_READ_PERMITTED) != 0) + +#define PVRSRV_MEMALLOCFLAG_GPU_WRITE_PERMITTED (1U<<3) /*!< can be mapped is GPU writable in another GPU mem context */ +#define PVRSRV_CHECK_GPU_WRITE_PERMITTED(uiFlags) ((uiFlags & PVRSRV_MEMALLOCFLAG_GPU_WRITE_PERMITTED) != 0) + +#define PVRSRV_MEMALLOCFLAG_CPU_READABLE (1U<<4) /*!< mapped as readable to the CPU */ +#define PVRSRV_CHECK_CPU_READABLE(uiFlags) ((uiFlags & PVRSRV_MEMALLOCFLAG_CPU_READABLE) != 0) + +#define PVRSRV_MEMALLOCFLAG_CPU_WRITEABLE (1U<<5) /*!< mapped as writeable to the CPU */ +#define PVRSRV_CHECK_CPU_WRITEABLE(uiFlags) ((uiFlags & PVRSRV_MEMALLOCFLAG_CPU_WRITEABLE) != 0) + +#define PVRSRV_MEMALLOCFLAG_CPU_READ_PERMITTED (1U<<6) /*!< can be mapped is CPU readable in another CPU mem context */ +#define PVRSRV_CHECK_CPU_READ_PERMITTED(uiFlags) ((uiFlags & PVRSRV_MEMALLOCFLAG_CPU_READ_PERMITTED) != 0) + +#define PVRSRV_MEMALLOCFLAG_CPU_WRITE_PERMITTED (1U<<7) /*!< can be mapped is CPU writable in another CPU mem context */ +#define PVRSRV_CHECK_CPU_WRITE_PERMITTED(uiFlags) ((uiFlags & PVRSRV_MEMALLOCFLAG_CPU_WRITE_PERMITTED) != 0) + + +/* + * ********************************************************** + * * * + * * CACHE CONTROL FLAGS * + * * * + * ********************************************************** + */ + +/* + GPU domain + ========== + + The following defines are used to control the GPU cache bit field. + The defines are mutually exclusive. + + A helper macro, PVRSRV_GPU_CACHE_MODE, is provided to obtain just the GPU cache + bit field from the flags. This should be used whenever the GPU cache mode + needs to be determined. +*/ + +/*! + GPU domain. Request uncached memory. This means that any writes to memory + allocated with this flag are written straight to memory and thus are coherent + for any device in the system. +*/ +#define PVRSRV_MEMALLOCFLAG_GPU_UNCACHED (0U<<8) +#define PVRSRV_CHECK_GPU_UNCACHED(uiFlags) ((uiFlags & PVRSRV_MEMALLOCFLAG_GPU_UNCACHED) != 0) + +/*! + GPU domain. Use write combiner (if supported) to combine sequential writes + together to reduce memory access by doing burst writes. +*/ +#define PVRSRV_MEMALLOCFLAG_GPU_WRITE_COMBINE (1U<<8) +#define PVRSRV_CHECK_GPU_WRITE_COMBINE(uiFlags) ((uiFlags & PVRSRV_MEMALLOCFLAG_GPU_WRITE_COMBINE) != 0) + +/*! + GPU domain. This flag affects the device MMU protection flags. + + This flag ensures that the GPU and the CPU will always be coherent. + This is done by either by snooping each others caches or, if this is + not supported, by making the allocation uncached. Please note that + this will _not_ guaranty coherency with memory so if this memory + is accessed by another device (eg display controller) a flush will + be required. +*/ +#define PVRSRV_MEMALLOCFLAG_GPU_CACHE_COHERENT (2U<<8) +#define PVRSRV_CHECK_GPU_CACHE_COHERENT(uiFlags) ((uiFlags & PVRSRV_MEMALLOCFLAG_GPU_CACHE_COHERENT) != 0) + +/*! + GPU domain. Request cached memory, but not coherent (i.e. no cache snooping). + This means that if the allocation needs to transition from one device + to another services has to be informed so it can flush/invalidate the + appropriate caches. + + Note: We reserve 3 bits in the CPU/GPU cache mode to allow for future + expansion. +*/ +#define PVRSRV_MEMALLOCFLAG_GPU_CACHE_INCOHERENT (3U<<8) +#define PVRSRV_CHECK_GPU_CACHE_INCOHERENT(uiFlags) ((uiFlags & PVRSRV_MEMALLOCFLAG_GPU_CACHE_INCOHERENT) != 0) + +/*! + GPU domain. + + Request cached cached coherent memory. This is like + PVRSRV_MEMALLOCFLAG_GPU_CACHE_COHERENT but doesn't fall back on + uncached memory if the system doesn't support cache-snooping + but rather returns an error. +*/ +#define PVRSRV_MEMALLOCFLAG_GPU_CACHED_CACHE_COHERENT (4U<<8) +#define PVRSRV_CHECK_GPU_CACHED_CACHE_COHERENT(uiFlags) ((uiFlags & PVRSRV_MEMALLOCFLAG_GPU_CACHED_CACHE_COHERENT) != 0) + +/*! + GPU domain. + + This flag is for internal use only and is used to indicate + that the underlying allocation should be cached on the GPU + after all the snooping and coherent checks have been done +*/ +#define PVRSRV_MEMALLOCFLAG_GPU_CACHED (7U<<8) +#define PVRSRV_CHECK_GPU_CACHED(uiFlags) ((uiFlags & PVRSRV_MEMALLOCFLAG_GPU_CACHED) != 0) + +/*! + GPU domain. + + GPU cache mode mask +*/ +#define PVRSRV_MEMALLOCFLAG_GPU_CACHE_MODE_MASK (7U<<8) +#define PVRSRV_GPU_CACHE_MODE(uiFlags) (uiFlags & PVRSRV_MEMALLOCFLAG_GPU_CACHE_MODE_MASK) + + +/* + CPU domain + ========== + + The following defines are used to control the CPU cache bit field. + The defines are mutually exclusive. + + A helper macro, PVRSRV_CPU_CACHE_MODE, is provided to obtain just the CPU cache + bit field from the flags. This should be used whenever the CPU cache mode + needs to be determined. +*/ + +/*! + CPU domain. Request uncached memory. This means that any writes to memory + allocated with this flag are written straight to memory and thus are coherent + for any device in the system. +*/ +#define PVRSRV_MEMALLOCFLAG_CPU_UNCACHED (0U<<11) +#define PVRSRV_CHECK_CPU_UNCACHED(uiFlags) ((uiFlags & PVRSRV_MEMALLOCFLAG_CPU_UNCACHED) != 0) + +/*! + CPU domain. Use write combiner (if supported) to combine sequential writes + together to reduce memory access by doing burst writes. +*/ +#define PVRSRV_MEMALLOCFLAG_CPU_WRITE_COMBINE (1U<<11) +#define PVRSRV_CHECK_CPU_WRITE_COMBINE(uiFlags) ((uiFlags & PVRSRV_MEMALLOCFLAG_CPU_WRITE_COMBINE) != 0) + +/*! + CPU domain. This flag affects the device MMU protection flags. + + This flag ensures that the GPU and the CPU will always be coherent. + This is done by either by snooping each others caches or, if this is + not supported, by making the allocation uncached. Please note that + this will _not_ guaranty coherency with memory so if this memory + is accessed by another device (eg display controller) a flush will + be required. +*/ +#define PVRSRV_MEMALLOCFLAG_CPU_CACHE_COHERENT (2U<<11) +#define PVRSRV_CHECK_CPU_CACHE_COHERENT(uiFlags) ((uiFlags & PVRSRV_MEMALLOCFLAG_CPU_CACHE_COHERENT) != 0) + +/*! + CPU domain. Request cached memory, but not coherent (i.e. no cache snooping). + This means that if the allocation needs to transition from one device + to another services has to be informed so it can flush/invalidate the + appropriate caches. + + Note: We reserve 3 bits in the CPU/GPU cache mode to allow for future + expansion. +*/ +#define PVRSRV_MEMALLOCFLAG_CPU_CACHE_INCOHERENT (3U<<11) +#define PVRSRV_CHECK_CPU_CACHE_INCOHERENT(uiFlags) ((uiFlags & PVRSRV_MEMALLOCFLAG_CPU_CACHE_INCOHERENT) != 0) + +/*! + CPU domain. + + Request cached cached coherent memory. This is like + PVRSRV_MEMALLOCFLAG_CPU_CACHE_COHERENT but doesn't fall back on + uncached memory if the system doesn't support cache-snooping + but rather returns an error. +*/ +#define PVRSRV_MEMALLOCFLAG_CPU_CACHED_CACHE_COHERENT (4U<<11) +#define PVRSRV_CHECK_CPU_CACHED_CACHE_COHERENT(uiFlags) ((uiFlags & PVRSRV_MEMALLOCFLAG_CPU_CACHED_CACHE_COHERENT) != 0) + +/*! + CPU domain. + + This flag is for internal use only and is used to indicate + that the underlying allocation should be cached on the CPU + after all the snooping and coherent checks have been done +*/ +#define PVRSRV_MEMALLOCFLAG_CPU_CACHED (7U<<11) +#define PVRSRV_CHECK_CPU_CACHED(uiFlags) ((uiFlags & PVRSRV_MEMALLOCFLAG_CPU_CACHED) != 0) + +/*! + CPU domain. + + CPU cache mode mask +*/ +#define PVRSRV_MEMALLOCFLAG_CPU_CACHE_MODE_MASK (7U<<11) +#define PVRSRV_CPU_CACHE_MODE(uiFlags) (uiFlags & PVRSRV_MEMALLOCFLAG_CPU_CACHE_MODE_MASK) + +/* Helper flags for usual cases */ +#define PVRSRV_MEMALLOCFLAG_UNCACHED (PVRSRV_MEMALLOCFLAG_GPU_UNCACHED | PVRSRV_MEMALLOCFLAG_CPU_UNCACHED) /*!< Memory will be uncached */ +#define PVRSRV_CHECK_UNCACHED(uiFlags) ((uiFlags & PVRSRV_MEMALLOCFLAG_UNCACHED) != 0) + +#define PVRSRV_MEMALLOCFLAG_WRITE_COMBINE (PVRSRV_MEMALLOCFLAG_GPU_WRITE_COMBINE | PVRSRV_MEMALLOCFLAG_CPU_WRITE_COMBINE) /*!< Memory will be write-combined */ +#define PVRSRV_CHECK_WRITE_COMBINE(uiFlags) ((uiFlags & PVRSRV_MEMALLOCFLAG_WRITE_COMBINE) != 0) + +#define PVRSRV_MEMALLOCFLAG_CACHE_COHERENT (PVRSRV_MEMALLOCFLAG_GPU_CACHE_COHERENT | PVRSRV_MEMALLOCFLAG_CPU_CACHE_COHERENT) /*!< Memory will be cache-coherent */ +#define PVRSRV_CHECK_CACHE_COHERENT(uiFlags) ((uiFlags & PVRSRV_MEMALLOCFLAG_CACHE_COHERENT) != 0) + +#define PVRSRV_MEMALLOCFLAG_CACHE_INCOHERENT (PVRSRV_MEMALLOCFLAG_GPU_CACHE_INCOHERENT | PVRSRV_MEMALLOCFLAG_CPU_CACHE_INCOHERENT) /*!< Memory will be cache-incoherent */ +#define PVRSRV_CHECK_CACHE_INCOHERENT(uiFlags) ((uiFlags & PVRSRV_MEMALLOCFLAG_CACHE_INCOHERENT) != 0) + + +/*! + CPU MMU Flags mask -- intended for use internal to services only + */ +#define PVRSRV_MEMALLOCFLAGS_CPU_MMUFLAGSMASK (PVRSRV_MEMALLOCFLAG_CPU_READABLE | \ + PVRSRV_MEMALLOCFLAG_CPU_WRITEABLE | \ + PVRSRV_MEMALLOCFLAG_CPU_CACHE_MODE_MASK) + +/*! + MMU Flags mask -- intended for use internal to services only - used + for partitioning the flags bits and determining which flags to pass + down to mmu_common.c + */ +#define PVRSRV_MEMALLOCFLAGS_GPU_MMUFLAGSMASK (PVRSRV_MEMALLOCFLAG_GPU_READABLE | \ + PVRSRV_MEMALLOCFLAG_GPU_WRITEABLE | \ + PVRSRV_MEMALLOCFLAG_GPU_CACHE_MODE_MASK) + +/*! + PVRSRV_MEMALLOCFLAG_KERNEL_CPU_MAPPABLE + + Indicates that the PMR created due to this allocation will support + in-kernel CPU mappings. Only privileged processes may use this + flag as it may cause wastage of precious kernel virtual memory on + some platforms. + */ +#define PVRSRV_MEMALLOCFLAG_KERNEL_CPU_MAPPABLE (1U<<14) +#define PVRSRV_CHECK_KERNEL_CPU_MAPPABLE(uiFlags) ((uiFlags & PVRSRV_MEMALLOCFLAG_KERNEL_CPU_MAPPABLE) != 0) + + + +/* + * + * ********************************************************** + * * * + * * ALLOC MEMORY FLAGS * + * * * + * ********************************************************** + * + * (Bits 15) + * + */ +#define PVRSRV_MEMALLOCFLAG_NO_OSPAGES_ON_ALLOC (1U<<15) +#define PVRSRV_CHECK_ON_DEMAND(uiFlags) ((uiFlags & PVRSRV_MEMALLOCFLAG_NO_OSPAGES_ON_ALLOC) != 0) + +/*! + PVRSRV_MEMALLOCFLAG_CPU_LOCAL + + Indicates that the allocation will primarily be accessed by + the CPU, so a UMA allocation (if available) is preferable. + If not set, the allocation will primarily be accessed by + the GPU, so LMA allocation (if available) is preferable. + */ +#define PVRSRV_MEMALLOCFLAG_CPU_LOCAL (1U<<16) +#define PVRSRV_CHECK_CPU_LOCAL(uiFlags) ((uiFlags & PVRSRV_MEMALLOCFLAG_CPU_LOCAL) != 0) + +/* + * + * ********************************************************** + * * * + * * MEMORY ZEROING AND POISONING FLAGS * + * * * + * ********************************************************** + * + * Zero / Poison, on alloc/free + * + * We think the following usecases are required: + * + * don't poison or zero on alloc or free + * (normal operation, also most efficient) + * poison on alloc + * (for helping to highlight bugs) + * poison on alloc and free + * (for helping to highlight bugs) + * zero on alloc + * (avoid highlighting security issues in other uses of memory) + * zero on alloc and poison on free + * (avoid highlighting security issues in other uses of memory, + * while helping to highlight a subset of bugs e.g. memory + * freed prematurely) + * + * Since there are more than 4, we can't encode this in just two bits, + * so we might as well have a separate flag for each of the three + * actions. + */ + +/*! + PVRSRV_MEMALLOCFLAG_ZERO_ON_ALLOC + Ensures that the memory allocated is initialized with zeroes. + */ +#define PVRSRV_MEMALLOCFLAG_ZERO_ON_ALLOC (1U<<31) +#define PVRSRV_CHECK_ZERO_ON_ALLOC(uiFlags) ((uiFlags & PVRSRV_MEMALLOCFLAG_ZERO_ON_ALLOC) != 0) + +/*! + VRSRV_MEMALLOCFLAG_POISON_ON_ALLOC + + Scribbles over the allocated memory with a poison value + + Not compatible with ZERO_ON_ALLOC + + Poisoning is very deliberately _not_ reflected in PDump as we want + a simulation to cry loudly if the initialised data propogates to a + result. + */ +#define PVRSRV_MEMALLOCFLAG_POISON_ON_ALLOC (1U<<30) +#define PVRSRV_CHECK_POISON_ON_ALLOC(uiFlags) ((uiFlags & PVRSRV_MEMALLOCFLAG_POISON_ON_ALLOC) != 0) + +/*! + PVRSRV_MEMALLOCFLAG_POISON_ON_FREE + + Causes memory to be trashed when freed, as a lazy man's security + measure. + */ +#define PVRSRV_MEMALLOCFLAG_POISON_ON_FREE (1U<<29) +#define PVRSRV_CHECK_POISON_ON_FREE(uiFlags) ((uiFlags & PVRSRV_MEMALLOCFLAG_POISON_ON_FREE) != 0) + +/* + * + * ********************************************************** + * * * + * * Device specific MMU flags * + * * * + * ********************************************************** + * + * (Bits 24 to 27) + * + * Some services controled devices have device specific control + * bits in their page table entries, we need to allow these flags + * to be passed down the memory managament layers so the user + * can control these bits. + */ + +#define PVRSRV_MEMALLOCFLAG_DEVICE_FLAGS_OFFSET 24 +#define PVRSRV_MEMALLOCFLAG_DEVICE_FLAGS_MASK 0x0f000000UL +#define PVRSRV_MEMALLOCFLAG_DEVICE_FLAG(n) \ + (((n) << PVRSRV_MEMALLOCFLAG_DEVICE_FLAGS_OFFSET) & \ + PVRSRV_MEMALLOCFLAG_DEVICE_FLAGS_MASK) + +/*! + PMR flags mask -- for internal services use only. This is the set + of flags that will be passed down and stored with the PMR, this also + includes the MMU flags which the PMR has to pass down to mm_common.c + at PMRMap time. +*/ +#define PVRSRV_MEMALLOCFLAGS_PMRFLAGSMASK (PVRSRV_MEMALLOCFLAG_DEVICE_FLAGS_MASK | \ + PVRSRV_MEMALLOCFLAG_KERNEL_CPU_MAPPABLE | \ + PVRSRV_MEMALLOCFLAG_ZERO_ON_ALLOC | \ + PVRSRV_MEMALLOCFLAG_POISON_ON_ALLOC | \ + PVRSRV_MEMALLOCFLAG_POISON_ON_FREE | \ + PVRSRV_MEMALLOCFLAGS_GPU_MMUFLAGSMASK | \ + PVRSRV_MEMALLOCFLAGS_CPU_MMUFLAGSMASK | \ + PVRSRV_MEMALLOCFLAG_NO_OSPAGES_ON_ALLOC | \ + PVRSRV_MEMALLOCFLAG_CPU_LOCAL) + +#if ((~(PVRSRV_MEMALLOCFLAGS_PMRFLAGSMASK) & PVRSRV_MEMALLOCFLAGS_GPU_MMUFLAGSMASK) != 0) +#error PVRSRV_MEMALLOCFLAGS_GPU_MMUFLAGSMASK is not a subset of PVRSRV_MEMALLOCFLAGS_PMRFLAGSMASK +#endif + +/*! + RA differentiation mask + + for use internal to services + + this is the set of flags bits that are able to determine whether a + pair of allocations are permitted to live in the same page table. + Allocations whose flags differ in any of these places would be + allocated from separate RA Imports and therefore would never coexist + in the same page +*/ +#define PVRSRV_MEMALLOCFLAGS_RA_DIFFERENTIATION_MASK (PVRSRV_MEMALLOCFLAG_GPU_READABLE | \ + PVRSRV_MEMALLOCFLAG_GPU_WRITEABLE | \ + PVRSRV_MEMALLOCFLAG_CPU_READABLE | \ + PVRSRV_MEMALLOCFLAG_CPU_WRITEABLE | \ + PVRSRV_MEMALLOCFLAG_GPU_CACHE_MODE_MASK | \ + PVRSRV_MEMALLOCFLAG_CPU_CACHE_MODE_MASK | \ + PVRSRV_MEMALLOCFLAG_POISON_ON_FREE | \ + PVRSRV_MEMALLOCFLAGS_PMRFLAGSMASK | \ + PVRSRV_MEMALLOCFLAG_NO_OSPAGES_ON_ALLOC) + +#if ((~(PVRSRV_MEMALLOCFLAGS_RA_DIFFERENTIATION_MASK) & PVRSRV_MEMALLOCFLAGS_PMRFLAGSMASK) != 0) +#error PVRSRV_MEMALLOCFLAGS_PMRFLAGSMASK is not a subset of PVRSRV_MEMALLOCFLAGS_RA_DIFFERENTIATION_MASK +#endif + +/*! + Flags that affect _allocation_ +*/ +#define PVRSRV_MEMALLOCFLAGS_PERALLOCFLAGSMASK (0xFFFFFFFFU) + +/*! + Flags that affect _mapping_ +*/ +#define PVRSRV_MEMALLOCFLAGS_PERMAPPINGFLAGSMASK (PVRSRV_MEMALLOCFLAG_DEVICE_FLAGS_MASK | \ + PVRSRV_MEMALLOCFLAG_GPU_READABLE | \ + PVRSRV_MEMALLOCFLAG_GPU_WRITEABLE | \ + PVRSRV_MEMALLOCFLAG_CPU_READABLE | \ + PVRSRV_MEMALLOCFLAG_CPU_WRITEABLE | \ + PVRSRV_MEMALLOCFLAG_GPU_CACHE_MODE_MASK | \ + PVRSRV_MEMALLOCFLAG_CPU_CACHE_MODE_MASK | \ + PVRSRV_MEMALLOCFLAG_NO_OSPAGES_ON_ALLOC) + +#if ((~(PVRSRV_MEMALLOCFLAGS_RA_DIFFERENTIATION_MASK) & PVRSRV_MEMALLOCFLAGS_PERMAPPINGFLAGSMASK) != 0) +#error PVRSRV_MEMALLOCFLAGS_PERMAPPINGFLAGSMASK is not a subset of PVRSRV_MEMALLOCFLAGS_RA_DIFFERENTIATION_MASK +#endif + +#endif /* #ifndef PVRSRV_MEMALLOCFLAGS_H */ + diff --git a/drivers/gpu/rogue_m/include/pvrversion.h b/drivers/gpu/rogue_m/include/pvrversion.h new file mode 100644 index 000000000000..94d0002b11f1 --- /dev/null +++ b/drivers/gpu/rogue_m/include/pvrversion.h @@ -0,0 +1,91 @@ +/*************************************************************************/ /*! +@File +@Title Version numbers and strings. +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Version numbers and strings for PVR Consumer services + components. +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef _PVRVERSION_H_ +#define _PVRVERSION_H_ + +/* + * Rogue KM Version Note + * + * L 1.17: + * Support gpu disable dvfs case. + * Add rk_tf_check_version to compatible for rk3328. + * L 1.18: + * If fix freq,then don't force to drop freq to the lowest. + * + * M 1.21: + * Merge 1.5_RTM3604260 DDK code. + * M 1.24: + * Merge 1.5_ED3653583 DDK code. + * M 1.28: + * Merge 1.5_ED3776568 DDK code. + */ + +#define PVR_STR(X) #X +#define PVR_STR2(X) PVR_STR(X) + +#define PVRVERSION_MAJ 1 +#define PVRVERSION_MIN 5 + +#define PVRVERSION_FAMILY "rogueddk" +#define PVRVERSION_BRANCHNAME "1.5" +#define PVRVERSION_BUILD 3776568 +#define PVRVERSION_BSCONTROL "Rogue_DDK_Android" + +#define PVRVERSION_STRING "Rogue_DDK_Android rogueddk 1.5@" PVR_STR2(PVRVERSION_BUILD) +#define PVRVERSION_STRING_SHORT "1.5@" PVR_STR2(PVRVERSION_BUILD) "" + +#define COPYRIGHT_TXT "Copyright (c) Imagination Technologies Ltd. All Rights Reserved." + +#define PVRVERSION_BUILD_HI 377 +#define PVRVERSION_BUILD_LO 6568 +#define PVRVERSION_STRING_NUMERIC PVR_STR2(PVRVERSION_MAJ) "." PVR_STR2(PVRVERSION_MIN) "." PVR_STR2(PVRVERSION_BUILD_HI) "." PVR_STR2(PVRVERSION_BUILD_LO) + +#define PVRVERSION_PACK(MAJ,MIN) ((((MAJ)&0xFFFF) << 16) | (((MIN)&0xFFFF) << 0)) +#define PVRVERSION_UNPACK_MAJ(VERSION) (((VERSION) >> 16) & 0xFFFF) +#define PVRVERSION_UNPACK_MIN(VERSION) (((VERSION) >> 0) & 0xFFFF) + +//chenli:define rockchip version +#define RKVERSION "KM M 1.28" +#endif /* _PVRVERSION_H_ */ diff --git a/drivers/gpu/rogue_m/include/rgx_common.h b/drivers/gpu/rogue_m/include/rgx_common.h new file mode 100644 index 000000000000..1ffd810791ce --- /dev/null +++ b/drivers/gpu/rogue_m/include/rgx_common.h @@ -0,0 +1,146 @@ +/*************************************************************************/ /*! +@File +@Title RGX Common Types and Defines Header +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Common types and definitions for RGX software +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ +#ifndef RGX_COMMON_H_ +#define RGX_COMMON_H_ + +#if defined (__cplusplus) +extern "C" { +#endif + +#include "img_defs.h" + +/* Included to get the BVNC_KM_N defined and other feature defs */ +#include "km/rgxdefs_km.h" + +/*! This macro represents a mask of LSBs that must be zero on data structure + * sizes and offsets to ensure they are 8-byte granular on types shared between + * the FW and host driver */ +#define RGX_FW_ALIGNMENT_LSB (7) + +/*! Macro to test structure size alignment */ +#define RGX_FW_STRUCT_SIZE_ASSERT(_a) \ + BLD_ASSERT((sizeof(_a)&RGX_FW_ALIGNMENT_LSB)==0, _a##struct_size) + +/*! Macro to test structure member alignment */ +#define RGX_FW_STRUCT_OFFSET_ASSERT(_a, _b) \ + BLD_ASSERT((offsetof(_a, _b)&RGX_FW_ALIGNMENT_LSB)==0, _a##struct_offset) + + +/*! The number of performance counters in each layout block */ +#if defined(RGX_FEATURE_CLUSTER_GROUPING) +#define RGX_HWPERF_CNTRS_IN_BLK 6 +#define RGX_HWPERF_CNTRS_IN_BLK_MIN 4 +#else +#define RGX_HWPERF_CNTRS_IN_BLK 4 +#define RGX_HWPERF_CNTRS_IN_BLK_MIN 4 +#endif + + +/*! The master definition for data masters known to the firmware of RGX. + * The DM in a V1 HWPerf packet uses this definition. */ +typedef enum _RGXFWIF_DM_ +{ + RGXFWIF_DM_GP = 0, + RGXFWIF_DM_2D = 1, + RGXFWIF_DM_TA = 2, + RGXFWIF_DM_3D = 3, + RGXFWIF_DM_CDM = 4, +#if defined(RGX_FEATURE_RAY_TRACING) + RGXFWIF_DM_RTU = 5, + RGXFWIF_DM_SHG = 6, +#endif + RGXFWIF_DM_LAST, + + RGXFWIF_DM_FORCE_I32 = 0x7fffffff /*!< Force enum to be at least 32-bits wide */ +} RGXFWIF_DM; + +#if defined(RGX_FEATURE_RAY_TRACING) +#define RGXFWIF_DM_MAX_MTS 8 +#else +#define RGXFWIF_DM_MAX_MTS 6 +#endif + +#if defined(RGX_FEATURE_RAY_TRACING) +/* Maximum number of DM in use: GP, 2D, TA, 3D, CDM, SHG, RTU */ +#define RGXFWIF_DM_MAX (7) +#else +#define RGXFWIF_DM_MAX (5) +#endif + +/* Min/Max number of HW DMs (all but GP) */ +#if defined(RGX_FEATURE_TLA) +#define RGXFWIF_HWDM_MIN (1) +#else +#define RGXFWIF_HWDM_MIN (2) +#endif +#define RGXFWIF_HWDM_MAX (RGXFWIF_DM_MAX) + +/*! + ****************************************************************************** + * RGXFW Compiler alignment definitions + *****************************************************************************/ +#if defined(__GNUC__) +#define RGXFW_ALIGN __attribute__ ((aligned (8))) +#elif defined(_MSC_VER) +#define RGXFW_ALIGN __declspec(align(8)) +#pragma warning (disable : 4324) +#else +#error "Align MACROS need to be defined for this compiler" +#endif + +/*! + ****************************************************************************** + * Force 8-byte alignment for structures allocated uncached. + *****************************************************************************/ +#define UNCACHED_ALIGN RGXFW_ALIGN + +#if defined (__cplusplus) +} +#endif + +#endif /* RGX_COMMON_H_ */ + +/****************************************************************************** + End of file +******************************************************************************/ + diff --git a/drivers/gpu/rogue_m/include/rgx_heaps.h b/drivers/gpu/rogue_m/include/rgx_heaps.h new file mode 100644 index 000000000000..e476f943f474 --- /dev/null +++ b/drivers/gpu/rogue_m/include/rgx_heaps.h @@ -0,0 +1,98 @@ +/*************************************************************************/ /*! +@File +@Title RGX heap definitions +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#if !defined(__RGX_HEAPS_H__) +#define __RGX_HEAPS_H__ + +#include "km/rgxdefs_km.h" + +/* RGX Heap IDs, note: not all heaps are available to clients */ +/* N.B. Old heap identifiers are deprecated now that the old memory + management is. New heap identifiers should be suitably renamed */ +#define RGX_UNDEFINED_HEAP_ID (~0LU) /*!< RGX Undefined Heap ID */ +#define RGX_GENERAL_HEAP_ID 0 /*!< RGX General Heap ID */ +#define RGX_PDSCODEDATA_HEAP_ID 1 /*!< RGX PDS Code/Data Heap ID */ +//#define RGX_3DPARAMETERS_HEAP_ID 2 /*!< RGX 3D Parameters Heap ID */ +#define RGX_USCCODE_HEAP_ID 2 /*!< RGX USC Code Heap ID */ +#define RGX_FIRMWARE_HEAP_ID 3 /*!< RGX Firmware Heap ID */ +#define RGX_TQ3DPARAMETERS_HEAP_ID 4 /*!< RGX Firmware Heap ID */ +#define RGX_BIF_TILING_HEAP_1_ID 5 /*!< RGX BIF Tiling Heap 1 ID */ +#define RGX_BIF_TILING_HEAP_2_ID 6 /*!< RGX BIF Tiling Heap 2 ID */ +#define RGX_BIF_TILING_HEAP_3_ID 7 /*!< RGX BIF Tiling Heap 3 ID */ +#define RGX_BIF_TILING_HEAP_4_ID 8 /*!< RGX BIF Tiling Heap 4 ID */ +#define RGX_HWBRN37200_HEAP_ID 9 /*!< RGX HWBRN37200 */ +#define RGX_DOPPLER_HEAP_ID 10 /*!< Doppler Heap ID */ +#define RGX_DOPPLER_OVERFLOW_HEAP_ID 11 /*!< Doppler Overflow Heap ID */ + +/* FIXME: work out what this ought to be. In the old days it was + typically bigger than it needed to be. Is the correct thing + "max + 1" ?? */ +#define RGX_MAX_HEAP_ID (RGX_DOPPLER_OVERFLOW_HEAP_ID + 1) /*!< Max Valid Heap ID */ + +/* + Identify heaps by their names +*/ +#define RGX_GENERAL_HEAP_IDENT "General" /*!< RGX General Heap Identifier */ +#define RGX_PDSCODEDATA_HEAP_IDENT "PDS Code and Data" /*!< RGX PDS Code/Data Heap Identifier */ +#define RGX_USCCODE_HEAP_IDENT "USC Code" /*!< RGX USC Code Heap Identifier */ +#define RGX_TQ3DPARAMETERS_HEAP_IDENT "TQ3DParameters" /*!< RGX TQ 3D Parameters Heap Identifier */ +#define RGX_BIF_TILING_HEAP_1_IDENT "BIF Tiling Heap l" /*!< RGX BIF Tiling Heap 1 identifier */ +#define RGX_BIF_TILING_HEAP_2_IDENT "BIF Tiling Heap 2" /*!< RGX BIF Tiling Heap 2 identifier */ +#define RGX_BIF_TILING_HEAP_3_IDENT "BIF Tiling Heap 3" /*!< RGX BIF Tiling Heap 3 identifier */ +#define RGX_BIF_TILING_HEAP_4_IDENT "BIF Tiling Heap 4" /*!< RGX BIF Tiling Heap 4 identifier */ +#define RGX_DOPPLER_HEAP_IDENT "Doppler" /*!< Doppler Heap Identifier */ +#define RGX_DOPPLER_OVERFLOW_HEAP_IDENT "Doppler Overflow" /*!< Doppler Heap Identifier */ + +/* BIF tiling heaps have specific buffer requirements based on their XStride + * configuration. This is detailed in the BIF tiling documentation and ensures + * that the bits swapped by the BIF tiling algorithm do not result in addresses + * outside the allocated buffer. The representation here reflects the diagram + * in the BIF tiling documentation. + * XStride is defined for a platform in sysconfig.h, but the resulting alignment + * can be queried through the PVRSRVGetHeapLog2ImportAlignment() API. + */ +#define RGX_BIF_TILING_HEAP_STRIDE_LOG2_FROM_XSTRIDE(X) (X+1+8) +#define RGX_BIF_TILING_HEAP_ALIGN_LOG2_FROM_XSTRIDE(X) (4+X+1+8) +#define RGX_BIF_TILING_HEAP_STRIDE_LOG2_FROM_ALIGN_LOG2(A) (A-4) + +#endif /* __RGX_HEAPS_H__ */ + diff --git a/drivers/gpu/rogue_m/include/rgx_hwperf_km.h b/drivers/gpu/rogue_m/include/rgx_hwperf_km.h new file mode 100644 index 000000000000..86880b4dbccd --- /dev/null +++ b/drivers/gpu/rogue_m/include/rgx_hwperf_km.h @@ -0,0 +1,385 @@ +/*************************************************************************/ /*! +@File +@Title RGX HWPerf Types and Defines Header +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Common data types definitions for hardware performance API +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ +#ifndef RGX_HWPERF_KM_H_ +#define RGX_HWPERF_KM_H_ + +/* + * This header file holds the HWPerf related macros and types needed by the + * code in the Kernel Mode (KM) server/driver module and its content is + * intended to be suitable for distribution under a public software license. + * The definitions within are common and may be used in user-mode, kernel-mode + * and firmware compilation units. + */ + +#if defined (__cplusplus) +extern "C" { +#endif + +#define RGX_HWPERF_V2_FORMAT 2 + +#include "rgx_common.h" + + +/****************************************************************************** + * Data Stream Common Types + *****************************************************************************/ + +/* These structures are used on both GPU and CPU and must be a size that is a + * multiple of 64 bits, 8 bytes to allow the FW to write 8 byte quantities + * at 8 byte aligned addresses. BLD_ASSERT() is used to check this. + */ + +/*! Type used to encode the event that generated the HW performance packet. + * NOTE: When this type is updated the corresponding hwperfbin2json tool source + * needs to be updated as well. Also need to update the table in rgxhwperf.c. + * The RGX_HWPERF_EVENT_MASK_* macros will also need updating when adding new + * types. + */ +typedef enum +{ + RGX_HWPERF_INVALID = 0x00, + /* FW types 0x01..0x07 */ + RGX_HWPERF_FW_BGSTART = 0x01, + RGX_HWPERF_FW_BGEND = 0x02, + RGX_HWPERF_FW_IRQSTART = 0x03, + + RGX_HWPERF_FW_IRQEND = 0x04, + RGX_HWPERF_FW_DBGSTART = 0x05, + RGX_HWPERF_FW_DBGEND = 0x06, + + /* HW types 0x08..0x18 */ + RGX_HWPERF_HW_TAKICK = 0x08, + RGX_HWPERF_HW_TAFINISHED = 0x09, + RGX_HWPERF_HW_3DTQKICK = 0x0A, +/* RGX_HWPERF_HW_3DTQFINISHED = 0x17, */ +/* RGX_HWPERF_HW_3DSPMKICK = 0x11, */ +/* RGX_HWPERF_HW_3DSPMFINISHED = 0x18, */ + RGX_HWPERF_HW_3DKICK = 0x0B, + + RGX_HWPERF_HW_3DFINISHED = 0x0C, + RGX_HWPERF_HW_CDMKICK = 0x0D, + RGX_HWPERF_HW_CDMFINISHED = 0x0E, + RGX_HWPERF_HW_TLAKICK = 0x0F, + + RGX_HWPERF_HW_TLAFINISHED = 0x10, + RGX_HWPERF_HW_3DSPMKICK = 0x11, + RGX_HWPERF_HW_PERIODIC = 0x12, + RGX_HWPERF_HW_RTUKICK = 0x13, + + RGX_HWPERF_HW_RTUFINISHED = 0x14, + RGX_HWPERF_HW_SHGKICK = 0x15, + RGX_HWPERF_HW_SHGFINISHED = 0x16, + RGX_HWPERF_HW_3DTQFINISHED = 0x17, + + RGX_HWPERF_HW_3DSPMFINISHED = 0x18, + + /* other types 0x1A..0x1F */ + RGX_HWPERF_CLKS_CHG = 0x1A, + RGX_HWPERF_GPU_STATE_CHG = 0x1B, + + /* power types 0x20..0x27 */ + RGX_HWPERF_PWR_EST_REQUEST = 0x20, + RGX_HWPERF_PWR_EST_READY = 0x21, + RGX_HWPERF_PWR_EST_RESULT = 0x22, + RGX_HWPERF_PWR_CHG = 0x23, + + /* context switch types 0x30..0x31 */ + RGX_HWPERF_CSW_START = 0x30, + RGX_HWPERF_CSW_FINISHED = 0x31, + + /* last */ + RGX_HWPERF_LAST_TYPE, + + /* This enumeration must have a value that is a power of two as it is + * used in masks and a filter bit field (currently 64 bits long). + */ + RGX_HWPERF_MAX_TYPE = 0x40 +} RGX_HWPERF_EVENT_TYPE; + +/* The event type values are incrementing integers for use as a shift ordinal + * in the event filtering process at the point events are generated. + * This scheme thus implies a limit of 63 event types. + */ +BLD_ASSERT((RGX_HWPERF_LAST_TYPEui32Size) & RGX_HWPERF_SIZE_MASK)) + +/*! Macro to obtain the size of the packet data */ +#define RGX_HWPERF_GET_DATA_SIZE(_packet_addr) (RGX_HWPERF_GET_SIZE(_packet_addr) - sizeof(RGX_HWPERF_V2_PACKET_HDR)) + + +/*! Masks for use with the IMG_UINT32 eTypeId header field */ +#define RGX_HWPERF_TYPEID_MASK 0xFFFFU +#define RGX_HWPERF_TYPEID_THREAD_MASK 0x8000U +#define RGX_HWPERF_TYPEID_EVENT_MASK (RGX_HWPERF_MAX_TYPE-1) + +/*! Meta thread macros for encoding the ID into the type field of a packet */ +#define RGX_HWPERF_META_THREAD_SHIFT 15U +#define RGX_HWPERF_META_THREAD_ID0 0x0U +#define RGX_HWPERF_META_THREAD_ID1 0x1U +/*! Obsolete, kept for source compatibility */ +#define RGX_HWPERF_META_THREAD_MASK 0x1U + +/*! Macros used to set the packet type and encode meta thread ID (0|1) within */ +#define RGX_HWPERF_MAKE_TYPEID(_type,_thread) ((IMG_UINT32) ((RGX_HWPERF_TYPEID_THREAD_MASK&((_thread)<eTypeId) & RGX_HWPERF_TYPEID_EVENT_MASK) + +/*! Obtains the META Thread number that generated the packet */ +#define RGX_HWPERF_GET_THREAD_ID(_packet_addr) (((((_packet_addr)->eTypeId)&RGX_HWPERF_TYPEID_THREAD_MASK) >> RGX_HWPERF_META_THREAD_SHIFT)) + +/*! Macros to obtain a typed pointer to a packet or data structure given a packet address */ +#define RGX_HWPERF_GET_PACKET(_buffer_addr) ((RGX_HWPERF_V2_PACKET_HDR*) (_buffer_addr)) +#define RGX_HWPERF_GET_PACKET_DATA_BYTES(_packet_addr) ((IMG_BYTE*) ( ((IMG_BYTE*)(_packet_addr)) +sizeof(RGX_HWPERF_V2_PACKET_HDR) ) ) +#define RGX_HWPERF_GET_NEXT_PACKET(_packet_addr) ((RGX_HWPERF_V2_PACKET_HDR*) ( ((IMG_BYTE*)(_packet_addr))+(RGX_HWPERF_SIZE_MASK&(_packet_addr)->ui32Size)) ) + +/*! Obtains a typed pointer to a packet header given the packed data address */ +#define RGX_HWPERF_GET_PACKET_HEADER(_packet_addr) ((RGX_HWPERF_V2_PACKET_HDR*) ( ((IMG_BYTE*)(_packet_addr)) - sizeof(RGX_HWPERF_V2_PACKET_HDR) )) + + +/*! Masks for use with the IMG_UINT32 ui32BlkInfo field */ +#define RGX_HWPERF_BLKINFO_BLKCOUNT_MASK 0xFFFF0000U +#define RGX_HWPERF_BLKINFO_BLKOFFSET_MASK 0x0000FFFFU + +/*! Shift for the NumBlocks and counter block offset field in ui32BlkInfo */ +#define RGX_HWPERF_BLKINFO_BLKCOUNT_SHIFT 16U +#define RGX_HWPERF_BLKINFO_BLKOFFSET_SHIFT 0U + +/*! Macro used to set the block info word as a combination of two 16-bit integers */ +#define RGX_HWPERF_MAKE_BLKINFO(_numblks,_blkoffset) ((IMG_UINT32) ((RGX_HWPERF_BLKINFO_BLKCOUNT_MASK&((_numblks) << RGX_HWPERF_BLKINFO_BLKCOUNT_SHIFT)) | (RGX_HWPERF_BLKINFO_BLKOFFSET_MASK&((_blkoffset) << RGX_HWPERF_BLKINFO_BLKOFFSET_SHIFT)))) + +/*! Macro used to obtain get the number of counter blocks present in the packet */ +#define RGX_HWPERF_GET_BLKCOUNT(_blkinfo) ((_blkinfo & RGX_HWPERF_BLKINFO_BLKCOUNT_MASK) >> RGX_HWPERF_BLKINFO_BLKCOUNT_SHIFT) + +/*! Obtains the offset of the counter block stream in the packet */ +#define RGX_HWPERF_GET_BLKOFFSET(_blkinfo) ((_blkinfo & RGX_HWPERF_BLKINFO_BLKOFFSET_MASK) >> RGX_HWPERF_BLKINFO_BLKOFFSET_SHIFT) + +/* This is the maximum frame contexts that are supported in the driver at the moment */ +#define RGX_HWPERF_HW_MAX_WORK_CONTEXT 2 +/*! This structure holds the field data of a Hardware packet. + */ +#define RGX_HWPERF_HW_DATA_FIELDS_LIST \ +IMG_UINT32 ui32DMCyc; /*!< DataMaster cycle count register, 0 if none */\ +IMG_UINT32 ui32FrameNum; /*!< Frame number */\ +IMG_UINT32 ui32PID; /*!< Process identifier */\ +IMG_UINT32 ui32DMContext; /*!< RenderContext for a TA,3D, Compute context for CDM, etc. */\ +IMG_UINT32 ui32RenderTarget; /*!< RenderTarget for a TA,3D, 0x0 otherwise */\ +IMG_UINT32 ui32ExtJobRef; /*!< Externally provided job reference used to track work for debugging purposes */\ +IMG_UINT32 ui32IntJobRef; /*!< Internally provided job reference used to track work for debugging purposes */\ +IMG_UINT32 ui32TimeCorrIndex; /*!< Index to the time correlation at the time the packet was generated */\ +IMG_UINT32 ui32BlkInfo; /*!< <31..16> NumBlocks <15..0> Counterblock stream offset */\ +IMG_UINT32 ui32WorkContext; /*!< Work context number. Frame number for RTU DM, 0x0 otherwise */ + +typedef struct +{ + RGX_HWPERF_HW_DATA_FIELDS_LIST +} RGX_HWPERF_HW_DATA_FIELDS; + +RGX_FW_STRUCT_SIZE_ASSERT(RGX_HWPERF_HW_DATA_FIELDS) + + +/****************************************************************************** + * API Types + *****************************************************************************/ + + +/*! Mask macros for use with RGXCtrlHWPerf() API. + * RGX_HWPERF_EVENT_ALL is obsolete, use RGX_HWPERF_EVENT_MASK_ALL + */ +#define RGX_HWPERF_EVENT_MASK_NONE (IMG_UINT64_C(0x0000000000000000)) +#define RGX_HWPERF_EVENT_MASK_ALL (IMG_UINT64_C(0xFFFFFFFFFFFFFFFF)) +#define RGX_HWPERF_EVENT_MASK_ALL_FW (IMG_UINT64_C(0x000000000000007E)) +#define RGX_HWPERF_EVENT_MASK_HW_KICKFINISH (IMG_UINT64_C(0x0000000001FBFF00)) +#define RGX_HWPERF_EVENT_MASK_HW_PERIODIC (IMG_UINT64_C(0x0000000000040000)) +#define RGX_HWPERF_EVENT_MASK_ALL_HW (RGX_HWPERF_EVENT_MASK_HW_KICKFINISH \ + | RGX_HWPERF_EVENT_MASK_HW_PERIODIC) +#define RGX_HWPERF_EVENT_MASK_ALL_PWR_EST (IMG_UINT64_C(0X0000000700000000)) +#define RGX_HWPERF_EVENT_MASK_ALL_PWR (IMG_UINT64_C(0X0000000800000000)) +#define RGX_HWPERF_EVENT_MASK_VALUE(e) (((IMG_UINT64)1)<<(e)) + +/*! Type used in the RGX API RGXConfigureAndEnableHWPerfCounters() + * It is used to configure the performance counter module in a layout + * block and allows one or more counters in the block to be + * configured in one operation based on the counter select mask. The bit + * shifts for this are the values in RGX_HWPERF_CNTBLK_COUNTER_ID. This mask + * also encodes which values in the arrays are valid, for example, if bit 1 set + * then aui8Mode[1], aui16GroupSelect[1], aui16BitSelect[1], aui32BatchMax[1], + * and aui32BatchMin[1] must be set. If these array elements are all set to + * 0 then the counter will not count and will not be in the HW event, + * effectively disabling the counter from the callers point of view. + * If any are non zero then the counter will be included in the HW event. + * + * Each layout block has 4 or 6 counters that can be programmed independently to + * profile the performance of a HW block. Each counter can be configured to + * accumulate statistics from 1 of 32 counter groups defined for that block. + * Each counter group can have up to 16 signals/bits defined that can be + * selected. Each counter may accumulate in one of two modes. + * See hwdefs/regapiperf.h for block/group/signal definitions. + */ + typedef struct _RGX_HWPERF_CONFIG_CNTBLK_ +{ + /*! Counter block ID, see RGX_HWPERF_CNTBLK_ID */ + IMG_UINT16 ui16BlockID; + + /*! 4 or 6 LSBs are a mask of which counters to configure. Bit 0 is counter 0, + * bit 1 is counter 1 on so on. */ + IMG_UINT8 ui8CounterSelect; + + /*! 4 or 6 LSBs 0 for counting 1's in the group, 1 for treating the group + * signals as a number for unsigned addition. Bit 0 is counter 0, bit 1 is + * counter 1 on so on. This member relates to the MODE field + * in the RGX_CR__PERF_SELECTm register for each counter */ + IMG_UINT8 ui8Mode; + + /*! 5 or 6 LSBs used as the GROUP_SELECT field in the RGX_CR__PERF_SELECTm + * register. Array index 0 is counter 0, index 1 is counter 1 and so on. */ + IMG_UINT8 aui8GroupSelect[RGX_HWPERF_CNTRS_IN_BLK]; + + /*! 16 LSBs used as the BIT_SELECT field in the RGX_CR__PERF_SELECTm + * register. Array indexes relate to counters as above. */ + IMG_UINT16 aui16BitSelect[RGX_HWPERF_CNTRS_IN_BLK]; + + /*! 14 LSBs used as the BATCH_MAX field in the RGX_CR__PERF_SELECTm + * register. Array indexes relate to counters as above. */ + IMG_UINT32 aui32BatchMax[RGX_HWPERF_CNTRS_IN_BLK]; + + /*! 14 LSBs used as the BATCH_MIN field in the RGX_CR__PERF_SELECTm + * register. Array indexes relate to counters as above. */ + IMG_UINT32 aui32BatchMin[RGX_HWPERF_CNTRS_IN_BLK]; +} UNCACHED_ALIGN RGX_HWPERF_CONFIG_CNTBLK; + +RGX_FW_STRUCT_SIZE_ASSERT(RGX_HWPERF_CONFIG_CNTBLK) + + +#if defined (__cplusplus) +} +#endif + +#endif /* RGX_HWPERF_KM_H_ */ + +/****************************************************************************** + End of file +******************************************************************************/ + diff --git a/drivers/gpu/rogue_m/include/rgx_memallocflags.h b/drivers/gpu/rogue_m/include/rgx_memallocflags.h new file mode 100644 index 000000000000..5fa19094c63e --- /dev/null +++ b/drivers/gpu/rogue_m/include/rgx_memallocflags.h @@ -0,0 +1,49 @@ +/**************************************************************************/ /*! +@File +@Title RGX memory allocation flags +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef _RGX_MEMALLOCFLAGS_H_ +#define _RGX_MEMALLOCFLAGS_H_ + +#define PMMETA_PROTECT (1 << 0) /* Memory that only the PM and Meta can access */ +#define META_CACHED (1 << 1) /* Memory that is cached in META */ + +#endif diff --git a/drivers/gpu/rogue_m/include/rgx_meta.h b/drivers/gpu/rogue_m/include/rgx_meta.h new file mode 100644 index 000000000000..b1c0aaa383d9 --- /dev/null +++ b/drivers/gpu/rogue_m/include/rgx_meta.h @@ -0,0 +1,352 @@ +/*************************************************************************/ /*! +@File +@Title RGX META definitions +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description RGX META helper definitions +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#if !defined (__RGX_META_H__) +#define __RGX_META_H__ + + +/***** The META HW register definitions in the file are updated manually *****/ + + +#include "img_defs.h" + +/************************************************************************ +* META registers and MACROS +************************************************************************/ +#define META_CR_CTRLREG_BASE(T) (0x04800000 + 0x1000*(T)) + +#define META_CR_TXPRIVEXT (0x048000E8) +#define META_CR_TXPRIVEXT_MINIM_EN (0x1<<7) + +#define META_CR_SYSC_JTAG_THREAD (0x04830030) +#define META_CR_SYSC_JTAG_THREAD_PRIV_EN (0x00000004) + +#define META_CR_PERF_COUNT0 (0x0480FFE0) +#define META_CR_PERF_COUNT1 (0x0480FFE8) +#define META_CR_PERF_COUNT_CTRL_SHIFT (28) +#define META_CR_PERF_COUNT_CTRL_MASK (0xF0000000) +#define META_CR_PERF_COUNT_CTRL_DCACHEHITS (0x8 << META_CR_PERF_COUNT_CTRL_SHIFT) +#define META_CR_PERF_COUNT_CTRL_ICACHEHITS (0x9 << META_CR_PERF_COUNT_CTRL_SHIFT) +#define META_CR_PERF_COUNT_CTRL_ICACHEMISS (0xA << META_CR_PERF_COUNT_CTRL_SHIFT) +#define META_CR_PERF_COUNT_CTRL_ICORE (0xD << META_CR_PERF_COUNT_CTRL_SHIFT) +#define META_CR_PERF_COUNT_THR_SHIFT (24) +#define META_CR_PERF_COUNT_THR_MASK (0x0F000000) +#define META_CR_PERF_COUNT_THR_0 (0x1 << META_CR_PERF_COUNT_THR_SHIFT) +#define META_CR_PERF_COUNT_THR_1 (0x2 << META_CR_PERF_COUNT_THR_1) + +#define META_CR_TxVECINT_BHALT (0x04820500) +#define META_CR_PERF_ICORE0 (0x0480FFD0) +#define META_CR_PERF_ICORE1 (0x0480FFD8) +#define META_CR_PERF_ICORE_DCACHEMISS (0x8) + +typedef enum +{ + META_PERF_CONF_NONE = 0, + META_PERF_CONF_ICACHE = 1, + META_PERF_CONF_DCACHE = 2, + META_PERF_CONF_POLLS = 3, + META_PERF_CONF_CUSTOM_TIMER = 4 +} META_PERF_CONF; + +#define META_CR_PERF_COUNT(CTRL, THR) ((META_CR_PERF_COUNT_CTRL_##CTRL << META_CR_PERF_COUNT_CTRL_SHIFT) | \ + (THR << META_CR_PERF_COUNT_THR_SHIFT)) + +#define META_CR_TXUXXRXDT_OFFSET (META_CR_CTRLREG_BASE(0) + 0x0000FFF0) +#define META_CR_TXUXXRXRQ_OFFSET (META_CR_CTRLREG_BASE(0) + 0x0000FFF8) + +#define META_CR_TXUXXRXRQ_DREADY_BIT (0x80000000) /* Poll for done */ +#define META_CR_TXUXXRXRQ_RDnWR_BIT (0x00010000) /* Set for read */ +#define META_CR_TXUXXRXRQ_TX_S (12) +#define META_CR_TXUXXRXRQ_RX_S (4) +#define META_CR_TXUXXRXRQ_UXX_S (0) + +#define META_CR_TXUA0_ID (0x3) /* Address unit regs */ +#define META_CR_TXUPC_ID (0x5) /* PC registers */ + +/* Macros to calculate register access values */ +#define META_CR_CORE_REG(Thr, RegNum, Unit) (((Thr) << META_CR_TXUXXRXRQ_TX_S ) | \ + ((RegNum) << META_CR_TXUXXRXRQ_RX_S ) | \ + ((Unit) << META_CR_TXUXXRXRQ_UXX_S)) + +#define META_CR_THR0_PC META_CR_CORE_REG(0, 0, META_CR_TXUPC_ID) +#define META_CR_THR0_PCX META_CR_CORE_REG(0, 1, META_CR_TXUPC_ID) +#define META_CR_THR0_SP META_CR_CORE_REG(0, 0, META_CR_TXUA0_ID) + +#define META_CR_THR1_PC META_CR_CORE_REG(1, 0, META_CR_TXUPC_ID) +#define META_CR_THR1_PCX META_CR_CORE_REG(1, 1, META_CR_TXUPC_ID) +#define META_CR_THR1_SP META_CR_CORE_REG(1, 0, META_CR_TXUA0_ID) + +#define SP_ACCESS(Thread) META_CR_CORE_REG(Thread, 0, META_CR_TXUA0_ID) +#define PC_ACCESS(Thread) META_CR_CORE_REG(Thread, 0, META_CR_TXUPC_ID) + +#define META_CR_COREREG_ENABLE (0x0000000) +#define META_CR_COREREG_STATUS (0x0000010) +#define META_CR_COREREG_DEFR (0x00000A0) + +#define META_CR_T0ENABLE_OFFSET (META_CR_CTRLREG_BASE(0) + META_CR_COREREG_ENABLE) +#define META_CR_T0STATUS_OFFSET (META_CR_CTRLREG_BASE(0) + META_CR_COREREG_STATUS) +#define META_CR_T0DEFR_OFFSET (META_CR_CTRLREG_BASE(0) + META_CR_COREREG_DEFR) + +#define META_CR_T1ENABLE_OFFSET (META_CR_CTRLREG_BASE(1) + META_CR_COREREG_ENABLE) +#define META_CR_T1STATUS_OFFSET (META_CR_CTRLREG_BASE(1) + META_CR_COREREG_STATUS) +#define META_CR_T1DEFR_OFFSET (META_CR_CTRLREG_BASE(1) + META_CR_COREREG_DEFR) + +#define META_CR_TXENABLE_ENABLE_BIT (0x00000001) /* Set if running */ +#define META_CR_TXSTATUS_PRIV (0x00020000) + +#define META_MEM_GLOBAL_RANGE_BIT (0x80000000) + + +/************************************************************************ +* META LDR Format +************************************************************************/ +/* Block header structure */ +typedef struct +{ + IMG_UINT32 ui32DevID; + IMG_UINT32 ui32SLCode; + IMG_UINT32 ui32SLData; + IMG_UINT16 ui16PLCtrl; + IMG_UINT16 ui16CRC; + +} RGX_META_LDR_BLOCK_HDR; + +/* High level data stream block structure */ +typedef struct +{ + IMG_UINT16 ui16Cmd; + IMG_UINT16 ui16Length; + IMG_UINT32 ui32Next; + IMG_UINT32 aui32CmdData[4]; + +} RGX_META_LDR_L1_DATA_BLK; + +/* High level data stream block structure */ +typedef struct +{ + IMG_UINT16 ui16Tag; + IMG_UINT16 ui16Length; + IMG_UINT32 aui32BlockData[4]; + +} RGX_META_LDR_L2_DATA_BLK; + +/* Config command structure */ +typedef struct +{ + IMG_UINT32 ui32Type; + IMG_UINT32 aui32BlockData[4]; + +} RGX_META_LDR_CFG_BLK; + +/* Block type definitions */ +#define RGX_META_LDR_COMMENT_TYPE_MASK (0x0010) +#define RGX_META_LDR_BLK_IS_COMMENT(X) ((X & RGX_META_LDR_COMMENT_TYPE_MASK) != 0) + +/* Command definitions + Value Name Description + 0 LoadMem Load memory with binary data. + 1 LoadCore Load a set of core registers. + 2 LoadMMReg Load a set of memory mapped registers. + 3 StartThreads Set each thread PC and SP, then enable threads. + 4 ZeroMem Zeros a memory region. + 5 Config Perform a configuration command. */ +#define RGX_META_LDR_CMD_MASK (0x000F) + +#define RGX_META_LDR_CMD_LOADMEM (0x0000) +#define RGX_META_LDR_CMD_LOADCORE (0x0001) +#define RGX_META_LDR_CMD_LOADMMREG (0x0002) +#define RGX_META_LDR_CMD_START_THREADS (0x0003) +#define RGX_META_LDR_CMD_ZEROMEM (0x0004) +#define RGX_META_LDR_CMD_CONFIG (0x0005) + +/* Config Command definitions + Value Name Description + 0 Pause Pause for x times 100 instructions + 1 Read Read a value from register - No value return needed. + Utilises effects of issuing reads to certain registers + 2 Write Write to mem location + 3 MemSet Set mem to value + 4 MemCheck check mem for specific value.*/ +#define RGX_META_LDR_CFG_PAUSE (0x0000) +#define RGX_META_LDR_CFG_READ (0x0001) +#define RGX_META_LDR_CFG_WRITE (0x0002) +#define RGX_META_LDR_CFG_MEMSET (0x0003) +#define RGX_META_LDR_CFG_MEMCHECK (0x0004) + +/************************************************************************ +* RGX FW segmented MMU definitions +************************************************************************/ +/* All threads can access the segment */ +#define RGXFW_SEGMMU_ALLTHRS (0xf << 8) +/* Writeable */ +#define RGXFW_SEGMMU_WRITEABLE (0x1 << 1) +/* All threads can access and writeable */ +#define RGXFW_SEGMMU_ALLTHRS_WRITEABLE (RGXFW_SEGMMU_ALLTHRS | RGXFW_SEGMMU_WRITEABLE) + +/* Direct map regions mapping (8-10) */ +#define RGXFW_SEGMMU_DMAP_ID_START (8) +#define RGXFW_SEGMMU_DMAP_ADDR_START (0x06000000U) +#define RGXFW_SEGMMU_DMAP_ADDR_META (0x86000000U) +#define RGXFW_SEGMMU_DMAP_SIZE (8*1024*1024) /* 8 MB */ + +/* Direct map region 11 used for mapping GPU memory */ +#define RGXFW_SEGMMU_DMAP_GPU_ID (11) +#define RGXFW_SEGMMU_DMAP_GPU_ADDR_START (RGXFW_SEGMMU_DMAP_ADDR_START + 3*RGXFW_SEGMMU_DMAP_SIZE) + +/* Segment IDs */ +#define RGXFW_SEGMMU_TEXT_ID (0) +#define RGXFW_SEGMMU_SHARED_ID (1) +#define RGXFW_SEGMMU_BOOTLDR_ID (2) +#define RGXFW_SEGMMU_DATA_ID (3) + +#define RGXFW_SEGMMU_META_DM_ID (0x7) + +#if defined(HW_ERN_45914) +/* SLC caching strategy is emitted through the segment MMU. All the segments configured + through this macro are CACHED in the SLC. The interface has been kept the same to + simplify the code changes. The bifdm argument is ignored (no longer relevant). */ +#if defined(HW_ERN_49144) +#define RGXFW_SEGMMU_OUTADDR_TOP_S7(pers, coheren, mmu_ctx) ( (((IMG_UINT64) ((pers) & 0x3)) << 50) | \ + (((IMG_UINT64) ((mmu_ctx) & 0xFF)) << 42) | \ + (((IMG_UINT64) ((coheren) & 0x1)) << 40) ) +#define RGXFW_SEGMMU_OUTADDR_TOP_S7_SLC_CACHED(mmu_ctx) RGXFW_SEGMMU_OUTADDR_TOP_S7(0x3, 0x0, mmu_ctx) +#define RGXFW_SEGMMU_OUTADDR_TOP_S7_SLC_UNCACHED(mmu_ctx) RGXFW_SEGMMU_OUTADDR_TOP_S7(0x0, 0x1, mmu_ctx) + +/* Set FW code/data cached in the SLC as default */ +#define RGXFW_SEGMMU_OUTADDR_TOP(mmu_ctx, bifdm) RGXFW_SEGMMU_OUTADDR_TOP_S7_SLC_CACHED(mmu_ctx | (bifdm&0x0)) +#else +#define RGXFW_SEGMMU_OUTADDR_TOP_S7(pers, coheren, mmu_ctx) ( (((IMG_UINT64) ((pers) & 0x3)) << 52) | \ + (((IMG_UINT64) ((mmu_ctx) & 0xFF)) << 44) | \ + (((IMG_UINT64) ((coheren) & 0x1)) << 40) ) +#define RGXFW_SEGMMU_OUTADDR_TOP_S7_SLC_CACHED(mmu_ctx) RGXFW_SEGMMU_OUTADDR_TOP_S7(0x3, 0x0, mmu_ctx) +#define RGXFW_SEGMMU_OUTADDR_TOP_S7_SLC_UNCACHED(mmu_ctx) RGXFW_SEGMMU_OUTADDR_TOP_S7(0x0, 0x1, mmu_ctx) + +/* Set FW code/data cached in the SLC as default */ +#define RGXFW_SEGMMU_OUTADDR_TOP(mmu_ctx, bifdm) RGXFW_SEGMMU_OUTADDR_TOP_S7_SLC_CACHED(mmu_ctx | (bifdm&0x0)) +#endif +#else +/* To configure the Page Catalog and BIF-DM fed into the BIF for Garten accesses through this segment */ +#define RGXFW_SEGMMU_OUTADDR_TOP(pc, bifdm) ( (((IMG_UINT64) ((pc) & 0xF)) << 44) | \ + (((IMG_UINT64) ((bifdm) & 0xF)) << 40) ) +#endif + +/* META segments have 4kB minimum size */ +#define RGXFW_SEGMMU_ALIGN (0x1000) + +/* Segmented MMU registers (n = segment id) */ +#define META_CR_MMCU_SEGMENTn_BASE(n) (0x04850000 + (n)*0x10) +#define META_CR_MMCU_SEGMENTn_LIMIT(n) (0x04850004 + (n)*0x10) +#define META_CR_MMCU_SEGMENTn_OUTA0(n) (0x04850008 + (n)*0x10) +#define META_CR_MMCU_SEGMENTn_OUTA1(n) (0x0485000C + (n)*0x10) + +/* Win mode for data cache */ +#define RGXFW__SEGMMU_DMAP_DC_WIN (0x3) +#define RGXFW__SEGMMU_DMAP_DC_SHIFT (0x6) + +/************************************************************************ +* RGX FW Bootloader defaults +************************************************************************/ +#define RGXFW_BOOTLDR_META_ADDR (0x40000000) +#define RGXFW_BOOTLDR_DEVV_ADDR_0 (0xC0000000) +#define RGXFW_BOOTLDR_DEVV_ADDR_1 (0x000000E1) +#define RGXFW_BOOTLDR_DEVV_ADDR ((((IMG_UINT64) RGXFW_BOOTLDR_DEVV_ADDR_1) << 32) | RGXFW_BOOTLDR_DEVV_ADDR_0) +#define RGXFW_BOOTLDR_LIMIT (0x1FFFF000) + +/* Bootloader configuration offset is in dwords (512 bytes) */ +#define RGXFW_BOOTLDR_CONF_OFFSET (0x80) + +/************************************************************************ +* RGX META Stack +************************************************************************/ +#define RGX_META_STACK_SIZE (0xC00) + +/************************************************************************ +* RGX META Core memory +************************************************************************/ +#define RGX_META_COREMEM_BSS_SIZE (0xA00) +#define RGX_META_COREMEM_DATA_SIZE (RGX_META_COREMEM_BSS_SIZE + RGX_META_STACK_SIZE) +#define RGX_META_COREMEM_CODE_SIZE (RGX_META_COREMEM_SIZE - RGX_META_COREMEM_DATA_SIZE) +/* code and data both map to the same physical memory */ +#define RGX_META_COREMEM_CODE_ADDR (0x80000000) +#define RGX_META_COREMEM_DATA_ADDR (0x82000000) +#define RGX_META_COREMEM_STACK_ADDR (RGX_META_COREMEM_DATA_ADDR) +#define RGX_META_COREMEM_BSS_ADDR (RGX_META_COREMEM_STACK_ADDR + RGX_META_STACK_SIZE) +/* because data and code share the same memory, base address for code is offset by the data */ +#define RGX_META_COREMEM_CODE_BADDR (RGX_META_COREMEM_CODE_ADDR + RGX_META_COREMEM_DATA_SIZE) + +#define RGX_META_IS_COREMEM_CODE(A) (((A) >= RGX_META_COREMEM_CODE_BADDR) && ((A) < (RGX_META_COREMEM_CODE_ADDR + RGX_META_COREMEM_SIZE))) +#define RGX_META_IS_COREMEM_DATA(A) (((A) >= RGX_META_COREMEM_DATA_ADDR) && ((A) < (RGX_META_COREMEM_DATA_ADDR + RGX_META_COREMEM_DATA_SIZE))) + +/************************************************************************ +* 2nd thread +************************************************************************/ +#define RGXFW_THR1_PC (0x18930000) +#define RGXFW_THR1_SP (0x78890000) + +/************************************************************************ +* META compatibility +************************************************************************/ + +#define META_CR_CORE_ID (0x04831000) +#define META_CR_CORE_ID_VER_SHIFT (16U) +#define META_CR_CORE_ID_VER_CLRMSK (0XFF00FFFFU) + +#if (RGX_FEATURE_META == MTP218) +#define RGX_CR_META_CORE_ID_VALUE 0x19 +#elif (RGX_FEATURE_META == MTP219) +#define RGX_CR_META_CORE_ID_VALUE 0x1E +#elif (RGX_FEATURE_META == LTP218) +#define RGX_CR_META_CORE_ID_VALUE 0x1C +#elif (RGX_FEATURE_META == LTP217) +#define RGX_CR_META_CORE_ID_VALUE 0x1F +#else +#error "Unknown META ID" +#endif + +#endif /* __RGX_META_H__ */ + +/****************************************************************************** + End of file (rgx_meta.h) +******************************************************************************/ + + diff --git a/drivers/gpu/rogue_m/include/rgx_options_km.h b/drivers/gpu/rogue_m/include/rgx_options_km.h new file mode 100644 index 000000000000..475ff5168141 --- /dev/null +++ b/drivers/gpu/rogue_m/include/rgx_options_km.h @@ -0,0 +1,192 @@ +/*************************************************************************/ /*! +@File +@Title RGX KM build options +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +/* Each build option listed here is packed into a dword which + * provides up to log2(RGX_BUILD_OPTIONS_MASK_KM + 1) flags. + * The corresponding bit is set if the build option + * was enabled at compile time. + * + * In order to extract the enabled build flags the INTERNAL_TEST + * switch should be enabled in a client program which includes this + * header. Then the client can test specific build flags by reading + * the bit value at ##OPTIONNAME##_SET_OFFSET in RGX_BUILD_OPTIONS_KM. + * + * IMPORTANT: add new options to unused bits or define a new dword + * (e.g. RGX_BUILD_OPTIONS_KM2) so that the bitfield remains backwards + * compatible. + */ + +#define RGX_BUILD_OPTIONS_MASK_KM 0x0000FFFFUL + +#if defined(NO_HARDWARE) || defined (INTERNAL_TEST) + #define NO_HARDWARE_SET_OFFSET OPTIONS_BIT0 + #define OPTIONS_BIT0 (0x1ul << 0) + #if OPTIONS_BIT0 > RGX_BUILD_OPTIONS_MASK_KM + #error "Bit exceeds reserved range" + #endif +#else + #define OPTIONS_BIT0 0x0 +#endif /* NO_HARDWARE */ + + +#if defined(PDUMP) || defined (INTERNAL_TEST) + #define PDUMP_SET_OFFSET OPTIONS_BIT1 + #define OPTIONS_BIT1 (0x1ul << 1) + #if OPTIONS_BIT1 > RGX_BUILD_OPTIONS_MASK_KM + #error "Bit exceeds reserved range" + #endif +#else + #define OPTIONS_BIT1 0x0 +#endif /* PDUMP */ + + +#if defined(SUPPORT_META_SLAVE_BOOT) || defined (INTERNAL_TEST) + #define SUPPORT_META_SLAVE_BOOT_SET_OFFSET OPTIONS_BIT2 + #define OPTIONS_BIT2 (0x1ul << 2) + #if OPTIONS_BIT2 > RGX_BUILD_OPTIONS_MASK_KM + #error "Bit exceeds reserved range" + #endif +#else + #define OPTIONS_BIT2 0x0 +#endif /* SUPPORT_META_SLAVE_BOOT */ + + +#if defined(SUPPORT_MMU_FREELIST) || defined (INTERNAL_TEST) + #define SUPPORT_MMU_FREELIST_SET_OFFSET OPTIONS_BIT3 + #define OPTIONS_BIT3 (0x1ul << 3) + #if OPTIONS_BIT3 > RGX_BUILD_OPTIONS_MASK_KM + #error "Bit exceeds reserved range" + #endif +#else + #define OPTIONS_BIT3 0x0 +#endif /* SUPPORT_MMU_FREELIST */ + + +#if defined(SUPPORT_RGX) || defined (INTERNAL_TEST) + #define SUPPORT_RGX_SET_OFFSET OPTIONS_BIT4 + #define OPTIONS_BIT4 (0x1ul << 4) + #if OPTIONS_BIT4 > RGX_BUILD_OPTIONS_MASK_KM + #error "Bit exceeds reserved range" + #endif +#else + #define OPTIONS_BIT4 0x0 +#endif /* SUPPORT_RGX */ + + +#if defined(SUPPORT_SECURE_EXPORT) || defined (INTERNAL_TEST) + #define SUPPORT_SECURE_EXPORT_SET_OFFSET OPTIONS_BIT5 + #define OPTIONS_BIT5 (0x1ul << 5) + #if OPTIONS_BIT5 > RGX_BUILD_OPTIONS_MASK_KM + #error "Bit exceeds reserved range" + #endif +#else + #define OPTIONS_BIT5 0x0 +#endif /* SUPPORT_SECURE_EXPORT */ + + +#if defined(SUPPORT_INSECURE_EXPORT) || defined (INTERNAL_TEST) + #define SUPPORT_INSECURE_EXPORT_SET_OFFSET OPTIONS_BIT6 + #define OPTIONS_BIT6 (0x1ul << 6) + #if OPTIONS_BIT6 > RGX_BUILD_OPTIONS_MASK_KM + #error "Bit exceeds reserved range" + #endif +#else + #define OPTIONS_BIT6 0x0 +#endif /* SUPPORT_INSECURE_EXPORT */ + + +#if defined(SUPPORT_VFP) || defined (INTERNAL_TEST) + #define SUPPORT_VFP_SET_OFFSET OPTIONS_BIT7 + #define OPTIONS_BIT7 (0x1ul << 7) + #if OPTIONS_BIT7 > RGX_BUILD_OPTIONS_MASK_KM + #error "Bit exceeds reserved range" + #endif +#else + #define OPTIONS_BIT7 0x0 +#endif /* SUPPORT_VFP */ + + +#if defined(SUPPORT_DRM) || defined (INTERNAL_TEST) + #define SUPPORT_DRM_SET_OFFSET OPTIONS_BIT8 + #define OPTIONS_BIT8 (0x1ul << 8) + #if OPTIONS_BIT8 > RGX_BUILD_OPTIONS_MASK_KM + #error "Bit exceeds reserved range" + #endif +#else + #define OPTIONS_BIT8 0x0 +#endif /* SUPPORT_DRM */ + + +#if defined(SUPPORT_ION) || defined (INTERNAL_TEST) + #define SUPPORT_ION_SET_OFFSET OPTIONS_BIT9 + #define OPTIONS_BIT9 (0x1ul << 9) + #if OPTIONS_BIT9 > RGX_BUILD_OPTIONS_MASK_KM + #error "Bit exceeds reserved range" + #endif +#else + #define OPTIONS_BIT9 0x0 +#endif /* SUPPORT_ION */ + +#if defined(DEBUG) || defined (INTERNAL_TEST) + #define DEBUG_SET_OFFSET OPTIONS_BIT10 + #define OPTIONS_BIT10 (0x1ul << 10) + #if OPTIONS_BIT10 > RGX_BUILD_OPTIONS_MASK_KM + #error "Bit exceeds reserved range" + #endif +#else + #define OPTIONS_BIT10 0x0 +#endif /* DEBUG */ + + +#define RGX_BUILD_OPTIONS_KM \ + OPTIONS_BIT0 |\ + OPTIONS_BIT1 |\ + OPTIONS_BIT2 |\ + OPTIONS_BIT3 |\ + OPTIONS_BIT4 |\ + OPTIONS_BIT6 |\ + OPTIONS_BIT7 |\ + OPTIONS_BIT8 |\ + OPTIONS_BIT9 |\ + OPTIONS_BIT10 + + diff --git a/drivers/gpu/rogue_m/include/rgxscript.h b/drivers/gpu/rogue_m/include/rgxscript.h new file mode 100644 index 000000000000..d6f21c0ead81 --- /dev/null +++ b/drivers/gpu/rogue_m/include/rgxscript.h @@ -0,0 +1,179 @@ +/*************************************************************************/ /*! +@File +@Title rgx kernel services structues/functions +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description RGX initialisation script definitions. +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef __RGXSCRIPT_H__ +#define __RGXSCRIPT_H__ + +#if defined (__cplusplus) +extern "C" { +#endif + +#define RGX_MAX_INIT_COMMANDS (256) +#define RGX_MAX_DEBUG_COMMANDS (320) +#define RGX_MAX_DBGBUS_COMMANDS (4096) +#define RGX_MAX_DEINIT_COMMANDS (32) +#define RGX_DBG_CMD_NAME_SIZE (40) + +typedef enum _RGX_INIT_OPERATION +{ + RGX_INIT_OP_ILLEGAL = 0, + RGX_INIT_OP_WRITE_HW_REG, + RGX_INIT_OP_POLL_64_HW_REG, + RGX_INIT_OP_POLL_HW_REG, + RGX_INIT_OP_COND_POLL_HW_REG, + RGX_INIT_OP_LOOP_POINT, + RGX_INIT_OP_COND_BRANCH, + RGX_INIT_OP_HALT, + RGX_INIT_OP_DBG_READ32_HW_REG, + RGX_INIT_OP_DBG_READ64_HW_REG, + RGX_INIT_OP_DBG_CALC, + RGX_INIT_OP_DBG_WAIT, + RGX_INIT_OP_DBG_STRING, + RGX_INIT_OP_PDUMP_HW_REG, +} RGX_INIT_OPERATION; + +typedef union _RGX_INIT_COMMAND_ +{ + RGX_INIT_OPERATION eOp; + + struct { + RGX_INIT_OPERATION eOp; + IMG_UINT32 ui32Offset; + IMG_UINT32 ui32Value; + } sWriteHWReg; + + struct { + RGX_INIT_OPERATION eOp; + IMG_UINT32 ui32Offset; + IMG_UINT32 ui32Value; + } sPDumpHWReg; + + struct + { + RGX_INIT_OPERATION eOp; + IMG_UINT32 ui32Offset; + IMG_UINT64 ui64Value; + IMG_UINT64 ui64Mask; + } sPoll64HWReg; + + struct + { + RGX_INIT_OPERATION eOp; + IMG_UINT32 ui32Offset; + IMG_UINT32 ui32Value; + IMG_UINT32 ui32Mask; + } sPollHWReg; + + struct + { + RGX_INIT_OPERATION eOp; + IMG_UINT32 ui32CondOffset; + IMG_UINT32 ui32CondValue; + IMG_UINT32 ui32CondMask; + IMG_UINT32 ui32Offset; + IMG_UINT32 ui32Value; + IMG_UINT32 ui32Mask; + } sCondPollHWReg; + + struct + { + RGX_INIT_OPERATION eOp; + } sLoopPoint; + + struct + { + RGX_INIT_OPERATION eOp; + IMG_UINT32 ui32Offset; + IMG_UINT32 ui32Value; + IMG_UINT32 ui32Mask; + + } sConditionalBranchPoint; + + struct + { + RGX_INIT_OPERATION eOp; + IMG_UINT32 ui32Offset; + IMG_CHAR aszName[RGX_DBG_CMD_NAME_SIZE]; + } sDBGReadHWReg; + + struct + { + RGX_INIT_OPERATION eOp; + IMG_UINT32 ui32Offset1; + IMG_UINT32 ui32Offset2; + IMG_UINT32 ui32Offset3; + IMG_CHAR aszName[RGX_DBG_CMD_NAME_SIZE]; + } sDBGCalc; + + struct + { + RGX_INIT_OPERATION eOp; + IMG_UINT32 ui32WaitInUs; + } sDBGWait; + + struct + { + RGX_INIT_OPERATION eOp; + IMG_CHAR aszString[RGX_DBG_CMD_NAME_SIZE]; + } sDBGString; + +} RGX_INIT_COMMAND; + +typedef struct _RGX_INIT_SCRIPTS_ +{ + RGX_INIT_COMMAND asInitCommands[RGX_MAX_INIT_COMMANDS]; + RGX_INIT_COMMAND asDbgCommands[RGX_MAX_DEBUG_COMMANDS]; + RGX_INIT_COMMAND asDbgBusCommands[RGX_MAX_DBGBUS_COMMANDS]; + RGX_INIT_COMMAND asDeinitCommands[RGX_MAX_DEINIT_COMMANDS]; +} RGX_SCRIPTS; + +#if defined(__cplusplus) +} +#endif + +#endif /* __RGXSCRIPT_H__ */ + +/***************************************************************************** + End of file (rgxscript.h) +*****************************************************************************/ + diff --git a/drivers/gpu/rogue_m/include/ri_typedefs.h b/drivers/gpu/rogue_m/include/ri_typedefs.h new file mode 100644 index 000000000000..c7e9a46ebf9b --- /dev/null +++ b/drivers/gpu/rogue_m/include/ri_typedefs.h @@ -0,0 +1,55 @@ +/*************************************************************************/ /*! +@File +@Title Resource Information (RI) Management +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Client side part of RI management +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef RI_TYPEDEFS_H +#define RI_TYPEDEFS_H + +#include "img_types.h" + +#define RI_MAX_TEXT_LEN 80 + +typedef struct RI_SUBLIST_ENTRY RI_ENTRY; +typedef RI_ENTRY* RI_HANDLE; + +#endif /* #ifndef RI_TYPEDEFS_H */ + diff --git a/drivers/gpu/rogue_m/include/services.h b/drivers/gpu/rogue_m/include/services.h new file mode 100644 index 000000000000..06e1ab5ecbcd --- /dev/null +++ b/drivers/gpu/rogue_m/include/services.h @@ -0,0 +1,1337 @@ +/*************************************************************************/ /*! +@File +@Title Services API Header +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Exported services API details +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#ifndef __SERVICES_H__ +#define __SERVICES_H__ + +#if defined(SUPPORT_GPUVIRT_VALIDATION) + #if !defined(OSID_BITS_FLAGS_OFFSET) + #define OSID_BITS_FLAGS_OFFSET 20 + #define OSID_BITS_FLAGS_MASK 7 + #endif + + #if !defined(GPUVIRT_VALIDATION_MAX_STRING_LENGTH) + #define GPUVIRT_VALIDATION_MAX_STRING_LENGTH 100 + #endif + + #if !defined(GPUVIRT_VALIDATION_NUM_REGIONS) + #define GPUVIRT_VALIDATION_NUM_REGIONS 2 + #endif + +#endif + +#if defined (__cplusplus) +extern "C" { +#endif + +#include "img_defs.h" +#include "servicesext.h" +#include "sync_external.h" +#include "pdumpdefs.h" +#include "lock_types.h" +#include "pvr_debug.h" + +/* FIXME: Can't do this as dc_client includes services.h +#include "dc_client.h" +*/ + +#if defined(LDDM) +/* LDDM build needs to include this for the allocation structure */ +#include "umallocation.h" +#endif + +#include "pvrsrv_device_types.h" + +/* The comment below is the front page for code-generated doxygen documentation */ +/*! + ****************************************************************************** + @mainpage + This document details the APIs and implementation of the Consumer Services. + It is intended to be used in conjunction with the Consumer Services + Software Architectural Specification and the Consumer Services Software + Functional Specification. + *****************************************************************************/ + +/****************************************************************************** + * #defines + *****************************************************************************/ + +/*! 4k page size definition */ +#define PVRSRV_4K_PAGE_SIZE 4096UL /*!< Size of a 4K Page */ +#define PVRSRV_4K_PAGE_SIZE_ALIGNSHIFT 12 /*!< Amount to shift an address by so that + it is always page-aligned */ +/*! 16k page size definition */ +#define PVRSRV_16K_PAGE_SIZE 16384UL /*!< Size of a 16K Page */ +#define PVRSRV_16K_PAGE_SIZE_ALIGNSHIFT 14 /*!< Amount to shift an address by so that + it is always page-aligned */ +/*! 64k page size definition */ +#define PVRSRV_64K_PAGE_SIZE 65536UL /*!< Size of a 64K Page */ +#define PVRSRV_64K_PAGE_SIZE_ALIGNSHIFT 16 /*!< Amount to shift an address by so that + it is always page-aligned */ +/*! 256k page size definition */ +#define PVRSRV_256K_PAGE_SIZE 262144UL /*!< Size of a 256K Page */ +#define PVRSRV_256K_PAGE_SIZE_ALIGNSHIFT 18 /*!< Amount to shift an address by so that + it is always page-aligned */ +/*! 1MB page size definition */ +#define PVRSRV_1M_PAGE_SIZE 1048576UL /*!< Size of a 1M Page */ +#define PVRSRV_1M_PAGE_SIZE_ALIGNSHIFT 20 /*!< Amount to shift an address by so that + it is always page-aligned */ +/*! 2MB page size definition */ +#define PVRSRV_2M_PAGE_SIZE 2097152UL /*!< Size of a 2M Page */ +#define PVRSRV_2M_PAGE_SIZE_ALIGNSHIFT 21 /*!< Amount to shift an address by so that + it is always page-aligned */ + + +#define EVENTOBJNAME_MAXLENGTH (50) /*!< Max length of an event object name */ + + +/*! + Flags for Services connection. + Allows to define per-client policy for Services +*/ +#define SRV_FLAGS_PERSIST (1U << 0) /*!< Persist client flag */ +#define SRV_FLAGS_INIT_PROCESS (1U << 1) /*!< Allows connect to succeed if SrvInit + * has not yet run (used by SrvInit itself) */ +#define SRV_FLAGS_PDUMPCTRL (1U << 31) /*!< PDump Ctrl client flag */ + +/* + Pdump flags which are accessible to Services clients +*/ +/* FIXME: defined to be the same as + * #define PDUMP_FLAGS_CONTINUOUS 0x40000000UL + * (from services/include/pdump.h) + * The flags need to either be moved here, or e.g. all PDump functions need a bContinuous parameter + */ +#define PVRSRV_PDUMP_FLAGS_CONTINUOUS 0x40000000UL /*!< pdump continuous */ + +#define PVRSRV_UNDEFINED_HEAP_ID (~0LU) + +/*! + ****************************************************************************** + * User Module type + *****************************************************************************/ +typedef enum +{ + IMG_EGL = 0x00000001, /*!< EGL Module */ + IMG_OPENGLES1 = 0x00000002, /*!< OGLES1 Module */ + IMG_OPENGLES3 = 0x00000003, /*!< OGLES3 Module */ + IMG_D3DM = 0x00000004, /*!< D3DM Module */ + IMG_SRV_UM = 0x00000005, /*!< Services User-Mode */ + IMG_SRV_INIT = 0x00000006, /*!< Services initialisation */ + IMG_SRVCLIENT = 0x00000007, /*!< Services Client */ + IMG_OPENGL = 0x00000008, /*!< OpenGL */ + IMG_D3D = 0x00000009, /*!< D3D */ + IMG_OPENCL = 0x0000000A, /*!< OpenCL */ + IMG_ANDROID_HAL = 0x0000000B, /*!< Graphics HAL */ + IMG_WEC_GPE = 0x0000000C, /*!< WinEC-specific GPE */ + IMG_PVRGPE = 0x0000000D, /*!< WinEC/WinCE GPE */ + IMG_RSCOMPUTE = 0x0000000E, /*!< RenderScript Compute */ + IMG_OPENRL = 0x0000000F, /*!< OpenRL Module */ + IMG_PDUMPCTRL = 0x00000010, /*!< PDump control client */ + IMG_USC2 = 0x00000011, /*!< Uniflex compiler */ + +} IMG_MODULE_ID; + +/*! Max length of an App-Hint string */ +#define APPHINT_MAX_STRING_SIZE 256 + +/*! + ****************************************************************************** + * IMG data types + *****************************************************************************/ +typedef enum +{ + IMG_STRING_TYPE = 1, /*!< String type */ + IMG_FLOAT_TYPE , /*!< Float type */ + IMG_UINT_TYPE , /*!< Unsigned Int type */ + IMG_INT_TYPE , /*!< (Signed) Int type */ + IMG_FLAG_TYPE /*!< Flag Type */ +}IMG_DATA_TYPE; + + +/****************************************************************************** + * Structure definitions. + *****************************************************************************/ + +/*! + * Forward declaration + */ +typedef struct _PVRSRV_DEV_DATA_ *PPVRSRV_DEV_DATA; +/*! + * Forward declaration (look on connection.h) + */ +typedef struct _PVRSRV_CONNECTION_ PVRSRV_CONNECTION; + +/*! + ****************************************************************************** + * This structure allows the user mode glue code to have an OS independent + * set of prototypes. + *****************************************************************************/ +typedef struct _PVRSRV_DEV_DATA_ +{ + PVRSRV_CONNECTION *psConnection; /*!< Services connection info */ + IMG_HANDLE hDevCookie; /*!< Dev cookie */ + +} PVRSRV_DEV_DATA; + +/*************************************************************************/ /*! + PVR Client Event handling in Services +*/ /**************************************************************************/ +typedef enum _PVRSRV_CLIENT_EVENT_ +{ + PVRSRV_CLIENT_EVENT_HWTIMEOUT = 0, /*!< hw timeout event */ +} PVRSRV_CLIENT_EVENT; + +/**************************************************************************/ /*! +@Function PVRSRVClientEvent +@Description Handles timeouts occurring in client drivers +@Input eEvent event type +@Input psDevData pointer to the PVRSRV_DEV_DATA context +@Input pvData client-specific data +@Return PVRSRV_OK on success. Otherwise, a PVRSRV_ + error code + */ /**************************************************************************/ +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVClientEvent(const PVRSRV_CLIENT_EVENT eEvent, + PVRSRV_DEV_DATA *psDevData, + IMG_PVOID pvData); + +/****************************************************************************** + * PVR Services API prototypes. + *****************************************************************************/ + +/**************************************************************************/ /*! +@Function PVRSRVConnect +@Description Creates a services connection from an application to the + services module. +@Output ppsConnection on Success, *ppsConnection is set to the new + PVRSRV_CONNECTION instance. +@Input ui32SrvFlags a bit-wise OR of the following: + SRV_FLAGS_PERSIST +@Return PVRSRV_OK on success. Otherwise, a PVRSRV_ + error code + */ /**************************************************************************/ +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVConnect(PVRSRV_CONNECTION **ppsConnection, + IMG_UINT32 ui32SrvFlags); + +/**************************************************************************/ /*! +@Function PVRSRVDisconnect +@Description Disconnects from the services module +@Input psConnection the connection to be disconnected +@Return PVRSRV_OK on success. Otherwise, a PVRSRV_ + error code + */ /**************************************************************************/ +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVDisconnect(PVRSRV_CONNECTION *psConnection); + +/**************************************************************************/ /*! +@Function PVRSRVEnumerateDevices +@Description Enumerate all services managed devices in the + system. + + The function returns a list of the device IDs stored either + in the services (or constructed in the user mode glue + component in certain environments). The number of devices + in the list is also returned. + + The user is required to provide a buffer large enough to + receive an array of MAX_NUM_DEVICE_IDS * + PVRSRV_DEVICE_IDENTIFIER structures. + + In a binary layered component which does not support dynamic + runtime selection, the glue code should compile to return + the supported devices statically, e.g. multiple instances of + the same device if multiple devices are supported + + In the case of an environment (for instance) where one + services managed device may connect to two display devices + this code would enumerate all three devices and even + non-dynamic device selection code should retain the facility + to parse the list to find the index of a given device.} + +@Input psConnection Services connection +@Output puiNumDevices Number of devices present in the system +@Output puiDevIDs Pointer to called supplied array of + PVRSRV_DEVICE_IDENTIFIER structures. The + array is assumed to be at least + PVRSRV_MAX_DEVICES long. +@Return PVRSRV_OK on success. Otherwise, a PVRSRV_ + error code + */ /**************************************************************************/ +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVEnumerateDevices(const PVRSRV_CONNECTION *psConnection, + IMG_UINT32 *puiNumDevices, + PVRSRV_DEVICE_IDENTIFIER *puiDevIDs); + +/**************************************************************************/ /*! +@Function PVRSRVAcquireDeviceData +@Description Returns device info structure pointer for the requested device. + This populates a PVRSRV_DEV_DATA structure with appropriate + pointers to the DevInfo structure for the device requested. + + In a non-plug-and-play the first call to GetDeviceInfo for a + device causes device initialisation + + Calls to GetDeviceInfo are reference counted +@Input psConnection Services connection +@Input uiDevIndex Index to the required device obtained from the + PVRSRVEnumerateDevice function +@Output psDevData The returned Device Data +@Input eDeviceType Required device type. If type is unknown use + uiDevIndex to locate device data +@Return PVRSRV_OK on success. Otherwise, a PVRSRV_ + error code + */ /**************************************************************************/ +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVAcquireDeviceData(PVRSRV_CONNECTION *psConnection, + IMG_UINT32 uiDevIndex, + PVRSRV_DEV_DATA *psDevData, + PVRSRV_DEVICE_TYPE eDeviceType); + +/**************************************************************************/ /*! +@Function PVRSRVPollForValue +@Description Polls for a value to match a masked read of System Memory. + The function returns when either (1) the value read back + matches ui32Value, or (2) the maximum number of tries has + been reached. +@Input psConnection Services connection +@Input hOSEvent Handle to OS event to wait for +@Input pui32LinMemAddr the address of the memory to poll +@Input ui32Value the required value +@Input ui32Mask the mask to use +@Input ui32Waitus interval between tries (us) +@Input ui32Tries number of tries to make before giving up +@Return PVRSRV_OK on success. Otherwise, a + PVRSRV_ error code + */ /**************************************************************************/ +IMG_IMPORT +PVRSRV_ERROR PVRSRVPollForValue(const PVRSRV_CONNECTION *psConnection, + IMG_HANDLE hOSEvent, + volatile IMG_UINT32 *pui32LinMemAddr, + IMG_UINT32 ui32Value, + IMG_UINT32 ui32Mask, + IMG_UINT32 ui32Waitus, + IMG_UINT32 ui32Tries); + +/* this function is almost the same as PVRSRVPollForValue. The only difference + * is that it now handles the interval between tries itself. Therefore it can + * correctly handles the differences between the different platforms. + */ +IMG_IMPORT +PVRSRV_ERROR PVRSRVWaitForValue(const PVRSRV_CONNECTION *psConnection, + IMG_HANDLE hOSEvent, + volatile IMG_UINT32 *pui32LinMemAddr, + IMG_UINT32 ui32Value, + IMG_UINT32 ui32Mask); + + +/**************************************************************************/ /*! + @Function PVRSRVConditionCheckCallback + @Description Function prototype for use with the PVRSRVWaitForCondition() + API. Clients implement this callback to test if the condition + waited for has been met and become true. + + @Input pvUserData Pointer to client user data needed for + the check + @Output pbCondMet Updated on exit with condition state + + @Return PVRSRV_OK when condition tested without error + PVRSRV_* other system error that will lead to the + abnormal termination of the wait API. + */ +/******************************************************************************/ +typedef +PVRSRV_ERROR (*PVRSRVConditionCheckCallback)( + IMG_PVOID pvUserData, + IMG_BOOL* pbCondMet); + + +/**************************************************************************/ /*! +@Function PVRSRVWaitForCondition +@Description Wait using PVRSRVEventObjectWait() for a + condition (pfnCallback) to become true. It periodically + checks the condition state by employing a loop and + waiting on either the event supplied or sleeping for a brief + time (if hEvent is null) each time the condition is + checked and found not to be met. When the condition is true + the function returns. It will also return when the time + period has been exceeded or an error has occurred. + +@Input psConnection Services connection +@Input hEvent Event to wait on or NULL not to use event + objects but OS wait for a short time. +@Input pfnCallback Client condition check callback +@Input pvUserData Client user data supplied to callback + +@Return PVRSRV_OK When condition met + PVRSRV_ERROR_TIMEOUT When condition not met and time is up + PVRSRV_* Otherwise, some other error code + */ /**************************************************************************/ +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVWaitForCondition( + const PVRSRV_CONNECTION* psConnection, + IMG_HANDLE hEvent, + PVRSRVConditionCheckCallback pfnCallback, + IMG_PVOID pvUserData); + + +/**************************************************************************/ /*! +@Function PVRSRVWaitUntilSyncPrimOpReady +@Description Wait using PVRSRVWaitForCondition for a sync operation to + become ready. + +@Input psConnection Services connection +@Input hEvent Event to wait on or NULL not to use event + objects but OS wait for a short time. +@Input psOpCookie Sync operation cookie to test + +@Return PVRSRV_OK When condition met + PVRSRV_ERROR_TIMEOUT When condition not met and time is up + PVRSRV_* Otherwise, some other error code + */ /**************************************************************************/ +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVWaitUntilSyncPrimOpReady( + const PVRSRV_CONNECTION* psConnection, + IMG_HANDLE hEvent, + PSYNC_OP_COOKIE psOpCookie); + + +/****************************************************************************** + * PDUMP Function prototypes... + *****************************************************************************/ +#if defined(PDUMP) +/**************************************************************************/ /*! +@Function PVRSRVPDumpInit +@Description Pdump initialisation +@Input psConnection Services connection +@Return PVRSRV_OK on success. Otherwise, a PVRSRV_ + error code + */ /**************************************************************************/ +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpInit(const PVRSRV_CONNECTION *psConnection); + +/**************************************************************************/ /*! +@Function PVRSRVPDumpStartInitPhase +@Description Resume the pdump init phase state +@Input psConnection Services connection +@Return PVRSRV_OK on success. Otherwise, a PVRSRV_ + error code + */ /**************************************************************************/ +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpStartInitPhase(const PVRSRV_CONNECTION *psConnection); + +/**************************************************************************/ /*! +@Function PVRSRVPDumpStopInitPhase +@Description Stop the pdump init phase state +@Input psConnection Services connection +@Input eModuleID Which module is requesting to stop the init phase +@Return PVRSRV_OK on success. Otherwise, a PVRSRV_ + error code + */ /**************************************************************************/ +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpStopInitPhase(const PVRSRV_CONNECTION *psConnection, + IMG_MODULE_ID eModuleID); + +/**************************************************************************/ /*! +@Function PVRSRVPDumpSetFrame +@Description Sets the pdump frame +@Input psConnection Services connection +@Input ui32Frame frame id +@Return PVRSRV_OK on success. Otherwise, a PVRSRV_ + error code +*/ /**************************************************************************/ +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpSetFrame(const PVRSRV_CONNECTION *psConnection, + IMG_UINT32 ui32Frame); + +/**************************************************************************/ /*! +@Function PVRSRVPDumpGetFrame +@Description Gets the current pdump frame +@Input psConnection Services connection +@Output pui32Frame frame id +@Return PVRSRV_OK on success. Otherwise, a PVRSRV_error code +*/ /**************************************************************************/ +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpGetFrame(const PVRSRV_CONNECTION *psConnection, + IMG_UINT32 *pui32Frame); + +/**************************************************************************/ /*! +@Function PVRSRVPDumpIsLastCaptureFrame +@Description Returns whether this is the last frame of the capture range +@Input psConnection Services connection +@Return IMG_TRUE if last frame, + IMG_FALSE otherwise +*/ /**************************************************************************/ +IMG_IMPORT +IMG_BOOL IMG_CALLCONV PVRSRVPDumpIsLastCaptureFrame(const PVRSRV_CONNECTION *psConnection); + +/**************************************************************************/ /*! +@Function PVRSRVPDumpAfterRender +@Description Executes TraceBuffer and SignatureBuffer commands +@Input psDevData Device data +*/ /**************************************************************************/ +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpAfterRender(PVRSRV_DEV_DATA *psDevData); + +/**************************************************************************/ /*! +@Function PVRSRVPDumpComment +@Description PDumps a comment +@Input psConnection Services connection +@Input pszComment Comment to be inserted +@Input bContinuous pdump contiunous boolean +@Return PVRSRV_OK on success. Otherwise, a PVRSRV_ + error code + */ /**************************************************************************/ +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpComment(const PVRSRV_CONNECTION *psConnection, + const IMG_CHAR *pszComment, + IMG_BOOL bContinuous); + +/**************************************************************************/ /*! +@Function PVRSRVPDumpCommentf +@Description PDumps a formatted comment +@Input psConnection Services connection +@Input bContinuous pdump continuous boolean +@Input pszFormat Format string +@Input ... vararg list +@Return PVRSRV_OK on success. Otherwise, a PVRSRV_ + error code + */ /**************************************************************************/ +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpCommentf(const PVRSRV_CONNECTION *psConnection, + IMG_BOOL bContinuous, + const IMG_CHAR *pszFormat, ...) + IMG_FORMAT_PRINTF(3, 4); + +/**************************************************************************/ /*! +@Function PVRSRVPDumpCommentWithFlagsf +@Description PDumps a formatted comment, passing in flags +@Input psConnection Services connection +@Input ui32Flags Flags +@Input pszFormat Format string +@Input ... vararg list +@Return PVRSRV_OK on success. Otherwise, a PVRSRV_ + error code + */ /**************************************************************************/ +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpCommentWithFlagsf(const PVRSRV_CONNECTION *psConnection, + IMG_UINT32 ui32Flags, + const IMG_CHAR *pszFormat, ...) + IMG_FORMAT_PRINTF(3, 4); + + +/**************************************************************************/ /*! +@Function PVRSRVPDumpIsCapturing +@Description Reports whether PDump is currently capturing or not +@Input psConnection Services connection +@Output pbIsCapturing Indicates whether PDump is currently + capturing +@Return PVRSRV_OK on success. Otherwise, a PVRSRV_ + error code + */ /**************************************************************************/ +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpIsCapturing(const PVRSRV_CONNECTION *psConnection, + IMG_BOOL *pbIsCapturing); + + +/**************************************************************************/ /*! +@Function PVRSRVPDumpIsCapturingTest +@Description checks whether pdump is currently in frame capture range +@Input psConnection Services connection +@Return IMG_BOOL + */ /**************************************************************************/ +IMG_IMPORT +IMG_BOOL IMG_CALLCONV PVRSRVPDumpIsCapturingTest(const PVRSRV_CONNECTION *psConnection); + +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpSetDefaultCaptureParams(const PVRSRV_CONNECTION *psConnection, + IMG_UINT32 ui32Mode, + IMG_UINT32 ui32Start, + IMG_UINT32 ui32End, + IMG_UINT32 ui32Interval, + IMG_UINT32 ui32MaxParamFileSize); + +#else /* PDUMP */ + +#ifdef INLINE_IS_PRAGMA +#pragma inline(PVRSRVPDumpInit) +#endif +static INLINE PVRSRV_ERROR +PVRSRVPDumpInit(const PVRSRV_CONNECTION *psConnection) +{ + PVR_UNREFERENCED_PARAMETER(psConnection); + return PVRSRV_OK; +} + +#ifdef INLINE_IS_PRAGMA +#pragma inline(PVRSRVPDumpStartInitPhase) +#endif +static INLINE PVRSRV_ERROR +PVRSRVPDumpStartInitPhase(const PVRSRV_CONNECTION *psConnection) +{ + PVR_UNREFERENCED_PARAMETER(psConnection); + return PVRSRV_OK; +} + +#ifdef INLINE_IS_PRAGMA +#pragma inline(PVRSRVPDumpStopInitPhase) +#endif +static INLINE PVRSRV_ERROR +PVRSRVPDumpStopInitPhase(const PVRSRV_CONNECTION *psConnection) +{ + PVR_UNREFERENCED_PARAMETER(psConnection); + return PVRSRV_OK; +} + +#ifdef INLINE_IS_PRAGMA +#pragma inline(PVRSRVPDumpSetFrame) +#endif +static INLINE PVRSRV_ERROR +PVRSRVPDumpSetFrame(const PVRSRV_CONNECTION *psConnection, + IMG_UINT32 ui32Frame) +{ + PVR_UNREFERENCED_PARAMETER(psConnection); + PVR_UNREFERENCED_PARAMETER(ui32Frame); + return PVRSRV_OK; +} + +#ifdef INLINE_IS_PRAGMA +#pragma inline(PVRSRVPDumpGetFrame) +#endif +static INLINE PVRSRV_ERROR +PVRSRVPDumpGetFrame(const PVRSRV_CONNECTION *psConnection, + IMG_UINT32 *pui32Frame) +{ + PVR_UNREFERENCED_PARAMETER(psConnection); + PVR_UNREFERENCED_PARAMETER(pui32Frame); + return PVRSRV_OK; +} + + +#ifdef INLINE_IS_PRAGMA +#pragma inline(PVRSRVPDumpIsLastCaptureFrame) +#endif +static INLINE IMG_BOOL +PVRSRVPDumpIsLastCaptureFrame(const PVRSRV_CONNECTION *psConnection) +{ + PVR_UNREFERENCED_PARAMETER(psConnection); + return IMG_FALSE; +} + +#ifdef INLINE_IS_PRAGMA +#pragma inline(PVRSRVPDumpAfterRender) +#endif +static INLINE PVRSRV_ERROR +PVRSRVPDumpAfterRender(PVRSRV_DEV_DATA *psDevData) +{ + PVR_UNREFERENCED_PARAMETER(psDevData); + return PVRSRV_OK; +} + +#ifdef INLINE_IS_PRAGMA +#pragma inline(PVRSRVPDumpComment) +#endif +static INLINE PVRSRV_ERROR +PVRSRVPDumpComment(const PVRSRV_CONNECTION *psConnection, + const IMG_CHAR *pszComment, + IMG_BOOL bContinuous) +{ + PVR_UNREFERENCED_PARAMETER(psConnection); + PVR_UNREFERENCED_PARAMETER(pszComment); + PVR_UNREFERENCED_PARAMETER(bContinuous); + return PVRSRV_OK; +} + +#ifdef INLINE_IS_PRAGMA +#pragma inline(PVRSRVPDumpCommentf) +#endif +static INLINE PVRSRV_ERROR +PVRSRVPDumpCommentf(const PVRSRV_CONNECTION *psConnection, + IMG_BOOL bContinuous, + const IMG_CHAR *pszFormat, ...) +{ + PVR_UNREFERENCED_PARAMETER(psConnection); + PVR_UNREFERENCED_PARAMETER(bContinuous); + PVR_UNREFERENCED_PARAMETER(pszFormat); + return PVRSRV_OK; +} + +#ifdef INLINE_IS_PRAGMA +#pragma inline(PVRSRVPDumpCommentWithFlagsf) +#endif +static INLINE PVRSRV_ERROR +PVRSRVPDumpCommentWithFlagsf(const PVRSRV_CONNECTION *psConnection, + IMG_UINT32 ui32Flags, + const IMG_CHAR *pszFormat, ...) +{ + PVR_UNREFERENCED_PARAMETER(psConnection); + PVR_UNREFERENCED_PARAMETER(ui32Flags); + PVR_UNREFERENCED_PARAMETER(pszFormat); + return PVRSRV_OK; +} + + +#ifdef INLINE_IS_PRAGMA +#pragma inline(PVRSRVPDumpIsCapturing) +#endif +static INLINE PVRSRV_ERROR +PVRSRVPDumpIsCapturing(const PVRSRV_CONNECTION *psConnection, + IMG_BOOL *pbIsCapturing) +{ + PVR_UNREFERENCED_PARAMETER(psConnection); + *pbIsCapturing = IMG_FALSE; + return PVRSRV_OK; +} + +#ifdef INLINE_IS_PRAGMA +#pragma inline(PVRSRVPDumpIsCapturingTest) +#endif +static INLINE IMG_BOOL +PVRSRVPDumpIsCapturingTest(const PVRSRV_CONNECTION *psConnection) +{ + PVR_UNREFERENCED_PARAMETER(psConnection); + return IMG_FALSE; +} + +#ifdef INLINE_IS_PRAGMA +#pragma inline(PDumpSetPidCapRange) +#endif +static INLINE PVRSRV_ERROR +PVRSRVPDumpSetDefaultCaptureParams(const PVRSRV_CONNECTION *psConnection, + IMG_UINT32 ui32Mode, + IMG_UINT32 ui32Start, + IMG_UINT32 ui32End, + IMG_UINT32 ui32Interval, + IMG_UINT32 ui32MaxParamFileSize) +{ + PVR_UNREFERENCED_PARAMETER(psConnection); + PVR_UNREFERENCED_PARAMETER(ui32Mode); + PVR_UNREFERENCED_PARAMETER(ui32Start); + PVR_UNREFERENCED_PARAMETER(ui32End); + PVR_UNREFERENCED_PARAMETER(ui32Interval); + PVR_UNREFERENCED_PARAMETER(ui32MaxParamFileSize); + + return PVRSRV_OK; +} + + +#endif /* PDUMP */ + +/**************************************************************************/ /*! +@Function PVRSRVLoadLibrary +@Description Load the named Dynamic-Link (Shared) Library. This will perform + reference counting in association with PVRSRVUnloadLibrary, + so for example if the same library is loaded twice and unloaded once, + a reference to the library will remain. +@Input pszLibraryName the name of the library to load +@Return On success, the handle of the newly-loaded + library. Otherwise, zero. + */ /**************************************************************************/ +IMG_IMPORT IMG_HANDLE PVRSRVLoadLibrary(const IMG_CHAR *pszLibraryName); + +/**************************************************************************/ /*! +@Function PVRSRVUnloadLibrary +@Description Unload the Dynamic-Link (Shared) Library which had previously been + loaded using PVRSRVLoadLibrary(). See PVRSRVLoadLibrary() for + information regarding reference counting. +@Input hExtDrv handle of the Dynamic-Link / Shared library + to unload, as returned by PVRSRVLoadLibrary(). +@Return PVRSRV_OK if successful. Otherwise, + PVRSRV_ERROR_UNLOAD_LIBRARY_FAILED. + */ /**************************************************************************/ +IMG_IMPORT PVRSRV_ERROR PVRSRVUnloadLibrary(IMG_HANDLE hExtDrv); + +/**************************************************************************/ /*! +@Function PVRSRVGetLibFuncAddr +@Description Returns the address of a function in a Dynamic-Link / Shared + Library. +@Input hExtDrv handle of the Dynamic-Link / Shared Library + in which the function resides +@Input pszFunctionName the name of the function +@Output ppvFuncAddr on success, the address of the function + requested. Otherwise, NULL. +@Return PVRSRV_OK if successful. Otherwise, + PVRSRV_ERROR_UNABLE_TO_GET_FUNC_ADDR. + */ /**************************************************************************/ +IMG_IMPORT PVRSRV_ERROR PVRSRVGetLibFuncAddr(IMG_HANDLE hExtDrv, + const IMG_CHAR *pszFunctionName, + IMG_VOID **ppvFuncAddr); + +/**************************************************************************/ /*! +@Function PVRSRVClockus +@Description Returns the current system clock time, in microseconds. Note + that this does not necessarily guarantee microsecond accuracy. +@Return the curent system clock time, in + microseconds + */ /**************************************************************************/ +IMG_IMPORT IMG_UINT32 PVRSRVClockus (void); + +/**************************************************************************/ /*! +@Function PVRSRVWaitus +@Description Waits for the specified number of microseconds +@Input ui32Timeus the time to wait for, in microseconds +@Return None + */ /**************************************************************************/ +IMG_IMPORT IMG_VOID PVRSRVWaitus (IMG_UINT32 ui32Timeus); + +/**************************************************************************/ /*! +@Function PVRSRVReleaseThreadQuanta +@Description Releases thread quanta +@Return None + */ /**************************************************************************/ +IMG_IMPORT IMG_VOID PVRSRVReleaseThreadQuanta (void); + +/**************************************************************************/ /*! +@Function PVRSRVGetCurrentProcessID +@Description Returns handle for current process +@Return ID of current process + */ /**************************************************************************/ +IMG_IMPORT IMG_PID IMG_CALLCONV PVRSRVGetCurrentProcessID(void); + +/**************************************************************************/ /*! +@Function PVRSRVSetLocale +@Description Thin wrapper on posix setlocale +@Input pszLocale +@Return IMG_NULL (currently) + */ /**************************************************************************/ +IMG_IMPORT IMG_CHAR * IMG_CALLCONV PVRSRVSetLocale(const IMG_CHAR *pszLocale); + + +/**************************************************************************/ /*! +@Function PVRSRVCreateAppHintState +@Description Create app hint state +@Input eModuleID module id +@Input pszAppName app name +@Output ppvState state +@Return None + */ /**************************************************************************/ +IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVCreateAppHintState(IMG_MODULE_ID eModuleID, + const IMG_CHAR *pszAppName, + IMG_VOID **ppvState); +/**************************************************************************/ /*! +@Function PVRSRVFreeAppHintState +@Description Free the app hint state, if it was created +@Input eModuleID module id +@Input pvHintState app hint state +@Return None + */ /**************************************************************************/ +IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVFreeAppHintState(IMG_MODULE_ID eModuleID, + IMG_VOID *pvHintState); + +/**************************************************************************/ /*! +@Function PVRSRVGetAppHint +@Description Return the value of this hint from state or use default +@Input pvHintState hint state +@Input pszHintName hint name +@Input eDataType data type +@Input pvDefault default value +@Output pvReturn hint value +@Return True if hint read, False if used default + */ /**************************************************************************/ +IMG_IMPORT IMG_BOOL IMG_CALLCONV PVRSRVGetAppHint(IMG_VOID *pvHintState, + const IMG_CHAR *pszHintName, + IMG_DATA_TYPE eDataType, + const IMG_VOID *pvDefault, + IMG_VOID *pvReturn); + +/****************************************************************************** + * Memory API(s) + *****************************************************************************/ + +/* Exported APIs */ +/**************************************************************************/ /*! +@Function PVRSRVAllocUserModeMem +@Description Allocate a block of user-mode memory +@Input ui32Size the amount of memory to allocate +@Return On success, a pointer to the memory allocated. + Otherwise, NULL. + */ /**************************************************************************/ +IMG_IMPORT IMG_PVOID IMG_CALLCONV PVRSRVAllocUserModeMem (IMG_SIZE_T ui32Size); + +/**************************************************************************/ /*! +@Function PVRSRVCallocUserModeMem +@Description Allocate a block of user-mode memory +@Input ui32Size the amount of memory to allocate +@Return On success, a pointer to the memory allocated. + Otherwise, NULL. + */ /**************************************************************************/ +IMG_IMPORT IMG_PVOID IMG_CALLCONV PVRSRVCallocUserModeMem (IMG_SIZE_T ui32Size); + +/**************************************************************************/ /*! +@Function PVRSRVReallocUserModeMem +@Description Re-allocate a block of memory +@Input pvBase the address of the existing memory, previously + allocated with PVRSRVAllocUserModeMem +@Input uNewSize the newly-desired size of the memory chunk +@Return On success, a pointer to the memory block. If the + size of the block could not be changed, the + return value is NULL. + */ /**************************************************************************/ +IMG_IMPORT IMG_PVOID IMG_CALLCONV PVRSRVReallocUserModeMem (IMG_PVOID pvBase, IMG_SIZE_T uNewSize); +/**************************************************************************/ /*! +@Function PVRSRVFreeUserModeMem +@Description Free a block of memory previously allocated with + PVRSRVAllocUserModeMem +@Input pvMem pointer to the block of memory to be freed +@Return None + */ /**************************************************************************/ +IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVFreeUserModeMem (IMG_PVOID pvMem); + +/**************************************************************************/ /*! +@Function PVRSRVMemCopy +@Description Copy a block of memory + Safe implementation of memset for use with device memory. +@Input pvDst Pointer to the destination +@Input pvSrc Pointer to the source location +@Input uiSize The amount of memory to copy in bytes +@Return None + */ /**************************************************************************/ +IMG_IMPORT IMG_VOID PVRSRVMemCopy(IMG_VOID *pvDst, const IMG_VOID *pvSrc, IMG_SIZE_T uiSize); + +/**************************************************************************/ /*! +@Function PVRSRVCachedMemCopy +@Description Copy a block of memory between two cached memory allocations. + For use only when source and destination are both cached memory allocations. +@Input pvDst Pointer to the destination +@Input pvSrc Pointer to the source location +@Input uiSize The amount of memory to copy in bytes +@Return None + */ /**************************************************************************/ +IMG_IMPORT void PVRSRVCachedMemCopy(IMG_VOID *pvDst, const IMG_VOID *pvSrc, IMG_SIZE_T uiSize); + +/**************************************************************************/ /*! +@Function PVRSRVDeviceMemCopy +@Description Copy a block of memory to/from a device memory allocation. + For use when one or both of the allocations is a device memory allocation. +@Input pvDst Pointer to the destination +@Input pvSrc Pointer to the source location +@Input uiSize The amount of memory to copy in bytes +@Return None + */ /**************************************************************************/ +IMG_IMPORT IMG_VOID PVRSRVDeviceMemCopy(IMG_VOID *pvDst, const IMG_VOID *pvSrc, IMG_SIZE_T uiSize); + +/**************************************************************************/ /*! +@Function PVRSRVMemSet +@Description Set all bytes in a region of memory to the specified value. + Safe implementation of memset for use with device memory. +@Input pvDest Pointer to the start of the memory region +@Input ui8Value The value to be written +@Input uiSize The number of bytes to be set to ui8Value +@Return None + */ /**************************************************************************/ +IMG_IMPORT IMG_VOID PVRSRVMemSet(IMG_VOID *pvDest, IMG_UINT8 ui8Value, IMG_SIZE_T uiSize); + +/**************************************************************************/ /*! +@Function PVRSRVCachedMemSet +@Description Set all bytes in a region of cached memory to the specified value. + For use only when the destination is a cached memory allocation. +@Input pvDest Pointer to the start of the memory region +@Input ui8Value The value to be written +@Input uiSize The number of bytes to be set to ui8Value +@Return None + */ /**************************************************************************/ +IMG_IMPORT IMG_VOID PVRSRVCachedMemSet(IMG_VOID *pvDest, IMG_UINT8 ui8Value, IMG_SIZE_T uiSize); + +/**************************************************************************/ /*! +@Function PVRSRVDeviceMemSet +@Description Set all bytes in a region of device memory to the specified value. + The destination pointer should be a device memory buffer. +@Input pvDest Pointer to the start of the memory region +@Input ui8Value The value to be written +@Input uiSize The number of bytes to be set to ui8Value +@Return None + */ /**************************************************************************/ +IMG_IMPORT IMG_VOID PVRSRVDeviceMemSet(IMG_VOID *pvDest, IMG_UINT8 ui8Value, IMG_SIZE_T uiSize); + +/**************************************************************************/ /*! +@Function PVRSRVLockProcessGlobalMutex +@Description Locking function for non-recursive coarse-grained mutex shared + between all threads in a proccess. +@Return None + */ /**************************************************************************/ +IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVLockProcessGlobalMutex(void); + +/**************************************************************************/ /*! +@Function PVRSRVUnlockProcessGlobalMutex +@Description Unlocking function for non-recursive coarse-grained mutex shared + between all threads in a proccess. +@Return None + */ /**************************************************************************/ +IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVUnlockProcessGlobalMutex(void); + + +typedef struct _OS_MUTEX_ *PVRSRV_MUTEX_HANDLE; + +/**************************************************************************/ /*! +@Function PVRSRVCreateMutex +@Description creates a mutex +@Output phMutex ptr to mutex handle +@Return PVRSRV_OK on success. Otherwise, a PVRSRV_ + error code + */ /**************************************************************************/ +#if !defined(PVR_DEBUG_MUTEXES) +IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV PVRSRVCreateMutex(PVRSRV_MUTEX_HANDLE *phMutex); +#else +IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV PVRSRVCreateMutex(PVRSRV_MUTEX_HANDLE *phMutex, + IMG_CHAR pszMutexName[], + IMG_CHAR pszFilename[], + IMG_INT iLine); +#define PVRSRVCreateMutex(phMutex) \ + PVRSRVCreateMutex(phMutex, #phMutex, __FILE__, __LINE__) +#endif + +/**************************************************************************/ /*! +@Function PVRSRVDestroyMutex +@Description Create a mutex. +@Input hMutex On success, filled with the new Mutex +@Return PVRSRV_OK on success. Otherwise, a PVRSRV_ + error code + */ /**********************************************************************/ +#if !defined(PVR_DEBUG_MUTEXES) +IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV PVRSRVDestroyMutex(PVRSRV_MUTEX_HANDLE hMutex); +#else +IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV PVRSRVDestroyMutex(PVRSRV_MUTEX_HANDLE hMutex, + IMG_CHAR pszMutexName[], + IMG_CHAR pszFilename[], + IMG_INT iLine); +#define PVRSRVDestroyMutex(hMutex) \ + PVRSRVDestroyMutex(hMutex, #hMutex, __FILE__, __LINE__) +#endif + +/**************************************************************************/ /*! +@Function PVRSRVLockMutex +@Description Lock the mutex passed +@Input hMutex handle of the mutex to be locked +@Return None + */ /**********************************************************************/ +#if !defined(PVR_DEBUG_MUTEXES) +IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVLockMutex(PVRSRV_MUTEX_HANDLE hMutex); +#else +IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVLockMutex(PVRSRV_MUTEX_HANDLE hMutex, + IMG_CHAR pszMutexName[], + IMG_CHAR pszFilename[], + IMG_INT iLine); +#define PVRSRVLockMutex(hMutex) \ + PVRSRVLockMutex(hMutex, #hMutex, __FILE__, __LINE__) +#endif + +/**************************************************************************/ /*! +@Function PVRSRVUnlockMutex +@Description Unlock the mutex passed +@Input hMutex handle of the mutex to be unlocked +@Return None + */ /**********************************************************************/ +#if !defined(PVR_DEBUG_MUTEXES) +IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVUnlockMutex(PVRSRV_MUTEX_HANDLE hMutex); +#else +IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVUnlockMutex(PVRSRV_MUTEX_HANDLE hMutex, + IMG_CHAR pszMutexName[], + IMG_CHAR pszFilename[], + IMG_INT iLine); +#define PVRSRVUnlockMutex(hMutex) \ + PVRSRVUnlockMutex(hMutex, #hMutex, __FILE__, __LINE__) +#endif + +struct _PVRSRV_SEMAPHORE_OPAQUE_STRUCT_; +typedef struct _PVRSRV_SEMAPHORE_OPAQUE_STRUCT_ *PVRSRV_SEMAPHORE_HANDLE; /*!< Convenience typedef */ + + +#if defined(_MSC_VER) + /*! + Used when waiting for a semaphore to become unlocked. Indicates that + the caller is willing to wait forever. + */ + #define IMG_SEMAPHORE_WAIT_INFINITE ((IMG_UINT64)0xFFFFFFFFFFFFFFFF) +#else + /*! + Used when waiting for a semaphore to become unlocked. Indicates that + the caller is willing to wait forever. + */ + #define IMG_SEMAPHORE_WAIT_INFINITE ((IMG_UINT64)0xFFFFFFFFFFFFFFFFull) +#endif + +#ifdef INLINE_IS_PRAGMA +#pragma inline(PVRSRVCreateSemaphore) +#endif +/**************************************************************************/ /*! +@Function PVRSRVCreateSemaphore +@Description Create a semaphore with an initial count +@Output phSemaphore on success, ptr to the handle of the new + semaphore. Otherwise, zero. +@Input iInitialCount initial count +@Return PVRSRV_OK on success. Otherwise, a PVRSRV_ + error code + */ /**************************************************************************/ +static INLINE PVRSRV_ERROR PVRSRVCreateSemaphore(PVRSRV_SEMAPHORE_HANDLE *phSemaphore, + IMG_INT iInitialCount) +{ + PVR_UNREFERENCED_PARAMETER(iInitialCount); + *phSemaphore = 0; + return PVRSRV_OK; +} + +#ifdef INLINE_IS_PRAGMA +#pragma inline(PVRSRVDestroySemaphore) +#endif +/**************************************************************************/ /*! +@Function PVRSRVDestroySemaphore +@Description destroy the semaphore passed +@Input hSemaphore the semaphore to be destroyed +@Return PVRSRV_OK on success. Otherwise, a PVRSRV_ + error code + */ /**************************************************************************/ +static INLINE PVRSRV_ERROR PVRSRVDestroySemaphore(PVRSRV_SEMAPHORE_HANDLE hSemaphore) +{ + PVR_UNREFERENCED_PARAMETER(hSemaphore); + return PVRSRV_OK; +} + +#ifdef INLINE_IS_PRAGMA +#pragma inline(PVRSRVWaitSemaphore) +#endif +/**************************************************************************/ /*! +@Function PVRSRVWaitSemaphore +@Description wait on the specified semaphore +@Input hSemaphore the semephore on which to wait +@Input ui64TimeoutMicroSeconds the time to wait for the semaphore to + become unlocked, if locked when the function + is called. +@Return PVRSRV_OK on success. Otherwise, a PVRSRV_ + error code + */ /**************************************************************************/ +static INLINE PVRSRV_ERROR PVRSRVWaitSemaphore(PVRSRV_SEMAPHORE_HANDLE hSemaphore, + IMG_UINT64 ui64TimeoutMicroSeconds) +{ + PVR_UNREFERENCED_PARAMETER(hSemaphore); + PVR_UNREFERENCED_PARAMETER(ui64TimeoutMicroSeconds); + return PVRSRV_ERROR_INVALID_PARAMS; +} + +#ifdef INLINE_IS_PRAGMA +#pragma inline(PVRSRVPostSemaphore) +#endif +/**************************************************************************/ /*! +@Function PVRSRVPostSemaphore +@Description post semphore +@Input hSemaphore handle to semaphore +@Input iPostCount post count +@Return None + */ /**************************************************************************/ +static INLINE IMG_VOID PVRSRVPostSemaphore(PVRSRV_SEMAPHORE_HANDLE hSemaphore, IMG_INT iPostCount) +{ + PVR_UNREFERENCED_PARAMETER(hSemaphore); + PVR_UNREFERENCED_PARAMETER(iPostCount); +} + +/* Non-exported APIs */ +#if defined(DEBUG) && (defined(__linux__) || defined(_WIN32) || defined(__QNXNTO__)) +/**************************************************************************/ /*! +@Function PVRSRVAllocUserModeMemTracking +@Description Wrapper function for malloc, used for memory-leak detection +@Input ui32Size number of bytes to be allocated +@Input pszFileName filename of the calling code +@Input ui32LineNumber line number of the calling code +@Return On success, a ptr to the newly-allocated + memory. Otherwise, NULL. + */ /**************************************************************************/ +IMG_IMPORT IMG_PVOID IMG_CALLCONV PVRSRVAllocUserModeMemTracking(IMG_SIZE_T ui32Size, + IMG_CHAR *pszFileName, + IMG_UINT32 ui32LineNumber); + +/**************************************************************************/ /*! +@Function PVRSRVCallocUserModeMemTracking +@Description Wrapper function for calloc, used for memory-leak detection +@Input ui32Size number of bytes to be allocated +@Input pszFileName filename of the calling code +@Input ui32LineNumber line number of the calling code +@Return On success, a ptr to the newly-allocated + memory. Otherwise, NULL. + */ /**************************************************************************/ +IMG_IMPORT IMG_PVOID IMG_CALLCONV PVRSRVCallocUserModeMemTracking(IMG_SIZE_T ui32Size, + IMG_CHAR *pszFileName, + IMG_UINT32 ui32LineNumber); + +/**************************************************************************/ /*! +@Function PVRSRVFreeUserModeMemTracking +@Description Wrapper for free - see PVRSRVAllocUserModeMemTracking +@Input pvMem pointer to the memory to be freed +@Return None + */ /**************************************************************************/ +IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVFreeUserModeMemTracking(IMG_VOID *pvMem); + +/**************************************************************************/ /*! +@Function PVRSRVReallocUserModeMemTracking +@Description Wrapper for realloc, used in memory-leak detection +@Input pvMem pointer to the existing memory block +@Input ui32NewSize the desired new size of the block +@Input pszFileName the filename of the calling code +@Input ui32LineNumber the line number of the calling code +@Return on success, a pointer to the memory block. + This may not necessarily be the same + location as the block was at before the + call. On failure, NULL is returned. + */ /**************************************************************************/ +IMG_IMPORT IMG_PVOID IMG_CALLCONV PVRSRVReallocUserModeMemTracking(IMG_VOID *pvMem, + IMG_SIZE_T ui32NewSize, + IMG_CHAR *pszFileName, + IMG_UINT32 ui32LineNumber); +#endif /* defined(DEBUG) && (defined(__linux__) || defined(_WIN32)) */ + +/**************************************************************************/ /*! +@Function PVRSRVDumpDebugInfo +@Description Dump debug information to kernel log +@Input psConnection Services connection +@Return IMG_VOID + */ /**************************************************************************/ +IMG_IMPORT IMG_VOID +PVRSRVDumpDebugInfo(const PVRSRV_CONNECTION *psConnection, IMG_UINT32 ui32VerbLevel); + +/**************************************************************************/ /*! +@Function PVRSRVGetDevClockSpeed +@Description Gets the clock speed +@Input psConnection Services connection +@Input psDevData Pointer to the PVRSRV_DEV_DATA context +@Output pui32ClockSpeed Variable for storing clock speed +@Return IMG_BOOL True if the operation was successful + */ /**************************************************************************/ +IMG_IMPORT IMG_BOOL IMG_CALLCONV PVRSRVGetDevClockSpeed(const PVRSRV_CONNECTION *psConnection, + PVRSRV_DEV_DATA *psDevData, + IMG_PUINT32 pui32ClockSpeed); + +/**************************************************************************/ /*! +@Function PVRSRVResetHWRLogs +@Description Resets the HWR Logs buffer (the hardware recovery count is not reset) +@Input psConnection Services connection +@Input psDevData Pointer to the PVRSRV_DEV_DATA context +@Return PVRSRV_ERROR PVRSRV_OK on success. Otherwise, a PVRSRV_ + error code + */ /**************************************************************************/ +IMG_IMPORT PVRSRV_ERROR +PVRSRVResetHWRLogs(const PVRSRV_CONNECTION *psConnection, PVRSRV_DEV_DATA *psDevData); + + +/****************************************************************************** + * PVR Global Event Object - Event APIs + *****************************************************************************/ + +/***************************************************************************** +@Function PVRSRVAcquireGlobalEventHandle +@Description Gets a handle to an event that is opened on the global + event object. +@Input psConnection Services connection +@Output phEvent Global event handle +@Return PVRSRV_OK on success. Otherwise, a PVRSRV_ + error code + */ /**************************************************************************/ +IMG_IMPORT PVRSRV_ERROR +PVRSRVAcquireGlobalEventHandle(const PVRSRV_CONNECTION *psConnection, + IMG_HANDLE *phEvent); + +/**************************************************************************/ /*! +@Function PVRSRVReleaseGlobalEventHandle +@Description Destroys the event handle previously acquired. +@Input psConnection Services connection +@Input phEvent Global event handle +@Return PVRSRV_OK on success. Otherwise, a PVRSRV_ + error code + */ /**************************************************************************/ +IMG_IMPORT PVRSRV_ERROR +PVRSRVReleaseGlobalEventHandle(const PVRSRV_CONNECTION *psConnection, + IMG_HANDLE hEvent); + +/**************************************************************************/ /*! +@Function PVRSRVEventObjectWait +@Description Wait (block) on the OS-specific event object passed +@Input psConnection Services connection +@Input hEvent Global event handle to wait on +@Return PVRSRV_OK on success. Otherwise, a PVRSRV_ + error code + */ /**************************************************************************/ +IMG_IMPORT PVRSRV_ERROR +PVRSRVEventObjectWait(const PVRSRV_CONNECTION *psConnection, + IMG_HANDLE hEvent); + +/****************************************************************************** + * PVR Global Event Object - Event APIs End + *****************************************************************************/ + + +IMG_IMPORT PVRSRV_ERROR +PVRSRVKickDevices(const PVRSRV_CONNECTION *psConnection); + + +/**************************************************************************/ /*! +@Function PVRSRVSoftReset +@Description Resets some modules of the device +@Input psConnection Services connection +@Input psDevData Pointer to the PVRSRV_DEV_DATA context +@Input ui64ResetValue1 A mask for which each bit set corresponds + to a module to reset (via the SOFT_RESET + register). +@Input ui64ResetValue2 A mask for which each bit set corresponds + to a module to reset (via the SOFT_RESET2 + register). +@Return PVRSRV_ERROR +*/ /***************************************************************************/ +IMG_IMPORT PVRSRV_ERROR +PVRSRVSoftReset(const PVRSRV_CONNECTION *psConnection, + PVRSRV_DEV_DATA *psDevData, + IMG_UINT64 ui64ResetValue1, + IMG_UINT64 ui64ResetValue2); + +/*! + Time wrapping macro +*/ +#define TIME_NOT_PASSED_UINT32(a,b,c) (((a) - (b)) < (c)) + + +#if defined (__cplusplus) +} +#endif +#endif /* __SERVICES_H__ */ + +/****************************************************************************** + End of file (services.h) +******************************************************************************/ + diff --git a/drivers/gpu/rogue_m/include/servicesext.h b/drivers/gpu/rogue_m/include/servicesext.h new file mode 100644 index 000000000000..f6fc8c101b33 --- /dev/null +++ b/drivers/gpu/rogue_m/include/servicesext.h @@ -0,0 +1,195 @@ +/*************************************************************************/ /*! +@File +@Title Services definitions required by external drivers +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Provides services data structures, defines and prototypes + required by external drivers +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#if !defined (__SERVICESEXT_H__) +#define __SERVICESEXT_H__ + +/* include/ */ +#include "pvrsrv_error.h" +#include "img_types.h" +#include "img_3dtypes.h" +#include "pvrsrv_device_types.h" + + +/* + * Lock buffer read/write flags + */ +#define PVRSRV_LOCKFLG_READONLY (1) /*!< The locking process will only read the locked surface */ + +/*! + ***************************************************************************** + * Services State + *****************************************************************************/ +typedef enum _PVRSRV_SERVICES_STATE_ +{ + PVRSRV_SERVICES_STATE_OK = 0, + PVRSRV_SERVICES_STATE_BAD, +} PVRSRV_SERVICES_STATE; + + +/*! + ***************************************************************************** + * States for power management + *****************************************************************************/ +/*! + System Power State Enum + */ +typedef enum _PVRSRV_SYS_POWER_STATE_ +{ + PVRSRV_SYS_POWER_STATE_Unspecified = -1, /*!< Unspecified : Uninitialised */ + PVRSRV_SYS_POWER_STATE_OFF = 0, /*!< Off */ + PVRSRV_SYS_POWER_STATE_ON = 1, /*!< On */ + + PVRSRV_SYS_POWER_STATE_FORCE_I32 = 0x7fffffff /*!< Force enum to be at least 32-bits wide */ + +} PVRSRV_SYS_POWER_STATE, *PPVRSRV_SYS_POWER_STATE; /*!< Typedef for ptr to PVRSRV_SYS_POWER_STATE */ + +/*! + Device Power State Enum + */ +typedef enum _PVRSRV_DEV_POWER_STATE_ +{ + PVRSRV_DEV_POWER_STATE_DEFAULT = -1, /*!< Default state for the device */ + PVRSRV_DEV_POWER_STATE_OFF = 0, /*!< Unpowered */ + PVRSRV_DEV_POWER_STATE_ON = 1, /*!< Running */ + + PVRSRV_DEV_POWER_STATE_FORCE_I32 = 0x7fffffff /*!< Force enum to be at least 32-bits wide */ + +} PVRSRV_DEV_POWER_STATE, *PPVRSRV_DEV_POWER_STATE; /*!< Typedef for ptr to PVRSRV_DEV_POWER_STATE */ /* PRQA S 3205 */ + + +/* Power transition handler prototypes */ + +/*! + Typedef for a pointer to a Function that will be called before a transition + from one power state to another. See also PFN_POST_POWER. + */ +typedef PVRSRV_ERROR (*PFN_PRE_POWER) (IMG_HANDLE hDevHandle, + PVRSRV_DEV_POWER_STATE eNewPowerState, + PVRSRV_DEV_POWER_STATE eCurrentPowerState, + IMG_BOOL bForced); +/*! + Typedef for a pointer to a Function that will be called after a transition + from one power state to another. See also PFN_PRE_POWER. + */ +typedef PVRSRV_ERROR (*PFN_POST_POWER) (IMG_HANDLE hDevHandle, + PVRSRV_DEV_POWER_STATE eNewPowerState, + PVRSRV_DEV_POWER_STATE eCurrentPowerState, + IMG_BOOL bForced); + +/* Clock speed handler prototypes */ + +/*! + Typedef for a pointer to a Function that will be caled before a transition + from one clockspeed to another. See also PFN_POST_CLOCKSPEED_CHANGE. + */ +typedef PVRSRV_ERROR (*PFN_PRE_CLOCKSPEED_CHANGE) (IMG_HANDLE hDevHandle, + PVRSRV_DEV_POWER_STATE eCurrentPowerState); + +/*! + Typedef for a pointer to a Function that will be caled after a transition + from one clockspeed to another. See also PFN_PRE_CLOCKSPEED_CHANGE. + */ +typedef PVRSRV_ERROR (*PFN_POST_CLOCKSPEED_CHANGE) (IMG_HANDLE hDevHandle, + PVRSRV_DEV_POWER_STATE eCurrentPowerState); + +/*! + Typedef for a pointer to a function that will be called to transition the device + to a forced idle state. Used in unison with (forced) power requests, DVFS and cluster count changes. + */ +typedef PVRSRV_ERROR (*PFN_FORCED_IDLE_REQUEST) (IMG_HANDLE hDevHandle, + IMG_BOOL bDeviceOffPermitted); + +/*! + Typedef for a pointer to a function that will be called to cancel a forced idle state + and return the firmware back to a state where the hardware can be scheduled. + */ +typedef PVRSRV_ERROR (*PFN_FORCED_IDLE_CANCEL_REQUEST) (IMG_HANDLE hDevHandle); + +typedef PVRSRV_ERROR (*PFN_DUST_COUNT_REQUEST) (IMG_HANDLE hDevHandle, + IMG_UINT32 ui32DustCount); + +/*! + ***************************************************************************** + * Enumeration of possible alpha types. + *****************************************************************************/ +typedef enum _PVRSRV_COLOURSPACE_FORMAT_ { + PVRSRV_COLOURSPACE_FORMAT_UNKNOWN = 0x00000000, /*!< Colourspace Format: Unknown */ + PVRSRV_COLOURSPACE_FORMAT_LINEAR = 0x00010000, /*!< Colourspace Format: Linear */ + PVRSRV_COLOURSPACE_FORMAT_NONLINEAR = 0x00020000, /*!< Colourspace Format: Non-Linear */ + PVRSRV_COLOURSPACE_FORMAT_MASK = 0x000F0000, /*!< Colourspace Format Mask */ +} PVRSRV_COLOURSPACE_FORMAT; + + +/*! + * Drawable orientation (in degrees clockwise). + */ +typedef enum _IMG_ROTATION_ PVRSRV_ROTATION; + +#define PVRSRV_ROTATE_0 IMG_ROTATION_0DEG +#define PVRSRV_ROTATE_90 IMG_ROTATION_90DEG +#define PVRSRV_ROTATE_180 IMG_ROTATION_180DEG +#define PVRSRV_ROTATE_270 IMG_ROTATION_270DEG +#define PVRSRV_FLIP_Y IMG_ROTATION_FLIP_Y + + +/*! + ***************************************************************************** + * This structure is used for OS independent registry (profile) access + *****************************************************************************/ + +typedef struct _PVRSRV_REGISTRY_INFO +{ + IMG_UINT32 ui32DevCookie; + IMG_PCHAR pszKey; + IMG_PCHAR pszValue; + IMG_PCHAR pszBuf; + IMG_UINT32 ui32BufSize; +} PVRSRV_REGISTRY_INFO, *PPVRSRV_REGISTRY_INFO; + +#endif /* __SERVICESEXT_H__ */ +/***************************************************************************** + End of file (servicesext.h) +*****************************************************************************/ + diff --git a/drivers/gpu/rogue_m/include/sync_external.h b/drivers/gpu/rogue_m/include/sync_external.h new file mode 100644 index 000000000000..7ee0945fdb7a --- /dev/null +++ b/drivers/gpu/rogue_m/include/sync_external.h @@ -0,0 +1,79 @@ +/*************************************************************************/ /*! +@File +@Title Services external synchronisation interface header +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Defines synchronisation structures that are visible internally + and externally +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#include "img_types.h" + +#ifndef _SYNC_EXTERNAL_ +#define _SYNC_EXTERNAL_ + +#define SYNC_MAX_CLASS_NAME_LEN 32 + +typedef IMG_HANDLE SYNC_BRIDGE_HANDLE; +typedef struct SYNC_PRIM_CONTEXT *PSYNC_PRIM_CONTEXT; +typedef struct _SYNC_OP_COOKIE_ *PSYNC_OP_COOKIE; + +typedef struct PVRSRV_CLIENT_SYNC_PRIM +{ + volatile IMG_UINT32 *pui32LinAddr; /*!< User pointer to the primitive */ +} PVRSRV_CLIENT_SYNC_PRIM; + +typedef IMG_HANDLE PVRSRV_CLIENT_SYNC_PRIM_HANDLE; + +typedef struct PVRSRV_CLIENT_SYNC_PRIM_OP +{ + IMG_UINT32 ui32Flags; /*!< Operation flags */ +#define PVRSRV_CLIENT_SYNC_PRIM_OP_CHECK (1 << 0) +#define PVRSRV_CLIENT_SYNC_PRIM_OP_UPDATE (1 << 1) +#define PVRSRV_CLIENT_SYNC_PRIM_OP_UNFENCED_UPDATE (PVRSRV_CLIENT_SYNC_PRIM_OP_UPDATE | (1<<2)) + PVRSRV_CLIENT_SYNC_PRIM *psSync; /*!< Pointer to the client sync */ + IMG_UINT32 ui32FenceValue; /*!< The Fence value (only used if PVRSRV_CLIENT_SYNC_PRIM_OP_CHECK is set) */ + IMG_UINT32 ui32UpdateValue; /*!< The Update value (only used if PVRSRV_CLIENT_SYNC_PRIM_OP_UPDATE is set) */ +} PVRSRV_CLIENT_SYNC_PRIM_OP; + +#if defined(__KERNEL__) && defined(ANDROID) && !defined(__GENKSYMS__) +#define __pvrsrv_defined_struct_enum__ +#include +#endif + +#endif /* _SYNC_EXTERNAL_ */ diff --git a/drivers/gpu/rogue_m/include/system/rgx_tc/apollo_regs.h b/drivers/gpu/rogue_m/include/system/rgx_tc/apollo_regs.h new file mode 100644 index 000000000000..66b0acda22e0 --- /dev/null +++ b/drivers/gpu/rogue_m/include/system/rgx_tc/apollo_regs.h @@ -0,0 +1,159 @@ +/*************************************************************************/ /*! +@File +@Title System Description Header +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description This header provides system-specific declarations and macros +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#if !defined(__APOLLO_REGS_H__) +#define __APOLLO_REGS_H__ + +/* + * The core clock speed is passed through a multiplier depending on the TC version. + * + * On TC_ES1: Multiplier = x3, final speed = 270MHz + * On TC_ES2: Multiplier = x6, final speed = 540MHz + * On TCF5: Multiplier = 1x final speed = 45MHz + * + * + * The base (unmultiplied speed) can be adjusted using a module parameter called "sys_core_clk_speed", + * a number in Hz. + * + * As an example: + * + * PVR_SRVKM_PARAMS="sys_core_clk_speed=60000000" /etc/init.d/rc.pvr start + * + * would result in a core speed of 60MHz xMultiplier. + * + * + * + * + * The memory clock is unmultiplied and can be adjusted using a module parameter called + * "sys_mem_clk_speed", this should be the number in Hz for the memory clock speed. + * + * As an example: + * + * PVR_SRVKM_PARAMS="sys_mem_clk_speed=100000000" /etc/init.d/rc.pvr start + * + * would attempt to start the driver with the memory clock speed set to 100MHz. + * + * + * Same applies to the system interface clock speed sys_sysif_clk_speed. + * Needed for TCF5 but not for TC_ES2/ES1. + * As an example: + * + * PVR_SRVKM_PARAMS="sys_mem_clk_speed=45000000" /etc/init.d/rc.pvr start + * + * would attempt to start the driver with the system clock speed set to 45MHz. + * + * + * All parameters can be specified at once, eg: + * PVR_SRVKM_PARAMS="sys_mem_clk_speed=MEMORY_SPEED sys_core_clk_speed=CORE_SPEED sys_mem_clk_speed=SYSIF_SPEED" /etc/init.d/rc.pvr start + */ + + /* TC TCF5 */ +#define RGX_TC_SYS_CLOCK_SPEED (45000000) /*< At the moment just used for TCF5 */ + +#if defined(TC_APOLLO_TCF5) + #define RGX_TC_CORE_CLOCK_SPEED (45000000) + #define RGX_TC_MEM_CLOCK_SPEED (45000000) + +#elif defined(TC_APOLLO_BONNIE) + /* TC Bonnie */ + #define RGX_TC_CORE_CLOCK_SPEED (18000000) + #define RGX_TC_MEM_CLOCK_SPEED (65000000) + +#elif defined(TC_APOLLO_ES2) + /* TC ES2 */ + #define RGX_TC_CORE_CLOCK_SPEED (90000000) + #define RGX_TC_MEM_CLOCK_SPEED (104000000) + #define TCF_TEMP_SENSOR_SPI_OFFSET 0xe + #define TCF_TEMP_SENSOR_TO_C(raw) (((raw) * 248 / 4096) - 54) + +#else + /* TC ES1 */ + #define RGX_TC_CORE_CLOCK_SPEED (90000000) + #define RGX_TC_MEM_CLOCK_SPEED (65000000) +#endif + +/* Number of bytes that are broken */ +#define SYS_DEV_MEM_BROKEN_BYTES (1024 * 1024) +#define SYS_DEV_MEM_REGION_SIZE (0x40000000 - SYS_DEV_MEM_BROKEN_BYTES) + +/* Apollo reg on base register 0 */ +#define SYS_APOLLO_REG_PCI_BASENUM (0) +#define SYS_APOLLO_REG_REGION_SIZE (0x00010000) + +#define SYS_APOLLO_REG_SYS_OFFSET (0x0000) +#define SYS_APOLLO_REG_SYS_SIZE (0x0400) + +#define SYS_APOLLO_REG_PLL_OFFSET (0x1000) +#define SYS_APOLLO_REG_PLL_SIZE (0x0400) + +#define SYS_APOLLO_REG_HOST_OFFSET (0x4050) +#define SYS_APOLLO_REG_HOST_SIZE (0x0014) + +#define SYS_APOLLO_REG_PDP_OFFSET (0xC000) +#define SYS_APOLLO_REG_PDP_SIZE (0x0400) + +/* Offsets for flashing Apollo PROMs from base 0 */ +#define APOLLO_FLASH_STAT_OFFSET (0x4058) +#define APOLLO_FLASH_DATA_WRITE_OFFSET (0x4050) +#define APOLLO_FLASH_RESET_OFFSET (0x4060) + +#define APOLLO_FLASH_FIFO_STATUS_MASK (0xF) +#define APOLLO_FLASH_FIFO_STATUS_SHIFT (0) +#define APOLLO_FLASH_PROGRAM_STATUS_MASK (0xF) +#define APOLLO_FLASH_PROGAM_STATUS_SHIFT (16) + +#define APOLLO_FLASH_PROG_COMPLETE_BIT (0x1) +#define APOLLO_FLASH_PROG_PROGRESS_BIT (0x2) +#define APOLLO_FLASH_PROG_FAILED_BIT (0x4) +#define APOLLO_FLASH_INV_FILETYPE_BIT (0x8) + +#define APOLLO_FLASH_FIFO_SIZE (8) + +/* RGX reg on base register 1 */ +#define SYS_RGX_REG_PCI_BASENUM (1) +#define SYS_RGX_REG_REGION_SIZE (0x00004000) + +/* Device memory (including HP mapping) on base register 2 */ +#define SYS_DEV_MEM_PCI_BASENUM (2) + +#endif /* if !defined(__APOLLO_REGS_H__) */ diff --git a/drivers/gpu/rogue_m/include/system/rgx_tc/pdp_regs.h b/drivers/gpu/rogue_m/include/system/rgx_tc/pdp_regs.h new file mode 100644 index 000000000000..bd26b0617f95 --- /dev/null +++ b/drivers/gpu/rogue_m/include/system/rgx_tc/pdp_regs.h @@ -0,0 +1,75 @@ +/*************************************************************************/ /*! +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#if !defined(__PDP_REGS_H__) +#define __PDP_REGS_H__ + +/*************************************************************************/ /*! + PCI Device Information +*/ /**************************************************************************/ + +#define DCPDP_VENDOR_ID_POWERVR (0x1010) + +#define DCPDP_DEVICE_ID_PCI_APOLLO_FPGA (0x1CF1) +#define DCPDP_DEVICE_ID_PCIE_APOLLO_FPGA (0x1CF2) + +/*************************************************************************/ /*! + PCI Device Base Address Information +*/ /**************************************************************************/ + +/* PLL and PDP registers on base address register 0 */ +#define DCPDP_REG_PCI_BASENUM (0) + +#define DCPDP_PCI_PLL_REG_OFFSET (0x1000) +#define DCPDP_PCI_PLL_REG_SIZE (0x0400) + +#define DCPDP_PCI_PDP_REG_OFFSET (0xC000) +#define DCPDP_PCI_PDP_REG_SIZE (0x2000) + +/*************************************************************************/ /*! + Misc register information +*/ /**************************************************************************/ + +/* This information isn't captured in tcf_rgbpdp_regs.h so define it here */ +#define DCPDP_STR1SURF_FORMAT_ARGB8888 (0xE) +#define DCPDP_STR1ADDRCTRL_BASE_ADDR_SHIFT (4) +#define DCPDP_STR1POSN_STRIDE_SHIFT (4) + +#endif /* !defined(__PDP_REGS_H__) */ diff --git a/drivers/gpu/rogue_m/include/system/rgx_tc/tcf_clk_ctrl.h b/drivers/gpu/rogue_m/include/system/rgx_tc/tcf_clk_ctrl.h new file mode 100644 index 000000000000..a42d23e995dc --- /dev/null +++ b/drivers/gpu/rogue_m/include/system/rgx_tc/tcf_clk_ctrl.h @@ -0,0 +1,808 @@ +/*************************************************************************/ /*! +@Title Test Chip Framework system control register definitions +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Autogenerated C -- do not edit + Generated from: tcf_clk_ctrl.def +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#if !defined(_TCF_CLK_CTRL_H_) +#define _TCF_CLK_CTRL_H_ + +/* + Register FPGA_ID_REG +*/ +#define TCF_CLK_CTRL_FPGA_ID_REG 0x0000 +#define FPGA_ID_REG_CORE_CFG_MASK 0x0000FFFFU +#define FPGA_ID_REG_CORE_CFG_SHIFT 0 +#define FPGA_ID_REG_CORE_CFG_SIGNED 0 + +#define FPGA_ID_REG_CORE_ID_MASK 0xFFFF0000U +#define FPGA_ID_REG_CORE_ID_SHIFT 16 +#define FPGA_ID_REG_CORE_ID_SIGNED 0 + +/* + Register FPGA_REV_REG +*/ +#define TCF_CLK_CTRL_FPGA_REV_REG 0x0008 +#define FPGA_REV_REG_MAINT_MASK 0x000000FFU +#define FPGA_REV_REG_MAINT_SHIFT 0 +#define FPGA_REV_REG_MAINT_SIGNED 0 + +#define FPGA_REV_REG_MINOR_MASK 0x0000FF00U +#define FPGA_REV_REG_MINOR_SHIFT 8 +#define FPGA_REV_REG_MINOR_SIGNED 0 + +#define FPGA_REV_REG_MAJOR_MASK 0x00FF0000U +#define FPGA_REV_REG_MAJOR_SHIFT 16 +#define FPGA_REV_REG_MAJOR_SIGNED 0 + +#define FPGA_REV_REG_DESIGNER_MASK 0xFF000000U +#define FPGA_REV_REG_DESIGNER_SHIFT 24 +#define FPGA_REV_REG_DESIGNER_SIGNED 0 + +/* + Register FPGA_DES_REV_1 +*/ +#define TCF_CLK_CTRL_FPGA_DES_REV_1 0x0010 +#define FPGA_DES_REV_1_MASK 0xFFFFFFFFU +#define FPGA_DES_REV_1_SHIFT 0 +#define FPGA_DES_REV_1_SIGNED 0 + +/* + Register FPGA_DES_REV_2 +*/ +#define TCF_CLK_CTRL_FPGA_DES_REV_2 0x0018 +#define FPGA_DES_REV_2_MASK 0xFFFFFFFFU +#define FPGA_DES_REV_2_SHIFT 0 +#define FPGA_DES_REV_2_SIGNED 0 + +/* + Register TCF_CORE_ID_REG +*/ +#define TCF_CLK_CTRL_TCF_CORE_ID_REG 0x0020 +#define TCF_CORE_ID_REG_CORE_CFG_MASK 0x0000FFFFU +#define TCF_CORE_ID_REG_CORE_CFG_SHIFT 0 +#define TCF_CORE_ID_REG_CORE_CFG_SIGNED 0 + +#define TCF_CORE_ID_REG_CORE_ID_MASK 0xFFFF0000U +#define TCF_CORE_ID_REG_CORE_ID_SHIFT 16 +#define TCF_CORE_ID_REG_CORE_ID_SIGNED 0 + +/* + Register TCF_CORE_REV_REG +*/ +#define TCF_CLK_CTRL_TCF_CORE_REV_REG 0x0028 +#define TCF_CORE_REV_REG_MAINT_MASK 0x000000FFU +#define TCF_CORE_REV_REG_MAINT_SHIFT 0 +#define TCF_CORE_REV_REG_MAINT_SIGNED 0 + +#define TCF_CORE_REV_REG_MINOR_MASK 0x0000FF00U +#define TCF_CORE_REV_REG_MINOR_SHIFT 8 +#define TCF_CORE_REV_REG_MINOR_SIGNED 0 + +#define TCF_CORE_REV_REG_MAJOR_MASK 0x00FF0000U +#define TCF_CORE_REV_REG_MAJOR_SHIFT 16 +#define TCF_CORE_REV_REG_MAJOR_SIGNED 0 + +#define TCF_CORE_REV_REG_DESIGNER_MASK 0xFF000000U +#define TCF_CORE_REV_REG_DESIGNER_SHIFT 24 +#define TCF_CORE_REV_REG_DESIGNER_SIGNED 0 + +/* + Register TCF_CORE_DES_REV_1 +*/ +#define TCF_CLK_CTRL_TCF_CORE_DES_REV_1 0x0030 +#define TCF_CORE_DES_REV_1_MASK 0xFFFFFFFFU +#define TCF_CORE_DES_REV_1_SHIFT 0 +#define TCF_CORE_DES_REV_1_SIGNED 0 + +/* + Register TCF_CORE_DES_REV_2 +*/ +#define TCF_CLK_CTRL_TCF_CORE_DES_REV_2 0x0038 +#define TCF_CORE_DES_REV_2_MASK 0xFFFFFFFFU +#define TCF_CORE_DES_REV_2_SHIFT 0 +#define TCF_CORE_DES_REV_2_SIGNED 0 + +/* + Register SCB_GENERAL_CONTROL +*/ +#define TCF_CLK_CTRL_SCB_GENERAL_CONTROL 0x0040 +#define SCB_GC_TRANS_HALT_MASK 0x00000200U +#define SCB_GC_TRANS_HALT_SHIFT 9 +#define SCB_GC_TRANS_HALT_SIGNED 0 + +#define SCB_GC_CKD_REGS_MASK 0x00000100U +#define SCB_GC_CKD_REGS_SHIFT 8 +#define SCB_GC_CKD_REGS_SIGNED 0 + +#define SCB_GC_CKD_SLAVE_MASK 0x00000080U +#define SCB_GC_CKD_SLAVE_SHIFT 7 +#define SCB_GC_CKD_SLAVE_SIGNED 0 + +#define SCB_GC_CKD_MASTER_MASK 0x00000040U +#define SCB_GC_CKD_MASTER_SHIFT 6 +#define SCB_GC_CKD_MASTER_SIGNED 0 + +#define SCB_GC_CKD_XDATA_MASK 0x00000020U +#define SCB_GC_CKD_XDATA_SHIFT 5 +#define SCB_GC_CKD_XDATA_SIGNED 0 + +#define SCB_GC_SFR_REG_MASK 0x00000010U +#define SCB_GC_SFR_REG_SHIFT 4 +#define SCB_GC_SFR_REG_SIGNED 0 + +#define SCB_GC_SFR_SLAVE_MASK 0x00000008U +#define SCB_GC_SFR_SLAVE_SHIFT 3 +#define SCB_GC_SFR_SLAVE_SIGNED 0 + +#define SCB_GC_SFR_MASTER_MASK 0x00000004U +#define SCB_GC_SFR_MASTER_SHIFT 2 +#define SCB_GC_SFR_MASTER_SIGNED 0 + +#define SCB_GC_SFR_DET_DATA_MASK 0x00000002U +#define SCB_GC_SFR_DET_DATA_SHIFT 1 +#define SCB_GC_SFR_DET_DATA_SIGNED 0 + +#define SCB_GC_SFR_GEN_DATA_MASK 0x00000001U +#define SCB_GC_SFR_GEN_DATA_SHIFT 0 +#define SCB_GC_SFR_GEN_DATA_SIGNED 0 + +/* + Register SCB_MASTER_READ_COUNT +*/ +#define TCF_CLK_CTRL_SCB_MASTER_READ_COUNT 0x0048 +#define MASTER_READ_COUNT_MASK 0x0000FFFFU +#define MASTER_READ_COUNT_SHIFT 0 +#define MASTER_READ_COUNT_SIGNED 0 + +/* + Register SCB_MASTER_READ_DATA +*/ +#define TCF_CLK_CTRL_SCB_MASTER_READ_DATA 0x0050 +#define MASTER_READ_DATA_MASK 0x000000FFU +#define MASTER_READ_DATA_SHIFT 0 +#define MASTER_READ_DATA_SIGNED 0 + +/* + Register SCB_MASTER_ADDRESS +*/ +#define TCF_CLK_CTRL_SCB_MASTER_ADDRESS 0x0058 +#define SCB_MASTER_ADDRESS_MASK 0x000003FFU +#define SCB_MASTER_ADDRESS_SHIFT 0 +#define SCB_MASTER_ADDRESS_SIGNED 0 + +/* + Register SCB_MASTER_WRITE_DATA +*/ +#define TCF_CLK_CTRL_SCB_MASTER_WRITE_DATA 0x0060 +#define MASTER_WRITE_DATA_MASK 0x000000FFU +#define MASTER_WRITE_DATA_SHIFT 0 +#define MASTER_WRITE_DATA_SIGNED 0 + +/* + Register SCB_MASTER_WRITE_COUNT +*/ +#define TCF_CLK_CTRL_SCB_MASTER_WRITE_COUNT 0x0068 +#define MASTER_WRITE_COUNT_MASK 0x0000FFFFU +#define MASTER_WRITE_COUNT_SHIFT 0 +#define MASTER_WRITE_COUNT_SIGNED 0 + +/* + Register SCB_BUS_SELECT +*/ +#define TCF_CLK_CTRL_SCB_BUS_SELECT 0x0070 +#define BUS_SELECT_MASK 0x00000003U +#define BUS_SELECT_SHIFT 0 +#define BUS_SELECT_SIGNED 0 + +/* + Register SCB_MASTER_FILL_STATUS +*/ +#define TCF_CLK_CTRL_SCB_MASTER_FILL_STATUS 0x0078 +#define MASTER_WRITE_FIFO_EMPTY_MASK 0x00000008U +#define MASTER_WRITE_FIFO_EMPTY_SHIFT 3 +#define MASTER_WRITE_FIFO_EMPTY_SIGNED 0 + +#define MASTER_WRITE_FIFO_FULL_MASK 0x00000004U +#define MASTER_WRITE_FIFO_FULL_SHIFT 2 +#define MASTER_WRITE_FIFO_FULL_SIGNED 0 + +#define MASTER_READ_FIFO_EMPTY_MASK 0x00000002U +#define MASTER_READ_FIFO_EMPTY_SHIFT 1 +#define MASTER_READ_FIFO_EMPTY_SIGNED 0 + +#define MASTER_READ_FIFO_FULL_MASK 0x00000001U +#define MASTER_READ_FIFO_FULL_SHIFT 0 +#define MASTER_READ_FIFO_FULL_SIGNED 0 + +/* + Register CLK_AND_RST_CTRL +*/ +#define TCF_CLK_CTRL_CLK_AND_RST_CTRL 0x0080 +#define GLB_CLKG_EN_MASK 0x00020000U +#define GLB_CLKG_EN_SHIFT 17 +#define GLB_CLKG_EN_SIGNED 0 + +#define CLK_GATE_CNTL_MASK 0x00010000U +#define CLK_GATE_CNTL_SHIFT 16 +#define CLK_GATE_CNTL_SIGNED 0 + +#define DUT_DCM_RESETN_MASK 0x00000400U +#define DUT_DCM_RESETN_SHIFT 10 +#define DUT_DCM_RESETN_SIGNED 0 + +#define MEM_RESYNC_BYPASS_MASK 0x00000200U +#define MEM_RESYNC_BYPASS_SHIFT 9 +#define MEM_RESYNC_BYPASS_SIGNED 0 + +#define SYS_RESYNC_BYPASS_MASK 0x00000100U +#define SYS_RESYNC_BYPASS_SHIFT 8 +#define SYS_RESYNC_BYPASS_SIGNED 0 + +#define SCB_RESETN_MASK 0x00000010U +#define SCB_RESETN_SHIFT 4 +#define SCB_RESETN_SIGNED 0 + +#define PDP2_RESETN_MASK 0x00000008U +#define PDP2_RESETN_SHIFT 3 +#define PDP2_RESETN_SIGNED 0 + +#define PDP1_RESETN_MASK 0x00000004U +#define PDP1_RESETN_SHIFT 2 +#define PDP1_RESETN_SIGNED 0 + +#define DDR_RESETN_MASK 0x00000002U +#define DDR_RESETN_SHIFT 1 +#define DDR_RESETN_SIGNED 0 + +#define DUT_RESETN_MASK 0x00000001U +#define DUT_RESETN_SHIFT 0 +#define DUT_RESETN_SIGNED 0 + +/* + Register TEST_REG_OUT +*/ +#define TCF_CLK_CTRL_TEST_REG_OUT 0x0088 +#define TEST_REG_OUT_MASK 0xFFFFFFFFU +#define TEST_REG_OUT_SHIFT 0 +#define TEST_REG_OUT_SIGNED 0 + +/* + Register TEST_REG_IN +*/ +#define TCF_CLK_CTRL_TEST_REG_IN 0x0090 +#define TEST_REG_IN_MASK 0xFFFFFFFFU +#define TEST_REG_IN_SHIFT 0 +#define TEST_REG_IN_SIGNED 0 + +/* + Register TEST_CTRL +*/ +#define TCF_CLK_CTRL_TEST_CTRL 0x0098 +#define PCI_TEST_OFFSET_MASK 0xF8000000U +#define PCI_TEST_OFFSET_SHIFT 27 +#define PCI_TEST_OFFSET_SIGNED 0 + +#define HOST_PHY_MODE_MASK 0x00000100U +#define HOST_PHY_MODE_SHIFT 8 +#define HOST_PHY_MODE_SIGNED 0 + +#define HOST_ONLY_MODE_MASK 0x00000080U +#define HOST_ONLY_MODE_SHIFT 7 +#define HOST_ONLY_MODE_SIGNED 0 + +#define PCI_TEST_MODE_MASK 0x00000040U +#define PCI_TEST_MODE_SHIFT 6 +#define PCI_TEST_MODE_SIGNED 0 + +#define TURN_OFF_DDR_MASK 0x00000020U +#define TURN_OFF_DDR_SHIFT 5 +#define TURN_OFF_DDR_SIGNED 0 + +#define SYS_RD_CLK_INV_MASK 0x00000010U +#define SYS_RD_CLK_INV_SHIFT 4 +#define SYS_RD_CLK_INV_SIGNED 0 + +#define MEM_REQ_CLK_INV_MASK 0x00000008U +#define MEM_REQ_CLK_INV_SHIFT 3 +#define MEM_REQ_CLK_INV_SIGNED 0 + +#define BURST_SPLIT_MASK 0x00000004U +#define BURST_SPLIT_SHIFT 2 +#define BURST_SPLIT_SIGNED 0 + +#define CLK_INVERSION_MASK 0x00000002U +#define CLK_INVERSION_SHIFT 1 +#define CLK_INVERSION_SIGNED 0 + +#define ADDRESS_FORCE_MASK 0x00000001U +#define ADDRESS_FORCE_SHIFT 0 +#define ADDRESS_FORCE_SIGNED 0 + +/* + Register CLEAR_HOST_MEM_SIG +*/ +#define TCF_CLK_CTRL_CLEAR_HOST_MEM_SIG 0x00A0 +#define SIGNATURE_TAG_ID_MASK 0x00000F00U +#define SIGNATURE_TAG_ID_SHIFT 8 +#define SIGNATURE_TAG_ID_SIGNED 0 + +#define CLEAR_HOST_MEM_SIGNATURE_MASK 0x00000001U +#define CLEAR_HOST_MEM_SIGNATURE_SHIFT 0 +#define CLEAR_HOST_MEM_SIGNATURE_SIGNED 0 + +/* + Register HOST_MEM_SIGNATURE +*/ +#define TCF_CLK_CTRL_HOST_MEM_SIGNATURE 0x00A8 +#define HOST_MEM_SIGNATURE_MASK 0xFFFFFFFFU +#define HOST_MEM_SIGNATURE_SHIFT 0 +#define HOST_MEM_SIGNATURE_SIGNED 0 + +/* + Register INTERRUPT_STATUS +*/ +#define TCF_CLK_CTRL_INTERRUPT_STATUS 0x00C8 +#define INTERRUPT_MASTER_STATUS_MASK 0x80000000U +#define INTERRUPT_MASTER_STATUS_SHIFT 31 +#define INTERRUPT_MASTER_STATUS_SIGNED 0 + +#define OTHER_INTS_MASK 0x7FFE0000U +#define OTHER_INTS_SHIFT 17 +#define OTHER_INTS_SIGNED 0 + +#define HOST_MST_NORESPONSE_MASK 0x00010000U +#define HOST_MST_NORESPONSE_SHIFT 16 +#define HOST_MST_NORESPONSE_SIGNED 0 + +#define PDP2_INT_MASK 0x00008000U +#define PDP2_INT_SHIFT 15 +#define PDP2_INT_SIGNED 0 + +#define PDP1_INT_MASK 0x00004000U +#define PDP1_INT_SHIFT 14 +#define PDP1_INT_SIGNED 0 + +#define EXT_INT_MASK 0x00002000U +#define EXT_INT_SHIFT 13 +#define EXT_INT_SIGNED 0 + +#define SCB_MST_HLT_BIT_MASK 0x00001000U +#define SCB_MST_HLT_BIT_SHIFT 12 +#define SCB_MST_HLT_BIT_SIGNED 0 + +#define SCB_SLV_EVENT_MASK 0x00000800U +#define SCB_SLV_EVENT_SHIFT 11 +#define SCB_SLV_EVENT_SIGNED 0 + +#define SCB_TDONE_RX_MASK 0x00000400U +#define SCB_TDONE_RX_SHIFT 10 +#define SCB_TDONE_RX_SIGNED 0 + +#define SCB_SLV_WT_RD_DAT_MASK 0x00000200U +#define SCB_SLV_WT_RD_DAT_SHIFT 9 +#define SCB_SLV_WT_RD_DAT_SIGNED 0 + +#define SCB_SLV_WT_PRV_RD_MASK 0x00000100U +#define SCB_SLV_WT_PRV_RD_SHIFT 8 +#define SCB_SLV_WT_PRV_RD_SIGNED 0 + +#define SCB_SLV_WT_WR_DAT_MASK 0x00000080U +#define SCB_SLV_WT_WR_DAT_SHIFT 7 +#define SCB_SLV_WT_WR_DAT_SIGNED 0 + +#define SCB_MST_WT_RD_DAT_MASK 0x00000040U +#define SCB_MST_WT_RD_DAT_SHIFT 6 +#define SCB_MST_WT_RD_DAT_SIGNED 0 + +#define SCB_ADD_ACK_ERR_MASK 0x00000020U +#define SCB_ADD_ACK_ERR_SHIFT 5 +#define SCB_ADD_ACK_ERR_SIGNED 0 + +#define SCB_WR_ACK_ERR_MASK 0x00000010U +#define SCB_WR_ACK_ERR_SHIFT 4 +#define SCB_WR_ACK_ERR_SIGNED 0 + +#define SCB_SDAT_LO_TIM_MASK 0x00000008U +#define SCB_SDAT_LO_TIM_SHIFT 3 +#define SCB_SDAT_LO_TIM_SIGNED 0 + +#define SCB_SCLK_LO_TIM_MASK 0x00000004U +#define SCB_SCLK_LO_TIM_SHIFT 2 +#define SCB_SCLK_LO_TIM_SIGNED 0 + +#define SCB_UNEX_START_BIT_MASK 0x00000002U +#define SCB_UNEX_START_BIT_SHIFT 1 +#define SCB_UNEX_START_BIT_SIGNED 0 + +#define SCB_BUS_INACTIVE_MASK 0x00000001U +#define SCB_BUS_INACTIVE_SHIFT 0 +#define SCB_BUS_INACTIVE_SIGNED 0 + +/* + Register INTERRUPT_OP_CFG +*/ +#define TCF_CLK_CTRL_INTERRUPT_OP_CFG 0x00D0 +#define PULSE_NLEVEL_MASK 0x80000000U +#define PULSE_NLEVEL_SHIFT 31 +#define PULSE_NLEVEL_SIGNED 0 + +#define INT_SENSE_MASK 0x40000000U +#define INT_SENSE_SHIFT 30 +#define INT_SENSE_SIGNED 0 + +#define INTERRUPT_DEST_MASK 0x0000000FU +#define INTERRUPT_DEST_SHIFT 0 +#define INTERRUPT_DEST_SIGNED 0 + +/* + Register INTERRUPT_ENABLE +*/ +#define TCF_CLK_CTRL_INTERRUPT_ENABLE 0x00D8 +#define INTERRUPT_MASTER_ENABLE_MASK 0x80000000U +#define INTERRUPT_MASTER_ENABLE_SHIFT 31 +#define INTERRUPT_MASTER_ENABLE_SIGNED 0 + +#define INTERRUPT_ENABLE_MASK 0x7FFFFFFFU +#define INTERRUPT_ENABLE_SHIFT 0 +#define INTERRUPT_ENABLE_SIGNED 0 + +/* + Register INTERRUPT_CLEAR +*/ +#define TCF_CLK_CTRL_INTERRUPT_CLEAR 0x00E0 +#define INTERRUPT_MASTER_CLEAR_MASK 0x80000000U +#define INTERRUPT_MASTER_CLEAR_SHIFT 31 +#define INTERRUPT_MASTER_CLEAR_SIGNED 0 + +#define INTERRUPT_CLEAR_MASK 0x7FFFFFFFU +#define INTERRUPT_CLEAR_SHIFT 0 +#define INTERRUPT_CLEAR_SIGNED 0 + +/* + Register YCC_RGB_CTRL +*/ +#define TCF_CLK_CTRL_YCC_RGB_CTRL 0x00E8 +#define RGB_CTRL1_MASK 0x000001FFU +#define RGB_CTRL1_SHIFT 0 +#define RGB_CTRL1_SIGNED 0 + +#define RGB_CTRL2_MASK 0x01FF0000U +#define RGB_CTRL2_SHIFT 16 +#define RGB_CTRL2_SIGNED 0 + +/* + Register EXP_BRD_CTRL +*/ +#define TCF_CLK_CTRL_EXP_BRD_CTRL 0x00F8 +#define PDP1_DATA_EN_MASK 0x00000003U +#define PDP1_DATA_EN_SHIFT 0 +#define PDP1_DATA_EN_SIGNED 0 + +#define PDP2_DATA_EN_MASK 0x00000030U +#define PDP2_DATA_EN_SHIFT 4 +#define PDP2_DATA_EN_SIGNED 0 + +#define EXP_BRD_OUTPUT_MASK 0xFFFFFF00U +#define EXP_BRD_OUTPUT_SHIFT 8 +#define EXP_BRD_OUTPUT_SIGNED 0 + +/* + Register HOSTIF_CONTROL +*/ +#define TCF_CLK_CTRL_HOSTIF_CONTROL 0x0100 +#define HOSTIF_CTRL_MASK 0x000000FFU +#define HOSTIF_CTRL_SHIFT 0 +#define HOSTIF_CTRL_SIGNED 0 + +/* + Register DUT_CONTROL_1 +*/ +#define TCF_CLK_CTRL_DUT_CONTROL_1 0x0108 +#define DUT_CTRL_1_MASK 0xFFFFFFFFU +#define DUT_CTRL_1_SHIFT 0 +#define DUT_CTRL_1_SIGNED 0 + +/* TC ES2 additional needs those: */ +#define DUT_CTRL_TEST_MODE_SHIFT 0 +#define DUT_CTRL_TEST_MODE_MASK 0x3 + +#define DUT_CTRL_VCC_0V9EN (1<<12) +#define DUT_CTRL_VCC_1V8EN (1<<13) +#define DUT_CTRL_VCC_IO_INH (1<<14) +#define DUT_CTRL_VCC_CORE_INH (1<<15) + +/* + Register DUT_STATUS_1 +*/ +#define TCF_CLK_CTRL_DUT_STATUS_1 0x0110 +#define DUT_STATUS_1_MASK 0xFFFFFFFFU +#define DUT_STATUS_1_SHIFT 0 +#define DUT_STATUS_1_SIGNED 0 + +/* + Register DUT_CTRL_NOT_STAT_1 +*/ +#define TCF_CLK_CTRL_DUT_CTRL_NOT_STAT_1 0x0118 +#define DUT_STAT_NOT_CTRL_1_MASK 0xFFFFFFFFU +#define DUT_STAT_NOT_CTRL_1_SHIFT 0 +#define DUT_STAT_NOT_CTRL_1_SIGNED 0 + +/* + Register DUT_CONTROL_2 +*/ +#define TCF_CLK_CTRL_DUT_CONTROL_2 0x0120 +#define DUT_CTRL_2_MASK 0xFFFFFFFFU +#define DUT_CTRL_2_SHIFT 0 +#define DUT_CTRL_2_SIGNED 0 + +/* + Register DUT_STATUS_2 +*/ +#define TCF_CLK_CTRL_DUT_STATUS_2 0x0128 +#define DUT_STATUS_2_MASK 0xFFFFFFFFU +#define DUT_STATUS_2_SHIFT 0 +#define DUT_STATUS_2_SIGNED 0 + +/* + Register DUT_CTRL_NOT_STAT_2 +*/ +#define TCF_CLK_CTRL_DUT_CTRL_NOT_STAT_2 0x0130 +#define DUT_CTRL_NOT_STAT_2_MASK 0xFFFFFFFFU +#define DUT_CTRL_NOT_STAT_2_SHIFT 0 +#define DUT_CTRL_NOT_STAT_2_SIGNED 0 + +/* + Register BUS_CAP_BASE_ADDR +*/ +#define TCF_CLK_CTRL_BUS_CAP_BASE_ADDR 0x0138 +#define BUS_CAP_BASE_ADDR_MASK 0xFFFFFFFFU +#define BUS_CAP_BASE_ADDR_SHIFT 0 +#define BUS_CAP_BASE_ADDR_SIGNED 0 + +/* + Register BUS_CAP_ENABLE +*/ +#define TCF_CLK_CTRL_BUS_CAP_ENABLE 0x0140 +#define BUS_CAP_ENABLE_MASK 0x00000001U +#define BUS_CAP_ENABLE_SHIFT 0 +#define BUS_CAP_ENABLE_SIGNED 0 + +/* + Register BUS_CAP_COUNT +*/ +#define TCF_CLK_CTRL_BUS_CAP_COUNT 0x0148 +#define BUS_CAP_COUNT_MASK 0xFFFFFFFFU +#define BUS_CAP_COUNT_SHIFT 0 +#define BUS_CAP_COUNT_SIGNED 0 + +/* + Register DCM_LOCK_STATUS +*/ +#define TCF_CLK_CTRL_DCM_LOCK_STATUS 0x0150 +#define DCM_LOCK_STATUS_MASK 0x00000007U +#define DCM_LOCK_STATUS_SHIFT 0 +#define DCM_LOCK_STATUS_SIGNED 0 + +/* + Register AUX_DUT_RESETNS +*/ +#define TCF_CLK_CTRL_AUX_DUT_RESETNS 0x0158 +#define AUX_DUT_RESETNS_MASK 0x0000000FU +#define AUX_DUT_RESETNS_SHIFT 0 +#define AUX_DUT_RESETNS_SIGNED 0 + +/* + Register TCF_SPI_MST_ADDR_RDNWR +*/ +#define TCF_CLK_CTRL_TCF_SPI_MST_ADDR_RDNWR 0x0160 +#define TCF_SPI_MST_ADDR_MASK 0x00000FFFU +#define TCF_SPI_MST_ADDR_SHIFT 0 +#define TCF_SPI_MST_ADDR_SIGNED 0 + +#define TCF_SPI_MST_RDNWR_MASK 0x00001000U +#define TCF_SPI_MST_RDNWR_SHIFT 12 +#define TCF_SPI_MST_RDNWR_SIGNED 0 + +#define TCF_SPI_MST_SLAVE_ID_MASK 0x00010000U +#define TCF_SPI_MST_SLAVE_ID_SHIFT 16 +#define TCF_SPI_MST_SLAVE_ID_SIGNED 0 + +/* + Register TCF_SPI_MST_WDATA +*/ +#define TCF_CLK_CTRL_TCF_SPI_MST_WDATA 0x0168 +#define TCF_SPI_MST_WDATA_MASK 0xFFFFFFFFU +#define TCF_SPI_MST_WDATA_SHIFT 0 +#define TCF_SPI_MST_WDATA_SIGNED 0 + +/* + Register TCF_SPI_MST_RDATA +*/ +#define TCF_CLK_CTRL_TCF_SPI_MST_RDATA 0x0170 +#define TCF_SPI_MST_RDATA_MASK 0xFFFFFFFFU +#define TCF_SPI_MST_RDATA_SHIFT 0 +#define TCF_SPI_MST_RDATA_SIGNED 0 + +/* + Register TCF_SPI_MST_STATUS +*/ +#define TCF_CLK_CTRL_TCF_SPI_MST_STATUS 0x0178 +#define TCF_SPI_MST_STATUS_MASK 0x0000000FU +#define TCF_SPI_MST_STATUS_SHIFT 0 +#define TCF_SPI_MST_STATUS_SIGNED 0 + +/* + Register TCF_SPI_MST_GO +*/ +#define TCF_CLK_CTRL_TCF_SPI_MST_GO 0x0180 +#define TCF_SPI_MST_GO_MASK 0x00000001U +#define TCF_SPI_MST_GO_SHIFT 0 +#define TCF_SPI_MST_GO_SIGNED 0 + +/* + Register EXT_SIG_CTRL +*/ +#define TCF_CLK_CTRL_EXT_SIG_CTRL 0x0188 +#define EXT_SYS_REQ_SIG_START_MASK 0x00000001U +#define EXT_SYS_REQ_SIG_START_SHIFT 0 +#define EXT_SYS_REQ_SIG_START_SIGNED 0 + +#define EXT_SYS_RD_SIG_START_MASK 0x00000002U +#define EXT_SYS_RD_SIG_START_SHIFT 1 +#define EXT_SYS_RD_SIG_START_SIGNED 0 + +#define EXT_MEM_REQ_SIG_START_MASK 0x00000004U +#define EXT_MEM_REQ_SIG_START_SHIFT 2 +#define EXT_MEM_REQ_SIG_START_SIGNED 0 + +#define EXT_MEM_RD_SIG_START_MASK 0x00000008U +#define EXT_MEM_RD_SIG_START_SHIFT 3 +#define EXT_MEM_RD_SIG_START_SIGNED 0 + +/* + Register EXT_SYS_REQ_SIG +*/ +#define TCF_CLK_CTRL_EXT_SYS_REQ_SIG 0x0190 +#define EXT_SYS_REQ_SIG_MASK 0xFFFFFFFFU +#define EXT_SYS_REQ_SIG_SHIFT 0 +#define EXT_SYS_REQ_SIG_SIGNED 0 + +/* + Register EXT_SYS_RD_SIG +*/ +#define TCF_CLK_CTRL_EXT_SYS_RD_SIG 0x0198 +#define EXT_SYS_RD_SIG_MASK 0xFFFFFFFFU +#define EXT_SYS_RD_SIG_SHIFT 0 +#define EXT_SYS_RD_SIG_SIGNED 0 + +/* + Register EXT_MEM_REQ_SIG +*/ +#define TCF_CLK_CTRL_EXT_MEM_REQ_SIG 0x01A0 +#define EXT_MEM_REQ_SIG_MASK 0xFFFFFFFFU +#define EXT_MEM_REQ_SIG_SHIFT 0 +#define EXT_MEM_REQ_SIG_SIGNED 0 + +/* + Register EXT_MEM_RD_SIG +*/ +#define TCF_CLK_CTRL_EXT_MEM_RD_SIG 0x01A8 +#define EXT_MEM_RD_SIG_MASK 0xFFFFFFFFU +#define EXT_MEM_RD_SIG_SHIFT 0 +#define EXT_MEM_RD_SIG_SIGNED 0 + +/* + Register EXT_SYS_REQ_WR_CNT +*/ +#define TCF_CLK_CTRL_EXT_SYS_REQ_WR_CNT 0x01B0 +#define EXT_SYS_REQ_WR_CNT_MASK 0xFFFFFFFFU +#define EXT_SYS_REQ_WR_CNT_SHIFT 0 +#define EXT_SYS_REQ_WR_CNT_SIGNED 0 + +/* + Register EXT_SYS_REQ_RD_CNT +*/ +#define TCF_CLK_CTRL_EXT_SYS_REQ_RD_CNT 0x01B8 +#define EXT_SYS_REQ_RD_CNT_MASK 0xFFFFFFFFU +#define EXT_SYS_REQ_RD_CNT_SHIFT 0 +#define EXT_SYS_REQ_RD_CNT_SIGNED 0 + +/* + Register EXT_SYS_RD_CNT +*/ +#define TCF_CLK_CTRL_EXT_SYS_RD_CNT 0x01C0 +#define EXT_SYS_RD_CNT_MASK 0xFFFFFFFFU +#define EXT_SYS_RD_CNT_SHIFT 0 +#define EXT_SYS_RD_CNT_SIGNED 0 + +/* + Register EXT_MEM_REQ_WR_CNT +*/ +#define TCF_CLK_CTRL_EXT_MEM_REQ_WR_CNT 0x01C8 +#define EXT_MEM_REQ_WR_CNT_MASK 0xFFFFFFFFU +#define EXT_MEM_REQ_WR_CNT_SHIFT 0 +#define EXT_MEM_REQ_WR_CNT_SIGNED 0 + +/* + Register EXT_MEM_REQ_RD_CNT +*/ +#define TCF_CLK_CTRL_EXT_MEM_REQ_RD_CNT 0x01D0 +#define EXT_MEM_REQ_RD_CNT_MASK 0xFFFFFFFFU +#define EXT_MEM_REQ_RD_CNT_SHIFT 0 +#define EXT_MEM_REQ_RD_CNT_SIGNED 0 + +/* + Register EXT_MEM_RD_CNT +*/ +#define TCF_CLK_CTRL_EXT_MEM_RD_CNT 0x01D8 +#define EXT_MEM_RD_CNT_MASK 0xFFFFFFFFU +#define EXT_MEM_RD_CNT_SHIFT 0 +#define EXT_MEM_RD_CNT_SIGNED 0 + +/* + Register TCF_CORE_TARGET_BUILD_CFG +*/ +#define TCF_CLK_CTRL_TCF_CORE_TARGET_BUILD_CFG 0x01E0 +#define TCF_CORE_TARGET_BUILD_ID_MASK 0x000000FFU +#define TCF_CORE_TARGET_BUILD_ID_SHIFT 0 +#define TCF_CORE_TARGET_BUILD_ID_SIGNED 0 + +/* + Register MEM_THROUGH_SYS +*/ +#define TCF_CLK_CTRL_MEM_THROUGH_SYS 0x01E8 +#define MEM_THROUGH_SYS_MASK 0x00000001U +#define MEM_THROUGH_SYS_SHIFT 0 +#define MEM_THROUGH_SYS_SIGNED 0 + +/* + Register HOST_PHY_OFFSET +*/ +#define TCF_CLK_CTRL_HOST_PHY_OFFSET 0x01F0 +#define HOST_PHY_OFFSET_MASK 0xFFFFFFFFU +#define HOST_PHY_OFFSET_SHIFT 0 +#define HOST_PHY_OFFSET_SIGNED 0 + +#endif /* !defined(_TCF_CLK_CTRL_H_) */ + +/***************************************************************************** + End of file (tcf_clk_ctrl.h) +*****************************************************************************/ diff --git a/drivers/gpu/rogue_m/include/system/rgx_tc/tcf_pll.h b/drivers/gpu/rogue_m/include/system/rgx_tc/tcf_pll.h new file mode 100644 index 000000000000..fa0f823b7be2 --- /dev/null +++ b/drivers/gpu/rogue_m/include/system/rgx_tc/tcf_pll.h @@ -0,0 +1,311 @@ +/*************************************************************************/ /*! +@Title Test Chip Framework PDP register definitions +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Autogenerated C -- do not edit + Generated from tcf_pll.def +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#if !defined(_TCF_PLL_H_) +#define _TCF_PLL_H_ + +/* + Register PLL_DDR2_CLK0 +*/ +#define TCF_PLL_PLL_DDR2_CLK0 0x0000 +#define DDR2_PLL_CLK0_PHS_MASK 0x00300000U +#define DDR2_PLL_CLK0_PHS_SHIFT 20 +#define DDR2_PLL_CLK0_PHS_SIGNED 0 + +#define DDR2_PLL_CLK0_MS_MASK 0x00030000U +#define DDR2_PLL_CLK0_MS_SHIFT 16 +#define DDR2_PLL_CLK0_MS_SIGNED 0 + +#define DDR2_PLL_CLK0_FREQ_MASK 0x000001FFU +#define DDR2_PLL_CLK0_FREQ_SHIFT 0 +#define DDR2_PLL_CLK0_FREQ_SIGNED 0 + +/* + Register PLL_DDR2_CLK1TO5 +*/ +#define TCF_PLL_PLL_DDR2_CLK1TO5 0x0008 +#define DDR2_PLL_CLK1TO5_PHS_MASK 0x3FF00000U +#define DDR2_PLL_CLK1TO5_PHS_SHIFT 20 +#define DDR2_PLL_CLK1TO5_PHS_SIGNED 0 + +#define DDR2_PLL_CLK1TO5_MS_MASK 0x000FFC00U +#define DDR2_PLL_CLK1TO5_MS_SHIFT 10 +#define DDR2_PLL_CLK1TO5_MS_SIGNED 0 + +#define DDR2_PLL_CLK1TO5_FREQ_MASK 0x000003FFU +#define DDR2_PLL_CLK1TO5_FREQ_SHIFT 0 +#define DDR2_PLL_CLK1TO5_FREQ_SIGNED 0 + +/* + Register PLL_DDR2_DRP_GO +*/ +#define TCF_PLL_PLL_DDR2_DRP_GO 0x0010 +#define PLL_DDR2_DRP_GO_MASK 0x00000001U +#define PLL_DDR2_DRP_GO_SHIFT 0 +#define PLL_DDR2_DRP_GO_SIGNED 0 + +/* + Register PLL_PDP_CLK0 +*/ +#define TCF_PLL_PLL_PDP_CLK0 0x0018 +#define PDP_PLL_CLK0_PHS_MASK 0x00300000U +#define PDP_PLL_CLK0_PHS_SHIFT 20 +#define PDP_PLL_CLK0_PHS_SIGNED 0 + +#define PDP_PLL_CLK0_MS_MASK 0x00030000U +#define PDP_PLL_CLK0_MS_SHIFT 16 +#define PDP_PLL_CLK0_MS_SIGNED 0 + +#define PDP_PLL_CLK0_FREQ_MASK 0x000001FFU +#define PDP_PLL_CLK0_FREQ_SHIFT 0 +#define PDP_PLL_CLK0_FREQ_SIGNED 0 + +/* + Register PLL_PDP_CLK1TO5 +*/ +#define TCF_PLL_PLL_PDP_CLK1TO5 0x0020 +#define PDP_PLL_CLK1TO5_PHS_MASK 0x3FF00000U +#define PDP_PLL_CLK1TO5_PHS_SHIFT 20 +#define PDP_PLL_CLK1TO5_PHS_SIGNED 0 + +#define PDP_PLL_CLK1TO5_MS_MASK 0x000FFC00U +#define PDP_PLL_CLK1TO5_MS_SHIFT 10 +#define PDP_PLL_CLK1TO5_MS_SIGNED 0 + +#define PDP_PLL_CLK1TO5_FREQ_MASK 0x000003FFU +#define PDP_PLL_CLK1TO5_FREQ_SHIFT 0 +#define PDP_PLL_CLK1TO5_FREQ_SIGNED 0 + +/* + Register PLL_PDP_DRP_GO +*/ +#define TCF_PLL_PLL_PDP_DRP_GO 0x0028 +#define PLL_PDP_DRP_GO_MASK 0x00000001U +#define PLL_PDP_DRP_GO_SHIFT 0 +#define PLL_PDP_DRP_GO_SIGNED 0 + +/* + Register PLL_PDP2_CLK0 +*/ +#define TCF_PLL_PLL_PDP2_CLK0 0x0030 +#define PDP2_PLL_CLK0_PHS_MASK 0x00300000U +#define PDP2_PLL_CLK0_PHS_SHIFT 20 +#define PDP2_PLL_CLK0_PHS_SIGNED 0 + +#define PDP2_PLL_CLK0_MS_MASK 0x00030000U +#define PDP2_PLL_CLK0_MS_SHIFT 16 +#define PDP2_PLL_CLK0_MS_SIGNED 0 + +#define PDP2_PLL_CLK0_FREQ_MASK 0x000001FFU +#define PDP2_PLL_CLK0_FREQ_SHIFT 0 +#define PDP2_PLL_CLK0_FREQ_SIGNED 0 + +/* + Register PLL_PDP2_CLK1TO5 +*/ +#define TCF_PLL_PLL_PDP2_CLK1TO5 0x0038 +#define PDP2_PLL_CLK1TO5_PHS_MASK 0x3FF00000U +#define PDP2_PLL_CLK1TO5_PHS_SHIFT 20 +#define PDP2_PLL_CLK1TO5_PHS_SIGNED 0 + +#define PDP2_PLL_CLK1TO5_MS_MASK 0x000FFC00U +#define PDP2_PLL_CLK1TO5_MS_SHIFT 10 +#define PDP2_PLL_CLK1TO5_MS_SIGNED 0 + +#define PDP2_PLL_CLK1TO5_FREQ_MASK 0x000003FFU +#define PDP2_PLL_CLK1TO5_FREQ_SHIFT 0 +#define PDP2_PLL_CLK1TO5_FREQ_SIGNED 0 + +/* + Register PLL_PDP2_DRP_GO +*/ +#define TCF_PLL_PLL_PDP2_DRP_GO 0x0040 +#define PLL_PDP2_DRP_GO_MASK 0x00000001U +#define PLL_PDP2_DRP_GO_SHIFT 0 +#define PLL_PDP2_DRP_GO_SIGNED 0 + +/* + Register PLL_CORE_CLK0 +*/ +#define TCF_PLL_PLL_CORE_CLK0 0x0048 +#define CORE_PLL_CLK0_PHS_MASK 0x00300000U +#define CORE_PLL_CLK0_PHS_SHIFT 20 +#define CORE_PLL_CLK0_PHS_SIGNED 0 + +#define CORE_PLL_CLK0_MS_MASK 0x00030000U +#define CORE_PLL_CLK0_MS_SHIFT 16 +#define CORE_PLL_CLK0_MS_SIGNED 0 + +#define CORE_PLL_CLK0_FREQ_MASK 0x000001FFU +#define CORE_PLL_CLK0_FREQ_SHIFT 0 +#define CORE_PLL_CLK0_FREQ_SIGNED 0 + +/* + Register PLL_CORE_CLK1TO5 +*/ +#define TCF_PLL_PLL_CORE_CLK1TO5 0x0050 +#define CORE_PLL_CLK1TO5_PHS_MASK 0x3FF00000U +#define CORE_PLL_CLK1TO5_PHS_SHIFT 20 +#define CORE_PLL_CLK1TO5_PHS_SIGNED 0 + +#define CORE_PLL_CLK1TO5_MS_MASK 0x000FFC00U +#define CORE_PLL_CLK1TO5_MS_SHIFT 10 +#define CORE_PLL_CLK1TO5_MS_SIGNED 0 + +#define CORE_PLL_CLK1TO5_FREQ_MASK 0x000003FFU +#define CORE_PLL_CLK1TO5_FREQ_SHIFT 0 +#define CORE_PLL_CLK1TO5_FREQ_SIGNED 0 + +/* + Register PLL_CORE_DRP_GO +*/ +#define TCF_PLL_PLL_CORE_DRP_GO 0x0058 +#define PLL_CORE_DRP_GO_MASK 0x00000001U +#define PLL_CORE_DRP_GO_SHIFT 0 +#define PLL_CORE_DRP_GO_SIGNED 0 + +/* + Register PLL_SYSIF_CLK0 +*/ +#define TCF_PLL_PLL_SYSIF_CLK0 0x0060 +#define SYSIF_PLL_CLK0_PHS_MASK 0x00300000U +#define SYSIF_PLL_CLK0_PHS_SHIFT 20 +#define SYSIF_PLL_CLK0_PHS_SIGNED 0 + +#define SYSIF_PLL_CLK0_MS_MASK 0x00030000U +#define SYSIF_PLL_CLK0_MS_SHIFT 16 +#define SYSIF_PLL_CLK0_MS_SIGNED 0 + +#define SYSIF_PLL_CLK0_FREQ_MASK 0x000001FFU +#define SYSIF_PLL_CLK0_FREQ_SHIFT 0 +#define SYSIF_PLL_CLK0_FREQ_SIGNED 0 + +/* + Register PLL_SYSIF_CLK1TO5 +*/ +#define TCF_PLL_PLL_SYSIF_CLK1TO5 0x0068 +#define SYSIF_PLL_CLK1TO5_PHS_MASK 0x3FF00000U +#define SYSIF_PLL_CLK1TO5_PHS_SHIFT 20 +#define SYSIF_PLL_CLK1TO5_PHS_SIGNED 0 + +#define SYSIF_PLL_CLK1TO5_MS_MASK 0x000FFC00U +#define SYSIF_PLL_CLK1TO5_MS_SHIFT 10 +#define SYSIF_PLL_CLK1TO5_MS_SIGNED 0 + +#define SYSIF_PLL_CLK1TO5_FREQ_MASK 0x000003FFU +#define SYSIF_PLL_CLK1TO5_FREQ_SHIFT 0 +#define SYSIF_PLL_CLK1TO5_FREQ_SIGNED 0 + +/* + Register PLL_SYS_DRP_GO +*/ +#define TCF_PLL_PLL_SYS_DRP_GO 0x0070 +#define PLL_SYS_DRP_GO_MASK 0x00000001U +#define PLL_SYS_DRP_GO_SHIFT 0 +#define PLL_SYS_DRP_GO_SIGNED 0 + +/* + Register PLL_MEMIF_CLK0 +*/ +#define TCF_PLL_PLL_MEMIF_CLK0 0x0078 +#define MEMIF_PLL_CLK0_PHS_MASK 0x00300000U +#define MEMIF_PLL_CLK0_PHS_SHIFT 20 +#define MEMIF_PLL_CLK0_PHS_SIGNED 0 + +#define MEMIF_PLL_CLK0_MS_MASK 0x00030000U +#define MEMIF_PLL_CLK0_MS_SHIFT 16 +#define MEMIF_PLL_CLK0_MS_SIGNED 0 + +#define MEMIF_PLL_CLK0_FREQ_MASK 0x000001FFU +#define MEMIF_PLL_CLK0_FREQ_SHIFT 0 +#define MEMIF_PLL_CLK0_FREQ_SIGNED 0 + +/* + Register PLL_MEMIF_CLK1TO5 +*/ +#define TCF_PLL_PLL_MEMIF_CLK1TO5 0x0080 +#define MEMIF_PLL_CLK1TO5_PHS_MASK 0x3FF00000U +#define MEMIF_PLL_CLK1TO5_PHS_SHIFT 20 +#define MEMIF_PLL_CLK1TO5_PHS_SIGNED 0 + +#define MEMIF_PLL_CLK1TO5_MS_MASK 0x000FFC00U +#define MEMIF_PLL_CLK1TO5_MS_SHIFT 10 +#define MEMIF_PLL_CLK1TO5_MS_SIGNED 0 + +#define MEMIF_PLL_CLK1TO5_FREQ_MASK 0x000003FFU +#define MEMIF_PLL_CLK1TO5_FREQ_SHIFT 0 +#define MEMIF_PLL_CLK1TO5_FREQ_SIGNED 0 + +/* + Register PLL_MEM_DRP_GO +*/ +#define TCF_PLL_PLL_MEM_DRP_GO 0x0088 +#define PLL_MEM_DRP_GO_MASK 0x00000001U +#define PLL_MEM_DRP_GO_SHIFT 0 +#define PLL_MEM_DRP_GO_SIGNED 0 + +/* + Register PLL_ALL_DRP_GO +*/ +#define TCF_PLL_PLL_ALL_DRP_GO 0x0090 +#define PLL_ALL_DRP_GO_MASK 0x00000001U +#define PLL_ALL_DRP_GO_SHIFT 0 +#define PLL_ALL_DRP_GO_SIGNED 0 + +/* + Register PLL_DRP_STATUS +*/ +#define TCF_PLL_PLL_DRP_STATUS 0x0098 +#define PLL_LOCKS_MASK 0x00003F00U +#define PLL_LOCKS_SHIFT 8 +#define PLL_LOCKS_SIGNED 0 + +#define PLL_DRP_GOOD_MASK 0x0000003FU +#define PLL_DRP_GOOD_SHIFT 0 +#define PLL_DRP_GOOD_SIGNED 0 + +#endif /* !defined(_TCF_PLL_H_) */ + +/***************************************************************************** + End of file (tcf_pll.h) +*****************************************************************************/ diff --git a/drivers/gpu/rogue_m/include/system/rgx_tc/tcf_rgbpdp_regs.h b/drivers/gpu/rogue_m/include/system/rgx_tc/tcf_rgbpdp_regs.h new file mode 100644 index 000000000000..f3e6d54613d1 --- /dev/null +++ b/drivers/gpu/rogue_m/include/system/rgx_tc/tcf_rgbpdp_regs.h @@ -0,0 +1,559 @@ +/*************************************************************************/ /*! +@Title Test Chip Framework PDP register definitions +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Autogenerated C -- do not edit + Generated from: tcf_rgbpdp_regs.def +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ + +#if !defined(_TCF_RGBPDP_REGS_H_) +#define _TCF_RGBPDP_REGS_H_ + +/* + Register PVR_TCF_RGBPDP_STR1SURF +*/ +#define TCF_RGBPDP_PVR_TCF_RGBPDP_STR1SURF 0x0000 +#define STR1HEIGHT_MASK 0x000007FFU +#define STR1HEIGHT_SHIFT 0 +#define STR1HEIGHT_SIGNED 0 + +#define STR1WIDTH_MASK 0x003FF800U +#define STR1WIDTH_SHIFT 11 +#define STR1WIDTH_SIGNED 0 + +#define STR1PIXFMT_MASK 0x0F000000U +#define STR1PIXFMT_SHIFT 24 +#define STR1PIXFMT_SIGNED 0 + +/* + Register PVR_TCF_RGBPDP_STR1ADDRCTRL +*/ +#define TCF_RGBPDP_PVR_TCF_RGBPDP_STR1ADDRCTRL 0x0004 +#define STR1BASE_MASK 0x03FFFFFFU +#define STR1BASE_SHIFT 0 +#define STR1BASE_SIGNED 0 + +#define STR1INTFIELD_MASK 0x40000000U +#define STR1INTFIELD_SHIFT 30 +#define STR1INTFIELD_SIGNED 0 + +#define STR1STREN_MASK 0x80000000U +#define STR1STREN_SHIFT 31 +#define STR1STREN_SIGNED 0 + +/* + Register PVR_PDP_STR1POSN +*/ +#define TCF_RGBPDP_PVR_PDP_STR1POSN 0x0008 +#define STR1STRIDE_MASK 0x000003FFU +#define STR1STRIDE_SHIFT 0 +#define STR1STRIDE_SIGNED 0 + +/* + Register PVR_TCF_RGBPDP_MEMCTRL +*/ +#define TCF_RGBPDP_PVR_TCF_RGBPDP_MEMCTRL 0x000C +#define MEMREFRESH_MASK 0xC0000000U +#define MEMREFRESH_SHIFT 30 +#define MEMREFRESH_SIGNED 0 + +/* + Register PVR_TCF_RGBPDP_STRCTRL +*/ +#define TCF_RGBPDP_PVR_TCF_RGBPDP_STRCTRL 0x0010 +#define BURSTLEN_GFX_MASK 0x000000FFU +#define BURSTLEN_GFX_SHIFT 0 +#define BURSTLEN_GFX_SIGNED 0 + +#define THRESHOLD_GFX_MASK 0x0000FF00U +#define THRESHOLD_GFX_SHIFT 8 +#define THRESHOLD_GFX_SIGNED 0 + +/* + Register PVR_TCF_RGBPDP_SYNCCTRL +*/ +#define TCF_RGBPDP_PVR_TCF_RGBPDP_SYNCCTRL 0x0014 +#define HSDIS_MASK 0x00000001U +#define HSDIS_SHIFT 0 +#define HSDIS_SIGNED 0 + +#define HSPOL_MASK 0x00000002U +#define HSPOL_SHIFT 1 +#define HSPOL_SIGNED 0 + +#define VSDIS_MASK 0x00000004U +#define VSDIS_SHIFT 2 +#define VSDIS_SIGNED 0 + +#define VSPOL_MASK 0x00000008U +#define VSPOL_SHIFT 3 +#define VSPOL_SIGNED 0 + +#define BLNKDIS_MASK 0x00000010U +#define BLNKDIS_SHIFT 4 +#define BLNKDIS_SIGNED 0 + +#define BLNKPOL_MASK 0x00000020U +#define BLNKPOL_SHIFT 5 +#define BLNKPOL_SIGNED 0 + +#define HS_SLAVE_MASK 0x00000040U +#define HS_SLAVE_SHIFT 6 +#define HS_SLAVE_SIGNED 0 + +#define VS_SLAVE_MASK 0x00000080U +#define VS_SLAVE_SHIFT 7 +#define VS_SLAVE_SIGNED 0 + +#define INTERLACE_MASK 0x00000100U +#define INTERLACE_SHIFT 8 +#define INTERLACE_SIGNED 0 + +#define FIELDPOL_MASK 0x00000200U +#define FIELDPOL_SHIFT 9 +#define FIELDPOL_SIGNED 0 + +#define CLKPOL_MASK 0x00000800U +#define CLKPOL_SHIFT 11 +#define CLKPOL_SIGNED 0 + +#define CSYNC_EN_MASK 0x00001000U +#define CSYNC_EN_SHIFT 12 +#define CSYNC_EN_SIGNED 0 + +#define FIELD_EN_MASK 0x00002000U +#define FIELD_EN_SHIFT 13 +#define FIELD_EN_SIGNED 0 + +#define UPDWAIT_MASK 0x000F0000U +#define UPDWAIT_SHIFT 16 +#define UPDWAIT_SIGNED 0 + +#define UPDCTRL_MASK 0x01000000U +#define UPDCTRL_SHIFT 24 +#define UPDCTRL_SIGNED 0 + +#define UPDINTCTRL_MASK 0x02000000U +#define UPDINTCTRL_SHIFT 25 +#define UPDINTCTRL_SIGNED 0 + +#define UPDSYNCTRL_MASK 0x04000000U +#define UPDSYNCTRL_SHIFT 26 +#define UPDSYNCTRL_SIGNED 0 + +#define POWERDN_MASK 0x10000000U +#define POWERDN_SHIFT 28 +#define POWERDN_SIGNED 0 + +#define DISP_RST_MASK 0x20000000U +#define DISP_RST_SHIFT 29 +#define DISP_RST_SIGNED 0 + +#define SYNCACTIVE_MASK 0x80000000U +#define SYNCACTIVE_SHIFT 31 +#define SYNCACTIVE_SIGNED 0 + +/* + Register PVR_TCF_RGBPDP_BORDCOL +*/ +#define TCF_RGBPDP_PVR_TCF_RGBPDP_BORDCOL 0x0018 +#define BORDCOL_MASK 0x00FFFFFFU +#define BORDCOL_SHIFT 0 +#define BORDCOL_SIGNED 0 + +/* + Register PVR_TCF_RGBPDP_UPDCTRL +*/ +#define TCF_RGBPDP_PVR_TCF_RGBPDP_UPDCTRL 0x001C +#define UPDFIELD_MASK 0x00000001U +#define UPDFIELD_SHIFT 0 +#define UPDFIELD_SIGNED 0 + +/* + Register PVR_TCF_RGBPDP_HSYNC1 +*/ +#define TCF_RGBPDP_PVR_TCF_RGBPDP_HSYNC1 0x0020 +#define HT_MASK 0x00000FFFU +#define HT_SHIFT 0 +#define HT_SIGNED 0 + +#define HBPS_MASK 0x0FFF0000U +#define HBPS_SHIFT 16 +#define HBPS_SIGNED 0 + +/* + Register PVR_TCF_RGBPDP_HSYNC2 +*/ +#define TCF_RGBPDP_PVR_TCF_RGBPDP_HSYNC2 0x0024 +#define HLBS_MASK 0x00000FFFU +#define HLBS_SHIFT 0 +#define HLBS_SIGNED 0 + +#define HAS_MASK 0x0FFF0000U +#define HAS_SHIFT 16 +#define HAS_SIGNED 0 + +/* + Register PVR_TCF_RGBPDP_HSYNC3 +*/ +#define TCF_RGBPDP_PVR_TCF_RGBPDP_HSYNC3 0x0028 +#define HRBS_MASK 0x00000FFFU +#define HRBS_SHIFT 0 +#define HRBS_SIGNED 0 + +#define HFPS_MASK 0x0FFF0000U +#define HFPS_SHIFT 16 +#define HFPS_SIGNED 0 + +/* + Register PVR_TCF_RGBPDP_VSYNC1 +*/ +#define TCF_RGBPDP_PVR_TCF_RGBPDP_VSYNC1 0x002C +#define VT_MASK 0x00000FFFU +#define VT_SHIFT 0 +#define VT_SIGNED 0 + +#define VBPS_MASK 0x0FFF0000U +#define VBPS_SHIFT 16 +#define VBPS_SIGNED 0 + +/* + Register PVR_TCF_RGBPDP_VSYNC2 +*/ +#define TCF_RGBPDP_PVR_TCF_RGBPDP_VSYNC2 0x0030 +#define VTBS_MASK 0x00000FFFU +#define VTBS_SHIFT 0 +#define VTBS_SIGNED 0 + +#define VAS_MASK 0x0FFF0000U +#define VAS_SHIFT 16 +#define VAS_SIGNED 0 + +/* + Register PVR_TCF_RGBPDP_VSYNC3 +*/ +#define TCF_RGBPDP_PVR_TCF_RGBPDP_VSYNC3 0x0034 +#define VBBS_MASK 0x00000FFFU +#define VBBS_SHIFT 0 +#define VBBS_SIGNED 0 + +#define VFPS_MASK 0x0FFF0000U +#define VFPS_SHIFT 16 +#define VFPS_SIGNED 0 + +/* + Register PVR_TCF_RGBPDP_HDECTRL +*/ +#define TCF_RGBPDP_PVR_TCF_RGBPDP_HDECTRL 0x0038 +#define HDEF_MASK 0x00000FFFU +#define HDEF_SHIFT 0 +#define HDEF_SIGNED 0 + +#define HDES_MASK 0x0FFF0000U +#define HDES_SHIFT 16 +#define HDES_SIGNED 0 + +/* + Register PVR_TCF_RGBPDP_VDECTRL +*/ +#define TCF_RGBPDP_PVR_TCF_RGBPDP_VDECTRL 0x003C +#define VDEF_MASK 0x00000FFFU +#define VDEF_SHIFT 0 +#define VDEF_SIGNED 0 + +#define VDES_MASK 0x0FFF0000U +#define VDES_SHIFT 16 +#define VDES_SIGNED 0 + +/* + Register PVR_TCF_RGBPDP_VEVENT +*/ +#define TCF_RGBPDP_PVR_TCF_RGBPDP_VEVENT 0x0040 +#define VFETCH_MASK 0x00000FFFU +#define VFETCH_SHIFT 0 +#define VFETCH_SIGNED 0 + +#define VEVENT_MASK 0x0FFF0000U +#define VEVENT_SHIFT 16 +#define VEVENT_SIGNED 0 + +/* + Register PVR_TCF_RGBPDP_OPMASK +*/ +#define TCF_RGBPDP_PVR_TCF_RGBPDP_OPMASK 0x0044 +#define MASKR_MASK 0x000000FFU +#define MASKR_SHIFT 0 +#define MASKR_SIGNED 0 + +#define MASKG_MASK 0x0000FF00U +#define MASKG_SHIFT 8 +#define MASKG_SIGNED 0 + +#define MASKB_MASK 0x00FF0000U +#define MASKB_SHIFT 16 +#define MASKB_SIGNED 0 + +#define BLANKLEVEL_MASK 0x40000000U +#define BLANKLEVEL_SHIFT 30 +#define BLANKLEVEL_SIGNED 0 + +#define MASKLEVEL_MASK 0x80000000U +#define MASKLEVEL_SHIFT 31 +#define MASKLEVEL_SIGNED 0 + +/* + Register PVR_TCF_RGBPDP_INTSTAT +*/ +#define TCF_RGBPDP_PVR_TCF_RGBPDP_INTSTAT 0x0048 +#define INTS_HBLNK0_MASK 0x00000001U +#define INTS_HBLNK0_SHIFT 0 +#define INTS_HBLNK0_SIGNED 0 + +#define INTS_HBLNK1_MASK 0x00000002U +#define INTS_HBLNK1_SHIFT 1 +#define INTS_HBLNK1_SIGNED 0 + +#define INTS_VBLNK0_MASK 0x00000004U +#define INTS_VBLNK0_SHIFT 2 +#define INTS_VBLNK0_SIGNED 0 + +#define INTS_VBLNK1_MASK 0x00000008U +#define INTS_VBLNK1_SHIFT 3 +#define INTS_VBLNK1_SIGNED 0 + +#define INTS_STR1URUN_MASK 0x00000010U +#define INTS_STR1URUN_SHIFT 4 +#define INTS_STR1URUN_SIGNED 0 + +#define INTS_STR1ORUN_MASK 0x00000020U +#define INTS_STR1ORUN_SHIFT 5 +#define INTS_STR1ORUN_SIGNED 0 + +#define INTS_DISPURUN_MASK 0x00000040U +#define INTS_DISPURUN_SHIFT 6 +#define INTS_DISPURUN_SIGNED 0 + +/* + Register PVR_TCF_RGBPDP_INTENAB +*/ +#define TCF_RGBPDP_PVR_TCF_RGBPDP_INTENAB 0x004C +#define INTEN_HBLNK0_MASK 0x00000001U +#define INTEN_HBLNK0_SHIFT 0 +#define INTEN_HBLNK0_SIGNED 0 + +#define INTEN_HBLNK1_MASK 0x00000002U +#define INTEN_HBLNK1_SHIFT 1 +#define INTEN_HBLNK1_SIGNED 0 + +#define INTEN_VBLNK0_MASK 0x00000004U +#define INTEN_VBLNK0_SHIFT 2 +#define INTEN_VBLNK0_SIGNED 0 + +#define INTEN_VBLNK1_MASK 0x00000008U +#define INTEN_VBLNK1_SHIFT 3 +#define INTEN_VBLNK1_SIGNED 0 + +#define INTEN_STR1URUN_MASK 0x00000010U +#define INTEN_STR1URUN_SHIFT 4 +#define INTEN_STR1URUN_SIGNED 0 + +#define INTEN_STR1ORUN_MASK 0x00000020U +#define INTEN_STR1ORUN_SHIFT 5 +#define INTEN_STR1ORUN_SIGNED 0 + +#define INTEN_DISPURUN_MASK 0x00000040U +#define INTEN_DISPURUN_SHIFT 6 +#define INTEN_DISPURUN_SIGNED 0 + +/* + Register PVR_TCF_RGBPDP_INTCLEAR +*/ +#define TCF_RGBPDP_PVR_TCF_RGBPDP_INTCLEAR 0x0050 +#define INTCLR_HBLNK0_MASK 0x00000001U +#define INTCLR_HBLNK0_SHIFT 0 +#define INTCLR_HBLNK0_SIGNED 0 + +#define INTCLR_HBLNK1_MASK 0x00000002U +#define INTCLR_HBLNK1_SHIFT 1 +#define INTCLR_HBLNK1_SIGNED 0 + +#define INTCLR_VBLNK0_MASK 0x00000004U +#define INTCLR_VBLNK0_SHIFT 2 +#define INTCLR_VBLNK0_SIGNED 0 + +#define INTCLR_VBLNK1_MASK 0x00000008U +#define INTCLR_VBLNK1_SHIFT 3 +#define INTCLR_VBLNK1_SIGNED 0 + +#define INTCLR_STR1URUN_MASK 0x00000010U +#define INTCLR_STR1URUN_SHIFT 4 +#define INTCLR_STR1URUN_SIGNED 0 + +#define INTCLR_STR1ORUN_MASK 0x00000020U +#define INTCLR_STR1ORUN_SHIFT 5 +#define INTCLR_STR1ORUN_SIGNED 0 + +#define INTCLR_DISPURUN_MASK 0x00000040U +#define INTCLR_DISPURUN_SHIFT 6 +#define INTCLR_DISPURUN_SIGNED 0 + +/* + Register PVR_TCF_RGBPDP_INTCTRL +*/ +#define TCF_RGBPDP_PVR_TCF_RGBPDP_INTCTRL 0x0054 +#define HBLNK_LINENO_MASK 0x00000FFFU +#define HBLNK_LINENO_SHIFT 0 +#define HBLNK_LINENO_SIGNED 0 + +#define HBLNK_LINE_MASK 0x00010000U +#define HBLNK_LINE_SHIFT 16 +#define HBLNK_LINE_SIGNED 0 + +/* + Register PVR_TCF_RGBPDP_SIGNAT +*/ +#define TCF_RGBPDP_PVR_TCF_RGBPDP_SIGNAT 0x0058 +#define SIGNATURE_MASK 0xFFFFFFFFU +#define SIGNATURE_SHIFT 0 +#define SIGNATURE_SIGNED 0 + +/* + Register PVR_TCF_RGBPDP_LINESTAT +*/ +#define TCF_RGBPDP_PVR_TCF_RGBPDP_LINESTAT 0x005C +#define LINENO_MASK 0x00000FFFU +#define LINENO_SHIFT 0 +#define LINENO_SIGNED 0 + +/* + Register PVR_TCF_RGBPDP_DBGCTRL +*/ +#define TCF_RGBPDP_PVR_TCF_RGBPDP_DBGCTRL 0x0060 +#define DBG_ENAB_MASK 0x00000001U +#define DBG_ENAB_SHIFT 0 +#define DBG_ENAB_SIGNED 0 + +#define DBG_READ_MASK 0x00000002U +#define DBG_READ_SHIFT 1 +#define DBG_READ_SIGNED 0 + +/* + Register PVR_TCF_RGBPDP_DBGDATA +*/ +#define TCF_RGBPDP_PVR_TCF_RGBPDP_DBGDATA 0x0064 +#define DBG_DATA_MASK 0x00FFFFFFU +#define DBG_DATA_SHIFT 0 +#define DBG_DATA_SIGNED 0 + +/* + Register PVR_TCF_RGBPDP_DBGSIDE +*/ +#define TCF_RGBPDP_PVR_TCF_RGBPDP_DBGSIDE 0x0068 +#define DBG_SIDE_MASK 0x00000007U +#define DBG_SIDE_SHIFT 0 +#define DBG_SIDE_SIGNED 0 + +#define DBG_VAL_MASK 0x00000008U +#define DBG_VAL_SHIFT 3 +#define DBG_VAL_SIGNED 0 + +/* + Register PVR_TCF_RGBPDP_REGLD_STAT +*/ +#define TCF_RGBPDP_PVR_TCF_RGBPDP_REGLD_STAT 0x0070 +#define REGLD_ADDROUT_MASK 0x00FFFFFFU +#define REGLD_ADDROUT_SHIFT 0 +#define REGLD_ADDROUT_SIGNED 0 + +#define REGLD_ADDREN_MASK 0x80000000U +#define REGLD_ADDREN_SHIFT 31 +#define REGLD_ADDREN_SIGNED 0 + +/* + Register PVR_TCF_RGBPDP_REGLD_CTRL +*/ +#define TCF_RGBPDP_PVR_TCF_RGBPDP_REGLD_CTRL 0x0074 +#define REGLD_ADDRIN_MASK 0x00FFFFFFU +#define REGLD_ADDRIN_SHIFT 0 +#define REGLD_ADDRIN_SIGNED 0 + +#define REGLD_VAL_MASK 0x01000000U +#define REGLD_VAL_SHIFT 24 +#define REGLD_VAL_SIGNED 0 + +#define REGLD_ADDRLEN_MASK 0xFE000000U +#define REGLD_ADDRLEN_SHIFT 25 +#define REGLD_ADDRLEN_SIGNED 0 + +/* + Register PVR_TCF_RGBPDP_CORE_ID +*/ +#define TCF_RGBPDP_PVR_TCF_RGBPDP_CORE_ID 0x0078 +#define CONFIG_ID_MASK 0x0000FFFFU +#define CONFIG_ID_SHIFT 0 +#define CONFIG_ID_SIGNED 0 + +#define CORE_ID_MASK 0x00FF0000U +#define CORE_ID_SHIFT 16 +#define CORE_ID_SIGNED 0 + +#define GROUP_ID_MASK 0xFF000000U +#define GROUP_ID_SHIFT 24 +#define GROUP_ID_SIGNED 0 + +/* + Register PVR_TCF_RGBPDP_CORE_REV +*/ +#define TCF_RGBPDP_PVR_TCF_RGBPDP_CORE_REV 0x007C +#define MAINT_REV_MASK 0x000000FFU +#define MAINT_REV_SHIFT 0 +#define MAINT_REV_SIGNED 0 + +#define MINOR_REV_MASK 0x0000FF00U +#define MINOR_REV_SHIFT 8 +#define MINOR_REV_SIGNED 0 + +#define MAJOR_REV_MASK 0x00FF0000U +#define MAJOR_REV_SHIFT 16 +#define MAJOR_REV_SIGNED 0 + +#endif /* !defined(_TCF_RGBPDP_REGS_H_) */ + +/***************************************************************************** + End of file (tcf_rgbpdp_regs.h) +*****************************************************************************/ diff --git a/drivers/gpu/rogue_m/kernel/drivers/staging/imgtec/Kbuild.mk b/drivers/gpu/rogue_m/kernel/drivers/staging/imgtec/Kbuild.mk new file mode 100644 index 000000000000..4c7f9988247d --- /dev/null +++ b/drivers/gpu/rogue_m/kernel/drivers/staging/imgtec/Kbuild.mk @@ -0,0 +1,84 @@ +########################################################################### ### +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +ccflags-y := \ + -I$(TOP)/kernel/drivers/staging/imgtec \ + -I$(TOP)/include/system/rgx_tc \ + $(ccflags-y) + +# Avoid picking up the services version of 'sync.h' +CFLAGS_adf_common.o := -Idrivers/staging/android +CFLAGS_adf_fbdev.o := -Idrivers/staging/android +CFLAGS_adf_pdp.o := -Idrivers/staging/android +CFLAGS_adf_sunxi.o := -Idrivers/staging/android + +adf_fbdev-y += \ + kernel/drivers/staging/imgtec/adf_fbdev.o \ + kernel/drivers/staging/imgtec/adf_common.o + +adf_pdp-y += \ + kernel/drivers/staging/imgtec/adf_pdp.o \ + kernel/drivers/staging/imgtec/adf_common.o + +apollo-y += \ + kernel/drivers/staging/imgtec/apollo.o + +ifeq ($(SUPPORT_ION),1) +apollo-y += \ + kernel/drivers/staging/imgtec/ion_lma_heap.o +endif + +adf_sunxi-y += \ + kernel/drivers/staging/imgtec/adf_sunxi.o \ + kernel/drivers/staging/imgtec/adf_common.o + +drm_fbdev-y += \ + kernel/drivers/staging/imgtec/drm_fbdev.o + +drm_nulldisp-y += \ + kernel/drivers/staging/imgtec/drm_nulldisp.o + +drm_pdp-y += \ + kernel/drivers/staging/imgtec/drm_pdp.o \ + kernel/drivers/staging/imgtec/drm_pdp_mm.o \ + kernel/drivers/staging/imgtec/drm_pdp_modeset.o \ + kernel/drivers/staging/imgtec/drm_pdp_crtc.o \ + kernel/drivers/staging/imgtec/drm_pdp_dvi.o \ + kernel/drivers/staging/imgtec/drm_pdp_tmds.o diff --git a/drivers/gpu/rogue_m/kernel/drivers/staging/imgtec/Linux.mk b/drivers/gpu/rogue_m/kernel/drivers/staging/imgtec/Linux.mk new file mode 100644 index 000000000000..826da4f13fd1 --- /dev/null +++ b/drivers/gpu/rogue_m/kernel/drivers/staging/imgtec/Linux.mk @@ -0,0 +1,69 @@ +########################################################################### ### +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 +# +# The contents of this file are subject to the MIT license as set out below. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### + +modules := adf_fbdev adf_pdp apollo adf_sunxi drm_fbdev drm_nulldisp drm_pdp + +adf_fbdev_type := kernel_module +adf_fbdev_target := adf_fbdev.ko +adf_fbdev_makefile := $(THIS_DIR)/Kbuild.mk + +adf_pdp_type := kernel_module +adf_pdp_target := adf_pdp.ko +adf_pdp_makefile := $(THIS_DIR)/Kbuild.mk + +apollo_type := kernel_module +apollo_target := apollo.ko +apollo_makefile := $(THIS_DIR)/Kbuild.mk + +adf_sunxi_type := kernel_module +adf_sunxi_target := adf_sunxi.ko +adf_sunxi_makefile := $(THIS_DIR)/Kbuild.mk + +drm_fbdev_type := kernel_module +drm_fbdev_target := drm_fbdev.ko +drm_fbdev_makefile := $(THIS_DIR)/Kbuild.mk + +drm_nulldisp_type := kernel_module +drm_nulldisp_target := drm_nulldisp.ko +drm_nulldisp_makefile := $(THIS_DIR)/Kbuild.mk + +drm_pdp_type := kernel_module +drm_pdp_target := drm_pdp.ko +drm_pdp_makefile := $(THIS_DIR)/Kbuild.mk diff --git a/drivers/gpu/rogue_m/kernel/drivers/staging/imgtec/adf_common.c b/drivers/gpu/rogue_m/kernel/drivers/staging/imgtec/adf_common.c new file mode 100644 index 000000000000..a32f8ff4e7c9 --- /dev/null +++ b/drivers/gpu/rogue_m/kernel/drivers/staging/imgtec/adf_common.c @@ -0,0 +1,564 @@ +/*************************************************************************/ /*! +@File +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ /**************************************************************************/ +/* vi: set ts=8: */ + +#include "adf_common.h" + +#include +#include +#include +#include +#include + +#include