Advertisement
Guest User

Untitled

a guest
Feb 12th, 2013
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 5.61 KB | None | 0 0
  1. /*
  2.  * Copyright 2009-2013, Haiku, Inc. All rights reserved.
  3.  * Distributed under the terms of the MIT License.
  4.  */
  5. #ifndef _ACCELERANT_H_
  6. #define _ACCELERANT_H_
  7.  
  8.  
  9. #include <GraphicsDefs.h>
  10. #include <OS.h>
  11.  
  12.  
  13. #if defined(__cplusplus)
  14.     extern "C" {
  15. #endif
  16.  
  17.  
  18. typedef struct {
  19.     uint32  version;                    /* structure version number */
  20.     char    name[32];                   /* a name the user will recognize */
  21.                                         /* the device by */
  22.     char    chipset[32];                /* the chipset used by the device */
  23.     char    serial_no[32];              /* serial number for the device */
  24.     uint32  memory;                     /* amount of memory on the device, */
  25.                                         /* in bytes */
  26.     uint32  dac_speed;                  /* nominal DAC speed, in MHz */
  27. } accelerant_device_info;
  28.  
  29.  
  30. typedef struct {
  31.     uint32  pixel_clock;                /* kHz */
  32.     uint16  h_display;                  /* in pixels (not character clocks) */
  33.     uint16  h_sync_start;
  34.     uint16  h_sync_end;
  35.     uint16  h_total;
  36.     uint16  v_display;                  /* in lines */
  37.     uint16  v_sync_start;
  38.     uint16  v_sync_end;
  39.     uint16  v_total;
  40.     uint32  flags;                      /* sync polarity, etc. */
  41. } display_timing;
  42.  
  43.  
  44. typedef struct {
  45.     display_timing  timing;             /* CTRC info */
  46.     uint32          space;              /* pixel configuration */
  47.     uint16          virtual_width;      /* in pixels */
  48.     uint16          virtual_height;     /* in lines */
  49.     uint16          h_display_start;    /* first displayed pixel in line */
  50.     uint16          v_display_start;    /* first displayed line */
  51.     uint32          flags;              /* mode flags (Some drivers use this */
  52.                                         /* for dual head related options.) */
  53. } display_mode;
  54.  
  55.  
  56. typedef struct {
  57.     void*   frame_buffer;               /* pointer to first byte of frame */
  58.                                         /* buffer in virtual memory */
  59.  
  60.     void*   frame_buffer_dma;           /* pointer to first byte of frame */
  61.                                         /* buffer in physical memory for DMA */
  62.  
  63.     uint32  bytes_per_row;              /* number of bytes in one */
  64.                                         /* virtual_width line */
  65.                                         /* not neccesarily the same as */
  66.                                         /* virtual_width * byte_per_pixel */
  67. } frame_buffer_config;
  68.  
  69.  
  70. typedef struct {
  71.     uint16  h_res;                      /* minimum effective change in */
  72.                                         /* horizontal pixels, usually 8 */
  73.  
  74.     uint16  h_sync_min;                 /* min/max horizontal sync pulse */
  75.                                         /* width in pixels, a multiple of */
  76.                                         /* h_res */
  77.     uint16  h_sync_max;
  78.     uint16  h_blank_min;                /* min/max horizontal blank pulse */
  79.                                         /* width in pixels, a multiple of */
  80.                                         /* h_res */
  81.     uint16  h_blank_max;
  82.     uint16  v_res;                      /* minimum effective change in */
  83.                                         /* vertical lines, usually 1 */
  84.  
  85.     uint16  v_sync_min;                 /* min/max vertical sync pulse */
  86.                                         /* width in lines, a multiple of */
  87.                                         /* v_res */
  88.     uint16  v_sync_max;
  89.     uint16  v_blank_min;                /* min/max vertical blank pulse */
  90.                                         /* width in linex, a multiple of */
  91.                                         /* v_res */
  92.     uint16  v_blank_max;
  93. } display_timing_constraints;
  94.  
  95.  
  96. // WARNING: This is experimental new Haiku API
  97. typedef struct {
  98.     uint32  version;
  99.     char    vendor[128];
  100.     char    name[128];
  101.     char    serial_number[128];
  102.     uint32  product_id;
  103.     struct {
  104.         uint16  week;
  105.         uint16  year;
  106.     }       produced;
  107.     float   width;
  108.     float   height;
  109.     uint32  min_horizontal_frequency;   /* in kHz */
  110.     uint32  max_horizontal_frequency;
  111.     uint32  min_vertical_frequency;     /* in Hz */
  112.     uint32  max_vertical_frequency;
  113.     uint32  max_pixel_clock;            /* in kHz */
  114. } monitor_info;
  115.  
  116.  
  117. /* mode flags */
  118. enum {
  119.     B_SCROLL            = 1 << 0,
  120.     B_8_BIT_DAC         = 1 << 1,
  121.     B_HARDWARE_CURSOR   = 1 << 2,
  122.     B_PARALLEL_ACCESS   = 1 << 3,
  123.     B_DPMS              = 1 << 4,
  124.     B_IO_FB_NA          = 1 << 5
  125. };
  126.  
  127.  
  128. /* power saver flags */
  129. enum {
  130.     B_DPMS_ON           = 1 << 0,
  131.     B_DPMS_STAND_BY     = 1 << 1,
  132.     B_DPMS_SUSPEND      = 1 << 2,
  133.     B_DPMS_OFF          = 1 << 3
  134. };
  135.  
  136.  
  137. /* timing flags */
  138. enum {
  139.     B_BLANK_PEDESTAL    = 1 << 27,
  140.     B_TIMING_INTERLACED = 1 << 28,
  141.     B_POSITIVE_HSYNC    = 1 << 29,
  142.     B_POSITIVE_VSYNC    = 1 << 30,
  143.     B_SYNC_ON_GREEN     = 1 << 31
  144. };
  145.  
  146.  
  147. typedef struct {
  148.     uint16  src_left;                   /* guaranteed constrained to */
  149.                                         /* virtual width and height */
  150.     uint16  src_top;
  151.     uint16  dest_left;
  152.     uint16  dest_top;
  153.     uint16  width;                      /* 0 to N, where zero means */
  154.                                         /* one pixel, one means two pixels, */
  155.                                         /* etc. */
  156.     uint16  height;                     /* 0 to M, where zero means one */
  157.                                         /* line, one means two lines, etc. */
  158. } blit_params;
  159.  
  160.  
  161. typedef struct {
  162.     uint16  src_left;                   /* guaranteed constrained to */
  163.                                         /* virtual width and height */
  164.     uint16  src_top;
  165.     uint16  src_width;                  /* 0 to N, where zero means one */
  166.                                         /* pixel, one means two pixels, */
  167.                                         /* etc. */
  168.     uint16  src_height;                 /* 0 to M, where zero means one */
  169.                                         /* line, one means two lines, etc. */
  170.     uint16  dest_left;
  171.     uint16  dest_top;
  172.     uint16  dest_width;                 /* 0 to N, where zero means one */
  173.                                         /* pixel, one means two pixels, etc. */
  174.     uint16  dest_height;                /* 0 to M, where zero means one */
  175.                                         /* line, one means two lines, etc. */
  176. } scaled_blit_params;
  177.  
  178.  
  179. typedef struct {
  180.     uint16  left;                       /* guaranteed constrained to */
  181.                                         /* virtual width and height */
  182.     uint16  top;
  183.     uint16  right;
  184.     uint16  bottom;
  185. } fill_rect_params;
  186.  
  187.  
  188. typedef struct {
  189.     uint32  engine_id;                  /* 0 == no engine, 1,2,3 etc */
  190.                                         /* individual engines */
  191.     uint32  capability_mask;            /* features this engine supports */
  192.     void*   opaque;                     /* optional pointer to engine */
  193.                                         /* private storage */
  194. } engine_token;
  195.  
  196.  
  197. enum {  /* engine capabilities */
  198.     B_2D_ACCELERATION = 1 << 0,
  199.     B_3D_ACCELERATION = 1 << 1
  200. };
  201.  
  202.  
  203. typedef struct {
  204.     uint64  counter;                    /* counts issued primatives */
  205.     uint32  engine_id;                  /* what engine the counter is for */
  206.     char    opaque[12];                 /* 12 bytes of private storage */
  207. } sync_token;
  208.  
  209.  
  210. #if defined(__cplusplus)
  211. }
  212. #endif
  213.  
  214. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement