timvideos / linux-litex

Linux Kernel designed to run on the HDMI2USB-misoc-firmware with or1k arch.
Other
2 stars 0 forks source link

Write a framebuffer driver for LiteVideo #8

Open mithro opened 7 years ago

mithro commented 7 years ago

Should be as simple as allocating a couple of buffers in memory and then setting the correct CSR registers.

mithro commented 7 years ago

http://lxr.free-electrons.com/source/Documentation/devicetree/bindings/display/connector/hdmi-connector.txt

  1 HDMI Connector
  2 ==============
  3 
  4 Required properties:
  5 - compatible: "hdmi-connector"
  6 - type: the HDMI connector type: "a", "b", "c", "d" or "e"
  7 
  8 Optional properties:
  9 - label: a symbolic name for the connector
 10 - hpd-gpios: HPD GPIO number
 11 - ddc-i2c-bus: phandle link to the I2C controller used for DDC EDID probing
 12 
 13 Required nodes:
 14 - Video port for HDMI input
 15 
 16 Example
 17 -------
 18 
 19 hdmi0: connector@1 {
 20         compatible = "hdmi-connector";
 21         label = "hdmi";
 22 
 23         type = "a";
 24 
 25         port {
 26                 hdmi_connector_in: endpoint {
 27                         remote-endpoint = <&tpd12s015_out>;
 28                 };
 29         };
 30 };
mithro commented 7 years ago

http://lxr.free-electrons.com/source/Documentation/devicetree/bindings/display/simple-framebuffer.txt

mithro commented 7 years ago

Reply from Dave Airlie when I asked him how to go about this;

How would you recommend we go about creating a driver? I assume there should be fairly dumb framebuffer driver we could modify? Is there any documentation we should be following?

So ignore the fbdev layer at this stage, if you want to submit anything upstream.

At this point the state of the art it is possibly tinydrm

https://01.org/linuxgraphics/gfx-docs/drm/gpu/tinydrm.html

I think that should be enough for your needs, to write a small driver to start off.

Should we maybe we should start with something like statically allocating memory for the framebuffer and using the "simple-framebuffer" driver? I've also seen things about a "tiny-drm" and a "simple-drm"?

Using CMA is pretty trivial and should cover the case.

mithro commented 7 years ago

Dave suggested this would be a good driver to copy https://lists.freedesktop.org/archives/dri-devel/2017-April/138714.html