hdlcd.hh (9939:735d73e394d3) | hdlcd.hh (10839:10cac0f0f419) |
---|---|
1/* | 1/* |
2 * Copyright (c) 2010-2013 ARM Limited | 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> | 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> |
|
86 | 87 |
88#include "base/bitmap.hh" 89#include "base/framebuffer.hh" |
|
87#include "dev/arm/amba_device.hh" 88#include "params/HDLcd.hh" 89#include "sim/serialize.hh" 90 91class VncInput; | 90#include "dev/arm/amba_device.hh" 91#include "params/HDLcd.hh" 92#include "sim/serialize.hh" 93 94class VncInput; |
92class Bitmap; | |
93 94class HDLcd: public AmbaDmaDevice 95{ 96 protected: 97 /** fake AMBA ID -- unused */ 98 static const uint64_t AMBA_ID = ULL(0xb105f00d00141000); 99 100 /** ARM HDLcd register offsets */ --- 36 unchanged lines hidden (view full) --- 137 static const size_t MAX_BURST_LEN = 16; 138 139 /** size of internal buffer in bytes */ 140 static const size_t PIXEL_BUFFER_CAPACITY = 2048; 141 142 /** AXI port width in bytes */ 143 static const size_t AXI_PORT_WIDTH = 8; 144 | 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 |
|
145 /** 146 * @name RegisterFieldLayouts 147 * Bit layout declarations for multi-field registers. 148 */ 149 /**@{*/ 150 BitUnion32(VersionReg) 151 Bitfield<7,0> version_minor; 152 Bitfield<15,8> version_major; --- 84 unchanged lines hidden (view full) --- 237 ColorSelectReg red_select; /**< Red color select register */ 238 ColorSelectReg green_select; /**< Green color select register */ 239 ColorSelectReg blue_select; /**< Blue color select register */ 240 /** @} */ 241 242 /** Pixel clock period */ 243 const Tick pixelClock; 244 | 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 |
|
245 /** VNC server */ 246 VncInput *vnc; 247 248 /** Helper to write out bitmaps */ | 251 /** VNC server */ 252 VncInput *vnc; 253 254 /** Helper to write out bitmaps */ |
249 Bitmap *bmp; | 255 Bitmap bmp; |
250 251 /** Picture of what the current frame buffer looks like */ 252 std::ostream *pic; 253 254 /** 255 * Event wrapper for dmaDone() 256 * 257 * This event call pushes its this pointer onto the freeDoneEvent vector --- 62 unchanged lines hidden (view full) --- 320 321 /** Number of pending dma reads */ 322 size_t dmaPendingNum; 323 324 /** Flag indicating whether current frame has underrun */ 325 bool frameUnderrun; 326 327 /** HDLcd virtual display buffer */ | 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 */ |
328 uint8_t *virtualDisplayBuffer; | 334 std::vector<uint8_t> virtualDisplayBuffer; |
329 330 /** Size of the pixel buffer */ 331 size_t pixelBufferSize; 332 333 /** Index of the next pixel to render */ 334 size_t pixelIndex; 335 336 /** Flag indicating whether video parameters need updating */ --- 60 unchanged lines hidden (view full) --- 397 * Gets frame buffer height. 398 * 399 * @return frame buffer height (lines per panel) 400 */ 401 inline size_t height() const { 402 return fb_line_count.fb_line_count; 403 } 404 | 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 |
|
405 /** 406 * Gets the total number of pixel clocks per display line. 407 * 408 * @return number of pixel clocks per display line including porch delays 409 * and horizontal sync time 410 */ 411 inline uint64_t PClksPerLine() const { 412 return h_back_porch.val + 1 + --- 18 unchanged lines hidden (view full) --- 431 void fillPixelBuffer(); 432 433 /** DMA done event */ 434 void dmaDone(DmaDoneEvent *event); 435 436 /** Called when it is time to render a pixel */ 437 void renderPixel(); 438 | 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 |
|
439 /** Start of frame event */ 440 EventWrapper<HDLcd, &HDLcd::startFrame> startFrameEvent; 441 442 /** End of frame event */ 443 EventWrapper<HDLcd, &HDLcd::endFrame> endFrameEvent; 444 445 /** Pixel render event */ 446 EventWrapper<HDLcd, &HDLcd::renderPixel> renderPixelEvent; --- 58 unchanged lines hidden --- | 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 --- |