~ubuntu-branches/ubuntu/intrepid/xserver-xgl/intrepid

« back to all changes in this revision

Viewing changes to hw/kdrive/neomagic/backend.h

  • Committer: Bazaar Package Importer
  • Author(s): Matthew Garrett
  • Date: 2006-02-13 14:21:43 UTC
  • Revision ID: james.westby@ubuntu.com-20060213142143-mad6z9xzem7hzxz9
Tags: upstream-7.0.0
ImportĀ upstreamĀ versionĀ 7.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Generic card driving functions.
 
3
 * Essentially, cascades calls to fbdev and vesa to initialize cards that
 
4
 * do not have hardware-specific routines yet. Copied from the ati driver.
 
5
 *
 
6
 * Copyright (c) 2004 Brent Cook <busterb@mail.utexas.edu>
 
7
 *
 
8
 * This code is licensed under the GPL.  See the file COPYING in the root
 
9
 * directory of the sources for details.
 
10
 */
 
11
 
 
12
#ifndef _BACKEND_H_
 
13
#define _BACKEND_H_
 
14
#include "kdrive.h"
 
15
 
 
16
#ifdef KDRIVEFBDEV
 
17
#include <fbdev.h>
 
18
#endif
 
19
#ifdef KDRIVEVESA
 
20
#include <vesa.h>
 
21
#endif
 
22
 
 
23
typedef enum _BackendType {VESA, FBDEV} BackendType;
 
24
 
 
25
typedef struct _BackendInfo {
 
26
    // backend info
 
27
    BackendType type;
 
28
 
 
29
    // backend internal structures
 
30
    union {
 
31
#ifdef KDRIVEFBDEV
 
32
        FbdevPriv fbdev;
 
33
#endif
 
34
#ifdef KDRIVEVESA
 
35
        VesaCardPrivRec vesa;
 
36
#endif
 
37
    } priv;
 
38
 
 
39
    // pointers to helper functions for this backend
 
40
    void (*cardfini)(KdCardInfo *);
 
41
    void (*scrfini)(KdScreenInfo *);
 
42
    Bool (*initScreen)(ScreenPtr);
 
43
    Bool (*finishInitScreen)(ScreenPtr pScreen);
 
44
    Bool (*createRes)(ScreenPtr);
 
45
    void (*preserve)(KdCardInfo *);
 
46
    void (*restore)(KdCardInfo *);
 
47
    Bool (*dpms)(ScreenPtr, int);
 
48
    Bool (*enable)(ScreenPtr);
 
49
    void (*disable)(ScreenPtr);
 
50
    void (*getColors)(ScreenPtr, int, int, xColorItem *);
 
51
    void (*putColors)(ScreenPtr, int, int, xColorItem *);
 
52
} BackendInfo;
 
53
 
 
54
typedef union _BackendScreen {
 
55
#ifdef KDRIVEFBDEV
 
56
    FbdevScrPriv fbdev;
 
57
#endif
 
58
#ifdef KDRIVEVESA
 
59
    VesaScreenPrivRec vesa;
 
60
#endif
 
61
} BackendScreen;
 
62
 
 
63
Bool
 
64
backendInitialize(KdCardInfo *card, BackendInfo *backend);
 
65
 
 
66
Bool
 
67
backendScreenInitialize(KdScreenInfo *screen, BackendScreen *backendScreen,
 
68
                        BackendInfo *backendCard);
 
69
 
 
70
#endif