Subversion Repositories Kolibri OS

Rev

Rev 3033 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3033 Rev 3039
1
typedef struct tag_object  kobj_t;
1
typedef struct tag_object  kobj_t;
2
typedef struct tag_display display_t;
2
typedef struct tag_display display_t;
3
 
3
 
4
 
4
 
5
struct tag_object
5
struct tag_object
6
{
6
{
7
    uint32_t   magic;
7
    uint32_t   magic;
8
    void      *destroy;
8
    void      *destroy;
9
    kobj_t    *fd;
9
    kobj_t    *fd;
10
    kobj_t    *bk;
10
    kobj_t    *bk;
11
    uint32_t   pid;
11
    uint32_t   pid;
12
};
12
};
13
 
13
 
14
typedef struct
14
typedef struct
15
{
15
{
16
    kobj_t   header;
16
    kobj_t   header;
17
 
17
 
18
    u32     handle;
18
    u32     handle;
19
    void    *uaddr;
19
    char   *uaddr;
20
 
20
 
21
    u32     pitch;
21
    u32     pitch;
22
    u32     gaddr;
22
    u32     gaddr;
23
 
23
 
24
    u32     width;
24
    u32     width;
25
    u32     height;
25
    u32     height;
26
    u32     max_width;
26
    u32     max_width;
27
    u32     max_height;
27
    u32     max_height;
28
    u32     page_count;
28
    u32     page_count;
29
    u32     max_count;
29
    u32     max_count;
30
 
30
 
31
    u32     format;
31
    u32     format;
32
    struct drm_i915_gem_object *obj;
32
    struct drm_i915_gem_object *obj;
33
}bitmap_t;
33
}bitmap_t;
34
 
34
 
35
 
35
 
36
struct  io_call_10         /*     SRV_CREATE_SURFACE    */
36
struct  io_call_10         /*     SRV_CREATE_SURFACE    */
37
{
37
{
38
    u32     handle;       // ignored
38
    u32     handle;       // ignored
39
    void   *data;         // ignored
39
    void   *data;         // ignored
40
 
40
 
41
    u32     width;
41
    u32     width;
42
    u32     height;
42
    u32     height;
43
    u32     pitch;        // ignored
43
    u32     pitch;        // ignored
44
 
44
 
45
    u32     max_width;
45
    u32     max_width;
46
    u32     max_height;
46
    u32     max_height;
47
    u32     format;       // reserved mbz
47
    u32     format;       // reserved mbz
48
};
48
};
49
 
49
 
50
struct  io_call_12         /*     SRV_LOCK_SURFACE    */
50
struct  io_call_12         /*     SRV_LOCK_SURFACE    */
51
{
51
{
52
    u32     handle;       // ignored
52
    u32     handle;
53
    void   *data;         // ignored
53
    void   *data;
54
 
-
 
55
    u32     width;
-
 
56
    u32     height;
54
    u32     pitch;
57
    u32     pitch;        // ignored
55
};
58
};
-
 
59
 
56
 
-
 
57
struct  io_call_14         /*     SRV_RESIZE_SURFACE    */
-
 
58
{
-
 
59
    u32     handle;
-
 
60
    void   *data;
-
 
61
    u32     new_width;
-
 
62
    u32     new_height;
-
 
63
    u32     pitch;
-
 
64
};
60
 
65
 
61
typedef struct
66
typedef struct
62
{
67
{
63
    uint32_t  idx;
68
    uint32_t  idx;
64
    union
69
    union
65
    {
70
    {
66
        uint32_t opt[2];
71
        uint32_t opt[2];
67
        struct {
72
        struct {
68
            uint32_t max_tex_width;
73
            uint32_t max_tex_width;
69
            uint32_t max_tex_height;
74
            uint32_t max_tex_height;
70
        }cap1;
75
        }cap1;
71
    };
76
    };
72
}hwcaps_t;
77
}hwcaps_t;
73
 
78
 
74
#define HW_BIT_BLIT         (1<<0)      /* BGRX blitter             */
79
#define HW_BIT_BLIT         (1<<0)      /* BGRX blitter             */
75
#define HW_TEX_BLIT         (1<<1)      /* stretch blit             */
80
#define HW_TEX_BLIT         (1<<1)      /* stretch blit             */
76
#define HW_VID_BLIT         (1<<2)      /* planar and packed video  */
81
#define HW_VID_BLIT         (1<<2)      /* planar and packed video  */
77
                                        /*  3 - 63 reserved         */
82
                                        /*  3 - 63 reserved         */
78
struct context
83
struct context
79
{
84
{
80
    kobj_t   header;
85
    kobj_t   header;
81
 
86
 
82
    struct drm_i915_gem_object *obj;
87
    struct drm_i915_gem_object *obj;
83
    u32       cmd_buffer;
88
    u32       cmd_buffer;
84
    u32       cmd_offset;
89
    u32       cmd_offset;
85
 
90
 
86
    bitmap_t *mask;
91
    bitmap_t *mask;
87
    u32       seqno;
92
    u32       seqno;
88
    int       slot;
93
    int       slot;
89
 
94
 
90
};
95
};
91
 
96
 
92
int get_driver_caps(hwcaps_t *caps);
97
int get_driver_caps(hwcaps_t *caps);
93
int create_surface(struct drm_device *dev, struct io_call_10 *pbitmap);
98
int create_surface(struct drm_device *dev, struct io_call_10 *pbitmap);
94
int lock_surface(struct io_call_12 *pbitmap);
99
int lock_surface(struct io_call_12 *pbitmap);
95
 
100
int resize_surface(struct io_call_14 *pbitmap);
-
 
101
 
96
struct context *get_context(struct drm_device *dev);
102
struct context *get_context(struct drm_device *dev);
97
 
103
 
98
int init_bitmaps();
104
int init_bitmaps();