I am using the rasbperry pi 3. I am working on an embedded project. I wrote some frame buffer initialization code, which seems to work since the color palette rectangle disappears and I get a black screen. However I have been unsuccessful at setting the value of a single pixel so far.
My goal is to get a white screen at the end, but I only get a black screen, I don't even see changes in the individual pixels.
I am using the 8th channel (property tags ARM->VC) to communicate with the mailbox, since it seems channel 1 is unreliable.
This is my structure:
struct temp
{
int size;
int request;
int tag1;
int buff_size1;
int val_length1;
int widthP;
int heightP;
int tag2;
int buff_size2;
int val_length2;
int widthV;
int heightV;
int tag3;
int buff_size3;
int val_length3;
int depth;
int tag4;
int buff_size4;
int val_length4;
int fb_ptr;
int fb_size;
int end;
};
Which is statically initialized as follows:
volatile temp t __attribute__ ((aligned (16)))=
{
.size = sizeof(temp),
.request = 0,
.tag1 = SET_PHYSICAL_WIDTH_HEIGHT,
.buff_size1 = 8,
.val_length1 = 8,
.widthP = 1024,
.heightP = 768,
.tag2 = SET_VIRTUAL_WIDTH_HEIGHT,
.buff_size2 = 8,
.val_length2 = 8,
.widthV = 1024,
.heightV = 768,
.tag3 = SET_DEPTH,
.buff_size3 = 4,
.val_length3 = 4,
.depth = 16,
.tag4 = ALLOCATE,
.buff_size4 = 8,
.val_length4 = 8,
.fb_ptr = 0,
.fb_size = 0,
.end = END,
};
And then I finally do:
void init_display()
{
write_to_mailbox((uint32_t) &t, (Channel)(PTAG_ARM_TO_VC));
for(int i=0; i<t.fb_size; i++)
{
*(volatile uint32_t *)(t.fb_ptr + i) = 0xFFFF;
}
}
I have been successful at blinking the ACT led so I think write_to_mailbox() works as intended, which is why I didn't post it here.