Subversion Repositories Kolibri OS

Rev

Rev 2351 | Rev 2361 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2351 Rev 2352
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
struct hman
4
struct hman
5
{
5
{
6
    u32  *table;
6
    u32  *table;
7
    u32   next;
7
    u32   next;
8
    u32   avail;
8
    u32   avail;
9
    u32   count;
9
    u32   count;
10
};
10
};
11
 
11
 
12
extern struct hman bm_man;
12
extern struct hman bm_man;
13
 
13
 
14
int init_hman(struct hman *man, u32 count);
14
int init_hman(struct hman *man, u32 count);
15
u32  alloc_handle(struct hman *man);
15
u32  alloc_handle(struct hman *man);
16
int free_handle(struct hman *man, u32 handle);
16
int free_handle(struct hman *man, u32 handle);
17
 
17
 
18
#define hman_get_data(man, handle)                  \
18
#define hman_get_data(man, handle)                  \
19
        ((man)->table[(handle)-1])
19
        ((man)->table[(handle)-1])
20
 
20
 
21
#define hman_set_data(man, handle, val)             \
21
#define hman_set_data(man, handle, val)             \
22
        ((man)->table[(handle)-1]) = (u32)(val)
22
        ((man)->table[(handle)-1]) = (u32)(val)
23
 
23
 
24
 
24
 
25
struct tag_object
25
struct tag_object
26
{
26
{
27
    uint32_t   magic;
27
    uint32_t   magic;
28
    void      *destroy;
28
    void      *destroy;
29
    kobj_t    *fd;
29
    kobj_t    *fd;
30
    kobj_t    *bk;
30
    kobj_t    *bk;
31
    uint32_t   pid;
31
    uint32_t   pid;
32
};
32
};
33
 
33
 
34
typedef struct
34
typedef struct
35
{
35
{
36
    kobj_t   header;
36
    kobj_t   header;
37
 
37
 
38
    u32     handle;
38
    u32     handle;
39
    void    *uaddr;
39
    void    *uaddr;
40
 
40
 
41
    u32     pitch;
41
    u32     pitch;
42
    u32     gaddr;
42
    u32     gaddr;
43
 
43
 
44
    u32     width;
44
    u32     width;
45
    u32     height;
45
    u32     height;
46
    u32     max_width;
46
    u32     max_width;
47
    u32     max_height;
47
    u32     max_height;
48
 
48
 
49
    u32     format;
49
    u32     format;
50
    struct drm_i915_gem_object *obj;
50
    struct drm_i915_gem_object *obj;
51
}bitmap_t;
51
}bitmap_t;
52
 
52
 
53
 
53
 
54
struct  io_call_10         /*     SRV_CREATE_SURFACE    */
54
struct  io_call_10         /*     SRV_CREATE_SURFACE    */
55
{
55
{
56
    u32     handle;       // ignored
56
    u32     handle;       // ignored
57
    void   *data;         // ignored
57
    void   *data;         // ignored
58
 
58
 
59
    u32     width;
59
    u32     width;
60
    u32     height;
60
    u32     height;
61
    u32     pitch;        // ignored
61
    u32     pitch;        // ignored
62
 
62
 
63
    u32     max_width;
63
    u32     max_width;
64
    u32     max_height;
64
    u32     max_height;
65
    u32     format;       // reserved mbz
65
    u32     format;       // reserved mbz
66
};
66
};
67
 
67
 
-
 
68
struct  io_call_12         /*     SRV_LOCK_SURFACE    */
-
 
69
{
-
 
70
    u32     handle;       // ignored
-
 
71
    void   *data;         // ignored
-
 
72
 
-
 
73
    u32     width;
-
 
74
    u32     height;
-
 
75
    u32     pitch;        // ignored
-
 
76
};
-
 
77
 
-
 
78
 
68
typedef struct
79
typedef struct
69
{
80
{
70
    uint32_t  idx;
81
    uint32_t  idx;
71
    union
82
    union
72
    {
83
    {
73
        uint32_t opt[2];
84
        uint32_t opt[2];
74
        struct {
85
        struct {
75
            uint32_t max_tex_width;
86
            uint32_t max_tex_width;
76
            uint32_t max_tex_height;
87
            uint32_t max_tex_height;
77
        }cap1;
88
        }cap1;
78
    };
89
    };
79
}hwcaps_t;
90
}hwcaps_t;
80
 
91
 
81
#define HW_BIT_BLIT         (1<<0)      /* BGRX blitter             */
92
#define HW_BIT_BLIT         (1<<0)      /* BGRX blitter             */
82
#define HW_TEX_BLIT         (1<<1)      /* stretch blit             */
93
#define HW_TEX_BLIT         (1<<1)      /* stretch blit             */
83
#define HW_VID_BLIT         (1<<2)      /* planar and packed video  */
94
#define HW_VID_BLIT         (1<<2)      /* planar and packed video  */
84
                                        /*  3 - 63 reserved         */
95
                                        /*  3 - 63 reserved         */
85
 
96
 
86
int get_driver_caps(hwcaps_t *caps);
97
int get_driver_caps(hwcaps_t *caps);
87
int create_surface(struct io_call_10 *pbitmap);
98
int create_surface(struct io_call_10 *pbitmap);
88
int init_bitmaps();
99
int lock_surface(struct io_call_12 *pbitmap);
-
 
100
 
-
 
101
int init_bitmaps();
89
102