Subversion Repositories Kolibri OS

Rev

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