Hello community,
here is the log from the commit of package Mesa
checked in at Mon Aug 6 18:55:04 CEST 2007.
--------
--- Mesa/Mesa.changes 2007-07-04 05:09:30.000000000 +0200
+++ /mounts/work_src_done/STABLE/Mesa/Mesa.changes 2007-08-04 05:55:16.000000000 +0200
@@ -1,0 +2,5 @@
+Sat Aug 4 05:54:46 CEST 2007 - sndirsch@suse.de
+
+- updated to bugfix relelase 7.0.1
+
+-------------------------------------------------------------------
Old:
----
MesaDemos-7.0.tar.bz2
MesaLib-7.0.tar.bz2
New:
----
MesaDemos-7.0.1.tar.bz2
MesaLib-7.0.1.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ Mesa.spec ++++++
--- /var/tmp/diff_new_pack.E14028/_old 2007-08-06 18:54:34.000000000 +0200
+++ /var/tmp/diff_new_pack.E14028/_new 2007-08-06 18:54:34.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package Mesa (Version 7.0)
+# spec file for package Mesa (Version 7.0.1)
#
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@@ -18,8 +18,8 @@
Provides: xorg-x11-Mesa
Obsoletes: xorg-x11-Mesa
Autoreqprov: on
-Version: 7.0
-Release: 4
+Version: 7.0.1
+Release: 1
Summary: Mesa is a 3-D graphics library with an API which is very similar to that of OpenGL.*
Source: MesaLib-%{version}.tar.bz2
Source1: MesaDemos-%{version}.tar.bz2
@@ -105,6 +105,7 @@
%prep
%setup -n %{name}-%{version} -b1 -b4
+rm docs/README.MINGW32.orig
# make legal department happy (Bug #204110)
test -f src/mesa/drivers/directfb/idirectfbgl_mesa.c && exit 1
test -f progs/ggi/asc-view.c && exit 1
@@ -273,6 +274,8 @@
/usr/%{_lib}/libMesaGL.a
%changelog
+* Sat Aug 04 2007 - sndirsch@suse.de
+- updated to bugfix relelase 7.0.1
* Wed Jul 04 2007 - sndirsch@suse.de
- i915-g33.diff/i915tex-g33.diff
* support for G33/Q33/Q35
++++++ MesaDemos-7.0.tar.bz2 -> MesaDemos-7.0.1.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Mesa-7.0/progs/demos/geartrain.c new/Mesa-7.0.1/progs/demos/geartrain.c
--- old/Mesa-7.0/progs/demos/geartrain.c 2007-06-22 00:10:53.000000000 +0200
+++ new/Mesa-7.0.1/progs/demos/geartrain.c 2007-08-01 23:49:59.000000000 +0200
@@ -1053,6 +1053,7 @@
else
file = argv[1];
+ glutInit(&argc, argv);
glutInitWindowPosition (0, 0);
glutInitWindowSize(640,480);
glutInitDisplayMode (GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE );
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Mesa-7.0/progs/demos/gltestperf.c new/Mesa-7.0.1/progs/demos/gltestperf.c
--- old/Mesa-7.0/progs/demos/gltestperf.c 2007-06-22 00:10:53.000000000 +0200
+++ new/Mesa-7.0.1/progs/demos/gltestperf.c 2007-08-01 23:49:59.000000000 +0200
@@ -569,6 +569,7 @@
if (ac == 2)
frontbuffer = 0;
+ glutInit(&ac, av);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
glutInitWindowPosition(0, 0);
glutInitWindowSize(640, 480);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Mesa-7.0/progs/demos/isosurf.c new/Mesa-7.0.1/progs/demos/isosurf.c
--- old/Mesa-7.0/progs/demos/isosurf.c 2007-06-22 00:10:53.000000000 +0200
+++ new/Mesa-7.0.1/progs/demos/isosurf.c 2007-08-01 23:49:59.000000000 +0200
@@ -1042,6 +1042,7 @@
read_surface( "isosurf.dat" );
+ glutInit( &argc, argv);
glutInitWindowPosition(0, 0);
glutInitWindowSize(400, 400);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Mesa-7.0/progs/demos/morph3d.c new/Mesa-7.0.1/progs/demos/morph3d.c
--- old/Mesa-7.0/progs/demos/morph3d.c 2007-06-22 00:10:53.000000000 +0200
+++ new/Mesa-7.0.1/progs/demos/morph3d.c 2007-08-01 23:50:00.000000000 +0200
@@ -826,7 +826,7 @@
}
-static void INIT(void)
+int main(int argc, char **argv)
{
printf("Morph 3D - Shows morphing platonic polyhedra\n");
printf("Author: Marcelo Fernandes Vianna (vianna@cat.cbpf.br)\n\n");
@@ -841,6 +841,7 @@
object=1;
+ glutInit(&argc, argv);
glutInitWindowPosition(0,0);
glutInitWindowSize(640,480);
@@ -888,9 +889,3 @@
glutMainLoop();
}
-
-int main(int argc, char **argv)
-{
- INIT();
- return(0);
-}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Mesa-7.0/progs/demos/winpos.c new/Mesa-7.0.1/progs/demos/winpos.c
--- old/Mesa-7.0/progs/demos/winpos.c 2007-06-22 00:10:53.000000000 +0200
+++ new/Mesa-7.0.1/progs/demos/winpos.c 2007-08-01 23:50:00.000000000 +0200
@@ -100,6 +100,7 @@
int main( int argc, char *argv[] )
{
+ glutInit(&argc, argv);
glutInitWindowPosition(0, 0);
glutInitWindowSize(500, 500);
glutInitDisplayMode( GLUT_RGB );
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Mesa-7.0/progs/fbdev/glfbdevtest.c new/Mesa-7.0.1/progs/fbdev/glfbdevtest.c
--- old/Mesa-7.0/progs/fbdev/glfbdevtest.c 1970-01-01 01:00:00.000000000 +0100
+++ new/Mesa-7.0.1/progs/fbdev/glfbdevtest.c 2007-06-22 00:10:53.000000000 +0200
@@ -0,0 +1,524 @@
+/*
+ * Test the GLFBDev interface. Only tested with radeonfb driver!!!!
+ *
+ * Written by Brian Paul
+ */
+
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#define DEFAULT_DEPTH 8
+
+static struct fb_fix_screeninfo FixedInfo;
+static struct fb_var_screeninfo VarInfo, OrigVarInfo;
+static int DesiredDepth = 0;
+static int OriginalVT = -1;
+static int ConsoleFD = -1;
+static int FrameBufferFD = -1;
+static caddr_t FrameBuffer = (caddr_t) -1;
+static caddr_t MMIOAddress = (caddr_t) -1;
+
+
+static void
+print_fixed_info(const struct fb_fix_screeninfo *fixed, const char *s)
+{
+ static const char *visuals[] = {
+ "MONO01", "MONO10", "TRUECOLOR", "PSEUDOCOLOR",
+ "DIRECTCOLOR", "STATIC_PSEUDOCOLOR"
+ };
+
+ printf("%s info -----------------------\n", s);
+ printf("id = %16s\n", fixed->id);
+ printf("smem_start = 0x%lx\n", fixed->smem_start);
+ printf("smem_len = %d (0x%x)\n", fixed->smem_len, fixed->smem_len);
+ printf("type = 0x%x\n", fixed->type);
+ printf("type_aux = 0x%x\n", fixed->type_aux);
+ printf("visual = 0x%x (%s)\n", fixed->visual, visuals[fixed->visual]);
+ printf("xpanstep = %d\n", fixed->xpanstep);
+ printf("ypanstep = %d\n", fixed->ypanstep);
+ printf("ywrapstep = %d\n", fixed->ywrapstep);
+ printf("line_length = %d\n", fixed->line_length);
+ printf("mmio_start = 0x%lx\n", fixed->mmio_start);
+ printf("mmio_len = %d (0x%x)\n", fixed->mmio_len, fixed->mmio_len);
+ printf("accel = 0x%x\n", fixed->accel);
+}
+
+
+static void
+print_var_info(const struct fb_var_screeninfo *var, const char *s)
+{
+ printf("%s info -----------------------\n", s);
+ printf("xres = %d\n", var->xres);
+ printf("yres = %d\n", var->yres);
+ printf("xres_virtual = %d\n", var->xres_virtual);
+ printf("yres_virtual = %d\n", var->yres_virtual);
+ printf("xoffset = %d\n", var->xoffset);
+ printf("yoffset = %d\n", var->yoffset);
+ printf("bits_per_pixel = %d\n", var->bits_per_pixel);
+ printf("grayscale = %d\n", var->grayscale);
+
+ printf("red.offset = %d length = %d msb_right = %d\n",
+ var->red.offset, var->red.length, var->red.msb_right);
+ printf("green.offset = %d length = %d msb_right = %d\n",
+ var->green.offset, var->green.length, var->green.msb_right);
+ printf("blue.offset = %d length = %d msb_right = %d\n",
+ var->blue.offset, var->blue.length, var->blue.msb_right);
+ printf("transp.offset = %d length = %d msb_right = %d\n",
+ var->transp.offset, var->transp.length, var->transp.msb_right);
+
+ printf("nonstd = %d\n", var->nonstd);
+ printf("activate = %d\n", var->activate);
+ printf("height = %d mm\n", var->height);
+ printf("width = %d mm\n", var->width);
+ printf("accel_flags = 0x%x\n", var->accel_flags);
+ printf("pixclock = %d\n", var->pixclock);
+ printf("left_margin = %d\n", var->left_margin);
+ printf("right_margin = %d\n", var->right_margin);
+ printf("upper_margin = %d\n", var->upper_margin);
+ printf("lower_margin = %d\n", var->lower_margin);
+ printf("hsync_len = %d\n", var->hsync_len);
+ printf("vsync_len = %d\n", var->vsync_len);
+ printf("sync = %d\n", var->sync);
+ printf("vmode = %d\n", var->vmode);
+}
+
+
+static void
+signal_handler(int signumber)
+{
+ signal(signumber, SIG_IGN); /* prevent recursion! */
+ fprintf(stderr, "error: got signal %d (exiting)\n", signumber);
+ exit(1);
+}
+
+
+static void
+initialize_fbdev( void )
+{
+ char ttystr[1000];
+ int fd, vtnumber, ttyfd;
+ int sz;
+
+ (void) sz;
+
+ if (geteuid()) {
+ fprintf(stderr, "error: you need to be root\n");
+ exit(1);
+ }
+
+#if 1
+ /* open the framebuffer device */
+ FrameBufferFD = open("/dev/fb0", O_RDWR);
+ if (FrameBufferFD < 0) {
+ fprintf(stderr, "Error opening /dev/fb0: %s\n", strerror(errno));
+ exit(1);
+ }
+#endif
+
+ /* open /dev/tty0 and get the vt number */
+ if ((fd = open("/dev/tty0", O_WRONLY, 0)) < 0) {
+ fprintf(stderr, "error opening /dev/tty0\n");
+ exit(1);
+ }
+ if (ioctl(fd, VT_OPENQRY, &vtnumber) < 0 || vtnumber < 0) {
+ fprintf(stderr, "error: couldn't get a free vt\n");
+ exit(1);
+ }
+ close(fd);
+
+ /* open the console tty */
+ sprintf(ttystr, "/dev/tty%d", vtnumber); /* /dev/tty1-64 */
+ ConsoleFD = open(ttystr, O_RDWR | O_NDELAY, 0);
+ if (ConsoleFD < 0) {
+ fprintf(stderr, "error couldn't open console fd\n");
+ exit(1);
+ }
+
+ /* save current vt number */
+ {
+ struct vt_stat vts;
+ if (ioctl(ConsoleFD, VT_GETSTATE, &vts) == 0)
+ OriginalVT = vts.v_active;
+ }
+
+ /* disconnect from controlling tty */
+ ttyfd = open("/dev/tty", O_RDWR);
+ if (ttyfd >= 0) {
+ ioctl(ttyfd, TIOCNOTTY, 0);
+ close(ttyfd);
+ }
+
+ /* some magic to restore the vt when we exit */
+ {
+ struct vt_mode vt;
+ if (ioctl(ConsoleFD, VT_ACTIVATE, vtnumber) != 0)
+ printf("ioctl VT_ACTIVATE: %s\n", strerror(errno));
+ if (ioctl(ConsoleFD, VT_WAITACTIVE, vtnumber) != 0)
+ printf("ioctl VT_WAITACTIVE: %s\n", strerror(errno));
+
+ if (ioctl(ConsoleFD, VT_GETMODE, &vt) < 0) {
+ fprintf(stderr, "error: ioctl VT_GETMODE: %s\n", strerror(errno));
+ exit(1);
+ }
+
+ vt.mode = VT_PROCESS;
+ vt.relsig = SIGUSR1;
+ vt.acqsig = SIGUSR1;
+ if (ioctl(ConsoleFD, VT_SETMODE, &vt) < 0) {
+ fprintf(stderr, "error: ioctl(VT_SETMODE) failed: %s\n",
+ strerror(errno));
+ exit(1);
+ }
+ }
+
+ /* go into graphics mode */
+ if (ioctl(ConsoleFD, KDSETMODE, KD_GRAPHICS) < 0) {
+ fprintf(stderr, "error: ioctl(KDSETMODE, KD_GRAPHICS) failed: %s\n",
+ strerror(errno));
+ exit(1);
+ }
+
+
+#if 0
+ /* open the framebuffer device */
+ FrameBufferFD = open("/dev/fb0", O_RDWR);
+ if (FrameBufferFD < 0) {
+ fprintf(stderr, "Error opening /dev/fb0: %s\n", strerror(errno));
+ exit(1);
+ }
+#endif
+
+ /* Get the fixed screen info */
+ if (ioctl(FrameBufferFD, FBIOGET_FSCREENINFO, &FixedInfo)) {
+ fprintf(stderr, "error: ioctl(FBIOGET_FSCREENINFO) failed: %s\n",
+ strerror(errno));
+ exit(1);
+ }
+
+ print_fixed_info(&FixedInfo, "Fixed");
+
+
+ /* get the variable screen info */
+ if (ioctl(FrameBufferFD, FBIOGET_VSCREENINFO, &OrigVarInfo)) {
+ fprintf(stderr, "error: ioctl(FBIOGET_VSCREENINFO) failed: %s\n",
+ strerror(errno));
+ exit(1);
+ }
+
+ print_var_info(&OrigVarInfo, "Orig Var");
+
+ /* operate on a copy */
+ VarInfo = OrigVarInfo;
+
+ /* set the depth, resolution, etc */
+ DesiredDepth = 32;
+ if (DesiredDepth)
+ VarInfo.bits_per_pixel = DesiredDepth;
+
+ if (VarInfo.bits_per_pixel == 16) {
+ VarInfo.red.offset = 11;
+ VarInfo.green.offset = 5;
+ VarInfo.blue.offset = 0;
+ VarInfo.red.length = 5;
+ VarInfo.green.length = 6;
+ VarInfo.blue.length = 5;
+ VarInfo.transp.offset = 0;
+ VarInfo.transp.length = 0;
+ }
+ else if (VarInfo.bits_per_pixel == 32) {
+ VarInfo.red.offset = 16;
+ VarInfo.green.offset = 8;
+ VarInfo.blue.offset = 0;
+ VarInfo.transp.offset = 24;
+ VarInfo.red.length = 8;
+ VarInfo.green.length = 8;
+ VarInfo.blue.length = 8;
+ VarInfo.transp.length = 8;
+ }
+ /* timing values taken from /etc/fb.modes (1280x1024 @ 75Hz) */
+ VarInfo.xres_virtual = VarInfo.xres = 1280;
+ VarInfo.yres_virtual = VarInfo.yres = 1024;
+ VarInfo.pixclock = 7408;
+ VarInfo.left_margin = 248;
+ VarInfo.right_margin = 16;
+ VarInfo.upper_margin = 38;
+ VarInfo.lower_margin = 1;
+ VarInfo.hsync_len = 144;
+ VarInfo.vsync_len = 3;
+
+ VarInfo.xoffset = 0;
+ VarInfo.yoffset = 0;
+ VarInfo.nonstd = 0;
+ VarInfo.vmode &= ~FB_VMODE_YWRAP; /* turn off scrolling */
+
+ /* set new variable screen info */
+ if (ioctl(FrameBufferFD, FBIOPUT_VSCREENINFO, &VarInfo)) {
+ fprintf(stderr, "ioctl(FBIOPUT_VSCREENINFO failed): %s\n",
+ strerror(errno));
+ exit(1);
+ }
+
+ print_var_info(&VarInfo, "New Var");
+
+ if (FixedInfo.visual != FB_VISUAL_TRUECOLOR &&
+ FixedInfo.visual != FB_VISUAL_DIRECTCOLOR) {
+ fprintf(stderr, "non-TRUE/DIRECT-COLOR visuals (0x%x) not supported by this demo.\n", FixedInfo.visual);
+ exit(1);
+ }
+
+ /* initialize colormap */
+ if (FixedInfo.visual == FB_VISUAL_DIRECTCOLOR) {
+ struct fb_cmap cmap;
+ unsigned short red[256], green[256], blue[256];
+ int i;
+
+ /* we're assuming 256 entries here */
+ printf("initializing directcolor colormap\n");
+ cmap.start = 0;
+ cmap.len = 256;
+ cmap.red = red;
+ cmap.green = green;
+ cmap.blue = blue;
+ cmap.transp = NULL;
+ for (i = 0; i < cmap.len; i++) {
+ red[i] = green[i] = blue[i] = (i << 8) | i;
+ }
+ if (ioctl(FrameBufferFD, FBIOPUTCMAP, (void *) &cmap) < 0) {
+ fprintf(stderr, "ioctl(FBIOPUTCMAP) failed [%d]\n", i);
+ }
+ }
+
+ /*
+ * fbdev says the frame buffer is at offset zero, and the mmio region
+ * is immediately after.
+ */
+
+ /* mmap the framebuffer into our address space */
+ FrameBuffer = (caddr_t) mmap(0, /* start */
+ FixedInfo.smem_len, /* bytes */
+ PROT_READ | PROT_WRITE, /* prot */
+ MAP_SHARED, /* flags */
+ FrameBufferFD, /* fd */
+ 0 /* offset */);
+ if (FrameBuffer == (caddr_t) - 1) {
+ fprintf(stderr, "error: unable to mmap framebuffer: %s\n",
+ strerror(errno));
+ exit(1);
+ }
+ printf("FrameBuffer = %p\n", FrameBuffer);
+
+#if 1
+ /* mmap the MMIO region into our address space */
+ MMIOAddress = (caddr_t) mmap(0, /* start */
+ FixedInfo.mmio_len, /* bytes */
+ PROT_READ | PROT_WRITE, /* prot */
+ MAP_SHARED, /* flags */
+ FrameBufferFD, /* fd */
+ FixedInfo.smem_len /* offset */);
+ if (MMIOAddress == (caddr_t) - 1) {
+ fprintf(stderr, "error: unable to mmap mmio region: %s\n",
+ strerror(errno));
+ }
+ printf("MMIOAddress = %p\n", MMIOAddress);
+
+ /* try out some simple MMIO register reads */
+ if (1)
+ {
+ typedef unsigned int CARD32;
+ typedef unsigned char CARD8;
+#define RADEON_CONFIG_MEMSIZE 0x00f8
+#define RADEON_MEM_SDRAM_MODE_REG 0x0158
+#define MMIO_IN32(base, offset) \
+ *(volatile CARD32 *)(void *)(((CARD8*)(base)) + (offset))
+#define INREG(addr) MMIO_IN32(MMIOAddress, addr)
+ int sz, type;
+ const char *typeStr[] = {"SDR", "DDR", "64-bit SDR"};
+ sz = INREG(RADEON_CONFIG_MEMSIZE);
+ type = INREG(RADEON_MEM_SDRAM_MODE_REG);
+ printf("RADEON_CONFIG_MEMSIZE = %d (%d MB)\n", sz, sz / 1024 / 1024);
+ printf("RADEON_MEM_SDRAM_MODE_REG >> 30 = %d (%s)\n",
+ type >> 30, typeStr[type>>30]);
+ }
+#endif
+
+}
+
+
+static void
+shutdown_fbdev( void )
+{
+ struct vt_mode VT;
+
+ printf("cleaning up...\n");
+ /* restore original variable screen info */
+ if (ioctl(FrameBufferFD, FBIOPUT_VSCREENINFO, &OrigVarInfo)) {
+ fprintf(stderr, "ioctl(FBIOPUT_VSCREENINFO failed): %s\n",
+ strerror(errno));
+ exit(1);
+ }
+
+ munmap(MMIOAddress, FixedInfo.mmio_len);
+ munmap(FrameBuffer, FixedInfo.smem_len);
+ close(FrameBufferFD);
+
+ /* restore text mode */
+ ioctl(ConsoleFD, KDSETMODE, KD_TEXT);
+
+ /* set vt */
+ if (ioctl(ConsoleFD, VT_GETMODE, &VT) != -1) {
+ VT.mode = VT_AUTO;
+ ioctl(ConsoleFD, VT_SETMODE, &VT);
+ }
+
+ /* restore original vt */
+ if (OriginalVT >= 0) {
+ ioctl(ConsoleFD, VT_ACTIVATE, OriginalVT);
+ OriginalVT = -1;
+ }
+
+ close(ConsoleFD);
+}
+
+
+/* Borrowed from GLUT */
+static void
+doughnut(GLfloat r, GLfloat R, GLint nsides, GLint rings)
+{
+ int i, j;
+ GLfloat theta, phi, theta1;
+ GLfloat cosTheta, sinTheta;
+ GLfloat cosTheta1, sinTheta1;
+ GLfloat ringDelta, sideDelta;
+
+ ringDelta = 2.0 * M_PI / rings;
+ sideDelta = 2.0 * M_PI / nsides;
+
+ theta = 0.0;
+ cosTheta = 1.0;
+ sinTheta = 0.0;
+ for (i = rings - 1; i >= 0; i--) {
+ theta1 = theta + ringDelta;
+ cosTheta1 = cos(theta1);
+ sinTheta1 = sin(theta1);
+ glBegin(GL_QUAD_STRIP);
+ phi = 0.0;
+ for (j = nsides; j >= 0; j--) {
+ GLfloat cosPhi, sinPhi, dist;
+
+ phi += sideDelta;
+ cosPhi = cos(phi);
+ sinPhi = sin(phi);
+ dist = R + r * cosPhi;
+
+ glNormal3f(cosTheta1 * cosPhi, -sinTheta1 * cosPhi, sinPhi);
+ glVertex3f(cosTheta1 * dist, -sinTheta1 * dist, r * sinPhi);
+ glNormal3f(cosTheta * cosPhi, -sinTheta * cosPhi, sinPhi);
+ glVertex3f(cosTheta * dist, -sinTheta * dist, r * sinPhi);
+ }
+ glEnd();
+ theta = theta1;
+ cosTheta = cosTheta1;
+ sinTheta = sinTheta1;
+ }
+}
+
+
+static void
+gltest( void )
+{
+ static const int attribs[] = {
+ GLFBDEV_DOUBLE_BUFFER,
+ GLFBDEV_DEPTH_SIZE, 16,
+ GLFBDEV_NONE
+ };
+ GLFBDevContextPtr ctx;
+ GLFBDevBufferPtr buf;
+ GLFBDevVisualPtr vis;
+ int bytes, r, g, b, a;
+ float ang;
+
+ printf("GLFBDEV_VENDOR = %s\n", glFBDevGetString(GLFBDEV_VENDOR));
+ printf("GLFBDEV_VERSION = %s\n", glFBDevGetString(GLFBDEV_VERSION));
+
+ /* framebuffer size */
+ bytes = VarInfo.xres_virtual * VarInfo.yres_virtual * VarInfo.bits_per_pixel / 8;
+
+ vis = glFBDevCreateVisual( &FixedInfo, &VarInfo, attribs );
+ assert(vis);
+
+ buf = glFBDevCreateBuffer( &FixedInfo, &VarInfo, vis, FrameBuffer, NULL, bytes );
+ assert(buf);
+
+ ctx = glFBDevCreateContext( vis, NULL );
+ assert(buf);
+
+ b = glFBDevMakeCurrent( ctx, buf, buf );
+ assert(b);
+
+ /*printf("GL_EXTENSIONS: %s\n", glGetString(GL_EXTENSIONS));*/
+ glGetIntegerv(GL_RED_BITS, &r);
+ glGetIntegerv(GL_GREEN_BITS, &g);
+ glGetIntegerv(GL_BLUE_BITS, &b);
+ glGetIntegerv(GL_ALPHA_BITS, &a);
+ printf("RED_BITS=%d GREEN_BITS=%d BLUE_BITS=%d ALPHA_BITS=%d\n",
+ r, g, b, a);
+
+ glClearColor(0.5, 0.5, 1.0, 0);
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glFrustum(-1, 1, -1, 1, 2, 30);
+ glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();
+ glTranslatef(0, 0, -15);
+ glViewport(0, 0, VarInfo.xres_virtual, VarInfo.yres_virtual);
+ glEnable(GL_LIGHTING);
+ glEnable(GL_LIGHT0);
+ glEnable(GL_DEPTH_TEST);
+
+ for (ang = 0; ang <= 180; ang += 15) {
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+ glPushMatrix();
+ glRotatef(ang, 1, 0, 0);
+ doughnut(1, 3, 40, 20);
+ glPopMatrix();
+ glFBDevSwapBuffers(buf);
+ }
+
+ /* clean up */
+ b = glFBDevMakeCurrent( NULL, NULL, NULL);
+ assert(b);
+
+ glFBDevDestroyContext(ctx);
+ glFBDevDestroyBuffer(buf);
+ glFBDevDestroyVisual(vis);
+}
+
+
+int
+main( int argc, char *argv[] )
+{
+ signal(SIGUSR1, signal_handler); /* exit if someone tries a vt switch */
+ signal(SIGSEGV, signal_handler); /* catch segfaults */
+
+ initialize_fbdev();
+ gltest();
+ shutdown_fbdev();
+
+ return 0;
+}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Mesa-7.0/progs/fbdev/Makefile new/Mesa-7.0.1/progs/fbdev/Makefile
--- old/Mesa-7.0/progs/fbdev/Makefile 1970-01-01 01:00:00.000000000 +0100
+++ new/Mesa-7.0.1/progs/fbdev/Makefile 2007-06-22 00:10:53.000000000 +0200
@@ -0,0 +1,53 @@
+# Makefile for miniglx demo programs
+
+TOP = ../..
+
+include $(TOP)/configs/current
+
+
+SOURCES = glfbdevtest.c
+
+OBJECTS = $(SOURCES:.c=.o)
+
+PROGS = $(SOURCES:%.c=%)
+
+INCLUDES = \
+ -I. \
+ -I$(TOP)/include
+
+
+##### RULES #####
+
+.SUFFIXES:
+.SUFFIXES: .c
+
+.c:
+ $(CC) $(INCLUDES) $(CFLAGS) $< $(APP_LIB_DEPS) -o $@
+
+.c.o:
+ $(CC) -c $(INCLUDES) $(CFLAGS) $< -o $@
+
+.S.o:
+ $(CC) -c $(INCLUDES) $(CFLAGS) $< -o $@
+
+
+##### TARGETS #####
+
+default: depend $(PROGS)
+
+clean:
+ rm -f $(PROGS)
+ rm -f *.o
+
+
+depend: $(SOURCES)
+ touch depend
+ $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(SOURCES) > /dev/null
+
+
+# Emacs tags
+tags:
+ etags `find . -name \*.[ch]` `find ../include`
+
+
+include depend
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Mesa-7.0/progs/osdemos/ostest1.c new/Mesa-7.0.1/progs/osdemos/ostest1.c
--- old/Mesa-7.0/progs/osdemos/ostest1.c 2007-06-22 00:10:54.000000000 +0200
+++ new/Mesa-7.0.1/progs/osdemos/ostest1.c 2007-08-01 23:50:00.000000000 +0200
@@ -409,6 +409,8 @@
printf("Rendering %d bit/channel image: %s\n", bits, filename);
+ OSMesaColorClamp(GL_TRUE);
+
init_context();
render_image();
if (Gradient)
@@ -421,7 +423,7 @@
if (WriteFiles && filename != NULL) {
if (type == GL_UNSIGNED_SHORT) {
GLushort *buffer16 = (GLushort *) buffer;
- GLubyte *buffer8 = malloc(WIDTH * HEIGHT * 4);
+ GLubyte *buffer8 = (GLubyte *) malloc(WIDTH * HEIGHT * 4);
int i;
for (i = 0; i < WIDTH * HEIGHT * 4; i++)
buffer8[i] = buffer16[i] >> 8;
@@ -430,8 +432,9 @@
}
else if (type == GL_FLOAT) {
GLfloat *buffer32 = (GLfloat *) buffer;
- GLubyte *buffer8 = malloc(WIDTH * HEIGHT * 4);
+ GLubyte *buffer8 = (GLubyte *) malloc(WIDTH * HEIGHT * 4);
int i;
+ /* colors may be outside [0,1] so we need to clamp */
for (i = 0; i < WIDTH * HEIGHT * 4; i++)
buffer8[i] = (GLubyte) (buffer32[i] * 255.0);
write_ppm(filename, buffer8, WIDTH, HEIGHT);
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Mesa-7.0/progs/osdemos/readtex.c new/Mesa-7.0.1/progs/osdemos/readtex.c
--- old/Mesa-7.0/progs/osdemos/readtex.c 1970-01-01 01:00:00.000000000 +0100
+++ new/Mesa-7.0.1/progs/osdemos/readtex.c 2007-07-26 00:29:17.000000000 +0200
@@ -0,0 +1,454 @@
+/* readtex.c */
+
+/*
+ * Read an SGI .rgb image file and generate a mipmap texture set.
+ * Much of this code was borrowed from SGI's tk OpenGL toolkit.
+ */
+
+
+
+#include
+#include
+#include
+#include
+#include
+#include "readtex.h"
+
+
+#ifndef SEEK_SET
+# define SEEK_SET 0
+#endif
+
+
+/*
+** RGB Image Structure
+*/
+
+typedef struct _TK_RGBImageRec {
+ GLint sizeX, sizeY;
+ GLint components;
+ unsigned char *data;
+} TK_RGBImageRec;
+
+
+
+/******************************************************************************/
+
+typedef struct _rawImageRec {
+ unsigned short imagic;
+ unsigned short type;
+ unsigned short dim;
+ unsigned short sizeX, sizeY, sizeZ;
+ unsigned long min, max;
+ unsigned long wasteBytes;
+ char name[80];
+ unsigned long colorMap;
+ FILE *file;
+ unsigned char *tmp, *tmpR, *tmpG, *tmpB, *tmpA;
+ unsigned long rleEnd;
+ GLuint *rowStart;
+ GLint *rowSize;
+} rawImageRec;
+
+/******************************************************************************/
+
+static void ConvertShort(unsigned short *array, long length)
+{
+ unsigned long b1, b2;
+ unsigned char *ptr;
+
+ ptr = (unsigned char *)array;
+ while (length--) {
+ b1 = *ptr++;
+ b2 = *ptr++;
+ *array++ = (unsigned short) ((b1 << 8) | (b2));
+ }
+}
+
+static void ConvertLong(GLuint *array, long length)
+{
+ unsigned long b1, b2, b3, b4;
+ unsigned char *ptr;
+
+ ptr = (unsigned char *)array;
+ while (length--) {
+ b1 = *ptr++;
+ b2 = *ptr++;
+ b3 = *ptr++;
+ b4 = *ptr++;
+ *array++ = (b1 << 24) | (b2 << 16) | (b3 << 8) | (b4);
+ }
+}
+
+static rawImageRec *RawImageOpen(const char *fileName)
+{
+ union {
+ int testWord;
+ char testByte[4];
+ } endianTest;
+ rawImageRec *raw;
+ GLenum swapFlag;
+ int x;
+
+ endianTest.testWord = 1;
+ if (endianTest.testByte[0] == 1) {
+ swapFlag = GL_TRUE;
+ } else {
+ swapFlag = GL_FALSE;
+ }
+
+ raw = (rawImageRec *)calloc(1, sizeof(rawImageRec));
+ if (raw == NULL) {
+ fprintf(stderr, "Out of memory!\n");
+ return NULL;
+ }
+ if ((raw->file = fopen(fileName, "rb")) == NULL) {
+ perror(fileName);
+ return NULL;
+ }
+
+ fread(raw, 1, 12, raw->file);
+
+ if (swapFlag) {
+ ConvertShort(&raw->imagic, 6);
+ }
+
+ raw->tmp = (unsigned char *)malloc(raw->sizeX*256);
+ raw->tmpR = (unsigned char *)malloc(raw->sizeX*256);
+ raw->tmpG = (unsigned char *)malloc(raw->sizeX*256);
+ raw->tmpB = (unsigned char *)malloc(raw->sizeX*256);
+ if (raw->sizeZ==4) {
+ raw->tmpA = (unsigned char *)malloc(raw->sizeX*256);
+ }
+ if (raw->tmp == NULL || raw->tmpR == NULL || raw->tmpG == NULL ||
+ raw->tmpB == NULL) {
+ fprintf(stderr, "Out of memory!\n");
+ return NULL;
+ }
+
+ if ((raw->type & 0xFF00) == 0x0100) {
+ x = raw->sizeY * raw->sizeZ * sizeof(GLuint);
+ raw->rowStart = (GLuint *)malloc(x);
+ raw->rowSize = (GLint *)malloc(x);
+ if (raw->rowStart == NULL || raw->rowSize == NULL) {
+ fprintf(stderr, "Out of memory!\n");
+ return NULL;
+ }
+ raw->rleEnd = 512 + (2 * x);
+ fseek(raw->file, 512, SEEK_SET);
+ fread(raw->rowStart, 1, x, raw->file);
+ fread(raw->rowSize, 1, x, raw->file);
+ if (swapFlag) {
+ ConvertLong(raw->rowStart, (long) (x/sizeof(GLuint)));
+ ConvertLong((GLuint *)raw->rowSize, (long) (x/sizeof(GLint)));
+ }
+ }
+ return raw;
+}
+
+static void RawImageClose(rawImageRec *raw)
+{
+ fclose(raw->file);
+ free(raw->tmp);
+ free(raw->tmpR);
+ free(raw->tmpG);
+ free(raw->tmpB);
+ if (raw->rowStart)
+ free(raw->rowStart);
+ if (raw->rowSize)
+ free(raw->rowSize);
+ if (raw->sizeZ>3) {
+ free(raw->tmpA);
+ }
+ free(raw);
+}
+
+static void RawImageGetRow(rawImageRec *raw, unsigned char *buf, int y, int z)
+{
+ unsigned char *iPtr, *oPtr, pixel;
+ int count, done = 0;
+
+ if ((raw->type & 0xFF00) == 0x0100) {
+ fseek(raw->file, (long) raw->rowStart[y+z*raw->sizeY], SEEK_SET);
+ fread(raw->tmp, 1, (unsigned int)raw->rowSize[y+z*raw->sizeY],
+ raw->file);
+
+ iPtr = raw->tmp;
+ oPtr = buf;
+ while (!done) {
+ pixel = *iPtr++;
+ count = (int)(pixel & 0x7F);
+ if (!count) {
+ done = 1;
+ return;
+ }
+ if (pixel & 0x80) {
+ while (count--) {
+ *oPtr++ = *iPtr++;
+ }
+ } else {
+ pixel = *iPtr++;
+ while (count--) {
+ *oPtr++ = pixel;
+ }
+ }
+ }
+ } else {
+ fseek(raw->file, 512+(y*raw->sizeX)+(z*raw->sizeX*raw->sizeY),
+ SEEK_SET);
+ fread(buf, 1, raw->sizeX, raw->file);
+ }
+}
+
+
+static void RawImageGetData(rawImageRec *raw, TK_RGBImageRec *final)
+{
+ unsigned char *ptr;
+ int i, j;
+
+ final->data = (unsigned char *)malloc((raw->sizeX+1)*(raw->sizeY+1)*4);
+ if (final->data == NULL) {
+ fprintf(stderr, "Out of memory!\n");
+ }
+
+ ptr = final->data;
+ for (i = 0; i < (int)(raw->sizeY); i++) {
+ RawImageGetRow(raw, raw->tmpR, i, 0);
+ RawImageGetRow(raw, raw->tmpG, i, 1);
+ RawImageGetRow(raw, raw->tmpB, i, 2);
+ if (raw->sizeZ>3) {
+ RawImageGetRow(raw, raw->tmpA, i, 3);
+ }
+ for (j = 0; j < (int)(raw->sizeX); j++) {
+ *ptr++ = *(raw->tmpR + j);
+ *ptr++ = *(raw->tmpG + j);
+ *ptr++ = *(raw->tmpB + j);
+ if (raw->sizeZ>3) {
+ *ptr++ = *(raw->tmpA + j);
+ }
+ }
+ }
+}
+
+
+static TK_RGBImageRec *tkRGBImageLoad(const char *fileName)
+{
+ rawImageRec *raw;
+ TK_RGBImageRec *final;
+
+ raw = RawImageOpen(fileName);
+ if (!raw) {
+ fprintf(stderr, "File not found\n");
+ return NULL;
+ }
+ final = (TK_RGBImageRec *)malloc(sizeof(TK_RGBImageRec));
+ if (final == NULL) {
+ fprintf(stderr, "Out of memory!\n");
+ return NULL;
+ }
+ final->sizeX = raw->sizeX;
+ final->sizeY = raw->sizeY;
+ final->components = raw->sizeZ;
+ RawImageGetData(raw, final);
+ RawImageClose(raw);
+ return final;
+}
+
+
+static void FreeImage( TK_RGBImageRec *image )
+{
+ free(image->data);
+ free(image);
+}
+
+
+/*
+ * Load an SGI .rgb file and generate a set of 2-D mipmaps from it.
+ * Input: imageFile - name of .rgb to read
+ * intFormat - internal texture format to use, or number of components
+ * Return: GL_TRUE if success, GL_FALSE if error.
+ */
+GLboolean LoadRGBMipmaps( const char *imageFile, GLint intFormat )
+{
+ GLint w, h;
+ return LoadRGBMipmaps2( imageFile, GL_TEXTURE_2D, intFormat, &w, &h );
+}
+
+
+
+GLboolean LoadRGBMipmaps2( const char *imageFile, GLenum target,
+ GLint intFormat, GLint *width, GLint *height )
+{
+ GLint error;
+ GLenum format;
+ TK_RGBImageRec *image;
+
+ image = tkRGBImageLoad( imageFile );
+ if (!image) {
+ return GL_FALSE;
+ }
+
+ if (image->components==3) {
+ format = GL_RGB;
+ }
+ else if (image->components==4) {
+ format = GL_RGBA;
+ }
+ else {
+ /* not implemented */
+ fprintf(stderr,
+ "Error in LoadRGBMipmaps %d-component images not implemented\n",
+ image->components );
+ return GL_FALSE;
+ }
+
+ error = gluBuild2DMipmaps( target,
+ intFormat,
+ image->sizeX, image->sizeY,
+ format,
+ GL_UNSIGNED_BYTE,
+ image->data );
+
+ *width = image->sizeX;
+ *height = image->sizeY;
+
+ FreeImage(image);
+
+ return error ? GL_FALSE : GL_TRUE;
+}
+
+
+
+/*
+ * Load an SGI .rgb file and return a pointer to the image data.
+ * Input: imageFile - name of .rgb to read
+ * Output: width - width of image
+ * height - height of image
+ * format - format of image (GL_RGB or GL_RGBA)
+ * Return: pointer to image data or NULL if error
+ */
+GLubyte *LoadRGBImage( const char *imageFile, GLint *width, GLint *height,
+ GLenum *format )
+{
+ TK_RGBImageRec *image;
+ GLint bytes;
+ GLubyte *buffer;
+
+ image = tkRGBImageLoad( imageFile );
+ if (!image) {
+ return NULL;
+ }
+
+ if (image->components==3) {
+ *format = GL_RGB;
+ }
+ else if (image->components==4) {
+ *format = GL_RGBA;
+ }
+ else {
+ /* not implemented */
+ fprintf(stderr,
+ "Error in LoadRGBImage %d-component images not implemented\n",
+ image->components );
+ return NULL;
+ }
+
+ *width = image->sizeX;
+ *height = image->sizeY;
+
+ bytes = image->sizeX * image->sizeY * image->components;
+ buffer = (GLubyte *) malloc(bytes);
+ if (!buffer)
+ return NULL;
+
+ memcpy( (void *) buffer, (void *) image->data, bytes );
+
+ FreeImage(image);
+
+ return buffer;
+}
+
+#define CLAMP( X, MIN, MAX ) ( (X)<(MIN) ? (MIN) : ((X)>(MAX) ? (MAX) : (X)) )
+
+
+static void ConvertRGBtoYUV(GLint w, GLint h, GLint texel_bytes,
+ const GLubyte *src,
+ GLushort *dest)
+{
+ GLint i, j;
+
+ for (i = 0; i < h; i++) {
+ for (j = 0; j < w; j++) {
+ const GLfloat r = (src[0]) / 255.0;
+ const GLfloat g = (src[1]) / 255.0;
+ const GLfloat b = (src[2]) / 255.0;
+ GLfloat y, cr, cb;
+ GLint iy, icr, icb;
+
+ y = r * 65.481 + g * 128.553 + b * 24.966 + 16;
+ cb = r * -37.797 + g * -74.203 + b * 112.0 + 128;
+ cr = r * 112.0 + g * -93.786 + b * -18.214 + 128;
+ /*printf("%f %f %f -> %f %f %f\n", r, g, b, y, cb, cr);*/
+ iy = (GLint) CLAMP(y, 0, 254);
+ icb = (GLint) CLAMP(cb, 0, 254);
+ icr = (GLint) CLAMP(cr, 0, 254);
+
+ if (j & 1) {
+ /* odd */
+ *dest = (iy << 8) | icr;
+ }
+ else {
+ /* even */
+ *dest = (iy << 8) | icb;
+ }
+ dest++;
+ src += texel_bytes;
+ }
+ }
+}
+
+
+/*
+ * Load an SGI .rgb file and return a pointer to the image data, converted
+ * to 422 yuv.
+ *
+ * Input: imageFile - name of .rgb to read
+ * Output: width - width of image
+ * height - height of image
+ * Return: pointer to image data or NULL if error
+ */
+GLushort *LoadYUVImage( const char *imageFile, GLint *width, GLint *height )
+{
+ TK_RGBImageRec *image;
+ GLushort *buffer;
+
+ image = tkRGBImageLoad( imageFile );
+ if (!image) {
+ return NULL;
+ }
+
+ if (image->components != 3 && image->components !=4 ) {
+ /* not implemented */
+ fprintf(stderr,
+ "Error in LoadYUVImage %d-component images not implemented\n",
+ image->components );
+ return NULL;
+ }
+
+ *width = image->sizeX;
+ *height = image->sizeY;
+
+ buffer = (GLushort *) malloc( image->sizeX * image->sizeY * 2 );
+
+ if (buffer)
+ ConvertRGBtoYUV( image->sizeX,
+ image->sizeY,
+ image->components,
+ image->data,
+ buffer );
+
+
+ FreeImage(image);
+ return buffer;
+}
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Mesa-7.0/progs/samples/Makefile.mgw new/Mesa-7.0.1/progs/samples/Makefile.mgw
--- old/Mesa-7.0/progs/samples/Makefile.mgw 2007-06-22 00:10:54.000000000 +0200
+++ new/Mesa-7.0.1/progs/samples/Makefile.mgw 2007-08-01 23:50:00.000000000 +0200
@@ -26,6 +26,15 @@
# Email : dborca@users.sourceforge.net
# Web : http://www.geocities.com/dborca
+# MinGW samples makefile updated for Mesa 7.0
+#
+# Updated : by Heromyth, on 2007-7-21
+# Email : zxpmyth@yahoo.com.cn
+# Bugs : 1) All the default settings work fine. But the setting X86=1 can't work.
+# The others havn't been tested yet.
+# 2) The generated DLLs are *not* compatible with the ones built
+# with the other compilers like VC8, especially for GLUT.
+# 3) Although more tests are needed, it can be used individually!
#
# Available options:
@@ -45,14 +54,14 @@
TOP = ../..
CC = mingw32-gcc
-CFLAGS = -Wall -W -pedantic
-CFLAGS += -O2 -ffast-math
+CFLAGS = -Wall -pedantic
+CFLAGS += -O2 -ffast-math -D_DLL
CFLAGS += -I$(TOP)/include -I../util
ifeq ($(FX),1)
-CFLAGS += -DFX
+ CFLAGS += -DFX
endif
-CFLAGS += -DGLUT_DISABLE_ATEXIT_HACK -D_STDCALL_SUPPORTED
-CFLAGS += -D_WINDEF_ -D_WINGDI_
+
+CFLAGS += -DGLUT_DISABLE_ATEXIT_HACK
LD = mingw32-g++
LDFLAGS = -s -L$(TOP)/lib
@@ -62,7 +71,8 @@
.c.o:
$(CC) -o $@ $(CFLAGS) -c $<
%.exe: ../util/readtex.o ../util/showbuffer.o %.o
- $(LD) -o $@ $(LDFLAGS) $^ $(LDLIBS)
+ $(LD) -o $@ $(LDFLAGS) $(LDLIBS) $^
+
all:
$(error Must specify to build)
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Mesa-7.0/progs/xdemos/pbdemo.c new/Mesa-7.0.1/progs/xdemos/pbdemo.c
--- old/Mesa-7.0/progs/xdemos/pbdemo.c 2007-06-22 00:10:54.000000000 +0200
+++ new/Mesa-7.0.1/progs/xdemos/pbdemo.c 2007-08-01 23:50:00.000000000 +0200
@@ -93,7 +93,7 @@
None
},
{
- /* Single bufferd, without depth buffer */
+ /* Single buffered, without depth buffer */
GLX_RENDER_TYPE, GLX_RGBA_BIT,
GLX_DRAWABLE_TYPE, GLX_PBUFFER_BIT,
GLX_RED_SIZE, 1,
@@ -105,7 +105,7 @@
None
},
{
- /* Double bufferd, without depth buffer */
+ /* Double buffered, without depth buffer */
GLX_RENDER_TYPE, GLX_RGBA_BIT,
GLX_DRAWABLE_TYPE, GLX_PBUFFER_BIT,
GLX_RED_SIZE, 1,
@@ -130,9 +130,8 @@
/* Get list of possible frame buffer configurations */
fbConfigs = ChooseFBConfig(dpy, screen, fbAttribs[attempt], &nConfigs);
if (nConfigs==0 || !fbConfigs) {
- printf("Error: glXChooseFBConfig failed\n");
- XCloseDisplay(dpy);
- return 0;
+ printf("Note: glXChooseFBConfig(%s) failed\n", fbString[attempt]);
+ continue;
}
#if 0 /*DEBUG*/
++++++ MesaLib-7.0.tar.bz2 -> MesaLib-7.0.1.tar.bz2 ++++++
++++ 14593 lines of diff (skipped)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org