From 46f2811351806aafb3d56e02c107f95ac2ea85e3 Mon Sep 17 00:00:00 2001 From: Hector Martin Date: Sun, 1 Jan 2023 18:40:42 +0900 Subject: [PATCH] m1n1.fw.dcp.iboot: Identify colorspace values Signed-off-by: Hector Martin --- proxyclient/experiments/dcp_iboot.py | 4 ++-- proxyclient/m1n1/fw/dcp/iboot.py | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/proxyclient/experiments/dcp_iboot.py b/proxyclient/experiments/dcp_iboot.py index f4932f8b..9aed5d86 100755 --- a/proxyclient/experiments/dcp_iboot.py +++ b/proxyclient/experiments/dcp_iboot.py @@ -10,7 +10,7 @@ from m1n1.setup import * from m1n1.shell import run_shell from m1n1 import asm from m1n1.hw.dart import DART, DARTRegs -from m1n1.fw.dcp.iboot import DCPIBootClient, SurfaceFormat, EOTF, Transform, AddrFormat +from m1n1.fw.dcp.iboot import DCPIBootClient, SurfaceFormat, EOTF, Transform, AddrFormat, Colorspace from m1n1.proxyutils import RegMonitor print(f"Framebuffer at {u.ba.video.base:#x}") @@ -87,7 +87,7 @@ layer = Container( width = u.ba.video.width, height = u.ba.video.height, surface_fmt = SurfaceFormat.w30r, - colorspace = 2, + colorspace = Colorspace.SCRGBFixed, eotf = EOTF.GAMMA_SDR, transform = Transform.NONE, ) diff --git a/proxyclient/m1n1/fw/dcp/iboot.py b/proxyclient/m1n1/fw/dcp/iboot.py index 602f9b63..8124ca93 100644 --- a/proxyclient/m1n1/fw/dcp/iboot.py +++ b/proxyclient/m1n1/fw/dcp/iboot.py @@ -24,6 +24,12 @@ Colorimetry = "Colorimetry" / Enum(Int32ul, DCIP3 = 3, ) +Colorspace = "Colorspace" / Enum(Int32ul, + SRGB = 1, + Native = 2, + BT2020 = 3, +) + SurfaceFormat = "SurfaceFormat" / Enum(Int32ul, BGRA = 1, BGRA2 = 2, @@ -72,7 +78,7 @@ ColorMode = Struct( "eotf" / EOTF, "encoding" / Encoding, "bpp" / Int32ul, - Padding(4), + "unk" / Int32ul, ) ColorModeList = Struct( @@ -108,7 +114,7 @@ IBootLayerInfo = Struct( "width" / Int32ul, "height" / Int32ul, "surface_fmt" / SurfaceFormat, - "colorspace" / Int32ul, + "colorspace" / Colorspace, "eotf" / EOTF, "transform" / Transform, Padding(3)