From: Imagination Technologies/TI Date: Mon, 11 Feb 2013 22:34:31 +0000 (+0200) Subject: 1.9.19.2139099/4.08.00.01 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c73eb6c59bf3d1c738a1019ca0ab5df1a4b13d9a;p=sgx.git 1.9.19.2139099/4.08.00.01 --- diff --git a/GPL-COPYING b/GPL-COPYING new file mode 100644 index 0000000..83d1261 --- /dev/null +++ b/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/INSTALL b/INSTALL index edba256..aefa6c3 100644 --- a/INSTALL +++ b/INSTALL @@ -4,43 +4,43 @@ Copyright (C) Imagination Technologies Ltd. All rights reserved. ====================================================================== This file covers how to build and install the Imagination Technologies -SGX DDK for the Linux kernel. +SGX DDK for the Linux kernel. Build System Environment Variables ------------------------------------------- -The SGX DDK Build scripts depend on a number of environment variables -being setup before compilation or installation of DDK software can +The SGX 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, when the make install target is used. +The DDK Build scripts install files to the location specified by the +DISCIMAGE environment variable, when the make install target is used. This should point to the target filesystem. $ export DISCIMAGE=/path/to/filesystem $KERNELDIR -When building the SGX DDK kernel module, the build needs access -to the headers of the Linux kernel +When building the SGX DDK kernel module, the build needs access +to the headers of the Linux kernel $ export KERNELDIR=/path/to/kernel $PATH -If a cross compiler is being used make sure the PATH environment variable +If a cross compiler is being used make sure the PATH environment variable includes the path to the toolchain $ export PATH=$PATH:/path/to/toolchain $CROSS_COMPILE -Since the SGX DDK Build scripts are geared toward a cross-compilation -workflow, the CROSS_COMPILE environment variable needs to be set +Since the SGX DDK Build scripts are geared toward a cross-compilation +workflow, the CROSS_COMPILE environment variable needs to be set $ export CROSS_COMPILE=toolchain-prefix- Build and Install Instructions ------------------------------------------- -The SGX DDK configures different target builds within directories under -eurasiacon/build/linux/. +The SGX DDK configures different target builds within directories under +eurasiacon/build/linux/. The supported build targets are: @@ -49,12 +49,12 @@ The supported build targets are: 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. +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. - CFLAGS Build dependent optimisations and debug information flags. - SILENT Determines whether text of commands is produced during build. + BUILD The type of build being performed. + Alternatives are release, timing or debug. + CFLAGS Build dependent optimisations and debug information flags. + SILENT Determines whether text of commands is produced during build. To build for, change to the appropriate target directory, e.g.: $ cd eurasiacon/build/linux/platform/kbuild @@ -70,7 +70,3 @@ $ make install Become an ordinary user again: $ exit - - - - diff --git a/MIT-COPYING b/MIT-COPYING new file mode 100644 index 0000000..0cbd14e --- /dev/null +++ b/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/Makefile b/Makefile index 2daf6a9..ba1ce41 100644 --- a/Makefile +++ b/Makefile @@ -233,6 +233,7 @@ DISABLE_SGX_PB_GROW_SHRINK ?= 1 SUPPORT_LINUX_X86_PAT ?=1 SUPPORT_LINUX_X86_WRITECOMBINE ?=1 SUPPORT_SGX_LOW_LATENCY_SCHEDULING ?=1 +SUPPORT_PVRSRV_GET_DC_SYSTEM_BUFFER ?=1 ifeq ($(SUPPORT_XORG),1) SUPPORT_PDUMP_MULTI_PROCESS = 1 @@ -293,6 +294,7 @@ SYS_CFLAGS.$(SUPPORT_BUFFER_CLASS) += -DSUPPORT_BUFFER_CLASS SYS_CFLAGS.$(SUPPORT_PERCONTEXT_PB) += -DSUPPORT_PERCONTEXT_PB SYS_CFLAGS.$(SUPPORT_DYNAMIC_PBRESIZE) += -DSUPPORT_DYNAMIC_PBRESIZE SYS_CFLAGS.$(DISABLE_SGX_PB_GROW_SHRINK) += -DDISABLE_SGX_PB_GROW_SHRINK +SYS_CFLAGS.$(SUPPORT_PVRSRV_GET_DC_SYSTEM_BUFFER) += -DSUPPORT_PVRSRV_GET_DC_SYSTEM_BUFFER SYS_CFLAGS.$(USE_FBDEV) += -DUSE_FBDEV SYS_CFLAGS.$(USE_FBDEV) += -DFBDEV_NAME="\"$(FBDEV_NAME)\"" diff --git a/README b/README index 8d31e51..2eae109 100644 --- a/README +++ b/README @@ -7,17 +7,18 @@ Copyright (C) Imagination Technologies Ltd. All rights reserved. About ------------------------------------------- -This is the Imagination Technologies SGX DDK for the Linux kernel. +This is the Imagination Technologies SGX DDK for the Linux kernel. License ------------------------------------------- -You may use, distribute and copy this software under the terms of -GNU General Public License version 2. +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". -The full GNU General Public License version 2 is included in this -distribution in the file called "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 @@ -35,7 +36,7 @@ The DDK software must be installed by the root user. Become the root user: $ su Install the DDK software: -$ make install +# make install Become an ordinary user again: $ exit @@ -45,4 +46,4 @@ Contact information: ------------------------------------------- Imagination Technologies Ltd. -Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK +Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK diff --git a/eurasiacon/build/linux2/bits.mk b/eurasiacon/build/linux2/bits.mk index 173e1ef..a1a7eef 100644 --- a/eurasiacon/build/linux2/bits.mk +++ b/eurasiacon/build/linux2/bits.mk @@ -1,29 +1,43 @@ -# -# Copyright (C) Imagination Technologies Ltd. All rights reserved. +########################################################################### ### +#@Title Useful special targets which don't build anything +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 # -# This program is free software; you can redistribute it and/or modify it -# under the terms and conditions of the GNU General Public License, -# version 2, as published by the Free Software Foundation. +# The contents of this file are subject to the MIT license as set out below. # -# This program is distributed in the hope it will be useful but, except -# as otherwise stated in writing, 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. +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: # -# 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., -# 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. # -# The full GNU General Public License is included in this distribution in -# the file called "COPYING". -# -# Contact Information: -# Imagination Technologies Ltd. -# Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. # -# - -# Useful special targets which don't build anything +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION 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-%: ; @@ -41,10 +55,8 @@ whatis-$(RELATIVE_OUT)/host/%: ; $(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-v +.PHONY: ls-modules ls-modules: - @: $(foreach _m,$(ALL_MODULES),$(info $(_m))) -ls-modules-v: @: $(foreach _m,$(ALL_MODULES),$(info $($(_m)_type) $(_m) $(patsubst $(TOP)/%,%,$(INTERNAL_MAKEFILE_FOR_MODULE_$(_m))))) ifeq ($(strip $(MAKECMDGOALS)),visualise) @@ -64,18 +76,20 @@ endif .PHONY: help help: @echo 'Build targets' - @echo ' make, make build Build the UM/KM components of the build and scripts' - @echo ' make components Build only the UM components' - @echo ' make kbuild Build only the KM components' - @echo ' make scripts Build only the scripts (rc.pvr and install.sh)' - @echo ' make MODULE Build the module MODULE and all its dependencies' + @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 MODULE Build the module MODULE and all of its dependencies' @echo ' make eurasiacon/binary2_.../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 SOMEOPTION=1 ... Set configuration options (see Makefile.config)' - @echo '' + @echo ' EXCLUDED_APIS=... List of APIs to remove from the build' + @echo ' make SOMEOPTION=1 ... Set configuration options (see config/core.mk)' + @echo ' Defaults are set by $(PVR_BUILD_DIR)/Makefile' @echo 'Clean targets' @echo ' make clean Remove only intermediates for the current build' @echo ' make clobber As "make clean", but remove output files too' @@ -84,4 +98,15 @@ help: @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[-v] List all modules [with type+makefile]' + @echo ' make ls-modules List all modules defined by makefiles' + +ifneq ($(filter help,$(D)),) +empty := +space := $(empty) $(empty) +$(info Debug options) +$(info $(space)D=modules dump module info) +$(info $(space)D=freeze-config prevent config changes) +$(info $(space)D=config-changes dump diffs when config changes) +$(info Options may be combined: make D=freeze-config,config-changes) +$(error D=help given) +endif diff --git a/eurasiacon/build/linux2/buildvars.mk b/eurasiacon/build/linux2/buildvars.mk index b6bd2d3..24fa829 100644 --- a/eurasiacon/build/linux2/buildvars.mk +++ b/eurasiacon/build/linux2/buildvars.mk @@ -1,54 +1,66 @@ -# -# Copyright (C) Imagination Technologies Ltd. All rights reserved. +########################################################################### ### +#@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 # -# This program is free software; you can redistribute it and/or modify it -# under the terms and conditions of the GNU General Public License, -# version 2, as published by the Free Software Foundation. +# The contents of this file are subject to the MIT license as set out below. # -# This program is distributed in the hope it will be useful but, except -# as otherwise stated in writing, 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. +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: # -# 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., -# 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. # -# The full GNU General Public License is included in this distribution in -# the file called "COPYING". -# -# Contact Information: -# Imagination Technologies Ltd. -# Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. # -# - -# -# 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 -# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION 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 ($(BUILD),debug) -COMMON_FLAGS := -O0 +COMMON_USER_FLAGS := -O0 else OPTIM ?= -O2 -COMMON_FLAGS := $(OPTIM) +COMMON_USER_FLAGS := $(OPTIM) endif # FIXME: We should probably audit the driver for aliasing # -COMMON_FLAGS += -fno-strict-aliasing +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_FLAGS += -g +COMMON_USER_FLAGS += -g # These flags are used for kernel, User C and User C++ # -COMMON_FLAGS += \ - -W -Wall -Wno-missing-field-initializers -Wmissing-format-attribute +COMMON_FLAGS = -W -Wall # Some GCC warnings are C only, so we must mask them from C++ # @@ -56,11 +68,16 @@ COMMON_CFLAGS := $(COMMON_FLAGS) \ -Wdeclaration-after-statement -Wno-format-zero-length \ -Wmissing-prototypes -Wstrict-prototypes -# If we saw W=1, turn on some extra warnings. -# Most of these flags are new, so cc-option check them. +# Additional warnings, and optional warnings. # +WARNING_CFLAGS := \ + -Wpointer-arith -Wunused-parameter \ + -Wmissing-format-attribute \ + $(call cc-option,-Wno-missing-field-initializers) \ + $(call cc-option,-fdiagnostics-show-option) + ifeq ($(W),1) -COMMON_CFLAGS += \ +WARNING_CFLAGS += \ $(call cc-option,-Wbad-function-cast) \ $(call cc-option,-Wcast-qual) \ $(call cc-option,-Wcast-align) \ @@ -82,18 +99,84 @@ COMMON_CFLAGS += \ $(call cc-option,-Wwrite-strings) endif +WARNING_CFLAGS += \ + $(call cc-optional-warning,-Wunused-but-set-variable) + +HOST_WARNING_CFLAGS := \ + -Wpointer-arith -Wunused-parameter \ + -Wmissing-format-attribute \ + $(call host-cc-option,-Wno-missing-field-initializers) \ + $(call host-cc-option,-fdiagnostics-show-option) + +ifeq ($(W),1) +HOST_WARNING_CFLAGS += \ + $(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 + +HOST_WARNING_CFLAGS += \ + $(call host-cc-optional-warning,-Wunused-but-set-variable) + +KBUILD_WARNING_CFLAGS := \ + -Wno-unused-parameter -Wno-sign-compare +KBUILD_WARNING_CFLAGS += \ + $(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_CFLAGS) -Wpointer-arith -Wunused-parameter $(SYS_CFLAGS) + $(COMMON_USER_FLAGS) $(COMMON_CFLAGS) $(WARNING_CFLAGS) \ + $(SYS_CFLAGS) + ALL_HOST_CFLAGS := \ - $(COMMON_CFLAGS) -Wpointer-arith -Wunused-parameter + $(COMMON_USER_FLAGS) $(COMMON_CFLAGS) $(HOST_WARNING_CFLAGS) # User C++ only # ALL_CXXFLAGS := \ - $(COMMON_FLAGS) -fno-rtti -fno-exceptions \ - -Wpointer-arith -Wunused-parameter $(SYS_CXXFLAGS) + $(COMMON_USER_FLAGS) $(COMMON_FLAGS) \ + -fno-rtti -fno-exceptions \ + -Wpointer-arith -Wunused-parameter \ + $(SYS_CXXFLAGS) + +ALL_HOST_CXXFLAGS := \ + $(COMMON_USER_FLAGS) $(COMMON_CFLAGS) -Wall # User C and C++ # @@ -118,9 +201,11 @@ ALL_LDFLAGS += $(SYS_LDFLAGS) # Kernel C only # -ALL_KBUILD_CFLAGS := $(COMMON_CFLAGS) -Wno-unused-parameter -Wno-sign-compare \ - $(call cc-option,-Wno-type-limits) \ - $(call cc-option,-Wno-unused-but-set-variable) +ALL_KBUILD_CFLAGS := $(COMMON_CFLAGS) $(KBUILD_WARNING_CFLAGS) \ + $(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) # This variable contains a list of all modules built by kbuild ALL_KBUILD_MODULES := diff --git a/eurasiacon/build/linux2/commands.mk b/eurasiacon/build/linux2/commands.mk index 35d1988..25e5ed1 100644 --- a/eurasiacon/build/linux2/commands.mk +++ b/eurasiacon/build/linux2/commands.mk @@ -1,26 +1,42 @@ -# -# Copyright (C) Imagination Technologies Ltd. All rights reserved. +########################################################################### ### +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 # -# This program is free software; you can redistribute it and/or modify it -# under the terms and conditions of the GNU General Public License, -# version 2, as published by the Free Software Foundation. +# The contents of this file are subject to the MIT license as set out below. # -# This program is distributed in the hope it will be useful but, except -# as otherwise stated in writing, 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. +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: # -# 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., -# 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. # -# The full GNU General Public License is included in this distribution in -# the file called "COPYING". -# -# Contact Information: -# Imagination Technologies Ltd. -# Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. # +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION 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 $^ @@ -174,8 +190,6 @@ override CC_CHECK := $(if $(V),,@)$(MAKE_TOP)/tools/cc-check.sh override CXX := $(if $(V),,@)$(CROSS_COMPILE)$(CXX) override CHMOD := $(if $(V),,@)chmod override CP := $(if $(V),,@)cp -override DOS2UNIX := $(if $(V),,@)\ - $(shell if [ -z `which fromdos` ]; then echo dos2unix -f -q; else echo fromdos -f -p; fi) override ECHO := $(if $(V),,@)echo override FLEX := $(if $(V),,@)flex override GAWK := $(if $(V),,@)gawk diff --git a/eurasiacon/build/linux2/common/apis/xorg.mk b/eurasiacon/build/linux2/common/apis/xorg.mk index f0a8ef0..fc87c2f 100644 --- a/eurasiacon/build/linux2/common/apis/xorg.mk +++ b/eurasiacon/build/linux2/common/apis/xorg.mk @@ -1,29 +1,48 @@ -# -# Copyright (C) Imagination Technologies Ltd. All rights reserved. +########################################################################### ### +#@Title XOrg root makefile +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 # -# This program is free software; you can redistribute it and/or modify it -# under the terms and conditions of the GNU General Public License, -# version 2, as published by the Free Software Foundation. +# The contents of this file are subject to the MIT license as set out below. # -# This program is distributed in the hope it will be useful but, except -# as otherwise stated in writing, 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. +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: # -# 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., -# 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. # -# The full GNU General Public License is included in this distribution in -# the file called "COPYING". -# -# Contact Information: -# Imagination Technologies Ltd. -# Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. # -# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION 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 ($(filter xorg,$(EXCLUDED_APIS)),) - COMPONENTS += xorg pvr_conf pvr_video wsegl_dri2_linux + COMPONENTS += xorg pvr_conf pvr_video pvr_video_bin wsegl_dri2_linux -include ../common/apis/xorg_opengl.mk +ifeq ($(SUPPORT_PVR_REMOTE),1) + COMPONENTS += pvr_input +endif endif diff --git a/eurasiacon/build/linux2/common/dridrm.mk b/eurasiacon/build/linux2/common/dridrm.mk index 5979012..5d0289f 100644 --- a/eurasiacon/build/linux2/common/dridrm.mk +++ b/eurasiacon/build/linux2/common/dridrm.mk @@ -1,30 +1,46 @@ -# -# Copyright (C) Imagination Technologies Ltd. All rights reserved. +########################################################################### ### +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 # -# This program is free software; you can redistribute it and/or modify it -# under the terms and conditions of the GNU General Public License, -# version 2, as published by the Free Software Foundation. +# The contents of this file are subject to the MIT license as set out below. # -# This program is distributed in the hope it will be useful but, except -# as otherwise stated in writing, 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. +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: # -# 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., -# 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. # -# The full GNU General Public License is included in this distribution in -# the file called "COPYING". -# -# Contact Information: -# Imagination Technologies Ltd. -# Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. # -# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION 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 TunableBothConfigC,SUPPORT_DRI_DRM,)) $(eval $(call TunableBothConfigC,SUPPORT_DRI_DRM_EXT,)) +$(eval $(call TunableKernelConfigC,SUPPORT_DRI_DRM_PLUGIN,)) $(eval $(call TunableBothConfigMake,SUPPORT_DRI_DRM,)) @@ -33,6 +49,7 @@ ifeq ($(SUPPORT_DRI_DRM),1) ifeq ($(SUPPORT_DRI_DRM_NO_LIBDRM),1) endif $(eval $(call TunableKernelConfigC,PVR_SECURE_DRM_AUTH_EXPORT,)) +$(eval $(call TunableKernelConfigC,SUPPORT_DRM_MODESET,)) endif $(eval $(call TunableKernelConfigC,PVR_DISPLAY_CONTROLLER_DRM_IOCTL,)) @@ -42,4 +59,5 @@ $(eval $(call TunableBothConfigMake,PVR_DRI_DRM_NOT_PCI)) $(eval $(call TunableKernelConfigC,PVR_DRI_DRM_PLATFORM_DEV,)) + export EXTERNAL_3PDD_TARBALL diff --git a/eurasiacon/build/linux2/common/omap4.mk b/eurasiacon/build/linux2/common/omap4.mk index 8c0a172..153159a 100644 --- a/eurasiacon/build/linux2/common/omap4.mk +++ b/eurasiacon/build/linux2/common/omap4.mk @@ -1,27 +1,43 @@ -# -# Copyright (C) Imagination Technologies Ltd. All rights reserved. +########################################################################### ### +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 # -# This program is free software; you can redistribute it and/or modify it -# under the terms and conditions of the GNU General Public License, -# version 2, as published by the Free Software Foundation. +# The contents of this file are subject to the MIT license as set out below. # -# This program is distributed in the hope it will be useful but, except -# as otherwise stated in writing, 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. +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: # -# 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., -# 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. # -# The full GNU General Public License is included in this distribution in -# the file called "COPYING". -# -# Contact Information: -# Imagination Technologies Ltd. -# Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. # -# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION 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 TunableBothConfigC,PVR_NO_FULL_CACHE_OPS,)) $(eval $(call TunableKernelConfigC,PVR_NO_OMAP_TIMER,)) +$(eval $(call TunableKernelConfigC,PVR_OMAPLFB_DONT_USE_FB_PAN_DISPLAY,)) +$(eval $(call TunableKernelConfigC,PVR_OMAPLFB_DRM_FB,)) diff --git a/eurasiacon/build/linux2/common/opencl.mk b/eurasiacon/build/linux2/common/opencl.mk index 42c0ed0..b5f84d4 100644 --- a/eurasiacon/build/linux2/common/opencl.mk +++ b/eurasiacon/build/linux2/common/opencl.mk @@ -1,24 +1,40 @@ -# -# Copyright (C) Imagination Technologies Ltd. All rights reserved. +########################################################################### ### +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 # -# This program is free software; you can redistribute it and/or modify it -# under the terms and conditions of the GNU General Public License, -# version 2, as published by the Free Software Foundation. +# The contents of this file are subject to the MIT license as set out below. # -# This program is distributed in the hope it will be useful but, except -# as otherwise stated in writing, 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. +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: # -# 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., -# 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. # -# The full GNU General Public License is included in this distribution in -# the file called "COPYING". -# -# Contact Information: -# Imagination Technologies Ltd. -# Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. # +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION 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/eurasiacon/build/linux2/common/xorg.mk b/eurasiacon/build/linux2/common/xorg.mk index f503460..27c77a3 100644 --- a/eurasiacon/build/linux2/common/xorg.mk +++ b/eurasiacon/build/linux2/common/xorg.mk @@ -1,28 +1,48 @@ -# -# Copyright (C) Imagination Technologies Ltd. All rights reserved. +########################################################################### ### +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 # -# This program is free software; you can redistribute it and/or modify it -# under the terms and conditions of the GNU General Public License, -# version 2, as published by the Free Software Foundation. +# The contents of this file are subject to the MIT license as set out below. # -# This program is distributed in the hope it will be useful but, except -# as otherwise stated in writing, 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. +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: # -# 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., -# 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. # -# The full GNU General Public License is included in this distribution in -# the file called "COPYING". -# -# Contact Information: -# Imagination Technologies Ltd. -# Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. # +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### PVR_SECURE_DRM_AUTH_EXPORT := 1 $(eval $(call TunableKernelConfigC,XPROC_WORKAROUND_NUM_SHAREABLES,4095)) +ifeq ($(SUPPORT_PVR_REMOTE),1) +else +endif + diff --git a/eurasiacon/build/linux2/common/xorg_test.mk b/eurasiacon/build/linux2/common/xorg_test.mk index 6e7552f..a1b4009 100644 --- a/eurasiacon/build/linux2/common/xorg_test.mk +++ b/eurasiacon/build/linux2/common/xorg_test.mk @@ -1,27 +1,42 @@ -# -# Copyright (C) Imagination Technologies Ltd. All rights reserved. +########################################################################### ### +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 # -# This program is free software; you can redistribute it and/or modify it -# under the terms and conditions of the GNU General Public License, -# version 2, as published by the Free Software Foundation. +# The contents of this file are subject to the MIT license as set out below. # -# This program is distributed in the hope it will be useful but, except -# as otherwise stated in writing, 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. +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: # -# 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., -# 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. # -# The full GNU General Public License is included in this distribution in -# the file called "COPYING". -# -# Contact Information: -# Imagination Technologies Ltd. -# Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. # -# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### # FIXME: Will go away when SUPPORT_DRI_DRM is untangled from # the old meaning of SUPPORT_XORG=1. diff --git a/eurasiacon/build/linux2/config/core.mk b/eurasiacon/build/linux2/config/core.mk index 1c87e16..8eb0824 100644 --- a/eurasiacon/build/linux2/config/core.mk +++ b/eurasiacon/build/linux2/config/core.mk @@ -1,27 +1,43 @@ -# -# Copyright (C) Imagination Technologies Ltd. All rights reserved. +########################################################################### ### +#@Title Root build configuration. +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 # -# This program is free software; you can redistribute it and/or modify it -# under the terms and conditions of the GNU General Public License, -# version 2, as published by the Free Software Foundation. +# The contents of this file are subject to the MIT license as set out below. # -# This program is distributed in the hope it will be useful but, except -# as otherwise stated in writing, 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. +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: # -# 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., -# 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. # -# The full GNU General Public License is included in this distribution in -# the file called "COPYING". -# -# Contact Information: -# Imagination Technologies Ltd. -# Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. # -# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION 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 @@ -110,10 +126,6 @@ endef ############################### END MACROS ################################## -DOS2UNIX := $(shell \ - if [ -z `which fromdos` ]; then echo dos2unix -f -q; else echo fromdos -f -p; fi \ -) - # Check we have a new enough version of GNU make. # need := 3.81 @@ -142,6 +154,14 @@ endif endif override EURASIAROOT := $(_GUESSED_EURASIAROOT) TOP := $(EURASIAROOT) + +ifneq ($(words $(TOP)),1) +$(warning This source tree is located in a path which contains whitespace,) +$(warning which is not supported.) +$(warning $(space)The root is: $(TOP)) +$(error Whitespace found in $$(TOP)) +endif + $(call directory-must-exist,$(TOP)) include ../defs.mk @@ -157,6 +177,7 @@ $(call directory-must-exist,$(TOP)/eurasiacon/build/linux2/$(PVR_BUILD_DIR)) # BUILD ?= release OUT ?= $(TOP)/eurasiacon/binary2_$(PVR_BUILD_DIR)_$(BUILD) +override OUT := $(if $(filter /%,$(OUT)),$(OUT),$(TOP)/$(OUT)) CONFIG_MK := $(OUT)/config.mk CONFIG_H := $(OUT)/config.h @@ -250,7 +271,31 @@ override SUPPORT_HW_RECOVERY := 0 override SUPPORT_ACTIVE_POWER_MANAGEMENT := 0 endif +# We're bumping against USSE limits on older cores because the ukernel +# is too large when building both SGX_DISABLE_VISTEST_SUPPORT=0 and +# PVRSRV_USSE_EDM_STATUS_DEBUG=1. +# +# Automatically disable vistest support if debugging the ukernel to +# prevent build failures. +# +ifneq ($(filter 520 530 531 535 540,$(SGXCORE)),) +ifneq ($(SGX_DISABLE_VISTEST_SUPPORT),1) +SGX_DISABLE_VISTEST_SUPPORT ?= not-overridden +ifeq ($(SGX_DISABLE_VISTEST_SUPPORT),not-overridden) +$(warning Setting SGX_DISABLE_VISTEST_SUPPORT=1 because PVRSRV_USSE_EDM_STATUS_DEBUG=1) +SGX_DISABLE_VISTEST_SUPPORT := 1 +endif +endif +endif + ifeq ($(SGXCORE),535) +ifeq ($(PVRSRV_USSE_EDM_STATUS_DEBUG),1) +SUPPORT_SGX_HWPERF ?= not-overridden +ifeq ($(SUPPORT_SGX_HWPERF),not-overridden) +$(warning Setting SUPPORT_SGX_HWPERF=0 because PVRSRV_USSE_EDM_STATUS_DEBUG=1) +SUPPORT_SGX_HWPERF := 0 +endif +endif PVR2D_ALT_2DHW ?= 0 endif @@ -303,7 +348,7 @@ $(foreach _o,SYS_CFLAGS SYS_CXXFLAGS SYS_EXE_LDFLAGS SYS_LIB_LDFLAGS SUPPORT_EWS # 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 opengles2 openvg ews unittests xorg xorg_unittests +_excludable_apis := opencl opengl opengles1 opengles2 openvg ews unittests xorg xorg_unittests scripts _unrecognised := $(strip $(filter-out $(_excludable_apis),$(EXCLUDED_APIS))) ifneq ($(_unrecognised),) $(warning *** Unrecognised entries in EXCLUDED_APIS: $(_unrecognised)) @@ -328,18 +373,46 @@ KERNEL_COMPONENTS += dbgdrv endif endif +ifeq ($(SUPPORT_PVR_REMOTE),1) +ifneq ($(filter pvr2d,$(COMPONENTS)),) +COMPONENTS += null_pvr2d_remote +endif +COMPONENTS += pvrvncsrv +endif + # If KERNELDIR is set, write it out to the config.mk, with # KERNEL_COMPONENTS and KERNEL_ID # ifneq ($(strip $(KERNELDIR)),) include ../kernel_version.mk +PVRSRV_MODULE_BASEDIR ?= /lib/modules/$(KERNEL_ID)/extra/ $(eval $(call KernelConfigMake,KERNELDIR,$(KERNELDIR))) # Needed only by install script $(eval $(call KernelConfigMake,KERNEL_COMPONENTS,$(KERNEL_COMPONENTS))) -$(eval $(call TunableKernelConfigMake,KERNEL_CROSS_COMPILE,)) $(eval $(call TunableKernelConfigMake,EXTRA_PVRSRVKM_COMPONENTS,)) $(eval $(call TunableKernelConfigMake,EXTRA_KBUILD_SOURCE,)) + +# 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. +VMLINUX := $(strip $(wildcard $(KERNELDIR)/vmlinux)) +ifneq ($(VMLINUX),) +VMLINUX_IS_64BIT := $(shell file $(VMLINUX) | grep -q 64-bit || echo false) +ifneq ($(VMLINUX_IS_64BIT),false) +$(warning $$(KERNELDIR)/vmlinux is 64-bit, which is not supported. Kbuild may fail.) +endif +else +$(warning $$(KERNELDIR)/vmlinux does not exist. Kbuild may fail.) endif +endif + # Ideally configured by platform Makefiles, as necessary # @@ -349,7 +422,6 @@ endif $(eval $(call BothConfigC,LINUX,)) $(eval $(call BothConfigC,PVR_BUILD_DIR,"\"$(PVR_BUILD_DIR)\"")) -$(eval $(call BothConfigC,PVR_BUILD_DATE,"\"\"")) $(eval $(call BothConfigC,PVR_BUILD_TYPE,"\"$(BUILD)\"")) $(eval $(call BothConfigC,PVRSRV_MODNAME,"\"$(PVRSRV_MODNAME)\"")) @@ -364,7 +436,21 @@ $(eval $(call TunableBothConfigC,USE_SGX_CORE_REV_HEAD,)) $(eval $(call BothConfigC,TRANSFER_QUEUE,)) $(eval $(call BothConfigC,PVR_SECURE_HANDLES,)) -$(eval $(call KernelConfigC,DISPLAY_CONTROLLER,$(DISPLAY_CONTROLLER))) +ifneq ($(DISPLAY_CONTROLLER),) +$(eval $(call BothConfigC,DISPLAY_CONTROLLER,$(DISPLAY_CONTROLLER))) +endif + +PVR_LINUX_MEM_AREA_POOL_MAX_PAGES ?= 0 +ifneq ($(PVR_LINUX_MEM_AREA_POOL_MAX_PAGES),0) +PVR_LINUX_MEM_AREA_USE_VMAP ?= 1 +include ../kernel_version.mk +ifeq ($(call kernel-version-at-least,3,0),true) +PVR_LINUX_MEM_AREA_POOL_ALLOW_SHRINK ?= 1 +endif +endif +$(eval $(call KernelConfigC,PVR_LINUX_MEM_AREA_POOL_MAX_PAGES,$(PVR_LINUX_MEM_AREA_POOL_MAX_PAGES))) +$(eval $(call TunableKernelConfigC,PVR_LINUX_MEM_AREA_USE_VMAP,)) +$(eval $(call TunableKernelConfigC,PVR_LINUX_MEM_AREA_POOL_ALLOW_SHRINK,)) $(eval $(call BothConfigMake,PVR_SYSTEM,$(PVR_SYSTEM))) @@ -403,7 +489,6 @@ $(eval $(call TunableBothConfigC,SUPPORT_MEMINFO_IDS,)) $(eval $(call TunableBothConfigC,SUPPORT_SGX_NEW_STATUS_VALS,1)) $(eval $(call TunableBothConfigC,SUPPORT_PDUMP_MULTI_PROCESS,)) $(eval $(call TunableBothConfigC,SUPPORT_DBGDRV_EVENT_OBJECTS,1)) -$(eval $(call TunableBothConfigC,PVR_DBG_BREAK_ASSERT_FAIL,)) $(eval $(call TunableBothConfigC,SGX_FEATURE_SYSTEM_CACHE,)) $(eval $(call TunableBothConfigC,SGX_BYPASS_SYSTEM_CACHE,)) $(eval $(call TunableBothConfigC,SGX_BYPASS_DCU,)) @@ -415,19 +500,26 @@ $(eval $(call TunableBothConfigC,PDUMP,)) $(eval $(call TunableBothConfigC,NO_HARDWARE,)) $(eval $(call TunableBothConfigC,PDUMP_DEBUG_OUTFILES,)) $(eval $(call TunableBothConfigC,PVRSRV_USSE_EDM_STATUS_DEBUG,)) +$(eval $(call TunableBothConfigC,SGX_DISABLE_VISTEST_SUPPORT,)) $(eval $(call TunableBothConfigC,PVRSRV_RESET_ON_HWTIMEOUT,)) $(eval $(call TunableBothConfigC,SYS_USING_INTERRUPTS,1)) $(eval $(call TunableBothConfigC,SUPPORT_EXTERNAL_SYSTEM_CACHE,)) +$(eval $(call TunableBothConfigC,PVRSRV_NEW_PVR_DPF,)) $(eval $(call TunableBothConfigC,PVRSRV_NEED_PVR_DPF,)) $(eval $(call TunableBothConfigC,PVRSRV_NEED_PVR_ASSERT,)) $(eval $(call TunableBothConfigC,PVRSRV_NEED_PVR_TRACE,)) $(eval $(call TunableBothConfigC,SUPPORT_SECURE_33657_FIX,)) +$(eval $(call TunableBothConfigC,SUPPORT_ION,)) +$(eval $(call TunableBothConfigC,SUPPORT_HWRECOVERY_TRACE_LIMIT,)) +$(eval $(call TunableBothConfigC,SUPPORT_PVRSRV_GET_DC_SYSTEM_BUFFER,1)) +$(eval $(call TunableBothConfigC,SUPPORT_NV12_FROM_2_HWADDRS,)) $(eval $(call TunableKernelConfigC,SUPPORT_LINUX_X86_WRITECOMBINE,1)) $(eval $(call TunableKernelConfigC,SUPPORT_LINUX_X86_PAT,1)) $(eval $(call TunableKernelConfigC,SGX_DYNAMIC_TIMING_INFO,)) $(eval $(call TunableKernelConfigC,SYS_SGX_ACTIVE_POWER_LATENCY_MS,)) $(eval $(call TunableKernelConfigC,SYS_CUSTOM_POWERLOCK_WRAP,)) +$(eval $(call TunableKernelConfigC,SYS_SUPPORTS_SGX_IDLE_CALLBACK,)) $(eval $(call TunableKernelConfigC,PVR_LINUX_USING_WORKQUEUES,)) $(eval $(call TunableKernelConfigC,PVR_LINUX_MISR_USING_WORKQUEUE,)) $(eval $(call TunableKernelConfigC,PVR_LINUX_MISR_USING_PRIVATE_WORKQUEUE,)) @@ -435,26 +527,33 @@ $(eval $(call TunableKernelConfigC,PVR_LINUX_TIMERS_USING_WORKQUEUES,)) $(eval $(call TunableKernelConfigC,PVR_LINUX_TIMERS_USING_SHARED_WORKQUEUE,)) $(eval $(call TunableKernelConfigC,LDM_PLATFORM,)) $(eval $(call TunableKernelConfigC,PVR_LDM_PLATFORM_PRE_REGISTERED,)) +$(eval $(call TunableKernelConfigC,PVR_LDM_PLATFORM_PRE_REGISTERED_DEV,)) +$(eval $(call TunableKernelConfigC,PVR_LDM_DRIVER_REGISTRATION_NAME,"\"$(PVRSRV_MODNAME)\"")) $(eval $(call TunableKernelConfigC,LDM_PCI,)) $(eval $(call TunableKernelConfigC,PVRSRV_DUMP_MK_TRACE,)) $(eval $(call TunableKernelConfigC,PVRSRV_DUMP_KERNEL_CCB,)) +$(eval $(call TunableKernelConfigC,PVRSRV_REFCOUNT_DEBUG,)) +$(eval $(call TunableKernelConfigC,PVRSRV_MMU_MAKE_READWRITE_ON_DEMAND,)) $(eval $(call TunableKernelConfigC,HYBRID_SHARED_PB_SIZE,)) +$(eval $(call TunableKernelConfigC,SUPPORT_LARGE_GENERAL_HEAP,)) +$(eval $(call TunableKernelConfigC,TTRACE,)) -$(eval $(call TunableBothConfigMake,LDM_PLATFORM,)) -$(eval $(call TunableBothConfigMake,LDM_PCI,)) +$(eval $(call TunableBothConfigMake,SUPPORT_ION,)) $(eval $(call TunableBothConfigMake,OPTIM,)) +$(eval $(call TunableKernelConfigMake,TTRACE,)) + endif # INTERNAL_CLOBBER_ONLY export INTERNAL_CLOBBER_ONLY export TOP export OUT -MAKE_ETC := -Rr --no-print-directory -C $(TOP) TOP=$(TOP) \ +MAKE_ETC := -Rr --no-print-directory -C $(TOP) TOP=$(TOP) OUT=$(OUT) \ -f eurasiacon/build/linux2/toplevel.mk # This must match the default value of MAKECMDGOALS below, and the default @@ -472,8 +571,8 @@ endif autogen: ifeq ($(INTERNAL_CLOBBER_ONLY),) @$(MAKE) -s --no-print-directory -C $(EURASIAROOT) \ - DOS2UNIX="$(DOS2UNIX)" \ - -f eurasiacon/build/linux2/prepare_tree.mk + -f eurasiacon/build/linux2/prepare_tree.mk \ + LDM_PCI=$(LDM_PCI) LDM_PLATFORM=$(LDM_PLATFORM) else @: endif diff --git a/eurasiacon/build/linux2/defs.mk b/eurasiacon/build/linux2/defs.mk index d4cfe29..621e03e 100644 --- a/eurasiacon/build/linux2/defs.mk +++ b/eurasiacon/build/linux2/defs.mk @@ -1,27 +1,42 @@ -# -# Copyright (C) Imagination Technologies Ltd. All rights reserved. +########################################################################### ### +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 # -# This program is free software; you can redistribute it and/or modify it -# under the terms and conditions of the GNU General Public License, -# version 2, as published by the Free Software Foundation. +# The contents of this file are subject to the MIT license as set out below. # -# This program is distributed in the hope it will be useful but, except -# as otherwise stated in writing, 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. +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: # -# 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., -# 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. # -# The full GNU General Public License is included in this distribution in -# the file called "COPYING". -# -# Contact Information: -# Imagination Technologies Ltd. -# Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. # -# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION 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),) @@ -81,7 +96,6 @@ endef define cc-check $(shell \ CC_CHECK=$(patsubst @%,%,$(CC_CHECK)) && \ - $(patsubst @%,%,$(DOS2UNIX)) $$CC_CHECK && \ $(patsubst @%,%,$(CHMOD)) +x $$CC_CHECK && \ $$CC_CHECK --cc "$(1)" --out "$(2)" $(3)) endef @@ -101,3 +115,26 @@ endef define host-cc-option $(call cc-check,$(patsubst @%,%,$(HOST_CC)),$(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 $(1)),) +endef diff --git a/eurasiacon/build/linux2/kbuild/Makefile.template b/eurasiacon/build/linux2/kbuild/Makefile.template index 4804e94..09ce3dc 100644 --- a/eurasiacon/build/linux2/kbuild/Makefile.template +++ b/eurasiacon/build/linux2/kbuild/Makefile.template @@ -1,27 +1,43 @@ -# -# Copyright (C) Imagination Technologies Ltd. All rights reserved. +########################################################################### ### +#@Title Root kernel makefile +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 # -# This program is free software; you can redistribute it and/or modify it -# under the terms and conditions of the GNU General Public License, -# version 2, as published by the Free Software Foundation. +# The contents of this file are subject to the MIT license as set out below. # -# This program is distributed in the hope it will be useful but, except -# as otherwise stated in writing, 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. +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: # -# 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., -# 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. # -# The full GNU General Public License is included in this distribution in -# the file called "COPYING". -# -# Contact Information: -# Imagination Technologies Ltd. -# Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. # -# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION 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_OUT)/kbuild/Makefile @@ -55,7 +71,6 @@ ccflags-y += -D__linux__ -include $(OUT)/config_kernel.h \ -I$(TOP)/services4/include \ -I$(TOP)/services4/system/$(PVR_SYSTEM) \ -I$(TOP)/services4/system/include \ - -I$(TOP)/services4/srvkm/hwdefs \ -I$(TOP)/services4/srvkm/bridged \ -I$(TOP)/services4/srvkm/bridged/sgx \ -I$(TOP)/services4/srvkm/common \ @@ -63,6 +78,12 @@ ccflags-y += -D__linux__ -include $(OUT)/config_kernel.h \ -I$(TOP)/services4/srvkm/env/linux \ -I$(TOP)/services4/srvkm/include +ifeq ($(PVR_LOCAL_HWDEFS),) +ccflags-y += -I$(TOP)/services4/srvkm/hwdefs +else +ccflags-y += -I$(TOP)/hwdefs +endif + include $(INTERNAL_KBUILD_MAKEFILES) $(if $(pvrsrvkm-y),,$(error pvrsrvkm-y was empty, which could mean that srvkm is missing from $$(KERNEL_COMPONENTS))) diff --git a/eurasiacon/build/linux2/kbuild/external_tarball.mk b/eurasiacon/build/linux2/kbuild/external_tarball.mk index caa58ed..d3aa147 100644 --- a/eurasiacon/build/linux2/kbuild/external_tarball.mk +++ b/eurasiacon/build/linux2/kbuild/external_tarball.mk @@ -1,27 +1,42 @@ -# -# Copyright (C) Imagination Technologies Ltd. All rights reserved. +########################################################################### ### +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 # -# This program is free software; you can redistribute it and/or modify it -# under the terms and conditions of the GNU General Public License, -# version 2, as published by the Free Software Foundation. +# The contents of this file are subject to the MIT license as set out below. # -# This program is distributed in the hope it will be useful but, except -# as otherwise stated in writing, 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. +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: # -# 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., -# 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. # -# The full GNU General Public License is included in this distribution in -# the file called "COPYING". -# -# Contact Information: -# Imagination Technologies Ltd. -# Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. # -# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION 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 ($(EXTERNAL_3PDD_TARBALL),) TAR_OPT_STRIP_COMPONENTS ?= --strip-components diff --git a/eurasiacon/build/linux2/kbuild/kbuild.mk b/eurasiacon/build/linux2/kbuild/kbuild.mk index 2d973af..94e2100 100644 --- a/eurasiacon/build/linux2/kbuild/kbuild.mk +++ b/eurasiacon/build/linux2/kbuild/kbuild.mk @@ -1,35 +1,46 @@ -# -# Copyright (C) Imagination Technologies Ltd. All rights reserved. +########################################################################### ### +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 # -# This program is free software; you can redistribute it and/or modify it -# under the terms and conditions of the GNU General Public License, -# version 2, as published by the Free Software Foundation. +# The contents of this file are subject to the MIT license as set out below. # -# This program is distributed in the hope it will be useful but, except -# as otherwise stated in writing, 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. +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: # -# 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., -# 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. # -# The full GNU General Public License is included in this distribution in -# the file called "COPYING". -# -# Contact Information: -# Imagination Technologies Ltd. -# Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. # -# - -include $(CONFIG_KERNEL_MK) +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION 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 $(strip $(KERNELDIR)),,$(error KERNELDIR must be set)) $(call directory-must-exist,$(KERNELDIR)) -KERNEL_CROSS_COMPILE ?= $(CROSS_COMPILE) - $(TARGET_OUT)/kbuild/Makefile: $(MAKE_TOP)/kbuild/Makefile.template @[ ! -e $(dir $@) ] && mkdir -p $(dir $@) || true $(CP) -f $< $@ @@ -51,11 +62,6 @@ kbuild: $(TARGET_OUT)/kbuild/Makefile EXTRA_CFLAGS="$(ALL_KBUILD_CFLAGS)" \ V=$(V) W=$(W) \ TOP=$(TOP) -ifeq ($(DEBUGLINK),1) - @for kernel_module in $(addprefix $(TARGET_OUT)/kbuild/,$(INTERNAL_KBUILD_OBJECTS:.o=.ko)); do \ - $(patsubst @%,%,$(STRIP)) --strip-unneeded $$kernel_module; \ - done -endif @for kernel_module in $(addprefix $(TARGET_OUT)/kbuild/,$(INTERNAL_KBUILD_OBJECTS:.o=.ko)); do \ cp $$kernel_module $(TARGET_OUT); \ done diff --git a/eurasiacon/build/linux2/kernel_module.mk b/eurasiacon/build/linux2/kernel_module.mk index f5db1a8..a0a1289 100644 --- a/eurasiacon/build/linux2/kernel_module.mk +++ b/eurasiacon/build/linux2/kernel_module.mk @@ -1,26 +1,42 @@ -# -# Copyright (C) Imagination Technologies Ltd. All rights reserved. +########################################################################### ### +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 # -# This program is free software; you can redistribute it and/or modify it -# under the terms and conditions of the GNU General Public License, -# version 2, as published by the Free Software Foundation. +# The contents of this file are subject to the MIT license as set out below. # -# This program is distributed in the hope it will be useful but, except -# as otherwise stated in writing, 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. +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: # -# 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., -# 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. # -# The full GNU General Public License is included in this distribution in -# the file called "COPYING". -# -# Contact Information: -# Imagination Technologies Ltd. -# Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. # +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION 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 diff --git a/eurasiacon/build/linux2/kernel_version.mk b/eurasiacon/build/linux2/kernel_version.mk index 8ed6aaa..35ecceb 100644 --- a/eurasiacon/build/linux2/kernel_version.mk +++ b/eurasiacon/build/linux2/kernel_version.mk @@ -1,27 +1,42 @@ -# -# Copyright (C) Imagination Technologies Ltd. All rights reserved. +########################################################################### ### +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 # -# This program is free software; you can redistribute it and/or modify it -# under the terms and conditions of the GNU General Public License, -# version 2, as published by the Free Software Foundation. +# The contents of this file are subject to the MIT license as set out below. # -# This program is distributed in the hope it will be useful but, except -# as otherwise stated in writing, 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. +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: # -# 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., -# 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. # -# The full GNU General Public License is included in this distribution in -# the file called "COPYING". -# -# Contact Information: -# Imagination Technologies Ltd. -# Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. # -# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION 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)) @@ -34,28 +49,52 @@ override KERNEL_SUBLEVEL := \ 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) -# UTS_RELEASE is more accurate, if we can find it -# If we can't, fall back to manufacturing the version -# +# Try to get the kernel ID from the kernel.release file. +# KERNEL_ID ?= \ - $(shell grep -h '\#define UTS_RELEASE' \ - $(KERNELDIR)/include/linux/* | cut -f3 -d' ' | sed s/\"//g) + $(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.release, it it exists, contains what UTS_RELEASE would have -# been set to. -# KERNEL_ID := \ - $(shell cat $(KERNELDIR)/include/config/kernel.release 2>/dev/null) + $(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/eurasiacon/build/linux2/moduledefs.mk b/eurasiacon/build/linux2/moduledefs.mk index 2569099..869026f 100644 --- a/eurasiacon/build/linux2/moduledefs.mk +++ b/eurasiacon/build/linux2/moduledefs.mk @@ -1,27 +1,42 @@ -# -# Copyright (C) Imagination Technologies Ltd. All rights reserved. +########################################################################### ### +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 # -# This program is free software; you can redistribute it and/or modify it -# under the terms and conditions of the GNU General Public License, -# version 2, as published by the Free Software Foundation. +# The contents of this file are subject to the MIT license as set out below. # -# This program is distributed in the hope it will be useful but, except -# as otherwise stated in writing, 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. +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: # -# 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., -# 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. # -# The full GNU General Public License is included in this distribution in -# the file called "COPYING". -# -# Contact Information: -# Imagination Technologies Ltd. -# Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. # -# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION 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_TARGETS := MODULE_CFLAGS := $(ALL_CFLAGS) $($(THIS_MODULE)_cflags) diff --git a/eurasiacon/build/linux2/modules.mk b/eurasiacon/build/linux2/modules.mk index 9bc52a3..1576590 100644 --- a/eurasiacon/build/linux2/modules.mk +++ b/eurasiacon/build/linux2/modules.mk @@ -1,27 +1,43 @@ -# -# Copyright (C) Imagination Technologies Ltd. All rights reserved. +########################################################################### ### +#@Title Module processing +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 # -# This program is free software; you can redistribute it and/or modify it -# under the terms and conditions of the GNU General Public License, -# version 2, as published by the Free Software Foundation. +# The contents of this file are subject to the MIT license as set out below. # -# This program is distributed in the hope it will be useful but, except -# as otherwise stated in writing, 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. +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: # -# 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., -# 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. # -# The full GNU General Public License is included in this distribution in -# the file called "COPYING". -# -# Contact Information: -# Imagination Technologies Ltd. -# Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. # -# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION 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 diff --git a/eurasiacon/build/linux2/omap4430_linux/Makefile b/eurasiacon/build/linux2/omap4430_linux/Makefile index 0f3a35b..6d0e81a 100644 --- a/eurasiacon/build/linux2/omap4430_linux/Makefile +++ b/eurasiacon/build/linux2/omap4430_linux/Makefile @@ -1,27 +1,43 @@ -# -# Copyright (C) Imagination Technologies Ltd. All rights reserved. +########################################################################### ### +#@Title Root makefile for OMAP4430 Linux. Builds everything else. +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 # -# This program is free software; you can redistribute it and/or modify it -# under the terms and conditions of the GNU General Public License, -# version 2, as published by the Free Software Foundation. +# The contents of this file are subject to the MIT license as set out below. # -# This program is distributed in the hope it will be useful but, except -# as otherwise stated in writing, 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. +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: # -# 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., -# 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. # -# The full GNU General Public License is included in this distribution in -# the file called "COPYING". -# -# Contact Information: -# Imagination Technologies Ltd. -# Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. # -# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### ########################################################################### PVR_SYSTEM := omap4 @@ -29,10 +45,6 @@ KERNEL_COMPONENTS := srvkm bufferclass_example include ../kernel_version.mk -OMAP_KERNEL_AT_LEAST_2_6_35 := $(shell test $(KERNEL_VERSION) -ge 2 -a \ - $(KERNEL_PATCHLEVEL) -ge 6 -a \ - $(KERNEL_SUBLEVEL) -ge 35 && echo 1 || echo 0) - # Only enable active power management if passive power management is # enabled, as indicated by LDM_PLATFORM being set to 1. On OMAP, # the system can suspend in the case where active power management is @@ -66,8 +78,6 @@ ifeq ($(SUPPORT_OMAP4430_NEON),1) SYS_CFLAGS += -ftree-vectorize -mfpu=neon -mfloat-abi=softfp endif -PVR_NO_FULL_CACHE_OPS := 1 - LIBGCC := $(shell $(CROSS_COMPILE)gcc -print-libgcc-file-name) SGXCORE := 540 @@ -82,9 +92,31 @@ else OPK_DEFAULT := libpvrPVR2D_FLIPWSEGL.so endif -ifeq ($(OMAP_KERNEL_AT_LEAST_2_6_35),1) +ifeq ($(call kernel-version-at-least,2,6,35),true) +# Work around flipping problems seen with the Taal LCDs on Blaze. +# The work around is safe to use with other types of screen on Blaze +# (e.g. HDMI) and on other platforms (e.g. Panda board). +PVR_OMAPLFB_DONT_USE_FB_PAN_DISPLAY := 1 ifeq ($(LDM_PLATFORM),1) PVR_LDM_PLATFORM_PRE_REGISTERED := 1 +ifeq ($(call kernel-version-at-least,2,6,35,7),true) +# Not all variants of the OMAP4 kernel have a DRM based framebuffer. +# Note that a non-X.Org version of the driver does not have to be built +# with DRM support if the kernel has a DRM based framebuffer. +PVR_OMAPLFB_DRM_FB ?= 1 +ifeq ($(PVR_OMAPLFB_DRM_FB),1) +PVR_LDM_PLATFORM_PRE_REGISTERED_DEV := "\"pvrsrvkm_pvr\"" +# There is already a "pvrsrvkm" driver (part of the DRM framebuffer code), +# so use the pre-registered device name instead. +PVR_LDM_DRIVER_REGISTRATION_NAME := "\"pvrsrvkm_pvr"\" +# The DRM library will not load the Services module on behalf of the X Server, +# as a DRM module has already been loaded (the DRM based framebuffer), so +# load the Services module before starting the X Server. +XORG_EXPLICIT_PVR_SERVICES_LOAD := 1 +else +PVR_LDM_PLATFORM_PRE_REGISTERED_DEV := "\"pvrsrvkm\"" +endif +endif endif endif @@ -93,14 +125,29 @@ ifeq ($(want_xorg),1) SUPPORT_DRI_DRM := 1 -ifeq ($(OMAP_KERNEL_AT_LEAST_2_6_35),1) +ifeq ($(call kernel-version-at-least,2,6,35),true) PVR_DRI_DRM_PLATFORM_DEV := 1 PVR_DRI_DRM_STATIC_BUS_ID := 1 +ifeq ($(call kernel-version-at-least,2,6,35,7),true) +ifeq ($(PVR_OMAPLFB_DRM_FB),1) +SUPPORT_DRI_DRM_PLUGIN := 1 +endif +ifeq ($(call kernel-version-at-least,2,6,36),true) +PVR_DRI_DRM_DEV_BUS_ID := "\"platform:pvrsrvkm"\" +else +PVR_DRI_DRM_DEV_BUS_ID := "\"platform:pvrsrvkm:00"\" +endif +# A client DRI authorisation failure, whilst switched away from the X Server +# VT, prevents all other attempts at DRI authorisation, even after +# switching back to the X server VT, so don't perform a DRM drop master +# call. +PVR_XORG_DONT_DROP_MASTER_IN_LEAVE_VT := 1 +endif else PVR_DRI_DRM_NOT_PCI := 1 endif -XORG_TOOLCHAIN := tarballs-omap4-ubuntu-10.10-cross +XORG_TOOLCHAIN ?= tarballs-omap4-ubuntu-10.10-cross XORG_PVR_CONF := omap4 XORG_PVR_VIDEO := omap4 diff --git a/eurasiacon/build/linux2/prepare_tree.mk b/eurasiacon/build/linux2/prepare_tree.mk index e1e18da..05e4fe3 100644 --- a/eurasiacon/build/linux2/prepare_tree.mk +++ b/eurasiacon/build/linux2/prepare_tree.mk @@ -1,29 +1,42 @@ -# -# Copyright (C) Imagination Technologies Ltd. All rights reserved. +########################################################################### ### +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 # -# This program is free software; you can redistribute it and/or modify it -# under the terms and conditions of the GNU General Public License, -# version 2, as published by the Free Software Foundation. +# The contents of this file are subject to the MIT license as set out below. # -# This program is distributed in the hope it will be useful but, except -# as otherwise stated in writing, 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. +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: # -# 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., -# 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. # -# The full GNU General Public License is included in this distribution in -# the file called "COPYING". -# -# Contact Information: -# Imagination Technologies Ltd. -# Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. # -# - --include $(OUT)/config.mk.new +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION 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 diff --git a/eurasiacon/build/linux2/this_makefile.mk b/eurasiacon/build/linux2/this_makefile.mk index 2410804..c312001 100644 --- a/eurasiacon/build/linux2/this_makefile.mk +++ b/eurasiacon/build/linux2/this_makefile.mk @@ -1,27 +1,42 @@ -# -# Copyright (C) Imagination Technologies Ltd. All rights reserved. +########################################################################### ### +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 # -# This program is free software; you can redistribute it and/or modify it -# under the terms and conditions of the GNU General Public License, -# version 2, as published by the Free Software Foundation. +# The contents of this file are subject to the MIT license as set out below. # -# This program is distributed in the hope it will be useful but, except -# as otherwise stated in writing, 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. +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: # -# 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., -# 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. # -# The full GNU General Public License is included in this distribution in -# the file called "COPYING". -# -# Contact Information: -# Imagination Technologies Ltd. -# Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. # -# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION 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 diff --git a/eurasiacon/build/linux2/tools/cc-check.sh b/eurasiacon/build/linux2/tools/cc-check.sh index 7d6d75c..6cef8fa 100644 --- a/eurasiacon/build/linux2/tools/cc-check.sh +++ b/eurasiacon/build/linux2/tools/cc-check.sh @@ -1,34 +1,62 @@ -# -# Copyright (C) Imagination Technologies Ltd. All rights reserved. +#!/bin/sh +########################################################################### ### +#@Title Test the nature of the C compiler. +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 # -# This program is free software; you can redistribute it and/or modify it -# under the terms and conditions of the GNU General Public License, -# version 2, as published by the Free Software Foundation. +# The contents of this file are subject to the MIT license as set out below. # -# This program is distributed in the hope it will be useful but, except -# as otherwise stated in writing, 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. +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: # -# 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., -# 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. # -# The full GNU General Public License is included in this distribution in -# the file called "COPYING". -# -# Contact Information: -# Imagination Technologies Ltd. -# Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. +# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". # +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION 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] --cc CC --out OUT [cflag]" exit 1 } +# NOTE: The program passed to the compiler is deliberately incorrect +# (`return;' should be `return 0;') but we do this to emit a warning. +# +# Emitting a warning is necessary to get GCC to print out additional +# warnings about any unsupported -Wno options, so we can handle these +# as unsupported by the build. +# do_cc() { - echo "int main(void){return 0;}" | $CC $1 -xc -c - -o $ccof 2>/dev/null + echo "int main(void){return;}" | $CC -W -Wall $3 -xc -c - -o $1 >$2 2>&1 } while [ 1 ]; do @@ -51,16 +79,21 @@ done [ "x$CC" = "x" ] && usage [ "x$OUT" = "x" ] && usage ccof=$OUT/cc-sanity-check +log=${ccof}.log if [ "x$BIT_CHECK" = "x1" ]; then - do_cc "" - file $ccof | grep -q 64-bit + do_cc $ccof $log "" + file $ccof | grep 64-bit >/dev/null 2>&1 [ "$?" = "0" ] && echo true || echo false else [ "x$1" = "x" ] && usage - do_cc $1 - [ "$?" = "0" ] && echo $1 + do_cc $ccof $log $1 + if [ "$?" = "0" ]; then + # compile passed, but was the warning unrecognized? + grep -q "^cc1: warning: unrecognized command line option \"$1\"" $log + [ "$?" = "1" ] && echo $1 + fi fi -rm -f $ccof +rm -f $ccof $log exit 0 diff --git a/eurasiacon/build/linux2/toplevel.mk b/eurasiacon/build/linux2/toplevel.mk index 79f906c..26b1198 100644 --- a/eurasiacon/build/linux2/toplevel.mk +++ b/eurasiacon/build/linux2/toplevel.mk @@ -1,33 +1,47 @@ -# -# Copyright (C) Imagination Technologies Ltd. All rights reserved. +########################################################################### ### +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 # -# This program is free software; you can redistribute it and/or modify it -# under the terms and conditions of the GNU General Public License, -# version 2, as published by the Free Software Foundation. +# The contents of this file are subject to the MIT license as set out below. # -# This program is distributed in the hope it will be useful but, except -# as otherwise stated in writing, 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. +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: # -# 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., -# 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. # -# The full GNU General Public License is included in this distribution in -# the file called "COPYING". -# -# Contact Information: -# Imagination Technologies Ltd. -# Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. # -# - +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION 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 Makefile.config, which must match this one .PHONY: build -build: components kbuild scripts +build: components kbuild ifeq ($(OUT),) $(error "Must specify output directory with OUT=") @@ -53,6 +67,14 @@ CONFIG_KERNEL_H := $(RELATIVE_OUT)/config_kernel.h MAKE_TOP := eurasiacon/build/linux2 THIS_MAKEFILE := (top-level makefiles) +# 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)) + include $(MAKE_TOP)/defs.mk ifneq ($(INTERNAL_CLOBBER_ONLY),true) @@ -68,15 +90,33 @@ $(HOST_OUT) $(TARGET_OUT): # If these generated files differ from any pre-existing ones, # replace them, causing affected parts of the driver to rebuild. # -$(shell \ +_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 -q $$file $$file.new >/dev/null 2>/dev/null \ + diff -U 0 $$file $$file.new \ + >>$(if $(_want_config_diff),$(OUT)/config.diff,/dev/null) 2>/dev/null \ && rm -f $$file.new \ - || mv -f $$file.new $$file >/dev/null 2>/dev/null; \ + || 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) @@ -84,7 +124,7 @@ 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))) +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) @@ -96,12 +136,15 @@ else # clobber-only ALL_MAKEFILES := endif +unexport ALL_MAKEFILES + REMAINING_MAKEFILES := $(ALL_MAKEFILES) ALL_MODULES := INTERNAL_INCLUDED_ALL_MAKEFILES := ifneq ($(INTERNAL_CLOBBER_ONLY),true) --include $(CONFIG_MK) +# Please do not change the format of the following lines +-include $(CONFIG_KERNEL_MK) # These files may not exist in GPL km source packages -include $(MAKE_TOP)/xorgconf.mk -include $(MAKE_TOP)/llvm.mk @@ -127,8 +170,8 @@ endif # each module: for each module in $(ALL_MODULES), set per-makefile variables $(foreach _m,$(ALL_MODULES),$(eval $(call process-module,$(_m)))) -.PHONY: kbuild scripts install -kbuild scripts install: +.PHONY: kbuild install +kbuild install: ifneq ($(INTERNAL_CLOBBER_ONLY),true) -include $(MAKE_TOP)/scripts.mk @@ -157,34 +200,11 @@ endif # 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. 'make scripts' generates the -# install.sh and rc.pvr scripts. -.PHONY: all_modules components scripts +# makefiles) as components of the build. +.PHONY: all_modules components all_modules: $(ALL_MODULES) components: $(COMPONENTS) -# 'make opk' builds the OEM Porting Kit. The build should set OPK_COMPONENTS -# in components.mk if it should be possible to build the OPK for it -.PHONY: opk -ifneq ($(strip $(OPK_COMPONENTS)),) -opk: $(OPK_COMPONENTS) - -opk_clobber: MODULE_DIRS_TO_REMOVE := $(addprefix $(OUT)/target/intermediates/,$(OPK_COMPONENTS)) -opk_clobber: OPK_OUTFILES := $(addprefix $(RELATIVE_OUT)/target/,$(foreach _c,$(OPK_COMPONENTS),$(if $($(_c)_target),$($(_c)_target),$(error Module $(_c) must be a shared library which sets $$($(_c)_target) for OPK clobbering)))) -opk_clobber: - $(clean-dirs) - $(if $(V),,@echo " RM " $(call relative-to-top,$(OPK_OUTFILES))) - $(RM) -f $(OPK_OUTFILES) -else -# OPK_COMPONENTS is empty or unset -opk: - @echo - @echo "** This build ($(PVR_BUILD_DIR)) is unable to build the OPK, because" - @echo "** OPK_COMPONENTS is empty or unset. Cannot continue." - @echo - @false -endif - # Cleaning .PHONY: clean clobber clean: MODULE_DIRS_TO_REMOVE := $(OUT)/host/intermediates $(OUT)/target/intermediates $(OUT)/target/kbuild diff --git a/include4/dbgdrvif.h b/include4/dbgdrvif.h index b7614ac..753f8f2 100644 --- a/include4/dbgdrvif.h +++ b/include4/dbgdrvif.h @@ -1,28 +1,44 @@ -/********************************************************************** - * - * Copyright (C) Imagination Technologies Ltd. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful but, except - * as otherwise stated in writing, 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., - * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * - * The full GNU General Public License is included in this distribution in - * the file called "COPYING". - * - * Contact Information: - * Imagination Technologies Ltd. - * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK - * - ******************************************************************************/ +/*************************************************************************/ /*! +@Title Debug driver +@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_ #define _DBGDRVIF_ @@ -43,6 +59,9 @@ #endif +/***************************************************************************** + Stream mode stuff. +*****************************************************************************/ #define DEBUG_CAPMODE_FRAMED 0x00000001UL #define DEBUG_CAPMODE_CONTINUOUS 0x00000002UL #define DEBUG_CAPMODE_HOTKEY 0x00000004UL @@ -61,6 +80,10 @@ #define DEBUG_FLAGS_TEXTSTREAM 0x80000000UL +/***************************************************************************** + Debug level control. Only bothered with the first 12 levels, I suspect you + get the idea... +*****************************************************************************/ #define DEBUG_LEVEL_0 0x00000001UL #define DEBUG_LEVEL_1 0x00000003UL #define DEBUG_LEVEL_2 0x00000007UL @@ -87,6 +110,9 @@ #define DEBUG_LEVEL_SEL10 0x00000400UL #define DEBUG_LEVEL_SEL11 0x00000800UL +/***************************************************************************** + IOCTL values. +*****************************************************************************/ #define DEBUG_SERVICE_IOCTL_BASE 0x800UL #define DEBUG_SERVICE_CREATESTREAM CTL_CODE(FILE_DEVICE_UNKNOWN, DEBUG_SERVICE_IOCTL_BASE + 0x01, METHOD_BUFFERED, FILE_ANY_ACCESS) #define DEBUG_SERVICE_DESTROYSTREAM CTL_CODE(FILE_DEVICE_UNKNOWN, DEBUG_SERVICE_IOCTL_BASE + 0x02, METHOD_BUFFERED, FILE_ANY_ACCESS) @@ -121,6 +147,9 @@ typedef enum _DBG_EVENT_ } DBG_EVENT; +/***************************************************************************** + In/Out Structures +*****************************************************************************/ typedef struct _DBG_IN_CREATESTREAM_ { union @@ -247,23 +276,33 @@ typedef struct _DBG_IN_WRITE_LF_ IMG_UINT32 ui32BufferSize; } DBG_IN_WRITE_LF, *PDBG_IN_WRITE_LF; +/* + Flags for above struct +*/ #define WRITELF_FLAGS_RESETBUF 0x00000001UL +/* + Common control structure (don't duplicate control in main stream + and init phase stream). +*/ typedef struct _DBG_STREAM_CONTROL_ { - IMG_BOOL bInitPhaseComplete; - IMG_UINT32 ui32Flags; + IMG_BOOL bInitPhaseComplete; /*!< init phase has finished */ + IMG_UINT32 ui32Flags; /*!< flags (see DEBUG_FLAGS above) */ - IMG_UINT32 ui32CapMode; - IMG_UINT32 ui32OutMode; + IMG_UINT32 ui32CapMode; /*!< capturing mode framed/hot key */ + IMG_UINT32 ui32OutMode; /*!< output mode, e.g. files */ IMG_UINT32 ui32DebugLevel; IMG_UINT32 ui32DefaultMode; - IMG_UINT32 ui32Start; - IMG_UINT32 ui32End; - IMG_UINT32 ui32Current; - IMG_UINT32 ui32SampleRate; + IMG_UINT32 ui32Start; /*!< first capture frame */ + IMG_UINT32 ui32End; /*!< last frame */ + IMG_UINT32 ui32Current; /*!< current frame */ + IMG_UINT32 ui32SampleRate; /*!< capture frequency */ IMG_UINT32 ui32Reserved; } DBG_STREAM_CONTROL, *PDBG_STREAM_CONTROL; +/* + Per-buffer control structure. +*/ typedef struct _DBG_STREAM_ { struct _DBG_STREAM_ *psNext; @@ -275,20 +314,24 @@ typedef struct _DBG_STREAM_ IMG_UINT32 ui32RPtr; IMG_UINT32 ui32WPtr; IMG_UINT32 ui32DataWritten; - IMG_UINT32 ui32Marker; - IMG_UINT32 ui32InitPhaseWOff; - - - - - IMG_CHAR szName[30]; + IMG_UINT32 ui32Marker; /*!< marker for file splitting */ + IMG_UINT32 ui32InitPhaseWOff; /*!< snapshot offset for init phase end for follow-on pdump */ + IMG_CHAR szName[30]; /* Give this a size, some compilers don't like [] */ } DBG_STREAM,*PDBG_STREAM; +/* + * Allows dbgdrv to notify services when events happen, e.g. pdump.exe starts. + * (better than resetting psDevInfo->psKernelCCBInfo->ui32CCBDumpWOff = 0 + * in SGXGetClientInfoKM.) + */ typedef struct _DBGKM_CONNECT_NOTIFIER_ { IMG_VOID (IMG_CALLCONV *pfnConnectNotifier) (IMG_VOID); } DBGKM_CONNECT_NOTIFIER, *PDBGKM_CONNECT_NOTIFIER; +/***************************************************************************** + Kernel mode service table +*****************************************************************************/ typedef struct _DBGKM_SERVICE_TABLE_ { IMG_UINT32 ui32Size; @@ -324,5 +367,15 @@ typedef struct _DBGKM_SERVICE_TABLE_ IMG_UINT32 (IMG_CALLCONV *pfnWritePersist) (PDBG_STREAM psStream,IMG_UINT8 *pui8InBuf,IMG_UINT32 ui32InBuffSize,IMG_UINT32 ui32Level); } DBGKM_SERVICE_TABLE, *PDBGKM_SERVICE_TABLE; +#if defined(__linux__) +/***************************************************************************** + Function to export service table from debug driver to the PDUMP component. +*****************************************************************************/ +IMG_VOID DBGDrvGetServiceTable(DBGKM_SERVICE_TABLE **fn_table); +#endif + #endif +/***************************************************************************** + End of file (DBGDRVIF.H) +*****************************************************************************/ diff --git a/include4/img_defs.h b/include4/img_defs.h index 79a730f..375ed99 100644 --- a/include4/img_defs.h +++ b/include4/img_defs.h @@ -1,29 +1,45 @@ -/********************************************************************** - * - * Copyright (C) Imagination Technologies Ltd. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful but, except - * as otherwise stated in writing, 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., - * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * - * The full GNU General Public License is included in this distribution in - * the file called "COPYING". - * - * Contact Information: - * Imagination Technologies Ltd. - * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK - * - ******************************************************************************/ - +/*************************************************************************/ /*! +@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__ @@ -57,24 +73,33 @@ typedef enum img_tag_TriStateSwitch #endif +/* Use this in any file, or use attributes under GCC - see below */ #ifndef PVR_UNREFERENCED_PARAMETER #define PVR_UNREFERENCED_PARAMETER(param) (param) = (param) #endif +/* 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 +/* + Wide character definitions +*/ #ifndef _TCHAR_DEFINED #if defined(UNICODE) typedef unsigned short TCHAR, *PTCHAR, *PTSTR; -#else +#else /* #if defined(UNICODE) */ typedef char TCHAR, *PTCHAR, *PTSTR; -#endif +#endif /* #if defined(UNICODE) */ #define _TCHAR_DEFINED -#endif +#endif /* #ifndef _TCHAR_DEFINED */ #if defined(__linux__) || defined(__QNXNTO__) || defined(__METAG) @@ -89,6 +114,7 @@ typedef char TCHAR, *PTCHAR, *PTSTR; #error("define an OS") #endif +// Use default definition if not overridden #ifndef IMG_ABORT #define IMG_ABORT() abort() #endif @@ -109,6 +135,9 @@ typedef char TCHAR, *PTCHAR, *PTSTR; #define IMG_FORMAT_PRINTF(x,y) #endif +/* + * Cleanup request defines + */ #define CLEANUP_WITH_POLL IMG_FALSE #define FORCE_CLEANUP IMG_TRUE @@ -118,4 +147,7 @@ typedef char TCHAR, *PTCHAR, *PTSTR; #define IMG_UNDEF (~0UL) #endif -#endif +#endif /* #if !defined (__IMG_DEFS_H__) */ +/***************************************************************************** + End of file (IMG_DEFS.H) +*****************************************************************************/ diff --git a/include4/img_types.h b/include4/img_types.h index 2431786..7f5137e 100644 --- a/include4/img_types.h +++ b/include4/img_types.h @@ -1,36 +1,54 @@ -/********************************************************************** - * - * Copyright (C) Imagination Technologies Ltd. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful but, except - * as otherwise stated in writing, 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., - * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * - * The full GNU General Public License is included in this distribution in - * the file called "COPYING". - * - * Contact Information: - * Imagination Technologies Ltd. - * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK - * - ******************************************************************************/ - +/*************************************************************************/ /*! +@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__ +/* 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 +/* Physical address space defaults to 32bits */ #if !defined(IMG_ADDRSPACE_PHYSADDR_BITS) #define IMG_ADDRSPACE_PHYSADDR_BITS 32 #endif @@ -56,13 +74,13 @@ typedef signed long IMG_INT32, *IMG_PINT32; #define IMG_UINT32_MAX 0xFFFFFFFFUL #endif -#if defined(USE_CODE) +#if defined(USE_CODE) typedef unsigned __int64 IMG_UINT64, *IMG_PUINT64; typedef __int64 IMG_INT64, *IMG_PINT64; #else - #if ((defined(LINUX) || defined(__METAG)) || defined(__QNXNTO__)) + #if defined(LINUX) || defined(__METAG) || defined (__QNXNTO__) typedef unsigned long long IMG_UINT64, *IMG_PUINT64; typedef long long IMG_INT64, *IMG_PINT64; #else @@ -71,6 +89,7 @@ typedef __int64 IMG_INT64, *IMG_PINT64; #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; #endif @@ -101,21 +120,59 @@ typedef void** IMG_HVOID, * IMG_PHVOID; #define IMG_NULL 0 +/* services/stream ID */ typedef IMG_UINT32 IMG_SID; typedef IMG_UINT32 IMG_EVENTSID; -#if defined(SUPPORT_SID_INTERFACE) - typedef IMG_SID IMG_S_HANDLE; -#else - typedef IMG_HANDLE IMG_S_HANDLE; -#endif +/* + * 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 { - + /* device virtual addresses are 32bit for now */ IMG_UINT32 uiAddr; #define IMG_CAST_TO_DEVVADDR_UINT(var) (IMG_UINT32)(var) @@ -123,16 +180,18 @@ typedef struct _IMG_DEV_VIRTADDR typedef IMG_UINT32 IMG_DEVMEM_SIZE_T; +/* cpu physical address */ typedef struct _IMG_CPU_PHYADDR { - + /* variable sized type (32,64) */ IMG_UINTPTR_T uiAddr; } IMG_CPU_PHYADDR; +/* device physical address */ typedef struct _IMG_DEV_PHYADDR { #if IMG_ADDRSPACE_PHYSADDR_BITS == 32 - + /* variable sized type (32,64) */ IMG_UINTPTR_T uiAddr; #else IMG_UINT32 uiAddr; @@ -140,12 +199,16 @@ typedef struct _IMG_DEV_PHYADDR #endif } IMG_DEV_PHYADDR; +/* system physical address */ typedef struct _IMG_SYS_PHYADDR { - + /* variable sized type (32,64) */ IMG_UINTPTR_T uiAddr; } IMG_SYS_PHYADDR; #include "img_defs.h" -#endif +#endif /* __IMG_TYPES_H__ */ +/****************************************************************************** + End of file (img_types.h) +******************************************************************************/ diff --git a/include4/pdumpdefs.h b/include4/pdumpdefs.h index 193b464..112e9ee 100644 --- a/include4/pdumpdefs.h +++ b/include4/pdumpdefs.h @@ -1,29 +1,44 @@ -/********************************************************************** - * - * Copyright (C) Imagination Technologies Ltd. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful but, except - * as otherwise stated in writing, 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., - * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * - * The full GNU General Public License is included in this distribution in - * the file called "COPYING". - * - * Contact Information: - * Imagination Technologies Ltd. - * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK - * - ******************************************************************************/ +/*************************************************************************/ /*! +@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__ @@ -104,5 +119,8 @@ typedef enum _PDUMP_POLL_OPERATOR } PDUMP_POLL_OPERATOR; -#endif +#endif /* __PDUMPDEFS_H__ */ +/***************************************************************************** + End of file (pdumpdefs.h) +*****************************************************************************/ diff --git a/include4/pvr_debug.h b/include4/pvr_debug.h index a9d082e..7e05666 100644 --- a/include4/pvr_debug.h +++ b/include4/pvr_debug.h @@ -1,29 +1,44 @@ -/********************************************************************** - * - * Copyright (C) Imagination Technologies Ltd. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful but, except - * as otherwise stated in writing, 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., - * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * - * The full GNU General Public License is included in this distribution in - * the file called "COPYING". - * - * Contact Information: - * Imagination Technologies Ltd. - * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK - * -******************************************************************************/ - +/*************************************************************************/ /*! +@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__ @@ -38,32 +53,16 @@ extern "C" { #define PVR_MAX_DEBUG_MESSAGE_LEN (512) /* These are privately used by pvr_debug, use the PVR_DBG_ defines instead */ -#define DBGPRIV_FATAL 0x01UL -#define DBGPRIV_ERROR 0x02UL -#define DBGPRIV_WARNING 0x04UL -#define DBGPRIV_MESSAGE 0x08UL -#define DBGPRIV_VERBOSE 0x10UL -#define DBGPRIV_CALLTRACE 0x20UL -#define DBGPRIV_ALLOC 0x40UL - -#define DBGPRIV_DBGDRV_MESSAGE 0x1000UL - -#define DBGPRIV_ALLLEVELS (DBGPRIV_FATAL | DBGPRIV_ERROR | DBGPRIV_WARNING | DBGPRIV_MESSAGE | DBGPRIV_VERBOSE) - +#define DBGPRIV_FATAL 0x01UL +#define DBGPRIV_ERROR 0x02UL +#define DBGPRIV_WARNING 0x04UL +#define DBGPRIV_MESSAGE 0x08UL +#define DBGPRIV_VERBOSE 0x10UL +#define DBGPRIV_CALLTRACE 0x20UL +#define DBGPRIV_ALLOC 0x40UL +#define DBGPRIV_DBGDRV_MESSAGE 0x80UL - -#define PVR_DBG_FATAL DBGPRIV_FATAL,__FILE__, __LINE__ -#define PVR_DBG_ERROR DBGPRIV_ERROR,__FILE__, __LINE__ -#define PVR_DBG_WARNING DBGPRIV_WARNING,__FILE__, __LINE__ -#define PVR_DBG_MESSAGE DBGPRIV_MESSAGE,__FILE__, __LINE__ -#define PVR_DBG_VERBOSE DBGPRIV_VERBOSE,__FILE__, __LINE__ -#define PVR_DBG_CALLTRACE DBGPRIV_CALLTRACE,__FILE__, __LINE__ -#define PVR_DBG_ALLOC DBGPRIV_ALLOC,__FILE__, __LINE__ - -/* - * Debug driver debugging - */ -#define PVR_DBGDRIV_MESSAGE DBGPRIV_DBGDRV_MESSAGE, "", 0 +#define DBGPRIV_DBGLEVEL_COUNT 8 #if !defined(PVRSRV_NEED_PVR_ASSERT) && defined(DEBUG) #define PVRSRV_NEED_PVR_ASSERT @@ -77,20 +76,49 @@ extern "C" { #define PVRSRV_NEED_PVR_TRACE #endif - /* PVR_ASSERT() and PVR_DBG_BREAK handling */ #if defined(PVRSRV_NEED_PVR_ASSERT) - #define PVR_ASSERT(EXPR) if (!(EXPR)) PVRSRVDebugAssertFail(__FILE__, __LINE__); +#if defined(LINUX) && defined(__KERNEL__) +/* 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); - #if defined(PVR_DBG_BREAK_ASSERT_FAIL) - #define PVR_DBG_BREAK PVRSRVDebugAssertFail("PVR_DBG_BREAK", 0) +#if defined(LINUX) + #define PVR_ASSERT(EXPR) do \ + { \ + if (!(EXPR)) \ + PVRSRVDebugAssertFail(__FILE__, __LINE__); \ + } while (0) +#else + #if defined (__QNXNTO__) + #define PVR_ASSERT(EXPR) if (!(EXPR)) PVRSRVDebugAssertFail(__FILE__, __LINE__); + #else + #define PVR_ASSERT(EXPR) if (!(EXPR)) PVRSRVDebugAssertFail(__FILE__, __LINE__) + #endif +#endif + +#endif /* defined(LINUX) && defined(__KERNEL__) */ + + + #if defined(LINUX) && defined(__KERNEL__) + #define PVR_DBG_BREAK BUG() #else - #define PVR_DBG_BREAK + #define PVR_DBG_BREAK PVRSRVDebugAssertFail(__FILE__, __LINE__) #endif #else /* defined(PVRSRV_NEED_PVR_ASSERT) */ @@ -105,7 +133,66 @@ IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVDebugAssertFail(const IMG_CHAR *pszFile, #if defined(PVRSRV_NEED_PVR_DPF) - #define PVR_DPF(X) PVRSRVDebugPrintf X +#if defined(PVRSRV_NEW_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_DBGDRIV_MESSAGE DBGPRIV_DBGDRV_MESSAGE + + /* These levels are always on with PVRSRV_NEED_PVR_DPF */ + #define __PVR_DPF_0x01UL(x...) PVRSRVDebugPrintf(DBGPRIV_FATAL, x) + #define __PVR_DPF_0x02UL(x...) PVRSRVDebugPrintf(DBGPRIV_ERROR, x) + + /* Some are compiled out completely in release builds */ +#if defined(DEBUG) + #define __PVR_DPF_0x04UL(x...) PVRSRVDebugPrintf(DBGPRIV_WARNING, x) + #define __PVR_DPF_0x08UL(x...) PVRSRVDebugPrintf(DBGPRIV_MESSAGE, x) + #define __PVR_DPF_0x10UL(x...) PVRSRVDebugPrintf(DBGPRIV_VERBOSE, x) + #define __PVR_DPF_0x20UL(x...) PVRSRVDebugPrintf(DBGPRIV_CALLTRACE, x) + #define __PVR_DPF_0x40UL(x...) PVRSRVDebugPrintf(DBGPRIV_ALLOC, x) + #define __PVR_DPF_0x80UL(x...) PVRSRVDebugPrintf(DBGPRIV_DBGDRV_MESSAGE, x) +#else + #define __PVR_DPF_0x04UL(x...) + #define __PVR_DPF_0x08UL(x...) + #define __PVR_DPF_0x10UL(x...) + #define __PVR_DPF_0x20UL(x...) + #define __PVR_DPF_0x40UL(x...) + #define __PVR_DPF_0x80UL(x...) +#endif + + /* Translate the different log levels to separate macros + * so they can each be compiled out. + */ +#if defined(DEBUG) + #define __PVR_DPF(lvl, x...) __PVR_DPF_ ## lvl (__FILE__, __LINE__, x) +#else + #define __PVR_DPF(lvl, x...) __PVR_DPF_ ## lvl ("", 0, x) +#endif + + /* Get rid of the double bracketing */ + #define PVR_DPF(x) __PVR_DPF x + +#else /* defined(PVRSRV_NEW_PVR_DPF) */ + + /* Old logging mechanism */ + #define PVR_DBG_FATAL DBGPRIV_FATAL,__FILE__, __LINE__ + #define PVR_DBG_ERROR DBGPRIV_ERROR,__FILE__, __LINE__ + #define PVR_DBG_WARNING DBGPRIV_WARNING,__FILE__, __LINE__ + #define PVR_DBG_MESSAGE DBGPRIV_MESSAGE,__FILE__, __LINE__ + #define PVR_DBG_VERBOSE DBGPRIV_VERBOSE,__FILE__, __LINE__ + #define PVR_DBG_CALLTRACE DBGPRIV_CALLTRACE,__FILE__, __LINE__ + #define PVR_DBG_ALLOC DBGPRIV_ALLOC,__FILE__, __LINE__ + #define PVR_DBGDRIV_MESSAGE DBGPRIV_DBGDRV_MESSAGE, "", 0 + + #define PVR_DPF(X) PVRSRVDebugPrintf X + +#endif /* defined(PVRSRV_NEW_PVR_DPF) */ IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVDebugPrintf(IMG_UINT32 ui32DebugLevel, const IMG_CHAR *pszFileName, diff --git a/include4/pvrmodule.h b/include4/pvrmodule.h index 3dd5845..267c7b6 100644 --- a/include4/pvrmodule.h +++ b/include4/pvrmodule.h @@ -1,31 +1,48 @@ -/********************************************************************** - * - * Copyright (C) Imagination Technologies Ltd. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful but, except - * as otherwise stated in writing, 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., - * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * - * The full GNU General Public License is included in this distribution in - * the file called "COPYING". - * - * Contact Information: - * Imagination Technologies Ltd. - * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK - * - ******************************************************************************/ +/*************************************************************************/ /*! +@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("GPL"); -#endif +MODULE_LICENSE("Dual MIT/GPL"); + +#endif /* _PVRMODULE_H_ */ diff --git a/include4/pvrversion.h b/include4/pvrversion.h index 5f78678..01212ad 100644 --- a/include4/pvrversion.h +++ b/include4/pvrversion.h @@ -1,38 +1,46 @@ -/********************************************************************** - * - * Copyright (C) Imagination Technologies Ltd. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful but, except - * as otherwise stated in writing, 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., - * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * - * The full GNU General Public License is included in this distribution in - * the file called "COPYING". - * - * Contact Information: - * Imagination Technologies Ltd. - * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK - * - ******************************************************************************/ - - - - - - - - - - +/*************************************************************************/ /*! +@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_ @@ -41,21 +49,21 @@ #define PVR_STR2(X) PVR_STR(X) #define PVRVERSION_MAJ 1 -#define PVRVERSION_MIN 7 -#define PVRVERSION_BRANCH 17 +#define PVRVERSION_MIN 9 +#define PVRVERSION_BRANCH 19 #define PVRVERSION_FAMILY "sgxddk" -#define PVRVERSION_BRANCHNAME "1.7" -#define PVRVERSION_BUILD 867897 -#define PVRVERSION_BSCONTROL "CustomerTI_OMAP4430_Linux_GPL" +#define PVRVERSION_BRANCHNAME "1.9.RC2" +#define PVRVERSION_BUILD 2139099 +#define PVRVERSION_BSCONTROL "SGX_DDK_Linux_CustomerTI" -#define PVRVERSION_STRING "CustomerTI_OMAP4430_Linux_GPL sgxddk 17 1.7@" PVR_STR2(PVRVERSION_BUILD) -#define PVRVERSION_STRING_SHORT "1.7@" PVR_STR2(PVRVERSION_BUILD) +#define PVRVERSION_STRING "SGX_DDK_Linux_CustomerTI sgxddk 19 1.9.RC2@" PVR_STR2(PVRVERSION_BUILD) +#define PVRVERSION_STRING_SHORT "1.9.RC2@" PVR_STR2(PVRVERSION_BUILD) #define COPYRIGHT_TXT "Copyright (c) Imagination Technologies Ltd. All Rights Reserved." -#define PVRVERSION_BUILD_HI 86 -#define PVRVERSION_BUILD_LO 7897 +#define PVRVERSION_BUILD_HI 213 +#define PVRVERSION_BUILD_LO 9099 #define PVRVERSION_STRING_NUMERIC PVR_STR2(PVRVERSION_MAJ) "." PVR_STR2(PVRVERSION_MIN) "." PVR_STR2(PVRVERSION_BUILD_HI) "." PVR_STR2(PVRVERSION_BUILD_LO) -#endif +#endif /* _PVRVERSION_H_ */ diff --git a/include4/services.h b/include4/services.h index cd672d1..a0b5986 100644 --- a/include4/services.h +++ b/include4/services.h @@ -1,28 +1,44 @@ -/********************************************************************** - * - * Copyright (C) Imagination Technologies Ltd. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful but, except - * as otherwise stated in writing, 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., - * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * - * The full GNU General Public License is included in this distribution in - * the file called "COPYING". - * - * Contact Information: - * Imagination Technologies Ltd. - * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK - * - ******************************************************************************/ +/*************************************************************************/ /*! +@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__ @@ -36,14 +52,33 @@ extern "C" { #include "pdumpdefs.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 -#define PVRSRV_MAX_CMD_SIZE 1024 +#define PVRSRV_MAX_CMD_SIZE 1024/*!< max size in bytes of a command */ -#define PVRSRV_MAX_DEVICES 16 +#define PVRSRV_MAX_DEVICES 16 /*!< Largest supported number of devices on the system */ #define EVENTOBJNAME_MAXLENGTH (50) +/* + Flags associated with memory allocation + (bits 0-11) +*/ #define PVRSRV_MEM_READ (1U<<0) #define PVRSRV_MEM_WRITE (1U<<1) #define PVRSRV_MEM_CACHE_CONSISTENT (1U<<2) @@ -58,6 +93,10 @@ extern "C" { #define PVRSRV_MEM_EXPORTED (1U<<11) +/* + Heap Attribute flags + (bits 12-23) +*/ #define PVRSRV_HAP_CACHED (1U<<12) #define PVRSRV_HAP_UNCACHED (1U<<13) #define PVRSRV_HAP_WRITECOMBINE (1U<<14) @@ -73,51 +112,113 @@ extern "C" { |PVRSRV_HAP_FROM_EXISTING_PROCESS \ |PVRSRV_HAP_NO_CPU_VIRTUAL) +/* + Allows user allocations to override heap attributes + (Bits shared with heap flags) +*/ #define PVRSRV_MEM_CACHED PVRSRV_HAP_CACHED #define PVRSRV_MEM_UNCACHED PVRSRV_HAP_UNCACHED #define PVRSRV_MEM_WRITECOMBINE PVRSRV_HAP_WRITECOMBINE +/* + Backing store flags (defined internally) + (bits 24-26) +*/ #define PVRSRV_MEM_BACKINGSTORE_FIELD_SHIFT (24) +/* + Per allocation/mapping flags + (bits 27-30) + */ #define PVRSRV_MAP_NOUSERVIRTUAL (1UL<<27) #define PVRSRV_MEM_XPROC (1U<<28) - -#define PVRSRV_NO_CONTEXT_LOSS 0 -#define PVRSRV_SEVERE_LOSS_OF_CONTEXT 1 -#define PVRSRV_PRE_STATE_CHANGE_MASK 0x80 - - -#define PVRSRV_DEFAULT_DEV_COOKIE (1) - - -#define PVRSRV_MISC_INFO_TIMER_PRESENT (1U<<0) -#define PVRSRV_MISC_INFO_CLOCKGATE_PRESENT (1U<<1) -#define PVRSRV_MISC_INFO_MEMSTATS_PRESENT (1U<<2) -#define PVRSRV_MISC_INFO_GLOBALEVENTOBJECT_PRESENT (1U<<3) -#define PVRSRV_MISC_INFO_DDKVERSION_PRESENT (1U<<4) -#define PVRSRV_MISC_INFO_CPUCACHEOP_PRESENT (1U<<5) -#define PVRSRV_MISC_INFO_FREEMEM_PRESENT (1U<<6) - -#define PVRSRV_MISC_INFO_RESET_PRESENT (1U<<31) - +#define PVRSRV_MEM_ION (1U<<29) +#define PVRSRV_MEM_ALLOCATENONCACHEDMEM (1UL<<30) + +/* + Internal allocation/mapping flags + (bit 31) +*/ +#define PVRSRV_MEM_SPARSE (1U<<31) + + +/* + * How much context we lose on a (power) mode change + */ +#define PVRSRV_NO_CONTEXT_LOSS 0 /*!< Do not lose state on power down */ +#define PVRSRV_SEVERE_LOSS_OF_CONTEXT 1 /*!< lose state on power down */ +#define PVRSRV_PRE_STATE_CHANGE_MASK 0x80 /*!< power state change mask */ + + +/* + * Device cookie defines + */ +#define PVRSRV_DEFAULT_DEV_COOKIE (1) /*!< default device cookie */ + + +/* + * Misc Info. present flags + */ +#define PVRSRV_MISC_INFO_TIMER_PRESENT (1U<<0) +#define PVRSRV_MISC_INFO_CLOCKGATE_PRESENT (1U<<1) +#define PVRSRV_MISC_INFO_MEMSTATS_PRESENT (1U<<2) +#define PVRSRV_MISC_INFO_GLOBALEVENTOBJECT_PRESENT (1U<<3) +#define PVRSRV_MISC_INFO_DDKVERSION_PRESENT (1U<<4) +#define PVRSRV_MISC_INFO_CPUCACHEOP_PRESENT (1U<<5) +#define PVRSRV_MISC_INFO_FREEMEM_PRESENT (1U<<6) +#define PVRSRV_MISC_INFO_GET_REF_COUNT_PRESENT (1U<<7) +#define PVRSRV_MISC_INFO_GET_PAGE_SIZE_PRESENT (1U<<8) +#define PVRSRV_MISC_INFO_FORCE_SWAP_TO_SYSTEM_PRESENT (1U<<9) + +#define PVRSRV_MISC_INFO_RESET_PRESENT (1U<<31) + +/* PDUMP defines */ #define PVRSRV_PDUMP_MAX_FILENAME_SIZE 20 #define PVRSRV_PDUMP_MAX_COMMENT_SIZE 200 +/* + Flags for PVRSRVChangeDeviceMemoryAttributes call. +*/ #define PVRSRV_CHANGEDEVMEM_ATTRIBS_CACHECOHERENT 0x00000001 +/* + Flags for PVRSRVMapExtMemory and PVRSRVUnmapExtMemory + ALTERNATEVA - Used when mapping multiple virtual addresses to the same physical address. Set this flag on extra maps. + PHYSCONTIG - Physical pages are contiguous (unused) +*/ #define PVRSRV_MAPEXTMEMORY_FLAGS_ALTERNATEVA 0x00000001 #define PVRSRV_MAPEXTMEMORY_FLAGS_PHYSCONTIG 0x00000002 +/* + Flags for PVRSRVModifySyncOps + WO_INC - Used to increment "WriteOpsPending/complete of sync info" + RO_INC - Used to increment "ReadOpsPending/complete of sync info" +*/ #define PVRSRV_MODIFYSYNCOPS_FLAGS_WO_INC 0x00000001 #define PVRSRV_MODIFYSYNCOPS_FLAGS_RO_INC 0x00000002 +/* + Flags for Services connection. + Allows to define per-client policy for Services +*/ #define SRV_FLAGS_PERSIST 0x1 #define SRV_FLAGS_PDUMP_ACTIVE 0x2 +/* + Pdump flags which are accessible to Services clients +*/ #define PVRSRV_PDUMP_FLAGS_CONTINUOUS 0x1 +/****************************************************************************** + * Enums + *****************************************************************************/ + +/*! + ****************************************************************************** + * List of known device types. + *****************************************************************************/ typedef enum _PVRSRV_DEVICE_TYPE_ { PVRSRV_DEVICE_TYPE_UNKNOWN = 0 , @@ -133,7 +234,7 @@ typedef enum _PVRSRV_DEVICE_TYPE_ PVRSRV_DEVICE_TYPE_VGX = 8, - + /* 3rd party devices take ext type */ PVRSRV_DEVICE_TYPE_EXT = 9, PVRSRV_DEVICE_TYPE_LAST = 9, @@ -146,8 +247,13 @@ typedef enum _PVRSRV_DEVICE_TYPE_ #define HEAP_IDX( _heap_id_ ) ( (_heap_id_)&((1<<24) - 1 ) ) #define HEAP_DEV( _heap_id_ ) ( (_heap_id_)>>24 ) +/* common undefined heap ID define */ #define PVRSRV_UNDEFINED_HEAP_ID (~0LU) +/*! + ****************************************************************************** + * User Module type + *****************************************************************************/ typedef enum { IMG_EGL = 0x00000001, @@ -175,6 +281,10 @@ typedef enum #define APPHINT_MAX_STRING_SIZE 256 +/*! + ****************************************************************************** + * IMG data types + *****************************************************************************/ typedef enum { IMG_STRING_TYPE = 1, @@ -185,145 +295,181 @@ typedef enum }IMG_DATA_TYPE; +/****************************************************************************** + * Structure definitions. + *****************************************************************************/ + +/*! + * Forward declaration + */ typedef struct _PVRSRV_DEV_DATA_ *PPVRSRV_DEV_DATA; +/*! + ****************************************************************************** + * Device identifier structure + *****************************************************************************/ typedef struct _PVRSRV_DEVICE_IDENTIFIER_ { - PVRSRV_DEVICE_TYPE eDeviceType; - PVRSRV_DEVICE_CLASS eDeviceClass; - IMG_UINT32 ui32DeviceIndex; - IMG_CHAR *pszPDumpDevName; - IMG_CHAR *pszPDumpRegName; + 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; +/****************************************************************************** + * Client dev info + ****************************************************************************** + */ typedef struct _PVRSRV_CLIENT_DEV_DATA_ { - IMG_UINT32 ui32NumDevices; - PVRSRV_DEVICE_IDENTIFIER asDevID[PVRSRV_MAX_DEVICES]; - PVRSRV_ERROR (*apfnDevConnect[PVRSRV_MAX_DEVICES])(PPVRSRV_DEV_DATA); - PVRSRV_ERROR (*apfnDumpTrace[PVRSRV_MAX_DEVICES])(PPVRSRV_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; +/*! + ****************************************************************************** + * Kernel Services connection structure + *****************************************************************************/ typedef struct _PVRSRV_CONNECTION_ { - IMG_HANDLE hServices; - IMG_UINT32 ui32ProcessID; - PVRSRV_CLIENT_DEV_DATA sClientDevData; - IMG_UINT32 ui32SrvFlags; + IMG_HANDLE hServices; /*!< UM IOCTL handle */ + IMG_UINT32 ui32ProcessID; /*!< Process ID for resource locking */ + PVRSRV_CLIENT_DEV_DATA sClientDevData; /*!< Client device data */ + IMG_UINT32 ui32SrvFlags; /*!< Per-client Services flags */ }PVRSRV_CONNECTION; +/*! + ****************************************************************************** + * This structure allows the user mode glue code to have an OS independent + * set of prototypes. + *****************************************************************************/ typedef struct _PVRSRV_DEV_DATA_ { - IMG_CONST PVRSRV_CONNECTION *psConnection; + IMG_CONST PVRSRV_CONNECTION *psConnection; /*!< Services connection info */ #if defined (SUPPORT_SID_INTERFACE) - IMG_SID hDevCookie; + IMG_SID hDevCookie; /*!< Dev cookie */ #else - IMG_HANDLE hDevCookie; + IMG_HANDLE hDevCookie; /*!< Dev cookie */ #endif } PVRSRV_DEV_DATA; +/*! + ****************************************************************************** + * address:value update structure + *****************************************************************************/ typedef struct _PVRSRV_MEMUPDATE_ { - IMG_UINT32 ui32UpdateAddr; - IMG_UINT32 ui32UpdateVal; + IMG_UINT32 ui32UpdateAddr; /*!< Address */ + IMG_UINT32 ui32UpdateVal; /*!< value */ } PVRSRV_MEMUPDATE; +/*! + ****************************************************************************** + * address:value register structure + *****************************************************************************/ typedef struct _PVRSRV_HWREG_ { - IMG_UINT32 ui32RegAddr; - IMG_UINT32 ui32RegVal; + IMG_UINT32 ui32RegAddr; /*!< Address */ + IMG_UINT32 ui32RegVal; /*!< value */ } PVRSRV_HWREG; +/*! + ****************************************************************************** + * Implementation details for memory handling + *****************************************************************************/ typedef struct _PVRSRV_MEMBLK_ { - IMG_DEV_VIRTADDR sDevVirtAddr; - IMG_HANDLE hOSMemHandle; - IMG_HANDLE hOSWrapMem; - IMG_HANDLE hBuffer; - IMG_HANDLE hResItem; + IMG_DEV_VIRTADDR sDevVirtAddr; /*!< Address of the memory in the IMG MMUs address space */ + IMG_HANDLE hOSMemHandle; /*!< Stores the underlying memory allocation handle */ + IMG_HANDLE hOSWrapMem; /*!< FIXME: better way to solve this problem */ + IMG_HANDLE hBuffer; /*!< Stores the BM_HANDLE for the underlying memory management */ + IMG_HANDLE hResItem; /*!< handle to resource item for allocate */ IMG_SYS_PHYADDR *psIntSysPAddr; } PVRSRV_MEMBLK; +/*! + ****************************************************************************** + * Memory Management (externel interface) + *****************************************************************************/ typedef struct _PVRSRV_KERNEL_MEM_INFO_ *PPVRSRV_KERNEL_MEM_INFO; typedef struct _PVRSRV_CLIENT_MEM_INFO_ { - + /* CPU Virtual Address */ IMG_PVOID pvLinAddr; - + /* CPU Virtual Address (for kernel mode) */ IMG_PVOID pvLinAddrKM; - + /* Device Virtual Address */ IMG_DEV_VIRTADDR sDevVAddr; - - - - - - IMG_CPU_PHYADDR sCpuPAddr; - - + /* allocation flags */ IMG_UINT32 ui32Flags; - - - + /* client allocation flags */ IMG_UINT32 ui32ClientFlags; - + /* allocation size in bytes */ IMG_SIZE_T uAllocSize; - + /* ptr to associated client sync info - NULL if no sync */ struct _PVRSRV_CLIENT_SYNC_INFO_ *psClientSyncInfo; #if defined (SUPPORT_SID_INTERFACE) - + /* handle to client mapping data (OS specific) */ IMG_SID hMappingInfo; - + /* handle to kernel mem info */ IMG_SID hKernelMemInfo; - + /* resman handle for UM mapping clean-up */ IMG_SID hResItem; #else - + /* handle to client mapping data (OS specific) */ IMG_HANDLE hMappingInfo; - + /* handle to kernel mem info */ IMG_HANDLE hKernelMemInfo; - + /* resman handle for UM mapping clean-up */ IMG_HANDLE hResItem; #endif #if defined(SUPPORT_MEMINFO_IDS) #if !defined(USE_CODE) - + /* Globally unique "stamp" for allocation (not re-used until wrap) */ IMG_UINT64 ui64Stamp; - #else + #else /* !defined(USE_CODE) */ IMG_UINT32 dummy1; IMG_UINT32 dummy2; - #endif -#endif - - - + #endif /* !defined(USE_CODE) */ +#endif /* defined(SUPPORT_MEMINFO_IDS) */ + /* + ptr to next mem info + D3D uses psNext for mid-scene texture reload. + */ struct _PVRSRV_CLIENT_MEM_INFO_ *psNext; } PVRSRV_CLIENT_MEM_INFO, *PPVRSRV_CLIENT_MEM_INFO; +/*! + ****************************************************************************** + * Memory Heap Information + *****************************************************************************/ #define PVRSRV_MAX_CLIENT_HEAPS (32) typedef struct _PVRSRV_HEAP_INFO_ { @@ -342,11 +488,14 @@ typedef struct _PVRSRV_HEAP_INFO_ +/* + Event Object information structure +*/ typedef struct _PVRSRV_EVENTOBJECT_ { - + /* globally unique name of the event object */ IMG_CHAR szName[EVENTOBJNAME_MAXLENGTH]; - + /* kernel specific handle for the event object */ #if defined (SUPPORT_SID_INTERFACE) IMG_SID hOSEventKM; #else @@ -355,6 +504,9 @@ typedef struct _PVRSRV_EVENTOBJECT_ } PVRSRV_EVENTOBJECT; +/* + Cache operation type +*/ typedef enum { PVRSRV_MISC_INFO_CPUCACHEOP_NONE = 0, @@ -362,12 +514,16 @@ typedef enum PVRSRV_MISC_INFO_CPUCACHEOP_FLUSH } PVRSRV_MISC_INFO_CPUCACHEOP_TYPE; +/*! + ****************************************************************************** + * Structure to retrieve misc. information from services + *****************************************************************************/ typedef struct _PVRSRV_MISC_INFO_ { - IMG_UINT32 ui32StateRequest; - IMG_UINT32 ui32StatePresent; + IMG_UINT32 ui32StateRequest; /*!< requested State Flags */ + IMG_UINT32 ui32StatePresent; /*!< Present/Valid State Flags */ - + /*!< SOC Timer register */ IMG_VOID *pvSOCTimerRegisterKM; IMG_VOID *pvSOCTimerRegisterUM; #if defined (SUPPORT_SID_INTERFACE) @@ -378,58 +534,90 @@ typedef struct _PVRSRV_MISC_INFO_ IMG_HANDLE hSOCTimerRegisterMappingInfo; #endif - + /*!< SOC Clock Gating registers */ IMG_VOID *pvSOCClockGateRegs; IMG_UINT32 ui32SOCClockGateRegsSize; - + /* Memory Stats/DDK version string depending on ui32StateRequest flags */ IMG_CHAR *pszMemoryStr; IMG_UINT32 ui32MemoryStrLen; - - PVRSRV_EVENTOBJECT sGlobalEventObject; + /* global event object */ + PVRSRV_EVENTOBJECT sGlobalEventObject;//FIXME: should be private to services #if defined (SUPPORT_SID_INTERFACE) IMG_EVENTSID hOSGlobalEvent; #else IMG_HANDLE hOSGlobalEvent; #endif - + /* Note: add misc. items as required */ IMG_UINT32 aui32DDKVersion[4]; - + /*!< CPU cache flush controls: */ struct { - + /*!< Defer the CPU cache op to the next HW op to be submitted (else flush now) */ IMG_BOOL bDeferOp; - + /*!< Type of cache operation to perform */ PVRSRV_MISC_INFO_CPUCACHEOP_TYPE eCacheOpType; - + /* This union is a bit unsightly. We need it because we'll use the psMemInfo + * directly in the srvclient PVRSRVGetMiscInfo code, and then convert it + * to a kernel meminfo if required. Try to not waste space. + */ #if !defined (SUPPORT_SID_INTERFACE) union { - + /*!< Input client meminfo (UM side) */ PVRSRV_CLIENT_MEM_INFO *psClientMemInfo; - + /*!< Output kernel meminfo (Bridge+KM side) */ struct _PVRSRV_KERNEL_MEM_INFO_ *psKernelMemInfo; } u; #endif - + /*!< Offset in MemInfo to start cache op */ IMG_VOID *pvBaseVAddr; - + /*!< Length of range to perform cache op */ IMG_UINT32 ui32Length; } sCacheOpCtl; + + /*!< Meminfo refcount controls: */ + struct + { + /* This union is a bit unsightly. We need it because we'll use the psMemInfo + * directly in the srvclient PVRSRVGetMiscInfo code, and then convert it + * to a kernel meminfo if required. Try to not waste space. + */ +#if !defined(SUPPORT_SID_INTERFACE) + union + { + /*!< Input client meminfo (UM side) */ + PVRSRV_CLIENT_MEM_INFO *psClientMemInfo; + + /*!< Output kernel meminfo (Bridge+KM side) */ + struct _PVRSRV_KERNEL_MEM_INFO_ *psKernelMemInfo; + } u; +#endif + + /*!< Resulting refcount */ + IMG_UINT32 ui32RefCount; + } sGetRefCountCtl; + + IMG_UINT32 ui32PageSize; } PVRSRV_MISC_INFO; +/*! + ****************************************************************************** + * Synchronisation token + *****************************************************************************/ typedef struct _PVRSRV_SYNC_TOKEN_ { - - + /* This token is supposed to be passed around as an opaque object + - caller should not rely on the internal fields staying the same. + The fields are hidden in sPrivate in order to reinforce this. */ struct { #if defined (SUPPORT_SID_INTERFACE) @@ -439,20 +627,29 @@ typedef struct _PVRSRV_SYNC_TOKEN_ #endif IMG_UINT32 ui32ReadOpsPendingSnapshot; IMG_UINT32 ui32WriteOpsPendingSnapshot; + IMG_UINT32 ui32ReadOps2PendingSnapshot; } sPrivate; } PVRSRV_SYNC_TOKEN; +/****************************************************************************** + * PVR Client Event handling in Services + *****************************************************************************/ typedef enum _PVRSRV_CLIENT_EVENT_ { PVRSRV_CLIENT_EVENT_HWTIMEOUT = 0, } PVRSRV_CLIENT_EVENT; +typedef IMG_VOID (*PFN_QUEUE_COMMAND_COMPLETE)(IMG_HANDLE hCallbackData); + IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV PVRSRVClientEvent(IMG_CONST PVRSRV_CLIENT_EVENT eEvent, PVRSRV_DEV_DATA *psDevData, IMG_PVOID pvData); +/****************************************************************************** + * PVR Services API prototypes. + *****************************************************************************/ IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV PVRSRVConnect(PVRSRV_CONNECTION **ppsConnection, IMG_UINT32 ui32SrvFlags); @@ -474,16 +671,6 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVGetMiscInfo (IMG_CONST PVRSRV_CONNECTION *psConn IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV PVRSRVReleaseMiscInfo (IMG_CONST PVRSRV_CONNECTION *psConnection, PVRSRV_MISC_INFO *psMiscInfo); -#if 1 -IMG_IMPORT -IMG_UINT32 ReadHWReg(IMG_PVOID pvLinRegBaseAddr, IMG_UINT32 ui32Offset); - -IMG_IMPORT -IMG_VOID WriteHWReg(IMG_PVOID pvLinRegBaseAddr, IMG_UINT32 ui32Offset, IMG_UINT32 ui32Value); - -IMG_IMPORT IMG_VOID WriteHWRegs(IMG_PVOID pvLinRegBaseAddr, IMG_UINT32 ui32Count, PVRSRV_HWREG *psHWRegs); -#endif - IMG_IMPORT PVRSRV_ERROR PVRSRVPollForValue ( const PVRSRV_CONNECTION *psConnection, #if defined (SUPPORT_SID_INTERFACE) @@ -497,6 +684,7 @@ PVRSRV_ERROR PVRSRVPollForValue ( const PVRSRV_CONNECTION *psConnection, IMG_UINT32 ui32Waitus, IMG_UINT32 ui32Tries); +/* memory APIs */ IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV PVRSRVCreateDeviceMemContext(IMG_CONST PVRSRV_DEV_DATA *psDevData, #if defined (SUPPORT_SID_INTERFACE) @@ -510,10 +698,11 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVCreateDeviceMemContext(IMG_CONST PVRSRV_DEV_DATA IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV PVRSRVDestroyDeviceMemContext(IMG_CONST PVRSRV_DEV_DATA *psDevData, #if defined (SUPPORT_SID_INTERFACE) - IMG_SID hDevMemContext); + IMG_SID hDevMemContext #else - IMG_HANDLE hDevMemContext); + IMG_HANDLE hDevMemContext #endif + ); IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV PVRSRVGetDeviceMemHeapInfo(IMG_CONST PVRSRV_DEV_DATA *psDevData, @@ -536,6 +725,20 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVGetDeviceMemHeapInfo(IMG_CONST PVRSRV_DEV_DATA * #endif +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVAllocDeviceMem2(IMG_CONST PVRSRV_DEV_DATA *psDevData, +#if defined (SUPPORT_SID_INTERFACE) + IMG_SID hDevMemHeap, +#else + IMG_HANDLE hDevMemHeap, +#endif + IMG_UINT32 ui32Attribs, + IMG_SIZE_T ui32Size, + IMG_SIZE_T ui32Alignment, + IMG_PVOID pvPrivData, + IMG_UINT32 ui32PrivDataLength, + PVRSRV_CLIENT_MEM_INFO **ppsMemInfo); + IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV PVRSRVAllocDeviceMem(IMG_CONST PVRSRV_DEV_DATA *psDevData, #if defined (SUPPORT_SID_INTERFACE) @@ -556,10 +759,11 @@ IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV PVRSRVExportDeviceMem(IMG_CONST PVRSRV_DEV_DATA *psDevData, PVRSRV_CLIENT_MEM_INFO *psMemInfo, #if defined (SUPPORT_SID_INTERFACE) - IMG_SID *phMemInfo); + IMG_SID *phMemInfo #else - IMG_HANDLE *phMemInfo); + IMG_HANDLE *phMemInfo #endif + ); IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV PVRSRVReserveDeviceVirtualMem(IMG_CONST PVRSRV_DEV_DATA *psDevData, @@ -665,7 +869,43 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVMapDeviceMemory2(IMG_CONST PVRSRV_DEV_DATA *psDe IMG_HANDLE hDstDevMemHeap, #endif PVRSRV_CLIENT_MEM_INFO **ppsDstMemInfo); -#endif +#endif /* defined(LINUX) */ + +#if defined(SUPPORT_ION) +PVRSRV_ERROR PVRSRVMapIonHandle(const PVRSRV_DEV_DATA *psDevData, +#if defined (SUPPORT_SID_INTERFACE) + IMG_SID hDevMemContext, +#else + IMG_HANDLE hDevMemContext, +#endif + IMG_INT32 uiFD, + IMG_UINT32 uiSize, + IMG_UINT32 ui32Attribs, + PVRSRV_CLIENT_MEM_INFO **ppsMemInfo); + +PVRSRV_ERROR PVRSRVUnmapIonHandle(const PVRSRV_DEV_DATA *psDevData, + PVRSRV_CLIENT_MEM_INFO *psMemInfo); +#endif /* defined (SUPPORT_ION) */ + + +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVAllocDeviceMemSparse(const PVRSRV_DEV_DATA *psDevData, +#if defined (SUPPORT_SID_INTERFACE) + IMG_SID hDevMemHeap, +#else + IMG_HANDLE hDevMemHeap, +#endif + IMG_UINT32 ui32Attribs, + IMG_SIZE_T uAlignment, + IMG_UINT32 ui32ChunkSize, + IMG_UINT32 ui32NumVirtChunks, + IMG_UINT32 ui32NumPhysChunks, + IMG_BOOL *pabMapChunk, + PVRSRV_CLIENT_MEM_INFO **ppsMemInfo); + +/****************************************************************************** + * PVR Allocation Synchronisation Functionality... + *****************************************************************************/ typedef enum _PVRSRV_SYNCVAL_MODE_ { @@ -698,12 +938,18 @@ IMG_IMPORT PVRSRV_SYNCVAL PVRSRVGetPendingOpSyncVal(PPVRSRV_CLIENT_MEM_INFO psMe PVRSRV_SYNCVAL_MODE eMode); +/****************************************************************************** + * Common Device Class Enumeration + *****************************************************************************/ IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV PVRSRVEnumerateDeviceClass(IMG_CONST PVRSRV_CONNECTION *psConnection, PVRSRV_DEVICE_CLASS DeviceClass, IMG_UINT32 *pui32DevCount, IMG_UINT32 *pui32DevID); +/****************************************************************************** + * Display Device Class API definition + *****************************************************************************/ IMG_IMPORT IMG_HANDLE IMG_CALLCONV PVRSRVOpenDCDevice(IMG_CONST PVRSRV_DEV_DATA *psDevData, IMG_UINT32 ui32DeviceID); @@ -725,10 +971,11 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVEnumDCDims (IMG_HANDLE hDevice, IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV PVRSRVGetDCSystemBuffer(IMG_HANDLE hDevice, #if defined (SUPPORT_SID_INTERFACE) - IMG_SID *phBuffer); + IMG_SID *phBuffer #else - IMG_HANDLE *phBuffer); + IMG_HANDLE *phBuffer #endif + ); IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV PVRSRVGetDCInfo(IMG_HANDLE hDevice, @@ -743,18 +990,20 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVCreateDCSwapChain (IMG_HANDLE hDevice, IMG_UINT32 ui32OEMFlags, IMG_UINT32 *pui32SwapChainID, #if defined (SUPPORT_SID_INTERFACE) - IMG_SID *phSwapChain); + IMG_SID *phSwapChain #else - IMG_HANDLE *phSwapChain); + IMG_HANDLE *phSwapChain #endif + ); IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV PVRSRVDestroyDCSwapChain (IMG_HANDLE hDevice, #if defined (SUPPORT_SID_INTERFACE) - IMG_SID hSwapChain); + IMG_SID hSwapChain #else - IMG_HANDLE hSwapChain); + IMG_HANDLE hSwapChain #endif + ); IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV PVRSRVSetDCDstRect (IMG_HANDLE hDevice, @@ -796,11 +1045,23 @@ IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV PVRSRVGetDCBuffers(IMG_HANDLE hDevice, #if defined (SUPPORT_SID_INTERFACE) IMG_SID hSwapChain, - IMG_SID *phBuffer); + IMG_SID *phBuffer #else IMG_HANDLE hSwapChain, - IMG_HANDLE *phBuffer); + IMG_HANDLE *phBuffer +#endif + ); + +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVGetDCBuffers2(IMG_HANDLE hDevice, +#if defined (SUPPORT_SID_INTERFACE) + IMG_SID hSwapChain, + IMG_SID *phBuffer, +#else + IMG_HANDLE hSwapChain, + IMG_HANDLE *phBuffer, #endif + IMG_SYS_PHYADDR *psPhyAddr); IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV PVRSRVSwapToDCBuffer (IMG_HANDLE hDevice, @@ -813,20 +1074,37 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVSwapToDCBuffer (IMG_HANDLE hDevice, IMG_RECT *psClipRect, IMG_UINT32 ui32SwapInterval, #if defined (SUPPORT_SID_INTERFACE) - IMG_SID hPrivateTag); + IMG_SID hPrivateTag #else - IMG_HANDLE hPrivateTag); + IMG_HANDLE hPrivateTag #endif + ); IMG_IMPORT -PVRSRV_ERROR IMG_CALLCONV PVRSRVSwapToDCSystem (IMG_HANDLE hDevice, +PVRSRV_ERROR IMG_CALLCONV PVRSRVSwapToDCBuffer2 (IMG_HANDLE hDevice, #if defined (SUPPORT_SID_INTERFACE) - IMG_SID hSwapChain); + IMG_SID hBuffer, #else - IMG_HANDLE hSwapChain); + IMG_HANDLE hBuffer, #endif + IMG_UINT32 ui32SwapInterval, + PVRSRV_CLIENT_MEM_INFO **ppsMemInfos, + IMG_UINT32 ui32NumMemInfos, + IMG_PVOID pvPrivData, + IMG_UINT32 ui32PrivDataLength); +IMG_IMPORT +PVRSRV_ERROR IMG_CALLCONV PVRSRVSwapToDCSystem (IMG_HANDLE hDevice, +#if defined (SUPPORT_SID_INTERFACE) + IMG_SID hSwapChain +#else + IMG_HANDLE hSwapChain +#endif + ); +/****************************************************************************** + * Buffer Device Class API definition + *****************************************************************************/ IMG_IMPORT IMG_HANDLE IMG_CALLCONV PVRSRVOpenBCDevice(IMG_CONST PVRSRV_DEV_DATA *psDevData, IMG_UINT32 ui32DeviceID); @@ -843,12 +1121,16 @@ IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV PVRSRVGetBCBuffer(IMG_HANDLE hDevice, IMG_UINT32 ui32BufferIndex, #if defined (SUPPORT_SID_INTERFACE) - IMG_SID *phBuffer); + IMG_SID *phBuffer #else - IMG_HANDLE *phBuffer); + IMG_HANDLE *phBuffer #endif + ); +/****************************************************************************** + * PDUMP Function prototypes... + *****************************************************************************/ IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV PVRSRVPDumpInit(IMG_CONST PVRSRV_CONNECTION *psConnection); @@ -1051,6 +1333,11 @@ IMG_IMPORT IMG_BOOL IMG_CALLCONV PVRSRVGetAppHint(IMG_VOID *pvHintState, const IMG_VOID *pvDefault, IMG_VOID *pvReturn); +/****************************************************************************** + * Memory API(s) + *****************************************************************************/ + +/* Exported APIs */ IMG_IMPORT IMG_PVOID IMG_CALLCONV PVRSRVAllocUserModeMem (IMG_SIZE_T ui32Size); IMG_IMPORT IMG_PVOID IMG_CALLCONV PVRSRVCallocUserModeMem (IMG_SIZE_T ui32Size); IMG_IMPORT IMG_PVOID IMG_CALLCONV PVRSRVReallocUserModeMem (IMG_PVOID pvBase, IMG_SIZE_T uNewSize); @@ -1061,11 +1348,79 @@ IMG_IMPORT IMG_VOID PVRSRVMemSet(IMG_VOID *pvDest, IMG_UINT8 ui8Value, IMG_SIZE_ struct _PVRSRV_MUTEX_OPAQUE_STRUCT_; typedef struct _PVRSRV_MUTEX_OPAQUE_STRUCT_ *PVRSRV_MUTEX_HANDLE; + +#if defined(PVR_DEBUG_MUTEXES) + +IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV PVRSRVCreateMutex(PVRSRV_MUTEX_HANDLE *phMutex, + IMG_CHAR pszMutexName[], + IMG_CHAR pszFilename[], + IMG_INT iLine); +IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV PVRSRVDestroyMutex(PVRSRV_MUTEX_HANDLE hMutex, + IMG_CHAR pszMutexName[], + IMG_CHAR pszFilename[], + IMG_INT iLine); +IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVLockMutex(PVRSRV_MUTEX_HANDLE hMutex, + IMG_CHAR pszMutexName[], + IMG_CHAR pszFilename[], + IMG_INT iLine); +IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVUnlockMutex(PVRSRV_MUTEX_HANDLE hMutex, + IMG_CHAR pszMutexName[], + IMG_CHAR pszFilename[], + IMG_INT iLine); + +#define PVRSRVCreateMutex(phMutex) PVRSRVCreateMutex(phMutex, #phMutex, __FILE__, __LINE__) +#define PVRSRVDestroyMutex(hMutex) PVRSRVDestroyMutex(hMutex, #hMutex, __FILE__, __LINE__) +#define PVRSRVLockMutex(hMutex) PVRSRVLockMutex(hMutex, #hMutex, __FILE__, __LINE__) +#define PVRSRVUnlockMutex(hMutex) PVRSRVUnlockMutex(hMutex, #hMutex, __FILE__, __LINE__) + +#else /* defined(PVR_DEBUG_MUTEXES) */ + IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV PVRSRVCreateMutex(PVRSRV_MUTEX_HANDLE *phMutex); IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV PVRSRVDestroyMutex(PVRSRV_MUTEX_HANDLE hMutex); IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVLockMutex(PVRSRV_MUTEX_HANDLE hMutex); IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVUnlockMutex(PVRSRV_MUTEX_HANDLE hMutex); +#endif /* defined(PVR_DEBUG_MUTEXES) */ + + +struct _PVRSRV_RECMUTEX_OPAQUE_STRUCT_; +typedef struct _PVRSRV_RECMUTEX_OPAQUE_STRUCT_ *PVRSRV_RECMUTEX_HANDLE; + + +#if defined(PVR_DEBUG_MUTEXES) + +IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV PVRSRVCreateRecursiveMutex(PVRSRV_RECMUTEX_HANDLE *phMutex, + IMG_CHAR pszMutexName[], + IMG_CHAR pszFilename[], + IMG_INT iLine); +IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV PVRSRVDestroyRecursiveMutex(PVRSRV_RECMUTEX_HANDLE hMutex, + IMG_CHAR pszMutexName[], + IMG_CHAR pszFilename[], + IMG_INT iLine); +IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVLockRecursiveMutex(PVRSRV_RECMUTEX_HANDLE hMutex, + IMG_CHAR pszMutexName[], + IMG_CHAR pszFilename[], + IMG_INT iLine); +IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVUnlockRecursiveMutex(PVRSRV_RECMUTEX_HANDLE hMutex, + IMG_CHAR pszMutexName[], + IMG_CHAR pszFilename[], + IMG_INT iLine); + +#define PVRSRVCreateRecursiveMutex(phMutex) PVRSRVCreateRecursiveMutex(phMutex, #phMutex, __FILE__, __LINE__) +#define PVRSRVDestroyRecursiveMutex(hMutex) PVRSRVDestroyRecursiveMutex(hMutex, #hMutex, __FILE__, __LINE__) +#define PVRSRVLockRecursiveMutex(hMutex) PVRSRVLockRecursiveMutex(hMutex, #hMutex, __FILE__, __LINE__) +#define PVRSRVUnlockRecursiveMutex(hMutex) PVRSRVUnlockRecursiveMutex(hMutex, #hMutex, __FILE__, __LINE__) + +#else /* defined(PVR_DEBUG_MUTEXES) */ + +IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV PVRSRVCreateRecursiveMutex(PVRSRV_RECMUTEX_HANDLE *phMutex); +IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV PVRSRVDestroyRecursiveMutex(PVRSRV_RECMUTEX_HANDLE hMutex); +IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVLockRecursiveMutex(PVRSRV_RECMUTEX_HANDLE hMutex); +IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVUnlockRecursiveMutex(PVRSRV_RECMUTEX_HANDLE hMutex); + +#endif /* defined(PVR_DEBUG_MUTEXES) */ + +/* Non-recursive coarse-grained mutex shared between all threads in a proccess */ IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVLockProcessGlobalMutex(void); IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVUnlockProcessGlobalMutex(void); @@ -1117,10 +1472,11 @@ static INLINE IMG_VOID PVRSRVPostSemaphore(PVRSRV_SEMAPHORE_HANDLE hSemaphore, I PVR_UNREFERENCED_PARAMETER(iPostCount); } -#endif +#endif /* !defined(USE_CODE) */ -#if (defined(DEBUG) && (defined(__linux__) || defined(__QNXNTO__))) +/* Non-exported APIs */ +#if defined(DEBUG) && (defined(__linux__) || defined(__QNXNTO__) ) IMG_IMPORT IMG_PVOID IMG_CALLCONV PVRSRVAllocUserModeMemTracking(IMG_SIZE_T ui32Size, IMG_CHAR *pszFileName, IMG_UINT32 ui32LineNumber); IMG_IMPORT IMG_PVOID IMG_CALLCONV PVRSRVCallocUserModeMemTracking(IMG_SIZE_T ui32Size, IMG_CHAR *pszFileName, IMG_UINT32 ui32LineNumber); @@ -1129,33 +1485,84 @@ IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVFreeUserModeMemTracking(IMG_VOID *pvMem) IMG_IMPORT IMG_PVOID IMG_CALLCONV PVRSRVReallocUserModeMemTracking(IMG_VOID *pvMem, IMG_SIZE_T ui32NewSize, IMG_CHAR *pszFileName, IMG_UINT32 ui32LineNumber); -#endif +#endif /* defined(DEBUG) && (defined(__linux__) || defined(_UITRON_)) */ + +/****************************************************************************** + * PVR Event Object API(s) + *****************************************************************************/ IMG_IMPORT PVRSRV_ERROR PVRSRVEventObjectWait(const PVRSRV_CONNECTION *psConnection, #if defined (SUPPORT_SID_INTERFACE) - IMG_EVENTSID hOSEvent); + IMG_EVENTSID hOSEvent #else - IMG_HANDLE hOSEvent); + IMG_HANDLE hOSEvent #endif + ); +/*! + ****************************************************************************** + + @Function PVRSRVCreateSyncInfoModObj + + @Description Creates an empty Modification object to be later used by PVRSRVModifyPendingSyncOps + + ******************************************************************************/ IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV PVRSRVCreateSyncInfoModObj(const PVRSRV_CONNECTION *psConnection, #if defined (SUPPORT_SID_INTERFACE) - IMG_SID *phKernelSyncInfoModObj); + IMG_SID *phKernelSyncInfoModObj #else - IMG_HANDLE *phKernelSyncInfoModObj); + IMG_HANDLE *phKernelSyncInfoModObj #endif + ); + +/*! + ****************************************************************************** + @Function PVRSRVDestroySyncInfoModObj + + @Description Destroys a Modification object. Must be empty. + + ******************************************************************************/ IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV PVRSRVDestroySyncInfoModObj(const PVRSRV_CONNECTION *psConnection, #if defined (SUPPORT_SID_INTERFACE) - IMG_SID hKernelSyncInfoModObj); + IMG_SID hKernelSyncInfoModObj #else - IMG_HANDLE hKernelSyncInfoModObj); + IMG_HANDLE hKernelSyncInfoModObj #endif + ); + +/*! + ****************************************************************************** + @Function PVRSRVModifyPendingSyncOps + + @Description Returns PRE-INCREMENTED sync op values. Performs thread safe increment + of sync ops values as specified by ui32ModifyFlags. + + PVRSRV_ERROR_RETRY is returned if the supplied modification object + is not empty. This is on the assumption that a different thread + will imminently call PVRSRVModifyCompleteSyncOps. This thread should + sleep before retrying. It should be regarded as an error if no such + other thread exists. + + Note that this API has implied locking semantics, as follows: + + PVRSRVModifyPendingSyncOps() + - announces an operation on the buffer is "pending", and + conceptually takes a ticket to represent your place in the queue. + - NB: ** exclusive access to the resource is _NOT_ granted at this time ** + PVRSRVSyncOpsFlushToModObj() + - ensures you have exclusive access to the resource (conceptually, a LOCK) + - the previously "pending" operation can now be regarded as "in progress" + PVRSRVModifyCompleteSyncOps() + - declares that the previously "in progress" operation is now complete. (UNLOCK) + + + ******************************************************************************/ IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV PVRSRVModifyPendingSyncOps(const PVRSRV_CONNECTION *psConnection, #if defined (SUPPORT_SID_INTERFACE) @@ -1168,14 +1575,49 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVModifyPendingSyncOps(const PVRSRV_CONNECTION *ps IMG_UINT32 *pui32ReadOpsPending, IMG_UINT32 *pui32WriteOpsPending); +/*! + ****************************************************************************** + + @Function PVRSRVModifyCompleteSyncOps + + @Description Performs thread safe increment of sync ops values as specified + by the ui32ModifyFlags that were given to PVRSRVModifyPendingSyncOps. + The supplied Modification Object will become empty. + + Note that this API has implied locking semantics, as + described above in PVRSRVModifyPendingSyncOps + + ******************************************************************************/ IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV PVRSRVModifyCompleteSyncOps(const PVRSRV_CONNECTION *psConnection, #if defined (SUPPORT_SID_INTERFACE) - IMG_SID hKernelSyncInfoModObj); + IMG_SID hKernelSyncInfoModObj #else - IMG_HANDLE hKernelSyncInfoModObj); + IMG_HANDLE hKernelSyncInfoModObj #endif + ); + +/*! + ****************************************************************************** + + @Function PVRSRVSyncOpsTakeToken + + @Description Takes a "deli-counter" style token for future use with + PVRSRVSyncOpsFlushToToken(). In practice this means + recording a snapshot of the current "pending" values. A + future PVRSRVSyncOpsFlushToToken() will ensure that all + operations that were pending at the time of this + PVRSRVSyncOpsTakeToken() call will be flushed. + Operations may be subsequently queued after this call + and would not be flushed. The caller is required to + provide storage for the token. The token is disposable + - i.e. the caller can simply let the token go out of + scope without telling us... in particular, there is no + obligation to call PVRSRVSyncOpsFlushToToken(). + Multiple tokens may be taken. There is no implied + locking with this API. + ******************************************************************************/ IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV PVRSRVSyncOpsTakeToken(const PVRSRV_CONNECTION *psConnection, #if defined (SUPPORT_SID_INTERFACE) @@ -1184,6 +1626,22 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVSyncOpsTakeToken(const PVRSRV_CONNECTION *psConn const PVRSRV_CLIENT_SYNC_INFO *psSyncInfo, #endif PVRSRV_SYNC_TOKEN *psSyncToken); +/*! + ****************************************************************************** + + @Function PVRSRVSyncOpsFlushToToken + + @Description Tests whether the dependencies for a pending sync op modification + have been satisfied. If this function returns PVRSRV_OK, then the + "complete" counts have caught up with the snapshot of the "pending" + values taken when PVRSRVSyncOpsTakeToken() was called. + In the event that the dependencies are not (yet) met, + this call will auto-retry if bWait is specified, otherwise, it will + return PVRSRV_ERROR_RETRY. (Not really an "error") + + (auto-retry behaviour not implemented) + + ******************************************************************************/ IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV PVRSRVSyncOpsFlushToToken(const PVRSRV_CONNECTION *psConnection, #if defined (SUPPORT_SID_INTERFACE) @@ -1193,6 +1651,24 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVSyncOpsFlushToToken(const PVRSRV_CONNECTION *psC #endif const PVRSRV_SYNC_TOKEN *psSyncToken, IMG_BOOL bWait); +/*! + ****************************************************************************** + + @Function PVRSRVSyncOpsFlushToModObj + + @Description Tests whether the dependencies for a pending sync op modification + have been satisfied. If this function returns PVRSRV_OK, then the + "complete" counts have caught up with the snapshot of the "pending" + values taken when PVRSRVModifyPendingSyncOps() was called. + PVRSRVModifyCompleteSyncOps() can then be called without risk of + stalling. In the event that the dependencies are not (yet) met, + this call will auto-retry if bWait is specified, otherwise, it will + return PVRSRV_ERROR_RETRY. (Not really an "error") + + Note that this API has implied locking semantics, as + described above in PVRSRVModifyPendingSyncOps + + ******************************************************************************/ IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV PVRSRVSyncOpsFlushToModObj(const PVRSRV_CONNECTION *psConnection, #if defined (SUPPORT_SID_INTERFACE) @@ -1202,33 +1678,94 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVSyncOpsFlushToModObj(const PVRSRV_CONNECTION *ps #endif IMG_BOOL bWait); +/*! + ****************************************************************************** + + @Function PVRSRVSyncOpsFlushToDelta + + @Description Compares the number of outstanding operations (pending count minus + complete count) with the limit specified. If no more than ui32Delta + operations are outstanding, this function returns PVRSRV_OK. + In the event that there are too many outstanding operations, + this call will auto-retry if bWait is specified, otherwise, it will + return PVRSRV_ERROR_RETRY. (Not really an "error") + + ******************************************************************************/ IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV PVRSRVSyncOpsFlushToDelta(const PVRSRV_CONNECTION *psConnection, PVRSRV_CLIENT_SYNC_INFO *psClientSyncInfo, IMG_UINT32 ui32Delta, IMG_BOOL bWait); +/*! + ****************************************************************************** + + @Function PVRSRVAllocSyncInfo + + @Description Creates a Sync Object. Unlike the sync objects created + automatically with "PVRSRVAllocDeviceMem", the sync objects + returned by this function do _not_ have a UM mapping to the + sync data and they do _not_ have the device virtual address + of the "opscomplete" fields. These data are to be deprecated. + + ******************************************************************************/ + IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV PVRSRVAllocSyncInfo(IMG_CONST PVRSRV_DEV_DATA *psDevData, PVRSRV_CLIENT_SYNC_INFO **ppsSyncInfo); +/*! + ****************************************************************************** + + @Function PVRSRVFreeSyncInfo + + @Description Destroys a Sync Object created via + PVRSRVAllocSyncInfo. + + ******************************************************************************/ + IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV PVRSRVFreeSyncInfo(IMG_CONST PVRSRV_DEV_DATA *psDevData, PVRSRV_CLIENT_SYNC_INFO *psSyncInfo); +/*! + ****************************************************************************** + + @Function PVRSRVGetErrorString + + @Description Returns a text string relating to the PVRSRV_ERROR enum. + + ******************************************************************************/ IMG_IMPORT const IMG_CHAR *PVRSRVGetErrorString(PVRSRV_ERROR eError); +/*! + ****************************************************************************** + + @Function PVRSRVCacheInvalidate + + @Description Invalidate the CPU cache for a specified memory + area. Note that PVRSRVGetMiscInfo provides similar cpu + cache flush/invalidate functionality for some platforms. + + ******************************************************************************/ + IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV PVRSRVCacheInvalidate(const PVRSRV_CONNECTION *psConnection, IMG_PVOID pvLinearAddress, IMG_UINT32 ui32Size); +/****************************************************************************** + Time wrapping macro +******************************************************************************/ #define TIME_NOT_PASSED_UINT32(a,b,c) (((a) - (b)) < (c)) #if defined (__cplusplus) } #endif -#endif +#endif /* __SERVICES_H__ */ +/****************************************************************************** + End of file (services.h) +******************************************************************************/ diff --git a/include4/servicesext.h b/include4/servicesext.h index 54dd4d9..80df117 100644 --- a/include4/servicesext.h +++ b/include4/servicesext.h @@ -1,34 +1,62 @@ -/********************************************************************** - * - * Copyright (C) Imagination Technologies Ltd. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful but, except - * as otherwise stated in writing, 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., - * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * - * The full GNU General Public License is included in this distribution in - * the file called "COPYING". - * - * Contact Information: - * Imagination Technologies Ltd. - * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK - * - ******************************************************************************/ +/*************************************************************************/ /*! +@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__ -#define PVRSRV_LOCKFLG_READONLY (1) +/* + * Lock buffer read/write flags + */ +#define PVRSRV_LOCKFLG_READONLY (1) /*!< The locking process will only read the locked surface */ +/*! + ***************************************************************************** + * Error values + * + * NOTE: If you change this, make sure you update the error texts in + * services4/include/pvrsrv_errors.h to match. + * + *****************************************************************************/ typedef enum _PVRSRV_ERROR_ { PVRSRV_OK = 0, @@ -267,6 +295,10 @@ typedef enum _PVRSRV_ERROR_ } PVRSRV_ERROR; +/*! + ***************************************************************************** + * List of known device classes. + *****************************************************************************/ typedef enum _PVRSRV_DEVICE_CLASS_ { PVRSRV_DEVICE_CLASS_3D = 0 , @@ -279,14 +311,18 @@ typedef enum _PVRSRV_DEVICE_CLASS_ } PVRSRV_DEVICE_CLASS; +/*! + ***************************************************************************** + * States for power management + *****************************************************************************/ typedef enum _PVRSRV_SYS_POWER_STATE_ { - PVRSRV_SYS_POWER_STATE_Unspecified = -1, - PVRSRV_SYS_POWER_STATE_D0 = 0, - PVRSRV_SYS_POWER_STATE_D1 = 1, - PVRSRV_SYS_POWER_STATE_D2 = 2, - PVRSRV_SYS_POWER_STATE_D3 = 3, - PVRSRV_SYS_POWER_STATE_D4 = 4, + PVRSRV_SYS_POWER_STATE_Unspecified = -1, /*!< Unspecified : Uninitialised */ + PVRSRV_SYS_POWER_STATE_D0 = 0, /*!< On */ + PVRSRV_SYS_POWER_STATE_D1 = 1, /*!< User Idle */ + PVRSRV_SYS_POWER_STATE_D2 = 2, /*!< System Idle / sleep */ + PVRSRV_SYS_POWER_STATE_D3 = 3, /*!< Suspend / Hibernate */ + PVRSRV_SYS_POWER_STATE_D4 = 4, /*!< shutdown */ PVRSRV_SYS_POWER_STATE_FORCE_I32 = 0x7fffffff @@ -295,16 +331,17 @@ typedef enum _PVRSRV_SYS_POWER_STATE_ typedef enum _PVRSRV_DEV_POWER_STATE_ { - PVRSRV_DEV_POWER_STATE_DEFAULT = -1, - PVRSRV_DEV_POWER_STATE_ON = 0, - PVRSRV_DEV_POWER_STATE_IDLE = 1, - PVRSRV_DEV_POWER_STATE_OFF = 2, + PVRSRV_DEV_POWER_STATE_DEFAULT = -1, /*!< Default state for the device */ + PVRSRV_DEV_POWER_STATE_ON = 0, /*!< Running */ + PVRSRV_DEV_POWER_STATE_IDLE = 1, /*!< Powered but operation paused */ + PVRSRV_DEV_POWER_STATE_OFF = 2, /*!< Unpowered */ PVRSRV_DEV_POWER_STATE_FORCE_I32 = 0x7fffffff -} PVRSRV_DEV_POWER_STATE, *PPVRSRV_DEV_POWER_STATE; +} PVRSRV_DEV_POWER_STATE, *PPVRSRV_DEV_POWER_STATE; /* PRQA S 3205 */ +/* Power transition handler prototypes */ typedef PVRSRV_ERROR (*PFN_PRE_POWER) (IMG_HANDLE hDevHandle, PVRSRV_DEV_POWER_STATE eNewPowerState, PVRSRV_DEV_POWER_STATE eCurrentPowerState); @@ -312,6 +349,7 @@ typedef PVRSRV_ERROR (*PFN_POST_POWER) (IMG_HANDLE hDevHandle, PVRSRV_DEV_POWER_STATE eNewPowerState, PVRSRV_DEV_POWER_STATE eCurrentPowerState); +/* Clock speed handler prototypes */ typedef PVRSRV_ERROR (*PFN_PRE_CLOCKSPEED_CHANGE) (IMG_HANDLE hDevHandle, IMG_BOOL bIdleDevice, PVRSRV_DEV_POWER_STATE eCurrentPowerState); @@ -320,13 +358,23 @@ typedef PVRSRV_ERROR (*PFN_POST_CLOCKSPEED_CHANGE) (IMG_HANDLE hDevHandle, PVRSRV_DEV_POWER_STATE eCurrentPowerState); +/***************************************************************************** + * Enumeration of all possible pixel types. Where applicable, Ordering of name + * is in reverse order of memory bytes (i.e. as a word in little endian). + * e.g. A8R8G8B8 is in memory as 4 bytes in order: BB GG RR AA + * + * NOTE: When modifying this structure please update the client driver format + * tables located in %WORKROOT%/eurasia/codegen/pixfmts using the tool + * located in %WORKROOT%/eurasia/tools/intern/TextureFormatParser. + * + *****************************************************************************/ typedef enum _PVRSRV_PIXEL_FORMAT_ { - + /* Basic types */ PVRSRV_PIXEL_FORMAT_UNKNOWN = 0, PVRSRV_PIXEL_FORMAT_RGB565 = 1, PVRSRV_PIXEL_FORMAT_RGB555 = 2, - PVRSRV_PIXEL_FORMAT_RGB888 = 3, - PVRSRV_PIXEL_FORMAT_BGR888 = 4, + PVRSRV_PIXEL_FORMAT_RGB888 = 3, /*!< 24bit */ + PVRSRV_PIXEL_FORMAT_BGR888 = 4, /*!< 24bit */ PVRSRV_PIXEL_FORMAT_GREY_SCALE = 8, PVRSRV_PIXEL_FORMAT_PAL12 = 13, PVRSRV_PIXEL_FORMAT_PAL8 = 14, @@ -345,8 +393,8 @@ typedef enum _PVRSRV_PIXEL_FORMAT_ { PVRSRV_PIXEL_FORMAT_BGRA8888 = 28, PVRSRV_PIXEL_FORMAT_XRGB4444 = 29, PVRSRV_PIXEL_FORMAT_ARGB8332 = 30, - PVRSRV_PIXEL_FORMAT_A2RGB10 = 31, - PVRSRV_PIXEL_FORMAT_A2BGR10 = 32, + PVRSRV_PIXEL_FORMAT_A2RGB10 = 31, /*!< 32bpp, 10 bits for R, G, B, 2 bits for A */ + PVRSRV_PIXEL_FORMAT_A2BGR10 = 32, /*!< 32bpp, 10 bits for B, G, R, 2 bits for A */ PVRSRV_PIXEL_FORMAT_P8 = 33, PVRSRV_PIXEL_FORMAT_L8 = 34, PVRSRV_PIXEL_FORMAT_A8L8 = 35, @@ -362,7 +410,7 @@ typedef enum _PVRSRV_PIXEL_FORMAT_ { PVRSRV_PIXEL_FORMAT_D24S8 = 45, PVRSRV_PIXEL_FORMAT_D24X8 = 46, - + /* Added to ensure TQ build */ PVRSRV_PIXEL_FORMAT_ABGR16 = 47, PVRSRV_PIXEL_FORMAT_ABGR16F = 48, PVRSRV_PIXEL_FORMAT_ABGR32 = 49, @@ -373,22 +421,22 @@ typedef enum _PVRSRV_PIXEL_FORMAT_ { PVRSRV_PIXEL_FORMAT_GR32 = 54, PVRSRV_PIXEL_FORMAT_E5BGR9 = 55, - + /* reserved types */ PVRSRV_PIXEL_FORMAT_RESERVED1 = 56, PVRSRV_PIXEL_FORMAT_RESERVED2 = 57, PVRSRV_PIXEL_FORMAT_RESERVED3 = 58, PVRSRV_PIXEL_FORMAT_RESERVED4 = 59, PVRSRV_PIXEL_FORMAT_RESERVED5 = 60, - + /* RGB space packed formats */ PVRSRV_PIXEL_FORMAT_R8G8_B8G8 = 61, PVRSRV_PIXEL_FORMAT_G8R8_G8B8 = 62, - + /* YUV space planar formats */ PVRSRV_PIXEL_FORMAT_NV11 = 63, PVRSRV_PIXEL_FORMAT_NV12 = 64, - + /* YUV space packed formats */ PVRSRV_PIXEL_FORMAT_YUY2 = 65, PVRSRV_PIXEL_FORMAT_YUV420 = 66, PVRSRV_PIXEL_FORMAT_YUV444 = 67, @@ -398,107 +446,107 @@ typedef enum _PVRSRV_PIXEL_FORMAT_ { PVRSRV_PIXEL_FORMAT_UYVY = 71, PVRSRV_PIXEL_FORMAT_VYUY = 72, - PVRSRV_PIXEL_FORMAT_FOURCC_ORG_UYVY = 73, - PVRSRV_PIXEL_FORMAT_FOURCC_ORG_YUYV = 74, - PVRSRV_PIXEL_FORMAT_FOURCC_ORG_YVYU = 75, - PVRSRV_PIXEL_FORMAT_FOURCC_ORG_VYUY = 76, - PVRSRV_PIXEL_FORMAT_FOURCC_ORG_AYUV = 77, - - - PVRSRV_PIXEL_FORMAT_A32B32G32R32 = 78, - PVRSRV_PIXEL_FORMAT_A32B32G32R32F = 79, - PVRSRV_PIXEL_FORMAT_A32B32G32R32_UINT = 80, - PVRSRV_PIXEL_FORMAT_A32B32G32R32_SINT = 81, - - - PVRSRV_PIXEL_FORMAT_B32G32R32 = 82, - PVRSRV_PIXEL_FORMAT_B32G32R32F = 83, - PVRSRV_PIXEL_FORMAT_B32G32R32_UINT = 84, - PVRSRV_PIXEL_FORMAT_B32G32R32_SINT = 85, - - - PVRSRV_PIXEL_FORMAT_G32R32 = 86, - PVRSRV_PIXEL_FORMAT_G32R32F = 87, - PVRSRV_PIXEL_FORMAT_G32R32_UINT = 88, - PVRSRV_PIXEL_FORMAT_G32R32_SINT = 89, - - - PVRSRV_PIXEL_FORMAT_D32F = 90, - PVRSRV_PIXEL_FORMAT_R32 = 91, - PVRSRV_PIXEL_FORMAT_R32F = 92, - PVRSRV_PIXEL_FORMAT_R32_UINT = 93, - PVRSRV_PIXEL_FORMAT_R32_SINT = 94, - - - PVRSRV_PIXEL_FORMAT_A16B16G16R16 = 95, - PVRSRV_PIXEL_FORMAT_A16B16G16R16F = 96, - PVRSRV_PIXEL_FORMAT_A16B16G16R16_SINT = 97, - PVRSRV_PIXEL_FORMAT_A16B16G16R16_SNORM = 98, - PVRSRV_PIXEL_FORMAT_A16B16G16R16_UINT = 99, - PVRSRV_PIXEL_FORMAT_A16B16G16R16_UNORM = 100, - - - PVRSRV_PIXEL_FORMAT_G16R16 = 101, - PVRSRV_PIXEL_FORMAT_G16R16F = 102, - PVRSRV_PIXEL_FORMAT_G16R16_UINT = 103, - PVRSRV_PIXEL_FORMAT_G16R16_UNORM = 104, - PVRSRV_PIXEL_FORMAT_G16R16_SINT = 105, - PVRSRV_PIXEL_FORMAT_G16R16_SNORM = 106, - - - PVRSRV_PIXEL_FORMAT_R16 = 107, - PVRSRV_PIXEL_FORMAT_R16F = 108, - PVRSRV_PIXEL_FORMAT_R16_UINT = 109, - PVRSRV_PIXEL_FORMAT_R16_UNORM = 110, - PVRSRV_PIXEL_FORMAT_R16_SINT = 111, - PVRSRV_PIXEL_FORMAT_R16_SNORM = 112, - - - PVRSRV_PIXEL_FORMAT_X8R8G8B8 = 113, - PVRSRV_PIXEL_FORMAT_X8R8G8B8_UNORM = 114, - PVRSRV_PIXEL_FORMAT_X8R8G8B8_UNORM_SRGB = 115, - - PVRSRV_PIXEL_FORMAT_A8R8G8B8 = 116, - PVRSRV_PIXEL_FORMAT_A8R8G8B8_UNORM = 117, - PVRSRV_PIXEL_FORMAT_A8R8G8B8_UNORM_SRGB = 118, - - PVRSRV_PIXEL_FORMAT_A8B8G8R8 = 119, - PVRSRV_PIXEL_FORMAT_A8B8G8R8_UINT = 120, - PVRSRV_PIXEL_FORMAT_A8B8G8R8_UNORM = 121, - PVRSRV_PIXEL_FORMAT_A8B8G8R8_UNORM_SRGB = 122, - PVRSRV_PIXEL_FORMAT_A8B8G8R8_SINT = 123, - PVRSRV_PIXEL_FORMAT_A8B8G8R8_SNORM = 124, - - - PVRSRV_PIXEL_FORMAT_G8R8 = 125, - PVRSRV_PIXEL_FORMAT_G8R8_UINT = 126, - PVRSRV_PIXEL_FORMAT_G8R8_UNORM = 127, - PVRSRV_PIXEL_FORMAT_G8R8_SINT = 128, - PVRSRV_PIXEL_FORMAT_G8R8_SNORM = 129, - - - PVRSRV_PIXEL_FORMAT_A8 = 130, - PVRSRV_PIXEL_FORMAT_R8 = 131, - PVRSRV_PIXEL_FORMAT_R8_UINT = 132, - PVRSRV_PIXEL_FORMAT_R8_UNORM = 133, - PVRSRV_PIXEL_FORMAT_R8_SINT = 134, - PVRSRV_PIXEL_FORMAT_R8_SNORM = 135, - - - PVRSRV_PIXEL_FORMAT_A2B10G10R10 = 136, - PVRSRV_PIXEL_FORMAT_A2B10G10R10_UNORM = 137, - PVRSRV_PIXEL_FORMAT_A2B10G10R10_UINT = 138, - - - PVRSRV_PIXEL_FORMAT_B10G11R11 = 139, - PVRSRV_PIXEL_FORMAT_B10G11R11F = 140, - - - PVRSRV_PIXEL_FORMAT_X24G8R32 = 141, - PVRSRV_PIXEL_FORMAT_G8R24 = 142, + PVRSRV_PIXEL_FORMAT_FOURCC_ORG_UYVY = 73, /*!< See http://www.fourcc.org/yuv.php#UYVY */ + PVRSRV_PIXEL_FORMAT_FOURCC_ORG_YUYV = 74, /*!< See http://www.fourcc.org/yuv.php#YUYV */ + PVRSRV_PIXEL_FORMAT_FOURCC_ORG_YVYU = 75, /*!< See http://www.fourcc.org/yuv.php#YVYU */ + PVRSRV_PIXEL_FORMAT_FOURCC_ORG_VYUY = 76, /*!< No fourcc.org link */ + PVRSRV_PIXEL_FORMAT_FOURCC_ORG_AYUV = 77, /*!< See http://www.fourcc.org/yuv.php#AYUV */ + + /* 4 component, 32 bits per component types */ + PVRSRV_PIXEL_FORMAT_A32B32G32R32 = 78, /*!< type unspecified */ + PVRSRV_PIXEL_FORMAT_A32B32G32R32F = 79, /*!< float type */ + PVRSRV_PIXEL_FORMAT_A32B32G32R32_UINT = 80, /*!< uint type */ + PVRSRV_PIXEL_FORMAT_A32B32G32R32_SINT = 81, /*!< sint type */ + + /* 3 component, 32 bits per component types */ + PVRSRV_PIXEL_FORMAT_B32G32R32 = 82, /*!< type unspecified */ + PVRSRV_PIXEL_FORMAT_B32G32R32F = 83, /*!< float data */ + PVRSRV_PIXEL_FORMAT_B32G32R32_UINT = 84, /*!< uint data */ + PVRSRV_PIXEL_FORMAT_B32G32R32_SINT = 85, /*!< signed int data */ + + /* 2 component, 32 bits per component types */ + PVRSRV_PIXEL_FORMAT_G32R32 = 86, /*!< type unspecified */ + PVRSRV_PIXEL_FORMAT_G32R32F = 87, /*!< float */ + PVRSRV_PIXEL_FORMAT_G32R32_UINT = 88, /*!< uint */ + PVRSRV_PIXEL_FORMAT_G32R32_SINT = 89, /*!< signed int */ + + /* 1 component, 32 bits per component types */ + PVRSRV_PIXEL_FORMAT_D32F = 90, /*!< float depth */ + PVRSRV_PIXEL_FORMAT_R32 = 91, /*!< type unspecified */ + PVRSRV_PIXEL_FORMAT_R32F = 92, /*!< float type */ + PVRSRV_PIXEL_FORMAT_R32_UINT = 93, /*!< unsigned int type */ + PVRSRV_PIXEL_FORMAT_R32_SINT = 94, /*!< signed int type */ + + /* 4 component, 16 bits per component types */ + PVRSRV_PIXEL_FORMAT_A16B16G16R16 = 95, /*!< type unspecified */ + PVRSRV_PIXEL_FORMAT_A16B16G16R16F = 96, /*!< type float */ + PVRSRV_PIXEL_FORMAT_A16B16G16R16_SINT = 97, /*!< signed ints */ + PVRSRV_PIXEL_FORMAT_A16B16G16R16_SNORM = 98, /*!< signed normalised int */ + PVRSRV_PIXEL_FORMAT_A16B16G16R16_UINT = 99, /*!< unsigned ints */ + PVRSRV_PIXEL_FORMAT_A16B16G16R16_UNORM = 100, /*!< normalised unsigned int */ + + /* 2 component, 16 bits per component types */ + PVRSRV_PIXEL_FORMAT_G16R16 = 101, /*!< unspecified type */ + PVRSRV_PIXEL_FORMAT_G16R16F = 102, /*!< float type */ + PVRSRV_PIXEL_FORMAT_G16R16_UINT = 103, /*!< unsigned int type */ + PVRSRV_PIXEL_FORMAT_G16R16_UNORM = 104, /*!< unsigned normalised */ + PVRSRV_PIXEL_FORMAT_G16R16_SINT = 105, /*!< signed int */ + PVRSRV_PIXEL_FORMAT_G16R16_SNORM = 106, /*!< signed normalised */ + + /* 1 component, 16 bits per component types */ + PVRSRV_PIXEL_FORMAT_R16 = 107, /*!< type unspecified */ + PVRSRV_PIXEL_FORMAT_R16F = 108, /*!< float type */ + PVRSRV_PIXEL_FORMAT_R16_UINT = 109, /*!< unsigned int type */ + PVRSRV_PIXEL_FORMAT_R16_UNORM = 110, /*!< unsigned normalised int type */ + PVRSRV_PIXEL_FORMAT_R16_SINT = 111, /*!< signed int type */ + PVRSRV_PIXEL_FORMAT_R16_SNORM = 112, /*!< signed normalised int type */ + + /* 4 component, 8 bits per component types */ + PVRSRV_PIXEL_FORMAT_X8R8G8B8 = 113, /*!< type unspecified */ + PVRSRV_PIXEL_FORMAT_X8R8G8B8_UNORM = 114, /*!< normalised unsigned int */ + PVRSRV_PIXEL_FORMAT_X8R8G8B8_UNORM_SRGB = 115, /*!< normalised uint with sRGB */ + + PVRSRV_PIXEL_FORMAT_A8R8G8B8 = 116, /*!< type unspecified */ + PVRSRV_PIXEL_FORMAT_A8R8G8B8_UNORM = 117, /*!< normalised unsigned int */ + PVRSRV_PIXEL_FORMAT_A8R8G8B8_UNORM_SRGB = 118, /*!< normalised uint with sRGB */ + + PVRSRV_PIXEL_FORMAT_A8B8G8R8 = 119, /*!< type unspecified */ + PVRSRV_PIXEL_FORMAT_A8B8G8R8_UINT = 120, /*!< unsigned int */ + PVRSRV_PIXEL_FORMAT_A8B8G8R8_UNORM = 121, /*!< normalised unsigned int */ + PVRSRV_PIXEL_FORMAT_A8B8G8R8_UNORM_SRGB = 122, /*!< normalised unsigned int */ + PVRSRV_PIXEL_FORMAT_A8B8G8R8_SINT = 123, /*!< signed int */ + PVRSRV_PIXEL_FORMAT_A8B8G8R8_SNORM = 124, /*!< normalised signed int */ + + /* 2 component, 8 bits per component types */ + PVRSRV_PIXEL_FORMAT_G8R8 = 125, /*!< type unspecified */ + PVRSRV_PIXEL_FORMAT_G8R8_UINT = 126, /*!< unsigned int type */ + PVRSRV_PIXEL_FORMAT_G8R8_UNORM = 127, /*!< unsigned int normalised */ + PVRSRV_PIXEL_FORMAT_G8R8_SINT = 128, /*!< signed int type */ + PVRSRV_PIXEL_FORMAT_G8R8_SNORM = 129, /*!< signed int normalised */ + + /* 1 component, 8 bits per component types */ + PVRSRV_PIXEL_FORMAT_A8 = 130, /*!< type unspecified, alpha channel */ + PVRSRV_PIXEL_FORMAT_R8 = 131, /*!< type unspecified */ + PVRSRV_PIXEL_FORMAT_R8_UINT = 132, /*!< unsigned int */ + PVRSRV_PIXEL_FORMAT_R8_UNORM = 133, /*!< unsigned normalised int */ + PVRSRV_PIXEL_FORMAT_R8_SINT = 134, /*!< signed int */ + PVRSRV_PIXEL_FORMAT_R8_SNORM = 135, /*!< signed normalised int */ + + /* A2RGB10 types */ + PVRSRV_PIXEL_FORMAT_A2B10G10R10 = 136, /*!< Type unspecified */ + PVRSRV_PIXEL_FORMAT_A2B10G10R10_UNORM = 137, /*!< normalised unsigned int */ + PVRSRV_PIXEL_FORMAT_A2B10G10R10_UINT = 138, /*!< unsigned int */ + + /* F11F11F10 types */ + PVRSRV_PIXEL_FORMAT_B10G11R11 = 139, /*!< type unspecified */ + PVRSRV_PIXEL_FORMAT_B10G11R11F = 140, /*!< float type */ + + /* esoteric types */ + PVRSRV_PIXEL_FORMAT_X24G8R32 = 141, /*!< 64 bit, type unspecified (Usually typed to D32S8 style) */ + PVRSRV_PIXEL_FORMAT_G8R24 = 142, /*!< 32 bit, type unspecified (Usually typed to D24S8 style) */ PVRSRV_PIXEL_FORMAT_X8R24 = 143, - PVRSRV_PIXEL_FORMAT_E5B9G9R9 = 144, - PVRSRV_PIXEL_FORMAT_R1 = 145, + PVRSRV_PIXEL_FORMAT_E5B9G9R9 = 144, /*!< 32 bit, shared exponent (RGBE). */ + PVRSRV_PIXEL_FORMAT_R1 = 145, /*!< 1 bit monochrome */ PVRSRV_PIXEL_FORMAT_RESERVED6 = 146, PVRSRV_PIXEL_FORMAT_RESERVED7 = 147, @@ -516,20 +564,20 @@ typedef enum _PVRSRV_PIXEL_FORMAT_ { PVRSRV_PIXEL_FORMAT_RESERVED19 = 159, PVRSRV_PIXEL_FORMAT_RESERVED20 = 160, - - PVRSRV_PIXEL_FORMAT_UBYTE4 = 161, - PVRSRV_PIXEL_FORMAT_SHORT4 = 162, - PVRSRV_PIXEL_FORMAT_SHORT4N = 163, - PVRSRV_PIXEL_FORMAT_USHORT4N = 164, - PVRSRV_PIXEL_FORMAT_SHORT2N = 165, - PVRSRV_PIXEL_FORMAT_SHORT2 = 166, - PVRSRV_PIXEL_FORMAT_USHORT2N = 167, - PVRSRV_PIXEL_FORMAT_UDEC3 = 168, - PVRSRV_PIXEL_FORMAT_DEC3N = 169, - PVRSRV_PIXEL_FORMAT_F16_2 = 170, - PVRSRV_PIXEL_FORMAT_F16_4 = 171, - - + /* DXLegacy vertex types */ + PVRSRV_PIXEL_FORMAT_UBYTE4 = 161, /*!< 4 channels, 1 byte per channel, normalised */ + PVRSRV_PIXEL_FORMAT_SHORT4 = 162, /*!< 4 signed channels, 16 bits each, unnormalised */ + PVRSRV_PIXEL_FORMAT_SHORT4N = 163, /*!< 4 signed channels, 16 bits each, normalised */ + PVRSRV_PIXEL_FORMAT_USHORT4N = 164, /*!< 4 unsigned channels, 16 bits each, normalised */ + PVRSRV_PIXEL_FORMAT_SHORT2N = 165, /*!< 2 signed channels, 16 bits each, normalised */ + PVRSRV_PIXEL_FORMAT_SHORT2 = 166, /*!< 2 signed channels, 16 bits each, unnormalised */ + PVRSRV_PIXEL_FORMAT_USHORT2N = 167, /*!< 2 unsigned channels, 16 bits each, normalised */ + PVRSRV_PIXEL_FORMAT_UDEC3 = 168, /*!< 3 10-bit channels, unnormalised, unsigned*/ + PVRSRV_PIXEL_FORMAT_DEC3N = 169, /*!< 3 10-bit channels, signed normalised */ + PVRSRV_PIXEL_FORMAT_F16_2 = 170, /*!< 2 F16 channels */ + PVRSRV_PIXEL_FORMAT_F16_4 = 171, /*!< 4 F16 channels */ + + /* misc float types */ PVRSRV_PIXEL_FORMAT_L_F16 = 172, PVRSRV_PIXEL_FORMAT_L_F16_REP = 173, PVRSRV_PIXEL_FORMAT_L_F16_A_F16 = 174, @@ -540,7 +588,7 @@ typedef enum _PVRSRV_PIXEL_FORMAT_ { PVRSRV_PIXEL_FORMAT_A_F32 = 178, PVRSRV_PIXEL_FORMAT_L_F32_A_F32 = 179, - + /* powervr types */ PVRSRV_PIXEL_FORMAT_PVRTC2 = 180, PVRSRV_PIXEL_FORMAT_PVRTC4 = 181, PVRSRV_PIXEL_FORMAT_PVRTCII2 = 182, @@ -557,7 +605,7 @@ typedef enum _PVRSRV_PIXEL_FORMAT_ { PVRSRV_PIXEL_FORMAT_MONO8 = 193, PVRSRV_PIXEL_FORMAT_MONO16 = 194, - + /* additional YUV types */ PVRSRV_PIXEL_FORMAT_C0_YUYV = 195, PVRSRV_PIXEL_FORMAT_C0_UYVY = 196, PVRSRV_PIXEL_FORMAT_C0_YVYU = 197, @@ -567,7 +615,7 @@ typedef enum _PVRSRV_PIXEL_FORMAT_ { PVRSRV_PIXEL_FORMAT_C1_YVYU = 201, PVRSRV_PIXEL_FORMAT_C1_VYUY = 202, - + /* planar YUV types */ PVRSRV_PIXEL_FORMAT_C0_YUV420_2P_UV = 203, PVRSRV_PIXEL_FORMAT_C0_YUV420_2P_VU = 204, PVRSRV_PIXEL_FORMAT_C0_YUV420_3P = 205, @@ -583,7 +631,7 @@ typedef enum _PVRSRV_PIXEL_FORMAT_ { PVRSRV_PIXEL_FORMAT_ABGR1555 = 213, PVRSRV_PIXEL_FORMAT_BGR565 = 214, - + /* 4k aligned planar YUV */ PVRSRV_PIXEL_FORMAT_C0_4KYUV420_2P_UV = 215, PVRSRV_PIXEL_FORMAT_C0_4KYUV420_2P_VU = 216, PVRSRV_PIXEL_FORMAT_C1_4KYUV420_2P_UV = 217, @@ -601,6 +649,10 @@ typedef enum _PVRSRV_PIXEL_FORMAT_ { } PVRSRV_PIXEL_FORMAT; +/*! + ***************************************************************************** + * Enumeration of possible alpha types. + *****************************************************************************/ typedef enum _PVRSRV_ALPHA_FORMAT_ { PVRSRV_ALPHA_FORMAT_UNKNOWN = 0x00000000, PVRSRV_ALPHA_FORMAT_PRE = 0x00000001, @@ -608,6 +660,10 @@ typedef enum _PVRSRV_ALPHA_FORMAT_ { PVRSRV_ALPHA_FORMAT_MASK = 0x0000000F, } PVRSRV_ALPHA_FORMAT; +/*! + ***************************************************************************** + * Enumeration of possible alpha types. + *****************************************************************************/ typedef enum _PVRSRV_COLOURSPACE_FORMAT_ { PVRSRV_COLOURSPACE_FORMAT_UNKNOWN = 0x00000000, PVRSRV_COLOURSPACE_FORMAT_LINEAR = 0x00010000, @@ -616,6 +672,10 @@ typedef enum _PVRSRV_COLOURSPACE_FORMAT_ { } PVRSRV_COLOURSPACE_FORMAT; +/* + * Drawable orientation (in degrees clockwise). + * Opposite sense from WSEGL. + */ typedef enum _PVRSRV_ROTATION_ { PVRSRV_ROTATE_0 = 0, PVRSRV_ROTATE_90 = 1, @@ -625,55 +685,83 @@ typedef enum _PVRSRV_ROTATION_ { } PVRSRV_ROTATION; +/*! + * Flags for DisplayClassCreateSwapChain. + */ #define PVRSRV_CREATE_SWAPCHAIN_SHARED (1<<0) #define PVRSRV_CREATE_SWAPCHAIN_QUERY (1<<1) #define PVRSRV_CREATE_SWAPCHAIN_OEMOVERLAY (1<<2) +/*! + ***************************************************************************** + * Structure providing implementation details for serialisation and + * synchronisation of operations. This is the fundamental unit on which operations + * are synced, and would typically be included in any data structures that require + * serialised accesses etc. e.g. MEM_INFO structures + * + *****************************************************************************/ +/* + Sync Data to be shared/mapped between user/kernel +*/ typedef struct _PVRSRV_SYNC_DATA_ { - + /* CPU accessible WriteOp Info */ IMG_UINT32 ui32WriteOpsPending; volatile IMG_UINT32 ui32WriteOpsComplete; - + /* CPU accessible ReadOp Info */ IMG_UINT32 ui32ReadOpsPending; volatile IMG_UINT32 ui32ReadOpsComplete; - + /* CPU accessible ReadOp2 Info */ + IMG_UINT32 ui32ReadOps2Pending; + volatile IMG_UINT32 ui32ReadOps2Complete; + + /* pdump specific value */ IMG_UINT32 ui32LastOpDumpVal; IMG_UINT32 ui32LastReadOpDumpVal; + /* Last write oprtation on this sync */ + IMG_UINT64 ui64LastWrite; + } PVRSRV_SYNC_DATA; +/* + Client Sync Info structure +*/ typedef struct _PVRSRV_CLIENT_SYNC_INFO_ { - + /* mapping of the kernel sync data */ PVRSRV_SYNC_DATA *psSyncData; - - - - + /* Device accessible WriteOp Info */ IMG_DEV_VIRTADDR sWriteOpsCompleteDevVAddr; - + /* Device accessible ReadOp Info */ IMG_DEV_VIRTADDR sReadOpsCompleteDevVAddr; - + /* Device accessible ReadOp2 Info */ + IMG_DEV_VIRTADDR sReadOps2CompleteDevVAddr; + + /* handle to client mapping data (OS specific) */ #if defined (SUPPORT_SID_INTERFACE) IMG_SID hMappingInfo; - + /* handle to kernel sync info */ IMG_SID hKernelSyncInfo; #else IMG_HANDLE hMappingInfo; - + /* handle to kernel sync info */ IMG_HANDLE hKernelSyncInfo; #endif } PVRSRV_CLIENT_SYNC_INFO, *PPVRSRV_CLIENT_SYNC_INFO; +/*! + ***************************************************************************** + * Resource locking structure + *****************************************************************************/ typedef struct PVRSRV_RESOURCE_TAG { volatile IMG_UINT32 ui32Lock; @@ -682,13 +770,18 @@ typedef struct PVRSRV_RESOURCE_TAG typedef PVRSRV_RESOURCE PVRSRV_RES_HANDLE; +/* command complete callback pfn prototype */ typedef IMG_VOID (*PFN_CMD_COMPLETE) (IMG_HANDLE); typedef IMG_VOID (**PPFN_CMD_COMPLETE) (IMG_HANDLE); +/* private command handler prototype */ typedef IMG_BOOL (*PFN_CMD_PROC) (IMG_HANDLE, IMG_UINT32, IMG_VOID*); typedef IMG_BOOL (**PPFN_CMD_PROC) (IMG_HANDLE, IMG_UINT32, IMG_VOID*); +/* + rectangle structure required by Lock API +*/ typedef struct _IMG_RECT_ { IMG_INT32 x0; @@ -706,6 +799,7 @@ typedef struct _IMG_RECT_16_ }IMG_RECT_16; +/* common pfn between BC/DC */ typedef PVRSRV_ERROR (*PFN_GET_BUFFER_ADDR)(IMG_HANDLE, IMG_HANDLE, IMG_SYS_PHYADDR**, @@ -716,6 +810,9 @@ typedef PVRSRV_ERROR (*PFN_GET_BUFFER_ADDR)(IMG_HANDLE, IMG_UINT32*); +/* + Display dimension structure definition +*/ typedef struct DISPLAY_DIMS_TAG { IMG_UINT32 ui32ByteStride; @@ -724,54 +821,66 @@ typedef struct DISPLAY_DIMS_TAG } DISPLAY_DIMS; +/* + Display format structure definition +*/ typedef struct DISPLAY_FORMAT_TAG { - + /* pixel format type */ PVRSRV_PIXEL_FORMAT pixelformat; } DISPLAY_FORMAT; +/* + Display Surface Attributes structure definition +*/ typedef struct DISPLAY_SURF_ATTRIBUTES_TAG { - + /* pixel format type */ PVRSRV_PIXEL_FORMAT pixelformat; - + /* dimensions information structure array */ DISPLAY_DIMS sDims; } DISPLAY_SURF_ATTRIBUTES; +/* + Display Mode information structure definition +*/ typedef struct DISPLAY_MODE_INFO_TAG { - + /* pixel format type */ PVRSRV_PIXEL_FORMAT pixelformat; - + /* dimensions information structure array */ DISPLAY_DIMS sDims; - + /* refresh rate of the display */ IMG_UINT32 ui32RefreshHZ; - + /* OEM specific flags */ IMG_UINT32 ui32OEMFlags; } DISPLAY_MODE_INFO; -#define MAX_DISPLAY_NAME_SIZE (50) +#define MAX_DISPLAY_NAME_SIZE (50) /* arbitrary choice! */ +/* + Display info structure definition +*/ typedef struct DISPLAY_INFO_TAG { - + /* max swapchains supported */ IMG_UINT32 ui32MaxSwapChains; - + /* max buffers in a swapchain */ IMG_UINT32 ui32MaxSwapChainBuffers; - + /* min swap interval supported */ IMG_UINT32 ui32MinSwapInterval; - + /* max swap interval supported */ IMG_UINT32 ui32MaxSwapInterval; - + /* physical dimensions of the display required for DPI calc. */ IMG_UINT32 ui32PhysicalWidthmm; IMG_UINT32 ui32PhysicalHeightmm; - + /* display name */ IMG_CHAR szDisplayName[MAX_DISPLAY_NAME_SIZE]; #if defined(SUPPORT_HW_CURSOR) - + /* cursor dimensions */ IMG_UINT16 ui32CursorWidth; IMG_UINT16 ui32CursorHeight; #endif @@ -781,7 +890,7 @@ typedef struct ACCESS_INFO_TAG { IMG_UINT32 ui32Size; IMG_UINT32 ui32FBPhysBaseAddress; - IMG_UINT32 ui32FBMemAvailable; + IMG_UINT32 ui32FBMemAvailable; /* size of usable FB memory */ IMG_UINT32 ui32SysPhysBaseAddress; IMG_UINT32 ui32SysSize; IMG_UINT32 ui32DevIRQ; @@ -790,6 +899,8 @@ typedef struct ACCESS_INFO_TAG #if defined(PDUMP_SUSPEND_IS_PER_THREAD) +/** Present only on WinMobile 6.5 */ + typedef struct { IMG_UINT32 threadId; IMG_INT suspendCount; @@ -798,9 +909,13 @@ typedef struct { #define PVRSRV_PDUMP_SUSPEND_Q_NAME "PVRSRVPDumpSuspendMsgQ" #define PVRSRV_PDUMP_SUSPEND_Q_LENGTH 8 -#endif +#endif /* defined(PDUMP_SUSPEND_IS_PER_THREAD) */ +/*! + ***************************************************************************** + * This structure is used for OS independent registry (profile) access + *****************************************************************************/ typedef struct _PVRSRV_REGISTRY_INFO_ { IMG_UINT32 ui32DevCookie; @@ -821,8 +936,9 @@ PVRSRV_ERROR IMG_CALLCONV PVRSRVWriteRegistryString (PPVRSRV_REGISTRY_INFO psReg #define PVRSRV_BC_FLAGS_YUVCSC_BT601 (0 << 1) #define PVRSRV_BC_FLAGS_YUVCSC_BT709 (1 << 1) -#define MAX_BUFFER_DEVICE_NAME_SIZE (50) +#define MAX_BUFFER_DEVICE_NAME_SIZE (50) /* arbitrary choice! */ +/* buffer information structure */ typedef struct BUFFER_INFO_TAG { IMG_UINT32 ui32BufferCount; @@ -843,4 +959,7 @@ typedef enum _OVERLAY_DEINTERLACE_MODE_ BOB_EVEN_NONINTERLEAVED } OVERLAY_DEINTERLACE_MODE; -#endif +#endif /* __SERVICESEXT_H__ */ +/***************************************************************************** + End of file (servicesext.h) +*****************************************************************************/ diff --git a/include4/sgx_options.h b/include4/sgx_options.h index d2ddff6..619e6e7 100644 --- a/include4/sgx_options.h +++ b/include4/sgx_options.h @@ -1,56 +1,89 @@ -/********************************************************************** +/*************************************************************************/ /*! +@Title +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description +@License Dual MIT/GPLv2 + +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION 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 32 flags (or up to 28 flags plus a numeric + * value in the range 0-15 which corresponds to the number of + * cores minus one if SGX_FEATURE_MP is defined). The corresponding + * bit is set if the build option was enabled at compile time. * - * Copyright (C) Imagination Technologies Ltd. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful but, except - * as otherwise stated in writing, 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., - * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * - * The full GNU General Public License is included in this distribution in - * the file called "COPYING". + * 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 SGX_BUILD_OPTIONS. * - * Contact Information: - * Imagination Technologies Ltd. - * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK - * - ******************************************************************************/ + * IMPORTANT: add new options to unused bits or define a new dword + * (e.g. SGX_BUILD_OPTIONS2) so that the bitfield remains backwards + * compatible. + */ + #if defined(DEBUG) || defined (INTERNAL_TEST) #define DEBUG_SET_OFFSET OPTIONS_BIT0 #define OPTIONS_BIT0 0x1U #else #define OPTIONS_BIT0 0x0 -#endif +#endif /* DEBUG */ #if defined(PDUMP) || defined (INTERNAL_TEST) #define PDUMP_SET_OFFSET OPTIONS_BIT1 #define OPTIONS_BIT1 (0x1U << 1) #else #define OPTIONS_BIT1 0x0 -#endif +#endif /* PDUMP */ #if defined(PVRSRV_USSE_EDM_STATUS_DEBUG) || defined (INTERNAL_TEST) #define PVRSRV_USSE_EDM_STATUS_DEBUG_SET_OFFSET OPTIONS_BIT2 #define OPTIONS_BIT2 (0x1U << 2) #else #define OPTIONS_BIT2 0x0 -#endif +#endif /* PVRSRV_USSE_EDM_STATUS_DEBUG */ #if defined(SUPPORT_HW_RECOVERY) || defined (INTERNAL_TEST) #define SUPPORT_HW_RECOVERY_SET_OFFSET OPTIONS_BIT3 #define OPTIONS_BIT3 (0x1U << 3) #else #define OPTIONS_BIT3 0x0 -#endif +#endif /* SUPPORT_HW_RECOVERY */ @@ -63,7 +96,7 @@ #define OPTIONS_BIT4 (0x1U << 4) #else #define OPTIONS_BIT4 0x0 -#endif +#endif /* PVR_SECURE_HANDLES */ #endif #if defined(SGX_BYPASS_SYSTEM_CACHE) || defined (INTERNAL_TEST) @@ -71,43 +104,37 @@ #define OPTIONS_BIT5 (0x1U << 5) #else #define OPTIONS_BIT5 0x0 -#endif +#endif /* SGX_BYPASS_SYSTEM_CACHE */ #if defined(SGX_DMS_AGE_ENABLE) || defined (INTERNAL_TEST) #define SGX_DMS_AGE_ENABLE_SET_OFFSET OPTIONS_BIT6 #define OPTIONS_BIT6 (0x1U << 6) #else #define OPTIONS_BIT6 0x0 -#endif +#endif /* SGX_DMS_AGE_ENABLE */ #if defined(SGX_FAST_DPM_INIT) || defined (INTERNAL_TEST) #define SGX_FAST_DPM_INIT_SET_OFFSET OPTIONS_BIT8 #define OPTIONS_BIT8 (0x1U << 8) #else #define OPTIONS_BIT8 0x0 -#endif +#endif /* SGX_FAST_DPM_INIT */ #if defined(SGX_FEATURE_WRITEBACK_DCU) || defined (INTERNAL_TEST) #define SGX_FEATURE_DCU_SET_OFFSET OPTIONS_BIT9 #define OPTIONS_BIT9 (0x1U << 9) #else #define OPTIONS_BIT9 0x0 -#endif +#endif /* SGX_FEATURE_WRITEBACK_DCU */ #if defined(SGX_FEATURE_MP) || defined (INTERNAL_TEST) #define SGX_FEATURE_MP_SET_OFFSET OPTIONS_BIT10 #define OPTIONS_BIT10 (0x1U << 10) #else #define OPTIONS_BIT10 0x0 -#endif +#endif /* SGX_FEATURE_MP */ -#if defined(SGX_FEATURE_MULTITHREADED_UKERNEL) || defined (INTERNAL_TEST) -#define SGX_FEATURE_MULTITHREADED_UKERNEL_SET_OFFSET OPTIONS_BIT11 -#define OPTIONS_BIT11 (0x1U << 11) -#else #define OPTIONS_BIT11 0x0 -#endif - #if defined(SGX_FEATURE_OVERLAPPED_SPM) || defined (INTERNAL_TEST) @@ -115,7 +142,7 @@ #define OPTIONS_BIT12 (0x1U << 12) #else #define OPTIONS_BIT12 0x0 -#endif +#endif /* SGX_FEATURE_RENDER_TARGET_ARRAYS */ #if defined(SGX_FEATURE_SYSTEM_CACHE) || defined (INTERNAL_TEST) @@ -123,14 +150,14 @@ #define OPTIONS_BIT13 (0x1U << 13) #else #define OPTIONS_BIT13 0x0 -#endif +#endif /* SGX_FEATURE_SYSTEM_CACHE */ #if defined(SGX_SUPPORT_HWPROFILING) || defined (INTERNAL_TEST) #define SGX_SUPPORT_HWPROFILING_SET_OFFSET OPTIONS_BIT14 #define OPTIONS_BIT14 (0x1U << 14) #else #define OPTIONS_BIT14 0x0 -#endif +#endif /* SGX_SUPPORT_HWPROFILING */ @@ -139,28 +166,28 @@ #define OPTIONS_BIT15 (0x1U << 15) #else #define OPTIONS_BIT15 0x0 -#endif +#endif /* SUPPORT_ACTIVE_POWER_MANAGEMENT */ #if defined(SUPPORT_DISPLAYCONTROLLER_TILING) || defined (INTERNAL_TEST) #define SUPPORT_DISPLAYCONTROLLER_TILING_SET_OFFSET OPTIONS_BIT16 #define OPTIONS_BIT16 (0x1U << 16) #else #define OPTIONS_BIT16 0x0 -#endif +#endif /* SUPPORT_DISPLAYCONTROLLER_TILING */ #if defined(SUPPORT_PERCONTEXT_PB) || defined (INTERNAL_TEST) #define SUPPORT_PERCONTEXT_PB_SET_OFFSET OPTIONS_BIT17 #define OPTIONS_BIT17 (0x1U << 17) #else #define OPTIONS_BIT17 0x0 -#endif +#endif /* SUPPORT_PERCONTEXT_PB */ #if defined(SUPPORT_SGX_HWPERF) || defined (INTERNAL_TEST) #define SUPPORT_SGX_HWPERF_SET_OFFSET OPTIONS_BIT18 #define OPTIONS_BIT18 (0x1U << 18) #else #define OPTIONS_BIT18 0x0 -#endif +#endif /* SUPPORT_SGX_HWPERF */ @@ -169,28 +196,28 @@ #define OPTIONS_BIT19 (0x1U << 19) #else #define OPTIONS_BIT19 0x0 -#endif +#endif /* SUPPORT_SGX_MMU_DUMMY_PAGE */ #if defined(SUPPORT_SGX_PRIORITY_SCHEDULING) || defined (INTERNAL_TEST) #define SUPPORT_SGX_PRIORITY_SCHEDULING_SET_OFFSET OPTIONS_BIT20 #define OPTIONS_BIT20 (0x1U << 20) #else #define OPTIONS_BIT20 0x0 -#endif +#endif /* SUPPORT_SGX_PRIORITY_SCHEDULING */ #if defined(SUPPORT_SGX_LOW_LATENCY_SCHEDULING) || defined (INTERNAL_TEST) #define SUPPORT_SGX_LOW_LATENCY_SCHEDULING_SET_OFFSET OPTIONS_BIT21 #define OPTIONS_BIT21 (0x1U << 21) #else #define OPTIONS_BIT21 0x0 -#endif +#endif /* SUPPORT_SGX_LOW_LATENCY_SCHEDULING */ #if defined(USE_SUPPORT_NO_TA3D_OVERLAP) || defined (INTERNAL_TEST) #define USE_SUPPORT_NO_TA3D_OVERLAP_SET_OFFSET OPTIONS_BIT22 #define OPTIONS_BIT22 (0x1U << 22) #else #define OPTIONS_BIT22 0x0 -#endif +#endif /* USE_SUPPORT_NO_TA3D_OVERLAP */ #if defined(SGX_FEATURE_MP) || defined (INTERNAL_TEST) #if defined(SGX_FEATURE_MP_CORE_COUNT) @@ -204,9 +231,9 @@ #define SGX_FEATURE_MP_CORE_COUNT_SET_OFFSET_3D 28UL #define SGX_FEATURE_MP_CORE_COUNT_SET_MASK 0xFF #endif -#else +#else /* SGX_FEATURE_MP */ #define OPTIONS_HIGHBYTE 0x0 -#endif +#endif /* SGX_FEATURE_MP */ diff --git a/include4/sgxapi_km.h b/include4/sgxapi_km.h index dcbafbf..bb8776a 100644 --- a/include4/sgxapi_km.h +++ b/include4/sgxapi_km.h @@ -1,28 +1,44 @@ -/********************************************************************** - * - * Copyright (C) Imagination Technologies Ltd. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful but, except - * as otherwise stated in writing, 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., - * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * - * The full GNU General Public License is included in this distribution in - * the file called "COPYING". - * - * Contact Information: - * Imagination Technologies Ltd. - * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK - * - ******************************************************************************/ +/*************************************************************************/ /*! +@Title SGX KM API Header +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description Exported SGX 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 __SGXAPI_KM_H__ #define __SGXAPI_KM_H__ @@ -41,6 +57,11 @@ extern "C" { #endif #endif +/****************************************************************************** + Some defines... +******************************************************************************/ + +/* SGX Heap IDs, note: not all heaps are available to clients */ #define SGX_UNDEFINED_HEAP_ID (~0LU) #define SGX_GENERAL_HEAP_ID 0 #define SGX_TADATA_HEAP_ID 1 @@ -58,18 +79,27 @@ extern "C" { #endif #if defined(SGX_FEATURE_2D_HARDWARE) #define SGX_2D_HEAP_ID 12 -#else -#if defined(FIX_HW_BRN_26915) -#define SGX_CGBUFFER_HEAP_ID 13 #endif +#if defined(SUPPORT_MEMORY_TILING) +#define SGX_VPB_TILED_HEAP_ID 14 +#endif +#if defined(SUPPORT_ION) +#define SGX_ION_HEAP_ID 15 #endif -#define SGX_MAX_HEAP_ID 14 +#define SGX_MAX_HEAP_ID 16 + +/* + * Keep SGX_3DPARAMETERS_HEAP_ID as TQ full custom + * shaders need it to select which heap to write + * their ISP controll stream to. + */ #if (defined(SUPPORT_PERCONTEXT_PB) || defined(SUPPORT_HYBRID_PB)) #define SGX_3DPARAMETERS_HEAP_ID SGX_PERCONTEXT_3DPARAMETERS_HEAP_ID #else #define SGX_3DPARAMETERS_HEAP_ID SGX_SHARED_3DPARAMETERS_HEAP_ID #endif +/* Define for number of bytes between consecutive code base registers */ #if defined(SGX543) || defined(SGX544) || defined(SGX554) #define SGX_USE_CODE_SEGMENT_RANGE_BITS 23 #else @@ -80,12 +110,18 @@ extern "C" { #define SGX_MAX_3D_STATUS_VALS 4 #if defined(SUPPORT_SGX_GENERALISED_SYNCOBJECTS) +/* sync info structure array size */ #define SGX_MAX_TA_DST_SYNCS 1 #define SGX_MAX_TA_SRC_SYNCS 1 #define SGX_MAX_3D_SRC_SYNCS 4 +/* note: there is implicitly 1 3D Dst Sync */ #else -#define SGX_MAX_SRC_SYNCS 8 -#define SGX_MAX_DST_SYNCS 1 +/* sync info structure array size */ +#define SGX_MAX_SRC_SYNCS_TA 32 +#define SGX_MAX_DST_SYNCS_TA 1 +/* note: there is implicitly 1 3D Dst Sync */ +#define SGX_MAX_SRC_SYNCS_TQ 8 +#define SGX_MAX_DST_SYNCS_TQ 1 #endif @@ -95,7 +131,7 @@ extern "C" { #else #define PVRSRV_SGX_HWPERF_NUM_COUNTERS 9 #define PVRSRV_SGX_HWPERF_NUM_MISC_COUNTERS 8 -#endif +#endif /* SGX543 */ #define PVRSRV_SGX_HWPERF_INVALID 0x1 @@ -165,6 +201,10 @@ extern "C" { #define PVRSRV_SGX_HWPERF_STATUS_MK_EXECUTION_ON (1UL << 3) +/*! + ***************************************************************************** + * One entry in the HWPerf Circular Buffer. + *****************************************************************************/ typedef struct _PVRSRV_SGX_HWPERF_CB_ENTRY_ { IMG_UINT32 ui32FrameNo; @@ -174,12 +214,15 @@ typedef struct _PVRSRV_SGX_HWPERF_CB_ENTRY_ IMG_UINT32 ui32Ordinal; IMG_UINT32 ui32Info; IMG_UINT32 ui32Clocksx16; - + /* NOTE: There should always be at least as many 3D cores as TA cores. */ IMG_UINT32 ui32Counters[SGX_FEATURE_MP_CORE_COUNT_3D][PVRSRV_SGX_HWPERF_NUM_COUNTERS]; IMG_UINT32 ui32MiscCounters[SGX_FEATURE_MP_CORE_COUNT_3D][PVRSRV_SGX_HWPERF_NUM_MISC_COUNTERS]; } PVRSRV_SGX_HWPERF_CB_ENTRY; +/* + Status values control structure +*/ typedef struct _CTL_STATUS_ { IMG_DEV_VIRTADDR sStatusDevAddr; @@ -187,6 +230,9 @@ typedef struct _CTL_STATUS_ } CTL_STATUS; +/*! + List of possible requests/commands to SGXGetMiscInfo() +*/ typedef enum _SGX_MISC_INFO_REQUEST_ { SGX_MISC_INFO_REQUEST_CLOCKSPEED = 0, @@ -195,14 +241,15 @@ typedef enum _SGX_MISC_INFO_REQUEST_ #if defined(SUPPORT_SGX_EDM_MEMORY_DEBUG) SGX_MISC_INFO_REQUEST_MEMREAD, SGX_MISC_INFO_REQUEST_MEMCOPY, -#endif +#endif /* SUPPORT_SGX_EDM_MEMORY_DEBUG */ SGX_MISC_INFO_REQUEST_SET_HWPERF_STATUS, #if defined(SGX_FEATURE_DATA_BREAKPOINTS) SGX_MISC_INFO_REQUEST_SET_BREAKPOINT, SGX_MISC_INFO_REQUEST_POLL_BREAKPOINT, SGX_MISC_INFO_REQUEST_RESUME_BREAKPOINT, -#endif +#endif /* SGX_FEATURE_DATA_BREAKPOINTS */ SGX_MISC_INFO_DUMP_DEBUG_INFO, + SGX_MISC_INFO_DUMP_DEBUG_INFO_FORCE_REGS, SGX_MISC_INFO_PANIC, SGX_MISC_INFO_REQUEST_SPM, SGX_MISC_INFO_REQUEST_ACTIVEPOWER, @@ -211,66 +258,84 @@ typedef enum _SGX_MISC_INFO_REQUEST_ } SGX_MISC_INFO_REQUEST; +/****************************************************************************** + * Struct for passing SGX core rev/features from ukernel to driver. + * This is accessed from the kernel part of the driver and microkernel; it is + * only accessed in user space during buffer allocation in srvinit. + ******************************************************************************/ typedef struct _PVRSRV_SGX_MISCINFO_FEATURES { - IMG_UINT32 ui32CoreRev; - IMG_UINT32 ui32CoreID; - IMG_UINT32 ui32DDKVersion; - IMG_UINT32 ui32DDKBuild; - IMG_UINT32 ui32CoreIdSW; - IMG_UINT32 ui32CoreRevSW; - IMG_UINT32 ui32BuildOptions; + IMG_UINT32 ui32CoreRev; /*!< SGX Core revision from HW register */ + IMG_UINT32 ui32CoreID; /*!< SGX Core ID from HW register */ + IMG_UINT32 ui32DDKVersion; /*!< software DDK version */ + IMG_UINT32 ui32DDKBuild; /*!< software DDK build no. */ + IMG_UINT32 ui32CoreIdSW; /*!< software core version (ID), e.g. SGX535, SGX540 */ + IMG_UINT32 ui32CoreRevSW; /*!< software core revision */ + IMG_UINT32 ui32BuildOptions; /*!< build options bit-field */ #if defined(SUPPORT_SGX_EDM_MEMORY_DEBUG) - IMG_UINT32 ui32DeviceMemValue; + IMG_UINT32 ui32DeviceMemValue; /*!< device mem value read from ukernel */ #endif #if defined(PVRSRV_USSE_EDM_STATUS_DEBUG) - IMG_DEV_VIRTADDR sDevVAEDMStatusBuffer; - IMG_PVOID pvEDMStatusBuffer; + IMG_DEV_VIRTADDR sDevVAEDMStatusBuffer; /*!< DevVAddr of the EDM status buffer */ + IMG_PVOID pvEDMStatusBuffer; /*!< CPUVAddr of the EDM status buffer */ #endif } PVRSRV_SGX_MISCINFO_FEATURES; +/****************************************************************************** + * Struct for getting lock-up stats from the kernel driver + ******************************************************************************/ typedef struct _PVRSRV_SGX_MISCINFO_LOCKUPS { - IMG_UINT32 ui32HostDetectedLockups; - IMG_UINT32 ui32uKernelDetectedLockups; + IMG_UINT32 ui32HostDetectedLockups; /*!< Host timer detected lockups */ + IMG_UINT32 ui32uKernelDetectedLockups; /*!< Microkernel detected lockups */ } PVRSRV_SGX_MISCINFO_LOCKUPS; +/****************************************************************************** + * Struct for getting lock-up stats from the kernel driver + ******************************************************************************/ typedef struct _PVRSRV_SGX_MISCINFO_ACTIVEPOWER { - IMG_UINT32 ui32NumActivePowerEvents; + IMG_UINT32 ui32NumActivePowerEvents; /*!< active power events */ } PVRSRV_SGX_MISCINFO_ACTIVEPOWER; +/****************************************************************************** + * Struct for getting SPM stats fro the kernel driver + ******************************************************************************/ typedef struct _PVRSRV_SGX_MISCINFO_SPM { - IMG_HANDLE hRTDataSet; - IMG_UINT32 ui32NumOutOfMemSignals; - IMG_UINT32 ui32NumSPMRenders; + IMG_HANDLE hRTDataSet; /*!< render target data set handle returned from SGXAddRenderTarget */ + IMG_UINT32 ui32NumOutOfMemSignals; /*!< Number of Out of Mem Signals */ + IMG_UINT32 ui32NumSPMRenders; /*!< Number of SPM renders */ } PVRSRV_SGX_MISCINFO_SPM; #if defined(SGX_FEATURE_DATA_BREAKPOINTS) +/*! + ****************************************************************************** + * Structure for SGX break points control + *****************************************************************************/ typedef struct _SGX_BREAKPOINT_INFO { - + /* set/clear BP boolean */ IMG_BOOL bBPEnable; - + /* Index of BP to set */ IMG_UINT32 ui32BPIndex; - + /* On which DataMaster(s) should the breakpoint fire? */ IMG_UINT32 ui32DataMasterMask; - + /* DevVAddr of BP to set */ IMG_DEV_VIRTADDR sBPDevVAddr, sBPDevVAddrEnd; - + /* Whether or not the desired breakpoint will be trapped */ IMG_BOOL bTrapped; - + /* Will the requested breakpoint fire for reads? */ IMG_BOOL bRead; - + /* Will the requested breakpoint fire for writes? */ IMG_BOOL bWrite; - + /* Has a breakpoint been trapped? */ IMG_BOOL bTrappedBP; - + /* Extra information recorded about a trapped breakpoint */ IMG_UINT32 ui32CoreNum; IMG_DEV_VIRTADDR sTrappedBPDevVAddr; IMG_UINT32 ui32TrappedBPBurstLength; @@ -278,38 +343,50 @@ typedef struct _SGX_BREAKPOINT_INFO IMG_UINT32 ui32TrappedBPDataMaster; IMG_UINT32 ui32TrappedBPTag; } SGX_BREAKPOINT_INFO; -#endif +#endif /* SGX_FEATURE_DATA_BREAKPOINTS */ +/*! + ****************************************************************************** + * Structure for setting the hardware performance status + *****************************************************************************/ typedef struct _PVRSRV_SGX_MISCINFO_SET_HWPERF_STATUS { - + /* See PVRSRV_SGX_HWPERF_STATUS_* */ IMG_UINT32 ui32NewHWPerfStatus; #if defined(SGX_FEATURE_EXTENDED_PERF_COUNTERS) - + /* Specifies the HW's active group selectors */ IMG_UINT32 aui32PerfGroup[PVRSRV_SGX_HWPERF_NUM_COUNTERS]; - + /* Specifies the HW's active bit selectors */ IMG_UINT32 aui32PerfBit[PVRSRV_SGX_HWPERF_NUM_COUNTERS]; + /* Specifies the HW's counter bit selectors */ + IMG_UINT32 ui32PerfCounterBitSelect; + /* Specifies the HW's sum_mux selectors */ + IMG_UINT32 ui32PerfSumMux; #else - + /* Specifies the HW's active group */ IMG_UINT32 ui32PerfGroup; - #endif + #endif /* SGX_FEATURE_EXTENDED_PERF_COUNTERS */ } PVRSRV_SGX_MISCINFO_SET_HWPERF_STATUS; +/*! + ****************************************************************************** + * Structure for misc SGX commands in services + *****************************************************************************/ typedef struct _SGX_MISC_INFO_ { - SGX_MISC_INFO_REQUEST eRequest; + SGX_MISC_INFO_REQUEST eRequest; /*!< Command request to SGXGetMiscInfo() */ IMG_UINT32 ui32Padding; #if defined(SUPPORT_SGX_EDM_MEMORY_DEBUG) - IMG_DEV_VIRTADDR sDevVAddrSrc; - IMG_DEV_VIRTADDR sDevVAddrDest; - IMG_HANDLE hDevMemContext; + IMG_DEV_VIRTADDR sDevVAddrSrc; /*!< dev virtual addr for mem read */ + IMG_DEV_VIRTADDR sDevVAddrDest; /*!< dev virtual addr for mem write */ + IMG_HANDLE hDevMemContext; /*!< device memory context for mem debug */ #endif union { - IMG_UINT32 reserved; + IMG_UINT32 reserved; /*!< Unused: ensures valid code in the case everything else is compiled out */ PVRSRV_SGX_MISCINFO_FEATURES sSGXFeatures; IMG_UINT32 ui32SGXClockSpeed; PVRSRV_SGX_MISCINFO_ACTIVEPOWER sActivePower; @@ -323,12 +400,19 @@ typedef struct _SGX_MISC_INFO_ } SGX_MISC_INFO; #if defined(SGX_FEATURE_2D_HARDWARE) +/* + * The largest number of source sync objects that can be associated with a blit + * command. Allows for src, pattern, and mask + */ #define PVRSRV_MAX_BLT_SRC_SYNCS 3 #endif #define SGX_KICKTA_DUMPBITMAP_MAX_NAME_LENGTH 256 +/* + Structure for dumping bitmaps +*/ typedef struct _SGX_KICKTA_DUMPBITMAP_ { IMG_DEV_VIRTADDR sDevBaseAddr; @@ -343,9 +427,13 @@ typedef struct _SGX_KICKTA_DUMPBITMAP_ #define PVRSRV_SGX_PDUMP_CONTEXT_MAX_BITMAP_ARRAY_SIZE (16) +/*! + ****************************************************************************** + * Data required only when dumping parameters + *****************************************************************************/ typedef struct _PVRSRV_SGX_PDUMP_CONTEXT_ { - + /* cache control word for micro kernel cache flush/invalidates */ IMG_UINT32 ui32CacheControl; } PVRSRV_SGX_PDUMP_CONTEXT; @@ -354,11 +442,11 @@ typedef struct _PVRSRV_SGX_PDUMP_CONTEXT_ #if !defined (SUPPORT_SID_INTERFACE) typedef struct _SGX_KICKTA_DUMP_ROFF_ { - IMG_HANDLE hKernelMemInfo; - IMG_UINT32 uiAllocIndex; - IMG_UINT32 ui32Offset; - IMG_UINT32 ui32Value; - IMG_PCHAR pszName; + IMG_HANDLE hKernelMemInfo; /*< Buffer handle */ + IMG_UINT32 uiAllocIndex; /*< Alloc index for LDDM */ + IMG_UINT32 ui32Offset; /*< Byte offset to value to dump */ + IMG_UINT32 ui32Value; /*< Actual value to dump */ + IMG_PCHAR pszName; /*< Name of buffer */ } SGX_KICKTA_DUMP_ROFF, *PSGX_KICKTA_DUMP_ROFF; #endif @@ -369,18 +457,24 @@ typedef struct _SGX_KICKTA_DUMP_BUFFER_ #endif { IMG_UINT32 ui32SpaceUsed; - IMG_UINT32 ui32Start; - IMG_UINT32 ui32End; - IMG_UINT32 ui32BufferSize; - IMG_UINT32 ui32BackEndLength; + IMG_UINT32 ui32Start; /*< Byte offset of start to dump */ + IMG_UINT32 ui32End; /*< Byte offset of end of dump (non-inclusive) */ + IMG_UINT32 ui32BufferSize; /*< Size of buffer */ + IMG_UINT32 ui32BackEndLength; /*< Size of back end portion, if End < Start */ IMG_UINT32 uiAllocIndex; - IMG_HANDLE hKernelMemInfo; + IMG_HANDLE hKernelMemInfo; /*< MemInfo handle for the circular buffer */ IMG_PVOID pvLinAddr; #if defined(SUPPORT_SGX_NEW_STATUS_VALS) - IMG_HANDLE hCtrlKernelMemInfo; - IMG_DEV_VIRTADDR sCtrlDevVAddr; + IMG_HANDLE hCtrlKernelMemInfo; /*< MemInfo handle for the control structure of the + circular buffer */ + IMG_DEV_VIRTADDR sCtrlDevVAddr; /*< Device virtual address of the memory in the + control structure to be checked */ +#endif + IMG_PCHAR pszName; /*< Name of buffer */ + +#if defined (__QNXNTO__) + IMG_UINT32 ui32NameLength; /*< Number of characters in buffer name */ #endif - IMG_PCHAR pszName; #if defined (SUPPORT_SID_INTERFACE) } SGX_KICKTA_DUMP_BUFFER_KM, *PSGX_KICKTA_DUMP_BUFFER_KM; #else @@ -389,25 +483,29 @@ typedef struct _SGX_KICKTA_DUMP_BUFFER_ #if !defined (SUPPORT_SID_INTERFACE) #ifdef PDUMP +/* + PDUMP version of above kick structure +*/ typedef struct _SGX_KICKTA_PDUMP_ { - + // Bitmaps to dump PSGX_KICKTA_DUMPBITMAP psPDumpBitmapArray; IMG_UINT32 ui32PDumpBitmapSize; - + // Misc buffers to dump (e.g. TA, PDS etc..) PSGX_KICKTA_DUMP_BUFFER psBufferArray; IMG_UINT32 ui32BufferArraySize; - + // Roffs to dump PSGX_KICKTA_DUMP_ROFF psROffArray; IMG_UINT32 ui32ROffArraySize; } SGX_KICKTA_PDUMP, *PSGX_KICKTA_PDUMP; -#endif -#endif +#endif /* PDUMP */ +#endif /* #if !defined (SUPPORT_SID_INTERFACE) */ #if defined(TRANSFER_QUEUE) #if defined(SGX_FEATURE_2D_HARDWARE) +/* Maximum size of ctrl stream for 2d blit command (in 32 bit words) */ #define SGX_MAX_2D_BLIT_CMD_SIZE 26 #define SGX_MAX_2D_SRC_SYNC_OPS 3 #endif @@ -419,5 +517,8 @@ typedef struct _SGX_KICKTA_PDUMP_ } #endif -#endif +#endif /* __SGXAPI_KM_H__ */ +/****************************************************************************** + End of file (sgxapi_km.h) +******************************************************************************/ diff --git a/include4/sgxscript.h b/include4/sgxscript.h index df79e2f..46b89d2 100644 --- a/include4/sgxscript.h +++ b/include4/sgxscript.h @@ -1,29 +1,44 @@ -/********************************************************************** - * - * Copyright (C) Imagination Technologies Ltd. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful but, except - * as otherwise stated in writing, 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., - * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * - * The full GNU General Public License is included in this distribution in - * the file called "COPYING". - * - * Contact Information: - * Imagination Technologies Ltd. - * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK - * - ******************************************************************************/ +/*************************************************************************/ /*! +@Title SGX kernel services structues/functions +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description SGX 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 __SGXSCRIPT_H__ #define __SGXSCRIPT_H__ @@ -38,6 +53,7 @@ typedef enum _SGX_INIT_OPERATION { SGX_INIT_OP_ILLEGAL = 0, SGX_INIT_OP_WRITE_HW_REG, + SGX_INIT_OP_READ_HW_REG, #if defined(PDUMP) SGX_INIT_OP_PDUMP_HW_REG, #endif @@ -52,6 +68,10 @@ typedef union _SGX_INIT_COMMAND IMG_UINT32 ui32Offset; IMG_UINT32 ui32Value; } sWriteHWReg; + struct { + SGX_INIT_OPERATION eOp; + IMG_UINT32 ui32Offset; + } sReadHWReg; #if defined(PDUMP) struct { SGX_INIT_OPERATION eOp; @@ -59,11 +79,6 @@ typedef union _SGX_INIT_COMMAND IMG_UINT32 ui32Value; } sPDumpHWReg; #endif -#if defined(FIX_HW_BRN_22997) && defined(FIX_HW_BRN_23030) && defined(SGX_FEATURE_HOST_PORT) - struct { - SGX_INIT_OPERATION eOp; - } sWorkaroundBRN22997; -#endif } SGX_INIT_COMMAND; typedef struct _SGX_INIT_SCRIPTS_ @@ -77,5 +92,8 @@ typedef struct _SGX_INIT_SCRIPTS_ } #endif -#endif +#endif /* __SGXSCRIPT_H__ */ +/***************************************************************************** + End of file (sgxscript.h) +*****************************************************************************/ diff --git a/services4/3rdparty/bufferclass_example/Kbuild.mk b/services4/3rdparty/bufferclass_example/Kbuild.mk index 04938c1..8f5720e 100644 --- a/services4/3rdparty/bufferclass_example/Kbuild.mk +++ b/services4/3rdparty/bufferclass_example/Kbuild.mk @@ -1,28 +1,42 @@ -# -# Copyright (C) Imagination Technologies Ltd. All rights reserved. +########################################################################### ### +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 # -# This program is free software; you can redistribute it and/or modify it -# under the terms and conditions of the GNU General Public License, -# version 2, as published by the Free Software Foundation. +# The contents of this file are subject to the MIT license as set out below. # -# This program is distributed in the hope it will be useful but, except -# as otherwise stated in writing, 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. +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: # -# 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., -# 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. # -# The full GNU General Public License is included in this distribution in -# the file called "COPYING". -# -# Contact Information: -# Imagination Technologies Ltd. -# Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. # -# - +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION 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)/services4/3rdparty/bufferclass_example bc_example-y += \ diff --git a/services4/3rdparty/bufferclass_example/Linux.mk b/services4/3rdparty/bufferclass_example/Linux.mk index cb001fd..f2e44a6 100644 --- a/services4/3rdparty/bufferclass_example/Linux.mk +++ b/services4/3rdparty/bufferclass_example/Linux.mk @@ -1,27 +1,42 @@ -# -# Copyright (C) Imagination Technologies Ltd. All rights reserved. +########################################################################### ### +#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +#@License Dual MIT/GPLv2 # -# This program is free software; you can redistribute it and/or modify it -# under the terms and conditions of the GNU General Public License, -# version 2, as published by the Free Software Foundation. +# The contents of this file are subject to the MIT license as set out below. # -# This program is distributed in the hope it will be useful but, except -# as otherwise stated in writing, 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. +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: # -# 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., -# 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. # -# The full GNU General Public License is included in this distribution in -# the file called "COPYING". -# -# Contact Information: -# Imagination Technologies Ltd. -# Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK +# Alternatively, the contents of this file may be used under the terms of +# the GNU General Public License Version 2 ("GPL") in which case the provisions +# of GPL are applicable instead of those above. # -# +# If you wish to allow use of your version of this file only under the terms of +# GPL, and not to allow others to use your version of this file under the terms +# of the MIT license, indicate your decision by deleting the provisions above +# and replace them with the notice and other provisions required by GPL as set +# out in the file called "GPL-COPYING" included in this distribution. If you do +# not delete the provisions above, a recipient may use your version of this file +# under the terms of either the MIT license or GPL. +# +# This License is also included in this distribution in the file called +# "MIT-COPYING". +# +# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +# IN AN ACTION 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 := bufferclass_example diff --git a/services4/3rdparty/bufferclass_example/bufferclass_example.c b/services4/3rdparty/bufferclass_example/bufferclass_example.c index 5ac75ee..2669888 100644 --- a/services4/3rdparty/bufferclass_example/bufferclass_example.c +++ b/services4/3rdparty/bufferclass_example/bufferclass_example.c @@ -1,29 +1,68 @@ -/********************************************************************** - * - * Copyright (C) Imagination Technologies Ltd. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful but, except - * as otherwise stated in writing, 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., - * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * - * The full GNU General Public License is included in this distribution in - * the file called "COPYING". - * - * Contact Information: - * Imagination Technologies Ltd. - * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK - * - ******************************************************************************/ - +/*************************************************************************/ /*! +@Title bufferclass_example kernel 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. +*/ /**************************************************************************/ + +/************************************************************************** + The 3rd party driver is a specification of an API to integrate the IMG POWERVR + Services driver with a 3rd Party 'buffer device'. It is NOT a specification for + a 'buffer device' driver, rather a specification to extend the API for a + pre-existing driver for the 'buffer device' hardware. + + The 3rd party driver interface provides IMG POWERVR client drivers (e.g. PVR2D) + with an API abstraction of the system's underlying buffer device hardware, + allowing the client drivers to indirectly control the buffer device hardware + and access its associated memory. + + Functions of the API include + - query buffer device surface attributes (width, height, stride, pixel format, + CPU physical and virtual address) + + Note: having queried surface attributes the client drivers are able to map the + buffer device memory to any IMG POWERVR Services device by calling + PVRSRVMapDeviceClassMemory with the buffer device surface handle. + + This code is intended to be an example of how a pre-existing buffer device + driver may be extended to support the 3rd Party buffer device interface to + POWERVR Services + - IMG is not providing a buffer device driver implementation. + **************************************************************************/ #if defined(__linux__) #include #else @@ -36,38 +75,52 @@ #define BUFFERCLASS_DEVICE_NAME "Example Bufferclass Device (SW)" +/* top level 'hook ptr' */ static void *gpvAnchor = NULL; static PFN_BC_GET_PVRJTABLE pfnGetPVRJTable = IMG_NULL; +/* + Kernel services is a kernel module and must be loaded first. + This driver is also a kernel module and must be loaded after the pvr services module. + This driver should be able to retrieve the + address of the services PVRGetBufferClassJTable from (the already loaded) + kernel services module. +*/ + +/* returns anchor pointer */ BC_EXAMPLE_DEVINFO * GetAnchorPtr(void) { return (BC_EXAMPLE_DEVINFO *)gpvAnchor; } +/* sets anchor pointer */ static void SetAnchorPtr(BC_EXAMPLE_DEVINFO *psDevInfo) { gpvAnchor = (void *)psDevInfo; } +/* Open device function, called from services */ static PVRSRV_ERROR OpenBCDevice(IMG_UINT32 ui32DeviceID, IMG_HANDLE *phDevice) { BC_EXAMPLE_DEVINFO *psDevInfo; - - - + /* + bufferclass_example manages only one BufferClass device + therefore there is no need to track ID numbers. + */ UNREFERENCED_PARAMETER(ui32DeviceID); psDevInfo = GetAnchorPtr(); - + /* return handle to the devinfo */ *phDevice = (IMG_HANDLE)psDevInfo; return (PVRSRV_OK); } +/* Close device function, called from services */ static PVRSRV_ERROR CloseBCDevice(IMG_UINT32 ui32DeviceID, IMG_HANDLE hDevice) { UNREFERENCED_PARAMETER(hDevice); @@ -75,6 +128,8 @@ static PVRSRV_ERROR CloseBCDevice(IMG_UINT32 ui32DeviceID, IMG_HANDLE hDevice) return (PVRSRV_OK); } +/* Passes in the sync data for a buffer, and returns the handle */ +/* called from services */ static PVRSRV_ERROR GetBCBuffer(IMG_HANDLE hDevice, IMG_UINT32 ui32BufferNumber, PVRSRV_SYNC_DATA *psSyncData, @@ -103,6 +158,7 @@ static PVRSRV_ERROR GetBCBuffer(IMG_HANDLE hDevice, } +/* get buffer info function, called from services */ static PVRSRV_ERROR GetBCInfo(IMG_HANDLE hDevice, BUFFER_INFO *psBCInfo) { BC_EXAMPLE_DEVINFO *psDevInfo; @@ -120,6 +176,7 @@ static PVRSRV_ERROR GetBCInfo(IMG_HANDLE hDevice, BUFFER_INFO *psBCInfo) } +/* get buffer address function, called from services */ static PVRSRV_ERROR GetBCBufferAddr(IMG_HANDLE hDevice, IMG_HANDLE hBuffer, IMG_SYS_PHYADDR **ppsSysAddr, @@ -157,55 +214,67 @@ static PVRSRV_ERROR GetBCBufferAddr(IMG_HANDLE hDevice, } +/* + * Register the device with services module srvkm. + * This should only be done once at boot time. + */ BCE_ERROR BC_Example_Register(void) { BC_EXAMPLE_DEVINFO *psDevInfo; - - - - - + /* + - connect to services + - register with services + - allocate and setup private data structure + */ + /* + in kernel driver, data structures must be anchored to something for subsequent retrieval + this may be a single global pointer or TLS or something else - up to you + call API to retrieve this ptr + */ - - + /* + get the anchor pointer + */ psDevInfo = GetAnchorPtr(); if (psDevInfo == NULL) { - + /* allocate device info. structure */ psDevInfo = (BC_EXAMPLE_DEVINFO *)BCAllocKernelMem(sizeof(BC_EXAMPLE_DEVINFO)); if(!psDevInfo) { - return (BCE_ERROR_OUT_OF_MEMORY); + return (BCE_ERROR_OUT_OF_MEMORY);/* failure */ } - + /* set the top-level anchor */ SetAnchorPtr((void*)psDevInfo); - + /* set ref count */ psDevInfo->ulRefCount = 0; if(BCOpenPVRServices(&psDevInfo->hPVRServices) != BCE_OK) { - return (BCE_ERROR_INIT_FAILURE); + return (BCE_ERROR_INIT_FAILURE);/* failure */ } if(BCGetLibFuncAddr (psDevInfo->hPVRServices, "PVRGetBufferClassJTable", &pfnGetPVRJTable) != BCE_OK) { - return (BCE_ERROR_INIT_FAILURE); + return (BCE_ERROR_INIT_FAILURE);/* failure */ } - + /* got the kernel services function table */ if(!(*pfnGetPVRJTable)(&psDevInfo->sPVRJTable)) { - return (BCE_ERROR_INIT_FAILURE); + return (BCE_ERROR_INIT_FAILURE);/* failure */ } - + /* + Setup the devinfo + */ psDevInfo->ulNumBuffers = 0; @@ -213,10 +282,10 @@ BCE_ERROR BC_Example_Register(void) if(!psDevInfo->psSystemBuffer) { - return (BCE_ERROR_OUT_OF_MEMORY); + return (BCE_ERROR_OUT_OF_MEMORY);/* failure */ } - + /* Setup Buffer Info */ psDevInfo->sBufferInfo.pixelformat = PVRSRV_PIXEL_FORMAT_UNKNOWN; psDevInfo->sBufferInfo.ui32Width = 0; psDevInfo->sBufferInfo.ui32Height = 0; @@ -227,8 +296,9 @@ BCE_ERROR BC_Example_Register(void) strncpy(psDevInfo->sBufferInfo.szDeviceName, BUFFERCLASS_DEVICE_NAME, MAX_BUFFER_DEVICE_NAME_SIZE); - - + /* + Bsetup the BC Jtable so SRVKM can call into this driver + */ psDevInfo->sBCJTable.ui32TableSize = sizeof(PVRSRV_BC_SRV2BUFFER_KMJTABLE); psDevInfo->sBCJTable.pfnOpenBCDevice = OpenBCDevice; psDevInfo->sBCJTable.pfnCloseBCDevice = CloseBCDevice; @@ -237,52 +307,55 @@ BCE_ERROR BC_Example_Register(void) psDevInfo->sBCJTable.pfnGetBufferAddr = GetBCBufferAddr; - - + /* register device with services and retrieve device index */ + /* This example only registers 1 device, but for multiple buffer streams, register more devices */ if(psDevInfo->sPVRJTable.pfnPVRSRVRegisterBCDevice (&psDevInfo->sBCJTable, (IMG_UINT32*)&psDevInfo->ulDeviceID ) != PVRSRV_OK) { - return (BCE_ERROR_DEVICE_REGISTER_FAILED); + return (BCE_ERROR_DEVICE_REGISTER_FAILED);/* failure */ } } - + /* increment the ref count */ psDevInfo->ulRefCount++; - + /* return success */ return (BCE_OK); } +/* + * Unregister the device with services module srvkm. + */ BCE_ERROR BC_Example_Unregister(void) { BC_EXAMPLE_DEVINFO *psDevInfo; psDevInfo = GetAnchorPtr(); - + /* check DevInfo has been setup */ if (psDevInfo == NULL) { - return (BCE_ERROR_GENERIC); + return (BCE_ERROR_GENERIC);/* failure */ } - + /* decrement ref count */ psDevInfo->ulRefCount--; if (psDevInfo->ulRefCount == 0) { - + /* all references gone - de-init device information */ PVRSRV_BC_BUFFER2SRV_KMJTABLE *psJTable = &psDevInfo->sPVRJTable; - + /* Remove the device from kernel services device register */ if (psJTable->pfnPVRSRVRemoveBCDevice(psDevInfo->ulDeviceID) != PVRSRV_OK) { - return (BCE_ERROR_GENERIC); + return (BCE_ERROR_GENERIC);/* failure */ } if (BCClosePVRServices(psDevInfo->hPVRServices) != BCE_OK) { psDevInfo->hPVRServices = NULL; - return (BCE_ERROR_GENERIC); + return (BCE_ERROR_GENERIC);/* failure */ } if (psDevInfo->psSystemBuffer) @@ -290,18 +363,21 @@ BCE_ERROR BC_Example_Unregister(void) BCFreeKernelMem(psDevInfo->psSystemBuffer); } - + /* de-allocate data structure */ BCFreeKernelMem(psDevInfo); - + /* clear the top-level anchor */ SetAnchorPtr(NULL); } - + /* return success */ return (BCE_OK); } +/* + * Create shared buffers. + */ BCE_ERROR BC_Example_Buffers_Create(void) { BC_EXAMPLE_DEVINFO *psDevInfo; @@ -316,21 +392,24 @@ BCE_ERROR BC_Example_Buffers_Create(void) IMG_UINT32 ui32MaxWidth = 320 * 4; - - + /* + get the anchor pointer + */ psDevInfo = GetAnchorPtr(); if (psDevInfo == NULL) { - + /* + * This device was not correctly registered/created. + */ return (BCE_ERROR_DEVICE_REGISTER_FAILED); } if (psDevInfo->ulNumBuffers) { - + /* Buffers already allocated */ return (BCE_ERROR_GENERIC); } - + /* Setup Buffer Info */ psDevInfo->sBufferInfo.pixelformat = BC_EXAMPLE_PIXELFORMAT; psDevInfo->sBufferInfo.ui32Width = ui32Width; psDevInfo->sBufferInfo.ui32Height = ui32Height; @@ -344,15 +423,15 @@ BCE_ERROR BC_Example_Buffers_Create(void) if(psDevInfo->sBufferInfo.pixelformat == PVRSRV_PIXEL_FORMAT_NV12) { - + /* Second plane is quarter size, but 2bytes per pixel */ ulSize += ((ui32ByteStride >> 1) * (ui32Height >> 1) << 1); } - else if(psDevInfo->sBufferInfo.pixelformat == PVRSRV_PIXEL_FORMAT_I420) + else if(psDevInfo->sBufferInfo.pixelformat == PVRSRV_PIXEL_FORMAT_YV12) { - + /* Second plane is quarter size, but 1byte per pixel */ ulSize += (ui32ByteStride >> 1) * (ui32Height >> 1); - + /* third plane is quarter size, but 1byte per pixel */ ulSize += (ui32ByteStride >> 1) * (ui32Height >> 1); } @@ -365,7 +444,7 @@ BCE_ERROR BC_Example_Buffers_Create(void) break; } #else - + /* Setup system buffer */ if (BCAllocContigMemory(ulSize, &psDevInfo->psSystemBuffer[i].hMemHandle, &psDevInfo->psSystemBuffer[i].sCPUVAddr, @@ -385,8 +464,9 @@ BCE_ERROR BC_Example_Buffers_Create(void) psDevInfo->sBufferInfo.ui32BufferCount = (IMG_UINT32)psDevInfo->ulNumBuffers; - - + /* + Bsetup the BC Jtable so SRVKM can call into this driver + */ psDevInfo->sBCJTable.ui32TableSize = sizeof(PVRSRV_BC_SRV2BUFFER_KMJTABLE); psDevInfo->sBCJTable.pfnOpenBCDevice = OpenBCDevice; psDevInfo->sBCJTable.pfnCloseBCDevice = CloseBCDevice; @@ -396,13 +476,13 @@ BCE_ERROR BC_Example_Buffers_Create(void) - + /* Update buffer's parameters for reconfiguration next time */ if (ui32Width < ui32MaxWidth) { switch(pixelformat) { case PVRSRV_PIXEL_FORMAT_NV12: - case PVRSRV_PIXEL_FORMAT_I420: + case PVRSRV_PIXEL_FORMAT_YV12: { ui32Width += 320; ui32Height += 160; @@ -439,11 +519,14 @@ BCE_ERROR BC_Example_Buffers_Create(void) ui32ByteStride = BC_EXAMPLE_STRIDE; } - + /* return success */ return (BCE_OK); } +/* + * Destroy shared buffers. + */ BCE_ERROR BC_Example_Buffers_Destroy(void) { BC_EXAMPLE_DEVINFO *psDevInfo; @@ -451,16 +534,18 @@ BCE_ERROR BC_Example_Buffers_Destroy(void) psDevInfo = GetAnchorPtr(); - + /* check DevInfo has been setup */ if (psDevInfo == NULL) { - - + /* + This device was not correctly registered/created. + */ return (BCE_ERROR_DEVICE_REGISTER_FAILED); } - - + /* + Free all allocated surfaces + */ for(i = 0; i < psDevInfo->ulNumBuffers; i++) { #if defined(BC_DISCONTIG_BUFFERS) @@ -477,7 +562,7 @@ BCE_ERROR BC_Example_Buffers_Destroy(void) } psDevInfo->ulNumBuffers = 0; - + /* Reset buffer info */ psDevInfo->sBufferInfo.pixelformat = PVRSRV_PIXEL_FORMAT_UNKNOWN; psDevInfo->sBufferInfo.ui32Width = 0; psDevInfo->sBufferInfo.ui32Height = 0; @@ -486,11 +571,15 @@ BCE_ERROR BC_Example_Buffers_Destroy(void) psDevInfo->sBufferInfo.ui32Flags = 0; psDevInfo->sBufferInfo.ui32BufferCount = (IMG_UINT32)psDevInfo->ulNumBuffers; - + /* return success */ return (BCE_OK); } +/* + * This function does both registration and buffer allocation at + * boot time. + */ BCE_ERROR BC_Example_Init(void) { BCE_ERROR eError; @@ -510,6 +599,9 @@ BCE_ERROR BC_Example_Init(void) return (BCE_OK); } +/* + * Destroy buffers and unregister device. + */ BCE_ERROR BC_Example_Deinit(void) { BCE_ERROR eError; @@ -529,3 +621,6 @@ BCE_ERROR BC_Example_Deinit(void) return (BCE_OK); } +/****************************************************************************** + End of file (bufferclass_example.c) +******************************************************************************/ diff --git a/services4/3rdparty/bufferclass_example/bufferclass_example.h b/services4/3rdparty/bufferclass_example/bufferclass_example.h index 572c3d7..4cdeb39 100644 --- a/services4/3rdparty/bufferclass_example/bufferclass_example.h +++ b/services4/3rdparty/bufferclass_example/bufferclass_example.h @@ -1,32 +1,47 @@ -/********************************************************************** - * - * Copyright (C) Imagination Technologies Ltd. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful but, except - * as otherwise stated in writing, 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., - * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * - * The full GNU General Public License is included in this distribution in - * the file called "COPYING". - * - * Contact Information: - * Imagination Technologies Ltd. - * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK - * - ******************************************************************************/ - +/*************************************************************************/ /*! +@Title bufferclass_example kernel driver structures and prototypes +@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 __BC_EXAMPLE_H__ #define __BC_EXAMPLE_H__ +/* IMG services headers */ #include "img_defs.h" #include "servicesext.h" #include "kernelbuffer.h" @@ -38,6 +53,9 @@ extern "C" { #define BC_EXAMPLE_NUM_BUFFERS 3 #define NV12 1 +//#define YV12 1 +//#define YUV422 1 + #ifdef NV12 #define BC_EXAMPLE_WIDTH (320) @@ -46,12 +64,12 @@ extern "C" { #define BC_EXAMPLE_PIXELFORMAT (PVRSRV_PIXEL_FORMAT_NV12) #else -#ifdef I420 +#ifdef YV12 #define BC_EXAMPLE_WIDTH (320) #define BC_EXAMPLE_HEIGHT (160) #define BC_EXAMPLE_STRIDE (320) -#define BC_EXAMPLE_PIXELFORMAT (PVRSRV_PIXEL_FORMAT_I420) +#define BC_EXAMPLE_PIXELFORMAT (PVRSRV_PIXEL_FORMAT_YV12) #else #ifdef YUV422 @@ -82,13 +100,14 @@ typedef enum tag_bce_bool BCE_TRUE = 1, } BCE_BOOL, *BCE_PBOOL; +/* BC_NOHW buffer structure */ typedef struct BC_EXAMPLE_BUFFER_TAG { unsigned long ulSize; BCE_HANDLE hMemHandle; - - + /* IMG structures used, to minimise API function code */ + /* replace with own structures where necessary */ #if defined(BC_DISCONTIG_BUFFERS) IMG_SYS_PHYADDR *psSysAddr; #else @@ -102,36 +121,42 @@ typedef struct BC_EXAMPLE_BUFFER_TAG } BC_EXAMPLE_BUFFER; +/* kernel device information structure */ typedef struct BC_EXAMPLE_DEVINFO_TAG { unsigned long ulDeviceID; BC_EXAMPLE_BUFFER *psSystemBuffer; - + /* number of supported buffers */ unsigned long ulNumBuffers; - + /* jump table into PVR services */ PVRSRV_BC_BUFFER2SRV_KMJTABLE sPVRJTable; - + /* jump table into BC */ PVRSRV_BC_SRV2BUFFER_KMJTABLE sBCJTable; - - - + /* + handle for connection to kernel services + - OS specific - may not be required + */ BCE_HANDLE hPVRServices; - + /* ref count */ unsigned long ulRefCount; - - + /* IMG structures used, to minimise API function code */ + /* replace with own structures where necessary */ BUFFER_INFO sBufferInfo; } BC_EXAMPLE_DEVINFO; +/*! + ***************************************************************************** + * Error values + *****************************************************************************/ typedef enum _BCE_ERROR_ { BCE_OK = 0, @@ -162,6 +187,7 @@ BCE_ERROR BC_Example_Buffers_Destroy(void); BCE_ERROR BC_Example_Init(void); BCE_ERROR BC_Example_Deinit(void); +/* OS Specific APIs */ BCE_ERROR BCOpenPVRServices(BCE_HANDLE *phPVRServices); BCE_ERROR BCClosePVRServices(BCE_HANDLE hPVRServices); @@ -204,5 +230,9 @@ BC_EXAMPLE_DEVINFO * GetAnchorPtr(void); } #endif -#endif +#endif /* __BC_EXAMPLE_H__ */ + +/****************************************************************************** + End of file (bufferclass_example.h) +******************************************************************************/ diff --git a/services4/3rdparty/bufferclass_example/bufferclass_example_linux.c b/services4/3rdparty/bufferclass_example/bufferclass_example_linux.c index 6a855d2..90d25c8 100644 --- a/services4/3rdparty/bufferclass_example/bufferclass_example_linux.c +++ b/services4/3rdparty/bufferclass_example/bufferclass_example_linux.c @@ -1,28 +1,70 @@ -/********************************************************************** - * - * Copyright (C) Imagination Technologies Ltd. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful but, except - * as otherwise stated in writing, 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., - * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * - * The full GNU General Public License is included in this distribution in - * the file called "COPYING". - * - * Contact Information: - * Imagination Technologies Ltd. - * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK - * - ******************************************************************************/ +/*************************************************************************/ /*! +@Title bufferclass example linux specific implementations +@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. +*/ /**************************************************************************/ + +/************************************************************************** + The 3rd party driver is a specification of an API to integrate the IMG POWERVR + Services driver with 3rd Party display hardware. It is NOT a specification for + a display controller driver, rather a specification to extend the API for a + pre-existing driver for the display hardware. + + The 3rd party driver interface provides IMG POWERVR client drivers (e.g. PVR2D) + with an API abstraction of the system's underlying display hardware, allowing + the client drivers to indirectly control the display hardware and access its + associated memory. + + Functions of the API include + - query primary surface attributes (width, height, stride, pixel format, CPU + physical and virtual address) + - swap/flip chain creation and subsequent query of surface attributes + - asynchronous display surface flipping, taking account of asynchronous read + (flip) and write (render) operations to the display surface + + Note: having queried surface attributes the client drivers are able to map the + display memory to any IMG POWERVR Services device by calling + PVRSRVMapDeviceClassMemory with the display surface handle. + + This code is intended to be an example of how a pre-existing display driver may + be extended to support the 3rd Party Display interface to POWERVR Services + - IMG is not providing a display driver implementation. + **************************************************************************/ #include #include @@ -77,9 +119,15 @@ static DEFINE_MUTEX(sBCExampleBridgeMutex); #endif #if defined(LDM_PLATFORM) || defined(LDM_PCI) +/* + * Device class used for /sys entries (and udev device node creation) + */ static struct class *psPvrClass; #endif +/* + * This is the major number we use for all nodes in /dev. + */ static int AssignedMajorNumber; static struct file_operations bufferclass_example_fops = { @@ -94,22 +142,46 @@ static struct file_operations bufferclass_example_fops = { #define unref__ __attribute__ ((unused)) #if defined(LMA) -#define PVR_BUFFERCLASS_MEMOFFSET (220 * 1024 * 1024) -#define PVR_BUFFERCLASS_MEMSIZE (4 * 1024 * 1024) +#define PVR_BUFFERCLASS_MEMOFFSET (220 * 1024 * 1024) /* Must be after services localmem region */ +#define PVR_BUFFERCLASS_MEMSIZE (4 * 1024 * 1024) /* Must be before displayclass localmem region */ unsigned long g_ulMemBase = 0; unsigned long g_ulMemCurrent = 0; +/* PVR device vendor ID */ #define VENDOR_ID_PVR 0x1010 #define DEVICE_ID_PVR 0x1CF1 #define DEVICE_ID1_PVR 0x1CF2 +/* PDP mem (including HP mapping) on base register 2 */ #define PVR_MEM_PCI_BASENUM 2 #endif +/***************************************************************************** + Function Name: BC_Example_ModInit + Description : Insert the driver into the kernel. + + The device major number is allocated by the kernel dynamically + if AssignedMajorNumber is zero on entry. This means that the + device node (nominally /dev/bc_example) may need to be re-made if + the kernel varies the major number it assigns. The number + does seem to stay constant between runs, but I don't think + this is guaranteed. The node is made as root on the shell + with: + + mknod /dev/bc_example c ? 0 + + where ? is the major number reported by the printk() - look + at the boot log using `dmesg' to see this). + + __init places the function in a special memory section that + the kernel frees once the function has been run. Refer also + to module_init() macro call below. + +*****************************************************************************/ static int __init BC_Example_ModInit(void) { #if defined(LDM_PLATFORM) || defined(LDM_PCI) @@ -125,7 +197,7 @@ static int __init BC_Example_ModInit(void) psPCIDev = pci_get_device(VENDOR_ID_PVR, DEVICE_ID_PVR, NULL); if (psPCIDev == NULL) { - + /* Try an alternative PCI ID */ psPCIDev = pci_get_device(VENDOR_ID_PVR, DEVICE_ID1_PVR, NULL); } @@ -157,7 +229,10 @@ static int __init BC_Example_ModInit(void) #endif #if defined(LDM_PLATFORM) || defined(LDM_PCI) - + /* + * This code (using GPL symbols) facilitates automatic device + * node creation on platforms with udev (or similar). + */ psPvrClass = class_create(THIS_MODULE, "bc_example"); if (IS_ERR(psPvrClass)) @@ -169,17 +244,20 @@ static int __init BC_Example_ModInit(void) psDev = device_create(psPvrClass, NULL, MKDEV(AssignedMajorNumber, 0), #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,26)) NULL, -#endif +#endif /* (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,26)) */ DEVNAME); if (IS_ERR(psDev)) { printk(KERN_ERR DRVNAME ": BC_Example_ModInit: unable to create device (%ld)", PTR_ERR(psDev)); goto ExitDestroyClass; } -#endif +#endif /* defined(LDM_PLATFORM) || defined(LDM_PCI) */ #if defined(LMA) - + /* + * We don't do a pci_request_region for PVR_MEM_PCI_BASENUM, + * we assume the SGX driver has done this already. + */ g_ulMemBase = pci_resource_start(psPCIDev, PVR_MEM_PCI_BASENUM) + PVR_BUFFERCLASS_MEMOFFSET; #endif @@ -190,7 +268,11 @@ static int __init BC_Example_ModInit(void) } #if defined(LMA) - + /* + * To prevent possible problems with system suspend/resume, we don't + * keep the device enabled, but rely on the fact that the SGX driver + * will have done a pci_enable_device. + */ pci_disable_device(psPCIDev); #endif @@ -208,8 +290,17 @@ ExitDisable: ExitError: #endif return -EBUSY; -} +} /*BC_Example_ModInit*/ + +/***************************************************************************** + Function Name: BC_Example_ModInit + Description : Remove the driver from the kernel. + __exit places the function in a special memory section that + the kernel frees once the function has been run. Refer also + to module_exit() macro call below. + +*****************************************************************************/ static void __exit BC_Example_ModCleanup(void) { #if defined(LDM_PLATFORM) || defined(LDM_PCI) @@ -224,7 +315,7 @@ static void __exit BC_Example_ModCleanup(void) printk (KERN_ERR DRVNAME ": BC_Example_ModCleanup: can't deinit device\n"); } -} +} /*BC_Example_ModCleanup*/ void *BCAllocKernelMem(unsigned long ulSize) @@ -288,7 +379,7 @@ void BCFreeDiscontigMemory(unsigned long ulSize, vfree(LinAddr); } -#else +#else /* defined(BC_DISCONTIG_BUFFERS) */ BCE_ERROR BCAllocContigMemory(unsigned long ulSize, BCE_HANDLE unref__ *phMemHandle, @@ -298,7 +389,7 @@ BCE_ERROR BCAllocContigMemory(unsigned long ulSize, #if defined(LMA) void *pvLinAddr; - + /* Only allowed a certain amount of memory for bufferclass buffers */ if(g_ulMemCurrent + ulSize >= PVR_BUFFERCLASS_MEMSIZE) { return (BCE_ERROR_OUT_OF_MEMORY); @@ -311,12 +402,12 @@ BCE_ERROR BCAllocContigMemory(unsigned long ulSize, pPhysAddr->uiAddr = g_ulMemBase + g_ulMemCurrent; *pLinAddr = pvLinAddr; - + /* Not a real allocator; just increment the current address */ g_ulMemCurrent += ulSize; return (BCE_OK); } return (BCE_ERROR_OUT_OF_MEMORY); -#else +#else /* defined(LMA) */ #if defined(BCE_USE_SET_MEMORY) void *pvLinAddr; unsigned long ulAlignedSize = PAGE_ALIGN(ulSize); @@ -337,7 +428,7 @@ BCE_ERROR BCAllocContigMemory(unsigned long ulSize, *pLinAddr = pvLinAddr; return (BCE_OK); -#else +#else /* BCE_USE_SET_MEMORY */ dma_addr_t dma; void *pvLinAddr; @@ -351,8 +442,8 @@ BCE_ERROR BCAllocContigMemory(unsigned long ulSize, *pLinAddr = pvLinAddr; return (BCE_OK); -#endif -#endif +#endif /* BCE_USE_SET_MEMORY */ +#endif /* defined(LMA) */ } void BCFreeContigMemory(unsigned long ulSize, @@ -363,7 +454,7 @@ void BCFreeContigMemory(unsigned long ulSize, #if defined(LMA) g_ulMemCurrent -= ulSize; iounmap(LinAddr); -#else +#else /* defined(LMA) */ #if defined(BCE_USE_SET_MEMORY) unsigned long ulAlignedSize = PAGE_ALIGN(ulSize); int iError; @@ -375,34 +466,50 @@ void BCFreeContigMemory(unsigned long ulSize, printk(KERN_ERR DRVNAME ": BCFreeContigMemory: set_memory_wb failed (%d)\n", iError); } kfree(LinAddr); -#else +#else /* BCE_USE_SET_MEMORY */ dma_free_coherent(NULL, ulSize, LinAddr, (dma_addr_t)PhysAddr.uiAddr); -#endif -#endif +#endif /* BCE_USE_SET_MEMORY */ +#endif /* defined(LMA) */ } -#endif - +#endif /* defined(BC_DISCONTIG_BUFFERS) */ + +/************************************************************************** + FUNCTION: CpuPAddrToSysPAddrBC + PURPOSE: Compute a system physical address from a cpu physical + address. + PARAMETERS: In: cpu_paddr - cpu physical address. + RETURNS: system physical address. + **************************************************************************/ IMG_SYS_PHYADDR CpuPAddrToSysPAddrBC(IMG_CPU_PHYADDR cpu_paddr) { IMG_SYS_PHYADDR sys_paddr; - + /* This would only be an inequality if the CPU's MMU did not point to sys address 0, + ie. multi CPU system */ sys_paddr.uiAddr = cpu_paddr.uiAddr; return sys_paddr; } +/************************************************************************** + FUNCTION: SysPAddrToCpuPAddrBC + PURPOSE: Compute a cpu physical address + from a system physical address. + PARAMETERS: In: cpu_paddr - system physical address. + RETURNS: cpu physical address. + **************************************************************************/ IMG_CPU_PHYADDR SysPAddrToCpuPAddrBC(IMG_SYS_PHYADDR sys_paddr) { IMG_CPU_PHYADDR cpu_paddr; - + /* This would only be an inequality if the CPU's MMU did not point to sys address 0, + ie. multi CPU system */ cpu_paddr.uiAddr = sys_paddr.uiAddr; return cpu_paddr; } BCE_ERROR BCOpenPVRServices (BCE_HANDLE *phPVRServices) { - + /* Nothing to do - we have already checked services module insertion */ *phPVRServices = 0; return (BCE_OK); } @@ -410,7 +517,7 @@ BCE_ERROR BCOpenPVRServices (BCE_HANDLE *phPVRServices) BCE_ERROR BCClosePVRServices (BCE_HANDLE unref__ hPVRServices) { - + /* Nothing to do */ return (BCE_OK); } @@ -421,7 +528,7 @@ BCE_ERROR BCGetLibFuncAddr (BCE_HANDLE unref__ hExtDrv, char *szFunctionName, PF return (BCE_ERROR_INVALID_PARAMS); } - + /* Nothing to do - should be exported from pvrsrv.ko */ *ppfnFuncTable = PVRGetBufferClassJTable; return (BCE_OK); @@ -492,6 +599,12 @@ static long BC_Example_Bridge_Unlocked(struct file *file, unsigned int cmd, unsi } #endif +/* + These macro calls define the initialisation and removal functions of the + driver. Although they are prefixed `module_', they apply when compiling + statically as well; in both cases they define the function the kernel will + run to start/stop the driver. +*/ module_init(BC_Example_ModInit); module_exit(BC_Example_ModCleanup); diff --git a/services4/3rdparty/bufferclass_example/bufferclass_example_linux.h b/services4/3rdparty/bufferclass_example/bufferclass_example_linux.h index b663608..65d7860 100644 --- a/services4/3rdparty/bufferclass_example/bufferclass_example_linux.h +++ b/services4/3rdparty/bufferclass_example/bufferclass_example_linux.h @@ -1,29 +1,43 @@ -/********************************************************************** - * - * Copyright (C) Imagination Technologies Ltd. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful but, except - * as otherwise stated in writing, 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., - * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * - * The full GNU General Public License is included in this distribution in - * the file called "COPYING". - * - * Contact Information: - * Imagination Technologies Ltd. - * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK - * - ******************************************************************************/ +/*************************************************************************/ /*! +@Title bufferclass_example kernel driver interface +@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 __BC_EXAMPLE_LINUX_H__ #define __BC_EXAMPLE_LINUX_H__ @@ -36,6 +50,7 @@ typedef struct BC_Example_ioctl_package_TAG }BC_Example_ioctl_package; +/*!< Nov 2006: according to ioctl-number.txt 'g' wasn't in use. */ #define BC_EXAMPLE_IOC_GID 'g' #define BC_EXAMPLE_IOWR(INDEX) _IOWR(BC_EXAMPLE_IOC_GID, INDEX, BC_Example_ioctl_package) @@ -44,5 +59,9 @@ typedef struct BC_Example_ioctl_package_TAG #define BC_Example_ioctl_get_buffer_count BC_EXAMPLE_IOWR(1) #define BC_Example_ioctl_reconfigure_buffer BC_EXAMPLE_IOWR(2) -#endif +#endif /* __BC_EXAMPLE_H__ */ + +/****************************************************************************** + End of file (bufferclass_example.h) +******************************************************************************/ diff --git a/services4/3rdparty/bufferclass_example/bufferclass_example_private.c b/services4/3rdparty/bufferclass_example/bufferclass_example_private.c index 3a02eb9..d9dbfde 100644 --- a/services4/3rdparty/bufferclass_example/bufferclass_example_private.c +++ b/services4/3rdparty/bufferclass_example/bufferclass_example_private.c @@ -1,28 +1,70 @@ -/********************************************************************** - * - * Copyright (C) Imagination Technologies Ltd. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful but, except - * as otherwise stated in writing, 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., - * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * - * The full GNU General Public License is included in this distribution in - * the file called "COPYING". - * - * Contact Information: - * Imagination Technologies Ltd. - * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK - * - ******************************************************************************/ +/*************************************************************************/ /*! +@Title Bufferclass example private functions. +@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. +*/ /**************************************************************************/ + +/************************************************************************** + The 3rd party driver is a specification of an API to integrate the IMG POWERVR + Services driver with 3rd Party display hardware. It is NOT a specification for + a display controller driver, rather a specification to extend the API for a + pre-existing driver for the display hardware. + + The 3rd party driver interface provides IMG POWERVR client drivers (e.g. PVR2D) + with an API abstraction of the system's underlying display hardware, allowing + the client drivers to indirectly control the display hardware and access its + associated memory. + + Functions of the API include + - query primary surface attributes (width, height, stride, pixel format, CPU + physical and virtual address) + - swap/flip chain creation and subsequent query of surface attributes + - asynchronous display surface flipping, taking account of asynchronous read + (flip) and write (render) operations to the display surface + + Note: having queried surface attributes the client drivers are able to map the + display memory to any IMG POWERVR Services device by calling + PVRSRVMapDeviceClassMemory with the display surface handle. + + This code is intended to be an example of how a pre-existing display driver may + be extended to support the 3rd Party Display interface to POWERVR Services + - IMG is not providing a display driver implementation. + **************************************************************************/ #include "bufferclass_example.h" #include "bufferclass_example_private.h" @@ -61,7 +103,7 @@ static void FillNV12Image(void *pvDest, int width, int height, int bytestride) u = (j<(height/2))? ((i<(width/2))? 0xFF:0x33) : ((i<(width/2))? 0x33:0xAA); v = (j<(height/2))? ((i<(width/2))? 0xAC:0x0) : ((i<(width/2))? 0x03:0xEE); - + /* Byte order is VU */ pui16uv[count++] = (v << 8) | u; } @@ -70,7 +112,7 @@ static void FillNV12Image(void *pvDest, int width, int height, int bytestride) iPhase++; } -static void FillI420Image(void *pvDest, int width, int height, int bytestride) +static void FillYV12Image(void *pvDest, int width, int height, int bytestride) { static int iPhase = 0; int i, j; @@ -96,28 +138,28 @@ static void FillI420Image(void *pvDest, int width, int height, int bytestride) for(j=0;j>3) | ((Colour8>>2)<<5) | ((Colour8>>3)<<11); Colour32 = Colour16 | Colour16 << 16; @@ -208,11 +250,25 @@ static void FillRGB565Image(void *pvDest, int width, int height, int bytestride) pui32Addr[i] = 0x001F001FUL; } - + /* advance the colour */ Colour8 = (Colour8 + 1) % MIN(height - 1, 0xFFU); } +/*! +****************************************************************************** + + @Function FillBuffer + + @Description + + Fills pixels into a buffer specified by index + + @Input ui32BufferIndex - buffer index + + @Return 0 - success, -1 - failure + +******************************************************************************/ int FillBuffer(unsigned int uiBufferIndex) { BC_EXAMPLE_DEVINFO *psDevInfo = GetAnchorPtr(); @@ -220,27 +276,27 @@ int FillBuffer(unsigned int uiBufferIndex) BUFFER_INFO *psBufferInfo; PVRSRV_SYNC_DATA *psSyncData; - + /* check DevInfo has been setup */ if(psDevInfo == NULL) { - return -1; + return -1;/* failure */ } psBuffer = &psDevInfo->psSystemBuffer[uiBufferIndex]; psBufferInfo = &psDevInfo->sBufferInfo; - + /* This may be NULL, as it is only registered once texture streaming starts. */ psSyncData = psBuffer->psSyncData; if(psSyncData) { - + /* ensure all reads have flushed on the buffer */ if(psSyncData->ui32ReadOpsPending != psSyncData->ui32ReadOpsComplete) { - return -1; + return -1;/* failure */ } - + /* take a write-lock on the new buffer to capture to */ psSyncData->ui32WriteOpsPending++; } @@ -275,9 +331,9 @@ int FillBuffer(unsigned int uiBufferIndex) psBufferInfo->ui32ByteStride); break; } - case PVRSRV_PIXEL_FORMAT_I420: + case PVRSRV_PIXEL_FORMAT_YV12: { - FillI420Image(psBuffer->sCPUVAddr, + FillYV12Image(psBuffer->sCPUVAddr, psBufferInfo->ui32Width, psBufferInfo->ui32Height, psBufferInfo->ui32ByteStride); @@ -285,7 +341,7 @@ int FillBuffer(unsigned int uiBufferIndex) } } - + /* unlock the buffer, signalling the writes are complete */ if(psSyncData) { psSyncData->ui32WriteOpsComplete++; @@ -300,17 +356,31 @@ int FillBuffer(unsigned int uiBufferIndex) } +/*! +****************************************************************************** + + @Function GetBufferCount + + @Description + + returns buffer count + + @Output pulBufferCount - buffer count + + @Return 0 - success, -1 - failure + +******************************************************************************/ int GetBufferCount(unsigned int *puiBufferCount) { BC_EXAMPLE_DEVINFO *psDevInfo = GetAnchorPtr(); - + /* check DevInfo has been setup */ if(psDevInfo == IMG_NULL) { - return -1; + return -1;/* failure */ } - + /* return buffer count */ *puiBufferCount = (unsigned int)psDevInfo->sBufferInfo.ui32BufferCount; return 0; @@ -318,11 +388,24 @@ int GetBufferCount(unsigned int *puiBufferCount) +/****************************************************************************** + + @Function ReconfigureBuffer + + @Description + + returns whether reconfiguration succeeds or not + + @Output uiSucceed : 1 - succeeded, 0 - failed + + @Return 0 - success, -1 - failure + +******************************************************************************/ int ReconfigureBuffer(unsigned int *uiSucceed) { BCE_ERROR eError; - + /* Destroy the shared buffers of the current buffer class device */ eError = BC_Example_Buffers_Destroy(); if (eError != BCE_OK) @@ -331,10 +414,10 @@ int ReconfigureBuffer(unsigned int *uiSucceed) return -1; } - + /* No need to un-register and then re-register the device with services module srvkm */ - + /* Recreate shared buffers with reconfigured parameters */ eError = BC_Example_Buffers_Create(); if (eError != BCE_OK) @@ -343,7 +426,7 @@ int ReconfigureBuffer(unsigned int *uiSucceed) return -1; } - + /* return uiSucceed as succeeded 1 */ *uiSucceed = 1; return 0; } diff --git a/services4/3rdparty/bufferclass_example/bufferclass_example_private.h b/services4/3rdparty/bufferclass_example/bufferclass_example_private.h index 94515bc..8d95e2b 100644 --- a/services4/3rdparty/bufferclass_example/bufferclass_example_private.h +++ b/services4/3rdparty/bufferclass_example/bufferclass_example_private.h @@ -1,28 +1,43 @@ -/********************************************************************** - * - * Copyright (C) Imagination Technologies Ltd. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful but, except - * as otherwise stated in writing, 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., - * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * - * The full GNU General Public License is included in this distribution in - * the file called "COPYING". - * - * Contact Information: - * Imagination Technologies Ltd. - * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK - * - ******************************************************************************/ +/*************************************************************************/ /*! +@Title Bufferclass example internal interfaces. +@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 _BUFFERCLASS_EXAMPLE_PRIVATE_H_ #define _BUFFERCLASS_EXAMPLE_PRIVATE_H_ @@ -31,4 +46,4 @@ int FillBuffer(unsigned int uiBufferIndex); int GetBufferCount(unsigned int *puiBufferCount); int ReconfigureBuffer(unsigned int *uiSucceed); -#endif +#endif /* _BUFFERCLASS_EXAMPLE_PRIVATE_H_ */ diff --git a/services4/3rdparty/bufferclass_ti/bc_cat.c b/services4/3rdparty/bufferclass_ti/bc_cat.c index 04f5c38..d515885 100644 --- a/services4/3rdparty/bufferclass_ti/bc_cat.c +++ b/services4/3rdparty/bufferclass_ti/bc_cat.c @@ -47,7 +47,7 @@ #define DEVNAME "bccat" #define DRVNAME DEVNAME -#define DEVICE_COUNT 1 +#define DEVICE_COUNT 10 #define BC_EXAMPLE_NUM_BUFFERS 3 #define BUFFERCLASS_DEVICE_NAME "Example Bufferclass Device (SW)" @@ -324,6 +324,15 @@ static int BC_CreateBuffers(int id, bc_buf_params_t *p) return -EINVAL; switch (p->fourcc) { + case BC_PIX_FMT_YV12: + pixel_fmt = PVRSRV_PIXEL_FORMAT_YV12; + stride = p->width; + break; + case BC_PIX_FMT_I420: + pixel_fmt = PVRSRV_PIXEL_FORMAT_I420; + stride = p->width; + break; + case BC_PIX_FMT_NV12: pixel_fmt = PVRSRV_PIXEL_FORMAT_NV12; stride = p->width; @@ -381,6 +390,12 @@ static int BC_CreateBuffers(int id, bc_buf_params_t *p) if (pixel_fmt == PVRSRV_PIXEL_FORMAT_NV12) ulSize += (stride >> 1) * (p->height >> 1) << 1; + if ((pixel_fmt == PVRSRV_PIXEL_FORMAT_I420) || (pixel_fmt == PVRSRV_PIXEL_FORMAT_YV12) ) + { + ulSize += (stride >> 1) * (p->height >> 1); + ulSize += (stride >> 1) * (p->height >> 1); + } + for (i=0; i < p->count; i++) { if (psDevInfo->buf_type == BC_MEMORY_MMAP) { @@ -662,7 +677,8 @@ static int __init bc_cat_init(void) #ifdef PLAT_TI8168 width_align = 8; #else - width_align = cpu_is_omap3530() && ( omap_rev() < OMAP3430_REV_ES3_0 ) ? 32 : 8; + width_align = 8; + //width_align = cpu_is_omap3530() && ( omap_rev() < OMAP3430_REV_ES3_0 ) ? 32 : 8; #endif major = register_chrdev(0, DEVNAME, &bc_cat_fops); diff --git a/services4/3rdparty/bufferclass_ti/bc_cat.h b/services4/3rdparty/bufferclass_ti/bc_cat.h index 0b436ee..7d45649 100644 --- a/services4/3rdparty/bufferclass_ti/bc_cat.h +++ b/services4/3rdparty/bufferclass_ti/bc_cat.h @@ -33,6 +33,8 @@ #define BC_FOURCC(a,b,c,d) \ ((unsigned long) ((a) | (b)<<8 | (c)<<16 | (d)<<24)) +#define BC_PIX_FMT_I420 BC_FOURCC('I', '4', '2', '0') /*YUV 4:2:0*/ +#define BC_PIX_FMT_YV12 BC_FOURCC('Y', 'V', '1', '2') /*YUV 4:2:0*/ #define BC_PIX_FMT_NV12 BC_FOURCC('N', 'V', '1', '2') /*YUV 4:2:0*/ #define BC_PIX_FMT_UYVY BC_FOURCC('U', 'Y', 'V', 'Y') /*YUV 4:2:2*/ #define BC_PIX_FMT_YUYV BC_FOURCC('Y', 'U', 'Y', 'V') /*YUV 4:2:2*/ diff --git a/services4/3rdparty/dc_omapfb3_linux/3rdparty_dc_drm_shared.h b/services4/3rdparty/dc_omapfb3_linux/3rdparty_dc_drm_shared.h index a48c8dc..addbfc2 100644 --- a/services4/3rdparty/dc_omapfb3_linux/3rdparty_dc_drm_shared.h +++ b/services4/3rdparty/dc_omapfb3_linux/3rdparty_dc_drm_shared.h @@ -1,29 +1,46 @@ -/********************************************************************** - * - * Copyright(c) Imagination Technologies Ltd. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful but, except - * as otherwise stated in writing, 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., - * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * - * The full GNU General Public License is included in this distribution in - * the file called "COPYING". - * - * Contact Information: - * Imagination Technologies Ltd. - * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK - * - ******************************************************************************/ +/*************************************************************************/ /*! +@Title OMAP Linux display driver shared DRM structures +@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved +@Description OMAP Linux display driver DRM structures shared between + kernel and user space. +@License Dual MIT/GPLv2 +The contents of this file are subject to the MIT license as set out below. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +Alternatively, the contents of this file may be used under the terms of +the GNU General Public License Version 2 ("GPL") in which case the provisions +of GPL are applicable instead of those above. + +If you wish to allow use of your version of this file only under the terms of +GPL, and not to allow others to use your version of this file under the terms +of the MIT license, indicate your decision by deleting the provisions above +and replace them with the notice and other provisions required by GPL as set +out in the file called "GPL-COPYING" included in this distribution. If you do +not delete the provisions above, a recipient may use your version of this file +under the terms of either the MIT license or GPL. + +This License is also included in this distribution in the file called +"MIT-COPYING". + +EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS +PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING +BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION 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 __3RDPARTY_DC_DRM_SHARED_H__ #define __3RDPARTY_DC_DRM_SHARED_H__ #if defined(SUPPORT_DRI_DRM) @@ -40,6 +57,9 @@ #define PVR_DRM_DISP_ARG_DEV 1 #define PVR_DRM_DISP_NUM_ARGS 2 -#endif -#endif +#endif /* defined(SUPPORT_DRI_DRM) */ +#endif /* __3RDPARTY_DC_DRM_SHARED_H__ */ +/****************************************************************************** + End of file (3rdparty_dc_drm_shared.h) +******************************************************************************/ diff --git a/services4/3rdparty/dc_omapfb3_linux/Kbuild.mk b/services4/3rdparty/dc_omapfb3_linux/Kbuild.mk new file mode 100644 index 0000000..eca9351 --- /dev/null +++ b/services4/3rdparty/dc_omapfb3_linux/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)/services4/3rdparty/dc_omapfb3_linux \ + -I$(KERNELDIR)/drivers/video/omap2 \ + -I$(KERNELDIR)/arch/arm/plat-omap/include + +omaplfb-y += \ + services4/3rdparty/dc_omapfb3_linux/omaplfb_displayclass.o \ + services4/3rdparty/dc_omapfb3_linux/omaplfb_linux.o diff --git a/services4/3rdparty/dc_omapfb3_linux/Linux.mk b/services4/3rdparty/dc_omapfb3_linux/Linux.mk new file mode 100644 index 0000000..7574073 --- /dev/null +++ b/services4/3rdparty/dc_omapfb3_linux/Linux.mk @@ -0,0 +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. +# +### ########################################################################### + +modules := dc_omapfb3_linux + +dc_omapfb3_linux_type := kernel_module +dc_omapfb3_linux_target := omaplfb.ko +dc_omapfb3_linux_makefile := $(THIS_DIR)/Kbuild.mk diff --git a/services4/3rdparty/dc_omapfb3_linux/kbuild/Makefile b/services4/3rdparty/dc_omapfb3_linux/kbuild/Makefile deleted file mode 100644 index f52617a..0000000 --- a/services4/3rdparty/dc_omapfb3_linux/kbuild/Makefile +++ /dev/null @@ -1,36 +0,0 @@ -# -# Copyright(c) 2008 Imagination Technologies Ltd. All rights reserved. -# -# This program is free software; you can redistribute it and/or modify it -# under the terms and conditions of the GNU General Public License, -# version 2, as published by the Free Software Foundation. -# -# This program is distributed in the hope it will be useful but, except -# as otherwise stated in writing, 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., -# 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. -# -# The full GNU General Public License is included in this distribution in -# the file called "COPYING". -# -# Contact Information: -# Imagination Technologies Ltd. -# Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK -# -# - -MODULE = $(DISPLAY_CONTROLLER) - -INCLUDES = - -SOURCES = - -SYM_VERS_DEPS = $(EURASIAROOT)/services4/srvkm/env/linux - -include $(EURASIAROOT)/services4/$(DISPLAY_CONTROLLER_DIR)/makefile.linux.common - -include $(EURASIAROOT)/eurasiacon/build/linux/kbuild/Makefile.kbuild_subdir_common diff --git a/services4/3rdparty/dc_omapfb3_linux/makefile.linux.common b/services4/3rdparty/dc_omapfb3_linux/makefile.linux.common deleted file mode 100644 index d5b4a30..0000000 --- a/services4/3rdparty/dc_omapfb3_linux/makefile.linux.common +++ /dev/null @@ -1,42 +0,0 @@ -# -# Copyright(c) 2008 Imagination Technologies Ltd. All rights reserved. -# -# This program is free software; you can redistribute it and/or modify it -# under the terms and conditions of the GNU General Public License, -# version 2, as published by the Free Software Foundation. -# -# This program is distributed in the hope it will be useful but, except -# as otherwise stated in writing, 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., -# 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. -# -# The full GNU General Public License is included in this distribution in -# the file called "COPYING". -# -# Contact Information: -# Imagination Technologies Ltd. -# Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK -# -# -# - -ifeq ($(SUPPORT_DRI_DRM),1) -DISPLAY_CONTROLLER_SOURCES_ROOT = $(KBUILDROOT)/$(DISPLAY_CONTROLLER_DIR) -MODULE_CFLAGS += -DPVR_DISPLAY_CONTROLLER_DRM_IOCTL -else -DISPLAY_CONTROLLER_SOURCES_ROOT = .. -endif - -INCLUDES += -I$(EURASIAROOT)/include4 \ - -I$(EURASIAROOT)/services4/include \ - -I$(EURASIAROOT)/services4/system/$(PVR_SYSTEM) \ - -I$(EURASIAROOT)/services4/system/include \ - -I$(KERNELDIR)/drivers/video/omap2 \ - -I$(KERNELDIR)/arch/arm/plat-omap/include - -SOURCES += $(DISPLAY_CONTROLLER_SOURCES_ROOT)/omaplfb_displayclass.c \ - $(DISPLAY_CONTROLLER_SOURCES_ROOT)/omaplfb_linux.c diff --git a/services4/3rdparty/dc_omapfb3_linux/omaplfb.h b/services4/3rdparty/dc_omapfb3_linux/omaplfb.h index b77ee39..c69640d 100644 --- a/services4/3rdparty/dc_omapfb3_linux/omaplfb.h +++ b/services4/3rdparty/dc_omapfb3_linux/omaplfb.h @@ -1,29 +1,44 @@ -/********************************************************************** - * - * Copyright(c) Imagination Technologies Ltd. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful but, except - * as otherwise stated in writing, 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., - * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * - * The full GNU General Public License is included in this distribution in - * the file called "COPYING". - * - * Contact Information: - * Imagination Technologies Ltd. - * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK - * - ******************************************************************************/ - +/*************************************************************************/ /*! +@Title OMAP Linux display driver structures and prototypes +@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 __OMAPLFB_H__ #define __OMAPLFB_H__ @@ -43,6 +58,14 @@ #include #endif +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)) +#define OMAPLFB_CONSOLE_LOCK() console_lock() +#define OMAPLFB_CONSOLE_UNLOCK() console_unlock() +#else +#define OMAPLFB_CONSOLE_LOCK() acquire_console_sem() +#define OMAPLFB_CONSOLE_UNLOCK() release_console_sem() +#endif + #define unref__ __attribute__ ((unused)) typedef void * OMAPLFB_HANDLE; @@ -55,6 +78,7 @@ typedef atomic_t OMAPLFB_ATOMIC_BOOL; typedef atomic_t OMAPLFB_ATOMIC_INT; +/* OMAPLFB buffer structure */ typedef struct OMAPLFB_BUFFER_TAG { struct OMAPLFB_BUFFER_TAG *psNext; @@ -62,11 +86,11 @@ typedef struct OMAPLFB_BUFFER_TAG struct work_struct sWork; - + /* Position of this buffer in the virtual framebuffer */ unsigned long ulYOffset; - - + /* IMG structures used, to minimise API function code */ + /* replace with own structures where necessary */ IMG_SYS_PHYADDR sSysAddr; IMG_CPU_VIRTADDR sCPUVAddr; PVRSRV_SYNC_DATA *psSyncData; @@ -75,27 +99,34 @@ typedef struct OMAPLFB_BUFFER_TAG unsigned long ulSwapInterval; } OMAPLFB_BUFFER; +/* OMAPLFB swapchain structure */ typedef struct OMAPLFB_SWAPCHAIN_TAG { - + /* Swap chain ID */ unsigned int uiSwapChainID; - + /* number of buffers in swapchain */ unsigned long ulBufferCount; - + /* list of buffers in the swapchain */ OMAPLFB_BUFFER *psBuffer; - + /* Swap chain work queue */ struct workqueue_struct *psWorkQueue; - + /* + * Set if we didn't manage to wait for VSync on last swap, + * or if we think we need to wait for VSync on the next flip. + * The flag helps to avoid jitter when the screen is + * unblanked, by forcing an extended wait for VSync before + * attempting the next flip. + */ OMAPLFB_BOOL bNotVSynced; - + /* Previous number of blank events */ int iBlankEvents; - + /* Framebuffer Device ID for messages (e.g. printk) */ unsigned int uiFBDevID; } OMAPLFB_SWAPCHAIN; @@ -110,75 +141,83 @@ typedef struct OMAPLFB_FBINFO_TAG unsigned long ulPhysicalWidthmm; unsigned long ulPhysicalHeightmm; - - - IMG_SYS_PHYADDR sSysAddr; + /* IMG structures used, to minimise API function code */ + /* replace with own structures where necessary */ + IMG_SYS_PHYADDR sSysAddr;//system physical address IMG_CPU_VIRTADDR sCPUVAddr; - + /* pixelformat of system/primary surface */ PVRSRV_PIXEL_FORMAT ePixelFormat; -}OMAPLFB_FBINFO; +#if defined(CONFIG_DSSCOMP) + OMAPLFB_BOOL bIs2D; + IMG_SYS_PHYADDR *psPageList; + struct ion_handle *psIONHandle; + IMG_UINT32 uiBytesPerPixel; +#endif +} OMAPLFB_FBINFO; + +/* kernel device information structure */ typedef struct OMAPLFB_DEVINFO_TAG { - + /* Framebuffer Device ID */ unsigned int uiFBDevID; - + /* PVR Device ID */ unsigned int uiPVRDevID; - + /* Swapchain create/destroy mutex */ struct mutex sCreateSwapChainMutex; - + /* system surface info */ OMAPLFB_BUFFER sSystemBuffer; - + /* jump table into PVR services */ PVRSRV_DC_DISP2SRV_KMJTABLE sPVRJTable; - + /* jump table into DC */ PVRSRV_DC_SRV2DISP_KMJTABLE sDCJTable; - + /* fb info structure */ OMAPLFB_FBINFO sFBInfo; - + /* Only one swapchain supported by this device so hang it here */ OMAPLFB_SWAPCHAIN *psSwapChain; - + /* Swap chain ID */ unsigned int uiSwapChainID; - + /* True if PVR Services is flushing its command queues */ OMAPLFB_ATOMIC_BOOL sFlushCommands; - + /* pointer to linux frame buffer information structure */ struct fb_info *psLINFBInfo; - + /* Linux Framebuffer event notification block */ struct notifier_block sLINNotifBlock; - - + /* IMG structures used, to minimise API function code */ + /* replace with own structures where necessary */ - + /* Address of the surface being displayed */ IMG_DEV_VIRTADDR sDisplayDevVAddr; DISPLAY_INFO sDisplayInfo; - + /* Display format */ DISPLAY_FORMAT sDisplayFormat; - + /* Display dimensions */ DISPLAY_DIMS sDisplayDim; - + /* True if screen is blanked */ OMAPLFB_ATOMIC_BOOL sBlanked; - + /* Number of blank/unblank events */ OMAPLFB_ATOMIC_INT sBlankEvents; #ifdef CONFIG_HAS_EARLYSUSPEND - + /* Set by early suspend */ OMAPLFB_ATOMIC_BOOL sEarlySuspendFlag; struct early_suspend sEarlySuspend; @@ -192,6 +231,7 @@ typedef struct OMAPLFB_DEVINFO_TAG #define OMAPLFB_PAGE_SIZE 4096 +/* DEBUG only printk */ #ifdef DEBUG #define DEBUG_PRINTK(x) printk x #else @@ -203,6 +243,10 @@ typedef struct OMAPLFB_DEVINFO_TAG #define DEVNAME DRVNAME #define DRIVER_PREFIX DRVNAME +/*! + ***************************************************************************** + * Error values + *****************************************************************************/ typedef enum _OMAPLFB_ERROR_ { OMAPLFB_OK = 0, @@ -232,6 +276,7 @@ typedef enum _OMAPLFB_UPDATE_MODE_ OMAPLFB_ERROR OMAPLFBInit(void); OMAPLFB_ERROR OMAPLFBDeInit(void); +/* OS Specific APIs */ OMAPLFB_DEVINFO *OMAPLFBGetDevInfoPtr(unsigned uiFBDevID); unsigned OMAPLFBMaxFBDevIDPlusOne(void); void *OMAPLFBAllocKernelMem(unsigned long ulSize); @@ -265,5 +310,15 @@ void OMAPLFBAtomicIntSet(OMAPLFB_ATOMIC_INT *psAtomic, int iVal); int OMAPLFBAtomicIntRead(OMAPLFB_ATOMIC_INT *psAtomic); void OMAPLFBAtomicIntInc(OMAPLFB_ATOMIC_INT *psAtomic); -#endif +#if defined(DEBUG) +void OMAPLFBPrintInfo(OMAPLFB_DEVINFO *psDevInfo); +#else +#define OMAPLFBPrintInfo(psDevInfo) +#endif + +#endif /* __OMAPLFB_H__ */ + +/****************************************************************************** + End of file (omaplfb.h) +******************************************************************************/ diff --git a/services4/3rdparty/dc_omapfb3_linux/omaplfb_displayclass.c b/services4/3rdparty/dc_omapfb3_linux/omaplfb_displayclass.c index 0f139ab..085b5a1 100644 --- a/services4/3rdparty/dc_omapfb3_linux/omaplfb_displayclass.c +++ b/services4/3rdparty/dc_omapfb3_linux/omaplfb_displayclass.c @@ -1,28 +1,77 @@ -/********************************************************************** - * - * Copyright(c) Imagination Technologies Ltd. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful but, except - * as otherwise stated in writing, 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., - * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - * - * The full GNU General Public License is included in this distribution in - * the file called "COPYING". - * - * Contact Information: - * Imagination Technologies Ltd. - * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK - * - ******************************************************************************/ +/*************************************************************************/ /*! +@Title OMAP common display driver components +@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. + +*/ /**************************************************************************/ + +/************************************************************************** + The 3rd party driver is a specification of an API to integrate the IMG POWERVR + Services driver with 3rd Party display hardware. It is NOT a specification for + a display controller driver, rather a specification to extend the API for a + pre-existing driver for the display hardware. + + The 3rd party driver interface provides IMG POWERVR client drivers (e.g. PVR2D) + with an API abstraction of the system's underlying display hardware, allowing + the client drivers to indirectly control the display hardware and access its + associated memory. + + Functions of the API include + - query primary surface attributes (width, height, stride, pixel format, CPU + physical and virtual address) + - swap/flip chain creation and subsequent query of surface attributes + - asynchronous display surface flipping, taking account of asynchronous read + (flip) and write (render) operations to the display surface + + Note: having queried surface attributes the client drivers are able to map the + display memory to any IMG POWERVR Services device by calling + PVRSRVMapDeviceClassMemory with the display surface handle. + + This code is intended to be an example of how a pre-existing display driver may + be extended to support the 3rd Party Display interface to POWERVR Services + - IMG is not providing a display driver implementation. + **************************************************************************/ + +/* + * OMAP Linux 3rd party display driver. + * This is based on the Generic PVR Linux Framebuffer 3rd party display + * driver, with OMAP specific extensions to support flipping. + */ #include #include @@ -32,26 +81,45 @@ #include #include +/* IMG services headers */ #include "img_defs.h" #include "servicesext.h" #include "kerneldisplay.h" #include "omaplfb.h" +#if defined(CONFIG_DSSCOMP) + +#if !defined(CONFIG_ION_OMAP) +#error CONFIG_DSSCOMP support requires CONFIG_ION_OMAP +#endif + +#include +#include + +extern struct ion_client *gpsIONClient; + +#include +#include