Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-9]: src/sys/dev/wsfb Pull up following revision(s) (requested by ...



details:   https://anonhg.NetBSD.org/src/rev/bbe2379df091
branches:  netbsd-9
changeset: 936367:bbe2379df091
user:      martin <martin%NetBSD.org@localhost>
date:      Sun Jul 26 10:47:25 2020 +0000

description:
Pull up following revision(s) (requested by jdolecek in ticket #1025):

        sys/dev/wsfb/genfb.c: revision 1.73

reduce stack usage in genfb_calc_hsize()

diffstat:

 sys/dev/wsfb/genfb.c |  19 +++++++++++++------
 1 files changed, 13 insertions(+), 6 deletions(-)

diffs (48 lines):

diff -r 000b12a33c08 -r bbe2379df091 sys/dev/wsfb/genfb.c
--- a/sys/dev/wsfb/genfb.c      Sun Jul 26 10:46:14 2020 +0000
+++ b/sys/dev/wsfb/genfb.c      Sun Jul 26 10:47:25 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: genfb.c,v 1.67.2.2 2020/04/15 14:15:17 martin Exp $ */
+/*     $NetBSD: genfb.c,v 1.67.2.3 2020/07/26 10:47:25 martin Exp $ */
 
 /*-
  * Copyright (c) 2007 Michael Lorenz
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: genfb.c,v 1.67.2.2 2020/04/15 14:15:17 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: genfb.c,v 1.67.2.3 2020/07/26 10:47:25 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -632,18 +632,25 @@
        device_t dev = sc->sc_dev;
        prop_dictionary_t dict = device_properties(dev);
        prop_data_t edid_data;
-       struct edid_info edid;
+       struct edid_info *edid;
        const char *edid_ptr;
+       int hsize;
 
        edid_data = prop_dictionary_get(dict, "EDID");
        if (edid_data == NULL || prop_data_size(edid_data) < 128)
                return 0;
 
+       edid = kmem_alloc(sizeof(*edid), KM_SLEEP);
+
        edid_ptr = prop_data_data_nocopy(edid_data);
-       if (edid_parse(__UNCONST(edid_ptr), &edid) != 0)
-               return 0;
+       if (edid_parse(__UNCONST(edid_ptr), edid) == 0)
+               hsize = (int)edid->edid_max_hsize * 10;
+       else
+               hsize = 0;
 
-       return (int)edid.edid_max_hsize * 10;
+       kmem_free(edid, sizeof(*edid));
+
+       return hsize;
 }
 
 /* Return the minimum number of character columns based on DPI */



Home | Main Index | Thread Index | Old Index