Subversion Repositories Kolibri OS

Rev

Blame | 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.     char   *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 radeon_bo  *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;
  54.     void   *data;
  55.     u32     pitch;
  56. };
  57.  
  58. struct  io_call_14         /*     SRV_RESIZE_SURFACE    */
  59. {
  60.     u32     handle;
  61.     void   *data;
  62.     u32     new_width;
  63.     u32     new_height;
  64.     u32     pitch;
  65. };
  66.  
  67. typedef struct
  68. {
  69.     uint32_t  idx;
  70.     union
  71.     {
  72.         uint32_t opt[2];
  73.         struct {
  74.             uint32_t max_tex_width;
  75.             uint32_t max_tex_height;
  76.         }cap1;
  77.     };
  78. }hwcaps_t;
  79.  
  80. #define HW_BIT_BLIT         (1<<0)      /* BGRX blitter             */
  81. #define HW_TEX_BLIT         (1<<1)      /* stretch blit             */
  82. #define HW_VID_BLIT         (1<<2)      /* planar and packed video  */
  83.                                         /*  3 - 63 reserved         */
  84. struct context
  85. {
  86.     kobj_t   header;
  87.  
  88.     struct radeon_ib ib;
  89.  
  90.     u32       cmd_buffer;
  91.     u32       cmd_offset;
  92.  
  93.     bitmap_t *mask;
  94.     u32       seqno;
  95.     int       slot;
  96.  
  97. };
  98.  
  99. int get_driver_caps(hwcaps_t *caps);
  100. int create_surface(struct drm_device *dev, struct io_call_10 *pbitmap);
  101. int lock_surface(struct io_call_12 *pbitmap);
  102. int resize_surface(struct io_call_14 *pbitmap);
  103.  
  104. struct context *get_context(struct drm_device *dev);
  105.  
  106. int init_bitmaps();
  107.  
  108.