Subversion Repositories Kolibri OS

Rev

Rev 2352 | Rev 3033 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

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