1/* |
2 * Copyright (c) 2010-2013, 2015 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 --- 67 unchanged lines hidden (view full) --- 78 * specification is referenced for the different Versatile Express tiles. 79 * This implementation uses the larger 2 KB buffer by default. 80 */ 81 82#ifndef __DEV_ARM_HDLCD_HH__ 83#define __DEV_ARM_HDLCD_HH__ 84 85#include <fstream> |
86#include <memory> |
87 |
88#include "base/bitmap.hh" 89#include "base/framebuffer.hh" |
90#include "dev/arm/amba_device.hh" 91#include "params/HDLcd.hh" 92#include "sim/serialize.hh" 93 94class VncInput; |
95 96class HDLcd: public AmbaDmaDevice 97{ 98 protected: 99 /** fake AMBA ID -- unused */ 100 static const uint64_t AMBA_ID = ULL(0xb105f00d00141000); 101 102 /** ARM HDLcd register offsets */ --- 36 unchanged lines hidden (view full) --- 139 static const size_t MAX_BURST_LEN = 16; 140 141 /** size of internal buffer in bytes */ 142 static const size_t PIXEL_BUFFER_CAPACITY = 2048; 143 144 /** AXI port width in bytes */ 145 static const size_t AXI_PORT_WIDTH = 8; 146 |
147 static const size_t MAX_BURST_SIZE = MAX_BURST_LEN * AXI_PORT_WIDTH; 148 |
149 /** 150 * @name RegisterFieldLayouts 151 * Bit layout declarations for multi-field registers. 152 */ 153 /**@{*/ 154 BitUnion32(VersionReg) 155 Bitfield<7,0> version_minor; 156 Bitfield<15,8> version_major; --- 84 unchanged lines hidden (view full) --- 241 ColorSelectReg red_select; /**< Red color select register */ 242 ColorSelectReg green_select; /**< Green color select register */ 243 ColorSelectReg blue_select; /**< Blue color select register */ 244 /** @} */ 245 246 /** Pixel clock period */ 247 const Tick pixelClock; 248 |
249 FrameBuffer fb; 250 |
251 /** VNC server */ 252 VncInput *vnc; 253 254 /** Helper to write out bitmaps */ |
255 Bitmap bmp; |
256 257 /** Picture of what the current frame buffer looks like */ 258 std::ostream *pic; 259 260 /** 261 * Event wrapper for dmaDone() 262 * 263 * This event call pushes its this pointer onto the freeDoneEvent vector --- 62 unchanged lines hidden (view full) --- 326 327 /** Number of pending dma reads */ 328 size_t dmaPendingNum; 329 330 /** Flag indicating whether current frame has underrun */ 331 bool frameUnderrun; 332 333 /** HDLcd virtual display buffer */ |
334 std::vector<uint8_t> virtualDisplayBuffer; |
335 336 /** Size of the pixel buffer */ 337 size_t pixelBufferSize; 338 339 /** Index of the next pixel to render */ 340 size_t pixelIndex; 341 342 /** Flag indicating whether video parameters need updating */ --- 60 unchanged lines hidden (view full) --- 403 * Gets frame buffer height. 404 * 405 * @return frame buffer height (lines per panel) 406 */ 407 inline size_t height() const { 408 return fb_line_count.fb_line_count; 409 } 410 |
411 inline size_t area() const { return height() * width(); } 412 |
413 /** 414 * Gets the total number of pixel clocks per display line. 415 * 416 * @return number of pixel clocks per display line including porch delays 417 * and horizontal sync time 418 */ 419 inline uint64_t PClksPerLine() const { 420 return h_back_porch.val + 1 + --- 18 unchanged lines hidden (view full) --- 439 void fillPixelBuffer(); 440 441 /** DMA done event */ 442 void dmaDone(DmaDoneEvent *event); 443 444 /** Called when it is time to render a pixel */ 445 void renderPixel(); 446 |
447 PixelConverter pixelConverter() const; 448 |
449 /** Start of frame event */ 450 EventWrapper<HDLcd, &HDLcd::startFrame> startFrameEvent; 451 452 /** End of frame event */ 453 EventWrapper<HDLcd, &HDLcd::endFrame> endFrameEvent; 454 455 /** Pixel render event */ 456 EventWrapper<HDLcd, &HDLcd::renderPixel> renderPixelEvent; --- 58 unchanged lines hidden --- |