nanovg-vita: Initial working port
2
.gitignore
vendored
@ -5,6 +5,8 @@
|
||||
*.exe
|
||||
*.o
|
||||
*.so
|
||||
*.a
|
||||
*.suprx
|
||||
test
|
||||
|
||||
## Logs and databases #
|
||||
|
78
CMakeLists.txt
Normal file
@ -0,0 +1,78 @@
|
||||
cmake_minimum_required(VERSION 2.8)
|
||||
|
||||
if(NOT DEFINED CMAKE_TOOLCHAIN_FILE)
|
||||
if(DEFINED ENV{VITASDK})
|
||||
set(CMAKE_TOOLCHAIN_FILE "$ENV{VITASDK}/share/vita.toolchain.cmake" CACHE PATH "toolchain file")
|
||||
else()
|
||||
message(FATAL_ERROR "Please define VITASDK to point to your SDK path!")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
project(nanovg-vita)
|
||||
include("${VITASDK}/share/vita.cmake" REQUIRED)
|
||||
|
||||
set(VITA_APP_NAME "nanovg-vita")
|
||||
set(VITA_TITLEID "NANOVGPSV")
|
||||
set(VITA_VERSION "01.00")
|
||||
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 -ffast-math -mtune=cortex-a9 -mfpu=neon -Wall")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -ffast-math -mtune=cortex-a9 -mfpu=neon -Wall -std=gnu++17")
|
||||
set(VITA_MKSFOEX_FLAGS "${VITA_MKSFOEX_FLAGS} -d PARENTAL_LEVEL=1")
|
||||
set(VITA_MKSFOEX_FLAGS "${VITA_MKSFOEX_FLAGS} -d ATTRIBUTE2=12")
|
||||
|
||||
add_definitions(-D__psp2__)
|
||||
|
||||
include_directories(
|
||||
include
|
||||
nanovg/src
|
||||
nanovg/example
|
||||
)
|
||||
|
||||
link_directories(
|
||||
${CMAKE_CURRENT_BINARY_DIR}
|
||||
${CMAKE_SOURCE_DIR}/libs
|
||||
)
|
||||
|
||||
add_executable(${PROJECT_NAME}
|
||||
nanovg/src/nanovg.c
|
||||
nanovg/example/demo.c
|
||||
source/main.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(${PROJECT_NAME}
|
||||
libgpu_es4_ext_stub_weak
|
||||
libGLESv2_stub_weak
|
||||
libIMGEGL_stub_weak
|
||||
SceCtrl_stub
|
||||
)
|
||||
|
||||
vita_create_self(${PROJECT_NAME}.self ${PROJECT_NAME} UNSAFE)
|
||||
vita_create_vpk(${PROJECT_NAME}.vpk ${VITA_TITLEID} ${PROJECT_NAME}.self
|
||||
VERSION ${VITA_VERSION}
|
||||
NAME ${VITA_APP_NAME}
|
||||
FILE sce_sys/icon0.png sce_sys/icon0.png
|
||||
FILE sce_sys/livearea/contents/bg.png sce_sys/livearea/contents/bg.png
|
||||
FILE sce_sys/livearea/contents/startup.png sce_sys/livearea/contents/startup.png
|
||||
FILE sce_sys/livearea/contents/template.xml sce_sys/livearea/contents/template.xml
|
||||
FILE data/libgpu_es4_ext.suprx libgpu_es4_ext.suprx
|
||||
FILE data/libIMGEGL.suprx libIMGEGL.suprx
|
||||
FILE data/libGLESv2.suprx module/libGLESv2.suprx
|
||||
FILE data/libpvrPSP2_WSEGL.suprx module/libpvrPSP2_WSEGL.suprx
|
||||
FILE nanovg/example/images/image1.jpg example/images/image1.jpg
|
||||
FILE nanovg/example/images/image2.jpg example/images/image2.jpg
|
||||
FILE nanovg/example/images/image3.jpg example/images/image3.jpg
|
||||
FILE nanovg/example/images/image4.jpg example/images/image4.jpg
|
||||
FILE nanovg/example/images/image5.jpg example/images/image5.jpg
|
||||
FILE nanovg/example/images/image6.jpg example/images/image6.jpg
|
||||
FILE nanovg/example/images/image7.jpg example/images/image7.jpg
|
||||
FILE nanovg/example/images/image8.jpg example/images/image8.jpg
|
||||
FILE nanovg/example/images/image9.jpg example/images/image9.jpg
|
||||
FILE nanovg/example/images/image10.jpg example/images/image10.jpg
|
||||
FILE nanovg/example/images/image11.jpg example/images/image11.jpg
|
||||
FILE nanovg/example/images/image12.jpg example/images/image12.jpg
|
||||
|
||||
FILE nanovg/example/entypo.ttf example/entypo.ttf
|
||||
FILE nanovg/example/Roboto-Regular.ttf example/Roboto-Regular.ttf
|
||||
FILE nanovg/example/Roboto-Bold.ttf example/Roboto-Bold.ttf
|
||||
FILE nanovg/example/NotoEmoji-Regular.ttf example/NotoEmoji-Regular.ttf
|
||||
)
|
18
LICENSE.txt
@ -1,18 +0,0 @@
|
||||
Copyright (c) 2013 Mikko Mononen memon@inside.org
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
arising from the use of this software.
|
||||
|
||||
Permission is granted to anyone to use this software for any purpose,
|
||||
including commercial applications, and to alter it and redistribute it
|
||||
freely, subject to the following restrictions:
|
||||
|
||||
1. The origin of this software must not be misrepresented; you must not
|
||||
claim that you wrote the original software. If you use this software
|
||||
in a product, an acknowledgment in the product documentation would be
|
||||
appreciated but is not required.
|
||||
2. Altered source versions must be plainly marked as such, and must not be
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
|
126
README.md
@ -1,126 +0,0 @@
|
||||
*This project is not actively maintained.*
|
||||
|
||||
NanoVG
|
||||
==========
|
||||
|
||||
NanoVG is small antialiased vector graphics rendering library for OpenGL. It has lean API modeled after HTML5 canvas API. It is aimed to be a practical and fun toolset for building scalable user interfaces and visualizations.
|
||||
|
||||
## Screenshot
|
||||
|
||||
![screenshot of some text rendered witht the sample program](/example/screenshot-01.png?raw=true)
|
||||
|
||||
Usage
|
||||
=====
|
||||
|
||||
The NanoVG API is modeled loosely on HTML5 canvas API. If you know canvas, you're up to speed with NanoVG in no time.
|
||||
|
||||
## Creating drawing context
|
||||
|
||||
The drawing context is created using platform specific constructor function. If you're using the OpenGL 2.0 back-end the context is created as follows:
|
||||
```C
|
||||
#define NANOVG_GL2_IMPLEMENTATION // Use GL2 implementation.
|
||||
#include "nanovg_gl.h"
|
||||
...
|
||||
struct NVGcontext* vg = nvgCreateGL2(NVG_ANTIALIAS | NVG_STENCIL_STROKES);
|
||||
```
|
||||
|
||||
The first parameter defines flags for creating the renderer.
|
||||
|
||||
- `NVG_ANTIALIAS` means that the renderer adjusts the geometry to include anti-aliasing. If you're using MSAA, you can omit this flags.
|
||||
- `NVG_STENCIL_STROKES` means that the render uses better quality rendering for (overlapping) strokes. The quality is mostly visible on wider strokes. If you want speed, you can omit this flag.
|
||||
|
||||
Currently there is an OpenGL back-end for NanoVG: [nanovg_gl.h](/src/nanovg_gl.h) for OpenGL 2.0, OpenGL ES 2.0, OpenGL 3.2 core profile and OpenGL ES 3. The implementation can be chosen using a define as in above example. See the header file and examples for further info.
|
||||
|
||||
*NOTE:* The render target you're rendering to must have stencil buffer.
|
||||
|
||||
## Drawing shapes with NanoVG
|
||||
|
||||
Drawing a simple shape using NanoVG consists of four steps: 1) begin a new shape, 2) define the path to draw, 3) set fill or stroke, 4) and finally fill or stroke the path.
|
||||
|
||||
```C
|
||||
nvgBeginPath(vg);
|
||||
nvgRect(vg, 100,100, 120,30);
|
||||
nvgFillColor(vg, nvgRGBA(255,192,0,255));
|
||||
nvgFill(vg);
|
||||
```
|
||||
|
||||
Calling `nvgBeginPath()` will clear any existing paths and start drawing from blank slate. There are number of number of functions to define the path to draw, such as rectangle, rounded rectangle and ellipse, or you can use the common moveTo, lineTo, bezierTo and arcTo API to compose the paths step by step.
|
||||
|
||||
## Understanding Composite Paths
|
||||
|
||||
Because of the way the rendering backend is build in NanoVG, drawing a composite path, that is path consisting from multiple paths defining holes and fills, is a bit more involved. NanoVG uses even-odd filling rule and by default the paths are wound in counter clockwise order. Keep that in mind when drawing using the low level draw API. In order to wind one of the predefined shapes as a hole, you should call `nvgPathWinding(vg, NVG_HOLE)`, or `nvgPathWinding(vg, NVG_CW)` _after_ defining the path.
|
||||
|
||||
``` C
|
||||
nvgBeginPath(vg);
|
||||
nvgRect(vg, 100,100, 120,30);
|
||||
nvgCircle(vg, 120,120, 5);
|
||||
nvgPathWinding(vg, NVG_HOLE); // Mark circle as a hole.
|
||||
nvgFillColor(vg, nvgRGBA(255,192,0,255));
|
||||
nvgFill(vg);
|
||||
```
|
||||
|
||||
## Rendering is wrong, what to do?
|
||||
|
||||
- make sure you have created NanoVG context using one of the `nvgCreatexxx()` calls
|
||||
- make sure you have initialised OpenGL with *stencil buffer*
|
||||
- make sure you have cleared stencil buffer
|
||||
- make sure all rendering calls happen between `nvgBeginFrame()` and `nvgEndFrame()`
|
||||
- to enable more checks for OpenGL errors, add `NVG_DEBUG` flag to `nvgCreatexxx()`
|
||||
- if the problem still persists, please report an issue!
|
||||
|
||||
## OpenGL state touched by the backend
|
||||
|
||||
The OpenGL back-end touches following states:
|
||||
|
||||
When textures are uploaded or updated, the following pixel store is set to defaults: `GL_UNPACK_ALIGNMENT`, `GL_UNPACK_ROW_LENGTH`, `GL_UNPACK_SKIP_PIXELS`, `GL_UNPACK_SKIP_ROWS`. Texture binding is also affected. Texture updates can happen when the user loads images, or when new font glyphs are added. Glyphs are added as needed between calls to `nvgBeginFrame()` and `nvgEndFrame()`.
|
||||
|
||||
The data for the whole frame is buffered and flushed in `nvgEndFrame()`. The following code illustrates the OpenGL state touched by the rendering code:
|
||||
```C
|
||||
glUseProgram(prog);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glEnable(GL_CULL_FACE);
|
||||
glCullFace(GL_BACK);
|
||||
glFrontFace(GL_CCW);
|
||||
glEnable(GL_BLEND);
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
glDisable(GL_SCISSOR_TEST);
|
||||
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
|
||||
glStencilMask(0xffffffff);
|
||||
glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP);
|
||||
glStencilFunc(GL_ALWAYS, 0, 0xffffffff);
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
glBindBuffer(GL_UNIFORM_BUFFER, buf);
|
||||
glBindVertexArray(arr);
|
||||
glBindBuffer(GL_ARRAY_BUFFER, buf);
|
||||
glBindTexture(GL_TEXTURE_2D, tex);
|
||||
glUniformBlockBinding(... , GLNVG_FRAG_BINDING);
|
||||
```
|
||||
|
||||
## API Reference
|
||||
|
||||
See the header file [nanovg.h](/src/nanovg.h) for API reference.
|
||||
|
||||
## Ports
|
||||
|
||||
- [DX11 port](https://github.com/cmaughan/nanovg) by [Chris Maughan](https://github.com/cmaughan)
|
||||
- [Metal port](https://github.com/ollix/MetalNanoVG) by [Olli Wang](https://github.com/olliwang)
|
||||
- [bgfx port](https://github.com/bkaradzic/bgfx/tree/master/examples/20-nanovg) by [Branimir Karadžić](https://github.com/bkaradzic)
|
||||
|
||||
## Projects using NanoVG
|
||||
|
||||
- [Processing API simulation by vinjn](https://github.com/vinjn/island/blob/master/examples/01-processing/sketch2d.h)
|
||||
- [NanoVG for .NET, C# P/Invoke binding](https://github.com/sbarisic/nanovg_dotnet)
|
||||
|
||||
## License
|
||||
The library is licensed under [zlib license](LICENSE.txt)
|
||||
Fonts used in examples:
|
||||
- Roboto licensed under [Apache license](http://www.apache.org/licenses/LICENSE-2.0)
|
||||
- Entypo licensed under CC BY-SA 4.0.
|
||||
- Noto Emoji licensed under [SIL Open Font License, Version 1.1](http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=OFL)
|
||||
|
||||
## Discussions
|
||||
[NanoVG mailing list](https://groups.google.com/forum/#!forum/nanovg)
|
||||
|
||||
## Links
|
||||
Uses [stb_truetype](http://nothings.org) (or, optionally, [freetype](http://freetype.org)) for font rendering.
|
||||
Uses [stb_image](http://nothings.org) for image loading.
|
@ -1,92 +0,0 @@
|
||||
This Font Software is licensed under the SIL Open Font License,
|
||||
Version 1.1.
|
||||
|
||||
This license is copied below, and is also available with a FAQ at:
|
||||
http://scripts.sil.org/OFL
|
||||
|
||||
-----------------------------------------------------------
|
||||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||
-----------------------------------------------------------
|
||||
|
||||
PREAMBLE
|
||||
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||
development of collaborative font projects, to support the font
|
||||
creation efforts of academic and linguistic communities, and to
|
||||
provide a free and open framework in which fonts may be shared and
|
||||
improved in partnership with others.
|
||||
|
||||
The OFL allows the licensed fonts to be used, studied, modified and
|
||||
redistributed freely as long as they are not sold by themselves. The
|
||||
fonts, including any derivative works, can be bundled, embedded,
|
||||
redistributed and/or sold with any software provided that any reserved
|
||||
names are not used by derivative works. The fonts and derivatives,
|
||||
however, cannot be released under any other type of license. The
|
||||
requirement for fonts to remain under this license does not apply to
|
||||
any document created using the fonts or their derivatives.
|
||||
|
||||
DEFINITIONS
|
||||
"Font Software" refers to the set of files released by the Copyright
|
||||
Holder(s) under this license and clearly marked as such. This may
|
||||
include source files, build scripts and documentation.
|
||||
|
||||
"Reserved Font Name" refers to any names specified as such after the
|
||||
copyright statement(s).
|
||||
|
||||
"Original Version" refers to the collection of Font Software
|
||||
components as distributed by the Copyright Holder(s).
|
||||
|
||||
"Modified Version" refers to any derivative made by adding to,
|
||||
deleting, or substituting -- in part or in whole -- any of the
|
||||
components of the Original Version, by changing formats or by porting
|
||||
the Font Software to a new environment.
|
||||
|
||||
"Author" refers to any designer, engineer, programmer, technical
|
||||
writer or other person who contributed to the Font Software.
|
||||
|
||||
PERMISSION & CONDITIONS
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of the Font Software, to use, study, copy, merge, embed,
|
||||
modify, redistribute, and sell modified and unmodified copies of the
|
||||
Font Software, subject to the following conditions:
|
||||
|
||||
1) Neither the Font Software nor any of its individual components, in
|
||||
Original or Modified Versions, may be sold by itself.
|
||||
|
||||
2) Original or Modified Versions of the Font Software may be bundled,
|
||||
redistributed and/or sold with any software, provided that each copy
|
||||
contains the above copyright notice and this license. These can be
|
||||
included either as stand-alone text files, human-readable headers or
|
||||
in the appropriate machine-readable metadata fields within text or
|
||||
binary files as long as those fields can be easily viewed by the user.
|
||||
|
||||
3) No Modified Version of the Font Software may use the Reserved Font
|
||||
Name(s) unless explicit written permission is granted by the
|
||||
corresponding Copyright Holder. This restriction only applies to the
|
||||
primary font name as presented to the users.
|
||||
|
||||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||
Software shall not be used to promote, endorse or advertise any
|
||||
Modified Version, except to acknowledge the contribution(s) of the
|
||||
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||
permission.
|
||||
|
||||
5) The Font Software, modified or unmodified, in part or in whole,
|
||||
must be distributed entirely under this license, and must not be
|
||||
distributed under any other license. The requirement for fonts to
|
||||
remain under this license does not apply to any document created using
|
||||
the Font Software.
|
||||
|
||||
TERMINATION
|
||||
This license becomes null and void if any of the above conditions are
|
||||
not met.
|
||||
|
||||
DISCLAIMER
|
||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||
OTHER DEALINGS IN THE FONT SOFTWARE.
|
1228
example/demo.c
@ -1,26 +0,0 @@
|
||||
#ifndef DEMO_H
|
||||
#define DEMO_H
|
||||
|
||||
#include "nanovg.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct DemoData {
|
||||
int fontNormal, fontBold, fontIcons, fontEmoji;
|
||||
int images[12];
|
||||
};
|
||||
typedef struct DemoData DemoData;
|
||||
|
||||
int loadDemoData(NVGcontext* vg, DemoData* data);
|
||||
void freeDemoData(NVGcontext* vg, DemoData* data);
|
||||
void renderDemo(NVGcontext* vg, float mx, float my, float width, float height, float t, int blowup, DemoData* data);
|
||||
|
||||
void saveScreenShot(int w, int h, int premult, const char* name);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // DEMO_H
|
@ -1,272 +0,0 @@
|
||||
//
|
||||
// Copyright (c) 2013 Mikko Mononen memon@inside.org
|
||||
//
|
||||
// This software is provided 'as-is', without any express or implied
|
||||
// warranty. In no event will the authors be held liable for any damages
|
||||
// arising from the use of this software.
|
||||
// Permission is granted to anyone to use this software for any purpose,
|
||||
// including commercial applications, and to alter it and redistribute it
|
||||
// freely, subject to the following restrictions:
|
||||
// 1. The origin of this software must not be misrepresented; you must not
|
||||
// claim that you wrote the original software. If you use this software
|
||||
// in a product, an acknowledgment in the product documentation would be
|
||||
// appreciated but is not required.
|
||||
// 2. Altered source versions must be plainly marked as such, and must not be
|
||||
// misrepresented as being the original software.
|
||||
// 3. This notice may not be removed or altered from any source distribution.
|
||||
//
|
||||
|
||||
#include <stdio.h>
|
||||
#ifdef NANOVG_GLEW
|
||||
# include <GL/glew.h>
|
||||
#endif
|
||||
#ifdef __APPLE__
|
||||
# define GLFW_INCLUDE_GLCOREARB
|
||||
#endif
|
||||
#include <GLFW/glfw3.h>
|
||||
#include "nanovg.h"
|
||||
#define NANOVG_GL3_IMPLEMENTATION
|
||||
#include "nanovg_gl.h"
|
||||
#include "nanovg_gl_utils.h"
|
||||
#include "perf.h"
|
||||
|
||||
void renderPattern(NVGcontext* vg, NVGLUframebuffer* fb, float t, float pxRatio)
|
||||
{
|
||||
int winWidth, winHeight;
|
||||
int fboWidth, fboHeight;
|
||||
int pw, ph, x, y;
|
||||
float s = 20.0f;
|
||||
float sr = (cosf(t)+1)*0.5f;
|
||||
float r = s * 0.6f * (0.2f + 0.8f * sr);
|
||||
|
||||
if (fb == NULL) return;
|
||||
|
||||
nvgImageSize(vg, fb->image, &fboWidth, &fboHeight);
|
||||
winWidth = (int)(fboWidth / pxRatio);
|
||||
winHeight = (int)(fboHeight / pxRatio);
|
||||
|
||||
// Draw some stuff to an FBO as a test
|
||||
nvgluBindFramebuffer(fb);
|
||||
glViewport(0, 0, fboWidth, fboHeight);
|
||||
glClearColor(0, 0, 0, 0);
|
||||
glClear(GL_COLOR_BUFFER_BIT|GL_STENCIL_BUFFER_BIT);
|
||||
nvgBeginFrame(vg, winWidth, winHeight, pxRatio);
|
||||
|
||||
pw = (int)ceilf(winWidth / s);
|
||||
ph = (int)ceilf(winHeight / s);
|
||||
|
||||
nvgBeginPath(vg);
|
||||
for (y = 0; y < ph; y++) {
|
||||
for (x = 0; x < pw; x++) {
|
||||
float cx = (x+0.5f) * s;
|
||||
float cy = (y+0.5f) * s;
|
||||
nvgCircle(vg, cx,cy, r);
|
||||
}
|
||||
}
|
||||
nvgFillColor(vg, nvgRGBA(220,160,0,200));
|
||||
nvgFill(vg);
|
||||
|
||||
nvgEndFrame(vg);
|
||||
nvgluBindFramebuffer(NULL);
|
||||
}
|
||||
|
||||
int loadFonts(NVGcontext* vg)
|
||||
{
|
||||
int font;
|
||||
font = nvgCreateFont(vg, "sans", "../example/Roboto-Regular.ttf");
|
||||
if (font == -1) {
|
||||
printf("Could not add font regular.\n");
|
||||
return -1;
|
||||
}
|
||||
font = nvgCreateFont(vg, "sans-bold", "../example/Roboto-Bold.ttf");
|
||||
if (font == -1) {
|
||||
printf("Could not add font bold.\n");
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void errorcb(int error, const char* desc)
|
||||
{
|
||||
printf("GLFW error %d: %s\n", error, desc);
|
||||
}
|
||||
|
||||
static void key(GLFWwindow* window, int key, int scancode, int action, int mods)
|
||||
{
|
||||
NVG_NOTUSED(scancode);
|
||||
NVG_NOTUSED(mods);
|
||||
if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS)
|
||||
glfwSetWindowShouldClose(window, GL_TRUE);
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
GLFWwindow* window;
|
||||
NVGcontext* vg = NULL;
|
||||
GPUtimer gpuTimer;
|
||||
PerfGraph fps, cpuGraph, gpuGraph;
|
||||
double prevt = 0, cpuTime = 0;
|
||||
NVGLUframebuffer* fb = NULL;
|
||||
int winWidth, winHeight;
|
||||
int fbWidth, fbHeight;
|
||||
float pxRatio;
|
||||
|
||||
if (!glfwInit()) {
|
||||
printf("Failed to init GLFW.");
|
||||
return -1;
|
||||
}
|
||||
|
||||
initGraph(&fps, GRAPH_RENDER_FPS, "Frame Time");
|
||||
initGraph(&cpuGraph, GRAPH_RENDER_MS, "CPU Time");
|
||||
initGraph(&gpuGraph, GRAPH_RENDER_MS, "GPU Time");
|
||||
|
||||
glfwSetErrorCallback(errorcb);
|
||||
#ifndef _WIN32 // don't require this on win32, and works with more cards
|
||||
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
|
||||
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
|
||||
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
|
||||
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
|
||||
#endif
|
||||
glfwWindowHint(GLFW_OPENGL_DEBUG_CONTEXT, 1);
|
||||
|
||||
#ifdef DEMO_MSAA
|
||||
glfwWindowHint(GLFW_SAMPLES, 4);
|
||||
#endif
|
||||
window = glfwCreateWindow(1000, 600, "NanoVG", NULL, NULL);
|
||||
// window = glfwCreateWindow(1000, 600, "NanoVG", glfwGetPrimaryMonitor(), NULL);
|
||||
if (!window) {
|
||||
glfwTerminate();
|
||||
return -1;
|
||||
}
|
||||
|
||||
glfwSetKeyCallback(window, key);
|
||||
|
||||
glfwMakeContextCurrent(window);
|
||||
#ifdef NANOVG_GLEW
|
||||
glewExperimental = GL_TRUE;
|
||||
if(glewInit() != GLEW_OK) {
|
||||
printf("Could not init glew.\n");
|
||||
return -1;
|
||||
}
|
||||
// GLEW generates GL error because it calls glGetString(GL_EXTENSIONS), we'll consume it here.
|
||||
glGetError();
|
||||
#endif
|
||||
|
||||
#ifdef DEMO_MSAA
|
||||
vg = nvgCreateGL3(NVG_STENCIL_STROKES | NVG_DEBUG);
|
||||
#else
|
||||
vg = nvgCreateGL3(NVG_ANTIALIAS | NVG_STENCIL_STROKES | NVG_DEBUG);
|
||||
#endif
|
||||
if (vg == NULL) {
|
||||
printf("Could not init nanovg.\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Create hi-dpi FBO for hi-dpi screens.
|
||||
glfwGetWindowSize(window, &winWidth, &winHeight);
|
||||
glfwGetFramebufferSize(window, &fbWidth, &fbHeight);
|
||||
// Calculate pixel ration for hi-dpi devices.
|
||||
pxRatio = (float)fbWidth / (float)winWidth;
|
||||
|
||||
// The image pattern is tiled, set repeat on x and y.
|
||||
fb = nvgluCreateFramebuffer(vg, (int)(100*pxRatio), (int)(100*pxRatio), NVG_IMAGE_REPEATX | NVG_IMAGE_REPEATY);
|
||||
if (fb == NULL) {
|
||||
printf("Could not create FBO.\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (loadFonts(vg) == -1) {
|
||||
printf("Could not load fonts\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
glfwSwapInterval(0);
|
||||
|
||||
initGPUTimer(&gpuTimer);
|
||||
|
||||
glfwSetTime(0);
|
||||
prevt = glfwGetTime();
|
||||
|
||||
while (!glfwWindowShouldClose(window))
|
||||
{
|
||||
double mx, my, t, dt;
|
||||
float gpuTimes[3];
|
||||
int i, n;
|
||||
|
||||
t = glfwGetTime();
|
||||
dt = t - prevt;
|
||||
prevt = t;
|
||||
|
||||
startGPUTimer(&gpuTimer);
|
||||
|
||||
glfwGetCursorPos(window, &mx, &my);
|
||||
glfwGetWindowSize(window, &winWidth, &winHeight);
|
||||
glfwGetFramebufferSize(window, &fbWidth, &fbHeight);
|
||||
// Calculate pixel ration for hi-dpi devices.
|
||||
pxRatio = (float)fbWidth / (float)winWidth;
|
||||
|
||||
renderPattern(vg, fb, t, pxRatio);
|
||||
|
||||
// Update and render
|
||||
glViewport(0, 0, fbWidth, fbHeight);
|
||||
glClearColor(0.3f, 0.3f, 0.32f, 1.0f);
|
||||
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT);
|
||||
|
||||
nvgBeginFrame(vg, winWidth, winHeight, pxRatio);
|
||||
|
||||
// Use the FBO as image pattern.
|
||||
if (fb != NULL) {
|
||||
NVGpaint img = nvgImagePattern(vg, 0, 0, 100, 100, 0, fb->image, 1.0f);
|
||||
nvgSave(vg);
|
||||
|
||||
for (i = 0; i < 20; i++) {
|
||||
nvgBeginPath(vg);
|
||||
nvgRect(vg, 10 + i*30,10, 10, winHeight-20);
|
||||
nvgFillColor(vg, nvgHSLA(i/19.0f, 0.5f, 0.5f, 255));
|
||||
nvgFill(vg);
|
||||
}
|
||||
|
||||
nvgBeginPath(vg);
|
||||
nvgRoundedRect(vg, 140 + sinf(t*1.3f)*100, 140 + cosf(t*1.71244f)*100, 250, 250, 20);
|
||||
nvgFillPaint(vg, img);
|
||||
nvgFill(vg);
|
||||
nvgStrokeColor(vg, nvgRGBA(220,160,0,255));
|
||||
nvgStrokeWidth(vg, 3.0f);
|
||||
nvgStroke(vg);
|
||||
|
||||
nvgRestore(vg);
|
||||
}
|
||||
|
||||
renderGraph(vg, 5,5, &fps);
|
||||
renderGraph(vg, 5+200+5,5, &cpuGraph);
|
||||
if (gpuTimer.supported)
|
||||
renderGraph(vg, 5+200+5+200+5,5, &gpuGraph);
|
||||
|
||||
nvgEndFrame(vg);
|
||||
|
||||
// Measure the CPU time taken excluding swap buffers (as the swap may wait for GPU)
|
||||
cpuTime = glfwGetTime() - t;
|
||||
|
||||
updateGraph(&fps, dt);
|
||||
updateGraph(&cpuGraph, cpuTime);
|
||||
|
||||
// We may get multiple results.
|
||||
n = stopGPUTimer(&gpuTimer, gpuTimes, 3);
|
||||
for (i = 0; i < n; i++)
|
||||
updateGraph(&gpuGraph, gpuTimes[i]);
|
||||
|
||||
glfwSwapBuffers(window);
|
||||
glfwPollEvents();
|
||||
}
|
||||
|
||||
nvgluDeleteFramebuffer(fb);
|
||||
|
||||
nvgDeleteGL3(vg);
|
||||
|
||||
printf("Average Frame Time: %.2f ms\n", getGraphAverage(&fps) * 1000.0f);
|
||||
printf(" CPU Time: %.2f ms\n", getGraphAverage(&cpuGraph) * 1000.0f);
|
||||
printf(" GPU Time: %.2f ms\n", getGraphAverage(&gpuGraph) * 1000.0f);
|
||||
|
||||
glfwTerminate();
|
||||
return 0;
|
||||
}
|
@ -1,162 +0,0 @@
|
||||
//
|
||||
// Copyright (c) 2013 Mikko Mononen memon@inside.org
|
||||
//
|
||||
// This software is provided 'as-is', without any express or implied
|
||||
// warranty. In no event will the authors be held liable for any damages
|
||||
// arising from the use of this software.
|
||||
// Permission is granted to anyone to use this software for any purpose,
|
||||
// including commercial applications, and to alter it and redistribute it
|
||||
// freely, subject to the following restrictions:
|
||||
// 1. The origin of this software must not be misrepresented; you must not
|
||||
// claim that you wrote the original software. If you use this software
|
||||
// in a product, an acknowledgment in the product documentation would be
|
||||
// appreciated but is not required.
|
||||
// 2. Altered source versions must be plainly marked as such, and must not be
|
||||
// misrepresented as being the original software.
|
||||
// 3. This notice may not be removed or altered from any source distribution.
|
||||
//
|
||||
|
||||
#include <stdio.h>
|
||||
#ifdef NANOVG_GLEW
|
||||
# include <GL/glew.h>
|
||||
#endif
|
||||
#define GLFW_INCLUDE_GLEXT
|
||||
#include <GLFW/glfw3.h>
|
||||
#include "nanovg.h"
|
||||
#define NANOVG_GL2_IMPLEMENTATION
|
||||
#include "nanovg_gl.h"
|
||||
#include "demo.h"
|
||||
#include "perf.h"
|
||||
|
||||
|
||||
void errorcb(int error, const char* desc)
|
||||
{
|
||||
printf("GLFW error %d: %s\n", error, desc);
|
||||
}
|
||||
|
||||
int blowup = 0;
|
||||
int screenshot = 0;
|
||||
int premult = 0;
|
||||
|
||||
static void key(GLFWwindow* window, int key, int scancode, int action, int mods)
|
||||
{
|
||||
NVG_NOTUSED(scancode);
|
||||
NVG_NOTUSED(mods);
|
||||
if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS)
|
||||
glfwSetWindowShouldClose(window, GL_TRUE);
|
||||
if (key == GLFW_KEY_SPACE && action == GLFW_PRESS)
|
||||
blowup = !blowup;
|
||||
if (key == GLFW_KEY_S && action == GLFW_PRESS)
|
||||
screenshot = 1;
|
||||
if (key == GLFW_KEY_P && action == GLFW_PRESS)
|
||||
premult = !premult;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
GLFWwindow* window;
|
||||
DemoData data;
|
||||
NVGcontext* vg = NULL;
|
||||
PerfGraph fps;
|
||||
double prevt = 0;
|
||||
|
||||
if (!glfwInit()) {
|
||||
printf("Failed to init GLFW.");
|
||||
return -1;
|
||||
}
|
||||
|
||||
initGraph(&fps, GRAPH_RENDER_FPS, "Frame Time");
|
||||
|
||||
glfwSetErrorCallback(errorcb);
|
||||
|
||||
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 2);
|
||||
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0);
|
||||
#ifdef DEMO_MSAA
|
||||
glfwWindowHint(GLFW_SAMPLES, 4);
|
||||
#endif
|
||||
|
||||
window = glfwCreateWindow(1000, 600, "NanoVG", NULL, NULL);
|
||||
// window = glfwCreateWindow(1000, 600, "NanoVG", glfwGetPrimaryMonitor(), NULL);
|
||||
if (!window) {
|
||||
glfwTerminate();
|
||||
return -1;
|
||||
}
|
||||
|
||||
glfwSetKeyCallback(window, key);
|
||||
|
||||
glfwMakeContextCurrent(window);
|
||||
#ifdef NANOVG_GLEW
|
||||
if(glewInit() != GLEW_OK) {
|
||||
printf("Could not init glew.\n");
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef DEMO_MSAA
|
||||
vg = nvgCreateGL2(NVG_STENCIL_STROKES | NVG_DEBUG);
|
||||
#else
|
||||
vg = nvgCreateGL2(NVG_ANTIALIAS | NVG_STENCIL_STROKES | NVG_DEBUG);
|
||||
#endif
|
||||
if (vg == NULL) {
|
||||
printf("Could not init nanovg.\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (loadDemoData(vg, &data) == -1)
|
||||
return -1;
|
||||
|
||||
glfwSwapInterval(0);
|
||||
|
||||
glfwSetTime(0);
|
||||
prevt = glfwGetTime();
|
||||
|
||||
while (!glfwWindowShouldClose(window))
|
||||
{
|
||||
double mx, my, t, dt;
|
||||
int winWidth, winHeight;
|
||||
int fbWidth, fbHeight;
|
||||
float pxRatio;
|
||||
|
||||
t = glfwGetTime();
|
||||
dt = t - prevt;
|
||||
prevt = t;
|
||||
updateGraph(&fps, dt);
|
||||
|
||||
glfwGetCursorPos(window, &mx, &my);
|
||||
glfwGetWindowSize(window, &winWidth, &winHeight);
|
||||
glfwGetFramebufferSize(window, &fbWidth, &fbHeight);
|
||||
|
||||
// Calculate pixel ration for hi-dpi devices.
|
||||
pxRatio = (float)fbWidth / (float)winWidth;
|
||||
|
||||
// Update and render
|
||||
glViewport(0, 0, fbWidth, fbHeight);
|
||||
if (premult)
|
||||
glClearColor(0,0,0,0);
|
||||
else
|
||||
glClearColor(0.3f, 0.3f, 0.32f, 1.0f);
|
||||
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT);
|
||||
|
||||
nvgBeginFrame(vg, winWidth, winHeight, pxRatio);
|
||||
|
||||
renderDemo(vg, mx,my, winWidth,winHeight, t, blowup, &data);
|
||||
renderGraph(vg, 5,5, &fps);
|
||||
|
||||
nvgEndFrame(vg);
|
||||
|
||||
if (screenshot) {
|
||||
screenshot = 0;
|
||||
saveScreenShot(fbWidth, fbHeight, premult, "dump.png");
|
||||
}
|
||||
|
||||
glfwSwapBuffers(window);
|
||||
glfwPollEvents();
|
||||
}
|
||||
|
||||
freeDemoData(vg, &data);
|
||||
|
||||
nvgDeleteGL2(vg);
|
||||
|
||||
glfwTerminate();
|
||||
return 0;
|
||||
}
|
@ -1,198 +0,0 @@
|
||||
//
|
||||
// Copyright (c) 2013 Mikko Mononen memon@inside.org
|
||||
//
|
||||
// This software is provided 'as-is', without any express or implied
|
||||
// warranty. In no event will the authors be held liable for any damages
|
||||
// arising from the use of this software.
|
||||
// Permission is granted to anyone to use this software for any purpose,
|
||||
// including commercial applications, and to alter it and redistribute it
|
||||
// freely, subject to the following restrictions:
|
||||
// 1. The origin of this software must not be misrepresented; you must not
|
||||
// claim that you wrote the original software. If you use this software
|
||||
// in a product, an acknowledgment in the product documentation would be
|
||||
// appreciated but is not required.
|
||||
// 2. Altered source versions must be plainly marked as such, and must not be
|
||||
// misrepresented as being the original software.
|
||||
// 3. This notice may not be removed or altered from any source distribution.
|
||||
//
|
||||
|
||||
#include <stdio.h>
|
||||
#ifdef NANOVG_GLEW
|
||||
# include <GL/glew.h>
|
||||
#endif
|
||||
#ifdef __APPLE__
|
||||
# define GLFW_INCLUDE_GLCOREARB
|
||||
#endif
|
||||
#define GLFW_INCLUDE_GLEXT
|
||||
#include <GLFW/glfw3.h>
|
||||
#include "nanovg.h"
|
||||
#define NANOVG_GL3_IMPLEMENTATION
|
||||
#include "nanovg_gl.h"
|
||||
#include "demo.h"
|
||||
#include "perf.h"
|
||||
|
||||
|
||||
void errorcb(int error, const char* desc)
|
||||
{
|
||||
printf("GLFW error %d: %s\n", error, desc);
|
||||
}
|
||||
|
||||
int blowup = 0;
|
||||
int screenshot = 0;
|
||||
int premult = 0;
|
||||
|
||||
static void key(GLFWwindow* window, int key, int scancode, int action, int mods)
|
||||
{
|
||||
NVG_NOTUSED(scancode);
|
||||
NVG_NOTUSED(mods);
|
||||
if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS)
|
||||
glfwSetWindowShouldClose(window, GL_TRUE);
|
||||
if (key == GLFW_KEY_SPACE && action == GLFW_PRESS)
|
||||
blowup = !blowup;
|
||||
if (key == GLFW_KEY_S && action == GLFW_PRESS)
|
||||
screenshot = 1;
|
||||
if (key == GLFW_KEY_P && action == GLFW_PRESS)
|
||||
premult = !premult;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
GLFWwindow* window;
|
||||
DemoData data;
|
||||
NVGcontext* vg = NULL;
|
||||
GPUtimer gpuTimer;
|
||||
PerfGraph fps, cpuGraph, gpuGraph;
|
||||
double prevt = 0, cpuTime = 0;
|
||||
|
||||
if (!glfwInit()) {
|
||||
printf("Failed to init GLFW.");
|
||||
return -1;
|
||||
}
|
||||
|
||||
initGraph(&fps, GRAPH_RENDER_FPS, "Frame Time");
|
||||
initGraph(&cpuGraph, GRAPH_RENDER_MS, "CPU Time");
|
||||
initGraph(&gpuGraph, GRAPH_RENDER_MS, "GPU Time");
|
||||
|
||||
glfwSetErrorCallback(errorcb);
|
||||
#ifndef _WIN32 // don't require this on win32, and works with more cards
|
||||
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
|
||||
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
|
||||
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
|
||||
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
|
||||
#endif
|
||||
glfwWindowHint(GLFW_OPENGL_DEBUG_CONTEXT, 1);
|
||||
|
||||
#ifdef DEMO_MSAA
|
||||
glfwWindowHint(GLFW_SAMPLES, 4);
|
||||
#endif
|
||||
window = glfwCreateWindow(1000, 600, "NanoVG", NULL, NULL);
|
||||
// window = glfwCreateWindow(1000, 600, "NanoVG", glfwGetPrimaryMonitor(), NULL);
|
||||
if (!window) {
|
||||
glfwTerminate();
|
||||
return -1;
|
||||
}
|
||||
|
||||
glfwSetKeyCallback(window, key);
|
||||
|
||||
glfwMakeContextCurrent(window);
|
||||
#ifdef NANOVG_GLEW
|
||||
glewExperimental = GL_TRUE;
|
||||
if(glewInit() != GLEW_OK) {
|
||||
printf("Could not init glew.\n");
|
||||
return -1;
|
||||
}
|
||||
// GLEW generates GL error because it calls glGetString(GL_EXTENSIONS), we'll consume it here.
|
||||
glGetError();
|
||||
#endif
|
||||
|
||||
#ifdef DEMO_MSAA
|
||||
vg = nvgCreateGL3(NVG_STENCIL_STROKES | NVG_DEBUG);
|
||||
#else
|
||||
vg = nvgCreateGL3(NVG_ANTIALIAS | NVG_STENCIL_STROKES | NVG_DEBUG);
|
||||
#endif
|
||||
if (vg == NULL) {
|
||||
printf("Could not init nanovg.\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (loadDemoData(vg, &data) == -1)
|
||||
return -1;
|
||||
|
||||
glfwSwapInterval(0);
|
||||
|
||||
initGPUTimer(&gpuTimer);
|
||||
|
||||
glfwSetTime(0);
|
||||
prevt = glfwGetTime();
|
||||
|
||||
while (!glfwWindowShouldClose(window))
|
||||
{
|
||||
double mx, my, t, dt;
|
||||
int winWidth, winHeight;
|
||||
int fbWidth, fbHeight;
|
||||
float pxRatio;
|
||||
float gpuTimes[3];
|
||||
int i, n;
|
||||
|
||||
t = glfwGetTime();
|
||||
dt = t - prevt;
|
||||
prevt = t;
|
||||
|
||||
startGPUTimer(&gpuTimer);
|
||||
|
||||
glfwGetCursorPos(window, &mx, &my);
|
||||
glfwGetWindowSize(window, &winWidth, &winHeight);
|
||||
glfwGetFramebufferSize(window, &fbWidth, &fbHeight);
|
||||
// Calculate pixel ration for hi-dpi devices.
|
||||
pxRatio = (float)fbWidth / (float)winWidth;
|
||||
|
||||
// Update and render
|
||||
glViewport(0, 0, fbWidth, fbHeight);
|
||||
if (premult)
|
||||
glClearColor(0,0,0,0);
|
||||
else
|
||||
glClearColor(0.3f, 0.3f, 0.32f, 1.0f);
|
||||
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT);
|
||||
|
||||
nvgBeginFrame(vg, winWidth, winHeight, pxRatio);
|
||||
|
||||
renderDemo(vg, mx,my, winWidth,winHeight, t, blowup, &data);
|
||||
|
||||
renderGraph(vg, 5,5, &fps);
|
||||
renderGraph(vg, 5+200+5,5, &cpuGraph);
|
||||
if (gpuTimer.supported)
|
||||
renderGraph(vg, 5+200+5+200+5,5, &gpuGraph);
|
||||
|
||||
nvgEndFrame(vg);
|
||||
|
||||
// Measure the CPU time taken excluding swap buffers (as the swap may wait for GPU)
|
||||
cpuTime = glfwGetTime() - t;
|
||||
|
||||
updateGraph(&fps, dt);
|
||||
updateGraph(&cpuGraph, cpuTime);
|
||||
|
||||
// We may get multiple results.
|
||||
n = stopGPUTimer(&gpuTimer, gpuTimes, 3);
|
||||
for (i = 0; i < n; i++)
|
||||
updateGraph(&gpuGraph, gpuTimes[i]);
|
||||
|
||||
if (screenshot) {
|
||||
screenshot = 0;
|
||||
saveScreenShot(fbWidth, fbHeight, premult, "dump.png");
|
||||
}
|
||||
|
||||
glfwSwapBuffers(window);
|
||||
glfwPollEvents();
|
||||
}
|
||||
|
||||
freeDemoData(vg, &data);
|
||||
|
||||
nvgDeleteGL3(vg);
|
||||
|
||||
printf("Average Frame Time: %.2f ms\n", getGraphAverage(&fps) * 1000.0f);
|
||||
printf(" CPU Time: %.2f ms\n", getGraphAverage(&cpuGraph) * 1000.0f);
|
||||
printf(" GPU Time: %.2f ms\n", getGraphAverage(&gpuGraph) * 1000.0f);
|
||||
|
||||
glfwTerminate();
|
||||
return 0;
|
||||
}
|
@ -1,155 +0,0 @@
|
||||
//
|
||||
// Copyright (c) 2013 Mikko Mononen memon@inside.org
|
||||
//
|
||||
// This software is provided 'as-is', without any express or implied
|
||||
// warranty. In no event will the authors be held liable for any damages
|
||||
// arising from the use of this software.
|
||||
// Permission is granted to anyone to use this software for any purpose,
|
||||
// including commercial applications, and to alter it and redistribute it
|
||||
// freely, subject to the following restrictions:
|
||||
// 1. The origin of this software must not be misrepresented; you must not
|
||||
// claim that you wrote the original software. If you use this software
|
||||
// in a product, an acknowledgment in the product documentation would be
|
||||
// appreciated but is not required.
|
||||
// 2. Altered source versions must be plainly marked as such, and must not be
|
||||
// misrepresented as being the original software.
|
||||
// 3. This notice may not be removed or altered from any source distribution.
|
||||
//
|
||||
|
||||
#include <stdio.h>
|
||||
#define GLFW_INCLUDE_ES2
|
||||
#define GLFW_INCLUDE_GLEXT
|
||||
#include <GLFW/glfw3.h>
|
||||
#include "nanovg.h"
|
||||
#define NANOVG_GLES2_IMPLEMENTATION
|
||||
#include "nanovg_gl.h"
|
||||
#include "nanovg_gl_utils.h"
|
||||
#include "demo.h"
|
||||
#include "perf.h"
|
||||
|
||||
|
||||
void errorcb(int error, const char* desc)
|
||||
{
|
||||
printf("GLFW error %d: %s\n", error, desc);
|
||||
}
|
||||
|
||||
int blowup = 0;
|
||||
int screenshot = 0;
|
||||
int premult = 0;
|
||||
|
||||
static void key(GLFWwindow* window, int key, int scancode, int action, int mods)
|
||||
{
|
||||
NVG_NOTUSED(scancode);
|
||||
NVG_NOTUSED(mods);
|
||||
if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS)
|
||||
glfwSetWindowShouldClose(window, GL_TRUE);
|
||||
if (key == GLFW_KEY_SPACE && action == GLFW_PRESS)
|
||||
blowup = !blowup;
|
||||
if (key == GLFW_KEY_S && action == GLFW_PRESS)
|
||||
screenshot = 1;
|
||||
if (key == GLFW_KEY_P && action == GLFW_PRESS)
|
||||
premult = !premult;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
GLFWwindow* window;
|
||||
DemoData data;
|
||||
NVGcontext* vg = NULL;
|
||||
PerfGraph fps;
|
||||
double prevt = 0;
|
||||
|
||||
if (!glfwInit()) {
|
||||
printf("Failed to init GLFW.");
|
||||
return -1;
|
||||
}
|
||||
|
||||
initGraph(&fps, GRAPH_RENDER_FPS, "Frame Time");
|
||||
|
||||
glfwSetErrorCallback(errorcb);
|
||||
|
||||
glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_ES_API);
|
||||
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 2);
|
||||
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0);
|
||||
|
||||
window = glfwCreateWindow(1000, 600, "NanoVG", NULL, NULL);
|
||||
// window = glfwCreateWindow(1000, 600, "NanoVG", glfwGetPrimaryMonitor(), NULL);
|
||||
if (!window) {
|
||||
glfwTerminate();
|
||||
return -1;
|
||||
}
|
||||
|
||||
glfwSetKeyCallback(window, key);
|
||||
|
||||
glfwMakeContextCurrent(window);
|
||||
|
||||
vg = nvgCreateGLES2(NVG_ANTIALIAS | NVG_STENCIL_STROKES | NVG_DEBUG);
|
||||
if (vg == NULL) {
|
||||
printf("Could not init nanovg.\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (loadDemoData(vg, &data) == -1)
|
||||
return -1;
|
||||
|
||||
glfwSwapInterval(0);
|
||||
|
||||
glfwSetTime(0);
|
||||
prevt = glfwGetTime();
|
||||
|
||||
while (!glfwWindowShouldClose(window))
|
||||
{
|
||||
double mx, my, t, dt;
|
||||
int winWidth, winHeight;
|
||||
int fbWidth, fbHeight;
|
||||
float pxRatio;
|
||||
|
||||
t = glfwGetTime();
|
||||
dt = t - prevt;
|
||||
prevt = t;
|
||||
updateGraph(&fps, dt);
|
||||
|
||||
glfwGetCursorPos(window, &mx, &my);
|
||||
glfwGetWindowSize(window, &winWidth, &winHeight);
|
||||
glfwGetFramebufferSize(window, &fbWidth, &fbHeight);
|
||||
// Calculate pixel ration for hi-dpi devices.
|
||||
pxRatio = (float)fbWidth / (float)winWidth;
|
||||
|
||||
// Update and render
|
||||
glViewport(0, 0, fbWidth, fbHeight);
|
||||
if (premult)
|
||||
glClearColor(0,0,0,0);
|
||||
else
|
||||
glClearColor(0.3f, 0.3f, 0.32f, 1.0f);
|
||||
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT);
|
||||
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glEnable(GL_CULL_FACE);
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
|
||||
nvgBeginFrame(vg, winWidth, winHeight, pxRatio);
|
||||
|
||||
renderDemo(vg, mx,my, winWidth,winHeight, t, blowup, &data);
|
||||
renderGraph(vg, 5,5, &fps);
|
||||
|
||||
nvgEndFrame(vg);
|
||||
|
||||
if (screenshot) {
|
||||
screenshot = 0;
|
||||
saveScreenShot(fbWidth, fbHeight, premult, "dump.png");
|
||||
}
|
||||
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
|
||||
glfwSwapBuffers(window);
|
||||
glfwPollEvents();
|
||||
}
|
||||
|
||||
freeDemoData(vg, &data);
|
||||
|
||||
nvgDeleteGLES2(vg);
|
||||
|
||||
glfwTerminate();
|
||||
return 0;
|
||||
}
|
@ -1,155 +0,0 @@
|
||||
//
|
||||
// Copyright (c) 2013 Mikko Mononen memon@inside.org
|
||||
//
|
||||
// This software is provided 'as-is', without any express or implied
|
||||
// warranty. In no event will the authors be held liable for any damages
|
||||
// arising from the use of this software.
|
||||
// Permission is granted to anyone to use this software for any purpose,
|
||||
// including commercial applications, and to alter it and redistribute it
|
||||
// freely, subject to the following restrictions:
|
||||
// 1. The origin of this software must not be misrepresented; you must not
|
||||
// claim that you wrote the original software. If you use this software
|
||||
// in a product, an acknowledgment in the product documentation would be
|
||||
// appreciated but is not required.
|
||||
// 2. Altered source versions must be plainly marked as such, and must not be
|
||||
// misrepresented as being the original software.
|
||||
// 3. This notice may not be removed or altered from any source distribution.
|
||||
//
|
||||
|
||||
#include <stdio.h>
|
||||
#define GLFW_INCLUDE_ES3
|
||||
#define GLFW_INCLUDE_GLEXT
|
||||
#include <GLFW/glfw3.h>
|
||||
#include "nanovg.h"
|
||||
#define NANOVG_GLES3_IMPLEMENTATION
|
||||
#include "nanovg_gl.h"
|
||||
#include "nanovg_gl_utils.h"
|
||||
#include "demo.h"
|
||||
#include "perf.h"
|
||||
|
||||
|
||||
void errorcb(int error, const char* desc)
|
||||
{
|
||||
printf("GLFW error %d: %s\n", error, desc);
|
||||
}
|
||||
|
||||
int blowup = 0;
|
||||
int screenshot = 0;
|
||||
int premult = 0;
|
||||
|
||||
static void key(GLFWwindow* window, int key, int scancode, int action, int mods)
|
||||
{
|
||||
NVG_NOTUSED(scancode);
|
||||
NVG_NOTUSED(mods);
|
||||
if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS)
|
||||
glfwSetWindowShouldClose(window, GL_TRUE);
|
||||
if (key == GLFW_KEY_SPACE && action == GLFW_PRESS)
|
||||
blowup = !blowup;
|
||||
if (key == GLFW_KEY_S && action == GLFW_PRESS)
|
||||
screenshot = 1;
|
||||
if (key == GLFW_KEY_P && action == GLFW_PRESS)
|
||||
premult = !premult;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
GLFWwindow* window;
|
||||
DemoData data;
|
||||
NVGcontext* vg = NULL;
|
||||
PerfGraph fps;
|
||||
double prevt = 0;
|
||||
|
||||
if (!glfwInit()) {
|
||||
printf("Failed to init GLFW.");
|
||||
return -1;
|
||||
}
|
||||
|
||||
initGraph(&fps, GRAPH_RENDER_FPS, "Frame Time");
|
||||
|
||||
glfwSetErrorCallback(errorcb);
|
||||
|
||||
glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_ES_API);
|
||||
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
|
||||
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0);
|
||||
|
||||
window = glfwCreateWindow(1000, 600, "NanoVG", NULL, NULL);
|
||||
// window = glfwCreateWindow(1000, 600, "NanoVG", glfwGetPrimaryMonitor(), NULL);
|
||||
if (!window) {
|
||||
glfwTerminate();
|
||||
return -1;
|
||||
}
|
||||
|
||||
glfwSetKeyCallback(window, key);
|
||||
|
||||
glfwMakeContextCurrent(window);
|
||||
|
||||
vg = nvgCreateGLES3(NVG_ANTIALIAS | NVG_STENCIL_STROKES | NVG_DEBUG);
|
||||
if (vg == NULL) {
|
||||
printf("Could not init nanovg.\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (loadDemoData(vg, &data) == -1)
|
||||
return -1;
|
||||
|
||||
glfwSwapInterval(0);
|
||||
|
||||
glfwSetTime(0);
|
||||
prevt = glfwGetTime();
|
||||
|
||||
while (!glfwWindowShouldClose(window))
|
||||
{
|
||||
double mx, my, t, dt;
|
||||
int winWidth, winHeight;
|
||||
int fbWidth, fbHeight;
|
||||
float pxRatio;
|
||||
|
||||
t = glfwGetTime();
|
||||
dt = t - prevt;
|
||||
prevt = t;
|
||||
updateGraph(&fps, dt);
|
||||
|
||||
glfwGetCursorPos(window, &mx, &my);
|
||||
glfwGetWindowSize(window, &winWidth, &winHeight);
|
||||
glfwGetFramebufferSize(window, &fbWidth, &fbHeight);
|
||||
// Calculate pixel ration for hi-dpi devices.
|
||||
pxRatio = (float)fbWidth / (float)winWidth;
|
||||
|
||||
// Update and render
|
||||
glViewport(0, 0, fbWidth, fbHeight);
|
||||
if (premult)
|
||||
glClearColor(0,0,0,0);
|
||||
else
|
||||
glClearColor(0.3f, 0.3f, 0.32f, 1.0f);
|
||||
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT);
|
||||
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glEnable(GL_CULL_FACE);
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
|
||||
nvgBeginFrame(vg, winWidth, winHeight, pxRatio);
|
||||
|
||||
renderDemo(vg, mx,my, winWidth,winHeight, t, blowup, &data);
|
||||
renderGraph(vg, 5,5, &fps);
|
||||
|
||||
nvgEndFrame(vg);
|
||||
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
|
||||
if (screenshot) {
|
||||
screenshot = 0;
|
||||
saveScreenShot(fbWidth, fbHeight, premult, "dump.png");
|
||||
}
|
||||
|
||||
glfwSwapBuffers(window);
|
||||
glfwPollEvents();
|
||||
}
|
||||
|
||||
freeDemoData(vg, &data);
|
||||
|
||||
nvgDeleteGLES3(vg);
|
||||
|
||||
glfwTerminate();
|
||||
return 0;
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
Image credits
|
||||
http://cuteoverload.com/2013/11/05/mom-taxi-xvi-birthday-party/
|
||||
http://cuteoverload.com/2013/11/05/benson-hedges-private-eye-in-the-case-of-the-crafty-craftsman/
|
||||
http://cuteoverload.com/2013/11/05/no-underwater-ballets/
|
||||
http://cuteoverload.com/2013/11/05/every-nose-has-a-story/
|
||||
http://cuteoverload.com/2013/11/04/nosevember-nozzle-nose/
|
||||
http://cuteoverload.com/2013/11/04/this-just-in-super-strength-cute/
|
||||
http://cuteoverload.com/2013/11/03/have-a-bunderful-sunday/
|
||||
http://cuteoverload.com/2013/11/02/caturday-sense-a-common-theme-here/
|
||||
http://cuteoverload.com/2013/11/01/nosevember-1st-24-hours-of-noses-1148pm-pt/
|
||||
http://cuteoverload.com/2013/04/02/there-might-be-something-cuter-than-this/
|
||||
http://cuteoverload.com/2013/07/17/snorting-micro-peeg-gets-belleh-rubs-interwebs-explode/
|
||||
http://cuteoverload.com/2013/08/07/bark-in-the-park-v3-0/
|
Before Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 3.4 KiB |
Before Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 5.3 KiB |
Before Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 23 KiB |
Before Width: | Height: | Size: 26 KiB |
Before Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 3.9 KiB |
186
example/perf.c
@ -1,186 +0,0 @@
|
||||
#include "perf.h"
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <math.h>
|
||||
#ifdef NANOVG_GLEW
|
||||
# include <GL/glew.h>
|
||||
#endif
|
||||
#include <GLFW/glfw3.h>
|
||||
#include "nanovg.h"
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#define snprintf _snprintf
|
||||
#elif !defined(__MINGW32__)
|
||||
#include <iconv.h>
|
||||
#endif
|
||||
|
||||
// timer query support
|
||||
#ifndef GL_ARB_timer_query
|
||||
#define GL_TIME_ELAPSED 0x88BF
|
||||
//typedef void (APIENTRY *pfnGLGETQUERYOBJECTUI64V)(GLuint id, GLenum pname, GLuint64* params);
|
||||
//pfnGLGETQUERYOBJECTUI64V glGetQueryObjectui64v = 0;
|
||||
#endif
|
||||
|
||||
void initGPUTimer(GPUtimer* timer)
|
||||
{
|
||||
memset(timer, 0, sizeof(*timer));
|
||||
|
||||
/* timer->supported = glfwExtensionSupported("GL_ARB_timer_query");
|
||||
if (timer->supported) {
|
||||
#ifndef GL_ARB_timer_query
|
||||
glGetQueryObjectui64v = (pfnGLGETQUERYOBJECTUI64V)glfwGetProcAddress("glGetQueryObjectui64v");
|
||||
printf("glGetQueryObjectui64v=%p\n", glGetQueryObjectui64v);
|
||||
if (!glGetQueryObjectui64v) {
|
||||
timer->supported = GL_FALSE;
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
glGenQueries(GPU_QUERY_COUNT, timer->queries);
|
||||
}*/
|
||||
}
|
||||
|
||||
void startGPUTimer(GPUtimer* timer)
|
||||
{
|
||||
if (!timer->supported)
|
||||
return;
|
||||
glBeginQuery(GL_TIME_ELAPSED, timer->queries[timer->cur % GPU_QUERY_COUNT] );
|
||||
timer->cur++;
|
||||
}
|
||||
|
||||
int stopGPUTimer(GPUtimer* timer, float* times, int maxTimes)
|
||||
{
|
||||
NVG_NOTUSED(times);
|
||||
NVG_NOTUSED(maxTimes);
|
||||
GLint available = 1;
|
||||
int n = 0;
|
||||
if (!timer->supported)
|
||||
return 0;
|
||||
|
||||
glEndQuery(GL_TIME_ELAPSED);
|
||||
while (available && timer->ret <= timer->cur) {
|
||||
// check for results if there are any
|
||||
glGetQueryObjectiv(timer->queries[timer->ret % GPU_QUERY_COUNT], GL_QUERY_RESULT_AVAILABLE, &available);
|
||||
if (available) {
|
||||
/* GLuint64 timeElapsed = 0;
|
||||
glGetQueryObjectui64v(timer->queries[timer->ret % GPU_QUERY_COUNT], GL_QUERY_RESULT, &timeElapsed);
|
||||
timer->ret++;
|
||||
if (n < maxTimes) {
|
||||
times[n] = (float)((double)timeElapsed * 1e-9);
|
||||
n++;
|
||||
}*/
|
||||
}
|
||||
}
|
||||
return n;
|
||||
}
|
||||
|
||||
|
||||
void initGraph(PerfGraph* fps, int style, const char* name)
|
||||
{
|
||||
memset(fps, 0, sizeof(PerfGraph));
|
||||
fps->style = style;
|
||||
strncpy(fps->name, name, sizeof(fps->name));
|
||||
fps->name[sizeof(fps->name)-1] = '\0';
|
||||
}
|
||||
|
||||
void updateGraph(PerfGraph* fps, float frameTime)
|
||||
{
|
||||
fps->head = (fps->head+1) % GRAPH_HISTORY_COUNT;
|
||||
fps->values[fps->head] = frameTime;
|
||||
}
|
||||
|
||||
float getGraphAverage(PerfGraph* fps)
|
||||
{
|
||||
int i;
|
||||
float avg = 0;
|
||||
for (i = 0; i < GRAPH_HISTORY_COUNT; i++) {
|
||||
avg += fps->values[i];
|
||||
}
|
||||
return avg / (float)GRAPH_HISTORY_COUNT;
|
||||
}
|
||||
|
||||
void renderGraph(NVGcontext* vg, float x, float y, PerfGraph* fps)
|
||||
{
|
||||
int i;
|
||||
float avg, w, h;
|
||||
char str[64];
|
||||
|
||||
avg = getGraphAverage(fps);
|
||||
|
||||
w = 200;
|
||||
h = 35;
|
||||
|
||||
nvgBeginPath(vg);
|
||||
nvgRect(vg, x,y, w,h);
|
||||
nvgFillColor(vg, nvgRGBA(0,0,0,128));
|
||||
nvgFill(vg);
|
||||
|
||||
nvgBeginPath(vg);
|
||||
nvgMoveTo(vg, x, y+h);
|
||||
if (fps->style == GRAPH_RENDER_FPS) {
|
||||
for (i = 0; i < GRAPH_HISTORY_COUNT; i++) {
|
||||
float v = 1.0f / (0.00001f + fps->values[(fps->head+i) % GRAPH_HISTORY_COUNT]);
|
||||
float vx, vy;
|
||||
if (v > 80.0f) v = 80.0f;
|
||||
vx = x + ((float)i/(GRAPH_HISTORY_COUNT-1)) * w;
|
||||
vy = y + h - ((v / 80.0f) * h);
|
||||
nvgLineTo(vg, vx, vy);
|
||||
}
|
||||
} else if (fps->style == GRAPH_RENDER_PERCENT) {
|
||||
for (i = 0; i < GRAPH_HISTORY_COUNT; i++) {
|
||||
float v = fps->values[(fps->head+i) % GRAPH_HISTORY_COUNT] * 1.0f;
|
||||
float vx, vy;
|
||||
if (v > 100.0f) v = 100.0f;
|
||||
vx = x + ((float)i/(GRAPH_HISTORY_COUNT-1)) * w;
|
||||
vy = y + h - ((v / 100.0f) * h);
|
||||
nvgLineTo(vg, vx, vy);
|
||||
}
|
||||
} else {
|
||||
for (i = 0; i < GRAPH_HISTORY_COUNT; i++) {
|
||||
float v = fps->values[(fps->head+i) % GRAPH_HISTORY_COUNT] * 1000.0f;
|
||||
float vx, vy;
|
||||
if (v > 20.0f) v = 20.0f;
|
||||
vx = x + ((float)i/(GRAPH_HISTORY_COUNT-1)) * w;
|
||||
vy = y + h - ((v / 20.0f) * h);
|
||||
nvgLineTo(vg, vx, vy);
|
||||
}
|
||||
}
|
||||
nvgLineTo(vg, x+w, y+h);
|
||||
nvgFillColor(vg, nvgRGBA(255,192,0,128));
|
||||
nvgFill(vg);
|
||||
|
||||
nvgFontFace(vg, "sans");
|
||||
|
||||
if (fps->name[0] != '\0') {
|
||||
nvgFontSize(vg, 12.0f);
|
||||
nvgTextAlign(vg, NVG_ALIGN_LEFT|NVG_ALIGN_TOP);
|
||||
nvgFillColor(vg, nvgRGBA(240,240,240,192));
|
||||
nvgText(vg, x+3,y+3, fps->name, NULL);
|
||||
}
|
||||
|
||||
if (fps->style == GRAPH_RENDER_FPS) {
|
||||
nvgFontSize(vg, 15.0f);
|
||||
nvgTextAlign(vg,NVG_ALIGN_RIGHT|NVG_ALIGN_TOP);
|
||||
nvgFillColor(vg, nvgRGBA(240,240,240,255));
|
||||
sprintf(str, "%.2f FPS", 1.0f / avg);
|
||||
nvgText(vg, x+w-3,y+3, str, NULL);
|
||||
|
||||
nvgFontSize(vg, 13.0f);
|
||||
nvgTextAlign(vg,NVG_ALIGN_RIGHT|NVG_ALIGN_BASELINE);
|
||||
nvgFillColor(vg, nvgRGBA(240,240,240,160));
|
||||
sprintf(str, "%.2f ms", avg * 1000.0f);
|
||||
nvgText(vg, x+w-3,y+h-3, str, NULL);
|
||||
}
|
||||
else if (fps->style == GRAPH_RENDER_PERCENT) {
|
||||
nvgFontSize(vg, 15.0f);
|
||||
nvgTextAlign(vg,NVG_ALIGN_RIGHT|NVG_ALIGN_TOP);
|
||||
nvgFillColor(vg, nvgRGBA(240,240,240,255));
|
||||
sprintf(str, "%.1f %%", avg * 1.0f);
|
||||
nvgText(vg, x+w-3,y+3, str, NULL);
|
||||
} else {
|
||||
nvgFontSize(vg, 15.0f);
|
||||
nvgTextAlign(vg,NVG_ALIGN_RIGHT|NVG_ALIGN_TOP);
|
||||
nvgFillColor(vg, nvgRGBA(240,240,240,255));
|
||||
sprintf(str, "%.2f ms", avg * 1000.0f);
|
||||
nvgText(vg, x+w-3,y+3, str, NULL);
|
||||
}
|
||||
}
|
@ -1,46 +0,0 @@
|
||||
#ifndef PERF_H
|
||||
#define PERF_H
|
||||
|
||||
#include "nanovg.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
enum GraphrenderStyle {
|
||||
GRAPH_RENDER_FPS,
|
||||
GRAPH_RENDER_MS,
|
||||
GRAPH_RENDER_PERCENT,
|
||||
};
|
||||
|
||||
#define GRAPH_HISTORY_COUNT 100
|
||||
struct PerfGraph {
|
||||
int style;
|
||||
char name[32];
|
||||
float values[GRAPH_HISTORY_COUNT];
|
||||
int head;
|
||||
};
|
||||
typedef struct PerfGraph PerfGraph;
|
||||
|
||||
void initGraph(PerfGraph* fps, int style, const char* name);
|
||||
void updateGraph(PerfGraph* fps, float frameTime);
|
||||
void renderGraph(NVGcontext* vg, float x, float y, PerfGraph* fps);
|
||||
float getGraphAverage(PerfGraph* fps);
|
||||
|
||||
#define GPU_QUERY_COUNT 5
|
||||
struct GPUtimer {
|
||||
int supported;
|
||||
int cur, ret;
|
||||
unsigned int queries[GPU_QUERY_COUNT];
|
||||
};
|
||||
typedef struct GPUtimer GPUtimer;
|
||||
|
||||
void initGPUTimer(GPUtimer* timer);
|
||||
void startGPUTimer(GPUtimer* timer);
|
||||
int stopGPUTimer(GPUtimer* timer, float* times, int maxTimes);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // PERF_H
|
Before Width: | Height: | Size: 966 KiB |
Before Width: | Height: | Size: 224 KiB |
@ -1,511 +0,0 @@
|
||||
/* stbiw-0.92 - public domain - http://nothings.org/stb/stb_image_write.h
|
||||
writes out PNG/BMP/TGA images to C stdio - Sean Barrett 2010
|
||||
no warranty implied; use at your own risk
|
||||
|
||||
|
||||
Before including,
|
||||
|
||||
#define STB_IMAGE_WRITE_IMPLEMENTATION
|
||||
|
||||
in the file that you want to have the implementation.
|
||||
|
||||
|
||||
ABOUT:
|
||||
|
||||
This header file is a library for writing images to C stdio. It could be
|
||||
adapted to write to memory or a general streaming interface; let me know.
|
||||
|
||||
The PNG output is not optimal; it is 20-50% larger than the file
|
||||
written by a decent optimizing implementation. This library is designed
|
||||
for source code compactness and simplicitly, not optimal image file size
|
||||
or run-time performance.
|
||||
|
||||
USAGE:
|
||||
|
||||
There are three functions, one for each image file format:
|
||||
|
||||
int stbi_write_png(char const *filename, int w, int h, int comp, const void *data, int stride_in_bytes);
|
||||
int stbi_write_bmp(char const *filename, int w, int h, int comp, const void *data);
|
||||
int stbi_write_tga(char const *filename, int w, int h, int comp, const void *data);
|
||||
|
||||
Each function returns 0 on failure and non-0 on success.
|
||||
|
||||
The functions create an image file defined by the parameters. The image
|
||||
is a rectangle of pixels stored from left-to-right, top-to-bottom.
|
||||
Each pixel contains 'comp' channels of data stored interleaved with 8-bits
|
||||
per channel, in the following order: 1=Y, 2=YA, 3=RGB, 4=RGBA. (Y is
|
||||
monochrome color.) The rectangle is 'w' pixels wide and 'h' pixels tall.
|
||||
The *data pointer points to the first byte of the top-left-most pixel.
|
||||
For PNG, "stride_in_bytes" is the distance in bytes from the first byte of
|
||||
a row of pixels to the first byte of the next row of pixels.
|
||||
|
||||
PNG creates output files with the same number of components as the input.
|
||||
The BMP and TGA formats expand Y to RGB in the file format. BMP does not
|
||||
output alpha.
|
||||
|
||||
PNG supports writing rectangles of data even when the bytes storing rows of
|
||||
data are not consecutive in memory (e.g. sub-rectangles of a larger image),
|
||||
by supplying the stride between the beginning of adjacent rows. The other
|
||||
formats do not. (Thus you cannot write a native-format BMP through the BMP
|
||||
writer, both because it is in BGR order and because it may have padding
|
||||
at the end of the line.)
|
||||
*/
|
||||
|
||||
#ifndef INCLUDE_STB_IMAGE_WRITE_H
|
||||
#define INCLUDE_STB_IMAGE_WRITE_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern int stbi_write_png(char const *filename, int w, int h, int comp, const void *data, int stride_in_bytes);
|
||||
extern int stbi_write_bmp(char const *filename, int w, int h, int comp, const void *data);
|
||||
extern int stbi_write_tga(char const *filename, int w, int h, int comp, const void *data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif//INCLUDE_STB_IMAGE_WRITE_H
|
||||
|
||||
#ifdef STB_IMAGE_WRITE_IMPLEMENTATION
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
|
||||
typedef unsigned int stbiw_uint32;
|
||||
typedef int stb_image_write_test[sizeof(stbiw_uint32)==4 ? 1 : -1];
|
||||
|
||||
static void writefv(FILE *f, const char *fmt, va_list v)
|
||||
{
|
||||
while (*fmt) {
|
||||
switch (*fmt++) {
|
||||
case ' ': break;
|
||||
case '1': { unsigned char x = (unsigned char) va_arg(v, int); fputc(x,f); break; }
|
||||
case '2': { int x = va_arg(v,int); unsigned char b[2];
|
||||
b[0] = (unsigned char) x; b[1] = (unsigned char) (x>>8);
|
||||
fwrite(b,2,1,f); break; }
|
||||
case '4': { stbiw_uint32 x = va_arg(v,int); unsigned char b[4];
|
||||
b[0]=(unsigned char)x; b[1]=(unsigned char)(x>>8);
|
||||
b[2]=(unsigned char)(x>>16); b[3]=(unsigned char)(x>>24);
|
||||
fwrite(b,4,1,f); break; }
|
||||
default:
|
||||
assert(0);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void write3(FILE *f, unsigned char a, unsigned char b, unsigned char c)
|
||||
{
|
||||
unsigned char arr[3];
|
||||
arr[0] = a, arr[1] = b, arr[2] = c;
|
||||
fwrite(arr, 3, 1, f);
|
||||
}
|
||||
|
||||
static void write_pixels(FILE *f, int rgb_dir, int vdir, int x, int y, int comp, void *data, int write_alpha, int scanline_pad)
|
||||
{
|
||||
unsigned char bg[3] = { 255, 0, 255}, px[3];
|
||||
stbiw_uint32 zero = 0;
|
||||
int i,j,k, j_end;
|
||||
|
||||
if (y <= 0)
|
||||
return;
|
||||
|
||||
if (vdir < 0)
|
||||
j_end = -1, j = y-1;
|
||||
else
|
||||
j_end = y, j = 0;
|
||||
|
||||
for (; j != j_end; j += vdir) {
|
||||
for (i=0; i < x; ++i) {
|
||||
unsigned char *d = (unsigned char *) data + (j*x+i)*comp;
|
||||
if (write_alpha < 0)
|
||||
fwrite(&d[comp-1], 1, 1, f);
|
||||
switch (comp) {
|
||||
case 1:
|
||||
case 2: write3(f, d[0],d[0],d[0]);
|
||||
break;
|
||||
case 4:
|
||||
if (!write_alpha) {
|
||||
// composite against pink background
|
||||
for (k=0; k < 3; ++k)
|
||||
px[k] = bg[k] + ((d[k] - bg[k]) * d[3])/255;
|
||||
write3(f, px[1-rgb_dir],px[1],px[1+rgb_dir]);
|
||||
break;
|
||||
}
|
||||
/* FALLTHROUGH */
|
||||
case 3:
|
||||
write3(f, d[1-rgb_dir],d[1],d[1+rgb_dir]);
|
||||
break;
|
||||
}
|
||||
if (write_alpha > 0)
|
||||
fwrite(&d[comp-1], 1, 1, f);
|
||||
}
|
||||
fwrite(&zero,scanline_pad,1,f);
|
||||
}
|
||||
}
|
||||
|
||||
static int outfile(char const *filename, int rgb_dir, int vdir, int x, int y, int comp, void *data, int alpha, int pad, const char *fmt, ...)
|
||||
{
|
||||
FILE *f;
|
||||
if (y < 0 || x < 0) return 0;
|
||||
f = fopen(filename, "wb");
|
||||
if (f) {
|
||||
va_list v;
|
||||
va_start(v, fmt);
|
||||
writefv(f, fmt, v);
|
||||
va_end(v);
|
||||
write_pixels(f,rgb_dir,vdir,x,y,comp,data,alpha,pad);
|
||||
fclose(f);
|
||||
}
|
||||
return f != NULL;
|
||||
}
|
||||
|
||||
int stbi_write_bmp(char const *filename, int x, int y, int comp, const void *data)
|
||||
{
|
||||
int pad = (-x*3) & 3;
|
||||
return outfile(filename,-1,-1,x,y,comp,(void *) data,0,pad,
|
||||
"11 4 22 4" "4 44 22 444444",
|
||||
'B', 'M', 14+40+(x*3+pad)*y, 0,0, 14+40, // file header
|
||||
40, x,y, 1,24, 0,0,0,0,0,0); // bitmap header
|
||||
}
|
||||
|
||||
int stbi_write_tga(char const *filename, int x, int y, int comp, const void *data)
|
||||
{
|
||||
int has_alpha = !(comp & 1);
|
||||
return outfile(filename, -1,-1, x, y, comp, (void *) data, has_alpha, 0,
|
||||
"111 221 2222 11", 0,0,2, 0,0,0, 0,0,x,y, 24+8*has_alpha, 8*has_alpha);
|
||||
}
|
||||
|
||||
// stretchy buffer; stbi__sbpush() == vector<>::push_back() -- stbi__sbcount() == vector<>::size()
|
||||
#define stbi__sbraw(a) ((int *) (a) - 2)
|
||||
#define stbi__sbm(a) stbi__sbraw(a)[0]
|
||||
#define stbi__sbn(a) stbi__sbraw(a)[1]
|
||||
|
||||
#define stbi__sbneedgrow(a,n) ((a)==0 || stbi__sbn(a)+n >= stbi__sbm(a))
|
||||
#define stbi__sbmaybegrow(a,n) (stbi__sbneedgrow(a,(n)) ? stbi__sbgrow(a,n) : 0)
|
||||
#define stbi__sbgrow(a,n) stbi__sbgrowf((void **) &(a), (n), sizeof(*(a)))
|
||||
|
||||
#define stbi__sbpush(a, v) (stbi__sbmaybegrow(a,1), (a)[stbi__sbn(a)++] = (v))
|
||||
#define stbi__sbcount(a) ((a) ? stbi__sbn(a) : 0)
|
||||
#define stbi__sbfree(a) ((a) ? free(stbi__sbraw(a)),0 : 0)
|
||||
|
||||
static void *stbi__sbgrowf(void **arr, int increment, int itemsize)
|
||||
{
|
||||
int m = *arr ? 2*stbi__sbm(*arr)+increment : increment+1;
|
||||
void *p = realloc(*arr ? stbi__sbraw(*arr) : 0, itemsize * m + sizeof(int)*2);
|
||||
assert(p);
|
||||
if (p) {
|
||||
if (!*arr) ((int *) p)[1] = 0;
|
||||
*arr = (void *) ((int *) p + 2);
|
||||
stbi__sbm(*arr) = m;
|
||||
}
|
||||
return *arr;
|
||||
}
|
||||
|
||||
static unsigned char *stbi__zlib_flushf(unsigned char *data, unsigned int *bitbuffer, int *bitcount)
|
||||
{
|
||||
while (*bitcount >= 8) {
|
||||
stbi__sbpush(data, (unsigned char) *bitbuffer);
|
||||
*bitbuffer >>= 8;
|
||||
*bitcount -= 8;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
static int stbi__zlib_bitrev(int code, int codebits)
|
||||
{
|
||||
int res=0;
|
||||
while (codebits--) {
|
||||
res = (res << 1) | (code & 1);
|
||||
code >>= 1;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
static unsigned int stbi__zlib_countm(unsigned char *a, unsigned char *b, int limit)
|
||||
{
|
||||
int i;
|
||||
for (i=0; i < limit && i < 258; ++i)
|
||||
if (a[i] != b[i]) break;
|
||||
return i;
|
||||
}
|
||||
|
||||
static unsigned int stbi__zhash(unsigned char *data)
|
||||
{
|
||||
stbiw_uint32 hash = data[0] + (data[1] << 8) + (data[2] << 16);
|
||||
hash ^= hash << 3;
|
||||
hash += hash >> 5;
|
||||
hash ^= hash << 4;
|
||||
hash += hash >> 17;
|
||||
hash ^= hash << 25;
|
||||
hash += hash >> 6;
|
||||
return hash;
|
||||
}
|
||||
|
||||
#define stbi__zlib_flush() (out = stbi__zlib_flushf(out, &bitbuf, &bitcount))
|
||||
#define stbi__zlib_add(code,codebits) \
|
||||
(bitbuf |= (code) << bitcount, bitcount += (codebits), stbi__zlib_flush())
|
||||
#define stbi__zlib_huffa(b,c) stbi__zlib_add(stbi__zlib_bitrev(b,c),c)
|
||||
// default huffman tables
|
||||
#define stbi__zlib_huff1(n) stbi__zlib_huffa(0x30 + (n), 8)
|
||||
#define stbi__zlib_huff2(n) stbi__zlib_huffa(0x190 + (n)-144, 9)
|
||||
#define stbi__zlib_huff3(n) stbi__zlib_huffa(0 + (n)-256,7)
|
||||
#define stbi__zlib_huff4(n) stbi__zlib_huffa(0xc0 + (n)-280,8)
|
||||
#define stbi__zlib_huff(n) ((n) <= 143 ? stbi__zlib_huff1(n) : (n) <= 255 ? stbi__zlib_huff2(n) : (n) <= 279 ? stbi__zlib_huff3(n) : stbi__zlib_huff4(n))
|
||||
#define stbi__zlib_huffb(n) ((n) <= 143 ? stbi__zlib_huff1(n) : stbi__zlib_huff2(n))
|
||||
|
||||
#define stbi__ZHASH 16384
|
||||
|
||||
unsigned char * stbi_zlib_compress(unsigned char *data, int data_len, int *out_len, int quality)
|
||||
{
|
||||
static unsigned short lengthc[] = { 3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258, 259 };
|
||||
static unsigned char lengtheb[]= { 0,0,0,0,0,0,0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0 };
|
||||
static unsigned short distc[] = { 1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577, 32768 };
|
||||
static unsigned char disteb[] = { 0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13 };
|
||||
unsigned int bitbuf=0;
|
||||
int i,j, bitcount=0;
|
||||
unsigned char *out = NULL;
|
||||
unsigned char **hash_table[stbi__ZHASH]; // 64KB on the stack!
|
||||
if (quality < 5) quality = 5;
|
||||
|
||||
stbi__sbpush(out, 0x78); // DEFLATE 32K window
|
||||
stbi__sbpush(out, 0x5e); // FLEVEL = 1
|
||||
stbi__zlib_add(1,1); // BFINAL = 1
|
||||
stbi__zlib_add(1,2); // BTYPE = 1 -- fixed huffman
|
||||
|
||||
for (i=0; i < stbi__ZHASH; ++i)
|
||||
hash_table[i] = NULL;
|
||||
|
||||
i=0;
|
||||
while (i < data_len-3) {
|
||||
// hash next 3 bytes of data to be compressed
|
||||
int h = stbi__zhash(data+i)&(stbi__ZHASH-1), best=3;
|
||||
unsigned char *bestloc = 0;
|
||||
unsigned char **hlist = hash_table[h];
|
||||
int n = stbi__sbcount(hlist);
|
||||
for (j=0; j < n; ++j) {
|
||||
if (hlist[j]-data > i-32768) { // if entry lies within window
|
||||
int d = stbi__zlib_countm(hlist[j], data+i, data_len-i);
|
||||
if (d >= best) best=d,bestloc=hlist[j];
|
||||
}
|
||||
}
|
||||
// when hash table entry is too long, delete half the entries
|
||||
if (hash_table[h] && stbi__sbn(hash_table[h]) == 2*quality) {
|
||||
memcpy(hash_table[h], hash_table[h]+quality, sizeof(hash_table[h][0])*quality);
|
||||
stbi__sbn(hash_table[h]) = quality;
|
||||
}
|
||||
stbi__sbpush(hash_table[h],data+i);
|
||||
|
||||
if (bestloc) {
|
||||
// "lazy matching" - check match at *next* byte, and if it's better, do cur byte as literal
|
||||
h = stbi__zhash(data+i+1)&(stbi__ZHASH-1);
|
||||
hlist = hash_table[h];
|
||||
n = stbi__sbcount(hlist);
|
||||
for (j=0; j < n; ++j) {
|
||||
if (hlist[j]-data > i-32767) {
|
||||
int e = stbi__zlib_countm(hlist[j], data+i+1, data_len-i-1);
|
||||
if (e > best) { // if next match is better, bail on current match
|
||||
bestloc = NULL;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (bestloc) {
|
||||
int d = data+i - bestloc; // distance back
|
||||
assert(d <= 32767 && best <= 258);
|
||||
for (j=0; best > lengthc[j+1]-1; ++j);
|
||||
stbi__zlib_huff(j+257);
|
||||
if (lengtheb[j]) stbi__zlib_add(best - lengthc[j], lengtheb[j]);
|
||||
for (j=0; d > distc[j+1]-1; ++j);
|
||||
stbi__zlib_add(stbi__zlib_bitrev(j,5),5);
|
||||
if (disteb[j]) stbi__zlib_add(d - distc[j], disteb[j]);
|
||||
i += best;
|
||||
} else {
|
||||
stbi__zlib_huffb(data[i]);
|
||||
++i;
|
||||
}
|
||||
}
|
||||
// write out final bytes
|
||||
for (;i < data_len; ++i)
|
||||
stbi__zlib_huffb(data[i]);
|
||||
stbi__zlib_huff(256); // end of block
|
||||
// pad with 0 bits to byte boundary
|
||||
while (bitcount)
|
||||
stbi__zlib_add(0,1);
|
||||
|
||||
for (i=0; i < stbi__ZHASH; ++i)
|
||||
(void) stbi__sbfree(hash_table[i]);
|
||||
|
||||
{
|
||||
// compute adler32 on input
|
||||
unsigned int i=0, s1=1, s2=0, blocklen = data_len % 5552;
|
||||
int j=0;
|
||||
while (j < data_len) {
|
||||
for (i=0; i < blocklen; ++i) s1 += data[j+i], s2 += s1;
|
||||
s1 %= 65521, s2 %= 65521;
|
||||
j += blocklen;
|
||||
blocklen = 5552;
|
||||
}
|
||||
stbi__sbpush(out, (unsigned char) (s2 >> 8));
|
||||
stbi__sbpush(out, (unsigned char) s2);
|
||||
stbi__sbpush(out, (unsigned char) (s1 >> 8));
|
||||
stbi__sbpush(out, (unsigned char) s1);
|
||||
}
|
||||
*out_len = stbi__sbn(out);
|
||||
// make returned pointer freeable
|
||||
memmove(stbi__sbraw(out), out, *out_len);
|
||||
return (unsigned char *) stbi__sbraw(out);
|
||||
}
|
||||
|
||||
unsigned int stbi__crc32(unsigned char *buffer, int len)
|
||||
{
|
||||
static unsigned int crc_table[256];
|
||||
unsigned int crc = ~0u;
|
||||
int i,j;
|
||||
if (crc_table[1] == 0)
|
||||
for(i=0; i < 256; i++)
|
||||
for (crc_table[i]=i, j=0; j < 8; ++j)
|
||||
crc_table[i] = (crc_table[i] >> 1) ^ (crc_table[i] & 1 ? 0xedb88320 : 0);
|
||||
for (i=0; i < len; ++i)
|
||||
crc = (crc >> 8) ^ crc_table[buffer[i] ^ (crc & 0xff)];
|
||||
return ~crc;
|
||||
}
|
||||
|
||||
#define stbi__wpng4(o,a,b,c,d) ((o)[0]=(unsigned char)(a),(o)[1]=(unsigned char)(b),(o)[2]=(unsigned char)(c),(o)[3]=(unsigned char)(d),(o)+=4)
|
||||
#define stbi__wp32(data,v) stbi__wpng4(data, (v)>>24,(v)>>16,(v)>>8,(v));
|
||||
#define stbi__wptag(data,s) stbi__wpng4(data, s[0],s[1],s[2],s[3])
|
||||
|
||||
static void stbi__wpcrc(unsigned char **data, int len)
|
||||
{
|
||||
unsigned int crc = stbi__crc32(*data - len - 4, len+4);
|
||||
stbi__wp32(*data, crc);
|
||||
}
|
||||
|
||||
static unsigned char stbi__paeth(int a, int b, int c)
|
||||
{
|
||||
int p = a + b - c, pa = abs(p-a), pb = abs(p-b), pc = abs(p-c);
|
||||
if (pa <= pb && pa <= pc) return (unsigned char) a;
|
||||
if (pb <= pc) return (unsigned char) b;
|
||||
return (unsigned char) c;
|
||||
}
|
||||
|
||||
unsigned char *stbi_write_png_to_mem(unsigned char *pixels, int stride_bytes, int x, int y, int n, int *out_len)
|
||||
{
|
||||
int ctype[5] = { -1, 0, 4, 2, 6 };
|
||||
unsigned char sig[8] = { 137,80,78,71,13,10,26,10 };
|
||||
unsigned char *out,*o, *filt, *zlib;
|
||||
signed char *line_buffer;
|
||||
int i,j,k,p,zlen;
|
||||
|
||||
if (stride_bytes == 0)
|
||||
stride_bytes = x * n;
|
||||
|
||||
filt = (unsigned char *) malloc((x*n+1) * y); if (!filt) return 0;
|
||||
line_buffer = (signed char *) malloc(x * n); if (!line_buffer) { free(filt); return 0; }
|
||||
for (j=0; j < y; ++j) {
|
||||
static int mapping[] = { 0,1,2,3,4 };
|
||||
static int firstmap[] = { 0,1,0,5,6 };
|
||||
int *mymap = j ? mapping : firstmap;
|
||||
int best = 0, bestval = 0x7fffffff;
|
||||
for (p=0; p < 2; ++p) {
|
||||
for (k= p?best:0; k < 5; ++k) {
|
||||
int type = mymap[k],est=0;
|
||||
unsigned char *z = pixels + stride_bytes*j;
|
||||
for (i=0; i < n; ++i)
|
||||
switch (type) {
|
||||
case 0: line_buffer[i] = z[i]; break;
|
||||
case 1: line_buffer[i] = z[i]; break;
|
||||
case 2: line_buffer[i] = z[i] - z[i-stride_bytes]; break;
|
||||
case 3: line_buffer[i] = z[i] - (z[i-stride_bytes]>>1); break;
|
||||
case 4: line_buffer[i] = (signed char) (z[i] - stbi__paeth(0,z[i-stride_bytes],0)); break;
|
||||
case 5: line_buffer[i] = z[i]; break;
|
||||
case 6: line_buffer[i] = z[i]; break;
|
||||
}
|
||||
for (i=n; i < x*n; ++i) {
|
||||
switch (type) {
|
||||
case 0: line_buffer[i] = z[i]; break;
|
||||
case 1: line_buffer[i] = z[i] - z[i-n]; break;
|
||||
case 2: line_buffer[i] = z[i] - z[i-stride_bytes]; break;
|
||||
case 3: line_buffer[i] = z[i] - ((z[i-n] + z[i-stride_bytes])>>1); break;
|
||||
case 4: line_buffer[i] = z[i] - stbi__paeth(z[i-n], z[i-stride_bytes], z[i-stride_bytes-n]); break;
|
||||
case 5: line_buffer[i] = z[i] - (z[i-n]>>1); break;
|
||||
case 6: line_buffer[i] = z[i] - stbi__paeth(z[i-n], 0,0); break;
|
||||
}
|
||||
}
|
||||
if (p) break;
|
||||
for (i=0; i < x*n; ++i)
|
||||
est += abs((signed char) line_buffer[i]);
|
||||
if (est < bestval) { bestval = est; best = k; }
|
||||
}
|
||||
}
|
||||
// when we get here, best contains the filter type, and line_buffer contains the data
|
||||
filt[j*(x*n+1)] = (unsigned char) best;
|
||||
memcpy(filt+j*(x*n+1)+1, line_buffer, x*n);
|
||||
}
|
||||
free(line_buffer);
|
||||
zlib = stbi_zlib_compress(filt, y*( x*n+1), &zlen, 8); // increase 8 to get smaller but use more memory
|
||||
free(filt);
|
||||
if (!zlib) return 0;
|
||||
|
||||
// each tag requires 12 bytes of overhead
|
||||
out = (unsigned char *) malloc(8 + 12+13 + 12+zlen + 12);
|
||||
if (!out) return 0;
|
||||
*out_len = 8 + 12+13 + 12+zlen + 12;
|
||||
|
||||
o=out;
|
||||
memcpy(o,sig,8); o+= 8;
|
||||
stbi__wp32(o, 13); // header length
|
||||
stbi__wptag(o, "IHDR");
|
||||
stbi__wp32(o, x);
|
||||
stbi__wp32(o, y);
|
||||
*o++ = 8;
|
||||
*o++ = (unsigned char) ctype[n];
|
||||
*o++ = 0;
|
||||
*o++ = 0;
|
||||
*o++ = 0;
|
||||
stbi__wpcrc(&o,13);
|
||||
|
||||
stbi__wp32(o, zlen);
|
||||
stbi__wptag(o, "IDAT");
|
||||
memcpy(o, zlib, zlen); o += zlen; free(zlib);
|
||||
stbi__wpcrc(&o, zlen);
|
||||
|
||||
stbi__wp32(o,0);
|
||||
stbi__wptag(o, "IEND");
|
||||
stbi__wpcrc(&o,0);
|
||||
|
||||
assert(o == out + *out_len);
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
int stbi_write_png(char const *filename, int x, int y, int comp, const void *data, int stride_bytes)
|
||||
{
|
||||
FILE *f;
|
||||
int len;
|
||||
unsigned char *png = stbi_write_png_to_mem((unsigned char *) data, stride_bytes, x, y, comp, &len);
|
||||
if (!png) return 0;
|
||||
f = fopen(filename, "wb");
|
||||
if (!f) { free(png); return 0; }
|
||||
fwrite(png, 1, len, f);
|
||||
fclose(f);
|
||||
free(png);
|
||||
return 1;
|
||||
}
|
||||
#endif // STB_IMAGE_WRITE_IMPLEMENTATION
|
||||
|
||||
/* Revision history
|
||||
|
||||
0.92 (2010-08-01)
|
||||
casts to unsigned char to fix warnings
|
||||
0.91 (2010-07-17)
|
||||
first public release
|
||||
0.90 first internal release
|
||||
*/
|
32
include/EGL/egl.h
Normal file
@ -0,0 +1,32 @@
|
||||
/**************************************************************************
|
||||
* Name : drvegl.h
|
||||
*
|
||||
* Copyright : 2004-2006 by Imagination Technologies Limited. All rights reserved.
|
||||
* : No part of this software, either material or conceptual
|
||||
* : may be copied or distributed, transmitted, transcribed,
|
||||
* : stored in a retrieval system or translated into any
|
||||
* : human or computer language in any form by any means,
|
||||
* : electronic, mechanical, manual or other-wise, or
|
||||
* : disclosed to third parties without the express written
|
||||
* : permission of Imagination Technologies Limited, Unit 8, HomePark
|
||||
* : Industrial Estate, King's Langley, Hertfordshire,
|
||||
* : WD4 8LZ, U.K.
|
||||
*
|
||||
* $Log: drvegl.h $
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef __drvegl_h_
|
||||
#define __drvegl_h_
|
||||
|
||||
/* May need to export on some platforms */
|
||||
#if !defined(GLAPI_EXT)
|
||||
#define GLAPI_EXT IMG_EXPORT
|
||||
#endif
|
||||
|
||||
#ifndef APIENTRY
|
||||
#define APIENTRY IMG_CALLCONV
|
||||
#endif
|
||||
|
||||
#include "egl1_4.h"
|
||||
|
||||
#endif /* ___drvegl_h_ */
|
322
include/EGL/egl1_4.h
Normal file
@ -0,0 +1,322 @@
|
||||
/**************************************************************************
|
||||
* Name : drvegl1_4.h
|
||||
*
|
||||
* Copyright : 2005-2008 by Imagination Technologies Limited. All rights reserved.
|
||||
* : No part of this software, either material or conceptual
|
||||
* : may be copied or distributed, transmitted, transcribed,
|
||||
* : stored in a retrieval system or translated into any
|
||||
* : human or computer language in any form by any means,
|
||||
* : electronic, mechanical, manual or other-wise, or
|
||||
* : disclosed to third parties without the express written
|
||||
* : permission of Imagination Technologies Limited, Unit 8, HomePark
|
||||
* : Industrial Estate, King's Langley, Hertfordshire,
|
||||
* : WD4 8LZ, U.K.
|
||||
*
|
||||
* $Log: drvegl1_4.h $
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef __drvegl1_4_h_
|
||||
#define __drvegl1_4_h_
|
||||
|
||||
|
||||
/* All platform-dependent types and macro boilerplate (such as EGLAPI
|
||||
* and EGLAPIENTRY) should go in eglplatform.h.
|
||||
*/
|
||||
#include "eglplatform.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* EGL Types */
|
||||
/* EGLint is defined in eglplatform.h */
|
||||
typedef unsigned int EGLBoolean;
|
||||
typedef unsigned int EGLenum;
|
||||
typedef void *EGLConfig;
|
||||
typedef void *EGLContext;
|
||||
typedef void *EGLDisplay;
|
||||
typedef void *EGLSurface;
|
||||
typedef void *EGLClientBuffer;
|
||||
|
||||
/* EGL Versioning */
|
||||
#define EGL_VERSION_1_0 1
|
||||
#define EGL_VERSION_1_1 1
|
||||
#define EGL_VERSION_1_2 1
|
||||
#define EGL_VERSION_1_3 1
|
||||
#define EGL_VERSION_1_4 1
|
||||
|
||||
/* EGL Enumerants. Bitmasks and other exceptional cases aside, most
|
||||
* enums are assigned unique values starting at 0x3000.
|
||||
*/
|
||||
|
||||
/* EGL aliases */
|
||||
#define EGL_FALSE 0
|
||||
#define EGL_TRUE 1
|
||||
|
||||
/* Out-of-band handle values */
|
||||
#define EGL_DEFAULT_DISPLAY ((EGLNativeDisplayType)0)
|
||||
#define EGL_NO_CONTEXT ((EGLContext)0)
|
||||
#define EGL_NO_DISPLAY ((EGLDisplay)0)
|
||||
#define EGL_NO_SURFACE ((EGLSurface)0)
|
||||
|
||||
/* Out-of-band attribute value */
|
||||
#define EGL_DONT_CARE ((EGLint)-1)
|
||||
|
||||
/* Errors / GetError return values */
|
||||
#define EGL_SUCCESS 0x3000
|
||||
#define EGL_NOT_INITIALIZED 0x3001
|
||||
#define EGL_BAD_ACCESS 0x3002
|
||||
#define EGL_BAD_ALLOC 0x3003
|
||||
#define EGL_BAD_ATTRIBUTE 0x3004
|
||||
#define EGL_BAD_CONFIG 0x3005
|
||||
#define EGL_BAD_CONTEXT 0x3006
|
||||
#define EGL_BAD_CURRENT_SURFACE 0x3007
|
||||
#define EGL_BAD_DISPLAY 0x3008
|
||||
#define EGL_BAD_MATCH 0x3009
|
||||
#define EGL_BAD_NATIVE_PIXMAP 0x300A
|
||||
#define EGL_BAD_NATIVE_WINDOW 0x300B
|
||||
#define EGL_BAD_PARAMETER 0x300C
|
||||
#define EGL_BAD_SURFACE 0x300D
|
||||
#define EGL_CONTEXT_LOST 0x300E /* EGL 1.1 - IMG_power_management */
|
||||
|
||||
/* Reserved 0x300F-0x301F for additional errors */
|
||||
|
||||
/* Config attributes */
|
||||
#define EGL_BUFFER_SIZE 0x3020
|
||||
#define EGL_ALPHA_SIZE 0x3021
|
||||
#define EGL_BLUE_SIZE 0x3022
|
||||
#define EGL_GREEN_SIZE 0x3023
|
||||
#define EGL_RED_SIZE 0x3024
|
||||
#define EGL_DEPTH_SIZE 0x3025
|
||||
#define EGL_STENCIL_SIZE 0x3026
|
||||
#define EGL_CONFIG_CAVEAT 0x3027
|
||||
#define EGL_CONFIG_ID 0x3028
|
||||
#define EGL_LEVEL 0x3029
|
||||
#define EGL_MAX_PBUFFER_HEIGHT 0x302A
|
||||
#define EGL_MAX_PBUFFER_PIXELS 0x302B
|
||||
#define EGL_MAX_PBUFFER_WIDTH 0x302C
|
||||
#define EGL_NATIVE_RENDERABLE 0x302D
|
||||
#define EGL_NATIVE_VISUAL_ID 0x302E
|
||||
#define EGL_NATIVE_VISUAL_TYPE 0x302F
|
||||
#define EGL_SAMPLES 0x3031
|
||||
#define EGL_SAMPLE_BUFFERS 0x3032
|
||||
#define EGL_SURFACE_TYPE 0x3033
|
||||
#define EGL_TRANSPARENT_TYPE 0x3034
|
||||
#define EGL_TRANSPARENT_BLUE_VALUE 0x3035
|
||||
#define EGL_TRANSPARENT_GREEN_VALUE 0x3036
|
||||
#define EGL_TRANSPARENT_RED_VALUE 0x3037
|
||||
#define EGL_NONE 0x3038 /* Attrib list terminator */
|
||||
#define EGL_BIND_TO_TEXTURE_RGB 0x3039
|
||||
#define EGL_BIND_TO_TEXTURE_RGBA 0x303A
|
||||
#define EGL_MIN_SWAP_INTERVAL 0x303B
|
||||
#define EGL_MAX_SWAP_INTERVAL 0x303C
|
||||
#define EGL_LUMINANCE_SIZE 0x303D
|
||||
#define EGL_ALPHA_MASK_SIZE 0x303E
|
||||
#define EGL_COLOR_BUFFER_TYPE 0x303F
|
||||
#define EGL_RENDERABLE_TYPE 0x3040
|
||||
#define EGL_MATCH_NATIVE_PIXMAP 0x3041 /* Pseudo-attribute (not queryable) */
|
||||
#define EGL_CONFORMANT 0x3042
|
||||
|
||||
/* Reserved 0x3041-0x304F for additional config attributes */
|
||||
|
||||
/* Config attribute values */
|
||||
#define EGL_SLOW_CONFIG 0x3050 /* EGL_CONFIG_CAVEAT value */
|
||||
#define EGL_NON_CONFORMANT_CONFIG 0x3051 /* EGL_CONFIG_CAVEAT value */
|
||||
#define EGL_TRANSPARENT_RGB 0x3052 /* EGL_TRANSPARENT_TYPE value */
|
||||
#define EGL_RGB_BUFFER 0x308E /* EGL_COLOR_BUFFER_TYPE value */
|
||||
#define EGL_LUMINANCE_BUFFER 0x308F /* EGL_COLOR_BUFFER_TYPE value */
|
||||
|
||||
/* More config attribute values, for EGL_TEXTURE_FORMAT */
|
||||
#define EGL_NO_TEXTURE 0x305C
|
||||
#define EGL_TEXTURE_RGB 0x305D
|
||||
#define EGL_TEXTURE_RGBA 0x305E
|
||||
#define EGL_TEXTURE_2D 0x305F
|
||||
|
||||
/* Config attribute mask bits */
|
||||
#define EGL_PBUFFER_BIT 0x0001 /* EGL_SURFACE_TYPE mask bits */
|
||||
#define EGL_PIXMAP_BIT 0x0002 /* EGL_SURFACE_TYPE mask bits */
|
||||
#define EGL_WINDOW_BIT 0x0004 /* EGL_SURFACE_TYPE mask bits */
|
||||
#define EGL_VG_COLORSPACE_LINEAR_BIT 0x0020 /* EGL_SURFACE_TYPE mask bits */
|
||||
#define EGL_VG_ALPHA_FORMAT_PRE_BIT 0x0040 /* EGL_SURFACE_TYPE mask bits */
|
||||
#define EGL_MULTISAMPLE_RESOLVE_BOX_BIT 0x0200 /* EGL_SURFACE_TYPE mask bits */
|
||||
#define EGL_SWAP_BEHAVIOR_PRESERVED_BIT 0x0400 /* EGL_SURFACE_TYPE mask bits */
|
||||
|
||||
#define EGL_OPENGL_ES_BIT 0x0001 /* EGL_RENDERABLE_TYPE mask bits */
|
||||
#define EGL_OPENVG_BIT 0x0002 /* EGL_RENDERABLE_TYPE mask bits */
|
||||
#define EGL_OPENGL_ES2_BIT 0x0004 /* EGL_RENDERABLE_TYPE mask bits */
|
||||
#define EGL_OPENGL_BIT 0x0008 /* EGL_RENDERABLE_TYPE mask bits */
|
||||
|
||||
/* QueryString targets */
|
||||
#define EGL_VENDOR 0x3053
|
||||
#define EGL_VERSION 0x3054
|
||||
#define EGL_EXTENSIONS 0x3055
|
||||
#define EGL_CLIENT_APIS 0x308D
|
||||
|
||||
/* QuerySurface / SurfaceAttrib / CreatePbufferSurface targets */
|
||||
#define EGL_HEIGHT 0x3056
|
||||
#define EGL_WIDTH 0x3057
|
||||
#define EGL_LARGEST_PBUFFER 0x3058
|
||||
#define EGL_TEXTURE_FORMAT 0x3080
|
||||
#define EGL_TEXTURE_TARGET 0x3081
|
||||
#define EGL_MIPMAP_TEXTURE 0x3082
|
||||
#define EGL_MIPMAP_LEVEL 0x3083
|
||||
#define EGL_RENDER_BUFFER 0x3086
|
||||
#define EGL_VG_COLORSPACE 0x3087
|
||||
#define EGL_VG_ALPHA_FORMAT 0x3088
|
||||
#define EGL_HORIZONTAL_RESOLUTION 0x3090
|
||||
#define EGL_VERTICAL_RESOLUTION 0x3091
|
||||
#define EGL_PIXEL_ASPECT_RATIO 0x3092
|
||||
#define EGL_SWAP_BEHAVIOR 0x3093
|
||||
#define EGL_MULTISAMPLE_RESOLVE 0x3099
|
||||
|
||||
/* EGL_RENDER_BUFFER values / BindTexImage / ReleaseTexImage buffer targets */
|
||||
#define EGL_BACK_BUFFER 0x3084
|
||||
#define EGL_SINGLE_BUFFER 0x3085
|
||||
|
||||
/* OpenVG color spaces */
|
||||
#define EGL_VG_COLORSPACE_sRGB 0x3089 /* EGL_VG_COLORSPACE value */
|
||||
#define EGL_VG_COLORSPACE_LINEAR 0x308A /* EGL_VG_COLORSPACE value */
|
||||
|
||||
/* OpenVG alpha formats */
|
||||
#define EGL_VG_ALPHA_FORMAT_NONPRE 0x308B /* EGL_ALPHA_FORMAT value */
|
||||
#define EGL_VG_ALPHA_FORMAT_PRE 0x308C /* EGL_ALPHA_FORMAT value */
|
||||
|
||||
/* Constant scale factor by which fractional display resolutions &
|
||||
* aspect ratio are scaled when queried as integer values.
|
||||
*/
|
||||
#define EGL_DISPLAY_SCALING 10000
|
||||
|
||||
/* Unknown display resolution/aspect ratio */
|
||||
#define EGL_UNKNOWN ((EGLint)-1)
|
||||
|
||||
/* Back buffer swap behaviors */
|
||||
#define EGL_BUFFER_PRESERVED 0x3094 /* EGL_SWAP_BEHAVIOR value */
|
||||
#define EGL_BUFFER_DESTROYED 0x3095 /* EGL_SWAP_BEHAVIOR value */
|
||||
|
||||
/* CreatePbufferFromClientBuffer buffer types */
|
||||
#define EGL_OPENVG_IMAGE 0x3096
|
||||
|
||||
/* QueryContext targets */
|
||||
#define EGL_CONTEXT_CLIENT_TYPE 0x3097
|
||||
|
||||
/* CreateContext attributes */
|
||||
#define EGL_CONTEXT_CLIENT_VERSION 0x3098
|
||||
|
||||
/* Multisample resolution behaviors */
|
||||
#define EGL_MULTISAMPLE_RESOLVE_DEFAULT 0x309A /* EGL_MULTISAMPLE_RESOLVE value */
|
||||
#define EGL_MULTISAMPLE_RESOLVE_BOX 0x309B /* EGL_MULTISAMPLE_RESOLVE value */
|
||||
|
||||
/* BindAPI/QueryAPI targets */
|
||||
#define EGL_OPENGL_ES_API 0x30A0
|
||||
#define EGL_OPENVG_API 0x30A1
|
||||
#define EGL_OPENGL_API 0x30A2
|
||||
|
||||
/* GetCurrentSurface targets */
|
||||
#define EGL_DRAW 0x3059
|
||||
#define EGL_READ 0x305A
|
||||
|
||||
/* WaitNative engines */
|
||||
#define EGL_CORE_NATIVE_ENGINE 0x305B
|
||||
|
||||
/* EGL 1.2 tokens renamed for consistency in EGL 1.3 */
|
||||
#define EGL_COLORSPACE EGL_VG_COLORSPACE
|
||||
#define EGL_ALPHA_FORMAT EGL_VG_ALPHA_FORMAT
|
||||
#define EGL_COLORSPACE_sRGB EGL_VG_COLORSPACE_sRGB
|
||||
#define EGL_COLORSPACE_LINEAR EGL_VG_COLORSPACE_LINEAR
|
||||
#define EGL_ALPHA_FORMAT_NONPRE EGL_VG_ALPHA_FORMAT_NONPRE
|
||||
#define EGL_ALPHA_FORMAT_PRE EGL_VG_ALPHA_FORMAT_PRE
|
||||
|
||||
/* EGL extensions must request enum blocks from the Khronos
|
||||
* API Registrar, who maintains the enumerant registry. Submit
|
||||
* a bug in Khronos Bugzilla against task "Registry".
|
||||
*/
|
||||
|
||||
/*
|
||||
** FIXME: The EGL_SEQUENCE_ITEM_SYMB token is temporary until an
|
||||
** offical name and value are assigned.
|
||||
*/
|
||||
#define EGL_SEQUENCE_ITEM_SYMB 0x6000
|
||||
|
||||
/* EGL Functions */
|
||||
|
||||
EGLAPI EGLint EGLAPIENTRY eglGetError(void);
|
||||
|
||||
EGLAPI EGLDisplay EGLAPIENTRY eglGetDisplay(EGLNativeDisplayType display_id);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglTerminate(EGLDisplay dpy);
|
||||
|
||||
EGLAPI const char * EGLAPIENTRY eglQueryString(EGLDisplay dpy, EGLint name);
|
||||
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigs(EGLDisplay dpy, EGLConfig *configs,
|
||||
EGLint config_size, EGLint *num_config);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglChooseConfig(EGLDisplay dpy, const EGLint *attrib_list,
|
||||
EGLConfig *configs, EGLint config_size,
|
||||
EGLint *num_config);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigAttrib(EGLDisplay dpy, EGLConfig config,
|
||||
EGLint attribute, EGLint *value);
|
||||
|
||||
EGLAPI EGLSurface EGLAPIENTRY eglCreateWindowSurface(EGLDisplay dpy, EGLConfig config,
|
||||
EGLNativeWindowType win,
|
||||
const EGLint *attrib_list);
|
||||
EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferSurface(EGLDisplay dpy, EGLConfig config,
|
||||
const EGLint *attrib_list);
|
||||
EGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurface(EGLDisplay dpy, EGLConfig config,
|
||||
EGLNativePixmapType pixmap,
|
||||
const EGLint *attrib_list);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglDestroySurface(EGLDisplay dpy, EGLSurface surface);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurface(EGLDisplay dpy, EGLSurface surface,
|
||||
EGLint attribute, EGLint *value);
|
||||
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglBindAPI(EGLenum api);
|
||||
EGLAPI EGLenum EGLAPIENTRY eglQueryAPI(void);
|
||||
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglWaitClient(void);
|
||||
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglReleaseThread(void);
|
||||
|
||||
EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferFromClientBuffer(
|
||||
EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer,
|
||||
EGLConfig config, const EGLint *attrib_list);
|
||||
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglSurfaceAttrib(EGLDisplay dpy, EGLSurface surface,
|
||||
EGLint attribute, EGLint value);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglBindTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglReleaseTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer);
|
||||
|
||||
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglSwapInterval(EGLDisplay dpy, EGLint interval);
|
||||
|
||||
|
||||
EGLAPI EGLContext EGLAPIENTRY eglCreateContext(EGLDisplay dpy, EGLConfig config,
|
||||
EGLContext share_context,
|
||||
const EGLint *attrib_list);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglDestroyContext(EGLDisplay dpy, EGLContext ctx);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglMakeCurrent(EGLDisplay dpy, EGLSurface draw,
|
||||
EGLSurface read, EGLContext ctx);
|
||||
|
||||
EGLAPI EGLContext EGLAPIENTRY eglGetCurrentContext(void);
|
||||
EGLAPI EGLSurface EGLAPIENTRY eglGetCurrentSurface(EGLint readdraw);
|
||||
EGLAPI EGLDisplay EGLAPIENTRY eglGetCurrentDisplay(void);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglQueryContext(EGLDisplay dpy, EGLContext ctx,
|
||||
EGLint attribute, EGLint *value);
|
||||
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglWaitGL(void);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglWaitNative(EGLint engine);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers(EGLDisplay dpy, EGLSurface surface);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglCopyBuffers(EGLDisplay dpy, EGLSurface surface,
|
||||
EGLNativePixmapType target);
|
||||
|
||||
/* This is a generic function pointer type, whose name indicates it must
|
||||
* be cast to the proper type *and calling convention* before use.
|
||||
*/
|
||||
typedef void (*__eglMustCastToProperFunctionPointerType)(void);
|
||||
|
||||
/* Now, define eglGetProcAddress using the generic function ptr. type */
|
||||
EGLAPI __eglMustCastToProperFunctionPointerType EGLAPIENTRY
|
||||
eglGetProcAddress(const char *procname);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __drvegl1_4_h_ */
|
316
include/EGL/eglext.h
Normal file
@ -0,0 +1,316 @@
|
||||
/*************************************************************************/ /*!
|
||||
@File drveglext.h
|
||||
@Title EGL extensions header for drivers
|
||||
@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
|
||||
@Description EGL extensions header for drivers
|
||||
@License Strictly Confidential.
|
||||
*/ /**************************************************************************/
|
||||
|
||||
#ifndef __drveglext_h_
|
||||
#define __drveglext_h_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright (c) 2007-2009 The Khronos Group Inc.
|
||||
**
|
||||
** Permission is hereby granted, free of charge, to any person obtaining a
|
||||
** copy of this software and/or associated documentation files (the
|
||||
** "Materials"), to deal in the Materials without restriction, including
|
||||
** without limitation the rights to use, copy, modify, merge, publish,
|
||||
** distribute, sublicense, and/or sell copies of the Materials, and to
|
||||
** permit persons to whom the Materials are furnished to do so, subject to
|
||||
** the following conditions:
|
||||
**
|
||||
** The above copyright notice and this permission notice shall be included
|
||||
** in all copies or substantial portions of the Materials.
|
||||
**
|
||||
** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
||||
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
*/
|
||||
|
||||
#include "eglplatform.h"
|
||||
|
||||
#define EGL_EGLEXT_PROTOTYPES
|
||||
|
||||
/*************************************************************/
|
||||
|
||||
/* Header file version number */
|
||||
/* Current version at http://www.khronos.org/registry/egl/ */
|
||||
/* $Revision: 1.22 $ on $Date: 2011/07/20 15:25:34 $ */
|
||||
#define EGL_EGLEXT_VERSION 6
|
||||
|
||||
#ifndef EGL_KHR_config_attribs
|
||||
#define EGL_KHR_config_attribs 1
|
||||
#define EGL_CONFORMANT_KHR 0x3042 /* EGLConfig attribute */
|
||||
#define EGL_VG_COLORSPACE_LINEAR_BIT_KHR 0x0020 /* EGL_SURFACE_TYPE bitfield */
|
||||
#define EGL_VG_ALPHA_FORMAT_PRE_BIT_KHR 0x0040 /* EGL_SURFACE_TYPE bitfield */
|
||||
#endif
|
||||
|
||||
#ifndef EGL_KHR_lock_surface
|
||||
#define EGL_KHR_lock_surface 1
|
||||
#define EGL_READ_SURFACE_BIT_KHR 0x0001 /* EGL_LOCK_USAGE_HINT_KHR bitfield */
|
||||
#define EGL_WRITE_SURFACE_BIT_KHR 0x0002 /* EGL_LOCK_USAGE_HINT_KHR bitfield */
|
||||
#define EGL_LOCK_SURFACE_BIT_KHR 0x0080 /* EGL_SURFACE_TYPE bitfield */
|
||||
#define EGL_OPTIMAL_FORMAT_BIT_KHR 0x0100 /* EGL_SURFACE_TYPE bitfield */
|
||||
#define EGL_MATCH_FORMAT_KHR 0x3043 /* EGLConfig attribute */
|
||||
#define EGL_FORMAT_RGB_565_EXACT_KHR 0x30C0 /* EGL_MATCH_FORMAT_KHR value */
|
||||
#define EGL_FORMAT_RGB_565_KHR 0x30C1 /* EGL_MATCH_FORMAT_KHR value */
|
||||
#define EGL_FORMAT_RGBA_8888_EXACT_KHR 0x30C2 /* EGL_MATCH_FORMAT_KHR value */
|
||||
#define EGL_FORMAT_RGBA_8888_KHR 0x30C3 /* EGL_MATCH_FORMAT_KHR value */
|
||||
#define EGL_MAP_PRESERVE_PIXELS_KHR 0x30C4 /* eglLockSurfaceKHR attribute */
|
||||
#define EGL_LOCK_USAGE_HINT_KHR 0x30C5 /* eglLockSurfaceKHR attribute */
|
||||
#define EGL_BITMAP_POINTER_KHR 0x30C6 /* eglQuerySurface attribute */
|
||||
#define EGL_BITMAP_PITCH_KHR 0x30C7 /* eglQuerySurface attribute */
|
||||
#define EGL_BITMAP_ORIGIN_KHR 0x30C8 /* eglQuerySurface attribute */
|
||||
#define EGL_BITMAP_PIXEL_RED_OFFSET_KHR 0x30C9 /* eglQuerySurface attribute */
|
||||
#define EGL_BITMAP_PIXEL_GREEN_OFFSET_KHR 0x30CA /* eglQuerySurface attribute */
|
||||
#define EGL_BITMAP_PIXEL_BLUE_OFFSET_KHR 0x30CB /* eglQuerySurface attribute */
|
||||
#define EGL_BITMAP_PIXEL_ALPHA_OFFSET_KHR 0x30CC /* eglQuerySurface attribute */
|
||||
#define EGL_BITMAP_PIXEL_LUMINANCE_OFFSET_KHR 0x30CD /* eglQuerySurface attribute */
|
||||
#define EGL_LOWER_LEFT_KHR 0x30CE /* EGL_BITMAP_ORIGIN_KHR value */
|
||||
#define EGL_UPPER_LEFT_KHR 0x30CF /* EGL_BITMAP_ORIGIN_KHR value */
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglLockSurfaceKHR (EGLDisplay display, EGLSurface surface, const EGLint *attrib_list);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglUnlockSurfaceKHR (EGLDisplay display, EGLSurface surface);
|
||||
#endif /* EGL_EGLEXT_PROTOTYPES */
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLLOCKSURFACEKHRPROC) (EGLDisplay display, EGLSurface surface, const EGLint *attrib_list);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLUNLOCKSURFACEKHRPROC) (EGLDisplay display, EGLSurface surface);
|
||||
#endif
|
||||
|
||||
#ifndef EGL_KHR_image
|
||||
#define EGL_KHR_image 1
|
||||
#define EGL_NATIVE_PIXMAP_KHR 0x30B0 /* eglCreateImageKHR target */
|
||||
typedef void *EGLImageKHR;
|
||||
#define EGL_NO_IMAGE_KHR ((EGLImageKHR)0)
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLImageKHR EGLAPIENTRY eglCreateImageKHR (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglDestroyImageKHR (EGLDisplay dpy, EGLImageKHR image);
|
||||
#endif /* EGL_EGLEXT_PROTOTYPES */
|
||||
typedef EGLImageKHR (EGLAPIENTRYP PFNEGLCREATEIMAGEKHRPROC) (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLint *attrib_list);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYIMAGEKHRPROC) (EGLDisplay dpy, EGLImageKHR image);
|
||||
#endif
|
||||
|
||||
#ifndef EGL_KHR_vg_parent_image
|
||||
#define EGL_KHR_vg_parent_image 1
|
||||
#define EGL_VG_PARENT_IMAGE_KHR 0x30BA /* eglCreateImageKHR target */
|
||||
#endif
|
||||
|
||||
#ifndef EGL_KHR_gl_texture_2D_image
|
||||
#define EGL_KHR_gl_texture_2D_image 1
|
||||
#define EGL_GL_TEXTURE_2D_KHR 0x30B1 /* eglCreateImageKHR target */
|
||||
#define EGL_GL_TEXTURE_LEVEL_KHR 0x30BC /* eglCreateImageKHR attribute */
|
||||
#endif
|
||||
|
||||
#ifndef EGL_KHR_gl_texture_cubemap_image
|
||||
#define EGL_KHR_gl_texture_cubemap_image 1
|
||||
#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X_KHR 0x30B3 /* eglCreateImageKHR target */
|
||||
#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X_KHR 0x30B4 /* eglCreateImageKHR target */
|
||||
#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y_KHR 0x30B5 /* eglCreateImageKHR target */
|
||||
#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_KHR 0x30B6 /* eglCreateImageKHR target */
|
||||
#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z_KHR 0x30B7 /* eglCreateImageKHR target */
|
||||
#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_KHR 0x30B8 /* eglCreateImageKHR target */
|
||||
#endif
|
||||
|
||||
#ifndef EGL_KHR_gl_texture_3D_image
|
||||
#define EGL_KHR_gl_texture_3D_image 1
|
||||
#define EGL_GL_TEXTURE_3D_KHR 0x30B2 /* eglCreateImageKHR target */
|
||||
#define EGL_GL_TEXTURE_ZOFFSET_KHR 0x30BD /* eglCreateImageKHR attribute */
|
||||
#endif
|
||||
|
||||
#ifndef EGL_KHR_gl_renderbuffer_image
|
||||
#define EGL_KHR_gl_renderbuffer_image 1
|
||||
#define EGL_GL_RENDERBUFFER_KHR 0x30B9 /* eglCreateImageKHR target */
|
||||
#endif
|
||||
|
||||
#ifndef EGL_IMG_cl_image
|
||||
#define EGL_IMG_cl_image 1
|
||||
#define EGL_CL_IMAGE_IMG 0x6010 /* experimental eglCreateImageKHR target */
|
||||
#endif
|
||||
|
||||
#ifndef EGL_NOK_image_shared
|
||||
#define EGL_NOK_image_shared 1
|
||||
#define EGL_SHARED_IMAGE_NOK 0x30DA /* eglCreateImageKHR target */
|
||||
typedef void* EGLNativeSharedImageTypeNOK;
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLNativeSharedImageTypeNOK eglCreateSharedImageNOK( EGLDisplay eglDpy, EGLImageKHR eglImage, EGLint *pAttribList);
|
||||
EGLAPI EGLBoolean eglDestroySharedImageNOK(EGLDisplay eglDpy, EGLNativeSharedImageTypeNOK hNOKSharedImage);
|
||||
EGLAPI EGLBoolean eglQueryImageNOK(EGLDisplay eglDpy, EGLImageKHR eglImage, EGLint attribute, EGLint *value);
|
||||
#endif /* EGL_EGLEXT_PROTOTYPES */
|
||||
typedef EGLNativeSharedImageTypeNOK (EGLAPIENTRYP PFNEGLCREATESHAREDIMAGENOKPROC)( EGLDisplay eglDpy, EGLImageKHR eglImage, EGLint *pAttribList);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSHAREDIMAGENOKPROC)(EGLDisplay eglDpy, EGLNativeSharedImageTypeNOK hNOKSharedImage);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYIMAGENOKPROC)(EGLDisplay eglDpy, EGLImageKHR eglImage, EGLint attribute, EGLint *value);
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef EGL_KHR_reusable_sync
|
||||
#define EGL_KHR_reusable_sync 1
|
||||
|
||||
typedef void* EGLSyncKHR;
|
||||
typedef khronos_utime_nanoseconds_t EGLTimeKHR;
|
||||
|
||||
#define EGL_SYNC_STATUS_KHR 0x30F1
|
||||
#define EGL_SIGNALED_KHR 0x30F2
|
||||
#define EGL_UNSIGNALED_KHR 0x30F3
|
||||
#define EGL_TIMEOUT_EXPIRED_KHR 0x30F5
|
||||
#define EGL_CONDITION_SATISFIED_KHR 0x30F6
|
||||
#define EGL_SYNC_TYPE_KHR 0x30F7
|
||||
#define EGL_SYNC_REUSABLE_KHR 0x30FA
|
||||
#define EGL_SYNC_FLUSH_COMMANDS_BIT_KHR 0x0001 /* eglClientWaitSyncKHR <flags> bitfield */
|
||||
#define EGL_FOREVER_KHR 0xFFFFFFFFFFFFFFFFull
|
||||
#define EGL_NO_SYNC_KHR ((EGLSyncKHR)0)
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLSyncKHR EGLAPIENTRY eglCreateSyncKHR(EGLDisplay dpy, EGLenum type, const EGLint *attrib_list);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglDestroySyncKHR(EGLDisplay dpy, EGLSyncKHR sync);
|
||||
EGLAPI EGLint EGLAPIENTRY eglClientWaitSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglSignalSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttribKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value);
|
||||
#endif /* EGL_EGLEXT_PROTOTYPES */
|
||||
typedef EGLSyncKHR (EGLAPIENTRYP PFNEGLCREATESYNCKHRPROC) (EGLDisplay dpy, EGLenum type, const EGLint *attrib_list);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync);
|
||||
typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSIGNALSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value);
|
||||
#endif
|
||||
|
||||
#ifndef EGL_KHR_image_base
|
||||
#define EGL_KHR_image_base 1
|
||||
/* Most interfaces defined by EGL_KHR_image_pixmap above */
|
||||
#define EGL_IMAGE_PRESERVED_KHR 0x30D2 /* eglCreateImageKHR attribute */
|
||||
#endif
|
||||
|
||||
#ifndef EGL_KHR_image_pixmap
|
||||
#define EGL_KHR_image_pixmap 1
|
||||
/* Interfaces defined by EGL_KHR_image above */
|
||||
#endif
|
||||
|
||||
#ifndef EGL_IMG_context_priority
|
||||
#define EGL_IMG_context_priority 1
|
||||
#define EGL_CONTEXT_PRIORITY_LEVEL_IMG 0x3100
|
||||
#define EGL_CONTEXT_PRIORITY_HIGH_IMG 0x3101
|
||||
#define EGL_CONTEXT_PRIORITY_MEDIUM_IMG 0x3102
|
||||
#define EGL_CONTEXT_PRIORITY_LOW_IMG 0x3103
|
||||
#endif
|
||||
|
||||
#ifndef EGL_KHR_lock_surface2
|
||||
#define EGL_KHR_lock_surface2 1
|
||||
#define EGL_BITMAP_PIXEL_SIZE_KHR 0x3110
|
||||
#endif
|
||||
|
||||
#ifndef EGL_NV_coverage_sample
|
||||
#define EGL_NV_coverage_sample 1
|
||||
#define EGL_COVERAGE_BUFFERS_NV 0x30E0
|
||||
#define EGL_COVERAGE_SAMPLES_NV 0x30E1
|
||||
#endif
|
||||
|
||||
#ifndef EGL_NV_depth_nonlinear
|
||||
#define EGL_NV_depth_nonlinear 1
|
||||
#define EGL_DEPTH_ENCODING_NV 0x30E2
|
||||
#define EGL_DEPTH_ENCODING_NONE_NV 0
|
||||
#define EGL_DEPTH_ENCODING_NONLINEAR_NV 0x30E3
|
||||
#endif
|
||||
|
||||
#ifndef EGL_NV_sync
|
||||
#define EGL_NV_sync 1
|
||||
#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_NV 0x30E6
|
||||
#define EGL_SYNC_STATUS_NV 0x30E7
|
||||
#define EGL_SIGNALED_NV 0x30E8
|
||||
#define EGL_UNSIGNALED_NV 0x30E9
|
||||
#define EGL_SYNC_FLUSH_COMMANDS_BIT_NV 0x0001
|
||||
#define EGL_FOREVER_NV 0xFFFFFFFFFFFFFFFFull
|
||||
#define EGL_ALREADY_SIGNALED_NV 0x30EA
|
||||
#define EGL_TIMEOUT_EXPIRED_NV 0x30EB
|
||||
#define EGL_CONDITION_SATISFIED_NV 0x30EC
|
||||
#define EGL_SYNC_TYPE_NV 0x30ED
|
||||
#define EGL_SYNC_CONDITION_NV 0x30EE
|
||||
#define EGL_SYNC_FENCE_NV 0x30EF
|
||||
#define EGL_NO_SYNC_NV ((EGLSyncNV)0)
|
||||
typedef void* EGLSyncNV;
|
||||
typedef khronos_uint64_t EGLTimeNV;
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLSyncNV eglCreateFenceSyncNV (EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list);
|
||||
EGLBoolean eglDestroySyncNV (EGLSyncNV sync);
|
||||
EGLBoolean eglFenceNV (EGLSyncNV sync);
|
||||
EGLint eglClientWaitSyncNV (EGLSyncNV sync, EGLint flags, EGLTimeNV timeout);
|
||||
EGLBoolean eglSignalSyncNV (EGLSyncNV sync, EGLenum mode);
|
||||
EGLBoolean eglGetSyncAttribNV (EGLSyncNV sync, EGLint attribute, EGLint *value);
|
||||
#endif /* EGL_EGLEXT_PROTOTYPES */
|
||||
typedef EGLSyncNV (EGLAPIENTRYP PFNEGLCREATEFENCESYNCNVPROC) (EGLDisplay dpy, EGLenum condition, const EGLint *attrib_list);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCNVPROC) (EGLSyncNV sync);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLFENCENVPROC) (EGLSyncNV sync);
|
||||
typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCNVPROC) (EGLSyncNV sync, EGLint flags, EGLTimeNV timeout);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSIGNALSYNCNVPROC) (EGLSyncNV sync, EGLenum mode);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBNVPROC) (EGLSyncNV sync, EGLint attribute, EGLint *value);
|
||||
#endif
|
||||
|
||||
#ifndef EGL_KHR_fence_sync
|
||||
#define EGL_KHR_fence_sync 1
|
||||
/* Reuses most tokens and entry points from EGL_KHR_reusable_sync */
|
||||
#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_KHR 0x30F0
|
||||
#define EGL_SYNC_CONDITION_KHR 0x30F8
|
||||
#define EGL_SYNC_FENCE_KHR 0x30F9
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(ANDROID)
|
||||
#define EGL_NATIVE_BUFFER_ANDROID 0x3140 /* eglCreateImageKHR target */
|
||||
#define EGL_RECORDABLE_ANDROID 0x3142 /* EGLConfig attribute */
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(EGL_EXTENSION_ANDROID_BLOB_CACHE)
|
||||
|
||||
/*
|
||||
* EGLsizei is a signed integer type for representing the size of a memory
|
||||
* buffer.
|
||||
*/
|
||||
typedef khronos_ssize_t EGLsizei;
|
||||
|
||||
/*
|
||||
* EGLSetBlobFunc is a pointer to an application-provided function that a
|
||||
* client API implementation may use to insert a key/value pair into the
|
||||
* cache.
|
||||
*/
|
||||
typedef void (*EGLSetBlobFunc) (const void* key, EGLsizei keySize,
|
||||
const void* value, EGLsizei valueSize);
|
||||
|
||||
/*
|
||||
* EGLGetBlobFunc is a pointer to an application-provided function that a
|
||||
* client API implementation may use to retrieve a cached value from the
|
||||
* cache.
|
||||
*/
|
||||
typedef EGLsizei (*EGLGetBlobFunc) (const void* key, EGLsizei keySize,
|
||||
void* value, EGLsizei valueSize);
|
||||
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI void EGLAPIENTRY eglSetBlobCacheFuncsANDROID (EGLDisplay display, EGLSetBlobFunc set, EGLGetBlobFunc get);
|
||||
#endif /* EGL_EGLEXT_PROTOTYPES */
|
||||
|
||||
typedef void (EGLAPIENTRYP PFNEGLSETBLOBCACHEFUNCSANDROIDROC) (EGLDisplay display, EGLSetBlobFunc set, EGLGetBlobFunc get);
|
||||
|
||||
#endif /* EGL_EXTENSION_ANDROID_BLOB_CACHE */
|
||||
|
||||
#if defined(EGL_EXTENSION_IMG_EGL_HIBERNATION)
|
||||
#define EGL_HIBERNATED_IMG 0x3104
|
||||
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLHIBERNATEPROCESSIMGPROC) (void);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLAWAKENPROCESSIMGPROC) (void);
|
||||
#if defined(EGL_EGLEXT_PROTOTYPES)
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglHibernateProcessIMG(void);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglAwakenProcessIMG(void);
|
||||
#endif /* EGL_EGLEXT_PROTOTYPES */
|
||||
#endif /* EGL_EXTENSION_IMG_EGL_HIBERNATION */
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __drveglext_h_ */
|
170
include/EGL/eglplatform.h
Normal file
@ -0,0 +1,170 @@
|
||||
/***********************************************************************
|
||||
<module>
|
||||
* Name : drveglplatform.h
|
||||
* Title : Platform defines for EGL.
|
||||
* Author : Ben Bowman
|
||||
* Created : 7 Nov 2006
|
||||
*
|
||||
* Copyright : 2003-2006 by Imagination Technologies Limited.
|
||||
* All rights reserved. No part of this software, either
|
||||
* material or conceptual may be copied or distributed,
|
||||
* transmitted, transcribed, stored in a retrieval system
|
||||
* or translated into any human or computer language in any
|
||||
* form by any means, electronic, mechanical, manual or
|
||||
* other-wise, or disclosed to third parties without the
|
||||
* express written permission of Imagination Technologies
|
||||
* Limited, Unit 8, HomePark Industrial Estate,
|
||||
* King's Langley, Hertfordshire, WD4 8LZ, U.K.
|
||||
*
|
||||
* Description : Type definitions exported by Khronos EGL.
|
||||
*
|
||||
* Platform : ALL
|
||||
*
|
||||
* $Log: drveglplatform.h $
|
||||
***********************************************************************/
|
||||
|
||||
#ifndef _drveglplatform_h_
|
||||
#define _drveglplatform_h_
|
||||
|
||||
#include "KHR/khrplatform.h"
|
||||
|
||||
#if !defined(IMG_EXPORT)
|
||||
#define IMG_EXPORT
|
||||
#endif
|
||||
|
||||
/* Windows calling convention boilerplate */
|
||||
|
||||
#if defined(LINUX)
|
||||
#include <stdint.h>
|
||||
#else
|
||||
typedef int int32_t;
|
||||
#endif
|
||||
|
||||
/* Macros used in EGL function prototype declarations.
|
||||
*
|
||||
* EGL functions should be prototyped as:
|
||||
*
|
||||
* EGLAPI return-type EGLAPIENTRY eglFunction(arguments);
|
||||
* typedef return-type (EXPAPIENTRYP PFNEGLFUNCTIONPROC) (arguments);
|
||||
*
|
||||
* KHRONOS_APICALL and KHRONOS_APIENTRY are defined in KHR/khrplatform.h
|
||||
*/
|
||||
|
||||
#ifndef EGLAPI
|
||||
#define EGLAPI IMG_EXPORT
|
||||
#endif
|
||||
|
||||
/* On Windows, EGLAPIENTRY can be defined like APIENTRY.
|
||||
* On most other platforms, it should be empty.
|
||||
*/
|
||||
#if defined(APIENTRY) && !defined(__psp2__)
|
||||
#define EGLAPIENTRY APIENTRY
|
||||
#else
|
||||
#define EGLAPIENTRY
|
||||
#endif
|
||||
|
||||
#define EGLAPIENTRYP EGLAPIENTRY*
|
||||
|
||||
/* The types NativeDisplayType, NativeWindowType, and NativePixmapType
|
||||
* are aliases of window-system-dependent types, such as X Display * or
|
||||
* Windows Device Context. They must be defined in platform-specific
|
||||
* code below. The EGL-prefixed versions of Native*Type are the same
|
||||
* types, renamed in EGL 1.3 so all types in the API start with "EGL".
|
||||
*/
|
||||
#if defined(SUPPORT_X11)
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
|
||||
typedef Display* NativeDisplayType;
|
||||
typedef Window NativeWindowType;
|
||||
typedef Pixmap NativePixmapType;
|
||||
|
||||
#else
|
||||
|
||||
#if defined(SUPPORT_WINCEWS)
|
||||
|
||||
typedef HDC NativeDisplayType;
|
||||
typedef HWND NativeWindowType;
|
||||
typedef HBITMAP NativePixmapType;
|
||||
|
||||
#else
|
||||
|
||||
#if defined(__psp2__)
|
||||
|
||||
typedef enum Psp2DrawableType
|
||||
{
|
||||
PSP2_DRAWABLE_TYPE_UNKNOWN,
|
||||
PSP2_DRAWABLE_TYPE_WINDOW,
|
||||
PSP2_DRAWABLE_TYPE_PIXMAP
|
||||
} Psp2DrawableType;
|
||||
|
||||
typedef enum Psp2WindowSize
|
||||
{
|
||||
PSP2_WINDOW_960X544,
|
||||
PSP2_WINDOW_480X272,
|
||||
PSP2_WINDOW_640X368,
|
||||
PSP2_WINDOW_720X408,
|
||||
PSP2_WINDOW_1280X725,
|
||||
PSP2_WINDOW_1920X1088
|
||||
} Psp2WindowSize;
|
||||
|
||||
typedef struct Psp2NativeWindow
|
||||
{
|
||||
unsigned int type;
|
||||
unsigned int windowSize;
|
||||
unsigned int numFlipBuffers;
|
||||
unsigned int flipChainThrdAffinity;
|
||||
|
||||
unsigned int swapChainId;
|
||||
void *swapChain;
|
||||
void *psConnection;
|
||||
unsigned int ahSwapChainBuffers[4]; //PSP2_SWAPCHAIN_MAX_BUFFER_NUM
|
||||
void *apsSwapBufferMemInfo[4]; //PSP2_SWAPCHAIN_MAX_BUFFER_NUM
|
||||
void *psDevData;
|
||||
unsigned int hDevMemContext;
|
||||
unsigned int currBufIdx;
|
||||
unsigned int swapInterval;
|
||||
} Psp2NativeWindow;
|
||||
|
||||
typedef struct Psp2NativePixmap
|
||||
{
|
||||
Psp2DrawableType type;
|
||||
unsigned int sizeX;
|
||||
unsigned int sizeY;
|
||||
unsigned int memType;
|
||||
|
||||
SceUID memUID;
|
||||
void *memBase;
|
||||
void *psDevData;
|
||||
unsigned int hDevMemContext;
|
||||
} Psp2NativePixmap;
|
||||
|
||||
typedef int NativeDisplayType;
|
||||
typedef Psp2NativeWindow *NativeWindowType;
|
||||
typedef Psp2NativePixmap *NativePixmapType;
|
||||
|
||||
#else
|
||||
|
||||
typedef int NativeDisplayType;
|
||||
typedef void *NativeWindowType;
|
||||
typedef void *NativePixmapType;
|
||||
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* EGL 1.2 types, renamed for consistency in EGL 1.3 */
|
||||
typedef NativeDisplayType EGLNativeDisplayType;
|
||||
typedef NativePixmapType EGLNativePixmapType;
|
||||
typedef NativeWindowType EGLNativeWindowType;
|
||||
|
||||
/* Define EGLint. This must be a signed integral type large enough to contain
|
||||
* all legal attribute names and values passed into and out of EGL, whether
|
||||
* their type is boolean, bitmask, enumerant (symbolic constant), integer,
|
||||
* handle, or other. While in general a 32-bit integer will suffice, if
|
||||
* handles are 64 bit types, then EGLint should be defined as a signed 64-bit
|
||||
* integer type.
|
||||
*/
|
||||
typedef khronos_int32_t EGLint;
|
||||
|
||||
#endif /* _drveglplatform_h_ */
|
621
include/GLES2/gl2.h
Normal file
@ -0,0 +1,621 @@
|
||||
#ifndef __drvgl2_h_
|
||||
#define __drvgl2_h_
|
||||
|
||||
/* Based on khronos subversion 11779 */
|
||||
|
||||
#include "gl2platform.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* This document is licensed under the SGI Free Software B License Version
|
||||
* 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
|
||||
*/
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Data type definitions
|
||||
*-----------------------------------------------------------------------*/
|
||||
|
||||
typedef void GLvoid;
|
||||
typedef char GLchar;
|
||||
typedef unsigned int GLenum;
|
||||
typedef unsigned char GLboolean;
|
||||
typedef unsigned int GLbitfield;
|
||||
typedef khronos_int8_t GLbyte;
|
||||
typedef short GLshort;
|
||||
typedef int GLint;
|
||||
typedef int GLsizei;
|
||||
typedef khronos_uint8_t GLubyte;
|
||||
typedef unsigned short GLushort;
|
||||
typedef unsigned int GLuint;
|
||||
typedef khronos_float_t GLfloat;
|
||||
typedef khronos_float_t GLclampf;
|
||||
typedef khronos_int32_t GLfixed;
|
||||
|
||||
/* GL types for handling large vertex buffer objects */
|
||||
typedef khronos_intptr_t GLintptr;
|
||||
typedef khronos_ssize_t GLsizeiptr;
|
||||
|
||||
/* OpenGL ES core versions */
|
||||
#define GL_ES_VERSION_2_0 1
|
||||
|
||||
/* ClearBufferMask */
|
||||
#define GL_DEPTH_BUFFER_BIT 0x00000100
|
||||
#define GL_STENCIL_BUFFER_BIT 0x00000400
|
||||
#define GL_COLOR_BUFFER_BIT 0x00004000
|
||||
|
||||
/* Boolean */
|
||||
#define GL_FALSE 0
|
||||
#define GL_TRUE 1
|
||||
|
||||
/* BeginMode */
|
||||
#define GL_POINTS 0x0000
|
||||
#define GL_LINES 0x0001
|
||||
#define GL_LINE_LOOP 0x0002
|
||||
#define GL_LINE_STRIP 0x0003
|
||||
#define GL_TRIANGLES 0x0004
|
||||
#define GL_TRIANGLE_STRIP 0x0005
|
||||
#define GL_TRIANGLE_FAN 0x0006
|
||||
|
||||
/* AlphaFunction (not supported in ES20) */
|
||||
/* GL_NEVER */
|
||||
/* GL_LESS */
|
||||
/* GL_EQUAL */
|
||||
/* GL_LEQUAL */
|
||||
/* GL_GREATER */
|
||||
/* GL_NOTEQUAL */
|
||||
/* GL_GEQUAL */
|
||||
/* GL_ALWAYS */
|
||||
|
||||
/* BlendingFactorDest */
|
||||
#define GL_ZERO 0
|
||||
#define GL_ONE 1
|
||||
#define GL_SRC_COLOR 0x0300
|
||||
#define GL_ONE_MINUS_SRC_COLOR 0x0301
|
||||
#define GL_SRC_ALPHA 0x0302
|
||||
#define GL_ONE_MINUS_SRC_ALPHA 0x0303
|
||||
#define GL_DST_ALPHA 0x0304
|
||||
#define GL_ONE_MINUS_DST_ALPHA 0x0305
|
||||
|
||||
/* BlendingFactorSrc */
|
||||
/* GL_ZERO */
|
||||
/* GL_ONE */
|
||||
#define GL_DST_COLOR 0x0306
|
||||
#define GL_ONE_MINUS_DST_COLOR 0x0307
|
||||
#define GL_SRC_ALPHA_SATURATE 0x0308
|
||||
/* GL_SRC_ALPHA */
|
||||
/* GL_ONE_MINUS_SRC_ALPHA */
|
||||
/* GL_DST_ALPHA */
|
||||
/* GL_ONE_MINUS_DST_ALPHA */
|
||||
|
||||
/* BlendEquationSeparate */
|
||||
#define GL_FUNC_ADD 0x8006
|
||||
#define GL_BLEND_EQUATION 0x8009
|
||||
#define GL_BLEND_EQUATION_RGB 0x8009 /* same as BLEND_EQUATION */
|
||||
#define GL_BLEND_EQUATION_ALPHA 0x883D
|
||||
|
||||
/* BlendSubtract */
|
||||
#define GL_FUNC_SUBTRACT 0x800A
|
||||
#define GL_FUNC_REVERSE_SUBTRACT 0x800B
|
||||
|
||||
/* Separate Blend Functions */
|
||||
#define GL_BLEND_DST_RGB 0x80C8
|
||||
#define GL_BLEND_SRC_RGB 0x80C9
|
||||
#define GL_BLEND_DST_ALPHA 0x80CA
|
||||
#define GL_BLEND_SRC_ALPHA 0x80CB
|
||||
#define GL_CONSTANT_COLOR 0x8001
|
||||
#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002
|
||||
#define GL_CONSTANT_ALPHA 0x8003
|
||||
#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
|
||||
#define GL_BLEND_COLOR 0x8005
|
||||
|
||||
/* Buffer Objects */
|
||||
#define GL_ARRAY_BUFFER 0x8892
|
||||
#define GL_ELEMENT_ARRAY_BUFFER 0x8893
|
||||
#define GL_ARRAY_BUFFER_BINDING 0x8894
|
||||
#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895
|
||||
|
||||
#define GL_STREAM_DRAW 0x88E0
|
||||
#define GL_STATIC_DRAW 0x88E4
|
||||
#define GL_DYNAMIC_DRAW 0x88E8
|
||||
|
||||
#define GL_BUFFER_SIZE 0x8764
|
||||
#define GL_BUFFER_USAGE 0x8765
|
||||
|
||||
#define GL_CURRENT_VERTEX_ATTRIB 0x8626
|
||||
|
||||
/* CullFaceMode */
|
||||
#define GL_FRONT 0x0404
|
||||
#define GL_BACK 0x0405
|
||||
#define GL_FRONT_AND_BACK 0x0408
|
||||
|
||||
/* DepthFunction */
|
||||
/* GL_NEVER */
|
||||
/* GL_LESS */
|
||||
/* GL_EQUAL */
|
||||
/* GL_LEQUAL */
|
||||
/* GL_GREATER */
|
||||
/* GL_NOTEQUAL */
|
||||
/* GL_GEQUAL */
|
||||
/* GL_ALWAYS */
|
||||
|
||||
/* EnableCap */
|
||||
#define GL_TEXTURE_2D 0x0DE1
|
||||
#define GL_CULL_FACE 0x0B44
|
||||
#define GL_BLEND 0x0BE2
|
||||
#define GL_DITHER 0x0BD0
|
||||
#define GL_STENCIL_TEST 0x0B90
|
||||
#define GL_DEPTH_TEST 0x0B71
|
||||
#define GL_SCISSOR_TEST 0x0C11
|
||||
#define GL_POLYGON_OFFSET_FILL 0x8037
|
||||
#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
|
||||
#define GL_SAMPLE_COVERAGE 0x80A0
|
||||
|
||||
/* ErrorCode */
|
||||
#define GL_NO_ERROR 0
|
||||
#define GL_INVALID_ENUM 0x0500
|
||||
#define GL_INVALID_VALUE 0x0501
|
||||
#define GL_INVALID_OPERATION 0x0502
|
||||
#define GL_OUT_OF_MEMORY 0x0505
|
||||
|
||||
/* FrontFaceDirection */
|
||||
#define GL_CW 0x0900
|
||||
#define GL_CCW 0x0901
|
||||
|
||||
/* GetPName */
|
||||
#define GL_LINE_WIDTH 0x0B21
|
||||
#define GL_ALIASED_POINT_SIZE_RANGE 0x846D
|
||||
#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
|
||||
#define GL_CULL_FACE_MODE 0x0B45
|
||||
#define GL_FRONT_FACE 0x0B46
|
||||
#define GL_DEPTH_RANGE 0x0B70
|
||||
#define GL_DEPTH_WRITEMASK 0x0B72
|
||||
#define GL_DEPTH_CLEAR_VALUE 0x0B73
|
||||
#define GL_DEPTH_FUNC 0x0B74
|
||||
#define GL_STENCIL_CLEAR_VALUE 0x0B91
|
||||
#define GL_STENCIL_FUNC 0x0B92
|
||||
#define GL_STENCIL_FAIL 0x0B94
|
||||
#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95
|
||||
#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96
|
||||
#define GL_STENCIL_REF 0x0B97
|
||||
#define GL_STENCIL_VALUE_MASK 0x0B93
|
||||
#define GL_STENCIL_WRITEMASK 0x0B98
|
||||
#define GL_STENCIL_BACK_FUNC 0x8800
|
||||
#define GL_STENCIL_BACK_FAIL 0x8801
|
||||
#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802
|
||||
#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803
|
||||
#define GL_STENCIL_BACK_REF 0x8CA3
|
||||
#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4
|
||||
#define GL_STENCIL_BACK_WRITEMASK 0x8CA5
|
||||
#define GL_VIEWPORT 0x0BA2
|
||||
#define GL_SCISSOR_BOX 0x0C10
|
||||
/* GL_SCISSOR_TEST */
|
||||
#define GL_COLOR_CLEAR_VALUE 0x0C22
|
||||
#define GL_COLOR_WRITEMASK 0x0C23
|
||||
#define GL_UNPACK_ALIGNMENT 0x0CF5
|
||||
#define GL_PACK_ALIGNMENT 0x0D05
|
||||
#define GL_MAX_TEXTURE_SIZE 0x0D33
|
||||
#define GL_MAX_VIEWPORT_DIMS 0x0D3A
|
||||
#define GL_SUBPIXEL_BITS 0x0D50
|
||||
#define GL_RED_BITS 0x0D52
|
||||
#define GL_GREEN_BITS 0x0D53
|
||||
#define GL_BLUE_BITS 0x0D54
|
||||
#define GL_ALPHA_BITS 0x0D55
|
||||
#define GL_DEPTH_BITS 0x0D56
|
||||
#define GL_STENCIL_BITS 0x0D57
|
||||
#define GL_POLYGON_OFFSET_UNITS 0x2A00
|
||||
/* GL_POLYGON_OFFSET_FILL */
|
||||
#define GL_POLYGON_OFFSET_FACTOR 0x8038
|
||||
#define GL_TEXTURE_BINDING_2D 0x8069
|
||||
#define GL_SAMPLE_BUFFERS 0x80A8
|
||||
#define GL_SAMPLES 0x80A9
|
||||
#define GL_SAMPLE_COVERAGE_VALUE 0x80AA
|
||||
#define GL_SAMPLE_COVERAGE_INVERT 0x80AB
|
||||
|
||||
/* GetTextureParameter */
|
||||
/* GL_TEXTURE_MAG_FILTER */
|
||||
/* GL_TEXTURE_MIN_FILTER */
|
||||
/* GL_TEXTURE_WRAP_S */
|
||||
/* GL_TEXTURE_WRAP_T */
|
||||
|
||||
#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
|
||||
#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
|
||||
|
||||
/* HintMode */
|
||||
#define GL_DONT_CARE 0x1100
|
||||
#define GL_FASTEST 0x1101
|
||||
#define GL_NICEST 0x1102
|
||||
|
||||
/* HintTarget */
|
||||
#define GL_GENERATE_MIPMAP_HINT 0x8192
|
||||
|
||||
/* DataType */
|
||||
#define GL_BYTE 0x1400
|
||||
#define GL_UNSIGNED_BYTE 0x1401
|
||||
#define GL_SHORT 0x1402
|
||||
#define GL_UNSIGNED_SHORT 0x1403
|
||||
#define GL_INT 0x1404
|
||||
#define GL_UNSIGNED_INT 0x1405
|
||||
#define GL_FLOAT 0x1406
|
||||
#define GL_FIXED 0x140C
|
||||
|
||||
/* PixelFormat */
|
||||
#define GL_DEPTH_COMPONENT 0x1902
|
||||
#define GL_ALPHA 0x1906
|
||||
#define GL_RGB 0x1907
|
||||
#define GL_RGBA 0x1908
|
||||
#define GL_LUMINANCE 0x1909
|
||||
#define GL_LUMINANCE_ALPHA 0x190A
|
||||
|
||||
/* PixelType */
|
||||
/* GL_UNSIGNED_BYTE */
|
||||
#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
|
||||
#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
|
||||
#define GL_UNSIGNED_SHORT_5_6_5 0x8363
|
||||
|
||||
/* Shaders */
|
||||
#define GL_FRAGMENT_SHADER 0x8B30
|
||||
#define GL_VERTEX_SHADER 0x8B31
|
||||
#define GL_MAX_VERTEX_ATTRIBS 0x8869
|
||||
#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB
|
||||
#define GL_MAX_VARYING_VECTORS 0x8DFC
|
||||
#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D
|
||||
#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C
|
||||
#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872
|
||||
#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD
|
||||
#define GL_SHADER_TYPE 0x8B4F
|
||||
#define GL_DELETE_STATUS 0x8B80
|
||||
#define GL_LINK_STATUS 0x8B82
|
||||
#define GL_VALIDATE_STATUS 0x8B83
|
||||
#define GL_ATTACHED_SHADERS 0x8B85
|
||||
#define GL_ACTIVE_UNIFORMS 0x8B86
|
||||
#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87
|
||||
#define GL_ACTIVE_ATTRIBUTES 0x8B89
|
||||
#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A
|
||||
#define GL_SHADING_LANGUAGE_VERSION 0x8B8C
|
||||
#define GL_CURRENT_PROGRAM 0x8B8D
|
||||
|
||||
/* StencilFunction */
|
||||
#define GL_NEVER 0x0200
|
||||
#define GL_LESS 0x0201
|
||||
#define GL_EQUAL 0x0202
|
||||
#define GL_LEQUAL 0x0203
|
||||
#define GL_GREATER 0x0204
|
||||
#define GL_NOTEQUAL 0x0205
|
||||
#define GL_GEQUAL 0x0206
|
||||
#define GL_ALWAYS 0x0207
|
||||
|
||||
/* StencilOp */
|
||||
/* GL_ZERO */
|
||||
#define GL_KEEP 0x1E00
|
||||
#define GL_REPLACE 0x1E01
|
||||
#define GL_INCR 0x1E02
|
||||
#define GL_DECR 0x1E03
|
||||
#define GL_INVERT 0x150A
|
||||
#define GL_INCR_WRAP 0x8507
|
||||
#define GL_DECR_WRAP 0x8508
|
||||
|
||||
/* StringName */
|
||||
#define GL_VENDOR 0x1F00
|
||||
#define GL_RENDERER 0x1F01
|
||||
#define GL_VERSION 0x1F02
|
||||
#define GL_EXTENSIONS 0x1F03
|
||||
|
||||
/* TextureMagFilter */
|
||||
#define GL_NEAREST 0x2600
|
||||
#define GL_LINEAR 0x2601
|
||||
|
||||
/* TextureMinFilter */
|
||||
/* GL_NEAREST */
|
||||
/* GL_LINEAR */
|
||||
#define GL_NEAREST_MIPMAP_NEAREST 0x2700
|
||||
#define GL_LINEAR_MIPMAP_NEAREST 0x2701
|
||||
#define GL_NEAREST_MIPMAP_LINEAR 0x2702
|
||||
#define GL_LINEAR_MIPMAP_LINEAR 0x2703
|
||||
|
||||
/* TextureParameterName */
|
||||
#define GL_TEXTURE_MAG_FILTER 0x2800
|
||||
#define GL_TEXTURE_MIN_FILTER 0x2801
|
||||
#define GL_TEXTURE_WRAP_S 0x2802
|
||||
#define GL_TEXTURE_WRAP_T 0x2803
|
||||
|
||||
/* TextureTarget */
|
||||
/* GL_TEXTURE_2D */
|
||||
#define GL_TEXTURE 0x1702
|
||||
|
||||
#define GL_TEXTURE_CUBE_MAP 0x8513
|
||||
#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514
|
||||
#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515
|
||||
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516
|
||||
#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517
|
||||
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518
|
||||
#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519
|
||||
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A
|
||||
#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C
|
||||
|
||||
/* TextureUnit */
|
||||
#define GL_TEXTURE0 0x84C0
|
||||
#define GL_TEXTURE1 0x84C1
|
||||
#define GL_TEXTURE2 0x84C2
|
||||
#define GL_TEXTURE3 0x84C3
|
||||
#define GL_TEXTURE4 0x84C4
|
||||
#define GL_TEXTURE5 0x84C5
|
||||
#define GL_TEXTURE6 0x84C6
|
||||
#define GL_TEXTURE7 0x84C7
|
||||
#define GL_TEXTURE8 0x84C8
|
||||
#define GL_TEXTURE9 0x84C9
|
||||
#define GL_TEXTURE10 0x84CA
|
||||
#define GL_TEXTURE11 0x84CB
|
||||
#define GL_TEXTURE12 0x84CC
|
||||
#define GL_TEXTURE13 0x84CD
|
||||
#define GL_TEXTURE14 0x84CE
|
||||
#define GL_TEXTURE15 0x84CF
|
||||
#define GL_TEXTURE16 0x84D0
|
||||
#define GL_TEXTURE17 0x84D1
|
||||
#define GL_TEXTURE18 0x84D2
|
||||
#define GL_TEXTURE19 0x84D3
|
||||
#define GL_TEXTURE20 0x84D4
|
||||
#define GL_TEXTURE21 0x84D5
|
||||
#define GL_TEXTURE22 0x84D6
|
||||
#define GL_TEXTURE23 0x84D7
|
||||
#define GL_TEXTURE24 0x84D8
|
||||
#define GL_TEXTURE25 0x84D9
|
||||
#define GL_TEXTURE26 0x84DA
|
||||
#define GL_TEXTURE27 0x84DB
|
||||
#define GL_TEXTURE28 0x84DC
|
||||
#define GL_TEXTURE29 0x84DD
|
||||
#define GL_TEXTURE30 0x84DE
|
||||
#define GL_TEXTURE31 0x84DF
|
||||
#define GL_ACTIVE_TEXTURE 0x84E0
|
||||
|
||||
/* TextureWrapMode */
|
||||
#define GL_REPEAT 0x2901
|
||||
#define GL_CLAMP_TO_EDGE 0x812F
|
||||
#define GL_MIRRORED_REPEAT 0x8370
|
||||
|
||||
/* Uniform Types */
|
||||
#define GL_FLOAT_VEC2 0x8B50
|
||||
#define GL_FLOAT_VEC3 0x8B51
|
||||
#define GL_FLOAT_VEC4 0x8B52
|
||||
#define GL_INT_VEC2 0x8B53
|
||||
#define GL_INT_VEC3 0x8B54
|
||||
#define GL_INT_VEC4 0x8B55
|
||||
#define GL_BOOL 0x8B56
|
||||
#define GL_BOOL_VEC2 0x8B57
|
||||
#define GL_BOOL_VEC3 0x8B58
|
||||
#define GL_BOOL_VEC4 0x8B59
|
||||
#define GL_FLOAT_MAT2 0x8B5A
|
||||
#define GL_FLOAT_MAT3 0x8B5B
|
||||
#define GL_FLOAT_MAT4 0x8B5C
|
||||
#define GL_SAMPLER_2D 0x8B5E
|
||||
#define GL_SAMPLER_CUBE 0x8B60
|
||||
|
||||
/* Vertex Arrays */
|
||||
#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622
|
||||
#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623
|
||||
#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624
|
||||
#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625
|
||||
#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A
|
||||
#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645
|
||||
#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F
|
||||
|
||||
/* Read Format */
|
||||
#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A
|
||||
#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B
|
||||
|
||||
/* Shader Source */
|
||||
#define GL_COMPILE_STATUS 0x8B81
|
||||
#define GL_INFO_LOG_LENGTH 0x8B84
|
||||
#define GL_SHADER_SOURCE_LENGTH 0x8B88
|
||||
#define GL_SHADER_COMPILER 0x8DFA
|
||||
|
||||
/* Shader Binary */
|
||||
#define GL_SHADER_BINARY_FORMATS 0x8DF8
|
||||
#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9
|
||||
|
||||
/* Shader Precision-Specified Types */
|
||||
#define GL_LOW_FLOAT 0x8DF0
|
||||
#define GL_MEDIUM_FLOAT 0x8DF1
|
||||
#define GL_HIGH_FLOAT 0x8DF2
|
||||
#define GL_LOW_INT 0x8DF3
|
||||
#define GL_MEDIUM_INT 0x8DF4
|
||||
#define GL_HIGH_INT 0x8DF5
|
||||
|
||||
/* Framebuffer Object. */
|
||||
#define GL_FRAMEBUFFER 0x8D40
|
||||
#define GL_RENDERBUFFER 0x8D41
|
||||
|
||||
#define GL_RGBA4 0x8056
|
||||
#define GL_RGB5_A1 0x8057
|
||||
#define GL_RGB565 0x8D62
|
||||
#define GL_DEPTH_COMPONENT16 0x81A5
|
||||
#define GL_STENCIL_INDEX 0x1901
|
||||
#define GL_STENCIL_INDEX8 0x8D48
|
||||
|
||||
#define GL_RENDERBUFFER_WIDTH 0x8D42
|
||||
#define GL_RENDERBUFFER_HEIGHT 0x8D43
|
||||
#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44
|
||||
#define GL_RENDERBUFFER_RED_SIZE 0x8D50
|
||||
#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51
|
||||
#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52
|
||||
#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53
|
||||
#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54
|
||||
#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55
|
||||
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3
|
||||
|
||||
#define GL_COLOR_ATTACHMENT0 0x8CE0
|
||||
#define GL_DEPTH_ATTACHMENT 0x8D00
|
||||
#define GL_STENCIL_ATTACHMENT 0x8D20
|
||||
|
||||
#define GL_NONE 0
|
||||
|
||||
#define GL_FRAMEBUFFER_COMPLETE 0x8CD5
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS 0x8CD9
|
||||
#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD
|
||||
|
||||
#define GL_FRAMEBUFFER_BINDING 0x8CA6
|
||||
#define GL_RENDERBUFFER_BINDING 0x8CA7
|
||||
#define GL_MAX_RENDERBUFFER_SIZE 0x84E8
|
||||
|
||||
#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* GL core functions.
|
||||
*-----------------------------------------------------------------------*/
|
||||
|
||||
GL_APICALL void GL_APIENTRY glActiveTexture (GLenum texture);
|
||||
GL_APICALL void GL_APIENTRY glAttachShader (GLuint program, GLuint shader);
|
||||
GL_APICALL void GL_APIENTRY glBindAttribLocation (GLuint program, GLuint index, const GLchar* name);
|
||||
GL_APICALL void GL_APIENTRY glBindBuffer (GLenum target, GLuint buffer);
|
||||
GL_APICALL void GL_APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer);
|
||||
GL_APICALL void GL_APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer);
|
||||
GL_APICALL void GL_APIENTRY glBindTexture (GLenum target, GLuint texture);
|
||||
GL_APICALL void GL_APIENTRY glBlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
|
||||
GL_APICALL void GL_APIENTRY glBlendEquation( GLenum mode );
|
||||
GL_APICALL void GL_APIENTRY glBlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha);
|
||||
GL_APICALL void GL_APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor);
|
||||
GL_APICALL void GL_APIENTRY glBlendFuncSeparate (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
|
||||
GL_APICALL void GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage);
|
||||
GL_APICALL void GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data);
|
||||
GL_APICALL GLenum GL_APIENTRY glCheckFramebufferStatus (GLenum target);
|
||||
GL_APICALL void GL_APIENTRY glClear (GLbitfield mask);
|
||||
GL_APICALL void GL_APIENTRY glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
|
||||
GL_APICALL void GL_APIENTRY glClearDepthf (GLclampf depth);
|
||||
GL_APICALL void GL_APIENTRY glClearStencil (GLint s);
|
||||
GL_APICALL void GL_APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
|
||||
GL_APICALL void GL_APIENTRY glCompileShader (GLuint shader);
|
||||
GL_APICALL void GL_APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data);
|
||||
GL_APICALL void GL_APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data);
|
||||
GL_APICALL void GL_APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
|
||||
GL_APICALL void GL_APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
GL_APICALL GLuint GL_APIENTRY glCreateProgram (void);
|
||||
GL_APICALL GLuint GL_APIENTRY glCreateShader (GLenum type);
|
||||
GL_APICALL void GL_APIENTRY glCullFace (GLenum mode);
|
||||
GL_APICALL void GL_APIENTRY glDeleteBuffers (GLsizei n, const GLuint *buffers);
|
||||
GL_APICALL void GL_APIENTRY glDeleteFramebuffers (GLsizei n, const GLuint* framebuffers);
|
||||
GL_APICALL void GL_APIENTRY glDeleteProgram (GLuint program);
|
||||
GL_APICALL void GL_APIENTRY glDeleteRenderbuffers (GLsizei n, const GLuint* renderbuffers);
|
||||
GL_APICALL void GL_APIENTRY glDeleteShader (GLuint shader);
|
||||
GL_APICALL void GL_APIENTRY glDeleteTextures (GLsizei n, const GLuint* textures);
|
||||
GL_APICALL void GL_APIENTRY glDepthFunc (GLenum func);
|
||||
GL_APICALL void GL_APIENTRY glDepthMask (GLboolean flag);
|
||||
GL_APICALL void GL_APIENTRY glDepthRangef (GLclampf zNear, GLclampf zFar);
|
||||
GL_APICALL void GL_APIENTRY glDetachShader (GLuint program, GLuint shader);
|
||||
GL_APICALL void GL_APIENTRY glDisable (GLenum cap);
|
||||
GL_APICALL void GL_APIENTRY glDisableVertexAttribArray (GLuint index);
|
||||
GL_APICALL void GL_APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count);
|
||||
GL_APICALL void GL_APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const GLvoid* indices);
|
||||
GL_APICALL void GL_APIENTRY glEnable (GLenum cap);
|
||||
GL_APICALL void GL_APIENTRY glEnableVertexAttribArray (GLuint index);
|
||||
GL_APICALL void GL_APIENTRY glFinish (void);
|
||||
GL_APICALL void GL_APIENTRY glFlush (void);
|
||||
GL_APICALL void GL_APIENTRY glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
|
||||
GL_APICALL void GL_APIENTRY glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
|
||||
GL_APICALL void GL_APIENTRY glFrontFace (GLenum mode);
|
||||
GL_APICALL void GL_APIENTRY glGenBuffers (GLsizei n, GLuint* buffers);
|
||||
GL_APICALL void GL_APIENTRY glGenerateMipmap (GLenum target);
|
||||
GL_APICALL void GL_APIENTRY glGenFramebuffers (GLsizei n, GLuint* framebuffers);
|
||||
GL_APICALL void GL_APIENTRY glGenRenderbuffers (GLsizei n, GLuint* renderbuffers);
|
||||
GL_APICALL void GL_APIENTRY glGenTextures (GLsizei n, GLuint* textures);
|
||||
GL_APICALL void GL_APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name);
|
||||
GL_APICALL void GL_APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name);
|
||||
GL_APICALL void GL_APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxcount, GLsizei *count, GLuint *shaders);
|
||||
GL_APICALL int GL_APIENTRY glGetAttribLocation (GLuint program, const GLchar* name);
|
||||
GL_APICALL void GL_APIENTRY glGetBooleanv (GLenum pname, GLboolean *params);
|
||||
GL_APICALL void GL_APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params);
|
||||
GL_APICALL GLenum GL_APIENTRY glGetError (void);
|
||||
GL_APICALL void GL_APIENTRY glGetFloatv (GLenum pname, GLfloat *params);
|
||||
GL_APICALL void GL_APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint* params);
|
||||
GL_APICALL void GL_APIENTRY glGetIntegerv (GLenum pname, GLint *params);
|
||||
GL_APICALL void GL_APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint *params);
|
||||
GL_APICALL void GL_APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog);
|
||||
GL_APICALL void GL_APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint* params);
|
||||
GL_APICALL void GL_APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint* params);
|
||||
GL_APICALL void GL_APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog);
|
||||
GL_APICALL void GL_APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision);
|
||||
GL_APICALL void GL_APIENTRY glGetShaderSource (GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source);
|
||||
GL_APICALL const GLubyte * GL_APIENTRY glGetString (GLenum name);
|
||||
GL_APICALL void GL_APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params);
|
||||
GL_APICALL void GL_APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint* params);
|
||||
GL_APICALL void GL_APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat *params);
|
||||
GL_APICALL void GL_APIENTRY glGetUniformiv (GLuint program, GLint location, GLint *params);
|
||||
GL_APICALL int GL_APIENTRY glGetUniformLocation (GLuint program, const GLchar* name);
|
||||
GL_APICALL void GL_APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat *params);
|
||||
GL_APICALL void GL_APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint *params);
|
||||
GL_APICALL void GL_APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, GLvoid** pointer);
|
||||
GL_APICALL void GL_APIENTRY glHint (GLenum target, GLenum mode);
|
||||
GL_APICALL GLboolean GL_APIENTRY glIsBuffer (GLuint buffer);
|
||||
GL_APICALL GLboolean GL_APIENTRY glIsEnabled (GLenum cap);
|
||||
GL_APICALL GLboolean GL_APIENTRY glIsFramebuffer (GLuint framebuffer);
|
||||
GL_APICALL GLboolean GL_APIENTRY glIsProgram (GLuint program);
|
||||
GL_APICALL GLboolean GL_APIENTRY glIsRenderbuffer (GLuint renderbuffer);
|
||||
GL_APICALL GLboolean GL_APIENTRY glIsShader (GLuint shader);
|
||||
GL_APICALL GLboolean GL_APIENTRY glIsTexture (GLuint texture);
|
||||
GL_APICALL void GL_APIENTRY glLineWidth (GLfloat width);
|
||||
GL_APICALL void GL_APIENTRY glLinkProgram (GLuint program);
|
||||
GL_APICALL void GL_APIENTRY glPixelStorei (GLenum pname, GLint param);
|
||||
GL_APICALL void GL_APIENTRY glPolygonOffset (GLfloat factor, GLfloat units);
|
||||
GL_APICALL void GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels);
|
||||
GL_APICALL void GL_APIENTRY glReleaseShaderCompiler (void);
|
||||
GL_APICALL void GL_APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
|
||||
GL_APICALL void GL_APIENTRY glSampleCoverage (GLclampf value, GLboolean invert);
|
||||
GL_APICALL void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
GL_APICALL void GL_APIENTRY glShaderBinary (GLsizei n, const GLuint* shaders, GLenum binaryformat, const GLvoid* binary, GLsizei length);
|
||||
GL_APICALL void GL_APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar** string, const GLint* length);
|
||||
GL_APICALL void GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask);
|
||||
GL_APICALL void GL_APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask);
|
||||
GL_APICALL void GL_APIENTRY glStencilMask (GLuint mask);
|
||||
GL_APICALL void GL_APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask);
|
||||
GL_APICALL void GL_APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass);
|
||||
GL_APICALL void GL_APIENTRY glStencilOpSeparate (GLenum face, GLenum fail, GLenum zfail, GLenum zpass);
|
||||
GL_APICALL void GL_APIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels);
|
||||
GL_APICALL void GL_APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param);
|
||||
GL_APICALL void GL_APIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat *params);
|
||||
GL_APICALL void GL_APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param);
|
||||
GL_APICALL void GL_APIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint* params);
|
||||
GL_APICALL void GL_APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid* pixels);
|
||||
GL_APICALL void GL_APIENTRY glUniform1f (GLint location, GLfloat x);
|
||||
GL_APICALL void GL_APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat *v);
|
||||
GL_APICALL void GL_APIENTRY glUniform1i (GLint location, GLint x);
|
||||
GL_APICALL void GL_APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint* v);
|
||||
GL_APICALL void GL_APIENTRY glUniform2f (GLint location, GLfloat x, GLfloat y);
|
||||
GL_APICALL void GL_APIENTRY glUniform2fv (GLint location, GLsizei count, const GLfloat *v);
|
||||
GL_APICALL void GL_APIENTRY glUniform2i (GLint location, GLint x, GLint y);
|
||||
GL_APICALL void GL_APIENTRY glUniform2iv (GLint location, GLsizei count, const GLint* v);
|
||||
GL_APICALL void GL_APIENTRY glUniform3f (GLint location, GLfloat x, GLfloat y, GLfloat z);
|
||||
GL_APICALL void GL_APIENTRY glUniform3fv (GLint location, GLsizei count, const GLfloat *v);
|
||||
GL_APICALL void GL_APIENTRY glUniform3i (GLint location, GLint x, GLint y, GLint z);
|
||||
GL_APICALL void GL_APIENTRY glUniform3iv (GLint location, GLsizei count, const GLint* v);
|
||||
GL_APICALL void GL_APIENTRY glUniform4f (GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
|
||||
GL_APICALL void GL_APIENTRY glUniform4fv (GLint location, GLsizei count, const GLfloat *v);
|
||||
GL_APICALL void GL_APIENTRY glUniform4i (GLint location, GLint x, GLint y, GLint z, GLint w);
|
||||
GL_APICALL void GL_APIENTRY glUniform4iv (GLint location, GLsizei count, const GLint* v);
|
||||
GL_APICALL void GL_APIENTRY glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
|
||||
GL_APICALL void GL_APIENTRY glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
|
||||
GL_APICALL void GL_APIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
|
||||
GL_APICALL void GL_APIENTRY glUseProgram (GLuint program);
|
||||
GL_APICALL void GL_APIENTRY glValidateProgram (GLuint program);
|
||||
GL_APICALL void GL_APIENTRY glVertexAttrib1f (GLuint indx, GLfloat x);
|
||||
GL_APICALL void GL_APIENTRY glVertexAttrib1fv (GLuint indx, const GLfloat *values);
|
||||
GL_APICALL void GL_APIENTRY glVertexAttrib2f (GLuint indx, GLfloat x, GLfloat y);
|
||||
GL_APICALL void GL_APIENTRY glVertexAttrib2fv (GLuint indx, const GLfloat *values);
|
||||
GL_APICALL void GL_APIENTRY glVertexAttrib3f (GLuint indx, GLfloat x, GLfloat y, GLfloat z);
|
||||
GL_APICALL void GL_APIENTRY glVertexAttrib3fv (GLuint indx, const GLfloat *values);
|
||||
GL_APICALL void GL_APIENTRY glVertexAttrib4f (GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
|
||||
GL_APICALL void GL_APIENTRY glVertexAttrib4fv (GLuint indx, const GLfloat *values);
|
||||
GL_APICALL void GL_APIENTRY glVertexAttribPointer (GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* ptr);
|
||||
GL_APICALL void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __drvgl2_h_ */
|
1051
include/GLES2/gl2ext.h
Normal file
59
include/GLES2/gl2platform.h
Normal file
@ -0,0 +1,59 @@
|
||||
/******************************************************************************
|
||||
* Name : drvgl2platform.h
|
||||
*
|
||||
* Copyright : 2004-20010 by Imagination Technologies Limited.
|
||||
* : All rights reserved. No part of this software, either
|
||||
* : material or conceptual may be copied or distributed,
|
||||
* : transmitted, transcribed, stored in a retrieval system or
|
||||
* : translated into any human or computer language in any form
|
||||
* : by form by any means, electronic, mechanical, manual or
|
||||
* : otherwise, or disclosed to third parties without the
|
||||
* : express written permission of:
|
||||
* : Imagination Technologies Limited, Home Park Estate,
|
||||
* : Kings Langley, Hertfordshire, WD4 8LZ, U.K.
|
||||
*
|
||||
* $Log: drvgl2platform.h $
|
||||
*****************************************************************************/
|
||||
#ifndef __drvgl2platform_h_
|
||||
#define __drvgl2platform_h_
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* This document is licensed under the SGI Free Software B License Version
|
||||
* 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
|
||||
*/
|
||||
|
||||
/* Platform-specific types and definitions for OpenGL ES 2.X gl2.h
|
||||
*
|
||||
* Adopters may modify khrplatform.h and this file to suit their platform.
|
||||
* You are encouraged to submit all modifications to the Khronos group so that
|
||||
* they can be included in future versions of this file. Please submit changes
|
||||
* by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla)
|
||||
* by filing a bug against product "OpenGL-ES" component "Registry".
|
||||
*/
|
||||
|
||||
#include <KHR/khrplatform.h>
|
||||
|
||||
#ifndef GL_APICALL
|
||||
#define GL_APICALL KHRONOS_APICALL
|
||||
#endif
|
||||
|
||||
#ifndef GL_APIENTRY
|
||||
#define GL_APIENTRY KHRONOS_APIENTRY
|
||||
#endif
|
||||
|
||||
#if defined(__linux__)
|
||||
# define GL_API_EXT __attribute__((visibility("hidden")))
|
||||
#else
|
||||
# define GL_API_EXT
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __drvgl2platform_h_ */
|
162
include/gpu_es4/eurasia/hwdefs/mnemedefs.h
Normal file
@ -0,0 +1,162 @@
|
||||
/****************************************************************************
|
||||
Name : mnemedefs.h
|
||||
Author : Autogenerated
|
||||
Copyright : 2001-2009 by Imagination Technologies Limited. All rights
|
||||
reserved. No part of this software, either material or
|
||||
conceptual may be copied or distributed, transmitted,
|
||||
transcribed, stored in a retrieval system or translated into
|
||||
any human or computer language in any form by any means,
|
||||
electronic, mechanical, manual or otherwise, or
|
||||
disclosed to third parties without the express written
|
||||
permission of Imagination Technologies Limited, Home Park
|
||||
Estate, Kings Langley, Hertfordshire, WD4 8LZ, U.K.
|
||||
Description :
|
||||
|
||||
Program Type : Autogenerated C -- do not edit
|
||||
|
||||
Version : $Revision: 1.2 $
|
||||
|
||||
|
||||
Generated by regconv version 1.127, from files:
|
||||
mne_cache.def
|
||||
****************************************************************************/
|
||||
|
||||
|
||||
#ifndef _MNEMEDEFS_H_
|
||||
#define _MNEMEDEFS_H_
|
||||
|
||||
/* Register MNE_CR_CTRL */
|
||||
#define MNE_CR_CTRL 0x0D00
|
||||
#define MNE_CR_CTRL_BYP_CC_N_MASK 0x00010000U
|
||||
#define MNE_CR_CTRL_BYP_CC_N_SHIFT 16
|
||||
#define MNE_CR_CTRL_BYP_CC_N_SIGNED 0
|
||||
|
||||
#define MNE_CR_CTRL_BYP_CC_MASK 0x00008000U
|
||||
#define MNE_CR_CTRL_BYP_CC_SHIFT 15
|
||||
#define MNE_CR_CTRL_BYP_CC_SIGNED 0
|
||||
|
||||
#define MNE_CR_CTRL_USE_INVAL_REQ_MASK 0x00007800U
|
||||
#define MNE_CR_CTRL_USE_INVAL_REQ_SHIFT 11
|
||||
#define MNE_CR_CTRL_USE_INVAL_REQ_SIGNED 0
|
||||
|
||||
#define MNE_CR_CTRL_BYPASS_ALL_MASK 0x00000400U
|
||||
#define MNE_CR_CTRL_BYPASS_ALL_SHIFT 10
|
||||
#define MNE_CR_CTRL_BYPASS_ALL_SIGNED 0
|
||||
|
||||
#define MNE_CR_CTRL_BYPASS_MASK 0x000003E0U
|
||||
#define MNE_CR_CTRL_BYPASS_SHIFT 5
|
||||
#define MNE_CR_CTRL_BYPASS_SIGNED 0
|
||||
|
||||
#define MNE_CR_CTRL_PAUSE_MASK 0x00000010U
|
||||
#define MNE_CR_CTRL_PAUSE_SHIFT 4
|
||||
#define MNE_CR_CTRL_PAUSE_SIGNED 0
|
||||
|
||||
/* Register MNE_CR_USE_INVAL */
|
||||
#define MNE_CR_USE_INVAL 0x0D04
|
||||
#define MNE_CR_USE_INVAL_ADDR_MASK 0xFFFFFFFFU
|
||||
#define MNE_CR_USE_INVAL_ADDR_SHIFT 0
|
||||
#define MNE_CR_USE_INVAL_ADDR_SIGNED 0
|
||||
|
||||
/* Register MNE_CR_STAT */
|
||||
#define MNE_CR_STAT 0x0D08
|
||||
#define MNE_CR_STAT_PAUSED_MASK 0x00000400U
|
||||
#define MNE_CR_STAT_PAUSED_SHIFT 10
|
||||
#define MNE_CR_STAT_PAUSED_SIGNED 0
|
||||
|
||||
#define MNE_CR_STAT_READS_MASK 0x000003FFU
|
||||
#define MNE_CR_STAT_READS_SHIFT 0
|
||||
#define MNE_CR_STAT_READS_SIGNED 0
|
||||
|
||||
/* Register MNE_CR_STAT_STATS */
|
||||
#define MNE_CR_STAT_STATS 0x0D0C
|
||||
#define MNE_CR_STAT_STATS_RST_MASK 0x000FFFF0U
|
||||
#define MNE_CR_STAT_STATS_RST_SHIFT 4
|
||||
#define MNE_CR_STAT_STATS_RST_SIGNED 0
|
||||
|
||||
#define MNE_CR_STAT_STATS_SEL_MASK 0x0000000FU
|
||||
#define MNE_CR_STAT_STATS_SEL_SHIFT 0
|
||||
#define MNE_CR_STAT_STATS_SEL_SIGNED 0
|
||||
|
||||
/* Register MNE_CR_STAT_STATS_OUT */
|
||||
#define MNE_CR_STAT_STATS_OUT 0x0D10
|
||||
#define MNE_CR_STAT_STATS_OUT_VALUE_MASK 0xFFFFFFFFU
|
||||
#define MNE_CR_STAT_STATS_OUT_VALUE_SHIFT 0
|
||||
#define MNE_CR_STAT_STATS_OUT_VALUE_SIGNED 0
|
||||
|
||||
/* Register MNE_CR_EVENT_STATUS */
|
||||
#define MNE_CR_EVENT_STATUS 0x0D14
|
||||
#define MNE_CR_EVENT_STATUS_INVAL_MASK 0x00000001U
|
||||
#define MNE_CR_EVENT_STATUS_INVAL_SHIFT 0
|
||||
#define MNE_CR_EVENT_STATUS_INVAL_SIGNED 0
|
||||
|
||||
/* Register MNE_CR_EVENT_CLEAR */
|
||||
#define MNE_CR_EVENT_CLEAR 0x0D18
|
||||
#define MNE_CR_EVENT_CLEAR_INVAL_MASK 0x00000001U
|
||||
#define MNE_CR_EVENT_CLEAR_INVAL_SHIFT 0
|
||||
#define MNE_CR_EVENT_CLEAR_INVAL_SIGNED 0
|
||||
|
||||
/* Register MNE_CR_CTRL_INVAL */
|
||||
#define MNE_CR_CTRL_INVAL 0x0D20
|
||||
#define MNE_CR_CTRL_INVAL_PREQ_PDS_MASK 0x00000008U
|
||||
#define MNE_CR_CTRL_INVAL_PREQ_PDS_SHIFT 3
|
||||
#define MNE_CR_CTRL_INVAL_PREQ_PDS_SIGNED 0
|
||||
|
||||
#define MNE_CR_CTRL_INVAL_PREQ_USEC_MASK 0x00000004U
|
||||
#define MNE_CR_CTRL_INVAL_PREQ_USEC_SHIFT 2
|
||||
#define MNE_CR_CTRL_INVAL_PREQ_USEC_SIGNED 0
|
||||
|
||||
#define MNE_CR_CTRL_INVAL_PREQ_CACHE_MASK 0x00000002U
|
||||
#define MNE_CR_CTRL_INVAL_PREQ_CACHE_SHIFT 1
|
||||
#define MNE_CR_CTRL_INVAL_PREQ_CACHE_SIGNED 0
|
||||
|
||||
#define MNE_CR_CTRL_INVAL_ALL_MASK 0x00000001U
|
||||
#define MNE_CR_CTRL_INVAL_ALL_SHIFT 0
|
||||
#define MNE_CR_CTRL_INVAL_ALL_SIGNED 0
|
||||
|
||||
/* Register MNE_CR_emu_mem_stall */
|
||||
#define MNE_CR_emu_mem_stall 0x0D24
|
||||
#define MNE_CR_EMU_MEM_STALL_COUNT_MASK 0xFFFFFFFFU
|
||||
#define MNE_CR_EMU_MEM_STALL_COUNT_SHIFT 0
|
||||
#define MNE_CR_EMU_MEM_STALL_COUNT_SIGNED 0
|
||||
|
||||
/* Register MNE_CR_mem_byte */
|
||||
#define MNE_CR_mem_byte 0x0D28
|
||||
#define MNE_CR_MEM_BYTE_WRITE_MASK 0xFFFFFFFFU
|
||||
#define MNE_CR_MEM_BYTE_WRITE_SHIFT 0
|
||||
#define MNE_CR_MEM_BYTE_WRITE_SIGNED 0
|
||||
|
||||
/* Register MNE_CR_mem_non_masked */
|
||||
#define MNE_CR_mem_non_masked 0x0D2C
|
||||
#define MNE_CR_MEM_NON_MASKED_WRITE_MASK 0xFFFFFFFFU
|
||||
#define MNE_CR_MEM_NON_MASKED_WRITE_SHIFT 0
|
||||
#define MNE_CR_MEM_NON_MASKED_WRITE_SIGNED 0
|
||||
|
||||
/* Register MNE_CR_mem_CYCLE_COUNTER */
|
||||
#define MNE_CR_mem_CYCLE_COUNTER 0x0D30
|
||||
#define MNE_CR_MEM_CYCLE_COUNTER_RESET_MASK 0x00000001U
|
||||
#define MNE_CR_MEM_CYCLE_COUNTER_RESET_SHIFT 0
|
||||
#define MNE_CR_MEM_CYCLE_COUNTER_RESET_SIGNED 0
|
||||
|
||||
/* Register MNE_CR_mem */
|
||||
#define MNE_CR_mem 0x0D34
|
||||
#define MNE_CR_MEM_READ_MASK 0xFFFFFFFFU
|
||||
#define MNE_CR_MEM_READ_SHIFT 0
|
||||
#define MNE_CR_MEM_READ_SIGNED 0
|
||||
|
||||
/* Register MNE_CR_mem_any */
|
||||
#define MNE_CR_mem_any 0x0D38
|
||||
#define MNE_CR_MEM_ANY_WRITE_MASK 0xFFFFFFFFU
|
||||
#define MNE_CR_MEM_ANY_WRITE_SHIFT 0
|
||||
#define MNE_CR_MEM_ANY_WRITE_SIGNED 0
|
||||
|
||||
/* Register MNE_CR_mem_masked */
|
||||
#define MNE_CR_mem_masked 0x0D3C
|
||||
#define MNE_CR_MEM_MASKED_WRITE_MASK 0xFFFFFFFFU
|
||||
#define MNE_CR_MEM_MASKED_WRITE_SHIFT 0
|
||||
#define MNE_CR_MEM_MASKED_WRITE_SIGNED 0
|
||||
|
||||
#endif /* _MNEMEDEFS_H_ */
|
||||
|
||||
/*****************************************************************************
|
||||
End of file (mnemedefs.h)
|
||||
*****************************************************************************/
|
2557
include/gpu_es4/eurasia/hwdefs/sgx520defs.h
Normal file
2658
include/gpu_es4/eurasia/hwdefs/sgx530defs.h
Normal file
2969
include/gpu_es4/eurasia/hwdefs/sgx531defs.h
Normal file
3229
include/gpu_es4/eurasia/hwdefs/sgx535defs.h
Normal file
3150
include/gpu_es4/eurasia/hwdefs/sgx540defs.h
Normal file
59
include/gpu_es4/eurasia/hwdefs/sgx540usedefs.h
Normal file
@ -0,0 +1,59 @@
|
||||
/*************************************************************************
|
||||
* Name : sgx540usedefs.h
|
||||
* Title : SGX hw definitions
|
||||
*
|
||||
* Copyright : 2005-2006 by Imagination Technologies Limited. All rights reserved.
|
||||
* : No part of this software, either material or conceptual
|
||||
* : may be copied or distributed, transmitted, transcribed,
|
||||
* : stored in a retrieval system or translated into any
|
||||
* : human or computer language in any form by any means,
|
||||
* : electronic, mechanical, manual or other-wise, or
|
||||
* : disclosed to third parties without the express written
|
||||
* : permission of Imagination Technologies Limited, Unit 8, HomePark
|
||||
* : Industrial Estate, King's Langley, Hertfordshire,
|
||||
* : WD4 8LZ, U.K.
|
||||
*
|
||||
* Platform : ANSI
|
||||
*
|
||||
* Modifications:-
|
||||
* $Log: sgx540usedefs.h $
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef _SGX540USEDEFS_H_
|
||||
#define _SGX540USEDEFS_H_
|
||||
|
||||
#define SGX540_USE1_OP_FNRM (27)
|
||||
|
||||
#define SGX540_USE1_FNRM_DRCSEL_SHIFT (21)
|
||||
#define SGX540_USE1_FNRM_DRCSEL_CLRMSK (0xFFDFFFFF)
|
||||
|
||||
#define SGX540_USE1_FNRM_F16DP (0x00080000)
|
||||
|
||||
#define SGX540_USE1_FNRM_F16C0SWIZ_SHIFT (8)
|
||||
#define SGX540_USE1_FNRM_F16C0SWIZ_CLRMSK (0xFFFFF8FF)
|
||||
|
||||
#define SGX540_USE1_FNRM_F16C1SWIZ_SHIFT (5)
|
||||
#define SGX540_USE1_FNRM_F16C1SWIZ_CLRMSK (0xFFFFFF1F)
|
||||
|
||||
#define SGX540_USE1_FNRM_SRCMOD_SHIFT (3)
|
||||
#define SGX540_USE1_FNRM_SRCMOD_CLRMSK (0xFFFFFFE7)
|
||||
|
||||
#define SGX540_USE0_FNRM_F16C2SWIZ_SHIFT (17)
|
||||
#define SGX540_USE0_FNRM_F16C2SWIZ_CLRMSK (0xFFF1FFFF)
|
||||
|
||||
#define SGX540_USE0_FNRM_F16C3SWIZ_SHIFT (14)
|
||||
#define SGX540_USE0_FNRM_F16C3SWIZ_CLRMSK (0xFFFE3FFF)
|
||||
|
||||
#define SGX540_USE_FNRM_F16CHANSEL_SRC0L (0)
|
||||
#define SGX540_USE_FNRM_F16CHANSEL_SRC0H (1)
|
||||
#define SGX540_USE_FNRM_F16CHANSEL_SRC1L (2)
|
||||
#define SGX540_USE_FNRM_F16CHANSEL_SRC1H (3)
|
||||
#define SGX540_USE_FNRM_F16CHANSEL_ZERO (4)
|
||||
#define SGX540_USE_FNRM_F16CHANSEL_ONE (5)
|
||||
#define SGX540_USE_FNRM_F16CHANSEL_RESERVED0 (6)
|
||||
#define SGX540_USE_FNRM_F16CHANSEL_RESERVED1 (7)
|
||||
|
||||
#endif /* _SGX540USEDEFS_H_ */
|
||||
|
||||
/* EOF */
|
||||
|
7091
include/gpu_es4/eurasia/hwdefs/sgx543_debug_defs.h
Normal file
5577
include/gpu_es4/eurasia/hwdefs/sgx543_v1.164defs.h
Normal file
5722
include/gpu_es4/eurasia/hwdefs/sgx543defs.h
Normal file
7091
include/gpu_es4/eurasia/hwdefs/sgx544_debug_defs.h
Normal file
5760
include/gpu_es4/eurasia/hwdefs/sgx544defs.h
Normal file
5745
include/gpu_es4/eurasia/hwdefs/sgx545defs.h
Normal file
421
include/gpu_es4/eurasia/hwdefs/sgx545usedefs.h
Normal file
@ -0,0 +1,421 @@
|
||||
/*************************************************************************
|
||||
* Name : sgx545usedefs.h
|
||||
* Title : SGX hw definitions
|
||||
*
|
||||
* Copyright : 2005-2006 by Imagination Technologies Limited. All rights reserved.
|
||||
* : No part of this software, either material or conceptual
|
||||
* : may be copied or distributed, transmitted, transcribed,
|
||||
* : stored in a retrieval system or translated into any
|
||||
* : human or computer language in any form by any means,
|
||||
* : electronic, mechanical, manual or other-wise, or
|
||||
* : disclosed to third parties without the express written
|
||||
* : permission of Imagination Technologies Limited, Unit 8, HomePark
|
||||
* : Industrial Estate, King's Langley, Hertfordshire,
|
||||
* : WD4 8LZ, U.K.
|
||||
*
|
||||
* Platform : ANSI
|
||||
*
|
||||
* Modifications:-
|
||||
* $Log: sgx545usedefs.h $
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef _SGX545USEDEFS_H_
|
||||
#define _SGX545USEDEFS_H_
|
||||
|
||||
#define SGX545_PIXELBE2S2_TWOEMITS (1UL << 11)
|
||||
|
||||
/* 545 extensions of the OP field. */
|
||||
#define SGX545_USE1_OP_FDUAL (27UL)
|
||||
|
||||
/* 545 changes to the OP2 field for MINMAX floating point instruction. */
|
||||
#define SGX545_USE1_FLOAT_OP2_MAXMIN (0)
|
||||
#define SGX545_USE1_FLOAT_OP2_MINMAX (1)
|
||||
|
||||
/* 545 changes to the floating point instruction fields. */
|
||||
#define SGX545_USE1_FLOAT_MOE (0x00200000)
|
||||
|
||||
#define SGX545_USE1_FLOAT_RCNT_SHIFT (12)
|
||||
#define SGX545_USE1_FLOAT_RCNT_CLRMSK (0xFFFFCFFF)
|
||||
|
||||
#define SGX545_USE1_FLOAT_SRC0ABS (0x00000080)
|
||||
|
||||
#define SGX545_USE1_FLOAT_S0INC (0x00008000)
|
||||
#define SGX545_USE1_FLOAT_S1INC (0x00004000)
|
||||
#define SGX545_USE1_FLOAT_S2INC (0x00000100)
|
||||
|
||||
#define SGX545_USE1_FLOAT_RCOUNT_MAXIMUM 4
|
||||
|
||||
/* 545 changes to the FMAD16 instruction. */
|
||||
#define SGX545_USE_FARITH16_SWZ_LOWHIGH 0
|
||||
#define SGX545_USE_FARITH16_SWZ_LOWLOW 1
|
||||
#define SGX545_USE_FARITH16_SWZ_HIGHHIGH 2
|
||||
#define SGX545_USE_FARITH16_SWZ_CVTFROMF32 3
|
||||
|
||||
#define SGX545_USE1_FARITH16_SRC2SWZ_SHIFT (21)
|
||||
#define SGX545_USE1_FARITH16_SRC2SWZ_CLRMSK (0xFF9FFFFF)
|
||||
|
||||
#define SGX545_USE1_FARITH16_SRC1SWZH_SHIFT (18)
|
||||
#define SGX545_USE1_FARITH16_SRC1SWZH_CLRMSK (0xFFFBFFFF)
|
||||
#define SGX545_USE1_FARITH16_SRC1SWZH_INTERNALSHIFT (1)
|
||||
|
||||
#define SGX545_USE1_FARITH16_SRC1SWZL_SHIFT (13)
|
||||
#define SGX545_USE1_FARITH16_SRC1SWZL_CLRMSK (0xFFFFDFFF)
|
||||
#define SGX545_USE1_FARITH16_SRC1SWZL_INTERNALSHIFT (0)
|
||||
|
||||
#define SGX545_USE1_FARITH16_RCNT_SHIFT (12)
|
||||
#define SGX545_USE1_FARITH16_RCNT_CLRMSK (0xFFFFEFFF)
|
||||
#define SGX545_USE1_FARITH16_RCNT_MAXIMUM (2)
|
||||
|
||||
#define SGX545_USE1_FARITH16_SRC0SWZ_SHIFT (9)
|
||||
#define SGX545_USE1_FARITH16_SRC0SWZ_CLRMSK (0xFFFFF9FF)
|
||||
|
||||
/* 545 extensions of the scalar instruction fields. */
|
||||
#define SGX545_USE1_FSCALAR_GROUP (0x00010000)
|
||||
|
||||
#define SGX545_USE1_FLOAT_OP2_SQRT (0)
|
||||
#define SGX545_USE1_FLOAT_OP2_SIN (1)
|
||||
#define SGX545_USE1_FLOAT_OP2_COS (2)
|
||||
#define SGX545_USE1_FLOAT_OP2_SCALARRESERVED (3)
|
||||
|
||||
/* 545 extensions of the MOVC instruction fields. */
|
||||
#define SGX545_USE1_MOVC_COVERAGETYPEEXT (0x00400000)
|
||||
|
||||
#define SGX545_USE1_MOVC_TSTDTYPE_COVERAGE (6)
|
||||
#define SGX545_USE1_MOVC_TSTDTYPE_COVERAGE_SMASK (7)
|
||||
|
||||
#define SGX545_USE1_MOVC_COVERAGETYPE_STDMASK (0)
|
||||
#define SGX545_USE1_MOVC_COVERAGETYPE_STDU8 (1)
|
||||
#define SGX545_USE1_MOVC_COVERAGETYPE_EXTF16 (0)
|
||||
#define SGX545_USE1_MOVC_COVERAGETYPE_EXTF32 (1)
|
||||
|
||||
#define SGX545_USE1_MOVC_S2SCSEL_SHIFT (5)
|
||||
#define SGX545_USE1_MOVC_S2SCSEL_CLRMSK (0xFFFFFF9F)
|
||||
|
||||
/* 545 changes to the EFO instruction fields. */
|
||||
/* Negate right-hand source for A0 addr. */
|
||||
#define SGX545_USE1_EFO_A0RNEG (0x04000000)
|
||||
|
||||
#define SGX545_USE1_EFO_SPRED_SHIFT (24)
|
||||
#define SGX545_USE1_EFO_SPRED_CLRMSK (0xFCFFFFFF)
|
||||
|
||||
/* 545 multiplier selections. */
|
||||
#define SGX545_USE1_EFO_ASRC_M0M1_I1I0 (0)
|
||||
#define SGX545_USE1_EFO_ASRC_M0SRC0_I1I0 (1)
|
||||
#define SGX545_USE1_EFO_ASRC_M0I0_I1M1 (2)
|
||||
#define SGX545_USE1_EFO_ASRC_SRC0SRC2_SRC1SRC2 (3)
|
||||
|
||||
/* 545 adder selections. */
|
||||
#define SGX545_USE1_EFO_MSRC_SRC0SRC2_SRC1SRC2 (0)
|
||||
#define SGX545_USE1_EFO_MSRC_SRC2SRC1_SRC2SRC2 (1)
|
||||
#define SGX545_USE1_EFO_MSRC_SRC1SRC0_SRC2SRC2 (2)
|
||||
#define SGX545_USE1_EFO_MSRC_SRC1I0_SRC2I1 (3)
|
||||
|
||||
#define SGX545_USE1_EFO_GPIROW (0x00000100)
|
||||
|
||||
#define SGX545_USE1_EFO_S2BEXT (0x00000080)
|
||||
|
||||
#define SGX545_USE1_EFO_S0BEXT (0x00000040)
|
||||
|
||||
#define SGX545_USE1_EFO_SRC0NEG (0x00000020)
|
||||
|
||||
#define SGX545_USE1_EFO_SRC1NEG (0x00000010)
|
||||
|
||||
#define SGX545_USE1_EFO_SRC2NEG (0x00000008)
|
||||
|
||||
/*
|
||||
Dual-issue instruction fields.
|
||||
*/
|
||||
#define SGX545_USE1_FDUAL_SPRED_SHIFT (24)
|
||||
#define SGX545_USE1_FDUAL_SPRED_CLRMSK (0xFCFFFFFF)
|
||||
|
||||
#define SGX545_USE1_FDUAL_OP1EXT (0x04000000)
|
||||
|
||||
#define SGX545_USE1_FDUAL_O2S2EXT_MSRCEXT (0x00200000)
|
||||
|
||||
#define SGX545_USE1_FDUAL_OP1_SHIFT (18)
|
||||
#define SGX545_USE1_FDUAL_OP1_CLRMSK (0xFFF3FFFF)
|
||||
#define SGX545_USE1_FDUAL_OP1_STD_FMAD (0)
|
||||
#define SGX545_USE1_FDUAL_OP1_STD_MOV (1)
|
||||
#define SGX545_USE1_FDUAL_OP1_STD_FADM (2)
|
||||
#define SGX545_USE1_FDUAL_OP1_STD_FMSA (3)
|
||||
#define SGX545_USE1_FDUAL_OP1_EXT_FDDP (0)
|
||||
#define SGX545_USE1_FDUAL_OP1_EXT_FCLMP (1)
|
||||
#define SGX545_USE1_FDUAL_OP1_EXT_IMA32 (2)
|
||||
#define SGX545_USE1_FDUAL_OP1_EXT_FSSQ (3)
|
||||
|
||||
#define SGX545_USE1_FDUAL_OP2S1_SHIFT (14)
|
||||
#define SGX545_USE1_FDUAL_OP2S1_CLRMSK (0xFFFF3FFF)
|
||||
#define SGX545_USE1_FDUAL_OP2S1_I0 (0)
|
||||
#define SGX545_USE1_FDUAL_OP2S1_I1 (1)
|
||||
#define SGX545_USE1_FDUAL_OP2S1_I2 (2)
|
||||
#define SGX545_USE1_FDUAL_OP2S1_SRC1 (3)
|
||||
#define SGX545_USE1_FDUAL_OP2S1_MSRCSTD_I0 (0)
|
||||
#define SGX545_USE1_FDUAL_OP2S1_MSRCSTD_I1 (1)
|
||||
#define SGX545_USE1_FDUAL_OP2S1_MSRCSTD_I2 (2)
|
||||
#define SGX545_USE1_FDUAL_OP2S1_MSRCSTD_RESERVED (3)
|
||||
#define SGX545_USE1_FDUAL_OP2S1_MSRCEXT_SRC0 (0)
|
||||
#define SGX545_USE1_FDUAL_OP2S1_MSRCEXT_SRC1 (1)
|
||||
#define SGX545_USE1_FDUAL_OP2S1_MSRCEXT_SRC2 (2)
|
||||
#define SGX545_USE1_FDUAL_OP2S1_MSRCEXT_RESERVED (3)
|
||||
|
||||
#define SGX545_USE1_FDUAL_OP2DEXTS0EXT (0x00002000)
|
||||
|
||||
#define SGX545_USE1_FDUAL_RCNT_SHIFT (12)
|
||||
#define SGX545_USE1_FDUAL_RCNT_CLRMSK (0xFFFFEFFF)
|
||||
#define SGX545_USE1_FDUAL_RCNT_MAX (2)
|
||||
|
||||
#define SGX545_USE1_FDUAL_NOSCHED (0x00000800)
|
||||
|
||||
#define SGX545_USE1_FDUAL_OP2S2_SHIFT (10)
|
||||
#define SGX545_USE1_FDUAL_OP2S2_CLRMSK (0xFFFFFBFF)
|
||||
#define SGX545_USE1_FDUAL_OP2S2_STD_I0 (0)
|
||||
#define SGX545_USE1_FDUAL_OP2S2_STD_I1 (1)
|
||||
#define SGX545_USE1_FDUAL_OP2S2_EXT_I2 (0)
|
||||
#define SGX545_USE1_FDUAL_OP2S2_EXT_SRC2 (1)
|
||||
|
||||
#define SGX545_USE1_FDUAL_OP2_SHIFT (6)
|
||||
#define SGX545_USE1_FDUAL_OP2_CLRMSK (0xFFFFFC3F)
|
||||
#define SGX545_USE1_FDUAL_OP2_FMAD (0)
|
||||
#define SGX545_USE1_FDUAL_OP2_FMAD16 (1)
|
||||
#define SGX545_USE1_FDUAL_OP2_FMSA (2)
|
||||
#define SGX545_USE1_FDUAL_OP2_FFRC (3)
|
||||
#define SGX545_USE1_FDUAL_OP2_FCLMP (4)
|
||||
#define SGX545_USE1_FDUAL_OP2_FRCP (5)
|
||||
#define SGX545_USE1_FDUAL_OP2_FRSQ (6)
|
||||
#define SGX545_USE1_FDUAL_OP2_FEXP (7)
|
||||
#define SGX545_USE1_FDUAL_OP2_FLOG (8)
|
||||
#define SGX545_USE1_FDUAL_OP2_FSIN (9)
|
||||
#define SGX545_USE1_FDUAL_OP2_FCOS (10)
|
||||
#define SGX545_USE1_FDUAL_OP2_FADD (11)
|
||||
#define SGX545_USE1_FDUAL_OP2_FSUB (12)
|
||||
#define SGX545_USE1_FDUAL_OP2_FMUL (13)
|
||||
#define SGX545_USE1_FDUAL_OP2_IMA32 (14)
|
||||
#define SGX545_USE1_FDUAL_OP2_MOV (15)
|
||||
|
||||
#define SGX545_USE1_FDUAL_OP2DSTS0_SHIFT (5)
|
||||
#define SGX545_USE1_FDUAL_OP2DSTS0_CLRMSK (0xFFFFFFDF)
|
||||
#define SGX545_USE1_FDUAL_OP2DSTS0_STD_I0 (0)
|
||||
#define SGX545_USE1_FDUAL_OP2DSTS0_STD_I1 (1)
|
||||
#define SGX545_USE1_FDUAL_OP2DSTS0_EXT_I2 (0)
|
||||
#define SGX545_USE1_FDUAL_OP2DSTS0_EXT_I0SRC0 (1)
|
||||
#define SGX545_USE1_FDUAL_OP2DSTS0_MAXIMUM_INTERNAL_REGISTER \
|
||||
(2)
|
||||
|
||||
#define SGX545_USE1_FDUAL_S1NEG (0x00000010)
|
||||
#define SGX545_USE1_FDUAL_S2NEG (0x00000008)
|
||||
|
||||
/*
|
||||
Number of the internal register written by
|
||||
a primary FDDP operation (in addition to
|
||||
the normal destination).
|
||||
*/
|
||||
#define SGX545_USE_FDUAL_FDDP_IREG_DEST_NUM (0)
|
||||
|
||||
/* 545 pack instruction changes. */
|
||||
#define SGX545_USE0_PCK_RMODE_SHIFT (19)
|
||||
#define SGX545_USE0_PCK_RMODE_CLRMSK (0xFFE7FFFF)
|
||||
#define SGX545_USE0_PCK_RMODE_NEAREST (0)
|
||||
#define SGX545_USE0_PCK_RMODE_DOWN (1)
|
||||
#define SGX545_USE0_PCK_RMODE_UP (2)
|
||||
#define SGX545_USE0_PCK_RMODE_ZERO (3)
|
||||
|
||||
#define SGX545_USE0_PCK_ROUNDENABLE (0x00040000)
|
||||
|
||||
/*
|
||||
IDIV
|
||||
*/
|
||||
#define SGX545_USE1_32BITINT_OP2_IDIV (1)
|
||||
|
||||
#define SGX545_USE1_IDIV_DBANK_TEMP (0x00000000)
|
||||
#define SGX545_USE1_IDIV_DBANK_PRIMATTR (0x00000080)
|
||||
#define SGX545_USE1_IDIV_DBANK_CLRMSK (0xFFFFFF7F)
|
||||
|
||||
#define SGX545_USE1_IDIV_DRCSEL_SHIFT (0)
|
||||
#define SGX545_USE1_IDIV_DRCSEL_CLRMSK (0xFFFFFFFE)
|
||||
#define SGX545_USE1_IDIV_DRCSEL_MAX (1)
|
||||
|
||||
/*
|
||||
545 changes to the SMP instruction.
|
||||
*/
|
||||
#define SGX545_USE1_SMP_SRD_SHIFT (14)
|
||||
#define SGX545_USE1_SMP_SRD_CLRMSK (0xFFFF3FFF)
|
||||
#define SGX545_USE1_SMP_SRD_NONE (0)
|
||||
#define SGX545_USE1_SMP_SRD_COEFFS (1)
|
||||
#define SGX545_USE1_SMP_SRD_RAWDATA (2)
|
||||
#define SGX545_USE1_SMP_SRD_RESERVED (3)
|
||||
|
||||
#define SGX545_USE1_SMP_PCF_SHIFT (5)
|
||||
#define SGX545_USE1_SMP_PCF_CLRMSK (0xFFFFFF9F)
|
||||
#define SGX545_USE1_SMP_PCF_NONE (0)
|
||||
#define SGX545_USE1_SMP_PCF_F32 (1)
|
||||
#define SGX545_USE1_SMP_PCF_F16 (2)
|
||||
#define SGX545_USE1_SMP_PCF_RESERVED (3)
|
||||
|
||||
/*
|
||||
Number of registers written by a texture sample using SRD=COEFFS
|
||||
*/
|
||||
#define SGX545_USE_SMP_SRD_COEFFS_RESULT_LENGTH (2)
|
||||
|
||||
/*
|
||||
Format of the data returned by a texture sample using SRD=COEFFS
|
||||
|
||||
Bit Register offset Description
|
||||
31..24 0 Bilinear S fraction (in case of 3D textures)
|
||||
23..16 0 Trilinear fraction
|
||||
15..8 0 Bilinear V fraction
|
||||
7..0 0 Bilinear U fraction
|
||||
|
||||
31..8 1 Reserved
|
||||
7..0 1 LOD value
|
||||
*/
|
||||
#define SGX545_USE_SMP_SRD_COEFFS0_UFRACTION_SHIFT (0)
|
||||
#define SGX545_USE_SMP_SRD_COEFFS0_UFRACTION_CLRMSK (0xFFFFFF00)
|
||||
|
||||
#define SGX545_USE_SMP_SRD_COEFFS0_VFRACTION_SHIFT (8)
|
||||
#define SGX545_USE_SMP_SRD_COEFFS0_VFRACTION_CLRMSK (0xFFFF00FF)
|
||||
|
||||
#define SGX545_USE_SMP_SRD_COEFFS0_TRILINEARFRACTION_SHIFT (16)
|
||||
#define SGX545_USE_SMP_SRD_COEFFS0_TRILINEARFRACTION_CLRMSK (0xFF00FFFF)
|
||||
|
||||
#define SGX545_USE_SMP_SRD_COEFFS0_SFRACTION_SHIFT (24)
|
||||
#define SGX545_USE_SMP_SRD_COEFFS0_SFRACTION_CLRMSK (0x00FFFFFF)
|
||||
|
||||
#define SGX545_USE_SMP_SRD_COEFFS1_LOD_SHIFT (0)
|
||||
#define SGX545_USE_SMP_SRD_COEFFS1_LOD_CLRMSK (0xFFFFFF00)
|
||||
|
||||
/*
|
||||
545 changes to the LD/ST instruction.
|
||||
*/
|
||||
#define SGX545_USE1_LDST_EXTENDED (0x00400000)
|
||||
|
||||
/* Same bit position as DRCSEL for LD */
|
||||
#define SGX545_USE1_ST_NORDBEF (0x00000001)
|
||||
|
||||
/*
|
||||
Extended load instruction fields.
|
||||
*/
|
||||
#define SGX545_USE1_EXTLD_DCCTLEXT (0x00200000)
|
||||
|
||||
#define SGX545_USE1_EXTLD_OFFSET1_CLRMSK (0xFFF0FFFF)
|
||||
#define SGX545_USE1_EXTLD_OFFSET1_SHIFT (16)
|
||||
#define SGX545_USE1_EXTLD_OFFSET1_INTERNALSHIFT (7)
|
||||
|
||||
#define SGX545_USE1_EXTLD_OFFSET0_CLRMSK (0xFFFFF01F)
|
||||
#define SGX545_USE1_EXTLD_OFFSET0_SHIFT (5)
|
||||
#define SGX545_USE1_EXTLD_OFFSET0_INTERNALSHIFT (0)
|
||||
|
||||
#define SGX545_USE1_EXTLD_OFFSET_MAX (2047)
|
||||
|
||||
#define SGX545_USE1_EXTLD_DBANK_TEMP (0x00000000)
|
||||
#define SGX545_USE1_EXTLD_DBANK_PRIMATTR (0x00000010)
|
||||
#define SGX545_USE1_EXTLD_DBANK_CLRMSK (0xFFFFFFEF)
|
||||
|
||||
#define SGX545_USE1_EXTLD_DTYPE_32BIT (0x00000000)
|
||||
#define SGX545_USE1_EXTLD_DTYPE_128BIT (0x00000008)
|
||||
|
||||
/*
|
||||
The maximum value for the range check parameter for each data type
|
||||
(in units of that data type).
|
||||
*/
|
||||
#define SGX545_USE_EXTLD_MAXIMUM_DWORD_RANGE (0x1FFFFFFF)
|
||||
#define SGX545_USE_EXTLD_MAXIMUM_QWORD_RANGE (0x07FFFFFF)
|
||||
|
||||
/*
|
||||
USE to MTE emit for 545
|
||||
*/
|
||||
|
||||
#define SGX545_USETOMTE2_OVERRIDESYNCNUM (0x00000001)
|
||||
|
||||
#define SGX545_USETOMTE1_COMPLEX (0x00100000)
|
||||
|
||||
#define SGX545_USETOMTE1_VERTEXC_RESOURCENUM_SHIFT (7)
|
||||
#define SGX545_USETOMTE1_VERTEXC_RESOURCENUM_CLRMSK (0xFFFFFC7F)
|
||||
|
||||
#define SGX545_USETOMTE1_VERTEXC_VERINPART_SHIFT (3)
|
||||
#define SGX545_USETOMTE1_VERTEXC_VERINPART_CLRMSK (0xFFFFFF87)
|
||||
|
||||
#define SGX545_USETOMTE1_VERTEXS_RESOURCENUM_SHIFT (3)
|
||||
#define SGX545_USETOMTE1_VERTEXS_RESOURCENUM_CLRMSK (0xFFFFFFC7)
|
||||
|
||||
#define SGX545_USETOMTE1_PRIM_TYPE_SHIFT (13)
|
||||
#define SGX545_USETOMTE1_PRIM_TYPE_CLRMSK (0xFFFFDFFF)
|
||||
#define SGX545_USETOMTE1_PRIM_TYPE_TRIANGLE (0)
|
||||
#define SGX545_USETOMTE1_PRIM_TYPE_STRIP (1)
|
||||
|
||||
#define SGX545_USETOMTE1_PRIM_START_SHIFT (8)
|
||||
#define SGX545_USETOMTE1_PRIM_START_CLRMSK (0xFFFFE0FF)
|
||||
|
||||
#define SGX545_USETOMTE1_PRIM_NUM_SHIFT (3)
|
||||
#define SGX545_USETOMTE1_PRIM_NUM_CLRMSK (0xFFFFFF07)
|
||||
|
||||
#define SGX545_USETOMTE1_NUMPARTITIONS_SHIFT (0)
|
||||
#define SGX545_USETOMTE1_NUMPARITIIONS_CLRMSK (0xFFFFFFF8)
|
||||
|
||||
/* New special opcodes for 545. */
|
||||
#define SGX545_USE1_OTHER2_OP2_CFI (0)
|
||||
#define SGX545_USE1_OTHER2_OP2_RESERVED (1)
|
||||
|
||||
/* MOE instructions. */
|
||||
#define SGX545_USE1_MOECTRL_OP2_MOEST (6)
|
||||
|
||||
#define SGX545_USE1_MOECTRL_MOEST_PARAM_CLRMSK (0xFFFF87FF)
|
||||
#define SGX545_USE1_MOECTRL_MOEST_PARAM_SHIFT (11)
|
||||
#define SGX545_USE1_MOECTRL_MOEST_PARAM_SMOALOW (0)
|
||||
#define SGX545_USE1_MOECTRL_MOEST_PARAM_SMOAHIGH (1)
|
||||
#define SGX545_USE1_MOECTRL_MOEST_PARAM_SMLSILOW (2)
|
||||
#define SGX545_USE1_MOECTRL_MOEST_PARAM_SMLSIHIGH (3)
|
||||
#define SGX545_USE1_MOECTRL_MOEST_PARAM_SMBOLOW (4)
|
||||
#define SGX545_USE1_MOECTRL_MOEST_PARAM_SMBOHIGH (5)
|
||||
#define SGX545_USE1_MOECTRL_MOEST_PARAM_SMRLOW (6)
|
||||
#define SGX545_USE1_MOECTRL_MOEST_PARAM_SMRHIGH (7)
|
||||
#define SGX545_USE1_MOECTRL_MOEST_PARAM_IDX (8)
|
||||
#define SGX545_USE1_MOECTRL_MOEST_PARAM_MAXIMUM (8)
|
||||
|
||||
/* Cache flush instruction. */
|
||||
#define SGX545_USE1_OTHER2_CFI_GLOBAL (0x00008000)
|
||||
#define SGX545_USE1_OTHER2_CFI_DM_NOMATCH (0x00004000)
|
||||
#define SGX545_USE1_OTHER2_CFI_FLUSH (0x00002000)
|
||||
#define SGX545_USE1_OTHER2_CFI_INVALIDATE (0x00001000)
|
||||
|
||||
#define SGX545_USE1_OTHER2_CFI_LEVEL_CLRMSK (0xFFFFFCFF)
|
||||
#define SGX545_USE1_OTHER2_CFI_LEVEL_SHIFT (8)
|
||||
#define SGX545_USE1_OTHER2_CFI_LEVEL_RESERVED (0)
|
||||
#define SGX545_USE1_OTHER2_CFI_LEVEL_L0L1 (1)
|
||||
#define SGX545_USE1_OTHER2_CFI_LEVEL_L2 (2)
|
||||
#define SGX545_USE1_OTHER2_CFI_LEVEL_L0L1L2 (3)
|
||||
#define SGX545_USE1_OTHER2_CFI_LEVEL_MAX (3)
|
||||
|
||||
#define SGX545_USE_OTHER2_CFI_DATAMASTER_VERTEX (0)
|
||||
#define SGX545_USE_OTHER2_CFI_DATAMASTER_PIXEL (1)
|
||||
#define SGX545_USE_OTHER2_CFI_DATAMASTER_RESERVED (2)
|
||||
#define SGX545_USE_OTHER2_CFI_DATAMASTER_EVENT (3)
|
||||
|
||||
/* WOP instruction. */
|
||||
#define SGX545_USE0_WOP_TWOPART (0x00000008)
|
||||
#define SGX545_USE0_WOP_PTNB_SHIFT (0)
|
||||
#define SGX545_USE0_WOP_PTNB_CLRMSK (0xFFFFFFF8)
|
||||
#define SGX545_USE0_WOP_PTNB_MAX (5)
|
||||
|
||||
/* Emit instruction. */
|
||||
#define SGX545_USE1_EMIT_TARGET_VCB (3)
|
||||
|
||||
#define SGX545_USE1_EMIT_MTE_CUT (0x00002000)
|
||||
|
||||
#define SGX545_USE1_EMIT_INCP_MAX (5)
|
||||
|
||||
#define SGX545_USE1_EMIT_VCB_EMITTYPE_SHIFT (12)
|
||||
#define SGX545_USE1_EMIT_VCB_EMITTYPE_CLRMSK (0xFFFFEFFF)
|
||||
#define SGX545_USE1_EMIT_VCB_EMITTYPE_STATE (0)
|
||||
#define SGX545_USE1_EMIT_VCB_EMITTYPE_VERTEX (1)
|
||||
|
||||
#define SGX545_USE1_EMIT_VERTEX_TWOPART (0x00000400)
|
||||
#define SGX545_USE1_EMIT_STATE_THREEPART (0x00000400)
|
||||
|
||||
#define SGX545_USE1_EMIT_INCPEXT_SHIFT (9)
|
||||
#define SGX545_USE1_EMIT_INCPEXT_CLRMSK (0xFFFFFDFF)
|
||||
#define SGX545_USE1_EMIT_INCPEXT_INTERNALSHIFT 2
|
||||
|
||||
#endif /* _SGX545USEDEFS_H_ */
|
||||
|
||||
/* EOF */
|
||||
|
143
include/gpu_es4/eurasia/hwdefs/sgxcoretypes.h
Normal file
@ -0,0 +1,143 @@
|
||||
/******************************************************************************
|
||||
* Name : sgxcoretypes.h
|
||||
* Title : SGX HW errata definitions
|
||||
*
|
||||
* Copyright : 2005-2010 by Imagination Technologies Limited.
|
||||
* : All rights reserved. No part of this software, either
|
||||
* : material or conceptual may be copied or distributed,
|
||||
* : transmitted, transcribed, stored in a retrieval system or
|
||||
* : translated into any human or computer language in any form
|
||||
* : by any means, electronic, mechanical, manual or otherwise,
|
||||
* : or disclosed to third parties without the express written
|
||||
* : permission of Imagination Technologies Limited,
|
||||
* : Home Park Estate, Kings Langley, Hertfordshire,
|
||||
* : WD4 8LZ, U.K.
|
||||
*
|
||||
* Platform : ANSI
|
||||
*
|
||||
* Description : Specifies associations between SGX core revisions
|
||||
* and SW workarounds required to fix HW errata that exist
|
||||
* in specific core revisions
|
||||
*
|
||||
* Modifications:-
|
||||
* $Log: sgxcoretypes.h $
|
||||
*****************************************************************************/
|
||||
#ifndef _SGXCORETYPES_H_
|
||||
#define _SGXCORETYPES_H_
|
||||
|
||||
/*
|
||||
Numeric identifiers for different cores.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
SGX_CORE_ID_INVALID = 0,
|
||||
SGX_CORE_ID_520 = 1,
|
||||
SGX_CORE_ID_530 = 2,
|
||||
SGX_CORE_ID_531 = 3,
|
||||
SGX_CORE_ID_535 = 4,
|
||||
SGX_CORE_ID_540 = 5,
|
||||
SGX_CORE_ID_541 = 6,
|
||||
SGX_CORE_ID_543 = 7,
|
||||
SGX_CORE_ID_544 = 8,
|
||||
SGX_CORE_ID_545 = 9,
|
||||
SGX_CORE_ID_554 = 10
|
||||
} SGX_CORE_ID_TYPE;
|
||||
|
||||
typedef struct _SGX_CORE_INFO
|
||||
{
|
||||
SGX_CORE_ID_TYPE eID;
|
||||
IMG_UINT32 uiRev;
|
||||
} SGX_CORE_INFO, *PSGX_CORE_INFO;
|
||||
|
||||
typedef struct _SGX_CORE_BUGS
|
||||
{
|
||||
/*
|
||||
Mask of the bugs present in the this core. Flags are
|
||||
SGX_BUG_FLAGS_FIX_HW_BRN_xxxx
|
||||
defined in sgxerrata.h.
|
||||
*/
|
||||
IMG_UINT32 ui32Flags;
|
||||
} SGX_CORE_BUGS, *PSGX_CORE_BUGS;
|
||||
|
||||
typedef struct _SGX_CORE_FEATURES
|
||||
{
|
||||
/*
|
||||
Mask of the on-off features present in the this core. Flags are
|
||||
SGX_FEATURE_FLAGS_xxxx
|
||||
in sgxfeaturedefs.h.
|
||||
*/
|
||||
IMG_UINT32 ui32Flags;
|
||||
IMG_UINT32 ui32Flags2;
|
||||
/*
|
||||
Count of USE mutuxes available in this core.
|
||||
*/
|
||||
IMG_UINT32 ui32NumMutexes;
|
||||
/*
|
||||
Count of USE monitors available in this core.
|
||||
*/
|
||||
IMG_UINT32 ui32NumMonitors;
|
||||
/*
|
||||
Size (in dwords) of TAG texture state in this core.
|
||||
*/
|
||||
IMG_UINT32 ui32TextureStateSize;
|
||||
/*
|
||||
Count of the PDS constants required for an iteration on this core.
|
||||
*/
|
||||
IMG_UINT32 ui32IterationStateSize;
|
||||
/*
|
||||
Number of USE pipelines on this core.
|
||||
*/
|
||||
IMG_UINT32 ui32NumUSEPipes;
|
||||
/*
|
||||
Number of valid bits in the USE program counter on
|
||||
this core.
|
||||
*/
|
||||
IMG_UINT32 ui32NumProgramCounterBits;
|
||||
/*
|
||||
Number of internal registers available.
|
||||
*/
|
||||
IMG_UINT32 ui32NumInternalRegisters;
|
||||
/*
|
||||
Points to a count of the special registers on this core which are invalid as sources to
|
||||
non-bitwise instructions.
|
||||
*/
|
||||
IMG_UINT32 const* puInvalidSpecialRegistersForNonBitwiseCount;
|
||||
/*
|
||||
Points to a list of the special registers on this core which are invalid
|
||||
as sources to non-bitwise instructions.
|
||||
*/
|
||||
IMG_UINT32 const* auInvalidSpecialRegistersForNonBitwise;
|
||||
/*
|
||||
User-visible name of the core.
|
||||
*/
|
||||
IMG_CHAR const* pszCoreName;
|
||||
} SGX_CORE_FEATURES, *PSGX_CORE_FEATURES;
|
||||
|
||||
typedef struct _SGX_CORE_DESC
|
||||
{
|
||||
/*
|
||||
ID of the core described by this structure.
|
||||
*/
|
||||
SGX_CORE_ID_TYPE eCoreType;
|
||||
/*
|
||||
Latest revision described by this structure or 0
|
||||
if it describes the head revision.
|
||||
*/
|
||||
IMG_UINT32 ui32CoreRevision;
|
||||
/*
|
||||
Structure describing the bugs present in this core.
|
||||
*/
|
||||
SGX_CORE_BUGS sBugs;
|
||||
/*
|
||||
Structure describing the features of this core.
|
||||
*/
|
||||
const SGX_CORE_FEATURES* psFeatures;
|
||||
} SGX_CORE_DESC, *PSGX_CORE_DESC;
|
||||
typedef SGX_CORE_DESC const* PCSGX_CORE_DESC;
|
||||
|
||||
#endif /* _SGXCORETYPES_H_ */
|
||||
|
||||
/******************************************************************************
|
||||
End of file (sgxcoretypes.h)
|
||||
******************************************************************************/
|
||||
|
9222
include/gpu_es4/eurasia/hwdefs/sgxdefs.h
Normal file
3031
include/gpu_es4/eurasia/hwdefs/sgxerrata.h
Normal file
1150
include/gpu_es4/eurasia/hwdefs/sgxfeaturedefs.h
Normal file
59
include/gpu_es4/eurasia/hwdefs/sgxima32usedefs.h
Normal file
@ -0,0 +1,59 @@
|
||||
/*************************************************************************
|
||||
* Name : sgxima32usedefs.h
|
||||
* Title : SGX hw definitions
|
||||
*
|
||||
* Copyright : 2005-2006 by Imagination Technologies Limited. All rights reserved.
|
||||
* : No part of this software, either material or conceptual
|
||||
* : may be copied or distributed, transmitted, transcribed,
|
||||
* : stored in a retrieval system or translated into any
|
||||
* : human or computer language in any form by any means,
|
||||
* : electronic, mechanical, manual or other-wise, or
|
||||
* : disclosed to third parties without the express written
|
||||
* : permission of Imagination Technologies Limited, Unit 8, HomePark
|
||||
* : Industrial Estate, King's Langley, Hertfordshire,
|
||||
* : WD4 8LZ, U.K.
|
||||
*
|
||||
* Platform : ANSI
|
||||
*
|
||||
* Modifications:-
|
||||
* $Log: sgxima32usedefs.h $
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef _SGXIMA32USEDEFS_H_
|
||||
#define _SGXIMA32USEDEFS_H_
|
||||
|
||||
/* Extensions of the OP field. */
|
||||
#define EURASIA_USE1_OP_32BITINT (26UL)
|
||||
|
||||
/*
|
||||
Subopcode field for OP=EURASIA_USE1_OP_32BITINT
|
||||
*/
|
||||
#define EURASIA_USE1_32BITINT_OP2_SHIFT (20)
|
||||
#define EURASIA_USE1_32BITINT_OP2_CLRMSK (0xFFCFFFFFU)
|
||||
#define EURASIA_USE1_32BITINT_OP2_IMA32 (0)
|
||||
|
||||
/*
|
||||
IMA32
|
||||
*/
|
||||
#define EURASIA_USE1_IMA32_CIEN_SHIFT (10)
|
||||
#define EURASIA_USE1_IMA32_CIEN_CLRMSK (0xFFFFF3FFU)
|
||||
#define EURASIA_USE1_IMA32_CIEN_DISABLED (0)
|
||||
#define EURASIA_USE1_IMA32_CIEN_I0_BIT0 (1)
|
||||
#define EURASIA_USE1_IMA32_CIEN_I1_BIT0 (2)
|
||||
#define EURASIA_USE1_IMA32_CIEN_I2_BIT0 (3)
|
||||
|
||||
#define EURASIA_USE1_IMA32_SGN (0x00000200U)
|
||||
|
||||
#define EURASIA_USE1_IMA32_NEGS1 (0x00000100U)
|
||||
|
||||
#define EURASIA_USE1_IMA32_NEGS2 (0x00000080U)
|
||||
|
||||
#define EURASIA_USE1_IMA32_GPIWEN (0x00000040U)
|
||||
|
||||
#define EURASIA_USE1_IMA32_GPISRC_CLRMSK (0xFFFFFFCFU)
|
||||
#define EURASIA_USE1_IMA32_GPISRC_SHIFT (4)
|
||||
#define EURASIA_USE1_IMA32_GPISRC_MAX (2)
|
||||
|
||||
#define EURASIA_USE1_IMA32_S0BEXT (0x00008000U)
|
||||
|
||||
#endif /* _SGXIMA32USEDEFS_H_ */
|
125
include/gpu_es4/eurasia/hwdefs/sgxmmu.h
Normal file
@ -0,0 +1,125 @@
|
||||
/*!****************************************************************************
|
||||
@File sgxmmu.h
|
||||
|
||||
@Title SGX MMU defines
|
||||
|
||||
@Author Imagination Technologies
|
||||
|
||||
@date 11/10/2005
|
||||
|
||||
@Copyright Copyright 2003-2004 by Imagination Technologies Limited.
|
||||
All rights reserved. No part of this software, either
|
||||
material or conceptual may be copied or distributed,
|
||||
transmitted, transcribed, stored in a retrieval system
|
||||
or translated into any human or computer language in any
|
||||
form by any means, electronic, mechanical, manual or
|
||||
other-wise, or disclosed to third parties without the
|
||||
express written permission of Imagination Technologies
|
||||
Limited, Unit 8, HomePark Industrial Estate,
|
||||
King's Langley, Hertfordshire, WD4 8LZ, U.K.
|
||||
|
||||
@Platform
|
||||
|
||||
@Description Provides SGX MMU declarations and macros
|
||||
|
||||
@DoxygenVer
|
||||
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
Modifications :-
|
||||
|
||||
$Log: sgxmmu.h $
|
||||
*****************************************************************************/
|
||||
|
||||
#if !defined(__SGXMMU_H__)
|
||||
#define __SGXMMU_H__
|
||||
|
||||
#include "sgxdefs.h"
|
||||
|
||||
/* to be implemented */
|
||||
|
||||
/* SGX MMU maps 4Kb pages */
|
||||
#define SGX_MMU_PAGE_SHIFT (12)
|
||||
#define SGX_MMU_PAGE_SIZE (1UL<<SGX_MMU_PAGE_SHIFT)
|
||||
#define SGX_MMU_PAGE_MASK (SGX_MMU_PAGE_SIZE - 1UL)
|
||||
|
||||
/* PD details */
|
||||
#define SGX_MMU_PD_SHIFT (10)
|
||||
#define SGX_MMU_PD_SIZE (1<<SGX_MMU_PD_SHIFT)
|
||||
#define SGX_MMU_PD_MASK (0xFFC00000UL)
|
||||
|
||||
/* PD Entry details */
|
||||
#if defined(SGX_FEATURE_36BIT_MMU)
|
||||
#define SGX_MMU_PDE_ADDR_MASK (0xFFFFFF00UL)
|
||||
#define SGX_MMU_PDE_ADDR_ALIGNSHIFT (4)
|
||||
#else
|
||||
#define SGX_MMU_PDE_ADDR_MASK (0xFFFFF000UL)
|
||||
#define SGX_MMU_PDE_ADDR_ALIGNSHIFT (0)
|
||||
#endif
|
||||
#define SGX_MMU_PDE_VALID (0x00000001UL)
|
||||
/* variable page size control field */
|
||||
#define SGX_MMU_PDE_PAGE_SIZE_4K (0x00000000UL)
|
||||
#define SGX_MMU_PDE_PAGE_SIZE_16K (0x00000002UL)
|
||||
#define SGX_MMU_PDE_PAGE_SIZE_64K (0x00000004UL)
|
||||
#define SGX_MMU_PDE_PAGE_SIZE_256K (0x00000006UL)
|
||||
#define SGX_MMU_PDE_PAGE_SIZE_1M (0x00000008UL)
|
||||
#define SGX_MMU_PDE_PAGE_SIZE_4M (0x0000000AUL)
|
||||
#define SGX_MMU_PDE_PAGE_SIZE_MASK (0x0000000EUL)
|
||||
|
||||
/* PT details */
|
||||
#define SGX_MMU_PT_SHIFT (10)
|
||||
#define SGX_MMU_PT_SIZE (1UL<<SGX_MMU_PT_SHIFT)
|
||||
#define SGX_MMU_PT_MASK (0x003FF000UL)
|
||||
|
||||
/* PT Entry details */
|
||||
#if defined(SGX_FEATURE_36BIT_MMU)
|
||||
#define SGX_MMU_PTE_ADDR_MASK (0xFFFFFF00UL)
|
||||
#define SGX_MMU_PTE_ADDR_ALIGNSHIFT (4)
|
||||
#else
|
||||
#define SGX_MMU_PTE_ADDR_MASK (0xFFFFF000UL)
|
||||
#define SGX_MMU_PTE_ADDR_ALIGNSHIFT (0)
|
||||
#endif
|
||||
#define SGX_MMU_PTE_VALID (0x00000001U)
|
||||
#define SGX_MMU_PTE_WRITEONLY (0x00000002U)
|
||||
#define SGX_MMU_PTE_READONLY (0x00000004U)
|
||||
#define SGX_MMU_PTE_CACHECONSISTENT (0x00000008U)
|
||||
#define SGX_MMU_PTE_EDMPROTECT (0x00000010U)
|
||||
|
||||
/* A BIF tiling range (Min DevVAddr and Max DevVAddr) is given in terms of
|
||||
* address LSBs and MSBs. For example, when defining a range on EUR_CR_BIF_TILE0
|
||||
* bits 31:20 of the range is given. The following definitions describe the bits
|
||||
* involved in providing these addresses.
|
||||
*/
|
||||
|
||||
/* LSB and MSB which can be provided for the Min DevVAddr and Max DevVAddr
|
||||
* in a BIF tiling range.
|
||||
*/
|
||||
#define SGX_BIF_TILING_ADDR_LSB 20
|
||||
#define SGX_BIF_TILING_ADDR_MSB 31
|
||||
#if defined(SGX_FEATURE_BIF_WIDE_TILING_AND_4K_ADDRESS)
|
||||
/* Extended addressing allows for a more fine-grained address
|
||||
* by also defining lower bits of the DevVAddr
|
||||
*/
|
||||
#define SGX_BIF_TILING_EXT_ADDR_LSB 12
|
||||
#define SGX_BIF_TILING_EXT_ADDR_MSB 19
|
||||
#endif
|
||||
|
||||
/* Mask which defines the bits which can be given in the tiling range.
|
||||
* If extended addressing is available the mask is wider.
|
||||
*/
|
||||
#if defined(SGX_FEATURE_BIF_WIDE_TILING_AND_4K_ADDRESS)
|
||||
#define SGX_BIF_TILING_ADDR_MASK 0xFFFFF000U
|
||||
/* inverse of SGX_BIF_TILING_ADDR_MASK */
|
||||
#define SGX_BIF_TILING_ADDR_INV_MASK 0x00000FFFU
|
||||
#else
|
||||
#define SGX_BIF_TILING_ADDR_MASK 0xFFF00000U
|
||||
#define SGX_BIF_TILING_ADDR_INV_MASK 0x000FFFFFU
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __SGXMMU_H__ */
|
||||
|
||||
/*****************************************************************************
|
||||
End of file (sgxmmu.h)
|
||||
*****************************************************************************/
|
4196
include/gpu_es4/eurasia/hwdefs/sgxmpdefs.h
Normal file
1085
include/gpu_es4/eurasia/hwdefs/sgxpdsdefs.h
Normal file
90
include/gpu_es4/eurasia/hwdefs/sgxphasusedefs.h
Normal file
@ -0,0 +1,90 @@
|
||||
/*************************************************************************
|
||||
* Name : sgx545usedefs.h
|
||||
* Title : SGX hw definitions
|
||||
*
|
||||
* Copyright : 2005-2010 by Imagination Technologies Limited. All rights reserved.
|
||||
* : No part of this software, either material or conceptual
|
||||
* : may be copied or distributed, transmitted, transcribed,
|
||||
* : stored in a retrieval system or translated into any
|
||||
* : human or computer language in any form by any means,
|
||||
* : electronic, mechanical, manual or other-wise, or
|
||||
* : disclosed to third parties without the express written
|
||||
* : permission of Imagination Technologies Limited, Unit 8, HomePark
|
||||
* : Industrial Estate, King's Langley, Hertfordshire,
|
||||
* : WD4 8LZ, U.K.
|
||||
*
|
||||
* Platform : ANSI
|
||||
*
|
||||
* Modifications:-
|
||||
* $Log: sgxphasusedefs.h $
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef _SGXPHASUSEDEFS_H_
|
||||
#define _SGXPHASUSEDEFS_H_
|
||||
|
||||
/* Uses OPCAT=OTHER2 with EURASIA_USE1_SPECIAL_OPCAT_EXTRA */
|
||||
#define EURASIA_USE1_OTHER2_OP2_PHAS (2)
|
||||
|
||||
/* PHAS instruction. */
|
||||
#define EURASIA_USE1_OTHER2_PHAS_END (0x00080000)
|
||||
#define EURASIA_USE1_OTHER2_PHAS_IMM (0x00040000)
|
||||
|
||||
#define EURASIA_USE1_OTHER2_PHAS_NONIMM_NOSCHED (0x00000800)
|
||||
|
||||
#define EURASIA_USE1_OTHER2_PHAS_IMM_MODE_CLRMSK (0xFFFFDFFF)
|
||||
#define EURASIA_USE1_OTHER2_PHAS_IMM_MODE_SHIFT (13)
|
||||
|
||||
#define EURASIA_USE1_OTHER2_PHAS_IMM_RATE_CLRMSK (0xFFFFE7FF)
|
||||
#define EURASIA_USE1_OTHER2_PHAS_IMM_RATE_SHIFT (11)
|
||||
|
||||
#define EURASIA_USE1_OTHER2_PHAS_IMM_WAITCOND_CLRMSK (0xFFFFF8FF)
|
||||
#define EURASIA_USE1_OTHER2_PHAS_IMM_WAITCOND_SHIFT (8)
|
||||
|
||||
#define EURASIA_USE1_OTHER2_PHAS_IMM_TCOUNT_CLRMSK (0xFFFFFF00)
|
||||
#define EURASIA_USE1_OTHER2_PHAS_IMM_TCOUNT_SHIFT (0)
|
||||
|
||||
#define EURASIA_USE0_OTHER2_PHAS_IMM_EXEADDR_CLRMSK (~(((1UL << SGX_FEATURE_USE_NUMBER_PC_BITS) - 1) << EURASIA_USE0_OTHER2_PHAS_IMM_EXEADDR_SHIFT))
|
||||
#define EURASIA_USE0_OTHER2_PHAS_IMM_EXEADDR_SHIFT (0)
|
||||
|
||||
#define EURASIA_USE_OTHER2_PHAS_SRC1_MODE_CLRMSK (0xFFFFFFDF)
|
||||
#define EURASIA_USE_OTHER2_PHAS_SRC1_MODE_SHIFT (5)
|
||||
|
||||
#define EURASIA_USE_OTHER2_PHAS_SRC1_WAITCOND_CLRMSK (0xFFFFFFE3)
|
||||
#define EURASIA_USE_OTHER2_PHAS_SRC1_WAITCOND_SHIFT (2)
|
||||
|
||||
#define EURASIA_USE_OTHER2_PHAS_SRC1_RATE_CLRMSK (0xFFFFFFFC)
|
||||
#define EURASIA_USE_OTHER2_PHAS_SRC1_RATE_SHIFT (0)
|
||||
|
||||
#define EURASIA_USE_OTHER2_PHAS_SRC2_TCOUNT_CLRMSK (0x00FFFFFF)
|
||||
#define EURASIA_USE_OTHER2_PHAS_SRC2_TCOUNT_SHIFT (24)
|
||||
|
||||
#define EURASIA_USE_OTHER2_PHAS_SRC2_EXEADDR_CLRMSK (~(((1UL << SGX_FEATURE_USE_NUMBER_PC_BITS) - 1) << EURASIA_USE0_OTHER2_PHAS_IMM_EXEADDR_SHIFT))
|
||||
#define EURASIA_USE_OTHER2_PHAS_SRC2_EXEADDR_SHIFT (0)
|
||||
|
||||
#define EURASIA_USE_OTHER2_PHAS_TCOUNT_ALIGN (4)
|
||||
#define EURASIA_USE_OTHER2_PHAS_TCOUNT_ALIGNSHIFT (2)
|
||||
#define EURASIA_USE_OTHER2_PHAS_TCOUNT_MAX (1020)
|
||||
|
||||
#define EURASIA_USE_OTHER2_PHAS_MODE_PARALLEL (0)
|
||||
#define EURASIA_USE_OTHER2_PHAS_MODE_PERINSTANCE (1)
|
||||
|
||||
#define EURASIA_USE_OTHER2_PHAS_RATE_PIXEL (0)
|
||||
#define EURASIA_USE_OTHER2_PHAS_RATE_SELECTIVE (1)
|
||||
#define EURASIA_USE_OTHER2_PHAS_RATE_SAMPLE (2)
|
||||
#define EURASIA_USE_OTHER2_PHAS_RATE_RESERVED (3)
|
||||
|
||||
#define EURASIA_USE_OTHER2_PHAS_WAITCOND_NONE (0)
|
||||
#define EURASIA_USE_OTHER2_PHAS_WAITCOND_PT (1)
|
||||
#define EURASIA_USE_OTHER2_PHAS_WAITCOND_VCULL (2)
|
||||
#define EURASIA_USE_OTHER2_PHAS_WAITCOND_RESERVED0 (3)
|
||||
#define EURASIA_USE_OTHER2_PHAS_WAITCOND_RESERVED1 (4)
|
||||
#define EURASIA_USE_OTHER2_PHAS_WAITCOND_RESERVED2 (5)
|
||||
#define EURASIA_USE_OTHER2_PHAS_WAITCOND_RESERVED3 (6)
|
||||
#define EURASIA_USE_OTHER2_PHAS_WAITCOND_END (7)
|
||||
|
||||
#if defined(SGX_FEATURE_USE_SPRVV) || defined(SUPPORT_SGX543) || defined(SUPPORT_SGX544) || defined(SUPPORT_SGX554)
|
||||
#define EURASIA_USE_OTHER2_PHAS_TYPEEXT_SPRVV (0x00800000)
|
||||
#endif /* defined(SGX_FEATURE_USE_SPRVV) || defined(SUPPORT_SGX543) */
|
||||
|
||||
#endif /* _SGXPHASUSEDEFS_H_ */
|
||||
|
180
include/gpu_es4/eurasia/hwdefs/sgxptladefs.h
Normal file
@ -0,0 +1,180 @@
|
||||
/******************************************************************************
|
||||
* Name : sgxptladefs.h
|
||||
* Title : SGX PTLA (Present and Texture Load Accelerator) HW definitions
|
||||
*
|
||||
* Copyright : 2009 by Imagination Technologies Limited.
|
||||
* : All rights reserved. No part of this software, either
|
||||
* : material or conceptual may be copied or distributed,
|
||||
* : transmitted, transcribed, stored in a retrieval system or
|
||||
* : translated into any human or computer language in any form
|
||||
* : by any means, electronic, mechanical, manual or otherwise,
|
||||
* : or disclosed to third parties without the express written
|
||||
* : permission of Imagination Technologies Limited,
|
||||
* : Home Park Estate, Kings Langley, Hertfordshire,
|
||||
* : WD4 8LZ, U.K.
|
||||
*
|
||||
* Platform : ANSI
|
||||
*
|
||||
* Modifications:-
|
||||
* $Log: sgxptladefs.h $
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef _SGXPTLADEFS_H_
|
||||
#define _SGXPTLADEFS_H_
|
||||
|
||||
/*****************************************************************************
|
||||
PTLA pixel formats
|
||||
*****************************************************************************/
|
||||
#define EURASIA_PTLA_FORMAT_U8 0x00U // monochrome unsigned 8 bit
|
||||
#define EURASIA_PTLA_FORMAT_4444ARGB 0x01U // 16 bit 4444
|
||||
#define EURASIA_PTLA_FORMAT_1555ARGB 0x02U // 16 bit 1555
|
||||
#define EURASIA_PTLA_FORMAT_565RGB 0x03U // 16 bit 565
|
||||
#define EURASIA_PTLA_FORMAT_U88 0x04U // unsigned 8 bit 2 channels
|
||||
#define EURASIA_PTLA_FORMAT_888RGB 0x05U // 24 bit RGB
|
||||
#define EURASIA_PTLA_FORMAT_8888ARGB 0x06U // 32 bit ARGB
|
||||
#define EURASIA_PTLA_FORMAT_YUV422_YUYV 0x07U // YUV 422 low-high byte order Y0UY1V
|
||||
#define EURASIA_PTLA_FORMAT_YUV422_UYVY 0x08U // YUV 422 low-high byte order UY0VY1
|
||||
#define EURASIA_PTLA_FORMAT_YUV422_YVYU 0x09U // YUV 422 low-high byte order Y0VY1U
|
||||
#define EURASIA_PTLA_FORMAT_YUV422_VYUY 0x0AU // YUV 422 low-high byte order VY0UY1
|
||||
#define EURASIA_PTLA_FORMAT_YUV420_2PLANE 0x0BU // YUV420 2 Plane
|
||||
#define EURASIA_PTLA_FORMAT_YUV420_3PLANE 0x0CU // YUV420 3 Plane
|
||||
#define EURASIA_PTLA_FORMAT_2101010ARGB 0x0DU // 32 bit 2 10 10 10
|
||||
#define EURASIA_PTLA_FORMAT_S8 0x0EU // signed 8 bit
|
||||
#define EURASIA_PTLA_FORMAT_16BPP_RAW 0x0FU // 16 bit raw (no format conversion)
|
||||
#define EURASIA_PTLA_FORMAT_888RSGSBS 0x10U // signed 24 bit rgb
|
||||
#define EURASIA_PTLA_FORMAT_32BPP_RAW 0x11U // 32 bit raw
|
||||
#define EURASIA_PTLA_FORMAT_64BPP_RAW 0x12U // 64 bit raw
|
||||
#define EURASIA_PTLA_FORMAT_128BPP_RAW 0x13U // 128 bit raw
|
||||
|
||||
#define EURASIA_PTLA_FORMAT_MAX 0x13U
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
PTLA Command Stream Block Headers
|
||||
*****************************************************************************/
|
||||
#define EURASIA_PTLA_CTRL_BH 0x00000000U // 0000 - control for upscale and colour key
|
||||
#define EURASIA_PTLA_SRCOFF_BH 0x10000000U // 0001 - source offset
|
||||
#define EURASIA_PTLA_SRCOFF_YUV2_BH 0x20000000U // 0010 - two planer yuv source offset
|
||||
#define EURASIA_PTLA_SRCOFF_YUV3_BH 0x30000000U // 0011 - three planer yuv source offset
|
||||
#define EURASIA_PTLA_SRC_SURF_BH 0x40000000U // 0100 - source surface
|
||||
#define EURASIA_PTLA_DST_SURF_BH 0x50000000U // 0101 - destination surface
|
||||
#define EURASIA_PTLA_BLIT_BH 0x60000000U // 0110 - blt rectangle and kicker
|
||||
#define EURASIA_PTLA_FENCE_BH 0x70000000U // 0111 - fence
|
||||
#define EURASIA_PTLA_FLUSH_BH 0x80000000U // 1111 - flush (fence with interrupt)
|
||||
|
||||
#define EURASIA_PTLA_HEADER_MASK 0xF0000000U
|
||||
|
||||
/*****************************************************************************
|
||||
PTLA Control block for upscale and colour key commands (EURASIA_PTLA_CTRL_BH)
|
||||
*****************************************************************************/
|
||||
// Control Data Present Flags
|
||||
#define EURASIA_PTLA_CTRL_UPSCALE 0x00000001U
|
||||
#define EURASIA_PTLA_CTRL_SRC_CKEY 0x00000002U
|
||||
// Source Colour Key Colour
|
||||
#define EURASIA_PTLA_CTRL_SRC_CKEY_MASK 0xFFFFFFFFU // Colour Key colour (8888 format)
|
||||
#define EURASIA_PTLA_CTRL_SRC_CKEY_SHIFT 0
|
||||
// Source Colour Key Mask
|
||||
#define EURASIA_PTLA_CTRL_SRC_KEYMASK_MASK 0xFFFFFFFFU // Colour Key mask (8888 format)
|
||||
#define EURASIA_PTLA_CTRL_SRC_KEYMASK_SHIFT 0
|
||||
// Upscale
|
||||
#define EURASIA_PTLA_CTRL_UPSCALE_ALPHA_X_MASK 0x000FFC00U // X upscale factor (4.6 format)
|
||||
#define EURASIA_PTLA_CTRL_UPSCALE_ALPHA_X_SHIFT 10
|
||||
#define EURASIA_PTLA_CTRL_UPSCALE_ALPHA_Y_MASK 0x000003FFU // Y upscale factor (4.6 format)
|
||||
#define EURASIA_PTLA_CTRL_UPSCALE_ALPHA_Y_SHIFT 0
|
||||
|
||||
/*****************************************************************************
|
||||
Source Offset command EURASIA_PTLA_SRC_OFF_BH
|
||||
Also for EURASIA_PTLA_SRCOFF_YUV2_BH and EURASIA_PTLA_SRCOFF_YUV3_BH
|
||||
*****************************************************************************/
|
||||
// Source offset
|
||||
#define EURASIA_PTLA_SRCOFF_XSTART_MASK (0x1FFFU << 13) // Source X Start (pixels)
|
||||
#define EURASIA_PTLA_SRCOFF_XSTART_SHIFT 13
|
||||
#define EURASIA_PTLA_SRCOFF_YSTART_MASK 0x1FFFU // Source Y Start (pixels)
|
||||
#define EURASIA_PTLA_SRCOFF_YSTART_SHIFT 0
|
||||
// Source size
|
||||
#define EURASIA_PTLA_SRCOFF_XSIZE_MASK (0x1FFFU << 13) // Source X Size (pixels)
|
||||
#define EURASIA_PTLA_SRCOFF_XSIZE_SHIFT 13
|
||||
#define EURASIA_PTLA_SRCOFF_YSIZE_MASK 0x1FFFU // Source Y Size (pixels)
|
||||
#define EURASIA_PTLA_SRCOFF_YSIZE_SHIFT 0
|
||||
|
||||
/*****************************************************************************
|
||||
PTLA Surface defs for EURASIA_PTLA_SRC_SURF_BH and EURASIA_PTLA_DST_SURF_BH
|
||||
*****************************************************************************/
|
||||
// Surface layout
|
||||
#define EURASIA_PTLA_SURF_LAYOUT_STRIDED 0x00U
|
||||
#define EURASIA_PTLA_SURF_LAYOUT_TILED 0x01U
|
||||
#define EURASIA_PTLA_SURF_LAYOUT_TWIDDLED 0x02U
|
||||
#define EURASIA_PTLA_SURF_LAYOUT_SHIFT 22
|
||||
#define EURASIA_PTLA_SURF_LAYOUT_MASK 0x00C00000U
|
||||
#define EURASIA_PTLA_SURF_LAYOUT_CLRMASK (~EURASIA_PTLA_SURF_TYPE_MASK)
|
||||
// Surface pixel format
|
||||
#define EURASIA_PTLA_SURF_FORMAT_SHIFT 16
|
||||
#define EURASIA_PTLA_SURF_FORMAT_MASK 0x003F0000U
|
||||
// Surface stride
|
||||
#define EURASIA_PTLA_SURF_STRIDE_MASK 0x0000FFFFU
|
||||
#define EURASIA_PTLA_SURF_STRIDE_CLRMASK (~EURASIA_PTLA_SURF_STRIDE_MASK)
|
||||
#define EURASIA_PTLA_SURF_STRIDE_SHIFT 0
|
||||
|
||||
/*****************************************************************************
|
||||
Blit rectangle command EURASIA_PTLA_BLIT_BH (this also kicks the blt)
|
||||
*****************************************************************************/
|
||||
// Copy order (backwards blt)
|
||||
#define EURASIA_PTLA_COPYORDER_MASK 3U
|
||||
#define EURASIA_PTLA_COPYORDER_CLRMASK (~EURASIA_PTLA_COPYORDER_MASK)
|
||||
#define EURASIA_PTLA_COPYORDER_TL2BR 0U
|
||||
#define EURASIA_PTLA_COPYORDER_BR2TL 1U
|
||||
#define EURASIA_PTLA_COPYORDER_TR2BL 2U
|
||||
#define EURASIA_PTLA_COPYORDER_BL2TR 3U
|
||||
// Rotation
|
||||
#define EURASIA_PTLA_ROT_SHIFT 2
|
||||
#define EURASIA_PTLA_ROT_MASK (3U<<EURASIA_PTLA_ROT_SHIFT)
|
||||
#define EURASIA_PTLA_ROT_CLRMASK (~EURASIA_PTLA_ROT_MASK)
|
||||
#define EURASIA_PTLA_ROT_NONE (0U<<EURASIA_PTLA_ROT_SHIFT)
|
||||
#define EURASIA_PTLA_ROT_90DEGS (1U<<EURASIA_PTLA_ROT_SHIFT)
|
||||
#define EURASIA_PTLA_ROT_180DEGS (2U<<EURASIA_PTLA_ROT_SHIFT)
|
||||
#define EURASIA_PTLA_ROT_270DEGS (3U<<EURASIA_PTLA_ROT_SHIFT)
|
||||
// Fill control
|
||||
#define EURASIA_PTLA_FILL_MASK (1U<<4)
|
||||
#define EURASIA_PTLA_FILL_CLRMASK (~EURASIA_PTLA_FILL_MASK)
|
||||
#define EURASIA_PTLA_FILL_ENABLE (1U<<4)
|
||||
// Enable SRC colour key
|
||||
#define EURASIA_PTLA_SRCCK_MASK (1U<<5)
|
||||
#define EURASIA_PTLA_SRCCK_CLRMASK (~EURASIA_PTLA_SRCCK_MASK)
|
||||
#define EURASIA_PTLA_SRCCK_ENABLE (1U<<5)
|
||||
// Upscale control
|
||||
#define EURASIA_PTLA_UPSCALE_MASK (1U<<6)
|
||||
#define EURASIA_PTLA_UPSCALE_CLRMASK (~EURASIA_PTLA_UPSCALE_MASK)
|
||||
#define EURASIA_PTLA_UPSCALE_ENABLE (1U<<6)
|
||||
// Downscale control
|
||||
#define EURASIA_PTLA_DOWNSCALE_MASK (1U<<7)
|
||||
#define EURASIA_PTLA_DOWNSCALE_CLRMASK (~EURASIA_PTLA_DOWNSCALE_MASK)
|
||||
#define EURASIA_PTLA_DOWNSCALE_ENABLE (1U<<7)
|
||||
// Colour key pass/reject op
|
||||
#define EURASIA_PTLA_SRCCK_PASS_MASK (1U<<8)
|
||||
#define EURASIA_PTLA_SRCCK_PASS_CLRMASK (~EURASIA_PTLA_SRCCK_PASS_MASK)
|
||||
#define EURASIA_PTLA_SRCCK_PASS_ENABLE (1U<<8)
|
||||
// Fill colour RGBA8888 (only required if EURASIA_PTLA_FILL_ENABLE is set)
|
||||
#define EURASIA_PTLA_FILLCOLOUR_MASK 0xFFFFFFFFU
|
||||
#define EURASIA_PTLA_FILLCOLOUR_SHIFT 0
|
||||
// Dest X start (also required for YUV multi plane formats)
|
||||
#define EURASIA_PTLA_DST_XSTART_MASK (0x1FFFU<<13)
|
||||
#define EURASIA_PTLA_DST_XSTART_CLRMASK (~EURASIA_PTLA_DST_XSTART_MASK)
|
||||
#define EURASIA_PTLA_DST_XSTART_SHIFT 13
|
||||
// Dest Y start (also required for YUV multi plane formats)
|
||||
#define EURASIA_PTLA_DST_YSTART_MASK (0x1FFFU)
|
||||
#define EURASIA_PTLA_DST_YSTART_CLRMASK (~EURASIA_PTLA_DST_YSTART_MASK)
|
||||
#define EURASIA_PTLA_DST_YSTART_SHIFT 0
|
||||
// Dest X size
|
||||
#define EURASIA_PTLA_DST_XSIZE_MASK (0x1FFFU<<13)
|
||||
#define EURASIA_PTLA_DST_XSIZE_CLRMASK (~EURASIA_PTLA_DST_XSIZE_MASK)
|
||||
#define EURASIA_PTLA_DST_XSIZE_SHIFT 13
|
||||
// Dest Y size
|
||||
#define EURASIA_PTLA_DST_YSIZE_MASK (0x1FFFU)
|
||||
#define EURASIA_PTLA_DST_YSIZE_CLRMASK (~EURASIA_PTLA_DST_YSIZE_MASK)
|
||||
#define EURASIA_PTLA_DST_YSIZE_SHIFT 0
|
||||
|
||||
#endif // _SGXPTLADEFS_H_
|
||||
|
||||
/******************************************************************************
|
||||
End of file (sgxptlsdefs.h)
|
||||
******************************************************************************/
|
94
include/gpu_es4/eurasia/hwdefs/sgxusespecialbankdefs.h
Normal file
@ -0,0 +1,94 @@
|
||||
/*************************************************************************
|
||||
* Name : sgxusespecialbankdefs.h
|
||||
* Title : SGX hw definitions
|
||||
*
|
||||
* Copyright : 2005-2010 by Imagination Technologies Limited. All rights reserved.
|
||||
* : No part of this software, either material or conceptual
|
||||
* : may be copied or distributed, transmitted, transcribed,
|
||||
* : stored in a retrieval system or translated into any
|
||||
* : human or computer language in any form by any means,
|
||||
* : electronic, mechanical, manual or other-wise, or
|
||||
* : disclosed to third parties without the express written
|
||||
* : permission of Imagination Technologies Limited, Unit 8, HomePark
|
||||
* : Industrial Estate, King's Langley, Hertfordshire,
|
||||
* : WD4 8LZ, U.K.
|
||||
*
|
||||
* Platform : ANSI
|
||||
*
|
||||
* Modifications:-
|
||||
* $Log: sgxusespecialbankdefs.h $
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef _SGXUSESPECIALBANKDEFS_H
|
||||
#define _SGXUSESPECIALBANKDEFS_H
|
||||
|
||||
#define EURASIA_USE_SPECIAL_BANK_G0 (0)
|
||||
#define EURASIA_USE_SPECIAL_BANK_G1 (1)
|
||||
#define EURASIA_USE_SPECIAL_BANK_G2 (2)
|
||||
#define EURASIA_USE_SPECIAL_BANK_G3 (3)
|
||||
#define EURASIA_USE_SPECIAL_BANK_G4 (4)
|
||||
#define EURASIA_USE_SPECIAL_BANK_G5 (5)
|
||||
#define EURASIA_USE_SPECIAL_BANK_G6 (6)
|
||||
#define EURASIA_USE_SPECIAL_BANK_G7 (7)
|
||||
#define EURASIA_USE_SPECIAL_BANK_G8 (8)
|
||||
#define EURASIA_USE_SPECIAL_BANK_G9 (9)
|
||||
#define EURASIA_USE_SPECIAL_BANK_G10 (10)
|
||||
#define EURASIA_USE_SPECIAL_BANK_G11 (11)
|
||||
#define EURASIA_USE_SPECIAL_BANK_G12 (12)
|
||||
#define EURASIA_USE_SPECIAL_BANK_G13 (13)
|
||||
#define EURASIA_USE_SPECIAL_BANK_G14 (14)
|
||||
#define EURASIA_USE_SPECIAL_BANK_G15 (15)
|
||||
#define EURASIA_USE_SPECIAL_BANK_BFCONTROL (16)
|
||||
#define EURASIA_USE_SPECIAL_BANK_PIPENUMBER (17)
|
||||
#define EURASIA_USE_SPECIAL_BANK_OUTPUTBASE (18)
|
||||
#define EURASIA_USE_SPECIAL_BANK_SEQUENCENUMBER (19)
|
||||
#define EURASIA_USE_SPECIAL_BANK_INSTANCEVALIDMASK (20)
|
||||
#define EURASIA_USE_SPECIAL_BANK_TASKID (21)
|
||||
#define EURASIA_USE_SPECIAL_BANK_SLOTNUMBER (22)
|
||||
#define EURASIA_USE_SPECIAL_BANK_QUADRANTX (23)
|
||||
#define EURASIA_USE_SPECIAL_BANK_TILEY (24)
|
||||
#define EURASIA_USE_SPECIAL_BANK_INSTNRINSLOT (25)
|
||||
#define EURASIA_USE_SPECIAL_BANK_MOEITERATIONNR (26)
|
||||
#define EURASIA_USE_SPECIAL_BANK_TASKQUEUEDATA0 (27)
|
||||
#define EURASIA_USE_SPECIAL_BANK_TASKQUEUEDATA1 (28)
|
||||
#define EURASIA_USE_SPECIAL_BANK_TASKQUEUEDATA2 (29)
|
||||
#define EURASIA_USE_SPECIAL_BANK_TASKQUEUEDATA3 (30)
|
||||
#define EURASIA_USE_SPECIAL_BANK_TASKQUEUEDATA4 (31)
|
||||
#define EURASIA_USE_SPECIAL_BANK_TASKQUEUEDATA5 (32)
|
||||
#define EURASIA_USE_SPECIAL_BANK_TASKQUEUEDATA6 (33)
|
||||
#define EURASIA_USE_SPECIAL_BANK_TASKTYPE (34)
|
||||
|
||||
#if defined(SGX543) || defined(SGX544) || defined(SGX554)
|
||||
#define EURASIA_USE_SPECIAL_BANK_EDGEMASK0 (36)
|
||||
#define EURASIA_USE_SPECIAL_BANK_EDGEMASK1 (37)
|
||||
#define EURASIA_USE_SPECIAL_BANK_EDGEMASK2 (38)
|
||||
#define EURASIA_USE_SPECIAL_BANK_EDGEMASK3 (39)
|
||||
#define EURASIA_USE_SPECIAL_BANK_INSTNRINTASK (40)
|
||||
#define EURASIA_USE_SPECIAL_BANK_SECCATTRSIZE (41)
|
||||
#define EURASIA_USE_SPECIAL_BANK_BATCHNUMBER (42)
|
||||
#define EURASIA_USE_SPECIAL_BANK_TILEXY (43)
|
||||
#else /* !defined(SGX543) && !defined(SGX544) */
|
||||
#define EURASIA_USE_SPECIAL_BANK_RESERVED0 (35)
|
||||
#define EURASIA_USE_SPECIAL_BANK_EDGEMASK0 (36)
|
||||
#define EURASIA_USE_SPECIAL_BANK_EDGEMASK1 (37)
|
||||
#define EURASIA_USE_SPECIAL_BANK_EDGEMASKSELECT (38)
|
||||
#define EURASIA_USE_SPECIAL_BANK_INSTNRINTASK (39)
|
||||
#endif /* !defined(SGX543) && !defined(SGX544) */
|
||||
|
||||
#if defined(SGX545)
|
||||
#define EURASIA_USE_SPECIAL_BANK_SECCATTRSIZE (40)
|
||||
#define EURASIA_USE_SPECIAL_BANK_INPUTCOVERAGEMSK (41)
|
||||
#define EURASIA_USE_SPECIAL_BANK_INPUTCOVERAGEVAL (42)
|
||||
#define EURASIA_USE_SPECIAL_BANK_PIXELINTENSITY (43)
|
||||
#endif /* !defined(SGX545) */
|
||||
|
||||
#if defined(SGX545) || defined(SUPPORT_SGX545)
|
||||
#define EURASIA_USE_SPECIAL_BANK_SAMPLENUMBER (44)
|
||||
#endif /* !defined(SGX545) || defined(SUPPORT_SGX545) */
|
||||
|
||||
/*
|
||||
Only available for chip versions with multiple cores.
|
||||
*/
|
||||
#define EURASIA_USE_SPECIAL_BANK_CORENUMBER (45)
|
||||
|
||||
#endif /* _SGXUSESPECIALBANKDEFS_H */
|
1305
include/gpu_es4/eurasia/hwdefs/sgxvec34usedefs.h
Normal file
4990
include/gpu_es4/eurasia/hwdefs/usecodegen.h
Normal file
143
include/gpu_es4/eurasia/include4/bitops.h
Normal file
@ -0,0 +1,143 @@
|
||||
/******************************************************************************
|
||||
* Name : bitops.h
|
||||
* Title : Utility funtions/macros for bitwise operations
|
||||
* Created : April 2005
|
||||
*
|
||||
* Copyright : 2002-2007 by Imagination Technologies Ltd.
|
||||
* All rights reserved. No part of this software, either
|
||||
* material or conceptual may be copied or distributed,
|
||||
* transmitted, transcribed, stored in a retrieval system or
|
||||
* translated into any human or computer language in any form
|
||||
* by any means, electronic, mechanical, manual or otherwise,
|
||||
* or disclosed to third parties without the express written
|
||||
* permission of Imagination Technologies Ltd,
|
||||
* Home Park Estate, Kings Langley, Hertfordshire,
|
||||
* WD4 8LZ, U.K.
|
||||
*
|
||||
* Modifications :-
|
||||
* $Log: bitops.h $
|
||||
*****************************************************************************/
|
||||
|
||||
#if !defined (__BITOPS_H__)
|
||||
#define __BITOPS_H__
|
||||
|
||||
|
||||
FORCE_INLINE IMG_UINT32 GetRange(IMG_UINT32 auArr[],
|
||||
const IMG_UINT32 uTop,
|
||||
const IMG_UINT32 uBottom)
|
||||
{
|
||||
IMG_UINT32 uBitData;
|
||||
const IMG_UINT32 uTopLong = uTop >> 5;
|
||||
const IMG_UINT32 uBottomLong = uBottom >> 5;
|
||||
const IMG_UINT32 uBottomShift = (IMG_UINT32)uBottom & 0x1FL;
|
||||
const IMG_UINT32 uRange = (uTop - uBottom) + 1;
|
||||
const IMG_UINT32 uDataMask = ((uRange == 32) ?
|
||||
0xFFFFFFFFL :
|
||||
((IMG_UINT32)((1L << uRange) - 1L)));
|
||||
|
||||
if (uTopLong == uBottomLong)
|
||||
{
|
||||
/* data fits within one of our 32-bit chunks */
|
||||
uBitData = ((auArr[uBottomLong] >> uBottomShift) & uDataMask);
|
||||
}
|
||||
else
|
||||
{
|
||||
uBitData = (((auArr[uBottomLong] >> uBottomShift) |
|
||||
(auArr[uTopLong] << (32L - uBottomShift))) &
|
||||
uDataMask);
|
||||
}
|
||||
|
||||
return uBitData;
|
||||
}
|
||||
|
||||
#define BITS_PER_NIBBLE (4)
|
||||
#define NIBBLE_MASK ((1 << BITS_PER_NIBBLE) - 1)
|
||||
#define NIBBLES_PER_UINT (32 / BITS_PER_NIBBLE)
|
||||
|
||||
FORCE_INLINE IMG_UINT32 GetNibble(const IMG_UINT32 auArr[], const IMG_UINT32 uPos)
|
||||
{
|
||||
const IMG_UINT32 uElem = uPos / NIBBLES_PER_UINT;
|
||||
const IMG_UINT32 uShift = (uPos % NIBBLES_PER_UINT) * BITS_PER_NIBBLE;
|
||||
|
||||
return (auArr[uElem] >> uShift) & NIBBLE_MASK;
|
||||
}
|
||||
|
||||
FORCE_INLINE IMG_VOID SetNibble(IMG_UINT32 auArr[], const IMG_UINT32 uPos, const IMG_UINT32 uValue)
|
||||
{
|
||||
const IMG_UINT32 uElem = uPos / NIBBLES_PER_UINT;
|
||||
const IMG_UINT32 uShift = (uPos % NIBBLES_PER_UINT) * BITS_PER_NIBBLE;
|
||||
|
||||
auArr[uElem] &= ~(NIBBLE_MASK << uShift);
|
||||
auArr[uElem] |= ((uValue & NIBBLE_MASK) << uShift);
|
||||
}
|
||||
|
||||
FORCE_INLINE IMG_UINT32 GetBit( const IMG_UINT32 auArr[], const IMG_UINT32 uPos )
|
||||
{
|
||||
return auArr[uPos >> 5] & (1U << (uPos % 32)) ? 1 : 0;
|
||||
}
|
||||
|
||||
/*
|
||||
Write the given bits into the given index locations of auArr
|
||||
*/
|
||||
FORCE_INLINE IMG_VOID SetRange(IMG_UINT32 auArr[],
|
||||
const IMG_UINT32 uTop,
|
||||
const IMG_UINT32 uBottom,
|
||||
const IMG_UINT32 uBitData)
|
||||
{
|
||||
const IMG_UINT32 uTopLong = uTop >> 5;
|
||||
const IMG_UINT32 uBottomLong = uBottom >> 5;
|
||||
const IMG_UINT32 uBottomShift = (IMG_UINT32)uBottom & 0x1FL;
|
||||
const IMG_UINT32 uRange = (uTop - uBottom) + 1;
|
||||
const IMG_UINT32 uDataMask = ((uRange == 32) ?
|
||||
0xFFFFFFFFL :
|
||||
((IMG_UINT32)((1L << uRange) - 1L)));
|
||||
|
||||
if (uTopLong == uBottomLong)
|
||||
{
|
||||
/*
|
||||
data fits within one of our 32-bit chunks
|
||||
*/
|
||||
auArr[uBottomLong] = (auArr[uBottomLong] &
|
||||
(~(uDataMask << uBottomShift))) |
|
||||
((uBitData & uDataMask) << uBottomShift);
|
||||
}
|
||||
else
|
||||
{
|
||||
const IMG_UINT32 uTopShift = 32L - uBottomShift;
|
||||
|
||||
/*
|
||||
data is split across two of our 32-bit chunks
|
||||
*/
|
||||
auArr[uTopLong] = (auArr[uTopLong] & (~(uDataMask >> uTopShift))) |
|
||||
((uBitData & uDataMask) >> uTopShift);
|
||||
auArr[uBottomLong] = (auArr[uBottomLong] &
|
||||
(~(uDataMask << uBottomShift))) |
|
||||
((uBitData & uDataMask) << uBottomShift);
|
||||
}
|
||||
}
|
||||
|
||||
FORCE_INLINE IMG_VOID SetBit( IMG_UINT32 auArr[], IMG_UINT32 uBit, IMG_UINT32 uBitData )
|
||||
{
|
||||
if (uBitData)
|
||||
{
|
||||
auArr[uBit >> 5] |= (1U << (uBit % 32));
|
||||
}
|
||||
else
|
||||
{
|
||||
auArr[uBit >> 5] &= ~(1U << (uBit % 32));
|
||||
}
|
||||
}
|
||||
|
||||
FORCE_INLINE IMG_UINT32 CountBits(IMG_UINT32 auArr[], IMG_UINT32 uEnd, IMG_UINT32 uStart)
|
||||
{
|
||||
IMG_UINT32 uCount, i;
|
||||
|
||||
uCount = 0;
|
||||
for (i = uStart; i <= uEnd; i++)
|
||||
{
|
||||
uCount += GetBit(auArr, i);
|
||||
}
|
||||
return uCount;
|
||||
}
|
||||
|
||||
#endif /* if !defined (__BITOPS_H__) */
|
174
include/gpu_es4/eurasia/include4/img_3dtypes.h
Normal file
@ -0,0 +1,174 @@
|
||||
/******************************************************************************
|
||||
* Name : img_3dtypes.h
|
||||
* Title : Global 3D types for use by IMG APIs
|
||||
* Author(s) : Imagination Technologies
|
||||
* Created : 8th April 2009
|
||||
*
|
||||
* Copyright : 2003-2006 by Imagination Technologies Limited.
|
||||
* All rights reserved. No part of this software, either material
|
||||
* or conceptual may be copied or distributed, transmitted,
|
||||
* transcribed, stored in a retrieval system or translated into
|
||||
* any human or computer language in any form by any means,
|
||||
* electronic, mechanical, manual or otherwise, or disclosed
|
||||
* to third parties without the express written permission of
|
||||
* Imagination Technologies Limited, Home Park Estate,
|
||||
* Kings Langley, Hertfordshire, WD4 8LZ, U.K.
|
||||
*
|
||||
* Description : Defines 3D types for use by IMG APIs
|
||||
*
|
||||
* Platform : Generic
|
||||
*
|
||||
* Modifications:-
|
||||
* $Log: img_3dtypes.h $
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __IMG_3DTYPES_H__
|
||||
#define __IMG_3DTYPES_H__
|
||||
|
||||
/**
|
||||
* Comparison functions
|
||||
* This comparison function is defined as:
|
||||
* A {CmpFunc} B
|
||||
* A is a reference value, e.g., incoming depth etc.
|
||||
* B is the sample value, e.g., value in depth buffer.
|
||||
*/
|
||||
typedef enum _IMG_COMPFUNC_
|
||||
{
|
||||
IMG_COMPFUNC_NEVER, /**< The comparison never succeeds */
|
||||
IMG_COMPFUNC_LESS, /**< The comparison is a less-than operation */
|
||||
IMG_COMPFUNC_EQUAL, /**< The comparison is an equal-to operation */
|
||||
IMG_COMPFUNC_LESS_EQUAL, /**< The comparison is a less-than or equal-to
|
||||
operation */
|
||||
IMG_COMPFUNC_GREATER, /**< The comparison is a greater-than operation
|
||||
*/
|
||||
IMG_COMPFUNC_NOT_EQUAL, /**< The comparison is a no-equal-to operation
|
||||
*/
|
||||
IMG_COMPFUNC_GREATER_EQUAL, /**< The comparison is a greater-than or
|
||||
equal-to operation */
|
||||
IMG_COMPFUNC_ALWAYS, /**< The comparison always succeeds */
|
||||
} IMG_COMPFUNC;
|
||||
|
||||
/**
|
||||
* Stencil op functions
|
||||
*/
|
||||
typedef enum _IMG_STENCILOP_
|
||||
{
|
||||
IMG_STENCILOP_KEEP, /**< Keep original value */
|
||||
IMG_STENCILOP_ZERO, /**< Set stencil to 0 */
|
||||
IMG_STENCILOP_REPLACE, /**< Replace stencil entry */
|
||||
IMG_STENCILOP_INCR_SAT, /**< Increment stencil entry, clamping to max */
|
||||
IMG_STENCILOP_DECR_SAT, /**< Decrement stencil entry, clamping to zero */
|
||||
IMG_STENCILOP_INVERT, /**< Invert bits in stencil entry */
|
||||
IMG_STENCILOP_INCR, /**< Increment stencil entry,
|
||||
wrapping if necessary */
|
||||
IMG_STENCILOP_DECR, /**< Decrement stencil entry,
|
||||
wrapping if necessary */
|
||||
} IMG_STENCILOP;
|
||||
|
||||
/**
|
||||
* Memory layout enumeration.
|
||||
* Defines how pixels are layed out within a surface.
|
||||
*/
|
||||
typedef enum _IMG_MEMLAYOUT_
|
||||
{
|
||||
IMG_MEMLAYOUT_STRIDED, /**< Resource is strided, one row at a time */
|
||||
IMG_MEMLAYOUT_HYBRIDTWIDDLED, /**< Resource is hybrid twiddled */
|
||||
IMG_MEMLAYOUT_TWIDDLED, /**< Resource is twiddled, classic style */
|
||||
IMG_MEMLAYOUT_TILED, /**< Resource is tiled, 32x32 */
|
||||
} IMG_MEMLAYOUT;
|
||||
|
||||
typedef enum _IMG_SCALING_
|
||||
{
|
||||
IMG_SCALING_NONE, /**< Apply no scaling */
|
||||
IMG_SCALING_AA, /**< Apply Bartlett 4 sample downscaling */
|
||||
IMG_SCALING_UPSCALE, /**< Apply 2x2 replicated upscaling */
|
||||
IMG_SCALING_UPAA, /**< Apply Bartlett downscaling, followed by 2x2 upscaling */
|
||||
} IMG_SCALING;
|
||||
|
||||
|
||||
/**
|
||||
* Alpha blending allows colours and textures on one surface
|
||||
* to be blended with transparancy onto another surface.
|
||||
* These definitions apply to both source and destination blending
|
||||
* states
|
||||
*/
|
||||
typedef enum _IMG_BLEND_
|
||||
{
|
||||
IMG_BLEND_ZERO = 0, /**< Blend factor is (0,0,0,0) */
|
||||
IMG_BLEND_ONE, /**< Blend factor is (1,1,1,1) */
|
||||
IMG_BLEND_SRC_COLOUR, /**< Blend factor is the source colour */
|
||||
IMG_BLEND_INV_SRC_COLOUR, /**< Blend factor is the inverted source colour
|
||||
(i.e. 1-src_col) */
|
||||
IMG_BLEND_SRC_ALPHA, /**< Blend factor is the source alpha */
|
||||
IMG_BLEND_INV_SRC_ALPHA, /**< Blend factor is the inverted source alpha
|
||||
(i.e. 1-src_alpha) */
|
||||
IMG_BLEND_DEST_ALPHA, /**< Blend factor is the destination alpha */
|
||||
IMG_BLEND_INV_DEST_ALPHA, /**< Blend factor is the inverted destination
|
||||
alpha */
|
||||
IMG_BLEND_DEST_COLOUR, /**< Blend factor is the destination colour */
|
||||
IMG_BLEND_INV_DEST_COLOUR, /**< Blend factor is the inverted destination
|
||||
colour */
|
||||
IMG_BLEND_SRC_ALPHASAT, /**< Blend factor is the alpha saturation (the
|
||||
minimum of (Src alpha,
|
||||
1 - destination alpha)) */
|
||||
IMG_BLEND_BLEND_FACTOR, /**< Blend factor is a constant */
|
||||
IMG_BLEND_INVBLEND_FACTOR, /**< Blend factor is a constant (inverted)*/
|
||||
IMG_BLEND_SRC1_COLOUR, /**< Blend factor is the colour outputted from
|
||||
the pixel shader */
|
||||
IMG_BLEND_INV_SRC1_COLOUR, /**< Blend factor is the inverted colour
|
||||
outputted from the pixel shader */
|
||||
IMG_BLEND_SRC1_ALPHA, /**< Blend factor is the alpha outputted from
|
||||
the pixel shader */
|
||||
IMG_BLEND_INV_SRC1_ALPHA /**< Blend factor is the inverted alpha
|
||||
outputted from the pixel shader */
|
||||
} IMG_BLEND;
|
||||
|
||||
/**
|
||||
* The arithmetic operation to perform when blending
|
||||
*/
|
||||
typedef enum _IMG_BLENDOP_
|
||||
{
|
||||
IMG_BLENDOP_ADD = 0, /**< Result = (Source + Destination)*/
|
||||
IMG_BLENDOP_SUBTRACT, /**< Result = (Source - Destination) */
|
||||
IMG_BLENDOP_REV_SUBTRACT, /**< Result = (Destination - Source) */
|
||||
IMG_BLENDOP_MIN, /**< Result = min (Source, Destination) */
|
||||
IMG_BLENDOP_MAX /**< Result = max (Source, Destination) */
|
||||
} IMG_BLENDOP;
|
||||
|
||||
/**
|
||||
* Type of fog blending supported
|
||||
*/
|
||||
typedef enum _IMG_FOGMODE_
|
||||
{
|
||||
IMG_FOGMODE_NONE, /**< No fog blending - fog calculations are
|
||||
* based on the value output from the vertex phase */
|
||||
IMG_FOGMODE_LINEAR, /**< Linear interpolation */
|
||||
IMG_FOGMODE_EXP, /**< Exponential */
|
||||
IMG_FOGMODE_EXP2, /**< Exponential squaring */
|
||||
} IMG_FOGMODE;
|
||||
|
||||
/**
|
||||
* Culling based on winding order of triangle.
|
||||
*/
|
||||
typedef enum _IMG_CULLMODE_
|
||||
{
|
||||
IMG_CULLMODE_NONE, /**< Don't cull */
|
||||
IMG_CULLMODE_CLOCKWISE, /**< Cull clockwise triangles */
|
||||
IMG_CULLMODE_ANTICLOCKWISE, /**< Cull anti-clockwise triangles */
|
||||
} IMG_CULLMODE;
|
||||
|
||||
/**
|
||||
* Rotation counter-clockwise
|
||||
*/
|
||||
typedef enum _IMG_ROTATION_
|
||||
{
|
||||
IMG_ROTATION_0DEG,
|
||||
IMG_ROTATION_90DEG,
|
||||
IMG_ROTATION_180DEG,
|
||||
IMG_ROTATION_270DEG
|
||||
} IMG_ROTATION;
|
||||
|
||||
#endif /* __IMG_3DTYPES_H__ */
|
||||
/******************************************************************************
|
||||
End of file (img_3dtypes.h)
|
||||
******************************************************************************/
|
164
include/gpu_es4/eurasia/include4/img_defs.h
Normal file
@ -0,0 +1,164 @@
|
||||
/*!****************************************************************************
|
||||
@File img_defs.h
|
||||
|
||||
@Title Common header containing type definitions for portability
|
||||
|
||||
@Author Imagination Technologies
|
||||
|
||||
@date August 2001
|
||||
|
||||
@Copyright Copyright 2003-2008 by Imagination Technologies Limited.
|
||||
All rights reserved. No part of this software, either material
|
||||
or conceptual may be copied or distributed, transmitted,
|
||||
transcribed, stored in a retrieval system or translated into
|
||||
any human or computer language in any form by any means,
|
||||
electronic, mechanical, manual or other-wise, or disclosed to
|
||||
third parties without the express written permission of
|
||||
Imagination Technologies Limited, Home Park Estate,
|
||||
Kings Langley, Hertfordshire, WD4 8LZ, U.K.
|
||||
|
||||
@Platform cross platform / environment
|
||||
|
||||
@Description Contains variable and structure definitions. Any platform
|
||||
specific types should be defined in this file.
|
||||
|
||||
@DoxygenVer
|
||||
|
||||
Modifications :-
|
||||
$Log: img_defs.h $
|
||||
*******************************************************************************/
|
||||
#if !defined (__IMG_DEFS_H__)
|
||||
#define __IMG_DEFS_H__
|
||||
|
||||
#include "img_types.h"
|
||||
|
||||
typedef enum img_tag_TriStateSwitch
|
||||
{
|
||||
IMG_ON = 0x00,
|
||||
IMG_OFF,
|
||||
IMG_IGNORE
|
||||
|
||||
} img_TriStateSwitch, * img_pTriStateSwitch;
|
||||
|
||||
#define IMG_SUCCESS 0
|
||||
|
||||
#define IMG_NO_REG 1
|
||||
|
||||
#if defined (NO_INLINE_FUNCS)
|
||||
#define INLINE
|
||||
#define FORCE_INLINE
|
||||
#else
|
||||
#if defined (__cplusplus)
|
||||
#define INLINE inline
|
||||
#define FORCE_INLINE inline
|
||||
#else
|
||||
#if !defined(INLINE)
|
||||
#define INLINE __inline
|
||||
#endif
|
||||
#define FORCE_INLINE static __inline
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
/* Use this in any file, or use attributes under GCC - see below */
|
||||
#ifndef PVR_UNREFERENCED_PARAMETER
|
||||
#define PVR_UNREFERENCED_PARAMETER(param) (param) = (param)
|
||||
#endif
|
||||
|
||||
/* The best way to supress unused parameter warnings using GCC is to use a
|
||||
* variable attribute. Place the unref__ between the type and name of an
|
||||
* unused parameter in a function parameter list, eg `int unref__ var'. This
|
||||
* should only be used in GCC build environments, for example, in files that
|
||||
* compile only on Linux. Other files should use UNREFERENCED_PARAMETER */
|
||||
#ifdef __GNUC__
|
||||
#define unref__ __attribute__ ((unused))
|
||||
#else
|
||||
#define unref__
|
||||
#endif
|
||||
|
||||
/*
|
||||
Wide character definitions
|
||||
*/
|
||||
#ifndef _TCHAR_DEFINED
|
||||
#if defined(UNICODE)
|
||||
typedef unsigned short TCHAR, *PTCHAR, *PTSTR;
|
||||
#else /* #if defined(UNICODE) */
|
||||
typedef char TCHAR, *PTCHAR, *PTSTR;
|
||||
#endif /* #if defined(UNICODE) */
|
||||
#define _TCHAR_DEFINED
|
||||
#endif /* #ifndef _TCHAR_DEFINED */
|
||||
|
||||
|
||||
#if defined(__linux__) || defined(__METAG)
|
||||
|
||||
#define IMG_CALLCONV
|
||||
#define IMG_INTERNAL __attribute__((visibility("hidden")))
|
||||
#define IMG_EXPORT __attribute__((visibility("default")))
|
||||
#define IMG_IMPORT
|
||||
#define IMG_RESTRICT __restrict__
|
||||
|
||||
#elif defined(__psp2__) && defined(IMG_PSP2_PRX_EXPORT_INTERNAL)
|
||||
|
||||
#define IMG_CALLCONV
|
||||
#define IMG_INTERNAL __declspec(dllexport)
|
||||
#define IMG_EXPORT __declspec(dllexport)
|
||||
#define IMG_IMPORT __declspec(dllexport)
|
||||
#define IMG_RESTRICT __restrict__
|
||||
|
||||
#elif defined(__psp2__) && defined(IMG_PSP2_PRX_EXPORT)
|
||||
|
||||
#define IMG_CALLCONV
|
||||
#define IMG_INTERNAL
|
||||
#define IMG_EXPORT __declspec(dllexport)
|
||||
#define IMG_IMPORT
|
||||
#define IMG_RESTRICT __restrict__
|
||||
|
||||
#elif defined(__psp2__)
|
||||
|
||||
#define IMG_CALLCONV
|
||||
#define IMG_INTERNAL
|
||||
#define IMG_EXPORT
|
||||
#define IMG_IMPORT
|
||||
#define IMG_RESTRICT __restrict__
|
||||
|
||||
#else
|
||||
#error("define an OS")
|
||||
#endif
|
||||
|
||||
// Use default definition if not overridden
|
||||
#ifndef IMG_ABORT
|
||||
#define IMG_ABORT() sceKernelExitProcess(-1)
|
||||
#endif
|
||||
|
||||
#ifndef IMG_MALLOC
|
||||
#define IMG_MALLOC(A) malloc (A)
|
||||
#endif
|
||||
|
||||
#ifndef IMG_FREE
|
||||
#define IMG_FREE(A) free (A)
|
||||
#endif
|
||||
|
||||
#define IMG_CONST const
|
||||
|
||||
#if defined(__GNUC__)
|
||||
#define IMG_FORMAT_PRINTF(x,y) __attribute__((format(printf,x,y)))
|
||||
#else
|
||||
#define IMG_FORMAT_PRINTF(x,y)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Cleanup request defines
|
||||
*/
|
||||
#define CLEANUP_WITH_POLL IMG_FALSE
|
||||
#define FORCE_CLEANUP IMG_TRUE
|
||||
|
||||
#if defined (_WIN64)
|
||||
#define IMG_UNDEF (~0ULL)
|
||||
#else
|
||||
#define IMG_UNDEF (~0UL)
|
||||
#endif
|
||||
|
||||
#endif /* #if !defined (__IMG_DEFS_H__) */
|
||||
/*****************************************************************************
|
||||
End of file (IMG_DEFS.H)
|
||||
*****************************************************************************/
|
145
include/gpu_es4/eurasia/include4/img_list.h
Normal file
@ -0,0 +1,145 @@
|
||||
/*
|
||||
* Copyright © 2010 Intel Corporation
|
||||
* Copyright © 2010 Francisco Jerez <currojerez@riseup.net>
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice (including the next
|
||||
* paragraph) shall be included in all copies or substantial portions of the
|
||||
* Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
* IN THE SOFTWARE.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef _IMG_LIST_H_
|
||||
#define _IMG_LIST_H_
|
||||
|
||||
#include "img_defs.h"
|
||||
|
||||
/* classic doubly-link circular list */
|
||||
typedef struct PVRSRV_LIST_HEAD {
|
||||
struct PVRSRV_LIST_HEAD *next;
|
||||
struct PVRSRV_LIST_HEAD *prev;
|
||||
}PVRSRV_LIST;
|
||||
|
||||
#define LIST_HEAD_INIT(name) { &(name), &(name) }
|
||||
|
||||
#define LIST_HEAD(name) \
|
||||
PVRSRV_LIST name = LIST_HEAD_INIT(name)
|
||||
|
||||
static INLINE void
|
||||
list_init(PVRSRV_LIST *list)
|
||||
{
|
||||
list->next = list->prev = list;
|
||||
}
|
||||
|
||||
static INLINE void
|
||||
__list_add(PVRSRV_LIST *entry,
|
||||
PVRSRV_LIST *prev,
|
||||
PVRSRV_LIST *next)
|
||||
{
|
||||
next->prev = entry;
|
||||
entry->next = next;
|
||||
entry->prev = prev;
|
||||
prev->next = entry;
|
||||
}
|
||||
|
||||
static INLINE void
|
||||
list_add(PVRSRV_LIST *entry, PVRSRV_LIST *head)
|
||||
{
|
||||
__list_add(entry, head, head->next);
|
||||
}
|
||||
|
||||
static INLINE void list_add_tail(PVRSRV_LIST *new_entry, PVRSRV_LIST *head)
|
||||
{
|
||||
__list_add(new_entry, head->prev, head);
|
||||
}
|
||||
|
||||
static INLINE void
|
||||
__list_del(PVRSRV_LIST *prev, PVRSRV_LIST *next)
|
||||
{
|
||||
next->prev = prev;
|
||||
prev->next = next;
|
||||
}
|
||||
|
||||
static INLINE void
|
||||
list_del(PVRSRV_LIST *entry)
|
||||
{
|
||||
__list_del(entry->prev, entry->next);
|
||||
list_init(entry);
|
||||
}
|
||||
|
||||
static INLINE void list_del_init(PVRSRV_LIST *entry)
|
||||
{
|
||||
__list_del(entry->prev, entry->next);
|
||||
list_init(entry);
|
||||
}
|
||||
|
||||
/**
|
||||
* list_move - delete from one list and add as another's head
|
||||
* @list: the entry to move
|
||||
* @head: the head that will precede our entry
|
||||
*/
|
||||
static INLINE void list_move(PVRSRV_LIST *list, PVRSRV_LIST *head)
|
||||
{
|
||||
__list_del(list->prev, list->next);
|
||||
list_add(list, head);
|
||||
}
|
||||
|
||||
/**
|
||||
* list_move_tail - delete from one list and add as another's tail
|
||||
* @list: the entry to move
|
||||
* @head: the head that will follow our entry
|
||||
*/
|
||||
static INLINE void list_move_tail(PVRSRV_LIST *list,
|
||||
PVRSRV_LIST *head)
|
||||
{
|
||||
__list_del(list->prev, list->next);
|
||||
list_add_tail(list, head);
|
||||
}
|
||||
|
||||
static INLINE IMG_BOOL
|
||||
list_is_empty(PVRSRV_LIST *head)
|
||||
{
|
||||
return (head->next == head) ? IMG_TRUE : IMG_FALSE;
|
||||
}
|
||||
|
||||
#ifndef container_of
|
||||
#define container_of(ptr, type, member) \
|
||||
(type *)((char *)(ptr) - (char *) &((type *)0)->member)
|
||||
#endif
|
||||
|
||||
#define list_entry(ptr, type, member) \
|
||||
container_of(ptr, type, member)
|
||||
|
||||
#define list_first_entry(ptr, type, member) \
|
||||
list_entry((ptr)->next, type, member)
|
||||
|
||||
#define __container_of(ptr, sample, member) \
|
||||
(void *)((char *)(ptr) \
|
||||
- ((char *)&(sample)->member - (char *)(sample)))
|
||||
|
||||
#define list_for_each_entry(pos, head, member) \
|
||||
for (pos = __container_of((head)->next, pos, member); \
|
||||
&pos->member != (head); \
|
||||
pos = __container_of(pos->member.next, pos, member))
|
||||
|
||||
#define list_for_each_entry_safe(pos, tmp, head, member) \
|
||||
for (pos = __container_of((head)->next, pos, member), \
|
||||
tmp = __container_of(pos->member.next, pos, member); \
|
||||
&pos->member != (head); \
|
||||
pos = tmp, tmp = __container_of(pos->member.next, tmp, member))
|
||||
|
||||
#endif //_IMG_LIST_H_
|
204
include/gpu_es4/eurasia/include4/img_types.h
Normal file
@ -0,0 +1,204 @@
|
||||
/******************************************************************************
|
||||
* Name : img_types.h
|
||||
* Title : Global types for use by IMG APIs
|
||||
* Author(s) : Imagination Technologies
|
||||
* Created : 1st August 2003
|
||||
*
|
||||
* Copyright : 2003-2006 by Imagination Technologies Limited.
|
||||
* All rights reserved. No part of this software, either material
|
||||
* or conceptual may be copied or distributed, transmitted,
|
||||
* transcribed, stored in a retrieval system or translated into
|
||||
* any human or computer language in any form by any means,
|
||||
* electronic, mechanical, manual or otherwise, or disclosed
|
||||
* to third parties without the express written permission of
|
||||
* Imagination Technologies Limited, Home Park Estate,
|
||||
* Kings Langley, Hertfordshire, WD4 8LZ, U.K.
|
||||
*
|
||||
* Description : Defines type aliases for use by IMG APIs
|
||||
*
|
||||
* Platform : Generic
|
||||
*
|
||||
* Modifications:-
|
||||
* $Log: img_types.h $
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __IMG_TYPES_H__
|
||||
#define __IMG_TYPES_H__
|
||||
|
||||
/* define all address space bit depths: */
|
||||
/* CPU virtual address space defaults to 32bits */
|
||||
#if !defined(IMG_ADDRSPACE_CPUVADDR_BITS)
|
||||
#define IMG_ADDRSPACE_CPUVADDR_BITS 32
|
||||
#endif
|
||||
|
||||
/* Physical address space defaults to 32bits */
|
||||
#if !defined(IMG_ADDRSPACE_PHYSADDR_BITS)
|
||||
#define IMG_ADDRSPACE_PHYSADDR_BITS 32
|
||||
#endif
|
||||
|
||||
typedef unsigned int IMG_UINT, *IMG_PUINT;
|
||||
typedef signed int IMG_INT, *IMG_PINT;
|
||||
|
||||
typedef unsigned char IMG_UINT8, *IMG_PUINT8;
|
||||
typedef unsigned char IMG_BYTE, *IMG_PBYTE;
|
||||
typedef signed char IMG_INT8, *IMG_PINT8;
|
||||
typedef char IMG_CHAR, *IMG_PCHAR;
|
||||
|
||||
typedef unsigned short IMG_UINT16, *IMG_PUINT16;
|
||||
typedef signed short IMG_INT16, *IMG_PINT16;
|
||||
#if !defined(IMG_UINT32_IS_ULONG)
|
||||
typedef unsigned int IMG_UINT32, *IMG_PUINT32;
|
||||
typedef signed int IMG_INT32, *IMG_PINT32;
|
||||
#else
|
||||
typedef unsigned long IMG_UINT32, *IMG_PUINT32;
|
||||
typedef signed long IMG_INT32, *IMG_PINT32;
|
||||
#endif
|
||||
#if !defined(IMG_UINT32_MAX)
|
||||
#define IMG_UINT32_MAX 0xFFFFFFFFUL
|
||||
#endif
|
||||
|
||||
#if defined(USE_CODE)
|
||||
|
||||
typedef unsigned __int64 IMG_UINT64, *IMG_PUINT64;
|
||||
typedef __int64 IMG_INT64, *IMG_PINT64;
|
||||
|
||||
#else
|
||||
#if (defined(LINUX) || defined(__METAG) || defined(__psp2__))
|
||||
typedef unsigned long long IMG_UINT64, *IMG_PUINT64;
|
||||
typedef long long IMG_INT64, *IMG_PINT64;
|
||||
#else
|
||||
#error("define an OS")
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !(defined(LINUX) && defined (__KERNEL__))
|
||||
/* Linux kernel mode does not use floating point */
|
||||
typedef float IMG_FLOAT, *IMG_PFLOAT;
|
||||
typedef double IMG_DOUBLE, *IMG_PDOUBLE;
|
||||
#endif
|
||||
|
||||
typedef enum tag_img_bool
|
||||
{
|
||||
IMG_FALSE = 0,
|
||||
IMG_TRUE = 1,
|
||||
IMG_FORCE_ALIGN = 0x7FFFFFFF
|
||||
} IMG_BOOL, *IMG_PBOOL;
|
||||
|
||||
typedef void IMG_VOID, *IMG_PVOID;
|
||||
|
||||
typedef IMG_INT32 IMG_RESULT;
|
||||
|
||||
#if defined(_WIN64)
|
||||
typedef unsigned __int64 IMG_UINTPTR_T;
|
||||
typedef signed __int64 IMG_PTRDIFF_T;
|
||||
typedef IMG_UINT64 IMG_SIZE_T;
|
||||
#else
|
||||
typedef unsigned int IMG_UINTPTR_T;
|
||||
typedef IMG_UINT32 IMG_SIZE_T;
|
||||
#endif
|
||||
|
||||
typedef IMG_PVOID IMG_HANDLE;
|
||||
|
||||
typedef void** IMG_HVOID, * IMG_PHVOID;
|
||||
|
||||
#define IMG_NULL 0
|
||||
|
||||
/* services/stream ID */
|
||||
typedef IMG_UINT32 IMG_SID;
|
||||
|
||||
typedef IMG_UINT32 IMG_EVENTSID;
|
||||
|
||||
/* Which of IMG_HANDLE/IMG_SID depends on SUPPORT_SID_INTERFACE */
|
||||
#if defined(SUPPORT_SID_INTERFACE)
|
||||
typedef IMG_SID IMG_S_HANDLE;
|
||||
#else
|
||||
typedef IMG_HANDLE IMG_S_HANDLE;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Address types.
|
||||
* All types used to refer to a block of memory are wrapped in structures
|
||||
* to enforce some degree of type safety, i.e. a IMG_DEV_VIRTADDR cannot
|
||||
* be assigned to a variable of type IMG_DEV_PHYADDR because they are not the
|
||||
* same thing.
|
||||
*
|
||||
* There is an assumption that the system contains at most one non-cpu mmu,
|
||||
* and a memory block is only mapped by the MMU once.
|
||||
*
|
||||
* Different devices could have offset views of the physical address space.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
* +------------+ +------------+ +------------+ +------------+
|
||||
* | CPU | | DEV | | DEV | | DEV |
|
||||
* +------------+ +------------+ +------------+ +------------+
|
||||
* | | | |
|
||||
* | PVOID |IMG_DEV_VIRTADDR |IMG_DEV_VIRTADDR |
|
||||
* | \-------------------/ |
|
||||
* | | |
|
||||
* +------------+ +------------+ |
|
||||
* | MMU | | MMU | |
|
||||
* +------------+ +------------+ |
|
||||
* | | |
|
||||
* | | |
|
||||
* | | |
|
||||
* +--------+ +---------+ +--------+
|
||||
* | Offset | | (Offset)| | Offset |
|
||||
* +--------+ +---------+ +--------+
|
||||
* | | IMG_DEV_PHYADDR |
|
||||
* | | |
|
||||
* | | IMG_DEV_PHYADDR |
|
||||
* +---------------------------------------------------------------------+
|
||||
* | System Address bus |
|
||||
* +---------------------------------------------------------------------+
|
||||
*
|
||||
*/
|
||||
|
||||
typedef IMG_PVOID IMG_CPU_VIRTADDR;
|
||||
|
||||
/* device virtual address */
|
||||
typedef struct _IMG_DEV_VIRTADDR
|
||||
{
|
||||
/* device virtual addresses are 32bit for now */
|
||||
IMG_UINT32 uiAddr;
|
||||
#define IMG_CAST_TO_DEVVADDR_UINT(var) (IMG_UINT32)(var)
|
||||
|
||||
} IMG_DEV_VIRTADDR;
|
||||
|
||||
typedef IMG_UINT32 IMG_DEVMEM_SIZE_T;
|
||||
|
||||
/* cpu physical address */
|
||||
typedef struct _IMG_CPU_PHYADDR
|
||||
{
|
||||
/* variable sized type (32,64) */
|
||||
IMG_UINTPTR_T uiAddr;
|
||||
} IMG_CPU_PHYADDR;
|
||||
|
||||
/* device physical address */
|
||||
typedef struct _IMG_DEV_PHYADDR
|
||||
{
|
||||
#if IMG_ADDRSPACE_PHYSADDR_BITS == 32
|
||||
/* variable sized type (32,64) */
|
||||
IMG_UINTPTR_T uiAddr;
|
||||
#else
|
||||
IMG_UINT32 uiAddr;
|
||||
IMG_UINT32 uiHighAddr;
|
||||
#endif
|
||||
} IMG_DEV_PHYADDR;
|
||||
|
||||
/* system physical address */
|
||||
typedef struct _IMG_SYS_PHYADDR
|
||||
{
|
||||
/* variable sized type (32,64) */
|
||||
IMG_UINTPTR_T uiAddr;
|
||||
} IMG_SYS_PHYADDR;
|
||||
|
||||
#include "img_defs.h"
|
||||
|
||||
#endif /* __IMG_TYPES_H__ */
|
||||
/******************************************************************************
|
||||
End of file (img_types.h)
|
||||
******************************************************************************/
|
116
include/gpu_es4/eurasia/include4/pdumpdefs.h
Normal file
@ -0,0 +1,116 @@
|
||||
/*!****************************************************************************
|
||||
@File pdumpdefs.h
|
||||
|
||||
@Title PDUMP definitions header
|
||||
|
||||
@Author Imagination Technologies
|
||||
|
||||
@date 01/08/2003
|
||||
|
||||
@Copyright Copyright 2003-2004 by Imagination Technologies Limited.
|
||||
All rights reserved. No part of this software, either
|
||||
material or conceptual may be copied or distributed,
|
||||
transmitted, transcribed, stored in a retrieval system
|
||||
or translated into any human or computer language in any
|
||||
form by any means, electronic, mechanical, manual or
|
||||
other-wise, or disclosed to third parties without the
|
||||
express written permission of Imagination Technologies
|
||||
Limited, Unit 8, HomePark Industrial Estate,
|
||||
King's Langley, Hertfordshire, WD4 8LZ, U.K.
|
||||
|
||||
@Platform cross platform / environment
|
||||
|
||||
@Description PDUMP definitions header
|
||||
|
||||
@DoxygenVer
|
||||
|
||||
Modifications :-
|
||||
|
||||
$Log: pdumpdefs.h $
|
||||
*****************************************************************************/
|
||||
|
||||
#if !defined (__PDUMPDEFS_H__)
|
||||
#define __PDUMPDEFS_H__
|
||||
|
||||
typedef enum _PDUMP_PIXEL_FORMAT_
|
||||
{
|
||||
PVRSRV_PDUMP_PIXEL_FORMAT_UNSUPPORTED = 0,
|
||||
PVRSRV_PDUMP_PIXEL_FORMAT_RGB8 = 1,
|
||||
PVRSRV_PDUMP_PIXEL_FORMAT_RGB332 = 2,
|
||||
PVRSRV_PDUMP_PIXEL_FORMAT_KRGB555 = 3,
|
||||
PVRSRV_PDUMP_PIXEL_FORMAT_RGB565 = 4,
|
||||
PVRSRV_PDUMP_PIXEL_FORMAT_ARGB4444 = 5,
|
||||
PVRSRV_PDUMP_PIXEL_FORMAT_ARGB1555 = 6,
|
||||
PVRSRV_PDUMP_PIXEL_FORMAT_RGB888 = 7,
|
||||
PVRSRV_PDUMP_PIXEL_FORMAT_ARGB8888 = 8,
|
||||
PVRSRV_PDUMP_PIXEL_FORMAT_YUV8 = 9,
|
||||
PVRSRV_PDUMP_PIXEL_FORMAT_AYUV4444 = 10,
|
||||
PVRSRV_PDUMP_PIXEL_FORMAT_VY0UY1_8888 = 11,
|
||||
PVRSRV_PDUMP_PIXEL_FORMAT_UY0VY1_8888 = 12,
|
||||
PVRSRV_PDUMP_PIXEL_FORMAT_Y0UY1V_8888 = 13,
|
||||
PVRSRV_PDUMP_PIXEL_FORMAT_Y0VY1U_8888 = 14,
|
||||
PVRSRV_PDUMP_PIXEL_FORMAT_YUV888 = 15,
|
||||
PVRSRV_PDUMP_PIXEL_FORMAT_UYVY10101010 = 16,
|
||||
PVRSRV_PDUMP_PIXEL_FORMAT_VYAUYA8888 = 17,
|
||||
PVRSRV_PDUMP_PIXEL_FORMAT_AYUV8888 = 18,
|
||||
PVRSRV_PDUMP_PIXEL_FORMAT_AYUV2101010 = 19,
|
||||
PVRSRV_PDUMP_PIXEL_FORMAT_YUV101010 = 20,
|
||||
PVRSRV_PDUMP_PIXEL_FORMAT_PL12Y8 = 21,
|
||||
PVRSRV_PDUMP_PIXEL_FORMAT_YUV_IMC2 = 22,
|
||||
PVRSRV_PDUMP_PIXEL_FORMAT_YUV_YV12 = 23,
|
||||
PVRSRV_PDUMP_PIXEL_FORMAT_YUV_PL8 = 24,
|
||||
PVRSRV_PDUMP_PIXEL_FORMAT_YUV_PL12 = 25,
|
||||
PVRSRV_PDUMP_PIXEL_FORMAT_422PL12YUV8 = 26,
|
||||
PVRSRV_PDUMP_PIXEL_FORMAT_420PL12YUV8 = 27,
|
||||
PVRSRV_PDUMP_PIXEL_FORMAT_PL12Y10 = 28,
|
||||
PVRSRV_PDUMP_PIXEL_FORMAT_422PL12YUV10 = 29,
|
||||
PVRSRV_PDUMP_PIXEL_FORMAT_420PL12YUV10 = 30,
|
||||
PVRSRV_PDUMP_PIXEL_FORMAT_ABGR8888 = 31,
|
||||
PVRSRV_PDUMP_PIXEL_FORMAT_BGRA8888 = 32,
|
||||
PVRSRV_PDUMP_PIXEL_FORMAT_ARGB8332 = 33,
|
||||
PVRSRV_PDUMP_PIXEL_FORMAT_RGB555 = 34,
|
||||
PVRSRV_PDUMP_PIXEL_FORMAT_F16 = 35,
|
||||
PVRSRV_PDUMP_PIXEL_FORMAT_F32 = 36,
|
||||
PVRSRV_PDUMP_PIXEL_FORMAT_L16 = 37,
|
||||
PVRSRV_PDUMP_PIXEL_FORMAT_L32 = 38,
|
||||
PVRSRV_PDUMP_PIXEL_FORMAT_RGBA8888 = 39,
|
||||
PVRSRV_PDUMP_PIXEL_FORMAT_ABGR4444 = 40,
|
||||
PVRSRV_PDUMP_PIXEL_FORMAT_RGBA4444 = 41,
|
||||
PVRSRV_PDUMP_PIXEL_FORMAT_BGRA4444 = 42,
|
||||
PVRSRV_PDUMP_PIXEL_FORMAT_ABGR1555 = 43,
|
||||
PVRSRV_PDUMP_PIXEL_FORMAT_RGBA5551 = 44,
|
||||
PVRSRV_PDUMP_PIXEL_FORMAT_BGRA5551 = 45,
|
||||
PVRSRV_PDUMP_PIXEL_FORMAT_BGR565 = 46,
|
||||
PVRSRV_PDUMP_PIXEL_FORMAT_A8 = 47,
|
||||
|
||||
PVRSRV_PDUMP_PIXEL_FORMAT_FORCE_I32 = 0x7fffffff
|
||||
|
||||
} PDUMP_PIXEL_FORMAT;
|
||||
|
||||
typedef enum _PDUMP_MEM_FORMAT_
|
||||
{
|
||||
PVRSRV_PDUMP_MEM_FORMAT_STRIDE = 0,
|
||||
PVRSRV_PDUMP_MEM_FORMAT_RESERVED = 1,
|
||||
PVRSRV_PDUMP_MEM_FORMAT_TILED = 8,
|
||||
PVRSRV_PDUMP_MEM_FORMAT_TWIDDLED = 9,
|
||||
PVRSRV_PDUMP_MEM_FORMAT_HYBRID = 10,
|
||||
|
||||
PVRSRV_PDUMP_MEM_FORMAT_FORCE_I32 = 0x7fffffff
|
||||
} PDUMP_MEM_FORMAT;
|
||||
|
||||
typedef enum _PDUMP_POLL_OPERATOR
|
||||
{
|
||||
PDUMP_POLL_OPERATOR_EQUAL = 0,
|
||||
PDUMP_POLL_OPERATOR_LESS = 1,
|
||||
PDUMP_POLL_OPERATOR_LESSEQUAL = 2,
|
||||
PDUMP_POLL_OPERATOR_GREATER = 3,
|
||||
PDUMP_POLL_OPERATOR_GREATEREQUAL = 4,
|
||||
PDUMP_POLL_OPERATOR_NOTEQUAL = 5,
|
||||
} PDUMP_POLL_OPERATOR;
|
||||
|
||||
|
||||
#endif /* __PDUMPDEFS_H__ */
|
||||
|
||||
/*****************************************************************************
|
||||
End of file (pdumpdefs.h)
|
||||
*****************************************************************************/
|
182
include/gpu_es4/eurasia/include4/pvr_debug.h
Normal file
@ -0,0 +1,182 @@
|
||||
/******************************************************************************
|
||||
* Name : pvr_debug.h
|
||||
* Title : PVR Debug Declarations
|
||||
* Author : J R Morrissey
|
||||
* Created : 20 May 2002
|
||||
*
|
||||
* Copyright : 2002-2008 by Imagination Technologies Limited.
|
||||
* All rights reserved. No part of this software, either
|
||||
* material or conceptual may be copied or distributed,
|
||||
* transmitted, transcribed, stored in a retrieval system
|
||||
* or translated into any human or computer language in any
|
||||
* form by any means, electronic, mechanical, manual or
|
||||
* otherwise, or disclosed to third parties without the
|
||||
* express written permission of
|
||||
* Imagination Technologies Limited, Home Park Estate,
|
||||
* Kings Langley, Hertfordshire, WD4 8LZ, U.K.
|
||||
*
|
||||
* Description : Provides debug functionality
|
||||
*
|
||||
* Platform : Generic
|
||||
*
|
||||
* Modifications:-
|
||||
* $Log: pvr_debug.h $
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __PVR_DEBUG_H__
|
||||
#define __PVR_DEBUG_H__
|
||||
|
||||
|
||||
#include "img_types.h"
|
||||
|
||||
#if defined (__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define PVR_MAX_DEBUG_MESSAGE_LEN (512)
|
||||
|
||||
/* These are privately used by pvr_debug, use the PVR_DBG_ defines instead */
|
||||
#define DBGPRIV_FATAL 0x01UL
|
||||
#define DBGPRIV_ERROR 0x02UL
|
||||
#define DBGPRIV_WARNING 0x04UL
|
||||
#define DBGPRIV_MESSAGE 0x08UL
|
||||
#define DBGPRIV_VERBOSE 0x10UL
|
||||
#define DBGPRIV_CALLTRACE 0x20UL
|
||||
#define DBGPRIV_ALLOC 0x40UL
|
||||
#define DBGPRIV_DBGDRV_MESSAGE 0x80UL
|
||||
|
||||
#if !defined(PVRSRV_NEED_PVR_ASSERT) && defined(DEBUG)
|
||||
#define PVRSRV_NEED_PVR_ASSERT
|
||||
#endif
|
||||
|
||||
#if defined(PVRSRV_NEED_PVR_ASSERT) && !defined(PVRSRV_NEED_PVR_DPF)
|
||||
#define PVRSRV_NEED_PVR_DPF
|
||||
#endif
|
||||
|
||||
#if !defined(PVRSRV_NEED_PVR_TRACE) && (defined(DEBUG) || defined(TIMING))
|
||||
#define PVRSRV_NEED_PVR_TRACE
|
||||
#endif
|
||||
|
||||
/* PVR_ASSERT() and PVR_DBG_BREAK handling */
|
||||
|
||||
#if defined(PVRSRV_NEED_PVR_ASSERT)
|
||||
|
||||
#define PVR_ASSERT(EXPR) if (!(EXPR)) PVRSRVDebugAssertFail(__FILE__, __LINE__);
|
||||
|
||||
IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVDebugAssertFail(const IMG_CHAR *pszFile,
|
||||
IMG_UINT32 ui32Line);
|
||||
|
||||
#define PVR_DBG_BREAK PVRSRVDebugAssertFail(__FILE__, __LINE__)
|
||||
|
||||
#else /* defined(PVRSRV_NEED_PVR_ASSERT) */
|
||||
|
||||
#define PVR_ASSERT(EXPR)
|
||||
#define PVR_DBG_BREAK
|
||||
|
||||
#endif /* defined(PVRSRV_NEED_PVR_ASSERT) */
|
||||
|
||||
|
||||
/* PVR_DPF() handling */
|
||||
|
||||
#if defined(PVRSRV_NEED_PVR_DPF)
|
||||
|
||||
#if defined(PVRSRV_NEW_PVR_DPF)
|
||||
|
||||
/* New logging mechanism */
|
||||
#define PVR_DBG_FATAL DBGPRIV_FATAL
|
||||
#define PVR_DBG_ERROR DBGPRIV_ERROR
|
||||
#define PVR_DBG_WARNING DBGPRIV_WARNING
|
||||
#define PVR_DBG_MESSAGE DBGPRIV_MESSAGE
|
||||
#define PVR_DBG_VERBOSE DBGPRIV_VERBOSE
|
||||
#define PVR_DBG_CALLTRACE DBGPRIV_CALLTRACE
|
||||
#define PVR_DBG_ALLOC DBGPRIV_ALLOC
|
||||
#define PVR_DBGDRIV_MESSAGE DBGPRIV_DBGDRV_MESSAGE
|
||||
|
||||
/* These levels are always on with PVRSRV_NEED_PVR_DPF */
|
||||
#define __PVR_DPF_0x01UL(x...) PVRSRVDebugPrintf(DBGPRIV_FATAL, x)
|
||||
#define __PVR_DPF_0x02UL(x...) PVRSRVDebugPrintf(DBGPRIV_ERROR, x)
|
||||
|
||||
/* Some are compiled out completely in release builds */
|
||||
#if defined(DEBUG)
|
||||
#define __PVR_DPF_0x04UL(x...) PVRSRVDebugPrintf(DBGPRIV_WARNING, x)
|
||||
#define __PVR_DPF_0x08UL(x...) PVRSRVDebugPrintf(DBGPRIV_MESSAGE, x)
|
||||
#define __PVR_DPF_0x10UL(x...) PVRSRVDebugPrintf(DBGPRIV_VERBOSE, x)
|
||||
#define __PVR_DPF_0x20UL(x...) PVRSRVDebugPrintf(DBGPRIV_CALLTRACE, x)
|
||||
#define __PVR_DPF_0x40UL(x...) PVRSRVDebugPrintf(DBGPRIV_ALLOC, x)
|
||||
#define __PVR_DPF_0x80UL(x...) PVRSRVDebugPrintf(DBGPRIV_DBGDRV_MESSAGE, x)
|
||||
#else
|
||||
#define __PVR_DPF_0x04UL(x...)
|
||||
#define __PVR_DPF_0x08UL(x...)
|
||||
#define __PVR_DPF_0x10UL(x...)
|
||||
#define __PVR_DPF_0x20UL(x...)
|
||||
#define __PVR_DPF_0x40UL(x...)
|
||||
#define __PVR_DPF_0x80UL(x...)
|
||||
#endif
|
||||
|
||||
/* Translate the different log levels to separate macros
|
||||
* so they can each be compiled out.
|
||||
*/
|
||||
#if defined(DEBUG)
|
||||
#define __PVR_DPF(lvl, x...) __PVR_DPF_ ## lvl (__FILE__, __LINE__, x)
|
||||
#else
|
||||
#define __PVR_DPF(lvl, x...) __PVR_DPF_ ## lvl ("", 0, x)
|
||||
#endif
|
||||
|
||||
/* Get rid of the double bracketing */
|
||||
#define PVR_DPF(x) __PVR_DPF x
|
||||
|
||||
#else /* defined(PVRSRV_NEW_PVR_DPF) */
|
||||
|
||||
/* Old logging mechanism */
|
||||
#define PVR_DBG_FATAL DBGPRIV_FATAL,__FILE__, __LINE__
|
||||
#define PVR_DBG_ERROR DBGPRIV_ERROR,__FILE__, __LINE__
|
||||
#define PVR_DBG_WARNING DBGPRIV_WARNING,__FILE__, __LINE__
|
||||
#define PVR_DBG_MESSAGE DBGPRIV_MESSAGE,__FILE__, __LINE__
|
||||
#define PVR_DBG_VERBOSE DBGPRIV_VERBOSE,__FILE__, __LINE__
|
||||
#define PVR_DBG_CALLTRACE DBGPRIV_CALLTRACE,__FILE__, __LINE__
|
||||
#define PVR_DBG_ALLOC DBGPRIV_ALLOC,__FILE__, __LINE__
|
||||
#define PVR_DBGDRIV_MESSAGE DBGPRIV_DBGDRV_MESSAGE, "", 0
|
||||
|
||||
#define PVR_DPF(X) PVRSRVDebugPrintf X
|
||||
|
||||
#endif /* defined(PVRSRV_NEW_PVR_DPF) */
|
||||
|
||||
IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVDebugPrintf(IMG_UINT32 ui32DebugLevel,
|
||||
const IMG_CHAR *pszFileName,
|
||||
IMG_UINT32 ui32Line,
|
||||
const IMG_CHAR *pszFormat,
|
||||
...) IMG_FORMAT_PRINTF(4, 5);
|
||||
|
||||
#else /* defined(PVRSRV_NEED_PVR_DPF) */
|
||||
|
||||
#define PVR_DPF(X)
|
||||
|
||||
#endif /* defined(PVRSRV_NEED_PVR_DPF) */
|
||||
|
||||
|
||||
/* PVR_TRACE() handling */
|
||||
|
||||
#if defined(PVRSRV_NEED_PVR_TRACE)
|
||||
|
||||
#define PVR_TRACE(X) PVRSRVTrace X
|
||||
|
||||
IMG_IMPORT IMG_VOID IMG_CALLCONV PVRSRVTrace(const IMG_CHAR* pszFormat, ... )
|
||||
IMG_FORMAT_PRINTF(1, 2);
|
||||
|
||||
#else /* defined(PVRSRV_NEED_PVR_TRACE) */
|
||||
|
||||
#define PVR_TRACE(X)
|
||||
|
||||
#endif /* defined(PVRSRV_NEED_PVR_TRACE) */
|
||||
|
||||
|
||||
#if defined (__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __PVR_DEBUG_H__ */
|
||||
|
||||
/******************************************************************************
|
||||
End of file (pvr_debug.h)
|
||||
******************************************************************************/
|
||||
|
209
include/gpu_es4/eurasia/include4/pvr_metrics.h
Normal file
@ -0,0 +1,209 @@
|
||||
/******************************************************************************
|
||||
* Name : pvr_metrics.h
|
||||
*
|
||||
* Copyright : 2003-2007 by Imagination Technologies Limited.
|
||||
* : All rights reserved. No part of this software, either material
|
||||
* : or conceptual may be copied or distributed, transmitted,
|
||||
* : transcribed, stored in a retrieval system or translated into
|
||||
* : any human or computer language in any form by any means,
|
||||
* : electronic, mechanical, manual or otherwise, or disclosed
|
||||
* : to third parties without the express written permission of
|
||||
* : Imagination Technologies Limited, Home Park Estate,
|
||||
* : Kings Langley, Hertfordshire, WD4 8LZ, U.K.
|
||||
*
|
||||
* Platform : ANSI
|
||||
*
|
||||
* $Log: pvr_metrics.h $
|
||||
******************************************************************************/
|
||||
#ifndef _PVRMETRICS_
|
||||
#define _PVRMETRICS_
|
||||
|
||||
#if defined (__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if defined(TIMING) || defined(DEBUG)
|
||||
|
||||
#if defined(__linux__)
|
||||
IMG_EXPORT IMG_VOID PVRSRVGetTimerRegister(IMG_VOID *pvSOCTimerRegisterUM);
|
||||
IMG_EXPORT IMG_VOID PVRSRVReleaseTimerRegister(IMG_VOID);
|
||||
#endif
|
||||
IMG_IMPORT IMG_UINT32 PVRSRVMetricsTimeNow(IMG_VOID);
|
||||
IMG_IMPORT IMG_FLOAT PVRSRVMetricsGetCPUFreq(IMG_VOID);
|
||||
|
||||
IMG_IMPORT IMG_VOID PVRSRVInitProfileOutput(IMG_VOID **ppvFileInfo);
|
||||
IMG_IMPORT IMG_VOID PVRSRVDeInitProfileOutput(IMG_VOID **ppvFileInfo);
|
||||
IMG_IMPORT IMG_VOID PVRSRVProfileOutput(IMG_VOID *pvFileInfo, const IMG_CHAR *psString);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
IMG_UINT32 ui32Start, ui32Stop, ui32Count, ui32Max, ui32Total, ui32Sum;
|
||||
IMG_FLOAT fStack;
|
||||
|
||||
} PVR_Temporal_Data;
|
||||
|
||||
|
||||
/*
|
||||
Parameter explanation:
|
||||
|
||||
X : a Temporal_Data instance
|
||||
SWAP : a *_TIMES_SWAP_BUFFERS Temporal_Data instance
|
||||
H : an application hint
|
||||
CPU : float for CPU speed
|
||||
TAG : a define
|
||||
Y : numerical parameter
|
||||
*/
|
||||
|
||||
#define PVR_MTR_CALLS(X) X.ui32Count
|
||||
|
||||
#define PVR_MTR_TIME_PER_CALL(X, CPU) ( (X.ui32Count) ? \
|
||||
(X.ui32Total*CPU/X.ui32Count) : 0.0f )
|
||||
|
||||
#define PVR_MTR_MAX_TIME(X, CPU) ( X.ui32Max*CPU )
|
||||
|
||||
#define PVR_MTR_PIXELS_PER_CALL(X) ( (X.ui32Count) ? \
|
||||
(X.fStack*1000.0f/X.ui32Count) : 0.0f )
|
||||
|
||||
/* generic per frame metrics - an integer is passed as second parameter */
|
||||
|
||||
#define PVR_MTR_TIME_PER_FRAME_GENERIC(X, Y, CPU) ((X.ui32Total*CPU)/(Y))
|
||||
|
||||
#define PVR_MTR_PIXELS_PER_FRAME_GENERIC(X, Y) ((X.fStack*1000.0f)/(Y))
|
||||
|
||||
#define PVR_MTR_METRIC_PER_FRAME_GENERIC(X, Y) (X.ui32Count/(Y))
|
||||
|
||||
#define PVR_MTR_PARAM_PER_FRAME_GENERIC(X, Y) ((X)/(Y))
|
||||
|
||||
|
||||
/*
|
||||
per frame metrics - a timer is passed as second parameter,
|
||||
typically a *_TIMER_SWAP_HW_TIME timer
|
||||
*/
|
||||
|
||||
#define PVR_MTR_TIME_PER_FRAME(SWAP, X, CPU) ( (SWAP.ui32Count) ? \
|
||||
(X.ui32Total*CPU/SWAP.ui32Count) : 0.0f )
|
||||
|
||||
#define PVR_MTR_PIXELS_PER_FRAME(SWAP, X) ( (SWAP.ui32Count) ? \
|
||||
(X.fStack*1000.0f/SWAP.ui32Count) : 0.0f )
|
||||
|
||||
#define PVR_MTR_METRIC_PER_FRAME(SWAP, X) ( (SWAP.ui32Count) ? \
|
||||
(X.ui32Count/SWAP.ui32Count) : 0 )
|
||||
|
||||
#define PVR_MTR_PARAM_PER_FRAME(SWAP, X) X/SWAP.ui32Count
|
||||
|
||||
|
||||
#define PVR_MTR_CHECK_BETWEEN_START_END_FRAME(H, SWAP) ((H.ui32ProfileStartFrame <= SWAP.ui32Count) && \
|
||||
(H.ui32ProfileEndFrame >= SWAP.ui32Count))
|
||||
|
||||
|
||||
#define PVR_MTR_TIME_RESET(X) { \
|
||||
X.ui32Count = 0; \
|
||||
X.ui32Total = 0; \
|
||||
X.ui32Sum = 0; \
|
||||
X.ui32Start = 0; \
|
||||
X.ui32Stop = 0; \
|
||||
X.fStack = 0.0f; \
|
||||
}
|
||||
|
||||
#define PVR_MTR_TIME_START(X, H, SWAP) { \
|
||||
if(PVR_MTR_CHECK_BETWEEN_START_END_FRAME(H, SWAP)) \
|
||||
{ \
|
||||
X.ui32Count += 1; \
|
||||
X.ui32Count |= 0x80000000L; \
|
||||
X.ui32Start = PVRSRVMetricsTimeNow(); X.ui32Stop = 0; \
|
||||
} \
|
||||
}
|
||||
|
||||
#define PVR_MTR_SWAP_TIME_START(X) { \
|
||||
{ \
|
||||
X.ui32Count += 1; \
|
||||
X.ui32Count |= 0x80000000L; \
|
||||
X.ui32Start = PVRSRVMetricsTimeNow(); X.ui32Stop = 0; \
|
||||
} \
|
||||
}
|
||||
|
||||
#define PVR_MTR_TIME_SUSPEND(X) { X.ui32Stop += PVRSRVMetricsTimeNow() - X.ui32Start; }
|
||||
|
||||
#define PVR_MTR_TIME_RESUME(X) { X.ui32Start = PVRSRVMetricsTimeNow(); }
|
||||
|
||||
#define PVR_MTR_TIME_STOP(X, H, SWAP) { \
|
||||
if(PVR_MTR_CHECK_BETWEEN_START_END_FRAME(H, SWAP)) \
|
||||
{ \
|
||||
IMG_UINT32 ui32TimeLapse = PVRSRVMetricsTimeNow() - X.ui32Start; \
|
||||
if(ui32TimeLapse > X.ui32Max) \
|
||||
{ \
|
||||
X.ui32Max = ui32TimeLapse; \
|
||||
} \
|
||||
X.ui32Stop += ui32TimeLapse; \
|
||||
X.ui32Sum += X.ui32Stop; \
|
||||
X.ui32Total += X.ui32Stop; X.ui32Count &= 0x7FFFFFFFL; \
|
||||
} \
|
||||
}
|
||||
|
||||
#define PVR_MTR_SWAP_TIME_STOP(X) { \
|
||||
{ \
|
||||
X.ui32Stop += PVRSRVMetricsTimeNow() - X.ui32Start; \
|
||||
X.ui32Sum += X.ui32Stop; \
|
||||
X.ui32Total += X.ui32Stop; X.ui32Count &= 0x7FFFFFFFL; \
|
||||
} \
|
||||
}
|
||||
|
||||
#define PVR_MTR_TIME_RESET_SUM(X) { X.Sum = 0; }
|
||||
|
||||
#define PVR_MTR_INC_PERFRAME_COUNT(X) { \
|
||||
if (X.fStack == 0.0f) \
|
||||
{ \
|
||||
X.ui32Count++; \
|
||||
X.fStack = 1.0f; \
|
||||
} \
|
||||
}
|
||||
|
||||
#define PVR_MTR_RESET_PERFRAME_COUNT(X) { X.fStack = 0.0f;}
|
||||
|
||||
#define PVR_MTR_DECR_COUNT(X) { X.ui32Count -= 1; }
|
||||
|
||||
#define PVR_MTR_INC_PIXEL_COUNT(X, Y) { X.fStack += 0.001f*(IMG_FLOAT)(Y); }
|
||||
|
||||
|
||||
#define PVR_MTR_INC_COUNT(TIMER, X, Y, H, SWAP, TAG) { \
|
||||
IMG_INT tempTimer = TIMER; \
|
||||
if((tempTimer == TAG) || PVR_MTR_CHECK_BETWEEN_START_END_FRAME(H, SWAP)) \
|
||||
{ \
|
||||
X.ui32Count += 1; \
|
||||
X.ui32Stop += (Y); \
|
||||
X.ui32Total += (Y); \
|
||||
} \
|
||||
}
|
||||
|
||||
|
||||
#else /* !(defined (TIMING) || defined (DEBUG)) */
|
||||
|
||||
#define PVR_MTR_TIME_RESET(X)
|
||||
#define PVR_MTR_TIME_START(X, H, SWAP)
|
||||
#define PVR_MTR_TIME_SUSPEND(X)
|
||||
#define PVR_MTR_TIME_RESUME(X)
|
||||
#define PVR_MTR_TIME_STOP(X, H, SWAP)
|
||||
#define PVR_MTR_SWAP_TIME_START(X)
|
||||
#define PVR_MTR_SWAP_TIME_STOP(X)
|
||||
#define PVR_MTR_INC_COUNT(X, Y, H, SWAP, TAG)
|
||||
#define PVR_MTR_DECR_COUNT(X)
|
||||
#define PVR_MTR_INC_PIXEL_COUNT(X, Y)
|
||||
#define PVR_MTR_INC_PERFRAME_COUNT(X)
|
||||
#define PVR_MTR_RESET_PERFRAME_COUNT(X)
|
||||
#define PVR_MTR_TIME_RESET_SUM(X)
|
||||
|
||||
/* these macros are never used, so far */
|
||||
#define PVR_MTR_RESET_FRAME()
|
||||
#define PVR_MTR_INC_POLY_COUNT(X)
|
||||
|
||||
#endif /* defined (TIMING) || defined (DEBUG) */
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _PVRMETRICS_ */
|
||||
|
||||
/******************************************************************************
|
||||
End of file (pvr_metrics.h)
|
||||
******************************************************************************/
|
35
include/gpu_es4/eurasia/include4/pvrversion.h
Normal file
@ -0,0 +1,35 @@
|
||||
/*************************************************************************/ /*!
|
||||
@File pvrversion.h
|
||||
@Title Version numbers and strings.
|
||||
@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
|
||||
@Description Version numbers and strings for PVR Consumer services
|
||||
components.
|
||||
@License Strictly Confidential.
|
||||
$Log:
|
||||
*/ /**************************************************************************/
|
||||
|
||||
#ifndef _PVRVERSION_H_
|
||||
#define _PVRVERSION_H_
|
||||
|
||||
#define PVR_STR(X) #X
|
||||
#define PVR_STR2(X) PVR_STR(X)
|
||||
|
||||
#define PVRVERSION_MAJ 1
|
||||
#define PVRVERSION_MIN 8
|
||||
#define PVRVERSION_BRANCH 18
|
||||
|
||||
#define PVRVERSION_FAMILY "sgxddk"
|
||||
#define PVRVERSION_BRANCHNAME "1.8"
|
||||
#define PVRVERSION_BUILD 869593
|
||||
#define PVRVERSION_BSCONTROL "psp2_sgx_ogles1_ogles2_GPL"
|
||||
|
||||
#define PVRVERSION_STRING "psp2_sgx_ogles1_ogles2_GPL sgxddk 18 1.8@" PVR_STR2(PVRVERSION_BUILD)
|
||||
#define PVRVERSION_STRING_SHORT "1.8@" PVR_STR2(PVRVERSION_BUILD)
|
||||
|
||||
#define COPYRIGHT_TXT "Copyright (c) Imagination Technologies Ltd. All Rights Reserved."
|
||||
|
||||
#define PVRVERSION_BUILD_HI 86
|
||||
#define PVRVERSION_BUILD_LO 9593
|
||||
#define PVRVERSION_STRING_NUMERIC PVR_STR2(PVRVERSION_MAJ) "." PVR_STR2(PVRVERSION_MIN) "." PVR_STR2(PVRVERSION_BUILD_HI) "." PVR_STR2(PVRVERSION_BUILD_LO)
|
||||
|
||||
#endif /* _PVRVERSION_H_ */
|
2096
include/gpu_es4/eurasia/include4/services.h
Normal file
962
include/gpu_es4/eurasia/include4/servicesext.h
Normal file
@ -0,0 +1,962 @@
|
||||
/*!****************************************************************************
|
||||
@File servicesext.h
|
||||
|
||||
@Title services data structures, defines and prototypes required by
|
||||
external drivers
|
||||
|
||||
@Author Imagination Technologies
|
||||
|
||||
@date 22 / 7 / 2004
|
||||
|
||||
@Copyright Copyright 2003-2004 by Imagination Technologies Limited.
|
||||
All rights reserved. No part of this software, either
|
||||
material or conceptual may be copied or distributed,
|
||||
transmitted, transcribed, stored in a retrieval system
|
||||
or translated into any human or computer language in any
|
||||
form by any means, electronic, mechanical, manual or
|
||||
other-wise, or disclosed to third parties without the
|
||||
express written permission of Imagination Technologies
|
||||
Limited, Unit 8, HomePark Industrial Estate,
|
||||
King's Langley, Hertfordshire, WD4 8LZ, U.K.
|
||||
|
||||
@Platform generic
|
||||
|
||||
@Description provides services data structures, defines and prototypes
|
||||
required by external drivers
|
||||
|
||||
@DoxygenVer
|
||||
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
Modifications :-
|
||||
$Log: servicesext.h $
|
||||
*****************************************************************************/
|
||||
|
||||
#if !defined (__SERVICESEXT_H__)
|
||||
#define __SERVICESEXT_H__
|
||||
|
||||
/*
|
||||
* Lock buffer read/write flags
|
||||
*/
|
||||
#define PVRSRV_LOCKFLG_READONLY (1) /*!< The locking process will only read the locked surface */
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* Error values
|
||||
*
|
||||
* NOTE: update services4\srvclient\common\resoureces.h to match
|
||||
*
|
||||
*****************************************************************************/
|
||||
typedef enum _PVRSRV_ERROR_
|
||||
{
|
||||
PVRSRV_OK = 0,
|
||||
PVRSRV_ERROR_OUT_OF_MEMORY,
|
||||
PVRSRV_ERROR_TOO_FEW_BUFFERS,
|
||||
PVRSRV_ERROR_INVALID_PARAMS,
|
||||
PVRSRV_ERROR_INIT_FAILURE,
|
||||
PVRSRV_ERROR_CANT_REGISTER_CALLBACK,
|
||||
PVRSRV_ERROR_INVALID_DEVICE,
|
||||
PVRSRV_ERROR_NOT_OWNER,
|
||||
PVRSRV_ERROR_BAD_MAPPING,
|
||||
PVRSRV_ERROR_TIMEOUT,
|
||||
PVRSRV_ERROR_FLIP_CHAIN_EXISTS,
|
||||
PVRSRV_ERROR_INVALID_SWAPINTERVAL,
|
||||
PVRSRV_ERROR_SCENE_INVALID,
|
||||
PVRSRV_ERROR_STREAM_ERROR,
|
||||
PVRSRV_ERROR_FAILED_DEPENDENCIES,
|
||||
PVRSRV_ERROR_CMD_NOT_PROCESSED,
|
||||
PVRSRV_ERROR_CMD_TOO_BIG,
|
||||
PVRSRV_ERROR_DEVICE_REGISTER_FAILED,
|
||||
PVRSRV_ERROR_TOOMANYBUFFERS,
|
||||
PVRSRV_ERROR_NOT_SUPPORTED,
|
||||
PVRSRV_ERROR_PROCESSING_BLOCKED,
|
||||
|
||||
PVRSRV_ERROR_CANNOT_FLUSH_QUEUE,
|
||||
PVRSRV_ERROR_CANNOT_GET_QUEUE_SPACE,
|
||||
PVRSRV_ERROR_CANNOT_GET_RENDERDETAILS,
|
||||
PVRSRV_ERROR_RETRY,
|
||||
|
||||
PVRSRV_ERROR_DDK_VERSION_MISMATCH,
|
||||
PVRSRV_ERROR_BUILD_MISMATCH,
|
||||
PVRSRV_ERROR_CORE_REVISION_MISMATCH,
|
||||
|
||||
PVRSRV_ERROR_UPLOAD_TOO_BIG,
|
||||
|
||||
PVRSRV_ERROR_INVALID_FLAGS,
|
||||
PVRSRV_ERROR_FAILED_TO_REGISTER_PROCESS,
|
||||
|
||||
PVRSRV_ERROR_UNABLE_TO_LOAD_LIBRARY,
|
||||
PVRSRV_ERROR_UNABLE_GET_FUNC_ADDR,
|
||||
PVRSRV_ERROR_UNLOAD_LIBRARY_FAILED,
|
||||
|
||||
PVRSRV_ERROR_BRIDGE_CALL_FAILED,
|
||||
PVRSRV_ERROR_IOCTL_CALL_FAILED,
|
||||
|
||||
PVRSRV_ERROR_MMU_CONTEXT_NOT_FOUND,
|
||||
PVRSRV_ERROR_BUFFER_DEVICE_NOT_FOUND,
|
||||
PVRSRV_ERROR_BUFFER_DEVICE_ALREADY_PRESENT,
|
||||
|
||||
PVRSRV_ERROR_PCI_DEVICE_NOT_FOUND,
|
||||
PVRSRV_ERROR_PCI_CALL_FAILED,
|
||||
PVRSRV_ERROR_PCI_REGION_TOO_SMALL,
|
||||
PVRSRV_ERROR_PCI_REGION_UNAVAILABLE,
|
||||
PVRSRV_ERROR_BAD_REGION_SIZE_MISMATCH,
|
||||
|
||||
PVRSRV_ERROR_REGISTER_BASE_NOT_SET,
|
||||
|
||||
PVRSRV_ERROR_BM_BAD_SHAREMEM_HANDLE,
|
||||
|
||||
PVRSRV_ERROR_FAILED_TO_ALLOC_USER_MEM,
|
||||
PVRSRV_ERROR_FAILED_TO_ALLOC_VP_MEMORY,
|
||||
PVRSRV_ERROR_FAILED_TO_MAP_SHARED_PBDESC,
|
||||
PVRSRV_ERROR_FAILED_TO_GET_PHYS_ADDR,
|
||||
|
||||
PVRSRV_ERROR_FAILED_TO_ALLOC_VIRT_MEMORY,
|
||||
PVRSRV_ERROR_FAILED_TO_COPY_VIRT_MEMORY,
|
||||
|
||||
PVRSRV_ERROR_FAILED_TO_ALLOC_PAGES,
|
||||
PVRSRV_ERROR_FAILED_TO_FREE_PAGES,
|
||||
PVRSRV_ERROR_FAILED_TO_COPY_PAGES,
|
||||
PVRSRV_ERROR_UNABLE_TO_LOCK_PAGES,
|
||||
PVRSRV_ERROR_UNABLE_TO_UNLOCK_PAGES,
|
||||
PVRSRV_ERROR_STILL_MAPPED,
|
||||
PVRSRV_ERROR_MAPPING_NOT_FOUND,
|
||||
PVRSRV_ERROR_PHYS_ADDRESS_EXCEEDS_32BIT,
|
||||
PVRSRV_ERROR_FAILED_TO_MAP_PAGE_TABLE,
|
||||
|
||||
PVRSRV_ERROR_INVALID_SEGMENT_BLOCK,
|
||||
PVRSRV_ERROR_INVALID_SGXDEVDATA,
|
||||
PVRSRV_ERROR_INVALID_DEVINFO,
|
||||
PVRSRV_ERROR_INVALID_MEMINFO,
|
||||
PVRSRV_ERROR_INVALID_MISCINFO,
|
||||
PVRSRV_ERROR_UNKNOWN_IOCTL,
|
||||
PVRSRV_ERROR_INVALID_CONTEXT,
|
||||
PVRSRV_ERROR_UNABLE_TO_DESTROY_CONTEXT,
|
||||
PVRSRV_ERROR_INVALID_HEAP,
|
||||
PVRSRV_ERROR_INVALID_KERNELINFO,
|
||||
PVRSRV_ERROR_UNKNOWN_POWER_STATE,
|
||||
PVRSRV_ERROR_INVALID_HANDLE_TYPE,
|
||||
PVRSRV_ERROR_INVALID_WRAP_TYPE,
|
||||
PVRSRV_ERROR_INVALID_PHYS_ADDR,
|
||||
PVRSRV_ERROR_INVALID_CPU_ADDR,
|
||||
PVRSRV_ERROR_INVALID_HEAPINFO,
|
||||
PVRSRV_ERROR_INVALID_PERPROC,
|
||||
PVRSRV_ERROR_FAILED_TO_RETRIEVE_HEAPINFO,
|
||||
PVRSRV_ERROR_INVALID_MAP_REQUEST,
|
||||
PVRSRV_ERROR_INVALID_UNMAP_REQUEST,
|
||||
PVRSRV_ERROR_UNABLE_TO_FIND_MAPPING_HEAP,
|
||||
PVRSRV_ERROR_MAPPING_STILL_IN_USE,
|
||||
|
||||
PVRSRV_ERROR_EXCEEDED_HW_LIMITS,
|
||||
PVRSRV_ERROR_NO_STAGING_BUFFER_ALLOCATED,
|
||||
|
||||
PVRSRV_ERROR_UNABLE_TO_CREATE_PERPROC_AREA,
|
||||
PVRSRV_ERROR_UNABLE_TO_CREATE_EVENT,
|
||||
PVRSRV_ERROR_UNABLE_TO_ENABLE_EVENT,
|
||||
PVRSRV_ERROR_UNABLE_TO_REGISTER_EVENT,
|
||||
PVRSRV_ERROR_UNABLE_TO_DESTROY_EVENT,
|
||||
PVRSRV_ERROR_UNABLE_TO_CREATE_THREAD,
|
||||
PVRSRV_ERROR_UNABLE_TO_CLOSE_THREAD,
|
||||
PVRSRV_ERROR_THREAD_READ_ERROR,
|
||||
PVRSRV_ERROR_UNABLE_TO_REGISTER_ISR_HANDLER,
|
||||
PVRSRV_ERROR_UNABLE_TO_INSTALL_ISR,
|
||||
PVRSRV_ERROR_UNABLE_TO_UNINSTALL_ISR,
|
||||
PVRSRV_ERROR_ISR_ALREADY_INSTALLED,
|
||||
PVRSRV_ERROR_ISR_NOT_INSTALLED,
|
||||
PVRSRV_ERROR_UNABLE_TO_INITIALISE_INTERRUPT,
|
||||
PVRSRV_ERROR_UNABLE_TO_RETRIEVE_INFO,
|
||||
PVRSRV_ERROR_UNABLE_TO_DO_BACKWARDS_BLIT,
|
||||
PVRSRV_ERROR_UNABLE_TO_CLOSE_SERVICES,
|
||||
PVRSRV_ERROR_UNABLE_TO_REGISTER_CONTEXT,
|
||||
PVRSRV_ERROR_UNABLE_TO_REGISTER_RESOURCE,
|
||||
PVRSRV_ERROR_UNABLE_TO_CLOSE_HANDLE,
|
||||
|
||||
PVRSRV_ERROR_INVALID_CCB_COMMAND,
|
||||
|
||||
PVRSRV_ERROR_UNABLE_TO_LOCK_RESOURCE,
|
||||
PVRSRV_ERROR_INVALID_LOCK_ID,
|
||||
PVRSRV_ERROR_RESOURCE_NOT_LOCKED,
|
||||
|
||||
PVRSRV_ERROR_FLIP_FAILED,
|
||||
PVRSRV_ERROR_UNBLANK_DISPLAY_FAILED,
|
||||
|
||||
PVRSRV_ERROR_TIMEOUT_POLLING_FOR_VALUE,
|
||||
|
||||
PVRSRV_ERROR_CREATE_RENDER_CONTEXT_FAILED,
|
||||
PVRSRV_ERROR_UNKNOWN_PRIMARY_FRAG,
|
||||
PVRSRV_ERROR_UNEXPECTED_SECONDARY_FRAG,
|
||||
PVRSRV_ERROR_UNEXPECTED_PRIMARY_FRAG,
|
||||
|
||||
PVRSRV_ERROR_UNABLE_TO_INSERT_FENCE_ID,
|
||||
|
||||
PVRSRV_ERROR_BLIT_SETUP_FAILED,
|
||||
|
||||
PVRSRV_ERROR_PDUMP_NOT_AVAILABLE,
|
||||
PVRSRV_ERROR_PDUMP_BUFFER_FULL,
|
||||
PVRSRV_ERROR_PDUMP_BUF_OVERFLOW,
|
||||
PVRSRV_ERROR_PDUMP_NOT_ACTIVE,
|
||||
PVRSRV_ERROR_INCOMPLETE_LINE_OVERLAPS_PAGES,
|
||||
|
||||
PVRSRV_ERROR_MUTEX_DESTROY_FAILED,
|
||||
PVRSRV_ERROR_MUTEX_INTERRUPTIBLE_ERROR,
|
||||
|
||||
PVRSRV_ERROR_INSUFFICIENT_SCRIPT_SPACE,
|
||||
PVRSRV_ERROR_INSUFFICIENT_SPACE_FOR_COMMAND,
|
||||
|
||||
PVRSRV_ERROR_PROCESS_NOT_INITIALISED,
|
||||
PVRSRV_ERROR_PROCESS_NOT_FOUND,
|
||||
PVRSRV_ERROR_SRV_CONNECT_FAILED,
|
||||
PVRSRV_ERROR_SRV_DISCONNECT_FAILED,
|
||||
PVRSRV_ERROR_DEINT_PHASE_FAILED,
|
||||
PVRSRV_ERROR_INIT2_PHASE_FAILED,
|
||||
|
||||
PVRSRV_ERROR_UNABLE_TO_FIND_RESOURCE,
|
||||
|
||||
PVRSRV_ERROR_NO_DC_DEVICES_FOUND,
|
||||
PVRSRV_ERROR_UNABLE_TO_OPEN_DC_DEVICE,
|
||||
PVRSRV_ERROR_UNABLE_TO_REMOVE_DEVICE,
|
||||
PVRSRV_ERROR_NO_DEVICEDATA_FOUND,
|
||||
PVRSRV_ERROR_NO_DEVICENODE_FOUND,
|
||||
PVRSRV_ERROR_NO_CLIENTNODE_FOUND,
|
||||
PVRSRV_ERROR_FAILED_TO_PROCESS_QUEUE,
|
||||
|
||||
PVRSRV_ERROR_UNABLE_TO_INIT_TASK,
|
||||
PVRSRV_ERROR_UNABLE_TO_SCHEDULE_TASK,
|
||||
PVRSRV_ERROR_UNABLE_TO_KILL_TASK,
|
||||
|
||||
PVRSRV_ERROR_UNABLE_TO_ENABLE_TIMER,
|
||||
PVRSRV_ERROR_UNABLE_TO_DISABLE_TIMER,
|
||||
PVRSRV_ERROR_UNABLE_TO_REMOVE_TIMER,
|
||||
|
||||
PVRSRV_ERROR_UNKNOWN_PIXEL_FORMAT,
|
||||
PVRSRV_ERROR_UNKNOWN_SCRIPT_OPERATION,
|
||||
|
||||
PVRSRV_ERROR_HANDLE_INDEX_OUT_OF_RANGE,
|
||||
PVRSRV_ERROR_HANDLE_NOT_ALLOCATED,
|
||||
PVRSRV_ERROR_HANDLE_TYPE_MISMATCH,
|
||||
PVRSRV_ERROR_UNABLE_TO_ADD_HANDLE,
|
||||
PVRSRV_ERROR_HANDLE_NOT_SHAREABLE,
|
||||
PVRSRV_ERROR_HANDLE_NOT_FOUND,
|
||||
PVRSRV_ERROR_INVALID_SUBHANDLE,
|
||||
PVRSRV_ERROR_HANDLE_BATCH_IN_USE,
|
||||
PVRSRV_ERROR_HANDLE_BATCH_COMMIT_FAILURE,
|
||||
|
||||
PVRSRV_ERROR_UNABLE_TO_CREATE_HASH_TABLE,
|
||||
PVRSRV_ERROR_INSERT_HASH_TABLE_DATA_FAILED,
|
||||
|
||||
PVRSRV_ERROR_UNSUPPORTED_BACKING_STORE,
|
||||
PVRSRV_ERROR_UNABLE_TO_DESTROY_BM_HEAP,
|
||||
|
||||
PVRSRV_ERROR_UNKNOWN_INIT_SERVER_STATE,
|
||||
|
||||
PVRSRV_ERROR_NO_FREE_DEVICEIDS_AVALIABLE,
|
||||
PVRSRV_ERROR_INVALID_DEVICEID,
|
||||
PVRSRV_ERROR_DEVICEID_NOT_FOUND,
|
||||
|
||||
PVRSRV_ERROR_MEMORY_TEST_FAILED,
|
||||
PVRSRV_ERROR_CPUPADDR_TEST_FAILED,
|
||||
PVRSRV_ERROR_COPY_TEST_FAILED,
|
||||
|
||||
PVRSRV_ERROR_SEMAPHORE_NOT_INITIALISED,
|
||||
|
||||
PVRSRV_ERROR_UNABLE_TO_RELEASE_CLOCK,
|
||||
PVRSRV_ERROR_CLOCK_REQUEST_FAILED,
|
||||
PVRSRV_ERROR_DISABLE_CLOCK_FAILURE,
|
||||
PVRSRV_ERROR_UNABLE_TO_SET_CLOCK_RATE,
|
||||
PVRSRV_ERROR_UNABLE_TO_ROUND_CLOCK_RATE,
|
||||
PVRSRV_ERROR_UNABLE_TO_ENABLE_CLOCK,
|
||||
PVRSRV_ERROR_UNABLE_TO_GET_CLOCK,
|
||||
PVRSRV_ERROR_UNABLE_TO_GET_PARENT_CLOCK,
|
||||
PVRSRV_ERROR_UNABLE_TO_GET_SYSTEM_CLOCK,
|
||||
|
||||
PVRSRV_ERROR_UNKNOWN_SGL_ERROR,
|
||||
|
||||
PVRSRV_ERROR_SYSTEM_POWER_CHANGE_FAILURE,
|
||||
PVRSRV_ERROR_DEVICE_POWER_CHANGE_FAILURE,
|
||||
|
||||
PVRSRV_ERROR_BAD_SYNC_STATE,
|
||||
|
||||
PVRSRV_ERROR_CACHEOP_FAILED,
|
||||
|
||||
PVRSRV_ERROR_FORCE_I32 = 0x7fffffff
|
||||
|
||||
} PVRSRV_ERROR;
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* List of known device classes.
|
||||
*****************************************************************************/
|
||||
typedef enum _PVRSRV_DEVICE_CLASS_
|
||||
{
|
||||
PVRSRV_DEVICE_CLASS_3D = 0 ,
|
||||
PVRSRV_DEVICE_CLASS_DISPLAY = 1 ,
|
||||
PVRSRV_DEVICE_CLASS_BUFFER = 2 ,
|
||||
PVRSRV_DEVICE_CLASS_VIDEO = 3 ,
|
||||
|
||||
PVRSRV_DEVICE_CLASS_FORCE_I32 = 0x7fffffff
|
||||
|
||||
} PVRSRV_DEVICE_CLASS;
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* States for power management
|
||||
*****************************************************************************/
|
||||
typedef enum _PVRSRV_SYS_POWER_STATE_
|
||||
{
|
||||
PVRSRV_SYS_POWER_STATE_Unspecified = -1, /*!< Unspecified : Uninitialised */
|
||||
PVRSRV_SYS_POWER_STATE_D0 = 0, /*!< On */
|
||||
PVRSRV_SYS_POWER_STATE_D1 = 1, /*!< User Idle */
|
||||
PVRSRV_SYS_POWER_STATE_D2 = 2, /*!< System Idle / sleep */
|
||||
PVRSRV_SYS_POWER_STATE_D3 = 3, /*!< Suspend / Hibernate */
|
||||
PVRSRV_SYS_POWER_STATE_D4 = 4, /*!< shutdown */
|
||||
|
||||
PVRSRV_SYS_POWER_STATE_FORCE_I32 = 0x7fffffff
|
||||
|
||||
} PVRSRV_SYS_POWER_STATE, *PPVRSRV_SYS_POWER_STATE;
|
||||
|
||||
|
||||
typedef enum _PVRSRV_DEV_POWER_STATE_
|
||||
{
|
||||
PVRSRV_DEV_POWER_STATE_DEFAULT = -1, /*!< Default state for the device */
|
||||
PVRSRV_DEV_POWER_STATE_ON = 0, /*!< Running */
|
||||
PVRSRV_DEV_POWER_STATE_IDLE = 1, /*!< Powered but operation paused */
|
||||
PVRSRV_DEV_POWER_STATE_OFF = 2, /*!< Unpowered */
|
||||
|
||||
PVRSRV_DEV_POWER_STATE_FORCE_I32 = 0x7fffffff
|
||||
|
||||
} PVRSRV_DEV_POWER_STATE, *PPVRSRV_DEV_POWER_STATE; /* PRQA S 3205 */
|
||||
|
||||
|
||||
/* Power transition handler prototypes */
|
||||
typedef PVRSRV_ERROR (*PFN_PRE_POWER) (IMG_HANDLE hDevHandle,
|
||||
PVRSRV_DEV_POWER_STATE eNewPowerState,
|
||||
PVRSRV_DEV_POWER_STATE eCurrentPowerState);
|
||||
typedef PVRSRV_ERROR (*PFN_POST_POWER) (IMG_HANDLE hDevHandle,
|
||||
PVRSRV_DEV_POWER_STATE eNewPowerState,
|
||||
PVRSRV_DEV_POWER_STATE eCurrentPowerState);
|
||||
|
||||
/* Clock speed handler prototypes */
|
||||
typedef PVRSRV_ERROR (*PFN_PRE_CLOCKSPEED_CHANGE) (IMG_HANDLE hDevHandle,
|
||||
IMG_BOOL bIdleDevice,
|
||||
PVRSRV_DEV_POWER_STATE eCurrentPowerState);
|
||||
typedef PVRSRV_ERROR (*PFN_POST_CLOCKSPEED_CHANGE) (IMG_HANDLE hDevHandle,
|
||||
IMG_BOOL bIdleDevice,
|
||||
PVRSRV_DEV_POWER_STATE eCurrentPowerState);
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
* Enumeration of all possible pixel types. Where applicable, Ordering of name
|
||||
* is in reverse order of memory bytes (i.e. as a word in little endian).
|
||||
* e.g. A8R8G8B8 is in memory as 4 bytes in order: BB GG RR AA
|
||||
*
|
||||
* NOTE: When modifying this structure please update the client driver format
|
||||
* tables located in %WORKROOT%/eurasia/codegen/pixfmts using the tool
|
||||
* located in %WORKROOT%/eurasia/tools/intern/TextureFormatParser.
|
||||
*
|
||||
*****************************************************************************/
|
||||
typedef enum _PVRSRV_PIXEL_FORMAT_ {
|
||||
/* Basic types */
|
||||
PVRSRV_PIXEL_FORMAT_UNKNOWN = 0,
|
||||
PVRSRV_PIXEL_FORMAT_RGB565 = 1,
|
||||
PVRSRV_PIXEL_FORMAT_RGB555 = 2,
|
||||
PVRSRV_PIXEL_FORMAT_RGB888 = 3, /*!< 24bit */
|
||||
PVRSRV_PIXEL_FORMAT_BGR888 = 4, /*!< 24bit */
|
||||
PVRSRV_PIXEL_FORMAT_GREY_SCALE = 8,
|
||||
PVRSRV_PIXEL_FORMAT_PAL12 = 13,
|
||||
PVRSRV_PIXEL_FORMAT_PAL8 = 14,
|
||||
PVRSRV_PIXEL_FORMAT_PAL4 = 15,
|
||||
PVRSRV_PIXEL_FORMAT_PAL2 = 16,
|
||||
PVRSRV_PIXEL_FORMAT_PAL1 = 17,
|
||||
PVRSRV_PIXEL_FORMAT_ARGB1555 = 18,
|
||||
PVRSRV_PIXEL_FORMAT_ARGB4444 = 19,
|
||||
PVRSRV_PIXEL_FORMAT_ARGB8888 = 20,
|
||||
PVRSRV_PIXEL_FORMAT_ABGR8888 = 21,
|
||||
PVRSRV_PIXEL_FORMAT_YV12 = 22,
|
||||
PVRSRV_PIXEL_FORMAT_I420 = 23,
|
||||
PVRSRV_PIXEL_FORMAT_IMC2 = 25,
|
||||
PVRSRV_PIXEL_FORMAT_XRGB8888 = 26,
|
||||
PVRSRV_PIXEL_FORMAT_XBGR8888 = 27,
|
||||
PVRSRV_PIXEL_FORMAT_BGRA8888 = 28,
|
||||
PVRSRV_PIXEL_FORMAT_XRGB4444 = 29,
|
||||
PVRSRV_PIXEL_FORMAT_ARGB8332 = 30,
|
||||
PVRSRV_PIXEL_FORMAT_A2RGB10 = 31, /*!< 32bpp, 10 bits for R, G, B, 2 bits for A */
|
||||
PVRSRV_PIXEL_FORMAT_A2BGR10 = 32, /*!< 32bpp, 10 bits for B, G, R, 2 bits for A */
|
||||
PVRSRV_PIXEL_FORMAT_P8 = 33,
|
||||
PVRSRV_PIXEL_FORMAT_L8 = 34,
|
||||
PVRSRV_PIXEL_FORMAT_A8L8 = 35,
|
||||
PVRSRV_PIXEL_FORMAT_A4L4 = 36,
|
||||
PVRSRV_PIXEL_FORMAT_L16 = 37,
|
||||
PVRSRV_PIXEL_FORMAT_L6V5U5 = 38,
|
||||
PVRSRV_PIXEL_FORMAT_V8U8 = 39,
|
||||
PVRSRV_PIXEL_FORMAT_V16U16 = 40,
|
||||
PVRSRV_PIXEL_FORMAT_QWVU8888 = 41,
|
||||
PVRSRV_PIXEL_FORMAT_XLVU8888 = 42,
|
||||
PVRSRV_PIXEL_FORMAT_QWVU16 = 43,
|
||||
PVRSRV_PIXEL_FORMAT_D16 = 44,
|
||||
PVRSRV_PIXEL_FORMAT_D24S8 = 45,
|
||||
PVRSRV_PIXEL_FORMAT_D24X8 = 46,
|
||||
|
||||
/* Added to ensure TQ build */
|
||||
PVRSRV_PIXEL_FORMAT_ABGR16 = 47,
|
||||
PVRSRV_PIXEL_FORMAT_ABGR16F = 48,
|
||||
PVRSRV_PIXEL_FORMAT_ABGR32 = 49,
|
||||
PVRSRV_PIXEL_FORMAT_ABGR32F = 50,
|
||||
PVRSRV_PIXEL_FORMAT_B10GR11 = 51,
|
||||
PVRSRV_PIXEL_FORMAT_GR88 = 52,
|
||||
PVRSRV_PIXEL_FORMAT_BGR32 = 53,
|
||||
PVRSRV_PIXEL_FORMAT_GR32 = 54,
|
||||
PVRSRV_PIXEL_FORMAT_E5BGR9 = 55,
|
||||
|
||||
/* reserved types */
|
||||
PVRSRV_PIXEL_FORMAT_RESERVED1 = 56,
|
||||
PVRSRV_PIXEL_FORMAT_RESERVED2 = 57,
|
||||
PVRSRV_PIXEL_FORMAT_RESERVED3 = 58,
|
||||
PVRSRV_PIXEL_FORMAT_RESERVED4 = 59,
|
||||
PVRSRV_PIXEL_FORMAT_RESERVED5 = 60,
|
||||
|
||||
/* RGB space packed formats */
|
||||
PVRSRV_PIXEL_FORMAT_R8G8_B8G8 = 61,
|
||||
PVRSRV_PIXEL_FORMAT_G8R8_G8B8 = 62,
|
||||
|
||||
/* YUV space planar formats */
|
||||
PVRSRV_PIXEL_FORMAT_NV11 = 63,
|
||||
PVRSRV_PIXEL_FORMAT_NV12 = 64,
|
||||
|
||||
/* YUV space packed formats */
|
||||
PVRSRV_PIXEL_FORMAT_YUY2 = 65,
|
||||
PVRSRV_PIXEL_FORMAT_YUV420 = 66,
|
||||
PVRSRV_PIXEL_FORMAT_YUV444 = 67,
|
||||
PVRSRV_PIXEL_FORMAT_VUY444 = 68,
|
||||
PVRSRV_PIXEL_FORMAT_YUYV = 69,
|
||||
PVRSRV_PIXEL_FORMAT_YVYU = 70,
|
||||
PVRSRV_PIXEL_FORMAT_UYVY = 71,
|
||||
PVRSRV_PIXEL_FORMAT_VYUY = 72,
|
||||
|
||||
PVRSRV_PIXEL_FORMAT_FOURCC_ORG_UYVY = 73, /*!< See http://www.fourcc.org/yuv.php#UYVY */
|
||||
PVRSRV_PIXEL_FORMAT_FOURCC_ORG_YUYV = 74, /*!< See http://www.fourcc.org/yuv.php#YUYV */
|
||||
PVRSRV_PIXEL_FORMAT_FOURCC_ORG_YVYU = 75, /*!< See http://www.fourcc.org/yuv.php#YVYU */
|
||||
PVRSRV_PIXEL_FORMAT_FOURCC_ORG_VYUY = 76, /*!< No fourcc.org link */
|
||||
PVRSRV_PIXEL_FORMAT_FOURCC_ORG_AYUV = 77, /*!< See http://www.fourcc.org/yuv.php#AYUV */
|
||||
|
||||
/* 4 component, 32 bits per component types */
|
||||
PVRSRV_PIXEL_FORMAT_A32B32G32R32 = 78, /*!< type unspecified */
|
||||
PVRSRV_PIXEL_FORMAT_A32B32G32R32F = 79, /*!< float type */
|
||||
PVRSRV_PIXEL_FORMAT_A32B32G32R32_UINT = 80, /*!< uint type */
|
||||
PVRSRV_PIXEL_FORMAT_A32B32G32R32_SINT = 81, /*!< sint type */
|
||||
|
||||
/* 3 component, 32 bits per component types */
|
||||
PVRSRV_PIXEL_FORMAT_B32G32R32 = 82, /*!< type unspecified */
|
||||
PVRSRV_PIXEL_FORMAT_B32G32R32F = 83, /*!< float data */
|
||||
PVRSRV_PIXEL_FORMAT_B32G32R32_UINT = 84, /*!< uint data */
|
||||
PVRSRV_PIXEL_FORMAT_B32G32R32_SINT = 85, /*!< signed int data */
|
||||
|
||||
/* 2 component, 32 bits per component types */
|
||||
PVRSRV_PIXEL_FORMAT_G32R32 = 86, /*!< type unspecified */
|
||||
PVRSRV_PIXEL_FORMAT_G32R32F = 87, /*!< float */
|
||||
PVRSRV_PIXEL_FORMAT_G32R32_UINT = 88, /*!< uint */
|
||||
PVRSRV_PIXEL_FORMAT_G32R32_SINT = 89, /*!< signed int */
|
||||
|
||||
/* 1 component, 32 bits per component types */
|
||||
PVRSRV_PIXEL_FORMAT_D32F = 90, /*!< float depth */
|
||||
PVRSRV_PIXEL_FORMAT_R32 = 91, /*!< type unspecified */
|
||||
PVRSRV_PIXEL_FORMAT_R32F = 92, /*!< float type */
|
||||
PVRSRV_PIXEL_FORMAT_R32_UINT = 93, /*!< unsigned int type */
|
||||
PVRSRV_PIXEL_FORMAT_R32_SINT = 94, /*!< signed int type */
|
||||
|
||||
/* 4 component, 16 bits per component types */
|
||||
PVRSRV_PIXEL_FORMAT_A16B16G16R16 = 95, /*!< type unspecified */
|
||||
PVRSRV_PIXEL_FORMAT_A16B16G16R16F = 96, /*!< type float */
|
||||
PVRSRV_PIXEL_FORMAT_A16B16G16R16_SINT = 97, /*!< signed ints */
|
||||
PVRSRV_PIXEL_FORMAT_A16B16G16R16_SNORM = 98, /*!< signed normalised int */
|
||||
PVRSRV_PIXEL_FORMAT_A16B16G16R16_UINT = 99, /*!< unsigned ints */
|
||||
PVRSRV_PIXEL_FORMAT_A16B16G16R16_UNORM = 100, /*!< normalised unsigned int */
|
||||
|
||||
/* 2 component, 16 bits per component types */
|
||||
PVRSRV_PIXEL_FORMAT_G16R16 = 101, /*!< unspecified type */
|
||||
PVRSRV_PIXEL_FORMAT_G16R16F = 102, /*!< float type */
|
||||
PVRSRV_PIXEL_FORMAT_G16R16_UINT = 103, /*!< unsigned int type */
|
||||
PVRSRV_PIXEL_FORMAT_G16R16_UNORM = 104, /*!< unsigned normalised */
|
||||
PVRSRV_PIXEL_FORMAT_G16R16_SINT = 105, /*!< signed int */
|
||||
PVRSRV_PIXEL_FORMAT_G16R16_SNORM = 106, /*!< signed normalised */
|
||||
|
||||
/* 1 component, 16 bits per component types */
|
||||
PVRSRV_PIXEL_FORMAT_R16 = 107, /*!< type unspecified */
|
||||
PVRSRV_PIXEL_FORMAT_R16F = 108, /*!< float type */
|
||||
PVRSRV_PIXEL_FORMAT_R16_UINT = 109, /*!< unsigned int type */
|
||||
PVRSRV_PIXEL_FORMAT_R16_UNORM = 110, /*!< unsigned normalised int type */
|
||||
PVRSRV_PIXEL_FORMAT_R16_SINT = 111, /*!< signed int type */
|
||||
PVRSRV_PIXEL_FORMAT_R16_SNORM = 112, /*!< signed normalised int type */
|
||||
|
||||
/* 4 component, 8 bits per component types */
|
||||
PVRSRV_PIXEL_FORMAT_X8R8G8B8 = 113, /*!< type unspecified */
|
||||
PVRSRV_PIXEL_FORMAT_X8R8G8B8_UNORM = 114, /*!< normalised unsigned int */
|
||||
PVRSRV_PIXEL_FORMAT_X8R8G8B8_UNORM_SRGB = 115, /*!< normalised uint with sRGB */
|
||||
|
||||
PVRSRV_PIXEL_FORMAT_A8R8G8B8 = 116, /*!< type unspecified */
|
||||
PVRSRV_PIXEL_FORMAT_A8R8G8B8_UNORM = 117, /*!< normalised unsigned int */
|
||||
PVRSRV_PIXEL_FORMAT_A8R8G8B8_UNORM_SRGB = 118, /*!< normalised uint with sRGB */
|
||||
|
||||
PVRSRV_PIXEL_FORMAT_A8B8G8R8 = 119, /*!< type unspecified */
|
||||
PVRSRV_PIXEL_FORMAT_A8B8G8R8_UINT = 120, /*!< unsigned int */
|
||||
PVRSRV_PIXEL_FORMAT_A8B8G8R8_UNORM = 121, /*!< normalised unsigned int */
|
||||
PVRSRV_PIXEL_FORMAT_A8B8G8R8_UNORM_SRGB = 122, /*!< normalised unsigned int */
|
||||
PVRSRV_PIXEL_FORMAT_A8B8G8R8_SINT = 123, /*!< signed int */
|
||||
PVRSRV_PIXEL_FORMAT_A8B8G8R8_SNORM = 124, /*!< normalised signed int */
|
||||
|
||||
/* 2 component, 8 bits per component types */
|
||||
PVRSRV_PIXEL_FORMAT_G8R8 = 125, /*!< type unspecified */
|
||||
PVRSRV_PIXEL_FORMAT_G8R8_UINT = 126, /*!< unsigned int type */
|
||||
PVRSRV_PIXEL_FORMAT_G8R8_UNORM = 127, /*!< unsigned int normalised */
|
||||
PVRSRV_PIXEL_FORMAT_G8R8_SINT = 128, /*!< signed int type */
|
||||
PVRSRV_PIXEL_FORMAT_G8R8_SNORM = 129, /*!< signed int normalised */
|
||||
|
||||
/* 1 component, 8 bits per component types */
|
||||
PVRSRV_PIXEL_FORMAT_A8 = 130, /*!< type unspecified, alpha channel */
|
||||
PVRSRV_PIXEL_FORMAT_R8 = 131, /*!< type unspecified */
|
||||
PVRSRV_PIXEL_FORMAT_R8_UINT = 132, /*!< unsigned int */
|
||||
PVRSRV_PIXEL_FORMAT_R8_UNORM = 133, /*!< unsigned normalised int */
|
||||
PVRSRV_PIXEL_FORMAT_R8_SINT = 134, /*!< signed int */
|
||||
PVRSRV_PIXEL_FORMAT_R8_SNORM = 135, /*!< signed normalised int */
|
||||
|
||||
/* A2RGB10 types */
|
||||
PVRSRV_PIXEL_FORMAT_A2B10G10R10 = 136, /*!< Type unspecified */
|
||||
PVRSRV_PIXEL_FORMAT_A2B10G10R10_UNORM = 137, /*!< normalised unsigned int */
|
||||
PVRSRV_PIXEL_FORMAT_A2B10G10R10_UINT = 138, /*!< unsigned int */
|
||||
|
||||
/* F11F11F10 types */
|
||||
PVRSRV_PIXEL_FORMAT_B10G11R11 = 139, /*!< type unspecified */
|
||||
PVRSRV_PIXEL_FORMAT_B10G11R11F = 140, /*!< float type */
|
||||
|
||||
/* esoteric types */
|
||||
PVRSRV_PIXEL_FORMAT_X24G8R32 = 141, /*!< 64 bit, type unspecified (Usually typed to D32S8 style) */
|
||||
PVRSRV_PIXEL_FORMAT_G8R24 = 142, /*!< 32 bit, type unspecified (Usually typed to D24S8 style) */
|
||||
PVRSRV_PIXEL_FORMAT_X8R24 = 143,
|
||||
PVRSRV_PIXEL_FORMAT_E5B9G9R9 = 144, /*!< 32 bit, shared exponent (RGBE). */
|
||||
PVRSRV_PIXEL_FORMAT_R1 = 145, /*!< 1 bit monochrome */
|
||||
|
||||
PVRSRV_PIXEL_FORMAT_RESERVED6 = 146,
|
||||
PVRSRV_PIXEL_FORMAT_RESERVED7 = 147,
|
||||
PVRSRV_PIXEL_FORMAT_RESERVED8 = 148,
|
||||
PVRSRV_PIXEL_FORMAT_RESERVED9 = 149,
|
||||
PVRSRV_PIXEL_FORMAT_RESERVED10 = 150,
|
||||
PVRSRV_PIXEL_FORMAT_RESERVED11 = 151,
|
||||
PVRSRV_PIXEL_FORMAT_RESERVED12 = 152,
|
||||
PVRSRV_PIXEL_FORMAT_RESERVED13 = 153,
|
||||
PVRSRV_PIXEL_FORMAT_RESERVED14 = 154,
|
||||
PVRSRV_PIXEL_FORMAT_RESERVED15 = 155,
|
||||
PVRSRV_PIXEL_FORMAT_RESERVED16 = 156,
|
||||
PVRSRV_PIXEL_FORMAT_RESERVED17 = 157,
|
||||
PVRSRV_PIXEL_FORMAT_RESERVED18 = 158,
|
||||
PVRSRV_PIXEL_FORMAT_RESERVED19 = 159,
|
||||
PVRSRV_PIXEL_FORMAT_RESERVED20 = 160,
|
||||
|
||||
/* DXLegacy vertex types */
|
||||
PVRSRV_PIXEL_FORMAT_UBYTE4 = 161, /*!< 4 channels, 1 byte per channel, normalised */
|
||||
PVRSRV_PIXEL_FORMAT_SHORT4 = 162, /*!< 4 signed channels, 16 bits each, unnormalised */
|
||||
PVRSRV_PIXEL_FORMAT_SHORT4N = 163, /*!< 4 signed channels, 16 bits each, normalised */
|
||||
PVRSRV_PIXEL_FORMAT_USHORT4N = 164, /*!< 4 unsigned channels, 16 bits each, normalised */
|
||||
PVRSRV_PIXEL_FORMAT_SHORT2N = 165, /*!< 2 signed channels, 16 bits each, normalised */
|
||||
PVRSRV_PIXEL_FORMAT_SHORT2 = 166, /*!< 2 signed channels, 16 bits each, unnormalised */
|
||||
PVRSRV_PIXEL_FORMAT_USHORT2N = 167, /*!< 2 unsigned channels, 16 bits each, normalised */
|
||||
PVRSRV_PIXEL_FORMAT_UDEC3 = 168, /*!< 3 10-bit channels, unnormalised, unsigned*/
|
||||
PVRSRV_PIXEL_FORMAT_DEC3N = 169, /*!< 3 10-bit channels, signed normalised */
|
||||
PVRSRV_PIXEL_FORMAT_F16_2 = 170, /*!< 2 F16 channels */
|
||||
PVRSRV_PIXEL_FORMAT_F16_4 = 171, /*!< 4 F16 channels */
|
||||
|
||||
/* misc float types */
|
||||
PVRSRV_PIXEL_FORMAT_L_F16 = 172,
|
||||
PVRSRV_PIXEL_FORMAT_L_F16_REP = 173,
|
||||
PVRSRV_PIXEL_FORMAT_L_F16_A_F16 = 174,
|
||||
PVRSRV_PIXEL_FORMAT_A_F16 = 175,
|
||||
PVRSRV_PIXEL_FORMAT_B16G16R16F = 176,
|
||||
|
||||
PVRSRV_PIXEL_FORMAT_L_F32 = 177,
|
||||
PVRSRV_PIXEL_FORMAT_A_F32 = 178,
|
||||
PVRSRV_PIXEL_FORMAT_L_F32_A_F32 = 179,
|
||||
|
||||
/* powervr types */
|
||||
PVRSRV_PIXEL_FORMAT_PVRTC2 = 180,
|
||||
PVRSRV_PIXEL_FORMAT_PVRTC4 = 181,
|
||||
PVRSRV_PIXEL_FORMAT_PVRTCII2 = 182,
|
||||
PVRSRV_PIXEL_FORMAT_PVRTCII4 = 183,
|
||||
PVRSRV_PIXEL_FORMAT_PVRTCIII = 184,
|
||||
PVRSRV_PIXEL_FORMAT_PVRO8 = 185,
|
||||
PVRSRV_PIXEL_FORMAT_PVRO88 = 186,
|
||||
PVRSRV_PIXEL_FORMAT_PT1 = 187,
|
||||
PVRSRV_PIXEL_FORMAT_PT2 = 188,
|
||||
PVRSRV_PIXEL_FORMAT_PT4 = 189,
|
||||
PVRSRV_PIXEL_FORMAT_PT8 = 190,
|
||||
PVRSRV_PIXEL_FORMAT_PTW = 191,
|
||||
PVRSRV_PIXEL_FORMAT_PTB = 192,
|
||||
PVRSRV_PIXEL_FORMAT_MONO8 = 193,
|
||||
PVRSRV_PIXEL_FORMAT_MONO16 = 194,
|
||||
|
||||
/* additional YUV types */
|
||||
PVRSRV_PIXEL_FORMAT_C0_YUYV = 195,
|
||||
PVRSRV_PIXEL_FORMAT_C0_UYVY = 196,
|
||||
PVRSRV_PIXEL_FORMAT_C0_YVYU = 197,
|
||||
PVRSRV_PIXEL_FORMAT_C0_VYUY = 198,
|
||||
PVRSRV_PIXEL_FORMAT_C1_YUYV = 199,
|
||||
PVRSRV_PIXEL_FORMAT_C1_UYVY = 200,
|
||||
PVRSRV_PIXEL_FORMAT_C1_YVYU = 201,
|
||||
PVRSRV_PIXEL_FORMAT_C1_VYUY = 202,
|
||||
|
||||
/* planar YUV types */
|
||||
PVRSRV_PIXEL_FORMAT_C0_YUV420_2P_UV = 203,
|
||||
PVRSRV_PIXEL_FORMAT_C0_YUV420_2P_VU = 204,
|
||||
PVRSRV_PIXEL_FORMAT_C0_YUV420_3P = 205,
|
||||
PVRSRV_PIXEL_FORMAT_C1_YUV420_2P_UV = 206,
|
||||
PVRSRV_PIXEL_FORMAT_C1_YUV420_2P_VU = 207,
|
||||
PVRSRV_PIXEL_FORMAT_C1_YUV420_3P = 208,
|
||||
|
||||
PVRSRV_PIXEL_FORMAT_A2B10G10R10F = 209,
|
||||
PVRSRV_PIXEL_FORMAT_B8G8R8_SINT = 210,
|
||||
PVRSRV_PIXEL_FORMAT_PVRF32SIGNMASK = 211,
|
||||
|
||||
PVRSRV_PIXEL_FORMAT_ABGR4444 = 212,
|
||||
PVRSRV_PIXEL_FORMAT_ABGR1555 = 213,
|
||||
PVRSRV_PIXEL_FORMAT_BGR565 = 214,
|
||||
|
||||
/* 4k aligned planar YUV */
|
||||
PVRSRV_PIXEL_FORMAT_C0_4KYUV420_2P_UV = 215,
|
||||
PVRSRV_PIXEL_FORMAT_C0_4KYUV420_2P_VU = 216,
|
||||
PVRSRV_PIXEL_FORMAT_C1_4KYUV420_2P_UV = 217,
|
||||
PVRSRV_PIXEL_FORMAT_C1_4KYUV420_2P_VU = 218,
|
||||
PVRSRV_PIXEL_FORMAT_P208 = 219,
|
||||
PVRSRV_PIXEL_FORMAT_A8P8 = 220,
|
||||
|
||||
PVRSRV_PIXEL_FORMAT_A4 = 221,
|
||||
PVRSRV_PIXEL_FORMAT_AYUV8888 = 222,
|
||||
PVRSRV_PIXEL_FORMAT_RAW256 = 223,
|
||||
PVRSRV_PIXEL_FORMAT_RAW512 = 224,
|
||||
PVRSRV_PIXEL_FORMAT_RAW1024 = 225,
|
||||
|
||||
PVRSRV_PIXEL_FORMAT_FORCE_I32 = 0x7fffffff
|
||||
|
||||
} PVRSRV_PIXEL_FORMAT;
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* Enumeration of possible alpha types.
|
||||
*****************************************************************************/
|
||||
typedef enum _PVRSRV_ALPHA_FORMAT_ {
|
||||
PVRSRV_ALPHA_FORMAT_UNKNOWN = 0x00000000,
|
||||
PVRSRV_ALPHA_FORMAT_PRE = 0x00000001,
|
||||
PVRSRV_ALPHA_FORMAT_NONPRE = 0x00000002,
|
||||
PVRSRV_ALPHA_FORMAT_MASK = 0x0000000F,
|
||||
} PVRSRV_ALPHA_FORMAT;
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* Enumeration of possible alpha types.
|
||||
*****************************************************************************/
|
||||
typedef enum _PVRSRV_COLOURSPACE_FORMAT_ {
|
||||
PVRSRV_COLOURSPACE_FORMAT_UNKNOWN = 0x00000000,
|
||||
PVRSRV_COLOURSPACE_FORMAT_LINEAR = 0x00010000,
|
||||
PVRSRV_COLOURSPACE_FORMAT_NONLINEAR = 0x00020000,
|
||||
PVRSRV_COLOURSPACE_FORMAT_MASK = 0x000F0000,
|
||||
} PVRSRV_COLOURSPACE_FORMAT;
|
||||
|
||||
|
||||
/*
|
||||
* Drawable orientation (in degrees clockwise).
|
||||
* Opposite sense from WSEGL.
|
||||
*/
|
||||
typedef enum _PVRSRV_ROTATION_ {
|
||||
PVRSRV_ROTATE_0 = 0,
|
||||
PVRSRV_ROTATE_90 = 1,
|
||||
PVRSRV_ROTATE_180 = 2,
|
||||
PVRSRV_ROTATE_270 = 3,
|
||||
PVRSRV_FLIP_Y
|
||||
|
||||
} PVRSRV_ROTATION;
|
||||
|
||||
/*!
|
||||
* Flags for DisplayClassCreateSwapChain.
|
||||
*/
|
||||
#define PVRSRV_CREATE_SWAPCHAIN_SHARED (1<<0)
|
||||
#define PVRSRV_CREATE_SWAPCHAIN_QUERY (1<<1)
|
||||
#define PVRSRV_CREATE_SWAPCHAIN_OEMOVERLAY (1<<2)
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* Structure providing implementation details for serialisation and
|
||||
* synchronisation of operations. This is the fundamental unit on which operations
|
||||
* are synced, and would typically be included in any data structures that require
|
||||
* serialised accesses etc. e.g. MEM_INFO structures
|
||||
*
|
||||
*****************************************************************************/
|
||||
/*
|
||||
Sync Data to be shared/mapped between user/kernel
|
||||
*/
|
||||
typedef struct _PVRSRV_SYNC_DATA_
|
||||
{
|
||||
/* CPU accessible WriteOp Info */
|
||||
IMG_UINT32 ui32WriteOpsPending;
|
||||
volatile IMG_UINT32 ui32WriteOpsComplete;
|
||||
|
||||
/* CPU accessible ReadOp Info */
|
||||
IMG_UINT32 ui32ReadOpsPending;
|
||||
volatile IMG_UINT32 ui32ReadOpsComplete;
|
||||
|
||||
/* CPU accessible ReadOp2 Info */
|
||||
IMG_UINT32 ui32ReadOps2Pending;
|
||||
volatile IMG_UINT32 ui32ReadOps2Complete;
|
||||
|
||||
/* pdump specific value */
|
||||
IMG_UINT32 ui32LastOpDumpVal;
|
||||
IMG_UINT32 ui32LastReadOpDumpVal;
|
||||
|
||||
} PVRSRV_SYNC_DATA;
|
||||
|
||||
/*
|
||||
Client Sync Info structure
|
||||
*/
|
||||
#if defined(__psp2__)
|
||||
typedef struct _PVRSRV_CLIENT_SYNC_INFO_
|
||||
{
|
||||
IMG_SID hKernelSyncInfo;
|
||||
} PVRSRV_CLIENT_SYNC_INFO, *PPVRSRV_CLIENT_SYNC_INFO;
|
||||
#else
|
||||
typedef struct _PVRSRV_CLIENT_SYNC_INFO_
|
||||
{
|
||||
/* mapping of the kernel sync data */
|
||||
PVRSRV_SYNC_DATA *psSyncData;
|
||||
|
||||
/*
|
||||
FIXME: these should not be accessible by clients but the HAL is
|
||||
using them everywhere - remove when ready!!!
|
||||
*/
|
||||
/* Device accessible WriteOp Info */
|
||||
IMG_DEV_VIRTADDR sWriteOpsCompleteDevVAddr;
|
||||
|
||||
/* Device accessible ReadOp Info */
|
||||
IMG_DEV_VIRTADDR sReadOpsCompleteDevVAddr;
|
||||
|
||||
/* Device accessible ReadOp2 Info */
|
||||
IMG_DEV_VIRTADDR sReadOps2CompleteDevVAddr;
|
||||
|
||||
/* handle to client mapping data (OS specific) */
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hMappingInfo;
|
||||
|
||||
/* handle to kernel sync info */
|
||||
IMG_SID hKernelSyncInfo;
|
||||
#else
|
||||
IMG_HANDLE hMappingInfo;
|
||||
|
||||
/* handle to kernel sync info */
|
||||
IMG_HANDLE hKernelSyncInfo;
|
||||
#endif
|
||||
|
||||
} PVRSRV_CLIENT_SYNC_INFO, *PPVRSRV_CLIENT_SYNC_INFO;
|
||||
#endif
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* Resource locking structure
|
||||
*****************************************************************************/
|
||||
typedef struct PVRSRV_RESOURCE_TAG
|
||||
{
|
||||
volatile IMG_UINT32 ui32Lock;
|
||||
IMG_UINT32 ui32ID;
|
||||
}PVRSRV_RESOURCE;
|
||||
typedef PVRSRV_RESOURCE PVRSRV_RES_HANDLE;
|
||||
|
||||
|
||||
/* command complete callback pfn prototype */
|
||||
typedef IMG_VOID (*PFN_CMD_COMPLETE) (IMG_HANDLE);
|
||||
typedef IMG_VOID (**PPFN_CMD_COMPLETE) (IMG_HANDLE);
|
||||
|
||||
/* private command handler prototype */
|
||||
typedef IMG_BOOL (*PFN_CMD_PROC) (IMG_HANDLE, IMG_UINT32, IMG_VOID*);
|
||||
typedef IMG_BOOL (**PPFN_CMD_PROC) (IMG_HANDLE, IMG_UINT32, IMG_VOID*);
|
||||
|
||||
|
||||
/*
|
||||
rectangle structure required by Lock API
|
||||
*/
|
||||
typedef struct _IMG_RECT_
|
||||
{
|
||||
IMG_INT32 x0;
|
||||
IMG_INT32 y0;
|
||||
IMG_INT32 x1;
|
||||
IMG_INT32 y1;
|
||||
}IMG_RECT;
|
||||
|
||||
typedef struct _IMG_RECT_16_
|
||||
{
|
||||
IMG_INT16 x0;
|
||||
IMG_INT16 y0;
|
||||
IMG_INT16 x1;
|
||||
IMG_INT16 y1;
|
||||
}IMG_RECT_16;
|
||||
|
||||
|
||||
/* common pfn between BC/DC */
|
||||
typedef PVRSRV_ERROR (*PFN_GET_BUFFER_ADDR)(IMG_HANDLE,
|
||||
IMG_HANDLE,
|
||||
IMG_SYS_PHYADDR**,
|
||||
IMG_SIZE_T*,
|
||||
IMG_VOID**,
|
||||
IMG_HANDLE*,
|
||||
IMG_BOOL*,
|
||||
IMG_UINT32*);
|
||||
|
||||
|
||||
/*
|
||||
Display dimension structure definition
|
||||
*/
|
||||
typedef struct DISPLAY_DIMS_TAG
|
||||
{
|
||||
IMG_UINT32 ui32ByteStride;
|
||||
IMG_UINT32 ui32Width;
|
||||
IMG_UINT32 ui32Height;
|
||||
} DISPLAY_DIMS;
|
||||
|
||||
|
||||
/*
|
||||
Display format structure definition
|
||||
*/
|
||||
typedef struct DISPLAY_FORMAT_TAG
|
||||
{
|
||||
/* pixel format type */
|
||||
PVRSRV_PIXEL_FORMAT pixelformat;
|
||||
} DISPLAY_FORMAT;
|
||||
|
||||
/*
|
||||
Display Surface Attributes structure definition
|
||||
*/
|
||||
typedef struct DISPLAY_SURF_ATTRIBUTES_TAG
|
||||
{
|
||||
/* pixel format type */
|
||||
PVRSRV_PIXEL_FORMAT pixelformat;
|
||||
/* dimensions information structure array */
|
||||
DISPLAY_DIMS sDims;
|
||||
} DISPLAY_SURF_ATTRIBUTES;
|
||||
|
||||
|
||||
/*
|
||||
Display Mode information structure definition
|
||||
*/
|
||||
typedef struct DISPLAY_MODE_INFO_TAG
|
||||
{
|
||||
/* pixel format type */
|
||||
PVRSRV_PIXEL_FORMAT pixelformat;
|
||||
/* dimensions information structure array */
|
||||
DISPLAY_DIMS sDims;
|
||||
/* refresh rate of the display */
|
||||
IMG_UINT32 ui32RefreshHZ;
|
||||
/* OEM specific flags */
|
||||
IMG_UINT32 ui32OEMFlags;
|
||||
} DISPLAY_MODE_INFO;
|
||||
|
||||
|
||||
|
||||
#define MAX_DISPLAY_NAME_SIZE (50) /* arbitrary choice! */
|
||||
|
||||
/*
|
||||
Display info structure definition
|
||||
*/
|
||||
typedef struct DISPLAY_INFO_TAG
|
||||
{
|
||||
/* max swapchains supported */
|
||||
IMG_UINT32 ui32MaxSwapChains;
|
||||
/* max buffers in a swapchain */
|
||||
IMG_UINT32 ui32MaxSwapChainBuffers;
|
||||
/* min swap interval supported */
|
||||
IMG_UINT32 ui32MinSwapInterval;
|
||||
/* max swap interval supported */
|
||||
IMG_UINT32 ui32MaxSwapInterval;
|
||||
/* physical dimensions of the display required for DPI calc. */
|
||||
IMG_UINT32 ui32PhysicalWidthmm;
|
||||
IMG_UINT32 ui32PhysicalHeightmm;
|
||||
/* display name */
|
||||
IMG_CHAR szDisplayName[MAX_DISPLAY_NAME_SIZE];
|
||||
#if defined(SUPPORT_HW_CURSOR)
|
||||
/* cursor dimensions */
|
||||
IMG_UINT16 ui32CursorWidth;
|
||||
IMG_UINT16 ui32CursorHeight;
|
||||
#endif
|
||||
} DISPLAY_INFO;
|
||||
|
||||
typedef struct ACCESS_INFO_TAG
|
||||
{
|
||||
IMG_UINT32 ui32Size;
|
||||
IMG_UINT32 ui32FBPhysBaseAddress;
|
||||
IMG_UINT32 ui32FBMemAvailable; /* size of usable FB memory */
|
||||
IMG_UINT32 ui32SysPhysBaseAddress;
|
||||
IMG_UINT32 ui32SysSize;
|
||||
IMG_UINT32 ui32DevIRQ;
|
||||
}ACCESS_INFO;
|
||||
|
||||
|
||||
|
||||
#if defined(PDUMP_SUSPEND_IS_PER_THREAD)
|
||||
/** Present only on WinMobile 6.5 */
|
||||
|
||||
typedef struct {
|
||||
IMG_UINT32 threadId;
|
||||
IMG_INT suspendCount;
|
||||
} PVRSRV_THREAD_SUSPEND_COUNT;
|
||||
|
||||
#define PVRSRV_PDUMP_SUSPEND_Q_NAME "PVRSRVPDumpSuspendMsgQ"
|
||||
#define PVRSRV_PDUMP_SUSPEND_Q_LENGTH 8
|
||||
|
||||
#endif /* defined(PDUMP_SUSPEND_IS_PER_THREAD) */
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* This structure is used for OS independent registry (profile) access
|
||||
*****************************************************************************/
|
||||
typedef struct _PVRSRV_REGISTRY_INFO_
|
||||
{
|
||||
IMG_UINT32 ui32DevCookie;
|
||||
IMG_PCHAR pszKey;
|
||||
IMG_PCHAR pszValue;
|
||||
IMG_PCHAR pszBuf;
|
||||
IMG_UINT32 ui32BufSize;
|
||||
} PVRSRV_REGISTRY_INFO, *PPVRSRV_REGISTRY_INFO;
|
||||
|
||||
|
||||
PVRSRV_ERROR IMG_CALLCONV PVRSRVReadRegistryString (PPVRSRV_REGISTRY_INFO psRegInfo);
|
||||
PVRSRV_ERROR IMG_CALLCONV PVRSRVWriteRegistryString (PPVRSRV_REGISTRY_INFO psRegInfo);
|
||||
|
||||
|
||||
#define PVRSRV_BC_FLAGS_YUVCSC_CONFORMANT_RANGE (0 << 0)
|
||||
#define PVRSRV_BC_FLAGS_YUVCSC_FULL_RANGE (1 << 0)
|
||||
|
||||
#define PVRSRV_BC_FLAGS_YUVCSC_BT601 (0 << 1)
|
||||
#define PVRSRV_BC_FLAGS_YUVCSC_BT709 (1 << 1)
|
||||
|
||||
#define MAX_BUFFER_DEVICE_NAME_SIZE (50) /* arbitrary choice! */
|
||||
|
||||
/* buffer information structure */
|
||||
typedef struct BUFFER_INFO_TAG
|
||||
{
|
||||
IMG_UINT32 ui32BufferCount;
|
||||
IMG_UINT32 ui32BufferDeviceID;
|
||||
PVRSRV_PIXEL_FORMAT pixelformat;
|
||||
IMG_UINT32 ui32ByteStride;
|
||||
IMG_UINT32 ui32Width;
|
||||
IMG_UINT32 ui32Height;
|
||||
IMG_UINT32 ui32Flags;
|
||||
IMG_CHAR szDeviceName[MAX_BUFFER_DEVICE_NAME_SIZE];
|
||||
} BUFFER_INFO;
|
||||
|
||||
typedef enum _OVERLAY_DEINTERLACE_MODE_
|
||||
{
|
||||
WEAVE=0x0,
|
||||
BOB_ODD,
|
||||
BOB_EVEN,
|
||||
BOB_EVEN_NONINTERLEAVED
|
||||
} OVERLAY_DEINTERLACE_MODE;
|
||||
|
||||
#endif /* __SERVICESEXT_H__ */
|
||||
/*****************************************************************************
|
||||
End of file (servicesext.h)
|
||||
*****************************************************************************/
|
258
include/gpu_es4/eurasia/include4/sgx_options.h
Normal file
@ -0,0 +1,258 @@
|
||||
/*!****************************************************************************
|
||||
@File: sgx_options.h
|
||||
|
||||
@Title:
|
||||
|
||||
@Author: Imagination Technologies
|
||||
|
||||
@Date: 23-Feb-2009
|
||||
|
||||
@Copyright: Copyright 2007 by Imagination Technologies Limited.
|
||||
All rights reserved. No part of this software, either
|
||||
material or conceptual may be copied or distributed,
|
||||
transmitted, transcribed, stored in a retrieval system
|
||||
or translated into any human or computer language in any
|
||||
form by any means, electronic, mechanical, manual or
|
||||
other-wise, or disclosed to third parties without the
|
||||
express written permission of Imagination Technologies
|
||||
Limited, Unit 8, HomePark Industrial Estate,
|
||||
King's Langley, Hertfordshire, WD4 8LZ, U.K.
|
||||
|
||||
@Platform generic
|
||||
|
||||
@Description
|
||||
|
||||
@DoxygenVer
|
||||
|
||||
Modifications :
|
||||
$Log: sgx_options.h $
|
||||
******************************************************************************/
|
||||
|
||||
/* Each build option listed here is packed into a dword which
|
||||
* provides up to 32 flags (or up to 28 flags plus a numeric
|
||||
* value in the range 0-15 which corresponds to the number of
|
||||
* cores minus one if SGX_FEATURE_MP is defined). The corresponding
|
||||
* bit is set if the build option was enabled at compile time.
|
||||
*
|
||||
* In order to extract the enabled build flags the INTERNAL_TEST
|
||||
* switch should be enabled in a client program which includes this
|
||||
* header. Then the client can test specific build flags by reading
|
||||
* the bit value at ##OPTIONNAME##_SET_OFFSET in SGX_BUILD_OPTIONS.
|
||||
*
|
||||
* IMPORTANT: add new options to unused bits or define a new dword
|
||||
* (e.g. SGX_BUILD_OPTIONS2) so that the bitfield remains backwards
|
||||
* compatible.
|
||||
*/
|
||||
|
||||
|
||||
#if defined(DEBUG) || defined (INTERNAL_TEST)
|
||||
#define DEBUG_SET_OFFSET OPTIONS_BIT0
|
||||
#define OPTIONS_BIT0 0x1U
|
||||
#else
|
||||
#define OPTIONS_BIT0 0x0
|
||||
#endif /* DEBUG */
|
||||
|
||||
#if defined(PDUMP) || defined (INTERNAL_TEST)
|
||||
#define PDUMP_SET_OFFSET OPTIONS_BIT1
|
||||
#define OPTIONS_BIT1 (0x1U << 1)
|
||||
#else
|
||||
#define OPTIONS_BIT1 0x0
|
||||
#endif /* PDUMP */
|
||||
|
||||
#if defined(PVRSRV_USSE_EDM_STATUS_DEBUG) || defined (INTERNAL_TEST)
|
||||
#define PVRSRV_USSE_EDM_STATUS_DEBUG_SET_OFFSET OPTIONS_BIT2
|
||||
#define OPTIONS_BIT2 (0x1U << 2)
|
||||
#else
|
||||
#define OPTIONS_BIT2 0x0
|
||||
#endif /* PVRSRV_USSE_EDM_STATUS_DEBUG */
|
||||
|
||||
#if defined(SUPPORT_HW_RECOVERY) || defined (INTERNAL_TEST)
|
||||
#define SUPPORT_HW_RECOVERY_SET_OFFSET OPTIONS_BIT3
|
||||
#define OPTIONS_BIT3 (0x1U << 3)
|
||||
#else
|
||||
#define OPTIONS_BIT3 0x0
|
||||
#endif /* SUPPORT_HW_RECOVERY */
|
||||
|
||||
|
||||
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
#define PVR_SECURE_HANDLES_SET_OFFSET OPTIONS_BIT4
|
||||
#define OPTIONS_BIT4 (0x1U << 4)
|
||||
#else
|
||||
#if defined(PVR_SECURE_HANDLES) || defined (INTERNAL_TEST)
|
||||
#define PVR_SECURE_HANDLES_SET_OFFSET OPTIONS_BIT4
|
||||
#define OPTIONS_BIT4 (0x1U << 4)
|
||||
#else
|
||||
#define OPTIONS_BIT4 0x0
|
||||
#endif /* PVR_SECURE_HANDLES */
|
||||
#endif
|
||||
|
||||
#if defined(SGX_BYPASS_SYSTEM_CACHE) || defined (INTERNAL_TEST)
|
||||
#define SGX_BYPASS_SYSTEM_CACHE_SET_OFFSET OPTIONS_BIT5
|
||||
#define OPTIONS_BIT5 (0x1U << 5)
|
||||
#else
|
||||
#define OPTIONS_BIT5 0x0
|
||||
#endif /* SGX_BYPASS_SYSTEM_CACHE */
|
||||
|
||||
#if defined(SGX_DMS_AGE_ENABLE) || defined (INTERNAL_TEST)
|
||||
#define SGX_DMS_AGE_ENABLE_SET_OFFSET OPTIONS_BIT6
|
||||
#define OPTIONS_BIT6 (0x1U << 6)
|
||||
#else
|
||||
#define OPTIONS_BIT6 0x0
|
||||
#endif /* SGX_DMS_AGE_ENABLE */
|
||||
|
||||
#if defined(SGX_FAST_DPM_INIT) || defined (INTERNAL_TEST)
|
||||
#define SGX_FAST_DPM_INIT_SET_OFFSET OPTIONS_BIT8
|
||||
#define OPTIONS_BIT8 (0x1U << 8)
|
||||
#else
|
||||
#define OPTIONS_BIT8 0x0
|
||||
#endif /* SGX_FAST_DPM_INIT */
|
||||
|
||||
#if defined(SGX_FEATURE_WRITEBACK_DCU) || defined (INTERNAL_TEST)
|
||||
#define SGX_FEATURE_DCU_SET_OFFSET OPTIONS_BIT9
|
||||
#define OPTIONS_BIT9 (0x1U << 9)
|
||||
#else
|
||||
#define OPTIONS_BIT9 0x0
|
||||
#endif /* SGX_FEATURE_WRITEBACK_DCU */
|
||||
|
||||
#if defined(SGX_FEATURE_MP) || defined (INTERNAL_TEST)
|
||||
#define SGX_FEATURE_MP_SET_OFFSET OPTIONS_BIT10
|
||||
#define OPTIONS_BIT10 (0x1U << 10)
|
||||
#else
|
||||
#define OPTIONS_BIT10 0x0
|
||||
#endif /* SGX_FEATURE_MP */
|
||||
|
||||
#if defined(SGX_FEATURE_MULTITHREADED_UKERNEL) || defined (INTERNAL_TEST)
|
||||
#define SGX_FEATURE_MULTITHREADED_UKERNEL_SET_OFFSET OPTIONS_BIT11
|
||||
#define OPTIONS_BIT11 (0x1U << 11)
|
||||
#else
|
||||
#define OPTIONS_BIT11 0x0
|
||||
#endif /* SGX_FEATURE_MULTITHREADED_UKERNEL */
|
||||
|
||||
|
||||
|
||||
#if defined(SGX_FEATURE_OVERLAPPED_SPM) || defined (INTERNAL_TEST)
|
||||
#define SGX_FEATURE_OVERLAPPED_SPM_SET_OFFSET OPTIONS_BIT12
|
||||
#define OPTIONS_BIT12 (0x1U << 12)
|
||||
#else
|
||||
#define OPTIONS_BIT12 0x0
|
||||
#endif /* SGX_FEATURE_RENDER_TARGET_ARRAYS */
|
||||
|
||||
|
||||
#if defined(SGX_FEATURE_SYSTEM_CACHE) || defined (INTERNAL_TEST)
|
||||
#define SGX_FEATURE_SYSTEM_CACHE_SET_OFFSET OPTIONS_BIT13
|
||||
#define OPTIONS_BIT13 (0x1U << 13)
|
||||
#else
|
||||
#define OPTIONS_BIT13 0x0
|
||||
#endif /* SGX_FEATURE_SYSTEM_CACHE */
|
||||
|
||||
#if defined(SGX_SUPPORT_HWPROFILING) || defined (INTERNAL_TEST)
|
||||
#define SGX_SUPPORT_HWPROFILING_SET_OFFSET OPTIONS_BIT14
|
||||
#define OPTIONS_BIT14 (0x1U << 14)
|
||||
#else
|
||||
#define OPTIONS_BIT14 0x0
|
||||
#endif /* SGX_SUPPORT_HWPROFILING */
|
||||
|
||||
|
||||
|
||||
#if defined(SUPPORT_ACTIVE_POWER_MANAGEMENT) || defined (INTERNAL_TEST)
|
||||
#define SUPPORT_ACTIVE_POWER_MANAGEMENT_SET_OFFSET OPTIONS_BIT15
|
||||
#define OPTIONS_BIT15 (0x1U << 15)
|
||||
#else
|
||||
#define OPTIONS_BIT15 0x0
|
||||
#endif /* SUPPORT_ACTIVE_POWER_MANAGEMENT */
|
||||
|
||||
#if defined(SUPPORT_DISPLAYCONTROLLER_TILING) || defined (INTERNAL_TEST)
|
||||
#define SUPPORT_DISPLAYCONTROLLER_TILING_SET_OFFSET OPTIONS_BIT16
|
||||
#define OPTIONS_BIT16 (0x1U << 16)
|
||||
#else
|
||||
#define OPTIONS_BIT16 0x0
|
||||
#endif /* SUPPORT_DISPLAYCONTROLLER_TILING */
|
||||
|
||||
#if defined(SUPPORT_PERCONTEXT_PB) || defined (INTERNAL_TEST)
|
||||
#define SUPPORT_PERCONTEXT_PB_SET_OFFSET OPTIONS_BIT17
|
||||
#define OPTIONS_BIT17 (0x1U << 17)
|
||||
#else
|
||||
#define OPTIONS_BIT17 0x0
|
||||
#endif /* SUPPORT_PERCONTEXT_PB */
|
||||
|
||||
#if defined(SUPPORT_SGX_HWPERF) || defined (INTERNAL_TEST)
|
||||
#define SUPPORT_SGX_HWPERF_SET_OFFSET OPTIONS_BIT18
|
||||
#define OPTIONS_BIT18 (0x1U << 18)
|
||||
#else
|
||||
#define OPTIONS_BIT18 0x0
|
||||
#endif /* SUPPORT_SGX_HWPERF */
|
||||
|
||||
|
||||
|
||||
#if defined(SUPPORT_SGX_MMU_DUMMY_PAGE) || defined (INTERNAL_TEST)
|
||||
#define SUPPORT_SGX_MMU_DUMMY_PAGE_SET_OFFSET OPTIONS_BIT19
|
||||
#define OPTIONS_BIT19 (0x1U << 19)
|
||||
#else
|
||||
#define OPTIONS_BIT19 0x0
|
||||
#endif /* SUPPORT_SGX_MMU_DUMMY_PAGE */
|
||||
|
||||
#if defined(SUPPORT_SGX_PRIORITY_SCHEDULING) || defined (INTERNAL_TEST)
|
||||
#define SUPPORT_SGX_PRIORITY_SCHEDULING_SET_OFFSET OPTIONS_BIT20
|
||||
#define OPTIONS_BIT20 (0x1U << 20)
|
||||
#else
|
||||
#define OPTIONS_BIT20 0x0
|
||||
#endif /* SUPPORT_SGX_PRIORITY_SCHEDULING */
|
||||
|
||||
#if defined(SUPPORT_SGX_LOW_LATENCY_SCHEDULING) || defined (INTERNAL_TEST)
|
||||
#define SUPPORT_SGX_LOW_LATENCY_SCHEDULING_SET_OFFSET OPTIONS_BIT21
|
||||
#define OPTIONS_BIT21 (0x1U << 21)
|
||||
#else
|
||||
#define OPTIONS_BIT21 0x0
|
||||
#endif /* SUPPORT_SGX_LOW_LATENCY_SCHEDULING */
|
||||
|
||||
#if defined(USE_SUPPORT_NO_TA3D_OVERLAP) || defined (INTERNAL_TEST)
|
||||
#define USE_SUPPORT_NO_TA3D_OVERLAP_SET_OFFSET OPTIONS_BIT22
|
||||
#define OPTIONS_BIT22 (0x1U << 22)
|
||||
#else
|
||||
#define OPTIONS_BIT22 0x0
|
||||
#endif /* USE_SUPPORT_NO_TA3D_OVERLAP */
|
||||
|
||||
#if defined(SGX_FEATURE_MP) || defined (INTERNAL_TEST)
|
||||
#if defined(SGX_FEATURE_MP_CORE_COUNT)
|
||||
#define OPTIONS_HIGHBYTE ((SGX_FEATURE_MP_CORE_COUNT-1) << SGX_FEATURE_MP_CORE_COUNT_SET_OFFSET)
|
||||
#define SGX_FEATURE_MP_CORE_COUNT_SET_OFFSET 28UL
|
||||
#define SGX_FEATURE_MP_CORE_COUNT_SET_MASK 0xFF
|
||||
#else
|
||||
#define OPTIONS_HIGHBYTE (((SGX_FEATURE_MP_CORE_COUNT_TA-1) << SGX_FEATURE_MP_CORE_COUNT_SET_OFFSET) |\
|
||||
((SGX_FEATURE_MP_CORE_COUNT_3D-1) << SGX_FEATURE_MP_CORE_COUNT_SET_OFFSET_3D))
|
||||
#define SGX_FEATURE_MP_CORE_COUNT_SET_OFFSET 24UL
|
||||
#define SGX_FEATURE_MP_CORE_COUNT_SET_OFFSET_3D 28UL
|
||||
#define SGX_FEATURE_MP_CORE_COUNT_SET_MASK 0xFF
|
||||
#endif
|
||||
#else /* SGX_FEATURE_MP */
|
||||
#define OPTIONS_HIGHBYTE 0x0
|
||||
#endif /* SGX_FEATURE_MP */
|
||||
|
||||
|
||||
|
||||
#define SGX_BUILD_OPTIONS \
|
||||
OPTIONS_BIT0 |\
|
||||
OPTIONS_BIT1 |\
|
||||
OPTIONS_BIT2 |\
|
||||
OPTIONS_BIT3 |\
|
||||
OPTIONS_BIT4 |\
|
||||
OPTIONS_BIT5 |\
|
||||
OPTIONS_BIT6 |\
|
||||
OPTIONS_BIT8 |\
|
||||
OPTIONS_BIT9 |\
|
||||
OPTIONS_BIT10 |\
|
||||
OPTIONS_BIT11 |\
|
||||
OPTIONS_BIT12 |\
|
||||
OPTIONS_BIT13 |\
|
||||
OPTIONS_BIT14 |\
|
||||
OPTIONS_BIT15 |\
|
||||
OPTIONS_BIT16 |\
|
||||
OPTIONS_BIT17 |\
|
||||
OPTIONS_BIT18 |\
|
||||
OPTIONS_BIT19 |\
|
||||
OPTIONS_BIT20 |\
|
||||
OPTIONS_BIT21 |\
|
||||
OPTIONS_BIT22 |\
|
||||
OPTIONS_HIGHBYTE
|
||||
|
1315
include/gpu_es4/eurasia/include4/sgxapi.h
Normal file
501
include/gpu_es4/eurasia/include4/sgxapi_km.h
Normal file
@ -0,0 +1,501 @@
|
||||
/*!****************************************************************************
|
||||
@File sgxapi_km.h
|
||||
|
||||
@Title SGX KM API Header
|
||||
|
||||
@Author Imagination Technologies
|
||||
|
||||
@Date 01/06/2004
|
||||
|
||||
@Copyright Copyright 2004-2009 by Imagination Technologies Limited.
|
||||
All rights reserved. No part of this software, either material
|
||||
or conceptual may be copied or distributed, transmitted,
|
||||
transcribed, stored in a retrieval system or translated into
|
||||
any human or computer language in any form by any means,
|
||||
electronic, mechanical, manual or otherwise, or disclosed
|
||||
to third parties without the express written permission of
|
||||
Imagination Technologies Limited, Home Park Estate,
|
||||
Kings Langley, Hertfordshire, WD4 8LZ, U.K.
|
||||
|
||||
@Platform Cross platform / environment
|
||||
|
||||
@Description Exported SGX API details
|
||||
|
||||
@DoxygenVer
|
||||
|
||||
Modifications :-
|
||||
$Log: sgxapi_km.h $
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __SGXAPI_KM_H__
|
||||
#define __SGXAPI_KM_H__
|
||||
|
||||
#if defined (__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "sgxdefs.h"
|
||||
|
||||
#if defined(__linux__) && !defined(USE_CODE)
|
||||
#if defined(__KERNEL__)
|
||||
#include <asm/unistd.h>
|
||||
#else
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/******************************************************************************
|
||||
Some defines...
|
||||
******************************************************************************/
|
||||
|
||||
/* SGX Heap IDs, note: not all heaps are available to clients */
|
||||
#define SGX_UNDEFINED_HEAP_ID (~0LU)
|
||||
#define SGX_GENERAL_HEAP_ID 0
|
||||
#define SGX_TADATA_HEAP_ID 1
|
||||
#define SGX_KERNEL_CODE_HEAP_ID 2
|
||||
#define SGX_KERNEL_DATA_HEAP_ID 3
|
||||
#define SGX_PIXELSHADER_HEAP_ID 4
|
||||
#define SGX_VERTEXSHADER_HEAP_ID 5
|
||||
#define SGX_PDSPIXEL_CODEDATA_HEAP_ID 6
|
||||
#define SGX_PDSVERTEX_CODEDATA_HEAP_ID 7
|
||||
#define SGX_SYNCINFO_HEAP_ID 8
|
||||
#define SGX_SHARED_3DPARAMETERS_HEAP_ID 9
|
||||
#define SGX_PERCONTEXT_3DPARAMETERS_HEAP_ID 10
|
||||
#if defined(SUPPORT_SGX_GENERAL_MAPPING_HEAP)
|
||||
#define SGX_GENERAL_MAPPING_HEAP_ID 11
|
||||
#endif
|
||||
#if defined(SGX_FEATURE_2D_HARDWARE)
|
||||
#define SGX_2D_HEAP_ID 12
|
||||
#else
|
||||
#if defined(FIX_HW_BRN_26915)
|
||||
#define SGX_CGBUFFER_HEAP_ID 13
|
||||
#endif
|
||||
#endif
|
||||
#if defined(SUPPORT_MEMORY_TILING)
|
||||
#define SGX_VPB_TILED_HEAP_ID 14
|
||||
#endif
|
||||
|
||||
#define SGX_MAX_HEAP_ID 15
|
||||
|
||||
/*
|
||||
* Keep SGX_3DPARAMETERS_HEAP_ID as TQ full custom
|
||||
* shaders need it to select which heap to write
|
||||
* their ISP controll stream to.
|
||||
*/
|
||||
#if (defined(SUPPORT_PERCONTEXT_PB) || defined(SUPPORT_HYBRID_PB))
|
||||
#define SGX_3DPARAMETERS_HEAP_ID SGX_PERCONTEXT_3DPARAMETERS_HEAP_ID
|
||||
#else
|
||||
#define SGX_3DPARAMETERS_HEAP_ID SGX_SHARED_3DPARAMETERS_HEAP_ID
|
||||
#endif
|
||||
/* Define for number of bytes between consecutive code base registers */
|
||||
#if defined(SGX543) || defined(SGX544) || defined(SGX554)
|
||||
#define SGX_USE_CODE_SEGMENT_RANGE_BITS 23
|
||||
#else
|
||||
#define SGX_USE_CODE_SEGMENT_RANGE_BITS 19
|
||||
#endif
|
||||
|
||||
#define SGX_MAX_TA_STATUS_VALS 32
|
||||
#define SGX_MAX_3D_STATUS_VALS 4
|
||||
|
||||
#if defined(SUPPORT_SGX_GENERALISED_SYNCOBJECTS)
|
||||
/* sync info structure array size */
|
||||
#define SGX_MAX_TA_DST_SYNCS 1
|
||||
#define SGX_MAX_TA_SRC_SYNCS 1
|
||||
#define SGX_MAX_3D_SRC_SYNCS 4
|
||||
/* note: there is implicitly 1 3D Dst Sync */
|
||||
#else
|
||||
/* sync info structure array size */
|
||||
#define SGX_MAX_SRC_SYNCS 8
|
||||
#define SGX_MAX_DST_SYNCS 1
|
||||
/* note: there is implicitly 1 3D Dst Sync */
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(SGX_FEATURE_EXTENDED_PERF_COUNTERS)
|
||||
#define PVRSRV_SGX_HWPERF_NUM_COUNTERS 8
|
||||
#define PVRSRV_SGX_HWPERF_NUM_MISC_COUNTERS 11
|
||||
#else
|
||||
#define PVRSRV_SGX_HWPERF_NUM_COUNTERS 9
|
||||
#define PVRSRV_SGX_HWPERF_NUM_MISC_COUNTERS 8
|
||||
#endif /* SGX543 */
|
||||
|
||||
#define PVRSRV_SGX_HWPERF_INVALID 0x1
|
||||
|
||||
#define PVRSRV_SGX_HWPERF_TRANSFER 0x2
|
||||
#define PVRSRV_SGX_HWPERF_TA 0x3
|
||||
#define PVRSRV_SGX_HWPERF_3D 0x4
|
||||
#define PVRSRV_SGX_HWPERF_2D 0x5
|
||||
#define PVRSRV_SGX_HWPERF_POWER 0x6
|
||||
#define PVRSRV_SGX_HWPERF_PERIODIC 0x7
|
||||
#define PVRSRV_SGX_HWPERF_3DSPM 0x8
|
||||
|
||||
#define PVRSRV_SGX_HWPERF_MK_EVENT 0x101
|
||||
#define PVRSRV_SGX_HWPERF_MK_TA 0x102
|
||||
#define PVRSRV_SGX_HWPERF_MK_3D 0x103
|
||||
#define PVRSRV_SGX_HWPERF_MK_2D 0x104
|
||||
#define PVRSRV_SGX_HWPERF_MK_TRANSFER_DUMMY 0x105
|
||||
#define PVRSRV_SGX_HWPERF_MK_TA_DUMMY 0x106
|
||||
#define PVRSRV_SGX_HWPERF_MK_3D_DUMMY 0x107
|
||||
#define PVRSRV_SGX_HWPERF_MK_2D_DUMMY 0x108
|
||||
#define PVRSRV_SGX_HWPERF_MK_TA_LOCKUP 0x109
|
||||
#define PVRSRV_SGX_HWPERF_MK_3D_LOCKUP 0x10A
|
||||
#define PVRSRV_SGX_HWPERF_MK_2D_LOCKUP 0x10B
|
||||
|
||||
#define PVRSRV_SGX_HWPERF_TYPE_STARTEND_BIT 28
|
||||
#define PVRSRV_SGX_HWPERF_TYPE_OP_MASK ((1UL << PVRSRV_SGX_HWPERF_TYPE_STARTEND_BIT) - 1)
|
||||
#define PVRSRV_SGX_HWPERF_TYPE_OP_START (0UL << PVRSRV_SGX_HWPERF_TYPE_STARTEND_BIT)
|
||||
#define PVRSRV_SGX_HWPERF_TYPE_OP_END (1Ul << PVRSRV_SGX_HWPERF_TYPE_STARTEND_BIT)
|
||||
|
||||
#define PVRSRV_SGX_HWPERF_TYPE_TRANSFER_START (PVRSRV_SGX_HWPERF_TRANSFER | PVRSRV_SGX_HWPERF_TYPE_OP_START)
|
||||
#define PVRSRV_SGX_HWPERF_TYPE_TRANSFER_END (PVRSRV_SGX_HWPERF_TRANSFER | PVRSRV_SGX_HWPERF_TYPE_OP_END)
|
||||
#define PVRSRV_SGX_HWPERF_TYPE_TA_START (PVRSRV_SGX_HWPERF_TA | PVRSRV_SGX_HWPERF_TYPE_OP_START)
|
||||
#define PVRSRV_SGX_HWPERF_TYPE_TA_END (PVRSRV_SGX_HWPERF_TA | PVRSRV_SGX_HWPERF_TYPE_OP_END)
|
||||
#define PVRSRV_SGX_HWPERF_TYPE_3D_START (PVRSRV_SGX_HWPERF_3D | PVRSRV_SGX_HWPERF_TYPE_OP_START)
|
||||
#define PVRSRV_SGX_HWPERF_TYPE_3D_END (PVRSRV_SGX_HWPERF_3D | PVRSRV_SGX_HWPERF_TYPE_OP_END)
|
||||
#define PVRSRV_SGX_HWPERF_TYPE_2D_START (PVRSRV_SGX_HWPERF_2D | PVRSRV_SGX_HWPERF_TYPE_OP_START)
|
||||
#define PVRSRV_SGX_HWPERF_TYPE_2D_END (PVRSRV_SGX_HWPERF_2D | PVRSRV_SGX_HWPERF_TYPE_OP_END)
|
||||
#define PVRSRV_SGX_HWPERF_TYPE_POWER_START (PVRSRV_SGX_HWPERF_POWER | PVRSRV_SGX_HWPERF_TYPE_OP_START)
|
||||
#define PVRSRV_SGX_HWPERF_TYPE_POWER_END (PVRSRV_SGX_HWPERF_POWER | PVRSRV_SGX_HWPERF_TYPE_OP_END)
|
||||
#define PVRSRV_SGX_HWPERF_TYPE_PERIODIC (PVRSRV_SGX_HWPERF_PERIODIC)
|
||||
#define PVRSRV_SGX_HWPERF_TYPE_3DSPM_START (PVRSRV_SGX_HWPERF_3DSPM | PVRSRV_SGX_HWPERF_TYPE_OP_START)
|
||||
#define PVRSRV_SGX_HWPERF_TYPE_3DSPM_END (PVRSRV_SGX_HWPERF_3DSPM | PVRSRV_SGX_HWPERF_TYPE_OP_END)
|
||||
#define PVRSRV_SGX_HWPERF_TYPE_MK_TRANSFER_DUMMY_START (PVRSRV_SGX_HWPERF_MK_TRANSFER_DUMMY | PVRSRV_SGX_HWPERF_TYPE_OP_START)
|
||||
#define PVRSRV_SGX_HWPERF_TYPE_MK_TRANSFER_DUMMY_END (PVRSRV_SGX_HWPERF_MK_TRANSFER_DUMMY | PVRSRV_SGX_HWPERF_TYPE_OP_END)
|
||||
#define PVRSRV_SGX_HWPERF_TYPE_MK_TA_DUMMY_START (PVRSRV_SGX_HWPERF_MK_TA_DUMMY | PVRSRV_SGX_HWPERF_TYPE_OP_START)
|
||||
#define PVRSRV_SGX_HWPERF_TYPE_MK_TA_DUMMY_END (PVRSRV_SGX_HWPERF_MK_TA_DUMMY | PVRSRV_SGX_HWPERF_TYPE_OP_END)
|
||||
#define PVRSRV_SGX_HWPERF_TYPE_MK_3D_DUMMY_START (PVRSRV_SGX_HWPERF_MK_3D_DUMMY | PVRSRV_SGX_HWPERF_TYPE_OP_START)
|
||||
#define PVRSRV_SGX_HWPERF_TYPE_MK_3D_DUMMY_END (PVRSRV_SGX_HWPERF_MK_3D_DUMMY | PVRSRV_SGX_HWPERF_TYPE_OP_END)
|
||||
#define PVRSRV_SGX_HWPERF_TYPE_MK_2D_DUMMY_START (PVRSRV_SGX_HWPERF_MK_2D_DUMMY | PVRSRV_SGX_HWPERF_TYPE_OP_START)
|
||||
#define PVRSRV_SGX_HWPERF_TYPE_MK_2D_DUMMY_END (PVRSRV_SGX_HWPERF_MK_2D_DUMMY | PVRSRV_SGX_HWPERF_TYPE_OP_END)
|
||||
#define PVRSRV_SGX_HWPERF_TYPE_MK_TA_LOCKUP (PVRSRV_SGX_HWPERF_MK_TA_LOCKUP)
|
||||
#define PVRSRV_SGX_HWPERF_TYPE_MK_3D_LOCKUP (PVRSRV_SGX_HWPERF_MK_3D_LOCKUP)
|
||||
#define PVRSRV_SGX_HWPERF_TYPE_MK_2D_LOCKUP (PVRSRV_SGX_HWPERF_MK_2D_LOCKUP)
|
||||
|
||||
#define PVRSRV_SGX_HWPERF_TYPE_MK_EVENT_START (PVRSRV_SGX_HWPERF_MK_EVENT | PVRSRV_SGX_HWPERF_TYPE_OP_START)
|
||||
#define PVRSRV_SGX_HWPERF_TYPE_MK_EVENT_END (PVRSRV_SGX_HWPERF_MK_EVENT | PVRSRV_SGX_HWPERF_TYPE_OP_END)
|
||||
#define PVRSRV_SGX_HWPERF_TYPE_MK_TA_START (PVRSRV_SGX_HWPERF_MK_TA | PVRSRV_SGX_HWPERF_TYPE_OP_START)
|
||||
#define PVRSRV_SGX_HWPERF_TYPE_MK_TA_END (PVRSRV_SGX_HWPERF_MK_TA | PVRSRV_SGX_HWPERF_TYPE_OP_END)
|
||||
#define PVRSRV_SGX_HWPERF_TYPE_MK_3D_START (PVRSRV_SGX_HWPERF_MK_3D | PVRSRV_SGX_HWPERF_TYPE_OP_START)
|
||||
#define PVRSRV_SGX_HWPERF_TYPE_MK_3D_END (PVRSRV_SGX_HWPERF_MK_3D | PVRSRV_SGX_HWPERF_TYPE_OP_END)
|
||||
#define PVRSRV_SGX_HWPERF_TYPE_MK_2D_START (PVRSRV_SGX_HWPERF_MK_2D | PVRSRV_SGX_HWPERF_TYPE_OP_START)
|
||||
#define PVRSRV_SGX_HWPERF_TYPE_MK_2D_END (PVRSRV_SGX_HWPERF_MK_2D | PVRSRV_SGX_HWPERF_TYPE_OP_END)
|
||||
|
||||
#define PVRSRV_SGX_HWPERF_STATUS_OFF (0x0)
|
||||
#define PVRSRV_SGX_HWPERF_STATUS_RESET_COUNTERS (1UL << 0)
|
||||
#define PVRSRV_SGX_HWPERF_STATUS_GRAPHICS_ON (1UL << 1)
|
||||
#define PVRSRV_SGX_HWPERF_STATUS_PERIODIC_ON (1UL << 2)
|
||||
#define PVRSRV_SGX_HWPERF_STATUS_MK_EXECUTION_ON (1UL << 3)
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* One entry in the HWPerf Circular Buffer.
|
||||
*****************************************************************************/
|
||||
typedef struct _PVRSRV_SGX_HWPERF_CB_ENTRY_
|
||||
{
|
||||
IMG_UINT32 ui32FrameNo;
|
||||
IMG_UINT32 ui32PID;
|
||||
IMG_UINT32 ui32RTData;
|
||||
IMG_UINT32 ui32Type;
|
||||
IMG_UINT32 ui32Ordinal;
|
||||
IMG_UINT32 ui32Info;
|
||||
IMG_UINT32 ui32Clocksx16;
|
||||
/* NOTE: There should always be at least as many 3D cores as TA cores. */
|
||||
IMG_UINT32 ui32Counters[SGX_FEATURE_MP_CORE_COUNT_3D][PVRSRV_SGX_HWPERF_NUM_COUNTERS];
|
||||
IMG_UINT32 ui32MiscCounters[SGX_FEATURE_MP_CORE_COUNT_3D][PVRSRV_SGX_HWPERF_NUM_MISC_COUNTERS];
|
||||
} PVRSRV_SGX_HWPERF_CB_ENTRY;
|
||||
|
||||
|
||||
/*
|
||||
Status values control structure
|
||||
*/
|
||||
typedef struct _CTL_STATUS_
|
||||
{
|
||||
IMG_DEV_VIRTADDR sStatusDevAddr;
|
||||
IMG_UINT32 ui32StatusValue;
|
||||
} CTL_STATUS;
|
||||
|
||||
|
||||
/*!
|
||||
List of possible requests/commands to SGXGetMiscInfo()
|
||||
*/
|
||||
typedef enum _SGX_MISC_INFO_REQUEST_
|
||||
{
|
||||
SGX_MISC_INFO_REQUEST_CLOCKSPEED = 0,
|
||||
SGX_MISC_INFO_REQUEST_SGXREV,
|
||||
SGX_MISC_INFO_REQUEST_DRIVER_SGXREV,
|
||||
#if defined(SUPPORT_SGX_EDM_MEMORY_DEBUG)
|
||||
SGX_MISC_INFO_REQUEST_MEMREAD,
|
||||
SGX_MISC_INFO_REQUEST_MEMCOPY,
|
||||
#endif /* SUPPORT_SGX_EDM_MEMORY_DEBUG */
|
||||
SGX_MISC_INFO_REQUEST_SET_HWPERF_STATUS,
|
||||
#if defined(SGX_FEATURE_DATA_BREAKPOINTS)
|
||||
SGX_MISC_INFO_REQUEST_SET_BREAKPOINT,
|
||||
SGX_MISC_INFO_REQUEST_POLL_BREAKPOINT,
|
||||
SGX_MISC_INFO_REQUEST_RESUME_BREAKPOINT,
|
||||
#endif /* SGX_FEATURE_DATA_BREAKPOINTS */
|
||||
SGX_MISC_INFO_DUMP_DEBUG_INFO,
|
||||
SGX_MISC_INFO_PANIC,
|
||||
SGX_MISC_INFO_REQUEST_SPM,
|
||||
SGX_MISC_INFO_REQUEST_ACTIVEPOWER,
|
||||
SGX_MISC_INFO_REQUEST_LOCKUPS,
|
||||
SGX_MISC_INFO_REQUEST_FORCE_I16 = 0x7fff
|
||||
} SGX_MISC_INFO_REQUEST;
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* Struct for passing SGX core rev/features from ukernel to driver.
|
||||
* This is accessed from the kernel part of the driver and microkernel; it is
|
||||
* only accessed in user space during buffer allocation in srvinit.
|
||||
******************************************************************************/
|
||||
typedef struct _PVRSRV_SGX_MISCINFO_FEATURES
|
||||
{
|
||||
IMG_UINT32 ui32CoreRev; /*!< SGX Core revision from HW register */
|
||||
IMG_UINT32 ui32CoreID; /*!< SGX Core ID from HW register */
|
||||
IMG_UINT32 ui32DDKVersion; /*!< software DDK version */
|
||||
IMG_UINT32 ui32DDKBuild; /*!< software DDK build no. */
|
||||
IMG_UINT32 ui32CoreIdSW; /*!< software core version (ID), e.g. SGX535, SGX540 */
|
||||
IMG_UINT32 ui32CoreRevSW; /*!< software core revision */
|
||||
IMG_UINT32 ui32BuildOptions; /*!< build options bit-field */
|
||||
#if defined(SUPPORT_SGX_EDM_MEMORY_DEBUG)
|
||||
IMG_UINT32 ui32DeviceMemValue; /*!< device mem value read from ukernel */
|
||||
#endif
|
||||
#if defined(PVRSRV_USSE_EDM_STATUS_DEBUG)
|
||||
IMG_DEV_VIRTADDR sDevVAEDMStatusBuffer; /*!< DevVAddr of the EDM status buffer */
|
||||
IMG_PVOID pvEDMStatusBuffer; /*!< CPUVAddr of the EDM status buffer */
|
||||
#endif
|
||||
} PVRSRV_SGX_MISCINFO_FEATURES;
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* Struct for getting lock-up stats from the kernel driver
|
||||
******************************************************************************/
|
||||
typedef struct _PVRSRV_SGX_MISCINFO_LOCKUPS
|
||||
{
|
||||
IMG_UINT32 ui32HostDetectedLockups; /*!< Host timer detected lockups */
|
||||
IMG_UINT32 ui32uKernelDetectedLockups; /*!< Microkernel detected lockups */
|
||||
} PVRSRV_SGX_MISCINFO_LOCKUPS;
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* Struct for getting lock-up stats from the kernel driver
|
||||
******************************************************************************/
|
||||
typedef struct _PVRSRV_SGX_MISCINFO_ACTIVEPOWER
|
||||
{
|
||||
IMG_UINT32 ui32NumActivePowerEvents; /*!< active power events */
|
||||
} PVRSRV_SGX_MISCINFO_ACTIVEPOWER;
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* Struct for getting SPM stats fro the kernel driver
|
||||
******************************************************************************/
|
||||
typedef struct _PVRSRV_SGX_MISCINFO_SPM
|
||||
{
|
||||
IMG_HANDLE hRTDataSet; /*!< render target data set handle returned from SGXAddRenderTarget */
|
||||
IMG_UINT32 ui32NumOutOfMemSignals; /*!< Number of Out of Mem Signals */
|
||||
IMG_UINT32 ui32NumSPMRenders; /*!< Number of SPM renders */
|
||||
} PVRSRV_SGX_MISCINFO_SPM;
|
||||
|
||||
|
||||
#if defined(SGX_FEATURE_DATA_BREAKPOINTS)
|
||||
/*!
|
||||
******************************************************************************
|
||||
* Structure for SGX break points control
|
||||
*****************************************************************************/
|
||||
typedef struct _SGX_BREAKPOINT_INFO
|
||||
{
|
||||
/* set/clear BP boolean */
|
||||
IMG_BOOL bBPEnable;
|
||||
/* Index of BP to set */
|
||||
IMG_UINT32 ui32BPIndex;
|
||||
/* On which DataMaster(s) should the breakpoint fire? */
|
||||
IMG_UINT32 ui32DataMasterMask;
|
||||
/* DevVAddr of BP to set */
|
||||
IMG_DEV_VIRTADDR sBPDevVAddr, sBPDevVAddrEnd;
|
||||
/* Whether or not the desired breakpoint will be trapped */
|
||||
IMG_BOOL bTrapped;
|
||||
/* Will the requested breakpoint fire for reads? */
|
||||
IMG_BOOL bRead;
|
||||
/* Will the requested breakpoint fire for writes? */
|
||||
IMG_BOOL bWrite;
|
||||
/* Has a breakpoint been trapped? */
|
||||
IMG_BOOL bTrappedBP;
|
||||
/* Extra information recorded about a trapped breakpoint */
|
||||
IMG_UINT32 ui32CoreNum;
|
||||
IMG_DEV_VIRTADDR sTrappedBPDevVAddr;
|
||||
IMG_UINT32 ui32TrappedBPBurstLength;
|
||||
IMG_BOOL bTrappedBPRead;
|
||||
IMG_UINT32 ui32TrappedBPDataMaster;
|
||||
IMG_UINT32 ui32TrappedBPTag;
|
||||
} SGX_BREAKPOINT_INFO;
|
||||
#endif /* SGX_FEATURE_DATA_BREAKPOINTS */
|
||||
|
||||
|
||||
/*!
|
||||
******************************************************************************
|
||||
* Structure for setting the hardware performance status
|
||||
*****************************************************************************/
|
||||
typedef struct _PVRSRV_SGX_MISCINFO_SET_HWPERF_STATUS
|
||||
{
|
||||
/* See PVRSRV_SGX_HWPERF_STATUS_* */
|
||||
IMG_UINT32 ui32NewHWPerfStatus;
|
||||
|
||||
#if defined(SGX_FEATURE_EXTENDED_PERF_COUNTERS)
|
||||
/* Specifies the HW's active group selectors */
|
||||
IMG_UINT32 aui32PerfGroup[PVRSRV_SGX_HWPERF_NUM_COUNTERS];
|
||||
/* Specifies the HW's active bit selectors */
|
||||
IMG_UINT32 aui32PerfBit[PVRSRV_SGX_HWPERF_NUM_COUNTERS];
|
||||
#else
|
||||
/* Specifies the HW's active group */
|
||||
IMG_UINT32 ui32PerfGroup;
|
||||
#endif /* SGX_FEATURE_EXTENDED_PERF_COUNTERS */
|
||||
} PVRSRV_SGX_MISCINFO_SET_HWPERF_STATUS;
|
||||
|
||||
|
||||
/*!
|
||||
******************************************************************************
|
||||
* Structure for misc SGX commands in services
|
||||
*****************************************************************************/
|
||||
typedef struct _SGX_MISC_INFO_
|
||||
{
|
||||
SGX_MISC_INFO_REQUEST eRequest; /*!< Command request to SGXGetMiscInfo() */
|
||||
IMG_UINT32 ui32Padding;
|
||||
#if defined(SUPPORT_SGX_EDM_MEMORY_DEBUG)
|
||||
IMG_DEV_VIRTADDR sDevVAddrSrc; /*!< dev virtual addr for mem read */
|
||||
IMG_DEV_VIRTADDR sDevVAddrDest; /*!< dev virtual addr for mem write */
|
||||
IMG_HANDLE hDevMemContext; /*!< device memory context for mem debug */
|
||||
#endif
|
||||
union
|
||||
{
|
||||
IMG_UINT32 reserved; /*!< Unused: ensures valid code in the case everything else is compiled out */
|
||||
PVRSRV_SGX_MISCINFO_FEATURES sSGXFeatures;
|
||||
IMG_UINT32 ui32SGXClockSpeed;
|
||||
PVRSRV_SGX_MISCINFO_ACTIVEPOWER sActivePower;
|
||||
PVRSRV_SGX_MISCINFO_LOCKUPS sLockups;
|
||||
PVRSRV_SGX_MISCINFO_SPM sSPM;
|
||||
#if defined(SGX_FEATURE_DATA_BREAKPOINTS)
|
||||
SGX_BREAKPOINT_INFO sSGXBreakpointInfo;
|
||||
#endif
|
||||
PVRSRV_SGX_MISCINFO_SET_HWPERF_STATUS sSetHWPerfStatus;
|
||||
} uData;
|
||||
} SGX_MISC_INFO;
|
||||
|
||||
#if defined(SGX_FEATURE_2D_HARDWARE)
|
||||
/*
|
||||
* The largest number of source sync objects that can be associated with a blit
|
||||
* command. Allows for src, pattern, and mask
|
||||
*/
|
||||
#define PVRSRV_MAX_BLT_SRC_SYNCS 3
|
||||
#endif
|
||||
|
||||
|
||||
#define SGX_KICKTA_DUMPBITMAP_MAX_NAME_LENGTH 256
|
||||
|
||||
/*
|
||||
Structure for dumping bitmaps
|
||||
*/
|
||||
typedef struct _SGX_KICKTA_DUMPBITMAP_
|
||||
{
|
||||
IMG_DEV_VIRTADDR sDevBaseAddr;
|
||||
IMG_UINT32 ui32Flags;
|
||||
IMG_UINT32 ui32Width;
|
||||
IMG_UINT32 ui32Height;
|
||||
IMG_UINT32 ui32Stride;
|
||||
IMG_UINT32 ui32PDUMPFormat;
|
||||
IMG_UINT32 ui32BytesPP;
|
||||
IMG_CHAR pszName[SGX_KICKTA_DUMPBITMAP_MAX_NAME_LENGTH];
|
||||
} SGX_KICKTA_DUMPBITMAP, *PSGX_KICKTA_DUMPBITMAP;
|
||||
|
||||
#define PVRSRV_SGX_PDUMP_CONTEXT_MAX_BITMAP_ARRAY_SIZE (16)
|
||||
|
||||
/*!
|
||||
******************************************************************************
|
||||
* Data required only when dumping parameters
|
||||
*****************************************************************************/
|
||||
typedef struct _PVRSRV_SGX_PDUMP_CONTEXT_
|
||||
{
|
||||
/* cache control word for micro kernel cache flush/invalidates */
|
||||
IMG_UINT32 ui32CacheControl;
|
||||
|
||||
} PVRSRV_SGX_PDUMP_CONTEXT;
|
||||
|
||||
|
||||
#if !defined (SUPPORT_SID_INTERFACE)
|
||||
typedef struct _SGX_KICKTA_DUMP_ROFF_
|
||||
{
|
||||
IMG_HANDLE hKernelMemInfo; /*< Buffer handle */
|
||||
IMG_UINT32 uiAllocIndex; /*< Alloc index for LDDM */
|
||||
IMG_UINT32 ui32Offset; /*< Byte offset to value to dump */
|
||||
IMG_UINT32 ui32Value; /*< Actual value to dump */
|
||||
IMG_PCHAR pszName; /*< Name of buffer */
|
||||
} SGX_KICKTA_DUMP_ROFF, *PSGX_KICKTA_DUMP_ROFF;
|
||||
#endif
|
||||
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
typedef struct _SGX_KICKTA_DUMP_BUFFER_KM_
|
||||
#else
|
||||
typedef struct _SGX_KICKTA_DUMP_BUFFER_
|
||||
#endif
|
||||
{
|
||||
IMG_UINT32 ui32SpaceUsed;
|
||||
IMG_UINT32 ui32Start; /*< Byte offset of start to dump */
|
||||
IMG_UINT32 ui32End; /*< Byte offset of end of dump (non-inclusive) */
|
||||
IMG_UINT32 ui32BufferSize; /*< Size of buffer */
|
||||
IMG_UINT32 ui32BackEndLength; /*< Size of back end portion, if End < Start */
|
||||
IMG_UINT32 uiAllocIndex;
|
||||
IMG_HANDLE hKernelMemInfo; /*< MemInfo handle for the circular buffer */
|
||||
IMG_PVOID pvLinAddr;
|
||||
#if defined(SUPPORT_SGX_NEW_STATUS_VALS)
|
||||
IMG_HANDLE hCtrlKernelMemInfo; /*< MemInfo handle for the control structure of the
|
||||
circular buffer */
|
||||
IMG_DEV_VIRTADDR sCtrlDevVAddr; /*< Device virtual address of the memory in the
|
||||
control structure to be checked */
|
||||
#endif
|
||||
IMG_PCHAR pszName; /*< Name of buffer */
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
} SGX_KICKTA_DUMP_BUFFER_KM, *PSGX_KICKTA_DUMP_BUFFER_KM;
|
||||
#else
|
||||
} SGX_KICKTA_DUMP_BUFFER, *PSGX_KICKTA_DUMP_BUFFER;
|
||||
#endif
|
||||
|
||||
#if !defined (SUPPORT_SID_INTERFACE)
|
||||
#ifdef PDUMP
|
||||
/*
|
||||
PDUMP version of above kick structure
|
||||
*/
|
||||
typedef struct _SGX_KICKTA_PDUMP_
|
||||
{
|
||||
// Bitmaps to dump
|
||||
PSGX_KICKTA_DUMPBITMAP psPDumpBitmapArray;
|
||||
IMG_UINT32 ui32PDumpBitmapSize;
|
||||
|
||||
// Misc buffers to dump (e.g. TA, PDS etc..)
|
||||
PSGX_KICKTA_DUMP_BUFFER psBufferArray;
|
||||
IMG_UINT32 ui32BufferArraySize;
|
||||
|
||||
// Roffs to dump
|
||||
PSGX_KICKTA_DUMP_ROFF psROffArray;
|
||||
IMG_UINT32 ui32ROffArraySize;
|
||||
} SGX_KICKTA_PDUMP, *PSGX_KICKTA_PDUMP;
|
||||
#endif /* PDUMP */
|
||||
#endif /* #if !defined (SUPPORT_SID_INTERFACE) */
|
||||
|
||||
#if defined(TRANSFER_QUEUE)
|
||||
#if defined(SGX_FEATURE_2D_HARDWARE)
|
||||
/* Maximum size of ctrl stream for 2d blit command (in 32 bit words) */
|
||||
#define SGX_MAX_2D_BLIT_CMD_SIZE 26
|
||||
#define SGX_MAX_2D_SRC_SYNC_OPS 3
|
||||
#endif
|
||||
#define SGX_MAX_TRANSFER_STATUS_VALS 2
|
||||
#define SGX_MAX_TRANSFER_SYNC_OPS 5
|
||||
#endif
|
||||
|
||||
#if defined (__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __SGXAPI_KM_H__ */
|
||||
|
||||
/******************************************************************************
|
||||
End of file (sgxapi_km.h)
|
||||
******************************************************************************/
|
66
include/gpu_es4/eurasia/include4/sgxapiperf.h
Normal file
@ -0,0 +1,66 @@
|
||||
/*!****************************************************************************
|
||||
@File sgxapiperf.h
|
||||
|
||||
@Title SGX API Header (Performance profiling)
|
||||
|
||||
@Author Imagination Technologies
|
||||
|
||||
@Date 11/04/2007
|
||||
|
||||
@Copyright Copyright 2007 by Imagination Technologies Limited.
|
||||
All rights reserved. No part of this software, either material
|
||||
or conceptual may be copied or distributed, transmitted,
|
||||
transcribed, stored in a retrieval system or translated into
|
||||
any human or computer language in any form by any means,
|
||||
electronic, mechanical, manual or otherwise, or disclosed
|
||||
to third parties without the express written permission of
|
||||
Imagination Technologies Limited, Home Park Estate,
|
||||
Kings Langley, Hertfordshire, WD4 8LZ, U.K.
|
||||
|
||||
@Platform Cross platform / environment
|
||||
|
||||
@Description Exported SGX API details
|
||||
|
||||
@DoxygenVer
|
||||
|
||||
******************************************************************************/
|
||||
/******************************************************************************
|
||||
Modifications :-
|
||||
$Log: sgxapiperf.h $
|
||||
,
|
||||
--- Revision Logs Removed ---
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __SGXAPIPERF_H__
|
||||
#define __SGXAPIPERF_H__
|
||||
|
||||
#if defined (__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "services.h"
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
#include "sgxapi_km.h"
|
||||
#endif
|
||||
|
||||
/****************************************************************************/
|
||||
/* Performance registers */
|
||||
/****************************************************************************/
|
||||
|
||||
IMG_IMPORT
|
||||
PVRSRV_ERROR IMG_CALLCONV SGXReadHWPerfCB(PVRSRV_DEV_DATA *psDevData,
|
||||
IMG_UINT32 ui32ArraySize,
|
||||
PVRSRV_SGX_HWPERF_CB_ENTRY *psHWPerfCBData,
|
||||
IMG_UINT32 *pui32DataCount,
|
||||
IMG_UINT32 *pui32ClockSpeed,
|
||||
IMG_UINT32 *pui32HostTimeStamp);
|
||||
|
||||
#if defined (__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __SGXAPIPERF_H__ */
|
||||
|
||||
/******************************************************************************
|
||||
End of file (sgxapiperf.h)
|
||||
******************************************************************************/
|
159
include/gpu_es4/eurasia/include4/sgxformatconvert.h
Normal file
@ -0,0 +1,159 @@
|
||||
/*************************************************************************
|
||||
* Name : sgxformatconvert.h
|
||||
* Title : SGX hw definitions
|
||||
*
|
||||
* Copyright : 2005-2009 by Imagination Technologies Limited. All rights reserved.
|
||||
* : No part of this software, either material or conceptual
|
||||
* : may be copied or distributed, transmitted, transcribed,
|
||||
* : stored in a retrieval system or translated into any
|
||||
* : human or computer language in any form by any means,
|
||||
* : electronic, mechanical, manual or other-wise, or
|
||||
* : disclosed to third parties without the express written
|
||||
* : permission of Imagination Technologies Limited, Unit 8, HomePark
|
||||
* : Industrial Estate, King's Langley, Hertfordshire,
|
||||
* : WD4 8LZ, U.K.
|
||||
*
|
||||
* Platform : ANSI
|
||||
*
|
||||
* Modifications:-
|
||||
* $Log: sgxformatconvert.h $
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef _SGXFORMATCONVERT_H_
|
||||
#define _SGXFORMATCONVERT_H_
|
||||
|
||||
#ifdef INLINE_IS_PRAGMA
|
||||
#pragma inline(ConvertF16ToF32)
|
||||
#endif
|
||||
|
||||
FORCE_INLINE
|
||||
IMG_FLOAT ConvertF16ToF32(IMG_UINT32 ui32T1)
|
||||
/*****************************************************************************
|
||||
FUNCTION : ConvertF32ToF16
|
||||
|
||||
PURPOSE : Convert from FLOAT16 to FLOAT32.
|
||||
|
||||
PARAMETERS : ui32T1 - F16 value to convert.
|
||||
|
||||
RETURNS : Equivalent F32 value.
|
||||
*****************************************************************************/
|
||||
{
|
||||
IMG_UINT32 ui32Sign, ui32Exp, ui32Man;
|
||||
IMG_UINT32 ui32T2;
|
||||
|
||||
ui32Sign = (ui32T1 & 0x8000) >> 15;
|
||||
ui32Man = ((ui32T1 & 0x03FF) >> 0);
|
||||
ui32Exp = ((ui32T1 & 0x7C00) >> 10) + 127 - 15;
|
||||
|
||||
if (ui32Exp == 112)
|
||||
{
|
||||
if (ui32Man != 0)
|
||||
{
|
||||
ui32Exp++;
|
||||
while ((ui32Man & (1 << 10)) == 0)
|
||||
{
|
||||
ui32Exp--;
|
||||
ui32Man <<= 1;
|
||||
}
|
||||
ui32Man &= ~(1UL << 10);
|
||||
}
|
||||
else
|
||||
{
|
||||
ui32Exp = 0;
|
||||
}
|
||||
}
|
||||
ui32T2 = (ui32Sign << 31) | ((ui32Exp & 0xFF) << 23) | (ui32Man << 13);
|
||||
return *(IMG_FLOAT *)&ui32T2;
|
||||
}
|
||||
|
||||
#ifdef INLINE_IS_PRAGMA
|
||||
#pragma inline(ConvertF32ToF16)
|
||||
#endif
|
||||
|
||||
FORCE_INLINE
|
||||
IMG_UINT16 ConvertF32ToF16(IMG_FLOAT fV)
|
||||
/*****************************************************************************
|
||||
FUNCTION : ConvertF32ToF16
|
||||
|
||||
PURPOSE : Convert from FLOAT32 to FLOAT16.
|
||||
|
||||
PARAMETERS : fV - F32 value to convert.
|
||||
|
||||
RETURNS : Equivalent F16 value.
|
||||
*****************************************************************************/
|
||||
{
|
||||
IMG_UINT16 ui16V;
|
||||
IMG_UINT32 ui32Exp;
|
||||
IMG_UINT32 ui32Man;
|
||||
|
||||
/* PRQA S 3341 1 */ /* test for exactly zero shortcut */
|
||||
if (fV == 0.0f)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Set up the F16 sign bit. */
|
||||
if (fV < 0)
|
||||
{
|
||||
ui16V = 0x8000;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui16V = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
Get the absolute value of the input.
|
||||
*/
|
||||
if (fV < 0)
|
||||
{
|
||||
fV = -fV;
|
||||
}
|
||||
|
||||
/*
|
||||
Clamp to the maximum representable F16 value.
|
||||
*/
|
||||
/* 2^15 * (2 - 1/1024) = maximum f16 value. */
|
||||
if (fV > 131008)
|
||||
{
|
||||
fV = 131008;
|
||||
}
|
||||
|
||||
ui32Exp = ((*((IMG_PUINT32)&fV)) >> 23) - 127 + 15;
|
||||
ui32Man = (*((IMG_PUINT32)&fV)) & ((1 << 23) - 1);
|
||||
/* Check for making an F16 denorm. */
|
||||
if ((IMG_INT32)ui32Exp <= 0)
|
||||
{
|
||||
IMG_UINT32 ui32Shift;
|
||||
|
||||
ui32Man |= (1 << 23);
|
||||
|
||||
ui32Exp = ((*((IMG_UINT32 *)&fV)) >> 23);
|
||||
|
||||
ui32Shift = -14 + 127 - ui32Exp;
|
||||
|
||||
if (ui32Shift < 24)
|
||||
{
|
||||
ui32Man >>= ui32Shift;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui32Man = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ui16V |= (IMG_UINT16)((ui32Exp << 10) & 0x7C00);
|
||||
}
|
||||
ui16V |= (IMG_UINT16)(((ui32Man >> 13) << 0) & 0x03FF);
|
||||
/* Round to nearest. */
|
||||
if (ui32Man & (1 << 12))
|
||||
{
|
||||
ui16V++;
|
||||
}
|
||||
return ui16V;
|
||||
}
|
||||
|
||||
#endif /* _SGXFORMATCONVERT_H_ */
|
||||
|
||||
/* EOF */
|
88
include/gpu_es4/eurasia/include4/sgxscript.h
Normal file
@ -0,0 +1,88 @@
|
||||
/*!****************************************************************************
|
||||
@File sgxscript.h
|
||||
|
||||
@Title sgx kernel services structues/functions
|
||||
|
||||
@Author Imagination Technologies
|
||||
|
||||
@date 02 / 11 / 07
|
||||
|
||||
@Copyright Copyright 2007 by Imagination Technologies Limited.
|
||||
All rights reserved. No part of this software, either
|
||||
material or conceptual may be copied or distributed,
|
||||
transmitted, transcribed, stored in a retrieval system
|
||||
or translated into any human or computer language in any
|
||||
form by any means, electronic, mechanical, manual or
|
||||
other-wise, or disclosed to third parties without the
|
||||
express written permission of Imagination Technologies
|
||||
Limited, Unit 8, HomePark Industrial Estate,
|
||||
King's Langley, Hertfordshire, WD4 8LZ, U.K.
|
||||
|
||||
@Platform Generic
|
||||
|
||||
@Description SGX initialisation script definitions.
|
||||
|
||||
@DoxygenVer
|
||||
|
||||
Modifications :-
|
||||
|
||||
$Log: sgxscript.h $
|
||||
*****************************************************************************/
|
||||
#ifndef __SGXSCRIPT_H__
|
||||
#define __SGXSCRIPT_H__
|
||||
|
||||
#if defined (__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define SGX_MAX_INIT_COMMANDS 64
|
||||
#define SGX_MAX_DEINIT_COMMANDS 16
|
||||
|
||||
typedef enum _SGX_INIT_OPERATION
|
||||
{
|
||||
SGX_INIT_OP_ILLEGAL = 0,
|
||||
SGX_INIT_OP_WRITE_HW_REG,
|
||||
#if defined(PDUMP)
|
||||
SGX_INIT_OP_PDUMP_HW_REG,
|
||||
#endif
|
||||
SGX_INIT_OP_HALT
|
||||
} SGX_INIT_OPERATION;
|
||||
|
||||
typedef union _SGX_INIT_COMMAND
|
||||
{
|
||||
SGX_INIT_OPERATION eOp;
|
||||
struct {
|
||||
SGX_INIT_OPERATION eOp;
|
||||
IMG_UINT32 ui32Offset;
|
||||
IMG_UINT32 ui32Value;
|
||||
} sWriteHWReg;
|
||||
#if defined(PDUMP)
|
||||
struct {
|
||||
SGX_INIT_OPERATION eOp;
|
||||
IMG_UINT32 ui32Offset;
|
||||
IMG_UINT32 ui32Value;
|
||||
} sPDumpHWReg;
|
||||
#endif
|
||||
#if defined(FIX_HW_BRN_22997) && defined(FIX_HW_BRN_23030) && defined(SGX_FEATURE_HOST_PORT)
|
||||
struct {
|
||||
SGX_INIT_OPERATION eOp;
|
||||
} sWorkaroundBRN22997;
|
||||
#endif
|
||||
} SGX_INIT_COMMAND;
|
||||
|
||||
typedef struct _SGX_INIT_SCRIPTS_
|
||||
{
|
||||
SGX_INIT_COMMAND asInitCommandsPart1[SGX_MAX_INIT_COMMANDS];
|
||||
SGX_INIT_COMMAND asInitCommandsPart2[SGX_MAX_INIT_COMMANDS];
|
||||
SGX_INIT_COMMAND asDeinitCommands[SGX_MAX_DEINIT_COMMANDS];
|
||||
} SGX_INIT_SCRIPTS;
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __SGXSCRIPT_H__ */
|
||||
|
||||
/*****************************************************************************
|
||||
End of file (sgxscript.h)
|
||||
*****************************************************************************/
|
2250
include/gpu_es4/eurasia/services4/include/pvr_bridge.h
Normal file
301
include/gpu_es4/eurasia/services4/include/pvrsrv_errors.h
Normal file
@ -0,0 +1,301 @@
|
||||
/*!****************************************************************************
|
||||
@File pvrsrv_errors.h
|
||||
|
||||
@Title error code to string translation utility
|
||||
|
||||
@Author Imagination Technologies
|
||||
|
||||
@date 01/11/2009
|
||||
|
||||
@Copyright Copyright 2008-2009 by Imagination Technologies Limited.
|
||||
All rights reserved. No part of this software, either
|
||||
material or conceptual may be copied or distributed,
|
||||
transmitted, transcribed, stored in a retrieval system
|
||||
or translated into any human or computer language in any
|
||||
form by any means, electronic, mechanical, manual or
|
||||
other-wise, or disclosed to third parties without the
|
||||
express written permission of Imagination Technologies
|
||||
Limited, Unit 8, HomePark Industrial Estate,
|
||||
King's Langley, Hertfordshire, WD4 8LZ, U.K.
|
||||
|
||||
@Platform cross platform / environment
|
||||
|
||||
@Description error code to string translation utility
|
||||
|
||||
@DoxygenVer
|
||||
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
Modifications :-
|
||||
|
||||
$Log: pvrsrv_errors.h $
|
||||
*****************************************************************************/
|
||||
|
||||
#if !defined (__PVRSRV_ERRORS_H__)
|
||||
#define __PVRSRV_ERRORS_H__
|
||||
|
||||
#if defined (__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
NOTE: TO BE INCLUDED ONLY ONCE IN THE UM AND KM SERVICES MODULES
|
||||
PROVIDES IMPLEMENTATIONS OF
|
||||
|
||||
MUST BE KEPT IN SYNC WITH SERVICESEXT.H
|
||||
|
||||
PVRSRVGetErrorString
|
||||
PVRSRVGetErrorStringKM
|
||||
Specifically, we have
|
||||
|
||||
resources.c:
|
||||
IMG_EXPORT
|
||||
const IMG_CHAR *PVRSRVGetErrorString(PVRSRV_ERROR eError)
|
||||
{
|
||||
#include "pvrsrv_errors.h"
|
||||
}
|
||||
|
||||
pvrsrv.c:
|
||||
IMG_EXPORT
|
||||
const IMG_CHAR *PVRSRVGetErrorStringKM(PVRSRV_ERROR eError)
|
||||
{
|
||||
#include "pvrsrv_errors.h"
|
||||
}
|
||||
*/
|
||||
switch (eError)
|
||||
{
|
||||
case PVRSRV_OK: return "No Errors";
|
||||
case PVRSRV_ERROR_OUT_OF_MEMORY: return "PVRSRV_ERROR_OUT_OF_MEMORY - Unable to allocate required memory";
|
||||
case PVRSRV_ERROR_TOO_FEW_BUFFERS: return "PVRSRV_ERROR_TOO_FEW_BUFFERS";
|
||||
case PVRSRV_ERROR_INVALID_PARAMS: return "PVRSRV_ERROR_INVALID_PARAMS";
|
||||
case PVRSRV_ERROR_INIT_FAILURE: return "PVRSRV_ERROR_INIT_FAILURE";
|
||||
case PVRSRV_ERROR_CANT_REGISTER_CALLBACK: return "PVRSRV_ERROR_CANT_REGISTER_CALLBACK";
|
||||
case PVRSRV_ERROR_INVALID_DEVICE: return "PVRSRV_ERROR_INVALID_DEVICE";
|
||||
case PVRSRV_ERROR_NOT_OWNER: return "PVRSRV_ERROR_NOT_OWNER";
|
||||
case PVRSRV_ERROR_BAD_MAPPING: return "PVRSRV_ERROR_BAD_MAPPING";
|
||||
case PVRSRV_ERROR_TIMEOUT: return "PVRSRV_ERROR_TIMEOUT";
|
||||
case PVRSRV_ERROR_FLIP_CHAIN_EXISTS: return "PVRSRV_ERROR_FLIP_CHAIN_EXISTS";
|
||||
case PVRSRV_ERROR_INVALID_SWAPINTERVAL: return "PVRSRV_ERROR_INVALID_SWAPINTERVAL";
|
||||
case PVRSRV_ERROR_SCENE_INVALID: return "PVRSRV_ERROR_SCENE_INVALID";
|
||||
case PVRSRV_ERROR_STREAM_ERROR: return "PVRSRV_ERROR_STREAM_ERROR";
|
||||
case PVRSRV_ERROR_FAILED_DEPENDENCIES: return "PVRSRV_ERROR_FAILED_DEPENDENCIES";
|
||||
case PVRSRV_ERROR_CMD_NOT_PROCESSED: return "PVRSRV_ERROR_CMD_NOT_PROCESSED";
|
||||
case PVRSRV_ERROR_CMD_TOO_BIG: return "PVRSRV_ERROR_CMD_TOO_BIG";
|
||||
case PVRSRV_ERROR_DEVICE_REGISTER_FAILED: return "PVRSRV_ERROR_DEVICE_REGISTER_FAILED";
|
||||
case PVRSRV_ERROR_TOOMANYBUFFERS: return "PVRSRV_ERROR_TOOMANYBUFFERS";
|
||||
case PVRSRV_ERROR_NOT_SUPPORTED: return "PVRSRV_ERROR_NOT_SUPPORTED - fix";
|
||||
case PVRSRV_ERROR_PROCESSING_BLOCKED: return "PVRSRV_ERROR_PROCESSING_BLOCKED";
|
||||
|
||||
case PVRSRV_ERROR_CANNOT_FLUSH_QUEUE: return "PVRSRV_ERROR_CANNOT_FLUSH_QUEUE";
|
||||
case PVRSRV_ERROR_CANNOT_GET_QUEUE_SPACE: return "PVRSRV_ERROR_CANNOT_GET_QUEUE_SPACE";
|
||||
case PVRSRV_ERROR_CANNOT_GET_RENDERDETAILS: return "PVRSRV_ERROR_CANNOT_GET_RENDERDETAILS";
|
||||
case PVRSRV_ERROR_RETRY: return "PVRSRV_ERROR_RETRY";
|
||||
|
||||
case PVRSRV_ERROR_DDK_VERSION_MISMATCH: return "PVRSRV_ERROR_DDK_VERSION_MISMATCH";
|
||||
case PVRSRV_ERROR_BUILD_MISMATCH: return "PVRSRV_ERROR_BUILD_MISMATCH";
|
||||
case PVRSRV_ERROR_CORE_REVISION_MISMATCH: return "PVRSRV_ERROR_CORE_REVISION_MISMATCH";
|
||||
|
||||
case PVRSRV_ERROR_UPLOAD_TOO_BIG: return "PVRSRV_ERROR_UPLOAD_TOO_BIG";
|
||||
|
||||
case PVRSRV_ERROR_INVALID_FLAGS: return "PVRSRV_ERROR_INVALID_FLAGS";
|
||||
case PVRSRV_ERROR_FAILED_TO_REGISTER_PROCESS: return "PVRSRV_ERROR_FAILED_TO_REGISTER_PROCESS";
|
||||
|
||||
case PVRSRV_ERROR_UNABLE_TO_LOAD_LIBRARY: return "PVRSRV_ERROR_UNABLE_TO_LOAD_LIBRARY";
|
||||
case PVRSRV_ERROR_UNABLE_GET_FUNC_ADDR: return "PVRSRV_ERROR_UNABLE_GET_FUNC_ADDR";
|
||||
case PVRSRV_ERROR_UNLOAD_LIBRARY_FAILED: return "PVRSRV_ERROR_UNLOAD_LIBRARY_FAILED";
|
||||
|
||||
case PVRSRV_ERROR_BRIDGE_CALL_FAILED: return "PVRSRV_ERROR_BRIDGE_CALL_FAILED";
|
||||
case PVRSRV_ERROR_IOCTL_CALL_FAILED: return "PVRSRV_ERROR_IOCTL_CALL_FAILED";
|
||||
|
||||
case PVRSRV_ERROR_MMU_CONTEXT_NOT_FOUND: return "PVRSRV_ERROR_MMU_CONTEXT_NOT_FOUND";
|
||||
case PVRSRV_ERROR_BUFFER_DEVICE_NOT_FOUND: return "PVRSRV_ERROR_BUFFER_DEVICE_NOT_FOUND";
|
||||
case PVRSRV_ERROR_BUFFER_DEVICE_ALREADY_PRESENT:return "PVRSRV_ERROR_BUFFER_DEVICE_ALREADY_PRESENT";
|
||||
|
||||
case PVRSRV_ERROR_PCI_DEVICE_NOT_FOUND: return "PVRSRV_ERROR_PCI_DEVICE_NOT_FOUND";
|
||||
case PVRSRV_ERROR_PCI_CALL_FAILED: return "PVRSRV_ERROR_PCI_CALL_FAILED";
|
||||
case PVRSRV_ERROR_PCI_REGION_TOO_SMALL: return "PVRSRV_ERROR_PCI_REGION_TOO_SMALL";
|
||||
case PVRSRV_ERROR_PCI_REGION_UNAVAILABLE: return "PVRSRV_ERROR_PCI_REGION_UNAVAILABLE";
|
||||
case PVRSRV_ERROR_BAD_REGION_SIZE_MISMATCH: return "PVRSRV_ERROR_BAD_REGION_SIZE_MISMATCH";
|
||||
|
||||
case PVRSRV_ERROR_REGISTER_BASE_NOT_SET: return "PVRSRV_ERROR_REGISTER_BASE_NOT_SET";
|
||||
|
||||
case PVRSRV_ERROR_BM_BAD_SHAREMEM_HANDLE: return "PVRSRV_ERROR_BM_BAD_SHAREMEM_HANDLE";
|
||||
|
||||
case PVRSRV_ERROR_FAILED_TO_ALLOC_USER_MEM: return "PVRSRV_ERROR_FAILED_TO_ALLOC_USER_MEM";
|
||||
case PVRSRV_ERROR_FAILED_TO_ALLOC_VP_MEMORY: return "PVRSRV_ERROR_FAILED_TO_ALLOC_VP_MEMORY";
|
||||
case PVRSRV_ERROR_FAILED_TO_MAP_SHARED_PBDESC: return "PVRSRV_ERROR_FAILED_TO_MAP_SHARED_PBDESC";
|
||||
case PVRSRV_ERROR_FAILED_TO_GET_PHYS_ADDR: return "PVRSRV_ERROR_FAILED_TO_GET_PHYS_ADDR";
|
||||
|
||||
case PVRSRV_ERROR_FAILED_TO_ALLOC_VIRT_MEMORY: return "PVRSRV_ERROR_FAILED_TO_ALLOC_VIRT_MEMORY";
|
||||
case PVRSRV_ERROR_FAILED_TO_COPY_VIRT_MEMORY: return "PVRSRV_ERROR_FAILED_TO_COPY_VIRT_MEMORY";
|
||||
|
||||
case PVRSRV_ERROR_FAILED_TO_ALLOC_PAGES: return "PVRSRV_ERROR_FAILED_TO_ALLOC_PAGES";
|
||||
case PVRSRV_ERROR_FAILED_TO_FREE_PAGES: return "PVRSRV_ERROR_FAILED_TO_FREE_PAGES";
|
||||
case PVRSRV_ERROR_FAILED_TO_COPY_PAGES: return "PVRSRV_ERROR_FAILED_TO_COPY_PAGES";
|
||||
case PVRSRV_ERROR_UNABLE_TO_LOCK_PAGES: return "PVRSRV_ERROR_UNABLE_TO_LOCK_PAGES";
|
||||
case PVRSRV_ERROR_UNABLE_TO_UNLOCK_PAGES: return "PVRSRV_ERROR_UNABLE_TO_UNLOCK_PAGES";
|
||||
case PVRSRV_ERROR_STILL_MAPPED: return "PVRSRV_ERROR_STILL_MAPPED";
|
||||
case PVRSRV_ERROR_MAPPING_NOT_FOUND: return "PVRSRV_ERROR_MAPPING_NOT_FOUND";
|
||||
case PVRSRV_ERROR_PHYS_ADDRESS_EXCEEDS_32BIT: return "PVRSRV_ERROR_PHYS_ADDRESS_EXCEEDS_32BIT";
|
||||
case PVRSRV_ERROR_FAILED_TO_MAP_PAGE_TABLE: return "PVRSRV_ERROR_FAILED_TO_MAP_PAGE_TABLE";
|
||||
|
||||
case PVRSRV_ERROR_INVALID_SEGMENT_BLOCK: return "PVRSRV_ERROR_INVALID_SEGMENT_BLOCK";
|
||||
case PVRSRV_ERROR_INVALID_SGXDEVDATA: return "PVRSRV_ERROR_INVALID_SGXDEVDATA";
|
||||
case PVRSRV_ERROR_INVALID_DEVINFO: return "PVRSRV_ERROR_INVALID_DEVINFO";
|
||||
case PVRSRV_ERROR_INVALID_MEMINFO: return "PVRSRV_ERROR_INVALID_MEMINFO";
|
||||
case PVRSRV_ERROR_INVALID_MISCINFO: return "PVRSRV_ERROR_INVALID_MISCINFO";
|
||||
case PVRSRV_ERROR_UNKNOWN_IOCTL: return "PVRSRV_ERROR_UNKNOWN_IOCTL";
|
||||
case PVRSRV_ERROR_INVALID_CONTEXT: return "PVRSRV_ERROR_INVALID_CONTEXT";
|
||||
case PVRSRV_ERROR_UNABLE_TO_DESTROY_CONTEXT: return "PVRSRV_ERROR_UNABLE_TO_DESTROY_CONTEXT";
|
||||
case PVRSRV_ERROR_INVALID_HEAP: return "PVRSRV_ERROR_INVALID_HEAP";
|
||||
case PVRSRV_ERROR_INVALID_KERNELINFO: return "PVRSRV_ERROR_INVALID_KERNELINFO";
|
||||
case PVRSRV_ERROR_UNKNOWN_POWER_STATE: return "PVRSRV_ERROR_UNKNOWN_POWER_STATE";
|
||||
case PVRSRV_ERROR_INVALID_HANDLE_TYPE: return "PVRSRV_ERROR_INVALID_HANDLE_TYPE";
|
||||
case PVRSRV_ERROR_INVALID_WRAP_TYPE: return "PVRSRV_ERROR_INVALID_WRAP_TYPE";
|
||||
case PVRSRV_ERROR_INVALID_PHYS_ADDR: return "PVRSRV_ERROR_INVALID_PHYS_ADDR";
|
||||
case PVRSRV_ERROR_INVALID_CPU_ADDR: return "PVRSRV_ERROR_INVALID_CPU_ADDR";
|
||||
case PVRSRV_ERROR_INVALID_HEAPINFO: return "PVRSRV_ERROR_INVALID_HEAPINFO";
|
||||
case PVRSRV_ERROR_INVALID_PERPROC: return "PVRSRV_ERROR_INVALID_PERPROC";
|
||||
case PVRSRV_ERROR_FAILED_TO_RETRIEVE_HEAPINFO: return "PVRSRV_ERROR_FAILED_TO_RETRIEVE_HEAPINFO";
|
||||
case PVRSRV_ERROR_INVALID_MAP_REQUEST: return "PVRSRV_ERROR_INVALID_MAP_REQUEST";
|
||||
case PVRSRV_ERROR_INVALID_UNMAP_REQUEST: return "PVRSRV_ERROR_INVALID_UNMAP_REQUEST";
|
||||
case PVRSRV_ERROR_UNABLE_TO_FIND_MAPPING_HEAP: return "PVRSRV_ERROR_UNABLE_TO_FIND_MAPPING_HEAP";
|
||||
case PVRSRV_ERROR_MAPPING_STILL_IN_USE: return "PVRSRV_ERROR_MAPPING_STILL_IN_USE";
|
||||
|
||||
case PVRSRV_ERROR_EXCEEDED_HW_LIMITS: return "PVRSRV_ERROR_EXCEEDED_HW_LIMITS";
|
||||
case PVRSRV_ERROR_NO_STAGING_BUFFER_ALLOCATED: return "PVRSRV_ERROR_NO_STAGING_BUFFER_ALLOCATED";
|
||||
|
||||
case PVRSRV_ERROR_UNABLE_TO_CREATE_PERPROC_AREA:return "PVRSRV_ERROR_UNABLE_TO_CREATE_PERPROC_AREA";
|
||||
case PVRSRV_ERROR_UNABLE_TO_CREATE_EVENT: return "PVRSRV_ERROR_UNABLE_TO_CREATE_EVENT";
|
||||
case PVRSRV_ERROR_UNABLE_TO_ENABLE_EVENT: return "PVRSRV_ERROR_UNABLE_TO_ENABLE_EVENT";
|
||||
case PVRSRV_ERROR_UNABLE_TO_REGISTER_EVENT: return "PVRSRV_ERROR_UNABLE_TO_REGISTER_EVENT";
|
||||
case PVRSRV_ERROR_UNABLE_TO_DESTROY_EVENT: return "PVRSRV_ERROR_UNABLE_TO_DESTROY_EVENT";
|
||||
case PVRSRV_ERROR_UNABLE_TO_CREATE_THREAD: return "PVRSRV_ERROR_UNABLE_TO_CREATE_THREAD";
|
||||
case PVRSRV_ERROR_UNABLE_TO_CLOSE_THREAD: return "PVRSRV_ERROR_UNABLE_TO_CLOSE_THREAD";
|
||||
case PVRSRV_ERROR_THREAD_READ_ERROR: return "PVRSRV_ERROR_THREAD_READ_ERROR";
|
||||
case PVRSRV_ERROR_UNABLE_TO_REGISTER_ISR_HANDLER:return "PVRSRV_ERROR_UNABLE_TO_REGISTER_ISR_HANDLER";
|
||||
case PVRSRV_ERROR_UNABLE_TO_INSTALL_ISR: return "PVRSRV_ERROR_UNABLE_TO_INSTALL_ISR";
|
||||
case PVRSRV_ERROR_UNABLE_TO_UNINSTALL_ISR: return "PVRSRV_ERROR_UNABLE_TO_UNINSTALL_ISR";
|
||||
case PVRSRV_ERROR_ISR_ALREADY_INSTALLED: return "PVRSRV_ERROR_ISR_ALREADY_INSTALLED";
|
||||
case PVRSRV_ERROR_ISR_NOT_INSTALLED: return "PVRSRV_ERROR_ISR_NOT_INSTALLED";
|
||||
case PVRSRV_ERROR_UNABLE_TO_INITIALISE_INTERRUPT:return "PVRSRV_ERROR_UNABLE_TO_INITIALISE_INTERRUPT";
|
||||
case PVRSRV_ERROR_UNABLE_TO_RETRIEVE_INFO: return "PVRSRV_ERROR_UNABLE_TO_RETRIEVE_INFO";
|
||||
case PVRSRV_ERROR_UNABLE_TO_DO_BACKWARDS_BLIT: return "PVRSRV_ERROR_UNABLE_TO_DO_BACKWARDS_BLIT";
|
||||
case PVRSRV_ERROR_UNABLE_TO_CLOSE_SERVICES: return "PVRSRV_ERROR_UNABLE_TO_CLOSE_SERVICES";
|
||||
case PVRSRV_ERROR_UNABLE_TO_REGISTER_CONTEXT: return "PVRSRV_ERROR_UNABLE_TO_REGISTER_CONTEXT";
|
||||
case PVRSRV_ERROR_UNABLE_TO_REGISTER_RESOURCE: return "PVRSRV_ERROR_UNABLE_TO_REGISTER_RESOURCE";
|
||||
|
||||
case PVRSRV_ERROR_INVALID_CCB_COMMAND: return "PVRSRV_ERROR_INVALID_CCB_COMMAND";
|
||||
|
||||
case PVRSRV_ERROR_UNABLE_TO_LOCK_RESOURCE: return "PVRSRV_ERROR_UNABLE_TO_LOCK_RESOURCE";
|
||||
case PVRSRV_ERROR_INVALID_LOCK_ID: return "PVRSRV_ERROR_INVALID_LOCK_ID";
|
||||
case PVRSRV_ERROR_RESOURCE_NOT_LOCKED: return "PVRSRV_ERROR_RESOURCE_NOT_LOCKED";
|
||||
|
||||
case PVRSRV_ERROR_FLIP_FAILED: return "PVRSRV_ERROR_FLIP_FAILED";
|
||||
case PVRSRV_ERROR_UNBLANK_DISPLAY_FAILED: return "PVRSRV_ERROR_UNBLANK_DISPLAY_FAILED";
|
||||
|
||||
case PVRSRV_ERROR_TIMEOUT_POLLING_FOR_VALUE: return "PVRSRV_ERROR_TIMEOUT_POLLING_FOR_VALUE";
|
||||
|
||||
case PVRSRV_ERROR_CREATE_RENDER_CONTEXT_FAILED: return "PVRSRV_ERROR_CREATE_RENDER_CONTEXT_FAILED";
|
||||
case PVRSRV_ERROR_UNKNOWN_PRIMARY_FRAG: return "PVRSRV_ERROR_UNKNOWN_PRIMARY_FRAG";
|
||||
case PVRSRV_ERROR_UNEXPECTED_SECONDARY_FRAG: return "PVRSRV_ERROR_UNEXPECTED_SECONDARY_FRAG";
|
||||
case PVRSRV_ERROR_UNEXPECTED_PRIMARY_FRAG: return "PVRSRV_ERROR_UNEXPECTED_PRIMARY_FRAG";
|
||||
|
||||
case PVRSRV_ERROR_UNABLE_TO_INSERT_FENCE_ID: return "PVRSRV_ERROR_UNABLE_TO_INSERT_FENCE_ID";
|
||||
|
||||
case PVRSRV_ERROR_BLIT_SETUP_FAILED: return "PVRSRV_ERROR_BLIT_SETUP_FAILED";
|
||||
|
||||
case PVRSRV_ERROR_PDUMP_NOT_AVAILABLE: return "PVRSRV_ERROR_PDUMP_NOT_AVAILABLE";
|
||||
case PVRSRV_ERROR_PDUMP_BUFFER_FULL: return "PVRSRV_ERROR_PDUMP_BUFFER_FULL";
|
||||
case PVRSRV_ERROR_PDUMP_BUF_OVERFLOW: return "PVRSRV_ERROR_PDUMP_BUF_OVERFLOW";
|
||||
case PVRSRV_ERROR_PDUMP_NOT_ACTIVE: return "PVRSRV_ERROR_PDUMP_NOT_ACTIVE";
|
||||
case PVRSRV_ERROR_INCOMPLETE_LINE_OVERLAPS_PAGES:return "PVRSRV_ERROR_INCOMPLETE_LINE_OVERLAPS_PAGES";
|
||||
|
||||
case PVRSRV_ERROR_MUTEX_DESTROY_FAILED: return "PVRSRV_ERROR_MUTEX_DESTROY_FAILED";
|
||||
case PVRSRV_ERROR_MUTEX_INTERRUPTIBLE_ERROR: return "PVRSRV_ERROR_MUTEX_INTERRUPTIBLE_ERROR";
|
||||
|
||||
case PVRSRV_ERROR_INSUFFICIENT_SCRIPT_SPACE: return "PVRSRV_ERROR_INSUFFICIENT_SCRIPT_SPACE";
|
||||
case PVRSRV_ERROR_INSUFFICIENT_SPACE_FOR_COMMAND:return "PVRSRV_ERROR_INSUFFICIENT_SPACE_FOR_COMMAND";
|
||||
|
||||
case PVRSRV_ERROR_PROCESS_NOT_INITIALISED: return "PVRSRV_ERROR_PROCESS_NOT_INITIALISED";
|
||||
case PVRSRV_ERROR_PROCESS_NOT_FOUND: return "PVRSRV_ERROR_PROCESS_NOT_FOUND";
|
||||
case PVRSRV_ERROR_SRV_CONNECT_FAILED: return "PVRSRV_ERROR_SRV_CONNECT_FAILED";
|
||||
case PVRSRV_ERROR_SRV_DISCONNECT_FAILED: return "PVRSRV_ERROR_SRV_DISCONNECT_FAILED";
|
||||
case PVRSRV_ERROR_DEINT_PHASE_FAILED: return "PVRSRV_ERROR_DEINT_PHASE_FAILED";
|
||||
case PVRSRV_ERROR_INIT2_PHASE_FAILED: return "PVRSRV_ERROR_INIT2_PHASE_FAILED";
|
||||
|
||||
case PVRSRV_ERROR_NO_DC_DEVICES_FOUND: return "PVRSRV_ERROR_NO_DC_DEVICES_FOUND";
|
||||
case PVRSRV_ERROR_UNABLE_TO_OPEN_DC_DEVICE: return "PVRSRV_ERROR_UNABLE_TO_OPEN_DC_DEVICE";
|
||||
case PVRSRV_ERROR_UNABLE_TO_REMOVE_DEVICE: return "PVRSRV_ERROR_UNABLE_TO_REMOVE_DEVICE";
|
||||
case PVRSRV_ERROR_NO_DEVICEDATA_FOUND: return "PVRSRV_ERROR_NO_DEVICEDATA_FOUND";
|
||||
case PVRSRV_ERROR_NO_DEVICENODE_FOUND: return "PVRSRV_ERROR_NO_DEVICENODE_FOUND";
|
||||
case PVRSRV_ERROR_NO_CLIENTNODE_FOUND: return "PVRSRV_ERROR_NO_CLIENTNODE_FOUND";
|
||||
case PVRSRV_ERROR_FAILED_TO_PROCESS_QUEUE: return "PVRSRV_ERROR_FAILED_TO_PROCESS_QUEUE";
|
||||
|
||||
case PVRSRV_ERROR_UNABLE_TO_INIT_TASK: return "PVRSRV_ERROR_UNABLE_TO_INIT_TASK";
|
||||
case PVRSRV_ERROR_UNABLE_TO_SCHEDULE_TASK: return "PVRSRV_ERROR_UNABLE_TO_SCHEDULE_TASK";
|
||||
case PVRSRV_ERROR_UNABLE_TO_KILL_TASK: return "PVRSRV_ERROR_UNABLE_TO_KILL_TASK";
|
||||
|
||||
case PVRSRV_ERROR_UNABLE_TO_ENABLE_TIMER: return "PVRSRV_ERROR_UNABLE_TO_ENABLE_TIMER";
|
||||
case PVRSRV_ERROR_UNABLE_TO_DISABLE_TIMER: return "PVRSRV_ERROR_UNABLE_TO_DISABLE_TIMER";
|
||||
case PVRSRV_ERROR_UNABLE_TO_REMOVE_TIMER: return "PVRSRV_ERROR_UNABLE_TO_REMOVE_TIMER";
|
||||
|
||||
case PVRSRV_ERROR_UNKNOWN_PIXEL_FORMAT: return "PVRSRV_ERROR_UNKNOWN_PIXEL_FORMAT";
|
||||
case PVRSRV_ERROR_UNKNOWN_SCRIPT_OPERATION: return "PVRSRV_ERROR_UNKNOWN_SCRIPT_OPERATION";
|
||||
|
||||
case PVRSRV_ERROR_HANDLE_INDEX_OUT_OF_RANGE: return "PVRSRV_ERROR_HANDLE_INDEX_OUT_OF_RANGE";
|
||||
case PVRSRV_ERROR_HANDLE_NOT_ALLOCATED: return "PVRSRV_ERROR_HANDLE_NOT_ALLOCATED";
|
||||
case PVRSRV_ERROR_HANDLE_TYPE_MISMATCH: return "PVRSRV_ERROR_HANDLE_TYPE_MISMATCH";
|
||||
case PVRSRV_ERROR_UNABLE_TO_ADD_HANDLE: return "PVRSRV_ERROR_UNABLE_TO_ADD_HANDLE";
|
||||
case PVRSRV_ERROR_HANDLE_NOT_SHAREABLE: return "PVRSRV_ERROR_HANDLE_NOT_SHAREABLE";
|
||||
case PVRSRV_ERROR_HANDLE_NOT_FOUND: return "PVRSRV_ERROR_HANDLE_NOT_FOUND";
|
||||
case PVRSRV_ERROR_INVALID_SUBHANDLE: return "PVRSRV_ERROR_INVALID_SUBHANDLE";
|
||||
case PVRSRV_ERROR_HANDLE_BATCH_IN_USE: return "PVRSRV_ERROR_HANDLE_BATCH_IN_USE";
|
||||
case PVRSRV_ERROR_HANDLE_BATCH_COMMIT_FAILURE: return "PVRSRV_ERROR_HANDLE_BATCH_COMMIT_FAILURE";
|
||||
|
||||
case PVRSRV_ERROR_UNABLE_TO_CREATE_HASH_TABLE: return "PVRSRV_ERROR_UNABLE_TO_CREATE_HASH_TABLE";
|
||||
case PVRSRV_ERROR_INSERT_HASH_TABLE_DATA_FAILED:return "PVRSRV_ERROR_INSERT_HASH_TABLE_DATA_FAILED";
|
||||
|
||||
case PVRSRV_ERROR_UNSUPPORTED_BACKING_STORE: return "PVRSRV_ERROR_UNSUPPORTED_BACKING_STORE";
|
||||
case PVRSRV_ERROR_UNABLE_TO_DESTROY_BM_HEAP: return "PVRSRV_ERROR_UNABLE_TO_DESTROY_BM_HEAP";
|
||||
|
||||
case PVRSRV_ERROR_UNKNOWN_INIT_SERVER_STATE: return "PVRSRV_ERROR_UNKNOWN_INIT_SERVER_STATE";
|
||||
|
||||
case PVRSRV_ERROR_NO_FREE_DEVICEIDS_AVALIABLE: return "PVRSRV_ERROR_NO_FREE_DEVICEIDS_AVALIABLE";
|
||||
case PVRSRV_ERROR_INVALID_DEVICEID: return "PVRSRV_ERROR_INVALID_DEVICEID";
|
||||
case PVRSRV_ERROR_DEVICEID_NOT_FOUND: return "PVRSRV_ERROR_DEVICEID_NOT_FOUND";
|
||||
|
||||
case PVRSRV_ERROR_MEMORY_TEST_FAILED: return "PVRSRV_ERROR_MEMORY_TEST_FAILED";
|
||||
case PVRSRV_ERROR_CPUPADDR_TEST_FAILED: return "PVRSRV_ERROR_CPUPADDR_TEST_FAILED";
|
||||
case PVRSRV_ERROR_COPY_TEST_FAILED: return "PVRSRV_ERROR_COPY_TEST_FAILED";
|
||||
|
||||
case PVRSRV_ERROR_SEMAPHORE_NOT_INITIALISED: return "PVRSRV_ERROR_SEMAPHORE_NOT_INITIALISED";
|
||||
|
||||
case PVRSRV_ERROR_UNABLE_TO_RELEASE_CLOCK: return "PVRSRV_ERROR_UNABLE_TO_RELEASE_CLOCK";
|
||||
case PVRSRV_ERROR_CLOCK_REQUEST_FAILED: return "PVRSRV_ERROR_CLOCK_REQUEST_FAILED";
|
||||
case PVRSRV_ERROR_DISABLE_CLOCK_FAILURE: return "PVRSRV_ERROR_DISABLE_CLOCK_FAILURE";
|
||||
case PVRSRV_ERROR_UNABLE_TO_SET_CLOCK_RATE: return "PVRSRV_ERROR_UNABLE_TO_SET_CLOCK_RATE";
|
||||
case PVRSRV_ERROR_UNABLE_TO_ROUND_CLOCK_RATE: return "PVRSRV_ERROR_UNABLE_TO_ROUND_CLOCK_RATE";
|
||||
case PVRSRV_ERROR_UNABLE_TO_ENABLE_CLOCK: return "PVRSRV_ERROR_UNABLE_TO_ENABLE_CLOCK";
|
||||
case PVRSRV_ERROR_UNABLE_TO_GET_CLOCK: return "PVRSRV_ERROR_UNABLE_TO_GET_CLOCK";
|
||||
case PVRSRV_ERROR_UNABLE_TO_GET_PARENT_CLOCK: return "PVRSRV_ERROR_UNABLE_TO_GET_PARENT_CLOCK";
|
||||
case PVRSRV_ERROR_UNABLE_TO_GET_SYSTEM_CLOCK: return "PVRSRV_ERROR_UNABLE_TO_GET_SYSTEM_CLOCK";
|
||||
|
||||
case PVRSRV_ERROR_UNKNOWN_SGL_ERROR: return "PVRSRV_ERROR_UNKNOWN_SGL_ERROR";
|
||||
case PVRSRV_ERROR_BAD_SYNC_STATE: return "PVRSRV_ERROR_BAD_SYNC_STATE";
|
||||
|
||||
case PVRSRV_ERROR_FORCE_I32: return "PVRSRV_ERROR_FORCE_I32";
|
||||
|
||||
default:
|
||||
return "Unknown PVRSRV error number";
|
||||
}
|
||||
|
||||
#if defined (__cplusplus)
|
||||
}
|
||||
#endif
|
||||
#endif /* __PVRSRV_ERRORS_H__ */
|
||||
|
||||
/*****************************************************************************
|
||||
End of file (pvrsrv_errors.h)
|
||||
*****************************************************************************/
|
534
include/gpu_es4/eurasia/services4/include/servicesint.h
Normal file
@ -0,0 +1,534 @@
|
||||
/*!****************************************************************************
|
||||
@File servicesint.h
|
||||
|
||||
@Title Services Internal Header
|
||||
|
||||
@Author Imagination Technologies
|
||||
|
||||
@date 01/11/2004
|
||||
|
||||
@Copyright Copyright 2003-2004 by Imagination Technologies Limited.
|
||||
All rights reserved. No part of this software, either
|
||||
material or conceptual may be copied or distributed,
|
||||
transmitted, transcribed, stored in a retrieval system
|
||||
or translated into any human or computer language in any
|
||||
form by any means, electronic, mechanical, manual or
|
||||
other-wise, or disclosed to third parties without the
|
||||
express written permission of Imagination Technologies
|
||||
Limited, Unit 8, HomePark Industrial Estate,
|
||||
King's Langley, Hertfordshire, WD4 8LZ, U.K.
|
||||
|
||||
@Platform cross platform / environment
|
||||
|
||||
@Description services internal details
|
||||
|
||||
@DoxygenVer
|
||||
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
Modifications :-
|
||||
|
||||
$Log: servicesint.h $
|
||||
*****************************************************************************/
|
||||
|
||||
#if !defined (__SERVICESINT_H__)
|
||||
#define __SERVICESINT_H__
|
||||
|
||||
#if defined (__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "services.h"
|
||||
#include "sysinfo.h"
|
||||
|
||||
#define HWREC_DEFAULT_TIMEOUT (500)
|
||||
|
||||
#define DRIVERNAME_MAXLENGTH (100)
|
||||
|
||||
/*
|
||||
helper macros:
|
||||
*/
|
||||
#define ALIGNSIZE(size, alignshift) (((size) + ((1UL << (alignshift))-1)) & ~((1UL << (alignshift))-1))
|
||||
|
||||
#ifndef MAX
|
||||
#define MAX(a,b) (((a) > (b)) ? (a) : (b))
|
||||
#endif
|
||||
#ifndef MIN
|
||||
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
|
||||
#endif
|
||||
|
||||
typedef enum _PVRSRV_MEMTYPE_
|
||||
{
|
||||
PVRSRV_MEMTYPE_UNKNOWN = 0,
|
||||
PVRSRV_MEMTYPE_DEVICE = 1,
|
||||
PVRSRV_MEMTYPE_DEVICECLASS = 2,
|
||||
PVRSRV_MEMTYPE_WRAPPED = 3,
|
||||
PVRSRV_MEMTYPE_MAPPED = 4,
|
||||
} PVRSRV_MEMTYPE;
|
||||
|
||||
/*
|
||||
Kernel Memory Information structure
|
||||
*/
|
||||
typedef struct _PVRSRV_KERNEL_MEM_INFO_
|
||||
{
|
||||
/* Kernel Mode CPU Virtual address */
|
||||
IMG_PVOID pvLinAddrKM;
|
||||
|
||||
/* Device Virtual Address */
|
||||
IMG_DEV_VIRTADDR sDevVAddr;
|
||||
|
||||
/* allocation flags */
|
||||
IMG_UINT32 ui32Flags;
|
||||
|
||||
/* Size of the allocated buffer in bytes */
|
||||
IMG_SIZE_T uAllocSize;
|
||||
|
||||
/* Internal implementation details. Do not use outside services code. */
|
||||
PVRSRV_MEMBLK sMemBlk;
|
||||
|
||||
/* Address of the backup buffer used in a save/restore of the surface */
|
||||
IMG_PVOID pvSysBackupBuffer;
|
||||
|
||||
/* refcount for allocation, wrapping and mapping */
|
||||
IMG_UINT32 ui32RefCount;
|
||||
|
||||
/* Set when free call ocured and a mapping was still open */
|
||||
IMG_BOOL bPendingFree;
|
||||
|
||||
|
||||
#if defined(SUPPORT_MEMINFO_IDS)
|
||||
#if !defined(USE_CODE)
|
||||
/* Globally unique "stamp" for allocation (not re-used until wrap) */
|
||||
IMG_UINT64 ui64Stamp;
|
||||
#else /* !defined(USE_CODE) */
|
||||
IMG_UINT32 dummy1;
|
||||
IMG_UINT32 dummy2;
|
||||
#endif /* !defined(USE_CODE) */
|
||||
#endif /* defined(SUPPORT_MEMINFO_IDS) */
|
||||
|
||||
/* ptr to associated kernel sync info - NULL if no sync */
|
||||
struct _PVRSRV_KERNEL_SYNC_INFO_ *psKernelSyncInfo;
|
||||
|
||||
PVRSRV_MEMTYPE memType;
|
||||
|
||||
/* Device Virtual Address Offsets for the YUV MM planes */
|
||||
IMG_UINT32 planeOffsets[PVRSRV_MAX_NUMBER_OF_MM_BUFFER_PLANES];
|
||||
|
||||
/*
|
||||
To activate the "share mem workaround", add PVRSRV_MEM_XPROC to
|
||||
the flags for the allocation. This will cause the "map" API to
|
||||
call use Alloc Device Mem but will share the underlying memory
|
||||
block and sync data. Note that this is a workaround for a bug
|
||||
exposed by a specific use-case on a particular platform. Do not
|
||||
use this functionality generally.
|
||||
*/
|
||||
struct {
|
||||
/* Record whether the workaround is active for this
|
||||
allocation. The rest of the fields in this struct are
|
||||
undefined unless this is true */
|
||||
IMG_BOOL bInUse;
|
||||
|
||||
/* Store the device cookie handle from the original
|
||||
allocation, as it is not present on the "Map" API. */
|
||||
IMG_HANDLE hDevCookieInt;
|
||||
|
||||
/* This is an index into a static array which store
|
||||
information about the underlying allocation */
|
||||
IMG_UINT32 ui32ShareIndex;
|
||||
|
||||
/* Original arguments as supplied to original
|
||||
"PVRSRVAllocDeviceMem" call, such that a new call to this
|
||||
function can be later constructed */
|
||||
IMG_UINT32 ui32OrigReqAttribs;
|
||||
IMG_UINT32 ui32OrigReqSize;
|
||||
IMG_UINT32 ui32OrigReqAlignment;
|
||||
} sShareMemWorkaround;
|
||||
} PVRSRV_KERNEL_MEM_INFO;
|
||||
|
||||
|
||||
/*
|
||||
Kernel Sync Info structure
|
||||
*/
|
||||
typedef struct _PVRSRV_KERNEL_SYNC_INFO_
|
||||
{
|
||||
/* kernel sync data */
|
||||
PVRSRV_SYNC_DATA *psSyncData;
|
||||
|
||||
/* Device accessible WriteOp Info */
|
||||
IMG_DEV_VIRTADDR sWriteOpsCompleteDevVAddr;
|
||||
|
||||
/* Device accessible ReadOp Info */
|
||||
IMG_DEV_VIRTADDR sReadOpsCompleteDevVAddr;
|
||||
|
||||
/* Device accessible ReadOp Info */
|
||||
IMG_DEV_VIRTADDR sReadOps2CompleteDevVAddr;
|
||||
|
||||
/* meminfo for sync data */
|
||||
PVRSRV_KERNEL_MEM_INFO *psSyncDataMemInfoKM;
|
||||
|
||||
/* Reference count for deferring destruction of syncinfo when it is shared */
|
||||
/* NB: This is only done for devicemem.c (alloc/map/wrap etc), and
|
||||
not (presently) for deviceclass memory */
|
||||
IMG_PVOID pvRefCount;
|
||||
|
||||
/* Resman cleanup, for those created with explicit API */
|
||||
IMG_HANDLE hResItem;
|
||||
|
||||
/* Unique ID of the sync object */
|
||||
IMG_UINT32 ui32UID;
|
||||
} PVRSRV_KERNEL_SYNC_INFO;
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* This is a device addressable version of a pvrsrv_sync_oject
|
||||
* - any hw cmd may have an unlimited number of these
|
||||
****************************************************************************/
|
||||
typedef struct _PVRSRV_DEVICE_SYNC_OBJECT_
|
||||
{
|
||||
/* KEEP THESE 6 VARIABLES TOGETHER FOR UKERNEL BLOCK LOAD */
|
||||
IMG_UINT32 ui32ReadOpsPendingVal;
|
||||
IMG_DEV_VIRTADDR sReadOpsCompleteDevVAddr;
|
||||
IMG_UINT32 ui32WriteOpsPendingVal;
|
||||
IMG_DEV_VIRTADDR sWriteOpsCompleteDevVAddr;
|
||||
IMG_UINT32 ui32ReadOps2PendingVal;
|
||||
IMG_DEV_VIRTADDR sReadOps2CompleteDevVAddr;
|
||||
} PVRSRV_DEVICE_SYNC_OBJECT;
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* encapsulates a single sync object
|
||||
* - any cmd may have an unlimited number of these
|
||||
****************************************************************************/
|
||||
typedef struct _PVRSRV_SYNC_OBJECT
|
||||
{
|
||||
PVRSRV_KERNEL_SYNC_INFO *psKernelSyncInfoKM;
|
||||
IMG_UINT32 ui32WriteOpsPending;
|
||||
IMG_UINT32 ui32ReadOpsPending;
|
||||
IMG_UINT32 ui32ReadOps2Pending;
|
||||
|
||||
}PVRSRV_SYNC_OBJECT, *PPVRSRV_SYNC_OBJECT;
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* The `one size fits all' generic command.
|
||||
****************************************************************************/
|
||||
typedef struct _PVRSRV_COMMAND
|
||||
{
|
||||
IMG_SIZE_T uCmdSize; /*!< total size of command */
|
||||
IMG_UINT32 ui32DevIndex; /*!< device type - 16bit enum (exported by system) */
|
||||
IMG_UINT32 CommandType; /*!< command type */
|
||||
IMG_UINT32 ui32DstSyncCount; /*!< number of dst sync objects */
|
||||
IMG_UINT32 ui32SrcSyncCount; /*!< number of src sync objects */
|
||||
PVRSRV_SYNC_OBJECT *psDstSync; /*!< dst sync ptr list, allocated on
|
||||
back of this structure, i.e. is resident in Q */
|
||||
PVRSRV_SYNC_OBJECT *psSrcSync; /*!< src sync ptr list, allocated on
|
||||
back of this structure, i.e. is resident in Q */
|
||||
IMG_SIZE_T uDataSize; /*!< Size of Cmd Data Packet
|
||||
- only required in terms of allocating Q space */
|
||||
IMG_UINT32 ui32ProcessID; /*!< Process ID for debugging */
|
||||
IMG_VOID *pvData; /*!< data to be passed to Cmd Handler function,
|
||||
allocated on back of this structure, i.e. is resident in Q */
|
||||
PFN_QUEUE_COMMAND_COMPLETE pfnCommandComplete; /*!< Command complete callback */
|
||||
IMG_HANDLE hCallbackData; /*!< Command complete callback data */
|
||||
}PVRSRV_COMMAND, *PPVRSRV_COMMAND;
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* Circular command buffer structure forming the queue of pending commands.
|
||||
*
|
||||
* Queues are implemented as circular comamnd buffers (CCBs).
|
||||
* The buffer is allocated as a specified size, plus the size of the largest supported command.
|
||||
* The extra size allows commands to be added without worrying about wrapping around at the end.
|
||||
*
|
||||
* Commands are added to the CCB by client processes and consumed within
|
||||
* kernel mode code running from within an L/MISR typically.
|
||||
*
|
||||
* The process of adding a command to a queue is as follows:-
|
||||
* - A `lock' is acquired to prevent other processes from adding commands to a queue
|
||||
* - Data representing the command to be executed, along with it's PVRSRV_SYNC_INFO
|
||||
* dependencies is written to the buffer representing the queue at the queues
|
||||
* current WriteOffset.
|
||||
* - The PVRSRV_SYNC_INFO that the command depends on are updated to reflect
|
||||
* the addition of the new command.
|
||||
* - The WriteOffset is incremented by the size of the command added.
|
||||
* - If the WriteOffset now lies beyound the declared buffer size, it is
|
||||
* reset to zero.
|
||||
* - The semaphore is released.
|
||||
*
|
||||
*****************************************************************************/
|
||||
typedef struct _PVRSRV_QUEUE_INFO_
|
||||
{
|
||||
IMG_VOID *pvLinQueueKM; /*!< Pointer to the command buffer in the kernel's
|
||||
address space */
|
||||
|
||||
IMG_VOID *pvLinQueueUM; /*!< Pointer to the command buffer in the user's
|
||||
address space */
|
||||
|
||||
volatile IMG_SIZE_T ui32ReadOffset; /*!< Index into the buffer at which commands are being
|
||||
consumed */
|
||||
|
||||
volatile IMG_SIZE_T ui32WriteOffset; /*!< Index into the buffer at which commands are being
|
||||
added */
|
||||
|
||||
IMG_UINT32 *pui32KickerAddrKM; /*!< kicker address in the kernel's
|
||||
address space*/
|
||||
|
||||
IMG_UINT32 *pui32KickerAddrUM; /*!< kicker address in the user's
|
||||
address space */
|
||||
|
||||
IMG_SIZE_T ui32QueueSize; /*!< Size in bytes of the buffer - excluding the safety allocation */
|
||||
|
||||
IMG_UINT32 ui32ProcessID; /*!< Process ID required by resource locking */
|
||||
|
||||
IMG_HANDLE hMemBlock[2];
|
||||
|
||||
struct _PVRSRV_QUEUE_INFO_ *psNextKM; /*!< The next queue in the system */
|
||||
}PVRSRV_QUEUE_INFO;
|
||||
|
||||
|
||||
typedef struct _PVRSRV_HEAP_INFO_KM_
|
||||
{
|
||||
IMG_UINT32 ui32HeapID;
|
||||
IMG_DEV_VIRTADDR sDevVAddrBase;
|
||||
|
||||
IMG_HANDLE hDevMemHeap;
|
||||
IMG_UINT32 ui32HeapByteSize;
|
||||
IMG_UINT32 ui32Attribs;
|
||||
IMG_UINT32 ui32XTileStride;
|
||||
}PVRSRV_HEAP_INFO_KM;
|
||||
|
||||
|
||||
/*
|
||||
Event Object information structure
|
||||
*/
|
||||
typedef struct _PVRSRV_EVENTOBJECT_KM_
|
||||
{
|
||||
/* globally unique name of the event object */
|
||||
IMG_CHAR szName[EVENTOBJNAME_MAXLENGTH];
|
||||
/* kernel specific handle for the event object */
|
||||
IMG_HANDLE hOSEventKM;
|
||||
|
||||
} PVRSRV_EVENTOBJECT_KM;
|
||||
|
||||
|
||||
/*!
|
||||
******************************************************************************
|
||||
* Structure to retrieve misc. information from services
|
||||
*****************************************************************************/
|
||||
typedef struct _PVRSRV_MISC_INFO_KM_
|
||||
{
|
||||
IMG_UINT32 ui32StateRequest; /*!< requested State Flags */
|
||||
IMG_UINT32 ui32StatePresent; /*!< Present/Valid State Flags */
|
||||
|
||||
/*!< SOC Timer register */
|
||||
IMG_VOID *pvSOCTimerRegisterKM;
|
||||
IMG_VOID *pvSOCTimerRegisterUM;
|
||||
IMG_HANDLE hSOCTimerRegisterOSMemHandle;
|
||||
IMG_HANDLE hSOCTimerRegisterMappingInfo;
|
||||
|
||||
/*!< SOC Clock Gating registers */
|
||||
IMG_VOID *pvSOCClockGateRegs;
|
||||
IMG_UINT32 ui32SOCClockGateRegsSize;
|
||||
|
||||
/* Memory Stats/DDK version string depending on ui32StateRequest flags */
|
||||
IMG_CHAR *pszMemoryStr;
|
||||
IMG_UINT32 ui32MemoryStrLen;
|
||||
|
||||
/* global event object */
|
||||
PVRSRV_EVENTOBJECT_KM sGlobalEventObject;//FIXME: should be private to services
|
||||
IMG_HANDLE hOSGlobalEvent;
|
||||
|
||||
/* Note: add misc. items as required */
|
||||
IMG_UINT32 aui32DDKVersion[4];
|
||||
|
||||
/*!< CPU cache flush controls: */
|
||||
struct
|
||||
{
|
||||
/*!< Defer the CPU cache op to the next HW op to be submitted (else flush now) */
|
||||
IMG_BOOL bDeferOp;
|
||||
|
||||
/*!< Type of cache operation to perform */
|
||||
PVRSRV_MISC_INFO_CPUCACHEOP_TYPE eCacheOpType;
|
||||
|
||||
/*!< Meminfo (or meminfo handle) to flush */
|
||||
PVRSRV_KERNEL_MEM_INFO *psKernelMemInfo;
|
||||
|
||||
/*!< Offset in MemInfo to start cache op */
|
||||
IMG_VOID *pvBaseVAddr;
|
||||
|
||||
/*!< Length of range to perform cache op */
|
||||
IMG_UINT32 ui32Length;
|
||||
} sCacheOpCtl;
|
||||
|
||||
/*!< Meminfo refcount controls: */
|
||||
struct
|
||||
{
|
||||
/*!< Meminfo (or meminfo handle) to get refcount for */
|
||||
PVRSRV_KERNEL_MEM_INFO *psKernelMemInfo;
|
||||
|
||||
/*!< Resulting refcount */
|
||||
IMG_UINT32 ui32RefCount;
|
||||
} sGetRefCountCtl;
|
||||
} PVRSRV_MISC_INFO_KM;
|
||||
|
||||
|
||||
/* insert command function pointer */
|
||||
typedef PVRSRV_ERROR (*PFN_INSERT_CMD) (PVRSRV_QUEUE_INFO*,
|
||||
PVRSRV_COMMAND**,
|
||||
IMG_UINT32,
|
||||
IMG_UINT16,
|
||||
IMG_UINT32,
|
||||
PVRSRV_KERNEL_SYNC_INFO*[],
|
||||
IMG_UINT32,
|
||||
PVRSRV_KERNEL_SYNC_INFO*[],
|
||||
IMG_UINT32);
|
||||
/* submit command function pointer */
|
||||
typedef PVRSRV_ERROR (*PFN_SUBMIT_CMD) (PVRSRV_QUEUE_INFO*, PVRSRV_COMMAND*, IMG_BOOL);
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
Device Class Structures
|
||||
***********************************************************************/
|
||||
|
||||
/*
|
||||
Generic Device Class Buffer
|
||||
- details common between DC and BC
|
||||
*/
|
||||
typedef struct PVRSRV_DEVICECLASS_BUFFER_TAG
|
||||
{
|
||||
PFN_GET_BUFFER_ADDR pfnGetBufferAddr;
|
||||
IMG_HANDLE hDevMemContext;
|
||||
IMG_HANDLE hExtDevice;
|
||||
IMG_HANDLE hExtBuffer;
|
||||
PVRSRV_KERNEL_SYNC_INFO *psKernelSyncInfo;
|
||||
IMG_UINT32 ui32MemMapRefCount;
|
||||
} PVRSRV_DEVICECLASS_BUFFER;
|
||||
|
||||
|
||||
/*
|
||||
Common Device Class client services information structure
|
||||
*/
|
||||
typedef struct PVRSRV_CLIENT_DEVICECLASS_INFO_TAG
|
||||
{
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hDeviceKM;
|
||||
#else
|
||||
IMG_HANDLE hDeviceKM;
|
||||
#endif
|
||||
IMG_HANDLE hServices;
|
||||
} PVRSRV_CLIENT_DEVICECLASS_INFO;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
PVRSRV_FREE_CALLBACK_ORIGIN_ALLOCATOR,
|
||||
PVRSRV_FREE_CALLBACK_ORIGIN_IMPORTER,
|
||||
PVRSRV_FREE_CALLBACK_ORIGIN_EXTERNAL,
|
||||
}
|
||||
PVRSRV_FREE_CALLBACK_ORIGIN;
|
||||
|
||||
|
||||
IMG_IMPORT
|
||||
PVRSRV_ERROR FreeMemCallBackCommon(PVRSRV_KERNEL_MEM_INFO *psMemInfo,
|
||||
IMG_UINT32 ui32Param,
|
||||
PVRSRV_FREE_CALLBACK_ORIGIN eCallbackOrigin);
|
||||
|
||||
|
||||
IMG_IMPORT
|
||||
PVRSRV_ERROR PVRSRVQueueCommand(IMG_HANDLE hQueueInfo,
|
||||
PVRSRV_COMMAND *psCommand);
|
||||
|
||||
|
||||
/*!
|
||||
* *****************************************************************************
|
||||
* @brief Allocates system memory on behalf of a userspace process that is
|
||||
* addressable by the kernel; suitable for mapping into the current
|
||||
* user space process; suitable for mapping into other userspace
|
||||
* processes and it is possible to entirely disassociate the system
|
||||
* memory from the current userspace process via a call to
|
||||
* PVRSRVDissociateSharedSysMemoryKM.
|
||||
*
|
||||
* @param psConnection
|
||||
* @param ui32Flags
|
||||
* @param ui32Size
|
||||
* @param ppsClientMemInfo
|
||||
*
|
||||
* @return PVRSRV_ERROR
|
||||
********************************************************************************/
|
||||
IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV
|
||||
PVRSRVAllocSharedSysMem(const PVRSRV_CONNECTION *psConnection,
|
||||
IMG_UINT32 ui32Flags,
|
||||
IMG_SIZE_T ui32Size,
|
||||
PVRSRV_CLIENT_MEM_INFO **ppsClientMemInfo);
|
||||
|
||||
/*!
|
||||
* *****************************************************************************
|
||||
* @brief Frees memory allocated via PVRSRVAllocSharedMemory (Note you must
|
||||
* be sure any additional kernel references you created have been
|
||||
* removed before freeing the memory)
|
||||
*
|
||||
* @param psConnection
|
||||
* @param psClientMemInfo
|
||||
*
|
||||
* @return PVRSRV_ERROR
|
||||
********************************************************************************/
|
||||
IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV
|
||||
PVRSRVFreeSharedSysMem(const PVRSRV_CONNECTION *psConnection,
|
||||
PVRSRV_CLIENT_MEM_INFO *psClientMemInfo);
|
||||
|
||||
/*!
|
||||
* *****************************************************************************
|
||||
* @brief Removes any userspace reference to the shared system memory, except
|
||||
* that the memory will remain registered with the services resource
|
||||
* manager so if the process dies/exits the actuall shared memory will
|
||||
* still be freed.
|
||||
* If you need to move ownership of shared memory from userspace
|
||||
* to kernel space then before unrefing a shared piece of memory you can
|
||||
* take a copy of psClientMemInfo->hKernelMemInfo; call
|
||||
* PVRSRVUnrefSharedSysMem; then use some mechanism (specialised bridge
|
||||
* function) to request that the kernel remove any resource manager
|
||||
* reference to the shared memory and assume responsaility for the meminfo
|
||||
* in one atomic operation. (Note to aid with such a kernel space bridge
|
||||
* function see PVRSRVDissociateSharedSysMemoryKM)
|
||||
*
|
||||
* @param psConnection
|
||||
* @param psClientMemInfo
|
||||
*
|
||||
* @return
|
||||
********************************************************************************/
|
||||
IMG_IMPORT PVRSRV_ERROR
|
||||
PVRSRVUnrefSharedSysMem(const PVRSRV_CONNECTION *psConnection,
|
||||
PVRSRV_CLIENT_MEM_INFO *psClientMemInfo);
|
||||
|
||||
/*!
|
||||
* *****************************************************************************
|
||||
* @brief For shared system or device memory that is owned by the kernel, you can
|
||||
* use this function to map the underlying memory into a client using a
|
||||
* handle for the KernelMemInfo.
|
||||
*
|
||||
* @param[in] psConnection
|
||||
* @param[in] hKernelMemInfo
|
||||
* @param[out] ppsClientMemInfo
|
||||
*
|
||||
* @return
|
||||
********************************************************************************/
|
||||
IMG_IMPORT PVRSRV_ERROR IMG_CALLCONV
|
||||
PVRSRVMapMemInfoMem(const PVRSRV_CONNECTION *psConnection,
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hKernelMemInfo,
|
||||
#else
|
||||
IMG_HANDLE hKernelMemInfo,
|
||||
#endif
|
||||
PVRSRV_CLIENT_MEM_INFO **ppsClientMemInfo);
|
||||
|
||||
|
||||
#if defined (__cplusplus)
|
||||
}
|
||||
#endif
|
||||
#endif /* __SERVICESINT_H__ */
|
||||
|
||||
/*****************************************************************************
|
||||
End of file (servicesint.h)
|
||||
*****************************************************************************/
|
816
include/gpu_es4/eurasia/services4/include/sgx_bridge.h
Normal file
@ -0,0 +1,816 @@
|
||||
/*!****************************************************************************
|
||||
@File sgx_bridge.h
|
||||
|
||||
@Title SGX Bridge Functionality
|
||||
|
||||
@Author Imagination Technologies
|
||||
|
||||
@date 8/6/2004
|
||||
|
||||
@Copyright Copyright 2003-2004 by Imagination Technologies Limited.
|
||||
All rights reserved. No part of this software, either
|
||||
material or conceptual may be copied or distributed,
|
||||
transmitted, transcribed, stored in a retrieval system
|
||||
or translated into any human or computer language in any
|
||||
form by any means, electronic, mechanical, manual or
|
||||
other-wise, or disclosed to third parties without the
|
||||
express written permission of Imagination Technologies
|
||||
Limited, Unit 8, HomePark Industrial Estate,
|
||||
King's Langley, Hertfordshire, WD4 8LZ, U.K.
|
||||
|
||||
@Platform generic
|
||||
|
||||
@Description Header for the sgx Brdige code
|
||||
|
||||
@DoxygenVer
|
||||
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
Modifications :-
|
||||
|
||||
$Log: sgx_bridge.h $
|
||||
*****************************************************************************/
|
||||
|
||||
#if !defined(__SGX_BRIDGE_H__)
|
||||
#define __SGX_BRIDGE_H__
|
||||
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
#include "sgxapi.h"
|
||||
#else
|
||||
#include "sgxapi_km.h"
|
||||
#endif
|
||||
#include "sgxinfo.h"
|
||||
#include "pvr_bridge.h"
|
||||
|
||||
#if defined (__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Bridge Cmd Ids
|
||||
*/
|
||||
|
||||
/* *REMEMBER* to update PVRSRV_BRIDGE_LAST_SGX_CMD if you add/remove a command!
|
||||
* Also you need to ensure all PVRSRV_BRIDGE_SGX_CMD_BASE+ offsets are sequential!
|
||||
*/
|
||||
|
||||
#define PVRSRV_BRIDGE_SGX_CMD_BASE (PVRSRV_BRIDGE_LAST_NON_DEVICE_CMD+1)
|
||||
#define PVRSRV_BRIDGE_SGX_GETCLIENTINFO PVRSRV_IOWR(PVRSRV_BRIDGE_SGX_CMD_BASE+0)
|
||||
#define PVRSRV_BRIDGE_SGX_RELEASECLIENTINFO PVRSRV_IOWR(PVRSRV_BRIDGE_SGX_CMD_BASE+1)
|
||||
#define PVRSRV_BRIDGE_SGX_GETINTERNALDEVINFO PVRSRV_IOWR(PVRSRV_BRIDGE_SGX_CMD_BASE+2)
|
||||
#define PVRSRV_BRIDGE_SGX_DOKICK PVRSRV_IOWR(PVRSRV_BRIDGE_SGX_CMD_BASE+3)
|
||||
#define PVRSRV_BRIDGE_SGX_GETPHYSPAGEADDR PVRSRV_IOWR(PVRSRV_BRIDGE_SGX_CMD_BASE+4)
|
||||
#define PVRSRV_BRIDGE_SGX_READREGISTRYDWORD PVRSRV_IOWR(PVRSRV_BRIDGE_SGX_CMD_BASE+5)
|
||||
|
||||
#define PVRSRV_BRIDGE_SGX_2DQUERYBLTSCOMPLETE PVRSRV_IOWR(PVRSRV_BRIDGE_SGX_CMD_BASE+9)
|
||||
|
||||
#if defined(TRANSFER_QUEUE)
|
||||
#define PVRSRV_BRIDGE_SGX_SUBMITTRANSFER PVRSRV_IOWR(PVRSRV_BRIDGE_SGX_CMD_BASE+13)
|
||||
#endif
|
||||
#define PVRSRV_BRIDGE_SGX_GETMISCINFO PVRSRV_IOWR(PVRSRV_BRIDGE_SGX_CMD_BASE+14)
|
||||
#define PVRSRV_BRIDGE_SGXINFO_FOR_SRVINIT PVRSRV_IOWR(PVRSRV_BRIDGE_SGX_CMD_BASE+15)
|
||||
#define PVRSRV_BRIDGE_SGX_DEVINITPART2 PVRSRV_IOWR(PVRSRV_BRIDGE_SGX_CMD_BASE+16)
|
||||
|
||||
#define PVRSRV_BRIDGE_SGX_FINDSHAREDPBDESC PVRSRV_IOWR(PVRSRV_BRIDGE_SGX_CMD_BASE+17)
|
||||
#define PVRSRV_BRIDGE_SGX_UNREFSHAREDPBDESC PVRSRV_IOWR(PVRSRV_BRIDGE_SGX_CMD_BASE+18)
|
||||
#define PVRSRV_BRIDGE_SGX_ADDSHAREDPBDESC PVRSRV_IOWR(PVRSRV_BRIDGE_SGX_CMD_BASE+19)
|
||||
#define PVRSRV_BRIDGE_SGX_REGISTER_HW_RENDER_CONTEXT PVRSRV_IOWR(PVRSRV_BRIDGE_SGX_CMD_BASE+20)
|
||||
#define PVRSRV_BRIDGE_SGX_FLUSH_HW_RENDER_TARGET PVRSRV_IOWR(PVRSRV_BRIDGE_SGX_CMD_BASE+21)
|
||||
#define PVRSRV_BRIDGE_SGX_UNREGISTER_HW_RENDER_CONTEXT PVRSRV_IOWR(PVRSRV_BRIDGE_SGX_CMD_BASE+22)
|
||||
#if defined(SGX_FEATURE_2D_HARDWARE)
|
||||
#define PVRSRV_BRIDGE_SGX_SUBMIT2D PVRSRV_IOWR(PVRSRV_BRIDGE_SGX_CMD_BASE+23)
|
||||
#define PVRSRV_BRIDGE_SGX_REGISTER_HW_2D_CONTEXT PVRSRV_IOWR(PVRSRV_BRIDGE_SGX_CMD_BASE+24)
|
||||
#define PVRSRV_BRIDGE_SGX_UNREGISTER_HW_2D_CONTEXT PVRSRV_IOWR(PVRSRV_BRIDGE_SGX_CMD_BASE+25)
|
||||
#endif
|
||||
#define PVRSRV_BRIDGE_SGX_REGISTER_HW_TRANSFER_CONTEXT PVRSRV_IOWR(PVRSRV_BRIDGE_SGX_CMD_BASE+26)
|
||||
#define PVRSRV_BRIDGE_SGX_UNREGISTER_HW_TRANSFER_CONTEXT PVRSRV_IOWR(PVRSRV_BRIDGE_SGX_CMD_BASE+27)
|
||||
|
||||
#define PVRSRV_BRIDGE_SGX_SCHEDULE_PROCESS_QUEUES PVRSRV_IOWR(PVRSRV_BRIDGE_SGX_CMD_BASE+28)
|
||||
|
||||
#define PVRSRV_BRIDGE_SGX_READ_HWPERF_CB PVRSRV_IOWR(PVRSRV_BRIDGE_SGX_CMD_BASE+29)
|
||||
#define PVRSRV_BRIDGE_SGX_SET_RENDER_CONTEXT_PRIORITY PVRSRV_IOWR(PVRSRV_BRIDGE_SGX_CMD_BASE+30)
|
||||
#define PVRSRV_BRIDGE_SGX_SET_TRANSFER_CONTEXT_PRIORITY PVRSRV_IOWR(PVRSRV_BRIDGE_SGX_CMD_BASE+31)
|
||||
|
||||
#if defined(PDUMP)
|
||||
#define PVRSRV_BRIDGE_SGX_PDUMP_BUFFER_ARRAY PVRSRV_IOWR(PVRSRV_BRIDGE_SGX_CMD_BASE+32)
|
||||
#define PVRSRV_BRIDGE_SGX_PDUMP_3D_SIGNATURE_REGISTERS PVRSRV_IOWR(PVRSRV_BRIDGE_SGX_CMD_BASE+33)
|
||||
#define PVRSRV_BRIDGE_SGX_PDUMP_COUNTER_REGISTERS PVRSRV_IOWR(PVRSRV_BRIDGE_SGX_CMD_BASE+34)
|
||||
#define PVRSRV_BRIDGE_SGX_PDUMP_TA_SIGNATURE_REGISTERS PVRSRV_IOWR(PVRSRV_BRIDGE_SGX_CMD_BASE+35)
|
||||
#define PVRSRV_BRIDGE_SGX_PDUMP_HWPERFCB PVRSRV_IOWR(PVRSRV_BRIDGE_SGX_CMD_BASE+36)
|
||||
#define PVRSRV_BRIDGE_SGX_PDUMP_SAVEMEM PVRSRV_IOWR(PVRSRV_BRIDGE_SGX_CMD_BASE+37)
|
||||
#endif
|
||||
|
||||
#if defined(__psp2__)
|
||||
#define PVRSRV_BRIDGE_SGX_SET_CONTEXT_PRIORITY PVRSRV_IOWR(PVRSRV_BRIDGE_SGX_CMD_BASE+37)
|
||||
#endif
|
||||
|
||||
|
||||
/* *REMEMBER* to update PVRSRV_BRIDGE_LAST_SGX_CMD if you add/remove a command!
|
||||
* You need to ensure all PVRSRV_BRIDGE_SGX_CMD_BASE+ offsets are sequential!
|
||||
*/
|
||||
#define PVRSRV_BRIDGE_LAST_SGX_CMD (PVRSRV_BRIDGE_SGX_CMD_BASE+37)
|
||||
|
||||
/*****************************************************************************
|
||||
* Input structures for IOCTL/DRVESC
|
||||
*****************************************************************************/
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* `bridge in' SGX Get Phys Page Addr
|
||||
*****************************************************************************/
|
||||
typedef struct PVRSRV_BRIDGE_IN_GETPHYSPAGEADDR
|
||||
{
|
||||
IMG_UINT32 ui32BridgeFlags; /* Must be first member of structure */
|
||||
IMG_HANDLE hDevMemHeap;
|
||||
IMG_DEV_VIRTADDR sDevVAddr;
|
||||
}PVRSRV_BRIDGE_IN_GETPHYSPAGEADDR;
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* `bridge out' SGX Get Phys Page Addr
|
||||
*****************************************************************************/
|
||||
typedef struct PVRSRV_BRIDGE_OUT_GETPHYSPAGEADDR
|
||||
{
|
||||
PVRSRV_ERROR eError;
|
||||
IMG_DEV_PHYADDR DevPAddr;
|
||||
IMG_CPU_PHYADDR CpuPAddr;
|
||||
}PVRSRV_BRIDGE_OUT_GETPHYSPAGEADDR;
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* `bridge in' set transfer context priority
|
||||
*****************************************************************************/
|
||||
typedef struct PVRSRV_BRIDGE_IN_SGX_SET_TRANSFER_CONTEXT_PRIORITY_TAG
|
||||
{
|
||||
IMG_UINT32 ui32BridgeFlags; /* Must be first member of structure */
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hDevCookie;
|
||||
IMG_SID hHWTransferContext;
|
||||
#else
|
||||
IMG_HANDLE hDevCookie;
|
||||
IMG_HANDLE hHWTransferContext;
|
||||
#endif
|
||||
IMG_UINT32 ui32Priority;
|
||||
IMG_UINT32 ui32OffsetOfPriorityField;
|
||||
}PVRSRV_BRIDGE_IN_SGX_SET_TRANSFER_CONTEXT_PRIORITY;
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* `bridge in' set render context priority
|
||||
*****************************************************************************/
|
||||
typedef struct PVRSRV_BRIDGE_IN_SGX_SET_RENDER_CONTEXT_PRIORITY_TAG
|
||||
{
|
||||
IMG_UINT32 ui32BridgeFlags; /* Must be first member of structure */
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hDevCookie;
|
||||
IMG_SID hHWRenderContext;
|
||||
#else
|
||||
IMG_HANDLE hDevCookie;
|
||||
IMG_HANDLE hHWRenderContext;
|
||||
#endif
|
||||
IMG_UINT32 ui32Priority;
|
||||
IMG_UINT32 ui32OffsetOfPriorityField;
|
||||
}PVRSRV_BRIDGE_IN_SGX_SET_RENDER_CONTEXT_PRIORITY;
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* `bridge in' Get Client Info
|
||||
*****************************************************************************/
|
||||
typedef struct PVRSRV_BRIDGE_IN_GETCLIENTINFO_TAG
|
||||
{
|
||||
IMG_UINT32 ui32BridgeFlags; /* Must be first member of structure */
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hDevCookie;
|
||||
#else
|
||||
IMG_HANDLE hDevCookie;
|
||||
#endif
|
||||
}PVRSRV_BRIDGE_IN_GETCLIENTINFO;
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* `bridge out' Get internal device info
|
||||
*****************************************************************************/
|
||||
typedef struct PVRSRV_BRIDGE_OUT_GETINTERNALDEVINFO_TAG
|
||||
{
|
||||
SGX_INTERNAL_DEVINFO sSGXInternalDevInfo;
|
||||
PVRSRV_ERROR eError;
|
||||
}PVRSRV_BRIDGE_OUT_GETINTERNALDEVINFO;
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* `bridge in' Get internal device info
|
||||
*****************************************************************************/
|
||||
typedef struct PVRSRV_BRIDGE_IN_GETINTERNALDEVINFO_TAG
|
||||
{
|
||||
IMG_UINT32 ui32BridgeFlags; /* Must be first member of structure */
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hDevCookie;
|
||||
#else
|
||||
IMG_HANDLE hDevCookie;
|
||||
#endif
|
||||
}PVRSRV_BRIDGE_IN_GETINTERNALDEVINFO;
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* `bridge out' Get Client Info
|
||||
*****************************************************************************/
|
||||
typedef struct PVRSRV_BRIDGE_OUT_GETCLIENTINFO_TAG
|
||||
{
|
||||
SGX_CLIENT_INFO sClientInfo;
|
||||
PVRSRV_ERROR eError;
|
||||
}PVRSRV_BRIDGE_OUT_GETCLIENTINFO;
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* `bridge in' Release Client Info
|
||||
*****************************************************************************/
|
||||
typedef struct PVRSRV_BRIDGE_IN_RELEASECLIENTINFO_TAG
|
||||
{
|
||||
IMG_UINT32 ui32BridgeFlags; /* Must be first member of structure */
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hDevCookie;
|
||||
#else
|
||||
IMG_HANDLE hDevCookie;
|
||||
#endif
|
||||
SGX_CLIENT_INFO sClientInfo;
|
||||
}PVRSRV_BRIDGE_IN_RELEASECLIENTINFO;
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* `bridge in' Pdump ISP mem Pol
|
||||
*****************************************************************************/
|
||||
typedef struct PVRSRV_BRIDGE_IN_ISPBREAKPOLL_TAG
|
||||
{
|
||||
IMG_UINT32 ui32BridgeFlags; /* Must be first member of structure */
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hDevCookie;
|
||||
#else
|
||||
IMG_HANDLE hDevCookie;
|
||||
#endif
|
||||
}PVRSRV_BRIDGE_IN_ISPBREAKPOLL;
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* `bridge in' KickTA
|
||||
*****************************************************************************/
|
||||
typedef struct PVRSRV_BRIDGE_IN_DOKICK_TAG
|
||||
{
|
||||
IMG_UINT32 ui32BridgeFlags; /* Must be first member of structure */
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hDevCookie;
|
||||
#else
|
||||
IMG_HANDLE hDevCookie;
|
||||
#endif
|
||||
SGX_CCB_KICK sCCBKick;
|
||||
}PVRSRV_BRIDGE_IN_DOKICK;
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* `bridge in' SGXScheduleProcessQueues
|
||||
*****************************************************************************/
|
||||
typedef struct PVRSRV_BRIDGE_IN_SGX_SCHEDULE_PROCESS_QUEUES_TAG
|
||||
{
|
||||
IMG_UINT32 ui32BridgeFlags; /* Must be first member of structure */
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hDevCookie;
|
||||
#else
|
||||
IMG_HANDLE hDevCookie;
|
||||
#endif
|
||||
}PVRSRV_BRIDGE_IN_SGX_SCHEDULE_PROCESS_QUEUES;
|
||||
|
||||
|
||||
#if defined(TRANSFER_QUEUE)
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* `bridge in' SubmitTransfer
|
||||
*****************************************************************************/
|
||||
typedef struct PVRSRV_BRIDGE_IN_SUBMITTRANSFER_TAG
|
||||
{
|
||||
IMG_UINT32 ui32BridgeFlags; /* Must be first member of structure */
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hDevCookie;
|
||||
#else
|
||||
IMG_HANDLE hDevCookie;
|
||||
#endif
|
||||
PVRSRV_TRANSFER_SGX_KICK sKick;
|
||||
}PVRSRV_BRIDGE_IN_SUBMITTRANSFER;
|
||||
|
||||
#if defined(SGX_FEATURE_2D_HARDWARE)
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* `bridge in' Submit2D
|
||||
*****************************************************************************/
|
||||
typedef struct PVRSRV_BRIDGE_IN_SUBMIT2D_TAG
|
||||
{
|
||||
IMG_UINT32 ui32BridgeFlags; /* Must be first member of structure */
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hDevCookie;
|
||||
#else
|
||||
IMG_HANDLE hDevCookie;
|
||||
#endif
|
||||
PVRSRV_2D_SGX_KICK sKick;
|
||||
} PVRSRV_BRIDGE_IN_SUBMIT2D;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* `bridge in' ReadRegistryString
|
||||
*****************************************************************************/
|
||||
typedef struct PVRSRV_BRIDGE_IN_READREGDWORD_TAG
|
||||
{
|
||||
IMG_UINT32 ui32BridgeFlags; /* Must be first member of structure */
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hDevCookie;
|
||||
#else
|
||||
IMG_HANDLE hDevCookie;
|
||||
#endif
|
||||
IMG_PCHAR pszKey;
|
||||
IMG_PCHAR pszValue;
|
||||
}PVRSRV_BRIDGE_IN_READREGDWORD;
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* `bridge out' ReadRegistryString
|
||||
*****************************************************************************/
|
||||
typedef struct PVRSRV_BRIDGE_OUT_READREGDWORD_TAG
|
||||
{
|
||||
PVRSRV_ERROR eError;
|
||||
IMG_UINT32 ui32Data;
|
||||
}PVRSRV_BRIDGE_OUT_READREGDWORD;
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* `bridge in' SGXGetMiscInfo
|
||||
*****************************************************************************/
|
||||
typedef struct PVRSRV_BRIDGE_IN_SGXGETMISCINFO_TAG
|
||||
{
|
||||
IMG_UINT32 ui32BridgeFlags; /* Must be first member of structure */
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hDevCookie;
|
||||
#else
|
||||
IMG_HANDLE hDevCookie;
|
||||
#endif
|
||||
SGX_MISC_INFO *psMiscInfo;
|
||||
}PVRSRV_BRIDGE_IN_SGXGETMISCINFO;
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* `bridge in' SGXGetInfoForSrvInit
|
||||
*****************************************************************************/
|
||||
typedef struct PVRSRV_BRIDGE_IN_SGXINFO_FOR_SRVINIT_TAG
|
||||
{
|
||||
IMG_UINT32 ui32BridgeFlags; /* Must be first member of structure */
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hDevCookie;
|
||||
#else
|
||||
IMG_HANDLE hDevCookie;
|
||||
#endif
|
||||
}PVRSRV_BRIDGE_IN_SGXINFO_FOR_SRVINIT;
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* `bridge out' SGXGetInfoForSrvInit
|
||||
*****************************************************************************/
|
||||
typedef struct PVRSRV_BRIDGE_OUT_SGXINFO_FOR_SRVINIT_TAG
|
||||
{
|
||||
PVRSRV_ERROR eError;
|
||||
SGX_BRIDGE_INFO_FOR_SRVINIT sInitInfo;
|
||||
}PVRSRV_BRIDGE_OUT_SGXINFO_FOR_SRVINIT;
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* `bridge in' SGXDevInitPart2
|
||||
*****************************************************************************/
|
||||
typedef struct PVRSRV_BRIDGE_IN_SGXDEVINITPART2_TAG
|
||||
{
|
||||
IMG_UINT32 ui32BridgeFlags; /* Must be first member of structure */
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hDevCookie;
|
||||
#else
|
||||
IMG_HANDLE hDevCookie;
|
||||
#endif
|
||||
SGX_BRIDGE_INIT_INFO sInitInfo;
|
||||
}PVRSRV_BRIDGE_IN_SGXDEVINITPART2;
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* `bridge out' SGXDevInitPart2
|
||||
*****************************************************************************/
|
||||
typedef struct PVRSRV_BRIDGE_OUT_SGXDEVINITPART2_TAG
|
||||
{
|
||||
PVRSRV_ERROR eError;
|
||||
IMG_UINT32 ui32KMBuildOptions;
|
||||
|
||||
}PVRSRV_BRIDGE_OUT_SGXDEVINITPART2;
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* `bridge in' 2D query blits complete
|
||||
*****************************************************************************/
|
||||
#if defined(__psp2__)
|
||||
|
||||
typedef struct PVRSRV_BRIDGE_IN_2DQUERYBLTSCOMPLETE_TAG
|
||||
{
|
||||
IMG_UINT32 ui32BridgeFlags; /* Must be first member of structure */
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hDevCookie;
|
||||
PVRSRV_CLIENT_SYNC_INFO *psSyncInfo;
|
||||
#else
|
||||
IMG_HANDLE hDevCookie;
|
||||
IMG_HANDLE hKernSyncInfo;
|
||||
#endif
|
||||
IMG_BOOL bWaitForComplete;
|
||||
}PVRSRV_BRIDGE_IN_2DQUERYBLTSCOMPLETE;
|
||||
|
||||
#else
|
||||
|
||||
typedef struct PVRSRV_BRIDGE_IN_2DQUERYBLTSCOMPLETE_TAG
|
||||
{
|
||||
IMG_UINT32 ui32BridgeFlags; /* Must be first member of structure */
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hDevCookie;
|
||||
IMG_SID hKernSyncInfo;
|
||||
#else
|
||||
IMG_HANDLE hDevCookie;
|
||||
IMG_HANDLE hKernSyncInfo;
|
||||
#endif
|
||||
IMG_BOOL bWaitForComplete;
|
||||
}PVRSRV_BRIDGE_IN_2DQUERYBLTSCOMPLETE;
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#define PVRSRV_BRIDGE_SGX_SHAREDPBDESC_MAX_SUBMEMINFOS 10
|
||||
|
||||
typedef struct PVRSRV_BRIDGE_IN_SGXFINDSHAREDPBDESC_TAG
|
||||
{
|
||||
IMG_UINT32 ui32BridgeFlags; /* Must be first member of structure */
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hDevCookie;
|
||||
#else
|
||||
IMG_HANDLE hDevCookie;
|
||||
#endif
|
||||
IMG_BOOL bLockOnFailure;
|
||||
IMG_UINT32 ui32TotalPBSize;
|
||||
}PVRSRV_BRIDGE_IN_SGXFINDSHAREDPBDESC;
|
||||
|
||||
typedef struct PVRSRV_BRIDGE_OUT_SGXFINDSHAREDPBDESC_TAG
|
||||
{
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hKernelMemInfo;
|
||||
IMG_SID hSharedPBDesc;
|
||||
IMG_SID hSharedPBDescKernelMemInfoHandle;
|
||||
IMG_SID hHWPBDescKernelMemInfoHandle;
|
||||
IMG_SID hBlockKernelMemInfoHandle;
|
||||
IMG_SID hHWBlockKernelMemInfoHandle;
|
||||
IMG_SID ahSharedPBDescSubKernelMemInfoHandles[PVRSRV_BRIDGE_SGX_SHAREDPBDESC_MAX_SUBMEMINFOS];
|
||||
#else
|
||||
IMG_HANDLE hKernelMemInfo;
|
||||
IMG_HANDLE hSharedPBDesc;
|
||||
IMG_HANDLE hSharedPBDescKernelMemInfoHandle;
|
||||
IMG_HANDLE hHWPBDescKernelMemInfoHandle;
|
||||
IMG_HANDLE hBlockKernelMemInfoHandle;
|
||||
IMG_HANDLE hHWBlockKernelMemInfoHandle;
|
||||
IMG_HANDLE ahSharedPBDescSubKernelMemInfoHandles[PVRSRV_BRIDGE_SGX_SHAREDPBDESC_MAX_SUBMEMINFOS];
|
||||
#endif
|
||||
IMG_UINT32 ui32SharedPBDescSubKernelMemInfoHandlesCount;
|
||||
PVRSRV_ERROR eError;
|
||||
}PVRSRV_BRIDGE_OUT_SGXFINDSHAREDPBDESC;
|
||||
|
||||
typedef struct PVRSRV_BRIDGE_IN_SGXUNREFSHAREDPBDESC_TAG
|
||||
{
|
||||
IMG_UINT32 ui32BridgeFlags; /* Must be first member of structure */
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hSharedPBDesc;
|
||||
#else
|
||||
IMG_HANDLE hSharedPBDesc;
|
||||
#endif
|
||||
}PVRSRV_BRIDGE_IN_SGXUNREFSHAREDPBDESC;
|
||||
|
||||
typedef struct PVRSRV_BRIDGE_OUT_SGXUNREFSHAREDPBDESC_TAG
|
||||
{
|
||||
PVRSRV_ERROR eError;
|
||||
}PVRSRV_BRIDGE_OUT_SGXUNREFSHAREDPBDESC;
|
||||
|
||||
|
||||
typedef struct PVRSRV_BRIDGE_IN_SGXADDSHAREDPBDESC_TAG
|
||||
{
|
||||
IMG_UINT32 ui32BridgeFlags; /* Must be first member of structure */
|
||||
IMG_UINT32 ui32TotalPBSize;
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hDevCookie;
|
||||
IMG_SID hSharedPBDescKernelMemInfo;
|
||||
IMG_SID hHWPBDescKernelMemInfo;
|
||||
IMG_SID hBlockKernelMemInfo;
|
||||
IMG_SID hHWBlockKernelMemInfo;
|
||||
IMG_SID *phKernelMemInfoHandles;
|
||||
#else
|
||||
IMG_HANDLE hDevCookie;
|
||||
IMG_HANDLE hSharedPBDescKernelMemInfo;
|
||||
IMG_HANDLE hHWPBDescKernelMemInfo;
|
||||
IMG_HANDLE hBlockKernelMemInfo;
|
||||
IMG_HANDLE hHWBlockKernelMemInfo;
|
||||
IMG_HANDLE *phKernelMemInfoHandles;
|
||||
#endif
|
||||
IMG_UINT32 ui32KernelMemInfoHandlesCount;
|
||||
IMG_DEV_VIRTADDR sHWPBDescDevVAddr;
|
||||
}PVRSRV_BRIDGE_IN_SGXADDSHAREDPBDESC;
|
||||
|
||||
typedef struct PVRSRV_BRIDGE_OUT_SGXADDSHAREDPBDESC_TAG
|
||||
{
|
||||
PVRSRV_ERROR eError;
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hSharedPBDesc;
|
||||
#else
|
||||
IMG_HANDLE hSharedPBDesc;
|
||||
#endif
|
||||
}PVRSRV_BRIDGE_OUT_SGXADDSHAREDPBDESC;
|
||||
|
||||
|
||||
#ifdef PDUMP
|
||||
typedef struct PVRSRV_BRIDGE_IN_PDUMP_BUFFER_ARRAY_TAG
|
||||
{
|
||||
IMG_UINT32 ui32BridgeFlags; /* Must be first member of structure */
|
||||
SGX_KICKTA_DUMP_BUFFER *psBufferArray;
|
||||
IMG_UINT32 ui32BufferArrayLength;
|
||||
IMG_BOOL bDumpPolls;
|
||||
} PVRSRV_BRIDGE_IN_PDUMP_BUFFER_ARRAY;
|
||||
|
||||
typedef struct PVRSRV_BRIDGE_IN_PDUMP_3D_SIGNATURE_REGISTERS_TAG
|
||||
{
|
||||
IMG_UINT32 ui32BridgeFlags; /* Must be first member of structure */
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hDevCookie;
|
||||
IMG_SID hDevMemContext;
|
||||
#else
|
||||
IMG_HANDLE hDevCookie;
|
||||
IMG_HANDLE hDevMemContext;
|
||||
#endif
|
||||
IMG_UINT32 ui32DumpFrameNum;
|
||||
IMG_BOOL bLastFrame;
|
||||
IMG_UINT32 *pui32Registers;
|
||||
IMG_UINT32 ui32NumRegisters;
|
||||
}PVRSRV_BRIDGE_IN_PDUMP_3D_SIGNATURE_REGISTERS;
|
||||
|
||||
typedef struct PVRSRV_BRIDGE_IN_PDUMPCOUNTER_REGISTERS_TAG
|
||||
{
|
||||
IMG_UINT32 ui32BridgeFlags; /* Must be first member of structure */
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hDevCookie;
|
||||
#else
|
||||
IMG_HANDLE hDevCookie;
|
||||
#endif
|
||||
IMG_UINT32 ui32DumpFrameNum;
|
||||
IMG_BOOL bLastFrame;
|
||||
IMG_UINT32 *pui32Registers;
|
||||
IMG_UINT32 ui32NumRegisters;
|
||||
}PVRSRV_BRIDGE_IN_PDUMP_COUNTER_REGISTERS;
|
||||
|
||||
typedef struct PVRSRV_BRIDGE_IN_PDUMP_TA_SIGNATURE_REGISTERS_TAG
|
||||
{
|
||||
IMG_UINT32 ui32BridgeFlags; /* Must be first member of structure */
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hDevCookie;
|
||||
#else
|
||||
IMG_HANDLE hDevCookie;
|
||||
#endif
|
||||
IMG_UINT32 ui32DumpFrameNum;
|
||||
IMG_UINT32 ui32TAKickCount;
|
||||
IMG_BOOL bLastFrame;
|
||||
IMG_UINT32 *pui32Registers;
|
||||
IMG_UINT32 ui32NumRegisters;
|
||||
}PVRSRV_BRIDGE_IN_PDUMP_TA_SIGNATURE_REGISTERS;
|
||||
|
||||
typedef struct PVRSRV_BRIDGE_IN_PDUMP_HWPERFCB_TAG
|
||||
{
|
||||
IMG_UINT32 ui32BridgeFlags; /* Must be first member of structure */
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hDevCookie;
|
||||
IMG_SID hDevMemContext;
|
||||
#else
|
||||
IMG_HANDLE hDevCookie;
|
||||
IMG_HANDLE hDevMemContext;
|
||||
#endif
|
||||
IMG_CHAR szFileName[PVRSRV_PDUMP_MAX_FILENAME_SIZE];
|
||||
IMG_UINT32 ui32FileOffset;
|
||||
IMG_UINT32 ui32PDumpFlags;
|
||||
|
||||
}PVRSRV_BRIDGE_IN_PDUMP_HWPERFCB;
|
||||
|
||||
typedef struct PVRSRV_BRIDGE_IN_PDUMP_SAVEMEM
|
||||
{
|
||||
IMG_UINT32 ui32BridgeFlags; /* Must be first member of structure */
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hDevCookie;
|
||||
IMG_SID hDevMemContext;
|
||||
#else
|
||||
IMG_HANDLE hDevCookie;
|
||||
#endif
|
||||
IMG_CHAR szFileName[PVRSRV_PDUMP_MAX_FILENAME_SIZE];
|
||||
IMG_UINT32 ui32FileOffset;
|
||||
IMG_DEV_VIRTADDR sDevVAddr;
|
||||
IMG_UINT32 ui32Size;
|
||||
#if !defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_HANDLE hDevMemContext;
|
||||
#endif
|
||||
IMG_UINT32 ui32PDumpFlags;
|
||||
|
||||
}PVRSRV_BRIDGE_IN_PDUMP_SAVEMEM;
|
||||
|
||||
#endif
|
||||
|
||||
typedef struct PVRSRV_BRIDGE_IN_SGX_REGISTER_HW_RENDER_CONTEXT_TAG
|
||||
{
|
||||
IMG_UINT32 ui32BridgeFlags; /* Must be first member of structure */
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hDevCookie;
|
||||
#else
|
||||
IMG_HANDLE hDevCookie;
|
||||
#endif
|
||||
IMG_CPU_VIRTADDR pHWRenderContextCpuVAddr;
|
||||
IMG_UINT32 ui32HWRenderContextSize;
|
||||
IMG_UINT32 ui32OffsetToPDDevPAddr;
|
||||
IMG_HANDLE hDevMemContext;
|
||||
}PVRSRV_BRIDGE_IN_SGX_REGISTER_HW_RENDER_CONTEXT;
|
||||
|
||||
typedef struct PVRSRV_BRIDGE_OUT_SGX_REGISTER_HW_RENDER_CONTEXT_TAG
|
||||
{
|
||||
PVRSRV_ERROR eError;
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hHWRenderContext;
|
||||
#else
|
||||
IMG_HANDLE hHWRenderContext;
|
||||
#endif
|
||||
IMG_DEV_VIRTADDR sHWRenderContextDevVAddr;
|
||||
}PVRSRV_BRIDGE_OUT_SGX_REGISTER_HW_RENDER_CONTEXT;
|
||||
|
||||
typedef struct PVRSRV_BRIDGE_IN_SGX_UNREGISTER_HW_RENDER_CONTEXT_TAG
|
||||
{
|
||||
IMG_UINT32 ui32BridgeFlags; /* Must be first member of structure */
|
||||
IMG_BOOL bForceCleanup;
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hDevCookie;
|
||||
IMG_SID hHWRenderContext;
|
||||
#else
|
||||
IMG_HANDLE hDevCookie;
|
||||
IMG_HANDLE hHWRenderContext;
|
||||
#endif
|
||||
}PVRSRV_BRIDGE_IN_SGX_UNREGISTER_HW_RENDER_CONTEXT;
|
||||
|
||||
typedef struct PVRSRV_BRIDGE_IN_SGX_REGISTER_HW_TRANSFER_CONTEXT_TAG
|
||||
{
|
||||
IMG_UINT32 ui32BridgeFlags; /* Must be first member of structure */
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hDevCookie;
|
||||
#else
|
||||
IMG_HANDLE hDevCookie;
|
||||
#endif
|
||||
IMG_CPU_VIRTADDR pHWTransferContextCpuVAddr;
|
||||
IMG_UINT32 ui32HWTransferContextSize;
|
||||
IMG_UINT32 ui32OffsetToPDDevPAddr;
|
||||
IMG_HANDLE hDevMemContext;
|
||||
}PVRSRV_BRIDGE_IN_SGX_REGISTER_HW_TRANSFER_CONTEXT;
|
||||
|
||||
typedef struct PVRSRV_BRIDGE_OUT_SGX_REGISTER_HW_TRANSFER_CONTEXT_TAG
|
||||
{
|
||||
PVRSRV_ERROR eError;
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hHWTransferContext;
|
||||
#else
|
||||
IMG_HANDLE hHWTransferContext;
|
||||
#endif
|
||||
IMG_DEV_VIRTADDR sHWTransferContextDevVAddr;
|
||||
}PVRSRV_BRIDGE_OUT_SGX_REGISTER_HW_TRANSFER_CONTEXT;
|
||||
|
||||
typedef struct PVRSRV_BRIDGE_IN_SGX_UNREGISTER_HW_TRANSFER_CONTEXT_TAG
|
||||
{
|
||||
IMG_UINT32 ui32BridgeFlags; /* Must be first member of structure */
|
||||
IMG_BOOL bForceCleanup;
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hDevCookie;
|
||||
IMG_SID hHWTransferContext;
|
||||
#else
|
||||
IMG_HANDLE hDevCookie;
|
||||
IMG_HANDLE hHWTransferContext;
|
||||
#endif
|
||||
}PVRSRV_BRIDGE_IN_SGX_UNREGISTER_HW_TRANSFER_CONTEXT;
|
||||
|
||||
typedef struct PVRSRV_BRIDGE_IN_SGX_FLUSH_HW_RENDER_TARGET_TAG
|
||||
{
|
||||
IMG_UINT32 ui32BridgeFlags; /* Must be first member of structure */
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hDevCookie;
|
||||
#else
|
||||
IMG_HANDLE hDevCookie;
|
||||
#endif
|
||||
IMG_DEV_VIRTADDR sHWRTDataSetDevVAddr;
|
||||
}PVRSRV_BRIDGE_IN_SGX_FLUSH_HW_RENDER_TARGET;
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* SGX 2D specific defines
|
||||
*****************************************************************************/
|
||||
#if defined(SGX_FEATURE_2D_HARDWARE)
|
||||
typedef struct PVRSRV_BRIDGE_IN_SGX_REGISTER_HW_2D_CONTEXT_TAG
|
||||
{
|
||||
IMG_UINT32 ui32BridgeFlags; /* Must be first member of structure */
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hDevCookie;
|
||||
#else
|
||||
IMG_HANDLE hDevCookie;
|
||||
#endif
|
||||
IMG_CPU_VIRTADDR pHW2DContextCpuVAddr;
|
||||
IMG_UINT32 ui32HW2DContextSize;
|
||||
IMG_UINT32 ui32OffsetToPDDevPAddr;
|
||||
IMG_HANDLE hDevMemContext;
|
||||
}PVRSRV_BRIDGE_IN_SGX_REGISTER_HW_2D_CONTEXT;
|
||||
|
||||
typedef struct PVRSRV_BRIDGE_OUT_SGX_REGISTER_HW_2D_CONTEXT_TAG
|
||||
{
|
||||
PVRSRV_ERROR eError;
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hHW2DContext;
|
||||
#else
|
||||
IMG_HANDLE hHW2DContext;
|
||||
#endif
|
||||
IMG_DEV_VIRTADDR sHW2DContextDevVAddr;
|
||||
}PVRSRV_BRIDGE_OUT_SGX_REGISTER_HW_2D_CONTEXT;
|
||||
|
||||
typedef struct PVRSRV_BRIDGE_IN_SGX_UNREGISTER_HW_2D_CONTEXT_TAG
|
||||
{
|
||||
IMG_UINT32 ui32BridgeFlags; /* Must be first member of structure */
|
||||
IMG_BOOL bForceCleanup;
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hDevCookie;
|
||||
IMG_SID hHW2DContext;
|
||||
#else
|
||||
IMG_HANDLE hDevCookie;
|
||||
IMG_HANDLE hHW2DContext;
|
||||
#endif
|
||||
}PVRSRV_BRIDGE_IN_SGX_UNREGISTER_HW_2D_CONTEXT;
|
||||
|
||||
#define SGX2D_MAX_BLT_CMD_SIZ 256 /* Maximum size of a blit command, in bytes */
|
||||
#endif /* SGX_FEATURE_2D_HARDWARE */
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* `bridge in' SGXReadHWPerfCB
|
||||
*****************************************************************************/
|
||||
typedef struct PVRSRV_BRIDGE_IN_SGX_READ_HWPERF_CB_TAG
|
||||
{
|
||||
IMG_UINT32 ui32BridgeFlags; /* Must be first member of structure */
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hDevCookie;
|
||||
#else
|
||||
IMG_HANDLE hDevCookie;
|
||||
#endif
|
||||
IMG_UINT32 ui32ArraySize;
|
||||
PVRSRV_SGX_HWPERF_CB_ENTRY *psHWPerfCBData;
|
||||
} PVRSRV_BRIDGE_IN_SGX_READ_HWPERF_CB;
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* `bridge out' SGXReadHWPerfCB
|
||||
*****************************************************************************/
|
||||
typedef struct PVRSRV_BRIDGE_OUT_SGX_READ_HWPERF_CB_TAG
|
||||
{
|
||||
PVRSRV_ERROR eError;
|
||||
IMG_UINT32 ui32DataCount;
|
||||
IMG_UINT32 ui32ClockSpeed;
|
||||
IMG_UINT32 ui32HostTimeStamp;
|
||||
} PVRSRV_BRIDGE_OUT_SGX_READ_HWPERF_CB;
|
||||
|
||||
#if defined(__psp2__)
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* `bridge in' set context priority
|
||||
*****************************************************************************/
|
||||
typedef struct PVRSRV_BRIDGE_IN_SGX_SET_CONTEXT_PRIORITY_TAG
|
||||
{
|
||||
IMG_UINT32 ui32BridgeFlags; /* Must be first member of structure */
|
||||
IMG_HANDLE hRenderContext;
|
||||
SGX_CONTEXT_PRIORITY ePriority;
|
||||
}PVRSRV_BRIDGE_IN_SGX_SET_CONTEXT_PRIORITY;
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* `bridge out' set render context priority
|
||||
*****************************************************************************/
|
||||
typedef struct PVRSRV_BRIDGE_OUT_SGX_SET_CONTEXT_PRIORITY_TAG
|
||||
{
|
||||
PVRSRV_ERROR eError;
|
||||
SGX_CONTEXT_PRIORITY ePriority;
|
||||
}PVRSRV_BRIDGE_OUT_SGX_SET_CONTEXT_PRIORITY;
|
||||
#endif
|
||||
|
||||
#if defined (__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __SGX_BRIDGE_H__ */
|
||||
|
345
include/gpu_es4/eurasia/services4/include/sgx_bridge_um.h
Normal file
@ -0,0 +1,345 @@
|
||||
/*!****************************************************************************
|
||||
@File sgx_bridge_u.h
|
||||
|
||||
@Title SGX Bridge Functionality
|
||||
|
||||
@Author Imagination Technologies
|
||||
|
||||
@Date 3/12/2007
|
||||
|
||||
@Copyright Copyright 2007 by Imagination Technologies Limited.
|
||||
All rights reserved. No part of this software, either material
|
||||
or conceptual may be copied or distributed, transmitted,
|
||||
transcribed, stored in a retrieval system or translated into
|
||||
any human or computer language in any form by any means,
|
||||
electronic, mechanical, manual or other-wise, or disclosed
|
||||
to third parties without the express written permission of
|
||||
Imagination Technologies Limited, Home Park Estate,
|
||||
Kings Langley, Hertfordshire, WD4 8LZ, U.K.
|
||||
|
||||
@Platform Generic
|
||||
|
||||
@Description Header for the SGX Bridge code
|
||||
|
||||
Modifications :-
|
||||
$Log: sgx_bridge_um.h $
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __SGX_BRIDGE_UM_H__
|
||||
#define __SGX_BRIDGE_UM_H__
|
||||
|
||||
#if defined (__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*!
|
||||
* *****************************************************************************
|
||||
* @brief Performs a kernel kick
|
||||
*
|
||||
* @param psDevData
|
||||
* @param psCCBKick
|
||||
*
|
||||
* @return PVRSRV_ERROR
|
||||
********************************************************************************/
|
||||
|
||||
IMG_IMPORT PVRSRV_ERROR SGXDoKick(PVRSRV_DEV_DATA *psDevData,
|
||||
SGX_CCB_KICK *psCCBKick);
|
||||
|
||||
#if defined(TRANSFER_QUEUE)
|
||||
IMG_INTERNAL PVRSRV_ERROR SGXSubmitTransferBridge(const PVRSRV_DEV_DATA *psDevData, PVRSRV_TRANSFER_SGX_KICK *psKick);
|
||||
#if defined(SGX_FEATURE_2D_HARDWARE)
|
||||
IMG_INTERNAL PVRSRV_ERROR SGXSubmit2D(const PVRSRV_DEV_DATA *psDevData, PVRSRV_2D_SGX_KICK *psKick);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*!
|
||||
* *****************************************************************************
|
||||
* @brief Looks for a parameter buffer description that corresponds to
|
||||
* a buffer of size ui32TotalPBSize, optionally taking the lock
|
||||
* needed for SharedPBCreation on failure.
|
||||
*
|
||||
* Note if a PB Desc is found then its internal reference counter
|
||||
* is automatically incremented. It is your responsability to call
|
||||
* SGXUnrefSharedPBDesc to decrement this reference and free associated
|
||||
* userspace resources when you are done.
|
||||
*
|
||||
* This function returns an array of meminfo handles that are integral
|
||||
* to the shared PB desc (Those supplied via SGXAddSharedPBDesc). This
|
||||
* array is allocated via PVRSRVAllocUserModeMem and it is the callers
|
||||
* responsability to free this memory by calling PVRSRVFreeUserModeMem
|
||||
* when they have finished with the handles. (I.e. probably after
|
||||
* mapping them to userspace)
|
||||
*
|
||||
* If bLockOnFailure is set, and a suitable shared PB isn't found,
|
||||
* an internal flag is set, allowing this process to create a
|
||||
* shared PB. Any other process calling this function with
|
||||
* bLockOnFailure set, will receive the return code
|
||||
* PVRSRV_ERROR_PROCESSING_BLOCKED, indicating that it needs
|
||||
* to retry the function call. The internal flag is cleared
|
||||
* when this process creates a shared PB.
|
||||
*
|
||||
* @param[in] psDevData
|
||||
* @param[in] bLockOnFailure
|
||||
* @param[in] ui32TotalPBSize
|
||||
* @param[out] phSharedPBDesc
|
||||
* @param[out] phSharedPBDescKernelMemInfoHandle
|
||||
* @param[out] phHWPBDescKernelMemInfoHandle
|
||||
* @param[out] pphSharedPBDescSubKernelMemInfoHandles
|
||||
* @param[out] pui32SharedPBDescSubKernelMemInfoHandlesCount
|
||||
*
|
||||
* @return PVRSRV_ERROR
|
||||
********************************************************************************/
|
||||
IMG_INTERNAL PVRSRV_ERROR
|
||||
SGXFindSharedPBDesc(const PVRSRV_DEV_DATA *psDevData,
|
||||
IMG_BOOL bLockOnFailure,
|
||||
IMG_UINT32 ui32TotalPBSize,
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID *phSharedPBDesc,
|
||||
IMG_SID *phSharedPBDescKernelMemInfoHandle,
|
||||
IMG_SID *phHWPBDescKernelMemInfoHandle,
|
||||
IMG_SID *phBlockKernelMemInfoHandle,
|
||||
IMG_SID *phHWBlockKernelMemInfoHandle,
|
||||
IMG_SID **pphSharedPBDescSubKernelMemInfoHandles,
|
||||
#else
|
||||
IMG_HANDLE *phSharedPBDesc,
|
||||
IMG_HANDLE *phSharedPBDescKernelMemInfoHandle,
|
||||
IMG_HANDLE *phHWPBDescKernelMemInfoHandle,
|
||||
IMG_HANDLE *phBlockKernelMemInfoHandle,
|
||||
IMG_HANDLE *phHWBlockKernelMemInfoHandle,
|
||||
IMG_HANDLE **pphSharedPBDescSubKernelMemInfoHandles,
|
||||
#endif
|
||||
IMG_UINT32 *pui32SharedPBDescSubKernelMemInfoHandlesCount);
|
||||
|
||||
/*!
|
||||
* *****************************************************************************
|
||||
* @brief Decrements the reference counter and frees all kernel resources
|
||||
* associated with a SharedPBDesc.
|
||||
*
|
||||
* Note: It does not free userspace resources such as client meminfos
|
||||
* associated with the PB Desc. It is your responsible to free any
|
||||
* userspace resources including mappings _before_ calling
|
||||
* SGXUnrefSharedPBDesc.
|
||||
*
|
||||
* @param psDevData
|
||||
* @param hSharedPBDescKernelMemInfoHandle
|
||||
*
|
||||
* @return PVRSRV_ERROR
|
||||
********************************************************************************/
|
||||
IMG_INTERNAL PVRSRV_ERROR
|
||||
SGXUnrefSharedPBDesc(const PVRSRV_DEV_DATA *psDevData,
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hSharedPBDescKernelMemInfoHandle);
|
||||
#else
|
||||
IMG_HANDLE hSharedPBDescKernelMemInfoHandle);
|
||||
#endif
|
||||
|
||||
/*!
|
||||
* *****************************************************************************
|
||||
* @brief Links a new SharedPBDesc into a kernel managed list that can
|
||||
* then be queried by other clients.
|
||||
*
|
||||
* As a side affect this function also dissociates the SharedPBDesc
|
||||
* from the calling process so that the memory won't be freed if the
|
||||
* process dies/exits. (The kernel assumes responsability over the
|
||||
* memory at the same time)
|
||||
*
|
||||
* As well as the psSharedPBDescKernelMemInfoHandle you must also pass
|
||||
* a complete list of other meminfos that are integral to the
|
||||
* shared PB description. (Although the kernel doesn't have direct
|
||||
* access to the shared PB desc it still needs to be able to
|
||||
* clean up all the associated resources when it is no longer
|
||||
* in use.)
|
||||
*
|
||||
* If the dissociation fails then all the memory associated with
|
||||
* the hSharedPBDescKernelMemInfoHandle and all entries in phSubKernelMemInfos
|
||||
* will be freed by kernel services! Because of this, you are
|
||||
* responsible for freeing the corresponding client meminfos _before_
|
||||
* calling SGXAddSharedPBDesc.
|
||||
*
|
||||
* This function will return an error unless a succesful call to
|
||||
* SGXFindSharedPBDesc, with bLockOnFailure set, has been made.
|
||||
*
|
||||
* @param psDevData
|
||||
* @param ui32TotalPBSize The size of the associated parameter buffer
|
||||
* @param hSharedPBDescKernelMemInfoHandle
|
||||
* @param hHWPBDescKernelMemInfoHandle
|
||||
* @param hBlockKernelMemInfoHandle
|
||||
* @param hSharedPBDesc
|
||||
* @param phSubKernelMemInfos A list of other meminfos integral to the shared
|
||||
* PB description.
|
||||
* @param ui32SubKernelMemInfosCount The number of entires in phSubKernelMemInfos
|
||||
* @param sHWPBDescDevVAddr The device virtual address of the HWPBDesc
|
||||
*
|
||||
* @return PVRSRV_ERROR
|
||||
********************************************************************************/
|
||||
IMG_INTERNAL PVRSRV_ERROR
|
||||
SGXAddSharedPBDesc(const PVRSRV_DEV_DATA *psDevData,
|
||||
IMG_UINT32 ui32TotalPBSize,
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hSharedPBDescKernelMemInfoHandle,
|
||||
IMG_SID hHWPBDescKernelMemInfoHandle,
|
||||
IMG_SID hBlockKernelMemInfoHandle,
|
||||
IMG_SID hHWBlockKernelMemInfoHandle,
|
||||
IMG_SID *phSharedPBDesc,
|
||||
IMG_SID *phSubKernelMemInfos,
|
||||
#else
|
||||
IMG_HANDLE hSharedPBDescKernelMemInfoHandle,
|
||||
IMG_HANDLE hHWPBDescKernelMemInfoHandle,
|
||||
IMG_HANDLE hBlockKernelMemInfoHandle,
|
||||
IMG_HANDLE hHWBlockKernelMemInfoHandle,
|
||||
IMG_HANDLE *phSharedPBDesc,
|
||||
IMG_HANDLE *phSubKernelMemInfos,
|
||||
#endif
|
||||
IMG_UINT32 ui32SubKernelMemInfosCount,
|
||||
IMG_DEV_VIRTADDR sHWPBDescDevVAddr);
|
||||
|
||||
#ifdef PDUMP
|
||||
IMG_IMPORT IMG_VOID IMG_CALLCONV
|
||||
PVRSRVPDumpBufferArray(const PVRSRV_CONNECTION *psConnection,
|
||||
SGX_KICKTA_DUMP_BUFFER *psBufferArray,
|
||||
IMG_UINT32 ui32BufferArrayLength,
|
||||
IMG_BOOL bDumpPolls);
|
||||
|
||||
IMG_INTERNAL IMG_VOID PVRSRVPDump3DSignatureRegisters(const PVRSRV_DEV_DATA *psDevData,
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hDevMemContext,
|
||||
#else
|
||||
IMG_HANDLE hDevMemContext,
|
||||
#endif
|
||||
IMG_UINT32 ui32DumpFrameNum,
|
||||
IMG_BOOL bLastFrame,
|
||||
IMG_UINT32 *pui32Registers,
|
||||
IMG_UINT32 ui32NumRegisters);
|
||||
|
||||
IMG_INTERNAL IMG_VOID PVRSRVPDumpPerformanceCounterRegisters(const PVRSRV_DEV_DATA *psDevData,
|
||||
IMG_UINT32 ui32DumpFrameNum,
|
||||
IMG_BOOL bLastFrame,
|
||||
IMG_UINT32 *pui32Registers,
|
||||
IMG_UINT32 ui32NumRegisters);
|
||||
|
||||
IMG_INTERNAL IMG_VOID PVRSRVPDumpTASignatureRegisters(const PVRSRV_DEV_DATA *psDevData,
|
||||
IMG_UINT32 ui32DumpFrameNum,
|
||||
IMG_UINT32 ui32TAKickCount,
|
||||
IMG_BOOL bLastFrame,
|
||||
IMG_UINT32 *pui32Registers,
|
||||
IMG_UINT32 ui32NumRegisters);
|
||||
|
||||
IMG_INTERNAL IMG_VOID PVRSRVPDumpHWPerfCB(const PVRSRV_DEV_DATA *psDevData,
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hDevMemContext,
|
||||
#else
|
||||
IMG_HANDLE hDevMemContext,
|
||||
#endif
|
||||
IMG_CHAR *pszFileName,
|
||||
IMG_UINT32 ui32FileOffset,
|
||||
IMG_UINT32 ui32PDumpFlags);
|
||||
|
||||
IMG_INTERNAL IMG_VOID PVRSRVPDumpSaveMem(const PVRSRV_DEV_DATA *psDevData,
|
||||
IMG_CHAR *pszFileName,
|
||||
IMG_UINT32 ui32FileOffset,
|
||||
IMG_DEV_VIRTADDR sDevVAddr,
|
||||
IMG_UINT32 ui32Size,
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hDevMemContext,
|
||||
#else
|
||||
IMG_HANDLE hDevMemContext,
|
||||
#endif
|
||||
IMG_UINT32 ui32PDumpFlags);
|
||||
#endif
|
||||
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_INTERNAL PVRSRV_ERROR SGXRegisterHWRenderContext(
|
||||
const PVRSRV_DEV_DATA *psDevData, IMG_SID *phHWRenderContext,
|
||||
IMG_CPU_VIRTADDR *psHWRenderContextCpuVAddr,
|
||||
IMG_UINT32 ui32HWRenderContextSize,
|
||||
IMG_UINT32 ui32OffsetToPDDevPAddr,
|
||||
IMG_HANDLE hDevMemContext,
|
||||
IMG_DEV_VIRTADDR *psHWRenderContextDevVAddrOut);
|
||||
IMG_INTERNAL PVRSRV_ERROR SGXRegisterHWTransferContext(
|
||||
const PVRSRV_DEV_DATA *psDevData, IMG_SID *phHWTransferContext,
|
||||
IMG_CPU_VIRTADDR *psHWRenderContextCpuVAddr,
|
||||
IMG_UINT32 ui32HWRenderContextSize,
|
||||
IMG_UINT32 ui32OffsetToPDDevPAddr,
|
||||
IMG_HANDLE hDevMemContext,
|
||||
IMG_DEV_VIRTADDR *psHWTransferContextDevVAddrOut);
|
||||
#else
|
||||
IMG_INTERNAL PVRSRV_ERROR SGXRegisterHWRenderContext(
|
||||
const PVRSRV_DEV_DATA *psDevData, IMG_HANDLE *phHWRenderContext,
|
||||
IMG_CPU_VIRTADDR *psHWRenderContextCpuVAddr,
|
||||
IMG_UINT32 ui32RenderContextSize,
|
||||
IMG_UINT32 ui32OffsetToPDDevPAddr,
|
||||
IMG_HANDLE hDevMemContext,
|
||||
IMG_DEV_VIRTADDR *psHWRenderContextDevVAddrOut);
|
||||
IMG_INTERNAL PVRSRV_ERROR SGXRegisterHWTransferContext(
|
||||
const PVRSRV_DEV_DATA *psDevData, IMG_HANDLE *phHWTransferContext,
|
||||
IMG_CPU_VIRTADDR *psHWRenderContextCpuVAddr,
|
||||
IMG_UINT32 ui32RenderContextSize,
|
||||
IMG_UINT32 ui32OffsetToPDDevPAddr,
|
||||
IMG_HANDLE hDevMemContext,
|
||||
IMG_DEV_VIRTADDR *psHWTransferContextDevVAddrOut);
|
||||
#endif
|
||||
#if defined(SGX_FEATURE_2D_HARDWARE)
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_INTERNAL PVRSRV_ERROR SGXRegisterHW2DContext(
|
||||
const PVRSRV_DEV_DATA *psDevData, IMG_SID *phHW2DContext,
|
||||
IMG_CPU_VIRTADDR *psHWRenderContextCpuVAddr,
|
||||
IMG_UINT32 ui32RenderContextSize,
|
||||
IMG_UINT32 ui32OffsetToPDDevPAddr,
|
||||
IMG_HANDLE hDevMemContext,
|
||||
IMG_DEV_VIRTADDR *psHW2DContextDevVAddrOut);
|
||||
#else
|
||||
IMG_INTERNAL PVRSRV_ERROR SGXRegisterHW2DContext(
|
||||
const PVRSRV_DEV_DATA *psDevData, IMG_HANDLE *phHW2DContext,
|
||||
IMG_CPU_VIRTADDR *psHWRenderContextCpuVAddr,
|
||||
IMG_UINT32 ui32RenderContextSize,
|
||||
IMG_UINT32 ui32OffsetToPDDevPAddr,
|
||||
IMG_HANDLE hDevMemContext,
|
||||
IMG_DEV_VIRTADDR *psHW2DContextDevVAddrOut);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
IMG_INTERNAL PVRSRV_ERROR SGXFlushHWRenderTarget(const PVRSRV_DEV_DATA *psDevData, PVRSRV_CLIENT_MEM_INFO * psHWRTDataSetMemInfo);
|
||||
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_INTERNAL PVRSRV_ERROR SGXUnregisterHWRenderContext(const PVRSRV_DEV_DATA *psDevData, IMG_SID hHWRenderContext, IMG_BOOL bForceCleanup);
|
||||
IMG_INTERNAL PVRSRV_ERROR SGXUnregisterHWTransferContext(const PVRSRV_DEV_DATA *psDevData, IMG_SID hHWTransferContext, IMG_BOOL bForceCleanup);
|
||||
#else
|
||||
IMG_INTERNAL PVRSRV_ERROR SGXUnregisterHWRenderContext(const PVRSRV_DEV_DATA *psDevData, IMG_HANDLE hHWRenderContext, IMG_BOOL bForceCleanup);
|
||||
IMG_INTERNAL PVRSRV_ERROR SGXUnregisterHWTransferContext(const PVRSRV_DEV_DATA *psDevData, IMG_HANDLE hHWTransferContext, IMG_BOOL bForceCleanup);
|
||||
#endif
|
||||
#if defined(SGX_FEATURE_2D_HARDWARE)
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_INTERNAL PVRSRV_ERROR SGXUnregisterHW2DContext(const PVRSRV_DEV_DATA *psDevData, IMG_SID hHW2DContext, IMG_BOOL bForceCleanup);
|
||||
#else
|
||||
IMG_INTERNAL PVRSRV_ERROR SGXUnregisterHW2DContext(const PVRSRV_DEV_DATA *psDevData, IMG_HANDLE hHW2DContext, IMG_BOOL bForceCleanup);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_INTERNAL PVRSRV_ERROR SGXSetRenderContextPriority(const PVRSRV_DEV_DATA *psDevData,
|
||||
IMG_SID hHWRenderContext,
|
||||
IMG_UINT32 ui32Priority,
|
||||
IMG_UINT32 ui32OffsetOfPriorityField);
|
||||
|
||||
IMG_INTERNAL PVRSRV_ERROR SGXSetTransferContextPriority(const PVRSRV_DEV_DATA *psDevData,
|
||||
IMG_SID hHWTransferContext,
|
||||
IMG_UINT32 ui32Priority,
|
||||
IMG_UINT32 ui32OffsetOfPriorityField);
|
||||
#else
|
||||
IMG_INTERNAL PVRSRV_ERROR SGXSetRenderContextPriority(const PVRSRV_DEV_DATA *psDevData,
|
||||
IMG_HANDLE hHWRenderContext,
|
||||
IMG_UINT32 ui32Priority,
|
||||
IMG_UINT32 ui32OffsetOfPriorityField);
|
||||
|
||||
IMG_INTERNAL PVRSRV_ERROR SGXSetTransferContextPriority(const PVRSRV_DEV_DATA *psDevData,
|
||||
IMG_HANDLE hHWTransferContext,
|
||||
IMG_UINT32 ui32Priority,
|
||||
IMG_UINT32 ui32OffsetOfPriorityField);
|
||||
#endif
|
||||
|
||||
#if defined (__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __SGX_BRIDGE_UM_H__ */
|
||||
|
1067
include/gpu_es4/eurasia/services4/include/sgx_mkif_client.h
Normal file
462
include/gpu_es4/eurasia/services4/include/sgx_mkif_km.h
Normal file
@ -0,0 +1,462 @@
|
||||
/*!****************************************************************************
|
||||
@File sgx_mkif_km.h
|
||||
|
||||
@Title SGX microkernel interface structures used by srvkm
|
||||
|
||||
@Author Imagination Technologies
|
||||
|
||||
@Date 4th Aug 2009
|
||||
|
||||
@Copyright Copyright 2009 by Imagination Technologies Limited.
|
||||
All rights reserved. No part of this software, either material
|
||||
or conceptual may be copied or distributed, transmitted,
|
||||
transcribed, stored in a retrieval system or translated into
|
||||
any human or computer language in any form by any means,
|
||||
electronic, mechanical, manual or otherwise, or disclosed to
|
||||
third parties without the express written permission of
|
||||
Imagination Technologies Limited, Home Park Estate,
|
||||
Kings Langley, Hertfordshire, WD4 8LZ, U.K.
|
||||
|
||||
@Platform SGX
|
||||
|
||||
@Description SGX microkernel interface structures used by srvkm
|
||||
|
||||
@DoxygenVer
|
||||
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
Modifications :-
|
||||
$Log: sgx_mkif_km.h $
|
||||
*****************************************************************************/
|
||||
|
||||
#if !defined (__SGX_MKIF_KM_H__)
|
||||
#define __SGX_MKIF_KM_H__
|
||||
|
||||
#include "img_types.h"
|
||||
#include "servicesint.h"
|
||||
#include "sgxapi_km.h"
|
||||
|
||||
|
||||
#if !defined (SGX_MP_CORE_SELECT)
|
||||
/* MP register control macros */
|
||||
#if defined(SGX_FEATURE_MP)
|
||||
#define SGX_REG_BANK_SHIFT (14)
|
||||
#define SGX_REG_BANK_SIZE (1 << SGX_REG_BANK_SHIFT)
|
||||
#define SGX_REG_BANK_BASE_INDEX (2)
|
||||
#define SGX_REG_BANK_MASTER_INDEX (1)
|
||||
#define SGX_MP_CORE_SELECT(x,i) (x + ((i + SGX_REG_BANK_BASE_INDEX) * SGX_REG_BANK_SIZE))
|
||||
#define SGX_MP_MASTER_SELECT(x) (x + (SGX_REG_BANK_MASTER_INDEX * SGX_REG_BANK_SIZE))
|
||||
#else
|
||||
#define SGX_MP_CORE_SELECT(x,i) (x)
|
||||
#endif /* SGX_FEATURE_MP */
|
||||
#endif
|
||||
|
||||
|
||||
/*!
|
||||
******************************************************************************
|
||||
* CCB command structure for SGX
|
||||
*****************************************************************************/
|
||||
typedef struct _SGXMKIF_COMMAND_
|
||||
{
|
||||
IMG_UINT32 ui32ServiceAddress; /*!< address of the USE command handler */
|
||||
IMG_UINT32 ui32CacheControl; /*!< See SGXMKIF_CC_INVAL_* */
|
||||
IMG_UINT32 ui32Data[6]; /*!< array of other command control words */
|
||||
} SGXMKIF_COMMAND;
|
||||
|
||||
|
||||
/*!
|
||||
******************************************************************************
|
||||
* CCB array of commands for SGX
|
||||
*****************************************************************************/
|
||||
typedef struct _PVRSRV_SGX_KERNEL_CCB_
|
||||
{
|
||||
SGXMKIF_COMMAND asCommands[256]; /*!< array of commands */
|
||||
} PVRSRV_SGX_KERNEL_CCB;
|
||||
|
||||
|
||||
/*!
|
||||
******************************************************************************
|
||||
* CCB control for SGX
|
||||
*****************************************************************************/
|
||||
typedef struct _PVRSRV_SGX_CCB_CTL_
|
||||
{
|
||||
IMG_UINT32 ui32WriteOffset; /*!< write offset into array of commands (MUST be alligned to 16 bytes!) */
|
||||
IMG_UINT32 ui32ReadOffset; /*!< read offset into array of commands */
|
||||
} PVRSRV_SGX_CCB_CTL;
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* Control data for SGX
|
||||
*****************************************************************************/
|
||||
typedef struct _SGXMKIF_HOST_CTL_
|
||||
{
|
||||
#if defined(PVRSRV_USSE_EDM_BREAKPOINTS)
|
||||
IMG_UINT32 ui32BreakpointDisable;
|
||||
IMG_UINT32 ui32Continue;
|
||||
#endif
|
||||
|
||||
volatile IMG_UINT32 ui32InitStatus; /*!< Microkernel Initialisation status */
|
||||
volatile IMG_UINT32 ui32PowerStatus; /*!< Microkernel Power Management status */
|
||||
volatile IMG_UINT32 ui32CleanupStatus; /*!< Microkernel Resource Management status */
|
||||
#if defined(FIX_HW_BRN_28889)
|
||||
volatile IMG_UINT32 ui32InvalStatus; /*!< Microkernel BIF Cache Invalidate status */
|
||||
#endif
|
||||
#if defined(SUPPORT_HW_RECOVERY)
|
||||
IMG_UINT32 ui32uKernelDetectedLockups; /*!< counter relating to the number of lockups the uKernel has detected */
|
||||
IMG_UINT32 ui32HostDetectedLockups; /*!< counter relating to the number of lockups the host has detected */
|
||||
IMG_UINT32 ui32HWRecoverySampleRate; /*!< SGX lockup detection rate (in multiples of the timer period) */
|
||||
#endif /* SUPPORT_HW_RECOVERY*/
|
||||
IMG_UINT32 ui32uKernelTimerClock; /*!< SGX ukernel timer period (in clocks) */
|
||||
IMG_UINT32 ui32ActivePowManSampleRate; /*!< SGX Active Power latency period (in multiples of the timer period) */
|
||||
IMG_UINT32 ui32InterruptFlags; /*!< Interrupt flags - PVRSRV_USSE_EDM_INTERRUPT_xxx */
|
||||
IMG_UINT32 ui32InterruptClearFlags; /*!< Interrupt clear flags - PVRSRV_USSE_EDM_INTERRUPT_xxx */
|
||||
IMG_UINT32 ui32BPSetClearSignal; /*!< Breakpoint set/cear signal */
|
||||
|
||||
IMG_UINT32 ui32NumActivePowerEvents; /*!< counter for the number of active power events */
|
||||
|
||||
IMG_UINT32 ui32TimeWraps; /*!< to count time wraps in the Timer task*/
|
||||
IMG_UINT32 ui32HostClock; /*!< Host clock value at microkernel power-up time */
|
||||
IMG_UINT32 ui32AssertFail; /*!< Microkernel assert failure code */
|
||||
|
||||
#if defined(SGX_FEATURE_EXTENDED_PERF_COUNTERS)
|
||||
IMG_UINT32 aui32PerfGroup[PVRSRV_SGX_HWPERF_NUM_COUNTERS]; /*!< Specifies the HW's active group selectors */
|
||||
IMG_UINT32 aui32PerfBit[PVRSRV_SGX_HWPERF_NUM_COUNTERS]; /*!< Specifies the HW's active bit selectors */
|
||||
#else
|
||||
IMG_UINT32 ui32PerfGroup; /*!< Specifies the HW's active group */
|
||||
#endif /* SGX_FEATURE_EXTENDED_PERF_COUNTERS */
|
||||
|
||||
#if defined(FIX_HW_BRN_31939)
|
||||
IMG_UINT32 ui32BRN31939Mem;
|
||||
#endif
|
||||
|
||||
IMG_UINT32 ui32OpenCLDelayCount; /* Counter to keep track OpenCL task completion time in units of regular task time out events */
|
||||
} SGXMKIF_HOST_CTL;
|
||||
|
||||
/*
|
||||
* TA queue Kick flags
|
||||
*/
|
||||
/* Set in DoKickKM to indicate the command is ready to be processed */
|
||||
#define SGXMKIF_CMDTA_CTRLFLAGS_READY 0x00000001
|
||||
/*!
|
||||
******************************************************************************
|
||||
* Shared TA command structure.
|
||||
* This structure is part of the TA command structure proper (SGXMKIF_CMDTA),
|
||||
* and is accessed from the kernel part of the driver and the microkernel.
|
||||
* There shouldn't be a need to access it from user space.
|
||||
*****************************************************************************/
|
||||
typedef struct _SGXMKIF_CMDTA_SHARED_
|
||||
{
|
||||
IMG_UINT32 ui32CtrlFlags;
|
||||
|
||||
IMG_UINT32 ui32NumTAStatusVals;
|
||||
IMG_UINT32 ui32Num3DStatusVals;
|
||||
|
||||
/* KEEP THESE 4 VARIABLES TOGETHER FOR UKERNEL BLOCK LOAD */
|
||||
IMG_UINT32 ui32TATQSyncWriteOpsPendingVal;
|
||||
IMG_DEV_VIRTADDR sTATQSyncWriteOpsCompleteDevVAddr;
|
||||
IMG_UINT32 ui32TATQSyncReadOpsPendingVal;
|
||||
IMG_DEV_VIRTADDR sTATQSyncReadOpsCompleteDevVAddr;
|
||||
|
||||
/* KEEP THESE 4 VARIABLES TOGETHER FOR UKERNEL BLOCK LOAD */
|
||||
IMG_UINT32 ui323DTQSyncWriteOpsPendingVal;
|
||||
IMG_DEV_VIRTADDR s3DTQSyncWriteOpsCompleteDevVAddr;
|
||||
IMG_UINT32 ui323DTQSyncReadOpsPendingVal;
|
||||
IMG_DEV_VIRTADDR s3DTQSyncReadOpsCompleteDevVAddr;
|
||||
|
||||
|
||||
#if defined(SUPPORT_SGX_GENERALISED_SYNCOBJECTS)
|
||||
/* SRC and DST syncs */
|
||||
IMG_UINT32 ui32NumTASrcSyncs;
|
||||
PVRSRV_DEVICE_SYNC_OBJECT asTASrcSyncs[SGX_MAX_TA_SRC_SYNCS];
|
||||
IMG_UINT32 ui32NumTADstSyncs;
|
||||
PVRSRV_DEVICE_SYNC_OBJECT asTADstSyncs[SGX_MAX_TA_DST_SYNCS];
|
||||
IMG_UINT32 ui32Num3DSrcSyncs;
|
||||
PVRSRV_DEVICE_SYNC_OBJECT as3DSrcSyncs[SGX_MAX_3D_SRC_SYNCS];
|
||||
#else
|
||||
/* source dependency details */
|
||||
IMG_UINT32 ui32NumSrcSyncs;
|
||||
PVRSRV_DEVICE_SYNC_OBJECT asSrcSyncs[SGX_MAX_SRC_SYNCS];
|
||||
#endif
|
||||
|
||||
/* sync criteria used for TA/3D dependency synchronisation */
|
||||
PVRSRV_DEVICE_SYNC_OBJECT sTA3DDependency;
|
||||
|
||||
CTL_STATUS sCtlTAStatusInfo[SGX_MAX_TA_STATUS_VALS];
|
||||
CTL_STATUS sCtl3DStatusInfo[SGX_MAX_3D_STATUS_VALS];
|
||||
|
||||
} SGXMKIF_CMDTA_SHARED;
|
||||
|
||||
/*
|
||||
* Services internal TQ limits
|
||||
*/
|
||||
#define SGXTQ_MAX_STATUS SGX_MAX_TRANSFER_STATUS_VALS + 2
|
||||
|
||||
/*
|
||||
* Transfer queue Kick flags
|
||||
*/
|
||||
/* if set the uKernel won't update the sync objects on completion*/
|
||||
#define SGXMKIF_TQFLAGS_NOSYNCUPDATE 0x00000001
|
||||
/* if set the kernel won't advance the pending values*/
|
||||
#define SGXMKIF_TQFLAGS_KEEPPENDING 0x00000002
|
||||
/* in services equivalent for the same client flags*/
|
||||
#define SGXMKIF_TQFLAGS_TATQ_SYNC 0x00000004
|
||||
#define SGXMKIF_TQFLAGS_3DTQ_SYNC 0x00000008
|
||||
#if defined(SGX_FEATURE_FAST_RENDER_CONTEXT_SWITCH)
|
||||
#define SGXMKIF_TQFLAGS_CTXSWITCH 0x00000010
|
||||
#endif
|
||||
/* if set uKernel only updates syncobjects / status values*/
|
||||
#define SGXMKIF_TQFLAGS_DUMMYTRANSFER 0x00000020
|
||||
|
||||
/*!
|
||||
******************************************************************************
|
||||
* Shared Transfer Queue command structure.
|
||||
* This structure is placed at the start of the TQ command structure proper
|
||||
* (SGXMKIF_TRANSFERCMD), and is accessed from the kernel part of the driver
|
||||
* and the microkernel.
|
||||
*****************************************************************************/
|
||||
typedef struct _SGXMKIF_TRANSFERCMD_SHARED_
|
||||
{
|
||||
/* need to be able to check read and write ops on src, and update reads */
|
||||
|
||||
IMG_UINT32 ui32NumSrcSyncs;
|
||||
PVRSRV_DEVICE_SYNC_OBJECT asSrcSyncs[SGX_MAX_SRC_SYNCS];
|
||||
/* need to be able to check reads and writes on dest, and update writes */
|
||||
|
||||
IMG_UINT32 ui32NumDstSyncs;
|
||||
PVRSRV_DEVICE_SYNC_OBJECT asDstSyncs[SGX_MAX_DST_SYNCS];
|
||||
/* KEEP THESE 4 VARIABLES TOGETHER FOR UKERNEL BLOCK LOAD */
|
||||
IMG_UINT32 ui32TASyncWriteOpsPendingVal;
|
||||
IMG_DEV_VIRTADDR sTASyncWriteOpsCompleteDevVAddr;
|
||||
IMG_UINT32 ui32TASyncReadOpsPendingVal;
|
||||
IMG_DEV_VIRTADDR sTASyncReadOpsCompleteDevVAddr;
|
||||
|
||||
/* KEEP THESE 4 VARIABLES TOGETHER FOR UKERNEL BLOCK LOAD */
|
||||
IMG_UINT32 ui323DSyncWriteOpsPendingVal;
|
||||
IMG_DEV_VIRTADDR s3DSyncWriteOpsCompleteDevVAddr;
|
||||
IMG_UINT32 ui323DSyncReadOpsPendingVal;
|
||||
IMG_DEV_VIRTADDR s3DSyncReadOpsCompleteDevVAddr;
|
||||
|
||||
IMG_UINT32 ui32NumStatusVals;
|
||||
CTL_STATUS sCtlStatusInfo[SGXTQ_MAX_STATUS];
|
||||
} SGXMKIF_TRANSFERCMD_SHARED, *PSGXMKIF_TRANSFERCMD_SHARED;
|
||||
|
||||
|
||||
#if defined(SGX_FEATURE_2D_HARDWARE)
|
||||
typedef struct _SGXMKIF_2DCMD_SHARED_ {
|
||||
/* need to be able to check read and write ops on src, and update reads */
|
||||
IMG_UINT32 ui32NumSrcSync;
|
||||
PVRSRV_DEVICE_SYNC_OBJECT sSrcSyncData[SGX_MAX_2D_SRC_SYNC_OPS];
|
||||
|
||||
/* need to be able to check reads and writes on dest, and update writes */
|
||||
PVRSRV_DEVICE_SYNC_OBJECT sDstSyncData;
|
||||
|
||||
/* need to be able to check reads and writes on TA ops, and update writes */
|
||||
PVRSRV_DEVICE_SYNC_OBJECT sTASyncData;
|
||||
|
||||
/* need to be able to check reads and writes on 2D ops, and update writes */
|
||||
PVRSRV_DEVICE_SYNC_OBJECT s3DSyncData;
|
||||
} SGXMKIF_2DCMD_SHARED, *PSGXMKIF_2DCMD_SHARED;
|
||||
#endif /* SGX_FEATURE_2D_HARDWARE */
|
||||
|
||||
|
||||
typedef struct _SGXMKIF_HWDEVICE_SYNC_LIST_
|
||||
{
|
||||
IMG_DEV_VIRTADDR sAccessDevAddr;
|
||||
IMG_UINT32 ui32NumSyncObjects;
|
||||
/* Must be the last variable in the structure */
|
||||
PVRSRV_DEVICE_SYNC_OBJECT asSyncData[1];
|
||||
} SGXMKIF_HWDEVICE_SYNC_LIST, *PSGXMKIF_HWDEVICE_SYNC_LIST;
|
||||
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* Microkernel initialisation status
|
||||
*****************************************************************************/
|
||||
#define PVRSRV_USSE_EDM_INIT_COMPLETE (1UL << 0) /*!< ukernel initialisation complete */
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* Microkernel power status definitions
|
||||
*****************************************************************************/
|
||||
#define PVRSRV_USSE_EDM_POWMAN_IDLE_COMPLETE (1UL << 2) /*!< Signal from ukernel->Host indicating SGX is idle */
|
||||
#define PVRSRV_USSE_EDM_POWMAN_POWEROFF_COMPLETE (1UL << 3) /*!< Signal from ukernel->Host indicating SGX can be powered down */
|
||||
#define PVRSRV_USSE_EDM_POWMAN_POWEROFF_RESTART_IMMEDIATE (1UL << 4) /*!< Signal from ukernel->Host indicating there is work to do immediately */
|
||||
#define PVRSRV_USSE_EDM_POWMAN_NO_WORK (1UL << 5) /*!< Signal from ukernel->Host indicating no work to do */
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* EDM interrupt defines
|
||||
*****************************************************************************/
|
||||
#define PVRSRV_USSE_EDM_INTERRUPT_HWR (1UL << 0) /*!< EDM requesting hardware recovery */
|
||||
#define PVRSRV_USSE_EDM_INTERRUPT_ACTIVE_POWER (1UL << 1) /*!< EDM requesting to be powered down */
|
||||
#define PVRSRV_USSE_EDM_INTERRUPT_IDLE (1UL << 2) /*!< EDM indicating SGX idle */
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* EDM Resource management defines
|
||||
*****************************************************************************/
|
||||
#define PVRSRV_USSE_EDM_CLEANUPCMD_COMPLETE (1UL << 0) /*!< Signal from EDM->Host indicating clean-up completion */
|
||||
|
||||
#if defined(FIX_HW_BRN_28889)
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* EDM BIF Cache Invalidate defines
|
||||
*****************************************************************************/
|
||||
#define PVRSRV_USSE_EDM_BIF_INVAL_COMPLETE (1UL << 0) /*!< Signal from EDM->Host indicating the BIF invalidate has started */
|
||||
#endif
|
||||
|
||||
/*!
|
||||
****************************************************************************
|
||||
* EDM / uKernel Get misc info defines
|
||||
****************************************************************************
|
||||
*/
|
||||
#define PVRSRV_USSE_MISCINFO_READY 0x1UL
|
||||
#define PVRSRV_USSE_MISCINFO_GET_STRUCT_SIZES 0x2UL /*!< If set, getmiscinfo ukernel func returns structure sizes */
|
||||
#if defined(SUPPORT_SGX_EDM_MEMORY_DEBUG)
|
||||
#define PVRSRV_USSE_MISCINFO_MEMREAD 0x4UL /*!< If set, getmiscinfo ukernel func reads arbitrary device mem */
|
||||
#define PVRSRV_USSE_MISCINFO_MEMWRITE 0x8UL /*!< If set, getmiscinfo ukernel func writes arbitrary device mem */
|
||||
#if !defined(SGX_FEATURE_MULTIPLE_MEM_CONTEXTS)
|
||||
#define PVRSRV_USSE_MISCINFO_MEMREAD_FAIL 0x1UL << 31 /* If set, ukernel was unable to read from the mem context */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
/* Cleanup command control word */
|
||||
#define PVRSRV_CLEANUPCMD_RT 0x1U
|
||||
#define PVRSRV_CLEANUPCMD_RC 0x2U
|
||||
#define PVRSRV_CLEANUPCMD_TC 0x3U
|
||||
#define PVRSRV_CLEANUPCMD_2DC 0x4U
|
||||
#define PVRSRV_CLEANUPCMD_PB 0x5U
|
||||
|
||||
/* Power command control word */
|
||||
#define PVRSRV_POWERCMD_POWEROFF 0x1U
|
||||
#define PVRSRV_POWERCMD_IDLE 0x2U
|
||||
#define PVRSRV_POWERCMD_RESUME 0x3U
|
||||
|
||||
/* Context suspend command control word */
|
||||
#define PVRSRV_CTXSUSPCMD_SUSPEND 0x1U
|
||||
#define PVRSRV_CTXSUSPCMD_RESUME 0x2U
|
||||
|
||||
|
||||
#if defined(SGX_FEATURE_MULTIPLE_MEM_CONTEXTS)
|
||||
#define SGX_BIF_DIR_LIST_INDEX_EDM (SGX_FEATURE_BIF_NUM_DIRLISTS - 1)
|
||||
#else
|
||||
#define SGX_BIF_DIR_LIST_INDEX_EDM (0)
|
||||
#endif
|
||||
|
||||
/*!
|
||||
******************************************************************************
|
||||
* microkernel cache control requests
|
||||
******************************************************************************/
|
||||
#define SGXMKIF_CC_INVAL_BIF_PT 0x1
|
||||
#define SGXMKIF_CC_INVAL_BIF_PD 0x2
|
||||
#define SGXMKIF_CC_INVAL_BIF_SL 0x4
|
||||
#define SGXMKIF_CC_INVAL_DATA 0x8
|
||||
|
||||
|
||||
/*!
|
||||
******************************************************************************
|
||||
* SGX microkernel interface structure sizes
|
||||
******************************************************************************/
|
||||
typedef struct _SGX_MISCINFO_STRUCT_SIZES_
|
||||
{
|
||||
#if defined (SGX_FEATURE_2D_HARDWARE)
|
||||
IMG_UINT32 ui32Sizeof_2DCMD;
|
||||
IMG_UINT32 ui32Sizeof_2DCMD_SHARED;
|
||||
#endif
|
||||
IMG_UINT32 ui32Sizeof_CMDTA;
|
||||
IMG_UINT32 ui32Sizeof_CMDTA_SHARED;
|
||||
IMG_UINT32 ui32Sizeof_TRANSFERCMD;
|
||||
IMG_UINT32 ui32Sizeof_TRANSFERCMD_SHARED;
|
||||
IMG_UINT32 ui32Sizeof_3DREGISTERS;
|
||||
IMG_UINT32 ui32Sizeof_HWPBDESC;
|
||||
IMG_UINT32 ui32Sizeof_HWRENDERCONTEXT;
|
||||
IMG_UINT32 ui32Sizeof_HWRENDERDETAILS;
|
||||
IMG_UINT32 ui32Sizeof_HWRTDATA;
|
||||
IMG_UINT32 ui32Sizeof_HWRTDATASET;
|
||||
IMG_UINT32 ui32Sizeof_HWTRANSFERCONTEXT;
|
||||
IMG_UINT32 ui32Sizeof_HOST_CTL;
|
||||
IMG_UINT32 ui32Sizeof_COMMAND;
|
||||
} SGX_MISCINFO_STRUCT_SIZES;
|
||||
|
||||
|
||||
#if defined(SUPPORT_SGX_EDM_MEMORY_DEBUG)
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* SGX misc info for accessing device memory from ukernel
|
||||
*****************************************************************************
|
||||
*/
|
||||
typedef struct _PVRSRV_SGX_MISCINFO_MEMACCESS
|
||||
{
|
||||
IMG_DEV_VIRTADDR sDevVAddr; /*!< dev virtual addr for mem access */
|
||||
IMG_DEV_PHYADDR sPDDevPAddr; /*!< device physical addr of PD for the mem heap */
|
||||
} PVRSRV_SGX_MISCINFO_MEMACCESS;
|
||||
#endif
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* SGX Misc Info structure used in the microkernel
|
||||
* PVRSRV_SGX_MISCINFO_FEATURES is defined in sgxapi_km.h
|
||||
****************************************************************************/
|
||||
typedef struct _PVRSRV_SGX_MISCINFO_INFO
|
||||
{
|
||||
IMG_UINT32 ui32MiscInfoFlags;
|
||||
PVRSRV_SGX_MISCINFO_FEATURES sSGXFeatures; /*!< external info for client */
|
||||
SGX_MISCINFO_STRUCT_SIZES sSGXStructSizes; /*!< internal info: microkernel structure sizes */
|
||||
#if defined(SUPPORT_SGX_EDM_MEMORY_DEBUG)
|
||||
PVRSRV_SGX_MISCINFO_MEMACCESS sSGXMemAccessSrc; /*!< internal info: for reading dev memory */
|
||||
PVRSRV_SGX_MISCINFO_MEMACCESS sSGXMemAccessDest; /*!< internal info: for writing dev memory */
|
||||
#endif
|
||||
} PVRSRV_SGX_MISCINFO_INFO;
|
||||
|
||||
#ifdef PVRSRV_USSE_EDM_STATUS_DEBUG
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* Number of entries in the microkernel status buffer
|
||||
*****************************************************************************/
|
||||
#define SGXMK_TRACE_BUFFER_SIZE 512
|
||||
#endif /* PVRSRV_USSE_EDM_STATUS_DEBUG */
|
||||
|
||||
#define SGXMKIF_HWPERF_CB_SIZE 0x100 /* must be 2^n*/
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* One entry in the HWPerf Circular Buffer.
|
||||
*****************************************************************************/
|
||||
typedef struct _SGXMKIF_HWPERF_CB_ENTRY_
|
||||
{
|
||||
IMG_UINT32 ui32FrameNo;
|
||||
IMG_UINT32 ui32PID;
|
||||
IMG_UINT32 ui32RTData;
|
||||
IMG_UINT32 ui32Type;
|
||||
IMG_UINT32 ui32Ordinal;
|
||||
IMG_UINT32 ui32Info;
|
||||
IMG_UINT32 ui32TimeWraps;
|
||||
IMG_UINT32 ui32Time;
|
||||
/* NOTE: There should always be at least as many 3D cores as TA cores. */
|
||||
IMG_UINT32 ui32Counters[SGX_FEATURE_MP_CORE_COUNT_3D][PVRSRV_SGX_HWPERF_NUM_COUNTERS];
|
||||
IMG_UINT32 ui32MiscCounters[SGX_FEATURE_MP_CORE_COUNT_3D][PVRSRV_SGX_HWPERF_NUM_MISC_COUNTERS];
|
||||
} SGXMKIF_HWPERF_CB_ENTRY;
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* The HWPerf Circular Buffer.
|
||||
*****************************************************************************/
|
||||
typedef struct _SGXMKIF_HWPERF_CB_
|
||||
{
|
||||
IMG_UINT32 ui32Woff;
|
||||
IMG_UINT32 ui32Roff;
|
||||
IMG_UINT32 ui32Ordinal;
|
||||
SGXMKIF_HWPERF_CB_ENTRY psHWPerfCBData[SGXMKIF_HWPERF_CB_SIZE];
|
||||
} SGXMKIF_HWPERF_CB;
|
||||
|
||||
|
||||
#endif /* __SGX_MKIF_KM_H__ */
|
||||
|
||||
/******************************************************************************
|
||||
End of file (sgx_mkif_km.h)
|
||||
******************************************************************************/
|
||||
|
||||
|
538
include/gpu_es4/eurasia/services4/include/sgxinfo.h
Normal file
@ -0,0 +1,538 @@
|
||||
/*!****************************************************************************
|
||||
@File sgxinfo.h
|
||||
|
||||
@Title sgx services structures/functions
|
||||
|
||||
@Author Imagination Technologies
|
||||
|
||||
@Date 15 / 5 / 06
|
||||
|
||||
@Copyright Copyright 2003-2008 by Imagination Technologies Limited.
|
||||
All rights reserved. No part of this software, either material
|
||||
or conceptual may be copied or distributed, transmitted,
|
||||
transcribed, stored in a retrieval system or translated into
|
||||
any human or computer language in any form by any means,
|
||||
electronic, mechanical, manual or otherwise, or disclosed to
|
||||
third parties without the express written permission of
|
||||
Imagination Technologies Limited, Home Park Estate,
|
||||
Kings Langley, Hertfordshire, WD4 8LZ, U.K.
|
||||
|
||||
@Platform Generic
|
||||
|
||||
@Description inline functions/structures shared across UM and KM services components
|
||||
|
||||
@DoxygenVer
|
||||
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
Modifications :-
|
||||
$Log: sgxinfo.h $
|
||||
|
||||
--- Revision Logs Removed ---
|
||||
******************************************************************************/
|
||||
#if !defined (__SGXINFO_H__)
|
||||
#define __SGXINFO_H__
|
||||
|
||||
#include "sgxscript.h"
|
||||
#include "servicesint.h"
|
||||
#include "services.h"
|
||||
#if !defined (SUPPORT_SID_INTERFACE)
|
||||
#include "sgxapi_km.h"
|
||||
#endif
|
||||
#include "sgx_mkif_km.h"
|
||||
|
||||
|
||||
#define SGX_MAX_DEV_DATA 24
|
||||
#define SGX_MAX_INIT_MEM_HANDLES 18
|
||||
|
||||
|
||||
typedef struct _SGX_BRIDGE_INFO_FOR_SRVINIT
|
||||
{
|
||||
IMG_DEV_PHYADDR sPDDevPAddr;
|
||||
PVRSRV_HEAP_INFO asHeapInfo[PVRSRV_MAX_CLIENT_HEAPS];
|
||||
} SGX_BRIDGE_INFO_FOR_SRVINIT;
|
||||
|
||||
|
||||
typedef enum _SGXMKIF_CMD_TYPE_
|
||||
{
|
||||
SGXMKIF_CMD_TA = 0,
|
||||
SGXMKIF_CMD_TRANSFER = 1,
|
||||
SGXMKIF_CMD_2D = 2,
|
||||
SGXMKIF_CMD_POWER = 3,
|
||||
SGXMKIF_CMD_CONTEXTSUSPEND = 4,
|
||||
SGXMKIF_CMD_CLEANUP = 5,
|
||||
SGXMKIF_CMD_GETMISCINFO = 6,
|
||||
SGXMKIF_CMD_PROCESS_QUEUES = 7,
|
||||
SGXMKIF_CMD_DATABREAKPOINT = 8,
|
||||
SGXMKIF_CMD_SETHWPERFSTATUS = 9,
|
||||
SGXMKIF_CMD_FLUSHPDCACHE = 10,
|
||||
SGXMKIF_CMD_MAX = 11,
|
||||
|
||||
SGXMKIF_CMD_FORCE_I32 = -1,
|
||||
|
||||
} SGXMKIF_CMD_TYPE;
|
||||
|
||||
|
||||
typedef struct _SGX_BRIDGE_INIT_INFO_
|
||||
{
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hKernelCCBMemInfo;
|
||||
IMG_SID hKernelCCBCtlMemInfo;
|
||||
IMG_SID hKernelCCBEventKickerMemInfo;
|
||||
IMG_SID hKernelSGXHostCtlMemInfo;
|
||||
IMG_SID hKernelSGXTA3DCtlMemInfo;
|
||||
#if defined(FIX_HW_BRN_31272) || defined(FIX_HW_BRN_31780) || defined(FIX_HW_BRN_33920)
|
||||
IMG_SID hKernelSGXPTLAWriteBackMemInfo;
|
||||
#endif
|
||||
IMG_SID hKernelSGXMiscMemInfo;
|
||||
#else
|
||||
IMG_HANDLE hKernelCCBMemInfo;
|
||||
IMG_HANDLE hKernelCCBCtlMemInfo;
|
||||
IMG_HANDLE hKernelCCBEventKickerMemInfo;
|
||||
IMG_HANDLE hKernelSGXHostCtlMemInfo;
|
||||
IMG_HANDLE hKernelSGXTA3DCtlMemInfo;
|
||||
#if defined(FIX_HW_BRN_31272) || defined(FIX_HW_BRN_31780) || defined(FIX_HW_BRN_33920)
|
||||
IMG_HANDLE hKernelSGXPTLAWriteBackMemInfo;
|
||||
#endif
|
||||
IMG_HANDLE hKernelSGXMiscMemInfo;
|
||||
#endif
|
||||
|
||||
IMG_UINT32 aui32HostKickAddr[SGXMKIF_CMD_MAX];
|
||||
|
||||
SGX_INIT_SCRIPTS sScripts;
|
||||
|
||||
IMG_UINT32 ui32ClientBuildOptions;
|
||||
SGX_MISCINFO_STRUCT_SIZES sSGXStructSizes;
|
||||
|
||||
#if defined(SGX_SUPPORT_HWPROFILING)
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hKernelHWProfilingMemInfo;
|
||||
#else
|
||||
IMG_HANDLE hKernelHWProfilingMemInfo;
|
||||
#endif
|
||||
#endif
|
||||
#if defined(SUPPORT_SGX_HWPERF)
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hKernelHWPerfCBMemInfo;
|
||||
#else
|
||||
IMG_HANDLE hKernelHWPerfCBMemInfo;
|
||||
#endif
|
||||
#endif
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hKernelTASigBufferMemInfo;
|
||||
IMG_SID hKernel3DSigBufferMemInfo;
|
||||
#else
|
||||
IMG_HANDLE hKernelTASigBufferMemInfo;
|
||||
IMG_HANDLE hKernel3DSigBufferMemInfo;
|
||||
#endif
|
||||
|
||||
#if defined(FIX_HW_BRN_29702)
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hKernelCFIMemInfo;
|
||||
#else
|
||||
IMG_HANDLE hKernelCFIMemInfo;
|
||||
#endif
|
||||
#endif
|
||||
#if defined(FIX_HW_BRN_29823)
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hKernelDummyTermStreamMemInfo;
|
||||
#else
|
||||
IMG_HANDLE hKernelDummyTermStreamMemInfo;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(FIX_HW_BRN_31542) || defined(FIX_HW_BRN_36513)
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hKernelClearClipWAVDMStreamMemInfo;
|
||||
IMG_SID hKernelClearClipWAIndexStreamMemInfo;
|
||||
IMG_SID hKernelClearClipWAPDSMemInfo;
|
||||
IMG_SID hKernelClearClipWAUSEMemInfo;
|
||||
IMG_SID hKernelClearClipWAParamMemInfo;
|
||||
IMG_SID hKernelClearClipWAPMPTMemInfo;
|
||||
IMG_SID hKernelClearClipWATPCMemInfo;
|
||||
IMG_SID hKernelClearClipWAPSGRgnHdrMemInfo;
|
||||
#else
|
||||
IMG_HANDLE hKernelClearClipWAVDMStreamMemInfo;
|
||||
IMG_HANDLE hKernelClearClipWAIndexStreamMemInfo;
|
||||
IMG_HANDLE hKernelClearClipWAPDSMemInfo;
|
||||
IMG_HANDLE hKernelClearClipWAUSEMemInfo;
|
||||
IMG_HANDLE hKernelClearClipWAParamMemInfo;
|
||||
IMG_HANDLE hKernelClearClipWAPMPTMemInfo;
|
||||
IMG_HANDLE hKernelClearClipWATPCMemInfo;
|
||||
IMG_HANDLE hKernelClearClipWAPSGRgnHdrMemInfo;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(SGX_FEATURE_VDM_CONTEXT_SWITCH) && defined(FIX_HW_BRN_31425)
|
||||
IMG_HANDLE hKernelVDMSnapShotBufferMemInfo;
|
||||
IMG_HANDLE hKernelVDMCtrlStreamBufferMemInfo;
|
||||
#endif
|
||||
#if defined(SGX_FEATURE_VDM_CONTEXT_SWITCH) && \
|
||||
defined(FIX_HW_BRN_33657) && defined(SUPPORT_SECURE_33657_FIX)
|
||||
IMG_HANDLE hKernelVDMStateUpdateBufferMemInfo;
|
||||
#endif
|
||||
#if defined(PVRSRV_USSE_EDM_STATUS_DEBUG)
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hKernelEDMStatusBufferMemInfo;
|
||||
#else
|
||||
IMG_HANDLE hKernelEDMStatusBufferMemInfo;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
IMG_UINT32 ui32EDMTaskReg0;
|
||||
IMG_UINT32 ui32EDMTaskReg1;
|
||||
|
||||
IMG_UINT32 ui32ClkGateCtl;
|
||||
IMG_UINT32 ui32ClkGateCtl2;
|
||||
IMG_UINT32 ui32ClkGateStatusReg;
|
||||
IMG_UINT32 ui32ClkGateStatusMask;
|
||||
#if defined(SGX_FEATURE_MP)
|
||||
IMG_UINT32 ui32MasterClkGateStatusReg;
|
||||
IMG_UINT32 ui32MasterClkGateStatusMask;
|
||||
IMG_UINT32 ui32MasterClkGateStatus2Reg;
|
||||
IMG_UINT32 ui32MasterClkGateStatus2Mask;
|
||||
#endif /* SGX_FEATURE_MP */
|
||||
|
||||
IMG_UINT32 ui32CacheControl;
|
||||
|
||||
IMG_UINT32 asInitDevData[SGX_MAX_DEV_DATA];
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID asInitMemHandles[SGX_MAX_INIT_MEM_HANDLES];
|
||||
#else
|
||||
IMG_HANDLE asInitMemHandles[SGX_MAX_INIT_MEM_HANDLES];
|
||||
#endif
|
||||
|
||||
} SGX_BRIDGE_INIT_INFO;
|
||||
|
||||
|
||||
typedef struct _SGX_DEVICE_SYNC_LIST_
|
||||
{
|
||||
PSGXMKIF_HWDEVICE_SYNC_LIST psHWDeviceSyncList;
|
||||
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hKernelHWSyncListMemInfo;
|
||||
#else
|
||||
IMG_HANDLE hKernelHWSyncListMemInfo;
|
||||
#endif
|
||||
PVRSRV_CLIENT_MEM_INFO *psHWDeviceSyncListClientMemInfo;
|
||||
PVRSRV_CLIENT_MEM_INFO *psAccessResourceClientMemInfo;
|
||||
|
||||
volatile IMG_UINT32 *pui32Lock;
|
||||
|
||||
struct _SGX_DEVICE_SYNC_LIST_ *psNext;
|
||||
|
||||
/* Must be the last variable in the structure */
|
||||
IMG_UINT32 ui32NumSyncObjects;
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID ahSyncHandles[1];
|
||||
#else
|
||||
IMG_HANDLE ahSyncHandles[1];
|
||||
#endif
|
||||
} SGX_DEVICE_SYNC_LIST, *PSGX_DEVICE_SYNC_LIST;
|
||||
|
||||
|
||||
typedef struct _SGX_INTERNEL_STATUS_UPDATE_
|
||||
{
|
||||
CTL_STATUS sCtlStatus;
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hKernelMemInfo;
|
||||
#else
|
||||
IMG_HANDLE hKernelMemInfo;
|
||||
#endif
|
||||
} SGX_INTERNEL_STATUS_UPDATE;
|
||||
|
||||
|
||||
typedef struct _SGX_CCB_KICK_
|
||||
{
|
||||
SGXMKIF_COMMAND sCommand;
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hCCBKernelMemInfo;
|
||||
#else
|
||||
IMG_HANDLE hCCBKernelMemInfo;
|
||||
#endif
|
||||
|
||||
IMG_UINT32 ui32NumDstSyncObjects;
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hKernelHWSyncListMemInfo;
|
||||
#else
|
||||
IMG_HANDLE hKernelHWSyncListMemInfo;
|
||||
#endif
|
||||
|
||||
/* DST syncs */
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID *pahDstSyncHandles;
|
||||
#else
|
||||
IMG_HANDLE *pahDstSyncHandles;
|
||||
#endif
|
||||
|
||||
IMG_UINT32 ui32NumTAStatusVals;
|
||||
IMG_UINT32 ui32Num3DStatusVals;
|
||||
|
||||
#if defined(SUPPORT_SGX_NEW_STATUS_VALS)
|
||||
SGX_INTERNEL_STATUS_UPDATE asTAStatusUpdate[SGX_MAX_TA_STATUS_VALS];
|
||||
SGX_INTERNEL_STATUS_UPDATE as3DStatusUpdate[SGX_MAX_3D_STATUS_VALS];
|
||||
#else
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID ahTAStatusSyncInfo[SGX_MAX_TA_STATUS_VALS];
|
||||
IMG_SID ah3DStatusSyncInfo[SGX_MAX_3D_STATUS_VALS];
|
||||
#else
|
||||
IMG_HANDLE ahTAStatusSyncInfo[SGX_MAX_TA_STATUS_VALS];
|
||||
IMG_HANDLE ah3DStatusSyncInfo[SGX_MAX_3D_STATUS_VALS];
|
||||
#endif
|
||||
#endif
|
||||
|
||||
IMG_BOOL bFirstKickOrResume;
|
||||
#if (defined(NO_HARDWARE) || defined(PDUMP))
|
||||
IMG_BOOL bTerminateOrAbort;
|
||||
#endif
|
||||
IMG_BOOL bLastInScene;
|
||||
|
||||
/* CCB offset of data structure associated with this kick */
|
||||
IMG_UINT32 ui32CCBOffset;
|
||||
|
||||
#if defined(SUPPORT_SGX_GENERALISED_SYNCOBJECTS)
|
||||
/* SRC and DST syncs */
|
||||
IMG_UINT32 ui32NumTASrcSyncs;
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID ahTASrcKernelSyncInfo[SGX_MAX_TA_SRC_SYNCS];
|
||||
#else
|
||||
IMG_HANDLE ahTASrcKernelSyncInfo[SGX_MAX_TA_SRC_SYNCS];
|
||||
#endif
|
||||
IMG_UINT32 ui32NumTADstSyncs;
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID ahTADstKernelSyncInfo[SGX_MAX_TA_DST_SYNCS];
|
||||
#else
|
||||
IMG_HANDLE ahTADstKernelSyncInfo[SGX_MAX_TA_DST_SYNCS];
|
||||
#endif
|
||||
IMG_UINT32 ui32Num3DSrcSyncs;
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID ah3DSrcKernelSyncInfo[SGX_MAX_3D_SRC_SYNCS];
|
||||
#else
|
||||
IMG_HANDLE ah3DSrcKernelSyncInfo[SGX_MAX_3D_SRC_SYNCS];
|
||||
#endif
|
||||
#else
|
||||
/* SRC syncs */
|
||||
IMG_UINT32 ui32NumSrcSyncs;
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID ahSrcKernelSyncInfo[SGX_MAX_SRC_SYNCS];
|
||||
#else
|
||||
IMG_HANDLE ahSrcKernelSyncInfo[SGX_MAX_SRC_SYNCS];
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* TA/3D dependency data */
|
||||
IMG_BOOL bTADependency;
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hTA3DSyncInfo;
|
||||
|
||||
IMG_SID hTASyncInfo;
|
||||
IMG_SID h3DSyncInfo;
|
||||
#else
|
||||
IMG_HANDLE hTA3DSyncInfo;
|
||||
|
||||
IMG_HANDLE hTASyncInfo;
|
||||
IMG_HANDLE h3DSyncInfo;
|
||||
#endif
|
||||
#if defined(PDUMP)
|
||||
IMG_UINT32 ui32CCBDumpWOff;
|
||||
#endif
|
||||
#if defined(NO_HARDWARE)
|
||||
IMG_UINT32 ui32WriteOpsPendingVal;
|
||||
#endif
|
||||
IMG_HANDLE hDevMemContext;
|
||||
} SGX_CCB_KICK;
|
||||
|
||||
|
||||
/*!
|
||||
******************************************************************************
|
||||
* shared client/kernel device information structure for SGX
|
||||
*****************************************************************************/
|
||||
#define SGX_KERNEL_USE_CODE_BASE_INDEX 15
|
||||
|
||||
|
||||
/*!
|
||||
******************************************************************************
|
||||
* Client device information structure for SGX
|
||||
*****************************************************************************/
|
||||
typedef struct _SGX_CLIENT_INFO_
|
||||
{
|
||||
IMG_UINT32 ui32ProcessID; /*!< ID of process controlling SGX device */
|
||||
IMG_VOID *pvProcess; /*!< pointer to OS specific 'process' structure */
|
||||
PVRSRV_MISC_INFO sMiscInfo; /*!< Misc. Information, inc. SOC specifics */
|
||||
|
||||
IMG_UINT32 asDevData[SGX_MAX_DEV_DATA];
|
||||
|
||||
} SGX_CLIENT_INFO;
|
||||
|
||||
/*!
|
||||
******************************************************************************
|
||||
* Internal device information structure for SGX
|
||||
*****************************************************************************/
|
||||
typedef struct _SGX_INTERNAL_DEVINFO_
|
||||
{
|
||||
IMG_UINT32 ui32Flags;
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hHostCtlKernelMemInfoHandle;
|
||||
#else
|
||||
IMG_HANDLE hHostCtlKernelMemInfoHandle;
|
||||
#endif
|
||||
IMG_BOOL bForcePTOff;
|
||||
} SGX_INTERNAL_DEVINFO;
|
||||
|
||||
|
||||
typedef struct _SGX_INTERNAL_DEVINFO_KM_
|
||||
{
|
||||
IMG_UINT32 ui32Flags;
|
||||
IMG_HANDLE hHostCtlKernelMemInfoHandle;
|
||||
IMG_BOOL bForcePTOff;
|
||||
} SGX_INTERNAL_DEVINFO_KM;
|
||||
|
||||
|
||||
#if defined(TRANSFER_QUEUE)
|
||||
typedef struct _PVRSRV_TRANSFER_SGX_KICK_
|
||||
{
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hCCBMemInfo;
|
||||
#else
|
||||
IMG_HANDLE hCCBMemInfo;
|
||||
#endif
|
||||
IMG_UINT32 ui32SharedCmdCCBOffset;
|
||||
|
||||
IMG_DEV_VIRTADDR sHWTransferContextDevVAddr;
|
||||
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hTASyncInfo;
|
||||
IMG_SID h3DSyncInfo;
|
||||
#else
|
||||
IMG_HANDLE hTASyncInfo;
|
||||
IMG_HANDLE h3DSyncInfo;
|
||||
#endif
|
||||
|
||||
IMG_UINT32 ui32NumSrcSync;
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID ahSrcSyncInfo[SGX_MAX_TRANSFER_SYNC_OPS];
|
||||
#else
|
||||
IMG_HANDLE ahSrcSyncInfo[SGX_MAX_TRANSFER_SYNC_OPS];
|
||||
#endif
|
||||
|
||||
IMG_UINT32 ui32NumDstSync;
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID ahDstSyncInfo[SGX_MAX_TRANSFER_SYNC_OPS];
|
||||
#else
|
||||
IMG_HANDLE ahDstSyncInfo[SGX_MAX_TRANSFER_SYNC_OPS];
|
||||
#endif
|
||||
|
||||
IMG_UINT32 ui32Flags;
|
||||
|
||||
IMG_UINT32 ui32PDumpFlags;
|
||||
#if defined(PDUMP)
|
||||
IMG_UINT32 ui32CCBDumpWOff;
|
||||
#endif
|
||||
IMG_HANDLE hDevMemContext;
|
||||
} PVRSRV_TRANSFER_SGX_KICK, *PPVRSRV_TRANSFER_SGX_KICK;
|
||||
|
||||
#if defined(SGX_FEATURE_2D_HARDWARE)
|
||||
#if defined(__psp2__)
|
||||
|
||||
typedef struct _PVRSRV_2D_SGX_KICK_
|
||||
{
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hCCBMemInfo;
|
||||
#else
|
||||
IMG_HANDLE hCCBMemInfo;
|
||||
#endif
|
||||
IMG_UINT32 ui32SharedCmdCCBOffset;
|
||||
|
||||
IMG_DEV_VIRTADDR sHW2DContextDevVAddr;
|
||||
|
||||
IMG_UINT32 ui32NumSrcSync;
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID ahSrcSyncInfo[SGX_MAX_2D_SRC_SYNC_OPS];
|
||||
|
||||
IMG_SID hExtSyncInfo;
|
||||
|
||||
/* need to be able to check reads and writes on TA ops, and update writes */
|
||||
IMG_SID hTASyncInfo;
|
||||
|
||||
/* need to be able to check reads and writes on 2D ops, and update writes */
|
||||
IMG_SID h3DSyncInfo;
|
||||
#else
|
||||
IMG_HANDLE ahSrcSyncInfo[SGX_MAX_2D_SRC_SYNC_OPS];
|
||||
|
||||
/* need to be able to check reads and writes on dest, and update writes */
|
||||
IMG_HANDLE hDstSyncInfo;
|
||||
|
||||
/* need to be able to check reads and writes on TA ops, and update writes */
|
||||
IMG_HANDLE hTASyncInfo;
|
||||
|
||||
/* need to be able to check reads and writes on 2D ops, and update writes */
|
||||
IMG_HANDLE h3DSyncInfo;
|
||||
#endif
|
||||
|
||||
IMG_UINT32 ui32NumDstSync;
|
||||
|
||||
IMG_UINT32 ui32PDumpFlags;
|
||||
#if defined(PDUMP)
|
||||
IMG_UINT32 ui32CCBDumpWOff;
|
||||
#endif
|
||||
IMG_HANDLE hDevMemContext;
|
||||
|
||||
IMG_SID ahDstSyncInfo[1];
|
||||
|
||||
} PVRSRV_2D_SGX_KICK, *PPVRSRV_2D_SGX_KICK;
|
||||
|
||||
#else
|
||||
|
||||
typedef struct _PVRSRV_2D_SGX_KICK_
|
||||
{
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hCCBMemInfo;
|
||||
#else
|
||||
IMG_HANDLE hCCBMemInfo;
|
||||
#endif
|
||||
IMG_UINT32 ui32SharedCmdCCBOffset;
|
||||
|
||||
IMG_DEV_VIRTADDR sHW2DContextDevVAddr;
|
||||
|
||||
IMG_UINT32 ui32NumSrcSync;
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID ahSrcSyncInfo[SGX_MAX_2D_SRC_SYNC_OPS];
|
||||
|
||||
/* need to be able to check reads and writes on dest, and update writes */
|
||||
IMG_SID hDstSyncInfo;
|
||||
|
||||
/* need to be able to check reads and writes on TA ops, and update writes */
|
||||
IMG_SID hTASyncInfo;
|
||||
|
||||
/* need to be able to check reads and writes on 2D ops, and update writes */
|
||||
IMG_SID h3DSyncInfo;
|
||||
#else
|
||||
IMG_HANDLE ahSrcSyncInfo[SGX_MAX_2D_SRC_SYNC_OPS];
|
||||
|
||||
/* need to be able to check reads and writes on dest, and update writes */
|
||||
IMG_HANDLE hDstSyncInfo;
|
||||
|
||||
/* need to be able to check reads and writes on TA ops, and update writes */
|
||||
IMG_HANDLE hTASyncInfo;
|
||||
|
||||
/* need to be able to check reads and writes on 2D ops, and update writes */
|
||||
IMG_HANDLE h3DSyncInfo;
|
||||
#endif
|
||||
|
||||
IMG_UINT32 ui32PDumpFlags;
|
||||
#if defined(PDUMP)
|
||||
IMG_UINT32 ui32CCBDumpWOff;
|
||||
#endif
|
||||
IMG_HANDLE hDevMemContext;
|
||||
} PVRSRV_2D_SGX_KICK, *PPVRSRV_2D_SGX_KICK;
|
||||
|
||||
#endif
|
||||
#endif /* defined(SGX_FEATURE_2D_HARDWARE) */
|
||||
#endif /* defined(TRANSFER_QUEUE) */
|
||||
|
||||
|
||||
#endif /* __SGXINFO_H__ */
|
||||
/******************************************************************************
|
||||
End of file (sgxinfo.h)
|
||||
******************************************************************************/
|
@ -0,0 +1,700 @@
|
||||
/*!****************************************************************************
|
||||
@File sgxinfo_client.h
|
||||
|
||||
@Title sgx services structures/functions
|
||||
|
||||
@Author Imagination Technologies
|
||||
|
||||
@Date 30th Jan 2008
|
||||
|
||||
@Copyright Copyright 2003-2009 by Imagination Technologies Limited.
|
||||
All rights reserved. No part of this software, either material
|
||||
or conceptual may be copied or distributed, transmitted,
|
||||
transcribed, stored in a retrieval system or translated into
|
||||
any human or computer language in any form by any means,
|
||||
electronic, mechanical, manual or otherwise, or disclosed to
|
||||
third parties without the express written permission of
|
||||
Imagination Technologies Limited, Home Park Estate,
|
||||
Kings Langley, Hertfordshire, WD4 8LZ, U.K.
|
||||
|
||||
@Platform Generic
|
||||
|
||||
@Description inline functions/structures shared across UM and KM services components
|
||||
|
||||
@DoxygenVer
|
||||
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
Modifications :-
|
||||
$Log: sgxinfo_client.h $
|
||||
*****************************************************************************/
|
||||
#if !defined (__SGXINFO_CLIENT_H__)
|
||||
#define __SGXINFO_CLIENT_H__
|
||||
|
||||
#include "sgx_mkif_client.h"
|
||||
|
||||
|
||||
#if defined(SGX543) || defined(SGX544)
|
||||
/*
|
||||
EUR_CR_DMS_CTRL / EUR_CR_PDS_DMS_CTRL2 config(SGX543, 544):
|
||||
----------------------------------------------
|
||||
tile size is 32 x 32 (1024 pixels)
|
||||
1 partition is 128 DWORDs, 4 x USSE pipes, 16x16 pixels per pipe
|
||||
Based on number of dwords for each pipe (256, 512) for single/double
|
||||
the minimum allocation granularity are 2 and 4 contiguous
|
||||
pixel partitions respectively for single and double pixels
|
||||
Vertex partition allocation granularity is 1
|
||||
|
||||
When in SPM, the vertex partitions are not freed until a
|
||||
resume or restart, therefore, we guard for fragmentation
|
||||
max_num_contig_partitions = ceil ( partitions_available / (max_vertex_paritions + 1) )
|
||||
where partitions_available == max_partitions - max_vertex_partitions
|
||||
|
||||
The choice of 9 for total output partitions is based on
|
||||
(8 for pixel + 1 for vertex).
|
||||
|
||||
when the PDS threshold is reached the microkernel will lower the max_vertex_partitions
|
||||
to 1 if the SUPPORT_SGX_DOUBLE_PIXEL_PARTITIONS is enabled
|
||||
*/
|
||||
|
||||
#if defined(SUPPORT_SGX_DOUBLE_PIXEL_PARTITIONS)
|
||||
#define SGX_DEFAULT_MAX_NUM_VERTEX_PARTITIONS 3
|
||||
#define SGX_DEFAULT_MAX_NUM_PIXEL_PARTITIONS 8
|
||||
#define SGX_DEFAULT_SPM_MAX_NUM_VERTEX_PARTITIONS 1
|
||||
#else
|
||||
#define SGX_DEFAULT_MAX_NUM_VERTEX_PARTITIONS 3
|
||||
#define SGX_DEFAULT_MAX_NUM_PIXEL_PARTITIONS 8
|
||||
#define SGX_DEFAULT_SPM_MAX_NUM_VERTEX_PARTITIONS 3
|
||||
#endif
|
||||
#else
|
||||
#if defined(SGX554)
|
||||
#define SGX_DEFAULT_MAX_NUM_VERTEX_PARTITIONS 3
|
||||
#define SGX_DEFAULT_MAX_NUM_PIXEL_PARTITIONS 8
|
||||
#define SGX_DEFAULT_SPM_MAX_NUM_VERTEX_PARTITIONS 3
|
||||
#else
|
||||
#if defined(SGX545)
|
||||
/* This is moving the magic number that
|
||||
* were in the code unmodified to defines to start with */
|
||||
#define SGX_MAX_VERTEX_PARTITIONS_CHECK_COMPLEX_GEOMETRY
|
||||
#define SGX_MAX_VERTEX_PARTITIONS_COMPLEX_GEOMETRY_REDUCTION 2
|
||||
/* The if else have same values, this is in anticipation of
|
||||
* different configuration based on DOUBLE_PIXELs */
|
||||
#if defined(SUPPORT_SGX_DOUBLE_PIXEL_PARTITIONS)
|
||||
#define SGX_DEFAULT_MAX_NUM_VERTEX_PARTITIONS 10
|
||||
#define SGX_DEFAULT_MAX_NUM_PIXEL_PARTITIONS 31
|
||||
#define SGX_DEFAULT_SPM_MAX_NUM_VERTEX_PARTITIONS 10
|
||||
#else
|
||||
#define SGX_DEFAULT_MAX_NUM_VERTEX_PARTITIONS 10
|
||||
#define SGX_DEFAULT_MAX_NUM_PIXEL_PARTITIONS 31
|
||||
#define SGX_DEFAULT_SPM_MAX_NUM_VERTEX_PARTITIONS 10
|
||||
#endif
|
||||
#else
|
||||
#if defined(SGX535)
|
||||
#define SGX_DEFAULT_MAX_NUM_VERTEX_PARTITIONS 4
|
||||
#define SGX_DEFAULT_MAX_NUM_PIXEL_PARTITIONS 4
|
||||
#define SGX_DEFAULT_SPM_MAX_NUM_VERTEX_PARTITIONS 4
|
||||
#else
|
||||
#if defined(SGX540)
|
||||
#define SGX_MAX_PIXEL_PARTITIONS_CHECK_MSAA
|
||||
#define SGX_MAX_PIXEL_PARTITIONS_MSAA_REDUCTION 4
|
||||
#define SGX_DEFAULT_MAX_NUM_VERTEX_PARTITIONS 4
|
||||
#define SGX_DEFAULT_MAX_NUM_PIXEL_PARTITIONS 6
|
||||
#define SGX_DEFAULT_SPM_MAX_NUM_VERTEX_PARTITIONS 4
|
||||
#else
|
||||
/* See BRN20913 */
|
||||
#define SGX_MAX_PIXEL_PARTITIONS_CHECK_MSAA
|
||||
#define SGX_MAX_PIXEL_PARTITIONS_MSAA_REDUCTION 2
|
||||
#define SGX_DEFAULT_MAX_NUM_PIXEL_PARTITIONS 6
|
||||
#if defined(FIX_HW_BRN_32302)
|
||||
#define SGX_DEFAULT_MAX_NUM_VERTEX_PARTITIONS 2
|
||||
#define SGX_DEFAULT_SPM_MAX_NUM_VERTEX_PARTITIONS 2
|
||||
#else
|
||||
#define SGX_DEFAULT_MAX_NUM_VERTEX_PARTITIONS 4
|
||||
#define SGX_DEFAULT_SPM_MAX_NUM_VERTEX_PARTITIONS 4
|
||||
#endif
|
||||
#endif /* SGX540 */
|
||||
#endif /* SGX535 */
|
||||
#endif /*SGX545 */
|
||||
#endif /* 554 */
|
||||
#endif
|
||||
|
||||
/*!
|
||||
******************************************************************************
|
||||
* per context CCB control structure for SGX
|
||||
*****************************************************************************/
|
||||
typedef struct _SGX_CLIENT_CCB_
|
||||
{
|
||||
PVRSRV_CLIENT_MEM_INFO *psCCBClientMemInfo; /*!< meminfo for CCB in device accessible memory */
|
||||
PVRSRV_CLIENT_MEM_INFO *psCCBCtlClientMemInfo; /*!< meminfo for CCB control in device accessible memory */
|
||||
IMG_UINT32 *pui32CCBLinAddr; /*!< linear address of the buffer */
|
||||
IMG_DEV_VIRTADDR sCCBDevAddr; /*!< device virtual address of the buffer */
|
||||
IMG_UINT32 *pui32WriteOffset; /*!< linear address of the write offset into array of commands */
|
||||
volatile IMG_UINT32 *pui32ReadOffset; /*!< linear address of the read offset into array of commands */
|
||||
IMG_UINT32 ui32Size; /*!< ((Size of the buffer) - (overrun size)) */
|
||||
IMG_UINT32 ui32AllocGran; /*!< Allocation granularity */
|
||||
|
||||
#ifdef PDUMP
|
||||
IMG_UINT32 ui32CCBDumpWOff; /*!< for pdumping */
|
||||
#endif
|
||||
}SGX_CLIENT_CCB;
|
||||
|
||||
/*!
|
||||
*****************************************************************************
|
||||
* SGXPBRTA data
|
||||
*****************************************************************************/
|
||||
/* Indicates this parameter buffer can be shared between rendering contexts */
|
||||
#define SGX_PBDESCFLAGS_SHARED 0x00000001UL
|
||||
/* indicates whether the values have been over-ridden */
|
||||
#define SGX_PBDESCFLAGS_TA_OVERRIDE 0x00000002UL
|
||||
#define SGX_PBDESCFLAGS_ZLS_OVERRIDE 0x00000004UL
|
||||
#define SGX_PBDESCFLAGS_GLOBAL_OVERRIDE 0x00000008UL
|
||||
#define SGX_PBDESCFLAGS_PDS_OVERRIDE 0x00000010UL
|
||||
#define SGX_PBDESCFLAGS_THRESHOLD_UPDATE_PENDING 0x00000020UL
|
||||
#if defined(FORCE_ENABLE_GROW_SHRINK) && defined(SUPPORT_PERCONTEXT_PB)
|
||||
#define SGX_PBDESCFLAGS_GROW_PENDING 0x00000040UL
|
||||
#define SGX_PBDESCFLAGS_SHRINK_PENDING 0x00000080UL
|
||||
#define SGX_PBDESCFLAGS_SHRINK_QUEUED 0x00000100UL
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
/* PB Memblock flags */
|
||||
#define PBMEM_FLAGS_BLOCKFREE 0x00000001UL
|
||||
|
||||
/* RT Data Set flags */
|
||||
#define SGX_RTDSFLAGS_OPENGL 0x00000001UL
|
||||
#define SGX_RTDSFLAGS_DPMZLS 0x00000002UL
|
||||
|
||||
|
||||
/* Host parameter buffer block */
|
||||
typedef struct _SGX_PBBLOCK_
|
||||
{
|
||||
/* size of block in pages */
|
||||
IMG_UINT32 ui32PageCount;
|
||||
/* index of head of block */
|
||||
IMG_UINT16 ui16Head;
|
||||
/* index of tail of block */
|
||||
IMG_UINT16 ui16Tail;
|
||||
|
||||
/* info for the PB memory */
|
||||
PVRSRV_CLIENT_MEM_INFO *psPBClientMemInfo;
|
||||
|
||||
/* info for HW PB Block */
|
||||
PVRSRV_CLIENT_MEM_INFO *psHWPBBlockClientMemInfo;
|
||||
SGXMKIF_HWPBBLOCK *psHWPBBlock;
|
||||
IMG_DEV_VIRTADDR sHWPBBlockDevVAddr;
|
||||
|
||||
/* ptr to parent PB Desc */
|
||||
struct _SGX_PBDESC_ *psParentPBDesc;
|
||||
/* ptr to next PB Block */
|
||||
struct _SGX_PBBLOCK_ *psPrev;
|
||||
/* ptr to next PB Block */
|
||||
struct _SGX_PBBLOCK_ *psNext;
|
||||
} SGX_PBBLOCK, *PSGX_PBBLOCK;
|
||||
|
||||
/*
|
||||
* if SUPPORT_PERCONTEXT_PB then this is a per client structure.
|
||||
* if the PB is shared then this is mapped from the kernel.
|
||||
*/
|
||||
typedef struct _SGX_PBDESC_
|
||||
{
|
||||
IMG_UINT32 ui32Flags;
|
||||
|
||||
IMG_UINT32 ui32TotalPBSize; /*!< Size of parameter buffer in bytes */
|
||||
IMG_UINT32 ui32NumPages; /*!< Size of parameter buffer in pages (incl. reserve pages) */
|
||||
|
||||
IMG_UINT32 ui32FreeListInitialHT;
|
||||
IMG_UINT32 ui32FreeListInitialPrev;
|
||||
|
||||
IMG_UINT32 ui32TAThreshold; /*!< Number of pages allocated before almost
|
||||
out of memory interrupt */
|
||||
IMG_UINT32 ui32ZLSThreshold; /*!< Number of pages allocated before completely
|
||||
out of memory interrupt */
|
||||
IMG_UINT32 ui32GlobalThreshold;/*!< Number of pages allocated to global
|
||||
list before Global out of memory
|
||||
interrupt */
|
||||
IMG_UINT32 ui32PDSThreshold; /*!< Number of pages allocated before PDS stops
|
||||
double buffering of output buffers */
|
||||
|
||||
IMG_DEV_VIRTADDR sParamHeapBaseDevVAddr; /*!< device virtual address of base of
|
||||
base of param buffer */
|
||||
IMG_DEV_VIRTADDR sHWPBDescDevVAddr;
|
||||
|
||||
SGX_PBBLOCK *psListPBBlockHead;
|
||||
SGX_PBBLOCK *psListPBBlockTail;
|
||||
#if defined(FORCE_ENABLE_GROW_SHRINK) && defined(SUPPORT_PERCONTEXT_PB)
|
||||
SGX_PBBLOCK *psGrowListPBBlockHead;
|
||||
SGX_PBBLOCK *psGrowListPBBlockTail;
|
||||
SGX_PBBLOCK *psShrinkListPBBlock;
|
||||
|
||||
IMG_UINT32 ui32BusySceneCount;
|
||||
IMG_UINT32 ui32RenderCount;
|
||||
IMG_UINT32 ui32ShrinkRender;
|
||||
IMG_UINT32 ui32PBSizeLimit;
|
||||
IMG_UINT32 ui32PBGrowBlockSize;
|
||||
|
||||
#if defined(PDUMP)
|
||||
IMG_BOOL bPdumpRequired;
|
||||
IMG_UINT32 ui32PdumpNumPages; /*!< Size of parameter buffer in pages */
|
||||
IMG_UINT32 ui32PdumpFreeListInitialHT;
|
||||
IMG_UINT32 ui32PdumpFreeListInitialPrev;
|
||||
IMG_UINT32 ui32PdumpTAThreshold; /*!< Number of pages allocated before almost
|
||||
out of memory interrupt */
|
||||
IMG_UINT32 ui32PdumpZLSThreshold; /*!< Number of pages allocated before completely
|
||||
out of memory interrupt */
|
||||
IMG_UINT32 ui32PdumpGlobalThreshold; /*!< Number of pages allocated to global
|
||||
list before Global out of memory interrupt */
|
||||
IMG_UINT32 ui32PdumpPDSThreshold; /*!< Number of pages allocated before PDS stops
|
||||
double buffering of output buffers */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
SGXMKIF_HWPBDESC *psHWPBDesc;
|
||||
IMG_BOOL bPerContextPB;
|
||||
IMG_BOOL bGrowShrink;
|
||||
} SGX_PBDESC;
|
||||
|
||||
|
||||
/*
|
||||
* Per app info about the PB
|
||||
*/
|
||||
typedef struct _SGX_CLIENTPBDESC_
|
||||
{
|
||||
#if defined(SUPPORT_SHARED_PB)
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hSharedPBDesc;
|
||||
#else
|
||||
IMG_HANDLE hSharedPBDesc;
|
||||
#endif
|
||||
#endif
|
||||
PVRSRV_CLIENT_MEM_INFO *psPBDescClientMemInfo;
|
||||
PVRSRV_CLIENT_MEM_INFO *psHWPBDescClientMemInfo;
|
||||
PVRSRV_CLIENT_MEM_INFO *psEVMPageTableClientMemInfo;
|
||||
#if defined(SUPPORT_SHARED_PB)
|
||||
PVRSRV_CLIENT_MEM_INFO *psBlockClientMemInfo;
|
||||
PVRSRV_CLIENT_MEM_INFO *psHWBlockClientMemInfo;
|
||||
#endif
|
||||
|
||||
SGX_PBDESC *psPBDesc;
|
||||
} SGX_CLIENTPBDESC;
|
||||
|
||||
|
||||
/**
|
||||
* Host side render details control
|
||||
*/
|
||||
typedef struct _SGX_RENDERDETAILS_
|
||||
{
|
||||
|
||||
PSGXMKIF_HWRENDERDETAILS psHWRenderDetails;
|
||||
|
||||
PVRSRV_CLIENT_MEM_INFO *psHWRenderDetailsClientMemInfo;
|
||||
PVRSRV_CLIENT_MEM_INFO *psAccessResourceClientMemInfo;
|
||||
|
||||
volatile IMG_UINT32 *pui32Lock;
|
||||
|
||||
SGXMKIF_3DREGISTERS s3DRegs; /*!< Last register values sent from the
|
||||
driver - can be used to check if any
|
||||
values need updating */
|
||||
#if defined(SGX_FEATURE_RENDER_TARGET_ARRAYS)
|
||||
PVRSRV_CLIENT_MEM_INFO *psHWPixEventUpdateListClientMemInfo;
|
||||
IMG_UINT32 *psHWPixEventUpdateList;
|
||||
|
||||
PVRSRV_CLIENT_MEM_INFO *psHWBgObjPrimPDSUpdateListClientMemInfo;
|
||||
IMG_UINT32 *psHWBgObjPrimPDSUpdateList;
|
||||
#endif
|
||||
#if defined(NO_HARDWARE)
|
||||
IMG_UINT32 ui32WriteOpsPendingVal;
|
||||
#endif
|
||||
struct _SGX_RENDERDETAILS_ *psNext;
|
||||
} SGX_RENDERDETAILS, *PSGX_RENDERDETAILS;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Host side per target size data.
|
||||
*/
|
||||
typedef struct _SGX_RTDATA_
|
||||
{
|
||||
PVRSRV_CLIENT_MEM_INFO *apsRgnHeaderClientMemInfo[SGX_FEATURE_MP_CORE_COUNT_TA]; /*!< meminfo for region headers */
|
||||
PVRSRV_CLIENT_MEM_INFO *psContextStateClientMemInfo; /*!< meminfo for context state */
|
||||
|
||||
#if !defined(SGX_FEATURE_ISP_BREAKPOINT_RESUME_REV_2) && !defined(FIX_HW_BRN_23761) && !defined(SGX_FEATURE_VISTEST_IN_MEMORY)
|
||||
PVRSRV_CLIENT_MEM_INFO *psTileRgnLUTClientMemInfo; /*!< LUT for the address of each tile's region header */
|
||||
#endif
|
||||
|
||||
#if defined(SGX_FEATURE_SW_ISP_CONTEXT_SWITCH) || defined(FIX_HW_BRN_23862) || defined(FIX_HW_BRN_30089) || defined(FIX_HW_BRN_29504) \
|
||||
|| defined(FIX_HW_BRN_33753)
|
||||
PVRSRV_CLIENT_MEM_INFO *psLastRgnLUTClientMemInfo;
|
||||
#endif /* defined(FIX_HW_BRN_23862) */
|
||||
#if defined(SGX_FEATURE_RENDER_TARGET_ARRAYS)
|
||||
PVRSRV_CLIENT_MEM_INFO *psStatusClientMemInfo;
|
||||
#endif
|
||||
IMG_UINT32 ui32BGObjU;
|
||||
IMG_UINT32 ui32BGObjV;
|
||||
IMG_UINT32 ui32BGObjPtr1;
|
||||
IMG_UINT32 ui32BGObjPtr2;
|
||||
IMG_UINT32 ui32BGObjTexPtr;
|
||||
IMG_UINT32 ui32BGObjObjPtr;
|
||||
IMG_UINT32 ui32BGObjBlendPtr;
|
||||
volatile IMG_UINT32 *pui32RTStatus;
|
||||
} SGX_RTDATA, *PSGX_RTDATA;
|
||||
|
||||
/* forward reference */
|
||||
typedef struct _SGX_RENDERCONTEXT_ SGX_RENDERCONTEXT;
|
||||
typedef struct _SGX_RENDERCONTEXT_ *PSGX_RENDERCONTEXT;
|
||||
|
||||
|
||||
/**
|
||||
* Higher level host structure combining two copies of above structures
|
||||
* with the actual dimensions.
|
||||
*/
|
||||
typedef struct _SGX_RTDATASET_
|
||||
{
|
||||
PVRSRV_MUTEX_HANDLE hMutex;
|
||||
IMG_UINT32 ui32Flags;
|
||||
IMG_UINT32 ui32NumPixelsX;
|
||||
IMG_UINT32 ui32NumPixelsY;
|
||||
IMG_UINT32 ui323DAAMode;
|
||||
IMG_UINT32 ui32MTEMultiSampleCtl;
|
||||
IMG_UINT32 ui32ISPMultiSampleCtl;
|
||||
#if defined(EUR_CR_ISP_MULTISAMPLECTL2)
|
||||
IMG_UINT32 ui32ISPMultiSampleCtl2;
|
||||
#endif
|
||||
IMG_UINT16 ui16MSAASamplesInX;
|
||||
IMG_UINT16 ui16MSAASamplesInY;
|
||||
SGX_SCALING eScalingInX;
|
||||
SGX_SCALING eScalingInY;
|
||||
PVRSRV_ROTATION eRotation;
|
||||
IMG_UINT32 ui32BGObjUCoord;
|
||||
IMG_UINT32 ui32MTileNumber;
|
||||
IMG_UINT32 ui32MTileX1;
|
||||
IMG_UINT32 ui32MTileX2;
|
||||
IMG_UINT32 ui32MTileX3;
|
||||
IMG_UINT32 ui32MTileY1;
|
||||
IMG_UINT32 ui32MTileY2;
|
||||
IMG_UINT32 ui32MTileY3;
|
||||
IMG_UINT32 ui32ScreenXMax;
|
||||
IMG_UINT32 ui32ScreenYMax;
|
||||
IMG_UINT32 ui32MTileStride;
|
||||
IMG_UINT32 ui32RTDataSel; /*!< Used by host to decide which data set to select */
|
||||
IMG_UINT32 ui32RefCount; /*!< Reference count of targets using this size data */
|
||||
IMG_UINT16 ui16NumRTsInArray;
|
||||
#if defined(SGX_FEATURE_RENDER_TARGET_ARRAYS)
|
||||
IMG_UINT32 ui32TPCStride;
|
||||
IMG_UINT32 ui32RgnPageStride;
|
||||
#endif
|
||||
#if defined(FIX_HW_BRN_23862)
|
||||
IMG_DEV_VIRTADDR sBRN23862FixObjectDevAddr;
|
||||
IMG_DEV_VIRTADDR sBRN23862PDSStateDevAddr;
|
||||
#endif /* defined(FIX_HW_BRN_23862) */
|
||||
SGXMKIF_HWRTDATASET *psHWRTDataSet; /*!< Pointer to an HW size data set. */
|
||||
IMG_UINT32 ui32NumRTData; /*!< Number of HW rtdata */
|
||||
SGX_RTDATA *psRTData; /*!< Pointer to array containing ui32NumRTData elements */
|
||||
PVRSRV_CLIENT_MEM_INFO *psHWRTDataSetClientMemInfo;
|
||||
PVRSRV_CLIENT_MEM_INFO *psPendingCountClientMemInfo;
|
||||
IMG_UINT32 *pui32PendingCount;
|
||||
PVRSRV_CLIENT_MEM_INFO *apsTailPtrsClientMemInfo[SGX_FEATURE_MP_CORE_COUNT_TA];
|
||||
PVRSRV_CLIENT_MEM_INFO *psContextControlClientMemInfo[SGX_FEATURE_MP_CORE_COUNT_TA];
|
||||
PVRSRV_CLIENT_MEM_INFO *psContextOTPMClientMemInfo[SGX_FEATURE_MP_CORE_COUNT_TA];
|
||||
PVRSRV_CLIENT_MEM_INFO *psSpecialObjClientMemInfo;
|
||||
#if defined(SGX_FEATURE_MP)
|
||||
#if defined(EUR_CR_MASTER_DPM_MTILE_PARTI_PIM_TABLE_BASE_ADDR)
|
||||
PVRSRV_CLIENT_MEM_INFO *psPIMTableClientMemInfo;
|
||||
#endif
|
||||
#endif
|
||||
struct _SGX_RTDATASET_ *psNext;
|
||||
volatile IMG_UINT32 *pui32UserModeFlagsPtr;
|
||||
SGX_RENDERDETAILS *psRenderDetailsList;
|
||||
SGX_RENDERDETAILS *psCurrentRenderDetails; /*!< Render details used for rendering */
|
||||
SGX_DEVICE_SYNC_LIST *psDeviceSyncList;
|
||||
SGX_DEVICE_SYNC_LIST *psCurrentDeviceSyncList; /*!< Render details used for rendering */
|
||||
SGX_RENDERCONTEXT *psRenderContext; /*!< Back-pointer to containing render context */
|
||||
IMG_HANDLE hResItem; /*!< Resource Manager handle */
|
||||
#if defined(PDUMP)
|
||||
#if defined(NO_HARDWARE)
|
||||
SGX_RENDERDETAILS *psLastFreedRenderDetails;
|
||||
SGX_DEVICE_SYNC_LIST *psLastFreedDeviceSyncList;
|
||||
#endif /* NO_HARDWARE */
|
||||
IMG_UINT32 ui32PDumpPendingCount;
|
||||
#endif /* PDUMP */
|
||||
|
||||
#if defined(FIX_HW_BRN_32044)
|
||||
PVRSRV_CLIENT_MEM_INFO *ps32044CtlStrmClientMemInfo;
|
||||
PVRSRV_CLIENT_MEM_INFO *ps32044PDSPrgClientMemInfo;
|
||||
#endif
|
||||
|
||||
} SGX_RTDATASET, *PSGX_RTDATASET;
|
||||
|
||||
|
||||
/* Registry TA Kick flags */
|
||||
#define PVRSRV_SGX_TAREGFLAGS_FORCEPSGPADZER0 0x00000002
|
||||
#define PVRSRV_SGX_TAREGFLAGS_TACOMPLETESYNC 0x00000004
|
||||
#define PVRSRV_SGX_TAREGFLAGS_RENDERSYNC 0x00000008
|
||||
|
||||
/**
|
||||
* Render context control struct.
|
||||
*/
|
||||
struct _SGX_RENDERCONTEXT_
|
||||
{
|
||||
PVRSRV_MUTEX_HANDLE hMutex; /*!< Mutex to hold whilst modifying this structure. */
|
||||
|
||||
SGX_CLIENTPBDESC *psClientPBDesc; /*!< Parameter buffer */
|
||||
|
||||
/* It doesn't look like this is used? */
|
||||
PSGX_RTDATASET psRTDataSets; /*!< Pointer to linked list of render target data sets */
|
||||
SGX_CLIENT_CCB *psTACCB; /*!< Pointer to circular command buffer */
|
||||
IMG_DEV_VIRTADDR sHWRenderContextDevVAddr;
|
||||
|
||||
/* Sync info for 3D/TA dependencies */
|
||||
PVRSRV_CLIENT_MEM_INFO *psTA3DSyncObjectMemInfo;
|
||||
PVRSRV_CLIENT_SYNC_INFO *psTA3DSyncObject;
|
||||
|
||||
#if defined(SGX_FEATURE_MASTER_VDM_CONTEXT_SWITCH)
|
||||
PPVRSRV_CLIENT_MEM_INFO psMasterVDMSnapShotBufferMemInfo;
|
||||
#endif
|
||||
#if defined(SGX_FEATURE_SLAVE_VDM_CONTEXT_SWITCH)
|
||||
PPVRSRV_CLIENT_MEM_INFO psVDMSnapShotBufferMemInfo[SGX_FEATURE_MP_CORE_COUNT_TA];
|
||||
#endif
|
||||
#if defined(SGX_FEATURE_VDM_CONTEXT_SWITCH)
|
||||
#if defined(SGX_FEATURE_MTE_STATE_FLUSH)
|
||||
#if defined(SGX_FEATURE_MASTER_VDM_CONTEXT_SWITCH) && defined(SGX_FEATURE_SLAVE_VDM_CONTEXT_SWITCH)
|
||||
PVRSRV_CLIENT_MEM_INFO *psMTEStateFlushMemInfo[SGX_FEATURE_MP_CORE_COUNT_TA];
|
||||
#else
|
||||
PVRSRV_CLIENT_MEM_INFO *psMTEStateFlushMemInfo[1];
|
||||
#endif
|
||||
#endif
|
||||
#if defined(SGX_FEATURE_USE_SA_COUNT_REGISTER)
|
||||
PVRSRV_CLIENT_MEM_INFO *psSABufferMemInfo;
|
||||
#endif
|
||||
#endif
|
||||
#if defined(SGX_FEATURE_ISP_CONTEXT_SWITCH)
|
||||
PVRSRV_CLIENT_MEM_INFO *apsPDSCtxSwitchMemInfo[SGX_FEATURE_MP_CORE_COUNT_3D][SGX_FEATURE_NUM_PDS_PIPES]; /*!< meminfo for PDS state on ISP ctx switch */
|
||||
PVRSRV_CLIENT_MEM_INFO *psZLSCtxSwitchMemInfo[SGX_FEATURE_MP_CORE_COUNT_3D]; /*!< meminfo for ZLS tile on ISP ctx switch */
|
||||
#endif
|
||||
#if defined(SGX_SCRATCH_PRIM_BLOCK_ENABLE)
|
||||
PPVRSRV_CLIENT_MEM_INFO psScratchPrimBlockClientMemInfo; /*!< Mem info for scratch primitive block
|
||||
potentially used if a render is interrupted */
|
||||
#endif
|
||||
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hDevMemContext;
|
||||
IMG_SID hTQContext;
|
||||
#else
|
||||
IMG_HANDLE hDevMemContext;
|
||||
IMG_HANDLE hTQContext;
|
||||
#endif
|
||||
#ifdef PDUMP
|
||||
IMG_BOOL bPDumped; /*!< Flags whether or not context has been pdumped */
|
||||
#endif
|
||||
PPVRSRV_CLIENT_MEM_INFO psVisTestResultClientMemInfo; /*!< Mem Info for visability test results. */
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hHWRenderContext; /*!< HW render context registration handle */
|
||||
#else
|
||||
IMG_HANDLE hHWRenderContext; /*!< HW render context registration handle */
|
||||
#endif
|
||||
/* Copies of some items from SGX device information structure */
|
||||
IMG_BOOL bForcePTOff;
|
||||
IMG_UINT32 ui32TAKickRegFlags;
|
||||
#if defined(PDUMP)
|
||||
IMG_UINT32 ui32KickTANum; /*!< TA Num since last render */
|
||||
IMG_UINT32 ui32RenderNum; /*!< Render num for pdumping */
|
||||
#endif /* PDUMP */
|
||||
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_EVENTSID hOSEvent;
|
||||
#else
|
||||
IMG_HANDLE hOSEvent;
|
||||
#endif
|
||||
|
||||
#if defined(DEBUG)
|
||||
IMG_UINT32 ui32LastKickFlags;
|
||||
#endif
|
||||
|
||||
#if defined(SUPPORT_SGX_PRIORITY_SCHEDULING)
|
||||
IMG_BOOL bKickSubmitted;
|
||||
IMG_BOOL bPrioritySet;
|
||||
SGX_CONTEXT_PRIORITY ePriority;
|
||||
#endif
|
||||
|
||||
/* Used when apphints are set to override default values */
|
||||
IMG_UINT32 ui32NumPixelPartitions;
|
||||
IMG_UINT32 ui32NumVertexPartitions;
|
||||
|
||||
IMG_BOOL bPerContextPB;
|
||||
};
|
||||
|
||||
typedef struct _SGX_KICKTAKM_
|
||||
{
|
||||
SGX_KICKTA_COMMON *psKickTACommon;
|
||||
|
||||
PVRSRV_CLIENT_SYNC_INFO *psRenderSurfSyncInfo;
|
||||
#if defined(SUPPORT_SGX_NEW_STATUS_VALS)
|
||||
CTL_STATUS asTAStatusUpdate[SGX_MAX_TA_STATUS_VALS];
|
||||
CTL_STATUS as3DStatusUpdate[SGX_MAX_3D_STATUS_VALS];
|
||||
#else
|
||||
PVRSRV_CLIENT_SYNC_INFO *apsTAStatusInfo[SGX_MAX_TA_STATUS_VALS];
|
||||
PVRSRV_CLIENT_SYNC_INFO *aps3DStatusInfo[SGX_MAX_3D_STATUS_VALS];
|
||||
#endif
|
||||
|
||||
} SGX_KICKTAKM, *PSGX_KICKTAKM;
|
||||
|
||||
/*
|
||||
KICKTA_SUBMIT struct stores info needed when submitting the kick
|
||||
*/
|
||||
typedef struct _SGX_KICKTA_SUBMIT_
|
||||
{
|
||||
/*
|
||||
pvTACmd and ui32TACmdBytes should be set up by client ONLY on Vista
|
||||
where pvTACmd points to ui32TACmdBytes of reserved data
|
||||
*/
|
||||
IMG_PVOID pvTACmd;
|
||||
IMG_UINT32 ui32TACmdBytes;
|
||||
|
||||
struct _SGX_RTDATA_ *psRTData;
|
||||
struct _SGX_RTDATASET_ *psRTDataSet;
|
||||
struct _SGX_RENDERDETAILS_ *psRenderDetails;
|
||||
struct _SGX_DEVICE_SYNC_LIST_ *psDstDeviceSyncList;
|
||||
struct _SGX_RENDERCONTEXT_ *psRenderContext;
|
||||
IMG_UINT32 ui32KickFlags;
|
||||
|
||||
|
||||
IMG_UINT32 ui32Frame;
|
||||
|
||||
IMG_BOOL bFirstKickOrResume;
|
||||
#if (defined(NO_HARDWARE) || defined(PDUMP))
|
||||
IMG_BOOL bTerminateOrAbort;
|
||||
#endif
|
||||
|
||||
IMG_HANDLE hRenderSurfSyncInfo;
|
||||
|
||||
IMG_UINT32 ui32NumTAStatusVals;
|
||||
IMG_UINT32 ui32Num3DStatusVals;
|
||||
|
||||
#if defined(SUPPORT_SGX_NEW_STATUS_VALS)
|
||||
SGX_INTERNEL_STATUS_UPDATE asTAStatusUpdate[SGX_MAX_TA_STATUS_VALS];
|
||||
SGX_INTERNEL_STATUS_UPDATE as3DStatusUpdate[SGX_MAX_3D_STATUS_VALS];
|
||||
#else
|
||||
IMG_HANDLE ahTAStatusInfo[SGX_MAX_TA_STATUS_VALS];
|
||||
IMG_HANDLE ah3DStatusInfo[SGX_MAX_3D_STATUS_VALS];
|
||||
#endif
|
||||
|
||||
#if defined(PDUMP)
|
||||
struct _SGX_KICKTA_PDUMP_ *psKickPDUMP;
|
||||
#endif
|
||||
|
||||
/* source dependency details */
|
||||
#if defined(SUPPORT_SGX_GENERALISED_SYNCOBJECTS)
|
||||
IMG_UINT32 ui32NumTASrcSyncs;
|
||||
PVRSRV_CLIENT_SYNC_INFO *apsTASrcSurfSyncInfo[SGX_MAX_TA_SRC_SYNCS];
|
||||
IMG_UINT32 ui32NumTADstSyncs;
|
||||
PVRSRV_CLIENT_SYNC_INFO *apsTADstSurfSyncInfo[SGX_MAX_TA_DST_SYNCS];
|
||||
IMG_UINT32 ui32Num3DSrcSyncs;
|
||||
PVRSRV_CLIENT_SYNC_INFO *aps3DSrcSurfSyncInfo[SGX_MAX_3D_SRC_SYNCS];
|
||||
#else
|
||||
IMG_UINT32 ui32NumSrcSyncs;
|
||||
PVRSRV_CLIENT_SYNC_INFO *apsSrcSurfSyncInfo[SGX_MAX_SRC_SYNCS];
|
||||
#endif
|
||||
|
||||
/* TA/3D dependency details */
|
||||
PVRSRV_CLIENT_SYNC_INFO *psTA3DSyncInfo;
|
||||
IMG_BOOL bTADependency;
|
||||
|
||||
PVRSRV_CLIENT_SYNC_INFO *psTASyncInfo;
|
||||
PVRSRV_CLIENT_SYNC_INFO *ps3DSyncInfo;
|
||||
|
||||
#if defined(PDUMP) || defined(DEBUG)
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hLastSyncInfo;
|
||||
#else
|
||||
PVRSRV_CLIENT_SYNC_INFO *psLastSyncInfo;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
} SGX_KICKTA_SUBMIT, *PSGX_KICKTA_SUBMIT;
|
||||
|
||||
|
||||
/* Setting/requesting kernel devinfo members */
|
||||
typedef enum _SGX_DEV_DATA_
|
||||
{
|
||||
/* DPM device dat*/
|
||||
SGX_DEV_DATA_DPM_TA_ALLOC_FREE_LIST,
|
||||
SGX_DEV_DATA_DPM_TA_ALLOC,
|
||||
SGX_DEV_DATA_DPM_3D_FREE_LIST,
|
||||
SGX_DEV_DATA_DPM_3D,
|
||||
#if defined(SGX_FEATURE_HOST_ALLOC_FROM_DPM)
|
||||
SGX_DEV_DATA_DPM_HOST_DALLOC_FREE_LIST,
|
||||
SGX_DEV_DATA_DPM_HOST_DALLOC,
|
||||
SGX_DEV_DATA_DPM_HOST_ALLOC_FREE_LIST,
|
||||
SGX_DEV_DATA_DPM_HOST_ALLOC,
|
||||
#endif
|
||||
|
||||
/* Misc client data */
|
||||
SGX_DEV_DATA_EVM_CONFIG,
|
||||
SGX_DEV_DATA_CLIENT_KICK_FLAGS,
|
||||
|
||||
SGX_DEV_DATA_NUM_USE_TEMP_REGS,
|
||||
SGX_DEV_DATA_NUM_USE_ATTRIBUTE_REGS,
|
||||
|
||||
SGX_DEV_DATA_PDS_EXEC_BASE,
|
||||
SGX_DEV_DATA_USE_EXEC_BASE,
|
||||
|
||||
#if defined(FIX_HW_BRN_23861)
|
||||
SGX_DUMMY_STENCIL_LOAD_BASE_ADDR,
|
||||
SGX_DUMMY_STENCIL_STORE_BASE_ADDR,
|
||||
#endif
|
||||
|
||||
SGX_DEV_DATA_LAST = SGX_MAX_DEV_DATA
|
||||
} SGX_DEV_DATA;
|
||||
|
||||
/* Anonymous memory handles passed to the kernel at initialisation time */
|
||||
typedef enum _SGX_INIT_MEM_HANDLES_
|
||||
{
|
||||
SGX_INIT_MEM_USE,
|
||||
#if defined(SGX_FEATURE_MONOLITHIC_UKERNEL)
|
||||
#if defined(SGX_FEATURE_MP)
|
||||
SGX_INIT_MEM_SLAVE_PDS,
|
||||
SGX_INIT_MEM_SLAVE_USE,
|
||||
#endif
|
||||
#else
|
||||
SGX_INIT_MEM_TA_USE,
|
||||
SGX_INIT_MEM_3D_USE,
|
||||
SGX_INIT_MEM_SPM_USE,
|
||||
#if defined(SGX_FEATURE_2D_HARDWARE)
|
||||
SGX_INIT_MEM_2D_USE,
|
||||
#endif
|
||||
#endif /* SGX_FEATURE_MONOLITHIC_UKERNEL */
|
||||
SGX_INIT_MEM_PDS_INIT_PRIM1,
|
||||
SGX_INIT_MEM_PDS_INIT_SEC,
|
||||
SGX_INIT_MEM_PDS_INIT_PRIM2,
|
||||
SGX_INIT_MEM_PDS_EVENT,
|
||||
SGX_INIT_MEM_PDS_LOOPBACK,
|
||||
#if defined(SGX_FEATURE_VDM_CONTEXT_SWITCH)
|
||||
SGX_INIT_MEM_USE_CTX_SWITCH_TERM,
|
||||
SGX_INIT_MEM_PDS_CTX_SWITCH_TERM,
|
||||
SGX_INIT_MEM_USE_TA_STATE,
|
||||
SGX_INIT_MEM_PDS_TA_STATE,
|
||||
#if defined(SGX_FEATURE_MTE_STATE_FLUSH) && defined(SGX_FEATURE_COMPLEX_GEOMETRY_REV_2)
|
||||
SGX_INIT_MEM_USE_CMPLX_TA_STATE,
|
||||
SGX_INIT_MEM_PDS_CMPLX_TA_STATE,
|
||||
#endif
|
||||
#if defined(SGX_FEATURE_USE_SA_COUNT_REGISTER)
|
||||
SGX_INIT_MEM_USE_SA_RESTORE,
|
||||
SGX_INIT_MEM_PDS_SA_RESTORE,
|
||||
#endif
|
||||
#endif
|
||||
#if defined(FIX_HW_BRN_23861)
|
||||
SGX_INIT_MEM_DUMMY_STENCIL_LOAD,
|
||||
SGX_INIT_MEM_DUMMY_STENCIL_STORE,
|
||||
#endif
|
||||
SGX_INIT_MEM_LAST = SGX_MAX_INIT_MEM_HANDLES
|
||||
} SGX_INIT_MEM_HANDLES;
|
||||
|
||||
#endif /* __SGXINFO_CLIENT_H__ */
|
||||
|
||||
/******************************************************************************
|
||||
End of file (sgxinfo_client.h)
|
||||
******************************************************************************/
|
||||
|
||||
|
@ -0,0 +1,141 @@
|
||||
/*!****************************************************************************
|
||||
@File sgxtransfer_buffer.h
|
||||
|
||||
@Title Transfer queue circular buffer management
|
||||
|
||||
@Author Imagination Technologies
|
||||
|
||||
@date 06/10/09
|
||||
|
||||
@Copyright Copyright 2009 by Imagination Technologies Limited.
|
||||
All rights reserved. No part of this software, either
|
||||
material or conceptual may be copied or distributed,
|
||||
transmitted, transcribed, stored in a retrieval system
|
||||
or translated into any human or computer language in any
|
||||
form by any means, electronic, mechanical, manual or
|
||||
other-wise, or disclosed to third parties without the
|
||||
express written permission of Imagination Technologies
|
||||
Limited, Unit 8, HomePark Industrial Estate,
|
||||
King's Langley, Hertfordshire, WD4 8LZ, U.K.
|
||||
|
||||
@Platform Generic
|
||||
|
||||
@Description Transfer queue circular buffer management
|
||||
|
||||
@DoxygenVer
|
||||
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
Modifications :-
|
||||
|
||||
$Log: sgxtransfer_buffer.h $
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef _SGXTRANSFER_BUFFER_H_
|
||||
#define _SGXTRANSFER_BUFFER_H_
|
||||
|
||||
#include "img_types.h"
|
||||
#include "services.h"
|
||||
|
||||
#define SGXTQ_MAX_QUEUED_BLITS 32
|
||||
|
||||
typedef struct _SGXTQ_CB_PACKET_
|
||||
{
|
||||
IMG_UINT32 ui32FenceID;
|
||||
IMG_UINT32 ui32Roff;
|
||||
#if defined(PDUMP)
|
||||
/* stuff we need to PDUMP the CB packet */
|
||||
IMG_UINT32 ui32Offset;
|
||||
IMG_UINT32 ui32PacketSize;
|
||||
IMG_BOOL bWasDumped;
|
||||
#endif
|
||||
} SGXTQ_CB_PACKET;
|
||||
|
||||
|
||||
typedef struct _SGXTQ_CB_
|
||||
{
|
||||
IMG_UINT32 ui32Woff;
|
||||
/* non-commited woff*/
|
||||
IMG_UINT32 ui32NCWoff;
|
||||
IMG_UINT32 ui32Roff;
|
||||
|
||||
IMG_UINT32 ui32BufferSize;
|
||||
/* every packet or (non commited sub-packet) is aligned*/
|
||||
IMG_UINT32 ui32Alignment;
|
||||
IMG_BOOL bAllowPageBr;
|
||||
|
||||
PVRSRV_CLIENT_MEM_INFO* psBufferMemInfo;
|
||||
|
||||
/* list of packets inserted into the Buffer */
|
||||
SGXTQ_CB_PACKET asCBPackets[SGXTQ_MAX_QUEUED_BLITS];
|
||||
IMG_UINT32 ui32PacketRoff;
|
||||
IMG_UINT32 ui32PacketWoff;
|
||||
IMG_UINT32 ui32PacketNCWoff;
|
||||
|
||||
/* small label for the buffer*/
|
||||
IMG_CHAR *pbyLabel;
|
||||
|
||||
PVRSRV_DEV_DATA *psDevData;
|
||||
} SGXTQ_CB;
|
||||
|
||||
PVRSRV_ERROR SGXTQ_CreateCB(PVRSRV_DEV_DATA *psDevData,
|
||||
IMG_HANDLE hTQContext,
|
||||
IMG_UINT32 ui32CBSize,
|
||||
IMG_UINT32 ui32Alignment,
|
||||
IMG_BOOL bAllowPageBr,
|
||||
IMG_BOOL bAllowWrite,
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hDevMemHeap,
|
||||
#else
|
||||
IMG_HANDLE hDevMemHeap,
|
||||
#endif
|
||||
IMG_CHAR * pbyPDumpLabel,
|
||||
SGXTQ_CB **ppsCB);
|
||||
|
||||
IMG_VOID SGXTQ_DestroyCB(IMG_HANDLE hTQContext,
|
||||
SGXTQ_CB *psCB);
|
||||
|
||||
|
||||
IMG_BOOL SGXTQ_AcquireCB(PVRSRV_CLIENT_MEM_INFO * psFenceIDMemInfo,
|
||||
IMG_UINT32 ui32CurrentFence,
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_EVENTSID hOSevent,
|
||||
#else
|
||||
IMG_HANDLE hOSevent,
|
||||
#endif
|
||||
SGXTQ_CB * psCB,
|
||||
IMG_UINT32 ui32Size,
|
||||
IMG_BOOL bPreparedForWait,
|
||||
IMG_VOID **ppvLinAddr,
|
||||
IMG_PUINT32 pui32DevVAddr,
|
||||
IMG_BOOL bPDumpContinuous);
|
||||
|
||||
IMG_VOID SGXTQ_BeginCB(SGXTQ_CB *psCB);
|
||||
|
||||
IMG_VOID SGXTQ_FlushCB(SGXTQ_CB *psCB,
|
||||
IMG_BOOL bPDumpContinuous);
|
||||
|
||||
typedef struct _SQXTQ_CLIENT_TRANSFER_CONTEXT_ *PSQXTQ_CLIENT_TRANSFER_CONTEXT;
|
||||
#if defined(SUPPORT_KERNEL_SGXTQ)
|
||||
PVRSRV_ERROR TQAllocDeviceMem(IMG_HANDLE hDevice,
|
||||
IMG_HANDLE hHeap,
|
||||
IMG_UINT32 ui32Flags,
|
||||
IMG_UINT32 ui32Size,
|
||||
IMG_UINT32 ui32Alignment,
|
||||
PVRSRV_CLIENT_MEM_INFO **ppsMemInfo);
|
||||
PVRSRV_ERROR TQFreeDeviceMem(IMG_HANDLE hDevice,
|
||||
PVRSRV_CLIENT_MEM_INFO *psMemInfo);
|
||||
|
||||
#define ALLOCDEVICEMEM(Ctx, heap, flags, size, align, meminfo) TQAllocDeviceMem(((PSQXTQ_CLIENT_TRANSFER_CONTEXT) Ctx)->hCallbackHandle, heap, flags, size, align, meminfo)
|
||||
#define FREEDEVICEMEM(Ctx, meminfo) TQFreeDeviceMem(((PSQXTQ_CLIENT_TRANSFER_CONTEXT)Ctx)->hCallbackHandle, meminfo)
|
||||
#else
|
||||
#define ALLOCDEVICEMEM(Ctx, heap, flags, size, align, meminfo) PVRSRVAllocDeviceMem(((PSQXTQ_CLIENT_TRANSFER_CONTEXT) Ctx)->psDevData, heap, flags, size, align, meminfo)
|
||||
#define FREEDEVICEMEM(Ctx, meminfo) PVRSRVFreeDeviceMem(((PSQXTQ_CLIENT_TRANSFER_CONTEXT) Ctx)->psDevData, meminfo)
|
||||
#endif
|
||||
|
||||
#endif /*_SGXTRANSFER_BUFFER_H_*/
|
||||
|
||||
/******************************************************************************
|
||||
End of file (sgxtransfer_buffer.h)
|
||||
******************************************************************************/
|
@ -0,0 +1,994 @@
|
||||
/*!****************************************************************************
|
||||
@File sgxtransfer_client.h
|
||||
|
||||
@Title Device specific transfer queue routines
|
||||
|
||||
@Author Imagination Technologies
|
||||
|
||||
@date 08/02/06
|
||||
|
||||
@Copyright Copyright 2007-2010 by Imagination Technologies Limited.
|
||||
All rights reserved. No part of this software, either
|
||||
material or conceptual may be copied or distributed,
|
||||
transmitted, transcribed, stored in a retrieval system
|
||||
or translated into any human or computer language in any
|
||||
form by any means, electronic, mechanical, manual or
|
||||
other-wise, or disclosed to third parties without the
|
||||
express written permission of Imagination Technologies
|
||||
Limited, Unit 8, HomePark Industrial Estate,
|
||||
King's Langley, Hertfordshire, WD4 8LZ, U.K.
|
||||
|
||||
@Platform Generic
|
||||
|
||||
@Description Device specific functions
|
||||
|
||||
@DoxygenVer
|
||||
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
Modifications :-
|
||||
|
||||
$Log: sgxtransfer_client.h $
|
||||
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef _SGXTRANSFER_CLIENT_H_
|
||||
#define _SGXTRANSFER_CLIENT_H_
|
||||
#if defined(TRANSFER_QUEUE)
|
||||
|
||||
#include "sgxtransfer_buffer.h"
|
||||
|
||||
/* Stuff only accessible by the client (which the kernel will not touch) */
|
||||
|
||||
#ifndef ALIGNFIELD
|
||||
#define ALIGNFIELD(V, A) (((V) + ((1UL << (A)) - 1)) >> (A))
|
||||
#endif
|
||||
|
||||
/* returns FALSE if not aligned*/
|
||||
#define ISALIGNED(V, A) (((V) & ((1UL << (A)) - 1)) == 0)
|
||||
/* checks if value doesn't have bits at the bottom part shifted out by alignshift*/
|
||||
#define CHECKBITSNOTLOST(V, A) PVR_ASSERT(ISALIGNED(V, A))
|
||||
/* checks if value fits into the bitfield marked by the clearmask*/
|
||||
#define CHECKOVERFLOW(V, CLRM, SH) PVR_ASSERT(((V) & (~((~(CLRM)) >> (SH)))) == 0)
|
||||
|
||||
|
||||
/* PRQA S 0881 4 */ /* ignore 'order of evaluation' warning */
|
||||
#define ACCUMLATESET(state, val, sel) \
|
||||
(state) &= (sel##_CLRMSK); \
|
||||
PVR_ASSERT(((val) & (~((~sel##_CLRMSK) >> (sel##_SHIFT)))) == 0); \
|
||||
(state) |= (val) << (sel##_SHIFT)
|
||||
|
||||
/* PRQA S 0881 4 */ /* ignore 'order of evaluation' warning */
|
||||
#define ACCUMLATESETNS(state, val, sel) \
|
||||
(state) &= (sel##_CLRMSK); \
|
||||
PVR_ASSERT(((val) & (sel##_CLRMSK)) == 0); \
|
||||
(state) |= (val)
|
||||
|
||||
|
||||
#define FLOAT32_ONE 0x3f800000
|
||||
#define FLOAT32_HALF 0x3f000000
|
||||
#define FIXEDPT_FRAC 20
|
||||
|
||||
/* number of bits in a pixel per plane - for planar formats only*/
|
||||
#define SGXTQ_BITS_IN_PLANE 32
|
||||
/* number of maximal number of passes for a multi-chunk format*/
|
||||
#define SGXTQ_MAX_CHANCHUNKS 8
|
||||
|
||||
/* hw bg objects starting with 0 input layer up to this -1*/
|
||||
#define SGXTQ_NUM_HWBGOBJS 4
|
||||
|
||||
#if SGXTQ_MAX_SURFACES >= SGXTQ_NUM_HWBGOBJS
|
||||
#error Client API supports more texture layers than the TQ.
|
||||
#endif
|
||||
|
||||
#define SGXTQ_MAX_DIRECT_ATTRIBUTES 7
|
||||
|
||||
/* max number of rects whose F2D ISP stream can fit into CB. */
|
||||
#define SGXTQ_MAX_F2DRECTS 51
|
||||
|
||||
#define SGXTQ_PDS_CODE_GRANULARITY (1UL << EURASIA_PDS_BASEADD_ALIGNSHIFT)
|
||||
#define SGXTQ_PDS_CODE_AVERAGE_SIZE (200UL / SGXTQ_PDS_CODE_GRANULARITY)
|
||||
#define SGXTQ_PDS_CODE_CBSIZE SGXTQ_PDS_CODE_AVERAGE_SIZE * SGXTQ_MAX_QUEUED_BLITS * SGXTQ_PDS_CODE_GRANULARITY
|
||||
|
||||
#define SGXTQ_PDSPRIMFRAG_SINGLESOURCE_INSTANCENUM 16
|
||||
|
||||
#define SGXTQ_USSE_CODE_GRANULARITY EURASIA_PDS_DOUTU_PHASE_START_ALIGN
|
||||
#define SGXTQ_USSE_CODE_AVERAGE_SIZE (64UL / SGXTQ_USSE_CODE_GRANULARITY)
|
||||
#define SGXTQ_USSE_CODE_CBSIZE SGXTQ_USSE_CODE_AVERAGE_SIZE * SGXTQ_USSE_CODE_GRANULARITY * SGXTQ_MAX_QUEUED_BLITS
|
||||
|
||||
/* as this is huge, only allocate 4 instances. this means that we can't queue
|
||||
* 5 subtwiddled blits without doing a submit
|
||||
*/
|
||||
#define SGXTQ_USEEOTHANDLER_SUBTWIDDLED_INSTANCENUM 4
|
||||
|
||||
/* TODO : move corresponding define into hwdefs */
|
||||
#define SGXTQ_ISP_STREAM_GRANULARITY (16 * sizeof(IMG_UINT32))
|
||||
/* we need at least as big as the F2D with the maximum no of
|
||||
* cliprects in clipblit - the average is way below that ; this
|
||||
* should be consistent with the Fast 2D ISP stream writer function
|
||||
* on roundings we go one step further than needed*/
|
||||
#define SGXTQ_ISP_MAX_BATCHES ((SGXTQ_MAX_F2DRECTS + 4) >> 2)
|
||||
#if defined(SGX545)
|
||||
#define SGXTQ_ISP_STREAM_AVERAGE_SIZE ((4 * SGXTQ_ISP_MAX_BATCHES + 2 * SGXTQ_MAX_F2DRECTS) \
|
||||
* sizeof(IMG_UINT32) / SGXTQ_ISP_STREAM_GRANULARITY)
|
||||
#else
|
||||
#define SGXTQ_ISP_STREAM_AVERAGE_SIZE ((2 + 10 * SGXTQ_ISP_MAX_BATCHES + 17 * SGXTQ_MAX_F2DRECTS) \
|
||||
* sizeof(IMG_UINT32) / SGXTQ_ISP_STREAM_GRANULARITY)
|
||||
#endif
|
||||
#define SGXTQ_ISP_STREAM_CBSIZE SGXTQ_ISP_STREAM_GRANULARITY * SGXTQ_ISP_STREAM_AVERAGE_SIZE * SGXTQ_MAX_QUEUED_BLITS
|
||||
|
||||
|
||||
#if ((16 == EURASIA_ISPREGION_SIZEX && 16 == EURASIA_ISPREGION_SIZEY && EURASIA_TAPDSSTATE_PIPECOUNT == 2) || \
|
||||
(32 == EURASIA_ISPREGION_SIZEX && 32 == EURASIA_ISPREGION_SIZEY && EURASIA_TAPDSSTATE_PIPECOUNT == 4)) && \
|
||||
! (defined(FIX_HW_BRN_23615) && defined(FIX_HW_BRN_23070)) && \
|
||||
! defined(FIX_HW_BRN_26361) && \
|
||||
! defined(FIX_HW_BRN_28825)
|
||||
#define SGXTQ_SUBTILE_TWIDDLING
|
||||
#if ! defined(FIX_HW_BRN_30842)
|
||||
#define SGXTQ_SUBTWIDDLED_TMP6_2PIPE_MODE_MASK (1UL<<31)
|
||||
#define SGXTQ_SUBTWIDDLED_TMP6_DIRECTION_X_MASK (1UL<<30)
|
||||
#define SGXTQ_SUBTWIDDLED_TMP6_FBADDR_MOVE_MASK 0x0fffffff
|
||||
|
||||
#define SGXTQ_SUBTWIDDLED_TMP7_U_MASK 0xffff0000
|
||||
#define SGXTQ_SUBTWIDDLED_TMP7_U_SHIFT 16
|
||||
#define SGXTQ_SUBTWIDDLED_TMP7_V_MASK 0x0000ffff
|
||||
#define SGXTQ_SUBTWIDDLED_TMP7_V_SHIFT 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define SGXTQ_STAGINGBUFFER_ALLOC_GRAN (1UL << EURASIA_PDS_DOUTT2_TEXADDR_ALIGNSHIFT)
|
||||
#define SGXTQ_STAGINGBUFFER_MIN_SIZE ((EURASIA_ISPREGION_SIZEY * EURASIA_RENDERSIZE_MAXX * 4) + SGXTQ_STAGINGBUFFER_ALLOC_GRAN) // 4 = BytesPerPixel
|
||||
|
||||
typedef IMG_UINT32 IMG_UFIXED;
|
||||
|
||||
/* Defines used to determine heaps used for allocations */
|
||||
#define SGXTQ_SYNCINFO_HEAP_ID SGX_SYNCINFO_HEAP_ID
|
||||
#define SGXTQ_PDS_HEAP_ID SGX_PDSPIXEL_CODEDATA_HEAP_ID
|
||||
#define SGXTQ_USSE_HEAP_ID SGX_PIXELSHADER_HEAP_ID
|
||||
#define SGXTQ_KERNEL_DATA_ID SGX_KERNEL_DATA_HEAP_ID
|
||||
#define SGXTQ_BGOBJ_HEAP_ID SGX_GENERAL_HEAP_ID
|
||||
#if defined(SGX_FEATURE_2D_HARDWARE)
|
||||
#define SGXTQ_BUFFER_HEAP_ID SGX_2D_HEAP_ID
|
||||
#else
|
||||
#define SGXTQ_BUFFER_HEAP_ID SGX_GENERAL_HEAP_ID
|
||||
#endif
|
||||
|
||||
/* Defines used to determine the base register for the USE code */
|
||||
#define SGXTQ_USE_CODE_BASE_INDEX SGX_PIXSHADER_USE_CODE_BASE_INDEX
|
||||
|
||||
#if defined(PDUMP) && defined(DEBUG)
|
||||
#define SGXTQ_DEBUG_PDUMP_TQINPUT 1
|
||||
#endif
|
||||
|
||||
typedef struct _SGXTQ_HEAP_INFO_
|
||||
{
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hSyncMemHeap;
|
||||
IMG_SID hPDSMemHeap;
|
||||
IMG_SID hUSEMemHeap;
|
||||
IMG_SID hCtrlMemHeap;
|
||||
IMG_SID hParamMemHeap;
|
||||
IMG_SID hBufferMemHeap;
|
||||
#else
|
||||
IMG_HANDLE hSyncMemHeap;
|
||||
IMG_HANDLE hPDSMemHeap;
|
||||
IMG_HANDLE hUSEMemHeap;
|
||||
IMG_HANDLE hCtrlMemHeap;
|
||||
IMG_HANDLE hParamMemHeap;
|
||||
IMG_HANDLE hBufferMemHeap;
|
||||
#endif
|
||||
} SGXTQ_HEAP_INFO;
|
||||
|
||||
|
||||
/* includes full layer info with TAG & ITERATORS states*/
|
||||
typedef struct _SGXTQ_LAYER_
|
||||
{
|
||||
IMG_UINT32 aui32TAGState[EURASIA_TAG_TEXTURE_STATE_SIZE];
|
||||
IMG_UINT32 aui32ITERState[EURASIA_PDS_DOUTI_STATE_SIZE];
|
||||
} SGXTQ_LAYER;
|
||||
|
||||
|
||||
typedef struct _SGXTQ_PDS_UPDATE__
|
||||
{
|
||||
/* USSE kick */
|
||||
IMG_UINT32 ui32U0;
|
||||
IMG_UINT32 ui32U1;
|
||||
IMG_UINT32 ui32U2;
|
||||
#if defined(SGX_FEATURE_UNIFIED_TEMPS_AND_PAS)
|
||||
IMG_UINT32 ui32TempRegs;
|
||||
#endif
|
||||
|
||||
/* the input layer stack, list of TAG/ITERATORS states*/
|
||||
SGXTQ_LAYER asLayers[SGXTQ_NUM_HWBGOBJS - 1];
|
||||
|
||||
/* used in secondaries to pass args to the shader*/
|
||||
IMG_UINT32 aui32A[SGXTQ_MAX_DIRECT_ATTRIBUTES];
|
||||
|
||||
/* DMA */
|
||||
IMG_UINT32 ui32D0;
|
||||
IMG_UINT32 ui32D1;
|
||||
IMG_UINT32 ui32DMASize;
|
||||
|
||||
} SGXTQ_PDS_UPDATE;
|
||||
|
||||
|
||||
/*
|
||||
* used for multi layered HW BGObjs
|
||||
*/
|
||||
typedef struct _SGXTQ_TSP_COORDS__
|
||||
{
|
||||
/* layer 0*/
|
||||
IMG_UINT32 ui32Src0U0;
|
||||
IMG_UINT32 ui32Src0U1;
|
||||
IMG_UINT32 ui32Src0V0;
|
||||
IMG_UINT32 ui32Src0V1;
|
||||
|
||||
/* layer 1*/
|
||||
IMG_UINT32 ui32Src1U0;
|
||||
IMG_UINT32 ui32Src1U1;
|
||||
IMG_UINT32 ui32Src1V0;
|
||||
IMG_UINT32 ui32Src1V1;
|
||||
|
||||
/* layer 2*/
|
||||
IMG_UINT32 ui32Src2U0;
|
||||
IMG_UINT32 ui32Src2U1;
|
||||
IMG_UINT32 ui32Src2V0;
|
||||
IMG_UINT32 ui32Src2V1;
|
||||
} SGXTQ_TSP_COORDS;
|
||||
|
||||
|
||||
/* used for single layered real geometries
|
||||
* (rasterized from the same slice of src)
|
||||
*/
|
||||
typedef struct _SGXTQ_TSP_SINGLE_
|
||||
{
|
||||
/* single set of TSP floats*/
|
||||
IMG_UINT32 ui32Src0U0;
|
||||
IMG_UINT32 ui32Src0U1;
|
||||
IMG_UINT32 ui32Src0V0;
|
||||
IMG_UINT32 ui32Src0V1;
|
||||
|
||||
} SGXTQ_TSP_SINGLE;
|
||||
|
||||
typedef struct _SGXTQ_SURF_DESC__
|
||||
{
|
||||
SGXTQ_SURFACE* psSurf;
|
||||
IMG_RECT* psRect;
|
||||
IMG_UINT32 ui32DevVAddr;
|
||||
IMG_UINT32 ui32Width;
|
||||
IMG_UINT32 ui32Height;
|
||||
IMG_UINT32 ui32LineStride;
|
||||
IMG_UINT32 ui32BytesPerPixel;
|
||||
|
||||
/* used only if it's input*/
|
||||
IMG_UINT32 ui32TAGFormat;
|
||||
|
||||
/* used only if it's output*/
|
||||
IMG_UINT32 ui32PBEPackMode;
|
||||
} SGXTQ_SURF_DESC;
|
||||
|
||||
typedef enum _SGXTQ_USEFRAGS_
|
||||
{
|
||||
SGXTQ_USEBLIT_NORMAL = 0,
|
||||
#if ! defined(SGX_FEATURE_USE_VEC34)
|
||||
SGXTQ_USEBLIT_STRIDE,
|
||||
SGXTQ_USEBLIT_STRIDE_HIGHBPP,
|
||||
#endif
|
||||
SGXTQ_USEBLIT_FILL,
|
||||
SGXTQ_USEBLIT_A2R10G10B10,
|
||||
SGXTQ_USEBLIT_A2B10G10R10,
|
||||
#if !defined(SGX_FEATURE_USE_VEC34)
|
||||
SGXTQ_USEBLIT_SRGB,
|
||||
#endif
|
||||
|
||||
#if defined(EURASIA_PDS_DOUTT0_CHANREPLICATE)
|
||||
SGXTQ_USEBLIT_A8,
|
||||
#endif
|
||||
|
||||
SGXTQ_USEBLIT_ROP_NOTSANDNOTD,
|
||||
SGXTQ_USEBLIT_ROP_NOTSANDD,
|
||||
SGXTQ_USEBLIT_ROP_NOTS,
|
||||
SGXTQ_USEBLIT_ROP_SANDNOTD,
|
||||
SGXTQ_USEBLIT_ROP_NOTD,
|
||||
SGXTQ_USEBLIT_ROP_SXORD,
|
||||
SGXTQ_USEBLIT_ROP_NOTSORNOTD,
|
||||
SGXTQ_USEBLIT_ROP_SANDD,
|
||||
SGXTQ_USEBLIT_ROP_NOTSXORD,
|
||||
SGXTQ_USEBLIT_ROP_D,
|
||||
SGXTQ_USEBLIT_ROP_NOTSORD,
|
||||
SGXTQ_USEBLIT_ROP_S,
|
||||
SGXTQ_USEBLIT_ROP_SORNOTD,
|
||||
SGXTQ_USEBLIT_ROP_SORD,
|
||||
|
||||
SGXTQ_USEBLIT_SRC_BLEND,
|
||||
SGXTQ_USEBLIT_ACCUM_SRC_BLEND,
|
||||
SGXTQ_USEBLIT_PREMULSRC_BLEND,
|
||||
SGXTQ_USEBLIT_GLOBAL_BLEND,
|
||||
SGXTQ_USEBLIT_PREMULSRCWITHGLOBAL_BLEND,
|
||||
SGXTQ_USEBLIT_ROPFILL_AND,
|
||||
SGXTQ_USEBLIT_ROPFILL_ANDNOT,
|
||||
SGXTQ_USEBLIT_ROPFILL_NOTAND,
|
||||
SGXTQ_USEBLIT_ROPFILL_XOR,
|
||||
SGXTQ_USEBLIT_ROPFILL_OR,
|
||||
SGXTQ_USEBLIT_ROPFILL_NOTANDNOT,
|
||||
SGXTQ_USEBLIT_ROPFILL_NOTXOR,
|
||||
SGXTQ_USEBLIT_ROPFILL_ORNOT,
|
||||
SGXTQ_USEBLIT_ROPFILL_NOT,
|
||||
SGXTQ_USEBLIT_ROPFILL_NOTOR,
|
||||
SGXTQ_USEBLIT_ROPFILL_NOTORNOT,
|
||||
SGXTQ_USEBLIT_ROPFILL_NOTD,
|
||||
#if ! defined(SGX_FEATURE_USE_VEC34)
|
||||
SGXTQ_USEBLIT_LUT256,
|
||||
SGXTQ_USEBLIT_LUT16,
|
||||
SGXTQ_USEBLIT_LUT2,
|
||||
#endif /* SGX_FEATURE_USE_VEC34*/
|
||||
|
||||
SGXTQ_USEBLIT_SOURCE_COLOUR_KEY,
|
||||
SGXTQ_USEBLIT_DEST_COLOUR_KEY,
|
||||
|
||||
SGXTQ_USEBLIT_VIDEOPROCESSBLIT_3PLANAR,
|
||||
SGXTQ_USEBLIT_VIDEOPROCESSBLIT_2PLANAR,
|
||||
SGXTQ_USEBLIT_VIDEOPROCESSBLIT_PACKED,
|
||||
SGXTQ_USEBLIT_CLEARTYPEBLEND_GAMMA,
|
||||
SGXTQ_USEBLIT_CLEARTYPEBLEND_INVALIDGAMMA,
|
||||
|
||||
SGXTQ_USESECONDARY_UPDATE,
|
||||
SGXTQ_USESECONDARY_UPDATE_DMA,
|
||||
|
||||
SGXTQ_USEBLIT_ARGB2NV12_Y_PLANE,
|
||||
SGXTQ_USEBLIT_ARGB2NV12_UV_PLANE,
|
||||
|
||||
SGXTQ_NUM_USEFRAGS
|
||||
} SGXTQ_USEFRAGS;
|
||||
|
||||
typedef enum _SGXTQ_PDSPRIMFRAGS_
|
||||
{
|
||||
SGXTQ_PDSPRIMFRAG_KICKONLY = 0,
|
||||
SGXTQ_PDSPRIMFRAG_SINGLESOURCE,
|
||||
SGXTQ_PDSPRIMFRAG_TWOSOURCE,
|
||||
SGXTQ_PDSPRIMFRAG_THREESOURCE,
|
||||
SGXTQ_PDSPRIMFRAG_ITER,
|
||||
|
||||
SGXTQ_NUM_PDSPRIMFRAGS
|
||||
} SGXTQ_PDSPRIMFRAGS;
|
||||
|
||||
typedef enum _SGXTQ_PDSSECFRAGS_
|
||||
{
|
||||
SGXTQ_PDSSECFRAG_BASIC = 0,
|
||||
|
||||
SGXTQ_PDSSECFRAG_DMA_ONLY, /* PDS sec program using dma only (no direct attr) */
|
||||
|
||||
SGXTQ_PDSSECFRAG_1ATTR,
|
||||
SGXTQ_PDSSECFRAG_3ATTR,
|
||||
SGXTQ_PDSSECFRAG_4ATTR,
|
||||
SGXTQ_PDSSECFRAG_4ATTR_DMA,
|
||||
SGXTQ_PDSSECFRAG_5ATTR_DMA,
|
||||
SGXTQ_PDSSECFRAG_6ATTR,
|
||||
SGXTQ_PDSSECFRAG_7ATTR,
|
||||
|
||||
SGXTQ_NUM_PDSSECFRAGS
|
||||
} SGXTQ_PDSSECFRAGS;
|
||||
|
||||
#if (EURASIA_TAG_TEXTURE_STATE_SIZE == 4)
|
||||
#define SGXTQ_PDSSECFRAG_TEXSETUP SGXTQ_PDSSECFRAG_4ATTR
|
||||
#elif (EURASIA_TAG_TEXTURE_STATE_SIZE == 3)
|
||||
#define SGXTQ_PDSSECFRAG_TEXSETUP SGXTQ_PDSSECFRAG_3ATTR
|
||||
#else
|
||||
#error "Unexpected texture state size"
|
||||
#endif
|
||||
|
||||
typedef enum _SGXTQ_USEEOTHANDLER_
|
||||
{
|
||||
SGXTQ_USEEOTHANDLER_BASIC = 0,
|
||||
#if defined(SGXTQ_SUBTILE_TWIDDLING)
|
||||
SGXTQ_USEEOTHANDLER_SUBTWIDDLED,
|
||||
#endif
|
||||
|
||||
SGXTQ_NUM_USEEOTHANDLERS
|
||||
} SGXTQ_USEEOTHANDLER;
|
||||
|
||||
typedef enum _SGXTQ_PDSPIXEVENTHANDLER_
|
||||
{
|
||||
SGXTQ_PDSPIXEVENTHANDLER_BASIC = 0,
|
||||
SGXTQ_PDSPIXEVENTHANDLER_TILEXY,
|
||||
|
||||
SGXTQ_NUM_PDSPIXEVENTHANDLERS
|
||||
} SGXTQ_PDSPIXEVENTHANDLER;
|
||||
|
||||
|
||||
/****************************************************************
|
||||
* Resources
|
||||
****************************************************************/
|
||||
typedef struct _SGXTQ_PDS_RESOURCE_
|
||||
{
|
||||
/* data segment size */
|
||||
IMG_UINT32 ui32DataLen;
|
||||
|
||||
/* no of SAs/PAs */
|
||||
IMG_UINT32 ui32Attributes;
|
||||
|
||||
#if defined(SGX_FEATURE_UNIFIED_TEMPS_AND_PAS)
|
||||
IMG_UINT32 ui32TempRegs;
|
||||
#endif
|
||||
|
||||
/* TODO : ? merge in the PDS updates ?? that way we
|
||||
* don't have to worry about the setup for one PDS res
|
||||
* corrupting others PDS values..
|
||||
*/
|
||||
} SGXTQ_PDS_RESOURCE;
|
||||
|
||||
typedef struct _SGXTQ_USE_RESOURCE_
|
||||
{
|
||||
/* no of allocated temp regs, from r0 -> r(n-1) */
|
||||
IMG_UINT32 ui32NumTempRegs;
|
||||
|
||||
/* only for shaders*/
|
||||
IMG_UINT32 ui32NumLayers;
|
||||
} SGXTQ_USE_RESOURCE;
|
||||
|
||||
typedef enum _SGXTQ_DEV_RESOURCE_
|
||||
{
|
||||
SGXTQ_STREAM,
|
||||
SGXTQ_PDS,
|
||||
SGXTQ_USE,
|
||||
} SGXTQ_DEV_RESOURCE;
|
||||
|
||||
typedef struct _SGXTQ_STATIC_RESOURCE_
|
||||
{
|
||||
/* the resource allocation */
|
||||
PVRSRV_CLIENT_MEM_INFO *psMemInfo;
|
||||
} SGXTQ_STATIC_RESOURCE;
|
||||
|
||||
typedef struct _SGXTQ_CB_RESOURCE_
|
||||
{
|
||||
SGXTQ_CB * psCB;
|
||||
const IMG_UINT32 * pui32SrcAddr;
|
||||
IMG_UINT32 ui32Size;
|
||||
} SGXTQ_CB_RESOURCE;
|
||||
|
||||
typedef enum _SGXTQ_RESOURCE_STORAGE_
|
||||
{
|
||||
/* resource comes from a CB */
|
||||
SGXTQ_STORAGE_CB,
|
||||
|
||||
/* resource is allocated in the context */
|
||||
SGXTQ_STORAGE_STATIC,
|
||||
|
||||
/* resource skeleton buffer*/
|
||||
SGXTQ_STORAGE_NBUFFER,
|
||||
|
||||
/* resource is coming from the client driver*/
|
||||
SGXTQ_STORAGE_FOREIGN,
|
||||
|
||||
} SGXTQ_RESOURCE_STORAGE;
|
||||
|
||||
typedef struct _SGXTQ_RESOURCE_
|
||||
{
|
||||
/* where the resource is stored */
|
||||
SGXTQ_RESOURCE_STORAGE eStorage;
|
||||
union {
|
||||
SGXTQ_STATIC_RESOURCE sStatic;
|
||||
SGXTQ_CB_RESOURCE sCB;
|
||||
} uStorage;
|
||||
|
||||
IMG_DEV_VIRTADDR sDevVAddr;
|
||||
|
||||
/* what kind of resource */
|
||||
SGXTQ_DEV_RESOURCE eResource;
|
||||
union {
|
||||
SGXTQ_PDS_RESOURCE sPDS;
|
||||
SGXTQ_USE_RESOURCE sUSE;
|
||||
} uResource;
|
||||
} SGXTQ_RESOURCE;
|
||||
|
||||
/****************************************************************/
|
||||
|
||||
typedef struct _SQXTQ_CLIENT_TRANSFER_CONTEXT_
|
||||
{
|
||||
PVRSRV_DEV_DATA *psDevData;
|
||||
PVRSRV_MUTEX_HANDLE hMutex;
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_EVENTSID hOSEvent;
|
||||
|
||||
IMG_SID hHWTransferContext;
|
||||
#else
|
||||
IMG_HANDLE hOSEvent;
|
||||
|
||||
IMG_HANDLE hHWTransferContext;
|
||||
#endif
|
||||
|
||||
/* devVAddr of HW transfer context */
|
||||
IMG_DEV_VIRTADDR sHWTransferContextDevVAddr;
|
||||
|
||||
/* Sync info for TA/TQ dependencies */
|
||||
PVRSRV_CLIENT_MEM_INFO *psTASyncObjectMemInfo;
|
||||
PVRSRV_CLIENT_SYNC_INFO *psTASyncObject;
|
||||
|
||||
/* Sync info for 3D/TQ dependencies */
|
||||
PVRSRV_CLIENT_MEM_INFO *ps3DSyncObjectMemInfo;
|
||||
PVRSRV_CLIENT_SYNC_INFO *ps3DSyncObject;
|
||||
|
||||
/* transfer command CCB */
|
||||
SGX_CLIENT_CCB *psTransferCCB;
|
||||
|
||||
#if defined(SGX_FEATURE_2D_HARDWARE)
|
||||
/* */
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hHW2DContext;
|
||||
#else
|
||||
IMG_HANDLE hHW2DContext;
|
||||
#endif
|
||||
/* devVAddr of HW 2D context */
|
||||
IMG_DEV_VIRTADDR sHW2DContextDevVAddr;
|
||||
/* 2D command CCB */
|
||||
SGX_CLIENT_CCB *ps2DCCB;
|
||||
#endif
|
||||
|
||||
/* Bases */
|
||||
IMG_DEV_VIRTADDR sUSEExecBase;
|
||||
#if ! defined(SGX_FEATURE_PIXEL_PDSADDR_FULL_RANGE)
|
||||
IMG_DEV_VIRTADDR sPDSExecBase;
|
||||
#endif
|
||||
IMG_DEV_VIRTADDR sISPStreamBase;
|
||||
|
||||
/* Fence ID */
|
||||
PVRSRV_CLIENT_MEM_INFO *psFenceIDMemInfo;
|
||||
IMG_UINT32 ui32FenceID;
|
||||
|
||||
/* Resource buffers */
|
||||
SGXTQ_CB *psPDSCodeCB;
|
||||
SGXTQ_CB *psUSECodeCB;
|
||||
SGXTQ_CB *psStreamCB;
|
||||
|
||||
/* skeleton buffer for SGXTQ_PDSPRIMFRAG_SINGLESOURCE*/
|
||||
SGXTQ_CB *psPDSPrimFragSingleSNB;
|
||||
|
||||
#if defined(SGXTQ_SUBTILE_TWIDDLING)
|
||||
/* skeleton buffer for SGXTQ_USEEOTHANDLER_SUBTWIDDLED*/
|
||||
SGXTQ_CB *psUSEEOTSubTwiddledSNB;
|
||||
#endif
|
||||
|
||||
/* PDS resources */
|
||||
SGXTQ_RESOURCE *apsPDSPrimResources[SGXTQ_NUM_PDSPRIMFRAGS];
|
||||
SGXTQ_RESOURCE *apsPDSSecResources[SGXTQ_NUM_PDSSECFRAGS];
|
||||
SGXTQ_RESOURCE *apsPDSPixeventHandlers[SGXTQ_NUM_PDSPIXEVENTHANDLERS];
|
||||
|
||||
/* USE resources */
|
||||
SGXTQ_RESOURCE *apsUSEResources[SGXTQ_NUM_USEFRAGS];
|
||||
SGXTQ_RESOURCE *apsUSEEOTHandlers[SGXTQ_NUM_USEEOTHANDLERS];
|
||||
/* we shouldn't hit eop, it used to be set to eot, but eot isn't static and eor is,
|
||||
* so now it's easier to set it to eor. ; might need to be changed later */
|
||||
SGXTQ_RESOURCE *psUSEEOPHandler;
|
||||
SGXTQ_RESOURCE *psUSEEORHandler;
|
||||
|
||||
/* ISP resources */
|
||||
SGXTQ_RESOURCE *apsISPResources[SGXTQ_NUM_HWBGOBJS];
|
||||
/* Fast 2d ISP control stream */
|
||||
SGXTQ_RESOURCE *psFast2DISPControlStream;
|
||||
|
||||
#if defined(SGX_FEATURE_ISP_CONTEXT_SWITCH) && defined(SGX_FEATURE_FAST_RENDER_CONTEXT_SWITCH)
|
||||
/* meminfo for PDS state on ISP ctx switch */
|
||||
PVRSRV_CLIENT_MEM_INFO *apsPDSCtxSwitchMemInfo[SGX_FEATURE_MP_CORE_COUNT_3D][SGX_FEATURE_NUM_PDS_PIPES];
|
||||
#endif
|
||||
|
||||
#if defined(SUPPORT_SGX_PRIORITY_SCHEDULING)
|
||||
IMG_BOOL bKickSubmitted;
|
||||
IMG_BOOL bPrioritySet;
|
||||
SGX_CONTEXT_PRIORITY ePriority;
|
||||
#endif
|
||||
|
||||
/* Staging Buffer */
|
||||
SGXTQ_CB * psStagingBuffer;
|
||||
|
||||
#if defined(SUPPORT_KERNEL_SGXTQ)
|
||||
IMG_HANDLE hCallbackHandle;
|
||||
#endif
|
||||
|
||||
#if defined(BLITLIB)
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID ahSyncModObjPool[SGXTQ_MAX_SURFACES + 1];
|
||||
#else
|
||||
IMG_HANDLE ahSyncModObjPool[SGXTQ_MAX_SURFACES + 1];
|
||||
#endif
|
||||
#endif
|
||||
IMG_HANDLE hDevMemContext;
|
||||
} SGXTQ_CLIENT_TRANSFER_CONTEXT;
|
||||
|
||||
typedef struct _SGXTQ_BLIT_DATA_
|
||||
{
|
||||
IMG_UINT32 ui32SrcSel;
|
||||
IMG_UINT32 ui32SrcBytesPerPixel;
|
||||
IMG_UINT32 ui32DstBytesPerPixel;
|
||||
|
||||
IMG_UINT32 ui32SrcLineStride;
|
||||
IMG_UINT32 ui32SrcWidth;
|
||||
IMG_UINT32 ui32DstLineStride;
|
||||
IMG_UINT32 ui32DstWidth;
|
||||
IMG_UINT32 ui32DstTAGWidth;
|
||||
IMG_UINT32 ui32DstTAGLineStride;
|
||||
|
||||
IMG_RECT sSrcRect;
|
||||
IMG_RECT sDstRect;
|
||||
|
||||
IMG_UINT32 ui32NumLayers;
|
||||
SGXTQ_PDSPRIMFRAGS ePDSPrim;
|
||||
SGXTQ_PDSSECFRAGS ePDSSec;
|
||||
SGXTQ_USEFRAGS eUSEProg;
|
||||
|
||||
SGXTQ_TSP_COORDS sTSPCoords;
|
||||
|
||||
IMG_UINT32 ui32SrcDevVAddr;
|
||||
IMG_UINT32 ui32DstDevVAddr;
|
||||
|
||||
#if defined(SGX_FEATURE_NATIVE_BACKWARD_BLIT)
|
||||
IMG_UINT32 ui32ScanDirection;
|
||||
#else
|
||||
IMG_BOOL bBackBlit;
|
||||
#endif
|
||||
|
||||
} SGXTQ_BLIT_DATA;
|
||||
|
||||
typedef struct _SGXTQ_MIPGEN_DATA_
|
||||
{
|
||||
IMG_UINT32 ui32NextSourceDevVAddr;
|
||||
IMG_UINT32 ui32SourceDevVAddr;
|
||||
IMG_UINT32 ui32DestDevVAddr;
|
||||
|
||||
IMG_UINT32 ui32BytesPerPixel;
|
||||
|
||||
IMG_UINT32 ui32BatchWidth;
|
||||
IMG_UINT32 ui32BatchHeight;
|
||||
IMG_UINT32 ui32Width;
|
||||
IMG_UINT32 ui32Height;
|
||||
IMG_UINT32 ui32FirstWidth;
|
||||
IMG_UINT32 ui32FirstHeight;
|
||||
IMG_UINT32 ui32FirstSrcDevVAddr;
|
||||
|
||||
IMG_UINT32 ui32ChunksLeft;
|
||||
IMG_UINT32 ui32LevelsLeft;
|
||||
IMG_UINT32 ui32BatchesLeft;
|
||||
IMG_UINT32 ui32BatchSize;
|
||||
IMG_UINT32 ui32DstBatchSize;
|
||||
|
||||
} SGXTQ_MIPGEN_DATA;
|
||||
|
||||
typedef struct _SGXTQ_TEXTURE_UPLOAD_DATA
|
||||
{
|
||||
IMG_BOOL bSubTwiddled;
|
||||
|
||||
IMG_PBYTE apbySrcLinAddr[SGXTQ_MAX_CHANCHUNKS];
|
||||
IMG_UINT32 ui32SrcBytesPP;
|
||||
IMG_UINT32 ui32PixelByteStride;
|
||||
IMG_UINT32 ui32U2Float;
|
||||
|
||||
IMG_UINT32 aui32HeightLeft[SGXTQ_MAX_CHANCHUNKS];
|
||||
IMG_RECT asSBRect[SGXTQ_MAX_CHANCHUNKS];
|
||||
IMG_UINT32 ui32BatchHeight;
|
||||
IMG_UINT32 ui32NumChunks;
|
||||
IMG_PVOID pvSBLinAddr;
|
||||
IMG_UINT32 ui32SBLineStride;
|
||||
|
||||
IMG_RECT sDstRect;
|
||||
IMG_UINT32 ui32DstWidth;
|
||||
IMG_UINT32 ui32DstHeight;
|
||||
IMG_UINT32 ui32DstBytesPP;
|
||||
IMG_UINT32 ui32DstLineStride;
|
||||
} SGXTQ_TEXTURE_UPLOAD_DATA;
|
||||
|
||||
|
||||
typedef struct _SGXTQ_BUFBLT_DATA_
|
||||
{
|
||||
IMG_BOOL bInterleaved;
|
||||
IMG_UINT32 ui32BytesLeft;
|
||||
IMG_UINT32 ui32SrcStart;
|
||||
IMG_UINT32 ui32DstStart;
|
||||
} SGXTQ_BUFBLT_DATA;
|
||||
|
||||
typedef struct _SGXTQ_ARGB2NV12_DATA_
|
||||
{
|
||||
IMG_UINT32 ui32SrcWidth;
|
||||
IMG_UINT32 ui32SrcLineStride;
|
||||
|
||||
IMG_UINT32 ui32DstWidth;
|
||||
IMG_UINT32 ui32DstLineStride;
|
||||
} SGXTQ_ARGB2NV12_DATA;
|
||||
|
||||
/*
|
||||
For Prepare functions to easily store info
|
||||
required across multiple passes.
|
||||
*/
|
||||
typedef struct _SGXTQ_PREP_INTERNAL_
|
||||
{
|
||||
#if ! defined(SGX_FEATURE_NATIVE_BACKWARD_BLIT)
|
||||
struct
|
||||
{
|
||||
IMG_RECT sClampedSrcRect;
|
||||
IMG_RECT sClampedDstRect;
|
||||
IMG_DEV_VIRTADDR sBufferDevAddr;
|
||||
IMG_UINT32 ui32SrcLineStride;
|
||||
IMG_UINT32 ui32BlockHeight;
|
||||
} sBackwardBlitData;
|
||||
#endif
|
||||
|
||||
SGXTQ_PDS_UPDATE sPDSUpdate;
|
||||
IMG_UINT32 aui32PBEState[SGXTQ_PBESTATE_WORDS];
|
||||
|
||||
union {
|
||||
SGXTQ_BLIT_DATA sBlitData;
|
||||
SGXTQ_MIPGEN_DATA sMipData;
|
||||
SGXTQ_BUFBLT_DATA sBufBltData;
|
||||
SGXTQ_TEXTURE_UPLOAD_DATA sTexUplData;
|
||||
SGXTQ_ARGB2NV12_DATA sARGB2NV12Data;
|
||||
} Details;
|
||||
} SGXTQ_PREP_INTERNAL;
|
||||
|
||||
|
||||
#if defined(SGX_FEATURE_2D_HARDWARE)
|
||||
typedef struct _SGXMKIF_2DCMD_SUBMIT_
|
||||
{
|
||||
PSGXMKIF_2DCMD ps2DCmd;
|
||||
|
||||
PVRSRV_2D_SGX_KICK s2DKick;
|
||||
} SGXMKIF_2DCMD_SUBMIT, *PSGXMKIF_2DCMD_SUBMIT;
|
||||
#endif /* SGX_FEATURE_2D_HARDWARE */
|
||||
|
||||
|
||||
/* The common submits structure */
|
||||
typedef struct _SGXTQ_SUBMITS_
|
||||
{
|
||||
IMG_UINT32 ui32NumSubmits;
|
||||
/* Max queued submits per prep call */
|
||||
IMG_UINT32 aui32FenceIDs[SGXTQ_MAX_COMMANDS];
|
||||
|
||||
SGXMKIF_TRANSFERCMD asTransferCmd[SGXTQ_MAX_COMMANDS];
|
||||
PVRSRV_TRANSFER_SGX_KICK asKick[SGXTQ_MAX_COMMANDS];
|
||||
#if defined(SGX_FEATURE_2D_HARDWARE)
|
||||
IMG_UINT32 ui32Num2DSubmits;
|
||||
SGXMKIF_2DCMD_SUBMIT as2DSubmit[SGXTQ_MAX_COMMANDS];
|
||||
#endif
|
||||
|
||||
IMG_UINT32 ui32CCBOffset;
|
||||
} SGXTQ_SUBMITS;
|
||||
|
||||
|
||||
/* Utils Function Declarations */
|
||||
IMG_UFIXED SGXTQ_FixedIntDiv(IMG_UINT16 ui16A, IMG_UINT16 ui16B);
|
||||
IMG_UINT32 SGXTQ_FixedToFloat(IMG_UFIXED ufxVal);
|
||||
IMG_UINT32 SGXTQ_FixedToF16(IMG_UFIXED ufxVal);
|
||||
IMG_UINT32 SGXTQ_FloatIntDiv(IMG_UINT32 ui32A, IMG_UINT32 uiB);
|
||||
IMG_UINT32 SGXTQ_ByteToF16(IMG_UINT32 byte);
|
||||
|
||||
PVRSRV_ERROR SGXTQ_GetPixelFormats(PVRSRV_PIXEL_FORMAT eSrcPix,
|
||||
IMG_BOOL bSrcPacked,
|
||||
PVRSRV_PIXEL_FORMAT eDstPix,
|
||||
IMG_BOOL bDstPacked,
|
||||
SGXTQ_FILTERTYPE eFilter,
|
||||
IMG_UINT32 * pui32TagState,
|
||||
IMG_BOOL * pbTagPlanarizerNeeded,
|
||||
IMG_UINT32 * pui32TAGBpp,
|
||||
IMG_UINT32 * pui32PBEState,
|
||||
IMG_UINT32 * pui32PBEBpp,
|
||||
IMG_UINT32 ui32Pass,
|
||||
IMG_UINT32 * pui32PassesRequired);
|
||||
|
||||
IMG_UINT32 SGXTQ_FilterFromEnum(SGXTQ_FILTERTYPE eFilter);
|
||||
|
||||
IMG_UINT32 SGXTQ_RotationFromEnum(SGXTQ_ROTATION eRotation);
|
||||
|
||||
IMG_UINT32 SGXTQ_MemLayoutFromEnum(SGXTQ_MEMLAYOUT eMemLayout, IMG_BOOL bIsInput);
|
||||
|
||||
IMG_VOID SGXTQ_ShaderFromAlpha(SGXTQ_ALPHA eAlpha,
|
||||
SGXTQ_USEFRAGS* peUSEProgram,
|
||||
SGXTQ_PDSSECFRAGS* pePDSSec);
|
||||
|
||||
PVRSRV_ERROR SGXTQ_ShaderFromRop(IMG_BYTE byCustomRop3,
|
||||
SGXTQ_USEFRAGS* peUSEProg,
|
||||
SGXTQ_PDSPRIMFRAGS* pePDSPrim,
|
||||
IMG_UINT32* pui32NumLayers);
|
||||
|
||||
IMG_UINT32 SGXTQ_GetStrideGran(IMG_UINT32 ui32LineStride, IMG_UINT32 ui32BytesPerPixel);
|
||||
|
||||
PVRSRV_ERROR SGXTQ_GetSurfaceStride(SGXTQ_SURFACE* psSurf,
|
||||
IMG_UINT32 ui32BytesPP,
|
||||
IMG_BOOL bIsInput,
|
||||
IMG_BOOL bStridedBlitEnabled,
|
||||
IMG_UINT32* pi32LineStride);
|
||||
|
||||
|
||||
PVRSRV_ERROR SGXTQ_GetSurfaceWidth(SGXTQ_SURFACE* psSurf,
|
||||
IMG_UINT32 ui32BytesPP,
|
||||
IMG_BOOL bIsInput,
|
||||
IMG_BOOL bStridedBlitEnabled,
|
||||
IMG_UINT32* pui32RightEdge);
|
||||
|
||||
IMG_VOID SGXTQ_SetTAGState(SGXTQ_PDS_UPDATE* psPDSUpdate,
|
||||
IMG_UINT32 ui32LayerNo,
|
||||
IMG_UINT32 ui32SrcDevVAddr,
|
||||
SGXTQ_FILTERTYPE eFilter,
|
||||
IMG_UINT32 ui32Width,
|
||||
IMG_UINT32 ui32Height,
|
||||
IMG_UINT32 ui32Stride,
|
||||
IMG_UINT32 ui32TAGFormat,
|
||||
IMG_UINT32 ui32BytesPP,
|
||||
IMG_BOOL bNewPixelHandling,
|
||||
SGXTQ_MEMLAYOUT eMemLayout);
|
||||
|
||||
#if ! defined(SGX_FEATURE_USE_VEC34)
|
||||
PVRSRV_ERROR SGXTQ_SetupStridedBlit(IMG_UINT32 * pui32TAGState,
|
||||
SGXTQ_SURFACE *psSrcSurf,
|
||||
SGXTQ_USEFRAGS eUSEProg,
|
||||
IMG_UINT32 ui32SrcLineStride,
|
||||
IMG_UINT32 ui32SrcBytesPerPixel,
|
||||
IMG_UINT32 ui32PassesRequired,
|
||||
IMG_UINT32 ui32CurPass,
|
||||
IMG_UINT32 aui32Limms[]);
|
||||
#endif
|
||||
|
||||
|
||||
IMG_VOID SGXTQ_SetUSSEKick(SGXTQ_PDS_UPDATE *psPDSUpdate,
|
||||
IMG_DEV_VIRTADDR sUSEExecAddr,
|
||||
IMG_DEV_VIRTADDR sUSEExecBase,
|
||||
IMG_UINT32 ui32NumTempsRegs);
|
||||
|
||||
|
||||
IMG_VOID SGXTQ_SetDMAState(SGXTQ_PDS_UPDATE *psPDSUpdate,
|
||||
IMG_DEV_VIRTADDR sDevVaddr,
|
||||
IMG_UINT32 ui32LineLen,
|
||||
IMG_UINT32 ui32LineNo,
|
||||
IMG_UINT32 ui32Offset);
|
||||
|
||||
|
||||
PVRSRV_ERROR SGXTQ_CreateUSEEOTHandler(SGXTQ_CLIENT_TRANSFER_CONTEXT *psTQContext,
|
||||
IMG_UINT32 *aui32PBEState,
|
||||
SGXTQ_USEEOTHANDLER eEot,
|
||||
IMG_UINT32 ui32UV,
|
||||
IMG_UINT32 ui32DstBytesPP,
|
||||
IMG_BOOL bPDumpContinuous);
|
||||
|
||||
|
||||
PVRSRV_ERROR SGXTQ_CreatePDSPixeventHandler(SGXTQ_CLIENT_TRANSFER_CONTEXT * psTQContext,
|
||||
SGXTQ_RESOURCE * psEORHandler,
|
||||
SGXTQ_RESOURCE * psEOTHandler,
|
||||
SGXTQ_PDSPIXEVENTHANDLER ePixev,
|
||||
IMG_BOOL bPDumpContinuous);
|
||||
|
||||
PVRSRV_ERROR SGXTQ_SetPBEState(IMG_RECT * psDstRect,
|
||||
SGXTQ_MEMLAYOUT eMemLayout,
|
||||
IMG_UINT32 ui32DstWidth,
|
||||
IMG_UINT32 ui32DstHeight,
|
||||
IMG_UINT32 ui32DstLineStride,
|
||||
IMG_UINT32 ui32DstPBEPackMode,
|
||||
IMG_UINT32 ui32DstDevVAddr,
|
||||
IMG_UINT32 ui32SrcSel,
|
||||
SGXTQ_ROTATION eRotation,
|
||||
IMG_BOOL bEnableDithering,
|
||||
IMG_BOOL bNewPixelHandling,
|
||||
IMG_UINT32 * aui32PBEState);
|
||||
|
||||
|
||||
IMG_VOID SGXTQ_SetupPixeventRegs(SGXTQ_CLIENT_TRANSFER_CONTEXT *psTQContext,
|
||||
SGXMKIF_TRANSFERCMD *psSubmit,
|
||||
SGXTQ_RESOURCE *psPixEvent);
|
||||
|
||||
IMG_VOID SGXTQ_SetupTransferRegs(SGXTQ_CLIENT_TRANSFER_CONTEXT *psTQContext,
|
||||
IMG_UINT32 ui32BIFTile0Config,
|
||||
SGXMKIF_TRANSFERCMD *psSubmit,
|
||||
SGXTQ_RESOURCE *psPixEvent,
|
||||
IMG_UINT32 ui32NumLayers,
|
||||
IMG_UINT32 ui32ScanDirection,
|
||||
IMG_UINT32 ui32ISPRenderType);
|
||||
|
||||
|
||||
PVRSRV_ERROR SGXTQ_CreatePDSPrimResource(SGXTQ_CLIENT_TRANSFER_CONTEXT * psTQContext,
|
||||
SGXTQ_PDSPRIMFRAGS ePDSPrim,
|
||||
SGXTQ_PDS_UPDATE * psPDSValues,
|
||||
IMG_BOOL bPDumpContinuous);
|
||||
|
||||
|
||||
PVRSRV_ERROR SGXTQ_CreatePDSSecResource(SGXTQ_CLIENT_TRANSFER_CONTEXT * psTQContext,
|
||||
SGXTQ_PDSSECFRAGS ePDSSec,
|
||||
SGXTQ_PDS_UPDATE * psPDSValues,
|
||||
IMG_BOOL bPDumpContinuous);
|
||||
|
||||
|
||||
PVRSRV_ERROR SGXTQ_CreateUSESecondaryResource(SGXTQ_CLIENT_TRANSFER_CONTEXT * psTQContext,
|
||||
SGXTQ_PDSSECFRAGS ePDSSec,
|
||||
SGXTQ_PDS_UPDATE * psPDSValues,
|
||||
IMG_BOOL bPDumpContinuous);
|
||||
|
||||
|
||||
PVRSRV_ERROR SGXTQ_CreateUSEResource(SGXTQ_CLIENT_TRANSFER_CONTEXT * psTQContext,
|
||||
SGXTQ_USEFRAGS eUSEId,
|
||||
IMG_UINT32 * aui32USELimm,
|
||||
IMG_BOOL bPDumpContinuous);
|
||||
|
||||
|
||||
IMG_VOID SGXTQ_SetupTransferRenderBox(SGXMKIF_TRANSFERCMD *psSubmit,
|
||||
IMG_UINT32 x0,
|
||||
IMG_UINT32 y0,
|
||||
IMG_UINT32 x1,
|
||||
IMG_UINT32 y1);
|
||||
|
||||
PVRSRV_ERROR SGXTQ_SetupTransferClipRenderBox(SGXMKIF_TRANSFERCMD *psSubmit,
|
||||
IMG_UINT32 x0,
|
||||
IMG_UINT32 y0,
|
||||
IMG_UINT32 x1,
|
||||
IMG_UINT32 y1,
|
||||
IMG_UINT32 ui32DstWidth,
|
||||
IMG_UINT32 ui32DstHeight);
|
||||
|
||||
PVRSRV_ERROR SGXTQ_CreateISPResource(SGXTQ_CLIENT_TRANSFER_CONTEXT *psTQContext,
|
||||
SGXTQ_RESOURCE *psPrimary,
|
||||
SGXTQ_RESOURCE *psSecondary,
|
||||
IMG_RECT *psDstRect,
|
||||
SGXTQ_TSP_COORDS *psTSPCoords,
|
||||
IMG_BOOL bConservativeResUsage,
|
||||
IMG_BOOL bInvertTriangle,
|
||||
IMG_UINT32 ui32NumLayers,
|
||||
IMG_BOOL bPDumpContinuous,
|
||||
IMG_UINT32 ui32Flags);
|
||||
|
||||
|
||||
PVRSRV_ERROR SGXTQ_CreateISPF2DResource(SGXTQ_CLIENT_TRANSFER_CONTEXT *psTQContext,
|
||||
SGXTQ_RESOURCE *psPrimary,
|
||||
SGXTQ_RESOURCE *psSecondary,
|
||||
IMG_RECT *psDstRect,
|
||||
SGXTQ_TSP_SINGLE *psTSPCoords,
|
||||
IMG_UINT32 ui32NumRects,
|
||||
IMG_BOOL bTranslucent,
|
||||
IMG_BOOL bPDumpContinuous);
|
||||
|
||||
IMG_VOID SGXTQ_ClampInputRects(IMG_RECT *psSrcRect,
|
||||
IMG_UINT32 ui32SrcWidth,
|
||||
IMG_UINT32 ui32SrcHeight,
|
||||
IMG_RECT *psDstRect,
|
||||
IMG_UINT32 ui32DstWidth,
|
||||
IMG_UINT32 ui32DstHeight);
|
||||
|
||||
IMG_VOID SGXTQ_CopyToStagingBuffer(IMG_VOID *pvSBLinAddr,
|
||||
IMG_UINT32 ui32SBStrideInBytes,
|
||||
IMG_PBYTE pbySrcLinAddr,
|
||||
IMG_UINT32 ui32SrcStrideInBytes,
|
||||
IMG_UINT32 ui32BytesPP,
|
||||
IMG_UINT32 ui32PixelByteStride,
|
||||
IMG_UINT32 ui32HeightToCopy,
|
||||
IMG_UINT32 ui32WidthToCopy);
|
||||
|
||||
#if defined(SGX_FEATURE_2D_HARDWARE) && defined (PDUMP)
|
||||
IMG_VOID SGXTQ_PDump2DCmd(IMG_CONST PVRSRV_CONNECTION* psConnection, SGX_QUEUETRANSFER * psQueueTransfer, PSGXMKIF_2DCMD ps2DCmd);
|
||||
#endif //#if defined(SGX_FEATURE_2D_HARDWARE) && defined (PDUMP)
|
||||
|
||||
#if defined(PDUMP) && defined(SGXTQ_DEBUG_PDUMP_TQINPUT)
|
||||
IMG_VOID SGXTQ_PDumpTQInput(IMG_CONST PVRSRV_CONNECTION * psConnection,
|
||||
SGX_QUEUETRANSFER * psQueueTransfer,
|
||||
IMG_UINT32 ui32FenceId);
|
||||
#endif//#if defined(PDUMP) && defined(SGXTQ_DEBUG_PDUMP_TQINPUT)
|
||||
|
||||
#if defined(SGX_FEATURE_PTLA)
|
||||
PVRSRV_ERROR SGXSubmitTransfer(IMG_HANDLE hTransferContext,
|
||||
SGX_SUBMITTRANSFER *psSubmitTransfer);
|
||||
|
||||
#if defined(__psp2__)
|
||||
IMG_INTERNAL
|
||||
PVRSRV_ERROR IMG_CALLCONV SGXQueue2DTransfer(PVRSRV_DEV_DATA *psDevData,
|
||||
IMG_HANDLE hTransferContext,
|
||||
SGX_QUEUETRANSFER *psQueueTransfer);
|
||||
#else
|
||||
PVRSRV_ERROR IMG_CALLCONV SGXQueue2DTransfer(IMG_HANDLE hTransferContext,
|
||||
SGX_QUEUETRANSFER *psQueueTransfer);
|
||||
#endif
|
||||
#endif /* defined(SGX_FEATURE_PTLA) */
|
||||
|
||||
#if defined(SGX_FEATURE_2D_HARDWARE)
|
||||
PVRSRV_ERROR Prepare2DCoreBlit(SGXTQ_CLIENT_TRANSFER_CONTEXT *psTQContext,
|
||||
SGX_QUEUETRANSFER *psQueueTransfer,
|
||||
SGXMKIF_2DCMD_SUBMIT *ps2DSubmit);
|
||||
#endif /* defined(SGX_FEATURE_2D_HARDWARE) */
|
||||
|
||||
#endif /* TRANSFER_QUEUE */
|
||||
#endif /*_SGXTRANSFER_CLIENT_H_*/
|
||||
|
||||
/******************************************************************************
|
||||
End of file (sgxtransfer_client.h)
|
||||
******************************************************************************/
|
@ -0,0 +1,112 @@
|
||||
/*!****************************************************************************
|
||||
@File sgxutils_client.h
|
||||
|
||||
@Title Device specific utility routines declarations
|
||||
|
||||
@Author Imagination Technologies
|
||||
|
||||
@Date 15 / 5 / 06
|
||||
|
||||
@Copyright Copyright 2006-2008 by Imagination Technologies Limited.
|
||||
All rights reserved. No part of this software, either material
|
||||
or conceptual may be copied or distributed, transmitted,
|
||||
transcribed, stored in a retrieval system or translated into
|
||||
any human or computer language in any form by any means,
|
||||
electronic, mechanical, manual or otherwise, or disclosed
|
||||
to third parties without the express written permission of
|
||||
Imagination Technologies Limited, Home Park Estate,
|
||||
Kings Langley, Hertfordshire, WD4 8LZ, U.K.
|
||||
|
||||
@Platform Generic
|
||||
|
||||
@Description Inline functions/structures specific to SGX
|
||||
|
||||
@DoxygenVer
|
||||
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
Modifications :-
|
||||
$Log: sgxutils_client.h $
|
||||
******************************************************************************/
|
||||
|
||||
// FIXME:Services 4.0: There is some duplication between the contents
|
||||
// of this file, and sgxutils.h in srvkm.
|
||||
|
||||
|
||||
/*
|
||||
We use a buffer on the stack to contain a command followed by a
|
||||
variable number of registers.
|
||||
The SGXMKIF_CMDTA structure contains one PVRSRV_HWREG structure and is
|
||||
followed by more. The function Update3DRegs() writes these structures
|
||||
up to a maximum of NUM_3D_REGS_UPDATED.
|
||||
*/
|
||||
#define SGX_NUM_3D_REGS_UPDATED 46
|
||||
#define SGX_TEMP_CMD_BUF_SIZE (sizeof(SGXMKIF_CMDTA) + (SGX_NUM_3D_REGS_UPDATED-1) * sizeof(PVRSRV_HWREG))/sizeof(IMG_UINT32)
|
||||
|
||||
#define GET_CCB_SPACE(WOff, ROff, CCBSize) \
|
||||
((((ROff) - (WOff)) + ((CCBSize) - 1)) & ((CCBSize) - 1))
|
||||
|
||||
#define UPDATE_CCB_OFFSET(Off, PacketSize, CCBSize) \
|
||||
(Off) = (((Off) + (PacketSize)) & ((CCBSize) - 1))
|
||||
|
||||
/******************************************************************************
|
||||
FUNCTION : SGXCalcContextCCBParamSize
|
||||
|
||||
PURPOSE : Calculate param size including alloc granularity limitation
|
||||
|
||||
PARAMETERS : ui32ParamSize - size of params structure
|
||||
|
||||
RETURNS : Tweaked CCB param size
|
||||
******************************************************************************/
|
||||
static INLINE IMG_UINT32 SGXCalcContextCCBParamSize(IMG_UINT32 ui32ParamSize, IMG_UINT32 ui32AllocGran)
|
||||
{
|
||||
return (ui32ParamSize + (ui32AllocGran - 1)) & ~(ui32AllocGran - 1);
|
||||
}
|
||||
|
||||
// FIXME: Services 4.0: Temporarily required by sgxkick.c
|
||||
#define CURRENT_CCB_OFFSET(psCCB) (*(psCCB)->pui32WriteOffset)
|
||||
|
||||
#if defined (PDUMP)
|
||||
IMG_VOID DumpBufferArray(PSGX_KICKTA_DUMP_BUFFER psBufferArray,
|
||||
IMG_UINT32 ui32BufferArrayLength,
|
||||
IMG_BOOL bDumpPolls);
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
PVRSRV_ERROR CreateCCB(PVRSRV_DEV_DATA *psDevData,
|
||||
IMG_UINT32 ui32CCBSize,
|
||||
IMG_UINT32 ui32AllocGran,
|
||||
IMG_UINT32 ui32OverrunSize,
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_SID hDevMemHeap,
|
||||
#else
|
||||
IMG_HANDLE hDevMemHeap,
|
||||
#endif
|
||||
SGX_CLIENT_CCB **ppsCCB);
|
||||
|
||||
IMG_VOID DestroyCCB(PVRSRV_DEV_DATA *psDevData,
|
||||
SGX_CLIENT_CCB *psCCB);
|
||||
|
||||
#if defined (SUPPORT_SID_INTERFACE)
|
||||
IMG_PVOID SGXAcquireCCB(PVRSRV_DEV_DATA *psDevData, SGX_CLIENT_CCB *psCCB, IMG_UINT32 ui32CmdSize, IMG_EVENTSID hOSEvent);
|
||||
#else
|
||||
IMG_PVOID SGXAcquireCCB(PVRSRV_DEV_DATA *psDevData, SGX_CLIENT_CCB *psCCB, IMG_UINT32 ui32CmdSize, IMG_HANDLE hOSEvent);
|
||||
#endif
|
||||
|
||||
IMG_INTERNAL PVRSRV_ERROR AllocSharedMem(const PVRSRV_CONNECTION *psConnection,
|
||||
IMG_UINT32 ui32Flags,
|
||||
IMG_UINT32 ui32Size,
|
||||
IMG_VOID **ppvCpuVAddrUM,
|
||||
IMG_VOID **ppvCpuVAddrKM);
|
||||
|
||||
IMG_INTERNAL PVRSRV_ERROR FreeSharedMem(const PVRSRV_CONNECTION *psConnection,
|
||||
IMG_VOID *pvCpuVAddrUM);
|
||||
|
||||
/* TODO */
|
||||
#define PVRSRVMapKernelMemInfoToClient(A,B) (PVRSRV_ERROR_NOT_SUPPORTED)
|
||||
|
||||
/******************************************************************************
|
||||
End of file (sgxutils_client.h)
|
||||
******************************************************************************/
|
55
include/gpu_es4/eurasia/services4/system/psp2/sysinfo.h
Normal file
@ -0,0 +1,55 @@
|
||||
/*!****************************************************************************
|
||||
@File sysinfo.h
|
||||
|
||||
@Title System Description Header
|
||||
|
||||
@Author Imagination Technologies
|
||||
|
||||
@date 9/10/2007
|
||||
|
||||
@Copyright Copyright 2003-2009 by Imagination Technologies Limited.
|
||||
All rights reserved. No part of this software, either
|
||||
material or conceptual may be copied or distributed,
|
||||
transmitted, transcribed, stored in a retrieval system
|
||||
or translated into any human or computer language in any
|
||||
form by any means, electronic, mechanical, manual or
|
||||
other-wise, or disclosed to third parties without the
|
||||
express written permission of Imagination Technologies
|
||||
Limited, Unit 8, HomePark Industrial Estate,
|
||||
King's Langley, Hertfordshire, WD4 8LZ, U.K.
|
||||
|
||||
@Platform generic
|
||||
|
||||
@Description This header provides system-specific declarations and macros
|
||||
|
||||
@DoxygenVer
|
||||
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
Modifications :-
|
||||
$Log: sysinfo.h $
|
||||
*****************************************************************************/
|
||||
|
||||
#if !defined(__SYSINFO_H__)
|
||||
#define __SYSINFO_H__
|
||||
|
||||
/*!< System specific poll/timeout details */
|
||||
#if defined(PVR_LINUX_USING_WORKQUEUES)
|
||||
/*
|
||||
* The workqueue based 3rd party display driver may be blocked for up
|
||||
* to 500ms waiting for a vsync when the screen goes blank, so we
|
||||
* need to wait longer for the hardware if a flush of the swap chain is
|
||||
* required.
|
||||
*/
|
||||
#define MAX_HW_TIME_US (1000000)
|
||||
#define WAIT_TRY_COUNT (20000)
|
||||
#else
|
||||
#define MAX_HW_TIME_US (500000)
|
||||
#define WAIT_TRY_COUNT (10000)
|
||||
#endif
|
||||
|
||||
|
||||
#define SYS_DEVICE_COUNT 15 /* SGX, DISPLAYCLASS (external), BUFFERCLASS (external) */
|
||||
|
||||
#endif /* __SYSINFO_H__ */
|
155
include/gpu_es4/psp2_pvr_defs.h
Normal file
@ -0,0 +1,155 @@
|
||||
#ifndef PSP2_PVR_DEFS_H
|
||||
#define PSP2_PVR_DEFS_H
|
||||
|
||||
// Contains platform-specific definitions for PSP2
|
||||
|
||||
#include <kernel.h>
|
||||
|
||||
#include "eurasia/include4/services.h"
|
||||
#include "eurasia/include4/sgxapi.h"
|
||||
|
||||
#define PSP2_SWAPCHAIN_MAX_PENDING_COUNT 1
|
||||
#define PSP2_SWAPCHAIN_MAX_BUFFER_NUM 4
|
||||
#define PSP2_SWAPCHAIN_MIN_INTERVAL 0
|
||||
#define PSP2_SWAPCHAIN_MAX_INTERVAL 6
|
||||
|
||||
#define PVRSRV_PSP2_GENERIC_MEMORY_ATTRIB (PVRSRV_MEM_READ \
|
||||
| PVRSRV_MEM_WRITE \
|
||||
| PVRSRV_HAP_NO_GPU_VIRTUAL_ON_ALLOC \
|
||||
| PVRSRV_MEM_CACHE_CONSISTENT \
|
||||
| PVRSRV_MEM_NO_SYNCOBJ)
|
||||
|
||||
#define PVRSRV_PSP2_GENERIC_MEMORY_ATTRIB_NC (PVRSRV_MEM_READ \
|
||||
| PVRSRV_MEM_WRITE \
|
||||
| PVRSRV_HAP_NO_GPU_VIRTUAL_ON_ALLOC \
|
||||
| PVRSRV_MEM_NO_SYNCOBJ)
|
||||
|
||||
#define PVRSRV_PSP2_GENERIC_MEMORY_ATTRIB_RDONLY_NC (PVRSRV_MEM_READ \
|
||||
| PVRSRV_HAP_NO_GPU_VIRTUAL_ON_ALLOC \
|
||||
| PVRSRV_MEM_NO_SYNCOBJ)
|
||||
|
||||
#define PVRSRV_PSP2_COMPULSORY_ALLOC_FLAGS (PVRSRV_MEM_NO_SYNCOBJ | PVRSRV_HAP_NO_GPU_VIRTUAL_ON_ALLOC)
|
||||
|
||||
#define SGX_PIXELSHADER_SHARED_HEAP_ID 0x12
|
||||
#define SGX_VERTEXSHADER_SHARED_HEAP_ID 0x13
|
||||
|
||||
#define SGX_PIXSHADER_SHARED_USE_CODE_BASE_INDEX 9
|
||||
#define SGX_VTXSHADER_SHARED_USE_CODE_BASE_INDEX 8
|
||||
|
||||
#define SGX_KICKTA_SCENEFLAGS_VDM_BUFFER_HIGHMARK 0x00000001
|
||||
#define SGX_KICKTA_SCENEFLAGS_VERTEX_BUFFER_HIGHMARK 0x00000002
|
||||
#define SGX_KICKTA_SCENEFLAGS_FRAGMENT_BUFFER_HIGHMARK 0x00000004
|
||||
#define SGX_KICKTA_SCENEFLAGS_FRAGMENT_USSE_BUFFER_HIGHMARK 0x00000008
|
||||
#define SGX_KICKTA_SCENEFLAGS_MIDSCENERENDER 0x00000010
|
||||
|
||||
#define SGX_ADDRTFLAGS_CUSTOM_MULTISAMPLELOCATIONS 0x00010000
|
||||
#define SGX_ADDRTFLAGS_MACROTILE_SYNC 0x00020000
|
||||
#define SGX_ADDRTFLAGS_CUSTOM_MACROTILE_COUNTS 0x00040000
|
||||
|
||||
typedef struct _PVRSRV_OP_CLIENT_SYNC_INFO_
|
||||
{
|
||||
PVRSRV_CLIENT_SYNC_INFO *psInfoOld;
|
||||
PVRSRV_CLIENT_SYNC_INFO *psInfoNew;
|
||||
} PVRSRV_OP_CLIENT_SYNC_INFO;
|
||||
|
||||
typedef struct _PVRSRV_MEM_INFO_
|
||||
{
|
||||
IMG_PVOID pBase;
|
||||
IMG_UINT32 ui32Size;
|
||||
IMG_UINT32 ui32Flags;
|
||||
} PVRSRV_MEM_INFO;
|
||||
|
||||
typedef struct _SGX_RTINFO_
|
||||
{
|
||||
IMG_UINT32 ui32NumPixelsX;
|
||||
IMG_UINT32 ui32NumPixelsY;
|
||||
IMG_UINT16 ui16MSAASamplesInX;
|
||||
IMG_UINT16 ui16MSAASamplesInY;
|
||||
|
||||
IMG_BOOL bMacrotileSync;
|
||||
} SGX_RTINFO;
|
||||
|
||||
typedef struct _SGX_RTINFO_EXT_
|
||||
{
|
||||
IMG_UINT32 ui32NumPixelsInX;
|
||||
IMG_UINT32 ui32NumPixelsInY;
|
||||
IMG_UINT16 ui16MSAASamplesInX;
|
||||
IMG_UINT16 ui16MSAASamplesInY;
|
||||
|
||||
IMG_UINT32 ui32BGObjUCoord;
|
||||
|
||||
IMG_DEV_VIRTADDR sSpecialObjDevVAddr;
|
||||
IMG_UINT32 ui32Unknown;
|
||||
|
||||
IMG_UINT32 ui32BGObjTag;
|
||||
IMG_UINT32 ui32NumRTData;
|
||||
IMG_UINT32 ui32MTEMultiSampleCtl;
|
||||
IMG_PVOID pvRTDataSet;
|
||||
|
||||
IMG_UINT32 ui32MTileNumber;
|
||||
IMG_UINT32 ui32MTileX1;
|
||||
IMG_UINT32 ui32MTileX2;
|
||||
IMG_UINT32 ui32MTileX3;
|
||||
IMG_UINT32 ui32MTileY1;
|
||||
IMG_UINT32 ui32MTileY2;
|
||||
IMG_UINT32 ui32MTileY3;
|
||||
IMG_UINT32 ui32MTileStride;
|
||||
|
||||
IMG_UINT32 ui32Flags;
|
||||
} SGX_RTINFO_EXT;
|
||||
|
||||
IMG_INT PVRSRVWaitSyncOp(IMG_SID hKernelSyncInfoModObj, IMG_UINT32 *pui32Timeout);
|
||||
|
||||
IMG_INT PVRSRV_BridgeDispatchKM(IMG_UINT32 cmd, IMG_PVOID psBridgePackageKM);
|
||||
|
||||
PVRSRV_ERROR PVRSRVRegisterMemBlock(PVRSRV_DEV_DATA *psDevData, SceUID memblockUid, IMG_SID *phMemBlockProcRef, IMG_BOOL bUnmapFromCPU);
|
||||
|
||||
PVRSRV_ERROR PVRSRVUnregisterMemBlock(PVRSRV_DEV_DATA *psDevData, SceUID memblockUid);
|
||||
|
||||
PVRSRV_ERROR PVRSRVMapMemoryToGpu(
|
||||
PVRSRV_DEV_DATA *psDevData,
|
||||
IMG_SID hDevMemContext,
|
||||
IMG_SID hHeapHandle,
|
||||
IMG_UINT32 ui32Size,
|
||||
IMG_UINT32 ui32GpuDevVaddr,
|
||||
IMG_PVOID pMemBase,
|
||||
IMG_UINT32 ui32Flags,
|
||||
IMG_DEV_VIRTADDR *psMappedDevVAddr);
|
||||
|
||||
PVRSRV_ERROR PVRSRVUnmapMemoryFromGpu(
|
||||
PVRSRV_DEV_DATA *psDevData,
|
||||
IMG_PVOID pMemBase,
|
||||
IMG_SID hHeapHandle,
|
||||
IMG_BOOL bSync);
|
||||
|
||||
PVRSRV_ERROR PVRSRVCheckMappedMemory(
|
||||
PVRSRV_DEV_DATA *psDevData,
|
||||
IMG_SID hDevMemContext,
|
||||
IMG_PVOID pMemBase,
|
||||
IMG_UINT32 ui32Size,
|
||||
IMG_UINT32 ui32Flags);
|
||||
|
||||
PVRSRV_ERROR PVRSRVGetMemInfo(PVRSRV_DEV_DATA *psDevData, IMG_PVOID pMemBase, PVRSRV_MEM_INFO *psMemInfo);
|
||||
|
||||
PVRSRV_ERROR IMG_CALLCONV SGXTransferControlStream(
|
||||
IMG_UINT32 *pui32CtrlStream,
|
||||
IMG_UINT32 ui32CtrlSizeInDwords,
|
||||
PVRSRV_DEV_DATA *psDevData,
|
||||
IMG_HANDLE hTransferContext,
|
||||
PVRSRV_CLIENT_SYNC_INFO *psSyncInfo,
|
||||
IMG_BOOL bTASync,
|
||||
IMG_BOOL b3DSync,
|
||||
SGX_STATUS_UPDATE *psStatusUpdate);
|
||||
|
||||
PVRSRV_ERROR IMG_CALLCONV SGXGetRenderTargetInfo(PVRSRV_DEV_DATA *psDevData, IMG_HANDLE hRTDataSet, SGX_RTINFO *psRTInfo);
|
||||
|
||||
PVRSRV_ERROR IMG_CALLCONV SGXGetRenderTargetInfoExt(PVRSRV_DEV_DATA *psDevData, IMG_HANDLE hRTDataSet, SGX_RTINFO_EXT *psRTInfoExt);
|
||||
|
||||
PVRSRV_ERROR IMG_CALLCONV SGXGetRenderTargetDriverMemBlock(PVRSRV_DEV_DATA *psDevData, IMG_HANDLE hRTDataSet, IMG_INT32 *pi32DriverMemBlockUID, IMG_BOOL *pbInternalUID);
|
||||
|
||||
PVRSRV_ERROR IMG_CALLCONV SGXWaitTransfer(PVRSRV_DEV_DATA *psDevData, IMG_HANDLE hTransferContext);
|
||||
|
||||
int sceGpuSignalWait(void *unkTLS, unsigned int timeout);
|
||||
|
||||
|
||||
#endif
|