2 * Copyright 2007-2012 Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT license.
8 #ifndef DRIVERINTERFACE_H
9 #define DRIVERINTERFACE_H
12 #include <Accelerant.h>
13 #include <GraphicsDefs.h>
18 // This file contains info that is shared between the kernel driver and the
19 // accelerant, and info that is shared among the source files of the
23 #define ENABLE_DEBUG_TRACE // if defined, turns on debug output to syslog
30 status_t
Init(const char* name
)
33 sem
= create_sem(0, name
);
34 return sem
< 0 ? sem
: B_OK
;
39 if (atomic_add(&count
, 1) > 0)
40 return acquire_sem(sem
);
46 if (atomic_add(&count
, -1) > 1)
47 return release_sem(sem
);
51 void Delete() { delete_sem(sem
); }
57 INTEL_GET_SHARED_DATA
= B_DEVICE_OP_CODES_END
+ 234,
63 struct DisplayModeEx
: display_mode
{
66 uint16 bytesPerRow
; // number of bytes in one line/row
72 uint16 vendorID
; // PCI vendor ID, from pci_info
73 uint16 deviceID
; // PCI device ID, from pci_info
74 uint8 revision
; // PCI device revsion, from pci_info
75 char chipName
[32]; // user recognizable name of chip
77 bool bAccelerantInUse
; // true = accelerant has been initialized
80 area_id regsArea
; // area_id for the memory mapped registers. It
81 // will be cloned into accelerant address space.
82 area_id videoMemArea
; // addr shared with all teams.
83 addr_t videoMemAddr
; // virtual video memory addr
84 phys_addr_t videoMemPCI
; // physical video memory addr
85 uint32 videoMemSize
; // video memory size in bytes (for frame buffer)
87 uint32 maxFrameBufferSize
; // max available video memory for frame buffer
89 // Color spaces supported by current video chip/driver.
90 color_space colorSpaces
[6];
91 uint32 colorSpaceCount
; // number of color spaces in array colorSpaces
93 // List of screen modes.
94 area_id modeArea
; // area containing list of display modes
95 uint32 modeCount
; // number of display modes in the list
97 DisplayModeEx displayMode
; // current display mode configuration
100 bool bHaveEDID
; // true = EDID info from device is in edidInfo
102 Benaphore engineLock
; // serializing access to the acceleration engine
106 #endif // DRIVERINTERFACE_H