The Pedigree Project  0.1
VbeDisplay.cc
1 /*
2  * Copyright (c) 2008-2014, Pedigree Developers
3  *
4  * Please see the CONTRIB file in the root of the source tree for a full
5  * list of contributors.
6  *
7  * Permission to use, copy, modify, and distribute this software for any
8  * purpose with or without fee is hereby granted, provided that the above
9  * copyright notice and this permission notice appear in all copies.
10  *
11  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 #include "VbeDisplay.h"
21 #include "modules/system/config/Config.h"
22 #include "pedigree/kernel/Log.h"
23 #include "pedigree/kernel/graphics/Graphics.h"
24 #include "pedigree/kernel/machine/Framebuffer.h"
25 #include "pedigree/kernel/machine/Machine.h"
26 #include "pedigree/kernel/machine/Vga.h"
27 #include "pedigree/kernel/machine/x86_common/Bios.h"
28 #include "pedigree/kernel/processor/MemoryMappedIo.h"
29 #include "pedigree/kernel/processor/PhysicalMemoryManager.h"
30 #include "pedigree/kernel/processor/VirtualAddressSpace.h"
31 #include "pedigree/kernel/utilities/Iterator.h"
32 #include "pedigree/kernel/utilities/String.h"
33 #include "pedigree/kernel/utilities/Vector.h"
34 #include "pedigree/kernel/utilities/utility.h"
35 
37 static Display::ScreenMode g_ScreenMode;
38 static Display *g_pDisplay = 0;
39 static uintptr_t g_Framebuffer;
40 static size_t g_FbSize;
41 
42 VbeDisplay::VbeDisplay()
43  : m_VbeVersion(), m_ModeList(), m_Mode(), m_pFramebuffer(), m_Buffers(),
44  m_SpecialisedMode(Mode_Generic), m_Allocator()
45 {
46 }
47 
48 VbeDisplay::VbeDisplay(
49  Device *p, VbeVersion version, List<Display::ScreenMode *> &sms,
50  size_t vidMemSz, size_t displayNum)
51  : Display(p), m_VbeVersion(version), m_ModeList(sms), m_Mode(),
52  m_pFramebuffer(0), m_Buffers(), m_SpecialisedMode(Mode_Generic),
53  m_Allocator()
54 {
55  String str;
56  str.Format("DELETE FROM 'display_modes' where display_id = %d", displayNum);
57  Config::Result *pR = Config::instance().query(str);
58  if (!pR)
59  {
60  FATAL("VBE: Couldn't get a result.");
61  return;
62  }
63  if (!pR->succeeded())
64  {
65  FATAL("VbeDisplay: Sql error: " << pR->errorMessage());
66  return;
67  }
68  delete pR;
69 
70  uintptr_t fbAddr = 0;
71 
72  for (List<Display::ScreenMode *>::Iterator it = m_ModeList.begin();
73  it != m_ModeList.end(); it++)
74  {
75  str.Format(
76  "INSERT INTO 'display_modes' VALUES (NULL, %d,%d,%d,%d,%d,%d)",
77  (*it)->id, displayNum, (*it)->width, (*it)->height, (*it)->pf.nBpp,
78  (*it)->refresh);
79  pR = Config::instance().query(str);
80 
81  if (!pR->succeeded())
82  {
83  FATAL("VbeDisplay: Sql error: " << pR->errorMessage());
84  return;
85  }
86 
87  fbAddr = (*it)->framebuffer;
88 
89  delete pR;
90  }
91 
92  m_Allocator.free(0, vidMemSz);
93 
94  // Assumes the same framebuffer for all modes
95  bool bFramebufferFound = false;
97  it != m_Addresses.end(); it++)
98  {
99  uintptr_t address = (*it)->m_Address;
100  size_t size = (*it)->m_Size;
101  if (address <= fbAddr && (address + size) > fbAddr)
102  {
103  m_pFramebuffer = static_cast<MemoryMappedIo *>((*it)->m_Io);
104  m_pFramebufferRawAddress = (*it);
105  bFramebufferFound = true;
106  break;
107  }
108  }
109 
110  if (!bFramebufferFound)
111  ERROR("No PCI MMIO region found for the desired video mode.");
112 }
113 
114 VbeDisplay::~VbeDisplay()
115 {
116 }
117 
119 {
120  return m_pFramebuffer->virtualAddress();
121 }
122 
124 {
125  pPf = m_Mode.pf;
126  return true;
127 }
128 
130 {
131  sm = m_Mode;
132  return true;
133 }
134 
136 {
137  sms = m_ModeList;
138  return true;
139 }
140 
141 bool VbeDisplay::setScreenMode(size_t modeId)
142 {
143  Display::ScreenMode *pSm = 0;
144 
145  for (List<Display::ScreenMode *>::Iterator it = m_ModeList.begin();
146  it != m_ModeList.end(); it++)
147  {
148  if ((*it)->id == modeId)
149  {
150  pSm = *it;
151  break;
152  }
153  }
154  if (pSm == 0)
155  {
156  ERROR("Screenmode not found: " << modeId);
157  return false;
158  }
159 
160  return setScreenMode(*pSm);
161 }
162 
164 {
165  m_Mode = sm;
166 
167  if (m_Mode.pf.nBpp == 16 && m_Mode.pf.pRed == 11 && m_Mode.pf.mRed == 5 &&
168  m_Mode.pf.pGreen == 5 && m_Mode.pf.mGreen == 6 &&
169  m_Mode.pf.pBlue == 0 && m_Mode.pf.mBlue == 5)
170  {
171  m_Mode.pf2 = Graphics::Bits16_Rgb565;
172  m_SpecialisedMode = Mode_16bpp_5r6g5b;
173  }
174  else if (
175  m_Mode.pf.nBpp == 16 && m_Mode.pf.pRed == 10 && m_Mode.pf.mRed == 5 &&
176  m_Mode.pf.pGreen == 5 && m_Mode.pf.mGreen == 5 &&
177  m_Mode.pf.pBlue == 0 && m_Mode.pf.mBlue == 5)
178  {
179  m_Mode.pf2 = Graphics::Bits16_Rgb555;
180  }
181  else if (m_Mode.pf.nBpp == 24 && m_Mode.pf.pBlue == 0)
182  {
183  m_Mode.pf2 = Graphics::Bits24_Rgb;
184  m_SpecialisedMode = Mode_24bpp_8r8g8b;
185  }
186  else if (m_Mode.pf.nBpp == 24 && m_Mode.pf.pBlue > 0)
187  {
189  m_Mode.pf2 = Graphics::Bits24_Bgr;
190  }
191  else if (m_Mode.pf.nBpp == 32)
192  {
193  m_Mode.pf2 = Graphics::Bits32_Argb;
194  }
195  else
196  {
197  m_Mode.pf2 = Graphics::Bits16_Argb;
198  m_SpecialisedMode = Mode_Generic;
199  }
200 
201  m_Mode.bytesPerPixel = bytesPerPixel(m_Mode.pf2);
202  m_Mode.bytesPerLine = m_Mode.bytesPerPixel * m_Mode.width;
203 
204  // Invalidate all current buffers.
205  for (Tree<rgb_t *, Buffer *>::Iterator it = m_Buffers.begin();
206  it != m_Buffers.end(); it++)
207  {
208  Buffer *pBuf = it.value();
209  pBuf->valid = false;
210  }
211 
212  // SET SuperVGA VIDEO MODE - AX=4F02h, BX=new mode
213  Bios::instance().setAx(0x4F02);
214  Bios::instance().setBx(m_Mode.id | (1 << 14));
215  Bios::instance().setEs(0x0000);
216  Bios::instance().setDi(0x0000);
218 
219  // Check the signature.
220  if (Bios::instance().getAx() != 0x004F)
221  {
222  ERROR("VBE: Set mode failed! (mode " << Hex << m_Mode.id << ")");
223  return false;
224  }
225  NOTICE("VBE: Set mode " << m_Mode.id);
226 
227  // Tell the Machine instance what VBE mode we're in, so it can set it again
228  // if we enter the debugger and return.
229  Machine::instance().getVga(0)->setMode(m_Mode.id);
230 
231  m_pLogicalFramebuffer->setWidth(m_Mode.width);
232  m_pLogicalFramebuffer->setHeight(m_Mode.height);
233  m_pLogicalFramebuffer->setBytesPerPixel(m_Mode.bytesPerPixel);
234  m_pLogicalFramebuffer->setBytesPerLine(m_Mode.bytesPerLine);
235  m_pLogicalFramebuffer->setFormat(m_Mode.pf2);
236  m_pLogicalFramebuffer->setXPos(0);
237  m_pLogicalFramebuffer->setYPos(0);
238  m_pLogicalFramebuffer->setParent(0);
239 
240  m_pFramebufferRawAddress->map(
241  (m_Mode.height * m_Mode.bytesPerLine) + m_Mode.width, true, true);
242  m_pLogicalFramebuffer->setFramebuffer(
243  reinterpret_cast<uintptr_t>(m_pFramebuffer->virtualAddress()));
244 
245  g_pDisplay = this;
246  g_ScreenMode = m_Mode;
247  g_Framebuffer =
248  reinterpret_cast<uintptr_t>(m_pFramebuffer->virtualAddress());
249  g_FbSize = m_pFramebuffer->size();
250 
251  return true;
252 }
253 
255 {
256  Buffer *pBuffer = new Buffer();
257 
258  size_t pgmask = PhysicalMemoryManager::getPageSize() - 1;
259  size_t sz = m_Mode.width * m_Mode.height * sizeof(rgb_t);
260 
261  if (sz & pgmask)
263  sz &= ~pgmask;
264 
265  if (!PhysicalMemoryManager::instance().allocateRegion(
266  pBuffer->mr, sz / PhysicalMemoryManager::getPageSize(), 0,
268  {
269  ERROR("VbeDisplay::newBuffer: allocateRegion failed!");
270  }
271 
272  pBuffer->pBackbuffer =
273  reinterpret_cast<rgb_t *>(pBuffer->mr.virtualAddress());
274 
275  sz = m_Mode.width * m_Mode.height * (m_Mode.pf.nBpp / 8);
276  if (sz & pgmask)
278  sz &= ~pgmask;
279 
280  if (!PhysicalMemoryManager::instance().allocateRegion(
281  pBuffer->fbmr, sz / PhysicalMemoryManager::getPageSize(), 0,
283  {
284  ERROR("VbeDisplay::newBuffer: allocateRegion failed! (1)");
285  }
286 
287  pBuffer->pFbBackbuffer =
288  reinterpret_cast<uint8_t *>(pBuffer->fbmr.virtualAddress());
289 
290  m_Buffers.insert(pBuffer->pBackbuffer, pBuffer);
291 
292  return pBuffer->pBackbuffer;
293 }
294 
295 void VbeDisplay::setCurrentBuffer(rgb_t *pBuffer)
296 {
297  Buffer *pBuf = m_Buffers.lookup(pBuffer);
298  if (!pBuf || !pBuf->valid)
299  {
300  ERROR(
301  "VbeDisplay: Bad buffer:" << reinterpret_cast<uintptr_t>(pBuffer));
302  return;
303  }
304 
305  MemoryCopy(
306  getFramebuffer(), pBuf->pFbBackbuffer,
307  m_Mode.width * m_Mode.height * (m_Mode.pf.nBpp / 8));
308 }
309 
310 void VbeDisplay::updateBuffer(
311  rgb_t *pBuffer, size_t x1, size_t y1, size_t x2, size_t y2)
312 {
313  Buffer *pBuf = m_Buffers.lookup(pBuffer);
314  if (!pBuf || !pBuf->valid)
315  {
316  ERROR(
317  "VbeDisplay: updateBuffer: Bad buffer:"
318  << reinterpret_cast<uintptr_t>(pBuffer));
319  return;
320  }
321 
322  if (x1 == ~0UL)
323  x1 = 0;
324  if (x2 == ~0UL || x2 >= m_Mode.width)
325  x2 = m_Mode.width - 1;
326  if (y1 == ~0UL)
327  y1 = 0;
328  if (y2 == ~0UL || y2 >= m_Mode.height)
329  y2 = m_Mode.height - 1;
330 
331  if (m_SpecialisedMode == Mode_16bpp_5r6g5b)
332  {
333  unsigned int x, y;
334 
335  unsigned int pitch = m_Mode.width;
336 
337  for (y = y1; y <= y2; y++)
338  {
339  for (x = x1; x < x2; x++)
340  {
341  rgb_t *pRgb = pBuffer + pitch * y + x;
342  unsigned short r = (pRgb->r >> 3);
343  unsigned short g = (pRgb->g >> 2);
344  unsigned short b = (pRgb->b >> 3);
345  unsigned short a = (r << 11) | (g << 5) | b;
346  reinterpret_cast<uint16_t *>(
347  pBuf->pFbBackbuffer)[pitch * y + x] = a;
348  reinterpret_cast<uint16_t *>(getFramebuffer())[pitch * y + x] =
349  a;
350  }
351  }
352 
353  return;
354  }
355 
356  if (m_SpecialisedMode == Mode_24bpp_8r8g8b)
357  {
358  unsigned int x, y, i;
359 
360  uint8_t *pFb = reinterpret_cast<uint8_t *>(getFramebuffer());
361  uint8_t *pFb2 = pBuf->pFbBackbuffer;
362 
363  for (y = y1; y <= y2; y++)
364  {
365  for (x = x1; x < x2; x++)
366  {
367  rgb_t *pRgb = pBuffer + m_Mode.width * y + x;
368  i = (y * m_Mode.width + x) * 3;
369  pFb[i + 0] = pRgb->b;
370  pFb[i + 1] = pRgb->g;
371  pFb[i + 2] = pRgb->r;
372  pFb2[i + 0] = pRgb->b;
373  pFb2[i + 1] = pRgb->g;
374  pFb2[i + 2] = pRgb->r;
375  }
376  }
377 
378  return;
379  }
380 
381  size_t bytesPerPixel = m_Mode.pf.nBpp / 8;
382 
383  // Unoptimised version for arbitrary pixel formats.
384  for (size_t y = y1; y <= y2; y++)
385  {
386  for (size_t x = x1; x <= x2; x++)
387  {
388  size_t i = y * m_Mode.width + x;
389  packColour(
390  pBuffer[i], i,
391  reinterpret_cast<uintptr_t>(pBuf->pFbBackbuffer));
392  }
393 
394  MemoryCopy(
395  reinterpret_cast<uint8_t *>(getFramebuffer()) +
396  y * m_Mode.pf.nPitch + x1 * bytesPerPixel,
397  pBuf->pFbBackbuffer + y * m_Mode.pf.nPitch + x1 * bytesPerPixel,
398  (x2 - x1) * bytesPerPixel);
399  }
400 }
401 
402 void VbeDisplay::killBuffer(rgb_t *pBuffer)
403 {
404  Buffer *pBuf = m_Buffers.lookup(pBuffer);
405  if (!pBuf)
406  {
407  ERROR(
408  "VbeDisplay: killBuffer: Bad buffer:"
409  << reinterpret_cast<uintptr_t>(pBuffer));
410  return;
411  }
412  pBuf->mr.free();
413  pBuf->fbmr.free();
414 
415  delete pBuf;
416 
417  m_Buffers.remove(pBuffer);
418 }
419 
420 void VbeDisplay::bitBlit(
421  rgb_t *pBuffer, size_t fromX, size_t fromY, size_t toX, size_t toY,
422  size_t width, size_t height)
423 {
424  Buffer *pBuf = m_Buffers.lookup(pBuffer);
425  if (!pBuf || !pBuf->valid)
426  {
427  ERROR(
428  "VbeDisplay: bitBlit: Bad buffer:"
429  << reinterpret_cast<uintptr_t>(pBuffer));
430  return;
431  }
432 
433  size_t bytesPerPixel = m_Mode.pf.nBpp / 8;
434 
435  uint8_t *pFb = pBuf->pFbBackbuffer;
436 
437  // Just like MemoryCopy(), if the dest < src, copy forwards, else copy
438  // backwards.
439  size_t min = 0;
440  size_t max = height;
441  ssize_t increment = 1;
442  if (fromY < toY)
443  {
444  min = height;
445  max = 0;
446  increment = -1;
447  }
448 
449  if (toX == 0 && fromX == 0 && width == m_Mode.width)
450  {
451  size_t to = toY * m_Mode.width;
452  size_t from = fromY * m_Mode.width;
453  size_t sz = width * height;
454  size_t extent_s, extent_e;
455  if (from > to)
456  {
457  extent_s = to;
458  extent_e = from + sz - extent_s;
459  }
460  else
461  {
462  extent_s = from;
463  extent_e = to + sz - extent_s;
464  }
465 
466  MemoryCopy(&pBuffer[to], &pBuffer[from], sz * sizeof(rgb_t));
467  MemoryCopy(
468  &pFb[to * bytesPerPixel], &pFb[from * bytesPerPixel],
469  sz * bytesPerPixel);
470  MemoryCopy(
471  reinterpret_cast<uint8_t *>(getFramebuffer()) +
472  extent_s * bytesPerPixel,
473  pBuf->pFbBackbuffer + extent_s * bytesPerPixel,
474  extent_e * bytesPerPixel);
475  }
476  else
477  {
478  // Unoptimised bitblit. This could definately be made better.
479  for (size_t y = min; y < max; y += increment)
480  {
481  size_t to = (y + toY) * m_Mode.width + toX;
482  size_t from = (y + fromY) * m_Mode.width + fromX;
483  MemoryCopy(&pBuffer[to], &pBuffer[from], width * sizeof(rgb_t));
484  MemoryCopy(
485  &pFb[to * bytesPerPixel], &pFb[from * bytesPerPixel],
486  width * bytesPerPixel);
487  MemoryCopy(
488  reinterpret_cast<uint8_t *>(getFramebuffer()) +
489  to * bytesPerPixel,
490  pBuf->pFbBackbuffer + to * bytesPerPixel,
491  width * bytesPerPixel);
492  }
493  }
494 }
495 
497  rgb_t *pBuffer, size_t x, size_t y, size_t width, size_t height,
498  rgb_t colour)
499 {
500  Buffer *pBuf = m_Buffers.lookup(pBuffer);
501  if (!pBuf || !pBuf->valid)
502  {
503  ERROR(
504  "VbeDisplay: fillRect: Bad buffer:"
505  << reinterpret_cast<uintptr_t>(pBuffer));
506  return;
507  }
508 
509  uint8_t *pFb = reinterpret_cast<uint8_t *>(getFramebuffer());
510  uint8_t *pFb2 = pBuf->pFbBackbuffer;
511 
512  size_t compiledColour = 0;
513  if (m_SpecialisedMode == Mode_16bpp_5r6g5b)
514  {
515  compiledColour = ((colour.r >> 3) << 11) | ((colour.g >> 2) << 5) |
516  ((colour.b >> 3) << 0);
517  for (size_t i = y; i < y + height; i++)
518  {
519  DoubleWordSet(
520  &pBuffer[i * m_Mode.width + x],
521  *reinterpret_cast<uint32_t *>(&colour), width);
522  WordSet(
523  &pFb[(i * m_Mode.width + x) * 2],
524  static_cast<uint16_t>(compiledColour), width);
525  WordSet(
526  &pFb2[(i * m_Mode.width + x) * 2],
527  static_cast<uint16_t>(compiledColour), width);
528  }
529  return;
530  }
531  else
532  // Bit of a dirty hack. Oh well.
533  packColour(colour, 0, reinterpret_cast<uintptr_t>(&compiledColour));
534 
537  for (size_t i = y; i < y + height; i++)
538  {
539  for (size_t j = x; j < x + width; j++)
540  {
541  pBuffer[i * m_Mode.width + j] = colour;
542  switch (m_Mode.pf.nBpp)
543  {
544  case 15:
545  case 16:
546  {
547  uint16_t *pFb16 = reinterpret_cast<uint16_t *>(pFb);
548  uint16_t *pFb162 = reinterpret_cast<uint16_t *>(pFb2);
549  pFb16[i * m_Mode.width + j] = compiledColour & 0xFFFF;
550  pFb162[i * m_Mode.width + j] = compiledColour & 0xFFFF;
551  break;
552  }
553  case 24:
554  pFb[(i * m_Mode.width + j) * 3 + 0] = colour.b;
555  pFb[(i * m_Mode.width + j) * 3 + 1] = colour.g;
556  pFb[(i * m_Mode.width + j) * 3 + 2] = colour.r;
557  pFb2[(i * m_Mode.width + j) * 3 + 0] = colour.b;
558  pFb2[(i * m_Mode.width + j) * 3 + 1] = colour.g;
559  pFb2[(i * m_Mode.width + j) * 3 + 2] = colour.r;
560  break;
561  default:
562  WARNING("VbeDisplay: Pixel format not handled in "
563  "fillRectangle.");
564  }
565  }
566  }
567 }
568 
569 void VbeDisplay::packColour(rgb_t colour, size_t idx, uintptr_t pFb)
570 {
571  PixelFormat pf = m_Mode.pf;
572 
573  uint8_t r = colour.r;
574  uint8_t g = colour.g;
575  uint8_t b = colour.b;
576 
577  // Calculate the range of the Red field.
578  uint8_t range = 1 << pf.mRed;
579 
580  // Clamp the red value to this range.
581  r = (r * range) / 256;
582 
583  range = 1 << pf.mGreen;
584 
585  // Clamp the green value to this range.
586  g = (g * range) / 256;
587 
588  range = 1 << pf.mBlue;
589 
590  // Clamp the blue value to this range.
591  b = (b * range) / 256;
592 
593  // Assemble the colour.
594  uint32_t c = 0 | (static_cast<uint32_t>(r) << pf.pRed) |
595  (static_cast<uint32_t>(g) << pf.pGreen) |
596  (static_cast<uint32_t>(b) << pf.pBlue);
597 
598  switch (pf.nBpp)
599  {
600  case 15:
601  case 16:
602  {
603  uint16_t *pFb16 = reinterpret_cast<uint16_t *>(pFb);
604  pFb16[idx] = c;
605  break;
606  }
607  case 24:
608  {
609  rgb_t *pFbRgb = reinterpret_cast<rgb_t *>(pFb);
610  pFbRgb[idx].r = static_cast<uint32_t>(b);
611  pFbRgb[idx].g = static_cast<uint32_t>(g);
612  pFbRgb[idx].b = static_cast<uint32_t>(r);
613  break;
614  }
615  case 32:
616  {
617  uint32_t *pFb32 = reinterpret_cast<uint32_t *>(pFb);
618  pFb32[idx] = c;
619  break;
620  }
621  }
622 }
virtual void * getFramebuffer()
Definition: VbeDisplay.cc:118
uint8_t mRed
Red mask.
Definition: Display.h:57
static PhysicalMemoryManager & instance()
virtual bool getPixelFormat(Display::PixelFormat &pPf)
Definition: VbeDisplay.cc:123
virtual bool setScreenMode(Display::ScreenMode sm)
Definition: VbeDisplay.cc:163
A vector / dynamic array.
Memory mapped I/O range.
void setAx(int n)
Definition: Bios.cc:211
void executeInterrupt(int interrupt)
Definition: Bios.cc:172
Definition: String.h:49
virtual void fillRectangle(rgb_t *pBuffer, size_t x, size_t y, size_t width, size_t height, rgb_t colour)
Definition: VbeDisplay.cc:496
virtual Vga * getVga(size_t n)=0
uint8_t pGreen
Position of green field.
Definition: Display.h:60
Definition: Device.h:43
uint8_t nBpp
Bits per pixel (total).
Definition: Display.h:65
virtual bool setScreenMode(Display::ScreenMode sm)
virtual bool setMode(int mode)=0
virtual rgb_t * newBuffer()
Definition: VbeDisplay.cc:254
#define WARNING(text)
Definition: Log.h:78
Result * query(const char *sql)
#define NOTICE(text)
Definition: Log.h:74
Definition: Log.h:136
bool succeeded()
Returns true if the result is valid, false if there was an error.
static Bios & instance()
Definition: Bios.h:32
Iterator begin()
Definition: List.h:123
uint32_t nPitch
Bytes per scanline.
Definition: Display.h:66
void setBx(int n)
Definition: Bios.cc:215
virtual void * getFramebuffer()
Vector< Address * > m_Addresses
Definition: Device.h:362
uint8_t pBlue
Position of blue field.
Definition: Display.h:62
void * virtualAddress() const
Definition: MemoryRegion.cc:39
#define ERROR(text)
Definition: Log.h:82
virtual bool getScreenModes(List< Display::ScreenMode * > &sms)
Definition: VbeDisplay.cc:135
uint8_t mGreen
Green mask.
Definition: Display.h:59
void setDi(int n)
Definition: Bios.cc:227
An iterator applicable for many data structures.
Definition: Iterator.h:180
#define FATAL(text)
Definition: Log.h:89
std::string errorMessage(size_t buffSz=256)
Returns the error message.
uint8_t mBlue
Blue mask.
Definition: Display.h:61
uint8_t pRed
Position of red field.
Definition: Display.h:58
void setEs(int n)
Definition: Bios.cc:231
virtual bool getCurrentScreenMode(Display::ScreenMode &sm)
Definition: VbeDisplay.cc:129