Draw pixels
Got VRAM frame buffer address from Video Core via MailBox protocol and drew 1920×1080 pixels. I found it’s very slow ~3-5 fps.
Then I changed it to 640×480 which made it faster but not 60fps.
I’ll need to initialize interrupts & use timer and add fonts to show FPS tomorrrow.
Buffer address specified by MailBox’s property-tag protocol should be 16 byte aligned since the least 4 bits are used to specify tag (7 for ARM to VC, 8 for VC to ARM) like this.
struct FramebufferRequest {
uint32_t size;
uint32_t bufferRequestResponseCode;
// Set_Physical_Display
uint32_t tag_setPd;
uint32_t size_setPd;
uint32_t rr_setPd;
uint32_t width_setPd;
uint32_t height_setPd;
...
} fbRequest __attribute__((aligned(16)));
Today’s code: https://github.com/sokoide/rpi-baremetal -> 003_screen.
