| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: ffb.c,v 1.64 2019/12/22 23:23:31 thorpej Exp $ */ | | 1 | /* $NetBSD: ffb.c,v 1.65 2020/07/05 09:55:07 martin Exp $ */ |
2 | /* $OpenBSD: creator.c,v 1.20 2002/07/30 19:48:15 jason Exp $ */ | | 2 | /* $OpenBSD: creator.c,v 1.20 2002/07/30 19:48:15 jason Exp $ */ |
3 | | | 3 | |
4 | /* | | 4 | /* |
5 | * Copyright (c) 2002 Jason L. Wright (jason@thought.net) | | 5 | * Copyright (c) 2002 Jason L. Wright (jason@thought.net) |
6 | * All rights reserved. | | 6 | * All rights reserved. |
7 | * | | 7 | * |
8 | * Redistribution and use in source and binary forms, with or without | | 8 | * Redistribution and use in source and binary forms, with or without |
9 | * modification, are permitted provided that the following conditions | | 9 | * modification, are permitted provided that the following conditions |
10 | * are met: | | 10 | * are met: |
11 | * 1. Redistributions of source code must retain the above copyright | | 11 | * 1. Redistributions of source code must retain the above copyright |
12 | * notice, this list of conditions and the following disclaimer. | | 12 | * notice, this list of conditions and the following disclaimer. |
13 | * 2. Redistributions in binary form must reproduce the above copyright | | 13 | * 2. Redistributions in binary form must reproduce the above copyright |
14 | * notice, this list of conditions and the following disclaimer in the | | 14 | * notice, this list of conditions and the following disclaimer in the |
| @@ -23,27 +23,27 @@ | | | @@ -23,27 +23,27 @@ |
23 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | | 23 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
24 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | | 24 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
25 | * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, | | 25 | * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, |
26 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | | 26 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
27 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | | 27 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
28 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | | 28 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
29 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | | 29 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, |
30 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN | | 30 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN |
31 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | | 31 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
32 | * POSSIBILITY OF SUCH DAMAGE. | | 32 | * POSSIBILITY OF SUCH DAMAGE. |
33 | */ | | 33 | */ |
34 | | | 34 | |
35 | #include <sys/cdefs.h> | | 35 | #include <sys/cdefs.h> |
36 | __KERNEL_RCSID(0, "$NetBSD: ffb.c,v 1.64 2019/12/22 23:23:31 thorpej Exp $"); | | 36 | __KERNEL_RCSID(0, "$NetBSD: ffb.c,v 1.65 2020/07/05 09:55:07 martin Exp $"); |
37 | | | 37 | |
38 | #include <sys/types.h> | | 38 | #include <sys/types.h> |
39 | #include <sys/param.h> | | 39 | #include <sys/param.h> |
40 | #include <sys/systm.h> | | 40 | #include <sys/systm.h> |
41 | #include <sys/kernel.h> | | 41 | #include <sys/kernel.h> |
42 | #include <sys/device.h> | | 42 | #include <sys/device.h> |
43 | #include <sys/conf.h> | | 43 | #include <sys/conf.h> |
44 | #include <sys/ioctl.h> | | 44 | #include <sys/ioctl.h> |
45 | #include <sys/malloc.h> | | 45 | #include <sys/malloc.h> |
46 | #include <sys/mman.h> | | 46 | #include <sys/mman.h> |
47 | | | 47 | |
48 | #include <sys/bus.h> | | 48 | #include <sys/bus.h> |
49 | #include <machine/autoconf.h> | | 49 | #include <machine/autoconf.h> |
| @@ -296,27 +296,27 @@ ffb_attach(device_t self) | | | @@ -296,27 +296,27 @@ ffb_attach(device_t self) |
296 | sc->sc_edid_info.edid_nmodes); | | 296 | sc->sc_edid_info.edid_nmodes); |
297 | DPRINTF(("%s: EDID data:\n ", device_xname(sc->sc_dev))); | | 297 | DPRINTF(("%s: EDID data:\n ", device_xname(sc->sc_dev))); |
298 | for (i = 0; i < EDID_DATA_LEN; i++) { | | 298 | for (i = 0; i < EDID_DATA_LEN; i++) { |
299 | if (i && !(i % 32)) | | 299 | if (i && !(i % 32)) |
300 | DPRINTF(("\n ")); | | 300 | DPRINTF(("\n ")); |
301 | if (i && !(i % 4)) | | 301 | if (i && !(i % 4)) |
302 | DPRINTF((" ")); | | 302 | DPRINTF((" ")); |
303 | DPRINTF(("%02x", sc->sc_edid_data[i])); | | 303 | DPRINTF(("%02x", sc->sc_edid_data[i])); |
304 | } | | 304 | } |
305 | DPRINTF(("\n")); | | 305 | DPRINTF(("\n")); |
306 | if (ffb_debug) | | 306 | if (ffb_debug) |
307 | edid_print(&sc->sc_edid_info); | | 307 | edid_print(&sc->sc_edid_info); |
308 | | | 308 | |
309 | data = prop_data_create_data(sc->sc_edid_data, EDID_DATA_LEN); | | 309 | data = prop_data_create_copy(sc->sc_edid_data, EDID_DATA_LEN); |
310 | prop_dictionary_set(device_properties(self), "EDID", data); | | 310 | prop_dictionary_set(device_properties(self), "EDID", data); |
311 | prop_object_release(data); | | 311 | prop_object_release(data); |
312 | | | 312 | |
313 | if (try_edid) | | 313 | if (try_edid) |
314 | for (i = 0; i < sc->sc_edid_info.edid_nmodes; i++) { | | 314 | for (i = 0; i < sc->sc_edid_info.edid_nmodes; i++) { |
315 | if (ffb_set_vmode(sc, | | 315 | if (ffb_set_vmode(sc, |
316 | &(sc->sc_edid_info.edid_modes[i]), btype, | | 316 | &(sc->sc_edid_info.edid_modes[i]), btype, |
317 | &(sc->sc_width), &(sc->sc_height))) | | 317 | &(sc->sc_width), &(sc->sc_height))) |
318 | break; | | 318 | break; |
319 | } | | 319 | } |
320 | } else { | | 320 | } else { |
321 | DPRINTF(("%s: No EDID data.\n", device_xname(sc->sc_dev))); | | 321 | DPRINTF(("%s: No EDID data.\n", device_xname(sc->sc_dev))); |
322 | } | | 322 | } |