| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: omapfb.c,v 1.13 2013/01/17 01:10:52 macallan Exp $ */ | | 1 | /* $NetBSD: omapfb.c,v 1.14 2013/01/21 14:17:39 macallan Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 2010 Michael Lorenz | | 4 | * Copyright (c) 2010 Michael Lorenz |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * Redistribution and use in source and binary forms, with or without | | 7 | * Redistribution and use in source and binary forms, with or without |
8 | * modification, are permitted provided that the following conditions | | 8 | * modification, are permitted provided that the following conditions |
9 | * are met: | | 9 | * are met: |
10 | * 1. Redistributions of source code must retain the above copyright | | 10 | * 1. Redistributions of source code must retain the above copyright |
11 | * notice, this list of conditions and the following disclaimer. | | 11 | * notice, this list of conditions and the following disclaimer. |
12 | * 2. Redistributions in binary form must reproduce the above copyright | | 12 | * 2. Redistributions in binary form must reproduce the above copyright |
13 | * notice, this list of conditions and the following disclaimer in the | | 13 | * notice, this list of conditions and the following disclaimer in the |
14 | * documentation and/or other materials provided with the distribution. | | 14 | * documentation and/or other materials provided with the distribution. |
| @@ -21,27 +21,27 @@ | | | @@ -21,27 +21,27 @@ |
21 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | | 21 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
22 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | | 22 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
23 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | | 23 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | | 24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
25 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | | 25 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | | 26 | */ |
27 | | | 27 | |
28 | /* | | 28 | /* |
29 | * A console driver for OMAP 3530's built-in video controller | | 29 | * A console driver for OMAP 3530's built-in video controller |
30 | * tested on beagleboard only so far | | 30 | * tested on beagleboard only so far |
31 | */ | | 31 | */ |
32 | | | 32 | |
33 | #include <sys/cdefs.h> | | 33 | #include <sys/cdefs.h> |
34 | __KERNEL_RCSID(0, "$NetBSD: omapfb.c,v 1.13 2013/01/17 01:10:52 macallan Exp $"); | | 34 | __KERNEL_RCSID(0, "$NetBSD: omapfb.c,v 1.14 2013/01/21 14:17:39 macallan Exp $"); |
35 | | | 35 | |
36 | #include <sys/param.h> | | 36 | #include <sys/param.h> |
37 | #include <sys/systm.h> | | 37 | #include <sys/systm.h> |
38 | #include <sys/kernel.h> | | 38 | #include <sys/kernel.h> |
39 | #include <sys/device.h> | | 39 | #include <sys/device.h> |
40 | #include <sys/malloc.h> | | 40 | #include <sys/malloc.h> |
41 | #include <sys/lwp.h> | | 41 | #include <sys/lwp.h> |
42 | #include <sys/kauth.h> | | 42 | #include <sys/kauth.h> |
43 | | | 43 | |
44 | #include <uvm/uvm_extern.h> | | 44 | #include <uvm/uvm_extern.h> |
45 | | | 45 | |
46 | #include <dev/videomode/videomode.h> | | 46 | #include <dev/videomode/videomode.h> |
47 | | | 47 | |
| @@ -425,29 +425,38 @@ omapfb_attach(device_t parent, device_t | | | @@ -425,29 +425,38 @@ omapfb_attach(device_t parent, device_t |
425 | | | 425 | |
426 | static int | | 426 | static int |
427 | omapfb_ioctl(void *v, void *vs, u_long cmd, void *data, int flag, | | 427 | omapfb_ioctl(void *v, void *vs, u_long cmd, void *data, int flag, |
428 | struct lwp *l) | | 428 | struct lwp *l) |
429 | { | | 429 | { |
430 | struct vcons_data *vd = v; | | 430 | struct vcons_data *vd = v; |
431 | struct omapfb_softc *sc = vd->cookie; | | 431 | struct omapfb_softc *sc = vd->cookie; |
432 | struct wsdisplay_fbinfo *wdf; | | 432 | struct wsdisplay_fbinfo *wdf; |
433 | struct vcons_screen *ms = vd->active; | | 433 | struct vcons_screen *ms = vd->active; |
434 | | | 434 | |
435 | switch (cmd) { | | 435 | switch (cmd) { |
436 | | | 436 | |
437 | case WSDISPLAYIO_GTYPE: | | 437 | case WSDISPLAYIO_GTYPE: |
438 | *(u_int *)data = WSDISPLAY_TYPE_PCIMISC; | | 438 | *(u_int *)data = WSDISPLAY_TYPE_OMAP3; |
439 | return 0; | | 439 | return 0; |
440 | | | 440 | |
| | | 441 | case WSDISPLAYIO_GET_BUSID: |
| | | 442 | { |
| | | 443 | struct wsdisplayio_bus_id *busid; |
| | | 444 | |
| | | 445 | busid = data; |
| | | 446 | busid->bus_type = WSDISPLAYIO_BUS_SOC; |
| | | 447 | return 0; |
| | | 448 | } |
| | | 449 | |
441 | case WSDISPLAYIO_GINFO: | | 450 | case WSDISPLAYIO_GINFO: |
442 | if (ms == NULL) | | 451 | if (ms == NULL) |
443 | return ENODEV; | | 452 | return ENODEV; |
444 | wdf = (void *)data; | | 453 | wdf = (void *)data; |
445 | wdf->height = ms->scr_ri.ri_height; | | 454 | wdf->height = ms->scr_ri.ri_height; |
446 | wdf->width = ms->scr_ri.ri_width; | | 455 | wdf->width = ms->scr_ri.ri_width; |
447 | wdf->depth = ms->scr_ri.ri_depth; | | 456 | wdf->depth = ms->scr_ri.ri_depth; |
448 | wdf->cmsize = 256; | | 457 | wdf->cmsize = 256; |
449 | return 0; | | 458 | return 0; |
450 | | | 459 | |
451 | case WSDISPLAYIO_GETCMAP: | | 460 | case WSDISPLAYIO_GETCMAP: |
452 | return omapfb_getcmap(sc, | | 461 | return omapfb_getcmap(sc, |
453 | (struct wsdisplay_cmap *)data); | | 462 | (struct wsdisplay_cmap *)data); |