News for hackers. Stuff that matters.
Re:Exploring FPGA Graphics by amelius on Monday September 12, 2022 @07:24AM (#32808511)
Why are we still generating video signals as if there is a CRT on the other end?

E.g. we could save power by only sending parts of the display image that change.

Re:Exploring FPGA Graphics by ChuckNorris89 on Monday September 12, 2022 @07:35AM (#32808609)
Have you writing an spec compatibile HDMI/DP controller in HDL? It's insanely complex.

VGA is a walk in the park that's sane and easy to understand for beginners. You just need to modulate the 3 primary colors between 0-255 for 8 bit color, and two clock signals, and the monitor will display a picture.

VGA is also very simple to debug since as long as there's some signal on the color and clock lines, the monitor will display something allowing you visually see what's wrong, while on digital, if some part of the handshake failed, you get no picture on the monitor so there's no way to figure out what's wrong without specialized knowledge and equipment.

A CRT is basically it's own oscilloscope of the signals on the VGA cable making development a joy.

Re:Exploring FPGA Graphics by garaetjjte on Monday September 12, 2022 @10:11AM (#32810539)
DVI is almost literally digitized VGA, with analog signals replaced by differential signalling and symbol encoding to keep it DC-balanced. HDMI extends it by encoding audio and extra metadata (eg. used colorspace) inside blanking intervals (yes, they still use blanking intervals that were originally required for CRT displays). It doesn't do any handshake. Main difficulty is just high clocks required, and necessity to dynamically pick symbols (unless you only use few preselected DC-balanced values). DisplayPort and HDMI 2.1 are different, with packet-based transmission.
Re:Exploring FPGA Graphics by tverbeure on Monday September 12, 2022 @01:56PM (#32814216)
> It doesn't do any handshake.

HDMI 2.0 requires bidirectional communication between source and sink through SCDC registers to set parameters such as scramble_enable, clock ratio, and to read status flags such as clock detection, channel lock status, bit error rates etc.

Re:Exploring FPGA Graphics by NextHendrix on Monday September 12, 2022 @07:43AM (#32808679)
I think from a hardware perspective this would be non-trivial, despite sounding like an obvious thing in principle.

In sending the entire frame with every refresh you get pixel addressing "for free", since you just send the data for each pixel sequentially in a predefined order. If you only wanted to update a single pixel, you would need to effectively send an instruction saying "set pixel x to rgb: a, b, c" or whatever, including both the pixel colour values and the pixel address. You'd also need some sort of edge detection for when a pixel is supposed to change which adds a delay.

This is fine for one pixel, but if every pixel on the screen changes at once then suddenly you are going to be sending a hell of a lot of instructions that not only contain the colour values as in the "old crt style" method, but also the address of every individual pixel too, which will then have to be decoded by the screen-side hardware.

All in all, you'll be using a lot more bandwidth and will need a much faster clock to do all of that in the same period of time. In the old school way, you just have a pixel clock that matches the pixel rate and some serdes for serialisation/deserialisation on each end which imo is considerably simpler.

Re:Exploring FPGA Graphics by scoutt on Monday September 12, 2022 @09:08AM (#32809569)
If you don't send the entire buffer then a monitor should have at least 6220800 bytes of RAM dedicated to the frame buffer (1920x1080 resolution), do auto refresh (standard 60Hz) on the panel, and accept commands to overwrite said memory with new data, partially or completely.

That solution is far from what we have now, and much more like a serial LCD controller.

Re:Exploring FPGA Graphics by amelius on Monday September 12, 2022 @09:52AM (#32810229)
I think people can come up with more efficient protocols than sending x,y,rgb for every pixel. What you call "edge detection" is not necessary if you use shadow buffers. Yes, the display would need some memory, but this is measured in tens of megabytes which is not much by today's standards.
Re:Exploring FPGA Graphics by tverbeure on Monday September 12, 2022 @02:07PM (#32814377)
* a sink side memory of tens of megabytes is either on-chip memory (very costly) or on-PCB DRAM (still costly). For high refresh rate monitors, the memory would need to be high BW too. Note that there aren't any modern memory standards that are high BW but low storage. DRAMs with just a capacity of just a few MB would be very much pad limited.

* source side, you'd need a shadow buffer as well, and you need double the read BW to detect the difference between previous and the current frame.

All of that is technically achievable, but none of it matter for desktop monitors: the power savings are just too low to matter.

Laptops are a different matter. Many laptop LCD panels already support self-refresh. (Google "Panel Self Refresh")

But that's for cases where the screen is static: the user is staring at the screen, not moving their mouse, the cursor is static. The benefit is not just putting the link but also putting the GPU to sleep.

That's the low hanging fruit. Partial screen update doesn't save a lot more, because you'd need to power up the GPU for that.

Re:Exploring FPGA Graphics by dahart on Monday September 12, 2022 @10:26AM (#32810797)
Seems like having memory embedded in the display for a shadow buffer, and the diffing algorithm you’re proposing, could easily undo any power savings you’d get, and then some. Why are you certain that saving power is simple? How much power does the data protocol consume compared to the display itself? Isn’t the data transmission power in the noise margin of the power requirements for an active display, CRT or LCD?
Re:Exploring FPGA Graphics by mschuster91 on Monday September 12, 2022 @07:49AM (#32808749)
VGA is incredibly easy to generate - you can do it via bitbanging (carefully turning on and off) GPIO pins on an Arduino [1], simply because the tolerances are insanely huge. A step above is SD-SDI [2], which uses less pins but has stricter requirements on timing, and equipment accepting SDI is usually only found in the professional-grade TV production space.

DVI, HDMI, DisplayPort or heaven forbid Thunderbolt are a hot mess - to generate a signal out of these without the usage of dedicated chips, you need a ton of logic and parts: output format negotiation, extremely strict timing requirements that completely rule out bitbanging, signal conditioning, specially shielded cables, shielded traces on the circuit board.

[1] https://hackaday.com/2014/06/10/640x480-vga-on-an-arduino/

[2] https://en.wikipedia.org/wiki/Serial_digital_interface

Re:Exploring FPGA Graphics by tyingq on Monday September 12, 2022 @08:12AM (#32808971)
It's limited, but there are demos of bitbanged DVI on fairly modest hardware, after some overclocking.

https://github.com/Wren6991/picodvi

Re:Exploring FPGA Graphics by mlindner on Monday September 12, 2022 @09:28AM (#32809875)
> Why are we still generating video signals as if there is a CRT on the other end?

Because it's extremely simple electronically. It was designed to be simple to work with very slow electronic hardware made of discrete components. So it's basically child's play to generate it with a modern FPGA as there are huge error bars even if you make some small mistakes.

Also blanking areas are still important because at the end of a pixel row there is still some amount of extra electronic stuff happening that is slightly slower than jumping to the next pixel. Even on LCDs or OLEDs.

Even 4K HDR HDMI 2.1 still has something akin to blanking intervals.

Re:Exploring FPGA Graphics by leeter on Monday September 12, 2022 @08:39AM (#32809230)
Because VGA is fundamentally an analogue standard built around how a CRT works. Each bit of the signal serves a very defined purpose based on how a CRT and thus a vacuum tube works. This is also why VGA is so crazy to do digital capture for, because there are a lot of things that are "VGA" that are well outside the IBM standard. Monitors don't often care because as long as they can adjust their pixel clock, something they can do based on detecting the blanking intervals, they can display the signal because CRTs don't fundamentally have a "resolution" they have "Dot pitch" which is different. But for a digital monitor like an LCD it has to detect and verify the stability of the signal, then try to decode it into something that makes sense. That can take multiple attempts to get right. Most hardware also makes assumptions based on the common resolutions because there is no resolution information... just blanking. So without EDID it can be a real challenge to deal with VGA capture. IIRC you can have multiple resolutions at approximately the same pixel clock because of how VGA works that's fine, a CRT doesn't care... but digital capture needs to know how many times per second to sample so it can make pixels.

https://en.wikipedia.org/wiki/Cathode-ray_tube#Construction_...

https://en.wikipedia.org/wiki/Video_Graphics_Array

https://en.wikipedia.org/wiki/Extended_Display_Identificatio...

Re:Exploring FPGA Graphics by royjacobs on Monday September 12, 2022 @07:39AM (#32808651)
The purpose of this site is to teach the fundamentals of creating graphics and having them show up on an external display. Driving a VGA signal is extremely straightforward compared to the complexity of HDMI. Generating an HDMI signal is arguably not the main goal of the site, so using VGA makes total sense imo.
Re:Exploring FPGA Graphics by WillFlux on Monday September 12, 2022 @07:51AM (#32808773)
The examples aren’t limited to VGA; I support four different outputs with these designs.

* VGA using a Pmod board (you could also create your own register ladder)

* DVI using the TI TFP410 on the DVI Pmod board

* DVI generated on FPGA with a Verilog TMDS encoder (no IC required)

* SDL simulation on a PC

DVI is a subset of HDMI, so works on modern TVs and monitors.

You can find the source on GitHub: https://github.com/projf/projf-explore/tree/main/graphics/fp...

Re:Exploring FPGA Graphics by ranger_danger on Monday September 12, 2022 @11:18AM (#32811660)
Displayport has two features that allow this, Panel-self-refresh and Panel Replay. Otherwise if you don't send the entire frame every sync cycle, the display will lose signal and go blank.
Re:Exploring FPGA Graphics by Sophistifunk on Monday September 12, 2022 @07:09PM (#32818528)
Because those systems are orders of magnitude simpler, without all the copy-protection and control-plane "features" in modern display systems.