2 * Copyright 2002 by Alan Hourihane, Sychdyn, North Wales, UK.
4 * Permission to use, copy, modify, distribute, and sell this software and its
5 * documentation for any purpose is hereby granted without fee, provided that
6 * the above copyright notice appear in all copies and that both that
7 * copyright notice and this permission notice appear in supporting
8 * documentation, and that the name of Alan Hourihane not be used in
9 * advertising or publicity pertaining to distribution of the software without
10 * specific, written prior permission. Alan Hourihane makes no representations
11 * about the suitability of this software for any purpose. It is provided
12 * "as is" without express or implied warranty.
14 * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
15 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
16 * EVENT SHALL ALAN HOURIHANE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
17 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
18 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
19 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
20 * PERFORMANCE OF THIS SOFTWARE.
22 * Authors: Alan Hourihane, <alanh@fairlite.demon.co.uk>
24 * Trident CyberBladeXP driver.
27 #include "trident_context.h"
28 #include "trident_lock.h"
29 #if defined(USE_X86_ASM)
30 #include "x86/common_x86_asm.h"
33 #include "swrast/swrast.h"
34 #include "main/context.h"
35 #include "main/framebuffer.h"
37 #define TRIDENT_DATE "20041223"
39 /* Return the width and height of the current color buffer.
41 static void tridentDDGetBufferSize( GLframebuffer
*framebuffer
,
42 GLuint
*width
, GLuint
*height
)
44 GET_CURRENT_CONTEXT(ctx
);
45 tridentContextPtr tmesa
= TRIDENT_CONTEXT(ctx
);
48 *width
= tmesa
->driDrawable
->w
;
49 *height
= tmesa
->driDrawable
->h
;
50 UNLOCK_HARDWARE(tmesa
);
54 /* Return various strings for glGetString().
56 static const GLubyte
*tridentDDGetString( GLcontext
*ctx
, GLenum name
)
58 static char buffer
[128];
62 return (GLubyte
*)"Alan Hourihane";
65 sprintf( buffer
, "Mesa DRI Trident " TRIDENT_DATE
);
67 /* Append any CPU-specific information.
70 if ( _mesa_x86_cpu_features
) {
71 strncat( buffer
, " x86", 4 );
75 strncat( buffer
, "/MMX", 4 );
79 if ( cpu_has_3dnow
) {
80 strncat( buffer
, "/3DNow!", 7 );
85 strncat( buffer
, "/SSE", 4 );
89 return (GLubyte
*)buffer
;
96 /* Enable the extensions supported by this driver.
98 void tridentDDInitExtensions( GLcontext
*ctx
)
103 /* Initialize the driver's misc functions.
105 void tridentDDInitDriverFuncs( GLcontext
*ctx
)
107 ctx
->Driver
.GetBufferSize
= tridentDDGetBufferSize
;
108 ctx
->Driver
.GetString
= tridentDDGetString
;
109 ctx
->Driver
.Error
= NULL
;