gpu: remove unused rogue driver

Change-Id: I067a96e88b4a389470b12446dea573134b835018
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
This commit is contained in:
Tao Huang
2021-04-13 18:36:53 +08:00
parent 78f9ac0daa
commit b72885a1c1
456 changed files with 0 additions and 168936 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,9 +0,0 @@
# SPDX-License-Identifier: GPL-2.0
config POWERVR_ROGUE
tristate "PowerVR Rogue"
default n
help
Driver for PowerVR Rogue hardware.
Say Y here if your SoC contains a PowerVR Rogue GPU. For more
information, see <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,250 +0,0 @@
# SPDX-License-Identifier: GPL-2.0
include drivers/gpu/rogue/config_kernel.mk
obj-$(CONFIG_POWERVR_ROGUE) += pvrsrvkm.o
ccflags-y += -include drivers/gpu/rogue/config_kernel.h \
-Idrivers/gpu/rogue \
-Idrivers/gpu/rogue/hwdefs \
-Idrivers/gpu/rogue/hwdefs/km \
-Idrivers/gpu/rogue/system/include \
-Idrivers/gpu/rogue/system/common \
-Idrivers/gpu/rogue/system/$(PVR_SYSTEM) \
-Idrivers/gpu/rogue/services/server/include \
-Idrivers/gpu/rogue/include \
-Idrivers/gpu/rogue/services/include \
-Idrivers/gpu/rogue/services/include/shared \
-Idrivers/gpu/rogue/services/shared/include \
-Idrivers/gpu/rogue/services/shared/devices/rgx \
-Idrivers/gpu/rogue/services/server/env/linux \
-Idrivers/gpu/rogue/kernel/drivers/staging/imgtec \
-Idrivers/gpu/rogue/services/include/env/linux \
-Idrivers/gpu/rogue/services/server/devices/rgx
tmp := $(addprefix -I,$(wildcard drivers/gpu/rogue/generated/*))
ccflags-y += $(tmp)
########
pvrsrvkm-y += \
services/server/env/linux/event.o \
services/server/env/linux/mm.o \
services/server/env/linux/mmap.o \
services/server/env/linux/module.o \
services/server/env/linux/devicemem_mmap_stub.o \
services/server/env/linux/osfunc.o \
services/server/env/linux/allocmem.o \
services/server/env/linux/osconnection_server.o \
services/server/env/linux/pdump.o \
services/server/env/linux/physmem_osmem_linux.o \
services/server/env/linux/pvr_debugfs.o \
services/server/env/linux/pvr_bridge_k.o \
services/server/env/linux/pvr_debug.o \
services/server/env/linux/physmem_tdmetacode_linux.o \
services/server/env/linux/physmem_tdsecbuf_linux.o \
services/server/common/devicemem_heapcfg.o \
services/shared/common/devicemem.o \
services/shared/common/devicemem_utils.o \
services/shared/common/hash.o \
services/shared/common/ra.o \
services/shared/common/sync.o \
services/shared/common/dllist.o \
services/server/common/devicemem_server.o \
services/server/common/handle.o \
services/server/common/lists.o \
services/server/common/mmu_common.o \
services/server/common/connection_server.o \
services/server/common/physheap.o \
services/server/common/physmem.o \
services/server/common/physmem_lma.o \
services/server/common/pmr.o \
services/server/common/power.o \
services/server/common/process_stats.o \
services/server/common/pvrsrv.o \
services/server/common/resman.o \
services/server/common/srvcore.o \
services/server/common/sync_server.o \
services/server/common/tlintern.o \
services/shared/common/tlclient.o \
services/server/common/tlserver.o \
services/server/common/tlstream.o \
services/server/common/tutils.o \
services/shared/common/uniq_key_splay_tree.o \
services/server/devices/rgx/rgxsync.o
ifeq ($(SUPPORT_DISPLAY_CLASS),1)
pvrsrvkm-y += \
services/server/common/dc_server.o \
services/server/common/scp.o
endif
ifeq ($(PVR_RI_DEBUG),1)
pvrsrvkm-y += services/server/common/ri_server.o
endif
ifeq ($(PVR_HANDLE_BACKEND),generic)
pvrsrvkm-y += services/server/common/handle_generic.o
else
ifeq ($(PVR_HANDLE_BACKEND),idr)
pvrsrvkm-y += handle_idr.o
endif
endif
ifeq ($(SUPPORT_GPUTRACE_EVENTS),1)
pvrsrvkm-y += services/server/env/linux/pvr_gputrace.o
endif
pvrsrvkm-$(CONFIG_X86) += services/server/env/linux/osfunc_x86.o
pvrsrvkm-$(CONFIG_ARM) += services/server/env/linux/osfunc_arm.o
pvrsrvkm-$(CONFIG_ARM64) += services/server/env/linux/osfunc_arm64.o
pvrsrvkm-$(CONFIG_METAG) += osfunc_metag.o
pvrsrvkm-$(CONFIG_MIPS) += osfunc_mips.o
pvrsrvkm-$(CONFIG_EVENT_TRACING) += services/server/env/linux/trace_events.o
ifeq ($(PDUMP),1)
pvrsrvkm-y += \
services/server/common/pdump_common.o \
services/server/common/pdump_mmu.o \
services/server/common/pdump_physmem.o \
services/shared/common/devicemem_pdump.o
endif
pvrsrvkm-y += \
services/server/devices/rgx/rgxinit.o \
services/server/devices/rgx/rgxdebug.o \
services/server/devices/rgx/rgxhwperf.o \
services/server/devices/rgx/rgxmem.o \
services/server/devices/rgx/rgxta3d.o \
services/server/devices/rgx/rgxcompute.o \
services/server/devices/rgx/rgxccb.o \
services/server/devices/rgx/rgxmmuinit.o \
services/server/devices/rgx/rgxpower.o \
services/server/devices/rgx/rgxtransfer.o \
services/server/devices/rgx/rgxutils.o \
services/server/devices/rgx/rgxfwutils.o \
services/server/devices/rgx/rgxbreakpoint.o \
services/server/devices/rgx/debugmisc_server.o \
services/shared/devices/rgx/rgx_compat_bvnc.o \
services/server/devices/rgx/rgxregconfig.o \
services/server/devices/rgx/rgxtimerquery.o
ifeq ($(SUPPORT_RAY_TRACING),1)
pvrsrvkm-y += rgxray.o
endif
ifeq ($(PDUMP),1)
pvrsrvkm-y += services/server/devices/rgx/rgxpdump.o
endif
ifeq ($(PVR_ANDROID_NATIVE_WINDOW_HAS_SYNC),1)
pvrsrvkm-y += \
kernel/drivers/staging/imgtec/pvr_sync.o
endif
pvrsrvkm-y += \
generated/mm_bridge/server_mm_bridge.o \
generated/dmm_bridge/client_mm_bridge.o \
generated/pdumpmm_bridge/server_pdumpmm_bridge.o \
generated/dpdumpmm_bridge/client_pdumpmm_bridge.o \
generated/cmm_bridge/server_cmm_bridge.o \
generated/pdumpcmm_bridge/server_pdumpcmm_bridge.o \
generated/pdump_bridge/server_pdump_bridge.o \
generated/rgxtq_bridge/server_rgxtq_bridge.o \
generated/rgxinit_bridge/server_rgxinit_bridge.o \
generated/rgxta3d_bridge/server_rgxta3d_bridge.o \
generated/rgxcmp_bridge/server_rgxcmp_bridge.o \
generated/srvcore_bridge/server_srvcore_bridge.o \
generated/sync_bridge/server_sync_bridge.o \
generated/dsync_bridge/client_sync_bridge.o \
generated/breakpoint_bridge/server_breakpoint_bridge.o \
generated/debugmisc_bridge/server_debugmisc_bridge.o \
generated/rgxpdump_bridge/server_rgxpdump_bridge.o \
generated/pvrtl_bridge/server_pvrtl_bridge.o \
generated/dpvrtl_bridge/client_pvrtl_bridge.o \
generated/rgxhwperf_bridge/server_rgxhwperf_bridge.o \
generated/regconfig_bridge/server_regconfig_bridge.o \
generated/timerquery_bridge/server_timerquery_bridge.o
ifeq ($(PVR_RI_DEBUG),1)
pvrsrvkm-y += \
generated/ri_bridge/server_ri_bridge.o \
generated/dri_bridge/client_ri_bridge.o
endif
ifeq ($(SUPPORT_DISPLAY_CLASS),1)
pvrsrvkm-y += \
generated/dc_bridge/server_dc_bridge.o
endif
ifeq ($(SUPPORT_RAY_TRACING),1)
pvrsrvkm-y += generated/rgxray_bridge/server_rgxray_bridge.o
endif
ifeq ($(CACHEFLUSH_TYPE),CACHEFLUSH_GENERIC)
pvrsrvkm-y += \
services/server/common/cache_generic.o \
generated/cachegeneric_bridge/server_cachegeneric_bridge.o
endif
ifeq ($(SUPPORT_SECURE_EXPORT),1)
pvrsrvkm-y += \
services/server/env/linux/ossecure_export.o \
generated/smm_bridge/server_smm_bridge.o \
generated/syncsexport_bridge/server_syncsexport_bridge.o
endif
ifeq ($(SUPPORT_INSECURE_EXPORT),1)
pvrsrvkm-y += \
generated/syncexport_bridge/server_syncexport_bridge.o
endif
ifeq ($(SUPPORT_ION),1)
pvrsrvkm-y += generated/dmabuf_bridge/server_dmabuf_bridge.o
pvrsrvkm-y += services/server/env/linux/physmem_dmabuf.o
endif # SUPPORT_ION
#ccflags-y += \
# -mno-soft-float
#dc_pdp-y += \
# dc_pdp/dc_pdp.o \
# dc_pdp/pdp_osfuncs.o \
# dc_osfuncs.o
pvrsrvkm-y += \
system/$(PVR_SYSTEM)/sysconfig.o
# system/common/pci_support.o
ifeq ($(PVR_SYSTEM),rgx_tc)
pvrsrvkm-y += system/$(PVR_SYSTEM)/apollo_flasher_linux.o
endif
ifeq ($(PVR_SYSTEM),rk3368)
pvrsrvkm-y += system/$(PVR_SYSTEM)/rk_init.o
endif
#ifneq ($(SUPPORT_DRM),1)
#pvrsrvkm-y += system/common/interrupt_support.o
#endif
ifeq ($(SUPPORT_ION),1)
ifeq ($(LMA),1)
# For LMA, use the TC-specific ion heap.
pvrsrvkm-y += \
system/$(PVR_SYSTEM)/ion_support.o \
system/common/ion_lma_heap.o
else
# For UMA, use the generic ion support code, which creates heaps from system
# memory.
#pvrsrvkm-y += \
# system/common/ion_support_generic.o
endif # LMA
endif # SUPPORT_ION
dbgdrv-y += \
tools/services/debug/dbgdriv/common/dbgdriv.o \
tools/services/debug/dbgdriv/common/ioctl.o \
tools/services/debug/dbgdriv/common/handle.o \
tools/services/debug/dbgdriv/linux/main.o \
tools/services/debug/dbgdriv/linux/hostfunc.o

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,279 +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)
TESTED_HOST_USER_FLAGS += \
$(call host-cc-optional-warning,-Wunused-but-set-variable)
KBUILD_FLAGS := \
-Wno-unused-parameter -Wno-sign-compare
TESTED_KBUILD_FLAGS := \
$(call kernel-cc-option,-Wmissing-include-dirs) \
$(call kernel-cc-option,-Wno-type-limits) \
$(call kernel-cc-option,-Wno-pointer-arith) \
$(call kernel-cc-option,-Wno-aggregate-return) \
$(call kernel-cc-option,-Wno-unused-but-set-variable) \
$(call kernel-cc-optional-warning,-Wbad-function-cast) \
$(call kernel-cc-optional-warning,-Wcast-qual) \
$(call kernel-cc-optional-warning,-Wcast-align) \
$(call kernel-cc-optional-warning,-Wconversion) \
$(call kernel-cc-optional-warning,-Wdisabled-optimization) \
$(call kernel-cc-optional-warning,-Wlogical-op) \
$(call kernel-cc-optional-warning,-Wmissing-declarations) \
$(call kernel-cc-optional-warning,-Wmissing-include-dirs) \
$(call kernel-cc-optional-warning,-Wnested-externs) \
$(call kernel-cc-optional-warning,-Wno-missing-field-initializers) \
$(call kernel-cc-optional-warning,-Wold-style-definition) \
$(call kernel-cc-optional-warning,-Woverlength-strings) \
$(call kernel-cc-optional-warning,-Wpacked) \
$(call kernel-cc-optional-warning,-Wpacked-bitfield-compat) \
$(call kernel-cc-optional-warning,-Wpadded) \
$(call kernel-cc-optional-warning,-Wredundant-decls) \
$(call kernel-cc-optional-warning,-Wshadow) \
$(call kernel-cc-optional-warning,-Wswitch-default) \
$(call kernel-cc-optional-warning,-Wvla) \
$(call kernel-cc-optional-warning,-Wwrite-strings)
# User C only
#
ALL_CFLAGS := \
$(COMMON_USER_FLAGS) $(COMMON_CFLAGS) $(TESTED_TARGET_USER_FLAGS) \
$(SYS_CFLAGS)
ALL_HOST_CFLAGS := \
$(COMMON_USER_FLAGS) $(COMMON_CFLAGS) $(TESTED_HOST_USER_FLAGS)
# User C++ only
#
ALL_CXXFLAGS := \
-fno-rtti -fno-exceptions \
$(COMMON_USER_FLAGS) $(COMMON_FLAGS) $(TESTED_TARGET_USER_FLAGS) \
$(SYS_CXXFLAGS)
ALL_HOST_CXXFLAGS := \
-fno-rtti -fno-exceptions \
$(COMMON_USER_FLAGS) $(COMMON_FLAGS) $(TESTED_HOST_USER_FLAGS)
# Workaround for some target clangs that don't support -O0 w/ PIC.
#
ifeq ($(cc-is-clang),true)
ALL_CFLAGS := $(patsubst -O0,-O1,$(ALL_CFLAGS))
ALL_CXXFLAGS := $(patsubst -O0,-O1,$(ALL_CXXFLAGS))
endif
# Add GCOV_DIR just for target
#
ifeq ($(GCOV_BUILD),on)
ifneq ($(GCOV_DIR),)
ALL_CFLAGS += -fprofile-dir=$(GCOV_DIR)
ALL_CXXFLAGS += -fprofile-dir=$(GCOV_DIR)
endif
endif
# Kernel C only
#
ALL_KBUILD_CFLAGS := $(COMMON_CFLAGS) $(KBUILD_FLAGS) $(TESTED_KBUILD_FLAGS)
# User C and C++
#
# NOTE: ALL_HOST_LDFLAGS should probably be using -rpath-link too, and if we
# ever need to support building host shared libraries, it's required.
#
# We can't use it right now because we want to support non-GNU-compatible
# linkers like the Darwin 'ld' which doesn't support -rpath-link.
#
# For the same reason (Darwin 'ld') don't bother checking for text
# relocations in host binaries.
#
ALL_HOST_LDFLAGS :=
ALL_LDFLAGS := -Wl,--warn-shared-textrel
ifeq ($(GCOV_BUILD),on)
ALL_LDFLAGS += -fprofile-arcs
ALL_HOST_LDFLAGS += -fprofile-arcs
endif
ALL_LDFLAGS += $(SYS_LDFLAGS)
# This variable contains a list of all modules built by kbuild
ALL_KBUILD_MODULES :=
# This variable contains a list of all modules which contain C++ source files
ALL_CXX_MODULES :=
# Toolchain triple for cross environment
CROSS_TRIPLE := $(patsubst %-,%,$(CROSS_COMPILE))
ifneq ($(TOOLCHAIN),)
$(warning **********************************************)
$(warning The TOOLCHAIN option has been removed, but)
$(warning you have it set (via $(origin TOOLCHAIN)))
$(warning **********************************************)
endif
# We need the glibc version to generate the cache names for LLVM and XOrg components.
ifeq ($(CROSS_COMPILE),)
LIBC_VERSION_PROBE := $(shell ldd $(shell which true) | awk '/libc.so/{print $$3'} )
LIBC_VERSION := $(shell $(LIBC_VERSION_PROBE)| tr -d '(),' | head -1)
endif

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,98 +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,))
endif
ifeq ($(DISPLAY_CONTROLLER),dc_fbdev)
$(eval $(call TunableKernelConfigC,DC_FBDEV_REFRESH,))
$(eval $(call TunableKernelConfigC,DC_FBDEV_FORCE_XRGB8888,,\
Force the dc_fbdev display driver to use XRGB8888. This is necessary_\
when the underlying Linux framebuffer driver does not ignore alpha_\
meaning an alpha value of 0 results in nothing being displayed._\
))
$(eval $(call TunableKernelConfigC,DC_FBDEV_NUM_PREFERRED_BUFFERS,,\
The maximum number of display buffers the dc_fbdev display driver_\
supports. The underlying Linux framebuffer driver must be capable_\
of allocating sufficient memory for the number of buffers chosen._\
))
endif
ifeq ($(DISPLAY_CONTROLLER),dc_pdp)
$(eval $(call TunableKernelConfigC,DCPDP_WIDTH,))
$(eval $(call TunableKernelConfigC,DCPDP_HEIGHT,))
$(eval $(call TunableKernelConfigC,DCPDP_DPI,))
$(eval $(call TunableKernelConfigC,DCPDP_DYNAMIC_GTF_TIMING,1))
$(eval $(call TunableKernelConfigC,DCPDP_NO_INTERRUPTS,))
endif
ifeq ($(DISPLAY_CONTROLLER),adf_pdp)
$(eval $(call TunableKernelConfigC,ADF_PDP_WIDTH,))
$(eval $(call TunableKernelConfigC,ADF_PDP_HEIGHT,))
endif
########################################################################### ###
# DRM display drivers
########################################################################### ###
ifeq ($(DISPLAY_CONTROLLER),dc_drmfbdev)
$(eval $(call TunableKernelConfigC,DC_FBDEV_FORCE_XRGB8888,,\
Force the dc_fbdev display driver to use XRGB8888. This is necessary_\
when the underlying Linux framebuffer driver does not ignore alpha_\
meaning an alpha value of 0 results in nothing being displayed._\
))
$(eval $(call TunableKernelConfigC,DC_FBDEV_NUM_PREFERRED_BUFFERS,,\
The maximum number of display buffers the dc_fbdev display driver_\
supports. The underlying Linux framebuffer driver must be capable_\
of allocating sufficient memory for the number of buffers chosen._\
))
endif

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.
### ###########################################################################
include ../common/android/platform_version.mk
# Now we have included the platform_version.mk file, we know we have a
# correctly configured OUT_DIR and can probe it to figure out our
# architecture. For backwards compatibility with KitKat, use the deprecated
# ro.product.cpu.abi (primary architecture) property instead of abilist64.
$(eval $(subst #,$(newline),$(shell cat $(BUILD_PROP) | \
grep '^ro.product.cpu.abi=\|^ro.product.cpu.abilist32=' | \
sed -e 's,ro.product.cpu.abi=,JNI_CPU_ABI=,' \
-e 's,ro.product.cpu.abilist32=,JNI_CPU_ABI_2ND=,' | \
tr ',' ' ' | tr '\n' '#')))
# If ARCH is set, use that to remap to an "Android" ARCH..
ANDROID_ARCH := $(filter arm arm64 mips mips64 x86 x86_64,$(ARCH))
# x86 is special and has another legacy ARCH name which is remapped
ifeq ($(ARCH),i386)
ANDROID_ARCH := x86
endif
ifeq ($(ANDROID_ARCH),)
# ..otherwise, try to use the ABI list to figure it out.
ifneq ($(filter armeabi-v7a armeabi,$(JNI_CPU_ABI)),)
ANDROID_ARCH=arm
else ifneq ($(filter arm64-v8a,$(JNI_CPU_ABI)),)
ANDROID_ARCH=arm64
else ifneq ($(filter mips,$(JNI_CPU_ABI)),)
ANDROID_ARCH=mips
else ifneq ($(filter mips64,$(JNI_CPU_ABI)),)
ANDROID_ARCH=mips64
else ifneq ($(filter x86,$(JNI_CPU_ABI)),)
ANDROID_ARCH=x86
else ifneq ($(filter x86_64,$(JNI_CPU_ABI)),)
ANDROID_ARCH=x86_64
else
$(error ARCH not set and JNI_CPU_ABI=$(JNI_CPU_ABI) was not remappable)
endif
endif
JNI_CPU_ABI := $(word 1,$(JNI_CPU_ABI))
JNI_CPU_ABI_2ND := $(word 1,$(JNI_CPU_ABI_2ND))
include ../common/android/arch_common.mk
ifneq ($(filter arm arm64 mips mips64,$(ANDROID_ARCH)),)
LDM_PLATFORM ?= 1
endif
ifneq ($(filter x86 x86_64,$(ANDROID_ARCH)),)
KERNEL_CROSS_COMPILE ?= undef
endif
ifneq ($(filter arm64 mips64 x86_64,$(ANDROID_ARCH)),)
ifeq ($(MULTIARCH),)
$(warning *** 64-bit architecture detected. Enabling MULTIARCH=1.)
$(warning *** If you want a 64-bit only build, use MULTIARCH=64only.)
export MULTIARCH := 1
endif
endif

View File

@@ -1,77 +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)/external/openssl/include \
-isystem $(ANDROID_ROOT)/frameworks/base/include \
-isystem $(ANDROID_ROOT)/hardware/libhardware/include \
-isystem $(ANDROID_ROOT)/system/core/include \
-isystem $(ANDROID_ROOT)/system/core/adf/libadf/include \
-isystem $(ANDROID_ROOT)/system/core/adf/libadfhwc/include \
-isystem $(ANDROID_ROOT)/system/core/libsync/include \
-isystem $(ANDROID_ROOT)/system/core/libsync \
-isystem $(ANDROID_ROOT)/system/media/camera/include
# Obsolete libc includes
SYS_INCLUDES += \
-isystem $(ANDROID_ROOT)/bionic/libc/kernel/common \
-isystem $(ANDROID_ROOT)/bionic/libc/kernel/arch-$(ANDROID_ARCH)
# The following include is a workaround for ICS 4.0.4 partial directory change
SYS_INCLUDES += \
-isystem $(ANDROID_ROOT)/frameworks/base/native/include \
-isystem $(ANDROID_ROOT)/frameworks/native/include
ifeq ($(_CLANG),true)
SYS_INCLUDES := \
-nostdinc $(SYS_INCLUDES) \
-isystem $(ANDROID_ROOT)/external/clang/lib/Headers
endif
OPTIM := -O2

View File

@@ -1,69 +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,))
$(eval $(call UserConfigMake,TARGET_ROOT,$(TARGET_ROOT)))
$(eval $(call UserConfigMake,TARGET_DEVICE,$(TARGET_DEVICE)))
$(eval $(call BothConfigMake,SUPPORT_ANDROID_PLATFORM,1))
$(eval $(call BothConfigC,ANDROID,))
$(eval $(call UserConfigC,SUPPORT_ANDROID_PLATFORM,1))
# These are set automatically according to the platform version.
$(eval $(call TunableBothConfigC,PVR_ANDROID_NATIVE_WINDOW_HAS_SYNC,))
$(eval $(call TunableBothConfigC,PVR_ANDROID_DISABLE_MULTI_SYNCS,))
# These are user-tunable.
$(eval $(call TunableBothConfigC,PVR_ANDROID_HAS_SW_INCOMPATIBLE_FRAMEBUFFER,,\
Enable this to support running Android$(apos)s software GLES renderer_\
with gralloc from the DDK._\
))
# These are set automatically according to the platform version.
$(eval $(call TunableBothConfigMake,PVR_ANDROID_NATIVE_WINDOW_HAS_SYNC,))
# These are user-tunable.

View File

@@ -1,230 +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
# It is no longer supported disable this for Android, but we can still
# do so for the Linux DDK, so don't use NonTunableOption.
#
override SUPPORT_ION := 1
# Show GPU activity in systrace
#
SUPPORT_GPUTRACE_EVENTS ?= 1
##############################################################################
# Unless overridden by the user, assume the RenderScript Compute API level
# matches that of the SDK API_LEVEL.
#
RSC_API_LEVEL ?= $(API_LEVEL)
ifeq ($(RSC_API_LEVEL),21)
RSC_API_LEVEL := 20
endif
##############################################################################
# JB MR1 introduces cross-process syncs associated with a fd.
# This requires a new enough kernel version to have the base/sync driver.
#
#zxl:Temporarily closed for user build mode(Depend on libgui: LOCAL_CFLAGS += -DDONT_USE_FENCE_SYNC)
EGL_EXTENSION_ANDROID_NATIVE_FENCE_SYNC ?= 1
PVR_ANDROID_NATIVE_WINDOW_HAS_SYNC ?= 1
##############################################################################
# Handle various platform includes for unittests
#
SYS_INCLUDES += \
-isystem $(ANDROID_ROOT)/libnativehelper/include/nativehelper
SYS_KHRONOS_INCLUDES += \
-I$(ANDROID_ROOT)/frameworks/native/opengl/include
##############################################################################
# Android doesn't use these install script variables. They're still in place
# because the Linux install scripts use them.
#
SHLIB_DESTDIR := not-used
EGL_DESTDIR := not-used
# Must give our EGL/GLES libraries a globally unique name
#
EGL_BASENAME_SUFFIX := _POWERVR_ROGUE
# Use stlport instead of libstdc++ for STL compatibility
#
SYS_CXXFLAGS := -fuse-cxa-atexit $(SYS_CFLAGS)
SYS_INCLUDES += \
-isystem $(ANDROID_ROOT)/bionic \
-isystem $(ANDROID_ROOT)/external/stlport/stlport
##############################################################################
# ICS requires that at least one driver EGLConfig advertises the
# EGL_RECORDABLE_ANDROID attribute. The platform requires that surfaces
# rendered with this config can be consumed by an OMX video encoder.
#
EGL_EXTENSION_ANDROID_RECORDABLE := 1
##############################################################################
# ICS added the EGL_ANDROID_blob_cache extension. Enable support for this
# extension in EGL/GLESv2.
#
EGL_EXTENSION_ANDROID_BLOB_CACHE ?= 1
##############################################################################
# Framebuffer target extension is used to find configs compatible with
# the framebuffer
#
EGL_EXTENSION_ANDROID_FRAMEBUFFER_TARGET := 1
##############################################################################
# Disable the MEMINFO wrapper pvCpuVirtAddr feature. All Android DDK
# components no longer require it. This enables lazy CPU mappings, which
# improves allocation performance.
#
ifneq ($(PDUMP),1)
PVRSRV_NO_MEMINFO_CPU_VIRT_ADDR ?= 1
endif
##############################################################################
# JB added a new corkscrew API for userland backtracing.
#
ifeq ($(is_at_least_lollipop),0)
PVR_ANDROID_HAS_CORKSCREW_API := 1
endif
##############################################################################
# This is currently broken on KK. Disable until fixed.
#
SUPPORT_ANDROID_APPHINTS := 0
##############################################################################
# KitKat added very provisional/early support for sRGB render targets
#
# (Leaving this optional until the framework makes it mandatory.)
#
PVR_ANDROID_HAS_HAL_PIXEL_FORMAT_sRGB ?= 1
##############################################################################
# Switch on ADF support for KitKat MR1 or newer.
#
# Customers using AOSP KitKat MR1 sources need to copy and build the libadf
# and libadfhwc libraries from AOSP master system/core into their device/
# directories and build the components as dynamic libraries. Examples of how
# to do this are shown in the bundled 'pc_android' and 'generic_arm_android'
# directories in the device package.
#
# Customers using AOSP master do not need to make any changes.
# ADF requires kernel/common derivative kernels >= 3.10.
#
ifeq ($(is_at_least_kitkat_mr1),1)
#SUPPORT_ADF ?= 1
#SUPPORT_DC ?= 1
endif
##############################################################################
# Versions of Android between Cupcake and KitKat MR1 required Java 6.
#
ifeq ($(is_at_least_lollipop),0)
LEGACY_USE_JAVA6 ?= 1
endif
##############################################################################
# Versions of Android between ICS and KitKat MR1 used ion .heap_mask instead
# of .heap_id_mask.
#
ifeq ($(is_at_least_lollipop),0)
PVR_ANDROID_HAS_ION_FIELD_HEAP_MASK := 1
endif
##############################################################################
# Lollipop supports 64-bit. Configure BCC to emit both 32-bit and 64-bit LLVM
# bitcode in the renderscript driver.
#
ifeq ($(is_at_least_lollipop),1)
PVR_ANDROID_BCC_MULTIARCH_SUPPORT := 1
endif
##############################################################################
# Lollipop annotates the cursor allocation with USAGE_CURSOR to enable it to
# be accelerated with special cursor hardware (rather than wasting an
# overlay). This flag stops the DDK from blocking the allocation.
#
ifeq ($(is_at_least_lollipop),1)
PVR_ANDROID_HAS_GRALLOC_USAGE_CURSOR := 1
endif
##############################################################################
# Lollipop changed the camera HAL metadata specification to require that
# CONTROL_MAX_REGIONS specifies 3 integers (instead of 1).
#
ifeq ($(is_at_least_lollipop),1)
PVR_ANDROID_CAMERA_CONTROL_MAX_REGIONS_HAS_THREE := 1
endif
# Placeholder for future version handling
#
ifeq ($(is_future_version),1)
-include ../common/android/future_version.mk
endif

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,178 +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.
#
ifeq ($(call release-starts-with,JellyBeanMR1),1)
PLATFORM_RELEASE := 4.2
else ifeq ($(call release-starts-with,JellyBeanMR),1)
PLATFORM_RELEASE := 4.3
else ifeq ($(call release-starts-with,JellyBean),1)
PLATFORM_RELEASE := 4.1
else ifeq ($(call release-starts-with,KeyLimePie),1)
PLATFORM_RELEASE := 4.4
else ifeq ($(call release-starts-with,KitKatMR),1)
PLATFORM_RELEASE := 4.4.1
else ifeq ($(call release-starts-with,KitKat),1)
PLATFORM_RELEASE := 4.4
else ifeq ($(call release-starts-with,Lollipop),1)
PLATFORM_RELEASE := 5.0
else ifeq ($(PLATFORM_CODENAME),AOSP)
# AOSP (master) will normally have PLATFORM_CODENAME set to AOSP
PLATFORM_RELEASE := 5.1
else ifeq ($(shell echo $(PLATFORM_RELEASE) | grep -qE "[A-Za-z]+"; echo $$?),0)
PLATFORM_RELEASE := 5.1
endif
PLATFORM_RELEASE_MAJ := $(shell echo $(PLATFORM_RELEASE) | cut -f1 -d'.')
PLATFORM_RELEASE_MIN := $(shell echo $(PLATFORM_RELEASE) | cut -f2 -d'.')
PLATFORM_RELEASE_PATCH := $(shell echo $(PLATFORM_RELEASE) | cut -f3 -d'.')
# Not all versions have a patchlevel; fix that up here
#
ifeq ($(PLATFORM_RELEASE_PATCH),)
PLATFORM_RELEASE_PATCH := 0
endif
# Macros to help categorize support for features and API_LEVEL for tests.
#
is_at_least_jellybean_mr1 := \
$(shell ( test $(PLATFORM_RELEASE_MAJ) -gt 4 || \
( test $(PLATFORM_RELEASE_MAJ) -eq 4 && \
test $(PLATFORM_RELEASE_MIN) -ge 2 ) ) && echo 1 || echo 0)
is_at_least_jellybean_mr2 := \
$(shell ( test $(PLATFORM_RELEASE_MAJ) -gt 4 || \
( test $(PLATFORM_RELEASE_MAJ) -eq 4 && \
test $(PLATFORM_RELEASE_MIN) -ge 3 ) ) && echo 1 || echo 0)
is_at_least_kitkat := \
$(shell ( test $(PLATFORM_RELEASE_MAJ) -gt 4 || \
( test $(PLATFORM_RELEASE_MAJ) -eq 4 && \
test $(PLATFORM_RELEASE_MIN) -ge 4 ) ) && echo 1 || echo 0)
is_at_least_kitkat_mr1 := \
$(shell ( test $(PLATFORM_RELEASE_MAJ) -gt 4 || \
( test $(PLATFORM_RELEASE_MAJ) -eq 4 && \
test $(PLATFORM_RELEASE_MIN) -gt 4 ) || \
( test $(PLATFORM_RELEASE_MAJ) -eq 4 && \
test $(PLATFORM_RELEASE_MIN) -eq 4 && \
test $(PLATFORM_RELEASE_PATCH) -ge 1 ) ) && echo 1 || echo 0)
is_at_least_lollipop := \
$(shell ( test $(PLATFORM_RELEASE_MAJ) -ge 5 ) && echo 1 || echo 0)
# Assume "future versions" are >=5.1, but we don't really know
is_future_version := \
$(shell ( test $(PLATFORM_RELEASE_MAJ) -gt 5 || \
( test $(PLATFORM_RELEASE_MAJ) -eq 5 && \
test $(PLATFORM_RELEASE_MIN) -gt 0 ) ) && echo 1 || echo 0)
# Sometimes a feature is introduced in AOSP master that isn't in the current
# future version, but both versions are beyond our support level. This variable
# can be used to differentiate those builds.
#
ifeq ($(PLATFORM_CODENAME)$(is_future_version),AOSP1)
is_aosp_master := 1
else
is_aosp_master := 0
endif
# Picking an exact match of API_LEVEL for the platform we're building
# against can avoid compatibility theming and affords better integration.
#
ifeq ($(is_future_version),1)
# Temporarily pin to 19 until it is actually bumped to 20
API_LEVEL := 19
else ifeq ($(is_at_least_lollipop),1)
API_LEVEL := 21
#API_LEVEL := 20 was l-preview
else ifeq ($(is_at_least_kitkat),1)
API_LEVEL := 19
else ifeq ($(is_at_least_jellybean_mr2),1)
API_LEVEL := 18
else ifeq ($(is_at_least_jellybean_mr1),1)
API_LEVEL := 17
else
$(error Must build against Android >= 4.2)
endif
# Each DDK is tested against only a single version of the platform.
# Warn if a different platform version is used.
#
ifeq ($(is_future_version),1)
$(info WARNING: Android version is newer than this DDK supports)
else ifneq ($(is_at_least_kitkat),1)
$(info WARNING: Android version is older than this DDK supports)
endif

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,62 +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 ($(PVR_SYSTEM),$(filter $(PVR_SYSTEM),rgx_tc rgx_tc_es2))
$(eval $(call TunableKernelConfigC,TC_MEMORY_CONFIG,$(TC_MEMORY_CONFIG),\
Selects the memory configuration to be used. The choices are:_\
* TC_MEMORY_LOCAL (Rogue and the display controller use local card memory)_\
* TC_MEMORY_HOST (Rogue and the display controller use system memory)_\
* TC_MEMORY_HYBRID (Rogue uses system memory and the display controller uses local card memory)))
endif
ifeq ($(PVR_SYSTEM), rgx_linux_apollo)
$(eval $(call BothConfigC,TC_MEMORY_CONFIG,TC_MEMORY_LOCAL))
$(call $(NonTunableOption,TC_MEMORY_CONFIG))
endif
ifeq ($(TC_MEMORY_CONFIG),TC_MEMORY_LOCAL)
LMA := 1
endif
$(eval $(call TunableBothConfigC,LMA,))
$(eval $(call TunableKernelConfigMake,LMA,))

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,769 +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),)
OUT ?= $(TOP)/binary_$(PVR_BUILD_DIR)_$(WINDOW_SYSTEM)_$(BUILD)
else
OUT ?= $(TOP)/binary_$(PVR_BUILD_DIR)_$(BUILD)
endif
override OUT := $(if $(filter /%,$(OUT)),$(OUT),$(TOP)/$(OUT))
CONFIG_MK := $(OUT)/config.mk
CONFIG_H := $(OUT)/config.h
CONFIG_KERNEL_MK := $(OUT)/config_kernel.mk
CONFIG_KERNEL_H := $(OUT)/config_kernel.h
# Convert commas to spaces in $(D). This is so you can say "make
# D=config-changes,freeze-config" and have $(filter config-changes,$(D))
# still work.
override D := $(subst $(comma),$(space),$(D))
# Create the OUT directory
#
$(shell mkdir -p $(OUT))
# Some targets don't need information about any modules. If we only specify
# these targets on the make command line, set INTERNAL_CLOBBER_ONLY to
# indicate that toplevel.mk shouldn't read any makefiles
CLOBBER_ONLY_TARGETS := clean clobber help install
INTERNAL_CLOBBER_ONLY :=
ifneq ($(strip $(MAKECMDGOALS)),)
INTERNAL_CLOBBER_ONLY := \
$(if \
$(strip $(foreach _cmdgoal,$(MAKECMDGOALS),\
$(if $(filter $(_cmdgoal),$(CLOBBER_ONLY_TARGETS)),,x))),,true)
endif
# For a clobber-only build, we shouldn't regenerate any config files
ifneq ($(INTERNAL_CLOBBER_ONLY),true)
-include ../config/user-defs.mk
#
# Core handling
# delete any previous intermediary files
$(shell \
for file in $(CONFIG_KERNEL_H).new $(CONFIG_KERNEL_MK).new ; do \
rm -f $$file; \
done)
ifeq ($(DONT_NEED_RGX_BVNC),)
# Extract the BNC config name
RGX_BNC_SPLIT := $(subst .,$(space) ,$(RGX_BVNC))
RGX_BNC := $(word 1,$(RGX_BNC_SPLIT)).V.$(word 3,$(RGX_BNC_SPLIT)).$(word 4,$(RGX_BNC_SPLIT))
# Check BVNC core version
ALL_KM_BVNCS := \
$(patsubst rgxcore_km_%.h,%,\
$(notdir $(shell ls $(TOP)/hwdefs/km/cores/rgxcore_km_*.h)))
ifeq ($(filter $(RGX_BVNC),$(ALL_KM_BVNCS)),)
$(error Error: Invalid Kernel core RGX_BVNC=$(RGX_BVNC). \
Valid Kernel core BVNCs: $(subst $(space),$(comma)$(space),$(ALL_KM_BVNCS)))
endif
# Check if BVNC core file exist
RGX_BVNC_CORE_KM := $(TOP)/hwdefs/km/cores/rgxcore_km_$(RGX_BVNC).h
RGX_BVNC_CORE_KM_HEADER := \"cores/rgxcore_km_$(RGX_BVNC).h\"
# "rgxcore_km_$(RGX_BVNC).h"
ifeq ($(wildcard $(RGX_BVNC_CORE_KM)),)
$(error The file $(RGX_BVNC_CORE_KM) does not exist. \
Valid BVNCs: $(ALL_KM_BVNCS))
endif
# Check BNC config version
ALL_KM_BNCS := \
$(patsubst rgxconfig_km_%.h,%,\
$(notdir $(shell ls $(TOP)/hwdefs/km/configs/rgxconfig_km_*.h)))
ifeq ($(filter $(RGX_BNC),$(ALL_KM_BNCS)),)
$(error Error: Invalid Kernel config RGX_BNC=$(RGX_BNC). \
Valid Kernel config BNCs: $(subst $(space),$(comma)$(space),$(ALL_KM_BNCS)))
endif
# Check if BNC config file exist
RGX_BNC_CONFIG_KM := $(TOP)/hwdefs/km/configs/rgxconfig_km_$(RGX_BNC).h
RGX_BNC_CONFIG_KM_HEADER := \"configs/rgxconfig_km_$(RGX_BNC).h\"
#"rgxcore_km_$(RGX_BNC).h"
ifeq ($(wildcard $(RGX_BNC_CONFIG_KM)),)
$(error The file $(RGX_BNC_CONFIG_KM) does not exist. \
Valid BNCs: $(ALL_KM_BNCS))
endif
endif
# Enforced dependencies. Move this to an include.
#
SUPPORT_LINUX_USING_WORKQUEUES ?= 1
ifeq ($(SUPPORT_LINUX_USING_WORKQUEUES),1)
override PVR_LINUX_USING_WORKQUEUES := 1
override PVR_LINUX_MISR_USING_PRIVATE_WORKQUEUE := 1
override PVR_LINUX_TIMERS_USING_WORKQUEUES := 1
else ifeq ($(SUPPORT_LINUX_USING_SHARED_WORKQUEUES),1)
override PVR_LINUX_USING_WORKQUEUES := 1
override PVR_LINUX_MISR_USING_WORKQUEUE := 1
override PVR_LINUX_TIMERS_USING_SHARED_WORKQUEUE := 1
endif
ifeq ($(NO_HARDWARE),1)
override SYS_USING_INTERRUPTS := 0
endif
# Rather than requiring the user to have to define two variables (one quoted,
# one not), make PVRSRV_MODNAME a non-tunable and give it an overridable
# default here.
#
PVRSRV_MODNAME ?= pvrsrvkm
MAX_POOL_PAGES ?= 10240
# Normally builds don't touch these, but we use them to influence the
# components list. Make sure these are defined early enough to make this
# possible.
#
ifeq ($(SUPPORT_DRM),1)
SUPPORT_DISPLAY_CLASS := 0
else
ifeq ($(SUPPORT_ADF),1)
SUPPORT_DISPLAY_CLASS := 0
else
ifeq ($(SUPPORT_DC),1)
SUPPORT_DISPLAY_CLASS ?= 1
else
endif
endif
endif
ifeq ($(DONT_NEED_RGX_BVNC),)
# we can only do this stuff if we have a BVNC
SUPPORT_RAY_TRACING := \
$(shell grep -qw RGX_FEATURE_RAY_TRACING $(RGX_BNC_CONFIG_KM) && echo 1)
SUPPORT_DMA :=\
$(shell grep -qw RGX_FEATURE_META_DMA_CHANNEL_COUNT $(RGX_BNC_CONFIG_KM) && echo 1)
endif
# Default place for shared libraries
SHLIB_DESTDIR ?= /usr/lib
# Build's selected list of components.
# - components.mk is a per-build file that specifies the components that are
# to be built
-include components.mk
# Set up the host and target compiler.
include ../config/compiler.mk
# PDUMP needs extra components
#
ifeq ($(PDUMP),1)
ifneq ($(COMPONENTS),)
COMPONENTS += pdump
endif
ifeq ($(SUPPORT_DRM),1)
EXTRA_PVRSRVKM_COMPONENTS += dbgdrv
else
KERNEL_COMPONENTS += dbgdrv
endif
endif
# HWPerf KM Interface example
#
ifeq ($(SUPPORT_KERNEL_HWPERF_TEST),1)
KERNEL_COMPONENTS += rgxhwpdrv
endif
# PVRGDB needs extra components
#
ifeq ($(PVRGDB),1)
ifneq ($(COMPONENTS),)
COMPONENTS += pvrdebugger pvrgdb pvrdebugipc
endif
override SUPPORT_EXPORTING_MEMORY_CONTEXT := 1
endif
$(if $(filter config,$(D)),$(info Build configuration:))
################################# CONFIG ####################################
ifneq ($(SUPPORT_NEUTRINO_PLATFORM), 1)
# If KERNELDIR is set, write it out to the config.mk, with
# KERNEL_COMPONENTS and KERNEL_ID
#
ifneq ($(strip $(KERNELDIR)),)
PVRSRV_MODULE_BASEDIR ?= /lib/modules/$(KERNEL_ID)/extra/
$(eval $(call BothConfigMake,KERNELDIR,$(KERNELDIR)))
$(eval $(call BothConfigMake,KERNEL_ID,$(KERNEL_ID)))
$(eval $(call KernelConfigMake,KERNEL_COMPONENTS,$(KERNEL_COMPONENTS)))
$(eval $(call TunableKernelConfigMake,EXTRA_PVRSRVKM_COMPONENTS,,\
List of components that should be built in to pvrsrvkm.ko$(comma) rather than_\
forming separate kernel modules._\
))
# If KERNEL_CROSS_COMPILE is set to "undef", this is magically
# equivalent to being unset. If it is unset, we use CROSS_COMPILE
# (which might also be unset). If it is set, use it directly.
ifneq ($(KERNEL_CROSS_COMPILE),undef)
KERNEL_CROSS_COMPILE ?= $(CROSS_COMPILE)
$(eval $(call TunableBothConfigMake,KERNEL_CROSS_COMPILE,))
endif
# Check the KERNELDIR has a kernel built and also check that it is
# not 64-bit, which we do not support.
KERNEL_AUTOCONF := \
$(strip $(wildcard $(KERNELDIR)/include/linux/autoconf.h) \
$(wildcard $(KERNELDIR)/include/generated/autoconf.h))
ifeq ($(KERNEL_AUTOCONF),)
$(warning autoconf.h not found in $$(KERNELDIR)/include/linux \
or $$(KERNELDIR)/include/generated. Check your $$(KERNELDIR) variable \
and kernel configuration.)
endif
else
$(if $(KERNEL_COMPONENTS),$(warning KERNELDIR is not set. Kernel components cannot be built))
endif
endif # !Neutrino
# Normally this is off for Linux, and only used by Android, but if customers
# are testing their display engines using NULLADFWS, they need to enable it
# for dmabuf support under Linux. The sync header is needed by adf_pdp.
#
SUPPORT_ION ?= 0
ifneq ($(SUPPORT_ION),0)
# Support kernels built out-of-tree with O=/other/path
# In those cases, KERNELDIR will be O, not the source tree.
ifneq ($(wildcard $(KERNELDIR)/source),)
KSRCDIR := $(KERNELDIR)/source
else
KSRCDIR := $(KERNELDIR)
endif
ifneq ($(wildcard $(KSRCDIR)/drivers/staging/android/ion/ion.h),)
# The kernel has a more recent version of ion, located in drivers/staging.
# Change the default header paths and the behaviour wrt sg_dma_len.
PVR_ANDROID_ION_HEADER := \"../drivers/staging/android/ion/ion.h\"
PVR_ANDROID_ION_PRIV_HEADER := \"../drivers/staging/android/ion/ion_priv.h\"
PVR_ANDROID_ION_USE_SG_LENGTH := 1
endif
ifneq ($(wildcard $(KSRCDIR)/drivers/staging/android/sync.h),)
# The kernel has a more recent version of the sync driver, located in
# drivers/staging. Change the default header path.
PVR_ANDROID_SYNC_HEADER := \"../drivers/staging/android/sync.h\"
endif
$(eval $(call BothConfigMake,SUPPORT_ION,1))
$(eval $(call BothConfigC,SUPPORT_ION,))
$(eval $(call TunableKernelConfigC,PVR_ANDROID_ION_HEADER,\"linux/ion.h\"))
$(eval $(call TunableKernelConfigC,PVR_ANDROID_ION_PRIV_HEADER,\"../drivers/gpu/ion/ion_priv.h\"))
$(eval $(call TunableKernelConfigC,PVR_ANDROID_ION_USE_SG_LENGTH,))
$(eval $(call TunableKernelConfigC,PVR_ANDROID_SYNC_HEADER,\"linux/sync.h\"))
endif
$(eval $(call UserConfigC,PVRSRV_MODULE_BASEDIR,\"$(PVRSRV_MODULE_BASEDIR)\"))
# Ideally configured by platform Makefiles, as necessary
#
$(if $(USE_CCACHE),$(if $(USE_DISTCC),$(error\
Enabling both USE_CCACHE and USE_DISTCC at the same time is not supported)))
# Invariant options for Linux
#
$(eval $(call BothConfigC,LINUX,))
$(eval $(call BothConfigC,PVR_BUILD_DIR,"\"$(PVR_BUILD_DIR)\""))
$(eval $(call BothConfigC,PVR_BUILD_TYPE,"\"$(BUILD)\""))
$(eval $(call BothConfigC,PVRSRV_MODNAME,"\"$(PVRSRV_MODNAME)\""))
$(eval $(call BothConfigMake,PVRSRV_MODNAME,$(PVRSRV_MODNAME)))
$(eval $(call BothConfigMake,PVR_BUILD_DIR,$(PVR_BUILD_DIR)))
$(eval $(call BothConfigMake,PVR_BUILD_TYPE,$(BUILD)))
$(eval $(call BothConfigC,SUPPORT_RGX,1))
$(eval $(call UserConfigMake,SUPPORT_RGX,1))
$(eval $(call BothConfigC,PVR_SECURE_HANDLES,))
$(eval $(call UserConfigC,PVR_TLS_USE_GCC__thread_KEYWORD,))
ifneq ($(DISPLAY_CONTROLLER),)
$(eval $(call BothConfigC,DISPLAY_CONTROLLER,$(DISPLAY_CONTROLLER)))
$(eval $(call BothConfigMake,DISPLAY_CONTROLLER,$(DISPLAY_CONTROLLER)))
endif
$(eval $(call UserConfigC,OPK_DEFAULT,"\"$(OPK_DEFAULT)\""))
$(eval $(call UserConfigC,OPK_FALLBACK,"\"$(OPK_FALLBACK)\""))
$(eval $(call BothConfigMake,PVR_SYSTEM,$(PVR_SYSTEM)))
ifeq ($(MESA_EGL),1)
$(eval $(call UserConfigMake,LIB_IMG_EGL,pvr_dri_if))
else
$(eval $(call UserConfigMake,LIB_IMG_EGL,IMGegl))
endif
# Build-type dependent options
#
$(eval $(call BothConfigMake,BUILD,$(BUILD)))
ifeq ($(BUILD),debug)
PVR_RI_DEBUG ?= 1
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_BNC_CONFIG_KM_HEADER,))
endif
$(eval $(call TunableBothConfigC,SUPPORT_DBGDRV_EVENT_OBJECTS,1))
$(eval $(call TunableBothConfigC,PVR_DBG_BREAK_ASSERT_FAIL,,\
Enable this to treat PVR_DBG_BREAK as PVR_ASSERT(0)._\
Otherwise it is ignored._\
))
$(eval $(call TunableBothConfigC,PDUMP,,\
Enable parameter dumping in the driver._\
This adds code to record the parameters being sent to the hardware for_\
later analysis._\
))
$(eval $(call TunableBothConfigC,NO_HARDWARE,,\
Disable hardware interactions (e.g. register writes) that the driver would_\
normally perform. A driver built with this option can$(apos)t drive hardware$(comma)_\
but with PDUMP enabled$(comma) it can capture parameters to be played back later._\
))
$(eval $(call TunableBothConfigC,PDUMP_DEBUG_OUTFILES,))
$(eval $(call TunableBothConfigC,SYS_USING_INTERRUPTS,1))
$(eval $(call TunableBothConfigC,PVRSRV_NEED_PVR_DPF,,\
Enable this to turn on PVR_DPF in release builds._\
))
$(eval $(call TunableBothConfigC,PVRSRV_NEED_PVR_ASSERT,,\
Enable this to turn on PVR_ASSERT in release builds._\
))
$(eval $(call TunableBothConfigC,PVRSRV_NEED_PVR_TRACE,,\
Enable this to turn on PVR_TRACE in release builds._\
))
$(eval $(call TunableBothConfigC,REFCOUNT_DEBUG,))
$(eval $(call TunableBothConfigC,DC_DEBUG,))
$(eval $(call TunableBothConfigC,SCP_DEBUG,))
$(eval $(call TunableBothConfigC,CACHEFLUSH_TYPE,CACHEFLUSH_GENERIC))
$(eval $(call TunableBothConfigC,SUPPORT_INSECURE_EXPORT,1))
$(eval $(call TunableBothConfigC,SUPPORT_SECURE_EXPORT,1,\
Enable support for secure device memory and sync export._\
This replaces export handles with file descriptors$(comma) which can be passed_\
between processes to share memory._\
))
$(eval $(call TunableBothConfigC,SUPPORT_PMMIF,))
$(eval $(call TunableBothConfigC,SUPPORT_GPUTRACE_EVENTS,))
$(eval $(call TunableBothConfigC,SUPPORT_KERNEL_HWPERF,))
$(eval $(call TunableBothConfigC,SUPPORT_DISPLAY_CLASS,))
$(eval $(call TunableBothConfigC,PVRSRV_DEBUG_CCB_MAX,))
$(eval $(call TunableBothConfigC,SUPPORT_TRUSTED_DEVICE,))
$(eval $(call TunableBothConfigC,TRUSTED_DEVICE_DEFAULT_ENABLED,))
$(eval $(call TunableBothConfigC,SUPPORT_EXPORTING_MEMORY_CONTEXT,))
$(eval $(call TunableBothConfigC,SUPPORT_USER_REGISTER_CONFIGURATION,))
$(eval $(call TunableBothConfigC,FIX_DUSTS_POW_ON_INIT,))
$(eval $(call TunableKernelConfigC,DEBUG_HANDLEALLOC_INFO_KM,))
$(eval $(call TunableKernelConfigC,SUPPORT_LINUX_X86_WRITECOMBINE,1))
$(eval $(call TunableKernelConfigC,SUPPORT_LINUX_X86_PAT,1))
$(eval $(call TunableKernelConfigC,PVRSRV_RESET_ON_HWTIMEOUT,))
$(eval $(call TunableKernelConfigC,PVR_LINUX_USING_WORKQUEUES,))
$(eval $(call TunableKernelConfigC,PVR_LINUX_MISR_USING_WORKQUEUE,))
$(eval $(call TunableKernelConfigC,PVR_LINUX_MISR_USING_PRIVATE_WORKQUEUE,))
$(eval $(call TunableKernelConfigC,PVR_LINUX_TIMERS_USING_WORKQUEUES,))
$(eval $(call TunableKernelConfigC,PVR_LINUX_TIMERS_USING_SHARED_WORKQUEUE,))
$(eval $(call TunableKernelConfigC,PVR_LDM_PLATFORM_PRE_REGISTERED,))
$(eval $(call TunableKernelConfigC,PVR_LDM_DRIVER_REGISTRATION_NAME,"\"$(PVRSRV_MODNAME)\""))
$(eval $(call TunableBothConfigC,LDM_PLATFORM,))
$(eval $(call TunableBothConfigC,LDM_PCI,))
$(eval $(call TunableBothConfigC,PVRSRV_ENABLE_FULL_SYNC_TRACKING,))
$(eval $(call TunableKernelConfigC,SYNC_DEBUG,))
$(eval $(call TunableKernelConfigC,SUPPORT_DUMP_CLIENT_CCB_COMMANDS,))
$(eval $(call TunableKernelConfigC,PVR_LINUX_DONT_USE_RANGE_BASED_INVALIDATE,))
$(eval $(call TunableKernelConfigC,PVR_MMAP_USE_VM_INSERT,))
$(eval $(call TunableKernelConfigC,SUPPORT_MMU_PxE_MAP_ON_DEMAND,))
$(eval $(call TunableKernelConfigC,SUPPORT_MMU_MODIFICATION_LOGGING,,\
Enable support for logging of page table modifications. This is as debug_\
feature for use when debugging page-faults which are showing what look to_\
be unexpected values. It keeps a history of the last few modifications types_\
(map/unmap) and the value written during as a result of that operation._\
))
$(eval $(call TunableKernelConfigC,SUPPORT_DC_COMPLETE_TIMEOUT_DEBUG,))
$(eval $(call TunableKernelConfigC,SUPPORT_SYSTEM_INTERRUPT_HANDLING,,\
Enable support for system level interrupt handling. This is intended_\
for use on systems that have two or more levels of interrupt registers_\
which require the top level register to be cleared by the system layer_\
because it is not specific to one single device._\
))
$(eval $(call TunableBothConfigC,SUPPORT_PVR_VALGRIND,))
ifneq ($(SUPPORT_ANDROID_PLATFORM),1)
endif
$(eval $(call TunableBothConfigMake,CACHEFLUSH_TYPE,CACHEFLUSH_GENERIC))
$(eval $(call TunableBothConfigMake,PDUMP,))
$(eval $(call TunableBothConfigMake,SUPPORT_INSECURE_EXPORT,1))
$(eval $(call TunableBothConfigMake,SUPPORT_SECURE_EXPORT,1))
$(eval $(call TunableBothConfigMake,SUPPORT_PMMIF,))
$(eval $(call TunableBothConfigMake,SUPPORT_DISPLAY_CLASS,))
$(eval $(call TunableBothConfigMake,SUPPORT_RAY_TRACING,))
$(eval $(call TunableBothConfigMake,SUPPORT_GPUTRACE_EVENTS,))
$(eval $(call TunableBothConfigMake,SUPPORT_KERNEL_HWPERF,))
$(eval $(call TunableBothConfigMake,OPTIM,,\
Specify the optimisation flags passed to the compiler. Normally this_\
is autoconfigured based on the build type._\
))
$(eval $(call TunableBothConfigC,SUPPORT_MMU_FREELIST,))
$(eval $(call TunableBothConfigC,SUPPORT_VFP,))
$(eval $(call TunableBothConfigC,SUPPORT_META_SLAVE_BOOT,))
$(eval $(call UserConfigC,EGL_BASENAME_SUFFIX,\"$(EGL_BASENAME_SUFFIX)\"))
$(eval $(call TunableBothConfigC,PVR_TESTING_UTILS,,\
Enable this to build in support for testing the PVR Transport Layer API._\
))
TQ_CAPTURE_PARAMS ?= 1
$(eval $(call TunableBothConfigC,TDMETACODE,))
$(eval $(call TunableBothConfigC,PVR_DPF_ADHOC_DEBUG_ON,))
$(eval $(call TunableBothConfigC,RGXFW_DEBUG_LOG_GROUP,))
$(eval $(call TunableBothConfigC,SUPPORT_POWMON_WO_GPIO_PIN,))
$(eval $(call TunableKernelConfigMake,PVR_HANDLE_BACKEND,generic,\
Specifies the back-end that should be used$(comma) by the Services kernel handle_\
interface$(comma) to allocate handles. The available backends are:_\
* generic (OS agnostic)_\
* idr (Uses the Linux IDR interface)_\
))
$(eval $(call TunableBothConfigC,PVRSRV_ENABLE_PROCESS_STATS,1,\
Enable Process Statistics via DebugFS._\
))
$(eval $(call TunableKernelConfigC,SUPPORT_SHARED_SLC,,))
# PVR_RI_DEBUG is set to enable RI annotation of devmem allocations
# This is enabled by default for debug builds.
#
$(eval $(call TunableBothConfigMake,PVR_RI_DEBUG,))
$(eval $(call TunableBothConfigC,PVR_RI_DEBUG,,\
Enable Resource Information (RI) debug. This logs details of_\
resource allocations with annotation to help indicate their use._\
))
$(eval $(call 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,PVRSRV_ENABLE_MEMORY_STATS,,\
Enable Memory allocations to be recorded and published via Process Statistics._\
))
$(eval $(call TunableKernelConfigC,PVRSRV_ENABLE_FW_TRACE_DEBUGFS,,\
Enable automatic decoding of Firmware Trace via DebugFS._\
))
$(eval $(call TunableKernelConfigC,PVR_LINUX_PYSMEM_MAX_POOL_PAGES,"$(MAX_POOL_PAGES)"))
# 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 TunableKernelConfigC,PVR_LINUX_ARM_PAGEALLOC_FLUSH_THRESHOLD, 256))
$(eval $(call TunableKernelConfigC,PVR_LINUX_VMALLOC_ALLOCATION_THRESHOLD, 16384 ))
# Tunable RGX_MAX_TA_SYNCS / RGX_MAX_3D_SYNCS to increase the size of sync array in the DDK
# If defined, these macros take up the values as defined in the environment,
# Else, the default value is taken up as defined in include/rgxapi.h
#
endif # INTERNAL_CLOBBER_ONLY
export INTERNAL_CLOBBER_ONLY
export TOP
export OUT
MAKE_ETC := -Rr --no-print-directory -C $(TOP) TOP=$(TOP) OUT=$(OUT) \
-f build/linux/toplevel.mk
# This must match the default value of MAKECMDGOALS below, and the default
# goal in toplevel.mk
.DEFAULT_GOAL := build
ifeq ($(MAKECMDGOALS),)
MAKECMDGOALS := build
else
# We can't pass autogen to toplevel.mk
MAKECMDGOALS := $(filter-out autogen,$(MAKECMDGOALS))
endif
.PHONY: autogen
autogen:
ifeq ($(INTERNAL_CLOBBER_ONLY),)
@$(MAKE) -s --no-print-directory -C $(TOP) \
-f build/linux/prepare_tree.mk \
LDM_PCI=$(LDM_PCI) \
LDM_PLATFORM=$(LDM_PLATFORM)
else
@:
endif
include ../config/help.mk
# This deletes built-in suffix rules. Otherwise the submake isn't run when
# saying e.g. "make thingy.a"
.SUFFIXES:
# Because we have a match-anything rule below, we'll run the main build when
# we're actually trying to remake various makefiles after they're read in.
# These rules try to prevent that
%.mk: ;
Makefile%: ;
Makefile: ;
.PHONY: build kbuild install
build kbuild install: autogen
@$(if $(MAKECMDGOALS),$(MAKE) $(MAKE_ETC) $(MAKECMDGOALS) $(eval MAKECMDGOALS :=),:)
%: autogen
@$(if $(MAKECMDGOALS),$(MAKE) $(MAKE_ETC) $(MAKECMDGOALS) $(eval MAKECMDGOALS :=),:)

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 rscompute scripts composerhal servicestools hwperftools testchiptools rogue2d memtrackhal camerahal
_excluded_apis := $(subst $(comma),$(space),$(EXCLUDED_APIS))
_unrecognised := $(strip $(filter-out $(_excludable_apis),$(_excluded_apis)))
ifneq ($(_unrecognised),)
$(warning *** Ignoring unrecognised entries in EXCLUDED_APIS: $(_unrecognised))
$(warning *** EXCLUDED_APIS was set via $(origin EXCLUDED_APIS) to: $(EXCLUDED_APIS))
$(warning *** Excludable APIs are: $(_excludable_apis))
endif
override EXCLUDED_APIS := $(filter $(_excludable_apis), $(_excluded_apis))
ifeq ($(SUPPORT_NEUTRINO_PLATFORM),1)
include ../common/neutrino/preconfig_neutrino.mk
endif

View File

@@ -1,264 +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 host-intermediates-of
$(addprefix $(HOST_OUT)/intermediates/$(1)/,$(2))
endef
define module-library
$(patsubst lib%.so,%,$(if $($(1)_target),$($(1)_target),$(1).so))
endef
# This is done to allow module type makefiles to use $(THIS_MAKEFILE)
define register-module
INTERNAL_MAKEFILE_FOR_MODULE_$(1) := $(THIS_MAKEFILE)
endef
define process-module-arch
MODULE_ARCH := $$(strip $(2))
include $$(MAKE_TOP)/moduledefs_common.mk
include $$(MAKE_TOP)/moduledefs/$$(MODULE_ARCH).mk
include $$(MAKE_TOP)/modules/$$(strip $$($$(THIS_MODULE)_type)).mk
.SECONDARY: $$(MODULE_INTERMEDIATES_DIR)
$$(MODULE_INTERMEDIATES_DIR):
$$(make-directory)
MODULE_CLEAN_TARGETS += $$(MODULE_INTERMEDIATES_DIR)
INTERNAL_TARGETS_FOR_$(1) += $$(MODULE_TARGETS)
INTERNAL_CLEAN_TARGETS_FOR_$(1) += $$(MODULE_CLEAN_TARGETS)
INTERNAL_CLOBBER_TARGETS_FOR_$(1) += $$(MODULE_CLEAN_TARGETS) $$(MODULE_CLOBBER_TARGETS) $$(MODULE_TARGETS)
endef
target_neutral_types := \
apk \
bison_parser \
bridge \
copy_files \
custom \
flex_lexer \
flexxx_lexer \
gen_dispatch \
rsc_scriptc \
image_header \
inline_shaders \
java_archive \
module_group \
pds_header \
rgxfw \
usc_header \
rscbitcode_header
doc_types := \
doc \
doxygen
define calculate-arch-list
# Work out the target platforms for this module
MODULE_ARCH_LIST := $(2)
ifeq ($$(MODULE_ARCH_LIST),)
ifneq ($$(filter $(1),$(doc_types)),)
MODULE_ARCH_LIST := doc
else
ifneq ($$(filter $(1),$(target_neutral_types)),)
MODULE_ARCH_LIST := target_neutral
else
ifneq ($$(filter $(1),kernel_module),)
MODULE_ARCH_LIST := $(TARGET_PRIMARY_ARCH)
else
MODULE_ARCH_LIST := $(TARGET_ALL_ARCH)
endif
endif
endif
endif
endef
define process-module
THIS_MODULE := $(1)
THIS_MAKEFILE := $(INTERNAL_MAKEFILE_FOR_MODULE_$(1))
INTERNAL_TARGETS_FOR_$(1) :=
INTERNAL_CLEAN_TARGETS_FOR_$(1) :=
INTERNAL_CLOBBER_TARGETS_FOR_$(1) :=
include $$(MAKE_TOP)/this_makefile.mk
$$(call must-be-nonempty,THIS_MAKEFILE)
$$(call must-be-nonempty,$(1)_type)
$$(eval $$(call calculate-arch-list,$$($(1)_type),$$($(1)_arch)))
INTERNAL_ARCH_LIST_FOR_$(1) := $$(MODULE_ARCH_LIST)
$$(foreach _m,$$(MODULE_ARCH_LIST),$$(eval $$(call process-module-arch,$(1),$$(_m))))
endef
# This can be used by module_type.mk files to indicate that they can't be
# built as host_module_type
define target-build-only
$(if $(filter true,$(MODULE_HOST_BUILD)),$(error In makefile $(THIS_MAKEFILE): Module $(THIS_MODULE) attempted to build a host $(1), which is not supported))
endef
define relative-to-top
$(patsubst $(TOP)/%,%,$(1))
endef
define cc-check
$(shell \
CC_CHECK=$(patsubst @%,%,$(CC_CHECK)) && \
$(patsubst @%,%,$(CHMOD)) +x $$CC_CHECK && \
$$CC_CHECK --cc "$(1)" --out "$(2)" $(3))
endef
define cc-is-clang
$(call cc-check,$(patsubst @%,%,$(CC)),$(OUT),--clang)
endef
define cc-option
$(call cc-check,$(patsubst @%,%,$(CC)),$(OUT),$(1))
endef
define cxx-option
$(call cc-check,$(patsubst @%,%,$(CXX)),$(OUT),$(1))
endef
define host-cc-option
$(call cc-check,$(patsubst @%,%,$(HOST_CC)),$(OUT),$(1))
endef
define host-cxx-option
$(call cc-check,$(patsubst @%,%,$(HOST_CXX)),$(OUT),$(1))
endef
define kernel-cc-option
$(call cc-check,$(KERNEL_CROSS_COMPILE)gcc,$(OUT),$(1))
endef
# Turn a particular warning on, or explicitly turn it off, depending on
# the value of W. The "-W" or "-Wno-" part of the warning need not be
# specified.
define cc-optional-warning
$(call cc-option,-W$(if $(W),,no-)$(patsubst -W%,%,$(patsubst -Wno-%,%,$(1))))
endef
define host-cc-optional-warning
$(call host-cc-option,-W$(if $(W),,no-)$(patsubst -W%,%,$(patsubst -Wno-%,%,$(1))))
endef
define kernel-cc-optional-warning
$(call kernel-cc-option,-W$(if $(W),,no-)$(patsubst -W%,%,$(patsubst -Wno-%,%,$(1))))
endef
define module-info-line
$(if $(filter modules,$(D)),$(info [$(THIS_MODULE)] <$(MODULE_ARCH)> $(1)),)
endef
# $(call if-exists,A,B) => A if A is a file which exists, otherwise B
define if-exists
$(if $(wildcard $(1)),$(1),$(2))
endef
#
# Joins a given list of strings together with the given separator.
#
# (1): the list of strings to join
# (2): the separator to use for joining
#
NOOP=
SPACE=$(NOOP) $(NOOP)
define list-join
$(subst $(SPACE),$(2),$(strip $(1)))
endef
#
# Check if a given path is absolute
#
# $(1): path to check
# $(2): return when true
# $(3): return when false
#
define if-abs-path
$(if $(filter /%,$(1)),$(2),$(3))
endef
#
# Add a prefix to every path in a list, when the path isn't absolute.
#
# $(1): prefix to add
# $(2): list of paths
#
define addprefix-ifnot-abs
$(foreach _path,$(2),$(call if-abs-path,$(_path),$(_path),$(1)$(_path)))
endef
#
# Return the directory part of a path normalized (without trailing slashes)
#
# $(1): Path to normalize
#
define normalized-dir
$(if $(filter /,$(dir $(1))),$(dir $(1)),$(if $(findstring /,$(dir $(1))),$(patsubst %/,%,$(dir $(1))),$(dir $(1))))
endef
# Definitions to handle the various suffixes allowed for C++ files.
INTERNAL_CXX_SUFFIXES := .cc .cxx .cpp .c++
define filter-cxx-files
$(filter $(addprefix %,$(INTERNAL_CXX_SUFFIXES)),$(1))
endef
define filter-out-cxx-files
$(filter-out $(addprefix %,$(INTERNAL_CXX_SUFFIXES)),$(1))
endef
define objects-from-cxx-files
$(foreach _suffix,$(INTERNAL_CXX_SUFFIXES),$(patsubst %$(_suffix),%.o,$(filter %$(_suffix),$(1))))
endef
define unsupported-module-var
$(if $(strip $($(THIS_MODULE)_$(1))),$(error In makefile $(THIS_MAKEFILE): Setting '$(THIS_MODULE)_$(1)' has no effect, because $(THIS_MODULE) has type $($(THIS_MODULE)_type)))
endef

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_future_version),1)
SYS_INCLUDES += \
-isystem $(ANDROID_ROOT)/device/img/generic/adf/libadf/include \
-isystem $(ANDROID_ROOT)/device/img/generic/adf/libadfhwc/include
endif
endif
PVR_LDM_PLATFORM_PRE_REGISTERED := 1
#zxl: build adf_fbdev.ko
ifeq ($(SUPPORT_ADF),1)
ADF_FBDEV ?= adf_fbdev
KERNEL_COMPONENTS += $(ADF_FBDEV)
endif
ifneq ($(SUPPORT_ADF),1)
ifeq ($(SUPPORT_DC),1)
DISPLAY_CONTROLLER ?= dc_fbdev
KERNEL_COMPONENTS += $(DISPLAY_CONTROLLER)
ifeq ($(DISPLAY_CONTROLLER),dc_example)
DC_EXAMPLE_WIDTH ?= 640
DC_EXAMPLE_HEIGHT ?= 480
DC_EXAMPLE_BIT_DEPTH ?= 32
DC_EXAMPLE_DPI ?= 160
endif
endif
endif
#zxl: 3 fb buffer
DC_FBDEV_NUM_PREFERRED_BUFFERS := 3
CACHEFLUSH_TYPE ?= CACHEFLUSH_GENERIC
include ../config/core.mk
include ../common/3rdparty.mk
include ../common/android/extra_config.mk

View File

@@ -1,92 +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)
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,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.
### ###########################################################################
$(TARGET_PRIMARY_OUT)/kbuild/Makefile: $(MAKE_TOP)/kbuild/Makefile.template
@[ ! -e $(dir $@) ] && mkdir -p $(dir $@) || true
$(CP) -f $< $@
# We need to make INTERNAL_KBUILD_MAKEFILES absolute because the files will be
# read while chdir'd into $(KERNELDIR)
INTERNAL_KBUILD_MAKEFILES := $(abspath $(foreach _m,$(KERNEL_COMPONENTS) $(EXTRA_PVRSRVKM_COMPONENTS),$(if $(INTERNAL_KBUILD_MAKEFILE_FOR_$(_m)),$(INTERNAL_KBUILD_MAKEFILE_FOR_$(_m)),$(error Unknown kbuild module "$(_m)"))))
INTERNAL_KBUILD_OBJECTS := $(foreach _m,$(KERNEL_COMPONENTS),$(if $(INTERNAL_KBUILD_OBJECTS_FOR_$(_m)),$(INTERNAL_KBUILD_OBJECTS_FOR_$(_m)),$(error BUG: Unknown kbuild module "$(_m)" should have been caught earlier)))
INTERNAL_EXTRA_KBUILD_OBJECTS := $(foreach _m,$(EXTRA_PVRSRVKM_COMPONENTS),$(if $(INTERNAL_KBUILD_OBJECTS_FOR_$(_m)),$(INTERNAL_KBUILD_OBJECTS_FOR_$(_m)),$(error BUG: Unknown kbuild module "$(_m)" should have been caught earlier)))
.PHONY: kbuild kbuild_clean kbuild_check
kbuild_check:
@: $(if $(strip $(KERNELDIR)),,$(error KERNELDIR must be set))
@: $(call directory-must-exist,$(KERNELDIR))
@: $(foreach _m,$(ALL_KBUILD_MODULES),$(if $(wildcard $(abspath $(INTERNAL_KBUILD_MAKEFILE_FOR_$(_m)))),,$(error In makefile $(INTERNAL_MAKEFILE_FOR_MODULE_$(_m)): Module $(_m) requires kbuild makefile $(INTERNAL_KBUILD_MAKEFILE_FOR_$(_m)), which is missing)))
@: $(if $(filter-out command line override,$(origin build)),,$(error Overriding $$(build) (with "make build=...") will break kbuild))
kbuild: kbuild_check $(TARGET_PRIMARY_OUT)/kbuild/Makefile
$(if $(V),,@)$(MAKE) -Rr --no-print-directory -C $(KERNELDIR) \
M=$(abspath $(TARGET_PRIMARY_OUT)/kbuild) \
INTERNAL_KBUILD_MAKEFILES="$(INTERNAL_KBUILD_MAKEFILES)" \
INTERNAL_KBUILD_OBJECTS="$(INTERNAL_KBUILD_OBJECTS)" \
INTERNAL_EXTRA_KBUILD_OBJECTS="$(INTERNAL_EXTRA_KBUILD_OBJECTS)" \
BRIDGE_SOURCE_ROOT=$(abspath $(BRIDGE_SOURCE_ROOT)) \
TARGET_PRIMARY_ARCH=$(TARGET_PRIMARY_ARCH) \
CROSS_COMPILE="$(CCACHE) $(KERNEL_CROSS_COMPILE)" \
EXTRA_CFLAGS="$(ALL_KBUILD_CFLAGS)" \
V=$(V) W=$(W) \
CHECK="$(patsubst @%,%,$(CHECK))" $(if $(CHECK),C=1,) \
TOP=$(TOP)
@for kernel_module in $(addprefix $(TARGET_PRIMARY_OUT)/kbuild/,$(INTERNAL_KBUILD_OBJECTS:.o=.ko)); do \
cp $$kernel_module $(TARGET_PRIMARY_OUT); \
done
kbuild_clean: kbuild_check $(TARGET_PRIMARY_OUT)/kbuild/Makefile
$(if $(V),,@)$(MAKE) -Rr --no-print-directory -C $(KERNELDIR) \
M=$(abspath $(TARGET_PRIMARY_OUT)/kbuild) \
INTERNAL_KBUILD_MAKEFILES="$(INTERNAL_KBUILD_MAKEFILES)" \
INTERNAL_KBUILD_OBJECTS="$(INTERNAL_KBUILD_OBJECTS)" \
INTERNAL_EXTRA_KBUILD_OBJECTS="$(INTERNAL_EXTRA_KBUILD_OBJECTS)" \
BRIDGE_SOURCE_ROOT=$(abspath $(BRIDGE_SOURCE_ROOT)) \
TARGET_PRIMARY_ARCH=$(TARGET_PRIMARY_ARCH) \
CROSS_COMPILE="$(CCACHE) $(KERNEL_CROSS_COMPILE)" \
EXTRA_CFLAGS="$(ALL_KBUILD_CFLAGS)" \
V=$(V) W=$(W) \
TOP=$(TOP) clean
kbuild_install: install
kbuild: install_script_km

View File

@@ -1,57 +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

View File

@@ -1,57 +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

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_SSL_ARCH :=
# 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_SSL_ARCH :=
# 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_SSL_ARCH := linux-generic32
# Neutrino qcc requires "-Wc," prefix for compiler flags
ifeq ($(SUPPORT_NEUTRINO_PLATFORM),1)
include $(MAKE_TOP)/common/neutrino/modify_moduledefs.mk
endif

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_SSL_ARCH := linux-x86_64
# Neutrino qcc requires "-Wc," prefix for compiler flags
ifeq ($(SUPPORT_NEUTRINO_PLATFORM),1)
include $(MAKE_TOP)/common/neutrino/modify_moduledefs.mk
endif

View File

@@ -1,121 +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 :=
# Only allow cflags that do not affect code generation. This is to ensure
# proper binary compatibility when LTO (Link-Time Optimization) is enabled.
# We make exceptions for the below flags which will all fail linkage in
# non-LTO mode if incorrectly specified.
#
# NOTE: Only used by static_library and objects right now. Other module
# types should not be affected by complex code generation flags w/ LTO.
# Set MODULE_CHECK_CFLAGS in the module makefile to enable this check.
MODULE_CHECK_CFLAGS :=
MODULE_ALLOWED_CFLAGS := -W% -D% -std=% -fPIC -fPIE -pie -m32
# -L flags for library search dirs: these are relative to $(TOP), unless
# they're absolute paths
MODULE_LIBRARY_DIR_FLAGS := $(foreach _path,$($(THIS_MODULE)_libpaths),$(if $(filter /%,$(_path)),-L$(call relative-to-top,$(_path)),-L$(_path)))
# -L options to find system libraries (may be arch-specific)
MODULE_SYSTEM_LIBRARY_DIR_FLAGS :=
# -I flags for header search dirs (same rules as for -L)
MODULE_INCLUDE_FLAGS := $(foreach _path,$($(THIS_MODULE)_includes),$(if $(filter /%,$(_path)),-I$(call relative-to-top,$(_path)),-I$(_path)))
# If the build provides some external khronos include flags, and the module
# hasn't explicitly opted out of path substitution, prepend the system path
# to the DDK khronos header include path. This causes the platform headers
# to override the DDK versions. This is the default behaviour for Android.
ifneq ($(SYS_KHRONOS_INCLUDES),)
ifneq ($($(THIS_MODULE)_force_internal_khronos_headers),1)
MODULE_INCLUDE_FLAGS := $(patsubst -Iinclude/khronos,$(SYS_KHRONOS_INCLUDES) -Iinclude/khronos,$(MODULE_INCLUDE_FLAGS))
endif
endif
# These define the rules for finding source files.
# - If a name begins with a slash, we strip $(TOP) off the front if it begins
# with $(TOP). This is so that we don't get really long error messages from
# the compiler if the source tree is in a deeply nested directory, but we
# still do get absolute paths if you say "make OUT=/tmp/somewhere"
# - Otherwise, if a name contains a slash and begins with $(OUT), we leave it
# as it is. This is so you can say "module_src :=
# $(TARGET_INTERMEDIATES)/something/generated.c"
# - Otherwise, we assume it's a path referring to somewhere under the
# directory containing Linux.mk, and add $(THIS_DIR) to it
_SOURCES_WITHOUT_SLASH := $(strip $(foreach _s,$($(THIS_MODULE)_src),$(if $(findstring /,$(_s)),,$(_s))))
_SOURCES_WITH_SLASH := $(strip $(foreach _s,$($(THIS_MODULE)_src),$(if $(findstring /,$(_s)),$(_s),)))
MODULE_SOURCES := $(addprefix $(THIS_DIR)/,$(_SOURCES_WITHOUT_SLASH))
MODULE_SOURCES += $(call relative-to-top,$(filter /%,$(_SOURCES_WITH_SLASH)))
_RELATIVE_SOURCES_WITH_SLASH := $(filter-out /%,$(_SOURCES_WITH_SLASH))
_OUTDIR_RELATIVE_SOURCES_WITH_SLASH := $(filter $(RELATIVE_OUT)/%,$(_RELATIVE_SOURCES_WITH_SLASH))
_THISDIR_RELATIVE_SOURCES_WITH_SLASH := $(filter-out $(RELATIVE_OUT)/%,$(_RELATIVE_SOURCES_WITH_SLASH))
MODULE_SOURCES += $(_OUTDIR_RELATIVE_SOURCES_WITH_SLASH)
MODULE_SOURCES += $(addprefix $(THIS_DIR)/,$(_THISDIR_RELATIVE_SOURCES_WITH_SLASH))
# Add generated sources
MODULE_SOURCES += $(addprefix $(MODULE_OUT)/,$($(THIS_MODULE)_src_relative))
# -l flags for each library. The rules are:
# - for all static libs, use -lfoo
# - for all in-tree or external libs, use $(libfoo_ldflags) if that
# variable is defined (empty counts as defined). Otherwise use
# -lfoo.
MODULE_LIBRARY_FLAGS := $(addprefix -l, $($(THIS_MODULE)_staticlibs)) $(addprefix -l,$($(THIS_MODULE)_libs)) $(foreach _lib,$($(THIS_MODULE)_extlibs),$(if $(filter undefined,$(origin lib$(_lib)_ldflags)),-l$(_lib),$(lib$(_lib)_ldflags)))
# pkg-config integration; primarily used by X.Org
# We don't support arbitrary CFLAGS yet (just includes)
$(foreach _package,$($(THIS_MODULE)_packages),\
$(eval MODULE_INCLUDE_FLAGS += `pkg-config --cflags-only-I $(_package)`)\
$(eval MODULE_LIBRARY_FLAGS += `pkg-config --libs-only-l $(_package)`)\
$(eval MODULE_LIBRARY_DIR_FLAGS += `pkg-config --libs-only-L $(_package)`))

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,117 +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.
#@Description Common processing for all modules that compile code.
### ###########################################################################
# Filter for source types
MODULE_C_SOURCES := $(filter %.c,$(MODULE_SOURCES))
MODULE_CXX_SOURCES := $(call filter-cxx-files,$(MODULE_SOURCES))
MODULE_UNRECOGNISED_SOURCES := $(call filter-out-cxx-files,$(filter-out %.c,$(MODULE_SOURCES)))
ifneq ($(strip $(MODULE_UNRECOGNISED_SOURCES)),)
$(error In makefile $(THIS_MAKEFILE): Module $(THIS_MODULE) specified source files with unrecognised suffixes: $(MODULE_UNRECOGNISED_SOURCES))
endif
# Objects built from MODULE_SOURCES
MODULE_C_OBJECTS := $(addprefix $(MODULE_INTERMEDIATES_DIR)/,$(notdir $(MODULE_C_SOURCES:.c=.o)))
MODULE_CXX_OBJECTS := $(addprefix $(MODULE_INTERMEDIATES_DIR)/,$(notdir $(call objects-from-cxx-files,$(MODULE_CXX_SOURCES))))
# MODULE_GENERATED_DEPENDENCIES are generated as a side effect of running the
# rules below, but if we wanted to generate .d files for things that GCC
# couldn't handle, we could add a rule with $(MODULE_GENERATED_DEPENDENCIES)
# as a target
MODULE_GENERATED_DEPENDENCIES := $(MODULE_C_OBJECTS:.o=.d) $(MODULE_CXX_OBJECTS:.o=.d)
-include $(MODULE_GENERATED_DEPENDENCIES)
MODULE_DEPENDS := $(addprefix $(MODULE_OUT)/,$($(THIS_MODULE)_depends))
MODULE_DEPENDS += $(addprefix $(GENERATED_CODE_OUT)/,$($(THIS_MODULE)_genheaders))
# Add any MODULE_OUT relative include flags here
MODULE_INCLUDE_FLAGS += $(addprefix -I $(MODULE_OUT)/, $($(THIS_MODULE)_includes_relative))
define rule-for-objects-o-from-one-c
$(1): MODULE_CC := $$(MODULE_CC)
$(1): MODULE_CFLAGS := $$(MODULE_CFLAGS)
$(1): MODULE_INCLUDE_FLAGS := $$(MODULE_INCLUDE_FLAGS)
$(1): MODULE_ALLOWED_CFLAGS := $$(MODULE_ALLOWED_CFLAGS)
$(1): THIS_MODULE := $$(THIS_MODULE)
ifneq ($(PKG_CONFIG_ENV_VAR),)
$(1): export PKG_CONFIG_TOP_BUILD_DIR := $(abspath $(MODULE_OUT))
$(1): export $(PKG_CONFIG_ENV_VAR) := $(abspath $(MODULE_OUT)/lws_pkgconfig)
endif
$(1): $$(MODULE_DEPENDS) $$(THIS_MAKEFILE)
$(1): | $$(MODULE_INTERMEDIATES_DIR)
$(1): $(2)
@: $(if $(MODULE_CHECK_CFLAGS),
$(if $(filter-out $(MODULE_ALLOWED_CFLAGS),$($(THIS_MODULE)_cflags)),\
$(error $(THIS_MODULE): LTO-incompatible cflag(s) used: \
$(filter-out $(MODULE_ALLOWED_CFLAGS),$($(THIS_MODULE)_cflags)))))
$$(check-src)
ifeq ($(MODULE_HOST_BUILD),true)
$$(host-o-from-one-c)
else
$$(target-o-from-one-c)
endif
endef
# This rule is used to compile C++ source files
define rule-for-objects-o-from-one-cxx
$(1): MODULE_CXX := $$(MODULE_CXX)
$(1): MODULE_CXXFLAGS := $$(MODULE_CXXFLAGS)
$(1): MODULE_INCLUDE_FLAGS := $$(MODULE_INCLUDE_FLAGS)
$(1): MODULE_ALLOWED_CFLAGS := $$(MODULE_ALLOWED_CFLAGS)
$(1): THIS_MODULE := $$(THIS_MODULE)
ifneq ($(PKG_CONFIG_ENV_VAR),)
$(1): export PKG_CONFIG_TOP_BUILD_DIR := $(abspath $(MODULE_OUT))
$(1): export $(PKG_CONFIG_ENV_VAR) := $(abspath $(MODULE_OUT)/lws_pkgconfig)
endif
$(1): $$(MODULE_DEPENDS) $$(THIS_MAKEFILE)
$(1): | $$(MODULE_INTERMEDIATES_DIR)
$(1): $(2)
@: $(if $(MODULE_CHECK_CFLAGS),
$(if $(filter-out $(MODULE_ALLOWED_CFLAGS),$($(THIS_MODULE)_cxxflags)),\
$(error $(THIS_MODULE): LTO-incompatible cxxflag(s) used: \
$(filter-out $(MODULE_ALLOWED_CFLAGS),$($(THIS_MODULE)_cxxflags)))))
ifeq ($(MODULE_HOST_BUILD),true)
$$(host-o-from-one-cxx)
else
$$(target-o-from-one-cxx)
endif
endef

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,139 +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.7.4.5
RGX_BVNC ?= 1.82.4.5
include ../common/android/paths.mk
include ../common/android/arch.mk
include ../common/android/features.mk
ifeq ($(SUPPORT_ADF),1)
ifneq ($(is_future_version),1)
SYS_INCLUDES += \
-isystem $(ANDROID_ROOT)/device/img/pc/adf/libadf/include \
-isystem $(ANDROID_ROOT)/device/img/pc/adf/libadfhwc/include
endif
endif
ifeq ($(NO_HARDWARE),1)
LDM_PLATFORM := 1
PVR_SYSTEM := rgx_nohw
# If we end up using dc_fbdev, Android always wants to be
# triple buffered in when running in pure-software mode.
DC_FBDEV_NUM_PREFERRED_BUFFERS := 3
else
ifeq ($(SUPPORT_ADF),1)
PVR_LDM_PLATFORM_PRE_REGISTERED := 1
LMA := 1
LDM_PLATFORM := 1
PVR_SYSTEM := rgx_linux_apollo
SUPPORT_SYSTEM_INTERRUPT_HANDLING := 1
ION_DEFAULT_HEAP_ID_MASK := (1 << (ION_HEAP_TYPE_CUSTOM + 2))
else
LDM_PCI := 1
PVR_SYSTEM := rgx_tc
TC_MEMORY_CONFIG := TC_MEMORY_LOCAL
SUPPORT_SYSTEM_INTERRUPT_HANDLING := 1
endif
endif
ifeq ($(SUPPORT_ADF),1)
ifneq ($(NO_HARDWARE),1)
DISPLAY_CONTROLLER ?= adf_pdp
endif
else
ifeq ($(NO_HARDWARE),1)
DISPLAY_CONTROLLER ?= dc_example
else
DISPLAY_CONTROLLER ?= dc_pdp
endif
endif
ifeq ($(DISPLAY_CONTROLLER),adf_pdp)
ADF_PDP_WIDTH ?= 1280
ADF_PDP_HEIGHT ?= 720
KERNEL_COMPONENTS += apollo
endif
KERNEL_COMPONENTS += $(DISPLAY_CONTROLLER)
CACHEFLUSH_TYPE ?= CACHEFLUSH_X86
PVR_ANDROID_DEFER_CLEAR ?= 1
ifeq ($(PVR_SYSTEM),rgx_tc)
ifeq ($(TC_MEMORY_CONFIG),TC_MEMORY_LOCAL)
LMA := 1
# Tell ion that we want memory from the test chip local memory
# heap. The choice of ION_HEAP_TYPE_CUSTOM+1 as the ID is
# arbitrary, but it has to match the one specified in the
# TC-specific ion support code.
ION_DEFAULT_HEAP_ID_MASK := 1 << (ION_HEAP_TYPE_CUSTOM + 1)
endif
endif
ifeq ($(DISPLAY_CONTROLLER),dc_pdp)
DCPDP_WIDTH ?= 1280
DCPDP_HEIGHT ?= 720
DCPDP_NO_INTERRUPTS ?= 1
endif
include ../config/core.mk
include ../common/android/extra_config.mk
include ../common/pvrgdb.mk
include ../common/3rdparty.mk
include ../common/testchip.mk

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,341 +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 \
-DSUPPORT_DRM_DC_MODULE=1
endif
ifeq ($(PDUMP),1)
M4DEFS_K += -DPDUMP=1
endif
ifneq ($(DISPLAY_CONTROLLER),)
$(eval $(call if-kernel-component,$(DISPLAY_CONTROLLER),\
-DDISPLAY_CONTROLLER=$(DISPLAY_CONTROLLER)))
endif
# These defs are not derived from user variables
#
M4DEFS := \
-DSOLIB_VERSION=$(PVRVERSION_MAJ).$(PVRVERSION_MIN).$(PVRVERSION_BUILD)
# XOrg support options are convoluted, so don't bother with if-component.
ifneq ($(filter pvr_video,$(COMPONENTS)),) # This is an X build
M4DEFS += -DSUPPORT_LWS=1
M4DEFS += -DSUPPORT_XORG=1
M4DEFS += -DXORG_EXPLICIT_PVR_SERVICES_LOAD=$(XORG_EXPLICIT_PVR_SERVICES_LOAD)
ifneq ($(XORG_WAYLAND),1)
M4DEFS += -DXORG_WAYLAND=1
endif
ifeq ($(LWS_NATIVE),1)
M4DEFS += -DPVR_XORG_DESTDIR=/usr/bin
M4DEFS += -DPVR_CONF_DESTDIR=/etc/X11
$(eval $(call if-component,opengl_mesa,-DSUPPORT_MESA=1))
else
M4DEFS += -DLWS_INSTALL_TREE=1
M4DEFS += -DPVR_XORG_DESTDIR=$(LWS_PREFIX)/bin
M4DEFS += -DPVR_CONF_DESTDIR=$(LWS_PREFIX)/etc/X11
$(eval $(call if-component,pvr_input, -DSUPPORT_DDX_INPUT=1))
$(eval $(call if-component,opengl_mesa,-DSUPPORT_LIBGL=1 -DSUPPORT_MESA=1))
endif
else # This is a non-X build
ifneq ($(filter pvr_dri,$(COMPONENTS)),) # This is a Wayland build
M4DEFS += -DSUPPORT_LWS=1
M4DEFS += -DSUPPORT_WAYLAND=1
ifeq ($(LWS_NATIVE),1)
else
M4DEFS += -DLWS_INSTALL_TREE=1
endif
else # This is a non-X and Wayland build
$(eval $(call if-component,opengl,-DSUPPORT_LIBGL=1))
endif
endif
# Map other COMPONENTS on to SUPPORT_ defs
#
$(eval $(call if-component,opengles1,\
-DSUPPORT_OPENGLES1=1 -DOGLES1_MODULE=$(opengles1_target) \
-DSUPPORT_OPENGLES1_V1_ONLY=0))
$(eval $(call if-component,opengles3,\
-DSUPPORT_OPENGLES3=1 -DOGLES3_MODULE=$(opengles3_target)))
$(eval $(call if-component,egl,\
-DSUPPORT_LIBEGL=1 -DEGL_MODULE=$(egl_target)))
$(eval $(call if-component,glslcompiler,\
-DSUPPORT_SOURCE_SHADER=1))
$(eval $(call if-component,opencl,\
-DSUPPORT_OPENCL=1))
$(eval $(call if-component,liboclcompiler,\
-DSUPPORT_OCL_COMPILER=1))
$(eval $(call if-component,openrl,\
-DSUPPORT_OPENRL=1))
$(eval $(call if-component,rscompute,\
-DSUPPORT_RSC=1))
$(eval $(call if-component,librscruntime,\
-DSUPPORT_RSC_RUNTIME=1))
$(eval $(call if-component,librsccompiler,\
-DSUPPORT_RSC_COMPILER=1))
$(eval $(call if-component,opengl opengl_mesa,\
-DSUPPORT_OPENGL=1))
$(eval $(call if-component,null_ws,\
-DSUPPORT_NULL_WS=1))
$(eval $(call if-component,null_drm_ws,\
-DSUPPORT_NULL_DRM_WS=1 \
-DSUPPORT_LWS=1 \
-DLWS_INSTALL_TREE=1))
$(eval $(call if-component,null_remote,\
-DSUPPORT_NULL_REMOTE=1))
$(eval $(call if-component,null_adf_ws,\
-DSUPPORT_NULL_ADF_WS=1))
$(eval $(call if-component,ews_ws,\
-DSUPPORT_EWS=1))
$(eval $(call if-component,ews_wm,\
-DSUPPORT_LUA=1))
$(eval $(call if-component,graphicshal,\
-DSUPPORT_GRAPHICS_HAL=1))
$(eval $(call if-component,xmultiegltest,\
-DSUPPORT_XUNITTESTS=1))
$(eval $(call if-component,pvrgdb,\
-DPVRGDB=1))
ifeq ($(PVR_REMOTE),1)
M4DEFS += -DPVR_REMOTE=1
endif
ifneq ($(filter pvr_dri,$(COMPONENTS)),)
M4DEFS += -DPVR_DRI_MODULE=1
endif
# Build UM script using old scheme using M4
define create-install-um-script-m4
$(RELATIVE_OUT)/$(1)/install_um.sh: $(PVRVERSION_H) $(CONFIG_MK) \
$(MAKE_TOP)/scripts/common.m4 \
$(MAKE_TOP)/$(PVR_BUILD_DIR)/install_um.sh.m4 \
| $(RELATIVE_OUT)/$(1)
$$(if $(V),,@echo " GEN " $$(call relative-to-top,$$@))
$(M4) $(M4FLAGS) $(M4DEFS) $(M4DEFS_K) \
$(MAKE_TOP)/scripts/common.m4 \
$(MAKE_TOP)/$(PVR_BUILD_DIR)/install_um.sh.m4 > $$@
install_script: $(RELATIVE_OUT)/$(1)/install_um.sh
endef
$(foreach _t,$(TARGET_ALL_ARCH),$(eval $(call create-install-um-script-m4,$(_t))))
$(TARGET_PRIMARY_OUT)/rc.pvr: $(PVRVERSION_H) $(CONFIG_MK) $(CONFIG_KERNEL_MK) \
$(MAKE_TOP)/scripts/rc.pvr.m4 $(MAKE_TOP)/scripts/common.m4 \
$(MAKE_TOP)/$(PVR_BUILD_DIR)/rc.pvr.m4 \
| $(TARGET_PRIMARY_OUT)
$(if $(V),,@echo " GEN " $(call relative-to-top,$@))
$(M4) $(M4FLAGS) $(M4DEFS) $(M4DEFS_K) $(MAKE_TOP)/scripts/rc.pvr.m4 \
$(MAKE_TOP)/$(PVR_BUILD_DIR)/rc.pvr.m4 > $@
$(CHMOD) +x $@
init_script: $(TARGET_PRIMARY_OUT)/rc.pvr
$(TARGET_PRIMARY_OUT)/udev.pvr: $(CONFIG_KERNEL_MK) \
$(MAKE_TOP)/scripts/udev.pvr.m4 \
| $(TARGET_PRIMARY_OUT)
$(if $(V),,@echo " GEN " $(call relative-to-top,$@))
$(M4) $(M4FLAGS) $(M4DEFS_K) $(MAKE_TOP)/scripts/udev.pvr.m4 > $@
udev_rules: $(TARGET_PRIMARY_OUT)/udev.pvr
endif # ifeq ($(SUPPORT_ANDROID_PLATFORM),)
# This code mimics the way Make processes our implicit/explicit goal list.
# It tries to build up a list of components that were actually built, from
# whence an install script is generated.
#
ifneq ($(MAKECMDGOALS),)
BUILT_UM := $(MAKECMDGOALS)
ifneq ($(filter build services_all components,$(MAKECMDGOALS)),)
BUILT_UM += $(COMPONENTS)
endif
BUILT_UM := $(sort $(filter $(ALL_MODULES) xorg wl,$(BUILT_UM)))
else
BUILT_UM := $(sort $(COMPONENTS))
endif
ifneq ($(MAKECMDGOALS),)
BUILT_KM := $(MAKECMDGOALS)
ifneq ($(filter build services_all kbuild,$(MAKECMDGOALS)),)
BUILT_KM += $(KERNEL_COMPONENTS)
endif
BUILT_KM := $(sort $(filter $(ALL_MODULES),$(BUILT_KM)))
else
BUILT_KM := $(sort $(KERNEL_COMPONENTS))
endif
INSTALL_UM_MODULES := \
$(strip $(foreach _m,$(BUILT_UM),\
$(if $(filter doc module_group,$($(_m)_type)),,\
$(if $(filter host_%,$($(_m)_arch)),,\
$(if $($(_m)_install_path),$(_m),\
$(warning WARNING: UM $(_m)_install_path not defined))))))
# Build up a list of installable shared libraries. The shared_library module
# type is specially guaranteed to define $(_m)_target, even if the Linux.mk
# itself didn't. The list is formatted with <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,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,291 +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
ifeq ($(SUPPORT_NEUTRINO_PLATFORM),1)
include $(MAKE_TOP)/common/neutrino/subst_makefiles.mk
endif
unexport ALL_MAKEFILES
REMAINING_MAKEFILES := $(ALL_MAKEFILES)
ALL_MODULES :=
INTERNAL_INCLUDED_ALL_MAKEFILES :=
ALL_LDFLAGS :=
# Please do not change the format of the following lines
-include $(CONFIG_MK)
-include $(CONFIG_KERNEL_MK)
# OK to change now
# If we haven't set host/target archs, set some sensible defaults now.
# This allows things like prune.sh to work
ifeq ($(HOST_PRIMARY_ARCH),)
ifneq ($(FORCE_ARCH),)
HOST_PRIMARY_ARCH := host_i386
HOST_32BIT_ARCH := host_i386
TARGET_PRIMARY_ARCH := target_i686
TARGET_ALL_ARCH := target_i686
endif
endif
# Output directory for configuration, object code,
# final programs/libraries, and install/rc scripts.
HOST_OUT := $(RELATIVE_OUT)/$(HOST_PRIMARY_ARCH)
HOST_32BIT_OUT := $(RELATIVE_OUT)/$(HOST_32BIT_ARCH)
TARGET_OUT := $(RELATIVE_OUT)/$(TARGET_PRIMARY_ARCH)
TARGET_PRIMARY_OUT := $(RELATIVE_OUT)/$(TARGET_PRIMARY_ARCH)
TARGET_NEUTRAL_OUT := $(RELATIVE_OUT)/target_neutral
BRIDGE_SOURCE_ROOT := $(call if-exists,$(TOP)/generated,$(TARGET_NEUTRAL_OUT)/intermediates)
GENERATED_CODE_OUT := $(TARGET_NEUTRAL_OUT)/intermediates
DOCS_OUT := $(RELATIVE_OUT)/doc
# Mark subdirectories of $(OUT) as secondary, and provide rules to create
# them.
OUT_SUBDIRS := $(addprefix $(RELATIVE_OUT)/,$(TARGET_ALL_ARCH)) \
$(TARGET_NEUTRAL_OUT) $(DOCS_OUT) $(if $(HOST_PRIMARY_ARCH),$(sort $(HOST_OUT) $(HOST_32BIT_OUT)))
.SECONDARY: $(OUT_SUBDIRS)
$(OUT_SUBDIRS):
$(make-directory)
ifneq ($(INTERNAL_CLOBBER_ONLY),true)
-include $(MAKE_TOP)/pvrversion.mk
ifeq ($(SUPPORT_BUILD_LWS),1)
-include $(MAKE_TOP)/lwsconf.mk
endif
-include $(MAKE_TOP)/llvm.mk
-include $(MAKE_TOP)/common/bridges.mk
endif
include $(MAKE_TOP)/commands.mk
include $(MAKE_TOP)/buildvars.mk
HOST_INTERMEDIATES := $(HOST_OUT)/intermediates
TARGET_INTERMEDIATES := $(TARGET_OUT)/intermediates
ifneq ($(KERNEL_COMPONENTS),)
build: kbuild
endif
# "make bridges" makes all the modules which are bridges. This is used by
# builds which ship pregenerated bridge headers.
.PHONY: bridges
bridges:
# Include each Linux.mk, then include modules.mk to save some information
# about each module
include $(foreach _Linux.mk,$(ALL_MAKEFILES),$(MAKE_TOP)/this_makefile.mk $(_Linux.mk) $(MAKE_TOP)/modules.mk)
ifeq ($(strip $(REMAINING_MAKEFILES)),)
INTERNAL_INCLUDED_ALL_MAKEFILES := true
else
$(error Impossible: $(words $(REMAINING_MAKEFILES)) makefiles were mysteriously ignored when reading $$(ALL_MAKEFILES))
endif
# At this point, all Linux.mks have been included. Now generate rules to build
# each module: for each module in $(ALL_MODULES), set per-makefile variables
$(foreach _m,$(ALL_MODULES),$(eval $(call process-module,$(_m))))
.PHONY: kbuild install
kbuild install:
ifneq ($(INTERNAL_CLOBBER_ONLY),true)
-include $(MAKE_TOP)/scripts.mk
-include $(MAKE_TOP)/kbuild/kbuild.mk
endif
# We won't depend on 'build' here so that people can build subsets of
# components and still have the install script attempt to install the
# subset.
install:
@if [ ! -d "$(DISCIMAGE)" ]; then \
echo; \
echo "** DISCIMAGE was not set or does not point to a valid directory."; \
echo "** Cannot continue with install."; \
echo; \
exit 1; \
fi
@if [ ! -f $(RELATIVE_OUT)/install.sh ]; then \
echo; \
echo "** install.sh not found in $(RELATIVE_OUT)."; \
echo "** Cannot continue with install."; \
echo; \
exit 1; \
fi
@cd $(RELATIVE_OUT) && ./install.sh
.PHONY: uninstall
uninstall: install_script
uninstall:
@if [ ! -d "$(DISCIMAGE)" ]; then \
echo; \
echo "** DISCIMAGE was not set or does not point to a valid directory."; \
echo "** Cannot continue with uninstall."; \
echo; \
exit 1; \
fi
@if [ ! -f $(RELATIVE_OUT)/install.sh ]; then \
echo; \
echo "** install.sh not found in $(RELATIVE_OUT)."; \
echo "** Cannot continue with uninstall."; \
echo; \
exit 1; \
fi
@cd $(RELATIVE_OUT) && ./install.sh -u
# You can say 'make all_modules' to attempt to make everything, or 'make
# components' to only make the things which are listed (in the per-build
# makefiles) as components of the build.
.PHONY: all_modules all_docs components
all_modules: $(ALL_MODULES)
all_docs: ;
components: $(COMPONENTS)
# Cleaning
.PHONY: clean clobber
clean: MODULE_DIRS_TO_REMOVE := $(OUT_SUBDIRS)
clean:
$(clean-dirs)
clobber: MODULE_DIRS_TO_REMOVE := $(OUT)
clobber:
$(clean-dirs)
# Saying 'make clean-MODULE' removes the intermediates for MODULE.
# clobber-MODULE deletes the output files as well
clean-%:
$(if $(V),,@echo " RM " $(call relative-to-top,$(INTERNAL_CLEAN_TARGETS_FOR_$*)))
$(RM) -rf $(INTERNAL_CLEAN_TARGETS_FOR_$*)
clobber-%:
$(if $(V),,@echo " RM " $(call relative-to-top,$(INTERNAL_CLOBBER_TARGETS_FOR_$*)))
$(RM) -rf $(INTERNAL_CLOBBER_TARGETS_FOR_$*)
include $(MAKE_TOP)/bits.mk
# D=nobuild stops the build before any recipes are run. This line should
# come at the end of this makefile.
$(if $(filter nobuild,$(D)),$(error D=nobuild given),)

View File

@@ -1,35 +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 PVR_SECURE_HANDLES
#define RELEASE
#define RGX_BVNC_CORE_KM_HEADER "cores/rgxcore_km_5.9.1.46.h"
#define RGX_BNC_CONFIG_KM_HEADER "configs/rgxconfig_km_5.V.1.46.h"
#define SUPPORT_DBGDRV_EVENT_OBJECTS
#define SYS_USING_INTERRUPTS
#define CACHEFLUSH_TYPE CACHEFLUSH_GENERIC
#define SUPPORT_INSECURE_EXPORT
#define SUPPORT_SECURE_EXPORT
#define SUPPORT_GPUTRACE_EVENTS
#define SUPPORT_LINUX_X86_WRITECOMBINE
#define SUPPORT_LINUX_X86_PAT
#define PVR_LINUX_USING_WORKQUEUES
#define PVR_LINUX_MISR_USING_PRIVATE_WORKQUEUE
#define PVR_LINUX_TIMERS_USING_WORKQUEUES
#define PVR_LDM_PLATFORM_PRE_REGISTERED
#define PVR_LDM_DRIVER_REGISTRATION_NAME "pvrsrvkm"
#define LDM_PLATFORM
#define PVRSRV_ENABLE_PROCESS_STATS
#define PVR_LINUX_PYSMEM_MAX_POOL_PAGES 10240
#define PVR_LINUX_ARM_PAGEALLOC_FLUSH_THRESHOLD 256
#define PVR_LINUX_VMALLOC_ALLOCATION_THRESHOLD 16384
#define ANDROID
#define PVR_ANDROID_NATIVE_WINDOW_HAS_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/kernel
override KERNEL_ID := 3.10.0
override KERNEL_COMPONENTS := srvkm
override KERNEL_CROSS_COMPILE := /work/zxl/project/rk3368/prebuilts/gcc/linux-x86/aarch64/aarch64-linux-android-4.9/bin/aarch64-linux-android-
override SUPPORT_ION := 1
override PVRSRV_MODNAME := pvrsrvkm
override PVR_BUILD_DIR := generic_arm_android
override PVR_BUILD_TYPE := release
override PVR_SYSTEM := rk3368
override BUILD := release
override DEBUGLINK := 1
override CACHEFLUSH_TYPE := CACHEFLUSH_GENERIC
override SUPPORT_INSECURE_EXPORT := 1
override SUPPORT_SECURE_EXPORT := 1
override SUPPORT_GPUTRACE_EVENTS := 1
override OPTIM := -O2
override PVR_HANDLE_BACKEND := generic
override SUPPORT_ANDROID_PLATFORM := 1
override PVR_ANDROID_NATIVE_WINDOW_HAS_SYNC := 1

View File

@@ -1,49 +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.
### ###########################################################################
ccflags-y += \
-I$(TOP)/services/3rdparty/dc_fbdev
dc_fbdev-y += \
services/3rdparty/dc_fbdev/dc_fbdev.o
ifneq ($(W),1)
#CFLAGS_dc_fbdev.o := -Werror
endif

View File

@@ -1,45 +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.
### ###########################################################################
modules := dc_fbdev
dc_fbdev_type := kernel_module
dc_fbdev_target := dc_fbdev.ko
dc_fbdev_makefile := $(THIS_DIR)/Kbuild.mk

View File

@@ -1,893 +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.
*/ /**************************************************************************/
#include <linux/version.h>
#include <linux/console.h>
#include <linux/module.h>
#include <linux/fb.h>
#include "kerneldisplay.h"
#include "imgpixfmts_km.h"
#include "pvrmodule.h" /* for MODULE_LICENSE() */
#if !defined(CONFIG_FB)
#error dc_fbdev needs Linux framebuffer support. Enable it in your kernel.
#endif
#define DRVNAME "dc_fbdev"
#define DC_PHYS_HEAP_ID 0
#define MAX_COMMANDS_IN_FLIGHT 2
#if defined(DC_FBDEV_NUM_PREFERRED_BUFFERS)
#define NUM_PREFERRED_BUFFERS DC_FBDEV_NUM_PREFERRED_BUFFERS
#else
#define NUM_PREFERRED_BUFFERS 2
#endif
#define FALLBACK_REFRESH_RATE 60
#define FALLBACK_DPI 160
struct fb_var_screeninfo sDefaultVar; //chenli: store default fb_var_screeninfo
typedef struct
{
IMG_HANDLE hSrvHandle;
IMG_UINT32 ePixFormat;
struct fb_info *psLINFBInfo;
bool bCanFlip;
}
DC_FBDEV_DEVICE;
typedef struct
{
DC_FBDEV_DEVICE *psDeviceData;
IMG_HANDLE hLastConfigData;
IMG_UINT32 ui32AllocUseMask;
}
DC_FBDEV_CONTEXT;
typedef struct
{
DC_FBDEV_CONTEXT *psDeviceContext;
IMG_UINT32 ui32Width;
IMG_UINT32 ui32Height;
IMG_UINT32 ui32ByteStride;
IMG_UINT32 ui32BufferID;
}
DC_FBDEV_BUFFER;
MODULE_SUPPORTED_DEVICE(DEVNAME);
static DC_FBDEV_DEVICE *gpsDeviceData;
#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,29))
static inline void console_lock(void)
{
acquire_console_sem();
}
static inline void console_unlock(void)
{
release_console_sem();
}
#endif
static
void DC_FBDEV_GetInfo(IMG_HANDLE hDeviceData,
DC_DISPLAY_INFO *psDisplayInfo)
{
PVR_UNREFERENCED_PARAMETER(hDeviceData);
strncpy(psDisplayInfo->szDisplayName, DRVNAME " 1", DC_NAME_SIZE);
psDisplayInfo->ui32MinDisplayPeriod = 0;
psDisplayInfo->ui32MaxDisplayPeriod = 1;
psDisplayInfo->ui32MaxPipes = 1;
psDisplayInfo->bUnlatchedSupported = IMG_FALSE;
}
static
PVRSRV_ERROR DC_FBDEV_PanelQueryCount(IMG_HANDLE hDeviceData,
IMG_UINT32 *pui32NumPanels)
{
PVR_UNREFERENCED_PARAMETER(hDeviceData);
*pui32NumPanels = 1;
return PVRSRV_OK;
}
static
PVRSRV_ERROR DC_FBDEV_PanelQuery(IMG_HANDLE hDeviceData,
IMG_UINT32 ui32PanelsArraySize,
IMG_UINT32 *pui32NumPanels,
PVRSRV_PANEL_INFO *psPanelInfo)
{
DC_FBDEV_DEVICE *psDeviceData = hDeviceData;
struct fb_var_screeninfo *psVar = &psDeviceData->psLINFBInfo->var;
struct fb_var_screeninfo sVar = { .pixclock = 0 };
if(!lock_fb_info(psDeviceData->psLINFBInfo))
return PVRSRV_ERROR_RETRY;
*pui32NumPanels = 1;
psPanelInfo[0].sSurfaceInfo.sFormat.ePixFormat = psDeviceData->ePixFormat;
psPanelInfo[0].sSurfaceInfo.sDims.ui32Width = psVar->xres;
psPanelInfo[0].sSurfaceInfo.sDims.ui32Height = psVar->yres;
psPanelInfo[0].sSurfaceInfo.sFormat.eMemLayout = PVRSRV_SURFACE_MEMLAYOUT_STRIDED;
psPanelInfo[0].sSurfaceInfo.sFormat.u.sFBCLayout.eFBCompressionMode = FB_COMPRESSION_NONE;
/* Conformant fbdev drivers should have `var' and mode in sync by now,
* but some don't (like drmfb), so try a couple of different ways to
* get the info before falling back to the default.
*/
if(psVar->xres > 0 && psVar->yres > 0 && psVar->pixclock > 0)
sVar = *psVar;
else if(psDeviceData->psLINFBInfo->mode)
fb_videomode_to_var(&sVar, psDeviceData->psLINFBInfo->mode);
/* Override the refresh rate when defined. */
#ifdef DC_FBDEV_REFRESH
psPanelInfo[0].ui32RefreshRate = DC_FBDEV_REFRESH;
#else
if(sVar.xres > 0 && sVar.yres > 0 && sVar.pixclock > 0)
{
psPanelInfo[0].ui32RefreshRate = 1000000000LU /
((sVar.upper_margin + sVar.lower_margin +
sVar.yres + sVar.vsync_len) *
(sVar.left_margin + sVar.right_margin +
sVar.xres + sVar.hsync_len) *
(sVar.pixclock / 1000));
}
else
psPanelInfo[0].ui32RefreshRate = FALLBACK_REFRESH_RATE;
#endif
psPanelInfo[0].ui32XDpi =
((int)sVar.width > 0) ? (254000 / sVar.width * psVar->xres / 10000) : FALLBACK_DPI;
psPanelInfo[0].ui32YDpi =
((int)sVar.height > 0) ? 254000 / sVar.height * psVar->yres / 10000 : FALLBACK_DPI;
unlock_fb_info(psDeviceData->psLINFBInfo);
return PVRSRV_OK;
}
static
PVRSRV_ERROR DC_FBDEV_FormatQuery(IMG_HANDLE hDeviceData,
IMG_UINT32 ui32NumFormats,
PVRSRV_SURFACE_FORMAT *pasFormat,
IMG_UINT32 *pui32Supported)
{
DC_FBDEV_DEVICE *psDeviceData = hDeviceData;
int i;
for(i = 0; i < ui32NumFormats; i++)
{
pui32Supported[i] = 0;
if(pasFormat[i].ePixFormat == psDeviceData->ePixFormat)
pui32Supported[i]++;
}
return PVRSRV_OK;
}
static
PVRSRV_ERROR DC_FBDEV_DimQuery(IMG_HANDLE hDeviceData,
IMG_UINT32 ui32NumDims,
PVRSRV_SURFACE_DIMS *psDim,
IMG_UINT32 *pui32Supported)
{
DC_FBDEV_DEVICE *psDeviceData = hDeviceData;
struct fb_var_screeninfo *psVar = &psDeviceData->psLINFBInfo->var;
int i;
if(!lock_fb_info(psDeviceData->psLINFBInfo))
return PVRSRV_ERROR_RETRY;
for(i = 0; i < ui32NumDims; i++)
{
pui32Supported[i] = 0;
if(psDim[i].ui32Width == psVar->xres &&
psDim[i].ui32Height == psVar->yres)
pui32Supported[i]++;
}
unlock_fb_info(psDeviceData->psLINFBInfo);
return PVRSRV_OK;
}
static
PVRSRV_ERROR DC_FBDEV_ContextCreate(IMG_HANDLE hDeviceData,
IMG_HANDLE *hDisplayContext)
{
DC_FBDEV_CONTEXT *psDeviceContext;
PVRSRV_ERROR eError = PVRSRV_OK;
psDeviceContext = kzalloc(sizeof(DC_FBDEV_CONTEXT), GFP_KERNEL);
if(!psDeviceContext)
{
eError = PVRSRV_ERROR_OUT_OF_MEMORY;
goto err_out;
}
psDeviceContext->psDeviceData = hDeviceData;
*hDisplayContext = psDeviceContext;
err_out:
return eError;
}
static PVRSRV_ERROR
DC_FBDEV_ContextConfigureCheck(IMG_HANDLE hDisplayContext,
IMG_UINT32 ui32PipeCount,
PVRSRV_SURFACE_CONFIG_INFO *pasSurfAttrib,
IMG_HANDLE *ahBuffers)
{
DC_FBDEV_CONTEXT *psDeviceContext = hDisplayContext;
DC_FBDEV_DEVICE *psDeviceData = psDeviceContext->psDeviceData;
struct fb_var_screeninfo *psVar = &psDeviceData->psLINFBInfo->var;
DC_FBDEV_BUFFER *psBuffer;
PVRSRV_ERROR eError;
if(ui32PipeCount != 1)
{
eError = PVRSRV_ERROR_DC_TOO_MANY_PIPES;
goto err_out;
}
if(!ahBuffers)
{
eError = PVRSRV_ERROR_DC_INVALID_CONFIG;
goto err_out;
}
if(!lock_fb_info(psDeviceData->psLINFBInfo))
{
eError = PVRSRV_ERROR_RETRY;
goto err_out;
}
psBuffer = ahBuffers[0];
if(pasSurfAttrib[0].sCrop.sDims.ui32Width != psVar->xres ||
pasSurfAttrib[0].sCrop.sDims.ui32Height != psVar->yres ||
pasSurfAttrib[0].sCrop.i32XOffset != 0 ||
pasSurfAttrib[0].sCrop.i32YOffset != 0)
{
eError = PVRSRV_ERROR_DC_INVALID_CROP_RECT;
goto err_unlock;
}
if(pasSurfAttrib[0].sDisplay.sDims.ui32Width !=
pasSurfAttrib[0].sCrop.sDims.ui32Width ||
pasSurfAttrib[0].sDisplay.sDims.ui32Height !=
pasSurfAttrib[0].sCrop.sDims.ui32Height ||
pasSurfAttrib[0].sDisplay.i32XOffset !=
pasSurfAttrib[0].sCrop.i32XOffset ||
pasSurfAttrib[0].sDisplay.i32YOffset !=
pasSurfAttrib[0].sCrop.i32YOffset)
{
eError = PVRSRV_ERROR_DC_INVALID_DISPLAY_RECT;
goto err_unlock;
}
if(psBuffer->ui32Width != psVar->xres &&
psBuffer->ui32Height != psVar->yres)
{
eError = PVRSRV_ERROR_DC_INVALID_BUFFER_DIMS;
goto err_unlock;
}
eError = PVRSRV_OK;
err_unlock:
unlock_fb_info(psDeviceData->psLINFBInfo);
err_out:
return eError;
}
static int DumpFbInfo( struct fb_var_screeninfo *info)
{
#if 0
printk("dump: vir[%d,%d] [%d,%d,%d,%d] format=%d \n",
info->xres_virtual,info->yres_virtual,
info->xoffset,
info->yoffset,
info->xres,
info->yres,
(info->nonstd & 0xff));
#endif
return 0;
}
static
void DC_FBDEV_ContextConfigure(IMG_HANDLE hDisplayContext,
IMG_UINT32 ui32PipeCount,
PVRSRV_SURFACE_CONFIG_INFO *pasSurfAttrib,
IMG_HANDLE *ahBuffers,
IMG_UINT32 ui32DisplayPeriod,
IMG_HANDLE hConfigData)
{
DC_FBDEV_CONTEXT *psDeviceContext = hDisplayContext;
DC_FBDEV_DEVICE *psDeviceData = psDeviceContext->psDeviceData;
struct fb_var_screeninfo sVar = psDeviceData->psLINFBInfo->var;
int err;
IMG_BOOL bReset=false;
PVR_UNREFERENCED_PARAMETER(ui32PipeCount);
PVR_UNREFERENCED_PARAMETER(pasSurfAttrib);
PVR_UNREFERENCED_PARAMETER(ui32DisplayPeriod);
if(psDeviceContext->hLastConfigData)
DCDisplayConfigurationRetired(psDeviceContext->hLastConfigData);
sVar.yoffset = 0;
//chenli: if current FB's format is not RGBX_8888, reset fb_var_screeninfo
if((sVar.nonstd & 0xff) != (sDefaultVar.nonstd & 0xff))
{
DumpFbInfo(&sDefaultVar);
sVar = sDefaultVar;
bReset = true;
}
if(ui32PipeCount == 0)
{
/* If the pipe count is zero, we're tearing down. Don't record
* any new configurations, but still allow the display to pan
* back to buffer 0.
*/
psDeviceContext->hLastConfigData = IMG_NULL;
/*
We still need to "retire" this NULL flip as that signals back to
the DC core that we've finished doing what we need to do
and it can destroy the display context
*/
DCDisplayConfigurationRetired(hConfigData);
}
else
{
BUG_ON(ahBuffers == IMG_NULL);
if(psDeviceData->bCanFlip)
{
DC_FBDEV_BUFFER *psBuffer = ahBuffers[0];
sVar.yoffset = sVar.yres * psBuffer->ui32BufferID;
}
psDeviceContext->hLastConfigData = hConfigData;
}
if(lock_fb_info(psDeviceData->psLINFBInfo) || bReset)
{
console_lock();
/* If we're supposed to be able to flip, but the yres_virtual
* has been changed to an unsupported (smaller) value, we need
* to change it back (this is a workaround for some Linux fbdev
* drivers that seem to lose any modifications to yres_virtual
* after a blank.)
*/
if((psDeviceData->bCanFlip &&
sVar.yres_virtual < sVar.yres * NUM_PREFERRED_BUFFERS) || bReset)
{
sVar.activate = FB_ACTIVATE_NOW;
sVar.yres_virtual = sVar.yres * NUM_PREFERRED_BUFFERS;
#if 0
//chenli: if the virtual screen resolution not changed, res_virtual should not be changed
if(bReset == false)
{
sVar.xres_virtual = sVar.xres;
sVar.yres_virtual = sVar.yoffset + sVar.yres;
}
#endif
err = fb_set_var(psDeviceData->psLINFBInfo, &sVar);
if(err)
pr_err("fb_set_var failed (err=%d)\n", err);
}
else
{
err = fb_pan_display(psDeviceData->psLINFBInfo, &sVar);
if(err)
pr_err("fb_pan_display failed (err=%d)\n", err);
}
console_unlock();
unlock_fb_info(psDeviceData->psLINFBInfo);
}
}
static
void DC_FBDEV_ContextDestroy(IMG_HANDLE hDisplayContext)
{
DC_FBDEV_CONTEXT *psDeviceContext = hDisplayContext;
BUG_ON(psDeviceContext->hLastConfigData != IMG_NULL);
kfree(psDeviceContext);
}
static
IMG_BOOL DC_FBDEV_GetBufferID(DC_FBDEV_CONTEXT *psDeviceContext, IMG_UINT32 *pui32BufferID)
{
IMG_UINT32 ui32BufferID;
/* If we don't support flipping, allow this code to give every
* allocated buffer the same ID. This means that the display
* won't be panned, and the same page list will be used for
* every allocation.
*/
if (!psDeviceContext->psDeviceData->bCanFlip)
{
*pui32BufferID = 0;
return IMG_TRUE;
}
for (ui32BufferID = 0; ui32BufferID < NUM_PREFERRED_BUFFERS; ++ui32BufferID)
{
if ((psDeviceContext->ui32AllocUseMask & (1UL << ui32BufferID)) == 0)
{
psDeviceContext->ui32AllocUseMask |= (1UL << ui32BufferID);
*pui32BufferID = ui32BufferID;
return IMG_TRUE;
}
}
return IMG_FALSE;
}
static
void DC_FBDEV_PutBufferID(DC_FBDEV_CONTEXT *psDeviceContext, IMG_UINT32 ui32BufferID)
{
psDeviceContext->ui32AllocUseMask &= ~(1UL << ui32BufferID);
}
#define BYTE_TO_PAGES(range) (((range) + (PAGE_SIZE - 1)) >> PAGE_SHIFT)
static
PVRSRV_ERROR DC_FBDEV_BufferAlloc(IMG_HANDLE hDisplayContext,
DC_BUFFER_CREATE_INFO *psCreateInfo,
IMG_DEVMEM_LOG2ALIGN_T *puiLog2PageSize,
IMG_UINT32 *pui32PageCount,
IMG_UINT32 *pui32PhysHeapID,
IMG_UINT32 *pui32ByteStride,
IMG_HANDLE *phBuffer)
{
DC_FBDEV_CONTEXT *psDeviceContext = hDisplayContext;
DC_FBDEV_DEVICE *psDeviceData = psDeviceContext->psDeviceData;
PVRSRV_SURFACE_INFO *psSurfInfo = &psCreateInfo->sSurface;
PVRSRV_ERROR eError;
DC_FBDEV_BUFFER *psBuffer;
IMG_UINT32 ui32ByteSize;
if (psSurfInfo->sFormat.ePixFormat != psDeviceData->ePixFormat)
{
eError = PVRSRV_ERROR_UNSUPPORTED_PIXEL_FORMAT;
goto err_out;
}
psBuffer = kmalloc(sizeof(DC_FBDEV_BUFFER), GFP_KERNEL);
if (!psBuffer)
{
eError = PVRSRV_ERROR_OUT_OF_MEMORY;
goto err_out;
}
psBuffer->psDeviceContext = psDeviceContext;
psBuffer->ui32ByteStride =
psSurfInfo->sDims.ui32Width * psCreateInfo->ui32BPP;
psBuffer->ui32Width = psSurfInfo->sDims.ui32Width;
psBuffer->ui32Height = psSurfInfo->sDims.ui32Height;
if (!DC_FBDEV_GetBufferID(psDeviceContext, &psBuffer->ui32BufferID))
{
eError = PVRSRV_ERROR_OUT_OF_MEMORY;
goto err_free;
}
ui32ByteSize = psBuffer->ui32ByteStride * psBuffer->ui32Height;
*puiLog2PageSize = PAGE_SHIFT;
*pui32PageCount = BYTE_TO_PAGES(ui32ByteSize);
*pui32PhysHeapID = DC_PHYS_HEAP_ID;
*pui32ByteStride = psBuffer->ui32ByteStride;
*phBuffer = psBuffer;
return PVRSRV_OK;
err_free:
kfree(psBuffer);
err_out:
return eError;
}
static
PVRSRV_ERROR DC_FBDEV_BufferAcquire(IMG_HANDLE hBuffer,
IMG_DEV_PHYADDR *pasDevPAddr,
IMG_PVOID *ppvLinAddr)
{
DC_FBDEV_BUFFER *psBuffer = hBuffer;
DC_FBDEV_DEVICE *psDeviceData = psBuffer->psDeviceContext->psDeviceData;
IMG_UINT32 ui32ByteSize = psBuffer->ui32ByteStride * psBuffer->ui32Height;
IMG_UINTPTR_T uiStartAddr;
IMG_UINT32 i, ui32MaxLen;
uiStartAddr = psDeviceData->psLINFBInfo->fix.smem_start +
psBuffer->ui32BufferID * ui32ByteSize;
ui32MaxLen = psDeviceData->psLINFBInfo->fix.smem_len -
psBuffer->ui32BufferID * ui32ByteSize;
for (i = 0; i < BYTE_TO_PAGES(ui32ByteSize); i++)
{
BUG_ON(i * PAGE_SIZE >= ui32MaxLen);
pasDevPAddr[i].uiAddr = uiStartAddr + (i * PAGE_SIZE);
}
/* We're UMA, so services will do the right thing and make
* its own CPU virtual address mapping for the buffer.
*/
*ppvLinAddr = IMG_NULL;
return PVRSRV_OK;
}
static void DC_FBDEV_BufferRelease(IMG_HANDLE hBuffer)
{
PVR_UNREFERENCED_PARAMETER(hBuffer);
}
static void DC_FBDEV_BufferFree(IMG_HANDLE hBuffer)
{
DC_FBDEV_BUFFER *psBuffer = hBuffer;
DC_FBDEV_PutBufferID(psBuffer->psDeviceContext, psBuffer->ui32BufferID);
kfree(psBuffer);
}
/* If we can flip, we need to make sure we have the memory to do so.
*
* We'll assume that the fbdev device provides extra space in
* yres_virtual for panning; xres_virtual is theoretically supported,
* but it involves more work.
*
* If the fbdev device doesn't have yres_virtual > yres, we'll try
* requesting it before bailing. Userspace applications commonly do
* this with an FBIOPUT_VSCREENINFO ioctl().
*
* Another problem is with a limitation in the services DC -- it
* needs framebuffers to be page aligned (this is a SW limitation,
* the HW can support non-page-aligned buffers). So we have to
* check that stride * height for a single buffer is page aligned.
*/
static bool DC_FBDEV_FlipPossible(struct fb_info *psLINFBInfo)
{
struct fb_var_screeninfo sVar = psLINFBInfo->var;
int err;
if(!psLINFBInfo->fix.xpanstep && !psLINFBInfo->fix.ypanstep &&
!psLINFBInfo->fix.ywrapstep)
{
pr_err("The fbdev device detected does not support ypan/ywrap. "
"Flipping disabled.\n");
return false;
}
if((psLINFBInfo->fix.line_length * sVar.yres) % PAGE_SIZE != 0)
{
pr_err("Line length (in bytes) x yres is not a multiple of "
"page size. Flipping disabled.\n");
return false;
}
/* We might already have enough space */
if(sVar.yres * NUM_PREFERRED_BUFFERS <= sVar.yres_virtual)
return true;
pr_err("No buffer space for flipping; asking for more.\n");
pr_err("sVar.yres=%d,sVar.yres_virtual=%d",sVar.yres,sVar.yres_virtual);
//zxl:if open it,will lead to penguin Logo show error
#if 0
if((sVar.nonstd & 0xff) != (sDefaultVar.nonstd & 0xff))
{
DumpFbInfo(&sDefaultVar);
sVar = sDefaultVar;
}
#endif
sVar.activate = FB_ACTIVATE_NOW;
sVar.yres_virtual = sVar.yres * NUM_PREFERRED_BUFFERS;
err = fb_set_var(psLINFBInfo, &sVar);
if(err)
{
pr_err("fb_set_var failed (err=%d). Flipping disabled.\n", err);
return false;
}
if(sVar.yres * NUM_PREFERRED_BUFFERS > sVar.yres_virtual)
{
pr_err("Failed to obtain additional buffer space. "
"Flipping disabled.\n");
return false;
}
/* Some fbdev drivers allow the yres_virtual modification through,
* but don't actually update the fix. We need the fix to be updated
* and more memory allocated, so we can actually take advantage of
* the increased yres_virtual.
*/
if(psLINFBInfo->fix.smem_len < psLINFBInfo->fix.line_length * sVar.yres_virtual)
{
pr_err("'fix' not re-allocated with sufficient buffer space. "
"Flipping disabled.\n");
return false;
}
return true;
}
static int __init DC_FBDEV_init(void)
{
static DC_DEVICE_FUNCTIONS sDCFunctions =
{
.pfnGetInfo = DC_FBDEV_GetInfo,
.pfnPanelQueryCount = DC_FBDEV_PanelQueryCount,
.pfnPanelQuery = DC_FBDEV_PanelQuery,
.pfnFormatQuery = DC_FBDEV_FormatQuery,
.pfnDimQuery = DC_FBDEV_DimQuery,
.pfnSetBlank = IMG_NULL,
.pfnSetVSyncReporting = IMG_NULL,
.pfnLastVSyncQuery = IMG_NULL,
.pfnContextCreate = DC_FBDEV_ContextCreate,
.pfnContextDestroy = DC_FBDEV_ContextDestroy,
.pfnContextConfigure = DC_FBDEV_ContextConfigure,
.pfnContextConfigureCheck = DC_FBDEV_ContextConfigureCheck,
.pfnBufferAlloc = DC_FBDEV_BufferAlloc,
.pfnBufferAcquire = DC_FBDEV_BufferAcquire,
.pfnBufferRelease = DC_FBDEV_BufferRelease,
.pfnBufferFree = DC_FBDEV_BufferFree,
};
struct fb_info *psLINFBInfo;
IMG_PIXFMT ePixFormat;
int err = -ENODEV;
psLINFBInfo = registered_fb[0];
if(!psLINFBInfo)
{
pr_err("No Linux framebuffer (fbdev) device is registered!\n"
"Check you have a framebuffer driver compiled into your "
"kernel\nand that it is enabled on the cmdline.\n");
goto err_out;
}
if(!lock_fb_info(psLINFBInfo))
goto err_out;
console_lock();
/* Filter out broken FB devices */
if(!psLINFBInfo->fix.smem_len || !psLINFBInfo->fix.line_length)
{
pr_err("The fbdev device detected had a zero smem_len or "
"line_length,\nwhich suggests it is a broken driver.\n");
goto err_unlock;
}
if(psLINFBInfo->fix.type != FB_TYPE_PACKED_PIXELS ||
psLINFBInfo->fix.visual != FB_VISUAL_TRUECOLOR)
{
pr_err("The fbdev device detected is not truecolor with packed "
"pixels.\n");
goto err_unlock;
}
#if 1
/*chenli: If FB uses RGB888 format after boot logo,
the value we need should be caculated with the RGB888 format
*/
if(psLINFBInfo->var.bits_per_pixel ==16)
{
psLINFBInfo->var.bits_per_pixel = 32;
psLINFBInfo->var.red.length = 8;
psLINFBInfo->var.green.length = 8;
psLINFBInfo->var.blue.length = 8 ;
psLINFBInfo->var.red.offset = 16;
psLINFBInfo->var.green.offset = 8;
psLINFBInfo->var.blue.offset = 0;
psLINFBInfo->var.red.msb_right = 0;
psLINFBInfo->fix.line_length *= 2;
}
#endif
if(psLINFBInfo->var.bits_per_pixel == 32)
{
if(psLINFBInfo->var.red.length != 8 ||
psLINFBInfo->var.green.length != 8 ||
psLINFBInfo->var.blue.length != 8 ||
psLINFBInfo->var.red.offset != 16 ||
psLINFBInfo->var.green.offset != 8 ||
psLINFBInfo->var.blue.offset != 0)
{
pr_err("The fbdev device detected uses an unrecognized "
"32bit pixel format (%u/%u/%u, %u/%u/%u)\n",
psLINFBInfo->var.red.length,
psLINFBInfo->var.green.length,
psLINFBInfo->var.blue.length,
psLINFBInfo->var.red.offset,
psLINFBInfo->var.green.offset,
psLINFBInfo->var.blue.offset);
goto err_unlock;
}
#if defined(DC_FBDEV_FORCE_XRGB8888)
ePixFormat = IMG_PIXFMT_B8G8R8X8_UNORM;
#else
ePixFormat = IMG_PIXFMT_B8G8R8A8_UNORM;
#endif
}
else if(psLINFBInfo->var.bits_per_pixel == 16)
{
if(psLINFBInfo->var.red.length != 5 ||
psLINFBInfo->var.green.length != 6 ||
psLINFBInfo->var.blue.length != 5 ||
psLINFBInfo->var.red.offset != 11 ||
psLINFBInfo->var.green.offset != 5 ||
psLINFBInfo->var.blue.offset != 0)
{
pr_err("The fbdev device detected uses an unrecognized "
"16bit pixel format (%u/%u/%u, %u/%u/%u)\n",
psLINFBInfo->var.red.length,
psLINFBInfo->var.green.length,
psLINFBInfo->var.blue.length,
psLINFBInfo->var.red.offset,
psLINFBInfo->var.green.offset,
psLINFBInfo->var.blue.offset);
goto err_unlock;
}
ePixFormat = IMG_PIXFMT_B5G6R5_UNORM;
}
else
{
pr_err("The fbdev device detected uses an unsupported "
"bpp (%u).\n", psLINFBInfo->var.bits_per_pixel);
goto err_unlock;
}
#if 1
//save defalut fb info
sDefaultVar = psLINFBInfo->var;
sDefaultVar.reserved[0] = 0;
sDefaultVar.reserved[1] = 0;
sDefaultVar.reserved[2] = 0;
sDefaultVar.yres_virtual = sDefaultVar.yres * 3;
sDefaultVar.nonstd &= 0xffffff00;
sDefaultVar.nonstd |= 5; //zxl:to match ePixFormat=IMG_PIXFMT_B8G8R8A8_UNORM
sDefaultVar.grayscale &= 0xff;
sDefaultVar.grayscale |= (sDefaultVar.xres<<8) + (sDefaultVar.yres<<20);
sDefaultVar.activate = FB_ACTIVATE_NOW;
sDefaultVar.yres_virtual = sDefaultVar.yres * NUM_PREFERRED_BUFFERS;
#endif
if(!try_module_get(psLINFBInfo->fbops->owner))
{
pr_err("try_module_get() failed");
goto err_unlock;
}
if(psLINFBInfo->fbops->fb_open &&
psLINFBInfo->fbops->fb_open(psLINFBInfo, 0) != 0)
{
pr_err("fb_open() failed");
goto err_module_put;
}
gpsDeviceData = kmalloc(sizeof(DC_FBDEV_DEVICE), GFP_KERNEL);
if(!gpsDeviceData)
goto err_module_put;
gpsDeviceData->psLINFBInfo = psLINFBInfo;
gpsDeviceData->ePixFormat = ePixFormat;
if(DCRegisterDevice(&sDCFunctions,
MAX_COMMANDS_IN_FLIGHT,
gpsDeviceData,
&gpsDeviceData->hSrvHandle) != PVRSRV_OK)
goto err_kfree;
gpsDeviceData->bCanFlip = DC_FBDEV_FlipPossible(psLINFBInfo);
pr_info("Found usable fbdev device (%s):\n"
"range (physical) = 0x%lx-0x%lx\n"
"size (bytes) = 0x%x\n"
"xres x yres = %ux%u\n"
"xres x yres (v) = %ux%u\n"
"img pix fmt = %u\n"
"flipping? = %d\n",
psLINFBInfo->fix.id,
psLINFBInfo->fix.smem_start,
psLINFBInfo->fix.smem_start + psLINFBInfo->fix.smem_len,
psLINFBInfo->fix.smem_len,
psLINFBInfo->var.xres, psLINFBInfo->var.yres,
psLINFBInfo->var.xres_virtual, psLINFBInfo->var.yres_virtual,
ePixFormat, gpsDeviceData->bCanFlip);
err = 0;
err_unlock:
console_unlock();
unlock_fb_info(psLINFBInfo);
err_out:
return err;
err_kfree:
kfree(gpsDeviceData);
err_module_put:
module_put(psLINFBInfo->fbops->owner);
goto err_unlock;
}
static void __exit DC_FBDEV_exit(void)
{
DC_FBDEV_DEVICE *psDeviceData = gpsDeviceData;
struct fb_info *psLINFBInfo = psDeviceData->psLINFBInfo;
lock_fb_info(psLINFBInfo);
console_lock();
if(psLINFBInfo->fbops->fb_release)
psLINFBInfo->fbops->fb_release(psLINFBInfo, 0);
module_put(psLINFBInfo->fbops->owner);
console_unlock();
unlock_fb_info(psLINFBInfo);
DCUnregisterDevice(psDeviceData->hSrvHandle);
kfree(psDeviceData);
}
module_init(DC_FBDEV_init);
module_exit(DC_FBDEV_exit);

View File

@@ -1,157 +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 "rgx_bridge.h"
#include "pvr_bridge_io.h"
#define PVRSRV_BRIDGE_BREAKPOINT_CMD_FIRST (PVRSRV_BRIDGE_BREAKPOINT_START)
#define PVRSRV_BRIDGE_BREAKPOINT_RGXSETBREAKPOINT PVRSRV_IOWR(PVRSRV_BRIDGE_BREAKPOINT_CMD_FIRST+0)
#define PVRSRV_BRIDGE_BREAKPOINT_RGXCLEARBREAKPOINT PVRSRV_IOWR(PVRSRV_BRIDGE_BREAKPOINT_CMD_FIRST+1)
#define PVRSRV_BRIDGE_BREAKPOINT_RGXENABLEBREAKPOINT PVRSRV_IOWR(PVRSRV_BRIDGE_BREAKPOINT_CMD_FIRST+2)
#define PVRSRV_BRIDGE_BREAKPOINT_RGXDISABLEBREAKPOINT PVRSRV_IOWR(PVRSRV_BRIDGE_BREAKPOINT_CMD_FIRST+3)
#define PVRSRV_BRIDGE_BREAKPOINT_RGXOVERALLOCATEBPREGISTERS PVRSRV_IOWR(PVRSRV_BRIDGE_BREAKPOINT_CMD_FIRST+4)
#define PVRSRV_BRIDGE_BREAKPOINT_CMD_LAST (PVRSRV_BRIDGE_BREAKPOINT_CMD_FIRST+4)
/*******************************************
RGXSetBreakpoint
*******************************************/
/* Bridge in structure for RGXSetBreakpoint */
typedef struct PVRSRV_BRIDGE_IN_RGXSETBREAKPOINT_TAG
{
IMG_HANDLE hDevNode;
IMG_HANDLE hPrivData;
IMG_UINT32 eFWDataMaster;
IMG_UINT32 ui32BreakpointAddr;
IMG_UINT32 ui32HandlerAddr;
IMG_UINT32 ui32DM;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXSETBREAKPOINT;
/* Bridge out structure for RGXSetBreakpoint */
typedef struct PVRSRV_BRIDGE_OUT_RGXSETBREAKPOINT_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXSETBREAKPOINT;
/*******************************************
RGXClearBreakpoint
*******************************************/
/* Bridge in structure for RGXClearBreakpoint */
typedef struct PVRSRV_BRIDGE_IN_RGXCLEARBREAKPOINT_TAG
{
IMG_HANDLE hDevNode;
IMG_HANDLE hPrivData;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXCLEARBREAKPOINT;
/* Bridge out structure for RGXClearBreakpoint */
typedef struct PVRSRV_BRIDGE_OUT_RGXCLEARBREAKPOINT_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXCLEARBREAKPOINT;
/*******************************************
RGXEnableBreakpoint
*******************************************/
/* Bridge in structure for RGXEnableBreakpoint */
typedef struct PVRSRV_BRIDGE_IN_RGXENABLEBREAKPOINT_TAG
{
IMG_HANDLE hDevNode;
IMG_HANDLE hPrivData;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXENABLEBREAKPOINT;
/* Bridge out structure for RGXEnableBreakpoint */
typedef struct PVRSRV_BRIDGE_OUT_RGXENABLEBREAKPOINT_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXENABLEBREAKPOINT;
/*******************************************
RGXDisableBreakpoint
*******************************************/
/* Bridge in structure for RGXDisableBreakpoint */
typedef struct PVRSRV_BRIDGE_IN_RGXDISABLEBREAKPOINT_TAG
{
IMG_HANDLE hDevNode;
IMG_HANDLE hPrivData;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXDISABLEBREAKPOINT;
/* Bridge out structure for RGXDisableBreakpoint */
typedef struct PVRSRV_BRIDGE_OUT_RGXDISABLEBREAKPOINT_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXDISABLEBREAKPOINT;
/*******************************************
RGXOverallocateBPRegisters
*******************************************/
/* Bridge in structure for RGXOverallocateBPRegisters */
typedef struct PVRSRV_BRIDGE_IN_RGXOVERALLOCATEBPREGISTERS_TAG
{
IMG_HANDLE hDevNode;
IMG_UINT32 ui32TempRegs;
IMG_UINT32 ui32SharedRegs;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXOVERALLOCATEBPREGISTERS;
/* Bridge out structure for RGXOverallocateBPRegisters */
typedef struct PVRSRV_BRIDGE_OUT_RGXOVERALLOCATEBPREGISTERS_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXOVERALLOCATEBPREGISTERS;
#endif /* COMMON_BREAKPOINT_BRIDGE_H */

View File

@@ -1,371 +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>
/* ***************************************************************************
* Bridge proxy functions
*/
/* ***************************************************************************
* Server-side bridge entry points
*/
static IMG_INT
PVRSRVBridgeRGXSetBreakpoint(IMG_UINT32 ui32BridgeID,
PVRSRV_BRIDGE_IN_RGXSETBREAKPOINT *psRGXSetBreakpointIN,
PVRSRV_BRIDGE_OUT_RGXSETBREAKPOINT *psRGXSetBreakpointOUT,
CONNECTION_DATA *psConnection)
{
IMG_HANDLE hDevNodeInt = IMG_NULL;
IMG_HANDLE hPrivDataInt = IMG_NULL;
PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_BREAKPOINT_RGXSETBREAKPOINT);
{
/* Look up the address from the handle */
psRGXSetBreakpointOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_HANDLE *) &hDevNodeInt,
psRGXSetBreakpointIN->hDevNode,
PVRSRV_HANDLE_TYPE_DEV_NODE);
if(psRGXSetBreakpointOUT->eError != PVRSRV_OK)
{
goto RGXSetBreakpoint_exit;
}
}
{
/* Look up the address from the handle */
psRGXSetBreakpointOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_HANDLE *) &hPrivDataInt,
psRGXSetBreakpointIN->hPrivData,
PVRSRV_HANDLE_TYPE_DEV_PRIV_DATA);
if(psRGXSetBreakpointOUT->eError != PVRSRV_OK)
{
goto RGXSetBreakpoint_exit;
}
}
psRGXSetBreakpointOUT->eError =
PVRSRVRGXSetBreakpointKM(
hDevNodeInt,
hPrivDataInt,
psRGXSetBreakpointIN->eFWDataMaster,
psRGXSetBreakpointIN->ui32BreakpointAddr,
psRGXSetBreakpointIN->ui32HandlerAddr,
psRGXSetBreakpointIN->ui32DM);
RGXSetBreakpoint_exit:
return 0;
}
static IMG_INT
PVRSRVBridgeRGXClearBreakpoint(IMG_UINT32 ui32BridgeID,
PVRSRV_BRIDGE_IN_RGXCLEARBREAKPOINT *psRGXClearBreakpointIN,
PVRSRV_BRIDGE_OUT_RGXCLEARBREAKPOINT *psRGXClearBreakpointOUT,
CONNECTION_DATA *psConnection)
{
IMG_HANDLE hDevNodeInt = IMG_NULL;
IMG_HANDLE hPrivDataInt = IMG_NULL;
PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_BREAKPOINT_RGXCLEARBREAKPOINT);
{
/* Look up the address from the handle */
psRGXClearBreakpointOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_HANDLE *) &hDevNodeInt,
psRGXClearBreakpointIN->hDevNode,
PVRSRV_HANDLE_TYPE_DEV_NODE);
if(psRGXClearBreakpointOUT->eError != PVRSRV_OK)
{
goto RGXClearBreakpoint_exit;
}
}
{
/* Look up the address from the handle */
psRGXClearBreakpointOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_HANDLE *) &hPrivDataInt,
psRGXClearBreakpointIN->hPrivData,
PVRSRV_HANDLE_TYPE_DEV_PRIV_DATA);
if(psRGXClearBreakpointOUT->eError != PVRSRV_OK)
{
goto RGXClearBreakpoint_exit;
}
}
psRGXClearBreakpointOUT->eError =
PVRSRVRGXClearBreakpointKM(
hDevNodeInt,
hPrivDataInt);
RGXClearBreakpoint_exit:
return 0;
}
static IMG_INT
PVRSRVBridgeRGXEnableBreakpoint(IMG_UINT32 ui32BridgeID,
PVRSRV_BRIDGE_IN_RGXENABLEBREAKPOINT *psRGXEnableBreakpointIN,
PVRSRV_BRIDGE_OUT_RGXENABLEBREAKPOINT *psRGXEnableBreakpointOUT,
CONNECTION_DATA *psConnection)
{
IMG_HANDLE hDevNodeInt = IMG_NULL;
IMG_HANDLE hPrivDataInt = IMG_NULL;
PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_BREAKPOINT_RGXENABLEBREAKPOINT);
{
/* Look up the address from the handle */
psRGXEnableBreakpointOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_HANDLE *) &hDevNodeInt,
psRGXEnableBreakpointIN->hDevNode,
PVRSRV_HANDLE_TYPE_DEV_NODE);
if(psRGXEnableBreakpointOUT->eError != PVRSRV_OK)
{
goto RGXEnableBreakpoint_exit;
}
}
{
/* Look up the address from the handle */
psRGXEnableBreakpointOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_HANDLE *) &hPrivDataInt,
psRGXEnableBreakpointIN->hPrivData,
PVRSRV_HANDLE_TYPE_DEV_PRIV_DATA);
if(psRGXEnableBreakpointOUT->eError != PVRSRV_OK)
{
goto RGXEnableBreakpoint_exit;
}
}
psRGXEnableBreakpointOUT->eError =
PVRSRVRGXEnableBreakpointKM(
hDevNodeInt,
hPrivDataInt);
RGXEnableBreakpoint_exit:
return 0;
}
static IMG_INT
PVRSRVBridgeRGXDisableBreakpoint(IMG_UINT32 ui32BridgeID,
PVRSRV_BRIDGE_IN_RGXDISABLEBREAKPOINT *psRGXDisableBreakpointIN,
PVRSRV_BRIDGE_OUT_RGXDISABLEBREAKPOINT *psRGXDisableBreakpointOUT,
CONNECTION_DATA *psConnection)
{
IMG_HANDLE hDevNodeInt = IMG_NULL;
IMG_HANDLE hPrivDataInt = IMG_NULL;
PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_BREAKPOINT_RGXDISABLEBREAKPOINT);
{
/* Look up the address from the handle */
psRGXDisableBreakpointOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_HANDLE *) &hDevNodeInt,
psRGXDisableBreakpointIN->hDevNode,
PVRSRV_HANDLE_TYPE_DEV_NODE);
if(psRGXDisableBreakpointOUT->eError != PVRSRV_OK)
{
goto RGXDisableBreakpoint_exit;
}
}
{
/* Look up the address from the handle */
psRGXDisableBreakpointOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_HANDLE *) &hPrivDataInt,
psRGXDisableBreakpointIN->hPrivData,
PVRSRV_HANDLE_TYPE_DEV_PRIV_DATA);
if(psRGXDisableBreakpointOUT->eError != PVRSRV_OK)
{
goto RGXDisableBreakpoint_exit;
}
}
psRGXDisableBreakpointOUT->eError =
PVRSRVRGXDisableBreakpointKM(
hDevNodeInt,
hPrivDataInt);
RGXDisableBreakpoint_exit:
return 0;
}
static IMG_INT
PVRSRVBridgeRGXOverallocateBPRegisters(IMG_UINT32 ui32BridgeID,
PVRSRV_BRIDGE_IN_RGXOVERALLOCATEBPREGISTERS *psRGXOverallocateBPRegistersIN,
PVRSRV_BRIDGE_OUT_RGXOVERALLOCATEBPREGISTERS *psRGXOverallocateBPRegistersOUT,
CONNECTION_DATA *psConnection)
{
IMG_HANDLE hDevNodeInt = IMG_NULL;
PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_BREAKPOINT_RGXOVERALLOCATEBPREGISTERS);
{
/* Look up the address from the handle */
psRGXOverallocateBPRegistersOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_HANDLE *) &hDevNodeInt,
psRGXOverallocateBPRegistersIN->hDevNode,
PVRSRV_HANDLE_TYPE_DEV_NODE);
if(psRGXOverallocateBPRegistersOUT->eError != PVRSRV_OK)
{
goto RGXOverallocateBPRegisters_exit;
}
}
psRGXOverallocateBPRegistersOUT->eError =
PVRSRVRGXOverallocateBPRegistersKM(
hDevNodeInt,
psRGXOverallocateBPRegistersIN->ui32TempRegs,
psRGXOverallocateBPRegistersIN->ui32SharedRegs);
RGXOverallocateBPRegisters_exit:
return 0;
}
/* ***************************************************************************
* Server bridge dispatch related glue
*/
PVRSRV_ERROR RegisterBREAKPOINTFunctions(IMG_VOID);
IMG_VOID UnregisterBREAKPOINTFunctions(IMG_VOID);
/*
* Register all BREAKPOINT functions with services
*/
PVRSRV_ERROR RegisterBREAKPOINTFunctions(IMG_VOID)
{
SetDispatchTableEntry(PVRSRV_BRIDGE_BREAKPOINT_RGXSETBREAKPOINT, PVRSRVBridgeRGXSetBreakpoint);
SetDispatchTableEntry(PVRSRV_BRIDGE_BREAKPOINT_RGXCLEARBREAKPOINT, PVRSRVBridgeRGXClearBreakpoint);
SetDispatchTableEntry(PVRSRV_BRIDGE_BREAKPOINT_RGXENABLEBREAKPOINT, PVRSRVBridgeRGXEnableBreakpoint);
SetDispatchTableEntry(PVRSRV_BRIDGE_BREAKPOINT_RGXDISABLEBREAKPOINT, PVRSRVBridgeRGXDisableBreakpoint);
SetDispatchTableEntry(PVRSRV_BRIDGE_BREAKPOINT_RGXOVERALLOCATEBPREGISTERS, PVRSRVBridgeRGXOverallocateBPRegisters);
return PVRSRV_OK;
}
/*
* Unregister all breakpoint functions with services
*/
IMG_VOID UnregisterBREAKPOINTFunctions(IMG_VOID)
{
}

View File

@@ -1,75 +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 "cache_external.h"
#include "pvr_bridge_io.h"
#define PVRSRV_BRIDGE_CACHEGENERIC_CMD_FIRST (PVRSRV_BRIDGE_CACHEGENERIC_START)
#define PVRSRV_BRIDGE_CACHEGENERIC_CACHEOPQUEUE PVRSRV_IOWR(PVRSRV_BRIDGE_CACHEGENERIC_CMD_FIRST+0)
#define PVRSRV_BRIDGE_CACHEGENERIC_CMD_LAST (PVRSRV_BRIDGE_CACHEGENERIC_CMD_FIRST+0)
/*******************************************
CacheOpQueue
*******************************************/
/* Bridge in structure for CacheOpQueue */
typedef struct PVRSRV_BRIDGE_IN_CACHEOPQUEUE_TAG
{
PVRSRV_CACHE_OP iuCacheOp;
} PVRSRV_BRIDGE_IN_CACHEOPQUEUE;
/* Bridge out structure for CacheOpQueue */
typedef struct PVRSRV_BRIDGE_OUT_CACHEOPQUEUE_TAG
{
PVRSRV_ERROR eError;
} PVRSRV_BRIDGE_OUT_CACHEOPQUEUE;
#endif /* COMMON_CACHEGENERIC_BRIDGE_H */

View File

@@ -1,126 +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>
/* ***************************************************************************
* Bridge proxy functions
*/
/* ***************************************************************************
* Server-side bridge entry points
*/
static IMG_INT
PVRSRVBridgeCacheOpQueue(IMG_UINT32 ui32BridgeID,
PVRSRV_BRIDGE_IN_CACHEOPQUEUE *psCacheOpQueueIN,
PVRSRV_BRIDGE_OUT_CACHEOPQUEUE *psCacheOpQueueOUT,
CONNECTION_DATA *psConnection)
{
PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_CACHEGENERIC_CACHEOPQUEUE);
PVR_UNREFERENCED_PARAMETER(psConnection);
psCacheOpQueueOUT->eError =
CacheOpQueue(
psCacheOpQueueIN->iuCacheOp);
return 0;
}
/* ***************************************************************************
* Server bridge dispatch related glue
*/
PVRSRV_ERROR RegisterCACHEGENERICFunctions(IMG_VOID);
IMG_VOID UnregisterCACHEGENERICFunctions(IMG_VOID);
/*
* Register all CACHEGENERIC functions with services
*/
PVRSRV_ERROR RegisterCACHEGENERICFunctions(IMG_VOID)
{
SetDispatchTableEntry(PVRSRV_BRIDGE_CACHEGENERIC_CACHEOPQUEUE, PVRSRVBridgeCacheOpQueue);
return PVRSRV_OK;
}
/*
* Unregister all cachegeneric functions with services
*/
IMG_VOID UnregisterCACHEGENERICFunctions(IMG_VOID)
{
}

View File

@@ -1,178 +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 "devicemem_typedefs.h"
#include "pvr_bridge_io.h"
#define PVRSRV_BRIDGE_CMM_CMD_FIRST (PVRSRV_BRIDGE_CMM_START)
#define PVRSRV_BRIDGE_CMM_PMRWRITEPMPAGELIST PVRSRV_IOWR(PVRSRV_BRIDGE_CMM_CMD_FIRST+0)
#define PVRSRV_BRIDGE_CMM_PMRWRITEVFPPAGELIST PVRSRV_IOWR(PVRSRV_BRIDGE_CMM_CMD_FIRST+1)
#define PVRSRV_BRIDGE_CMM_PMRUNWRITEPMPAGELIST PVRSRV_IOWR(PVRSRV_BRIDGE_CMM_CMD_FIRST+2)
#define PVRSRV_BRIDGE_CMM_DEVMEMINTCTXEXPORT PVRSRV_IOWR(PVRSRV_BRIDGE_CMM_CMD_FIRST+3)
#define PVRSRV_BRIDGE_CMM_DEVMEMINTCTXUNEXPORT PVRSRV_IOWR(PVRSRV_BRIDGE_CMM_CMD_FIRST+4)
#define PVRSRV_BRIDGE_CMM_DEVMEMINTCTXIMPORT PVRSRV_IOWR(PVRSRV_BRIDGE_CMM_CMD_FIRST+5)
#define PVRSRV_BRIDGE_CMM_CMD_LAST (PVRSRV_BRIDGE_CMM_CMD_FIRST+5)
/*******************************************
PMRWritePMPageList
*******************************************/
/* Bridge in structure for PMRWritePMPageList */
typedef struct PVRSRV_BRIDGE_IN_PMRWRITEPMPAGELIST_TAG
{
IMG_HANDLE hPageListPMR;
IMG_DEVMEM_OFFSET_T uiTableOffset;
IMG_DEVMEM_SIZE_T uiTableLength;
IMG_HANDLE hReferencePMR;
IMG_UINT32 ui32Log2PageSize;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_PMRWRITEPMPAGELIST;
/* Bridge out structure for PMRWritePMPageList */
typedef struct PVRSRV_BRIDGE_OUT_PMRWRITEPMPAGELIST_TAG
{
IMG_HANDLE hPageList;
IMG_UINT64 ui64CheckSum;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PMRWRITEPMPAGELIST;
/*******************************************
PMRWriteVFPPageList
*******************************************/
/* Bridge in structure for PMRWriteVFPPageList */
typedef struct PVRSRV_BRIDGE_IN_PMRWRITEVFPPAGELIST_TAG
{
IMG_HANDLE hFreeListPMR;
IMG_DEVMEM_OFFSET_T uiTableOffset;
IMG_DEVMEM_SIZE_T uiTableLength;
IMG_UINT32 ui32TableBase;
IMG_UINT32 ui32Log2PageSize;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_PMRWRITEVFPPAGELIST;
/* Bridge out structure for PMRWriteVFPPageList */
typedef struct PVRSRV_BRIDGE_OUT_PMRWRITEVFPPAGELIST_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PMRWRITEVFPPAGELIST;
/*******************************************
PMRUnwritePMPageList
*******************************************/
/* Bridge in structure for PMRUnwritePMPageList */
typedef struct PVRSRV_BRIDGE_IN_PMRUNWRITEPMPAGELIST_TAG
{
IMG_HANDLE hPageList;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_PMRUNWRITEPMPAGELIST;
/* Bridge out structure for PMRUnwritePMPageList */
typedef struct PVRSRV_BRIDGE_OUT_PMRUNWRITEPMPAGELIST_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PMRUNWRITEPMPAGELIST;
/*******************************************
DevmemIntCtxExport
*******************************************/
/* Bridge in structure for DevmemIntCtxExport */
typedef struct PVRSRV_BRIDGE_IN_DEVMEMINTCTXEXPORT_TAG
{
IMG_HANDLE hDevMemServerContext;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_DEVMEMINTCTXEXPORT;
/* Bridge out structure for DevmemIntCtxExport */
typedef struct PVRSRV_BRIDGE_OUT_DEVMEMINTCTXEXPORT_TAG
{
IMG_HANDLE hDevMemIntCtxExport;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DEVMEMINTCTXEXPORT;
/*******************************************
DevmemIntCtxUnexport
*******************************************/
/* Bridge in structure for DevmemIntCtxUnexport */
typedef struct PVRSRV_BRIDGE_IN_DEVMEMINTCTXUNEXPORT_TAG
{
IMG_HANDLE hDevMemIntCtxExport;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_DEVMEMINTCTXUNEXPORT;
/* Bridge out structure for DevmemIntCtxUnexport */
typedef struct PVRSRV_BRIDGE_OUT_DEVMEMINTCTXUNEXPORT_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DEVMEMINTCTXUNEXPORT;
/*******************************************
DevmemIntCtxImport
*******************************************/
/* Bridge in structure for DevmemIntCtxImport */
typedef struct PVRSRV_BRIDGE_IN_DEVMEMINTCTXIMPORT_TAG
{
IMG_HANDLE hDevMemIntCtxExport;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_DEVMEMINTCTXIMPORT;
/* Bridge out structure for DevmemIntCtxImport */
typedef struct PVRSRV_BRIDGE_OUT_DEVMEMINTCTXIMPORT_TAG
{
IMG_HANDLE hDevMemServerContext;
IMG_HANDLE hPrivData;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DEVMEMINTCTXIMPORT;
#endif /* COMMON_CMM_BRIDGE_H */

View File

@@ -1,611 +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>
/* ***************************************************************************
* Bridge proxy functions
*/
static PVRSRV_ERROR
PMRUnwritePMPageListResManProxy(IMG_HANDLE hResmanItem)
{
PVRSRV_ERROR eError;
eError = ResManFreeResByPtr(hResmanItem);
/* Freeing a resource should never fail... */
PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY));
return eError;
}
static PVRSRV_ERROR
DevmemIntCtxUnexportResManProxy(IMG_HANDLE hResmanItem)
{
PVRSRV_ERROR eError;
eError = ResManFreeResByPtr(hResmanItem);
/* Freeing a resource should never fail... */
PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY));
return eError;
}
/* ***************************************************************************
* Server-side bridge entry points
*/
static IMG_INT
PVRSRVBridgePMRWritePMPageList(IMG_UINT32 ui32BridgeID,
PVRSRV_BRIDGE_IN_PMRWRITEPMPAGELIST *psPMRWritePMPageListIN,
PVRSRV_BRIDGE_OUT_PMRWRITEPMPAGELIST *psPMRWritePMPageListOUT,
CONNECTION_DATA *psConnection)
{
PMR * psPageListPMRInt = IMG_NULL;
IMG_HANDLE hPageListPMRInt2 = IMG_NULL;
PMR * psReferencePMRInt = IMG_NULL;
IMG_HANDLE hReferencePMRInt2 = IMG_NULL;
PMR_PAGELIST * psPageListInt = IMG_NULL;
IMG_HANDLE hPageListInt2 = IMG_NULL;
PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_CMM_PMRWRITEPMPAGELIST);
{
/* Look up the address from the handle */
psPMRWritePMPageListOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_HANDLE *) &hPageListPMRInt2,
psPMRWritePMPageListIN->hPageListPMR,
PVRSRV_HANDLE_TYPE_PHYSMEM_PMR);
if(psPMRWritePMPageListOUT->eError != PVRSRV_OK)
{
goto PMRWritePMPageList_exit;
}
/* Look up the data from the resman address */
psPMRWritePMPageListOUT->eError = ResManFindPrivateDataByPtr(hPageListPMRInt2, (IMG_VOID **) &psPageListPMRInt);
if(psPMRWritePMPageListOUT->eError != PVRSRV_OK)
{
goto PMRWritePMPageList_exit;
}
}
{
/* Look up the address from the handle */
psPMRWritePMPageListOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_HANDLE *) &hReferencePMRInt2,
psPMRWritePMPageListIN->hReferencePMR,
PVRSRV_HANDLE_TYPE_PHYSMEM_PMR);
if(psPMRWritePMPageListOUT->eError != PVRSRV_OK)
{
goto PMRWritePMPageList_exit;
}
/* Look up the data from the resman address */
psPMRWritePMPageListOUT->eError = ResManFindPrivateDataByPtr(hReferencePMRInt2, (IMG_VOID **) &psReferencePMRInt);
if(psPMRWritePMPageListOUT->eError != PVRSRV_OK)
{
goto PMRWritePMPageList_exit;
}
}
psPMRWritePMPageListOUT->eError =
PMRWritePMPageList(
psPageListPMRInt,
psPMRWritePMPageListIN->uiTableOffset,
psPMRWritePMPageListIN->uiTableLength,
psReferencePMRInt,
psPMRWritePMPageListIN->ui32Log2PageSize,
&psPageListInt,
&psPMRWritePMPageListOUT->ui64CheckSum);
/* Exit early if bridged call fails */
if(psPMRWritePMPageListOUT->eError != PVRSRV_OK)
{
goto PMRWritePMPageList_exit;
}
/* Create a resman item and overwrite the handle with it */
hPageListInt2 = ResManRegisterRes(psConnection->hResManContext,
RESMAN_TYPE_PMR_PAGELIST,
psPageListInt,
(RESMAN_FREE_FN)&PMRUnwritePMPageList);
if (hPageListInt2 == IMG_NULL)
{
psPMRWritePMPageListOUT->eError = PVRSRV_ERROR_UNABLE_TO_REGISTER_RESOURCE;
goto PMRWritePMPageList_exit;
}
psPMRWritePMPageListOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase,
&psPMRWritePMPageListOUT->hPageList,
(IMG_HANDLE) hPageListInt2,
PVRSRV_HANDLE_TYPE_PHYSMEM_PMR_PAGELIST,
PVRSRV_HANDLE_ALLOC_FLAG_NONE
);
if (psPMRWritePMPageListOUT->eError != PVRSRV_OK)
{
goto PMRWritePMPageList_exit;
}
PMRWritePMPageList_exit:
if (psPMRWritePMPageListOUT->eError != PVRSRV_OK)
{
/* If we have a valid resman item we should undo the bridge function by freeing the resman item */
if (hPageListInt2)
{
PVRSRV_ERROR eError = ResManFreeResByPtr(hPageListInt2);
/* Freeing a resource should never fail... */
PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY));
}
else if (psPageListInt)
{
PMRUnwritePMPageList(psPageListInt);
}
}
return 0;
}
static IMG_INT
PVRSRVBridgePMRWriteVFPPageList(IMG_UINT32 ui32BridgeID,
PVRSRV_BRIDGE_IN_PMRWRITEVFPPAGELIST *psPMRWriteVFPPageListIN,
PVRSRV_BRIDGE_OUT_PMRWRITEVFPPAGELIST *psPMRWriteVFPPageListOUT,
CONNECTION_DATA *psConnection)
{
PMR * psFreeListPMRInt = IMG_NULL;
IMG_HANDLE hFreeListPMRInt2 = IMG_NULL;
PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_CMM_PMRWRITEVFPPAGELIST);
{
/* Look up the address from the handle */
psPMRWriteVFPPageListOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_HANDLE *) &hFreeListPMRInt2,
psPMRWriteVFPPageListIN->hFreeListPMR,
PVRSRV_HANDLE_TYPE_PHYSMEM_PMR);
if(psPMRWriteVFPPageListOUT->eError != PVRSRV_OK)
{
goto PMRWriteVFPPageList_exit;
}
/* Look up the data from the resman address */
psPMRWriteVFPPageListOUT->eError = ResManFindPrivateDataByPtr(hFreeListPMRInt2, (IMG_VOID **) &psFreeListPMRInt);
if(psPMRWriteVFPPageListOUT->eError != PVRSRV_OK)
{
goto PMRWriteVFPPageList_exit;
}
}
psPMRWriteVFPPageListOUT->eError =
PMRWriteVFPPageList(
psFreeListPMRInt,
psPMRWriteVFPPageListIN->uiTableOffset,
psPMRWriteVFPPageListIN->uiTableLength,
psPMRWriteVFPPageListIN->ui32TableBase,
psPMRWriteVFPPageListIN->ui32Log2PageSize);
PMRWriteVFPPageList_exit:
return 0;
}
static IMG_INT
PVRSRVBridgePMRUnwritePMPageList(IMG_UINT32 ui32BridgeID,
PVRSRV_BRIDGE_IN_PMRUNWRITEPMPAGELIST *psPMRUnwritePMPageListIN,
PVRSRV_BRIDGE_OUT_PMRUNWRITEPMPAGELIST *psPMRUnwritePMPageListOUT,
CONNECTION_DATA *psConnection)
{
IMG_HANDLE hPageListInt2 = IMG_NULL;
PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_CMM_PMRUNWRITEPMPAGELIST);
{
/* Look up the address from the handle */
psPMRUnwritePMPageListOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_HANDLE *) &hPageListInt2,
psPMRUnwritePMPageListIN->hPageList,
PVRSRV_HANDLE_TYPE_PHYSMEM_PMR_PAGELIST);
if(psPMRUnwritePMPageListOUT->eError != PVRSRV_OK)
{
goto PMRUnwritePMPageList_exit;
}
}
psPMRUnwritePMPageListOUT->eError = PMRUnwritePMPageListResManProxy(hPageListInt2);
/* Exit early if bridged call fails */
if(psPMRUnwritePMPageListOUT->eError != PVRSRV_OK)
{
goto PMRUnwritePMPageList_exit;
}
psPMRUnwritePMPageListOUT->eError =
PVRSRVReleaseHandle(psConnection->psHandleBase,
(IMG_HANDLE) psPMRUnwritePMPageListIN->hPageList,
PVRSRV_HANDLE_TYPE_PHYSMEM_PMR_PAGELIST);
PMRUnwritePMPageList_exit:
return 0;
}
static IMG_INT
PVRSRVBridgeDevmemIntCtxExport(IMG_UINT32 ui32BridgeID,
PVRSRV_BRIDGE_IN_DEVMEMINTCTXEXPORT *psDevmemIntCtxExportIN,
PVRSRV_BRIDGE_OUT_DEVMEMINTCTXEXPORT *psDevmemIntCtxExportOUT,
CONNECTION_DATA *psConnection)
{
DEVMEMINT_CTX * psDevMemServerContextInt = IMG_NULL;
IMG_HANDLE hDevMemServerContextInt2 = IMG_NULL;
DEVMEMINT_CTX_EXPORT * psDevMemIntCtxExportInt = IMG_NULL;
IMG_HANDLE hDevMemIntCtxExportInt2 = IMG_NULL;
PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_CMM_DEVMEMINTCTXEXPORT);
{
/* Look up the address from the handle */
psDevmemIntCtxExportOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_HANDLE *) &hDevMemServerContextInt2,
psDevmemIntCtxExportIN->hDevMemServerContext,
PVRSRV_HANDLE_TYPE_DEVMEMINT_CTX);
if(psDevmemIntCtxExportOUT->eError != PVRSRV_OK)
{
goto DevmemIntCtxExport_exit;
}
/* Look up the data from the resman address */
psDevmemIntCtxExportOUT->eError = ResManFindPrivateDataByPtr(hDevMemServerContextInt2, (IMG_VOID **) &psDevMemServerContextInt);
if(psDevmemIntCtxExportOUT->eError != PVRSRV_OK)
{
goto DevmemIntCtxExport_exit;
}
}
psDevmemIntCtxExportOUT->eError =
DevmemIntCtxExport(
psDevMemServerContextInt,
&psDevMemIntCtxExportInt);
/* Exit early if bridged call fails */
if(psDevmemIntCtxExportOUT->eError != PVRSRV_OK)
{
goto DevmemIntCtxExport_exit;
}
/* Create a resman item and overwrite the handle with it */
hDevMemIntCtxExportInt2 = ResManRegisterRes(psConnection->hResManContext,
RESMAN_TYPE_DEVICEMEM2_CONTEXT_EXPORT,
psDevMemIntCtxExportInt,
(RESMAN_FREE_FN)&DevmemIntCtxUnexport);
if (hDevMemIntCtxExportInt2 == IMG_NULL)
{
psDevmemIntCtxExportOUT->eError = PVRSRV_ERROR_UNABLE_TO_REGISTER_RESOURCE;
goto DevmemIntCtxExport_exit;
}
/* see if it's already exported */
psDevmemIntCtxExportOUT->eError =
PVRSRVFindHandle(KERNEL_HANDLE_BASE,
&psDevmemIntCtxExportOUT->hDevMemIntCtxExport,
(IMG_HANDLE) hDevMemIntCtxExportInt2,
PVRSRV_HANDLE_TYPE_DEVMEMINT_CTX_EXPORT);
if(psDevmemIntCtxExportOUT->eError == PVRSRV_OK)
{
/* It's already exported */
return 0;
}
psDevmemIntCtxExportOUT->eError = PVRSRVAllocHandle(KERNEL_HANDLE_BASE,
&psDevmemIntCtxExportOUT->hDevMemIntCtxExport,
(IMG_HANDLE) hDevMemIntCtxExportInt2,
PVRSRV_HANDLE_TYPE_DEVMEMINT_CTX_EXPORT,
PVRSRV_HANDLE_ALLOC_FLAG_NONE
);
if (psDevmemIntCtxExportOUT->eError != PVRSRV_OK)
{
goto DevmemIntCtxExport_exit;
}
DevmemIntCtxExport_exit:
if (psDevmemIntCtxExportOUT->eError != PVRSRV_OK)
{
/* If we have a valid resman item we should undo the bridge function by freeing the resman item */
if (hDevMemIntCtxExportInt2)
{
PVRSRV_ERROR eError = ResManFreeResByPtr(hDevMemIntCtxExportInt2);
/* Freeing a resource should never fail... */
PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY));
}
else if (psDevMemIntCtxExportInt)
{
DevmemIntCtxUnexport(psDevMemIntCtxExportInt);
}
}
return 0;
}
static IMG_INT
PVRSRVBridgeDevmemIntCtxUnexport(IMG_UINT32 ui32BridgeID,
PVRSRV_BRIDGE_IN_DEVMEMINTCTXUNEXPORT *psDevmemIntCtxUnexportIN,
PVRSRV_BRIDGE_OUT_DEVMEMINTCTXUNEXPORT *psDevmemIntCtxUnexportOUT,
CONNECTION_DATA *psConnection)
{
IMG_HANDLE hDevMemIntCtxExportInt2 = IMG_NULL;
PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_CMM_DEVMEMINTCTXUNEXPORT);
PVR_UNREFERENCED_PARAMETER(psConnection);
{
/* Look up the address from the handle */
psDevmemIntCtxUnexportOUT->eError =
PVRSRVLookupHandle(KERNEL_HANDLE_BASE,
(IMG_HANDLE *) &hDevMemIntCtxExportInt2,
psDevmemIntCtxUnexportIN->hDevMemIntCtxExport,
PVRSRV_HANDLE_TYPE_DEVMEMINT_CTX_EXPORT);
if(psDevmemIntCtxUnexportOUT->eError != PVRSRV_OK)
{
goto DevmemIntCtxUnexport_exit;
}
}
psDevmemIntCtxUnexportOUT->eError = DevmemIntCtxUnexportResManProxy(hDevMemIntCtxExportInt2);
/* Exit early if bridged call fails */
if(psDevmemIntCtxUnexportOUT->eError != PVRSRV_OK)
{
goto DevmemIntCtxUnexport_exit;
}
psDevmemIntCtxUnexportOUT->eError =
PVRSRVReleaseHandle(KERNEL_HANDLE_BASE,
(IMG_HANDLE) psDevmemIntCtxUnexportIN->hDevMemIntCtxExport,
PVRSRV_HANDLE_TYPE_DEVMEMINT_CTX_EXPORT);
DevmemIntCtxUnexport_exit:
return 0;
}
static IMG_INT
PVRSRVBridgeDevmemIntCtxImport(IMG_UINT32 ui32BridgeID,
PVRSRV_BRIDGE_IN_DEVMEMINTCTXIMPORT *psDevmemIntCtxImportIN,
PVRSRV_BRIDGE_OUT_DEVMEMINTCTXIMPORT *psDevmemIntCtxImportOUT,
CONNECTION_DATA *psConnection)
{
DEVMEMINT_CTX_EXPORT * psDevMemIntCtxExportInt = IMG_NULL;
IMG_HANDLE hDevMemIntCtxExportInt2 = IMG_NULL;
DEVMEMINT_CTX * psDevMemServerContextInt = IMG_NULL;
IMG_HANDLE hDevMemServerContextInt2 = IMG_NULL;
IMG_HANDLE hPrivDataInt = IMG_NULL;
PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_CMM_DEVMEMINTCTXIMPORT);
psDevmemIntCtxImportOUT->hDevMemServerContext = IMG_NULL;
{
/* Look up the address from the handle */
psDevmemIntCtxImportOUT->eError =
PVRSRVLookupHandle(KERNEL_HANDLE_BASE,
(IMG_HANDLE *) &hDevMemIntCtxExportInt2,
psDevmemIntCtxImportIN->hDevMemIntCtxExport,
PVRSRV_HANDLE_TYPE_DEVMEMINT_CTX_EXPORT);
if(psDevmemIntCtxImportOUT->eError != PVRSRV_OK)
{
goto DevmemIntCtxImport_exit;
}
/* Look up the data from the resman address */
psDevmemIntCtxImportOUT->eError = ResManFindPrivateDataByPtr(hDevMemIntCtxExportInt2, (IMG_VOID **) &psDevMemIntCtxExportInt);
if(psDevmemIntCtxImportOUT->eError != PVRSRV_OK)
{
goto DevmemIntCtxImport_exit;
}
}
psDevmemIntCtxImportOUT->eError =
DevmemIntCtxImport(
psDevMemIntCtxExportInt,
&psDevMemServerContextInt,
&hPrivDataInt);
/* Exit early if bridged call fails */
if(psDevmemIntCtxImportOUT->eError != PVRSRV_OK)
{
goto DevmemIntCtxImport_exit;
}
/* Create a resman item and overwrite the handle with it */
hDevMemServerContextInt2 = ResManRegisterRes(psConnection->hResManContext,
RESMAN_TYPE_DEVICEMEM2_CONTEXT,
psDevMemServerContextInt,
(RESMAN_FREE_FN)&DevmemIntCtxDestroy);
if (hDevMemServerContextInt2 == IMG_NULL)
{
psDevmemIntCtxImportOUT->eError = PVRSRV_ERROR_UNABLE_TO_REGISTER_RESOURCE;
goto DevmemIntCtxImport_exit;
}
psDevmemIntCtxImportOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase,
&psDevmemIntCtxImportOUT->hDevMemServerContext,
(IMG_HANDLE) hDevMemServerContextInt2,
PVRSRV_HANDLE_TYPE_DEVMEMINT_CTX,
PVRSRV_HANDLE_ALLOC_FLAG_NONE
);
if (psDevmemIntCtxImportOUT->eError != PVRSRV_OK)
{
goto DevmemIntCtxImport_exit;
}
psDevmemIntCtxImportOUT->eError = PVRSRVAllocSubHandle(psConnection->psHandleBase,
&psDevmemIntCtxImportOUT->hPrivData,
(IMG_HANDLE) hPrivDataInt,
PVRSRV_HANDLE_TYPE_DEV_PRIV_DATA,
PVRSRV_HANDLE_ALLOC_FLAG_MULTI
,psDevmemIntCtxImportOUT->hDevMemServerContext);
if (psDevmemIntCtxImportOUT->eError != PVRSRV_OK)
{
goto DevmemIntCtxImport_exit;
}
DevmemIntCtxImport_exit:
if (psDevmemIntCtxImportOUT->eError != PVRSRV_OK)
{
if (psDevmemIntCtxImportOUT->hDevMemServerContext)
{
PVRSRVReleaseHandle(psConnection->psHandleBase,
(IMG_HANDLE) psDevmemIntCtxImportOUT->hDevMemServerContext,
PVRSRV_HANDLE_TYPE_DEVMEMINT_CTX);
}
/* If we have a valid resman item we should undo the bridge function by freeing the resman item */
if (hDevMemServerContextInt2)
{
PVRSRV_ERROR eError = ResManFreeResByPtr(hDevMemServerContextInt2);
/* Freeing a resource should never fail... */
PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY));
}
else if (psDevMemServerContextInt)
{
DevmemIntCtxDestroy(psDevMemServerContextInt);
}
}
return 0;
}
/* ***************************************************************************
* Server bridge dispatch related glue
*/
PVRSRV_ERROR RegisterCMMFunctions(IMG_VOID);
IMG_VOID UnregisterCMMFunctions(IMG_VOID);
/*
* Register all CMM functions with services
*/
PVRSRV_ERROR RegisterCMMFunctions(IMG_VOID)
{
SetDispatchTableEntry(PVRSRV_BRIDGE_CMM_PMRWRITEPMPAGELIST, PVRSRVBridgePMRWritePMPageList);
SetDispatchTableEntry(PVRSRV_BRIDGE_CMM_PMRWRITEVFPPAGELIST, PVRSRVBridgePMRWriteVFPPageList);
SetDispatchTableEntry(PVRSRV_BRIDGE_CMM_PMRUNWRITEPMPAGELIST, PVRSRVBridgePMRUnwritePMPageList);
SetDispatchTableEntry(PVRSRV_BRIDGE_CMM_DEVMEMINTCTXEXPORT, PVRSRVBridgeDevmemIntCtxExport);
SetDispatchTableEntry(PVRSRV_BRIDGE_CMM_DEVMEMINTCTXUNEXPORT, PVRSRVBridgeDevmemIntCtxUnexport);
SetDispatchTableEntry(PVRSRV_BRIDGE_CMM_DEVMEMINTCTXIMPORT, PVRSRVBridgeDevmemIntCtxImport);
return PVRSRV_OK;
}
/*
* Unregister all cmm functions with services
*/
IMG_VOID UnregisterCMMFunctions(IMG_VOID)
{
}

View File

@@ -1,578 +0,0 @@
/*************************************************************************/ /*!
@File
@Title Common bridge header for dc
@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
@Description Declares common defines and structures that are used by both
the client and sever side of the bridge for dc
@License Dual MIT/GPLv2
The contents of this file are subject to the MIT license as set out below.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
Alternatively, the contents of this file may be used under the terms of
the GNU General Public License Version 2 ("GPL") in which case the provisions
of GPL are applicable instead of those above.
If you wish to allow use of your version of this file only under the terms of
GPL, and not to allow others to use your version of this file under the terms
of the MIT license, indicate your decision by deleting the provisions above
and replace them with the notice and other provisions required by GPL as set
out in the file called "GPL-COPYING" included in this distribution. If you do
not delete the provisions above, a recipient may use your version of this file
under the terms of either the MIT license or GPL.
This License is also included in this distribution in the file called
"MIT-COPYING".
EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ /**************************************************************************/
#ifndef COMMON_DC_BRIDGE_H
#define COMMON_DC_BRIDGE_H
#include "pvrsrv_surface.h"
#include "dc_external.h"
#include "dc_common.h"
#include "pvr_bridge_io.h"
#define PVRSRV_BRIDGE_DC_CMD_FIRST (PVRSRV_BRIDGE_DC_START)
#define PVRSRV_BRIDGE_DC_DCDEVICESQUERYCOUNT PVRSRV_IOWR(PVRSRV_BRIDGE_DC_CMD_FIRST+0)
#define PVRSRV_BRIDGE_DC_DCDEVICESENUMERATE PVRSRV_IOWR(PVRSRV_BRIDGE_DC_CMD_FIRST+1)
#define PVRSRV_BRIDGE_DC_DCDEVICEACQUIRE PVRSRV_IOWR(PVRSRV_BRIDGE_DC_CMD_FIRST+2)
#define PVRSRV_BRIDGE_DC_DCDEVICERELEASE PVRSRV_IOWR(PVRSRV_BRIDGE_DC_CMD_FIRST+3)
#define PVRSRV_BRIDGE_DC_DCGETINFO PVRSRV_IOWR(PVRSRV_BRIDGE_DC_CMD_FIRST+4)
#define PVRSRV_BRIDGE_DC_DCPANELQUERYCOUNT PVRSRV_IOWR(PVRSRV_BRIDGE_DC_CMD_FIRST+5)
#define PVRSRV_BRIDGE_DC_DCPANELQUERY PVRSRV_IOWR(PVRSRV_BRIDGE_DC_CMD_FIRST+6)
#define PVRSRV_BRIDGE_DC_DCFORMATQUERY PVRSRV_IOWR(PVRSRV_BRIDGE_DC_CMD_FIRST+7)
#define PVRSRV_BRIDGE_DC_DCDIMQUERY PVRSRV_IOWR(PVRSRV_BRIDGE_DC_CMD_FIRST+8)
#define PVRSRV_BRIDGE_DC_DCSETBLANK PVRSRV_IOWR(PVRSRV_BRIDGE_DC_CMD_FIRST+9)
#define PVRSRV_BRIDGE_DC_DCSETVSYNCREPORTING PVRSRV_IOWR(PVRSRV_BRIDGE_DC_CMD_FIRST+10)
#define PVRSRV_BRIDGE_DC_DCLASTVSYNCQUERY PVRSRV_IOWR(PVRSRV_BRIDGE_DC_CMD_FIRST+11)
#define PVRSRV_BRIDGE_DC_DCSYSTEMBUFFERACQUIRE PVRSRV_IOWR(PVRSRV_BRIDGE_DC_CMD_FIRST+12)
#define PVRSRV_BRIDGE_DC_DCSYSTEMBUFFERRELEASE PVRSRV_IOWR(PVRSRV_BRIDGE_DC_CMD_FIRST+13)
#define PVRSRV_BRIDGE_DC_DCDISPLAYCONTEXTCREATE PVRSRV_IOWR(PVRSRV_BRIDGE_DC_CMD_FIRST+14)
#define PVRSRV_BRIDGE_DC_DCDISPLAYCONTEXTCONFIGURECHECK PVRSRV_IOWR(PVRSRV_BRIDGE_DC_CMD_FIRST+15)
#define PVRSRV_BRIDGE_DC_DCDISPLAYCONTEXTCONFIGURE PVRSRV_IOWR(PVRSRV_BRIDGE_DC_CMD_FIRST+16)
#define PVRSRV_BRIDGE_DC_DCDISPLAYCONTEXTDESTROY PVRSRV_IOWR(PVRSRV_BRIDGE_DC_CMD_FIRST+17)
#define PVRSRV_BRIDGE_DC_DCBUFFERALLOC PVRSRV_IOWR(PVRSRV_BRIDGE_DC_CMD_FIRST+18)
#define PVRSRV_BRIDGE_DC_DCBUFFERIMPORT PVRSRV_IOWR(PVRSRV_BRIDGE_DC_CMD_FIRST+19)
#define PVRSRV_BRIDGE_DC_DCBUFFERFREE PVRSRV_IOWR(PVRSRV_BRIDGE_DC_CMD_FIRST+20)
#define PVRSRV_BRIDGE_DC_DCBUFFERUNIMPORT PVRSRV_IOWR(PVRSRV_BRIDGE_DC_CMD_FIRST+21)
#define PVRSRV_BRIDGE_DC_DCBUFFERPIN PVRSRV_IOWR(PVRSRV_BRIDGE_DC_CMD_FIRST+22)
#define PVRSRV_BRIDGE_DC_DCBUFFERUNPIN PVRSRV_IOWR(PVRSRV_BRIDGE_DC_CMD_FIRST+23)
#define PVRSRV_BRIDGE_DC_DCBUFFERACQUIRE PVRSRV_IOWR(PVRSRV_BRIDGE_DC_CMD_FIRST+24)
#define PVRSRV_BRIDGE_DC_DCBUFFERRELEASE PVRSRV_IOWR(PVRSRV_BRIDGE_DC_CMD_FIRST+25)
#define PVRSRV_BRIDGE_DC_CMD_LAST (PVRSRV_BRIDGE_DC_CMD_FIRST+25)
/*******************************************
DCDevicesQueryCount
*******************************************/
/* Bridge in structure for DCDevicesQueryCount */
typedef struct PVRSRV_BRIDGE_IN_DCDEVICESQUERYCOUNT_TAG
{
IMG_UINT32 ui32EmptyStructPlaceholder;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_DCDEVICESQUERYCOUNT;
/* Bridge out structure for DCDevicesQueryCount */
typedef struct PVRSRV_BRIDGE_OUT_DCDEVICESQUERYCOUNT_TAG
{
IMG_UINT32 ui32DeviceCount;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DCDEVICESQUERYCOUNT;
/*******************************************
DCDevicesEnumerate
*******************************************/
/* Bridge in structure for DCDevicesEnumerate */
typedef struct PVRSRV_BRIDGE_IN_DCDEVICESENUMERATE_TAG
{
IMG_UINT32 ui32DeviceArraySize;
/* Output pointer pui32DeviceIndex is also an implied input */
IMG_UINT32 * pui32DeviceIndex;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_DCDEVICESENUMERATE;
/* Bridge out structure for DCDevicesEnumerate */
typedef struct PVRSRV_BRIDGE_OUT_DCDEVICESENUMERATE_TAG
{
IMG_UINT32 ui32DeviceCount;
IMG_UINT32 * pui32DeviceIndex;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DCDEVICESENUMERATE;
/*******************************************
DCDeviceAcquire
*******************************************/
/* Bridge in structure for DCDeviceAcquire */
typedef struct PVRSRV_BRIDGE_IN_DCDEVICEACQUIRE_TAG
{
IMG_UINT32 ui32DeviceIndex;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_DCDEVICEACQUIRE;
/* Bridge out structure for DCDeviceAcquire */
typedef struct PVRSRV_BRIDGE_OUT_DCDEVICEACQUIRE_TAG
{
IMG_HANDLE hDevice;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DCDEVICEACQUIRE;
/*******************************************
DCDeviceRelease
*******************************************/
/* Bridge in structure for DCDeviceRelease */
typedef struct PVRSRV_BRIDGE_IN_DCDEVICERELEASE_TAG
{
IMG_HANDLE hDevice;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_DCDEVICERELEASE;
/* Bridge out structure for DCDeviceRelease */
typedef struct PVRSRV_BRIDGE_OUT_DCDEVICERELEASE_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DCDEVICERELEASE;
/*******************************************
DCGetInfo
*******************************************/
/* Bridge in structure for DCGetInfo */
typedef struct PVRSRV_BRIDGE_IN_DCGETINFO_TAG
{
IMG_HANDLE hDevice;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_DCGETINFO;
/* Bridge out structure for DCGetInfo */
typedef struct PVRSRV_BRIDGE_OUT_DCGETINFO_TAG
{
DC_DISPLAY_INFO sDisplayInfo;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DCGETINFO;
/*******************************************
DCPanelQueryCount
*******************************************/
/* Bridge in structure for DCPanelQueryCount */
typedef struct PVRSRV_BRIDGE_IN_DCPANELQUERYCOUNT_TAG
{
IMG_HANDLE hDevice;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_DCPANELQUERYCOUNT;
/* Bridge out structure for DCPanelQueryCount */
typedef struct PVRSRV_BRIDGE_OUT_DCPANELQUERYCOUNT_TAG
{
IMG_UINT32 ui32NumPanels;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DCPANELQUERYCOUNT;
/*******************************************
DCPanelQuery
*******************************************/
/* Bridge in structure for DCPanelQuery */
typedef struct PVRSRV_BRIDGE_IN_DCPANELQUERY_TAG
{
IMG_HANDLE hDevice;
IMG_UINT32 ui32PanelsArraySize;
/* Output pointer psPanelInfo is also an implied input */
PVRSRV_PANEL_INFO * psPanelInfo;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_DCPANELQUERY;
/* Bridge out structure for DCPanelQuery */
typedef struct PVRSRV_BRIDGE_OUT_DCPANELQUERY_TAG
{
IMG_UINT32 ui32NumPanels;
PVRSRV_PANEL_INFO * psPanelInfo;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DCPANELQUERY;
/*******************************************
DCFormatQuery
*******************************************/
/* Bridge in structure for DCFormatQuery */
typedef struct PVRSRV_BRIDGE_IN_DCFORMATQUERY_TAG
{
IMG_HANDLE hDevice;
IMG_UINT32 ui32NumFormats;
PVRSRV_SURFACE_FORMAT * psFormat;
/* Output pointer pui32Supported is also an implied input */
IMG_UINT32 * pui32Supported;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_DCFORMATQUERY;
/* Bridge out structure for DCFormatQuery */
typedef struct PVRSRV_BRIDGE_OUT_DCFORMATQUERY_TAG
{
IMG_UINT32 * pui32Supported;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DCFORMATQUERY;
/*******************************************
DCDimQuery
*******************************************/
/* Bridge in structure for DCDimQuery */
typedef struct PVRSRV_BRIDGE_IN_DCDIMQUERY_TAG
{
IMG_HANDLE hDevice;
IMG_UINT32 ui32NumDims;
PVRSRV_SURFACE_DIMS * psDim;
/* Output pointer pui32Supported is also an implied input */
IMG_UINT32 * pui32Supported;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_DCDIMQUERY;
/* Bridge out structure for DCDimQuery */
typedef struct PVRSRV_BRIDGE_OUT_DCDIMQUERY_TAG
{
IMG_UINT32 * pui32Supported;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DCDIMQUERY;
/*******************************************
DCSetBlank
*******************************************/
/* Bridge in structure for DCSetBlank */
typedef struct PVRSRV_BRIDGE_IN_DCSETBLANK_TAG
{
IMG_HANDLE hDevice;
IMG_BOOL bEnabled;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_DCSETBLANK;
/* Bridge out structure for DCSetBlank */
typedef struct PVRSRV_BRIDGE_OUT_DCSETBLANK_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DCSETBLANK;
/*******************************************
DCSetVSyncReporting
*******************************************/
/* Bridge in structure for DCSetVSyncReporting */
typedef struct PVRSRV_BRIDGE_IN_DCSETVSYNCREPORTING_TAG
{
IMG_HANDLE hDevice;
IMG_BOOL bEnabled;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_DCSETVSYNCREPORTING;
/* Bridge out structure for DCSetVSyncReporting */
typedef struct PVRSRV_BRIDGE_OUT_DCSETVSYNCREPORTING_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DCSETVSYNCREPORTING;
/*******************************************
DCLastVSyncQuery
*******************************************/
/* Bridge in structure for DCLastVSyncQuery */
typedef struct PVRSRV_BRIDGE_IN_DCLASTVSYNCQUERY_TAG
{
IMG_HANDLE hDevice;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_DCLASTVSYNCQUERY;
/* Bridge out structure for DCLastVSyncQuery */
typedef struct PVRSRV_BRIDGE_OUT_DCLASTVSYNCQUERY_TAG
{
IMG_INT64 i64Timestamp;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DCLASTVSYNCQUERY;
/*******************************************
DCSystemBufferAcquire
*******************************************/
/* Bridge in structure for DCSystemBufferAcquire */
typedef struct PVRSRV_BRIDGE_IN_DCSYSTEMBUFFERACQUIRE_TAG
{
IMG_HANDLE hDevice;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_DCSYSTEMBUFFERACQUIRE;
/* Bridge out structure for DCSystemBufferAcquire */
typedef struct PVRSRV_BRIDGE_OUT_DCSYSTEMBUFFERACQUIRE_TAG
{
IMG_UINT32 ui32Stride;
IMG_HANDLE hBuffer;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DCSYSTEMBUFFERACQUIRE;
/*******************************************
DCSystemBufferRelease
*******************************************/
/* Bridge in structure for DCSystemBufferRelease */
typedef struct PVRSRV_BRIDGE_IN_DCSYSTEMBUFFERRELEASE_TAG
{
IMG_HANDLE hBuffer;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_DCSYSTEMBUFFERRELEASE;
/* Bridge out structure for DCSystemBufferRelease */
typedef struct PVRSRV_BRIDGE_OUT_DCSYSTEMBUFFERRELEASE_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DCSYSTEMBUFFERRELEASE;
/*******************************************
DCDisplayContextCreate
*******************************************/
/* Bridge in structure for DCDisplayContextCreate */
typedef struct PVRSRV_BRIDGE_IN_DCDISPLAYCONTEXTCREATE_TAG
{
IMG_HANDLE hDevice;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_DCDISPLAYCONTEXTCREATE;
/* Bridge out structure for DCDisplayContextCreate */
typedef struct PVRSRV_BRIDGE_OUT_DCDISPLAYCONTEXTCREATE_TAG
{
IMG_HANDLE hDisplayContext;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DCDISPLAYCONTEXTCREATE;
/*******************************************
DCDisplayContextConfigureCheck
*******************************************/
/* Bridge in structure for DCDisplayContextConfigureCheck */
typedef struct PVRSRV_BRIDGE_IN_DCDISPLAYCONTEXTCONFIGURECHECK_TAG
{
IMG_HANDLE hDisplayContext;
IMG_UINT32 ui32PipeCount;
PVRSRV_SURFACE_CONFIG_INFO * psSurfInfo;
IMG_HANDLE * phBuffers;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_DCDISPLAYCONTEXTCONFIGURECHECK;
/* Bridge out structure for DCDisplayContextConfigureCheck */
typedef struct PVRSRV_BRIDGE_OUT_DCDISPLAYCONTEXTCONFIGURECHECK_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DCDISPLAYCONTEXTCONFIGURECHECK;
/*******************************************
DCDisplayContextConfigure
*******************************************/
/* Bridge in structure for DCDisplayContextConfigure */
typedef struct PVRSRV_BRIDGE_IN_DCDISPLAYCONTEXTCONFIGURE_TAG
{
IMG_HANDLE hDisplayContext;
IMG_UINT32 ui32PipeCount;
PVRSRV_SURFACE_CONFIG_INFO * psSurfInfo;
IMG_HANDLE * phBuffers;
IMG_UINT32 ui32SyncCount;
IMG_HANDLE * phSync;
IMG_BOOL * pbUpdate;
IMG_UINT32 ui32DisplayPeriod;
IMG_UINT32 ui32MaxDepth;
IMG_INT32 i32AcquireFd;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_DCDISPLAYCONTEXTCONFIGURE;
/* Bridge out structure for DCDisplayContextConfigure */
typedef struct PVRSRV_BRIDGE_OUT_DCDISPLAYCONTEXTCONFIGURE_TAG
{
IMG_INT32 i32ReleaseFd;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DCDISPLAYCONTEXTCONFIGURE;
/*******************************************
DCDisplayContextDestroy
*******************************************/
/* Bridge in structure for DCDisplayContextDestroy */
typedef struct PVRSRV_BRIDGE_IN_DCDISPLAYCONTEXTDESTROY_TAG
{
IMG_HANDLE hDisplayContext;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_DCDISPLAYCONTEXTDESTROY;
/* Bridge out structure for DCDisplayContextDestroy */
typedef struct PVRSRV_BRIDGE_OUT_DCDISPLAYCONTEXTDESTROY_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DCDISPLAYCONTEXTDESTROY;
/*******************************************
DCBufferAlloc
*******************************************/
/* Bridge in structure for DCBufferAlloc */
typedef struct PVRSRV_BRIDGE_IN_DCBUFFERALLOC_TAG
{
IMG_HANDLE hDisplayContext;
DC_BUFFER_CREATE_INFO sSurfInfo;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_DCBUFFERALLOC;
/* Bridge out structure for DCBufferAlloc */
typedef struct PVRSRV_BRIDGE_OUT_DCBUFFERALLOC_TAG
{
IMG_UINT32 ui32Stride;
IMG_HANDLE hBuffer;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DCBUFFERALLOC;
/*******************************************
DCBufferImport
*******************************************/
/* Bridge in structure for DCBufferImport */
typedef struct PVRSRV_BRIDGE_IN_DCBUFFERIMPORT_TAG
{
IMG_HANDLE hDisplayContext;
IMG_UINT32 ui32NumPlanes;
IMG_HANDLE * phImport;
DC_BUFFER_IMPORT_INFO sSurfAttrib;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_DCBUFFERIMPORT;
/* Bridge out structure for DCBufferImport */
typedef struct PVRSRV_BRIDGE_OUT_DCBUFFERIMPORT_TAG
{
IMG_HANDLE hBuffer;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DCBUFFERIMPORT;
/*******************************************
DCBufferFree
*******************************************/
/* Bridge in structure for DCBufferFree */
typedef struct PVRSRV_BRIDGE_IN_DCBUFFERFREE_TAG
{
IMG_HANDLE hBuffer;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_DCBUFFERFREE;
/* Bridge out structure for DCBufferFree */
typedef struct PVRSRV_BRIDGE_OUT_DCBUFFERFREE_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DCBUFFERFREE;
/*******************************************
DCBufferUnimport
*******************************************/
/* Bridge in structure for DCBufferUnimport */
typedef struct PVRSRV_BRIDGE_IN_DCBUFFERUNIMPORT_TAG
{
IMG_HANDLE hBuffer;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_DCBUFFERUNIMPORT;
/* Bridge out structure for DCBufferUnimport */
typedef struct PVRSRV_BRIDGE_OUT_DCBUFFERUNIMPORT_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DCBUFFERUNIMPORT;
/*******************************************
DCBufferPin
*******************************************/
/* Bridge in structure for DCBufferPin */
typedef struct PVRSRV_BRIDGE_IN_DCBUFFERPIN_TAG
{
IMG_HANDLE hBuffer;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_DCBUFFERPIN;
/* Bridge out structure for DCBufferPin */
typedef struct PVRSRV_BRIDGE_OUT_DCBUFFERPIN_TAG
{
IMG_HANDLE hPinHandle;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DCBUFFERPIN;
/*******************************************
DCBufferUnpin
*******************************************/
/* Bridge in structure for DCBufferUnpin */
typedef struct PVRSRV_BRIDGE_IN_DCBUFFERUNPIN_TAG
{
IMG_HANDLE hPinHandle;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_DCBUFFERUNPIN;
/* Bridge out structure for DCBufferUnpin */
typedef struct PVRSRV_BRIDGE_OUT_DCBUFFERUNPIN_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DCBUFFERUNPIN;
/*******************************************
DCBufferAcquire
*******************************************/
/* Bridge in structure for DCBufferAcquire */
typedef struct PVRSRV_BRIDGE_IN_DCBUFFERACQUIRE_TAG
{
IMG_HANDLE hBuffer;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_DCBUFFERACQUIRE;
/* Bridge out structure for DCBufferAcquire */
typedef struct PVRSRV_BRIDGE_OUT_DCBUFFERACQUIRE_TAG
{
IMG_HANDLE hExtMem;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DCBUFFERACQUIRE;
/*******************************************
DCBufferRelease
*******************************************/
/* Bridge in structure for DCBufferRelease */
typedef struct PVRSRV_BRIDGE_IN_DCBUFFERRELEASE_TAG
{
IMG_HANDLE hExtMem;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_DCBUFFERRELEASE;
/* Bridge out structure for DCBufferRelease */
typedef struct PVRSRV_BRIDGE_OUT_DCBUFFERRELEASE_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DCBUFFERRELEASE;
#endif /* COMMON_DC_BRIDGE_H */

File diff suppressed because it is too large Load Diff

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,160 +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 "devicemem_typedefs.h"
#include "rgx_bridge.h"
#include "pvrsrv_memallocflags.h"
#include "pvr_bridge_io.h"
#define PVRSRV_BRIDGE_DEBUGMISC_CMD_FIRST (PVRSRV_BRIDGE_DEBUGMISC_START)
#define PVRSRV_BRIDGE_DEBUGMISC_DEBUGMISCSLCSETBYPASSSTATE PVRSRV_IOWR(PVRSRV_BRIDGE_DEBUGMISC_CMD_FIRST+0)
#define PVRSRV_BRIDGE_DEBUGMISC_RGXDEBUGMISCSETFWLOG PVRSRV_IOWR(PVRSRV_BRIDGE_DEBUGMISC_CMD_FIRST+1)
#define PVRSRV_BRIDGE_DEBUGMISC_RGXDEBUGMISCDUMPFREELISTPAGELIST PVRSRV_IOWR(PVRSRV_BRIDGE_DEBUGMISC_CMD_FIRST+2)
#define PVRSRV_BRIDGE_DEBUGMISC_PHYSMEMIMPORTSECBUF PVRSRV_IOWR(PVRSRV_BRIDGE_DEBUGMISC_CMD_FIRST+3)
#define PVRSRV_BRIDGE_DEBUGMISC_POWMONTESTIOCTL PVRSRV_IOWR(PVRSRV_BRIDGE_DEBUGMISC_CMD_FIRST+4)
#define PVRSRV_BRIDGE_DEBUGMISC_CMD_LAST (PVRSRV_BRIDGE_DEBUGMISC_CMD_FIRST+4)
/*******************************************
DebugMiscSLCSetBypassState
*******************************************/
/* Bridge in structure for DebugMiscSLCSetBypassState */
typedef struct PVRSRV_BRIDGE_IN_DEBUGMISCSLCSETBYPASSSTATE_TAG
{
IMG_HANDLE hDevNode;
IMG_UINT32 ui32Flags;
IMG_BOOL bIsBypassed;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_DEBUGMISCSLCSETBYPASSSTATE;
/* Bridge out structure for DebugMiscSLCSetBypassState */
typedef struct PVRSRV_BRIDGE_OUT_DEBUGMISCSLCSETBYPASSSTATE_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DEBUGMISCSLCSETBYPASSSTATE;
/*******************************************
RGXDebugMiscSetFWLog
*******************************************/
/* Bridge in structure for RGXDebugMiscSetFWLog */
typedef struct PVRSRV_BRIDGE_IN_RGXDEBUGMISCSETFWLOG_TAG
{
IMG_HANDLE hDevNode;
IMG_UINT32 ui32RGXFWLogType;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXDEBUGMISCSETFWLOG;
/* Bridge out structure for RGXDebugMiscSetFWLog */
typedef struct PVRSRV_BRIDGE_OUT_RGXDEBUGMISCSETFWLOG_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXDEBUGMISCSETFWLOG;
/*******************************************
RGXDebugMiscDumpFreelistPageList
*******************************************/
/* Bridge in structure for RGXDebugMiscDumpFreelistPageList */
typedef struct PVRSRV_BRIDGE_IN_RGXDEBUGMISCDUMPFREELISTPAGELIST_TAG
{
IMG_HANDLE hDevNode;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXDEBUGMISCDUMPFREELISTPAGELIST;
/* Bridge out structure for RGXDebugMiscDumpFreelistPageList */
typedef struct PVRSRV_BRIDGE_OUT_RGXDEBUGMISCDUMPFREELISTPAGELIST_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXDEBUGMISCDUMPFREELISTPAGELIST;
/*******************************************
PhysmemImportSecBuf
*******************************************/
/* Bridge in structure for PhysmemImportSecBuf */
typedef struct PVRSRV_BRIDGE_IN_PHYSMEMIMPORTSECBUF_TAG
{
IMG_HANDLE hDevNode;
IMG_DEVMEM_SIZE_T uiSize;
IMG_UINT32 ui32Log2PageSize;
PVRSRV_MEMALLOCFLAGS_T uiFlags;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_PHYSMEMIMPORTSECBUF;
/* Bridge out structure for PhysmemImportSecBuf */
typedef struct PVRSRV_BRIDGE_OUT_PHYSMEMIMPORTSECBUF_TAG
{
IMG_HANDLE hPMRPtr;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PHYSMEMIMPORTSECBUF;
/*******************************************
PowMonTestIoctl
*******************************************/
/* Bridge in structure for PowMonTestIoctl */
typedef struct PVRSRV_BRIDGE_IN_POWMONTESTIOCTL_TAG
{
IMG_UINT32 ui32Cmd;
IMG_UINT32 ui32In1;
IMG_UINT32 ui32In2;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_POWMONTESTIOCTL;
/* Bridge out structure for PowMonTestIoctl */
typedef struct PVRSRV_BRIDGE_OUT_POWMONTESTIOCTL_TAG
{
IMG_UINT32 ui32Out1;
IMG_UINT32 ui32Out2;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_POWMONTESTIOCTL;
#endif /* COMMON_DEBUGMISC_BRIDGE_H */

View File

@@ -1,343 +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>
/* ***************************************************************************
* Bridge proxy functions
*/
/* ***************************************************************************
* Server-side bridge entry points
*/
static IMG_INT
PVRSRVBridgeDebugMiscSLCSetBypassState(IMG_UINT32 ui32BridgeID,
PVRSRV_BRIDGE_IN_DEBUGMISCSLCSETBYPASSSTATE *psDebugMiscSLCSetBypassStateIN,
PVRSRV_BRIDGE_OUT_DEBUGMISCSLCSETBYPASSSTATE *psDebugMiscSLCSetBypassStateOUT,
CONNECTION_DATA *psConnection)
{
IMG_HANDLE hDevNodeInt = IMG_NULL;
PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_DEBUGMISC_DEBUGMISCSLCSETBYPASSSTATE);
{
/* Look up the address from the handle */
psDebugMiscSLCSetBypassStateOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_HANDLE *) &hDevNodeInt,
psDebugMiscSLCSetBypassStateIN->hDevNode,
PVRSRV_HANDLE_TYPE_DEV_NODE);
if(psDebugMiscSLCSetBypassStateOUT->eError != PVRSRV_OK)
{
goto DebugMiscSLCSetBypassState_exit;
}
}
psDebugMiscSLCSetBypassStateOUT->eError =
PVRSRVDebugMiscSLCSetBypassStateKM(
hDevNodeInt,
psDebugMiscSLCSetBypassStateIN->ui32Flags,
psDebugMiscSLCSetBypassStateIN->bIsBypassed);
DebugMiscSLCSetBypassState_exit:
return 0;
}
static IMG_INT
PVRSRVBridgeRGXDebugMiscSetFWLog(IMG_UINT32 ui32BridgeID,
PVRSRV_BRIDGE_IN_RGXDEBUGMISCSETFWLOG *psRGXDebugMiscSetFWLogIN,
PVRSRV_BRIDGE_OUT_RGXDEBUGMISCSETFWLOG *psRGXDebugMiscSetFWLogOUT,
CONNECTION_DATA *psConnection)
{
IMG_HANDLE hDevNodeInt = IMG_NULL;
PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_DEBUGMISC_RGXDEBUGMISCSETFWLOG);
{
/* Look up the address from the handle */
psRGXDebugMiscSetFWLogOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_HANDLE *) &hDevNodeInt,
psRGXDebugMiscSetFWLogIN->hDevNode,
PVRSRV_HANDLE_TYPE_DEV_NODE);
if(psRGXDebugMiscSetFWLogOUT->eError != PVRSRV_OK)
{
goto RGXDebugMiscSetFWLog_exit;
}
}
psRGXDebugMiscSetFWLogOUT->eError =
PVRSRVRGXDebugMiscSetFWLogKM(
hDevNodeInt,
psRGXDebugMiscSetFWLogIN->ui32RGXFWLogType);
RGXDebugMiscSetFWLog_exit:
return 0;
}
static IMG_INT
PVRSRVBridgeRGXDebugMiscDumpFreelistPageList(IMG_UINT32 ui32BridgeID,
PVRSRV_BRIDGE_IN_RGXDEBUGMISCDUMPFREELISTPAGELIST *psRGXDebugMiscDumpFreelistPageListIN,
PVRSRV_BRIDGE_OUT_RGXDEBUGMISCDUMPFREELISTPAGELIST *psRGXDebugMiscDumpFreelistPageListOUT,
CONNECTION_DATA *psConnection)
{
IMG_HANDLE hDevNodeInt = IMG_NULL;
PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_DEBUGMISC_RGXDEBUGMISCDUMPFREELISTPAGELIST);
{
/* Look up the address from the handle */
psRGXDebugMiscDumpFreelistPageListOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_HANDLE *) &hDevNodeInt,
psRGXDebugMiscDumpFreelistPageListIN->hDevNode,
PVRSRV_HANDLE_TYPE_DEV_NODE);
if(psRGXDebugMiscDumpFreelistPageListOUT->eError != PVRSRV_OK)
{
goto RGXDebugMiscDumpFreelistPageList_exit;
}
}
psRGXDebugMiscDumpFreelistPageListOUT->eError =
PVRSRVRGXDebugMiscDumpFreelistPageListKM(
hDevNodeInt);
RGXDebugMiscDumpFreelistPageList_exit:
return 0;
}
static IMG_INT
PVRSRVBridgePhysmemImportSecBuf(IMG_UINT32 ui32BridgeID,
PVRSRV_BRIDGE_IN_PHYSMEMIMPORTSECBUF *psPhysmemImportSecBufIN,
PVRSRV_BRIDGE_OUT_PHYSMEMIMPORTSECBUF *psPhysmemImportSecBufOUT,
CONNECTION_DATA *psConnection)
{
IMG_HANDLE hDevNodeInt = IMG_NULL;
PMR * psPMRPtrInt = IMG_NULL;
IMG_HANDLE hPMRPtrInt2 = IMG_NULL;
PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_DEBUGMISC_PHYSMEMIMPORTSECBUF);
{
/* Look up the address from the handle */
psPhysmemImportSecBufOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_HANDLE *) &hDevNodeInt,
psPhysmemImportSecBufIN->hDevNode,
PVRSRV_HANDLE_TYPE_DEV_NODE);
if(psPhysmemImportSecBufOUT->eError != PVRSRV_OK)
{
goto PhysmemImportSecBuf_exit;
}
}
psPhysmemImportSecBufOUT->eError =
PhysmemNewTDSecureBufPMR(
hDevNodeInt,
psPhysmemImportSecBufIN->uiSize,
psPhysmemImportSecBufIN->ui32Log2PageSize,
psPhysmemImportSecBufIN->uiFlags,
&psPMRPtrInt);
/* Exit early if bridged call fails */
if(psPhysmemImportSecBufOUT->eError != PVRSRV_OK)
{
goto PhysmemImportSecBuf_exit;
}
/* Create a resman item and overwrite the handle with it */
hPMRPtrInt2 = ResManRegisterRes(psConnection->hResManContext,
RESMAN_TYPE_PMR,
psPMRPtrInt,
(RESMAN_FREE_FN)&PMRUnrefPMR);
if (hPMRPtrInt2 == IMG_NULL)
{
psPhysmemImportSecBufOUT->eError = PVRSRV_ERROR_UNABLE_TO_REGISTER_RESOURCE;
goto PhysmemImportSecBuf_exit;
}
psPhysmemImportSecBufOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase,
&psPhysmemImportSecBufOUT->hPMRPtr,
(IMG_HANDLE) hPMRPtrInt2,
PVRSRV_HANDLE_TYPE_PHYSMEM_PMR,
PVRSRV_HANDLE_ALLOC_FLAG_NONE
);
if (psPhysmemImportSecBufOUT->eError != PVRSRV_OK)
{
goto PhysmemImportSecBuf_exit;
}
PhysmemImportSecBuf_exit:
if (psPhysmemImportSecBufOUT->eError != PVRSRV_OK)
{
/* If we have a valid resman item we should undo the bridge function by freeing the resman item */
if (hPMRPtrInt2)
{
PVRSRV_ERROR eError = ResManFreeResByPtr(hPMRPtrInt2);
/* Freeing a resource should never fail... */
PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY));
}
else if (psPMRPtrInt)
{
PMRUnrefPMR(psPMRPtrInt);
}
}
return 0;
}
static IMG_INT
PVRSRVBridgePowMonTestIoctl(IMG_UINT32 ui32BridgeID,
PVRSRV_BRIDGE_IN_POWMONTESTIOCTL *psPowMonTestIoctlIN,
PVRSRV_BRIDGE_OUT_POWMONTESTIOCTL *psPowMonTestIoctlOUT,
CONNECTION_DATA *psConnection)
{
PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_DEBUGMISC_POWMONTESTIOCTL);
PVR_UNREFERENCED_PARAMETER(psConnection);
psPowMonTestIoctlOUT->eError =
PowMonTestIoctlKM(
psPowMonTestIoctlIN->ui32Cmd,
psPowMonTestIoctlIN->ui32In1,
psPowMonTestIoctlIN->ui32In2,
&psPowMonTestIoctlOUT->ui32Out1,
&psPowMonTestIoctlOUT->ui32Out2);
return 0;
}
/* ***************************************************************************
* Server bridge dispatch related glue
*/
PVRSRV_ERROR RegisterDEBUGMISCFunctions(IMG_VOID);
IMG_VOID UnregisterDEBUGMISCFunctions(IMG_VOID);
/*
* Register all DEBUGMISC functions with services
*/
PVRSRV_ERROR RegisterDEBUGMISCFunctions(IMG_VOID)
{
SetDispatchTableEntry(PVRSRV_BRIDGE_DEBUGMISC_DEBUGMISCSLCSETBYPASSSTATE, PVRSRVBridgeDebugMiscSLCSetBypassState);
SetDispatchTableEntry(PVRSRV_BRIDGE_DEBUGMISC_RGXDEBUGMISCSETFWLOG, PVRSRVBridgeRGXDebugMiscSetFWLog);
SetDispatchTableEntry(PVRSRV_BRIDGE_DEBUGMISC_RGXDEBUGMISCDUMPFREELISTPAGELIST, PVRSRVBridgeRGXDebugMiscDumpFreelistPageList);
SetDispatchTableEntry(PVRSRV_BRIDGE_DEBUGMISC_PHYSMEMIMPORTSECBUF, PVRSRVBridgePhysmemImportSecBuf);
SetDispatchTableEntry(PVRSRV_BRIDGE_DEBUGMISC_POWMONTESTIOCTL, PVRSRVBridgePowMonTestIoctl);
return PVRSRV_OK;
}
/*
* Unregister all debugmisc functions with services
*/
IMG_VOID UnregisterDEBUGMISCFunctions(IMG_VOID)
{
}

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,98 +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 "mm_common.h"
#include "pvr_bridge_io.h"
#define PVRSRV_BRIDGE_DEVICEMEMHISTORY_CMD_FIRST (PVRSRV_BRIDGE_DEVICEMEMHISTORY_START)
#define PVRSRV_BRIDGE_DEVICEMEMHISTORY_DEVICEMEMHISTORYMAP PVRSRV_IOWR(PVRSRV_BRIDGE_DEVICEMEMHISTORY_CMD_FIRST+0)
#define PVRSRV_BRIDGE_DEVICEMEMHISTORY_DEVICEMEMHISTORYUNMAP PVRSRV_IOWR(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;
} PVRSRV_BRIDGE_IN_DEVICEMEMHISTORYMAP;
/* Bridge out structure for DevicememHistoryMap */
typedef struct PVRSRV_BRIDGE_OUT_DEVICEMEMHISTORYMAP_TAG
{
PVRSRV_ERROR eError;
} 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;
} PVRSRV_BRIDGE_IN_DEVICEMEMHISTORYUNMAP;
/* Bridge out structure for DevicememHistoryUnmap */
typedef struct PVRSRV_BRIDGE_OUT_DEVICEMEMHISTORYUNMAP_TAG
{
PVRSRV_ERROR eError;
} PVRSRV_BRIDGE_OUT_DEVICEMEMHISTORYUNMAP;
#endif /* COMMON_DEVICEMEMHISTORY_BRIDGE_H */

View File

@@ -1,203 +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>
/* ***************************************************************************
* Bridge proxy functions
*/
/* ***************************************************************************
* Server-side bridge entry points
*/
static IMG_INT
PVRSRVBridgeDevicememHistoryMap(IMG_UINT32 ui32BridgeID,
PVRSRV_BRIDGE_IN_DEVICEMEMHISTORYMAP *psDevicememHistoryMapIN,
PVRSRV_BRIDGE_OUT_DEVICEMEMHISTORYMAP *psDevicememHistoryMapOUT,
CONNECTION_DATA *psConnection)
{
IMG_CHAR *uiTextInt = IMG_NULL;
PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_DEVICEMEMHISTORY_DEVICEMEMHISTORYMAP);
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 ui32BridgeID,
PVRSRV_BRIDGE_IN_DEVICEMEMHISTORYUNMAP *psDevicememHistoryUnmapIN,
PVRSRV_BRIDGE_OUT_DEVICEMEMHISTORYUNMAP *psDevicememHistoryUnmapOUT,
CONNECTION_DATA *psConnection)
{
IMG_CHAR *uiTextInt = IMG_NULL;
PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_DEVICEMEMHISTORY_DEVICEMEMHISTORYUNMAP);
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
*/
PVRSRV_ERROR RegisterDEVICEMEMHISTORYFunctions(IMG_VOID);
IMG_VOID UnregisterDEVICEMEMHISTORYFunctions(IMG_VOID);
/*
* Register all DEVICEMEMHISTORY functions with services
*/
PVRSRV_ERROR RegisterDEVICEMEMHISTORYFunctions(IMG_VOID)
{
SetDispatchTableEntry(PVRSRV_BRIDGE_DEVICEMEMHISTORY_DEVICEMEMHISTORYMAP, PVRSRVBridgeDevicememHistoryMap);
SetDispatchTableEntry(PVRSRV_BRIDGE_DEVICEMEMHISTORY_DEVICEMEMHISTORYUNMAP, PVRSRVBridgeDevicememHistoryUnmap);
return PVRSRV_OK;
}
/*
* Unregister all devicememhistory functions with services
*/
IMG_VOID UnregisterDEVICEMEMHISTORYFunctions(IMG_VOID)
{
}

View File

@@ -1,79 +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 "pvrsrv_memallocflags.h"
#include "pvr_bridge_io.h"
#define PVRSRV_BRIDGE_DMABUF_CMD_FIRST (PVRSRV_BRIDGE_DMABUF_START)
#define PVRSRV_BRIDGE_DMABUF_PHYSMEMIMPORTDMABUF PVRSRV_IOWR(PVRSRV_BRIDGE_DMABUF_CMD_FIRST+0)
#define PVRSRV_BRIDGE_DMABUF_CMD_LAST (PVRSRV_BRIDGE_DMABUF_CMD_FIRST+0)
/*******************************************
PhysmemImportDmaBuf
*******************************************/
/* Bridge in structure for PhysmemImportDmaBuf */
typedef struct PVRSRV_BRIDGE_IN_PHYSMEMIMPORTDMABUF_TAG
{
IMG_INT ifd;
PVRSRV_MEMALLOCFLAGS_T uiFlags;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_PHYSMEMIMPORTDMABUF;
/* Bridge out structure for PhysmemImportDmaBuf */
typedef struct PVRSRV_BRIDGE_OUT_PHYSMEMIMPORTDMABUF_TAG
{
IMG_HANDLE hPMRPtr;
IMG_DEVMEM_SIZE_T uiSize;
IMG_DEVMEM_ALIGN_T sAlign;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PHYSMEMIMPORTDMABUF;
#endif /* COMMON_DMABUF_BRIDGE_H */

View File

@@ -1,174 +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>
/* ***************************************************************************
* Bridge proxy functions
*/
/* ***************************************************************************
* Server-side bridge entry points
*/
static IMG_INT
PVRSRVBridgePhysmemImportDmaBuf(IMG_UINT32 ui32BridgeID,
PVRSRV_BRIDGE_IN_PHYSMEMIMPORTDMABUF *psPhysmemImportDmaBufIN,
PVRSRV_BRIDGE_OUT_PHYSMEMIMPORTDMABUF *psPhysmemImportDmaBufOUT,
CONNECTION_DATA *psConnection)
{
PMR * psPMRPtrInt = IMG_NULL;
IMG_HANDLE hPMRPtrInt2 = IMG_NULL;
PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_DMABUF_PHYSMEMIMPORTDMABUF);
psPhysmemImportDmaBufOUT->eError =
PhysmemImportDmaBuf(psConnection,
psPhysmemImportDmaBufIN->ifd,
psPhysmemImportDmaBufIN->uiFlags,
&psPMRPtrInt,
&psPhysmemImportDmaBufOUT->uiSize,
&psPhysmemImportDmaBufOUT->sAlign);
/* Exit early if bridged call fails */
if(psPhysmemImportDmaBufOUT->eError != PVRSRV_OK)
{
goto PhysmemImportDmaBuf_exit;
}
/* Create a resman item and overwrite the handle with it */
hPMRPtrInt2 = ResManRegisterRes(psConnection->hResManContext,
RESMAN_TYPE_PMR,
psPMRPtrInt,
(RESMAN_FREE_FN)&PMRUnrefPMR);
if (hPMRPtrInt2 == IMG_NULL)
{
psPhysmemImportDmaBufOUT->eError = PVRSRV_ERROR_UNABLE_TO_REGISTER_RESOURCE;
goto PhysmemImportDmaBuf_exit;
}
psPhysmemImportDmaBufOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase,
&psPhysmemImportDmaBufOUT->hPMRPtr,
(IMG_HANDLE) hPMRPtrInt2,
PVRSRV_HANDLE_TYPE_PHYSMEM_PMR,
PVRSRV_HANDLE_ALLOC_FLAG_NONE
);
if (psPhysmemImportDmaBufOUT->eError != PVRSRV_OK)
{
goto PhysmemImportDmaBuf_exit;
}
PhysmemImportDmaBuf_exit:
if (psPhysmemImportDmaBufOUT->eError != PVRSRV_OK)
{
/* If we have a valid resman item we should undo the bridge function by freeing the resman item */
if (hPMRPtrInt2)
{
PVRSRV_ERROR eError = ResManFreeResByPtr(hPMRPtrInt2);
/* Freeing a resource should never fail... */
PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY));
}
else if (psPMRPtrInt)
{
PMRUnrefPMR(psPMRPtrInt);
}
}
return 0;
}
/* ***************************************************************************
* Server bridge dispatch related glue
*/
PVRSRV_ERROR RegisterDMABUFFunctions(IMG_VOID);
IMG_VOID UnregisterDMABUFFunctions(IMG_VOID);
/*
* Register all DMABUF functions with services
*/
PVRSRV_ERROR RegisterDMABUFFunctions(IMG_VOID)
{
SetDispatchTableEntry(PVRSRV_BRIDGE_DMABUF_PHYSMEMIMPORTDMABUF, PVRSRVBridgePhysmemImportDmaBuf);
return PVRSRV_OK;
}
/*
* Unregister all dmabuf functions with services
*/
IMG_VOID UnregisterDMABUFFunctions(IMG_VOID)
{
}

View File

@@ -1,535 +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 BridgeHeapCfgHeapConfigCount(IMG_HANDLE hBridge,
IMG_HANDLE hDeviceNode,
IMG_UINT32 *pui32NumHeapConfigs)
{
PVRSRV_ERROR eError;
IMG_HANDLE hDeviceNodeInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
hDeviceNodeInt = (IMG_HANDLE) hDeviceNode;
eError =
HeapCfgHeapConfigCount(
hDeviceNodeInt,
pui32NumHeapConfigs);
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeHeapCfgHeapCount(IMG_HANDLE hBridge,
IMG_HANDLE hDeviceNode,
IMG_UINT32 ui32HeapConfigIndex,
IMG_UINT32 *pui32NumHeaps)
{
PVRSRV_ERROR eError;
IMG_HANDLE hDeviceNodeInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
hDeviceNodeInt = (IMG_HANDLE) hDeviceNode;
eError =
HeapCfgHeapCount(
hDeviceNodeInt,
ui32HeapConfigIndex,
pui32NumHeaps);
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeHeapCfgHeapConfigName(IMG_HANDLE hBridge,
IMG_HANDLE hDeviceNode,
IMG_UINT32 ui32HeapConfigIndex,
IMG_UINT32 ui32HeapConfigNameBufSz,
IMG_CHAR *puiHeapConfigName)
{
PVRSRV_ERROR eError;
IMG_HANDLE hDeviceNodeInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
hDeviceNodeInt = (IMG_HANDLE) hDeviceNode;
eError =
HeapCfgHeapConfigName(
hDeviceNodeInt,
ui32HeapConfigIndex,
ui32HeapConfigNameBufSz,
puiHeapConfigName);
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeHeapCfgHeapDetails(IMG_HANDLE hBridge,
IMG_HANDLE hDeviceNode,
IMG_UINT32 ui32HeapConfigIndex,
IMG_UINT32 ui32HeapIndex,
IMG_UINT32 ui32HeapNameBufSz,
IMG_CHAR *puiHeapNameOut,
IMG_DEV_VIRTADDR *psDevVAddrBase,
IMG_DEVMEM_SIZE_T *puiHeapLength,
IMG_UINT32 *pui32Log2DataPageSizeOut)
{
PVRSRV_ERROR eError;
IMG_HANDLE hDeviceNodeInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
hDeviceNodeInt = (IMG_HANDLE) hDeviceNode;
eError =
HeapCfgHeapDetails(
hDeviceNodeInt,
ui32HeapConfigIndex,
ui32HeapIndex,
ui32HeapNameBufSz,
puiHeapNameOut,
psDevVAddrBase,
puiHeapLength,
pui32Log2DataPageSizeOut);
return eError;
}

View File

@@ -1,165 +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 BridgeHeapCfgHeapConfigCount(IMG_HANDLE hBridge,
IMG_HANDLE hDeviceNode,
IMG_UINT32 *pui32NumHeapConfigs);
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeHeapCfgHeapCount(IMG_HANDLE hBridge,
IMG_HANDLE hDeviceNode,
IMG_UINT32 ui32HeapConfigIndex,
IMG_UINT32 *pui32NumHeaps);
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeHeapCfgHeapConfigName(IMG_HANDLE hBridge,
IMG_HANDLE hDeviceNode,
IMG_UINT32 ui32HeapConfigIndex,
IMG_UINT32 ui32HeapConfigNameBufSz,
IMG_CHAR *puiHeapConfigName);
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeHeapCfgHeapDetails(IMG_HANDLE hBridge,
IMG_HANDLE hDeviceNode,
IMG_UINT32 ui32HeapConfigIndex,
IMG_UINT32 ui32HeapIndex,
IMG_UINT32 ui32HeapNameBufSz,
IMG_CHAR *puiHeapNameOut,
IMG_DEV_VIRTADDR *psDevVAddrBase,
IMG_DEVMEM_SIZE_T *puiHeapLength,
IMG_UINT32 *pui32Log2DataPageSizeOut);
#endif /* CLIENT_MM_BRIDGE_H */

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,177 +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 "tltestdefs.h"
#include "tlserver.h"
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeTLConnect(IMG_HANDLE hBridge)
{
PVRSRV_ERROR eError;
eError =
TLServerConnectKM(hBridge
);
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeTLDisconnect(IMG_HANDLE hBridge)
{
PVRSRV_ERROR eError;
eError =
TLServerDisconnectKM(hBridge
);
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeTLOpenStream(IMG_HANDLE hBridge,
IMG_CHAR *puiName,
IMG_UINT32 ui32Mode,
IMG_HANDLE *phSD,
DEVMEM_SERVER_EXPORTCOOKIE *phClientBUFExportCookie)
{
PVRSRV_ERROR eError;
TL_STREAM_DESC * psSDInt;
DEVMEM_EXPORTCOOKIE * psClientBUFExportCookieInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
eError =
TLServerOpenStreamKM(
puiName,
ui32Mode,
&psSDInt,
&psClientBUFExportCookieInt);
*phSD = psSDInt;
*phClientBUFExportCookie = psClientBUFExportCookieInt;
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeTLCloseStream(IMG_HANDLE hBridge,
IMG_HANDLE hSD)
{
PVRSRV_ERROR eError;
TL_STREAM_DESC * psSDInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
psSDInt = (TL_STREAM_DESC *) hSD;
eError =
TLServerCloseStreamKM(
psSDInt);
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeTLAcquireData(IMG_HANDLE hBridge,
IMG_HANDLE hSD,
IMG_UINT32 *pui32ReadOffset,
IMG_UINT32 *pui32ReadLen)
{
PVRSRV_ERROR eError;
TL_STREAM_DESC * psSDInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
psSDInt = (TL_STREAM_DESC *) hSD;
eError =
TLServerAcquireDataKM(
psSDInt,
pui32ReadOffset,
pui32ReadLen);
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeTLReleaseData(IMG_HANDLE hBridge,
IMG_HANDLE hSD,
IMG_UINT32 ui32ReadOffset,
IMG_UINT32 ui32ReadLen)
{
PVRSRV_ERROR eError;
TL_STREAM_DESC * psSDInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
psSDInt = (TL_STREAM_DESC *) hSD;
eError =
TLServerReleaseDataKM(
psSDInt,
ui32ReadOffset,
ui32ReadLen);
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeTLTestIoctl(IMG_HANDLE hBridge,
IMG_UINT32 ui32Cmd,
IMG_BYTE *psIn1,
IMG_UINT32 ui32In2,
IMG_UINT32 *pui32Out1,
IMG_UINT32 *pui32Out2)
{
PVRSRV_ERROR eError;
PVR_UNREFERENCED_PARAMETER(hBridge);
eError =
TLServerTestIoctlKM(
ui32Cmd,
psIn1,
ui32In2,
pui32Out1,
pui32Out2);
return eError;
}

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_SIZE_T uiLogicalSize)
{
PVRSRV_ERROR eError;
PMR * psPMRHandleInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
psPMRHandleInt = (PMR *) hPMRHandle;
eError =
RIWritePMREntryKM(
psPMRHandleInt,
ui32TextASize,
puiTextA,
uiLogicalSize);
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeRIWriteMEMDESCEntry(IMG_HANDLE hBridge,
IMG_HANDLE hPMRHandle,
IMG_UINT32 ui32TextBSize,
const IMG_CHAR *puiTextB,
IMG_SIZE_T uiOffset,
IMG_SIZE_T uiSize,
IMG_BOOL bIsImport,
IMG_BOOL bIsExportable,
IMG_HANDLE *phRIHandle)
{
PVRSRV_ERROR eError;
PMR * psPMRHandleInt;
RI_HANDLE psRIHandleInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
psPMRHandleInt = (PMR *) hPMRHandle;
eError =
RIWriteMEMDESCEntryKM(
psPMRHandleInt,
ui32TextBSize,
puiTextB,
uiOffset,
uiSize,
bIsImport,
bIsExportable,
&psRIHandleInt);
*phRIHandle = psRIHandleInt;
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeRIUpdateMEMDESCAddr(IMG_HANDLE hBridge,
IMG_HANDLE hRIHandle,
IMG_DEV_VIRTADDR sAddr)
{
PVRSRV_ERROR eError;
RI_HANDLE psRIHandleInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
psRIHandleInt = (RI_HANDLE) hRIHandle;
eError =
RIUpdateMEMDESCAddrKM(
psRIHandleInt,
sAddr);
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeRIDeleteMEMDESCEntry(IMG_HANDLE hBridge,
IMG_HANDLE hRIHandle)
{
PVRSRV_ERROR eError;
RI_HANDLE psRIHandleInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
psRIHandleInt = (RI_HANDLE) hRIHandle;
eError =
RIDeleteMEMDESCEntryKM(
psRIHandleInt);
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeRIDumpList(IMG_HANDLE hBridge,
IMG_HANDLE hPMRHandle)
{
PVRSRV_ERROR eError;
PMR * psPMRHandleInt;
PVR_UNREFERENCED_PARAMETER(hBridge);
psPMRHandleInt = (PMR *) hPMRHandle;
eError =
RIDumpListKM(
psPMRHandleInt);
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeRIDumpAll(IMG_HANDLE hBridge)
{
PVRSRV_ERROR eError;
PVR_UNREFERENCED_PARAMETER(hBridge);
eError =
RIDumpAllKM(
);
return eError;
}
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeRIDumpProcess(IMG_HANDLE hBridge,
IMG_PID ui32Pid)
{
PVRSRV_ERROR eError;
PVR_UNREFERENCED_PARAMETER(hBridge);
eError =
RIDumpProcessKM(
ui32Pid);
return eError;
}

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,527 +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 "pvrsrv_memallocflags.h"
#include "devicemem_typedefs.h"
#include "pvr_bridge_io.h"
#define PVRSRV_BRIDGE_MM_CMD_FIRST (PVRSRV_BRIDGE_MM_START)
#define PVRSRV_BRIDGE_MM_PMREXPORTPMR PVRSRV_IOWR(PVRSRV_BRIDGE_MM_CMD_FIRST+0)
#define PVRSRV_BRIDGE_MM_PMRUNEXPORTPMR PVRSRV_IOWR(PVRSRV_BRIDGE_MM_CMD_FIRST+1)
#define PVRSRV_BRIDGE_MM_PMRGETUID PVRSRV_IOWR(PVRSRV_BRIDGE_MM_CMD_FIRST+2)
#define PVRSRV_BRIDGE_MM_PMRMAKESERVEREXPORTCLIENTEXPORT PVRSRV_IOWR(PVRSRV_BRIDGE_MM_CMD_FIRST+3)
#define PVRSRV_BRIDGE_MM_PMRUNMAKESERVEREXPORTCLIENTEXPORT PVRSRV_IOWR(PVRSRV_BRIDGE_MM_CMD_FIRST+4)
#define PVRSRV_BRIDGE_MM_PMRIMPORTPMR PVRSRV_IOWR(PVRSRV_BRIDGE_MM_CMD_FIRST+5)
#define PVRSRV_BRIDGE_MM_DEVMEMINTCTXCREATE PVRSRV_IOWR(PVRSRV_BRIDGE_MM_CMD_FIRST+6)
#define PVRSRV_BRIDGE_MM_DEVMEMINTCTXDESTROY PVRSRV_IOWR(PVRSRV_BRIDGE_MM_CMD_FIRST+7)
#define PVRSRV_BRIDGE_MM_DEVMEMINTHEAPCREATE PVRSRV_IOWR(PVRSRV_BRIDGE_MM_CMD_FIRST+8)
#define PVRSRV_BRIDGE_MM_DEVMEMINTHEAPDESTROY PVRSRV_IOWR(PVRSRV_BRIDGE_MM_CMD_FIRST+9)
#define PVRSRV_BRIDGE_MM_DEVMEMINTMAPPMR PVRSRV_IOWR(PVRSRV_BRIDGE_MM_CMD_FIRST+10)
#define PVRSRV_BRIDGE_MM_DEVMEMINTUNMAPPMR PVRSRV_IOWR(PVRSRV_BRIDGE_MM_CMD_FIRST+11)
#define PVRSRV_BRIDGE_MM_DEVMEMINTRESERVERANGE PVRSRV_IOWR(PVRSRV_BRIDGE_MM_CMD_FIRST+12)
#define PVRSRV_BRIDGE_MM_DEVMEMINTUNRESERVERANGE PVRSRV_IOWR(PVRSRV_BRIDGE_MM_CMD_FIRST+13)
#define PVRSRV_BRIDGE_MM_PHYSMEMNEWRAMBACKEDPMR PVRSRV_IOWR(PVRSRV_BRIDGE_MM_CMD_FIRST+14)
#define PVRSRV_BRIDGE_MM_PMRLOCALIMPORTPMR PVRSRV_IOWR(PVRSRV_BRIDGE_MM_CMD_FIRST+15)
#define PVRSRV_BRIDGE_MM_PMRUNREFPMR PVRSRV_IOWR(PVRSRV_BRIDGE_MM_CMD_FIRST+16)
#define PVRSRV_BRIDGE_MM_DEVMEMSLCFLUSHINVALREQUEST PVRSRV_IOWR(PVRSRV_BRIDGE_MM_CMD_FIRST+17)
#define PVRSRV_BRIDGE_MM_HEAPCFGHEAPCONFIGCOUNT PVRSRV_IOWR(PVRSRV_BRIDGE_MM_CMD_FIRST+18)
#define PVRSRV_BRIDGE_MM_HEAPCFGHEAPCOUNT PVRSRV_IOWR(PVRSRV_BRIDGE_MM_CMD_FIRST+19)
#define PVRSRV_BRIDGE_MM_HEAPCFGHEAPCONFIGNAME PVRSRV_IOWR(PVRSRV_BRIDGE_MM_CMD_FIRST+20)
#define PVRSRV_BRIDGE_MM_HEAPCFGHEAPDETAILS PVRSRV_IOWR(PVRSRV_BRIDGE_MM_CMD_FIRST+21)
#define PVRSRV_BRIDGE_MM_CMD_LAST (PVRSRV_BRIDGE_MM_CMD_FIRST+21)
/*******************************************
PMRExportPMR
*******************************************/
/* Bridge in structure for PMRExportPMR */
typedef struct PVRSRV_BRIDGE_IN_PMREXPORTPMR_TAG
{
IMG_HANDLE hPMR;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_PMREXPORTPMR;
/* Bridge out structure for PMRExportPMR */
typedef struct PVRSRV_BRIDGE_OUT_PMREXPORTPMR_TAG
{
IMG_HANDLE hPMRExport;
IMG_UINT64 ui64Size;
IMG_UINT32 ui32Log2Contig;
IMG_UINT64 ui64Password;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PMREXPORTPMR;
/*******************************************
PMRUnexportPMR
*******************************************/
/* Bridge in structure for PMRUnexportPMR */
typedef struct PVRSRV_BRIDGE_IN_PMRUNEXPORTPMR_TAG
{
IMG_HANDLE hPMRExport;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_PMRUNEXPORTPMR;
/* Bridge out structure for PMRUnexportPMR */
typedef struct PVRSRV_BRIDGE_OUT_PMRUNEXPORTPMR_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PMRUNEXPORTPMR;
/*******************************************
PMRGetUID
*******************************************/
/* Bridge in structure for PMRGetUID */
typedef struct PVRSRV_BRIDGE_IN_PMRGETUID_TAG
{
IMG_HANDLE hPMR;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_PMRGETUID;
/* Bridge out structure for PMRGetUID */
typedef struct PVRSRV_BRIDGE_OUT_PMRGETUID_TAG
{
IMG_UINT64 ui64UID;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PMRGETUID;
/*******************************************
PMRMakeServerExportClientExport
*******************************************/
/* Bridge in structure for PMRMakeServerExportClientExport */
typedef struct PVRSRV_BRIDGE_IN_PMRMAKESERVEREXPORTCLIENTEXPORT_TAG
{
DEVMEM_SERVER_EXPORTCOOKIE hPMRServerExport;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_PMRMAKESERVEREXPORTCLIENTEXPORT;
/* Bridge out structure for PMRMakeServerExportClientExport */
typedef struct PVRSRV_BRIDGE_OUT_PMRMAKESERVEREXPORTCLIENTEXPORT_TAG
{
IMG_HANDLE hPMRExportOut;
IMG_UINT64 ui64Size;
IMG_UINT32 ui32Log2Contig;
IMG_UINT64 ui64Password;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PMRMAKESERVEREXPORTCLIENTEXPORT;
/*******************************************
PMRUnmakeServerExportClientExport
*******************************************/
/* Bridge in structure for PMRUnmakeServerExportClientExport */
typedef struct PVRSRV_BRIDGE_IN_PMRUNMAKESERVEREXPORTCLIENTEXPORT_TAG
{
IMG_HANDLE hPMRExport;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_PMRUNMAKESERVEREXPORTCLIENTEXPORT;
/* Bridge out structure for PMRUnmakeServerExportClientExport */
typedef struct PVRSRV_BRIDGE_OUT_PMRUNMAKESERVEREXPORTCLIENTEXPORT_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PMRUNMAKESERVEREXPORTCLIENTEXPORT;
/*******************************************
PMRImportPMR
*******************************************/
/* Bridge in structure for PMRImportPMR */
typedef struct PVRSRV_BRIDGE_IN_PMRIMPORTPMR_TAG
{
IMG_HANDLE hPMRExport;
IMG_UINT64 ui64uiPassword;
IMG_UINT64 ui64uiSize;
IMG_UINT32 ui32uiLog2Contig;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_PMRIMPORTPMR;
/* Bridge out structure for PMRImportPMR */
typedef struct PVRSRV_BRIDGE_OUT_PMRIMPORTPMR_TAG
{
IMG_HANDLE hPMR;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PMRIMPORTPMR;
/*******************************************
DevmemIntCtxCreate
*******************************************/
/* Bridge in structure for DevmemIntCtxCreate */
typedef struct PVRSRV_BRIDGE_IN_DEVMEMINTCTXCREATE_TAG
{
IMG_HANDLE hDeviceNode;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_DEVMEMINTCTXCREATE;
/* Bridge out structure for DevmemIntCtxCreate */
typedef struct PVRSRV_BRIDGE_OUT_DEVMEMINTCTXCREATE_TAG
{
IMG_HANDLE hDevMemServerContext;
IMG_HANDLE hPrivData;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DEVMEMINTCTXCREATE;
/*******************************************
DevmemIntCtxDestroy
*******************************************/
/* Bridge in structure for DevmemIntCtxDestroy */
typedef struct PVRSRV_BRIDGE_IN_DEVMEMINTCTXDESTROY_TAG
{
IMG_HANDLE hDevmemServerContext;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_DEVMEMINTCTXDESTROY;
/* Bridge out structure for DevmemIntCtxDestroy */
typedef struct PVRSRV_BRIDGE_OUT_DEVMEMINTCTXDESTROY_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DEVMEMINTCTXDESTROY;
/*******************************************
DevmemIntHeapCreate
*******************************************/
/* Bridge in structure for DevmemIntHeapCreate */
typedef struct PVRSRV_BRIDGE_IN_DEVMEMINTHEAPCREATE_TAG
{
IMG_HANDLE hDevmemCtx;
IMG_DEV_VIRTADDR sHeapBaseAddr;
IMG_DEVMEM_SIZE_T uiHeapLength;
IMG_UINT32 ui32Log2DataPageSize;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_DEVMEMINTHEAPCREATE;
/* Bridge out structure for DevmemIntHeapCreate */
typedef struct PVRSRV_BRIDGE_OUT_DEVMEMINTHEAPCREATE_TAG
{
IMG_HANDLE hDevmemHeapPtr;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DEVMEMINTHEAPCREATE;
/*******************************************
DevmemIntHeapDestroy
*******************************************/
/* Bridge in structure for DevmemIntHeapDestroy */
typedef struct PVRSRV_BRIDGE_IN_DEVMEMINTHEAPDESTROY_TAG
{
IMG_HANDLE hDevmemHeap;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_DEVMEMINTHEAPDESTROY;
/* Bridge out structure for DevmemIntHeapDestroy */
typedef struct PVRSRV_BRIDGE_OUT_DEVMEMINTHEAPDESTROY_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DEVMEMINTHEAPDESTROY;
/*******************************************
DevmemIntMapPMR
*******************************************/
/* Bridge in structure for DevmemIntMapPMR */
typedef struct PVRSRV_BRIDGE_IN_DEVMEMINTMAPPMR_TAG
{
IMG_HANDLE hDevmemServerHeap;
IMG_HANDLE hReservation;
IMG_HANDLE hPMR;
PVRSRV_MEMALLOCFLAGS_T uiMapFlags;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_DEVMEMINTMAPPMR;
/* Bridge out structure for DevmemIntMapPMR */
typedef struct PVRSRV_BRIDGE_OUT_DEVMEMINTMAPPMR_TAG
{
IMG_HANDLE hMapping;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DEVMEMINTMAPPMR;
/*******************************************
DevmemIntUnmapPMR
*******************************************/
/* Bridge in structure for DevmemIntUnmapPMR */
typedef struct PVRSRV_BRIDGE_IN_DEVMEMINTUNMAPPMR_TAG
{
IMG_HANDLE hMapping;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_DEVMEMINTUNMAPPMR;
/* Bridge out structure for DevmemIntUnmapPMR */
typedef struct PVRSRV_BRIDGE_OUT_DEVMEMINTUNMAPPMR_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DEVMEMINTUNMAPPMR;
/*******************************************
DevmemIntReserveRange
*******************************************/
/* Bridge in structure for DevmemIntReserveRange */
typedef struct PVRSRV_BRIDGE_IN_DEVMEMINTRESERVERANGE_TAG
{
IMG_HANDLE hDevmemServerHeap;
IMG_DEV_VIRTADDR sAddress;
IMG_DEVMEM_SIZE_T uiLength;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_DEVMEMINTRESERVERANGE;
/* Bridge out structure for DevmemIntReserveRange */
typedef struct PVRSRV_BRIDGE_OUT_DEVMEMINTRESERVERANGE_TAG
{
IMG_HANDLE hReservation;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DEVMEMINTRESERVERANGE;
/*******************************************
DevmemIntUnreserveRange
*******************************************/
/* Bridge in structure for DevmemIntUnreserveRange */
typedef struct PVRSRV_BRIDGE_IN_DEVMEMINTUNRESERVERANGE_TAG
{
IMG_HANDLE hReservation;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_DEVMEMINTUNRESERVERANGE;
/* Bridge out structure for DevmemIntUnreserveRange */
typedef struct PVRSRV_BRIDGE_OUT_DEVMEMINTUNRESERVERANGE_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DEVMEMINTUNRESERVERANGE;
/*******************************************
PhysmemNewRamBackedPMR
*******************************************/
/* Bridge in structure for PhysmemNewRamBackedPMR */
typedef struct PVRSRV_BRIDGE_IN_PHYSMEMNEWRAMBACKEDPMR_TAG
{
IMG_HANDLE hDeviceNode;
IMG_DEVMEM_SIZE_T uiSize;
IMG_DEVMEM_SIZE_T uiChunkSize;
IMG_UINT32 ui32NumPhysChunks;
IMG_UINT32 ui32NumVirtChunks;
IMG_BOOL * pbMappingTable;
IMG_UINT32 ui32Log2PageSize;
PVRSRV_MEMALLOCFLAGS_T uiFlags;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_PHYSMEMNEWRAMBACKEDPMR;
/* Bridge out structure for PhysmemNewRamBackedPMR */
typedef struct PVRSRV_BRIDGE_OUT_PHYSMEMNEWRAMBACKEDPMR_TAG
{
IMG_HANDLE hPMRPtr;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PHYSMEMNEWRAMBACKEDPMR;
/*******************************************
PMRLocalImportPMR
*******************************************/
/* Bridge in structure for PMRLocalImportPMR */
typedef struct PVRSRV_BRIDGE_IN_PMRLOCALIMPORTPMR_TAG
{
IMG_HANDLE hExtHandle;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_PMRLOCALIMPORTPMR;
/* Bridge out structure for PMRLocalImportPMR */
typedef struct PVRSRV_BRIDGE_OUT_PMRLOCALIMPORTPMR_TAG
{
IMG_HANDLE hPMR;
IMG_DEVMEM_SIZE_T uiSize;
IMG_DEVMEM_ALIGN_T sAlign;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PMRLOCALIMPORTPMR;
/*******************************************
PMRUnrefPMR
*******************************************/
/* Bridge in structure for PMRUnrefPMR */
typedef struct PVRSRV_BRIDGE_IN_PMRUNREFPMR_TAG
{
IMG_HANDLE hPMR;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_PMRUNREFPMR;
/* Bridge out structure for PMRUnrefPMR */
typedef struct PVRSRV_BRIDGE_OUT_PMRUNREFPMR_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PMRUNREFPMR;
/*******************************************
DevmemSLCFlushInvalRequest
*******************************************/
/* Bridge in structure for DevmemSLCFlushInvalRequest */
typedef struct PVRSRV_BRIDGE_IN_DEVMEMSLCFLUSHINVALREQUEST_TAG
{
IMG_HANDLE hDeviceNode;
IMG_HANDLE hPmr;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_DEVMEMSLCFLUSHINVALREQUEST;
/* Bridge out structure for DevmemSLCFlushInvalRequest */
typedef struct PVRSRV_BRIDGE_OUT_DEVMEMSLCFLUSHINVALREQUEST_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DEVMEMSLCFLUSHINVALREQUEST;
/*******************************************
DevmemIntGetSystemLog2PageSize
*******************************************/
/* Bridge in structure for DevmemIntGetSystemLog2PageSize */
typedef struct PVRSRV_BRIDGE_IN_DEVMEMINTGETSYSTEMLOG2PAGESIZE_TAG
{
IMG_UINT32 ui32EmptyStructPlaceholder;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_DEVMEMINTGETSYSTEMLOG2PAGESIZE;
/* Bridge out structure for DevmemIntGetSystemLog2PageSize */
typedef struct PVRSRV_BRIDGE_OUT_DEVMEMINTGETSYSTEMLOG2PAGESIZE_TAG
{
IMG_UINT32 ui32Log2PageSize;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DEVMEMINTGETSYSTEMLOG2PAGESIZE;
/*******************************************
HeapCfgHeapConfigCount
*******************************************/
/* Bridge in structure for HeapCfgHeapConfigCount */
typedef struct PVRSRV_BRIDGE_IN_HEAPCFGHEAPCONFIGCOUNT_TAG
{
IMG_HANDLE hDeviceNode;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_HEAPCFGHEAPCONFIGCOUNT;
/* Bridge out structure for HeapCfgHeapConfigCount */
typedef struct PVRSRV_BRIDGE_OUT_HEAPCFGHEAPCONFIGCOUNT_TAG
{
IMG_UINT32 ui32NumHeapConfigs;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_HEAPCFGHEAPCONFIGCOUNT;
/*******************************************
HeapCfgHeapCount
*******************************************/
/* Bridge in structure for HeapCfgHeapCount */
typedef struct PVRSRV_BRIDGE_IN_HEAPCFGHEAPCOUNT_TAG
{
IMG_HANDLE hDeviceNode;
IMG_UINT32 ui32HeapConfigIndex;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_HEAPCFGHEAPCOUNT;
/* Bridge out structure for HeapCfgHeapCount */
typedef struct PVRSRV_BRIDGE_OUT_HEAPCFGHEAPCOUNT_TAG
{
IMG_UINT32 ui32NumHeaps;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_HEAPCFGHEAPCOUNT;
/*******************************************
HeapCfgHeapConfigName
*******************************************/
/* Bridge in structure for HeapCfgHeapConfigName */
typedef struct PVRSRV_BRIDGE_IN_HEAPCFGHEAPCONFIGNAME_TAG
{
IMG_HANDLE hDeviceNode;
IMG_UINT32 ui32HeapConfigIndex;
IMG_UINT32 ui32HeapConfigNameBufSz;
/* Output pointer puiHeapConfigName is also an implied input */
IMG_CHAR * puiHeapConfigName;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_HEAPCFGHEAPCONFIGNAME;
/* Bridge out structure for HeapCfgHeapConfigName */
typedef struct PVRSRV_BRIDGE_OUT_HEAPCFGHEAPCONFIGNAME_TAG
{
IMG_CHAR * puiHeapConfigName;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_HEAPCFGHEAPCONFIGNAME;
/*******************************************
HeapCfgHeapDetails
*******************************************/
/* Bridge in structure for HeapCfgHeapDetails */
typedef struct PVRSRV_BRIDGE_IN_HEAPCFGHEAPDETAILS_TAG
{
IMG_HANDLE hDeviceNode;
IMG_UINT32 ui32HeapConfigIndex;
IMG_UINT32 ui32HeapIndex;
IMG_UINT32 ui32HeapNameBufSz;
/* Output pointer puiHeapNameOut is also an implied input */
IMG_CHAR * puiHeapNameOut;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_HEAPCFGHEAPDETAILS;
/* Bridge out structure for HeapCfgHeapDetails */
typedef struct PVRSRV_BRIDGE_OUT_HEAPCFGHEAPDETAILS_TAG
{
IMG_CHAR * puiHeapNameOut;
IMG_DEV_VIRTADDR sDevVAddrBase;
IMG_DEVMEM_SIZE_T uiHeapLength;
IMG_UINT32 ui32Log2DataPageSizeOut;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_HEAPCFGHEAPDETAILS;
#endif /* COMMON_MM_BRIDGE_H */

File diff suppressed because it is too large Load Diff

View File

@@ -1,208 +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 "services.h"
#include "pvr_bridge_io.h"
#define PVRSRV_BRIDGE_PDUMP_CMD_FIRST (PVRSRV_BRIDGE_PDUMP_START)
#define PVRSRV_BRIDGE_PDUMP_PVRSRVPDUMPISCAPTURING PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+0)
#define PVRSRV_BRIDGE_PDUMP_PVRSRVPDUMPCOMMENT PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+1)
#define PVRSRV_BRIDGE_PDUMP_PVRSRVPDUMPSETFRAME PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+2)
#define PVRSRV_BRIDGE_PDUMP_PVRSRVPDUMPGETFRAME PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+3)
#define PVRSRV_BRIDGE_PDUMP_PVRSRVPDUMPSETDEFAULTCAPTUREPARAMS PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+4)
#define PVRSRV_BRIDGE_PDUMP_PVRSRVPDUMPISLASTCAPTUREFRAME PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+5)
#define PVRSRV_BRIDGE_PDUMP_PVRSRVPDUMPSTARTINITPHASE PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+6)
#define PVRSRV_BRIDGE_PDUMP_PVRSRVPDUMPSTOPINITPHASE PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMP_CMD_FIRST+7)
#define PVRSRV_BRIDGE_PDUMP_CMD_LAST (PVRSRV_BRIDGE_PDUMP_CMD_FIRST+7)
/*******************************************
PVRSRVPDumpIsCapturing
*******************************************/
/* Bridge in structure for PVRSRVPDumpIsCapturing */
typedef struct PVRSRV_BRIDGE_IN_PVRSRVPDUMPISCAPTURING_TAG
{
IMG_UINT32 ui32EmptyStructPlaceholder;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_PVRSRVPDUMPISCAPTURING;
/* Bridge out structure for PVRSRVPDumpIsCapturing */
typedef struct PVRSRV_BRIDGE_OUT_PVRSRVPDUMPISCAPTURING_TAG
{
IMG_BOOL bIsCapturing;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PVRSRVPDUMPISCAPTURING;
/*******************************************
PVRSRVPDumpComment
*******************************************/
/* Bridge in structure for PVRSRVPDumpComment */
typedef struct PVRSRV_BRIDGE_IN_PVRSRVPDUMPCOMMENT_TAG
{
IMG_CHAR * puiComment;
IMG_UINT32 ui32Flags;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_PVRSRVPDUMPCOMMENT;
/* Bridge out structure for PVRSRVPDumpComment */
typedef struct PVRSRV_BRIDGE_OUT_PVRSRVPDUMPCOMMENT_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PVRSRVPDUMPCOMMENT;
/*******************************************
PVRSRVPDumpSetFrame
*******************************************/
/* Bridge in structure for PVRSRVPDumpSetFrame */
typedef struct PVRSRV_BRIDGE_IN_PVRSRVPDUMPSETFRAME_TAG
{
IMG_UINT32 ui32Frame;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_PVRSRVPDUMPSETFRAME;
/* Bridge out structure for PVRSRVPDumpSetFrame */
typedef struct PVRSRV_BRIDGE_OUT_PVRSRVPDUMPSETFRAME_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PVRSRVPDUMPSETFRAME;
/*******************************************
PVRSRVPDumpGetFrame
*******************************************/
/* Bridge in structure for PVRSRVPDumpGetFrame */
typedef struct PVRSRV_BRIDGE_IN_PVRSRVPDUMPGETFRAME_TAG
{
IMG_UINT32 ui32EmptyStructPlaceholder;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_PVRSRVPDUMPGETFRAME;
/* Bridge out structure for PVRSRVPDumpGetFrame */
typedef struct PVRSRV_BRIDGE_OUT_PVRSRVPDUMPGETFRAME_TAG
{
IMG_UINT32 ui32Frame;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PVRSRVPDUMPGETFRAME;
/*******************************************
PVRSRVPDumpSetDefaultCaptureParams
*******************************************/
/* Bridge in structure for PVRSRVPDumpSetDefaultCaptureParams */
typedef struct PVRSRV_BRIDGE_IN_PVRSRVPDUMPSETDEFAULTCAPTUREPARAMS_TAG
{
IMG_UINT32 ui32Mode;
IMG_UINT32 ui32Start;
IMG_UINT32 ui32End;
IMG_UINT32 ui32Interval;
IMG_UINT32 ui32MaxParamFileSize;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_PVRSRVPDUMPSETDEFAULTCAPTUREPARAMS;
/* Bridge out structure for PVRSRVPDumpSetDefaultCaptureParams */
typedef struct PVRSRV_BRIDGE_OUT_PVRSRVPDUMPSETDEFAULTCAPTUREPARAMS_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PVRSRVPDUMPSETDEFAULTCAPTUREPARAMS;
/*******************************************
PVRSRVPDumpIsLastCaptureFrame
*******************************************/
/* Bridge in structure for PVRSRVPDumpIsLastCaptureFrame */
typedef struct PVRSRV_BRIDGE_IN_PVRSRVPDUMPISLASTCAPTUREFRAME_TAG
{
IMG_UINT32 ui32EmptyStructPlaceholder;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_PVRSRVPDUMPISLASTCAPTUREFRAME;
/* Bridge out structure for PVRSRVPDumpIsLastCaptureFrame */
typedef struct PVRSRV_BRIDGE_OUT_PVRSRVPDUMPISLASTCAPTUREFRAME_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PVRSRVPDUMPISLASTCAPTUREFRAME;
/*******************************************
PVRSRVPDumpStartInitPhase
*******************************************/
/* Bridge in structure for PVRSRVPDumpStartInitPhase */
typedef struct PVRSRV_BRIDGE_IN_PVRSRVPDUMPSTARTINITPHASE_TAG
{
IMG_UINT32 ui32EmptyStructPlaceholder;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_PVRSRVPDUMPSTARTINITPHASE;
/* Bridge out structure for PVRSRVPDumpStartInitPhase */
typedef struct PVRSRV_BRIDGE_OUT_PVRSRVPDUMPSTARTINITPHASE_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PVRSRVPDUMPSTARTINITPHASE;
/*******************************************
PVRSRVPDumpStopInitPhase
*******************************************/
/* Bridge in structure for PVRSRVPDumpStopInitPhase */
typedef struct PVRSRV_BRIDGE_IN_PVRSRVPDUMPSTOPINITPHASE_TAG
{
IMG_MODULE_ID eModuleID;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_PVRSRVPDUMPSTOPINITPHASE;
/* Bridge out structure for PVRSRVPDumpStopInitPhase */
typedef struct PVRSRV_BRIDGE_OUT_PVRSRVPDUMPSTOPINITPHASE_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PVRSRVPDUMPSTOPINITPHASE;
#endif /* COMMON_PDUMP_BRIDGE_H */

View File

@@ -1,332 +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 "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>
/* ***************************************************************************
* Bridge proxy functions
*/
/* ***************************************************************************
* Server-side bridge entry points
*/
static IMG_INT
PVRSRVBridgePVRSRVPDumpIsCapturing(IMG_UINT32 ui32BridgeID,
PVRSRV_BRIDGE_IN_PVRSRVPDUMPISCAPTURING *psPVRSRVPDumpIsCapturingIN,
PVRSRV_BRIDGE_OUT_PVRSRVPDUMPISCAPTURING *psPVRSRVPDumpIsCapturingOUT,
CONNECTION_DATA *psConnection)
{
PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_PDUMP_PVRSRVPDUMPISCAPTURING);
PVR_UNREFERENCED_PARAMETER(psConnection);
PVR_UNREFERENCED_PARAMETER(psPVRSRVPDumpIsCapturingIN);
psPVRSRVPDumpIsCapturingOUT->eError =
PDumpIsCaptureFrameKM(
&psPVRSRVPDumpIsCapturingOUT->bIsCapturing);
return 0;
}
static IMG_INT
PVRSRVBridgePVRSRVPDumpComment(IMG_UINT32 ui32BridgeID,
PVRSRV_BRIDGE_IN_PVRSRVPDUMPCOMMENT *psPVRSRVPDumpCommentIN,
PVRSRV_BRIDGE_OUT_PVRSRVPDUMPCOMMENT *psPVRSRVPDumpCommentOUT,
CONNECTION_DATA *psConnection)
{
IMG_CHAR *uiCommentInt = IMG_NULL;
PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_PDUMP_PVRSRVPDUMPCOMMENT);
PVR_UNREFERENCED_PARAMETER(psConnection);
{
uiCommentInt = OSAllocMem(PVRSRV_PDUMP_MAX_COMMENT_SIZE * sizeof(IMG_CHAR));
if (!uiCommentInt)
{
psPVRSRVPDumpCommentOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY;
goto PVRSRVPDumpComment_exit;
}
}
/* Copy the data over */
if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psPVRSRVPDumpCommentIN->puiComment, PVRSRV_PDUMP_MAX_COMMENT_SIZE * sizeof(IMG_CHAR))
|| (OSCopyFromUser(NULL, uiCommentInt, psPVRSRVPDumpCommentIN->puiComment,
PVRSRV_PDUMP_MAX_COMMENT_SIZE * sizeof(IMG_CHAR)) != PVRSRV_OK) )
{
psPVRSRVPDumpCommentOUT->eError = PVRSRV_ERROR_INVALID_PARAMS;
goto PVRSRVPDumpComment_exit;
}
psPVRSRVPDumpCommentOUT->eError =
PDumpCommentKM(
uiCommentInt,
psPVRSRVPDumpCommentIN->ui32Flags);
PVRSRVPDumpComment_exit:
if (uiCommentInt)
OSFreeMem(uiCommentInt);
return 0;
}
static IMG_INT
PVRSRVBridgePVRSRVPDumpSetFrame(IMG_UINT32 ui32BridgeID,
PVRSRV_BRIDGE_IN_PVRSRVPDUMPSETFRAME *psPVRSRVPDumpSetFrameIN,
PVRSRV_BRIDGE_OUT_PVRSRVPDUMPSETFRAME *psPVRSRVPDumpSetFrameOUT,
CONNECTION_DATA *psConnection)
{
PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_PDUMP_PVRSRVPDUMPSETFRAME);
psPVRSRVPDumpSetFrameOUT->eError =
PDumpSetFrameKM(psConnection,
psPVRSRVPDumpSetFrameIN->ui32Frame);
return 0;
}
static IMG_INT
PVRSRVBridgePVRSRVPDumpGetFrame(IMG_UINT32 ui32BridgeID,
PVRSRV_BRIDGE_IN_PVRSRVPDUMPGETFRAME *psPVRSRVPDumpGetFrameIN,
PVRSRV_BRIDGE_OUT_PVRSRVPDUMPGETFRAME *psPVRSRVPDumpGetFrameOUT,
CONNECTION_DATA *psConnection)
{
PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_PDUMP_PVRSRVPDUMPGETFRAME);
PVR_UNREFERENCED_PARAMETER(psPVRSRVPDumpGetFrameIN);
psPVRSRVPDumpGetFrameOUT->eError =
PDumpGetFrameKM(psConnection,
&psPVRSRVPDumpGetFrameOUT->ui32Frame);
return 0;
}
static IMG_INT
PVRSRVBridgePVRSRVPDumpSetDefaultCaptureParams(IMG_UINT32 ui32BridgeID,
PVRSRV_BRIDGE_IN_PVRSRVPDUMPSETDEFAULTCAPTUREPARAMS *psPVRSRVPDumpSetDefaultCaptureParamsIN,
PVRSRV_BRIDGE_OUT_PVRSRVPDUMPSETDEFAULTCAPTUREPARAMS *psPVRSRVPDumpSetDefaultCaptureParamsOUT,
CONNECTION_DATA *psConnection)
{
PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_PDUMP_PVRSRVPDUMPSETDEFAULTCAPTUREPARAMS);
PVR_UNREFERENCED_PARAMETER(psConnection);
psPVRSRVPDumpSetDefaultCaptureParamsOUT->eError =
PDumpSetDefaultCaptureParamsKM(
psPVRSRVPDumpSetDefaultCaptureParamsIN->ui32Mode,
psPVRSRVPDumpSetDefaultCaptureParamsIN->ui32Start,
psPVRSRVPDumpSetDefaultCaptureParamsIN->ui32End,
psPVRSRVPDumpSetDefaultCaptureParamsIN->ui32Interval,
psPVRSRVPDumpSetDefaultCaptureParamsIN->ui32MaxParamFileSize);
return 0;
}
static IMG_INT
PVRSRVBridgePVRSRVPDumpIsLastCaptureFrame(IMG_UINT32 ui32BridgeID,
PVRSRV_BRIDGE_IN_PVRSRVPDUMPISLASTCAPTUREFRAME *psPVRSRVPDumpIsLastCaptureFrameIN,
PVRSRV_BRIDGE_OUT_PVRSRVPDUMPISLASTCAPTUREFRAME *psPVRSRVPDumpIsLastCaptureFrameOUT,
CONNECTION_DATA *psConnection)
{
PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_PDUMP_PVRSRVPDUMPISLASTCAPTUREFRAME);
PVR_UNREFERENCED_PARAMETER(psConnection);
PVR_UNREFERENCED_PARAMETER(psPVRSRVPDumpIsLastCaptureFrameIN);
psPVRSRVPDumpIsLastCaptureFrameOUT->eError =
PDumpIsLastCaptureFrameKM(
);
return 0;
}
static IMG_INT
PVRSRVBridgePVRSRVPDumpStartInitPhase(IMG_UINT32 ui32BridgeID,
PVRSRV_BRIDGE_IN_PVRSRVPDUMPSTARTINITPHASE *psPVRSRVPDumpStartInitPhaseIN,
PVRSRV_BRIDGE_OUT_PVRSRVPDUMPSTARTINITPHASE *psPVRSRVPDumpStartInitPhaseOUT,
CONNECTION_DATA *psConnection)
{
PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_PDUMP_PVRSRVPDUMPSTARTINITPHASE);
PVR_UNREFERENCED_PARAMETER(psConnection);
PVR_UNREFERENCED_PARAMETER(psPVRSRVPDumpStartInitPhaseIN);
psPVRSRVPDumpStartInitPhaseOUT->eError =
PDumpStartInitPhaseKM(
);
return 0;
}
static IMG_INT
PVRSRVBridgePVRSRVPDumpStopInitPhase(IMG_UINT32 ui32BridgeID,
PVRSRV_BRIDGE_IN_PVRSRVPDUMPSTOPINITPHASE *psPVRSRVPDumpStopInitPhaseIN,
PVRSRV_BRIDGE_OUT_PVRSRVPDUMPSTOPINITPHASE *psPVRSRVPDumpStopInitPhaseOUT,
CONNECTION_DATA *psConnection)
{
PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_PDUMP_PVRSRVPDUMPSTOPINITPHASE);
PVR_UNREFERENCED_PARAMETER(psConnection);
psPVRSRVPDumpStopInitPhaseOUT->eError =
PDumpStopInitPhaseKM(
psPVRSRVPDumpStopInitPhaseIN->eModuleID);
return 0;
}
/* ***************************************************************************
* Server bridge dispatch related glue
*/
PVRSRV_ERROR RegisterPDUMPFunctions(IMG_VOID);
IMG_VOID UnregisterPDUMPFunctions(IMG_VOID);
/*
* Register all PDUMP functions with services
*/
PVRSRV_ERROR RegisterPDUMPFunctions(IMG_VOID)
{
SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMP_PVRSRVPDUMPISCAPTURING, PVRSRVBridgePVRSRVPDumpIsCapturing);
SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMP_PVRSRVPDUMPCOMMENT, PVRSRVBridgePVRSRVPDumpComment);
SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMP_PVRSRVPDUMPSETFRAME, PVRSRVBridgePVRSRVPDumpSetFrame);
SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMP_PVRSRVPDUMPGETFRAME, PVRSRVBridgePVRSRVPDumpGetFrame);
SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMP_PVRSRVPDUMPSETDEFAULTCAPTUREPARAMS, PVRSRVBridgePVRSRVPDumpSetDefaultCaptureParams);
SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMP_PVRSRVPDUMPISLASTCAPTUREFRAME, PVRSRVBridgePVRSRVPDumpIsLastCaptureFrame);
SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMP_PVRSRVPDUMPSTARTINITPHASE, PVRSRVBridgePVRSRVPDumpStartInitPhase);
SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMP_PVRSRVPDUMPSTOPINITPHASE, PVRSRVBridgePVRSRVPDumpStopInitPhase);
return PVRSRV_OK;
}
/*
* Unregister all pdump functions with services
*/
IMG_VOID UnregisterPDUMPFunctions(IMG_VOID)
{
}

View File

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

View File

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

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,244 +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 "pdump.h"
#include "pdumpdefs.h"
#include "pvrsrv_memallocflags.h"
#include "devicemem_typedefs.h"
#include "pvr_bridge_io.h"
#define PVRSRV_BRIDGE_PDUMPMM_CMD_FIRST (PVRSRV_BRIDGE_PDUMPMM_START)
#define PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPLOADMEM PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMPMM_CMD_FIRST+0)
#define PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPLOADMEMVALUE32 PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMPMM_CMD_FIRST+1)
#define PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPLOADMEMVALUE64 PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMPMM_CMD_FIRST+2)
#define PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPSAVETOFILE PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMPMM_CMD_FIRST+3)
#define PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPSYMBOLICADDR PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMPMM_CMD_FIRST+4)
#define PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPPOL32 PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMPMM_CMD_FIRST+5)
#define PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPCBP PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMPMM_CMD_FIRST+6)
#define PVRSRV_BRIDGE_PDUMPMM_DEVMEMINTPDUMPSAVETOFILEVIRTUAL PVRSRV_IOWR(PVRSRV_BRIDGE_PDUMPMM_CMD_FIRST+7)
#define PVRSRV_BRIDGE_PDUMPMM_CMD_LAST (PVRSRV_BRIDGE_PDUMPMM_CMD_FIRST+7)
/*******************************************
PMRPDumpLoadMem
*******************************************/
/* Bridge in structure for PMRPDumpLoadMem */
typedef struct PVRSRV_BRIDGE_IN_PMRPDUMPLOADMEM_TAG
{
IMG_HANDLE hPMR;
IMG_DEVMEM_OFFSET_T uiOffset;
IMG_DEVMEM_SIZE_T uiSize;
IMG_UINT32 ui32PDumpFlags;
IMG_BOOL bbZero;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_PMRPDUMPLOADMEM;
/* Bridge out structure for PMRPDumpLoadMem */
typedef struct PVRSRV_BRIDGE_OUT_PMRPDUMPLOADMEM_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PMRPDUMPLOADMEM;
/*******************************************
PMRPDumpLoadMemValue32
*******************************************/
/* Bridge in structure for PMRPDumpLoadMemValue32 */
typedef struct PVRSRV_BRIDGE_IN_PMRPDUMPLOADMEMVALUE32_TAG
{
IMG_HANDLE hPMR;
IMG_DEVMEM_OFFSET_T uiOffset;
IMG_UINT32 ui32Value;
IMG_UINT32 ui32PDumpFlags;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_PMRPDUMPLOADMEMVALUE32;
/* Bridge out structure for PMRPDumpLoadMemValue32 */
typedef struct PVRSRV_BRIDGE_OUT_PMRPDUMPLOADMEMVALUE32_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PMRPDUMPLOADMEMVALUE32;
/*******************************************
PMRPDumpLoadMemValue64
*******************************************/
/* Bridge in structure for PMRPDumpLoadMemValue64 */
typedef struct PVRSRV_BRIDGE_IN_PMRPDUMPLOADMEMVALUE64_TAG
{
IMG_HANDLE hPMR;
IMG_DEVMEM_OFFSET_T uiOffset;
IMG_UINT64 ui64Value;
IMG_UINT32 ui32PDumpFlags;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_PMRPDUMPLOADMEMVALUE64;
/* Bridge out structure for PMRPDumpLoadMemValue64 */
typedef struct PVRSRV_BRIDGE_OUT_PMRPDUMPLOADMEMVALUE64_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PMRPDUMPLOADMEMVALUE64;
/*******************************************
PMRPDumpSaveToFile
*******************************************/
/* Bridge in structure for PMRPDumpSaveToFile */
typedef struct PVRSRV_BRIDGE_IN_PMRPDUMPSAVETOFILE_TAG
{
IMG_HANDLE hPMR;
IMG_DEVMEM_OFFSET_T uiOffset;
IMG_DEVMEM_SIZE_T uiSize;
IMG_UINT32 ui32ArraySize;
const IMG_CHAR * puiFileName;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_PMRPDUMPSAVETOFILE;
/* Bridge out structure for PMRPDumpSaveToFile */
typedef struct PVRSRV_BRIDGE_OUT_PMRPDUMPSAVETOFILE_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PMRPDUMPSAVETOFILE;
/*******************************************
PMRPDumpSymbolicAddr
*******************************************/
/* Bridge in structure for PMRPDumpSymbolicAddr */
typedef struct PVRSRV_BRIDGE_IN_PMRPDUMPSYMBOLICADDR_TAG
{
IMG_HANDLE hPMR;
IMG_DEVMEM_OFFSET_T uiOffset;
IMG_UINT32 ui32MemspaceNameLen;
IMG_UINT32 ui32SymbolicAddrLen;
/* Output pointer puiMemspaceName is also an implied input */
IMG_CHAR * puiMemspaceName;
/* Output pointer puiSymbolicAddr is also an implied input */
IMG_CHAR * puiSymbolicAddr;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_PMRPDUMPSYMBOLICADDR;
/* Bridge out structure for PMRPDumpSymbolicAddr */
typedef struct PVRSRV_BRIDGE_OUT_PMRPDUMPSYMBOLICADDR_TAG
{
IMG_CHAR * puiMemspaceName;
IMG_CHAR * puiSymbolicAddr;
IMG_DEVMEM_OFFSET_T uiNewOffset;
IMG_DEVMEM_OFFSET_T uiNextSymName;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PMRPDUMPSYMBOLICADDR;
/*******************************************
PMRPDumpPol32
*******************************************/
/* Bridge in structure for PMRPDumpPol32 */
typedef struct PVRSRV_BRIDGE_IN_PMRPDUMPPOL32_TAG
{
IMG_HANDLE hPMR;
IMG_DEVMEM_OFFSET_T uiOffset;
IMG_UINT32 ui32Value;
IMG_UINT32 ui32Mask;
PDUMP_POLL_OPERATOR eOperator;
IMG_UINT32 ui32PDumpFlags;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_PMRPDUMPPOL32;
/* Bridge out structure for PMRPDumpPol32 */
typedef struct PVRSRV_BRIDGE_OUT_PMRPDUMPPOL32_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PMRPDUMPPOL32;
/*******************************************
PMRPDumpCBP
*******************************************/
/* Bridge in structure for PMRPDumpCBP */
typedef struct PVRSRV_BRIDGE_IN_PMRPDUMPCBP_TAG
{
IMG_HANDLE hPMR;
IMG_DEVMEM_OFFSET_T uiReadOffset;
IMG_DEVMEM_OFFSET_T uiWriteOffset;
IMG_DEVMEM_SIZE_T uiPacketSize;
IMG_DEVMEM_SIZE_T uiBufferSize;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_PMRPDUMPCBP;
/* Bridge out structure for PMRPDumpCBP */
typedef struct PVRSRV_BRIDGE_OUT_PMRPDUMPCBP_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PMRPDUMPCBP;
/*******************************************
DevmemIntPDumpSaveToFileVirtual
*******************************************/
/* Bridge in structure for DevmemIntPDumpSaveToFileVirtual */
typedef struct PVRSRV_BRIDGE_IN_DEVMEMINTPDUMPSAVETOFILEVIRTUAL_TAG
{
IMG_HANDLE hDevmemServerContext;
IMG_DEV_VIRTADDR sAddress;
IMG_DEVMEM_SIZE_T uiSize;
IMG_UINT32 ui32ArraySize;
const IMG_CHAR * puiFileName;
IMG_UINT32 ui32FileOffset;
IMG_UINT32 ui32PDumpFlags;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_DEVMEMINTPDUMPSAVETOFILEVIRTUAL;
/* Bridge out structure for DevmemIntPDumpSaveToFileVirtual */
typedef struct PVRSRV_BRIDGE_OUT_DEVMEMINTPDUMPSAVETOFILEVIRTUAL_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_DEVMEMINTPDUMPSAVETOFILEVIRTUAL;
#endif /* COMMON_PDUMPMM_BRIDGE_H */

View File

@@ -1,617 +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>
/* ***************************************************************************
* Bridge proxy functions
*/
/* ***************************************************************************
* Server-side bridge entry points
*/
static IMG_INT
PVRSRVBridgePMRPDumpLoadMem(IMG_UINT32 ui32BridgeID,
PVRSRV_BRIDGE_IN_PMRPDUMPLOADMEM *psPMRPDumpLoadMemIN,
PVRSRV_BRIDGE_OUT_PMRPDUMPLOADMEM *psPMRPDumpLoadMemOUT,
CONNECTION_DATA *psConnection)
{
PMR * psPMRInt = IMG_NULL;
IMG_HANDLE hPMRInt2 = IMG_NULL;
PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPLOADMEM);
{
/* Look up the address from the handle */
psPMRPDumpLoadMemOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_HANDLE *) &hPMRInt2,
psPMRPDumpLoadMemIN->hPMR,
PVRSRV_HANDLE_TYPE_PHYSMEM_PMR);
if(psPMRPDumpLoadMemOUT->eError != PVRSRV_OK)
{
goto PMRPDumpLoadMem_exit;
}
/* Look up the data from the resman address */
psPMRPDumpLoadMemOUT->eError = ResManFindPrivateDataByPtr(hPMRInt2, (IMG_VOID **) &psPMRInt);
if(psPMRPDumpLoadMemOUT->eError != PVRSRV_OK)
{
goto PMRPDumpLoadMem_exit;
}
}
psPMRPDumpLoadMemOUT->eError =
PMRPDumpLoadMem(
psPMRInt,
psPMRPDumpLoadMemIN->uiOffset,
psPMRPDumpLoadMemIN->uiSize,
psPMRPDumpLoadMemIN->ui32PDumpFlags,
psPMRPDumpLoadMemIN->bbZero);
PMRPDumpLoadMem_exit:
return 0;
}
static IMG_INT
PVRSRVBridgePMRPDumpLoadMemValue32(IMG_UINT32 ui32BridgeID,
PVRSRV_BRIDGE_IN_PMRPDUMPLOADMEMVALUE32 *psPMRPDumpLoadMemValue32IN,
PVRSRV_BRIDGE_OUT_PMRPDUMPLOADMEMVALUE32 *psPMRPDumpLoadMemValue32OUT,
CONNECTION_DATA *psConnection)
{
PMR * psPMRInt = IMG_NULL;
IMG_HANDLE hPMRInt2 = IMG_NULL;
PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPLOADMEMVALUE32);
{
/* Look up the address from the handle */
psPMRPDumpLoadMemValue32OUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_HANDLE *) &hPMRInt2,
psPMRPDumpLoadMemValue32IN->hPMR,
PVRSRV_HANDLE_TYPE_PHYSMEM_PMR);
if(psPMRPDumpLoadMemValue32OUT->eError != PVRSRV_OK)
{
goto PMRPDumpLoadMemValue32_exit;
}
/* Look up the data from the resman address */
psPMRPDumpLoadMemValue32OUT->eError = ResManFindPrivateDataByPtr(hPMRInt2, (IMG_VOID **) &psPMRInt);
if(psPMRPDumpLoadMemValue32OUT->eError != PVRSRV_OK)
{
goto PMRPDumpLoadMemValue32_exit;
}
}
psPMRPDumpLoadMemValue32OUT->eError =
PMRPDumpLoadMemValue32(
psPMRInt,
psPMRPDumpLoadMemValue32IN->uiOffset,
psPMRPDumpLoadMemValue32IN->ui32Value,
psPMRPDumpLoadMemValue32IN->ui32PDumpFlags);
PMRPDumpLoadMemValue32_exit:
return 0;
}
static IMG_INT
PVRSRVBridgePMRPDumpLoadMemValue64(IMG_UINT32 ui32BridgeID,
PVRSRV_BRIDGE_IN_PMRPDUMPLOADMEMVALUE64 *psPMRPDumpLoadMemValue64IN,
PVRSRV_BRIDGE_OUT_PMRPDUMPLOADMEMVALUE64 *psPMRPDumpLoadMemValue64OUT,
CONNECTION_DATA *psConnection)
{
PMR * psPMRInt = IMG_NULL;
IMG_HANDLE hPMRInt2 = IMG_NULL;
PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPLOADMEMVALUE64);
{
/* Look up the address from the handle */
psPMRPDumpLoadMemValue64OUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_HANDLE *) &hPMRInt2,
psPMRPDumpLoadMemValue64IN->hPMR,
PVRSRV_HANDLE_TYPE_PHYSMEM_PMR);
if(psPMRPDumpLoadMemValue64OUT->eError != PVRSRV_OK)
{
goto PMRPDumpLoadMemValue64_exit;
}
/* Look up the data from the resman address */
psPMRPDumpLoadMemValue64OUT->eError = ResManFindPrivateDataByPtr(hPMRInt2, (IMG_VOID **) &psPMRInt);
if(psPMRPDumpLoadMemValue64OUT->eError != PVRSRV_OK)
{
goto PMRPDumpLoadMemValue64_exit;
}
}
psPMRPDumpLoadMemValue64OUT->eError =
PMRPDumpLoadMemValue64(
psPMRInt,
psPMRPDumpLoadMemValue64IN->uiOffset,
psPMRPDumpLoadMemValue64IN->ui64Value,
psPMRPDumpLoadMemValue64IN->ui32PDumpFlags);
PMRPDumpLoadMemValue64_exit:
return 0;
}
static IMG_INT
PVRSRVBridgePMRPDumpSaveToFile(IMG_UINT32 ui32BridgeID,
PVRSRV_BRIDGE_IN_PMRPDUMPSAVETOFILE *psPMRPDumpSaveToFileIN,
PVRSRV_BRIDGE_OUT_PMRPDUMPSAVETOFILE *psPMRPDumpSaveToFileOUT,
CONNECTION_DATA *psConnection)
{
PMR * psPMRInt = IMG_NULL;
IMG_HANDLE hPMRInt2 = IMG_NULL;
IMG_CHAR *uiFileNameInt = IMG_NULL;
PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPSAVETOFILE);
if (psPMRPDumpSaveToFileIN->ui32ArraySize != 0)
{
uiFileNameInt = OSAllocMem(psPMRPDumpSaveToFileIN->ui32ArraySize * sizeof(IMG_CHAR));
if (!uiFileNameInt)
{
psPMRPDumpSaveToFileOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY;
goto PMRPDumpSaveToFile_exit;
}
}
/* Copy the data over */
if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psPMRPDumpSaveToFileIN->puiFileName, psPMRPDumpSaveToFileIN->ui32ArraySize * sizeof(IMG_CHAR))
|| (OSCopyFromUser(NULL, uiFileNameInt, psPMRPDumpSaveToFileIN->puiFileName,
psPMRPDumpSaveToFileIN->ui32ArraySize * sizeof(IMG_CHAR)) != PVRSRV_OK) )
{
psPMRPDumpSaveToFileOUT->eError = PVRSRV_ERROR_INVALID_PARAMS;
goto PMRPDumpSaveToFile_exit;
}
{
/* Look up the address from the handle */
psPMRPDumpSaveToFileOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_HANDLE *) &hPMRInt2,
psPMRPDumpSaveToFileIN->hPMR,
PVRSRV_HANDLE_TYPE_PHYSMEM_PMR);
if(psPMRPDumpSaveToFileOUT->eError != PVRSRV_OK)
{
goto PMRPDumpSaveToFile_exit;
}
/* Look up the data from the resman address */
psPMRPDumpSaveToFileOUT->eError = ResManFindPrivateDataByPtr(hPMRInt2, (IMG_VOID **) &psPMRInt);
if(psPMRPDumpSaveToFileOUT->eError != PVRSRV_OK)
{
goto PMRPDumpSaveToFile_exit;
}
}
psPMRPDumpSaveToFileOUT->eError =
PMRPDumpSaveToFile(
psPMRInt,
psPMRPDumpSaveToFileIN->uiOffset,
psPMRPDumpSaveToFileIN->uiSize,
psPMRPDumpSaveToFileIN->ui32ArraySize,
uiFileNameInt);
PMRPDumpSaveToFile_exit:
if (uiFileNameInt)
OSFreeMem(uiFileNameInt);
return 0;
}
static IMG_INT
PVRSRVBridgePMRPDumpSymbolicAddr(IMG_UINT32 ui32BridgeID,
PVRSRV_BRIDGE_IN_PMRPDUMPSYMBOLICADDR *psPMRPDumpSymbolicAddrIN,
PVRSRV_BRIDGE_OUT_PMRPDUMPSYMBOLICADDR *psPMRPDumpSymbolicAddrOUT,
CONNECTION_DATA *psConnection)
{
PMR * psPMRInt = IMG_NULL;
IMG_HANDLE hPMRInt2 = IMG_NULL;
IMG_CHAR *puiMemspaceNameInt = IMG_NULL;
IMG_CHAR *puiSymbolicAddrInt = IMG_NULL;
PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPSYMBOLICADDR);
psPMRPDumpSymbolicAddrOUT->puiMemspaceName = psPMRPDumpSymbolicAddrIN->puiMemspaceName;
psPMRPDumpSymbolicAddrOUT->puiSymbolicAddr = psPMRPDumpSymbolicAddrIN->puiSymbolicAddr;
if (psPMRPDumpSymbolicAddrIN->ui32MemspaceNameLen != 0)
{
puiMemspaceNameInt = OSAllocMem(psPMRPDumpSymbolicAddrIN->ui32MemspaceNameLen * sizeof(IMG_CHAR));
if (!puiMemspaceNameInt)
{
psPMRPDumpSymbolicAddrOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY;
goto PMRPDumpSymbolicAddr_exit;
}
}
if (psPMRPDumpSymbolicAddrIN->ui32SymbolicAddrLen != 0)
{
puiSymbolicAddrInt = OSAllocMem(psPMRPDumpSymbolicAddrIN->ui32SymbolicAddrLen * sizeof(IMG_CHAR));
if (!puiSymbolicAddrInt)
{
psPMRPDumpSymbolicAddrOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY;
goto PMRPDumpSymbolicAddr_exit;
}
}
{
/* Look up the address from the handle */
psPMRPDumpSymbolicAddrOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_HANDLE *) &hPMRInt2,
psPMRPDumpSymbolicAddrIN->hPMR,
PVRSRV_HANDLE_TYPE_PHYSMEM_PMR);
if(psPMRPDumpSymbolicAddrOUT->eError != PVRSRV_OK)
{
goto PMRPDumpSymbolicAddr_exit;
}
/* Look up the data from the resman address */
psPMRPDumpSymbolicAddrOUT->eError = ResManFindPrivateDataByPtr(hPMRInt2, (IMG_VOID **) &psPMRInt);
if(psPMRPDumpSymbolicAddrOUT->eError != PVRSRV_OK)
{
goto PMRPDumpSymbolicAddr_exit;
}
}
psPMRPDumpSymbolicAddrOUT->eError =
PMR_PDumpSymbolicAddr(
psPMRInt,
psPMRPDumpSymbolicAddrIN->uiOffset,
psPMRPDumpSymbolicAddrIN->ui32MemspaceNameLen,
puiMemspaceNameInt,
psPMRPDumpSymbolicAddrIN->ui32SymbolicAddrLen,
puiSymbolicAddrInt,
&psPMRPDumpSymbolicAddrOUT->uiNewOffset,
&psPMRPDumpSymbolicAddrOUT->uiNextSymName);
if ( !OSAccessOK(PVR_VERIFY_WRITE, (IMG_VOID*) psPMRPDumpSymbolicAddrOUT->puiMemspaceName, (psPMRPDumpSymbolicAddrIN->ui32MemspaceNameLen * sizeof(IMG_CHAR)))
|| (OSCopyToUser(NULL, psPMRPDumpSymbolicAddrOUT->puiMemspaceName, puiMemspaceNameInt,
(psPMRPDumpSymbolicAddrIN->ui32MemspaceNameLen * sizeof(IMG_CHAR))) != PVRSRV_OK) )
{
psPMRPDumpSymbolicAddrOUT->eError = PVRSRV_ERROR_INVALID_PARAMS;
goto PMRPDumpSymbolicAddr_exit;
}
if ( !OSAccessOK(PVR_VERIFY_WRITE, (IMG_VOID*) psPMRPDumpSymbolicAddrOUT->puiSymbolicAddr, (psPMRPDumpSymbolicAddrIN->ui32SymbolicAddrLen * sizeof(IMG_CHAR)))
|| (OSCopyToUser(NULL, psPMRPDumpSymbolicAddrOUT->puiSymbolicAddr, puiSymbolicAddrInt,
(psPMRPDumpSymbolicAddrIN->ui32SymbolicAddrLen * sizeof(IMG_CHAR))) != PVRSRV_OK) )
{
psPMRPDumpSymbolicAddrOUT->eError = PVRSRV_ERROR_INVALID_PARAMS;
goto PMRPDumpSymbolicAddr_exit;
}
PMRPDumpSymbolicAddr_exit:
if (puiMemspaceNameInt)
OSFreeMem(puiMemspaceNameInt);
if (puiSymbolicAddrInt)
OSFreeMem(puiSymbolicAddrInt);
return 0;
}
static IMG_INT
PVRSRVBridgePMRPDumpPol32(IMG_UINT32 ui32BridgeID,
PVRSRV_BRIDGE_IN_PMRPDUMPPOL32 *psPMRPDumpPol32IN,
PVRSRV_BRIDGE_OUT_PMRPDUMPPOL32 *psPMRPDumpPol32OUT,
CONNECTION_DATA *psConnection)
{
PMR * psPMRInt = IMG_NULL;
IMG_HANDLE hPMRInt2 = IMG_NULL;
PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPPOL32);
{
/* Look up the address from the handle */
psPMRPDumpPol32OUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_HANDLE *) &hPMRInt2,
psPMRPDumpPol32IN->hPMR,
PVRSRV_HANDLE_TYPE_PHYSMEM_PMR);
if(psPMRPDumpPol32OUT->eError != PVRSRV_OK)
{
goto PMRPDumpPol32_exit;
}
/* Look up the data from the resman address */
psPMRPDumpPol32OUT->eError = ResManFindPrivateDataByPtr(hPMRInt2, (IMG_VOID **) &psPMRInt);
if(psPMRPDumpPol32OUT->eError != PVRSRV_OK)
{
goto PMRPDumpPol32_exit;
}
}
psPMRPDumpPol32OUT->eError =
PMRPDumpPol32(
psPMRInt,
psPMRPDumpPol32IN->uiOffset,
psPMRPDumpPol32IN->ui32Value,
psPMRPDumpPol32IN->ui32Mask,
psPMRPDumpPol32IN->eOperator,
psPMRPDumpPol32IN->ui32PDumpFlags);
PMRPDumpPol32_exit:
return 0;
}
static IMG_INT
PVRSRVBridgePMRPDumpCBP(IMG_UINT32 ui32BridgeID,
PVRSRV_BRIDGE_IN_PMRPDUMPCBP *psPMRPDumpCBPIN,
PVRSRV_BRIDGE_OUT_PMRPDUMPCBP *psPMRPDumpCBPOUT,
CONNECTION_DATA *psConnection)
{
PMR * psPMRInt = IMG_NULL;
IMG_HANDLE hPMRInt2 = IMG_NULL;
PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPCBP);
{
/* Look up the address from the handle */
psPMRPDumpCBPOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_HANDLE *) &hPMRInt2,
psPMRPDumpCBPIN->hPMR,
PVRSRV_HANDLE_TYPE_PHYSMEM_PMR);
if(psPMRPDumpCBPOUT->eError != PVRSRV_OK)
{
goto PMRPDumpCBP_exit;
}
/* Look up the data from the resman address */
psPMRPDumpCBPOUT->eError = ResManFindPrivateDataByPtr(hPMRInt2, (IMG_VOID **) &psPMRInt);
if(psPMRPDumpCBPOUT->eError != PVRSRV_OK)
{
goto PMRPDumpCBP_exit;
}
}
psPMRPDumpCBPOUT->eError =
PMRPDumpCBP(
psPMRInt,
psPMRPDumpCBPIN->uiReadOffset,
psPMRPDumpCBPIN->uiWriteOffset,
psPMRPDumpCBPIN->uiPacketSize,
psPMRPDumpCBPIN->uiBufferSize);
PMRPDumpCBP_exit:
return 0;
}
static IMG_INT
PVRSRVBridgeDevmemIntPDumpSaveToFileVirtual(IMG_UINT32 ui32BridgeID,
PVRSRV_BRIDGE_IN_DEVMEMINTPDUMPSAVETOFILEVIRTUAL *psDevmemIntPDumpSaveToFileVirtualIN,
PVRSRV_BRIDGE_OUT_DEVMEMINTPDUMPSAVETOFILEVIRTUAL *psDevmemIntPDumpSaveToFileVirtualOUT,
CONNECTION_DATA *psConnection)
{
DEVMEMINT_CTX * psDevmemServerContextInt = IMG_NULL;
IMG_HANDLE hDevmemServerContextInt2 = IMG_NULL;
IMG_CHAR *uiFileNameInt = IMG_NULL;
PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_PDUMPMM_DEVMEMINTPDUMPSAVETOFILEVIRTUAL);
if (psDevmemIntPDumpSaveToFileVirtualIN->ui32ArraySize != 0)
{
uiFileNameInt = OSAllocMem(psDevmemIntPDumpSaveToFileVirtualIN->ui32ArraySize * sizeof(IMG_CHAR));
if (!uiFileNameInt)
{
psDevmemIntPDumpSaveToFileVirtualOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY;
goto DevmemIntPDumpSaveToFileVirtual_exit;
}
}
/* Copy the data over */
if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psDevmemIntPDumpSaveToFileVirtualIN->puiFileName, psDevmemIntPDumpSaveToFileVirtualIN->ui32ArraySize * sizeof(IMG_CHAR))
|| (OSCopyFromUser(NULL, uiFileNameInt, psDevmemIntPDumpSaveToFileVirtualIN->puiFileName,
psDevmemIntPDumpSaveToFileVirtualIN->ui32ArraySize * sizeof(IMG_CHAR)) != PVRSRV_OK) )
{
psDevmemIntPDumpSaveToFileVirtualOUT->eError = PVRSRV_ERROR_INVALID_PARAMS;
goto DevmemIntPDumpSaveToFileVirtual_exit;
}
{
/* Look up the address from the handle */
psDevmemIntPDumpSaveToFileVirtualOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_HANDLE *) &hDevmemServerContextInt2,
psDevmemIntPDumpSaveToFileVirtualIN->hDevmemServerContext,
PVRSRV_HANDLE_TYPE_DEVMEMINT_CTX);
if(psDevmemIntPDumpSaveToFileVirtualOUT->eError != PVRSRV_OK)
{
goto DevmemIntPDumpSaveToFileVirtual_exit;
}
/* Look up the data from the resman address */
psDevmemIntPDumpSaveToFileVirtualOUT->eError = ResManFindPrivateDataByPtr(hDevmemServerContextInt2, (IMG_VOID **) &psDevmemServerContextInt);
if(psDevmemIntPDumpSaveToFileVirtualOUT->eError != PVRSRV_OK)
{
goto DevmemIntPDumpSaveToFileVirtual_exit;
}
}
psDevmemIntPDumpSaveToFileVirtualOUT->eError =
DevmemIntPDumpSaveToFileVirtual(
psDevmemServerContextInt,
psDevmemIntPDumpSaveToFileVirtualIN->sAddress,
psDevmemIntPDumpSaveToFileVirtualIN->uiSize,
psDevmemIntPDumpSaveToFileVirtualIN->ui32ArraySize,
uiFileNameInt,
psDevmemIntPDumpSaveToFileVirtualIN->ui32FileOffset,
psDevmemIntPDumpSaveToFileVirtualIN->ui32PDumpFlags);
DevmemIntPDumpSaveToFileVirtual_exit:
if (uiFileNameInt)
OSFreeMem(uiFileNameInt);
return 0;
}
/* ***************************************************************************
* Server bridge dispatch related glue
*/
PVRSRV_ERROR RegisterPDUMPMMFunctions(IMG_VOID);
IMG_VOID UnregisterPDUMPMMFunctions(IMG_VOID);
/*
* Register all PDUMPMM functions with services
*/
PVRSRV_ERROR RegisterPDUMPMMFunctions(IMG_VOID)
{
SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPLOADMEM, PVRSRVBridgePMRPDumpLoadMem);
SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPLOADMEMVALUE32, PVRSRVBridgePMRPDumpLoadMemValue32);
SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPLOADMEMVALUE64, PVRSRVBridgePMRPDumpLoadMemValue64);
SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPSAVETOFILE, PVRSRVBridgePMRPDumpSaveToFile);
SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPSYMBOLICADDR, PVRSRVBridgePMRPDumpSymbolicAddr);
SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPPOL32, PVRSRVBridgePMRPDumpPol32);
SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMPMM_PMRPDUMPCBP, PVRSRVBridgePMRPDumpCBP);
SetDispatchTableEntry(PVRSRV_BRIDGE_PDUMPMM_DEVMEMINTPDUMPSAVETOFILEVIRTUAL, PVRSRVBridgeDevmemIntPDumpSaveToFileVirtual);
return PVRSRV_OK;
}
/*
* Unregister all pdumpmm functions with services
*/
IMG_VOID UnregisterPDUMPMMFunctions(IMG_VOID)
{
}

View File

@@ -1,83 +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);
IMG_INTERNAL PVRSRV_ERROR IMG_CALLCONV BridgeTLTestIoctl(IMG_HANDLE hBridge,
IMG_UINT32 ui32Cmd,
IMG_BYTE *psIn1,
IMG_UINT32 ui32In2,
IMG_UINT32 *pui32Out1,
IMG_UINT32 *pui32Out2);
#endif /* CLIENT_PVRTL_BRIDGE_H */

View File

@@ -1,196 +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 "devicemem_typedefs.h"
#include "pvr_tl.h"
#include "tltestdefs.h"
#include "pvr_bridge_io.h"
#define PVRSRV_BRIDGE_PVRTL_CMD_FIRST (PVRSRV_BRIDGE_PVRTL_START)
#define PVRSRV_BRIDGE_PVRTL_TLCONNECT PVRSRV_IOWR(PVRSRV_BRIDGE_PVRTL_CMD_FIRST+0)
#define PVRSRV_BRIDGE_PVRTL_TLDISCONNECT PVRSRV_IOWR(PVRSRV_BRIDGE_PVRTL_CMD_FIRST+1)
#define PVRSRV_BRIDGE_PVRTL_TLOPENSTREAM PVRSRV_IOWR(PVRSRV_BRIDGE_PVRTL_CMD_FIRST+2)
#define PVRSRV_BRIDGE_PVRTL_TLCLOSESTREAM PVRSRV_IOWR(PVRSRV_BRIDGE_PVRTL_CMD_FIRST+3)
#define PVRSRV_BRIDGE_PVRTL_TLACQUIREDATA PVRSRV_IOWR(PVRSRV_BRIDGE_PVRTL_CMD_FIRST+4)
#define PVRSRV_BRIDGE_PVRTL_TLRELEASEDATA PVRSRV_IOWR(PVRSRV_BRIDGE_PVRTL_CMD_FIRST+5)
#define PVRSRV_BRIDGE_PVRTL_TLTESTIOCTL PVRSRV_IOWR(PVRSRV_BRIDGE_PVRTL_CMD_FIRST+6)
#define PVRSRV_BRIDGE_PVRTL_CMD_LAST (PVRSRV_BRIDGE_PVRTL_CMD_FIRST+6)
/*******************************************
TLConnect
*******************************************/
/* Bridge in structure for TLConnect */
typedef struct PVRSRV_BRIDGE_IN_TLCONNECT_TAG
{
IMG_UINT32 ui32EmptyStructPlaceholder;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_TLCONNECT;
/* Bridge out structure for TLConnect */
typedef struct PVRSRV_BRIDGE_OUT_TLCONNECT_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_TLCONNECT;
/*******************************************
TLDisconnect
*******************************************/
/* Bridge in structure for TLDisconnect */
typedef struct PVRSRV_BRIDGE_IN_TLDISCONNECT_TAG
{
IMG_UINT32 ui32EmptyStructPlaceholder;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_TLDISCONNECT;
/* Bridge out structure for TLDisconnect */
typedef struct PVRSRV_BRIDGE_OUT_TLDISCONNECT_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_TLDISCONNECT;
/*******************************************
TLOpenStream
*******************************************/
/* Bridge in structure for TLOpenStream */
typedef struct PVRSRV_BRIDGE_IN_TLOPENSTREAM_TAG
{
IMG_CHAR * puiName;
IMG_UINT32 ui32Mode;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_TLOPENSTREAM;
/* Bridge out structure for TLOpenStream */
typedef struct PVRSRV_BRIDGE_OUT_TLOPENSTREAM_TAG
{
IMG_HANDLE hSD;
DEVMEM_SERVER_EXPORTCOOKIE hClientBUFExportCookie;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_TLOPENSTREAM;
/*******************************************
TLCloseStream
*******************************************/
/* Bridge in structure for TLCloseStream */
typedef struct PVRSRV_BRIDGE_IN_TLCLOSESTREAM_TAG
{
IMG_HANDLE hSD;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_TLCLOSESTREAM;
/* Bridge out structure for TLCloseStream */
typedef struct PVRSRV_BRIDGE_OUT_TLCLOSESTREAM_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_TLCLOSESTREAM;
/*******************************************
TLAcquireData
*******************************************/
/* Bridge in structure for TLAcquireData */
typedef struct PVRSRV_BRIDGE_IN_TLACQUIREDATA_TAG
{
IMG_HANDLE hSD;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_TLACQUIREDATA;
/* Bridge out structure for TLAcquireData */
typedef struct PVRSRV_BRIDGE_OUT_TLACQUIREDATA_TAG
{
IMG_UINT32 ui32ReadOffset;
IMG_UINT32 ui32ReadLen;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_TLACQUIREDATA;
/*******************************************
TLReleaseData
*******************************************/
/* Bridge in structure for TLReleaseData */
typedef struct PVRSRV_BRIDGE_IN_TLRELEASEDATA_TAG
{
IMG_HANDLE hSD;
IMG_UINT32 ui32ReadOffset;
IMG_UINT32 ui32ReadLen;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_TLRELEASEDATA;
/* Bridge out structure for TLReleaseData */
typedef struct PVRSRV_BRIDGE_OUT_TLRELEASEDATA_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_TLRELEASEDATA;
/*******************************************
TLTestIoctl
*******************************************/
/* Bridge in structure for TLTestIoctl */
typedef struct PVRSRV_BRIDGE_IN_TLTESTIOCTL_TAG
{
IMG_UINT32 ui32Cmd;
IMG_BYTE * psIn1;
IMG_UINT32 ui32In2;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_TLTESTIOCTL;
/* Bridge out structure for TLTestIoctl */
typedef struct PVRSRV_BRIDGE_OUT_TLTESTIOCTL_TAG
{
IMG_UINT32 ui32Out1;
IMG_UINT32 ui32Out2;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_TLTESTIOCTL;
#endif /* COMMON_PVRTL_BRIDGE_H */

View File

@@ -1,477 +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>
/* ***************************************************************************
* Bridge proxy functions
*/
static PVRSRV_ERROR
TLCloseStreamResManProxy(IMG_HANDLE hResmanItem)
{
PVRSRV_ERROR eError;
eError = ResManFreeResByPtr(hResmanItem);
/* Freeing a resource should never fail... */
PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY));
return eError;
}
/* ***************************************************************************
* Server-side bridge entry points
*/
static IMG_INT
PVRSRVBridgeTLConnect(IMG_UINT32 ui32BridgeID,
PVRSRV_BRIDGE_IN_TLCONNECT *psTLConnectIN,
PVRSRV_BRIDGE_OUT_TLCONNECT *psTLConnectOUT,
CONNECTION_DATA *psConnection)
{
PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_PVRTL_TLCONNECT);
PVR_UNREFERENCED_PARAMETER(psTLConnectIN);
psTLConnectOUT->eError =
TLServerConnectKM(psConnection
);
return 0;
}
static IMG_INT
PVRSRVBridgeTLDisconnect(IMG_UINT32 ui32BridgeID,
PVRSRV_BRIDGE_IN_TLDISCONNECT *psTLDisconnectIN,
PVRSRV_BRIDGE_OUT_TLDISCONNECT *psTLDisconnectOUT,
CONNECTION_DATA *psConnection)
{
PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_PVRTL_TLDISCONNECT);
PVR_UNREFERENCED_PARAMETER(psTLDisconnectIN);
psTLDisconnectOUT->eError =
TLServerDisconnectKM(psConnection
);
return 0;
}
static IMG_INT
PVRSRVBridgeTLOpenStream(IMG_UINT32 ui32BridgeID,
PVRSRV_BRIDGE_IN_TLOPENSTREAM *psTLOpenStreamIN,
PVRSRV_BRIDGE_OUT_TLOPENSTREAM *psTLOpenStreamOUT,
CONNECTION_DATA *psConnection)
{
IMG_CHAR *uiNameInt = IMG_NULL;
TL_STREAM_DESC * psSDInt = IMG_NULL;
IMG_HANDLE hSDInt2 = IMG_NULL;
DEVMEM_EXPORTCOOKIE * psClientBUFExportCookieInt = IMG_NULL;
PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_PVRTL_TLOPENSTREAM);
psTLOpenStreamOUT->hSD = IMG_NULL;
{
uiNameInt = OSAllocMem(PRVSRVTL_MAX_STREAM_NAME_SIZE * sizeof(IMG_CHAR));
if (!uiNameInt)
{
psTLOpenStreamOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY;
goto TLOpenStream_exit;
}
}
/* Copy the data over */
if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psTLOpenStreamIN->puiName, PRVSRVTL_MAX_STREAM_NAME_SIZE * sizeof(IMG_CHAR))
|| (OSCopyFromUser(NULL, uiNameInt, psTLOpenStreamIN->puiName,
PRVSRVTL_MAX_STREAM_NAME_SIZE * sizeof(IMG_CHAR)) != PVRSRV_OK) )
{
psTLOpenStreamOUT->eError = PVRSRV_ERROR_INVALID_PARAMS;
goto TLOpenStream_exit;
}
psTLOpenStreamOUT->eError =
TLServerOpenStreamKM(
uiNameInt,
psTLOpenStreamIN->ui32Mode,
&psSDInt,
&psClientBUFExportCookieInt);
/* Exit early if bridged call fails */
if(psTLOpenStreamOUT->eError != PVRSRV_OK)
{
goto TLOpenStream_exit;
}
/* Create a resman item and overwrite the handle with it */
hSDInt2 = ResManRegisterRes(psConnection->hResManContext,
RESMAN_TYPE_TL_STREAM_DESC,
psSDInt,
(RESMAN_FREE_FN)&TLServerCloseStreamKM);
if (hSDInt2 == IMG_NULL)
{
psTLOpenStreamOUT->eError = PVRSRV_ERROR_UNABLE_TO_REGISTER_RESOURCE;
goto TLOpenStream_exit;
}
psTLOpenStreamOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase,
&psTLOpenStreamOUT->hSD,
(IMG_HANDLE) hSDInt2,
PVRSRV_HANDLE_TYPE_PVR_TL_SD,
PVRSRV_HANDLE_ALLOC_FLAG_NONE
);
if (psTLOpenStreamOUT->eError != PVRSRV_OK)
{
goto TLOpenStream_exit;
}
psTLOpenStreamOUT->eError = PVRSRVAllocSubHandle(psConnection->psHandleBase,
&psTLOpenStreamOUT->hClientBUFExportCookie,
(IMG_HANDLE) psClientBUFExportCookieInt,
PVRSRV_HANDLE_TYPE_SERVER_EXPORTCOOKIE,
PVRSRV_HANDLE_ALLOC_FLAG_NONE
,psTLOpenStreamOUT->hSD);
if (psTLOpenStreamOUT->eError != PVRSRV_OK)
{
goto TLOpenStream_exit;
}
TLOpenStream_exit:
if (psTLOpenStreamOUT->eError != PVRSRV_OK)
{
if (psTLOpenStreamOUT->hSD)
{
PVRSRVReleaseHandle(psConnection->psHandleBase,
(IMG_HANDLE) psTLOpenStreamOUT->hSD,
PVRSRV_HANDLE_TYPE_PVR_TL_SD);
}
/* If we have a valid resman item we should undo the bridge function by freeing the resman item */
if (hSDInt2)
{
PVRSRV_ERROR eError = ResManFreeResByPtr(hSDInt2);
/* Freeing a resource should never fail... */
PVR_ASSERT((eError == PVRSRV_OK) || (eError == PVRSRV_ERROR_RETRY));
}
else if (psSDInt)
{
TLServerCloseStreamKM(psSDInt);
}
}
if (uiNameInt)
OSFreeMem(uiNameInt);
return 0;
}
static IMG_INT
PVRSRVBridgeTLCloseStream(IMG_UINT32 ui32BridgeID,
PVRSRV_BRIDGE_IN_TLCLOSESTREAM *psTLCloseStreamIN,
PVRSRV_BRIDGE_OUT_TLCLOSESTREAM *psTLCloseStreamOUT,
CONNECTION_DATA *psConnection)
{
IMG_HANDLE hSDInt2 = IMG_NULL;
PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_PVRTL_TLCLOSESTREAM);
{
/* Look up the address from the handle */
psTLCloseStreamOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_HANDLE *) &hSDInt2,
psTLCloseStreamIN->hSD,
PVRSRV_HANDLE_TYPE_PVR_TL_SD);
if(psTLCloseStreamOUT->eError != PVRSRV_OK)
{
goto TLCloseStream_exit;
}
}
psTLCloseStreamOUT->eError = TLCloseStreamResManProxy(hSDInt2);
/* Exit early if bridged call fails */
if(psTLCloseStreamOUT->eError != PVRSRV_OK)
{
goto TLCloseStream_exit;
}
psTLCloseStreamOUT->eError =
PVRSRVReleaseHandle(psConnection->psHandleBase,
(IMG_HANDLE) psTLCloseStreamIN->hSD,
PVRSRV_HANDLE_TYPE_PVR_TL_SD);
TLCloseStream_exit:
return 0;
}
static IMG_INT
PVRSRVBridgeTLAcquireData(IMG_UINT32 ui32BridgeID,
PVRSRV_BRIDGE_IN_TLACQUIREDATA *psTLAcquireDataIN,
PVRSRV_BRIDGE_OUT_TLACQUIREDATA *psTLAcquireDataOUT,
CONNECTION_DATA *psConnection)
{
TL_STREAM_DESC * psSDInt = IMG_NULL;
IMG_HANDLE hSDInt2 = IMG_NULL;
PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_PVRTL_TLACQUIREDATA);
{
/* Look up the address from the handle */
psTLAcquireDataOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_HANDLE *) &hSDInt2,
psTLAcquireDataIN->hSD,
PVRSRV_HANDLE_TYPE_PVR_TL_SD);
if(psTLAcquireDataOUT->eError != PVRSRV_OK)
{
goto TLAcquireData_exit;
}
/* Look up the data from the resman address */
psTLAcquireDataOUT->eError = ResManFindPrivateDataByPtr(hSDInt2, (IMG_VOID **) &psSDInt);
if(psTLAcquireDataOUT->eError != PVRSRV_OK)
{
goto TLAcquireData_exit;
}
}
psTLAcquireDataOUT->eError =
TLServerAcquireDataKM(
psSDInt,
&psTLAcquireDataOUT->ui32ReadOffset,
&psTLAcquireDataOUT->ui32ReadLen);
TLAcquireData_exit:
return 0;
}
static IMG_INT
PVRSRVBridgeTLReleaseData(IMG_UINT32 ui32BridgeID,
PVRSRV_BRIDGE_IN_TLRELEASEDATA *psTLReleaseDataIN,
PVRSRV_BRIDGE_OUT_TLRELEASEDATA *psTLReleaseDataOUT,
CONNECTION_DATA *psConnection)
{
TL_STREAM_DESC * psSDInt = IMG_NULL;
IMG_HANDLE hSDInt2 = IMG_NULL;
PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_PVRTL_TLRELEASEDATA);
{
/* Look up the address from the handle */
psTLReleaseDataOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_HANDLE *) &hSDInt2,
psTLReleaseDataIN->hSD,
PVRSRV_HANDLE_TYPE_PVR_TL_SD);
if(psTLReleaseDataOUT->eError != PVRSRV_OK)
{
goto TLReleaseData_exit;
}
/* Look up the data from the resman address */
psTLReleaseDataOUT->eError = ResManFindPrivateDataByPtr(hSDInt2, (IMG_VOID **) &psSDInt);
if(psTLReleaseDataOUT->eError != PVRSRV_OK)
{
goto TLReleaseData_exit;
}
}
psTLReleaseDataOUT->eError =
TLServerReleaseDataKM(
psSDInt,
psTLReleaseDataIN->ui32ReadOffset,
psTLReleaseDataIN->ui32ReadLen);
TLReleaseData_exit:
return 0;
}
static IMG_INT
PVRSRVBridgeTLTestIoctl(IMG_UINT32 ui32BridgeID,
PVRSRV_BRIDGE_IN_TLTESTIOCTL *psTLTestIoctlIN,
PVRSRV_BRIDGE_OUT_TLTESTIOCTL *psTLTestIoctlOUT,
CONNECTION_DATA *psConnection)
{
IMG_BYTE *psIn1Int = IMG_NULL;
PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_PVRTL_TLTESTIOCTL);
PVR_UNREFERENCED_PARAMETER(psConnection);
{
psIn1Int = OSAllocMem(PVR_TL_TEST_PARAM_MAX_SIZE * sizeof(IMG_BYTE));
if (!psIn1Int)
{
psTLTestIoctlOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY;
goto TLTestIoctl_exit;
}
}
/* Copy the data over */
if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psTLTestIoctlIN->psIn1, PVR_TL_TEST_PARAM_MAX_SIZE * sizeof(IMG_BYTE))
|| (OSCopyFromUser(NULL, psIn1Int, psTLTestIoctlIN->psIn1,
PVR_TL_TEST_PARAM_MAX_SIZE * sizeof(IMG_BYTE)) != PVRSRV_OK) )
{
psTLTestIoctlOUT->eError = PVRSRV_ERROR_INVALID_PARAMS;
goto TLTestIoctl_exit;
}
psTLTestIoctlOUT->eError =
TLServerTestIoctlKM(
psTLTestIoctlIN->ui32Cmd,
psIn1Int,
psTLTestIoctlIN->ui32In2,
&psTLTestIoctlOUT->ui32Out1,
&psTLTestIoctlOUT->ui32Out2);
TLTestIoctl_exit:
if (psIn1Int)
OSFreeMem(psIn1Int);
return 0;
}
/* ***************************************************************************
* Server bridge dispatch related glue
*/
PVRSRV_ERROR RegisterPVRTLFunctions(IMG_VOID);
IMG_VOID UnregisterPVRTLFunctions(IMG_VOID);
/*
* Register all PVRTL functions with services
*/
PVRSRV_ERROR RegisterPVRTLFunctions(IMG_VOID)
{
SetDispatchTableEntry(PVRSRV_BRIDGE_PVRTL_TLCONNECT, PVRSRVBridgeTLConnect);
SetDispatchTableEntry(PVRSRV_BRIDGE_PVRTL_TLDISCONNECT, PVRSRVBridgeTLDisconnect);
SetDispatchTableEntry(PVRSRV_BRIDGE_PVRTL_TLOPENSTREAM, PVRSRVBridgeTLOpenStream);
SetDispatchTableEntry(PVRSRV_BRIDGE_PVRTL_TLCLOSESTREAM, PVRSRVBridgeTLCloseStream);
SetDispatchTableEntry(PVRSRV_BRIDGE_PVRTL_TLACQUIREDATA, PVRSRVBridgeTLAcquireData);
SetDispatchTableEntry(PVRSRV_BRIDGE_PVRTL_TLRELEASEDATA, PVRSRVBridgeTLReleaseData);
SetDispatchTableEntry(PVRSRV_BRIDGE_PVRTL_TLTESTIOCTL, PVRSRVBridgeTLTestIoctl);
return PVRSRV_OK;
}
/*
* Unregister all pvrtl functions with services
*/
IMG_VOID UnregisterPVRTLFunctions(IMG_VOID)
{
}

View File

@@ -1,150 +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 "rgx_bridge.h"
#include "pvr_bridge_io.h"
#define PVRSRV_BRIDGE_REGCONFIG_CMD_FIRST (PVRSRV_BRIDGE_REGCONFIG_START)
#define PVRSRV_BRIDGE_REGCONFIG_RGXSETREGCONFIGPI PVRSRV_IOWR(PVRSRV_BRIDGE_REGCONFIG_CMD_FIRST+0)
#define PVRSRV_BRIDGE_REGCONFIG_RGXADDREGCONFIG PVRSRV_IOWR(PVRSRV_BRIDGE_REGCONFIG_CMD_FIRST+1)
#define PVRSRV_BRIDGE_REGCONFIG_RGXCLEARREGCONFIG PVRSRV_IOWR(PVRSRV_BRIDGE_REGCONFIG_CMD_FIRST+2)
#define PVRSRV_BRIDGE_REGCONFIG_RGXENABLEREGCONFIG PVRSRV_IOWR(PVRSRV_BRIDGE_REGCONFIG_CMD_FIRST+3)
#define PVRSRV_BRIDGE_REGCONFIG_RGXDISABLEREGCONFIG PVRSRV_IOWR(PVRSRV_BRIDGE_REGCONFIG_CMD_FIRST+4)
#define PVRSRV_BRIDGE_REGCONFIG_CMD_LAST (PVRSRV_BRIDGE_REGCONFIG_CMD_FIRST+4)
/*******************************************
RGXSetRegConfigPI
*******************************************/
/* Bridge in structure for RGXSetRegConfigPI */
typedef struct PVRSRV_BRIDGE_IN_RGXSETREGCONFIGPI_TAG
{
IMG_HANDLE hDevNode;
IMG_UINT8 ui8RegPowerIsland;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXSETREGCONFIGPI;
/* Bridge out structure for RGXSetRegConfigPI */
typedef struct PVRSRV_BRIDGE_OUT_RGXSETREGCONFIGPI_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXSETREGCONFIGPI;
/*******************************************
RGXAddRegconfig
*******************************************/
/* Bridge in structure for RGXAddRegconfig */
typedef struct PVRSRV_BRIDGE_IN_RGXADDREGCONFIG_TAG
{
IMG_HANDLE hDevNode;
IMG_UINT32 ui32RegAddr;
IMG_UINT64 ui64RegValue;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXADDREGCONFIG;
/* Bridge out structure for RGXAddRegconfig */
typedef struct PVRSRV_BRIDGE_OUT_RGXADDREGCONFIG_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXADDREGCONFIG;
/*******************************************
RGXClearRegConfig
*******************************************/
/* Bridge in structure for RGXClearRegConfig */
typedef struct PVRSRV_BRIDGE_IN_RGXCLEARREGCONFIG_TAG
{
IMG_HANDLE hDevNode;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXCLEARREGCONFIG;
/* Bridge out structure for RGXClearRegConfig */
typedef struct PVRSRV_BRIDGE_OUT_RGXCLEARREGCONFIG_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXCLEARREGCONFIG;
/*******************************************
RGXEnableRegConfig
*******************************************/
/* Bridge in structure for RGXEnableRegConfig */
typedef struct PVRSRV_BRIDGE_IN_RGXENABLEREGCONFIG_TAG
{
IMG_HANDLE hDevNode;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXENABLEREGCONFIG;
/* Bridge out structure for RGXEnableRegConfig */
typedef struct PVRSRV_BRIDGE_OUT_RGXENABLEREGCONFIG_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXENABLEREGCONFIG;
/*******************************************
RGXDisableRegConfig
*******************************************/
/* Bridge in structure for RGXDisableRegConfig */
typedef struct PVRSRV_BRIDGE_IN_RGXDISABLEREGCONFIG_TAG
{
IMG_HANDLE hDevNode;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXDISABLEREGCONFIG;
/* Bridge out structure for RGXDisableRegConfig */
typedef struct PVRSRV_BRIDGE_OUT_RGXDISABLEREGCONFIG_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXDISABLEREGCONFIG;
#endif /* COMMON_REGCONFIG_BRIDGE_H */

View File

@@ -1,304 +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>
/* ***************************************************************************
* Bridge proxy functions
*/
/* ***************************************************************************
* Server-side bridge entry points
*/
static IMG_INT
PVRSRVBridgeRGXSetRegConfigPI(IMG_UINT32 ui32BridgeID,
PVRSRV_BRIDGE_IN_RGXSETREGCONFIGPI *psRGXSetRegConfigPIIN,
PVRSRV_BRIDGE_OUT_RGXSETREGCONFIGPI *psRGXSetRegConfigPIOUT,
CONNECTION_DATA *psConnection)
{
IMG_HANDLE hDevNodeInt = IMG_NULL;
PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_REGCONFIG_RGXSETREGCONFIGPI);
{
/* Look up the address from the handle */
psRGXSetRegConfigPIOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_HANDLE *) &hDevNodeInt,
psRGXSetRegConfigPIIN->hDevNode,
PVRSRV_HANDLE_TYPE_DEV_NODE);
if(psRGXSetRegConfigPIOUT->eError != PVRSRV_OK)
{
goto RGXSetRegConfigPI_exit;
}
}
psRGXSetRegConfigPIOUT->eError =
PVRSRVRGXSetRegConfigPIKM(
hDevNodeInt,
psRGXSetRegConfigPIIN->ui8RegPowerIsland);
RGXSetRegConfigPI_exit:
return 0;
}
static IMG_INT
PVRSRVBridgeRGXAddRegconfig(IMG_UINT32 ui32BridgeID,
PVRSRV_BRIDGE_IN_RGXADDREGCONFIG *psRGXAddRegconfigIN,
PVRSRV_BRIDGE_OUT_RGXADDREGCONFIG *psRGXAddRegconfigOUT,
CONNECTION_DATA *psConnection)
{
IMG_HANDLE hDevNodeInt = IMG_NULL;
PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_REGCONFIG_RGXADDREGCONFIG);
{
/* Look up the address from the handle */
psRGXAddRegconfigOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_HANDLE *) &hDevNodeInt,
psRGXAddRegconfigIN->hDevNode,
PVRSRV_HANDLE_TYPE_DEV_NODE);
if(psRGXAddRegconfigOUT->eError != PVRSRV_OK)
{
goto RGXAddRegconfig_exit;
}
}
psRGXAddRegconfigOUT->eError =
PVRSRVRGXAddRegConfigKM(
hDevNodeInt,
psRGXAddRegconfigIN->ui32RegAddr,
psRGXAddRegconfigIN->ui64RegValue);
RGXAddRegconfig_exit:
return 0;
}
static IMG_INT
PVRSRVBridgeRGXClearRegConfig(IMG_UINT32 ui32BridgeID,
PVRSRV_BRIDGE_IN_RGXCLEARREGCONFIG *psRGXClearRegConfigIN,
PVRSRV_BRIDGE_OUT_RGXCLEARREGCONFIG *psRGXClearRegConfigOUT,
CONNECTION_DATA *psConnection)
{
IMG_HANDLE hDevNodeInt = IMG_NULL;
PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_REGCONFIG_RGXCLEARREGCONFIG);
{
/* Look up the address from the handle */
psRGXClearRegConfigOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_HANDLE *) &hDevNodeInt,
psRGXClearRegConfigIN->hDevNode,
PVRSRV_HANDLE_TYPE_DEV_NODE);
if(psRGXClearRegConfigOUT->eError != PVRSRV_OK)
{
goto RGXClearRegConfig_exit;
}
}
psRGXClearRegConfigOUT->eError =
PVRSRVRGXClearRegConfigKM(
hDevNodeInt);
RGXClearRegConfig_exit:
return 0;
}
static IMG_INT
PVRSRVBridgeRGXEnableRegConfig(IMG_UINT32 ui32BridgeID,
PVRSRV_BRIDGE_IN_RGXENABLEREGCONFIG *psRGXEnableRegConfigIN,
PVRSRV_BRIDGE_OUT_RGXENABLEREGCONFIG *psRGXEnableRegConfigOUT,
CONNECTION_DATA *psConnection)
{
IMG_HANDLE hDevNodeInt = IMG_NULL;
PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_REGCONFIG_RGXENABLEREGCONFIG);
{
/* Look up the address from the handle */
psRGXEnableRegConfigOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_HANDLE *) &hDevNodeInt,
psRGXEnableRegConfigIN->hDevNode,
PVRSRV_HANDLE_TYPE_DEV_NODE);
if(psRGXEnableRegConfigOUT->eError != PVRSRV_OK)
{
goto RGXEnableRegConfig_exit;
}
}
psRGXEnableRegConfigOUT->eError =
PVRSRVRGXEnableRegConfigKM(
hDevNodeInt);
RGXEnableRegConfig_exit:
return 0;
}
static IMG_INT
PVRSRVBridgeRGXDisableRegConfig(IMG_UINT32 ui32BridgeID,
PVRSRV_BRIDGE_IN_RGXDISABLEREGCONFIG *psRGXDisableRegConfigIN,
PVRSRV_BRIDGE_OUT_RGXDISABLEREGCONFIG *psRGXDisableRegConfigOUT,
CONNECTION_DATA *psConnection)
{
IMG_HANDLE hDevNodeInt = IMG_NULL;
PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_REGCONFIG_RGXDISABLEREGCONFIG);
{
/* Look up the address from the handle */
psRGXDisableRegConfigOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_HANDLE *) &hDevNodeInt,
psRGXDisableRegConfigIN->hDevNode,
PVRSRV_HANDLE_TYPE_DEV_NODE);
if(psRGXDisableRegConfigOUT->eError != PVRSRV_OK)
{
goto RGXDisableRegConfig_exit;
}
}
psRGXDisableRegConfigOUT->eError =
PVRSRVRGXDisableRegConfigKM(
hDevNodeInt);
RGXDisableRegConfig_exit:
return 0;
}
/* ***************************************************************************
* Server bridge dispatch related glue
*/
PVRSRV_ERROR RegisterREGCONFIGFunctions(IMG_VOID);
IMG_VOID UnregisterREGCONFIGFunctions(IMG_VOID);
/*
* Register all REGCONFIG functions with services
*/
PVRSRV_ERROR RegisterREGCONFIGFunctions(IMG_VOID)
{
SetDispatchTableEntry(PVRSRV_BRIDGE_REGCONFIG_RGXSETREGCONFIGPI, PVRSRVBridgeRGXSetRegConfigPI);
SetDispatchTableEntry(PVRSRV_BRIDGE_REGCONFIG_RGXADDREGCONFIG, PVRSRVBridgeRGXAddRegconfig);
SetDispatchTableEntry(PVRSRV_BRIDGE_REGCONFIG_RGXCLEARREGCONFIG, PVRSRVBridgeRGXClearRegConfig);
SetDispatchTableEntry(PVRSRV_BRIDGE_REGCONFIG_RGXENABLEREGCONFIG, PVRSRVBridgeRGXEnableRegConfig);
SetDispatchTableEntry(PVRSRV_BRIDGE_REGCONFIG_RGXDISABLEREGCONFIG, PVRSRVBridgeRGXDisableRegConfig);
return PVRSRV_OK;
}
/*
* Unregister all regconfig functions with services
*/
IMG_VOID UnregisterREGCONFIGFunctions(IMG_VOID)
{
}

View File

@@ -1,204 +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 "rgx_bridge.h"
#include "sync_external.h"
#include "rgx_fwif_shared.h"
#include "pvr_bridge_io.h"
#define PVRSRV_BRIDGE_RGXCMP_CMD_FIRST (PVRSRV_BRIDGE_RGXCMP_START)
#define PVRSRV_BRIDGE_RGXCMP_RGXCREATECOMPUTECONTEXT PVRSRV_IOWR(PVRSRV_BRIDGE_RGXCMP_CMD_FIRST+0)
#define PVRSRV_BRIDGE_RGXCMP_RGXDESTROYCOMPUTECONTEXT PVRSRV_IOWR(PVRSRV_BRIDGE_RGXCMP_CMD_FIRST+1)
#define PVRSRV_BRIDGE_RGXCMP_RGXKICKCDM PVRSRV_IOWR(PVRSRV_BRIDGE_RGXCMP_CMD_FIRST+2)
#define PVRSRV_BRIDGE_RGXCMP_RGXFLUSHCOMPUTEDATA PVRSRV_IOWR(PVRSRV_BRIDGE_RGXCMP_CMD_FIRST+3)
#define PVRSRV_BRIDGE_RGXCMP_RGXSETCOMPUTECONTEXTPRIORITY PVRSRV_IOWR(PVRSRV_BRIDGE_RGXCMP_CMD_FIRST+4)
#define PVRSRV_BRIDGE_RGXCMP_RGXKICKSYNCCDM PVRSRV_IOWR(PVRSRV_BRIDGE_RGXCMP_CMD_FIRST+5)
#define PVRSRV_BRIDGE_RGXCMP_CMD_LAST (PVRSRV_BRIDGE_RGXCMP_CMD_FIRST+5)
/*******************************************
RGXCreateComputeContext
*******************************************/
/* Bridge in structure for RGXCreateComputeContext */
typedef struct PVRSRV_BRIDGE_IN_RGXCREATECOMPUTECONTEXT_TAG
{
IMG_HANDLE hDevNode;
IMG_UINT32 ui32Priority;
IMG_DEV_VIRTADDR sMCUFenceAddr;
IMG_UINT32 ui32FrameworkCmdize;
IMG_BYTE * psFrameworkCmd;
IMG_HANDLE hPrivData;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXCREATECOMPUTECONTEXT;
/* Bridge out structure for RGXCreateComputeContext */
typedef struct PVRSRV_BRIDGE_OUT_RGXCREATECOMPUTECONTEXT_TAG
{
IMG_HANDLE hComputeContext;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXCREATECOMPUTECONTEXT;
/*******************************************
RGXDestroyComputeContext
*******************************************/
/* Bridge in structure for RGXDestroyComputeContext */
typedef struct PVRSRV_BRIDGE_IN_RGXDESTROYCOMPUTECONTEXT_TAG
{
IMG_HANDLE hComputeContext;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXDESTROYCOMPUTECONTEXT;
/* Bridge out structure for RGXDestroyComputeContext */
typedef struct PVRSRV_BRIDGE_OUT_RGXDESTROYCOMPUTECONTEXT_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXDESTROYCOMPUTECONTEXT;
/*******************************************
RGXKickCDM
*******************************************/
/* Bridge in structure for RGXKickCDM */
typedef struct PVRSRV_BRIDGE_IN_RGXKICKCDM_TAG
{
IMG_HANDLE hComputeContext;
IMG_UINT32 ui32ClientFenceCount;
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 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 * 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 ui32NumFenceFDs;
IMG_INT32 * pi32FenceFDs;
IMG_BOOL bbPDumpContinuous;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXKICKSYNCCDM;
/* Bridge out structure for RGXKickSyncCDM */
typedef struct PVRSRV_BRIDGE_OUT_RGXKICKSYNCCDM_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXKICKSYNCCDM;
#endif /* COMMON_RGXCMP_BRIDGE_H */

View File

@@ -1,140 +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 "rgx_bridge.h"
#include "rgx_hwperf_km.h"
#include "pvr_bridge_io.h"
#define PVRSRV_BRIDGE_RGXHWPERF_CMD_FIRST (PVRSRV_BRIDGE_RGXHWPERF_START)
#define PVRSRV_BRIDGE_RGXHWPERF_RGXCTRLHWPERF PVRSRV_IOWR(PVRSRV_BRIDGE_RGXHWPERF_CMD_FIRST+0)
#define PVRSRV_BRIDGE_RGXHWPERF_RGXCONFIGENABLEHWPERFCOUNTERS PVRSRV_IOWR(PVRSRV_BRIDGE_RGXHWPERF_CMD_FIRST+1)
#define PVRSRV_BRIDGE_RGXHWPERF_RGXCTRLHWPERFCOUNTERS PVRSRV_IOWR(PVRSRV_BRIDGE_RGXHWPERF_CMD_FIRST+2)
#define PVRSRV_BRIDGE_RGXHWPERF_RGXCONFIGCUSTOMCOUNTERS PVRSRV_IOWR(PVRSRV_BRIDGE_RGXHWPERF_CMD_FIRST+3)
#define PVRSRV_BRIDGE_RGXHWPERF_CMD_LAST (PVRSRV_BRIDGE_RGXHWPERF_CMD_FIRST+3)
/*******************************************
RGXCtrlHWPerf
*******************************************/
/* Bridge in structure for RGXCtrlHWPerf */
typedef struct PVRSRV_BRIDGE_IN_RGXCTRLHWPERF_TAG
{
IMG_HANDLE hDevNode;
IMG_BOOL bToggle;
IMG_UINT64 ui64Mask;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXCTRLHWPERF;
/* Bridge out structure for RGXCtrlHWPerf */
typedef struct PVRSRV_BRIDGE_OUT_RGXCTRLHWPERF_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXCTRLHWPERF;
/*******************************************
RGXConfigEnableHWPerfCounters
*******************************************/
/* Bridge in structure for RGXConfigEnableHWPerfCounters */
typedef struct PVRSRV_BRIDGE_IN_RGXCONFIGENABLEHWPERFCOUNTERS_TAG
{
IMG_HANDLE hDevNode;
IMG_UINT32 ui32ArrayLen;
RGX_HWPERF_CONFIG_CNTBLK * psBlockConfigs;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXCONFIGENABLEHWPERFCOUNTERS;
/* Bridge out structure for RGXConfigEnableHWPerfCounters */
typedef struct PVRSRV_BRIDGE_OUT_RGXCONFIGENABLEHWPERFCOUNTERS_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXCONFIGENABLEHWPERFCOUNTERS;
/*******************************************
RGXCtrlHWPerfCounters
*******************************************/
/* Bridge in structure for RGXCtrlHWPerfCounters */
typedef struct PVRSRV_BRIDGE_IN_RGXCTRLHWPERFCOUNTERS_TAG
{
IMG_HANDLE hDevNode;
IMG_BOOL bEnable;
IMG_UINT32 ui32ArrayLen;
IMG_UINT8 * pui8BlockIDs;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXCTRLHWPERFCOUNTERS;
/* Bridge out structure for RGXCtrlHWPerfCounters */
typedef struct PVRSRV_BRIDGE_OUT_RGXCTRLHWPERFCOUNTERS_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXCTRLHWPERFCOUNTERS;
/*******************************************
RGXConfigCustomCounters
*******************************************/
/* Bridge in structure for RGXConfigCustomCounters */
typedef struct PVRSRV_BRIDGE_IN_RGXCONFIGCUSTOMCOUNTERS_TAG
{
IMG_HANDLE hDevNode;
IMG_UINT16 ui16CustomBlockID;
IMG_UINT16 ui16NumCustomCounters;
IMG_UINT32 * pui32CustomCounterIDs;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXCONFIGCUSTOMCOUNTERS;
/* Bridge out structure for RGXConfigCustomCounters */
typedef struct PVRSRV_BRIDGE_OUT_RGXCONFIGCUSTOMCOUNTERS_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXCONFIGCUSTOMCOUNTERS;
#endif /* COMMON_RGXHWPERF_BRIDGE_H */

View File

@@ -1,340 +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>
/* ***************************************************************************
* Bridge proxy functions
*/
/* ***************************************************************************
* Server-side bridge entry points
*/
static IMG_INT
PVRSRVBridgeRGXCtrlHWPerf(IMG_UINT32 ui32BridgeID,
PVRSRV_BRIDGE_IN_RGXCTRLHWPERF *psRGXCtrlHWPerfIN,
PVRSRV_BRIDGE_OUT_RGXCTRLHWPERF *psRGXCtrlHWPerfOUT,
CONNECTION_DATA *psConnection)
{
IMG_HANDLE hDevNodeInt = IMG_NULL;
PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_RGXHWPERF_RGXCTRLHWPERF);
{
/* Look up the address from the handle */
psRGXCtrlHWPerfOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_HANDLE *) &hDevNodeInt,
psRGXCtrlHWPerfIN->hDevNode,
PVRSRV_HANDLE_TYPE_DEV_NODE);
if(psRGXCtrlHWPerfOUT->eError != PVRSRV_OK)
{
goto RGXCtrlHWPerf_exit;
}
}
psRGXCtrlHWPerfOUT->eError =
PVRSRVRGXCtrlHWPerfKM(
hDevNodeInt,
psRGXCtrlHWPerfIN->bToggle,
psRGXCtrlHWPerfIN->ui64Mask);
RGXCtrlHWPerf_exit:
return 0;
}
static IMG_INT
PVRSRVBridgeRGXConfigEnableHWPerfCounters(IMG_UINT32 ui32BridgeID,
PVRSRV_BRIDGE_IN_RGXCONFIGENABLEHWPERFCOUNTERS *psRGXConfigEnableHWPerfCountersIN,
PVRSRV_BRIDGE_OUT_RGXCONFIGENABLEHWPERFCOUNTERS *psRGXConfigEnableHWPerfCountersOUT,
CONNECTION_DATA *psConnection)
{
IMG_HANDLE hDevNodeInt = IMG_NULL;
RGX_HWPERF_CONFIG_CNTBLK *psBlockConfigsInt = IMG_NULL;
PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_RGXHWPERF_RGXCONFIGENABLEHWPERFCOUNTERS);
if (psRGXConfigEnableHWPerfCountersIN->ui32ArrayLen != 0)
{
psBlockConfigsInt = OSAllocMem(psRGXConfigEnableHWPerfCountersIN->ui32ArrayLen * sizeof(RGX_HWPERF_CONFIG_CNTBLK));
if (!psBlockConfigsInt)
{
psRGXConfigEnableHWPerfCountersOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY;
goto RGXConfigEnableHWPerfCounters_exit;
}
}
/* Copy the data over */
if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXConfigEnableHWPerfCountersIN->psBlockConfigs, psRGXConfigEnableHWPerfCountersIN->ui32ArrayLen * sizeof(RGX_HWPERF_CONFIG_CNTBLK))
|| (OSCopyFromUser(NULL, psBlockConfigsInt, psRGXConfigEnableHWPerfCountersIN->psBlockConfigs,
psRGXConfigEnableHWPerfCountersIN->ui32ArrayLen * sizeof(RGX_HWPERF_CONFIG_CNTBLK)) != PVRSRV_OK) )
{
psRGXConfigEnableHWPerfCountersOUT->eError = PVRSRV_ERROR_INVALID_PARAMS;
goto RGXConfigEnableHWPerfCounters_exit;
}
{
/* Look up the address from the handle */
psRGXConfigEnableHWPerfCountersOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_HANDLE *) &hDevNodeInt,
psRGXConfigEnableHWPerfCountersIN->hDevNode,
PVRSRV_HANDLE_TYPE_DEV_NODE);
if(psRGXConfigEnableHWPerfCountersOUT->eError != PVRSRV_OK)
{
goto RGXConfigEnableHWPerfCounters_exit;
}
}
psRGXConfigEnableHWPerfCountersOUT->eError =
PVRSRVRGXConfigEnableHWPerfCountersKM(
hDevNodeInt,
psRGXConfigEnableHWPerfCountersIN->ui32ArrayLen,
psBlockConfigsInt);
RGXConfigEnableHWPerfCounters_exit:
if (psBlockConfigsInt)
OSFreeMem(psBlockConfigsInt);
return 0;
}
static IMG_INT
PVRSRVBridgeRGXCtrlHWPerfCounters(IMG_UINT32 ui32BridgeID,
PVRSRV_BRIDGE_IN_RGXCTRLHWPERFCOUNTERS *psRGXCtrlHWPerfCountersIN,
PVRSRV_BRIDGE_OUT_RGXCTRLHWPERFCOUNTERS *psRGXCtrlHWPerfCountersOUT,
CONNECTION_DATA *psConnection)
{
IMG_HANDLE hDevNodeInt = IMG_NULL;
IMG_UINT8 *ui8BlockIDsInt = IMG_NULL;
PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_RGXHWPERF_RGXCTRLHWPERFCOUNTERS);
if (psRGXCtrlHWPerfCountersIN->ui32ArrayLen != 0)
{
ui8BlockIDsInt = OSAllocMem(psRGXCtrlHWPerfCountersIN->ui32ArrayLen * sizeof(IMG_UINT8));
if (!ui8BlockIDsInt)
{
psRGXCtrlHWPerfCountersOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY;
goto RGXCtrlHWPerfCounters_exit;
}
}
/* Copy the data over */
if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXCtrlHWPerfCountersIN->pui8BlockIDs, psRGXCtrlHWPerfCountersIN->ui32ArrayLen * sizeof(IMG_UINT8))
|| (OSCopyFromUser(NULL, ui8BlockIDsInt, psRGXCtrlHWPerfCountersIN->pui8BlockIDs,
psRGXCtrlHWPerfCountersIN->ui32ArrayLen * sizeof(IMG_UINT8)) != PVRSRV_OK) )
{
psRGXCtrlHWPerfCountersOUT->eError = PVRSRV_ERROR_INVALID_PARAMS;
goto RGXCtrlHWPerfCounters_exit;
}
{
/* Look up the address from the handle */
psRGXCtrlHWPerfCountersOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_HANDLE *) &hDevNodeInt,
psRGXCtrlHWPerfCountersIN->hDevNode,
PVRSRV_HANDLE_TYPE_DEV_NODE);
if(psRGXCtrlHWPerfCountersOUT->eError != PVRSRV_OK)
{
goto RGXCtrlHWPerfCounters_exit;
}
}
psRGXCtrlHWPerfCountersOUT->eError =
PVRSRVRGXCtrlHWPerfCountersKM(
hDevNodeInt,
psRGXCtrlHWPerfCountersIN->bEnable,
psRGXCtrlHWPerfCountersIN->ui32ArrayLen,
ui8BlockIDsInt);
RGXCtrlHWPerfCounters_exit:
if (ui8BlockIDsInt)
OSFreeMem(ui8BlockIDsInt);
return 0;
}
static IMG_INT
PVRSRVBridgeRGXConfigCustomCounters(IMG_UINT32 ui32BridgeID,
PVRSRV_BRIDGE_IN_RGXCONFIGCUSTOMCOUNTERS *psRGXConfigCustomCountersIN,
PVRSRV_BRIDGE_OUT_RGXCONFIGCUSTOMCOUNTERS *psRGXConfigCustomCountersOUT,
CONNECTION_DATA *psConnection)
{
IMG_HANDLE hDevNodeInt = IMG_NULL;
IMG_UINT32 *ui32CustomCounterIDsInt = IMG_NULL;
PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_RGXHWPERF_RGXCONFIGCUSTOMCOUNTERS);
if (psRGXConfigCustomCountersIN->ui16NumCustomCounters != 0)
{
ui32CustomCounterIDsInt = OSAllocMem(psRGXConfigCustomCountersIN->ui16NumCustomCounters * sizeof(IMG_UINT32));
if (!ui32CustomCounterIDsInt)
{
psRGXConfigCustomCountersOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY;
goto RGXConfigCustomCounters_exit;
}
}
/* Copy the data over */
if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXConfigCustomCountersIN->pui32CustomCounterIDs, psRGXConfigCustomCountersIN->ui16NumCustomCounters * sizeof(IMG_UINT32))
|| (OSCopyFromUser(NULL, ui32CustomCounterIDsInt, psRGXConfigCustomCountersIN->pui32CustomCounterIDs,
psRGXConfigCustomCountersIN->ui16NumCustomCounters * sizeof(IMG_UINT32)) != PVRSRV_OK) )
{
psRGXConfigCustomCountersOUT->eError = PVRSRV_ERROR_INVALID_PARAMS;
goto RGXConfigCustomCounters_exit;
}
{
/* Look up the address from the handle */
psRGXConfigCustomCountersOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_HANDLE *) &hDevNodeInt,
psRGXConfigCustomCountersIN->hDevNode,
PVRSRV_HANDLE_TYPE_DEV_NODE);
if(psRGXConfigCustomCountersOUT->eError != PVRSRV_OK)
{
goto RGXConfigCustomCounters_exit;
}
}
psRGXConfigCustomCountersOUT->eError =
PVRSRVRGXConfigCustomCountersKM(
hDevNodeInt,
psRGXConfigCustomCountersIN->ui16CustomBlockID,
psRGXConfigCustomCountersIN->ui16NumCustomCounters,
ui32CustomCounterIDsInt);
RGXConfigCustomCounters_exit:
if (ui32CustomCounterIDsInt)
OSFreeMem(ui32CustomCounterIDsInt);
return 0;
}
/* ***************************************************************************
* Server bridge dispatch related glue
*/
PVRSRV_ERROR RegisterRGXHWPERFFunctions(IMG_VOID);
IMG_VOID UnregisterRGXHWPERFFunctions(IMG_VOID);
/*
* Register all RGXHWPERF functions with services
*/
PVRSRV_ERROR RegisterRGXHWPERFFunctions(IMG_VOID)
{
SetDispatchTableEntry(PVRSRV_BRIDGE_RGXHWPERF_RGXCTRLHWPERF, PVRSRVBridgeRGXCtrlHWPerf);
SetDispatchTableEntry(PVRSRV_BRIDGE_RGXHWPERF_RGXCONFIGENABLEHWPERFCOUNTERS, PVRSRVBridgeRGXConfigEnableHWPerfCounters);
SetDispatchTableEntry(PVRSRV_BRIDGE_RGXHWPERF_RGXCTRLHWPERFCOUNTERS, PVRSRVBridgeRGXCtrlHWPerfCounters);
SetDispatchTableEntry(PVRSRV_BRIDGE_RGXHWPERF_RGXCONFIGCUSTOMCOUNTERS, PVRSRVBridgeRGXConfigCustomCounters);
return PVRSRV_OK;
}
/*
* Unregister all rgxhwperf functions with services
*/
IMG_VOID UnregisterRGXHWPERFFunctions(IMG_VOID)
{
}

View File

@@ -1,174 +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 "rgx_bridge.h"
#include "rgxscript.h"
#include "devicemem_typedefs.h"
#include "rgx_fwif_shared.h"
#include "rgx_fwif.h"
#include "pvr_bridge_io.h"
#define PVRSRV_BRIDGE_RGXINIT_CMD_FIRST (PVRSRV_BRIDGE_RGXINIT_START)
#define PVRSRV_BRIDGE_RGXINIT_RGXINITALLOCFWIMGMEM PVRSRV_IOWR(PVRSRV_BRIDGE_RGXINIT_CMD_FIRST+0)
#define PVRSRV_BRIDGE_RGXINIT_RGXINITFIRMWARE PVRSRV_IOWR(PVRSRV_BRIDGE_RGXINIT_CMD_FIRST+1)
#define PVRSRV_BRIDGE_RGXINIT_RGXINITLOADFWIMAGE PVRSRV_IOWR(PVRSRV_BRIDGE_RGXINIT_CMD_FIRST+2)
#define PVRSRV_BRIDGE_RGXINIT_RGXINITDEVPART2 PVRSRV_IOWR(PVRSRV_BRIDGE_RGXINIT_CMD_FIRST+3)
#define PVRSRV_BRIDGE_RGXINIT_CMD_LAST (PVRSRV_BRIDGE_RGXINIT_CMD_FIRST+3)
/*******************************************
RGXInitAllocFWImgMem
*******************************************/
/* Bridge in structure for RGXInitAllocFWImgMem */
typedef struct PVRSRV_BRIDGE_IN_RGXINITALLOCFWIMGMEM_TAG
{
IMG_HANDLE hDevNode;
IMG_DEVMEM_SIZE_T uiFWCodeLen;
IMG_DEVMEM_SIZE_T uiFWDataLen;
IMG_DEVMEM_SIZE_T uiFWCoremem;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXINITALLOCFWIMGMEM;
/* Bridge out structure for RGXInitAllocFWImgMem */
typedef struct PVRSRV_BRIDGE_OUT_RGXINITALLOCFWIMGMEM_TAG
{
DEVMEM_SERVER_EXPORTCOOKIE hFWCodeAllocServerExportCookie;
IMG_DEV_VIRTADDR sFWCodeDevVAddrBase;
DEVMEM_SERVER_EXPORTCOOKIE hFWDataAllocServerExportCookie;
IMG_DEV_VIRTADDR sFWDataDevVAddrBase;
DEVMEM_SERVER_EXPORTCOOKIE hFWCorememAllocServerExportCookie;
IMG_DEV_VIRTADDR sFWCorememDevVAddrBase;
RGXFWIF_DEV_VIRTADDR sFWCorememMetaVAddrBase;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXINITALLOCFWIMGMEM;
/*******************************************
RGXInitFirmware
*******************************************/
/* Bridge in structure for RGXInitFirmware */
typedef struct PVRSRV_BRIDGE_IN_RGXINITFIRMWARE_TAG
{
IMG_HANDLE hDevNode;
IMG_BOOL bEnableSignatureChecks;
IMG_UINT32 ui32SignatureChecksBufSize;
IMG_UINT32 ui32HWPerfFWBufSizeKB;
IMG_UINT64 ui64HWPerfFilter;
IMG_UINT32 ui32RGXFWAlignChecksSize;
IMG_UINT32 * pui32RGXFWAlignChecks;
IMG_UINT32 ui32ConfigFlags;
IMG_UINT32 ui32LogType;
IMG_UINT32 ui32FilterFlags;
RGXFWIF_COMPCHECKS_BVNC sClientBVNC;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXINITFIRMWARE;
/* Bridge out structure for RGXInitFirmware */
typedef struct PVRSRV_BRIDGE_OUT_RGXINITFIRMWARE_TAG
{
RGXFWIF_DEV_VIRTADDR spsRGXFwInit;
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXINITFIRMWARE;
/*******************************************
RGXInitLoadFWImage
*******************************************/
/* Bridge in structure for RGXInitLoadFWImage */
typedef struct PVRSRV_BRIDGE_IN_RGXINITLOADFWIMAGE_TAG
{
IMG_HANDLE hImgDestImport;
IMG_HANDLE hImgSrcImport;
IMG_UINT64 ui64ImgLen;
IMG_HANDLE hSigImport;
IMG_UINT64 ui64SigLen;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXINITLOADFWIMAGE;
/* Bridge out structure for RGXInitLoadFWImage */
typedef struct PVRSRV_BRIDGE_OUT_RGXINITLOADFWIMAGE_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXINITLOADFWIMAGE;
/*******************************************
RGXInitDevPart2
*******************************************/
/* Bridge in structure for RGXInitDevPart2 */
typedef struct PVRSRV_BRIDGE_IN_RGXINITDEVPART2_TAG
{
IMG_HANDLE hDevNode;
RGX_INIT_COMMAND * psInitScript;
RGX_INIT_COMMAND * psDbgScript;
RGX_INIT_COMMAND * psDbgBusScript;
RGX_INIT_COMMAND * psDeinitScript;
IMG_UINT32 ui32ui32KernelCatBaseIdReg;
IMG_UINT32 ui32KernelCatBaseId;
IMG_UINT32 ui32KernelCatBaseReg;
IMG_UINT32 ui32KernelCatBaseWordSize;
IMG_UINT32 ui32KernelCatBaseAlignShift;
IMG_UINT32 ui32KernelCatBaseShift;
IMG_UINT64 ui64KernelCatBaseMask;
IMG_UINT32 ui32DeviceFlags;
IMG_UINT32 ui32RGXActivePMConf;
DEVMEM_SERVER_EXPORTCOOKIE hFWCodeAllocServerExportCookie;
DEVMEM_SERVER_EXPORTCOOKIE hFWDataAllocServerExportCookie;
DEVMEM_SERVER_EXPORTCOOKIE hFWCorememAllocServerExportCookie;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXINITDEVPART2;
/* Bridge out structure for RGXInitDevPart2 */
typedef struct PVRSRV_BRIDGE_OUT_RGXINITDEVPART2_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXINITDEVPART2;
#endif /* COMMON_RGXINIT_BRIDGE_H */

View File

@@ -1,575 +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>
/* ***************************************************************************
* Bridge proxy functions
*/
/* ***************************************************************************
* Server-side bridge entry points
*/
static IMG_INT
PVRSRVBridgeRGXInitAllocFWImgMem(IMG_UINT32 ui32BridgeID,
PVRSRV_BRIDGE_IN_RGXINITALLOCFWIMGMEM *psRGXInitAllocFWImgMemIN,
PVRSRV_BRIDGE_OUT_RGXINITALLOCFWIMGMEM *psRGXInitAllocFWImgMemOUT,
CONNECTION_DATA *psConnection)
{
IMG_HANDLE hDevNodeInt = IMG_NULL;
DEVMEM_EXPORTCOOKIE * psFWCodeAllocServerExportCookieInt = IMG_NULL;
DEVMEM_EXPORTCOOKIE * psFWDataAllocServerExportCookieInt = IMG_NULL;
DEVMEM_EXPORTCOOKIE * psFWCorememAllocServerExportCookieInt = IMG_NULL;
PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_RGXINIT_RGXINITALLOCFWIMGMEM);
{
/* Look up the address from the handle */
psRGXInitAllocFWImgMemOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_HANDLE *) &hDevNodeInt,
psRGXInitAllocFWImgMemIN->hDevNode,
PVRSRV_HANDLE_TYPE_DEV_NODE);
if(psRGXInitAllocFWImgMemOUT->eError != PVRSRV_OK)
{
goto RGXInitAllocFWImgMem_exit;
}
}
psRGXInitAllocFWImgMemOUT->eError =
PVRSRVRGXInitAllocFWImgMemKM(
hDevNodeInt,
psRGXInitAllocFWImgMemIN->uiFWCodeLen,
psRGXInitAllocFWImgMemIN->uiFWDataLen,
psRGXInitAllocFWImgMemIN->uiFWCoremem,
&psFWCodeAllocServerExportCookieInt,
&psRGXInitAllocFWImgMemOUT->sFWCodeDevVAddrBase,
&psFWDataAllocServerExportCookieInt,
&psRGXInitAllocFWImgMemOUT->sFWDataDevVAddrBase,
&psFWCorememAllocServerExportCookieInt,
&psRGXInitAllocFWImgMemOUT->sFWCorememDevVAddrBase,
&psRGXInitAllocFWImgMemOUT->sFWCorememMetaVAddrBase);
/* Exit early if bridged call fails */
if(psRGXInitAllocFWImgMemOUT->eError != PVRSRV_OK)
{
goto RGXInitAllocFWImgMem_exit;
}
psRGXInitAllocFWImgMemOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase,
&psRGXInitAllocFWImgMemOUT->hFWCodeAllocServerExportCookie,
(IMG_HANDLE) psFWCodeAllocServerExportCookieInt,
PVRSRV_HANDLE_TYPE_SERVER_EXPORTCOOKIE,
PVRSRV_HANDLE_ALLOC_FLAG_NONE
);
if (psRGXInitAllocFWImgMemOUT->eError != PVRSRV_OK)
{
goto RGXInitAllocFWImgMem_exit;
}
psRGXInitAllocFWImgMemOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase,
&psRGXInitAllocFWImgMemOUT->hFWDataAllocServerExportCookie,
(IMG_HANDLE) psFWDataAllocServerExportCookieInt,
PVRSRV_HANDLE_TYPE_SERVER_EXPORTCOOKIE,
PVRSRV_HANDLE_ALLOC_FLAG_NONE
);
if (psRGXInitAllocFWImgMemOUT->eError != PVRSRV_OK)
{
goto RGXInitAllocFWImgMem_exit;
}
psRGXInitAllocFWImgMemOUT->eError = PVRSRVAllocHandle(psConnection->psHandleBase,
&psRGXInitAllocFWImgMemOUT->hFWCorememAllocServerExportCookie,
(IMG_HANDLE) psFWCorememAllocServerExportCookieInt,
PVRSRV_HANDLE_TYPE_SERVER_EXPORTCOOKIE,
PVRSRV_HANDLE_ALLOC_FLAG_NONE
);
if (psRGXInitAllocFWImgMemOUT->eError != PVRSRV_OK)
{
goto RGXInitAllocFWImgMem_exit;
}
RGXInitAllocFWImgMem_exit:
if (psRGXInitAllocFWImgMemOUT->eError != PVRSRV_OK)
{
}
return 0;
}
static IMG_INT
PVRSRVBridgeRGXInitFirmware(IMG_UINT32 ui32BridgeID,
PVRSRV_BRIDGE_IN_RGXINITFIRMWARE *psRGXInitFirmwareIN,
PVRSRV_BRIDGE_OUT_RGXINITFIRMWARE *psRGXInitFirmwareOUT,
CONNECTION_DATA *psConnection)
{
IMG_HANDLE hDevNodeInt = IMG_NULL;
IMG_UINT32 *ui32RGXFWAlignChecksInt = IMG_NULL;
PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_RGXINIT_RGXINITFIRMWARE);
if (psRGXInitFirmwareIN->ui32RGXFWAlignChecksSize != 0)
{
ui32RGXFWAlignChecksInt = OSAllocMem(psRGXInitFirmwareIN->ui32RGXFWAlignChecksSize * sizeof(IMG_UINT32));
if (!ui32RGXFWAlignChecksInt)
{
psRGXInitFirmwareOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY;
goto RGXInitFirmware_exit;
}
}
/* Copy the data over */
if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXInitFirmwareIN->pui32RGXFWAlignChecks, psRGXInitFirmwareIN->ui32RGXFWAlignChecksSize * sizeof(IMG_UINT32))
|| (OSCopyFromUser(NULL, ui32RGXFWAlignChecksInt, psRGXInitFirmwareIN->pui32RGXFWAlignChecks,
psRGXInitFirmwareIN->ui32RGXFWAlignChecksSize * sizeof(IMG_UINT32)) != PVRSRV_OK) )
{
psRGXInitFirmwareOUT->eError = PVRSRV_ERROR_INVALID_PARAMS;
goto RGXInitFirmware_exit;
}
{
/* Look up the address from the handle */
psRGXInitFirmwareOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_HANDLE *) &hDevNodeInt,
psRGXInitFirmwareIN->hDevNode,
PVRSRV_HANDLE_TYPE_DEV_NODE);
if(psRGXInitFirmwareOUT->eError != PVRSRV_OK)
{
goto RGXInitFirmware_exit;
}
}
psRGXInitFirmwareOUT->eError =
PVRSRVRGXInitFirmwareKM(
hDevNodeInt,
&psRGXInitFirmwareOUT->spsRGXFwInit,
psRGXInitFirmwareIN->bEnableSignatureChecks,
psRGXInitFirmwareIN->ui32SignatureChecksBufSize,
psRGXInitFirmwareIN->ui32HWPerfFWBufSizeKB,
psRGXInitFirmwareIN->ui64HWPerfFilter,
psRGXInitFirmwareIN->ui32RGXFWAlignChecksSize,
ui32RGXFWAlignChecksInt,
psRGXInitFirmwareIN->ui32ConfigFlags,
psRGXInitFirmwareIN->ui32LogType,
psRGXInitFirmwareIN->ui32FilterFlags,
&psRGXInitFirmwareIN->sClientBVNC);
RGXInitFirmware_exit:
if (ui32RGXFWAlignChecksInt)
OSFreeMem(ui32RGXFWAlignChecksInt);
return 0;
}
static IMG_INT
PVRSRVBridgeRGXInitLoadFWImage(IMG_UINT32 ui32BridgeID,
PVRSRV_BRIDGE_IN_RGXINITLOADFWIMAGE *psRGXInitLoadFWImageIN,
PVRSRV_BRIDGE_OUT_RGXINITLOADFWIMAGE *psRGXInitLoadFWImageOUT,
CONNECTION_DATA *psConnection)
{
PMR * psImgDestImportInt = IMG_NULL;
IMG_HANDLE hImgDestImportInt2 = IMG_NULL;
PMR * psImgSrcImportInt = IMG_NULL;
IMG_HANDLE hImgSrcImportInt2 = IMG_NULL;
PMR * psSigImportInt = IMG_NULL;
IMG_HANDLE hSigImportInt2 = IMG_NULL;
PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_RGXINIT_RGXINITLOADFWIMAGE);
{
/* Look up the address from the handle */
psRGXInitLoadFWImageOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_HANDLE *) &hImgDestImportInt2,
psRGXInitLoadFWImageIN->hImgDestImport,
PVRSRV_HANDLE_TYPE_PHYSMEM_PMR);
if(psRGXInitLoadFWImageOUT->eError != PVRSRV_OK)
{
goto RGXInitLoadFWImage_exit;
}
/* Look up the data from the resman address */
psRGXInitLoadFWImageOUT->eError = ResManFindPrivateDataByPtr(hImgDestImportInt2, (IMG_VOID **) &psImgDestImportInt);
if(psRGXInitLoadFWImageOUT->eError != PVRSRV_OK)
{
goto RGXInitLoadFWImage_exit;
}
}
{
/* Look up the address from the handle */
psRGXInitLoadFWImageOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_HANDLE *) &hImgSrcImportInt2,
psRGXInitLoadFWImageIN->hImgSrcImport,
PVRSRV_HANDLE_TYPE_PHYSMEM_PMR);
if(psRGXInitLoadFWImageOUT->eError != PVRSRV_OK)
{
goto RGXInitLoadFWImage_exit;
}
/* Look up the data from the resman address */
psRGXInitLoadFWImageOUT->eError = ResManFindPrivateDataByPtr(hImgSrcImportInt2, (IMG_VOID **) &psImgSrcImportInt);
if(psRGXInitLoadFWImageOUT->eError != PVRSRV_OK)
{
goto RGXInitLoadFWImage_exit;
}
}
{
/* Look up the address from the handle */
psRGXInitLoadFWImageOUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_HANDLE *) &hSigImportInt2,
psRGXInitLoadFWImageIN->hSigImport,
PVRSRV_HANDLE_TYPE_PHYSMEM_PMR);
if(psRGXInitLoadFWImageOUT->eError != PVRSRV_OK)
{
goto RGXInitLoadFWImage_exit;
}
/* Look up the data from the resman address */
psRGXInitLoadFWImageOUT->eError = ResManFindPrivateDataByPtr(hSigImportInt2, (IMG_VOID **) &psSigImportInt);
if(psRGXInitLoadFWImageOUT->eError != PVRSRV_OK)
{
goto RGXInitLoadFWImage_exit;
}
}
psRGXInitLoadFWImageOUT->eError =
PVRSRVRGXInitLoadFWImageKM(
psImgDestImportInt,
psImgSrcImportInt,
psRGXInitLoadFWImageIN->ui64ImgLen,
psSigImportInt,
psRGXInitLoadFWImageIN->ui64SigLen);
RGXInitLoadFWImage_exit:
return 0;
}
static IMG_INT
PVRSRVBridgeRGXInitDevPart2(IMG_UINT32 ui32BridgeID,
PVRSRV_BRIDGE_IN_RGXINITDEVPART2 *psRGXInitDevPart2IN,
PVRSRV_BRIDGE_OUT_RGXINITDEVPART2 *psRGXInitDevPart2OUT,
CONNECTION_DATA *psConnection)
{
IMG_HANDLE hDevNodeInt = IMG_NULL;
RGX_INIT_COMMAND *psInitScriptInt = IMG_NULL;
RGX_INIT_COMMAND *psDbgScriptInt = IMG_NULL;
RGX_INIT_COMMAND *psDbgBusScriptInt = IMG_NULL;
RGX_INIT_COMMAND *psDeinitScriptInt = IMG_NULL;
DEVMEM_EXPORTCOOKIE * psFWCodeAllocServerExportCookieInt = IMG_NULL;
DEVMEM_EXPORTCOOKIE * psFWDataAllocServerExportCookieInt = IMG_NULL;
DEVMEM_EXPORTCOOKIE * psFWCorememAllocServerExportCookieInt = IMG_NULL;
PVRSRV_BRIDGE_ASSERT_CMD(ui32BridgeID, PVRSRV_BRIDGE_RGXINIT_RGXINITDEVPART2);
{
psInitScriptInt = OSAllocMem(RGX_MAX_INIT_COMMANDS * sizeof(RGX_INIT_COMMAND));
if (!psInitScriptInt)
{
psRGXInitDevPart2OUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY;
goto RGXInitDevPart2_exit;
}
}
/* Copy the data over */
if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXInitDevPart2IN->psInitScript, RGX_MAX_INIT_COMMANDS * sizeof(RGX_INIT_COMMAND))
|| (OSCopyFromUser(NULL, psInitScriptInt, psRGXInitDevPart2IN->psInitScript,
RGX_MAX_INIT_COMMANDS * sizeof(RGX_INIT_COMMAND)) != PVRSRV_OK) )
{
psRGXInitDevPart2OUT->eError = PVRSRV_ERROR_INVALID_PARAMS;
goto RGXInitDevPart2_exit;
}
{
psDbgScriptInt = OSAllocMem(RGX_MAX_INIT_COMMANDS * sizeof(RGX_INIT_COMMAND));
if (!psDbgScriptInt)
{
psRGXInitDevPart2OUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY;
goto RGXInitDevPart2_exit;
}
}
/* Copy the data over */
if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXInitDevPart2IN->psDbgScript, RGX_MAX_INIT_COMMANDS * sizeof(RGX_INIT_COMMAND))
|| (OSCopyFromUser(NULL, psDbgScriptInt, psRGXInitDevPart2IN->psDbgScript,
RGX_MAX_INIT_COMMANDS * sizeof(RGX_INIT_COMMAND)) != PVRSRV_OK) )
{
psRGXInitDevPart2OUT->eError = PVRSRV_ERROR_INVALID_PARAMS;
goto RGXInitDevPart2_exit;
}
{
psDbgBusScriptInt = OSAllocMem(RGX_MAX_DBGBUS_COMMANDS * sizeof(RGX_INIT_COMMAND));
if (!psDbgBusScriptInt)
{
psRGXInitDevPart2OUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY;
goto RGXInitDevPart2_exit;
}
}
/* Copy the data over */
if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXInitDevPart2IN->psDbgBusScript, RGX_MAX_DBGBUS_COMMANDS * sizeof(RGX_INIT_COMMAND))
|| (OSCopyFromUser(NULL, psDbgBusScriptInt, psRGXInitDevPart2IN->psDbgBusScript,
RGX_MAX_DBGBUS_COMMANDS * sizeof(RGX_INIT_COMMAND)) != PVRSRV_OK) )
{
psRGXInitDevPart2OUT->eError = PVRSRV_ERROR_INVALID_PARAMS;
goto RGXInitDevPart2_exit;
}
{
psDeinitScriptInt = OSAllocMem(RGX_MAX_DEINIT_COMMANDS * sizeof(RGX_INIT_COMMAND));
if (!psDeinitScriptInt)
{
psRGXInitDevPart2OUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY;
goto RGXInitDevPart2_exit;
}
}
/* Copy the data over */
if ( !OSAccessOK(PVR_VERIFY_READ, (IMG_VOID*) psRGXInitDevPart2IN->psDeinitScript, RGX_MAX_DEINIT_COMMANDS * sizeof(RGX_INIT_COMMAND))
|| (OSCopyFromUser(NULL, psDeinitScriptInt, psRGXInitDevPart2IN->psDeinitScript,
RGX_MAX_DEINIT_COMMANDS * sizeof(RGX_INIT_COMMAND)) != PVRSRV_OK) )
{
psRGXInitDevPart2OUT->eError = PVRSRV_ERROR_INVALID_PARAMS;
goto RGXInitDevPart2_exit;
}
{
/* Look up the address from the handle */
psRGXInitDevPart2OUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_HANDLE *) &hDevNodeInt,
psRGXInitDevPart2IN->hDevNode,
PVRSRV_HANDLE_TYPE_DEV_NODE);
if(psRGXInitDevPart2OUT->eError != PVRSRV_OK)
{
goto RGXInitDevPart2_exit;
}
}
{
/* Look up the address from the handle */
psRGXInitDevPart2OUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_HANDLE *) &psFWCodeAllocServerExportCookieInt,
psRGXInitDevPart2IN->hFWCodeAllocServerExportCookie,
PVRSRV_HANDLE_TYPE_SERVER_EXPORTCOOKIE);
if(psRGXInitDevPart2OUT->eError != PVRSRV_OK)
{
goto RGXInitDevPart2_exit;
}
}
{
/* Look up the address from the handle */
psRGXInitDevPart2OUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_HANDLE *) &psFWDataAllocServerExportCookieInt,
psRGXInitDevPart2IN->hFWDataAllocServerExportCookie,
PVRSRV_HANDLE_TYPE_SERVER_EXPORTCOOKIE);
if(psRGXInitDevPart2OUT->eError != PVRSRV_OK)
{
goto RGXInitDevPart2_exit;
}
}
{
/* Look up the address from the handle */
psRGXInitDevPart2OUT->eError =
PVRSRVLookupHandle(psConnection->psHandleBase,
(IMG_HANDLE *) &psFWCorememAllocServerExportCookieInt,
psRGXInitDevPart2IN->hFWCorememAllocServerExportCookie,
PVRSRV_HANDLE_TYPE_SERVER_EXPORTCOOKIE);
if(psRGXInitDevPart2OUT->eError != PVRSRV_OK)
{
goto RGXInitDevPart2_exit;
}
}
psRGXInitDevPart2OUT->eError =
PVRSRVRGXInitDevPart2KM(
hDevNodeInt,
psInitScriptInt,
psDbgScriptInt,
psDbgBusScriptInt,
psDeinitScriptInt,
psRGXInitDevPart2IN->ui32ui32KernelCatBaseIdReg,
psRGXInitDevPart2IN->ui32KernelCatBaseId,
psRGXInitDevPart2IN->ui32KernelCatBaseReg,
psRGXInitDevPart2IN->ui32KernelCatBaseWordSize,
psRGXInitDevPart2IN->ui32KernelCatBaseAlignShift,
psRGXInitDevPart2IN->ui32KernelCatBaseShift,
psRGXInitDevPart2IN->ui64KernelCatBaseMask,
psRGXInitDevPart2IN->ui32DeviceFlags,
psRGXInitDevPart2IN->ui32RGXActivePMConf,
psFWCodeAllocServerExportCookieInt,
psFWDataAllocServerExportCookieInt,
psFWCorememAllocServerExportCookieInt);
/* Exit early if bridged call fails */
if(psRGXInitDevPart2OUT->eError != PVRSRV_OK)
{
goto RGXInitDevPart2_exit;
}
psRGXInitDevPart2OUT->eError =
PVRSRVReleaseHandle(psConnection->psHandleBase,
(IMG_HANDLE) psRGXInitDevPart2IN->hFWCodeAllocServerExportCookie,
PVRSRV_HANDLE_TYPE_SERVER_EXPORTCOOKIE);
psRGXInitDevPart2OUT->eError =
PVRSRVReleaseHandle(psConnection->psHandleBase,
(IMG_HANDLE) psRGXInitDevPart2IN->hFWDataAllocServerExportCookie,
PVRSRV_HANDLE_TYPE_SERVER_EXPORTCOOKIE);
psRGXInitDevPart2OUT->eError =
PVRSRVReleaseHandle(psConnection->psHandleBase,
(IMG_HANDLE) psRGXInitDevPart2IN->hFWCorememAllocServerExportCookie,
PVRSRV_HANDLE_TYPE_SERVER_EXPORTCOOKIE);
RGXInitDevPart2_exit:
if (psInitScriptInt)
OSFreeMem(psInitScriptInt);
if (psDbgScriptInt)
OSFreeMem(psDbgScriptInt);
if (psDbgBusScriptInt)
OSFreeMem(psDbgBusScriptInt);
if (psDeinitScriptInt)
OSFreeMem(psDeinitScriptInt);
return 0;
}
/* ***************************************************************************
* Server bridge dispatch related glue
*/
PVRSRV_ERROR RegisterRGXINITFunctions(IMG_VOID);
IMG_VOID UnregisterRGXINITFunctions(IMG_VOID);
/*
* Register all RGXINIT functions with services
*/
PVRSRV_ERROR RegisterRGXINITFunctions(IMG_VOID)
{
SetDispatchTableEntry(PVRSRV_BRIDGE_RGXINIT_RGXINITALLOCFWIMGMEM, PVRSRVBridgeRGXInitAllocFWImgMem);
SetDispatchTableEntry(PVRSRV_BRIDGE_RGXINIT_RGXINITFIRMWARE, PVRSRVBridgeRGXInitFirmware);
SetDispatchTableEntry(PVRSRV_BRIDGE_RGXINIT_RGXINITLOADFWIMAGE, PVRSRVBridgeRGXInitLoadFWImage);
SetDispatchTableEntry(PVRSRV_BRIDGE_RGXINIT_RGXINITDEVPART2, PVRSRVBridgeRGXInitDevPart2);
return PVRSRV_OK;
}
/*
* Unregister all rgxinit functions with services
*/
IMG_VOID UnregisterRGXINITFunctions(IMG_VOID)
{
}

View File

@@ -1,95 +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 "rgx_bridge.h"
#include "pvr_bridge_io.h"
#define PVRSRV_BRIDGE_RGXPDUMP_CMD_FIRST (PVRSRV_BRIDGE_RGXPDUMP_START)
#define PVRSRV_BRIDGE_RGXPDUMP_PDUMPTRACEBUFFER PVRSRV_IOWR(PVRSRV_BRIDGE_RGXPDUMP_CMD_FIRST+0)
#define PVRSRV_BRIDGE_RGXPDUMP_PDUMPSIGNATUREBUFFER PVRSRV_IOWR(PVRSRV_BRIDGE_RGXPDUMP_CMD_FIRST+1)
#define PVRSRV_BRIDGE_RGXPDUMP_CMD_LAST (PVRSRV_BRIDGE_RGXPDUMP_CMD_FIRST+1)
/*******************************************
PDumpTraceBuffer
*******************************************/
/* Bridge in structure for PDumpTraceBuffer */
typedef struct PVRSRV_BRIDGE_IN_PDUMPTRACEBUFFER_TAG
{
IMG_HANDLE hDeviceNode;
IMG_UINT32 ui32PDumpFlags;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_PDUMPTRACEBUFFER;
/* Bridge out structure for PDumpTraceBuffer */
typedef struct PVRSRV_BRIDGE_OUT_PDUMPTRACEBUFFER_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PDUMPTRACEBUFFER;
/*******************************************
PDumpSignatureBuffer
*******************************************/
/* Bridge in structure for PDumpSignatureBuffer */
typedef struct PVRSRV_BRIDGE_IN_PDUMPSIGNATUREBUFFER_TAG
{
IMG_HANDLE hDeviceNode;
IMG_UINT32 ui32PDumpFlags;
} __attribute__((packed)) PVRSRV_BRIDGE_IN_PDUMPSIGNATUREBUFFER;
/* Bridge out structure for PDumpSignatureBuffer */
typedef struct PVRSRV_BRIDGE_OUT_PDUMPSIGNATUREBUFFER_TAG
{
PVRSRV_ERROR eError;
} __attribute__((packed)) PVRSRV_BRIDGE_OUT_PDUMPSIGNATUREBUFFER;
#endif /* COMMON_RGXPDUMP_BRIDGE_H */

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