From 8b09d50f7f91e94afa141a8368317d1b74a34b26 Mon Sep 17 00:00:00 2001 From: Ville Syrjälä Date: Thu, 2 May 2024 16:19:42 +0300 Subject: tools/intel_vbt_decode: Decode block 20 (OEM Customizable Modes) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Decode VBT block 20 (OEM Customizable Modes). Just some list of modes, which we probably don't care about. Example output from ADL: BDB block 20 (170 bytes, min 2 bytes) - OEM customizable modes: 0000: 14 aa 00 06 1c 04 00 56 05 00 03 00 3c 00 00 00 0010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff 0020: 01 04 00 56 05 56 03 00 3c 00 00 00 00 00 00 00 0030: 00 00 00 00 00 00 00 00 00 00 00 ff 01 00 00 00 0040: 00 00 00 00 3c 00 00 00 00 00 00 00 00 00 00 00 0050: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0060: 3c 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0070: 00 00 00 00 00 00 00 00 00 00 00 00 3c 00 00 00 0080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0090: 00 00 00 00 00 00 00 00 3c 00 00 00 00 00 00 00 00a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 Num entries: 6 Entry size: 28 Entry #1: Enable in GOP: yes Enable in OS: no Enable in VBIOS: no Resolution: 1366x768 Display flags: none (0x00) Color depth: 0x00 Refresh rate: 60 DTD: hdisplay: 0 hsync [0, 0] -sync htotal: 0 vdisplay: 0 vsync [0, 0] -sync vtotal: 0 clock: 0 Display flags 2: EFP1,EFP2,EFP3,EFP4,EFP5,EFP6,EFP7,LFP1,LFP2 (0x01ff) ... Entry #6: Enable in GOP: no Enable in OS: no Enable in VBIOS: no Resolution: 0x0 Display flags: none (0x00) Color depth: 0x00 Refresh rate: 60 DTD: hdisplay: 0 hsync [0, 0] -sync htotal: 0 vdisplay: 0 vsync [0, 0] -sync vtotal: 0 clock: 0 Display flags 2: none (0x0000) Signed-off-by: Ville Syrjälä Acked-by: Jani Nikula --- tools/intel_vbt_decode.c | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'tools') diff --git a/tools/intel_vbt_decode.c b/tools/intel_vbt_decode.c index 3021c49a3..76806fc69 100644 --- a/tools/intel_vbt_decode.c +++ b/tools/intel_vbt_decode.c @@ -346,6 +346,8 @@ static size_t block_min_size(const struct context *context, int section_id) return sizeof(struct bdb_driver_rotation); case BDB_DISPLAY_REMOVE_OLD: return sizeof(struct bdb_display_remove_old); + case BDB_OEM_CUSTOM: + return sizeof(struct bdb_oem_custom); case BDB_SDVO_LVDS_OPTIONS: return sizeof(struct bdb_sdvo_lvds_options); case BDB_SDVO_LVDS_DTD: @@ -2227,6 +2229,39 @@ static void dump_driver_rotation(struct context *context, printf("\tRotation flags 4: 0x%08x\n", rot->rotation_flags_4); } +static void dump_oem_custom(struct context *context, + const struct bdb_block *block) +{ + const struct bdb_oem_custom *oem = block_data(block); + + printf("\tNum entries: %d\n", oem->num_entries); + printf("\tEntry size: %d\n", oem->entry_size); + + for (int i = 0; i < oem->num_entries; i++) { + const struct oem_mode *m = (const void *)&oem->modes[0] + + i * oem->entry_size; + + printf("\tEntry #%d:\n", i+1); + printf("\t\tEnable in GOP: %s\n", YESNO(m->enable_in_gop)); + printf("\t\tEnable in OS: %s\n", YESNO(m->enable_in_os)); + printf("\t\tEnable in VBIOS: %s\n", YESNO(m->enable_in_vbios)); + printf("\t\tResolution: %dx%d\n", m->x_res, m->y_res); + printf("\t\tDisplay flags: %s (0x%02x)\n", + child_device_handle(context, m->display_flags), + m->display_flags); + printf("\t\tColor depth: 0x%02x\n", m->color_depth); + printf("\t\tRefresh rate: %d\n", m->refresh_rate); + + printf("\t\tDTD:\n"); + print_detail_timing_data(&m->dtd); + + if (oem->entry_size >= 28) + printf("\t\tDisplay flags 2: %s (0x%04x)\n", + child_device_handle(context, m->display_flags_2), + m->display_flags_2); + } +} + static void dump_edp(struct context *context, const struct bdb_block *block) { @@ -3345,6 +3380,11 @@ struct dumper dumpers[] = { .name = "Display remove (pre-IVB)", .dump = dump_display_remove_old, }, + { + .id = BDB_OEM_CUSTOM, + .name = "OEM customizable modes", + .dump = dump_oem_custom, + }, { .id = BDB_SDVO_LVDS_OPTIONS, .name = "SDVO LVDS options block", -- cgit v1.2.3