Deleted Added
full compact
bcm2835_mbox.c (290666) bcm2835_mbox.c (298383)
1/*-
2 * Copyright (c) 2012 Oleksandr Tymoshenko <gonzo@freebsd.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2012 Oleksandr Tymoshenko <gonzo@freebsd.org>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c 290666 2015-11-11 00:41:02Z gonzo $");
28__FBSDID("$FreeBSD: head/sys/arm/broadcom/bcm2835/bcm2835_mbox.c 298383 2016-04-20 22:38:00Z gonzo $");
29
30#include <sys/param.h>
31#include <sys/systm.h>
32#include <sys/bus.h>
33#include <sys/kernel.h>
34#include <sys/lock.h>
35#include <sys/module.h>
36#include <sys/mutex.h>

--- 433 unchanged lines hidden (view full) ---

470 int err;
471 struct msg_fb_get_w_h msg;
472
473 memset(&msg, 0, sizeof(msg));
474 msg.hdr.buf_size = sizeof(msg);
475 msg.hdr.code = BCM2835_MBOX_CODE_REQ;
476 BCM2835_MBOX_INIT_TAG(&msg.physical_w_h, GET_PHYSICAL_W_H);
477 msg.physical_w_h.tag_hdr.val_len = 0;
29
30#include <sys/param.h>
31#include <sys/systm.h>
32#include <sys/bus.h>
33#include <sys/kernel.h>
34#include <sys/lock.h>
35#include <sys/module.h>
36#include <sys/mutex.h>

--- 433 unchanged lines hidden (view full) ---

470 int err;
471 struct msg_fb_get_w_h msg;
472
473 memset(&msg, 0, sizeof(msg));
474 msg.hdr.buf_size = sizeof(msg);
475 msg.hdr.code = BCM2835_MBOX_CODE_REQ;
476 BCM2835_MBOX_INIT_TAG(&msg.physical_w_h, GET_PHYSICAL_W_H);
477 msg.physical_w_h.tag_hdr.val_len = 0;
478 BCM2835_MBOX_INIT_TAG(&msg.virtual_w_h, GET_VIRTUAL_W_H);
479 msg.virtual_w_h.tag_hdr.val_len = 0;
480 BCM2835_MBOX_INIT_TAG(&msg.offset, GET_VIRTUAL_OFFSET);
481 msg.offset.tag_hdr.val_len = 0;
482 msg.end_tag = 0;
483
484 err = bcm2835_mbox_property(&msg, sizeof(msg));
485 if (err == 0) {
486 fb->xres = msg.physical_w_h.body.resp.width;
487 fb->yres = msg.physical_w_h.body.resp.height;
478 msg.end_tag = 0;
479
480 err = bcm2835_mbox_property(&msg, sizeof(msg));
481 if (err == 0) {
482 fb->xres = msg.physical_w_h.body.resp.width;
483 fb->yres = msg.physical_w_h.body.resp.height;
488 fb->vxres = msg.virtual_w_h.body.resp.width;
489 fb->vyres = msg.virtual_w_h.body.resp.height;
490 fb->xoffset = msg.offset.body.resp.x;
491 fb->yoffset = msg.offset.body.resp.y;
492 }
493
494 return (err);
495}
496
497int
498bcm2835_mbox_fb_init(struct bcm2835_fb_config *fb)
499{

--- 39 unchanged lines hidden ---
484 }
485
486 return (err);
487}
488
489int
490bcm2835_mbox_fb_init(struct bcm2835_fb_config *fb)
491{

--- 39 unchanged lines hidden ---