~ubuntu-branches/ubuntu/natty/mesa/natty-proposed

« back to all changes in this revision

Viewing changes to src/gallium/winsys/xlib/xlib.c

  • Committer: Bazaar Package Importer
  • Author(s): Robert Hooker, Robert Hooker, Christopher James Halse Rogers
  • Date: 2010-09-14 08:55:40 UTC
  • mfrom: (1.2.28 upstream)
  • Revision ID: james.westby@ubuntu.com-20100914085540-m4fpl0hdjlfd4jgz
Tags: 7.9~git20100909-0ubuntu1
[ Robert Hooker ]
* New upstream git snapshot up to commit 94118fe2d4b1e5 (LP: #631413)
* New features include ATI HD5xxx series support in r600, and a vastly
  improved glsl compiler.
* Remove pre-generated .pc's, use the ones generated at build time
  instead.
* Remove all references to mesa-utils now that its no longer shipped
  with the mesa source.
* Disable the experimental ARB_fragment_shader option by default on
  i915, it exposes incomplete functionality that breaks KDE compositing
  among other things. It can be enabled via driconf still. (LP: #628930).

[ Christopher James Halse Rogers ]
* debian/patches/04_osmesa_version.diff:
  - Refresh for new upstream
* Bugs fixed in this release:
  - Fixes severe rendering corruption in Unity on radeon (LP: #628727,
    LP: #596292, LP: #599741, LP: #630315, LP: #613694, LP: #599741).
  - Also fixes rendering in gnome-shell (LP: #578619).
  - Flickering in OpenGL apps on radeon (LP: #626943, LP: #610541).
  - Provides preliminary support for new intel chips (LP: #601052).
* debian/rules:
  - Update configure flags to match upstream reshuffling.
  - Explicitly remove gallium DRI drivers that we don't want to ship.
* Update debian/gbp.conf for this Maverick-specific packaging
* libegl1-mesa-dri-x11,kms: There are no longer separate kms or x11 drivers
  for EGL, libegl1-mesa-drivers now contains a single driver that provides
  both backends.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/**************************************************************************
2
 
 * 
3
 
 * Copyright 2007 Tungsten Graphics, Inc., Bismarck, ND., USA
4
 
 * All Rights Reserved.
5
 
 * 
6
 
 * Permission is hereby granted, free of charge, to any person obtaining a
7
 
 * copy of this software and associated documentation files (the
8
 
 * "Software"), to deal in the Software without restriction, including
9
 
 * without limitation the rights to use, copy, modify, merge, publish,
10
 
 * distribute, sub license, and/or sell copies of the Software, and to
11
 
 * permit persons to whom the Software is furnished to do so, subject to
12
 
 * the following conditions:
13
 
 * 
14
 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
 
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
 
 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
17
 
 * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
18
 
 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 
19
 
 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 
20
 
 * USE OR OTHER DEALINGS IN THE SOFTWARE.
21
 
 *
22
 
 * The above copyright notice and this permission notice (including the
23
 
 * next paragraph) shall be included in all copies or substantial portions
24
 
 * of the Software.
25
 
 * 
26
 
 * 
27
 
 **************************************************************************/
28
 
 
29
 
/*
30
 
 * Authors:
31
 
 *   Keith Whitwell
32
 
 */
33
 
 
34
 
#include "xlib.h"
35
 
#include "xm_winsys.h"
36
 
 
37
 
#include <stdlib.h>
38
 
#include <assert.h>
39
 
 
40
 
/* Todo, replace all this with callback-structs provided by the
41
 
 * individual implementations.
42
 
 */
43
 
 
44
 
enum mode {
45
 
   MODE_CELL,
46
 
   MODE_LLVMPIPE,
47
 
   MODE_SOFTPIPE
48
 
};
49
 
 
50
 
/* advertise OpenGL support */
51
 
PUBLIC const int st_api_OpenGL = 1;
52
 
 
53
 
static enum mode get_mode()
54
 
{
55
 
#ifdef GALLIUM_CELL
56
 
   if (!getenv("GALLIUM_NOCELL")) 
57
 
      return MODE_CELL;
58
 
#endif
59
 
 
60
 
#if defined(GALLIUM_LLVMPIPE)
61
 
   return MODE_LLVMPIPE;
62
 
#else
63
 
   return MODE_SOFTPIPE;
64
 
#endif
65
 
}
66
 
 
67
 
static void _init( void ) __attribute__((constructor));
68
 
 
69
 
static void _init( void )
70
 
{
71
 
   enum mode xlib_mode = get_mode();
72
 
 
73
 
   switch (xlib_mode) {
74
 
   case MODE_CELL:
75
 
#if defined(GALLIUM_CELL)
76
 
      xmesa_set_driver( &xlib_cell_driver );
77
 
#endif
78
 
      break;
79
 
   case MODE_LLVMPIPE:
80
 
#if defined(GALLIUM_LLVMPIPE)
81
 
      xmesa_set_driver( &xlib_llvmpipe_driver );
82
 
#endif
83
 
      break;
84
 
   case MODE_SOFTPIPE:
85
 
#if defined(GALLIUM_SOFTPIPE)
86
 
      xmesa_set_driver( &xlib_softpipe_driver );
87
 
#endif
88
 
      break;
89
 
   default:
90
 
      assert(0);
91
 
      break;
92
 
   }
93
 
}
94
 
 
95
 
 
96
 
/***********************************************************************
97
 
 *
98
 
 * Butt-ugly hack to convince the linker not to throw away public GL
99
 
 * symbols (they are all referenced from getprocaddress, I guess).
100
 
 */
101
 
extern void (*linker_foo(const unsigned char *procName))();
102
 
extern void (*glXGetProcAddress(const unsigned char *procName))();
103
 
 
104
 
extern void (*linker_foo(const unsigned char *procName))()
105
 
{
106
 
   return glXGetProcAddress(procName);
107
 
}
108
 
 
109
 
 
110
 
/**
111
 
 * When GLX_INDIRECT_RENDERING is defined, some symbols are missing in
112
 
 * libglapi.a.  We need to define them here.
113
 
 */
114
 
#ifdef GLX_INDIRECT_RENDERING
115
 
 
116
 
#define GL_GLEXT_PROTOTYPES
117
 
#include "GL/gl.h"
118
 
#include "glapi/glapi.h"
119
 
#include "glapi/glapitable.h"
120
 
#include "glapi/glapidispatch.h"
121
 
 
122
 
#if defined(USE_MGL_NAMESPACE)
123
 
#define NAME(func)  mgl##func
124
 
#else
125
 
#define NAME(func)  gl##func
126
 
#endif
127
 
 
128
 
#define DISPATCH(FUNC, ARGS, MESSAGE)           \
129
 
   CALL_ ## FUNC(GET_DISPATCH(), ARGS);
130
 
 
131
 
#define RETURN_DISPATCH(FUNC, ARGS, MESSAGE)    \
132
 
   return CALL_ ## FUNC(GET_DISPATCH(), ARGS);
133
 
 
134
 
/* skip normal ones */
135
 
#define _GLAPI_SKIP_NORMAL_ENTRY_POINTS
136
 
#include "glapi/glapitemp.h"
137
 
 
138
 
#endif /* GLX_INDIRECT_RENDERING */