gem5  v19.0.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
hdlcd.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2010-2013, 2015, 2017 ARM Limited
3  * All rights reserved
4  *
5  * The license below extends only to copyright in the software and shall
6  * not be construed as granting a license to any other intellectual
7  * property including but not limited to intellectual property relating
8  * to a hardware implementation of the functionality of the software
9  * licensed hereunder. You may use the software subject to the license
10  * terms below provided that you ensure that this notice is replicated
11  * unmodified and in its entirety in all distributions of the software,
12  * modified or unmodified, in source code or in binary form.
13  *
14  * Redistribution and use in source and binary forms, with or without
15  * modification, are permitted provided that the following conditions are
16  * met: redistributions of source code must retain the above copyright
17  * notice, this list of conditions and the following disclaimer;
18  * redistributions in binary form must reproduce the above copyright
19  * notice, this list of conditions and the following disclaimer in the
20  * documentation and/or other materials provided with the distribution;
21  * neither the name of the copyright holders nor the names of its
22  * contributors may be used to endorse or promote products derived from
23  * this software without specific prior written permission.
24  *
25  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
28  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
29  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
30  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
31  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
32  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
35  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36  *
37  * Authors: Chris Emmons
38  * Andreas Sandberg
39  */
40 
41 #include "dev/arm/hdlcd.hh"
42 
43 #include "base/output.hh"
44 #include "base/trace.hh"
45 #include "base/vnc/vncinput.hh"
46 #include "debug/Checkpoint.hh"
47 #include "debug/HDLcd.hh"
48 #include "dev/arm/amba_device.hh"
49 #include "dev/arm/base_gic.hh"
50 #include "enums/ImageFormat.hh"
51 #include "mem/packet.hh"
52 #include "mem/packet_access.hh"
53 #include "params/HDLcd.hh"
54 #include "sim/system.hh"
55 
56 using std::vector;
57 
58 
59 // initialize hdlcd registers
60 HDLcd::HDLcd(const HDLcdParams *p)
61  : AmbaDmaDevice(p, 0xFFFF),
62  // Parameters
63  vnc(p->vnc),
64  workaroundSwapRB(p->workaround_swap_rb),
65  workaroundDmaLineCount(p->workaround_dma_line_count),
66  addrRanges{RangeSize(pioAddr, pioSize)},
67  enableCapture(p->enable_capture),
68  pixelBufferSize(p->pixel_buffer_size),
69  virtRefreshRate(p->virt_refresh_rate),
70 
71  // Registers
72  version(VERSION_RESETV),
73  int_rawstat(0), int_mask(0),
74 
77 
78  v_sync(0), v_back_porch(0), v_data(0), v_front_porch(0),
79  h_sync(0), h_back_porch(0), h_data(0), h_front_porch(0),
80  polarities(0),
81 
82  command(0),
83 
84  pixel_format(0),
86 
87  virtRefreshEvent([this]{ virtRefresh(); }, name()),
88  // Other
89  imgFormat(p->frame_format), pic(NULL), conv(PixelConverter::rgba8888_le),
90  pixelPump(*this, *p->pxl_clk, p->pixel_chunk)
91 {
92  if (vnc)
94 
96 }
97 
99 {
100 }
101 
102 void
104 {
106 
107  using namespace Stats;
108 
109  stats.underruns
110  .name(name() + ".underruns")
111  .desc("number of buffer underruns")
112  .flags(nozero)
113  ;
114 }
115 
116 void
118 {
119  DPRINTF(Checkpoint, "Serializing ARM HDLCD\n");
120 
123 
129 
134 
139 
141 
147 
149  if (enabled())
150  dmaEngine->serializeSection(cp, "dmaEngine");
151 }
152 
153 void
155 {
156  DPRINTF(Checkpoint, "Unserializing ARM HDLCD\n");
157 
160 
166 
171 
176 
178 
184 
185  {
186  // Try to unserialize the pixel pump. It might not exist if
187  // we're unserializing an old checkpoint.
188  ScopedCheckpointSection sec(cp, "pixelPump");
191  }
192 
193  if (enabled()) {
194  // Create the DMA engine and read its state from the
195  // checkpoint. We don't need to worry about the pixel pump as
196  // it is a proper SimObject.
197  createDmaEngine();
198  dmaEngine->unserializeSection(cp, "dmaEngine");
199 
200  conv = pixelConverter();
201  }
202 }
203 
204 void
206 {
208 
209  if (enabled()) {
210  if (sys->bypassCaches()) {
211  // We restart the HDLCD if we are in KVM mode. This
212  // ensures that we always use the fast refresh logic if we
213  // resume in KVM mode.
214  cmdDisable();
215  cmdEnable();
216  } else if (!pixelPump.active()) {
217  // We restored from an old checkpoint without a pixel
218  // pump, start an new refresh. This typically happens when
219  // restoring from old checkpoints.
220  cmdEnable();
221  }
222  }
223 
224  // We restored from a checkpoint and need to update the VNC server
225  if (pixelPump.active() && vnc)
226  vnc->setDirty();
227 }
228 
229 void
231 {
234 }
235 
236 // read registers and frame buffer
237 Tick
239 {
240  assert(pkt->getAddr() >= pioAddr &&
241  pkt->getAddr() < pioAddr + pioSize);
242 
243  const Addr daddr(pkt->getAddr() - pioAddr);
244  panic_if(pkt->getSize() != 4,
245  "Unhandled read size (address: 0x.4x, size: %u)",
246  daddr, pkt->getSize());
247 
248  const uint32_t data(readReg(daddr));
249  DPRINTF(HDLcd, "read register 0x%04x: 0x%x\n", daddr, data);
250 
251  pkt->setLE<uint32_t>(data);
252  pkt->makeAtomicResponse();
253  return pioDelay;
254 }
255 
256 // write registers and frame buffer
257 Tick
259 {
260  assert(pkt->getAddr() >= pioAddr &&
261  pkt->getAddr() < pioAddr + pioSize);
262 
263  const Addr daddr(pkt->getAddr() - pioAddr);
264  panic_if(pkt->getSize() != 4,
265  "Unhandled read size (address: 0x.4x, size: %u)",
266  daddr, pkt->getSize());
267  const uint32_t data(pkt->getLE<uint32_t>());
268  DPRINTF(HDLcd, "write register 0x%04x: 0x%x\n", daddr, data);
269 
270  writeReg(daddr, data);
271 
272  pkt->makeAtomicResponse();
273  return pioDelay;
274 }
275 
276 uint32_t
278 {
279  switch (offset) {
280  case Version: return version;
281 
282  case Int_RawStat: return int_rawstat;
283  case Int_Clear:
284  panic("HDLCD INT_CLEAR register is Write-Only\n");
285  case Int_Mask: return int_mask;
286  case Int_Status: return intStatus();
287 
288  case Fb_Base: return fb_base;
289  case Fb_Line_Length: return fb_line_length;
290  case Fb_Line_Count: return fb_line_count;
291  case Fb_Line_Pitch: return fb_line_pitch;
292  case Bus_Options: return bus_options;
293 
294  case V_Sync: return v_sync;
295  case V_Back_Porch: return v_back_porch;
296  case V_Data: return v_data;
297  case V_Front_Porch: return v_front_porch;
298  case H_Sync: return h_sync;
299  case H_Back_Porch: return h_back_porch;
300  case H_Data: return h_data;
301  case H_Front_Porch: return h_front_porch;
302  case Polarities: return polarities;
303 
304  case Command: return command;
305  case Pixel_Format: return pixel_format;
306  case Red_Select: return red_select;
307  case Green_Select: return green_select;
308  case Blue_Select: return blue_select;
309 
310  default:
311  panic("Tried to read HDLCD register that doesn't exist\n", offset);
312  }
313 }
314 
315 void
316 HDLcd::writeReg(Addr offset, uint32_t value)
317 {
318  switch (offset) {
319  case Version:
320  panic("HDLCD VERSION register is read-Only\n");
321 
322  case Int_RawStat:
323  intRaise(value);
324  return;
325  case Int_Clear:
326  intClear(value);
327  return;
328  case Int_Mask:
329  intMask(value);
330  return;
331  case Int_Status:
332  panic("HDLCD INT_STATUS register is read-Only\n");
333  break;
334 
335  case Fb_Base:
336  fb_base = value;
337  return;
338 
339  case Fb_Line_Length:
340  fb_line_length = value;
341  return;
342 
343  case Fb_Line_Count:
344  fb_line_count = value;
345  return;
346 
347  case Fb_Line_Pitch:
348  fb_line_pitch = value;
349  return;
350 
351  case Bus_Options: {
352  const BusOptsReg old_bus_options(bus_options);
353  bus_options = value;
354 
355  if (bus_options.max_outstanding != old_bus_options.max_outstanding) {
356  DPRINTF(HDLcd,
357  "Changing HDLcd outstanding DMA transactions: %d -> %d\n",
358  old_bus_options.max_outstanding,
359  bus_options.max_outstanding);
360 
361  }
362 
363  if (bus_options.burst_len != old_bus_options.burst_len) {
364  DPRINTF(HDLcd,
365  "Changing HDLcd DMA burst flags: 0x%x -> 0x%x\n",
366  old_bus_options.burst_len, bus_options.burst_len);
367  }
368  } return;
369 
370  case V_Sync:
371  v_sync = value;
372  return;
373  case V_Back_Porch:
374  v_back_porch = value;
375  return;
376  case V_Data:
377  v_data = value;
378  return;
379  case V_Front_Porch:
380  v_front_porch = value;
381  return;
382 
383  case H_Sync:
384  h_sync = value;
385  return;
386  case H_Back_Porch:
387  h_back_porch = value;
388  return;
389  case H_Data:
390  h_data = value;
391  return;
392  case H_Front_Porch:
393  h_front_porch = value;
394  return;
395 
396  case Polarities:
397  polarities = value;
398  return;
399 
400  case Command: {
401  const CommandReg new_command(value);
402 
403  if (new_command.enable != command.enable) {
404  DPRINTF(HDLcd, "HDLCD switched %s\n",
405  new_command.enable ? "on" : "off");
406 
407  if (new_command.enable) {
408  cmdEnable();
409  } else {
410  cmdDisable();
411  }
412  }
413  command = new_command;
414  } return;
415 
416  case Pixel_Format:
417  pixel_format = value;
418  return;
419 
420  case Red_Select:
421  red_select = value;
422  return;
423  case Green_Select:
424  green_select = value;
425  return;
426  case Blue_Select:
427  blue_select = value;
428  return;
429 
430  default:
431  panic("Tried to write HDLCD register that doesn't exist\n", offset);
432  return;
433  }
434 }
435 
438 {
439  ByteOrder byte_order(
441 
442  /* Some Linux kernels have a broken driver that swaps the red and
443  * blue color select registers. */
444  if (!workaroundSwapRB) {
445  return PixelConverter(
446  pixel_format.bytes_per_pixel + 1,
447  red_select.offset, green_select.offset, blue_select.offset,
448  red_select.size, green_select.size, blue_select.size,
449  byte_order);
450  } else {
451  return PixelConverter(
452  pixel_format.bytes_per_pixel + 1,
453  blue_select.offset, green_select.offset, red_select.offset,
454  blue_select.size, green_select.size, red_select.size,
455  byte_order);
456  }
457 }
458 
461 {
462  return DisplayTimings(
463  h_data.val + 1, v_data.val + 1,
464  h_back_porch.val + 1, h_sync.val + 1, h_front_porch.val + 1,
465  v_back_porch.val + 1, v_sync.val + 1, v_front_porch.val + 1);
466 }
467 
468 void
470 {
471  if (bus_options.max_outstanding == 0) {
472  warn("Maximum number of outstanding DMA transfers set to 0.");
473  return;
474  }
475 
476  const uint32_t dma_burst_flags(bus_options.burst_len);
477  const uint32_t dma_burst_len(
478  dma_burst_flags ?
479  (1UL << (findMsbSet(dma_burst_flags) - 1)) :
480  MAX_BURST_LEN);
481  // Some drivers seem to set the DMA line count incorrectly. This
482  // could either be a driver bug or a specification bug. Unlike for
483  // timings, the specification does not require 1 to be added to
484  // the DMA engine's line count.
485  const uint32_t dma_lines(
487 
488  dmaEngine.reset(new DmaEngine(
489  *this, pixelBufferSize,
490  AXI_PORT_WIDTH * dma_burst_len,
491  bus_options.max_outstanding,
492  fb_line_length, fb_line_pitch, dma_lines));
493 }
494 
495 void
497 {
498  createDmaEngine();
499  conv = pixelConverter();
500 
501  // Update timing parameter before rendering frames
503 
504  if (sys->bypassCaches()) {
506  } else {
507  pixelPump.start();
508  }
509 }
510 
511 void
513 {
514  pixelPump.stop();
515  // Disable the virtual refresh event
516  if (virtRefreshEvent.scheduled()) {
517  assert(sys->bypassCaches());
519  }
520  dmaEngine->abortFrame();
521 }
522 
523 bool
525 {
526  uint8_t pixel_data[MAX_PIXEL_SIZE];
527  assert(conv.length <= sizeof(pixel_data));
528  if (dmaEngine->tryGet(pixel_data, conv.length)) {
529  p = conv.toPixel(pixel_data);
530  return true;
531  } else {
532  return false;
533  }
534 }
535 
536 void
538 {
539  DPRINTF(HDLcd, "Raising VSYNC interrupt.\n");
541 }
542 
543 void
545 {
546  DPRINTF(HDLcd, "End of VSYNC, starting DMA engine\n");
547  dmaEngine->startFrame(fb_base);
548 }
549 
550 void
552 {
553  DPRINTF(HDLcd, "Buffer underrun, stopping DMA fill.\n");
554  ++stats.underruns;
556  dmaEngine->abortFrame();
557 }
558 
559 void
561 {
562  DPRINTF(HDLcd, "Reached end of last visible line.\n");
563 
564  if (dmaEngine->size()) {
565  warn("HDLCD %u bytes still in FIFO after frame: Ensure that DMA "
566  "and PixelPump configuration is consistent\n",
567  dmaEngine->size());
568  dmaEngine->dumpSettings();
570  }
571 
572  if (vnc)
573  vnc->setDirty();
574 
575  if (enableCapture) {
576  if (!pic) {
577  pic = simout.create(
578  csprintf("%s.framebuffer.%s",
579  sys->name(), imgWriter->getImgExtension()),
580  true);
581  }
582 
583  assert(pic);
584  pic->stream()->seekp(0);
585  imgWriter->write(*pic->stream());
586  }
587 }
588 
589 void
590 HDLcd::setInterrupts(uint32_t ints, uint32_t mask)
591 {
592  const bool old_ints(intStatus());
593 
594  int_mask = mask;
595  int_rawstat = ints;
596 
597  if (!old_ints && intStatus()) {
598  gic->sendInt(intNum);
599  } else if (old_ints && !intStatus()) {
600  gic->clearInt(intNum);
601  }
602 }
603 
605  unsigned request_size, unsigned max_pending,
606  size_t line_size, ssize_t line_pitch, unsigned num_lines)
607  : DmaReadFifo(
608  _parent.dmaPort, size, request_size, max_pending,
609  Request::UNCACHEABLE),
610  parent(_parent),
611  lineSize(line_size), linePitch(line_pitch), numLines(num_lines),
612  nextLineAddr(0)
613 {
614 }
615 
616 void
618 {
620 
623 }
624 
625 void
627 {
629 
632 }
633 
634 void
636 {
638  frameEnd = fb_base + numLines * linePitch;
639 
641 }
642 
643 void
645 {
647  stopFill();
648  flush();
649 }
650 
651 
652 void
654 {
655  inform("DMA line size: %u bytes", lineSize);
656  inform("DMA line pitch: %i bytes", linePitch);
657  inform("DMA num lines: %u", numLines);
658 }
659 
660 void
662 {
663  if (nextLineAddr == frameEnd)
664  // We're done with this frame. Ignore calls to this method
665  // until the next frame has been started.
666  return;
667 
669  if (nextLineAddr != frameEnd)
671 }
672 
673 void
675 {
676  parent.intRaise(INT_DMA_END);
677 }
678 
679 void
681 {
682  const DisplayTimings &t(timings());
683 
684  inform("PixelPump width: %u", t.width);
685  inform("PixelPump height: %u", t.height);
686 
687  inform("PixelPump horizontal back porch: %u", t.hBackPorch);
688  inform("PixelPump horizontal fron porch: %u", t.hFrontPorch);
689  inform("PixelPump horizontal fron porch: %u", t.hSync);
690 
691  inform("PixelPump vertical back porch: %u", t.vBackPorch);
692  inform("PixelPump vertical fron porch: %u", t.vFrontPorch);
693  inform("PixelPump vertical fron porch: %u", t.vSync);
694 }
695 
696 
697 HDLcd *
698 HDLcdParams::create()
699 {
700  return new HDLcd(this);
701 }
TimingReg v_back_porch
Vertical back porch width register.
Definition: hdlcd.hh:243
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Definition: hdlcd.cc:626
#define panic(...)
This implements a cprintf based panic() function.
Definition: logging.hh:167
#define DPRINTF(x,...)
Definition: trace.hh:229
void serialize(CheckpointOut &cp) const override
Serialize an object.
Definition: hdlcd.cc:117
AddrRange RangeSize(Addr start, Addr size)
Definition: addr_range.hh:584
unsigned vSync
Vertical sync signal in lines.
Definition: pixelpump.hh:121
OutputDirectory simout
Definition: output.cc:65
static constexpr size_t MAX_PIXEL_SIZE
Maximum number of bytes per pixel.
Definition: hdlcd.hh:163
Addr nextLineAddr
Definition: hdlcd.hh:390
burst_len
Definition: hdlcd.hh:187
DisplayTimings displayTimings() const
Definition: hdlcd.cc:460
bool pxlNext(Pixel &p)
Definition: hdlcd.cc:524
virtual void clearInt(uint32_t num)=0
Clear an interrupt from a device that is connected to the GIC.
void serialize(CheckpointOut &cp) const override
Serialize an object.
Definition: dma_device.cc:322
uint32_t fb_base
Frame buffer base address register.
Definition: hdlcd.hh:237
Buffered DMA engine helper class.
Definition: dma_device.hh:329
Definition: hdlcd.hh:93
void startFill(Addr start, size_t size)
Start filling the FIFO.
Definition: dma_device.cc:359
OutputStream * create(const std::string &name, bool binary=false, bool no_gz=false)
Creates a file in this directory (optionally compressed).
Definition: output.cc:206
void cmdEnable()
Definition: hdlcd.cc:496
TimingReg h_front_porch
Horizontal front porch width reg.
Definition: hdlcd.hh:249
const bool workaroundDmaLineCount
Definition: hdlcd.hh:115
void serialize(CheckpointOut &cp) const override
Serialize an object.
Definition: hdlcd.cc:617
unsigned length
Bytes per pixel when stored in memory (including padding)
Definition: pixel.hh:181
Bitfield< 11, 8 > max_outstanding
Definition: hdlcd.hh:189
virtual void setDirty()
The frame buffer uses this call to notify the vnc server that the frame buffer has been updated and a...
Definition: vncinput.cc:95
void intMask(uint32_t mask)
Convenience function to update the interrupt mask.
Definition: hdlcd.hh:298
static constexpr size_t BUS_OPTIONS_RESETV
Reset value for Bus_Options register.
Definition: hdlcd.hh:151
void pxlVSyncBegin()
Definition: hdlcd.cc:537
PixelPump pixelPump
Definition: hdlcd.hh:364
void dumpSettings()
Definition: hdlcd.cc:653
DmaEngine(HDLcd &_parent, size_t size, unsigned request_size, unsigned max_pending, size_t line_size, ssize_t line_pitch, unsigned num_lines)
Definition: hdlcd.cc:604
HDLcd & parent
Definition: hdlcd.hh:385
void stop()
Immediately stop pushing pixels.
Definition: pixelpump.cc:163
PixelFormatReg pixel_format
Pixel format register.
Definition: hdlcd.hh:252
Pixel toPixel(uint32_t word) const
Get the Pixel representation of a color word.
Definition: pixel.hh:135
unsigned hBackPorch
Horizontal back porch in pixels.
Definition: pixelpump.hh:110
std::unique_ptr< ImgWriter > createImgWriter(Enums::ImageFormat type, const FrameBuffer *fb)
Factory Function which allocates a ImgWriter object and returns a smart pointer to it...
Definition: imgwriter.cc:52
const ssize_t linePitch
Definition: hdlcd.hh:387
ColorSelectReg green_select
Green color select register.
Definition: hdlcd.hh:254
virtual void regStats()
Callback to set stat parameters.
Definition: group.cc:66
ColorSelectReg blue_select
Blue color select register.
Definition: hdlcd.hh:255
CommandReg command
Command register.
Definition: hdlcd.hh:251
BusOptsReg bus_options
Bus options register.
Definition: hdlcd.hh:241
void abortFrame()
Definition: hdlcd.cc:644
virtual void setFrameBuffer(const FrameBuffer *rfb)
Set the address of the frame buffer we are going to show.
Definition: vncinput.cc:76
unsigned vFrontPorch
Vertical front porch in lines.
Definition: pixelpump.hh:119
void start()
Starting pushing pixels in timing mode.
Definition: pixelpump.cc:156
Definition: cprintf.cc:42
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Definition: pixelpump.cc:123
const Tick virtRefreshRate
Definition: hdlcd.hh:119
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Definition: hdlcd.cc:154
Implementiation of the ARM HDLcd controller.
HDLcd(const HDLcdParams *p)
Definition: hdlcd.cc:60
TimingReg v_front_porch
Vertical front porch width register.
Definition: hdlcd.hh:245
void deschedule(Event &event)
Definition: eventq.hh:750
void setLE(T v)
Set the value in the data pointer to v as little endian.
std::ostream * stream() const
Get the output underlying output stream.
Definition: output.hh:64
static constexpr size_t MAX_BURST_LEN
max number of beats delivered in one dma burst
Definition: hdlcd.hh:160
void startFrame(Addr fb_base)
Definition: hdlcd.cc:635
EventFunctionWrapper virtRefreshEvent
Definition: hdlcd.hh:350
const Addr pixelBufferSize
Definition: hdlcd.hh:118
std::unique_ptr< DmaEngine > dmaEngine
Definition: hdlcd.hh:394
uint32_t intStatus() const
Masked interrupt status register.
Definition: hdlcd.hh:321
unsigned getSize() const
Definition: packet.hh:736
#define UNSERIALIZE_SCALAR(scalar)
Definition: serialize.hh:645
#define inform(...)
Definition: logging.hh:213
OutputStream * pic
Picture of what the current frame buffer looks like.
Definition: hdlcd.hh:359
TimingReg h_back_porch
Horizontal back porch width register.
Definition: hdlcd.hh:247
Tick curTick()
The current simulated tick.
Definition: core.hh:47
Bitfield< 11, 8 > size
Definition: hdlcd.hh:222
std::string csprintf(const char *format, const Args &...args)
Definition: cprintf.hh:162
uint32_t int_mask
Interrupt mask register.
Definition: hdlcd.hh:236
bool scheduled() const
Determine if the current event is scheduled.
Definition: eventq.hh:385
void stopFill()
Stop the DMA engine.
Definition: dma_device.cc:369
offset
Definition: hdlcd.hh:220
bool active() const
Is the pixel pump active and refreshing the display?
Definition: pixelpump.hh:175
struct HDLcd::@55 stats
uint32_t fb_line_length
Frame buffer Line length register.
Definition: hdlcd.hh:238
This is a base class for AMBA devices that have to respond to Device and Implementer ID calls...
virtual void sendInt(uint32_t num)=0
Post an interrupt from a device that is connected to the GIC.
void makeAtomicResponse()
Definition: packet.hh:949
void renderFrame()
Render an entire frame in KVM execution mode.
Definition: pixelpump.cc:252
uint64_t Tick
Tick count type.
Definition: types.hh:63
#define SERIALIZE_OBJ(obj)
Definition: serialize.hh:678
TimingReg h_sync
Horizontal sync width register.
Definition: hdlcd.hh:246
void intClear(uint32_t ints)
Convenience function to clear interrupts.
Definition: hdlcd.hh:316
ByteOrder
Definition: types.hh:247
static const PixelConverter rgba8888_le
Predefined 32-bit RGB (red in least significant bits, 8 bits/channel, little endian) conversion helpe...
Definition: pixel.hh:200
void cmdDisable()
Definition: hdlcd.cc:512
Addr getAddr() const
Definition: packet.hh:726
PolaritiesReg polarities
Polarities register.
Definition: hdlcd.hh:250
PixelConverter conv
Cached pixel converter, set when the converter is enabled.
Definition: hdlcd.hh:362
void updateTimings(const DisplayTimings &timings)
Update frame size using display timing.
Definition: pixelpump.cc:140
FrameBuffer fb
Output frame buffer.
Definition: pixelpump.hh:195
Tick read(PacketPtr pkt) override
Pure virtual function that the device must implement.
Definition: hdlcd.cc:238
void dumpSettings()
Definition: hdlcd.cc:680
void setInterrupts(uint32_t ints, uint32_t mask)
Assign new interrupt values and update interrupt signals.
Definition: hdlcd.cc:590
TimingReg h_data
Horizontal data width register.
Definition: hdlcd.hh:248
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:142
BaseGic * gic
Definition: amba_device.hh:108
System * sys
Definition: io_device.hh:105
virtual const std::string name() const
Definition: sim_object.hh:120
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
Definition: packet.hh:255
void onIdle() override
Last response received callback.
Definition: hdlcd.cc:674
unsigned height
Display height in pixels.
Definition: pixelpump.hh:107
Bitfield< 15, 8 > vector
Definition: intmessage.hh:46
Tick clockEdge(Cycles cycles=Cycles(0)) const
Determine the tick when a cycle begins, by default the current one, but the argument also enables the...
VncInput * vnc
Definition: hdlcd.hh:113
void pxlUnderrun()
Definition: hdlcd.cc:551
#define SERIALIZE_SCALAR(scalar)
Definition: serialize.hh:643
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Definition: dma_device.cc:332
static constexpr size_t VERSION_RESETV
Reset value for Version register.
Definition: hdlcd.hh:154
ColorSelectReg red_select
Red color select register.
Definition: hdlcd.hh:253
unsigned hFrontPorch
Horizontal front porch in pixels.
Definition: pixelpump.hh:112
const unsigned numLines
Definition: hdlcd.hh:388
static constexpr size_t AXI_PORT_WIDTH
AXI port width in bytes.
Definition: hdlcd.hh:157
PixelConverter pixelConverter() const
Definition: hdlcd.cc:437
uint32_t int_rawstat
Interrupt raw status register.
Definition: hdlcd.hh:235
unsigned hSync
Horizontal sync signal length in pixels.
Definition: pixelpump.hh:114
Declaration of a VNC input.
Base class for ARM GIC implementations.
void virtRefresh()
Handler for fast frame refresh in KVM-mode.
Definition: hdlcd.cc:230
Declaration of the Packet class.
const size_t lineSize
Definition: hdlcd.hh:386
void pxlVSyncEnd()
Definition: hdlcd.cc:544
std::ostream CheckpointOut
Definition: serialize.hh:68
void writeReg(Addr offset, uint32_t value)
Definition: hdlcd.cc:316
int32_t fb_line_pitch
Frame buffer Line pitch register.
Definition: hdlcd.hh:240
bool bypassCaches() const
Should caches be bypassed?
Definition: system.hh:160
virtual void drainResume()
Resume execution after a successful drain.
Definition: drain.hh:257
bool sectionExists(const std::string &section)
Definition: serialize.cc:313
std::unique_ptr< ImgWriter > imgWriter
Helper to write out bitmaps.
Definition: hdlcd.hh:353
void pxlFrameDone()
Definition: hdlcd.cc:560
Tick write(PacketPtr pkt) override
Pure virtual function that the device must implement.
Definition: hdlcd.cc:258
static const std::string & currentSection()
Get the fully-qualified name of the active section.
Definition: serialize.cc:244
bool enabled() const
Definition: hdlcd.hh:269
uint32_t readReg(Addr offset)
Definition: hdlcd.cc:277
void createDmaEngine()
Definition: hdlcd.cc:469
int findMsbSet(uint64_t val)
Returns the bit position of the MSB that is set in the input.
Definition: bitfield.hh:204
void schedule(Event &event, Tick when)
Definition: eventq.hh:744
static constexpr uint32_t INT_VSYNC
Definition: hdlcd.hh:178
unsigned vBackPorch
Vertical back porch in lines.
Definition: pixelpump.hh:117
const bool workaroundSwapRB
Definition: hdlcd.hh:114
T getLE() const
Get the data in the packet byte swapped from little endian to host endian.
~HDLcd()
Definition: hdlcd.cc:98
Bitfield< 3, 0 > mask
Definition: types.hh:64
#define warn(...)
Definition: logging.hh:212
DmaPort dmaPort
Definition: dma_device.hh:172
Configurable RGB pixel converter.
Definition: pixel.hh:89
Internal gem5 representation of a Pixel.
Definition: pixel.hh:56
fb_line_count
Definition: hdlcd.hh:182
Bitfield< 5 > t
void drainResume() override
Resume execution after a successful drain.
Definition: hdlcd.cc:205
static constexpr uint32_t INT_UNDERRUN
Definition: hdlcd.hh:179
Scoped checkpoint section helper class.
Definition: serialize.hh:173
const FlagsType nozero
Don&#39;t print if this is zero.
Definition: info.hh:59
Bitfield< 0 > p
#define panic_if(cond,...)
Conditional panic macro that checks the supplied condition and only panics if the condition is true a...
Definition: logging.hh:185
void flush()
Flush the FIFO.
Definition: dma_device.hh:390
const char data[]
const bool enableCapture
Definition: hdlcd.hh:117
unsigned width
Display width in pixels.
Definition: pixelpump.hh:105
void intRaise(uint32_t ints)
Convenience function to raise a new interrupt.
Definition: hdlcd.hh:306
TimingReg v_sync
Vertical sync width register.
Definition: hdlcd.hh:242
void regStats() override
Callback to set stat parameters.
Definition: hdlcd.cc:103
Enums::ImageFormat imgFormat
Image Format.
Definition: hdlcd.hh:356
TimingReg v_data
Vertical data width register.
Definition: hdlcd.hh:244
void onEndOfBlock() override
End of block callback.
Definition: hdlcd.cc:661

Generated on Fri Feb 28 2020 16:27:00 for gem5 by doxygen 1.8.13