pl111.cc (9394:e88cf95d33d3) | pl111.cc (9395:bf428987f54e) |
---|---|
1/* 2 * Copyright (c) 2010-2012 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 --- 54 unchanged lines hidden (view full) --- 63 lcdRis(0), lcdMis(0), 64 clcdCrsrCtrl(0), clcdCrsrConfig(0), clcdCrsrPalette0(0), 65 clcdCrsrPalette1(0), clcdCrsrXY(0), clcdCrsrClip(0), clcdCrsrImsc(0), 66 clcdCrsrIcr(0), clcdCrsrRis(0), clcdCrsrMis(0), 67 pixelClock(p->pixel_clock), 68 vnc(p->vnc), bmp(NULL), width(LcdMaxWidth), height(LcdMaxHeight), 69 bytesPerPixel(4), startTime(0), startAddr(0), maxAddr(0), curAddr(0), 70 waterMark(0), dmaPendingNum(0), readEvent(this), fillFifoEvent(this), | 1/* 2 * Copyright (c) 2010-2012 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 --- 54 unchanged lines hidden (view full) --- 63 lcdRis(0), lcdMis(0), 64 clcdCrsrCtrl(0), clcdCrsrConfig(0), clcdCrsrPalette0(0), 65 clcdCrsrPalette1(0), clcdCrsrXY(0), clcdCrsrClip(0), clcdCrsrImsc(0), 66 clcdCrsrIcr(0), clcdCrsrRis(0), clcdCrsrMis(0), 67 pixelClock(p->pixel_clock), 68 vnc(p->vnc), bmp(NULL), width(LcdMaxWidth), height(LcdMaxHeight), 69 bytesPerPixel(4), startTime(0), startAddr(0), maxAddr(0), curAddr(0), 70 waterMark(0), dmaPendingNum(0), readEvent(this), fillFifoEvent(this), |
71 dmaDoneEvent(maxOutstandingDma, this), intEvent(this) | 71 dmaDoneEventAll(maxOutstandingDma, this), 72 dmaDoneEventFree(maxOutstandingDma), 73 intEvent(this) |
72{ 73 pioSize = 0xFFFF; 74 75 pic = simout.create(csprintf("%s.framebuffer.bmp", sys->name()), true); 76 77 const int buffer_size = LcdMaxWidth * LcdMaxHeight * sizeof(uint32_t); 78 dmaBuffer = new uint8_t[buffer_size]; 79 80 memset(lcdPalette, 0, sizeof(lcdPalette)); 81 memset(cursorImage, 0, sizeof(cursorImage)); 82 memset(dmaBuffer, 0, buffer_size); 83 | 74{ 75 pioSize = 0xFFFF; 76 77 pic = simout.create(csprintf("%s.framebuffer.bmp", sys->name()), true); 78 79 const int buffer_size = LcdMaxWidth * LcdMaxHeight * sizeof(uint32_t); 80 dmaBuffer = new uint8_t[buffer_size]; 81 82 memset(lcdPalette, 0, sizeof(lcdPalette)); 83 memset(cursorImage, 0, sizeof(cursorImage)); 84 memset(dmaBuffer, 0, buffer_size); 85 |
86 for (int i = 0; i < maxOutstandingDma; ++i) 87 dmaDoneEventFree[i] = &dmaDoneEventAll[i]; 88 |
|
84 if (vnc) 85 vnc->setFramebufferAddr(dmaBuffer); 86} 87 88Pl111::~Pl111() 89{ 90 delete[] dmaBuffer; 91} --- 361 unchanged lines hidden (view full) --- 453void 454Pl111::fillFifo() 455{ 456 while ((dmaPendingNum < maxOutstandingDma) && (maxAddr >= curAddr + dmaSize )) { 457 // concurrent dma reads need different dma done events 458 // due to assertion in scheduling state 459 ++dmaPendingNum; 460 | 89 if (vnc) 90 vnc->setFramebufferAddr(dmaBuffer); 91} 92 93Pl111::~Pl111() 94{ 95 delete[] dmaBuffer; 96} --- 361 unchanged lines hidden (view full) --- 458void 459Pl111::fillFifo() 460{ 461 while ((dmaPendingNum < maxOutstandingDma) && (maxAddr >= curAddr + dmaSize )) { 462 // concurrent dma reads need different dma done events 463 // due to assertion in scheduling state 464 ++dmaPendingNum; 465 |
461 assert(!dmaDoneEvent[dmaPendingNum-1].scheduled()); | 466 assert(!dmaDoneEventFree.empty()); 467 DmaDoneEvent *event(dmaDoneEventFree.back()); 468 dmaDoneEventFree.pop_back(); 469 assert(!event->scheduled()); |
462 463 // We use a uncachable request here because the requests from the CPU 464 // will be uncacheable as well. If we have uncacheable and cacheable 465 // requests in the memory system for the same address it won't be 466 // pleased 467 dmaPort.dmaAction(MemCmd::ReadReq, curAddr + startAddr, dmaSize, | 470 471 // We use a uncachable request here because the requests from the CPU 472 // will be uncacheable as well. If we have uncacheable and cacheable 473 // requests in the memory system for the same address it won't be 474 // pleased 475 dmaPort.dmaAction(MemCmd::ReadReq, curAddr + startAddr, dmaSize, |
468 &dmaDoneEvent[dmaPendingNum-1], curAddr + dmaBuffer, | 476 event, curAddr + dmaBuffer, |
469 0, Request::UNCACHEABLE); 470 curAddr += dmaSize; 471 } 472} 473 474void 475Pl111::dmaDone() 476{ --- 117 unchanged lines hidden (view full) --- 594 595 SERIALIZE_SCALAR(read_event_time); 596 SERIALIZE_SCALAR(fill_fifo_event_time); 597 SERIALIZE_SCALAR(int_event_time); 598 599 vector<Tick> dma_done_event_tick; 600 dma_done_event_tick.resize(maxOutstandingDma); 601 for (int x = 0; x < maxOutstandingDma; x++) { | 477 0, Request::UNCACHEABLE); 478 curAddr += dmaSize; 479 } 480} 481 482void 483Pl111::dmaDone() 484{ --- 117 unchanged lines hidden (view full) --- 602 603 SERIALIZE_SCALAR(read_event_time); 604 SERIALIZE_SCALAR(fill_fifo_event_time); 605 SERIALIZE_SCALAR(int_event_time); 606 607 vector<Tick> dma_done_event_tick; 608 dma_done_event_tick.resize(maxOutstandingDma); 609 for (int x = 0; x < maxOutstandingDma; x++) { |
602 dma_done_event_tick[x] = dmaDoneEvent[x].scheduled() ? 603 dmaDoneEvent[x].when() : 0; | 610 dma_done_event_tick[x] = dmaDoneEventAll[x].scheduled() ? 611 dmaDoneEventAll[x].when() : 0; |
604 } 605 arrayParamOut(os, "dma_done_event_tick", dma_done_event_tick); 606} 607 608void 609Pl111::unserialize(Checkpoint *cp, const std::string §ion) 610{ 611 DPRINTF(PL111, "Unserializing ARM PL111\n"); --- 84 unchanged lines hidden (view full) --- 696 if (read_event_time) 697 schedule(readEvent, read_event_time); 698 if (fill_fifo_event_time) 699 schedule(fillFifoEvent, fill_fifo_event_time); 700 701 vector<Tick> dma_done_event_tick; 702 dma_done_event_tick.resize(maxOutstandingDma); 703 arrayParamIn(cp, section, "dma_done_event_tick", dma_done_event_tick); | 612 } 613 arrayParamOut(os, "dma_done_event_tick", dma_done_event_tick); 614} 615 616void 617Pl111::unserialize(Checkpoint *cp, const std::string §ion) 618{ 619 DPRINTF(PL111, "Unserializing ARM PL111\n"); --- 84 unchanged lines hidden (view full) --- 704 if (read_event_time) 705 schedule(readEvent, read_event_time); 706 if (fill_fifo_event_time) 707 schedule(fillFifoEvent, fill_fifo_event_time); 708 709 vector<Tick> dma_done_event_tick; 710 dma_done_event_tick.resize(maxOutstandingDma); 711 arrayParamIn(cp, section, "dma_done_event_tick", dma_done_event_tick); |
712 dmaDoneEventFree.clear(); |
|
704 for (int x = 0; x < maxOutstandingDma; x++) { 705 if (dma_done_event_tick[x]) | 713 for (int x = 0; x < maxOutstandingDma; x++) { 714 if (dma_done_event_tick[x]) |
706 schedule(dmaDoneEvent[x], dma_done_event_tick[x]); | 715 schedule(dmaDoneEventAll[x], dma_done_event_tick[x]); 716 else 717 dmaDoneEventFree.push_back(&dmaDoneEventAll[x]); |
707 } | 718 } |
719 assert(maxOutstandingDma - dmaDoneEventFree.size() == dmaPendingNum); |
|
708 709 if (lcdControl.lcdpwr) { 710 updateVideoParams(); 711 if (vnc) 712 vnc->setDirty(); 713 } 714} 715 --- 28 unchanged lines hidden --- | 720 721 if (lcdControl.lcdpwr) { 722 updateVideoParams(); 723 if (vnc) 724 vnc->setDirty(); 725 } 726} 727 --- 28 unchanged lines hidden --- |