Hello community,
here is the log from the commit of package xorg-x11-server
checked in at Sun Sep 10 23:50:44 CEST 2006.
--------
--- xorg-x11-server/xorg-x11-server.changes 2006-09-01 23:39:45.000000000 +0200
+++ xorg-x11-server/xorg-x11-server.changes 2006-09-09 10:37:05.000000000 +0200
@@ -1,0 +2,8 @@
+Sat Sep 9 10:37:00 CEST 2006 - sndirsch@suse.de
+
+- removed two source files with imcompatible license from Mesa
+ tarball (Bug #204110)
+- added a check to specfile to make sure that these will not be
+ reintroduced with the next Mesa update again (Bug #204110)
+
+-------------------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ xorg-x11-server.spec ++++++
--- /var/tmp/diff_new_pack.8zRNH9/_old 2006-09-10 23:49:13.000000000 +0200
+++ /var/tmp/diff_new_pack.8zRNH9/_new 2006-09-10 23:49:13.000000000 +0200
@@ -17,7 +17,7 @@
URL: http://xorg.freedesktop.org/
%define EXPERIMENTAL 0
Version: 7.1
-Release: 29
+Release: 31
License: X11/MIT
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Group: System/X11/Servers/XF86_4
@@ -82,6 +82,9 @@
%endif
%prep
%setup -n xorg-server-%{dirsuffix} -b1 -a4
+# make legal department happy (Bug #204110)
+test -f ../Mesa/src/mesa/drivers/directfb/idirectfbgl_mesa.c && exit 1
+test -f ../Mesa/progs/ggi/asc-view.c && exit 1
%patch
%patch1
sed 's/LIBDIR/%{_lib}/g' %{PATCH2} | patch -p0
@@ -406,6 +409,11 @@
%endif
%changelog -n xorg-x11-server
+* Sat Sep 09 2006 - sndirsch@suse.de
+- removed two source files with imcompatible license from Mesa
+ tarball (Bug #204110)
+- added a check to specfile to make sure that these will not be
+ reintroduced with the next Mesa update again (Bug #204110)
* Fri Sep 01 2006 - sndirsch@suse.de
- moved xf86Parser.h,xf86Optrec.h back to /usr/include/xorg, since
SaX2 build issues have finally been resolved by making use of
++++++ Mesa-6.5_20060712.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Mesa/progs/ggi/asc-view.c new/Mesa/progs/ggi/asc-view.c
--- old/Mesa/progs/ggi/asc-view.c 1999-08-21 10:53:27.000000000 +0200
+++ new/Mesa/progs/ggi/asc-view.c 1970-01-01 01:00:00.000000000 +0100
@@ -1,377 +0,0 @@
-/*
- test program for the ggi-mesa driver
-
- Copyright (C) 1997,1998 Uwe Maurer - uwe_maurer@t-online.de
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-*/
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-ggi_visual_t vis,vis_mem;
-
-GGIMesaContext ctx;
-
-int screen_x=GGI_AUTO,screen_y=GGI_AUTO;
-ggi_graphtype bpp=GT_AUTO;
-
-//#define ZBUFFER
-
-//#define SMOOTH_NORMALS
-
-void Init()
-{
- GLfloat h=(GLfloat)3/4;
- GLfloat pos[4]={5,5,-20,0};
- GLfloat specular[4]={.4,.4,.4,1};
- GLfloat diffuse[4]={.3,.3,.3,1};
- GLfloat ambient[4]={.2,.2,.2,1};
-
- int err;
-
- if (ggiInit()<0)
- {
- printf("ggiInit() failed\n");
- exit(1);
- }
- ctx=GGIMesaCreateContext();
- if (ctx==NULL)
- {
- printf("Can't create Context!\n");
- exit(1);
- }
-
- vis=ggiOpen(NULL);
- vis_mem=ggiOpen("display-memory",NULL);
- if (vis==NULL || vis_mem==NULL)
- {
- printf("Can't open ggi_visuals!\n");
- exit(1);
- }
- err=ggiSetGraphMode(vis,screen_x,screen_y,screen_x,screen_y,bpp);
- err+=ggiSetGraphMode(vis_mem,screen_x,screen_y,screen_x,screen_y,bpp);
- if (err)
- {
- printf("Can't set %ix%i\n",screen_x,screen_y);
- exit(1);
- }
-
- if (GGIMesaSetVisual(ctx,vis_mem,GL_TRUE,GL_FALSE)<0)
- {
- printf("GGIMesaSetVisual() failed!\n");
- exit(1);
- }
-
- GGIMesaMakeCurrent(ctx);
-
- glViewport(0,0,screen_x,screen_y);
- glMatrixMode(GL_PROJECTION);
- glLoadIdentity();
- glFrustum(-1,1,-h,h,1,50);
- glMatrixMode(GL_MODELVIEW);
- glLoadIdentity();
- glTranslatef(0,0,-9);
- glShadeModel(GL_FLAT);
-
- glFrontFace(GL_CW);
- glEnable(GL_CULL_FACE);
- glEnable(GL_LIGHTING);
- glEnable(GL_LIGHT0);
-
- glLightfv(GL_LIGHT0,GL_POSITION,pos);
-
- glLightfv(GL_LIGHT0,GL_DIFFUSE,diffuse);
- glLightfv(GL_LIGHT0,GL_AMBIENT,ambient);
- glLightfv(GL_LIGHT0,GL_SPECULAR,specular);
-
- #ifdef ZBUFFER
- glEnable(GL_DEPTH_TEST);
- #endif
-}
-
-
-#define MAX_VERTS 1000
-#define MAX_TRIS 2000
-#define MAX_LEN 1024
-#define MAX_F 100000000
-
-void LoadAsc(GLuint *list,char *file)
-{
- FILE *fp;
-
- GLfloat p[MAX_VERTS][3];
- GLfloat normal[MAX_VERTS][3];
- float ncount[MAX_VERTS];
- int v[MAX_TRIS][3];
- char line[MAX_LEN];
- char *s;
- int i,j;
- int verts,faces;
- GLuint v0,v1,v2;
- GLfloat n[3];
- GLfloat len,k;
- GLfloat min[3]={MAX_F,MAX_F,MAX_F};
- GLfloat max[3]={-MAX_F,-MAX_F,-MAX_F};
- char *coord_str[]={"X","Z","Y"};
-
- fp=fopen(file,"r");
- if (!fp)
- {
- printf("Can't open %s!\n",file);
- exit(1);
- }
-
- while (strncmp(fgets(line,MAX_LEN,fp),"Tri-mesh",8)) ;
-
- s=strstr(line,":")+1;
- verts=atoi(s);
- s=strstr(s,":")+1;
- faces=atoi(s);
-
- if (verts>MAX_VERTS)
- {
- printf("Too many vertices..\n");
- exit(1);
- }
-
- while (strncmp(fgets(line,MAX_LEN,fp),"Vertex list",11)) ;
-
- for (i=0;imax[j]) max[j]=k;
- if (klen) {len=k;j=i;}
- n[i]=(max[i]+min[i])/2;
- }
-
- len/=2;
-
- for (i=0;iread);
- rotate+=10;
- frames++;
- if (frames==(*maxframes)) break;
-
- if (ggiKbhit(vis))
- {
- *maxframes=frames;
- break;
- }
- }
-
- gettimeofday(&stop,NULL);
- len=(double)(stop.tv_sec-start.tv_sec)+
- (double)(stop.tv_usec-start.tv_usec)/1e6;
- return len;
-}
-
-void visible(int vis)
-{
- if (vis == GLUT_VISIBLE)
- glutIdleFunc(idle);
- else
- glutIdleFunc(NULL);
-}
-
-int main(int argc, char *argv[])
-{
- glutInit(&argc, argv);
- glutInitDisplayMode(GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);
-
- glutInitWindowPosition(0, 0);
- glutInitWindowSize(300, 300);
- glutCreateWindow("asc-view");
- init();
-
- glutDisplayFunc(draw);
- glutReshapeFunc(reshape);
- glutKeyboardFunc(key);
- glutSpecialFunc(special);
- glutVisibilityFunc(visible);
-
- glutMainLoop();
-#if 0
- GLuint l;
- char *file;
- int maxframes=0;
- double len;
-
- Init();
-
- file=(argc>1) ? argv[1] : "asc/box.asc";
- if (argc>2) maxframes=atoi(argv[2]);
-
- if (argc==1)
- {
- printf("usage: %s filename.asc\n",argv[0]);
- }
-
- LoadAsc(&l,file);
-
- len=Display(l,&maxframes);
-
- printf("\ttime: %.3f sec\n",len);
- printf("\tframes: %i\n",maxframes);
- printf("\tfps: %.3f \n",(double)maxframes/len);
-
- GGIMesaDestroyContext(ctx);
- ggiClose(vis);
- ggiClose(vis_mem);
- ggiExit();
-#endif
- return 0;
-}
-
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/Mesa/src/mesa/drivers/directfb/idirectfbgl_mesa.c new/Mesa/src/mesa/drivers/directfb/idirectfbgl_mesa.c
--- old/Mesa/src/mesa/drivers/directfb/idirectfbgl_mesa.c 2006-07-31 06:49:52.000000000 +0200
+++ new/Mesa/src/mesa/drivers/directfb/idirectfbgl_mesa.c 1970-01-01 01:00:00.000000000 +0100
@@ -1,817 +0,0 @@
-/*
- * Copyright (C) 2004-2006 Claudio Ciccani
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- *
- * Based on glfbdev.c, written by Brian Paul.
- *
- */
-
-#include
-#include
-#include
-
-#include
-
-#include
-#include
-#include
-
-#ifdef CLAMP
-# undef CLAMP
-#endif
-
-#include "GL/directfbgl.h"
-#include "glheader.h"
-#include "buffers.h"
-#include "context.h"
-#include "extensions.h"
-#include "framebuffer.h"
-#include "renderbuffer.h"
-#include "imports.h"
-#include "texformat.h"
-#include "teximage.h"
-#include "texstore.h"
-#include "array_cache/acache.h"
-#include "swrast/swrast.h"
-#include "swrast_setup/swrast_setup.h"
-#include "tnl/tnl.h"
-#include "tnl/t_context.h"
-#include "tnl/t_pipeline.h"
-#include "drivers/common/driverfuncs.h"
-
-
-static DFBResult
-Probe( void *data );
-
-static DFBResult
-Construct( IDirectFBGL *thiz,
- IDirectFBSurface *surface );
-
-#include
-
-DIRECT_INTERFACE_IMPLEMENTATION( IDirectFBGL, Mesa )
-
-/*
- * private data struct of IDirectFBGL
- */
-typedef struct {
- int ref; /* reference counter */
-
- int locked;
-
- IDirectFBSurface *surface;
- DFBSurfacePixelFormat format;
- int width;
- int height;
-
- struct {
- __u8 *start;
- __u8 *end;
- int pitch;
- } video;
-
- GLvisual visual;
- GLframebuffer framebuffer;
- GLcontext context;
- struct gl_renderbuffer render;
-} IDirectFBGL_data;
-
-
-static bool directfbgl_init_visual ( GLvisual *visual,
- DFBSurfacePixelFormat format );
-static bool directfbgl_create_context ( GLcontext *context,
- GLframebuffer *framebuffer,
- GLvisual *visual,
- DFBSurfacePixelFormat format,
- IDirectFBGL_data *data );
-static void directfbgl_destroy_context( GLcontext *context,
- GLframebuffer *framebuffer );
-
-
-static void
-IDirectFBGL_Destruct( IDirectFBGL *thiz )
-{
- IDirectFBGL_data *data = (IDirectFBGL_data*) thiz->priv;
-
- directfbgl_destroy_context( &data->context, &data->framebuffer );
-
- data->surface->Release( data->surface );
-
- DIRECT_DEALLOCATE_INTERFACE( thiz );
-}
-
-static DFBResult
-IDirectFBGL_AddRef( IDirectFBGL *thiz )
-{
- DIRECT_INTERFACE_GET_DATA( IDirectFBGL );
-
- data->ref++;
-
- return DFB_OK;
-}
-
-static DFBResult
-IDirectFBGL_Release( IDirectFBGL *thiz )
-{
- DIRECT_INTERFACE_GET_DATA( IDirectFBGL )
-
- if (--data->ref == 0) {
- IDirectFBGL_Destruct( thiz );
- }
-
- return DFB_OK;
-}
-
-static DFBResult
-IDirectFBGL_Lock( IDirectFBGL *thiz )
-{
- IDirectFBSurface *surface;
- int width = 0;
- int height = 0;
- DFBResult err;
-
- DIRECT_INTERFACE_GET_DATA( IDirectFBGL );
-
- if (data->locked++)
- return DFB_OK;
-
- surface = data->surface;
- surface->GetSize( surface, &width, &height );
-
- err = surface->Lock( surface, DSLF_READ | DSLF_WRITE,
- (void*)&data->video.start, &data->video.pitch );
- if (err != DFB_OK) {
- D_ERROR( "DirectFBGL/Mesa: couldn't lock surface.\n" );
- return err;
- }
- data->video.end = data->video.start + (height-1) * data->video.pitch;
-
- data->render.Data = data->video.start;
-
- _mesa_make_current( &data->context,
- &data->framebuffer, &data->framebuffer );
-
- if (data->width != width || data->height != height) {
- data->width = width;
- data->height = height;
- _mesa_ResizeBuffersMESA();
- }
-
- return DFB_OK;
-}
-
-static DFBResult
-IDirectFBGL_Unlock( IDirectFBGL *thiz )
-{
- DIRECT_INTERFACE_GET_DATA( IDirectFBGL );
-
- if (!data->locked)
- return DFB_OK;
-
- if (--data->locked == 0) {
- _mesa_make_current( NULL, NULL, NULL );
- data->surface->Unlock( data->surface );
- }
-
- return DFB_OK;
-}
-
-static DFBResult
-IDirectFBGL_GetAttributes( IDirectFBGL *thiz,
- DFBGLAttributes *attributes )
-{
- DFBSurfaceCapabilities caps;
- GLvisual *visual;
-
- DIRECT_INTERFACE_GET_DATA( IDirectFBGL );
-
- if (!attributes)
- return DFB_INVARG;
-
- data->surface->GetCapabilities( data->surface, &caps );
-
- visual = &data->visual;
-
- attributes->buffer_size = visual->rgbBits ? : visual->indexBits;
- attributes->depth_size = visual->depthBits;
- attributes->stencil_size = visual->stencilBits;
- attributes->aux_buffers = visual->numAuxBuffers;
- attributes->red_size = visual->redBits;
- attributes->green_size = visual->greenBits;
- attributes->blue_size = visual->blueBits;
- attributes->alpha_size = visual->alphaBits;
- attributes->accum_red_size = visual->accumRedBits;
- attributes->accum_green_size = visual->accumGreenBits;
- attributes->accum_blue_size = visual->accumBlueBits;
- attributes->accum_alpha_size = visual->accumAlphaBits;
- attributes->double_buffer = (caps & DSCAPS_FLIPPING) ? 1 : 0;
- attributes->stereo = (visual->stereoMode != 0);
-
- return DFB_OK;
-}
-
-
-/* exported symbols */
-
-static DFBResult
-Probe( void *data )
-{
- return DFB_OK;
-}
-
-static DFBResult
-Construct( IDirectFBGL *thiz,
- IDirectFBSurface *surface )
-{
- /* Allocate interface data. */
- DIRECT_ALLOCATE_INTERFACE_DATA( thiz, IDirectFBGL );
-
- /* Initialize interface data. */
- data->ref = 1;
- data->surface = surface;
-
- surface->AddRef( surface );
- surface->GetPixelFormat( surface, &data->format );
- surface->GetSize( surface, &data->width, &data->height );
-
- /* Configure visual. */
- if (!directfbgl_init_visual( &data->visual, data->format )) {
- D_ERROR( "DirectFBGL/Mesa: failed to initialize visual.\n" );
- surface->Release( surface );
- return DFB_UNSUPPORTED;
- }
-
- /* Create context. */
- if (!directfbgl_create_context( &data->context, &data->framebuffer,
- &data->visual, data->format, data )) {
- D_ERROR( "DirectFBGL/Mesa: failed to create context.\n" );
- surface->Release( surface );
- return DFB_UNSUPPORTED;
- }
-
- /* Assign interface pointers. */
- thiz->AddRef = IDirectFBGL_AddRef;
- thiz->Release = IDirectFBGL_Release;
- thiz->Lock = IDirectFBGL_Lock;
- thiz->Unlock = IDirectFBGL_Unlock;
- thiz->GetAttributes = IDirectFBGL_GetAttributes;
-
- return DFB_OK;
-}
-
-
-/***************************** Driver functions ******************************/
-
-static const GLubyte*
-dfbGetString( GLcontext *ctx, GLenum pname )
-{
- switch (pname) {
- case GL_VENDOR:
- return "Claudio Ciccani";
- default:
- return NULL;
- }
-}
-
-static void
-dfbUpdateState( GLcontext *ctx, GLuint new_state )
-{
- _swrast_InvalidateState( ctx, new_state );
- _swsetup_InvalidateState( ctx, new_state );
- _ac_InvalidateState( ctx, new_state );
- _tnl_InvalidateState( ctx, new_state );
-}
-
-static void
-dfbGetBufferSize( GLframebuffer *buffer, GLuint *width, GLuint *height )
-{
- GLcontext *ctx = _mesa_get_current_context();
- IDirectFBGL_data *data = (IDirectFBGL_data*) ctx->DriverCtx;
-
- *width = (GLuint) data->width;
- *height = (GLuint) data->height;
-}
-
-static void
-dfbSetViewport( GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h )
-{
- _mesa_ResizeBuffersMESA();
-}
-
-static void
-dfbClear( GLcontext *ctx, GLbitfield mask, GLboolean all,
- GLint x, GLint y, GLint width, GLint height )
-{
- IDirectFBGL_data *data = (IDirectFBGL_data*) ctx->DriverCtx;
-
- if (mask & BUFFER_BIT_FRONT_LEFT &&
- ctx->Color.ColorMask[0] &&
- ctx->Color.ColorMask[1] &&
- ctx->Color.ColorMask[2] &&
- ctx->Color.ColorMask[3])
- {
- __u8 a, r, g, b;
-
- UNCLAMPED_FLOAT_TO_UBYTE( a, ctx->Color.ClearColor[ACOMP] );
- UNCLAMPED_FLOAT_TO_UBYTE( r, ctx->Color.ClearColor[RCOMP] );
- UNCLAMPED_FLOAT_TO_UBYTE( g, ctx->Color.ClearColor[GCOMP] );
- UNCLAMPED_FLOAT_TO_UBYTE( b, ctx->Color.ClearColor[BCOMP] );
-
- data->surface->Unlock( data->surface );
-
- if (all) {
- data->surface->SetClip( data->surface, NULL );
- data->surface->Clear( data->surface, r, g, b, a );
- }
- else {
- DFBRegion reg = { x1:x, y1:y, x2:x+width-1, y2:y+height-1 };
- data->surface->SetClip( data->surface, ® );
- data->surface->Clear( data->surface, r, g, b, a );
- data->surface->SetClip( data->surface, NULL );
- }
-
- data->surface->Lock( data->surface, DSLF_READ | DSLF_WRITE,
- (void*)&data->video.start, &data->video.pitch );
-
- mask &= ~BUFFER_BIT_FRONT_LEFT;
- }
-
- if (mask)
- _swrast_Clear( ctx, mask, all, x, y, width, height );
-}
-
-
-
-/************************ RenderBuffer functions *****************************/
-
-static void
-dfbDeleteRenderbuffer( struct gl_renderbuffer *render )
-{
- return;
-}
-
-static GLboolean
-dfbRenderbufferStorage( GLcontext *ctx, struct gl_renderbuffer *render,
- GLenum internalFormat, GLuint width, GLuint height )
-{
- return GL_TRUE;
-}
-
-
-/***************************** Span functions ********************************/
-
-/* RGB332 */
-#define NAME(PREFIX) PREFIX##_RGB332
-#define FORMAT GL_RGBA8
-#define RB_TYPE GLubyte
-#define SPAN_VARS \
- IDirectFBGL_data *data = (IDirectFBGL_data*) ctx->DriverCtx;
-#define INIT_PIXEL_PTR(P, X, Y) \
- GLubyte *P = data->video.end - (Y) * data->video.pitch + (X);
-#define INC_PIXEL_PTR(P) P += 1
-#define STORE_PIXEL(P, X, Y, S) \
- *P = ( (((S[RCOMP]) & 0xe0) ) | \
- (((S[GCOMP]) & 0xe0) >> 3) | \
- (((S[BCOMP]) ) >> 6) )
-#define FETCH_PIXEL(D, P) \
- D[RCOMP] = ((*P & 0xe0) ); \
- D[GCOMP] = ((*P & 0x1c) << 3); \
- D[BCOMP] = ((*P & 0x03) << 6); \
- D[ACOMP] = 0xff
-
-#include "swrast/s_spantemp.h"
-
-/* ARGB4444 */
-#define NAME(PREFIX) PREFIX##_ARGB4444
-#define FORMAT GL_RGBA8
-#define RB_TYPE GLubyte
-#define SPAN_VARS \
- IDirectFBGL_data *data = (IDirectFBGL_data*) ctx->DriverCtx;
-#define INIT_PIXEL_PTR(P, X, Y) \
- GLushort *P = (GLushort *) (data->video.end - (Y) * data->video.pitch + (X) * 2);
-#define INC_PIXEL_PTR(P) P += 1
-#define STORE_PIXEL_RGB(P, X, Y, S) \
- *P = ( 0xf000 | \
- (((S[RCOMP]) & 0xf0) << 4) | \
- (((S[GCOMP]) & 0xf0) ) | \
- (((S[BCOMP]) & 0xf0) >> 4) )
-#define STORE_PIXEL(P, X, Y, S) \
- *P = ( (((S[ACOMP]) & 0xf0) << 8) | \
- (((S[RCOMP]) & 0xf0) << 4) | \
- (((S[GCOMP]) & 0xf0) ) | \
- (((S[BCOMP]) & 0xf0) >> 4) )
-#define FETCH_PIXEL(D, P) \
- D[RCOMP] = ((*P & 0x0f00) >> 4); \
- D[GCOMP] = ((*P & 0x00f0) ); \
- D[BCOMP] = ((*P & 0x000f) << 4); \
- D[ACOMP] = ((*P & 0xf000) >> 8)
-
-#include "swrast/s_spantemp.h"
-
-/* ARGB2554 */
-#define NAME(PREFIX) PREFIX##_ARGB2554
-#define FORMAT GL_RGBA8
-#define RB_TYPE GLubyte
-#define SPAN_VARS \
- IDirectFBGL_data *data = (IDirectFBGL_data*) ctx->DriverCtx;
-#define INIT_PIXEL_PTR(P, X, Y) \
- GLushort *P = (GLushort *) (data->video.end - (Y) * data->video.pitch + (X) * 2);
-#define INC_PIXEL_PTR(P) P += 1
-#define STORE_PIXEL_RGB(P, X, Y, S) \
- *P = ( 0xc000 | \
- (((S[RCOMP]) & 0xf8) << 6) | \
- (((S[GCOMP]) & 0xf8) << 1) | \
- (((S[BCOMP]) & 0xf0) >> 4) )
-#define STORE_PIXEL(P, X, Y, S) \
- *P = ( (((S[ACOMP]) & 0xc0) << 8) | \
- (((S[RCOMP]) & 0xf8) << 6) | \
- (((S[GCOMP]) & 0xf8) << 1) | \
- (((S[BCOMP]) & 0xf0) >> 4) )
-#define FETCH_PIXEL(D, P) \
- D[RCOMP] = ((*P & 0x3e00) >> 9); \
- D[GCOMP] = ((*P & 0x01f0) >> 4); \
- D[BCOMP] = ((*P & 0x000f) << 4); \
- D[ACOMP] = ((*P & 0xc000) >> 14)
-
-#include "swrast/s_spantemp.h"
-
-/* ARGB1555 */
-#define NAME(PREFIX) PREFIX##_ARGB1555
-#define FORMAT GL_RGBA8
-#define RB_TYPE GLubyte
-#define SPAN_VARS \
- IDirectFBGL_data *data = (IDirectFBGL_data*) ctx->DriverCtx;
-#define INIT_PIXEL_PTR(P, X, Y) \
- GLushort *P = (GLushort *) (data->video.end - (Y) * data->video.pitch + (X) * 2);
-#define INC_PIXEL_PTR(P) P += 1
-#define STORE_PIXEL_RGB(P, X, Y, S) \
- *P = ( 0x8000 | \
- (((S[RCOMP]) & 0xf8) << 7) | \
- (((S[GCOMP]) & 0xf8) << 2) | \
- (((S[BCOMP]) ) >> 3) )
-#define STORE_PIXEL(P, X, Y, S) \
- *P = ( (((S[ACOMP]) & 0x80) << 16) | \
- (((S[RCOMP]) & 0xf8) << 7) | \
- (((S[GCOMP]) & 0xf8) << 2) | \
- (((S[BCOMP]) ) >> 3) )
-#define FETCH_PIXEL(D, P) \
- D[RCOMP] = ((*P & 0x7c00) >> 7); \
- D[GCOMP] = ((*P & 0x03e0) >> 2); \
- D[BCOMP] = ((*P & 0x001f) << 3); \
- D[ACOMP] = ((*P & 0x8000) ? 0xff : 0)
-
-#include "swrast/s_spantemp.h"
-
-/* RGB16 */
-#define NAME(PREFIX) PREFIX##_RGB16
-#define FORMAT GL_RGBA8
-#define RB_TYPE GLubyte
-#define SPAN_VARS \
- IDirectFBGL_data *data = (IDirectFBGL_data*) ctx->DriverCtx;
-#define INIT_PIXEL_PTR(P, X, Y) \
- GLushort *P = (GLushort *) (data->video.end - (Y) * data->video.pitch + (X) * 2);
-#define INC_PIXEL_PTR(P) P += 1
-#define STORE_PIXEL(P, X, Y, S) \
- *P = ( (((S[RCOMP]) & 0xf8) << 8) | \
- (((S[GCOMP]) & 0xfc) << 3) | \
- (((S[BCOMP]) ) >> 3) )
-#define FETCH_PIXEL(D, P) \
- D[RCOMP] = ((*P & 0xf800) >> 8); \
- D[GCOMP] = ((*P & 0x07e0) >> 3); \
- D[BCOMP] = ((*P & 0x001f) << 3); \
- D[ACOMP] = 0xff
-
-#include "swrast/s_spantemp.h"
-
-/* RGB24 */
-#define NAME(PREFIX) PREFIX##_RGB24
-#define FORMAT GL_RGBA8
-#define RB_TYPE GLubyte
-#define SPAN_VARS \
- IDirectFBGL_data *data = ctx->DriverCtx;
-#define INIT_PIXEL_PTR(P, X, Y) \
- GLubyte *P = data->video.end - (Y) * data->video.pitch + (X) * 3;
-#define INC_PIXEL_PTR(P) P += 3
-#define STORE_PIXEL(P, X, Y, S) \
- P[0] = S[BCOMP]; P[1] = S[GCOMP]; P[2] = S[BCOMP]
-#define FETCH_PIXEL(D, P) \
- D[RCOMP] = P[2]; D[GCOMP] = P[1]; D[BCOMP] = P[0]; D[ACOMP] = 0xff
-
-#include "swrast/s_spantemp.h"
-
-/* RGB32 */
-#define NAME(PREFIX) PREFIX##_RGB32
-#define FORMAT GL_RGBA8
-#define RB_TYPE GLubyte
-#define SPAN_VARS \
- IDirectFBGL_data *data = (IDirectFBGL_data*) ctx->DriverCtx;
-#define INIT_PIXEL_PTR(P, X, Y) \
- GLuint *P = (GLuint*) (data->video.end - (Y) * data->video.pitch + (X) * 4);
-#define INC_PIXEL_PTR(P) P += 1
-#define STORE_PIXEL(P, X, Y, S) \
- *P = ( ((S[RCOMP]) << 16) | \
- ((S[GCOMP]) << 8) | \
- ((S[BCOMP]) ) )
-#define FETCH_PIXEL(D, P) \
- D[RCOMP] = ((*P & 0x00ff0000) >> 16); \
- D[GCOMP] = ((*P & 0x0000ff00) >> 8); \
- D[BCOMP] = ((*P & 0x000000ff) ); \
- D[ACOMP] = 0xff
-
-#include "swrast/s_spantemp.h"
-
-/* ARGB */
-#define NAME(PREFIX) PREFIX##_ARGB
-#define FORMAT GL_RGBA8
-#define RB_TYPE GLubyte
-#define SPAN_VARS \
- IDirectFBGL_data *data = (IDirectFBGL_data*) ctx->DriverCtx;
-#define INIT_PIXEL_PTR(P, X, Y) \
- GLuint *P = (GLuint*) (data->video.end - (Y) * data->video.pitch + (X) * 4);
-#define INC_PIXEL_PTR(P) P += 1
-#define STORE_PIXEL_RGB(P, X, Y, S) \
- *P = ( 0xff000000 | \
- ((S[RCOMP]) << 16) | \
- ((S[GCOMP]) << 8) | \
- ((S[BCOMP]) ) )
-#define STORE_PIXEL(P, X, Y, S) \
- *P = ( ((S[ACOMP]) << 24) | \
- ((S[RCOMP]) << 16) | \
- ((S[GCOMP]) << 8) | \
- ((S[BCOMP]) ) )
-#define FETCH_PIXEL(D, P) \
- D[RCOMP] = ((*P & 0x00ff0000) >> 16); \
- D[GCOMP] = ((*P & 0x0000ff00) >> 8); \
- D[BCOMP] = ((*P & 0x000000ff) ); \
- D[ACOMP] = ((*P & 0xff000000) >> 24)
-
-#include "swrast/s_spantemp.h"
-
-/* AiRGB */
-#define NAME(PREFIX) PREFIX##_AiRGB
-#define FORMAT GL_RGBA8
-#define RB_TYPE GLubyte
-#define SPAN_VARS \
- IDirectFBGL_data *data = (IDirectFBGL_data*) ctx->DriverCtx;
-#define INIT_PIXEL_PTR(P, X, Y) \
- GLuint *P = (GLuint*) (data->video.end - (Y) * data->video.pitch + (X) * 4);
-#define INC_PIXEL_PTR(P) P += 1
-#define STORE_PIXEL_RGB(P, X, Y, S) \
- *P = ( ((S[RCOMP]) << 16) | \
- ((S[GCOMP]) << 8) | \
- ((S[BCOMP]) ) )
-#define STORE_PIXEL(P, X, Y, S) \
- *P = ( (((S[ACOMP]) ^ 0xff) << 24) | \
- (((S[RCOMP]) ) << 16) | \
- (((S[GCOMP]) ) << 8) | \
- (((S[BCOMP]) ) ) )
-#define FETCH_PIXEL(D, P) \
- D[RCOMP] = ((*P & 0x00ff0000) >> 16); \
- D[GCOMP] = ((*P & 0x0000ff00) >> 8); \
- D[BCOMP] = ((*P & 0x000000ff) ); \
- D[ACOMP] = (((*P & 0xff000000) >> 24) ^ 0xff)
-
-#include "swrast/s_spantemp.h"
-
-
-/*****************************************************************************/
-
-static bool
-directfbgl_init_visual( GLvisual *visual,
- DFBSurfacePixelFormat format )
-{
- GLboolean rgbFlag = GL_TRUE;
- GLboolean dbFlag = GL_FALSE;
- GLboolean stereoFlag = GL_FALSE;
- GLint redBits = 0;
- GLint blueBits = 0;
- GLint greenBits = 0;
- GLint alphaBits = 0;
- GLint indexBits = 0;
- GLint depthBits = 0;
- GLint stencilBits = 0;
- GLint accumRedBits = 0;
- GLint accumGreenBits = 0;
- GLint accumBlueBits = 0;
- GLint accumAlphaBits = 0;
- GLint numSamples = 0;
-
- /* FIXME: LUT8 support. */
- switch (format) {
- case DSPF_RGB332:
- redBits = 3;
- greenBits = 3;
- blueBits = 2;
- break;
- case DSPF_ARGB4444:
- redBits = 4;
- greenBits = 4;
- blueBits = 4;
- alphaBits = 4;
- break;
- case DSPF_ARGB2554:
- redBits = 5;
- greenBits = 5;
- blueBits = 4;
- alphaBits = 2;
- break;
- case DSPF_ARGB1555:
- redBits = 5;
- greenBits = 5;
- blueBits = 5;
- alphaBits = 1;
- break;
- case DSPF_RGB16:
- redBits = 5;
- greenBits = 6;
- blueBits = 5;
- break;
- case DSPF_ARGB:
- case DSPF_AiRGB:
- alphaBits = 8;
- case DSPF_RGB24:
- case DSPF_RGB32:
- redBits = 8;
- greenBits = 8;
- blueBits = 8;
- break;
- default:
- D_WARN( "unsupported pixelformat" );
- return false;
- }
-
- if (rgbFlag) {
- accumRedBits = redBits;
- accumGreenBits = greenBits;
- accumBlueBits = blueBits;
- accumAlphaBits = alphaBits;
- depthBits = redBits + greenBits + blueBits;
- stencilBits = alphaBits;
- } else
- depthBits = 8;
-
- return _mesa_initialize_visual( visual,
- rgbFlag, dbFlag, stereoFlag,
- redBits, greenBits, blueBits, alphaBits,
- indexBits, depthBits, stencilBits,
- accumRedBits, accumGreenBits,
- accumBlueBits, accumAlphaBits,
- numSamples );
-}
-
-static bool
-directfbgl_create_context( GLcontext *context,
- GLframebuffer *framebuffer,
- GLvisual *visual,
- DFBSurfacePixelFormat format,
- IDirectFBGL_data *data )
-{
- struct dd_function_table functions;
-
- _mesa_initialize_framebuffer( framebuffer, visual );
-
- _mesa_init_driver_functions( &functions );
- functions.GetString = dfbGetString;
- functions.UpdateState = dfbUpdateState;
- functions.GetBufferSize = dfbGetBufferSize;
- functions.Viewport = dfbSetViewport;
- functions.Clear = dfbClear;
-
- if (!_mesa_initialize_context( context, visual, NULL,
- &functions, (void*) data )) {
- D_DEBUG( "DirectFBGL/Mesa: _mesa_initialize_context() failed.\n" );
- _mesa_free_framebuffer_data( framebuffer );
- return false;
- }
-
- _swrast_CreateContext( context );
- _ac_CreateContext( context );
- _tnl_CreateContext( context );
- _swsetup_CreateContext( context );
- _swsetup_Wakeup( context );
-
- _mesa_init_renderbuffer( &data->render, 0 );
- data->render.InternalFormat = GL_RGBA;
- data->render._BaseFormat = GL_RGBA;
- data->render.DataType = GL_UNSIGNED_BYTE;
- data->render.Data = data->video.start;
- data->render.Delete = dfbDeleteRenderbuffer;
- data->render.AllocStorage = dfbRenderbufferStorage;
-
- switch (format) {
- case DSPF_RGB332:
- data->render.GetRow = get_row_RGB332;
- data->render.GetValues = get_values_RGB332;
- data->render.PutRow = put_row_RGB332;
- data->render.PutMonoRow = put_mono_row_RGB332;
- data->render.PutValues = put_values_RGB332;
- data->render.PutMonoValues = put_mono_values_RGB332;
- break;
- case DSPF_ARGB4444:
- data->render.GetRow = get_row_ARGB4444;
- data->render.GetValues = get_values_ARGB4444;
- data->render.PutRow = put_row_ARGB4444;
- data->render.PutMonoRow = put_mono_row_ARGB4444;
- data->render.PutValues = put_values_ARGB4444;
- data->render.PutMonoValues = put_mono_values_ARGB4444;
- break;
- case DSPF_ARGB2554:
- data->render.GetRow = get_row_ARGB2554;
- data->render.GetValues = get_values_ARGB2554;
- data->render.PutRow = put_row_ARGB2554;
- data->render.PutMonoRow = put_mono_row_ARGB2554;
- data->render.PutValues = put_values_ARGB2554;
- data->render.PutMonoValues = put_mono_values_ARGB2554;
- break;
- case DSPF_ARGB1555:
- data->render.GetRow = get_row_ARGB1555;
- data->render.GetValues = get_values_ARGB1555;
- data->render.PutRow = put_row_ARGB1555;
- data->render.PutMonoRow = put_mono_row_ARGB1555;
- data->render.PutValues = put_values_ARGB1555;
- data->render.PutMonoValues = put_mono_values_ARGB1555;
- break;
- case DSPF_RGB16:
- data->render.GetRow = get_row_RGB16;
- data->render.GetValues = get_values_RGB16;
- data->render.PutRow = put_row_RGB16;
- data->render.PutMonoRow = put_mono_row_RGB16;
- data->render.PutValues = put_values_RGB16;
- data->render.PutMonoValues = put_mono_values_RGB16;
- break;
- case DSPF_RGB24:
- data->render.GetRow = get_row_RGB24;
- data->render.GetValues = get_values_RGB24;
- data->render.PutRow = put_row_RGB24;
- data->render.PutMonoRow = put_mono_row_RGB24;
- data->render.PutValues = put_values_RGB24;
- data->render.PutMonoValues = put_mono_values_RGB24;
- break;
- case DSPF_RGB32:
- data->render.GetRow = get_row_RGB32;
- data->render.GetValues = get_values_RGB32;
- data->render.PutRow = put_row_RGB32;
- data->render.PutMonoRow = put_mono_row_RGB32;
- data->render.PutValues = put_values_RGB32;
- data->render.PutMonoValues = put_mono_values_RGB32;
- break;
- case DSPF_ARGB:
- data->render.GetRow = get_row_ARGB;
- data->render.GetValues = get_values_ARGB;
- data->render.PutRow = put_row_ARGB;
- data->render.PutMonoRow = put_mono_row_ARGB;
- data->render.PutValues = put_values_ARGB;
- data->render.PutMonoValues = put_mono_values_ARGB;
- break;
- case DSPF_AiRGB:
- data->render.GetRow = get_row_AiRGB;
- data->render.GetValues = get_values_AiRGB;
- data->render.PutRow = put_row_AiRGB;
- data->render.PutMonoRow = put_mono_row_AiRGB;
- data->render.PutValues = put_values_AiRGB;
- data->render.PutMonoValues = put_mono_values_AiRGB;
- break;
- default:
- D_BUG( "unexpected pixelformat" );
- return false;
- }
-
- _mesa_add_renderbuffer( framebuffer, BUFFER_FRONT_LEFT, &data->render );
-
- _mesa_add_soft_renderbuffers( framebuffer,
- GL_FALSE,
- visual->haveDepthBuffer,
- visual->haveStencilBuffer,
- visual->haveAccumBuffer,
- GL_FALSE,
- GL_FALSE );
-
- TNL_CONTEXT( context )->Driver.RunPipeline = _tnl_run_pipeline;
-
- _mesa_enable_sw_extensions( context );
-
- return true;
-}
-
-static void
-directfbgl_destroy_context( GLcontext *context,
- GLframebuffer *framebuffer )
-{
- _mesa_free_framebuffer_data( framebuffer );
- _mesa_notifyDestroy( context );
- _mesa_free_context_data( context );
-}
-
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org