Compare commits
117 Commits
mesa_7_7_r
...
mesa_7_7_r
Author | SHA1 | Date | |
---|---|---|---|
|
ba167f812c | ||
|
8fc433fa0f | ||
|
bb64c9bcdf | ||
|
9dbd47fc6b | ||
|
9921b3048e | ||
|
013cf1d63d | ||
|
7d84169865 | ||
|
7005f7cd1a | ||
|
c994f08eb1 | ||
|
f622b649fb | ||
|
76b3523d75 | ||
|
978b80c8e3 | ||
|
3cd745515e | ||
|
b2953ee1a6 | ||
|
d74cd04e61 | ||
|
ca8a2150c7 | ||
|
4071d065c2 | ||
|
1446f30875 | ||
|
412aeeed1c | ||
|
6212c8103a | ||
|
2cd2341ce8 | ||
|
d642edd2d1 | ||
|
8d2f3434c5 | ||
|
fe8e18bcd4 | ||
|
4fb5ae7233 | ||
|
5683d7d43f | ||
|
e5bc2a19bd | ||
|
225bc70b77 | ||
|
ca7cd3ade0 | ||
|
fb83fa26c4 | ||
|
8d8fd9776e | ||
|
1ef8c493b2 | ||
|
cd4d806a47 | ||
|
12fdef20b0 | ||
|
47e128331a | ||
|
bc0532b0ed | ||
|
8ac2503397 | ||
|
c74afe0c46 | ||
|
8df551c46b | ||
|
ea487c6d0b | ||
|
7b5eba453e | ||
|
7ed749c062 | ||
|
80a3944a4d | ||
|
6c1fc2b2a5 | ||
|
fe38c16021 | ||
|
d23bb22f62 | ||
|
12a440abfb | ||
|
4bf96ebdae | ||
|
ba3fedf246 | ||
|
8350648401 | ||
|
7324c22024 | ||
|
68d206fafa | ||
|
69ed1147a8 | ||
|
efb582fde7 | ||
|
b210739aad | ||
|
b1a87a3e0b | ||
|
25fd168f03 | ||
|
b803abbaad | ||
|
5820dae4ec | ||
|
fc5f07de1a | ||
|
d245a951f3 | ||
|
905e12f3cc | ||
|
56de7e222e | ||
|
34a0b22a74 | ||
|
9e29242331 | ||
|
a0ac8fc7d8 | ||
|
0a6acecb35 | ||
|
305d4f147e | ||
|
772e004781 | ||
|
f1172c4030 | ||
|
84de1672d3 | ||
|
4ca8e1680e | ||
|
d6a993135f | ||
|
005242f166 | ||
|
d3208678c2 | ||
|
97cbf4943a | ||
|
a99bf51bc8 | ||
|
28474e1225 | ||
|
bb6e3af939 | ||
|
a38776419b | ||
|
791b754687 | ||
|
89e747920f | ||
|
5a25adb646 | ||
|
3910e88ebf | ||
|
6c41bb25a2 | ||
|
8cde43eb19 | ||
|
2b5618fc5b | ||
|
c3b7f93e02 | ||
|
235c0c8134 | ||
|
0a107d36c2 | ||
|
b094683e7c | ||
|
592c8522a2 | ||
|
8f4d3613da | ||
|
9ed77d12b1 | ||
|
832593772d | ||
|
2a5cd95e24 | ||
|
ccea09cd3a | ||
|
67a0628ab2 | ||
|
908a3e56cc | ||
|
0c75854cc1 | ||
|
4598942b1b | ||
|
db352f58fa | ||
|
b47f7316da | ||
|
ba97b98842 | ||
|
b9f4a0bd2b | ||
|
d8da270a2b | ||
|
77ff3a5619 | ||
|
64102a5625 | ||
|
bb80a93c9e | ||
|
232e59ca6f | ||
|
9077ddaa25 | ||
|
a7e4a311e9 | ||
|
b2581dcab4 | ||
|
e84dddde9b | ||
|
c8cdce6657 | ||
|
8c26cefec7 | ||
|
910aaed4da |
2
Makefile
2
Makefile
@@ -182,7 +182,7 @@ ultrix-gcc:
|
||||
|
||||
# Rules for making release tarballs
|
||||
|
||||
VERSION=7.7-devel
|
||||
VERSION=7.7-rc2
|
||||
DIRECTORY = Mesa-$(VERSION)
|
||||
LIB_NAME = MesaLib-$(VERSION)
|
||||
DEMO_NAME = MesaDemos-$(VERSION)
|
||||
|
17
configure.ac
17
configure.ac
@@ -1143,7 +1143,14 @@ yes)
|
||||
GALLIUM_STATE_TRACKERS_DIRS=glx
|
||||
;;
|
||||
dri)
|
||||
test "x$enable_egl" = xyes && GALLIUM_STATE_TRACKERS_DIRS=egl
|
||||
GALLIUM_STATE_TRACKERS_DIRS="dri"
|
||||
if test "x$enable_egl" = xyes; then
|
||||
GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS egl"
|
||||
fi
|
||||
# Have only tested st/xorg on 1.6.0 servers
|
||||
PKG_CHECK_MODULES(XORG, [xorg-server >= 1.6.0],
|
||||
HAVE_XORG="yes"; GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS xorg",
|
||||
HAVE_XORG="no")
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
@@ -1206,13 +1213,15 @@ dnl
|
||||
dnl Gallium Intel configuration
|
||||
dnl
|
||||
AC_ARG_ENABLE([gallium-intel],
|
||||
[AS_HELP_STRING([--disable-gallium-intel],
|
||||
[build gallium intel @<:@default=enabled@:>@])],
|
||||
[AS_HELP_STRING([--enable-gallium-intel],
|
||||
[build gallium intel @<:@default=disabled@:>@])],
|
||||
[enable_gallium_intel="$enableval"],
|
||||
[enable_gallium_intel=yes])
|
||||
[enable_gallium_intel=auto])
|
||||
if test "x$enable_gallium_intel" = xyes; then
|
||||
GALLIUM_WINSYS_DRM_DIRS="$GALLIUM_WINSYS_DRM_DIRS intel"
|
||||
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i915"
|
||||
elif test "x$enable_gallium_intel" = xauto; then
|
||||
GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i915"
|
||||
fi
|
||||
|
||||
dnl
|
||||
|
@@ -56,6 +56,8 @@ tbd
|
||||
<li>Fixed clipping / provoking vertex bugs in i965 driver.
|
||||
<li>Assorted build fixes for AIX.
|
||||
<li>Endianness fixes for the DRI swrast driver (bug 22767).</li>
|
||||
<li>Point sprite fixes for i915/945 driver.
|
||||
<li>Fixed assorted memory leaks (usually on error paths)
|
||||
</ul>
|
||||
|
||||
<h2>Changes</h2>
|
||||
|
@@ -4,7 +4,7 @@ TOP = ..
|
||||
|
||||
include $(TOP)/configs/current
|
||||
|
||||
SUBDIRS = "$(strip "$(PROGRAM_DIRS)")"
|
||||
SUBDIRS = $(PROGRAM_DIRS)
|
||||
|
||||
|
||||
default: message subdirs
|
||||
@@ -15,22 +15,18 @@ message:
|
||||
|
||||
|
||||
subdirs:
|
||||
@if test -n "$(SUBDIRS)" ; then \
|
||||
for dir in $(SUBDIRS) ; do \
|
||||
if [ -d $$dir ] ; then \
|
||||
(cd $$dir && $(MAKE)) || exit 1 ; \
|
||||
fi \
|
||||
done \
|
||||
fi
|
||||
@list='$(SUBDIRS)'; for dir in $$list ; do \
|
||||
if [ -d $$dir ] ; then \
|
||||
(cd $$dir && $(MAKE)) || exit 1 ; \
|
||||
fi \
|
||||
done
|
||||
|
||||
# Dummy install target
|
||||
install:
|
||||
|
||||
clean:
|
||||
-@if test -n "$(SUBDIRS)" ; then \
|
||||
for dir in $(SUBDIRS) tests ; do \
|
||||
if [ -d $$dir ] ; then \
|
||||
(cd $$dir && $(MAKE) clean) ; \
|
||||
fi \
|
||||
done \
|
||||
fi
|
||||
@list='$(SUBDIRS)'; for dir in $$list tests ; do \
|
||||
if [ -d $$dir ] ; then \
|
||||
(cd $$dir && $(MAKE) clean) ; \
|
||||
fi \
|
||||
done
|
||||
|
@@ -15,8 +15,6 @@
|
||||
|
||||
#define DEPTH 5.0f
|
||||
|
||||
static PFNGLFOGCOORDPOINTEREXTPROC glFogCoordPointer_ext;
|
||||
|
||||
static GLfloat camz;
|
||||
|
||||
static GLint fogMode;
|
||||
|
@@ -248,6 +248,7 @@ loadImageTextures(void)
|
||||
|
||||
free(texData3);
|
||||
free(texData4);
|
||||
free(image);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -17,6 +17,7 @@ SOURCES = \
|
||||
tri-depth2.c \
|
||||
tri-depthwrite.c \
|
||||
tri-depthwrite2.c \
|
||||
tri-inv.c \
|
||||
tri-param.c \
|
||||
fp-tri.c
|
||||
|
||||
|
@@ -56,7 +56,7 @@ static void Key(unsigned char key, int x, int y)
|
||||
case 27:
|
||||
exit(1);
|
||||
default:
|
||||
return;
|
||||
break;
|
||||
}
|
||||
|
||||
glutPostRedisplay();
|
||||
|
@@ -10,7 +10,7 @@ LIB_DEP = $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) $(TOP)/$(LIB_DIR)/$(GLU_LIB_NAME) $(T
|
||||
LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLEW_LIB) -l$(GLU_LIB) -l$(GL_LIB) $(APP_LIB_DEPS)
|
||||
|
||||
PROGS = accum bitmap1 bitmap2 blendeq blendxor copy cursor depth eval fog \
|
||||
font line logo nurb olympic overlay point prim quad select \
|
||||
font line logo nurb olympic overlay point prim rgbtoppm quad select \
|
||||
shape sphere star stencil stretch texture tri wave
|
||||
|
||||
|
||||
|
@@ -86,7 +86,8 @@ static ImageRec *ImageOpen(char *fileName)
|
||||
exit(1);
|
||||
}
|
||||
if ((image->file = fopen(fileName, "rb")) == NULL) {
|
||||
return NULL;
|
||||
free(image);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
fread(image, 1, 12, image->file);
|
||||
@@ -224,6 +225,7 @@ read_rgb_texture(char *name, int *width, int *height)
|
||||
if (gbuf) free(gbuf);
|
||||
if (bbuf) free(bbuf);
|
||||
if (abuf) free(abuf);
|
||||
ImageClose(image);
|
||||
return NULL;
|
||||
}
|
||||
ptr = base;
|
||||
|
@@ -162,7 +162,7 @@ MeasureDownloadRate(void)
|
||||
const int image_bytes = align(w * h * BytesPerTexel(Format), ALIGN);
|
||||
const int bytes = image_bytes * NR_TEXOBJ;
|
||||
GLubyte *orig_texImage, *orig_getImage;
|
||||
GLubyte *texImage, *getImage;
|
||||
GLubyte *texImage;
|
||||
GLdouble t0, t1, time;
|
||||
int count;
|
||||
int i;
|
||||
@@ -184,7 +184,6 @@ MeasureDownloadRate(void)
|
||||
printf("alloc %p %p\n", orig_texImage, orig_getImage);
|
||||
|
||||
texImage = (GLubyte *)align((unsigned long)orig_texImage, ALIGN);
|
||||
getImage = (GLubyte *)align((unsigned long)orig_getImage, ALIGN);
|
||||
|
||||
for (i = 1; !(((unsigned long)texImage) & i); i<<=1)
|
||||
;
|
||||
|
@@ -84,9 +84,9 @@ static void check_link(GLuint prog)
|
||||
static void setup_uniforms()
|
||||
{
|
||||
{
|
||||
GLuint loc1f = glGetUniformLocationARB(program, "Offset1f");
|
||||
GLuint loc2f = glGetUniformLocationARB(program, "Offset2f");
|
||||
GLuint loc4f = glGetUniformLocationARB(program, "Offset4f");
|
||||
GLint loc1f = glGetUniformLocationARB(program, "Offset1f");
|
||||
GLint loc2f = glGetUniformLocationARB(program, "Offset2f");
|
||||
GLint loc4f = glGetUniformLocationARB(program, "Offset4f");
|
||||
GLfloat vecKer[] =
|
||||
{ 1.0, 0.0, 0.0, 1.0,
|
||||
0.0, 1.0, 0.0, 1.0,
|
||||
@@ -105,9 +105,9 @@ static void setup_uniforms()
|
||||
}
|
||||
|
||||
{
|
||||
GLuint loc1f = glGetUniformLocationARB(program, "KernelValue1f");
|
||||
GLuint loc2f = glGetUniformLocationARB(program, "KernelValue2f");
|
||||
GLuint loc4f = glGetUniformLocationARB(program, "KernelValue4f");
|
||||
GLint loc1f = glGetUniformLocationARB(program, "KernelValue1f");
|
||||
GLint loc2f = glGetUniformLocationARB(program, "KernelValue2f");
|
||||
GLint loc4f = glGetUniformLocationARB(program, "KernelValue4f");
|
||||
GLfloat vecKer[] =
|
||||
{ 1.0, 0.0, 0.0, 0.25,
|
||||
0.0, 1.0, 0.0, 0.25,
|
||||
|
@@ -401,6 +401,10 @@ print_screen_info(Display *dpy, int scrnum, Bool allowDirect, GLboolean limits)
|
||||
|
||||
root = RootWindow(dpy, scrnum);
|
||||
|
||||
/*
|
||||
* Find a basic GLX visual. We'll then create a rendering context and
|
||||
* query various info strings.
|
||||
*/
|
||||
visinfo = glXChooseVisual(dpy, scrnum, attribSingle);
|
||||
if (!visinfo)
|
||||
visinfo = glXChooseVisual(dpy, scrnum, attribDouble);
|
||||
@@ -409,24 +413,29 @@ print_screen_info(Display *dpy, int scrnum, Bool allowDirect, GLboolean limits)
|
||||
ctx = glXCreateContext( dpy, visinfo, NULL, allowDirect );
|
||||
|
||||
#ifdef GLX_VERSION_1_3
|
||||
{
|
||||
/* Try glXChooseFBConfig() if glXChooseVisual didn't work.
|
||||
* XXX when would that happen?
|
||||
*/
|
||||
if (!visinfo) {
|
||||
int fbAttribSingle[] = {
|
||||
GLX_RENDER_TYPE, GLX_RGBA_BIT,
|
||||
GLX_RED_SIZE, 1,
|
||||
GLX_GREEN_SIZE, 1,
|
||||
GLX_BLUE_SIZE, 1,
|
||||
GLX_DOUBLEBUFFER, GL_TRUE,
|
||||
GLX_DOUBLEBUFFER, GL_FALSE,
|
||||
None };
|
||||
int fbAttribDouble[] = {
|
||||
GLX_RENDER_TYPE, GLX_RGBA_BIT,
|
||||
GLX_RED_SIZE, 1,
|
||||
GLX_GREEN_SIZE, 1,
|
||||
GLX_BLUE_SIZE, 1,
|
||||
GLX_DOUBLEBUFFER, GL_TRUE,
|
||||
None };
|
||||
GLXFBConfig *configs = NULL;
|
||||
int nConfigs;
|
||||
|
||||
if (!visinfo)
|
||||
configs = glXChooseFBConfig(dpy, scrnum, fbAttribSingle, &nConfigs);
|
||||
if (!configs)
|
||||
configs = glXChooseFBConfig(dpy, scrnum, fbAttribDouble, &nConfigs);
|
||||
|
||||
if (configs) {
|
||||
|
@@ -35,4 +35,4 @@ include ../../Makefile.template
|
||||
.PHONY : $(COMPILER_ARCHIVE)
|
||||
|
||||
$(COMPILER_ARCHIVE):
|
||||
cd $(TOP)/src/mesa/drivers/dri/r300/compiler; make
|
||||
$(MAKE) -C $(TOP)/src/mesa/drivers/dri/r300/compiler
|
||||
|
89
src/gallium/drivers/svga/include/svga_escape.h
Normal file
89
src/gallium/drivers/svga/include/svga_escape.h
Normal file
@@ -0,0 +1,89 @@
|
||||
/**********************************************************
|
||||
* Copyright 2007-2009 VMware, Inc. All rights reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person
|
||||
* obtaining a copy of this software and associated documentation
|
||||
* files (the "Software"), to deal in the Software without
|
||||
* restriction, including without limitation the rights to use, copy,
|
||||
* modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
* of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice 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.
|
||||
*
|
||||
**********************************************************/
|
||||
|
||||
/*
|
||||
* svga_escape.h --
|
||||
*
|
||||
* Definitions for our own (vendor-specific) SVGA Escape commands.
|
||||
*/
|
||||
|
||||
#ifndef _SVGA_ESCAPE_H_
|
||||
#define _SVGA_ESCAPE_H_
|
||||
|
||||
|
||||
/*
|
||||
* Namespace IDs for the escape command
|
||||
*/
|
||||
|
||||
#define SVGA_ESCAPE_NSID_VMWARE 0x00000000
|
||||
#define SVGA_ESCAPE_NSID_DEVEL 0xFFFFFFFF
|
||||
|
||||
|
||||
/*
|
||||
* Within SVGA_ESCAPE_NSID_VMWARE, we multiplex commands according to
|
||||
* the first DWORD of escape data (after the nsID and size). As a
|
||||
* guideline we're using the high word and low word as a major and
|
||||
* minor command number, respectively.
|
||||
*
|
||||
* Major command number allocation:
|
||||
*
|
||||
* 0000: Reserved
|
||||
* 0001: SVGA_ESCAPE_VMWARE_LOG (svga_binary_logger.h)
|
||||
* 0002: SVGA_ESCAPE_VMWARE_VIDEO (svga_overlay.h)
|
||||
* 0003: SVGA_ESCAPE_VMWARE_HINT (svga_escape.h)
|
||||
*/
|
||||
|
||||
#define SVGA_ESCAPE_VMWARE_MAJOR_MASK 0xFFFF0000
|
||||
|
||||
|
||||
/*
|
||||
* SVGA Hint commands.
|
||||
*
|
||||
* These escapes let the SVGA driver provide optional information to
|
||||
* he host about the state of the guest or guest applications. The
|
||||
* host can use these hints to make user interface or performance
|
||||
* decisions.
|
||||
*
|
||||
* Notes:
|
||||
*
|
||||
* - SVGA_ESCAPE_VMWARE_HINT_FULLSCREEN is deprecated for guests
|
||||
* that use the SVGA Screen Object extension. Instead of sending
|
||||
* this escape, use the SVGA_SCREEN_FULLSCREEN_HINT flag on your
|
||||
* Screen Object.
|
||||
*/
|
||||
|
||||
#define SVGA_ESCAPE_VMWARE_HINT 0x00030000
|
||||
#define SVGA_ESCAPE_VMWARE_HINT_FULLSCREEN 0x00030001 // Deprecated
|
||||
|
||||
typedef
|
||||
struct {
|
||||
uint32 command;
|
||||
uint32 fullscreen;
|
||||
struct {
|
||||
int32 x, y;
|
||||
} monitorPosition;
|
||||
} SVGAEscapeHintFullscreen;
|
||||
|
||||
#endif /* _SVGA_ESCAPE_H_ */
|
201
src/gallium/drivers/svga/include/svga_overlay.h
Normal file
201
src/gallium/drivers/svga/include/svga_overlay.h
Normal file
@@ -0,0 +1,201 @@
|
||||
/**********************************************************
|
||||
* Copyright 2007-2009 VMware, Inc. All rights reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person
|
||||
* obtaining a copy of this software and associated documentation
|
||||
* files (the "Software"), to deal in the Software without
|
||||
* restriction, including without limitation the rights to use, copy,
|
||||
* modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
* of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice 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.
|
||||
*
|
||||
**********************************************************/
|
||||
|
||||
/*
|
||||
* svga_overlay.h --
|
||||
*
|
||||
* Definitions for video-overlay support.
|
||||
*/
|
||||
|
||||
#ifndef _SVGA_OVERLAY_H_
|
||||
#define _SVGA_OVERLAY_H_
|
||||
|
||||
#include "svga_reg.h"
|
||||
|
||||
/*
|
||||
* Video formats we support
|
||||
*/
|
||||
|
||||
#define VMWARE_FOURCC_YV12 0x32315659 // 'Y' 'V' '1' '2'
|
||||
#define VMWARE_FOURCC_YUY2 0x32595559 // 'Y' 'U' 'Y' '2'
|
||||
#define VMWARE_FOURCC_UYVY 0x59565955 // 'U' 'Y' 'V' 'Y'
|
||||
|
||||
typedef enum {
|
||||
SVGA_OVERLAY_FORMAT_INVALID = 0,
|
||||
SVGA_OVERLAY_FORMAT_YV12 = VMWARE_FOURCC_YV12,
|
||||
SVGA_OVERLAY_FORMAT_YUY2 = VMWARE_FOURCC_YUY2,
|
||||
SVGA_OVERLAY_FORMAT_UYVY = VMWARE_FOURCC_UYVY,
|
||||
} SVGAOverlayFormat;
|
||||
|
||||
#define SVGA_VIDEO_COLORKEY_MASK 0x00ffffff
|
||||
|
||||
#define SVGA_ESCAPE_VMWARE_VIDEO 0x00020000
|
||||
|
||||
#define SVGA_ESCAPE_VMWARE_VIDEO_SET_REGS 0x00020001
|
||||
/* FIFO escape layout:
|
||||
* Type, Stream Id, (Register Id, Value) pairs */
|
||||
|
||||
#define SVGA_ESCAPE_VMWARE_VIDEO_FLUSH 0x00020002
|
||||
/* FIFO escape layout:
|
||||
* Type, Stream Id */
|
||||
|
||||
typedef
|
||||
struct SVGAEscapeVideoSetRegs {
|
||||
struct {
|
||||
uint32 cmdType;
|
||||
uint32 streamId;
|
||||
} header;
|
||||
|
||||
// May include zero or more items.
|
||||
struct {
|
||||
uint32 registerId;
|
||||
uint32 value;
|
||||
} items[1];
|
||||
} SVGAEscapeVideoSetRegs;
|
||||
|
||||
typedef
|
||||
struct SVGAEscapeVideoFlush {
|
||||
uint32 cmdType;
|
||||
uint32 streamId;
|
||||
} SVGAEscapeVideoFlush;
|
||||
|
||||
|
||||
/*
|
||||
* Struct definitions for the video overlay commands built on
|
||||
* SVGAFifoCmdEscape.
|
||||
*/
|
||||
typedef
|
||||
struct {
|
||||
uint32 command;
|
||||
uint32 overlay;
|
||||
} SVGAFifoEscapeCmdVideoBase;
|
||||
|
||||
typedef
|
||||
struct {
|
||||
SVGAFifoEscapeCmdVideoBase videoCmd;
|
||||
} SVGAFifoEscapeCmdVideoFlush;
|
||||
|
||||
typedef
|
||||
struct {
|
||||
SVGAFifoEscapeCmdVideoBase videoCmd;
|
||||
struct {
|
||||
uint32 regId;
|
||||
uint32 value;
|
||||
} items[1];
|
||||
} SVGAFifoEscapeCmdVideoSetRegs;
|
||||
|
||||
typedef
|
||||
struct {
|
||||
SVGAFifoEscapeCmdVideoBase videoCmd;
|
||||
struct {
|
||||
uint32 regId;
|
||||
uint32 value;
|
||||
} items[SVGA_VIDEO_NUM_REGS];
|
||||
} SVGAFifoEscapeCmdVideoSetAllRegs;
|
||||
|
||||
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
*
|
||||
* VMwareVideoGetAttributes --
|
||||
*
|
||||
* Computes the size, pitches and offsets for YUV frames.
|
||||
*
|
||||
* Results:
|
||||
* TRUE on success; otherwise FALSE on failure.
|
||||
*
|
||||
* Side effects:
|
||||
* Pitches and offsets for the given YUV frame are put in 'pitches'
|
||||
* and 'offsets' respectively. They are both optional though.
|
||||
*
|
||||
*----------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
static INLINE Bool
|
||||
VMwareVideoGetAttributes(const SVGAOverlayFormat format, // IN
|
||||
uint32 *width, // IN / OUT
|
||||
uint32 *height, // IN / OUT
|
||||
uint32 *size, // OUT
|
||||
uint32 *pitches, // OUT (optional)
|
||||
uint32 *offsets) // OUT (optional)
|
||||
{
|
||||
int tmp;
|
||||
|
||||
*width = (*width + 1) & ~1;
|
||||
|
||||
if (offsets) {
|
||||
offsets[0] = 0;
|
||||
}
|
||||
|
||||
switch (format) {
|
||||
case VMWARE_FOURCC_YV12:
|
||||
*height = (*height + 1) & ~1;
|
||||
*size = (*width + 3) & ~3;
|
||||
|
||||
if (pitches) {
|
||||
pitches[0] = *size;
|
||||
}
|
||||
|
||||
*size *= *height;
|
||||
|
||||
if (offsets) {
|
||||
offsets[1] = *size;
|
||||
}
|
||||
|
||||
tmp = ((*width >> 1) + 3) & ~3;
|
||||
|
||||
if (pitches) {
|
||||
pitches[1] = pitches[2] = tmp;
|
||||
}
|
||||
|
||||
tmp *= (*height >> 1);
|
||||
*size += tmp;
|
||||
|
||||
if (offsets) {
|
||||
offsets[2] = *size;
|
||||
}
|
||||
|
||||
*size += tmp;
|
||||
break;
|
||||
|
||||
case VMWARE_FOURCC_YUY2:
|
||||
case VMWARE_FOURCC_UYVY:
|
||||
*size = *width * 2;
|
||||
|
||||
if (pitches) {
|
||||
pitches[0] = *size;
|
||||
}
|
||||
|
||||
*size *= *height;
|
||||
break;
|
||||
|
||||
default:
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#endif // _SVGA_OVERLAY_H_
|
@@ -72,19 +72,7 @@ stw_flush_frontbuffer(struct pipe_screen *screen,
|
||||
return;
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
{
|
||||
/* ensure that a random surface was not passed to us */
|
||||
struct pipe_surface *surface2;
|
||||
|
||||
if(!st_get_framebuffer_surface( fb->stfb, ST_SURFACE_FRONT_LEFT, &surface2 ))
|
||||
assert(0);
|
||||
else
|
||||
assert(surface2 == surface);
|
||||
}
|
||||
#endif
|
||||
|
||||
stw_framebuffer_present_locked(hdc, fb, ST_SURFACE_FRONT_LEFT);
|
||||
stw_framebuffer_present_locked(hdc, fb, surface);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -475,8 +475,6 @@ DrvPresentBuffers(HDC hdc, PGLPRESENTBUFFERSDATA data)
|
||||
struct stw_framebuffer *fb;
|
||||
struct pipe_screen *screen;
|
||||
struct pipe_surface *surface;
|
||||
unsigned surface_index;
|
||||
BOOL ret = FALSE;
|
||||
|
||||
fb = stw_framebuffer_from_hdc( hdc );
|
||||
if (fb == NULL)
|
||||
@@ -484,9 +482,7 @@ DrvPresentBuffers(HDC hdc, PGLPRESENTBUFFERSDATA data)
|
||||
|
||||
screen = stw_dev->screen;
|
||||
|
||||
surface_index = (unsigned)(uintptr_t)data->pPrivateData;
|
||||
if(!st_get_framebuffer_surface( fb->stfb, surface_index, &surface ))
|
||||
goto fail;
|
||||
surface = (struct pipe_surface *)data->pPrivateData;
|
||||
|
||||
#ifdef DEBUG
|
||||
if(stw_dev->trace_running) {
|
||||
@@ -520,15 +516,11 @@ DrvPresentBuffers(HDC hdc, PGLPRESENTBUFFERSDATA data)
|
||||
stw_dev->stw_winsys->present( screen, surface, hdc );
|
||||
}
|
||||
|
||||
ret = TRUE;
|
||||
|
||||
fail:
|
||||
|
||||
stw_framebuffer_update(fb);
|
||||
|
||||
stw_framebuffer_release(fb);
|
||||
|
||||
return ret;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
@@ -540,7 +532,7 @@ fail:
|
||||
BOOL
|
||||
stw_framebuffer_present_locked(HDC hdc,
|
||||
struct stw_framebuffer *fb,
|
||||
unsigned surface_index)
|
||||
struct pipe_surface *surface)
|
||||
{
|
||||
if(stw_dev->callbacks.wglCbPresentBuffers &&
|
||||
stw_dev->stw_winsys->compose) {
|
||||
@@ -551,7 +543,7 @@ stw_framebuffer_present_locked(HDC hdc,
|
||||
data.magic2 = 0;
|
||||
data.AdapterLuid = stw_dev->AdapterLuid;
|
||||
data.rect = fb->client_rect;
|
||||
data.pPrivateData = (void *)(uintptr_t)surface_index;
|
||||
data.pPrivateData = (void *)surface;
|
||||
|
||||
stw_framebuffer_release(fb);
|
||||
|
||||
@@ -559,13 +551,6 @@ stw_framebuffer_present_locked(HDC hdc,
|
||||
}
|
||||
else {
|
||||
struct pipe_screen *screen = stw_dev->screen;
|
||||
struct pipe_surface *surface;
|
||||
|
||||
if(!st_get_framebuffer_surface( fb->stfb, surface_index, &surface )) {
|
||||
/* FIXME: this shouldn't happen, but does on glean */
|
||||
stw_framebuffer_release(fb);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
if(stw_dev->trace_running) {
|
||||
@@ -590,6 +575,7 @@ DrvSwapBuffers(
|
||||
HDC hdc )
|
||||
{
|
||||
struct stw_framebuffer *fb;
|
||||
struct pipe_surface *surface = NULL;
|
||||
|
||||
fb = stw_framebuffer_from_hdc( hdc );
|
||||
if (fb == NULL)
|
||||
@@ -600,12 +586,9 @@ DrvSwapBuffers(
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* If we're swapping the buffer associated with the current context
|
||||
* we have to flush any pending rendering commands first.
|
||||
*/
|
||||
st_notify_swapbuffers( fb->stfb );
|
||||
st_swapbuffers(fb->stfb, &surface, NULL);
|
||||
|
||||
return stw_framebuffer_present_locked(hdc, fb, ST_SURFACE_BACK_LEFT);
|
||||
return stw_framebuffer_present_locked(hdc, fb, surface);
|
||||
}
|
||||
|
||||
|
||||
|
@@ -34,6 +34,7 @@
|
||||
|
||||
#include "pipe/p_thread.h"
|
||||
|
||||
struct pipe_surface;
|
||||
struct stw_pixelformat_info;
|
||||
|
||||
/**
|
||||
@@ -140,7 +141,7 @@ stw_framebuffer_allocate(
|
||||
BOOL
|
||||
stw_framebuffer_present_locked(HDC hdc,
|
||||
struct stw_framebuffer *fb,
|
||||
unsigned surface_index);
|
||||
struct pipe_surface *surface);
|
||||
|
||||
void
|
||||
stw_framebuffer_update(
|
||||
|
@@ -652,6 +652,9 @@ drv_screen_init(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
|
||||
if (serverGeneration == 1)
|
||||
xf86ShowUnusedOptions(pScrn->scrnIndex, pScrn->options);
|
||||
|
||||
if (ms->winsys_screen_init)
|
||||
ms->winsys_screen_init(pScrn);
|
||||
|
||||
return drv_enter_vt(scrnIndex, 1);
|
||||
}
|
||||
|
||||
@@ -768,6 +771,9 @@ drv_close_screen(int scrnIndex, ScreenPtr pScreen)
|
||||
drv_leave_vt(scrnIndex, 0);
|
||||
}
|
||||
|
||||
if (ms->winsys_screen_close)
|
||||
ms->winsys_screen_close(pScrn);
|
||||
|
||||
#ifdef DRI2
|
||||
if (ms->screen)
|
||||
xorg_dri2_close(pScreen);
|
||||
|
@@ -114,6 +114,11 @@ typedef struct _modesettingRec
|
||||
Bool noEvict;
|
||||
Bool debug_fallback;
|
||||
|
||||
/* winsys hocks */
|
||||
Bool (*winsys_screen_init)(ScrnInfoPtr pScr);
|
||||
Bool (*winsys_screen_close)(ScrnInfoPtr pScr);
|
||||
void *winsys_priv;
|
||||
|
||||
#ifdef DRM_MODE_FEATURE_DIRTYFB
|
||||
DamagePtr damage;
|
||||
#endif
|
||||
|
@@ -45,7 +45,8 @@
|
||||
#define DRM_VMW_UNREF_DMABUF 10
|
||||
#define DRM_VMW_FIFO_DEBUG 11
|
||||
#define DRM_VMW_FENCE_WAIT 12
|
||||
|
||||
#define DRM_VMW_OVERLAY 13
|
||||
#define DRM_VMW_CURSOR_BYPASS 14
|
||||
|
||||
/*************************************************************************/
|
||||
/**
|
||||
@@ -439,4 +440,99 @@ struct drm_vmw_fence_wait_arg {
|
||||
int32_t pad64;
|
||||
};
|
||||
|
||||
/*************************************************************************/
|
||||
/**
|
||||
* DRM_VMW_OVERLAY - Control overlays.
|
||||
*
|
||||
* This IOCTL controls the overlay units of the svga device.
|
||||
* The SVGA overlay units does not work like regular hardware units in
|
||||
* that they do not automaticaly read back the contents of the given dma
|
||||
* buffer. But instead only read back for each call to this ioctl, and
|
||||
* at any point between this call being made and a following call that
|
||||
* either changes the buffer or disables the stream.
|
||||
*/
|
||||
|
||||
/**
|
||||
* struct drm_vmw_rect
|
||||
*
|
||||
* Defines a rectangle. Used in the overlay ioctl to define
|
||||
* source and destination rectangle.
|
||||
*/
|
||||
|
||||
struct drm_vmw_rect {
|
||||
int32_t x;
|
||||
int32_t y;
|
||||
uint32_t w;
|
||||
uint32_t h;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct drm_vmw_overlay_arg
|
||||
*
|
||||
* @stream_id: Stearm to control
|
||||
* @enabled: If false all following arguments are ignored.
|
||||
* @handle: Handle to buffer for getting data from.
|
||||
* @format: Format of the overlay as understood by the host.
|
||||
* @width: Width of the overlay.
|
||||
* @height: Height of the overlay.
|
||||
* @size: Size of the overlay in bytes.
|
||||
* @pitch: Array of pitches, the two last are only used for YUV12 formats.
|
||||
* @offset: Offset from start of dma buffer to overlay.
|
||||
* @src: Source rect, must be within the defined area above.
|
||||
* @dst: Destination rect, x and y may be negative.
|
||||
*
|
||||
* Argument to the DRM_VMW_OVERLAY Ioctl.
|
||||
*/
|
||||
|
||||
struct drm_vmw_overlay_arg {
|
||||
uint32_t stream_id;
|
||||
uint32_t enabled;
|
||||
|
||||
uint32_t flags;
|
||||
uint32_t color_key;
|
||||
|
||||
uint32_t handle;
|
||||
uint32_t offset;
|
||||
int32_t format;
|
||||
uint32_t size;
|
||||
uint32_t width;
|
||||
uint32_t height;
|
||||
uint32_t pitch[3];
|
||||
|
||||
uint32_t pad64;
|
||||
struct drm_vmw_rect src;
|
||||
struct drm_vmw_rect dst;
|
||||
};
|
||||
|
||||
/*************************************************************************/
|
||||
/**
|
||||
* DRM_VMW_CURSOR_BYPASS - Give extra information about cursor bypass.
|
||||
*
|
||||
*/
|
||||
|
||||
#define DRM_VMW_CURSOR_BYPASS_ALL (1 << 0)
|
||||
#define DRM_VMW_CURSOR_BYPASS_FLAGS (1)
|
||||
|
||||
/**
|
||||
* struct drm_vmw_cursor_bypass_arg
|
||||
*
|
||||
* @flags: Flags.
|
||||
* @crtc_id: Crtc id, only used if DMR_CURSOR_BYPASS_ALL isn't passed.
|
||||
* @xpos: X position of cursor.
|
||||
* @ypos: Y position of cursor.
|
||||
* @xhot: X hotspot.
|
||||
* @yhot: Y hotspot.
|
||||
*
|
||||
* Argument to the DRM_VMW_CURSOR_BYPASS Ioctl.
|
||||
*/
|
||||
|
||||
struct drm_vmw_cursor_bypass_arg {
|
||||
uint32_t flags;
|
||||
uint32_t crtc_id;
|
||||
int32_t xpos;
|
||||
int32_t ypos;
|
||||
int32_t xhot;
|
||||
int32_t yhot;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -1,10 +1,17 @@
|
||||
TARGET = vmwgfx_drv.so
|
||||
CFILES = $(wildcard ./*.c)
|
||||
OBJECTS = $(patsubst ./%.c,./%.o,$(CFILES))
|
||||
TOP = ../../../../../..
|
||||
|
||||
include $(TOP)/configs/current
|
||||
|
||||
TARGET = vmwgfx_drv.so
|
||||
|
||||
CFILES = \
|
||||
vmw_xorg.c \
|
||||
vmw_video.c \
|
||||
vmw_ioctl.c \
|
||||
vmw_screen.c
|
||||
|
||||
OBJECTS = $(patsubst %.c,%.o,$(CFILES))
|
||||
|
||||
INCLUDES = \
|
||||
$(shell pkg-config --cflags-only-I pixman-1 xorg-server libdrm xproto) \
|
||||
-I$(TOP)/src/gallium/include \
|
||||
@@ -24,6 +31,7 @@ LINKS = \
|
||||
$(shell pkg-config --libs libdrm)
|
||||
|
||||
DRIVER_DEFINES = \
|
||||
-std=gnu99 \
|
||||
-DHAVE_CONFIG_H
|
||||
|
||||
TARGET_STAGING = $(TOP)/$(LIB_DIR)/gallium/$(TARGET)
|
||||
|
90
src/gallium/winsys/drm/vmware/xorg/vmw_driver.h
Normal file
90
src/gallium/winsys/drm/vmware/xorg/vmw_driver.h
Normal file
@@ -0,0 +1,90 @@
|
||||
/**********************************************************
|
||||
* Copyright 2009 VMware, Inc. All rights reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person
|
||||
* obtaining a copy of this software and associated documentation
|
||||
* files (the "Software"), to deal in the Software without
|
||||
* restriction, including without limitation the rights to use, copy,
|
||||
* modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
* of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice 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.
|
||||
*
|
||||
**********************************************************/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains the shared resources for VMware Xorg driver
|
||||
* that sits ontop of the Xorg State Traker.
|
||||
*
|
||||
* It is initialized in vmw_screen.c.
|
||||
*
|
||||
* @author Jakob Bornecrantz <jakob@vmware.com>
|
||||
*/
|
||||
|
||||
#ifndef VMW_DRIVER_H_
|
||||
#define VMW_DRIVER_H_
|
||||
|
||||
#include "state_trackers/xorg/xorg_tracker.h"
|
||||
|
||||
struct vmw_dma_buffer;
|
||||
|
||||
struct vmw_driver
|
||||
{
|
||||
int fd;
|
||||
|
||||
void *cursor_priv;
|
||||
|
||||
/* vmw_video.c */
|
||||
void *video_priv;
|
||||
};
|
||||
|
||||
static INLINE struct vmw_driver *
|
||||
vmw_driver(ScrnInfoPtr pScrn)
|
||||
{
|
||||
modesettingPtr ms = modesettingPTR(pScrn);
|
||||
return ms ? (struct vmw_driver *)ms->winsys_priv : NULL;
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* vmw_video.c
|
||||
*/
|
||||
|
||||
Bool vmw_video_init(ScrnInfoPtr pScrn, struct vmw_driver *vmw);
|
||||
|
||||
Bool vmw_video_close(ScrnInfoPtr pScrn, struct vmw_driver *vmw);
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* vmw_ioctl.c
|
||||
*/
|
||||
|
||||
int vmw_ioctl_cursor_bypass(struct vmw_driver *vmw, int xhot, int yhot);
|
||||
|
||||
struct vmw_dma_buffer * vmw_ioctl_buffer_create(struct vmw_driver *vmw,
|
||||
uint32_t size,
|
||||
unsigned *handle);
|
||||
|
||||
void * vmw_ioctl_buffer_map(struct vmw_driver *vmw,
|
||||
struct vmw_dma_buffer *buf);
|
||||
|
||||
void vmw_ioctl_buffer_unmap(struct vmw_driver *vmw,
|
||||
struct vmw_dma_buffer *buf);
|
||||
|
||||
void vmw_ioctl_buffer_destroy(struct vmw_driver *vmw,
|
||||
struct vmw_dma_buffer *buf);
|
||||
|
||||
|
||||
#endif
|
39
src/gallium/winsys/drm/vmware/xorg/vmw_hook.h
Normal file
39
src/gallium/winsys/drm/vmware/xorg/vmw_hook.h
Normal file
@@ -0,0 +1,39 @@
|
||||
/**********************************************************
|
||||
* Copyright 2009 VMware, Inc. All rights reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person
|
||||
* obtaining a copy of this software and associated documentation
|
||||
* files (the "Software"), to deal in the Software without
|
||||
* restriction, including without limitation the rights to use, copy,
|
||||
* modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
* of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice 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 VMW_HOOK_H_
|
||||
#define VMW_HOOK_H_
|
||||
|
||||
#include "state_trackers/xorg/xorg_winsys.h"
|
||||
|
||||
|
||||
/***********************************************************************
|
||||
* vmw_screen.c
|
||||
*/
|
||||
|
||||
void vmw_screen_set_functions(ScrnInfoPtr pScrn);
|
||||
|
||||
|
||||
#endif
|
157
src/gallium/winsys/drm/vmware/xorg/vmw_ioctl.c
Normal file
157
src/gallium/winsys/drm/vmware/xorg/vmw_ioctl.c
Normal file
@@ -0,0 +1,157 @@
|
||||
/**********************************************************
|
||||
* Copyright 2009 VMware, Inc. All rights reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person
|
||||
* obtaining a copy of this software and associated documentation
|
||||
* files (the "Software"), to deal in the Software without
|
||||
* restriction, including without limitation the rights to use, copy,
|
||||
* modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
* of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice 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.
|
||||
*
|
||||
**********************************************************/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains the functions for creating dma buffers by calling
|
||||
* the kernel via driver specific ioctls.
|
||||
*
|
||||
* @author Jakob Bornecrantz <jakob@vmware.com>
|
||||
*/
|
||||
|
||||
#define HAVE_STDINT_H
|
||||
#define _FILE_OFFSET_BITS 64
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <sys/mman.h>
|
||||
#include "xf86drm.h"
|
||||
#include "../core/vmwgfx_drm.h"
|
||||
|
||||
#include "vmw_driver.h"
|
||||
#include "util/u_debug.h"
|
||||
|
||||
struct vmw_dma_buffer
|
||||
{
|
||||
void *data;
|
||||
unsigned handle;
|
||||
uint64_t map_handle;
|
||||
unsigned map_count;
|
||||
uint32_t size;
|
||||
};
|
||||
|
||||
int
|
||||
vmw_ioctl_cursor_bypass(struct vmw_driver *vmw, int xhot, int yhot)
|
||||
{
|
||||
struct drm_vmw_cursor_bypass_arg arg;
|
||||
int ret;
|
||||
|
||||
memset(&arg, 0, sizeof(arg));
|
||||
arg.flags = DRM_VMW_CURSOR_BYPASS_ALL;
|
||||
arg.xhot = xhot;
|
||||
arg.yhot = yhot;
|
||||
|
||||
ret = drmCommandWrite(vmw->fd, DRM_VMW_CURSOR_BYPASS,
|
||||
&arg, sizeof(arg));
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
struct vmw_dma_buffer *
|
||||
vmw_ioctl_buffer_create(struct vmw_driver *vmw, uint32_t size, unsigned *handle)
|
||||
{
|
||||
struct vmw_dma_buffer *buf;
|
||||
union drm_vmw_alloc_dmabuf_arg arg;
|
||||
struct drm_vmw_alloc_dmabuf_req *req = &arg.req;
|
||||
struct drm_vmw_dmabuf_rep *rep = &arg.rep;
|
||||
int ret;
|
||||
|
||||
buf = xcalloc(1, sizeof(*buf));
|
||||
if (!buf)
|
||||
goto err;
|
||||
|
||||
memset(&arg, 0, sizeof(arg));
|
||||
req->size = size;
|
||||
do {
|
||||
ret = drmCommandWriteRead(vmw->fd, DRM_VMW_ALLOC_DMABUF, &arg, sizeof(arg));
|
||||
} while (ret == -ERESTART);
|
||||
|
||||
if (ret) {
|
||||
debug_printf("IOCTL failed %d: %s\n", ret, strerror(-ret));
|
||||
goto err_free;
|
||||
}
|
||||
|
||||
|
||||
buf->data = NULL;
|
||||
buf->handle = rep->handle;
|
||||
buf->map_handle = rep->map_handle;
|
||||
buf->map_count = 0;
|
||||
buf->size = size;
|
||||
|
||||
*handle = rep->handle;
|
||||
|
||||
return buf;
|
||||
|
||||
err_free:
|
||||
xfree(buf);
|
||||
err:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void
|
||||
vmw_ioctl_buffer_destroy(struct vmw_driver *vmw, struct vmw_dma_buffer *buf)
|
||||
{
|
||||
struct drm_vmw_unref_dmabuf_arg arg;
|
||||
|
||||
if (buf->data) {
|
||||
munmap(buf->data, buf->size);
|
||||
buf->data = NULL;
|
||||
}
|
||||
|
||||
memset(&arg, 0, sizeof(arg));
|
||||
arg.handle = buf->handle;
|
||||
drmCommandWrite(vmw->fd, DRM_VMW_UNREF_DMABUF, &arg, sizeof(arg));
|
||||
|
||||
xfree(buf);
|
||||
}
|
||||
|
||||
void *
|
||||
vmw_ioctl_buffer_map(struct vmw_driver *vmw, struct vmw_dma_buffer *buf)
|
||||
{
|
||||
void *map;
|
||||
|
||||
if (buf->data == NULL) {
|
||||
map = mmap(NULL, buf->size, PROT_READ | PROT_WRITE, MAP_SHARED,
|
||||
vmw->fd, buf->map_handle);
|
||||
if (map == MAP_FAILED) {
|
||||
debug_printf("%s: Map failed.\n", __FUNCTION__);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
buf->data = map;
|
||||
}
|
||||
|
||||
++buf->map_count;
|
||||
|
||||
return buf->data;
|
||||
}
|
||||
|
||||
void
|
||||
vmw_ioctl_buffer_unmap(struct vmw_driver *vmw, struct vmw_dma_buffer *buf)
|
||||
{
|
||||
--buf->map_count;
|
||||
}
|
154
src/gallium/winsys/drm/vmware/xorg/vmw_screen.c
Normal file
154
src/gallium/winsys/drm/vmware/xorg/vmw_screen.c
Normal file
@@ -0,0 +1,154 @@
|
||||
/**********************************************************
|
||||
* Copyright 2009 VMware, Inc. All rights reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person
|
||||
* obtaining a copy of this software and associated documentation
|
||||
* files (the "Software"), to deal in the Software without
|
||||
* restriction, including without limitation the rights to use, copy,
|
||||
* modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
* of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice 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.
|
||||
*
|
||||
**********************************************************/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains the init code for the VMware Xorg driver.
|
||||
*
|
||||
* @author Jakob Bornecrantz <jakob@vmware.com>
|
||||
*/
|
||||
|
||||
#include "vmw_hook.h"
|
||||
#include "vmw_driver.h"
|
||||
|
||||
/* modified version of crtc functions */
|
||||
xf86CrtcFuncsRec vmw_screen_crtc_funcs;
|
||||
|
||||
static void
|
||||
vmw_screen_cursor_load_argb(xf86CrtcPtr crtc, CARD32 *image)
|
||||
{
|
||||
struct vmw_driver *vmw = modesettingPTR(crtc->scrn)->winsys_priv;
|
||||
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(crtc->scrn);
|
||||
xf86CrtcFuncsPtr funcs = vmw->cursor_priv;
|
||||
CursorPtr c = config->cursor;
|
||||
|
||||
/* Run the ioctl before uploading the image */
|
||||
vmw_ioctl_cursor_bypass(vmw, c->bits->xhot, c->bits->yhot);
|
||||
|
||||
funcs->load_cursor_argb(crtc, image);
|
||||
}
|
||||
|
||||
static void
|
||||
vmw_screen_cursor_init(ScrnInfoPtr pScrn, struct vmw_driver *vmw)
|
||||
{
|
||||
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
|
||||
int i;
|
||||
|
||||
/* XXX assume that all crtc's have the same function struct */
|
||||
|
||||
/* Save old struct need to call the old functions as well */
|
||||
vmw->cursor_priv = (void*)(config->crtc[0]->funcs);
|
||||
memcpy(&vmw_screen_crtc_funcs, vmw->cursor_priv, sizeof(xf86CrtcFuncsRec));
|
||||
vmw_screen_crtc_funcs.load_cursor_argb = vmw_screen_cursor_load_argb;
|
||||
|
||||
for (i = 0; i < config->num_crtc; i++)
|
||||
config->crtc[i]->funcs = &vmw_screen_crtc_funcs;
|
||||
}
|
||||
|
||||
static void
|
||||
vmw_screen_cursor_close(ScrnInfoPtr pScrn, struct vmw_driver *vmw)
|
||||
{
|
||||
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
|
||||
int i;
|
||||
|
||||
vmw_ioctl_cursor_bypass(vmw, 0, 0);
|
||||
|
||||
for (i = 0; i < config->num_crtc; i++)
|
||||
config->crtc[i]->funcs = vmw->cursor_priv;
|
||||
}
|
||||
|
||||
static Bool
|
||||
vmw_screen_init(ScrnInfoPtr pScrn)
|
||||
{
|
||||
modesettingPtr ms = modesettingPTR(pScrn);
|
||||
struct vmw_driver *vmw;
|
||||
|
||||
vmw = xnfcalloc(sizeof(*vmw), 1);
|
||||
if (!vmw)
|
||||
return FALSE;
|
||||
|
||||
vmw->fd = ms->fd;
|
||||
ms->winsys_priv = vmw;
|
||||
|
||||
vmw_screen_cursor_init(pScrn, vmw);
|
||||
|
||||
/* if gallium is used then we don't need to do anything more. */
|
||||
if (ms->screen)
|
||||
return TRUE;
|
||||
|
||||
vmw_video_init(pScrn, vmw);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static Bool
|
||||
vmw_screen_close(ScrnInfoPtr pScrn)
|
||||
{
|
||||
modesettingPtr ms = modesettingPTR(pScrn);
|
||||
struct vmw_driver *vmw = vmw_driver(pScrn);
|
||||
|
||||
if (!vmw)
|
||||
return TRUE;
|
||||
|
||||
vmw_screen_cursor_close(pScrn, vmw);
|
||||
|
||||
vmw_video_close(pScrn, vmw);
|
||||
|
||||
ms->winsys_priv = NULL;
|
||||
xfree(vmw);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Functions for setting up hooks into the xorg state tracker
|
||||
*/
|
||||
|
||||
static Bool (*vmw_screen_pre_init_saved)(ScrnInfoPtr pScrn, int flags) = NULL;
|
||||
|
||||
static Bool
|
||||
vmw_screen_pre_init(ScrnInfoPtr pScrn, int flags)
|
||||
{
|
||||
modesettingPtr ms;
|
||||
|
||||
pScrn->PreInit = vmw_screen_pre_init_saved;
|
||||
if (!pScrn->PreInit(pScrn, flags))
|
||||
return FALSE;
|
||||
|
||||
ms = modesettingPTR(pScrn);
|
||||
ms->winsys_screen_init = vmw_screen_init;
|
||||
ms->winsys_screen_close = vmw_screen_close;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
vmw_screen_set_functions(ScrnInfoPtr pScrn)
|
||||
{
|
||||
assert(!vmw_screen_pre_init_saved);
|
||||
|
||||
vmw_screen_pre_init_saved = pScrn->PreInit;
|
||||
pScrn->PreInit = vmw_screen_pre_init;
|
||||
}
|
1023
src/gallium/winsys/drm/vmware/xorg/vmw_video.c
Normal file
1023
src/gallium/winsys/drm/vmware/xorg/vmw_video.c
Normal file
File diff suppressed because it is too large
Load Diff
@@ -31,7 +31,7 @@
|
||||
* @author Jakob Bornecrantz <wallbraker@gmail.com>
|
||||
*/
|
||||
|
||||
#include "state_trackers/xorg/xorg_winsys.h"
|
||||
#include "vmw_hook.h"
|
||||
|
||||
static void vmw_xorg_identify(int flags);
|
||||
static Bool vmw_xorg_pci_probe(DriverPtr driver,
|
||||
@@ -145,6 +145,8 @@ vmw_xorg_pci_probe(DriverPtr driver,
|
||||
|
||||
/* Use all the functions from the xorg tracker */
|
||||
xorg_tracker_set_functions(scrn);
|
||||
|
||||
vmw_screen_set_functions(scrn);
|
||||
}
|
||||
return scrn != NULL;
|
||||
}
|
||||
|
@@ -291,6 +291,7 @@ xm_surface_buffer_create(struct pipe_winsys *winsys,
|
||||
unsigned width, unsigned height,
|
||||
enum pipe_format format,
|
||||
unsigned usage,
|
||||
unsigned tex_usage,
|
||||
unsigned *stride)
|
||||
{
|
||||
const unsigned alignment = 64;
|
||||
|
@@ -121,7 +121,6 @@ static const struct dri_extension card_extensions[] = {
|
||||
{ "GL_MESA_pack_invert", NULL },
|
||||
{ "GL_MESA_ycbcr_texture", NULL },
|
||||
{ "GL_NV_blend_square", NULL },
|
||||
{ "GL_NV_point_sprite", GL_NV_point_sprite_functions },
|
||||
{ "GL_NV_vertex_program", GL_NV_vertex_program_functions },
|
||||
{ "GL_NV_vertex_program1_1", NULL },
|
||||
{ "GL_SGIS_generate_mipmap", NULL },
|
||||
|
@@ -336,6 +336,8 @@ out:
|
||||
unpack->BufferObj);
|
||||
}
|
||||
|
||||
intel_check_front_buffer_rendering(intel);
|
||||
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
||||
|
@@ -222,6 +222,8 @@ do_blit_copypixels(GLcontext * ctx,
|
||||
out:
|
||||
UNLOCK_HARDWARE(intel);
|
||||
|
||||
intel_check_front_buffer_rendering(intel);
|
||||
|
||||
DBG("%s: success\n", __FUNCTION__);
|
||||
return GL_TRUE;
|
||||
}
|
||||
|
@@ -325,9 +325,9 @@ GLboolean r200CreateContext( const __GLcontextModes *glVisual,
|
||||
_mesa_init_driver_functions(&functions);
|
||||
r200InitDriverFuncs(&functions);
|
||||
r200InitIoctlFuncs(&functions);
|
||||
r200InitStateFuncs(&functions, screen->kernel_mm);
|
||||
r200InitStateFuncs(&functions);
|
||||
r200InitTextureFuncs(&functions);
|
||||
r200InitShaderFuncs(&functions);
|
||||
r200InitShaderFuncs(&functions);
|
||||
radeonInitQueryObjFunctions(&functions);
|
||||
|
||||
if (!radeonInitContext(&rmesa->radeon, &functions,
|
||||
|
@@ -2476,7 +2476,7 @@ static void r200PolygonStipple( GLcontext *ctx, const GLubyte *mask )
|
||||
}
|
||||
/* Initialize the driver's state functions.
|
||||
*/
|
||||
void r200InitStateFuncs( struct dd_function_table *functions, GLboolean dri2 )
|
||||
void r200InitStateFuncs( struct dd_function_table *functions )
|
||||
{
|
||||
functions->UpdateState = r200InvalidateState;
|
||||
functions->LightingSpaceChange = r200LightingSpaceChange;
|
||||
@@ -2510,10 +2510,7 @@ void r200InitStateFuncs( struct dd_function_table *functions, GLboolean dri2 )
|
||||
functions->LogicOpcode = r200LogicOpCode;
|
||||
functions->PolygonMode = r200PolygonMode;
|
||||
functions->PolygonOffset = r200PolygonOffset;
|
||||
if (dri2)
|
||||
functions->PolygonStipple = r200PolygonStipple;
|
||||
else
|
||||
functions->PolygonStipple = radeonPolygonStipplePreKMS;
|
||||
functions->PolygonStipple = r200PolygonStipple;
|
||||
functions->PointParameterfv = r200PointParameter;
|
||||
functions->PointSize = r200PointSize;
|
||||
functions->RenderMode = r200RenderMode;
|
||||
|
@@ -38,7 +38,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
#include "r200_context.h"
|
||||
|
||||
extern void r200InitState( r200ContextPtr rmesa );
|
||||
extern void r200InitStateFuncs( struct dd_function_table *functions, GLboolean dri2 );
|
||||
extern void r200InitStateFuncs( struct dd_function_table *functions );
|
||||
extern void r200InitTnlFuncs( GLcontext *ctx );
|
||||
|
||||
extern void r200UpdateMaterial( GLcontext *ctx );
|
||||
|
@@ -887,10 +887,8 @@ void r200InitState( r200ContextPtr rmesa )
|
||||
}
|
||||
}
|
||||
}
|
||||
/* polygon stipple is done with irq for non-kms */
|
||||
if (rmesa->radeon.radeonScreen->kernel_mm) {
|
||||
ALLOC_STATE( stp, always, STP_STATE_SIZE, "STP/stp", 0 );
|
||||
}
|
||||
|
||||
ALLOC_STATE( stp, always, STP_STATE_SIZE, "STP/stp", 0 );
|
||||
|
||||
for (i = 0; i < 6; i++)
|
||||
if (rmesa->radeon.radeonScreen->kernel_mm)
|
||||
@@ -1122,12 +1120,11 @@ void r200InitState( r200ContextPtr rmesa )
|
||||
rmesa->hw.sci.cmd[SCI_CMD_1] = CP_PACKET0(R200_RE_TOP_LEFT, 0);
|
||||
rmesa->hw.sci.cmd[SCI_CMD_2] = CP_PACKET0(R200_RE_WIDTH_HEIGHT, 0);
|
||||
|
||||
rmesa->hw.stp.cmd[STP_CMD_0] = CP_PACKET0(RADEON_RE_STIPPLE_ADDR, 0);
|
||||
rmesa->hw.stp.cmd[STP_DATA_0] = 0;
|
||||
rmesa->hw.stp.cmd[STP_CMD_1] = CP_PACKET0_ONE(RADEON_RE_STIPPLE_DATA, 31);
|
||||
|
||||
if (rmesa->radeon.radeonScreen->kernel_mm) {
|
||||
|
||||
rmesa->hw.stp.cmd[STP_CMD_0] = CP_PACKET0(RADEON_RE_STIPPLE_ADDR, 0);
|
||||
rmesa->hw.stp.cmd[STP_DATA_0] = 0;
|
||||
rmesa->hw.stp.cmd[STP_CMD_1] = CP_PACKET0_ONE(RADEON_RE_STIPPLE_DATA, 31);
|
||||
|
||||
rmesa->hw.mtl[0].emit = mtl_emit;
|
||||
rmesa->hw.mtl[1].emit = mtl_emit;
|
||||
|
||||
|
@@ -1741,8 +1741,7 @@ static void r300Enable(GLcontext * ctx, GLenum cap, GLboolean state)
|
||||
r300SetPolygonOffsetState(ctx, state);
|
||||
break;
|
||||
case GL_SCISSOR_TEST:
|
||||
if (!rmesa->radeon.radeonScreen->kernel_mm)
|
||||
radeon_firevertices(&rmesa->radeon);
|
||||
radeon_firevertices(&rmesa->radeon);
|
||||
rmesa->radeon.state.scissor.enabled = state;
|
||||
radeonUpdateScissor( ctx );
|
||||
break;
|
||||
|
@@ -257,36 +257,11 @@ void radeonScissor(GLcontext* ctx, GLint x, GLint y, GLsizei w, GLsizei h)
|
||||
radeonContextPtr radeon = RADEON_CONTEXT(ctx);
|
||||
if (ctx->Scissor.Enabled) {
|
||||
/* We don't pipeline cliprect changes */
|
||||
if (!radeon->radeonScreen->kernel_mm) {
|
||||
radeon_firevertices(radeon);
|
||||
}
|
||||
radeon_firevertices(radeon);
|
||||
radeonUpdateScissor(ctx);
|
||||
}
|
||||
}
|
||||
|
||||
void radeonPolygonStipplePreKMS( GLcontext *ctx, const GLubyte *mask )
|
||||
{
|
||||
radeonContextPtr radeon = RADEON_CONTEXT(ctx);
|
||||
GLuint i;
|
||||
drm_radeon_stipple_t stipple;
|
||||
|
||||
/* Must flip pattern upside down.
|
||||
*/
|
||||
for ( i = 0 ; i < 32 ; i++ ) {
|
||||
stipple.mask[31 - i] = ((GLuint *) mask)[i];
|
||||
}
|
||||
|
||||
/* TODO: push this into cmd mechanism
|
||||
*/
|
||||
radeon_firevertices(radeon);
|
||||
LOCK_HARDWARE( radeon );
|
||||
|
||||
drmCommandWrite( radeon->dri.fd, DRM_RADEON_STIPPLE,
|
||||
&stipple, sizeof(stipple) );
|
||||
UNLOCK_HARDWARE( radeon );
|
||||
}
|
||||
|
||||
|
||||
/* ================================================================
|
||||
* SwapBuffers with client-side throttling
|
||||
*/
|
||||
|
@@ -10,7 +10,6 @@ void radeonRecalcScissorRects(radeonContextPtr radeon);
|
||||
void radeonSetCliprects(radeonContextPtr radeon);
|
||||
void radeonUpdateScissor( GLcontext *ctx );
|
||||
void radeonScissor(GLcontext* ctx, GLint x, GLint y, GLsizei w, GLsizei h);
|
||||
void radeonPolygonStipplePreKMS( GLcontext *ctx, const GLubyte *mask );
|
||||
|
||||
void radeonWaitForIdleLocked(radeonContextPtr radeon);
|
||||
extern uint32_t radeonGetAge(radeonContextPtr radeon);
|
||||
|
@@ -331,8 +331,12 @@ struct r100_hw_state {
|
||||
struct radeon_state_atom stp;
|
||||
};
|
||||
|
||||
struct radeon_stipple_state {
|
||||
GLuint mask[32];
|
||||
};
|
||||
|
||||
struct r100_state {
|
||||
struct radeon_stipple_state stipple;
|
||||
struct radeon_texture_state texture;
|
||||
};
|
||||
|
||||
|
@@ -369,6 +369,12 @@ radeon_framebuffer_renderbuffer(GLcontext * ctx,
|
||||
}
|
||||
|
||||
|
||||
/* TODO: According to EXT_fbo spec internal format of texture image
|
||||
* once set during glTexImage call, should be preserved when
|
||||
* attaching image to renderbuffer. When HW doesn't support
|
||||
* rendering to format of attached image, set framebuffer
|
||||
* completeness accordingly in radeon_validate_framebuffer (issue #79).
|
||||
*/
|
||||
static GLboolean
|
||||
radeon_update_wrapper(GLcontext *ctx, struct radeon_renderbuffer *rrb,
|
||||
struct gl_texture_image *texImage)
|
||||
|
@@ -421,9 +421,12 @@ static void migrate_image_to_miptree(radeon_mipmap_tree *mt,
|
||||
|
||||
radeon_mipmap_level *srclvl = &image->mt->levels[image->mtlevel];
|
||||
|
||||
/* TODO: bring back these assertions once the FBOs are fixed */
|
||||
#if 0
|
||||
assert(image->mtlevel == level);
|
||||
assert(srclvl->size == dstlvl->size);
|
||||
assert(srclvl->rowstride == dstlvl->rowstride);
|
||||
#endif
|
||||
|
||||
radeon_bo_map(image->mt->bo, GL_FALSE);
|
||||
|
||||
@@ -434,23 +437,18 @@ static void migrate_image_to_miptree(radeon_mipmap_tree *mt,
|
||||
|
||||
radeon_miptree_unreference(&image->mt);
|
||||
} else {
|
||||
/* need to confirm this value is correct */
|
||||
if (_mesa_is_format_compressed(image->base.TexFormat)) {
|
||||
unsigned size = _mesa_format_image_size(image->base.TexFormat,
|
||||
image->base.Width,
|
||||
image->base.Height,
|
||||
image->base.Depth);
|
||||
memcpy(dest, image->base.Data, size);
|
||||
} else {
|
||||
uint32_t srcrowstride;
|
||||
uint32_t height;
|
||||
const uint32_t srcrowstride = _mesa_format_row_stride(image->base.TexFormat, image->base.Width);
|
||||
uint32_t rows = image->base.Height * image->base.Depth;
|
||||
|
||||
height = image->base.Height * image->base.Depth;
|
||||
srcrowstride = image->base.Width * _mesa_get_format_bytes(image->base.TexFormat);
|
||||
copy_rows(dest, dstlvl->rowstride, image->base.Data, srcrowstride,
|
||||
height, srcrowstride);
|
||||
if (_mesa_is_format_compressed(image->base.TexFormat)) {
|
||||
uint32_t blockWidth, blockHeight;
|
||||
_mesa_get_format_block_size(image->base.TexFormat, &blockWidth, &blockHeight);
|
||||
rows = (rows + blockHeight - 1) / blockHeight;
|
||||
}
|
||||
|
||||
copy_rows(dest, dstlvl->rowstride, image->base.Data, srcrowstride,
|
||||
rows, srcrowstride);
|
||||
|
||||
_mesa_free_texmemory(image->base.Data);
|
||||
image->base.Data = 0;
|
||||
}
|
||||
|
@@ -550,6 +550,31 @@ static void radeonPolygonOffset( GLcontext *ctx,
|
||||
rmesa->hw.zbs.cmd[ZBS_SE_ZBIAS_CONSTANT] = constant.ui32;
|
||||
}
|
||||
|
||||
static void radeonPolygonStipplePreKMS( GLcontext *ctx, const GLubyte *mask )
|
||||
{
|
||||
r100ContextPtr rmesa = R100_CONTEXT(ctx);
|
||||
GLuint i;
|
||||
drm_radeon_stipple_t stipple;
|
||||
|
||||
/* Must flip pattern upside down.
|
||||
*/
|
||||
for ( i = 0 ; i < 32 ; i++ ) {
|
||||
rmesa->state.stipple.mask[31 - i] = ((GLuint *) mask)[i];
|
||||
}
|
||||
|
||||
/* TODO: push this into cmd mechanism
|
||||
*/
|
||||
radeon_firevertices(&rmesa->radeon);
|
||||
LOCK_HARDWARE( &rmesa->radeon );
|
||||
|
||||
/* FIXME: Use window x,y offsets into stipple RAM.
|
||||
*/
|
||||
stipple.mask = rmesa->state.stipple.mask;
|
||||
drmCommandWrite( rmesa->radeon.dri.fd, DRM_RADEON_STIPPLE,
|
||||
&stipple, sizeof(drm_radeon_stipple_t) );
|
||||
UNLOCK_HARDWARE( &rmesa->radeon );
|
||||
}
|
||||
|
||||
static void radeonPolygonMode( GLcontext *ctx, GLenum face, GLenum mode )
|
||||
{
|
||||
r100ContextPtr rmesa = R100_CONTEXT(ctx);
|
||||
|
@@ -515,15 +515,18 @@ static int image_matches_texture_obj(struct gl_texture_object *texObj,
|
||||
struct gl_texture_image *texImage,
|
||||
unsigned level)
|
||||
{
|
||||
const struct gl_texture_image *baseImage = texObj->Image[0][level];
|
||||
const struct gl_texture_image *baseImage = texObj->Image[0][texObj->BaseLevel];
|
||||
|
||||
if (!baseImage)
|
||||
return 0;
|
||||
|
||||
if (level < texObj->BaseLevel || level > texObj->MaxLevel)
|
||||
return 0;
|
||||
|
||||
const unsigned levelDiff = level - texObj->BaseLevel;
|
||||
const unsigned refWidth = baseImage->Width >> levelDiff;
|
||||
const unsigned refHeight = baseImage->Height >> levelDiff;
|
||||
const unsigned refDepth = baseImage->Depth >> levelDiff;
|
||||
const unsigned refWidth = MAX2(baseImage->Width >> levelDiff, 1);
|
||||
const unsigned refHeight = MAX2(baseImage->Height >> levelDiff, 1);
|
||||
const unsigned refDepth = MAX2(baseImage->Depth >> levelDiff, 1);
|
||||
|
||||
return (texImage->Width == refWidth &&
|
||||
texImage->Height == refHeight &&
|
||||
|
@@ -864,7 +864,7 @@ static void store_texel_al88_rev(struct gl_texture_image *texImage,
|
||||
static void FETCH(f_al1616)( const struct gl_texture_image *texImage,
|
||||
GLint i, GLint j, GLint k, GLfloat *texel )
|
||||
{
|
||||
const GLuint s = *TEXEL_ADDR(GLushort, texImage, i, j, k, 1);
|
||||
const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1);
|
||||
texel[RCOMP] =
|
||||
texel[GCOMP] =
|
||||
texel[BCOMP] = USHORT_TO_FLOAT( s & 0xffff );
|
||||
|
@@ -2197,18 +2197,22 @@ _mesa_texstore_al1616(TEXSTORE_PARAMS)
|
||||
GLuint *dstUI = (GLuint *) dstRow;
|
||||
if (dstFormat == MESA_FORMAT_AL1616) {
|
||||
for (col = 0; col < srcWidth; col++) {
|
||||
/* src[0] is luminance, src[1] is alpha */
|
||||
dstUI[col] = PACK_COLOR_1616( FLOAT_TO_USHORT(src[1]),
|
||||
FLOAT_TO_USHORT(src[0]) );
|
||||
src += 2;
|
||||
GLushort l, a;
|
||||
|
||||
UNCLAMPED_FLOAT_TO_USHORT(l, src[0]);
|
||||
UNCLAMPED_FLOAT_TO_USHORT(a, src[1]);
|
||||
dstUI[col] = PACK_COLOR_1616(a, l);
|
||||
src += 2;
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (col = 0; col < srcWidth; col++) {
|
||||
/* src[0] is luminance, src[1] is alpha */
|
||||
dstUI[col] = PACK_COLOR_1616_REV( FLOAT_TO_UBYTE(src[1]),
|
||||
FLOAT_TO_UBYTE(src[0]) );
|
||||
src += 2;
|
||||
GLushort l, a;
|
||||
|
||||
UNCLAMPED_FLOAT_TO_USHORT(l, src[0]);
|
||||
UNCLAMPED_FLOAT_TO_USHORT(a, src[1]);
|
||||
dstUI[col] = PACK_COLOR_1616_REV(a, l);
|
||||
src += 2;
|
||||
}
|
||||
}
|
||||
dstRow += dstRowStride;
|
||||
|
@@ -32,7 +32,7 @@
|
||||
#define MESA_MAJOR 7
|
||||
#define MESA_MINOR 7
|
||||
#define MESA_PATCH 0
|
||||
#define MESA_VERSION_STRING "7.7-rc1"
|
||||
#define MESA_VERSION_STRING "7.7-rc2"
|
||||
|
||||
/* To make version comparison easy */
|
||||
#define MESA_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
|
||||
|
@@ -278,7 +278,7 @@ static struct ureg_src swizzle_4v( struct ureg_src src,
|
||||
|
||||
|
||||
/**
|
||||
* Translate SWZ instructions into a single MAD. EG:
|
||||
* Translate a SWZ instruction into a MOV, MUL or MAD instruction. EG:
|
||||
*
|
||||
* SWZ dst, src.x-y10
|
||||
*
|
||||
|
@@ -138,6 +138,10 @@ struct vbo_exec_context
|
||||
*/
|
||||
const struct gl_client_array *inputs[VERT_ATTRIB_MAX];
|
||||
} array;
|
||||
|
||||
#ifdef DEBUG
|
||||
GLint flush_call_depth;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
|
@@ -876,9 +876,8 @@ void vbo_exec_FlushVertices( GLcontext *ctx, GLuint flags )
|
||||
|
||||
#ifdef DEBUG
|
||||
/* debug check: make sure we don't get called recursively */
|
||||
static GLuint callDepth = 0;
|
||||
callDepth++;
|
||||
assert(callDepth == 1);
|
||||
exec->flush_call_depth++;
|
||||
assert(exec->flush_call_depth == 1);
|
||||
#endif
|
||||
|
||||
if (0) _mesa_printf("%s\n", __FUNCTION__);
|
||||
@@ -886,7 +885,8 @@ void vbo_exec_FlushVertices( GLcontext *ctx, GLuint flags )
|
||||
if (exec->ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END) {
|
||||
if (0) _mesa_printf("%s - inside begin/end\n", __FUNCTION__);
|
||||
#ifdef DEBUG
|
||||
callDepth--;
|
||||
exec->flush_call_depth--;
|
||||
assert(exec->flush_call_depth == 0);
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
@@ -903,7 +903,8 @@ void vbo_exec_FlushVertices( GLcontext *ctx, GLuint flags )
|
||||
exec->ctx->Driver.NeedFlush &= ~flags;
|
||||
|
||||
#ifdef DEBUG
|
||||
callDepth--;
|
||||
exec->flush_call_depth--;
|
||||
assert(exec->flush_call_depth == 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user