~ubuntu-branches/ubuntu/gutsy/vnc4/gutsy

« back to all changes in this revision

Viewing changes to unix/xc/lib/GL/mesa/src/drv/ffb/ffb_dd.c

  • Committer: Bazaar Package Importer
  • Author(s): Ola Lundqvist
  • Date: 2006-05-15 20:35:17 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20060515203517-l4lre1ku942mn26k
Tags: 4.1.1+X4.3.0-10
* Correction of critical security issue. Thanks to Martin Kogler
  <e9925248@student.tuwien.ac.at> that informed me about the issue,
  and provided the patch.
  This flaw was originally found by Steve Wiseman of intelliadmin.com.
* Applied patch from Javier Kohen <jkohen@users.sourceforge.net> that
  inform the user that only 8 first characters of the password will
  actually be used when typing more than 8 characters, closes:
  #355619.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* $XFree86: xc/lib/GL/mesa/src/drv/ffb/ffb_dd.c,v 1.4 2002/09/11 19:49:07 tsi Exp $
 
2
 *
 
3
 * GLX Hardware Device Driver for Sun Creator/Creator3D
 
4
 * Copyright (C) 2000, 2001 David S. Miller
 
5
 *
 
6
 * Permission is hereby granted, free of charge, to any person obtaining a
 
7
 * copy of this software and associated documentation files (the "Software"),
 
8
 * to deal in the Software without restriction, including without limitation
 
9
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 
10
 * and/or sell copies of the Software, and to permit persons to whom the
 
11
 * Software is furnished to do so, subject to the following conditions:
 
12
 *
 
13
 * The above copyright notice and this permission notice shall be included
 
14
 * in all copies or substantial portions of the Software.
 
15
 *
 
16
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 
17
 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 
18
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
 
19
 * DAVID MILLER, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM,
 
20
 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
 
21
 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
 
22
 * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
23
 *
 
24
 *
 
25
 *    David S. Miller <davem@redhat.com>
 
26
 */
 
27
 
 
28
#include "mtypes.h"
 
29
 
 
30
#include <stdio.h>
 
31
#include <stdlib.h>
 
32
 
 
33
#include "mm.h"
 
34
#include "ffb_dd.h"
 
35
#include "ffb_span.h"
 
36
#include "ffb_depth.h"
 
37
#include "ffb_context.h"
 
38
#include "ffb_vb.h"
 
39
#include "ffb_tris.h"
 
40
#include "ffb_clear.h"
 
41
#include "ffb_lock.h"
 
42
#include "extensions.h"
 
43
 
 
44
#define FFB_DATE        "20010624"
 
45
 
 
46
/* Mesa's Driver Functions */
 
47
 
 
48
static const GLubyte *ffbDDGetString(GLcontext *ctx, GLenum name)
 
49
{
 
50
        ffbContextPtr fmesa = FFB_CONTEXT(ctx);
 
51
        static char buffer[128];
 
52
 
 
53
        switch (name) {
 
54
        case GL_VENDOR:
 
55
                return (GLubyte *) "David S. Miller";
 
56
 
 
57
        case GL_RENDERER:
 
58
                sprintf(buffer, "Mesa DRI FFB " FFB_DATE);
 
59
 
 
60
                if (fmesa->ffb_sarea->flags & FFB_DRI_FFB2)
 
61
                        strncat(buffer, " FFB2", 5);
 
62
                if (fmesa->ffb_sarea->flags & FFB_DRI_FFB2PLUS)
 
63
                        strncat(buffer, " FFB2PLUS", 9);
 
64
                if (fmesa->ffb_sarea->flags & FFB_DRI_PAC1)
 
65
                        strncat(buffer, " PAC1", 5);
 
66
                if (fmesa->ffb_sarea->flags & FFB_DRI_PAC2)
 
67
                        strncat(buffer, " PAC2", 5);
 
68
 
 
69
#ifdef USE_SPARC_ASM
 
70
                strncat(buffer, " Sparc", 6);
 
71
#endif
 
72
 
 
73
                return (GLubyte *) buffer;
 
74
 
 
75
        default:
 
76
                return NULL;
 
77
        };
 
78
}
 
79
 
 
80
 
 
81
static void ffbBufferSize(GLframebuffer *buffer, GLuint *width, GLuint *height)
 
82
{
 
83
        GET_CURRENT_CONTEXT(ctx);
 
84
        ffbContextPtr fmesa = FFB_CONTEXT(ctx);
 
85
 
 
86
        LOCK_HARDWARE(fmesa);
 
87
        *width = fmesa->driDrawable->w;
 
88
        *height = fmesa->driDrawable->h;
 
89
        UNLOCK_HARDWARE(fmesa);
 
90
}
 
91
 
 
92
void ffbDDExtensionsInit(GLcontext *ctx)
 
93
{
 
94
        /* Nothing for now until we start to add
 
95
         * real acceleration. -DaveM
 
96
         */
 
97
 
 
98
        /* XXX Need to turn off GL_EXT_blend_func_separate for one.
 
99
         * XXX Also BlendEquation should be turned off too, what
 
100
         * XXX EXT is that assosciated with?
 
101
         */
 
102
}
 
103
 
 
104
static void ffbDDFinish(GLcontext *ctx)
 
105
{
 
106
        ffbContextPtr fmesa = FFB_CONTEXT(ctx);
 
107
 
 
108
        LOCK_HARDWARE(fmesa);
 
109
        FFBWait(fmesa, fmesa->regs);
 
110
        UNLOCK_HARDWARE(fmesa);
 
111
}
 
112
 
 
113
void ffbDDInitDriverFuncs(GLcontext *ctx)
 
114
{
 
115
        ctx->Driver.GetBufferSize        = ffbBufferSize;
 
116
        ctx->Driver.GetString            = ffbDDGetString;
 
117
        ctx->Driver.Clear                = ffbDDClear;
 
118
 
 
119
        ctx->Driver.Finish               = ffbDDFinish;
 
120
}