Commit 6bd08e7e authored by Ben Avison's avatar Ben Avison

Make compatible with latest firmware

A documentation error and bug in BCMVideo combined with an incompatible change
in the VCHIQ interface, resulting in blank video output.

* In GenCmd_GetConfigInt, in the non-error case, Z is clear (not set) if the
  value read is nonzero. Many of the callers (correctly) only store the result
  if NE was returned, i.e. Z clear.
* In the parse error case, where it constructs the return flags using an
  MSR, it wasn't setting Z, so the callers were storing the corrupted r0
  (actually a pointer to the query string) into the workspace in such cases.
* The firmware has changed how it reports unknown values. It now responds
  "<name> is unknown" rather than "<name>=0", and this meant it was being
  considered as a parsing error, hence triggering the dormant bug above.
* GenCmd_GetConfigInt has now gained special-case handling of " is unknown"
  results, and treats them the same as "=0".

Tested on a Pi 4 with the latest firmware.
parent e19eb273
......@@ -11,10 +11,10 @@
GBLS Module_ComponentName
Module_MajorVersion SETS "0.59"
Module_Version SETA 59
Module_MinorVersion SETS ""
Module_Date SETS "02 Jul 2019"
Module_ApplicationDate SETS "02-Jul-19"
Module_MinorVersion SETS "NewFirmwareSupport.1"
Module_Date SETS "03 Jul 2019"
Module_ApplicationDate SETS "03-Jul-19"
Module_ComponentName SETS "BCMVideo"
Module_FullVersion SETS "0.59"
Module_HelpVersion SETS "0.59 (02 Jul 2019)"
Module_FullVersion SETS "0.59 (NewFirmwareSupport.1)"
Module_HelpVersion SETS "0.59 (03 Jul 2019) NewFirmwareSupport.1"
......@@ -4,18 +4,18 @@
#define Module_MajorVersion_CMHG 0.59
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 02 Jul 2019
#define Module_MinorVersion_CMHG NewFirmwareSupport.1
#define Module_Date_CMHG 03 Jul 2019
#define Module_MajorVersion "0.59"
#define Module_Version 59
#define Module_MinorVersion ""
#define Module_Date "02 Jul 2019"
#define Module_MinorVersion "NewFirmwareSupport.1"
#define Module_Date "03 Jul 2019"
#define Module_ApplicationDate "02-Jul-19"
#define Module_ApplicationDate "03-Jul-19"
#define Module_ComponentName "BCMVideo"
#define Module_FullVersion "0.59"
#define Module_HelpVersion "0.59 (02 Jul 2019)"
#define Module_FullVersion "0.59 (NewFirmwareSupport.1)"
#define Module_HelpVersion "0.59 (03 Jul 2019) NewFirmwareSupport.1"
#define Module_LibraryVersionInfo "0:59"
......@@ -154,8 +154,8 @@ GenCmd_Send ROUT
; out:
; r0 = config value (iff V clear)
; V set on error (r0 corrupt)
; Z set if non-zero value returned
; else Z clear (error returned or zero returned)
; Z clear if non-zero value returned
; else Z set (error returned or zero returned)
; Note: The GPU *may* return 0 for config parameters that are known to the
; firmware but have no value specified in the config (depends on item)
GenCmd_GetConfigInt ROUT
......@@ -195,6 +195,8 @@ GenCmd_GetConfigInt ROUT
B %FT90
CMP r3, #' '
CMP r3, #'='
MOV r0, #0
......@@ -245,8 +247,19 @@ GenCmd_GetConfigInt ROUT
ADDLS r0, r0, #10
MSR CPSR_f,#V_bit ; Z clear
MSR CPSR_f,#Z_bit :OR: V_bit ; Z set
95 ; Newer versions of the firmware can respond with "<name> is unknown"
; Check for this, and behave as though it had responded "<name>=0"
ADR r2, is_unknown
96 LDRB r0, [r2], #1
LDRB r3, [r1], #1
TEQ r0, r3
BNE %BT90 ; wasn't a match, so still consider this an error
TEQ r0, #0
; Matched magic string, drop through with r0 = 0
[ Debug
BL DebugHexTX4
......@@ -260,6 +273,9 @@ GenCmd_GetConfigInt ROUT
is_unknown = "is unknown", 0
VCGenCmd_BufLen * 1024
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment