Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Copyright 2009-2013, Haiku, Inc. All rights reserved.
- * Distributed under the terms of the MIT License.
- */
- #ifndef _ACCELERANT_H_
- #define _ACCELERANT_H_
- #include <GraphicsDefs.h>
- #include <OS.h>
- #if defined(__cplusplus)
- extern "C" {
- #endif
- typedef struct {
- uint32 version; /* structure version number */
- char name[32]; /* a name the user will recognize */
- /* the device by */
- char chipset[32]; /* the chipset used by the device */
- char serial_no[32]; /* serial number for the device */
- uint32 memory; /* amount of memory on the device, */
- /* in bytes */
- uint32 dac_speed; /* nominal DAC speed, in MHz */
- } accelerant_device_info;
- typedef struct {
- uint32 pixel_clock; /* kHz */
- uint16 h_display; /* in pixels (not character clocks) */
- uint16 h_sync_start;
- uint16 h_sync_end;
- uint16 h_total;
- uint16 v_display; /* in lines */
- uint16 v_sync_start;
- uint16 v_sync_end;
- uint16 v_total;
- uint32 flags; /* sync polarity, etc. */
- } display_timing;
- typedef struct {
- display_timing timing; /* CTRC info */
- uint32 space; /* pixel configuration */
- uint16 virtual_width; /* in pixels */
- uint16 virtual_height; /* in lines */
- uint16 h_display_start; /* first displayed pixel in line */
- uint16 v_display_start; /* first displayed line */
- uint32 flags; /* mode flags (Some drivers use this */
- /* for dual head related options.) */
- } display_mode;
- typedef struct {
- void* frame_buffer; /* pointer to first byte of frame */
- /* buffer in virtual memory */
- void* frame_buffer_dma; /* pointer to first byte of frame */
- /* buffer in physical memory for DMA */
- uint32 bytes_per_row; /* number of bytes in one */
- /* virtual_width line */
- /* not neccesarily the same as */
- /* virtual_width * byte_per_pixel */
- } frame_buffer_config;
- typedef struct {
- uint16 h_res; /* minimum effective change in */
- /* horizontal pixels, usually 8 */
- uint16 h_sync_min; /* min/max horizontal sync pulse */
- /* width in pixels, a multiple of */
- /* h_res */
- uint16 h_sync_max;
- uint16 h_blank_min; /* min/max horizontal blank pulse */
- /* width in pixels, a multiple of */
- /* h_res */
- uint16 h_blank_max;
- uint16 v_res; /* minimum effective change in */
- /* vertical lines, usually 1 */
- uint16 v_sync_min; /* min/max vertical sync pulse */
- /* width in lines, a multiple of */
- /* v_res */
- uint16 v_sync_max;
- uint16 v_blank_min; /* min/max vertical blank pulse */
- /* width in linex, a multiple of */
- /* v_res */
- uint16 v_blank_max;
- } display_timing_constraints;
- // WARNING: This is experimental new Haiku API
- typedef struct {
- uint32 version;
- char vendor[128];
- char name[128];
- char serial_number[128];
- uint32 product_id;
- struct {
- uint16 week;
- uint16 year;
- } produced;
- float width;
- float height;
- uint32 min_horizontal_frequency; /* in kHz */
- uint32 max_horizontal_frequency;
- uint32 min_vertical_frequency; /* in Hz */
- uint32 max_vertical_frequency;
- uint32 max_pixel_clock; /* in kHz */
- } monitor_info;
- /* mode flags */
- enum {
- B_SCROLL = 1 << 0,
- B_8_BIT_DAC = 1 << 1,
- B_HARDWARE_CURSOR = 1 << 2,
- B_PARALLEL_ACCESS = 1 << 3,
- B_DPMS = 1 << 4,
- B_IO_FB_NA = 1 << 5
- };
- /* power saver flags */
- enum {
- B_DPMS_ON = 1 << 0,
- B_DPMS_STAND_BY = 1 << 1,
- B_DPMS_SUSPEND = 1 << 2,
- B_DPMS_OFF = 1 << 3
- };
- /* timing flags */
- enum {
- B_BLANK_PEDESTAL = 1 << 27,
- B_TIMING_INTERLACED = 1 << 28,
- B_POSITIVE_HSYNC = 1 << 29,
- B_POSITIVE_VSYNC = 1 << 30,
- B_SYNC_ON_GREEN = 1 << 31
- };
- typedef struct {
- uint16 src_left; /* guaranteed constrained to */
- /* virtual width and height */
- uint16 src_top;
- uint16 dest_left;
- uint16 dest_top;
- uint16 width; /* 0 to N, where zero means */
- /* one pixel, one means two pixels, */
- /* etc. */
- uint16 height; /* 0 to M, where zero means one */
- /* line, one means two lines, etc. */
- } blit_params;
- typedef struct {
- uint16 src_left; /* guaranteed constrained to */
- /* virtual width and height */
- uint16 src_top;
- uint16 src_width; /* 0 to N, where zero means one */
- /* pixel, one means two pixels, */
- /* etc. */
- uint16 src_height; /* 0 to M, where zero means one */
- /* line, one means two lines, etc. */
- uint16 dest_left;
- uint16 dest_top;
- uint16 dest_width; /* 0 to N, where zero means one */
- /* pixel, one means two pixels, etc. */
- uint16 dest_height; /* 0 to M, where zero means one */
- /* line, one means two lines, etc. */
- } scaled_blit_params;
- typedef struct {
- uint16 left; /* guaranteed constrained to */
- /* virtual width and height */
- uint16 top;
- uint16 right;
- uint16 bottom;
- } fill_rect_params;
- typedef struct {
- uint32 engine_id; /* 0 == no engine, 1,2,3 etc */
- /* individual engines */
- uint32 capability_mask; /* features this engine supports */
- void* opaque; /* optional pointer to engine */
- /* private storage */
- } engine_token;
- enum { /* engine capabilities */
- B_2D_ACCELERATION = 1 << 0,
- B_3D_ACCELERATION = 1 << 1
- };
- typedef struct {
- uint64 counter; /* counts issued primatives */
- uint32 engine_id; /* what engine the counter is for */
- char opaque[12]; /* 12 bytes of private storage */
- } sync_token;
- #if defined(__cplusplus)
- }
- #endif
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement