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.
This commit is contained in:
martin 2020-01-21 15:35:39 +00:00
parent 6156b52ae4
commit d241c7a9f8
1 changed files with 22 additions and 18 deletions

View File

@ -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(struct work_struct *work);
#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