/* Get pitch */ mbox[30] = MBOX_TAG_GET_PITCH; mbox[31] = 4; mbox[32] = MBOX_TAG_REQ; mbox[33] = 0; // res: bytes per line
mbox[34] = MBOX_TAG_LAST;
// this might not return exactly what we asked for, could be // the closest supported resolution instead if (mbox_call(MBOX_CH_PROP) && mbox[20] == 32 && mbox[28] != 0) { mbox[28] &= 0x3FFFFFFF; // convert GPU address to ARM address width = mbox[5]; // get actual physical width height = mbox[6]; // get actual physical height pitch = mbox[33]; // get number of bytes per line isrgb = mbox[24]; // get the actual channel order fb = (void *)((unsignedlong)mbox[28]); } else { uart_printf("Unable to set screen resolution to 1024x768x32\n"); } }