Drawing triangles on Raspberry PI.
Posted: Thu Sep 25, 2014 5:21 pm
Oh, it's been a long time since my last post. First of all I want to thank you all on the forum for your precious help in the past. I was 14 when I joined the forum and I was a true pest. Here I finally understood how the pointer dereferencing operator works. All the way up to having a self-compiling OS with gcc, smp, acpi and a network stack (all my AWWWW YEAH moments)
I have received some RTFM and STFW, I deserved them and I learned to think and search a thousand times before posting. And this time I did it, I really did.
So, what am I looking for today?
I recently bought a Raspberry PI (shipped, still not received). Fascinated by the infinite possibilities, the little OSDever buried inside me rise again.
Just before clicking the "Complete Purchase" button I read an article by Broadcom, declaring that the R-PI is the only 100% open source computer.
My first thought was to the GPU: maybe I can finally draw a rotating 3D cube without having to draw every single pixel using REP STOSB?
I've looked all over the web. I downloaded and quickly read the available documentation out there:
1) the official BCM2835 chip documentation (just a list of memory mapped IO registers and some other fuzz), no mention of the GPU.
2) the official VideoCore IV documentation. Another bunch of registers and the Control Lists, the way to tell the GPU to do things. (still no mention - at first sight - on how to get to the right resolution, how to enable the HDMI port instead of the composite, etc.)
3) https://github.com/hermanhermitage/videocoreiv a GitHub documentation project about the R-PI GPU details (could be useful if complete)
I downloaded the official VideoCore IV driver for Android, but the lack of comments and poor naming made the code pretty useless (still, I didn't read it thoroughly).
I downloaded through the Wayback Machine the source code of DexOs who claimed of having the HDMI working, but still I could only find the old boring way of doing the "Painter Algorithm" drawing each pixel "by hand".
All other hobby OS out there just claim of having a pointer to the FB and again, they just put raw colors there. All of them use a mysterious "mailbox" (to obtain the FB address and resolution details) I could find no mention about on both the official specs (except for an IRQ number). No specification, no protocol, no registers.
Still, no apparent mention anywhere on "how to tell the GPU to draw a f******g triangle". (Control Lists maybe? Still how do I communicate them to the GPU?)
Now, I don't consider myself an expert in English reading, but man, I made it through the ACPI specification. These are just ~120 pages long (and tables most of the time).
I'm pretty sure I have not missed them. I've used some synonyms during the search. I've jumped back and forth for a week all over the web for these piece of informations.
Sure I could find my way reading source codes with more attention, but wasn't this meant to be a 100% open source platform?
So here are my questions:
1) Are those all the source of informations about the inner details of the R-PI?
2) Really it is not documented anywhere how to work with the GPU in a hardware accelerated fashion?
3) Did you try this way and if you succeeded, can you point me to your source of documentation?
4) Given that the Linux driver for the gpu is the only complete and reliable source of documentation (cryptic, but working), can you tell me where to find the code that actually does the rendering?
5) Is all this worth it? Or am I better to just put colors on the frame buffer?
As always, thanks in advance.
I have received some RTFM and STFW, I deserved them and I learned to think and search a thousand times before posting. And this time I did it, I really did.
So, what am I looking for today?
I recently bought a Raspberry PI (shipped, still not received). Fascinated by the infinite possibilities, the little OSDever buried inside me rise again.
Just before clicking the "Complete Purchase" button I read an article by Broadcom, declaring that the R-PI is the only 100% open source computer.
My first thought was to the GPU: maybe I can finally draw a rotating 3D cube without having to draw every single pixel using REP STOSB?
I've looked all over the web. I downloaded and quickly read the available documentation out there:
1) the official BCM2835 chip documentation (just a list of memory mapped IO registers and some other fuzz), no mention of the GPU.
2) the official VideoCore IV documentation. Another bunch of registers and the Control Lists, the way to tell the GPU to do things. (still no mention - at first sight - on how to get to the right resolution, how to enable the HDMI port instead of the composite, etc.)
3) https://github.com/hermanhermitage/videocoreiv a GitHub documentation project about the R-PI GPU details (could be useful if complete)
I downloaded the official VideoCore IV driver for Android, but the lack of comments and poor naming made the code pretty useless (still, I didn't read it thoroughly).
I downloaded through the Wayback Machine the source code of DexOs who claimed of having the HDMI working, but still I could only find the old boring way of doing the "Painter Algorithm" drawing each pixel "by hand".
All other hobby OS out there just claim of having a pointer to the FB and again, they just put raw colors there. All of them use a mysterious "mailbox" (to obtain the FB address and resolution details) I could find no mention about on both the official specs (except for an IRQ number). No specification, no protocol, no registers.
Still, no apparent mention anywhere on "how to tell the GPU to draw a f******g triangle". (Control Lists maybe? Still how do I communicate them to the GPU?)
Now, I don't consider myself an expert in English reading, but man, I made it through the ACPI specification. These are just ~120 pages long (and tables most of the time).
I'm pretty sure I have not missed them. I've used some synonyms during the search. I've jumped back and forth for a week all over the web for these piece of informations.
Sure I could find my way reading source codes with more attention, but wasn't this meant to be a 100% open source platform?
So here are my questions:
1) Are those all the source of informations about the inner details of the R-PI?
2) Really it is not documented anywhere how to work with the GPU in a hardware accelerated fashion?
3) Did you try this way and if you succeeded, can you point me to your source of documentation?
4) Given that the Linux driver for the gpu is the only complete and reliable source of documentation (cryptic, but working), can you tell me where to find the code that actually does the rendering?
5) Is all this worth it? Or am I better to just put colors on the frame buffer?
As always, thanks in advance.