~thopiekar/emgd/libva-1.0.12-github_community

« back to all changes in this revision

Viewing changes to src/x11/va_dricommon.h

  • Committer: Austin Yuan
  • Date: 2010-03-24 02:43:53 UTC
  • mfrom: (0.1.137)
  • Revision ID: git-v1:92e17d62fd6a9249906e284a28926010dc2c1639
Merge branch 'master' of git+ssh://AustinYuan@git.freedesktop.org/git/libva into sync-fdo-master

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#ifndef _VA_DRICOMMON_H_
2
 
#define _VA_DRICOMMON_H_
3
 
 
4
 
#include <X11/Xlib.h>
5
 
 
6
 
#include <xf86drm.h>
7
 
#include <drm.h>
8
 
#include <drm_sarea.h>
9
 
 
10
 
#include "va_backend.h"
11
 
 
12
 
enum
13
 
{
14
 
    VA_NONE = 0,
15
 
    VA_DRI1 = 1,
16
 
    VA_DRI2 = 2
17
 
};
18
 
 
19
 
union dri_buffer 
20
 
{
21
 
    struct {
22
 
        unsigned int attachment;
23
 
        unsigned int name;
24
 
        unsigned int pitch;
25
 
        unsigned int cpp;
26
 
        unsigned int flags;
27
 
    } dri2;
28
 
 
29
 
    struct {
30
 
    } dri1;
31
 
};
32
 
 
33
 
struct dri_drawable 
34
 
{
35
 
    XID x_drawable;
36
 
    int x;
37
 
    int y;
38
 
    unsigned int width;
39
 
    unsigned int height;
40
 
    struct dri_drawable *next;
41
 
};
42
 
 
43
 
#define DRAWABLE_HASH_SZ 32
44
 
struct dri_state 
45
 
{
46
 
    int fd;
47
 
    int driConnectedFlag; /* 0: disconnected, 1: DRI, 2: DRI2 */
48
 
    drm_handle_t hSAREA;
49
 
    drm_context_t hwContext;
50
 
    drmAddress pSAREA;
51
 
    XID hwContextID;
52
 
    struct dri_drawable *drawable_hash[DRAWABLE_HASH_SZ];
53
 
 
54
 
    struct dri_drawable *(*createDrawable)(VADriverContextP ctx, XID x_drawable);
55
 
    void (*destroyDrawable)(VADriverContextP ctx, struct dri_drawable *dri_drawable);
56
 
    void (*swapBuffer)(VADriverContextP ctx, struct dri_drawable *dri_drawable);
57
 
    union dri_buffer *(*getRenderingBuffer)(VADriverContextP ctx, struct dri_drawable *dri_drawable);
58
 
    void (*close)(VADriverContextP ctx);
59
 
};
60
 
 
61
 
Bool isDRI2Connected(VADriverContextP ctx, char **driver_name);
62
 
Bool isDRI1Connected(VADriverContextP ctx, char **driver_name);
63
 
void free_drawable_hashtable(VADriverContextP ctx);
64
 
struct dri_drawable *dri_get_drawable(VADriverContextP ctx, XID drawable);
65
 
void dri_swap_buffer(VADriverContextP ctx, struct dri_drawable *dri_drawable);
66
 
union dri_buffer *dri_get_rendering_buffer(VADriverContextP ctx, struct dri_drawable *dri_drawable);
67
 
 
68
 
#endif /* _VA_DRICOMMON_H_ */