From: zxl Date: Wed, 25 Mar 2015 03:05:17 +0000 (+0800) Subject: RK3368 GPU version: L0.10 X-Git-Tag: firefly_0821_release~4158^2~288 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=2a14944523fe53e44f5d49d049d2d57a514501e5;p=firefly-linux-kernel-4.4.55.git RK3368 GPU version: L0.10 Init Power Rogue DDK code Signed-off-by: zxl --- diff --git a/drivers/gpu/Makefile b/drivers/gpu/Makefile index a759007a95a2..386b1f5761a4 100644 --- a/drivers/gpu/Makefile +++ b/drivers/gpu/Makefile @@ -1,2 +1,3 @@ obj-y += drm/ vga/ arm/ obj-$(CONFIG_TEGRA_HOST1X) += host1x/ +obj-$(CONFIG_POWERVR_ROGUE) += rogue/ diff --git a/drivers/gpu/rogue/GPL-COPYING b/drivers/gpu/rogue/GPL-COPYING new file mode 100644 index 000000000000..83d1261af023 --- /dev/null +++ b/drivers/gpu/rogue/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/INSTALL b/drivers/gpu/rogue/INSTALL new file mode 100644 index 000000000000..1af75389b211 --- /dev/null +++ b/drivers/gpu/rogue/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/Kconfig b/drivers/gpu/rogue/Kconfig new file mode 100755 index 000000000000..91d129f29c46 --- /dev/null +++ b/drivers/gpu/rogue/Kconfig @@ -0,0 +1,8 @@ +config POWERVR_ROGUE + tristate "PowerVR Rogue" + default n + help + Driver for PowerVR Rogue hardware. + + Say Y here if your SoC contains a PowerVR Rogue GPU. For more + information, see . diff --git a/drivers/gpu/rogue/MIT-COPYING b/drivers/gpu/rogue/MIT-COPYING new file mode 100644 index 000000000000..0cbd14e06cbc --- /dev/null +++ b/drivers/gpu/rogue/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/Makefile b/drivers/gpu/rogue/Makefile new file mode 100755 index 000000000000..f5478bb32c68 --- /dev/null +++ b/drivers/gpu/rogue/Makefile @@ -0,0 +1,249 @@ +include drivers/gpu/rogue/config_kernel.mk + +obj-$(CONFIG_POWERVR_ROGUE) += pvrsrvkm.o + +ccflags-y += -include drivers/gpu/rogue/config_kernel.h \ + -Idrivers/gpu/rogue \ + -Idrivers/gpu/rogue/hwdefs \ + -Idrivers/gpu/rogue/hwdefs/km \ + -Idrivers/gpu/rogue/system/include \ + -Idrivers/gpu/rogue/system/common \ + -Idrivers/gpu/rogue/system/$(PVR_SYSTEM) \ + -Idrivers/gpu/rogue/services/server/include \ + -Idrivers/gpu/rogue/include \ + -Idrivers/gpu/rogue/services/include \ + -Idrivers/gpu/rogue/services/include/shared \ + -Idrivers/gpu/rogue/services/shared/include \ + -Idrivers/gpu/rogue/services/shared/devices/rgx \ + -Idrivers/gpu/rogue/services/server/env/linux \ + -Idrivers/gpu/rogue/kernel/drivers/staging/imgtec \ + -Idrivers/gpu/rogue/services/include/env/linux \ + -Idrivers/gpu/rogue/services/server/devices/rgx + +tmp := $(addprefix -I,$(wildcard drivers/gpu/rogue/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/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/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/resman.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/server/common/tutils.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 += 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 + +ifeq ($(SUPPORT_RAY_TRACING),1) +pvrsrvkm-y += rgxray.o +endif + +ifeq ($(PDUMP),1) +pvrsrvkm-y += services/server/devices/rgx/rgxpdump.o +endif + +ifeq ($(PVR_ANDROID_NATIVE_WINDOW_HAS_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/pdumpcmm_bridge/server_pdumpcmm_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 + +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/README b/drivers/gpu/rogue/README new file mode 100644 index 000000000000..8579ae18896c --- /dev/null +++ b/drivers/gpu/rogue/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/build/linux/bits.mk b/drivers/gpu/rogue/build/linux/bits.mk new file mode 100644 index 000000000000..e993c636d2d3 --- /dev/null +++ b/drivers/gpu/rogue/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/build/linux/buildvars.mk b/drivers/gpu/rogue/build/linux/buildvars.mk new file mode 100644 index 000000000000..25077d90baf6 --- /dev/null +++ b/drivers/gpu/rogue/build/linux/buildvars.mk @@ -0,0 +1,279 @@ +########################################################################### ### +#@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) +TESTED_HOST_USER_FLAGS += \ + $(call host-cc-optional-warning,-Wunused-but-set-variable) + +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/build/linux/commands.mk b/drivers/gpu/rogue/build/linux/commands.mk new file mode 100644 index 000000000000..3ab5fcb2fe54 --- /dev/null +++ b/drivers/gpu/rogue/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/build/linux/common/3rdparty.mk b/drivers/gpu/rogue/build/linux/common/3rdparty.mk new file mode 100644 index 000000000000..9fa667d61ef8 --- /dev/null +++ b/drivers/gpu/rogue/build/linux/common/3rdparty.mk @@ -0,0 +1,98 @@ +########################################################################### ### +#@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,)) +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),dc_drmfbdev) +$(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 diff --git a/drivers/gpu/rogue/build/linux/common/android/arch.mk b/drivers/gpu/rogue/build/linux/common/android/arch.mk new file mode 100644 index 000000000000..2df0daa8e655 --- /dev/null +++ b/drivers/gpu/rogue/build/linux/common/android/arch.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. +### ########################################################################### + +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)),) +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/build/linux/common/android/arch_common.mk b/drivers/gpu/rogue/build/linux/common/android/arch_common.mk new file mode 100644 index 000000000000..9c8286a567ec --- /dev/null +++ b/drivers/gpu/rogue/build/linux/common/android/arch_common.mk @@ -0,0 +1,77 @@ +########################################################################### ### +#@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)/external/openssl/include \ + -isystem $(ANDROID_ROOT)/frameworks/base/include \ + -isystem $(ANDROID_ROOT)/hardware/libhardware/include \ + -isystem $(ANDROID_ROOT)/system/core/include \ + -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 + +# 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/build/linux/common/android/extra_config.mk b/drivers/gpu/rogue/build/linux/common/android/extra_config.mk new file mode 100644 index 000000000000..88c5002fadde --- /dev/null +++ b/drivers/gpu/rogue/build/linux/common/android/extra_config.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. +### ########################################################################### + +$(eval $(call UserConfigMake,libpthread_ldflags,)) +$(eval $(call UserConfigMake,librt_ldflags,)) +$(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,PVR_ANDROID_NATIVE_WINDOW_HAS_SYNC,)) +$(eval $(call TunableBothConfigC,PVR_ANDROID_DISABLE_MULTI_SYNCS,)) + +# 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,PVR_ANDROID_NATIVE_WINDOW_HAS_SYNC,)) + +# These are user-tunable. + diff --git a/drivers/gpu/rogue/build/linux/common/android/features.mk b/drivers/gpu/rogue/build/linux/common/android/features.mk new file mode 100644 index 000000000000..eaf55294944a --- /dev/null +++ b/drivers/gpu/rogue/build/linux/common/android/features.mk @@ -0,0 +1,230 @@ +########################################################################### ### +#@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 + +# 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) +ifeq ($(RSC_API_LEVEL),21) +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 +PVR_ANDROID_NATIVE_WINDOW_HAS_SYNC ?= 1 + +############################################################################## +# Handle various platform includes for unittests +# +SYS_INCLUDES += \ + -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 + +# Use stlport instead of libstdc++ for STL compatibility +# +SYS_CXXFLAGS := -fuse-cxa-atexit $(SYS_CFLAGS) +SYS_INCLUDES += \ + -isystem $(ANDROID_ROOT)/bionic \ + -isystem $(ANDROID_ROOT)/external/stlport/stlport + +############################################################################## +# 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_DC ?= 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 + +# Placeholder for future version handling +# +ifeq ($(is_future_version),1) +-include ../common/android/future_version.mk +endif diff --git a/drivers/gpu/rogue/build/linux/common/android/install.sh.tpl b/drivers/gpu/rogue/build/linux/common/android/install.sh.tpl new file mode 100644 index 000000000000..b949c8c9146a --- /dev/null +++ b/drivers/gpu/rogue/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/build/linux/common/android/paths.mk b/drivers/gpu/rogue/build/linux/common/android/paths.mk new file mode 100644 index 000000000000..6cc7cc7efe97 --- /dev/null +++ b/drivers/gpu/rogue/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/build/linux/common/android/platform_version.mk b/drivers/gpu/rogue/build/linux/common/android/platform_version.mk new file mode 100644 index 000000000000..37eec2b8a316 --- /dev/null +++ b/drivers/gpu/rogue/build/linux/common/android/platform_version.mk @@ -0,0 +1,178 @@ +########################################################################### ### +#@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. +# +ifeq ($(call release-starts-with,JellyBeanMR1),1) +PLATFORM_RELEASE := 4.2 +else ifeq ($(call release-starts-with,JellyBeanMR),1) +PLATFORM_RELEASE := 4.3 +else ifeq ($(call release-starts-with,JellyBean),1) +PLATFORM_RELEASE := 4.1 +else ifeq ($(call release-starts-with,KeyLimePie),1) +PLATFORM_RELEASE := 4.4 +else 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,Lollipop),1) +PLATFORM_RELEASE := 5.0 +else ifeq ($(PLATFORM_CODENAME),AOSP) +# AOSP (master) will normally have PLATFORM_CODENAME set to AOSP +PLATFORM_RELEASE := 5.1 +else ifeq ($(shell echo $(PLATFORM_RELEASE) | grep -qE "[A-Za-z]+"; echo $$?),0) +PLATFORM_RELEASE := 5.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_jellybean_mr1 := \ + $(shell ( test $(PLATFORM_RELEASE_MAJ) -gt 4 || \ + ( test $(PLATFORM_RELEASE_MAJ) -eq 4 && \ + test $(PLATFORM_RELEASE_MIN) -ge 2 ) ) && echo 1 || echo 0) +is_at_least_jellybean_mr2 := \ + $(shell ( test $(PLATFORM_RELEASE_MAJ) -gt 4 || \ + ( test $(PLATFORM_RELEASE_MAJ) -eq 4 && \ + test $(PLATFORM_RELEASE_MIN) -ge 3 ) ) && echo 1 || echo 0) +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) + +# Assume "future versions" are >=5.1, but we don't really know +is_future_version := \ + $(shell ( test $(PLATFORM_RELEASE_MAJ) -gt 5 || \ + ( test $(PLATFORM_RELEASE_MAJ) -eq 5 && \ + test $(PLATFORM_RELEASE_MIN) -gt 0 ) ) && echo 1 || echo 0) + +# Sometimes a feature is introduced in AOSP master that isn't in the current +# future version, but both versions are beyond our support level. This variable +# can be used to differentiate those builds. +# +ifeq ($(PLATFORM_CODENAME)$(is_future_version),AOSP1) +is_aosp_master := 1 +else +is_aosp_master := 0 +endif + +# 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) +# Temporarily pin to 19 until it is actually bumped to 20 +API_LEVEL := 19 +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 ifeq ($(is_at_least_jellybean_mr2),1) +API_LEVEL := 18 +else ifeq ($(is_at_least_jellybean_mr1),1) +API_LEVEL := 17 +else +$(error Must build against Android >= 4.2) +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/build/linux/common/pvrgdb.mk b/drivers/gpu/rogue/build/linux/common/pvrgdb.mk new file mode 100644 index 000000000000..b5f84d41d6c7 --- /dev/null +++ b/drivers/gpu/rogue/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/build/linux/common/testchip.mk b/drivers/gpu/rogue/build/linux/common/testchip.mk new file mode 100644 index 000000000000..e9bb7eee5a10 --- /dev/null +++ b/drivers/gpu/rogue/build/linux/common/testchip.mk @@ -0,0 +1,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. +### ########################################################################### + +ifeq ($(RGX_BVNC),1.82.4.5) + $(eval $(call TunableKernelConfigC,TC_APOLLO_ES2,1)) +endif + +ifeq ($(PVR_SYSTEM),$(filter $(PVR_SYSTEM),rgx_tc rgx_tc_es2)) +$(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/build/linux/config/compiler.mk b/drivers/gpu/rogue/build/linux/config/compiler.mk new file mode 100644 index 000000000000..c1384eaae16e --- /dev/null +++ b/drivers/gpu/rogue/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/build/linux/config/compilers/aarch64-linux-android.mk b/drivers/gpu/rogue/build/linux/config/compilers/aarch64-linux-android.mk new file mode 100644 index 000000000000..97136fe6a45d --- /dev/null +++ b/drivers/gpu/rogue/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/build/linux/config/compilers/arm-eabi.mk b/drivers/gpu/rogue/build/linux/config/compilers/arm-eabi.mk new file mode 100644 index 000000000000..d671ba9ccc18 --- /dev/null +++ b/drivers/gpu/rogue/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/build/linux/config/compilers/arm-linux-androideabi.mk b/drivers/gpu/rogue/build/linux/config/compilers/arm-linux-androideabi.mk new file mode 100644 index 000000000000..8aaeaadf43d9 --- /dev/null +++ b/drivers/gpu/rogue/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/build/linux/config/compilers/i386-linux-gnu.mk b/drivers/gpu/rogue/build/linux/config/compilers/i386-linux-gnu.mk new file mode 100644 index 000000000000..cd9539c7cf68 --- /dev/null +++ b/drivers/gpu/rogue/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/build/linux/config/compilers/x86_64-linux-gnu.mk b/drivers/gpu/rogue/build/linux/config/compilers/x86_64-linux-gnu.mk new file mode 100644 index 000000000000..008e86b35a92 --- /dev/null +++ b/drivers/gpu/rogue/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/build/linux/config/core.mk b/drivers/gpu/rogue/build/linux/config/core.mk new file mode 100644 index 000000000000..ddfef8546156 --- /dev/null +++ b/drivers/gpu/rogue/build/linux/config/core.mk @@ -0,0 +1,755 @@ +########################################################################### ### +#@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),) +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 + +MAX_POOL_PAGES ?= 10240 + +# 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 ($(SUPPORT_DRM),1) +SUPPORT_DISPLAY_CLASS := 0 +else +ifeq ($(SUPPORT_ADF),1) +SUPPORT_DISPLAY_CLASS := 0 +else +ifeq ($(SUPPORT_DC),1) +SUPPORT_DISPLAY_CLASS ?= 1 +else +endif +endif +endif + +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_DMA :=\ + $(shell grep -qw RGX_FEATURE_META_DMA_CHANNEL_COUNT $(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 +endif +override SUPPORT_EXPORTING_MEMORY_CONTEXT := 1 +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 +# + +$(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)) + +$(eval $(call BothConfigC,PVR_SECURE_HANDLES,)) +$(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))) + +ifeq ($(MESA_EGL),1) +$(eval $(call UserConfigMake,LIB_IMG_EGL,pvr_dri_if)) +else +$(eval $(call UserConfigMake,LIB_IMG_EGL,IMGegl)) +endif + +# Build-type dependent options +# +$(eval $(call BothConfigMake,BUILD,$(BUILD))) + +ifeq ($(BUILD),debug) +PVR_RI_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_BNC_CONFIG_KM_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._\ +)) +$(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,1)) +$(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_PMMIF,)) +$(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,TRUSTED_DEVICE_DEFAULT_ENABLED,)) +$(eval $(call TunableBothConfigC,SUPPORT_EXPORTING_MEMORY_CONTEXT,)) +$(eval $(call TunableBothConfigC,SUPPORT_USER_REGISTER_CONFIGURATION,)) +$(eval $(call TunableBothConfigC,FIX_DUSTS_POW_ON_INIT,)) + +$(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,SYNC_DEBUG,)) +$(eval $(call TunableKernelConfigC,SUPPORT_DUMP_CLIENT_CCB_COMMANDS,)) +$(eval $(call TunableKernelConfigC,PVR_LINUX_DONT_USE_RANGE_BASED_INVALIDATE,)) +$(eval $(call TunableKernelConfigC,PVR_MMAP_USE_VM_INSERT,)) +$(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_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,)) + + + + + +ifneq ($(SUPPORT_ANDROID_PLATFORM),1) + endif + + +$(eval $(call TunableBothConfigMake,CACHEFLUSH_TYPE,CACHEFLUSH_GENERIC)) +$(eval $(call TunableBothConfigMake,PDUMP,)) +$(eval $(call TunableBothConfigMake,SUPPORT_INSECURE_EXPORT,1)) +$(eval $(call TunableBothConfigMake,SUPPORT_SECURE_EXPORT,1)) +$(eval $(call TunableBothConfigMake,SUPPORT_PMMIF,)) +$(eval $(call TunableBothConfigMake,SUPPORT_DISPLAY_CLASS,)) +$(eval $(call TunableBothConfigMake,SUPPORT_RAY_TRACING,)) + +$(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_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,generic,\ +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 TunableKernelConfigC,SUPPORT_SHARED_SLC,,)) + +# 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 TunableKernelConfigC,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 TunableKernelConfigC,PVR_LINUX_PYSMEM_MAX_POOL_PAGES,"$(MAX_POOL_PAGES)")) +$(eval $(call TunableKernelConfigC,PVR_LINUX_VMALLOC_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 +# + +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/build/linux/config/help.mk b/drivers/gpu/rogue/build/linux/config/help.mk new file mode 100644 index 000000000000..4d6ef013bca7 --- /dev/null +++ b/drivers/gpu/rogue/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/build/linux/config/kernel_version.mk b/drivers/gpu/rogue/build/linux/config/kernel_version.mk new file mode 100644 index 000000000000..35ecceb354a3 --- /dev/null +++ b/drivers/gpu/rogue/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/build/linux/config/preconfig.mk b/drivers/gpu/rogue/build/linux/config/preconfig.mk new file mode 100644 index 000000000000..681ac375f2dd --- /dev/null +++ b/drivers/gpu/rogue/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 rscompute scripts composerhal servicestools hwperftools testchiptools rogue2d memtrackhal camerahal +_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/build/linux/defs.mk b/drivers/gpu/rogue/build/linux/defs.mk new file mode 100644 index 000000000000..7b2a2c0fee2e --- /dev/null +++ b/drivers/gpu/rogue/build/linux/defs.mk @@ -0,0 +1,264 @@ +########################################################################### ### +#@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 host-intermediates-of +$(addprefix $(HOST_OUT)/intermediates/$(1)/,$(2)) +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 \ + usc_header \ + rscbitcode_header + +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/build/linux/generic_arm_android/Makefile b/drivers/gpu/rogue/build/linux/generic_arm_android/Makefile new file mode 100644 index 000000000000..f292a6e41339 --- /dev/null +++ b/drivers/gpu/rogue/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_future_version),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/build/linux/kbuild/Makefile.template b/drivers/gpu/rogue/build/linux/kbuild/Makefile.template new file mode 100644 index 000000000000..ee1f56459dd6 --- /dev/null +++ b/drivers/gpu/rogue/build/linux/kbuild/Makefile.template @@ -0,0 +1,92 @@ +########################################################################### ### +#@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) + +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/build/linux/kbuild/kbuild.mk b/drivers/gpu/rogue/build/linux/kbuild/kbuild.mk new file mode 100644 index 000000000000..31afa4823557 --- /dev/null +++ b/drivers/gpu/rogue/build/linux/kbuild/kbuild.mk @@ -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. +### ########################################################################### + +$(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)) + +kbuild: 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)" \ + 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)" \ + V=$(V) W=$(W) \ + TOP=$(TOP) clean + +kbuild_install: install +kbuild: install_script_km diff --git a/drivers/gpu/rogue/build/linux/moduledefs/host_i386.mk b/drivers/gpu/rogue/build/linux/moduledefs/host_i386.mk new file mode 100644 index 000000000000..c07e86bb443e --- /dev/null +++ b/drivers/gpu/rogue/build/linux/moduledefs/host_i386.mk @@ -0,0 +1,57 @@ +########################################################################### ### +#@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 diff --git a/drivers/gpu/rogue/build/linux/moduledefs/host_x86_64.mk b/drivers/gpu/rogue/build/linux/moduledefs/host_x86_64.mk new file mode 100644 index 000000000000..cb1af1d6ce6f --- /dev/null +++ b/drivers/gpu/rogue/build/linux/moduledefs/host_x86_64.mk @@ -0,0 +1,57 @@ +########################################################################### ### +#@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 diff --git a/drivers/gpu/rogue/build/linux/moduledefs/target_aarch64.mk b/drivers/gpu/rogue/build/linux/moduledefs/target_aarch64.mk new file mode 100644 index 000000000000..20326f995995 --- /dev/null +++ b/drivers/gpu/rogue/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_SSL_ARCH := + +# 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/build/linux/moduledefs/target_armv7-a.mk b/drivers/gpu/rogue/build/linux/moduledefs/target_armv7-a.mk new file mode 100644 index 000000000000..abb169e97f22 --- /dev/null +++ b/drivers/gpu/rogue/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_SSL_ARCH := + +# 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/build/linux/moduledefs/target_i686.mk b/drivers/gpu/rogue/build/linux/moduledefs/target_i686.mk new file mode 100644 index 000000000000..8978f7897fcd --- /dev/null +++ b/drivers/gpu/rogue/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_SSL_ARCH := linux-generic32 + +# 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/build/linux/moduledefs/target_neutral.mk b/drivers/gpu/rogue/build/linux/moduledefs/target_neutral.mk new file mode 100644 index 000000000000..6b58e5e81387 --- /dev/null +++ b/drivers/gpu/rogue/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/build/linux/moduledefs/target_x86_64.mk b/drivers/gpu/rogue/build/linux/moduledefs/target_x86_64.mk new file mode 100644 index 000000000000..9eacfb0d31f4 --- /dev/null +++ b/drivers/gpu/rogue/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_SSL_ARCH := linux-x86_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/build/linux/moduledefs_common.mk b/drivers/gpu/rogue/build/linux/moduledefs_common.mk new file mode 100644 index 000000000000..9d0fbbf614d1 --- /dev/null +++ b/drivers/gpu/rogue/build/linux/moduledefs_common.mk @@ -0,0 +1,121 @@ +########################################################################### ### +#@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 := + +# 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)) + +# -l flags for each library. The rules are: +# - for all static libs, use -lfoo +# - for all in-tree or external libs, use $(libfoo_ldflags) if that +# variable is defined (empty counts as defined). Otherwise use +# -lfoo. +MODULE_LIBRARY_FLAGS := $(addprefix -l, $($(THIS_MODULE)_staticlibs)) $(addprefix -l,$($(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/build/linux/modules.mk b/drivers/gpu/rogue/build/linux/modules.mk new file mode 100644 index 000000000000..971f21a20a25 --- /dev/null +++ b/drivers/gpu/rogue/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/build/linux/modules/_objects.mk b/drivers/gpu/rogue/build/linux/modules/_objects.mk new file mode 100644 index 000000000000..ecfa56bdb1a7 --- /dev/null +++ b/drivers/gpu/rogue/build/linux/modules/_objects.mk @@ -0,0 +1,117 @@ +########################################################################### ### +#@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. +#@Description Common processing for all modules that compile code. +### ########################################################################### + +# Filter for source types +MODULE_C_SOURCES := $(filter %.c,$(MODULE_SOURCES)) +MODULE_CXX_SOURCES := $(call filter-cxx-files,$(MODULE_SOURCES)) + +MODULE_UNRECOGNISED_SOURCES := $(call filter-out-cxx-files,$(filter-out %.c,$(MODULE_SOURCES))) + +ifneq ($(strip $(MODULE_UNRECOGNISED_SOURCES)),) +$(error In makefile $(THIS_MAKEFILE): Module $(THIS_MODULE) specified source files with unrecognised suffixes: $(MODULE_UNRECOGNISED_SOURCES)) +endif + +# Objects built from MODULE_SOURCES +MODULE_C_OBJECTS := $(addprefix $(MODULE_INTERMEDIATES_DIR)/,$(notdir $(MODULE_C_SOURCES:.c=.o))) +MODULE_CXX_OBJECTS := $(addprefix $(MODULE_INTERMEDIATES_DIR)/,$(notdir $(call objects-from-cxx-files,$(MODULE_CXX_SOURCES)))) + +# MODULE_GENERATED_DEPENDENCIES are generated as a side effect of running the +# rules below, but if we wanted to generate .d files for things that GCC +# couldn't handle, we could add a rule with $(MODULE_GENERATED_DEPENDENCIES) +# as a target +MODULE_GENERATED_DEPENDENCIES := $(MODULE_C_OBJECTS:.o=.d) $(MODULE_CXX_OBJECTS:.o=.d) +-include $(MODULE_GENERATED_DEPENDENCIES) + +MODULE_DEPENDS := $(addprefix $(MODULE_OUT)/,$($(THIS_MODULE)_depends)) +MODULE_DEPENDS += $(addprefix $(GENERATED_CODE_OUT)/,$($(THIS_MODULE)_genheaders)) + +# Add any MODULE_OUT relative include flags here +MODULE_INCLUDE_FLAGS += $(addprefix -I $(MODULE_OUT)/, $($(THIS_MODULE)_includes_relative)) + +define rule-for-objects-o-from-one-c +$(1): MODULE_CC := $$(MODULE_CC) +$(1): MODULE_CFLAGS := $$(MODULE_CFLAGS) +$(1): MODULE_INCLUDE_FLAGS := $$(MODULE_INCLUDE_FLAGS) +$(1): MODULE_ALLOWED_CFLAGS := $$(MODULE_ALLOWED_CFLAGS) +$(1): THIS_MODULE := $$(THIS_MODULE) +ifneq ($(PKG_CONFIG_ENV_VAR),) +$(1): export PKG_CONFIG_TOP_BUILD_DIR := $(abspath $(MODULE_OUT)) +$(1): export $(PKG_CONFIG_ENV_VAR) := $(abspath $(MODULE_OUT)/lws_pkgconfig) +endif +$(1): $$(MODULE_DEPENDS) $$(THIS_MAKEFILE) +$(1): | $$(MODULE_INTERMEDIATES_DIR) +$(1): $(2) + @: $(if $(MODULE_CHECK_CFLAGS), + $(if $(filter-out $(MODULE_ALLOWED_CFLAGS),$($(THIS_MODULE)_cflags)),\ + $(error $(THIS_MODULE): LTO-incompatible cflag(s) used: \ + $(filter-out $(MODULE_ALLOWED_CFLAGS),$($(THIS_MODULE)_cflags))))) + $$(check-src) +ifeq ($(MODULE_HOST_BUILD),true) + $$(host-o-from-one-c) +else + $$(target-o-from-one-c) +endif +endef + +# This rule is used to compile C++ source files +define rule-for-objects-o-from-one-cxx +$(1): MODULE_CXX := $$(MODULE_CXX) +$(1): MODULE_CXXFLAGS := $$(MODULE_CXXFLAGS) +$(1): MODULE_INCLUDE_FLAGS := $$(MODULE_INCLUDE_FLAGS) +$(1): MODULE_ALLOWED_CFLAGS := $$(MODULE_ALLOWED_CFLAGS) +$(1): THIS_MODULE := $$(THIS_MODULE) +ifneq ($(PKG_CONFIG_ENV_VAR),) +$(1): export PKG_CONFIG_TOP_BUILD_DIR := $(abspath $(MODULE_OUT)) +$(1): export $(PKG_CONFIG_ENV_VAR) := $(abspath $(MODULE_OUT)/lws_pkgconfig) +endif +$(1): $$(MODULE_DEPENDS) $$(THIS_MAKEFILE) +$(1): | $$(MODULE_INTERMEDIATES_DIR) +$(1): $(2) + @: $(if $(MODULE_CHECK_CFLAGS), + $(if $(filter-out $(MODULE_ALLOWED_CFLAGS),$($(THIS_MODULE)_cxxflags)),\ + $(error $(THIS_MODULE): LTO-incompatible cxxflag(s) used: \ + $(filter-out $(MODULE_ALLOWED_CFLAGS),$($(THIS_MODULE)_cxxflags))))) +ifeq ($(MODULE_HOST_BUILD),true) + $$(host-o-from-one-cxx) +else + $$(target-o-from-one-cxx) +endif +endef diff --git a/drivers/gpu/rogue/build/linux/modules/kernel_module.mk b/drivers/gpu/rogue/build/linux/modules/kernel_module.mk new file mode 100644 index 000000000000..9a2ae69c49fe --- /dev/null +++ b/drivers/gpu/rogue/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/build/linux/pc_android/Makefile b/drivers/gpu/rogue/build/linux/pc_android/Makefile new file mode 100644 index 000000000000..996d13a8a8bb --- /dev/null +++ b/drivers/gpu/rogue/build/linux/pc_android/Makefile @@ -0,0 +1,139 @@ +########################################################################### ### +#@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.7.4.5 +RGX_BVNC ?= 1.82.4.5 + +include ../common/android/paths.mk +include ../common/android/arch.mk +include ../common/android/features.mk + +ifeq ($(SUPPORT_ADF),1) +ifneq ($(is_future_version),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/build/linux/prepare_tree.mk b/drivers/gpu/rogue/build/linux/prepare_tree.mk new file mode 100644 index 000000000000..d59314368ee3 --- /dev/null +++ b/drivers/gpu/rogue/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/build/linux/pvrversion.mk b/drivers/gpu/rogue/build/linux/pvrversion.mk new file mode 100644 index 000000000000..10c25f3ce072 --- /dev/null +++ b/drivers/gpu/rogue/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/build/linux/scripts.mk b/drivers/gpu/rogue/build/linux/scripts.mk new file mode 100644 index 000000000000..4b388a649be5 --- /dev/null +++ b/drivers/gpu/rogue/build/linux/scripts.mk @@ -0,0 +1,341 @@ +########################################################################### ### +#@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 \ + -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) + +# 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 + ifneq ($(filter pvr_dri,$(COMPONENTS)),) # This is a Wayland build + 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,rscompute,\ + -DSUPPORT_RSC=1)) +$(eval $(call if-component,librscruntime,\ + -DSUPPORT_RSC_RUNTIME=1)) +$(eval $(call if-component,librsccompiler,\ + -DSUPPORT_RSC_COMPILER=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,xmultiegltest,\ + -DSUPPORT_XUNITTESTS=1)) +$(eval $(call if-component,pvrgdb,\ + -DPVRGDB=1)) + +ifeq ($(PVR_REMOTE),1) + M4DEFS += -DPVR_REMOTE=1 +endif + +ifneq ($(filter pvr_dri,$(COMPONENTS)),) + M4DEFS += -DPVR_DRI_MODULE=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/build/linux/this_makefile.mk b/drivers/gpu/rogue/build/linux/this_makefile.mk new file mode 100644 index 000000000000..c31200123d0e --- /dev/null +++ b/drivers/gpu/rogue/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/build/linux/tools/cc-check.sh b/drivers/gpu/rogue/build/linux/tools/cc-check.sh new file mode 100755 index 000000000000..773a88f71118 --- /dev/null +++ b/drivers/gpu/rogue/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/build/linux/toplevel.mk b/drivers/gpu/rogue/build/linux/toplevel.mk new file mode 100644 index 000000000000..cb5d9d432938 --- /dev/null +++ b/drivers/gpu/rogue/build/linux/toplevel.mk @@ -0,0 +1,291 @@ +########################################################################### ### +#@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 + +ifeq ($(SUPPORT_NEUTRINO_PLATFORM),1) +include $(MAKE_TOP)/common/neutrino/subst_makefiles.mk +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_i386 +HOST_32BIT_ARCH := host_i386 +TARGET_PRIMARY_ARCH := target_i686 +TARGET_ALL_ARCH := target_i686 +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 + +# 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: + +# 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/config_kernel.h b/drivers/gpu/rogue/config_kernel.h new file mode 100644 index 000000000000..18168ff53db6 --- /dev/null +++ b/drivers/gpu/rogue/config_kernel.h @@ -0,0 +1,33 @@ +#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 PVR_SECURE_HANDLES +#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 SYS_USING_INTERRUPTS +#define CACHEFLUSH_TYPE CACHEFLUSH_GENERIC +#define SUPPORT_INSECURE_EXPORT +#define SUPPORT_SECURE_EXPORT +#define SUPPORT_GPUTRACE_EVENTS +#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_ENABLE_PROCESS_STATS +#define PVR_LINUX_PYSMEM_MAX_POOL_PAGES 10240 +#define PVR_LINUX_VMALLOC_ALLOCATION_THRESHOLD 16384 +#define ANDROID +#define PVR_ANDROID_NATIVE_WINDOW_HAS_SYNC diff --git a/drivers/gpu/rogue/config_kernel.mk b/drivers/gpu/rogue/config_kernel.mk new file mode 100644 index 000000000000..493cf06999d5 --- /dev/null +++ b/drivers/gpu/rogue/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/kernel +override KERNEL_ID := 3.10.0 +override KERNEL_COMPONENTS := srvkm +override KERNEL_CROSS_COMPILE := /work/zxl/project/rk3368/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin/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 BUILD := release +override DEBUGLINK := 1 +override CACHEFLUSH_TYPE := CACHEFLUSH_GENERIC +override SUPPORT_INSECURE_EXPORT := 1 +override SUPPORT_SECURE_EXPORT := 1 +override SUPPORT_GPUTRACE_EVENTS := 1 +override OPTIM := -O2 +override PVR_HANDLE_BACKEND := generic +override SUPPORT_ANDROID_PLATFORM := 1 +override PVR_ANDROID_NATIVE_WINDOW_HAS_SYNC := 1 diff --git a/drivers/gpu/rogue/dc_fbdev/Kbuild.mk b/drivers/gpu/rogue/dc_fbdev/Kbuild.mk new file mode 100644 index 000000000000..3c2cb4f865fa --- /dev/null +++ b/drivers/gpu/rogue/dc_fbdev/Kbuild.mk @@ -0,0 +1,49 @@ +########################################################################### ### +#@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)/services/3rdparty/dc_fbdev + +dc_fbdev-y += \ + services/3rdparty/dc_fbdev/dc_fbdev.o + +ifneq ($(W),1) +#CFLAGS_dc_fbdev.o := -Werror +endif diff --git a/drivers/gpu/rogue/dc_fbdev/Linux.mk b/drivers/gpu/rogue/dc_fbdev/Linux.mk new file mode 100644 index 000000000000..05a7e15c1934 --- /dev/null +++ b/drivers/gpu/rogue/dc_fbdev/Linux.mk @@ -0,0 +1,45 @@ +########################################################################### ### +#@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 := dc_fbdev + +dc_fbdev_type := kernel_module +dc_fbdev_target := dc_fbdev.ko +dc_fbdev_makefile := $(THIS_DIR)/Kbuild.mk diff --git a/drivers/gpu/rogue/dc_fbdev/dc_fbdev.c b/drivers/gpu/rogue/dc_fbdev/dc_fbdev.c new file mode 100755 index 000000000000..c8f5e3de0a0d --- /dev/null +++ b/drivers/gpu/rogue/dc_fbdev/dc_fbdev.c @@ -0,0 +1,893 @@ +/*************************************************************************/ /*! +@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. +*/ /**************************************************************************/ + +#include +#include +#include +#include + +#include "kerneldisplay.h" +#include "imgpixfmts_km.h" +#include "pvrmodule.h" /* for MODULE_LICENSE() */ + +#if !defined(CONFIG_FB) +#error dc_fbdev needs Linux framebuffer support. Enable it in your kernel. +#endif + +#define DRVNAME "dc_fbdev" +#define DC_PHYS_HEAP_ID 0 +#define MAX_COMMANDS_IN_FLIGHT 2 + +#if defined(DC_FBDEV_NUM_PREFERRED_BUFFERS) +#define NUM_PREFERRED_BUFFERS DC_FBDEV_NUM_PREFERRED_BUFFERS +#else +#define NUM_PREFERRED_BUFFERS 2 +#endif + +#define FALLBACK_REFRESH_RATE 60 +#define FALLBACK_DPI 160 + +struct fb_var_screeninfo sDefaultVar; //chenli: store default fb_var_screeninfo + +typedef struct +{ + IMG_HANDLE hSrvHandle; + IMG_UINT32 ePixFormat; + struct fb_info *psLINFBInfo; + bool bCanFlip; +} +DC_FBDEV_DEVICE; + +typedef struct +{ + DC_FBDEV_DEVICE *psDeviceData; + IMG_HANDLE hLastConfigData; + IMG_UINT32 ui32AllocUseMask; +} +DC_FBDEV_CONTEXT; + +typedef struct +{ + DC_FBDEV_CONTEXT *psDeviceContext; + IMG_UINT32 ui32Width; + IMG_UINT32 ui32Height; + IMG_UINT32 ui32ByteStride; + IMG_UINT32 ui32BufferID; +} +DC_FBDEV_BUFFER; + +MODULE_SUPPORTED_DEVICE(DEVNAME); + +static DC_FBDEV_DEVICE *gpsDeviceData; + +#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,29)) +static inline void console_lock(void) +{ + acquire_console_sem(); +} + +static inline void console_unlock(void) +{ + release_console_sem(); +} +#endif + +static +void DC_FBDEV_GetInfo(IMG_HANDLE hDeviceData, + DC_DISPLAY_INFO *psDisplayInfo) +{ + PVR_UNREFERENCED_PARAMETER(hDeviceData); + + strncpy(psDisplayInfo->szDisplayName, DRVNAME " 1", DC_NAME_SIZE); + + psDisplayInfo->ui32MinDisplayPeriod = 0; + psDisplayInfo->ui32MaxDisplayPeriod = 1; + psDisplayInfo->ui32MaxPipes = 1; + psDisplayInfo->bUnlatchedSupported = IMG_FALSE; +} + +static +PVRSRV_ERROR DC_FBDEV_PanelQueryCount(IMG_HANDLE hDeviceData, + IMG_UINT32 *pui32NumPanels) +{ + PVR_UNREFERENCED_PARAMETER(hDeviceData); + *pui32NumPanels = 1; + return PVRSRV_OK; +} + +static +PVRSRV_ERROR DC_FBDEV_PanelQuery(IMG_HANDLE hDeviceData, + IMG_UINT32 ui32PanelsArraySize, + IMG_UINT32 *pui32NumPanels, + PVRSRV_PANEL_INFO *psPanelInfo) +{ + DC_FBDEV_DEVICE *psDeviceData = hDeviceData; + struct fb_var_screeninfo *psVar = &psDeviceData->psLINFBInfo->var; + struct fb_var_screeninfo sVar = { .pixclock = 0 }; + + if(!lock_fb_info(psDeviceData->psLINFBInfo)) + return PVRSRV_ERROR_RETRY; + + *pui32NumPanels = 1; + + psPanelInfo[0].sSurfaceInfo.sFormat.ePixFormat = psDeviceData->ePixFormat; + psPanelInfo[0].sSurfaceInfo.sDims.ui32Width = psVar->xres; + psPanelInfo[0].sSurfaceInfo.sDims.ui32Height = psVar->yres; + psPanelInfo[0].sSurfaceInfo.sFormat.eMemLayout = PVRSRV_SURFACE_MEMLAYOUT_STRIDED; + psPanelInfo[0].sSurfaceInfo.sFormat.u.sFBCLayout.eFBCompressionMode = FB_COMPRESSION_NONE; + + /* Conformant fbdev drivers should have `var' and mode in sync by now, + * but some don't (like drmfb), so try a couple of different ways to + * get the info before falling back to the default. + */ + if(psVar->xres > 0 && psVar->yres > 0 && psVar->pixclock > 0) + sVar = *psVar; + else if(psDeviceData->psLINFBInfo->mode) + fb_videomode_to_var(&sVar, psDeviceData->psLINFBInfo->mode); + + /* Override the refresh rate when defined. */ +#ifdef DC_FBDEV_REFRESH + psPanelInfo[0].ui32RefreshRate = DC_FBDEV_REFRESH; +#else + if(sVar.xres > 0 && sVar.yres > 0 && sVar.pixclock > 0) + { + psPanelInfo[0].ui32RefreshRate = 1000000000LU / + ((sVar.upper_margin + sVar.lower_margin + + sVar.yres + sVar.vsync_len) * + (sVar.left_margin + sVar.right_margin + + sVar.xres + sVar.hsync_len) * + (sVar.pixclock / 1000)); + } + else + psPanelInfo[0].ui32RefreshRate = FALLBACK_REFRESH_RATE; +#endif + + psPanelInfo[0].ui32XDpi = + ((int)sVar.width > 0) ? (254000 / sVar.width * psVar->xres / 10000) : FALLBACK_DPI; + + psPanelInfo[0].ui32YDpi = + ((int)sVar.height > 0) ? 254000 / sVar.height * psVar->yres / 10000 : FALLBACK_DPI; + + unlock_fb_info(psDeviceData->psLINFBInfo); + return PVRSRV_OK; +} + +static +PVRSRV_ERROR DC_FBDEV_FormatQuery(IMG_HANDLE hDeviceData, + IMG_UINT32 ui32NumFormats, + PVRSRV_SURFACE_FORMAT *pasFormat, + IMG_UINT32 *pui32Supported) +{ + DC_FBDEV_DEVICE *psDeviceData = hDeviceData; + int i; + + for(i = 0; i < ui32NumFormats; i++) + { + pui32Supported[i] = 0; + + if(pasFormat[i].ePixFormat == psDeviceData->ePixFormat) + pui32Supported[i]++; + } + + return PVRSRV_OK; +} + +static +PVRSRV_ERROR DC_FBDEV_DimQuery(IMG_HANDLE hDeviceData, + IMG_UINT32 ui32NumDims, + PVRSRV_SURFACE_DIMS *psDim, + IMG_UINT32 *pui32Supported) +{ + DC_FBDEV_DEVICE *psDeviceData = hDeviceData; + struct fb_var_screeninfo *psVar = &psDeviceData->psLINFBInfo->var; + int i; + + if(!lock_fb_info(psDeviceData->psLINFBInfo)) + return PVRSRV_ERROR_RETRY; + + for(i = 0; i < ui32NumDims; i++) + { + pui32Supported[i] = 0; + + if(psDim[i].ui32Width == psVar->xres && + psDim[i].ui32Height == psVar->yres) + pui32Supported[i]++; + } + + unlock_fb_info(psDeviceData->psLINFBInfo); + return PVRSRV_OK; +} + +static +PVRSRV_ERROR DC_FBDEV_ContextCreate(IMG_HANDLE hDeviceData, + IMG_HANDLE *hDisplayContext) +{ + DC_FBDEV_CONTEXT *psDeviceContext; + PVRSRV_ERROR eError = PVRSRV_OK; + + psDeviceContext = kzalloc(sizeof(DC_FBDEV_CONTEXT), GFP_KERNEL); + if(!psDeviceContext) + { + eError = PVRSRV_ERROR_OUT_OF_MEMORY; + goto err_out; + } + + psDeviceContext->psDeviceData = hDeviceData; + *hDisplayContext = psDeviceContext; + +err_out: + return eError; +} + +static PVRSRV_ERROR +DC_FBDEV_ContextConfigureCheck(IMG_HANDLE hDisplayContext, + IMG_UINT32 ui32PipeCount, + PVRSRV_SURFACE_CONFIG_INFO *pasSurfAttrib, + IMG_HANDLE *ahBuffers) +{ + DC_FBDEV_CONTEXT *psDeviceContext = hDisplayContext; + DC_FBDEV_DEVICE *psDeviceData = psDeviceContext->psDeviceData; + struct fb_var_screeninfo *psVar = &psDeviceData->psLINFBInfo->var; + DC_FBDEV_BUFFER *psBuffer; + PVRSRV_ERROR eError; + + if(ui32PipeCount != 1) + { + eError = PVRSRV_ERROR_DC_TOO_MANY_PIPES; + goto err_out; + } + + if(!ahBuffers) + { + eError = PVRSRV_ERROR_DC_INVALID_CONFIG; + goto err_out; + } + + if(!lock_fb_info(psDeviceData->psLINFBInfo)) + { + eError = PVRSRV_ERROR_RETRY; + goto err_out; + } + + psBuffer = ahBuffers[0]; + + if(pasSurfAttrib[0].sCrop.sDims.ui32Width != psVar->xres || + pasSurfAttrib[0].sCrop.sDims.ui32Height != psVar->yres || + pasSurfAttrib[0].sCrop.i32XOffset != 0 || + pasSurfAttrib[0].sCrop.i32YOffset != 0) + { + eError = PVRSRV_ERROR_DC_INVALID_CROP_RECT; + goto err_unlock; + } + + if(pasSurfAttrib[0].sDisplay.sDims.ui32Width != + pasSurfAttrib[0].sCrop.sDims.ui32Width || + pasSurfAttrib[0].sDisplay.sDims.ui32Height != + pasSurfAttrib[0].sCrop.sDims.ui32Height || + pasSurfAttrib[0].sDisplay.i32XOffset != + pasSurfAttrib[0].sCrop.i32XOffset || + pasSurfAttrib[0].sDisplay.i32YOffset != + pasSurfAttrib[0].sCrop.i32YOffset) + { + eError = PVRSRV_ERROR_DC_INVALID_DISPLAY_RECT; + goto err_unlock; + } + + if(psBuffer->ui32Width != psVar->xres && + psBuffer->ui32Height != psVar->yres) + { + eError = PVRSRV_ERROR_DC_INVALID_BUFFER_DIMS; + goto err_unlock; + } + + eError = PVRSRV_OK; +err_unlock: + unlock_fb_info(psDeviceData->psLINFBInfo); +err_out: + return eError; +} + +static int DumpFbInfo( struct fb_var_screeninfo *info) +{ +#if 0 + printk("dump: vir[%d,%d] [%d,%d,%d,%d] format=%d \n", + info->xres_virtual,info->yres_virtual, + info->xoffset, + info->yoffset, + info->xres, + info->yres, + (info->nonstd & 0xff)); +#endif + return 0; +} + +static +void DC_FBDEV_ContextConfigure(IMG_HANDLE hDisplayContext, + IMG_UINT32 ui32PipeCount, + PVRSRV_SURFACE_CONFIG_INFO *pasSurfAttrib, + IMG_HANDLE *ahBuffers, + IMG_UINT32 ui32DisplayPeriod, + IMG_HANDLE hConfigData) +{ + DC_FBDEV_CONTEXT *psDeviceContext = hDisplayContext; + DC_FBDEV_DEVICE *psDeviceData = psDeviceContext->psDeviceData; + struct fb_var_screeninfo sVar = psDeviceData->psLINFBInfo->var; + int err; + IMG_BOOL bReset=false; + + PVR_UNREFERENCED_PARAMETER(ui32PipeCount); + PVR_UNREFERENCED_PARAMETER(pasSurfAttrib); + PVR_UNREFERENCED_PARAMETER(ui32DisplayPeriod); + + if(psDeviceContext->hLastConfigData) + DCDisplayConfigurationRetired(psDeviceContext->hLastConfigData); + + sVar.yoffset = 0; + + //chenli: if current FB's format is not RGBX_8888, reset fb_var_screeninfo + if((sVar.nonstd & 0xff) != (sDefaultVar.nonstd & 0xff)) + { + DumpFbInfo(&sDefaultVar); + sVar = sDefaultVar; + bReset = true; + } + + if(ui32PipeCount == 0) + { + /* If the pipe count is zero, we're tearing down. Don't record + * any new configurations, but still allow the display to pan + * back to buffer 0. + */ + psDeviceContext->hLastConfigData = IMG_NULL; + + /* + We still need to "retire" this NULL flip as that signals back to + the DC core that we've finished doing what we need to do + and it can destroy the display context + */ + DCDisplayConfigurationRetired(hConfigData); + } + else + { + BUG_ON(ahBuffers == IMG_NULL); + + if(psDeviceData->bCanFlip) + { + DC_FBDEV_BUFFER *psBuffer = ahBuffers[0]; + sVar.yoffset = sVar.yres * psBuffer->ui32BufferID; + } + + psDeviceContext->hLastConfigData = hConfigData; + } + + if(lock_fb_info(psDeviceData->psLINFBInfo) || bReset) + { + console_lock(); + + /* If we're supposed to be able to flip, but the yres_virtual + * has been changed to an unsupported (smaller) value, we need + * to change it back (this is a workaround for some Linux fbdev + * drivers that seem to lose any modifications to yres_virtual + * after a blank.) + */ + if((psDeviceData->bCanFlip && + sVar.yres_virtual < sVar.yres * NUM_PREFERRED_BUFFERS) || bReset) + { + sVar.activate = FB_ACTIVATE_NOW; + sVar.yres_virtual = sVar.yres * NUM_PREFERRED_BUFFERS; + +#if 0 + //chenli: if the virtual screen resolution not changed, res_virtual should not be changed + if(bReset == false) + { + sVar.xres_virtual = sVar.xres; + sVar.yres_virtual = sVar.yoffset + sVar.yres; + } +#endif + + err = fb_set_var(psDeviceData->psLINFBInfo, &sVar); + if(err) + pr_err("fb_set_var failed (err=%d)\n", err); + } + else + { + err = fb_pan_display(psDeviceData->psLINFBInfo, &sVar); + if(err) + pr_err("fb_pan_display failed (err=%d)\n", err); + } + + console_unlock(); + unlock_fb_info(psDeviceData->psLINFBInfo); + } +} + +static +void DC_FBDEV_ContextDestroy(IMG_HANDLE hDisplayContext) +{ + DC_FBDEV_CONTEXT *psDeviceContext = hDisplayContext; + + BUG_ON(psDeviceContext->hLastConfigData != IMG_NULL); + kfree(psDeviceContext); +} + +static +IMG_BOOL DC_FBDEV_GetBufferID(DC_FBDEV_CONTEXT *psDeviceContext, IMG_UINT32 *pui32BufferID) +{ + IMG_UINT32 ui32BufferID; + + /* If we don't support flipping, allow this code to give every + * allocated buffer the same ID. This means that the display + * won't be panned, and the same page list will be used for + * every allocation. + */ + if (!psDeviceContext->psDeviceData->bCanFlip) + { + *pui32BufferID = 0; + return IMG_TRUE; + } + + for (ui32BufferID = 0; ui32BufferID < NUM_PREFERRED_BUFFERS; ++ui32BufferID) + { + if ((psDeviceContext->ui32AllocUseMask & (1UL << ui32BufferID)) == 0) + { + psDeviceContext->ui32AllocUseMask |= (1UL << ui32BufferID); + + *pui32BufferID = ui32BufferID; + + return IMG_TRUE; + } + } + return IMG_FALSE; +} + +static +void DC_FBDEV_PutBufferID(DC_FBDEV_CONTEXT *psDeviceContext, IMG_UINT32 ui32BufferID) +{ + psDeviceContext->ui32AllocUseMask &= ~(1UL << ui32BufferID); +} + +#define BYTE_TO_PAGES(range) (((range) + (PAGE_SIZE - 1)) >> PAGE_SHIFT) + +static +PVRSRV_ERROR DC_FBDEV_BufferAlloc(IMG_HANDLE hDisplayContext, + DC_BUFFER_CREATE_INFO *psCreateInfo, + IMG_DEVMEM_LOG2ALIGN_T *puiLog2PageSize, + IMG_UINT32 *pui32PageCount, + IMG_UINT32 *pui32PhysHeapID, + IMG_UINT32 *pui32ByteStride, + IMG_HANDLE *phBuffer) +{ + DC_FBDEV_CONTEXT *psDeviceContext = hDisplayContext; + DC_FBDEV_DEVICE *psDeviceData = psDeviceContext->psDeviceData; + PVRSRV_SURFACE_INFO *psSurfInfo = &psCreateInfo->sSurface; + PVRSRV_ERROR eError; + DC_FBDEV_BUFFER *psBuffer; + IMG_UINT32 ui32ByteSize; + + if (psSurfInfo->sFormat.ePixFormat != psDeviceData->ePixFormat) + { + eError = PVRSRV_ERROR_UNSUPPORTED_PIXEL_FORMAT; + goto err_out; + } + + psBuffer = kmalloc(sizeof(DC_FBDEV_BUFFER), GFP_KERNEL); + if (!psBuffer) + { + eError = PVRSRV_ERROR_OUT_OF_MEMORY; + goto err_out; + } + + psBuffer->psDeviceContext = psDeviceContext; + psBuffer->ui32ByteStride = + psSurfInfo->sDims.ui32Width * psCreateInfo->ui32BPP; + + psBuffer->ui32Width = psSurfInfo->sDims.ui32Width; + psBuffer->ui32Height = psSurfInfo->sDims.ui32Height; + + if (!DC_FBDEV_GetBufferID(psDeviceContext, &psBuffer->ui32BufferID)) + { + eError = PVRSRV_ERROR_OUT_OF_MEMORY; + goto err_free; + } + + ui32ByteSize = psBuffer->ui32ByteStride * psBuffer->ui32Height; + + *puiLog2PageSize = PAGE_SHIFT; + *pui32PageCount = BYTE_TO_PAGES(ui32ByteSize); + *pui32PhysHeapID = DC_PHYS_HEAP_ID; + *pui32ByteStride = psBuffer->ui32ByteStride; + *phBuffer = psBuffer; + + return PVRSRV_OK; + +err_free: + kfree(psBuffer); + +err_out: + return eError; +} + +static +PVRSRV_ERROR DC_FBDEV_BufferAcquire(IMG_HANDLE hBuffer, + IMG_DEV_PHYADDR *pasDevPAddr, + IMG_PVOID *ppvLinAddr) +{ + DC_FBDEV_BUFFER *psBuffer = hBuffer; + DC_FBDEV_DEVICE *psDeviceData = psBuffer->psDeviceContext->psDeviceData; + IMG_UINT32 ui32ByteSize = psBuffer->ui32ByteStride * psBuffer->ui32Height; + IMG_UINTPTR_T uiStartAddr; + IMG_UINT32 i, ui32MaxLen; + + uiStartAddr = psDeviceData->psLINFBInfo->fix.smem_start + + psBuffer->ui32BufferID * ui32ByteSize; + + ui32MaxLen = psDeviceData->psLINFBInfo->fix.smem_len - + psBuffer->ui32BufferID * ui32ByteSize; + + for (i = 0; i < BYTE_TO_PAGES(ui32ByteSize); i++) + { + BUG_ON(i * PAGE_SIZE >= ui32MaxLen); + pasDevPAddr[i].uiAddr = uiStartAddr + (i * PAGE_SIZE); + } + + /* We're UMA, so services will do the right thing and make + * its own CPU virtual address mapping for the buffer. + */ + *ppvLinAddr = IMG_NULL; + + return PVRSRV_OK; +} + +static void DC_FBDEV_BufferRelease(IMG_HANDLE hBuffer) +{ + PVR_UNREFERENCED_PARAMETER(hBuffer); +} + +static void DC_FBDEV_BufferFree(IMG_HANDLE hBuffer) +{ + DC_FBDEV_BUFFER *psBuffer = hBuffer; + + DC_FBDEV_PutBufferID(psBuffer->psDeviceContext, psBuffer->ui32BufferID); + + kfree(psBuffer); +} + +/* If we can flip, we need to make sure we have the memory to do so. + * + * We'll assume that the fbdev device provides extra space in + * yres_virtual for panning; xres_virtual is theoretically supported, + * but it involves more work. + * + * If the fbdev device doesn't have yres_virtual > yres, we'll try + * requesting it before bailing. Userspace applications commonly do + * this with an FBIOPUT_VSCREENINFO ioctl(). + * + * Another problem is with a limitation in the services DC -- it + * needs framebuffers to be page aligned (this is a SW limitation, + * the HW can support non-page-aligned buffers). So we have to + * check that stride * height for a single buffer is page aligned. + */ + +static bool DC_FBDEV_FlipPossible(struct fb_info *psLINFBInfo) +{ + struct fb_var_screeninfo sVar = psLINFBInfo->var; + int err; + + if(!psLINFBInfo->fix.xpanstep && !psLINFBInfo->fix.ypanstep && + !psLINFBInfo->fix.ywrapstep) + { + pr_err("The fbdev device detected does not support ypan/ywrap. " + "Flipping disabled.\n"); + return false; + } + + if((psLINFBInfo->fix.line_length * sVar.yres) % PAGE_SIZE != 0) + { + pr_err("Line length (in bytes) x yres is not a multiple of " + "page size. Flipping disabled.\n"); + return false; + } + + /* We might already have enough space */ + if(sVar.yres * NUM_PREFERRED_BUFFERS <= sVar.yres_virtual) + return true; + + pr_err("No buffer space for flipping; asking for more.\n"); + pr_err("sVar.yres=%d,sVar.yres_virtual=%d",sVar.yres,sVar.yres_virtual); + + //zxl:if open it,will lead to penguin Logo show error +#if 0 + if((sVar.nonstd & 0xff) != (sDefaultVar.nonstd & 0xff)) + { + DumpFbInfo(&sDefaultVar); + sVar = sDefaultVar; + } +#endif + + sVar.activate = FB_ACTIVATE_NOW; + sVar.yres_virtual = sVar.yres * NUM_PREFERRED_BUFFERS; + err = fb_set_var(psLINFBInfo, &sVar); + if(err) + { + pr_err("fb_set_var failed (err=%d). Flipping disabled.\n", err); + return false; + } + + if(sVar.yres * NUM_PREFERRED_BUFFERS > sVar.yres_virtual) + { + pr_err("Failed to obtain additional buffer space. " + "Flipping disabled.\n"); + return false; + } + + /* Some fbdev drivers allow the yres_virtual modification through, + * but don't actually update the fix. We need the fix to be updated + * and more memory allocated, so we can actually take advantage of + * the increased yres_virtual. + */ + if(psLINFBInfo->fix.smem_len < psLINFBInfo->fix.line_length * sVar.yres_virtual) + { + pr_err("'fix' not re-allocated with sufficient buffer space. " + "Flipping disabled.\n"); + return false; + } + + return true; +} + +static int __init DC_FBDEV_init(void) +{ + static DC_DEVICE_FUNCTIONS sDCFunctions = + { + .pfnGetInfo = DC_FBDEV_GetInfo, + .pfnPanelQueryCount = DC_FBDEV_PanelQueryCount, + .pfnPanelQuery = DC_FBDEV_PanelQuery, + .pfnFormatQuery = DC_FBDEV_FormatQuery, + .pfnDimQuery = DC_FBDEV_DimQuery, + .pfnSetBlank = IMG_NULL, + .pfnSetVSyncReporting = IMG_NULL, + .pfnLastVSyncQuery = IMG_NULL, + .pfnContextCreate = DC_FBDEV_ContextCreate, + .pfnContextDestroy = DC_FBDEV_ContextDestroy, + .pfnContextConfigure = DC_FBDEV_ContextConfigure, + .pfnContextConfigureCheck = DC_FBDEV_ContextConfigureCheck, + .pfnBufferAlloc = DC_FBDEV_BufferAlloc, + .pfnBufferAcquire = DC_FBDEV_BufferAcquire, + .pfnBufferRelease = DC_FBDEV_BufferRelease, + .pfnBufferFree = DC_FBDEV_BufferFree, + }; + + struct fb_info *psLINFBInfo; + IMG_PIXFMT ePixFormat; + int err = -ENODEV; + + psLINFBInfo = registered_fb[0]; + if(!psLINFBInfo) + { + pr_err("No Linux framebuffer (fbdev) device is registered!\n" + "Check you have a framebuffer driver compiled into your " + "kernel\nand that it is enabled on the cmdline.\n"); + goto err_out; + } + + if(!lock_fb_info(psLINFBInfo)) + goto err_out; + + console_lock(); + + /* Filter out broken FB devices */ + if(!psLINFBInfo->fix.smem_len || !psLINFBInfo->fix.line_length) + { + pr_err("The fbdev device detected had a zero smem_len or " + "line_length,\nwhich suggests it is a broken driver.\n"); + goto err_unlock; + } + + if(psLINFBInfo->fix.type != FB_TYPE_PACKED_PIXELS || + psLINFBInfo->fix.visual != FB_VISUAL_TRUECOLOR) + { + pr_err("The fbdev device detected is not truecolor with packed " + "pixels.\n"); + goto err_unlock; + } + +#if 1 + /*chenli: If FB uses RGB888 format after boot logo, + the value we need should be caculated with the RGB888 format + */ + if(psLINFBInfo->var.bits_per_pixel ==16) + { + psLINFBInfo->var.bits_per_pixel = 32; + psLINFBInfo->var.red.length = 8; + psLINFBInfo->var.green.length = 8; + psLINFBInfo->var.blue.length = 8 ; + psLINFBInfo->var.red.offset = 16; + psLINFBInfo->var.green.offset = 8; + psLINFBInfo->var.blue.offset = 0; + psLINFBInfo->var.red.msb_right = 0; + psLINFBInfo->fix.line_length *= 2; + } +#endif + + if(psLINFBInfo->var.bits_per_pixel == 32) + { + if(psLINFBInfo->var.red.length != 8 || + psLINFBInfo->var.green.length != 8 || + psLINFBInfo->var.blue.length != 8 || + psLINFBInfo->var.red.offset != 16 || + psLINFBInfo->var.green.offset != 8 || + psLINFBInfo->var.blue.offset != 0) + { + pr_err("The fbdev device detected uses an unrecognized " + "32bit pixel format (%u/%u/%u, %u/%u/%u)\n", + psLINFBInfo->var.red.length, + psLINFBInfo->var.green.length, + psLINFBInfo->var.blue.length, + psLINFBInfo->var.red.offset, + psLINFBInfo->var.green.offset, + psLINFBInfo->var.blue.offset); + goto err_unlock; + } +#if defined(DC_FBDEV_FORCE_XRGB8888) + ePixFormat = IMG_PIXFMT_B8G8R8X8_UNORM; +#else + ePixFormat = IMG_PIXFMT_B8G8R8A8_UNORM; +#endif + } + else if(psLINFBInfo->var.bits_per_pixel == 16) + { + if(psLINFBInfo->var.red.length != 5 || + psLINFBInfo->var.green.length != 6 || + psLINFBInfo->var.blue.length != 5 || + psLINFBInfo->var.red.offset != 11 || + psLINFBInfo->var.green.offset != 5 || + psLINFBInfo->var.blue.offset != 0) + { + pr_err("The fbdev device detected uses an unrecognized " + "16bit pixel format (%u/%u/%u, %u/%u/%u)\n", + psLINFBInfo->var.red.length, + psLINFBInfo->var.green.length, + psLINFBInfo->var.blue.length, + psLINFBInfo->var.red.offset, + psLINFBInfo->var.green.offset, + psLINFBInfo->var.blue.offset); + goto err_unlock; + } + ePixFormat = IMG_PIXFMT_B5G6R5_UNORM; + } + else + { + pr_err("The fbdev device detected uses an unsupported " + "bpp (%u).\n", psLINFBInfo->var.bits_per_pixel); + goto err_unlock; + } +#if 1 + //save defalut fb info + sDefaultVar = psLINFBInfo->var; + sDefaultVar.reserved[0] = 0; + sDefaultVar.reserved[1] = 0; + sDefaultVar.reserved[2] = 0; + sDefaultVar.yres_virtual = sDefaultVar.yres * 3; + sDefaultVar.nonstd &= 0xffffff00; + sDefaultVar.nonstd |= 5; //zxl:to match ePixFormat=IMG_PIXFMT_B8G8R8A8_UNORM + sDefaultVar.grayscale &= 0xff; + sDefaultVar.grayscale |= (sDefaultVar.xres<<8) + (sDefaultVar.yres<<20); + sDefaultVar.activate = FB_ACTIVATE_NOW; + sDefaultVar.yres_virtual = sDefaultVar.yres * NUM_PREFERRED_BUFFERS; +#endif + + if(!try_module_get(psLINFBInfo->fbops->owner)) + { + pr_err("try_module_get() failed"); + goto err_unlock; + } + + if(psLINFBInfo->fbops->fb_open && + psLINFBInfo->fbops->fb_open(psLINFBInfo, 0) != 0) + { + pr_err("fb_open() failed"); + goto err_module_put; + } + + gpsDeviceData = kmalloc(sizeof(DC_FBDEV_DEVICE), GFP_KERNEL); + if(!gpsDeviceData) + goto err_module_put; + + gpsDeviceData->psLINFBInfo = psLINFBInfo; + gpsDeviceData->ePixFormat = ePixFormat; + + if(DCRegisterDevice(&sDCFunctions, + MAX_COMMANDS_IN_FLIGHT, + gpsDeviceData, + &gpsDeviceData->hSrvHandle) != PVRSRV_OK) + goto err_kfree; + + gpsDeviceData->bCanFlip = DC_FBDEV_FlipPossible(psLINFBInfo); + + pr_info("Found usable fbdev device (%s):\n" + "range (physical) = 0x%lx-0x%lx\n" + "size (bytes) = 0x%x\n" + "xres x yres = %ux%u\n" + "xres x yres (v) = %ux%u\n" + "img pix fmt = %u\n" + "flipping? = %d\n", + psLINFBInfo->fix.id, + psLINFBInfo->fix.smem_start, + psLINFBInfo->fix.smem_start + psLINFBInfo->fix.smem_len, + psLINFBInfo->fix.smem_len, + psLINFBInfo->var.xres, psLINFBInfo->var.yres, + psLINFBInfo->var.xres_virtual, psLINFBInfo->var.yres_virtual, + ePixFormat, gpsDeviceData->bCanFlip); + err = 0; +err_unlock: + console_unlock(); + unlock_fb_info(psLINFBInfo); +err_out: + return err; +err_kfree: + kfree(gpsDeviceData); +err_module_put: + module_put(psLINFBInfo->fbops->owner); + goto err_unlock; +} + +static void __exit DC_FBDEV_exit(void) +{ + DC_FBDEV_DEVICE *psDeviceData = gpsDeviceData; + struct fb_info *psLINFBInfo = psDeviceData->psLINFBInfo; + + lock_fb_info(psLINFBInfo); + console_lock(); + + if(psLINFBInfo->fbops->fb_release) + psLINFBInfo->fbops->fb_release(psLINFBInfo, 0); + + module_put(psLINFBInfo->fbops->owner); + + console_unlock(); + unlock_fb_info(psLINFBInfo); + + DCUnregisterDevice(psDeviceData->hSrvHandle); + kfree(psDeviceData); +} + +module_init(DC_FBDEV_init); +module_exit(DC_FBDEV_exit); diff --git a/drivers/gpu/rogue/generated/breakpoint_bridge/common_breakpoint_bridge.h b/drivers/gpu/rogue/generated/breakpoint_bridge/common_breakpoint_bridge.h new file mode 100644 index 000000000000..4a4665255498 --- /dev/null +++ b/drivers/gpu/rogue/generated/breakpoint_bridge/common_breakpoint_bridge.h @@ -0,0 +1,157 @@ +/*************************************************************************/ /*! +@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 "rgx_bridge.h" + + +#include "pvr_bridge_io.h" + +#define PVRSRV_BRIDGE_BREAKPOINT_CMD_FIRST (PVRSRV_BRIDGE_BREAKPOINT_START) +#define PVRSRV_BRIDGE_BREAKPOINT_RGXSETBREAKPOINT PVRSRV_IOWR(PVRSRV_BRIDGE_BREAKPOINT_CMD_FIRST+0) +#define PVRSRV_BRIDGE_BREAKPOINT_RGXCLEARBREAKPOINT PVRSRV_IOWR(PVRSRV_BRIDGE_BREAKPOINT_CMD_FIRST+1) +#define PVRSRV_BRIDGE_BREAKPOINT_RGXENABLEBREAKPOINT PVRSRV_IOWR(PVRSRV_BRIDGE_BREAKPOINT_CMD_FIRST+2) +#define PVRSRV_BRIDGE_BREAKPOINT_RGXDISABLEBREAKPOINT PVRSRV_IOWR(PVRSRV_BRIDGE_BREAKPOINT_CMD_FIRST+3) +#define PVRSRV_BRIDGE_BREAKPOINT_RGXOVERALLOCATEBPREGISTERS PVRSRV_IOWR(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/generated/breakpoint_bridge/server_breakpoint_bridge.c b/drivers/gpu/rogue/generated/breakpoint_bridge/server_breakpoint_bridge.c new file mode 100644 index 000000000000..f2cb78e1ba26 --- /dev/null +++ b/drivers/gpu/rogue/generated/breakpoint_bridge/server_breakpoint_bridge.c @@ -0,0 +1,371 @@ +/*************************************************************************/ /*! +@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 + +/* *************************************************************************** + * Bridge proxy functions + */ + + + +/* *************************************************************************** + * Server-side bridge entry points + */ + +static IMG_INT +PVRSRVBridgeRGXSetBreakpoint(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_RGXSETBREAKPOINT *psRGXSetBreakpointIN, + PVRSRV_BRIDGE_OUT_RGXSETBREAKPOINT *psRGXSetBreakpointOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevNodeInt = IMG_NULL; + IMG_HANDLE hPrivDataInt = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_BREAKPOINT_RGXSETBREAKPOINT); + + + + + + { + /* Look up the address from the handle */ + psRGXSetBreakpointOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &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_HANDLE *) &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 ui32BridgeID, + PVRSRV_BRIDGE_IN_RGXCLEARBREAKPOINT *psRGXClearBreakpointIN, + PVRSRV_BRIDGE_OUT_RGXCLEARBREAKPOINT *psRGXClearBreakpointOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevNodeInt = IMG_NULL; + IMG_HANDLE hPrivDataInt = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_BREAKPOINT_RGXCLEARBREAKPOINT); + + + + + + { + /* Look up the address from the handle */ + psRGXClearBreakpointOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &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_HANDLE *) &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 ui32BridgeID, + PVRSRV_BRIDGE_IN_RGXENABLEBREAKPOINT *psRGXEnableBreakpointIN, + PVRSRV_BRIDGE_OUT_RGXENABLEBREAKPOINT *psRGXEnableBreakpointOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevNodeInt = IMG_NULL; + IMG_HANDLE hPrivDataInt = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_BREAKPOINT_RGXENABLEBREAKPOINT); + + + + + + { + /* Look up the address from the handle */ + psRGXEnableBreakpointOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &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_HANDLE *) &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 ui32BridgeID, + PVRSRV_BRIDGE_IN_RGXDISABLEBREAKPOINT *psRGXDisableBreakpointIN, + PVRSRV_BRIDGE_OUT_RGXDISABLEBREAKPOINT *psRGXDisableBreakpointOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevNodeInt = IMG_NULL; + IMG_HANDLE hPrivDataInt = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_BREAKPOINT_RGXDISABLEBREAKPOINT); + + + + + + { + /* Look up the address from the handle */ + psRGXDisableBreakpointOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &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_HANDLE *) &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 ui32BridgeID, + PVRSRV_BRIDGE_IN_RGXOVERALLOCATEBPREGISTERS *psRGXOverallocateBPRegistersIN, + PVRSRV_BRIDGE_OUT_RGXOVERALLOCATEBPREGISTERS *psRGXOverallocateBPRegistersOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevNodeInt = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_BREAKPOINT_RGXOVERALLOCATEBPREGISTERS); + + + + + + { + /* Look up the address from the handle */ + psRGXOverallocateBPRegistersOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &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 RegisterBREAKPOINTFunctions(IMG_VOID); +IMG_VOID UnregisterBREAKPOINTFunctions(IMG_VOID); + +/* + * Register all BREAKPOINT functions with services + */ +PVRSRV_ERROR RegisterBREAKPOINTFunctions(IMG_VOID) +{ + SetDispatchTableEntry(PVRSRV_BRIDGE_BREAKPOINT_RGXSETBREAKPOINT, PVRSRVBridgeRGXSetBreakpoint); + SetDispatchTableEntry(PVRSRV_BRIDGE_BREAKPOINT_RGXCLEARBREAKPOINT, PVRSRVBridgeRGXClearBreakpoint); + SetDispatchTableEntry(PVRSRV_BRIDGE_BREAKPOINT_RGXENABLEBREAKPOINT, PVRSRVBridgeRGXEnableBreakpoint); + SetDispatchTableEntry(PVRSRV_BRIDGE_BREAKPOINT_RGXDISABLEBREAKPOINT, PVRSRVBridgeRGXDisableBreakpoint); + SetDispatchTableEntry(PVRSRV_BRIDGE_BREAKPOINT_RGXOVERALLOCATEBPREGISTERS, PVRSRVBridgeRGXOverallocateBPRegisters); + + return PVRSRV_OK; +} + +/* + * Unregister all breakpoint functions with services + */ +IMG_VOID UnregisterBREAKPOINTFunctions(IMG_VOID) +{ +} diff --git a/drivers/gpu/rogue/generated/cachegeneric_bridge/common_cachegeneric_bridge.h b/drivers/gpu/rogue/generated/cachegeneric_bridge/common_cachegeneric_bridge.h new file mode 100644 index 000000000000..92f4cb0a479b --- /dev/null +++ b/drivers/gpu/rogue/generated/cachegeneric_bridge/common_cachegeneric_bridge.h @@ -0,0 +1,75 @@ +/*************************************************************************/ /*! +@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 "cache_external.h" + + +#include "pvr_bridge_io.h" + +#define PVRSRV_BRIDGE_CACHEGENERIC_CMD_FIRST (PVRSRV_BRIDGE_CACHEGENERIC_START) +#define PVRSRV_BRIDGE_CACHEGENERIC_CACHEOPQUEUE PVRSRV_IOWR(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; +} PVRSRV_BRIDGE_IN_CACHEOPQUEUE; + + +/* Bridge out structure for CacheOpQueue */ +typedef struct PVRSRV_BRIDGE_OUT_CACHEOPQUEUE_TAG +{ + PVRSRV_ERROR eError; +} PVRSRV_BRIDGE_OUT_CACHEOPQUEUE; + +#endif /* COMMON_CACHEGENERIC_BRIDGE_H */ diff --git a/drivers/gpu/rogue/generated/cachegeneric_bridge/server_cachegeneric_bridge.c b/drivers/gpu/rogue/generated/cachegeneric_bridge/server_cachegeneric_bridge.c new file mode 100644 index 000000000000..ed8cf78242b4 --- /dev/null +++ b/drivers/gpu/rogue/generated/cachegeneric_bridge/server_cachegeneric_bridge.c @@ -0,0 +1,126 @@ +/*************************************************************************/ /*! +@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 + +/* *************************************************************************** + * Bridge proxy functions + */ + + + +/* *************************************************************************** + * Server-side bridge entry points + */ + +static IMG_INT +PVRSRVBridgeCacheOpQueue(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_CACHEOPQUEUE *psCacheOpQueueIN, + PVRSRV_BRIDGE_OUT_CACHEOPQUEUE *psCacheOpQueueOUT, + CONNECTION_DATA *psConnection) +{ + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_CACHEGENERIC_CACHEOPQUEUE); + + PVR_UNREFERENCED_PARAMETER(psConnection); + + + + + psCacheOpQueueOUT->eError = + CacheOpQueue( + psCacheOpQueueIN->iuCacheOp); + + + + + return 0; +} + + + +/* *************************************************************************** + * Server bridge dispatch related glue + */ + +PVRSRV_ERROR RegisterCACHEGENERICFunctions(IMG_VOID); +IMG_VOID UnregisterCACHEGENERICFunctions(IMG_VOID); + +/* + * Register all CACHEGENERIC functions with services + */ +PVRSRV_ERROR RegisterCACHEGENERICFunctions(IMG_VOID) +{ + SetDispatchTableEntry(PVRSRV_BRIDGE_CACHEGENERIC_CACHEOPQUEUE, PVRSRVBridgeCacheOpQueue); + + return PVRSRV_OK; +} + +/* + * Unregister all cachegeneric functions with services + */ +IMG_VOID UnregisterCACHEGENERICFunctions(IMG_VOID) +{ +} diff --git a/drivers/gpu/rogue/generated/cmm_bridge/common_cmm_bridge.h b/drivers/gpu/rogue/generated/cmm_bridge/common_cmm_bridge.h new file mode 100644 index 000000000000..c16d71551fbf --- /dev/null +++ b/drivers/gpu/rogue/generated/cmm_bridge/common_cmm_bridge.h @@ -0,0 +1,178 @@ +/*************************************************************************/ /*! +@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 "devicemem_typedefs.h" + + +#include "pvr_bridge_io.h" + +#define PVRSRV_BRIDGE_CMM_CMD_FIRST (PVRSRV_BRIDGE_CMM_START) +#define PVRSRV_BRIDGE_CMM_PMRWRITEPMPAGELIST PVRSRV_IOWR(PVRSRV_BRIDGE_CMM_CMD_FIRST+0) +#define PVRSRV_BRIDGE_CMM_PMRWRITEVFPPAGELIST PVRSRV_IOWR(PVRSRV_BRIDGE_CMM_CMD_FIRST+1) +#define PVRSRV_BRIDGE_CMM_PMRUNWRITEPMPAGELIST PVRSRV_IOWR(PVRSRV_BRIDGE_CMM_CMD_FIRST+2) +#define PVRSRV_BRIDGE_CMM_DEVMEMINTCTXEXPORT PVRSRV_IOWR(PVRSRV_BRIDGE_CMM_CMD_FIRST+3) +#define PVRSRV_BRIDGE_CMM_DEVMEMINTCTXUNEXPORT PVRSRV_IOWR(PVRSRV_BRIDGE_CMM_CMD_FIRST+4) +#define PVRSRV_BRIDGE_CMM_DEVMEMINTCTXIMPORT PVRSRV_IOWR(PVRSRV_BRIDGE_CMM_CMD_FIRST+5) +#define PVRSRV_BRIDGE_CMM_CMD_LAST (PVRSRV_BRIDGE_CMM_CMD_FIRST+5) + + +/******************************************* + PMRWritePMPageList + *******************************************/ + +/* Bridge in structure for PMRWritePMPageList */ +typedef struct PVRSRV_BRIDGE_IN_PMRWRITEPMPAGELIST_TAG +{ + IMG_HANDLE hPageListPMR; + IMG_DEVMEM_OFFSET_T uiTableOffset; + IMG_DEVMEM_SIZE_T uiTableLength; + IMG_HANDLE hReferencePMR; + IMG_UINT32 ui32Log2PageSize; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_PMRWRITEPMPAGELIST; + + +/* Bridge out structure for PMRWritePMPageList */ +typedef struct PVRSRV_BRIDGE_OUT_PMRWRITEPMPAGELIST_TAG +{ + IMG_HANDLE hPageList; + IMG_UINT64 ui64CheckSum; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PMRWRITEPMPAGELIST; + +/******************************************* + PMRWriteVFPPageList + *******************************************/ + +/* Bridge in structure for PMRWriteVFPPageList */ +typedef struct PVRSRV_BRIDGE_IN_PMRWRITEVFPPAGELIST_TAG +{ + IMG_HANDLE hFreeListPMR; + IMG_DEVMEM_OFFSET_T uiTableOffset; + IMG_DEVMEM_SIZE_T uiTableLength; + IMG_UINT32 ui32TableBase; + IMG_UINT32 ui32Log2PageSize; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_PMRWRITEVFPPAGELIST; + + +/* Bridge out structure for PMRWriteVFPPageList */ +typedef struct PVRSRV_BRIDGE_OUT_PMRWRITEVFPPAGELIST_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PMRWRITEVFPPAGELIST; + +/******************************************* + PMRUnwritePMPageList + *******************************************/ + +/* Bridge in structure for PMRUnwritePMPageList */ +typedef struct PVRSRV_BRIDGE_IN_PMRUNWRITEPMPAGELIST_TAG +{ + IMG_HANDLE hPageList; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_PMRUNWRITEPMPAGELIST; + + +/* Bridge out structure for PMRUnwritePMPageList */ +typedef struct PVRSRV_BRIDGE_OUT_PMRUNWRITEPMPAGELIST_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PMRUNWRITEPMPAGELIST; + +/******************************************* + 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/generated/cmm_bridge/server_cmm_bridge.c b/drivers/gpu/rogue/generated/cmm_bridge/server_cmm_bridge.c new file mode 100644 index 000000000000..4c4172bf3dfa --- /dev/null +++ b/drivers/gpu/rogue/generated/cmm_bridge/server_cmm_bridge.c @@ -0,0 +1,611 @@ +/*************************************************************************/ /*! +@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 + +/* *************************************************************************** + * Bridge proxy functions + */ + +static PVRSRV_ERROR +PMRUnwritePMPageListResManProxy(IMG_HANDLE hResmanItem) +{ + PVRSRV_ERROR eError; + + eError = ResManFreeResByPtr(hResmanItem); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + + return eError; +} + +static PVRSRV_ERROR +DevmemIntCtxUnexportResManProxy(IMG_HANDLE hResmanItem) +{ + PVRSRV_ERROR eError; + + eError = ResManFreeResByPtr(hResmanItem); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + + return eError; +} + + + +/* *************************************************************************** + * Server-side bridge entry points + */ + +static IMG_INT +PVRSRVBridgePMRWritePMPageList(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_PMRWRITEPMPAGELIST *psPMRWritePMPageListIN, + PVRSRV_BRIDGE_OUT_PMRWRITEPMPAGELIST *psPMRWritePMPageListOUT, + CONNECTION_DATA *psConnection) +{ + PMR * psPageListPMRInt = IMG_NULL; + IMG_HANDLE hPageListPMRInt2 = IMG_NULL; + PMR * psReferencePMRInt = IMG_NULL; + IMG_HANDLE hReferencePMRInt2 = IMG_NULL; + PMR_PAGELIST * psPageListInt = IMG_NULL; + IMG_HANDLE hPageListInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_CMM_PMRWRITEPMPAGELIST); + + + + + + { + /* Look up the address from the handle */ + psPMRWritePMPageListOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hPageListPMRInt2, + psPMRWritePMPageListIN->hPageListPMR, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR); + if(psPMRWritePMPageListOUT->eError != PVRSRV_OK) + { + goto PMRWritePMPageList_exit; + } + + /* Look up the data from the resman address */ + psPMRWritePMPageListOUT->eError = ResManFindPrivateDataByPtr(hPageListPMRInt2, (IMG_VOID **) &psPageListPMRInt); + + if(psPMRWritePMPageListOUT->eError != PVRSRV_OK) + { + goto PMRWritePMPageList_exit; + } + } + + { + /* Look up the address from the handle */ + psPMRWritePMPageListOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hReferencePMRInt2, + psPMRWritePMPageListIN->hReferencePMR, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR); + if(psPMRWritePMPageListOUT->eError != PVRSRV_OK) + { + goto PMRWritePMPageList_exit; + } + + /* Look up the data from the resman address */ + psPMRWritePMPageListOUT->eError = ResManFindPrivateDataByPtr(hReferencePMRInt2, (IMG_VOID **) &psReferencePMRInt); + + if(psPMRWritePMPageListOUT->eError != PVRSRV_OK) + { + goto PMRWritePMPageList_exit; + } + } + + psPMRWritePMPageListOUT->eError = + PMRWritePMPageList( + psPageListPMRInt, + psPMRWritePMPageListIN->uiTableOffset, + psPMRWritePMPageListIN->uiTableLength, + psReferencePMRInt, + psPMRWritePMPageListIN->ui32Log2PageSize, + &psPageListInt, + &psPMRWritePMPageListOUT->ui64CheckSum); + /* Exit early if bridged call fails */ + if(psPMRWritePMPageListOUT->eError != PVRSRV_OK) + { + goto PMRWritePMPageList_exit; + } + + /* Create a resman item and overwrite the handle with it */ + hPageListInt2 = ResManRegisterRes(psConnection->hResManContext, + RESMAN_TYPE_PMR_PAGELIST, + psPageListInt, + (RESMAN_FREE_FN)&PMRUnwritePMPageList); + if (hPageListInt2 == IMG_NULL) + { + psPMRWritePMPageListOUT->eError = PVRSRV_ERROR_UNABLE_TO_REGISTER_RESOURCE; + goto PMRWritePMPageList_exit; + } + psPMRWritePMPageListOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psPMRWritePMPageListOUT->hPageList, + (IMG_HANDLE) hPageListInt2, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR_PAGELIST, + PVRSRV_HANDLE_ALLOC_FLAG_NONE + ); + if (psPMRWritePMPageListOUT->eError != PVRSRV_OK) + { + goto PMRWritePMPageList_exit; + } + + +PMRWritePMPageList_exit: + if (psPMRWritePMPageListOUT->eError != PVRSRV_OK) + { + /* If we have a valid resman item we should undo the bridge function by freeing the resman item */ + if (hPageListInt2) + { + PVRSRV_ERROR eError = ResManFreeResByPtr(hPageListInt2); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + } + else if (psPageListInt) + { + PMRUnwritePMPageList(psPageListInt); + } + } + + + return 0; +} + +static IMG_INT +PVRSRVBridgePMRWriteVFPPageList(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_PMRWRITEVFPPAGELIST *psPMRWriteVFPPageListIN, + PVRSRV_BRIDGE_OUT_PMRWRITEVFPPAGELIST *psPMRWriteVFPPageListOUT, + CONNECTION_DATA *psConnection) +{ + PMR * psFreeListPMRInt = IMG_NULL; + IMG_HANDLE hFreeListPMRInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_CMM_PMRWRITEVFPPAGELIST); + + + + + + { + /* Look up the address from the handle */ + psPMRWriteVFPPageListOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hFreeListPMRInt2, + psPMRWriteVFPPageListIN->hFreeListPMR, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR); + if(psPMRWriteVFPPageListOUT->eError != PVRSRV_OK) + { + goto PMRWriteVFPPageList_exit; + } + + /* Look up the data from the resman address */ + psPMRWriteVFPPageListOUT->eError = ResManFindPrivateDataByPtr(hFreeListPMRInt2, (IMG_VOID **) &psFreeListPMRInt); + + if(psPMRWriteVFPPageListOUT->eError != PVRSRV_OK) + { + goto PMRWriteVFPPageList_exit; + } + } + + psPMRWriteVFPPageListOUT->eError = + PMRWriteVFPPageList( + psFreeListPMRInt, + psPMRWriteVFPPageListIN->uiTableOffset, + psPMRWriteVFPPageListIN->uiTableLength, + psPMRWriteVFPPageListIN->ui32TableBase, + psPMRWriteVFPPageListIN->ui32Log2PageSize); + + + +PMRWriteVFPPageList_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgePMRUnwritePMPageList(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_PMRUNWRITEPMPAGELIST *psPMRUnwritePMPageListIN, + PVRSRV_BRIDGE_OUT_PMRUNWRITEPMPAGELIST *psPMRUnwritePMPageListOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hPageListInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_CMM_PMRUNWRITEPMPAGELIST); + + + + + + { + /* Look up the address from the handle */ + psPMRUnwritePMPageListOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hPageListInt2, + psPMRUnwritePMPageListIN->hPageList, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR_PAGELIST); + if(psPMRUnwritePMPageListOUT->eError != PVRSRV_OK) + { + goto PMRUnwritePMPageList_exit; + } + + } + + psPMRUnwritePMPageListOUT->eError = PMRUnwritePMPageListResManProxy(hPageListInt2); + /* Exit early if bridged call fails */ + if(psPMRUnwritePMPageListOUT->eError != PVRSRV_OK) + { + goto PMRUnwritePMPageList_exit; + } + + psPMRUnwritePMPageListOUT->eError = + PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psPMRUnwritePMPageListIN->hPageList, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR_PAGELIST); + + +PMRUnwritePMPageList_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeDevmemIntCtxExport(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_DEVMEMINTCTXEXPORT *psDevmemIntCtxExportIN, + PVRSRV_BRIDGE_OUT_DEVMEMINTCTXEXPORT *psDevmemIntCtxExportOUT, + CONNECTION_DATA *psConnection) +{ + DEVMEMINT_CTX * psDevMemServerContextInt = IMG_NULL; + IMG_HANDLE hDevMemServerContextInt2 = IMG_NULL; + DEVMEMINT_CTX_EXPORT * psDevMemIntCtxExportInt = IMG_NULL; + IMG_HANDLE hDevMemIntCtxExportInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_CMM_DEVMEMINTCTXEXPORT); + + + + + + { + /* Look up the address from the handle */ + psDevmemIntCtxExportOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hDevMemServerContextInt2, + psDevmemIntCtxExportIN->hDevMemServerContext, + PVRSRV_HANDLE_TYPE_DEVMEMINT_CTX); + if(psDevmemIntCtxExportOUT->eError != PVRSRV_OK) + { + goto DevmemIntCtxExport_exit; + } + + /* Look up the data from the resman address */ + psDevmemIntCtxExportOUT->eError = ResManFindPrivateDataByPtr(hDevMemServerContextInt2, (IMG_VOID **) &psDevMemServerContextInt); + + 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; + } + + /* Create a resman item and overwrite the handle with it */ + hDevMemIntCtxExportInt2 = ResManRegisterRes(psConnection->hResManContext, + RESMAN_TYPE_DEVICEMEM2_CONTEXT_EXPORT, + psDevMemIntCtxExportInt, + (RESMAN_FREE_FN)&DevmemIntCtxUnexport); + if (hDevMemIntCtxExportInt2 == IMG_NULL) + { + psDevmemIntCtxExportOUT->eError = PVRSRV_ERROR_UNABLE_TO_REGISTER_RESOURCE; + goto DevmemIntCtxExport_exit; + } + /* see if it's already exported */ + psDevmemIntCtxExportOUT->eError = + PVRSRVFindHandle(KERNEL_HANDLE_BASE, + &psDevmemIntCtxExportOUT->hDevMemIntCtxExport, + (IMG_HANDLE) hDevMemIntCtxExportInt2, + PVRSRV_HANDLE_TYPE_DEVMEMINT_CTX_EXPORT); + if(psDevmemIntCtxExportOUT->eError == PVRSRV_OK) + { + /* It's already exported */ + return 0; + } + + psDevmemIntCtxExportOUT->eError = PVRSRVAllocHandle(KERNEL_HANDLE_BASE, + &psDevmemIntCtxExportOUT->hDevMemIntCtxExport, + (IMG_HANDLE) hDevMemIntCtxExportInt2, + PVRSRV_HANDLE_TYPE_DEVMEMINT_CTX_EXPORT, + PVRSRV_HANDLE_ALLOC_FLAG_NONE + ); + if (psDevmemIntCtxExportOUT->eError != PVRSRV_OK) + { + goto DevmemIntCtxExport_exit; + } + + +DevmemIntCtxExport_exit: + if (psDevmemIntCtxExportOUT->eError != PVRSRV_OK) + { + /* If we have a valid resman item we should undo the bridge function by freeing the resman item */ + if (hDevMemIntCtxExportInt2) + { + PVRSRV_ERROR eError = ResManFreeResByPtr(hDevMemIntCtxExportInt2); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + } + else if (psDevMemIntCtxExportInt) + { + DevmemIntCtxUnexport(psDevMemIntCtxExportInt); + } + } + + + return 0; +} + +static IMG_INT +PVRSRVBridgeDevmemIntCtxUnexport(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_DEVMEMINTCTXUNEXPORT *psDevmemIntCtxUnexportIN, + PVRSRV_BRIDGE_OUT_DEVMEMINTCTXUNEXPORT *psDevmemIntCtxUnexportOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevMemIntCtxExportInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_CMM_DEVMEMINTCTXUNEXPORT); + + PVR_UNREFERENCED_PARAMETER(psConnection); + + + + + { + /* Look up the address from the handle */ + psDevmemIntCtxUnexportOUT->eError = + PVRSRVLookupHandle(KERNEL_HANDLE_BASE, + (IMG_HANDLE *) &hDevMemIntCtxExportInt2, + psDevmemIntCtxUnexportIN->hDevMemIntCtxExport, + PVRSRV_HANDLE_TYPE_DEVMEMINT_CTX_EXPORT); + if(psDevmemIntCtxUnexportOUT->eError != PVRSRV_OK) + { + goto DevmemIntCtxUnexport_exit; + } + + } + + psDevmemIntCtxUnexportOUT->eError = DevmemIntCtxUnexportResManProxy(hDevMemIntCtxExportInt2); + /* Exit early if bridged call fails */ + if(psDevmemIntCtxUnexportOUT->eError != PVRSRV_OK) + { + goto DevmemIntCtxUnexport_exit; + } + + psDevmemIntCtxUnexportOUT->eError = + PVRSRVReleaseHandle(KERNEL_HANDLE_BASE, + (IMG_HANDLE) psDevmemIntCtxUnexportIN->hDevMemIntCtxExport, + PVRSRV_HANDLE_TYPE_DEVMEMINT_CTX_EXPORT); + + +DevmemIntCtxUnexport_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeDevmemIntCtxImport(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_DEVMEMINTCTXIMPORT *psDevmemIntCtxImportIN, + PVRSRV_BRIDGE_OUT_DEVMEMINTCTXIMPORT *psDevmemIntCtxImportOUT, + CONNECTION_DATA *psConnection) +{ + DEVMEMINT_CTX_EXPORT * psDevMemIntCtxExportInt = IMG_NULL; + IMG_HANDLE hDevMemIntCtxExportInt2 = IMG_NULL; + DEVMEMINT_CTX * psDevMemServerContextInt = IMG_NULL; + IMG_HANDLE hDevMemServerContextInt2 = IMG_NULL; + IMG_HANDLE hPrivDataInt = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_CMM_DEVMEMINTCTXIMPORT); + + + + psDevmemIntCtxImportOUT->hDevMemServerContext = IMG_NULL; + + + { + /* Look up the address from the handle */ + psDevmemIntCtxImportOUT->eError = + PVRSRVLookupHandle(KERNEL_HANDLE_BASE, + (IMG_HANDLE *) &hDevMemIntCtxExportInt2, + psDevmemIntCtxImportIN->hDevMemIntCtxExport, + PVRSRV_HANDLE_TYPE_DEVMEMINT_CTX_EXPORT); + if(psDevmemIntCtxImportOUT->eError != PVRSRV_OK) + { + goto DevmemIntCtxImport_exit; + } + + /* Look up the data from the resman address */ + psDevmemIntCtxImportOUT->eError = ResManFindPrivateDataByPtr(hDevMemIntCtxExportInt2, (IMG_VOID **) &psDevMemIntCtxExportInt); + + 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; + } + + /* Create a resman item and overwrite the handle with it */ + hDevMemServerContextInt2 = ResManRegisterRes(psConnection->hResManContext, + RESMAN_TYPE_DEVICEMEM2_CONTEXT, + psDevMemServerContextInt, + (RESMAN_FREE_FN)&DevmemIntCtxDestroy); + if (hDevMemServerContextInt2 == IMG_NULL) + { + psDevmemIntCtxImportOUT->eError = PVRSRV_ERROR_UNABLE_TO_REGISTER_RESOURCE; + goto DevmemIntCtxImport_exit; + } + psDevmemIntCtxImportOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psDevmemIntCtxImportOUT->hDevMemServerContext, + (IMG_HANDLE) hDevMemServerContextInt2, + PVRSRV_HANDLE_TYPE_DEVMEMINT_CTX, + PVRSRV_HANDLE_ALLOC_FLAG_NONE + ); + if (psDevmemIntCtxImportOUT->eError != PVRSRV_OK) + { + goto DevmemIntCtxImport_exit; + } + psDevmemIntCtxImportOUT->eError = PVRSRVAllocSubHandle(psConnection->psHandleBase, + &psDevmemIntCtxImportOUT->hPrivData, + (IMG_HANDLE) 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) + { + PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psDevmemIntCtxImportOUT->hDevMemServerContext, + PVRSRV_HANDLE_TYPE_DEVMEMINT_CTX); + } + + /* If we have a valid resman item we should undo the bridge function by freeing the resman item */ + if (hDevMemServerContextInt2) + { + PVRSRV_ERROR eError = ResManFreeResByPtr(hDevMemServerContextInt2); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + } + else if (psDevMemServerContextInt) + { + DevmemIntCtxDestroy(psDevMemServerContextInt); + } + } + + + return 0; +} + + + +/* *************************************************************************** + * Server bridge dispatch related glue + */ + +PVRSRV_ERROR RegisterCMMFunctions(IMG_VOID); +IMG_VOID UnregisterCMMFunctions(IMG_VOID); + +/* + * Register all CMM functions with services + */ +PVRSRV_ERROR RegisterCMMFunctions(IMG_VOID) +{ + SetDispatchTableEntry(PVRSRV_BRIDGE_CMM_PMRWRITEPMPAGELIST, PVRSRVBridgePMRWritePMPageList); + SetDispatchTableEntry(PVRSRV_BRIDGE_CMM_PMRWRITEVFPPAGELIST, PVRSRVBridgePMRWriteVFPPageList); + SetDispatchTableEntry(PVRSRV_BRIDGE_CMM_PMRUNWRITEPMPAGELIST, PVRSRVBridgePMRUnwritePMPageList); + SetDispatchTableEntry(PVRSRV_BRIDGE_CMM_DEVMEMINTCTXEXPORT, PVRSRVBridgeDevmemIntCtxExport); + SetDispatchTableEntry(PVRSRV_BRIDGE_CMM_DEVMEMINTCTXUNEXPORT, PVRSRVBridgeDevmemIntCtxUnexport); + SetDispatchTableEntry(PVRSRV_BRIDGE_CMM_DEVMEMINTCTXIMPORT, PVRSRVBridgeDevmemIntCtxImport); + + return PVRSRV_OK; +} + +/* + * Unregister all cmm functions with services + */ +IMG_VOID UnregisterCMMFunctions(IMG_VOID) +{ +} diff --git a/drivers/gpu/rogue/generated/dc_bridge/common_dc_bridge.h b/drivers/gpu/rogue/generated/dc_bridge/common_dc_bridge.h new file mode 100644 index 000000000000..afa08781d361 --- /dev/null +++ b/drivers/gpu/rogue/generated/dc_bridge/common_dc_bridge.h @@ -0,0 +1,578 @@ +/*************************************************************************/ /*! +@File +@Title Common bridge header for dc +@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 dc +@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_DC_BRIDGE_H +#define COMMON_DC_BRIDGE_H + +#include "pvrsrv_surface.h" +#include "dc_external.h" +#include "dc_common.h" + + +#include "pvr_bridge_io.h" + +#define PVRSRV_BRIDGE_DC_CMD_FIRST (PVRSRV_BRIDGE_DC_START) +#define PVRSRV_BRIDGE_DC_DCDEVICESQUERYCOUNT PVRSRV_IOWR(PVRSRV_BRIDGE_DC_CMD_FIRST+0) +#define PVRSRV_BRIDGE_DC_DCDEVICESENUMERATE PVRSRV_IOWR(PVRSRV_BRIDGE_DC_CMD_FIRST+1) +#define PVRSRV_BRIDGE_DC_DCDEVICEACQUIRE PVRSRV_IOWR(PVRSRV_BRIDGE_DC_CMD_FIRST+2) +#define PVRSRV_BRIDGE_DC_DCDEVICERELEASE PVRSRV_IOWR(PVRSRV_BRIDGE_DC_CMD_FIRST+3) +#define PVRSRV_BRIDGE_DC_DCGETINFO PVRSRV_IOWR(PVRSRV_BRIDGE_DC_CMD_FIRST+4) +#define PVRSRV_BRIDGE_DC_DCPANELQUERYCOUNT PVRSRV_IOWR(PVRSRV_BRIDGE_DC_CMD_FIRST+5) +#define PVRSRV_BRIDGE_DC_DCPANELQUERY PVRSRV_IOWR(PVRSRV_BRIDGE_DC_CMD_FIRST+6) +#define PVRSRV_BRIDGE_DC_DCFORMATQUERY PVRSRV_IOWR(PVRSRV_BRIDGE_DC_CMD_FIRST+7) +#define PVRSRV_BRIDGE_DC_DCDIMQUERY PVRSRV_IOWR(PVRSRV_BRIDGE_DC_CMD_FIRST+8) +#define PVRSRV_BRIDGE_DC_DCSETBLANK PVRSRV_IOWR(PVRSRV_BRIDGE_DC_CMD_FIRST+9) +#define PVRSRV_BRIDGE_DC_DCSETVSYNCREPORTING PVRSRV_IOWR(PVRSRV_BRIDGE_DC_CMD_FIRST+10) +#define PVRSRV_BRIDGE_DC_DCLASTVSYNCQUERY PVRSRV_IOWR(PVRSRV_BRIDGE_DC_CMD_FIRST+11) +#define PVRSRV_BRIDGE_DC_DCSYSTEMBUFFERACQUIRE PVRSRV_IOWR(PVRSRV_BRIDGE_DC_CMD_FIRST+12) +#define PVRSRV_BRIDGE_DC_DCSYSTEMBUFFERRELEASE PVRSRV_IOWR(PVRSRV_BRIDGE_DC_CMD_FIRST+13) +#define PVRSRV_BRIDGE_DC_DCDISPLAYCONTEXTCREATE PVRSRV_IOWR(PVRSRV_BRIDGE_DC_CMD_FIRST+14) +#define PVRSRV_BRIDGE_DC_DCDISPLAYCONTEXTCONFIGURECHECK PVRSRV_IOWR(PVRSRV_BRIDGE_DC_CMD_FIRST+15) +#define PVRSRV_BRIDGE_DC_DCDISPLAYCONTEXTCONFIGURE PVRSRV_IOWR(PVRSRV_BRIDGE_DC_CMD_FIRST+16) +#define PVRSRV_BRIDGE_DC_DCDISPLAYCONTEXTDESTROY PVRSRV_IOWR(PVRSRV_BRIDGE_DC_CMD_FIRST+17) +#define PVRSRV_BRIDGE_DC_DCBUFFERALLOC PVRSRV_IOWR(PVRSRV_BRIDGE_DC_CMD_FIRST+18) +#define PVRSRV_BRIDGE_DC_DCBUFFERIMPORT PVRSRV_IOWR(PVRSRV_BRIDGE_DC_CMD_FIRST+19) +#define PVRSRV_BRIDGE_DC_DCBUFFERFREE PVRSRV_IOWR(PVRSRV_BRIDGE_DC_CMD_FIRST+20) +#define PVRSRV_BRIDGE_DC_DCBUFFERUNIMPORT PVRSRV_IOWR(PVRSRV_BRIDGE_DC_CMD_FIRST+21) +#define PVRSRV_BRIDGE_DC_DCBUFFERPIN PVRSRV_IOWR(PVRSRV_BRIDGE_DC_CMD_FIRST+22) +#define PVRSRV_BRIDGE_DC_DCBUFFERUNPIN PVRSRV_IOWR(PVRSRV_BRIDGE_DC_CMD_FIRST+23) +#define PVRSRV_BRIDGE_DC_DCBUFFERACQUIRE PVRSRV_IOWR(PVRSRV_BRIDGE_DC_CMD_FIRST+24) +#define PVRSRV_BRIDGE_DC_DCBUFFERRELEASE PVRSRV_IOWR(PVRSRV_BRIDGE_DC_CMD_FIRST+25) +#define PVRSRV_BRIDGE_DC_CMD_LAST (PVRSRV_BRIDGE_DC_CMD_FIRST+25) + + +/******************************************* + DCDevicesQueryCount + *******************************************/ + +/* Bridge in structure for DCDevicesQueryCount */ +typedef struct PVRSRV_BRIDGE_IN_DCDEVICESQUERYCOUNT_TAG +{ + IMG_UINT32 ui32EmptyStructPlaceholder; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_DCDEVICESQUERYCOUNT; + + +/* Bridge out structure for DCDevicesQueryCount */ +typedef struct PVRSRV_BRIDGE_OUT_DCDEVICESQUERYCOUNT_TAG +{ + IMG_UINT32 ui32DeviceCount; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DCDEVICESQUERYCOUNT; + +/******************************************* + DCDevicesEnumerate + *******************************************/ + +/* Bridge in structure for DCDevicesEnumerate */ +typedef struct PVRSRV_BRIDGE_IN_DCDEVICESENUMERATE_TAG +{ + IMG_UINT32 ui32DeviceArraySize; + /* Output pointer pui32DeviceIndex is also an implied input */ + IMG_UINT32 * pui32DeviceIndex; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_DCDEVICESENUMERATE; + + +/* Bridge out structure for DCDevicesEnumerate */ +typedef struct PVRSRV_BRIDGE_OUT_DCDEVICESENUMERATE_TAG +{ + IMG_UINT32 ui32DeviceCount; + IMG_UINT32 * pui32DeviceIndex; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DCDEVICESENUMERATE; + +/******************************************* + DCDeviceAcquire + *******************************************/ + +/* Bridge in structure for DCDeviceAcquire */ +typedef struct PVRSRV_BRIDGE_IN_DCDEVICEACQUIRE_TAG +{ + IMG_UINT32 ui32DeviceIndex; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_DCDEVICEACQUIRE; + + +/* Bridge out structure for DCDeviceAcquire */ +typedef struct PVRSRV_BRIDGE_OUT_DCDEVICEACQUIRE_TAG +{ + IMG_HANDLE hDevice; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DCDEVICEACQUIRE; + +/******************************************* + DCDeviceRelease + *******************************************/ + +/* Bridge in structure for DCDeviceRelease */ +typedef struct PVRSRV_BRIDGE_IN_DCDEVICERELEASE_TAG +{ + IMG_HANDLE hDevice; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_DCDEVICERELEASE; + + +/* Bridge out structure for DCDeviceRelease */ +typedef struct PVRSRV_BRIDGE_OUT_DCDEVICERELEASE_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DCDEVICERELEASE; + +/******************************************* + DCGetInfo + *******************************************/ + +/* Bridge in structure for DCGetInfo */ +typedef struct PVRSRV_BRIDGE_IN_DCGETINFO_TAG +{ + IMG_HANDLE hDevice; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_DCGETINFO; + + +/* Bridge out structure for DCGetInfo */ +typedef struct PVRSRV_BRIDGE_OUT_DCGETINFO_TAG +{ + DC_DISPLAY_INFO sDisplayInfo; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DCGETINFO; + +/******************************************* + DCPanelQueryCount + *******************************************/ + +/* Bridge in structure for DCPanelQueryCount */ +typedef struct PVRSRV_BRIDGE_IN_DCPANELQUERYCOUNT_TAG +{ + IMG_HANDLE hDevice; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_DCPANELQUERYCOUNT; + + +/* Bridge out structure for DCPanelQueryCount */ +typedef struct PVRSRV_BRIDGE_OUT_DCPANELQUERYCOUNT_TAG +{ + IMG_UINT32 ui32NumPanels; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DCPANELQUERYCOUNT; + +/******************************************* + DCPanelQuery + *******************************************/ + +/* Bridge in structure for DCPanelQuery */ +typedef struct PVRSRV_BRIDGE_IN_DCPANELQUERY_TAG +{ + IMG_HANDLE hDevice; + IMG_UINT32 ui32PanelsArraySize; + /* Output pointer psPanelInfo is also an implied input */ + PVRSRV_PANEL_INFO * psPanelInfo; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_DCPANELQUERY; + + +/* Bridge out structure for DCPanelQuery */ +typedef struct PVRSRV_BRIDGE_OUT_DCPANELQUERY_TAG +{ + IMG_UINT32 ui32NumPanels; + PVRSRV_PANEL_INFO * psPanelInfo; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DCPANELQUERY; + +/******************************************* + DCFormatQuery + *******************************************/ + +/* Bridge in structure for DCFormatQuery */ +typedef struct PVRSRV_BRIDGE_IN_DCFORMATQUERY_TAG +{ + IMG_HANDLE hDevice; + IMG_UINT32 ui32NumFormats; + PVRSRV_SURFACE_FORMAT * psFormat; + /* Output pointer pui32Supported is also an implied input */ + IMG_UINT32 * pui32Supported; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_DCFORMATQUERY; + + +/* Bridge out structure for DCFormatQuery */ +typedef struct PVRSRV_BRIDGE_OUT_DCFORMATQUERY_TAG +{ + IMG_UINT32 * pui32Supported; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DCFORMATQUERY; + +/******************************************* + DCDimQuery + *******************************************/ + +/* Bridge in structure for DCDimQuery */ +typedef struct PVRSRV_BRIDGE_IN_DCDIMQUERY_TAG +{ + IMG_HANDLE hDevice; + IMG_UINT32 ui32NumDims; + PVRSRV_SURFACE_DIMS * psDim; + /* Output pointer pui32Supported is also an implied input */ + IMG_UINT32 * pui32Supported; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_DCDIMQUERY; + + +/* Bridge out structure for DCDimQuery */ +typedef struct PVRSRV_BRIDGE_OUT_DCDIMQUERY_TAG +{ + IMG_UINT32 * pui32Supported; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DCDIMQUERY; + +/******************************************* + DCSetBlank + *******************************************/ + +/* Bridge in structure for DCSetBlank */ +typedef struct PVRSRV_BRIDGE_IN_DCSETBLANK_TAG +{ + IMG_HANDLE hDevice; + IMG_BOOL bEnabled; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_DCSETBLANK; + + +/* Bridge out structure for DCSetBlank */ +typedef struct PVRSRV_BRIDGE_OUT_DCSETBLANK_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DCSETBLANK; + +/******************************************* + DCSetVSyncReporting + *******************************************/ + +/* Bridge in structure for DCSetVSyncReporting */ +typedef struct PVRSRV_BRIDGE_IN_DCSETVSYNCREPORTING_TAG +{ + IMG_HANDLE hDevice; + IMG_BOOL bEnabled; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_DCSETVSYNCREPORTING; + + +/* Bridge out structure for DCSetVSyncReporting */ +typedef struct PVRSRV_BRIDGE_OUT_DCSETVSYNCREPORTING_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DCSETVSYNCREPORTING; + +/******************************************* + DCLastVSyncQuery + *******************************************/ + +/* Bridge in structure for DCLastVSyncQuery */ +typedef struct PVRSRV_BRIDGE_IN_DCLASTVSYNCQUERY_TAG +{ + IMG_HANDLE hDevice; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_DCLASTVSYNCQUERY; + + +/* Bridge out structure for DCLastVSyncQuery */ +typedef struct PVRSRV_BRIDGE_OUT_DCLASTVSYNCQUERY_TAG +{ + IMG_INT64 i64Timestamp; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DCLASTVSYNCQUERY; + +/******************************************* + DCSystemBufferAcquire + *******************************************/ + +/* Bridge in structure for DCSystemBufferAcquire */ +typedef struct PVRSRV_BRIDGE_IN_DCSYSTEMBUFFERACQUIRE_TAG +{ + IMG_HANDLE hDevice; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_DCSYSTEMBUFFERACQUIRE; + + +/* Bridge out structure for DCSystemBufferAcquire */ +typedef struct PVRSRV_BRIDGE_OUT_DCSYSTEMBUFFERACQUIRE_TAG +{ + IMG_UINT32 ui32Stride; + IMG_HANDLE hBuffer; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DCSYSTEMBUFFERACQUIRE; + +/******************************************* + DCSystemBufferRelease + *******************************************/ + +/* Bridge in structure for DCSystemBufferRelease */ +typedef struct PVRSRV_BRIDGE_IN_DCSYSTEMBUFFERRELEASE_TAG +{ + IMG_HANDLE hBuffer; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_DCSYSTEMBUFFERRELEASE; + + +/* Bridge out structure for DCSystemBufferRelease */ +typedef struct PVRSRV_BRIDGE_OUT_DCSYSTEMBUFFERRELEASE_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DCSYSTEMBUFFERRELEASE; + +/******************************************* + DCDisplayContextCreate + *******************************************/ + +/* Bridge in structure for DCDisplayContextCreate */ +typedef struct PVRSRV_BRIDGE_IN_DCDISPLAYCONTEXTCREATE_TAG +{ + IMG_HANDLE hDevice; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_DCDISPLAYCONTEXTCREATE; + + +/* Bridge out structure for DCDisplayContextCreate */ +typedef struct PVRSRV_BRIDGE_OUT_DCDISPLAYCONTEXTCREATE_TAG +{ + IMG_HANDLE hDisplayContext; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DCDISPLAYCONTEXTCREATE; + +/******************************************* + DCDisplayContextConfigureCheck + *******************************************/ + +/* Bridge in structure for DCDisplayContextConfigureCheck */ +typedef struct PVRSRV_BRIDGE_IN_DCDISPLAYCONTEXTCONFIGURECHECK_TAG +{ + IMG_HANDLE hDisplayContext; + IMG_UINT32 ui32PipeCount; + PVRSRV_SURFACE_CONFIG_INFO * psSurfInfo; + IMG_HANDLE * phBuffers; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_DCDISPLAYCONTEXTCONFIGURECHECK; + + +/* Bridge out structure for DCDisplayContextConfigureCheck */ +typedef struct PVRSRV_BRIDGE_OUT_DCDISPLAYCONTEXTCONFIGURECHECK_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DCDISPLAYCONTEXTCONFIGURECHECK; + +/******************************************* + DCDisplayContextConfigure + *******************************************/ + +/* Bridge in structure for DCDisplayContextConfigure */ +typedef struct PVRSRV_BRIDGE_IN_DCDISPLAYCONTEXTCONFIGURE_TAG +{ + IMG_HANDLE hDisplayContext; + IMG_UINT32 ui32PipeCount; + PVRSRV_SURFACE_CONFIG_INFO * psSurfInfo; + IMG_HANDLE * phBuffers; + IMG_UINT32 ui32SyncCount; + IMG_HANDLE * phSync; + IMG_BOOL * pbUpdate; + IMG_UINT32 ui32DisplayPeriod; + IMG_UINT32 ui32MaxDepth; + IMG_INT32 i32AcquireFd; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_DCDISPLAYCONTEXTCONFIGURE; + + +/* Bridge out structure for DCDisplayContextConfigure */ +typedef struct PVRSRV_BRIDGE_OUT_DCDISPLAYCONTEXTCONFIGURE_TAG +{ + IMG_INT32 i32ReleaseFd; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DCDISPLAYCONTEXTCONFIGURE; + +/******************************************* + DCDisplayContextDestroy + *******************************************/ + +/* Bridge in structure for DCDisplayContextDestroy */ +typedef struct PVRSRV_BRIDGE_IN_DCDISPLAYCONTEXTDESTROY_TAG +{ + IMG_HANDLE hDisplayContext; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_DCDISPLAYCONTEXTDESTROY; + + +/* Bridge out structure for DCDisplayContextDestroy */ +typedef struct PVRSRV_BRIDGE_OUT_DCDISPLAYCONTEXTDESTROY_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DCDISPLAYCONTEXTDESTROY; + +/******************************************* + DCBufferAlloc + *******************************************/ + +/* Bridge in structure for DCBufferAlloc */ +typedef struct PVRSRV_BRIDGE_IN_DCBUFFERALLOC_TAG +{ + IMG_HANDLE hDisplayContext; + DC_BUFFER_CREATE_INFO sSurfInfo; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_DCBUFFERALLOC; + + +/* Bridge out structure for DCBufferAlloc */ +typedef struct PVRSRV_BRIDGE_OUT_DCBUFFERALLOC_TAG +{ + IMG_UINT32 ui32Stride; + IMG_HANDLE hBuffer; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DCBUFFERALLOC; + +/******************************************* + DCBufferImport + *******************************************/ + +/* Bridge in structure for DCBufferImport */ +typedef struct PVRSRV_BRIDGE_IN_DCBUFFERIMPORT_TAG +{ + IMG_HANDLE hDisplayContext; + IMG_UINT32 ui32NumPlanes; + IMG_HANDLE * phImport; + DC_BUFFER_IMPORT_INFO sSurfAttrib; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_DCBUFFERIMPORT; + + +/* Bridge out structure for DCBufferImport */ +typedef struct PVRSRV_BRIDGE_OUT_DCBUFFERIMPORT_TAG +{ + IMG_HANDLE hBuffer; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DCBUFFERIMPORT; + +/******************************************* + DCBufferFree + *******************************************/ + +/* Bridge in structure for DCBufferFree */ +typedef struct PVRSRV_BRIDGE_IN_DCBUFFERFREE_TAG +{ + IMG_HANDLE hBuffer; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_DCBUFFERFREE; + + +/* Bridge out structure for DCBufferFree */ +typedef struct PVRSRV_BRIDGE_OUT_DCBUFFERFREE_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DCBUFFERFREE; + +/******************************************* + DCBufferUnimport + *******************************************/ + +/* Bridge in structure for DCBufferUnimport */ +typedef struct PVRSRV_BRIDGE_IN_DCBUFFERUNIMPORT_TAG +{ + IMG_HANDLE hBuffer; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_DCBUFFERUNIMPORT; + + +/* Bridge out structure for DCBufferUnimport */ +typedef struct PVRSRV_BRIDGE_OUT_DCBUFFERUNIMPORT_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DCBUFFERUNIMPORT; + +/******************************************* + DCBufferPin + *******************************************/ + +/* Bridge in structure for DCBufferPin */ +typedef struct PVRSRV_BRIDGE_IN_DCBUFFERPIN_TAG +{ + IMG_HANDLE hBuffer; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_DCBUFFERPIN; + + +/* Bridge out structure for DCBufferPin */ +typedef struct PVRSRV_BRIDGE_OUT_DCBUFFERPIN_TAG +{ + IMG_HANDLE hPinHandle; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DCBUFFERPIN; + +/******************************************* + DCBufferUnpin + *******************************************/ + +/* Bridge in structure for DCBufferUnpin */ +typedef struct PVRSRV_BRIDGE_IN_DCBUFFERUNPIN_TAG +{ + IMG_HANDLE hPinHandle; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_DCBUFFERUNPIN; + + +/* Bridge out structure for DCBufferUnpin */ +typedef struct PVRSRV_BRIDGE_OUT_DCBUFFERUNPIN_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DCBUFFERUNPIN; + +/******************************************* + DCBufferAcquire + *******************************************/ + +/* Bridge in structure for DCBufferAcquire */ +typedef struct PVRSRV_BRIDGE_IN_DCBUFFERACQUIRE_TAG +{ + IMG_HANDLE hBuffer; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_DCBUFFERACQUIRE; + + +/* Bridge out structure for DCBufferAcquire */ +typedef struct PVRSRV_BRIDGE_OUT_DCBUFFERACQUIRE_TAG +{ + IMG_HANDLE hExtMem; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DCBUFFERACQUIRE; + +/******************************************* + DCBufferRelease + *******************************************/ + +/* Bridge in structure for DCBufferRelease */ +typedef struct PVRSRV_BRIDGE_IN_DCBUFFERRELEASE_TAG +{ + IMG_HANDLE hExtMem; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_DCBUFFERRELEASE; + + +/* Bridge out structure for DCBufferRelease */ +typedef struct PVRSRV_BRIDGE_OUT_DCBUFFERRELEASE_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DCBUFFERRELEASE; + +#endif /* COMMON_DC_BRIDGE_H */ diff --git a/drivers/gpu/rogue/generated/dc_bridge/server_dc_bridge.c b/drivers/gpu/rogue/generated/dc_bridge/server_dc_bridge.c new file mode 100644 index 000000000000..5e3de0a95fa3 --- /dev/null +++ b/drivers/gpu/rogue/generated/dc_bridge/server_dc_bridge.c @@ -0,0 +1,2164 @@ +/*************************************************************************/ /*! +@File +@Title Server bridge for dc +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Implements the server side of the bridge for dc +@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 "dc_server.h" + + +#include "common_dc_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 + +/* *************************************************************************** + * Bridge proxy functions + */ + +static PVRSRV_ERROR +DCDeviceReleaseResManProxy(IMG_HANDLE hResmanItem) +{ + PVRSRV_ERROR eError; + + eError = ResManFreeResByPtr(hResmanItem); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + + return eError; +} + +static PVRSRV_ERROR +DCSystemBufferReleaseResManProxy(IMG_HANDLE hResmanItem) +{ + PVRSRV_ERROR eError; + + eError = ResManFreeResByPtr(hResmanItem); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + + return eError; +} + +static PVRSRV_ERROR +DCDisplayContextDestroyResManProxy(IMG_HANDLE hResmanItem) +{ + PVRSRV_ERROR eError; + + eError = ResManFreeResByPtr(hResmanItem); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + + return eError; +} + +static PVRSRV_ERROR +DCBufferFreeResManProxy(IMG_HANDLE hResmanItem) +{ + PVRSRV_ERROR eError; + + eError = ResManFreeResByPtr(hResmanItem); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + + return eError; +} + +static PVRSRV_ERROR +DCBufferUnimportResManProxy(IMG_HANDLE hResmanItem) +{ + PVRSRV_ERROR eError; + + eError = ResManFreeResByPtr(hResmanItem); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + + return eError; +} + +static PVRSRV_ERROR +DCBufferUnpinResManProxy(IMG_HANDLE hResmanItem) +{ + PVRSRV_ERROR eError; + + eError = ResManFreeResByPtr(hResmanItem); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + + return eError; +} + +static PVRSRV_ERROR +DCBufferReleaseResManProxy(IMG_HANDLE hResmanItem) +{ + PVRSRV_ERROR eError; + + eError = ResManFreeResByPtr(hResmanItem); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + + return eError; +} + + + +/* *************************************************************************** + * Server-side bridge entry points + */ + +static IMG_INT +PVRSRVBridgeDCDevicesQueryCount(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_DCDEVICESQUERYCOUNT *psDCDevicesQueryCountIN, + PVRSRV_BRIDGE_OUT_DCDEVICESQUERYCOUNT *psDCDevicesQueryCountOUT, + CONNECTION_DATA *psConnection) +{ + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_DC_DCDEVICESQUERYCOUNT); + + PVR_UNREFERENCED_PARAMETER(psConnection); + PVR_UNREFERENCED_PARAMETER(psDCDevicesQueryCountIN); + + + + + psDCDevicesQueryCountOUT->eError = + DCDevicesQueryCount( + &psDCDevicesQueryCountOUT->ui32DeviceCount); + + + + + return 0; +} + +static IMG_INT +PVRSRVBridgeDCDevicesEnumerate(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_DCDEVICESENUMERATE *psDCDevicesEnumerateIN, + PVRSRV_BRIDGE_OUT_DCDEVICESENUMERATE *psDCDevicesEnumerateOUT, + CONNECTION_DATA *psConnection) +{ + IMG_UINT32 *pui32DeviceIndexInt = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_DC_DCDEVICESENUMERATE); + + PVR_UNREFERENCED_PARAMETER(psConnection); + + psDCDevicesEnumerateOUT->pui32DeviceIndex = psDCDevicesEnumerateIN->pui32DeviceIndex; + + + if (psDCDevicesEnumerateIN->ui32DeviceArraySize != 0) + { + pui32DeviceIndexInt = OSAllocMem(psDCDevicesEnumerateIN->ui32DeviceArraySize * sizeof(IMG_UINT32)); + if (!pui32DeviceIndexInt) + { + psDCDevicesEnumerateOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto DCDevicesEnumerate_exit; + } + } + + + psDCDevicesEnumerateOUT->eError = + DCDevicesEnumerate( + psDCDevicesEnumerateIN->ui32DeviceArraySize, + &psDCDevicesEnumerateOUT->ui32DeviceCount, + pui32DeviceIndexInt); + + + if ( !OSAccessOK(PVR_VERIFY_WRITE, (IMG_VOID*) psDCDevicesEnumerateOUT->pui32DeviceIndex, (psDCDevicesEnumerateOUT->ui32DeviceCount * sizeof(IMG_UINT32))) + || (OSCopyToUser(NULL, psDCDevicesEnumerateOUT->pui32DeviceIndex, pui32DeviceIndexInt, + (psDCDevicesEnumerateOUT->ui32DeviceCount * sizeof(IMG_UINT32))) != PVRSRV_OK) ) + { + psDCDevicesEnumerateOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto DCDevicesEnumerate_exit; + } + + +DCDevicesEnumerate_exit: + if (pui32DeviceIndexInt) + OSFreeMem(pui32DeviceIndexInt); + + return 0; +} + +static IMG_INT +PVRSRVBridgeDCDeviceAcquire(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_DCDEVICEACQUIRE *psDCDeviceAcquireIN, + PVRSRV_BRIDGE_OUT_DCDEVICEACQUIRE *psDCDeviceAcquireOUT, + CONNECTION_DATA *psConnection) +{ + DC_DEVICE * psDeviceInt = IMG_NULL; + IMG_HANDLE hDeviceInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_DC_DCDEVICEACQUIRE); + + + + + + psDCDeviceAcquireOUT->eError = + DCDeviceAcquire( + psDCDeviceAcquireIN->ui32DeviceIndex, + &psDeviceInt); + /* Exit early if bridged call fails */ + if(psDCDeviceAcquireOUT->eError != PVRSRV_OK) + { + goto DCDeviceAcquire_exit; + } + + /* Create a resman item and overwrite the handle with it */ + hDeviceInt2 = ResManRegisterRes(psConnection->hResManContext, + RESMAN_TYPE_DC_DEVICE, + psDeviceInt, + (RESMAN_FREE_FN)&DCDeviceRelease); + if (hDeviceInt2 == IMG_NULL) + { + psDCDeviceAcquireOUT->eError = PVRSRV_ERROR_UNABLE_TO_REGISTER_RESOURCE; + goto DCDeviceAcquire_exit; + } + psDCDeviceAcquireOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psDCDeviceAcquireOUT->hDevice, + (IMG_HANDLE) hDeviceInt2, + PVRSRV_HANDLE_TYPE_DC_DEVICE, + PVRSRV_HANDLE_ALLOC_FLAG_NONE + ); + if (psDCDeviceAcquireOUT->eError != PVRSRV_OK) + { + goto DCDeviceAcquire_exit; + } + + +DCDeviceAcquire_exit: + if (psDCDeviceAcquireOUT->eError != PVRSRV_OK) + { + /* If we have a valid resman item we should undo the bridge function by freeing the resman item */ + if (hDeviceInt2) + { + PVRSRV_ERROR eError = ResManFreeResByPtr(hDeviceInt2); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + } + else if (psDeviceInt) + { + DCDeviceRelease(psDeviceInt); + } + } + + + return 0; +} + +static IMG_INT +PVRSRVBridgeDCDeviceRelease(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_DCDEVICERELEASE *psDCDeviceReleaseIN, + PVRSRV_BRIDGE_OUT_DCDEVICERELEASE *psDCDeviceReleaseOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDeviceInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_DC_DCDEVICERELEASE); + + + + + + { + /* Look up the address from the handle */ + psDCDeviceReleaseOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hDeviceInt2, + psDCDeviceReleaseIN->hDevice, + PVRSRV_HANDLE_TYPE_DC_DEVICE); + if(psDCDeviceReleaseOUT->eError != PVRSRV_OK) + { + goto DCDeviceRelease_exit; + } + + } + + psDCDeviceReleaseOUT->eError = DCDeviceReleaseResManProxy(hDeviceInt2); + /* Exit early if bridged call fails */ + if(psDCDeviceReleaseOUT->eError != PVRSRV_OK) + { + goto DCDeviceRelease_exit; + } + + psDCDeviceReleaseOUT->eError = + PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psDCDeviceReleaseIN->hDevice, + PVRSRV_HANDLE_TYPE_DC_DEVICE); + + +DCDeviceRelease_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeDCGetInfo(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_DCGETINFO *psDCGetInfoIN, + PVRSRV_BRIDGE_OUT_DCGETINFO *psDCGetInfoOUT, + CONNECTION_DATA *psConnection) +{ + DC_DEVICE * psDeviceInt = IMG_NULL; + IMG_HANDLE hDeviceInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_DC_DCGETINFO); + + + + + + { + /* Look up the address from the handle */ + psDCGetInfoOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hDeviceInt2, + psDCGetInfoIN->hDevice, + PVRSRV_HANDLE_TYPE_DC_DEVICE); + if(psDCGetInfoOUT->eError != PVRSRV_OK) + { + goto DCGetInfo_exit; + } + + /* Look up the data from the resman address */ + psDCGetInfoOUT->eError = ResManFindPrivateDataByPtr(hDeviceInt2, (IMG_VOID **) &psDeviceInt); + + if(psDCGetInfoOUT->eError != PVRSRV_OK) + { + goto DCGetInfo_exit; + } + } + + psDCGetInfoOUT->eError = + DCGetInfo( + psDeviceInt, + &psDCGetInfoOUT->sDisplayInfo); + + + +DCGetInfo_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeDCPanelQueryCount(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_DCPANELQUERYCOUNT *psDCPanelQueryCountIN, + PVRSRV_BRIDGE_OUT_DCPANELQUERYCOUNT *psDCPanelQueryCountOUT, + CONNECTION_DATA *psConnection) +{ + DC_DEVICE * psDeviceInt = IMG_NULL; + IMG_HANDLE hDeviceInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_DC_DCPANELQUERYCOUNT); + + + + + + { + /* Look up the address from the handle */ + psDCPanelQueryCountOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hDeviceInt2, + psDCPanelQueryCountIN->hDevice, + PVRSRV_HANDLE_TYPE_DC_DEVICE); + if(psDCPanelQueryCountOUT->eError != PVRSRV_OK) + { + goto DCPanelQueryCount_exit; + } + + /* Look up the data from the resman address */ + psDCPanelQueryCountOUT->eError = ResManFindPrivateDataByPtr(hDeviceInt2, (IMG_VOID **) &psDeviceInt); + + if(psDCPanelQueryCountOUT->eError != PVRSRV_OK) + { + goto DCPanelQueryCount_exit; + } + } + + psDCPanelQueryCountOUT->eError = + DCPanelQueryCount( + psDeviceInt, + &psDCPanelQueryCountOUT->ui32NumPanels); + + + +DCPanelQueryCount_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeDCPanelQuery(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_DCPANELQUERY *psDCPanelQueryIN, + PVRSRV_BRIDGE_OUT_DCPANELQUERY *psDCPanelQueryOUT, + CONNECTION_DATA *psConnection) +{ + DC_DEVICE * psDeviceInt = IMG_NULL; + IMG_HANDLE hDeviceInt2 = IMG_NULL; + PVRSRV_PANEL_INFO *psPanelInfoInt = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_DC_DCPANELQUERY); + + + psDCPanelQueryOUT->psPanelInfo = psDCPanelQueryIN->psPanelInfo; + + + if (psDCPanelQueryIN->ui32PanelsArraySize != 0) + { + psPanelInfoInt = OSAllocMem(psDCPanelQueryIN->ui32PanelsArraySize * sizeof(PVRSRV_PANEL_INFO)); + if (!psPanelInfoInt) + { + psDCPanelQueryOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto DCPanelQuery_exit; + } + } + + + { + /* Look up the address from the handle */ + psDCPanelQueryOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hDeviceInt2, + psDCPanelQueryIN->hDevice, + PVRSRV_HANDLE_TYPE_DC_DEVICE); + if(psDCPanelQueryOUT->eError != PVRSRV_OK) + { + goto DCPanelQuery_exit; + } + + /* Look up the data from the resman address */ + psDCPanelQueryOUT->eError = ResManFindPrivateDataByPtr(hDeviceInt2, (IMG_VOID **) &psDeviceInt); + + if(psDCPanelQueryOUT->eError != PVRSRV_OK) + { + goto DCPanelQuery_exit; + } + } + + psDCPanelQueryOUT->eError = + DCPanelQuery( + psDeviceInt, + psDCPanelQueryIN->ui32PanelsArraySize, + &psDCPanelQueryOUT->ui32NumPanels, + psPanelInfoInt); + + + if ( !OSAccessOK(PVR_VERIFY_WRITE, (IMG_VOID*) psDCPanelQueryOUT->psPanelInfo, (psDCPanelQueryOUT->ui32NumPanels * sizeof(PVRSRV_PANEL_INFO))) + || (OSCopyToUser(NULL, psDCPanelQueryOUT->psPanelInfo, psPanelInfoInt, + (psDCPanelQueryOUT->ui32NumPanels * sizeof(PVRSRV_PANEL_INFO))) != PVRSRV_OK) ) + { + psDCPanelQueryOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto DCPanelQuery_exit; + } + + +DCPanelQuery_exit: + if (psPanelInfoInt) + OSFreeMem(psPanelInfoInt); + + return 0; +} + +static IMG_INT +PVRSRVBridgeDCFormatQuery(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_DCFORMATQUERY *psDCFormatQueryIN, + PVRSRV_BRIDGE_OUT_DCFORMATQUERY *psDCFormatQueryOUT, + CONNECTION_DATA *psConnection) +{ + DC_DEVICE * psDeviceInt = IMG_NULL; + IMG_HANDLE hDeviceInt2 = IMG_NULL; + PVRSRV_SURFACE_FORMAT *psFormatInt = IMG_NULL; + IMG_UINT32 *pui32SupportedInt = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_DC_DCFORMATQUERY); + + + psDCFormatQueryOUT->pui32Supported = psDCFormatQueryIN->pui32Supported; + + + if (psDCFormatQueryIN->ui32NumFormats != 0) + { + psFormatInt = OSAllocMem(psDCFormatQueryIN->ui32NumFormats * sizeof(PVRSRV_SURFACE_FORMAT)); + if (!psFormatInt) + { + psDCFormatQueryOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto DCFormatQuery_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psDCFormatQueryIN->psFormat, psDCFormatQueryIN->ui32NumFormats * sizeof(PVRSRV_SURFACE_FORMAT)) + || (OSCopyFromUser(NULL, psFormatInt, psDCFormatQueryIN->psFormat, + psDCFormatQueryIN->ui32NumFormats * sizeof(PVRSRV_SURFACE_FORMAT)) != PVRSRV_OK) ) + { + psDCFormatQueryOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto DCFormatQuery_exit; + } + if (psDCFormatQueryIN->ui32NumFormats != 0) + { + pui32SupportedInt = OSAllocMem(psDCFormatQueryIN->ui32NumFormats * sizeof(IMG_UINT32)); + if (!pui32SupportedInt) + { + psDCFormatQueryOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto DCFormatQuery_exit; + } + } + + + { + /* Look up the address from the handle */ + psDCFormatQueryOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hDeviceInt2, + psDCFormatQueryIN->hDevice, + PVRSRV_HANDLE_TYPE_DC_DEVICE); + if(psDCFormatQueryOUT->eError != PVRSRV_OK) + { + goto DCFormatQuery_exit; + } + + /* Look up the data from the resman address */ + psDCFormatQueryOUT->eError = ResManFindPrivateDataByPtr(hDeviceInt2, (IMG_VOID **) &psDeviceInt); + + if(psDCFormatQueryOUT->eError != PVRSRV_OK) + { + goto DCFormatQuery_exit; + } + } + + psDCFormatQueryOUT->eError = + DCFormatQuery( + psDeviceInt, + psDCFormatQueryIN->ui32NumFormats, + psFormatInt, + pui32SupportedInt); + + + if ( !OSAccessOK(PVR_VERIFY_WRITE, (IMG_VOID*) psDCFormatQueryOUT->pui32Supported, (psDCFormatQueryIN->ui32NumFormats * sizeof(IMG_UINT32))) + || (OSCopyToUser(NULL, psDCFormatQueryOUT->pui32Supported, pui32SupportedInt, + (psDCFormatQueryIN->ui32NumFormats * sizeof(IMG_UINT32))) != PVRSRV_OK) ) + { + psDCFormatQueryOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto DCFormatQuery_exit; + } + + +DCFormatQuery_exit: + if (psFormatInt) + OSFreeMem(psFormatInt); + if (pui32SupportedInt) + OSFreeMem(pui32SupportedInt); + + return 0; +} + +static IMG_INT +PVRSRVBridgeDCDimQuery(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_DCDIMQUERY *psDCDimQueryIN, + PVRSRV_BRIDGE_OUT_DCDIMQUERY *psDCDimQueryOUT, + CONNECTION_DATA *psConnection) +{ + DC_DEVICE * psDeviceInt = IMG_NULL; + IMG_HANDLE hDeviceInt2 = IMG_NULL; + PVRSRV_SURFACE_DIMS *psDimInt = IMG_NULL; + IMG_UINT32 *pui32SupportedInt = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_DC_DCDIMQUERY); + + + psDCDimQueryOUT->pui32Supported = psDCDimQueryIN->pui32Supported; + + + if (psDCDimQueryIN->ui32NumDims != 0) + { + psDimInt = OSAllocMem(psDCDimQueryIN->ui32NumDims * sizeof(PVRSRV_SURFACE_DIMS)); + if (!psDimInt) + { + psDCDimQueryOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto DCDimQuery_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psDCDimQueryIN->psDim, psDCDimQueryIN->ui32NumDims * sizeof(PVRSRV_SURFACE_DIMS)) + || (OSCopyFromUser(NULL, psDimInt, psDCDimQueryIN->psDim, + psDCDimQueryIN->ui32NumDims * sizeof(PVRSRV_SURFACE_DIMS)) != PVRSRV_OK) ) + { + psDCDimQueryOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto DCDimQuery_exit; + } + if (psDCDimQueryIN->ui32NumDims != 0) + { + pui32SupportedInt = OSAllocMem(psDCDimQueryIN->ui32NumDims * sizeof(IMG_UINT32)); + if (!pui32SupportedInt) + { + psDCDimQueryOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto DCDimQuery_exit; + } + } + + + { + /* Look up the address from the handle */ + psDCDimQueryOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hDeviceInt2, + psDCDimQueryIN->hDevice, + PVRSRV_HANDLE_TYPE_DC_DEVICE); + if(psDCDimQueryOUT->eError != PVRSRV_OK) + { + goto DCDimQuery_exit; + } + + /* Look up the data from the resman address */ + psDCDimQueryOUT->eError = ResManFindPrivateDataByPtr(hDeviceInt2, (IMG_VOID **) &psDeviceInt); + + if(psDCDimQueryOUT->eError != PVRSRV_OK) + { + goto DCDimQuery_exit; + } + } + + psDCDimQueryOUT->eError = + DCDimQuery( + psDeviceInt, + psDCDimQueryIN->ui32NumDims, + psDimInt, + pui32SupportedInt); + + + if ( !OSAccessOK(PVR_VERIFY_WRITE, (IMG_VOID*) psDCDimQueryOUT->pui32Supported, (psDCDimQueryIN->ui32NumDims * sizeof(IMG_UINT32))) + || (OSCopyToUser(NULL, psDCDimQueryOUT->pui32Supported, pui32SupportedInt, + (psDCDimQueryIN->ui32NumDims * sizeof(IMG_UINT32))) != PVRSRV_OK) ) + { + psDCDimQueryOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto DCDimQuery_exit; + } + + +DCDimQuery_exit: + if (psDimInt) + OSFreeMem(psDimInt); + if (pui32SupportedInt) + OSFreeMem(pui32SupportedInt); + + return 0; +} + +static IMG_INT +PVRSRVBridgeDCSetBlank(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_DCSETBLANK *psDCSetBlankIN, + PVRSRV_BRIDGE_OUT_DCSETBLANK *psDCSetBlankOUT, + CONNECTION_DATA *psConnection) +{ + DC_DEVICE * psDeviceInt = IMG_NULL; + IMG_HANDLE hDeviceInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_DC_DCSETBLANK); + + + + + + { + /* Look up the address from the handle */ + psDCSetBlankOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hDeviceInt2, + psDCSetBlankIN->hDevice, + PVRSRV_HANDLE_TYPE_DC_DEVICE); + if(psDCSetBlankOUT->eError != PVRSRV_OK) + { + goto DCSetBlank_exit; + } + + /* Look up the data from the resman address */ + psDCSetBlankOUT->eError = ResManFindPrivateDataByPtr(hDeviceInt2, (IMG_VOID **) &psDeviceInt); + + if(psDCSetBlankOUT->eError != PVRSRV_OK) + { + goto DCSetBlank_exit; + } + } + + psDCSetBlankOUT->eError = + DCSetBlank( + psDeviceInt, + psDCSetBlankIN->bEnabled); + + + +DCSetBlank_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeDCSetVSyncReporting(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_DCSETVSYNCREPORTING *psDCSetVSyncReportingIN, + PVRSRV_BRIDGE_OUT_DCSETVSYNCREPORTING *psDCSetVSyncReportingOUT, + CONNECTION_DATA *psConnection) +{ + DC_DEVICE * psDeviceInt = IMG_NULL; + IMG_HANDLE hDeviceInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_DC_DCSETVSYNCREPORTING); + + + + + + { + /* Look up the address from the handle */ + psDCSetVSyncReportingOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hDeviceInt2, + psDCSetVSyncReportingIN->hDevice, + PVRSRV_HANDLE_TYPE_DC_DEVICE); + if(psDCSetVSyncReportingOUT->eError != PVRSRV_OK) + { + goto DCSetVSyncReporting_exit; + } + + /* Look up the data from the resman address */ + psDCSetVSyncReportingOUT->eError = ResManFindPrivateDataByPtr(hDeviceInt2, (IMG_VOID **) &psDeviceInt); + + if(psDCSetVSyncReportingOUT->eError != PVRSRV_OK) + { + goto DCSetVSyncReporting_exit; + } + } + + psDCSetVSyncReportingOUT->eError = + DCSetVSyncReporting( + psDeviceInt, + psDCSetVSyncReportingIN->bEnabled); + + + +DCSetVSyncReporting_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeDCLastVSyncQuery(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_DCLASTVSYNCQUERY *psDCLastVSyncQueryIN, + PVRSRV_BRIDGE_OUT_DCLASTVSYNCQUERY *psDCLastVSyncQueryOUT, + CONNECTION_DATA *psConnection) +{ + DC_DEVICE * psDeviceInt = IMG_NULL; + IMG_HANDLE hDeviceInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_DC_DCLASTVSYNCQUERY); + + + + + + { + /* Look up the address from the handle */ + psDCLastVSyncQueryOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hDeviceInt2, + psDCLastVSyncQueryIN->hDevice, + PVRSRV_HANDLE_TYPE_DC_DEVICE); + if(psDCLastVSyncQueryOUT->eError != PVRSRV_OK) + { + goto DCLastVSyncQuery_exit; + } + + /* Look up the data from the resman address */ + psDCLastVSyncQueryOUT->eError = ResManFindPrivateDataByPtr(hDeviceInt2, (IMG_VOID **) &psDeviceInt); + + if(psDCLastVSyncQueryOUT->eError != PVRSRV_OK) + { + goto DCLastVSyncQuery_exit; + } + } + + psDCLastVSyncQueryOUT->eError = + DCLastVSyncQuery( + psDeviceInt, + &psDCLastVSyncQueryOUT->i64Timestamp); + + + +DCLastVSyncQuery_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeDCSystemBufferAcquire(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_DCSYSTEMBUFFERACQUIRE *psDCSystemBufferAcquireIN, + PVRSRV_BRIDGE_OUT_DCSYSTEMBUFFERACQUIRE *psDCSystemBufferAcquireOUT, + CONNECTION_DATA *psConnection) +{ + DC_DEVICE * psDeviceInt = IMG_NULL; + IMG_HANDLE hDeviceInt2 = IMG_NULL; + DC_BUFFER * psBufferInt = IMG_NULL; + IMG_HANDLE hBufferInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_DC_DCSYSTEMBUFFERACQUIRE); + + + + + + { + /* Look up the address from the handle */ + psDCSystemBufferAcquireOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hDeviceInt2, + psDCSystemBufferAcquireIN->hDevice, + PVRSRV_HANDLE_TYPE_DC_DEVICE); + if(psDCSystemBufferAcquireOUT->eError != PVRSRV_OK) + { + goto DCSystemBufferAcquire_exit; + } + + /* Look up the data from the resman address */ + psDCSystemBufferAcquireOUT->eError = ResManFindPrivateDataByPtr(hDeviceInt2, (IMG_VOID **) &psDeviceInt); + + if(psDCSystemBufferAcquireOUT->eError != PVRSRV_OK) + { + goto DCSystemBufferAcquire_exit; + } + } + + psDCSystemBufferAcquireOUT->eError = + DCSystemBufferAcquire( + psDeviceInt, + &psDCSystemBufferAcquireOUT->ui32Stride, + &psBufferInt); + /* Exit early if bridged call fails */ + if(psDCSystemBufferAcquireOUT->eError != PVRSRV_OK) + { + goto DCSystemBufferAcquire_exit; + } + + /* Create a resman item and overwrite the handle with it */ + hBufferInt2 = ResManRegisterRes(psConnection->hResManContext, + RESMAN_TYPE_DC_BUFFER, + psBufferInt, + (RESMAN_FREE_FN)&DCSystemBufferRelease); + if (hBufferInt2 == IMG_NULL) + { + psDCSystemBufferAcquireOUT->eError = PVRSRV_ERROR_UNABLE_TO_REGISTER_RESOURCE; + goto DCSystemBufferAcquire_exit; + } + psDCSystemBufferAcquireOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psDCSystemBufferAcquireOUT->hBuffer, + (IMG_HANDLE) hBufferInt2, + PVRSRV_HANDLE_TYPE_DC_BUFFER, + PVRSRV_HANDLE_ALLOC_FLAG_SHARED + ); + if (psDCSystemBufferAcquireOUT->eError != PVRSRV_OK) + { + goto DCSystemBufferAcquire_exit; + } + + +DCSystemBufferAcquire_exit: + if (psDCSystemBufferAcquireOUT->eError != PVRSRV_OK) + { + /* If we have a valid resman item we should undo the bridge function by freeing the resman item */ + if (hBufferInt2) + { + PVRSRV_ERROR eError = ResManFreeResByPtr(hBufferInt2); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + } + else if (psBufferInt) + { + DCSystemBufferRelease(psBufferInt); + } + } + + + return 0; +} + +static IMG_INT +PVRSRVBridgeDCSystemBufferRelease(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_DCSYSTEMBUFFERRELEASE *psDCSystemBufferReleaseIN, + PVRSRV_BRIDGE_OUT_DCSYSTEMBUFFERRELEASE *psDCSystemBufferReleaseOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hBufferInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_DC_DCSYSTEMBUFFERRELEASE); + + + + + + { + /* Look up the address from the handle */ + psDCSystemBufferReleaseOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hBufferInt2, + psDCSystemBufferReleaseIN->hBuffer, + PVRSRV_HANDLE_TYPE_DC_BUFFER); + if(psDCSystemBufferReleaseOUT->eError != PVRSRV_OK) + { + goto DCSystemBufferRelease_exit; + } + + } + + psDCSystemBufferReleaseOUT->eError = DCSystemBufferReleaseResManProxy(hBufferInt2); + /* Exit early if bridged call fails */ + if(psDCSystemBufferReleaseOUT->eError != PVRSRV_OK) + { + goto DCSystemBufferRelease_exit; + } + + psDCSystemBufferReleaseOUT->eError = + PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psDCSystemBufferReleaseIN->hBuffer, + PVRSRV_HANDLE_TYPE_DC_BUFFER); + + +DCSystemBufferRelease_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeDCDisplayContextCreate(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_DCDISPLAYCONTEXTCREATE *psDCDisplayContextCreateIN, + PVRSRV_BRIDGE_OUT_DCDISPLAYCONTEXTCREATE *psDCDisplayContextCreateOUT, + CONNECTION_DATA *psConnection) +{ + DC_DEVICE * psDeviceInt = IMG_NULL; + IMG_HANDLE hDeviceInt2 = IMG_NULL; + DC_DISPLAY_CONTEXT * psDisplayContextInt = IMG_NULL; + IMG_HANDLE hDisplayContextInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_DC_DCDISPLAYCONTEXTCREATE); + + + + + + { + /* Look up the address from the handle */ + psDCDisplayContextCreateOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hDeviceInt2, + psDCDisplayContextCreateIN->hDevice, + PVRSRV_HANDLE_TYPE_DC_DEVICE); + if(psDCDisplayContextCreateOUT->eError != PVRSRV_OK) + { + goto DCDisplayContextCreate_exit; + } + + /* Look up the data from the resman address */ + psDCDisplayContextCreateOUT->eError = ResManFindPrivateDataByPtr(hDeviceInt2, (IMG_VOID **) &psDeviceInt); + + if(psDCDisplayContextCreateOUT->eError != PVRSRV_OK) + { + goto DCDisplayContextCreate_exit; + } + } + + psDCDisplayContextCreateOUT->eError = + DCDisplayContextCreate( + psDeviceInt, + &psDisplayContextInt); + /* Exit early if bridged call fails */ + if(psDCDisplayContextCreateOUT->eError != PVRSRV_OK) + { + goto DCDisplayContextCreate_exit; + } + + /* Create a resman item and overwrite the handle with it */ + hDisplayContextInt2 = ResManRegisterRes(psConnection->hResManContext, + RESMAN_TYPE_DC_DISPLAY_CONTEXT, + psDisplayContextInt, + (RESMAN_FREE_FN)&DCDisplayContextDestroy); + if (hDisplayContextInt2 == IMG_NULL) + { + psDCDisplayContextCreateOUT->eError = PVRSRV_ERROR_UNABLE_TO_REGISTER_RESOURCE; + goto DCDisplayContextCreate_exit; + } + psDCDisplayContextCreateOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psDCDisplayContextCreateOUT->hDisplayContext, + (IMG_HANDLE) hDisplayContextInt2, + PVRSRV_HANDLE_TYPE_DC_DISPLAY_CONTEXT, + PVRSRV_HANDLE_ALLOC_FLAG_NONE + ); + if (psDCDisplayContextCreateOUT->eError != PVRSRV_OK) + { + goto DCDisplayContextCreate_exit; + } + + +DCDisplayContextCreate_exit: + if (psDCDisplayContextCreateOUT->eError != PVRSRV_OK) + { + /* If we have a valid resman item we should undo the bridge function by freeing the resman item */ + if (hDisplayContextInt2) + { + PVRSRV_ERROR eError = ResManFreeResByPtr(hDisplayContextInt2); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + } + else if (psDisplayContextInt) + { + DCDisplayContextDestroy(psDisplayContextInt); + } + } + + + return 0; +} + +static IMG_INT +PVRSRVBridgeDCDisplayContextConfigureCheck(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_DCDISPLAYCONTEXTCONFIGURECHECK *psDCDisplayContextConfigureCheckIN, + PVRSRV_BRIDGE_OUT_DCDISPLAYCONTEXTCONFIGURECHECK *psDCDisplayContextConfigureCheckOUT, + CONNECTION_DATA *psConnection) +{ + DC_DISPLAY_CONTEXT * psDisplayContextInt = IMG_NULL; + IMG_HANDLE hDisplayContextInt2 = IMG_NULL; + PVRSRV_SURFACE_CONFIG_INFO *psSurfInfoInt = IMG_NULL; + DC_BUFFER * *psBuffersInt = IMG_NULL; + IMG_HANDLE *hBuffersInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_DC_DCDISPLAYCONTEXTCONFIGURECHECK); + + + + + if (psDCDisplayContextConfigureCheckIN->ui32PipeCount != 0) + { + psSurfInfoInt = OSAllocMem(psDCDisplayContextConfigureCheckIN->ui32PipeCount * sizeof(PVRSRV_SURFACE_CONFIG_INFO)); + if (!psSurfInfoInt) + { + psDCDisplayContextConfigureCheckOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto DCDisplayContextConfigureCheck_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psDCDisplayContextConfigureCheckIN->psSurfInfo, psDCDisplayContextConfigureCheckIN->ui32PipeCount * sizeof(PVRSRV_SURFACE_CONFIG_INFO)) + || (OSCopyFromUser(NULL, psSurfInfoInt, psDCDisplayContextConfigureCheckIN->psSurfInfo, + psDCDisplayContextConfigureCheckIN->ui32PipeCount * sizeof(PVRSRV_SURFACE_CONFIG_INFO)) != PVRSRV_OK) ) + { + psDCDisplayContextConfigureCheckOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto DCDisplayContextConfigureCheck_exit; + } + if (psDCDisplayContextConfigureCheckIN->ui32PipeCount != 0) + { + psBuffersInt = OSAllocMem(psDCDisplayContextConfigureCheckIN->ui32PipeCount * sizeof(DC_BUFFER *)); + if (!psBuffersInt) + { + psDCDisplayContextConfigureCheckOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto DCDisplayContextConfigureCheck_exit; + } + hBuffersInt2 = OSAllocMem(psDCDisplayContextConfigureCheckIN->ui32PipeCount * sizeof(IMG_HANDLE)); + if (!hBuffersInt2) + { + psDCDisplayContextConfigureCheckOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto DCDisplayContextConfigureCheck_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psDCDisplayContextConfigureCheckIN->phBuffers, psDCDisplayContextConfigureCheckIN->ui32PipeCount * sizeof(IMG_HANDLE)) + || (OSCopyFromUser(NULL, hBuffersInt2, psDCDisplayContextConfigureCheckIN->phBuffers, + psDCDisplayContextConfigureCheckIN->ui32PipeCount * sizeof(IMG_HANDLE)) != PVRSRV_OK) ) + { + psDCDisplayContextConfigureCheckOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto DCDisplayContextConfigureCheck_exit; + } + + { + /* Look up the address from the handle */ + psDCDisplayContextConfigureCheckOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hDisplayContextInt2, + psDCDisplayContextConfigureCheckIN->hDisplayContext, + PVRSRV_HANDLE_TYPE_DC_DISPLAY_CONTEXT); + if(psDCDisplayContextConfigureCheckOUT->eError != PVRSRV_OK) + { + goto DCDisplayContextConfigureCheck_exit; + } + + /* Look up the data from the resman address */ + psDCDisplayContextConfigureCheckOUT->eError = ResManFindPrivateDataByPtr(hDisplayContextInt2, (IMG_VOID **) &psDisplayContextInt); + + if(psDCDisplayContextConfigureCheckOUT->eError != PVRSRV_OK) + { + goto DCDisplayContextConfigureCheck_exit; + } + } + + { + IMG_UINT32 i; + + for (i=0;iui32PipeCount;i++) + { + { + /* Look up the address from the handle */ + psDCDisplayContextConfigureCheckOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hBuffersInt2[i], + hBuffersInt2[i], + PVRSRV_HANDLE_TYPE_DC_BUFFER); + if(psDCDisplayContextConfigureCheckOUT->eError != PVRSRV_OK) + { + goto DCDisplayContextConfigureCheck_exit; + } + + /* Look up the data from the resman address */ + psDCDisplayContextConfigureCheckOUT->eError = ResManFindPrivateDataByPtr(hBuffersInt2[i], (IMG_VOID **) &psBuffersInt[i]); + + if(psDCDisplayContextConfigureCheckOUT->eError != PVRSRV_OK) + { + goto DCDisplayContextConfigureCheck_exit; + } + } + } + } + + psDCDisplayContextConfigureCheckOUT->eError = + DCDisplayContextConfigureCheck( + psDisplayContextInt, + psDCDisplayContextConfigureCheckIN->ui32PipeCount, + psSurfInfoInt, + psBuffersInt); + + + +DCDisplayContextConfigureCheck_exit: + if (psSurfInfoInt) + OSFreeMem(psSurfInfoInt); + if (psBuffersInt) + OSFreeMem(psBuffersInt); + if (hBuffersInt2) + OSFreeMem(hBuffersInt2); + + return 0; +} + +static IMG_INT +PVRSRVBridgeDCDisplayContextConfigure(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_DCDISPLAYCONTEXTCONFIGURE *psDCDisplayContextConfigureIN, + PVRSRV_BRIDGE_OUT_DCDISPLAYCONTEXTCONFIGURE *psDCDisplayContextConfigureOUT, + CONNECTION_DATA *psConnection) +{ + DC_DISPLAY_CONTEXT * psDisplayContextInt = IMG_NULL; + IMG_HANDLE hDisplayContextInt2 = IMG_NULL; + PVRSRV_SURFACE_CONFIG_INFO *psSurfInfoInt = IMG_NULL; + DC_BUFFER * *psBuffersInt = IMG_NULL; + IMG_HANDLE *hBuffersInt2 = IMG_NULL; + SERVER_SYNC_PRIMITIVE * *psSyncInt = IMG_NULL; + IMG_HANDLE *hSyncInt2 = IMG_NULL; + IMG_BOOL *bUpdateInt = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_DC_DCDISPLAYCONTEXTCONFIGURE); + + + + + if (psDCDisplayContextConfigureIN->ui32PipeCount != 0) + { + psSurfInfoInt = OSAllocMem(psDCDisplayContextConfigureIN->ui32PipeCount * sizeof(PVRSRV_SURFACE_CONFIG_INFO)); + if (!psSurfInfoInt) + { + psDCDisplayContextConfigureOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto DCDisplayContextConfigure_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psDCDisplayContextConfigureIN->psSurfInfo, psDCDisplayContextConfigureIN->ui32PipeCount * sizeof(PVRSRV_SURFACE_CONFIG_INFO)) + || (OSCopyFromUser(NULL, psSurfInfoInt, psDCDisplayContextConfigureIN->psSurfInfo, + psDCDisplayContextConfigureIN->ui32PipeCount * sizeof(PVRSRV_SURFACE_CONFIG_INFO)) != PVRSRV_OK) ) + { + psDCDisplayContextConfigureOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto DCDisplayContextConfigure_exit; + } + if (psDCDisplayContextConfigureIN->ui32PipeCount != 0) + { + psBuffersInt = OSAllocMem(psDCDisplayContextConfigureIN->ui32PipeCount * sizeof(DC_BUFFER *)); + if (!psBuffersInt) + { + psDCDisplayContextConfigureOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto DCDisplayContextConfigure_exit; + } + hBuffersInt2 = OSAllocMem(psDCDisplayContextConfigureIN->ui32PipeCount * sizeof(IMG_HANDLE)); + if (!hBuffersInt2) + { + psDCDisplayContextConfigureOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto DCDisplayContextConfigure_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psDCDisplayContextConfigureIN->phBuffers, psDCDisplayContextConfigureIN->ui32PipeCount * sizeof(IMG_HANDLE)) + || (OSCopyFromUser(NULL, hBuffersInt2, psDCDisplayContextConfigureIN->phBuffers, + psDCDisplayContextConfigureIN->ui32PipeCount * sizeof(IMG_HANDLE)) != PVRSRV_OK) ) + { + psDCDisplayContextConfigureOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto DCDisplayContextConfigure_exit; + } + if (psDCDisplayContextConfigureIN->ui32SyncCount != 0) + { + psSyncInt = OSAllocMem(psDCDisplayContextConfigureIN->ui32SyncCount * sizeof(SERVER_SYNC_PRIMITIVE *)); + if (!psSyncInt) + { + psDCDisplayContextConfigureOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto DCDisplayContextConfigure_exit; + } + hSyncInt2 = OSAllocMem(psDCDisplayContextConfigureIN->ui32SyncCount * sizeof(IMG_HANDLE)); + if (!hSyncInt2) + { + psDCDisplayContextConfigureOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto DCDisplayContextConfigure_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psDCDisplayContextConfigureIN->phSync, psDCDisplayContextConfigureIN->ui32SyncCount * sizeof(IMG_HANDLE)) + || (OSCopyFromUser(NULL, hSyncInt2, psDCDisplayContextConfigureIN->phSync, + psDCDisplayContextConfigureIN->ui32SyncCount * sizeof(IMG_HANDLE)) != PVRSRV_OK) ) + { + psDCDisplayContextConfigureOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto DCDisplayContextConfigure_exit; + } + if (psDCDisplayContextConfigureIN->ui32SyncCount != 0) + { + bUpdateInt = OSAllocMem(psDCDisplayContextConfigureIN->ui32SyncCount * sizeof(IMG_BOOL)); + if (!bUpdateInt) + { + psDCDisplayContextConfigureOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto DCDisplayContextConfigure_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psDCDisplayContextConfigureIN->pbUpdate, psDCDisplayContextConfigureIN->ui32SyncCount * sizeof(IMG_BOOL)) + || (OSCopyFromUser(NULL, bUpdateInt, psDCDisplayContextConfigureIN->pbUpdate, + psDCDisplayContextConfigureIN->ui32SyncCount * sizeof(IMG_BOOL)) != PVRSRV_OK) ) + { + psDCDisplayContextConfigureOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto DCDisplayContextConfigure_exit; + } + + { + /* Look up the address from the handle */ + psDCDisplayContextConfigureOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hDisplayContextInt2, + psDCDisplayContextConfigureIN->hDisplayContext, + PVRSRV_HANDLE_TYPE_DC_DISPLAY_CONTEXT); + if(psDCDisplayContextConfigureOUT->eError != PVRSRV_OK) + { + goto DCDisplayContextConfigure_exit; + } + + /* Look up the data from the resman address */ + psDCDisplayContextConfigureOUT->eError = ResManFindPrivateDataByPtr(hDisplayContextInt2, (IMG_VOID **) &psDisplayContextInt); + + if(psDCDisplayContextConfigureOUT->eError != PVRSRV_OK) + { + goto DCDisplayContextConfigure_exit; + } + } + + { + IMG_UINT32 i; + + for (i=0;iui32PipeCount;i++) + { + { + /* Look up the address from the handle */ + psDCDisplayContextConfigureOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hBuffersInt2[i], + hBuffersInt2[i], + PVRSRV_HANDLE_TYPE_DC_BUFFER); + if(psDCDisplayContextConfigureOUT->eError != PVRSRV_OK) + { + goto DCDisplayContextConfigure_exit; + } + + /* Look up the data from the resman address */ + psDCDisplayContextConfigureOUT->eError = ResManFindPrivateDataByPtr(hBuffersInt2[i], (IMG_VOID **) &psBuffersInt[i]); + + if(psDCDisplayContextConfigureOUT->eError != PVRSRV_OK) + { + goto DCDisplayContextConfigure_exit; + } + } + } + } + + { + IMG_UINT32 i; + + for (i=0;iui32SyncCount;i++) + { + { + /* Look up the address from the handle */ + psDCDisplayContextConfigureOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hSyncInt2[i], + hSyncInt2[i], + PVRSRV_HANDLE_TYPE_SERVER_SYNC_PRIMITIVE); + if(psDCDisplayContextConfigureOUT->eError != PVRSRV_OK) + { + goto DCDisplayContextConfigure_exit; + } + + /* Look up the data from the resman address */ + psDCDisplayContextConfigureOUT->eError = ResManFindPrivateDataByPtr(hSyncInt2[i], (IMG_VOID **) &psSyncInt[i]); + + if(psDCDisplayContextConfigureOUT->eError != PVRSRV_OK) + { + goto DCDisplayContextConfigure_exit; + } + } + } + } + + psDCDisplayContextConfigureOUT->eError = + DCDisplayContextConfigure( + psDisplayContextInt, + psDCDisplayContextConfigureIN->ui32PipeCount, + psSurfInfoInt, + psBuffersInt, + psDCDisplayContextConfigureIN->ui32SyncCount, + psSyncInt, + bUpdateInt, + psDCDisplayContextConfigureIN->ui32DisplayPeriod, + psDCDisplayContextConfigureIN->ui32MaxDepth, + psDCDisplayContextConfigureIN->i32AcquireFd, + &psDCDisplayContextConfigureOUT->i32ReleaseFd); + + + +DCDisplayContextConfigure_exit: + if (psSurfInfoInt) + OSFreeMem(psSurfInfoInt); + if (psBuffersInt) + OSFreeMem(psBuffersInt); + if (hBuffersInt2) + OSFreeMem(hBuffersInt2); + if (psSyncInt) + OSFreeMem(psSyncInt); + if (hSyncInt2) + OSFreeMem(hSyncInt2); + if (bUpdateInt) + OSFreeMem(bUpdateInt); + + return 0; +} + +static IMG_INT +PVRSRVBridgeDCDisplayContextDestroy(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_DCDISPLAYCONTEXTDESTROY *psDCDisplayContextDestroyIN, + PVRSRV_BRIDGE_OUT_DCDISPLAYCONTEXTDESTROY *psDCDisplayContextDestroyOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDisplayContextInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_DC_DCDISPLAYCONTEXTDESTROY); + + + + + + { + /* Look up the address from the handle */ + psDCDisplayContextDestroyOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hDisplayContextInt2, + psDCDisplayContextDestroyIN->hDisplayContext, + PVRSRV_HANDLE_TYPE_DC_DISPLAY_CONTEXT); + if(psDCDisplayContextDestroyOUT->eError != PVRSRV_OK) + { + goto DCDisplayContextDestroy_exit; + } + + } + + psDCDisplayContextDestroyOUT->eError = DCDisplayContextDestroyResManProxy(hDisplayContextInt2); + /* Exit early if bridged call fails */ + if(psDCDisplayContextDestroyOUT->eError != PVRSRV_OK) + { + goto DCDisplayContextDestroy_exit; + } + + psDCDisplayContextDestroyOUT->eError = + PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psDCDisplayContextDestroyIN->hDisplayContext, + PVRSRV_HANDLE_TYPE_DC_DISPLAY_CONTEXT); + + +DCDisplayContextDestroy_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeDCBufferAlloc(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_DCBUFFERALLOC *psDCBufferAllocIN, + PVRSRV_BRIDGE_OUT_DCBUFFERALLOC *psDCBufferAllocOUT, + CONNECTION_DATA *psConnection) +{ + DC_DISPLAY_CONTEXT * psDisplayContextInt = IMG_NULL; + IMG_HANDLE hDisplayContextInt2 = IMG_NULL; + DC_BUFFER * psBufferInt = IMG_NULL; + IMG_HANDLE hBufferInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_DC_DCBUFFERALLOC); + + + + + + { + /* Look up the address from the handle */ + psDCBufferAllocOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hDisplayContextInt2, + psDCBufferAllocIN->hDisplayContext, + PVRSRV_HANDLE_TYPE_DC_DISPLAY_CONTEXT); + if(psDCBufferAllocOUT->eError != PVRSRV_OK) + { + goto DCBufferAlloc_exit; + } + + /* Look up the data from the resman address */ + psDCBufferAllocOUT->eError = ResManFindPrivateDataByPtr(hDisplayContextInt2, (IMG_VOID **) &psDisplayContextInt); + + if(psDCBufferAllocOUT->eError != PVRSRV_OK) + { + goto DCBufferAlloc_exit; + } + } + + psDCBufferAllocOUT->eError = + DCBufferAlloc( + psDisplayContextInt, + &psDCBufferAllocIN->sSurfInfo, + &psDCBufferAllocOUT->ui32Stride, + &psBufferInt); + /* Exit early if bridged call fails */ + if(psDCBufferAllocOUT->eError != PVRSRV_OK) + { + goto DCBufferAlloc_exit; + } + + /* Create a resman item and overwrite the handle with it */ + hBufferInt2 = ResManRegisterRes(psConnection->hResManContext, + RESMAN_TYPE_DC_BUFFER, + psBufferInt, + (RESMAN_FREE_FN)&DCBufferFree); + if (hBufferInt2 == IMG_NULL) + { + psDCBufferAllocOUT->eError = PVRSRV_ERROR_UNABLE_TO_REGISTER_RESOURCE; + goto DCBufferAlloc_exit; + } + psDCBufferAllocOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psDCBufferAllocOUT->hBuffer, + (IMG_HANDLE) hBufferInt2, + PVRSRV_HANDLE_TYPE_DC_BUFFER, + PVRSRV_HANDLE_ALLOC_FLAG_NONE + ); + if (psDCBufferAllocOUT->eError != PVRSRV_OK) + { + goto DCBufferAlloc_exit; + } + + +DCBufferAlloc_exit: + if (psDCBufferAllocOUT->eError != PVRSRV_OK) + { + /* If we have a valid resman item we should undo the bridge function by freeing the resman item */ + if (hBufferInt2) + { + PVRSRV_ERROR eError = ResManFreeResByPtr(hBufferInt2); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + } + else if (psBufferInt) + { + DCBufferFree(psBufferInt); + } + } + + + return 0; +} + +static IMG_INT +PVRSRVBridgeDCBufferImport(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_DCBUFFERIMPORT *psDCBufferImportIN, + PVRSRV_BRIDGE_OUT_DCBUFFERIMPORT *psDCBufferImportOUT, + CONNECTION_DATA *psConnection) +{ + DC_DISPLAY_CONTEXT * psDisplayContextInt = IMG_NULL; + IMG_HANDLE hDisplayContextInt2 = IMG_NULL; + PMR * *psImportInt = IMG_NULL; + IMG_HANDLE *hImportInt2 = IMG_NULL; + DC_BUFFER * psBufferInt = IMG_NULL; + IMG_HANDLE hBufferInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_DC_DCBUFFERIMPORT); + + + + + if (psDCBufferImportIN->ui32NumPlanes != 0) + { + psImportInt = OSAllocMem(psDCBufferImportIN->ui32NumPlanes * sizeof(PMR *)); + if (!psImportInt) + { + psDCBufferImportOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto DCBufferImport_exit; + } + hImportInt2 = OSAllocMem(psDCBufferImportIN->ui32NumPlanes * sizeof(IMG_HANDLE)); + if (!hImportInt2) + { + psDCBufferImportOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto DCBufferImport_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psDCBufferImportIN->phImport, psDCBufferImportIN->ui32NumPlanes * sizeof(IMG_HANDLE)) + || (OSCopyFromUser(NULL, hImportInt2, psDCBufferImportIN->phImport, + psDCBufferImportIN->ui32NumPlanes * sizeof(IMG_HANDLE)) != PVRSRV_OK) ) + { + psDCBufferImportOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto DCBufferImport_exit; + } + + { + /* Look up the address from the handle */ + psDCBufferImportOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hDisplayContextInt2, + psDCBufferImportIN->hDisplayContext, + PVRSRV_HANDLE_TYPE_DC_DISPLAY_CONTEXT); + if(psDCBufferImportOUT->eError != PVRSRV_OK) + { + goto DCBufferImport_exit; + } + + /* Look up the data from the resman address */ + psDCBufferImportOUT->eError = ResManFindPrivateDataByPtr(hDisplayContextInt2, (IMG_VOID **) &psDisplayContextInt); + + if(psDCBufferImportOUT->eError != PVRSRV_OK) + { + goto DCBufferImport_exit; + } + } + + { + IMG_UINT32 i; + + for (i=0;iui32NumPlanes;i++) + { + { + /* Look up the address from the handle */ + psDCBufferImportOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hImportInt2[i], + hImportInt2[i], + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR); + if(psDCBufferImportOUT->eError != PVRSRV_OK) + { + goto DCBufferImport_exit; + } + + /* Look up the data from the resman address */ + psDCBufferImportOUT->eError = ResManFindPrivateDataByPtr(hImportInt2[i], (IMG_VOID **) &psImportInt[i]); + + if(psDCBufferImportOUT->eError != PVRSRV_OK) + { + goto DCBufferImport_exit; + } + } + } + } + + psDCBufferImportOUT->eError = + DCBufferImport( + psDisplayContextInt, + psDCBufferImportIN->ui32NumPlanes, + psImportInt, + &psDCBufferImportIN->sSurfAttrib, + &psBufferInt); + /* Exit early if bridged call fails */ + if(psDCBufferImportOUT->eError != PVRSRV_OK) + { + goto DCBufferImport_exit; + } + + /* Create a resman item and overwrite the handle with it */ + hBufferInt2 = ResManRegisterRes(psConnection->hResManContext, + RESMAN_TYPE_DC_BUFFER, + psBufferInt, + (RESMAN_FREE_FN)&DCBufferFree); + if (hBufferInt2 == IMG_NULL) + { + psDCBufferImportOUT->eError = PVRSRV_ERROR_UNABLE_TO_REGISTER_RESOURCE; + goto DCBufferImport_exit; + } + psDCBufferImportOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psDCBufferImportOUT->hBuffer, + (IMG_HANDLE) hBufferInt2, + PVRSRV_HANDLE_TYPE_DC_BUFFER, + PVRSRV_HANDLE_ALLOC_FLAG_NONE + ); + if (psDCBufferImportOUT->eError != PVRSRV_OK) + { + goto DCBufferImport_exit; + } + + +DCBufferImport_exit: + if (psDCBufferImportOUT->eError != PVRSRV_OK) + { + /* If we have a valid resman item we should undo the bridge function by freeing the resman item */ + if (hBufferInt2) + { + PVRSRV_ERROR eError = ResManFreeResByPtr(hBufferInt2); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + } + else if (psBufferInt) + { + DCBufferFree(psBufferInt); + } + } + + if (psImportInt) + OSFreeMem(psImportInt); + if (hImportInt2) + OSFreeMem(hImportInt2); + + return 0; +} + +static IMG_INT +PVRSRVBridgeDCBufferFree(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_DCBUFFERFREE *psDCBufferFreeIN, + PVRSRV_BRIDGE_OUT_DCBUFFERFREE *psDCBufferFreeOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hBufferInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_DC_DCBUFFERFREE); + + + + + + { + /* Look up the address from the handle */ + psDCBufferFreeOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hBufferInt2, + psDCBufferFreeIN->hBuffer, + PVRSRV_HANDLE_TYPE_DC_BUFFER); + if(psDCBufferFreeOUT->eError != PVRSRV_OK) + { + goto DCBufferFree_exit; + } + + } + + psDCBufferFreeOUT->eError = DCBufferFreeResManProxy(hBufferInt2); + /* Exit early if bridged call fails */ + if(psDCBufferFreeOUT->eError != PVRSRV_OK) + { + goto DCBufferFree_exit; + } + + psDCBufferFreeOUT->eError = + PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psDCBufferFreeIN->hBuffer, + PVRSRV_HANDLE_TYPE_DC_BUFFER); + + +DCBufferFree_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeDCBufferUnimport(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_DCBUFFERUNIMPORT *psDCBufferUnimportIN, + PVRSRV_BRIDGE_OUT_DCBUFFERUNIMPORT *psDCBufferUnimportOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hBufferInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_DC_DCBUFFERUNIMPORT); + + + + + + { + /* Look up the address from the handle */ + psDCBufferUnimportOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hBufferInt2, + psDCBufferUnimportIN->hBuffer, + PVRSRV_HANDLE_TYPE_DC_BUFFER); + if(psDCBufferUnimportOUT->eError != PVRSRV_OK) + { + goto DCBufferUnimport_exit; + } + + } + + psDCBufferUnimportOUT->eError = DCBufferUnimportResManProxy(hBufferInt2); + /* Exit early if bridged call fails */ + if(psDCBufferUnimportOUT->eError != PVRSRV_OK) + { + goto DCBufferUnimport_exit; + } + + psDCBufferUnimportOUT->eError = + PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psDCBufferUnimportIN->hBuffer, + PVRSRV_HANDLE_TYPE_DC_BUFFER); + + +DCBufferUnimport_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeDCBufferPin(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_DCBUFFERPIN *psDCBufferPinIN, + PVRSRV_BRIDGE_OUT_DCBUFFERPIN *psDCBufferPinOUT, + CONNECTION_DATA *psConnection) +{ + DC_BUFFER * psBufferInt = IMG_NULL; + IMG_HANDLE hBufferInt2 = IMG_NULL; + DC_PIN_HANDLE hPinHandleInt = IMG_NULL; + IMG_HANDLE hPinHandleInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_DC_DCBUFFERPIN); + + + + + + { + /* Look up the address from the handle */ + psDCBufferPinOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hBufferInt2, + psDCBufferPinIN->hBuffer, + PVRSRV_HANDLE_TYPE_DC_BUFFER); + if(psDCBufferPinOUT->eError != PVRSRV_OK) + { + goto DCBufferPin_exit; + } + + /* Look up the data from the resman address */ + psDCBufferPinOUT->eError = ResManFindPrivateDataByPtr(hBufferInt2, (IMG_VOID **) &psBufferInt); + + if(psDCBufferPinOUT->eError != PVRSRV_OK) + { + goto DCBufferPin_exit; + } + } + + psDCBufferPinOUT->eError = + DCBufferPin( + psBufferInt, + &hPinHandleInt); + /* Exit early if bridged call fails */ + if(psDCBufferPinOUT->eError != PVRSRV_OK) + { + goto DCBufferPin_exit; + } + + /* Create a resman item and overwrite the handle with it */ + hPinHandleInt2 = ResManRegisterRes(psConnection->hResManContext, + RESMAN_TYPE_DC_PIN_HANDLE, + hPinHandleInt, + (RESMAN_FREE_FN)&DCBufferUnpin); + if (hPinHandleInt2 == IMG_NULL) + { + psDCBufferPinOUT->eError = PVRSRV_ERROR_UNABLE_TO_REGISTER_RESOURCE; + goto DCBufferPin_exit; + } + psDCBufferPinOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psDCBufferPinOUT->hPinHandle, + (IMG_HANDLE) hPinHandleInt2, + PVRSRV_HANDLE_TYPE_DC_PIN_HANDLE, + PVRSRV_HANDLE_ALLOC_FLAG_NONE + ); + if (psDCBufferPinOUT->eError != PVRSRV_OK) + { + goto DCBufferPin_exit; + } + + +DCBufferPin_exit: + if (psDCBufferPinOUT->eError != PVRSRV_OK) + { + /* If we have a valid resman item we should undo the bridge function by freeing the resman item */ + if (hPinHandleInt2) + { + PVRSRV_ERROR eError = ResManFreeResByPtr(hPinHandleInt2); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + } + else if (hPinHandleInt) + { + DCBufferUnpin(hPinHandleInt); + } + } + + + return 0; +} + +static IMG_INT +PVRSRVBridgeDCBufferUnpin(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_DCBUFFERUNPIN *psDCBufferUnpinIN, + PVRSRV_BRIDGE_OUT_DCBUFFERUNPIN *psDCBufferUnpinOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hPinHandleInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_DC_DCBUFFERUNPIN); + + + + + + { + /* Look up the address from the handle */ + psDCBufferUnpinOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hPinHandleInt2, + psDCBufferUnpinIN->hPinHandle, + PVRSRV_HANDLE_TYPE_DC_PIN_HANDLE); + if(psDCBufferUnpinOUT->eError != PVRSRV_OK) + { + goto DCBufferUnpin_exit; + } + + } + + psDCBufferUnpinOUT->eError = DCBufferUnpinResManProxy(hPinHandleInt2); + /* Exit early if bridged call fails */ + if(psDCBufferUnpinOUT->eError != PVRSRV_OK) + { + goto DCBufferUnpin_exit; + } + + psDCBufferUnpinOUT->eError = + PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psDCBufferUnpinIN->hPinHandle, + PVRSRV_HANDLE_TYPE_DC_PIN_HANDLE); + + +DCBufferUnpin_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeDCBufferAcquire(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_DCBUFFERACQUIRE *psDCBufferAcquireIN, + PVRSRV_BRIDGE_OUT_DCBUFFERACQUIRE *psDCBufferAcquireOUT, + CONNECTION_DATA *psConnection) +{ + DC_BUFFER * psBufferInt = IMG_NULL; + IMG_HANDLE hBufferInt2 = IMG_NULL; + PMR * psExtMemInt = IMG_NULL; + IMG_HANDLE hExtMemInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_DC_DCBUFFERACQUIRE); + + + + + + { + /* Look up the address from the handle */ + psDCBufferAcquireOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hBufferInt2, + psDCBufferAcquireIN->hBuffer, + PVRSRV_HANDLE_TYPE_DC_BUFFER); + if(psDCBufferAcquireOUT->eError != PVRSRV_OK) + { + goto DCBufferAcquire_exit; + } + + /* Look up the data from the resman address */ + psDCBufferAcquireOUT->eError = ResManFindPrivateDataByPtr(hBufferInt2, (IMG_VOID **) &psBufferInt); + + if(psDCBufferAcquireOUT->eError != PVRSRV_OK) + { + goto DCBufferAcquire_exit; + } + } + + psDCBufferAcquireOUT->eError = + DCBufferAcquire( + psBufferInt, + &psExtMemInt); + /* Exit early if bridged call fails */ + if(psDCBufferAcquireOUT->eError != PVRSRV_OK) + { + goto DCBufferAcquire_exit; + } + + /* Create a resman item and overwrite the handle with it */ + hExtMemInt2 = ResManRegisterRes(psConnection->hResManContext, + RESMAN_TYPE_PMR, + psExtMemInt, + (RESMAN_FREE_FN)&DCBufferRelease); + if (hExtMemInt2 == IMG_NULL) + { + psDCBufferAcquireOUT->eError = PVRSRV_ERROR_UNABLE_TO_REGISTER_RESOURCE; + goto DCBufferAcquire_exit; + } + psDCBufferAcquireOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psDCBufferAcquireOUT->hExtMem, + (IMG_HANDLE) hExtMemInt2, + PVRSRV_HANDLE_TYPE_DEVMEM_MEM_IMPORT, + PVRSRV_HANDLE_ALLOC_FLAG_NONE + ); + if (psDCBufferAcquireOUT->eError != PVRSRV_OK) + { + goto DCBufferAcquire_exit; + } + + +DCBufferAcquire_exit: + if (psDCBufferAcquireOUT->eError != PVRSRV_OK) + { + /* If we have a valid resman item we should undo the bridge function by freeing the resman item */ + if (hExtMemInt2) + { + PVRSRV_ERROR eError = ResManFreeResByPtr(hExtMemInt2); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + } + else if (psExtMemInt) + { + DCBufferRelease(psExtMemInt); + } + } + + + return 0; +} + +static IMG_INT +PVRSRVBridgeDCBufferRelease(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_DCBUFFERRELEASE *psDCBufferReleaseIN, + PVRSRV_BRIDGE_OUT_DCBUFFERRELEASE *psDCBufferReleaseOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hExtMemInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_DC_DCBUFFERRELEASE); + + + + + + { + /* Look up the address from the handle */ + psDCBufferReleaseOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hExtMemInt2, + psDCBufferReleaseIN->hExtMem, + PVRSRV_HANDLE_TYPE_DEVMEM_MEM_IMPORT); + if(psDCBufferReleaseOUT->eError != PVRSRV_OK) + { + goto DCBufferRelease_exit; + } + + } + + psDCBufferReleaseOUT->eError = DCBufferReleaseResManProxy(hExtMemInt2); + /* Exit early if bridged call fails */ + if(psDCBufferReleaseOUT->eError != PVRSRV_OK) + { + goto DCBufferRelease_exit; + } + + psDCBufferReleaseOUT->eError = + PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psDCBufferReleaseIN->hExtMem, + PVRSRV_HANDLE_TYPE_DEVMEM_MEM_IMPORT); + + +DCBufferRelease_exit: + + return 0; +} + + + +/* *************************************************************************** + * Server bridge dispatch related glue + */ + +PVRSRV_ERROR RegisterDCFunctions(IMG_VOID); +IMG_VOID UnregisterDCFunctions(IMG_VOID); + +/* + * Register all DC functions with services + */ +PVRSRV_ERROR RegisterDCFunctions(IMG_VOID) +{ + SetDispatchTableEntry(PVRSRV_BRIDGE_DC_DCDEVICESQUERYCOUNT, PVRSRVBridgeDCDevicesQueryCount); + SetDispatchTableEntry(PVRSRV_BRIDGE_DC_DCDEVICESENUMERATE, PVRSRVBridgeDCDevicesEnumerate); + SetDispatchTableEntry(PVRSRV_BRIDGE_DC_DCDEVICEACQUIRE, PVRSRVBridgeDCDeviceAcquire); + SetDispatchTableEntry(PVRSRV_BRIDGE_DC_DCDEVICERELEASE, PVRSRVBridgeDCDeviceRelease); + SetDispatchTableEntry(PVRSRV_BRIDGE_DC_DCGETINFO, PVRSRVBridgeDCGetInfo); + SetDispatchTableEntry(PVRSRV_BRIDGE_DC_DCPANELQUERYCOUNT, PVRSRVBridgeDCPanelQueryCount); + SetDispatchTableEntry(PVRSRV_BRIDGE_DC_DCPANELQUERY, PVRSRVBridgeDCPanelQuery); + SetDispatchTableEntry(PVRSRV_BRIDGE_DC_DCFORMATQUERY, PVRSRVBridgeDCFormatQuery); + SetDispatchTableEntry(PVRSRV_BRIDGE_DC_DCDIMQUERY, PVRSRVBridgeDCDimQuery); + SetDispatchTableEntry(PVRSRV_BRIDGE_DC_DCSETBLANK, PVRSRVBridgeDCSetBlank); + SetDispatchTableEntry(PVRSRV_BRIDGE_DC_DCSETVSYNCREPORTING, PVRSRVBridgeDCSetVSyncReporting); + SetDispatchTableEntry(PVRSRV_BRIDGE_DC_DCLASTVSYNCQUERY, PVRSRVBridgeDCLastVSyncQuery); + SetDispatchTableEntry(PVRSRV_BRIDGE_DC_DCSYSTEMBUFFERACQUIRE, PVRSRVBridgeDCSystemBufferAcquire); + SetDispatchTableEntry(PVRSRV_BRIDGE_DC_DCSYSTEMBUFFERRELEASE, PVRSRVBridgeDCSystemBufferRelease); + SetDispatchTableEntry(PVRSRV_BRIDGE_DC_DCDISPLAYCONTEXTCREATE, PVRSRVBridgeDCDisplayContextCreate); + SetDispatchTableEntry(PVRSRV_BRIDGE_DC_DCDISPLAYCONTEXTCONFIGURECHECK, PVRSRVBridgeDCDisplayContextConfigureCheck); + SetDispatchTableEntry(PVRSRV_BRIDGE_DC_DCDISPLAYCONTEXTCONFIGURE, PVRSRVBridgeDCDisplayContextConfigure); + SetDispatchTableEntry(PVRSRV_BRIDGE_DC_DCDISPLAYCONTEXTDESTROY, PVRSRVBridgeDCDisplayContextDestroy); + SetDispatchTableEntry(PVRSRV_BRIDGE_DC_DCBUFFERALLOC, PVRSRVBridgeDCBufferAlloc); + SetDispatchTableEntry(PVRSRV_BRIDGE_DC_DCBUFFERIMPORT, PVRSRVBridgeDCBufferImport); + SetDispatchTableEntry(PVRSRV_BRIDGE_DC_DCBUFFERFREE, PVRSRVBridgeDCBufferFree); + SetDispatchTableEntry(PVRSRV_BRIDGE_DC_DCBUFFERUNIMPORT, PVRSRVBridgeDCBufferUnimport); + SetDispatchTableEntry(PVRSRV_BRIDGE_DC_DCBUFFERPIN, PVRSRVBridgeDCBufferPin); + SetDispatchTableEntry(PVRSRV_BRIDGE_DC_DCBUFFERUNPIN, PVRSRVBridgeDCBufferUnpin); + SetDispatchTableEntry(PVRSRV_BRIDGE_DC_DCBUFFERACQUIRE, PVRSRVBridgeDCBufferAcquire); + SetDispatchTableEntry(PVRSRV_BRIDGE_DC_DCBUFFERRELEASE, PVRSRVBridgeDCBufferRelease); + + return PVRSRV_OK; +} + +/* + * Unregister all dc functions with services + */ +IMG_VOID UnregisterDCFunctions(IMG_VOID) +{ +} diff --git a/drivers/gpu/rogue/generated/debugmisc_bridge/common_debugmisc_bridge.h b/drivers/gpu/rogue/generated/debugmisc_bridge/common_debugmisc_bridge.h new file mode 100644 index 000000000000..e194537fb187 --- /dev/null +++ b/drivers/gpu/rogue/generated/debugmisc_bridge/common_debugmisc_bridge.h @@ -0,0 +1,160 @@ +/*************************************************************************/ /*! +@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 "devicemem_typedefs.h" +#include "rgx_bridge.h" +#include "pvrsrv_memallocflags.h" + + +#include "pvr_bridge_io.h" + +#define PVRSRV_BRIDGE_DEBUGMISC_CMD_FIRST (PVRSRV_BRIDGE_DEBUGMISC_START) +#define PVRSRV_BRIDGE_DEBUGMISC_DEBUGMISCSLCSETBYPASSSTATE PVRSRV_IOWR(PVRSRV_BRIDGE_DEBUGMISC_CMD_FIRST+0) +#define PVRSRV_BRIDGE_DEBUGMISC_RGXDEBUGMISCSETFWLOG PVRSRV_IOWR(PVRSRV_BRIDGE_DEBUGMISC_CMD_FIRST+1) +#define PVRSRV_BRIDGE_DEBUGMISC_RGXDEBUGMISCDUMPFREELISTPAGELIST PVRSRV_IOWR(PVRSRV_BRIDGE_DEBUGMISC_CMD_FIRST+2) +#define PVRSRV_BRIDGE_DEBUGMISC_PHYSMEMIMPORTSECBUF PVRSRV_IOWR(PVRSRV_BRIDGE_DEBUGMISC_CMD_FIRST+3) +#define PVRSRV_BRIDGE_DEBUGMISC_POWMONTESTIOCTL PVRSRV_IOWR(PVRSRV_BRIDGE_DEBUGMISC_CMD_FIRST+4) +#define PVRSRV_BRIDGE_DEBUGMISC_CMD_LAST (PVRSRV_BRIDGE_DEBUGMISC_CMD_FIRST+4) + + +/******************************************* + 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; + +/******************************************* + PowMonTestIoctl + *******************************************/ + +/* Bridge in structure for PowMonTestIoctl */ +typedef struct PVRSRV_BRIDGE_IN_POWMONTESTIOCTL_TAG +{ + IMG_UINT32 ui32Cmd; + IMG_UINT32 ui32In1; + IMG_UINT32 ui32In2; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_POWMONTESTIOCTL; + + +/* Bridge out structure for PowMonTestIoctl */ +typedef struct PVRSRV_BRIDGE_OUT_POWMONTESTIOCTL_TAG +{ + IMG_UINT32 ui32Out1; + IMG_UINT32 ui32Out2; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_POWMONTESTIOCTL; + +#endif /* COMMON_DEBUGMISC_BRIDGE_H */ diff --git a/drivers/gpu/rogue/generated/debugmisc_bridge/server_debugmisc_bridge.c b/drivers/gpu/rogue/generated/debugmisc_bridge/server_debugmisc_bridge.c new file mode 100644 index 000000000000..6a590d5ab268 --- /dev/null +++ b/drivers/gpu/rogue/generated/debugmisc_bridge/server_debugmisc_bridge.c @@ -0,0 +1,343 @@ +/*************************************************************************/ /*! +@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 + +/* *************************************************************************** + * Bridge proxy functions + */ + + + +/* *************************************************************************** + * Server-side bridge entry points + */ + +static IMG_INT +PVRSRVBridgeDebugMiscSLCSetBypassState(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_DEBUGMISCSLCSETBYPASSSTATE *psDebugMiscSLCSetBypassStateIN, + PVRSRV_BRIDGE_OUT_DEBUGMISCSLCSETBYPASSSTATE *psDebugMiscSLCSetBypassStateOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevNodeInt = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_DEBUGMISC_DEBUGMISCSLCSETBYPASSSTATE); + + + + + + { + /* Look up the address from the handle */ + psDebugMiscSLCSetBypassStateOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &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 ui32BridgeID, + PVRSRV_BRIDGE_IN_RGXDEBUGMISCSETFWLOG *psRGXDebugMiscSetFWLogIN, + PVRSRV_BRIDGE_OUT_RGXDEBUGMISCSETFWLOG *psRGXDebugMiscSetFWLogOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevNodeInt = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_DEBUGMISC_RGXDEBUGMISCSETFWLOG); + + + + + + { + /* Look up the address from the handle */ + psRGXDebugMiscSetFWLogOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &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 ui32BridgeID, + PVRSRV_BRIDGE_IN_RGXDEBUGMISCDUMPFREELISTPAGELIST *psRGXDebugMiscDumpFreelistPageListIN, + PVRSRV_BRIDGE_OUT_RGXDEBUGMISCDUMPFREELISTPAGELIST *psRGXDebugMiscDumpFreelistPageListOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevNodeInt = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_DEBUGMISC_RGXDEBUGMISCDUMPFREELISTPAGELIST); + + + + + + { + /* Look up the address from the handle */ + psRGXDebugMiscDumpFreelistPageListOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &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 ui32BridgeID, + PVRSRV_BRIDGE_IN_PHYSMEMIMPORTSECBUF *psPhysmemImportSecBufIN, + PVRSRV_BRIDGE_OUT_PHYSMEMIMPORTSECBUF *psPhysmemImportSecBufOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevNodeInt = IMG_NULL; + PMR * psPMRPtrInt = IMG_NULL; + IMG_HANDLE hPMRPtrInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_DEBUGMISC_PHYSMEMIMPORTSECBUF); + + + + + + { + /* Look up the address from the handle */ + psPhysmemImportSecBufOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &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; + } + + /* Create a resman item and overwrite the handle with it */ + hPMRPtrInt2 = ResManRegisterRes(psConnection->hResManContext, + RESMAN_TYPE_PMR, + psPMRPtrInt, + (RESMAN_FREE_FN)&PMRUnrefPMR); + if (hPMRPtrInt2 == IMG_NULL) + { + psPhysmemImportSecBufOUT->eError = PVRSRV_ERROR_UNABLE_TO_REGISTER_RESOURCE; + goto PhysmemImportSecBuf_exit; + } + psPhysmemImportSecBufOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psPhysmemImportSecBufOUT->hPMRPtr, + (IMG_HANDLE) hPMRPtrInt2, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR, + PVRSRV_HANDLE_ALLOC_FLAG_NONE + ); + if (psPhysmemImportSecBufOUT->eError != PVRSRV_OK) + { + goto PhysmemImportSecBuf_exit; + } + + +PhysmemImportSecBuf_exit: + if (psPhysmemImportSecBufOUT->eError != PVRSRV_OK) + { + /* If we have a valid resman item we should undo the bridge function by freeing the resman item */ + if (hPMRPtrInt2) + { + PVRSRV_ERROR eError = ResManFreeResByPtr(hPMRPtrInt2); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + } + else if (psPMRPtrInt) + { + PMRUnrefPMR(psPMRPtrInt); + } + } + + + return 0; +} + +static IMG_INT +PVRSRVBridgePowMonTestIoctl(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_POWMONTESTIOCTL *psPowMonTestIoctlIN, + PVRSRV_BRIDGE_OUT_POWMONTESTIOCTL *psPowMonTestIoctlOUT, + CONNECTION_DATA *psConnection) +{ + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_DEBUGMISC_POWMONTESTIOCTL); + + PVR_UNREFERENCED_PARAMETER(psConnection); + + + + + psPowMonTestIoctlOUT->eError = + PowMonTestIoctlKM( + psPowMonTestIoctlIN->ui32Cmd, + psPowMonTestIoctlIN->ui32In1, + psPowMonTestIoctlIN->ui32In2, + &psPowMonTestIoctlOUT->ui32Out1, + &psPowMonTestIoctlOUT->ui32Out2); + + + + + return 0; +} + + + +/* *************************************************************************** + * Server bridge dispatch related glue + */ + +PVRSRV_ERROR RegisterDEBUGMISCFunctions(IMG_VOID); +IMG_VOID UnregisterDEBUGMISCFunctions(IMG_VOID); + +/* + * Register all DEBUGMISC functions with services + */ +PVRSRV_ERROR RegisterDEBUGMISCFunctions(IMG_VOID) +{ + SetDispatchTableEntry(PVRSRV_BRIDGE_DEBUGMISC_DEBUGMISCSLCSETBYPASSSTATE, PVRSRVBridgeDebugMiscSLCSetBypassState); + SetDispatchTableEntry(PVRSRV_BRIDGE_DEBUGMISC_RGXDEBUGMISCSETFWLOG, PVRSRVBridgeRGXDebugMiscSetFWLog); + SetDispatchTableEntry(PVRSRV_BRIDGE_DEBUGMISC_RGXDEBUGMISCDUMPFREELISTPAGELIST, PVRSRVBridgeRGXDebugMiscDumpFreelistPageList); + SetDispatchTableEntry(PVRSRV_BRIDGE_DEBUGMISC_PHYSMEMIMPORTSECBUF, PVRSRVBridgePhysmemImportSecBuf); + SetDispatchTableEntry(PVRSRV_BRIDGE_DEBUGMISC_POWMONTESTIOCTL, PVRSRVBridgePowMonTestIoctl); + + return PVRSRV_OK; +} + +/* + * Unregister all debugmisc functions with services + */ +IMG_VOID UnregisterDEBUGMISCFunctions(IMG_VOID) +{ +} diff --git a/drivers/gpu/rogue/generated/dmabuf_bridge/common_dmabuf_bridge.h b/drivers/gpu/rogue/generated/dmabuf_bridge/common_dmabuf_bridge.h new file mode 100644 index 000000000000..a4000059a8d4 --- /dev/null +++ b/drivers/gpu/rogue/generated/dmabuf_bridge/common_dmabuf_bridge.h @@ -0,0 +1,79 @@ +/*************************************************************************/ /*! +@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 "pvrsrv_memallocflags.h" + + +#include "pvr_bridge_io.h" + +#define PVRSRV_BRIDGE_DMABUF_CMD_FIRST (PVRSRV_BRIDGE_DMABUF_START) +#define PVRSRV_BRIDGE_DMABUF_PHYSMEMIMPORTDMABUF PVRSRV_IOWR(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/generated/dmabuf_bridge/server_dmabuf_bridge.c b/drivers/gpu/rogue/generated/dmabuf_bridge/server_dmabuf_bridge.c new file mode 100644 index 000000000000..ef453223486e --- /dev/null +++ b/drivers/gpu/rogue/generated/dmabuf_bridge/server_dmabuf_bridge.c @@ -0,0 +1,174 @@ +/*************************************************************************/ /*! +@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 + +/* *************************************************************************** + * Bridge proxy functions + */ + + + +/* *************************************************************************** + * Server-side bridge entry points + */ + +static IMG_INT +PVRSRVBridgePhysmemImportDmaBuf(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_PHYSMEMIMPORTDMABUF *psPhysmemImportDmaBufIN, + PVRSRV_BRIDGE_OUT_PHYSMEMIMPORTDMABUF *psPhysmemImportDmaBufOUT, + CONNECTION_DATA *psConnection) +{ + PMR * psPMRPtrInt = IMG_NULL; + IMG_HANDLE hPMRPtrInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_DMABUF_PHYSMEMIMPORTDMABUF); + + + + + + 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; + } + + /* Create a resman item and overwrite the handle with it */ + hPMRPtrInt2 = ResManRegisterRes(psConnection->hResManContext, + RESMAN_TYPE_PMR, + psPMRPtrInt, + (RESMAN_FREE_FN)&PMRUnrefPMR); + if (hPMRPtrInt2 == IMG_NULL) + { + psPhysmemImportDmaBufOUT->eError = PVRSRV_ERROR_UNABLE_TO_REGISTER_RESOURCE; + goto PhysmemImportDmaBuf_exit; + } + psPhysmemImportDmaBufOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psPhysmemImportDmaBufOUT->hPMRPtr, + (IMG_HANDLE) hPMRPtrInt2, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR, + PVRSRV_HANDLE_ALLOC_FLAG_NONE + ); + if (psPhysmemImportDmaBufOUT->eError != PVRSRV_OK) + { + goto PhysmemImportDmaBuf_exit; + } + + +PhysmemImportDmaBuf_exit: + if (psPhysmemImportDmaBufOUT->eError != PVRSRV_OK) + { + /* If we have a valid resman item we should undo the bridge function by freeing the resman item */ + if (hPMRPtrInt2) + { + PVRSRV_ERROR eError = ResManFreeResByPtr(hPMRPtrInt2); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + } + else if (psPMRPtrInt) + { + PMRUnrefPMR(psPMRPtrInt); + } + } + + + return 0; +} + + + +/* *************************************************************************** + * Server bridge dispatch related glue + */ + +PVRSRV_ERROR RegisterDMABUFFunctions(IMG_VOID); +IMG_VOID UnregisterDMABUFFunctions(IMG_VOID); + +/* + * Register all DMABUF functions with services + */ +PVRSRV_ERROR RegisterDMABUFFunctions(IMG_VOID) +{ + SetDispatchTableEntry(PVRSRV_BRIDGE_DMABUF_PHYSMEMIMPORTDMABUF, PVRSRVBridgePhysmemImportDmaBuf); + + return PVRSRV_OK; +} + +/* + * Unregister all dmabuf functions with services + */ +IMG_VOID UnregisterDMABUFFunctions(IMG_VOID) +{ +} diff --git a/drivers/gpu/rogue/generated/dmm_bridge/client_mm_bridge.c b/drivers/gpu/rogue/generated/dmm_bridge/client_mm_bridge.c new file mode 100644 index 000000000000..0936f42e23f4 --- /dev/null +++ b/drivers/gpu/rogue/generated/dmm_bridge/client_mm_bridge.c @@ -0,0 +1,535 @@ +/*************************************************************************/ /*! +@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 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) +{ + PVRSRV_ERROR eError; + IMG_HANDLE hDeviceNodeInt; + PVR_UNREFERENCED_PARAMETER(hBridge); + + hDeviceNodeInt = (IMG_HANDLE) hDeviceNode; + + eError = + HeapCfgHeapDetails( + hDeviceNodeInt, + ui32HeapConfigIndex, + ui32HeapIndex, + ui32HeapNameBufSz, + puiHeapNameOut, + psDevVAddrBase, + puiHeapLength, + pui32Log2DataPageSizeOut); + + return eError; +} + diff --git a/drivers/gpu/rogue/generated/dmm_bridge/client_mm_bridge.h b/drivers/gpu/rogue/generated/dmm_bridge/client_mm_bridge.h new file mode 100644 index 000000000000..451ba840fa8a --- /dev/null +++ b/drivers/gpu/rogue/generated/dmm_bridge/client_mm_bridge.h @@ -0,0 +1,165 @@ +/*************************************************************************/ /*! +@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 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); + + +#endif /* CLIENT_MM_BRIDGE_H */ diff --git a/drivers/gpu/rogue/generated/dpdumpmm_bridge/client_pdumpmm_bridge.c b/drivers/gpu/rogue/generated/dpdumpmm_bridge/client_pdumpmm_bridge.c new file mode 100644 index 000000000000..a6dc4d0a5505 --- /dev/null +++ b/drivers/gpu/rogue/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/generated/dpvrtl_bridge/client_pvrtl_bridge.c b/drivers/gpu/rogue/generated/dpvrtl_bridge/client_pvrtl_bridge.c new file mode 100644 index 000000000000..6e63c93e3cfc --- /dev/null +++ b/drivers/gpu/rogue/generated/dpvrtl_bridge/client_pvrtl_bridge.c @@ -0,0 +1,177 @@ +/*************************************************************************/ /*! +@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 "tltestdefs.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; +} + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeTLTestIoctl(IMG_HANDLE hBridge, + IMG_UINT32 ui32Cmd, + IMG_BYTE *psIn1, + IMG_UINT32 ui32In2, + IMG_UINT32 *pui32Out1, + IMG_UINT32 *pui32Out2) +{ + PVRSRV_ERROR eError; + PVR_UNREFERENCED_PARAMETER(hBridge); + + + eError = + TLServerTestIoctlKM( + ui32Cmd, + psIn1, + ui32In2, + pui32Out1, + pui32Out2); + + return eError; +} + diff --git a/drivers/gpu/rogue/generated/dri_bridge/client_ri_bridge.c b/drivers/gpu/rogue/generated/dri_bridge/client_ri_bridge.c new file mode 100644 index 000000000000..88b859fdb5cf --- /dev/null +++ b/drivers/gpu/rogue/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_SIZE_T uiLogicalSize) +{ + PVRSRV_ERROR eError; + PMR * psPMRHandleInt; + PVR_UNREFERENCED_PARAMETER(hBridge); + + psPMRHandleInt = (PMR *) hPMRHandle; + + eError = + RIWritePMREntryKM( + psPMRHandleInt, + ui32TextASize, + puiTextA, + uiLogicalSize); + + return eError; +} + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeRIWriteMEMDESCEntry(IMG_HANDLE hBridge, + IMG_HANDLE hPMRHandle, + IMG_UINT32 ui32TextBSize, + const IMG_CHAR *puiTextB, + IMG_SIZE_T uiOffset, + IMG_SIZE_T uiSize, + 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, + uiOffset, + uiSize, + 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/generated/dsync_bridge/client_sync_bridge.c b/drivers/gpu/rogue/generated/dsync_bridge/client_sync_bridge.c new file mode 100644 index 000000000000..36e757479a6b --- /dev/null +++ b/drivers/gpu/rogue/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/generated/dsync_bridge/client_sync_bridge.h b/drivers/gpu/rogue/generated/dsync_bridge/client_sync_bridge.h new file mode 100644 index 000000000000..e80501c9638f --- /dev/null +++ b/drivers/gpu/rogue/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/generated/mm_bridge/common_mm_bridge.h b/drivers/gpu/rogue/generated/mm_bridge/common_mm_bridge.h new file mode 100644 index 000000000000..119a04a5486c --- /dev/null +++ b/drivers/gpu/rogue/generated/mm_bridge/common_mm_bridge.h @@ -0,0 +1,527 @@ +/*************************************************************************/ /*! +@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 "pvrsrv_memallocflags.h" +#include "devicemem_typedefs.h" + + +#include "pvr_bridge_io.h" + +#define PVRSRV_BRIDGE_MM_CMD_FIRST (PVRSRV_BRIDGE_MM_START) +#define PVRSRV_BRIDGE_MM_PMREXPORTPMR PVRSRV_IOWR(PVRSRV_BRIDGE_MM_CMD_FIRST+0) +#define PVRSRV_BRIDGE_MM_PMRUNEXPORTPMR PVRSRV_IOWR(PVRSRV_BRIDGE_MM_CMD_FIRST+1) +#define PVRSRV_BRIDGE_MM_PMRGETUID PVRSRV_IOWR(PVRSRV_BRIDGE_MM_CMD_FIRST+2) +#define PVRSRV_BRIDGE_MM_PMRMAKESERVEREXPORTCLIENTEXPORT PVRSRV_IOWR(PVRSRV_BRIDGE_MM_CMD_FIRST+3) +#define PVRSRV_BRIDGE_MM_PMRUNMAKESERVEREXPORTCLIENTEXPORT PVRSRV_IOWR(PVRSRV_BRIDGE_MM_CMD_FIRST+4) +#define PVRSRV_BRIDGE_MM_PMRIMPORTPMR PVRSRV_IOWR(PVRSRV_BRIDGE_MM_CMD_FIRST+5) +#define PVRSRV_BRIDGE_MM_DEVMEMINTCTXCREATE PVRSRV_IOWR(PVRSRV_BRIDGE_MM_CMD_FIRST+6) +#define PVRSRV_BRIDGE_MM_DEVMEMINTCTXDESTROY PVRSRV_IOWR(PVRSRV_BRIDGE_MM_CMD_FIRST+7) +#define PVRSRV_BRIDGE_MM_DEVMEMINTHEAPCREATE PVRSRV_IOWR(PVRSRV_BRIDGE_MM_CMD_FIRST+8) +#define PVRSRV_BRIDGE_MM_DEVMEMINTHEAPDESTROY PVRSRV_IOWR(PVRSRV_BRIDGE_MM_CMD_FIRST+9) +#define PVRSRV_BRIDGE_MM_DEVMEMINTMAPPMR PVRSRV_IOWR(PVRSRV_BRIDGE_MM_CMD_FIRST+10) +#define PVRSRV_BRIDGE_MM_DEVMEMINTUNMAPPMR PVRSRV_IOWR(PVRSRV_BRIDGE_MM_CMD_FIRST+11) +#define PVRSRV_BRIDGE_MM_DEVMEMINTRESERVERANGE PVRSRV_IOWR(PVRSRV_BRIDGE_MM_CMD_FIRST+12) +#define PVRSRV_BRIDGE_MM_DEVMEMINTUNRESERVERANGE PVRSRV_IOWR(PVRSRV_BRIDGE_MM_CMD_FIRST+13) +#define PVRSRV_BRIDGE_MM_PHYSMEMNEWRAMBACKEDPMR PVRSRV_IOWR(PVRSRV_BRIDGE_MM_CMD_FIRST+14) +#define PVRSRV_BRIDGE_MM_PMRLOCALIMPORTPMR PVRSRV_IOWR(PVRSRV_BRIDGE_MM_CMD_FIRST+15) +#define PVRSRV_BRIDGE_MM_PMRUNREFPMR PVRSRV_IOWR(PVRSRV_BRIDGE_MM_CMD_FIRST+16) +#define PVRSRV_BRIDGE_MM_DEVMEMSLCFLUSHINVALREQUEST PVRSRV_IOWR(PVRSRV_BRIDGE_MM_CMD_FIRST+17) +#define PVRSRV_BRIDGE_MM_HEAPCFGHEAPCONFIGCOUNT PVRSRV_IOWR(PVRSRV_BRIDGE_MM_CMD_FIRST+18) +#define PVRSRV_BRIDGE_MM_HEAPCFGHEAPCOUNT PVRSRV_IOWR(PVRSRV_BRIDGE_MM_CMD_FIRST+19) +#define PVRSRV_BRIDGE_MM_HEAPCFGHEAPCONFIGNAME PVRSRV_IOWR(PVRSRV_BRIDGE_MM_CMD_FIRST+20) +#define PVRSRV_BRIDGE_MM_HEAPCFGHEAPDETAILS PVRSRV_IOWR(PVRSRV_BRIDGE_MM_CMD_FIRST+21) +#define PVRSRV_BRIDGE_MM_CMD_LAST (PVRSRV_BRIDGE_MM_CMD_FIRST+21) + + +/******************************************* + 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; + +/******************************************* + DevmemIntGetSystemLog2PageSize + *******************************************/ + +/* Bridge in structure for DevmemIntGetSystemLog2PageSize */ +typedef struct PVRSRV_BRIDGE_IN_DEVMEMINTGETSYSTEMLOG2PAGESIZE_TAG +{ + IMG_UINT32 ui32EmptyStructPlaceholder; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_DEVMEMINTGETSYSTEMLOG2PAGESIZE; + + +/* Bridge out structure for DevmemIntGetSystemLog2PageSize */ +typedef struct PVRSRV_BRIDGE_OUT_DEVMEMINTGETSYSTEMLOG2PAGESIZE_TAG +{ + IMG_UINT32 ui32Log2PageSize; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DEVMEMINTGETSYSTEMLOG2PAGESIZE; + +/******************************************* + 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; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_HEAPCFGHEAPDETAILS; + +#endif /* COMMON_MM_BRIDGE_H */ diff --git a/drivers/gpu/rogue/generated/mm_bridge/server_mm_bridge.c b/drivers/gpu/rogue/generated/mm_bridge/server_mm_bridge.c new file mode 100644 index 000000000000..2b42bcdc8a35 --- /dev/null +++ b/drivers/gpu/rogue/generated/mm_bridge/server_mm_bridge.c @@ -0,0 +1,1851 @@ +/*************************************************************************/ /*! +@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 + +/* *************************************************************************** + * Bridge proxy functions + */ + +static PVRSRV_ERROR +PMRUnexportPMRResManProxy(IMG_HANDLE hResmanItem) +{ + PVRSRV_ERROR eError; + + eError = ResManFreeResByPtr(hResmanItem); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + + return eError; +} + +static PVRSRV_ERROR +PMRUnmakeServerExportClientExportResManProxy(IMG_HANDLE hResmanItem) +{ + PVRSRV_ERROR eError; + + eError = ResManFreeResByPtr(hResmanItem); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + + return eError; +} + +static PVRSRV_ERROR +DevmemIntCtxDestroyResManProxy(IMG_HANDLE hResmanItem) +{ + PVRSRV_ERROR eError; + + eError = ResManFreeResByPtr(hResmanItem); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + + return eError; +} + +static PVRSRV_ERROR +DevmemIntHeapDestroyResManProxy(IMG_HANDLE hResmanItem) +{ + PVRSRV_ERROR eError; + + eError = ResManFreeResByPtr(hResmanItem); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + + return eError; +} + +static PVRSRV_ERROR +DevmemIntUnmapPMRResManProxy(IMG_HANDLE hResmanItem) +{ + PVRSRV_ERROR eError; + + eError = ResManFreeResByPtr(hResmanItem); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + + return eError; +} + +static PVRSRV_ERROR +DevmemIntUnreserveRangeResManProxy(IMG_HANDLE hResmanItem) +{ + PVRSRV_ERROR eError; + + eError = ResManFreeResByPtr(hResmanItem); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + + return eError; +} + +static PVRSRV_ERROR +PMRUnrefPMRResManProxy(IMG_HANDLE hResmanItem) +{ + PVRSRV_ERROR eError; + + eError = ResManFreeResByPtr(hResmanItem); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + + return eError; +} + + + +/* *************************************************************************** + * Server-side bridge entry points + */ + +static IMG_INT +PVRSRVBridgePMRExportPMR(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_PMREXPORTPMR *psPMRExportPMRIN, + PVRSRV_BRIDGE_OUT_PMREXPORTPMR *psPMRExportPMROUT, + CONNECTION_DATA *psConnection) +{ + PMR * psPMRInt = IMG_NULL; + IMG_HANDLE hPMRInt2 = IMG_NULL; + PMR_EXPORT * psPMRExportInt = IMG_NULL; + IMG_HANDLE hPMRExportInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_MM_PMREXPORTPMR); + + + + + + PMRLock(); + { + /* Look up the address from the handle */ + psPMRExportPMROUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hPMRInt2, + psPMRExportPMRIN->hPMR, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR); + if(psPMRExportPMROUT->eError != PVRSRV_OK) + { + PMRUnlock(); + goto PMRExportPMR_exit; + } + + /* Look up the data from the resman address */ + psPMRExportPMROUT->eError = ResManFindPrivateDataByPtr(hPMRInt2, (IMG_VOID **) &psPMRInt); + + 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(); + + /* Create a resman item and overwrite the handle with it */ + hPMRExportInt2 = ResManRegisterRes(psConnection->hResManContext, + RESMAN_TYPE_PMR_EXPORT, + psPMRExportInt, + (RESMAN_FREE_FN)&PMRUnexportPMR); + if (hPMRExportInt2 == IMG_NULL) + { + psPMRExportPMROUT->eError = PVRSRV_ERROR_UNABLE_TO_REGISTER_RESOURCE; + goto PMRExportPMR_exit; + } + /* see if it's already exported */ + psPMRExportPMROUT->eError = + PVRSRVFindHandle(KERNEL_HANDLE_BASE, + &psPMRExportPMROUT->hPMRExport, + (IMG_HANDLE) hPMRExportInt2, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR_EXPORT); + if(psPMRExportPMROUT->eError == PVRSRV_OK) + { + /* It's already exported */ + return 0; + } + + psPMRExportPMROUT->eError = PVRSRVAllocHandle(KERNEL_HANDLE_BASE, + &psPMRExportPMROUT->hPMRExport, + (IMG_HANDLE) hPMRExportInt2, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR_EXPORT, + PVRSRV_HANDLE_ALLOC_FLAG_NONE + ); + if (psPMRExportPMROUT->eError != PVRSRV_OK) + { + goto PMRExportPMR_exit; + } + + +PMRExportPMR_exit: + if (psPMRExportPMROUT->eError != PVRSRV_OK) + { + /* If we have a valid resman item we should undo the bridge function by freeing the resman item */ + if (hPMRExportInt2) + { + PVRSRV_ERROR eError = ResManFreeResByPtr(hPMRExportInt2); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + } + else if (psPMRExportInt) + { + PMRUnexportPMR(psPMRExportInt); + } + } + + + return 0; +} + +static IMG_INT +PVRSRVBridgePMRUnexportPMR(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_PMRUNEXPORTPMR *psPMRUnexportPMRIN, + PVRSRV_BRIDGE_OUT_PMRUNEXPORTPMR *psPMRUnexportPMROUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hPMRExportInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_MM_PMRUNEXPORTPMR); + + PVR_UNREFERENCED_PARAMETER(psConnection); + + + + PMRLock(); + { + /* Look up the address from the handle */ + psPMRUnexportPMROUT->eError = + PVRSRVLookupHandle(KERNEL_HANDLE_BASE, + (IMG_HANDLE *) &hPMRExportInt2, + psPMRUnexportPMRIN->hPMRExport, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR_EXPORT); + if(psPMRUnexportPMROUT->eError != PVRSRV_OK) + { + PMRUnlock(); + goto PMRUnexportPMR_exit; + } + + } + PMRUnlock(); + + psPMRUnexportPMROUT->eError = PMRUnexportPMRResManProxy(hPMRExportInt2); + /* Exit early if bridged call fails */ + if(psPMRUnexportPMROUT->eError != PVRSRV_OK) + { + goto PMRUnexportPMR_exit; + } + + psPMRUnexportPMROUT->eError = + PVRSRVReleaseHandle(KERNEL_HANDLE_BASE, + (IMG_HANDLE) psPMRUnexportPMRIN->hPMRExport, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR_EXPORT); + + +PMRUnexportPMR_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgePMRGetUID(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_PMRGETUID *psPMRGetUIDIN, + PVRSRV_BRIDGE_OUT_PMRGETUID *psPMRGetUIDOUT, + CONNECTION_DATA *psConnection) +{ + PMR * psPMRInt = IMG_NULL; + IMG_HANDLE hPMRInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_MM_PMRGETUID); + + + + + PMRLock(); + { + /* Look up the address from the handle */ + psPMRGetUIDOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hPMRInt2, + psPMRGetUIDIN->hPMR, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR); + if(psPMRGetUIDOUT->eError != PVRSRV_OK) + { + goto PMRGetUID_exit; + } + + /* Look up the data from the resman address */ + psPMRGetUIDOUT->eError = ResManFindPrivateDataByPtr(hPMRInt2, (IMG_VOID **) &psPMRInt); + + if(psPMRGetUIDOUT->eError != PVRSRV_OK) + { + goto PMRGetUID_exit; + } + } + + psPMRGetUIDOUT->eError = + PMRGetUID( + psPMRInt, + &psPMRGetUIDOUT->ui64UID); + + + +PMRGetUID_exit: + PMRUnlock(); + + return 0; +} + +static IMG_INT +PVRSRVBridgePMRMakeServerExportClientExport(IMG_UINT32 ui32BridgeID, + 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 hPMRExportOutInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_MM_PMRMAKESERVEREXPORTCLIENTEXPORT); + + + + + + { + /* Look up the address from the handle */ + psPMRMakeServerExportClientExportOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &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; + } + + /* Create a resman item and overwrite the handle with it */ + hPMRExportOutInt2 = ResManRegisterRes(psConnection->hResManContext, + RESMAN_TYPE_PMR_EXPORT, + psPMRExportOutInt, + (RESMAN_FREE_FN)&PMRUnmakeServerExportClientExport); + if (hPMRExportOutInt2 == IMG_NULL) + { + psPMRMakeServerExportClientExportOUT->eError = PVRSRV_ERROR_UNABLE_TO_REGISTER_RESOURCE; + goto PMRMakeServerExportClientExport_exit; + } + /* see if it's already exported */ + psPMRMakeServerExportClientExportOUT->eError = + PVRSRVFindHandle(KERNEL_HANDLE_BASE, + &psPMRMakeServerExportClientExportOUT->hPMRExportOut, + (IMG_HANDLE) hPMRExportOutInt2, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR_EXPORT); + if(psPMRMakeServerExportClientExportOUT->eError == PVRSRV_OK) + { + /* It's already exported */ + return 0; + } + + psPMRMakeServerExportClientExportOUT->eError = PVRSRVAllocHandle(KERNEL_HANDLE_BASE, + &psPMRMakeServerExportClientExportOUT->hPMRExportOut, + (IMG_HANDLE) hPMRExportOutInt2, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR_EXPORT, + PVRSRV_HANDLE_ALLOC_FLAG_NONE + ); + if (psPMRMakeServerExportClientExportOUT->eError != PVRSRV_OK) + { + goto PMRMakeServerExportClientExport_exit; + } + + +PMRMakeServerExportClientExport_exit: + if (psPMRMakeServerExportClientExportOUT->eError != PVRSRV_OK) + { + /* If we have a valid resman item we should undo the bridge function by freeing the resman item */ + if (hPMRExportOutInt2) + { + PVRSRV_ERROR eError = ResManFreeResByPtr(hPMRExportOutInt2); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + } + else if (psPMRExportOutInt) + { + PMRUnmakeServerExportClientExport(psPMRExportOutInt); + } + } + + + return 0; +} + +static IMG_INT +PVRSRVBridgePMRUnmakeServerExportClientExport(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_PMRUNMAKESERVEREXPORTCLIENTEXPORT *psPMRUnmakeServerExportClientExportIN, + PVRSRV_BRIDGE_OUT_PMRUNMAKESERVEREXPORTCLIENTEXPORT *psPMRUnmakeServerExportClientExportOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hPMRExportInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_MM_PMRUNMAKESERVEREXPORTCLIENTEXPORT); + + PVR_UNREFERENCED_PARAMETER(psConnection); + + + + + { + /* Look up the address from the handle */ + psPMRUnmakeServerExportClientExportOUT->eError = + PVRSRVLookupHandle(KERNEL_HANDLE_BASE, + (IMG_HANDLE *) &hPMRExportInt2, + psPMRUnmakeServerExportClientExportIN->hPMRExport, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR_EXPORT); + if(psPMRUnmakeServerExportClientExportOUT->eError != PVRSRV_OK) + { + goto PMRUnmakeServerExportClientExport_exit; + } + + } + + psPMRUnmakeServerExportClientExportOUT->eError = PMRUnmakeServerExportClientExportResManProxy(hPMRExportInt2); + /* Exit early if bridged call fails */ + if(psPMRUnmakeServerExportClientExportOUT->eError != PVRSRV_OK) + { + goto PMRUnmakeServerExportClientExport_exit; + } + + psPMRUnmakeServerExportClientExportOUT->eError = + PVRSRVReleaseHandle(KERNEL_HANDLE_BASE, + (IMG_HANDLE) psPMRUnmakeServerExportClientExportIN->hPMRExport, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR_EXPORT); + + +PMRUnmakeServerExportClientExport_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgePMRImportPMR(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_PMRIMPORTPMR *psPMRImportPMRIN, + PVRSRV_BRIDGE_OUT_PMRIMPORTPMR *psPMRImportPMROUT, + CONNECTION_DATA *psConnection) +{ + PMR_EXPORT * psPMRExportInt = IMG_NULL; + IMG_HANDLE hPMRExportInt2 = IMG_NULL; + PMR * psPMRInt = IMG_NULL; + IMG_HANDLE hPMRInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_MM_PMRIMPORTPMR); + + + + +#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_HANDLE *) &hPMRExportInt2, + psPMRImportPMRIN->hPMRExport, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR_EXPORT); + if(psPMRImportPMROUT->eError != PVRSRV_OK) + { + PMRUnlock(); + goto PMRImportPMR_exit; + } + + /* Look up the data from the resman address */ + psPMRImportPMROUT->eError = ResManFindPrivateDataByPtr(hPMRExportInt2, (IMG_VOID **) &psPMRExportInt); + + 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(); + + /* Create a resman item and overwrite the handle with it */ + hPMRInt2 = ResManRegisterRes(psConnection->hResManContext, + RESMAN_TYPE_PMR, + psPMRInt, + (RESMAN_FREE_FN)&PMRUnrefPMR); + if (hPMRInt2 == IMG_NULL) + { + psPMRImportPMROUT->eError = PVRSRV_ERROR_UNABLE_TO_REGISTER_RESOURCE; + goto PMRImportPMR_exit; + } + psPMRImportPMROUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psPMRImportPMROUT->hPMR, + (IMG_HANDLE) hPMRInt2, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR, + PVRSRV_HANDLE_ALLOC_FLAG_NONE + ); + if (psPMRImportPMROUT->eError != PVRSRV_OK) + { + goto PMRImportPMR_exit; + } + + +PMRImportPMR_exit: + if (psPMRImportPMROUT->eError != PVRSRV_OK) + { + /* If we have a valid resman item we should undo the bridge function by freeing the resman item */ + if (hPMRInt2) + { + PVRSRV_ERROR eError = ResManFreeResByPtr(hPMRInt2); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + } + else if (psPMRInt) + { + PMRUnrefPMR(psPMRInt); + } + } + + + return 0; +} + +static IMG_INT +PVRSRVBridgeDevmemIntCtxCreate(IMG_UINT32 ui32BridgeID, + 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 hDevMemServerContextInt2 = IMG_NULL; + IMG_HANDLE hPrivDataInt = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_MM_DEVMEMINTCTXCREATE); + + + + psDevmemIntCtxCreateOUT->hDevMemServerContext = IMG_NULL; + + + { + /* Look up the address from the handle */ + psDevmemIntCtxCreateOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &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; + } + + /* Create a resman item and overwrite the handle with it */ + hDevMemServerContextInt2 = ResManRegisterRes(psConnection->hResManContext, + RESMAN_TYPE_DEVICEMEM2_CONTEXT, + psDevMemServerContextInt, + (RESMAN_FREE_FN)&DevmemIntCtxDestroy); + if (hDevMemServerContextInt2 == IMG_NULL) + { + psDevmemIntCtxCreateOUT->eError = PVRSRV_ERROR_UNABLE_TO_REGISTER_RESOURCE; + goto DevmemIntCtxCreate_exit; + } + psDevmemIntCtxCreateOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psDevmemIntCtxCreateOUT->hDevMemServerContext, + (IMG_HANDLE) hDevMemServerContextInt2, + PVRSRV_HANDLE_TYPE_DEVMEMINT_CTX, + PVRSRV_HANDLE_ALLOC_FLAG_NONE + ); + if (psDevmemIntCtxCreateOUT->eError != PVRSRV_OK) + { + goto DevmemIntCtxCreate_exit; + } + psDevmemIntCtxCreateOUT->eError = PVRSRVAllocSubHandle(psConnection->psHandleBase, + &psDevmemIntCtxCreateOUT->hPrivData, + (IMG_HANDLE) 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) + { + PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psDevmemIntCtxCreateOUT->hDevMemServerContext, + PVRSRV_HANDLE_TYPE_DEVMEMINT_CTX); + } + + /* If we have a valid resman item we should undo the bridge function by freeing the resman item */ + if (hDevMemServerContextInt2) + { + PVRSRV_ERROR eError = ResManFreeResByPtr(hDevMemServerContextInt2); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + } + else if (psDevMemServerContextInt) + { + DevmemIntCtxDestroy(psDevMemServerContextInt); + } + } + + + return 0; +} + +static IMG_INT +PVRSRVBridgeDevmemIntCtxDestroy(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_DEVMEMINTCTXDESTROY *psDevmemIntCtxDestroyIN, + PVRSRV_BRIDGE_OUT_DEVMEMINTCTXDESTROY *psDevmemIntCtxDestroyOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevmemServerContextInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_MM_DEVMEMINTCTXDESTROY); + + + + + + { + /* Look up the address from the handle */ + psDevmemIntCtxDestroyOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hDevmemServerContextInt2, + psDevmemIntCtxDestroyIN->hDevmemServerContext, + PVRSRV_HANDLE_TYPE_DEVMEMINT_CTX); + if(psDevmemIntCtxDestroyOUT->eError != PVRSRV_OK) + { + goto DevmemIntCtxDestroy_exit; + } + + } + + psDevmemIntCtxDestroyOUT->eError = DevmemIntCtxDestroyResManProxy(hDevmemServerContextInt2); + /* Exit early if bridged call fails */ + if(psDevmemIntCtxDestroyOUT->eError != PVRSRV_OK) + { + goto DevmemIntCtxDestroy_exit; + } + + psDevmemIntCtxDestroyOUT->eError = + PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psDevmemIntCtxDestroyIN->hDevmemServerContext, + PVRSRV_HANDLE_TYPE_DEVMEMINT_CTX); + + +DevmemIntCtxDestroy_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeDevmemIntHeapCreate(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_DEVMEMINTHEAPCREATE *psDevmemIntHeapCreateIN, + PVRSRV_BRIDGE_OUT_DEVMEMINTHEAPCREATE *psDevmemIntHeapCreateOUT, + CONNECTION_DATA *psConnection) +{ + DEVMEMINT_CTX * psDevmemCtxInt = IMG_NULL; + IMG_HANDLE hDevmemCtxInt2 = IMG_NULL; + DEVMEMINT_HEAP * psDevmemHeapPtrInt = IMG_NULL; + IMG_HANDLE hDevmemHeapPtrInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_MM_DEVMEMINTHEAPCREATE); + + + + + + { + /* Look up the address from the handle */ + psDevmemIntHeapCreateOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hDevmemCtxInt2, + psDevmemIntHeapCreateIN->hDevmemCtx, + PVRSRV_HANDLE_TYPE_DEVMEMINT_CTX); + if(psDevmemIntHeapCreateOUT->eError != PVRSRV_OK) + { + goto DevmemIntHeapCreate_exit; + } + + /* Look up the data from the resman address */ + psDevmemIntHeapCreateOUT->eError = ResManFindPrivateDataByPtr(hDevmemCtxInt2, (IMG_VOID **) &psDevmemCtxInt); + + 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; + } + + /* Create a resman item and overwrite the handle with it */ + hDevmemHeapPtrInt2 = ResManRegisterRes(psConnection->hResManContext, + RESMAN_TYPE_DEVICEMEM2_HEAP, + psDevmemHeapPtrInt, + (RESMAN_FREE_FN)&DevmemIntHeapDestroy); + if (hDevmemHeapPtrInt2 == IMG_NULL) + { + psDevmemIntHeapCreateOUT->eError = PVRSRV_ERROR_UNABLE_TO_REGISTER_RESOURCE; + goto DevmemIntHeapCreate_exit; + } + psDevmemIntHeapCreateOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psDevmemIntHeapCreateOUT->hDevmemHeapPtr, + (IMG_HANDLE) hDevmemHeapPtrInt2, + PVRSRV_HANDLE_TYPE_DEVMEMINT_HEAP, + PVRSRV_HANDLE_ALLOC_FLAG_NONE + ); + if (psDevmemIntHeapCreateOUT->eError != PVRSRV_OK) + { + goto DevmemIntHeapCreate_exit; + } + + +DevmemIntHeapCreate_exit: + if (psDevmemIntHeapCreateOUT->eError != PVRSRV_OK) + { + /* If we have a valid resman item we should undo the bridge function by freeing the resman item */ + if (hDevmemHeapPtrInt2) + { + PVRSRV_ERROR eError = ResManFreeResByPtr(hDevmemHeapPtrInt2); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + } + else if (psDevmemHeapPtrInt) + { + DevmemIntHeapDestroy(psDevmemHeapPtrInt); + } + } + + + return 0; +} + +static IMG_INT +PVRSRVBridgeDevmemIntHeapDestroy(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_DEVMEMINTHEAPDESTROY *psDevmemIntHeapDestroyIN, + PVRSRV_BRIDGE_OUT_DEVMEMINTHEAPDESTROY *psDevmemIntHeapDestroyOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevmemHeapInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_MM_DEVMEMINTHEAPDESTROY); + + + + + + { + /* Look up the address from the handle */ + psDevmemIntHeapDestroyOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hDevmemHeapInt2, + psDevmemIntHeapDestroyIN->hDevmemHeap, + PVRSRV_HANDLE_TYPE_DEVMEMINT_HEAP); + if(psDevmemIntHeapDestroyOUT->eError != PVRSRV_OK) + { + goto DevmemIntHeapDestroy_exit; + } + + } + + psDevmemIntHeapDestroyOUT->eError = DevmemIntHeapDestroyResManProxy(hDevmemHeapInt2); + /* Exit early if bridged call fails */ + if(psDevmemIntHeapDestroyOUT->eError != PVRSRV_OK) + { + goto DevmemIntHeapDestroy_exit; + } + + psDevmemIntHeapDestroyOUT->eError = + PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psDevmemIntHeapDestroyIN->hDevmemHeap, + PVRSRV_HANDLE_TYPE_DEVMEMINT_HEAP); + + +DevmemIntHeapDestroy_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeDevmemIntMapPMR(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_DEVMEMINTMAPPMR *psDevmemIntMapPMRIN, + PVRSRV_BRIDGE_OUT_DEVMEMINTMAPPMR *psDevmemIntMapPMROUT, + CONNECTION_DATA *psConnection) +{ + DEVMEMINT_HEAP * psDevmemServerHeapInt = IMG_NULL; + IMG_HANDLE hDevmemServerHeapInt2 = IMG_NULL; + DEVMEMINT_RESERVATION * psReservationInt = IMG_NULL; + IMG_HANDLE hReservationInt2 = IMG_NULL; + PMR * psPMRInt = IMG_NULL; + IMG_HANDLE hPMRInt2 = IMG_NULL; + DEVMEMINT_MAPPING * psMappingInt = IMG_NULL; + IMG_HANDLE hMappingInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_MM_DEVMEMINTMAPPMR); + + + + + + PMRLock(); + { + /* Look up the address from the handle */ + psDevmemIntMapPMROUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hDevmemServerHeapInt2, + psDevmemIntMapPMRIN->hDevmemServerHeap, + PVRSRV_HANDLE_TYPE_DEVMEMINT_HEAP); + if(psDevmemIntMapPMROUT->eError != PVRSRV_OK) + { + PMRUnlock(); + goto DevmemIntMapPMR_exit; + } + + /* Look up the data from the resman address */ + psDevmemIntMapPMROUT->eError = ResManFindPrivateDataByPtr(hDevmemServerHeapInt2, (IMG_VOID **) &psDevmemServerHeapInt); + + if(psDevmemIntMapPMROUT->eError != PVRSRV_OK) + { + PMRUnlock(); + goto DevmemIntMapPMR_exit; + } + } + + { + /* Look up the address from the handle */ + psDevmemIntMapPMROUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hReservationInt2, + psDevmemIntMapPMRIN->hReservation, + PVRSRV_HANDLE_TYPE_DEVMEMINT_RESERVATION); + if(psDevmemIntMapPMROUT->eError != PVRSRV_OK) + { + PMRUnlock(); + goto DevmemIntMapPMR_exit; + } + + /* Look up the data from the resman address */ + psDevmemIntMapPMROUT->eError = ResManFindPrivateDataByPtr(hReservationInt2, (IMG_VOID **) &psReservationInt); + + if(psDevmemIntMapPMROUT->eError != PVRSRV_OK) + { + PMRUnlock(); + goto DevmemIntMapPMR_exit; + } + } + + { + /* Look up the address from the handle */ + psDevmemIntMapPMROUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hPMRInt2, + psDevmemIntMapPMRIN->hPMR, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR); + if(psDevmemIntMapPMROUT->eError != PVRSRV_OK) + { + PMRUnlock(); + goto DevmemIntMapPMR_exit; + } + + /* Look up the data from the resman address */ + psDevmemIntMapPMROUT->eError = ResManFindPrivateDataByPtr(hPMRInt2, (IMG_VOID **) &psPMRInt); + + 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(); + + /* Create a resman item and overwrite the handle with it */ + hMappingInt2 = ResManRegisterRes(psConnection->hResManContext, + RESMAN_TYPE_DEVICEMEM2_MAPPING, + psMappingInt, + (RESMAN_FREE_FN)&DevmemIntUnmapPMR); + if (hMappingInt2 == IMG_NULL) + { + psDevmemIntMapPMROUT->eError = PVRSRV_ERROR_UNABLE_TO_REGISTER_RESOURCE; + goto DevmemIntMapPMR_exit; + } + psDevmemIntMapPMROUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psDevmemIntMapPMROUT->hMapping, + (IMG_HANDLE) hMappingInt2, + PVRSRV_HANDLE_TYPE_DEVMEMINT_MAPPING, + PVRSRV_HANDLE_ALLOC_FLAG_NONE + ); + if (psDevmemIntMapPMROUT->eError != PVRSRV_OK) + { + goto DevmemIntMapPMR_exit; + } + + +DevmemIntMapPMR_exit: + if (psDevmemIntMapPMROUT->eError != PVRSRV_OK) + { + /* If we have a valid resman item we should undo the bridge function by freeing the resman item */ + if (hMappingInt2) + { + PVRSRV_ERROR eError = ResManFreeResByPtr(hMappingInt2); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + } + else if (psMappingInt) + { + DevmemIntUnmapPMR(psMappingInt); + } + } + + + return 0; +} + +static IMG_INT +PVRSRVBridgeDevmemIntUnmapPMR(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_DEVMEMINTUNMAPPMR *psDevmemIntUnmapPMRIN, + PVRSRV_BRIDGE_OUT_DEVMEMINTUNMAPPMR *psDevmemIntUnmapPMROUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hMappingInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_MM_DEVMEMINTUNMAPPMR); + + + + + + PMRLock(); + { + /* Look up the address from the handle */ + psDevmemIntUnmapPMROUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hMappingInt2, + psDevmemIntUnmapPMRIN->hMapping, + PVRSRV_HANDLE_TYPE_DEVMEMINT_MAPPING); + if(psDevmemIntUnmapPMROUT->eError != PVRSRV_OK) + { + PMRUnlock(); + goto DevmemIntUnmapPMR_exit; + } + + } + + psDevmemIntUnmapPMROUT->eError = DevmemIntUnmapPMRResManProxy(hMappingInt2); + /* Exit early if bridged call fails */ + if(psDevmemIntUnmapPMROUT->eError != PVRSRV_OK) + { + PMRUnlock(); + goto DevmemIntUnmapPMR_exit; + } + PMRUnlock(); + + psDevmemIntUnmapPMROUT->eError = + PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psDevmemIntUnmapPMRIN->hMapping, + PVRSRV_HANDLE_TYPE_DEVMEMINT_MAPPING); + + +DevmemIntUnmapPMR_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeDevmemIntReserveRange(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_DEVMEMINTRESERVERANGE *psDevmemIntReserveRangeIN, + PVRSRV_BRIDGE_OUT_DEVMEMINTRESERVERANGE *psDevmemIntReserveRangeOUT, + CONNECTION_DATA *psConnection) +{ + DEVMEMINT_HEAP * psDevmemServerHeapInt = IMG_NULL; + IMG_HANDLE hDevmemServerHeapInt2 = IMG_NULL; + DEVMEMINT_RESERVATION * psReservationInt = IMG_NULL; + IMG_HANDLE hReservationInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_MM_DEVMEMINTRESERVERANGE); + + + + + + { + /* Look up the address from the handle */ + psDevmemIntReserveRangeOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hDevmemServerHeapInt2, + psDevmemIntReserveRangeIN->hDevmemServerHeap, + PVRSRV_HANDLE_TYPE_DEVMEMINT_HEAP); + if(psDevmemIntReserveRangeOUT->eError != PVRSRV_OK) + { + goto DevmemIntReserveRange_exit; + } + + /* Look up the data from the resman address */ + psDevmemIntReserveRangeOUT->eError = ResManFindPrivateDataByPtr(hDevmemServerHeapInt2, (IMG_VOID **) &psDevmemServerHeapInt); + + 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; + } + + /* Create a resman item and overwrite the handle with it */ + hReservationInt2 = ResManRegisterRes(psConnection->hResManContext, + RESMAN_TYPE_DEVICEMEM2_RESERVATION, + psReservationInt, + (RESMAN_FREE_FN)&DevmemIntUnreserveRange); + if (hReservationInt2 == IMG_NULL) + { + psDevmemIntReserveRangeOUT->eError = PVRSRV_ERROR_UNABLE_TO_REGISTER_RESOURCE; + goto DevmemIntReserveRange_exit; + } + psDevmemIntReserveRangeOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psDevmemIntReserveRangeOUT->hReservation, + (IMG_HANDLE) hReservationInt2, + PVRSRV_HANDLE_TYPE_DEVMEMINT_RESERVATION, + PVRSRV_HANDLE_ALLOC_FLAG_NONE + ); + if (psDevmemIntReserveRangeOUT->eError != PVRSRV_OK) + { + goto DevmemIntReserveRange_exit; + } + + +DevmemIntReserveRange_exit: + if (psDevmemIntReserveRangeOUT->eError != PVRSRV_OK) + { + /* If we have a valid resman item we should undo the bridge function by freeing the resman item */ + if (hReservationInt2) + { + PVRSRV_ERROR eError = ResManFreeResByPtr(hReservationInt2); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + } + else if (psReservationInt) + { + DevmemIntUnreserveRange(psReservationInt); + } + } + + + return 0; +} + +static IMG_INT +PVRSRVBridgeDevmemIntUnreserveRange(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_DEVMEMINTUNRESERVERANGE *psDevmemIntUnreserveRangeIN, + PVRSRV_BRIDGE_OUT_DEVMEMINTUNRESERVERANGE *psDevmemIntUnreserveRangeOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hReservationInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_MM_DEVMEMINTUNRESERVERANGE); + + + + + + { + /* Look up the address from the handle */ + psDevmemIntUnreserveRangeOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hReservationInt2, + psDevmemIntUnreserveRangeIN->hReservation, + PVRSRV_HANDLE_TYPE_DEVMEMINT_RESERVATION); + if(psDevmemIntUnreserveRangeOUT->eError != PVRSRV_OK) + { + goto DevmemIntUnreserveRange_exit; + } + + } + + psDevmemIntUnreserveRangeOUT->eError = DevmemIntUnreserveRangeResManProxy(hReservationInt2); + /* Exit early if bridged call fails */ + if(psDevmemIntUnreserveRangeOUT->eError != PVRSRV_OK) + { + goto DevmemIntUnreserveRange_exit; + } + + psDevmemIntUnreserveRangeOUT->eError = + PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psDevmemIntUnreserveRangeIN->hReservation, + PVRSRV_HANDLE_TYPE_DEVMEMINT_RESERVATION); + + +DevmemIntUnreserveRange_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgePhysmemNewRamBackedPMR(IMG_UINT32 ui32BridgeID, + 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; + IMG_HANDLE hPMRPtrInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_MM_PHYSMEMNEWRAMBACKEDPMR); + + + + + 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_HANDLE *) &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(); + + /* Create a resman item and overwrite the handle with it */ + hPMRPtrInt2 = ResManRegisterRes(psConnection->hResManContext, + RESMAN_TYPE_PMR, + psPMRPtrInt, + (RESMAN_FREE_FN)&PMRUnrefPMR); + if (hPMRPtrInt2 == IMG_NULL) + { + psPhysmemNewRamBackedPMROUT->eError = PVRSRV_ERROR_UNABLE_TO_REGISTER_RESOURCE; + goto PhysmemNewRamBackedPMR_exit; + } + psPhysmemNewRamBackedPMROUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psPhysmemNewRamBackedPMROUT->hPMRPtr, + (IMG_HANDLE) hPMRPtrInt2, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR, + PVRSRV_HANDLE_ALLOC_FLAG_NONE + ); + if (psPhysmemNewRamBackedPMROUT->eError != PVRSRV_OK) + { + goto PhysmemNewRamBackedPMR_exit; + } + + +PhysmemNewRamBackedPMR_exit: + if (psPhysmemNewRamBackedPMROUT->eError != PVRSRV_OK) + { + /* If we have a valid resman item we should undo the bridge function by freeing the resman item */ + if (hPMRPtrInt2) + { + PVRSRV_ERROR eError = ResManFreeResByPtr(hPMRPtrInt2); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + } + else if (psPMRPtrInt) + { + PMRUnrefPMR(psPMRPtrInt); + } + } + + if (bMappingTableInt) + OSFreeMem(bMappingTableInt); + + return 0; +} + +static IMG_INT +PVRSRVBridgePMRLocalImportPMR(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_PMRLOCALIMPORTPMR *psPMRLocalImportPMRIN, + PVRSRV_BRIDGE_OUT_PMRLOCALIMPORTPMR *psPMRLocalImportPMROUT, + CONNECTION_DATA *psConnection) +{ + PMR * psExtHandleInt = IMG_NULL; + IMG_HANDLE hExtHandleInt2 = IMG_NULL; + PMR * psPMRInt = IMG_NULL; + IMG_HANDLE hPMRInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_MM_PMRLOCALIMPORTPMR); + + + + + + PMRLock(); + { + /* Look up the address from the handle */ + psPMRLocalImportPMROUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hExtHandleInt2, + psPMRLocalImportPMRIN->hExtHandle, + PVRSRV_HANDLE_TYPE_DEVMEM_MEM_IMPORT); + if(psPMRLocalImportPMROUT->eError != PVRSRV_OK) + { + PMRUnlock(); + goto PMRLocalImportPMR_exit; + } + + /* Look up the data from the resman address */ + psPMRLocalImportPMROUT->eError = ResManFindPrivateDataByPtr(hExtHandleInt2, (IMG_VOID **) &psExtHandleInt); + + 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(); + + /* Create a resman item and overwrite the handle with it */ + hPMRInt2 = ResManRegisterRes(psConnection->hResManContext, + RESMAN_TYPE_PMR, + psPMRInt, + (RESMAN_FREE_FN)&PMRUnrefPMR); + if (hPMRInt2 == IMG_NULL) + { + psPMRLocalImportPMROUT->eError = PVRSRV_ERROR_UNABLE_TO_REGISTER_RESOURCE; + goto PMRLocalImportPMR_exit; + } + psPMRLocalImportPMROUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psPMRLocalImportPMROUT->hPMR, + (IMG_HANDLE) hPMRInt2, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR, + PVRSRV_HANDLE_ALLOC_FLAG_NONE + ); + if (psPMRLocalImportPMROUT->eError != PVRSRV_OK) + { + goto PMRLocalImportPMR_exit; + } + + +PMRLocalImportPMR_exit: + if (psPMRLocalImportPMROUT->eError != PVRSRV_OK) + { + /* If we have a valid resman item we should undo the bridge function by freeing the resman item */ + if (hPMRInt2) + { + PVRSRV_ERROR eError = ResManFreeResByPtr(hPMRInt2); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + } + else if (psPMRInt) + { + PMRUnrefPMR(psPMRInt); + } + } + + + return 0; +} + +static IMG_INT +PVRSRVBridgePMRUnrefPMR(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_PMRUNREFPMR *psPMRUnrefPMRIN, + PVRSRV_BRIDGE_OUT_PMRUNREFPMR *psPMRUnrefPMROUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hPMRInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_MM_PMRUNREFPMR); + + + + + PMRLock(); + { + /* Look up the address from the handle */ + psPMRUnrefPMROUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hPMRInt2, + psPMRUnrefPMRIN->hPMR, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR); + if(psPMRUnrefPMROUT->eError != PVRSRV_OK) + { + PMRUnlock(); + goto PMRUnrefPMR_exit; + } + + } + + psPMRUnrefPMROUT->eError = PMRUnrefPMRResManProxy(hPMRInt2); + /* Exit early if bridged call fails */ + if(psPMRUnrefPMROUT->eError != PVRSRV_OK) + { + PMRUnlock(); + goto PMRUnrefPMR_exit; + } + + PMRUnlock(); + + psPMRUnrefPMROUT->eError = + PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psPMRUnrefPMRIN->hPMR, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR); + + +PMRUnrefPMR_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeDevmemSLCFlushInvalRequest(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_DEVMEMSLCFLUSHINVALREQUEST *psDevmemSLCFlushInvalRequestIN, + PVRSRV_BRIDGE_OUT_DEVMEMSLCFLUSHINVALREQUEST *psDevmemSLCFlushInvalRequestOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDeviceNodeInt = IMG_NULL; + PMR * psPmrInt = IMG_NULL; + IMG_HANDLE hPmrInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_MM_DEVMEMSLCFLUSHINVALREQUEST); + + + + + + { + /* Look up the address from the handle */ + psDevmemSLCFlushInvalRequestOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &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_HANDLE *) &hPmrInt2, + psDevmemSLCFlushInvalRequestIN->hPmr, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR); + if(psDevmemSLCFlushInvalRequestOUT->eError != PVRSRV_OK) + { + goto DevmemSLCFlushInvalRequest_exit; + } + + /* Look up the data from the resman address */ + psDevmemSLCFlushInvalRequestOUT->eError = ResManFindPrivateDataByPtr(hPmrInt2, (IMG_VOID **) &psPmrInt); + + if(psDevmemSLCFlushInvalRequestOUT->eError != PVRSRV_OK) + { + goto DevmemSLCFlushInvalRequest_exit; + } + } + + psDevmemSLCFlushInvalRequestOUT->eError = + DevmemSLCFlushInvalRequest( + hDeviceNodeInt, + psPmrInt); + + + +DevmemSLCFlushInvalRequest_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeHeapCfgHeapConfigCount(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_HEAPCFGHEAPCONFIGCOUNT *psHeapCfgHeapConfigCountIN, + PVRSRV_BRIDGE_OUT_HEAPCFGHEAPCONFIGCOUNT *psHeapCfgHeapConfigCountOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDeviceNodeInt = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_MM_HEAPCFGHEAPCONFIGCOUNT); + + + + + + { + /* Look up the address from the handle */ + psHeapCfgHeapConfigCountOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &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 ui32BridgeID, + PVRSRV_BRIDGE_IN_HEAPCFGHEAPCOUNT *psHeapCfgHeapCountIN, + PVRSRV_BRIDGE_OUT_HEAPCFGHEAPCOUNT *psHeapCfgHeapCountOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDeviceNodeInt = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_MM_HEAPCFGHEAPCOUNT); + + + + + + { + /* Look up the address from the handle */ + psHeapCfgHeapCountOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &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 ui32BridgeID, + PVRSRV_BRIDGE_IN_HEAPCFGHEAPCONFIGNAME *psHeapCfgHeapConfigNameIN, + PVRSRV_BRIDGE_OUT_HEAPCFGHEAPCONFIGNAME *psHeapCfgHeapConfigNameOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDeviceNodeInt = IMG_NULL; + IMG_CHAR *puiHeapConfigNameInt = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_MM_HEAPCFGHEAPCONFIGNAME); + + + 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_HANDLE *) &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 ui32BridgeID, + PVRSRV_BRIDGE_IN_HEAPCFGHEAPDETAILS *psHeapCfgHeapDetailsIN, + PVRSRV_BRIDGE_OUT_HEAPCFGHEAPDETAILS *psHeapCfgHeapDetailsOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDeviceNodeInt = IMG_NULL; + IMG_CHAR *puiHeapNameOutInt = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_MM_HEAPCFGHEAPDETAILS); + + + 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_HANDLE *) &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); + + + 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 RegisterMMFunctions(IMG_VOID); +IMG_VOID UnregisterMMFunctions(IMG_VOID); + +/* + * Register all MM functions with services + */ +PVRSRV_ERROR RegisterMMFunctions(IMG_VOID) +{ + SetDispatchTableEntry(PVRSRV_BRIDGE_MM_PMREXPORTPMR, PVRSRVBridgePMRExportPMR); + SetDispatchTableEntry(PVRSRV_BRIDGE_MM_PMRUNEXPORTPMR, PVRSRVBridgePMRUnexportPMR); + SetDispatchTableEntry(PVRSRV_BRIDGE_MM_PMRGETUID, PVRSRVBridgePMRGetUID); + SetDispatchTableEntry(PVRSRV_BRIDGE_MM_PMRMAKESERVEREXPORTCLIENTEXPORT, PVRSRVBridgePMRMakeServerExportClientExport); + SetDispatchTableEntry(PVRSRV_BRIDGE_MM_PMRUNMAKESERVEREXPORTCLIENTEXPORT, PVRSRVBridgePMRUnmakeServerExportClientExport); + SetDispatchTableEntry(PVRSRV_BRIDGE_MM_PMRIMPORTPMR, PVRSRVBridgePMRImportPMR); + SetDispatchTableEntry(PVRSRV_BRIDGE_MM_DEVMEMINTCTXCREATE, PVRSRVBridgeDevmemIntCtxCreate); + SetDispatchTableEntry(PVRSRV_BRIDGE_MM_DEVMEMINTCTXDESTROY, PVRSRVBridgeDevmemIntCtxDestroy); + SetDispatchTableEntry(PVRSRV_BRIDGE_MM_DEVMEMINTHEAPCREATE, PVRSRVBridgeDevmemIntHeapCreate); + SetDispatchTableEntry(PVRSRV_BRIDGE_MM_DEVMEMINTHEAPDESTROY, PVRSRVBridgeDevmemIntHeapDestroy); + SetDispatchTableEntry(PVRSRV_BRIDGE_MM_DEVMEMINTMAPPMR, PVRSRVBridgeDevmemIntMapPMR); + SetDispatchTableEntry(PVRSRV_BRIDGE_MM_DEVMEMINTUNMAPPMR, PVRSRVBridgeDevmemIntUnmapPMR); + SetDispatchTableEntry(PVRSRV_BRIDGE_MM_DEVMEMINTRESERVERANGE, PVRSRVBridgeDevmemIntReserveRange); + SetDispatchTableEntry(PVRSRV_BRIDGE_MM_DEVMEMINTUNRESERVERANGE, PVRSRVBridgeDevmemIntUnreserveRange); + SetDispatchTableEntry(PVRSRV_BRIDGE_MM_PHYSMEMNEWRAMBACKEDPMR, PVRSRVBridgePhysmemNewRamBackedPMR); + SetDispatchTableEntry(PVRSRV_BRIDGE_MM_PMRLOCALIMPORTPMR, PVRSRVBridgePMRLocalImportPMR); + SetDispatchTableEntry(PVRSRV_BRIDGE_MM_PMRUNREFPMR, PVRSRVBridgePMRUnrefPMR); + SetDispatchTableEntry(PVRSRV_BRIDGE_MM_DEVMEMSLCFLUSHINVALREQUEST, PVRSRVBridgeDevmemSLCFlushInvalRequest); + SetDispatchTableEntry(PVRSRV_BRIDGE_MM_HEAPCFGHEAPCONFIGCOUNT, PVRSRVBridgeHeapCfgHeapConfigCount); + SetDispatchTableEntry(PVRSRV_BRIDGE_MM_HEAPCFGHEAPCOUNT, PVRSRVBridgeHeapCfgHeapCount); + SetDispatchTableEntry(PVRSRV_BRIDGE_MM_HEAPCFGHEAPCONFIGNAME, PVRSRVBridgeHeapCfgHeapConfigName); + SetDispatchTableEntry(PVRSRV_BRIDGE_MM_HEAPCFGHEAPDETAILS, PVRSRVBridgeHeapCfgHeapDetails); + + return PVRSRV_OK; +} + +/* + * Unregister all mm functions with services + */ +IMG_VOID UnregisterMMFunctions(IMG_VOID) +{ +} diff --git a/drivers/gpu/rogue/generated/pdump_bridge/common_pdump_bridge.h b/drivers/gpu/rogue/generated/pdump_bridge/common_pdump_bridge.h new file mode 100644 index 000000000000..a2bedfad158d --- /dev/null +++ b/drivers/gpu/rogue/generated/pdump_bridge/common_pdump_bridge.h @@ -0,0 +1,208 @@ +/*************************************************************************/ /*! +@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 "services.h" + + +#include "pvr_bridge_io.h" + +#define PVRSRV_BRIDGE_PDUMP_CMD_FIRST (PVRSRV_BRIDGE_PDUMP_START) +#define PVRSRV_BRIDGE_PDUMP_PVRSRVPDUMPISCAPTURING PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+0) +#define PVRSRV_BRIDGE_PDUMP_PVRSRVPDUMPCOMMENT PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+1) +#define PVRSRV_BRIDGE_PDUMP_PVRSRVPDUMPSETFRAME PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+2) +#define PVRSRV_BRIDGE_PDUMP_PVRSRVPDUMPGETFRAME PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+3) +#define PVRSRV_BRIDGE_PDUMP_PVRSRVPDUMPSETDEFAULTCAPTUREPARAMS PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+4) +#define PVRSRV_BRIDGE_PDUMP_PVRSRVPDUMPISLASTCAPTUREFRAME PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+5) +#define PVRSRV_BRIDGE_PDUMP_PVRSRVPDUMPSTARTINITPHASE PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+6) +#define PVRSRV_BRIDGE_PDUMP_PVRSRVPDUMPSTOPINITPHASE PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+7) +#define PVRSRV_BRIDGE_PDUMP_CMD_LAST (PVRSRV_BRIDGE_PDUMP_CMD_FIRST+7) + + +/******************************************* + 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; + +/******************************************* + 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; + +/******************************************* + 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_PDUMP_BRIDGE_H */ diff --git a/drivers/gpu/rogue/generated/pdump_bridge/server_pdump_bridge.c b/drivers/gpu/rogue/generated/pdump_bridge/server_pdump_bridge.c new file mode 100644 index 000000000000..ef38d519ee8e --- /dev/null +++ b/drivers/gpu/rogue/generated/pdump_bridge/server_pdump_bridge.c @@ -0,0 +1,332 @@ +/*************************************************************************/ /*! +@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 "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 + +/* *************************************************************************** + * Bridge proxy functions + */ + + + +/* *************************************************************************** + * Server-side bridge entry points + */ + +static IMG_INT +PVRSRVBridgePVRSRVPDumpIsCapturing(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_PVRSRVPDUMPISCAPTURING *psPVRSRVPDumpIsCapturingIN, + PVRSRV_BRIDGE_OUT_PVRSRVPDUMPISCAPTURING *psPVRSRVPDumpIsCapturingOUT, + CONNECTION_DATA *psConnection) +{ + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_PDUMP_PVRSRVPDUMPISCAPTURING); + + PVR_UNREFERENCED_PARAMETER(psConnection); + PVR_UNREFERENCED_PARAMETER(psPVRSRVPDumpIsCapturingIN); + + + + + psPVRSRVPDumpIsCapturingOUT->eError = + PDumpIsCaptureFrameKM( + &psPVRSRVPDumpIsCapturingOUT->bIsCapturing); + + + + + return 0; +} + +static IMG_INT +PVRSRVBridgePVRSRVPDumpComment(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_PVRSRVPDUMPCOMMENT *psPVRSRVPDumpCommentIN, + PVRSRV_BRIDGE_OUT_PVRSRVPDUMPCOMMENT *psPVRSRVPDumpCommentOUT, + CONNECTION_DATA *psConnection) +{ + IMG_CHAR *uiCommentInt = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_PDUMP_PVRSRVPDUMPCOMMENT); + + 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 ui32BridgeID, + PVRSRV_BRIDGE_IN_PVRSRVPDUMPSETFRAME *psPVRSRVPDumpSetFrameIN, + PVRSRV_BRIDGE_OUT_PVRSRVPDUMPSETFRAME *psPVRSRVPDumpSetFrameOUT, + CONNECTION_DATA *psConnection) +{ + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_PDUMP_PVRSRVPDUMPSETFRAME); + + + + + + psPVRSRVPDumpSetFrameOUT->eError = + PDumpSetFrameKM(psConnection, + psPVRSRVPDumpSetFrameIN->ui32Frame); + + + + + return 0; +} + +static IMG_INT +PVRSRVBridgePVRSRVPDumpGetFrame(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_PVRSRVPDUMPGETFRAME *psPVRSRVPDumpGetFrameIN, + PVRSRV_BRIDGE_OUT_PVRSRVPDUMPGETFRAME *psPVRSRVPDumpGetFrameOUT, + CONNECTION_DATA *psConnection) +{ + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_PDUMP_PVRSRVPDUMPGETFRAME); + + PVR_UNREFERENCED_PARAMETER(psPVRSRVPDumpGetFrameIN); + + + + + psPVRSRVPDumpGetFrameOUT->eError = + PDumpGetFrameKM(psConnection, + &psPVRSRVPDumpGetFrameOUT->ui32Frame); + + + + + return 0; +} + +static IMG_INT +PVRSRVBridgePVRSRVPDumpSetDefaultCaptureParams(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_PVRSRVPDUMPSETDEFAULTCAPTUREPARAMS *psPVRSRVPDumpSetDefaultCaptureParamsIN, + PVRSRV_BRIDGE_OUT_PVRSRVPDUMPSETDEFAULTCAPTUREPARAMS *psPVRSRVPDumpSetDefaultCaptureParamsOUT, + CONNECTION_DATA *psConnection) +{ + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_PDUMP_PVRSRVPDUMPSETDEFAULTCAPTUREPARAMS); + + 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 ui32BridgeID, + PVRSRV_BRIDGE_IN_PVRSRVPDUMPISLASTCAPTUREFRAME *psPVRSRVPDumpIsLastCaptureFrameIN, + PVRSRV_BRIDGE_OUT_PVRSRVPDUMPISLASTCAPTUREFRAME *psPVRSRVPDumpIsLastCaptureFrameOUT, + CONNECTION_DATA *psConnection) +{ + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_PDUMP_PVRSRVPDUMPISLASTCAPTUREFRAME); + + PVR_UNREFERENCED_PARAMETER(psConnection); + PVR_UNREFERENCED_PARAMETER(psPVRSRVPDumpIsLastCaptureFrameIN); + + + + + psPVRSRVPDumpIsLastCaptureFrameOUT->eError = + PDumpIsLastCaptureFrameKM( + ); + + + + + return 0; +} + +static IMG_INT +PVRSRVBridgePVRSRVPDumpStartInitPhase(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_PVRSRVPDUMPSTARTINITPHASE *psPVRSRVPDumpStartInitPhaseIN, + PVRSRV_BRIDGE_OUT_PVRSRVPDUMPSTARTINITPHASE *psPVRSRVPDumpStartInitPhaseOUT, + CONNECTION_DATA *psConnection) +{ + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_PDUMP_PVRSRVPDUMPSTARTINITPHASE); + + PVR_UNREFERENCED_PARAMETER(psConnection); + PVR_UNREFERENCED_PARAMETER(psPVRSRVPDumpStartInitPhaseIN); + + + + + psPVRSRVPDumpStartInitPhaseOUT->eError = + PDumpStartInitPhaseKM( + ); + + + + + return 0; +} + +static IMG_INT +PVRSRVBridgePVRSRVPDumpStopInitPhase(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_PVRSRVPDUMPSTOPINITPHASE *psPVRSRVPDumpStopInitPhaseIN, + PVRSRV_BRIDGE_OUT_PVRSRVPDUMPSTOPINITPHASE *psPVRSRVPDumpStopInitPhaseOUT, + CONNECTION_DATA *psConnection) +{ + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_PDUMP_PVRSRVPDUMPSTOPINITPHASE); + + PVR_UNREFERENCED_PARAMETER(psConnection); + + + + + psPVRSRVPDumpStopInitPhaseOUT->eError = + PDumpStopInitPhaseKM( + psPVRSRVPDumpStopInitPhaseIN->eModuleID); + + + + + return 0; +} + + + +/* *************************************************************************** + * Server bridge dispatch related glue + */ + +PVRSRV_ERROR RegisterPDUMPFunctions(IMG_VOID); +IMG_VOID UnregisterPDUMPFunctions(IMG_VOID); + +/* + * Register all PDUMP functions with services + */ +PVRSRV_ERROR RegisterPDUMPFunctions(IMG_VOID) +{ + SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMP_PVRSRVPDUMPISCAPTURING, PVRSRVBridgePVRSRVPDumpIsCapturing); + SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMP_PVRSRVPDUMPCOMMENT, PVRSRVBridgePVRSRVPDumpComment); + SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMP_PVRSRVPDUMPSETFRAME, PVRSRVBridgePVRSRVPDumpSetFrame); + SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMP_PVRSRVPDUMPGETFRAME, PVRSRVBridgePVRSRVPDumpGetFrame); + SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMP_PVRSRVPDUMPSETDEFAULTCAPTUREPARAMS, PVRSRVBridgePVRSRVPDumpSetDefaultCaptureParams); + SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMP_PVRSRVPDUMPISLASTCAPTUREFRAME, PVRSRVBridgePVRSRVPDumpIsLastCaptureFrame); + SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMP_PVRSRVPDUMPSTARTINITPHASE, PVRSRVBridgePVRSRVPDumpStartInitPhase); + SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMP_PVRSRVPDUMPSTOPINITPHASE, PVRSRVBridgePVRSRVPDumpStopInitPhase); + + return PVRSRV_OK; +} + +/* + * Unregister all pdump functions with services + */ +IMG_VOID UnregisterPDUMPFunctions(IMG_VOID) +{ +} diff --git a/drivers/gpu/rogue/generated/pdumpcmm_bridge/common_pdumpcmm_bridge.h b/drivers/gpu/rogue/generated/pdumpcmm_bridge/common_pdumpcmm_bridge.h new file mode 100644 index 000000000000..8ca4936192b9 --- /dev/null +++ b/drivers/gpu/rogue/generated/pdumpcmm_bridge/common_pdumpcmm_bridge.h @@ -0,0 +1,87 @@ +/*************************************************************************/ /*! +@File +@Title Common bridge header for pdumpcmm +@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 pdumpcmm +@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_PDUMPCMM_BRIDGE_H +#define COMMON_PDUMPCMM_BRIDGE_H + +#include "devicemem_typedefs.h" +#include "pdumpdefs.h" + + +#include "pvr_bridge_io.h" + +#define PVRSRV_BRIDGE_PDUMPCMM_CMD_FIRST (PVRSRV_BRIDGE_PDUMPCMM_START) +#define PVRSRV_BRIDGE_PDUMPCMM_DEVMEMPDUMPBITMAP PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMPCMM_CMD_FIRST+0) +#define PVRSRV_BRIDGE_PDUMPCMM_CMD_LAST (PVRSRV_BRIDGE_PDUMPCMM_CMD_FIRST+0) + + +/******************************************* + 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; + +#endif /* COMMON_PDUMPCMM_BRIDGE_H */ diff --git a/drivers/gpu/rogue/generated/pdumpcmm_bridge/server_pdumpcmm_bridge.c b/drivers/gpu/rogue/generated/pdumpcmm_bridge/server_pdumpcmm_bridge.c new file mode 100644 index 000000000000..ee37ac7866cf --- /dev/null +++ b/drivers/gpu/rogue/generated/pdumpcmm_bridge/server_pdumpcmm_bridge.c @@ -0,0 +1,198 @@ +/*************************************************************************/ /*! +@File +@Title Server bridge for pdumpcmm +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Implements the server side of the bridge for pdumpcmm +@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 "common_pdumpcmm_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 + +/* *************************************************************************** + * Bridge proxy functions + */ + + + +/* *************************************************************************** + * Server-side bridge entry points + */ + +static IMG_INT +PVRSRVBridgeDevmemPDumpBitmap(IMG_UINT32 ui32BridgeID, + 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; + IMG_HANDLE hDevmemCtxInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_PDUMPCMM_DEVMEMPDUMPBITMAP); + + + + + + { + 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_HANDLE *) &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_HANDLE *) &hDevmemCtxInt2, + psDevmemPDumpBitmapIN->hDevmemCtx, + PVRSRV_HANDLE_TYPE_DEVMEMINT_CTX); + if(psDevmemPDumpBitmapOUT->eError != PVRSRV_OK) + { + goto DevmemPDumpBitmap_exit; + } + + /* Look up the data from the resman address */ + psDevmemPDumpBitmapOUT->eError = ResManFindPrivateDataByPtr(hDevmemCtxInt2, (IMG_VOID **) &psDevmemCtxInt); + + 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; +} + + + +/* *************************************************************************** + * Server bridge dispatch related glue + */ + +PVRSRV_ERROR RegisterPDUMPCMMFunctions(IMG_VOID); +IMG_VOID UnregisterPDUMPCMMFunctions(IMG_VOID); + +/* + * Register all PDUMPCMM functions with services + */ +PVRSRV_ERROR RegisterPDUMPCMMFunctions(IMG_VOID) +{ + SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMPCMM_DEVMEMPDUMPBITMAP, PVRSRVBridgeDevmemPDumpBitmap); + + return PVRSRV_OK; +} + +/* + * Unregister all pdumpcmm functions with services + */ +IMG_VOID UnregisterPDUMPCMMFunctions(IMG_VOID) +{ +} diff --git a/drivers/gpu/rogue/generated/pdumpmm_bridge/client_pdumpmm_bridge.h b/drivers/gpu/rogue/generated/pdumpmm_bridge/client_pdumpmm_bridge.h new file mode 100644 index 000000000000..fdcabc846085 --- /dev/null +++ b/drivers/gpu/rogue/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/generated/pdumpmm_bridge/common_pdumpmm_bridge.h b/drivers/gpu/rogue/generated/pdumpmm_bridge/common_pdumpmm_bridge.h new file mode 100644 index 000000000000..cb6b3b404156 --- /dev/null +++ b/drivers/gpu/rogue/generated/pdumpmm_bridge/common_pdumpmm_bridge.h @@ -0,0 +1,244 @@ +/*************************************************************************/ /*! +@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 "pdump.h" +#include "pdumpdefs.h" +#include "pvrsrv_memallocflags.h" +#include "devicemem_typedefs.h" + + +#include "pvr_bridge_io.h" + +#define PVRSRV_BRIDGE_PDUMPMM_CMD_FIRST (PVRSRV_BRIDGE_PDUMPMM_START) +#define PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPLOADMEM PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMPMM_CMD_FIRST+0) +#define PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPLOADMEMVALUE32 PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMPMM_CMD_FIRST+1) +#define PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPLOADMEMVALUE64 PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMPMM_CMD_FIRST+2) +#define PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPSAVETOFILE PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMPMM_CMD_FIRST+3) +#define PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPSYMBOLICADDR PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMPMM_CMD_FIRST+4) +#define PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPPOL32 PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMPMM_CMD_FIRST+5) +#define PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPCBP PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMPMM_CMD_FIRST+6) +#define PVRSRV_BRIDGE_PDUMPMM_DEVMEMINTPDUMPSAVETOFILEVIRTUAL PVRSRV_IOWR(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/generated/pdumpmm_bridge/server_pdumpmm_bridge.c b/drivers/gpu/rogue/generated/pdumpmm_bridge/server_pdumpmm_bridge.c new file mode 100644 index 000000000000..f8df65557760 --- /dev/null +++ b/drivers/gpu/rogue/generated/pdumpmm_bridge/server_pdumpmm_bridge.c @@ -0,0 +1,617 @@ +/*************************************************************************/ /*! +@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 + +/* *************************************************************************** + * Bridge proxy functions + */ + + + +/* *************************************************************************** + * Server-side bridge entry points + */ + +static IMG_INT +PVRSRVBridgePMRPDumpLoadMem(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_PMRPDUMPLOADMEM *psPMRPDumpLoadMemIN, + PVRSRV_BRIDGE_OUT_PMRPDUMPLOADMEM *psPMRPDumpLoadMemOUT, + CONNECTION_DATA *psConnection) +{ + PMR * psPMRInt = IMG_NULL; + IMG_HANDLE hPMRInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPLOADMEM); + + + + + + { + /* Look up the address from the handle */ + psPMRPDumpLoadMemOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hPMRInt2, + psPMRPDumpLoadMemIN->hPMR, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR); + if(psPMRPDumpLoadMemOUT->eError != PVRSRV_OK) + { + goto PMRPDumpLoadMem_exit; + } + + /* Look up the data from the resman address */ + psPMRPDumpLoadMemOUT->eError = ResManFindPrivateDataByPtr(hPMRInt2, (IMG_VOID **) &psPMRInt); + + 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 ui32BridgeID, + PVRSRV_BRIDGE_IN_PMRPDUMPLOADMEMVALUE32 *psPMRPDumpLoadMemValue32IN, + PVRSRV_BRIDGE_OUT_PMRPDUMPLOADMEMVALUE32 *psPMRPDumpLoadMemValue32OUT, + CONNECTION_DATA *psConnection) +{ + PMR * psPMRInt = IMG_NULL; + IMG_HANDLE hPMRInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPLOADMEMVALUE32); + + + + + + { + /* Look up the address from the handle */ + psPMRPDumpLoadMemValue32OUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hPMRInt2, + psPMRPDumpLoadMemValue32IN->hPMR, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR); + if(psPMRPDumpLoadMemValue32OUT->eError != PVRSRV_OK) + { + goto PMRPDumpLoadMemValue32_exit; + } + + /* Look up the data from the resman address */ + psPMRPDumpLoadMemValue32OUT->eError = ResManFindPrivateDataByPtr(hPMRInt2, (IMG_VOID **) &psPMRInt); + + 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 ui32BridgeID, + PVRSRV_BRIDGE_IN_PMRPDUMPLOADMEMVALUE64 *psPMRPDumpLoadMemValue64IN, + PVRSRV_BRIDGE_OUT_PMRPDUMPLOADMEMVALUE64 *psPMRPDumpLoadMemValue64OUT, + CONNECTION_DATA *psConnection) +{ + PMR * psPMRInt = IMG_NULL; + IMG_HANDLE hPMRInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPLOADMEMVALUE64); + + + + + + { + /* Look up the address from the handle */ + psPMRPDumpLoadMemValue64OUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hPMRInt2, + psPMRPDumpLoadMemValue64IN->hPMR, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR); + if(psPMRPDumpLoadMemValue64OUT->eError != PVRSRV_OK) + { + goto PMRPDumpLoadMemValue64_exit; + } + + /* Look up the data from the resman address */ + psPMRPDumpLoadMemValue64OUT->eError = ResManFindPrivateDataByPtr(hPMRInt2, (IMG_VOID **) &psPMRInt); + + 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 ui32BridgeID, + PVRSRV_BRIDGE_IN_PMRPDUMPSAVETOFILE *psPMRPDumpSaveToFileIN, + PVRSRV_BRIDGE_OUT_PMRPDUMPSAVETOFILE *psPMRPDumpSaveToFileOUT, + CONNECTION_DATA *psConnection) +{ + PMR * psPMRInt = IMG_NULL; + IMG_HANDLE hPMRInt2 = IMG_NULL; + IMG_CHAR *uiFileNameInt = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPSAVETOFILE); + + + + + 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_HANDLE *) &hPMRInt2, + psPMRPDumpSaveToFileIN->hPMR, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR); + if(psPMRPDumpSaveToFileOUT->eError != PVRSRV_OK) + { + goto PMRPDumpSaveToFile_exit; + } + + /* Look up the data from the resman address */ + psPMRPDumpSaveToFileOUT->eError = ResManFindPrivateDataByPtr(hPMRInt2, (IMG_VOID **) &psPMRInt); + + 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 ui32BridgeID, + PVRSRV_BRIDGE_IN_PMRPDUMPSYMBOLICADDR *psPMRPDumpSymbolicAddrIN, + PVRSRV_BRIDGE_OUT_PMRPDUMPSYMBOLICADDR *psPMRPDumpSymbolicAddrOUT, + CONNECTION_DATA *psConnection) +{ + PMR * psPMRInt = IMG_NULL; + IMG_HANDLE hPMRInt2 = IMG_NULL; + IMG_CHAR *puiMemspaceNameInt = IMG_NULL; + IMG_CHAR *puiSymbolicAddrInt = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPSYMBOLICADDR); + + + 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_HANDLE *) &hPMRInt2, + psPMRPDumpSymbolicAddrIN->hPMR, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR); + if(psPMRPDumpSymbolicAddrOUT->eError != PVRSRV_OK) + { + goto PMRPDumpSymbolicAddr_exit; + } + + /* Look up the data from the resman address */ + psPMRPDumpSymbolicAddrOUT->eError = ResManFindPrivateDataByPtr(hPMRInt2, (IMG_VOID **) &psPMRInt); + + 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 ui32BridgeID, + PVRSRV_BRIDGE_IN_PMRPDUMPPOL32 *psPMRPDumpPol32IN, + PVRSRV_BRIDGE_OUT_PMRPDUMPPOL32 *psPMRPDumpPol32OUT, + CONNECTION_DATA *psConnection) +{ + PMR * psPMRInt = IMG_NULL; + IMG_HANDLE hPMRInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPPOL32); + + + + + + { + /* Look up the address from the handle */ + psPMRPDumpPol32OUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hPMRInt2, + psPMRPDumpPol32IN->hPMR, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR); + if(psPMRPDumpPol32OUT->eError != PVRSRV_OK) + { + goto PMRPDumpPol32_exit; + } + + /* Look up the data from the resman address */ + psPMRPDumpPol32OUT->eError = ResManFindPrivateDataByPtr(hPMRInt2, (IMG_VOID **) &psPMRInt); + + 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 ui32BridgeID, + PVRSRV_BRIDGE_IN_PMRPDUMPCBP *psPMRPDumpCBPIN, + PVRSRV_BRIDGE_OUT_PMRPDUMPCBP *psPMRPDumpCBPOUT, + CONNECTION_DATA *psConnection) +{ + PMR * psPMRInt = IMG_NULL; + IMG_HANDLE hPMRInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPCBP); + + + + + + { + /* Look up the address from the handle */ + psPMRPDumpCBPOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hPMRInt2, + psPMRPDumpCBPIN->hPMR, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR); + if(psPMRPDumpCBPOUT->eError != PVRSRV_OK) + { + goto PMRPDumpCBP_exit; + } + + /* Look up the data from the resman address */ + psPMRPDumpCBPOUT->eError = ResManFindPrivateDataByPtr(hPMRInt2, (IMG_VOID **) &psPMRInt); + + 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 ui32BridgeID, + PVRSRV_BRIDGE_IN_DEVMEMINTPDUMPSAVETOFILEVIRTUAL *psDevmemIntPDumpSaveToFileVirtualIN, + PVRSRV_BRIDGE_OUT_DEVMEMINTPDUMPSAVETOFILEVIRTUAL *psDevmemIntPDumpSaveToFileVirtualOUT, + CONNECTION_DATA *psConnection) +{ + DEVMEMINT_CTX * psDevmemServerContextInt = IMG_NULL; + IMG_HANDLE hDevmemServerContextInt2 = IMG_NULL; + IMG_CHAR *uiFileNameInt = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_PDUMPMM_DEVMEMINTPDUMPSAVETOFILEVIRTUAL); + + + + + 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_HANDLE *) &hDevmemServerContextInt2, + psDevmemIntPDumpSaveToFileVirtualIN->hDevmemServerContext, + PVRSRV_HANDLE_TYPE_DEVMEMINT_CTX); + if(psDevmemIntPDumpSaveToFileVirtualOUT->eError != PVRSRV_OK) + { + goto DevmemIntPDumpSaveToFileVirtual_exit; + } + + /* Look up the data from the resman address */ + psDevmemIntPDumpSaveToFileVirtualOUT->eError = ResManFindPrivateDataByPtr(hDevmemServerContextInt2, (IMG_VOID **) &psDevmemServerContextInt); + + 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 RegisterPDUMPMMFunctions(IMG_VOID); +IMG_VOID UnregisterPDUMPMMFunctions(IMG_VOID); + +/* + * Register all PDUMPMM functions with services + */ +PVRSRV_ERROR RegisterPDUMPMMFunctions(IMG_VOID) +{ + SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPLOADMEM, PVRSRVBridgePMRPDumpLoadMem); + SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPLOADMEMVALUE32, PVRSRVBridgePMRPDumpLoadMemValue32); + SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPLOADMEMVALUE64, PVRSRVBridgePMRPDumpLoadMemValue64); + SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPSAVETOFILE, PVRSRVBridgePMRPDumpSaveToFile); + SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPSYMBOLICADDR, PVRSRVBridgePMRPDumpSymbolicAddr); + SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPPOL32, PVRSRVBridgePMRPDumpPol32); + SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPCBP, PVRSRVBridgePMRPDumpCBP); + SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMPMM_DEVMEMINTPDUMPSAVETOFILEVIRTUAL, PVRSRVBridgeDevmemIntPDumpSaveToFileVirtual); + + return PVRSRV_OK; +} + +/* + * Unregister all pdumpmm functions with services + */ +IMG_VOID UnregisterPDUMPMMFunctions(IMG_VOID) +{ +} diff --git a/drivers/gpu/rogue/generated/pvrtl_bridge/client_pvrtl_bridge.h b/drivers/gpu/rogue/generated/pvrtl_bridge/client_pvrtl_bridge.h new file mode 100644 index 000000000000..d91040ff8c61 --- /dev/null +++ b/drivers/gpu/rogue/generated/pvrtl_bridge/client_pvrtl_bridge.h @@ -0,0 +1,83 @@ +/*************************************************************************/ /*! +@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); + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeTLTestIoctl(IMG_HANDLE hBridge, + IMG_UINT32 ui32Cmd, + IMG_BYTE *psIn1, + IMG_UINT32 ui32In2, + IMG_UINT32 *pui32Out1, + IMG_UINT32 *pui32Out2); + + +#endif /* CLIENT_PVRTL_BRIDGE_H */ diff --git a/drivers/gpu/rogue/generated/pvrtl_bridge/common_pvrtl_bridge.h b/drivers/gpu/rogue/generated/pvrtl_bridge/common_pvrtl_bridge.h new file mode 100644 index 000000000000..87010ed80684 --- /dev/null +++ b/drivers/gpu/rogue/generated/pvrtl_bridge/common_pvrtl_bridge.h @@ -0,0 +1,196 @@ +/*************************************************************************/ /*! +@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 "devicemem_typedefs.h" +#include "pvr_tl.h" +#include "tltestdefs.h" + + +#include "pvr_bridge_io.h" + +#define PVRSRV_BRIDGE_PVRTL_CMD_FIRST (PVRSRV_BRIDGE_PVRTL_START) +#define PVRSRV_BRIDGE_PVRTL_TLCONNECT PVRSRV_IOWR(PVRSRV_BRIDGE_PVRTL_CMD_FIRST+0) +#define PVRSRV_BRIDGE_PVRTL_TLDISCONNECT PVRSRV_IOWR(PVRSRV_BRIDGE_PVRTL_CMD_FIRST+1) +#define PVRSRV_BRIDGE_PVRTL_TLOPENSTREAM PVRSRV_IOWR(PVRSRV_BRIDGE_PVRTL_CMD_FIRST+2) +#define PVRSRV_BRIDGE_PVRTL_TLCLOSESTREAM PVRSRV_IOWR(PVRSRV_BRIDGE_PVRTL_CMD_FIRST+3) +#define PVRSRV_BRIDGE_PVRTL_TLACQUIREDATA PVRSRV_IOWR(PVRSRV_BRIDGE_PVRTL_CMD_FIRST+4) +#define PVRSRV_BRIDGE_PVRTL_TLRELEASEDATA PVRSRV_IOWR(PVRSRV_BRIDGE_PVRTL_CMD_FIRST+5) +#define PVRSRV_BRIDGE_PVRTL_TLTESTIOCTL PVRSRV_IOWR(PVRSRV_BRIDGE_PVRTL_CMD_FIRST+6) +#define PVRSRV_BRIDGE_PVRTL_CMD_LAST (PVRSRV_BRIDGE_PVRTL_CMD_FIRST+6) + + +/******************************************* + 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; + +/******************************************* + TLTestIoctl + *******************************************/ + +/* Bridge in structure for TLTestIoctl */ +typedef struct PVRSRV_BRIDGE_IN_TLTESTIOCTL_TAG +{ + IMG_UINT32 ui32Cmd; + IMG_BYTE * psIn1; + IMG_UINT32 ui32In2; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_TLTESTIOCTL; + + +/* Bridge out structure for TLTestIoctl */ +typedef struct PVRSRV_BRIDGE_OUT_TLTESTIOCTL_TAG +{ + IMG_UINT32 ui32Out1; + IMG_UINT32 ui32Out2; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_TLTESTIOCTL; + +#endif /* COMMON_PVRTL_BRIDGE_H */ diff --git a/drivers/gpu/rogue/generated/pvrtl_bridge/server_pvrtl_bridge.c b/drivers/gpu/rogue/generated/pvrtl_bridge/server_pvrtl_bridge.c new file mode 100644 index 000000000000..047bf67ea71f --- /dev/null +++ b/drivers/gpu/rogue/generated/pvrtl_bridge/server_pvrtl_bridge.c @@ -0,0 +1,477 @@ +/*************************************************************************/ /*! +@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 + +/* *************************************************************************** + * Bridge proxy functions + */ + +static PVRSRV_ERROR +TLCloseStreamResManProxy(IMG_HANDLE hResmanItem) +{ + PVRSRV_ERROR eError; + + eError = ResManFreeResByPtr(hResmanItem); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + + return eError; +} + + + +/* *************************************************************************** + * Server-side bridge entry points + */ + +static IMG_INT +PVRSRVBridgeTLConnect(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_TLCONNECT *psTLConnectIN, + PVRSRV_BRIDGE_OUT_TLCONNECT *psTLConnectOUT, + CONNECTION_DATA *psConnection) +{ + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_PVRTL_TLCONNECT); + + PVR_UNREFERENCED_PARAMETER(psTLConnectIN); + + + + + psTLConnectOUT->eError = + TLServerConnectKM(psConnection + ); + + + + + return 0; +} + +static IMG_INT +PVRSRVBridgeTLDisconnect(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_TLDISCONNECT *psTLDisconnectIN, + PVRSRV_BRIDGE_OUT_TLDISCONNECT *psTLDisconnectOUT, + CONNECTION_DATA *psConnection) +{ + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_PVRTL_TLDISCONNECT); + + PVR_UNREFERENCED_PARAMETER(psTLDisconnectIN); + + + + + psTLDisconnectOUT->eError = + TLServerDisconnectKM(psConnection + ); + + + + + return 0; +} + +static IMG_INT +PVRSRVBridgeTLOpenStream(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_TLOPENSTREAM *psTLOpenStreamIN, + PVRSRV_BRIDGE_OUT_TLOPENSTREAM *psTLOpenStreamOUT, + CONNECTION_DATA *psConnection) +{ + IMG_CHAR *uiNameInt = IMG_NULL; + TL_STREAM_DESC * psSDInt = IMG_NULL; + IMG_HANDLE hSDInt2 = IMG_NULL; + DEVMEM_EXPORTCOOKIE * psClientBUFExportCookieInt = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_PVRTL_TLOPENSTREAM); + + + + 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; + } + + /* Create a resman item and overwrite the handle with it */ + hSDInt2 = ResManRegisterRes(psConnection->hResManContext, + RESMAN_TYPE_TL_STREAM_DESC, + psSDInt, + (RESMAN_FREE_FN)&TLServerCloseStreamKM); + if (hSDInt2 == IMG_NULL) + { + psTLOpenStreamOUT->eError = PVRSRV_ERROR_UNABLE_TO_REGISTER_RESOURCE; + goto TLOpenStream_exit; + } + psTLOpenStreamOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psTLOpenStreamOUT->hSD, + (IMG_HANDLE) hSDInt2, + PVRSRV_HANDLE_TYPE_PVR_TL_SD, + PVRSRV_HANDLE_ALLOC_FLAG_NONE + ); + if (psTLOpenStreamOUT->eError != PVRSRV_OK) + { + goto TLOpenStream_exit; + } + psTLOpenStreamOUT->eError = PVRSRVAllocSubHandle(psConnection->psHandleBase, + &psTLOpenStreamOUT->hClientBUFExportCookie, + (IMG_HANDLE) 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) + { + PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psTLOpenStreamOUT->hSD, + PVRSRV_HANDLE_TYPE_PVR_TL_SD); + } + + /* If we have a valid resman item we should undo the bridge function by freeing the resman item */ + if (hSDInt2) + { + PVRSRV_ERROR eError = ResManFreeResByPtr(hSDInt2); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + } + else if (psSDInt) + { + TLServerCloseStreamKM(psSDInt); + } + } + + if (uiNameInt) + OSFreeMem(uiNameInt); + + return 0; +} + +static IMG_INT +PVRSRVBridgeTLCloseStream(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_TLCLOSESTREAM *psTLCloseStreamIN, + PVRSRV_BRIDGE_OUT_TLCLOSESTREAM *psTLCloseStreamOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hSDInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_PVRTL_TLCLOSESTREAM); + + + + + + { + /* Look up the address from the handle */ + psTLCloseStreamOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hSDInt2, + psTLCloseStreamIN->hSD, + PVRSRV_HANDLE_TYPE_PVR_TL_SD); + if(psTLCloseStreamOUT->eError != PVRSRV_OK) + { + goto TLCloseStream_exit; + } + + } + + psTLCloseStreamOUT->eError = TLCloseStreamResManProxy(hSDInt2); + /* Exit early if bridged call fails */ + if(psTLCloseStreamOUT->eError != PVRSRV_OK) + { + goto TLCloseStream_exit; + } + + psTLCloseStreamOUT->eError = + PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psTLCloseStreamIN->hSD, + PVRSRV_HANDLE_TYPE_PVR_TL_SD); + + +TLCloseStream_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeTLAcquireData(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_TLACQUIREDATA *psTLAcquireDataIN, + PVRSRV_BRIDGE_OUT_TLACQUIREDATA *psTLAcquireDataOUT, + CONNECTION_DATA *psConnection) +{ + TL_STREAM_DESC * psSDInt = IMG_NULL; + IMG_HANDLE hSDInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_PVRTL_TLACQUIREDATA); + + + + + + { + /* Look up the address from the handle */ + psTLAcquireDataOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hSDInt2, + psTLAcquireDataIN->hSD, + PVRSRV_HANDLE_TYPE_PVR_TL_SD); + if(psTLAcquireDataOUT->eError != PVRSRV_OK) + { + goto TLAcquireData_exit; + } + + /* Look up the data from the resman address */ + psTLAcquireDataOUT->eError = ResManFindPrivateDataByPtr(hSDInt2, (IMG_VOID **) &psSDInt); + + 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 ui32BridgeID, + PVRSRV_BRIDGE_IN_TLRELEASEDATA *psTLReleaseDataIN, + PVRSRV_BRIDGE_OUT_TLRELEASEDATA *psTLReleaseDataOUT, + CONNECTION_DATA *psConnection) +{ + TL_STREAM_DESC * psSDInt = IMG_NULL; + IMG_HANDLE hSDInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_PVRTL_TLRELEASEDATA); + + + + + + { + /* Look up the address from the handle */ + psTLReleaseDataOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hSDInt2, + psTLReleaseDataIN->hSD, + PVRSRV_HANDLE_TYPE_PVR_TL_SD); + if(psTLReleaseDataOUT->eError != PVRSRV_OK) + { + goto TLReleaseData_exit; + } + + /* Look up the data from the resman address */ + psTLReleaseDataOUT->eError = ResManFindPrivateDataByPtr(hSDInt2, (IMG_VOID **) &psSDInt); + + if(psTLReleaseDataOUT->eError != PVRSRV_OK) + { + goto TLReleaseData_exit; + } + } + + psTLReleaseDataOUT->eError = + TLServerReleaseDataKM( + psSDInt, + psTLReleaseDataIN->ui32ReadOffset, + psTLReleaseDataIN->ui32ReadLen); + + + +TLReleaseData_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeTLTestIoctl(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_TLTESTIOCTL *psTLTestIoctlIN, + PVRSRV_BRIDGE_OUT_TLTESTIOCTL *psTLTestIoctlOUT, + CONNECTION_DATA *psConnection) +{ + IMG_BYTE *psIn1Int = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_PVRTL_TLTESTIOCTL); + + PVR_UNREFERENCED_PARAMETER(psConnection); + + + + + { + psIn1Int = OSAllocMem(PVR_TL_TEST_PARAM_MAX_SIZE * sizeof(IMG_BYTE)); + if (!psIn1Int) + { + psTLTestIoctlOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto TLTestIoctl_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psTLTestIoctlIN->psIn1, PVR_TL_TEST_PARAM_MAX_SIZE * sizeof(IMG_BYTE)) + || (OSCopyFromUser(NULL, psIn1Int, psTLTestIoctlIN->psIn1, + PVR_TL_TEST_PARAM_MAX_SIZE * sizeof(IMG_BYTE)) != PVRSRV_OK) ) + { + psTLTestIoctlOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto TLTestIoctl_exit; + } + + psTLTestIoctlOUT->eError = + TLServerTestIoctlKM( + psTLTestIoctlIN->ui32Cmd, + psIn1Int, + psTLTestIoctlIN->ui32In2, + &psTLTestIoctlOUT->ui32Out1, + &psTLTestIoctlOUT->ui32Out2); + + + +TLTestIoctl_exit: + if (psIn1Int) + OSFreeMem(psIn1Int); + + return 0; +} + + + +/* *************************************************************************** + * Server bridge dispatch related glue + */ + +PVRSRV_ERROR RegisterPVRTLFunctions(IMG_VOID); +IMG_VOID UnregisterPVRTLFunctions(IMG_VOID); + +/* + * Register all PVRTL functions with services + */ +PVRSRV_ERROR RegisterPVRTLFunctions(IMG_VOID) +{ + SetDispatchTableEntry(PVRSRV_BRIDGE_PVRTL_TLCONNECT, PVRSRVBridgeTLConnect); + SetDispatchTableEntry(PVRSRV_BRIDGE_PVRTL_TLDISCONNECT, PVRSRVBridgeTLDisconnect); + SetDispatchTableEntry(PVRSRV_BRIDGE_PVRTL_TLOPENSTREAM, PVRSRVBridgeTLOpenStream); + SetDispatchTableEntry(PVRSRV_BRIDGE_PVRTL_TLCLOSESTREAM, PVRSRVBridgeTLCloseStream); + SetDispatchTableEntry(PVRSRV_BRIDGE_PVRTL_TLACQUIREDATA, PVRSRVBridgeTLAcquireData); + SetDispatchTableEntry(PVRSRV_BRIDGE_PVRTL_TLRELEASEDATA, PVRSRVBridgeTLReleaseData); + SetDispatchTableEntry(PVRSRV_BRIDGE_PVRTL_TLTESTIOCTL, PVRSRVBridgeTLTestIoctl); + + return PVRSRV_OK; +} + +/* + * Unregister all pvrtl functions with services + */ +IMG_VOID UnregisterPVRTLFunctions(IMG_VOID) +{ +} diff --git a/drivers/gpu/rogue/generated/regconfig_bridge/common_regconfig_bridge.h b/drivers/gpu/rogue/generated/regconfig_bridge/common_regconfig_bridge.h new file mode 100644 index 000000000000..fcce738e3f78 --- /dev/null +++ b/drivers/gpu/rogue/generated/regconfig_bridge/common_regconfig_bridge.h @@ -0,0 +1,150 @@ +/*************************************************************************/ /*! +@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 "rgx_bridge.h" + + +#include "pvr_bridge_io.h" + +#define PVRSRV_BRIDGE_REGCONFIG_CMD_FIRST (PVRSRV_BRIDGE_REGCONFIG_START) +#define PVRSRV_BRIDGE_REGCONFIG_RGXSETREGCONFIGPI PVRSRV_IOWR(PVRSRV_BRIDGE_REGCONFIG_CMD_FIRST+0) +#define PVRSRV_BRIDGE_REGCONFIG_RGXADDREGCONFIG PVRSRV_IOWR(PVRSRV_BRIDGE_REGCONFIG_CMD_FIRST+1) +#define PVRSRV_BRIDGE_REGCONFIG_RGXCLEARREGCONFIG PVRSRV_IOWR(PVRSRV_BRIDGE_REGCONFIG_CMD_FIRST+2) +#define PVRSRV_BRIDGE_REGCONFIG_RGXENABLEREGCONFIG PVRSRV_IOWR(PVRSRV_BRIDGE_REGCONFIG_CMD_FIRST+3) +#define PVRSRV_BRIDGE_REGCONFIG_RGXDISABLEREGCONFIG PVRSRV_IOWR(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/generated/regconfig_bridge/server_regconfig_bridge.c b/drivers/gpu/rogue/generated/regconfig_bridge/server_regconfig_bridge.c new file mode 100644 index 000000000000..ac6c68e6345a --- /dev/null +++ b/drivers/gpu/rogue/generated/regconfig_bridge/server_regconfig_bridge.c @@ -0,0 +1,304 @@ +/*************************************************************************/ /*! +@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 + +/* *************************************************************************** + * Bridge proxy functions + */ + + + +/* *************************************************************************** + * Server-side bridge entry points + */ + +static IMG_INT +PVRSRVBridgeRGXSetRegConfigPI(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_RGXSETREGCONFIGPI *psRGXSetRegConfigPIIN, + PVRSRV_BRIDGE_OUT_RGXSETREGCONFIGPI *psRGXSetRegConfigPIOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevNodeInt = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_REGCONFIG_RGXSETREGCONFIGPI); + + + + + + { + /* Look up the address from the handle */ + psRGXSetRegConfigPIOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &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 ui32BridgeID, + PVRSRV_BRIDGE_IN_RGXADDREGCONFIG *psRGXAddRegconfigIN, + PVRSRV_BRIDGE_OUT_RGXADDREGCONFIG *psRGXAddRegconfigOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevNodeInt = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_REGCONFIG_RGXADDREGCONFIG); + + + + + + { + /* Look up the address from the handle */ + psRGXAddRegconfigOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &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 ui32BridgeID, + PVRSRV_BRIDGE_IN_RGXCLEARREGCONFIG *psRGXClearRegConfigIN, + PVRSRV_BRIDGE_OUT_RGXCLEARREGCONFIG *psRGXClearRegConfigOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevNodeInt = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_REGCONFIG_RGXCLEARREGCONFIG); + + + + + + { + /* Look up the address from the handle */ + psRGXClearRegConfigOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &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 ui32BridgeID, + PVRSRV_BRIDGE_IN_RGXENABLEREGCONFIG *psRGXEnableRegConfigIN, + PVRSRV_BRIDGE_OUT_RGXENABLEREGCONFIG *psRGXEnableRegConfigOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevNodeInt = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_REGCONFIG_RGXENABLEREGCONFIG); + + + + + + { + /* Look up the address from the handle */ + psRGXEnableRegConfigOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &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 ui32BridgeID, + PVRSRV_BRIDGE_IN_RGXDISABLEREGCONFIG *psRGXDisableRegConfigIN, + PVRSRV_BRIDGE_OUT_RGXDISABLEREGCONFIG *psRGXDisableRegConfigOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevNodeInt = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_REGCONFIG_RGXDISABLEREGCONFIG); + + + + + + { + /* Look up the address from the handle */ + psRGXDisableRegConfigOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &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 RegisterREGCONFIGFunctions(IMG_VOID); +IMG_VOID UnregisterREGCONFIGFunctions(IMG_VOID); + +/* + * Register all REGCONFIG functions with services + */ +PVRSRV_ERROR RegisterREGCONFIGFunctions(IMG_VOID) +{ + SetDispatchTableEntry(PVRSRV_BRIDGE_REGCONFIG_RGXSETREGCONFIGPI, PVRSRVBridgeRGXSetRegConfigPI); + SetDispatchTableEntry(PVRSRV_BRIDGE_REGCONFIG_RGXADDREGCONFIG, PVRSRVBridgeRGXAddRegconfig); + SetDispatchTableEntry(PVRSRV_BRIDGE_REGCONFIG_RGXCLEARREGCONFIG, PVRSRVBridgeRGXClearRegConfig); + SetDispatchTableEntry(PVRSRV_BRIDGE_REGCONFIG_RGXENABLEREGCONFIG, PVRSRVBridgeRGXEnableRegConfig); + SetDispatchTableEntry(PVRSRV_BRIDGE_REGCONFIG_RGXDISABLEREGCONFIG, PVRSRVBridgeRGXDisableRegConfig); + + return PVRSRV_OK; +} + +/* + * Unregister all regconfig functions with services + */ +IMG_VOID UnregisterREGCONFIGFunctions(IMG_VOID) +{ +} diff --git a/drivers/gpu/rogue/generated/rgxcmp_bridge/common_rgxcmp_bridge.h b/drivers/gpu/rogue/generated/rgxcmp_bridge/common_rgxcmp_bridge.h new file mode 100644 index 000000000000..43a5fda70663 --- /dev/null +++ b/drivers/gpu/rogue/generated/rgxcmp_bridge/common_rgxcmp_bridge.h @@ -0,0 +1,200 @@ +/*************************************************************************/ /*! +@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 "rgx_bridge.h" +#include "sync_external.h" +#include "rgx_fwif_shared.h" + + +#include "pvr_bridge_io.h" + +#define PVRSRV_BRIDGE_RGXCMP_CMD_FIRST (PVRSRV_BRIDGE_RGXCMP_START) +#define PVRSRV_BRIDGE_RGXCMP_RGXCREATECOMPUTECONTEXT PVRSRV_IOWR(PVRSRV_BRIDGE_RGXCMP_CMD_FIRST+0) +#define PVRSRV_BRIDGE_RGXCMP_RGXDESTROYCOMPUTECONTEXT PVRSRV_IOWR(PVRSRV_BRIDGE_RGXCMP_CMD_FIRST+1) +#define PVRSRV_BRIDGE_RGXCMP_RGXKICKCDM PVRSRV_IOWR(PVRSRV_BRIDGE_RGXCMP_CMD_FIRST+2) +#define PVRSRV_BRIDGE_RGXCMP_RGXFLUSHCOMPUTEDATA PVRSRV_IOWR(PVRSRV_BRIDGE_RGXCMP_CMD_FIRST+3) +#define PVRSRV_BRIDGE_RGXCMP_RGXSETCOMPUTECONTEXTPRIORITY PVRSRV_IOWR(PVRSRV_BRIDGE_RGXCMP_CMD_FIRST+4) +#define PVRSRV_BRIDGE_RGXCMP_RGXKICKSYNCCDM PVRSRV_IOWR(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; + PRGXFWIF_UFO_ADDR * psClientFenceUFOAddress; + IMG_UINT32 * pui32ClientFenceValue; + IMG_UINT32 ui32ClientUpdateCount; + PRGXFWIF_UFO_ADDR * psClientUpdateUFOAddress; + 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; + PRGXFWIF_UFO_ADDR * psClientFenceUFOAddress; + IMG_UINT32 * pui32ClientFenceValue; + IMG_UINT32 ui32ClientUpdateCount; + PRGXFWIF_UFO_ADDR * psClientUpdateUFOAddress; + IMG_UINT32 * pui32ClientUpdateValue; + IMG_UINT32 ui32ServerSyncCount; + IMG_UINT32 * pui32ServerSyncFlags; + IMG_HANDLE * phServerSyncs; + IMG_UINT32 ui32NumFenceFDs; + IMG_INT32 * pi32FenceFDs; + 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/generated/rgxcmp_bridge/server_rgxcmp_bridge.c b/drivers/gpu/rogue/generated/rgxcmp_bridge/server_rgxcmp_bridge.c new file mode 100644 index 000000000000..a174f0955ad3 --- /dev/null +++ b/drivers/gpu/rogue/generated/rgxcmp_bridge/server_rgxcmp_bridge.c @@ -0,0 +1,905 @@ +/*************************************************************************/ /*! +@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 + +/* *************************************************************************** + * Bridge proxy functions + */ + +static PVRSRV_ERROR +RGXDestroyComputeContextResManProxy(IMG_HANDLE hResmanItem) +{ + PVRSRV_ERROR eError; + + eError = ResManFreeResByPtr(hResmanItem); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + + return eError; +} + + + +/* *************************************************************************** + * Server-side bridge entry points + */ + +static IMG_INT +PVRSRVBridgeRGXCreateComputeContext(IMG_UINT32 ui32BridgeID, + 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; + IMG_HANDLE hComputeContextInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_RGXCMP_RGXCREATECOMPUTECONTEXT); + + + + + 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_HANDLE *) &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_HANDLE *) &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; + } + + /* Create a resman item and overwrite the handle with it */ + hComputeContextInt2 = ResManRegisterRes(psConnection->hResManContext, + RESMAN_TYPE_RGX_SERVER_COMPUTE_CONTEXT, + psComputeContextInt, + (RESMAN_FREE_FN)&PVRSRVRGXDestroyComputeContextKM); + if (hComputeContextInt2 == IMG_NULL) + { + psRGXCreateComputeContextOUT->eError = PVRSRV_ERROR_UNABLE_TO_REGISTER_RESOURCE; + goto RGXCreateComputeContext_exit; + } + psRGXCreateComputeContextOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psRGXCreateComputeContextOUT->hComputeContext, + (IMG_HANDLE) hComputeContextInt2, + PVRSRV_HANDLE_TYPE_RGX_SERVER_COMPUTE_CONTEXT, + PVRSRV_HANDLE_ALLOC_FLAG_NONE + ); + if (psRGXCreateComputeContextOUT->eError != PVRSRV_OK) + { + goto RGXCreateComputeContext_exit; + } + + +RGXCreateComputeContext_exit: + if (psRGXCreateComputeContextOUT->eError != PVRSRV_OK) + { + /* If we have a valid resman item we should undo the bridge function by freeing the resman item */ + if (hComputeContextInt2) + { + PVRSRV_ERROR eError = ResManFreeResByPtr(hComputeContextInt2); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + } + else if (psComputeContextInt) + { + PVRSRVRGXDestroyComputeContextKM(psComputeContextInt); + } + } + + if (psFrameworkCmdInt) + OSFreeMem(psFrameworkCmdInt); + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXDestroyComputeContext(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_RGXDESTROYCOMPUTECONTEXT *psRGXDestroyComputeContextIN, + PVRSRV_BRIDGE_OUT_RGXDESTROYCOMPUTECONTEXT *psRGXDestroyComputeContextOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hComputeContextInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_RGXCMP_RGXDESTROYCOMPUTECONTEXT); + + + + + + { + /* Look up the address from the handle */ + psRGXDestroyComputeContextOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hComputeContextInt2, + psRGXDestroyComputeContextIN->hComputeContext, + PVRSRV_HANDLE_TYPE_RGX_SERVER_COMPUTE_CONTEXT); + if(psRGXDestroyComputeContextOUT->eError != PVRSRV_OK) + { + goto RGXDestroyComputeContext_exit; + } + + } + + psRGXDestroyComputeContextOUT->eError = RGXDestroyComputeContextResManProxy(hComputeContextInt2); + /* Exit early if bridged call fails */ + if(psRGXDestroyComputeContextOUT->eError != PVRSRV_OK) + { + goto RGXDestroyComputeContext_exit; + } + + psRGXDestroyComputeContextOUT->eError = + PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psRGXDestroyComputeContextIN->hComputeContext, + PVRSRV_HANDLE_TYPE_RGX_SERVER_COMPUTE_CONTEXT); + + +RGXDestroyComputeContext_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXKickCDM(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_RGXKICKCDM *psRGXKickCDMIN, + PVRSRV_BRIDGE_OUT_RGXKICKCDM *psRGXKickCDMOUT, + CONNECTION_DATA *psConnection) +{ + RGX_SERVER_COMPUTE_CONTEXT * psComputeContextInt = IMG_NULL; + IMG_HANDLE hComputeContextInt2 = IMG_NULL; + PRGXFWIF_UFO_ADDR *sClientFenceUFOAddressInt = IMG_NULL; + IMG_UINT32 *ui32ClientFenceValueInt = IMG_NULL; + PRGXFWIF_UFO_ADDR *sClientUpdateUFOAddressInt = 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; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_RGXCMP_RGXKICKCDM); + + + + + if (psRGXKickCDMIN->ui32ClientFenceCount != 0) + { + sClientFenceUFOAddressInt = OSAllocMem(psRGXKickCDMIN->ui32ClientFenceCount * sizeof(PRGXFWIF_UFO_ADDR)); + if (!sClientFenceUFOAddressInt) + { + psRGXKickCDMOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickCDM_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickCDMIN->psClientFenceUFOAddress, psRGXKickCDMIN->ui32ClientFenceCount * sizeof(PRGXFWIF_UFO_ADDR)) + || (OSCopyFromUser(NULL, sClientFenceUFOAddressInt, psRGXKickCDMIN->psClientFenceUFOAddress, + psRGXKickCDMIN->ui32ClientFenceCount * sizeof(PRGXFWIF_UFO_ADDR)) != 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) + { + sClientUpdateUFOAddressInt = OSAllocMem(psRGXKickCDMIN->ui32ClientUpdateCount * sizeof(PRGXFWIF_UFO_ADDR)); + if (!sClientUpdateUFOAddressInt) + { + psRGXKickCDMOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickCDM_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickCDMIN->psClientUpdateUFOAddress, psRGXKickCDMIN->ui32ClientUpdateCount * sizeof(PRGXFWIF_UFO_ADDR)) + || (OSCopyFromUser(NULL, sClientUpdateUFOAddressInt, psRGXKickCDMIN->psClientUpdateUFOAddress, + psRGXKickCDMIN->ui32ClientUpdateCount * sizeof(PRGXFWIF_UFO_ADDR)) != 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_HANDLE *) &hComputeContextInt2, + psRGXKickCDMIN->hComputeContext, + PVRSRV_HANDLE_TYPE_RGX_SERVER_COMPUTE_CONTEXT); + if(psRGXKickCDMOUT->eError != PVRSRV_OK) + { + goto RGXKickCDM_exit; + } + + /* Look up the data from the resman address */ + psRGXKickCDMOUT->eError = ResManFindPrivateDataByPtr(hComputeContextInt2, (IMG_VOID **) &psComputeContextInt); + + 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_HANDLE *) &hServerSyncsInt2[i], + hServerSyncsInt2[i], + PVRSRV_HANDLE_TYPE_SERVER_SYNC_PRIMITIVE); + if(psRGXKickCDMOUT->eError != PVRSRV_OK) + { + goto RGXKickCDM_exit; + } + + /* Look up the data from the resman address */ + psRGXKickCDMOUT->eError = ResManFindPrivateDataByPtr(hServerSyncsInt2[i], (IMG_VOID **) &psServerSyncsInt[i]); + + if(psRGXKickCDMOUT->eError != PVRSRV_OK) + { + goto RGXKickCDM_exit; + } + } + } + } + + psRGXKickCDMOUT->eError = + PVRSRVRGXKickCDMKM( + psComputeContextInt, + psRGXKickCDMIN->ui32ClientFenceCount, + sClientFenceUFOAddressInt, + ui32ClientFenceValueInt, + psRGXKickCDMIN->ui32ClientUpdateCount, + sClientUpdateUFOAddressInt, + ui32ClientUpdateValueInt, + psRGXKickCDMIN->ui32ServerSyncCount, + ui32ServerSyncFlagsInt, + psServerSyncsInt, + psRGXKickCDMIN->ui32CmdSize, + psDMCmdInt, + psRGXKickCDMIN->bbPDumpContinuous, + psRGXKickCDMIN->ui32ExternalJobReference, + psRGXKickCDMIN->ui32InternalJobReference); + + + +RGXKickCDM_exit: + if (sClientFenceUFOAddressInt) + OSFreeMem(sClientFenceUFOAddressInt); + if (ui32ClientFenceValueInt) + OSFreeMem(ui32ClientFenceValueInt); + if (sClientUpdateUFOAddressInt) + OSFreeMem(sClientUpdateUFOAddressInt); + 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 ui32BridgeID, + PVRSRV_BRIDGE_IN_RGXFLUSHCOMPUTEDATA *psRGXFlushComputeDataIN, + PVRSRV_BRIDGE_OUT_RGXFLUSHCOMPUTEDATA *psRGXFlushComputeDataOUT, + CONNECTION_DATA *psConnection) +{ + RGX_SERVER_COMPUTE_CONTEXT * psComputeContextInt = IMG_NULL; + IMG_HANDLE hComputeContextInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_RGXCMP_RGXFLUSHCOMPUTEDATA); + + + + + + { + /* Look up the address from the handle */ + psRGXFlushComputeDataOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hComputeContextInt2, + psRGXFlushComputeDataIN->hComputeContext, + PVRSRV_HANDLE_TYPE_RGX_SERVER_COMPUTE_CONTEXT); + if(psRGXFlushComputeDataOUT->eError != PVRSRV_OK) + { + goto RGXFlushComputeData_exit; + } + + /* Look up the data from the resman address */ + psRGXFlushComputeDataOUT->eError = ResManFindPrivateDataByPtr(hComputeContextInt2, (IMG_VOID **) &psComputeContextInt); + + if(psRGXFlushComputeDataOUT->eError != PVRSRV_OK) + { + goto RGXFlushComputeData_exit; + } + } + + psRGXFlushComputeDataOUT->eError = + PVRSRVRGXFlushComputeDataKM( + psComputeContextInt); + + + +RGXFlushComputeData_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXSetComputeContextPriority(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_RGXSETCOMPUTECONTEXTPRIORITY *psRGXSetComputeContextPriorityIN, + PVRSRV_BRIDGE_OUT_RGXSETCOMPUTECONTEXTPRIORITY *psRGXSetComputeContextPriorityOUT, + CONNECTION_DATA *psConnection) +{ + RGX_SERVER_COMPUTE_CONTEXT * psComputeContextInt = IMG_NULL; + IMG_HANDLE hComputeContextInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_RGXCMP_RGXSETCOMPUTECONTEXTPRIORITY); + + + + + + { + /* Look up the address from the handle */ + psRGXSetComputeContextPriorityOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hComputeContextInt2, + psRGXSetComputeContextPriorityIN->hComputeContext, + PVRSRV_HANDLE_TYPE_RGX_SERVER_COMPUTE_CONTEXT); + if(psRGXSetComputeContextPriorityOUT->eError != PVRSRV_OK) + { + goto RGXSetComputeContextPriority_exit; + } + + /* Look up the data from the resman address */ + psRGXSetComputeContextPriorityOUT->eError = ResManFindPrivateDataByPtr(hComputeContextInt2, (IMG_VOID **) &psComputeContextInt); + + 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 ui32BridgeID, + PVRSRV_BRIDGE_IN_RGXKICKSYNCCDM *psRGXKickSyncCDMIN, + PVRSRV_BRIDGE_OUT_RGXKICKSYNCCDM *psRGXKickSyncCDMOUT, + CONNECTION_DATA *psConnection) +{ + RGX_SERVER_COMPUTE_CONTEXT * psComputeContextInt = IMG_NULL; + IMG_HANDLE hComputeContextInt2 = IMG_NULL; + PRGXFWIF_UFO_ADDR *sClientFenceUFOAddressInt = IMG_NULL; + IMG_UINT32 *ui32ClientFenceValueInt = IMG_NULL; + PRGXFWIF_UFO_ADDR *sClientUpdateUFOAddressInt = 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 *i32FenceFDsInt = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_RGXCMP_RGXKICKSYNCCDM); + + + + + if (psRGXKickSyncCDMIN->ui32ClientFenceCount != 0) + { + sClientFenceUFOAddressInt = OSAllocMem(psRGXKickSyncCDMIN->ui32ClientFenceCount * sizeof(PRGXFWIF_UFO_ADDR)); + if (!sClientFenceUFOAddressInt) + { + psRGXKickSyncCDMOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickSyncCDM_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickSyncCDMIN->psClientFenceUFOAddress, psRGXKickSyncCDMIN->ui32ClientFenceCount * sizeof(PRGXFWIF_UFO_ADDR)) + || (OSCopyFromUser(NULL, sClientFenceUFOAddressInt, psRGXKickSyncCDMIN->psClientFenceUFOAddress, + psRGXKickSyncCDMIN->ui32ClientFenceCount * sizeof(PRGXFWIF_UFO_ADDR)) != 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) + { + sClientUpdateUFOAddressInt = OSAllocMem(psRGXKickSyncCDMIN->ui32ClientUpdateCount * sizeof(PRGXFWIF_UFO_ADDR)); + if (!sClientUpdateUFOAddressInt) + { + psRGXKickSyncCDMOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickSyncCDM_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickSyncCDMIN->psClientUpdateUFOAddress, psRGXKickSyncCDMIN->ui32ClientUpdateCount * sizeof(PRGXFWIF_UFO_ADDR)) + || (OSCopyFromUser(NULL, sClientUpdateUFOAddressInt, psRGXKickSyncCDMIN->psClientUpdateUFOAddress, + psRGXKickSyncCDMIN->ui32ClientUpdateCount * sizeof(PRGXFWIF_UFO_ADDR)) != 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->ui32NumFenceFDs != 0) + { + i32FenceFDsInt = OSAllocMem(psRGXKickSyncCDMIN->ui32NumFenceFDs * sizeof(IMG_INT32)); + if (!i32FenceFDsInt) + { + psRGXKickSyncCDMOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickSyncCDM_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickSyncCDMIN->pi32FenceFDs, psRGXKickSyncCDMIN->ui32NumFenceFDs * sizeof(IMG_INT32)) + || (OSCopyFromUser(NULL, i32FenceFDsInt, psRGXKickSyncCDMIN->pi32FenceFDs, + psRGXKickSyncCDMIN->ui32NumFenceFDs * 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_HANDLE *) &hComputeContextInt2, + psRGXKickSyncCDMIN->hComputeContext, + PVRSRV_HANDLE_TYPE_RGX_SERVER_COMPUTE_CONTEXT); + if(psRGXKickSyncCDMOUT->eError != PVRSRV_OK) + { + goto RGXKickSyncCDM_exit; + } + + /* Look up the data from the resman address */ + psRGXKickSyncCDMOUT->eError = ResManFindPrivateDataByPtr(hComputeContextInt2, (IMG_VOID **) &psComputeContextInt); + + 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_HANDLE *) &hServerSyncsInt2[i], + hServerSyncsInt2[i], + PVRSRV_HANDLE_TYPE_SERVER_SYNC_PRIMITIVE); + if(psRGXKickSyncCDMOUT->eError != PVRSRV_OK) + { + goto RGXKickSyncCDM_exit; + } + + /* Look up the data from the resman address */ + psRGXKickSyncCDMOUT->eError = ResManFindPrivateDataByPtr(hServerSyncsInt2[i], (IMG_VOID **) &psServerSyncsInt[i]); + + if(psRGXKickSyncCDMOUT->eError != PVRSRV_OK) + { + goto RGXKickSyncCDM_exit; + } + } + } + } + + psRGXKickSyncCDMOUT->eError = + PVRSRVRGXKickSyncCDMKM( + psComputeContextInt, + psRGXKickSyncCDMIN->ui32ClientFenceCount, + sClientFenceUFOAddressInt, + ui32ClientFenceValueInt, + psRGXKickSyncCDMIN->ui32ClientUpdateCount, + sClientUpdateUFOAddressInt, + ui32ClientUpdateValueInt, + psRGXKickSyncCDMIN->ui32ServerSyncCount, + ui32ServerSyncFlagsInt, + psServerSyncsInt, + psRGXKickSyncCDMIN->ui32NumFenceFDs, + i32FenceFDsInt, + psRGXKickSyncCDMIN->bbPDumpContinuous); + + + +RGXKickSyncCDM_exit: + if (sClientFenceUFOAddressInt) + OSFreeMem(sClientFenceUFOAddressInt); + if (ui32ClientFenceValueInt) + OSFreeMem(ui32ClientFenceValueInt); + if (sClientUpdateUFOAddressInt) + OSFreeMem(sClientUpdateUFOAddressInt); + if (ui32ClientUpdateValueInt) + OSFreeMem(ui32ClientUpdateValueInt); + if (ui32ServerSyncFlagsInt) + OSFreeMem(ui32ServerSyncFlagsInt); + if (psServerSyncsInt) + OSFreeMem(psServerSyncsInt); + if (hServerSyncsInt2) + OSFreeMem(hServerSyncsInt2); + if (i32FenceFDsInt) + OSFreeMem(i32FenceFDsInt); + + return 0; +} + + + +/* *************************************************************************** + * Server bridge dispatch related glue + */ + +PVRSRV_ERROR RegisterRGXCMPFunctions(IMG_VOID); +IMG_VOID UnregisterRGXCMPFunctions(IMG_VOID); + +/* + * Register all RGXCMP functions with services + */ +PVRSRV_ERROR RegisterRGXCMPFunctions(IMG_VOID) +{ + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXCMP_RGXCREATECOMPUTECONTEXT, PVRSRVBridgeRGXCreateComputeContext); + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXCMP_RGXDESTROYCOMPUTECONTEXT, PVRSRVBridgeRGXDestroyComputeContext); + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXCMP_RGXKICKCDM, PVRSRVBridgeRGXKickCDM); + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXCMP_RGXFLUSHCOMPUTEDATA, PVRSRVBridgeRGXFlushComputeData); + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXCMP_RGXSETCOMPUTECONTEXTPRIORITY, PVRSRVBridgeRGXSetComputeContextPriority); + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXCMP_RGXKICKSYNCCDM, PVRSRVBridgeRGXKickSyncCDM); + + return PVRSRV_OK; +} + +/* + * Unregister all rgxcmp functions with services + */ +IMG_VOID UnregisterRGXCMPFunctions(IMG_VOID) +{ +} diff --git a/drivers/gpu/rogue/generated/rgxhwperf_bridge/common_rgxhwperf_bridge.h b/drivers/gpu/rogue/generated/rgxhwperf_bridge/common_rgxhwperf_bridge.h new file mode 100644 index 000000000000..296fa692d156 --- /dev/null +++ b/drivers/gpu/rogue/generated/rgxhwperf_bridge/common_rgxhwperf_bridge.h @@ -0,0 +1,140 @@ +/*************************************************************************/ /*! +@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 "rgx_bridge.h" +#include "rgx_hwperf_km.h" + + +#include "pvr_bridge_io.h" + +#define PVRSRV_BRIDGE_RGXHWPERF_CMD_FIRST (PVRSRV_BRIDGE_RGXHWPERF_START) +#define PVRSRV_BRIDGE_RGXHWPERF_RGXCTRLHWPERF PVRSRV_IOWR(PVRSRV_BRIDGE_RGXHWPERF_CMD_FIRST+0) +#define PVRSRV_BRIDGE_RGXHWPERF_RGXCONFIGENABLEHWPERFCOUNTERS PVRSRV_IOWR(PVRSRV_BRIDGE_RGXHWPERF_CMD_FIRST+1) +#define PVRSRV_BRIDGE_RGXHWPERF_RGXCTRLHWPERFCOUNTERS PVRSRV_IOWR(PVRSRV_BRIDGE_RGXHWPERF_CMD_FIRST+2) +#define PVRSRV_BRIDGE_RGXHWPERF_RGXCONFIGCUSTOMCOUNTERS PVRSRV_IOWR(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_UINT8 * pui8BlockIDs; +} __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/generated/rgxhwperf_bridge/server_rgxhwperf_bridge.c b/drivers/gpu/rogue/generated/rgxhwperf_bridge/server_rgxhwperf_bridge.c new file mode 100644 index 000000000000..1546a1de7775 --- /dev/null +++ b/drivers/gpu/rogue/generated/rgxhwperf_bridge/server_rgxhwperf_bridge.c @@ -0,0 +1,340 @@ +/*************************************************************************/ /*! +@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 + +/* *************************************************************************** + * Bridge proxy functions + */ + + + +/* *************************************************************************** + * Server-side bridge entry points + */ + +static IMG_INT +PVRSRVBridgeRGXCtrlHWPerf(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_RGXCTRLHWPERF *psRGXCtrlHWPerfIN, + PVRSRV_BRIDGE_OUT_RGXCTRLHWPERF *psRGXCtrlHWPerfOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevNodeInt = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_RGXHWPERF_RGXCTRLHWPERF); + + + + + + { + /* Look up the address from the handle */ + psRGXCtrlHWPerfOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &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 ui32BridgeID, + 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; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_RGXHWPERF_RGXCONFIGENABLEHWPERFCOUNTERS); + + + + + 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_HANDLE *) &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 ui32BridgeID, + PVRSRV_BRIDGE_IN_RGXCTRLHWPERFCOUNTERS *psRGXCtrlHWPerfCountersIN, + PVRSRV_BRIDGE_OUT_RGXCTRLHWPERFCOUNTERS *psRGXCtrlHWPerfCountersOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevNodeInt = IMG_NULL; + IMG_UINT8 *ui8BlockIDsInt = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_RGXHWPERF_RGXCTRLHWPERFCOUNTERS); + + + + + if (psRGXCtrlHWPerfCountersIN->ui32ArrayLen != 0) + { + ui8BlockIDsInt = OSAllocMem(psRGXCtrlHWPerfCountersIN->ui32ArrayLen * sizeof(IMG_UINT8)); + if (!ui8BlockIDsInt) + { + psRGXCtrlHWPerfCountersOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXCtrlHWPerfCounters_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXCtrlHWPerfCountersIN->pui8BlockIDs, psRGXCtrlHWPerfCountersIN->ui32ArrayLen * sizeof(IMG_UINT8)) + || (OSCopyFromUser(NULL, ui8BlockIDsInt, psRGXCtrlHWPerfCountersIN->pui8BlockIDs, + psRGXCtrlHWPerfCountersIN->ui32ArrayLen * sizeof(IMG_UINT8)) != PVRSRV_OK) ) + { + psRGXCtrlHWPerfCountersOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXCtrlHWPerfCounters_exit; + } + + { + /* Look up the address from the handle */ + psRGXCtrlHWPerfCountersOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hDevNodeInt, + psRGXCtrlHWPerfCountersIN->hDevNode, + PVRSRV_HANDLE_TYPE_DEV_NODE); + if(psRGXCtrlHWPerfCountersOUT->eError != PVRSRV_OK) + { + goto RGXCtrlHWPerfCounters_exit; + } + + } + + psRGXCtrlHWPerfCountersOUT->eError = + PVRSRVRGXCtrlHWPerfCountersKM( + hDevNodeInt, + psRGXCtrlHWPerfCountersIN->bEnable, + psRGXCtrlHWPerfCountersIN->ui32ArrayLen, + ui8BlockIDsInt); + + + +RGXCtrlHWPerfCounters_exit: + if (ui8BlockIDsInt) + OSFreeMem(ui8BlockIDsInt); + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXConfigCustomCounters(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_RGXCONFIGCUSTOMCOUNTERS *psRGXConfigCustomCountersIN, + PVRSRV_BRIDGE_OUT_RGXCONFIGCUSTOMCOUNTERS *psRGXConfigCustomCountersOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevNodeInt = IMG_NULL; + IMG_UINT32 *ui32CustomCounterIDsInt = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_RGXHWPERF_RGXCONFIGCUSTOMCOUNTERS); + + + + + 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_HANDLE *) &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 RegisterRGXHWPERFFunctions(IMG_VOID); +IMG_VOID UnregisterRGXHWPERFFunctions(IMG_VOID); + +/* + * Register all RGXHWPERF functions with services + */ +PVRSRV_ERROR RegisterRGXHWPERFFunctions(IMG_VOID) +{ + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXHWPERF_RGXCTRLHWPERF, PVRSRVBridgeRGXCtrlHWPerf); + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXHWPERF_RGXCONFIGENABLEHWPERFCOUNTERS, PVRSRVBridgeRGXConfigEnableHWPerfCounters); + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXHWPERF_RGXCTRLHWPERFCOUNTERS, PVRSRVBridgeRGXCtrlHWPerfCounters); + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXHWPERF_RGXCONFIGCUSTOMCOUNTERS, PVRSRVBridgeRGXConfigCustomCounters); + + return PVRSRV_OK; +} + +/* + * Unregister all rgxhwperf functions with services + */ +IMG_VOID UnregisterRGXHWPERFFunctions(IMG_VOID) +{ +} diff --git a/drivers/gpu/rogue/generated/rgxinit_bridge/common_rgxinit_bridge.h b/drivers/gpu/rogue/generated/rgxinit_bridge/common_rgxinit_bridge.h new file mode 100644 index 000000000000..c729008e0318 --- /dev/null +++ b/drivers/gpu/rogue/generated/rgxinit_bridge/common_rgxinit_bridge.h @@ -0,0 +1,174 @@ +/*************************************************************************/ /*! +@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 "rgx_bridge.h" +#include "rgxscript.h" +#include "devicemem_typedefs.h" +#include "rgx_fwif_shared.h" +#include "rgx_fwif.h" + + +#include "pvr_bridge_io.h" + +#define PVRSRV_BRIDGE_RGXINIT_CMD_FIRST (PVRSRV_BRIDGE_RGXINIT_START) +#define PVRSRV_BRIDGE_RGXINIT_RGXINITALLOCFWIMGMEM PVRSRV_IOWR(PVRSRV_BRIDGE_RGXINIT_CMD_FIRST+0) +#define PVRSRV_BRIDGE_RGXINIT_RGXINITFIRMWARE PVRSRV_IOWR(PVRSRV_BRIDGE_RGXINIT_CMD_FIRST+1) +#define PVRSRV_BRIDGE_RGXINIT_RGXINITLOADFWIMAGE PVRSRV_IOWR(PVRSRV_BRIDGE_RGXINIT_CMD_FIRST+2) +#define PVRSRV_BRIDGE_RGXINIT_RGXINITDEVPART2 PVRSRV_IOWR(PVRSRV_BRIDGE_RGXINIT_CMD_FIRST+3) +#define PVRSRV_BRIDGE_RGXINIT_CMD_LAST (PVRSRV_BRIDGE_RGXINIT_CMD_FIRST+3) + + +/******************************************* + 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; + RGXFWIF_COMPCHECKS_BVNC sClientBVNC; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXINITFIRMWARE; + + +/* Bridge out structure for RGXInitFirmware */ +typedef struct PVRSRV_BRIDGE_OUT_RGXINITFIRMWARE_TAG +{ + RGXFWIF_DEV_VIRTADDR spsRGXFwInit; + 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; +} __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; + +#endif /* COMMON_RGXINIT_BRIDGE_H */ diff --git a/drivers/gpu/rogue/generated/rgxinit_bridge/server_rgxinit_bridge.c b/drivers/gpu/rogue/generated/rgxinit_bridge/server_rgxinit_bridge.c new file mode 100644 index 000000000000..b52586691e36 --- /dev/null +++ b/drivers/gpu/rogue/generated/rgxinit_bridge/server_rgxinit_bridge.c @@ -0,0 +1,575 @@ +/*************************************************************************/ /*! +@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 + +/* *************************************************************************** + * Bridge proxy functions + */ + + + +/* *************************************************************************** + * Server-side bridge entry points + */ + +static IMG_INT +PVRSRVBridgeRGXInitAllocFWImgMem(IMG_UINT32 ui32BridgeID, + 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; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_RGXINIT_RGXINITALLOCFWIMGMEM); + + + + + + { + /* Look up the address from the handle */ + psRGXInitAllocFWImgMemOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &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_HANDLE) psFWCodeAllocServerExportCookieInt, + PVRSRV_HANDLE_TYPE_SERVER_EXPORTCOOKIE, + PVRSRV_HANDLE_ALLOC_FLAG_NONE + ); + if (psRGXInitAllocFWImgMemOUT->eError != PVRSRV_OK) + { + goto RGXInitAllocFWImgMem_exit; + } + psRGXInitAllocFWImgMemOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psRGXInitAllocFWImgMemOUT->hFWDataAllocServerExportCookie, + (IMG_HANDLE) psFWDataAllocServerExportCookieInt, + PVRSRV_HANDLE_TYPE_SERVER_EXPORTCOOKIE, + PVRSRV_HANDLE_ALLOC_FLAG_NONE + ); + if (psRGXInitAllocFWImgMemOUT->eError != PVRSRV_OK) + { + goto RGXInitAllocFWImgMem_exit; + } + psRGXInitAllocFWImgMemOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psRGXInitAllocFWImgMemOUT->hFWCorememAllocServerExportCookie, + (IMG_HANDLE) psFWCorememAllocServerExportCookieInt, + PVRSRV_HANDLE_TYPE_SERVER_EXPORTCOOKIE, + PVRSRV_HANDLE_ALLOC_FLAG_NONE + ); + if (psRGXInitAllocFWImgMemOUT->eError != PVRSRV_OK) + { + goto RGXInitAllocFWImgMem_exit; + } + + +RGXInitAllocFWImgMem_exit: + if (psRGXInitAllocFWImgMemOUT->eError != PVRSRV_OK) + { + } + + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXInitFirmware(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_RGXINITFIRMWARE *psRGXInitFirmwareIN, + PVRSRV_BRIDGE_OUT_RGXINITFIRMWARE *psRGXInitFirmwareOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevNodeInt = IMG_NULL; + IMG_UINT32 *ui32RGXFWAlignChecksInt = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_RGXINIT_RGXINITFIRMWARE); + + + + + 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_HANDLE *) &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->sClientBVNC); + + + +RGXInitFirmware_exit: + if (ui32RGXFWAlignChecksInt) + OSFreeMem(ui32RGXFWAlignChecksInt); + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXInitLoadFWImage(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_RGXINITLOADFWIMAGE *psRGXInitLoadFWImageIN, + PVRSRV_BRIDGE_OUT_RGXINITLOADFWIMAGE *psRGXInitLoadFWImageOUT, + CONNECTION_DATA *psConnection) +{ + PMR * psImgDestImportInt = IMG_NULL; + IMG_HANDLE hImgDestImportInt2 = IMG_NULL; + PMR * psImgSrcImportInt = IMG_NULL; + IMG_HANDLE hImgSrcImportInt2 = IMG_NULL; + PMR * psSigImportInt = IMG_NULL; + IMG_HANDLE hSigImportInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_RGXINIT_RGXINITLOADFWIMAGE); + + + + + + { + /* Look up the address from the handle */ + psRGXInitLoadFWImageOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hImgDestImportInt2, + psRGXInitLoadFWImageIN->hImgDestImport, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR); + if(psRGXInitLoadFWImageOUT->eError != PVRSRV_OK) + { + goto RGXInitLoadFWImage_exit; + } + + /* Look up the data from the resman address */ + psRGXInitLoadFWImageOUT->eError = ResManFindPrivateDataByPtr(hImgDestImportInt2, (IMG_VOID **) &psImgDestImportInt); + + if(psRGXInitLoadFWImageOUT->eError != PVRSRV_OK) + { + goto RGXInitLoadFWImage_exit; + } + } + + { + /* Look up the address from the handle */ + psRGXInitLoadFWImageOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hImgSrcImportInt2, + psRGXInitLoadFWImageIN->hImgSrcImport, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR); + if(psRGXInitLoadFWImageOUT->eError != PVRSRV_OK) + { + goto RGXInitLoadFWImage_exit; + } + + /* Look up the data from the resman address */ + psRGXInitLoadFWImageOUT->eError = ResManFindPrivateDataByPtr(hImgSrcImportInt2, (IMG_VOID **) &psImgSrcImportInt); + + if(psRGXInitLoadFWImageOUT->eError != PVRSRV_OK) + { + goto RGXInitLoadFWImage_exit; + } + } + + { + /* Look up the address from the handle */ + psRGXInitLoadFWImageOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hSigImportInt2, + psRGXInitLoadFWImageIN->hSigImport, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR); + if(psRGXInitLoadFWImageOUT->eError != PVRSRV_OK) + { + goto RGXInitLoadFWImage_exit; + } + + /* Look up the data from the resman address */ + psRGXInitLoadFWImageOUT->eError = ResManFindPrivateDataByPtr(hSigImportInt2, (IMG_VOID **) &psSigImportInt); + + 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 ui32BridgeID, + 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; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_RGXINIT_RGXINITDEVPART2); + + + + + + { + 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_INIT_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_INIT_COMMANDS * sizeof(RGX_INIT_COMMAND)) + || (OSCopyFromUser(NULL, psDbgScriptInt, psRGXInitDevPart2IN->psDbgScript, + RGX_MAX_INIT_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_HANDLE *) &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_HANDLE *) &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_HANDLE *) &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_HANDLE *) &psFWCorememAllocServerExportCookieInt, + psRGXInitDevPart2IN->hFWCorememAllocServerExportCookie, + 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); + /* Exit early if bridged call fails */ + if(psRGXInitDevPart2OUT->eError != PVRSRV_OK) + { + goto RGXInitDevPart2_exit; + } + + psRGXInitDevPart2OUT->eError = + PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psRGXInitDevPart2IN->hFWCodeAllocServerExportCookie, + PVRSRV_HANDLE_TYPE_SERVER_EXPORTCOOKIE); + psRGXInitDevPart2OUT->eError = + PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psRGXInitDevPart2IN->hFWDataAllocServerExportCookie, + PVRSRV_HANDLE_TYPE_SERVER_EXPORTCOOKIE); + psRGXInitDevPart2OUT->eError = + PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psRGXInitDevPart2IN->hFWCorememAllocServerExportCookie, + PVRSRV_HANDLE_TYPE_SERVER_EXPORTCOOKIE); + + +RGXInitDevPart2_exit: + if (psInitScriptInt) + OSFreeMem(psInitScriptInt); + if (psDbgScriptInt) + OSFreeMem(psDbgScriptInt); + if (psDbgBusScriptInt) + OSFreeMem(psDbgBusScriptInt); + if (psDeinitScriptInt) + OSFreeMem(psDeinitScriptInt); + + return 0; +} + + + +/* *************************************************************************** + * Server bridge dispatch related glue + */ + +PVRSRV_ERROR RegisterRGXINITFunctions(IMG_VOID); +IMG_VOID UnregisterRGXINITFunctions(IMG_VOID); + +/* + * Register all RGXINIT functions with services + */ +PVRSRV_ERROR RegisterRGXINITFunctions(IMG_VOID) +{ + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXINIT_RGXINITALLOCFWIMGMEM, PVRSRVBridgeRGXInitAllocFWImgMem); + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXINIT_RGXINITFIRMWARE, PVRSRVBridgeRGXInitFirmware); + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXINIT_RGXINITLOADFWIMAGE, PVRSRVBridgeRGXInitLoadFWImage); + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXINIT_RGXINITDEVPART2, PVRSRVBridgeRGXInitDevPart2); + + return PVRSRV_OK; +} + +/* + * Unregister all rgxinit functions with services + */ +IMG_VOID UnregisterRGXINITFunctions(IMG_VOID) +{ +} diff --git a/drivers/gpu/rogue/generated/rgxpdump_bridge/common_rgxpdump_bridge.h b/drivers/gpu/rogue/generated/rgxpdump_bridge/common_rgxpdump_bridge.h new file mode 100644 index 000000000000..0b891ababa86 --- /dev/null +++ b/drivers/gpu/rogue/generated/rgxpdump_bridge/common_rgxpdump_bridge.h @@ -0,0 +1,95 @@ +/*************************************************************************/ /*! +@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 "rgx_bridge.h" + + +#include "pvr_bridge_io.h" + +#define PVRSRV_BRIDGE_RGXPDUMP_CMD_FIRST (PVRSRV_BRIDGE_RGXPDUMP_START) +#define PVRSRV_BRIDGE_RGXPDUMP_PDUMPTRACEBUFFER PVRSRV_IOWR(PVRSRV_BRIDGE_RGXPDUMP_CMD_FIRST+0) +#define PVRSRV_BRIDGE_RGXPDUMP_PDUMPSIGNATUREBUFFER PVRSRV_IOWR(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/generated/rgxpdump_bridge/server_rgxpdump_bridge.c b/drivers/gpu/rogue/generated/rgxpdump_bridge/server_rgxpdump_bridge.c new file mode 100644 index 000000000000..5206d891ef9a --- /dev/null +++ b/drivers/gpu/rogue/generated/rgxpdump_bridge/server_rgxpdump_bridge.c @@ -0,0 +1,183 @@ +/*************************************************************************/ /*! +@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 + +/* *************************************************************************** + * Bridge proxy functions + */ + + + +/* *************************************************************************** + * Server-side bridge entry points + */ + +static IMG_INT +PVRSRVBridgePDumpTraceBuffer(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_PDUMPTRACEBUFFER *psPDumpTraceBufferIN, + PVRSRV_BRIDGE_OUT_PDUMPTRACEBUFFER *psPDumpTraceBufferOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDeviceNodeInt = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_RGXPDUMP_PDUMPTRACEBUFFER); + + + + + + { + /* Look up the address from the handle */ + psPDumpTraceBufferOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &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 ui32BridgeID, + PVRSRV_BRIDGE_IN_PDUMPSIGNATUREBUFFER *psPDumpSignatureBufferIN, + PVRSRV_BRIDGE_OUT_PDUMPSIGNATUREBUFFER *psPDumpSignatureBufferOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDeviceNodeInt = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_RGXPDUMP_PDUMPSIGNATUREBUFFER); + + + + + + { + /* Look up the address from the handle */ + psPDumpSignatureBufferOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &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 RegisterRGXPDUMPFunctions(IMG_VOID); +IMG_VOID UnregisterRGXPDUMPFunctions(IMG_VOID); + +/* + * Register all RGXPDUMP functions with services + */ +PVRSRV_ERROR RegisterRGXPDUMPFunctions(IMG_VOID) +{ + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXPDUMP_PDUMPTRACEBUFFER, PVRSRVBridgePDumpTraceBuffer); + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXPDUMP_PDUMPSIGNATUREBUFFER, PVRSRVBridgePDumpSignatureBuffer); + + return PVRSRV_OK; +} + +/* + * Unregister all rgxpdump functions with services + */ +IMG_VOID UnregisterRGXPDUMPFunctions(IMG_VOID) +{ +} diff --git a/drivers/gpu/rogue/generated/rgxta3d_bridge/common_rgxta3d_bridge.h b/drivers/gpu/rogue/generated/rgxta3d_bridge/common_rgxta3d_bridge.h new file mode 100644 index 000000000000..03351abe23db --- /dev/null +++ b/drivers/gpu/rogue/generated/rgxta3d_bridge/common_rgxta3d_bridge.h @@ -0,0 +1,519 @@ +/*************************************************************************/ /*! +@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 "rgx_bridge.h" +#include "sync_external.h" +#include "rgx_fwif_shared.h" + + +#include "pvr_bridge_io.h" + +#define PVRSRV_BRIDGE_RGXTA3D_CMD_FIRST (PVRSRV_BRIDGE_RGXTA3D_START) +#define PVRSRV_BRIDGE_RGXTA3D_RGXCREATEHWRTDATA PVRSRV_IOWR(PVRSRV_BRIDGE_RGXTA3D_CMD_FIRST+0) +#define PVRSRV_BRIDGE_RGXTA3D_RGXDESTROYHWRTDATA PVRSRV_IOWR(PVRSRV_BRIDGE_RGXTA3D_CMD_FIRST+1) +#define PVRSRV_BRIDGE_RGXTA3D_RGXCREATERENDERTARGET PVRSRV_IOWR(PVRSRV_BRIDGE_RGXTA3D_CMD_FIRST+2) +#define PVRSRV_BRIDGE_RGXTA3D_RGXDESTROYRENDERTARGET PVRSRV_IOWR(PVRSRV_BRIDGE_RGXTA3D_CMD_FIRST+3) +#define PVRSRV_BRIDGE_RGXTA3D_RGXCREATEZSBUFFER PVRSRV_IOWR(PVRSRV_BRIDGE_RGXTA3D_CMD_FIRST+4) +#define PVRSRV_BRIDGE_RGXTA3D_RGXDESTROYZSBUFFER PVRSRV_IOWR(PVRSRV_BRIDGE_RGXTA3D_CMD_FIRST+5) +#define PVRSRV_BRIDGE_RGXTA3D_RGXPOPULATEZSBUFFER PVRSRV_IOWR(PVRSRV_BRIDGE_RGXTA3D_CMD_FIRST+6) +#define PVRSRV_BRIDGE_RGXTA3D_RGXUNPOPULATEZSBUFFER PVRSRV_IOWR(PVRSRV_BRIDGE_RGXTA3D_CMD_FIRST+7) +#define PVRSRV_BRIDGE_RGXTA3D_RGXCREATEFREELIST PVRSRV_IOWR(PVRSRV_BRIDGE_RGXTA3D_CMD_FIRST+8) +#define PVRSRV_BRIDGE_RGXTA3D_RGXDESTROYFREELIST PVRSRV_IOWR(PVRSRV_BRIDGE_RGXTA3D_CMD_FIRST+9) +#define PVRSRV_BRIDGE_RGXTA3D_RGXADDBLOCKTOFREELIST PVRSRV_IOWR(PVRSRV_BRIDGE_RGXTA3D_CMD_FIRST+10) +#define PVRSRV_BRIDGE_RGXTA3D_RGXREMOVEBLOCKFROMFREELIST PVRSRV_IOWR(PVRSRV_BRIDGE_RGXTA3D_CMD_FIRST+11) +#define PVRSRV_BRIDGE_RGXTA3D_RGXCREATERENDERCONTEXT PVRSRV_IOWR(PVRSRV_BRIDGE_RGXTA3D_CMD_FIRST+12) +#define PVRSRV_BRIDGE_RGXTA3D_RGXDESTROYRENDERCONTEXT PVRSRV_IOWR(PVRSRV_BRIDGE_RGXTA3D_CMD_FIRST+13) +#define PVRSRV_BRIDGE_RGXTA3D_RGXKICKTA3D PVRSRV_IOWR(PVRSRV_BRIDGE_RGXTA3D_CMD_FIRST+14) +#define PVRSRV_BRIDGE_RGXTA3D_RGXSETRENDERCONTEXTPRIORITY PVRSRV_IOWR(PVRSRV_BRIDGE_RGXTA3D_CMD_FIRST+15) +#define PVRSRV_BRIDGE_RGXTA3D_RGXGETLASTRENDERCONTEXTRESETREASON PVRSRV_IOWR(PVRSRV_BRIDGE_RGXTA3D_CMD_FIRST+16) +#define PVRSRV_BRIDGE_RGXTA3D_RGXGETPARTIALRENDERCOUNT PVRSRV_IOWR(PVRSRV_BRIDGE_RGXTA3D_CMD_FIRST+17) +#define PVRSRV_BRIDGE_RGXTA3D_RGXKICKSYNCTA PVRSRV_IOWR(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; + PRGXFWIF_UFO_ADDR * psClientTAFenceUFOAddress; + IMG_UINT32 * pui32ClientTAFenceValue; + IMG_UINT32 ui32ClientTAUpdateCount; + PRGXFWIF_UFO_ADDR * psClientTAUpdateUFOAddress; + IMG_UINT32 * pui32ClientTAUpdateValue; + IMG_UINT32 ui32ServerTASyncPrims; + IMG_UINT32 * pui32ServerTASyncFlags; + IMG_HANDLE * phServerTASyncs; + IMG_UINT32 ui32Client3DFenceCount; + PRGXFWIF_UFO_ADDR * psClient3DFenceUFOAddress; + IMG_UINT32 * pui32Client3DFenceValue; + IMG_UINT32 ui32Client3DUpdateCount; + PRGXFWIF_UFO_ADDR * psClient3DUpdateUFOAddress; + IMG_UINT32 * pui32Client3DUpdateValue; + IMG_UINT32 ui32Server3DSyncPrims; + IMG_UINT32 * pui32Server3DSyncFlags; + IMG_HANDLE * phServer3DSyncs; + PRGXFWIF_UFO_ADDR sPRFenceUFOAddress; + IMG_UINT32 ui32FRFenceValue; + IMG_UINT32 ui32NumFenceFds; + IMG_INT32 * pi32FenceFds; + 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; + PRGXFWIF_UFO_ADDR * psClientTAFenceUFOAddress; + IMG_UINT32 * pui32ClientTAFenceValue; + IMG_UINT32 ui32ClientTAUpdateCount; + PRGXFWIF_UFO_ADDR * psClientTAUpdateUFOAddress; + IMG_UINT32 * pui32ClientTAUpdateValue; + IMG_UINT32 ui32ServerTASyncPrims; + IMG_UINT32 * pui32ServerTASyncFlags; + IMG_HANDLE * phServerTASyncs; + IMG_UINT32 ui32Client3DFenceCount; + PRGXFWIF_UFO_ADDR * psClient3DFenceUFOAddress; + IMG_UINT32 * pui32Client3DFenceValue; + IMG_UINT32 ui32Client3DUpdateCount; + PRGXFWIF_UFO_ADDR * psClient3DUpdateUFOAddress; + IMG_UINT32 * pui32Client3DUpdateValue; + IMG_UINT32 ui32Server3DSyncPrims; + IMG_UINT32 * pui32Server3DSyncFlags; + IMG_HANDLE * phServer3DSyncs; + IMG_UINT32 ui32NumFenceFDs; + IMG_INT32 * pi32FenceFDs; + 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/generated/rgxta3d_bridge/server_rgxta3d_bridge.c b/drivers/gpu/rogue/generated/rgxta3d_bridge/server_rgxta3d_bridge.c new file mode 100644 index 000000000000..18fbd589bdc4 --- /dev/null +++ b/drivers/gpu/rogue/generated/rgxta3d_bridge/server_rgxta3d_bridge.c @@ -0,0 +1,2502 @@ +/*************************************************************************/ /*! +@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 + +/* *************************************************************************** + * Bridge proxy functions + */ + +static PVRSRV_ERROR +RGXDestroyHWRTDataResManProxy(IMG_HANDLE hResmanItem) +{ + PVRSRV_ERROR eError; + + eError = ResManFreeResByPtr(hResmanItem); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + + return eError; +} + +static PVRSRV_ERROR +RGXDestroyRenderTargetResManProxy(IMG_HANDLE hResmanItem) +{ + PVRSRV_ERROR eError; + + eError = ResManFreeResByPtr(hResmanItem); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + + return eError; +} + +static PVRSRV_ERROR +RGXDestroyZSBufferResManProxy(IMG_HANDLE hResmanItem) +{ + PVRSRV_ERROR eError; + + eError = ResManFreeResByPtr(hResmanItem); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + + return eError; +} + +static PVRSRV_ERROR +RGXUnpopulateZSBufferResManProxy(IMG_HANDLE hResmanItem) +{ + PVRSRV_ERROR eError; + + eError = ResManFreeResByPtr(hResmanItem); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + + return eError; +} + +static PVRSRV_ERROR +RGXDestroyFreeListResManProxy(IMG_HANDLE hResmanItem) +{ + PVRSRV_ERROR eError; + + eError = ResManFreeResByPtr(hResmanItem); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + + return eError; +} + +static PVRSRV_ERROR +RGXDestroyRenderContextResManProxy(IMG_HANDLE hResmanItem) +{ + PVRSRV_ERROR eError; + + eError = ResManFreeResByPtr(hResmanItem); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + + return eError; +} + + + +/* *************************************************************************** + * Server-side bridge entry points + */ + +static IMG_INT +PVRSRVBridgeRGXCreateHWRTData(IMG_UINT32 ui32BridgeID, + 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; + IMG_HANDLE hCleanupCookieInt2 = IMG_NULL; + DEVMEM_MEMDESC * psRTACtlMemDescInt = IMG_NULL; + DEVMEM_MEMDESC * pssHWRTDataMemDescInt = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_RGXTA3D_RGXCREATEHWRTDATA); + + + + 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_HANDLE *) &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_HANDLE *) &hapsFreeListsInt2[i], + hapsFreeListsInt2[i], + PVRSRV_HANDLE_TYPE_RGX_FREELIST); + if(psRGXCreateHWRTDataOUT->eError != PVRSRV_OK) + { + goto RGXCreateHWRTData_exit; + } + + /* Look up the data from the resman address */ + psRGXCreateHWRTDataOUT->eError = ResManFindPrivateDataByPtr(hapsFreeListsInt2[i], (IMG_VOID **) &psapsFreeListsInt[i]); + + 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; + } + + /* Create a resman item and overwrite the handle with it */ + hCleanupCookieInt2 = ResManRegisterRes(psConnection->hResManContext, + RESMAN_TYPE_RGX_FWIF_HWRTDATA, + psCleanupCookieInt, + (RESMAN_FREE_FN)&RGXDestroyHWRTData); + if (hCleanupCookieInt2 == IMG_NULL) + { + psRGXCreateHWRTDataOUT->eError = PVRSRV_ERROR_UNABLE_TO_REGISTER_RESOURCE; + goto RGXCreateHWRTData_exit; + } + psRGXCreateHWRTDataOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psRGXCreateHWRTDataOUT->hCleanupCookie, + (IMG_HANDLE) hCleanupCookieInt2, + PVRSRV_HANDLE_TYPE_RGX_RTDATA_CLEANUP, + PVRSRV_HANDLE_ALLOC_FLAG_NONE + ); + if (psRGXCreateHWRTDataOUT->eError != PVRSRV_OK) + { + goto RGXCreateHWRTData_exit; + } + psRGXCreateHWRTDataOUT->eError = PVRSRVAllocSubHandle(psConnection->psHandleBase, + &psRGXCreateHWRTDataOUT->hRTACtlMemDesc, + (IMG_HANDLE) 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_HANDLE) 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) + { + PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psRGXCreateHWRTDataOUT->hCleanupCookie, + PVRSRV_HANDLE_TYPE_RGX_RTDATA_CLEANUP); + } + + /* If we have a valid resman item we should undo the bridge function by freeing the resman item */ + if (hCleanupCookieInt2) + { + PVRSRV_ERROR eError = ResManFreeResByPtr(hCleanupCookieInt2); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + } + else if (psCleanupCookieInt) + { + RGXDestroyHWRTData(psCleanupCookieInt); + } + } + + if (psapsFreeListsInt) + OSFreeMem(psapsFreeListsInt); + if (hapsFreeListsInt2) + OSFreeMem(hapsFreeListsInt2); + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXDestroyHWRTData(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_RGXDESTROYHWRTDATA *psRGXDestroyHWRTDataIN, + PVRSRV_BRIDGE_OUT_RGXDESTROYHWRTDATA *psRGXDestroyHWRTDataOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hCleanupCookieInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_RGXTA3D_RGXDESTROYHWRTDATA); + + + + + + { + /* Look up the address from the handle */ + psRGXDestroyHWRTDataOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hCleanupCookieInt2, + psRGXDestroyHWRTDataIN->hCleanupCookie, + PVRSRV_HANDLE_TYPE_RGX_RTDATA_CLEANUP); + if(psRGXDestroyHWRTDataOUT->eError != PVRSRV_OK) + { + goto RGXDestroyHWRTData_exit; + } + + } + + psRGXDestroyHWRTDataOUT->eError = RGXDestroyHWRTDataResManProxy(hCleanupCookieInt2); + /* Exit early if bridged call fails */ + if(psRGXDestroyHWRTDataOUT->eError != PVRSRV_OK) + { + goto RGXDestroyHWRTData_exit; + } + + psRGXDestroyHWRTDataOUT->eError = + PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psRGXDestroyHWRTDataIN->hCleanupCookie, + PVRSRV_HANDLE_TYPE_RGX_RTDATA_CLEANUP); + + +RGXDestroyHWRTData_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXCreateRenderTarget(IMG_UINT32 ui32BridgeID, + 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; + IMG_HANDLE hsRenderTargetMemDescInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_RGXTA3D_RGXCREATERENDERTARGET); + + + + + + { + /* Look up the address from the handle */ + psRGXCreateRenderTargetOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &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; + } + + /* Create a resman item and overwrite the handle with it */ + hsRenderTargetMemDescInt2 = ResManRegisterRes(psConnection->hResManContext, + RESMAN_TYPE_RGX_FWIF_RENDERTARGET, + pssRenderTargetMemDescInt, + (RESMAN_FREE_FN)&RGXDestroyRenderTarget); + if (hsRenderTargetMemDescInt2 == IMG_NULL) + { + psRGXCreateRenderTargetOUT->eError = PVRSRV_ERROR_UNABLE_TO_REGISTER_RESOURCE; + goto RGXCreateRenderTarget_exit; + } + psRGXCreateRenderTargetOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psRGXCreateRenderTargetOUT->hsRenderTargetMemDesc, + (IMG_HANDLE) hsRenderTargetMemDescInt2, + PVRSRV_HANDLE_TYPE_RGX_FWIF_RENDERTARGET, + PVRSRV_HANDLE_ALLOC_FLAG_NONE + ); + if (psRGXCreateRenderTargetOUT->eError != PVRSRV_OK) + { + goto RGXCreateRenderTarget_exit; + } + + +RGXCreateRenderTarget_exit: + if (psRGXCreateRenderTargetOUT->eError != PVRSRV_OK) + { + /* If we have a valid resman item we should undo the bridge function by freeing the resman item */ + if (hsRenderTargetMemDescInt2) + { + PVRSRV_ERROR eError = ResManFreeResByPtr(hsRenderTargetMemDescInt2); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + } + else if (pssRenderTargetMemDescInt) + { + RGXDestroyRenderTarget(pssRenderTargetMemDescInt); + } + } + + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXDestroyRenderTarget(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_RGXDESTROYRENDERTARGET *psRGXDestroyRenderTargetIN, + PVRSRV_BRIDGE_OUT_RGXDESTROYRENDERTARGET *psRGXDestroyRenderTargetOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hsRenderTargetMemDescInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_RGXTA3D_RGXDESTROYRENDERTARGET); + + + + + + { + /* Look up the address from the handle */ + psRGXDestroyRenderTargetOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hsRenderTargetMemDescInt2, + psRGXDestroyRenderTargetIN->hsRenderTargetMemDesc, + PVRSRV_HANDLE_TYPE_RGX_FWIF_RENDERTARGET); + if(psRGXDestroyRenderTargetOUT->eError != PVRSRV_OK) + { + goto RGXDestroyRenderTarget_exit; + } + + } + + psRGXDestroyRenderTargetOUT->eError = RGXDestroyRenderTargetResManProxy(hsRenderTargetMemDescInt2); + /* Exit early if bridged call fails */ + if(psRGXDestroyRenderTargetOUT->eError != PVRSRV_OK) + { + goto RGXDestroyRenderTarget_exit; + } + + psRGXDestroyRenderTargetOUT->eError = + PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psRGXDestroyRenderTargetIN->hsRenderTargetMemDesc, + PVRSRV_HANDLE_TYPE_RGX_FWIF_RENDERTARGET); + + +RGXDestroyRenderTarget_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXCreateZSBuffer(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_RGXCREATEZSBUFFER *psRGXCreateZSBufferIN, + PVRSRV_BRIDGE_OUT_RGXCREATEZSBUFFER *psRGXCreateZSBufferOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevNodeInt = IMG_NULL; + DEVMEMINT_RESERVATION * psReservationInt = IMG_NULL; + IMG_HANDLE hReservationInt2 = IMG_NULL; + PMR * psPMRInt = IMG_NULL; + IMG_HANDLE hPMRInt2 = IMG_NULL; + RGX_ZSBUFFER_DATA * pssZSBufferKMInt = IMG_NULL; + IMG_HANDLE hsZSBufferKMInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_RGXTA3D_RGXCREATEZSBUFFER); + + + + + + { + /* Look up the address from the handle */ + psRGXCreateZSBufferOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &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_HANDLE *) &hReservationInt2, + psRGXCreateZSBufferIN->hReservation, + PVRSRV_HANDLE_TYPE_DEVMEMINT_RESERVATION); + if(psRGXCreateZSBufferOUT->eError != PVRSRV_OK) + { + goto RGXCreateZSBuffer_exit; + } + + /* Look up the data from the resman address */ + psRGXCreateZSBufferOUT->eError = ResManFindPrivateDataByPtr(hReservationInt2, (IMG_VOID **) &psReservationInt); + + if(psRGXCreateZSBufferOUT->eError != PVRSRV_OK) + { + goto RGXCreateZSBuffer_exit; + } + } + + { + /* Look up the address from the handle */ + psRGXCreateZSBufferOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hPMRInt2, + psRGXCreateZSBufferIN->hPMR, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR); + if(psRGXCreateZSBufferOUT->eError != PVRSRV_OK) + { + goto RGXCreateZSBuffer_exit; + } + + /* Look up the data from the resman address */ + psRGXCreateZSBufferOUT->eError = ResManFindPrivateDataByPtr(hPMRInt2, (IMG_VOID **) &psPMRInt); + + 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; + } + + /* Create a resman item and overwrite the handle with it */ + hsZSBufferKMInt2 = ResManRegisterRes(psConnection->hResManContext, + RESMAN_TYPE_RGX_FWIF_ZSBUFFER, + pssZSBufferKMInt, + (RESMAN_FREE_FN)&RGXDestroyZSBufferKM); + if (hsZSBufferKMInt2 == IMG_NULL) + { + psRGXCreateZSBufferOUT->eError = PVRSRV_ERROR_UNABLE_TO_REGISTER_RESOURCE; + goto RGXCreateZSBuffer_exit; + } + psRGXCreateZSBufferOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psRGXCreateZSBufferOUT->hsZSBufferKM, + (IMG_HANDLE) hsZSBufferKMInt2, + PVRSRV_HANDLE_TYPE_RGX_FWIF_ZSBUFFER, + PVRSRV_HANDLE_ALLOC_FLAG_NONE + ); + if (psRGXCreateZSBufferOUT->eError != PVRSRV_OK) + { + goto RGXCreateZSBuffer_exit; + } + + +RGXCreateZSBuffer_exit: + if (psRGXCreateZSBufferOUT->eError != PVRSRV_OK) + { + /* If we have a valid resman item we should undo the bridge function by freeing the resman item */ + if (hsZSBufferKMInt2) + { + PVRSRV_ERROR eError = ResManFreeResByPtr(hsZSBufferKMInt2); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + } + else if (pssZSBufferKMInt) + { + RGXDestroyZSBufferKM(pssZSBufferKMInt); + } + } + + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXDestroyZSBuffer(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_RGXDESTROYZSBUFFER *psRGXDestroyZSBufferIN, + PVRSRV_BRIDGE_OUT_RGXDESTROYZSBUFFER *psRGXDestroyZSBufferOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hsZSBufferMemDescInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_RGXTA3D_RGXDESTROYZSBUFFER); + + + + + + { + /* Look up the address from the handle */ + psRGXDestroyZSBufferOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hsZSBufferMemDescInt2, + psRGXDestroyZSBufferIN->hsZSBufferMemDesc, + PVRSRV_HANDLE_TYPE_RGX_FWIF_ZSBUFFER); + if(psRGXDestroyZSBufferOUT->eError != PVRSRV_OK) + { + goto RGXDestroyZSBuffer_exit; + } + + } + + psRGXDestroyZSBufferOUT->eError = RGXDestroyZSBufferResManProxy(hsZSBufferMemDescInt2); + /* Exit early if bridged call fails */ + if(psRGXDestroyZSBufferOUT->eError != PVRSRV_OK) + { + goto RGXDestroyZSBuffer_exit; + } + + psRGXDestroyZSBufferOUT->eError = + PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psRGXDestroyZSBufferIN->hsZSBufferMemDesc, + PVRSRV_HANDLE_TYPE_RGX_FWIF_ZSBUFFER); + + +RGXDestroyZSBuffer_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXPopulateZSBuffer(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_RGXPOPULATEZSBUFFER *psRGXPopulateZSBufferIN, + PVRSRV_BRIDGE_OUT_RGXPOPULATEZSBUFFER *psRGXPopulateZSBufferOUT, + CONNECTION_DATA *psConnection) +{ + RGX_ZSBUFFER_DATA * pssZSBufferKMInt = IMG_NULL; + IMG_HANDLE hsZSBufferKMInt2 = IMG_NULL; + RGX_POPULATION * pssPopulationInt = IMG_NULL; + IMG_HANDLE hsPopulationInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_RGXTA3D_RGXPOPULATEZSBUFFER); + + + + + + { + /* Look up the address from the handle */ + psRGXPopulateZSBufferOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hsZSBufferKMInt2, + psRGXPopulateZSBufferIN->hsZSBufferKM, + PVRSRV_HANDLE_TYPE_RGX_FWIF_ZSBUFFER); + if(psRGXPopulateZSBufferOUT->eError != PVRSRV_OK) + { + goto RGXPopulateZSBuffer_exit; + } + + /* Look up the data from the resman address */ + psRGXPopulateZSBufferOUT->eError = ResManFindPrivateDataByPtr(hsZSBufferKMInt2, (IMG_VOID **) &pssZSBufferKMInt); + + 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; + } + + /* Create a resman item and overwrite the handle with it */ + hsPopulationInt2 = ResManRegisterRes(psConnection->hResManContext, + RESMAN_TYPE_RGX_POPULATION, + pssPopulationInt, + (RESMAN_FREE_FN)&RGXUnpopulateZSBufferKM); + if (hsPopulationInt2 == IMG_NULL) + { + psRGXPopulateZSBufferOUT->eError = PVRSRV_ERROR_UNABLE_TO_REGISTER_RESOURCE; + goto RGXPopulateZSBuffer_exit; + } + psRGXPopulateZSBufferOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psRGXPopulateZSBufferOUT->hsPopulation, + (IMG_HANDLE) hsPopulationInt2, + PVRSRV_HANDLE_TYPE_RGX_POPULATION, + PVRSRV_HANDLE_ALLOC_FLAG_NONE + ); + if (psRGXPopulateZSBufferOUT->eError != PVRSRV_OK) + { + goto RGXPopulateZSBuffer_exit; + } + + +RGXPopulateZSBuffer_exit: + if (psRGXPopulateZSBufferOUT->eError != PVRSRV_OK) + { + /* If we have a valid resman item we should undo the bridge function by freeing the resman item */ + if (hsPopulationInt2) + { + PVRSRV_ERROR eError = ResManFreeResByPtr(hsPopulationInt2); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + } + else if (pssPopulationInt) + { + RGXUnpopulateZSBufferKM(pssPopulationInt); + } + } + + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXUnpopulateZSBuffer(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_RGXUNPOPULATEZSBUFFER *psRGXUnpopulateZSBufferIN, + PVRSRV_BRIDGE_OUT_RGXUNPOPULATEZSBUFFER *psRGXUnpopulateZSBufferOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hsPopulationInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_RGXTA3D_RGXUNPOPULATEZSBUFFER); + + + + + + { + /* Look up the address from the handle */ + psRGXUnpopulateZSBufferOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hsPopulationInt2, + psRGXUnpopulateZSBufferIN->hsPopulation, + PVRSRV_HANDLE_TYPE_RGX_POPULATION); + if(psRGXUnpopulateZSBufferOUT->eError != PVRSRV_OK) + { + goto RGXUnpopulateZSBuffer_exit; + } + + } + + psRGXUnpopulateZSBufferOUT->eError = RGXUnpopulateZSBufferResManProxy(hsPopulationInt2); + /* Exit early if bridged call fails */ + if(psRGXUnpopulateZSBufferOUT->eError != PVRSRV_OK) + { + goto RGXUnpopulateZSBuffer_exit; + } + + psRGXUnpopulateZSBufferOUT->eError = + PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psRGXUnpopulateZSBufferIN->hsPopulation, + PVRSRV_HANDLE_TYPE_RGX_POPULATION); + + +RGXUnpopulateZSBuffer_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXCreateFreeList(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_RGXCREATEFREELIST *psRGXCreateFreeListIN, + PVRSRV_BRIDGE_OUT_RGXCREATEFREELIST *psRGXCreateFreeListOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevNodeInt = IMG_NULL; + PMR * pssFreeListPMRInt = IMG_NULL; + IMG_HANDLE hsFreeListPMRInt2 = IMG_NULL; + RGX_FREELIST * psCleanupCookieInt = IMG_NULL; + IMG_HANDLE hCleanupCookieInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_RGXTA3D_RGXCREATEFREELIST); + + + + + + { + /* Look up the address from the handle */ + psRGXCreateFreeListOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &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_HANDLE *) &hsFreeListPMRInt2, + psRGXCreateFreeListIN->hsFreeListPMR, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR); + if(psRGXCreateFreeListOUT->eError != PVRSRV_OK) + { + goto RGXCreateFreeList_exit; + } + + /* Look up the data from the resman address */ + psRGXCreateFreeListOUT->eError = ResManFindPrivateDataByPtr(hsFreeListPMRInt2, (IMG_VOID **) &pssFreeListPMRInt); + + 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; + } + + /* Create a resman item and overwrite the handle with it */ + hCleanupCookieInt2 = ResManRegisterRes(psConnection->hResManContext, + RESMAN_TYPE_RGX_FWIF_FREELIST, + psCleanupCookieInt, + (RESMAN_FREE_FN)&RGXDestroyFreeList); + if (hCleanupCookieInt2 == IMG_NULL) + { + psRGXCreateFreeListOUT->eError = PVRSRV_ERROR_UNABLE_TO_REGISTER_RESOURCE; + goto RGXCreateFreeList_exit; + } + psRGXCreateFreeListOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psRGXCreateFreeListOUT->hCleanupCookie, + (IMG_HANDLE) hCleanupCookieInt2, + PVRSRV_HANDLE_TYPE_RGX_FREELIST, + PVRSRV_HANDLE_ALLOC_FLAG_NONE + ); + if (psRGXCreateFreeListOUT->eError != PVRSRV_OK) + { + goto RGXCreateFreeList_exit; + } + + +RGXCreateFreeList_exit: + if (psRGXCreateFreeListOUT->eError != PVRSRV_OK) + { + /* If we have a valid resman item we should undo the bridge function by freeing the resman item */ + if (hCleanupCookieInt2) + { + PVRSRV_ERROR eError = ResManFreeResByPtr(hCleanupCookieInt2); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + } + else if (psCleanupCookieInt) + { + RGXDestroyFreeList(psCleanupCookieInt); + } + } + + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXDestroyFreeList(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_RGXDESTROYFREELIST *psRGXDestroyFreeListIN, + PVRSRV_BRIDGE_OUT_RGXDESTROYFREELIST *psRGXDestroyFreeListOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hCleanupCookieInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_RGXTA3D_RGXDESTROYFREELIST); + + + + + + { + /* Look up the address from the handle */ + psRGXDestroyFreeListOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hCleanupCookieInt2, + psRGXDestroyFreeListIN->hCleanupCookie, + PVRSRV_HANDLE_TYPE_RGX_FREELIST); + if(psRGXDestroyFreeListOUT->eError != PVRSRV_OK) + { + goto RGXDestroyFreeList_exit; + } + + } + + psRGXDestroyFreeListOUT->eError = RGXDestroyFreeListResManProxy(hCleanupCookieInt2); + /* Exit early if bridged call fails */ + if(psRGXDestroyFreeListOUT->eError != PVRSRV_OK) + { + goto RGXDestroyFreeList_exit; + } + + psRGXDestroyFreeListOUT->eError = + PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psRGXDestroyFreeListIN->hCleanupCookie, + PVRSRV_HANDLE_TYPE_RGX_FREELIST); + + +RGXDestroyFreeList_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXAddBlockToFreeList(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_RGXADDBLOCKTOFREELIST *psRGXAddBlockToFreeListIN, + PVRSRV_BRIDGE_OUT_RGXADDBLOCKTOFREELIST *psRGXAddBlockToFreeListOUT, + CONNECTION_DATA *psConnection) +{ + RGX_FREELIST * pssFreeListInt = IMG_NULL; + IMG_HANDLE hsFreeListInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_RGXTA3D_RGXADDBLOCKTOFREELIST); + + + + + + { + /* Look up the address from the handle */ + psRGXAddBlockToFreeListOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hsFreeListInt2, + psRGXAddBlockToFreeListIN->hsFreeList, + PVRSRV_HANDLE_TYPE_RGX_FREELIST); + if(psRGXAddBlockToFreeListOUT->eError != PVRSRV_OK) + { + goto RGXAddBlockToFreeList_exit; + } + + /* Look up the data from the resman address */ + psRGXAddBlockToFreeListOUT->eError = ResManFindPrivateDataByPtr(hsFreeListInt2, (IMG_VOID **) &pssFreeListInt); + + if(psRGXAddBlockToFreeListOUT->eError != PVRSRV_OK) + { + goto RGXAddBlockToFreeList_exit; + } + } + + psRGXAddBlockToFreeListOUT->eError = + RGXAddBlockToFreeListKM( + pssFreeListInt, + psRGXAddBlockToFreeListIN->ui3232NumPages); + + + +RGXAddBlockToFreeList_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXRemoveBlockFromFreeList(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_RGXREMOVEBLOCKFROMFREELIST *psRGXRemoveBlockFromFreeListIN, + PVRSRV_BRIDGE_OUT_RGXREMOVEBLOCKFROMFREELIST *psRGXRemoveBlockFromFreeListOUT, + CONNECTION_DATA *psConnection) +{ + RGX_FREELIST * pssFreeListInt = IMG_NULL; + IMG_HANDLE hsFreeListInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_RGXTA3D_RGXREMOVEBLOCKFROMFREELIST); + + + + + + { + /* Look up the address from the handle */ + psRGXRemoveBlockFromFreeListOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hsFreeListInt2, + psRGXRemoveBlockFromFreeListIN->hsFreeList, + PVRSRV_HANDLE_TYPE_RGX_FREELIST); + if(psRGXRemoveBlockFromFreeListOUT->eError != PVRSRV_OK) + { + goto RGXRemoveBlockFromFreeList_exit; + } + + /* Look up the data from the resman address */ + psRGXRemoveBlockFromFreeListOUT->eError = ResManFindPrivateDataByPtr(hsFreeListInt2, (IMG_VOID **) &pssFreeListInt); + + if(psRGXRemoveBlockFromFreeListOUT->eError != PVRSRV_OK) + { + goto RGXRemoveBlockFromFreeList_exit; + } + } + + psRGXRemoveBlockFromFreeListOUT->eError = + RGXRemoveBlockFromFreeListKM( + pssFreeListInt); + + + +RGXRemoveBlockFromFreeList_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXCreateRenderContext(IMG_UINT32 ui32BridgeID, + 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; + IMG_HANDLE hRenderContextInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_RGXTA3D_RGXCREATERENDERCONTEXT); + + + + + 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_HANDLE *) &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_HANDLE *) &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; + } + + /* Create a resman item and overwrite the handle with it */ + hRenderContextInt2 = ResManRegisterRes(psConnection->hResManContext, + RESMAN_TYPE_RGX_SERVER_RENDER_CONTEXT, + psRenderContextInt, + (RESMAN_FREE_FN)&PVRSRVRGXDestroyRenderContextKM); + if (hRenderContextInt2 == IMG_NULL) + { + psRGXCreateRenderContextOUT->eError = PVRSRV_ERROR_UNABLE_TO_REGISTER_RESOURCE; + goto RGXCreateRenderContext_exit; + } + psRGXCreateRenderContextOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psRGXCreateRenderContextOUT->hRenderContext, + (IMG_HANDLE) hRenderContextInt2, + PVRSRV_HANDLE_TYPE_RGX_SERVER_RENDER_CONTEXT, + PVRSRV_HANDLE_ALLOC_FLAG_NONE + ); + if (psRGXCreateRenderContextOUT->eError != PVRSRV_OK) + { + goto RGXCreateRenderContext_exit; + } + + +RGXCreateRenderContext_exit: + if (psRGXCreateRenderContextOUT->eError != PVRSRV_OK) + { + /* If we have a valid resman item we should undo the bridge function by freeing the resman item */ + if (hRenderContextInt2) + { + PVRSRV_ERROR eError = ResManFreeResByPtr(hRenderContextInt2); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + } + else if (psRenderContextInt) + { + PVRSRVRGXDestroyRenderContextKM(psRenderContextInt); + } + } + + if (psFrameworkCmdInt) + OSFreeMem(psFrameworkCmdInt); + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXDestroyRenderContext(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_RGXDESTROYRENDERCONTEXT *psRGXDestroyRenderContextIN, + PVRSRV_BRIDGE_OUT_RGXDESTROYRENDERCONTEXT *psRGXDestroyRenderContextOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hCleanupCookieInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_RGXTA3D_RGXDESTROYRENDERCONTEXT); + + + + + + { + /* Look up the address from the handle */ + psRGXDestroyRenderContextOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hCleanupCookieInt2, + psRGXDestroyRenderContextIN->hCleanupCookie, + PVRSRV_HANDLE_TYPE_RGX_SERVER_RENDER_CONTEXT); + if(psRGXDestroyRenderContextOUT->eError != PVRSRV_OK) + { + goto RGXDestroyRenderContext_exit; + } + + } + + psRGXDestroyRenderContextOUT->eError = RGXDestroyRenderContextResManProxy(hCleanupCookieInt2); + /* Exit early if bridged call fails */ + if(psRGXDestroyRenderContextOUT->eError != PVRSRV_OK) + { + goto RGXDestroyRenderContext_exit; + } + + psRGXDestroyRenderContextOUT->eError = + PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psRGXDestroyRenderContextIN->hCleanupCookie, + PVRSRV_HANDLE_TYPE_RGX_SERVER_RENDER_CONTEXT); + + +RGXDestroyRenderContext_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXKickTA3D(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_RGXKICKTA3D *psRGXKickTA3DIN, + PVRSRV_BRIDGE_OUT_RGXKICKTA3D *psRGXKickTA3DOUT, + CONNECTION_DATA *psConnection) +{ + RGX_SERVER_RENDER_CONTEXT * psRenderContextInt = IMG_NULL; + IMG_HANDLE hRenderContextInt2 = IMG_NULL; + PRGXFWIF_UFO_ADDR *sClientTAFenceUFOAddressInt = IMG_NULL; + IMG_UINT32 *ui32ClientTAFenceValueInt = IMG_NULL; + PRGXFWIF_UFO_ADDR *sClientTAUpdateUFOAddressInt = IMG_NULL; + IMG_UINT32 *ui32ClientTAUpdateValueInt = IMG_NULL; + IMG_UINT32 *ui32ServerTASyncFlagsInt = IMG_NULL; + SERVER_SYNC_PRIMITIVE * *psServerTASyncsInt = IMG_NULL; + IMG_HANDLE *hServerTASyncsInt2 = IMG_NULL; + PRGXFWIF_UFO_ADDR *sClient3DFenceUFOAddressInt = IMG_NULL; + IMG_UINT32 *ui32Client3DFenceValueInt = IMG_NULL; + PRGXFWIF_UFO_ADDR *sClient3DUpdateUFOAddressInt = 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 *i32FenceFdsInt = IMG_NULL; + IMG_BYTE *psTACmdInt = IMG_NULL; + IMG_BYTE *ps3DPRCmdInt = IMG_NULL; + IMG_BYTE *ps3DCmdInt = IMG_NULL; + RGX_RTDATA_CLEANUP_DATA * psRTDataCleanupInt = IMG_NULL; + IMG_HANDLE hRTDataCleanupInt2 = IMG_NULL; + RGX_ZSBUFFER_DATA * psZBufferInt = IMG_NULL; + IMG_HANDLE hZBufferInt2 = IMG_NULL; + RGX_ZSBUFFER_DATA * psSBufferInt = IMG_NULL; + IMG_HANDLE hSBufferInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_RGXTA3D_RGXKICKTA3D); + + + + + if (psRGXKickTA3DIN->ui32ClientTAFenceCount != 0) + { + sClientTAFenceUFOAddressInt = OSAllocMem(psRGXKickTA3DIN->ui32ClientTAFenceCount * sizeof(PRGXFWIF_UFO_ADDR)); + if (!sClientTAFenceUFOAddressInt) + { + psRGXKickTA3DOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickTA3D_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickTA3DIN->psClientTAFenceUFOAddress, psRGXKickTA3DIN->ui32ClientTAFenceCount * sizeof(PRGXFWIF_UFO_ADDR)) + || (OSCopyFromUser(NULL, sClientTAFenceUFOAddressInt, psRGXKickTA3DIN->psClientTAFenceUFOAddress, + psRGXKickTA3DIN->ui32ClientTAFenceCount * sizeof(PRGXFWIF_UFO_ADDR)) != 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) + { + sClientTAUpdateUFOAddressInt = OSAllocMem(psRGXKickTA3DIN->ui32ClientTAUpdateCount * sizeof(PRGXFWIF_UFO_ADDR)); + if (!sClientTAUpdateUFOAddressInt) + { + psRGXKickTA3DOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickTA3D_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickTA3DIN->psClientTAUpdateUFOAddress, psRGXKickTA3DIN->ui32ClientTAUpdateCount * sizeof(PRGXFWIF_UFO_ADDR)) + || (OSCopyFromUser(NULL, sClientTAUpdateUFOAddressInt, psRGXKickTA3DIN->psClientTAUpdateUFOAddress, + psRGXKickTA3DIN->ui32ClientTAUpdateCount * sizeof(PRGXFWIF_UFO_ADDR)) != 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) + { + sClient3DFenceUFOAddressInt = OSAllocMem(psRGXKickTA3DIN->ui32Client3DFenceCount * sizeof(PRGXFWIF_UFO_ADDR)); + if (!sClient3DFenceUFOAddressInt) + { + psRGXKickTA3DOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickTA3D_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickTA3DIN->psClient3DFenceUFOAddress, psRGXKickTA3DIN->ui32Client3DFenceCount * sizeof(PRGXFWIF_UFO_ADDR)) + || (OSCopyFromUser(NULL, sClient3DFenceUFOAddressInt, psRGXKickTA3DIN->psClient3DFenceUFOAddress, + psRGXKickTA3DIN->ui32Client3DFenceCount * sizeof(PRGXFWIF_UFO_ADDR)) != 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) + { + sClient3DUpdateUFOAddressInt = OSAllocMem(psRGXKickTA3DIN->ui32Client3DUpdateCount * sizeof(PRGXFWIF_UFO_ADDR)); + if (!sClient3DUpdateUFOAddressInt) + { + psRGXKickTA3DOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickTA3D_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickTA3DIN->psClient3DUpdateUFOAddress, psRGXKickTA3DIN->ui32Client3DUpdateCount * sizeof(PRGXFWIF_UFO_ADDR)) + || (OSCopyFromUser(NULL, sClient3DUpdateUFOAddressInt, psRGXKickTA3DIN->psClient3DUpdateUFOAddress, + psRGXKickTA3DIN->ui32Client3DUpdateCount * sizeof(PRGXFWIF_UFO_ADDR)) != 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->ui32NumFenceFds != 0) + { + i32FenceFdsInt = OSAllocMem(psRGXKickTA3DIN->ui32NumFenceFds * sizeof(IMG_INT32)); + if (!i32FenceFdsInt) + { + psRGXKickTA3DOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickTA3D_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickTA3DIN->pi32FenceFds, psRGXKickTA3DIN->ui32NumFenceFds * sizeof(IMG_INT32)) + || (OSCopyFromUser(NULL, i32FenceFdsInt, psRGXKickTA3DIN->pi32FenceFds, + psRGXKickTA3DIN->ui32NumFenceFds * 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_HANDLE *) &hRenderContextInt2, + psRGXKickTA3DIN->hRenderContext, + PVRSRV_HANDLE_TYPE_RGX_SERVER_RENDER_CONTEXT); + if(psRGXKickTA3DOUT->eError != PVRSRV_OK) + { + goto RGXKickTA3D_exit; + } + + /* Look up the data from the resman address */ + psRGXKickTA3DOUT->eError = ResManFindPrivateDataByPtr(hRenderContextInt2, (IMG_VOID **) &psRenderContextInt); + + 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_HANDLE *) &hServerTASyncsInt2[i], + hServerTASyncsInt2[i], + PVRSRV_HANDLE_TYPE_SERVER_SYNC_PRIMITIVE); + if(psRGXKickTA3DOUT->eError != PVRSRV_OK) + { + goto RGXKickTA3D_exit; + } + + /* Look up the data from the resman address */ + psRGXKickTA3DOUT->eError = ResManFindPrivateDataByPtr(hServerTASyncsInt2[i], (IMG_VOID **) &psServerTASyncsInt[i]); + + 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_HANDLE *) &hServer3DSyncsInt2[i], + hServer3DSyncsInt2[i], + PVRSRV_HANDLE_TYPE_SERVER_SYNC_PRIMITIVE); + if(psRGXKickTA3DOUT->eError != PVRSRV_OK) + { + goto RGXKickTA3D_exit; + } + + /* Look up the data from the resman address */ + psRGXKickTA3DOUT->eError = ResManFindPrivateDataByPtr(hServer3DSyncsInt2[i], (IMG_VOID **) &psServer3DSyncsInt[i]); + + if(psRGXKickTA3DOUT->eError != PVRSRV_OK) + { + goto RGXKickTA3D_exit; + } + } + } + } + + if (psRGXKickTA3DIN->hRTDataCleanup) + { + /* Look up the address from the handle */ + psRGXKickTA3DOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hRTDataCleanupInt2, + psRGXKickTA3DIN->hRTDataCleanup, + PVRSRV_HANDLE_TYPE_RGX_RTDATA_CLEANUP); + if(psRGXKickTA3DOUT->eError != PVRSRV_OK) + { + goto RGXKickTA3D_exit; + } + + /* Look up the data from the resman address */ + psRGXKickTA3DOUT->eError = ResManFindPrivateDataByPtr(hRTDataCleanupInt2, (IMG_VOID **) &psRTDataCleanupInt); + + if(psRGXKickTA3DOUT->eError != PVRSRV_OK) + { + goto RGXKickTA3D_exit; + } + } + + if (psRGXKickTA3DIN->hZBuffer) + { + /* Look up the address from the handle */ + psRGXKickTA3DOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hZBufferInt2, + psRGXKickTA3DIN->hZBuffer, + PVRSRV_HANDLE_TYPE_RGX_FWIF_ZSBUFFER); + if(psRGXKickTA3DOUT->eError != PVRSRV_OK) + { + goto RGXKickTA3D_exit; + } + + /* Look up the data from the resman address */ + psRGXKickTA3DOUT->eError = ResManFindPrivateDataByPtr(hZBufferInt2, (IMG_VOID **) &psZBufferInt); + + if(psRGXKickTA3DOUT->eError != PVRSRV_OK) + { + goto RGXKickTA3D_exit; + } + } + + if (psRGXKickTA3DIN->hSBuffer) + { + /* Look up the address from the handle */ + psRGXKickTA3DOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hSBufferInt2, + psRGXKickTA3DIN->hSBuffer, + PVRSRV_HANDLE_TYPE_RGX_FWIF_ZSBUFFER); + if(psRGXKickTA3DOUT->eError != PVRSRV_OK) + { + goto RGXKickTA3D_exit; + } + + /* Look up the data from the resman address */ + psRGXKickTA3DOUT->eError = ResManFindPrivateDataByPtr(hSBufferInt2, (IMG_VOID **) &psSBufferInt); + + if(psRGXKickTA3DOUT->eError != PVRSRV_OK) + { + goto RGXKickTA3D_exit; + } + } + + psRGXKickTA3DOUT->eError = + PVRSRVRGXKickTA3DKM( + psRenderContextInt, + psRGXKickTA3DIN->ui32ClientTAFenceCount, + sClientTAFenceUFOAddressInt, + ui32ClientTAFenceValueInt, + psRGXKickTA3DIN->ui32ClientTAUpdateCount, + sClientTAUpdateUFOAddressInt, + ui32ClientTAUpdateValueInt, + psRGXKickTA3DIN->ui32ServerTASyncPrims, + ui32ServerTASyncFlagsInt, + psServerTASyncsInt, + psRGXKickTA3DIN->ui32Client3DFenceCount, + sClient3DFenceUFOAddressInt, + ui32Client3DFenceValueInt, + psRGXKickTA3DIN->ui32Client3DUpdateCount, + sClient3DUpdateUFOAddressInt, + ui32Client3DUpdateValueInt, + psRGXKickTA3DIN->ui32Server3DSyncPrims, + ui32Server3DSyncFlagsInt, + psServer3DSyncsInt, + psRGXKickTA3DIN->sPRFenceUFOAddress, + psRGXKickTA3DIN->ui32FRFenceValue, + psRGXKickTA3DIN->ui32NumFenceFds, + i32FenceFdsInt, + 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 (sClientTAFenceUFOAddressInt) + OSFreeMem(sClientTAFenceUFOAddressInt); + if (ui32ClientTAFenceValueInt) + OSFreeMem(ui32ClientTAFenceValueInt); + if (sClientTAUpdateUFOAddressInt) + OSFreeMem(sClientTAUpdateUFOAddressInt); + if (ui32ClientTAUpdateValueInt) + OSFreeMem(ui32ClientTAUpdateValueInt); + if (ui32ServerTASyncFlagsInt) + OSFreeMem(ui32ServerTASyncFlagsInt); + if (psServerTASyncsInt) + OSFreeMem(psServerTASyncsInt); + if (hServerTASyncsInt2) + OSFreeMem(hServerTASyncsInt2); + if (sClient3DFenceUFOAddressInt) + OSFreeMem(sClient3DFenceUFOAddressInt); + if (ui32Client3DFenceValueInt) + OSFreeMem(ui32Client3DFenceValueInt); + if (sClient3DUpdateUFOAddressInt) + OSFreeMem(sClient3DUpdateUFOAddressInt); + if (ui32Client3DUpdateValueInt) + OSFreeMem(ui32Client3DUpdateValueInt); + if (ui32Server3DSyncFlagsInt) + OSFreeMem(ui32Server3DSyncFlagsInt); + if (psServer3DSyncsInt) + OSFreeMem(psServer3DSyncsInt); + if (hServer3DSyncsInt2) + OSFreeMem(hServer3DSyncsInt2); + if (i32FenceFdsInt) + OSFreeMem(i32FenceFdsInt); + if (psTACmdInt) + OSFreeMem(psTACmdInt); + if (ps3DPRCmdInt) + OSFreeMem(ps3DPRCmdInt); + if (ps3DCmdInt) + OSFreeMem(ps3DCmdInt); + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXSetRenderContextPriority(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_RGXSETRENDERCONTEXTPRIORITY *psRGXSetRenderContextPriorityIN, + PVRSRV_BRIDGE_OUT_RGXSETRENDERCONTEXTPRIORITY *psRGXSetRenderContextPriorityOUT, + CONNECTION_DATA *psConnection) +{ + RGX_SERVER_RENDER_CONTEXT * psRenderContextInt = IMG_NULL; + IMG_HANDLE hRenderContextInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_RGXTA3D_RGXSETRENDERCONTEXTPRIORITY); + + + + + + { + /* Look up the address from the handle */ + psRGXSetRenderContextPriorityOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hRenderContextInt2, + psRGXSetRenderContextPriorityIN->hRenderContext, + PVRSRV_HANDLE_TYPE_RGX_SERVER_RENDER_CONTEXT); + if(psRGXSetRenderContextPriorityOUT->eError != PVRSRV_OK) + { + goto RGXSetRenderContextPriority_exit; + } + + /* Look up the data from the resman address */ + psRGXSetRenderContextPriorityOUT->eError = ResManFindPrivateDataByPtr(hRenderContextInt2, (IMG_VOID **) &psRenderContextInt); + + 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 ui32BridgeID, + PVRSRV_BRIDGE_IN_RGXGETLASTRENDERCONTEXTRESETREASON *psRGXGetLastRenderContextResetReasonIN, + PVRSRV_BRIDGE_OUT_RGXGETLASTRENDERCONTEXTRESETREASON *psRGXGetLastRenderContextResetReasonOUT, + CONNECTION_DATA *psConnection) +{ + RGX_SERVER_RENDER_CONTEXT * psRenderContextInt = IMG_NULL; + IMG_HANDLE hRenderContextInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_RGXTA3D_RGXGETLASTRENDERCONTEXTRESETREASON); + + + + + + { + /* Look up the address from the handle */ + psRGXGetLastRenderContextResetReasonOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hRenderContextInt2, + psRGXGetLastRenderContextResetReasonIN->hRenderContext, + PVRSRV_HANDLE_TYPE_RGX_SERVER_RENDER_CONTEXT); + if(psRGXGetLastRenderContextResetReasonOUT->eError != PVRSRV_OK) + { + goto RGXGetLastRenderContextResetReason_exit; + } + + /* Look up the data from the resman address */ + psRGXGetLastRenderContextResetReasonOUT->eError = ResManFindPrivateDataByPtr(hRenderContextInt2, (IMG_VOID **) &psRenderContextInt); + + if(psRGXGetLastRenderContextResetReasonOUT->eError != PVRSRV_OK) + { + goto RGXGetLastRenderContextResetReason_exit; + } + } + + psRGXGetLastRenderContextResetReasonOUT->eError = + PVRSRVRGXGetLastRenderContextResetReasonKM( + psRenderContextInt, + &psRGXGetLastRenderContextResetReasonOUT->ui32LastResetReason); + + + +RGXGetLastRenderContextResetReason_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXGetPartialRenderCount(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_RGXGETPARTIALRENDERCOUNT *psRGXGetPartialRenderCountIN, + PVRSRV_BRIDGE_OUT_RGXGETPARTIALRENDERCOUNT *psRGXGetPartialRenderCountOUT, + CONNECTION_DATA *psConnection) +{ + DEVMEM_MEMDESC * psHWRTDataMemDescInt = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_RGXTA3D_RGXGETPARTIALRENDERCOUNT); + + + + + + { + /* Look up the address from the handle */ + psRGXGetPartialRenderCountOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &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 ui32BridgeID, + PVRSRV_BRIDGE_IN_RGXKICKSYNCTA *psRGXKickSyncTAIN, + PVRSRV_BRIDGE_OUT_RGXKICKSYNCTA *psRGXKickSyncTAOUT, + CONNECTION_DATA *psConnection) +{ + RGX_SERVER_RENDER_CONTEXT * psRenderContextInt = IMG_NULL; + IMG_HANDLE hRenderContextInt2 = IMG_NULL; + PRGXFWIF_UFO_ADDR *sClientTAFenceUFOAddressInt = IMG_NULL; + IMG_UINT32 *ui32ClientTAFenceValueInt = IMG_NULL; + PRGXFWIF_UFO_ADDR *sClientTAUpdateUFOAddressInt = IMG_NULL; + IMG_UINT32 *ui32ClientTAUpdateValueInt = IMG_NULL; + IMG_UINT32 *ui32ServerTASyncFlagsInt = IMG_NULL; + SERVER_SYNC_PRIMITIVE * *psServerTASyncsInt = IMG_NULL; + IMG_HANDLE *hServerTASyncsInt2 = IMG_NULL; + PRGXFWIF_UFO_ADDR *sClient3DFenceUFOAddressInt = IMG_NULL; + IMG_UINT32 *ui32Client3DFenceValueInt = IMG_NULL; + PRGXFWIF_UFO_ADDR *sClient3DUpdateUFOAddressInt = 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 *i32FenceFDsInt = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_RGXTA3D_RGXKICKSYNCTA); + + + + + if (psRGXKickSyncTAIN->ui32ClientTAFenceCount != 0) + { + sClientTAFenceUFOAddressInt = OSAllocMem(psRGXKickSyncTAIN->ui32ClientTAFenceCount * sizeof(PRGXFWIF_UFO_ADDR)); + if (!sClientTAFenceUFOAddressInt) + { + psRGXKickSyncTAOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickSyncTA_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickSyncTAIN->psClientTAFenceUFOAddress, psRGXKickSyncTAIN->ui32ClientTAFenceCount * sizeof(PRGXFWIF_UFO_ADDR)) + || (OSCopyFromUser(NULL, sClientTAFenceUFOAddressInt, psRGXKickSyncTAIN->psClientTAFenceUFOAddress, + psRGXKickSyncTAIN->ui32ClientTAFenceCount * sizeof(PRGXFWIF_UFO_ADDR)) != 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) + { + sClientTAUpdateUFOAddressInt = OSAllocMem(psRGXKickSyncTAIN->ui32ClientTAUpdateCount * sizeof(PRGXFWIF_UFO_ADDR)); + if (!sClientTAUpdateUFOAddressInt) + { + psRGXKickSyncTAOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickSyncTA_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickSyncTAIN->psClientTAUpdateUFOAddress, psRGXKickSyncTAIN->ui32ClientTAUpdateCount * sizeof(PRGXFWIF_UFO_ADDR)) + || (OSCopyFromUser(NULL, sClientTAUpdateUFOAddressInt, psRGXKickSyncTAIN->psClientTAUpdateUFOAddress, + psRGXKickSyncTAIN->ui32ClientTAUpdateCount * sizeof(PRGXFWIF_UFO_ADDR)) != 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) + { + sClient3DFenceUFOAddressInt = OSAllocMem(psRGXKickSyncTAIN->ui32Client3DFenceCount * sizeof(PRGXFWIF_UFO_ADDR)); + if (!sClient3DFenceUFOAddressInt) + { + psRGXKickSyncTAOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickSyncTA_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickSyncTAIN->psClient3DFenceUFOAddress, psRGXKickSyncTAIN->ui32Client3DFenceCount * sizeof(PRGXFWIF_UFO_ADDR)) + || (OSCopyFromUser(NULL, sClient3DFenceUFOAddressInt, psRGXKickSyncTAIN->psClient3DFenceUFOAddress, + psRGXKickSyncTAIN->ui32Client3DFenceCount * sizeof(PRGXFWIF_UFO_ADDR)) != 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) + { + sClient3DUpdateUFOAddressInt = OSAllocMem(psRGXKickSyncTAIN->ui32Client3DUpdateCount * sizeof(PRGXFWIF_UFO_ADDR)); + if (!sClient3DUpdateUFOAddressInt) + { + psRGXKickSyncTAOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickSyncTA_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickSyncTAIN->psClient3DUpdateUFOAddress, psRGXKickSyncTAIN->ui32Client3DUpdateCount * sizeof(PRGXFWIF_UFO_ADDR)) + || (OSCopyFromUser(NULL, sClient3DUpdateUFOAddressInt, psRGXKickSyncTAIN->psClient3DUpdateUFOAddress, + psRGXKickSyncTAIN->ui32Client3DUpdateCount * sizeof(PRGXFWIF_UFO_ADDR)) != 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->ui32NumFenceFDs != 0) + { + i32FenceFDsInt = OSAllocMem(psRGXKickSyncTAIN->ui32NumFenceFDs * sizeof(IMG_INT32)); + if (!i32FenceFDsInt) + { + psRGXKickSyncTAOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickSyncTA_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickSyncTAIN->pi32FenceFDs, psRGXKickSyncTAIN->ui32NumFenceFDs * sizeof(IMG_INT32)) + || (OSCopyFromUser(NULL, i32FenceFDsInt, psRGXKickSyncTAIN->pi32FenceFDs, + psRGXKickSyncTAIN->ui32NumFenceFDs * 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_HANDLE *) &hRenderContextInt2, + psRGXKickSyncTAIN->hRenderContext, + PVRSRV_HANDLE_TYPE_RGX_SERVER_RENDER_CONTEXT); + if(psRGXKickSyncTAOUT->eError != PVRSRV_OK) + { + goto RGXKickSyncTA_exit; + } + + /* Look up the data from the resman address */ + psRGXKickSyncTAOUT->eError = ResManFindPrivateDataByPtr(hRenderContextInt2, (IMG_VOID **) &psRenderContextInt); + + 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_HANDLE *) &hServerTASyncsInt2[i], + hServerTASyncsInt2[i], + PVRSRV_HANDLE_TYPE_SERVER_SYNC_PRIMITIVE); + if(psRGXKickSyncTAOUT->eError != PVRSRV_OK) + { + goto RGXKickSyncTA_exit; + } + + /* Look up the data from the resman address */ + psRGXKickSyncTAOUT->eError = ResManFindPrivateDataByPtr(hServerTASyncsInt2[i], (IMG_VOID **) &psServerTASyncsInt[i]); + + 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_HANDLE *) &hServer3DSyncsInt2[i], + hServer3DSyncsInt2[i], + PVRSRV_HANDLE_TYPE_SERVER_SYNC_PRIMITIVE); + if(psRGXKickSyncTAOUT->eError != PVRSRV_OK) + { + goto RGXKickSyncTA_exit; + } + + /* Look up the data from the resman address */ + psRGXKickSyncTAOUT->eError = ResManFindPrivateDataByPtr(hServer3DSyncsInt2[i], (IMG_VOID **) &psServer3DSyncsInt[i]); + + if(psRGXKickSyncTAOUT->eError != PVRSRV_OK) + { + goto RGXKickSyncTA_exit; + } + } + } + } + + psRGXKickSyncTAOUT->eError = + PVRSRVRGXKickSyncTAKM( + psRenderContextInt, + psRGXKickSyncTAIN->ui32ClientTAFenceCount, + sClientTAFenceUFOAddressInt, + ui32ClientTAFenceValueInt, + psRGXKickSyncTAIN->ui32ClientTAUpdateCount, + sClientTAUpdateUFOAddressInt, + ui32ClientTAUpdateValueInt, + psRGXKickSyncTAIN->ui32ServerTASyncPrims, + ui32ServerTASyncFlagsInt, + psServerTASyncsInt, + psRGXKickSyncTAIN->ui32Client3DFenceCount, + sClient3DFenceUFOAddressInt, + ui32Client3DFenceValueInt, + psRGXKickSyncTAIN->ui32Client3DUpdateCount, + sClient3DUpdateUFOAddressInt, + ui32Client3DUpdateValueInt, + psRGXKickSyncTAIN->ui32Server3DSyncPrims, + ui32Server3DSyncFlagsInt, + psServer3DSyncsInt, + psRGXKickSyncTAIN->ui32NumFenceFDs, + i32FenceFDsInt, + psRGXKickSyncTAIN->bbPDumpContinuous); + + + +RGXKickSyncTA_exit: + if (sClientTAFenceUFOAddressInt) + OSFreeMem(sClientTAFenceUFOAddressInt); + if (ui32ClientTAFenceValueInt) + OSFreeMem(ui32ClientTAFenceValueInt); + if (sClientTAUpdateUFOAddressInt) + OSFreeMem(sClientTAUpdateUFOAddressInt); + if (ui32ClientTAUpdateValueInt) + OSFreeMem(ui32ClientTAUpdateValueInt); + if (ui32ServerTASyncFlagsInt) + OSFreeMem(ui32ServerTASyncFlagsInt); + if (psServerTASyncsInt) + OSFreeMem(psServerTASyncsInt); + if (hServerTASyncsInt2) + OSFreeMem(hServerTASyncsInt2); + if (sClient3DFenceUFOAddressInt) + OSFreeMem(sClient3DFenceUFOAddressInt); + if (ui32Client3DFenceValueInt) + OSFreeMem(ui32Client3DFenceValueInt); + if (sClient3DUpdateUFOAddressInt) + OSFreeMem(sClient3DUpdateUFOAddressInt); + if (ui32Client3DUpdateValueInt) + OSFreeMem(ui32Client3DUpdateValueInt); + if (ui32Server3DSyncFlagsInt) + OSFreeMem(ui32Server3DSyncFlagsInt); + if (psServer3DSyncsInt) + OSFreeMem(psServer3DSyncsInt); + if (hServer3DSyncsInt2) + OSFreeMem(hServer3DSyncsInt2); + if (i32FenceFDsInt) + OSFreeMem(i32FenceFDsInt); + + return 0; +} + + + +/* *************************************************************************** + * Server bridge dispatch related glue + */ + +PVRSRV_ERROR RegisterRGXTA3DFunctions(IMG_VOID); +IMG_VOID UnregisterRGXTA3DFunctions(IMG_VOID); + +/* + * Register all RGXTA3D functions with services + */ +PVRSRV_ERROR RegisterRGXTA3DFunctions(IMG_VOID) +{ + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXTA3D_RGXCREATEHWRTDATA, PVRSRVBridgeRGXCreateHWRTData); + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXTA3D_RGXDESTROYHWRTDATA, PVRSRVBridgeRGXDestroyHWRTData); + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXTA3D_RGXCREATERENDERTARGET, PVRSRVBridgeRGXCreateRenderTarget); + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXTA3D_RGXDESTROYRENDERTARGET, PVRSRVBridgeRGXDestroyRenderTarget); + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXTA3D_RGXCREATEZSBUFFER, PVRSRVBridgeRGXCreateZSBuffer); + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXTA3D_RGXDESTROYZSBUFFER, PVRSRVBridgeRGXDestroyZSBuffer); + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXTA3D_RGXPOPULATEZSBUFFER, PVRSRVBridgeRGXPopulateZSBuffer); + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXTA3D_RGXUNPOPULATEZSBUFFER, PVRSRVBridgeRGXUnpopulateZSBuffer); + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXTA3D_RGXCREATEFREELIST, PVRSRVBridgeRGXCreateFreeList); + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXTA3D_RGXDESTROYFREELIST, PVRSRVBridgeRGXDestroyFreeList); + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXTA3D_RGXADDBLOCKTOFREELIST, PVRSRVBridgeRGXAddBlockToFreeList); + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXTA3D_RGXREMOVEBLOCKFROMFREELIST, PVRSRVBridgeRGXRemoveBlockFromFreeList); + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXTA3D_RGXCREATERENDERCONTEXT, PVRSRVBridgeRGXCreateRenderContext); + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXTA3D_RGXDESTROYRENDERCONTEXT, PVRSRVBridgeRGXDestroyRenderContext); + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXTA3D_RGXKICKTA3D, PVRSRVBridgeRGXKickTA3D); + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXTA3D_RGXSETRENDERCONTEXTPRIORITY, PVRSRVBridgeRGXSetRenderContextPriority); + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXTA3D_RGXGETLASTRENDERCONTEXTRESETREASON, PVRSRVBridgeRGXGetLastRenderContextResetReason); + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXTA3D_RGXGETPARTIALRENDERCOUNT, PVRSRVBridgeRGXGetPartialRenderCount); + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXTA3D_RGXKICKSYNCTA, PVRSRVBridgeRGXKickSyncTA); + + return PVRSRV_OK; +} + +/* + * Unregister all rgxta3d functions with services + */ +IMG_VOID UnregisterRGXTA3DFunctions(IMG_VOID) +{ +} diff --git a/drivers/gpu/rogue/generated/rgxtq_bridge/common_rgxtq_bridge.h b/drivers/gpu/rogue/generated/rgxtq_bridge/common_rgxtq_bridge.h new file mode 100644 index 000000000000..7dec5f5ee43d --- /dev/null +++ b/drivers/gpu/rogue/generated/rgxtq_bridge/common_rgxtq_bridge.h @@ -0,0 +1,185 @@ +/*************************************************************************/ /*! +@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 "rgx_bridge.h" +#include "sync_external.h" +#include "rgx_fwif_shared.h" + + +#include "pvr_bridge_io.h" + +#define PVRSRV_BRIDGE_RGXTQ_CMD_FIRST (PVRSRV_BRIDGE_RGXTQ_START) +#define PVRSRV_BRIDGE_RGXTQ_RGXCREATETRANSFERCONTEXT PVRSRV_IOWR(PVRSRV_BRIDGE_RGXTQ_CMD_FIRST+0) +#define PVRSRV_BRIDGE_RGXTQ_RGXDESTROYTRANSFERCONTEXT PVRSRV_IOWR(PVRSRV_BRIDGE_RGXTQ_CMD_FIRST+1) +#define PVRSRV_BRIDGE_RGXTQ_RGXSUBMITTRANSFER PVRSRV_IOWR(PVRSRV_BRIDGE_RGXTQ_CMD_FIRST+2) +#define PVRSRV_BRIDGE_RGXTQ_RGXSETTRANSFERCONTEXTPRIORITY PVRSRV_IOWR(PVRSRV_BRIDGE_RGXTQ_CMD_FIRST+3) +#define PVRSRV_BRIDGE_RGXTQ_RGXKICKSYNCTRANSFER PVRSRV_IOWR(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; + PRGXFWIF_UFO_ADDR* * psFenceUFOAddress; + IMG_UINT32* * pui32FenceValue; + IMG_UINT32 * pui32ClientUpdateCount; + PRGXFWIF_UFO_ADDR* * psUpdateUFOAddress; + IMG_UINT32* * pui32UpdateValue; + IMG_UINT32 * pui32ServerSyncCount; + IMG_UINT32* * pui32ServerSyncFlags; + IMG_HANDLE* * phServerSync; + IMG_UINT32 ui32NumFenceFDs; + IMG_INT32 * pi32FenceFDs; + 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; + PRGXFWIF_UFO_ADDR * psClientFenceUFOAddress; + IMG_UINT32 * pui32ClientFenceValue; + IMG_UINT32 ui32ClientUpdateCount; + PRGXFWIF_UFO_ADDR * psClientUpdateUFOAddress; + IMG_UINT32 * pui32ClientUpdateValue; + IMG_UINT32 ui32ServerSyncCount; + IMG_UINT32 * pui32ServerSyncFlags; + IMG_HANDLE * phServerSyncs; + IMG_UINT32 ui32NumFenceFDs; + IMG_INT32 * pi32FenceFDs; + 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/generated/rgxtq_bridge/server_rgxtq_bridge.c b/drivers/gpu/rogue/generated/rgxtq_bridge/server_rgxtq_bridge.c new file mode 100644 index 000000000000..84e26ea24931 --- /dev/null +++ b/drivers/gpu/rogue/generated/rgxtq_bridge/server_rgxtq_bridge.c @@ -0,0 +1,1411 @@ +/*************************************************************************/ /*! +@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 + +/* *************************************************************************** + * Bridge proxy functions + */ + +static PVRSRV_ERROR +RGXDestroyTransferContextResManProxy(IMG_HANDLE hResmanItem) +{ + PVRSRV_ERROR eError; + + eError = ResManFreeResByPtr(hResmanItem); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + + return eError; +} + + + +/* *************************************************************************** + * Server-side bridge entry points + */ + +static IMG_INT +PVRSRVBridgeRGXCreateTransferContext(IMG_UINT32 ui32BridgeID, + 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; + IMG_HANDLE hTransferContextInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_RGXTQ_RGXCREATETRANSFERCONTEXT); + + + + + 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_HANDLE *) &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_HANDLE *) &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; + } + + /* Create a resman item and overwrite the handle with it */ + hTransferContextInt2 = ResManRegisterRes(psConnection->hResManContext, + RESMAN_TYPE_RGX_SERVER_TQ_CONTEXT, + psTransferContextInt, + (RESMAN_FREE_FN)&PVRSRVRGXDestroyTransferContextKM); + if (hTransferContextInt2 == IMG_NULL) + { + psRGXCreateTransferContextOUT->eError = PVRSRV_ERROR_UNABLE_TO_REGISTER_RESOURCE; + goto RGXCreateTransferContext_exit; + } + psRGXCreateTransferContextOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psRGXCreateTransferContextOUT->hTransferContext, + (IMG_HANDLE) hTransferContextInt2, + PVRSRV_HANDLE_TYPE_RGX_SERVER_TQ_CONTEXT, + PVRSRV_HANDLE_ALLOC_FLAG_NONE + ); + if (psRGXCreateTransferContextOUT->eError != PVRSRV_OK) + { + goto RGXCreateTransferContext_exit; + } + + +RGXCreateTransferContext_exit: + if (psRGXCreateTransferContextOUT->eError != PVRSRV_OK) + { + /* If we have a valid resman item we should undo the bridge function by freeing the resman item */ + if (hTransferContextInt2) + { + PVRSRV_ERROR eError = ResManFreeResByPtr(hTransferContextInt2); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + } + else if (psTransferContextInt) + { + PVRSRVRGXDestroyTransferContextKM(psTransferContextInt); + } + } + + if (psFrameworkCmdInt) + OSFreeMem(psFrameworkCmdInt); + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXDestroyTransferContext(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_RGXDESTROYTRANSFERCONTEXT *psRGXDestroyTransferContextIN, + PVRSRV_BRIDGE_OUT_RGXDESTROYTRANSFERCONTEXT *psRGXDestroyTransferContextOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hTransferContextInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_RGXTQ_RGXDESTROYTRANSFERCONTEXT); + + + + + + { + /* Look up the address from the handle */ + psRGXDestroyTransferContextOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hTransferContextInt2, + psRGXDestroyTransferContextIN->hTransferContext, + PVRSRV_HANDLE_TYPE_RGX_SERVER_TQ_CONTEXT); + if(psRGXDestroyTransferContextOUT->eError != PVRSRV_OK) + { + goto RGXDestroyTransferContext_exit; + } + + } + + psRGXDestroyTransferContextOUT->eError = RGXDestroyTransferContextResManProxy(hTransferContextInt2); + /* Exit early if bridged call fails */ + if(psRGXDestroyTransferContextOUT->eError != PVRSRV_OK) + { + goto RGXDestroyTransferContext_exit; + } + + psRGXDestroyTransferContextOUT->eError = + PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psRGXDestroyTransferContextIN->hTransferContext, + PVRSRV_HANDLE_TYPE_RGX_SERVER_TQ_CONTEXT); + + +RGXDestroyTransferContext_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXSubmitTransfer(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_RGXSUBMITTRANSFER *psRGXSubmitTransferIN, + PVRSRV_BRIDGE_OUT_RGXSUBMITTRANSFER *psRGXSubmitTransferOUT, + CONNECTION_DATA *psConnection) +{ + RGX_SERVER_TQ_CONTEXT * psTransferContextInt = IMG_NULL; + IMG_HANDLE hTransferContextInt2 = IMG_NULL; + IMG_UINT32 *ui32ClientFenceCountInt = IMG_NULL; + PRGXFWIF_UFO_ADDR **sFenceUFOAddressInt = IMG_NULL; + IMG_UINT32 **ui32FenceValueInt = IMG_NULL; + IMG_UINT32 *ui32ClientUpdateCountInt = IMG_NULL; + PRGXFWIF_UFO_ADDR **sUpdateUFOAddressInt = 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 *i32FenceFDsInt = IMG_NULL; + IMG_UINT32 *ui32CommandSizeInt = IMG_NULL; + IMG_UINT8 **ui8FWCommandInt = IMG_NULL; + IMG_UINT32 *ui32TQPrepareFlagsInt = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_RGXTQ_RGXSUBMITTRANSFER); + + + + + 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; + + /* + 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(PRGXFWIF_UFO_ADDR *); + if (ui32Pass == 0) + { + ui32AllocSize += ui32Size; + } + else + { + pui8Ptr = OSAllocMem(ui32AllocSize); + if (pui8Ptr == IMG_NULL) + { + psRGXSubmitTransferOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + goto RGXSubmitTransfer_exit; + } + sFenceUFOAddressInt = (PRGXFWIF_UFO_ADDR **) pui8Ptr; + pui8Ptr += ui32Size; + } + + for (i=0;iui32PrepareCount;i++) + { + ui32Size = ui32ClientFenceCountInt[i] * sizeof(PRGXFWIF_UFO_ADDR); + if (ui32Size) + { + if (ui32Pass == 0) + { + ui32AllocSize += ui32Size; + } + else + { + sFenceUFOAddressInt[i] = (PRGXFWIF_UFO_ADDR *) pui8Ptr; + pui8Ptr += ui32Size; + } + } + } + } + } + + { + IMG_UINT32 i; + PRGXFWIF_UFO_ADDR **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->psFenceUFOAddress[i], sizeof(PRGXFWIF_UFO_ADDR **)) + || (OSCopyFromUser(NULL, &psPtr, &psRGXSubmitTransferIN->psFenceUFOAddress[i], + sizeof(PRGXFWIF_UFO_ADDR **)) != PVRSRV_OK) ) + { + psRGXSubmitTransferOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXSubmitTransfer_exit; + } + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psPtr, (psRGXSubmitTransferIN->pui32ClientFenceCount[i] * sizeof(PRGXFWIF_UFO_ADDR))) + || (OSCopyFromUser(NULL, (sFenceUFOAddressInt[i]), psPtr, + (psRGXSubmitTransferIN->pui32ClientFenceCount[i] * sizeof(PRGXFWIF_UFO_ADDR))) != 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, (psRGXSubmitTransferIN->pui32ClientFenceCount[i] * sizeof(IMG_UINT32))) + || (OSCopyFromUser(NULL, (ui32FenceValueInt[i]), psPtr, + (psRGXSubmitTransferIN->pui32ClientFenceCount[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; + + /* + 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(PRGXFWIF_UFO_ADDR *); + if (ui32Pass == 0) + { + ui32AllocSize += ui32Size; + } + else + { + pui8Ptr = OSAllocMem(ui32AllocSize); + if (pui8Ptr == IMG_NULL) + { + psRGXSubmitTransferOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + goto RGXSubmitTransfer_exit; + } + sUpdateUFOAddressInt = (PRGXFWIF_UFO_ADDR **) pui8Ptr; + pui8Ptr += ui32Size; + } + + for (i=0;iui32PrepareCount;i++) + { + ui32Size = ui32ClientUpdateCountInt[i] * sizeof(PRGXFWIF_UFO_ADDR); + if (ui32Size) + { + if (ui32Pass == 0) + { + ui32AllocSize += ui32Size; + } + else + { + sUpdateUFOAddressInt[i] = (PRGXFWIF_UFO_ADDR *) pui8Ptr; + pui8Ptr += ui32Size; + } + } + } + } + } + + { + IMG_UINT32 i; + PRGXFWIF_UFO_ADDR **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->psUpdateUFOAddress[i], sizeof(PRGXFWIF_UFO_ADDR **)) + || (OSCopyFromUser(NULL, &psPtr, &psRGXSubmitTransferIN->psUpdateUFOAddress[i], + sizeof(PRGXFWIF_UFO_ADDR **)) != PVRSRV_OK) ) + { + psRGXSubmitTransferOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXSubmitTransfer_exit; + } + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psPtr, (psRGXSubmitTransferIN->pui32ClientUpdateCount[i] * sizeof(PRGXFWIF_UFO_ADDR))) + || (OSCopyFromUser(NULL, (sUpdateUFOAddressInt[i]), psPtr, + (psRGXSubmitTransferIN->pui32ClientUpdateCount[i] * sizeof(PRGXFWIF_UFO_ADDR))) != 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, (psRGXSubmitTransferIN->pui32ClientUpdateCount[i] * sizeof(IMG_UINT32))) + || (OSCopyFromUser(NULL, (ui32UpdateValueInt[i]), psPtr, + (psRGXSubmitTransferIN->pui32ClientUpdateCount[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, (psRGXSubmitTransferIN->pui32ServerSyncCount[i] * sizeof(IMG_UINT32))) + || (OSCopyFromUser(NULL, (ui32ServerSyncFlagsInt[i]), psPtr, + (psRGXSubmitTransferIN->pui32ServerSyncCount[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, (psRGXSubmitTransferIN->pui32ServerSyncCount[i] * sizeof(IMG_HANDLE))) + || (OSCopyFromUser(NULL, (hServerSyncInt2[i]), psPtr, + (psRGXSubmitTransferIN->pui32ServerSyncCount[i] * sizeof(IMG_HANDLE))) != PVRSRV_OK) ) + { + psRGXSubmitTransferOUT->eError = PVRSRV_ERROR_INVALID_PARAMS; + + goto RGXSubmitTransfer_exit; + } + } + } + if (psRGXSubmitTransferIN->ui32NumFenceFDs != 0) + { + i32FenceFDsInt = OSAllocMem(psRGXSubmitTransferIN->ui32NumFenceFDs * sizeof(IMG_INT32)); + if (!i32FenceFDsInt) + { + psRGXSubmitTransferOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXSubmitTransfer_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXSubmitTransferIN->pi32FenceFDs, psRGXSubmitTransferIN->ui32NumFenceFDs * sizeof(IMG_INT32)) + || (OSCopyFromUser(NULL, i32FenceFDsInt, psRGXSubmitTransferIN->pi32FenceFDs, + psRGXSubmitTransferIN->ui32NumFenceFDs * 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, (psRGXSubmitTransferIN->pui32CommandSize[i] * sizeof(IMG_UINT8))) + || (OSCopyFromUser(NULL, (ui8FWCommandInt[i]), psPtr, + (psRGXSubmitTransferIN->pui32CommandSize[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_HANDLE *) &hTransferContextInt2, + psRGXSubmitTransferIN->hTransferContext, + PVRSRV_HANDLE_TYPE_RGX_SERVER_TQ_CONTEXT); + if(psRGXSubmitTransferOUT->eError != PVRSRV_OK) + { + goto RGXSubmitTransfer_exit; + } + + /* Look up the data from the resman address */ + psRGXSubmitTransferOUT->eError = ResManFindPrivateDataByPtr(hTransferContextInt2, (IMG_VOID **) &psTransferContextInt); + + 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_HANDLE *) &hServerSyncInt2[i][j], + hServerSyncInt2[i][j], + PVRSRV_HANDLE_TYPE_SERVER_SYNC_PRIMITIVE); + if(psRGXSubmitTransferOUT->eError != PVRSRV_OK) + { + goto RGXSubmitTransfer_exit; + } + + /* Look up the data from the resman address */ + psRGXSubmitTransferOUT->eError = ResManFindPrivateDataByPtr(hServerSyncInt2[i][j], (IMG_VOID **) &psServerSyncInt[i][j]); + + if(psRGXSubmitTransferOUT->eError != PVRSRV_OK) + { + goto RGXSubmitTransfer_exit; + } + } + } + } + } + + psRGXSubmitTransferOUT->eError = + PVRSRVRGXSubmitTransferKM( + psTransferContextInt, + psRGXSubmitTransferIN->ui32PrepareCount, + ui32ClientFenceCountInt, + sFenceUFOAddressInt, + ui32FenceValueInt, + ui32ClientUpdateCountInt, + sUpdateUFOAddressInt, + ui32UpdateValueInt, + ui32ServerSyncCountInt, + ui32ServerSyncFlagsInt, + psServerSyncInt, + psRGXSubmitTransferIN->ui32NumFenceFDs, + i32FenceFDsInt, + ui32CommandSizeInt, + ui8FWCommandInt, + ui32TQPrepareFlagsInt, + psRGXSubmitTransferIN->ui32ExternalJobReference, + psRGXSubmitTransferIN->ui32InternalJobReference); + + + +RGXSubmitTransfer_exit: + if (ui32ClientFenceCountInt) + OSFreeMem(ui32ClientFenceCountInt); + if (sFenceUFOAddressInt) + OSFreeMem(sFenceUFOAddressInt); + if (ui32FenceValueInt) + OSFreeMem(ui32FenceValueInt); + if (ui32ClientUpdateCountInt) + OSFreeMem(ui32ClientUpdateCountInt); + if (sUpdateUFOAddressInt) + OSFreeMem(sUpdateUFOAddressInt); + if (ui32UpdateValueInt) + OSFreeMem(ui32UpdateValueInt); + if (ui32ServerSyncCountInt) + OSFreeMem(ui32ServerSyncCountInt); + if (ui32ServerSyncFlagsInt) + OSFreeMem(ui32ServerSyncFlagsInt); + if (psServerSyncInt) + OSFreeMem(psServerSyncInt); + if (hServerSyncInt2) + OSFreeMem(hServerSyncInt2); + if (i32FenceFDsInt) + OSFreeMem(i32FenceFDsInt); + if (ui32CommandSizeInt) + OSFreeMem(ui32CommandSizeInt); + if (ui8FWCommandInt) + OSFreeMem(ui8FWCommandInt); + if (ui32TQPrepareFlagsInt) + OSFreeMem(ui32TQPrepareFlagsInt); + + return 0; +} + +static IMG_INT +PVRSRVBridgeRGXSetTransferContextPriority(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_RGXSETTRANSFERCONTEXTPRIORITY *psRGXSetTransferContextPriorityIN, + PVRSRV_BRIDGE_OUT_RGXSETTRANSFERCONTEXTPRIORITY *psRGXSetTransferContextPriorityOUT, + CONNECTION_DATA *psConnection) +{ + RGX_SERVER_TQ_CONTEXT * psTransferContextInt = IMG_NULL; + IMG_HANDLE hTransferContextInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_RGXTQ_RGXSETTRANSFERCONTEXTPRIORITY); + + + + + + { + /* Look up the address from the handle */ + psRGXSetTransferContextPriorityOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hTransferContextInt2, + psRGXSetTransferContextPriorityIN->hTransferContext, + PVRSRV_HANDLE_TYPE_RGX_SERVER_TQ_CONTEXT); + if(psRGXSetTransferContextPriorityOUT->eError != PVRSRV_OK) + { + goto RGXSetTransferContextPriority_exit; + } + + /* Look up the data from the resman address */ + psRGXSetTransferContextPriorityOUT->eError = ResManFindPrivateDataByPtr(hTransferContextInt2, (IMG_VOID **) &psTransferContextInt); + + 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 ui32BridgeID, + PVRSRV_BRIDGE_IN_RGXKICKSYNCTRANSFER *psRGXKickSyncTransferIN, + PVRSRV_BRIDGE_OUT_RGXKICKSYNCTRANSFER *psRGXKickSyncTransferOUT, + CONNECTION_DATA *psConnection) +{ + RGX_SERVER_TQ_CONTEXT * psTransferContextInt = IMG_NULL; + IMG_HANDLE hTransferContextInt2 = IMG_NULL; + PRGXFWIF_UFO_ADDR *sClientFenceUFOAddressInt = IMG_NULL; + IMG_UINT32 *ui32ClientFenceValueInt = IMG_NULL; + PRGXFWIF_UFO_ADDR *sClientUpdateUFOAddressInt = 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 *i32FenceFDsInt = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_RGXTQ_RGXKICKSYNCTRANSFER); + + + + + if (psRGXKickSyncTransferIN->ui32ClientFenceCount != 0) + { + sClientFenceUFOAddressInt = OSAllocMem(psRGXKickSyncTransferIN->ui32ClientFenceCount * sizeof(PRGXFWIF_UFO_ADDR)); + if (!sClientFenceUFOAddressInt) + { + psRGXKickSyncTransferOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickSyncTransfer_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickSyncTransferIN->psClientFenceUFOAddress, psRGXKickSyncTransferIN->ui32ClientFenceCount * sizeof(PRGXFWIF_UFO_ADDR)) + || (OSCopyFromUser(NULL, sClientFenceUFOAddressInt, psRGXKickSyncTransferIN->psClientFenceUFOAddress, + psRGXKickSyncTransferIN->ui32ClientFenceCount * sizeof(PRGXFWIF_UFO_ADDR)) != 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) + { + sClientUpdateUFOAddressInt = OSAllocMem(psRGXKickSyncTransferIN->ui32ClientUpdateCount * sizeof(PRGXFWIF_UFO_ADDR)); + if (!sClientUpdateUFOAddressInt) + { + psRGXKickSyncTransferOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickSyncTransfer_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickSyncTransferIN->psClientUpdateUFOAddress, psRGXKickSyncTransferIN->ui32ClientUpdateCount * sizeof(PRGXFWIF_UFO_ADDR)) + || (OSCopyFromUser(NULL, sClientUpdateUFOAddressInt, psRGXKickSyncTransferIN->psClientUpdateUFOAddress, + psRGXKickSyncTransferIN->ui32ClientUpdateCount * sizeof(PRGXFWIF_UFO_ADDR)) != 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->ui32NumFenceFDs != 0) + { + i32FenceFDsInt = OSAllocMem(psRGXKickSyncTransferIN->ui32NumFenceFDs * sizeof(IMG_INT32)); + if (!i32FenceFDsInt) + { + psRGXKickSyncTransferOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY; + + goto RGXKickSyncTransfer_exit; + } + } + + /* Copy the data over */ + if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXKickSyncTransferIN->pi32FenceFDs, psRGXKickSyncTransferIN->ui32NumFenceFDs * sizeof(IMG_INT32)) + || (OSCopyFromUser(NULL, i32FenceFDsInt, psRGXKickSyncTransferIN->pi32FenceFDs, + psRGXKickSyncTransferIN->ui32NumFenceFDs * 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_HANDLE *) &hTransferContextInt2, + psRGXKickSyncTransferIN->hTransferContext, + PVRSRV_HANDLE_TYPE_RGX_SERVER_TQ_CONTEXT); + if(psRGXKickSyncTransferOUT->eError != PVRSRV_OK) + { + goto RGXKickSyncTransfer_exit; + } + + /* Look up the data from the resman address */ + psRGXKickSyncTransferOUT->eError = ResManFindPrivateDataByPtr(hTransferContextInt2, (IMG_VOID **) &psTransferContextInt); + + 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_HANDLE *) &hServerSyncsInt2[i], + hServerSyncsInt2[i], + PVRSRV_HANDLE_TYPE_SERVER_SYNC_PRIMITIVE); + if(psRGXKickSyncTransferOUT->eError != PVRSRV_OK) + { + goto RGXKickSyncTransfer_exit; + } + + /* Look up the data from the resman address */ + psRGXKickSyncTransferOUT->eError = ResManFindPrivateDataByPtr(hServerSyncsInt2[i], (IMG_VOID **) &psServerSyncsInt[i]); + + if(psRGXKickSyncTransferOUT->eError != PVRSRV_OK) + { + goto RGXKickSyncTransfer_exit; + } + } + } + } + + psRGXKickSyncTransferOUT->eError = + PVRSRVRGXKickSyncTransferKM( + psTransferContextInt, + psRGXKickSyncTransferIN->ui32ClientFenceCount, + sClientFenceUFOAddressInt, + ui32ClientFenceValueInt, + psRGXKickSyncTransferIN->ui32ClientUpdateCount, + sClientUpdateUFOAddressInt, + ui32ClientUpdateValueInt, + psRGXKickSyncTransferIN->ui32ServerSyncCount, + ui32ServerSyncFlagsInt, + psServerSyncsInt, + psRGXKickSyncTransferIN->ui32NumFenceFDs, + i32FenceFDsInt, + psRGXKickSyncTransferIN->ui32TQPrepareFlags); + + + +RGXKickSyncTransfer_exit: + if (sClientFenceUFOAddressInt) + OSFreeMem(sClientFenceUFOAddressInt); + if (ui32ClientFenceValueInt) + OSFreeMem(ui32ClientFenceValueInt); + if (sClientUpdateUFOAddressInt) + OSFreeMem(sClientUpdateUFOAddressInt); + if (ui32ClientUpdateValueInt) + OSFreeMem(ui32ClientUpdateValueInt); + if (ui32ServerSyncFlagsInt) + OSFreeMem(ui32ServerSyncFlagsInt); + if (psServerSyncsInt) + OSFreeMem(psServerSyncsInt); + if (hServerSyncsInt2) + OSFreeMem(hServerSyncsInt2); + if (i32FenceFDsInt) + OSFreeMem(i32FenceFDsInt); + + return 0; +} + + + +/* *************************************************************************** + * Server bridge dispatch related glue + */ + +PVRSRV_ERROR RegisterRGXTQFunctions(IMG_VOID); +IMG_VOID UnregisterRGXTQFunctions(IMG_VOID); + +/* + * Register all RGXTQ functions with services + */ +PVRSRV_ERROR RegisterRGXTQFunctions(IMG_VOID) +{ + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXTQ_RGXCREATETRANSFERCONTEXT, PVRSRVBridgeRGXCreateTransferContext); + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXTQ_RGXDESTROYTRANSFERCONTEXT, PVRSRVBridgeRGXDestroyTransferContext); + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXTQ_RGXSUBMITTRANSFER, PVRSRVBridgeRGXSubmitTransfer); + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXTQ_RGXSETTRANSFERCONTEXTPRIORITY, PVRSRVBridgeRGXSetTransferContextPriority); + SetDispatchTableEntry(PVRSRV_BRIDGE_RGXTQ_RGXKICKSYNCTRANSFER, PVRSRVBridgeRGXKickSyncTransfer); + + return PVRSRV_OK; +} + +/* + * Unregister all rgxtq functions with services + */ +IMG_VOID UnregisterRGXTQFunctions(IMG_VOID) +{ +} diff --git a/drivers/gpu/rogue/generated/ri_bridge/client_ri_bridge.h b/drivers/gpu/rogue/generated/ri_bridge/client_ri_bridge.h new file mode 100644 index 000000000000..31cf3b70a0e4 --- /dev/null +++ b/drivers/gpu/rogue/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_SIZE_T uiLogicalSize); + +IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeRIWriteMEMDESCEntry(IMG_HANDLE hBridge, + IMG_HANDLE hPMRHandle, + IMG_UINT32 ui32TextBSize, + const IMG_CHAR *puiTextB, + IMG_SIZE_T uiOffset, + IMG_SIZE_T uiSize, + 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/generated/ri_bridge/common_ri_bridge.h b/drivers/gpu/rogue/generated/ri_bridge/common_ri_bridge.h new file mode 100644 index 000000000000..e6cdec1c5bf6 --- /dev/null +++ b/drivers/gpu/rogue/generated/ri_bridge/common_ri_bridge.h @@ -0,0 +1,194 @@ +/*************************************************************************/ /*! +@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 "ri_typedefs.h" + + +#include "pvr_bridge_io.h" + +#define PVRSRV_BRIDGE_RI_CMD_FIRST (PVRSRV_BRIDGE_RI_START) +#define PVRSRV_BRIDGE_RI_RIWRITEPMRENTRY PVRSRV_IOWR(PVRSRV_BRIDGE_RI_CMD_FIRST+0) +#define PVRSRV_BRIDGE_RI_RIWRITEMEMDESCENTRY PVRSRV_IOWR(PVRSRV_BRIDGE_RI_CMD_FIRST+1) +#define PVRSRV_BRIDGE_RI_RIUPDATEMEMDESCADDR PVRSRV_IOWR(PVRSRV_BRIDGE_RI_CMD_FIRST+2) +#define PVRSRV_BRIDGE_RI_RIDELETEMEMDESCENTRY PVRSRV_IOWR(PVRSRV_BRIDGE_RI_CMD_FIRST+3) +#define PVRSRV_BRIDGE_RI_RIDUMPLIST PVRSRV_IOWR(PVRSRV_BRIDGE_RI_CMD_FIRST+4) +#define PVRSRV_BRIDGE_RI_RIDUMPALL PVRSRV_IOWR(PVRSRV_BRIDGE_RI_CMD_FIRST+5) +#define PVRSRV_BRIDGE_RI_RIDUMPPROCESS PVRSRV_IOWR(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_SIZE_T uiLogicalSize; +} __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_SIZE_T uiOffset; + IMG_SIZE_T uiSize; + 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/generated/ri_bridge/server_ri_bridge.c b/drivers/gpu/rogue/generated/ri_bridge/server_ri_bridge.c new file mode 100644 index 000000000000..ebe2fb56c9ab --- /dev/null +++ b/drivers/gpu/rogue/generated/ri_bridge/server_ri_bridge.c @@ -0,0 +1,504 @@ +/*************************************************************************/ /*! +@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 + +/* *************************************************************************** + * Bridge proxy functions + */ + +static PVRSRV_ERROR +RIDeleteMEMDESCEntryResManProxy(IMG_HANDLE hResmanItem) +{ + PVRSRV_ERROR eError; + + eError = ResManFreeResByPtr(hResmanItem); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + + return eError; +} + + + +/* *************************************************************************** + * Server-side bridge entry points + */ + +static IMG_INT +PVRSRVBridgeRIWritePMREntry(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_RIWRITEPMRENTRY *psRIWritePMREntryIN, + PVRSRV_BRIDGE_OUT_RIWRITEPMRENTRY *psRIWritePMREntryOUT, + CONNECTION_DATA *psConnection) +{ + PMR * psPMRHandleInt = IMG_NULL; + IMG_HANDLE hPMRHandleInt2 = IMG_NULL; + IMG_CHAR *uiTextAInt = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_RI_RIWRITEPMRENTRY); + + + + + 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_HANDLE *) &hPMRHandleInt2, + psRIWritePMREntryIN->hPMRHandle, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR); + if(psRIWritePMREntryOUT->eError != PVRSRV_OK) + { + goto RIWritePMREntry_exit; + } + + /* Look up the data from the resman address */ + psRIWritePMREntryOUT->eError = ResManFindPrivateDataByPtr(hPMRHandleInt2, (IMG_VOID **) &psPMRHandleInt); + + if(psRIWritePMREntryOUT->eError != PVRSRV_OK) + { + goto RIWritePMREntry_exit; + } + } + + psRIWritePMREntryOUT->eError = + RIWritePMREntryKM( + psPMRHandleInt, + psRIWritePMREntryIN->ui32TextASize, + uiTextAInt, + psRIWritePMREntryIN->uiLogicalSize); + + + +RIWritePMREntry_exit: + if (uiTextAInt) + OSFreeMem(uiTextAInt); + + return 0; +} + +static IMG_INT +PVRSRVBridgeRIWriteMEMDESCEntry(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_RIWRITEMEMDESCENTRY *psRIWriteMEMDESCEntryIN, + PVRSRV_BRIDGE_OUT_RIWRITEMEMDESCENTRY *psRIWriteMEMDESCEntryOUT, + CONNECTION_DATA *psConnection) +{ + PMR * psPMRHandleInt = IMG_NULL; + IMG_HANDLE hPMRHandleInt2 = IMG_NULL; + IMG_CHAR *uiTextBInt = IMG_NULL; + RI_HANDLE psRIHandleInt = IMG_NULL; + IMG_HANDLE hRIHandleInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_RI_RIWRITEMEMDESCENTRY); + + + + + 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_HANDLE *) &hPMRHandleInt2, + psRIWriteMEMDESCEntryIN->hPMRHandle, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR); + if(psRIWriteMEMDESCEntryOUT->eError != PVRSRV_OK) + { + goto RIWriteMEMDESCEntry_exit; + } + + /* Look up the data from the resman address */ + psRIWriteMEMDESCEntryOUT->eError = ResManFindPrivateDataByPtr(hPMRHandleInt2, (IMG_VOID **) &psPMRHandleInt); + + if(psRIWriteMEMDESCEntryOUT->eError != PVRSRV_OK) + { + goto RIWriteMEMDESCEntry_exit; + } + } + + psRIWriteMEMDESCEntryOUT->eError = + RIWriteMEMDESCEntryKM( + psPMRHandleInt, + psRIWriteMEMDESCEntryIN->ui32TextBSize, + uiTextBInt, + psRIWriteMEMDESCEntryIN->uiOffset, + psRIWriteMEMDESCEntryIN->uiSize, + psRIWriteMEMDESCEntryIN->bIsImport, + psRIWriteMEMDESCEntryIN->bIsExportable, + &psRIHandleInt); + /* Exit early if bridged call fails */ + if(psRIWriteMEMDESCEntryOUT->eError != PVRSRV_OK) + { + goto RIWriteMEMDESCEntry_exit; + } + + /* Create a resman item and overwrite the handle with it */ + hRIHandleInt2 = ResManRegisterRes(psConnection->hResManContext, + RESMAN_TYPE_RI_HANDLE, + psRIHandleInt, + (RESMAN_FREE_FN)&RIDeleteMEMDESCEntryKM); + if (hRIHandleInt2 == IMG_NULL) + { + psRIWriteMEMDESCEntryOUT->eError = PVRSRV_ERROR_UNABLE_TO_REGISTER_RESOURCE; + goto RIWriteMEMDESCEntry_exit; + } + psRIWriteMEMDESCEntryOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psRIWriteMEMDESCEntryOUT->hRIHandle, + (IMG_HANDLE) hRIHandleInt2, + PVRSRV_HANDLE_TYPE_RI_HANDLE, + PVRSRV_HANDLE_ALLOC_FLAG_NONE + ); + if (psRIWriteMEMDESCEntryOUT->eError != PVRSRV_OK) + { + goto RIWriteMEMDESCEntry_exit; + } + + +RIWriteMEMDESCEntry_exit: + if (psRIWriteMEMDESCEntryOUT->eError != PVRSRV_OK) + { + /* If we have a valid resman item we should undo the bridge function by freeing the resman item */ + if (hRIHandleInt2) + { + PVRSRV_ERROR eError = ResManFreeResByPtr(hRIHandleInt2); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + } + else if (psRIHandleInt) + { + RIDeleteMEMDESCEntryKM(psRIHandleInt); + } + } + + if (uiTextBInt) + OSFreeMem(uiTextBInt); + + return 0; +} + +static IMG_INT +PVRSRVBridgeRIUpdateMEMDESCAddr(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_RIUPDATEMEMDESCADDR *psRIUpdateMEMDESCAddrIN, + PVRSRV_BRIDGE_OUT_RIUPDATEMEMDESCADDR *psRIUpdateMEMDESCAddrOUT, + CONNECTION_DATA *psConnection) +{ + RI_HANDLE psRIHandleInt = IMG_NULL; + IMG_HANDLE hRIHandleInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_RI_RIUPDATEMEMDESCADDR); + + + + + + { + /* Look up the address from the handle */ + psRIUpdateMEMDESCAddrOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hRIHandleInt2, + psRIUpdateMEMDESCAddrIN->hRIHandle, + PVRSRV_HANDLE_TYPE_RI_HANDLE); + if(psRIUpdateMEMDESCAddrOUT->eError != PVRSRV_OK) + { + goto RIUpdateMEMDESCAddr_exit; + } + + /* Look up the data from the resman address */ + psRIUpdateMEMDESCAddrOUT->eError = ResManFindPrivateDataByPtr(hRIHandleInt2, (IMG_VOID **) &psRIHandleInt); + + if(psRIUpdateMEMDESCAddrOUT->eError != PVRSRV_OK) + { + goto RIUpdateMEMDESCAddr_exit; + } + } + + psRIUpdateMEMDESCAddrOUT->eError = + RIUpdateMEMDESCAddrKM( + psRIHandleInt, + psRIUpdateMEMDESCAddrIN->sAddr); + + + +RIUpdateMEMDESCAddr_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeRIDeleteMEMDESCEntry(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_RIDELETEMEMDESCENTRY *psRIDeleteMEMDESCEntryIN, + PVRSRV_BRIDGE_OUT_RIDELETEMEMDESCENTRY *psRIDeleteMEMDESCEntryOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hRIHandleInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_RI_RIDELETEMEMDESCENTRY); + + + + + + { + /* Look up the address from the handle */ + psRIDeleteMEMDESCEntryOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hRIHandleInt2, + psRIDeleteMEMDESCEntryIN->hRIHandle, + PVRSRV_HANDLE_TYPE_RI_HANDLE); + if(psRIDeleteMEMDESCEntryOUT->eError != PVRSRV_OK) + { + goto RIDeleteMEMDESCEntry_exit; + } + + } + + psRIDeleteMEMDESCEntryOUT->eError = RIDeleteMEMDESCEntryResManProxy(hRIHandleInt2); + /* Exit early if bridged call fails */ + if(psRIDeleteMEMDESCEntryOUT->eError != PVRSRV_OK) + { + goto RIDeleteMEMDESCEntry_exit; + } + + psRIDeleteMEMDESCEntryOUT->eError = + PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psRIDeleteMEMDESCEntryIN->hRIHandle, + PVRSRV_HANDLE_TYPE_RI_HANDLE); + + +RIDeleteMEMDESCEntry_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeRIDumpList(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_RIDUMPLIST *psRIDumpListIN, + PVRSRV_BRIDGE_OUT_RIDUMPLIST *psRIDumpListOUT, + CONNECTION_DATA *psConnection) +{ + PMR * psPMRHandleInt = IMG_NULL; + IMG_HANDLE hPMRHandleInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_RI_RIDUMPLIST); + + + + + + { + /* Look up the address from the handle */ + psRIDumpListOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hPMRHandleInt2, + psRIDumpListIN->hPMRHandle, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR); + if(psRIDumpListOUT->eError != PVRSRV_OK) + { + goto RIDumpList_exit; + } + + /* Look up the data from the resman address */ + psRIDumpListOUT->eError = ResManFindPrivateDataByPtr(hPMRHandleInt2, (IMG_VOID **) &psPMRHandleInt); + + if(psRIDumpListOUT->eError != PVRSRV_OK) + { + goto RIDumpList_exit; + } + } + + psRIDumpListOUT->eError = + RIDumpListKM( + psPMRHandleInt); + + + +RIDumpList_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeRIDumpAll(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_RIDUMPALL *psRIDumpAllIN, + PVRSRV_BRIDGE_OUT_RIDUMPALL *psRIDumpAllOUT, + CONNECTION_DATA *psConnection) +{ + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_RI_RIDUMPALL); + + PVR_UNREFERENCED_PARAMETER(psConnection); + PVR_UNREFERENCED_PARAMETER(psRIDumpAllIN); + + + + + psRIDumpAllOUT->eError = + RIDumpAllKM( + ); + + + + + return 0; +} + +static IMG_INT +PVRSRVBridgeRIDumpProcess(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_RIDUMPPROCESS *psRIDumpProcessIN, + PVRSRV_BRIDGE_OUT_RIDUMPPROCESS *psRIDumpProcessOUT, + CONNECTION_DATA *psConnection) +{ + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_RI_RIDUMPPROCESS); + + PVR_UNREFERENCED_PARAMETER(psConnection); + + + + + psRIDumpProcessOUT->eError = + RIDumpProcessKM( + psRIDumpProcessIN->ui32Pid); + + + + + return 0; +} + + + +/* *************************************************************************** + * Server bridge dispatch related glue + */ + +PVRSRV_ERROR RegisterRIFunctions(IMG_VOID); +IMG_VOID UnregisterRIFunctions(IMG_VOID); + +/* + * Register all RI functions with services + */ +PVRSRV_ERROR RegisterRIFunctions(IMG_VOID) +{ + SetDispatchTableEntry(PVRSRV_BRIDGE_RI_RIWRITEPMRENTRY, PVRSRVBridgeRIWritePMREntry); + SetDispatchTableEntry(PVRSRV_BRIDGE_RI_RIWRITEMEMDESCENTRY, PVRSRVBridgeRIWriteMEMDESCEntry); + SetDispatchTableEntry(PVRSRV_BRIDGE_RI_RIUPDATEMEMDESCADDR, PVRSRVBridgeRIUpdateMEMDESCAddr); + SetDispatchTableEntry(PVRSRV_BRIDGE_RI_RIDELETEMEMDESCENTRY, PVRSRVBridgeRIDeleteMEMDESCEntry); + SetDispatchTableEntry(PVRSRV_BRIDGE_RI_RIDUMPLIST, PVRSRVBridgeRIDumpList); + SetDispatchTableEntry(PVRSRV_BRIDGE_RI_RIDUMPALL, PVRSRVBridgeRIDumpAll); + SetDispatchTableEntry(PVRSRV_BRIDGE_RI_RIDUMPPROCESS, PVRSRVBridgeRIDumpProcess); + + return PVRSRV_OK; +} + +/* + * Unregister all ri functions with services + */ +IMG_VOID UnregisterRIFunctions(IMG_VOID) +{ +} diff --git a/drivers/gpu/rogue/generated/smm_bridge/common_smm_bridge.h b/drivers/gpu/rogue/generated/smm_bridge/common_smm_bridge.h new file mode 100644 index 000000000000..9ac4881c83d4 --- /dev/null +++ b/drivers/gpu/rogue/generated/smm_bridge/common_smm_bridge.h @@ -0,0 +1,114 @@ +/*************************************************************************/ /*! +@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 "pvr_bridge_io.h" + +#define PVRSRV_BRIDGE_SMM_CMD_FIRST (PVRSRV_BRIDGE_SMM_START) +#define PVRSRV_BRIDGE_SMM_PMRSECUREEXPORTPMR PVRSRV_IOWR(PVRSRV_BRIDGE_SMM_CMD_FIRST+0) +#define PVRSRV_BRIDGE_SMM_PMRSECUREUNEXPORTPMR PVRSRV_IOWR(PVRSRV_BRIDGE_SMM_CMD_FIRST+1) +#define PVRSRV_BRIDGE_SMM_PMRSECUREIMPORTPMR PVRSRV_IOWR(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/generated/smm_bridge/server_smm_bridge.c b/drivers/gpu/rogue/generated/smm_bridge/server_smm_bridge.c new file mode 100644 index 000000000000..3c8d297bf49e --- /dev/null +++ b/drivers/gpu/rogue/generated/smm_bridge/server_smm_bridge.c @@ -0,0 +1,328 @@ +/*************************************************************************/ /*! +@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 + +/* *************************************************************************** + * Bridge proxy functions + */ + +static PVRSRV_ERROR +PMRSecureUnexportPMRResManProxy(IMG_HANDLE hResmanItem) +{ + PVRSRV_ERROR eError; + + eError = ResManFreeResByPtr(hResmanItem); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + + return eError; +} + + + +/* *************************************************************************** + * Server-side bridge entry points + */ + +static IMG_INT +PVRSRVBridgePMRSecureExportPMR(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_PMRSECUREEXPORTPMR *psPMRSecureExportPMRIN, + PVRSRV_BRIDGE_OUT_PMRSECUREEXPORTPMR *psPMRSecureExportPMROUT, + CONNECTION_DATA *psConnection) +{ + PMR * psPMRInt = IMG_NULL; + IMG_HANDLE hPMRInt2 = IMG_NULL; + PMR * psPMROutInt = IMG_NULL; + IMG_HANDLE hPMROutInt2 = IMG_NULL; + CONNECTION_DATA *psSecureConnection; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_SMM_PMRSECUREEXPORTPMR); + + + + + + PMRLock(); + { + /* Look up the address from the handle */ + psPMRSecureExportPMROUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hPMRInt2, + psPMRSecureExportPMRIN->hPMR, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR); + if(psPMRSecureExportPMROUT->eError != PVRSRV_OK) + { + PMRUnlock(); + goto PMRSecureExportPMR_exit; + } + + /* Look up the data from the resman address */ + psPMRSecureExportPMROUT->eError = ResManFindPrivateDataByPtr(hPMRInt2, (IMG_VOID **) &psPMRInt); + + 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(); + + /* Create a resman item and overwrite the handle with it */ + hPMROutInt2 = ResManRegisterRes(psSecureConnection->hResManContext, + RESMAN_TYPE_PMR, + psPMROutInt, + (RESMAN_FREE_FN)&PMRSecureUnexportPMR); + if (hPMROutInt2 == IMG_NULL) + { + psPMRSecureExportPMROUT->eError = PVRSRV_ERROR_UNABLE_TO_REGISTER_RESOURCE; + goto PMRSecureExportPMR_exit; + } + + +PMRSecureExportPMR_exit: + if (psPMRSecureExportPMROUT->eError != PVRSRV_OK) + { + /* If we have a valid resman item we should undo the bridge function by freeing the resman item */ + if (hPMROutInt2) + { + PVRSRV_ERROR eError = ResManFreeResByPtr(hPMROutInt2); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + } + else if (psPMROutInt) + { + PMRSecureUnexportPMR(psPMROutInt); + } + } + + + return 0; +} + +static IMG_INT +PVRSRVBridgePMRSecureUnexportPMR(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_PMRSECUREUNEXPORTPMR *psPMRSecureUnexportPMRIN, + PVRSRV_BRIDGE_OUT_PMRSECUREUNEXPORTPMR *psPMRSecureUnexportPMROUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hPMRInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_SMM_PMRSECUREUNEXPORTPMR); + + + + + PMRLock(); + { + /* Look up the address from the handle */ + psPMRSecureUnexportPMROUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hPMRInt2, + psPMRSecureUnexportPMRIN->hPMR, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR); + if(psPMRSecureUnexportPMROUT->eError != PVRSRV_OK) + { + PMRUnlock(); + goto PMRSecureUnexportPMR_exit; + } + + } + + psPMRSecureUnexportPMROUT->eError = PMRSecureUnexportPMRResManProxy(hPMRInt2); + /* Exit early if bridged call fails */ + if(psPMRSecureUnexportPMROUT->eError != PVRSRV_OK) + { + PMRUnlock(); + goto PMRSecureUnexportPMR_exit; + } + PMRUnlock(); + + psPMRSecureUnexportPMROUT->eError = + PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psPMRSecureUnexportPMRIN->hPMR, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR); + + +PMRSecureUnexportPMR_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgePMRSecureImportPMR(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_PMRSECUREIMPORTPMR *psPMRSecureImportPMRIN, + PVRSRV_BRIDGE_OUT_PMRSECUREIMPORTPMR *psPMRSecureImportPMROUT, + CONNECTION_DATA *psConnection) +{ + PMR * psPMRInt = IMG_NULL; + IMG_HANDLE hPMRInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_SMM_PMRSECUREIMPORTPMR); + + + + + + 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(); + + /* Create a resman item and overwrite the handle with it */ + hPMRInt2 = ResManRegisterRes(psConnection->hResManContext, + RESMAN_TYPE_PMR, + psPMRInt, + (RESMAN_FREE_FN)&PMRUnrefPMR); + if (hPMRInt2 == IMG_NULL) + { + psPMRSecureImportPMROUT->eError = PVRSRV_ERROR_UNABLE_TO_REGISTER_RESOURCE; + goto PMRSecureImportPMR_exit; + } + psPMRSecureImportPMROUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psPMRSecureImportPMROUT->hPMR, + (IMG_HANDLE) hPMRInt2, + PVRSRV_HANDLE_TYPE_PHYSMEM_PMR, + PVRSRV_HANDLE_ALLOC_FLAG_NONE + ); + if (psPMRSecureImportPMROUT->eError != PVRSRV_OK) + { + goto PMRSecureImportPMR_exit; + } + + +PMRSecureImportPMR_exit: + if (psPMRSecureImportPMROUT->eError != PVRSRV_OK) + { + /* If we have a valid resman item we should undo the bridge function by freeing the resman item */ + if (hPMRInt2) + { + PVRSRV_ERROR eError = ResManFreeResByPtr(hPMRInt2); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + } + else if (psPMRInt) + { + PMRUnrefPMR(psPMRInt); + } + } + + + return 0; +} + + + +/* *************************************************************************** + * Server bridge dispatch related glue + */ + +PVRSRV_ERROR RegisterSMMFunctions(IMG_VOID); +IMG_VOID UnregisterSMMFunctions(IMG_VOID); + +/* + * Register all SMM functions with services + */ +PVRSRV_ERROR RegisterSMMFunctions(IMG_VOID) +{ + SetDispatchTableEntry(PVRSRV_BRIDGE_SMM_PMRSECUREEXPORTPMR, PVRSRVBridgePMRSecureExportPMR); + SetDispatchTableEntry(PVRSRV_BRIDGE_SMM_PMRSECUREUNEXPORTPMR, PVRSRVBridgePMRSecureUnexportPMR); + SetDispatchTableEntry(PVRSRV_BRIDGE_SMM_PMRSECUREIMPORTPMR, PVRSRVBridgePMRSecureImportPMR); + + return PVRSRV_OK; +} + +/* + * Unregister all smm functions with services + */ +IMG_VOID UnregisterSMMFunctions(IMG_VOID) +{ +} diff --git a/drivers/gpu/rogue/generated/srvcore_bridge/common_srvcore_bridge.h b/drivers/gpu/rogue/generated/srvcore_bridge/common_srvcore_bridge.h new file mode 100644 index 000000000000..ec38f5410890 --- /dev/null +++ b/drivers/gpu/rogue/generated/srvcore_bridge/common_srvcore_bridge.h @@ -0,0 +1,385 @@ +/*************************************************************************/ /*! +@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 "pvrsrv_device_types.h" +#include "cache_external.h" + + +#include "pvr_bridge_io.h" + +#define PVRSRV_BRIDGE_SRVCORE_CMD_FIRST (PVRSRV_BRIDGE_SRVCORE_START) +#define PVRSRV_BRIDGE_SRVCORE_CONNECT PVRSRV_IOWR(PVRSRV_BRIDGE_SRVCORE_CMD_FIRST+0) +#define PVRSRV_BRIDGE_SRVCORE_DISCONNECT PVRSRV_IOWR(PVRSRV_BRIDGE_SRVCORE_CMD_FIRST+1) +#define PVRSRV_BRIDGE_SRVCORE_ENUMERATEDEVICES PVRSRV_IOWR(PVRSRV_BRIDGE_SRVCORE_CMD_FIRST+2) +#define PVRSRV_BRIDGE_SRVCORE_ACQUIREDEVICEDATA PVRSRV_IOWR(PVRSRV_BRIDGE_SRVCORE_CMD_FIRST+3) +#define PVRSRV_BRIDGE_SRVCORE_RELEASEDEVICEDATA PVRSRV_IOWR(PVRSRV_BRIDGE_SRVCORE_CMD_FIRST+4) +#define PVRSRV_BRIDGE_SRVCORE_INITSRVDISCONNECT PVRSRV_IOWR(PVRSRV_BRIDGE_SRVCORE_CMD_FIRST+5) +#define PVRSRV_BRIDGE_SRVCORE_ACQUIREGLOBALEVENTOBJECT PVRSRV_IOWR(PVRSRV_BRIDGE_SRVCORE_CMD_FIRST+6) +#define PVRSRV_BRIDGE_SRVCORE_RELEASEGLOBALEVENTOBJECT PVRSRV_IOWR(PVRSRV_BRIDGE_SRVCORE_CMD_FIRST+7) +#define PVRSRV_BRIDGE_SRVCORE_EVENTOBJECTOPEN PVRSRV_IOWR(PVRSRV_BRIDGE_SRVCORE_CMD_FIRST+8) +#define PVRSRV_BRIDGE_SRVCORE_EVENTOBJECTWAIT PVRSRV_IOWR(PVRSRV_BRIDGE_SRVCORE_CMD_FIRST+9) +#define PVRSRV_BRIDGE_SRVCORE_EVENTOBJECTCLOSE PVRSRV_IOWR(PVRSRV_BRIDGE_SRVCORE_CMD_FIRST+10) +#define PVRSRV_BRIDGE_SRVCORE_DUMPDEBUGINFO PVRSRV_IOWR(PVRSRV_BRIDGE_SRVCORE_CMD_FIRST+11) +#define PVRSRV_BRIDGE_SRVCORE_GETDEVCLOCKSPEED PVRSRV_IOWR(PVRSRV_BRIDGE_SRVCORE_CMD_FIRST+12) +#define PVRSRV_BRIDGE_SRVCORE_HWOPTIMEOUT PVRSRV_IOWR(PVRSRV_BRIDGE_SRVCORE_CMD_FIRST+13) +#define PVRSRV_BRIDGE_SRVCORE_KICKDEVICES PVRSRV_IOWR(PVRSRV_BRIDGE_SRVCORE_CMD_FIRST+14) +#define PVRSRV_BRIDGE_SRVCORE_RESETHWRLOGS PVRSRV_IOWR(PVRSRV_BRIDGE_SRVCORE_CMD_FIRST+15) +#define PVRSRV_BRIDGE_SRVCORE_SOFTRESET PVRSRV_IOWR(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 ui32ui32RGXClockSpeed; + 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 ui64ResetValue; +} __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/generated/srvcore_bridge/server_srvcore_bridge.c b/drivers/gpu/rogue/generated/srvcore_bridge/server_srvcore_bridge.c new file mode 100644 index 000000000000..f78c979518ff --- /dev/null +++ b/drivers/gpu/rogue/generated/srvcore_bridge/server_srvcore_bridge.c @@ -0,0 +1,909 @@ +/*************************************************************************/ /*! +@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 + +/* *************************************************************************** + * Bridge proxy functions + */ + +static PVRSRV_ERROR +ReleaseGlobalEventObjectResManProxy(IMG_HANDLE hResmanItem) +{ + PVRSRV_ERROR eError; + + eError = ResManFreeResByPtr(hResmanItem); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + + return eError; +} + +static PVRSRV_ERROR +EventObjectCloseResManProxy(IMG_HANDLE hResmanItem) +{ + PVRSRV_ERROR eError; + + eError = ResManFreeResByPtr(hResmanItem); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + + return eError; +} + + + +/* *************************************************************************** + * Server-side bridge entry points + */ + +static IMG_INT +PVRSRVBridgeConnect(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_CONNECT *psConnectIN, + PVRSRV_BRIDGE_OUT_CONNECT *psConnectOUT, + CONNECTION_DATA *psConnection) +{ + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_SRVCORE_CONNECT); + + PVR_UNREFERENCED_PARAMETER(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 ui32BridgeID, + PVRSRV_BRIDGE_IN_DISCONNECT *psDisconnectIN, + PVRSRV_BRIDGE_OUT_DISCONNECT *psDisconnectOUT, + CONNECTION_DATA *psConnection) +{ + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_SRVCORE_DISCONNECT); + + PVR_UNREFERENCED_PARAMETER(psConnection); + PVR_UNREFERENCED_PARAMETER(psDisconnectIN); + + + + + psDisconnectOUT->eError = + PVRSRVDisconnectKM( + ); + + + + + return 0; +} + +static IMG_INT +PVRSRVBridgeEnumerateDevices(IMG_UINT32 ui32BridgeID, + 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; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_SRVCORE_ENUMERATEDEVICES); + + 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 ui32BridgeID, + PVRSRV_BRIDGE_IN_ACQUIREDEVICEDATA *psAcquireDeviceDataIN, + PVRSRV_BRIDGE_OUT_ACQUIREDEVICEDATA *psAcquireDeviceDataOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevCookieInt = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_SRVCORE_ACQUIREDEVICEDATA); + + + + + + 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_HANDLE) hDevCookieInt, + PVRSRV_HANDLE_TYPE_DEV_NODE, + PVRSRV_HANDLE_ALLOC_FLAG_SHARED + ); + if (psAcquireDeviceDataOUT->eError != PVRSRV_OK) + { + goto AcquireDeviceData_exit; + } + + +AcquireDeviceData_exit: + if (psAcquireDeviceDataOUT->eError != PVRSRV_OK) + { + } + + + return 0; +} + +static IMG_INT +PVRSRVBridgeReleaseDeviceData(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_RELEASEDEVICEDATA *psReleaseDeviceDataIN, + PVRSRV_BRIDGE_OUT_RELEASEDEVICEDATA *psReleaseDeviceDataOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevCookieInt = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_SRVCORE_RELEASEDEVICEDATA); + + + + + + { + /* Look up the address from the handle */ + psReleaseDeviceDataOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hDevCookieInt, + psReleaseDeviceDataIN->hDevCookie, + PVRSRV_HANDLE_TYPE_DEV_NODE); + if(psReleaseDeviceDataOUT->eError != PVRSRV_OK) + { + goto ReleaseDeviceData_exit; + } + + } + + psReleaseDeviceDataOUT->eError = + PVRSRVReleaseDeviceDataKM( + hDevCookieInt); + /* Exit early if bridged call fails */ + if(psReleaseDeviceDataOUT->eError != PVRSRV_OK) + { + goto ReleaseDeviceData_exit; + } + + psReleaseDeviceDataOUT->eError = + PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psReleaseDeviceDataIN->hDevCookie, + PVRSRV_HANDLE_TYPE_DEV_NODE); + + +ReleaseDeviceData_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeInitSrvDisconnect(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_INITSRVDISCONNECT *psInitSrvDisconnectIN, + PVRSRV_BRIDGE_OUT_INITSRVDISCONNECT *psInitSrvDisconnectOUT, + CONNECTION_DATA *psConnection) +{ + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_SRVCORE_INITSRVDISCONNECT); + + + + + + psInitSrvDisconnectOUT->eError = + PVRSRVInitSrvDisconnectKM(psConnection, + psInitSrvDisconnectIN->bInitSuccesful, + psInitSrvDisconnectIN->ui32ClientBuildOptions); + + + + + return 0; +} + +static IMG_INT +PVRSRVBridgeAcquireGlobalEventObject(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_ACQUIREGLOBALEVENTOBJECT *psAcquireGlobalEventObjectIN, + PVRSRV_BRIDGE_OUT_ACQUIREGLOBALEVENTOBJECT *psAcquireGlobalEventObjectOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hGlobalEventObjectInt = IMG_NULL; + IMG_HANDLE hGlobalEventObjectInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_SRVCORE_ACQUIREGLOBALEVENTOBJECT); + + PVR_UNREFERENCED_PARAMETER(psAcquireGlobalEventObjectIN); + + + + + psAcquireGlobalEventObjectOUT->eError = + AcquireGlobalEventObjectServer( + &hGlobalEventObjectInt); + /* Exit early if bridged call fails */ + if(psAcquireGlobalEventObjectOUT->eError != PVRSRV_OK) + { + goto AcquireGlobalEventObject_exit; + } + + /* Create a resman item and overwrite the handle with it */ + hGlobalEventObjectInt2 = ResManRegisterRes(psConnection->hResManContext, + RESMAN_TYPE_SHARED_EVENT_OBJECT, + hGlobalEventObjectInt, + (RESMAN_FREE_FN)&ReleaseGlobalEventObjectServer); + if (hGlobalEventObjectInt2 == IMG_NULL) + { + psAcquireGlobalEventObjectOUT->eError = PVRSRV_ERROR_UNABLE_TO_REGISTER_RESOURCE; + goto AcquireGlobalEventObject_exit; + } + psAcquireGlobalEventObjectOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psAcquireGlobalEventObjectOUT->hGlobalEventObject, + (IMG_HANDLE) hGlobalEventObjectInt2, + PVRSRV_HANDLE_TYPE_SHARED_EVENT_OBJECT, + PVRSRV_HANDLE_ALLOC_FLAG_SHARED + ); + if (psAcquireGlobalEventObjectOUT->eError != PVRSRV_OK) + { + goto AcquireGlobalEventObject_exit; + } + + +AcquireGlobalEventObject_exit: + if (psAcquireGlobalEventObjectOUT->eError != PVRSRV_OK) + { + /* If we have a valid resman item we should undo the bridge function by freeing the resman item */ + if (hGlobalEventObjectInt2) + { + PVRSRV_ERROR eError = ResManFreeResByPtr(hGlobalEventObjectInt2); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + } + else if (hGlobalEventObjectInt) + { + ReleaseGlobalEventObjectServer(hGlobalEventObjectInt); + } + } + + + return 0; +} + +static IMG_INT +PVRSRVBridgeReleaseGlobalEventObject(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_RELEASEGLOBALEVENTOBJECT *psReleaseGlobalEventObjectIN, + PVRSRV_BRIDGE_OUT_RELEASEGLOBALEVENTOBJECT *psReleaseGlobalEventObjectOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hGlobalEventObjectInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_SRVCORE_RELEASEGLOBALEVENTOBJECT); + + + + + + { + /* Look up the address from the handle */ + psReleaseGlobalEventObjectOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hGlobalEventObjectInt2, + psReleaseGlobalEventObjectIN->hGlobalEventObject, + PVRSRV_HANDLE_TYPE_SHARED_EVENT_OBJECT); + if(psReleaseGlobalEventObjectOUT->eError != PVRSRV_OK) + { + goto ReleaseGlobalEventObject_exit; + } + + } + + psReleaseGlobalEventObjectOUT->eError = ReleaseGlobalEventObjectResManProxy(hGlobalEventObjectInt2); + /* Exit early if bridged call fails */ + if(psReleaseGlobalEventObjectOUT->eError != PVRSRV_OK) + { + goto ReleaseGlobalEventObject_exit; + } + + psReleaseGlobalEventObjectOUT->eError = + PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psReleaseGlobalEventObjectIN->hGlobalEventObject, + PVRSRV_HANDLE_TYPE_SHARED_EVENT_OBJECT); + + +ReleaseGlobalEventObject_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeEventObjectOpen(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_EVENTOBJECTOPEN *psEventObjectOpenIN, + PVRSRV_BRIDGE_OUT_EVENTOBJECTOPEN *psEventObjectOpenOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hEventObjectInt = IMG_NULL; + IMG_HANDLE hEventObjectInt2 = IMG_NULL; + IMG_HANDLE hOSEventInt = IMG_NULL; + IMG_HANDLE hOSEventInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_SRVCORE_EVENTOBJECTOPEN); + + + + + + { + /* Look up the address from the handle */ + psEventObjectOpenOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hEventObjectInt2, + psEventObjectOpenIN->hEventObject, + PVRSRV_HANDLE_TYPE_SHARED_EVENT_OBJECT); + if(psEventObjectOpenOUT->eError != PVRSRV_OK) + { + goto EventObjectOpen_exit; + } + + /* Look up the data from the resman address */ + psEventObjectOpenOUT->eError = ResManFindPrivateDataByPtr(hEventObjectInt2, (IMG_VOID **) &hEventObjectInt); + + 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; + } + + /* Create a resman item and overwrite the handle with it */ + hOSEventInt2 = ResManRegisterRes(psConnection->hResManContext, + RESMAN_TYPE_EVENT_OBJECT, + hOSEventInt, + (RESMAN_FREE_FN)&OSEventObjectClose); + if (hOSEventInt2 == IMG_NULL) + { + psEventObjectOpenOUT->eError = PVRSRV_ERROR_UNABLE_TO_REGISTER_RESOURCE; + goto EventObjectOpen_exit; + } + psEventObjectOpenOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psEventObjectOpenOUT->hOSEvent, + (IMG_HANDLE) hOSEventInt2, + PVRSRV_HANDLE_TYPE_EVENT_OBJECT_CONNECT, + PVRSRV_HANDLE_ALLOC_FLAG_MULTI + ); + if (psEventObjectOpenOUT->eError != PVRSRV_OK) + { + goto EventObjectOpen_exit; + } + + +EventObjectOpen_exit: + if (psEventObjectOpenOUT->eError != PVRSRV_OK) + { + /* If we have a valid resman item we should undo the bridge function by freeing the resman item */ + if (hOSEventInt2) + { + PVRSRV_ERROR eError = ResManFreeResByPtr(hOSEventInt2); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + } + else if (hOSEventInt) + { + OSEventObjectClose(hOSEventInt); + } + } + + + return 0; +} + +static IMG_INT +PVRSRVBridgeEventObjectWait(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_EVENTOBJECTWAIT *psEventObjectWaitIN, + PVRSRV_BRIDGE_OUT_EVENTOBJECTWAIT *psEventObjectWaitOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hOSEventKMInt = IMG_NULL; + IMG_HANDLE hOSEventKMInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_SRVCORE_EVENTOBJECTWAIT); + + + + + + { + /* Look up the address from the handle */ + psEventObjectWaitOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hOSEventKMInt2, + psEventObjectWaitIN->hOSEventKM, + PVRSRV_HANDLE_TYPE_EVENT_OBJECT_CONNECT); + if(psEventObjectWaitOUT->eError != PVRSRV_OK) + { + goto EventObjectWait_exit; + } + + /* Look up the data from the resman address */ + psEventObjectWaitOUT->eError = ResManFindPrivateDataByPtr(hOSEventKMInt2, (IMG_VOID **) &hOSEventKMInt); + + if(psEventObjectWaitOUT->eError != PVRSRV_OK) + { + goto EventObjectWait_exit; + } + } + + psEventObjectWaitOUT->eError = + OSEventObjectWait( + hOSEventKMInt); + + + +EventObjectWait_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeEventObjectClose(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_EVENTOBJECTCLOSE *psEventObjectCloseIN, + PVRSRV_BRIDGE_OUT_EVENTOBJECTCLOSE *psEventObjectCloseOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hOSEventKMInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_SRVCORE_EVENTOBJECTCLOSE); + + + + + + { + /* Look up the address from the handle */ + psEventObjectCloseOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hOSEventKMInt2, + psEventObjectCloseIN->hOSEventKM, + PVRSRV_HANDLE_TYPE_EVENT_OBJECT_CONNECT); + if(psEventObjectCloseOUT->eError != PVRSRV_OK) + { + goto EventObjectClose_exit; + } + + } + + psEventObjectCloseOUT->eError = EventObjectCloseResManProxy(hOSEventKMInt2); + /* Exit early if bridged call fails */ + if(psEventObjectCloseOUT->eError != PVRSRV_OK) + { + goto EventObjectClose_exit; + } + + psEventObjectCloseOUT->eError = + PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psEventObjectCloseIN->hOSEventKM, + PVRSRV_HANDLE_TYPE_EVENT_OBJECT_CONNECT); + + +EventObjectClose_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeDumpDebugInfo(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_DUMPDEBUGINFO *psDumpDebugInfoIN, + PVRSRV_BRIDGE_OUT_DUMPDEBUGINFO *psDumpDebugInfoOUT, + CONNECTION_DATA *psConnection) +{ + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_SRVCORE_DUMPDEBUGINFO); + + PVR_UNREFERENCED_PARAMETER(psConnection); + + + + + psDumpDebugInfoOUT->eError = + PVRSRVDumpDebugInfoKM( + psDumpDebugInfoIN->ui32ui32VerbLevel); + + + + + return 0; +} + +static IMG_INT +PVRSRVBridgeGetDevClockSpeed(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_GETDEVCLOCKSPEED *psGetDevClockSpeedIN, + PVRSRV_BRIDGE_OUT_GETDEVCLOCKSPEED *psGetDevClockSpeedOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevNodeInt = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_SRVCORE_GETDEVCLOCKSPEED); + + + + + + { + /* Look up the address from the handle */ + psGetDevClockSpeedOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hDevNodeInt, + psGetDevClockSpeedIN->hDevNode, + PVRSRV_HANDLE_TYPE_DEV_NODE); + if(psGetDevClockSpeedOUT->eError != PVRSRV_OK) + { + goto GetDevClockSpeed_exit; + } + + } + + psGetDevClockSpeedOUT->eError = + PVRSRVGetDevClockSpeedKM( + hDevNodeInt, + &psGetDevClockSpeedOUT->ui32ui32RGXClockSpeed); + + + +GetDevClockSpeed_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeHWOpTimeout(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_HWOPTIMEOUT *psHWOpTimeoutIN, + PVRSRV_BRIDGE_OUT_HWOPTIMEOUT *psHWOpTimeoutOUT, + CONNECTION_DATA *psConnection) +{ + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_SRVCORE_HWOPTIMEOUT); + + PVR_UNREFERENCED_PARAMETER(psConnection); + PVR_UNREFERENCED_PARAMETER(psHWOpTimeoutIN); + + + + + psHWOpTimeoutOUT->eError = + PVRSRVHWOpTimeoutKM( + ); + + + + + return 0; +} + +static IMG_INT +PVRSRVBridgeKickDevices(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_KICKDEVICES *psKickDevicesIN, + PVRSRV_BRIDGE_OUT_KICKDEVICES *psKickDevicesOUT, + CONNECTION_DATA *psConnection) +{ + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_SRVCORE_KICKDEVICES); + + PVR_UNREFERENCED_PARAMETER(psConnection); + PVR_UNREFERENCED_PARAMETER(psKickDevicesIN); + + + + + psKickDevicesOUT->eError = + PVRSRVKickDevicesKM( + ); + + + + + return 0; +} + +static IMG_INT +PVRSRVBridgeResetHWRLogs(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_RESETHWRLOGS *psResetHWRLogsIN, + PVRSRV_BRIDGE_OUT_RESETHWRLOGS *psResetHWRLogsOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevNodeInt = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_SRVCORE_RESETHWRLOGS); + + + + + + { + /* Look up the address from the handle */ + psResetHWRLogsOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &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 ui32BridgeID, + PVRSRV_BRIDGE_IN_SOFTRESET *psSoftResetIN, + PVRSRV_BRIDGE_OUT_SOFTRESET *psSoftResetOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevNodeInt = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_SRVCORE_SOFTRESET); + + + + + + { + /* Look up the address from the handle */ + psSoftResetOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hDevNodeInt, + psSoftResetIN->hDevNode, + PVRSRV_HANDLE_TYPE_DEV_NODE); + if(psSoftResetOUT->eError != PVRSRV_OK) + { + goto SoftReset_exit; + } + + } + + psSoftResetOUT->eError = + PVRSRVSoftResetKM( + hDevNodeInt, + psSoftResetIN->ui64ResetValue); + + + +SoftReset_exit: + + return 0; +} + + + +/* *************************************************************************** + * Server bridge dispatch related glue + */ + +PVRSRV_ERROR RegisterSRVCOREFunctions(IMG_VOID); +IMG_VOID UnregisterSRVCOREFunctions(IMG_VOID); + +/* + * Register all SRVCORE functions with services + */ +PVRSRV_ERROR RegisterSRVCOREFunctions(IMG_VOID) +{ + SetDispatchTableEntry(PVRSRV_BRIDGE_SRVCORE_CONNECT, PVRSRVBridgeConnect); + SetDispatchTableEntry(PVRSRV_BRIDGE_SRVCORE_DISCONNECT, PVRSRVBridgeDisconnect); + SetDispatchTableEntry(PVRSRV_BRIDGE_SRVCORE_ENUMERATEDEVICES, PVRSRVBridgeEnumerateDevices); + SetDispatchTableEntry(PVRSRV_BRIDGE_SRVCORE_ACQUIREDEVICEDATA, PVRSRVBridgeAcquireDeviceData); + SetDispatchTableEntry(PVRSRV_BRIDGE_SRVCORE_RELEASEDEVICEDATA, PVRSRVBridgeReleaseDeviceData); + SetDispatchTableEntry(PVRSRV_BRIDGE_SRVCORE_INITSRVDISCONNECT, PVRSRVBridgeInitSrvDisconnect); + SetDispatchTableEntry(PVRSRV_BRIDGE_SRVCORE_ACQUIREGLOBALEVENTOBJECT, PVRSRVBridgeAcquireGlobalEventObject); + SetDispatchTableEntry(PVRSRV_BRIDGE_SRVCORE_RELEASEGLOBALEVENTOBJECT, PVRSRVBridgeReleaseGlobalEventObject); + SetDispatchTableEntry(PVRSRV_BRIDGE_SRVCORE_EVENTOBJECTOPEN, PVRSRVBridgeEventObjectOpen); + SetDispatchTableEntry(PVRSRV_BRIDGE_SRVCORE_EVENTOBJECTWAIT, PVRSRVBridgeEventObjectWait); + SetDispatchTableEntry(PVRSRV_BRIDGE_SRVCORE_EVENTOBJECTCLOSE, PVRSRVBridgeEventObjectClose); + SetDispatchTableEntry(PVRSRV_BRIDGE_SRVCORE_DUMPDEBUGINFO, PVRSRVBridgeDumpDebugInfo); + SetDispatchTableEntry(PVRSRV_BRIDGE_SRVCORE_GETDEVCLOCKSPEED, PVRSRVBridgeGetDevClockSpeed); + SetDispatchTableEntry(PVRSRV_BRIDGE_SRVCORE_HWOPTIMEOUT, PVRSRVBridgeHWOpTimeout); + SetDispatchTableEntry(PVRSRV_BRIDGE_SRVCORE_KICKDEVICES, PVRSRVBridgeKickDevices); + SetDispatchTableEntry(PVRSRV_BRIDGE_SRVCORE_RESETHWRLOGS, PVRSRVBridgeResetHWRLogs); + SetDispatchTableEntry(PVRSRV_BRIDGE_SRVCORE_SOFTRESET, PVRSRVBridgeSoftReset); + + return PVRSRV_OK; +} + +/* + * Unregister all srvcore functions with services + */ +IMG_VOID UnregisterSRVCOREFunctions(IMG_VOID) +{ +} diff --git a/drivers/gpu/rogue/generated/sync_bridge/common_sync_bridge.h b/drivers/gpu/rogue/generated/sync_bridge/common_sync_bridge.h new file mode 100644 index 000000000000..5210ad843d7c --- /dev/null +++ b/drivers/gpu/rogue/generated/sync_bridge/common_sync_bridge.h @@ -0,0 +1,480 @@ +/*************************************************************************/ /*! +@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 "pdump.h" +#include "pdumpdefs.h" +#include "devicemem_typedefs.h" + + +#include "pvr_bridge_io.h" + +#define PVRSRV_BRIDGE_SYNC_CMD_FIRST (PVRSRV_BRIDGE_SYNC_START) +#define PVRSRV_BRIDGE_SYNC_ALLOCSYNCPRIMITIVEBLOCK PVRSRV_IOWR(PVRSRV_BRIDGE_SYNC_CMD_FIRST+0) +#define PVRSRV_BRIDGE_SYNC_FREESYNCPRIMITIVEBLOCK PVRSRV_IOWR(PVRSRV_BRIDGE_SYNC_CMD_FIRST+1) +#define PVRSRV_BRIDGE_SYNC_SYNCPRIMSET PVRSRV_IOWR(PVRSRV_BRIDGE_SYNC_CMD_FIRST+2) +#define PVRSRV_BRIDGE_SYNC_SERVERSYNCPRIMSET PVRSRV_IOWR(PVRSRV_BRIDGE_SYNC_CMD_FIRST+3) +#define PVRSRV_BRIDGE_SYNC_SYNCRECORDREMOVEBYHANDLE PVRSRV_IOWR(PVRSRV_BRIDGE_SYNC_CMD_FIRST+4) +#define PVRSRV_BRIDGE_SYNC_SYNCRECORDADD PVRSRV_IOWR(PVRSRV_BRIDGE_SYNC_CMD_FIRST+5) +#define PVRSRV_BRIDGE_SYNC_SERVERSYNCALLOC PVRSRV_IOWR(PVRSRV_BRIDGE_SYNC_CMD_FIRST+6) +#define PVRSRV_BRIDGE_SYNC_SERVERSYNCFREE PVRSRV_IOWR(PVRSRV_BRIDGE_SYNC_CMD_FIRST+7) +#define PVRSRV_BRIDGE_SYNC_SERVERSYNCQUEUEHWOP PVRSRV_IOWR(PVRSRV_BRIDGE_SYNC_CMD_FIRST+8) +#define PVRSRV_BRIDGE_SYNC_SERVERSYNCGETSTATUS PVRSRV_IOWR(PVRSRV_BRIDGE_SYNC_CMD_FIRST+9) +#define PVRSRV_BRIDGE_SYNC_SYNCPRIMOPCREATE PVRSRV_IOWR(PVRSRV_BRIDGE_SYNC_CMD_FIRST+10) +#define PVRSRV_BRIDGE_SYNC_SYNCPRIMOPTAKE PVRSRV_IOWR(PVRSRV_BRIDGE_SYNC_CMD_FIRST+11) +#define PVRSRV_BRIDGE_SYNC_SYNCPRIMOPREADY PVRSRV_IOWR(PVRSRV_BRIDGE_SYNC_CMD_FIRST+12) +#define PVRSRV_BRIDGE_SYNC_SYNCPRIMOPCOMPLETE PVRSRV_IOWR(PVRSRV_BRIDGE_SYNC_CMD_FIRST+13) +#define PVRSRV_BRIDGE_SYNC_SYNCPRIMOPDESTROY PVRSRV_IOWR(PVRSRV_BRIDGE_SYNC_CMD_FIRST+14) +#define PVRSRV_BRIDGE_SYNC_SYNCPRIMPDUMP PVRSRV_IOWR(PVRSRV_BRIDGE_SYNC_CMD_FIRST+15) +#define PVRSRV_BRIDGE_SYNC_SYNCPRIMPDUMPVALUE PVRSRV_IOWR(PVRSRV_BRIDGE_SYNC_CMD_FIRST+16) +#define PVRSRV_BRIDGE_SYNC_SYNCPRIMPDUMPPOL PVRSRV_IOWR(PVRSRV_BRIDGE_SYNC_CMD_FIRST+17) +#define PVRSRV_BRIDGE_SYNC_SYNCPRIMOPPDUMPPOL PVRSRV_IOWR(PVRSRV_BRIDGE_SYNC_CMD_FIRST+18) +#define PVRSRV_BRIDGE_SYNC_SYNCPRIMPDUMPCBP PVRSRV_IOWR(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/generated/sync_bridge/server_sync_bridge.c b/drivers/gpu/rogue/generated/sync_bridge/server_sync_bridge.c new file mode 100644 index 000000000000..bca7d27523f4 --- /dev/null +++ b/drivers/gpu/rogue/generated/sync_bridge/server_sync_bridge.c @@ -0,0 +1,1737 @@ +/*************************************************************************/ /*! +@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 + +/* *************************************************************************** + * Bridge proxy functions + */ + +static PVRSRV_ERROR +FreeSyncPrimitiveBlockResManProxy(IMG_HANDLE hResmanItem) +{ + PVRSRV_ERROR eError; + + eError = ResManFreeResByPtr(hResmanItem); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + + return eError; +} + +static PVRSRV_ERROR +ServerSyncFreeResManProxy(IMG_HANDLE hResmanItem) +{ + PVRSRV_ERROR eError; + + eError = ResManFreeResByPtr(hResmanItem); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + + return eError; +} + +static PVRSRV_ERROR +SyncPrimOpDestroyResManProxy(IMG_HANDLE hResmanItem) +{ + PVRSRV_ERROR eError; + + eError = ResManFreeResByPtr(hResmanItem); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + + return eError; +} + + + +/* *************************************************************************** + * Server-side bridge entry points + */ + +static IMG_INT +PVRSRVBridgeAllocSyncPrimitiveBlock(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_ALLOCSYNCPRIMITIVEBLOCK *psAllocSyncPrimitiveBlockIN, + PVRSRV_BRIDGE_OUT_ALLOCSYNCPRIMITIVEBLOCK *psAllocSyncPrimitiveBlockOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevNodeInt = IMG_NULL; + SYNC_PRIMITIVE_BLOCK * psSyncHandleInt = IMG_NULL; + IMG_HANDLE hSyncHandleInt2 = IMG_NULL; + DEVMEM_EXPORTCOOKIE * psExportCookieInt = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_SYNC_ALLOCSYNCPRIMITIVEBLOCK); + + + + psAllocSyncPrimitiveBlockOUT->hSyncHandle = IMG_NULL; + + + { + /* Look up the address from the handle */ + psAllocSyncPrimitiveBlockOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &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; + } + + /* Create a resman item and overwrite the handle with it */ + hSyncHandleInt2 = ResManRegisterRes(psConnection->hResManContext, + RESMAN_TYPE_SYNC_PRIMITIVE_BLOCK, + psSyncHandleInt, + (RESMAN_FREE_FN)&PVRSRVFreeSyncPrimitiveBlockKM); + if (hSyncHandleInt2 == IMG_NULL) + { + psAllocSyncPrimitiveBlockOUT->eError = PVRSRV_ERROR_UNABLE_TO_REGISTER_RESOURCE; + goto AllocSyncPrimitiveBlock_exit; + } + psAllocSyncPrimitiveBlockOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psAllocSyncPrimitiveBlockOUT->hSyncHandle, + (IMG_HANDLE) hSyncHandleInt2, + PVRSRV_HANDLE_TYPE_SYNC_PRIMITIVE_BLOCK, + PVRSRV_HANDLE_ALLOC_FLAG_NONE + ); + if (psAllocSyncPrimitiveBlockOUT->eError != PVRSRV_OK) + { + goto AllocSyncPrimitiveBlock_exit; + } + psAllocSyncPrimitiveBlockOUT->eError = PVRSRVAllocSubHandle(psConnection->psHandleBase, + &psAllocSyncPrimitiveBlockOUT->hExportCookie, + (IMG_HANDLE) 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) + { + PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psAllocSyncPrimitiveBlockOUT->hSyncHandle, + PVRSRV_HANDLE_TYPE_SYNC_PRIMITIVE_BLOCK); + } + + /* If we have a valid resman item we should undo the bridge function by freeing the resman item */ + if (hSyncHandleInt2) + { + PVRSRV_ERROR eError = ResManFreeResByPtr(hSyncHandleInt2); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + } + else if (psSyncHandleInt) + { + PVRSRVFreeSyncPrimitiveBlockKM(psSyncHandleInt); + } + } + + + return 0; +} + +static IMG_INT +PVRSRVBridgeFreeSyncPrimitiveBlock(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_FREESYNCPRIMITIVEBLOCK *psFreeSyncPrimitiveBlockIN, + PVRSRV_BRIDGE_OUT_FREESYNCPRIMITIVEBLOCK *psFreeSyncPrimitiveBlockOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hSyncHandleInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_SYNC_FREESYNCPRIMITIVEBLOCK); + + + + + + { + /* Look up the address from the handle */ + psFreeSyncPrimitiveBlockOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hSyncHandleInt2, + psFreeSyncPrimitiveBlockIN->hSyncHandle, + PVRSRV_HANDLE_TYPE_SYNC_PRIMITIVE_BLOCK); + if(psFreeSyncPrimitiveBlockOUT->eError != PVRSRV_OK) + { + goto FreeSyncPrimitiveBlock_exit; + } + + } + + psFreeSyncPrimitiveBlockOUT->eError = FreeSyncPrimitiveBlockResManProxy(hSyncHandleInt2); + /* Exit early if bridged call fails */ + if(psFreeSyncPrimitiveBlockOUT->eError != PVRSRV_OK) + { + goto FreeSyncPrimitiveBlock_exit; + } + + psFreeSyncPrimitiveBlockOUT->eError = + PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psFreeSyncPrimitiveBlockIN->hSyncHandle, + PVRSRV_HANDLE_TYPE_SYNC_PRIMITIVE_BLOCK); + + +FreeSyncPrimitiveBlock_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeSyncPrimSet(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_SYNCPRIMSET *psSyncPrimSetIN, + PVRSRV_BRIDGE_OUT_SYNCPRIMSET *psSyncPrimSetOUT, + CONNECTION_DATA *psConnection) +{ + SYNC_PRIMITIVE_BLOCK * psSyncHandleInt = IMG_NULL; + IMG_HANDLE hSyncHandleInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_SYNC_SYNCPRIMSET); + + + + + + { + /* Look up the address from the handle */ + psSyncPrimSetOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hSyncHandleInt2, + psSyncPrimSetIN->hSyncHandle, + PVRSRV_HANDLE_TYPE_SYNC_PRIMITIVE_BLOCK); + if(psSyncPrimSetOUT->eError != PVRSRV_OK) + { + goto SyncPrimSet_exit; + } + + /* Look up the data from the resman address */ + psSyncPrimSetOUT->eError = ResManFindPrivateDataByPtr(hSyncHandleInt2, (IMG_VOID **) &psSyncHandleInt); + + 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 ui32BridgeID, + PVRSRV_BRIDGE_IN_SERVERSYNCPRIMSET *psServerSyncPrimSetIN, + PVRSRV_BRIDGE_OUT_SERVERSYNCPRIMSET *psServerSyncPrimSetOUT, + CONNECTION_DATA *psConnection) +{ + SERVER_SYNC_PRIMITIVE * psSyncHandleInt = IMG_NULL; + IMG_HANDLE hSyncHandleInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_SYNC_SERVERSYNCPRIMSET); + + + + + + { + /* Look up the address from the handle */ + psServerSyncPrimSetOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hSyncHandleInt2, + psServerSyncPrimSetIN->hSyncHandle, + PVRSRV_HANDLE_TYPE_SERVER_SYNC_PRIMITIVE); + if(psServerSyncPrimSetOUT->eError != PVRSRV_OK) + { + goto ServerSyncPrimSet_exit; + } + + /* Look up the data from the resman address */ + psServerSyncPrimSetOUT->eError = ResManFindPrivateDataByPtr(hSyncHandleInt2, (IMG_VOID **) &psSyncHandleInt); + + if(psServerSyncPrimSetOUT->eError != PVRSRV_OK) + { + goto ServerSyncPrimSet_exit; + } + } + + psServerSyncPrimSetOUT->eError = + PVRSRVServerSyncPrimSetKM( + psSyncHandleInt, + psServerSyncPrimSetIN->ui32Value); + + + +ServerSyncPrimSet_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeSyncRecordRemoveByHandle(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_SYNCRECORDREMOVEBYHANDLE *psSyncRecordRemoveByHandleIN, + PVRSRV_BRIDGE_OUT_SYNCRECORDREMOVEBYHANDLE *psSyncRecordRemoveByHandleOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hRecordHandleInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_SYNC_SYNCRECORDREMOVEBYHANDLE); + + /* Look up the address from the handle */ + psSyncRecordRemoveByHandleOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hRecordHandleInt2, + psSyncRecordRemoveByHandleIN->hhRecord, + PVRSRV_HANDLE_TYPE_SYNC_RECORD_HANDLE); + if(psSyncRecordRemoveByHandleOUT->eError != PVRSRV_OK) + { + goto SyncRecordRemoveByHandle_exit; + } + + psSyncRecordRemoveByHandleOUT->eError = ServerSyncFreeResManProxy(hRecordHandleInt2); + /* Exit early if bridged call fails */ + if(psSyncRecordRemoveByHandleOUT->eError != PVRSRV_OK) + { + goto SyncRecordRemoveByHandle_exit; + } + + 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 ui32BridgeID, + PVRSRV_BRIDGE_IN_SYNCRECORDADD *psSyncRecordAddIN, + PVRSRV_BRIDGE_OUT_SYNCRECORDADD *psSyncRecordAddOUT, + CONNECTION_DATA *psConnection) +{ + SYNC_RECORD_HANDLE pshRecordInt = IMG_NULL; + IMG_HANDLE hRecordHandleInt2 = IMG_NULL; + SYNC_PRIMITIVE_BLOCK * pshServerSyncPrimBlockInt = IMG_NULL; + IMG_HANDLE hSyncHandleInt2 = IMG_NULL; + IMG_CHAR *uiClassNameInt = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_SYNC_SYNCRECORDADD); + + 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_HANDLE *) &hSyncHandleInt2, + psSyncRecordAddIN->hhServerSyncPrimBlock, + PVRSRV_HANDLE_TYPE_SYNC_PRIMITIVE_BLOCK); + if(psSyncRecordAddOUT->eError != PVRSRV_OK) + { + goto SyncRecordAdd_exit; + } + + /* Look up the data from the resman address */ + psSyncRecordAddOUT->eError = ResManFindPrivateDataByPtr(hSyncHandleInt2, (IMG_VOID **) &pshServerSyncPrimBlockInt); + + 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; + } + + /* Create a resman item and overwrite the handle with it */ + hRecordHandleInt2 = ResManRegisterRes(psConnection->hResManContext, + RESMAN_TYPE_SYNC_RECORD_HANDLE, + pshRecordInt, + (RESMAN_FREE_FN)&PVRSRVSyncRecordRemoveByHandleKM); + if (hRecordHandleInt2 == IMG_NULL) + { + psSyncRecordAddOUT->eError = PVRSRV_ERROR_UNABLE_TO_REGISTER_RESOURCE; + goto SyncRecordAdd_exit; + } + + psSyncRecordAddOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psSyncRecordAddOUT->hhRecord, + (IMG_VOID *) hRecordHandleInt2, + PVRSRV_HANDLE_TYPE_SYNC_RECORD_HANDLE, + PVRSRV_HANDLE_ALLOC_FLAG_NONE + ); + if (psSyncRecordAddOUT->eError != PVRSRV_OK) + { + goto SyncRecordAdd_exit; + } + +SyncRecordAdd_exit: + if (psSyncRecordAddOUT->eError != PVRSRV_OK) + { + /* If we have a valid resman item we should undo the bridge function by freeing the resman item */ + if (hRecordHandleInt2) + { + PVRSRV_ERROR eError = ResManFreeResByPtr(hRecordHandleInt2); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + } + else if (pshRecordInt) + { + PVRSRVSyncRecordRemoveByHandleKM(pshRecordInt); + } + } + + if (uiClassNameInt) + OSFreeMem(uiClassNameInt); + + return 0; +} + +static IMG_INT +PVRSRVBridgeServerSyncAlloc(IMG_UINT32 ui32BridgeID, + 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_HANDLE hSyncHandleInt2 = IMG_NULL; + IMG_CHAR *uiClassNameInt = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_SYNC_SERVERSYNCALLOC); + + + + + 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_HANDLE *) &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; + } + + /* Create a resman item and overwrite the handle with it */ + hSyncHandleInt2 = ResManRegisterRes(psConnection->hResManContext, + RESMAN_TYPE_SERVER_SYNC_PRIMITIVE, + psSyncHandleInt, + (RESMAN_FREE_FN)&PVRSRVServerSyncFreeKM); + if (hSyncHandleInt2 == IMG_NULL) + { + psServerSyncAllocOUT->eError = PVRSRV_ERROR_UNABLE_TO_REGISTER_RESOURCE; + goto ServerSyncAlloc_exit; + } + psServerSyncAllocOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psServerSyncAllocOUT->hSyncHandle, + (IMG_HANDLE) hSyncHandleInt2, + PVRSRV_HANDLE_TYPE_SERVER_SYNC_PRIMITIVE, + PVRSRV_HANDLE_ALLOC_FLAG_NONE + ); + if (psServerSyncAllocOUT->eError != PVRSRV_OK) + { + goto ServerSyncAlloc_exit; + } + + +ServerSyncAlloc_exit: + if (psServerSyncAllocOUT->eError != PVRSRV_OK) + { + /* If we have a valid resman item we should undo the bridge function by freeing the resman item */ + if (hSyncHandleInt2) + { + PVRSRV_ERROR eError = ResManFreeResByPtr(hSyncHandleInt2); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + } + else if (psSyncHandleInt) + { + PVRSRVServerSyncFreeKM(psSyncHandleInt); + } + } + + if (uiClassNameInt) + OSFreeMem(uiClassNameInt); + + return 0; +} + +static IMG_INT +PVRSRVBridgeServerSyncFree(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_SERVERSYNCFREE *psServerSyncFreeIN, + PVRSRV_BRIDGE_OUT_SERVERSYNCFREE *psServerSyncFreeOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hSyncHandleInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_SYNC_SERVERSYNCFREE); + + + + + + { + /* Look up the address from the handle */ + psServerSyncFreeOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hSyncHandleInt2, + psServerSyncFreeIN->hSyncHandle, + PVRSRV_HANDLE_TYPE_SERVER_SYNC_PRIMITIVE); + if(psServerSyncFreeOUT->eError != PVRSRV_OK) + { + goto ServerSyncFree_exit; + } + + } + + psServerSyncFreeOUT->eError = ServerSyncFreeResManProxy(hSyncHandleInt2); + /* Exit early if bridged call fails */ + if(psServerSyncFreeOUT->eError != PVRSRV_OK) + { + goto ServerSyncFree_exit; + } + + psServerSyncFreeOUT->eError = + PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psServerSyncFreeIN->hSyncHandle, + PVRSRV_HANDLE_TYPE_SERVER_SYNC_PRIMITIVE); + + +ServerSyncFree_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeServerSyncQueueHWOp(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_SERVERSYNCQUEUEHWOP *psServerSyncQueueHWOpIN, + PVRSRV_BRIDGE_OUT_SERVERSYNCQUEUEHWOP *psServerSyncQueueHWOpOUT, + CONNECTION_DATA *psConnection) +{ + SERVER_SYNC_PRIMITIVE * psSyncHandleInt = IMG_NULL; + IMG_HANDLE hSyncHandleInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_SYNC_SERVERSYNCQUEUEHWOP); + + + + + + { + /* Look up the address from the handle */ + psServerSyncQueueHWOpOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hSyncHandleInt2, + psServerSyncQueueHWOpIN->hSyncHandle, + PVRSRV_HANDLE_TYPE_SERVER_SYNC_PRIMITIVE); + if(psServerSyncQueueHWOpOUT->eError != PVRSRV_OK) + { + goto ServerSyncQueueHWOp_exit; + } + + /* Look up the data from the resman address */ + psServerSyncQueueHWOpOUT->eError = ResManFindPrivateDataByPtr(hSyncHandleInt2, (IMG_VOID **) &psSyncHandleInt); + + 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 ui32BridgeID, + 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; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_SYNC_SERVERSYNCGETSTATUS); + + + 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_HANDLE *) &hSyncHandleInt2[i], + hSyncHandleInt2[i], + PVRSRV_HANDLE_TYPE_SERVER_SYNC_PRIMITIVE); + if(psServerSyncGetStatusOUT->eError != PVRSRV_OK) + { + goto ServerSyncGetStatus_exit; + } + + /* Look up the data from the resman address */ + psServerSyncGetStatusOUT->eError = ResManFindPrivateDataByPtr(hSyncHandleInt2[i], (IMG_VOID **) &psSyncHandleInt[i]); + + 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 ui32BridgeID, + 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; + IMG_HANDLE hServerCookieInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_SYNC_SYNCPRIMOPCREATE); + + + + + 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_HANDLE *) &hBlockListInt2[i], + hBlockListInt2[i], + PVRSRV_HANDLE_TYPE_SYNC_PRIMITIVE_BLOCK); + if(psSyncPrimOpCreateOUT->eError != PVRSRV_OK) + { + goto SyncPrimOpCreate_exit; + } + + /* Look up the data from the resman address */ + psSyncPrimOpCreateOUT->eError = ResManFindPrivateDataByPtr(hBlockListInt2[i], (IMG_VOID **) &psBlockListInt[i]); + + 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_HANDLE *) &hServerSyncInt2[i], + psSyncPrimOpCreateIN->phServerSync[i], + PVRSRV_HANDLE_TYPE_SERVER_SYNC_PRIMITIVE); + if(psSyncPrimOpCreateOUT->eError != PVRSRV_OK) + { + goto SyncPrimOpCreate_exit; + } + + /* Look up the data from the resman address */ + psSyncPrimOpCreateOUT->eError = ResManFindPrivateDataByPtr(hServerSyncInt2[i], (IMG_VOID **) &psServerSyncInt[i]); + + 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; + } + + /* Create a resman item and overwrite the handle with it */ + hServerCookieInt2 = ResManRegisterRes(psConnection->hResManContext, + RESMAN_TYPE_SERVER_OP_COOKIE, + psServerCookieInt, + (RESMAN_FREE_FN)&PVRSRVSyncPrimOpDestroyKM); + if (hServerCookieInt2 == IMG_NULL) + { + psSyncPrimOpCreateOUT->eError = PVRSRV_ERROR_UNABLE_TO_REGISTER_RESOURCE; + goto SyncPrimOpCreate_exit; + } + psSyncPrimOpCreateOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psSyncPrimOpCreateOUT->hServerCookie, + (IMG_HANDLE) hServerCookieInt2, + PVRSRV_HANDLE_TYPE_SERVER_OP_COOKIE, + PVRSRV_HANDLE_ALLOC_FLAG_NONE + ); + if (psSyncPrimOpCreateOUT->eError != PVRSRV_OK) + { + goto SyncPrimOpCreate_exit; + } + + +SyncPrimOpCreate_exit: + if (psSyncPrimOpCreateOUT->eError != PVRSRV_OK) + { + /* If we have a valid resman item we should undo the bridge function by freeing the resman item */ + if (hServerCookieInt2) + { + PVRSRV_ERROR eError = ResManFreeResByPtr(hServerCookieInt2); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + } + else 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 ui32BridgeID, + PVRSRV_BRIDGE_IN_SYNCPRIMOPTAKE *psSyncPrimOpTakeIN, + PVRSRV_BRIDGE_OUT_SYNCPRIMOPTAKE *psSyncPrimOpTakeOUT, + CONNECTION_DATA *psConnection) +{ + SERVER_OP_COOKIE * psServerCookieInt = IMG_NULL; + IMG_HANDLE hServerCookieInt2 = IMG_NULL; + IMG_UINT32 *ui32FlagsInt = IMG_NULL; + IMG_UINT32 *ui32FenceValueInt = IMG_NULL; + IMG_UINT32 *ui32UpdateValueInt = IMG_NULL; + IMG_UINT32 *ui32ServerFlagsInt = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_SYNC_SYNCPRIMOPTAKE); + + + + + 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_HANDLE *) &hServerCookieInt2, + psSyncPrimOpTakeIN->hServerCookie, + PVRSRV_HANDLE_TYPE_SERVER_OP_COOKIE); + if(psSyncPrimOpTakeOUT->eError != PVRSRV_OK) + { + goto SyncPrimOpTake_exit; + } + + /* Look up the data from the resman address */ + psSyncPrimOpTakeOUT->eError = ResManFindPrivateDataByPtr(hServerCookieInt2, (IMG_VOID **) &psServerCookieInt); + + 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 ui32BridgeID, + PVRSRV_BRIDGE_IN_SYNCPRIMOPREADY *psSyncPrimOpReadyIN, + PVRSRV_BRIDGE_OUT_SYNCPRIMOPREADY *psSyncPrimOpReadyOUT, + CONNECTION_DATA *psConnection) +{ + SERVER_OP_COOKIE * psServerCookieInt = IMG_NULL; + IMG_HANDLE hServerCookieInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_SYNC_SYNCPRIMOPREADY); + + + + + + { + /* Look up the address from the handle */ + psSyncPrimOpReadyOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hServerCookieInt2, + psSyncPrimOpReadyIN->hServerCookie, + PVRSRV_HANDLE_TYPE_SERVER_OP_COOKIE); + if(psSyncPrimOpReadyOUT->eError != PVRSRV_OK) + { + goto SyncPrimOpReady_exit; + } + + /* Look up the data from the resman address */ + psSyncPrimOpReadyOUT->eError = ResManFindPrivateDataByPtr(hServerCookieInt2, (IMG_VOID **) &psServerCookieInt); + + if(psSyncPrimOpReadyOUT->eError != PVRSRV_OK) + { + goto SyncPrimOpReady_exit; + } + } + + psSyncPrimOpReadyOUT->eError = + PVRSRVSyncPrimOpReadyKM( + psServerCookieInt, + &psSyncPrimOpReadyOUT->bReady); + + + +SyncPrimOpReady_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeSyncPrimOpComplete(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_SYNCPRIMOPCOMPLETE *psSyncPrimOpCompleteIN, + PVRSRV_BRIDGE_OUT_SYNCPRIMOPCOMPLETE *psSyncPrimOpCompleteOUT, + CONNECTION_DATA *psConnection) +{ + SERVER_OP_COOKIE * psServerCookieInt = IMG_NULL; + IMG_HANDLE hServerCookieInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_SYNC_SYNCPRIMOPCOMPLETE); + + + + + + { + /* Look up the address from the handle */ + psSyncPrimOpCompleteOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hServerCookieInt2, + psSyncPrimOpCompleteIN->hServerCookie, + PVRSRV_HANDLE_TYPE_SERVER_OP_COOKIE); + if(psSyncPrimOpCompleteOUT->eError != PVRSRV_OK) + { + goto SyncPrimOpComplete_exit; + } + + /* Look up the data from the resman address */ + psSyncPrimOpCompleteOUT->eError = ResManFindPrivateDataByPtr(hServerCookieInt2, (IMG_VOID **) &psServerCookieInt); + + if(psSyncPrimOpCompleteOUT->eError != PVRSRV_OK) + { + goto SyncPrimOpComplete_exit; + } + } + + psSyncPrimOpCompleteOUT->eError = + PVRSRVSyncPrimOpCompleteKM( + psServerCookieInt); + + + +SyncPrimOpComplete_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeSyncPrimOpDestroy(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_SYNCPRIMOPDESTROY *psSyncPrimOpDestroyIN, + PVRSRV_BRIDGE_OUT_SYNCPRIMOPDESTROY *psSyncPrimOpDestroyOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hServerCookieInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_SYNC_SYNCPRIMOPDESTROY); + + + + + + { + /* Look up the address from the handle */ + psSyncPrimOpDestroyOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hServerCookieInt2, + psSyncPrimOpDestroyIN->hServerCookie, + PVRSRV_HANDLE_TYPE_SERVER_OP_COOKIE); + if(psSyncPrimOpDestroyOUT->eError != PVRSRV_OK) + { + goto SyncPrimOpDestroy_exit; + } + + } + + psSyncPrimOpDestroyOUT->eError = SyncPrimOpDestroyResManProxy(hServerCookieInt2); + /* Exit early if bridged call fails */ + if(psSyncPrimOpDestroyOUT->eError != PVRSRV_OK) + { + goto SyncPrimOpDestroy_exit; + } + + psSyncPrimOpDestroyOUT->eError = + PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psSyncPrimOpDestroyIN->hServerCookie, + PVRSRV_HANDLE_TYPE_SERVER_OP_COOKIE); + + +SyncPrimOpDestroy_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeSyncPrimPDump(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_SYNCPRIMPDUMP *psSyncPrimPDumpIN, + PVRSRV_BRIDGE_OUT_SYNCPRIMPDUMP *psSyncPrimPDumpOUT, + CONNECTION_DATA *psConnection) +{ + SYNC_PRIMITIVE_BLOCK * psSyncHandleInt = IMG_NULL; + IMG_HANDLE hSyncHandleInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_SYNC_SYNCPRIMPDUMP); + + + + + + { + /* Look up the address from the handle */ + psSyncPrimPDumpOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hSyncHandleInt2, + psSyncPrimPDumpIN->hSyncHandle, + PVRSRV_HANDLE_TYPE_SYNC_PRIMITIVE_BLOCK); + if(psSyncPrimPDumpOUT->eError != PVRSRV_OK) + { + goto SyncPrimPDump_exit; + } + + /* Look up the data from the resman address */ + psSyncPrimPDumpOUT->eError = ResManFindPrivateDataByPtr(hSyncHandleInt2, (IMG_VOID **) &psSyncHandleInt); + + if(psSyncPrimPDumpOUT->eError != PVRSRV_OK) + { + goto SyncPrimPDump_exit; + } + } + + psSyncPrimPDumpOUT->eError = + PVRSRVSyncPrimPDumpKM( + psSyncHandleInt, + psSyncPrimPDumpIN->ui32Offset); + + + +SyncPrimPDump_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeSyncPrimPDumpValue(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_SYNCPRIMPDUMPVALUE *psSyncPrimPDumpValueIN, + PVRSRV_BRIDGE_OUT_SYNCPRIMPDUMPVALUE *psSyncPrimPDumpValueOUT, + CONNECTION_DATA *psConnection) +{ + SYNC_PRIMITIVE_BLOCK * psSyncHandleInt = IMG_NULL; + IMG_HANDLE hSyncHandleInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_SYNC_SYNCPRIMPDUMPVALUE); + + + + + + { + /* Look up the address from the handle */ + psSyncPrimPDumpValueOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hSyncHandleInt2, + psSyncPrimPDumpValueIN->hSyncHandle, + PVRSRV_HANDLE_TYPE_SYNC_PRIMITIVE_BLOCK); + if(psSyncPrimPDumpValueOUT->eError != PVRSRV_OK) + { + goto SyncPrimPDumpValue_exit; + } + + /* Look up the data from the resman address */ + psSyncPrimPDumpValueOUT->eError = ResManFindPrivateDataByPtr(hSyncHandleInt2, (IMG_VOID **) &psSyncHandleInt); + + 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 ui32BridgeID, + PVRSRV_BRIDGE_IN_SYNCPRIMPDUMPPOL *psSyncPrimPDumpPolIN, + PVRSRV_BRIDGE_OUT_SYNCPRIMPDUMPPOL *psSyncPrimPDumpPolOUT, + CONNECTION_DATA *psConnection) +{ + SYNC_PRIMITIVE_BLOCK * psSyncHandleInt = IMG_NULL; + IMG_HANDLE hSyncHandleInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_SYNC_SYNCPRIMPDUMPPOL); + + + + + + { + /* Look up the address from the handle */ + psSyncPrimPDumpPolOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hSyncHandleInt2, + psSyncPrimPDumpPolIN->hSyncHandle, + PVRSRV_HANDLE_TYPE_SYNC_PRIMITIVE_BLOCK); + if(psSyncPrimPDumpPolOUT->eError != PVRSRV_OK) + { + goto SyncPrimPDumpPol_exit; + } + + /* Look up the data from the resman address */ + psSyncPrimPDumpPolOUT->eError = ResManFindPrivateDataByPtr(hSyncHandleInt2, (IMG_VOID **) &psSyncHandleInt); + + 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 ui32BridgeID, + PVRSRV_BRIDGE_IN_SYNCPRIMOPPDUMPPOL *psSyncPrimOpPDumpPolIN, + PVRSRV_BRIDGE_OUT_SYNCPRIMOPPDUMPPOL *psSyncPrimOpPDumpPolOUT, + CONNECTION_DATA *psConnection) +{ + SERVER_OP_COOKIE * psServerCookieInt = IMG_NULL; + IMG_HANDLE hServerCookieInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_SYNC_SYNCPRIMOPPDUMPPOL); + + + + + + { + /* Look up the address from the handle */ + psSyncPrimOpPDumpPolOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hServerCookieInt2, + psSyncPrimOpPDumpPolIN->hServerCookie, + PVRSRV_HANDLE_TYPE_SERVER_OP_COOKIE); + if(psSyncPrimOpPDumpPolOUT->eError != PVRSRV_OK) + { + goto SyncPrimOpPDumpPol_exit; + } + + /* Look up the data from the resman address */ + psSyncPrimOpPDumpPolOUT->eError = ResManFindPrivateDataByPtr(hServerCookieInt2, (IMG_VOID **) &psServerCookieInt); + + 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 ui32BridgeID, + PVRSRV_BRIDGE_IN_SYNCPRIMPDUMPCBP *psSyncPrimPDumpCBPIN, + PVRSRV_BRIDGE_OUT_SYNCPRIMPDUMPCBP *psSyncPrimPDumpCBPOUT, + CONNECTION_DATA *psConnection) +{ + SYNC_PRIMITIVE_BLOCK * psSyncHandleInt = IMG_NULL; + IMG_HANDLE hSyncHandleInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_SYNC_SYNCPRIMPDUMPCBP); + + + + + + { + /* Look up the address from the handle */ + psSyncPrimPDumpCBPOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hSyncHandleInt2, + psSyncPrimPDumpCBPIN->hSyncHandle, + PVRSRV_HANDLE_TYPE_SYNC_PRIMITIVE_BLOCK); + if(psSyncPrimPDumpCBPOUT->eError != PVRSRV_OK) + { + goto SyncPrimPDumpCBP_exit; + } + + /* Look up the data from the resman address */ + psSyncPrimPDumpCBPOUT->eError = ResManFindPrivateDataByPtr(hSyncHandleInt2, (IMG_VOID **) &psSyncHandleInt); + + 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 RegisterSYNCFunctions(IMG_VOID); +IMG_VOID UnregisterSYNCFunctions(IMG_VOID); + +/* + * Register all SYNC functions with services + */ +PVRSRV_ERROR RegisterSYNCFunctions(IMG_VOID) +{ + SetDispatchTableEntry(PVRSRV_BRIDGE_SYNC_ALLOCSYNCPRIMITIVEBLOCK, PVRSRVBridgeAllocSyncPrimitiveBlock); + SetDispatchTableEntry(PVRSRV_BRIDGE_SYNC_FREESYNCPRIMITIVEBLOCK, PVRSRVBridgeFreeSyncPrimitiveBlock); + SetDispatchTableEntry(PVRSRV_BRIDGE_SYNC_SYNCPRIMSET, PVRSRVBridgeSyncPrimSet); + SetDispatchTableEntry(PVRSRV_BRIDGE_SYNC_SERVERSYNCPRIMSET, PVRSRVBridgeServerSyncPrimSet); + SetDispatchTableEntry(PVRSRV_BRIDGE_SYNC_SYNCRECORDREMOVEBYHANDLE, PVRSRVBridgeSyncRecordRemoveByHandle); + SetDispatchTableEntry(PVRSRV_BRIDGE_SYNC_SYNCRECORDADD, PVRSRVBridgeSyncRecordAdd); + SetDispatchTableEntry(PVRSRV_BRIDGE_SYNC_SERVERSYNCALLOC, PVRSRVBridgeServerSyncAlloc); + SetDispatchTableEntry(PVRSRV_BRIDGE_SYNC_SERVERSYNCFREE, PVRSRVBridgeServerSyncFree); + SetDispatchTableEntry(PVRSRV_BRIDGE_SYNC_SERVERSYNCQUEUEHWOP, PVRSRVBridgeServerSyncQueueHWOp); + SetDispatchTableEntry(PVRSRV_BRIDGE_SYNC_SERVERSYNCGETSTATUS, PVRSRVBridgeServerSyncGetStatus); + SetDispatchTableEntry(PVRSRV_BRIDGE_SYNC_SYNCPRIMOPCREATE, PVRSRVBridgeSyncPrimOpCreate); + SetDispatchTableEntry(PVRSRV_BRIDGE_SYNC_SYNCPRIMOPTAKE, PVRSRVBridgeSyncPrimOpTake); + SetDispatchTableEntry(PVRSRV_BRIDGE_SYNC_SYNCPRIMOPREADY, PVRSRVBridgeSyncPrimOpReady); + SetDispatchTableEntry(PVRSRV_BRIDGE_SYNC_SYNCPRIMOPCOMPLETE, PVRSRVBridgeSyncPrimOpComplete); + SetDispatchTableEntry(PVRSRV_BRIDGE_SYNC_SYNCPRIMOPDESTROY, PVRSRVBridgeSyncPrimOpDestroy); + SetDispatchTableEntry(PVRSRV_BRIDGE_SYNC_SYNCPRIMPDUMP, PVRSRVBridgeSyncPrimPDump); + SetDispatchTableEntry(PVRSRV_BRIDGE_SYNC_SYNCPRIMPDUMPVALUE, PVRSRVBridgeSyncPrimPDumpValue); + SetDispatchTableEntry(PVRSRV_BRIDGE_SYNC_SYNCPRIMPDUMPPOL, PVRSRVBridgeSyncPrimPDumpPol); + SetDispatchTableEntry(PVRSRV_BRIDGE_SYNC_SYNCPRIMOPPDUMPPOL, PVRSRVBridgeSyncPrimOpPDumpPol); + SetDispatchTableEntry(PVRSRV_BRIDGE_SYNC_SYNCPRIMPDUMPCBP, PVRSRVBridgeSyncPrimPDumpCBP); + + return PVRSRV_OK; +} + +/* + * Unregister all sync functions with services + */ +IMG_VOID UnregisterSYNCFunctions(IMG_VOID) +{ +} diff --git a/drivers/gpu/rogue/generated/syncexport_bridge/common_syncexport_bridge.h b/drivers/gpu/rogue/generated/syncexport_bridge/common_syncexport_bridge.h new file mode 100644 index 000000000000..1673d872a39b --- /dev/null +++ b/drivers/gpu/rogue/generated/syncexport_bridge/common_syncexport_bridge.h @@ -0,0 +1,113 @@ +/*************************************************************************/ /*! +@File +@Title Common bridge header for syncexport +@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 syncexport +@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_SYNCEXPORT_BRIDGE_H +#define COMMON_SYNCEXPORT_BRIDGE_H + + + +#include "pvr_bridge_io.h" + +#define PVRSRV_BRIDGE_SYNCEXPORT_CMD_FIRST (PVRSRV_BRIDGE_SYNCEXPORT_START) +#define PVRSRV_BRIDGE_SYNCEXPORT_SYNCPRIMSERVEREXPORT PVRSRV_IOWR(PVRSRV_BRIDGE_SYNCEXPORT_CMD_FIRST+0) +#define PVRSRV_BRIDGE_SYNCEXPORT_SYNCPRIMSERVERUNEXPORT PVRSRV_IOWR(PVRSRV_BRIDGE_SYNCEXPORT_CMD_FIRST+1) +#define PVRSRV_BRIDGE_SYNCEXPORT_SYNCPRIMSERVERIMPORT PVRSRV_IOWR(PVRSRV_BRIDGE_SYNCEXPORT_CMD_FIRST+2) +#define PVRSRV_BRIDGE_SYNCEXPORT_CMD_LAST (PVRSRV_BRIDGE_SYNCEXPORT_CMD_FIRST+2) + + +/******************************************* + SyncPrimServerExport + *******************************************/ + +/* Bridge in structure for SyncPrimServerExport */ +typedef struct PVRSRV_BRIDGE_IN_SYNCPRIMSERVEREXPORT_TAG +{ + IMG_HANDLE hSyncHandle; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_SYNCPRIMSERVEREXPORT; + + +/* Bridge out structure for SyncPrimServerExport */ +typedef struct PVRSRV_BRIDGE_OUT_SYNCPRIMSERVEREXPORT_TAG +{ + IMG_HANDLE hExport; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_SYNCPRIMSERVEREXPORT; + +/******************************************* + SyncPrimServerUnexport + *******************************************/ + +/* Bridge in structure for SyncPrimServerUnexport */ +typedef struct PVRSRV_BRIDGE_IN_SYNCPRIMSERVERUNEXPORT_TAG +{ + IMG_HANDLE hExport; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_SYNCPRIMSERVERUNEXPORT; + + +/* Bridge out structure for SyncPrimServerUnexport */ +typedef struct PVRSRV_BRIDGE_OUT_SYNCPRIMSERVERUNEXPORT_TAG +{ + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_SYNCPRIMSERVERUNEXPORT; + +/******************************************* + SyncPrimServerImport + *******************************************/ + +/* Bridge in structure for SyncPrimServerImport */ +typedef struct PVRSRV_BRIDGE_IN_SYNCPRIMSERVERIMPORT_TAG +{ + IMG_HANDLE hImport; +} __attribute__((packed)) PVRSRV_BRIDGE_IN_SYNCPRIMSERVERIMPORT; + + +/* Bridge out structure for SyncPrimServerImport */ +typedef struct PVRSRV_BRIDGE_OUT_SYNCPRIMSERVERIMPORT_TAG +{ + IMG_HANDLE hSyncHandle; + IMG_UINT32 ui32SyncPrimVAddr; + PVRSRV_ERROR eError; +} __attribute__((packed)) PVRSRV_BRIDGE_OUT_SYNCPRIMSERVERIMPORT; + +#endif /* COMMON_SYNCEXPORT_BRIDGE_H */ diff --git a/drivers/gpu/rogue/generated/syncexport_bridge/server_syncexport_bridge.c b/drivers/gpu/rogue/generated/syncexport_bridge/server_syncexport_bridge.c new file mode 100644 index 000000000000..8146ec30cfbf --- /dev/null +++ b/drivers/gpu/rogue/generated/syncexport_bridge/server_syncexport_bridge.c @@ -0,0 +1,366 @@ +/*************************************************************************/ /*! +@File +@Title Server bridge for syncexport +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Implements the server side of the bridge for syncexport +@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_syncexport_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 + +/* *************************************************************************** + * Bridge proxy functions + */ + +static PVRSRV_ERROR +SyncPrimServerUnexportResManProxy(IMG_HANDLE hResmanItem) +{ + PVRSRV_ERROR eError; + + eError = ResManFreeResByPtr(hResmanItem); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + + return eError; +} + + + +/* *************************************************************************** + * Server-side bridge entry points + */ + +static IMG_INT +PVRSRVBridgeSyncPrimServerExport(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_SYNCPRIMSERVEREXPORT *psSyncPrimServerExportIN, + PVRSRV_BRIDGE_OUT_SYNCPRIMSERVEREXPORT *psSyncPrimServerExportOUT, + CONNECTION_DATA *psConnection) +{ + SERVER_SYNC_PRIMITIVE * psSyncHandleInt = IMG_NULL; + IMG_HANDLE hSyncHandleInt2 = IMG_NULL; + SERVER_SYNC_EXPORT * psExportInt = IMG_NULL; + IMG_HANDLE hExportInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_SYNCEXPORT_SYNCPRIMSERVEREXPORT); + + + + + + { + /* Look up the address from the handle */ + psSyncPrimServerExportOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hSyncHandleInt2, + psSyncPrimServerExportIN->hSyncHandle, + PVRSRV_HANDLE_TYPE_SERVER_SYNC_PRIMITIVE); + if(psSyncPrimServerExportOUT->eError != PVRSRV_OK) + { + goto SyncPrimServerExport_exit; + } + + /* Look up the data from the resman address */ + psSyncPrimServerExportOUT->eError = ResManFindPrivateDataByPtr(hSyncHandleInt2, (IMG_VOID **) &psSyncHandleInt); + + if(psSyncPrimServerExportOUT->eError != PVRSRV_OK) + { + goto SyncPrimServerExport_exit; + } + } + + psSyncPrimServerExportOUT->eError = + PVRSRVSyncPrimServerExportKM( + psSyncHandleInt, + &psExportInt); + /* Exit early if bridged call fails */ + if(psSyncPrimServerExportOUT->eError != PVRSRV_OK) + { + goto SyncPrimServerExport_exit; + } + + /* Create a resman item and overwrite the handle with it */ + hExportInt2 = ResManRegisterRes(psConnection->hResManContext, + RESMAN_TYPE_SERVER_SYNC_EXPORT, + psExportInt, + (RESMAN_FREE_FN)&PVRSRVSyncPrimServerUnexportKM); + if (hExportInt2 == IMG_NULL) + { + psSyncPrimServerExportOUT->eError = PVRSRV_ERROR_UNABLE_TO_REGISTER_RESOURCE; + goto SyncPrimServerExport_exit; + } + /* see if it's already exported */ + psSyncPrimServerExportOUT->eError = + PVRSRVFindHandle(KERNEL_HANDLE_BASE, + &psSyncPrimServerExportOUT->hExport, + (IMG_HANDLE) hExportInt2, + PVRSRV_HANDLE_TYPE_SERVER_SYNC_EXPORT); + if(psSyncPrimServerExportOUT->eError == PVRSRV_OK) + { + /* It's already exported */ + return 0; + } + + psSyncPrimServerExportOUT->eError = PVRSRVAllocHandle(KERNEL_HANDLE_BASE, + &psSyncPrimServerExportOUT->hExport, + (IMG_HANDLE) hExportInt2, + PVRSRV_HANDLE_TYPE_SERVER_SYNC_EXPORT, + PVRSRV_HANDLE_ALLOC_FLAG_NONE + ); + if (psSyncPrimServerExportOUT->eError != PVRSRV_OK) + { + goto SyncPrimServerExport_exit; + } + + +SyncPrimServerExport_exit: + if (psSyncPrimServerExportOUT->eError != PVRSRV_OK) + { + /* If we have a valid resman item we should undo the bridge function by freeing the resman item */ + if (hExportInt2) + { + PVRSRV_ERROR eError = ResManFreeResByPtr(hExportInt2); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + } + else if (psExportInt) + { + PVRSRVSyncPrimServerUnexportKM(psExportInt); + } + } + + + return 0; +} + +static IMG_INT +PVRSRVBridgeSyncPrimServerUnexport(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_SYNCPRIMSERVERUNEXPORT *psSyncPrimServerUnexportIN, + PVRSRV_BRIDGE_OUT_SYNCPRIMSERVERUNEXPORT *psSyncPrimServerUnexportOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hExportInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_SYNCEXPORT_SYNCPRIMSERVERUNEXPORT); + + PVR_UNREFERENCED_PARAMETER(psConnection); + + + + + { + /* Look up the address from the handle */ + psSyncPrimServerUnexportOUT->eError = + PVRSRVLookupHandle(KERNEL_HANDLE_BASE, + (IMG_HANDLE *) &hExportInt2, + psSyncPrimServerUnexportIN->hExport, + PVRSRV_HANDLE_TYPE_SERVER_SYNC_EXPORT); + if(psSyncPrimServerUnexportOUT->eError != PVRSRV_OK) + { + goto SyncPrimServerUnexport_exit; + } + + } + + psSyncPrimServerUnexportOUT->eError = SyncPrimServerUnexportResManProxy(hExportInt2); + /* Exit early if bridged call fails */ + if(psSyncPrimServerUnexportOUT->eError != PVRSRV_OK) + { + goto SyncPrimServerUnexport_exit; + } + + psSyncPrimServerUnexportOUT->eError = + PVRSRVReleaseHandle(KERNEL_HANDLE_BASE, + (IMG_HANDLE) psSyncPrimServerUnexportIN->hExport, + PVRSRV_HANDLE_TYPE_SERVER_SYNC_EXPORT); + + +SyncPrimServerUnexport_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeSyncPrimServerImport(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_SYNCPRIMSERVERIMPORT *psSyncPrimServerImportIN, + PVRSRV_BRIDGE_OUT_SYNCPRIMSERVERIMPORT *psSyncPrimServerImportOUT, + CONNECTION_DATA *psConnection) +{ + SERVER_SYNC_EXPORT * psImportInt = IMG_NULL; + IMG_HANDLE hImportInt2 = IMG_NULL; + SERVER_SYNC_PRIMITIVE * psSyncHandleInt = IMG_NULL; + IMG_HANDLE hSyncHandleInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_SYNCEXPORT_SYNCPRIMSERVERIMPORT); + + + + +#if defined (SUPPORT_AUTH) + psSyncPrimServerImportOUT->eError = OSCheckAuthentication(psConnection, 1); + if (psSyncPrimServerImportOUT->eError != PVRSRV_OK) + { + goto SyncPrimServerImport_exit; + } +#endif + + { + /* Look up the address from the handle */ + psSyncPrimServerImportOUT->eError = + PVRSRVLookupHandle(KERNEL_HANDLE_BASE, + (IMG_HANDLE *) &hImportInt2, + psSyncPrimServerImportIN->hImport, + PVRSRV_HANDLE_TYPE_SERVER_SYNC_EXPORT); + if(psSyncPrimServerImportOUT->eError != PVRSRV_OK) + { + goto SyncPrimServerImport_exit; + } + + /* Look up the data from the resman address */ + psSyncPrimServerImportOUT->eError = ResManFindPrivateDataByPtr(hImportInt2, (IMG_VOID **) &psImportInt); + + if(psSyncPrimServerImportOUT->eError != PVRSRV_OK) + { + goto SyncPrimServerImport_exit; + } + } + + psSyncPrimServerImportOUT->eError = + PVRSRVSyncPrimServerImportKM( + psImportInt, + &psSyncHandleInt, + &psSyncPrimServerImportOUT->ui32SyncPrimVAddr); + /* Exit early if bridged call fails */ + if(psSyncPrimServerImportOUT->eError != PVRSRV_OK) + { + goto SyncPrimServerImport_exit; + } + + /* Create a resman item and overwrite the handle with it */ + hSyncHandleInt2 = ResManRegisterRes(psConnection->hResManContext, + RESMAN_TYPE_SERVER_SYNC_PRIMITIVE, + psSyncHandleInt, + (RESMAN_FREE_FN)&PVRSRVServerSyncFreeKM); + if (hSyncHandleInt2 == IMG_NULL) + { + psSyncPrimServerImportOUT->eError = PVRSRV_ERROR_UNABLE_TO_REGISTER_RESOURCE; + goto SyncPrimServerImport_exit; + } + psSyncPrimServerImportOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psSyncPrimServerImportOUT->hSyncHandle, + (IMG_HANDLE) hSyncHandleInt2, + PVRSRV_HANDLE_TYPE_SERVER_SYNC_PRIMITIVE, + PVRSRV_HANDLE_ALLOC_FLAG_NONE + ); + if (psSyncPrimServerImportOUT->eError != PVRSRV_OK) + { + goto SyncPrimServerImport_exit; + } + + +SyncPrimServerImport_exit: + if (psSyncPrimServerImportOUT->eError != PVRSRV_OK) + { + /* If we have a valid resman item we should undo the bridge function by freeing the resman item */ + if (hSyncHandleInt2) + { + PVRSRV_ERROR eError = ResManFreeResByPtr(hSyncHandleInt2); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + } + else if (psSyncHandleInt) + { + PVRSRVServerSyncFreeKM(psSyncHandleInt); + } + } + + + return 0; +} + + + +/* *************************************************************************** + * Server bridge dispatch related glue + */ + +PVRSRV_ERROR RegisterSYNCEXPORTFunctions(IMG_VOID); +IMG_VOID UnregisterSYNCEXPORTFunctions(IMG_VOID); + +/* + * Register all SYNCEXPORT functions with services + */ +PVRSRV_ERROR RegisterSYNCEXPORTFunctions(IMG_VOID) +{ + SetDispatchTableEntry(PVRSRV_BRIDGE_SYNCEXPORT_SYNCPRIMSERVEREXPORT, PVRSRVBridgeSyncPrimServerExport); + SetDispatchTableEntry(PVRSRV_BRIDGE_SYNCEXPORT_SYNCPRIMSERVERUNEXPORT, PVRSRVBridgeSyncPrimServerUnexport); + SetDispatchTableEntry(PVRSRV_BRIDGE_SYNCEXPORT_SYNCPRIMSERVERIMPORT, PVRSRVBridgeSyncPrimServerImport); + + return PVRSRV_OK; +} + +/* + * Unregister all syncexport functions with services + */ +IMG_VOID UnregisterSYNCEXPORTFunctions(IMG_VOID) +{ +} diff --git a/drivers/gpu/rogue/generated/syncsexport_bridge/common_syncsexport_bridge.h b/drivers/gpu/rogue/generated/syncsexport_bridge/common_syncsexport_bridge.h new file mode 100644 index 000000000000..8c2b4cf6b92b --- /dev/null +++ b/drivers/gpu/rogue/generated/syncsexport_bridge/common_syncsexport_bridge.h @@ -0,0 +1,113 @@ +/*************************************************************************/ /*! +@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 "pvr_bridge_io.h" + +#define PVRSRV_BRIDGE_SYNCSEXPORT_CMD_FIRST (PVRSRV_BRIDGE_SYNCSEXPORT_START) +#define PVRSRV_BRIDGE_SYNCSEXPORT_SYNCPRIMSERVERSECUREEXPORT PVRSRV_IOWR(PVRSRV_BRIDGE_SYNCSEXPORT_CMD_FIRST+0) +#define PVRSRV_BRIDGE_SYNCSEXPORT_SYNCPRIMSERVERSECUREUNEXPORT PVRSRV_IOWR(PVRSRV_BRIDGE_SYNCSEXPORT_CMD_FIRST+1) +#define PVRSRV_BRIDGE_SYNCSEXPORT_SYNCPRIMSERVERSECUREIMPORT PVRSRV_IOWR(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/generated/syncsexport_bridge/server_syncsexport_bridge.c b/drivers/gpu/rogue/generated/syncsexport_bridge/server_syncsexport_bridge.c new file mode 100644 index 000000000000..52751a16f632 --- /dev/null +++ b/drivers/gpu/rogue/generated/syncsexport_bridge/server_syncsexport_bridge.c @@ -0,0 +1,315 @@ +/*************************************************************************/ /*! +@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 + +/* *************************************************************************** + * Bridge proxy functions + */ + +static PVRSRV_ERROR +SyncPrimServerSecureUnexportResManProxy(IMG_HANDLE hResmanItem) +{ + PVRSRV_ERROR eError; + + eError = ResManFreeResByPtr(hResmanItem); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + + return eError; +} + + + +/* *************************************************************************** + * Server-side bridge entry points + */ + +static IMG_INT +PVRSRVBridgeSyncPrimServerSecureExport(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_SYNCPRIMSERVERSECUREEXPORT *psSyncPrimServerSecureExportIN, + PVRSRV_BRIDGE_OUT_SYNCPRIMSERVERSECUREEXPORT *psSyncPrimServerSecureExportOUT, + CONNECTION_DATA *psConnection) +{ + SERVER_SYNC_PRIMITIVE * psSyncHandleInt = IMG_NULL; + IMG_HANDLE hSyncHandleInt2 = IMG_NULL; + SERVER_SYNC_EXPORT * psExportInt = IMG_NULL; + IMG_HANDLE hExportInt2 = IMG_NULL; + CONNECTION_DATA *psSecureConnection; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_SYNCSEXPORT_SYNCPRIMSERVERSECUREEXPORT); + + + + + + { + /* Look up the address from the handle */ + psSyncPrimServerSecureExportOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hSyncHandleInt2, + psSyncPrimServerSecureExportIN->hSyncHandle, + PVRSRV_HANDLE_TYPE_SERVER_SYNC_PRIMITIVE); + if(psSyncPrimServerSecureExportOUT->eError != PVRSRV_OK) + { + goto SyncPrimServerSecureExport_exit; + } + + /* Look up the data from the resman address */ + psSyncPrimServerSecureExportOUT->eError = ResManFindPrivateDataByPtr(hSyncHandleInt2, (IMG_VOID **) &psSyncHandleInt); + + 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; + } + + /* Create a resman item and overwrite the handle with it */ + hExportInt2 = ResManRegisterRes(psSecureConnection->hResManContext, + RESMAN_TYPE_SERVER_SYNC_EXPORT, + psExportInt, + (RESMAN_FREE_FN)&PVRSRVSyncPrimServerSecureUnexportKM); + if (hExportInt2 == IMG_NULL) + { + psSyncPrimServerSecureExportOUT->eError = PVRSRV_ERROR_UNABLE_TO_REGISTER_RESOURCE; + goto SyncPrimServerSecureExport_exit; + } + + +SyncPrimServerSecureExport_exit: + if (psSyncPrimServerSecureExportOUT->eError != PVRSRV_OK) + { + /* If we have a valid resman item we should undo the bridge function by freeing the resman item */ + if (hExportInt2) + { + PVRSRV_ERROR eError = ResManFreeResByPtr(hExportInt2); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + } + else if (psExportInt) + { + PVRSRVSyncPrimServerSecureUnexportKM(psExportInt); + } + } + + + return 0; +} + +static IMG_INT +PVRSRVBridgeSyncPrimServerSecureUnexport(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_SYNCPRIMSERVERSECUREUNEXPORT *psSyncPrimServerSecureUnexportIN, + PVRSRV_BRIDGE_OUT_SYNCPRIMSERVERSECUREUNEXPORT *psSyncPrimServerSecureUnexportOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hExportInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_SYNCSEXPORT_SYNCPRIMSERVERSECUREUNEXPORT); + + + + + + { + /* Look up the address from the handle */ + psSyncPrimServerSecureUnexportOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &hExportInt2, + psSyncPrimServerSecureUnexportIN->hExport, + PVRSRV_HANDLE_TYPE_SERVER_SYNC_EXPORT); + if(psSyncPrimServerSecureUnexportOUT->eError != PVRSRV_OK) + { + goto SyncPrimServerSecureUnexport_exit; + } + + } + + psSyncPrimServerSecureUnexportOUT->eError = SyncPrimServerSecureUnexportResManProxy(hExportInt2); + /* Exit early if bridged call fails */ + if(psSyncPrimServerSecureUnexportOUT->eError != PVRSRV_OK) + { + goto SyncPrimServerSecureUnexport_exit; + } + + psSyncPrimServerSecureUnexportOUT->eError = + PVRSRVReleaseHandle(psConnection->psHandleBase, + (IMG_HANDLE) psSyncPrimServerSecureUnexportIN->hExport, + PVRSRV_HANDLE_TYPE_SERVER_SYNC_EXPORT); + + +SyncPrimServerSecureUnexport_exit: + + return 0; +} + +static IMG_INT +PVRSRVBridgeSyncPrimServerSecureImport(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_SYNCPRIMSERVERSECUREIMPORT *psSyncPrimServerSecureImportIN, + PVRSRV_BRIDGE_OUT_SYNCPRIMSERVERSECUREIMPORT *psSyncPrimServerSecureImportOUT, + CONNECTION_DATA *psConnection) +{ + SERVER_SYNC_PRIMITIVE * psSyncHandleInt = IMG_NULL; + IMG_HANDLE hSyncHandleInt2 = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_SYNCSEXPORT_SYNCPRIMSERVERSECUREIMPORT); + + + + + + psSyncPrimServerSecureImportOUT->eError = + PVRSRVSyncPrimServerSecureImportKM( + psSyncPrimServerSecureImportIN->Export, + &psSyncHandleInt, + &psSyncPrimServerSecureImportOUT->ui32SyncPrimVAddr); + /* Exit early if bridged call fails */ + if(psSyncPrimServerSecureImportOUT->eError != PVRSRV_OK) + { + goto SyncPrimServerSecureImport_exit; + } + + /* Create a resman item and overwrite the handle with it */ + hSyncHandleInt2 = ResManRegisterRes(psConnection->hResManContext, + RESMAN_TYPE_SERVER_SYNC_PRIMITIVE, + psSyncHandleInt, + (RESMAN_FREE_FN)&PVRSRVServerSyncFreeKM); + if (hSyncHandleInt2 == IMG_NULL) + { + psSyncPrimServerSecureImportOUT->eError = PVRSRV_ERROR_UNABLE_TO_REGISTER_RESOURCE; + goto SyncPrimServerSecureImport_exit; + } + psSyncPrimServerSecureImportOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase, + &psSyncPrimServerSecureImportOUT->hSyncHandle, + (IMG_HANDLE) hSyncHandleInt2, + PVRSRV_HANDLE_TYPE_SERVER_SYNC_PRIMITIVE, + PVRSRV_HANDLE_ALLOC_FLAG_NONE + ); + if (psSyncPrimServerSecureImportOUT->eError != PVRSRV_OK) + { + goto SyncPrimServerSecureImport_exit; + } + + +SyncPrimServerSecureImport_exit: + if (psSyncPrimServerSecureImportOUT->eError != PVRSRV_OK) + { + /* If we have a valid resman item we should undo the bridge function by freeing the resman item */ + if (hSyncHandleInt2) + { + PVRSRV_ERROR eError = ResManFreeResByPtr(hSyncHandleInt2); + + /* Freeing a resource should never fail... */ + PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY)); + } + else if (psSyncHandleInt) + { + PVRSRVServerSyncFreeKM(psSyncHandleInt); + } + } + + + return 0; +} + + + +/* *************************************************************************** + * Server bridge dispatch related glue + */ + +PVRSRV_ERROR RegisterSYNCSEXPORTFunctions(IMG_VOID); +IMG_VOID UnregisterSYNCSEXPORTFunctions(IMG_VOID); + +/* + * Register all SYNCSEXPORT functions with services + */ +PVRSRV_ERROR RegisterSYNCSEXPORTFunctions(IMG_VOID) +{ + SetDispatchTableEntry(PVRSRV_BRIDGE_SYNCSEXPORT_SYNCPRIMSERVERSECUREEXPORT, PVRSRVBridgeSyncPrimServerSecureExport); + SetDispatchTableEntry(PVRSRV_BRIDGE_SYNCSEXPORT_SYNCPRIMSERVERSECUREUNEXPORT, PVRSRVBridgeSyncPrimServerSecureUnexport); + SetDispatchTableEntry(PVRSRV_BRIDGE_SYNCSEXPORT_SYNCPRIMSERVERSECUREIMPORT, PVRSRVBridgeSyncPrimServerSecureImport); + + return PVRSRV_OK; +} + +/* + * Unregister all syncsexport functions with services + */ +IMG_VOID UnregisterSYNCSEXPORTFunctions(IMG_VOID) +{ +} diff --git a/drivers/gpu/rogue/generated/timerquery_bridge/common_timerquery_bridge.h b/drivers/gpu/rogue/generated/timerquery_bridge/common_timerquery_bridge.h new file mode 100644 index 000000000000..4a810c6431ff --- /dev/null +++ b/drivers/gpu/rogue/generated/timerquery_bridge/common_timerquery_bridge.h @@ -0,0 +1,134 @@ +/*************************************************************************/ /*! +@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 "rgx_bridge.h" + + +#include "pvr_bridge_io.h" + +#define PVRSRV_BRIDGE_TIMERQUERY_CMD_FIRST (PVRSRV_BRIDGE_TIMERQUERY_START) +#define PVRSRV_BRIDGE_TIMERQUERY_RGXBEGINTIMERQUERY PVRSRV_IOWR(PVRSRV_BRIDGE_TIMERQUERY_CMD_FIRST+0) +#define PVRSRV_BRIDGE_TIMERQUERY_RGXENDTIMERQUERY PVRSRV_IOWR(PVRSRV_BRIDGE_TIMERQUERY_CMD_FIRST+1) +#define PVRSRV_BRIDGE_TIMERQUERY_RGXQUERYTIMER PVRSRV_IOWR(PVRSRV_BRIDGE_TIMERQUERY_CMD_FIRST+2) +#define PVRSRV_BRIDGE_TIMERQUERY_RGXCURRENTTIME PVRSRV_IOWR(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/generated/timerquery_bridge/server_timerquery_bridge.c b/drivers/gpu/rogue/generated/timerquery_bridge/server_timerquery_bridge.c new file mode 100644 index 000000000000..84bebe47f720 --- /dev/null +++ b/drivers/gpu/rogue/generated/timerquery_bridge/server_timerquery_bridge.c @@ -0,0 +1,266 @@ +/*************************************************************************/ /*! +@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 + +/* *************************************************************************** + * Bridge proxy functions + */ + + + +/* *************************************************************************** + * Server-side bridge entry points + */ + +static IMG_INT +PVRSRVBridgeRGXBeginTimerQuery(IMG_UINT32 ui32BridgeID, + PVRSRV_BRIDGE_IN_RGXBEGINTIMERQUERY *psRGXBeginTimerQueryIN, + PVRSRV_BRIDGE_OUT_RGXBEGINTIMERQUERY *psRGXBeginTimerQueryOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevNodeInt = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_TIMERQUERY_RGXBEGINTIMERQUERY); + + + + + + { + /* Look up the address from the handle */ + psRGXBeginTimerQueryOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &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 ui32BridgeID, + PVRSRV_BRIDGE_IN_RGXENDTIMERQUERY *psRGXEndTimerQueryIN, + PVRSRV_BRIDGE_OUT_RGXENDTIMERQUERY *psRGXEndTimerQueryOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevNodeInt = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_TIMERQUERY_RGXENDTIMERQUERY); + + + + + + { + /* Look up the address from the handle */ + psRGXEndTimerQueryOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &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 ui32BridgeID, + PVRSRV_BRIDGE_IN_RGXQUERYTIMER *psRGXQueryTimerIN, + PVRSRV_BRIDGE_OUT_RGXQUERYTIMER *psRGXQueryTimerOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevNodeInt = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_TIMERQUERY_RGXQUERYTIMER); + + + + + + { + /* Look up the address from the handle */ + psRGXQueryTimerOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &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 ui32BridgeID, + PVRSRV_BRIDGE_IN_RGXCURRENTTIME *psRGXCurrentTimeIN, + PVRSRV_BRIDGE_OUT_RGXCURRENTTIME *psRGXCurrentTimeOUT, + CONNECTION_DATA *psConnection) +{ + IMG_HANDLE hDevNodeInt = IMG_NULL; + + PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_TIMERQUERY_RGXCURRENTTIME); + + + + + + { + /* Look up the address from the handle */ + psRGXCurrentTimeOUT->eError = + PVRSRVLookupHandle(psConnection->psHandleBase, + (IMG_HANDLE *) &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 RegisterTIMERQUERYFunctions(IMG_VOID); +IMG_VOID UnregisterTIMERQUERYFunctions(IMG_VOID); + +/* + * Register all TIMERQUERY functions with services + */ +PVRSRV_ERROR RegisterTIMERQUERYFunctions(IMG_VOID) +{ + SetDispatchTableEntry(PVRSRV_BRIDGE_TIMERQUERY_RGXBEGINTIMERQUERY, PVRSRVBridgeRGXBeginTimerQuery); + SetDispatchTableEntry(PVRSRV_BRIDGE_TIMERQUERY_RGXENDTIMERQUERY, PVRSRVBridgeRGXEndTimerQuery); + SetDispatchTableEntry(PVRSRV_BRIDGE_TIMERQUERY_RGXQUERYTIMER, PVRSRVBridgeRGXQueryTimer); + SetDispatchTableEntry(PVRSRV_BRIDGE_TIMERQUERY_RGXCURRENTTIME, PVRSRVBridgeRGXCurrentTime); + + return PVRSRV_OK; +} + +/* + * Unregister all timerquery functions with services + */ +IMG_VOID UnregisterTIMERQUERYFunctions(IMG_VOID) +{ +} diff --git a/drivers/gpu/rogue/hwdefs/km/configs/rgxconfig_km_1.V.2.0.h b/drivers/gpu/rogue/hwdefs/km/configs/rgxconfig_km_1.V.2.0.h new file mode 100644 index 000000000000..f8864f6a5f9d --- /dev/null +++ b/drivers/gpu/rogue/hwdefs/km/configs/rgxconfig_km_1.V.2.0.h @@ -0,0 +1,67 @@ +/*************************************************************************/ /*! +@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 (11/24/2014 2:08:59 PM): Do not edit manually ********************/ +/***** Timestamp: (11/24/2014 2:08:59 PM)************************************************************/ + +#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_GS_RTA_SUPPORT +#define RGX_FEATURE_NUM_ISP_IPP_PIPES (3) +#define RGX_FEATURE_META (MTP218) +#define RGX_FEATURE_META_COREMEM_SIZE (0) + + +#endif /* _RGXCONFIG_1_V_2_0_H_ */ diff --git a/drivers/gpu/rogue/hwdefs/km/configs/rgxconfig_km_1.V.2.20.h b/drivers/gpu/rogue/hwdefs/km/configs/rgxconfig_km_1.V.2.20.h new file mode 100644 index 000000000000..0a4caa8ed5d2 --- /dev/null +++ b/drivers/gpu/rogue/hwdefs/km/configs/rgxconfig_km_1.V.2.20.h @@ -0,0 +1,67 @@ +/*************************************************************************/ /*! +@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 (11/24/2014 2:08:59 PM): Do not edit manually ********************/ +/***** Timestamp: (11/24/2014 2:08:59 PM)************************************************************/ + +#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_GS_RTA_SUPPORT +#define RGX_FEATURE_NUM_ISP_IPP_PIPES (3) +#define RGX_FEATURE_META (MTP218) +#define RGX_FEATURE_META_COREMEM_SIZE (0) + + +#endif /* _RGXCONFIG_1_V_2_20_H_ */ diff --git a/drivers/gpu/rogue/hwdefs/km/configs/rgxconfig_km_1.V.2.30.h b/drivers/gpu/rogue/hwdefs/km/configs/rgxconfig_km_1.V.2.30.h new file mode 100644 index 000000000000..f73651310c6e --- /dev/null +++ b/drivers/gpu/rogue/hwdefs/km/configs/rgxconfig_km_1.V.2.30.h @@ -0,0 +1,67 @@ +/*************************************************************************/ /*! +@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 (11/24/2014 2:08:58 PM): Do not edit manually ********************/ +/***** Timestamp: (11/24/2014 2:08:58 PM)************************************************************/ + +#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_GS_RTA_SUPPORT +#define RGX_FEATURE_NUM_ISP_IPP_PIPES (3) +#define RGX_FEATURE_META (MTP218) +#define RGX_FEATURE_META_COREMEM_SIZE (0) + + +#endif /* _RGXCONFIG_1_V_2_30_H_ */ diff --git a/drivers/gpu/rogue/hwdefs/km/configs/rgxconfig_km_1.V.2.5.h b/drivers/gpu/rogue/hwdefs/km/configs/rgxconfig_km_1.V.2.5.h new file mode 100644 index 000000000000..f5f45b7826cd --- /dev/null +++ b/drivers/gpu/rogue/hwdefs/km/configs/rgxconfig_km_1.V.2.5.h @@ -0,0 +1,67 @@ +/*************************************************************************/ /*! +@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 (11/24/2014 2:08:59 PM): Do not edit manually ********************/ +/***** Timestamp: (11/24/2014 2:08:59 PM)************************************************************/ + +#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_GS_RTA_SUPPORT +#define RGX_FEATURE_NUM_ISP_IPP_PIPES (3) +#define RGX_FEATURE_META (MTP218) +#define RGX_FEATURE_META_COREMEM_SIZE (0) + + +#endif /* _RGXCONFIG_1_V_2_5_H_ */ diff --git a/drivers/gpu/rogue/hwdefs/km/configs/rgxconfig_km_1.V.4.12.h b/drivers/gpu/rogue/hwdefs/km/configs/rgxconfig_km_1.V.4.12.h new file mode 100644 index 000000000000..a9662208e4f2 --- /dev/null +++ b/drivers/gpu/rogue/hwdefs/km/configs/rgxconfig_km_1.V.4.12.h @@ -0,0 +1,66 @@ +/*************************************************************************/ /*! +@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 (11/24/2014 2:08:59 PM): Do not edit manually ********************/ +/***** Timestamp: (11/24/2014 2:08:59 PM)************************************************************/ + +#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_GS_RTA_SUPPORT +#define RGX_FEATURE_NUM_ISP_IPP_PIPES (3) +#define RGX_FEATURE_META (MTP218) +#define RGX_FEATURE_META_COREMEM_SIZE (0) + + +#endif /* _RGXCONFIG_1_V_4_12_H_ */ diff --git a/drivers/gpu/rogue/hwdefs/km/configs/rgxconfig_km_1.V.4.15.h b/drivers/gpu/rogue/hwdefs/km/configs/rgxconfig_km_1.V.4.15.h new file mode 100644 index 000000000000..ec5ca494e6e4 --- /dev/null +++ b/drivers/gpu/rogue/hwdefs/km/configs/rgxconfig_km_1.V.4.15.h @@ -0,0 +1,67 @@ +/*************************************************************************/ /*! +@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 (11/24/2014 2:08:59 PM): Do not edit manually ********************/ +/***** Timestamp: (11/24/2014 2:08:59 PM)************************************************************/ + +#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_GS_RTA_SUPPORT +#define RGX_FEATURE_NUM_ISP_IPP_PIPES (3) +#define RGX_FEATURE_META (MTP218) +#define RGX_FEATURE_META_COREMEM_SIZE (0) + + +#endif /* _RGXCONFIG_1_V_4_15_H_ */ diff --git a/drivers/gpu/rogue/hwdefs/km/configs/rgxconfig_km_1.V.4.19.h b/drivers/gpu/rogue/hwdefs/km/configs/rgxconfig_km_1.V.4.19.h new file mode 100644 index 000000000000..acfd425c2467 --- /dev/null +++ b/drivers/gpu/rogue/hwdefs/km/configs/rgxconfig_km_1.V.4.19.h @@ -0,0 +1,67 @@ +/*************************************************************************/ /*! +@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 (11/24/2014 2:09:00 PM): Do not edit manually ********************/ +/***** Timestamp: (11/24/2014 2:09:00 PM)************************************************************/ + +#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_GS_RTA_SUPPORT +#define RGX_FEATURE_NUM_ISP_IPP_PIPES (3) +#define RGX_FEATURE_META (MTP218) +#define RGX_FEATURE_META_COREMEM_SIZE (0) + + +#endif /* _RGXCONFIG_1_V_4_19_H_ */ diff --git a/drivers/gpu/rogue/hwdefs/km/configs/rgxconfig_km_1.V.4.4.h b/drivers/gpu/rogue/hwdefs/km/configs/rgxconfig_km_1.V.4.4.h new file mode 100644 index 000000000000..38f0941344e8 --- /dev/null +++ b/drivers/gpu/rogue/hwdefs/km/configs/rgxconfig_km_1.V.4.4.h @@ -0,0 +1,66 @@ +/*************************************************************************/ /*! +@Title RGX Config BVNC 1.V.4.4 +@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_4_H_ +#define _RGXCONFIG_KM_1_V_4_4_H_ + +/***** Automatically generated file (11/24/2014 2:08:59 PM): Do not edit manually ********************/ +/***** Timestamp: (11/24/2014 2:08:59 PM)************************************************************/ + +#define RGX_BNC_KM_B 1 +#define RGX_BNC_KM_N 4 +#define RGX_BNC_KM_C 4 + +/****************************************************************************** + * 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_GS_RTA_SUPPORT +#define RGX_FEATURE_NUM_ISP_IPP_PIPES (3) +#define RGX_FEATURE_META (MTP218) +#define RGX_FEATURE_META_COREMEM_SIZE (0) + + +#endif /* _RGXCONFIG_1_V_4_4_H_ */ diff --git a/drivers/gpu/rogue/hwdefs/km/configs/rgxconfig_km_1.V.4.5.h b/drivers/gpu/rogue/hwdefs/km/configs/rgxconfig_km_1.V.4.5.h new file mode 100644 index 000000000000..24f869a3e078 --- /dev/null +++ b/drivers/gpu/rogue/hwdefs/km/configs/rgxconfig_km_1.V.4.5.h @@ -0,0 +1,66 @@ +/*************************************************************************/ /*! +@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 (11/24/2014 2:08:59 PM): Do not edit manually ********************/ +/***** Timestamp: (11/24/2014 2:08:59 PM)************************************************************/ + +#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_GS_RTA_SUPPORT +#define RGX_FEATURE_NUM_ISP_IPP_PIPES (3) +#define RGX_FEATURE_META (MTP218) +#define RGX_FEATURE_META_COREMEM_SIZE (0) + + +#endif /* _RGXCONFIG_1_V_4_5_H_ */ diff --git a/drivers/gpu/rogue/hwdefs/km/configs/rgxconfig_km_1.V.4.6.h b/drivers/gpu/rogue/hwdefs/km/configs/rgxconfig_km_1.V.4.6.h new file mode 100644 index 000000000000..e566590e66e2 --- /dev/null +++ b/drivers/gpu/rogue/hwdefs/km/configs/rgxconfig_km_1.V.4.6.h @@ -0,0 +1,66 @@ +/*************************************************************************/ /*! +@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 (11/24/2014 2:08:59 PM): Do not edit manually ********************/ +/***** Timestamp: (11/24/2014 2:08:59 PM)************************************************************/ + +#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_GS_RTA_SUPPORT +#define RGX_FEATURE_NUM_ISP_IPP_PIPES (3) +#define RGX_FEATURE_META (MTP218) +#define RGX_FEATURE_META_COREMEM_SIZE (0) + + +#endif /* _RGXCONFIG_1_V_4_6_H_ */ diff --git a/drivers/gpu/rogue/hwdefs/km/configs/rgxconfig_km_12.V.1.20.h b/drivers/gpu/rogue/hwdefs/km/configs/rgxconfig_km_12.V.1.20.h new file mode 100644 index 000000000000..4f68912d23ee --- /dev/null +++ b/drivers/gpu/rogue/hwdefs/km/configs/rgxconfig_km_12.V.1.20.h @@ -0,0 +1,66 @@ +/*************************************************************************/ /*! +@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 (11/24/2014 2:08:58 PM): Do not edit manually ********************/ +/***** Timestamp: (11/24/2014 2:08:58 PM)************************************************************/ + +#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) + + +#endif /* _RGXCONFIG_12_V_1_20_H_ */ diff --git a/drivers/gpu/rogue/hwdefs/km/configs/rgxconfig_km_4.V.2.51.h b/drivers/gpu/rogue/hwdefs/km/configs/rgxconfig_km_4.V.2.51.h new file mode 100644 index 000000000000..6464e705d7ae --- /dev/null +++ b/drivers/gpu/rogue/hwdefs/km/configs/rgxconfig_km_4.V.2.51.h @@ -0,0 +1,69 @@ +/*************************************************************************/ /*! +@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 (11/24/2014 2:08:59 PM): Do not edit manually ********************/ +/***** Timestamp: (11/24/2014 2:08:59 PM)************************************************************/ + +#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_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_META_COREMEM_SIZE (32) + + +#endif /* _RGXCONFIG_4_V_2_51_H_ */ diff --git a/drivers/gpu/rogue/hwdefs/km/configs/rgxconfig_km_4.V.4.53.h b/drivers/gpu/rogue/hwdefs/km/configs/rgxconfig_km_4.V.4.53.h new file mode 100644 index 000000000000..b3c59e53de26 --- /dev/null +++ b/drivers/gpu/rogue/hwdefs/km/configs/rgxconfig_km_4.V.4.53.h @@ -0,0 +1,69 @@ +/*************************************************************************/ /*! +@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 (11/24/2014 2:08:59 PM): Do not edit manually ********************/ +/***** Timestamp: (11/24/2014 2:08:59 PM)************************************************************/ + +#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_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_META_COREMEM_SIZE (32) + + +#endif /* _RGXCONFIG_4_V_4_53_H_ */ diff --git a/drivers/gpu/rogue/hwdefs/km/configs/rgxconfig_km_4.V.6.61.h b/drivers/gpu/rogue/hwdefs/km/configs/rgxconfig_km_4.V.6.61.h new file mode 100644 index 000000000000..66e39df3e394 --- /dev/null +++ b/drivers/gpu/rogue/hwdefs/km/configs/rgxconfig_km_4.V.6.61.h @@ -0,0 +1,70 @@ +/*************************************************************************/ /*! +@Title RGX Config BVNC 4.V.6.61 +@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_61_H_ +#define _RGXCONFIG_KM_4_V_6_61_H_ + +/***** Automatically generated file (11/24/2014 2:09:00 PM): Do not edit manually ********************/ +/***** Timestamp: (11/24/2014 2:09:00 PM)************************************************************/ + +#define RGX_BNC_KM_B 4 +#define RGX_BNC_KM_N 6 +#define RGX_BNC_KM_C 61 + +/****************************************************************************** + * 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_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_META_COREMEM_SIZE (32) + + +#endif /* _RGXCONFIG_4_V_6_61_H_ */ diff --git a/drivers/gpu/rogue/hwdefs/km/configs/rgxconfig_km_5.V.1.16.h b/drivers/gpu/rogue/hwdefs/km/configs/rgxconfig_km_5.V.1.16.h new file mode 100644 index 000000000000..471d8fb13869 --- /dev/null +++ b/drivers/gpu/rogue/hwdefs/km/configs/rgxconfig_km_5.V.1.16.h @@ -0,0 +1,68 @@ +/*************************************************************************/ /*! +@Title RGX Config BVNC 5.V.1.16 +@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_16_H_ +#define _RGXCONFIG_KM_5_V_1_16_H_ + +/***** Automatically generated file (11/24/2014 2:09:00 PM): Do not edit manually ********************/ +/***** Timestamp: (11/24/2014 2:09:00 PM)************************************************************/ + +#define RGX_BNC_KM_B 5 +#define RGX_BNC_KM_N 1 +#define RGX_BNC_KM_C 16 + +/****************************************************************************** + * 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 (MTP218) +#define RGX_FEATURE_META_COREMEM_SIZE (0) + + +#endif /* _RGXCONFIG_5_V_1_16_H_ */ diff --git a/drivers/gpu/rogue/hwdefs/km/configs/rgxconfig_km_5.V.1.17.h b/drivers/gpu/rogue/hwdefs/km/configs/rgxconfig_km_5.V.1.17.h new file mode 100644 index 000000000000..a4df5fc95831 --- /dev/null +++ b/drivers/gpu/rogue/hwdefs/km/configs/rgxconfig_km_5.V.1.17.h @@ -0,0 +1,68 @@ +/*************************************************************************/ /*! +@Title RGX Config BVNC 5.V.1.17 +@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_17_H_ +#define _RGXCONFIG_KM_5_V_1_17_H_ + +/***** Automatically generated file (11/24/2014 2:09:00 PM): Do not edit manually ********************/ +/***** Timestamp: (11/24/2014 2:09:00 PM)************************************************************/ + +#define RGX_BNC_KM_B 5 +#define RGX_BNC_KM_N 1 +#define RGX_BNC_KM_C 17 + +/****************************************************************************** + * DDK Defines + *****************************************************************************/ +#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_NUM_CLUSTERS (1) +#define RGX_FEATURE_VIRTUAL_ADDRESS_SPACE_BITS (40) +#define RGX_FEATURE_SLC_BANKS (1) +#define RGX_FEATURE_GS_RTA_SUPPORT +#define RGX_FEATURE_NUM_ISP_IPP_PIPES (1) +#define RGX_FEATURE_META (MTP218) +#define RGX_FEATURE_META_COREMEM_SIZE (0) + + +#endif /* _RGXCONFIG_5_V_1_17_H_ */ diff --git a/drivers/gpu/rogue/hwdefs/km/configs/rgxconfig_km_5.V.1.46.h b/drivers/gpu/rogue/hwdefs/km/configs/rgxconfig_km_5.V.1.46.h new file mode 100644 index 000000000000..71632a9e0ba0 --- /dev/null +++ b/drivers/gpu/rogue/hwdefs/km/configs/rgxconfig_km_5.V.1.46.h @@ -0,0 +1,68 @@ +/*************************************************************************/ /*! +@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 (11/24/2014 2:09:00 PM): Do not edit manually ********************/ +/***** Timestamp: (11/24/2014 2:09:00 PM)************************************************************/ + +#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_META_COREMEM_SIZE (0) + + +#endif /* _RGXCONFIG_5_V_1_46_H_ */ diff --git a/drivers/gpu/rogue/hwdefs/km/cores/rgxcore_km_1.14.4.4.h b/drivers/gpu/rogue/hwdefs/km/cores/rgxcore_km_1.14.4.4.h new file mode 100644 index 000000000000..1eee2649d75b --- /dev/null +++ b/drivers/gpu/rogue/hwdefs/km/cores/rgxcore_km_1.14.4.4.h @@ -0,0 +1,75 @@ +/*************************************************************************/ /*! +@Title RGX Core BVNC 1.14.4.4 +@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_14_4_4_H_ +#define _RGXCORE_KM_1_14_4_4_H_ + +/***** Automatically generated file (10/28/2014 1:55:41 PM): Do not edit manually ********************/ +/***** Timestamp: (10/28/2014 1:55:41 PM)************************************************************/ +/***** CS: @871575 ******************************************************************/ + + +/****************************************************************************** + * BVNC = 1.14.4.4 + *****************************************************************************/ +#define RGX_BVNC_KM_B 1 +#define RGX_BVNC_KM_V 14 +#define RGX_BVNC_KM_N 4 +#define RGX_BVNC_KM_C 4 + +/****************************************************************************** + * Errata + *****************************************************************************/ + +#define FIX_HW_BRN_36492 +#define FIX_HW_BRN_37200 +#define FIX_HW_BRN_38344 +#define FIX_HW_BRN_38835 + + + +/****************************************************************************** + * Enhancements + *****************************************************************************/ + + + +#endif /* _RGXCORE_KM_1_14_4_4_H_ */ diff --git a/drivers/gpu/rogue/hwdefs/km/cores/rgxcore_km_1.31.2.0.h b/drivers/gpu/rogue/hwdefs/km/cores/rgxcore_km_1.31.2.0.h new file mode 100644 index 000000000000..d79ebf387bbb --- /dev/null +++ b/drivers/gpu/rogue/hwdefs/km/cores/rgxcore_km_1.31.2.0.h @@ -0,0 +1,72 @@ +/*************************************************************************/ /*! +@Title RGX Core BVNC 1.31.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_31_2_0_H_ +#define _RGXCORE_KM_1_31_2_0_H_ + +/***** Automatically generated file (10/28/2014 1:55:48 PM): Do not edit manually ********************/ +/***** Timestamp: (10/28/2014 1:55:48 PM)************************************************************/ +/***** CS: @2236231 ******************************************************************/ + + +/****************************************************************************** + * BVNC = 1.31.2.0 + *****************************************************************************/ +#define RGX_BVNC_KM_B 1 +#define RGX_BVNC_KM_V 31 +#define RGX_BVNC_KM_N 2 +#define RGX_BVNC_KM_C 0 + +/****************************************************************************** + * Errata + *****************************************************************************/ + +#define FIX_HW_BRN_38344 + + + +/****************************************************************************** + * Enhancements + *****************************************************************************/ + + + +#endif /* _RGXCORE_KM_1_31_2_0_H_ */ diff --git a/drivers/gpu/rogue/hwdefs/km/cores/rgxcore_km_1.32.4.19.h b/drivers/gpu/rogue/hwdefs/km/cores/rgxcore_km_1.32.4.19.h new file mode 100644 index 000000000000..0aa5ae99573d --- /dev/null +++ b/drivers/gpu/rogue/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 (10/28/2014 1:55:48 PM): Do not edit manually ********************/ +/***** Timestamp: (10/28/2014 1:55:48 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/hwdefs/km/cores/rgxcore_km_1.33.2.5.h b/drivers/gpu/rogue/hwdefs/km/cores/rgxcore_km_1.33.2.5.h new file mode 100644 index 000000000000..770590e2777e --- /dev/null +++ b/drivers/gpu/rogue/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 (10/28/2014 1:55:47 PM): Do not edit manually ********************/ +/***** Timestamp: (10/28/2014 1:55:47 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/hwdefs/km/cores/rgxcore_km_1.39.4.19.h b/drivers/gpu/rogue/hwdefs/km/cores/rgxcore_km_1.39.4.19.h new file mode 100644 index 000000000000..5eec9b327497 --- /dev/null +++ b/drivers/gpu/rogue/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 (10/28/2014 1:55:48 PM): Do not edit manually ********************/ +/***** Timestamp: (10/28/2014 1:55:48 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/hwdefs/km/cores/rgxcore_km_1.48.2.0.h b/drivers/gpu/rogue/hwdefs/km/cores/rgxcore_km_1.48.2.0.h new file mode 100644 index 000000000000..d018e98b6020 --- /dev/null +++ b/drivers/gpu/rogue/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 (10/28/2014 1:55:48 PM): Do not edit manually ********************/ +/***** Timestamp: (10/28/2014 1:55:48 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/hwdefs/km/cores/rgxcore_km_1.49.4.15.h b/drivers/gpu/rogue/hwdefs/km/cores/rgxcore_km_1.49.4.15.h new file mode 100644 index 000000000000..5782809e9e28 --- /dev/null +++ b/drivers/gpu/rogue/hwdefs/km/cores/rgxcore_km_1.49.4.15.h @@ -0,0 +1,72 @@ +/*************************************************************************/ /*! +@Title RGX Core BVNC 1.49.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_49_4_15_H_ +#define _RGXCORE_KM_1_49_4_15_H_ + +/***** Automatically generated file (10/28/2014 1:55:47 PM): Do not edit manually ********************/ +/***** Timestamp: (10/28/2014 1:55:47 PM)************************************************************/ +/***** CS: @2232098 ******************************************************************/ + + +/****************************************************************************** + * BVNC = 1.49.4.15 + *****************************************************************************/ +#define RGX_BVNC_KM_B 1 +#define RGX_BVNC_KM_V 49 +#define RGX_BVNC_KM_N 4 +#define RGX_BVNC_KM_C 15 + +/****************************************************************************** + * Errata + *****************************************************************************/ + +#define FIX_HW_BRN_38344 + + + +/****************************************************************************** + * Enhancements + *****************************************************************************/ + + + +#endif /* _RGXCORE_KM_1_49_4_15_H_ */ diff --git a/drivers/gpu/rogue/hwdefs/km/cores/rgxcore_km_1.67.2.5.h b/drivers/gpu/rogue/hwdefs/km/cores/rgxcore_km_1.67.2.5.h new file mode 100644 index 000000000000..c247200b5d64 --- /dev/null +++ b/drivers/gpu/rogue/hwdefs/km/cores/rgxcore_km_1.67.2.5.h @@ -0,0 +1,72 @@ +/*************************************************************************/ /*! +@Title RGX Core BVNC 1.67.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_67_2_5_H_ +#define _RGXCORE_KM_1_67_2_5_H_ + +/***** Automatically generated file (10/28/2014 1:55:48 PM): Do not edit manually ********************/ +/***** Timestamp: (10/28/2014 1:55:48 PM)************************************************************/ +/***** CS: @2363764 ******************************************************************/ + + +/****************************************************************************** + * BVNC = 1.67.2.5 + *****************************************************************************/ +#define RGX_BVNC_KM_B 1 +#define RGX_BVNC_KM_V 67 +#define RGX_BVNC_KM_N 2 +#define RGX_BVNC_KM_C 5 + +/****************************************************************************** + * Errata + *****************************************************************************/ + +#define FIX_HW_BRN_38344 + + + +/****************************************************************************** + * Enhancements + *****************************************************************************/ + + + +#endif /* _RGXCORE_KM_1_67_2_5_H_ */ diff --git a/drivers/gpu/rogue/hwdefs/km/cores/rgxcore_km_1.7.4.5.h b/drivers/gpu/rogue/hwdefs/km/cores/rgxcore_km_1.7.4.5.h new file mode 100644 index 000000000000..5616389b3aa9 --- /dev/null +++ b/drivers/gpu/rogue/hwdefs/km/cores/rgxcore_km_1.7.4.5.h @@ -0,0 +1,75 @@ +/*************************************************************************/ /*! +@Title RGX Core BVNC 1.7.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_7_4_5_H_ +#define _RGXCORE_KM_1_7_4_5_H_ + +/***** Automatically generated file (10/28/2014 1:55:40 PM): Do not edit manually ********************/ +/***** Timestamp: (10/28/2014 1:55:40 PM)************************************************************/ +/***** CS: @871574 ******************************************************************/ + + +/****************************************************************************** + * BVNC = 1.7.4.5 + *****************************************************************************/ +#define RGX_BVNC_KM_B 1 +#define RGX_BVNC_KM_V 7 +#define RGX_BVNC_KM_N 4 +#define RGX_BVNC_KM_C 5 + +/****************************************************************************** + * Errata + *****************************************************************************/ + +#define FIX_HW_BRN_36492 +#define FIX_HW_BRN_37200 +#define FIX_HW_BRN_38344 +#define FIX_HW_BRN_38835 + + + +/****************************************************************************** + * Enhancements + *****************************************************************************/ + + + +#endif /* _RGXCORE_KM_1_7_4_5_H_ */ diff --git a/drivers/gpu/rogue/hwdefs/km/cores/rgxcore_km_1.72.4.12.h b/drivers/gpu/rogue/hwdefs/km/cores/rgxcore_km_1.72.4.12.h new file mode 100644 index 000000000000..a675ff644b2a --- /dev/null +++ b/drivers/gpu/rogue/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 (10/28/2014 1:55:41 PM): Do not edit manually ********************/ +/***** Timestamp: (10/28/2014 1:55:41 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/hwdefs/km/cores/rgxcore_km_1.75.2.20.h b/drivers/gpu/rogue/hwdefs/km/cores/rgxcore_km_1.75.2.20.h new file mode 100644 index 000000000000..e756869ca017 --- /dev/null +++ b/drivers/gpu/rogue/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 (10/28/2014 1:55:48 PM): Do not edit manually ********************/ +/***** Timestamp: (10/28/2014 1:55:48 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/hwdefs/km/cores/rgxcore_km_1.75.2.30.h b/drivers/gpu/rogue/hwdefs/km/cores/rgxcore_km_1.75.2.30.h new file mode 100644 index 000000000000..5b791bdf5627 --- /dev/null +++ b/drivers/gpu/rogue/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 (10/28/2014 1:55:39 PM): Do not edit manually ********************/ +/***** Timestamp: (10/28/2014 1:55:39 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/hwdefs/km/cores/rgxcore_km_1.76.4.6.h b/drivers/gpu/rogue/hwdefs/km/cores/rgxcore_km_1.76.4.6.h new file mode 100644 index 000000000000..51d12ed5537f --- /dev/null +++ b/drivers/gpu/rogue/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 (10/28/2014 1:55:41 PM): Do not edit manually ********************/ +/***** Timestamp: (10/28/2014 1:55:41 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/hwdefs/km/cores/rgxcore_km_1.81.4.15.h b/drivers/gpu/rogue/hwdefs/km/cores/rgxcore_km_1.81.4.15.h new file mode 100644 index 000000000000..51f9da00d650 --- /dev/null +++ b/drivers/gpu/rogue/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 (10/28/2014 1:55:47 PM): Do not edit manually ********************/ +/***** Timestamp: (10/28/2014 1:55:47 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/hwdefs/km/cores/rgxcore_km_1.82.4.5.h b/drivers/gpu/rogue/hwdefs/km/cores/rgxcore_km_1.82.4.5.h new file mode 100644 index 000000000000..75fee8133df6 --- /dev/null +++ b/drivers/gpu/rogue/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 (10/28/2014 1:55:40 PM): Do not edit manually ********************/ +/***** Timestamp: (10/28/2014 1:55:40 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/hwdefs/km/cores/rgxcore_km_1.85.2.5.h b/drivers/gpu/rogue/hwdefs/km/cores/rgxcore_km_1.85.2.5.h new file mode 100644 index 000000000000..a89ab6f9d1a9 --- /dev/null +++ b/drivers/gpu/rogue/hwdefs/km/cores/rgxcore_km_1.85.2.5.h @@ -0,0 +1,71 @@ +/*************************************************************************/ /*! +@Title RGX Core BVNC 1.85.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_85_2_5_H_ +#define _RGXCORE_KM_1_85_2_5_H_ + +/***** Automatically generated file (10/28/2014 1:55:47 PM): Do not edit manually ********************/ +/***** Timestamp: (10/28/2014 1:55:47 PM)************************************************************/ +/***** CS: @2593573 ******************************************************************/ + + +/****************************************************************************** + * BVNC = 1.85.2.5 + *****************************************************************************/ +#define RGX_BVNC_KM_B 1 +#define RGX_BVNC_KM_V 85 +#define RGX_BVNC_KM_N 2 +#define RGX_BVNC_KM_C 5 + +/****************************************************************************** + * Errata + *****************************************************************************/ + + + + +/****************************************************************************** + * Enhancements + *****************************************************************************/ + + + +#endif /* _RGXCORE_KM_1_85_2_5_H_ */ diff --git a/drivers/gpu/rogue/hwdefs/km/cores/rgxcore_km_1.86.4.12.h b/drivers/gpu/rogue/hwdefs/km/cores/rgxcore_km_1.86.4.12.h new file mode 100644 index 000000000000..dfd1f0cc4819 --- /dev/null +++ b/drivers/gpu/rogue/hwdefs/km/cores/rgxcore_km_1.86.4.12.h @@ -0,0 +1,71 @@ +/*************************************************************************/ /*! +@Title RGX Core BVNC 1.86.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_86_4_12_H_ +#define _RGXCORE_KM_1_86_4_12_H_ + +/***** Automatically generated file (10/28/2014 1:55:41 PM): Do not edit manually ********************/ +/***** Timestamp: (10/28/2014 1:55:41 PM)************************************************************/ +/***** CS: @2605542 ******************************************************************/ + + +/****************************************************************************** + * BVNC = 1.86.4.12 + *****************************************************************************/ +#define RGX_BVNC_KM_B 1 +#define RGX_BVNC_KM_V 86 +#define RGX_BVNC_KM_N 4 +#define RGX_BVNC_KM_C 12 + +/****************************************************************************** + * Errata + *****************************************************************************/ + + + + +/****************************************************************************** + * Enhancements + *****************************************************************************/ + + + +#endif /* _RGXCORE_KM_1_86_4_12_H_ */ diff --git a/drivers/gpu/rogue/hwdefs/km/cores/rgxcore_km_12.4.1.20.h b/drivers/gpu/rogue/hwdefs/km/cores/rgxcore_km_12.4.1.20.h new file mode 100644 index 000000000000..ac825b1af995 --- /dev/null +++ b/drivers/gpu/rogue/hwdefs/km/cores/rgxcore_km_12.4.1.20.h @@ -0,0 +1,72 @@ +/*************************************************************************/ /*! +@Title RGX Core BVNC 12.4.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_4_1_20_H_ +#define _RGXCORE_KM_12_4_1_20_H_ + +/***** Automatically generated file (10/28/2014 1:55:39 PM): Do not edit manually ********************/ +/***** Timestamp: (10/28/2014 1:55:39 PM)************************************************************/ +/***** CS: @2875741 ******************************************************************/ + + +/****************************************************************************** + * BVNC = 12.4.1.20 + *****************************************************************************/ +#define RGX_BVNC_KM_B 12 +#define RGX_BVNC_KM_V 4 +#define RGX_BVNC_KM_N 1 +#define RGX_BVNC_KM_C 20 + +/****************************************************************************** + * Errata + *****************************************************************************/ + +#define FIX_HW_BRN_38344 + + + +/****************************************************************************** + * Enhancements + *****************************************************************************/ + + + +#endif /* _RGXCORE_KM_12_4_1_20_H_ */ diff --git a/drivers/gpu/rogue/hwdefs/km/cores/rgxcore_km_4.20.4.53.h b/drivers/gpu/rogue/hwdefs/km/cores/rgxcore_km_4.20.4.53.h new file mode 100644 index 000000000000..ac4ecd245ef4 --- /dev/null +++ b/drivers/gpu/rogue/hwdefs/km/cores/rgxcore_km_4.20.4.53.h @@ -0,0 +1,71 @@ +/*************************************************************************/ /*! +@Title RGX Core BVNC 4.20.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_20_4_53_H_ +#define _RGXCORE_KM_4_20_4_53_H_ + +/***** Automatically generated file (10/28/2014 1:55:39 PM): Do not edit manually ********************/ +/***** Timestamp: (10/28/2014 1:55:39 PM)************************************************************/ +/***** CS: @2849524 ******************************************************************/ + + +/****************************************************************************** + * BVNC = 4.20.4.53 + *****************************************************************************/ +#define RGX_BVNC_KM_B 4 +#define RGX_BVNC_KM_V 20 +#define RGX_BVNC_KM_N 4 +#define RGX_BVNC_KM_C 53 + +/****************************************************************************** + * Errata + *****************************************************************************/ + + + + +/****************************************************************************** + * Enhancements + *****************************************************************************/ + + + +#endif /* _RGXCORE_KM_4_20_4_53_H_ */ diff --git a/drivers/gpu/rogue/hwdefs/km/cores/rgxcore_km_4.24.6.61.h b/drivers/gpu/rogue/hwdefs/km/cores/rgxcore_km_4.24.6.61.h new file mode 100644 index 000000000000..d7e66aa563aa --- /dev/null +++ b/drivers/gpu/rogue/hwdefs/km/cores/rgxcore_km_4.24.6.61.h @@ -0,0 +1,71 @@ +/*************************************************************************/ /*! +@Title RGX Core BVNC 4.24.6.61 +@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_24_6_61_H_ +#define _RGXCORE_KM_4_24_6_61_H_ + +/***** Automatically generated file (9/1/2014 12:05:58 PM): Do not edit manually ********************/ +/***** Timestamp: (9/1/2014 12:05:58 PM)************************************************************/ +/***** CS: @2956365 ******************************************************************/ + + +/****************************************************************************** + * BVNC = 4.24.6.61 + *****************************************************************************/ +#define RGX_BVNC_KM_B 4 +#define RGX_BVNC_KM_V 24 +#define RGX_BVNC_KM_N 6 +#define RGX_BVNC_KM_C 61 + +/****************************************************************************** + * Errata + *****************************************************************************/ + + + + +/****************************************************************************** + * Enhancements + *****************************************************************************/ + + + +#endif /* _RGXCORE_KM_4_24_6_61_H_ */ diff --git a/drivers/gpu/rogue/hwdefs/km/cores/rgxcore_km_4.29.2.51.h b/drivers/gpu/rogue/hwdefs/km/cores/rgxcore_km_4.29.2.51.h new file mode 100644 index 000000000000..e4ba9ee1e8ae --- /dev/null +++ b/drivers/gpu/rogue/hwdefs/km/cores/rgxcore_km_4.29.2.51.h @@ -0,0 +1,71 @@ +/*************************************************************************/ /*! +@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 (10/28/2014 1:55:48 PM): Do not edit manually ********************/ +/***** Timestamp: (10/28/2014 1:55:48 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 + *****************************************************************************/ + + + + +/****************************************************************************** + * Enhancements + *****************************************************************************/ + + + +#endif /* _RGXCORE_KM_4_29_2_51_H_ */ diff --git a/drivers/gpu/rogue/hwdefs/km/cores/rgxcore_km_4.33.4.53.h b/drivers/gpu/rogue/hwdefs/km/cores/rgxcore_km_4.33.4.53.h new file mode 100644 index 000000000000..6ecb626fd0ae --- /dev/null +++ b/drivers/gpu/rogue/hwdefs/km/cores/rgxcore_km_4.33.4.53.h @@ -0,0 +1,71 @@ +/*************************************************************************/ /*! +@Title RGX Core BVNC 4.33.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_33_4_53_H_ +#define _RGXCORE_KM_4_33_4_53_H_ + +/***** Automatically generated file (10/28/2014 1:55:39 PM): Do not edit manually ********************/ +/***** Timestamp: (10/28/2014 1:55:39 PM)************************************************************/ +/***** CS: @2947126 ******************************************************************/ + + +/****************************************************************************** + * BVNC = 4.33.4.53 + *****************************************************************************/ +#define RGX_BVNC_KM_B 4 +#define RGX_BVNC_KM_V 33 +#define RGX_BVNC_KM_N 4 +#define RGX_BVNC_KM_C 53 + +/****************************************************************************** + * Errata + *****************************************************************************/ + + + + +/****************************************************************************** + * Enhancements + *****************************************************************************/ + + + +#endif /* _RGXCORE_KM_4_33_4_53_H_ */ diff --git a/drivers/gpu/rogue/hwdefs/km/cores/rgxcore_km_5.5.1.17.h b/drivers/gpu/rogue/hwdefs/km/cores/rgxcore_km_5.5.1.17.h new file mode 100644 index 000000000000..b4c3bb6e353f --- /dev/null +++ b/drivers/gpu/rogue/hwdefs/km/cores/rgxcore_km_5.5.1.17.h @@ -0,0 +1,72 @@ +/*************************************************************************/ /*! +@Title RGX Core BVNC 5.5.1.17 +@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_5_1_17_H_ +#define _RGXCORE_KM_5_5_1_17_H_ + +/***** Automatically generated file (10/28/2014 1:55:48 PM): Do not edit manually ********************/ +/***** Timestamp: (10/28/2014 1:55:48 PM)************************************************************/ +/***** CS: @2546826 ******************************************************************/ + + +/****************************************************************************** + * BVNC = 5.5.1.17 + *****************************************************************************/ +#define RGX_BVNC_KM_B 5 +#define RGX_BVNC_KM_V 5 +#define RGX_BVNC_KM_N 1 +#define RGX_BVNC_KM_C 17 + +/****************************************************************************** + * Errata + *****************************************************************************/ + +#define FIX_HW_BRN_38344 + + + +/****************************************************************************** + * Enhancements + *****************************************************************************/ + + + +#endif /* _RGXCORE_KM_5_5_1_17_H_ */ diff --git a/drivers/gpu/rogue/hwdefs/km/cores/rgxcore_km_5.6.1.17.h b/drivers/gpu/rogue/hwdefs/km/cores/rgxcore_km_5.6.1.17.h new file mode 100644 index 000000000000..dbe36ddb56ca --- /dev/null +++ b/drivers/gpu/rogue/hwdefs/km/cores/rgxcore_km_5.6.1.17.h @@ -0,0 +1,72 @@ +/*************************************************************************/ /*! +@Title RGX Core BVNC 5.6.1.17 +@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_6_1_17_H_ +#define _RGXCORE_KM_5_6_1_17_H_ + +/***** Automatically generated file (10/28/2014 1:55:48 PM): Do not edit manually ********************/ +/***** Timestamp: (10/28/2014 1:55:48 PM)************************************************************/ +/***** CS: @2608598 ******************************************************************/ + + +/****************************************************************************** + * BVNC = 5.6.1.17 + *****************************************************************************/ +#define RGX_BVNC_KM_B 5 +#define RGX_BVNC_KM_V 6 +#define RGX_BVNC_KM_N 1 +#define RGX_BVNC_KM_C 17 + +/****************************************************************************** + * Errata + *****************************************************************************/ + +#define FIX_HW_BRN_38344 + + + +/****************************************************************************** + * Enhancements + *****************************************************************************/ + + + +#endif /* _RGXCORE_KM_5_6_1_17_H_ */ diff --git a/drivers/gpu/rogue/hwdefs/km/cores/rgxcore_km_5.8.1.16.h b/drivers/gpu/rogue/hwdefs/km/cores/rgxcore_km_5.8.1.16.h new file mode 100644 index 000000000000..51988a47fb39 --- /dev/null +++ b/drivers/gpu/rogue/hwdefs/km/cores/rgxcore_km_5.8.1.16.h @@ -0,0 +1,72 @@ +/*************************************************************************/ /*! +@Title RGX Core BVNC 5.8.1.16 +@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_8_1_16_H_ +#define _RGXCORE_KM_5_8_1_16_H_ + +/***** Automatically generated file (10/28/2014 1:55:48 PM): Do not edit manually ********************/ +/***** Timestamp: (10/28/2014 1:55:48 PM)************************************************************/ +/***** CS: @2882464 ******************************************************************/ + + +/****************************************************************************** + * BVNC = 5.8.1.16 + *****************************************************************************/ +#define RGX_BVNC_KM_B 5 +#define RGX_BVNC_KM_V 8 +#define RGX_BVNC_KM_N 1 +#define RGX_BVNC_KM_C 16 + +/****************************************************************************** + * Errata + *****************************************************************************/ + +#define FIX_HW_BRN_38344 + + + +/****************************************************************************** + * Enhancements + *****************************************************************************/ + + + +#endif /* _RGXCORE_KM_5_8_1_16_H_ */ diff --git a/drivers/gpu/rogue/hwdefs/km/cores/rgxcore_km_5.9.1.46.h b/drivers/gpu/rogue/hwdefs/km/cores/rgxcore_km_5.9.1.46.h new file mode 100644 index 000000000000..048eadc40cdc --- /dev/null +++ b/drivers/gpu/rogue/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 (10/28/2014 1:55:48 PM): Do not edit manually ********************/ +/***** Timestamp: (10/28/2014 1:55:48 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/hwdefs/km/rgx_cr_defs_km.h b/drivers/gpu/rogue/hwdefs/km/rgx_cr_defs_km.h new file mode 100644 index 000000000000..463a5ad6b620 --- /dev/null +++ b/drivers/gpu/rogue/hwdefs/km/rgx_cr_defs_km.h @@ -0,0 +1,4069 @@ +/*************************************************************************/ /*! +@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@2782796 + * 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) +/* + + Core Module Clock Control Modes. + + + Allows individual domain clocks to be forced off, forced on or operate under automatic pipeline activity based clock gating. This register is generally controlled by the GPU firmware and should be set to AUTO. Clock gating reduces the power consumed by the device. + +*/ +/* + 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) +/* BIF_TEXAS default: AUTO (0x00000002) */ +#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)) +/* IPP default: AUTO (0x00000002) */ +#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 */ + +/* FBC default: AUTO (0x00000002) */ +#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)) +/* FBDC default: AUTO (0x00000002) */ +#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)) +/* FB_TLCACHE default: AUTO (0x00000002) */ +#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)) +/* USCS default: AUTO (0x00000002) */ +#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)) +/* PBE default: AUTO (0x00000002) */ +#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)) +/* MCU_l1 default: AUTO (0x00000002) */ +#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)) +/* CDM default: AUTO (0x00000002) */ +#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)) +/* BIF default: AUTO (0x00000002) */ +#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)) +/* TPU_MCU_DEMUX default: AUTO (0x00000002) */ +#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)) +/* MCU_L0 default: AUTO (0x00000002) */ +#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)) +/* TPU default: AUTO (0x00000002) */ +#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)) +/* USC default: AUTO (0x00000002) */ +#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)) +/* TLA default: AUTO (0x00000002) */ +#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)) +/* SLC default: AUTO (0x00000002) */ +#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)) +/* PDS default: AUTO (0x00000002) */ +#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)) +/* VDM default: AUTO (0x00000002) */ +#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)) +/* PM default: AUTO (0x00000002) */ +#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)) +/* TSP default: AUTO (0x00000002) */ +#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)) +/* ISP default: AUTO (0x00000002) */ +#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) +/* + + Core Module Clock Control Modes. + + + Allows individual domain clocks to be forced off, forced on or operate under automatic pipeline activity based clock gating. This register is generally controlled by the GPU firmware and should be set to AUTO. Clock gating reduces the power consumed by the device. + +*/ +/* + 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) +/* BIF_TEXAS default: AUTO (0x00000002) */ +#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)) +/* IPP default: AUTO (0x00000002) */ +#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 */ + +/* FBC default: AUTO (0x00000002) */ +#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)) +/* FBDC default: AUTO (0x00000002) */ +#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)) +/* FB_TLCACHE default: AUTO (0x00000002) */ +#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)) +/* USCS default: AUTO (0x00000002) */ +#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)) +/* PBE default: AUTO (0x00000002) */ +#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)) +/* MCU_l1 default: AUTO (0x00000002) */ +#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)) +/* CDM default: AUTO (0x00000002) */ +#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)) +/* SIDEKICK default: AUTO (0x00000002) */ +#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)) +/* BIF_SIDEKICK default: AUTO (0x00000002) */ +#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)) +/* BIF default: AUTO (0x00000002) */ +#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)) +/* TPU_MCU_DEMUX default: AUTO (0x00000002) */ +#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)) +/* MCU_L0 default: AUTO (0x00000002) */ +#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)) +/* TPU default: AUTO (0x00000002) */ +#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)) +/* USC default: AUTO (0x00000002) */ +#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)) +/* TLA default: AUTO (0x00000002) */ +#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)) +/* SLC default: AUTO (0x00000002) */ +#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)) +/* UVS default: AUTO (0x00000002) */ +#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)) +/* PDS default: AUTO (0x00000002) */ +#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)) +/* VDM default: AUTO (0x00000002) */ +#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)) +/* PM default: AUTO (0x00000002) */ +#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)) +/* GPP default: AUTO (0x00000002) */ +#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)) +/* TE default: AUTO (0x00000002) */ +#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)) +/* TSP default: AUTO (0x00000002) */ +#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)) +/* ISP default: AUTO (0x00000002) */ +#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) +/* + + Reports the current module clock status + + + Clock gating state reflects the condition of the clock for each module + +*/ +/* + Register RGX_CR_CLK_STATUS +*/ +#define RGX_CR_CLK_STATUS (0x0008U) +#define RGX_CR_CLK_STATUS_MASKFULL (IMG_UINT64_C(0x00000001FF907773)) +/* MCU_FBTC default: GATED (0x00000000) */ +#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) +/* BIF_TEXAS default: GATED (0x00000000) */ +#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)) +/* IPP default: GATED (0x00000000) */ +#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 */ + +/* FBC default: GATED (0x00000000) */ +#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)) +/* FBDC default: GATED (0x00000000) */ +#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)) +/* FB_TLCACHE default: GATED (0x00000000) */ +#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)) +/* USCS default: GATED (0x00000000) */ +#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)) +/* PBE default: GATED (0x00000000) */ +#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)) +/* MCU_L1 default: GATED (0x00000000) */ +#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)) +/* CDM default: GATED (0x00000000) */ +#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)) +/* BIF default: GATED (0x00000000) */ +#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)) +/* TPU_MCU_DEMUX default: GATED (0x00000000) */ +#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)) +/* MCU_L0 default: GATED (0x00000000) */ +#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)) +/* TPU default: GATED (0x00000000) */ +#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)) +/* USC default: GATED (0x00000000) */ +#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)) +/* TLA default: GATED (0x00000000) */ +#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)) +/* SLC default: GATED (0x00000000) */ +#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)) +/* PDS default: GATED (0x00000000) */ +#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)) +/* VDM default: GATED (0x00000000) */ +#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)) +/* PM default: GATED (0x00000000) */ +#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)) +/* TSP default: GATED (0x00000000) */ +#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)) +/* ISP default: GATED (0x00000000) */ +#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) +/* + + Reports the current module clock status + + + Clock gating state reflects the condition of the clock for each module + +*/ +/* + Register RGX_CR_CLK_STATUS +*/ +#define RGX_CR_CLK_STATUS (0x0008U) +#define RGX_CR_CLK_STATUS_MASKFULL (IMG_UINT64_C(0x00000001FFF077FF)) +/* MCU_FBTC default: GATED (0x00000000) */ +#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) +/* BIF_TEXAS default: GATED (0x00000000) */ +#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)) +/* IPP default: GATED (0x00000000) */ +#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 */ + +/* FBC default: GATED (0x00000000) */ +#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)) +/* FBDC default: GATED (0x00000000) */ +#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)) +/* FB_TLCACHE default: GATED (0x00000000) */ +#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)) +/* USCS default: GATED (0x00000000) */ +#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)) +/* PBE default: GATED (0x00000000) */ +#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)) +/* MCU_L1 default: GATED (0x00000000) */ +#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)) +/* CDM default: GATED (0x00000000) */ +#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)) +/* SIDEKICK default: GATED (0x00000000) */ +#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)) +/* BIF_SIDEKICK default: GATED (0x00000000) */ +#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)) +/* BIF default: GATED (0x00000000) */ +#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)) +/* TPU_MCU_DEMUX default: GATED (0x00000000) */ +#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)) +/* MCU_L0 default: GATED (0x00000000) */ +#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)) +/* TPU default: GATED (0x00000000) */ +#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)) +/* USC default: GATED (0x00000000) */ +#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)) +/* TLA default: GATED (0x00000000) */ +#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)) +/* SLC default: GATED (0x00000000) */ +#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)) +/* UVS default: GATED (0x00000000) */ +#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)) +/* PDS default: GATED (0x00000000) */ +#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)) +/* VDM default: GATED (0x00000000) */ +#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)) +/* PM default: GATED (0x00000000) */ +#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)) +/* GPP default: GATED (0x00000000) */ +#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)) +/* TE default: GATED (0x00000000) */ +#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)) +/* TSP default: GATED (0x00000000) */ +#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)) +/* ISP default: GATED (0x00000000) */ +#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) */ + + +/* + + Reports the core ID + + + Core ID Register + +*/ +/* + Register RGX_CR_CORE_ID +*/ +#define RGX_CR_CORE_ID (0x0018U) +#define RGX_CR_CORE_ID_MASKFULL (IMG_UINT64_C(0x00000000FFFFFFFF)) +/* ID + Core ID +*/ +#define RGX_CR_CORE_ID_ID_SHIFT (16U) +#define RGX_CR_CORE_ID_ID_CLRMSK (0X0000FFFFU) +/* CONFIG + Core Configuration +*/ +#define RGX_CR_CORE_ID_CONFIG_SHIFT (0U) +#define RGX_CR_CORE_ID_CONFIG_CLRMSK (0XFFFF0000U) + + +/* + + Reports the core revision + + + Core Revision Register identifies the specific core revision. + This is updated to reflect the formal release status of the core. + +*/ +/* + Register RGX_CR_CORE_REVISION +*/ +#define RGX_CR_CORE_REVISION (0x0020U) +#define RGX_CR_CORE_REVISION_MASKFULL (IMG_UINT64_C(0x00000000FFFFFFFF)) +/* DESIGNER + Designer Field +*/ +#define RGX_CR_CORE_REVISION_DESIGNER_SHIFT (24U) +#define RGX_CR_CORE_REVISION_DESIGNER_CLRMSK (0X00FFFFFFU) +/* MAJOR default: 0x00000001 + Major Revision +*/ +#define RGX_CR_CORE_REVISION_MAJOR_SHIFT (16U) +#define RGX_CR_CORE_REVISION_MAJOR_CLRMSK (0XFF00FFFFU) +/* MINOR + Minor Revision +*/ +#define RGX_CR_CORE_REVISION_MINOR_SHIFT (8U) +#define RGX_CR_CORE_REVISION_MINOR_CLRMSK (0XFFFF00FFU) +/* MAINTENANCE + Maintenance Revision +*/ +#define RGX_CR_CORE_REVISION_MAINTENANCE_SHIFT (0U) +#define RGX_CR_CORE_REVISION_MAINTENANCE_CLRMSK (0XFFFFFF00U) + + +/* + + SOC Specific reporting register. + + + Designer Revision Field + The SOC designer can use this register for their own revision control + +*/ +/* + Register RGX_CR_DESIGNER_REV_FIELD1 +*/ +#define RGX_CR_DESIGNER_REV_FIELD1 (0x0028U) +#define RGX_CR_DESIGNER_REV_FIELD1_MASKFULL (IMG_UINT64_C(0x00000000FFFFFFFF)) +/* DESIGNER_REV_FIELD1 + Designer field +*/ +#define RGX_CR_DESIGNER_REV_FIELD1_DESIGNER_REV_FIELD1_SHIFT (0U) +#define RGX_CR_DESIGNER_REV_FIELD1_DESIGNER_REV_FIELD1_CLRMSK (00000000U) + + +/* + + SOC Specific reporting register. + + + Designer Revision Field + The SOC designer can use this register for their own revision control is required + +*/ +/* + Register RGX_CR_DESIGNER_REV_FIELD2 +*/ +#define RGX_CR_DESIGNER_REV_FIELD2 (0x0030U) +#define RGX_CR_DESIGNER_REV_FIELD2_MASKFULL (IMG_UINT64_C(0x00000000FFFFFFFF)) +/* DESIGNER_REV_FIELD2 + Designer field +*/ +#define RGX_CR_DESIGNER_REV_FIELD2_DESIGNER_REV_FIELD2_SHIFT (0U) +#define RGX_CR_DESIGNER_REV_FIELD2_DESIGNER_REV_FIELD2_CLRMSK (00000000U) + + +/* + + Core Module Clock Control Modes. + + + Allows individual domain clocks to be forced off, forced on or operate under automatic pipeline activity based clock gating. This register is generally controlled by the GPU firmware and should be set to AUTO. Clock gating reduces the power consumed by the device. + +*/ +/* + Register RGX_CR_CLK_XTPLUS_CTRL +*/ +#define RGX_CR_CLK_XTPLUS_CTRL (0x0080U) +#define RGX_CR_CLK_XTPLUS_CTRL_MASKFULL (IMG_UINT64_C(0x00000003FFFFFFFF)) +/* IPF default: AUTO (0x00000002) */ +#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)) +/* COMPUTE default: AUTO (0x00000002) */ +#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)) +/* PIXEL default: AUTO (0x00000002) */ +#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)) +/* VERTEX default: AUTO (0x00000002) */ +#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)) +/* USCPS default: AUTO (0x00000002) */ +#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)) +/* PDS_SHARED default: AUTO (0x00000002) */ +#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)) +/* BIF_BLACKPEARL default: AUTO (0x00000002) */ +#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)) +/* USC_SHARED default: AUTO (0x00000002) */ +#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)) +/* GEOMETRY default: AUTO (0x00000002) */ +#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)) +/* RAST default: AUTO (0x00000002) */ +#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)) +/* UVB default: AUTO (0x00000002) */ +#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)) +/* GPP default: AUTO (0x00000002) */ +#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)) +/* VDM_PIPE default: AUTO (0x00000002) */ +#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)) +/* VDM default: AUTO (0x00000002) */ +#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)) +/* TE3 default: AUTO (0x00000002) */ +#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)) +/* VCE default: AUTO (0x00000002) */ +#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)) +/* VBS default: AUTO (0x00000002) */ +#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)) + + +/* + + Reports the current module clock status + + + Clock gating state reflects the condition of the clock for each module + +*/ +/* + Register RGX_CR_CLK_XTPLUS_STATUS +*/ +#define RGX_CR_CLK_XTPLUS_STATUS (0x0088U) +#define RGX_CR_CLK_XTPLUS_STATUS_MASKFULL (IMG_UINT64_C(0x000000000000007F)) +/* UVB default: GATED (0x00000000) */ +#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)) +/* GPP default: GATED (0x00000000) */ +#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)) +/* VDM_PIPE default: GATED (0x00000000) */ +#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)) +/* VDM default: GATED (0x00000000) */ +#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)) +/* TE3 default: GATED (0x00000000) */ +#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)) +/* VCE default: GATED (0x00000000) */ +#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)) +/* VBS default: GATED (0x00000000) */ +#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)) + + +/* + + Core soft reset control register. + + + Write a '1' to reset and a '0' to clear + See the soft reset section in the TRM to understand how to use the soft reset register. + +*/ +/* + 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) +/* PHANTOM3_CORE*/ +#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)) +/* PHANTOM2_CORE*/ +#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)) +/* BERNADO2_CORE*/ +#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 */ + +/* JONES_CORE*/ +#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)) +/* TILING_CORE*/ +#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)) +/* TE3*/ +#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)) +/* VCE*/ +#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)) +/* VBS*/ +#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) +/* DPX1_CORE*/ +#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)) +/* DPX0_CORE*/ +#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)) +/* FBA*/ +#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)) +/* SH*/ +#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)) +/* VRDM*/ +#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 */ + +/* MCU_FBTC*/ +#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) +/* PHANTOM1_CORE*/ +#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)) +/* PHANTOM0_CORE*/ +#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)) +/* BERNADO1_CORE*/ +#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)) +/* BERNADO0_CORE*/ +#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)) +/* IPP*/ +#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)) +/* BIF_TEXAS*/ +#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)) +/* TORNADO_CORE*/ +#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 */ + +/* DUST_H_CORE*/ +#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)) +/* DUST_G_CORE*/ +#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)) +/* DUST_F_CORE*/ +#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)) +/* DUST_E_CORE*/ +#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)) +/* DUST_D_CORE*/ +#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)) +/* DUST_C_CORE*/ +#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)) +/* MMU*/ +#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)) +/* BIF1 +Sidekick BIF +*/ +#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)) +/* GARTEN +Includes MTS and META +*/ +#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)) +/* RASCAL_CORE +Note that the RASL_CORE bit affects logic related to the reading and writing of registers. This soft reset should therefore be used with caution. Upon power down events it is necessary to reset every register, so this bit should be used, but it must be release before any other resets, or beofre anyu other registers are programmed +*/ +#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)) +/* DUST_B_CORE*/ +#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)) +/* DUST_A_CORE*/ +#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)) +/* FB_TLCACHE*/ +#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)) +/* SLC*/ +#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)) +/* TLA*/ +#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)) +/* UVS*/ +#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)) +/* TE*/ +#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)) +/* GPP*/ +#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)) +/* FBDC*/ +#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)) +/* FBC*/ +#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)) +/* PM*/ +#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)) +/* PBE*/ +#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)) +/* USC_SHARED*/ +#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)) +/* MCU_L1*/ +#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)) +/* BIF +Bifpmcache BIF +*/ +#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)) +/* CDM*/ +#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)) +/* VDM*/ +#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)) +/* TESS*/ +#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)) +/* PDS*/ +#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)) +/* ISP*/ +#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)) +/* TSP*/ +#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)) +/* TPU_MCU_DEMUX*/ +#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)) +/* MCU_L0*/ +#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)) +/* TPU*/ +#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)) +/* USC*/ +#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)) + + +/* + + Core soft reset control register. + + + Write a '1' to reset and a '0' to clear + See the soft reset section in the TRM to understand how to use the soft reset register. + +*/ +/* + Register RGX_CR_SOFT_RESET2 +*/ +#define RGX_CR_SOFT_RESET2 (0x0108U) +#define RGX_CR_SOFT_RESET2_MASKFULL (IMG_UINT64_C(0x00000000000001FF)) +/* USCPS*/ +#define RGX_CR_SOFT_RESET2_USCPS_SHIFT (8U) +#define RGX_CR_SOFT_RESET2_USCPS_CLRMSK (0XFFFFFEFFU) +#define RGX_CR_SOFT_RESET2_USCPS_EN (0X00000100U) +/* IPF*/ +#define RGX_CR_SOFT_RESET2_IPF_SHIFT (7U) +#define RGX_CR_SOFT_RESET2_IPF_CLRMSK (0XFFFFFF7FU) +#define RGX_CR_SOFT_RESET2_IPF_EN (0X00000080U) +/* GEOMETRY*/ +#define RGX_CR_SOFT_RESET2_GEOMETRY_SHIFT (6U) +#define RGX_CR_SOFT_RESET2_GEOMETRY_CLRMSK (0XFFFFFFBFU) +#define RGX_CR_SOFT_RESET2_GEOMETRY_EN (0X00000040U) +/* USC_SHARED*/ +#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) +/* PDS_SHARED*/ +#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) +/* BIF_BLACKPEARL*/ +#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) +/* PIXEL*/ +#define RGX_CR_SOFT_RESET2_PIXEL_SHIFT (2U) +#define RGX_CR_SOFT_RESET2_PIXEL_CLRMSK (0XFFFFFFFBU) +#define RGX_CR_SOFT_RESET2_PIXEL_EN (0X00000004U) +/* COMPUTE*/ +#define RGX_CR_SOFT_RESET2_COMPUTE_SHIFT (1U) +#define RGX_CR_SOFT_RESET2_COMPUTE_CLRMSK (0XFFFFFFFDU) +#define RGX_CR_SOFT_RESET2_COMPUTE_EN (0X00000002U) +/* VERTEX*/ +#define RGX_CR_SOFT_RESET2_VERTEX_SHIFT (0U) +#define RGX_CR_SOFT_RESET2_VERTEX_CLRMSK (0XFFFFFFFEU) +#define RGX_CR_SOFT_RESET2_VERTEX_EN (0X00000001U) + + +/* + + The event status register indicate the source of an interrupt generated by PowerVR RGX + These events only schedule an interrupt context thread to run on META when the appropriate enables are set in RGX_CR_DMn_INTERRUPT_ENABLE + +*/ +/* + 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) +/* DPX_OUT_OF_MEMORY + The Doppler overflow FIFO in memory is full +*/ +#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) +/* DPX_MMU_PAGE_FAULT + A Doppler MMU page fault has occurred +*/ +#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) +/* RPM_OUT_OF_MEMORY + The Ray Page Manager has run out of free pages +*/ +#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) +/* FBA_FC3_FINISHED + All records for every attachment point of frame context 3 have been written out to memory +*/ +#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) +/* FBA_FC2_FINISHED + All records for every attachment point of frame context 2 have been written out to memory +*/ +#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) +/* FBA_FC1_FINISHED + All records for every attachment point of frame context 1 have been written out to memory +*/ +#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) +/* FBA_FC0_FINISHED + All records for every attachment point of frame context 0 have been written out to memory +*/ +#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) +/* RDM_FC3_FINISHED + All rays in frame context 3 have finished i.e RDM has encountered an interrupt command in the RT control stream +*/ +#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) +/* RDM_FC2_FINISHED + All rays in frame context 2 have finished i.e RDM has encountered an interrupt command in the RT control stream +*/ +#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) +/* RDM_FC1_FINISHED + All rays in frame context 1 have finished i.e RDM has encountered an interrupt command in the RT control stream +*/ +#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) +/* RDM_FC0_FINISHED + All rays in frame context 0 have finished i.e RDM has encountered an interrupt command in the RT control stream +*/ +#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) +/* SHG_FINISHED + SHG has completed the hierarchical voxelisation process and memory has been written +*/ +#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 */ + +/* USC_TRIGGER + One or more USC has executed a nop.trigger instruction +*/ +#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) +/* ZLS_FINISHED + ZLS has finished all tiles in a Render +*/ +#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) +/* GPIO_ACK + General Purpose ouput acknowledgement +*/ +#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) +/* GPIO_REQ + General Purpose input request +*/ +#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) +/* POWER_ABORT + The requested power operation has been denied. +*/ +#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) +/* POWER_COMPLETE + The requested power operation has completed +*/ +#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) +/* MMU_PAGE_FAULT + An MMU page fault has occurred +*/ +#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) +/* PM_3D_MEM_FREE + PM memory allocation completed for the current render +*/ +#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) +/* PM_OUT_OF_MEMORY + PM memory allocation failed for a macro-tile +*/ +#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) +/* TA_TERMINATE + The TE has aborted a macro tile after a failted PM allocation request +*/ +#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) +/* TA_FINISHED + The TA phase has completed +*/ +#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) +/* ISP_END_MACROTILE + ISP End-of-Macrotile +*/ +#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) +/* PIXELBE_END_RENDER + The 3D phase has completed +*/ +#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) +/* COMPUTE_FINISHED + The compute phase has completed +*/ +#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) +/* KERNEL_FINISHED + A compute kernel has completed and updated the associated event object in external memory +*/ +#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) +/* TLA_COMPLETE + The 2D core has completed writing out all data to memory and it has received a complete signal from the memory interface +*/ +#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) + + +/* + + This register contains the value of a 48-bit internal timer. + The timer runs continuously, and wraps at the top end. + It counts 256 cycles at the core clock frequency. + + + This means that at 100 MHz: + 1 count value = 1/100MHz = 256 * 10 * 10^-9 seconds = 2.56 us + + In order to avoid having to issue three 32-bit reads to detect the lower 32-bits wrapping, the MSB of the low 32-bit word is duplicated in the MSB of the high 32-bit word. + +*/ +/* + Register RGX_CR_TIMER +*/ +#define RGX_CR_TIMER (0x0160U) +#define RGX_CR_TIMER_MASKFULL (IMG_UINT64_C(0x8000FFFFFFFFFFFF)) +/* BIT31*/ +#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)) +/* VALUE*/ +#define RGX_CR_TIMER_VALUE_SHIFT (0U) +#define RGX_CR_TIMER_VALUE_CLRMSK (IMG_UINT64_C(0XFFFF000000000000)) + + +/* + Register RGX_CR_META_SP_MSLVDATAX +*/ +#define RGX_CR_META_SP_MSLVDATAX (0x0A00U) +#define RGX_CR_META_SP_MSLVDATAX_MASKFULL (IMG_UINT64_C(0x00000000FFFFFFFF)) +/* MSLVDATAX +This register holds the last data value read or written by the slave port +*/ +#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)) +/* MSLVDATAT +This register updates or returns the same value as MSLVDATAX. However each read/write transaction on this register also starts the corresponding transfer within the META Core +*/ +#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)) +/* ADDR +32-bit byte address specifying the address at which the next read or write access should be made within the META core memory map. +*/ +#define RGX_CR_META_SP_MSLVCTRL0_ADDR_SHIFT (2U) +#define RGX_CR_META_SP_MSLVCTRL0_ADDR_CLRMSK (0X00000003U) +/* AUTOINCR +Selects auto-increment addressing mode when set to 1. The address specified in ADDR (bits 31-2) will be incremented after each transaction is transmitted by the slave port. +*/ +#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) +/* RD +If written with the value 1 a read to the address specified (see below) will be issued and this bit will clear back to zero once the read transaction is transmitted by the slave port. +*/ +#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)) +/* DEFERRTHREAD +Deferred bus error thread ID. (Read only) +*/ +#define RGX_CR_META_SP_MSLVCTRL1_DEFERRTHREAD_SHIFT (30U) +#define RGX_CR_META_SP_MSLVCTRL1_DEFERRTHREAD_CLRMSK (0X3FFFFFFFU) +/* LOCK2_INTERLOCK +Slave interface LOCK2 interlock active (Read only) +*/ +#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) +/* ATOMIC_INTERLOCK +Atomic inter-lock active in MMU arbiter (Read only) +*/ +#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) +/* GBLPORT_IDLE +Global internal register access port idle (Read only) +*/ +#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) +/* COREMEM_IDLE +Core memory update register idle (Read only) +*/ +#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) +/* READY +Slave port ready to issue a further read or write request (Read only) +*/ +#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) +/* DEFERRID +Deferred bus error code (Read only) +*/ +#define RGX_CR_META_SP_MSLVCTRL1_DEFERRID_SHIFT (21U) +#define RGX_CR_META_SP_MSLVCTRL1_DEFERRID_CLRMSK (0XFF1FFFFFU) +/* DEFERR +This bit is set to '1' when a slave access generated a deferred bus error. Writing '0' to this bit clears this flag. Once this flag is set to '1', further bus errors would be ignored until it is cleared. +*/ +#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) +/* WR_ACTIVE +If set means that a write is still in progress within the META core, else zero if write(s) have completed (Read only) +*/ +#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) +/* THREAD +Specifies the thread identifier to be issued on read or write transactions within the META core. +*/ +#define RGX_CR_META_SP_MSLVCTRL1_THREAD_SHIFT (4U) +#define RGX_CR_META_SP_MSLVCTRL1_THREAD_CLRMSK (0XFFFFFFCFU) +/* TRANS_SIZE +Selects the transaction size (number of byte lanes) generated within the META core for writes or reads. The following sizes are currently supported, 0 - 32-bit, 1 - 16-bit, and 2 - 8-bit. +*/ +#define RGX_CR_META_SP_MSLVCTRL1_TRANS_SIZE_SHIFT (2U) +#define RGX_CR_META_SP_MSLVCTRL1_TRANS_SIZE_CLRMSK (0XFFFFFFF3U) +/* BYTE_ROUND +Byte routing/shift to be applied to data transfers performed on the MSLVDATAX and MSLVDATAT registers. Data will be duplicated in either direction so that 8-bit or 16-bit read or write operations can be performed using the lower part of the slave interface data bus. +*/ +#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)) +/* INPUT +JTAG GPIO Input. Used for S/W handshake with the JTAG port. +*/ +#define RGX_CR_META_SP_MSLVHANDSHKE_INPUT_SHIFT (2U) +#define RGX_CR_META_SP_MSLVHANDSHKE_INPUT_CLRMSK (0XFFFFFFF3U) +/* OUTPUT +JTAG GPIO Output. Used for S/W handshake with the JTAG port. +*/ +#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)) +/* MSLVT0KICK +Writing the unsigned integer value n to the bottom 16-bits of this register will cause n kicks to be accumulated by thread 0's 16-bit background kick accumulator. For read these bits are always read as '0' as this register is merely a conduit and has no associated store. +*/ +#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)) +/* MSLVT0KICKI +Writing the unsigned integer value n to the bottom 16-bits of this register will cause n kicks to be accumulated by thread 0's 16-bit interrupt kick accumulator. For read these bits are always read as '0' as this register is merely a conduit and has no associated store. +*/ +#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)) +/* MSLVT1KICK +same behavior as MSLVT0KICK, but for thread1 +*/ +#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)) +/* MSLVT1KICKI +same behavior as MSLVT0KICKI, but for thread1 +*/ +#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)) +/* MSLVT2KICK +same behavior as MSLVT0KICK, but for thread2 +*/ +#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)) +/* MSLVT2KICKI +same behavior as MSLVT0KICKI, but for thread2 +*/ +#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)) +/* MSLVT3KICK +same behavior as MSLVT0KICK, but for thread3 +*/ +#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)) +/* MSLVT3KICKI +same behavior as MSLVT0KICKI, but for thread3 +*/ +#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)) +/* SOFTRESET +This write only bit may be used to soft reset the core. If a value of '1' is written to bit 0 the core will be held in reset. The register must subsequently be cleared again to take the core out of reset. To ensure correct operation the core must be held in reset for at least 16 core clock cycles. +*/ +#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)) +/* TRIGVECT3 +IRQ event occurred due to vectoring to an event inside META core to the host (set trigger vector to 3). This status bit can be written with '0' to clear the IRQ event +*/ +#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) +/* TRIGVECT2 +IRQ event occurred due to vectoring to an event inside META core to the host (set trigger vector to 2). This status bit can be written with '0' to clear the IRQ event. +*/ +#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)) +/* EVENT1 +Enable Slave interrupt event 1 to raise an output interrupt. +*/ +#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) +/* EVENT0 +Enable Slave interrupt event 0 to raise an output interrupt. +*/ +#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)) +/* MODE +Level or edge mode for the META core output triggers. +*/ +#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) + + +/* + + This register allows firmware tasks to be scheduled on the META (Garten) core. + +*/ +/* + Register RGX_CR_MTS_SCHEDULE +*/ +#define RGX_CR_MTS_SCHEDULE (0x0B00U) +#define RGX_CR_MTS_SCHEDULE_MASKFULL (IMG_UINT64_C(0x00000000000001FF)) +/* HOST +Host Interrupte kick +*/ +#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) +/* PRIORITY +DataMaster Priority +*/ +#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) +/* CONTEXT default: BGCTX (0x00000000) */ +#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) +/* TASK default: NON_COUNTED (0x00000000) */ +#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) +/* DM +DataMaster Type +*/ +#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) + + +/* + + This register allows firmware tasks to be scheduled on the META (Garten) core. + +*/ +/* + Register RGX_CR_MTS_SCHEDULE1 +*/ +#define RGX_CR_MTS_SCHEDULE1 (0x10B00U) +#define RGX_CR_MTS_SCHEDULE1_MASKFULL (IMG_UINT64_C(0x00000000000001FF)) +/* HOST +Host Interrupte kick +*/ +#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) +/* PRIORITY +DataMaster Priority +*/ +#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) +/* CONTEXT default: BGCTX (0x00000000) */ +#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) +/* TASK default: NON_COUNTED (0x00000000) */ +#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) +/* DM +DataMaster Type +*/ +#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) + + +/* + + This register allows firmware tasks to be scheduled on the META (Garten) core. + +*/ +/* + Register RGX_CR_MTS_SCHEDULE2 +*/ +#define RGX_CR_MTS_SCHEDULE2 (0x20B00U) +#define RGX_CR_MTS_SCHEDULE2_MASKFULL (IMG_UINT64_C(0x00000000000001FF)) +/* HOST +Host Interrupte kick +*/ +#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) +/* PRIORITY +DataMaster Priority +*/ +#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) +/* CONTEXT default: BGCTX (0x00000000) */ +#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) +/* TASK default: NON_COUNTED (0x00000000) */ +#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) +/* DM +DataMaster Type +*/ +#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) + + +/* + + This register allows firmware tasks to be scheduled on the META (Garten) core. + +*/ +/* + Register RGX_CR_MTS_SCHEDULE3 +*/ +#define RGX_CR_MTS_SCHEDULE3 (0x30B00U) +#define RGX_CR_MTS_SCHEDULE3_MASKFULL (IMG_UINT64_C(0x00000000000001FF)) +/* HOST +Host Interrupte kick +*/ +#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) +/* PRIORITY +DataMaster Priority +*/ +#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) +/* CONTEXT default: BGCTX (0x00000000) */ +#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) +/* TASK default: NON_COUNTED (0x00000000) */ +#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) +/* DM +DataMaster Type +*/ +#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) + + +/* + + This register allows firmware tasks to be scheduled on the META (Garten) core. + +*/ +/* + Register RGX_CR_MTS_SCHEDULE4 +*/ +#define RGX_CR_MTS_SCHEDULE4 (0x40B00U) +#define RGX_CR_MTS_SCHEDULE4_MASKFULL (IMG_UINT64_C(0x00000000000001FF)) +/* HOST +Host Interrupte kick +*/ +#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) +/* PRIORITY +DataMaster Priority +*/ +#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) +/* CONTEXT default: BGCTX (0x00000000) */ +#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) +/* TASK default: NON_COUNTED (0x00000000) */ +#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) +/* DM +DataMaster Type +*/ +#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) + + +/* + + This register allows firmware tasks to be scheduled on the META (Garten) core. + +*/ +/* + Register RGX_CR_MTS_SCHEDULE5 +*/ +#define RGX_CR_MTS_SCHEDULE5 (0x50B00U) +#define RGX_CR_MTS_SCHEDULE5_MASKFULL (IMG_UINT64_C(0x00000000000001FF)) +/* HOST +Host Interrupte kick +*/ +#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) +/* PRIORITY +DataMaster Priority +*/ +#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) +/* CONTEXT default: BGCTX (0x00000000) */ +#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) +/* TASK default: NON_COUNTED (0x00000000) */ +#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) +/* DM +DataMaster Type +*/ +#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) + + +/* + + This register allows firmware tasks to be scheduled on the META (Garten) core. + +*/ +/* + Register RGX_CR_MTS_SCHEDULE6 +*/ +#define RGX_CR_MTS_SCHEDULE6 (0x60B00U) +#define RGX_CR_MTS_SCHEDULE6_MASKFULL (IMG_UINT64_C(0x00000000000001FF)) +/* HOST +Host Interrupte kick +*/ +#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) +/* PRIORITY +DataMaster Priority +*/ +#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) +/* CONTEXT default: BGCTX (0x00000000) */ +#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) +/* TASK default: NON_COUNTED (0x00000000) */ +#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) +/* DM +DataMaster Type +*/ +#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) + + +/* + + This register allows firmware tasks to be scheduled on the META (Garten) core. + +*/ +/* + Register RGX_CR_MTS_SCHEDULE7 +*/ +#define RGX_CR_MTS_SCHEDULE7 (0x70B00U) +#define RGX_CR_MTS_SCHEDULE7_MASKFULL (IMG_UINT64_C(0x00000000000001FF)) +/* HOST +Host Interrupte kick +*/ +#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) +/* PRIORITY +DataMaster Priority +*/ +#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) +/* CONTEXT default: BGCTX (0x00000000) */ +#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) +/* TASK default: NON_COUNTED (0x00000000) */ +#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) +/* DM +DataMaster Type +*/ +#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) + + +#if defined(RGX_FEATURE_S7_TOP_INFRASTRUCTURE) +/* + + This register contains the configuration options for the Garten wrapper. + +*/ +/* + 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(0x000FF0FFFFFFF001)) +/* FENCE_PC_BASE +Page Catalogue base address number to be used for fence requests +*/ +#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)) +/* FENCE_ADDR +4k page address to be used for fence requests +*/ +#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)) +/* IDLE_CTRL default: MTS (0x00000001) */ +#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) +/* + + This register contains the configuration options for the Garten wrapper. + +*/ +/* + 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)) +/* FENCE_PC_BASE +Page Catalogue base address number to be used for fence requests +*/ +#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)) +/* FENCE_DM +Data master value to be used for fence requests +*/ +#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)) +/* FENCE_ADDR +4k page address to be used for fence requests +*/ +#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)) +/* IDLE_CTRL default: MTS (0x00000001) */ +#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_META_BOOT +*/ +#define RGX_CR_META_BOOT (0x0BF8U) +#define RGX_CR_META_BOOT_MASKFULL (IMG_UINT64_C(0x0000000000000001)) +/* MODE + 0 = Don't boot, 1 = Boot +*/ +#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)) +/* FORCE_COHERENCY default: 0x00000001 + 0 = SLC control, 1 = SLC Coherency Forced +*/ +#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) + + +/* + Index registers per data master. Byte aligned fields to allow byte-masked access +*/ +/* + 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) +/* RVTX +Catalogue base address for VRDM, SHF, SHG and RPM +*/ +#define RGX_CR_BIF_CAT_BASE_INDEX_RVTX_SHIFT (48U) +#define RGX_CR_BIF_CAT_BASE_INDEX_RVTX_CLRMSK (IMG_UINT64_C(0XFFF8FFFFFFFFFFFF)) +/* RAY +Catalogue base address for RDM and FBA +*/ +#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 */ + +/* HOST +Catalogue Base number for HOST data master +*/ +#define RGX_CR_BIF_CAT_BASE_INDEX_HOST_SHIFT (32U) +#define RGX_CR_BIF_CAT_BASE_INDEX_HOST_CLRMSK (IMG_UINT64_C(0XFFFFFFF8FFFFFFFF)) +/* TLA +Catalogue Base number for TLA data master +*/ +#define RGX_CR_BIF_CAT_BASE_INDEX_TLA_SHIFT (24U) +#define RGX_CR_BIF_CAT_BASE_INDEX_TLA_CLRMSK (IMG_UINT64_C(0XFFFFFFFFF8FFFFFF)) +/* CDM +Catalogue Base number for CDM data master +*/ +#define RGX_CR_BIF_CAT_BASE_INDEX_CDM_SHIFT (16U) +#define RGX_CR_BIF_CAT_BASE_INDEX_CDM_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFF8FFFF)) +/* PIXEL +Catalogue Base number for PIXEL data master +*/ +#define RGX_CR_BIF_CAT_BASE_INDEX_PIXEL_SHIFT (8U) +#define RGX_CR_BIF_CAT_BASE_INDEX_PIXEL_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFF8FF)) +/* TA +Catalogue Base number for TA data master +*/ +#define RGX_CR_BIF_CAT_BASE_INDEX_TA_SHIFT (0U) +#define RGX_CR_BIF_CAT_BASE_INDEX_TA_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFF8)) + + +/* + +Indicates a fault has occurred on bank 0 and provides details of fault + +*/ +/* + 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)) +/* CAT_BASE +Catalogue base address number +*/ +#define RGX_CR_BIF_FAULT_BANK0_MMU_STATUS_CAT_BASE_SHIFT (12U) +#define RGX_CR_BIF_FAULT_BANK0_MMU_STATUS_CAT_BASE_CLRMSK (0XFFFF0FFFU) +/* PAGE_SIZE +Page size +*/ +#define RGX_CR_BIF_FAULT_BANK0_MMU_STATUS_PAGE_SIZE_SHIFT (8U) +#define RGX_CR_BIF_FAULT_BANK0_MMU_STATUS_PAGE_SIZE_CLRMSK (0XFFFFF8FFU) +/* DATA_TYPE +MMU data type that was invalid (on valid fault) +*/ +#define RGX_CR_BIF_FAULT_BANK0_MMU_STATUS_DATA_TYPE_SHIFT (5U) +#define RGX_CR_BIF_FAULT_BANK0_MMU_STATUS_DATA_TYPE_CLRMSK (0XFFFFFF9FU) +/* FAULT_RO +Indicates read-only fault('1') or valid fault('0') +*/ +#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) +/* FAULT_PM_META_RO +Indicates pm/meta protected region fault +*/ +#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) +/* FAULT +Indicates a fault has occured +*/ +#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) + + +/* + +Provides details of the request that faulted on bank 0 + +*/ +/* + 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)) +/* RNW*/ +#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)) +/* TAG_SB*/ +#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)) +/* TAG_ID*/ +#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)) +/* ADDRESS*/ +#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) + + +/* + +Indicates a fault has occurred on bank 1 and provides details of fault + +*/ +/* + 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)) +/* CAT_BASE +Catalogue base address number +*/ +#define RGX_CR_BIF_FAULT_BANK1_MMU_STATUS_CAT_BASE_SHIFT (12U) +#define RGX_CR_BIF_FAULT_BANK1_MMU_STATUS_CAT_BASE_CLRMSK (0XFFFF0FFFU) +/* PAGE_SIZE +Page size +*/ +#define RGX_CR_BIF_FAULT_BANK1_MMU_STATUS_PAGE_SIZE_SHIFT (8U) +#define RGX_CR_BIF_FAULT_BANK1_MMU_STATUS_PAGE_SIZE_CLRMSK (0XFFFFF8FFU) +/* DATA_TYPE +MMU data type that was invalid (on valid fault) +*/ +#define RGX_CR_BIF_FAULT_BANK1_MMU_STATUS_DATA_TYPE_SHIFT (5U) +#define RGX_CR_BIF_FAULT_BANK1_MMU_STATUS_DATA_TYPE_CLRMSK (0XFFFFFF9FU) +/* FAULT_RO +Indicates read-only fault('1') of valid fault('0') +*/ +#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) +/* FAULT_PM_META_RO +Indicates pm/meta protected region fault +*/ +#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) +/* FAULT +Indicates a fault has occured +*/ +#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) + + +/* + +Provides details of the request that faulted on bank 1 + +*/ +/* + 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)) +/* RNW*/ +#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)) +/* TAG_SB*/ +#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)) +/* TAG_ID*/ +#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)) +/* ADDRESS*/ +#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) + + +/* + +Specifies physical address to read from in the event of a faulting read request from BIF1 + +*/ +/* + Register RGX_CR_BIF_FAULT_READ +*/ +#define RGX_CR_BIF_FAULT_READ (0x13E0U) +#define RGX_CR_BIF_FAULT_READ_MASKFULL (IMG_UINT64_C(0x000000FFFFFFFFF0)) +/* ADDRESS*/ +#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) + + +/* + +Indicates a fault has occurred on bank 0 and provides details of fault + +*/ +/* + 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)) +/* CAT_BASE +Catalogue base address number +*/ +#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) +/* PAGE_SIZE +Page size +*/ +#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) +/* DATA_TYPE +MMU data type that was invalid (on valid fault) +*/ +#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) +/* FAULT_RO +Indicates read-only fault('1') or valid fault('0') +*/ +#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) +/* FAULT_PM_META_RO +Indicates pm/meta protected region fault +*/ +#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) +/* FAULT +Indicates a fault has occured +*/ +#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) + + +/* + +Provides details of the request that faulted on bank 0 + +*/ +/* + 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)) +/* RNW*/ +#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)) +/* TAG_SB*/ +#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)) +/* TAG_ID*/ +#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)) +/* ADDRESS*/ +#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) + + +/* + + SLC control registers + +*/ +/* + Register RGX_CR_SLC_CTRL_MISC +*/ +#define RGX_CR_SLC_CTRL_MISC (0x3800U) +#define RGX_CR_SLC_CTRL_MISC_MASKFULL (IMG_UINT64_C(0xFFFFFFFF00FF0105)) +/* SCRAMBLE_BITS + Pattern of bits used to determine the Cache Bank in Address Decode mode 0x21. The actual Cache Bank to use is determined by indexing into the 32 Scramble Bits using the 5 LSB's of the Hash result and then XORing this with Bit 6 of the incoming address to give a single bit result +*/ +#define RGX_CR_SLC_CTRL_MISC_SCRAMBLE_BITS_SHIFT (32U) +#define RGX_CR_SLC_CTRL_MISC_SCRAMBLE_BITS_CLRMSK (IMG_UINT64_C(0X00000000FFFFFFFF)) +/* ADDR_DECODE_MODE default: INTERLEAVED_64_BYTE (0x00000000) +(null) +*/ +#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)) +/* PAUSE + Pause the SLC +*/ +#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)) +/* ENABLE_LINE_USE_LIMIT + Enable the use of cache line limits +*/ +#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)) +/* BYPASS_BURST_COMBINER default: 0x00000001 + Disable the burst combiner on the external memory interface +*/ +#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)) + + +/* + + SLC Flush & Invalidate control. + Note that per Data Master operations will flush any cache lines that have been made dirty by any writes from the specified Data Master. Combined Invalidate operation then only invalidates entries that have been referenced solely by the specified Data Master, any cache lines referenced by multiple Data Masters will not be affected by a per Data Master invalidate operation and will remain valid. + +*/ +/* + 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)) +/* LAZY + Advanced mode of operation whereby other requestors are not blocked whilst the Flush Invalidate is in progress +*/ +#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) +/* DM_RAY_VERTEX + When set, flush all SLC entries made dirty by the ray tracing VERTEX_RAY data master, then invalidate all SLC entries referenced solely by the ray tracing VERTEX_RAY +*/ +#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) +/* DM_RAY + When set, flush all SLC entries made dirty by the ray tracing RAY data master, then invalidate all SLC entries referenced solely by the ray tracing RAY +*/ +#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 */ + +/* DM_FRC + When set, flush all SLC entries made dirty by the FRC Video Core, then invalidate all SLC entries referenced solely by the FRC Video Core (Optional feature) +*/ +#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) +/* DM_VXE + When set, flush all SLC entries made dirty by the VXE Video Core, then invalidate all SLC entries referenced solely by the VXE Video Core (Optional feature) +*/ +#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) +/* DM_VXD + When set, flush all SLC entries made dirty by the VXD Video Core, then invalidate all SLC entries referenced solely by the VXD Video Core (Optional feature) +*/ +#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) +/* DM_HOST_META + When set, flush all SLC entries made dirty by the HOST or META, then invalidate all SLC entries referenced solely by the HOST or META +*/ +#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) +/* DM_MMU + When set, flush all SLC entries made dirty by the MMU, then invalidate all SLC entries referenced solely by the MMU +*/ +#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) +/* DM_COMPUTE + When set, flush all SLC entries made dirty by the COMPUTE data master, then invalidate all SLC entries referenced solely by the COMPUTE data master +*/ +#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) +/* DM_PIXEL + When set, flush all SLC entries made dirty by the PIXEL data master, then invalidate all SLC entries referenced solely by the PIXEL data master +*/ +#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) +/* DM_TA + When set, flush all SLC entries made dirty by the TA group which includes VERTEX, TESSELLATOR & STREAM_OUT data masters, then invalidate all SLC entries referenced solely by the TA group which includes VERTEX, TESSELLATOR & STREAM_OUT data masters +*/ +#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) +/* ALL + When set, flush all SLC entries, then invalidate all SLC entries +*/ +#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) + + +/* + + Current status of Flush / Invalidate operations within the SLC + +*/ +/* + Register RGX_CR_SLC_STATUS0 +*/ +#define RGX_CR_SLC_STATUS0 (0x3820U) +#define RGX_CR_SLC_STATUS0_MASKFULL (IMG_UINT64_C(0x0000000000000007)) +/* FLUSH_INVAL_PENDING +1 indicates there is a pending request to perform a combined Flush Invalidate on the SLC +*/ +#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) +/* INVAL_PENDING +1 indicates there is a pending request to Invalidate the SLC +*/ +#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) +/* FLUSH_PENDING +1 indicates there is a pending request to Flush the SLC +*/ +#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) + + +/* + + SLC Bypass control + +*/ +/* + 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) +/* DM_RAY_VERTEX + Bypass SLC for ray tracing VERTEX_RAY (CPF) requestor +*/ +#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) +/* DM_RAY + Bypass SLC for ray tracing RAY requestor +*/ +#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 */ + +/* REQ_IPF_CPF + Bypass SLC for IPF (CPF) requestor +*/ +#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) +/* REQ_TPU + Bypass SLC for TPU requests coming from the MCU requestor +*/ +#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) +/* REQ_FBDC + Bypass SLC for the FBDC requestor +*/ +#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) +/* REQ_TLA + Bypass SLC for the TLA requestor +*/ +#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) +/* BYP_CC_N + Bypass SLC when Cache Coherency bit is not set +*/ +#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) +/* BYP_CC + Bypass SLC when Cache Coherency bit is set +*/ +#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) +/* REQ_MCU + Bypass SLC for the MCU requestor +*/ +#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) +/* REQ_PDS + Bypass SLC for the PDS requestor +*/ +#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) +/* REQ_TPF + Bypass SLC for the TPF requestor +*/ +#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) +/* REQ_TA_TPC + Bypass SLC for the TA (Tail Pointer Cache data) requestor +*/ +#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) +/* REQ_IPF_OBJ + Bypass SLC for the IPF (Object data) requestor +*/ +#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) +/* REQ_USC + Bypass SLC for the USC requestor +*/ +#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) +/* REQ_META + Bypass SLC for the META requestor +*/ +#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) +/* REQ_HOST + Bypass SLC for the Host requestor +*/ +#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) +/* REQ_MMU_PT + Bypass SLC for the MMU requestor (Page Table data) +*/ +#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) +/* REQ_MMU_PD + Bypass SLC for the MMU requestor (Page Directory data) +*/ +#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) +/* REQ_MMU_PC + Bypass SLC for the MMU requestor (Page Catalogue data) +*/ +#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) +/* DM_FRC + Bypass SLC for the FRC Video Core (Optional feature) +*/ +#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) +/* DM_VXE + Bypass SLC for the VXE Video Core (Optional feature) +*/ +#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) +/* DM_VXD + Bypass SLC for the VXD Video Core (Optional feature) +*/ +#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) +/* DM_HOST_META + Bypass SLC the HOST/META data master +*/ +#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) +/* DM_MMU + Bypass SLC the MMU data master +*/ +#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) +/* DM_COMPUTE + Bypass SLC the COMPUTE data master +*/ +#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) +/* DM_PIXEL + Bypass SLC for the PIXEL data master +*/ +#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) +/* DM_TA + Bypass SLC for the TA group which includes VERTEX, TESSELLATOR & STREAM_OUT data masters +*/ +#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) +/* ALL + Bypass SLC for all requesters +*/ +#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) + + +/* + + AXI ACE-LITE configuration registers + +*/ +/* + 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)) +/* DISABLE_COHERENT_WRITELINEUNIQUE +SET to 1 to disable coherent write line uniques +*/ +#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)) +/* DISABLE_COHERENT_WRITE +SET to 1 to disable coherent writes +*/ +#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)) +/* DISABLE_COHERENT_READ +SET to 1 to disable coherent reads +*/ +#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)) +/* ARCACHE_CACHE_MAINTENANCE default: 0x00000002 +Read cache policy for cache maintenance transactions - bit[1] should be set to 1 +*/ +#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)) +/* ARCACHE_COHERENT default: 0x00000002 +Read cache policy for coherent transactions - bit[1] should be set to 1 +*/ +#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)) +/* AWCACHE_COHERENT default: 0x00000002 +Write cache policy for coherent transactions - bit[1] should be set to 1 +*/ +#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)) +/* ARDOMAIN_BARRIER +Read shareability domain for barrier transactions + 00 = Non-Shareable + 01 = Inner Shareable + 10 = Outer Shareable + 11 = System +*/ +#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)) +/* AWDOMAIN_BARRIER +Write shareability domain for barrier transactions + 00 = Non-Shareable + 01 = Inner Shareable + 10 = Outer Shareable + 11 = System +*/ +#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)) +/* ARDOMAIN_CACHE_MAINTENANCE +Read shareability domain for cache maintenance transactions + 00 = Non-Shareable + 01 = Inner Shareable + 10 = Outer Shareable +*/ +#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)) +/* AWDOMAIN_COHERENT default: 0x00000001 +Write shareability domain for coherant transactions + 01 = Inner Shareable + 10 = Outer Shareable +*/ +#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)) +/* ARDOMAIN_COHERENT default: 0x00000001 +Read shareability domain for coherant transactions + 01 = Inner Shareable + 10 = Outer Shareable +*/ +#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)) +/* ARDOMAIN_NON_SNOOPING +Read shareability domain for non-snooping transactions + 00 = Non-Shareable + 11 = System +*/ +#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)) +/* AWDOMAIN_NON_SNOOPING +Write shareability domain for non-snooping transactions + 00 = Non-Shareable + 11 = System +*/ +#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)) +/* ARCACHE_NON_SNOOPING +Read cache policy for non-snooping transactions +*/ +#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)) +/* AWCACHE_NON_SNOOPING +Write cache policy for non-snooping transactions +*/ +#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)) + + +/* + + SLC control registers + +*/ +/* + Register RGX_CR_SLC_CTRL_MISC2 +*/ +#define RGX_CR_SLC_CTRL_MISC2 (0x3930U) +#define RGX_CR_SLC_CTRL_MISC2_MASKFULL (IMG_UINT64_C(0x00000000FFFFFFFF)) +/* SCRAMBLE_BITS + Pattern of bits used to determine the MSB of the Cache Bank in 4 Bank configurations in Address Decode mode 0x21. The actual Cache Bank to use is determined by indexing into the 32 Scramble Bits using the 5 LSB's of the Hash result and then XORing this with Bit 6 of the incoming address to give a single bit result +*/ +#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)) +/* BYPASS + control register bit to bypass load balancing in SLC crossbar. In this case, the requests from + img-memif0 will go directly to ocp-memif0 and so on +*/ +#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)) +/* COUNT +The number of TA phases completed +*/ +#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)) +/* COUNT +The number of 3D phases completed +*/ +#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)) +/* COUNT +The number of Compute phases completed +*/ +#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)) +/* COUNT +The number of cycles spent in TA phases +*/ +#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)) +/* COUNT +The number of cycles spent in 3D phases +*/ +#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)) +/* COUNT +The number of cycles spent in Compute phases +*/ +#define RGX_CR_PERF_COMPUTE_CYCLE_COUNT_SHIFT (0U) +#define RGX_CR_PERF_COMPUTE_CYCLE_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)) +/* CYCLES +The number of cycles it takes the 3D pipeline to spin-up +*/ +#define RGX_CR_PERF_3D_SPINUP_CYCLES_SHIFT (0U) +#define RGX_CR_PERF_3D_SPINUP_CYCLES_CLRMSK (00000000U) + + +/* + + This defines the core revision and bus widths of the core. See IPG spec for more details. + +*/ +/* + Register RGX_CR_OCP_REVINFO +*/ +#define RGX_CR_OCP_REVINFO (0x9000U) +#define RGX_CR_OCP_REVINFO_MASKFULL (IMG_UINT64_C(0x00000007FFFFFFFF)) +/* HWINFO_SYSBUS default: 0x00000001 +System data bus width, 0: 32 bits, 1: 64 bits, 2: 128 bits +*/ +#define RGX_CR_OCP_REVINFO_HWINFO_SYSBUS_SHIFT (33U) +#define RGX_CR_OCP_REVINFO_HWINFO_SYSBUS_CLRMSK (IMG_UINT64_C(0XFFFFFFF9FFFFFFFF)) +/* HWINFO_MEMBUS +Memory data bus width, 0: 128 bis, 1: 256 bits +*/ +#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)) +/* REVISION default: 0x40000000 +Core revision +*/ +#define RGX_CR_OCP_REVINFO_REVISION_SHIFT (0U) +#define RGX_CR_OCP_REVINFO_REVISION_CLRMSK (IMG_UINT64_C(0XFFFFFFFF00000000)) + + +/* + + This defines the OCP Idle mode and OCP Standby mode for various power domains. See OCP-IPGeneric spec for more details. + +*/ +/* + Register RGX_CR_OCP_SYSCONFIG +*/ +#define RGX_CR_OCP_SYSCONFIG (0x9010U) +#define RGX_CR_OCP_SYSCONFIG_MASKFULL (IMG_UINT64_C(0x0000000000000FFF)) +/* DUST2_STANDBY_MODE default: 0x00000002 +Standby Mode for Dust2, 0: Force-Standby, 1: No-Standby, 2: Smart-Standby +*/ +#define RGX_CR_OCP_SYSCONFIG_DUST2_STANDBY_MODE_SHIFT (10U) +#define RGX_CR_OCP_SYSCONFIG_DUST2_STANDBY_MODE_CLRMSK (0XFFFFF3FFU) +/* DUST1_STANDBY_MODE default: 0x00000002 +Standby Mode for Dust1, 0: Force-Standby, 1: No-Standby, 2: Smart-Standby +*/ +#define RGX_CR_OCP_SYSCONFIG_DUST1_STANDBY_MODE_SHIFT (8U) +#define RGX_CR_OCP_SYSCONFIG_DUST1_STANDBY_MODE_CLRMSK (0XFFFFFCFFU) +/* DUST0_STANDBY_MODE default: 0x00000002 +Standby Mode for Dust0, 0: Force-Standby, 1: No-Standby, 2: Smart-Standby +*/ +#define RGX_CR_OCP_SYSCONFIG_DUST0_STANDBY_MODE_SHIFT (6U) +#define RGX_CR_OCP_SYSCONFIG_DUST0_STANDBY_MODE_CLRMSK (0XFFFFFF3FU) +/* RASCAL_STANDBYMODE default: 0x00000002 +Standby Mode for Rascal, 0: Force-Standby, 1: No-Standby, 2: Smart-Standby +*/ +#define RGX_CR_OCP_SYSCONFIG_RASCAL_STANDBYMODE_SHIFT (4U) +#define RGX_CR_OCP_SYSCONFIG_RASCAL_STANDBYMODE_CLRMSK (0XFFFFFFCFU) +/* STANDBY_MODE default: 0x00000002 +Standby Mode for SLC and Sidekick OCP Master, 0: Force-Standby, 1: No-Standby, 2: Smart-Standby +*/ +#define RGX_CR_OCP_SYSCONFIG_STANDBY_MODE_SHIFT (2U) +#define RGX_CR_OCP_SYSCONFIG_STANDBY_MODE_CLRMSK (0XFFFFFFF3U) +/* IDLE_MODE default: 0x00000002 +Idle Mode for OCP slaves, 0: Force-Idle, 1: No-Idle, 2: Smart-Idle +*/ +#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)) +/* Init_MInterrupt_raw +Interrupt raw event for OCP Master Interfaces, W 0 : No action, W 1 - Set event, R 0 - No event pending, R 1 - Event pending +*/ +#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)) +/* Target_SInterrupt_raw +Interrupt raw event for OCP Slave Interfaces, W 0 : No action, W 1 - Set event, R 0 - No event pending, R 1 - Event pending +*/ +#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)) +/* rgx_irq_raw +Interrupt raw event for core, W 0 : No action, W 1 - Set event, R 0 - No event pending, R 1 - Event pending +*/ +#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)) +/* Init_MInterrupt_status +Interrupt status event for OCP Master Interfaces, W 0 : No action, W 1 - Clear event, R 0 - No event pending, R 1 - Event pending and interrupt enabled +*/ +#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)) +/* target_SInterrupt_status +Interrupt status event for OCP Slave Interfaces, W 0 : No action, W 1 - Clear event, R 0 - No event pending, R 1 - Event pending and interrupt enabled +*/ +#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)) +/* rgx_irq_status +Interrupt status event for core, W 0 : No action, W 1 - Clear event, R 0 - No event pending, R 1 - Event pending and interrupt enabled +*/ +#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)) +/* Init_MInterrupt_enable +Interrupt enable for OCP Master Interfaces, W 0 : No action, W 1 - Enable Interrupt, R 0 - Interrupt is disabled, R 1 - Interrupt is enabled +*/ +#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)) +/* Target_SInterrupt_enable +Interrupt enable for OCP Slave Interfaces, W 0 : No action, W 1 - Enable Interrupt, R 0 - Interrupt is disabled, R 1 - Interrupt is enabled +*/ +#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)) +/* rgx_irq_enable +Interrupt enable for core, W 0 : No action, W 1 - Enable Interrupt, R 0 - Interrupt is disabled, R 1 - Interrupt is enabled +*/ +#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)) +/* Init_MInterrupt_disable +Interrupt disable for OCP Master Interfaces, W 0 : No action, W 1 - Disable Interrupt, R 0 - Interrupt is disabled, R 1 - Interrupt is enabled +*/ +#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)) +/* Target_SInterrupt_disable +Interrupt disable for OCP Slave Interfaces, W 0 : No action, W 1 - Disable Interrupt, R 0 - Interrupt is disabled, R 1 - Interrupt is enabled +*/ +#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)) +/* rgx_irq_disable +Interrupt disable for core, W 0 : No action, W 1 - Disable Interrupt, R 0 - Interrupt is disabled, R 1 - Interrupt is enabled +*/ +#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) + + +/* + + This defines the interrupt disable for Core. + +*/ +/* + Register RGX_CR_OCP_IRQ_EVENT +*/ +#define RGX_CR_OCP_IRQ_EVENT (0x9080U) +#define RGX_CR_OCP_IRQ_EVENT_MASKFULL (IMG_UINT64_C(0x00000000000FFFFF)) +/* TARGETH_RCVD_UNEXPECTED_RDATA +interrupt events from OCP host if - received unexpeted rdata from IMG if +*/ +#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)) +/* TARGETH_RCVD_UNSUPPORTED_MCMD +interrupt events from OCP host if - received unsupported MCmd +*/ +#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)) +/* TARGETS_RCVD_UNEXPECTED_RDATA +interrupt events from OCP system if - received unexpeted rdata from IMG if +*/ +#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)) +/* TARGETS_RCVD_UNSUPPORTED_MCMD +interrupt events from OCP system if - received unsupported MCmd +*/ +#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)) +/* INIT3_IMG_PAGE_BOUNDARY_CROSS +interrupt events from Init3 - burst request from IMG cross 4k page boundary +*/ +#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)) +/* INIT3_RCVD_RESP_ERR_FAIL +interrupt events from Init3 - received RESP_ERR or RESP_FAIL from SoC +*/ +#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)) +/* INIT3_RCVD_UNUSED_TAGID +interrupt events from Init3 - received unused ocp tag id from SoC +*/ +#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)) +/* INIT3_RDATA_FIFO_OVERFILL +interrupt events from Init3 - return data fifo overfill +*/ +#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)) +/* INIT2_IMG_PAGE_BOUNDARY_CROSS +interrupt events from Init2 - burst request from IMG cross 4k page boundary +*/ +#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)) +/* INIT2_RCVD_RESP_ERR_FAIL +interrupt events from Init2 - received RESP_ERR or RESP_FAIL from SoC +*/ +#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)) +/* INIT2_RCVD_UNUSED_TAGID +interrupt events from Init2 - received unused ocp tag id from SoC +*/ +#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)) +/* INIT2_RDATA_FIFO_OVERFILL +interrupt events from Init2 - return data fifo overfill +*/ +#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)) +/* INIT1_IMG_PAGE_BOUNDARY_CROSS +interrupt events from Init1 - burst request from IMG cross 4k page boundary +*/ +#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)) +/* INIT1_RCVD_RESP_ERR_FAIL +interrupt events from Init1 - received RESP_ERR or RESP_FAIL from SoC +*/ +#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)) +/* INIT1_RCVD_UNUSED_TAGID +interrupt events from Init1 - received unused ocp tag id from SoC +*/ +#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)) +/* INIT1_RDATA_FIFO_OVERFILL +interrupt events from Init1 - return data fifo overfill +*/ +#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)) +/* INIT0_IMG_PAGE_BOUNDARY_CROSS +interrupt events from Init0 - burst request from IMG cross 4k page boundary +*/ +#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)) +/* INIT0_RCVD_RESP_ERR_FAIL +interrupt events from Init0 - received RESP_ERR or RESP_FAIL from SoC +*/ +#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)) +/* INIT0_RCVD_UNUSED_TAGID +interrupt events from Init0 - received unused ocp tag id from SoC +*/ +#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)) +/* INIT0_RDATA_FIFO_OVERFILL +interrupt events from Init0 - return data fifo overfill +*/ +#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)) +/* REG +bypass rgx_irq from OCP wrapper and do not use OCP specific irq enable/disable +*/ +#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) + + +/* + + This defines the debug status of the OCP internal registers + +*/ +/* + Register RGX_CR_OCP_DEBUG_STATUS +*/ +#define RGX_CR_OCP_DEBUG_STATUS (0x9090U) +#define RGX_CR_OCP_DEBUG_STATUS_MASKFULL (IMG_UINT64_C(0x001F1F77FFFFFFFF)) +/* TARGETH_SDISCACK default: 0x00000003 +debug status from OCP host interface - acknowledge to Idle protocol +*/ +#define RGX_CR_OCP_DEBUG_STATUS_TARGETH_SDISCACK_SHIFT (51U) +#define RGX_CR_OCP_DEBUG_STATUS_TARGETH_SDISCACK_CLRMSK (IMG_UINT64_C(0XFFE7FFFFFFFFFFFF)) +/* TARGETH_SCONNECT +debug status from OCP host interface - Target SConnect state +*/ +#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)) +/* TARGETH_MCONNECT +debug status from OCP host interface - taget MConnect state +*/ +#define RGX_CR_OCP_DEBUG_STATUS_TARGETH_MCONNECT_SHIFT (48U) +#define RGX_CR_OCP_DEBUG_STATUS_TARGETH_MCONNECT_CLRMSK (IMG_UINT64_C(0XFFFCFFFFFFFFFFFF)) +/* TARGETS_SDISCACK default: 0x00000003 +debug status from OCP system interface - acknowledge to Idle protocol +*/ +#define RGX_CR_OCP_DEBUG_STATUS_TARGETS_SDISCACK_SHIFT (43U) +#define RGX_CR_OCP_DEBUG_STATUS_TARGETS_SDISCACK_CLRMSK (IMG_UINT64_C(0XFFFFE7FFFFFFFFFF)) +/* TARGETS_SCONNECT +debug status from OCP system interface - Target SConnect state +*/ +#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)) +/* TARGETS_MCONNECT +debug status from OCP system interface - taget MConnect state +*/ +#define RGX_CR_OCP_DEBUG_STATUS_TARGETS_MCONNECT_SHIFT (40U) +#define RGX_CR_OCP_DEBUG_STATUS_TARGETS_MCONNECT_CLRMSK (IMG_UINT64_C(0XFFFFFCFFFFFFFFFF)) +/* TARGETH_BUSY +debug status from OCP host interface - ocp slave interface is busy +*/ +#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)) +/* TARGETH_CMD_FIFO_FULL +debug status from OCP host interface - command fifo full +*/ +#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)) +/* TARGETH_SRESP_ERROR +debug status from OCP host interface - error response due to non-supporting command +*/ +#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)) +/* TARGETS_BUSY +debug status from OCP system interface - ocp slave interface is busy +*/ +#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)) +/* TARGETS_CMD_FIFO_FULL +debug status from OCP system interface - command fifo full +*/ +#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)) +/* TARGETS_SRESP_ERROR +debug status from OCP system interface - error response due to non-supporting command +*/ +#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)) +/* INIT3_RESERVED +debug status from init3 - reserved +*/ +#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)) +/* INIT3_SWAIT +debug status from init3 - defines whether to wait in M_WAIT state for MConnect +*/ +#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)) +/* INIT3_MDISCREQ default: 0x00000001 +debug status from init3 - request to disconnect from standby protocol +*/ +#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)) +/* INIT3_MDISCACK default: 0x00000003 +debug status from init3 - ack to MDiscReq from standby protocol +*/ +#define RGX_CR_OCP_DEBUG_STATUS_INIT3_MDISCACK_SHIFT (27U) +#define RGX_CR_OCP_DEBUG_STATUS_INIT3_MDISCACK_CLRMSK (IMG_UINT64_C(0XFFFFFFFFE7FFFFFF)) +/* INIT3_SCONNECT +debug status from init3 - disconnect state from slave +*/ +#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)) +/* INIT3_MCONNECT +debug status from init3 - initiator mconnect state +*/ +#define RGX_CR_OCP_DEBUG_STATUS_INIT3_MCONNECT_SHIFT (24U) +#define RGX_CR_OCP_DEBUG_STATUS_INIT3_MCONNECT_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFCFFFFFF)) +/* INIT2_RESERVED +debug status from init2 - reserved +*/ +#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)) +/* INIT2_SWAIT +debug status from init2 - defines whether to wait in M_WAIT state for MConnect +*/ +#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)) +/* INIT2_MDISCREQ default: 0x00000001 +debug status from init2 - request to disconnect from standby protocol +*/ +#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)) +/* INIT2_MDISCACK default: 0x00000003 +debug status from init2 - ack to MDiscReq from standby protocol +*/ +#define RGX_CR_OCP_DEBUG_STATUS_INIT2_MDISCACK_SHIFT (19U) +#define RGX_CR_OCP_DEBUG_STATUS_INIT2_MDISCACK_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFE7FFFF)) +/* INIT2_SCONNECT +debug status from init2 - disconnect state from slave +*/ +#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)) +/* INIT2_MCONNECT +debug status from init2 - initiator mconnect state +*/ +#define RGX_CR_OCP_DEBUG_STATUS_INIT2_MCONNECT_SHIFT (16U) +#define RGX_CR_OCP_DEBUG_STATUS_INIT2_MCONNECT_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFCFFFF)) +/* INIT1_RESERVED +debug status from init1 - reserved +*/ +#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)) +/* INIT1_SWAIT +debug status from init1 - defines whether to wait in M_WAIT state for MConnect +*/ +#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)) +/* INIT1_MDISCREQ default: 0x00000001 +debug status from init1 - request to disconnect from standby protocol +*/ +#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)) +/* INIT1_MDISCACK default: 0x00000003 +debug status from init1 - ack to MDiscReq from standby protocol +*/ +#define RGX_CR_OCP_DEBUG_STATUS_INIT1_MDISCACK_SHIFT (11U) +#define RGX_CR_OCP_DEBUG_STATUS_INIT1_MDISCACK_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFE7FF)) +/* INIT1_SCONNECT +debug status from init1 - disconnect state from slave +*/ +#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)) +/* INIT1_MCONNECT +debug status from init1 - initiator mconnect state +*/ +#define RGX_CR_OCP_DEBUG_STATUS_INIT1_MCONNECT_SHIFT (8U) +#define RGX_CR_OCP_DEBUG_STATUS_INIT1_MCONNECT_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFCFF)) +/* INIT0_RESERVED +debug status from init0 - reserved +*/ +#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)) +/* INIT0_SWAIT +debug status from init0 - defines whether to wait in M_WAIT state for MConnect +*/ +#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)) +/* INIT0_MDISCREQ default: 0x00000001 +debug status from init0 - request to disconnect from standby protocol +*/ +#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)) +/* INIT0_MDISCACK default: 0x00000003 +debug status from init0 - ack to MDiscReq from standby protocol +*/ +#define RGX_CR_OCP_DEBUG_STATUS_INIT0_MDISCACK_SHIFT (3U) +#define RGX_CR_OCP_DEBUG_STATUS_INIT0_MDISCACK_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFE7)) +/* INIT0_SCONNECT +debug status from init0 - disconnect state from slave +*/ +#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)) +/* INIT0_MCONNECT +debug status from init0 - initiator mconnect state +*/ +#define RGX_CR_OCP_DEBUG_STATUS_INIT0_MCONNECT_SHIFT (0U) +#define RGX_CR_OCP_DEBUG_STATUS_INIT0_MCONNECT_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFFC)) + + +/* PM_ALIST*/ +#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) +/* HOST*/ +#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) +/* META*/ +#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) +/* PB_ZLS*/ +#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) +/* PB_TE*/ +#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) +/* PB_VCE*/ +#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) +/* TLA*/ +#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) + + +/* + Define Requestors/Data Masters which are Trusted/Untrusted and enable/disbale the Memory Bus Security feature within the Core + + When enabled the GPU modifies the top 2 bits of the external memory address to indicate: + - Address[39] Trusted DM Access (according to the DM Trusted setup) + - Address[38] META Code Access + + Setting this bit effectively reduces the external physical address range from 1TB to 256 GB, and should only be used where the SOC implementation has a corresponding trust implementation. + +*/ +/* + Register RGX_CR_BIF_TRUST +*/ +#define RGX_CR_BIF_TRUST (0xA000U) +#define RGX_CR_BIF_TRUST_MASKFULL (IMG_UINT64_C(0x000000000001FFFF)) +/* ENABLE +Enable Security feature: 0x1 = Enabled, 0x0 = Disabled +*/ +#define RGX_CR_BIF_TRUST_ENABLE_SHIFT (16U) +#define RGX_CR_BIF_TRUST_ENABLE_CLRMSK (0XFFFEFFFFU) +#define RGX_CR_BIF_TRUST_ENABLE_EN (0X00010000U) +/* DM_TRUSTED +Mask of bits which defines which of the remaining Data Masters are trusted: 0x1 = Trusted, 0x0 = Untrusted +*/ +#define RGX_CR_BIF_TRUST_DM_TRUSTED_SHIFT (9U) +#define RGX_CR_BIF_TRUST_DM_TRUSTED_CLRMSK (0XFFFF01FFU) +/* OTHER_COMPUTE_DM_TRUSTED +Defines whether other accesses with the Compute DM are trusted: 0x1 = Trusted, 0x0 = Untrusted +*/ +#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) +/* MCU_COMPUTE_DM_TRUSTED +Defines whether MCU accesses with the Compute DM are trusted: 0x1 = Trusted, 0x0 = Untrusted +*/ +#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) +/* PBE_COMPUTE_DM_TRUSTED +Defines whether PBE accesses with the Compute DM are trusted: 0x1 = Trusted, 0x0 = Untrusted +*/ +#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) +/* OTHER_PIXEL_DM_TRUSTED +Defines whether other accesses with the Pixel DM are trusted: 0x1 = Trusted, 0x0 = Untrusted +*/ +#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) +/* MCU_PIXEL_DM_TRUSTED +Defines whether MCU accesses with the Pixel DM are trusted: 0x1 = Trusted, 0x0 = Untrusted +*/ +#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) +/* PBE_PIXEL_DM_TRUSTED +Defines whether PBE accesses with the Pixel DM are trusted: 0x1 = Trusted, 0x0 = Untrusted +*/ +#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) +/* OTHER_VERTEX_DM_TRUSTED +Defines whether other accesses with the Vertex DM are trusted: 0x1 = Trusted, 0x0 = Untrusted +*/ +#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) +/* MCU_VERTEX_DM_TRUSTED +Defines whether MCU accesses with the Vertex DM are trusted: 0x1 = Trusted, 0x0 = Untrusted +*/ +#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) +/* PBE_VERTEX_DM_TRUSTED +Defines whether PBE accesses with the Vertex DM are trusted: 0x1 = Trusted, 0x0 = Untrusted +*/ +#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)) +/* Enable +0 = No System Bus Security1 = System Bus Restricted +*/ +#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) + + +/* + + Core Module Clock Control Modes. + + + Allows individual domain clocks to be forced off, forced on or operate under automatic pipeline activity based clock gating. This register is generally controlled by the GPU firmware and should be set to AUTO. Clock gating reduces the power consumed by the device. + +*/ +/* + Register RGX_CR_CLK_CTRL2 +*/ +#define RGX_CR_CLK_CTRL2 (0xD200U) +#define RGX_CR_CLK_CTRL2_MASKFULL (IMG_UINT64_C(0x0000000000000F33)) +/* MCU_FBTC default: AUTO (0x00000002) */ +#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) +/* VRDM default: AUTO (0x00000002) */ +#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)) +/* SH default: AUTO (0x00000002) */ +#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)) +/* FBA default: AUTO (0x00000002) */ +#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 */ + +/* + + Reports the current module clock status + + + Clock gating state reflects the condition of the clock for each module + +*/ +/* + 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) +/* VRDM default: GATED (0x00000000) */ +#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)) +/* SH default: GATED (0x00000000) */ +#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)) +/* FBA default: GATED (0x00000000) */ +#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)) + + +#endif /* RGX_FEATURE_RAY_TRACING */ + +/* + + Indicates a page fault has occurred due to a non-Meta request and gives details of faulting request. Any write to this register will clear the contents and allow a subsequent fault to be reported + +*/ +/* + Register RGX_CR_MMU_FAULT_STATUS +*/ +#define RGX_CR_MMU_FAULT_STATUS (0xE150U) +#define RGX_CR_MMU_FAULT_STATUS_MASKFULL (IMG_UINT64_C(0xFFFFFFFFFFFFFFFF)) +/* ADDRESS +Virtual address +*/ +#define RGX_CR_MMU_FAULT_STATUS_ADDRESS_SHIFT (28U) +#define RGX_CR_MMU_FAULT_STATUS_ADDRESS_CLRMSK (IMG_UINT64_C(0X000000000FFFFFFF)) +/* CONTEXT +Context +*/ +#define RGX_CR_MMU_FAULT_STATUS_CONTEXT_SHIFT (20U) +#define RGX_CR_MMU_FAULT_STATUS_CONTEXT_CLRMSK (IMG_UINT64_C(0XFFFFFFFFF00FFFFF)) +/* TAG_SB +Sideband tag +*/ +#define RGX_CR_MMU_FAULT_STATUS_TAG_SB_SHIFT (12U) +#define RGX_CR_MMU_FAULT_STATUS_TAG_SB_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFF00FFF)) +/* REQ_ID +Requester ID - see rgx_bif3_pack/documentation for encoding +*/ +#define RGX_CR_MMU_FAULT_STATUS_REQ_ID_SHIFT (6U) +#define RGX_CR_MMU_FAULT_STATUS_REQ_ID_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFF03F)) +/* LEVEL +MMU level that faulted: "00"=PT "01"=PD "10"=PC "11"=PC Base +*/ +#define RGX_CR_MMU_FAULT_STATUS_LEVEL_SHIFT (4U) +#define RGX_CR_MMU_FAULT_STATUS_LEVEL_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFCF)) +/* RNW +Indicates whether fault was caused by a read(1) or write(0) request +*/ +#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)) +/* TYPE +Type of fault: "00"=valid "10"=read-only "11"=pm/meta protected +*/ +#define RGX_CR_MMU_FAULT_STATUS_TYPE_SHIFT (1U) +#define RGX_CR_MMU_FAULT_STATUS_TYPE_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFF9)) +/* FAULT +Indicates a fault has occured +*/ +#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)) + + +/* + + Indicates a page fault has occurred due to a Meta request and gives details of faulting request. Any write to this register will clear the contents and allow a subsequent fault to be reported + +*/ +/* + 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)) +/* ADDRESS +Virtual address +*/ +#define RGX_CR_MMU_FAULT_STATUS_META_ADDRESS_SHIFT (28U) +#define RGX_CR_MMU_FAULT_STATUS_META_ADDRESS_CLRMSK (IMG_UINT64_C(0X000000000FFFFFFF)) +/* CONTEXT +Context +*/ +#define RGX_CR_MMU_FAULT_STATUS_META_CONTEXT_SHIFT (20U) +#define RGX_CR_MMU_FAULT_STATUS_META_CONTEXT_CLRMSK (IMG_UINT64_C(0XFFFFFFFFF00FFFFF)) +/* TAG_SB +Sideband tag +*/ +#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)) +/* REQ_ID +Requester ID - see rgx_bif3_pack/documentation for encoding +*/ +#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)) +/* LEVEL +MMU level that faulted: "00"=PT "01"=PD "10"=PC "11"=PC Base +*/ +#define RGX_CR_MMU_FAULT_STATUS_META_LEVEL_SHIFT (4U) +#define RGX_CR_MMU_FAULT_STATUS_META_LEVEL_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFCF)) +/* RNW +Indicates whether fault was caused by a read(1) or write(0) request +*/ +#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)) +/* TYPE +Type of fault: "00"=valid "10"=read-only "11"=pm/meta protected +*/ +#define RGX_CR_MMU_FAULT_STATUS_META_TYPE_SHIFT (1U) +#define RGX_CR_MMU_FAULT_STATUS_META_TYPE_CLRMSK (IMG_UINT64_C(0XFFFFFFFFFFFFFFF9)) +/* FAULT +Indicates a fault has occured +*/ +#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)) + + +/* + + SLC Control registers + +*/ +/* + Register RGX_CR_SLC3_CTRL_MISC +*/ +#define RGX_CR_SLC3_CTRL_MISC (0xE200U) +#define RGX_CR_SLC3_CTRL_MISC_MASKFULL (IMG_UINT64_C(0x0000000000000003)) +/* ADDR_DECODE_MODE default: LINEAR (0x00000000) +(null) +*/ +#define RGX_CR_SLC3_CTRL_MISC_ADDR_DECODE_MODE_SHIFT (0U) +#define RGX_CR_SLC3_CTRL_MISC_ADDR_DECODE_MODE_CLRMSK (0XFFFFFFFCU) +#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) + + +/* + + SLC Control registers + +*/ +/* + Register RGX_CR_SLC3_SCRAMBLE +*/ +#define RGX_CR_SLC3_SCRAMBLE (0xE208U) +#define RGX_CR_SLC3_SCRAMBLE_MASKFULL (IMG_UINT64_C(0xFFFFFFFFFFFFFFFF)) +/* BITS + Pattern of bits used to determine the Cache Bank in Address Decode mode 0x3. The actual Cache Bank to use is determined by indexing into the Scramble Bits, see the SLC HW specification for more details +*/ +#define RGX_CR_SLC3_SCRAMBLE_BITS_SHIFT (0U) +#define RGX_CR_SLC3_SCRAMBLE_BITS_CLRMSK (IMG_UINT64_C(0000000000000000)) + + +/* + + SLC Control registers + +*/ +/* + Register RGX_CR_SLC3_SCRAMBLE2 +*/ +#define RGX_CR_SLC3_SCRAMBLE2 (0xE210U) +#define RGX_CR_SLC3_SCRAMBLE2_MASKFULL (IMG_UINT64_C(0xFFFFFFFFFFFFFFFF)) +/* BITS + Pattern of bits used to determine the Cache Bank in Address Decode mode 0x3. The actual Cache Bank to use is determined by indexing into the Scramble Bits, see the SLC HW specification for more details +*/ +#define RGX_CR_SLC3_SCRAMBLE2_BITS_SHIFT (0U) +#define RGX_CR_SLC3_SCRAMBLE2_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/hwdefs/km/rgxdefs_km.h b/drivers/gpu/rogue/hwdefs/km/rgxdefs_km.h new file mode 100644 index 000000000000..ed570ef85c3b --- /dev/null +++ b/drivers/gpu/rogue/hwdefs/km/rgxdefs_km.h @@ -0,0 +1,140 @@ +/*************************************************************************/ /*! +@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) + +/* 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) + +/* 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_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) + +#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) + +#if defined(RGX_FEATURE_META_DMA_CHANNEL_COUNT) +#define RGX_FEATURE_DMA (1) +#define RGXFW_DMA_CH_PRIO_DEFAULT ( (RGXFW_DMA_PRIORITY_0 << RGX_CR_DMA_CONTROL_CH0_PRIORITY_SHIFT) | \ + (RGXFW_DMA_PRIORITY_1 << RGX_CR_DMA_CONTROL_CH1_PRIORITY_SHIFT) ) +#endif + +/****************************************************************************** + * 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 /* */ + +#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/hwdefs/km/rgxmmudefs_km.h b/drivers/gpu/rogue/hwdefs/km/rgxmmudefs_km.h new file mode 100644 index 000000000000..7419db508105 --- /dev/null +++ b/drivers/gpu/rogue/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/include/adf/adf_ext.h b/drivers/gpu/rogue/include/adf/adf_ext.h new file mode 100644 index 000000000000..d730fe061d4d --- /dev/null +++ b/drivers/gpu/rogue/include/adf/adf_ext.h @@ -0,0 +1,108 @@ +/*************************************************************************/ /*! +@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]; +} __attribute__((packed, aligned(8))); + +struct adf_post_ext { + __u32 post_id; + struct adf_buffer_config_ext bufs_ext[]; +} __attribute__((packed, aligned(8))); + +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; +} __attribute__((packed, aligned(8))); + +/* 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. + */ +#ifndef ADF_IOCTL_TYPE +#define ADF_IOCTL_TYPE 'D' +#endif + +#ifndef ADF_IOCTL_NR_CUSTOM +#define ADF_IOCTL_NR_CUSTOM 128 +#endif + +#define ADF_VALIDATE_CONFIG_EXT \ + _IOW(ADF_IOCTL_TYPE, ADF_IOCTL_NR_CUSTOM + 0, struct adf_validate_config_ext) + +#endif /* __ADF_EXT_H__ */ diff --git a/drivers/gpu/rogue/include/cache_external.h b/drivers/gpu/rogue/include/cache_external.h new file mode 100644 index 000000000000..2967f1ead23e --- /dev/null +++ b/drivers/gpu/rogue/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/include/dbgdrvif_srv5.h b/drivers/gpu/rogue/include/dbgdrvif_srv5.h new file mode 100644 index 000000000000..4f6135907bcd --- /dev/null +++ b/drivers/gpu/rogue/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/include/dc_external.h b/drivers/gpu/rogue/include/dc_external.h new file mode 100644 index 000000000000..dd6422508981 --- /dev/null +++ b/drivers/gpu/rogue/include/dc_external.h @@ -0,0 +1,71 @@ +/*************************************************************************/ /*! +@File +@Title Device class external +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Defines DC specific structures which are externally visible + (i.e. visible to clients of services), but are also required + within services. +@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 _DC_EXTERNAL_H_ +#define _DC_EXTERNAL_H_ + +#include "img_types.h" + +#define DC_NAME_SIZE 50 +typedef struct _DC_DISPLAY_INFO_ +{ + IMG_CHAR szDisplayName[DC_NAME_SIZE]; + IMG_UINT32 ui32MinDisplayPeriod; + IMG_UINT32 ui32MaxDisplayPeriod; + IMG_UINT32 ui32MaxPipes; + IMG_BOOL bUnlatchedSupported; +} DC_DISPLAY_INFO; + +typedef struct _DC_BUFFER_IMPORT_INFO_ +{ + IMG_UINT32 ePixFormat; + IMG_UINT32 ui32BPP; + IMG_UINT32 ui32Width[3]; + IMG_UINT32 ui32Height[3]; + IMG_UINT32 ui32ByteStride[3]; + IMG_UINT32 ui32PrivData[3]; +} DC_BUFFER_IMPORT_INFO; + +#endif /* _DC_EXTERNAL_H_ */ diff --git a/drivers/gpu/rogue/include/devicemem_typedefs.h b/drivers/gpu/rogue/include/devicemem_typedefs.h new file mode 100644 index 000000000000..cac0d7f0972c --- /dev/null +++ b/drivers/gpu/rogue/include/devicemem_typedefs.h @@ -0,0 +1,104 @@ +/*************************************************************************/ /*! +@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 /* */ 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. +*/ + 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/include/fbc_types.h b/drivers/gpu/rogue/include/fbc_types.h new file mode 100644 index 000000000000..28be3474c801 --- /dev/null +++ b/drivers/gpu/rogue/include/fbc_types.h @@ -0,0 +1,64 @@ +/*************************************************************************/ /*! +@File +@Title Frame buffer compression 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. +*/ /**************************************************************************/ + +#ifndef _FBC_TYPES_H_ +#define _FBC_TYPES_H_ + +/** + * Types of framebuffer compression available. + */ +typedef enum _FB_COMPRESSION_ +{ + FB_COMPRESSION_NONE, + FB_COMPRESSION_DIRECT_8x8, + FB_COMPRESSION_DIRECT_16x4, + FB_COMPRESSION_DIRECT_32x2, + FB_COMPRESSION_INDIRECT_8x8, + FB_COMPRESSION_INDIRECT_16x4, + FB_COMPRESSION_INDIRECT_4TILE_8x8, + FB_COMPRESSION_INDIRECT_4TILE_16x4 +} FB_COMPRESSION; + +#endif /* _FBC_TYPES_H_ */ + +/* EOF */ + diff --git a/drivers/gpu/rogue/include/img_defs.h b/drivers/gpu/rogue/include/img_defs.h new file mode 100644 index 000000000000..da4e6738b09c --- /dev/null +++ b/drivers/gpu/rogue/include/img_defs.h @@ -0,0 +1,231 @@ +/*************************************************************************/ /*! +@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. */ +#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) +#if defined(UNDER_CE) + #include "windowsce_img_defs.h" +#else + #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 */ +#endif /* UNDER_CE */ +#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 +#if defined UNDER_CE + /* WinCE / WinEC does not have an abort() function */ + #define IMG_ABORT() exit(1) +#else + #define IMG_ABORT() abort() +#endif + #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 */ +#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/include/img_types.h b/drivers/gpu/rogue/include/img_types.h new file mode 100644 index 000000000000..b882f4623c81 --- /dev/null +++ b/drivers/gpu/rogue/include/img_types.h @@ -0,0 +1,290 @@ +/*************************************************************************/ /*! +@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 +/* number of bits in the units returned by sizeof */ +#define IMG_CHAR_BIT 8 + +/* define all address space bit depths: */ +/* CPU virtual address space defaults to 32bits */ +#if !defined(IMG_ADDRSPACE_CPUVADDR_BITS) +#define IMG_ADDRSPACE_CPUVADDR_BITS 32 +#endif + +typedef unsigned int IMG_UINT, *IMG_PUINT; +typedef signed int IMG_INT, *IMG_PINT; + +typedef unsigned char IMG_UINT8, *IMG_PUINT8; +typedef unsigned char IMG_BYTE, *IMG_PBYTE; +typedef signed char IMG_INT8, *IMG_PINT8; +typedef char IMG_CHAR, *IMG_PCHAR; +typedef IMG_CHAR const *IMG_PCCHAR; + +typedef unsigned short IMG_UINT16, *IMG_PUINT16; +typedef signed short IMG_INT16, *IMG_PINT16; +typedef unsigned int IMG_UINT32, *IMG_PUINT32; +typedef signed int IMG_INT32, *IMG_PINT32; +#if !defined(IMG_UINT32_MAX) + #define IMG_UINT32_MAX 0xFFFFFFFFUL +#endif +#if !defined(IMG_UINT16_MAX) + #define IMG_UINT16_MAX 0xFFFFU +#endif + +typedef IMG_UINT16 const* IMG_PCUINT16; +typedef IMG_INT16 const* IMG_PCINT16; +typedef IMG_UINT32 const* IMG_PCUINT32; +typedef IMG_INT32 const* IMG_PCINT32; + +#if defined(_WIN32) + +typedef unsigned __int64 IMG_UINT64, *IMG_PUINT64; +typedef __int64 IMG_INT64, *IMG_PINT64; +#define IMG_INT64_C(c) c ## LL +#define IMG_UINT64_C(c) c ## ULL +#if defined(_MSC_VER) +#define strtoll _strtoi64 +#endif + +#else + #if defined(LINUX) || defined(__METAG) || defined(__QNXNTO__) + typedef unsigned long long IMG_UINT64, *IMG_PUINT64; + typedef long long IMG_INT64, *IMG_PINT64; + #define IMG_INT64_C(c) c ## LL + #define IMG_UINT64_C(c) c ## ULL + #else + #error("define an OS") + #endif +#endif +#if !defined(IMG_UINT64_MAX) + #define IMG_UINT64_MAX 0xFFFFFFFFFFFFFFFFULL +#endif + +#if !(defined(LINUX) && defined (__KERNEL__)) +/* 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; + +#endif + +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; + +/* Figure out which headers to include to get uintptr_t. */ +#if !defined(_MSC_VER) && !defined(__KERNEL__) +/* MSVC before VS2010 doesn't have , but it has uintptr_t in + . */ +#include +#endif +#if defined(__QNXNTO__) +#include +#endif +#if defined(LINUX) && defined (__KERNEL__) +#include +#endif +#include + +typedef uintptr_t IMG_UINTPTR_T; +typedef size_t IMG_SIZE_T; + +#define IMG_SIZE_T_MAX ((IMG_SIZE_T) -1) + +#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 + +/* 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%010llX" +#define IMG_DEVMEM_SIZE_FMTSPEC "0x%010llX" +#define IMG_DEVMEM_ALIGN_FMTSPEC "0x%010llX" +#define IMG_DEVMEM_OFFSET_FMTSPEC "0x%010llX" + +/* 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; + +/* + 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/include/imgpixfmts_km.h b/drivers/gpu/rogue/include/imgpixfmts_km.h new file mode 100644 index 000000000000..ab683e47505a --- /dev/null +++ b/drivers/gpu/rogue/include/imgpixfmts_km.h @@ -0,0 +1,78 @@ +/*************************************************************************/ /*! +@File +@Title Pixel formats +@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. +*/ /**************************************************************************/ + +/**************************************************************************** + ** + ** WARNING: This file is autogenerated - DO NOT EDIT. + ** + ** See fmts_systable.txt to add new formats. + ****************************************************************************/ + +#include "imgyuv.h" +#if !defined(_IMGPIXFMTS_KM_H_) +#define _IMGPIXFMTS_KM_H_ + +typedef enum _IMG_PIXFMT_ +{ + IMG_PIXFMT_UNKNOWN = 0, + IMG_PIXFMT_R8G8B8A8_UNORM = 30, + IMG_PIXFMT_R8G8B8X8_UNORM = 35, + IMG_PIXFMT_B5G6R5_UNORM = 81, + IMG_PIXFMT_B5G5R5A1_UNORM = 82, + IMG_PIXFMT_B5G5R5X1_UNORM = 83, + IMG_PIXFMT_B8G8R8A8_UNORM = 84, + IMG_PIXFMT_B8G8R8X8_UNORM = 85, + IMG_PIXFMT_UYVY = 162, + IMG_PIXFMT_VYUY = 163, + IMG_PIXFMT_YUYV = 164, + IMG_PIXFMT_YVYU = 165, + IMG_PIXFMT_YVU420_2PLANE = 166, + IMG_PIXFMT_YUV420_2PLANE = 167, + IMG_PIXFMT_YVU420_2PLANE_MACRO_BLOCK = 168, + IMG_PIXFMT_YUV420_3PLANE = 169, + IMG_PIXFMT_YVU420_3PLANE = 170, + IMG_PIXFMT_V8U8Y8A8 = 175, +} IMG_PIXFMT; + + + +#endif /* _IMGPIXFMTS_KM_H_ */ diff --git a/drivers/gpu/rogue/include/imgyuv.h b/drivers/gpu/rogue/include/imgyuv.h new file mode 100644 index 000000000000..9359c355a66f --- /dev/null +++ b/drivers/gpu/rogue/include/imgyuv.h @@ -0,0 +1,63 @@ +/*************************************************************************/ /*! +@File +@Title YUV defines +@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(_IMGYUV_H_) +#define _IMGYUV_H_ + +typedef enum +{ + IMG_COLORSPACE_BT601_CONFORMANT_RANGE = 1, + IMG_COLORSPACE_BT601_FULL_RANGE = 2, + IMG_COLORSPACE_BT709_CONFORMANT_RANGE = 3, + IMG_COLORSPACE_BT709_FULL_RANGE = 4 +}IMG_YUV_COLORSPACE; + +typedef enum +{ + IMG_CHROMA_INTERP_ZERO = 1, + IMG_CHROMA_INTERP_QUARTER = 2, + IMG_CHROMA_INTERP_HALF = 3, + IMG_CHROMA_INTERP_THREEQUARTERS = 4 +}IMG_YUV_CHROMA_INTERP; + + +#endif /* _IMGYUV_H_ */ diff --git a/drivers/gpu/rogue/include/lock_types.h b/drivers/gpu/rogue/include/lock_types.h new file mode 100644 index 000000000000..dd8284554c03 --- /dev/null +++ b/drivers/gpu/rogue/include/lock_types.h @@ -0,0 +1,75 @@ +/*************************************************************************/ /*! +@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 +/* 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; + +#else /* defined(LINUX) && defined(__KERNEL__) */ + +typedef struct _OS_LOCK_ *POS_LOCK; + +#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/include/pdumpdefs.h b/drivers/gpu/rogue/include/pdumpdefs.h new file mode 100644 index 000000000000..568f6f07f366 --- /dev/null +++ b/drivers/gpu/rogue/include/pdumpdefs.h @@ -0,0 +1,201 @@ +/*************************************************************************/ /*! +@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_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/include/pvr_debug.h b/drivers/gpu/rogue/include/pvr_debug.h new file mode 100755 index 000000000000..3b45f52b64a4 --- /dev/null +++ b/drivers/gpu/rogue/include/pvr_debug.h @@ -0,0 +1,475 @@ +/*************************************************************************/ /*! +@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__) +# 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_ +#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 */ + +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/include/pvr_fd_sync_user.h b/drivers/gpu/rogue/include/pvr_fd_sync_user.h new file mode 100644 index 000000000000..c63ebe0bc4d2 --- /dev/null +++ b/drivers/gpu/rogue/include/pvr_fd_sync_user.h @@ -0,0 +1,160 @@ +/*************************************************************************/ /*! +@File pvr_fd_sync_user.h +@Title Userspace 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_USER_H_ +#define _PVR_FD_SYNC_USER_H_ + +#include +#include + +#include "pvrsrv_error.h" + +#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 \ + _IOWR(PVR_SYNC_IOC_MAGIC, 1, struct pvr_sync_enable_fencing_ioctl_data) + +#define PVR_SYNC_IOC_DEBUG_FENCE \ + _IOWR(PVR_SYNC_IOC_MAGIC, 2, struct pvr_sync_debug_fence_ioctl_data) + +#define PVR_SYNC_IOC_ALLOC_FENCE \ + _IOWR(PVR_SYNC_IOC_MAGIC, 3, struct pvr_sync_alloc_fence_ioctl_data) + +#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_debug_sync_data { + /* Output */ + char szParentName[32]; + __s32 i32Status; + __u8 ui8Foreign; + union + { + struct { + __u32 id; + __u32 ui32FWAddr; + __u32 ui32CurrOp; + __u32 ui32NextOp; + __u32 ui32TlTaken; + } s; + char szForeignVal[16]; + }; +} __attribute__((packed, aligned(8))); + +struct pvr_sync_debug_fence_ioctl_data +{ + /* Input */ + int iFenceFd; + + /* Output */ + char szName[32]; + __s32 i32Status; + __u32 ui32NumSyncs; + struct pvr_sync_debug_sync_data aPts[PVR_SYNC_MAX_QUERY_FENCE_POINTS]; +} +__attribute__((packed, aligned(8))); + +PVRSRV_ERROR PVRFDSyncOpen(int *piSyncFd); +PVRSRV_ERROR PVRFDSyncClose(int iSyncFd); + +PVRSRV_ERROR PVRFDSyncWaitFence(int iFenceFd); +PVRSRV_ERROR PVRFDSyncCheckFence(int iFenceFd); + +PVRSRV_ERROR PVRFDSyncMergeFences(const char *pcszName, + int iFenceFd1, + int iFenceFd2, + int *piNewFenceFd); + +PVRSRV_ERROR PVRFDSyncAllocFence(int iSyncFd, + int *piFenceFd, + int *pbTimelineIdle); + +PVRSRV_ERROR PVRFDSyncCreateFence(int iSyncFd, + const char *pcszName, + int iAllocFenceFd, + int *piFenceFd); + +PVRSRV_ERROR PVRFDSyncEnableFencing(int iSyncFd, + int bFencingEnabled); + +PVRSRV_ERROR PVRFDSyncQueryFence(int iSyncFd, + int iFenceFd, + struct pvr_sync_debug_fence_ioctl_data *psData); + +PVRSRV_ERROR PVRFDSyncDumpFence(int iSyncFd, + int iFenceFd, + const char *pcszModule, + const char *pcszFmt, ...) + __attribute__((format(printf,4,5))); + +#endif /* _PVR_FD_SYNC_USER_H_ */ diff --git a/drivers/gpu/rogue/include/pvrmodule.h b/drivers/gpu/rogue/include/pvrmodule.h new file mode 100644 index 000000000000..267c7b687487 --- /dev/null +++ b/drivers/gpu/rogue/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/include/pvrsrv_device_types.h b/drivers/gpu/rogue/include/pvrsrv_device_types.h new file mode 100644 index 000000000000..1b4c5cdbb69f --- /dev/null +++ b/drivers/gpu/rogue/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) +#define __pvrsrv_defined_struct_enum__ +#include +#endif + +#endif /* __PVRSRV_DEVICE_TYPES_H__ */ + diff --git a/drivers/gpu/rogue/include/pvrsrv_devmem.h b/drivers/gpu/rogue/include/pvrsrv_devmem.h new file mode 100644 index 000000000000..352f04bfbf7b --- /dev/null +++ b/drivers/gpu/rogue/include/pvrsrv_devmem.h @@ -0,0 +1,550 @@ +/*************************************************************************/ /*! +@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 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); + +#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/include/pvrsrv_error.h b/drivers/gpu/rogue/include/pvrsrv_error.h new file mode 100644 index 000000000000..82ef82a46440 --- /dev/null +++ b/drivers/gpu/rogue/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/include/pvrsrv_errors.h b/drivers/gpu/rogue/include/pvrsrv_errors.h new file mode 100644 index 000000000000..fe26246ea91a --- /dev/null +++ b/drivers/gpu/rogue/include/pvrsrv_errors.h @@ -0,0 +1,327 @@ +/*************************************************************************/ /*! +@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_REG_CONFIG_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_MAP_TDMETACODE_PAGES_FAIL) +PVRE(PVRSRV_ERROR_REQUEST_TDSECUREBUF_PAGES_FAIL) +PVRE(PVRSRV_ERROR_INIT_TDSECUREBUF_PAGES_FAIL) +PVRE(PVRSRV_ERROR_MAP_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_INVALID_OFFSET) +PVRE(PVRSRV_ERROR_CCCB_STALLED) diff --git a/drivers/gpu/rogue/include/pvrsrv_memallocflags.h b/drivers/gpu/rogue/include/pvrsrv_memallocflags.h new file mode 100644 index 000000000000..a14ea54c5ae6 --- /dev/null +++ b/drivers/gpu/rogue/include/pvrsrv_memallocflags.h @@ -0,0 +1,492 @@ +/*************************************************************************/ /*! +@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) + +/*! + * 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_MEMALLOCFLAG_GPU_READ_PERMITTED (1U<<2) /*!< can be mapped is GPU readable in another GPU mem context */ +#define PVRSRV_MEMALLOCFLAG_GPU_WRITE_PERMITTED (1U<<3) /*!< can be mapped is GPU writable in another GPU mem context */ + +#define PVRSRV_MEMALLOCFLAG_CPU_READABLE (1U<<4) /*!< mapped as readable to the CPU */ +#define PVRSRV_MEMALLOCFLAG_CPU_WRITEABLE (1U<<5) /*!< mapped as writeable to the CPU */ +#define PVRSRV_MEMALLOCFLAG_CPU_READ_PERMITTED (1U<<6) /*!< can be mapped is CPU readable in another CPU mem context */ +#define PVRSRV_MEMALLOCFLAG_CPU_WRITE_PERMITTED (1U<<7) /*!< can be mapped is CPU writable in another CPU mem context */ + + +/* + * ********************************************************** + * * * + * * 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, 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) + +/*! + 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) +/*! + 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) + +/*! + 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) + +/*! + 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) + +/*! + 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) + +/*! + GPU domain. + + GPU cache mode mask +*/ +#define PVRSRV_MEMALLOCFLAG_GPU_CACHE_MODE_MASK (7U<<8) + +#define GPU_CACHE_MODE(n) (n & 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, 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) + +/*! + 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) + +/*! + 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) + +/*! + 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) + +/*! + 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) + + +/*! + 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) + +/*! + CPU domain. + + CPU cache mode mask +*/ +#define PVRSRV_MEMALLOCFLAG_CPU_CACHE_MODE_MASK (7U<<11) + +#define CPU_CACHE_MODE(n) (n & 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_MEMALLOCFLAG_WRITE_COMBINE (PVRSRV_MEMALLOCFLAG_GPU_WRITE_COMBINE | PVRSRV_MEMALLOCFLAG_CPU_WRITE_COMBINE) /*!< Memory will be write-combined */ +#define PVRSRV_MEMALLOCFLAG_CACHE_COHERENT (PVRSRV_MEMALLOCFLAG_GPU_CACHE_COHERENT | PVRSRV_MEMALLOCFLAG_CPU_CACHE_COHERENT) /*!< Memory will be cache-coherent */ +#define PVRSRV_MEMALLOCFLAG_CACHE_INCOHERENT (PVRSRV_MEMALLOCFLAG_GPU_CACHE_INCOHERENT | PVRSRV_MEMALLOCFLAG_CPU_CACHE_INCOHERENT) /*!< Memory will be cache-incoherent */ + +/*! + 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) + + + + +/* + * + * ********************************************************** + * * * + * * ALLOC MEMORY FLAGS * + * * * + * ********************************************************** + * + * (Bits 15) + * + */ +#define PVRSRV_MEMALLOCFLAG_NO_OSPAGES_ON_ALLOC (1U<<15) + +/*! + 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) + +/* + * + * ********************************************************** + * * * + * * 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) + +/*! + 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) + +/*! + 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) + +/* + * + * ********************************************************** + * * * + * * 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/include/pvrsrv_surface.h b/drivers/gpu/rogue/include/pvrsrv_surface.h new file mode 100644 index 000000000000..fdd1328b1aa2 --- /dev/null +++ b/drivers/gpu/rogue/include/pvrsrv_surface.h @@ -0,0 +1,150 @@ +/*************************************************************************/ /*! +@File +@Title Device class external +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Defines DC specific structures which are externally visible + (i.e. visible to clients of services), but are also required + within services. +@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_SURFACE_H_ +#define _PVRSRV_SURFACE_H_ + +#include "img_types.h" +#include "fbc_types.h" + +#define PVRSRV_SURFACE_TRANSFORM_NONE (0 << 0) +#define PVRSRV_SURFACE_TRANSFORM_FLIP_H (1 << 0) +#define PVRSRV_SURFACE_TRANSFORM_FLIP_V (1 << 1) +#define PVRSRV_SURFACE_TRANSFORM_ROT_90 (1 << 2) +#define PVRSRV_SURFACE_TRANSFORM_ROT_180 ((1 << 0) + (1 << 1)) +#define PVRSRV_SURFACE_TRANSFORM_ROT_270 ((1 << 0) + (1 << 1) + (1 << 2)) + +#define PVRSRV_SURFACE_BLENDING_NONE 0 +#define PVRSRV_SURFACE_BLENDING_PREMULT 1 +#define PVRSRV_SURFACE_BLENDING_COVERAGE 2 + +typedef enum _PVRSRV_SURFACE_MEMLAYOUT_ { + PVRSRV_SURFACE_MEMLAYOUT_STRIDED = 0, /*!< Strided memory buffer */ + PVRSRV_SURFACE_MEMLAYOUT_FBC, /*!< Frame buffer compressed buffer */ + PVRSRV_SURFACE_MEMLAYOUT_BIF_PAGE_TILED, /*!< BIF page tiled buffer */ +} PVRSRV_SURFACE_MEMLAYOUT; + +typedef struct _PVRSRV_SURFACE_FBC_LAYOUT_ { + FB_COMPRESSION eFBCompressionMode; +} PVRSRV_SURFACE_FBC_LAYOUT; + +typedef struct _PVRSRV_SURFACE_FORMAT_ +{ + IMG_UINT32 ePixFormat; + PVRSRV_SURFACE_MEMLAYOUT eMemLayout; + union { + PVRSRV_SURFACE_FBC_LAYOUT sFBCLayout; + } u; +} PVRSRV_SURFACE_FORMAT; + +typedef struct _PVRSRV_SURFACE_DIMS_ +{ + IMG_UINT32 ui32Width; + IMG_UINT32 ui32Height; +} PVRSRV_SURFACE_DIMS; + +typedef struct _PVRSRV_SURFACE_INFO_ +{ + PVRSRV_SURFACE_DIMS sDims; + PVRSRV_SURFACE_FORMAT sFormat; +} PVRSRV_SURFACE_INFO; + +typedef struct _PVRSRV_SURFACE_RECT_ +{ + IMG_INT32 i32XOffset; + IMG_INT32 i32YOffset; + PVRSRV_SURFACE_DIMS sDims; +} PVRSRV_SURFACE_RECT; + +typedef struct _PVRSRV_SURFACE_CONFIG_INFO_ +{ + /*!< Crop applied to surface (BEFORE transformation) */ + PVRSRV_SURFACE_RECT sCrop; + + /*!< Region of screen to display surface in (AFTER scaling) */ + PVRSRV_SURFACE_RECT sDisplay; + + /*!< Surface rotation / flip / mirror */ + IMG_UINT32 ui32Transform; + + /*!< Alpha blending mode e.g. none / premult / coverage */ + IMG_UINT32 eBlendType; + + /*!< Custom data for the display engine */ + IMG_UINT32 ui32Custom; + + /*!< Plane alpha */ + IMG_UINT8 ui8PlaneAlpha; + IMG_UINT8 ui8Reserved1[3]; +} PVRSRV_SURFACE_CONFIG_INFO; + +typedef struct _PVRSRV_PANEL_INFO_ +{ + PVRSRV_SURFACE_INFO sSurfaceInfo; + IMG_UINT32 ui32RefreshRate; + IMG_UINT32 ui32XDpi; + IMG_UINT32 ui32YDpi; +} PVRSRV_PANEL_INFO; + +/* + Helper function to create a Config Info based on a Surface Info + to do a flip with no scale, transformation etc. +*/ +static INLINE IMG_VOID SurfaceConfigFromSurfInfo(PVRSRV_SURFACE_INFO *psSurfaceInfo, + PVRSRV_SURFACE_CONFIG_INFO *psConfigInfo) +{ + psConfigInfo->sCrop.sDims = psSurfaceInfo->sDims; + psConfigInfo->sCrop.i32XOffset = 0; + psConfigInfo->sCrop.i32YOffset = 0; + psConfigInfo->sDisplay.sDims = psSurfaceInfo->sDims; + psConfigInfo->sDisplay.i32XOffset = 0; + psConfigInfo->sDisplay.i32YOffset = 0; + psConfigInfo->ui32Transform = PVRSRV_SURFACE_TRANSFORM_NONE; + psConfigInfo->eBlendType = PVRSRV_SURFACE_BLENDING_NONE; + psConfigInfo->ui32Custom = 0; + psConfigInfo->ui8PlaneAlpha = 0xff; +} + +#endif /* _PVRSRV_SURFACE_H_ */ diff --git a/drivers/gpu/rogue/include/pvrversion.h b/drivers/gpu/rogue/include/pvrversion.h new file mode 100755 index 000000000000..8310322605ee --- /dev/null +++ b/drivers/gpu/rogue/include/pvrversion.h @@ -0,0 +1,74 @@ +/*************************************************************************/ /*! +@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_ + +#define PVR_STR(X) #X +#define PVR_STR2(X) PVR_STR(X) + +#define PVRVERSION_MAJ 1 +#define PVRVERSION_MIN 4 + +#define PVRVERSION_FAMILY "rogueddk" +#define PVRVERSION_BRANCHNAME "1.4" +#define PVRVERSION_BUILD 3443629 +#define PVRVERSION_BSCONTROL "Rogue_DDK_Android_RSCompute" + +#define PVRVERSION_STRING "Rogue_DDK_Android_RSCompute rogueddk 1.4@" PVR_STR2(PVRVERSION_BUILD) +#define PVRVERSION_STRING_SHORT "1.4@" PVR_STR2(PVRVERSION_BUILD) "" + +#define COPYRIGHT_TXT "Copyright (c) Imagination Technologies Ltd. All Rights Reserved." + +#define PVRVERSION_BUILD_HI 344 +#define PVRVERSION_BUILD_LO 3629 +#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 "L 0.10" +#endif /* _PVRVERSION_H_ */ diff --git a/drivers/gpu/rogue/include/rgx_common.h b/drivers/gpu/rogue/include/rgx_common.h new file mode 100644 index 000000000000..4e59c145c344 --- /dev/null +++ b/drivers/gpu/rogue/include/rgx_common.h @@ -0,0 +1,129 @@ +/*************************************************************************/ /*! +@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) + + + +#if defined (__cplusplus) +} +#endif + +#endif /* RGX_COMMON_H_ */ + +/****************************************************************************** + End of file +******************************************************************************/ + diff --git a/drivers/gpu/rogue/include/rgx_heaps.h b/drivers/gpu/rogue/include/rgx_heaps.h new file mode 100644 index 000000000000..1472436db09a --- /dev/null +++ b/drivers/gpu/rogue/include/rgx_heaps.h @@ -0,0 +1,85 @@ +/*************************************************************************/ /*! +@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 */ + +/* +*/ +#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 */ + +#endif /* __RGX_HEAPS_H__ */ + diff --git a/drivers/gpu/rogue/include/rgx_hwperf_km.h b/drivers/gpu/rogue/include/rgx_hwperf_km.h new file mode 100644 index 000000000000..86b709c54370 --- /dev/null +++ b/drivers/gpu/rogue/include/rgx_hwperf_km.h @@ -0,0 +1,358 @@ +/*************************************************************************/ /*! +@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) )) + + +/*! 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 */ + +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_UINT8 ui8BlockID; + + /*! 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]; +} 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/include/rgx_memallocflags.h b/drivers/gpu/rogue/include/rgx_memallocflags.h new file mode 100644 index 000000000000..5fa19094c63e --- /dev/null +++ b/drivers/gpu/rogue/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/include/rgx_meta.h b/drivers/gpu/rogue/include/rgx_meta.h new file mode 100644 index 000000000000..4548f9274333 --- /dev/null +++ b/drivers/gpu/rogue/include/rgx_meta.h @@ -0,0 +1,345 @@ +/*************************************************************************/ /*! +@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; + +#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). */ +#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) + +// Temporarily use uncached for everything: +//#define RGXFW_SEGMMU_OUTADDR_TOP(mmu_ctx, bifdm) RGXFW_SEGMMU_OUTADDR_TOP_S7_SLC_CACHED(mmu_ctx) +#define RGXFW_SEGMMU_OUTADDR_TOP(mmu_ctx, bifdm) RGXFW_SEGMMU_OUTADDR_TOP_S7_SLC_UNCACHED(mmu_ctx | (bifdm&0x0)) +#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) +#if defined(HW_ERN_45914) +#define RGXFW_BOOTLDR_DEVV_ADDR_1 (0x003000E1) +#else +#define RGXFW_BOOTLDR_DEVV_ADDR_1 (0x000007E1) +#endif +#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 (0x800) +#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/include/rgx_options_km.h b/drivers/gpu/rogue/include/rgx_options_km.h new file mode 100644 index 000000000000..994d9e9b7dc4 --- /dev/null +++ b/drivers/gpu/rogue/include/rgx_options_km.h @@ -0,0 +1,204 @@ +/*************************************************************************/ /*! +@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_PMMIF) || defined (INTERNAL_TEST) + #define SUPPORT_PMMIF_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_PMMIF */ + + +#if defined(SUPPORT_RGX) || defined (INTERNAL_TEST) + #define SUPPORT_RGX_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_RGX */ + + +#if defined(SUPPORT_SECURE_EXPORT) || defined (INTERNAL_TEST) + #define SUPPORT_SECURE_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_SECURE_EXPORT */ + + +#if defined(SUPPORT_INSECURE_EXPORT) || defined (INTERNAL_TEST) + #define SUPPORT_INSECURE_EXPORT_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_INSECURE_EXPORT */ + + +#if defined(SUPPORT_VFP) || defined (INTERNAL_TEST) + #define SUPPORT_VFP_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_VFP */ + + +#if defined(SUPPORT_DRM) || defined (INTERNAL_TEST) + #define SUPPORT_DRM_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_DRM */ + + +#if defined(SUPPORT_ION) || defined (INTERNAL_TEST) + #define SUPPORT_ION_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 /* SUPPORT_ION */ + +#if defined(DEBUG) || defined (INTERNAL_TEST) + #define DEBUG_SET_OFFSET OPTIONS_BIT11 + #define OPTIONS_BIT11 (0x1ul << 11) + #if OPTIONS_BIT11 > RGX_BUILD_OPTIONS_MASK_KM + #error "Bit exceeds reserved range" + #endif +#else + #define OPTIONS_BIT11 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 |\ + OPTIONS_BIT11 + + diff --git a/drivers/gpu/rogue/include/rgxscript.h b/drivers/gpu/rogue/include/rgxscript.h new file mode 100644 index 000000000000..43e7679192d5 --- /dev/null +++ b/drivers/gpu/rogue/include/rgxscript.h @@ -0,0 +1,178 @@ +/*************************************************************************/ /*! +@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_DBGBUS_COMMANDS (4096) +#define RGX_MAX_DEINIT_COMMANDS (32) +#define RGX_DBG_CMD_NAME_SIZE (32) + +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_INIT_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/include/ri_typedefs.h b/drivers/gpu/rogue/include/ri_typedefs.h new file mode 100644 index 000000000000..c7e9a46ebf9b --- /dev/null +++ b/drivers/gpu/rogue/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/include/services.h b/drivers/gpu/rogue/include/services.h new file mode 100644 index 000000000000..b1deb9c5cb58 --- /dev/null +++ b/drivers/gpu/rogue/include/services.h @@ -0,0 +1,1258 @@ +/*************************************************************************/ /*! +@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 (__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" + +/* +*/ + +#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 */ + + +#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 +*/ +/* +*/ +#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_WDDMKMD = 0x00000008, /*!< WDDM KMD */ + IMG_WDDM3DNODE = 0x00000009, /*!< WDDM 3D Node */ + IMG_WDDMMVIDEONODE = 0x0000000A, /*!< WDDM MVideo Node */ + IMG_WDDMVPBNODE = 0x0000000B, /*!< WDDM VPB Node */ + IMG_OPENGL = 0x0000000C, /*!< OpenGL */ + IMG_D3D = 0x0000000D, /*!< D3D */ + IMG_OPENCL = 0x0000000E, /*!< OpenCL */ + IMG_ANDROID_HAL = 0x0000000F, /*!< Graphics HAL */ + IMG_WEC_GPE = 0x00000010, /*!< WinEC-specific GPE */ + IMG_PVRGPE = 0x00000011, /*!< WinEC/WinCE GPE */ + IMG_RSCOMPUTE = 0x00000012, /*!< RenderScript Compute */ + IMG_OPENRL = 0x00000013, /*!< OpenRL Module */ + IMG_PDUMPCTRL = 0x00000014, /*!< PDump control client */ + +} 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; + + +/*************************************************************************/ /*! + * Client dev info + */ /*************************************************************************/ +typedef struct _PVRSRV_CLIENT_DEV_DATA_ +{ + IMG_UINT32 ui32NumDevices; /*!< Number of services-managed devices connected */ + PVRSRV_DEVICE_IDENTIFIER asDevID[PVRSRV_MAX_DEVICES]; /*!< Device identifiers */ + PVRSRV_ERROR (*apfnDevConnect[PVRSRV_MAX_DEVICES])(PPVRSRV_DEV_DATA); /*!< device-specific connection callback */ + PVRSRV_ERROR (*apfnDumpTrace[PVRSRV_MAX_DEVICES])(PPVRSRV_DEV_DATA); /*!< device-specific debug trace callback */ + +} PVRSRV_CLIENT_DEV_DATA; + +/*! + ****************************************************************************** + * 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 connection from an application to the services + module and initialises device-specific call-back functions. +@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 object 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 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 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 RGX clock speed +@Input psConnection Services connection +@Input psDevData Pointer to the PVRSRV_DEV_DATA context +@Output pui32RGXClockSpeed 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 pui32RGXClockSpeed); + +/**************************************************************************/ /*! +@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 Event Object API(s) + *****************************************************************************/ + +/***************************************************************************** +@Function PVRSRVAcquireGlobalEventObject +@Description Gets a handle to an event + Outputs : phOSEvent Global eventobject event + Returns : +@Return PVRSRV_OK on success. Otherwise, a PVRSRV_ + error code + +******************************************************************************/ +IMG_IMPORT PVRSRV_ERROR +PVRSRVAcquireGlobalEventObject(const PVRSRV_CONNECTION *psConnection, + IMG_HANDLE *phOSEvent); + +/***************************************************************************** + Function Name : PVRSRVReleaseGlobalEventObject + Inputs : phOSEvent Global eventobject event + Outputs : +@Return PVRSRV_OK on success. Otherwise, a PVRSRV_ + error code + +******************************************************************************/ +IMG_IMPORT PVRSRV_ERROR +PVRSRVReleaseGlobalEventObject(const PVRSRV_CONNECTION *psConnection, + IMG_HANDLE hOSEvent); + +/**************************************************************************/ /*! +@Function PVRSRVEventObjectWait +@Description Wait (block) on the OS-specific event object passed +@Input psConnection Services connection +@Input hOSEvent the event object to wait on +@Return PVRSRV_OK on success. Otherwise, a PVRSRV_ + error code + */ /**************************************************************************/ +IMG_IMPORT PVRSRV_ERROR +PVRSRVEventObjectWait(const PVRSRV_CONNECTION *psConnection, + IMG_HANDLE hOSEvent); + + +IMG_IMPORT PVRSRV_ERROR +PVRSRVKickDevices(const PVRSRV_CONNECTION *psConnection); + + +/**************************************************************************/ /*! +@Function RGXSoftReset +@Description Resets some modules of the RGX device +@Input psConnection Services connection +@Input psDevData Pointer to the PVRSRV_DEV_DATA context +@Output ui64ResetValue a mask for which each bit set correspond + to a module to reset. +@Return PVRSRV_ERROR +*/ /***************************************************************************/ +IMG_IMPORT PVRSRV_ERROR +PVRSRVSoftReset(const PVRSRV_CONNECTION *psConnection, + PVRSRV_DEV_DATA *psDevData, + IMG_UINT64 ui64ResetValue); + +/*! + 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/include/servicesext.h b/drivers/gpu/rogue/include/servicesext.h new file mode 100644 index 000000000000..09dd2243e9d0 --- /dev/null +++ b/drivers/gpu/rogue/include/servicesext.h @@ -0,0 +1,180 @@ +/*************************************************************************/ /*! +@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 "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, + IMG_BOOL bIdleDevice, + 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, + IMG_BOOL bIdleDevice, + PVRSRV_DEV_POWER_STATE eCurrentPowerState); + +/*! + ***************************************************************************** + * 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 _PVRSRV_ROTATION_ { + PVRSRV_ROTATE_0 = 0, /*!< Rotate by 0 degres */ + PVRSRV_ROTATE_90 = 1, /*!< Rotate by 90 degrees */ + PVRSRV_ROTATE_180 = 2, /*!< Rotate by 180 degrees */ + PVRSRV_ROTATE_270 = 3, /*!< Rotate by 270 degrees */ + PVRSRV_FLIP_Y = 4, /*!< Flip in Y axis */ + +} PVRSRV_ROTATION; + +/*! + ***************************************************************************** + * 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/include/sync_external.h b/drivers/gpu/rogue/include/sync_external.h new file mode 100644 index 000000000000..efe5beb19c03 --- /dev/null +++ b/drivers/gpu/rogue/include/sync_external.h @@ -0,0 +1,78 @@ +/*************************************************************************/ /*! +@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) + 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) +#define __pvrsrv_defined_struct_enum__ +#include +#endif + +#endif /* _SYNC_EXTERNAL_ */ diff --git a/drivers/gpu/rogue/include/system/rgx_tc/apollo_regs.h b/drivers/gpu/rogue/include/system/rgx_tc/apollo_regs.h new file mode 100644 index 000000000000..5e04920b8a84 --- /dev/null +++ b/drivers/gpu/rogue/include/system/rgx_tc/apollo_regs.h @@ -0,0 +1,79 @@ +/*************************************************************************/ /*! +@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__ + +#if 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 + +/* 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) + +/* RGX reg on base register 1 */ +#define SYS_RGX_REG_PCI_BASENUM (1) +#define SYS_RGX_REG_REGION_SIZE (0x00004000) + +#endif /* if !defined(__APOLLO_REGS_H__) */ diff --git a/drivers/gpu/rogue/include/system/rgx_tc/pdp_regs.h b/drivers/gpu/rogue/include/system/rgx_tc/pdp_regs.h new file mode 100644 index 000000000000..bd26b0617f95 --- /dev/null +++ b/drivers/gpu/rogue/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/include/system/rgx_tc/tcf_clk_ctrl.h b/drivers/gpu/rogue/include/system/rgx_tc/tcf_clk_ctrl.h new file mode 100644 index 000000000000..a42d23e995dc --- /dev/null +++ b/drivers/gpu/rogue/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/include/system/rgx_tc/tcf_pll.h b/drivers/gpu/rogue/include/system/rgx_tc/tcf_pll.h new file mode 100644 index 000000000000..fa0f823b7be2 --- /dev/null +++ b/drivers/gpu/rogue/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/include/system/rgx_tc/tcf_rgbpdp_regs.h b/drivers/gpu/rogue/include/system/rgx_tc/tcf_rgbpdp_regs.h new file mode 100644 index 000000000000..f3e6d54613d1 --- /dev/null +++ b/drivers/gpu/rogue/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/kernel/drivers/staging/imgtec/Kbuild.mk b/drivers/gpu/rogue/kernel/drivers/staging/imgtec/Kbuild.mk new file mode 100644 index 000000000000..45bf201fdb85 --- /dev/null +++ b/drivers/gpu/rogue/kernel/drivers/staging/imgtec/Kbuild.mk @@ -0,0 +1,66 @@ +########################################################################### ### +#@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 \ + kernel/drivers/staging/imgtec/ion_lma_heap.o + +adf_sunxi-y += \ + kernel/drivers/staging/imgtec/adf_sunxi.o \ + kernel/drivers/staging/imgtec/adf_common.o diff --git a/drivers/gpu/rogue/kernel/drivers/staging/imgtec/Linux.mk b/drivers/gpu/rogue/kernel/drivers/staging/imgtec/Linux.mk new file mode 100644 index 000000000000..d83499d976af --- /dev/null +++ b/drivers/gpu/rogue/kernel/drivers/staging/imgtec/Linux.mk @@ -0,0 +1,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. +### ########################################################################### + +modules := adf_fbdev adf_pdp apollo adf_sunxi + +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 diff --git a/drivers/gpu/rogue/kernel/drivers/staging/imgtec/adf_common.c b/drivers/gpu/rogue/kernel/drivers/staging/imgtec/adf_common.c new file mode 100644 index 000000000000..5ca8872f4c65 --- /dev/null +++ b/drivers/gpu/rogue/kernel/drivers/staging/imgtec/adf_common.c @@ -0,0 +1,480 @@ +/*************************************************************************/ /*! +@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