Hi,

(re-adding the list)

On 05/05/17 05:49, Pajeet Gurav wrote:
> thank you so much andre! I guess I'll just mooch the code off the
> u-boot sources and write simple pixel writing routines using that.

Well, as I said below I don't think this is a good idea. Can't you just
use U-Boot's framebuffer? Please note that U-Boot sets up everything for
you, in a pretty portable manner (so a new SoC or board would look the
same to your OS). Once this is set up, the DE2 and HDMI controller keep
running (as long as you don't mess with their clocks) and continuously
scan out the framebuffer to the screen.
All you need to do is do read out the simplefb node from the DT.
If you don't want or can't use the DT, you could as well hardcode that
information: the framebuffer address itself is probably a constant in
U-Boot and you might be able to read out the resolution from some HDMI
or DE2 register.

Once you know the address, resolution and colour encoding, you can
easily code your pixel routines. You should be able to easily give this
a try: just look up the framebuffer address and write something into
that area.

This approach saves your from writing a lot of tedious, fragile and
boring code (for instance EDID parsing), and allows you to just go ahead
with graphics on the screen.
If you go ahead with your idea, you probably end up with code that works
on the A64 only, and with your HDMI monitor only (and not other monitors
or interfaces).

Cheers,
Andre.

> On Tue, May 2, 2017 at 1:20 PM, Andre Przywara <[email protected]> wrote:
>> Hi,
>>
>> On 02/05/17 08:25, Pajeet Gurav wrote:
>>> Hello, I'm trying to write a hobby operating system and I would like to
>>> find at what address the A64 framebuffer resides and how to initialize
>>> the graphics engine to perform such a function, I only need to be able
>>> to pixels on the screen, thanks
>>
>> If you use U-Boot as your boot loader, that's fairly simple, as you can
>> rely on the simple-framebuffer mechanism. Recent patches (which are
>> queued in u-boot-sunxi/master already, see the patches from Jernej [1])
>> do what you want: The code initialises the Allwinner DE2 display engine
>> and the HDMI controller. The framebuffer is then situated in DRAM and
>> the address of that (which is configurable) is put into the simplefb DT
>> node.
>> Whatever you write into this memory, appears on the screen. The DT node
>> tells you about the colour encoding and the resolution as well.
>>
>> Setting up the DE2 and the HDMI controller is not trivial and I'd
>> recommend against doing that yourself in your OS code. There is quite
>> something to do (complex clock setup, EDID configuration, HDMI output
>> setup) and most of that is not well documented (if at all).
>>
>> Cheers,
>> Andre.
>>
>> [1] http://git.denx.de/?p=u-boot/u-boot-sunxi.git;a=shortlog
>>

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to