1
0
mirror of git://projects.qi-hardware.com/ben-blinkenlights.git synced 2024-11-19 06:56:16 +02:00
Commit Graph

19 Commits

Author SHA1 Message Date
Werner Almesberger
4b59dbf062 ubb-vga: express mode data in more common units and remove hard-coded constants
- ubb-vga.h (struct mode), ubb-vga.c (mode_db): replaced hsync_end with
  its constituends hsync_cycles and hback_cycles
- ubb-vga.h (struct mode), ubb-vga.c (mode_db): added vsync_lines,
  vfront_lines, and vback_lines
- ubb-vga.h (struct mode): changed "line_cycles" from "int" to
  "uint16_t"
- ubb-vga.c (line): don't hard-code horizontal back porch
- ubb-vga.c (line): don't hard-code sum of horizontal back porch and
  hsync
- ubb-vga.c (hdelay): don't hard-code hsync
- ubb-vga.c (frame): don't hard-code vsync and the vertical porches
- ubb-vga.c (frame): don't hard-code hsync and horizontal back porch
2011-05-01 20:59:38 -03:00
Werner Almesberger
aa2fc7101d ubb-vga.c (mode_db): added 1024x768, 53 Hz mode (56 MHz pixel clock) 2011-05-01 18:55:29 -03:00
Werner Almesberger
934a89bfa5 ubb-vga: added quick and dirty run-until-keypress mode
- 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
2011-05-01 16:41:32 -03:00
Werner Almesberger
eabd0b53f6 ubb-vga: make mode information global
- ubb-vga.c (mode), ubb-vga.h: made global
2011-05-01 15:17:30 -03:00
Werner Almesberger
f7eb220401 ubb-vga: gently prepare the code for sharing mode information
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
2011-05-01 15:17:01 -03:00
Werner Almesberger
90b087cea0 ubb-vga.c (struct mode, mode_db): removed no longer used field "line_words" 2011-05-01 14:47:16 -03:00
Werner Almesberger
9fb5c6f3f4 ubb-vga.c: moved some DMA settings from per-line to per-session setup
- 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
2011-05-01 13:54:54 -03:00
Werner Almesberger
b273f27c07 ubb-vga.c: DMA was set to transfer twice the amount needed, oops
- ubb-vga.c (line): removed unnecessary DMA channel reset
- ubb-vga.c (line): number of words is pixels/64, not pixels/32
2011-05-01 13:22:08 -03:00
Werner Almesberger
a8a0cfa22f ubb-vga.c: added (fragile) DMA support (locks up on anything but 800x600)
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
2011-05-01 12:22:23 -03:00
Werner Almesberger
64f3047144 ubb-vga.c: cleaned up setup process and prepared for DMA
- ubb-vga.c (setup): made "static"
- ubb-vga.c (setup_noirq, cleanup_noirq, session): added functions for
  setup tasks to perform with interrupts off
2011-04-29 22:48:01 -03:00
Werner Almesberger
8d803dda4c ubb-vga.c: housekeeping
- 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
2011-04-29 22:22:51 -03:00
Werner Almesberger
3a8e062c48 renamed ubb-vga.c to ubb-vga-old.c, ubb-vga2.c to ubb-vga.c; updated Makefile 2011-04-29 14:03:07 -03:00
Werner Almesberger
a794c4b1b2 ubb-vga: avoid diodes; redesign for luminance bit (Y) and MMC controller
- ubb-vga.sch: use resistive divider instead of diodes
- ubb-vga.sch, ubb-vga.c (VSYNC): moved VSYNC from DAT3 to CLK to make
  all MMC data lines available for pixel data
- ubb-vga.sch, ubb-vga.c (R): moved red from DAT2 to DAT3 for convenient
  access to the 4th channel
- ubb-vga.sch: added luminance (Y) channel
- ubb-vga.sch: added pull-down to HSYNC/CMD, for later use with the MMC
  controller
- ubb-vga.c (pdfuns, pdfunc, ben_setup, setup): make UBB signals GPIOs,
  in case someone left them in a different configuration
2011-04-27 16:48:07 -03:00
Werner Almesberger
67107d0062 ubb-vga: option -d to double the number of set/clear pairs, improving resolution
- README: added compatibility of double mode
- ubb-vga.c (usage, main): new option -d to double the number of set/clear
  pairs (making lines longer and the apparent pixel clock slower)
- ubb-vga.c (grab, session, main): have a complete set/clear pair for each
  pixel in double mode
2011-04-24 21:09:50 -03:00
Werner Almesberger
dab839ab66 ubb-vga.c: moved line length and timing to variables
- ubb-vga.c (line_pairs, line, frame, tricolor, grid, session): line
  length is now kept in a variable, instead of hard-coding its value
  and the values derived from it
- ubb-vga.c (line_cycles, line, hdelay): the total line duration is now
  kept in a variable, instead of hard-coding it all over the place
2011-04-24 20:01:12 -03:00
Werner Almesberger
dae21696b3 ubb-vga.c: a bit more cleanup
- ubb-vga.c: added more section titles
- ubb-vga.c (pick, pattern): grouped pixel-generating functions with
  image generation
- ubb-vga.c (usage, main): properly parse command-line options ("getopt"
  is a bit of overkill at the moment but will be needed later)
2011-04-24 19:43:26 -03:00
Werner Almesberger
554c6645d8 ubb-vga.c: removed unused #defines and rearranged the code a little 2011-04-24 12:12:36 -03:00
Werner Almesberger
8bd7199d9e ubb-vga.c: removed commented-out code from earlier experiments
The history of the split prefetch code:

Once up on a time, I thought that it was important to stay very close
to the "official" pixel clock. We could do this when copying 32 bit
words from cache to the GPIO set/clear registers, but not when
shifting 8 bit values as we do now.

One problem with 32 bit values is that transferring that amount of
data exceeds the time available in the hsync pulse. Hence the idea
to split the prefetch between hsync pulse and horizontal front porch.

Note that we also split prefetches between the two VGA lines of each
QVGA line. This commit does not change that mechanism.

- ubb-vga.c (line, frame): removed code fragments for prefetch split
  between hsync pulse and front porch
- ubb-vga.c (line, frame): remove code fragments for measuring time
  relative to the rising edge of hsync (and letting the prefetch time
  control the hsync length), not the falling edge
2011-04-24 11:48:32 -03:00
Werner Almesberger
3b7a7caec1 renamed "video" to ubb-vga 2011-04-24 02:56:56 -03:00