Module Name:    src
Committed By:   martin
Date:           Tue Jan 21 15:35:39 UTC 2020

Modified Files:
        src/sys/external/bsd/drm2/dist/drm/radeon [netbsd-9]: radeon_vce.c

Log Message:
Pull up following revision(s) (requested by jmcneill in ticket #634):

        sys/external/bsd/drm2/dist/drm/radeon/radeon_vce.c: revision 1.4

Fix loading TAHITI VCE firmware.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.3.4.1 \
    src/sys/external/bsd/drm2/dist/drm/radeon/radeon_vce.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/drm2/dist/drm/radeon/radeon_vce.c
diff -u src/sys/external/bsd/drm2/dist/drm/radeon/radeon_vce.c:1.3 src/sys/external/bsd/drm2/dist/drm/radeon/radeon_vce.c:1.3.4.1
--- src/sys/external/bsd/drm2/dist/drm/radeon/radeon_vce.c:1.3	Mon Aug 27 04:58:36 2018
+++ src/sys/external/bsd/drm2/dist/drm/radeon/radeon_vce.c	Tue Jan 21 15:35:39 2020
@@ -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.3.4.1 2020/01/21 15:35:39 martin 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.3.4.1 2020/01/21 15:35:39 martin Exp $");
 
 #include <linux/firmware.h>
 #include <linux/module.h>
@@ -53,34 +53,38 @@ static void radeon_vce_idle_work_handler
 
 #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

Reply via email to