Changeset 73abf49 in mainline for kernel/genarch/src/drivers/bcm2835/mbox.c
- Timestamp:
- 2021-06-22T19:36:32Z (3 years ago)
- Branches:
- master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 1b7b7af
- Parents:
- 034ce6bb
- git-author:
- Maurizio Lombardi <mlombard@…> (2021-06-22 19:21:17)
- git-committer:
- Maurizio Lombardi <mlombard@…> (2021-06-22 19:36:32)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/genarch/src/drivers/bcm2835/mbox.c
r034ce6bb r73abf49 86 86 } 87 87 88 bool bcm2835_fb_init(fb_properties_t *prop )88 bool bcm2835_fb_init(fb_properties_t *prop, uint32_t width, uint32_t height) 89 89 { 90 90 bcm2835_mbox_t *fb_mbox; … … 95 95 KM_NATURAL_ALIGNMENT, PAGE_NOT_CACHEABLE); 96 96 97 fb_desc->width = 640;98 fb_desc->height = 480;97 fb_desc->width = width; 98 fb_desc->height = height; 99 99 fb_desc->virt_width = fb_desc->width; 100 100 fb_desc->virt_height = fb_desc->height; … … 128 128 } 129 129 130 bool bcm2835_mbox_get_fb_size(uint32_t *w, uint32_t *h) 131 { 132 bool r; 133 MBOX_BUFF_ALLOC(msg, mbox_getfbsize_buf_t); 134 135 msg->buf_hdr.size = sizeof(mbox_getfbsize_buf_t); 136 msg->buf_hdr.code = MBOX_PROP_CODE_REQ; 137 msg->tag_hdr.tag_id = MBOX_TAG_GET_PHYS_W_H; 138 msg->tag_hdr.buf_size = sizeof(msg->body); 139 msg->tag_hdr.val_len = 0; 140 msg->zero = 0; 141 142 mbox_write((bcm2835_mbox_t *)BCM2835_MBOX0_ADDR, 143 MBOX_CHAN_PROP_A2V, KA2VCA((uint32_t)msg)); 144 mbox_read((bcm2835_mbox_t *)BCM2835_MBOX0_ADDR, 145 MBOX_CHAN_PROP_A2V); 146 147 r = msg->buf_hdr.code == MBOX_PROP_CODE_RESP_OK; 148 if (r) { 149 *h = msg->body.height; 150 *w = msg->body.width; 151 } 152 153 return r; 154 } 155 130 156 /** 131 157 * @}
Note:
See TracChangeset
for help on using the changeset viewer.