hdlcd.cc (9646:7a0c51f14095) | hdlcd.cc (9648:f10eb34e3e38) |
---|---|
1/* 2 * Copyright (c) 2010-2013 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 --- 268 unchanged lines hidden (view full) --- 277 CommandReg new_command; 278 new_command = data; 279 if (new_command.enable != command.enable) { 280 DPRINTF(HDLcd, "HDLCD switched %s\n", 281 new_command.enable==0 ? "off" : "on"); 282 if (new_command.enable) { 283 doUpdateParams = true; 284 if (!frameUnderway) { | 1/* 2 * Copyright (c) 2010-2013 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 --- 268 unchanged lines hidden (view full) --- 277 CommandReg new_command; 278 new_command = data; 279 if (new_command.enable != command.enable) { 280 DPRINTF(HDLcd, "HDLCD switched %s\n", 281 new_command.enable==0 ? "off" : "on"); 282 if (new_command.enable) { 283 doUpdateParams = true; 284 if (!frameUnderway) { |
285 schedule(startFrameEvent, nextCycle()); | 285 schedule(startFrameEvent, clockEdge()); |
286 } 287 } 288 } 289 command = new_command; } 290 break; 291 case Pixel_Format: 292 pixel_format = data; 293 DPRINTF(HDLcd, "HDLCD res = %d x %d\n", width(), height()); --- 215 unchanged lines hidden (view full) --- 509 pixelBufferSize = 0; 510 } else { 511 // did we underrun on this set of pixels? 512 if (pixelBufferSize < bytesPerPixel() * count) { 513 warn("HDLcd controller buffer underrun\n"); 514 frameUnderrun = true; 515 int_rawstat.underrun = 1; 516 if (!intEvent.scheduled()) | 286 } 287 } 288 } 289 command = new_command; } 290 break; 291 case Pixel_Format: 292 pixel_format = data; 293 DPRINTF(HDLcd, "HDLCD res = %d x %d\n", width(), height()); --- 215 unchanged lines hidden (view full) --- 509 pixelBufferSize = 0; 510 } else { 511 // did we underrun on this set of pixels? 512 if (pixelBufferSize < bytesPerPixel() * count) { 513 warn("HDLcd controller buffer underrun\n"); 514 frameUnderrun = true; 515 int_rawstat.underrun = 1; 516 if (!intEvent.scheduled()) |
517 schedule(intEvent, nextCycle()); | 517 schedule(intEvent, clockEdge()); |
518 } else { 519 // emulate the pixel read from the internal buffer 520 pixelBufferSize -= bytesPerPixel() * count; 521 } 522 } 523 524 // the DMA may have previously stalled due to the buffer being full; 525 // give it a kick; it knows not to fill if at end of frame, underrun, etc 526 if (!fillPixelBufferEvent.scheduled()) | 518 } else { 519 // emulate the pixel read from the internal buffer 520 pixelBufferSize -= bytesPerPixel() * count; 521 } 522 } 523 524 // the DMA may have previously stalled due to the buffer being full; 525 // give it a kick; it knows not to fill if at end of frame, underrun, etc 526 if (!fillPixelBufferEvent.scheduled()) |
527 schedule(fillPixelBufferEvent, nextCycle()); | 527 schedule(fillPixelBufferEvent, clockEdge()); |
528 529 // schedule the next pixel read according to where it is in the frame 530 pixelIndex += count; 531 assert(pixelIndex <= width() * height()); 532 size_t x = pixelIndex % width(); 533 Tick nextEventTick = curTick(); 534 if (x == 0) { 535 // start of new line --- 56 unchanged lines hidden (view full) --- 592 // schedule another dma transaction if: 593 // - we're not done reading the frame 594 // - there is sufficient room in the pixel buffer for another transaction 595 // - another fillPixelBufferEvent is not already scheduled 596 const size_t targetTransSize = dmaBurstLength() * AXI_PORT_WIDTH; 597 if ((dmaCurAddr < dmaMaxAddr) && 598 (bytesFreeInPixelBuffer() + targetTransSize < PIXEL_BUFFER_CAPACITY) && 599 !fillPixelBufferEvent.scheduled()) { | 528 529 // schedule the next pixel read according to where it is in the frame 530 pixelIndex += count; 531 assert(pixelIndex <= width() * height()); 532 size_t x = pixelIndex % width(); 533 Tick nextEventTick = curTick(); 534 if (x == 0) { 535 // start of new line --- 56 unchanged lines hidden (view full) --- 592 // schedule another dma transaction if: 593 // - we're not done reading the frame 594 // - there is sufficient room in the pixel buffer for another transaction 595 // - another fillPixelBufferEvent is not already scheduled 596 const size_t targetTransSize = dmaBurstLength() * AXI_PORT_WIDTH; 597 if ((dmaCurAddr < dmaMaxAddr) && 598 (bytesFreeInPixelBuffer() + targetTransSize < PIXEL_BUFFER_CAPACITY) && 599 !fillPixelBufferEvent.scheduled()) { |
600 schedule(fillPixelBufferEvent, nextCycle()); | 600 schedule(fillPixelBufferEvent, clockEdge()); |
601 } 602} 603 604void 605HDLcd::serialize(std::ostream &os) 606{ 607 DPRINTF(HDLcd, "Serializing ARM HDLCD\n"); 608 --- 248 unchanged lines hidden --- | 601 } 602} 603 604void 605HDLcd::serialize(std::ostream &os) 606{ 607 DPRINTF(HDLcd, "Serializing ARM HDLCD\n"); 608 --- 248 unchanged lines hidden --- |