Make UEFI boot-platform build again
[haiku.git] / headers / private / graphics / intel_810 / DriverInterface.h
blob0a77871e5b867657fe0c764b0030c0c9ce51e761
1 /*
2 * Copyright 2007-2012 Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT license.
5 * Authors:
6 * Gerald Zajac
7 */
8 #ifndef DRIVERINTERFACE_H
9 #define DRIVERINTERFACE_H
12 #include <Accelerant.h>
13 #include <GraphicsDefs.h>
14 #include <Drivers.h>
15 #include <edid.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
20 // accelerant.
23 #define ENABLE_DEBUG_TRACE // if defined, turns on debug output to syslog
26 struct Benaphore {
27 sem_id sem;
28 int32 count;
30 status_t Init(const char* name)
32 count = 0;
33 sem = create_sem(0, name);
34 return sem < 0 ? sem : B_OK;
37 status_t Acquire()
39 if (atomic_add(&count, 1) > 0)
40 return acquire_sem(sem);
41 return B_OK;
44 status_t Release()
46 if (atomic_add(&count, -1) > 1)
47 return release_sem(sem);
48 return B_OK;
51 void Delete() { delete_sem(sem); }
56 enum {
57 INTEL_GET_SHARED_DATA = B_DEVICE_OP_CODES_END + 234,
58 INTEL_DEVICE_NAME,
59 INTEL_GET_EDID,
63 struct DisplayModeEx : display_mode {
64 uint8 bitsPerPixel;
65 uint8 bytesPerPixel;
66 uint16 bytesPerRow; // number of bytes in one line/row
70 struct SharedInfo {
71 // Device ID info.
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
79 // Memory mappings.
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
99 edid1_info edidInfo;
100 bool bHaveEDID; // true = EDID info from device is in edidInfo
102 Benaphore engineLock; // serializing access to the acceleration engine
106 #endif // DRIVERINTERFACE_H