gpu: remove unused rogue_m driver

Change-Id: I2d38df29926bc7c2e7e618b777cd36768cab0d0e
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
This commit is contained in:
Tao Huang
2021-04-13 18:40:34 +08:00
parent b72885a1c1
commit 33bae277f6
434 changed files with 0 additions and 160526 deletions

View File

@@ -1,344 +0,0 @@
-------------------------------------------------------------------------
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.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) 19yy <name of author>
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.
<signature of Ty Coon>, 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.
-------------------------------------------------------------------------

View File

@@ -1,58 +0,0 @@
Rogue Embedded Systems DDK for the Linux kernel.
Copyright (C) Imagination Technologies Ltd. All rights reserved.
======================================================================
This file covers how to build and install the Imagination Technologies
Rogue DDK for the Linux kernel. For full details, see the relevant platform
guide.
Build System Environment Variables
-------------------------------------------
The Rogue DDK Build scripts depend on a number of environment variables
being setup before compilation or installation of DDK software can
commence:
$DISCIMAGE
The DDK Build scripts install files to the location specified by the
DISCIMAGE environment variable. To do so, they need to know where the
target system image resides:
$ export DISCIMAGE=/path/to/filesystem
If you are building on the target system, you can set this to '/'.
$KERNELDIR
When building the Rogue DDK kernel module, the build needs access
to the headers of the Linux kernel.
If you are building on the target machine, you can set this as follows:
$ export KERNELDIR=/usr/src/linux-headers-`uname -r`
$CROSS_COMPILE
If you intend on targeting a platform that is different from your build
machine (e.g.,if you are compiling on an x86 but targeting ARM) you need
to set the CROSS_COMPILE variable so that the build system uses the correct
compiler. E.g.,
$ export CROSS_COMPILE=arm-linux-gnueabi-
Build and Install Instructions
-------------------------------------------
The Rogue DDK configures different target builds within directories under
build/linux/.
The most interesting build targets are:
build Makes everything
clobber Removes all binaries for all builds as well.
install Runs the install script generated by the build.
The following variables may be set on the command line to influence a build.
BUILD The type of build being performed.
Alternatives are release, timing or debug.
To build for, change to the appropriate target directory, e.g.:
$ cd eurasiacon/build/linux/<platform>
$ make BUILD=debug
$ sudo make install

View File

@@ -1,10 +0,0 @@
# SPDX-License-Identifier: GPL-2.0
config POWERVR_ROGUE_M
tristate "PowerVR Rogue M"
select PM_OPP
default n
help
Driver for PowerVR Rogue hardware.
Say Y here if your SoC contains a PowerVR Rogue GPU. For more
information, see <http://www.imgtec.com/powervr/>.

View File

@@ -1,41 +0,0 @@
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.
-----------------------------------------------------------------------------

View File

@@ -1,251 +0,0 @@
# SPDX-License-Identifier: GPL-2.0
include drivers/gpu/rogue_m/config_kernel.mk
obj-$(CONFIG_POWERVR_ROGUE_M) += pvrsrvkm.o
ccflags-y += -include $(srctree)/drivers/gpu/rogue_m/config_kernel.h \
-Idrivers/gpu/rogue_m \
-Idrivers/gpu/rogue_m/hwdefs \
-Idrivers/gpu/rogue_m/hwdefs/km \
-Idrivers/gpu/rogue_m/system/include \
-Idrivers/gpu/rogue_m/system/common \
-Idrivers/gpu/rogue_m/system/$(PVR_SYSTEM) \
-Idrivers/gpu/rogue_m/services/server/include \
-Idrivers/gpu/rogue_m/include \
-Idrivers/gpu/rogue_m/services/include \
-Idrivers/gpu/rogue_m/services/include/shared \
-Idrivers/gpu/rogue_m/services/shared/include \
-Idrivers/gpu/rogue_m/services/shared/devices/rgx \
-Idrivers/gpu/rogue_m/services/server/env/linux \
-Idrivers/gpu/rogue_m/kernel/drivers/staging/imgtec \
-Idrivers/gpu/rogue_m/services/include/env/linux \
-Idrivers/gpu/rogue_m/services/server/devices/rgx
tmp := $(addprefix -I,$(wildcard $(srctree)/drivers/gpu/rogue_m/generated/*))
ccflags-y += $(tmp)
########
pvrsrvkm-y += \
services/server/env/linux/event.o \
services/server/env/linux/mm.o \
services/server/env/linux/mmap.o \
services/server/env/linux/module.o \
services/server/env/linux/module_common.o \
services/server/env/linux/devicemem_mmap_stub.o \
services/server/env/linux/osfunc.o \
services/server/env/linux/allocmem.o \
services/server/env/linux/osconnection_server.o \
services/server/env/linux/pdump.o \
services/server/env/linux/physmem_osmem_linux.o \
services/server/env/linux/pvr_debugfs.o \
services/server/env/linux/pvr_bridge_k.o \
services/server/env/linux/pvr_debug.o \
services/server/env/linux/physmem_tdmetacode_linux.o \
services/server/env/linux/physmem_tdsecbuf_linux.o \
services/server/common/devicemem_heapcfg.o \
services/shared/common/devicemem.o \
services/shared/common/devicemem_utils.o \
services/shared/common/mem_utils.o \
services/shared/common/hash.o \
services/shared/common/ra.o \
services/shared/common/sync.o \
services/shared/common/dllist.o \
services/server/common/devicemem_server.o \
services/server/common/handle.o \
services/server/common/lists.o \
services/server/common/mmu_common.o \
services/server/common/connection_server.o \
services/server/common/physheap.o \
services/server/common/physmem.o \
services/server/common/physmem_lma.o \
services/server/common/pmr.o \
services/server/common/power.o \
services/server/common/process_stats.o \
services/server/common/pvrsrv.o \
services/server/common/srvcore.o \
services/server/common/sync_server.o \
services/server/common/tlintern.o \
services/shared/common/tlclient.o \
services/server/common/tlserver.o \
services/server/common/tlstream.o \
services/shared/common/uniq_key_splay_tree.o \
services/server/devices/rgx/rgxsync.o
ifeq ($(SUPPORT_DISPLAY_CLASS),1)
pvrsrvkm-y += \
services/server/common/dc_server.o \
services/server/common/scp.o
endif
ifeq ($(PVR_RI_DEBUG),1)
pvrsrvkm-y += services/server/common/ri_server.o
endif
ifeq ($(PVR_HANDLE_BACKEND),generic)
pvrsrvkm-y += services/server/common/handle_generic.o
else
ifeq ($(PVR_HANDLE_BACKEND),idr)
pvrsrvkm-y += services/server/env/linux/handle_idr.o
endif
endif
ifeq ($(SUPPORT_GPUTRACE_EVENTS),1)
pvrsrvkm-y += services/server/env/linux/pvr_gputrace.o
endif
pvrsrvkm-$(CONFIG_X86) += services/server/env/linux/osfunc_x86.o
pvrsrvkm-$(CONFIG_ARM) += services/server/env/linux/osfunc_arm.o
pvrsrvkm-$(CONFIG_ARM64) += services/server/env/linux/osfunc_arm64.o
pvrsrvkm-$(CONFIG_METAG) += osfunc_metag.o
pvrsrvkm-$(CONFIG_MIPS) += osfunc_mips.o
pvrsrvkm-$(CONFIG_EVENT_TRACING) += services/server/env/linux/trace_events.o
ifeq ($(PDUMP),1)
pvrsrvkm-y += \
services/server/common/pdump_common.o \
services/server/common/pdump_mmu.o \
services/server/common/pdump_physmem.o \
services/shared/common/devicemem_pdump.o
endif
pvrsrvkm-y += \
services/server/devices/rgx/rgxinit.o \
services/server/devices/rgx/rgxdebug.o \
services/server/devices/rgx/rgxhwperf.o \
services/server/devices/rgx/rgxmem.o \
services/server/devices/rgx/rgxta3d.o \
services/server/devices/rgx/rgxcompute.o \
services/server/devices/rgx/rgxccb.o \
services/server/devices/rgx/rgxmmuinit.o \
services/server/devices/rgx/rgxpower.o \
services/server/devices/rgx/rgxtransfer.o \
services/server/devices/rgx/rgxutils.o \
services/server/devices/rgx/rgxfwutils.o \
services/server/devices/rgx/rgxbreakpoint.o \
services/server/devices/rgx/debugmisc_server.o \
services/shared/devices/rgx/rgx_compat_bvnc.o \
services/server/devices/rgx/rgxregconfig.o \
services/server/devices/rgx/rgxtimerquery.o \
services/server/devices/rgx/rgxtimecorr.o
ifeq ($(SUPPORT_RAY_TRACING),1)
pvrsrvkm-y += rgxray.o
endif
ifeq ($(PDUMP),1)
pvrsrvkm-y += services/server/devices/rgx/rgxpdump.o
endif
ifeq ($(SUPPORT_NATIVE_FENCE_SYNC),1)
pvrsrvkm-y += \
kernel/drivers/staging/imgtec/pvr_sync.o
endif
pvrsrvkm-y += \
generated/mm_bridge/server_mm_bridge.o \
generated/dmm_bridge/client_mm_bridge.o \
generated/pdumpmm_bridge/server_pdumpmm_bridge.o \
generated/dpdumpmm_bridge/client_pdumpmm_bridge.o \
generated/cmm_bridge/server_cmm_bridge.o \
generated/pdump_bridge/server_pdump_bridge.o \
generated/rgxtq_bridge/server_rgxtq_bridge.o \
generated/rgxinit_bridge/server_rgxinit_bridge.o \
generated/rgxta3d_bridge/server_rgxta3d_bridge.o \
generated/rgxcmp_bridge/server_rgxcmp_bridge.o \
generated/srvcore_bridge/server_srvcore_bridge.o \
generated/sync_bridge/server_sync_bridge.o \
generated/dsync_bridge/client_sync_bridge.o \
generated/breakpoint_bridge/server_breakpoint_bridge.o \
generated/debugmisc_bridge/server_debugmisc_bridge.o \
generated/rgxpdump_bridge/server_rgxpdump_bridge.o \
generated/pvrtl_bridge/server_pvrtl_bridge.o \
generated/dpvrtl_bridge/client_pvrtl_bridge.o \
generated/rgxhwperf_bridge/server_rgxhwperf_bridge.o \
generated/regconfig_bridge/server_regconfig_bridge.o \
generated/timerquery_bridge/server_timerquery_bridge.o \
generated/pdumpctrl_bridge/server_pdumpctrl_bridge.o
ifeq ($(PVR_RI_DEBUG),1)
pvrsrvkm-y += \
generated/ri_bridge/server_ri_bridge.o \
generated/dri_bridge/client_ri_bridge.o
endif
ifeq ($(SUPPORT_DISPLAY_CLASS),1)
pvrsrvkm-y += \
generated/dc_bridge/server_dc_bridge.o
endif
ifeq ($(SUPPORT_RAY_TRACING),1)
pvrsrvkm-y += generated/rgxray_bridge/server_rgxray_bridge.o
endif
ifeq ($(CACHEFLUSH_TYPE),CACHEFLUSH_GENERIC)
pvrsrvkm-y += \
services/server/common/cache_generic.o \
generated/cachegeneric_bridge/server_cachegeneric_bridge.o
endif
ifeq ($(SUPPORT_SECURE_EXPORT),1)
pvrsrvkm-y += \
services/server/env/linux/ossecure_export.o \
generated/smm_bridge/server_smm_bridge.o \
generated/syncsexport_bridge/server_syncsexport_bridge.o
endif
ifeq ($(SUPPORT_INSECURE_EXPORT),1)
pvrsrvkm-y += \
generated/syncexport_bridge/server_syncexport_bridge.o
endif
ifeq ($(SUPPORT_ION),1)
pvrsrvkm-y += generated/dmabuf_bridge/server_dmabuf_bridge.o
pvrsrvkm-y += services/server/env/linux/physmem_dmabuf.o
endif # SUPPORT_ION
#ccflags-y += \
# -mno-soft-float
#dc_pdp-y += \
# dc_pdp/dc_pdp.o \
# dc_pdp/pdp_osfuncs.o \
# dc_osfuncs.o
pvrsrvkm-y += \
system/$(PVR_SYSTEM)/sysconfig.o
# system/common/pci_support.o
ifeq ($(PVR_SYSTEM),rgx_tc)
pvrsrvkm-y += system/$(PVR_SYSTEM)/apollo_flasher_linux.o
endif
ifeq ($(PVR_SYSTEM),rk3368)
pvrsrvkm-y += system/$(PVR_SYSTEM)/rk_init.o
endif
#ifneq ($(SUPPORT_DRM),1)
#pvrsrvkm-y += system/common/interrupt_support.o
#endif
ifeq ($(SUPPORT_ION),1)
ifeq ($(LMA),1)
# For LMA, use the TC-specific ion heap.
pvrsrvkm-y += \
system/$(PVR_SYSTEM)/ion_support.o \
system/common/ion_lma_heap.o
else
# For UMA, use the generic ion support code, which creates heaps from system
# memory.
#pvrsrvkm-y += \
# system/common/ion_support_generic.o
endif # LMA
endif # SUPPORT_ION
dbgdrv-y += \
tools/services/debug/dbgdriv/common/dbgdriv.o \
tools/services/debug/dbgdriv/common/ioctl.o \
tools/services/debug/dbgdriv/common/handle.o \
tools/services/debug/dbgdriv/linux/main.o \
tools/services/debug/dbgdriv/linux/hostfunc.o

View File

@@ -1,32 +0,0 @@
Rogue Embedded Systems DDK for Linux kernel.
Copyright (C) Imagination Technologies Ltd. All rights reserved.
======================================================================
About
-------------------------------------------
This is the Imagination Technologies Rogue DDK for the Linux kernel.
License
-------------------------------------------
You may use, distribute and copy this software under the terms of the MIT
license. Details of this license can be found in the file "MIT-COPYING".
Alternatively, you may use, distribute and copy this software under the terms
of the GNU General Public License version 2. The full GNU General Public
License version 2 can be found in the file "GPL-COPYING".
Build and Install Instructions
-------------------------------------------
For details see the "INSTALL" file and the platform guide.
Contact information:
-------------------------------------------
Imagination Technologies Ltd. <gpl-support@imgtec.com>
Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK

View File

@@ -1,125 +0,0 @@
########################################################################### ###
#@Title Useful special targets which don't build anything
#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
#@License Dual MIT/GPLv2
#
# The contents of this file are subject to the MIT license as set out below.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# Alternatively, the contents of this file may be used under the terms of
# the GNU General Public License Version 2 ("GPL") in which case the provisions
# of GPL are applicable instead of those above.
#
# If you wish to allow use of your version of this file only under the terms of
# GPL, and not to allow others to use your version of this file under the terms
# of the MIT license, indicate your decision by deleting the provisions above
# and replace them with the notice and other provisions required by GPL as set
# out in the file called "GPL-COPYING" included in this distribution. If you do
# not delete the provisions above, a recipient may use your version of this file
# under the terms of either the MIT license or GPL.
#
# This License is also included in this distribution in the file called
# "MIT-COPYING".
#
# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
### ###########################################################################
ifneq ($(filter dumpvar-%,$(MAKECMDGOALS)),)
dumpvar-%: ;
$(foreach _var_to_dump,$(patsubst dumpvar-%,%,$(filter dumpvar-%,$(MAKECMDGOALS))),$(info $(if $(filter undefined,$(origin $(_var_to_dump))),# $$($(_var_to_dump)) is not set,$(_var_to_dump) := $($(_var_to_dump)))))
endif
ifneq ($(filter whereis-%,$(MAKECMDGOALS)),)
whereis-%: ;
$(foreach _module_to_find,$(patsubst whereis-%,%,$(filter whereis-%,$(MAKECMDGOALS))),$(info $(if $(INTERNAL_MAKEFILE_FOR_MODULE_$(_module_to_find)),$(INTERNAL_MAKEFILE_FOR_MODULE_$(_module_to_find)),# No module $(_module_to_find))))
endif
ifneq ($(filter whatis-%,$(MAKECMDGOALS)),)
whatis-$(HOST_OUT)/%: ;
whatis-$(TARGET_PRIMARY_OUT)/%: ;
whatis-$(TARGET_NEUTRAL_OUT)/%: ;
$(foreach _file_to_find,$(patsubst whatis-%,%,$(filter whatis-%,$(MAKECMDGOALS))),$(info $(strip $(foreach _m,$(ALL_MODULES),$(if $(filter $(_file_to_find),$(INTERNAL_TARGETS_FOR_$(_m))),$(_file_to_find) is in $(_m) which is defined in $(INTERNAL_MAKEFILE_FOR_MODULE_$(_m)),)))))
endif
.PHONY: ls-modules
ls-modules:
@: $(foreach _m,$(ALL_MODULES),$(info $($(_m)_type) $(_m) $(patsubst $(TOP)/%,%,$(INTERNAL_MAKEFILE_FOR_MODULE_$(_m)))))
.PHONY: ls-types
ls-types:
@: $(info $(sort $(patsubst host_%,%,$(foreach _m,$(ALL_MODULES),$($(_m)_type)))))
ifeq ($(strip $(MAKECMDGOALS)),visualise)
FORMAT ?= xlib
GRAPHVIZ ?= neato
visualise: $(OUT)/MAKE_RULES.dot
$(GRAPHVIZ) -T$(FORMAT) -o $(OUT)/MAKE_RULES.$(FORMAT) $<
$(OUT)/MAKE_RULES.dot: $(OUT)/MAKE_RULES
perl $(MAKE_TOP)/tools/depgraph.pl -t $(TOP) -g $(firstword $(GRAPHVIZ)) $(OUT)/MAKE_RULES >$(OUT)/MAKE_RULES.dot
$(OUT)/MAKE_RULES: $(ALL_MAKEFILES)
-$(MAKE) -C $(TOP) -f $(MAKE_TOP)/toplevel.mk TOP=$(TOP) OUT=$(OUT) ls-modules -qp >$(OUT)/MAKE_RULES 2>&1
else
visualise:
@: $(error visualise specified along with other goals. This is not supported)
endif
.PHONY: help confighelp
help:
@echo 'Build targets'
@echo ' make, make build Build all components of the build'
@echo ' make components Build only the user-mode components'
@echo ' make kbuild Build only the kernel-mode components'
@echo " make docs Build the build's supporting documentation"
@echo ' make MODULE Build the module MODULE and all of its dependencies'
@echo ' make binary_.../target/libsomething.so'
@echo ' Build a particular file (including intermediates)'
@echo 'Variables'
@echo ' make V=1 ... Print the commands that are executed'
@echo ' make W=1 ... Enable extra compiler warnings'
@echo ' make D=opt ... Set build system debug option (D=help for a list)'
@echo ' make OUT=dir ... Place output+intermediates in specified directory'
@echo ' make CHECK=cmd ... Check source with static analyser or other tool'
@echo ' EXCLUDED_APIS=... List of APIs to remove from the build'
@echo ' make SOMEOPTION=1 ... Set configuration options (see "make confighelp")'
@echo ' Defaults are set by $(PVR_BUILD_DIR)/Makefile'
@echo 'Clean targets'
@echo ' make clean Remove output files for the current build'
@echo ' make clobber As "make clean", but remove build config too'
@echo ' make clean-MODULE Clean (or clobber) only files for MODULE'
@echo ''
@echo 'Special targets'
@echo ' make whereis-MODULE Show the path to the Linux.mk defining MODULE'
@echo ' make whatis-FILE Show which module builds an output FILE'
@echo ' make ls-modules List all modules defined by makefiles'
# This rule runs in the configuration stage, in config/help.mk. Make a dummy
# target here to suppress "no rule to make target 'confighelp' messages.
confighelp: ;
ifneq ($(filter help,$(D)),)
empty :=
space := $(empty) $(empty)
$(info Debug options)
$(info $(space)D=modules dump module info)
$(info $(space)D=config dump all config options + type and origin)
$(info $(space)D=freeze-config prevent config changes)
$(info $(space)D=config-changes dump diffs when config changes)
$(info $(space)D=nobuild stop before running the main build)
$(info Options can be combined: make D=freeze-config,config-changes)
$(error D=help given)
endif

View File

@@ -1,281 +0,0 @@
########################################################################### ###
#@Title Define global variables
#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
#@Description This file is read once at the start of the build, after reading
# in config.mk. It should define the non-MODULE_* variables used
# in commands, like ALL_CFLAGS
#@License Dual MIT/GPLv2
#
# The contents of this file are subject to the MIT license as set out below.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# Alternatively, the contents of this file may be used under the terms of
# the GNU General Public License Version 2 ("GPL") in which case the provisions
# of GPL are applicable instead of those above.
#
# If you wish to allow use of your version of this file only under the terms of
# GPL, and not to allow others to use your version of this file under the terms
# of the MIT license, indicate your decision by deleting the provisions above
# and replace them with the notice and other provisions required by GPL as set
# out in the file called "GPL-COPYING" included in this distribution. If you do
# not delete the provisions above, a recipient may use your version of this file
# under the terms of either the MIT license or GPL.
#
# This License is also included in this distribution in the file called
# "MIT-COPYING".
#
# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
### ###########################################################################
# NOTE: You must *not* use the cc-option et al macros in COMMON_FLAGS,
# COMMON_CFLAGS or COMMON_USER_FLAGS. These flags are shared between
# host and target, which might use compilers with different capabilities.
# ANOTHER NOTE: All flags here must be architecture-independent (i.e. no
# -march or toolchain include paths)
# These flags are used for kernel, User C and User C++
#
COMMON_FLAGS := -W -Wall
# Some GCC warnings are C only, so we must mask them from C++
#
COMMON_CFLAGS := $(COMMON_FLAGS) \
-Wdeclaration-after-statement -Wno-format-zero-length \
-Wmissing-prototypes -Wstrict-prototypes
# User C and User C++ optimization control. Does not affect kernel.
#
ifeq ($(BUILD),debug)
COMMON_USER_FLAGS := -O0
else
OPTIM ?= -O2
ifeq ($(USE_LTO),1)
COMMON_USER_FLAGS := $(OPTIM) -flto
else
COMMON_USER_FLAGS := $(OPTIM)
endif
endif
# GCOV support for user-mode coverage statistics
#
ifeq ($(GCOV_BUILD),on)
COMMON_USER_FLAGS += -fprofile-arcs -ftest-coverage
endif
# Driver has not yet been audited for aliasing issues
#
COMMON_USER_FLAGS += -fno-strict-aliasing
# We always enable debugging. Either the release binaries are stripped
# and the symbols put in the symbolpackage, or we're building debug.
#
COMMON_USER_FLAGS += -g
# User C and User C++ warning flags
#
COMMON_USER_FLAGS += \
-Wpointer-arith -Wunused-parameter \
-Wmissing-format-attribute
# Additional warnings, and optional warnings.
#
TESTED_TARGET_USER_FLAGS := \
$(call cc-option,-Wno-missing-field-initializers) \
$(call cc-option,-fdiagnostics-show-option) \
$(call cc-option,-Wno-self-assign) \
$(call cc-option,-Wno-parentheses-equality)
TESTED_HOST_USER_FLAGS := \
$(call host-cc-option,-Wno-missing-field-initializers) \
$(call host-cc-option,-fdiagnostics-show-option) \
$(call host-cc-option,-Wno-self-assign) \
$(call host-cc-option,-Wno-parentheses-equality)
# These flags are clang-specific.
# -Wno-unused-command-line-argument works around a buggy interaction
# with ccache, see https://bugzilla.samba.org/show_bug.cgi?id=8118
# -fcolor-diagnostics force-enables colored error messages which
# get disabled when ccache is piped through ccache.
#
TESTED_TARGET_USER_FLAGS += \
$(call cc-option,-Qunused-arguments) \
$(call cc-option,-fcolor-diagnostics)
TESTED_HOST_USER_FLAGS += \
$(call host-cc-option,-Qunused-arguments) \
$(call host-cc-option,-fcolor-diagnostics)
ifeq ($(W),1)
TESTED_TARGET_USER_FLAGS += \
$(call cc-option,-Wbad-function-cast) \
$(call cc-option,-Wcast-qual) \
$(call cc-option,-Wcast-align) \
$(call cc-option,-Wconversion) \
$(call cc-option,-Wdisabled-optimization) \
$(call cc-option,-Wlogical-op) \
$(call cc-option,-Wmissing-declarations) \
$(call cc-option,-Wmissing-include-dirs) \
$(call cc-option,-Wnested-externs) \
$(call cc-option,-Wold-style-definition) \
$(call cc-option,-Woverlength-strings) \
$(call cc-option,-Wpacked) \
$(call cc-option,-Wpacked-bitfield-compat) \
$(call cc-option,-Wpadded) \
$(call cc-option,-Wredundant-decls) \
$(call cc-option,-Wshadow) \
$(call cc-option,-Wswitch-default) \
$(call cc-option,-Wvla) \
$(call cc-option,-Wwrite-strings)
TESTED_HOST_USER_FLAGS += \
$(call host-cc-option,-Wbad-function-cast) \
$(call host-cc-option,-Wcast-qual) \
$(call host-cc-option,-Wcast-align) \
$(call host-cc-option,-Wconversion) \
$(call host-cc-option,-Wdisabled-optimization) \
$(call host-cc-option,-Wlogical-op) \
$(call host-cc-option,-Wmissing-declarations) \
$(call host-cc-option,-Wmissing-include-dirs) \
$(call host-cc-option,-Wnested-externs) \
$(call host-cc-option,-Wold-style-definition) \
$(call host-cc-option,-Woverlength-strings) \
$(call host-cc-option,-Wpacked) \
$(call host-cc-option,-Wpacked-bitfield-compat) \
$(call host-cc-option,-Wpadded) \
$(call host-cc-option,-Wredundant-decls) \
$(call host-cc-option,-Wshadow) \
$(call host-cc-option,-Wswitch-default) \
$(call host-cc-option,-Wvla) \
$(call host-cc-option,-Wwrite-strings)
endif
TESTED_TARGET_USER_FLAGS += \
$(call cc-optional-warning,-Wunused-but-set-variable) \
$(call cc-optional-warning,-Wtypedef-redefinition)
TESTED_HOST_USER_FLAGS += \
$(call host-cc-optional-warning,-Wunused-but-set-variable) \
$(call host-cc-optional-warning,-Wtypedef-redefinition)
KBUILD_FLAGS := \
-Wno-unused-parameter -Wno-sign-compare
TESTED_KBUILD_FLAGS := \
$(call kernel-cc-option,-Wmissing-include-dirs) \
$(call kernel-cc-option,-Wno-type-limits) \
$(call kernel-cc-option,-Wno-pointer-arith) \
$(call kernel-cc-option,-Wno-aggregate-return) \
$(call kernel-cc-option,-Wno-unused-but-set-variable) \
$(call kernel-cc-optional-warning,-Wbad-function-cast) \
$(call kernel-cc-optional-warning,-Wcast-qual) \
$(call kernel-cc-optional-warning,-Wcast-align) \
$(call kernel-cc-optional-warning,-Wconversion) \
$(call kernel-cc-optional-warning,-Wdisabled-optimization) \
$(call kernel-cc-optional-warning,-Wlogical-op) \
$(call kernel-cc-optional-warning,-Wmissing-declarations) \
$(call kernel-cc-optional-warning,-Wmissing-include-dirs) \
$(call kernel-cc-optional-warning,-Wnested-externs) \
$(call kernel-cc-optional-warning,-Wno-missing-field-initializers) \
$(call kernel-cc-optional-warning,-Wold-style-definition) \
$(call kernel-cc-optional-warning,-Woverlength-strings) \
$(call kernel-cc-optional-warning,-Wpacked) \
$(call kernel-cc-optional-warning,-Wpacked-bitfield-compat) \
$(call kernel-cc-optional-warning,-Wpadded) \
$(call kernel-cc-optional-warning,-Wredundant-decls) \
$(call kernel-cc-optional-warning,-Wshadow) \
$(call kernel-cc-optional-warning,-Wswitch-default) \
$(call kernel-cc-optional-warning,-Wvla) \
$(call kernel-cc-optional-warning,-Wwrite-strings)
# User C only
#
ALL_CFLAGS := \
$(COMMON_USER_FLAGS) $(COMMON_CFLAGS) $(TESTED_TARGET_USER_FLAGS) \
$(SYS_CFLAGS)
ALL_HOST_CFLAGS := \
$(COMMON_USER_FLAGS) $(COMMON_CFLAGS) $(TESTED_HOST_USER_FLAGS)
# User C++ only
#
ALL_CXXFLAGS := \
-fno-rtti -fno-exceptions \
$(COMMON_USER_FLAGS) $(COMMON_FLAGS) $(TESTED_TARGET_USER_FLAGS) \
$(SYS_CXXFLAGS)
ALL_HOST_CXXFLAGS := \
-fno-rtti -fno-exceptions \
$(COMMON_USER_FLAGS) $(COMMON_FLAGS) $(TESTED_HOST_USER_FLAGS)
# Workaround for some target clangs that don't support -O0 w/ PIC.
#
ifeq ($(cc-is-clang),true)
ALL_CFLAGS := $(patsubst -O0,-O1,$(ALL_CFLAGS))
ALL_CXXFLAGS := $(patsubst -O0,-O1,$(ALL_CXXFLAGS))
endif
# Add GCOV_DIR just for target
#
ifeq ($(GCOV_BUILD),on)
ifneq ($(GCOV_DIR),)
ALL_CFLAGS += -fprofile-dir=$(GCOV_DIR)
ALL_CXXFLAGS += -fprofile-dir=$(GCOV_DIR)
endif
endif
# Kernel C only
#
ALL_KBUILD_CFLAGS := $(COMMON_CFLAGS) $(KBUILD_FLAGS) $(TESTED_KBUILD_FLAGS)
# User C and C++
#
# NOTE: ALL_HOST_LDFLAGS should probably be using -rpath-link too, and if we
# ever need to support building host shared libraries, it's required.
#
# We can't use it right now because we want to support non-GNU-compatible
# linkers like the Darwin 'ld' which doesn't support -rpath-link.
#
# For the same reason (Darwin 'ld') don't bother checking for text
# relocations in host binaries.
#
ALL_HOST_LDFLAGS :=
ALL_LDFLAGS := -Wl,--warn-shared-textrel
ifeq ($(GCOV_BUILD),on)
ALL_LDFLAGS += -fprofile-arcs
ALL_HOST_LDFLAGS += -fprofile-arcs
endif
ALL_LDFLAGS += $(SYS_LDFLAGS)
# This variable contains a list of all modules built by kbuild
ALL_KBUILD_MODULES :=
# This variable contains a list of all modules which contain C++ source files
ALL_CXX_MODULES :=
# Toolchain triple for cross environment
CROSS_TRIPLE := $(patsubst %-,%,$(CROSS_COMPILE))
ifneq ($(TOOLCHAIN),)
$(warning **********************************************)
$(warning The TOOLCHAIN option has been removed, but)
$(warning you have it set (via $(origin TOOLCHAIN)))
$(warning **********************************************)
endif
# We need the glibc version to generate the cache names for LLVM and XOrg components.
ifeq ($(CROSS_COMPILE),)
LIBC_VERSION_PROBE := $(shell ldd $(shell which true) | awk '/libc.so/{print $$3'} )
LIBC_VERSION := $(shell $(LIBC_VERSION_PROBE)| tr -d '(),' | head -1)
endif

View File

@@ -1,357 +0,0 @@
########################################################################### ###
#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
#@License Dual MIT/GPLv2
#
# The contents of this file are subject to the MIT license as set out below.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# Alternatively, the contents of this file may be used under the terms of
# the GNU General Public License Version 2 ("GPL") in which case the provisions
# of GPL are applicable instead of those above.
#
# If you wish to allow use of your version of this file only under the terms of
# GPL, and not to allow others to use your version of this file under the terms
# of the MIT license, indicate your decision by deleting the provisions above
# and replace them with the notice and other provisions required by GPL as set
# out in the file called "GPL-COPYING" included in this distribution. If you do
# not delete the provisions above, a recipient may use your version of this file
# under the terms of either the MIT license or GPL.
#
# This License is also included in this distribution in the file called
# "MIT-COPYING".
#
# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
### ###########################################################################
# from-one-* recipes make a thing from one source file, so they use $<. Others
# use $(MODULE_something) instead of $^
# We expect that MODULE_*FLAGS contains all the flags we need, including the
# flags for all modules (like $(ALL_CFLAGS) and $(ALL_HOST_CFLAGS)), and
# excluding flags for include search dirs or for linking libraries. The
# exceptions are ALL_EXE_LDFLAGS and ALL_LIB_LDFLAGS, since they depend on the
# type of thing being linked, so they appear in the commands below
define host-o-from-one-c
$(if $(V),,@echo " HOST_CC " $(call relative-to-top,$<))
$(MODULE_CC) -MD -MF $(patsubst %.o,%.d,$@) -c $(MODULE_CFLAGS) \
$(MODULE_INCLUDE_FLAGS) -include $(CONFIG_H) $< -o $@
endef
define target-o-from-one-c
$(if $(V),,@echo " CC " $(call relative-to-top,$<))
$(MODULE_CC) -MD -MF $(patsubst %.o,%.d,$@) -c $(MODULE_CFLAGS) \
$(MODULE_INCLUDE_FLAGS) -include $(CONFIG_H) $< -o $@
endef
define host-o-from-one-cxx
$(if $(V),,@echo " HOST_CXX" $(call relative-to-top,$<))
$(MODULE_CXX) -MD -MF $(patsubst %.o,%.d,$@) -c $(MODULE_CXXFLAGS) \
$(MODULE_INCLUDE_FLAGS) -include $(CONFIG_H) $< -o $@
endef
define target-o-from-one-cxx
$(if $(V),,@echo " CXX " $(call relative-to-top,$<))
$(MODULE_CXX) -MD -MF $(patsubst %.o,%.d,$@) -c $(MODULE_CXXFLAGS) \
$(MODULE_INCLUDE_FLAGS) -include $(CONFIG_H) $< -o $@
endef
define host-executable-from-o
$(if $(V),,@echo " HOST_LD " $(call relative-to-top,$@))
$(MODULE_CC) $(MODULE_LDFLAGS) \
-o $@ $(sort $(MODULE_ALL_OBJECTS)) $(MODULE_LIBRARY_DIR_FLAGS) \
$(MODULE_LIBRARY_FLAGS)
endef
define host-executable-cxx-from-o
$(if $(V),,@echo " HOST_LD " $(call relative-to-top,$@))
$(MODULE_CXX) $(MODULE_LDFLAGS) \
-o $@ $(sort $(MODULE_ALL_OBJECTS)) $(MODULE_LIBRARY_DIR_FLAGS) \
$(MODULE_LIBRARY_FLAGS)
endef
define target-executable-from-o
$(if $(V),,@echo " LD " $(call relative-to-top,$@))
$(MODULE_CC) \
$(MODULE_EXE_LDFLAGS) $(MODULE_LDFLAGS) -o $@ \
$(MODULE_EXE_CRTBEGIN) $(MODULE_ALL_OBJECTS) $(MODULE_EXE_CRTEND) \
$(MODULE_LIBRARY_DIR_FLAGS) $(MODULE_LIBRARY_FLAGS) $(MODULE_LIBGCC)
endef
define target-executable-cxx-from-o
$(if $(V),,@echo " LD " $(call relative-to-top,$@))
$(MODULE_CXX) \
$(MODULE_EXE_LDFLAGS) $(MODULE_LDFLAGS) -o $@ \
$(MODULE_EXE_CRTBEGIN) $(MODULE_ALL_OBJECTS) $(MODULE_EXE_CRTEND) \
$(MODULE_LIBRARY_DIR_FLAGS) $(MODULE_LIBRARY_FLAGS) $(MODULE_LIBGCC)
endef
define target-shared-library-from-o
$(if $(V),,@echo " LD " $(call relative-to-top,$@))
$(MODULE_CC) -shared -Wl,-Bsymbolic \
$(MODULE_LIB_LDFLAGS) $(MODULE_LDFLAGS) -o $@ \
$(MODULE_LIB_CRTBEGIN) $(MODULE_ALL_OBJECTS) $(MODULE_LIB_CRTEND) \
$(MODULE_LIBRARY_DIR_FLAGS) $(MODULE_LIBRARY_FLAGS) $(MODULE_LIBGCC)
endef
define host-shared-library-from-o
$(if $(V),,@echo " HOST_LD " $(call relative-to-top,$@))
$(MODULE_CC) -shared -Wl,-Bsymbolic \
$(MODULE_LDFLAGS) -o $@ \
$(sort $(MODULE_ALL_OBJECTS)) \
$(MODULE_LIBRARY_DIR_FLAGS) $(MODULE_LIBRARY_FLAGS)
endef
# If there were any C++ source files in a shared library, we use one of
# these recipes, which run the C++ compiler to link the final library
define target-shared-library-cxx-from-o
$(if $(V),,@echo " LD " $(call relative-to-top,$@))
$(MODULE_CXX) -shared -Wl,-Bsymbolic \
$(MODULE_LIB_LDFLAGS) $(MODULE_LDFLAGS) -o $@ \
$(MODULE_LIB_CRTBEGIN) $(MODULE_ALL_OBJECTS) $(MODULE_LIB_CRTEND) \
$(MODULE_LIBRARY_DIR_FLAGS) $(MODULE_LIBRARY_FLAGS) $(MODULE_LIBGCC)
endef
define host-shared-library-cxx-from-o
$(if $(V),,@echo " HOST_LD " $(call relative-to-top,$@))
$(MODULE_CXX) -shared -Wl,-Bsymbolic \
$(MODULE_LDFLAGS) -o $@ \
$(sort $(MODULE_ALL_OBJECTS)) \
$(MODULE_LIBRARY_DIR_FLAGS) $(MODULE_LIBRARY_FLAGS)
endef
define host-copy-debug-information
$(HOST_OBJCOPY) --only-keep-debug $@ $(basename $@).dbg
endef
define host-strip-debug-information
$(HOST_STRIP) --strip-unneeded $@
endef
define host-add-debuglink
$(if $(V),,@echo " DBGLINK " $(call relative-to-top,$(basename $@).dbg))
$(HOST_OBJCOPY) --add-gnu-debuglink=$(basename $@).dbg $@
endef
define target-copy-debug-information
$(OBJCOPY) --only-keep-debug $@ $(basename $@).dbg
endef
define target-strip-debug-information
$(STRIP) --strip-unneeded $@
endef
define target-add-debuglink
$(if $(V),,@echo " DBGLINK " $(call relative-to-top,$(basename $@).dbg))
$(OBJCOPY) --add-gnu-debuglink=$(basename $@).dbg $@
endef
define host-static-library-from-o
$(if $(V),,@echo " HOST_AR " $(call relative-to-top,$@))
$(HOST_AR) cru $@ $(sort $(MODULE_ALL_OBJECTS))
endef
define target-static-library-from-o
$(if $(V),,@echo " AR " $(call relative-to-top,$@))
$(AR) cru $@ $(sort $(MODULE_ALL_OBJECTS))
endef
define tab-c-from-y
$(if $(V),,@echo " BISON " $(call relative-to-top,$<))
$(BISON) $(MODULE_BISON_FLAGS) -o $@ -d $<
endef
define l-c-from-l
$(if $(V),,@echo " FLEX " $(call relative-to-top,$<))
$(FLEX) $(MODULE_FLEX_FLAGS) -o$@ $<
endef
define l-cc-from-l
$(if $(V),,@echo " FLEXXX " $(call relative-to-top,$<))
$(FLEXXX) $(MODULE_FLEXXX_FLAGS) -o$@ $<
endef
define clean-dirs
$(if $(V),,@echo " RM " $(call relative-to-top,$(MODULE_DIRS_TO_REMOVE)))
$(RM) -rf $(MODULE_DIRS_TO_REMOVE)
endef
define make-directory
$(MKDIR) -p $@
endef
ifeq ($(DISABLE_CHECK_EXPORTS),)
define check-exports
endef
else
define check-exports
endef
endif
# Check a source file with the program specified in $(CHECK).
# If $(CHECK) is empty, don't do anything.
ifeq ($(CHECK),)
check-src :=
else
define check-src-1
$(if $(V),,@echo " CHECK " $(call relative-to-top,$<))
$(if $(IGNORE_CHECK_ERRORS),-,)$(CHECK) $(MODULE_INCLUDE_FLAGS) \
$(if $(CHECK_NO_CONFIG_H),,-include $(CONFIG_H)) \
$(filter -D%,$(MODULE_CFLAGS)) \
$(CHECKFLAGS) $<
endef
# If CHECK_ONLY is set, only check files matching a Make pattern.
# e.g. CHECK_ONLY=opengles1/%.c
define check-src
$(if $(and $(if $(CHECK_ONLY),$(filter $(CHECK_ONLY),$<),true), \
$(if $(CHECK_EXCLUDE),$(filter-out $(CHECK_EXCLUDE),$<),true)),$(check-src-1),@:)
endef
endif
# Programs used in recipes
BISON ?= bison
CC ?= gcc
CC_SECONDARY ?= $(CC)
CROSS_COMPILE_SECONDARY ?= $(CROSS_COMPILE)
CXX ?= g++
CXX_SECONDARY ?= $(CXX)
HOST_CC ?= gcc
HOST_CXX ?= g++
JAR ?= jar
JAVA ?= java
JAVAC ?= javac
PYTHON ?= python
ZIP ?= zip
ifeq ($(USE_CCACHE),1)
CCACHE ?= ccache
endif
ifeq ($(USE_DISTCC),1)
DISTCC ?= distcc
endif
# Define CHMOD and CC_CHECK first so we can use cc-is-clang
#
override CHMOD := $(if $(V),,@)chmod
override CC_CHECK := $(if $(V),,@)$(MAKE_TOP)/tools/cc-check.sh
# If clang is detected, the compiler name is invariant but CROSS_COMPILE
# is reflected in the use of -target. For GCC this is always encoded into
# the binary. If CROSS_COMPILE is not set we can skip this.
#
# If we're doing a build with multiple target architectures, we might need
# two separate compilers to build binaries for each architecture. In this
# case, CROSS_COMPILE and CROSS_COMPILE_SECONDARY are the cross compiler
# prefix for the two compilers - $(CC) and $(CC_SECONDARY).
#
# Set the secondary compiler first before we overwrite $(CC).
#
ifneq ($(CROSS_COMPILE_SECONDARY),)
ifeq ($(cc-is-clang),true)
override CC_SECONDARY := \
$(CC_SECONDARY) \
-target $(patsubst %-,%,$(CROSS_COMPILE_SECONDARY)) \
-B$(dir $(shell which $(CROSS_COMPILE_SECONDARY)gcc))
override CXX_SECONDARY := \
$(CXX_SECONDARY) \
-target $(patsubst %-,%,$(CROSS_COMPILE_SECONDARY)) \
-B$(dir $(shell which $(CROSS_COMPILE_SECONDARY)gcc))
else
ifeq ($(origin CC_SECONDARY),file)
override CC_SECONDARY := $(CROSS_COMPILE_SECONDARY)$(CC_SECONDARY)
endif
ifeq ($(origin CXX_SECONDARY),file)
override CXX_SECONDARY := $(CROSS_COMPILE_SECONDARY)$(CXX_SECONDARY)
endif
endif
endif
# Apply compiler wrappers and V=1 handling
override CC_SECONDARY := $(if $(V),,@)$(CCACHE)$(DISTCC) $(CC_SECONDARY)
override CXX_SECONDARY := $(if $(V),,@)$(CCACHE)$(DISTCC) $(CXX_SECONDARY)
ifneq ($(CROSS_COMPILE),)
ifeq ($(cc-is-clang),true)
override CC := \
$(CC) \
-target $(patsubst %-,%,$(CROSS_COMPILE)) \
-B$(dir $(shell which $(CROSS_COMPILE)gcc))
override CXX := \
$(CXX) \
-target $(patsubst %-,%,$(CROSS_COMPILE)) \
-B$(dir $(shell which $(CROSS_COMPILE)gcc))
else
ifeq ($(origin CC),file)
override CC := $(CROSS_COMPILE)$(CC)
endif
ifeq ($(origin CXX),file)
override CXX := $(CROSS_COMPILE)$(CXX)
endif
endif
else
$(if $(CROSS_COMPILE_SECONDARY),$(error CROSS_COMPILE_SECONDARY is set but CROSS_COMPILE is empty))
endif
# Apply compiler wrappers and V=1 handling
override CC := $(if $(V),,@)$(CCACHE)$(DISTCC) $(CC)
override CXX := $(if $(V),,@)$(CCACHE)$(DISTCC) $(CXX)
override AR := $(if $(V),,@)$(CROSS_COMPILE)ar
override BISON := $(if $(V),,@)$(BISON)
override BZIP2 := $(if $(V),,@)bzip2 -9
override CAT := $(if $(V),,@)cat
override CHECK := $(if $(CHECK),$(if $(V),,@)$(CHECK),)
override CP := $(if $(V),,@)cp
override ECHO := $(if $(V),,@)echo
override FLEX := $(if $(V),,@)flex
override FLEXXX := $(if $(V),,@)flex++
override GREP := $(if $(V),,@)grep
override HOST_AR := $(if $(V),,@)ar
override HOST_CC := $(if $(V),,@)$(CCACHE) $(HOST_CC)
override HOST_CXX := $(if $(V),,@)$(CCACHE) $(HOST_CXX)
override HOST_OBJCOPY := $(if $(V),,@)objcopy
override HOST_STRIP := $(if $(V),,@)strip
override INSTALL := $(if $(V),,@)install
override JAR := $(if $(V),,@)$(JAR)
override JAVA := $(if $(V),,@)$(JAVA)
override JAVAC := $(if $(V),,@)$(JAVAC)
override LN := $(if $(V),,@)ln -f -s
override M4 := $(if $(V),,@)m4
override MKDIR := $(if $(V),,@)mkdir
override MV := $(if $(V),,@)mv
override OBJCOPY := $(if $(V),,@)$(CROSS_COMPILE)objcopy
override PERL := $(if $(V),,@)perl
override PSC := $(if $(V),,@)$(HOST_OUT)/psc_standalone
override PYTHON := $(if $(V),,@)$(PYTHON)
override RANLIB := $(if $(V),,@)$(CROSS_COMPILE)ranlib
override RM := $(if $(V),,@)rm -f
override ROGUEASM := $(if $(V),,@)$(HOST_OUT)/rogueasm
override SED := $(if $(V),,@)sed
override STRIP := $(if $(V),,@)$(CROSS_COMPILE)strip
override TAR := $(if $(V),,@)tar
override TOUCH := $(if $(V),,@)touch
override TEST := $(if $(V),,@)test
override VHD2INC := $(if $(V),,@)$(HOST_OUT)/vhd2inc
override XXD := $(if $(V),,@)xxd
override ZIP := $(if $(V),,@)$(ZIP)
ifeq ($(SUPPORT_NEUTRINO_PLATFORM),1)
include $(MAKE_TOP)/common/neutrino/commands_neutrino.mk
endif

View File

@@ -1,103 +0,0 @@
########################################################################### ###
#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
#@License Dual MIT/GPLv2
#
# The contents of this file are subject to the MIT license as set out below.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# Alternatively, the contents of this file may be used under the terms of
# the GNU General Public License Version 2 ("GPL") in which case the provisions
# of GPL are applicable instead of those above.
#
# If you wish to allow use of your version of this file only under the terms of
# GPL, and not to allow others to use your version of this file under the terms
# of the MIT license, indicate your decision by deleting the provisions above
# and replace them with the notice and other provisions required by GPL as set
# out in the file called "GPL-COPYING" included in this distribution. If you do
# not delete the provisions above, a recipient may use your version of this file
# under the terms of either the MIT license or GPL.
#
# This License is also included in this distribution in the file called
# "MIT-COPYING".
#
# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
### ###########################################################################
########################################################################### ###
# Display class drivers
########################################################################### ###
ifeq ($(DISPLAY_CONTROLLER),dc_example)
$(eval $(call TunableKernelConfigC,DC_EXAMPLE_WIDTH,))
$(eval $(call TunableKernelConfigC,DC_EXAMPLE_HEIGHT,))
$(eval $(call TunableKernelConfigC,DC_EXAMPLE_DPI,))
$(eval $(call TunableKernelConfigC,DC_EXAMPLE_BIT_DEPTH,))
$(eval $(call TunableKernelConfigC,DC_EXAMPLE_FBC_MODE,))
$(eval $(call TunableKernelConfigC,DC_EXAMPLE_MEMORY_LAYOUT,))
endif
ifeq ($(DISPLAY_CONTROLLER),dc_fbdev)
$(eval $(call TunableKernelConfigC,DC_FBDEV_REFRESH,))
$(eval $(call TunableKernelConfigC,DC_FBDEV_FORCE_XRGB8888,,\
Force the dc_fbdev display driver to use XRGB8888. This is necessary_\
when the underlying Linux framebuffer driver does not ignore alpha_\
meaning an alpha value of 0 results in nothing being displayed._\
))
$(eval $(call TunableKernelConfigC,DC_FBDEV_NUM_PREFERRED_BUFFERS,,\
The maximum number of display buffers the dc_fbdev display driver_\
supports. The underlying Linux framebuffer driver must be capable_\
of allocating sufficient memory for the number of buffers chosen._\
))
endif
ifeq ($(DISPLAY_CONTROLLER),dc_pdp)
$(eval $(call TunableKernelConfigC,DCPDP_WIDTH,))
$(eval $(call TunableKernelConfigC,DCPDP_HEIGHT,))
$(eval $(call TunableKernelConfigC,DCPDP_DPI,))
$(eval $(call TunableKernelConfigC,DCPDP_DYNAMIC_GTF_TIMING,1))
$(eval $(call TunableKernelConfigC,DCPDP_NO_INTERRUPTS,))
endif
ifeq ($(DISPLAY_CONTROLLER),adf_pdp)
$(eval $(call TunableKernelConfigC,ADF_PDP_WIDTH,))
$(eval $(call TunableKernelConfigC,ADF_PDP_HEIGHT,))
endif
########################################################################### ###
# DRM display drivers
########################################################################### ###
ifeq ($(DISPLAY_CONTROLLER),drm_fbdev)
$(eval $(call TunableKernelConfigC,DRM_FBDEV_FORCE_XRGB8888,,\
Force the drm_fbdev display driver to use XRGB8888. This is necessary_\
when the underlying Linux framebuffer driver does not ignore alpha_\
meaning an alpha value of 0 results in nothing being displayed._\
))
$(eval $(call TunableKernelConfigC,DRM_FBDEV_NUM_PREFERRED_BUFFERS,,\
The maximum number of display buffers the drm_fbdev display driver_\
supports. The underlying Linux framebuffer driver must be capable_\
of allocating sufficient memory for the number of buffers chosen._\
))
$(eval $(call TunableKernelConfigC,DRM_FBDEV_SET_BPP,,\
Set the number of bits per pixel to a particular value.\
))
endif

View File

@@ -1,101 +0,0 @@
########################################################################### ###
#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
#@License Dual MIT/GPLv2
#
# The contents of this file are subject to the MIT license as set out below.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# Alternatively, the contents of this file may be used under the terms of
# the GNU General Public License Version 2 ("GPL") in which case the provisions
# of GPL are applicable instead of those above.
#
# If you wish to allow use of your version of this file only under the terms of
# GPL, and not to allow others to use your version of this file under the terms
# of the MIT license, indicate your decision by deleting the provisions above
# and replace them with the notice and other provisions required by GPL as set
# out in the file called "GPL-COPYING" included in this distribution. If you do
# not delete the provisions above, a recipient may use your version of this file
# under the terms of either the MIT license or GPL.
#
# This License is also included in this distribution in the file called
# "MIT-COPYING".
#
# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
### ###########################################################################
include ../common/android/platform_version.mk
# Now we have included the platform_version.mk file, we know we have a
# correctly configured OUT_DIR and can probe it to figure out our
# architecture. For backwards compatibility with KitKat, use the deprecated
# ro.product.cpu.abi (primary architecture) property instead of abilist64.
$(eval $(subst #,$(newline),$(shell cat $(BUILD_PROP) | \
grep '^ro.product.cpu.abi=\|^ro.product.cpu.abilist32=' | \
sed -e 's,ro.product.cpu.abi=,JNI_CPU_ABI=,' \
-e 's,ro.product.cpu.abilist32=,JNI_CPU_ABI_2ND=,' | \
tr ',' ' ' | tr '\n' '#')))
# If ARCH is set, use that to remap to an "Android" ARCH..
ANDROID_ARCH := $(filter arm arm64 mips mips64 x86 x86_64,$(ARCH))
# x86 is special and has another legacy ARCH name which is remapped
ifeq ($(ARCH),i386)
ANDROID_ARCH := x86
endif
ifeq ($(ANDROID_ARCH),)
# ..otherwise, try to use the ABI list to figure it out.
ifneq ($(filter armeabi-v7a armeabi,$(JNI_CPU_ABI)),)
ANDROID_ARCH=arm
else ifneq ($(filter arm64-v8a,$(JNI_CPU_ABI)),)
ANDROID_ARCH=arm64
else ifneq ($(filter mips,$(JNI_CPU_ABI)),)
ANDROID_ARCH=mips
else ifneq ($(filter mips64,$(JNI_CPU_ABI)),)
ANDROID_ARCH=mips64
else ifneq ($(filter x86,$(JNI_CPU_ABI)),)
ANDROID_ARCH=x86
else ifneq ($(filter x86_64,$(JNI_CPU_ABI)),)
ANDROID_ARCH=x86_64
else
$(error ARCH not set and JNI_CPU_ABI=$(JNI_CPU_ABI) was not remappable)
endif
endif
JNI_CPU_ABI := $(word 1,$(JNI_CPU_ABI))
JNI_CPU_ABI_2ND := $(word 1,$(JNI_CPU_ABI_2ND))
include ../common/android/arch_common.mk
ifneq ($(filter arm arm64 mips mips64,$(ANDROID_ARCH)),)
LDM_PLATFORM ?= 1
endif
ifneq ($(filter x86 x86_64,$(ANDROID_ARCH)),)
KERNEL_CROSS_COMPILE ?= undef
endif
ifneq ($(filter arm64 mips64 x86_64,$(ANDROID_ARCH)),)
PVR_ANDROID_ARCH_IS_64BIT := 1
ifeq ($(MULTIARCH),)
$(warning *** 64-bit architecture detected. Enabling MULTIARCH=1.)
$(warning *** If you want a 64-bit only build, use MULTIARCH=64only.)
export MULTIARCH := 1
endif
endif

View File

@@ -1,85 +0,0 @@
########################################################################### ###
#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
#@License Dual MIT/GPLv2
#
# The contents of this file are subject to the MIT license as set out below.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# Alternatively, the contents of this file may be used under the terms of
# the GNU General Public License Version 2 ("GPL") in which case the provisions
# of GPL are applicable instead of those above.
#
# If you wish to allow use of your version of this file only under the terms of
# GPL, and not to allow others to use your version of this file under the terms
# of the MIT license, indicate your decision by deleting the provisions above
# and replace them with the notice and other provisions required by GPL as set
# out in the file called "GPL-COPYING" included in this distribution. If you do
# not delete the provisions above, a recipient may use your version of this file
# under the terms of either the MIT license or GPL.
#
# This License is also included in this distribution in the file called
# "MIT-COPYING".
#
# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
### ###########################################################################
SYS_CFLAGS := \
-fno-short-enums \
-funwind-tables \
-D__linux__
SYS_INCLUDES := \
-isystem $(ANDROID_ROOT)/bionic/libc/include \
-isystem $(ANDROID_ROOT)/bionic/libc/kernel/uapi \
-isystem $(ANDROID_ROOT)/bionic/libm/include \
-isystem $(ANDROID_ROOT)/bionic/libthread_db/include \
-isystem $(ANDROID_ROOT)/external/libunwind/include \
-isystem $(ANDROID_ROOT)/frameworks/base/include \
-isystem $(ANDROID_ROOT)/hardware/libhardware/include \
-isystem $(ANDROID_ROOT)/system/core/include \
-isystem $(ANDROID_ROOT)/system/core/include/sync \
-isystem $(ANDROID_ROOT)/system/core/adf/libadf/include \
-isystem $(ANDROID_ROOT)/system/core/adf/libadfhwc/include \
-isystem $(ANDROID_ROOT)/system/core/libsync/include \
-isystem $(ANDROID_ROOT)/system/core/libsync \
-isystem $(ANDROID_ROOT)/system/media/camera/include
ifneq ($(wildcard $(ANDROID_ROOT)/external/boringssl/src/include),)
SYS_INCLUDES += \
-isystem $(ANDROID_ROOT)/external/boringssl/src/include
else
SYS_INCLUDES += \
-isystem $(ANDROID_ROOT)/external/openssl/include
endif
# Obsolete libc includes
SYS_INCLUDES += \
-isystem $(ANDROID_ROOT)/bionic/libc/kernel/common \
-isystem $(ANDROID_ROOT)/bionic/libc/kernel/arch-$(ANDROID_ARCH)
# The following include is a workaround for ICS 4.0.4 partial directory change
SYS_INCLUDES += \
-isystem $(ANDROID_ROOT)/frameworks/base/native/include \
-isystem $(ANDROID_ROOT)/frameworks/native/include
ifeq ($(_CLANG),true)
SYS_INCLUDES := \
-nostdinc $(SYS_INCLUDES) \
-isystem $(ANDROID_ROOT)/external/clang/lib/Headers
endif
OPTIM := -O2

View File

@@ -1,80 +0,0 @@
########################################################################### ###
#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
#@License Dual MIT/GPLv2
#
# The contents of this file are subject to the MIT license as set out below.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# Alternatively, the contents of this file may be used under the terms of
# the GNU General Public License Version 2 ("GPL") in which case the provisions
# of GPL are applicable instead of those above.
#
# If you wish to allow use of your version of this file only under the terms of
# GPL, and not to allow others to use your version of this file under the terms
# of the MIT license, indicate your decision by deleting the provisions above
# and replace them with the notice and other provisions required by GPL as set
# out in the file called "GPL-COPYING" included in this distribution. If you do
# not delete the provisions above, a recipient may use your version of this file
# under the terms of either the MIT license or GPL.
#
# This License is also included in this distribution in the file called
# "MIT-COPYING".
#
# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
### ###########################################################################
$(eval $(call UserConfigMake,libpthread_ldflags,))
$(eval $(call UserConfigMake,librt_ldflags,))
# On versions of Android prior to L, remap the use of libc++ to a combination
# of stlport and libstdc++. Not every module written in C++ in the DDK needs
# the STL, but linking it should be harmless (and most modules do need it).
ifneq ($(is_at_least_lollipop),1)
$(eval $(call UserConfigMake,libc++_ldflags,-lstlport -lstdc++))
endif
$(eval $(call UserConfigMake,TARGET_ROOT,$(TARGET_ROOT)))
$(eval $(call UserConfigMake,TARGET_DEVICE,$(TARGET_DEVICE)))
$(eval $(call BothConfigMake,SUPPORT_ANDROID_PLATFORM,1))
$(eval $(call BothConfigC,ANDROID,))
$(eval $(call UserConfigC,SUPPORT_ANDROID_PLATFORM,1))
# These are set automatically according to the platform version.
$(eval $(call TunableBothConfigC,SUPPORT_NATIVE_FENCE_SYNC,))
# These are user-tunable.
$(eval $(call TunableBothConfigC,PVR_ANDROID_HAS_SW_INCOMPATIBLE_FRAMEBUFFER,,\
Enable this to support running Android$(apos)s software GLES renderer_\
with gralloc from the DDK._\
))
# These are set automatically according to the platform version.
$(eval $(call TunableBothConfigMake,SUPPORT_NATIVE_FENCE_SYNC,))
# These are user-tunable.
$(eval $(call TunableKernelConfigC,ADF_FBDEV_NUM_PREFERRED_BUFFERS,))

View File

@@ -1,312 +0,0 @@
########################################################################### ###
#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
#@License Dual MIT/GPLv2
#
# The contents of this file are subject to the MIT license as set out below.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# Alternatively, the contents of this file may be used under the terms of
# the GNU General Public License Version 2 ("GPL") in which case the provisions
# of GPL are applicable instead of those above.
#
# If you wish to allow use of your version of this file only under the terms of
# GPL, and not to allow others to use your version of this file under the terms
# of the MIT license, indicate your decision by deleting the provisions above
# and replace them with the notice and other provisions required by GPL as set
# out in the file called "GPL-COPYING" included in this distribution. If you do
# not delete the provisions above, a recipient may use your version of this file
# under the terms of either the MIT license or GPL.
#
# This License is also included in this distribution in the file called
# "MIT-COPYING".
#
# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
### ###########################################################################
# Basic support option tuning for Android
#
SUPPORT_ANDROID_PLATFORM := 1
SUPPORT_OPENGLES1_V1_ONLY := 1
DONT_USE_SONAMES := 1
# Always print debugging after 5 seconds of no activity
#
CLIENT_DRIVER_DEFAULT_WAIT_RETRIES := 50
# Android WSEGL is always the same
#
OPK_DEFAULT := libpvrANDROID_WSEGL.so
# srvkm is always built
#
KERNEL_COMPONENTS := srvkm
# Kernel modules are always installed here under Android
#
# Time:2014-08-26
# Note:change module's path from /system/modules/ to /system/lib/modules/
# Modifier: zxl
PVRSRV_MODULE_BASEDIR := /system/lib/modules/
# Enable secure FD export in Services
#
SUPPORT_SECURE_EXPORT := 1
# Disable multi sync support in Services
#
SUPPORT_MULTI_SYNC := 0
# It is no longer supported disable this for Android, but we can still
# do so for the Linux DDK, so don't use NonTunableOption.
#
override SUPPORT_ION := 1
# Show GPU activity in systrace
#
SUPPORT_GPUTRACE_EVENTS ?= 1
##############################################################################
# Unless overridden by the user, assume the RenderScript Compute API level
# matches that of the SDK API_LEVEL.
#
RSC_API_LEVEL ?= $(API_LEVEL)
ifneq ($(findstring $(RSC_API_LEVEL),21 22),)
RSC_API_LEVEL := 20
endif
##############################################################################
# JB MR1 introduces cross-process syncs associated with a fd.
# This requires a new enough kernel version to have the base/sync driver.
#
#zxl:Temporarily closed for user build mode(Depend on libgui: LOCAL_CFLAGS += -DDONT_USE_FENCE_SYNC)
EGL_EXTENSION_ANDROID_NATIVE_FENCE_SYNC ?= 1
ifeq ($(PDUMP),1)
# PDUMPs won't process if any native synchronization is enabled
override EGL_EXTENSION_ANDROID_NATIVE_FENCE_SYNC := 0
override SUPPORT_NATIVE_FENCE_SYNC := 0
override PVR_ANDROID_DEFER_CLEAR := 0
else
override SUPPORT_NATIVE_FENCE_SYNC := 1
endif
##############################################################################
# Handle various platform includes
#
SYS_INCLUDES += \
-isystem $(ANDROID_ROOT)/external/zlib/src \
-isystem $(ANDROID_ROOT)/libnativehelper/include/nativehelper
SYS_KHRONOS_INCLUDES += \
-I$(ANDROID_ROOT)/frameworks/native/opengl/include
##############################################################################
# Android doesn't use these install script variables. They're still in place
# because the Linux install scripts use them.
#
SHLIB_DESTDIR := not-used
EGL_DESTDIR := not-used
# Must give our EGL/GLES libraries a globally unique name
#
EGL_BASENAME_SUFFIX := _POWERVR_ROGUE
##############################################################################
# In K and older, augment the libstdc++ includes with stlport includes. Any
# part of the C++ library not implemented by stlport will be handled by
# linking in libstdc++ too (see extra_config.mk).
#
# On L and newer, don't use stlport OR libstdc++ at all; just use libc++.
#
SYS_CXXFLAGS := -fuse-cxa-atexit $(SYS_CFLAGS)
ifeq ($(is_at_least_lollipop),1)
SYS_INCLUDES += \
-isystem $(ANDROID_ROOT)/external/libcxx/include
else
SYS_INCLUDES += \
-isystem $(ANDROID_ROOT)/bionic \
-isystem $(ANDROID_ROOT)/external/stlport/stlport
endif
##############################################################################
# ICS requires that at least one driver EGLConfig advertises the
# EGL_RECORDABLE_ANDROID attribute. The platform requires that surfaces
# rendered with this config can be consumed by an OMX video encoder.
#
EGL_EXTENSION_ANDROID_RECORDABLE := 1
##############################################################################
# ICS added the EGL_ANDROID_blob_cache extension. Enable support for this
# extension in EGL/GLESv2.
#
EGL_EXTENSION_ANDROID_BLOB_CACHE ?= 1
##############################################################################
# Framebuffer target extension is used to find configs compatible with
# the framebuffer
#
EGL_EXTENSION_ANDROID_FRAMEBUFFER_TARGET := 1
##############################################################################
# Disable the MEMINFO wrapper pvCpuVirtAddr feature. All Android DDK
# components no longer require it. This enables lazy CPU mappings, which
# improves allocation performance.
#
ifneq ($(PDUMP),1)
PVRSRV_NO_MEMINFO_CPU_VIRT_ADDR ?= 1
endif
##############################################################################
# JB added a new corkscrew API for userland backtracing.
#
ifeq ($(is_at_least_lollipop),0)
PVR_ANDROID_HAS_CORKSCREW_API := 1
endif
##############################################################################
# This is currently broken on KK. Disable until fixed.
#
SUPPORT_ANDROID_APPHINTS := 0
##############################################################################
# KitKat added very provisional/early support for sRGB render targets
#
# (Leaving this optional until the framework makes it mandatory.)
#
PVR_ANDROID_HAS_HAL_PIXEL_FORMAT_sRGB ?= 1
##############################################################################
# Switch on ADF support for KitKat MR1 or newer.
#
# Customers using AOSP KitKat MR1 sources need to copy and build the libadf
# and libadfhwc libraries from AOSP master system/core into their device/
# directories and build the components as dynamic libraries. Examples of how
# to do this are shown in the bundled 'pc_android' and 'generic_arm_android'
# directories in the device package.
#
# Customers using AOSP master do not need to make any changes.
# ADF requires kernel/common derivative kernels >= 3.10.
#
ifeq ($(is_at_least_kitkat_mr1),1)
#SUPPORT_ADF ?= 1
SUPPORT_DISPLAY_CLASS := 0
else
SUPPORT_DISPLAY_CLASS ?= 1
endif
##############################################################################
# Versions of Android between Cupcake and KitKat MR1 required Java 6.
#
ifeq ($(is_at_least_lollipop),0)
LEGACY_USE_JAVA6 ?= 1
endif
##############################################################################
# Versions of Android between ICS and KitKat MR1 used ion .heap_mask instead
# of .heap_id_mask.
#
ifeq ($(is_at_least_lollipop),0)
PVR_ANDROID_HAS_ION_FIELD_HEAP_MASK := 1
endif
##############################################################################
# Lollipop supports 64-bit. Configure BCC to emit both 32-bit and 64-bit LLVM
# bitcode in the renderscript driver.
#
ifeq ($(is_at_least_lollipop),1)
PVR_ANDROID_BCC_MULTIARCH_SUPPORT := 1
endif
##############################################################################
# Lollipop annotates the cursor allocation with USAGE_CURSOR to enable it to
# be accelerated with special cursor hardware (rather than wasting an
# overlay). This flag stops the DDK from blocking the allocation.
#
ifeq ($(is_at_least_lollipop),1)
PVR_ANDROID_HAS_GRALLOC_USAGE_CURSOR := 1
endif
##############################################################################
# Lollipop changed the camera HAL metadata specification to require that
# CONTROL_MAX_REGIONS specifies 3 integers (instead of 1).
#
ifeq ($(is_at_least_lollipop),1)
PVR_ANDROID_CAMERA_CONTROL_MAX_REGIONS_HAS_THREE := 1
endif
##############################################################################
# Lollipop adds async versions of the CPU access functions to gralloc.
#
ifeq ($(is_at_least_lollipop),1)
PVR_ANDROID_HAS_GRALLOC_ASYNC_LOCK := 1
endif
##############################################################################
# Marshmallow needs --soname turned on
#
ifeq ($(is_at_least_marshmallow),1)
PVR_ANDROID_NEEDS_SONAME ?= 1
endif
##############################################################################
# Marshmallow replaces RAW_SENSOR with RAW10, RAW12 and RAW16
#
ifeq ($(is_at_least_marshmallow),1)
PVR_ANDROID_HAS_HAL_PIXEL_FORMAT_RAWxx := 1
endif
##############################################################################
# Marshmallow has redesigned sRGB support
#
ifeq ($(is_at_least_marshmallow),1)
PVR_ANDROID_HAS_SET_BUFFERS_DATASPACE ?= 1
PVR_ANDROID_HAS_HAL_PIXEL_FORMAT_sRGB := 0
endif
##############################################################################
# fenv was rewritten in Marshmallow
#
ifeq ($(is_at_least_marshmallow),1)
PVR_ANDROID_HAS_WORKING_FESETROUND := 1
endif
##############################################################################
# Marshmallow renderscript support
#
ifeq ($(is_at_least_marshmallow),1)
# Bump the RenderScript API level to 23 for future versions
# API_LEVEL itself shouldn't be touched.
RSC_API_LEVEL := 23
# RenderScript header file was moved in AOSP master
PVR_ANDROID_HAS_RS_INTERNAL_DEFINES := 1
# LLVM's MemoryBuffer is now passed via reference
PVR_ANDROID_HAS_RS_MEMBUFFER_REF := 1
# RenderScript ScriptGroup API has ScriptGroupBase instead of ScriptGroup
PVR_ANDROID_HAS_SCRIPTGROUPBASE := 1
# RenderScript elementData API is generic
PVR_ANDROID_POST_L_HAL := 1
endif
# Placeholder for future version handling
#
ifeq ($(is_future_version),1)
-include ../common/android/future_version.mk
endif

View File

@@ -1,323 +0,0 @@
#!/bin/bash
############################################################################ ###
#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
#@License Dual MIT/GPLv2
#
# The contents of this file are subject to the MIT license as set out below.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# Alternatively, the contents of this file may be used under the terms of
# the GNU General Public License Version 2 ("GPL") in which case the provisions
# of GPL are applicable instead of those above.
#
# If you wish to allow use of your version of this file only under the terms of
# GPL, and not to allow others to use your version of this file under the terms
# of the MIT license, indicate your decision by deleting the provisions above
# and replace them with the notice and other provisions required by GPL as set
# out in the file called "GPL-COPYING" included in this distribution. If you do
# not delete the provisions above, a recipient may use your version of this file
# under the terms of either the MIT license or GPL.
#
# This License is also included in this distribution in the file called
# "MIT-COPYING".
#
# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#### ###########################################################################
# Help on how to invoke
#
function usage {
echo "usage: $0 [options...]"
echo ""
echo "Options: -v Verbose mode."
echo " -n Dry-run mode."
echo " -u Uninstall-only mode."
echo " --root <path> Use <path> as the root of the install file system."
echo " (Overrides the DISCIMAGE environment variable.)"
exit 1
}
WD=`pwd`
SCRIPT_ROOT=`dirname $0`
cd $SCRIPT_ROOT
PVRVERSION=[PVRVERSION]
PVRBUILD=[PVRBUILD]
PRIMARY_ARCH="[PRIMARY_ARCH]"
ARCHITECTURES="[ARCHITECTURES]"
# These destination directories are the same for 32- or 64-bit binaries.
# zxl: change module's path from /system/modules/ to /system/lib/modules/
MOD_DESTDIR=/system/lib/modules
BIN_DESTDIR=/system/vendor/bin
DATA_DESTDIR=${BIN_DESTDIR}
# Exit with an error messages.
# $1=blurb
#
function bail {
if [ ! -z "$1" ]; then
echo "$1" >&2
fi
echo "" >&2
echo "Installation failed" >&2
exit 1
}
# Copy all the required files into their appropriate places on the local machine.
function install_locally {
# Define functions required for local installs
# basic installation function
# $1=fromfile, $2=destfilename, $3=blurb, $4=chmod-flags, $5=chown-flags
#
function install_file {
if [ -z "$DDK_INSTALL_LOG" ]; then
bail "INTERNAL ERROR: Invoking install without setting logfile name"
fi
DESTFILE=${DISCIMAGE}$2
DESTDIR=`dirname $DESTFILE`
if [ ! -e $1 ]; then
[ -n "$VERBOSE" ] && echo "skipping file $1 -> $2"
return
fi
# Destination directory - make sure it's there and writable
#
if [ -d "${DESTDIR}" ]; then
if [ ! -w "${DESTDIR}" ]; then
bail "${DESTDIR} is not writable."
fi
else
$DOIT mkdir -p ${DESTDIR} || bail "Couldn't mkdir -p ${DESTDIR}"
[ -n "$VERBOSE" ] && echo "Created directory `dirname $2`"
fi
# Delete the original so that permissions don't persist.
#
$DOIT rm -f $DESTFILE
$DOIT cp -f $1 $DESTFILE || bail "Couldn't copy $1 to $DESTFILE"
$DOIT chmod $4 ${DESTFILE}
echo "$3 `basename $1` -> $2"
$DOIT echo "file $2" >> $DDK_INSTALL_LOG
}
# Android-specific targetfs mkdir workarounds
if [ ! -d ${DISCIMAGE}/data ]; then
mkdir ${DISCIMAGE}/data
chown 1000:1000 ${DISCIMAGE}/data
chmod 0771 ${DISCIMAGE}/data
fi
if [ ! -d ${DISCIMAGE}/data/app ]; then
mkdir ${DISCIMAGE}/data/app
chown 1000:1000 ${DISCIMAGE}/data/app
chmod 0771 ${DISCIMAGE}/data/app
fi
for arch in $ARCHITECTURES; do
if [ ! -d $arch ]; then
echo "Unknown architecture $arch. Aborting"
#exit 1
fi
case $arch in
target*64)
SHLIB_DESTDIR=/system/vendor/lib64
;;
*)
SHLIB_DESTDIR=/system/vendor/lib
esac
EGL_DESTDIR=${SHLIB_DESTDIR}/egl
pushd $arch > /dev/null
# Install UM components
if [ -f install_um.sh ]; then
DDK_INSTALL_LOG=$UMLOG
echo "Installing User components for architecture $arch"
$DOIT echo "version $PVRVERSION" > $DDK_INSTALL_LOG
source install_um.sh
echo
fi
popd > /dev/null
done
pushd $PRIMARY_ARCH > /dev/null
# Install KM components
if [ -f install_km.sh ]; then
DDK_INSTALL_LOG=$KMLOG
echo "Installing Kernel components for architecture $PRIMARY_ARCH"
$DOIT echo "version $PVRVERSION" > $DDK_INSTALL_LOG
source install_km.sh
echo
fi
popd > /dev/null
$DOIT mkdir -p ${DISCIMAGE}/system/lib/egl
$DOIT cat >${DISCIMAGE}/system/lib/egl/egl.cfg <<EOF
0 0 POWERVR_ROGUE
EOF
$DOIT echo "file /system/lib/egl/egl.cfg" >> $DDK_INSTALL_LOG
# Create an OLDLOG so old versions of the driver can uninstall.
$DOIT echo "version $PVRVERSION" > $OLDLOG
if [ -f $KMLOG ]; then
tail -n +2 $KMLOG >> $OLDLOG
fi
if [ -f $UMLOG ]; then
tail -n +2 $UMLOG >> $OLDLOG
fi
# Make sure new logs are newer than $OLDLOG
touch -m -d "last sunday" $OLDLOG
}
# Read the appropriate install log and delete anything therein.
function uninstall_locally {
# Function to uninstall something.
function do_uninstall {
LOG=$1
if [ ! -f $LOG ]; then
echo "Nothing to un-install."
return;
fi
BAD=0
VERSION=""
while read type data; do
case $type in
version)
echo "Uninstalling existing version $data"
VERSION="$data"
;;
link|file)
if [ -z "$VERSION" ]; then
BAD=1;
echo "No version record at head of $LOG"
elif ! $DOIT rm -f ${DISCIMAGE}${data}; then
BAD=1;
else
[ -n "$VERBOSE" ] && echo "Deleted $type $data"
fi
;;
tree)
;;
esac
done < $1;
if [ $BAD = 0 ]; then
echo "Uninstallation completed."
$DOIT rm -f $LOG
else
echo "Uninstallation failed!!!"
fi
}
if [ -z "$OLDLOG" -o -z "$KMLOG" -o -z "$UMLOG" ]; then
bail "INTERNAL ERROR: Invoking uninstall without setting logfile name"
fi
# Uninstall anything installed using the old-style install scripts.
LEGACY_LOG=0
if [ -f $OLDLOG ]; then
if [ -f $KMLOG -a $KMLOG -nt $OLDLOG ]; then
# Last install was new scheme.
rm $OLDLOG
elif [ -f $UMLOG -a $UMLOG -nt $OLDLOG ]; then
# Last install was new scheme.
rm $OLDLOG
else
echo "Uninstalling all components from legacy log."
do_uninstall $OLDLOG
LEGACY_LOG=1
echo
fi
fi
if [ $LEGACY_LOG = 0 ]; then
# Uninstall KM components if we are doing a KM install.
if [ -f install_km.sh -a -f $KMLOG ]; then
echo "Uninstalling Kernel components"
do_uninstall $KMLOG
echo
fi
# Uninstall UM components if we are doing a UM install.
if [ -f install_um.sh -a -f $UMLOG ]; then
echo "Uninstalling User components"
do_uninstall $UMLOG
echo
fi
fi
}
# Work out if there are any special instructions.
#
while [ "$1" ]; do
case "$1" in
-v|--verbose)
VERBOSE=v
;;
-r|--root)
DISCIMAGE=$2
shift;
;;
-u|--uninstall)
UNINSTALL_ONLY=y
;;
-n)
DOIT=echo
;;
-h | --help | *)
usage
;;
esac
shift
done
if [ ! -z "$DISCIMAGE" ]; then
if [ ! -d "$DISCIMAGE" ]; then
bail "$0: $DISCIMAGE does not exist."
fi
echo
if [ $DISCIMAGE == "/" ]; then
echo "Installing PowerVR '$PVRVERSION ($PVRBUILD)' locally"
else
echo "Installing PowerVR '$PVRVERSION ($PVRBUILD)' on $DISCIMAGE"
fi
echo
echo "File system installation root is $DISCIMAGE"
echo
OLDLOG=$DISCIMAGE/powervr_ddk_install.log
KMLOG=$DISCIMAGE/powervr_ddk_install_km.log
UMLOG=$DISCIMAGE/powervr_ddk_install_um.log
uninstall_locally
if [ "$UNINSTALL_ONLY" != "y" ]; then
install_locally
fi
else
bail "DISCIMAGE must be set for installation to be possible."
fi

View File

@@ -1,52 +0,0 @@
########################################################################### ###
#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
#@License Dual MIT/GPLv2
#
# The contents of this file are subject to the MIT license as set out below.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# Alternatively, the contents of this file may be used under the terms of
# the GNU General Public License Version 2 ("GPL") in which case the provisions
# of GPL are applicable instead of those above.
#
# If you wish to allow use of your version of this file only under the terms of
# GPL, and not to allow others to use your version of this file under the terms
# of the MIT license, indicate your decision by deleting the provisions above
# and replace them with the notice and other provisions required by GPL as set
# out in the file called "GPL-COPYING" included in this distribution. If you do
# not delete the provisions above, a recipient may use your version of this file
# under the terms of either the MIT license or GPL.
#
# This License is also included in this distribution in the file called
# "MIT-COPYING".
#
# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
### ###########################################################################
TARGET_BUILD_TYPE ?= release
HOST_OS ?= linux
HOST_ARCH ?= x86
OUT_DIR ?= $(ANDROID_ROOT)/out
ifeq ($(TARGET_BUILD_TYPE),debug)
TARGET_ROOT := $(OUT_DIR)/debug/target
else
TARGET_ROOT := $(OUT_DIR)/target
endif

View File

@@ -1,172 +0,0 @@
########################################################################### ###
#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
#@License Dual MIT/GPLv2
#
# The contents of this file are subject to the MIT license as set out below.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# Alternatively, the contents of this file may be used under the terms of
# the GNU General Public License Version 2 ("GPL") in which case the provisions
# of GPL are applicable instead of those above.
#
# If you wish to allow use of your version of this file only under the terms of
# GPL, and not to allow others to use your version of this file under the terms
# of the MIT license, indicate your decision by deleting the provisions above
# and replace them with the notice and other provisions required by GPL as set
# out in the file called "GPL-COPYING" included in this distribution. If you do
# not delete the provisions above, a recipient may use your version of this file
# under the terms of either the MIT license or GPL.
#
# This License is also included in this distribution in the file called
# "MIT-COPYING".
#
# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
### ###########################################################################
# If there's no build.prop file in the expected location, bail out. Tell the
# user which file we were trying to read in case TARGET_DEVICE was not set.
#
BUILD_PROP := $(TARGET_ROOT)/product/$(TARGET_DEVICE)/system/build.prop
ifeq ($(wildcard $(BUILD_PROP)),)
$(warning *** Could not determine Android version. Did you set ANDROID_ROOT,\
OUT_DIR and TARGET_DEVICE in your environment correctly?)
$(error Error reading $(BUILD_PROP))
endif
# Extract version.release and version.codename from the build.prop file.
# If either of the values aren't in the build.prop, the Make variables won't
# be defined, and fallback handling will take place.
#
define newline
endef
$(eval $(subst #,$(newline),$(shell cat $(BUILD_PROP) | \
grep '^ro.build.version.release=\|^ro.build.version.codename=' | \
sed -e 's,ro.build.version.release=,PLATFORM_RELEASE=,' \
-e 's,ro.build.version.codename=,PLATFORM_CODENAME=,' | tr '\n' '#')))
define release-starts-with
$(shell echo $(PLATFORM_RELEASE) | grep -q ^$(1); \
[ "$$?" = "0" ] && echo 1 || echo 0)
endef
# ro.build.version.release contains the version number for release builds, or
# the version codename otherwise. In this case we need to assume that the
# version of Android we're building against has the features that are in the
# final release of that version, so we set PLATFORM_RELEASE to the
# corresponding release number.
#
# NOTE: It's the _string_ ordering that matters here, not the version number
# ordering. You need to make sure that strings that are sub-strings of other
# checked strings appear _later_ in this list.
#
# e.g. 'KitKatMR' starts with 'KitKat', but it is not KitKat.
#
# NOTE: The version codenames for Android stopped after KitKat, don't read
# too much into the below names. They are mostly placeholders/reminders.
#
ifeq ($(call release-starts-with,KitKatMR),1)
PLATFORM_RELEASE := 4.4.1
else ifeq ($(call release-starts-with,KitKat),1)
PLATFORM_RELEASE := 4.4
else ifeq ($(call release-starts-with,LollipopMR1),1)
PLATFORM_RELEASE := 5.1
else ifeq ($(call release-starts-with,Lollipop),1)
PLATFORM_RELEASE := 5.0
else ifeq ($(call release-starts-with,Marshmallow),1)
PLATFORM_RELEASE := 6.0
else ifeq ($(PLATFORM_CODENAME),AOSP)
# AOSP (master) will normally have PLATFORM_CODENAME set to AOSP
PLATFORM_RELEASE := 6.0.60
else ifeq ($(shell echo $(PLATFORM_RELEASE) | grep -qE "[A-Za-z]+"; echo $$?),0)
PLATFORM_RELEASE := 6.1
endif
# Workaround for master. Sometimes there is an AOSP version ahead of
# the current master version number, but master still has more features.
#
ifeq ($(PLATFORM_RELEASE),6.0.60)
PLATFORM_RELEASE := 6.1
is_aosp_master := 1
endif
PLATFORM_RELEASE_MAJ := $(shell echo $(PLATFORM_RELEASE) | cut -f1 -d'.')
PLATFORM_RELEASE_MIN := $(shell echo $(PLATFORM_RELEASE) | cut -f2 -d'.')
PLATFORM_RELEASE_PATCH := $(shell echo $(PLATFORM_RELEASE) | cut -f3 -d'.')
# Not all versions have a patchlevel; fix that up here
#
ifeq ($(PLATFORM_RELEASE_PATCH),)
PLATFORM_RELEASE_PATCH := 0
endif
# Macros to help categorize support for features and API_LEVEL for tests.
#
is_at_least_kitkat := \
$(shell ( test $(PLATFORM_RELEASE_MAJ) -gt 4 || \
( test $(PLATFORM_RELEASE_MAJ) -eq 4 && \
test $(PLATFORM_RELEASE_MIN) -ge 4 ) ) && echo 1 || echo 0)
is_at_least_kitkat_mr1 := \
$(shell ( test $(PLATFORM_RELEASE_MAJ) -gt 4 || \
( test $(PLATFORM_RELEASE_MAJ) -eq 4 && \
test $(PLATFORM_RELEASE_MIN) -gt 4 ) || \
( test $(PLATFORM_RELEASE_MAJ) -eq 4 && \
test $(PLATFORM_RELEASE_MIN) -eq 4 && \
test $(PLATFORM_RELEASE_PATCH) -ge 1 ) ) && echo 1 || echo 0)
is_at_least_lollipop := \
$(shell ( test $(PLATFORM_RELEASE_MAJ) -ge 5 ) && echo 1 || echo 0)
is_at_least_lollipop_mr1 := \
$(shell ( test $(PLATFORM_RELEASE_MAJ) -gt 5 || \
( test $(PLATFORM_RELEASE_MAJ) -eq 5 && \
test $(PLATFORM_RELEASE_MIN) -gt 0 ) ) && echo 1 || echo 0)
is_at_least_marshmallow := \
$(shell ( test $(PLATFORM_RELEASE_MAJ) -ge 6 ) && echo 1 || echo 0)
# Assume "future versions" are >6.0, but we don't really know
is_future_version := \
$(shell ( test $(PLATFORM_RELEASE_MAJ) -gt 6 || \
( test $(PLATFORM_RELEASE_MAJ) -eq 6 && \
test $(PLATFORM_RELEASE_MIN) -gt 0 ) ) && echo 1 || echo 0)
# Picking an exact match of API_LEVEL for the platform we're building
# against can avoid compatibility theming and affords better integration.
#
ifeq ($(is_future_version),1)
API_LEVEL := 23
else ifeq ($(is_at_least_marshmallow),1)
API_LEVEL := 23
else ifeq ($(is_at_least_lollipop_mr1),1)
API_LEVEL := 22
else ifeq ($(is_at_least_lollipop),1)
API_LEVEL := 21
#API_LEVEL := 20 was l-preview
else ifeq ($(is_at_least_kitkat),1)
API_LEVEL := 19
else
$(error Must build against Android >= 4.4)
endif
# Each DDK is tested against only a single version of the platform.
# Warn if a different platform version is used.
#
ifeq ($(is_future_version),1)
$(info WARNING: Android version is newer than this DDK supports)
else ifneq ($(is_at_least_kitkat),1)
$(info WARNING: Android version is older than this DDK supports)
endif

View File

@@ -1,40 +0,0 @@
########################################################################### ###
#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
#@License Dual MIT/GPLv2
#
# The contents of this file are subject to the MIT license as set out below.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# Alternatively, the contents of this file may be used under the terms of
# the GNU General Public License Version 2 ("GPL") in which case the provisions
# of GPL are applicable instead of those above.
#
# If you wish to allow use of your version of this file only under the terms of
# GPL, and not to allow others to use your version of this file under the terms
# of the MIT license, indicate your decision by deleting the provisions above
# and replace them with the notice and other provisions required by GPL as set
# out in the file called "GPL-COPYING" included in this distribution. If you do
# not delete the provisions above, a recipient may use your version of this file
# under the terms of either the MIT license or GPL.
#
# This License is also included in this distribution in the file called
# "MIT-COPYING".
#
# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
### ###########################################################################

View File

@@ -1,70 +0,0 @@
########################################################################### ###
#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
#@License Dual MIT/GPLv2
#
# The contents of this file are subject to the MIT license as set out below.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# Alternatively, the contents of this file may be used under the terms of
# the GNU General Public License Version 2 ("GPL") in which case the provisions
# of GPL are applicable instead of those above.
#
# If you wish to allow use of your version of this file only under the terms of
# GPL, and not to allow others to use your version of this file under the terms
# of the MIT license, indicate your decision by deleting the provisions above
# and replace them with the notice and other provisions required by GPL as set
# out in the file called "GPL-COPYING" included in this distribution. If you do
# not delete the provisions above, a recipient may use your version of this file
# under the terms of either the MIT license or GPL.
#
# This License is also included in this distribution in the file called
# "MIT-COPYING".
#
# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
### ###########################################################################
ifeq ($(RGX_BVNC),1.82.4.5)
$(eval $(call TunableKernelConfigC,TC_APOLLO_ES2,1))
endif
ifeq ($(RGX_BVNC),12.4.1.48)
$(eval $(call TunableKernelConfigC,TC_APOLLO_TCF5,1))
endif
ifeq ($(RGX_BVNC),4.31.4.55)
$(eval $(call TunableKernelConfigC,TC_APOLLO_BONNIE,1))
endif
ifeq ($(PVR_SYSTEM),$(filter $(PVR_SYSTEM),rgx_tc rgx_tc_es2 plato))
$(eval $(call TunableKernelConfigC,TC_MEMORY_CONFIG,$(TC_MEMORY_CONFIG),\
Selects the memory configuration to be used. The choices are:_\
* TC_MEMORY_LOCAL (Rogue and the display controller use local card memory)_\
* TC_MEMORY_HOST (Rogue and the display controller use system memory)_\
* TC_MEMORY_HYBRID (Rogue uses system memory and the display controller uses local card memory)))
endif
ifeq ($(PVR_SYSTEM), rgx_linux_apollo)
$(eval $(call BothConfigC,TC_MEMORY_CONFIG,TC_MEMORY_LOCAL))
$(call $(NonTunableOption,TC_MEMORY_CONFIG))
endif
ifeq ($(TC_MEMORY_CONFIG),TC_MEMORY_LOCAL)
LMA := 1
endif
$(eval $(call TunableBothConfigC,LMA,))
$(eval $(call TunableKernelConfigMake,LMA,))

View File

@@ -1,194 +0,0 @@
########################################################################### ###
#@File
#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
#@License Dual MIT/GPLv2
#
# The contents of this file are subject to the MIT license as set out below.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# Alternatively, the contents of this file may be used under the terms of
# the GNU General Public License Version 2 ("GPL") in which case the provisions
# of GPL are applicable instead of those above.
#
# If you wish to allow use of your version of this file only under the terms of
# GPL, and not to allow others to use your version of this file under the terms
# of the MIT license, indicate your decision by deleting the provisions above
# and replace them with the notice and other provisions required by GPL as set
# out in the file called "GPL-COPYING" included in this distribution. If you do
# not delete the provisions above, a recipient may use your version of this file
# under the terms of either the MIT license or GPL.
#
# This License is also included in this distribution in the file called
# "MIT-COPYING".
#
# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
### ###########################################################################
# Check for valid values of $(MULTIARCH).
ifeq ($(strip $(MULTIARCH)),0)
$(error MULTIARCH must be empty to disable multiarch)
endif
define calculate-compiler-preferred-target
ifeq ($(2),qcc)
$(1)_compiler_preferred_target := qcc
else
$(1)_compiler_preferred_target := $$(shell $(2) -dumpmachine)
ifeq ($$($(1)_compiler_preferred_target),)
$$(warning No output from '$(2) -dumpmachine')
$$(warning Check that the compiler is in your PATH and CROSS_COMPILE is)
$$(warning set correctly.)
$$(error Unable to run compiler '$(2)')
endif
ifneq ($$(filter x86_64-%,$$($(1)_compiler_preferred_target)),)
$(1)_compiler_preferred_target := x86_64-linux-gnu
endif
ifneq ($$(filter i386-% i486-% i686-%,$$($(1)_compiler_preferred_target)),)
$(1)_compiler_preferred_target := i386-linux-gnu
endif
ifneq ($$(filter armv7a-cros-linux-gnueabi,$$($(1)_compiler_preferred_target)),)
$(1)_compiler_preferred_target := arm-linux-gnueabi
endif
endif
endef
define cross-compiler-name
ifeq ($$(origin CC),file)
$(1) := $(2)$(3)
else
ifeq ($$(_CLANG),true)
$(1) := $(3) -target $$(patsubst %-,%,$(2))
else
$(1) := $(3)
endif
endif
endef
# Work out the host compiler architecture
$(eval $(call calculate-compiler-preferred-target,host,$(HOST_CC)))
ifeq ($(host_compiler_preferred_target),x86_64-linux-gnu)
HOST_PRIMARY_ARCH := host_x86_64
HOST_32BIT_ARCH := host_i386
HOST_FORCE_32BIT := -m32
else
ifeq ($(host_compiler_preferred_target),i386-linux-gnu)
HOST_PRIMARY_ARCH := host_i386
HOST_32BIT_ARCH := host_i386
else
$(error Unknown host compiler target architecture $(host_compiler_preferred_target))
endif
endif
# Workaround our lack of support for non-Linux HOST_CCs
ifneq ($(HOST_CC_IS_LINUX),1)
$(warning $$(HOST_CC) is non-Linux. Trying to work around.)
override HOST_CC := $(HOST_CC) -D__linux__
$(eval $(call BothConfigMake,HOST_CC,$(HOST_CC)))
endif
$(eval $(call BothConfigMake,HOST_PRIMARY_ARCH,$(HOST_PRIMARY_ARCH)))
$(eval $(call BothConfigMake,HOST_32BIT_ARCH,$(HOST_32BIT_ARCH)))
$(eval $(call BothConfigMake,HOST_FORCE_32BIT,$(HOST_FORCE_32BIT)))
TARGET_ALL_ARCH :=
TARGET_PRIMARY_ARCH :=
TARGET_SECONDARY_ARCH :=
# Work out the target compiler cross triple, and include the corresponding
# compilers/*.mk file, which sets TARGET_PRIMARY_ARCH and
# TARGET_SECONDARY_ARCH for that compiler.
#
compilers := ../config/compilers
define include-compiler-file
ifeq ($(strip $(1)),)
$$(error empty arg passed to include-compiler-file)
endif
ifeq ($$(wildcard $$(compilers)/$(1).mk),)
$$(warning ******************************************************)
$$(warning Compiler target '$(1)' not recognised)
$$(warning (missing $$(compilers)/$(1).mk file))
$$(warning ******************************************************)
$$(error Compiler '$(1)' not recognised)
endif
include $$(compilers)/$(1).mk
endef
# Check the kernel cross compiler to work out which architecture it targets.
# We can then tell if CROSS_COMPILE targets a different architecture.
ifneq ($(origin KERNEL_CROSS_COMPILE),undefined)
# First, calculate the value of KERNEL_CROSS_COMPILE as it would be seen by
# the main build, so we can check it here in the config stage.
$(call one-word-only,KERNEL_CROSS_COMPILE)
_kernel_cross_compile := $(if $(filter undef,$(KERNEL_CROSS_COMPILE)),,$(KERNEL_CROSS_COMPILE))
# We can take shortcuts with KERNEL_CROSS_COMPILE, as we don't want to
# respect CC and we don't support clang in that part currently.
_kernel_cross_compile := $(_kernel_cross_compile)gcc
# Then check the compiler.
$(eval $(call calculate-compiler-preferred-target,target,$(_kernel_cross_compile)))
$(eval $(call include-compiler-file,$(target_compiler_preferred_target)))
_kernel_primary_arch := $(TARGET_PRIMARY_ARCH)
else
# We can take shortcuts with KERNEL_CROSS_COMPILE, as we don't want to
# respect CC and we don't support clang in that part currently.
_kernel_cross_compile := $(CROSS_COMPILE)gcc
# KERNEL_CROSS_COMPILE will be the same as CROSS_COMPILE, so we don't need
# to do the compatibility check.
_kernel_primary_arch :=
endif
$(eval $(call cross-compiler-name,_cc,$(CROSS_COMPILE),$(CC)))
$(eval $(call cross-compiler-name,_cc_secondary,$(if $(CROSS_COMPILE_SECONDARY),$(CROSS_COMPILE_SECONDARY),$(CROSS_COMPILE)),$(CC_SECONDARY)))
$(eval $(call calculate-compiler-preferred-target,target,$(_cc)))
$(eval $(call include-compiler-file,$(target_compiler_preferred_target)))
# Sanity check: if KERNEL_CROSS_COMPILE was set, it has to target the same
# architecture as CROSS_COMPILE.
ifneq ($(_kernel_primary_arch),)
ifneq ($(TARGET_PRIMARY_ARCH),$(_kernel_primary_arch))
$(warning ********************************************************)
$(warning Error: Kernel and user-mode cross compilers build for)
$(warning different targets)
$(warning $(space)$(space)CROSS_COMPILE=$(CROSS_COMPILE))
$(warning $(space)$(space)$(space)builds for $(TARGET_PRIMARY_ARCH))
$(warning $(space)$(space)KERNEL_CROSS_COMPILE=$(KERNEL_CROSS_COMPILE))
$(warning $(space)$(space)$(space)builds for $(_kernel_primary_arch))
$(warning ********************************************************)
$(error Mismatching kernel and user-mode cross compilers)
endif
endif
ifneq ($(MULTIARCH),32only)
TARGET_ALL_ARCH += $(TARGET_PRIMARY_ARCH)
endif
ifneq ($(MULTIARCH),64only)
TARGET_ALL_ARCH += $(TARGET_SECONDARY_ARCH)
endif
$(eval $(call BothConfigMake,TARGET_PRIMARY_ARCH,$(TARGET_PRIMARY_ARCH)))
$(eval $(call BothConfigMake,TARGET_SECONDARY_ARCH,$(TARGET_SECONDARY_ARCH)))
$(eval $(call BothConfigMake,TARGET_ALL_ARCH,$(TARGET_ALL_ARCH)))
$(eval $(call BothConfigMake,TARGET_FORCE_32BIT,$(TARGET_FORCE_32BIT)))
$(info ******* Multiarch build: $(if $(MULTIARCH),yes,no))
$(info ******* Primary arch: $(if $(TARGET_PRIMARY_ARCH),$(TARGET_PRIMARY_ARCH),none))
$(info ******* Secondary arch: $(if $(TARGET_SECONDARY_ARCH),$(TARGET_SECONDARY_ARCH),none))
# Find the paths to libgcc for the primary and secondary architectures.
LIBGCC := $(shell $(_cc) -print-libgcc-file-name)
LIBGCC_SECONDARY := $(shell $(_cc_secondary) $(TARGET_FORCE_32BIT) -print-libgcc-file-name)

View File

@@ -1,13 +0,0 @@
# SPDX-License-Identifier: GPL-2.0
# 64-bit Android AArch64 compiler
TARGET_PRIMARY_ARCH := target_aarch64
ifeq ($(MULTIARCH),1)
TARGET_SECONDARY_ARCH := target_armv7-a
ifneq ($(MAKECMDGOALS),kbuild)
ifneq ($(COMPONENTS),)
ifeq ($(CROSS_COMPILE_SECONDARY),)
$(error CROSS_COMPILE_SECONDARY must be set for multiarch ARM builds)
endif
endif
endif
endif

View File

@@ -1,3 +0,0 @@
# SPDX-License-Identifier: GPL-2.0
# 32-bit ARM EABI compiler
TARGET_PRIMARY_ARCH := target_armv7-a

View File

@@ -1,3 +0,0 @@
# SPDX-License-Identifier: GPL-2.0
# 32-bit Android ARM compiler
include $(compilers)/arm-eabi.mk

View File

@@ -1,3 +0,0 @@
# SPDX-License-Identifier: GPL-2.0
# 32-bit x86 compiler
TARGET_PRIMARY_ARCH := target_i686

View File

@@ -1,30 +0,0 @@
# SPDX-License-Identifier: GPL-2.0
# 64-bit x86 compiler
TARGET_FORCE_32BIT := -m32
ifneq ($(KERNELDIR),)
ifneq ($(ARCH),i386)
ifeq ($(shell grep -q "CONFIG_X86_32=y" $(KERNELDIR)/.config && echo 1 || echo 0),1)
$(warning ******************************************************)
$(warning Your kernel appears to be configured for 32-bit x86,)
$(warning but CROSS_COMPILE (or KERNEL_CROSS_COMPILE) points)
$(warning to a 64-bit compiler.)
$(warning If you want a 32-bit build, either set CROSS_COMPILE)
$(warning to point to a 32-bit compiler, or build with ARCH=i386)
$(warning to force 32-bit mode with your existing compiler.)
$(warning ******************************************************)
$(error Invalid CROSS_COMPILE / kernel architecture combination)
endif # CONFIG_X86_32
endif # ARCH=i386
endif # KERNELDIR
# If ARCH=i386 is set, force a build for 32-bit only, even though we're
# using a 64-bit compiler.
ifeq ($(ARCH),i386)
include $(compilers)/i386-linux-gnu.mk
else
TARGET_PRIMARY_ARCH := target_x86_64
ifeq ($(MULTIARCH),1)
TARGET_SECONDARY_ARCH := target_i686
endif # MULTIARCH
endif

View File

@@ -1,867 +0,0 @@
########################################################################### ###
#@File
#@Title Root build configuration.
#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
#@License Dual MIT/GPLv2
#
# The contents of this file are subject to the MIT license as set out below.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# Alternatively, the contents of this file may be used under the terms of
# the GNU General Public License Version 2 ("GPL") in which case the provisions
# of GPL are applicable instead of those above.
#
# If you wish to allow use of your version of this file only under the terms of
# GPL, and not to allow others to use your version of this file under the terms
# of the MIT license, indicate your decision by deleting the provisions above
# and replace them with the notice and other provisions required by GPL as set
# out in the file called "GPL-COPYING" included in this distribution. If you do
# not delete the provisions above, a recipient may use your version of this file
# under the terms of either the MIT license or GPL.
#
# This License is also included in this distribution in the file called
# "MIT-COPYING".
#
# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
### ###########################################################################
# Configuration wrapper for new build system. This file deals with
# configuration of the build. Add to this file anything that deals
# with switching driver options on/off and altering the defines or
# objects the build uses.
#
# At the end of this file is an exhaustive list of all variables
# that are passed between the platform/config stage and the generic
# build. PLEASE refrain from adding more variables than necessary
# to this stage -- almost all options can go through config.h.
#
# Sanity check: Make sure preconfig has been included
ifeq ($(TOP),)
$(error TOP not defined: Was preconfig.mk included in root makefile?)
endif
################################# MACROS ####################################
ALL_TUNABLE_OPTIONS :=
# This records the config option's help text and default value. Note that
# the help text can't contain a literal comma. Use $(comma) instead.
define RegisterOptionHelp
ALL_TUNABLE_OPTIONS += $(1)
ifeq ($(INTERNAL_DESCRIPTION_FOR_$(1)),)
INTERNAL_DESCRIPTION_FOR_$(1) := $(3)
endif
INTERNAL_CONFIG_DEFAULT_FOR_$(1) := $(2)
$(if $(4),\
$(error Too many arguments in config option '$(1)' (stray comma in help text?)))
endef
# Write out a kernel GNU make option.
#
define KernelConfigMake
$$(shell echo "override $(1) := $(2)" >>$(CONFIG_KERNEL_MK).new)
$(if $(filter config,$(D)),$(info KernelConfigMake $(1) := $(2) # $(if $($(1)),$(origin $(1)),default)))
endef
# Write out a GNU make option for both user & kernel
#
define BothConfigMake
$$(eval $$(call KernelConfigMake,$(1),$(2)))
$$(eval $$(call UserConfigMake,$(1),$(2)))
endef
# Conditionally write out a kernel GNU make option
#
define _TunableKernelConfigMake
ifneq ($$($(1)),)
ifneq ($$($(1)),0)
$$(eval $$(call KernelConfigMake,$(1),$$($(1))))
endif
else
ifneq ($(2),)
$$(eval $$(call KernelConfigMake,$(1),$(2)))
endif
endif
endef
define TunableKernelConfigMake
$$(eval $$(call _TunableKernelConfigMake,$(1),$(2)))
$(call RegisterOptionHelp,$(1),$(2),$(3),$(4))
endef
# Conditionally write out a GNU make option for both user & kernel
#
define TunableBothConfigMake
$$(eval $$(call _TunableKernelConfigMake,$(1),$(2)))
$$(eval $$(call _TunableUserConfigMake,$(1),$(2)))
$(call RegisterOptionHelp,$(1),$(2),$(3),$(4))
endef
# Write out a kernel-only option
#
define KernelConfigC
$$(shell echo "#define $(1) $(2)" >>$(CONFIG_KERNEL_H).new)
$(if $(filter config,$(D)),$(info KernelConfigC #define $(1) $(2) /* $(if $($(1)),$(origin $(1)),default) */),)
endef
# Write out an option for both user & kernel
#
define BothConfigC
$$(eval $$(call KernelConfigC,$(1),$(2)))
$$(eval $$(call UserConfigC,$(1),$(2)))
endef
# Conditionally write out a kernel-only option
#
define _TunableKernelConfigC
ifneq ($$($(1)),)
ifneq ($$($(1)),0)
ifeq ($$($(1)),1)
$$(eval $$(call KernelConfigC,$(1),))
else
$$(eval $$(call KernelConfigC,$(1),$$($(1))))
endif
endif
else
ifneq ($(2),)
ifeq ($(2),1)
$$(eval $$(call KernelConfigC,$(1),))
else
$$(eval $$(call KernelConfigC,$(1),$(2)))
endif
endif
endif
endef
define TunableKernelConfigC
$$(eval $$(call _TunableKernelConfigC,$(1),$(2)))
ALL_TUNABLE_OPTIONS += $(1)
ifeq ($(INTERNAL_DESCRIPTION_FOR_$(1)),)
INTERNAL_DESCRIPTION_FOR_$(1) := $(3)
endif
INTERNAL_CONFIG_DEFAULT_FOR_$(1) := $(2)
endef
# Conditionally write out an option for both user & kernel
#
define TunableBothConfigC
$$(eval $$(call _TunableKernelConfigC,$(1),$(2)))
$$(eval $$(call _TunableUserConfigC,$(1),$(2)))
$(call RegisterOptionHelp,$(1),$(2),$(3),$(4))
endef
# Use this to mark config options which have to exist, but aren't
# user-tunable. Warn if an attempt is made to change it.
#
define NonTunableOption
$(if $(filter command line environment,$(origin $(1))),\
$(error Changing '$(1)' is not supported))
endef
############################### END MACROS ##################################
# Check we have a new enough version of GNU make.
#
need := 3.81
ifeq ($(filter $(need),$(firstword $(sort $(MAKE_VERSION) $(need)))),)
$(error A version of GNU make >= $(need) is required - this is version $(MAKE_VERSION))
endif
# Decide whether we need a BVNC
ifneq ($(COMPILER_BVNC_LIST),)
DONT_NEED_RGX_BVNC := 1
endif
include ../defs.mk
# Infer PVR_BUILD_DIR from the directory configuration is launched from.
# Check anyway that such a directory exists.
#
PVR_BUILD_DIR := $(notdir $(abspath .))
$(call directory-must-exist,$(TOP)/build/linux/$(PVR_BUILD_DIR))
# Output directory for configuration, object code,
# final programs/libraries, and install/rc scripts.
#
BUILD ?= release
ifneq ($(filter $(WINDOW_SYSTEM),xorg wayland nullws nulldrmws ews_drm nulladfws ews_adf screen),)
OUT ?= $(TOP)/binary_$(PVR_BUILD_DIR)_$(WINDOW_SYSTEM)_$(BUILD)
else
OUT ?= $(TOP)/binary_$(PVR_BUILD_DIR)_$(BUILD)
endif
override OUT := $(if $(filter /%,$(OUT)),$(OUT),$(TOP)/$(OUT))
CONFIG_MK := $(OUT)/config.mk
CONFIG_H := $(OUT)/config.h
CONFIG_KERNEL_MK := $(OUT)/config_kernel.mk
CONFIG_KERNEL_H := $(OUT)/config_kernel.h
# Convert commas to spaces in $(D). This is so you can say "make
# D=config-changes,freeze-config" and have $(filter config-changes,$(D))
# still work.
override D := $(subst $(comma),$(space),$(D))
# Create the OUT directory
#
$(shell mkdir -p $(OUT))
# Some targets don't need information about any modules. If we only specify
# these targets on the make command line, set INTERNAL_CLOBBER_ONLY to
# indicate that toplevel.mk shouldn't read any makefiles
CLOBBER_ONLY_TARGETS := clean clobber help install
INTERNAL_CLOBBER_ONLY :=
ifneq ($(strip $(MAKECMDGOALS)),)
INTERNAL_CLOBBER_ONLY := \
$(if \
$(strip $(foreach _cmdgoal,$(MAKECMDGOALS),\
$(if $(filter $(_cmdgoal),$(CLOBBER_ONLY_TARGETS)),,x))),,true)
endif
# For a clobber-only build, we shouldn't regenerate any config files
ifneq ($(INTERNAL_CLOBBER_ONLY),true)
-include ../config/user-defs.mk
#
# Core handling
# delete any previous intermediary files
$(shell \
for file in $(CONFIG_KERNEL_H).new $(CONFIG_KERNEL_MK).new ; do \
rm -f $$file; \
done)
ifeq ($(DONT_NEED_RGX_BVNC),)
# Extract the BNC config name
RGX_BNC_SPLIT := $(subst .,$(space) ,$(RGX_BVNC))
RGX_BNC := $(word 1,$(RGX_BNC_SPLIT)).V.$(word 3,$(RGX_BNC_SPLIT)).$(word 4,$(RGX_BNC_SPLIT))
# Check BVNC core version
ALL_KM_BVNCS := \
$(patsubst rgxcore_km_%.h,%,\
$(notdir $(shell ls $(TOP)/hwdefs/km/cores/rgxcore_km_*.h)))
ifeq ($(filter $(RGX_BVNC),$(ALL_KM_BVNCS)),)
$(error Error: Invalid Kernel core RGX_BVNC=$(RGX_BVNC). \
Valid Kernel core BVNCs: $(subst $(space),$(comma)$(space),$(ALL_KM_BVNCS)))
endif
# Check if BVNC core file exist
RGX_BVNC_CORE_KM := $(TOP)/hwdefs/km/cores/rgxcore_km_$(RGX_BVNC).h
RGX_BVNC_CORE_KM_HEADER := \"cores/rgxcore_km_$(RGX_BVNC).h\"
# "rgxcore_km_$(RGX_BVNC).h"
ifeq ($(wildcard $(RGX_BVNC_CORE_KM)),)
$(error The file $(RGX_BVNC_CORE_KM) does not exist. \
Valid BVNCs: $(ALL_KM_BVNCS))
endif
# Check BNC config version
ALL_KM_BNCS := \
$(patsubst rgxconfig_km_%.h,%,\
$(notdir $(shell ls $(TOP)/hwdefs/km/configs/rgxconfig_km_*.h)))
ifeq ($(filter $(RGX_BNC),$(ALL_KM_BNCS)),)
$(error Error: Invalid Kernel config RGX_BNC=$(RGX_BNC). \
Valid Kernel config BNCs: $(subst $(space),$(comma)$(space),$(ALL_KM_BNCS)))
endif
# Check if BNC config file exist
RGX_BNC_CONFIG_KM := $(TOP)/hwdefs/km/configs/rgxconfig_km_$(RGX_BNC).h
RGX_BNC_CONFIG_KM_HEADER := \"configs/rgxconfig_km_$(RGX_BNC).h\"
#"rgxcore_km_$(RGX_BNC).h"
ifeq ($(wildcard $(RGX_BNC_CONFIG_KM)),)
$(error The file $(RGX_BNC_CONFIG_KM) does not exist. \
Valid BNCs: $(ALL_KM_BNCS))
endif
endif
# Enforced dependencies. Move this to an include.
#
SUPPORT_LINUX_USING_WORKQUEUES ?= 1
ifeq ($(SUPPORT_LINUX_USING_WORKQUEUES),1)
override PVR_LINUX_USING_WORKQUEUES := 1
override PVR_LINUX_MISR_USING_PRIVATE_WORKQUEUE := 1
override PVR_LINUX_TIMERS_USING_WORKQUEUES := 1
else ifeq ($(SUPPORT_LINUX_USING_SHARED_WORKQUEUES),1)
override PVR_LINUX_USING_WORKQUEUES := 1
override PVR_LINUX_MISR_USING_WORKQUEUE := 1
override PVR_LINUX_TIMERS_USING_SHARED_WORKQUEUE := 1
endif
ifeq ($(NO_HARDWARE),1)
override SYS_USING_INTERRUPTS := 0
endif
# Rather than requiring the user to have to define two variables (one quoted,
# one not), make PVRSRV_MODNAME a non-tunable and give it an overridable
# default here.
#
PVRSRV_MODNAME ?= pvrsrvkm
# Normally builds don't touch these, but we use them to influence the
# components list. Make sure these are defined early enough to make this
# possible.
#
ifeq ($(DONT_NEED_RGX_BVNC),)
# we can only do this stuff if we have a BVNC
SUPPORT_RAY_TRACING := \
$(shell grep -qw RGX_FEATURE_RAY_TRACING $(RGX_BNC_CONFIG_KM) && echo 1)
SUPPORT_META_DMA :=\
$(shell grep -qw RGX_FEATURE_META_DMA $(RGX_BNC_CONFIG_KM) && echo 1)
endif
# Default place for shared libraries
SHLIB_DESTDIR ?= /usr/lib
# Build's selected list of components.
# - components.mk is a per-build file that specifies the components that are
# to be built
-include components.mk
# Set up the host and target compiler.
include ../config/compiler.mk
# PDUMP needs extra components
#
ifeq ($(PDUMP),1)
ifneq ($(COMPONENTS),)
COMPONENTS += pdump
endif
ifeq ($(SUPPORT_DRM),1)
EXTRA_PVRSRVKM_COMPONENTS += dbgdrv
else
KERNEL_COMPONENTS += dbgdrv
endif
endif
# HWPerf KM Interface example
#
ifeq ($(SUPPORT_KERNEL_HWPERF_TEST),1)
KERNEL_COMPONENTS += rgxhwpdrv
endif
# PVRGDB needs extra components
#
ifeq ($(PVRGDB),1)
ifneq ($(COMPONENTS),)
COMPONENTS += pvrdebugger pvrgdb pvrdebugipc
ifneq ($(filter opencl,$(COMPONENTS)),)
COMPONENTS += gdb_ocl_test
endif
endif
override SUPPORT_EXPORTING_MEMORY_CONTEXT := 1
endif
# RenderScript Replay needs extra components
ifeq ($(RSCREPLAY),1)
ifneq ($(COMPONENTS),)
COMPONENTS += librscruntime librsccompiler renderscript renderscript_sha1 rscreplay
endif
endif
$(if $(filter config,$(D)),$(info Build configuration:))
################################# CONFIG ####################################
ifneq ($(SUPPORT_NEUTRINO_PLATFORM), 1)
# If KERNELDIR is set, write it out to the config.mk, with
# KERNEL_COMPONENTS and KERNEL_ID
#
ifneq ($(strip $(KERNELDIR)),)
PVRSRV_MODULE_BASEDIR ?= /lib/modules/$(KERNEL_ID)/extra/
$(eval $(call BothConfigMake,KERNELDIR,$(KERNELDIR)))
$(eval $(call BothConfigMake,KERNEL_ID,$(KERNEL_ID)))
$(eval $(call KernelConfigMake,KERNEL_COMPONENTS,$(KERNEL_COMPONENTS)))
$(eval $(call TunableKernelConfigMake,EXTRA_PVRSRVKM_COMPONENTS,,\
List of components that should be built in to pvrsrvkm.ko$(comma) rather than_\
forming separate kernel modules._\
))
# If KERNEL_CROSS_COMPILE is set to "undef", this is magically
# equivalent to being unset. If it is unset, we use CROSS_COMPILE
# (which might also be unset). If it is set, use it directly.
ifneq ($(KERNEL_CROSS_COMPILE),undef)
KERNEL_CROSS_COMPILE ?= $(CROSS_COMPILE)
$(eval $(call TunableBothConfigMake,KERNEL_CROSS_COMPILE,))
endif
# Check the KERNELDIR has a kernel built and also check that it is
# not 64-bit, which we do not support.
KERNEL_AUTOCONF := \
$(strip $(wildcard $(KERNELDIR)/include/linux/autoconf.h) \
$(wildcard $(KERNELDIR)/include/generated/autoconf.h))
ifeq ($(KERNEL_AUTOCONF),)
$(warning autoconf.h not found in $$(KERNELDIR)/include/linux \
or $$(KERNELDIR)/include/generated. Check your $$(KERNELDIR) variable \
and kernel configuration.)
endif
else
$(if $(KERNEL_COMPONENTS),$(warning KERNELDIR is not set. Kernel components cannot be built))
endif
endif # !Neutrino
# Normally this is off for Linux, and only used by Android, but if customers
# are testing their display engines using NULLADFWS, they need to enable it
# for dmabuf support under Linux. The sync header is needed by adf_pdp.
#
SUPPORT_ION ?= 0
ifneq ($(SUPPORT_ION),0)
# Support kernels built out-of-tree with O=/other/path
# In those cases, KERNELDIR will be O, not the source tree.
ifneq ($(wildcard $(KERNELDIR)/source),)
KSRCDIR := $(KERNELDIR)/source
else
KSRCDIR := $(KERNELDIR)
endif
ifneq ($(wildcard $(KSRCDIR)/drivers/staging/android/ion/ion.h),)
# The kernel has a more recent version of ion, located in drivers/staging.
# Change the default header paths and the behaviour wrt sg_dma_len.
PVR_ANDROID_ION_HEADER := \"../drivers/staging/android/ion/ion.h\"
PVR_ANDROID_ION_PRIV_HEADER := \"../drivers/staging/android/ion/ion_priv.h\"
PVR_ANDROID_ION_USE_SG_LENGTH := 1
endif
ifneq ($(wildcard $(KSRCDIR)/drivers/staging/android/sync.h),)
# The kernel has a more recent version of the sync driver, located in
# drivers/staging. Change the default header path.
PVR_ANDROID_SYNC_HEADER := \"../drivers/staging/android/sync.h\"
endif
$(eval $(call BothConfigMake,SUPPORT_ION,1))
$(eval $(call BothConfigC,SUPPORT_ION,))
$(eval $(call TunableKernelConfigC,PVR_ANDROID_ION_HEADER,\"linux/ion.h\"))
$(eval $(call TunableKernelConfigC,PVR_ANDROID_ION_PRIV_HEADER,\"../drivers/gpu/ion/ion_priv.h\"))
$(eval $(call TunableKernelConfigC,PVR_ANDROID_ION_USE_SG_LENGTH,))
$(eval $(call TunableKernelConfigC,PVR_ANDROID_SYNC_HEADER,\"linux/sync.h\"))
endif
$(eval $(call UserConfigC,PVRSRV_MODULE_BASEDIR,\"$(PVRSRV_MODULE_BASEDIR)\"))
# Ideally configured by platform Makefiles, as necessary
#
ifeq ($(SUPPORT_KERNEL_SRVINIT),1)
$(eval $(call TunableBothConfigMake,RGX_FW_FILENAME,rgx.fw))
$(eval $(call TunableBothConfigC,RGX_FW_FILENAME,"\"rgx.fw\""))
endif
$(if $(USE_CCACHE),$(if $(USE_DISTCC),$(error\
Enabling both USE_CCACHE and USE_DISTCC at the same time is not supported)))
# Invariant options for Linux
#
$(eval $(call BothConfigC,LINUX,))
$(eval $(call BothConfigC,PVR_BUILD_DIR,"\"$(PVR_BUILD_DIR)\""))
$(eval $(call BothConfigC,PVR_BUILD_TYPE,"\"$(BUILD)\""))
$(eval $(call BothConfigC,PVRSRV_MODNAME,"\"$(PVRSRV_MODNAME)\""))
$(eval $(call BothConfigMake,PVRSRV_MODNAME,$(PVRSRV_MODNAME)))
$(eval $(call BothConfigMake,PVR_BUILD_DIR,$(PVR_BUILD_DIR)))
$(eval $(call BothConfigMake,PVR_BUILD_TYPE,$(BUILD)))
$(eval $(call BothConfigC,SUPPORT_RGX,1))
$(eval $(call UserConfigMake,SUPPORT_RGX,1))
# Some of the definitions in stdint.h aren't exposed by default in C++ mode,
# unless these macros are defined. To make sure we get these definitions
# regardless of which files include stdint.h, define them here.
$(eval $(call UserConfigC,__STDC_CONSTANT_MACROS,))
$(eval $(call UserConfigC,__STDC_FORMAT_MACROS,))
$(eval $(call UserConfigC,__STDC_LIMIT_MACROS,))
$(eval $(call UserConfigC,PVR_TLS_USE_GCC__thread_KEYWORD,))
ifneq ($(DISPLAY_CONTROLLER),)
$(eval $(call BothConfigC,DISPLAY_CONTROLLER,$(DISPLAY_CONTROLLER)))
$(eval $(call BothConfigMake,DISPLAY_CONTROLLER,$(DISPLAY_CONTROLLER)))
endif
$(eval $(call UserConfigC,OPK_DEFAULT,"\"$(OPK_DEFAULT)\""))
$(eval $(call UserConfigC,OPK_FALLBACK,"\"$(OPK_FALLBACK)\""))
$(eval $(call BothConfigMake,PVR_SYSTEM,$(PVR_SYSTEM)))
$(eval $(call KernelConfigMake,PVR_LOADER,$(PVR_LOADER)))
ifeq ($(MESA_EGL),1)
$(eval $(call UserConfigMake,LIB_IMG_EGL,pvr_dri_support))
$(eval $(call UserConfigC,LIB_IMG_EGL_NAME,\"libpvr_dri_support.so\"))
else
$(eval $(call UserConfigMake,LIB_IMG_EGL,IMGegl))
$(eval $(call UserConfigC,LIB_IMG_EGL_NAME,\"libIMGegl.so\"))
endif
# Build-type dependent options
#
$(eval $(call BothConfigMake,BUILD,$(BUILD)))
ifeq ($(BUILD),debug)
PVR_RI_DEBUG ?= 1
SUPPORT_PAGE_FAULT_DEBUG ?= 1
$(eval $(call BothConfigC,DEBUG,))
$(eval $(call KernelConfigC,DEBUG_LINUX_MEMORY_ALLOCATIONS,))
$(eval $(call KernelConfigC,DEBUG_LINUX_MEM_AREAS,))
$(eval $(call KernelConfigC,DEBUG_LINUX_MMAP_AREAS,))
$(eval $(call KernelConfigC,DEBUG_BRIDGE_KM,))
$(eval $(call KernelConfigC,DEBUG_HANDLEALLOC_KM,))
$(eval $(call UserConfigC,DLL_METRIC,1))
$(eval $(call TunableBothConfigC,RGXFW_ALIGNCHECKS,1))
$(eval $(call TunableBothConfigC,PVRSRV_DEBUG_CCB_MAX,))
else ifeq ($(BUILD),release)
$(eval $(call BothConfigC,RELEASE,))
$(eval $(call TunableBothConfigMake,DEBUGLINK,1))
$(eval $(call TunableBothConfigC,RGXFW_ALIGNCHECKS,))
else ifeq ($(BUILD),timing)
$(eval $(call BothConfigC,TIMING,))
$(eval $(call UserConfigC,DLL_METRIC,1))
$(eval $(call TunableBothConfigMake,DEBUGLINK,1))
else
$(error BUILD= must be either debug, release or timing)
endif
# User-configurable options
#
ifeq ($(DONT_NEED_RGX_BVNC),)
$(eval $(call TunableBothConfigC,RGX_BVNC_CORE_KM_HEADER,))
$(eval $(call TunableBothConfigC,RGX_BVNC_CORE_HEADER,))
$(eval $(call TunableBothConfigC,RGX_BNC_CONFIG_KM_HEADER,))
$(eval $(call TunableBothConfigC,RGX_BNC_CONFIG_HEADER,))
endif
$(eval $(call TunableBothConfigC,SUPPORT_DBGDRV_EVENT_OBJECTS,1))
$(eval $(call TunableBothConfigC,PVR_DBG_BREAK_ASSERT_FAIL,,\
Enable this to treat PVR_DBG_BREAK as PVR_ASSERT(0)._\
Otherwise it is ignored._\
))
$(eval $(call TunableBothConfigC,PDUMP,,\
Enable parameter dumping in the driver._\
This adds code to record the parameters being sent to the hardware for_\
later analysis._\
))
PDUMP_STREAMBUF_SIZE_MB ?= 16
$(eval $(call TunableBothConfigC,PDUMP_STREAMBUF_MAX_SIZE_MB,$(PDUMP_STREAMBUF_SIZE_MB),))
$(eval $(call TunableBothConfigC,NO_HARDWARE,,\
Disable hardware interactions (e.g. register writes) that the driver would_\
normally perform. A driver built with this option can$(apos)t drive hardware$(comma)_\
but with PDUMP enabled$(comma) it can capture parameters to be played back later._\
))
$(eval $(call TunableBothConfigC,PDUMP_DEBUG_OUTFILES,))
$(eval $(call TunableBothConfigC,SYS_USING_INTERRUPTS,1))
$(eval $(call TunableBothConfigC,PVRSRV_NEED_PVR_DPF,,\
Enable this to turn on PVR_DPF in release builds._\
))
$(eval $(call TunableBothConfigC,PVRSRV_NEED_PVR_ASSERT,,\
Enable this to turn on PVR_ASSERT in release builds._\
))
$(eval $(call TunableBothConfigC,PVRSRV_NEED_PVR_TRACE,,\
Enable this to turn on PVR_TRACE in release builds._\
))
$(eval $(call TunableBothConfigC,REFCOUNT_DEBUG,))
$(eval $(call TunableBothConfigC,DC_DEBUG,))
$(eval $(call TunableBothConfigC,SCP_DEBUG,))
$(eval $(call TunableBothConfigC,CACHEFLUSH_TYPE,CACHEFLUSH_GENERIC))
$(eval $(call TunableBothConfigC,SUPPORT_INSECURE_EXPORT,))
$(eval $(call TunableBothConfigC,SUPPORT_SECURE_EXPORT,1,\
Enable support for secure device memory and sync export._\
This replaces export handles with file descriptors$(comma) which can be passed_\
between processes to share memory._\
))
$(eval $(call TunableBothConfigC,SUPPORT_GPUTRACE_EVENTS,))
$(eval $(call TunableBothConfigC,SUPPORT_KERNEL_HWPERF,))
$(eval $(call TunableBothConfigC,SUPPORT_DISPLAY_CLASS,))
$(eval $(call TunableBothConfigC,PVRSRV_DEBUG_CCB_MAX,))
$(eval $(call TunableBothConfigC,SUPPORT_TRUSTED_DEVICE,))
$(eval $(call TunableBothConfigC,SUPPORT_GPUVIRT_VALIDATION,))
$(eval $(call TunableBothConfigC,GPUVIRT_VALIDATION_NUM_OS,8))
$(eval $(call TunableBothConfigC,TRUSTED_DEVICE_DEFAULT_ENABLED,))
$(eval $(call TunableBothConfigC,SUPPORT_EXPORTING_MEMORY_CONTEXT,))
$(eval $(call TunableBothConfigMake,SUPPORT_USER_REGISTER_CONFIGURATION,))
$(eval $(call TunableBothConfigC,SUPPORT_USER_REGISTER_CONFIGURATION,))
$(eval $(call TunableBothConfigC,SUPPORT_VALIDATION,))
$(eval $(call TunableBothConfigC,FIX_DUSTS_POW_ON_INIT,))
$(eval $(call TunableBothConfigC,PVR_DVFS,,\
Enables PVR DVFS implementation to actively change frequency / voltage depending_\
on current GPU load. Currently only supported on Linux._\
))
$(eval $(call TunableBothConfigC,PVR_POWER_ACTOR,,\
Enables PVR power actor implementation for registration with a kernel configured_\
with IPA. Enables power counter measurement timer in the FW which is periodicaly_\
read by the host DVFS in order to operate within a governor set power envelope._\
))
$(eval $(call TunableBothConfigC,PVR_POWER_ACTOR_SCALING,,\
Scaling factor for the dynamic power coefficients._\
))
$(eval $(call TunableKernelConfigC,PVR_POWER_ACTOR_DEBUG,,\
Enable debug logging for power actor._\
))
$(eval $(call TunableKernelConfigC,DEBUG_HANDLEALLOC_INFO_KM,))
$(eval $(call TunableKernelConfigC,SUPPORT_LINUX_X86_WRITECOMBINE,1))
$(eval $(call TunableKernelConfigC,SUPPORT_LINUX_X86_PAT,1))
$(eval $(call TunableKernelConfigC,PVRSRV_RESET_ON_HWTIMEOUT,))
$(eval $(call TunableKernelConfigC,PVR_LINUX_USING_WORKQUEUES,))
$(eval $(call TunableKernelConfigC,PVR_LINUX_MISR_USING_WORKQUEUE,))
$(eval $(call TunableKernelConfigC,PVR_LINUX_MISR_USING_PRIVATE_WORKQUEUE,))
$(eval $(call TunableKernelConfigC,PVR_LINUX_TIMERS_USING_WORKQUEUES,))
$(eval $(call TunableKernelConfigC,PVR_LINUX_TIMERS_USING_SHARED_WORKQUEUE,))
$(eval $(call TunableKernelConfigC,PVR_LDM_PLATFORM_PRE_REGISTERED,))
$(eval $(call TunableKernelConfigC,PVR_LDM_DRIVER_REGISTRATION_NAME,"\"$(PVRSRV_MODNAME)\""))
$(eval $(call TunableBothConfigC,LDM_PLATFORM,))
$(eval $(call TunableBothConfigC,LDM_PCI,))
$(eval $(call TunableBothConfigC,PVRSRV_ENABLE_FULL_SYNC_TRACKING,))
$(eval $(call TunableKernelConfigC,PVRSRV_FULL_SYNC_TRACKING_HISTORY_LEN,256))
$(eval $(call TunableKernelConfigC,PVRSRV_ENABLE_FULL_CCB_DUMP,))
$(eval $(call TunableKernelConfigC,SYNC_DEBUG,))
$(eval $(call TunableKernelConfigC,SUPPORT_DUMP_CLIENT_CCB_COMMANDS,))
$(eval $(call TunableKernelConfigC,PVR_LINUX_DONT_USE_RANGE_BASED_INVALIDATE,))
$(eval $(call TunableKernelConfigC,SUPPORT_MMU_PxE_MAP_ON_DEMAND,))
$(eval $(call TunableKernelConfigC,SUPPORT_MMU_MODIFICATION_LOGGING,,\
Enable support for logging of page table modifications. This is as debug_\
feature for use when debugging page-faults which are showing what look to_\
be unexpected values. It keeps a history of the last few modifications types_\
(map/unmap) and the value written during as a result of that operation._\
))
$(eval $(call TunableKernelConfigC,SUPPORT_MMU_PAGESIZECONFIG_REFCOUNT,))
$(eval $(call TunableKernelConfigC,SUPPORT_DC_COMPLETE_TIMEOUT_DEBUG,))
$(eval $(call TunableKernelConfigC,SUPPORT_SYSTEM_INTERRUPT_HANDLING,,\
Enable support for system level interrupt handling. This is intended_\
for use on systems that have two or more levels of interrupt registers_\
which require the top level register to be cleared by the system layer_\
because it is not specific to one single device._\
))
$(eval $(call TunableBothConfigC,SUPPORT_PVR_VALGRIND,))
$(eval $(call TunableBothConfigC,PVRSRV_DEVMEM_SAFE_MEMSETCPY,,\
Enable this to force the use of *DeviceMemSet/Copy in the drvier _\
instead of the built-in libc functions. These implemenations are device _\
memory safe and are used by default on AARCH64 platform._\
))
$(eval $(call TunableBothConfigC,PVRSRV_BRIDGE_LOGGING,))
ifneq ($(SUPPORT_ANDROID_PLATFORM),1)
endif
ifneq ($(DWARF_DEBUG), 1)
endif
$(eval $(call TunableBothConfigMake,CACHEFLUSH_TYPE,CACHEFLUSH_GENERIC))
$(eval $(call TunableBothConfigMake,PDUMP,))
$(eval $(call TunableBothConfigMake,SUPPORT_INSECURE_EXPORT,))
$(eval $(call TunableBothConfigMake,SUPPORT_SECURE_EXPORT,1))
$(eval $(call TunableBothConfigMake,SUPPORT_DISPLAY_CLASS,))
$(eval $(call TunableBothConfigMake,SUPPORT_RAY_TRACING,))
$(eval $(call TunableBothConfigC,FORCE_DM_OVERLAP,))
$(eval $(call TunableBothConfigC,SUPPORT_EXTRA_METASP_DEBUG,))
$(eval $(call TunableBothConfigC,GPU_UTIL_SLC_STALL_COUNTERS,))
$(eval $(call TunableBothConfigMake,SUPPORT_GPUTRACE_EVENTS,))
$(eval $(call TunableBothConfigMake,SUPPORT_KERNEL_HWPERF,))
$(eval $(call TunableBothConfigMake,OPTIM,,\
Specify the optimisation flags passed to the compiler. Normally this_\
is autoconfigured based on the build type._\
))
$(eval $(call TunableBothConfigC,SUPPORT_PERCONTEXT_FREELIST,1))
$(eval $(call TunableBothConfigC,SUPPORT_MMU_FREELIST,))
$(eval $(call TunableBothConfigC,SUPPORT_VFP,))
$(eval $(call TunableBothConfigC,SUPPORT_META_SLAVE_BOOT,))
$(eval $(call UserConfigC,EGL_BASENAME_SUFFIX,\"$(EGL_BASENAME_SUFFIX)\"))
$(eval $(call TunableBothConfigC,PVR_TESTING_UTILS,,\
Enable this to build in support for testing the PVR Transport Layer API._\
))
TQ_CAPTURE_PARAMS ?= 1
$(eval $(call TunableBothConfigC,TDMETACODE,))
$(eval $(call TunableBothConfigC,PVR_DPF_ADHOC_DEBUG_ON,))
$(eval $(call TunableBothConfigC,RGXFW_DEBUG_LOG_GROUP,))
$(eval $(call TunableBothConfigC,SUPPORT_POWMON_WO_GPIO_PIN,))
$(eval $(call TunableKernelConfigMake,PVR_HANDLE_BACKEND,idr,\
Specifies the back-end that should be used$(comma) by the Services kernel handle_\
interface$(comma) to allocate handles. The available backends are:_\
* generic (OS agnostic)_\
* idr (Uses the Linux IDR interface)_\
))
$(eval $(call TunableBothConfigC,PVRSRV_ENABLE_PROCESS_STATS,1,\
Enable Process Statistics via DebugFS._\
))
$(eval $(call TunableBothConfigC,SUPPORT_SHARED_SLC,,\
When the SLC is shared the SLC reset is performed by the System layer when \
calling RGXInitSLC and not the GPU driver. Define this for system layer \
SLC handling. \
))
# PVR_RI_DEBUG is set to enable RI annotation of devmem allocations
# This is enabled by default for debug builds.
#
$(eval $(call TunableBothConfigMake,PVR_RI_DEBUG,))
$(eval $(call TunableBothConfigC,PVR_RI_DEBUG,,\
Enable Resource Information (RI) debug. This logs details of_\
resource allocations with annotation to help indicate their use._\
))
$(eval $(call TunableBothConfigMake,SUPPORT_PAGE_FAULT_DEBUG,))
$(eval $(call TunableBothConfigC,SUPPORT_PAGE_FAULT_DEBUG,,\
Collect information about allocations such as descriptive strings_\
and timing data for more detailed page fault analysis._\
))
$(eval $(call TunableKernelConfigC,PVR_DISABLE_KMALLOC_MEMSTATS,,\
Set to avoid gathering statistical information about kmalloc and vmalloc_\
allocations._\
))
$(eval $(call TunableBothConfigC,PVRSRV_ENABLE_MEMORY_STATS,,\
Enable Memory allocations to be recorded and published via Process Statistics._\
))
$(eval $(call TunableKernelConfigC,PVRSRV_ENABLE_FW_TRACE_DEBUGFS,,\
Enable automatic decoding of Firmware Trace via DebugFS._\
))
$(eval $(call TunableBothConfigC,PVR_LINUX_PHYSMEM_MAX_POOL_PAGES,10240))
$(eval $(call TunableBothConfigC,PVR_MMAP_USE_VM_INSERT,,\
If enabled Linux will always use vm_insert_page for CPU mappings._\
vm_insert_page was found to be slower than remap_pfn_range on ARM kernels_\
but guarantees full memory accounting for the process that mapped the memory.\
The slowdown in vm_insert_page is caused by a dcache flush_\
that is only implemented for ARM and a few other architectures._\
This tunable can be enabled to debug memory issues. On x86 platforms_\
we always use vm_insert_page independent of this tunable._\
))
# ARM-Linux specific:
# When allocating uncached or write-combine memory we need to invalidate the
# CPU cache before we can use the acquired pages.
# The threshhold defines at which number of pages we want to do a full
# cache flush instead of invalidating pages one by one.
$(eval $(call TunableBothConfigC,PVR_LINUX_ARM_PAGEALLOC_FLUSH_THRESHOLD, 256))
# Choose the threshold at which iterative page-by-page ('n' 1 page allocs)
# allocation is replaced with multiple block (1 'n' page alloc) allocation;
# for PVR_LINUX_PHYSMEM_MAX_ALLOC_ORDER, the valid range is [0:MAX_ORDER-1]
# NOTE: To disable higher-order allocation, set XXX_MAX_ALLOC_ORDER to zero
$(eval $(call TunableBothConfigC,PVR_LINUX_PHYSMEM_MIN_NUM_PAGES, 256 ))
$(eval $(call TunableBothConfigC,PVR_LINUX_PHYSMEM_MAX_ALLOC_ORDER, 2 ))
# Choose the threshold at which allocation size we want to use vmalloc instead of
# kmalloc. On highly fragmented systems large kmallocs can fail because it requests
# physically contiguous pages. All allocations bigger than this define use vmalloc.
$(eval $(call TunableBothConfigC,PVR_LINUX_KMALLOC_ALLOCATION_THRESHOLD, 16384 ))
# Tunable RGX_MAX_TA_SYNCS / RGX_MAX_3D_SYNCS to increase the size of sync array in the DDK
# If defined, these macros take up the values as defined in the environment,
# Else, the default value is taken up as defined in include/rgxapi.h
#
$(eval $(call TunableBothConfigMake,SUPPORT_KERNEL_SRVINIT,))
$(eval $(call TunableBothConfigC,SUPPORT_KERNEL_SRVINIT,))
$(eval $(call TunableKernelConfigC,PVRSRV_SPLIT_LARGE_OSMEM_ALLOC,,\
Splits some critical allocations greater than page size into_\
two allocations: multiple page size and allocation size minus multiple_\
page size._\
))
$(eval $(call TunableKernelConfigC,PVRSRV_FORCE_SLOWER_VMAP_ON_64BIT_BUILDS,,\
If enabled, all kernel mappings will use vmap/vunmap._\
vmap/vunmap is slower than vm_map_ram/vm_unmap_ram and can_\
even have bad peaks taking up to 100x longer than vm_map_ram._\
The disadvantage of vm_map_ram is that it can lead to vmalloc space_\
fragmentation that can lead to vmalloc space exhaustion on 32 bit Linux systems._\
This flag only affects 64 bit Linux builds, on 32 bit we always default to use vmap_\
because of the described fragmentation problem._\
))
$(eval $(call TunableKernelConfigC,PVRSRV_DEBUG_LISR_EXECUTION,,\
Collect information about the last execution of the LISR in order to_\
debug interrupt handling timeouts._\
))
endif # INTERNAL_CLOBBER_ONLY
export INTERNAL_CLOBBER_ONLY
export TOP
export OUT
MAKE_ETC := -Rr --no-print-directory -C $(TOP) TOP=$(TOP) OUT=$(OUT) \
-f build/linux/toplevel.mk
# This must match the default value of MAKECMDGOALS below, and the default
# goal in toplevel.mk
.DEFAULT_GOAL := build
ifeq ($(MAKECMDGOALS),)
MAKECMDGOALS := build
else
# We can't pass autogen to toplevel.mk
MAKECMDGOALS := $(filter-out autogen,$(MAKECMDGOALS))
endif
.PHONY: autogen
autogen:
ifeq ($(INTERNAL_CLOBBER_ONLY),)
@$(MAKE) -s --no-print-directory -C $(TOP) \
-f build/linux/prepare_tree.mk \
LDM_PCI=$(LDM_PCI) \
LDM_PLATFORM=$(LDM_PLATFORM)
else
@:
endif
include ../config/help.mk
# This deletes built-in suffix rules. Otherwise the submake isn't run when
# saying e.g. "make thingy.a"
.SUFFIXES:
# Because we have a match-anything rule below, we'll run the main build when
# we're actually trying to remake various makefiles after they're read in.
# These rules try to prevent that
%.mk: ;
Makefile%: ;
Makefile: ;
.PHONY: build kbuild install
build kbuild install: autogen
@$(if $(MAKECMDGOALS),$(MAKE) $(MAKE_ETC) $(MAKECMDGOALS) $(eval MAKECMDGOALS :=),:)
%: autogen
@$(if $(MAKECMDGOALS),$(MAKE) $(MAKE_ETC) $(MAKECMDGOALS) $(eval MAKECMDGOALS :=),:)

View File

@@ -1,74 +0,0 @@
########################################################################### ###
#@File
#@Title Targets for printing config option help
#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
#@License Dual MIT/GPLv2
#
# The contents of this file are subject to the MIT license as set out below.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# Alternatively, the contents of this file may be used under the terms of
# the GNU General Public License Version 2 ("GPL") in which case the provisions
# of GPL are applicable instead of those above.
#
# If you wish to allow use of your version of this file only under the terms of
# GPL, and not to allow others to use your version of this file under the terms
# of the MIT license, indicate your decision by deleting the provisions above
# and replace them with the notice and other provisions required by GPL as set
# out in the file called "GPL-COPYING" included in this distribution. If you do
# not delete the provisions above, a recipient may use your version of this file
# under the terms of either the MIT license or GPL.
#
# This License is also included in this distribution in the file called
# "MIT-COPYING".
#
# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
### ###########################################################################
define newline
endef
empty :=
define abbrev-option-value
$(if $(word 6,$(1)),$(wordlist 1,5,$(1))...,$(1))
endef
define print-option-help
# Print the option name and value
$(info $(1) ($(if $($(1)),$(call abbrev-option-value,$($(1))),<unset>), default $(if $(INTERNAL_CONFIG_DEFAULT_FOR_$(1)),$(call abbrev-option-value,$(INTERNAL_CONFIG_DEFAULT_FOR_$(1))),<unset>))$(if $(INTERNAL_DESCRIPTION_FOR_$(1)),:,))
# Ensure the config help text ends with a newline
$(and $(INTERNAL_DESCRIPTION_FOR_$(1)),$(if $(filter %_,$(word $(words $(INTERNAL_DESCRIPTION_FOR_$(1))),$(INTERNAL_DESCRIPTION_FOR_$(1)))),,$(eval INTERNAL_DESCRIPTION_FOR_$(1) := $(INTERNAL_DESCRIPTION_FOR_$(1))_ )))
# Print the config help text
$(info $(empty) $(subst _ ,$(newline) ,$(INTERNAL_DESCRIPTION_FOR_$(1))))
endef
.PHONY: confighelp allconfighelp
# Show only the config options that have help text
confighelp:
@: $(foreach _o,$(sort $(ALL_TUNABLE_OPTIONS)),$(if $(INTERNAL_DESCRIPTION_FOR_$(_o)),$(call print-option-help,$(_o)),))
# Show all the config options
allconfighelp:
@: $(foreach _o,$(sort $(ALL_TUNABLE_OPTIONS)),$(call print-option-help,$(_o)))
ifneq ($(filter confighelp-%,$(MAKECMDGOALS)),)
confighelp-%:
@: $(if $(filter $*,$(ALL_TUNABLE_OPTIONS)),$(call print-option-help,$*),$(info $* is not a tunable config option))
endif

View File

@@ -1,100 +0,0 @@
########################################################################### ###
#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
#@License Dual MIT/GPLv2
#
# The contents of this file are subject to the MIT license as set out below.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# Alternatively, the contents of this file may be used under the terms of
# the GNU General Public License Version 2 ("GPL") in which case the provisions
# of GPL are applicable instead of those above.
#
# If you wish to allow use of your version of this file only under the terms of
# GPL, and not to allow others to use your version of this file under the terms
# of the MIT license, indicate your decision by deleting the provisions above
# and replace them with the notice and other provisions required by GPL as set
# out in the file called "GPL-COPYING" included in this distribution. If you do
# not delete the provisions above, a recipient may use your version of this file
# under the terms of either the MIT license or GPL.
#
# This License is also included in this distribution in the file called
# "MIT-COPYING".
#
# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
### ###########################################################################
$(if $(KERNELDIR),,$(error KERNELDIR must be set to obtain a version))
override KERNEL_VERSION := \
$(shell grep "^VERSION = " $(KERNELDIR)/Makefile | cut -f3 -d' ')
override KERNEL_PATCHLEVEL := \
$(shell grep "^PATCHLEVEL = " $(KERNELDIR)/Makefile | cut -f3 -d' ')
override KERNEL_SUBLEVEL := \
$(shell grep "^SUBLEVEL = " $(KERNELDIR)/Makefile | cut -f3 -d' ')
override KERNEL_EXTRAVERSION := \
$(shell grep "^EXTRAVERSION = " $(KERNELDIR)/Makefile | cut -f3 -d' ')
# Break the kernel version up into a space separated list
kernel_version_as_list := $(KERNEL_VERSION) \
$(KERNEL_PATCHLEVEL) \
$(KERNEL_SUBLEVEL) \
$(patsubst .%,%,$(KERNEL_EXTRAVERSION))
# The base ID doesn't have to be accurate; we only use it for
# feature checks which will not care about extraversion bits
#
override KERNEL_BASE_ID := \
$(KERNEL_VERSION).$(KERNEL_PATCHLEVEL).$(KERNEL_SUBLEVEL)
# Try to get the kernel ID from the kernel.release file.
#
KERNEL_ID ?= \
$(shell cat $(KERNELDIR)/include/config/kernel.release 2>/dev/null)
# If the kernel ID isn't set yet, try to set it from the UTS_RELEASE
# macro.
#
ifeq ($(strip $(KERNEL_ID)),)
KERNEL_ID := \
$(shell grep -h '\#define UTS_RELEASE' \
$(KERNELDIR)/include/linux/* | cut -f3 -d' ' | sed s/\"//g)
endif
ifeq ($(strip $(KERNEL_ID)),)
KERNEL_ID := \
$(KERNEL_VERSION).$(KERNEL_PATCHLEVEL).$(KERNEL_SUBLEVEL)$(KERNEL_EXTRAVERSION)
endif
# Return 1 if the kernel version is at least the value passed to the
# function, else return nothing.
# Examples
# $(call kernel-version-at-least,2,6,35)
# $(call kernel-version-at-least,2,6,35,7)
#
define kernel-version-at-least
$(shell set -- $(kernel_version_as_list) 0 0 0 0; \
Y=true; \
for D in $1 $2 $3 $4; \
do \
[ $$1 ] || break; \
[ $$1 -eq $$D ] && { shift; continue; };\
[ $$1 -lt $$D ] && Y=; \
break; \
done; \
echo $$Y)
endef

View File

@@ -1,157 +0,0 @@
########################################################################### ###
#@File
#@Title Set up configuration required by build-directory Makefiles
#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
#@License Dual MIT/GPLv2
#
# The contents of this file are subject to the MIT license as set out below.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# Alternatively, the contents of this file may be used under the terms of
# the GNU General Public License Version 2 ("GPL") in which case the provisions
# of GPL are applicable instead of those above.
#
# If you wish to allow use of your version of this file only under the terms of
# GPL, and not to allow others to use your version of this file under the terms
# of the MIT license, indicate your decision by deleting the provisions above
# and replace them with the notice and other provisions required by GPL as set
# out in the file called "GPL-COPYING" included in this distribution. If you do
# not delete the provisions above, a recipient may use your version of this file
# under the terms of either the MIT license or GPL.
#
# This License is also included in this distribution in the file called
# "MIT-COPYING".
#
# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
### ###########################################################################
# NOTE: Don't put anything in this file that isn't strictly required
# by the build-directory Makefiles. It should go in core.mk otherwise.
TOP := $(abspath ../../..)
# Some miscellaneous things to make comma substitutions easier.
apos := '#'
comma := ,
empty :=
space := $(empty) $(empty)
ifneq ($(words $(TOP)),1)
$(warning This source tree is located in a path which contains whitespace,)
$(warning which is not supported.)
$(warning )
$(warning $(space)The root is: $(TOP))
$(warning )
$(error Whitespace found in $$(TOP))
endif
$(call directory-must-exist,$(TOP))
ifneq ($(SUPPORT_NEUTRINO_PLATFORM),1)
CC_CHECK := ../tools/cc-check.sh
CHMOD := chmod
# GNU Make has builtin values for CC/CXX which we don't want to trust. This
# is because $(CROSS_COMPILE)$(CC) doesn't always expand to a cross compiler
# toolchain binary name (e.g. most toolchains have 'gcc' but not 'cc').
ifeq ($(origin CC),default)
_CC := $(CROSS_COMPILE)gcc
CC := gcc
else
_CLANG := $(shell $(CC_CHECK) --clang --cc $(CC))
ifeq ($(_CLANG),true)
_CC := $(CC) -target $(patsubst %-,%,$(CROSS_COMPILE))
else
_CC := $(CC)
endif
endif
ifeq ($(origin CXX),default)
_CXX := $(CROSS_COMPILE)g++
CXX := g++
else
_CLANGXX := $(shell $(CC_CHECK) --clang --cc $(CXX))
ifeq ($(_CLANGXX),true)
_CXX := $(CXX) -target $(patsubst %-,%,$(CROSS_COMPILE))
else
_CXX := $(CXX)
endif
endif
CC_SECONDARY ?= $(CC)
HOST_CC ?= gcc
# Work out if we are targeting ARM before we start tweaking _CC.
TARGETING_AARCH64 := $(shell \
$(_CC) -dM -E - </dev/null | grep -q __aarch64__ && echo 1)
TARGETING_ARM := $(shell \
$(_CC) -dM -E - </dev/null | grep __arm__ >/dev/null 2>&1 && echo 1)
TARGETING_MIPS := $(shell \
$(_CC) -dM -E - </dev/null | grep __mips__ >/dev/null 2>&1 && echo 1)
HOST_CC_IS_LINUX := $(shell \
$(HOST_CC) -dM -E - </dev/null | grep __linux__ >/dev/null 2>&1 && echo 1)
ifneq ($(strip $(KERNELDIR)),)
include ../config/kernel_version.mk
endif
# The user didn't set CROSS_COMPILE. There's probably nothing wrong
# with that, but we'll let them know anyway.
#
ifeq ($(origin CROSS_COMPILE), undefined)
$(warning CROSS_COMPILE is not set. Target components will be built with the host compiler)
endif
endif # !Neutrino
# The user is trying to set one of the old SUPPORT_ options on the
# command line or in the environment. This isn't supported any more
# and will often break the build. The user is generally only trying
# to remove a component from the list of targets to build, so we'll
# point them at the new way of doing this.
define sanity-check-support-option-origin
ifeq ($$(filter undefined file,$$(origin $(1))),)
$$(warning *** Setting $(1) via $$(origin $(1)) is deprecated)
$$(error If you are trying to disable a component, use e.g. EXCLUDED_APIS="opengles1 opengl")
endif
endef
$(foreach _o,SYS_CFLAGS SYS_CXXFLAGS SYS_INCLUDES SYS_EXE_LDFLAGS SYS_LIB_LDFLAGS,$(eval $(call sanity-check-support-option-origin,$(_o))))
# Check for words in EXCLUDED_APIS that aren't understood by the
# common/apis/*.mk files. This should be kept in sync with all the tests on
# EXCLUDED_APIS in those files
_excludable_apis := opencl opengl opengles1 opengles3 openrl unittests renderscript scripts composerhal servicestools hwperftools testchiptools rogue2d memtrackhal camerahal sensorhal
_excluded_apis := $(subst $(comma),$(space),$(EXCLUDED_APIS))
_unrecognised := $(strip $(filter-out $(_excludable_apis),$(_excluded_apis)))
ifneq ($(_unrecognised),)
$(warning *** Ignoring unrecognised entries in EXCLUDED_APIS: $(_unrecognised))
$(warning *** EXCLUDED_APIS was set via $(origin EXCLUDED_APIS) to: $(EXCLUDED_APIS))
$(warning *** Excludable APIs are: $(_excludable_apis))
endif
override EXCLUDED_APIS := $(filter $(_excludable_apis), $(_excluded_apis))
ifeq ($(SUPPORT_NEUTRINO_PLATFORM),1)
include ../common/neutrino/preconfig_neutrino.mk
endif

View File

@@ -1,262 +0,0 @@
########################################################################### ###
#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
#@License Dual MIT/GPLv2
#
# The contents of this file are subject to the MIT license as set out below.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# Alternatively, the contents of this file may be used under the terms of
# the GNU General Public License Version 2 ("GPL") in which case the provisions
# of GPL are applicable instead of those above.
#
# If you wish to allow use of your version of this file only under the terms of
# GPL, and not to allow others to use your version of this file under the terms
# of the MIT license, indicate your decision by deleting the provisions above
# and replace them with the notice and other provisions required by GPL as set
# out in the file called "GPL-COPYING" included in this distribution. If you do
# not delete the provisions above, a recipient may use your version of this file
# under the terms of either the MIT license or GPL.
#
# This License is also included in this distribution in the file called
# "MIT-COPYING".
#
# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
### ###########################################################################
define must-be-defined
$(if $(filter undefined,$(origin $(1))),$(error In makefile $(THIS_MAKEFILE): $$($(1)) must be defined),)
endef
define must-be-nonempty
$(if $(strip $($(1))),,$(error In makefile $(THIS_MAKEFILE): $$($(1)) must contain a value))
endef
define directory-must-exist
$(if $(wildcard $(abspath $(1)/)),,$(error Directory $(1) must exist))
endef
define one-word-only
$(if $(filter-out $(firstword $($(1))),$($(1))),$(error In makefile $(THIS_MAKEFILE): $$($(1)) must contain only one word),)
endef
define module-library
$(patsubst lib%.so,%,$(if $($(1)_target),$($(1)_target),$(1).so))
endef
# This is done to allow module type makefiles to use $(THIS_MAKEFILE)
define register-module
INTERNAL_MAKEFILE_FOR_MODULE_$(1) := $(THIS_MAKEFILE)
endef
define process-module-arch
MODULE_ARCH := $$(strip $(2))
include $$(MAKE_TOP)/moduledefs_common.mk
include $$(MAKE_TOP)/moduledefs/$$(MODULE_ARCH).mk
include $$(MAKE_TOP)/modules/$$(strip $$($$(THIS_MODULE)_type)).mk
.SECONDARY: $$(MODULE_INTERMEDIATES_DIR)
$$(MODULE_INTERMEDIATES_DIR):
$$(make-directory)
MODULE_CLEAN_TARGETS += $$(MODULE_INTERMEDIATES_DIR)
INTERNAL_TARGETS_FOR_$(1) += $$(MODULE_TARGETS)
INTERNAL_CLEAN_TARGETS_FOR_$(1) += $$(MODULE_CLEAN_TARGETS)
INTERNAL_CLOBBER_TARGETS_FOR_$(1) += $$(MODULE_CLEAN_TARGETS) $$(MODULE_CLOBBER_TARGETS) $$(MODULE_TARGETS)
endef
target_neutral_types := \
apk \
bison_parser \
bridge \
copy_files \
custom \
flex_lexer \
flexxx_lexer \
gen_dispatch \
rsc_scriptc \
image_header \
inline_shaders \
java_archive \
module_group \
pds_header \
rgxfw \
test_image \
usc_header \
rscbitcode_header \
yuv_test_image
doc_types := \
doc \
doxygen
define calculate-arch-list
# Work out the target platforms for this module
MODULE_ARCH_LIST := $(2)
ifeq ($$(MODULE_ARCH_LIST),)
ifneq ($$(filter $(1),$(doc_types)),)
MODULE_ARCH_LIST := doc
else
ifneq ($$(filter $(1),$(target_neutral_types)),)
MODULE_ARCH_LIST := target_neutral
else
ifneq ($$(filter $(1),kernel_module),)
MODULE_ARCH_LIST := $(TARGET_PRIMARY_ARCH)
else
MODULE_ARCH_LIST := $(TARGET_ALL_ARCH)
endif
endif
endif
endif
endef
define process-module
THIS_MODULE := $(1)
THIS_MAKEFILE := $(INTERNAL_MAKEFILE_FOR_MODULE_$(1))
INTERNAL_TARGETS_FOR_$(1) :=
INTERNAL_CLEAN_TARGETS_FOR_$(1) :=
INTERNAL_CLOBBER_TARGETS_FOR_$(1) :=
include $$(MAKE_TOP)/this_makefile.mk
$$(call must-be-nonempty,THIS_MAKEFILE)
$$(call must-be-nonempty,$(1)_type)
$$(eval $$(call calculate-arch-list,$$($(1)_type),$$($(1)_arch)))
INTERNAL_ARCH_LIST_FOR_$(1) := $$(MODULE_ARCH_LIST)
$$(foreach _m,$$(MODULE_ARCH_LIST),$$(eval $$(call process-module-arch,$(1),$$(_m))))
endef
# This can be used by module_type.mk files to indicate that they can't be
# built as host_module_type
define target-build-only
$(if $(filter true,$(MODULE_HOST_BUILD)),$(error In makefile $(THIS_MAKEFILE): Module $(THIS_MODULE) attempted to build a host $(1), which is not supported))
endef
define relative-to-top
$(patsubst $(TOP)/%,%,$(1))
endef
define cc-check
$(shell \
CC_CHECK=$(patsubst @%,%,$(CC_CHECK)) && \
$(patsubst @%,%,$(CHMOD)) +x $$CC_CHECK && \
$$CC_CHECK --cc "$(1)" --out "$(2)" $(3))
endef
define cc-is-clang
$(call cc-check,$(patsubst @%,%,$(CC)),$(OUT),--clang)
endef
define cc-option
$(call cc-check,$(patsubst @%,%,$(CC)),$(OUT),$(1))
endef
define cxx-option
$(call cc-check,$(patsubst @%,%,$(CXX)),$(OUT),$(1))
endef
define host-cc-option
$(call cc-check,$(patsubst @%,%,$(HOST_CC)),$(OUT),$(1))
endef
define host-cxx-option
$(call cc-check,$(patsubst @%,%,$(HOST_CXX)),$(OUT),$(1))
endef
define kernel-cc-option
$(call cc-check,$(KERNEL_CROSS_COMPILE)gcc,$(OUT),$(1))
endef
# Turn a particular warning on, or explicitly turn it off, depending on
# the value of W. The "-W" or "-Wno-" part of the warning need not be
# specified.
define cc-optional-warning
$(call cc-option,-W$(if $(W),,no-)$(patsubst -W%,%,$(patsubst -Wno-%,%,$(1))))
endef
define host-cc-optional-warning
$(call host-cc-option,-W$(if $(W),,no-)$(patsubst -W%,%,$(patsubst -Wno-%,%,$(1))))
endef
define kernel-cc-optional-warning
$(call kernel-cc-option,-W$(if $(W),,no-)$(patsubst -W%,%,$(patsubst -Wno-%,%,$(1))))
endef
define module-info-line
$(if $(filter modules,$(D)),$(info [$(THIS_MODULE)] <$(MODULE_ARCH)> $(1)),)
endef
# $(call if-exists,A,B) => A if A is a file which exists, otherwise B
define if-exists
$(if $(wildcard $(1)),$(1),$(2))
endef
#
# Joins a given list of strings together with the given separator.
#
# (1): the list of strings to join
# (2): the separator to use for joining
#
NOOP=
SPACE=$(NOOP) $(NOOP)
define list-join
$(subst $(SPACE),$(2),$(strip $(1)))
endef
#
# Check if a given path is absolute
#
# $(1): path to check
# $(2): return when true
# $(3): return when false
#
define if-abs-path
$(if $(filter /%,$(1)),$(2),$(3))
endef
#
# Add a prefix to every path in a list, when the path isn't absolute.
#
# $(1): prefix to add
# $(2): list of paths
#
define addprefix-ifnot-abs
$(foreach _path,$(2),$(call if-abs-path,$(_path),$(_path),$(1)$(_path)))
endef
#
# Return the directory part of a path normalized (without trailing slashes)
#
# $(1): Path to normalize
#
define normalized-dir
$(if $(filter /,$(dir $(1))),$(dir $(1)),$(if $(findstring /,$(dir $(1))),$(patsubst %/,%,$(dir $(1))),$(dir $(1))))
endef
# Definitions to handle the various suffixes allowed for C++ files.
INTERNAL_CXX_SUFFIXES := .cc .cxx .cpp .c++
define filter-cxx-files
$(filter $(addprefix %,$(INTERNAL_CXX_SUFFIXES)),$(1))
endef
define filter-out-cxx-files
$(filter-out $(addprefix %,$(INTERNAL_CXX_SUFFIXES)),$(1))
endef
define objects-from-cxx-files
$(foreach _suffix,$(INTERNAL_CXX_SUFFIXES),$(patsubst %$(_suffix),%.o,$(filter %$(_suffix),$(1))))
endef
define unsupported-module-var
$(if $(strip $($(THIS_MODULE)_$(1))),$(error In makefile $(THIS_MAKEFILE): Setting '$(THIS_MODULE)_$(1)' has no effect, because $(THIS_MODULE) has type $($(THIS_MODULE)_type)))
endef

View File

@@ -1,122 +0,0 @@
########################################################################### ###
#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
#@License Dual MIT/GPLv2
#
# The contents of this file are subject to the MIT license as set out below.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# Alternatively, the contents of this file may be used under the terms of
# the GNU General Public License Version 2 ("GPL") in which case the provisions
# of GPL are applicable instead of those above.
#
# If you wish to allow use of your version of this file only under the terms of
# GPL, and not to allow others to use your version of this file under the terms
# of the MIT license, indicate your decision by deleting the provisions above
# and replace them with the notice and other provisions required by GPL as set
# out in the file called "GPL-COPYING" included in this distribution. If you do
# not delete the provisions above, a recipient may use your version of this file
# under the terms of either the MIT license or GPL.
#
# This License is also included in this distribution in the file called
# "MIT-COPYING".
#
# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
### ###########################################################################
include ../config/preconfig.mk
# If a TARGET_PRODUCT is specified but not a TARGET_DEVICE, try to
# derive the TARGET_DEVICE from TARGET_PRODUCT.
#
ifeq ($(TARGET_DEVICE),)
override TARGET_DEVICE := \
$(patsubst mini_%,%,$(patsubst full_%,%,$(TARGET_PRODUCT)))
ifeq ($(TARGET_DEVICE),arm64_img)
override TARGET_DEVICE := arm64
endif
ifeq ($(TARGET_DEVICE),armv7a_neon_img)
override TARGET_DEVICE := armv7-a-neon
endif
endif
ifeq ($(TARGET_DEVICE),)
# Prefer arm64 now for MULTIARCH=1 builds.
# Use TARGET_DEVICE=armv7-a-neon for 32-bit only builds.
override TARGET_DEVICE := arm64
endif
ifeq ($(TARGET_DEVICE),armv7-a-neon)
# The 32-bit only Android build is still using separate toolchains for
# kernel and userspace, force this on the DDK side when it's detected.
KERNEL_CROSS_COMPILE ?= arm-eabi-
endif
ifeq ($(MULTIARCH),1)
override TARGET_DEVICE := rk3368
else
override TARGET_DEVICE := rk3368_32
endif
HAL_VARIANT ?= rk3368
PVR_SYSTEM := rk3368
NO_HARDWARE := 0
LDM_PLATFORM := 1
#RGX_BVNC ?= 1.75.2.30
#rockchip G6110
RGX_BVNC ?= 5.9.1.46
include ../common/android/paths.mk
include ../common/android/arch.mk
include ../common/android/features.mk
ifeq ($(SUPPORT_ADF),1)
ifneq ($(is_at_least_lollipop),1)
SYS_INCLUDES += \
-isystem $(ANDROID_ROOT)/device/img/generic/adf/libadf/include \
-isystem $(ANDROID_ROOT)/device/img/generic/adf/libadfhwc/include
endif
endif
PVR_LDM_PLATFORM_PRE_REGISTERED := 1
#zxl: build adf_fbdev.ko
ifeq ($(SUPPORT_ADF),1)
ADF_FBDEV ?= adf_fbdev
KERNEL_COMPONENTS += $(ADF_FBDEV)
endif
ifneq ($(SUPPORT_ADF),1)
ifeq ($(SUPPORT_DC),1)
DISPLAY_CONTROLLER ?= dc_fbdev
KERNEL_COMPONENTS += $(DISPLAY_CONTROLLER)
ifeq ($(DISPLAY_CONTROLLER),dc_example)
DC_EXAMPLE_WIDTH ?= 640
DC_EXAMPLE_HEIGHT ?= 480
DC_EXAMPLE_BIT_DEPTH ?= 32
DC_EXAMPLE_DPI ?= 160
endif
endif
endif
#zxl: 3 fb buffer
DC_FBDEV_NUM_PREFERRED_BUFFERS := 3
CACHEFLUSH_TYPE ?= CACHEFLUSH_GENERIC
include ../config/core.mk
include ../common/3rdparty.mk
include ../common/android/extra_config.mk

View File

@@ -1,95 +0,0 @@
########################################################################### ###
#@Title Root kernel makefile
#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
#@License Dual MIT/GPLv2
#
# The contents of this file are subject to the MIT license as set out below.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# Alternatively, the contents of this file may be used under the terms of
# the GNU General Public License Version 2 ("GPL") in which case the provisions
# of GPL are applicable instead of those above.
#
# If you wish to allow use of your version of this file only under the terms of
# GPL, and not to allow others to use your version of this file under the terms
# of the MIT license, indicate your decision by deleting the provisions above
# and replace them with the notice and other provisions required by GPL as set
# out in the file called "GPL-COPYING" included in this distribution. If you do
# not delete the provisions above, a recipient may use your version of this file
# under the terms of either the MIT license or GPL.
#
# This License is also included in this distribution in the file called
# "MIT-COPYING".
#
# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
### ###########################################################################
# This top-level kbuild makefile builds all the Linux kernel modules in the
# DDK. To run kbuild, this makefile is copied to $(TARGET_PRIMARY_OUT)/kbuild/Makefile
# and make is invoked in $(TARGET_PRIMARY_OUT)/kbuild.
# This makefile doesn't define any kbuild special variables apart from
# ccflags-y and obj-m. The variables for objects are picked up by including
# the kbuild makefile fragments named in $(INTERNAL_KBUILD_MAKEFILES). The
# list of objects that these fragments make is collected in
# $(INTERNAL_KBUILD_OBJECTS) and $(INTERNAL_EXTRA_KBUILD_OBJECTS). These
# variables are set according to the build's $(KERNEL_COMPONENTS) and
# $(EXTRA_PVRSRVKM_COMPONENTS). To add a new kernel module to the build, edit
# these variables in the per-build Makefile.
include $(OUT)/config_kernel.mk
.SECONDARY:
define symlink-source-file
@if [ ! -e $(dir $@) ]; then mkdir -p $(dir $@); fi
@if [ ! -h $@ ]; then ln -sf $< $@; fi
endef
bridge_base := $(BRIDGE_SOURCE_ROOT)
$(OUT)/$(TARGET_PRIMARY_ARCH)/kbuild/%.c: $(TOP)/%.c
$(symlink-source-file)
$(OUT)/$(TARGET_PRIMARY_ARCH)/kbuild/generated/%.c: $(bridge_base)/%.c
$(symlink-source-file)
$(OUT)/$(TARGET_PRIMARY_ARCH)/kbuild/external/%.c: $(srctree)/%.c
$(symlink-source-file)
ccflags-y += -D__linux__ -include $(OUT)/config_kernel.h \
-I$(OUT)/include \
-I$(TOP)/include \
-I$(TOP)/hwdefs/km \
-I$(TOP)/services/include \
-I$(TOP)/services/include/shared \
-I$(TOP)/services/shared/include \
-I$(TOP)/services/shared/common \
-I$(TOP)/services/system/$(PVR_SYSTEM) \
-I$(TOP)/services/system/include \
-I$(TOP)/services/server/common \
-I$(TOP)/services/server/devices/rgx \
-I$(TOP)/services/server/env/linux \
-I$(TOP)/services/server/include
include $(INTERNAL_KBUILD_MAKEFILES)
$(if $(pvrsrvkm-y),,$(error pvrsrvkm-y was empty, which could mean that srvkm is missing from $$(KERNEL_COMPONENTS)))
pvrsrvkm-y += $(foreach _m,$(INTERNAL_EXTRA_KBUILD_OBJECTS:.o=),$($(_m)-y))
obj-m += $(INTERNAL_KBUILD_OBJECTS)

View File

@@ -1,94 +0,0 @@
########################################################################### ###
#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
#@License Dual MIT/GPLv2
#
# The contents of this file are subject to the MIT license as set out below.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# Alternatively, the contents of this file may be used under the terms of
# the GNU General Public License Version 2 ("GPL") in which case the provisions
# of GPL are applicable instead of those above.
#
# If you wish to allow use of your version of this file only under the terms of
# GPL, and not to allow others to use your version of this file under the terms
# of the MIT license, indicate your decision by deleting the provisions above
# and replace them with the notice and other provisions required by GPL as set
# out in the file called "GPL-COPYING" included in this distribution. If you do
# not delete the provisions above, a recipient may use your version of this file
# under the terms of either the MIT license or GPL.
#
# This License is also included in this distribution in the file called
# "MIT-COPYING".
#
# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
### ###########################################################################
$(TARGET_PRIMARY_OUT)/kbuild/Makefile: $(MAKE_TOP)/kbuild/Makefile.template
@[ ! -e $(dir $@) ] && mkdir -p $(dir $@) || true
$(CP) -f $< $@
# We need to make INTERNAL_KBUILD_MAKEFILES absolute because the files will be
# read while chdir'd into $(KERNELDIR)
INTERNAL_KBUILD_MAKEFILES := $(abspath $(foreach _m,$(KERNEL_COMPONENTS) $(EXTRA_PVRSRVKM_COMPONENTS),$(if $(INTERNAL_KBUILD_MAKEFILE_FOR_$(_m)),$(INTERNAL_KBUILD_MAKEFILE_FOR_$(_m)),$(error Unknown kbuild module "$(_m)"))))
INTERNAL_KBUILD_OBJECTS := $(foreach _m,$(KERNEL_COMPONENTS),$(if $(INTERNAL_KBUILD_OBJECTS_FOR_$(_m)),$(INTERNAL_KBUILD_OBJECTS_FOR_$(_m)),$(error BUG: Unknown kbuild module "$(_m)" should have been caught earlier)))
INTERNAL_EXTRA_KBUILD_OBJECTS := $(foreach _m,$(EXTRA_PVRSRVKM_COMPONENTS),$(if $(INTERNAL_KBUILD_OBJECTS_FOR_$(_m)),$(INTERNAL_KBUILD_OBJECTS_FOR_$(_m)),$(error BUG: Unknown kbuild module "$(_m)" should have been caught earlier)))
.PHONY: kbuild kbuild_clean kbuild_check
kbuild_check:
@: $(if $(strip $(KERNELDIR)),,$(error KERNELDIR must be set))
@: $(call directory-must-exist,$(KERNELDIR))
@: $(foreach _m,$(ALL_KBUILD_MODULES),$(if $(wildcard $(abspath $(INTERNAL_KBUILD_MAKEFILE_FOR_$(_m)))),,$(error In makefile $(INTERNAL_MAKEFILE_FOR_MODULE_$(_m)): Module $(_m) requires kbuild makefile $(INTERNAL_KBUILD_MAKEFILE_FOR_$(_m)), which is missing)))
@: $(if $(filter-out command line override,$(origin build)),,$(error Overriding $$(build) (with "make build=...") will break kbuild))
# Services server headers are generated as part of running the bridge
# generator, which might be included in KM code. So as well as depending on
# the kbuild Makefile, we need to make kbuild also depend on each bridge
# module (including direct bridges), so that 'make kbuild' in a clean tree
# works.
kbuild: kbuild_check $(TARGET_PRIMARY_OUT)/kbuild/Makefile $(BRIDGES) $(DIRECT_BRIDGES)
$(if $(V),,@)$(MAKE) -Rr --no-print-directory -C $(KERNELDIR) \
M=$(abspath $(TARGET_PRIMARY_OUT)/kbuild) \
INTERNAL_KBUILD_MAKEFILES="$(INTERNAL_KBUILD_MAKEFILES)" \
INTERNAL_KBUILD_OBJECTS="$(INTERNAL_KBUILD_OBJECTS)" \
INTERNAL_EXTRA_KBUILD_OBJECTS="$(INTERNAL_EXTRA_KBUILD_OBJECTS)" \
BRIDGE_SOURCE_ROOT=$(abspath $(BRIDGE_SOURCE_ROOT)) \
TARGET_PRIMARY_ARCH=$(TARGET_PRIMARY_ARCH) \
CROSS_COMPILE="$(CCACHE) $(KERNEL_CROSS_COMPILE)" \
EXTRA_CFLAGS="$(ALL_KBUILD_CFLAGS)" \
CC=$(KERNEL_CROSS_COMPILE)gcc V=$(V) W=$(W) \
CHECK="$(patsubst @%,%,$(CHECK))" $(if $(CHECK),C=1,) \
TOP=$(TOP)
@for kernel_module in $(addprefix $(TARGET_PRIMARY_OUT)/kbuild/,$(INTERNAL_KBUILD_OBJECTS:.o=.ko)); do \
cp $$kernel_module $(TARGET_PRIMARY_OUT); \
done
kbuild_clean: kbuild_check $(TARGET_PRIMARY_OUT)/kbuild/Makefile
$(if $(V),,@)$(MAKE) -Rr --no-print-directory -C $(KERNELDIR) \
M=$(abspath $(TARGET_PRIMARY_OUT)/kbuild) \
INTERNAL_KBUILD_MAKEFILES="$(INTERNAL_KBUILD_MAKEFILES)" \
INTERNAL_KBUILD_OBJECTS="$(INTERNAL_KBUILD_OBJECTS)" \
INTERNAL_EXTRA_KBUILD_OBJECTS="$(INTERNAL_EXTRA_KBUILD_OBJECTS)" \
BRIDGE_SOURCE_ROOT=$(abspath $(BRIDGE_SOURCE_ROOT)) \
TARGET_PRIMARY_ARCH=$(TARGET_PRIMARY_ARCH) \
CROSS_COMPILE="$(CCACHE) $(KERNEL_CROSS_COMPILE)" \
EXTRA_CFLAGS="$(ALL_KBUILD_CFLAGS)" \
CC=$(KERNEL_CROSS_COMPILE)gcc V=$(V) W=$(W) \
TOP=$(TOP) clean
kbuild_install: install
kbuild: install_script_km

View File

@@ -1,62 +0,0 @@
########################################################################### ###
#@File
#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
#@License Dual MIT/GPLv2
#
# The contents of this file are subject to the MIT license as set out below.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# Alternatively, the contents of this file may be used under the terms of
# the GNU General Public License Version 2 ("GPL") in which case the provisions
# of GPL are applicable instead of those above.
#
# If you wish to allow use of your version of this file only under the terms of
# GPL, and not to allow others to use your version of this file under the terms
# of the MIT license, indicate your decision by deleting the provisions above
# and replace them with the notice and other provisions required by GPL as set
# out in the file called "GPL-COPYING" included in this distribution. If you do
# not delete the provisions above, a recipient may use your version of this file
# under the terms of either the MIT license or GPL.
#
# This License is also included in this distribution in the file called
# "MIT-COPYING".
#
# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
### ###########################################################################
MODULE_HOST_BUILD := true
MODULE_CC := $(HOST_CC) $(HOST_FORCE_32BIT)
MODULE_CXX := $(HOST_CXX) $(HOST_FORCE_32BIT)
MODULE_CFLAGS := $(ALL_HOST_CFLAGS) $($(THIS_MODULE)_cflags) $(HOST_FORCE_32BIT)
MODULE_CXXFLAGS := $(ALL_HOST_CXXFLAGS) $($(THIS_MODULE)_cxxflags) $(HOST_FORCE_32BIT)
MODULE_LDFLAGS := $(ALL_HOST_LDFLAGS) -L$(MODULE_OUT) $($(THIS_MODULE)_ldflags) $(HOST_FORCE_32BIT)
ifneq ($(BUILD),debug)
ifeq ($(USE_LTO),1)
MODULE_LDFLAGS := \
$(sort $(filter-out -W% -D%,$(ALL_HOST_CFLAGS) $(ALL_HOST_CXXFLAGS))) \
$(MODULE_LDFLAGS)
endif
endif
ifeq ($(SUPPORT_NEUTRINO_PLATFORM),1)
include $(MAKE_TOP)/common/neutrino/extra_host.mk
else
endif

View File

@@ -1,62 +0,0 @@
########################################################################### ###
#@File
#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
#@License Dual MIT/GPLv2
#
# The contents of this file are subject to the MIT license as set out below.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# Alternatively, the contents of this file may be used under the terms of
# the GNU General Public License Version 2 ("GPL") in which case the provisions
# of GPL are applicable instead of those above.
#
# If you wish to allow use of your version of this file only under the terms of
# GPL, and not to allow others to use your version of this file under the terms
# of the MIT license, indicate your decision by deleting the provisions above
# and replace them with the notice and other provisions required by GPL as set
# out in the file called "GPL-COPYING" included in this distribution. If you do
# not delete the provisions above, a recipient may use your version of this file
# under the terms of either the MIT license or GPL.
#
# This License is also included in this distribution in the file called
# "MIT-COPYING".
#
# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
### ###########################################################################
MODULE_HOST_BUILD := true
MODULE_CC := $(HOST_CC)
MODULE_CXX := $(HOST_CXX)
MODULE_CFLAGS := $(ALL_HOST_CFLAGS) $($(THIS_MODULE)_cflags)
MODULE_CXXFLAGS := $(ALL_HOST_CXXFLAGS) $($(THIS_MODULE)_cxxflags)
MODULE_LDFLAGS := $(ALL_HOST_LDFLAGS) -L$(MODULE_OUT) $($(THIS_MODULE)_ldflags)
ifneq ($(BUILD),debug)
ifeq ($(USE_LTO),1)
MODULE_LDFLAGS := \
$(sort $(filter-out -W% -D%,$(ALL_HOST_CFLAGS) $(ALL_HOST_CXXFLAGS))) \
$(MODULE_LDFLAGS)
endif
endif
ifeq ($(SUPPORT_NEUTRINO_PLATFORM),1)
include $(MAKE_TOP)/common/neutrino/extra_host.mk
else
endif

View File

@@ -1,98 +0,0 @@
########################################################################### ###
#@File
#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
#@License Dual MIT/GPLv2
#
# The contents of this file are subject to the MIT license as set out below.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# Alternatively, the contents of this file may be used under the terms of
# the GNU General Public License Version 2 ("GPL") in which case the provisions
# of GPL are applicable instead of those above.
#
# If you wish to allow use of your version of this file only under the terms of
# GPL, and not to allow others to use your version of this file under the terms
# of the MIT license, indicate your decision by deleting the provisions above
# and replace them with the notice and other provisions required by GPL as set
# out in the file called "GPL-COPYING" included in this distribution. If you do
# not delete the provisions above, a recipient may use your version of this file
# under the terms of either the MIT license or GPL.
#
# This License is also included in this distribution in the file called
# "MIT-COPYING".
#
# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
### ###########################################################################
MODULE_CC := $(CC)
MODULE_CXX := $(CXX)
MODULE_CFLAGS := $(ALL_CFLAGS) $($(THIS_MODULE)_cflags)
MODULE_CXXFLAGS := $(ALL_CXXFLAGS) $($(THIS_MODULE)_cxxflags)
MODULE_LDFLAGS := $(ALL_LDFLAGS) $($(THIS_MODULE)_ldflags) -L$(MODULE_OUT) -Xlinker -rpath-link=$(MODULE_OUT)
# Since this is a target module, add system-specific include flags.
MODULE_INCLUDE_FLAGS := $(SYS_INCLUDES) $(MODULE_INCLUDE_FLAGS)
ifneq ($(SUPPORT_ANDROID_PLATFORM),)
_obj := $(TARGET_ROOT)/product/$(TARGET_DEVICE)/obj
# Linker flags used to find system libraries.
MODULE_SYSTEM_LIBRARY_DIR_FLAGS += \
-L$(_obj)/lib \
-Xlinker -rpath-link=$(_obj)/lib \
-L$(TARGET_ROOT)/product/$(TARGET_DEVICE)/system/lib64 \
-Xlinker -rpath-link=$(TARGET_ROOT)/product/$(TARGET_DEVICE)/system/lib64
# Add architecture-specific Android include flags
MODULE_INCLUDE_FLAGS := \
-isystem $(ANDROID_ROOT)/bionic/libc/arch-arm64/include \
-isystem $(ANDROID_ROOT)/bionic/libc/kernel/uapi/asm-arm64 \
-isystem $(ANDROID_ROOT)/bionic/libm/include/arm64 \
$(MODULE_INCLUDE_FLAGS)
MODULE_LDFLAGS += $(MODULE_SYSTEM_LIBRARY_DIR_FLAGS)
MODULE_EXE_LDFLAGS := \
-Bdynamic -nostdlib -Wl,-dynamic-linker,/system/bin/linker64 \
-lc -ldl -lcutils
MODULE_LIB_LDFLAGS := $(MODULE_EXE_LDFLAGS)
MODULE_EXE_CRTBEGIN := $(_obj)/lib/crtbegin_dynamic.o
MODULE_EXE_CRTEND := $(_obj)/lib/crtend_android.o
MODULE_LIB_CRTBEGIN := $(_obj)/lib/crtbegin_so.o
MODULE_LIB_CRTEND := $(_obj)/lib/crtend_so.o
MODULE_LIBGCC := $(LIBGCC)
endif
ifneq ($(BUILD),debug)
ifeq ($(USE_LTO),1)
MODULE_LDFLAGS := \
$(sort $(filter-out -W% -D%,$(ALL_CFLAGS) $(ALL_CXXFLAGS))) \
$(MODULE_LDFLAGS)
endif
endif
MODULE_ARCH_BITNESS := 64
# Neutrino qcc requires "-Wc," prefix for compiler flags
ifeq ($(SUPPORT_NEUTRINO_PLATFORM),1)
include $(MAKE_TOP)/common/neutrino/modify_moduledefs.mk
endif

View File

@@ -1,103 +0,0 @@
########################################################################### ###
#@File
#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
#@License Dual MIT/GPLv2
#
# The contents of this file are subject to the MIT license as set out below.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# Alternatively, the contents of this file may be used under the terms of
# the GNU General Public License Version 2 ("GPL") in which case the provisions
# of GPL are applicable instead of those above.
#
# If you wish to allow use of your version of this file only under the terms of
# GPL, and not to allow others to use your version of this file under the terms
# of the MIT license, indicate your decision by deleting the provisions above
# and replace them with the notice and other provisions required by GPL as set
# out in the file called "GPL-COPYING" included in this distribution. If you do
# not delete the provisions above, a recipient may use your version of this file
# under the terms of either the MIT license or GPL.
#
# This License is also included in this distribution in the file called
# "MIT-COPYING".
#
# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
### ###########################################################################
MODULE_CC := $(CC_SECONDARY) -march=armv7-a -mfloat-abi=softfp
MODULE_CXX := $(CXX_SECONDARY) -march=armv7-a -mfloat-abi=softfp
ifneq ($(BUILD),debug)
MODULE_CC := $(MODULE_CC) -mthumb
MODULE_CXX := $(MODULE_CXX) -mthumb
endif
MODULE_CFLAGS := $(ALL_CFLAGS) $($(THIS_MODULE)_cflags)
MODULE_CXXFLAGS := $(ALL_CXXFLAGS) $($(THIS_MODULE)_cxxflags)
MODULE_LDFLAGS := $(ALL_LDFLAGS) $($(THIS_MODULE)_ldflags) -L$(MODULE_OUT) -Xlinker -rpath-link=$(MODULE_OUT)
# Since this is a target module, add system-specific include flags.
MODULE_INCLUDE_FLAGS := $(SYS_INCLUDES) $(MODULE_INCLUDE_FLAGS)
ifneq ($(SUPPORT_ANDROID_PLATFORM),)
_obj := $(TARGET_ROOT)/product/$(TARGET_DEVICE)/obj$(if $(MULTIARCH),_arm,)
# Linker flags used to find system libraries.
MODULE_SYSTEM_LIBRARY_DIR_FLAGS += \
-L$(_obj)/lib \
-Xlinker -rpath-link=$(_obj)/lib \
-L$(TARGET_ROOT)/product/$(TARGET_DEVICE)/system/lib \
-Xlinker -rpath-link=$(TARGET_ROOT)/product/$(TARGET_DEVICE)/system/lib
# Add architecture-specific Android include flags
MODULE_INCLUDE_FLAGS := \
-isystem $(ANDROID_ROOT)/bionic/libc/arch-arm/include \
-isystem $(ANDROID_ROOT)/bionic/libc/kernel/uapi/asm-arm \
-isystem $(ANDROID_ROOT)/bionic/libm/include/arm \
$(MODULE_INCLUDE_FLAGS)
MODULE_LDFLAGS += $(MODULE_SYSTEM_LIBRARY_DIR_FLAGS)
MODULE_EXE_LDFLAGS := \
-Bdynamic -nostdlib -Wl,-dynamic-linker,/system/bin/linker \
-lc -ldl -lcutils
MODULE_LIB_LDFLAGS := $(MODULE_EXE_LDFLAGS)
MODULE_EXE_CRTBEGIN := $(_obj)/lib/crtbegin_dynamic.o
MODULE_EXE_CRTEND := $(_obj)/lib/crtend_android.o
MODULE_LIB_CRTBEGIN := $(_obj)/lib/crtbegin_so.o
MODULE_LIB_CRTEND := $(_obj)/lib/crtend_so.o
MODULE_LIBGCC := $(LIBGCC_SECONDARY)
endif
ifneq ($(BUILD),debug)
ifeq ($(USE_LTO),1)
MODULE_LDFLAGS := \
$(sort $(filter-out -W% -D%,$(ALL_CFLAGS) $(ALL_CXXFLAGS))) \
$(MODULE_LDFLAGS)
endif
endif
MODULE_ARCH_BITNESS := 32
# Neutrino qcc requires "-Wc," prefix for compiler flags
ifeq ($(SUPPORT_NEUTRINO_PLATFORM),1)
include $(MAKE_TOP)/common/neutrino/modify_moduledefs.mk
endif

View File

@@ -1,102 +0,0 @@
########################################################################### ###
#@File
#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
#@License Dual MIT/GPLv2
#
# The contents of this file are subject to the MIT license as set out below.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# Alternatively, the contents of this file may be used under the terms of
# the GNU General Public License Version 2 ("GPL") in which case the provisions
# of GPL are applicable instead of those above.
#
# If you wish to allow use of your version of this file only under the terms of
# GPL, and not to allow others to use your version of this file under the terms
# of the MIT license, indicate your decision by deleting the provisions above
# and replace them with the notice and other provisions required by GPL as set
# out in the file called "GPL-COPYING" included in this distribution. If you do
# not delete the provisions above, a recipient may use your version of this file
# under the terms of either the MIT license or GPL.
#
# This License is also included in this distribution in the file called
# "MIT-COPYING".
#
# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
### ###########################################################################
MODULE_CC := $(CC_SECONDARY) $(TARGET_FORCE_32BIT) -march=i686
MODULE_CXX := $(CXX_SECONDARY) $(TARGET_FORCE_32BIT) -march=i686
MODULE_CFLAGS := $(ALL_CFLAGS) $($(THIS_MODULE)_cflags) $(TARGET_FORCE_32BIT) -march=i686
MODULE_CXXFLAGS := $(ALL_CXXFLAGS) $($(THIS_MODULE)_cxxflags) $(TARGET_FORCE_32BIT) -march=i686
MODULE_LDFLAGS := $(ALL_LDFLAGS) $($(THIS_MODULE)_ldflags) -L$(MODULE_OUT) -Xlinker -rpath-link=$(MODULE_OUT) $(TARGET_FORCE_32BIT)
# Since this is a target module, add system-specific include flags.
MODULE_INCLUDE_FLAGS := $(SYS_INCLUDES) $(MODULE_INCLUDE_FLAGS)
ifneq ($(SUPPORT_ANDROID_PLATFORM),)
_obj := $(TARGET_ROOT)/product/$(TARGET_DEVICE)/obj$(if $(MULTIARCH),_x86,)
# Linker flags used to find system libraries.
MODULE_SYSTEM_LIBRARY_DIR_FLAGS += \
-L$(_obj)/lib \
-Xlinker -rpath-link=$(_obj)/lib \
-L$(TARGET_ROOT)/product/$(TARGET_DEVICE)/system/lib \
-Xlinker -rpath-link=$(TARGET_ROOT)/product/$(TARGET_DEVICE)/system/lib
# Add architecture-specific Android include flags
MODULE_INCLUDE_FLAGS := \
-isystem $(ANDROID_ROOT)/bionic/libc/arch-x86/include \
-isystem $(ANDROID_ROOT)/bionic/libc/kernel/uapi/asm-x86 \
-isystem $(ANDROID_ROOT)/bionic/libm/include/i387 \
$(MODULE_INCLUDE_FLAGS)
MODULE_LDFLAGS += $(MODULE_SYSTEM_LIBRARY_DIR_FLAGS)
MODULE_EXE_LDFLAGS := \
-Bdynamic -nostdlib -Wl,-dynamic-linker,/system/bin/linker \
-lc -ldl -lcutils
MODULE_LIB_LDFLAGS := $(MODULE_EXE_LDFLAGS)
MODULE_EXE_CRTBEGIN := $(_obj)/lib/crtbegin_dynamic.o
MODULE_EXE_CRTEND := $(_obj)/lib/crtend_android.o
MODULE_LIB_CRTBEGIN := $(_obj)/lib/crtbegin_so.o
MODULE_LIB_CRTEND := $(_obj)/lib/crtend_so.o
MODULE_LIBGCC := $(LIBGCC_SECONDARY)
else
# On Linux, we currently don't need to specify any flags to find the system
# libraries.
MODULE_SYSTEM_LIBRARY_DIR_FLAGS :=
endif
ifneq ($(BUILD),debug)
ifeq ($(USE_LTO),1)
MODULE_LDFLAGS := \
$(sort $(filter-out -W% -D%,$(ALL_CFLAGS) $(ALL_CXXFLAGS))) \
$(MODULE_LDFLAGS)
endif
endif
MODULE_ARCH_BITNESS := 32
# Neutrino qcc requires "-Wc," prefix for compiler flags
ifeq ($(SUPPORT_NEUTRINO_PLATFORM),1)
include $(MAKE_TOP)/common/neutrino/modify_moduledefs.mk
endif

View File

@@ -1,44 +0,0 @@
########################################################################### ###
#@File
#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
#@License Dual MIT/GPLv2
#
# The contents of this file are subject to the MIT license as set out below.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# Alternatively, the contents of this file may be used under the terms of
# the GNU General Public License Version 2 ("GPL") in which case the provisions
# of GPL are applicable instead of those above.
#
# If you wish to allow use of your version of this file only under the terms of
# GPL, and not to allow others to use your version of this file under the terms
# of the MIT license, indicate your decision by deleting the provisions above
# and replace them with the notice and other provisions required by GPL as set
# out in the file called "GPL-COPYING" included in this distribution. If you do
# not delete the provisions above, a recipient may use your version of this file
# under the terms of either the MIT license or GPL.
#
# This License is also included in this distribution in the file called
# "MIT-COPYING".
#
# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
### ###########################################################################
MODULE_BISON_FLAGS := $(ALL_BISON_FLAGS) $($(THIS_MODULE)_bisonflags)
MODULE_FLEX_FLAGS := $(ALL_FLEX_FLAGS) $($(THIS_MODULE)_flexflags)
MODULE_FLEXXX_FLAGS := $(ALL_FLEXXX_FLAGS) $($(THIS_MODULE)_flexxxflags)

View File

@@ -1,100 +0,0 @@
########################################################################### ###
#@File
#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
#@License Dual MIT/GPLv2
#
# The contents of this file are subject to the MIT license as set out below.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# Alternatively, the contents of this file may be used under the terms of
# the GNU General Public License Version 2 ("GPL") in which case the provisions
# of GPL are applicable instead of those above.
#
# If you wish to allow use of your version of this file only under the terms of
# GPL, and not to allow others to use your version of this file under the terms
# of the MIT license, indicate your decision by deleting the provisions above
# and replace them with the notice and other provisions required by GPL as set
# out in the file called "GPL-COPYING" included in this distribution. If you do
# not delete the provisions above, a recipient may use your version of this file
# under the terms of either the MIT license or GPL.
#
# This License is also included in this distribution in the file called
# "MIT-COPYING".
#
# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
### ###########################################################################
MODULE_CC := $(CC) -march=x86-64
MODULE_CXX := $(CXX) -march=x86-64
MODULE_CFLAGS := $(ALL_CFLAGS) $($(THIS_MODULE)_cflags) -march=x86-64
MODULE_CXXFLAGS := $(ALL_CXXFLAGS) $($(THIS_MODULE)_cxxflags) -march=x86-64
MODULE_LDFLAGS := $(ALL_LDFLAGS) $($(THIS_MODULE)_ldflags) -L$(MODULE_OUT) -Xlinker -rpath-link=$(MODULE_OUT)
# Since this is a target module, add system-specific include flags.
MODULE_INCLUDE_FLAGS := $(SYS_INCLUDES) $(MODULE_INCLUDE_FLAGS)
ifneq ($(SUPPORT_ANDROID_PLATFORM),)
# Linker flags used to find system libraries.
MODULE_SYSTEM_LIBRARY_DIR_FLAGS += \
-L$(TARGET_ROOT)/product/$(TARGET_DEVICE)/obj/lib \
-Xlinker -rpath-link=$(TARGET_ROOT)/product/$(TARGET_DEVICE)/obj/lib \
-L$(TARGET_ROOT)/product/$(TARGET_DEVICE)/system/lib64 \
-Xlinker -rpath-link=$(TARGET_ROOT)/product/$(TARGET_DEVICE)/system/lib64
# Add architecture-specific Android include flags
MODULE_INCLUDE_FLAGS := \
-isystem $(ANDROID_ROOT)/bionic/libc/arch-x86_64/include \
-isystem $(ANDROID_ROOT)/bionic/libc/kernel/uapi/asm-x86 \
-isystem $(ANDROID_ROOT)/bionic/libm/include/amd64 \
$(MODULE_INCLUDE_FLAGS)
MODULE_LDFLAGS += $(MODULE_SYSTEM_LIBRARY_DIR_FLAGS)
MODULE_EXE_LDFLAGS := \
-Bdynamic -nostdlib -Wl,-dynamic-linker,/system/bin/linker64 \
-lc -ldl -lcutils
MODULE_LIB_LDFLAGS := $(MODULE_EXE_LDFLAGS)
MODULE_EXE_CRTBEGIN := $(TARGET_ROOT)/product/$(TARGET_DEVICE)/obj/lib/crtbegin_dynamic.o
MODULE_EXE_CRTEND := $(TARGET_ROOT)/product/$(TARGET_DEVICE)/obj/lib/crtend_android.o
MODULE_LIB_CRTBEGIN := $(TARGET_ROOT)/product/$(TARGET_DEVICE)/obj/lib/crtbegin_so.o
MODULE_LIB_CRTEND := $(TARGET_ROOT)/product/$(TARGET_DEVICE)/obj/lib/crtend_so.o
MODULE_LIBGCC := $(LIBGCC)
else
# On Linux, we currently don't need to specify any flags to find the system
# libraries.
MODULE_SYSTEM_LIBRARY_DIR_FLAGS :=
endif
ifneq ($(BUILD),debug)
ifeq ($(USE_LTO),1)
MODULE_LDFLAGS := \
$(sort $(filter-out -W% -D%,$(ALL_CFLAGS) $(ALL_CXXFLAGS))) \
$(MODULE_LDFLAGS)
endif
endif
MODULE_ARCH_BITNESS := 64
# Neutrino qcc requires "-Wc," prefix for compiler flags
ifeq ($(SUPPORT_NEUTRINO_PLATFORM),1)
include $(MAKE_TOP)/common/neutrino/modify_moduledefs.mk
endif

View File

@@ -1,146 +0,0 @@
########################################################################### ###
#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
#@License Dual MIT/GPLv2
#
# The contents of this file are subject to the MIT license as set out below.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# Alternatively, the contents of this file may be used under the terms of
# the GNU General Public License Version 2 ("GPL") in which case the provisions
# of GPL are applicable instead of those above.
#
# If you wish to allow use of your version of this file only under the terms of
# GPL, and not to allow others to use your version of this file under the terms
# of the MIT license, indicate your decision by deleting the provisions above
# and replace them with the notice and other provisions required by GPL as set
# out in the file called "GPL-COPYING" included in this distribution. If you do
# not delete the provisions above, a recipient may use your version of this file
# under the terms of either the MIT license or GPL.
#
# This License is also included in this distribution in the file called
# "MIT-COPYING".
#
# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
### ###########################################################################
MODULE_OUT := $(RELATIVE_OUT)/$(MODULE_ARCH)
MODULE_INTERMEDIATES_DIR := $(MODULE_OUT)/intermediates/$(THIS_MODULE)
MODULE_TARGETS :=
MODULE_HOST_BUILD :=
MODULE_CLEAN_TARGETS :=
MODULE_CLOBBER_TARGETS :=
MODULE_CFLAGS :=
MODULE_CXXFLAGS :=
MODULE_LDFLAGS :=
MODULE_BISON_FLAGS :=
MODULE_FLEX_FLAGS :=
MODULE_FLEXXX_FLAGS :=
MODULE_ARCH_BITNESS :=
# Only allow cflags that do not affect code generation. This is to ensure
# proper binary compatibility when LTO (Link-Time Optimization) is enabled.
# We make exceptions for the below flags which will all fail linkage in
# non-LTO mode if incorrectly specified.
#
# NOTE: Only used by static_library and objects right now. Other module
# types should not be affected by complex code generation flags w/ LTO.
# Set MODULE_CHECK_CFLAGS in the module makefile to enable this check.
MODULE_CHECK_CFLAGS :=
MODULE_ALLOWED_CFLAGS := -W% -D% -std=% -fPIC -fPIE -pie -m32
# -L flags for library search dirs: these are relative to $(TOP), unless
# they're absolute paths
MODULE_LIBRARY_DIR_FLAGS := $(foreach _path,$($(THIS_MODULE)_libpaths),$(if $(filter /%,$(_path)),-L$(call relative-to-top,$(_path)),-L$(_path)))
# -L options to find system libraries (may be arch-specific)
MODULE_SYSTEM_LIBRARY_DIR_FLAGS :=
# -I flags for header search dirs (same rules as for -L)
MODULE_INCLUDE_FLAGS := $(foreach _path,$($(THIS_MODULE)_includes),$(if $(filter /%,$(_path)),-I$(call relative-to-top,$(_path)),-I$(_path)))
# If the build provides some external khronos include flags, and the module
# hasn't explicitly opted out of path substitution, prepend the system path
# to the DDK khronos header include path. This causes the platform headers
# to override the DDK versions. This is the default behaviour for Android.
ifneq ($(SYS_KHRONOS_INCLUDES),)
ifneq ($($(THIS_MODULE)_force_internal_khronos_headers),1)
MODULE_INCLUDE_FLAGS := $(patsubst -Iinclude/khronos,$(SYS_KHRONOS_INCLUDES) -Iinclude/khronos,$(MODULE_INCLUDE_FLAGS))
endif
endif
# These define the rules for finding source files.
#
# - If a name begins with a slash, we strip $(TOP) off the front if it
# begins with $(TOP). This is so that we don't get really long error
# messages from the compiler if the source tree is in a deeply nested
# directory, but we still do get absolute paths if you say "make
# OUT=/tmp/somewhere"
#
# - Otherwise, if a name contains a slash and begins with $(OUT), we leave
# it as it is. This is so you can say "module_src :=
# $(TARGET_INTERMEDIATES)/something/generated.c"
#
# - Otherwise, we assume it's a path referring to somewhere under the
# directory containing Linux.mk, and add $(THIS_DIR) to it
#
_SOURCES_WITHOUT_SLASH := \
$(strip $(foreach _s,$($(THIS_MODULE)_src),$(if $(findstring /,$(_s)),,$(_s))))
_SOURCES_WITH_SLASH := \
$(strip $(foreach _s,$($(THIS_MODULE)_src),$(if $(findstring /,$(_s)),$(_s),)))
MODULE_SOURCES := $(addprefix $(THIS_DIR)/,$(_SOURCES_WITHOUT_SLASH))
MODULE_SOURCES += $(call relative-to-top,$(filter /%,$(_SOURCES_WITH_SLASH)))
_RELATIVE_SOURCES_WITH_SLASH := \
$(filter-out /%,$(_SOURCES_WITH_SLASH))
_OUTDIR_RELATIVE_SOURCES_WITH_SLASH := \
$(filter $(RELATIVE_OUT)/%,$(_RELATIVE_SOURCES_WITH_SLASH))
_THISDIR_RELATIVE_SOURCES_WITH_SLASH := \
$(filter-out $(RELATIVE_OUT)/%,$(_RELATIVE_SOURCES_WITH_SLASH))
MODULE_SOURCES += $(_OUTDIR_RELATIVE_SOURCES_WITH_SLASH)
MODULE_SOURCES += $(addprefix $(THIS_DIR)/,$(_THISDIR_RELATIVE_SOURCES_WITH_SLASH))
# Add generated sources
MODULE_SOURCES += $(addprefix $(MODULE_OUT)/,$($(THIS_MODULE)_src_relative))
# MODULE_LIBRARY_FLAGS contains the flags to link each library. The rules
# are:
#
# module_staticlibs := mylib
# module_libs := mylib
# Use -lmylib
#
# module_extlibs := mylib
# Use $(libmylib_ldflags) if that variable is defined (empty counts as
# defined). Otherwise use -lmylib
#
# module_libs := :mylib
# Use -l:mylib.so
MODULE_LIBRARY_FLAGS := \
$(addprefix -l, $($(THIS_MODULE)_staticlibs)) \
$(addprefix -l, $(filter-out :%, $($(THIS_MODULE)_libs))) \
$(addprefix -l, $(addsuffix .so, $(filter :%,$($(THIS_MODULE)_libs)))) \
$(foreach _lib,$($(THIS_MODULE)_extlibs),$(if $(filter undefined,$(origin lib$(_lib)_ldflags)),-l$(_lib),$(lib$(_lib)_ldflags)))
# pkg-config integration; primarily used by X.Org
# We don't support arbitrary CFLAGS yet (just includes)
$(foreach _package,$($(THIS_MODULE)_packages),\
$(eval MODULE_INCLUDE_FLAGS += `pkg-config --cflags-only-I $(_package)`)\
$(eval MODULE_LIBRARY_FLAGS += `pkg-config --libs-only-l $(_package)`)\
$(eval MODULE_LIBRARY_DIR_FLAGS += `pkg-config --libs-only-L $(_package)`))

View File

@@ -1,48 +0,0 @@
########################################################################### ###
#@Title Module processing
#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
#@License Dual MIT/GPLv2
#
# The contents of this file are subject to the MIT license as set out below.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# Alternatively, the contents of this file may be used under the terms of
# the GNU General Public License Version 2 ("GPL") in which case the provisions
# of GPL are applicable instead of those above.
#
# If you wish to allow use of your version of this file only under the terms of
# GPL, and not to allow others to use your version of this file under the terms
# of the MIT license, indicate your decision by deleting the provisions above
# and replace them with the notice and other provisions required by GPL as set
# out in the file called "GPL-COPYING" included in this distribution. If you do
# not delete the provisions above, a recipient may use your version of this file
# under the terms of either the MIT license or GPL.
#
# This License is also included in this distribution in the file called
# "MIT-COPYING".
#
# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
### ###########################################################################
# Bits for processing $(modules) after reading in each Linux.mk
#$(info ---- $(modules) ----)
$(foreach _m,$(modules),$(if $(filter $(_m),$(ALL_MODULES)),$(error In makefile $(THIS_MAKEFILE): Duplicate module $(_m) (first seen in $(INTERNAL_MAKEFILE_FOR_MODULE_$(_m))) listed in $$(modules)),$(eval $(call register-module,$(_m)))))
ALL_MODULES += $(modules)

View File

@@ -1,92 +0,0 @@
########################################################################### ###
#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
#@License Dual MIT/GPLv2
#
# The contents of this file are subject to the MIT license as set out below.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# Alternatively, the contents of this file may be used under the terms of
# the GNU General Public License Version 2 ("GPL") in which case the provisions
# of GPL are applicable instead of those above.
#
# If you wish to allow use of your version of this file only under the terms of
# GPL, and not to allow others to use your version of this file under the terms
# of the MIT license, indicate your decision by deleting the provisions above
# and replace them with the notice and other provisions required by GPL as set
# out in the file called "GPL-COPYING" included in this distribution. If you do
# not delete the provisions above, a recipient may use your version of this file
# under the terms of either the MIT license or GPL.
#
# This License is also included in this distribution in the file called
# "MIT-COPYING".
#
# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
### ###########################################################################
# Rules for making kernel modules with kbuild. This makefile doesn't define
# any rules that build the modules, it only copies the kbuild Makefile into
# the right place and then invokes kbuild to do the actual build
$(call target-build-only,kernel module)
MODULE_KBUILD_DIR := $(MODULE_OUT)/kbuild
# $(THIS_MODULE)_makefile names the kbuild makefile fragment used to build
# this module's objects
$(call must-be-nonempty,$(THIS_MODULE)_makefile)
MODULE_KBUILD_MAKEFILE := $($(THIS_MODULE)_makefile)
# $(THIS_MODULE)_target specifies the name of the kernel module
$(call must-be-nonempty,$(THIS_MODULE)_target)
MODULE_TARGETS := $($(THIS_MODULE)_target)
MODULE_KBUILD_OBJECTS := $($(THIS_MODULE)_target:.ko=.o)
$(call module-info-line,kernel module: $(MODULE_TARGETS))
# Unusually, we define $(THIS_MODULE)_install_path if the user didn't, as we
# can't use MODULE_INSTALL_PATH in the scripts.mk logic.
ifeq ($($(THIS_MODULE)_install_path),)
$(THIS_MODULE)_install_path := \
$${MOD_DESTDIR}/$(patsubst $(MODULE_OUT)/%,%,$(MODULE_TARGETS))
endif
MODULE_INSTALL_PATH := $($(THIS_MODULE)_install_path)
# Here we could maybe include $(MODULE_KBUILD_MAKEFILE) and look at
# $(MODULE_KBUILD_OBJECTS)-y to see which source files might be built
.PHONY: $(THIS_MODULE)
$(THIS_MODULE): MODULE_KBUILD_MAKEFILE := $(MODULE_KBUILD_MAKEFILE)
$(THIS_MODULE): MODULE_KBUILD_OBJECTS := $(MODULE_KBUILD_OBJECTS)
$(THIS_MODULE):
@echo "kbuild module '$@'"
@echo " MODULE_KBUILD_MAKEFILE := $(MODULE_KBUILD_MAKEFILE)"
@echo " MODULE_KBUILD_OBJECTS := $(MODULE_KBUILD_OBJECTS)"
@echo ' Being built:' $(if $(filter $@,$(KERNEL_COMPONENTS)),"yes (separate module)",$(if $(filter $@,$(EXTRA_PVRSRVKM_COMPONENTS)),"yes (into pvrsrvkm)","no"))
@echo "Module $@ is a kbuild module. Run 'make kbuild' to make it"
@false
$(MODULE_INTERMEDIATES_DIR)/.install: MODULE_TYPE := $($(THIS_MODULE)_type)
$(MODULE_INTERMEDIATES_DIR)/.install: MODULE_INSTALL_PATH := $(MODULE_INSTALL_PATH)
$(MODULE_INTERMEDIATES_DIR)/.install: MODULE_TARGETS := $(patsubst $(MODULE_OUT)/%,%,$(MODULE_TARGETS))
$(MODULE_INTERMEDIATES_DIR)/.install: $(THIS_MAKEFILE) | $(MODULE_INTERMEDIATES_DIR)
@echo 'install_file $(MODULE_TARGETS) $(MODULE_INSTALL_PATH) "$(MODULE_TYPE)" 0644 0:0' >$@
ALL_KBUILD_MODULES += $(THIS_MODULE)
INTERNAL_KBUILD_MAKEFILE_FOR_$(THIS_MODULE) := $(MODULE_KBUILD_MAKEFILE)
INTERNAL_KBUILD_OBJECTS_FOR_$(THIS_MODULE) := $(MODULE_KBUILD_OBJECTS)

View File

@@ -1,144 +0,0 @@
########################################################################### ###
#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
#@License Dual MIT/GPLv2
#
# The contents of this file are subject to the MIT license as set out below.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# Alternatively, the contents of this file may be used under the terms of
# the GNU General Public License Version 2 ("GPL") in which case the provisions
# of GPL are applicable instead of those above.
#
# If you wish to allow use of your version of this file only under the terms of
# GPL, and not to allow others to use your version of this file under the terms
# of the MIT license, indicate your decision by deleting the provisions above
# and replace them with the notice and other provisions required by GPL as set
# out in the file called "GPL-COPYING" included in this distribution. If you do
# not delete the provisions above, a recipient may use your version of this file
# under the terms of either the MIT license or GPL.
#
# This License is also included in this distribution in the file called
# "MIT-COPYING".
#
# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
### ###########################################################################
include ../config/preconfig.mk
# If a TARGET_PRODUCT is specified but not a TARGET_DEVICE, try to
# derive the TARGET_DEVICE from TARGET_PRODUCT.
#
ifeq ($(TARGET_DEVICE),)
override TARGET_DEVICE := \
$(patsubst mini_%,%,$(patsubst full_%,%,$(TARGET_PRODUCT)))
endif
ifeq ($(TARGET_DEVICE),)
override TARGET_DEVICE := pc
endif
HAL_VARIANT := pc
RGX_BVNC ?= 1.82.4.5
# TC BONNIE:
#RGX_BVNC ?= 4.31.4.55
include ../common/android/paths.mk
include ../common/android/arch.mk
include ../common/android/features.mk
ifeq ($(SUPPORT_ADF),1)
ifneq ($(is_at_least_lollipop),1)
SYS_INCLUDES += \
-isystem $(ANDROID_ROOT)/device/img/pc/adf/libadf/include \
-isystem $(ANDROID_ROOT)/device/img/pc/adf/libadfhwc/include
endif
endif
ifeq ($(NO_HARDWARE),1)
LDM_PLATFORM := 1
PVR_SYSTEM := rgx_nohw
# If we end up using dc_fbdev, Android always wants to be
# triple buffered in when running in pure-software mode.
DC_FBDEV_NUM_PREFERRED_BUFFERS := 3
else
ifeq ($(SUPPORT_ADF),1)
PVR_LDM_PLATFORM_PRE_REGISTERED := 1
LMA := 1
LDM_PLATFORM := 1
PVR_SYSTEM := rgx_linux_apollo
SUPPORT_SYSTEM_INTERRUPT_HANDLING := 1
ION_DEFAULT_HEAP_ID_MASK := (1 << (ION_HEAP_TYPE_CUSTOM + 2))
else
LDM_PCI := 1
PVR_SYSTEM := rgx_tc
TC_MEMORY_CONFIG := TC_MEMORY_LOCAL
SUPPORT_SYSTEM_INTERRUPT_HANDLING := 1
endif
endif
ifeq ($(SUPPORT_ADF),1)
ifneq ($(NO_HARDWARE),1)
DISPLAY_CONTROLLER ?= adf_pdp
endif
else
ifeq ($(NO_HARDWARE),1)
DISPLAY_CONTROLLER ?= dc_example
else
DISPLAY_CONTROLLER ?= dc_pdp
endif
endif
ifeq ($(DISPLAY_CONTROLLER),adf_pdp)
ADF_PDP_WIDTH ?= 1280
ADF_PDP_HEIGHT ?= 720
KERNEL_COMPONENTS += apollo
endif
KERNEL_COMPONENTS += $(DISPLAY_CONTROLLER)
CACHEFLUSH_TYPE ?= CACHEFLUSH_X86
PVR_ANDROID_DEFER_CLEAR ?= 1
ifeq ($(PVR_SYSTEM),rgx_tc)
ifeq ($(TC_MEMORY_CONFIG),TC_MEMORY_LOCAL)
LMA := 1
# Tell ion that we want memory from the test chip local memory
# heap. The choice of ION_HEAP_TYPE_CUSTOM+1 as the ID is
# arbitrary, but it has to match the one specified in the
# TC-specific ion support code.
ION_DEFAULT_HEAP_ID_MASK := 1 << (ION_HEAP_TYPE_CUSTOM + 1)
endif
endif
ifeq ($(DISPLAY_CONTROLLER),dc_pdp)
DCPDP_WIDTH ?= 1280
DCPDP_HEIGHT ?= 720
DCPDP_NO_INTERRUPTS ?= 1
endif
include ../config/core.mk
include ../common/android/extra_config.mk
include ../common/pvrgdb.mk
include ../common/3rdparty.mk
include ../common/testchip.mk
# For VP this needs to be external visible options
$(eval $(call KernelConfigC,TC_APOLLO_ES2,))
$(eval $(call TunableKernelConfigC,VIRTUAL_PLATFORM,))

View File

@@ -1,56 +0,0 @@
########################################################################### ###
#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
#@License Dual MIT/GPLv2
#
# The contents of this file are subject to the MIT license as set out below.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# Alternatively, the contents of this file may be used under the terms of
# the GNU General Public License Version 2 ("GPL") in which case the provisions
# of GPL are applicable instead of those above.
#
# If you wish to allow use of your version of this file only under the terms of
# GPL, and not to allow others to use your version of this file under the terms
# of the MIT license, indicate your decision by deleting the provisions above
# and replace them with the notice and other provisions required by GPL as set
# out in the file called "GPL-COPYING" included in this distribution. If you do
# not delete the provisions above, a recipient may use your version of this file
# under the terms of either the MIT license or GPL.
#
# This License is also included in this distribution in the file called
# "MIT-COPYING".
#
# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
### ###########################################################################
.PHONY: prepare_tree
prepare_tree:
INTERNAL_INCLUDED_PREPARE_HEADERS :=
-include build/linux/prepare_headers.mk
ifneq ($(INTERNAL_INCLUDED_PREPARE_HEADERS),true)
missing_headers := $(strip $(shell test ! -e include/pvrversion.h && echo true))
ifdef missing_headers
$(info )
$(info ** include/pvrversion.h is missing, and cannot be rebuilt.)
$(info ** Cannot continue.)
$(info )
$(error Missing headers)
endif
endif

View File

@@ -1,57 +0,0 @@
########################################################################### ###
#@Title Extract info from pvrversion.h
#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
#@License Dual MIT/GPLv2
#
# The contents of this file are subject to the MIT license as set out below.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# Alternatively, the contents of this file may be used under the terms of
# the GNU General Public License Version 2 ("GPL") in which case the provisions
# of GPL are applicable instead of those above.
#
# If you wish to allow use of your version of this file only under the terms of
# GPL, and not to allow others to use your version of this file under the terms
# of the MIT license, indicate your decision by deleting the provisions above
# and replace them with the notice and other provisions required by GPL as set
# out in the file called "GPL-COPYING" included in this distribution. If you do
# not delete the provisions above, a recipient may use your version of this file
# under the terms of either the MIT license or GPL.
#
# This License is also included in this distribution in the file called
# "MIT-COPYING".
#
# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
### ###########################################################################
# Version information
PVRVERSION_H := $(call if-exists,include/pvrversion.h,$(OUT)/include/pvrversion.h)
ifneq ($(wildcard $(PVRVERSION_H)),)
# scripts.mk uses these to set the install script's version suffix
PVRVERSION_MAJ := $(shell perl -ne '/\sPVRVERSION_MAJ\s+(\w+)/ and print $$1' $(PVRVERSION_H))
PVRVERSION_MIN := $(shell perl -ne '/\sPVRVERSION_MIN\s+(\w+)/ and print $$1' $(PVRVERSION_H))
PVRVERSION_FAMILY := $(shell perl -ne '/\sPVRVERSION_FAMILY\s+"(\S+)"/ and print $$1' $(PVRVERSION_H))
PVRVERSION_BRANCHNAME := $(shell perl -ne '/\sPVRVERSION_BRANCHNAME\s+"(\S+)"/ and print $$1' $(PVRVERSION_H))
PVRVERSION_BUILD := $(shell perl -ne '/\sPVRVERSION_BUILD\s+(\w+)/ and print $$1' $(PVRVERSION_H))
PVRVERSION_NUM := $(PVRVERSION_MAJ).$(PVRVERSION_MIN).$(PVRVERSION_BUILD)
PVRVERSION := "$(PVRVERSION_FAMILY)_$(PVRVERSION_BRANCHNAME)\@$(PVRVERSION_BUILD)"
endif

View File

@@ -1,352 +0,0 @@
########################################################################### ###
#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
#@License Dual MIT/GPLv2
#
# The contents of this file are subject to the MIT license as set out below.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# Alternatively, the contents of this file may be used under the terms of
# the GNU General Public License Version 2 ("GPL") in which case the provisions
# of GPL are applicable instead of those above.
#
# If you wish to allow use of your version of this file only under the terms of
# GPL, and not to allow others to use your version of this file under the terms
# of the MIT license, indicate your decision by deleting the provisions above
# and replace them with the notice and other provisions required by GPL as set
# out in the file called "GPL-COPYING" included in this distribution. If you do
# not delete the provisions above, a recipient may use your version of this file
# under the terms of either the MIT license or GPL.
#
# This License is also included in this distribution in the file called
# "MIT-COPYING".
#
# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
### ###########################################################################
ifeq ($(SUPPORT_ANDROID_PLATFORM),)
define if-component
ifneq ($$(filter $(1),$$(COMPONENTS)),)
M4DEFS += $(2)
endif
endef
define if-kernel-component
ifneq ($$(filter $(1),$$(KERNEL_COMPONENTS)),)
M4DEFS_K += $(2)
endif
endef
# common.m4 lives here
#
M4FLAGS := -I$(MAKE_TOP)/scripts
# These defs are required for both KM and UM install script.
M4DEFS_K := \
-DPVRVERSION="$(PVRVERSION)" \
-DPVR_BUILD_DIR=$(PVR_BUILD_DIR) \
-DPVRSRV_MODNAME=$(PVRSRV_MODNAME)
ifeq ($(SUPPORT_DRM),1)
M4DEFS_K += \
-DSUPPORT_DRM=1
endif
ifeq ($(SUPPORT_DRM_DC_MODULE),1)
M4DEFS_K += \
-DSUPPORT_DRM_DC_MODULE=1
endif
ifeq ($(PDUMP),1)
M4DEFS_K += -DPDUMP=1
endif
ifneq ($(DISPLAY_CONTROLLER),)
$(eval $(call if-kernel-component,$(DISPLAY_CONTROLLER),\
-DDISPLAY_CONTROLLER=$(DISPLAY_CONTROLLER)))
endif
# These defs are not derived from user variables
#
M4DEFS := \
-DSOLIB_VERSION=$(PVRVERSION_MAJ).$(PVRVERSION_MIN).$(PVRVERSION_BUILD)
ifeq ($(SUPPORT_KERNEL_SRVINIT),1)
M4DEFS += \
-DSUPPORT_KERNEL_SRVINIT=1 \
-DFW_DESTDIR=$(FW_DESTDIR) \
-DRGX_FW_FILENAME=$(RGX_FW_FILENAME)
endif
# XOrg support options are convoluted, so don't bother with if-component.
ifneq ($(filter pvr_video,$(COMPONENTS)),) # This is an X build
M4DEFS += -DSUPPORT_LWS=1
M4DEFS += -DSUPPORT_XORG=1
M4DEFS += -DXORG_EXPLICIT_PVR_SERVICES_LOAD=$(XORG_EXPLICIT_PVR_SERVICES_LOAD)
ifneq ($(XORG_WAYLAND),1)
M4DEFS += -DXORG_WAYLAND=1
endif
ifeq ($(LWS_NATIVE),1)
M4DEFS += -DPVR_XORG_DESTDIR=/usr/bin
M4DEFS += -DPVR_CONF_DESTDIR=/etc/X11
$(eval $(call if-component,opengl_mesa,-DSUPPORT_MESA=1))
else
M4DEFS += -DLWS_INSTALL_TREE=1
M4DEFS += -DPVR_XORG_DESTDIR=$(LWS_PREFIX)/bin
M4DEFS += -DPVR_CONF_DESTDIR=$(LWS_PREFIX)/etc/X11
$(eval $(call if-component,pvr_input, -DSUPPORT_DDX_INPUT=1))
$(eval $(call if-component,opengl_mesa,-DSUPPORT_LIBGL=1 -DSUPPORT_MESA=1))
endif
else # This is a non-X build
ifeq ($(WINDOW_SYSTEM),wayland)
M4DEFS += -DSUPPORT_LWS=1
M4DEFS += -DSUPPORT_WAYLAND=1
ifeq ($(LWS_NATIVE),1)
else
M4DEFS += -DLWS_INSTALL_TREE=1
endif
else # This is a non-X and Wayland build
$(eval $(call if-component,opengl,-DSUPPORT_LIBGL=1))
endif
endif
# Map other COMPONENTS on to SUPPORT_ defs
#
$(eval $(call if-component,opengles1,\
-DSUPPORT_OPENGLES1=1 -DOGLES1_MODULE=$(opengles1_target) \
-DSUPPORT_OPENGLES1_V1_ONLY=0))
$(eval $(call if-component,opengles3,\
-DSUPPORT_OPENGLES3=1 -DOGLES3_MODULE=$(opengles3_target)))
$(eval $(call if-component,egl,\
-DSUPPORT_LIBEGL=1 -DEGL_MODULE=$(egl_target)))
$(eval $(call if-component,glslcompiler,\
-DSUPPORT_SOURCE_SHADER=1))
$(eval $(call if-component,opencl,\
-DSUPPORT_OPENCL=1))
$(eval $(call if-component,liboclcompiler,\
-DSUPPORT_OCL_COMPILER=1))
$(eval $(call if-component,openrl,\
-DSUPPORT_OPENRL=1))
$(eval $(call if-component,renderscript,\
-DSUPPORT_RSC=1))
$(eval $(call if-component,renderscript_sha1,\
-DSUPPORT_RSC_SHA1=1))
$(eval $(call if-component,librscruntime,\
-DSUPPORT_RSC_RUNTIME=1))
$(eval $(call if-component,librsccompiler,\
-DSUPPORT_RSC_COMPILER=1))
$(eval $(call if-component,rscreplay,\
-DSUPPORT_RSC_REPLAY=1))
$(eval $(call if-component,opengl opengl_mesa,\
-DSUPPORT_OPENGL=1))
$(eval $(call if-component,null_ws,\
-DSUPPORT_NULL_WS=1))
$(eval $(call if-component,null_drm_ws,\
-DSUPPORT_NULL_DRM_WS=1 \
-DSUPPORT_LWS=1 \
-DLWS_INSTALL_TREE=1))
$(eval $(call if-component,null_remote,\
-DSUPPORT_NULL_REMOTE=1))
$(eval $(call if-component,null_adf_ws,\
-DSUPPORT_NULL_ADF_WS=1))
$(eval $(call if-component,ews_ws,\
-DSUPPORT_EWS=1))
$(eval $(call if-component,ews_wm,\
-DSUPPORT_LUA=1))
$(eval $(call if-component,graphicshal,\
-DSUPPORT_GRAPHICS_HAL=1))
$(eval $(call if-component,xeglinfo,\
-DSUPPORT_XUNITTESTS=1))
$(eval $(call if-component,pvrgdb,\
-DPVRGDB=1))
ifeq ($(PVR_REMOTE),1)
M4DEFS += -DPVR_REMOTE=1
endif
# Build UM script using old scheme using M4
define create-install-um-script-m4
$(RELATIVE_OUT)/$(1)/install_um.sh: $(PVRVERSION_H) $(CONFIG_MK) \
$(MAKE_TOP)/scripts/common.m4 \
$(MAKE_TOP)/$(PVR_BUILD_DIR)/install_um.sh.m4 \
| $(RELATIVE_OUT)/$(1)
$$(if $(V),,@echo " GEN " $$(call relative-to-top,$$@))
$(M4) $(M4FLAGS) $(M4DEFS) $(M4DEFS_K) \
$(MAKE_TOP)/scripts/common.m4 \
$(MAKE_TOP)/$(PVR_BUILD_DIR)/install_um.sh.m4 > $$@
install_script: $(RELATIVE_OUT)/$(1)/install_um.sh
endef
$(foreach _t,$(TARGET_ALL_ARCH),$(eval $(call create-install-um-script-m4,$(_t))))
$(TARGET_PRIMARY_OUT)/rc.pvr: $(PVRVERSION_H) $(CONFIG_MK) $(CONFIG_KERNEL_MK) \
$(MAKE_TOP)/scripts/rc.pvr.m4 $(MAKE_TOP)/scripts/common.m4 \
$(MAKE_TOP)/$(PVR_BUILD_DIR)/rc.pvr.m4 \
| $(TARGET_PRIMARY_OUT)
$(if $(V),,@echo " GEN " $(call relative-to-top,$@))
$(M4) $(M4FLAGS) $(M4DEFS) $(M4DEFS_K) $(MAKE_TOP)/scripts/rc.pvr.m4 \
$(MAKE_TOP)/$(PVR_BUILD_DIR)/rc.pvr.m4 > $@
$(CHMOD) +x $@
init_script: $(TARGET_PRIMARY_OUT)/rc.pvr
$(TARGET_PRIMARY_OUT)/udev.pvr: $(CONFIG_KERNEL_MK) \
$(MAKE_TOP)/scripts/udev.pvr.m4 \
| $(TARGET_PRIMARY_OUT)
$(if $(V),,@echo " GEN " $(call relative-to-top,$@))
$(M4) $(M4FLAGS) $(M4DEFS_K) $(MAKE_TOP)/scripts/udev.pvr.m4 > $@
udev_rules: $(TARGET_PRIMARY_OUT)/udev.pvr
endif # ifeq ($(SUPPORT_ANDROID_PLATFORM),)
# This code mimics the way Make processes our implicit/explicit goal list.
# It tries to build up a list of components that were actually built, from
# whence an install script is generated.
#
ifneq ($(MAKECMDGOALS),)
BUILT_UM := $(MAKECMDGOALS)
ifneq ($(filter build services_all components,$(MAKECMDGOALS)),)
BUILT_UM += $(COMPONENTS)
endif
BUILT_UM := $(sort $(filter $(ALL_MODULES) xorg wl,$(BUILT_UM)))
else
BUILT_UM := $(sort $(COMPONENTS))
endif
ifneq ($(MAKECMDGOALS),)
BUILT_KM := $(MAKECMDGOALS)
ifneq ($(filter build services_all kbuild,$(MAKECMDGOALS)),)
BUILT_KM += $(KERNEL_COMPONENTS)
endif
BUILT_KM := $(sort $(filter $(ALL_MODULES),$(BUILT_KM)))
else
BUILT_KM := $(sort $(KERNEL_COMPONENTS))
endif
INSTALL_UM_MODULES := \
$(strip $(foreach _m,$(BUILT_UM),\
$(if $(filter doc module_group,$($(_m)_type)),,\
$(if $(filter host_%,$($(_m)_arch)),,\
$(if $($(_m)_install_path),$(_m),\
$(warning WARNING: UM $(_m)_install_path not defined))))))
# Build up a list of installable shared libraries. The shared_library module
# type is specially guaranteed to define $(_m)_target, even if the Linux.mk
# itself didn't. The list is formatted with <module>:<target> pairs e.g.
# "moduleA:libmoduleA.so moduleB:libcustom.so" for later processing.
ALL_SHARED_INSTALLABLE := \
$(sort $(foreach _a,$(ALL_MODULES),\
$(if $(filter shared_library,$($(_a)_type)),$(_a):$($(_a)_target),)))
# Handle implicit install dependencies. Executables and shared libraries may
# be linked against other shared libraries. Avoid requiring the user to
# specify the program's binary dependencies explicitly with $(m)_install_extra
INSTALL_UM_MODULES := \
$(sort $(INSTALL_UM_MODULES) \
$(foreach _a,$(ALL_SHARED_INSTALLABLE),\
$(foreach _m,$(INSTALL_UM_MODULES),\
$(foreach _l,$($(_m)_libs),\
$(if $(filter lib$(_l).so,$(word 2,$(subst :, ,$(_a)))),\
$(word 1,$(subst :, ,$(_a))))))))
# Add explicit dependencies that must be installed
INSTALL_UM_MODULES := \
$(sort $(INSTALL_UM_MODULES) \
$(foreach _m,$(INSTALL_UM_MODULES),\
$($(_m)_install_dependencies)))
define calculate-um-fragments
# Work out which modules are required for this arch.
INSTALL_UM_MODULES_$(1) := \
$$(strip $$(foreach _m,$(INSTALL_UM_MODULES),\
$$(if $$(filter $(1),$$(INTERNAL_ARCH_LIST_FOR_$$(_m))),$$(_m))))
INSTALL_UM_FRAGMENTS_$(1) := $$(foreach _m,$$(INSTALL_UM_MODULES_$(1)),$(RELATIVE_OUT)/$(1)/intermediates/$$(_m)/.install)
.PHONY: install_um_$(1)_debug
install_um_$(1)_debug: $$(INSTALL_UM_FRAGMENTS_$(1))
$(CAT) $$^
endef
$(foreach _t,$(TARGET_ALL_ARCH) target_neutral,$(eval $(call calculate-um-fragments,$(_t))))
INSTALL_KM_FRAGMENTS := \
$(strip $(foreach _m,$(BUILT_KM),\
$(if $(filter-out kernel_module,$($(_m)_type)),,\
$(if $($(_m)_install_path),\
$(TARGET_PRIMARY_OUT)/intermediates/$(_m)/.install,\
$(warning WARNING: KM $(_m)_install_path not defined)))))
.PHONY: install_km_debug
install_km_debug: $(INSTALL_KM_FRAGMENTS)
$(CAT) $^
ifneq ($(INSTALL_KM_FRAGMENTS),)
$(TARGET_PRIMARY_OUT)/install_km.sh: $(INSTALL_KM_FRAGMENTS) $(CONFIG_KERNEL_MK) | $(TARGET_PRIMARY_OUT)
$(if $(V),,@echo " GEN " $(call relative-to-top,$@))
$(ECHO) KERNELVERSION=$(KERNEL_ID) > $@
ifeq ($(SUPPORT_ANDROID_PLATFORM),)
$(ECHO) MOD_DESTDIR=/lib/modules/$(KERNEL_ID)/extra >> $@
endif
$(CAT) $(INSTALL_KM_FRAGMENTS) >> $@
install_script_km: $(TARGET_PRIMARY_OUT)/install_km.sh
endif
# Build UM script using new scheme which does not use M4 for anything
# (Only works for Android and target_neutral right now.)
define create-install-um-script
ifneq ($$(INSTALL_UM_FRAGMENTS_$(1)),)
$(RELATIVE_OUT)/$(1)/install_um.sh: $$(INSTALL_UM_FRAGMENTS_$(1)) | $(RELATIVE_OUT)/$(1)
$(if $(V),,@echo " GEN " $$(call relative-to-top,$$@))
$(CAT) $$(INSTALL_UM_FRAGMENTS_$(1)) > $$@
install_script: $(RELATIVE_OUT)/$(1)/install_um.sh
endif
endef
$(eval $(call create-install-um-script,target_neutral))
ifneq ($(SUPPORT_ANDROID_PLATFORM),)
$(foreach _t,$(TARGET_ALL_ARCH),$(eval $(call create-install-um-script,$(_t))))
endif
# Build the top-level install script that drives the install.
ifneq ($(SUPPORT_ANDROID_PLATFORM),)
install_sh_template := $(MAKE_TOP)/common/android/install.sh.tpl
else
install_sh_template := $(MAKE_TOP)/scripts/install.sh.tpl
endif
$(RELATIVE_OUT)/install.sh: $(PVRVERSION_H) | $(RELATIVE_OUT)
# In customer packages only one of config.mk or config_kernel.mk will exist.
# We can depend on either one, as long as we rebuild the install script when
# the config options it uses change.
$(RELATIVE_OUT)/install.sh: $(call if-exists,$(CONFIG_MK),$(CONFIG_KERNEL_MK))
$(RELATIVE_OUT)/install.sh: $(install_sh_template)
$(if $(V),,@echo " GEN " $(call relative-to-top,$@))
$(ECHO) 's/\[PVRVERSION\]/$(subst /,\/,$(PVRVERSION))/g;' > $(RELATIVE_OUT)/install.sh.sed
$(ECHO) 's/\[PVRBUILD\]/$(BUILD)/g;' >> $(RELATIVE_OUT)/install.sh.sed
$(ECHO) 's/\[PRIMARY_ARCH\]/$(TARGET_PRIMARY_ARCH)/g;' >> $(RELATIVE_OUT)/install.sh.sed
$(ECHO) 's/\[ARCHITECTURES\]/$(TARGET_ALL_ARCH)/g;' >> $(RELATIVE_OUT)/install.sh.sed
$(ECHO) 's/\[LWS_PREFIX\]/$(subst /,\/,$(LWS_PREFIX))/g;' >> $(RELATIVE_OUT)/install.sh.sed
$(ECHO) 's/\[SHLIB_DESTDIR\]/$(subst /,\/,$(SHLIB_DESTDIR))/g;' >> $(RELATIVE_OUT)/install.sh.sed
@sed -f $(RELATIVE_OUT)/install.sh.sed $< > $@
$(CHMOD) +x $@
$(RM) $(RELATIVE_OUT)/install.sh.sed
install_script: $(RELATIVE_OUT)/install.sh
install_script_km: $(RELATIVE_OUT)/install.sh

View File

@@ -1,89 +0,0 @@
########################################################################### ###
#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
#@License Dual MIT/GPLv2
#
# The contents of this file are subject to the MIT license as set out below.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# Alternatively, the contents of this file may be used under the terms of
# the GNU General Public License Version 2 ("GPL") in which case the provisions
# of GPL are applicable instead of those above.
#
# If you wish to allow use of your version of this file only under the terms of
# GPL, and not to allow others to use your version of this file under the terms
# of the MIT license, indicate your decision by deleting the provisions above
# and replace them with the notice and other provisions required by GPL as set
# out in the file called "GPL-COPYING" included in this distribution. If you do
# not delete the provisions above, a recipient may use your version of this file
# under the terms of either the MIT license or GPL.
#
# This License is also included in this distribution in the file called
# "MIT-COPYING".
#
# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
### ###########################################################################
include ../config/preconfig.mk
# If a TARGET_PRODUCT is specified but not a TARGET_DEVICE, try to
# derive the TARGET_DEVICE from TARGET_PRODUCT.
#
ifeq ($(TARGET_DEVICE),)
override TARGET_DEVICE := \
$(patsubst mini_%,%,$(patsubst full_%,%,$(TARGET_PRODUCT)))
ifneq ($(filter kylin_perf kylin_p1,$(TARGET_DEVICE)),)
override TARGET_DEVICE := sun9i
endif
endif
ifeq ($(TARGET_DEVICE),)
override TARGET_DEVICE := sun9i
endif
HAL_VARIANT := sun9i
PVR_SYSTEM := rgx_sunxi
LDM_PLATFORM := 1
SUPPORT_ADF := 1
RGX_BVNC = 1.75.2.30
KERNEL_CROSS_COMPILE ?= arm-eabi-
include ../common/android/paths.mk
include ../common/android/arch.mk
include ../common/android/features.mk
ION_DEFAULT_HEAP_ID_MASK := (1 << ION_HEAP_TYPE_DMA)
ION_FALLBACK_HEAP_ID_MASK := (1 << ION_HEAP_TYPE_CARVEOUT)
ifneq ($(is_at_least_lollipop),1)
SYS_INCLUDES += \
-isystem $(ANDROID_ROOT)/device/img/sun9i/adf/libadf/include \
-isystem $(ANDROID_ROOT)/device/img/sun9i/adf/libadfhwc/include
endif
DISPLAY_CONTROLLER ?= adf_sunxi
KERNEL_COMPONENTS += $(DISPLAY_CONTROLLER)
CACHEFLUSH_TYPE ?= CACHEFLUSH_GENERIC
PDUMP_STREAMBUF_SIZE_MB := 10
include ../config/core.mk
include ../common/android/extra_config.mk

View File

@@ -1,68 +0,0 @@
########################################################################### ###
#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
#@License Dual MIT/GPLv2
#
# The contents of this file are subject to the MIT license as set out below.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# Alternatively, the contents of this file may be used under the terms of
# the GNU General Public License Version 2 ("GPL") in which case the provisions
# of GPL are applicable instead of those above.
#
# If you wish to allow use of your version of this file only under the terms of
# GPL, and not to allow others to use your version of this file under the terms
# of the MIT license, indicate your decision by deleting the provisions above
# and replace them with the notice and other provisions required by GPL as set
# out in the file called "GPL-COPYING" included in this distribution. If you do
# not delete the provisions above, a recipient may use your version of this file
# under the terms of either the MIT license or GPL.
#
# This License is also included in this distribution in the file called
# "MIT-COPYING".
#
# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
### ###########################################################################
# Find out the path of the Linux.mk makefile currently being processed, and
# set paths used by the build rules
# This magic is used so we can use this_makefile.mk twice: first when reading
# in each Linux.mk, and then again when generating rules. There we set
# $(THIS_MAKEFILE), and $(REMAINING_MAKEFILES) should be empty
ifneq ($(strip $(REMAINING_MAKEFILES)),)
# Absolute path to the Linux.mk being processed
THIS_MAKEFILE := $(firstword $(REMAINING_MAKEFILES))
# The list of makefiles left to process
REMAINING_MAKEFILES := $(wordlist 2,$(words $(REMAINING_MAKEFILES)),$(REMAINING_MAKEFILES))
else
# When generating rules, we should have read in every Linux.mk
$(if $(INTERNAL_INCLUDED_ALL_MAKEFILES),,$(error No makefiles left in $$(REMAINING_MAKEFILES), but $$(INTERNAL_INCLUDED_ALL_MAKEFILES) is not set))
endif
# Path to the directory containing Linux.mk
THIS_DIR := $(patsubst %/,%,$(dir $(THIS_MAKEFILE)))
ifeq ($(strip $(THIS_DIR)),)
$(error Empty $$(THIS_DIR) for makefile "$(THIS_MAKEFILE)")
endif
modules :=

View File

@@ -1,120 +0,0 @@
#!/bin/sh
########################################################################### ###
#@File
#@Title Test the nature of the C compiler.
#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
#@License Dual MIT/GPLv2
#
# The contents of this file are subject to the MIT license as set out below.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# Alternatively, the contents of this file may be used under the terms of
# the GNU General Public License Version 2 ("GPL") in which case the provisions
# of GPL are applicable instead of those above.
#
# If you wish to allow use of your version of this file only under the terms of
# GPL, and not to allow others to use your version of this file under the terms
# of the MIT license, indicate your decision by deleting the provisions above
# and replace them with the notice and other provisions required by GPL as set
# out in the file called "GPL-COPYING" included in this distribution. If you do
# not delete the provisions above, a recipient may use your version of this file
# under the terms of either the MIT license or GPL.
#
# This License is also included in this distribution in the file called
# "MIT-COPYING".
#
# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
### ###########################################################################
LANG=C
export LANG
usage() {
echo "usage: $0 [--64] [--clang] --cc CC [--out OUT] [cflag]"
exit 1
}
check_clang() {
$CC -Wp,-dM -E - </dev/null | grep __clang__ >/dev/null 2>&1
if [ "$?" = "0" ]; then
# Clang must be passed a program with a main() that returns 0.
# It will produce an error if main() is improperly specified.
IS_CLANG=1
TEST_PROGRAM="int main(void){return 0;}"
else
# If we're not clang, assume we're GCC. GCC needs to be passed
# a program with a faulty return in main() so that another
# warning (unrelated to the flag being tested) is emitted.
# This will cause GCC to warn about the unsupported warning flag.
IS_CLANG=0
TEST_PROGRAM="int main(void){return;}"
fi
}
do_cc() {
echo "$TEST_PROGRAM" 2> /dev/null | $CC -W -Wall $3 -xc -c - -o $1 >$2 2>&1
}
while [ 1 ]; do
if [ "$1" = "--64" ]; then
[ -z $CLANG ] && BIT_CHECK=1
elif [ "$1" = "--clang" ]; then
[ -z $BIT_CHECK ] && CLANG=1
elif [ "$1" = "--cc" ]; then
[ "x$2" = "x" ] && usage
CC="$2" && shift
elif [ "$1" = "--out" ]; then
[ "x$2" = "x" ] && usage
OUT="$2" && shift
elif [ "${1#--}" != "$1" ]; then
usage
else
break
fi
shift
done
[ "x$CC" = "x" ] && usage
[ "x$CLANG" = "x" -a "x$OUT" = "x" ] && usage
ccof=$OUT/cc-sanity-check
log=${ccof}.log
check_clang
if [ "x$BIT_CHECK" = "x1" ]; then
do_cc $ccof $log ""
file $ccof | grep 64-bit >/dev/null 2>&1
[ "$?" = "0" ] && echo true || echo false
elif [ "x$CLANG" = "x1" ]; then
[ "x$IS_CLANG" = "x1" ] && echo true || echo false
else
[ "x$1" = "x" ] && usage
do_cc $ccof $log $1
if [ "$?" = "0" ]; then
# compile passed, but was the warning unrecognized?
if [ "x$IS_CLANG" = "x1" ]; then
grep "^warning: unknown warning option '$1'" $log >/dev/null 2>&1
else
grep -E "(^cc1: warning: unrecognized command line option \"$1\"|^cc1: warning: command line option \"$1\" is valid for C\+\+/ObjC\+\+ but not for C|gcc: unrecognized option '$1')" $log >/dev/null 2>&1
fi
[ "$?" = "1" ] && echo $1
fi
fi
rm -f $ccof $log
exit 0

View File

@@ -1,303 +0,0 @@
########################################################################### ###
#@File
#@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
#@License Dual MIT/GPLv2
#
# The contents of this file are subject to the MIT license as set out below.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# Alternatively, the contents of this file may be used under the terms of
# the GNU General Public License Version 2 ("GPL") in which case the provisions
# of GPL are applicable instead of those above.
#
# If you wish to allow use of your version of this file only under the terms of
# GPL, and not to allow others to use your version of this file under the terms
# of the MIT license, indicate your decision by deleting the provisions above
# and replace them with the notice and other provisions required by GPL as set
# out in the file called "GPL-COPYING" included in this distribution. If you do
# not delete the provisions above, a recipient may use your version of this file
# under the terms of either the MIT license or GPL.
#
# This License is also included in this distribution in the file called
# "MIT-COPYING".
#
# EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
# PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
# BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
# PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
### ###########################################################################
# Define the default goal. This masks a previous definition of the default
# goal in config/core.mk, which must match this one
.PHONY: build
build: components
MAKE_TOP := build/linux
THIS_MAKEFILE := (top-level makefiles)
include $(MAKE_TOP)/defs.mk
ifeq ($(OUT),)
$(error Must specify output directory with OUT=)
endif
ifeq ($(TOP),)
$(error Must specify root of source tree with TOP=)
endif
$(call directory-must-exist,$(TOP))
# RELATIVE_OUT is relative only if it's under $(TOP)
RELATIVE_OUT := $(patsubst $(TOP)/%,%,$(OUT))
CONFIG_MK := $(RELATIVE_OUT)/config.mk
CONFIG_H := $(RELATIVE_OUT)/config.h
CONFIG_KERNEL_MK := $(RELATIVE_OUT)/config_kernel.mk
CONFIG_KERNEL_H := $(RELATIVE_OUT)/config_kernel.h
# Convert commas to spaces in $(D). This is so you can say "make
# D=config-changes,freeze-config" and have $(filter config-changes,$(D))
# still work.
comma := ,
empty :=
space := $(empty) $(empty)
override D := $(subst $(comma),$(space),$(D))
ifneq ($(INTERNAL_CLOBBER_ONLY),true)
# Create the out directory
#
$(shell mkdir -p $(OUT))
# If these generated files differ from any pre-existing ones,
# replace them, causing affected parts of the driver to rebuild.
#
_want_config_diff := $(filter config-changes,$(D))
_freeze_config := $(strip $(filter freeze-config,$(D)))
_updated_config_files := $(shell \
$(if $(_want_config_diff),rm -f $(OUT)/config.diff;,) \
for file in $(CONFIG_MK) $(CONFIG_H) \
$(CONFIG_KERNEL_MK) $(CONFIG_KERNEL_H); do \
diff -U 0 $$file $$file.new \
>>$(if $(_want_config_diff),$(OUT)/config.diff,/dev/null) 2>/dev/null \
&& rm -f $$file.new \
|| echo $$file; \
done)
ifneq ($(_want_config_diff),)
# We send the diff to stderr so it isn't captured by $(shell)
$(shell [ -s $(OUT)/config.diff ] && echo >&2 "Configuration changed in $(RELATIVE_OUT):" && cat >&2 $(OUT)/config.diff)
endif
ifneq ($(_freeze_config),)
$(if $(_updated_config_files),$(error Configuration change in $(RELATIVE_OUT) prevented by D=freeze-config),)
endif
# Update the config, if changed
$(foreach _f,$(_updated_config_files), \
$(shell mv -f $(_f).new $(_f) >/dev/null 2>/dev/null))
endif # INTERNAL_CLOBBER_ONLY
MAKEFLAGS := -Rr --no-print-directory
ifneq ($(INTERNAL_CLOBBER_ONLY),true)
# This is so you can say "find $(TOP) -name Linux.mk > /tmp/something; export
# ALL_MAKEFILES=/tmp/something; make" and avoid having to run find. This is
# handy if your source tree is mounted over NFS or something
override ALL_MAKEFILES := $(call relative-to-top,$(if $(strip $(ALL_MAKEFILES)),$(shell cat $(ALL_MAKEFILES)),$(shell find $(TOP) -type f -name Linux.mk -print -o -type d -name '.*' -prune)))
ifeq ($(strip $(ALL_MAKEFILES)),)
$(info ** Unable to find any Linux.mk files under $$(TOP). This could mean that)
$(info ** there are no makefiles, or that ALL_MAKEFILES is set in the environment)
$(info ** and points to a nonexistent or empty file.)
$(error No makefiles)
endif
else # clobber-only
ALL_MAKEFILES :=
endif
unexport ALL_MAKEFILES
REMAINING_MAKEFILES := $(ALL_MAKEFILES)
ALL_MODULES :=
INTERNAL_INCLUDED_ALL_MAKEFILES :=
ALL_LDFLAGS :=
# Please do not change the format of the following lines
-include $(CONFIG_MK)
-include $(CONFIG_KERNEL_MK)
# OK to change now
# If we haven't set host/target archs, set some sensible defaults now.
# This allows things like prune.sh to work
ifeq ($(HOST_PRIMARY_ARCH),)
ifneq ($(FORCE_ARCH),)
HOST_PRIMARY_ARCH := host_x86_64
HOST_32BIT_ARCH := host_i386
_ALL_ARCHS := \
$(filter-out %target_neutral.mk,$(wildcard $(MAKE_TOP)/moduledefs/target_*.mk))
TARGET_PRIMARY_ARCH := \
$(patsubst $(MAKE_TOP)/moduledefs/%.mk,%,$(word 1, $(_ALL_ARCHS)))
TARGET_ALL_ARCH := $(TARGET_PRIMARY_ARCH)
endif
endif
# Output directory for configuration, object code,
# final programs/libraries, and install/rc scripts.
HOST_OUT := $(RELATIVE_OUT)/$(HOST_PRIMARY_ARCH)
HOST_32BIT_OUT := $(RELATIVE_OUT)/$(HOST_32BIT_ARCH)
TARGET_OUT := $(RELATIVE_OUT)/$(TARGET_PRIMARY_ARCH)
TARGET_PRIMARY_OUT := $(RELATIVE_OUT)/$(TARGET_PRIMARY_ARCH)
TARGET_NEUTRAL_OUT := $(RELATIVE_OUT)/target_neutral
BRIDGE_SOURCE_ROOT := $(call if-exists,$(TOP)/generated,$(TARGET_NEUTRAL_OUT)/intermediates)
GENERATED_CODE_OUT := $(TARGET_NEUTRAL_OUT)/intermediates
DOCS_OUT := $(RELATIVE_OUT)/doc
#
# neutrino/subst_makefiles.mk must be included after Output directories have been defined,
# because it overrides BRIDGE_SOURCE_ROOT of bridges to be built. If we include this makefile
# earlier, the value of BRIDGE_SOURCE_ROOT set in neutrino/subst_makefiles.mk will be overwritten.
ifeq ($(SUPPORT_NEUTRINO_PLATFORM),1)
include $(MAKE_TOP)/common/neutrino/subst_makefiles.mk
# neutrino/subst_makefiles.mk overrides ALL_MAKEFILES.
# Set REMAINING_MAKEFILES to the new value of ALL_MAKEFILES
REMAINING_MAKEFILES := $(ALL_MAKEFILES)
endif
# Mark subdirectories of $(OUT) as secondary, and provide rules to create
# them.
OUT_SUBDIRS := $(addprefix $(RELATIVE_OUT)/,$(TARGET_ALL_ARCH)) \
$(TARGET_NEUTRAL_OUT) $(DOCS_OUT) $(if $(HOST_PRIMARY_ARCH),$(sort $(HOST_OUT) $(HOST_32BIT_OUT)))
.SECONDARY: $(OUT_SUBDIRS)
$(OUT_SUBDIRS):
$(make-directory)
ifneq ($(INTERNAL_CLOBBER_ONLY),true)
-include $(MAKE_TOP)/pvrversion.mk
ifeq ($(SUPPORT_BUILD_LWS),1)
-include $(MAKE_TOP)/lwsconf.mk
endif
-include $(MAKE_TOP)/llvm.mk
-include $(MAKE_TOP)/common/bridges.mk
endif
include $(MAKE_TOP)/commands.mk
include $(MAKE_TOP)/buildvars.mk
HOST_INTERMEDIATES := $(HOST_OUT)/intermediates
TARGET_INTERMEDIATES := $(TARGET_OUT)/intermediates
ifneq ($(KERNEL_COMPONENTS),)
build: kbuild
endif
# "make bridges" makes all the modules which are bridges. This is used by
# builds which ship pregenerated bridge headers.
.PHONY: bridges
bridges: $(BRIDGES) $(DIRECT_BRIDGES)
# Include each Linux.mk, then include modules.mk to save some information
# about each module
include $(foreach _Linux.mk,$(ALL_MAKEFILES),$(MAKE_TOP)/this_makefile.mk $(_Linux.mk) $(MAKE_TOP)/modules.mk)
ifeq ($(strip $(REMAINING_MAKEFILES)),)
INTERNAL_INCLUDED_ALL_MAKEFILES := true
else
$(error Impossible: $(words $(REMAINING_MAKEFILES)) makefiles were mysteriously ignored when reading $$(ALL_MAKEFILES))
endif
# At this point, all Linux.mks have been included. Now generate rules to build
# each module: for each module in $(ALL_MODULES), set per-makefile variables
$(foreach _m,$(ALL_MODULES),$(eval $(call process-module,$(_m))))
.PHONY: kbuild install
kbuild install:
ifneq ($(INTERNAL_CLOBBER_ONLY),true)
-include $(MAKE_TOP)/scripts.mk
-include $(MAKE_TOP)/kbuild/kbuild.mk
endif
# We won't depend on 'build' here so that people can build subsets of
# components and still have the install script attempt to install the
# subset.
install:
@if [ ! -d "$(DISCIMAGE)" ]; then \
echo; \
echo "** DISCIMAGE was not set or does not point to a valid directory."; \
echo "** Cannot continue with install."; \
echo; \
exit 1; \
fi
@if [ ! -f $(RELATIVE_OUT)/install.sh ]; then \
echo; \
echo "** install.sh not found in $(RELATIVE_OUT)."; \
echo "** Cannot continue with install."; \
echo; \
exit 1; \
fi
@cd $(RELATIVE_OUT) && ./install.sh
.PHONY: uninstall
uninstall: install_script
uninstall:
@if [ ! -d "$(DISCIMAGE)" ]; then \
echo; \
echo "** DISCIMAGE was not set or does not point to a valid directory."; \
echo "** Cannot continue with uninstall."; \
echo; \
exit 1; \
fi
@if [ ! -f $(RELATIVE_OUT)/install.sh ]; then \
echo; \
echo "** install.sh not found in $(RELATIVE_OUT)."; \
echo "** Cannot continue with uninstall."; \
echo; \
exit 1; \
fi
@cd $(RELATIVE_OUT) && ./install.sh -u
# You can say 'make all_modules' to attempt to make everything, or 'make
# components' to only make the things which are listed (in the per-build
# makefiles) as components of the build.
.PHONY: all_modules all_docs components
all_modules: $(ALL_MODULES)
all_docs: ;
components: $(COMPONENTS)
# Cleaning
.PHONY: clean clobber
clean: MODULE_DIRS_TO_REMOVE := $(OUT_SUBDIRS)
clean:
$(clean-dirs)
clobber: MODULE_DIRS_TO_REMOVE := $(OUT)
clobber:
$(clean-dirs)
# Saying 'make clean-MODULE' removes the intermediates for MODULE.
# clobber-MODULE deletes the output files as well
clean-%:
$(if $(V),,@echo " RM " $(call relative-to-top,$(INTERNAL_CLEAN_TARGETS_FOR_$*)))
$(RM) -rf $(INTERNAL_CLEAN_TARGETS_FOR_$*)
clobber-%:
$(if $(V),,@echo " RM " $(call relative-to-top,$(INTERNAL_CLOBBER_TARGETS_FOR_$*)))
$(RM) -rf $(INTERNAL_CLOBBER_TARGETS_FOR_$*)
include $(MAKE_TOP)/bits.mk
# D=nobuild stops the build before any recipes are run. This line should
# come at the end of this makefile.
$(if $(filter nobuild,$(D)),$(error D=nobuild given),)

View File

@@ -1,39 +0,0 @@
/* SPDX-License-Identifier: GPL-2.0 */
#define SUPPORT_ION
#define PVR_ANDROID_ION_HEADER "../drivers/staging/android/ion/ion.h"
#define PVR_ANDROID_ION_PRIV_HEADER "../drivers/staging/android/ion/ion_priv.h"
#define PVR_ANDROID_ION_USE_SG_LENGTH
#define PVR_ANDROID_SYNC_HEADER "../drivers/staging/android/sync.h"
#define LINUX
#define PVR_BUILD_DIR "generic_arm_android"
#define PVR_BUILD_TYPE "release"
#define PVRSRV_MODNAME "pvrsrvkm"
#define SUPPORT_RGX 1
#define RELEASE
#define RGX_BVNC_CORE_KM_HEADER "cores/rgxcore_km_5.9.1.46.h"
#define RGX_BNC_CONFIG_KM_HEADER "configs/rgxconfig_km_5.V.1.46.h"
#define SUPPORT_DBGDRV_EVENT_OBJECTS
#define PDUMP_STREAMBUF_MAX_SIZE_MB 16
#define SYS_USING_INTERRUPTS
#define CACHEFLUSH_TYPE CACHEFLUSH_GENERIC
#define SUPPORT_SECURE_EXPORT
#define SUPPORT_GPUTRACE_EVENTS
#define GPUVIRT_VALIDATION_NUM_OS 8
#define SUPPORT_LINUX_X86_WRITECOMBINE
#define SUPPORT_LINUX_X86_PAT
#define PVR_LINUX_USING_WORKQUEUES
#define PVR_LINUX_MISR_USING_PRIVATE_WORKQUEUE
#define PVR_LINUX_TIMERS_USING_WORKQUEUES
#define PVR_LDM_PLATFORM_PRE_REGISTERED
#define PVR_LDM_DRIVER_REGISTRATION_NAME "pvrsrvkm"
#define LDM_PLATFORM
#define PVRSRV_FULL_SYNC_TRACKING_HISTORY_LEN 256
#define SUPPORT_PERCONTEXT_FREELIST
#define PVRSRV_ENABLE_PROCESS_STATS
#define PVR_LINUX_PHYSMEM_MAX_POOL_PAGES 10240
#define PVR_LINUX_ARM_PAGEALLOC_FLUSH_THRESHOLD 256
#define PVR_LINUX_PHYSMEM_MIN_NUM_PAGES 256
#define PVR_LINUX_PHYSMEM_MAX_ALLOC_ORDER 2
#define PVR_LINUX_KMALLOC_ALLOCATION_THRESHOLD 16384
#define ANDROID
#define SUPPORT_NATIVE_FENCE_SYNC

View File

@@ -1,27 +0,0 @@
# SPDX-License-Identifier: GPL-2.0
override HOST_PRIMARY_ARCH := host_x86_64
override HOST_32BIT_ARCH := host_i386
override HOST_FORCE_32BIT := -m32
override TARGET_PRIMARY_ARCH := target_aarch64
override TARGET_SECONDARY_ARCH := target_armv7-a
override TARGET_ALL_ARCH := target_aarch64 target_armv7-a
override TARGET_FORCE_32BIT :=
override KERNELDIR := /work/zxl/project/rk3368_6.0/kernel
override KERNEL_ID := 3.10.0
override KERNEL_COMPONENTS := srvkm
override KERNEL_CROSS_COMPILE := aarch64-linux-android-
override SUPPORT_ION := 1
override PVRSRV_MODNAME := pvrsrvkm
override PVR_BUILD_DIR := generic_arm_android
override PVR_BUILD_TYPE := release
override PVR_SYSTEM := rk3368
override PVR_LOADER :=
override BUILD := release
override DEBUGLINK := 1
override CACHEFLUSH_TYPE := CACHEFLUSH_GENERIC
override SUPPORT_SECURE_EXPORT := 1
override SUPPORT_GPUTRACE_EVENTS := 1
override OPTIM := -O2
override PVR_HANDLE_BACKEND := idr
override SUPPORT_ANDROID_PLATFORM := 1
override SUPPORT_NATIVE_FENCE_SYNC := 1

View File

@@ -1,158 +0,0 @@
/*************************************************************************/ /*!
@File
@Title Common bridge header for breakpoint
@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
@Description Declares common defines and structures that are used by both
the client and sever side of the bridge for breakpoint
@License Dual MIT/GPLv2
The contents of this file are subject to the MIT license as set out below.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
Alternatively, the contents of this file may be used under the terms of
the GNU General Public License Version 2 ("GPL") in which case the provisions
of GPL are applicable instead of those above.
If you wish to allow use of your version of this file only under the terms of
GPL, and not to allow others to use your version of this file under the terms
of the MIT license, indicate your decision by deleting the provisions above
and replace them with the notice and other provisions required by GPL as set
out in the file called "GPL-COPYING" included in this distribution. If you do
not delete the provisions above, a recipient may use your version of this file
under the terms of either the MIT license or GPL.
This License is also included in this distribution in the file called
"MIT-COPYING".
EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ /**************************************************************************/
#ifndef COMMON_BREAKPOINT_BRIDGE_H
#define COMMON_BREAKPOINT_BRIDGE_H
#include "img_types.h"
#include "pvrsrv_error.h"
#include "rgx_bridge.h"
#define PVRSRV_BRIDGE_BREAKPOINT_CMD_FIRST 0
#define PVRSRV_BRIDGE_BREAKPOINT_RGXSETBREAKPOINT PVRSRV_BRIDGE_BREAKPOINT_CMD_FIRST+0
#define PVRSRV_BRIDGE_BREAKPOINT_RGXCLEARBREAKPOINT PVRSRV_BRIDGE_BREAKPOINT_CMD_FIRST+1
#define PVRSRV_BRIDGE_BREAKPOINT_RGXENABLEBREAKPOINT PVRSRV_BRIDGE_BREAKPOINT_CMD_FIRST+2
#define PVRSRV_BRIDGE_BREAKPOINT_RGXDISABLEBREAKPOINT PVRSRV_BRIDGE_BREAKPOINT_CMD_FIRST+3
#define PVRSRV_BRIDGE_BREAKPOINT_RGXOVERALLOCATEBPREGISTERS PVRSRV_BRIDGE_BREAKPOINT_CMD_FIRST+4
#define PVRSRV_BRIDGE_BREAKPOINT_CMD_LAST (PVRSRV_BRIDGE_BREAKPOINT_CMD_FIRST+4)
/*******************************************
RGXSetBreakpoint
*******************************************/
/* Bridge in structure for RGXSetBreakpoint */
typedef struct PVRSRV_BRIDGE_IN_RGXSETBREAKPOINT_TAG
{
IMG_HANDLE hDevNode;
IMG_HANDLE hPrivData;
IMG_UINT32 eFWDataMaster;
IMG_UINT32 ui32BreakpointAddr;
IMG_UINT32 ui32HandlerAddr;
IMG_UINT32 ui32DM;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXSETBREAKPOINT;
/* Bridge out structure for RGXSetBreakpoint */
typedef struct PVRSRV_BRIDGE_OUT_RGXSETBREAKPOINT_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXSETBREAKPOINT;
/*******************************************
RGXClearBreakpoint
*******************************************/
/* Bridge in structure for RGXClearBreakpoint */
typedef struct PVRSRV_BRIDGE_IN_RGXCLEARBREAKPOINT_TAG
{
IMG_HANDLE hDevNode;
IMG_HANDLE hPrivData;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXCLEARBREAKPOINT;
/* Bridge out structure for RGXClearBreakpoint */
typedef struct PVRSRV_BRIDGE_OUT_RGXCLEARBREAKPOINT_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXCLEARBREAKPOINT;
/*******************************************
RGXEnableBreakpoint
*******************************************/
/* Bridge in structure for RGXEnableBreakpoint */
typedef struct PVRSRV_BRIDGE_IN_RGXENABLEBREAKPOINT_TAG
{
IMG_HANDLE hDevNode;
IMG_HANDLE hPrivData;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXENABLEBREAKPOINT;
/* Bridge out structure for RGXEnableBreakpoint */
typedef struct PVRSRV_BRIDGE_OUT_RGXENABLEBREAKPOINT_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXENABLEBREAKPOINT;
/*******************************************
RGXDisableBreakpoint
*******************************************/
/* Bridge in structure for RGXDisableBreakpoint */
typedef struct PVRSRV_BRIDGE_IN_RGXDISABLEBREAKPOINT_TAG
{
IMG_HANDLE hDevNode;
IMG_HANDLE hPrivData;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXDISABLEBREAKPOINT;
/* Bridge out structure for RGXDisableBreakpoint */
typedef struct PVRSRV_BRIDGE_OUT_RGXDISABLEBREAKPOINT_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXDISABLEBREAKPOINT;
/*******************************************
RGXOverallocateBPRegisters
*******************************************/
/* Bridge in structure for RGXOverallocateBPRegisters */
typedef struct PVRSRV_BRIDGE_IN_RGXOVERALLOCATEBPREGISTERS_TAG
{
IMG_HANDLE hDevNode;
IMG_UINT32 ui32TempRegs;
IMG_UINT32 ui32SharedRegs;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXOVERALLOCATEBPREGISTERS;
/* Bridge out structure for RGXOverallocateBPRegisters */
typedef struct PVRSRV_BRIDGE_OUT_RGXOVERALLOCATEBPREGISTERS_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXOVERALLOCATEBPREGISTERS;
#endif /* COMMON_BREAKPOINT_BRIDGE_H */

View File

@@ -1,392 +0,0 @@
/*************************************************************************/ /*!
@File
@Title Server bridge for breakpoint
@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
@Description Implements the server side of the bridge for breakpoint
@License Dual MIT/GPLv2
The contents of this file are subject to the MIT license as set out below.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
Alternatively, the contents of this file may be used under the terms of
the GNU General Public License Version 2 ("GPL") in which case the provisions
of GPL are applicable instead of those above.
If you wish to allow use of your version of this file only under the terms of
GPL, and not to allow others to use your version of this file under the terms
of the MIT license, indicate your decision by deleting the provisions above
and replace them with the notice and other provisions required by GPL as set
out in the file called "GPL-COPYING" included in this distribution. If you do
not delete the provisions above, a recipient may use your version of this file
under the terms of either the MIT license or GPL.
This License is also included in this distribution in the file called
"MIT-COPYING".
EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ /**************************************************************************/
#include <stddef.h>
#include <linux/uaccess.h>
#include "img_defs.h"
#include "rgxbreakpoint.h"
#include "common_breakpoint_bridge.h"
#include "allocmem.h"
#include "pvr_debug.h"
#include "connection_server.h"
#include "pvr_bridge.h"
#include "rgx_bridge.h"
#include "srvcore.h"
#include "handle.h"
#if defined (SUPPORT_AUTH)
#include "osauth.h"
#endif
#include <linux/slab.h>
/* ***************************************************************************
* Server-side bridge entry points
*/
static IMG_INT
PVRSRVBridgeRGXSetBreakpoint(IMG_UINT32 ui32DispatchTableEntry,
PVRSRV_BRIDGE_IN_RGXSETBREAKPOINT *psRGXSetBreakpointIN,
PVRSRV_BRIDGE_OUT_RGXSETBREAKPOINT *psRGXSetBreakpointOUT,
CONNECTION_DATA *psConnection)
{
IMG_HANDLE hDevNodeInt = IMG_NULL;
IMG_HANDLE hPrivDataInt = IMG_NULL;
{
/* Look up the address from the handle */
psRGXSetBreakpointOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_VOID **) &hDevNodeInt,
psRGXSetBreakpointIN->hDevNode,
PVRSRV_HANDLE_TYPE_DEV_NODE);
if(psRGXSetBreakpointOUT->eError != PVRSRV_OK)
{
goto RGXSetBreakpoint_exit;
}
}
{
/* Look up the address from the handle */
psRGXSetBreakpointOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_VOID **) &hPrivDataInt,
psRGXSetBreakpointIN->hPrivData,
PVRSRV_HANDLE_TYPE_DEV_PRIV_DATA);
if(psRGXSetBreakpointOUT->eError != PVRSRV_OK)
{
goto RGXSetBreakpoint_exit;
}
}
psRGXSetBreakpointOUT->eError =
PVRSRVRGXSetBreakpointKM(
hDevNodeInt,
hPrivDataInt,
psRGXSetBreakpointIN->eFWDataMaster,
psRGXSetBreakpointIN->ui32BreakpointAddr,
psRGXSetBreakpointIN->ui32HandlerAddr,
psRGXSetBreakpointIN->ui32DM);
RGXSetBreakpoint_exit:
return 0;
}
static IMG_INT
PVRSRVBridgeRGXClearBreakpoint(IMG_UINT32 ui32DispatchTableEntry,
PVRSRV_BRIDGE_IN_RGXCLEARBREAKPOINT *psRGXClearBreakpointIN,
PVRSRV_BRIDGE_OUT_RGXCLEARBREAKPOINT *psRGXClearBreakpointOUT,
CONNECTION_DATA *psConnection)
{
IMG_HANDLE hDevNodeInt = IMG_NULL;
IMG_HANDLE hPrivDataInt = IMG_NULL;
{
/* Look up the address from the handle */
psRGXClearBreakpointOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_VOID **) &hDevNodeInt,
psRGXClearBreakpointIN->hDevNode,
PVRSRV_HANDLE_TYPE_DEV_NODE);
if(psRGXClearBreakpointOUT->eError != PVRSRV_OK)
{
goto RGXClearBreakpoint_exit;
}
}
{
/* Look up the address from the handle */
psRGXClearBreakpointOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_VOID **) &hPrivDataInt,
psRGXClearBreakpointIN->hPrivData,
PVRSRV_HANDLE_TYPE_DEV_PRIV_DATA);
if(psRGXClearBreakpointOUT->eError != PVRSRV_OK)
{
goto RGXClearBreakpoint_exit;
}
}
psRGXClearBreakpointOUT->eError =
PVRSRVRGXClearBreakpointKM(
hDevNodeInt,
hPrivDataInt);
RGXClearBreakpoint_exit:
return 0;
}
static IMG_INT
PVRSRVBridgeRGXEnableBreakpoint(IMG_UINT32 ui32DispatchTableEntry,
PVRSRV_BRIDGE_IN_RGXENABLEBREAKPOINT *psRGXEnableBreakpointIN,
PVRSRV_BRIDGE_OUT_RGXENABLEBREAKPOINT *psRGXEnableBreakpointOUT,
CONNECTION_DATA *psConnection)
{
IMG_HANDLE hDevNodeInt = IMG_NULL;
IMG_HANDLE hPrivDataInt = IMG_NULL;
{
/* Look up the address from the handle */
psRGXEnableBreakpointOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_VOID **) &hDevNodeInt,
psRGXEnableBreakpointIN->hDevNode,
PVRSRV_HANDLE_TYPE_DEV_NODE);
if(psRGXEnableBreakpointOUT->eError != PVRSRV_OK)
{
goto RGXEnableBreakpoint_exit;
}
}
{
/* Look up the address from the handle */
psRGXEnableBreakpointOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_VOID **) &hPrivDataInt,
psRGXEnableBreakpointIN->hPrivData,
PVRSRV_HANDLE_TYPE_DEV_PRIV_DATA);
if(psRGXEnableBreakpointOUT->eError != PVRSRV_OK)
{
goto RGXEnableBreakpoint_exit;
}
}
psRGXEnableBreakpointOUT->eError =
PVRSRVRGXEnableBreakpointKM(
hDevNodeInt,
hPrivDataInt);
RGXEnableBreakpoint_exit:
return 0;
}
static IMG_INT
PVRSRVBridgeRGXDisableBreakpoint(IMG_UINT32 ui32DispatchTableEntry,
PVRSRV_BRIDGE_IN_RGXDISABLEBREAKPOINT *psRGXDisableBreakpointIN,
PVRSRV_BRIDGE_OUT_RGXDISABLEBREAKPOINT *psRGXDisableBreakpointOUT,
CONNECTION_DATA *psConnection)
{
IMG_HANDLE hDevNodeInt = IMG_NULL;
IMG_HANDLE hPrivDataInt = IMG_NULL;
{
/* Look up the address from the handle */
psRGXDisableBreakpointOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_VOID **) &hDevNodeInt,
psRGXDisableBreakpointIN->hDevNode,
PVRSRV_HANDLE_TYPE_DEV_NODE);
if(psRGXDisableBreakpointOUT->eError != PVRSRV_OK)
{
goto RGXDisableBreakpoint_exit;
}
}
{
/* Look up the address from the handle */
psRGXDisableBreakpointOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_VOID **) &hPrivDataInt,
psRGXDisableBreakpointIN->hPrivData,
PVRSRV_HANDLE_TYPE_DEV_PRIV_DATA);
if(psRGXDisableBreakpointOUT->eError != PVRSRV_OK)
{
goto RGXDisableBreakpoint_exit;
}
}
psRGXDisableBreakpointOUT->eError =
PVRSRVRGXDisableBreakpointKM(
hDevNodeInt,
hPrivDataInt);
RGXDisableBreakpoint_exit:
return 0;
}
static IMG_INT
PVRSRVBridgeRGXOverallocateBPRegisters(IMG_UINT32 ui32DispatchTableEntry,
PVRSRV_BRIDGE_IN_RGXOVERALLOCATEBPREGISTERS *psRGXOverallocateBPRegistersIN,
PVRSRV_BRIDGE_OUT_RGXOVERALLOCATEBPREGISTERS *psRGXOverallocateBPRegistersOUT,
CONNECTION_DATA *psConnection)
{
IMG_HANDLE hDevNodeInt = IMG_NULL;
{
/* Look up the address from the handle */
psRGXOverallocateBPRegistersOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_VOID **) &hDevNodeInt,
psRGXOverallocateBPRegistersIN->hDevNode,
PVRSRV_HANDLE_TYPE_DEV_NODE);
if(psRGXOverallocateBPRegistersOUT->eError != PVRSRV_OK)
{
goto RGXOverallocateBPRegisters_exit;
}
}
psRGXOverallocateBPRegistersOUT->eError =
PVRSRVRGXOverallocateBPRegistersKM(
hDevNodeInt,
psRGXOverallocateBPRegistersIN->ui32TempRegs,
psRGXOverallocateBPRegistersIN->ui32SharedRegs);
RGXOverallocateBPRegisters_exit:
return 0;
}
/* ***************************************************************************
* Server bridge dispatch related glue
*/
PVRSRV_ERROR InitBREAKPOINTBridge(IMG_VOID);
PVRSRV_ERROR DeinitBREAKPOINTBridge(IMG_VOID);
/*
* Register all BREAKPOINT functions with services
*/
PVRSRV_ERROR InitBREAKPOINTBridge(IMG_VOID)
{
SetDispatchTableEntry(PVRSRV_BRIDGE_BREAKPOINT, PVRSRV_BRIDGE_BREAKPOINT_RGXSETBREAKPOINT, PVRSRVBridgeRGXSetBreakpoint,
IMG_NULL, IMG_NULL,
0, 0);
SetDispatchTableEntry(PVRSRV_BRIDGE_BREAKPOINT, PVRSRV_BRIDGE_BREAKPOINT_RGXCLEARBREAKPOINT, PVRSRVBridgeRGXClearBreakpoint,
IMG_NULL, IMG_NULL,
0, 0);
SetDispatchTableEntry(PVRSRV_BRIDGE_BREAKPOINT, PVRSRV_BRIDGE_BREAKPOINT_RGXENABLEBREAKPOINT, PVRSRVBridgeRGXEnableBreakpoint,
IMG_NULL, IMG_NULL,
0, 0);
SetDispatchTableEntry(PVRSRV_BRIDGE_BREAKPOINT, PVRSRV_BRIDGE_BREAKPOINT_RGXDISABLEBREAKPOINT, PVRSRVBridgeRGXDisableBreakpoint,
IMG_NULL, IMG_NULL,
0, 0);
SetDispatchTableEntry(PVRSRV_BRIDGE_BREAKPOINT, PVRSRV_BRIDGE_BREAKPOINT_RGXOVERALLOCATEBPREGISTERS, PVRSRVBridgeRGXOverallocateBPRegisters,
IMG_NULL, IMG_NULL,
0, 0);
return PVRSRV_OK;
}
/*
* Unregister all breakpoint functions with services
*/
PVRSRV_ERROR DeinitBREAKPOINTBridge(IMG_VOID)
{
return PVRSRV_OK;
}

View File

@@ -1,76 +0,0 @@
/*************************************************************************/ /*!
@File
@Title Common bridge header for cachegeneric
@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
@Description Declares common defines and structures that are used by both
the client and sever side of the bridge for cachegeneric
@License Dual MIT/GPLv2
The contents of this file are subject to the MIT license as set out below.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
Alternatively, the contents of this file may be used under the terms of
the GNU General Public License Version 2 ("GPL") in which case the provisions
of GPL are applicable instead of those above.
If you wish to allow use of your version of this file only under the terms of
GPL, and not to allow others to use your version of this file under the terms
of the MIT license, indicate your decision by deleting the provisions above
and replace them with the notice and other provisions required by GPL as set
out in the file called "GPL-COPYING" included in this distribution. If you do
not delete the provisions above, a recipient may use your version of this file
under the terms of either the MIT license or GPL.
This License is also included in this distribution in the file called
"MIT-COPYING".
EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ /**************************************************************************/
#ifndef COMMON_CACHEGENERIC_BRIDGE_H
#define COMMON_CACHEGENERIC_BRIDGE_H
#include "img_types.h"
#include "pvrsrv_error.h"
#include "cache_external.h"
#define PVRSRV_BRIDGE_CACHEGENERIC_CMD_FIRST 0
#define PVRSRV_BRIDGE_CACHEGENERIC_CACHEOPQUEUE PVRSRV_BRIDGE_CACHEGENERIC_CMD_FIRST+0
#define PVRSRV_BRIDGE_CACHEGENERIC_CMD_LAST (PVRSRV_BRIDGE_CACHEGENERIC_CMD_FIRST+0)
/*******************************************
CacheOpQueue
*******************************************/
/* Bridge in structure for CacheOpQueue */
typedef struct PVRSRV_BRIDGE_IN_CACHEOPQUEUE_TAG
{
PVRSRV_CACHE_OP iuCacheOp;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_CACHEOPQUEUE;
/* Bridge out structure for CacheOpQueue */
typedef struct PVRSRV_BRIDGE_OUT_CACHEOPQUEUE_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_CACHEOPQUEUE;
#endif /* COMMON_CACHEGENERIC_BRIDGE_H */

View File

@@ -1,131 +0,0 @@
/*************************************************************************/ /*!
@File
@Title Server bridge for cachegeneric
@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
@Description Implements the server side of the bridge for cachegeneric
@License Dual MIT/GPLv2
The contents of this file are subject to the MIT license as set out below.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
Alternatively, the contents of this file may be used under the terms of
the GNU General Public License Version 2 ("GPL") in which case the provisions
of GPL are applicable instead of those above.
If you wish to allow use of your version of this file only under the terms of
GPL, and not to allow others to use your version of this file under the terms
of the MIT license, indicate your decision by deleting the provisions above
and replace them with the notice and other provisions required by GPL as set
out in the file called "GPL-COPYING" included in this distribution. If you do
not delete the provisions above, a recipient may use your version of this file
under the terms of either the MIT license or GPL.
This License is also included in this distribution in the file called
"MIT-COPYING".
EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ /**************************************************************************/
#include <stddef.h>
#include <linux/uaccess.h>
#include "img_defs.h"
#include "cache_generic.h"
#include "common_cachegeneric_bridge.h"
#include "allocmem.h"
#include "pvr_debug.h"
#include "connection_server.h"
#include "pvr_bridge.h"
#include "rgx_bridge.h"
#include "srvcore.h"
#include "handle.h"
#if defined (SUPPORT_AUTH)
#include "osauth.h"
#endif
#include <linux/slab.h>
/* ***************************************************************************
* Server-side bridge entry points
*/
static IMG_INT
PVRSRVBridgeCacheOpQueue(IMG_UINT32 ui32DispatchTableEntry,
PVRSRV_BRIDGE_IN_CACHEOPQUEUE *psCacheOpQueueIN,
PVRSRV_BRIDGE_OUT_CACHEOPQUEUE *psCacheOpQueueOUT,
CONNECTION_DATA *psConnection)
{
PVR_UNREFERENCED_PARAMETER(psConnection);
psCacheOpQueueOUT->eError =
CacheOpQueue(
psCacheOpQueueIN->iuCacheOp);
return 0;
}
/* ***************************************************************************
* Server bridge dispatch related glue
*/
PVRSRV_ERROR InitCACHEGENERICBridge(IMG_VOID);
PVRSRV_ERROR DeinitCACHEGENERICBridge(IMG_VOID);
/*
* Register all CACHEGENERIC functions with services
*/
PVRSRV_ERROR InitCACHEGENERICBridge(IMG_VOID)
{
SetDispatchTableEntry(PVRSRV_BRIDGE_CACHEGENERIC, PVRSRV_BRIDGE_CACHEGENERIC_CACHEOPQUEUE, PVRSRVBridgeCacheOpQueue,
IMG_NULL, IMG_NULL,
0, 0);
return PVRSRV_OK;
}
/*
* Unregister all cachegeneric functions with services
*/
PVRSRV_ERROR DeinitCACHEGENERICBridge(IMG_VOID)
{
return PVRSRV_OK;
}

View File

@@ -1,115 +0,0 @@
/*************************************************************************/ /*!
@File
@Title Common bridge header for cmm
@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
@Description Declares common defines and structures that are used by both
the client and sever side of the bridge for cmm
@License Dual MIT/GPLv2
The contents of this file are subject to the MIT license as set out below.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
Alternatively, the contents of this file may be used under the terms of
the GNU General Public License Version 2 ("GPL") in which case the provisions
of GPL are applicable instead of those above.
If you wish to allow use of your version of this file only under the terms of
GPL, and not to allow others to use your version of this file under the terms
of the MIT license, indicate your decision by deleting the provisions above
and replace them with the notice and other provisions required by GPL as set
out in the file called "GPL-COPYING" included in this distribution. If you do
not delete the provisions above, a recipient may use your version of this file
under the terms of either the MIT license or GPL.
This License is also included in this distribution in the file called
"MIT-COPYING".
EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ /**************************************************************************/
#ifndef COMMON_CMM_BRIDGE_H
#define COMMON_CMM_BRIDGE_H
#include "img_types.h"
#include "pvrsrv_error.h"
#include "devicemem_typedefs.h"
#define PVRSRV_BRIDGE_CMM_CMD_FIRST 0
#define PVRSRV_BRIDGE_CMM_DEVMEMINTCTXEXPORT PVRSRV_BRIDGE_CMM_CMD_FIRST+0
#define PVRSRV_BRIDGE_CMM_DEVMEMINTCTXUNEXPORT PVRSRV_BRIDGE_CMM_CMD_FIRST+1
#define PVRSRV_BRIDGE_CMM_DEVMEMINTCTXIMPORT PVRSRV_BRIDGE_CMM_CMD_FIRST+2
#define PVRSRV_BRIDGE_CMM_CMD_LAST (PVRSRV_BRIDGE_CMM_CMD_FIRST+2)
/*******************************************
DevmemIntCtxExport
*******************************************/
/* Bridge in structure for DevmemIntCtxExport */
typedef struct PVRSRV_BRIDGE_IN_DEVMEMINTCTXEXPORT_TAG
{
IMG_HANDLE hDevMemServerContext;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_DEVMEMINTCTXEXPORT;
/* Bridge out structure for DevmemIntCtxExport */
typedef struct PVRSRV_BRIDGE_OUT_DEVMEMINTCTXEXPORT_TAG
{
IMG_HANDLE hDevMemIntCtxExport;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DEVMEMINTCTXEXPORT;
/*******************************************
DevmemIntCtxUnexport
*******************************************/
/* Bridge in structure for DevmemIntCtxUnexport */
typedef struct PVRSRV_BRIDGE_IN_DEVMEMINTCTXUNEXPORT_TAG
{
IMG_HANDLE hDevMemIntCtxExport;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_DEVMEMINTCTXUNEXPORT;
/* Bridge out structure for DevmemIntCtxUnexport */
typedef struct PVRSRV_BRIDGE_OUT_DEVMEMINTCTXUNEXPORT_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DEVMEMINTCTXUNEXPORT;
/*******************************************
DevmemIntCtxImport
*******************************************/
/* Bridge in structure for DevmemIntCtxImport */
typedef struct PVRSRV_BRIDGE_IN_DEVMEMINTCTXIMPORT_TAG
{
IMG_HANDLE hDevMemIntCtxExport;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_DEVMEMINTCTXIMPORT;
/* Bridge out structure for DevmemIntCtxImport */
typedef struct PVRSRV_BRIDGE_OUT_DEVMEMINTCTXIMPORT_TAG
{
IMG_HANDLE hDevMemServerContext;
IMG_HANDLE hPrivData;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DEVMEMINTCTXIMPORT;
#endif /* COMMON_CMM_BRIDGE_H */

View File

@@ -1,393 +0,0 @@
/*************************************************************************/ /*!
@File
@Title Server bridge for cmm
@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
@Description Implements the server side of the bridge for cmm
@License Dual MIT/GPLv2
The contents of this file are subject to the MIT license as set out below.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
Alternatively, the contents of this file may be used under the terms of
the GNU General Public License Version 2 ("GPL") in which case the provisions
of GPL are applicable instead of those above.
If you wish to allow use of your version of this file only under the terms of
GPL, and not to allow others to use your version of this file under the terms
of the MIT license, indicate your decision by deleting the provisions above
and replace them with the notice and other provisions required by GPL as set
out in the file called "GPL-COPYING" included in this distribution. If you do
not delete the provisions above, a recipient may use your version of this file
under the terms of either the MIT license or GPL.
This License is also included in this distribution in the file called
"MIT-COPYING".
EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ /**************************************************************************/
#include <stddef.h>
#include <linux/uaccess.h>
#include "img_defs.h"
#include "pmr.h"
#include "devicemem_server.h"
#include "common_cmm_bridge.h"
#include "allocmem.h"
#include "pvr_debug.h"
#include "connection_server.h"
#include "pvr_bridge.h"
#include "rgx_bridge.h"
#include "srvcore.h"
#include "handle.h"
#if defined (SUPPORT_AUTH)
#include "osauth.h"
#endif
#include <linux/slab.h>
static PVRSRV_ERROR ReleaseDevMemIntCtxExport(IMG_VOID *pvData)
{
PVR_UNREFERENCED_PARAMETER(pvData);
return PVRSRV_OK;
}
/* ***************************************************************************
* Server-side bridge entry points
*/
static IMG_INT
PVRSRVBridgeDevmemIntCtxExport(IMG_UINT32 ui32DispatchTableEntry,
PVRSRV_BRIDGE_IN_DEVMEMINTCTXEXPORT *psDevmemIntCtxExportIN,
PVRSRV_BRIDGE_OUT_DEVMEMINTCTXEXPORT *psDevmemIntCtxExportOUT,
CONNECTION_DATA *psConnection)
{
DEVMEMINT_CTX * psDevMemServerContextInt = IMG_NULL;
DEVMEMINT_CTX_EXPORT * psDevMemIntCtxExportInt = IMG_NULL;
IMG_HANDLE hDevMemIntCtxExportInt = IMG_NULL;
{
/* Look up the address from the handle */
psDevmemIntCtxExportOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_VOID **) &psDevMemServerContextInt,
psDevmemIntCtxExportIN->hDevMemServerContext,
PVRSRV_HANDLE_TYPE_DEVMEMINT_CTX);
if(psDevmemIntCtxExportOUT->eError != PVRSRV_OK)
{
goto DevmemIntCtxExport_exit;
}
}
psDevmemIntCtxExportOUT->eError =
DevmemIntCtxExport(
psDevMemServerContextInt,
&psDevMemIntCtxExportInt);
/* Exit early if bridged call fails */
if(psDevmemIntCtxExportOUT->eError != PVRSRV_OK)
{
goto DevmemIntCtxExport_exit;
}
/*
* For cases where we need a cross process handle we actually allocate two.
*
* The first one is a connection specific handle and it gets given the real
* release function. This handle does *NOT* get returned to the caller. It's
* purpose is to release any leaked resources when we either have a bad or
* abnormally terminated client. If we didn't do this then the resource
* wouldn't be freed until driver unload. If the resource is freed normally,
* this handle can be looked up via the cross process handle and then
* released accordingly.
*
* The second one is a cross process handle and it gets given a noop release
* function. This handle does get returned to the caller.
*/
psDevmemIntCtxExportOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase,
&hDevMemIntCtxExportInt,
(IMG_VOID *) psDevMemIntCtxExportInt,
PVRSRV_HANDLE_TYPE_DEVMEMINT_CTX_EXPORT,
PVRSRV_HANDLE_ALLOC_FLAG_SHARED
,(PFN_HANDLE_RELEASE)&DevmemIntCtxUnexport);
if (psDevmemIntCtxExportOUT->eError != PVRSRV_OK)
{
goto DevmemIntCtxExport_exit;
}
psDevmemIntCtxExportOUT->eError = PVRSRVAllocHandle(KERNEL_HANDLE_BASE,
&psDevmemIntCtxExportOUT->hDevMemIntCtxExport,
(IMG_VOID *) psDevMemIntCtxExportInt,
PVRSRV_HANDLE_TYPE_DEVMEMINT_CTX_EXPORT,
PVRSRV_HANDLE_ALLOC_FLAG_MULTI,
(PFN_HANDLE_RELEASE)&ReleaseDevMemIntCtxExport);
if (psDevmemIntCtxExportOUT->eError != PVRSRV_OK)
{
goto DevmemIntCtxExport_exit;
}
DevmemIntCtxExport_exit:
if (psDevmemIntCtxExportOUT->eError != PVRSRV_OK)
{
if (psDevmemIntCtxExportOUT->hDevMemIntCtxExport)
{
PVRSRV_ERROR eError = PVRSRVReleaseHandle(KERNEL_HANDLE_BASE,
(IMG_HANDLE) psDevmemIntCtxExportOUT->hDevMemIntCtxExport,
PVRSRV_HANDLE_TYPE_DEVMEMINT_CTX_EXPORT);
/* Releasing the handle should free/destroy/release the resource. This should never fail... */
PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY));
}
if (hDevMemIntCtxExportInt)
{
PVRSRV_ERROR eError = PVRSRVReleaseHandle(psConnection->psHandleBase,
hDevMemIntCtxExportInt,
PVRSRV_HANDLE_TYPE_DEVMEMINT_CTX_EXPORT);
/* Releasing the handle should free/destroy/release the resource. This should never fail... */
PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY));
/* Avoid freeing/destroying/releasing the resource a second time below */
psDevMemIntCtxExportInt = IMG_NULL;
}
if (psDevMemIntCtxExportInt)
{
DevmemIntCtxUnexport(psDevMemIntCtxExportInt);
}
}
return 0;
}
static IMG_INT
PVRSRVBridgeDevmemIntCtxUnexport(IMG_UINT32 ui32DispatchTableEntry,
PVRSRV_BRIDGE_IN_DEVMEMINTCTXUNEXPORT *psDevmemIntCtxUnexportIN,
PVRSRV_BRIDGE_OUT_DEVMEMINTCTXUNEXPORT *psDevmemIntCtxUnexportOUT,
CONNECTION_DATA *psConnection)
{
DEVMEMINT_CTX_EXPORT * psDevMemIntCtxExportInt = IMG_NULL;
IMG_HANDLE hDevMemIntCtxExportInt = IMG_NULL;
PVR_UNREFERENCED_PARAMETER(psConnection);
psDevmemIntCtxUnexportOUT->eError =
PVRSRVLookupHandle(KERNEL_HANDLE_BASE,
(IMG_VOID **) &psDevMemIntCtxExportInt,
(IMG_HANDLE) psDevmemIntCtxUnexportIN->hDevMemIntCtxExport,
PVRSRV_HANDLE_TYPE_DEVMEMINT_CTX_EXPORT);
PVR_ASSERT(psDevmemIntCtxUnexportOUT->eError == PVRSRV_OK);
/*
* Find the connection specific handle that represents the same data
* as the cross process handle as releasing it will actually call the
* data's real release function (see the function where the cross
* process handle is allocated for more details).
*/
psDevmemIntCtxUnexportOUT->eError =
PVRSRVFindHandle(psConnection->psHandleBase,
&hDevMemIntCtxExportInt,
psDevMemIntCtxExportInt,
PVRSRV_HANDLE_TYPE_DEVMEMINT_CTX_EXPORT);
PVR_ASSERT(psDevmemIntCtxUnexportOUT->eError == PVRSRV_OK);
psDevmemIntCtxUnexportOUT->eError =
PVRSRVReleaseHandle(psConnection->psHandleBase,
hDevMemIntCtxExportInt,
PVRSRV_HANDLE_TYPE_DEVMEMINT_CTX_EXPORT);
PVR_ASSERT((psDevmemIntCtxUnexportOUT->eError == PVRSRV_OK) || (psDevmemIntCtxUnexportOUT->eError == PVRSRV_ERROR_RETRY));
psDevmemIntCtxUnexportOUT->eError =
PVRSRVReleaseHandle(KERNEL_HANDLE_BASE,
(IMG_HANDLE) psDevmemIntCtxUnexportIN->hDevMemIntCtxExport,
PVRSRV_HANDLE_TYPE_DEVMEMINT_CTX_EXPORT);
if ((psDevmemIntCtxUnexportOUT->eError != PVRSRV_OK) && (psDevmemIntCtxUnexportOUT->eError != PVRSRV_ERROR_RETRY))
{
PVR_ASSERT(0);
goto DevmemIntCtxUnexport_exit;
}
DevmemIntCtxUnexport_exit:
return 0;
}
static IMG_INT
PVRSRVBridgeDevmemIntCtxImport(IMG_UINT32 ui32DispatchTableEntry,
PVRSRV_BRIDGE_IN_DEVMEMINTCTXIMPORT *psDevmemIntCtxImportIN,
PVRSRV_BRIDGE_OUT_DEVMEMINTCTXIMPORT *psDevmemIntCtxImportOUT,
CONNECTION_DATA *psConnection)
{
DEVMEMINT_CTX_EXPORT * psDevMemIntCtxExportInt = IMG_NULL;
DEVMEMINT_CTX * psDevMemServerContextInt = IMG_NULL;
IMG_HANDLE hPrivDataInt = IMG_NULL;
psDevmemIntCtxImportOUT->hDevMemServerContext = IMG_NULL;
{
/* Look up the address from the handle */
psDevmemIntCtxImportOUT->eError =
PVRSRVLookupHandle(KERNEL_HANDLE_BASE,
(IMG_VOID **) &psDevMemIntCtxExportInt,
psDevmemIntCtxImportIN->hDevMemIntCtxExport,
PVRSRV_HANDLE_TYPE_DEVMEMINT_CTX_EXPORT);
if(psDevmemIntCtxImportOUT->eError != PVRSRV_OK)
{
goto DevmemIntCtxImport_exit;
}
}
psDevmemIntCtxImportOUT->eError =
DevmemIntCtxImport(
psDevMemIntCtxExportInt,
&psDevMemServerContextInt,
&hPrivDataInt);
/* Exit early if bridged call fails */
if(psDevmemIntCtxImportOUT->eError != PVRSRV_OK)
{
goto DevmemIntCtxImport_exit;
}
psDevmemIntCtxImportOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase,
&psDevmemIntCtxImportOUT->hDevMemServerContext,
(IMG_VOID *) psDevMemServerContextInt,
PVRSRV_HANDLE_TYPE_DEVMEMINT_CTX,
PVRSRV_HANDLE_ALLOC_FLAG_MULTI
,(PFN_HANDLE_RELEASE)&DevmemIntCtxDestroy);
if (psDevmemIntCtxImportOUT->eError != PVRSRV_OK)
{
goto DevmemIntCtxImport_exit;
}
psDevmemIntCtxImportOUT->eError = PVRSRVAllocSubHandle(psConnection->psHandleBase,
&psDevmemIntCtxImportOUT->hPrivData,
(IMG_VOID *) hPrivDataInt,
PVRSRV_HANDLE_TYPE_DEV_PRIV_DATA,
PVRSRV_HANDLE_ALLOC_FLAG_MULTI
,psDevmemIntCtxImportOUT->hDevMemServerContext);
if (psDevmemIntCtxImportOUT->eError != PVRSRV_OK)
{
goto DevmemIntCtxImport_exit;
}
DevmemIntCtxImport_exit:
if (psDevmemIntCtxImportOUT->eError != PVRSRV_OK)
{
if (psDevmemIntCtxImportOUT->hDevMemServerContext)
{
PVRSRV_ERROR eError = PVRSRVReleaseHandle(psConnection->psHandleBase,
(IMG_HANDLE) psDevmemIntCtxImportOUT->hDevMemServerContext,
PVRSRV_HANDLE_TYPE_DEVMEMINT_CTX);
/* Releasing the handle should free/destroy/release the resource. This should never fail... */
PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY));
/* Avoid freeing/destroying/releasing the resource a second time below */
psDevMemServerContextInt = IMG_NULL;
}
if (psDevMemServerContextInt)
{
DevmemIntCtxDestroy(psDevMemServerContextInt);
}
}
return 0;
}
/* ***************************************************************************
* Server bridge dispatch related glue
*/
PVRSRV_ERROR InitCMMBridge(IMG_VOID);
PVRSRV_ERROR DeinitCMMBridge(IMG_VOID);
/*
* Register all CMM functions with services
*/
PVRSRV_ERROR InitCMMBridge(IMG_VOID)
{
SetDispatchTableEntry(PVRSRV_BRIDGE_CMM, PVRSRV_BRIDGE_CMM_DEVMEMINTCTXEXPORT, PVRSRVBridgeDevmemIntCtxExport,
IMG_NULL, IMG_NULL,
0, 0);
SetDispatchTableEntry(PVRSRV_BRIDGE_CMM, PVRSRV_BRIDGE_CMM_DEVMEMINTCTXUNEXPORT, PVRSRVBridgeDevmemIntCtxUnexport,
IMG_NULL, IMG_NULL,
0, 0);
SetDispatchTableEntry(PVRSRV_BRIDGE_CMM, PVRSRV_BRIDGE_CMM_DEVMEMINTCTXIMPORT, PVRSRVBridgeDevmemIntCtxImport,
IMG_NULL, IMG_NULL,
0, 0);
return PVRSRV_OK;
}
/*
* Unregister all cmm functions with services
*/
PVRSRV_ERROR DeinitCMMBridge(IMG_VOID)
{
return PVRSRV_OK;
}

View File

@@ -1,88 +0,0 @@
/*************************************************************************/ /*!
@Title Direct client bridge for devicememhistory
@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
@License Dual MIT/GPLv2
The contents of this file are subject to the MIT license as set out below.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
Alternatively, the contents of this file may be used under the terms of
the GNU General Public License Version 2 ("GPL") in which case the provisions
of GPL are applicable instead of those above.
If you wish to allow use of your version of this file only under the terms of
GPL, and not to allow others to use your version of this file under the terms
of the MIT license, indicate your decision by deleting the provisions above
and replace them with the notice and other provisions required by GPL as set
out in the file called "GPL-COPYING" included in this distribution. If you do
not delete the provisions above, a recipient may use your version of this file
under the terms of either the MIT license or GPL.
This License is also included in this distribution in the file called
"MIT-COPYING".
EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ /**************************************************************************/
#include "client_devicememhistory_bridge.h"
#include "img_defs.h"
#include "pvr_debug.h"
/* Module specific includes */
#include "img_types.h"
#include "mm_common.h"
#include "devicemem_history_server.h"
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeDevicememHistoryMap(IMG_HANDLE hBridge,
IMG_DEV_VIRTADDR sDevVAddr,
IMG_DEVMEM_SIZE_T uiSize,
const IMG_CHAR *puiText)
{
PVRSRV_ERROR eError;
PVR_UNREFERENCED_PARAMETER(hBridge);
eError =
DevicememHistoryMapKM(
sDevVAddr,
uiSize,
puiText);
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeDevicememHistoryUnmap(IMG_HANDLE hBridge,
IMG_DEV_VIRTADDR sDevVAddr,
IMG_DEVMEM_SIZE_T uiSize,
const IMG_CHAR *puiText)
{
PVRSRV_ERROR eError;
PVR_UNREFERENCED_PARAMETER(hBridge);
eError =
DevicememHistoryUnmapKM(
sDevVAddr,
uiSize,
puiText);
return eError;
}

View File

@@ -1,139 +0,0 @@
/*************************************************************************/ /*!
@File
@Title Common bridge header for debugmisc
@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
@Description Declares common defines and structures that are used by both
the client and sever side of the bridge for debugmisc
@License Dual MIT/GPLv2
The contents of this file are subject to the MIT license as set out below.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
Alternatively, the contents of this file may be used under the terms of
the GNU General Public License Version 2 ("GPL") in which case the provisions
of GPL are applicable instead of those above.
If you wish to allow use of your version of this file only under the terms of
GPL, and not to allow others to use your version of this file under the terms
of the MIT license, indicate your decision by deleting the provisions above
and replace them with the notice and other provisions required by GPL as set
out in the file called "GPL-COPYING" included in this distribution. If you do
not delete the provisions above, a recipient may use your version of this file
under the terms of either the MIT license or GPL.
This License is also included in this distribution in the file called
"MIT-COPYING".
EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ /**************************************************************************/
#ifndef COMMON_DEBUGMISC_BRIDGE_H
#define COMMON_DEBUGMISC_BRIDGE_H
#include "img_types.h"
#include "pvrsrv_error.h"
#include "devicemem_typedefs.h"
#include "rgx_bridge.h"
#include "pvrsrv_memallocflags.h"
#define PVRSRV_BRIDGE_DEBUGMISC_CMD_FIRST 0
#define PVRSRV_BRIDGE_DEBUGMISC_DEBUGMISCSLCSETBYPASSSTATE PVRSRV_BRIDGE_DEBUGMISC_CMD_FIRST+0
#define PVRSRV_BRIDGE_DEBUGMISC_RGXDEBUGMISCSETFWLOG PVRSRV_BRIDGE_DEBUGMISC_CMD_FIRST+1
#define PVRSRV_BRIDGE_DEBUGMISC_RGXDEBUGMISCDUMPFREELISTPAGELIST PVRSRV_BRIDGE_DEBUGMISC_CMD_FIRST+2
#define PVRSRV_BRIDGE_DEBUGMISC_PHYSMEMIMPORTSECBUF PVRSRV_BRIDGE_DEBUGMISC_CMD_FIRST+3
#define PVRSRV_BRIDGE_DEBUGMISC_CMD_LAST (PVRSRV_BRIDGE_DEBUGMISC_CMD_FIRST+3)
/*******************************************
DebugMiscSLCSetBypassState
*******************************************/
/* Bridge in structure for DebugMiscSLCSetBypassState */
typedef struct PVRSRV_BRIDGE_IN_DEBUGMISCSLCSETBYPASSSTATE_TAG
{
IMG_HANDLE hDevNode;
IMG_UINT32 ui32Flags;
IMG_BOOL bIsBypassed;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_DEBUGMISCSLCSETBYPASSSTATE;
/* Bridge out structure for DebugMiscSLCSetBypassState */
typedef struct PVRSRV_BRIDGE_OUT_DEBUGMISCSLCSETBYPASSSTATE_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DEBUGMISCSLCSETBYPASSSTATE;
/*******************************************
RGXDebugMiscSetFWLog
*******************************************/
/* Bridge in structure for RGXDebugMiscSetFWLog */
typedef struct PVRSRV_BRIDGE_IN_RGXDEBUGMISCSETFWLOG_TAG
{
IMG_HANDLE hDevNode;
IMG_UINT32 ui32RGXFWLogType;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXDEBUGMISCSETFWLOG;
/* Bridge out structure for RGXDebugMiscSetFWLog */
typedef struct PVRSRV_BRIDGE_OUT_RGXDEBUGMISCSETFWLOG_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXDEBUGMISCSETFWLOG;
/*******************************************
RGXDebugMiscDumpFreelistPageList
*******************************************/
/* Bridge in structure for RGXDebugMiscDumpFreelistPageList */
typedef struct PVRSRV_BRIDGE_IN_RGXDEBUGMISCDUMPFREELISTPAGELIST_TAG
{
IMG_HANDLE hDevNode;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXDEBUGMISCDUMPFREELISTPAGELIST;
/* Bridge out structure for RGXDebugMiscDumpFreelistPageList */
typedef struct PVRSRV_BRIDGE_OUT_RGXDEBUGMISCDUMPFREELISTPAGELIST_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXDEBUGMISCDUMPFREELISTPAGELIST;
/*******************************************
PhysmemImportSecBuf
*******************************************/
/* Bridge in structure for PhysmemImportSecBuf */
typedef struct PVRSRV_BRIDGE_IN_PHYSMEMIMPORTSECBUF_TAG
{
IMG_HANDLE hDevNode;
IMG_DEVMEM_SIZE_T uiSize;
IMG_UINT32 ui32Log2PageSize;
PVRSRV_MEMALLOCFLAGS_T uiFlags;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_PHYSMEMIMPORTSECBUF;
/* Bridge out structure for PhysmemImportSecBuf */
typedef struct PVRSRV_BRIDGE_OUT_PHYSMEMIMPORTSECBUF_TAG
{
IMG_HANDLE hPMRPtr;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PHYSMEMIMPORTSECBUF;
#endif /* COMMON_DEBUGMISC_BRIDGE_H */

View File

@@ -1,314 +0,0 @@
/*************************************************************************/ /*!
@File
@Title Server bridge for debugmisc
@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
@Description Implements the server side of the bridge for debugmisc
@License Dual MIT/GPLv2
The contents of this file are subject to the MIT license as set out below.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
Alternatively, the contents of this file may be used under the terms of
the GNU General Public License Version 2 ("GPL") in which case the provisions
of GPL are applicable instead of those above.
If you wish to allow use of your version of this file only under the terms of
GPL, and not to allow others to use your version of this file under the terms
of the MIT license, indicate your decision by deleting the provisions above
and replace them with the notice and other provisions required by GPL as set
out in the file called "GPL-COPYING" included in this distribution. If you do
not delete the provisions above, a recipient may use your version of this file
under the terms of either the MIT license or GPL.
This License is also included in this distribution in the file called
"MIT-COPYING".
EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ /**************************************************************************/
#include <stddef.h>
#include <linux/uaccess.h>
#include "img_defs.h"
#include "devicemem_server.h"
#include "debugmisc_server.h"
#include "pmr.h"
#include "physmem_osmem.h"
#include "common_debugmisc_bridge.h"
#include "allocmem.h"
#include "pvr_debug.h"
#include "connection_server.h"
#include "pvr_bridge.h"
#include "rgx_bridge.h"
#include "srvcore.h"
#include "handle.h"
#if defined (SUPPORT_AUTH)
#include "osauth.h"
#endif
#include <linux/slab.h>
/* ***************************************************************************
* Server-side bridge entry points
*/
static IMG_INT
PVRSRVBridgeDebugMiscSLCSetBypassState(IMG_UINT32 ui32DispatchTableEntry,
PVRSRV_BRIDGE_IN_DEBUGMISCSLCSETBYPASSSTATE *psDebugMiscSLCSetBypassStateIN,
PVRSRV_BRIDGE_OUT_DEBUGMISCSLCSETBYPASSSTATE *psDebugMiscSLCSetBypassStateOUT,
CONNECTION_DATA *psConnection)
{
IMG_HANDLE hDevNodeInt = IMG_NULL;
{
/* Look up the address from the handle */
psDebugMiscSLCSetBypassStateOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_VOID **) &hDevNodeInt,
psDebugMiscSLCSetBypassStateIN->hDevNode,
PVRSRV_HANDLE_TYPE_DEV_NODE);
if(psDebugMiscSLCSetBypassStateOUT->eError != PVRSRV_OK)
{
goto DebugMiscSLCSetBypassState_exit;
}
}
psDebugMiscSLCSetBypassStateOUT->eError =
PVRSRVDebugMiscSLCSetBypassStateKM(
hDevNodeInt,
psDebugMiscSLCSetBypassStateIN->ui32Flags,
psDebugMiscSLCSetBypassStateIN->bIsBypassed);
DebugMiscSLCSetBypassState_exit:
return 0;
}
static IMG_INT
PVRSRVBridgeRGXDebugMiscSetFWLog(IMG_UINT32 ui32DispatchTableEntry,
PVRSRV_BRIDGE_IN_RGXDEBUGMISCSETFWLOG *psRGXDebugMiscSetFWLogIN,
PVRSRV_BRIDGE_OUT_RGXDEBUGMISCSETFWLOG *psRGXDebugMiscSetFWLogOUT,
CONNECTION_DATA *psConnection)
{
IMG_HANDLE hDevNodeInt = IMG_NULL;
{
/* Look up the address from the handle */
psRGXDebugMiscSetFWLogOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_VOID **) &hDevNodeInt,
psRGXDebugMiscSetFWLogIN->hDevNode,
PVRSRV_HANDLE_TYPE_DEV_NODE);
if(psRGXDebugMiscSetFWLogOUT->eError != PVRSRV_OK)
{
goto RGXDebugMiscSetFWLog_exit;
}
}
psRGXDebugMiscSetFWLogOUT->eError =
PVRSRVRGXDebugMiscSetFWLogKM(
hDevNodeInt,
psRGXDebugMiscSetFWLogIN->ui32RGXFWLogType);
RGXDebugMiscSetFWLog_exit:
return 0;
}
static IMG_INT
PVRSRVBridgeRGXDebugMiscDumpFreelistPageList(IMG_UINT32 ui32DispatchTableEntry,
PVRSRV_BRIDGE_IN_RGXDEBUGMISCDUMPFREELISTPAGELIST *psRGXDebugMiscDumpFreelistPageListIN,
PVRSRV_BRIDGE_OUT_RGXDEBUGMISCDUMPFREELISTPAGELIST *psRGXDebugMiscDumpFreelistPageListOUT,
CONNECTION_DATA *psConnection)
{
IMG_HANDLE hDevNodeInt = IMG_NULL;
{
/* Look up the address from the handle */
psRGXDebugMiscDumpFreelistPageListOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_VOID **) &hDevNodeInt,
psRGXDebugMiscDumpFreelistPageListIN->hDevNode,
PVRSRV_HANDLE_TYPE_DEV_NODE);
if(psRGXDebugMiscDumpFreelistPageListOUT->eError != PVRSRV_OK)
{
goto RGXDebugMiscDumpFreelistPageList_exit;
}
}
psRGXDebugMiscDumpFreelistPageListOUT->eError =
PVRSRVRGXDebugMiscDumpFreelistPageListKM(
hDevNodeInt);
RGXDebugMiscDumpFreelistPageList_exit:
return 0;
}
static IMG_INT
PVRSRVBridgePhysmemImportSecBuf(IMG_UINT32 ui32DispatchTableEntry,
PVRSRV_BRIDGE_IN_PHYSMEMIMPORTSECBUF *psPhysmemImportSecBufIN,
PVRSRV_BRIDGE_OUT_PHYSMEMIMPORTSECBUF *psPhysmemImportSecBufOUT,
CONNECTION_DATA *psConnection)
{
IMG_HANDLE hDevNodeInt = IMG_NULL;
PMR * psPMRPtrInt = IMG_NULL;
{
/* Look up the address from the handle */
psPhysmemImportSecBufOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_VOID **) &hDevNodeInt,
psPhysmemImportSecBufIN->hDevNode,
PVRSRV_HANDLE_TYPE_DEV_NODE);
if(psPhysmemImportSecBufOUT->eError != PVRSRV_OK)
{
goto PhysmemImportSecBuf_exit;
}
}
psPhysmemImportSecBufOUT->eError =
PhysmemNewTDSecureBufPMR(
hDevNodeInt,
psPhysmemImportSecBufIN->uiSize,
psPhysmemImportSecBufIN->ui32Log2PageSize,
psPhysmemImportSecBufIN->uiFlags,
&psPMRPtrInt);
/* Exit early if bridged call fails */
if(psPhysmemImportSecBufOUT->eError != PVRSRV_OK)
{
goto PhysmemImportSecBuf_exit;
}
psPhysmemImportSecBufOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase,
&psPhysmemImportSecBufOUT->hPMRPtr,
(IMG_VOID *) psPMRPtrInt,
PVRSRV_HANDLE_TYPE_PHYSMEM_PMR,
PVRSRV_HANDLE_ALLOC_FLAG_MULTI
,(PFN_HANDLE_RELEASE)&PMRUnrefPMR);
if (psPhysmemImportSecBufOUT->eError != PVRSRV_OK)
{
goto PhysmemImportSecBuf_exit;
}
PhysmemImportSecBuf_exit:
if (psPhysmemImportSecBufOUT->eError != PVRSRV_OK)
{
if (psPMRPtrInt)
{
PMRUnrefPMR(psPMRPtrInt);
}
}
return 0;
}
/* ***************************************************************************
* Server bridge dispatch related glue
*/
PVRSRV_ERROR InitDEBUGMISCBridge(IMG_VOID);
PVRSRV_ERROR DeinitDEBUGMISCBridge(IMG_VOID);
/*
* Register all DEBUGMISC functions with services
*/
PVRSRV_ERROR InitDEBUGMISCBridge(IMG_VOID)
{
SetDispatchTableEntry(PVRSRV_BRIDGE_DEBUGMISC, PVRSRV_BRIDGE_DEBUGMISC_DEBUGMISCSLCSETBYPASSSTATE, PVRSRVBridgeDebugMiscSLCSetBypassState,
IMG_NULL, IMG_NULL,
0, 0);
SetDispatchTableEntry(PVRSRV_BRIDGE_DEBUGMISC, PVRSRV_BRIDGE_DEBUGMISC_RGXDEBUGMISCSETFWLOG, PVRSRVBridgeRGXDebugMiscSetFWLog,
IMG_NULL, IMG_NULL,
0, 0);
SetDispatchTableEntry(PVRSRV_BRIDGE_DEBUGMISC, PVRSRV_BRIDGE_DEBUGMISC_RGXDEBUGMISCDUMPFREELISTPAGELIST, PVRSRVBridgeRGXDebugMiscDumpFreelistPageList,
IMG_NULL, IMG_NULL,
0, 0);
SetDispatchTableEntry(PVRSRV_BRIDGE_DEBUGMISC, PVRSRV_BRIDGE_DEBUGMISC_PHYSMEMIMPORTSECBUF, PVRSRVBridgePhysmemImportSecBuf,
IMG_NULL, IMG_NULL,
0, 0);
return PVRSRV_OK;
}
/*
* Unregister all debugmisc functions with services
*/
PVRSRV_ERROR DeinitDEBUGMISCBridge(IMG_VOID)
{
return PVRSRV_OK;
}

View File

@@ -1,63 +0,0 @@
/*************************************************************************/ /*!
@File
@Title Client bridge header for devicememhistory
@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
@Description Exports the client bridge functions for devicememhistory
@License Dual MIT/GPLv2
The contents of this file are subject to the MIT license as set out below.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
Alternatively, the contents of this file may be used under the terms of
the GNU General Public License Version 2 ("GPL") in which case the provisions
of GPL are applicable instead of those above.
If you wish to allow use of your version of this file only under the terms of
GPL, and not to allow others to use your version of this file under the terms
of the MIT license, indicate your decision by deleting the provisions above
and replace them with the notice and other provisions required by GPL as set
out in the file called "GPL-COPYING" included in this distribution. If you do
not delete the provisions above, a recipient may use your version of this file
under the terms of either the MIT license or GPL.
This License is also included in this distribution in the file called
"MIT-COPYING".
EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ /**************************************************************************/
#ifndef CLIENT_DEVICEMEMHISTORY_BRIDGE_H
#define CLIENT_DEVICEMEMHISTORY_BRIDGE_H
#include "pvr_bridge_client.h"
#include "pvr_bridge.h"
#include "common_devicememhistory_bridge.h"
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeDevicememHistoryMap(IMG_HANDLE hBridge,
IMG_DEV_VIRTADDR sDevVAddr,
IMG_DEVMEM_SIZE_T uiSize,
const IMG_CHAR *puiText);
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeDevicememHistoryUnmap(IMG_HANDLE hBridge,
IMG_DEV_VIRTADDR sDevVAddr,
IMG_DEVMEM_SIZE_T uiSize,
const IMG_CHAR *puiText);
#endif /* CLIENT_DEVICEMEMHISTORY_BRIDGE_H */

View File

@@ -1,99 +0,0 @@
/*************************************************************************/ /*!
@File
@Title Common bridge header for devicememhistory
@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
@Description Declares common defines and structures that are used by both
the client and sever side of the bridge for devicememhistory
@License Dual MIT/GPLv2
The contents of this file are subject to the MIT license as set out below.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
Alternatively, the contents of this file may be used under the terms of
the GNU General Public License Version 2 ("GPL") in which case the provisions
of GPL are applicable instead of those above.
If you wish to allow use of your version of this file only under the terms of
GPL, and not to allow others to use your version of this file under the terms
of the MIT license, indicate your decision by deleting the provisions above
and replace them with the notice and other provisions required by GPL as set
out in the file called "GPL-COPYING" included in this distribution. If you do
not delete the provisions above, a recipient may use your version of this file
under the terms of either the MIT license or GPL.
This License is also included in this distribution in the file called
"MIT-COPYING".
EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ /**************************************************************************/
#ifndef COMMON_DEVICEMEMHISTORY_BRIDGE_H
#define COMMON_DEVICEMEMHISTORY_BRIDGE_H
#include "img_types.h"
#include "pvrsrv_error.h"
#include "img_types.h"
#include "mm_common.h"
#define PVRSRV_BRIDGE_DEVICEMEMHISTORY_CMD_FIRST 0
#define PVRSRV_BRIDGE_DEVICEMEMHISTORY_DEVICEMEMHISTORYMAP PVRSRV_BRIDGE_DEVICEMEMHISTORY_CMD_FIRST+0
#define PVRSRV_BRIDGE_DEVICEMEMHISTORY_DEVICEMEMHISTORYUNMAP PVRSRV_BRIDGE_DEVICEMEMHISTORY_CMD_FIRST+1
#define PVRSRV_BRIDGE_DEVICEMEMHISTORY_CMD_LAST (PVRSRV_BRIDGE_DEVICEMEMHISTORY_CMD_FIRST+1)
/*******************************************
DevicememHistoryMap
*******************************************/
/* Bridge in structure for DevicememHistoryMap */
typedef struct PVRSRV_BRIDGE_IN_DEVICEMEMHISTORYMAP_TAG
{
IMG_DEV_VIRTADDR sDevVAddr;
IMG_DEVMEM_SIZE_T uiSize;
const IMG_CHAR * puiText;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_DEVICEMEMHISTORYMAP;
/* Bridge out structure for DevicememHistoryMap */
typedef struct PVRSRV_BRIDGE_OUT_DEVICEMEMHISTORYMAP_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DEVICEMEMHISTORYMAP;
/*******************************************
DevicememHistoryUnmap
*******************************************/
/* Bridge in structure for DevicememHistoryUnmap */
typedef struct PVRSRV_BRIDGE_IN_DEVICEMEMHISTORYUNMAP_TAG
{
IMG_DEV_VIRTADDR sDevVAddr;
IMG_DEVMEM_SIZE_T uiSize;
const IMG_CHAR * puiText;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_DEVICEMEMHISTORYUNMAP;
/* Bridge out structure for DevicememHistoryUnmap */
typedef struct PVRSRV_BRIDGE_OUT_DEVICEMEMHISTORYUNMAP_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DEVICEMEMHISTORYUNMAP;
#endif /* COMMON_DEVICEMEMHISTORY_BRIDGE_H */

View File

@@ -1,217 +0,0 @@
/*************************************************************************/ /*!
@File
@Title Server bridge for devicememhistory
@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
@Description Implements the server side of the bridge for devicememhistory
@License Dual MIT/GPLv2
The contents of this file are subject to the MIT license as set out below.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
Alternatively, the contents of this file may be used under the terms of
the GNU General Public License Version 2 ("GPL") in which case the provisions
of GPL are applicable instead of those above.
If you wish to allow use of your version of this file only under the terms of
GPL, and not to allow others to use your version of this file under the terms
of the MIT license, indicate your decision by deleting the provisions above
and replace them with the notice and other provisions required by GPL as set
out in the file called "GPL-COPYING" included in this distribution. If you do
not delete the provisions above, a recipient may use your version of this file
under the terms of either the MIT license or GPL.
This License is also included in this distribution in the file called
"MIT-COPYING".
EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ /**************************************************************************/
#include <stddef.h>
#include <linux/uaccess.h>
#include "img_defs.h"
#include "devicemem_history_server.h"
#include "common_devicememhistory_bridge.h"
#include "allocmem.h"
#include "pvr_debug.h"
#include "connection_server.h"
#include "pvr_bridge.h"
#include "rgx_bridge.h"
#include "srvcore.h"
#include "handle.h"
#if defined (SUPPORT_AUTH)
#include "osauth.h"
#endif
#include <linux/slab.h>
#include "lock.h"
/* ***************************************************************************
* Server-side bridge entry points
*/
static IMG_INT
PVRSRVBridgeDevicememHistoryMap(IMG_UINT32 ui32DispatchTableEntry,
PVRSRV_BRIDGE_IN_DEVICEMEMHISTORYMAP *psDevicememHistoryMapIN,
PVRSRV_BRIDGE_OUT_DEVICEMEMHISTORYMAP *psDevicememHistoryMapOUT,
CONNECTION_DATA *psConnection)
{
IMG_CHAR *uiTextInt = IMG_NULL;
PVR_UNREFERENCED_PARAMETER(psConnection);
{
uiTextInt = OSAllocMem(DEVICEMEM_HISTORY_TEXT_BUFSZ * sizeof(IMG_CHAR));
if (!uiTextInt)
{
psDevicememHistoryMapOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY;
goto DevicememHistoryMap_exit;
}
}
/* Copy the data over */
if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psDevicememHistoryMapIN->puiText, DEVICEMEM_HISTORY_TEXT_BUFSZ * sizeof(IMG_CHAR))
|| (OSCopyFromUser(NULL, uiTextInt, psDevicememHistoryMapIN->puiText,
DEVICEMEM_HISTORY_TEXT_BUFSZ * sizeof(IMG_CHAR)) != PVRSRV_OK) )
{
psDevicememHistoryMapOUT->eError = PVRSRV_ERROR_INVALID_PARAMS;
goto DevicememHistoryMap_exit;
}
psDevicememHistoryMapOUT->eError =
DevicememHistoryMapKM(
psDevicememHistoryMapIN->sDevVAddr,
psDevicememHistoryMapIN->uiSize,
uiTextInt);
DevicememHistoryMap_exit:
if (uiTextInt)
OSFreeMem(uiTextInt);
return 0;
}
static IMG_INT
PVRSRVBridgeDevicememHistoryUnmap(IMG_UINT32 ui32DispatchTableEntry,
PVRSRV_BRIDGE_IN_DEVICEMEMHISTORYUNMAP *psDevicememHistoryUnmapIN,
PVRSRV_BRIDGE_OUT_DEVICEMEMHISTORYUNMAP *psDevicememHistoryUnmapOUT,
CONNECTION_DATA *psConnection)
{
IMG_CHAR *uiTextInt = IMG_NULL;
PVR_UNREFERENCED_PARAMETER(psConnection);
{
uiTextInt = OSAllocMem(DEVICEMEM_HISTORY_TEXT_BUFSZ * sizeof(IMG_CHAR));
if (!uiTextInt)
{
psDevicememHistoryUnmapOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY;
goto DevicememHistoryUnmap_exit;
}
}
/* Copy the data over */
if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psDevicememHistoryUnmapIN->puiText, DEVICEMEM_HISTORY_TEXT_BUFSZ * sizeof(IMG_CHAR))
|| (OSCopyFromUser(NULL, uiTextInt, psDevicememHistoryUnmapIN->puiText,
DEVICEMEM_HISTORY_TEXT_BUFSZ * sizeof(IMG_CHAR)) != PVRSRV_OK) )
{
psDevicememHistoryUnmapOUT->eError = PVRSRV_ERROR_INVALID_PARAMS;
goto DevicememHistoryUnmap_exit;
}
psDevicememHistoryUnmapOUT->eError =
DevicememHistoryUnmapKM(
psDevicememHistoryUnmapIN->sDevVAddr,
psDevicememHistoryUnmapIN->uiSize,
uiTextInt);
DevicememHistoryUnmap_exit:
if (uiTextInt)
OSFreeMem(uiTextInt);
return 0;
}
/* ***************************************************************************
* Server bridge dispatch related glue
*/
static POS_LOCK pDEVICEMEMHISTORYBridgeLock;
static IMG_BYTE pbyDEVICEMEMHISTORYBridgeBuffer[56 + 4];
PVRSRV_ERROR InitDEVICEMEMHISTORYBridge(IMG_VOID);
PVRSRV_ERROR DeinitDEVICEMEMHISTORYBridge(IMG_VOID);
/*
* Register all DEVICEMEMHISTORY functions with services
*/
PVRSRV_ERROR InitDEVICEMEMHISTORYBridge(IMG_VOID)
{
PVR_LOGR_IF_ERROR(OSLockCreate(&pDEVICEMEMHISTORYBridgeLock, LOCK_TYPE_PASSIVE), "OSLockCreate");
SetDispatchTableEntry(PVRSRV_BRIDGE_DEVICEMEMHISTORY, PVRSRV_BRIDGE_DEVICEMEMHISTORY_DEVICEMEMHISTORYMAP, PVRSRVBridgeDevicememHistoryMap,
pDEVICEMEMHISTORYBridgeLock, pbyDEVICEMEMHISTORYBridgeBuffer,
56, 4);
SetDispatchTableEntry(PVRSRV_BRIDGE_DEVICEMEMHISTORY, PVRSRV_BRIDGE_DEVICEMEMHISTORY_DEVICEMEMHISTORYUNMAP, PVRSRVBridgeDevicememHistoryUnmap,
pDEVICEMEMHISTORYBridgeLock, pbyDEVICEMEMHISTORYBridgeBuffer,
56, 4);
return PVRSRV_OK;
}
/*
* Unregister all devicememhistory functions with services
*/
PVRSRV_ERROR DeinitDEVICEMEMHISTORYBridge(IMG_VOID)
{
PVR_LOGR_IF_ERROR(OSLockDestroy(pDEVICEMEMHISTORYBridgeLock), "OSLockDestroy");
return PVRSRV_OK;
}

View File

@@ -1,80 +0,0 @@
/*************************************************************************/ /*!
@File
@Title Common bridge header for dmabuf
@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
@Description Declares common defines and structures that are used by both
the client and sever side of the bridge for dmabuf
@License Dual MIT/GPLv2
The contents of this file are subject to the MIT license as set out below.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
Alternatively, the contents of this file may be used under the terms of
the GNU General Public License Version 2 ("GPL") in which case the provisions
of GPL are applicable instead of those above.
If you wish to allow use of your version of this file only under the terms of
GPL, and not to allow others to use your version of this file under the terms
of the MIT license, indicate your decision by deleting the provisions above
and replace them with the notice and other provisions required by GPL as set
out in the file called "GPL-COPYING" included in this distribution. If you do
not delete the provisions above, a recipient may use your version of this file
under the terms of either the MIT license or GPL.
This License is also included in this distribution in the file called
"MIT-COPYING".
EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ /**************************************************************************/
#ifndef COMMON_DMABUF_BRIDGE_H
#define COMMON_DMABUF_BRIDGE_H
#include "img_types.h"
#include "pvrsrv_error.h"
#include "pvrsrv_memallocflags.h"
#define PVRSRV_BRIDGE_DMABUF_CMD_FIRST 0
#define PVRSRV_BRIDGE_DMABUF_PHYSMEMIMPORTDMABUF PVRSRV_BRIDGE_DMABUF_CMD_FIRST+0
#define PVRSRV_BRIDGE_DMABUF_CMD_LAST (PVRSRV_BRIDGE_DMABUF_CMD_FIRST+0)
/*******************************************
PhysmemImportDmaBuf
*******************************************/
/* Bridge in structure for PhysmemImportDmaBuf */
typedef struct PVRSRV_BRIDGE_IN_PHYSMEMIMPORTDMABUF_TAG
{
IMG_INT ifd;
PVRSRV_MEMALLOCFLAGS_T uiFlags;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_PHYSMEMIMPORTDMABUF;
/* Bridge out structure for PhysmemImportDmaBuf */
typedef struct PVRSRV_BRIDGE_OUT_PHYSMEMIMPORTDMABUF_TAG
{
IMG_HANDLE hPMRPtr;
IMG_DEVMEM_SIZE_T uiSize;
IMG_DEVMEM_ALIGN_T sAlign;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PHYSMEMIMPORTDMABUF;
#endif /* COMMON_DMABUF_BRIDGE_H */

View File

@@ -1,162 +0,0 @@
/*************************************************************************/ /*!
@File
@Title Server bridge for dmabuf
@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
@Description Implements the server side of the bridge for dmabuf
@License Dual MIT/GPLv2
The contents of this file are subject to the MIT license as set out below.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
Alternatively, the contents of this file may be used under the terms of
the GNU General Public License Version 2 ("GPL") in which case the provisions
of GPL are applicable instead of those above.
If you wish to allow use of your version of this file only under the terms of
GPL, and not to allow others to use your version of this file under the terms
of the MIT license, indicate your decision by deleting the provisions above
and replace them with the notice and other provisions required by GPL as set
out in the file called "GPL-COPYING" included in this distribution. If you do
not delete the provisions above, a recipient may use your version of this file
under the terms of either the MIT license or GPL.
This License is also included in this distribution in the file called
"MIT-COPYING".
EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ /**************************************************************************/
#include <stddef.h>
#include <linux/uaccess.h>
#include "img_defs.h"
#include "physmem_dmabuf.h"
#include "pmr.h"
#include "common_dmabuf_bridge.h"
#include "allocmem.h"
#include "pvr_debug.h"
#include "connection_server.h"
#include "pvr_bridge.h"
#include "rgx_bridge.h"
#include "srvcore.h"
#include "handle.h"
#if defined (SUPPORT_AUTH)
#include "osauth.h"
#endif
#include <linux/slab.h>
/* ***************************************************************************
* Server-side bridge entry points
*/
static IMG_INT
PVRSRVBridgePhysmemImportDmaBuf(IMG_UINT32 ui32DispatchTableEntry,
PVRSRV_BRIDGE_IN_PHYSMEMIMPORTDMABUF *psPhysmemImportDmaBufIN,
PVRSRV_BRIDGE_OUT_PHYSMEMIMPORTDMABUF *psPhysmemImportDmaBufOUT,
CONNECTION_DATA *psConnection)
{
PMR * psPMRPtrInt = IMG_NULL;
psPhysmemImportDmaBufOUT->eError =
PhysmemImportDmaBuf(psConnection,
psPhysmemImportDmaBufIN->ifd,
psPhysmemImportDmaBufIN->uiFlags,
&psPMRPtrInt,
&psPhysmemImportDmaBufOUT->uiSize,
&psPhysmemImportDmaBufOUT->sAlign);
/* Exit early if bridged call fails */
if(psPhysmemImportDmaBufOUT->eError != PVRSRV_OK)
{
goto PhysmemImportDmaBuf_exit;
}
psPhysmemImportDmaBufOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase,
&psPhysmemImportDmaBufOUT->hPMRPtr,
(IMG_VOID *) psPMRPtrInt,
PVRSRV_HANDLE_TYPE_PHYSMEM_PMR,
PVRSRV_HANDLE_ALLOC_FLAG_MULTI
,(PFN_HANDLE_RELEASE)&PMRUnrefPMR);
if (psPhysmemImportDmaBufOUT->eError != PVRSRV_OK)
{
goto PhysmemImportDmaBuf_exit;
}
PhysmemImportDmaBuf_exit:
if (psPhysmemImportDmaBufOUT->eError != PVRSRV_OK)
{
if (psPMRPtrInt)
{
PMRUnrefPMR(psPMRPtrInt);
}
}
return 0;
}
/* ***************************************************************************
* Server bridge dispatch related glue
*/
PVRSRV_ERROR InitDMABUFBridge(IMG_VOID);
PVRSRV_ERROR DeinitDMABUFBridge(IMG_VOID);
/*
* Register all DMABUF functions with services
*/
PVRSRV_ERROR InitDMABUFBridge(IMG_VOID)
{
SetDispatchTableEntry(PVRSRV_BRIDGE_DMABUF, PVRSRV_BRIDGE_DMABUF_PHYSMEMIMPORTDMABUF, PVRSRVBridgePhysmemImportDmaBuf,
IMG_NULL, IMG_NULL,
0, 0);
return PVRSRV_OK;
}
/*
* Unregister all dmabuf functions with services
*/
PVRSRV_ERROR DeinitDMABUFBridge(IMG_VOID)
{
return PVRSRV_OK;
}

View File

@@ -1,555 +0,0 @@
/*************************************************************************/ /*!
@Title Direct client bridge for mm
@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
@License Dual MIT/GPLv2
The contents of this file are subject to the MIT license as set out below.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
Alternatively, the contents of this file may be used under the terms of
the GNU General Public License Version 2 ("GPL") in which case the provisions
of GPL are applicable instead of those above.
If you wish to allow use of your version of this file only under the terms of
GPL, and not to allow others to use your version of this file under the terms
of the MIT license, indicate your decision by deleting the provisions above
and replace them with the notice and other provisions required by GPL as set
out in the file called "GPL-COPYING" included in this distribution. If you do
not delete the provisions above, a recipient may use your version of this file
under the terms of either the MIT license or GPL.
This License is also included in this distribution in the file called
"MIT-COPYING".
EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ /**************************************************************************/
#include "client_mm_bridge.h"
#include "img_defs.h"
#include "pvr_debug.h"
/* Module specific includes */
#include "pvrsrv_memallocflags.h"
#include "devicemem_typedefs.h"
#include "devicemem_server.h"
#include "pmr.h"
#include "devicemem_heapcfg.h"
#include "physmem.h"
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgePMRExportPMR(IMG_HANDLE hBridge,
IMG_HANDLE hPMR,
IMG_HANDLE *phPMRExport,
IMG_UINT64 *pui64Size,
IMG_UINT32 *pui32Log2Contig,
IMG_UINT64 *pui64Password)
{
PVRSRV_ERROR eError;
PMR * psPMRInt;
PMR_EXPORT * psPMRExportInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
psPMRInt = (PMR *) hPMR;
eError =
PMRExportPMR(
psPMRInt,
&psPMRExportInt,
pui64Size,
pui32Log2Contig,
pui64Password);
*phPMRExport = psPMRExportInt;
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgePMRUnexportPMR(IMG_HANDLE hBridge,
IMG_HANDLE hPMRExport)
{
PVRSRV_ERROR eError;
PMR_EXPORT * psPMRExportInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
psPMRExportInt = (PMR_EXPORT *) hPMRExport;
eError =
PMRUnexportPMR(
psPMRExportInt);
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgePMRGetUID(IMG_HANDLE hBridge,
IMG_HANDLE hPMR,
IMG_UINT64 *pui64UID)
{
PVRSRV_ERROR eError;
PMR * psPMRInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
psPMRInt = (PMR *) hPMR;
eError =
PMRGetUID(
psPMRInt,
pui64UID);
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgePMRMakeServerExportClientExport(IMG_HANDLE hBridge,
DEVMEM_SERVER_EXPORTCOOKIE hPMRServerExport,
IMG_HANDLE *phPMRExportOut,
IMG_UINT64 *pui64Size,
IMG_UINT32 *pui32Log2Contig,
IMG_UINT64 *pui64Password)
{
PVRSRV_ERROR eError;
DEVMEM_EXPORTCOOKIE * psPMRServerExportInt;
PMR_EXPORT * psPMRExportOutInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
psPMRServerExportInt = (DEVMEM_EXPORTCOOKIE *) hPMRServerExport;
eError =
PMRMakeServerExportClientExport(
psPMRServerExportInt,
&psPMRExportOutInt,
pui64Size,
pui32Log2Contig,
pui64Password);
*phPMRExportOut = psPMRExportOutInt;
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgePMRUnmakeServerExportClientExport(IMG_HANDLE hBridge,
IMG_HANDLE hPMRExport)
{
PVRSRV_ERROR eError;
PMR_EXPORT * psPMRExportInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
psPMRExportInt = (PMR_EXPORT *) hPMRExport;
eError =
PMRUnmakeServerExportClientExport(
psPMRExportInt);
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgePMRImportPMR(IMG_HANDLE hBridge,
IMG_HANDLE hPMRExport,
IMG_UINT64 ui64uiPassword,
IMG_UINT64 ui64uiSize,
IMG_UINT32 ui32uiLog2Contig,
IMG_HANDLE *phPMR)
{
PVRSRV_ERROR eError;
PMR_EXPORT * psPMRExportInt;
PMR * psPMRInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
psPMRExportInt = (PMR_EXPORT *) hPMRExport;
eError =
PMRImportPMR(
psPMRExportInt,
ui64uiPassword,
ui64uiSize,
ui32uiLog2Contig,
&psPMRInt);
*phPMR = psPMRInt;
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeDevmemIntCtxCreate(IMG_HANDLE hBridge,
IMG_HANDLE hDeviceNode,
IMG_HANDLE *phDevMemServerContext,
IMG_HANDLE *phPrivData)
{
PVRSRV_ERROR eError;
IMG_HANDLE hDeviceNodeInt;
DEVMEMINT_CTX * psDevMemServerContextInt;
IMG_HANDLE hPrivDataInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
hDeviceNodeInt = (IMG_HANDLE) hDeviceNode;
eError =
DevmemIntCtxCreate(
hDeviceNodeInt,
&psDevMemServerContextInt,
&hPrivDataInt);
*phDevMemServerContext = psDevMemServerContextInt;
*phPrivData = hPrivDataInt;
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeDevmemIntCtxDestroy(IMG_HANDLE hBridge,
IMG_HANDLE hDevmemServerContext)
{
PVRSRV_ERROR eError;
DEVMEMINT_CTX * psDevmemServerContextInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
psDevmemServerContextInt = (DEVMEMINT_CTX *) hDevmemServerContext;
eError =
DevmemIntCtxDestroy(
psDevmemServerContextInt);
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeDevmemIntHeapCreate(IMG_HANDLE hBridge,
IMG_HANDLE hDevmemCtx,
IMG_DEV_VIRTADDR sHeapBaseAddr,
IMG_DEVMEM_SIZE_T uiHeapLength,
IMG_UINT32 ui32Log2DataPageSize,
IMG_HANDLE *phDevmemHeapPtr)
{
PVRSRV_ERROR eError;
DEVMEMINT_CTX * psDevmemCtxInt;
DEVMEMINT_HEAP * psDevmemHeapPtrInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
psDevmemCtxInt = (DEVMEMINT_CTX *) hDevmemCtx;
eError =
DevmemIntHeapCreate(
psDevmemCtxInt,
sHeapBaseAddr,
uiHeapLength,
ui32Log2DataPageSize,
&psDevmemHeapPtrInt);
*phDevmemHeapPtr = psDevmemHeapPtrInt;
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeDevmemIntHeapDestroy(IMG_HANDLE hBridge,
IMG_HANDLE hDevmemHeap)
{
PVRSRV_ERROR eError;
DEVMEMINT_HEAP * psDevmemHeapInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
psDevmemHeapInt = (DEVMEMINT_HEAP *) hDevmemHeap;
eError =
DevmemIntHeapDestroy(
psDevmemHeapInt);
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeDevmemIntMapPMR(IMG_HANDLE hBridge,
IMG_HANDLE hDevmemServerHeap,
IMG_HANDLE hReservation,
IMG_HANDLE hPMR,
PVRSRV_MEMALLOCFLAGS_T uiMapFlags,
IMG_HANDLE *phMapping)
{
PVRSRV_ERROR eError;
DEVMEMINT_HEAP * psDevmemServerHeapInt;
DEVMEMINT_RESERVATION * psReservationInt;
PMR * psPMRInt;
DEVMEMINT_MAPPING * psMappingInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
psDevmemServerHeapInt = (DEVMEMINT_HEAP *) hDevmemServerHeap;
psReservationInt = (DEVMEMINT_RESERVATION *) hReservation;
psPMRInt = (PMR *) hPMR;
eError =
DevmemIntMapPMR(
psDevmemServerHeapInt,
psReservationInt,
psPMRInt,
uiMapFlags,
&psMappingInt);
*phMapping = psMappingInt;
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeDevmemIntUnmapPMR(IMG_HANDLE hBridge,
IMG_HANDLE hMapping)
{
PVRSRV_ERROR eError;
DEVMEMINT_MAPPING * psMappingInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
psMappingInt = (DEVMEMINT_MAPPING *) hMapping;
eError =
DevmemIntUnmapPMR(
psMappingInt);
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeDevmemIntReserveRange(IMG_HANDLE hBridge,
IMG_HANDLE hDevmemServerHeap,
IMG_DEV_VIRTADDR sAddress,
IMG_DEVMEM_SIZE_T uiLength,
IMG_HANDLE *phReservation)
{
PVRSRV_ERROR eError;
DEVMEMINT_HEAP * psDevmemServerHeapInt;
DEVMEMINT_RESERVATION * psReservationInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
psDevmemServerHeapInt = (DEVMEMINT_HEAP *) hDevmemServerHeap;
eError =
DevmemIntReserveRange(
psDevmemServerHeapInt,
sAddress,
uiLength,
&psReservationInt);
*phReservation = psReservationInt;
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeDevmemIntUnreserveRange(IMG_HANDLE hBridge,
IMG_HANDLE hReservation)
{
PVRSRV_ERROR eError;
DEVMEMINT_RESERVATION * psReservationInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
psReservationInt = (DEVMEMINT_RESERVATION *) hReservation;
eError =
DevmemIntUnreserveRange(
psReservationInt);
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgePhysmemNewRamBackedPMR(IMG_HANDLE hBridge,
IMG_HANDLE hDeviceNode,
IMG_DEVMEM_SIZE_T uiSize,
IMG_DEVMEM_SIZE_T uiChunkSize,
IMG_UINT32 ui32NumPhysChunks,
IMG_UINT32 ui32NumVirtChunks,
IMG_BOOL *pbMappingTable,
IMG_UINT32 ui32Log2PageSize,
PVRSRV_MEMALLOCFLAGS_T uiFlags,
IMG_HANDLE *phPMRPtr)
{
PVRSRV_ERROR eError;
IMG_HANDLE hDeviceNodeInt;
PMR * psPMRPtrInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
hDeviceNodeInt = (IMG_HANDLE) hDeviceNode;
eError =
PhysmemNewRamBackedPMR(
hDeviceNodeInt,
uiSize,
uiChunkSize,
ui32NumPhysChunks,
ui32NumVirtChunks,
pbMappingTable,
ui32Log2PageSize,
uiFlags,
&psPMRPtrInt);
*phPMRPtr = psPMRPtrInt;
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgePMRLocalImportPMR(IMG_HANDLE hBridge,
IMG_HANDLE hExtHandle,
IMG_HANDLE *phPMR,
IMG_DEVMEM_SIZE_T *puiSize,
IMG_DEVMEM_ALIGN_T *psAlign)
{
PVRSRV_ERROR eError;
PMR * psExtHandleInt;
PMR * psPMRInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
psExtHandleInt = (PMR *) hExtHandle;
eError =
PMRLocalImportPMR(
psExtHandleInt,
&psPMRInt,
puiSize,
psAlign);
*phPMR = psPMRInt;
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgePMRUnrefPMR(IMG_HANDLE hBridge,
IMG_HANDLE hPMR)
{
PVRSRV_ERROR eError;
PMR * psPMRInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
psPMRInt = (PMR *) hPMR;
eError =
PMRUnrefPMR(
psPMRInt);
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeDevmemSLCFlushInvalRequest(IMG_HANDLE hBridge,
IMG_HANDLE hDeviceNode,
IMG_HANDLE hPmr)
{
PVRSRV_ERROR eError;
IMG_HANDLE hDeviceNodeInt;
PMR * psPmrInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
hDeviceNodeInt = (IMG_HANDLE) hDeviceNode;
psPmrInt = (PMR *) hPmr;
eError =
DevmemSLCFlushInvalRequest(
hDeviceNodeInt,
psPmrInt);
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeDevmemIsVDevAddrValid(IMG_HANDLE hBridge,
IMG_HANDLE hDevmemCtx,
IMG_DEV_VIRTADDR sAddress)
{
PVRSRV_ERROR eError;
DEVMEMINT_CTX * psDevmemCtxInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
psDevmemCtxInt = (DEVMEMINT_CTX *) hDevmemCtx;
eError =
DevmemIntIsVDevAddrValid(
psDevmemCtxInt,
sAddress);
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeHeapCfgHeapConfigCount(IMG_HANDLE hBridge,
IMG_HANDLE hDeviceNode,
IMG_UINT32 *pui32NumHeapConfigs)
{
PVRSRV_ERROR eError;
IMG_HANDLE hDeviceNodeInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
hDeviceNodeInt = (IMG_HANDLE) hDeviceNode;
eError =
HeapCfgHeapConfigCount(
hDeviceNodeInt,
pui32NumHeapConfigs);
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeHeapCfgHeapCount(IMG_HANDLE hBridge,
IMG_HANDLE hDeviceNode,
IMG_UINT32 ui32HeapConfigIndex,
IMG_UINT32 *pui32NumHeaps)
{
PVRSRV_ERROR eError;
IMG_HANDLE hDeviceNodeInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
hDeviceNodeInt = (IMG_HANDLE) hDeviceNode;
eError =
HeapCfgHeapCount(
hDeviceNodeInt,
ui32HeapConfigIndex,
pui32NumHeaps);
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeHeapCfgHeapConfigName(IMG_HANDLE hBridge,
IMG_HANDLE hDeviceNode,
IMG_UINT32 ui32HeapConfigIndex,
IMG_UINT32 ui32HeapConfigNameBufSz,
IMG_CHAR *puiHeapConfigName)
{
PVRSRV_ERROR eError;
IMG_HANDLE hDeviceNodeInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
hDeviceNodeInt = (IMG_HANDLE) hDeviceNode;
eError =
HeapCfgHeapConfigName(
hDeviceNodeInt,
ui32HeapConfigIndex,
ui32HeapConfigNameBufSz,
puiHeapConfigName);
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeHeapCfgHeapDetails(IMG_HANDLE hBridge,
IMG_HANDLE hDeviceNode,
IMG_UINT32 ui32HeapConfigIndex,
IMG_UINT32 ui32HeapIndex,
IMG_UINT32 ui32HeapNameBufSz,
IMG_CHAR *puiHeapNameOut,
IMG_DEV_VIRTADDR *psDevVAddrBase,
IMG_DEVMEM_SIZE_T *puiHeapLength,
IMG_UINT32 *pui32Log2DataPageSizeOut,
IMG_UINT32 *pui32Log2ImportAlignmentOut)
{
PVRSRV_ERROR eError;
IMG_HANDLE hDeviceNodeInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
hDeviceNodeInt = (IMG_HANDLE) hDeviceNode;
eError =
HeapCfgHeapDetails(
hDeviceNodeInt,
ui32HeapConfigIndex,
ui32HeapIndex,
ui32HeapNameBufSz,
puiHeapNameOut,
psDevVAddrBase,
puiHeapLength,
pui32Log2DataPageSizeOut,
pui32Log2ImportAlignmentOut);
return eError;
}

View File

@@ -1,170 +0,0 @@
/*************************************************************************/ /*!
@Title Direct client bridge header for mm
@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
@License Dual MIT/GPLv2
The contents of this file are subject to the MIT license as set out below.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
Alternatively, the contents of this file may be used under the terms of
the GNU General Public License Version 2 ("GPL") in which case the provisions
of GPL are applicable instead of those above.
If you wish to allow use of your version of this file only under the terms of
GPL, and not to allow others to use your version of this file under the terms
of the MIT license, indicate your decision by deleting the provisions above
and replace them with the notice and other provisions required by GPL as set
out in the file called "GPL-COPYING" included in this distribution. If you do
not delete the provisions above, a recipient may use your version of this file
under the terms of either the MIT license or GPL.
This License is also included in this distribution in the file called
"MIT-COPYING".
EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ /**************************************************************************/
#ifndef CLIENT_MM_BRIDGE_H
#define CLIENT_MM_BRIDGE_H
#include "common_mm_bridge.h"
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgePMRExportPMR(IMG_HANDLE hBridge,
IMG_HANDLE hPMR,
IMG_HANDLE *phPMRExport,
IMG_UINT64 *pui64Size,
IMG_UINT32 *pui32Log2Contig,
IMG_UINT64 *pui64Password);
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgePMRUnexportPMR(IMG_HANDLE hBridge,
IMG_HANDLE hPMRExport);
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgePMRGetUID(IMG_HANDLE hBridge,
IMG_HANDLE hPMR,
IMG_UINT64 *pui64UID);
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgePMRMakeServerExportClientExport(IMG_HANDLE hBridge,
DEVMEM_SERVER_EXPORTCOOKIE hPMRServerExport,
IMG_HANDLE *phPMRExportOut,
IMG_UINT64 *pui64Size,
IMG_UINT32 *pui32Log2Contig,
IMG_UINT64 *pui64Password);
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgePMRUnmakeServerExportClientExport(IMG_HANDLE hBridge,
IMG_HANDLE hPMRExport);
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgePMRImportPMR(IMG_HANDLE hBridge,
IMG_HANDLE hPMRExport,
IMG_UINT64 ui64uiPassword,
IMG_UINT64 ui64uiSize,
IMG_UINT32 ui32uiLog2Contig,
IMG_HANDLE *phPMR);
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeDevmemIntCtxCreate(IMG_HANDLE hBridge,
IMG_HANDLE hDeviceNode,
IMG_HANDLE *phDevMemServerContext,
IMG_HANDLE *phPrivData);
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeDevmemIntCtxDestroy(IMG_HANDLE hBridge,
IMG_HANDLE hDevmemServerContext);
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeDevmemIntHeapCreate(IMG_HANDLE hBridge,
IMG_HANDLE hDevmemCtx,
IMG_DEV_VIRTADDR sHeapBaseAddr,
IMG_DEVMEM_SIZE_T uiHeapLength,
IMG_UINT32 ui32Log2DataPageSize,
IMG_HANDLE *phDevmemHeapPtr);
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeDevmemIntHeapDestroy(IMG_HANDLE hBridge,
IMG_HANDLE hDevmemHeap);
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeDevmemIntMapPMR(IMG_HANDLE hBridge,
IMG_HANDLE hDevmemServerHeap,
IMG_HANDLE hReservation,
IMG_HANDLE hPMR,
PVRSRV_MEMALLOCFLAGS_T uiMapFlags,
IMG_HANDLE *phMapping);
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeDevmemIntUnmapPMR(IMG_HANDLE hBridge,
IMG_HANDLE hMapping);
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeDevmemIntReserveRange(IMG_HANDLE hBridge,
IMG_HANDLE hDevmemServerHeap,
IMG_DEV_VIRTADDR sAddress,
IMG_DEVMEM_SIZE_T uiLength,
IMG_HANDLE *phReservation);
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeDevmemIntUnreserveRange(IMG_HANDLE hBridge,
IMG_HANDLE hReservation);
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgePhysmemNewRamBackedPMR(IMG_HANDLE hBridge,
IMG_HANDLE hDeviceNode,
IMG_DEVMEM_SIZE_T uiSize,
IMG_DEVMEM_SIZE_T uiChunkSize,
IMG_UINT32 ui32NumPhysChunks,
IMG_UINT32 ui32NumVirtChunks,
IMG_BOOL *pbMappingTable,
IMG_UINT32 ui32Log2PageSize,
PVRSRV_MEMALLOCFLAGS_T uiFlags,
IMG_HANDLE *phPMRPtr);
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgePMRLocalImportPMR(IMG_HANDLE hBridge,
IMG_HANDLE hExtHandle,
IMG_HANDLE *phPMR,
IMG_DEVMEM_SIZE_T *puiSize,
IMG_DEVMEM_ALIGN_T *psAlign);
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgePMRUnrefPMR(IMG_HANDLE hBridge,
IMG_HANDLE hPMR);
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeDevmemSLCFlushInvalRequest(IMG_HANDLE hBridge,
IMG_HANDLE hDeviceNode,
IMG_HANDLE hPmr);
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeDevmemIsVDevAddrValid(IMG_HANDLE hBridge,
IMG_HANDLE hDevmemCtx,
IMG_DEV_VIRTADDR sAddress);
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeHeapCfgHeapConfigCount(IMG_HANDLE hBridge,
IMG_HANDLE hDeviceNode,
IMG_UINT32 *pui32NumHeapConfigs);
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeHeapCfgHeapCount(IMG_HANDLE hBridge,
IMG_HANDLE hDeviceNode,
IMG_UINT32 ui32HeapConfigIndex,
IMG_UINT32 *pui32NumHeaps);
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeHeapCfgHeapConfigName(IMG_HANDLE hBridge,
IMG_HANDLE hDeviceNode,
IMG_UINT32 ui32HeapConfigIndex,
IMG_UINT32 ui32HeapConfigNameBufSz,
IMG_CHAR *puiHeapConfigName);
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeHeapCfgHeapDetails(IMG_HANDLE hBridge,
IMG_HANDLE hDeviceNode,
IMG_UINT32 ui32HeapConfigIndex,
IMG_UINT32 ui32HeapIndex,
IMG_UINT32 ui32HeapNameBufSz,
IMG_CHAR *puiHeapNameOut,
IMG_DEV_VIRTADDR *psDevVAddrBase,
IMG_DEVMEM_SIZE_T *puiHeapLength,
IMG_UINT32 *pui32Log2DataPageSizeOut,
IMG_UINT32 *pui32Log2ImportAlignmentOut);
#endif /* CLIENT_MM_BRIDGE_H */

View File

@@ -1,256 +0,0 @@
/*************************************************************************/ /*!
@Title Direct client bridge for pdumpmm
@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
@License Dual MIT/GPLv2
The contents of this file are subject to the MIT license as set out below.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
Alternatively, the contents of this file may be used under the terms of
the GNU General Public License Version 2 ("GPL") in which case the provisions
of GPL are applicable instead of those above.
If you wish to allow use of your version of this file only under the terms of
GPL, and not to allow others to use your version of this file under the terms
of the MIT license, indicate your decision by deleting the provisions above
and replace them with the notice and other provisions required by GPL as set
out in the file called "GPL-COPYING" included in this distribution. If you do
not delete the provisions above, a recipient may use your version of this file
under the terms of either the MIT license or GPL.
This License is also included in this distribution in the file called
"MIT-COPYING".
EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ /**************************************************************************/
#include "client_pdumpmm_bridge.h"
#include "img_defs.h"
#include "pvr_debug.h"
/* Module specific includes */
#include "pdump.h"
#include "pdumpdefs.h"
#include "pvrsrv_memallocflags.h"
#include "devicemem_typedefs.h"
#include "devicemem_server.h"
#include "pmr.h"
#include "physmem.h"
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgePMRPDumpLoadMem(IMG_HANDLE hBridge,
IMG_HANDLE hPMR,
IMG_DEVMEM_OFFSET_T uiOffset,
IMG_DEVMEM_SIZE_T uiSize,
IMG_UINT32 ui32PDumpFlags,
IMG_BOOL bbZero)
{
PVRSRV_ERROR eError;
PMR * psPMRInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
psPMRInt = (PMR *) hPMR;
eError =
PMRPDumpLoadMem(
psPMRInt,
uiOffset,
uiSize,
ui32PDumpFlags,
bbZero);
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgePMRPDumpLoadMemValue32(IMG_HANDLE hBridge,
IMG_HANDLE hPMR,
IMG_DEVMEM_OFFSET_T uiOffset,
IMG_UINT32 ui32Value,
IMG_UINT32 ui32PDumpFlags)
{
PVRSRV_ERROR eError;
PMR * psPMRInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
psPMRInt = (PMR *) hPMR;
eError =
PMRPDumpLoadMemValue32(
psPMRInt,
uiOffset,
ui32Value,
ui32PDumpFlags);
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgePMRPDumpLoadMemValue64(IMG_HANDLE hBridge,
IMG_HANDLE hPMR,
IMG_DEVMEM_OFFSET_T uiOffset,
IMG_UINT64 ui64Value,
IMG_UINT32 ui32PDumpFlags)
{
PVRSRV_ERROR eError;
PMR * psPMRInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
psPMRInt = (PMR *) hPMR;
eError =
PMRPDumpLoadMemValue64(
psPMRInt,
uiOffset,
ui64Value,
ui32PDumpFlags);
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgePMRPDumpSaveToFile(IMG_HANDLE hBridge,
IMG_HANDLE hPMR,
IMG_DEVMEM_OFFSET_T uiOffset,
IMG_DEVMEM_SIZE_T uiSize,
IMG_UINT32 ui32ArraySize,
const IMG_CHAR *puiFileName)
{
PVRSRV_ERROR eError;
PMR * psPMRInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
psPMRInt = (PMR *) hPMR;
eError =
PMRPDumpSaveToFile(
psPMRInt,
uiOffset,
uiSize,
ui32ArraySize,
puiFileName);
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgePMRPDumpSymbolicAddr(IMG_HANDLE hBridge,
IMG_HANDLE hPMR,
IMG_DEVMEM_OFFSET_T uiOffset,
IMG_UINT32 ui32MemspaceNameLen,
IMG_CHAR *puiMemspaceName,
IMG_UINT32 ui32SymbolicAddrLen,
IMG_CHAR *puiSymbolicAddr,
IMG_DEVMEM_OFFSET_T *puiNewOffset,
IMG_DEVMEM_OFFSET_T *puiNextSymName)
{
PVRSRV_ERROR eError;
PMR * psPMRInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
psPMRInt = (PMR *) hPMR;
eError =
PMR_PDumpSymbolicAddr(
psPMRInt,
uiOffset,
ui32MemspaceNameLen,
puiMemspaceName,
ui32SymbolicAddrLen,
puiSymbolicAddr,
puiNewOffset,
puiNextSymName);
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgePMRPDumpPol32(IMG_HANDLE hBridge,
IMG_HANDLE hPMR,
IMG_DEVMEM_OFFSET_T uiOffset,
IMG_UINT32 ui32Value,
IMG_UINT32 ui32Mask,
PDUMP_POLL_OPERATOR eOperator,
IMG_UINT32 ui32PDumpFlags)
{
PVRSRV_ERROR eError;
PMR * psPMRInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
psPMRInt = (PMR *) hPMR;
eError =
PMRPDumpPol32(
psPMRInt,
uiOffset,
ui32Value,
ui32Mask,
eOperator,
ui32PDumpFlags);
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgePMRPDumpCBP(IMG_HANDLE hBridge,
IMG_HANDLE hPMR,
IMG_DEVMEM_OFFSET_T uiReadOffset,
IMG_DEVMEM_OFFSET_T uiWriteOffset,
IMG_DEVMEM_SIZE_T uiPacketSize,
IMG_DEVMEM_SIZE_T uiBufferSize)
{
PVRSRV_ERROR eError;
PMR * psPMRInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
psPMRInt = (PMR *) hPMR;
eError =
PMRPDumpCBP(
psPMRInt,
uiReadOffset,
uiWriteOffset,
uiPacketSize,
uiBufferSize);
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeDevmemIntPDumpSaveToFileVirtual(IMG_HANDLE hBridge,
IMG_HANDLE hDevmemServerContext,
IMG_DEV_VIRTADDR sAddress,
IMG_DEVMEM_SIZE_T uiSize,
IMG_UINT32 ui32ArraySize,
const IMG_CHAR *puiFileName,
IMG_UINT32 ui32FileOffset,
IMG_UINT32 ui32PDumpFlags)
{
PVRSRV_ERROR eError;
DEVMEMINT_CTX * psDevmemServerContextInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
psDevmemServerContextInt = (DEVMEMINT_CTX *) hDevmemServerContext;
eError =
DevmemIntPDumpSaveToFileVirtual(
psDevmemServerContextInt,
sAddress,
uiSize,
ui32ArraySize,
puiFileName,
ui32FileOffset,
ui32PDumpFlags);
return eError;
}

View File

@@ -1,154 +0,0 @@
/*************************************************************************/ /*!
@Title Direct client bridge for pvrtl
@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
@License Dual MIT/GPLv2
The contents of this file are subject to the MIT license as set out below.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
Alternatively, the contents of this file may be used under the terms of
the GNU General Public License Version 2 ("GPL") in which case the provisions
of GPL are applicable instead of those above.
If you wish to allow use of your version of this file only under the terms of
GPL, and not to allow others to use your version of this file under the terms
of the MIT license, indicate your decision by deleting the provisions above
and replace them with the notice and other provisions required by GPL as set
out in the file called "GPL-COPYING" included in this distribution. If you do
not delete the provisions above, a recipient may use your version of this file
under the terms of either the MIT license or GPL.
This License is also included in this distribution in the file called
"MIT-COPYING".
EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ /**************************************************************************/
#include "client_pvrtl_bridge.h"
#include "img_defs.h"
#include "pvr_debug.h"
/* Module specific includes */
#include "devicemem_typedefs.h"
#include "pvr_tl.h"
#include "tlserver.h"
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeTLConnect(IMG_HANDLE hBridge)
{
PVRSRV_ERROR eError;
eError =
TLServerConnectKM(hBridge
);
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeTLDisconnect(IMG_HANDLE hBridge)
{
PVRSRV_ERROR eError;
eError =
TLServerDisconnectKM(hBridge
);
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeTLOpenStream(IMG_HANDLE hBridge,
IMG_CHAR *puiName,
IMG_UINT32 ui32Mode,
IMG_HANDLE *phSD,
DEVMEM_SERVER_EXPORTCOOKIE *phClientBUFExportCookie)
{
PVRSRV_ERROR eError;
TL_STREAM_DESC * psSDInt;
DEVMEM_EXPORTCOOKIE * psClientBUFExportCookieInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
eError =
TLServerOpenStreamKM(
puiName,
ui32Mode,
&psSDInt,
&psClientBUFExportCookieInt);
*phSD = psSDInt;
*phClientBUFExportCookie = psClientBUFExportCookieInt;
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeTLCloseStream(IMG_HANDLE hBridge,
IMG_HANDLE hSD)
{
PVRSRV_ERROR eError;
TL_STREAM_DESC * psSDInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
psSDInt = (TL_STREAM_DESC *) hSD;
eError =
TLServerCloseStreamKM(
psSDInt);
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeTLAcquireData(IMG_HANDLE hBridge,
IMG_HANDLE hSD,
IMG_UINT32 *pui32ReadOffset,
IMG_UINT32 *pui32ReadLen)
{
PVRSRV_ERROR eError;
TL_STREAM_DESC * psSDInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
psSDInt = (TL_STREAM_DESC *) hSD;
eError =
TLServerAcquireDataKM(
psSDInt,
pui32ReadOffset,
pui32ReadLen);
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeTLReleaseData(IMG_HANDLE hBridge,
IMG_HANDLE hSD,
IMG_UINT32 ui32ReadOffset,
IMG_UINT32 ui32ReadLen)
{
PVRSRV_ERROR eError;
TL_STREAM_DESC * psSDInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
psSDInt = (TL_STREAM_DESC *) hSD;
eError =
TLServerReleaseDataKM(
psSDInt,
ui32ReadOffset,
ui32ReadLen);
return eError;
}

View File

@@ -1,181 +0,0 @@
/*************************************************************************/ /*!
@Title Direct client bridge for ri
@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
@License Dual MIT/GPLv2
The contents of this file are subject to the MIT license as set out below.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
Alternatively, the contents of this file may be used under the terms of
the GNU General Public License Version 2 ("GPL") in which case the provisions
of GPL are applicable instead of those above.
If you wish to allow use of your version of this file only under the terms of
GPL, and not to allow others to use your version of this file under the terms
of the MIT license, indicate your decision by deleting the provisions above
and replace them with the notice and other provisions required by GPL as set
out in the file called "GPL-COPYING" included in this distribution. If you do
not delete the provisions above, a recipient may use your version of this file
under the terms of either the MIT license or GPL.
This License is also included in this distribution in the file called
"MIT-COPYING".
EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ /**************************************************************************/
#include "client_ri_bridge.h"
#include "img_defs.h"
#include "pvr_debug.h"
/* Module specific includes */
#include "ri_typedefs.h"
#include "ri_server.h"
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeRIWritePMREntry(IMG_HANDLE hBridge,
IMG_HANDLE hPMRHandle,
IMG_UINT32 ui32TextASize,
const IMG_CHAR *puiTextA,
IMG_UINT64 ui64LogicalSize)
{
PVRSRV_ERROR eError;
PMR * psPMRHandleInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
psPMRHandleInt = (PMR *) hPMRHandle;
eError =
RIWritePMREntryKM(
psPMRHandleInt,
ui32TextASize,
puiTextA,
ui64LogicalSize);
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeRIWriteMEMDESCEntry(IMG_HANDLE hBridge,
IMG_HANDLE hPMRHandle,
IMG_UINT32 ui32TextBSize,
const IMG_CHAR *puiTextB,
IMG_UINT64 ui64Offset,
IMG_UINT64 ui64Size,
IMG_BOOL bIsImport,
IMG_BOOL bIsExportable,
IMG_HANDLE *phRIHandle)
{
PVRSRV_ERROR eError;
PMR * psPMRHandleInt;
RI_HANDLE psRIHandleInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
psPMRHandleInt = (PMR *) hPMRHandle;
eError =
RIWriteMEMDESCEntryKM(
psPMRHandleInt,
ui32TextBSize,
puiTextB,
ui64Offset,
ui64Size,
bIsImport,
bIsExportable,
&psRIHandleInt);
*phRIHandle = psRIHandleInt;
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeRIUpdateMEMDESCAddr(IMG_HANDLE hBridge,
IMG_HANDLE hRIHandle,
IMG_DEV_VIRTADDR sAddr)
{
PVRSRV_ERROR eError;
RI_HANDLE psRIHandleInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
psRIHandleInt = (RI_HANDLE) hRIHandle;
eError =
RIUpdateMEMDESCAddrKM(
psRIHandleInt,
sAddr);
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeRIDeleteMEMDESCEntry(IMG_HANDLE hBridge,
IMG_HANDLE hRIHandle)
{
PVRSRV_ERROR eError;
RI_HANDLE psRIHandleInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
psRIHandleInt = (RI_HANDLE) hRIHandle;
eError =
RIDeleteMEMDESCEntryKM(
psRIHandleInt);
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeRIDumpList(IMG_HANDLE hBridge,
IMG_HANDLE hPMRHandle)
{
PVRSRV_ERROR eError;
PMR * psPMRHandleInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
psPMRHandleInt = (PMR *) hPMRHandle;
eError =
RIDumpListKM(
psPMRHandleInt);
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeRIDumpAll(IMG_HANDLE hBridge)
{
PVRSRV_ERROR eError;
PVR_UNREFERENCED_PARAMETER(hBridge);
eError =
RIDumpAllKM(
);
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeRIDumpProcess(IMG_HANDLE hBridge,
IMG_PID ui32Pid)
{
PVRSRV_ERROR eError;
PVR_UNREFERENCED_PARAMETER(hBridge);
eError =
RIDumpProcessKM(
ui32Pid);
return eError;
}

View File

@@ -1,492 +0,0 @@
/*************************************************************************/ /*!
@Title Direct client bridge for sync
@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
@License Dual MIT/GPLv2
The contents of this file are subject to the MIT license as set out below.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
Alternatively, the contents of this file may be used under the terms of
the GNU General Public License Version 2 ("GPL") in which case the provisions
of GPL are applicable instead of those above.
If you wish to allow use of your version of this file only under the terms of
GPL, and not to allow others to use your version of this file under the terms
of the MIT license, indicate your decision by deleting the provisions above
and replace them with the notice and other provisions required by GPL as set
out in the file called "GPL-COPYING" included in this distribution. If you do
not delete the provisions above, a recipient may use your version of this file
under the terms of either the MIT license or GPL.
This License is also included in this distribution in the file called
"MIT-COPYING".
EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ /**************************************************************************/
#include "client_sync_bridge.h"
#include "img_defs.h"
#include "pvr_debug.h"
/* Module specific includes */
#include "pdump.h"
#include "pdumpdefs.h"
#include "devicemem_typedefs.h"
#include "sync_server.h"
#include "pdump.h"
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeAllocSyncPrimitiveBlock(IMG_HANDLE hBridge,
IMG_HANDLE hDevNode,
IMG_HANDLE *phSyncHandle,
IMG_UINT32 *pui32SyncPrimVAddr,
IMG_UINT32 *pui32SyncPrimBlockSize,
DEVMEM_SERVER_EXPORTCOOKIE *phExportCookie)
{
PVRSRV_ERROR eError;
IMG_HANDLE hDevNodeInt;
SYNC_PRIMITIVE_BLOCK * psSyncHandleInt;
DEVMEM_EXPORTCOOKIE * psExportCookieInt;
hDevNodeInt = (IMG_HANDLE) hDevNode;
eError =
PVRSRVAllocSyncPrimitiveBlockKM(hBridge
,
hDevNodeInt,
&psSyncHandleInt,
pui32SyncPrimVAddr,
pui32SyncPrimBlockSize,
&psExportCookieInt);
*phSyncHandle = psSyncHandleInt;
*phExportCookie = psExportCookieInt;
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeFreeSyncPrimitiveBlock(IMG_HANDLE hBridge,
IMG_HANDLE hSyncHandle)
{
PVRSRV_ERROR eError;
SYNC_PRIMITIVE_BLOCK * psSyncHandleInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
psSyncHandleInt = (SYNC_PRIMITIVE_BLOCK *) hSyncHandle;
eError =
PVRSRVFreeSyncPrimitiveBlockKM(
psSyncHandleInt);
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeSyncPrimSet(IMG_HANDLE hBridge,
IMG_HANDLE hSyncHandle,
IMG_UINT32 ui32Index,
IMG_UINT32 ui32Value)
{
PVRSRV_ERROR eError;
SYNC_PRIMITIVE_BLOCK * psSyncHandleInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
psSyncHandleInt = (SYNC_PRIMITIVE_BLOCK *) hSyncHandle;
eError =
PVRSRVSyncPrimSetKM(
psSyncHandleInt,
ui32Index,
ui32Value);
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeServerSyncPrimSet(IMG_HANDLE hBridge,
IMG_HANDLE hSyncHandle,
IMG_UINT32 ui32Value)
{
PVRSRV_ERROR eError;
SERVER_SYNC_PRIMITIVE * psSyncHandleInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
psSyncHandleInt = (SERVER_SYNC_PRIMITIVE *) hSyncHandle;
eError =
PVRSRVServerSyncPrimSetKM(
psSyncHandleInt,
ui32Value);
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeSyncRecordRemoveByHandle(IMG_HANDLE hBridge,
IMG_HANDLE hhRecord)
{
PVRSRV_ERROR eError;
SYNC_RECORD_HANDLE pshRecordInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
pshRecordInt = (SYNC_RECORD_HANDLE) hhRecord;
eError =
PVRSRVSyncRecordRemoveByHandleKM(
pshRecordInt);
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeSyncRecordAdd(IMG_HANDLE hBridge,
IMG_HANDLE *phhRecord,
IMG_HANDLE hhServerSyncPrimBlock,
IMG_UINT32 ui32ui32FwBlockAddr,
IMG_UINT32 ui32ui32SyncOffset,
IMG_BOOL bbServerSync,
IMG_UINT32 ui32ClassNameSize,
const IMG_CHAR *puiClassName)
{
PVRSRV_ERROR eError;
SYNC_RECORD_HANDLE pshRecordInt;
SYNC_PRIMITIVE_BLOCK * pshServerSyncPrimBlockInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
pshServerSyncPrimBlockInt = (SYNC_PRIMITIVE_BLOCK *) hhServerSyncPrimBlock;
eError =
PVRSRVSyncRecordAddKM(
&pshRecordInt,
pshServerSyncPrimBlockInt,
ui32ui32FwBlockAddr,
ui32ui32SyncOffset,
bbServerSync,
ui32ClassNameSize,
puiClassName);
*phhRecord = pshRecordInt;
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeServerSyncAlloc(IMG_HANDLE hBridge,
IMG_HANDLE hDevNode,
IMG_HANDLE *phSyncHandle,
IMG_UINT32 *pui32SyncPrimVAddr,
IMG_UINT32 ui32ClassNameSize,
const IMG_CHAR *puiClassName)
{
PVRSRV_ERROR eError;
IMG_HANDLE hDevNodeInt;
SERVER_SYNC_PRIMITIVE * psSyncHandleInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
hDevNodeInt = (IMG_HANDLE) hDevNode;
eError =
PVRSRVServerSyncAllocKM(
hDevNodeInt,
&psSyncHandleInt,
pui32SyncPrimVAddr,
ui32ClassNameSize,
puiClassName);
*phSyncHandle = psSyncHandleInt;
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeServerSyncFree(IMG_HANDLE hBridge,
IMG_HANDLE hSyncHandle)
{
PVRSRV_ERROR eError;
SERVER_SYNC_PRIMITIVE * psSyncHandleInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
psSyncHandleInt = (SERVER_SYNC_PRIMITIVE *) hSyncHandle;
eError =
PVRSRVServerSyncFreeKM(
psSyncHandleInt);
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeServerSyncQueueHWOp(IMG_HANDLE hBridge,
IMG_HANDLE hSyncHandle,
IMG_BOOL bbUpdate,
IMG_UINT32 *pui32FenceValue,
IMG_UINT32 *pui32UpdateValue)
{
PVRSRV_ERROR eError;
SERVER_SYNC_PRIMITIVE * psSyncHandleInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
psSyncHandleInt = (SERVER_SYNC_PRIMITIVE *) hSyncHandle;
eError =
PVRSRVServerSyncQueueHWOpKM(
psSyncHandleInt,
bbUpdate,
pui32FenceValue,
pui32UpdateValue);
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeServerSyncGetStatus(IMG_HANDLE hBridge,
IMG_UINT32 ui32SyncCount,
IMG_HANDLE *phSyncHandle,
IMG_UINT32 *pui32UID,
IMG_UINT32 *pui32FWAddr,
IMG_UINT32 *pui32CurrentOp,
IMG_UINT32 *pui32NextOp)
{
PVRSRV_ERROR eError;
SERVER_SYNC_PRIMITIVE * *psSyncHandleInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
psSyncHandleInt = (SERVER_SYNC_PRIMITIVE **) phSyncHandle;
eError =
PVRSRVServerSyncGetStatusKM(
ui32SyncCount,
psSyncHandleInt,
pui32UID,
pui32FWAddr,
pui32CurrentOp,
pui32NextOp);
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeSyncPrimOpCreate(IMG_HANDLE hBridge,
IMG_UINT32 ui32SyncBlockCount,
IMG_HANDLE *phBlockList,
IMG_UINT32 ui32ClientSyncCount,
IMG_UINT32 *pui32SyncBlockIndex,
IMG_UINT32 *pui32Index,
IMG_UINT32 ui32ServerSyncCount,
IMG_HANDLE *phServerSync,
IMG_HANDLE *phServerCookie)
{
PVRSRV_ERROR eError;
SYNC_PRIMITIVE_BLOCK * *psBlockListInt;
SERVER_SYNC_PRIMITIVE * *psServerSyncInt;
SERVER_OP_COOKIE * psServerCookieInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
psBlockListInt = (SYNC_PRIMITIVE_BLOCK **) phBlockList;
psServerSyncInt = (SERVER_SYNC_PRIMITIVE **) phServerSync;
eError =
PVRSRVSyncPrimOpCreateKM(
ui32SyncBlockCount,
psBlockListInt,
ui32ClientSyncCount,
pui32SyncBlockIndex,
pui32Index,
ui32ServerSyncCount,
psServerSyncInt,
&psServerCookieInt);
*phServerCookie = psServerCookieInt;
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeSyncPrimOpTake(IMG_HANDLE hBridge,
IMG_HANDLE hServerCookie,
IMG_UINT32 ui32ClientSyncCount,
IMG_UINT32 *pui32Flags,
IMG_UINT32 *pui32FenceValue,
IMG_UINT32 *pui32UpdateValue,
IMG_UINT32 ui32ServerSyncCount,
IMG_UINT32 *pui32ServerFlags)
{
PVRSRV_ERROR eError;
SERVER_OP_COOKIE * psServerCookieInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
psServerCookieInt = (SERVER_OP_COOKIE *) hServerCookie;
eError =
PVRSRVSyncPrimOpTakeKM(
psServerCookieInt,
ui32ClientSyncCount,
pui32Flags,
pui32FenceValue,
pui32UpdateValue,
ui32ServerSyncCount,
pui32ServerFlags);
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeSyncPrimOpReady(IMG_HANDLE hBridge,
IMG_HANDLE hServerCookie,
IMG_BOOL *pbReady)
{
PVRSRV_ERROR eError;
SERVER_OP_COOKIE * psServerCookieInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
psServerCookieInt = (SERVER_OP_COOKIE *) hServerCookie;
eError =
PVRSRVSyncPrimOpReadyKM(
psServerCookieInt,
pbReady);
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeSyncPrimOpComplete(IMG_HANDLE hBridge,
IMG_HANDLE hServerCookie)
{
PVRSRV_ERROR eError;
SERVER_OP_COOKIE * psServerCookieInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
psServerCookieInt = (SERVER_OP_COOKIE *) hServerCookie;
eError =
PVRSRVSyncPrimOpCompleteKM(
psServerCookieInt);
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeSyncPrimOpDestroy(IMG_HANDLE hBridge,
IMG_HANDLE hServerCookie)
{
PVRSRV_ERROR eError;
SERVER_OP_COOKIE * psServerCookieInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
psServerCookieInt = (SERVER_OP_COOKIE *) hServerCookie;
eError =
PVRSRVSyncPrimOpDestroyKM(
psServerCookieInt);
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeSyncPrimPDump(IMG_HANDLE hBridge,
IMG_HANDLE hSyncHandle,
IMG_UINT32 ui32Offset)
{
PVRSRV_ERROR eError;
SYNC_PRIMITIVE_BLOCK * psSyncHandleInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
psSyncHandleInt = (SYNC_PRIMITIVE_BLOCK *) hSyncHandle;
eError =
PVRSRVSyncPrimPDumpKM(
psSyncHandleInt,
ui32Offset);
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeSyncPrimPDumpValue(IMG_HANDLE hBridge,
IMG_HANDLE hSyncHandle,
IMG_UINT32 ui32Offset,
IMG_UINT32 ui32Value)
{
PVRSRV_ERROR eError;
SYNC_PRIMITIVE_BLOCK * psSyncHandleInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
psSyncHandleInt = (SYNC_PRIMITIVE_BLOCK *) hSyncHandle;
eError =
PVRSRVSyncPrimPDumpValueKM(
psSyncHandleInt,
ui32Offset,
ui32Value);
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeSyncPrimPDumpPol(IMG_HANDLE hBridge,
IMG_HANDLE hSyncHandle,
IMG_UINT32 ui32Offset,
IMG_UINT32 ui32Value,
IMG_UINT32 ui32Mask,
PDUMP_POLL_OPERATOR eOperator,
PDUMP_FLAGS_T uiPDumpFlags)
{
PVRSRV_ERROR eError;
SYNC_PRIMITIVE_BLOCK * psSyncHandleInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
psSyncHandleInt = (SYNC_PRIMITIVE_BLOCK *) hSyncHandle;
eError =
PVRSRVSyncPrimPDumpPolKM(
psSyncHandleInt,
ui32Offset,
ui32Value,
ui32Mask,
eOperator,
uiPDumpFlags);
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeSyncPrimOpPDumpPol(IMG_HANDLE hBridge,
IMG_HANDLE hServerCookie,
PDUMP_POLL_OPERATOR eOperator,
PDUMP_FLAGS_T uiPDumpFlags)
{
PVRSRV_ERROR eError;
SERVER_OP_COOKIE * psServerCookieInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
psServerCookieInt = (SERVER_OP_COOKIE *) hServerCookie;
eError =
PVRSRVSyncPrimOpPDumpPolKM(
psServerCookieInt,
eOperator,
uiPDumpFlags);
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeSyncPrimPDumpCBP(IMG_HANDLE hBridge,
IMG_HANDLE hSyncHandle,
IMG_UINT32 ui32Offset,
IMG_DEVMEM_OFFSET_T uiWriteOffset,
IMG_DEVMEM_SIZE_T uiPacketSize,
IMG_DEVMEM_SIZE_T uiBufferSize)
{
PVRSRV_ERROR eError;
SYNC_PRIMITIVE_BLOCK * psSyncHandleInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
psSyncHandleInt = (SYNC_PRIMITIVE_BLOCK *) hSyncHandle;
eError =
PVRSRVSyncPrimPDumpCBPKM(
psSyncHandleInt,
ui32Offset,
uiWriteOffset,
uiPacketSize,
uiBufferSize);
return eError;
}

View File

@@ -1,161 +0,0 @@
/*************************************************************************/ /*!
@Title Direct client bridge header for sync
@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
@License Dual MIT/GPLv2
The contents of this file are subject to the MIT license as set out below.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
Alternatively, the contents of this file may be used under the terms of
the GNU General Public License Version 2 ("GPL") in which case the provisions
of GPL are applicable instead of those above.
If you wish to allow use of your version of this file only under the terms of
GPL, and not to allow others to use your version of this file under the terms
of the MIT license, indicate your decision by deleting the provisions above
and replace them with the notice and other provisions required by GPL as set
out in the file called "GPL-COPYING" included in this distribution. If you do
not delete the provisions above, a recipient may use your version of this file
under the terms of either the MIT license or GPL.
This License is also included in this distribution in the file called
"MIT-COPYING".
EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ /**************************************************************************/
#ifndef CLIENT_SYNC_BRIDGE_H
#define CLIENT_SYNC_BRIDGE_H
#include "common_sync_bridge.h"
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeAllocSyncPrimitiveBlock(IMG_HANDLE hBridge,
IMG_HANDLE hDevNode,
IMG_HANDLE *phSyncHandle,
IMG_UINT32 *pui32SyncPrimVAddr,
IMG_UINT32 *pui32SyncPrimBlockSize,
DEVMEM_SERVER_EXPORTCOOKIE *phExportCookie);
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeFreeSyncPrimitiveBlock(IMG_HANDLE hBridge,
IMG_HANDLE hSyncHandle);
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeSyncPrimSet(IMG_HANDLE hBridge,
IMG_HANDLE hSyncHandle,
IMG_UINT32 ui32Index,
IMG_UINT32 ui32Value);
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeServerSyncPrimSet(IMG_HANDLE hBridge,
IMG_HANDLE hSyncHandle,
IMG_UINT32 ui32Value);
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeSyncRecordRemoveByHandle(IMG_HANDLE hBridge,
IMG_HANDLE hhRecord);
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeSyncRecordAdd(IMG_HANDLE hBridge,
IMG_HANDLE *phhRecord,
IMG_HANDLE hhServerSyncPrimBlock,
IMG_UINT32 ui32ui32FwBlockAddr,
IMG_UINT32 ui32ui32SyncOffset,
IMG_BOOL bbServerSync,
IMG_UINT32 ui32ClassNameSize,
const IMG_CHAR *puiClassName);
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeServerSyncAlloc(IMG_HANDLE hBridge,
IMG_HANDLE hDevNode,
IMG_HANDLE *phSyncHandle,
IMG_UINT32 *pui32SyncPrimVAddr,
IMG_UINT32 ui32ClassNameSize,
const IMG_CHAR *puiClassName);
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeServerSyncFree(IMG_HANDLE hBridge,
IMG_HANDLE hSyncHandle);
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeServerSyncQueueHWOp(IMG_HANDLE hBridge,
IMG_HANDLE hSyncHandle,
IMG_BOOL bbUpdate,
IMG_UINT32 *pui32FenceValue,
IMG_UINT32 *pui32UpdateValue);
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeServerSyncGetStatus(IMG_HANDLE hBridge,
IMG_UINT32 ui32SyncCount,
IMG_HANDLE *phSyncHandle,
IMG_UINT32 *pui32UID,
IMG_UINT32 *pui32FWAddr,
IMG_UINT32 *pui32CurrentOp,
IMG_UINT32 *pui32NextOp);
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeSyncPrimOpCreate(IMG_HANDLE hBridge,
IMG_UINT32 ui32SyncBlockCount,
IMG_HANDLE *phBlockList,
IMG_UINT32 ui32ClientSyncCount,
IMG_UINT32 *pui32SyncBlockIndex,
IMG_UINT32 *pui32Index,
IMG_UINT32 ui32ServerSyncCount,
IMG_HANDLE *phServerSync,
IMG_HANDLE *phServerCookie);
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeSyncPrimOpTake(IMG_HANDLE hBridge,
IMG_HANDLE hServerCookie,
IMG_UINT32 ui32ClientSyncCount,
IMG_UINT32 *pui32Flags,
IMG_UINT32 *pui32FenceValue,
IMG_UINT32 *pui32UpdateValue,
IMG_UINT32 ui32ServerSyncCount,
IMG_UINT32 *pui32ServerFlags);
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeSyncPrimOpReady(IMG_HANDLE hBridge,
IMG_HANDLE hServerCookie,
IMG_BOOL *pbReady);
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeSyncPrimOpComplete(IMG_HANDLE hBridge,
IMG_HANDLE hServerCookie);
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeSyncPrimOpDestroy(IMG_HANDLE hBridge,
IMG_HANDLE hServerCookie);
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeSyncPrimPDump(IMG_HANDLE hBridge,
IMG_HANDLE hSyncHandle,
IMG_UINT32 ui32Offset);
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeSyncPrimPDumpValue(IMG_HANDLE hBridge,
IMG_HANDLE hSyncHandle,
IMG_UINT32 ui32Offset,
IMG_UINT32 ui32Value);
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeSyncPrimPDumpPol(IMG_HANDLE hBridge,
IMG_HANDLE hSyncHandle,
IMG_UINT32 ui32Offset,
IMG_UINT32 ui32Value,
IMG_UINT32 ui32Mask,
PDUMP_POLL_OPERATOR eOperator,
PDUMP_FLAGS_T uiPDumpFlags);
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeSyncPrimOpPDumpPol(IMG_HANDLE hBridge,
IMG_HANDLE hServerCookie,
PDUMP_POLL_OPERATOR eOperator,
PDUMP_FLAGS_T uiPDumpFlags);
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeSyncPrimPDumpCBP(IMG_HANDLE hBridge,
IMG_HANDLE hSyncHandle,
IMG_UINT32 ui32Offset,
IMG_DEVMEM_OFFSET_T uiWriteOffset,
IMG_DEVMEM_SIZE_T uiPacketSize,
IMG_DEVMEM_SIZE_T uiBufferSize);
#endif /* CLIENT_SYNC_BRIDGE_H */

View File

@@ -1,530 +0,0 @@
/*************************************************************************/ /*!
@File
@Title Common bridge header for mm
@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
@Description Declares common defines and structures that are used by both
the client and sever side of the bridge for mm
@License Dual MIT/GPLv2
The contents of this file are subject to the MIT license as set out below.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
Alternatively, the contents of this file may be used under the terms of
the GNU General Public License Version 2 ("GPL") in which case the provisions
of GPL are applicable instead of those above.
If you wish to allow use of your version of this file only under the terms of
GPL, and not to allow others to use your version of this file under the terms
of the MIT license, indicate your decision by deleting the provisions above
and replace them with the notice and other provisions required by GPL as set
out in the file called "GPL-COPYING" included in this distribution. If you do
not delete the provisions above, a recipient may use your version of this file
under the terms of either the MIT license or GPL.
This License is also included in this distribution in the file called
"MIT-COPYING".
EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ /**************************************************************************/
#ifndef COMMON_MM_BRIDGE_H
#define COMMON_MM_BRIDGE_H
#include "img_types.h"
#include "pvrsrv_error.h"
#include "pvrsrv_memallocflags.h"
#include "devicemem_typedefs.h"
#define PVRSRV_BRIDGE_MM_CMD_FIRST 0
#define PVRSRV_BRIDGE_MM_PMREXPORTPMR PVRSRV_BRIDGE_MM_CMD_FIRST+0
#define PVRSRV_BRIDGE_MM_PMRUNEXPORTPMR PVRSRV_BRIDGE_MM_CMD_FIRST+1
#define PVRSRV_BRIDGE_MM_PMRGETUID PVRSRV_BRIDGE_MM_CMD_FIRST+2
#define PVRSRV_BRIDGE_MM_PMRMAKESERVEREXPORTCLIENTEXPORT PVRSRV_BRIDGE_MM_CMD_FIRST+3
#define PVRSRV_BRIDGE_MM_PMRUNMAKESERVEREXPORTCLIENTEXPORT PVRSRV_BRIDGE_MM_CMD_FIRST+4
#define PVRSRV_BRIDGE_MM_PMRIMPORTPMR PVRSRV_BRIDGE_MM_CMD_FIRST+5
#define PVRSRV_BRIDGE_MM_DEVMEMINTCTXCREATE PVRSRV_BRIDGE_MM_CMD_FIRST+6
#define PVRSRV_BRIDGE_MM_DEVMEMINTCTXDESTROY PVRSRV_BRIDGE_MM_CMD_FIRST+7
#define PVRSRV_BRIDGE_MM_DEVMEMINTHEAPCREATE PVRSRV_BRIDGE_MM_CMD_FIRST+8
#define PVRSRV_BRIDGE_MM_DEVMEMINTHEAPDESTROY PVRSRV_BRIDGE_MM_CMD_FIRST+9
#define PVRSRV_BRIDGE_MM_DEVMEMINTMAPPMR PVRSRV_BRIDGE_MM_CMD_FIRST+10
#define PVRSRV_BRIDGE_MM_DEVMEMINTUNMAPPMR PVRSRV_BRIDGE_MM_CMD_FIRST+11
#define PVRSRV_BRIDGE_MM_DEVMEMINTRESERVERANGE PVRSRV_BRIDGE_MM_CMD_FIRST+12
#define PVRSRV_BRIDGE_MM_DEVMEMINTUNRESERVERANGE PVRSRV_BRIDGE_MM_CMD_FIRST+13
#define PVRSRV_BRIDGE_MM_PHYSMEMNEWRAMBACKEDPMR PVRSRV_BRIDGE_MM_CMD_FIRST+14
#define PVRSRV_BRIDGE_MM_PMRLOCALIMPORTPMR PVRSRV_BRIDGE_MM_CMD_FIRST+15
#define PVRSRV_BRIDGE_MM_PMRUNREFPMR PVRSRV_BRIDGE_MM_CMD_FIRST+16
#define PVRSRV_BRIDGE_MM_DEVMEMSLCFLUSHINVALREQUEST PVRSRV_BRIDGE_MM_CMD_FIRST+17
#define PVRSRV_BRIDGE_MM_DEVMEMISVDEVADDRVALID PVRSRV_BRIDGE_MM_CMD_FIRST+18
#define PVRSRV_BRIDGE_MM_HEAPCFGHEAPCONFIGCOUNT PVRSRV_BRIDGE_MM_CMD_FIRST+19
#define PVRSRV_BRIDGE_MM_HEAPCFGHEAPCOUNT PVRSRV_BRIDGE_MM_CMD_FIRST+20
#define PVRSRV_BRIDGE_MM_HEAPCFGHEAPCONFIGNAME PVRSRV_BRIDGE_MM_CMD_FIRST+21
#define PVRSRV_BRIDGE_MM_HEAPCFGHEAPDETAILS PVRSRV_BRIDGE_MM_CMD_FIRST+22
#define PVRSRV_BRIDGE_MM_CMD_LAST (PVRSRV_BRIDGE_MM_CMD_FIRST+22)
/*******************************************
PMRExportPMR
*******************************************/
/* Bridge in structure for PMRExportPMR */
typedef struct PVRSRV_BRIDGE_IN_PMREXPORTPMR_TAG
{
IMG_HANDLE hPMR;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_PMREXPORTPMR;
/* Bridge out structure for PMRExportPMR */
typedef struct PVRSRV_BRIDGE_OUT_PMREXPORTPMR_TAG
{
IMG_HANDLE hPMRExport;
IMG_UINT64 ui64Size;
IMG_UINT32 ui32Log2Contig;
IMG_UINT64 ui64Password;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PMREXPORTPMR;
/*******************************************
PMRUnexportPMR
*******************************************/
/* Bridge in structure for PMRUnexportPMR */
typedef struct PVRSRV_BRIDGE_IN_PMRUNEXPORTPMR_TAG
{
IMG_HANDLE hPMRExport;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_PMRUNEXPORTPMR;
/* Bridge out structure for PMRUnexportPMR */
typedef struct PVRSRV_BRIDGE_OUT_PMRUNEXPORTPMR_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PMRUNEXPORTPMR;
/*******************************************
PMRGetUID
*******************************************/
/* Bridge in structure for PMRGetUID */
typedef struct PVRSRV_BRIDGE_IN_PMRGETUID_TAG
{
IMG_HANDLE hPMR;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_PMRGETUID;
/* Bridge out structure for PMRGetUID */
typedef struct PVRSRV_BRIDGE_OUT_PMRGETUID_TAG
{
IMG_UINT64 ui64UID;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PMRGETUID;
/*******************************************
PMRMakeServerExportClientExport
*******************************************/
/* Bridge in structure for PMRMakeServerExportClientExport */
typedef struct PVRSRV_BRIDGE_IN_PMRMAKESERVEREXPORTCLIENTEXPORT_TAG
{
DEVMEM_SERVER_EXPORTCOOKIE hPMRServerExport;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_PMRMAKESERVEREXPORTCLIENTEXPORT;
/* Bridge out structure for PMRMakeServerExportClientExport */
typedef struct PVRSRV_BRIDGE_OUT_PMRMAKESERVEREXPORTCLIENTEXPORT_TAG
{
IMG_HANDLE hPMRExportOut;
IMG_UINT64 ui64Size;
IMG_UINT32 ui32Log2Contig;
IMG_UINT64 ui64Password;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PMRMAKESERVEREXPORTCLIENTEXPORT;
/*******************************************
PMRUnmakeServerExportClientExport
*******************************************/
/* Bridge in structure for PMRUnmakeServerExportClientExport */
typedef struct PVRSRV_BRIDGE_IN_PMRUNMAKESERVEREXPORTCLIENTEXPORT_TAG
{
IMG_HANDLE hPMRExport;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_PMRUNMAKESERVEREXPORTCLIENTEXPORT;
/* Bridge out structure for PMRUnmakeServerExportClientExport */
typedef struct PVRSRV_BRIDGE_OUT_PMRUNMAKESERVEREXPORTCLIENTEXPORT_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PMRUNMAKESERVEREXPORTCLIENTEXPORT;
/*******************************************
PMRImportPMR
*******************************************/
/* Bridge in structure for PMRImportPMR */
typedef struct PVRSRV_BRIDGE_IN_PMRIMPORTPMR_TAG
{
IMG_HANDLE hPMRExport;
IMG_UINT64 ui64uiPassword;
IMG_UINT64 ui64uiSize;
IMG_UINT32 ui32uiLog2Contig;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_PMRIMPORTPMR;
/* Bridge out structure for PMRImportPMR */
typedef struct PVRSRV_BRIDGE_OUT_PMRIMPORTPMR_TAG
{
IMG_HANDLE hPMR;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PMRIMPORTPMR;
/*******************************************
DevmemIntCtxCreate
*******************************************/
/* Bridge in structure for DevmemIntCtxCreate */
typedef struct PVRSRV_BRIDGE_IN_DEVMEMINTCTXCREATE_TAG
{
IMG_HANDLE hDeviceNode;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_DEVMEMINTCTXCREATE;
/* Bridge out structure for DevmemIntCtxCreate */
typedef struct PVRSRV_BRIDGE_OUT_DEVMEMINTCTXCREATE_TAG
{
IMG_HANDLE hDevMemServerContext;
IMG_HANDLE hPrivData;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DEVMEMINTCTXCREATE;
/*******************************************
DevmemIntCtxDestroy
*******************************************/
/* Bridge in structure for DevmemIntCtxDestroy */
typedef struct PVRSRV_BRIDGE_IN_DEVMEMINTCTXDESTROY_TAG
{
IMG_HANDLE hDevmemServerContext;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_DEVMEMINTCTXDESTROY;
/* Bridge out structure for DevmemIntCtxDestroy */
typedef struct PVRSRV_BRIDGE_OUT_DEVMEMINTCTXDESTROY_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DEVMEMINTCTXDESTROY;
/*******************************************
DevmemIntHeapCreate
*******************************************/
/* Bridge in structure for DevmemIntHeapCreate */
typedef struct PVRSRV_BRIDGE_IN_DEVMEMINTHEAPCREATE_TAG
{
IMG_HANDLE hDevmemCtx;
IMG_DEV_VIRTADDR sHeapBaseAddr;
IMG_DEVMEM_SIZE_T uiHeapLength;
IMG_UINT32 ui32Log2DataPageSize;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_DEVMEMINTHEAPCREATE;
/* Bridge out structure for DevmemIntHeapCreate */
typedef struct PVRSRV_BRIDGE_OUT_DEVMEMINTHEAPCREATE_TAG
{
IMG_HANDLE hDevmemHeapPtr;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DEVMEMINTHEAPCREATE;
/*******************************************
DevmemIntHeapDestroy
*******************************************/
/* Bridge in structure for DevmemIntHeapDestroy */
typedef struct PVRSRV_BRIDGE_IN_DEVMEMINTHEAPDESTROY_TAG
{
IMG_HANDLE hDevmemHeap;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_DEVMEMINTHEAPDESTROY;
/* Bridge out structure for DevmemIntHeapDestroy */
typedef struct PVRSRV_BRIDGE_OUT_DEVMEMINTHEAPDESTROY_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DEVMEMINTHEAPDESTROY;
/*******************************************
DevmemIntMapPMR
*******************************************/
/* Bridge in structure for DevmemIntMapPMR */
typedef struct PVRSRV_BRIDGE_IN_DEVMEMINTMAPPMR_TAG
{
IMG_HANDLE hDevmemServerHeap;
IMG_HANDLE hReservation;
IMG_HANDLE hPMR;
PVRSRV_MEMALLOCFLAGS_T uiMapFlags;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_DEVMEMINTMAPPMR;
/* Bridge out structure for DevmemIntMapPMR */
typedef struct PVRSRV_BRIDGE_OUT_DEVMEMINTMAPPMR_TAG
{
IMG_HANDLE hMapping;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DEVMEMINTMAPPMR;
/*******************************************
DevmemIntUnmapPMR
*******************************************/
/* Bridge in structure for DevmemIntUnmapPMR */
typedef struct PVRSRV_BRIDGE_IN_DEVMEMINTUNMAPPMR_TAG
{
IMG_HANDLE hMapping;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_DEVMEMINTUNMAPPMR;
/* Bridge out structure for DevmemIntUnmapPMR */
typedef struct PVRSRV_BRIDGE_OUT_DEVMEMINTUNMAPPMR_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DEVMEMINTUNMAPPMR;
/*******************************************
DevmemIntReserveRange
*******************************************/
/* Bridge in structure for DevmemIntReserveRange */
typedef struct PVRSRV_BRIDGE_IN_DEVMEMINTRESERVERANGE_TAG
{
IMG_HANDLE hDevmemServerHeap;
IMG_DEV_VIRTADDR sAddress;
IMG_DEVMEM_SIZE_T uiLength;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_DEVMEMINTRESERVERANGE;
/* Bridge out structure for DevmemIntReserveRange */
typedef struct PVRSRV_BRIDGE_OUT_DEVMEMINTRESERVERANGE_TAG
{
IMG_HANDLE hReservation;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DEVMEMINTRESERVERANGE;
/*******************************************
DevmemIntUnreserveRange
*******************************************/
/* Bridge in structure for DevmemIntUnreserveRange */
typedef struct PVRSRV_BRIDGE_IN_DEVMEMINTUNRESERVERANGE_TAG
{
IMG_HANDLE hReservation;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_DEVMEMINTUNRESERVERANGE;
/* Bridge out structure for DevmemIntUnreserveRange */
typedef struct PVRSRV_BRIDGE_OUT_DEVMEMINTUNRESERVERANGE_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DEVMEMINTUNRESERVERANGE;
/*******************************************
PhysmemNewRamBackedPMR
*******************************************/
/* Bridge in structure for PhysmemNewRamBackedPMR */
typedef struct PVRSRV_BRIDGE_IN_PHYSMEMNEWRAMBACKEDPMR_TAG
{
IMG_HANDLE hDeviceNode;
IMG_DEVMEM_SIZE_T uiSize;
IMG_DEVMEM_SIZE_T uiChunkSize;
IMG_UINT32 ui32NumPhysChunks;
IMG_UINT32 ui32NumVirtChunks;
IMG_BOOL * pbMappingTable;
IMG_UINT32 ui32Log2PageSize;
PVRSRV_MEMALLOCFLAGS_T uiFlags;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_PHYSMEMNEWRAMBACKEDPMR;
/* Bridge out structure for PhysmemNewRamBackedPMR */
typedef struct PVRSRV_BRIDGE_OUT_PHYSMEMNEWRAMBACKEDPMR_TAG
{
IMG_HANDLE hPMRPtr;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PHYSMEMNEWRAMBACKEDPMR;
/*******************************************
PMRLocalImportPMR
*******************************************/
/* Bridge in structure for PMRLocalImportPMR */
typedef struct PVRSRV_BRIDGE_IN_PMRLOCALIMPORTPMR_TAG
{
IMG_HANDLE hExtHandle;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_PMRLOCALIMPORTPMR;
/* Bridge out structure for PMRLocalImportPMR */
typedef struct PVRSRV_BRIDGE_OUT_PMRLOCALIMPORTPMR_TAG
{
IMG_HANDLE hPMR;
IMG_DEVMEM_SIZE_T uiSize;
IMG_DEVMEM_ALIGN_T sAlign;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PMRLOCALIMPORTPMR;
/*******************************************
PMRUnrefPMR
*******************************************/
/* Bridge in structure for PMRUnrefPMR */
typedef struct PVRSRV_BRIDGE_IN_PMRUNREFPMR_TAG
{
IMG_HANDLE hPMR;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_PMRUNREFPMR;
/* Bridge out structure for PMRUnrefPMR */
typedef struct PVRSRV_BRIDGE_OUT_PMRUNREFPMR_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PMRUNREFPMR;
/*******************************************
DevmemSLCFlushInvalRequest
*******************************************/
/* Bridge in structure for DevmemSLCFlushInvalRequest */
typedef struct PVRSRV_BRIDGE_IN_DEVMEMSLCFLUSHINVALREQUEST_TAG
{
IMG_HANDLE hDeviceNode;
IMG_HANDLE hPmr;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_DEVMEMSLCFLUSHINVALREQUEST;
/* Bridge out structure for DevmemSLCFlushInvalRequest */
typedef struct PVRSRV_BRIDGE_OUT_DEVMEMSLCFLUSHINVALREQUEST_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DEVMEMSLCFLUSHINVALREQUEST;
/*******************************************
DevmemIsVDevAddrValid
*******************************************/
/* Bridge in structure for DevmemIsVDevAddrValid */
typedef struct PVRSRV_BRIDGE_IN_DEVMEMISVDEVADDRVALID_TAG
{
IMG_HANDLE hDevmemCtx;
IMG_DEV_VIRTADDR sAddress;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_DEVMEMISVDEVADDRVALID;
/* Bridge out structure for DevmemIsVDevAddrValid */
typedef struct PVRSRV_BRIDGE_OUT_DEVMEMISVDEVADDRVALID_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DEVMEMISVDEVADDRVALID;
/*******************************************
HeapCfgHeapConfigCount
*******************************************/
/* Bridge in structure for HeapCfgHeapConfigCount */
typedef struct PVRSRV_BRIDGE_IN_HEAPCFGHEAPCONFIGCOUNT_TAG
{
IMG_HANDLE hDeviceNode;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_HEAPCFGHEAPCONFIGCOUNT;
/* Bridge out structure for HeapCfgHeapConfigCount */
typedef struct PVRSRV_BRIDGE_OUT_HEAPCFGHEAPCONFIGCOUNT_TAG
{
IMG_UINT32 ui32NumHeapConfigs;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_HEAPCFGHEAPCONFIGCOUNT;
/*******************************************
HeapCfgHeapCount
*******************************************/
/* Bridge in structure for HeapCfgHeapCount */
typedef struct PVRSRV_BRIDGE_IN_HEAPCFGHEAPCOUNT_TAG
{
IMG_HANDLE hDeviceNode;
IMG_UINT32 ui32HeapConfigIndex;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_HEAPCFGHEAPCOUNT;
/* Bridge out structure for HeapCfgHeapCount */
typedef struct PVRSRV_BRIDGE_OUT_HEAPCFGHEAPCOUNT_TAG
{
IMG_UINT32 ui32NumHeaps;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_HEAPCFGHEAPCOUNT;
/*******************************************
HeapCfgHeapConfigName
*******************************************/
/* Bridge in structure for HeapCfgHeapConfigName */
typedef struct PVRSRV_BRIDGE_IN_HEAPCFGHEAPCONFIGNAME_TAG
{
IMG_HANDLE hDeviceNode;
IMG_UINT32 ui32HeapConfigIndex;
IMG_UINT32 ui32HeapConfigNameBufSz;
/* Output pointer puiHeapConfigName is also an implied input */
IMG_CHAR * puiHeapConfigName;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_HEAPCFGHEAPCONFIGNAME;
/* Bridge out structure for HeapCfgHeapConfigName */
typedef struct PVRSRV_BRIDGE_OUT_HEAPCFGHEAPCONFIGNAME_TAG
{
IMG_CHAR * puiHeapConfigName;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_HEAPCFGHEAPCONFIGNAME;
/*******************************************
HeapCfgHeapDetails
*******************************************/
/* Bridge in structure for HeapCfgHeapDetails */
typedef struct PVRSRV_BRIDGE_IN_HEAPCFGHEAPDETAILS_TAG
{
IMG_HANDLE hDeviceNode;
IMG_UINT32 ui32HeapConfigIndex;
IMG_UINT32 ui32HeapIndex;
IMG_UINT32 ui32HeapNameBufSz;
/* Output pointer puiHeapNameOut is also an implied input */
IMG_CHAR * puiHeapNameOut;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_HEAPCFGHEAPDETAILS;
/* Bridge out structure for HeapCfgHeapDetails */
typedef struct PVRSRV_BRIDGE_OUT_HEAPCFGHEAPDETAILS_TAG
{
IMG_CHAR * puiHeapNameOut;
IMG_DEV_VIRTADDR sDevVAddrBase;
IMG_DEVMEM_SIZE_T uiHeapLength;
IMG_UINT32 ui32Log2DataPageSizeOut;
IMG_UINT32 ui32Log2ImportAlignmentOut;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_HEAPCFGHEAPDETAILS;
#endif /* COMMON_MM_BRIDGE_H */

File diff suppressed because it is too large Load Diff

View File

@@ -1,125 +0,0 @@
/*************************************************************************/ /*!
@File
@Title Common bridge header for pdump
@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
@Description Declares common defines and structures that are used by both
the client and sever side of the bridge for pdump
@License Dual MIT/GPLv2
The contents of this file are subject to the MIT license as set out below.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
Alternatively, the contents of this file may be used under the terms of
the GNU General Public License Version 2 ("GPL") in which case the provisions
of GPL are applicable instead of those above.
If you wish to allow use of your version of this file only under the terms of
GPL, and not to allow others to use your version of this file under the terms
of the MIT license, indicate your decision by deleting the provisions above
and replace them with the notice and other provisions required by GPL as set
out in the file called "GPL-COPYING" included in this distribution. If you do
not delete the provisions above, a recipient may use your version of this file
under the terms of either the MIT license or GPL.
This License is also included in this distribution in the file called
"MIT-COPYING".
EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ /**************************************************************************/
#ifndef COMMON_PDUMP_BRIDGE_H
#define COMMON_PDUMP_BRIDGE_H
#include "img_types.h"
#include "pvrsrv_error.h"
#include "devicemem_typedefs.h"
#include "pdumpdefs.h"
#define PVRSRV_BRIDGE_PDUMP_CMD_FIRST 0
#define PVRSRV_BRIDGE_PDUMP_DEVMEMPDUMPBITMAP PVRSRV_BRIDGE_PDUMP_CMD_FIRST+0
#define PVRSRV_BRIDGE_PDUMP_PVRSRVPDUMPCOMMENT PVRSRV_BRIDGE_PDUMP_CMD_FIRST+1
#define PVRSRV_BRIDGE_PDUMP_PVRSRVPDUMPSETFRAME PVRSRV_BRIDGE_PDUMP_CMD_FIRST+2
#define PVRSRV_BRIDGE_PDUMP_CMD_LAST (PVRSRV_BRIDGE_PDUMP_CMD_FIRST+2)
/*******************************************
DevmemPDumpBitmap
*******************************************/
/* Bridge in structure for DevmemPDumpBitmap */
typedef struct PVRSRV_BRIDGE_IN_DEVMEMPDUMPBITMAP_TAG
{
IMG_HANDLE hDeviceNode;
IMG_CHAR * puiFileName;
IMG_UINT32 ui32FileOffset;
IMG_UINT32 ui32Width;
IMG_UINT32 ui32Height;
IMG_UINT32 ui32StrideInBytes;
IMG_DEV_VIRTADDR sDevBaseAddr;
IMG_HANDLE hDevmemCtx;
IMG_UINT32 ui32Size;
PDUMP_PIXEL_FORMAT ePixelFormat;
IMG_UINT32 ui32AddrMode;
IMG_UINT32 ui32PDumpFlags;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_DEVMEMPDUMPBITMAP;
/* Bridge out structure for DevmemPDumpBitmap */
typedef struct PVRSRV_BRIDGE_OUT_DEVMEMPDUMPBITMAP_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DEVMEMPDUMPBITMAP;
/*******************************************
PVRSRVPDumpComment
*******************************************/
/* Bridge in structure for PVRSRVPDumpComment */
typedef struct PVRSRV_BRIDGE_IN_PVRSRVPDUMPCOMMENT_TAG
{
IMG_CHAR * puiComment;
IMG_UINT32 ui32Flags;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_PVRSRVPDUMPCOMMENT;
/* Bridge out structure for PVRSRVPDumpComment */
typedef struct PVRSRV_BRIDGE_OUT_PVRSRVPDUMPCOMMENT_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PVRSRVPDUMPCOMMENT;
/*******************************************
PVRSRVPDumpSetFrame
*******************************************/
/* Bridge in structure for PVRSRVPDumpSetFrame */
typedef struct PVRSRV_BRIDGE_IN_PVRSRVPDUMPSETFRAME_TAG
{
IMG_UINT32 ui32Frame;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_PVRSRVPDUMPSETFRAME;
/* Bridge out structure for PVRSRVPDumpSetFrame */
typedef struct PVRSRV_BRIDGE_OUT_PVRSRVPDUMPSETFRAME_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PVRSRVPDUMPSETFRAME;
#endif /* COMMON_PDUMP_BRIDGE_H */

View File

@@ -1,278 +0,0 @@
/*************************************************************************/ /*!
@File
@Title Server bridge for pdump
@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
@Description Implements the server side of the bridge for pdump
@License Dual MIT/GPLv2
The contents of this file are subject to the MIT license as set out below.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
Alternatively, the contents of this file may be used under the terms of
the GNU General Public License Version 2 ("GPL") in which case the provisions
of GPL are applicable instead of those above.
If you wish to allow use of your version of this file only under the terms of
GPL, and not to allow others to use your version of this file under the terms
of the MIT license, indicate your decision by deleting the provisions above
and replace them with the notice and other provisions required by GPL as set
out in the file called "GPL-COPYING" included in this distribution. If you do
not delete the provisions above, a recipient may use your version of this file
under the terms of either the MIT license or GPL.
This License is also included in this distribution in the file called
"MIT-COPYING".
EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ /**************************************************************************/
#include <stddef.h>
#include <linux/uaccess.h>
#include "img_defs.h"
#include "devicemem_server.h"
#include "pdump_km.h"
#include "common_pdump_bridge.h"
#include "allocmem.h"
#include "pvr_debug.h"
#include "connection_server.h"
#include "pvr_bridge.h"
#include "rgx_bridge.h"
#include "srvcore.h"
#include "handle.h"
#if defined (SUPPORT_AUTH)
#include "osauth.h"
#endif
#include <linux/slab.h>
/* ***************************************************************************
* Server-side bridge entry points
*/
static IMG_INT
PVRSRVBridgeDevmemPDumpBitmap(IMG_UINT32 ui32DispatchTableEntry,
PVRSRV_BRIDGE_IN_DEVMEMPDUMPBITMAP *psDevmemPDumpBitmapIN,
PVRSRV_BRIDGE_OUT_DEVMEMPDUMPBITMAP *psDevmemPDumpBitmapOUT,
CONNECTION_DATA *psConnection)
{
IMG_HANDLE hDeviceNodeInt = IMG_NULL;
IMG_CHAR *uiFileNameInt = IMG_NULL;
DEVMEMINT_CTX * psDevmemCtxInt = IMG_NULL;
{
uiFileNameInt = OSAllocMem(PVRSRV_PDUMP_MAX_FILENAME_SIZE * sizeof(IMG_CHAR));
if (!uiFileNameInt)
{
psDevmemPDumpBitmapOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY;
goto DevmemPDumpBitmap_exit;
}
}
/* Copy the data over */
if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psDevmemPDumpBitmapIN->puiFileName, PVRSRV_PDUMP_MAX_FILENAME_SIZE * sizeof(IMG_CHAR))
|| (OSCopyFromUser(NULL, uiFileNameInt, psDevmemPDumpBitmapIN->puiFileName,
PVRSRV_PDUMP_MAX_FILENAME_SIZE * sizeof(IMG_CHAR)) != PVRSRV_OK) )
{
psDevmemPDumpBitmapOUT->eError = PVRSRV_ERROR_INVALID_PARAMS;
goto DevmemPDumpBitmap_exit;
}
{
/* Look up the address from the handle */
psDevmemPDumpBitmapOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_VOID **) &hDeviceNodeInt,
psDevmemPDumpBitmapIN->hDeviceNode,
PVRSRV_HANDLE_TYPE_DEV_NODE);
if(psDevmemPDumpBitmapOUT->eError != PVRSRV_OK)
{
goto DevmemPDumpBitmap_exit;
}
}
{
/* Look up the address from the handle */
psDevmemPDumpBitmapOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_VOID **) &psDevmemCtxInt,
psDevmemPDumpBitmapIN->hDevmemCtx,
PVRSRV_HANDLE_TYPE_DEVMEMINT_CTX);
if(psDevmemPDumpBitmapOUT->eError != PVRSRV_OK)
{
goto DevmemPDumpBitmap_exit;
}
}
psDevmemPDumpBitmapOUT->eError =
DevmemIntPDumpBitmap(
hDeviceNodeInt,
uiFileNameInt,
psDevmemPDumpBitmapIN->ui32FileOffset,
psDevmemPDumpBitmapIN->ui32Width,
psDevmemPDumpBitmapIN->ui32Height,
psDevmemPDumpBitmapIN->ui32StrideInBytes,
psDevmemPDumpBitmapIN->sDevBaseAddr,
psDevmemCtxInt,
psDevmemPDumpBitmapIN->ui32Size,
psDevmemPDumpBitmapIN->ePixelFormat,
psDevmemPDumpBitmapIN->ui32AddrMode,
psDevmemPDumpBitmapIN->ui32PDumpFlags);
DevmemPDumpBitmap_exit:
if (uiFileNameInt)
OSFreeMem(uiFileNameInt);
return 0;
}
static IMG_INT
PVRSRVBridgePVRSRVPDumpComment(IMG_UINT32 ui32DispatchTableEntry,
PVRSRV_BRIDGE_IN_PVRSRVPDUMPCOMMENT *psPVRSRVPDumpCommentIN,
PVRSRV_BRIDGE_OUT_PVRSRVPDUMPCOMMENT *psPVRSRVPDumpCommentOUT,
CONNECTION_DATA *psConnection)
{
IMG_CHAR *uiCommentInt = IMG_NULL;
PVR_UNREFERENCED_PARAMETER(psConnection);
{
uiCommentInt = OSAllocMem(PVRSRV_PDUMP_MAX_COMMENT_SIZE * sizeof(IMG_CHAR));
if (!uiCommentInt)
{
psPVRSRVPDumpCommentOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY;
goto PVRSRVPDumpComment_exit;
}
}
/* Copy the data over */
if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psPVRSRVPDumpCommentIN->puiComment, PVRSRV_PDUMP_MAX_COMMENT_SIZE * sizeof(IMG_CHAR))
|| (OSCopyFromUser(NULL, uiCommentInt, psPVRSRVPDumpCommentIN->puiComment,
PVRSRV_PDUMP_MAX_COMMENT_SIZE * sizeof(IMG_CHAR)) != PVRSRV_OK) )
{
psPVRSRVPDumpCommentOUT->eError = PVRSRV_ERROR_INVALID_PARAMS;
goto PVRSRVPDumpComment_exit;
}
psPVRSRVPDumpCommentOUT->eError =
PDumpCommentKM(
uiCommentInt,
psPVRSRVPDumpCommentIN->ui32Flags);
PVRSRVPDumpComment_exit:
if (uiCommentInt)
OSFreeMem(uiCommentInt);
return 0;
}
static IMG_INT
PVRSRVBridgePVRSRVPDumpSetFrame(IMG_UINT32 ui32DispatchTableEntry,
PVRSRV_BRIDGE_IN_PVRSRVPDUMPSETFRAME *psPVRSRVPDumpSetFrameIN,
PVRSRV_BRIDGE_OUT_PVRSRVPDUMPSETFRAME *psPVRSRVPDumpSetFrameOUT,
CONNECTION_DATA *psConnection)
{
psPVRSRVPDumpSetFrameOUT->eError =
PDumpSetFrameKM(psConnection,
psPVRSRVPDumpSetFrameIN->ui32Frame);
return 0;
}
/* ***************************************************************************
* Server bridge dispatch related glue
*/
PVRSRV_ERROR InitPDUMPBridge(IMG_VOID);
PVRSRV_ERROR DeinitPDUMPBridge(IMG_VOID);
/*
* Register all PDUMP functions with services
*/
PVRSRV_ERROR InitPDUMPBridge(IMG_VOID)
{
SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMP, PVRSRV_BRIDGE_PDUMP_DEVMEMPDUMPBITMAP, PVRSRVBridgeDevmemPDumpBitmap,
IMG_NULL, IMG_NULL,
0, 0);
SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMP, PVRSRV_BRIDGE_PDUMP_PVRSRVPDUMPCOMMENT, PVRSRVBridgePVRSRVPDumpComment,
IMG_NULL, IMG_NULL,
0, 0);
SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMP, PVRSRV_BRIDGE_PDUMP_PVRSRVPDUMPSETFRAME, PVRSRVBridgePVRSRVPDumpSetFrame,
IMG_NULL, IMG_NULL,
0, 0);
return PVRSRV_OK;
}
/*
* Unregister all pdump functions with services
*/
PVRSRV_ERROR DeinitPDUMPBridge(IMG_VOID)
{
return PVRSRV_OK;
}

View File

@@ -1,172 +0,0 @@
/*************************************************************************/ /*!
@File
@Title Common bridge header for pdumpctrl
@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
@Description Declares common defines and structures that are used by both
the client and sever side of the bridge for pdumpctrl
@License Dual MIT/GPLv2
The contents of this file are subject to the MIT license as set out below.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
Alternatively, the contents of this file may be used under the terms of
the GNU General Public License Version 2 ("GPL") in which case the provisions
of GPL are applicable instead of those above.
If you wish to allow use of your version of this file only under the terms of
GPL, and not to allow others to use your version of this file under the terms
of the MIT license, indicate your decision by deleting the provisions above
and replace them with the notice and other provisions required by GPL as set
out in the file called "GPL-COPYING" included in this distribution. If you do
not delete the provisions above, a recipient may use your version of this file
under the terms of either the MIT license or GPL.
This License is also included in this distribution in the file called
"MIT-COPYING".
EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ /**************************************************************************/
#ifndef COMMON_PDUMPCTRL_BRIDGE_H
#define COMMON_PDUMPCTRL_BRIDGE_H
#include "img_types.h"
#include "pvrsrv_error.h"
#include "services.h"
#define PVRSRV_BRIDGE_PDUMPCTRL_CMD_FIRST 0
#define PVRSRV_BRIDGE_PDUMPCTRL_PVRSRVPDUMPISCAPTURING PVRSRV_BRIDGE_PDUMPCTRL_CMD_FIRST+0
#define PVRSRV_BRIDGE_PDUMPCTRL_PVRSRVPDUMPGETFRAME PVRSRV_BRIDGE_PDUMPCTRL_CMD_FIRST+1
#define PVRSRV_BRIDGE_PDUMPCTRL_PVRSRVPDUMPSETDEFAULTCAPTUREPARAMS PVRSRV_BRIDGE_PDUMPCTRL_CMD_FIRST+2
#define PVRSRV_BRIDGE_PDUMPCTRL_PVRSRVPDUMPISLASTCAPTUREFRAME PVRSRV_BRIDGE_PDUMPCTRL_CMD_FIRST+3
#define PVRSRV_BRIDGE_PDUMPCTRL_PVRSRVPDUMPSTARTINITPHASE PVRSRV_BRIDGE_PDUMPCTRL_CMD_FIRST+4
#define PVRSRV_BRIDGE_PDUMPCTRL_PVRSRVPDUMPSTOPINITPHASE PVRSRV_BRIDGE_PDUMPCTRL_CMD_FIRST+5
#define PVRSRV_BRIDGE_PDUMPCTRL_CMD_LAST (PVRSRV_BRIDGE_PDUMPCTRL_CMD_FIRST+5)
/*******************************************
PVRSRVPDumpIsCapturing
*******************************************/
/* Bridge in structure for PVRSRVPDumpIsCapturing */
typedef struct PVRSRV_BRIDGE_IN_PVRSRVPDUMPISCAPTURING_TAG
{
IMG_UINT32 ui32EmptyStructPlaceholder;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_PVRSRVPDUMPISCAPTURING;
/* Bridge out structure for PVRSRVPDumpIsCapturing */
typedef struct PVRSRV_BRIDGE_OUT_PVRSRVPDUMPISCAPTURING_TAG
{
IMG_BOOL bIsCapturing;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PVRSRVPDUMPISCAPTURING;
/*******************************************
PVRSRVPDumpGetFrame
*******************************************/
/* Bridge in structure for PVRSRVPDumpGetFrame */
typedef struct PVRSRV_BRIDGE_IN_PVRSRVPDUMPGETFRAME_TAG
{
IMG_UINT32 ui32EmptyStructPlaceholder;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_PVRSRVPDUMPGETFRAME;
/* Bridge out structure for PVRSRVPDumpGetFrame */
typedef struct PVRSRV_BRIDGE_OUT_PVRSRVPDUMPGETFRAME_TAG
{
IMG_UINT32 ui32Frame;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PVRSRVPDUMPGETFRAME;
/*******************************************
PVRSRVPDumpSetDefaultCaptureParams
*******************************************/
/* Bridge in structure for PVRSRVPDumpSetDefaultCaptureParams */
typedef struct PVRSRV_BRIDGE_IN_PVRSRVPDUMPSETDEFAULTCAPTUREPARAMS_TAG
{
IMG_UINT32 ui32Mode;
IMG_UINT32 ui32Start;
IMG_UINT32 ui32End;
IMG_UINT32 ui32Interval;
IMG_UINT32 ui32MaxParamFileSize;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_PVRSRVPDUMPSETDEFAULTCAPTUREPARAMS;
/* Bridge out structure for PVRSRVPDumpSetDefaultCaptureParams */
typedef struct PVRSRV_BRIDGE_OUT_PVRSRVPDUMPSETDEFAULTCAPTUREPARAMS_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PVRSRVPDUMPSETDEFAULTCAPTUREPARAMS;
/*******************************************
PVRSRVPDumpIsLastCaptureFrame
*******************************************/
/* Bridge in structure for PVRSRVPDumpIsLastCaptureFrame */
typedef struct PVRSRV_BRIDGE_IN_PVRSRVPDUMPISLASTCAPTUREFRAME_TAG
{
IMG_UINT32 ui32EmptyStructPlaceholder;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_PVRSRVPDUMPISLASTCAPTUREFRAME;
/* Bridge out structure for PVRSRVPDumpIsLastCaptureFrame */
typedef struct PVRSRV_BRIDGE_OUT_PVRSRVPDUMPISLASTCAPTUREFRAME_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PVRSRVPDUMPISLASTCAPTUREFRAME;
/*******************************************
PVRSRVPDumpStartInitPhase
*******************************************/
/* Bridge in structure for PVRSRVPDumpStartInitPhase */
typedef struct PVRSRV_BRIDGE_IN_PVRSRVPDUMPSTARTINITPHASE_TAG
{
IMG_UINT32 ui32EmptyStructPlaceholder;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_PVRSRVPDUMPSTARTINITPHASE;
/* Bridge out structure for PVRSRVPDumpStartInitPhase */
typedef struct PVRSRV_BRIDGE_OUT_PVRSRVPDUMPSTARTINITPHASE_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PVRSRVPDUMPSTARTINITPHASE;
/*******************************************
PVRSRVPDumpStopInitPhase
*******************************************/
/* Bridge in structure for PVRSRVPDumpStopInitPhase */
typedef struct PVRSRV_BRIDGE_IN_PVRSRVPDUMPSTOPINITPHASE_TAG
{
IMG_MODULE_ID eModuleID;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_PVRSRVPDUMPSTOPINITPHASE;
/* Bridge out structure for PVRSRVPDumpStopInitPhase */
typedef struct PVRSRV_BRIDGE_OUT_PVRSRVPDUMPSTOPINITPHASE_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PVRSRVPDUMPSTOPINITPHASE;
#endif /* COMMON_PDUMPCTRL_BRIDGE_H */

View File

@@ -1,288 +0,0 @@
/*************************************************************************/ /*!
@File
@Title Server bridge for pdumpctrl
@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
@Description Implements the server side of the bridge for pdumpctrl
@License Dual MIT/GPLv2
The contents of this file are subject to the MIT license as set out below.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
Alternatively, the contents of this file may be used under the terms of
the GNU General Public License Version 2 ("GPL") in which case the provisions
of GPL are applicable instead of those above.
If you wish to allow use of your version of this file only under the terms of
GPL, and not to allow others to use your version of this file under the terms
of the MIT license, indicate your decision by deleting the provisions above
and replace them with the notice and other provisions required by GPL as set
out in the file called "GPL-COPYING" included in this distribution. If you do
not delete the provisions above, a recipient may use your version of this file
under the terms of either the MIT license or GPL.
This License is also included in this distribution in the file called
"MIT-COPYING".
EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ /**************************************************************************/
#include <stddef.h>
#include <linux/uaccess.h>
#include "img_defs.h"
#include "pdump_km.h"
#include "common_pdumpctrl_bridge.h"
#include "allocmem.h"
#include "pvr_debug.h"
#include "connection_server.h"
#include "pvr_bridge.h"
#include "rgx_bridge.h"
#include "srvcore.h"
#include "handle.h"
#if defined (SUPPORT_AUTH)
#include "osauth.h"
#endif
#include <linux/slab.h>
#include "lock.h"
/* ***************************************************************************
* Server-side bridge entry points
*/
static IMG_INT
PVRSRVBridgePVRSRVPDumpIsCapturing(IMG_UINT32 ui32DispatchTableEntry,
PVRSRV_BRIDGE_IN_PVRSRVPDUMPISCAPTURING *psPVRSRVPDumpIsCapturingIN,
PVRSRV_BRIDGE_OUT_PVRSRVPDUMPISCAPTURING *psPVRSRVPDumpIsCapturingOUT,
CONNECTION_DATA *psConnection)
{
PVR_UNREFERENCED_PARAMETER(psConnection);
PVR_UNREFERENCED_PARAMETER(psPVRSRVPDumpIsCapturingIN);
psPVRSRVPDumpIsCapturingOUT->eError =
PDumpIsCaptureFrameKM(
&psPVRSRVPDumpIsCapturingOUT->bIsCapturing);
return 0;
}
static IMG_INT
PVRSRVBridgePVRSRVPDumpGetFrame(IMG_UINT32 ui32DispatchTableEntry,
PVRSRV_BRIDGE_IN_PVRSRVPDUMPGETFRAME *psPVRSRVPDumpGetFrameIN,
PVRSRV_BRIDGE_OUT_PVRSRVPDUMPGETFRAME *psPVRSRVPDumpGetFrameOUT,
CONNECTION_DATA *psConnection)
{
PVR_UNREFERENCED_PARAMETER(psPVRSRVPDumpGetFrameIN);
psPVRSRVPDumpGetFrameOUT->eError =
PDumpGetFrameKM(psConnection,
&psPVRSRVPDumpGetFrameOUT->ui32Frame);
return 0;
}
static IMG_INT
PVRSRVBridgePVRSRVPDumpSetDefaultCaptureParams(IMG_UINT32 ui32DispatchTableEntry,
PVRSRV_BRIDGE_IN_PVRSRVPDUMPSETDEFAULTCAPTUREPARAMS *psPVRSRVPDumpSetDefaultCaptureParamsIN,
PVRSRV_BRIDGE_OUT_PVRSRVPDUMPSETDEFAULTCAPTUREPARAMS *psPVRSRVPDumpSetDefaultCaptureParamsOUT,
CONNECTION_DATA *psConnection)
{
PVR_UNREFERENCED_PARAMETER(psConnection);
psPVRSRVPDumpSetDefaultCaptureParamsOUT->eError =
PDumpSetDefaultCaptureParamsKM(
psPVRSRVPDumpSetDefaultCaptureParamsIN->ui32Mode,
psPVRSRVPDumpSetDefaultCaptureParamsIN->ui32Start,
psPVRSRVPDumpSetDefaultCaptureParamsIN->ui32End,
psPVRSRVPDumpSetDefaultCaptureParamsIN->ui32Interval,
psPVRSRVPDumpSetDefaultCaptureParamsIN->ui32MaxParamFileSize);
return 0;
}
static IMG_INT
PVRSRVBridgePVRSRVPDumpIsLastCaptureFrame(IMG_UINT32 ui32DispatchTableEntry,
PVRSRV_BRIDGE_IN_PVRSRVPDUMPISLASTCAPTUREFRAME *psPVRSRVPDumpIsLastCaptureFrameIN,
PVRSRV_BRIDGE_OUT_PVRSRVPDUMPISLASTCAPTUREFRAME *psPVRSRVPDumpIsLastCaptureFrameOUT,
CONNECTION_DATA *psConnection)
{
PVR_UNREFERENCED_PARAMETER(psConnection);
PVR_UNREFERENCED_PARAMETER(psPVRSRVPDumpIsLastCaptureFrameIN);
psPVRSRVPDumpIsLastCaptureFrameOUT->eError =
PDumpIsLastCaptureFrameKM(
);
return 0;
}
static IMG_INT
PVRSRVBridgePVRSRVPDumpStartInitPhase(IMG_UINT32 ui32DispatchTableEntry,
PVRSRV_BRIDGE_IN_PVRSRVPDUMPSTARTINITPHASE *psPVRSRVPDumpStartInitPhaseIN,
PVRSRV_BRIDGE_OUT_PVRSRVPDUMPSTARTINITPHASE *psPVRSRVPDumpStartInitPhaseOUT,
CONNECTION_DATA *psConnection)
{
PVR_UNREFERENCED_PARAMETER(psConnection);
PVR_UNREFERENCED_PARAMETER(psPVRSRVPDumpStartInitPhaseIN);
psPVRSRVPDumpStartInitPhaseOUT->eError =
PDumpStartInitPhaseKM(
);
return 0;
}
static IMG_INT
PVRSRVBridgePVRSRVPDumpStopInitPhase(IMG_UINT32 ui32DispatchTableEntry,
PVRSRV_BRIDGE_IN_PVRSRVPDUMPSTOPINITPHASE *psPVRSRVPDumpStopInitPhaseIN,
PVRSRV_BRIDGE_OUT_PVRSRVPDUMPSTOPINITPHASE *psPVRSRVPDumpStopInitPhaseOUT,
CONNECTION_DATA *psConnection)
{
PVR_UNREFERENCED_PARAMETER(psConnection);
psPVRSRVPDumpStopInitPhaseOUT->eError =
PDumpStopInitPhaseKM(
psPVRSRVPDumpStopInitPhaseIN->eModuleID);
return 0;
}
/* ***************************************************************************
* Server bridge dispatch related glue
*/
static POS_LOCK pPDUMPCTRLBridgeLock;
static IMG_BYTE pbyPDUMPCTRLBridgeBuffer[20 + 8];
PVRSRV_ERROR InitPDUMPCTRLBridge(IMG_VOID);
PVRSRV_ERROR DeinitPDUMPCTRLBridge(IMG_VOID);
/*
* Register all PDUMPCTRL functions with services
*/
PVRSRV_ERROR InitPDUMPCTRLBridge(IMG_VOID)
{
PVR_LOGR_IF_ERROR(OSLockCreate(&pPDUMPCTRLBridgeLock, LOCK_TYPE_PASSIVE), "OSLockCreate");
SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMPCTRL, PVRSRV_BRIDGE_PDUMPCTRL_PVRSRVPDUMPISCAPTURING, PVRSRVBridgePVRSRVPDumpIsCapturing,
pPDUMPCTRLBridgeLock, pbyPDUMPCTRLBridgeBuffer,
20, 8);
SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMPCTRL, PVRSRV_BRIDGE_PDUMPCTRL_PVRSRVPDUMPGETFRAME, PVRSRVBridgePVRSRVPDumpGetFrame,
pPDUMPCTRLBridgeLock, pbyPDUMPCTRLBridgeBuffer,
20, 8);
SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMPCTRL, PVRSRV_BRIDGE_PDUMPCTRL_PVRSRVPDUMPSETDEFAULTCAPTUREPARAMS, PVRSRVBridgePVRSRVPDumpSetDefaultCaptureParams,
pPDUMPCTRLBridgeLock, pbyPDUMPCTRLBridgeBuffer,
20, 8);
SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMPCTRL, PVRSRV_BRIDGE_PDUMPCTRL_PVRSRVPDUMPISLASTCAPTUREFRAME, PVRSRVBridgePVRSRVPDumpIsLastCaptureFrame,
pPDUMPCTRLBridgeLock, pbyPDUMPCTRLBridgeBuffer,
20, 8);
SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMPCTRL, PVRSRV_BRIDGE_PDUMPCTRL_PVRSRVPDUMPSTARTINITPHASE, PVRSRVBridgePVRSRVPDumpStartInitPhase,
pPDUMPCTRLBridgeLock, pbyPDUMPCTRLBridgeBuffer,
20, 8);
SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMPCTRL, PVRSRV_BRIDGE_PDUMPCTRL_PVRSRVPDUMPSTOPINITPHASE, PVRSRVBridgePVRSRVPDumpStopInitPhase,
pPDUMPCTRLBridgeLock, pbyPDUMPCTRLBridgeBuffer,
20, 8);
return PVRSRV_OK;
}
/*
* Unregister all pdumpctrl functions with services
*/
PVRSRV_ERROR DeinitPDUMPCTRLBridge(IMG_VOID)
{
PVR_LOGR_IF_ERROR(OSLockDestroy(pPDUMPCTRLBridgeLock), "OSLockDestroy");
return PVRSRV_OK;
}

View File

@@ -1,113 +0,0 @@
/*************************************************************************/ /*!
@File
@Title Client bridge header for pdumpmm
@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
@Description Exports the client bridge functions for pdumpmm
@License Dual MIT/GPLv2
The contents of this file are subject to the MIT license as set out below.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
Alternatively, the contents of this file may be used under the terms of
the GNU General Public License Version 2 ("GPL") in which case the provisions
of GPL are applicable instead of those above.
If you wish to allow use of your version of this file only under the terms of
GPL, and not to allow others to use your version of this file under the terms
of the MIT license, indicate your decision by deleting the provisions above
and replace them with the notice and other provisions required by GPL as set
out in the file called "GPL-COPYING" included in this distribution. If you do
not delete the provisions above, a recipient may use your version of this file
under the terms of either the MIT license or GPL.
This License is also included in this distribution in the file called
"MIT-COPYING".
EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ /**************************************************************************/
#ifndef CLIENT_PDUMPMM_BRIDGE_H
#define CLIENT_PDUMPMM_BRIDGE_H
#include "pvr_bridge_client.h"
#include "pvr_bridge.h"
#include "common_pdumpmm_bridge.h"
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgePMRPDumpLoadMem(IMG_HANDLE hBridge,
IMG_HANDLE hPMR,
IMG_DEVMEM_OFFSET_T uiOffset,
IMG_DEVMEM_SIZE_T uiSize,
IMG_UINT32 ui32PDumpFlags,
IMG_BOOL bbZero);
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgePMRPDumpLoadMemValue32(IMG_HANDLE hBridge,
IMG_HANDLE hPMR,
IMG_DEVMEM_OFFSET_T uiOffset,
IMG_UINT32 ui32Value,
IMG_UINT32 ui32PDumpFlags);
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgePMRPDumpLoadMemValue64(IMG_HANDLE hBridge,
IMG_HANDLE hPMR,
IMG_DEVMEM_OFFSET_T uiOffset,
IMG_UINT64 ui64Value,
IMG_UINT32 ui32PDumpFlags);
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgePMRPDumpSaveToFile(IMG_HANDLE hBridge,
IMG_HANDLE hPMR,
IMG_DEVMEM_OFFSET_T uiOffset,
IMG_DEVMEM_SIZE_T uiSize,
IMG_UINT32 ui32ArraySize,
const IMG_CHAR *puiFileName);
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgePMRPDumpSymbolicAddr(IMG_HANDLE hBridge,
IMG_HANDLE hPMR,
IMG_DEVMEM_OFFSET_T uiOffset,
IMG_UINT32 ui32MemspaceNameLen,
IMG_CHAR *puiMemspaceName,
IMG_UINT32 ui32SymbolicAddrLen,
IMG_CHAR *puiSymbolicAddr,
IMG_DEVMEM_OFFSET_T *puiNewOffset,
IMG_DEVMEM_OFFSET_T *puiNextSymName);
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgePMRPDumpPol32(IMG_HANDLE hBridge,
IMG_HANDLE hPMR,
IMG_DEVMEM_OFFSET_T uiOffset,
IMG_UINT32 ui32Value,
IMG_UINT32 ui32Mask,
PDUMP_POLL_OPERATOR eOperator,
IMG_UINT32 ui32PDumpFlags);
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgePMRPDumpCBP(IMG_HANDLE hBridge,
IMG_HANDLE hPMR,
IMG_DEVMEM_OFFSET_T uiReadOffset,
IMG_DEVMEM_OFFSET_T uiWriteOffset,
IMG_DEVMEM_SIZE_T uiPacketSize,
IMG_DEVMEM_SIZE_T uiBufferSize);
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeDevmemIntPDumpSaveToFileVirtual(IMG_HANDLE hBridge,
IMG_HANDLE hDevmemServerContext,
IMG_DEV_VIRTADDR sAddress,
IMG_DEVMEM_SIZE_T uiSize,
IMG_UINT32 ui32ArraySize,
const IMG_CHAR *puiFileName,
IMG_UINT32 ui32FileOffset,
IMG_UINT32 ui32PDumpFlags);
#endif /* CLIENT_PDUMPMM_BRIDGE_H */

View File

@@ -1,245 +0,0 @@
/*************************************************************************/ /*!
@File
@Title Common bridge header for pdumpmm
@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
@Description Declares common defines and structures that are used by both
the client and sever side of the bridge for pdumpmm
@License Dual MIT/GPLv2
The contents of this file are subject to the MIT license as set out below.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
Alternatively, the contents of this file may be used under the terms of
the GNU General Public License Version 2 ("GPL") in which case the provisions
of GPL are applicable instead of those above.
If you wish to allow use of your version of this file only under the terms of
GPL, and not to allow others to use your version of this file under the terms
of the MIT license, indicate your decision by deleting the provisions above
and replace them with the notice and other provisions required by GPL as set
out in the file called "GPL-COPYING" included in this distribution. If you do
not delete the provisions above, a recipient may use your version of this file
under the terms of either the MIT license or GPL.
This License is also included in this distribution in the file called
"MIT-COPYING".
EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ /**************************************************************************/
#ifndef COMMON_PDUMPMM_BRIDGE_H
#define COMMON_PDUMPMM_BRIDGE_H
#include "img_types.h"
#include "pvrsrv_error.h"
#include "pdump.h"
#include "pdumpdefs.h"
#include "pvrsrv_memallocflags.h"
#include "devicemem_typedefs.h"
#define PVRSRV_BRIDGE_PDUMPMM_CMD_FIRST 0
#define PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPLOADMEM PVRSRV_BRIDGE_PDUMPMM_CMD_FIRST+0
#define PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPLOADMEMVALUE32 PVRSRV_BRIDGE_PDUMPMM_CMD_FIRST+1
#define PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPLOADMEMVALUE64 PVRSRV_BRIDGE_PDUMPMM_CMD_FIRST+2
#define PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPSAVETOFILE PVRSRV_BRIDGE_PDUMPMM_CMD_FIRST+3
#define PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPSYMBOLICADDR PVRSRV_BRIDGE_PDUMPMM_CMD_FIRST+4
#define PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPPOL32 PVRSRV_BRIDGE_PDUMPMM_CMD_FIRST+5
#define PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPCBP PVRSRV_BRIDGE_PDUMPMM_CMD_FIRST+6
#define PVRSRV_BRIDGE_PDUMPMM_DEVMEMINTPDUMPSAVETOFILEVIRTUAL PVRSRV_BRIDGE_PDUMPMM_CMD_FIRST+7
#define PVRSRV_BRIDGE_PDUMPMM_CMD_LAST (PVRSRV_BRIDGE_PDUMPMM_CMD_FIRST+7)
/*******************************************
PMRPDumpLoadMem
*******************************************/
/* Bridge in structure for PMRPDumpLoadMem */
typedef struct PVRSRV_BRIDGE_IN_PMRPDUMPLOADMEM_TAG
{
IMG_HANDLE hPMR;
IMG_DEVMEM_OFFSET_T uiOffset;
IMG_DEVMEM_SIZE_T uiSize;
IMG_UINT32 ui32PDumpFlags;
IMG_BOOL bbZero;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_PMRPDUMPLOADMEM;
/* Bridge out structure for PMRPDumpLoadMem */
typedef struct PVRSRV_BRIDGE_OUT_PMRPDUMPLOADMEM_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PMRPDUMPLOADMEM;
/*******************************************
PMRPDumpLoadMemValue32
*******************************************/
/* Bridge in structure for PMRPDumpLoadMemValue32 */
typedef struct PVRSRV_BRIDGE_IN_PMRPDUMPLOADMEMVALUE32_TAG
{
IMG_HANDLE hPMR;
IMG_DEVMEM_OFFSET_T uiOffset;
IMG_UINT32 ui32Value;
IMG_UINT32 ui32PDumpFlags;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_PMRPDUMPLOADMEMVALUE32;
/* Bridge out structure for PMRPDumpLoadMemValue32 */
typedef struct PVRSRV_BRIDGE_OUT_PMRPDUMPLOADMEMVALUE32_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PMRPDUMPLOADMEMVALUE32;
/*******************************************
PMRPDumpLoadMemValue64
*******************************************/
/* Bridge in structure for PMRPDumpLoadMemValue64 */
typedef struct PVRSRV_BRIDGE_IN_PMRPDUMPLOADMEMVALUE64_TAG
{
IMG_HANDLE hPMR;
IMG_DEVMEM_OFFSET_T uiOffset;
IMG_UINT64 ui64Value;
IMG_UINT32 ui32PDumpFlags;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_PMRPDUMPLOADMEMVALUE64;
/* Bridge out structure for PMRPDumpLoadMemValue64 */
typedef struct PVRSRV_BRIDGE_OUT_PMRPDUMPLOADMEMVALUE64_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PMRPDUMPLOADMEMVALUE64;
/*******************************************
PMRPDumpSaveToFile
*******************************************/
/* Bridge in structure for PMRPDumpSaveToFile */
typedef struct PVRSRV_BRIDGE_IN_PMRPDUMPSAVETOFILE_TAG
{
IMG_HANDLE hPMR;
IMG_DEVMEM_OFFSET_T uiOffset;
IMG_DEVMEM_SIZE_T uiSize;
IMG_UINT32 ui32ArraySize;
const IMG_CHAR * puiFileName;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_PMRPDUMPSAVETOFILE;
/* Bridge out structure for PMRPDumpSaveToFile */
typedef struct PVRSRV_BRIDGE_OUT_PMRPDUMPSAVETOFILE_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PMRPDUMPSAVETOFILE;
/*******************************************
PMRPDumpSymbolicAddr
*******************************************/
/* Bridge in structure for PMRPDumpSymbolicAddr */
typedef struct PVRSRV_BRIDGE_IN_PMRPDUMPSYMBOLICADDR_TAG
{
IMG_HANDLE hPMR;
IMG_DEVMEM_OFFSET_T uiOffset;
IMG_UINT32 ui32MemspaceNameLen;
IMG_UINT32 ui32SymbolicAddrLen;
/* Output pointer puiMemspaceName is also an implied input */
IMG_CHAR * puiMemspaceName;
/* Output pointer puiSymbolicAddr is also an implied input */
IMG_CHAR * puiSymbolicAddr;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_PMRPDUMPSYMBOLICADDR;
/* Bridge out structure for PMRPDumpSymbolicAddr */
typedef struct PVRSRV_BRIDGE_OUT_PMRPDUMPSYMBOLICADDR_TAG
{
IMG_CHAR * puiMemspaceName;
IMG_CHAR * puiSymbolicAddr;
IMG_DEVMEM_OFFSET_T uiNewOffset;
IMG_DEVMEM_OFFSET_T uiNextSymName;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PMRPDUMPSYMBOLICADDR;
/*******************************************
PMRPDumpPol32
*******************************************/
/* Bridge in structure for PMRPDumpPol32 */
typedef struct PVRSRV_BRIDGE_IN_PMRPDUMPPOL32_TAG
{
IMG_HANDLE hPMR;
IMG_DEVMEM_OFFSET_T uiOffset;
IMG_UINT32 ui32Value;
IMG_UINT32 ui32Mask;
PDUMP_POLL_OPERATOR eOperator;
IMG_UINT32 ui32PDumpFlags;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_PMRPDUMPPOL32;
/* Bridge out structure for PMRPDumpPol32 */
typedef struct PVRSRV_BRIDGE_OUT_PMRPDUMPPOL32_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PMRPDUMPPOL32;
/*******************************************
PMRPDumpCBP
*******************************************/
/* Bridge in structure for PMRPDumpCBP */
typedef struct PVRSRV_BRIDGE_IN_PMRPDUMPCBP_TAG
{
IMG_HANDLE hPMR;
IMG_DEVMEM_OFFSET_T uiReadOffset;
IMG_DEVMEM_OFFSET_T uiWriteOffset;
IMG_DEVMEM_SIZE_T uiPacketSize;
IMG_DEVMEM_SIZE_T uiBufferSize;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_PMRPDUMPCBP;
/* Bridge out structure for PMRPDumpCBP */
typedef struct PVRSRV_BRIDGE_OUT_PMRPDUMPCBP_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PMRPDUMPCBP;
/*******************************************
DevmemIntPDumpSaveToFileVirtual
*******************************************/
/* Bridge in structure for DevmemIntPDumpSaveToFileVirtual */
typedef struct PVRSRV_BRIDGE_IN_DEVMEMINTPDUMPSAVETOFILEVIRTUAL_TAG
{
IMG_HANDLE hDevmemServerContext;
IMG_DEV_VIRTADDR sAddress;
IMG_DEVMEM_SIZE_T uiSize;
IMG_UINT32 ui32ArraySize;
const IMG_CHAR * puiFileName;
IMG_UINT32 ui32FileOffset;
IMG_UINT32 ui32PDumpFlags;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_DEVMEMINTPDUMPSAVETOFILEVIRTUAL;
/* Bridge out structure for DevmemIntPDumpSaveToFileVirtual */
typedef struct PVRSRV_BRIDGE_OUT_DEVMEMINTPDUMPSAVETOFILEVIRTUAL_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DEVMEMINTPDUMPSAVETOFILEVIRTUAL;
#endif /* COMMON_PDUMPMM_BRIDGE_H */

View File

@@ -1,586 +0,0 @@
/*************************************************************************/ /*!
@File
@Title Server bridge for pdumpmm
@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
@Description Implements the server side of the bridge for pdumpmm
@License Dual MIT/GPLv2
The contents of this file are subject to the MIT license as set out below.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
Alternatively, the contents of this file may be used under the terms of
the GNU General Public License Version 2 ("GPL") in which case the provisions
of GPL are applicable instead of those above.
If you wish to allow use of your version of this file only under the terms of
GPL, and not to allow others to use your version of this file under the terms
of the MIT license, indicate your decision by deleting the provisions above
and replace them with the notice and other provisions required by GPL as set
out in the file called "GPL-COPYING" included in this distribution. If you do
not delete the provisions above, a recipient may use your version of this file
under the terms of either the MIT license or GPL.
This License is also included in this distribution in the file called
"MIT-COPYING".
EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ /**************************************************************************/
#include <stddef.h>
#include <linux/uaccess.h>
#include "img_defs.h"
#include "devicemem_server.h"
#include "pmr.h"
#include "physmem.h"
#include "common_pdumpmm_bridge.h"
#include "allocmem.h"
#include "pvr_debug.h"
#include "connection_server.h"
#include "pvr_bridge.h"
#include "rgx_bridge.h"
#include "srvcore.h"
#include "handle.h"
#if defined (SUPPORT_AUTH)
#include "osauth.h"
#endif
#include <linux/slab.h>
/* ***************************************************************************
* Server-side bridge entry points
*/
static IMG_INT
PVRSRVBridgePMRPDumpLoadMem(IMG_UINT32 ui32DispatchTableEntry,
PVRSRV_BRIDGE_IN_PMRPDUMPLOADMEM *psPMRPDumpLoadMemIN,
PVRSRV_BRIDGE_OUT_PMRPDUMPLOADMEM *psPMRPDumpLoadMemOUT,
CONNECTION_DATA *psConnection)
{
PMR * psPMRInt = IMG_NULL;
{
/* Look up the address from the handle */
psPMRPDumpLoadMemOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_VOID **) &psPMRInt,
psPMRPDumpLoadMemIN->hPMR,
PVRSRV_HANDLE_TYPE_PHYSMEM_PMR);
if(psPMRPDumpLoadMemOUT->eError != PVRSRV_OK)
{
goto PMRPDumpLoadMem_exit;
}
}
psPMRPDumpLoadMemOUT->eError =
PMRPDumpLoadMem(
psPMRInt,
psPMRPDumpLoadMemIN->uiOffset,
psPMRPDumpLoadMemIN->uiSize,
psPMRPDumpLoadMemIN->ui32PDumpFlags,
psPMRPDumpLoadMemIN->bbZero);
PMRPDumpLoadMem_exit:
return 0;
}
static IMG_INT
PVRSRVBridgePMRPDumpLoadMemValue32(IMG_UINT32 ui32DispatchTableEntry,
PVRSRV_BRIDGE_IN_PMRPDUMPLOADMEMVALUE32 *psPMRPDumpLoadMemValue32IN,
PVRSRV_BRIDGE_OUT_PMRPDUMPLOADMEMVALUE32 *psPMRPDumpLoadMemValue32OUT,
CONNECTION_DATA *psConnection)
{
PMR * psPMRInt = IMG_NULL;
{
/* Look up the address from the handle */
psPMRPDumpLoadMemValue32OUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_VOID **) &psPMRInt,
psPMRPDumpLoadMemValue32IN->hPMR,
PVRSRV_HANDLE_TYPE_PHYSMEM_PMR);
if(psPMRPDumpLoadMemValue32OUT->eError != PVRSRV_OK)
{
goto PMRPDumpLoadMemValue32_exit;
}
}
psPMRPDumpLoadMemValue32OUT->eError =
PMRPDumpLoadMemValue32(
psPMRInt,
psPMRPDumpLoadMemValue32IN->uiOffset,
psPMRPDumpLoadMemValue32IN->ui32Value,
psPMRPDumpLoadMemValue32IN->ui32PDumpFlags);
PMRPDumpLoadMemValue32_exit:
return 0;
}
static IMG_INT
PVRSRVBridgePMRPDumpLoadMemValue64(IMG_UINT32 ui32DispatchTableEntry,
PVRSRV_BRIDGE_IN_PMRPDUMPLOADMEMVALUE64 *psPMRPDumpLoadMemValue64IN,
PVRSRV_BRIDGE_OUT_PMRPDUMPLOADMEMVALUE64 *psPMRPDumpLoadMemValue64OUT,
CONNECTION_DATA *psConnection)
{
PMR * psPMRInt = IMG_NULL;
{
/* Look up the address from the handle */
psPMRPDumpLoadMemValue64OUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_VOID **) &psPMRInt,
psPMRPDumpLoadMemValue64IN->hPMR,
PVRSRV_HANDLE_TYPE_PHYSMEM_PMR);
if(psPMRPDumpLoadMemValue64OUT->eError != PVRSRV_OK)
{
goto PMRPDumpLoadMemValue64_exit;
}
}
psPMRPDumpLoadMemValue64OUT->eError =
PMRPDumpLoadMemValue64(
psPMRInt,
psPMRPDumpLoadMemValue64IN->uiOffset,
psPMRPDumpLoadMemValue64IN->ui64Value,
psPMRPDumpLoadMemValue64IN->ui32PDumpFlags);
PMRPDumpLoadMemValue64_exit:
return 0;
}
static IMG_INT
PVRSRVBridgePMRPDumpSaveToFile(IMG_UINT32 ui32DispatchTableEntry,
PVRSRV_BRIDGE_IN_PMRPDUMPSAVETOFILE *psPMRPDumpSaveToFileIN,
PVRSRV_BRIDGE_OUT_PMRPDUMPSAVETOFILE *psPMRPDumpSaveToFileOUT,
CONNECTION_DATA *psConnection)
{
PMR * psPMRInt = IMG_NULL;
IMG_CHAR *uiFileNameInt = IMG_NULL;
if (psPMRPDumpSaveToFileIN->ui32ArraySize != 0)
{
uiFileNameInt = OSAllocMem(psPMRPDumpSaveToFileIN->ui32ArraySize * sizeof(IMG_CHAR));
if (!uiFileNameInt)
{
psPMRPDumpSaveToFileOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY;
goto PMRPDumpSaveToFile_exit;
}
}
/* Copy the data over */
if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psPMRPDumpSaveToFileIN->puiFileName, psPMRPDumpSaveToFileIN->ui32ArraySize * sizeof(IMG_CHAR))
|| (OSCopyFromUser(NULL, uiFileNameInt, psPMRPDumpSaveToFileIN->puiFileName,
psPMRPDumpSaveToFileIN->ui32ArraySize * sizeof(IMG_CHAR)) != PVRSRV_OK) )
{
psPMRPDumpSaveToFileOUT->eError = PVRSRV_ERROR_INVALID_PARAMS;
goto PMRPDumpSaveToFile_exit;
}
{
/* Look up the address from the handle */
psPMRPDumpSaveToFileOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_VOID **) &psPMRInt,
psPMRPDumpSaveToFileIN->hPMR,
PVRSRV_HANDLE_TYPE_PHYSMEM_PMR);
if(psPMRPDumpSaveToFileOUT->eError != PVRSRV_OK)
{
goto PMRPDumpSaveToFile_exit;
}
}
psPMRPDumpSaveToFileOUT->eError =
PMRPDumpSaveToFile(
psPMRInt,
psPMRPDumpSaveToFileIN->uiOffset,
psPMRPDumpSaveToFileIN->uiSize,
psPMRPDumpSaveToFileIN->ui32ArraySize,
uiFileNameInt);
PMRPDumpSaveToFile_exit:
if (uiFileNameInt)
OSFreeMem(uiFileNameInt);
return 0;
}
static IMG_INT
PVRSRVBridgePMRPDumpSymbolicAddr(IMG_UINT32 ui32DispatchTableEntry,
PVRSRV_BRIDGE_IN_PMRPDUMPSYMBOLICADDR *psPMRPDumpSymbolicAddrIN,
PVRSRV_BRIDGE_OUT_PMRPDUMPSYMBOLICADDR *psPMRPDumpSymbolicAddrOUT,
CONNECTION_DATA *psConnection)
{
PMR * psPMRInt = IMG_NULL;
IMG_CHAR *puiMemspaceNameInt = IMG_NULL;
IMG_CHAR *puiSymbolicAddrInt = IMG_NULL;
psPMRPDumpSymbolicAddrOUT->puiMemspaceName = psPMRPDumpSymbolicAddrIN->puiMemspaceName;
psPMRPDumpSymbolicAddrOUT->puiSymbolicAddr = psPMRPDumpSymbolicAddrIN->puiSymbolicAddr;
if (psPMRPDumpSymbolicAddrIN->ui32MemspaceNameLen != 0)
{
puiMemspaceNameInt = OSAllocMem(psPMRPDumpSymbolicAddrIN->ui32MemspaceNameLen * sizeof(IMG_CHAR));
if (!puiMemspaceNameInt)
{
psPMRPDumpSymbolicAddrOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY;
goto PMRPDumpSymbolicAddr_exit;
}
}
if (psPMRPDumpSymbolicAddrIN->ui32SymbolicAddrLen != 0)
{
puiSymbolicAddrInt = OSAllocMem(psPMRPDumpSymbolicAddrIN->ui32SymbolicAddrLen * sizeof(IMG_CHAR));
if (!puiSymbolicAddrInt)
{
psPMRPDumpSymbolicAddrOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY;
goto PMRPDumpSymbolicAddr_exit;
}
}
{
/* Look up the address from the handle */
psPMRPDumpSymbolicAddrOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_VOID **) &psPMRInt,
psPMRPDumpSymbolicAddrIN->hPMR,
PVRSRV_HANDLE_TYPE_PHYSMEM_PMR);
if(psPMRPDumpSymbolicAddrOUT->eError != PVRSRV_OK)
{
goto PMRPDumpSymbolicAddr_exit;
}
}
psPMRPDumpSymbolicAddrOUT->eError =
PMR_PDumpSymbolicAddr(
psPMRInt,
psPMRPDumpSymbolicAddrIN->uiOffset,
psPMRPDumpSymbolicAddrIN->ui32MemspaceNameLen,
puiMemspaceNameInt,
psPMRPDumpSymbolicAddrIN->ui32SymbolicAddrLen,
puiSymbolicAddrInt,
&psPMRPDumpSymbolicAddrOUT->uiNewOffset,
&psPMRPDumpSymbolicAddrOUT->uiNextSymName);
if ( !OSAccessOK(PVR_VERIFY_WRITE, (IMG_VOID*) psPMRPDumpSymbolicAddrOUT->puiMemspaceName, (psPMRPDumpSymbolicAddrIN->ui32MemspaceNameLen * sizeof(IMG_CHAR)))
|| (OSCopyToUser(NULL, psPMRPDumpSymbolicAddrOUT->puiMemspaceName, puiMemspaceNameInt,
(psPMRPDumpSymbolicAddrIN->ui32MemspaceNameLen * sizeof(IMG_CHAR))) != PVRSRV_OK) )
{
psPMRPDumpSymbolicAddrOUT->eError = PVRSRV_ERROR_INVALID_PARAMS;
goto PMRPDumpSymbolicAddr_exit;
}
if ( !OSAccessOK(PVR_VERIFY_WRITE, (IMG_VOID*) psPMRPDumpSymbolicAddrOUT->puiSymbolicAddr, (psPMRPDumpSymbolicAddrIN->ui32SymbolicAddrLen * sizeof(IMG_CHAR)))
|| (OSCopyToUser(NULL, psPMRPDumpSymbolicAddrOUT->puiSymbolicAddr, puiSymbolicAddrInt,
(psPMRPDumpSymbolicAddrIN->ui32SymbolicAddrLen * sizeof(IMG_CHAR))) != PVRSRV_OK) )
{
psPMRPDumpSymbolicAddrOUT->eError = PVRSRV_ERROR_INVALID_PARAMS;
goto PMRPDumpSymbolicAddr_exit;
}
PMRPDumpSymbolicAddr_exit:
if (puiMemspaceNameInt)
OSFreeMem(puiMemspaceNameInt);
if (puiSymbolicAddrInt)
OSFreeMem(puiSymbolicAddrInt);
return 0;
}
static IMG_INT
PVRSRVBridgePMRPDumpPol32(IMG_UINT32 ui32DispatchTableEntry,
PVRSRV_BRIDGE_IN_PMRPDUMPPOL32 *psPMRPDumpPol32IN,
PVRSRV_BRIDGE_OUT_PMRPDUMPPOL32 *psPMRPDumpPol32OUT,
CONNECTION_DATA *psConnection)
{
PMR * psPMRInt = IMG_NULL;
{
/* Look up the address from the handle */
psPMRPDumpPol32OUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_VOID **) &psPMRInt,
psPMRPDumpPol32IN->hPMR,
PVRSRV_HANDLE_TYPE_PHYSMEM_PMR);
if(psPMRPDumpPol32OUT->eError != PVRSRV_OK)
{
goto PMRPDumpPol32_exit;
}
}
psPMRPDumpPol32OUT->eError =
PMRPDumpPol32(
psPMRInt,
psPMRPDumpPol32IN->uiOffset,
psPMRPDumpPol32IN->ui32Value,
psPMRPDumpPol32IN->ui32Mask,
psPMRPDumpPol32IN->eOperator,
psPMRPDumpPol32IN->ui32PDumpFlags);
PMRPDumpPol32_exit:
return 0;
}
static IMG_INT
PVRSRVBridgePMRPDumpCBP(IMG_UINT32 ui32DispatchTableEntry,
PVRSRV_BRIDGE_IN_PMRPDUMPCBP *psPMRPDumpCBPIN,
PVRSRV_BRIDGE_OUT_PMRPDUMPCBP *psPMRPDumpCBPOUT,
CONNECTION_DATA *psConnection)
{
PMR * psPMRInt = IMG_NULL;
{
/* Look up the address from the handle */
psPMRPDumpCBPOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_VOID **) &psPMRInt,
psPMRPDumpCBPIN->hPMR,
PVRSRV_HANDLE_TYPE_PHYSMEM_PMR);
if(psPMRPDumpCBPOUT->eError != PVRSRV_OK)
{
goto PMRPDumpCBP_exit;
}
}
psPMRPDumpCBPOUT->eError =
PMRPDumpCBP(
psPMRInt,
psPMRPDumpCBPIN->uiReadOffset,
psPMRPDumpCBPIN->uiWriteOffset,
psPMRPDumpCBPIN->uiPacketSize,
psPMRPDumpCBPIN->uiBufferSize);
PMRPDumpCBP_exit:
return 0;
}
static IMG_INT
PVRSRVBridgeDevmemIntPDumpSaveToFileVirtual(IMG_UINT32 ui32DispatchTableEntry,
PVRSRV_BRIDGE_IN_DEVMEMINTPDUMPSAVETOFILEVIRTUAL *psDevmemIntPDumpSaveToFileVirtualIN,
PVRSRV_BRIDGE_OUT_DEVMEMINTPDUMPSAVETOFILEVIRTUAL *psDevmemIntPDumpSaveToFileVirtualOUT,
CONNECTION_DATA *psConnection)
{
DEVMEMINT_CTX * psDevmemServerContextInt = IMG_NULL;
IMG_CHAR *uiFileNameInt = IMG_NULL;
if (psDevmemIntPDumpSaveToFileVirtualIN->ui32ArraySize != 0)
{
uiFileNameInt = OSAllocMem(psDevmemIntPDumpSaveToFileVirtualIN->ui32ArraySize * sizeof(IMG_CHAR));
if (!uiFileNameInt)
{
psDevmemIntPDumpSaveToFileVirtualOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY;
goto DevmemIntPDumpSaveToFileVirtual_exit;
}
}
/* Copy the data over */
if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psDevmemIntPDumpSaveToFileVirtualIN->puiFileName, psDevmemIntPDumpSaveToFileVirtualIN->ui32ArraySize * sizeof(IMG_CHAR))
|| (OSCopyFromUser(NULL, uiFileNameInt, psDevmemIntPDumpSaveToFileVirtualIN->puiFileName,
psDevmemIntPDumpSaveToFileVirtualIN->ui32ArraySize * sizeof(IMG_CHAR)) != PVRSRV_OK) )
{
psDevmemIntPDumpSaveToFileVirtualOUT->eError = PVRSRV_ERROR_INVALID_PARAMS;
goto DevmemIntPDumpSaveToFileVirtual_exit;
}
{
/* Look up the address from the handle */
psDevmemIntPDumpSaveToFileVirtualOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_VOID **) &psDevmemServerContextInt,
psDevmemIntPDumpSaveToFileVirtualIN->hDevmemServerContext,
PVRSRV_HANDLE_TYPE_DEVMEMINT_CTX);
if(psDevmemIntPDumpSaveToFileVirtualOUT->eError != PVRSRV_OK)
{
goto DevmemIntPDumpSaveToFileVirtual_exit;
}
}
psDevmemIntPDumpSaveToFileVirtualOUT->eError =
DevmemIntPDumpSaveToFileVirtual(
psDevmemServerContextInt,
psDevmemIntPDumpSaveToFileVirtualIN->sAddress,
psDevmemIntPDumpSaveToFileVirtualIN->uiSize,
psDevmemIntPDumpSaveToFileVirtualIN->ui32ArraySize,
uiFileNameInt,
psDevmemIntPDumpSaveToFileVirtualIN->ui32FileOffset,
psDevmemIntPDumpSaveToFileVirtualIN->ui32PDumpFlags);
DevmemIntPDumpSaveToFileVirtual_exit:
if (uiFileNameInt)
OSFreeMem(uiFileNameInt);
return 0;
}
/* ***************************************************************************
* Server bridge dispatch related glue
*/
PVRSRV_ERROR InitPDUMPMMBridge(IMG_VOID);
PVRSRV_ERROR DeinitPDUMPMMBridge(IMG_VOID);
/*
* Register all PDUMPMM functions with services
*/
PVRSRV_ERROR InitPDUMPMMBridge(IMG_VOID)
{
SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMPMM, PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPLOADMEM, PVRSRVBridgePMRPDumpLoadMem,
IMG_NULL, IMG_NULL,
0, 0);
SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMPMM, PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPLOADMEMVALUE32, PVRSRVBridgePMRPDumpLoadMemValue32,
IMG_NULL, IMG_NULL,
0, 0);
SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMPMM, PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPLOADMEMVALUE64, PVRSRVBridgePMRPDumpLoadMemValue64,
IMG_NULL, IMG_NULL,
0, 0);
SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMPMM, PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPSAVETOFILE, PVRSRVBridgePMRPDumpSaveToFile,
IMG_NULL, IMG_NULL,
0, 0);
SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMPMM, PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPSYMBOLICADDR, PVRSRVBridgePMRPDumpSymbolicAddr,
IMG_NULL, IMG_NULL,
0, 0);
SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMPMM, PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPPOL32, PVRSRVBridgePMRPDumpPol32,
IMG_NULL, IMG_NULL,
0, 0);
SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMPMM, PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPCBP, PVRSRVBridgePMRPDumpCBP,
IMG_NULL, IMG_NULL,
0, 0);
SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMPMM, PVRSRV_BRIDGE_PDUMPMM_DEVMEMINTPDUMPSAVETOFILEVIRTUAL, PVRSRVBridgeDevmemIntPDumpSaveToFileVirtual,
IMG_NULL, IMG_NULL,
0, 0);
return PVRSRV_OK;
}
/*
* Unregister all pdumpmm functions with services
*/
PVRSRV_ERROR DeinitPDUMPMMBridge(IMG_VOID)
{
return PVRSRV_OK;
}

View File

@@ -1,76 +0,0 @@
/*************************************************************************/ /*!
@File
@Title Client bridge header for pvrtl
@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
@Description Exports the client bridge functions for pvrtl
@License Dual MIT/GPLv2
The contents of this file are subject to the MIT license as set out below.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
Alternatively, the contents of this file may be used under the terms of
the GNU General Public License Version 2 ("GPL") in which case the provisions
of GPL are applicable instead of those above.
If you wish to allow use of your version of this file only under the terms of
GPL, and not to allow others to use your version of this file under the terms
of the MIT license, indicate your decision by deleting the provisions above
and replace them with the notice and other provisions required by GPL as set
out in the file called "GPL-COPYING" included in this distribution. If you do
not delete the provisions above, a recipient may use your version of this file
under the terms of either the MIT license or GPL.
This License is also included in this distribution in the file called
"MIT-COPYING".
EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ /**************************************************************************/
#ifndef CLIENT_PVRTL_BRIDGE_H
#define CLIENT_PVRTL_BRIDGE_H
#include "pvr_bridge_client.h"
#include "pvr_bridge.h"
#include "common_pvrtl_bridge.h"
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeTLConnect(IMG_HANDLE hBridge);
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeTLDisconnect(IMG_HANDLE hBridge);
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeTLOpenStream(IMG_HANDLE hBridge,
IMG_CHAR *puiName,
IMG_UINT32 ui32Mode,
IMG_HANDLE *phSD,
DEVMEM_SERVER_EXPORTCOOKIE *phClientBUFExportCookie);
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeTLCloseStream(IMG_HANDLE hBridge,
IMG_HANDLE hSD);
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeTLAcquireData(IMG_HANDLE hBridge,
IMG_HANDLE hSD,
IMG_UINT32 *pui32ReadOffset,
IMG_UINT32 *pui32ReadLen);
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeTLReleaseData(IMG_HANDLE hBridge,
IMG_HANDLE hSD,
IMG_UINT32 ui32ReadOffset,
IMG_UINT32 ui32ReadLen);
#endif /* CLIENT_PVRTL_BRIDGE_H */

View File

@@ -1,174 +0,0 @@
/*************************************************************************/ /*!
@File
@Title Common bridge header for pvrtl
@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
@Description Declares common defines and structures that are used by both
the client and sever side of the bridge for pvrtl
@License Dual MIT/GPLv2
The contents of this file are subject to the MIT license as set out below.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
Alternatively, the contents of this file may be used under the terms of
the GNU General Public License Version 2 ("GPL") in which case the provisions
of GPL are applicable instead of those above.
If you wish to allow use of your version of this file only under the terms of
GPL, and not to allow others to use your version of this file under the terms
of the MIT license, indicate your decision by deleting the provisions above
and replace them with the notice and other provisions required by GPL as set
out in the file called "GPL-COPYING" included in this distribution. If you do
not delete the provisions above, a recipient may use your version of this file
under the terms of either the MIT license or GPL.
This License is also included in this distribution in the file called
"MIT-COPYING".
EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ /**************************************************************************/
#ifndef COMMON_PVRTL_BRIDGE_H
#define COMMON_PVRTL_BRIDGE_H
#include "img_types.h"
#include "pvrsrv_error.h"
#include "devicemem_typedefs.h"
#include "pvr_tl.h"
#define PVRSRV_BRIDGE_PVRTL_CMD_FIRST 0
#define PVRSRV_BRIDGE_PVRTL_TLCONNECT PVRSRV_BRIDGE_PVRTL_CMD_FIRST+0
#define PVRSRV_BRIDGE_PVRTL_TLDISCONNECT PVRSRV_BRIDGE_PVRTL_CMD_FIRST+1
#define PVRSRV_BRIDGE_PVRTL_TLOPENSTREAM PVRSRV_BRIDGE_PVRTL_CMD_FIRST+2
#define PVRSRV_BRIDGE_PVRTL_TLCLOSESTREAM PVRSRV_BRIDGE_PVRTL_CMD_FIRST+3
#define PVRSRV_BRIDGE_PVRTL_TLACQUIREDATA PVRSRV_BRIDGE_PVRTL_CMD_FIRST+4
#define PVRSRV_BRIDGE_PVRTL_TLRELEASEDATA PVRSRV_BRIDGE_PVRTL_CMD_FIRST+5
#define PVRSRV_BRIDGE_PVRTL_CMD_LAST (PVRSRV_BRIDGE_PVRTL_CMD_FIRST+5)
/*******************************************
TLConnect
*******************************************/
/* Bridge in structure for TLConnect */
typedef struct PVRSRV_BRIDGE_IN_TLCONNECT_TAG
{
IMG_UINT32 ui32EmptyStructPlaceholder;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_TLCONNECT;
/* Bridge out structure for TLConnect */
typedef struct PVRSRV_BRIDGE_OUT_TLCONNECT_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_TLCONNECT;
/*******************************************
TLDisconnect
*******************************************/
/* Bridge in structure for TLDisconnect */
typedef struct PVRSRV_BRIDGE_IN_TLDISCONNECT_TAG
{
IMG_UINT32 ui32EmptyStructPlaceholder;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_TLDISCONNECT;
/* Bridge out structure for TLDisconnect */
typedef struct PVRSRV_BRIDGE_OUT_TLDISCONNECT_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_TLDISCONNECT;
/*******************************************
TLOpenStream
*******************************************/
/* Bridge in structure for TLOpenStream */
typedef struct PVRSRV_BRIDGE_IN_TLOPENSTREAM_TAG
{
IMG_CHAR * puiName;
IMG_UINT32 ui32Mode;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_TLOPENSTREAM;
/* Bridge out structure for TLOpenStream */
typedef struct PVRSRV_BRIDGE_OUT_TLOPENSTREAM_TAG
{
IMG_HANDLE hSD;
DEVMEM_SERVER_EXPORTCOOKIE hClientBUFExportCookie;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_TLOPENSTREAM;
/*******************************************
TLCloseStream
*******************************************/
/* Bridge in structure for TLCloseStream */
typedef struct PVRSRV_BRIDGE_IN_TLCLOSESTREAM_TAG
{
IMG_HANDLE hSD;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_TLCLOSESTREAM;
/* Bridge out structure for TLCloseStream */
typedef struct PVRSRV_BRIDGE_OUT_TLCLOSESTREAM_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_TLCLOSESTREAM;
/*******************************************
TLAcquireData
*******************************************/
/* Bridge in structure for TLAcquireData */
typedef struct PVRSRV_BRIDGE_IN_TLACQUIREDATA_TAG
{
IMG_HANDLE hSD;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_TLACQUIREDATA;
/* Bridge out structure for TLAcquireData */
typedef struct PVRSRV_BRIDGE_OUT_TLACQUIREDATA_TAG
{
IMG_UINT32 ui32ReadOffset;
IMG_UINT32 ui32ReadLen;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_TLACQUIREDATA;
/*******************************************
TLReleaseData
*******************************************/
/* Bridge in structure for TLReleaseData */
typedef struct PVRSRV_BRIDGE_IN_TLRELEASEDATA_TAG
{
IMG_HANDLE hSD;
IMG_UINT32 ui32ReadOffset;
IMG_UINT32 ui32ReadLen;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_TLRELEASEDATA;
/* Bridge out structure for TLReleaseData */
typedef struct PVRSRV_BRIDGE_OUT_TLRELEASEDATA_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_TLRELEASEDATA;
#endif /* COMMON_PVRTL_BRIDGE_H */

View File

@@ -1,397 +0,0 @@
/*************************************************************************/ /*!
@File
@Title Server bridge for pvrtl
@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
@Description Implements the server side of the bridge for pvrtl
@License Dual MIT/GPLv2
The contents of this file are subject to the MIT license as set out below.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
Alternatively, the contents of this file may be used under the terms of
the GNU General Public License Version 2 ("GPL") in which case the provisions
of GPL are applicable instead of those above.
If you wish to allow use of your version of this file only under the terms of
GPL, and not to allow others to use your version of this file under the terms
of the MIT license, indicate your decision by deleting the provisions above
and replace them with the notice and other provisions required by GPL as set
out in the file called "GPL-COPYING" included in this distribution. If you do
not delete the provisions above, a recipient may use your version of this file
under the terms of either the MIT license or GPL.
This License is also included in this distribution in the file called
"MIT-COPYING".
EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ /**************************************************************************/
#include <stddef.h>
#include <linux/uaccess.h>
#include "img_defs.h"
#include "tlserver.h"
#include "common_pvrtl_bridge.h"
#include "allocmem.h"
#include "pvr_debug.h"
#include "connection_server.h"
#include "pvr_bridge.h"
#include "rgx_bridge.h"
#include "srvcore.h"
#include "handle.h"
#if defined (SUPPORT_AUTH)
#include "osauth.h"
#endif
#include <linux/slab.h>
/* ***************************************************************************
* Server-side bridge entry points
*/
static IMG_INT
PVRSRVBridgeTLConnect(IMG_UINT32 ui32DispatchTableEntry,
PVRSRV_BRIDGE_IN_TLCONNECT *psTLConnectIN,
PVRSRV_BRIDGE_OUT_TLCONNECT *psTLConnectOUT,
CONNECTION_DATA *psConnection)
{
PVR_UNREFERENCED_PARAMETER(psTLConnectIN);
psTLConnectOUT->eError =
TLServerConnectKM(psConnection
);
return 0;
}
static IMG_INT
PVRSRVBridgeTLDisconnect(IMG_UINT32 ui32DispatchTableEntry,
PVRSRV_BRIDGE_IN_TLDISCONNECT *psTLDisconnectIN,
PVRSRV_BRIDGE_OUT_TLDISCONNECT *psTLDisconnectOUT,
CONNECTION_DATA *psConnection)
{
PVR_UNREFERENCED_PARAMETER(psTLDisconnectIN);
psTLDisconnectOUT->eError =
TLServerDisconnectKM(psConnection
);
return 0;
}
static IMG_INT
PVRSRVBridgeTLOpenStream(IMG_UINT32 ui32DispatchTableEntry,
PVRSRV_BRIDGE_IN_TLOPENSTREAM *psTLOpenStreamIN,
PVRSRV_BRIDGE_OUT_TLOPENSTREAM *psTLOpenStreamOUT,
CONNECTION_DATA *psConnection)
{
IMG_CHAR *uiNameInt = IMG_NULL;
TL_STREAM_DESC * psSDInt = IMG_NULL;
DEVMEM_EXPORTCOOKIE * psClientBUFExportCookieInt = IMG_NULL;
psTLOpenStreamOUT->hSD = IMG_NULL;
{
uiNameInt = OSAllocMem(PRVSRVTL_MAX_STREAM_NAME_SIZE * sizeof(IMG_CHAR));
if (!uiNameInt)
{
psTLOpenStreamOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY;
goto TLOpenStream_exit;
}
}
/* Copy the data over */
if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psTLOpenStreamIN->puiName, PRVSRVTL_MAX_STREAM_NAME_SIZE * sizeof(IMG_CHAR))
|| (OSCopyFromUser(NULL, uiNameInt, psTLOpenStreamIN->puiName,
PRVSRVTL_MAX_STREAM_NAME_SIZE * sizeof(IMG_CHAR)) != PVRSRV_OK) )
{
psTLOpenStreamOUT->eError = PVRSRV_ERROR_INVALID_PARAMS;
goto TLOpenStream_exit;
}
psTLOpenStreamOUT->eError =
TLServerOpenStreamKM(
uiNameInt,
psTLOpenStreamIN->ui32Mode,
&psSDInt,
&psClientBUFExportCookieInt);
/* Exit early if bridged call fails */
if(psTLOpenStreamOUT->eError != PVRSRV_OK)
{
goto TLOpenStream_exit;
}
psTLOpenStreamOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase,
&psTLOpenStreamOUT->hSD,
(IMG_VOID *) psSDInt,
PVRSRV_HANDLE_TYPE_PVR_TL_SD,
PVRSRV_HANDLE_ALLOC_FLAG_MULTI
,(PFN_HANDLE_RELEASE)&TLServerCloseStreamKM);
if (psTLOpenStreamOUT->eError != PVRSRV_OK)
{
goto TLOpenStream_exit;
}
psTLOpenStreamOUT->eError = PVRSRVAllocSubHandle(psConnection->psHandleBase,
&psTLOpenStreamOUT->hClientBUFExportCookie,
(IMG_VOID *) psClientBUFExportCookieInt,
PVRSRV_HANDLE_TYPE_SERVER_EXPORTCOOKIE,
PVRSRV_HANDLE_ALLOC_FLAG_NONE
,psTLOpenStreamOUT->hSD);
if (psTLOpenStreamOUT->eError != PVRSRV_OK)
{
goto TLOpenStream_exit;
}
TLOpenStream_exit:
if (psTLOpenStreamOUT->eError != PVRSRV_OK)
{
if (psTLOpenStreamOUT->hSD)
{
PVRSRV_ERROR eError = PVRSRVReleaseHandle(psConnection->psHandleBase,
(IMG_HANDLE) psTLOpenStreamOUT->hSD,
PVRSRV_HANDLE_TYPE_PVR_TL_SD);
/* Releasing the handle should free/destroy/release the resource. This should never fail... */
PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY));
/* Avoid freeing/destroying/releasing the resource a second time below */
psSDInt = IMG_NULL;
}
if (psSDInt)
{
TLServerCloseStreamKM(psSDInt);
}
}
if (uiNameInt)
OSFreeMem(uiNameInt);
return 0;
}
static IMG_INT
PVRSRVBridgeTLCloseStream(IMG_UINT32 ui32DispatchTableEntry,
PVRSRV_BRIDGE_IN_TLCLOSESTREAM *psTLCloseStreamIN,
PVRSRV_BRIDGE_OUT_TLCLOSESTREAM *psTLCloseStreamOUT,
CONNECTION_DATA *psConnection)
{
psTLCloseStreamOUT->eError =
PVRSRVReleaseHandle(psConnection->psHandleBase,
(IMG_HANDLE) psTLCloseStreamIN->hSD,
PVRSRV_HANDLE_TYPE_PVR_TL_SD);
if ((psTLCloseStreamOUT->eError != PVRSRV_OK) && (psTLCloseStreamOUT->eError != PVRSRV_ERROR_RETRY))
{
PVR_ASSERT(0);
goto TLCloseStream_exit;
}
TLCloseStream_exit:
return 0;
}
static IMG_INT
PVRSRVBridgeTLAcquireData(IMG_UINT32 ui32DispatchTableEntry,
PVRSRV_BRIDGE_IN_TLACQUIREDATA *psTLAcquireDataIN,
PVRSRV_BRIDGE_OUT_TLACQUIREDATA *psTLAcquireDataOUT,
CONNECTION_DATA *psConnection)
{
TL_STREAM_DESC * psSDInt = IMG_NULL;
{
/* Look up the address from the handle */
psTLAcquireDataOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_VOID **) &psSDInt,
psTLAcquireDataIN->hSD,
PVRSRV_HANDLE_TYPE_PVR_TL_SD);
if(psTLAcquireDataOUT->eError != PVRSRV_OK)
{
goto TLAcquireData_exit;
}
}
psTLAcquireDataOUT->eError =
TLServerAcquireDataKM(
psSDInt,
&psTLAcquireDataOUT->ui32ReadOffset,
&psTLAcquireDataOUT->ui32ReadLen);
TLAcquireData_exit:
return 0;
}
static IMG_INT
PVRSRVBridgeTLReleaseData(IMG_UINT32 ui32DispatchTableEntry,
PVRSRV_BRIDGE_IN_TLRELEASEDATA *psTLReleaseDataIN,
PVRSRV_BRIDGE_OUT_TLRELEASEDATA *psTLReleaseDataOUT,
CONNECTION_DATA *psConnection)
{
TL_STREAM_DESC * psSDInt = IMG_NULL;
{
/* Look up the address from the handle */
psTLReleaseDataOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_VOID **) &psSDInt,
psTLReleaseDataIN->hSD,
PVRSRV_HANDLE_TYPE_PVR_TL_SD);
if(psTLReleaseDataOUT->eError != PVRSRV_OK)
{
goto TLReleaseData_exit;
}
}
psTLReleaseDataOUT->eError =
TLServerReleaseDataKM(
psSDInt,
psTLReleaseDataIN->ui32ReadOffset,
psTLReleaseDataIN->ui32ReadLen);
TLReleaseData_exit:
return 0;
}
/* ***************************************************************************
* Server bridge dispatch related glue
*/
PVRSRV_ERROR InitPVRTLBridge(IMG_VOID);
PVRSRV_ERROR DeinitPVRTLBridge(IMG_VOID);
/*
* Register all PVRTL functions with services
*/
PVRSRV_ERROR InitPVRTLBridge(IMG_VOID)
{
SetDispatchTableEntry(PVRSRV_BRIDGE_PVRTL, PVRSRV_BRIDGE_PVRTL_TLCONNECT, PVRSRVBridgeTLConnect,
IMG_NULL, IMG_NULL,
0, 0);
SetDispatchTableEntry(PVRSRV_BRIDGE_PVRTL, PVRSRV_BRIDGE_PVRTL_TLDISCONNECT, PVRSRVBridgeTLDisconnect,
IMG_NULL, IMG_NULL,
0, 0);
SetDispatchTableEntry(PVRSRV_BRIDGE_PVRTL, PVRSRV_BRIDGE_PVRTL_TLOPENSTREAM, PVRSRVBridgeTLOpenStream,
IMG_NULL, IMG_NULL,
0, 0);
SetDispatchTableEntry(PVRSRV_BRIDGE_PVRTL, PVRSRV_BRIDGE_PVRTL_TLCLOSESTREAM, PVRSRVBridgeTLCloseStream,
IMG_NULL, IMG_NULL,
0, 0);
SetDispatchTableEntry(PVRSRV_BRIDGE_PVRTL, PVRSRV_BRIDGE_PVRTL_TLACQUIREDATA, PVRSRVBridgeTLAcquireData,
IMG_NULL, IMG_NULL,
0, 0);
SetDispatchTableEntry(PVRSRV_BRIDGE_PVRTL, PVRSRV_BRIDGE_PVRTL_TLRELEASEDATA, PVRSRVBridgeTLReleaseData,
IMG_NULL, IMG_NULL,
0, 0);
return PVRSRV_OK;
}
/*
* Unregister all pvrtl functions with services
*/
PVRSRV_ERROR DeinitPVRTLBridge(IMG_VOID)
{
return PVRSRV_OK;
}

View File

@@ -1,151 +0,0 @@
/*************************************************************************/ /*!
@File
@Title Common bridge header for regconfig
@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
@Description Declares common defines and structures that are used by both
the client and sever side of the bridge for regconfig
@License Dual MIT/GPLv2
The contents of this file are subject to the MIT license as set out below.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
Alternatively, the contents of this file may be used under the terms of
the GNU General Public License Version 2 ("GPL") in which case the provisions
of GPL are applicable instead of those above.
If you wish to allow use of your version of this file only under the terms of
GPL, and not to allow others to use your version of this file under the terms
of the MIT license, indicate your decision by deleting the provisions above
and replace them with the notice and other provisions required by GPL as set
out in the file called "GPL-COPYING" included in this distribution. If you do
not delete the provisions above, a recipient may use your version of this file
under the terms of either the MIT license or GPL.
This License is also included in this distribution in the file called
"MIT-COPYING".
EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ /**************************************************************************/
#ifndef COMMON_REGCONFIG_BRIDGE_H
#define COMMON_REGCONFIG_BRIDGE_H
#include "img_types.h"
#include "pvrsrv_error.h"
#include "rgx_bridge.h"
#define PVRSRV_BRIDGE_REGCONFIG_CMD_FIRST 0
#define PVRSRV_BRIDGE_REGCONFIG_RGXSETREGCONFIGPI PVRSRV_BRIDGE_REGCONFIG_CMD_FIRST+0
#define PVRSRV_BRIDGE_REGCONFIG_RGXADDREGCONFIG PVRSRV_BRIDGE_REGCONFIG_CMD_FIRST+1
#define PVRSRV_BRIDGE_REGCONFIG_RGXCLEARREGCONFIG PVRSRV_BRIDGE_REGCONFIG_CMD_FIRST+2
#define PVRSRV_BRIDGE_REGCONFIG_RGXENABLEREGCONFIG PVRSRV_BRIDGE_REGCONFIG_CMD_FIRST+3
#define PVRSRV_BRIDGE_REGCONFIG_RGXDISABLEREGCONFIG PVRSRV_BRIDGE_REGCONFIG_CMD_FIRST+4
#define PVRSRV_BRIDGE_REGCONFIG_CMD_LAST (PVRSRV_BRIDGE_REGCONFIG_CMD_FIRST+4)
/*******************************************
RGXSetRegConfigPI
*******************************************/
/* Bridge in structure for RGXSetRegConfigPI */
typedef struct PVRSRV_BRIDGE_IN_RGXSETREGCONFIGPI_TAG
{
IMG_HANDLE hDevNode;
IMG_UINT8 ui8RegPowerIsland;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXSETREGCONFIGPI;
/* Bridge out structure for RGXSetRegConfigPI */
typedef struct PVRSRV_BRIDGE_OUT_RGXSETREGCONFIGPI_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXSETREGCONFIGPI;
/*******************************************
RGXAddRegconfig
*******************************************/
/* Bridge in structure for RGXAddRegconfig */
typedef struct PVRSRV_BRIDGE_IN_RGXADDREGCONFIG_TAG
{
IMG_HANDLE hDevNode;
IMG_UINT32 ui32RegAddr;
IMG_UINT64 ui64RegValue;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXADDREGCONFIG;
/* Bridge out structure for RGXAddRegconfig */
typedef struct PVRSRV_BRIDGE_OUT_RGXADDREGCONFIG_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXADDREGCONFIG;
/*******************************************
RGXClearRegConfig
*******************************************/
/* Bridge in structure for RGXClearRegConfig */
typedef struct PVRSRV_BRIDGE_IN_RGXCLEARREGCONFIG_TAG
{
IMG_HANDLE hDevNode;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXCLEARREGCONFIG;
/* Bridge out structure for RGXClearRegConfig */
typedef struct PVRSRV_BRIDGE_OUT_RGXCLEARREGCONFIG_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXCLEARREGCONFIG;
/*******************************************
RGXEnableRegConfig
*******************************************/
/* Bridge in structure for RGXEnableRegConfig */
typedef struct PVRSRV_BRIDGE_IN_RGXENABLEREGCONFIG_TAG
{
IMG_HANDLE hDevNode;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXENABLEREGCONFIG;
/* Bridge out structure for RGXEnableRegConfig */
typedef struct PVRSRV_BRIDGE_OUT_RGXENABLEREGCONFIG_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXENABLEREGCONFIG;
/*******************************************
RGXDisableRegConfig
*******************************************/
/* Bridge in structure for RGXDisableRegConfig */
typedef struct PVRSRV_BRIDGE_IN_RGXDISABLEREGCONFIG_TAG
{
IMG_HANDLE hDevNode;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXDISABLEREGCONFIG;
/* Bridge out structure for RGXDisableRegConfig */
typedef struct PVRSRV_BRIDGE_OUT_RGXDISABLEREGCONFIG_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXDISABLEREGCONFIG;
#endif /* COMMON_REGCONFIG_BRIDGE_H */

View File

@@ -1,325 +0,0 @@
/*************************************************************************/ /*!
@File
@Title Server bridge for regconfig
@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
@Description Implements the server side of the bridge for regconfig
@License Dual MIT/GPLv2
The contents of this file are subject to the MIT license as set out below.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
Alternatively, the contents of this file may be used under the terms of
the GNU General Public License Version 2 ("GPL") in which case the provisions
of GPL are applicable instead of those above.
If you wish to allow use of your version of this file only under the terms of
GPL, and not to allow others to use your version of this file under the terms
of the MIT license, indicate your decision by deleting the provisions above
and replace them with the notice and other provisions required by GPL as set
out in the file called "GPL-COPYING" included in this distribution. If you do
not delete the provisions above, a recipient may use your version of this file
under the terms of either the MIT license or GPL.
This License is also included in this distribution in the file called
"MIT-COPYING".
EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ /**************************************************************************/
#include <stddef.h>
#include <linux/uaccess.h>
#include "img_defs.h"
#include "rgxregconfig.h"
#include "common_regconfig_bridge.h"
#include "allocmem.h"
#include "pvr_debug.h"
#include "connection_server.h"
#include "pvr_bridge.h"
#include "rgx_bridge.h"
#include "srvcore.h"
#include "handle.h"
#if defined (SUPPORT_AUTH)
#include "osauth.h"
#endif
#include <linux/slab.h>
/* ***************************************************************************
* Server-side bridge entry points
*/
static IMG_INT
PVRSRVBridgeRGXSetRegConfigPI(IMG_UINT32 ui32DispatchTableEntry,
PVRSRV_BRIDGE_IN_RGXSETREGCONFIGPI *psRGXSetRegConfigPIIN,
PVRSRV_BRIDGE_OUT_RGXSETREGCONFIGPI *psRGXSetRegConfigPIOUT,
CONNECTION_DATA *psConnection)
{
IMG_HANDLE hDevNodeInt = IMG_NULL;
{
/* Look up the address from the handle */
psRGXSetRegConfigPIOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_VOID **) &hDevNodeInt,
psRGXSetRegConfigPIIN->hDevNode,
PVRSRV_HANDLE_TYPE_DEV_NODE);
if(psRGXSetRegConfigPIOUT->eError != PVRSRV_OK)
{
goto RGXSetRegConfigPI_exit;
}
}
psRGXSetRegConfigPIOUT->eError =
PVRSRVRGXSetRegConfigPIKM(
hDevNodeInt,
psRGXSetRegConfigPIIN->ui8RegPowerIsland);
RGXSetRegConfigPI_exit:
return 0;
}
static IMG_INT
PVRSRVBridgeRGXAddRegconfig(IMG_UINT32 ui32DispatchTableEntry,
PVRSRV_BRIDGE_IN_RGXADDREGCONFIG *psRGXAddRegconfigIN,
PVRSRV_BRIDGE_OUT_RGXADDREGCONFIG *psRGXAddRegconfigOUT,
CONNECTION_DATA *psConnection)
{
IMG_HANDLE hDevNodeInt = IMG_NULL;
{
/* Look up the address from the handle */
psRGXAddRegconfigOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_VOID **) &hDevNodeInt,
psRGXAddRegconfigIN->hDevNode,
PVRSRV_HANDLE_TYPE_DEV_NODE);
if(psRGXAddRegconfigOUT->eError != PVRSRV_OK)
{
goto RGXAddRegconfig_exit;
}
}
psRGXAddRegconfigOUT->eError =
PVRSRVRGXAddRegConfigKM(
hDevNodeInt,
psRGXAddRegconfigIN->ui32RegAddr,
psRGXAddRegconfigIN->ui64RegValue);
RGXAddRegconfig_exit:
return 0;
}
static IMG_INT
PVRSRVBridgeRGXClearRegConfig(IMG_UINT32 ui32DispatchTableEntry,
PVRSRV_BRIDGE_IN_RGXCLEARREGCONFIG *psRGXClearRegConfigIN,
PVRSRV_BRIDGE_OUT_RGXCLEARREGCONFIG *psRGXClearRegConfigOUT,
CONNECTION_DATA *psConnection)
{
IMG_HANDLE hDevNodeInt = IMG_NULL;
{
/* Look up the address from the handle */
psRGXClearRegConfigOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_VOID **) &hDevNodeInt,
psRGXClearRegConfigIN->hDevNode,
PVRSRV_HANDLE_TYPE_DEV_NODE);
if(psRGXClearRegConfigOUT->eError != PVRSRV_OK)
{
goto RGXClearRegConfig_exit;
}
}
psRGXClearRegConfigOUT->eError =
PVRSRVRGXClearRegConfigKM(
hDevNodeInt);
RGXClearRegConfig_exit:
return 0;
}
static IMG_INT
PVRSRVBridgeRGXEnableRegConfig(IMG_UINT32 ui32DispatchTableEntry,
PVRSRV_BRIDGE_IN_RGXENABLEREGCONFIG *psRGXEnableRegConfigIN,
PVRSRV_BRIDGE_OUT_RGXENABLEREGCONFIG *psRGXEnableRegConfigOUT,
CONNECTION_DATA *psConnection)
{
IMG_HANDLE hDevNodeInt = IMG_NULL;
{
/* Look up the address from the handle */
psRGXEnableRegConfigOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_VOID **) &hDevNodeInt,
psRGXEnableRegConfigIN->hDevNode,
PVRSRV_HANDLE_TYPE_DEV_NODE);
if(psRGXEnableRegConfigOUT->eError != PVRSRV_OK)
{
goto RGXEnableRegConfig_exit;
}
}
psRGXEnableRegConfigOUT->eError =
PVRSRVRGXEnableRegConfigKM(
hDevNodeInt);
RGXEnableRegConfig_exit:
return 0;
}
static IMG_INT
PVRSRVBridgeRGXDisableRegConfig(IMG_UINT32 ui32DispatchTableEntry,
PVRSRV_BRIDGE_IN_RGXDISABLEREGCONFIG *psRGXDisableRegConfigIN,
PVRSRV_BRIDGE_OUT_RGXDISABLEREGCONFIG *psRGXDisableRegConfigOUT,
CONNECTION_DATA *psConnection)
{
IMG_HANDLE hDevNodeInt = IMG_NULL;
{
/* Look up the address from the handle */
psRGXDisableRegConfigOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_VOID **) &hDevNodeInt,
psRGXDisableRegConfigIN->hDevNode,
PVRSRV_HANDLE_TYPE_DEV_NODE);
if(psRGXDisableRegConfigOUT->eError != PVRSRV_OK)
{
goto RGXDisableRegConfig_exit;
}
}
psRGXDisableRegConfigOUT->eError =
PVRSRVRGXDisableRegConfigKM(
hDevNodeInt);
RGXDisableRegConfig_exit:
return 0;
}
/* ***************************************************************************
* Server bridge dispatch related glue
*/
PVRSRV_ERROR InitREGCONFIGBridge(IMG_VOID);
PVRSRV_ERROR DeinitREGCONFIGBridge(IMG_VOID);
/*
* Register all REGCONFIG functions with services
*/
PVRSRV_ERROR InitREGCONFIGBridge(IMG_VOID)
{
SetDispatchTableEntry(PVRSRV_BRIDGE_REGCONFIG, PVRSRV_BRIDGE_REGCONFIG_RGXSETREGCONFIGPI, PVRSRVBridgeRGXSetRegConfigPI,
IMG_NULL, IMG_NULL,
0, 0);
SetDispatchTableEntry(PVRSRV_BRIDGE_REGCONFIG, PVRSRV_BRIDGE_REGCONFIG_RGXADDREGCONFIG, PVRSRVBridgeRGXAddRegconfig,
IMG_NULL, IMG_NULL,
0, 0);
SetDispatchTableEntry(PVRSRV_BRIDGE_REGCONFIG, PVRSRV_BRIDGE_REGCONFIG_RGXCLEARREGCONFIG, PVRSRVBridgeRGXClearRegConfig,
IMG_NULL, IMG_NULL,
0, 0);
SetDispatchTableEntry(PVRSRV_BRIDGE_REGCONFIG, PVRSRV_BRIDGE_REGCONFIG_RGXENABLEREGCONFIG, PVRSRVBridgeRGXEnableRegConfig,
IMG_NULL, IMG_NULL,
0, 0);
SetDispatchTableEntry(PVRSRV_BRIDGE_REGCONFIG, PVRSRV_BRIDGE_REGCONFIG_RGXDISABLEREGCONFIG, PVRSRVBridgeRGXDisableRegConfig,
IMG_NULL, IMG_NULL,
0, 0);
return PVRSRV_OK;
}
/*
* Unregister all regconfig functions with services
*/
PVRSRV_ERROR DeinitREGCONFIGBridge(IMG_VOID)
{
return PVRSRV_OK;
}

View File

@@ -1,206 +0,0 @@
/*************************************************************************/ /*!
@File
@Title Common bridge header for rgxcmp
@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
@Description Declares common defines and structures that are used by both
the client and sever side of the bridge for rgxcmp
@License Dual MIT/GPLv2
The contents of this file are subject to the MIT license as set out below.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
Alternatively, the contents of this file may be used under the terms of
the GNU General Public License Version 2 ("GPL") in which case the provisions
of GPL are applicable instead of those above.
If you wish to allow use of your version of this file only under the terms of
GPL, and not to allow others to use your version of this file under the terms
of the MIT license, indicate your decision by deleting the provisions above
and replace them with the notice and other provisions required by GPL as set
out in the file called "GPL-COPYING" included in this distribution. If you do
not delete the provisions above, a recipient may use your version of this file
under the terms of either the MIT license or GPL.
This License is also included in this distribution in the file called
"MIT-COPYING".
EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ /**************************************************************************/
#ifndef COMMON_RGXCMP_BRIDGE_H
#define COMMON_RGXCMP_BRIDGE_H
#include "img_types.h"
#include "pvrsrv_error.h"
#include "rgx_bridge.h"
#include "sync_external.h"
#include "rgx_fwif_shared.h"
#define PVRSRV_BRIDGE_RGXCMP_CMD_FIRST 0
#define PVRSRV_BRIDGE_RGXCMP_RGXCREATECOMPUTECONTEXT PVRSRV_BRIDGE_RGXCMP_CMD_FIRST+0
#define PVRSRV_BRIDGE_RGXCMP_RGXDESTROYCOMPUTECONTEXT PVRSRV_BRIDGE_RGXCMP_CMD_FIRST+1
#define PVRSRV_BRIDGE_RGXCMP_RGXKICKCDM PVRSRV_BRIDGE_RGXCMP_CMD_FIRST+2
#define PVRSRV_BRIDGE_RGXCMP_RGXFLUSHCOMPUTEDATA PVRSRV_BRIDGE_RGXCMP_CMD_FIRST+3
#define PVRSRV_BRIDGE_RGXCMP_RGXSETCOMPUTECONTEXTPRIORITY PVRSRV_BRIDGE_RGXCMP_CMD_FIRST+4
#define PVRSRV_BRIDGE_RGXCMP_RGXKICKSYNCCDM PVRSRV_BRIDGE_RGXCMP_CMD_FIRST+5
#define PVRSRV_BRIDGE_RGXCMP_CMD_LAST (PVRSRV_BRIDGE_RGXCMP_CMD_FIRST+5)
/*******************************************
RGXCreateComputeContext
*******************************************/
/* Bridge in structure for RGXCreateComputeContext */
typedef struct PVRSRV_BRIDGE_IN_RGXCREATECOMPUTECONTEXT_TAG
{
IMG_HANDLE hDevNode;
IMG_UINT32 ui32Priority;
IMG_DEV_VIRTADDR sMCUFenceAddr;
IMG_UINT32 ui32FrameworkCmdize;
IMG_BYTE * psFrameworkCmd;
IMG_HANDLE hPrivData;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXCREATECOMPUTECONTEXT;
/* Bridge out structure for RGXCreateComputeContext */
typedef struct PVRSRV_BRIDGE_OUT_RGXCREATECOMPUTECONTEXT_TAG
{
IMG_HANDLE hComputeContext;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXCREATECOMPUTECONTEXT;
/*******************************************
RGXDestroyComputeContext
*******************************************/
/* Bridge in structure for RGXDestroyComputeContext */
typedef struct PVRSRV_BRIDGE_IN_RGXDESTROYCOMPUTECONTEXT_TAG
{
IMG_HANDLE hComputeContext;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXDESTROYCOMPUTECONTEXT;
/* Bridge out structure for RGXDestroyComputeContext */
typedef struct PVRSRV_BRIDGE_OUT_RGXDESTROYCOMPUTECONTEXT_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXDESTROYCOMPUTECONTEXT;
/*******************************************
RGXKickCDM
*******************************************/
/* Bridge in structure for RGXKickCDM */
typedef struct PVRSRV_BRIDGE_IN_RGXKICKCDM_TAG
{
IMG_HANDLE hComputeContext;
IMG_UINT32 ui32ClientFenceCount;
IMG_HANDLE * phClientFenceUFOSyncPrimBlock;
IMG_UINT32 * pui32ClientFenceOffset;
IMG_UINT32 * pui32ClientFenceValue;
IMG_UINT32 ui32ClientUpdateCount;
IMG_HANDLE * phClientUpdateUFOSyncPrimBlock;
IMG_UINT32 * pui32ClientUpdateOffset;
IMG_UINT32 * pui32ClientUpdateValue;
IMG_UINT32 ui32ServerSyncCount;
IMG_UINT32 * pui32ServerSyncFlags;
IMG_HANDLE * phServerSyncs;
IMG_UINT32 ui32CmdSize;
IMG_BYTE * psDMCmd;
IMG_BOOL bbPDumpContinuous;
IMG_UINT32 ui32ExternalJobReference;
IMG_UINT32 ui32InternalJobReference;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXKICKCDM;
/* Bridge out structure for RGXKickCDM */
typedef struct PVRSRV_BRIDGE_OUT_RGXKICKCDM_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXKICKCDM;
/*******************************************
RGXFlushComputeData
*******************************************/
/* Bridge in structure for RGXFlushComputeData */
typedef struct PVRSRV_BRIDGE_IN_RGXFLUSHCOMPUTEDATA_TAG
{
IMG_HANDLE hComputeContext;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXFLUSHCOMPUTEDATA;
/* Bridge out structure for RGXFlushComputeData */
typedef struct PVRSRV_BRIDGE_OUT_RGXFLUSHCOMPUTEDATA_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXFLUSHCOMPUTEDATA;
/*******************************************
RGXSetComputeContextPriority
*******************************************/
/* Bridge in structure for RGXSetComputeContextPriority */
typedef struct PVRSRV_BRIDGE_IN_RGXSETCOMPUTECONTEXTPRIORITY_TAG
{
IMG_HANDLE hComputeContext;
IMG_UINT32 ui32Priority;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXSETCOMPUTECONTEXTPRIORITY;
/* Bridge out structure for RGXSetComputeContextPriority */
typedef struct PVRSRV_BRIDGE_OUT_RGXSETCOMPUTECONTEXTPRIORITY_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXSETCOMPUTECONTEXTPRIORITY;
/*******************************************
RGXKickSyncCDM
*******************************************/
/* Bridge in structure for RGXKickSyncCDM */
typedef struct PVRSRV_BRIDGE_IN_RGXKICKSYNCCDM_TAG
{
IMG_HANDLE hComputeContext;
IMG_UINT32 ui32ClientFenceCount;
IMG_HANDLE * phClientFenceUFOSyncPrimBlock;
IMG_UINT32 * pui32ClientFenceOffset;
IMG_UINT32 * pui32ClientFenceValue;
IMG_UINT32 ui32ClientUpdateCount;
IMG_HANDLE * phClientUpdateUFOSyncPrimBlock;
IMG_UINT32 * pui32ClientUpdateOffset;
IMG_UINT32 * pui32ClientUpdateValue;
IMG_UINT32 ui32ServerSyncCount;
IMG_UINT32 * pui32ServerSyncFlags;
IMG_HANDLE * phServerSyncs;
IMG_UINT32 ui32NumCheckFenceFDs;
IMG_INT32 * pi32CheckFenceFDs;
IMG_INT32 i32UpdateFenceFD;
IMG_BOOL bbPDumpContinuous;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXKICKSYNCCDM;
/* Bridge out structure for RGXKickSyncCDM */
typedef struct PVRSRV_BRIDGE_OUT_RGXKICKSYNCCDM_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXKICKSYNCCDM;
#endif /* COMMON_RGXCMP_BRIDGE_H */

View File

@@ -1,141 +0,0 @@
/*************************************************************************/ /*!
@File
@Title Common bridge header for rgxhwperf
@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
@Description Declares common defines and structures that are used by both
the client and sever side of the bridge for rgxhwperf
@License Dual MIT/GPLv2
The contents of this file are subject to the MIT license as set out below.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
Alternatively, the contents of this file may be used under the terms of
the GNU General Public License Version 2 ("GPL") in which case the provisions
of GPL are applicable instead of those above.
If you wish to allow use of your version of this file only under the terms of
GPL, and not to allow others to use your version of this file under the terms
of the MIT license, indicate your decision by deleting the provisions above
and replace them with the notice and other provisions required by GPL as set
out in the file called "GPL-COPYING" included in this distribution. If you do
not delete the provisions above, a recipient may use your version of this file
under the terms of either the MIT license or GPL.
This License is also included in this distribution in the file called
"MIT-COPYING".
EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ /**************************************************************************/
#ifndef COMMON_RGXHWPERF_BRIDGE_H
#define COMMON_RGXHWPERF_BRIDGE_H
#include "img_types.h"
#include "pvrsrv_error.h"
#include "rgx_bridge.h"
#include "rgx_hwperf_km.h"
#define PVRSRV_BRIDGE_RGXHWPERF_CMD_FIRST 0
#define PVRSRV_BRIDGE_RGXHWPERF_RGXCTRLHWPERF PVRSRV_BRIDGE_RGXHWPERF_CMD_FIRST+0
#define PVRSRV_BRIDGE_RGXHWPERF_RGXCONFIGENABLEHWPERFCOUNTERS PVRSRV_BRIDGE_RGXHWPERF_CMD_FIRST+1
#define PVRSRV_BRIDGE_RGXHWPERF_RGXCTRLHWPERFCOUNTERS PVRSRV_BRIDGE_RGXHWPERF_CMD_FIRST+2
#define PVRSRV_BRIDGE_RGXHWPERF_RGXCONFIGCUSTOMCOUNTERS PVRSRV_BRIDGE_RGXHWPERF_CMD_FIRST+3
#define PVRSRV_BRIDGE_RGXHWPERF_CMD_LAST (PVRSRV_BRIDGE_RGXHWPERF_CMD_FIRST+3)
/*******************************************
RGXCtrlHWPerf
*******************************************/
/* Bridge in structure for RGXCtrlHWPerf */
typedef struct PVRSRV_BRIDGE_IN_RGXCTRLHWPERF_TAG
{
IMG_HANDLE hDevNode;
IMG_BOOL bToggle;
IMG_UINT64 ui64Mask;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXCTRLHWPERF;
/* Bridge out structure for RGXCtrlHWPerf */
typedef struct PVRSRV_BRIDGE_OUT_RGXCTRLHWPERF_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXCTRLHWPERF;
/*******************************************
RGXConfigEnableHWPerfCounters
*******************************************/
/* Bridge in structure for RGXConfigEnableHWPerfCounters */
typedef struct PVRSRV_BRIDGE_IN_RGXCONFIGENABLEHWPERFCOUNTERS_TAG
{
IMG_HANDLE hDevNode;
IMG_UINT32 ui32ArrayLen;
RGX_HWPERF_CONFIG_CNTBLK * psBlockConfigs;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXCONFIGENABLEHWPERFCOUNTERS;
/* Bridge out structure for RGXConfigEnableHWPerfCounters */
typedef struct PVRSRV_BRIDGE_OUT_RGXCONFIGENABLEHWPERFCOUNTERS_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXCONFIGENABLEHWPERFCOUNTERS;
/*******************************************
RGXCtrlHWPerfCounters
*******************************************/
/* Bridge in structure for RGXCtrlHWPerfCounters */
typedef struct PVRSRV_BRIDGE_IN_RGXCTRLHWPERFCOUNTERS_TAG
{
IMG_HANDLE hDevNode;
IMG_BOOL bEnable;
IMG_UINT32 ui32ArrayLen;
IMG_UINT16 * pui16BlockIDs;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXCTRLHWPERFCOUNTERS;
/* Bridge out structure for RGXCtrlHWPerfCounters */
typedef struct PVRSRV_BRIDGE_OUT_RGXCTRLHWPERFCOUNTERS_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXCTRLHWPERFCOUNTERS;
/*******************************************
RGXConfigCustomCounters
*******************************************/
/* Bridge in structure for RGXConfigCustomCounters */
typedef struct PVRSRV_BRIDGE_IN_RGXCONFIGCUSTOMCOUNTERS_TAG
{
IMG_HANDLE hDevNode;
IMG_UINT16 ui16CustomBlockID;
IMG_UINT16 ui16NumCustomCounters;
IMG_UINT32 * pui32CustomCounterIDs;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXCONFIGCUSTOMCOUNTERS;
/* Bridge out structure for RGXConfigCustomCounters */
typedef struct PVRSRV_BRIDGE_OUT_RGXCONFIGCUSTOMCOUNTERS_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXCONFIGCUSTOMCOUNTERS;
#endif /* COMMON_RGXHWPERF_BRIDGE_H */

View File

@@ -1,357 +0,0 @@
/*************************************************************************/ /*!
@File
@Title Server bridge for rgxhwperf
@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
@Description Implements the server side of the bridge for rgxhwperf
@License Dual MIT/GPLv2
The contents of this file are subject to the MIT license as set out below.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
Alternatively, the contents of this file may be used under the terms of
the GNU General Public License Version 2 ("GPL") in which case the provisions
of GPL are applicable instead of those above.
If you wish to allow use of your version of this file only under the terms of
GPL, and not to allow others to use your version of this file under the terms
of the MIT license, indicate your decision by deleting the provisions above
and replace them with the notice and other provisions required by GPL as set
out in the file called "GPL-COPYING" included in this distribution. If you do
not delete the provisions above, a recipient may use your version of this file
under the terms of either the MIT license or GPL.
This License is also included in this distribution in the file called
"MIT-COPYING".
EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ /**************************************************************************/
#include <stddef.h>
#include <linux/uaccess.h>
#include "img_defs.h"
#include "rgxhwperf.h"
#include "common_rgxhwperf_bridge.h"
#include "allocmem.h"
#include "pvr_debug.h"
#include "connection_server.h"
#include "pvr_bridge.h"
#include "rgx_bridge.h"
#include "srvcore.h"
#include "handle.h"
#if defined (SUPPORT_AUTH)
#include "osauth.h"
#endif
#include <linux/slab.h>
/* ***************************************************************************
* Server-side bridge entry points
*/
static IMG_INT
PVRSRVBridgeRGXCtrlHWPerf(IMG_UINT32 ui32DispatchTableEntry,
PVRSRV_BRIDGE_IN_RGXCTRLHWPERF *psRGXCtrlHWPerfIN,
PVRSRV_BRIDGE_OUT_RGXCTRLHWPERF *psRGXCtrlHWPerfOUT,
CONNECTION_DATA *psConnection)
{
IMG_HANDLE hDevNodeInt = IMG_NULL;
{
/* Look up the address from the handle */
psRGXCtrlHWPerfOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_VOID **) &hDevNodeInt,
psRGXCtrlHWPerfIN->hDevNode,
PVRSRV_HANDLE_TYPE_DEV_NODE);
if(psRGXCtrlHWPerfOUT->eError != PVRSRV_OK)
{
goto RGXCtrlHWPerf_exit;
}
}
psRGXCtrlHWPerfOUT->eError =
PVRSRVRGXCtrlHWPerfKM(
hDevNodeInt,
psRGXCtrlHWPerfIN->bToggle,
psRGXCtrlHWPerfIN->ui64Mask);
RGXCtrlHWPerf_exit:
return 0;
}
static IMG_INT
PVRSRVBridgeRGXConfigEnableHWPerfCounters(IMG_UINT32 ui32DispatchTableEntry,
PVRSRV_BRIDGE_IN_RGXCONFIGENABLEHWPERFCOUNTERS *psRGXConfigEnableHWPerfCountersIN,
PVRSRV_BRIDGE_OUT_RGXCONFIGENABLEHWPERFCOUNTERS *psRGXConfigEnableHWPerfCountersOUT,
CONNECTION_DATA *psConnection)
{
IMG_HANDLE hDevNodeInt = IMG_NULL;
RGX_HWPERF_CONFIG_CNTBLK *psBlockConfigsInt = IMG_NULL;
if (psRGXConfigEnableHWPerfCountersIN->ui32ArrayLen != 0)
{
psBlockConfigsInt = OSAllocMem(psRGXConfigEnableHWPerfCountersIN->ui32ArrayLen * sizeof(RGX_HWPERF_CONFIG_CNTBLK));
if (!psBlockConfigsInt)
{
psRGXConfigEnableHWPerfCountersOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY;
goto RGXConfigEnableHWPerfCounters_exit;
}
}
/* Copy the data over */
if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXConfigEnableHWPerfCountersIN->psBlockConfigs, psRGXConfigEnableHWPerfCountersIN->ui32ArrayLen * sizeof(RGX_HWPERF_CONFIG_CNTBLK))
|| (OSCopyFromUser(NULL, psBlockConfigsInt, psRGXConfigEnableHWPerfCountersIN->psBlockConfigs,
psRGXConfigEnableHWPerfCountersIN->ui32ArrayLen * sizeof(RGX_HWPERF_CONFIG_CNTBLK)) != PVRSRV_OK) )
{
psRGXConfigEnableHWPerfCountersOUT->eError = PVRSRV_ERROR_INVALID_PARAMS;
goto RGXConfigEnableHWPerfCounters_exit;
}
{
/* Look up the address from the handle */
psRGXConfigEnableHWPerfCountersOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_VOID **) &hDevNodeInt,
psRGXConfigEnableHWPerfCountersIN->hDevNode,
PVRSRV_HANDLE_TYPE_DEV_NODE);
if(psRGXConfigEnableHWPerfCountersOUT->eError != PVRSRV_OK)
{
goto RGXConfigEnableHWPerfCounters_exit;
}
}
psRGXConfigEnableHWPerfCountersOUT->eError =
PVRSRVRGXConfigEnableHWPerfCountersKM(
hDevNodeInt,
psRGXConfigEnableHWPerfCountersIN->ui32ArrayLen,
psBlockConfigsInt);
RGXConfigEnableHWPerfCounters_exit:
if (psBlockConfigsInt)
OSFreeMem(psBlockConfigsInt);
return 0;
}
static IMG_INT
PVRSRVBridgeRGXCtrlHWPerfCounters(IMG_UINT32 ui32DispatchTableEntry,
PVRSRV_BRIDGE_IN_RGXCTRLHWPERFCOUNTERS *psRGXCtrlHWPerfCountersIN,
PVRSRV_BRIDGE_OUT_RGXCTRLHWPERFCOUNTERS *psRGXCtrlHWPerfCountersOUT,
CONNECTION_DATA *psConnection)
{
IMG_HANDLE hDevNodeInt = IMG_NULL;
IMG_UINT16 *ui16BlockIDsInt = IMG_NULL;
if (psRGXCtrlHWPerfCountersIN->ui32ArrayLen != 0)
{
ui16BlockIDsInt = OSAllocMem(psRGXCtrlHWPerfCountersIN->ui32ArrayLen * sizeof(IMG_UINT16));
if (!ui16BlockIDsInt)
{
psRGXCtrlHWPerfCountersOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY;
goto RGXCtrlHWPerfCounters_exit;
}
}
/* Copy the data over */
if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXCtrlHWPerfCountersIN->pui16BlockIDs, psRGXCtrlHWPerfCountersIN->ui32ArrayLen * sizeof(IMG_UINT16))
|| (OSCopyFromUser(NULL, ui16BlockIDsInt, psRGXCtrlHWPerfCountersIN->pui16BlockIDs,
psRGXCtrlHWPerfCountersIN->ui32ArrayLen * sizeof(IMG_UINT16)) != PVRSRV_OK) )
{
psRGXCtrlHWPerfCountersOUT->eError = PVRSRV_ERROR_INVALID_PARAMS;
goto RGXCtrlHWPerfCounters_exit;
}
{
/* Look up the address from the handle */
psRGXCtrlHWPerfCountersOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_VOID **) &hDevNodeInt,
psRGXCtrlHWPerfCountersIN->hDevNode,
PVRSRV_HANDLE_TYPE_DEV_NODE);
if(psRGXCtrlHWPerfCountersOUT->eError != PVRSRV_OK)
{
goto RGXCtrlHWPerfCounters_exit;
}
}
psRGXCtrlHWPerfCountersOUT->eError =
PVRSRVRGXCtrlHWPerfCountersKM(
hDevNodeInt,
psRGXCtrlHWPerfCountersIN->bEnable,
psRGXCtrlHWPerfCountersIN->ui32ArrayLen,
ui16BlockIDsInt);
RGXCtrlHWPerfCounters_exit:
if (ui16BlockIDsInt)
OSFreeMem(ui16BlockIDsInt);
return 0;
}
static IMG_INT
PVRSRVBridgeRGXConfigCustomCounters(IMG_UINT32 ui32DispatchTableEntry,
PVRSRV_BRIDGE_IN_RGXCONFIGCUSTOMCOUNTERS *psRGXConfigCustomCountersIN,
PVRSRV_BRIDGE_OUT_RGXCONFIGCUSTOMCOUNTERS *psRGXConfigCustomCountersOUT,
CONNECTION_DATA *psConnection)
{
IMG_HANDLE hDevNodeInt = IMG_NULL;
IMG_UINT32 *ui32CustomCounterIDsInt = IMG_NULL;
if (psRGXConfigCustomCountersIN->ui16NumCustomCounters != 0)
{
ui32CustomCounterIDsInt = OSAllocMem(psRGXConfigCustomCountersIN->ui16NumCustomCounters * sizeof(IMG_UINT32));
if (!ui32CustomCounterIDsInt)
{
psRGXConfigCustomCountersOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY;
goto RGXConfigCustomCounters_exit;
}
}
/* Copy the data over */
if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXConfigCustomCountersIN->pui32CustomCounterIDs, psRGXConfigCustomCountersIN->ui16NumCustomCounters * sizeof(IMG_UINT32))
|| (OSCopyFromUser(NULL, ui32CustomCounterIDsInt, psRGXConfigCustomCountersIN->pui32CustomCounterIDs,
psRGXConfigCustomCountersIN->ui16NumCustomCounters * sizeof(IMG_UINT32)) != PVRSRV_OK) )
{
psRGXConfigCustomCountersOUT->eError = PVRSRV_ERROR_INVALID_PARAMS;
goto RGXConfigCustomCounters_exit;
}
{
/* Look up the address from the handle */
psRGXConfigCustomCountersOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_VOID **) &hDevNodeInt,
psRGXConfigCustomCountersIN->hDevNode,
PVRSRV_HANDLE_TYPE_DEV_NODE);
if(psRGXConfigCustomCountersOUT->eError != PVRSRV_OK)
{
goto RGXConfigCustomCounters_exit;
}
}
psRGXConfigCustomCountersOUT->eError =
PVRSRVRGXConfigCustomCountersKM(
hDevNodeInt,
psRGXConfigCustomCountersIN->ui16CustomBlockID,
psRGXConfigCustomCountersIN->ui16NumCustomCounters,
ui32CustomCounterIDsInt);
RGXConfigCustomCounters_exit:
if (ui32CustomCounterIDsInt)
OSFreeMem(ui32CustomCounterIDsInt);
return 0;
}
/* ***************************************************************************
* Server bridge dispatch related glue
*/
PVRSRV_ERROR InitRGXHWPERFBridge(IMG_VOID);
PVRSRV_ERROR DeinitRGXHWPERFBridge(IMG_VOID);
/*
* Register all RGXHWPERF functions with services
*/
PVRSRV_ERROR InitRGXHWPERFBridge(IMG_VOID)
{
SetDispatchTableEntry(PVRSRV_BRIDGE_RGXHWPERF, PVRSRV_BRIDGE_RGXHWPERF_RGXCTRLHWPERF, PVRSRVBridgeRGXCtrlHWPerf,
IMG_NULL, IMG_NULL,
0, 0);
SetDispatchTableEntry(PVRSRV_BRIDGE_RGXHWPERF, PVRSRV_BRIDGE_RGXHWPERF_RGXCONFIGENABLEHWPERFCOUNTERS, PVRSRVBridgeRGXConfigEnableHWPerfCounters,
IMG_NULL, IMG_NULL,
0, 0);
SetDispatchTableEntry(PVRSRV_BRIDGE_RGXHWPERF, PVRSRV_BRIDGE_RGXHWPERF_RGXCTRLHWPERFCOUNTERS, PVRSRVBridgeRGXCtrlHWPerfCounters,
IMG_NULL, IMG_NULL,
0, 0);
SetDispatchTableEntry(PVRSRV_BRIDGE_RGXHWPERF, PVRSRV_BRIDGE_RGXHWPERF_RGXCONFIGCUSTOMCOUNTERS, PVRSRVBridgeRGXConfigCustomCounters,
IMG_NULL, IMG_NULL,
0, 0);
return PVRSRV_OK;
}
/*
* Unregister all rgxhwperf functions with services
*/
PVRSRV_ERROR DeinitRGXHWPERFBridge(IMG_VOID)
{
return PVRSRV_OK;
}

View File

@@ -1,201 +0,0 @@
/*************************************************************************/ /*!
@File
@Title Common bridge header for rgxinit
@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
@Description Declares common defines and structures that are used by both
the client and sever side of the bridge for rgxinit
@License Dual MIT/GPLv2
The contents of this file are subject to the MIT license as set out below.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
Alternatively, the contents of this file may be used under the terms of
the GNU General Public License Version 2 ("GPL") in which case the provisions
of GPL are applicable instead of those above.
If you wish to allow use of your version of this file only under the terms of
GPL, and not to allow others to use your version of this file under the terms
of the MIT license, indicate your decision by deleting the provisions above
and replace them with the notice and other provisions required by GPL as set
out in the file called "GPL-COPYING" included in this distribution. If you do
not delete the provisions above, a recipient may use your version of this file
under the terms of either the MIT license or GPL.
This License is also included in this distribution in the file called
"MIT-COPYING".
EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ /**************************************************************************/
#ifndef COMMON_RGXINIT_BRIDGE_H
#define COMMON_RGXINIT_BRIDGE_H
#include "img_types.h"
#include "pvrsrv_error.h"
#include "rgx_bridge.h"
#include "rgxscript.h"
#include "devicemem_typedefs.h"
#include "rgx_fwif_shared.h"
#include "rgx_fwif.h"
#define PVRSRV_BRIDGE_RGXINIT_CMD_FIRST 0
#define PVRSRV_BRIDGE_RGXINIT_RGXINITALLOCFWIMGMEM PVRSRV_BRIDGE_RGXINIT_CMD_FIRST+0
#define PVRSRV_BRIDGE_RGXINIT_RGXINITFIRMWARE PVRSRV_BRIDGE_RGXINIT_CMD_FIRST+1
#define PVRSRV_BRIDGE_RGXINIT_RGXINITLOADFWIMAGE PVRSRV_BRIDGE_RGXINIT_CMD_FIRST+2
#define PVRSRV_BRIDGE_RGXINIT_RGXINITDEVPART2 PVRSRV_BRIDGE_RGXINIT_CMD_FIRST+3
#define PVRSRV_BRIDGE_RGXINIT_GPUVIRTPOPULATELMASUBARENAS PVRSRV_BRIDGE_RGXINIT_CMD_FIRST+4
#define PVRSRV_BRIDGE_RGXINIT_CMD_LAST (PVRSRV_BRIDGE_RGXINIT_CMD_FIRST+4)
/*******************************************
RGXInitAllocFWImgMem
*******************************************/
/* Bridge in structure for RGXInitAllocFWImgMem */
typedef struct PVRSRV_BRIDGE_IN_RGXINITALLOCFWIMGMEM_TAG
{
IMG_HANDLE hDevNode;
IMG_DEVMEM_SIZE_T uiFWCodeLen;
IMG_DEVMEM_SIZE_T uiFWDataLen;
IMG_DEVMEM_SIZE_T uiFWCoremem;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXINITALLOCFWIMGMEM;
/* Bridge out structure for RGXInitAllocFWImgMem */
typedef struct PVRSRV_BRIDGE_OUT_RGXINITALLOCFWIMGMEM_TAG
{
DEVMEM_SERVER_EXPORTCOOKIE hFWCodeAllocServerExportCookie;
IMG_DEV_VIRTADDR sFWCodeDevVAddrBase;
DEVMEM_SERVER_EXPORTCOOKIE hFWDataAllocServerExportCookie;
IMG_DEV_VIRTADDR sFWDataDevVAddrBase;
DEVMEM_SERVER_EXPORTCOOKIE hFWCorememAllocServerExportCookie;
IMG_DEV_VIRTADDR sFWCorememDevVAddrBase;
RGXFWIF_DEV_VIRTADDR sFWCorememMetaVAddrBase;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXINITALLOCFWIMGMEM;
/*******************************************
RGXInitFirmware
*******************************************/
/* Bridge in structure for RGXInitFirmware */
typedef struct PVRSRV_BRIDGE_IN_RGXINITFIRMWARE_TAG
{
IMG_HANDLE hDevNode;
IMG_BOOL bEnableSignatureChecks;
IMG_UINT32 ui32SignatureChecksBufSize;
IMG_UINT32 ui32HWPerfFWBufSizeKB;
IMG_UINT64 ui64HWPerfFilter;
IMG_UINT32 ui32RGXFWAlignChecksSize;
IMG_UINT32 * pui32RGXFWAlignChecks;
IMG_UINT32 ui32ConfigFlags;
IMG_UINT32 ui32LogType;
IMG_UINT32 ui32FilterFlags;
IMG_UINT32 ui32JonesDisableMask;
IMG_UINT32 ui32ui32HWRDebugDumpLimit;
RGXFWIF_COMPCHECKS_BVNC sClientBVNC;
IMG_UINT32 ui32HWPerfCountersDataSize;
RGX_RD_POWER_ISLAND_CONF eRGXRDPowerIslandConf;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXINITFIRMWARE;
/* Bridge out structure for RGXInitFirmware */
typedef struct PVRSRV_BRIDGE_OUT_RGXINITFIRMWARE_TAG
{
RGXFWIF_DEV_VIRTADDR spsRGXFwInit;
DEVMEM_SERVER_EXPORTCOOKIE hHWPerfDataAllocServerExportCookie;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXINITFIRMWARE;
/*******************************************
RGXInitLoadFWImage
*******************************************/
/* Bridge in structure for RGXInitLoadFWImage */
typedef struct PVRSRV_BRIDGE_IN_RGXINITLOADFWIMAGE_TAG
{
IMG_HANDLE hImgDestImport;
IMG_HANDLE hImgSrcImport;
IMG_UINT64 ui64ImgLen;
IMG_HANDLE hSigImport;
IMG_UINT64 ui64SigLen;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXINITLOADFWIMAGE;
/* Bridge out structure for RGXInitLoadFWImage */
typedef struct PVRSRV_BRIDGE_OUT_RGXINITLOADFWIMAGE_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXINITLOADFWIMAGE;
/*******************************************
RGXInitDevPart2
*******************************************/
/* Bridge in structure for RGXInitDevPart2 */
typedef struct PVRSRV_BRIDGE_IN_RGXINITDEVPART2_TAG
{
IMG_HANDLE hDevNode;
RGX_INIT_COMMAND * psInitScript;
RGX_INIT_COMMAND * psDbgScript;
RGX_INIT_COMMAND * psDbgBusScript;
RGX_INIT_COMMAND * psDeinitScript;
IMG_UINT32 ui32ui32KernelCatBaseIdReg;
IMG_UINT32 ui32KernelCatBaseId;
IMG_UINT32 ui32KernelCatBaseReg;
IMG_UINT32 ui32KernelCatBaseWordSize;
IMG_UINT32 ui32KernelCatBaseAlignShift;
IMG_UINT32 ui32KernelCatBaseShift;
IMG_UINT64 ui64KernelCatBaseMask;
IMG_UINT32 ui32DeviceFlags;
IMG_UINT32 ui32RGXActivePMConf;
DEVMEM_SERVER_EXPORTCOOKIE hFWCodeAllocServerExportCookie;
DEVMEM_SERVER_EXPORTCOOKIE hFWDataAllocServerExportCookie;
DEVMEM_SERVER_EXPORTCOOKIE hFWCorememAllocServerExportCookie;
DEVMEM_SERVER_EXPORTCOOKIE hHWPerfDataAllocServerExportCookie;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXINITDEVPART2;
/* Bridge out structure for RGXInitDevPart2 */
typedef struct PVRSRV_BRIDGE_OUT_RGXINITDEVPART2_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXINITDEVPART2;
/*******************************************
GPUVIRTPopulateLMASubArenas
*******************************************/
/* Bridge in structure for GPUVIRTPopulateLMASubArenas */
typedef struct PVRSRV_BRIDGE_IN_GPUVIRTPOPULATELMASUBARENAS_TAG
{
IMG_HANDLE hDevNode;
IMG_UINT32 ui32NumElements;
IMG_UINT32 * pui32Elements;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_GPUVIRTPOPULATELMASUBARENAS;
/* Bridge out structure for GPUVIRTPopulateLMASubArenas */
typedef struct PVRSRV_BRIDGE_OUT_GPUVIRTPOPULATELMASUBARENAS_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_GPUVIRTPOPULATELMASUBARENAS;
#endif /* COMMON_RGXINIT_BRIDGE_H */

View File

@@ -1,733 +0,0 @@
/*************************************************************************/ /*!
@File
@Title Server bridge for rgxinit
@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
@Description Implements the server side of the bridge for rgxinit
@License Dual MIT/GPLv2
The contents of this file are subject to the MIT license as set out below.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
Alternatively, the contents of this file may be used under the terms of
the GNU General Public License Version 2 ("GPL") in which case the provisions
of GPL are applicable instead of those above.
If you wish to allow use of your version of this file only under the terms of
GPL, and not to allow others to use your version of this file under the terms
of the MIT license, indicate your decision by deleting the provisions above
and replace them with the notice and other provisions required by GPL as set
out in the file called "GPL-COPYING" included in this distribution. If you do
not delete the provisions above, a recipient may use your version of this file
under the terms of either the MIT license or GPL.
This License is also included in this distribution in the file called
"MIT-COPYING".
EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ /**************************************************************************/
#include <stddef.h>
#include <linux/uaccess.h>
#include "img_defs.h"
#include "rgxinit.h"
#include "common_rgxinit_bridge.h"
#include "allocmem.h"
#include "pvr_debug.h"
#include "connection_server.h"
#include "pvr_bridge.h"
#include "rgx_bridge.h"
#include "srvcore.h"
#include "handle.h"
#if defined (SUPPORT_AUTH)
#include "osauth.h"
#endif
#include <linux/slab.h>
static PVRSRV_ERROR ReleaseFWCodeAllocServerExportCookie(IMG_VOID *pvData)
{
PVR_UNREFERENCED_PARAMETER(pvData);
return PVRSRV_OK;
}
static PVRSRV_ERROR ReleaseFWDataAllocServerExportCookie(IMG_VOID *pvData)
{
PVR_UNREFERENCED_PARAMETER(pvData);
return PVRSRV_OK;
}
static PVRSRV_ERROR ReleaseFWCorememAllocServerExportCookie(IMG_VOID *pvData)
{
PVR_UNREFERENCED_PARAMETER(pvData);
return PVRSRV_OK;
}
static PVRSRV_ERROR ReleaseHWPerfDataAllocServerExportCookie(IMG_VOID *pvData)
{
PVR_UNREFERENCED_PARAMETER(pvData);
return PVRSRV_OK;
}
/* ***************************************************************************
* Server-side bridge entry points
*/
static IMG_INT
PVRSRVBridgeRGXInitAllocFWImgMem(IMG_UINT32 ui32DispatchTableEntry,
PVRSRV_BRIDGE_IN_RGXINITALLOCFWIMGMEM *psRGXInitAllocFWImgMemIN,
PVRSRV_BRIDGE_OUT_RGXINITALLOCFWIMGMEM *psRGXInitAllocFWImgMemOUT,
CONNECTION_DATA *psConnection)
{
IMG_HANDLE hDevNodeInt = IMG_NULL;
DEVMEM_EXPORTCOOKIE * psFWCodeAllocServerExportCookieInt = IMG_NULL;
DEVMEM_EXPORTCOOKIE * psFWDataAllocServerExportCookieInt = IMG_NULL;
DEVMEM_EXPORTCOOKIE * psFWCorememAllocServerExportCookieInt = IMG_NULL;
{
/* Look up the address from the handle */
psRGXInitAllocFWImgMemOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_VOID **) &hDevNodeInt,
psRGXInitAllocFWImgMemIN->hDevNode,
PVRSRV_HANDLE_TYPE_DEV_NODE);
if(psRGXInitAllocFWImgMemOUT->eError != PVRSRV_OK)
{
goto RGXInitAllocFWImgMem_exit;
}
}
psRGXInitAllocFWImgMemOUT->eError =
PVRSRVRGXInitAllocFWImgMemKM(
hDevNodeInt,
psRGXInitAllocFWImgMemIN->uiFWCodeLen,
psRGXInitAllocFWImgMemIN->uiFWDataLen,
psRGXInitAllocFWImgMemIN->uiFWCoremem,
&psFWCodeAllocServerExportCookieInt,
&psRGXInitAllocFWImgMemOUT->sFWCodeDevVAddrBase,
&psFWDataAllocServerExportCookieInt,
&psRGXInitAllocFWImgMemOUT->sFWDataDevVAddrBase,
&psFWCorememAllocServerExportCookieInt,
&psRGXInitAllocFWImgMemOUT->sFWCorememDevVAddrBase,
&psRGXInitAllocFWImgMemOUT->sFWCorememMetaVAddrBase);
/* Exit early if bridged call fails */
if(psRGXInitAllocFWImgMemOUT->eError != PVRSRV_OK)
{
goto RGXInitAllocFWImgMem_exit;
}
psRGXInitAllocFWImgMemOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase,
&psRGXInitAllocFWImgMemOUT->hFWCodeAllocServerExportCookie,
(IMG_VOID *) psFWCodeAllocServerExportCookieInt,
PVRSRV_HANDLE_TYPE_SERVER_EXPORTCOOKIE,
PVRSRV_HANDLE_ALLOC_FLAG_NONE
,(PFN_HANDLE_RELEASE)&ReleaseFWCodeAllocServerExportCookie);
if (psRGXInitAllocFWImgMemOUT->eError != PVRSRV_OK)
{
goto RGXInitAllocFWImgMem_exit;
}
psRGXInitAllocFWImgMemOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase,
&psRGXInitAllocFWImgMemOUT->hFWDataAllocServerExportCookie,
(IMG_VOID *) psFWDataAllocServerExportCookieInt,
PVRSRV_HANDLE_TYPE_SERVER_EXPORTCOOKIE,
PVRSRV_HANDLE_ALLOC_FLAG_NONE
,(PFN_HANDLE_RELEASE)&ReleaseFWDataAllocServerExportCookie);
if (psRGXInitAllocFWImgMemOUT->eError != PVRSRV_OK)
{
goto RGXInitAllocFWImgMem_exit;
}
psRGXInitAllocFWImgMemOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase,
&psRGXInitAllocFWImgMemOUT->hFWCorememAllocServerExportCookie,
(IMG_VOID *) psFWCorememAllocServerExportCookieInt,
PVRSRV_HANDLE_TYPE_SERVER_EXPORTCOOKIE,
PVRSRV_HANDLE_ALLOC_FLAG_NONE
,(PFN_HANDLE_RELEASE)&ReleaseFWCorememAllocServerExportCookie);
if (psRGXInitAllocFWImgMemOUT->eError != PVRSRV_OK)
{
goto RGXInitAllocFWImgMem_exit;
}
RGXInitAllocFWImgMem_exit:
if (psRGXInitAllocFWImgMemOUT->eError != PVRSRV_OK)
{
}
return 0;
}
static IMG_INT
PVRSRVBridgeRGXInitFirmware(IMG_UINT32 ui32DispatchTableEntry,
PVRSRV_BRIDGE_IN_RGXINITFIRMWARE *psRGXInitFirmwareIN,
PVRSRV_BRIDGE_OUT_RGXINITFIRMWARE *psRGXInitFirmwareOUT,
CONNECTION_DATA *psConnection)
{
IMG_HANDLE hDevNodeInt = IMG_NULL;
IMG_UINT32 *ui32RGXFWAlignChecksInt = IMG_NULL;
DEVMEM_EXPORTCOOKIE * psHWPerfDataAllocServerExportCookieInt = IMG_NULL;
if (psRGXInitFirmwareIN->ui32RGXFWAlignChecksSize != 0)
{
ui32RGXFWAlignChecksInt = OSAllocMem(psRGXInitFirmwareIN->ui32RGXFWAlignChecksSize * sizeof(IMG_UINT32));
if (!ui32RGXFWAlignChecksInt)
{
psRGXInitFirmwareOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY;
goto RGXInitFirmware_exit;
}
}
/* Copy the data over */
if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXInitFirmwareIN->pui32RGXFWAlignChecks, psRGXInitFirmwareIN->ui32RGXFWAlignChecksSize * sizeof(IMG_UINT32))
|| (OSCopyFromUser(NULL, ui32RGXFWAlignChecksInt, psRGXInitFirmwareIN->pui32RGXFWAlignChecks,
psRGXInitFirmwareIN->ui32RGXFWAlignChecksSize * sizeof(IMG_UINT32)) != PVRSRV_OK) )
{
psRGXInitFirmwareOUT->eError = PVRSRV_ERROR_INVALID_PARAMS;
goto RGXInitFirmware_exit;
}
{
/* Look up the address from the handle */
psRGXInitFirmwareOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_VOID **) &hDevNodeInt,
psRGXInitFirmwareIN->hDevNode,
PVRSRV_HANDLE_TYPE_DEV_NODE);
if(psRGXInitFirmwareOUT->eError != PVRSRV_OK)
{
goto RGXInitFirmware_exit;
}
}
psRGXInitFirmwareOUT->eError =
PVRSRVRGXInitFirmwareKM(
hDevNodeInt,
&psRGXInitFirmwareOUT->spsRGXFwInit,
psRGXInitFirmwareIN->bEnableSignatureChecks,
psRGXInitFirmwareIN->ui32SignatureChecksBufSize,
psRGXInitFirmwareIN->ui32HWPerfFWBufSizeKB,
psRGXInitFirmwareIN->ui64HWPerfFilter,
psRGXInitFirmwareIN->ui32RGXFWAlignChecksSize,
ui32RGXFWAlignChecksInt,
psRGXInitFirmwareIN->ui32ConfigFlags,
psRGXInitFirmwareIN->ui32LogType,
psRGXInitFirmwareIN->ui32FilterFlags,
psRGXInitFirmwareIN->ui32JonesDisableMask,
psRGXInitFirmwareIN->ui32ui32HWRDebugDumpLimit,
&psRGXInitFirmwareIN->sClientBVNC,
psRGXInitFirmwareIN->ui32HWPerfCountersDataSize,
&psHWPerfDataAllocServerExportCookieInt,
psRGXInitFirmwareIN->eRGXRDPowerIslandConf);
/* Exit early if bridged call fails */
if(psRGXInitFirmwareOUT->eError != PVRSRV_OK)
{
goto RGXInitFirmware_exit;
}
psRGXInitFirmwareOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase,
&psRGXInitFirmwareOUT->hHWPerfDataAllocServerExportCookie,
(IMG_VOID *) psHWPerfDataAllocServerExportCookieInt,
PVRSRV_HANDLE_TYPE_SERVER_EXPORTCOOKIE,
PVRSRV_HANDLE_ALLOC_FLAG_NONE
,(PFN_HANDLE_RELEASE)&ReleaseHWPerfDataAllocServerExportCookie);
if (psRGXInitFirmwareOUT->eError != PVRSRV_OK)
{
goto RGXInitFirmware_exit;
}
RGXInitFirmware_exit:
if (psRGXInitFirmwareOUT->eError != PVRSRV_OK)
{
}
if (ui32RGXFWAlignChecksInt)
OSFreeMem(ui32RGXFWAlignChecksInt);
return 0;
}
static IMG_INT
PVRSRVBridgeRGXInitLoadFWImage(IMG_UINT32 ui32DispatchTableEntry,
PVRSRV_BRIDGE_IN_RGXINITLOADFWIMAGE *psRGXInitLoadFWImageIN,
PVRSRV_BRIDGE_OUT_RGXINITLOADFWIMAGE *psRGXInitLoadFWImageOUT,
CONNECTION_DATA *psConnection)
{
PMR * psImgDestImportInt = IMG_NULL;
PMR * psImgSrcImportInt = IMG_NULL;
PMR * psSigImportInt = IMG_NULL;
{
/* Look up the address from the handle */
psRGXInitLoadFWImageOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_VOID **) &psImgDestImportInt,
psRGXInitLoadFWImageIN->hImgDestImport,
PVRSRV_HANDLE_TYPE_PHYSMEM_PMR);
if(psRGXInitLoadFWImageOUT->eError != PVRSRV_OK)
{
goto RGXInitLoadFWImage_exit;
}
}
{
/* Look up the address from the handle */
psRGXInitLoadFWImageOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_VOID **) &psImgSrcImportInt,
psRGXInitLoadFWImageIN->hImgSrcImport,
PVRSRV_HANDLE_TYPE_PHYSMEM_PMR);
if(psRGXInitLoadFWImageOUT->eError != PVRSRV_OK)
{
goto RGXInitLoadFWImage_exit;
}
}
{
/* Look up the address from the handle */
psRGXInitLoadFWImageOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_VOID **) &psSigImportInt,
psRGXInitLoadFWImageIN->hSigImport,
PVRSRV_HANDLE_TYPE_PHYSMEM_PMR);
if(psRGXInitLoadFWImageOUT->eError != PVRSRV_OK)
{
goto RGXInitLoadFWImage_exit;
}
}
psRGXInitLoadFWImageOUT->eError =
PVRSRVRGXInitLoadFWImageKM(
psImgDestImportInt,
psImgSrcImportInt,
psRGXInitLoadFWImageIN->ui64ImgLen,
psSigImportInt,
psRGXInitLoadFWImageIN->ui64SigLen);
RGXInitLoadFWImage_exit:
return 0;
}
static IMG_INT
PVRSRVBridgeRGXInitDevPart2(IMG_UINT32 ui32DispatchTableEntry,
PVRSRV_BRIDGE_IN_RGXINITDEVPART2 *psRGXInitDevPart2IN,
PVRSRV_BRIDGE_OUT_RGXINITDEVPART2 *psRGXInitDevPart2OUT,
CONNECTION_DATA *psConnection)
{
IMG_HANDLE hDevNodeInt = IMG_NULL;
RGX_INIT_COMMAND *psInitScriptInt = IMG_NULL;
RGX_INIT_COMMAND *psDbgScriptInt = IMG_NULL;
RGX_INIT_COMMAND *psDbgBusScriptInt = IMG_NULL;
RGX_INIT_COMMAND *psDeinitScriptInt = IMG_NULL;
DEVMEM_EXPORTCOOKIE * psFWCodeAllocServerExportCookieInt = IMG_NULL;
DEVMEM_EXPORTCOOKIE * psFWDataAllocServerExportCookieInt = IMG_NULL;
DEVMEM_EXPORTCOOKIE * psFWCorememAllocServerExportCookieInt = IMG_NULL;
DEVMEM_EXPORTCOOKIE * psHWPerfDataAllocServerExportCookieInt = IMG_NULL;
{
psInitScriptInt = OSAllocMem(RGX_MAX_INIT_COMMANDS * sizeof(RGX_INIT_COMMAND));
if (!psInitScriptInt)
{
psRGXInitDevPart2OUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY;
goto RGXInitDevPart2_exit;
}
}
/* Copy the data over */
if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXInitDevPart2IN->psInitScript, RGX_MAX_INIT_COMMANDS * sizeof(RGX_INIT_COMMAND))
|| (OSCopyFromUser(NULL, psInitScriptInt, psRGXInitDevPart2IN->psInitScript,
RGX_MAX_INIT_COMMANDS * sizeof(RGX_INIT_COMMAND)) != PVRSRV_OK) )
{
psRGXInitDevPart2OUT->eError = PVRSRV_ERROR_INVALID_PARAMS;
goto RGXInitDevPart2_exit;
}
{
psDbgScriptInt = OSAllocMem(RGX_MAX_DEBUG_COMMANDS * sizeof(RGX_INIT_COMMAND));
if (!psDbgScriptInt)
{
psRGXInitDevPart2OUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY;
goto RGXInitDevPart2_exit;
}
}
/* Copy the data over */
if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXInitDevPart2IN->psDbgScript, RGX_MAX_DEBUG_COMMANDS * sizeof(RGX_INIT_COMMAND))
|| (OSCopyFromUser(NULL, psDbgScriptInt, psRGXInitDevPart2IN->psDbgScript,
RGX_MAX_DEBUG_COMMANDS * sizeof(RGX_INIT_COMMAND)) != PVRSRV_OK) )
{
psRGXInitDevPart2OUT->eError = PVRSRV_ERROR_INVALID_PARAMS;
goto RGXInitDevPart2_exit;
}
{
psDbgBusScriptInt = OSAllocMem(RGX_MAX_DBGBUS_COMMANDS * sizeof(RGX_INIT_COMMAND));
if (!psDbgBusScriptInt)
{
psRGXInitDevPart2OUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY;
goto RGXInitDevPart2_exit;
}
}
/* Copy the data over */
if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXInitDevPart2IN->psDbgBusScript, RGX_MAX_DBGBUS_COMMANDS * sizeof(RGX_INIT_COMMAND))
|| (OSCopyFromUser(NULL, psDbgBusScriptInt, psRGXInitDevPart2IN->psDbgBusScript,
RGX_MAX_DBGBUS_COMMANDS * sizeof(RGX_INIT_COMMAND)) != PVRSRV_OK) )
{
psRGXInitDevPart2OUT->eError = PVRSRV_ERROR_INVALID_PARAMS;
goto RGXInitDevPart2_exit;
}
{
psDeinitScriptInt = OSAllocMem(RGX_MAX_DEINIT_COMMANDS * sizeof(RGX_INIT_COMMAND));
if (!psDeinitScriptInt)
{
psRGXInitDevPart2OUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY;
goto RGXInitDevPart2_exit;
}
}
/* Copy the data over */
if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXInitDevPart2IN->psDeinitScript, RGX_MAX_DEINIT_COMMANDS * sizeof(RGX_INIT_COMMAND))
|| (OSCopyFromUser(NULL, psDeinitScriptInt, psRGXInitDevPart2IN->psDeinitScript,
RGX_MAX_DEINIT_COMMANDS * sizeof(RGX_INIT_COMMAND)) != PVRSRV_OK) )
{
psRGXInitDevPart2OUT->eError = PVRSRV_ERROR_INVALID_PARAMS;
goto RGXInitDevPart2_exit;
}
{
/* Look up the address from the handle */
psRGXInitDevPart2OUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_VOID **) &hDevNodeInt,
psRGXInitDevPart2IN->hDevNode,
PVRSRV_HANDLE_TYPE_DEV_NODE);
if(psRGXInitDevPart2OUT->eError != PVRSRV_OK)
{
goto RGXInitDevPart2_exit;
}
}
{
/* Look up the address from the handle */
psRGXInitDevPart2OUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_VOID **) &psFWCodeAllocServerExportCookieInt,
psRGXInitDevPart2IN->hFWCodeAllocServerExportCookie,
PVRSRV_HANDLE_TYPE_SERVER_EXPORTCOOKIE);
if(psRGXInitDevPart2OUT->eError != PVRSRV_OK)
{
goto RGXInitDevPart2_exit;
}
}
{
/* Look up the address from the handle */
psRGXInitDevPart2OUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_VOID **) &psFWDataAllocServerExportCookieInt,
psRGXInitDevPart2IN->hFWDataAllocServerExportCookie,
PVRSRV_HANDLE_TYPE_SERVER_EXPORTCOOKIE);
if(psRGXInitDevPart2OUT->eError != PVRSRV_OK)
{
goto RGXInitDevPart2_exit;
}
}
{
/* Look up the address from the handle */
psRGXInitDevPart2OUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_VOID **) &psFWCorememAllocServerExportCookieInt,
psRGXInitDevPart2IN->hFWCorememAllocServerExportCookie,
PVRSRV_HANDLE_TYPE_SERVER_EXPORTCOOKIE);
if(psRGXInitDevPart2OUT->eError != PVRSRV_OK)
{
goto RGXInitDevPart2_exit;
}
}
{
/* Look up the address from the handle */
psRGXInitDevPart2OUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_VOID **) &psHWPerfDataAllocServerExportCookieInt,
psRGXInitDevPart2IN->hHWPerfDataAllocServerExportCookie,
PVRSRV_HANDLE_TYPE_SERVER_EXPORTCOOKIE);
if(psRGXInitDevPart2OUT->eError != PVRSRV_OK)
{
goto RGXInitDevPart2_exit;
}
}
psRGXInitDevPart2OUT->eError =
PVRSRVRGXInitDevPart2KM(
hDevNodeInt,
psInitScriptInt,
psDbgScriptInt,
psDbgBusScriptInt,
psDeinitScriptInt,
psRGXInitDevPart2IN->ui32ui32KernelCatBaseIdReg,
psRGXInitDevPart2IN->ui32KernelCatBaseId,
psRGXInitDevPart2IN->ui32KernelCatBaseReg,
psRGXInitDevPart2IN->ui32KernelCatBaseWordSize,
psRGXInitDevPart2IN->ui32KernelCatBaseAlignShift,
psRGXInitDevPart2IN->ui32KernelCatBaseShift,
psRGXInitDevPart2IN->ui64KernelCatBaseMask,
psRGXInitDevPart2IN->ui32DeviceFlags,
psRGXInitDevPart2IN->ui32RGXActivePMConf,
psFWCodeAllocServerExportCookieInt,
psFWDataAllocServerExportCookieInt,
psFWCorememAllocServerExportCookieInt,
psHWPerfDataAllocServerExportCookieInt);
psRGXInitDevPart2OUT->eError =
PVRSRVReleaseHandle(psConnection->psHandleBase,
(IMG_HANDLE) psRGXInitDevPart2IN->hFWCodeAllocServerExportCookie,
PVRSRV_HANDLE_TYPE_SERVER_EXPORTCOOKIE);
if ((psRGXInitDevPart2OUT->eError != PVRSRV_OK) && (psRGXInitDevPart2OUT->eError != PVRSRV_ERROR_RETRY))
{
PVR_ASSERT(0);
goto RGXInitDevPart2_exit;
}
psRGXInitDevPart2OUT->eError =
PVRSRVReleaseHandle(psConnection->psHandleBase,
(IMG_HANDLE) psRGXInitDevPart2IN->hFWDataAllocServerExportCookie,
PVRSRV_HANDLE_TYPE_SERVER_EXPORTCOOKIE);
if ((psRGXInitDevPart2OUT->eError != PVRSRV_OK) && (psRGXInitDevPart2OUT->eError != PVRSRV_ERROR_RETRY))
{
PVR_ASSERT(0);
goto RGXInitDevPart2_exit;
}
psRGXInitDevPart2OUT->eError =
PVRSRVReleaseHandle(psConnection->psHandleBase,
(IMG_HANDLE) psRGXInitDevPart2IN->hFWCorememAllocServerExportCookie,
PVRSRV_HANDLE_TYPE_SERVER_EXPORTCOOKIE);
if ((psRGXInitDevPart2OUT->eError != PVRSRV_OK) && (psRGXInitDevPart2OUT->eError != PVRSRV_ERROR_RETRY))
{
PVR_ASSERT(0);
goto RGXInitDevPart2_exit;
}
psRGXInitDevPart2OUT->eError =
PVRSRVReleaseHandle(psConnection->psHandleBase,
(IMG_HANDLE) psRGXInitDevPart2IN->hHWPerfDataAllocServerExportCookie,
PVRSRV_HANDLE_TYPE_SERVER_EXPORTCOOKIE);
if ((psRGXInitDevPart2OUT->eError != PVRSRV_OK) && (psRGXInitDevPart2OUT->eError != PVRSRV_ERROR_RETRY))
{
PVR_ASSERT(0);
goto RGXInitDevPart2_exit;
}
RGXInitDevPart2_exit:
if (psInitScriptInt)
OSFreeMem(psInitScriptInt);
if (psDbgScriptInt)
OSFreeMem(psDbgScriptInt);
if (psDbgBusScriptInt)
OSFreeMem(psDbgBusScriptInt);
if (psDeinitScriptInt)
OSFreeMem(psDeinitScriptInt);
return 0;
}
static IMG_INT
PVRSRVBridgeGPUVIRTPopulateLMASubArenas(IMG_UINT32 ui32DispatchTableEntry,
PVRSRV_BRIDGE_IN_GPUVIRTPOPULATELMASUBARENAS *psGPUVIRTPopulateLMASubArenasIN,
PVRSRV_BRIDGE_OUT_GPUVIRTPOPULATELMASUBARENAS *psGPUVIRTPopulateLMASubArenasOUT,
CONNECTION_DATA *psConnection)
{
IMG_HANDLE hDevNodeInt = IMG_NULL;
IMG_UINT32 *ui32ElementsInt = IMG_NULL;
if (psGPUVIRTPopulateLMASubArenasIN->ui32NumElements != 0)
{
ui32ElementsInt = OSAllocMem(psGPUVIRTPopulateLMASubArenasIN->ui32NumElements * sizeof(IMG_UINT32));
if (!ui32ElementsInt)
{
psGPUVIRTPopulateLMASubArenasOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY;
goto GPUVIRTPopulateLMASubArenas_exit;
}
}
/* Copy the data over */
if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psGPUVIRTPopulateLMASubArenasIN->pui32Elements, psGPUVIRTPopulateLMASubArenasIN->ui32NumElements * sizeof(IMG_UINT32))
|| (OSCopyFromUser(NULL, ui32ElementsInt, psGPUVIRTPopulateLMASubArenasIN->pui32Elements,
psGPUVIRTPopulateLMASubArenasIN->ui32NumElements * sizeof(IMG_UINT32)) != PVRSRV_OK) )
{
psGPUVIRTPopulateLMASubArenasOUT->eError = PVRSRV_ERROR_INVALID_PARAMS;
goto GPUVIRTPopulateLMASubArenas_exit;
}
{
/* Look up the address from the handle */
psGPUVIRTPopulateLMASubArenasOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_VOID **) &hDevNodeInt,
psGPUVIRTPopulateLMASubArenasIN->hDevNode,
PVRSRV_HANDLE_TYPE_DEV_NODE);
if(psGPUVIRTPopulateLMASubArenasOUT->eError != PVRSRV_OK)
{
goto GPUVIRTPopulateLMASubArenas_exit;
}
}
psGPUVIRTPopulateLMASubArenasOUT->eError =
PVRSRVGPUVIRTPopulateLMASubArenasKM(
hDevNodeInt,
psGPUVIRTPopulateLMASubArenasIN->ui32NumElements,
ui32ElementsInt);
GPUVIRTPopulateLMASubArenas_exit:
if (ui32ElementsInt)
OSFreeMem(ui32ElementsInt);
return 0;
}
/* ***************************************************************************
* Server bridge dispatch related glue
*/
PVRSRV_ERROR InitRGXINITBridge(IMG_VOID);
PVRSRV_ERROR DeinitRGXINITBridge(IMG_VOID);
/*
* Register all RGXINIT functions with services
*/
PVRSRV_ERROR InitRGXINITBridge(IMG_VOID)
{
SetDispatchTableEntry(PVRSRV_BRIDGE_RGXINIT, PVRSRV_BRIDGE_RGXINIT_RGXINITALLOCFWIMGMEM, PVRSRVBridgeRGXInitAllocFWImgMem,
IMG_NULL, IMG_NULL,
0, 0);
SetDispatchTableEntry(PVRSRV_BRIDGE_RGXINIT, PVRSRV_BRIDGE_RGXINIT_RGXINITFIRMWARE, PVRSRVBridgeRGXInitFirmware,
IMG_NULL, IMG_NULL,
0, 0);
SetDispatchTableEntry(PVRSRV_BRIDGE_RGXINIT, PVRSRV_BRIDGE_RGXINIT_RGXINITLOADFWIMAGE, PVRSRVBridgeRGXInitLoadFWImage,
IMG_NULL, IMG_NULL,
0, 0);
SetDispatchTableEntry(PVRSRV_BRIDGE_RGXINIT, PVRSRV_BRIDGE_RGXINIT_RGXINITDEVPART2, PVRSRVBridgeRGXInitDevPart2,
IMG_NULL, IMG_NULL,
0, 0);
SetDispatchTableEntry(PVRSRV_BRIDGE_RGXINIT, PVRSRV_BRIDGE_RGXINIT_GPUVIRTPOPULATELMASUBARENAS, PVRSRVBridgeGPUVIRTPopulateLMASubArenas,
IMG_NULL, IMG_NULL,
0, 0);
return PVRSRV_OK;
}
/*
* Unregister all rgxinit functions with services
*/
PVRSRV_ERROR DeinitRGXINITBridge(IMG_VOID)
{
return PVRSRV_OK;
}

View File

@@ -1,96 +0,0 @@
/*************************************************************************/ /*!
@File
@Title Common bridge header for rgxpdump
@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
@Description Declares common defines and structures that are used by both
the client and sever side of the bridge for rgxpdump
@License Dual MIT/GPLv2
The contents of this file are subject to the MIT license as set out below.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
Alternatively, the contents of this file may be used under the terms of
the GNU General Public License Version 2 ("GPL") in which case the provisions
of GPL are applicable instead of those above.
If you wish to allow use of your version of this file only under the terms of
GPL, and not to allow others to use your version of this file under the terms
of the MIT license, indicate your decision by deleting the provisions above
and replace them with the notice and other provisions required by GPL as set
out in the file called "GPL-COPYING" included in this distribution. If you do
not delete the provisions above, a recipient may use your version of this file
under the terms of either the MIT license or GPL.
This License is also included in this distribution in the file called
"MIT-COPYING".
EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ /**************************************************************************/
#ifndef COMMON_RGXPDUMP_BRIDGE_H
#define COMMON_RGXPDUMP_BRIDGE_H
#include "img_types.h"
#include "pvrsrv_error.h"
#include "rgx_bridge.h"
#define PVRSRV_BRIDGE_RGXPDUMP_CMD_FIRST 0
#define PVRSRV_BRIDGE_RGXPDUMP_PDUMPTRACEBUFFER PVRSRV_BRIDGE_RGXPDUMP_CMD_FIRST+0
#define PVRSRV_BRIDGE_RGXPDUMP_PDUMPSIGNATUREBUFFER PVRSRV_BRIDGE_RGXPDUMP_CMD_FIRST+1
#define PVRSRV_BRIDGE_RGXPDUMP_CMD_LAST (PVRSRV_BRIDGE_RGXPDUMP_CMD_FIRST+1)
/*******************************************
PDumpTraceBuffer
*******************************************/
/* Bridge in structure for PDumpTraceBuffer */
typedef struct PVRSRV_BRIDGE_IN_PDUMPTRACEBUFFER_TAG
{
IMG_HANDLE hDeviceNode;
IMG_UINT32 ui32PDumpFlags;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_PDUMPTRACEBUFFER;
/* Bridge out structure for PDumpTraceBuffer */
typedef struct PVRSRV_BRIDGE_OUT_PDUMPTRACEBUFFER_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PDUMPTRACEBUFFER;
/*******************************************
PDumpSignatureBuffer
*******************************************/
/* Bridge in structure for PDumpSignatureBuffer */
typedef struct PVRSRV_BRIDGE_IN_PDUMPSIGNATUREBUFFER_TAG
{
IMG_HANDLE hDeviceNode;
IMG_UINT32 ui32PDumpFlags;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_PDUMPSIGNATUREBUFFER;
/* Bridge out structure for PDumpSignatureBuffer */
typedef struct PVRSRV_BRIDGE_OUT_PDUMPSIGNATUREBUFFER_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PDUMPSIGNATUREBUFFER;
#endif /* COMMON_RGXPDUMP_BRIDGE_H */

View File

@@ -1,192 +0,0 @@
/*************************************************************************/ /*!
@File
@Title Server bridge for rgxpdump
@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
@Description Implements the server side of the bridge for rgxpdump
@License Dual MIT/GPLv2
The contents of this file are subject to the MIT license as set out below.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
Alternatively, the contents of this file may be used under the terms of
the GNU General Public License Version 2 ("GPL") in which case the provisions
of GPL are applicable instead of those above.
If you wish to allow use of your version of this file only under the terms of
GPL, and not to allow others to use your version of this file under the terms
of the MIT license, indicate your decision by deleting the provisions above
and replace them with the notice and other provisions required by GPL as set
out in the file called "GPL-COPYING" included in this distribution. If you do
not delete the provisions above, a recipient may use your version of this file
under the terms of either the MIT license or GPL.
This License is also included in this distribution in the file called
"MIT-COPYING".
EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ /**************************************************************************/
#include <stddef.h>
#include <linux/uaccess.h>
#include "img_defs.h"
#include "rgxpdump.h"
#include "common_rgxpdump_bridge.h"
#include "allocmem.h"
#include "pvr_debug.h"
#include "connection_server.h"
#include "pvr_bridge.h"
#include "rgx_bridge.h"
#include "srvcore.h"
#include "handle.h"
#if defined (SUPPORT_AUTH)
#include "osauth.h"
#endif
#include <linux/slab.h>
/* ***************************************************************************
* Server-side bridge entry points
*/
static IMG_INT
PVRSRVBridgePDumpTraceBuffer(IMG_UINT32 ui32DispatchTableEntry,
PVRSRV_BRIDGE_IN_PDUMPTRACEBUFFER *psPDumpTraceBufferIN,
PVRSRV_BRIDGE_OUT_PDUMPTRACEBUFFER *psPDumpTraceBufferOUT,
CONNECTION_DATA *psConnection)
{
IMG_HANDLE hDeviceNodeInt = IMG_NULL;
{
/* Look up the address from the handle */
psPDumpTraceBufferOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_VOID **) &hDeviceNodeInt,
psPDumpTraceBufferIN->hDeviceNode,
PVRSRV_HANDLE_TYPE_DEV_NODE);
if(psPDumpTraceBufferOUT->eError != PVRSRV_OK)
{
goto PDumpTraceBuffer_exit;
}
}
psPDumpTraceBufferOUT->eError =
PVRSRVPDumpTraceBufferKM(
hDeviceNodeInt,
psPDumpTraceBufferIN->ui32PDumpFlags);
PDumpTraceBuffer_exit:
return 0;
}
static IMG_INT
PVRSRVBridgePDumpSignatureBuffer(IMG_UINT32 ui32DispatchTableEntry,
PVRSRV_BRIDGE_IN_PDUMPSIGNATUREBUFFER *psPDumpSignatureBufferIN,
PVRSRV_BRIDGE_OUT_PDUMPSIGNATUREBUFFER *psPDumpSignatureBufferOUT,
CONNECTION_DATA *psConnection)
{
IMG_HANDLE hDeviceNodeInt = IMG_NULL;
{
/* Look up the address from the handle */
psPDumpSignatureBufferOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_VOID **) &hDeviceNodeInt,
psPDumpSignatureBufferIN->hDeviceNode,
PVRSRV_HANDLE_TYPE_DEV_NODE);
if(psPDumpSignatureBufferOUT->eError != PVRSRV_OK)
{
goto PDumpSignatureBuffer_exit;
}
}
psPDumpSignatureBufferOUT->eError =
PVRSRVPDumpSignatureBufferKM(
hDeviceNodeInt,
psPDumpSignatureBufferIN->ui32PDumpFlags);
PDumpSignatureBuffer_exit:
return 0;
}
/* ***************************************************************************
* Server bridge dispatch related glue
*/
PVRSRV_ERROR InitRGXPDUMPBridge(IMG_VOID);
PVRSRV_ERROR DeinitRGXPDUMPBridge(IMG_VOID);
/*
* Register all RGXPDUMP functions with services
*/
PVRSRV_ERROR InitRGXPDUMPBridge(IMG_VOID)
{
SetDispatchTableEntry(PVRSRV_BRIDGE_RGXPDUMP, PVRSRV_BRIDGE_RGXPDUMP_PDUMPTRACEBUFFER, PVRSRVBridgePDumpTraceBuffer,
IMG_NULL, IMG_NULL,
0, 0);
SetDispatchTableEntry(PVRSRV_BRIDGE_RGXPDUMP, PVRSRV_BRIDGE_RGXPDUMP_PDUMPSIGNATUREBUFFER, PVRSRVBridgePDumpSignatureBuffer,
IMG_NULL, IMG_NULL,
0, 0);
return PVRSRV_OK;
}
/*
* Unregister all rgxpdump functions with services
*/
PVRSRV_ERROR DeinitRGXPDUMPBridge(IMG_VOID)
{
return PVRSRV_OK;
}

View File

@@ -1,531 +0,0 @@
/*************************************************************************/ /*!
@File
@Title Common bridge header for rgxta3d
@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
@Description Declares common defines and structures that are used by both
the client and sever side of the bridge for rgxta3d
@License Dual MIT/GPLv2
The contents of this file are subject to the MIT license as set out below.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
Alternatively, the contents of this file may be used under the terms of
the GNU General Public License Version 2 ("GPL") in which case the provisions
of GPL are applicable instead of those above.
If you wish to allow use of your version of this file only under the terms of
GPL, and not to allow others to use your version of this file under the terms
of the MIT license, indicate your decision by deleting the provisions above
and replace them with the notice and other provisions required by GPL as set
out in the file called "GPL-COPYING" included in this distribution. If you do
not delete the provisions above, a recipient may use your version of this file
under the terms of either the MIT license or GPL.
This License is also included in this distribution in the file called
"MIT-COPYING".
EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ /**************************************************************************/
#ifndef COMMON_RGXTA3D_BRIDGE_H
#define COMMON_RGXTA3D_BRIDGE_H
#include "img_types.h"
#include "pvrsrv_error.h"
#include "rgx_bridge.h"
#include "sync_external.h"
#include "rgx_fwif_shared.h"
#define PVRSRV_BRIDGE_RGXTA3D_CMD_FIRST 0
#define PVRSRV_BRIDGE_RGXTA3D_RGXCREATEHWRTDATA PVRSRV_BRIDGE_RGXTA3D_CMD_FIRST+0
#define PVRSRV_BRIDGE_RGXTA3D_RGXDESTROYHWRTDATA PVRSRV_BRIDGE_RGXTA3D_CMD_FIRST+1
#define PVRSRV_BRIDGE_RGXTA3D_RGXCREATERENDERTARGET PVRSRV_BRIDGE_RGXTA3D_CMD_FIRST+2
#define PVRSRV_BRIDGE_RGXTA3D_RGXDESTROYRENDERTARGET PVRSRV_BRIDGE_RGXTA3D_CMD_FIRST+3
#define PVRSRV_BRIDGE_RGXTA3D_RGXCREATEZSBUFFER PVRSRV_BRIDGE_RGXTA3D_CMD_FIRST+4
#define PVRSRV_BRIDGE_RGXTA3D_RGXDESTROYZSBUFFER PVRSRV_BRIDGE_RGXTA3D_CMD_FIRST+5
#define PVRSRV_BRIDGE_RGXTA3D_RGXPOPULATEZSBUFFER PVRSRV_BRIDGE_RGXTA3D_CMD_FIRST+6
#define PVRSRV_BRIDGE_RGXTA3D_RGXUNPOPULATEZSBUFFER PVRSRV_BRIDGE_RGXTA3D_CMD_FIRST+7
#define PVRSRV_BRIDGE_RGXTA3D_RGXCREATEFREELIST PVRSRV_BRIDGE_RGXTA3D_CMD_FIRST+8
#define PVRSRV_BRIDGE_RGXTA3D_RGXDESTROYFREELIST PVRSRV_BRIDGE_RGXTA3D_CMD_FIRST+9
#define PVRSRV_BRIDGE_RGXTA3D_RGXADDBLOCKTOFREELIST PVRSRV_BRIDGE_RGXTA3D_CMD_FIRST+10
#define PVRSRV_BRIDGE_RGXTA3D_RGXREMOVEBLOCKFROMFREELIST PVRSRV_BRIDGE_RGXTA3D_CMD_FIRST+11
#define PVRSRV_BRIDGE_RGXTA3D_RGXCREATERENDERCONTEXT PVRSRV_BRIDGE_RGXTA3D_CMD_FIRST+12
#define PVRSRV_BRIDGE_RGXTA3D_RGXDESTROYRENDERCONTEXT PVRSRV_BRIDGE_RGXTA3D_CMD_FIRST+13
#define PVRSRV_BRIDGE_RGXTA3D_RGXKICKTA3D PVRSRV_BRIDGE_RGXTA3D_CMD_FIRST+14
#define PVRSRV_BRIDGE_RGXTA3D_RGXSETRENDERCONTEXTPRIORITY PVRSRV_BRIDGE_RGXTA3D_CMD_FIRST+15
#define PVRSRV_BRIDGE_RGXTA3D_RGXGETLASTRENDERCONTEXTRESETREASON PVRSRV_BRIDGE_RGXTA3D_CMD_FIRST+16
#define PVRSRV_BRIDGE_RGXTA3D_RGXGETPARTIALRENDERCOUNT PVRSRV_BRIDGE_RGXTA3D_CMD_FIRST+17
#define PVRSRV_BRIDGE_RGXTA3D_RGXKICKSYNCTA PVRSRV_BRIDGE_RGXTA3D_CMD_FIRST+18
#define PVRSRV_BRIDGE_RGXTA3D_CMD_LAST (PVRSRV_BRIDGE_RGXTA3D_CMD_FIRST+18)
/*******************************************
RGXCreateHWRTData
*******************************************/
/* Bridge in structure for RGXCreateHWRTData */
typedef struct PVRSRV_BRIDGE_IN_RGXCREATEHWRTDATA_TAG
{
IMG_HANDLE hDevNode;
IMG_UINT32 ui32RenderTarget;
IMG_DEV_VIRTADDR sPMMlistDevVAddr;
IMG_DEV_VIRTADDR sVFPPageTableAddr;
IMG_HANDLE * phapsFreeLists;
IMG_UINT32 ui32PPPScreen;
IMG_UINT32 ui32PPPGridOffset;
IMG_UINT64 ui64PPPMultiSampleCtl;
IMG_UINT32 ui32TPCStride;
IMG_DEV_VIRTADDR sTailPtrsDevVAddr;
IMG_UINT32 ui32TPCSize;
IMG_UINT32 ui32TEScreen;
IMG_UINT32 ui32TEAA;
IMG_UINT32 ui32TEMTILE1;
IMG_UINT32 ui32TEMTILE2;
IMG_UINT32 ui32MTileStride;
IMG_UINT32 ui32ui32ISPMergeLowerX;
IMG_UINT32 ui32ui32ISPMergeLowerY;
IMG_UINT32 ui32ui32ISPMergeUpperX;
IMG_UINT32 ui32ui32ISPMergeUpperY;
IMG_UINT32 ui32ui32ISPMergeScaleX;
IMG_UINT32 ui32ui32ISPMergeScaleY;
IMG_UINT16 ui16MaxRTs;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXCREATEHWRTDATA;
/* Bridge out structure for RGXCreateHWRTData */
typedef struct PVRSRV_BRIDGE_OUT_RGXCREATEHWRTDATA_TAG
{
IMG_HANDLE hCleanupCookie;
IMG_HANDLE hRTACtlMemDesc;
IMG_HANDLE hsHWRTDataMemDesc;
IMG_UINT32 ui32FWHWRTData;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXCREATEHWRTDATA;
/*******************************************
RGXDestroyHWRTData
*******************************************/
/* Bridge in structure for RGXDestroyHWRTData */
typedef struct PVRSRV_BRIDGE_IN_RGXDESTROYHWRTDATA_TAG
{
IMG_HANDLE hCleanupCookie;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXDESTROYHWRTDATA;
/* Bridge out structure for RGXDestroyHWRTData */
typedef struct PVRSRV_BRIDGE_OUT_RGXDESTROYHWRTDATA_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXDESTROYHWRTDATA;
/*******************************************
RGXCreateRenderTarget
*******************************************/
/* Bridge in structure for RGXCreateRenderTarget */
typedef struct PVRSRV_BRIDGE_IN_RGXCREATERENDERTARGET_TAG
{
IMG_HANDLE hDevNode;
IMG_DEV_VIRTADDR spsVHeapTableDevVAddr;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXCREATERENDERTARGET;
/* Bridge out structure for RGXCreateRenderTarget */
typedef struct PVRSRV_BRIDGE_OUT_RGXCREATERENDERTARGET_TAG
{
IMG_HANDLE hsRenderTargetMemDesc;
IMG_UINT32 ui32sRenderTargetFWDevVAddr;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXCREATERENDERTARGET;
/*******************************************
RGXDestroyRenderTarget
*******************************************/
/* Bridge in structure for RGXDestroyRenderTarget */
typedef struct PVRSRV_BRIDGE_IN_RGXDESTROYRENDERTARGET_TAG
{
IMG_HANDLE hsRenderTargetMemDesc;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXDESTROYRENDERTARGET;
/* Bridge out structure for RGXDestroyRenderTarget */
typedef struct PVRSRV_BRIDGE_OUT_RGXDESTROYRENDERTARGET_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXDESTROYRENDERTARGET;
/*******************************************
RGXCreateZSBuffer
*******************************************/
/* Bridge in structure for RGXCreateZSBuffer */
typedef struct PVRSRV_BRIDGE_IN_RGXCREATEZSBUFFER_TAG
{
IMG_HANDLE hDevNode;
IMG_HANDLE hReservation;
IMG_HANDLE hPMR;
PVRSRV_MEMALLOCFLAGS_T uiMapFlags;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXCREATEZSBUFFER;
/* Bridge out structure for RGXCreateZSBuffer */
typedef struct PVRSRV_BRIDGE_OUT_RGXCREATEZSBUFFER_TAG
{
IMG_HANDLE hsZSBufferKM;
IMG_UINT32 ui32sZSBufferFWDevVAddr;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXCREATEZSBUFFER;
/*******************************************
RGXDestroyZSBuffer
*******************************************/
/* Bridge in structure for RGXDestroyZSBuffer */
typedef struct PVRSRV_BRIDGE_IN_RGXDESTROYZSBUFFER_TAG
{
IMG_HANDLE hsZSBufferMemDesc;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXDESTROYZSBUFFER;
/* Bridge out structure for RGXDestroyZSBuffer */
typedef struct PVRSRV_BRIDGE_OUT_RGXDESTROYZSBUFFER_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXDESTROYZSBUFFER;
/*******************************************
RGXPopulateZSBuffer
*******************************************/
/* Bridge in structure for RGXPopulateZSBuffer */
typedef struct PVRSRV_BRIDGE_IN_RGXPOPULATEZSBUFFER_TAG
{
IMG_HANDLE hsZSBufferKM;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXPOPULATEZSBUFFER;
/* Bridge out structure for RGXPopulateZSBuffer */
typedef struct PVRSRV_BRIDGE_OUT_RGXPOPULATEZSBUFFER_TAG
{
IMG_HANDLE hsPopulation;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXPOPULATEZSBUFFER;
/*******************************************
RGXUnpopulateZSBuffer
*******************************************/
/* Bridge in structure for RGXUnpopulateZSBuffer */
typedef struct PVRSRV_BRIDGE_IN_RGXUNPOPULATEZSBUFFER_TAG
{
IMG_HANDLE hsPopulation;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXUNPOPULATEZSBUFFER;
/* Bridge out structure for RGXUnpopulateZSBuffer */
typedef struct PVRSRV_BRIDGE_OUT_RGXUNPOPULATEZSBUFFER_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXUNPOPULATEZSBUFFER;
/*******************************************
RGXCreateFreeList
*******************************************/
/* Bridge in structure for RGXCreateFreeList */
typedef struct PVRSRV_BRIDGE_IN_RGXCREATEFREELIST_TAG
{
IMG_HANDLE hDevNode;
IMG_UINT32 ui32ui32MaxFLPages;
IMG_UINT32 ui32ui32InitFLPages;
IMG_UINT32 ui32ui32GrowFLPages;
IMG_BOOL bbFreeListCheck;
IMG_DEV_VIRTADDR spsFreeListDevVAddr;
IMG_HANDLE hsFreeListPMR;
IMG_DEVMEM_OFFSET_T uiPMROffset;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXCREATEFREELIST;
/* Bridge out structure for RGXCreateFreeList */
typedef struct PVRSRV_BRIDGE_OUT_RGXCREATEFREELIST_TAG
{
IMG_HANDLE hCleanupCookie;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXCREATEFREELIST;
/*******************************************
RGXDestroyFreeList
*******************************************/
/* Bridge in structure for RGXDestroyFreeList */
typedef struct PVRSRV_BRIDGE_IN_RGXDESTROYFREELIST_TAG
{
IMG_HANDLE hCleanupCookie;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXDESTROYFREELIST;
/* Bridge out structure for RGXDestroyFreeList */
typedef struct PVRSRV_BRIDGE_OUT_RGXDESTROYFREELIST_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXDESTROYFREELIST;
/*******************************************
RGXAddBlockToFreeList
*******************************************/
/* Bridge in structure for RGXAddBlockToFreeList */
typedef struct PVRSRV_BRIDGE_IN_RGXADDBLOCKTOFREELIST_TAG
{
IMG_HANDLE hsFreeList;
IMG_UINT32 ui3232NumPages;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXADDBLOCKTOFREELIST;
/* Bridge out structure for RGXAddBlockToFreeList */
typedef struct PVRSRV_BRIDGE_OUT_RGXADDBLOCKTOFREELIST_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXADDBLOCKTOFREELIST;
/*******************************************
RGXRemoveBlockFromFreeList
*******************************************/
/* Bridge in structure for RGXRemoveBlockFromFreeList */
typedef struct PVRSRV_BRIDGE_IN_RGXREMOVEBLOCKFROMFREELIST_TAG
{
IMG_HANDLE hsFreeList;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXREMOVEBLOCKFROMFREELIST;
/* Bridge out structure for RGXRemoveBlockFromFreeList */
typedef struct PVRSRV_BRIDGE_OUT_RGXREMOVEBLOCKFROMFREELIST_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXREMOVEBLOCKFROMFREELIST;
/*******************************************
RGXCreateRenderContext
*******************************************/
/* Bridge in structure for RGXCreateRenderContext */
typedef struct PVRSRV_BRIDGE_IN_RGXCREATERENDERCONTEXT_TAG
{
IMG_HANDLE hDevNode;
IMG_UINT32 ui32Priority;
IMG_DEV_VIRTADDR sMCUFenceAddr;
IMG_DEV_VIRTADDR sVDMCallStackAddr;
IMG_UINT32 ui32FrameworkCmdize;
IMG_BYTE * psFrameworkCmd;
IMG_HANDLE hPrivData;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXCREATERENDERCONTEXT;
/* Bridge out structure for RGXCreateRenderContext */
typedef struct PVRSRV_BRIDGE_OUT_RGXCREATERENDERCONTEXT_TAG
{
IMG_HANDLE hRenderContext;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXCREATERENDERCONTEXT;
/*******************************************
RGXDestroyRenderContext
*******************************************/
/* Bridge in structure for RGXDestroyRenderContext */
typedef struct PVRSRV_BRIDGE_IN_RGXDESTROYRENDERCONTEXT_TAG
{
IMG_HANDLE hCleanupCookie;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXDESTROYRENDERCONTEXT;
/* Bridge out structure for RGXDestroyRenderContext */
typedef struct PVRSRV_BRIDGE_OUT_RGXDESTROYRENDERCONTEXT_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXDESTROYRENDERCONTEXT;
/*******************************************
RGXKickTA3D
*******************************************/
/* Bridge in structure for RGXKickTA3D */
typedef struct PVRSRV_BRIDGE_IN_RGXKICKTA3D_TAG
{
IMG_HANDLE hRenderContext;
IMG_UINT32 ui32ClientTAFenceCount;
IMG_HANDLE * phClientTAFenceSyncPrimBlock;
IMG_UINT32 * pui32ClientTAFenceSyncOffset;
IMG_UINT32 * pui32ClientTAFenceValue;
IMG_UINT32 ui32ClientTAUpdateCount;
IMG_HANDLE * phClientTAUpdateSyncPrimBlock;
IMG_UINT32 * pui32ClientTAUpdateSyncOffset;
IMG_UINT32 * pui32ClientTAUpdateValue;
IMG_UINT32 ui32ServerTASyncPrims;
IMG_UINT32 * pui32ServerTASyncFlags;
IMG_HANDLE * phServerTASyncs;
IMG_UINT32 ui32Client3DFenceCount;
IMG_HANDLE * phClient3DFenceSyncPrimBlock;
IMG_UINT32 * pui32Client3DFenceSyncOffset;
IMG_UINT32 * pui32Client3DFenceValue;
IMG_UINT32 ui32Client3DUpdateCount;
IMG_HANDLE * phClient3DUpdateSyncPrimBlock;
IMG_UINT32 * pui32Client3DUpdateSyncOffset;
IMG_UINT32 * pui32Client3DUpdateValue;
IMG_UINT32 ui32Server3DSyncPrims;
IMG_UINT32 * pui32Server3DSyncFlags;
IMG_HANDLE * phServer3DSyncs;
IMG_HANDLE hPRFenceUFOSyncPrimBlock;
IMG_UINT32 ui32FRFenceUFOSyncOffset;
IMG_UINT32 ui32FRFenceValue;
IMG_UINT32 ui32NumCheckFenceFDs;
IMG_INT32 * pi32CheckFenceFDs;
IMG_INT32 i32UpdateFenceFD;
IMG_UINT32 ui32TACmdSize;
IMG_BYTE * psTACmd;
IMG_UINT32 ui323DPRCmdSize;
IMG_BYTE * ps3DPRCmd;
IMG_UINT32 ui323DCmdSize;
IMG_BYTE * ps3DCmd;
IMG_UINT32 ui32ExternalJobReference;
IMG_UINT32 ui32InternalJobReference;
IMG_BOOL bbLastTAInScene;
IMG_BOOL bbKickTA;
IMG_BOOL bbKickPR;
IMG_BOOL bbKick3D;
IMG_BOOL bbAbort;
IMG_BOOL bbPDumpContinuous;
IMG_HANDLE hRTDataCleanup;
IMG_HANDLE hZBuffer;
IMG_HANDLE hSBuffer;
IMG_BOOL bbCommitRefCountsTA;
IMG_BOOL bbCommitRefCounts3D;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXKICKTA3D;
/* Bridge out structure for RGXKickTA3D */
typedef struct PVRSRV_BRIDGE_OUT_RGXKICKTA3D_TAG
{
IMG_BOOL bbCommittedRefCountsTA;
IMG_BOOL bbCommittedRefCounts3D;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXKICKTA3D;
/*******************************************
RGXSetRenderContextPriority
*******************************************/
/* Bridge in structure for RGXSetRenderContextPriority */
typedef struct PVRSRV_BRIDGE_IN_RGXSETRENDERCONTEXTPRIORITY_TAG
{
IMG_HANDLE hRenderContext;
IMG_UINT32 ui32Priority;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXSETRENDERCONTEXTPRIORITY;
/* Bridge out structure for RGXSetRenderContextPriority */
typedef struct PVRSRV_BRIDGE_OUT_RGXSETRENDERCONTEXTPRIORITY_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXSETRENDERCONTEXTPRIORITY;
/*******************************************
RGXGetLastRenderContextResetReason
*******************************************/
/* Bridge in structure for RGXGetLastRenderContextResetReason */
typedef struct PVRSRV_BRIDGE_IN_RGXGETLASTRENDERCONTEXTRESETREASON_TAG
{
IMG_HANDLE hRenderContext;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXGETLASTRENDERCONTEXTRESETREASON;
/* Bridge out structure for RGXGetLastRenderContextResetReason */
typedef struct PVRSRV_BRIDGE_OUT_RGXGETLASTRENDERCONTEXTRESETREASON_TAG
{
IMG_UINT32 ui32LastResetReason;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXGETLASTRENDERCONTEXTRESETREASON;
/*******************************************
RGXGetPartialRenderCount
*******************************************/
/* Bridge in structure for RGXGetPartialRenderCount */
typedef struct PVRSRV_BRIDGE_IN_RGXGETPARTIALRENDERCOUNT_TAG
{
IMG_HANDLE hHWRTDataMemDesc;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXGETPARTIALRENDERCOUNT;
/* Bridge out structure for RGXGetPartialRenderCount */
typedef struct PVRSRV_BRIDGE_OUT_RGXGETPARTIALRENDERCOUNT_TAG
{
IMG_UINT32 ui32NumPartialRenders;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXGETPARTIALRENDERCOUNT;
/*******************************************
RGXKickSyncTA
*******************************************/
/* Bridge in structure for RGXKickSyncTA */
typedef struct PVRSRV_BRIDGE_IN_RGXKICKSYNCTA_TAG
{
IMG_HANDLE hRenderContext;
IMG_UINT32 ui32ClientTAFenceCount;
IMG_HANDLE * phClientTAFenceUFOSyncPrimBlock;
IMG_UINT32 * pui32ClientTAFenceOffset;
IMG_UINT32 * pui32ClientTAFenceValue;
IMG_UINT32 ui32ClientTAUpdateCount;
IMG_HANDLE * phClientTAUpdateUFOSyncPrimBlock;
IMG_UINT32 * pui32ClientTAUpdateOffset;
IMG_UINT32 * pui32ClientTAUpdateValue;
IMG_UINT32 ui32ServerTASyncPrims;
IMG_UINT32 * pui32ServerTASyncFlags;
IMG_HANDLE * phServerTASyncs;
IMG_UINT32 ui32Client3DFenceCount;
IMG_HANDLE * phClient3DFenceUFOSyncPrimBlock;
IMG_UINT32 * pui32Client3DFenceOffset;
IMG_UINT32 * pui32Client3DFenceValue;
IMG_UINT32 ui32Client3DUpdateCount;
IMG_HANDLE * phClient3DUpdateUFOSyncPrimBlock;
IMG_UINT32 * pui32Client3DUpdateOffset;
IMG_UINT32 * pui32Client3DUpdateValue;
IMG_UINT32 ui32Server3DSyncPrims;
IMG_UINT32 * pui32Server3DSyncFlags;
IMG_HANDLE * phServer3DSyncs;
IMG_UINT32 ui32NumCheckFenceFDs;
IMG_INT32 * pi32CheckFenceFDs;
IMG_INT32 i32UpdateFenceFD;
IMG_BOOL bbPDumpContinuous;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXKICKSYNCTA;
/* Bridge out structure for RGXKickSyncTA */
typedef struct PVRSRV_BRIDGE_OUT_RGXKICKSYNCTA_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXKICKSYNCTA;
#endif /* COMMON_RGXTA3D_BRIDGE_H */

View File

@@ -1,192 +0,0 @@
/*************************************************************************/ /*!
@File
@Title Common bridge header for rgxtq
@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
@Description Declares common defines and structures that are used by both
the client and sever side of the bridge for rgxtq
@License Dual MIT/GPLv2
The contents of this file are subject to the MIT license as set out below.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
Alternatively, the contents of this file may be used under the terms of
the GNU General Public License Version 2 ("GPL") in which case the provisions
of GPL are applicable instead of those above.
If you wish to allow use of your version of this file only under the terms of
GPL, and not to allow others to use your version of this file under the terms
of the MIT license, indicate your decision by deleting the provisions above
and replace them with the notice and other provisions required by GPL as set
out in the file called "GPL-COPYING" included in this distribution. If you do
not delete the provisions above, a recipient may use your version of this file
under the terms of either the MIT license or GPL.
This License is also included in this distribution in the file called
"MIT-COPYING".
EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ /**************************************************************************/
#ifndef COMMON_RGXTQ_BRIDGE_H
#define COMMON_RGXTQ_BRIDGE_H
#include "img_types.h"
#include "pvrsrv_error.h"
#include "rgx_bridge.h"
#include "sync_external.h"
#include "rgx_fwif_shared.h"
#define PVRSRV_BRIDGE_RGXTQ_CMD_FIRST 0
#define PVRSRV_BRIDGE_RGXTQ_RGXCREATETRANSFERCONTEXT PVRSRV_BRIDGE_RGXTQ_CMD_FIRST+0
#define PVRSRV_BRIDGE_RGXTQ_RGXDESTROYTRANSFERCONTEXT PVRSRV_BRIDGE_RGXTQ_CMD_FIRST+1
#define PVRSRV_BRIDGE_RGXTQ_RGXSUBMITTRANSFER PVRSRV_BRIDGE_RGXTQ_CMD_FIRST+2
#define PVRSRV_BRIDGE_RGXTQ_RGXSETTRANSFERCONTEXTPRIORITY PVRSRV_BRIDGE_RGXTQ_CMD_FIRST+3
#define PVRSRV_BRIDGE_RGXTQ_RGXKICKSYNCTRANSFER PVRSRV_BRIDGE_RGXTQ_CMD_FIRST+4
#define PVRSRV_BRIDGE_RGXTQ_CMD_LAST (PVRSRV_BRIDGE_RGXTQ_CMD_FIRST+4)
/*******************************************
RGXCreateTransferContext
*******************************************/
/* Bridge in structure for RGXCreateTransferContext */
typedef struct PVRSRV_BRIDGE_IN_RGXCREATETRANSFERCONTEXT_TAG
{
IMG_HANDLE hDevNode;
IMG_UINT32 ui32Priority;
IMG_DEV_VIRTADDR sMCUFenceAddr;
IMG_UINT32 ui32FrameworkCmdize;
IMG_BYTE * psFrameworkCmd;
IMG_HANDLE hPrivData;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXCREATETRANSFERCONTEXT;
/* Bridge out structure for RGXCreateTransferContext */
typedef struct PVRSRV_BRIDGE_OUT_RGXCREATETRANSFERCONTEXT_TAG
{
IMG_HANDLE hTransferContext;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXCREATETRANSFERCONTEXT;
/*******************************************
RGXDestroyTransferContext
*******************************************/
/* Bridge in structure for RGXDestroyTransferContext */
typedef struct PVRSRV_BRIDGE_IN_RGXDESTROYTRANSFERCONTEXT_TAG
{
IMG_HANDLE hTransferContext;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXDESTROYTRANSFERCONTEXT;
/* Bridge out structure for RGXDestroyTransferContext */
typedef struct PVRSRV_BRIDGE_OUT_RGXDESTROYTRANSFERCONTEXT_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXDESTROYTRANSFERCONTEXT;
/*******************************************
RGXSubmitTransfer
*******************************************/
/* Bridge in structure for RGXSubmitTransfer */
typedef struct PVRSRV_BRIDGE_IN_RGXSUBMITTRANSFER_TAG
{
IMG_HANDLE hTransferContext;
IMG_UINT32 ui32PrepareCount;
IMG_UINT32 * pui32ClientFenceCount;
IMG_HANDLE* * phFenceUFOSyncPrimBlock;
IMG_UINT32* * pui32FenceSyncOffset;
IMG_UINT32* * pui32FenceValue;
IMG_UINT32 * pui32ClientUpdateCount;
IMG_HANDLE* * phUpdateUFOSyncPrimBlock;
IMG_UINT32* * pui32UpdateSyncOffset;
IMG_UINT32* * pui32UpdateValue;
IMG_UINT32 * pui32ServerSyncCount;
IMG_UINT32* * pui32ServerSyncFlags;
IMG_HANDLE* * phServerSync;
IMG_UINT32 ui32NumCheckFenceFDs;
IMG_INT32 * pi32CheckFenceFDs;
IMG_INT32 i32UpdateFenceFD;
IMG_UINT32 * pui32CommandSize;
IMG_UINT8* * pui8FWCommand;
IMG_UINT32 * pui32TQPrepareFlags;
IMG_UINT32 ui32ExternalJobReference;
IMG_UINT32 ui32InternalJobReference;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXSUBMITTRANSFER;
/* Bridge out structure for RGXSubmitTransfer */
typedef struct PVRSRV_BRIDGE_OUT_RGXSUBMITTRANSFER_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXSUBMITTRANSFER;
/*******************************************
RGXSetTransferContextPriority
*******************************************/
/* Bridge in structure for RGXSetTransferContextPriority */
typedef struct PVRSRV_BRIDGE_IN_RGXSETTRANSFERCONTEXTPRIORITY_TAG
{
IMG_HANDLE hTransferContext;
IMG_UINT32 ui32Priority;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXSETTRANSFERCONTEXTPRIORITY;
/* Bridge out structure for RGXSetTransferContextPriority */
typedef struct PVRSRV_BRIDGE_OUT_RGXSETTRANSFERCONTEXTPRIORITY_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXSETTRANSFERCONTEXTPRIORITY;
/*******************************************
RGXKickSyncTransfer
*******************************************/
/* Bridge in structure for RGXKickSyncTransfer */
typedef struct PVRSRV_BRIDGE_IN_RGXKICKSYNCTRANSFER_TAG
{
IMG_HANDLE hTransferContext;
IMG_UINT32 ui32ClientFenceCount;
IMG_HANDLE * phClientFenceUFOSyncPrimBlock;
IMG_UINT32 * pui32ClientFenceSyncOffset;
IMG_UINT32 * pui32ClientFenceValue;
IMG_UINT32 ui32ClientUpdateCount;
IMG_HANDLE * phClientUpdateUFOSyncPrimBlock;
IMG_UINT32 * pui32ClientUpdateSyncOffset;
IMG_UINT32 * pui32ClientUpdateValue;
IMG_UINT32 ui32ServerSyncCount;
IMG_UINT32 * pui32ServerSyncFlags;
IMG_HANDLE * phServerSyncs;
IMG_UINT32 ui32NumCheckFenceFDs;
IMG_INT32 * pi32CheckFenceFDs;
IMG_INT32 i32UpdateFenceFD;
IMG_UINT32 ui32TQPrepareFlags;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXKICKSYNCTRANSFER;
/* Bridge out structure for RGXKickSyncTransfer */
typedef struct PVRSRV_BRIDGE_OUT_RGXKICKSYNCTRANSFER_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXKICKSYNCTRANSFER;
#endif /* COMMON_RGXTQ_BRIDGE_H */

Some files were not shown because too many files have changed in this diff Show More