- ubb-vga.c (ben_setup, setup_noirq): moved calls to disable_lcd and
get_timer to setup_noirq
- ubb-vga.c (cleanup, cleanup_noirq): moved calls to release_timer
and enable_lcd to cleanup_noirq
- ubb-vga.c (cleanup, main): "cleanup" is now empty; removed it
- vga-ben.pro, vga-ben.sch, vga-ben.cmp, vga-ben.pro: similar to
ubb-vga.sch, but with R and Y swapped (for better grounding), the VGA
connector replaced by solder pads, and added pads for the shield
- Makefile (schp, brd): new targets for editing vga-ben
First, we extend all deadlines a litte to make sure we never have to
wait negative time. Second, we get the timer value at the end of the
wait and CPU-loop for the difference between the actual value and the
ideal (extended) value.
- ubb-vga.c (mode_db): added new mode "640x480/61"
- ubb-vga.c (setup, line): MSC_CLKRT is reset when the MSC resets. Moved
it from "setup" to "line".
- ubb-vga.c (clkrt, setup, line): pick the highest available MSC clock
and adjust the bus clock divider accordingly
- ubb-vga.c (main): added commented-out clock debugging output
- README: added XEN-1510T result for "640x480/61"
Two benefits:
1) We don't accumulate errors from the delay between the timer reset and
the deadline preceding it
2) In the future, we may use WAIT to wait for timer expiration, which
should cause less bus activity and is should also reduce jitter
- regs4740.h (TFR. TFSR, TFCR, TDHR): added more timer registers
- ubb-vga.c (until): renamed to "delay" and changed to measure relative
to the last deadline
- ubb-vga.c (line, hdelay, frame): replaced "until" with "delay"
- ubb-vga.c (hdelay, frame, session): reset the timer only once, at
the beginning of the session
- ubb-vga.c (frame): we didn't wait for the horizontal back porch of
the last image line
This caused 800x600 images to be cut off, because the line length is
not a multiple of 64 bytes.
- ubb-vga.c (session): make the allocation a multiple of the DMA
transfer size
- ubb-vga.c (line): round number of transfers up instead of down
- ubb-vga.c (mode_db): line duration of 800x600/54 was a bit to short
- ubb-vga.c (line): send a 0 word at the end of the line, to avoid
overscan (we use PIO to synchronize with CPU timing)
- ubb-vga.c (mode_db): updated line length of 640x480 resolutions for
correct termination
- ubb-vga.c (KEY_MASK): KEYINx lines on port D
- ubb-vga.c (session): run until keypress if the number of frames is
zero
- ubb-vga.c (main): set frames to zero if omitted
This is tricky: if we just make "mode" global, the whole timing may
fall apart, with the DMA locking up. So let's take small bisectable
steps to get there ...
- ubb-vga.c (struct mode), ubb-vga.h: moved mode entry declaration to
ubb-vga.h
- ubb-vga.c (mode_db): moved up
- tstimg.c (printc): added diagonal to '0' (zero) to distinguish it from
'O' (oh)
- tstimg.c (printc): added "nose" to '1' to better distinguish it from
'I'
- tstimg.c (printc): completed the alphabet
- tstimg.c (printc): added '.' character
- ubb-vga.c (setup_noirq, line): moved DMA channel command setting to
per-session setup
- ubb-vga.c (setup_noirq, line): moved DMA request type setting to
per-session setup
- ubb-vga.c (line): added commend that the target address needs to be
set for each transfer, even if it doesn't change
Note that DMA is very sensitive to the video timing. At the moment,
only 800x600 mode works without locking up the DMA controller.
- ubb-vga.c (DMA, setup_noirq, cleanup_noirq, line): replaced MMC PIO
with DMA
- ubb-vga.c (frame): pass physical addresses to "line"
- ubb-vga.c (frame): detect if the DMA controller is stuck
- ubb-vga.c (ben_setup): use REG_WINDOW instead of calculating the
window size
- ubb-vga.c (PAGE_SIZS): we no longer need it - removed
- ubb-vga.c (line): shift bus width setting in MSC_CMDAT by the field
position, not the bit position
- ubb-vga.c (line): moved comment detailing the search for the
adjustment value to the mode database, so that we don't clutter
this function
- regs4740.h (REG_PADDR): translate a register access to the
corresponding physical address
- regs4740.h (REG_WINDOW): added register window size
- regs4740.h (CGU, INT, TCU, GPIO, MSC): prefix register group macros
with an underscore, to avoid name collision with DMAC
- regs4740.h: added DMAC registers
- regs4740.h (MSC_NOP): should be MSC_NOB
- physmem.c (calloc_phys_vec): malloc the vector instead of sbrk'ing it
- ubb-vga.h (xlat_virt), physmem.c (xlat_one, xlat_virt): translate a
vector of virtual addresses to physical addresses
- physmem.c (align_sbrk): align the end of the data segment
- physmem.c (calloc_phys_vec): align the line pointer vector to a machine
word, just in case
- physmem.c (calloc_phys_vec): crudely align the line buffers within
pages, to avoid page-crossing within a line (yes, this does reduce
noise)
The indirection introduced with the non-contiguous frame buffer caused
significant horizontal distortions. We can compensate for them by
starting the timer before loading the line pointer and calling "line".
- ubb-vga.h (calloc_phys_vec), physmem.c: non-contiguous memory allocator
(for now, without really considering any mapping to physical memory)
- Makefile (OBJS): added physmem.o
- ubb-vga.h (grabfb), grabfb.c (grabfb): API change for non-contiguous
frame buffer
- ubb-vga.h (ppmimg), ppmimg.c (convert, ppmimg): API change for
non-contiguous frame buffer
- ubb-vga.h (tstimg), tstimg.c (pixel, color_bars, grill, grid, sides,
dot, line45, arc, printc, text, ctext, tstimg): API change for
non-contiguous frame buffer
- tstimg.c (tstimg): we no longer need to clear the frame buffer
- ubb-vga.c (frame, session, main): use a vector of line buffers instead
of a contiguous frame buffer
- ubb-vga2.c (XREs, YRES, res, res_db, setup, line, hdelay, frame,
session): replaced hard-coded display characteristics with a mode
database
- ubb-vga2.c (usage, main): new option -m to select the display mode
- ubb-vga2.c (session): allocate frame buffer dynamically
- ubb-vga2.c (session): since we no longer prefetch, we don't need to
allocate space beyond the end of the frame buffer
- ubb-vga2.c (line): resurrected "quick load" and extended it to fill the
FIFO completely
- regs4740.h: macros to access selected Jz4740 registers
- ubb-vga2.c: replaced all pointers to registers with access macros
- ubb-vga2.c (line_cycles): we now seem to be 0.1 us slower
- ubb-vga2.c (line): write the first word to the TX FIFO after starting
the command or it is lost
- ubb-vga2.c (line): fetch the first word while waiting for the back
porch, making sure we have plenty of time for cache effects
- ubb-vga2.c (line): we no longer need to prefetch the first word of
the next line
- ubb-vga.h (ccube_init, ccube_map), ccube.c: color mapper based on
proximity in color cube
- grabfb.c (pattern, grabfb), ppmimg.c (pattern, convert): use the color
cube mapper instead of inferios threshold-based mapping
- ubb-vga2.c (session): initialize the color cube
- ubb-vga.h (thres), grabfb.c (thres), ubb-vga2.c (usage, main): removed
the threshold along with the option (-l) to set it
- Makefile (OBJS): added ccube.o