ubb-vga "double" mode

Werner Almesberger werner at almesberger.net
Mon Apr 25 07:02:41 EDT 2011


David Kuehling wrote:
> Just wondering: why do you have to use pddatc/pddats pairs?

That's a quirk/feature of the Ingenic architecture: you can't "write
a value to a port" as you would do on most other architectures, but
can only set or clear bits in a single operation.

This is nice in cases where you share a port with other drivers,
because you don't need a read-modify-write operation (and perhaps
locking) to preserve their pins, but it makes the kind of output we
need for VGA a little awkward to implement.

There are two issues: 1) that each value change needs up to two
writes, one to set bits, and another to clear bits. 2) that the
setting and the clearing don't happen at the same time, so if you'd
have, for example, a red-to-green transition, you'd either have
red-yellow-green (set before clear) or red-black-green (clear before
set).

> I'd imagine that you could read pddat once per line,

Oh, I'd just remember my old value. Reading a register access is
about 24 times faster (at a guess) than reading a GPIO ;-)

> Won't this possibly double pixel resolution?  Side-effect would be that
> other pins on Port D couldn't be reliably updated by the kernel, but how
> important is that (when you already disabled interrupts anyway :)

Would be nice if Ingenic had implemented a toggle operation as
well.

*pdxor = *p++;	/* I wish ... */

- Werner




More information about the discussion mailing list


interactive