Source-Changes-HG archive

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

[src/trunk]: src/sys/external/bsd/drm2/dist/drm/radeon Fix loading TAHITI VCE...



details:   https://anonhg.NetBSD.org/src/rev/900ac71ce83c
branches:  trunk
changeset: 467284:900ac71ce83c
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sun Jan 19 11:07:00 2020 +0000

description:
Fix loading TAHITI VCE firmware.

diffstat:

 sys/external/bsd/drm2/dist/drm/radeon/radeon_vce.c |  40 ++++++++++++---------
 1 files changed, 22 insertions(+), 18 deletions(-)

diffs (73 lines):

diff -r f7313b44e790 -r 900ac71ce83c sys/external/bsd/drm2/dist/drm/radeon/radeon_vce.c
--- a/sys/external/bsd/drm2/dist/drm/radeon/radeon_vce.c        Sun Jan 19 10:59:56 2020 +0000
+++ b/sys/external/bsd/drm2/dist/drm/radeon/radeon_vce.c        Sun Jan 19 11:07:00 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: radeon_vce.c,v 1.3 2018/08/27 04:58:36 riastradh Exp $ */
+/*     $NetBSD: radeon_vce.c,v 1.4 2020/01/19 11:07:00 jmcneill Exp $  */
 
 /*
  * Copyright 2013 Advanced Micro Devices, Inc.
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: radeon_vce.c,v 1.3 2018/08/27 04:58:36 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: radeon_vce.c,v 1.4 2020/01/19 11:07:00 jmcneill Exp $");
 
 #include <linux/firmware.h>
 #include <linux/module.h>
@@ -53,34 +53,38 @@
 
 #ifdef __NetBSD__              /* XXX Ugh!  */
 static bool
-scan_2dec_u8(const char **sp, char delim, uint8_t *u8p)
+scan_2dec_uint(const char **sp, char delim, unsigned int *uintp)
 {
-       char c0, c1;
+       u_int val = 0, n;
+       char c;
 
-       if (!isdigit((unsigned char)(c0 = *(*sp)++)))
-               return false;
-       if (!isdigit((unsigned char)(c1 = *(*sp)++)))
-               return false;
-       if (*(*sp)++ != delim)
+       for (n = 0; n < 2; n++) {
+               c = *(*sp)++;
+               if (!isdigit((unsigned char)c))
+                       return false;
+               if (n != 0)
+                       val *= 10;
+               val += (c - '0');
+               if (*(*sp) == delim)
+                       break;
+       }
+       if (*(*sp) != delim)
                return false;
 
-       *u8p = ((c0 - '0') * 10) + (c1 - '0');
+       (*sp)++;
+       *uintp = val;
        return true;
 }
 
 static bool
-scan_2dec_uint(const char **sp, char delim, unsigned int *uintp)
+scan_2dec_u8(const char **sp, char delim, uint8_t *u8p)
 {
-       char c0, c1;
+       unsigned int val;
 
-       if (!isdigit((unsigned char)(c0 = *(*sp)++)))
-               return false;
-       if (!isdigit((unsigned char)(c1 = *(*sp)++)))
-               return false;
-       if (*(*sp)++ != delim)
+       if (!scan_2dec_uint(sp, delim, &val))
                return false;
 
-       *uintp = ((c0 - '0') * 10) + (c1 - '0');
+       *u8p = (uint8_t)val;
        return true;
 }
 #endif



Home | Main Index | Thread Index | Old Index