summaryrefslogtreecommitdiff
path: root/tools/intel_vbt_decode.c
AgeCommit message (Collapse)AuthorFilesLines
8 daystools/intel_vbt_decode: Decode the EFP indexVille Syrjälä1-0/+3
Decode the new EFP panel index field. TODO: hook this up into panel_str() Reviewed-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
8 daystools/intel_vbt_decode: Decode all the driver feature bitsVille Syrjälä1-0/+6
Add decoding for bunch of driver feature bits: Hpd wake, ADT, DFPS. Reviewed-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
8 daystools/intel_vbt_decode: Dump MIPI sequences in the order they appear in VBTVille Syrjälä1-5/+2
Dump the MIPI sequence blocks in the order they appear in the VBT (as opposed to being ordered by the sequence type). This makes it easier to compare the hexdump vs. the decoded output, which is what I tend to do occasionally when trying to check whether we are decoding things correctly or not. Reviewed-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
8 daystools/intel_vbt_decode: Dump out the backlight entry sizeVille Syrjälä1-0/+2
Dump the backlight entry size for completeness. It's easier to compare against the spec/etc. when everything is decoded. Reviewed-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
8 daystools/intel_vbt_decode: Add version checks for backlight decodingVille Syrjälä1-12/+23
Decode stuff from the backlight block based on the version number. Reviewed-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
8 daystools/intel_vbt_decode: Check version before decoding ↵Ville Syrjälä1-0/+3
lace_aggressiveness_profile The LFP power lace_aggressiveness_profile was introduced in VBT verson 210. Check for that version before deocoding the information. Reviewed-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
8 daystools/intel_vbt_decode: Decode the obsolote DPST supported fieldVille Syrjälä1-0/+2
Looks like there used to be a field for DPST in the LFP power block feature bits. Later that got first into the driver features block, and then back into a different part of the LFP power block. Not sure when this got deprecated. Reviewed-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
8 daystools/intel_vbt_decode: Decode the backlight i2c stuffVille Syrjälä1-13/+32
Decode the (obsolete) backlight i2c stuff for completeness. v2: Add missing '<' to "<reserved>" (Jani) Reviewed-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
8 daystools/intel_vbt_decode: Dump AIM offsetsVille Syrjälä1-0/+2
Dump the AIM offsets from the header. I don't think these should be actually in ant of modern VBT, but no harm in dumping them out anyway. Reviewed-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
8 daystools/intel_vbt_decode: Print the block min sizeVille Syrjälä1-2/+2
Print out our idea of the minimum size for each block. Can be helpful in determining if we're potentially decoding stuff that's not really present. Reviewed-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
8 daystools/intel_vbt_decode: Allow blocks to be named without full decodingVille Syrjälä1-5/+4
Make it possible to give blocks a name without having to implement full decoding. Reviewed-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
8 daystools/intel_vbt_decode: Extract default_algorithm()Ville Syrjälä1-1/+6
Extract default_algorithm() for later use in decoding other blocks. Reviewed-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2024-03-26tools/intel_vbt_decode: Optionally determine panel type from EDIDVille Syrjälä1-0/+91
VBT may declare panel type as 255, which means we should match the EDID PnP ID against the panel entries in the VBT to determine the correct panel type. Implement support for this by allowing the user to optionally provide the EDID via a command like parameter. v2: Drop extra ' ' and some lefover debug junk (Jani) v3: s/0/NULL/ for mmap() s/ /_/ in usage() for consistency Reviewed-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2024-03-26tools/intel_vbt_decode: Also dump the second panel (panel_type2)Ville Syrjälä1-6/+40
Modern VBTs can declare two panel types in order to support dual panel systems. Dump the panel information for the second panel as well. Since panel_type2 could also be declared as 255 (== match pnpid to EDID) we also add a new command line knob to select panel_type2 by hand. Data for the second panel will be indicated by "(2)", as opposed to "(1)" for the first panel. We can also end up in a situation where panel_type==panel_type2. The reasons being a dodgy VBT, or the VBT might declare panel_type==255 and panel_type2=0, and if we can't determine which panel the 255 refers to (via pnpid) then we just default to panel_type==0. v2: Break the ?: into separate ifs (Jani) Clarify why we can end up with panel_type==panel_type2 (Jani) v3: Update usage() Reviewed-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2024-03-26tools/intel_vbt_decode: Change panel indicator from * to (1)Ville Syrjälä1-1/+1
In preparation for also indicating the second panel (panel_type2) change the indicator for the first panel (panel_type) to "(1)" from "*". Reviewed-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2024-03-26tools/intel_vbt_decode: Extract panel_str()Ville Syrjälä1-14/+15
Extract the code to generate the panel==panel_type indicator string to a small helper. Reviewed-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2024-03-26tools/intel_vbt_decode: Extract dump_panel()Ville Syrjälä1-10/+16
Pull the repeated "dump this panel?" expression into a small helper. Reviewed-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2023-03-01tools/intel_vbt_decode: Dump mode backlight dataVille Syrjälä1-0/+15
Dump the new stuff from the backlight block: - brightness_level - brightness_min_level - brightness_precision_bits - hdr_dpcd_refresh_timeout Reviewed-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2023-03-01tools/intel_vbt_decode: fix division by zero child device sizeJani Nikula1-4/+10
Real world VBTs keep fuzzing our decoder, this time with a legacy child devices block #11 that has child_dev_size 0, leading to division by zero. Check for it, and bail out early, both for legacy and current child device blocks. Reviewed-by: Kamil Konieczny <kamil.konieczny@linux.intel.com> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2022-12-05tools/intel_vbt_decode: print debug-ish messages to stderrJani Nikula1-1/+1
The tool outputs the decoded and somewhat nicely formatted VBT to stdout, so debug style messages to stdout aren't a great fit. For example: BDB blocks present: 1 2 9 10 12 20 27 40Generating LVDS data table pointers 41Generating LVDS data table pointers 42 43 44 46 51 52 53 56 57 58 252 253 254 Print the debug message about data table pointers to stderr instead. Fixes: ce4d30196d3c ("tools/intel_vbt_decode: Generate LVDS data table pointes if not provided") Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Jani Nikula <jani.nikula@intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2022-11-29tools/intel_vbt_decode: decode VBT MIPI sequence v4 native flagJani Nikula1-2/+6
MIPI sequence v4 has a flag for native/non-native GPIO. Signed-off-by: Jani Nikula <jani.nikula@intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2022-10-19tools/intel_vbt_decode: Decode more child dev fieldsVille Syrjälä1-0/+10
Decode a bunch of newish child dev fields: - disable_compression_for_ext_disp - lttpr_non_transparent - dp_port_trace_length - tbt Reviewed-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2022-10-19tools/intel_vbt_decode: Add version checks for a lot of child dev fieldsVille Syrjälä1-36/+54
Stop decoding most child dev fields if the BDB version is too old. Reviewed-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2022-10-19tools/intel_vbt_decode: Resort block 2 decodingVille Syrjälä1-20/+33
Dump out block 2 contents in the same (big endianish) order as it's listed in the spec. Also group each bitfield into its own little block. Makes it a bit easier to cross check between the two. Reviewed-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2022-10-19tools/intel_vbt_decode: Decode the i2c speedVille Syrjälä1-1/+13
Decode the i2c speed, just for kicks. Reviewed-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2022-10-19tools/intel_vbt_decode: update vbt defs from kernelVille Syrjälä1-2/+2
Sync up the the VBT definitions from kernel commit 758b018aa283 ("drm/i915/bios: Add the "Disable compression for the Display Port/HDMI external display" bit") and adjust the actual code to match. Reviewed-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2022-09-07tools/intel_vbt_decode: Print panel_type2Ville Syrjälä1-5/+3
Print out the second panel type as well. I decided to just get rid of the "(override %d)" stuff as it doesn't really get us anything and doesn't really make sense anyway when we have two possible panel types to consider. The command line override may or may not match either of those. Acked-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2022-09-07tools/intel_vbt_decode: Dump all panels from MIPI blocksVille Syrjälä1-123/+159
Respect the --all-panels in the MIPI blocks dumping and dump all six possible panels. Acked-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2022-09-07tools/intel_vbt_decode: Dump the compression structure index as decimalVille Syrjälä1-1/+1
The compression structure index is just that, and index. So just dump it as a decimal number (and drop the mispaced parenthesis). Acked-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2022-09-07tools/intel_vbt_decode: Adjust DVO port printingVille Syrjälä1-1/+2
Dump the DVO port using the more standard form: "DVO Port: <decoded name> (<raw value>)". Acked-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2022-09-07tools/intel_vbt_decode: Decode AUX CHVille Syrjälä1-1/+25
Decode the AUX CH to a human readable name. Acked-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2022-09-07tools/intel_vbt_decode: Clean up driver features block decodingVille Syrjälä1-23/+70
Print all the stuff from the driver features block, and print it in the same order as the spec lists it to make it a bit easier to compare the two. Also use consistent naming for a bunch of the fields that exist in both the driver features block and the power conservation block. Acked-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2022-09-07tools/intel_vbt_decode: Decode eDP/DP max lane countVille Syrjälä1-0/+2
We have a new field for eDP/DP max lane count. Decode it. Acked-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2022-09-07tools/intel_vbt_decode: Decode the "use VBT vswing tables" flagVille Syrjälä1-0/+1
Decode the "Use VBT swging tables" bit. Note that we don't decode the actual tables so far. Acked-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2022-09-07tools/intel_vbt_decode: Parse HDMI FRL rateVille Syrjälä1-0/+21
Parse the max HDMI FRL rate stuff. Acked-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2022-09-07tools/intel_vbt_decode: Extract panel_fitting[]Ville Syrjälä1-15/+9
Extract the panel_fitting string representation into an array. Less clutter in the code this way. Acked-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2022-09-07tools/intel_vbt_decode: Extract lvds_config[]Ville Syrjälä1-15/+9
Extract the lvds_config string representation into an array. Less clutter in the code this way. Acked-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2022-09-07tools/intel_vbt_decode: Remove pointless variablesVille Syrjälä1-29/+21
A bunch of places assign some random variable just to print out its value with YESNO(). Skip the pointless intermediate step. Acked-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2022-09-07tools/intel_vbt_decode: Introduce panel_bits()/panel_bool()Ville Syrjälä1-33/+45
Add a few helpers for extracting panel specific bits from the bitfields. Acked-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2022-09-07tools/intel_vbt_decode: update vbt defs from kernelVille Syrjälä1-6/+21
Sync up the the VBT definitions from kernel commit ac7af83ae08b ("drm/i915: Rename some VBT bits") and adjust the actual code to match. Note that 'slave_port' is gone now, so we'll just throw it out, and the DP redriver stuff is now defined as bitfields which need to be properly decoded. Acked-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2022-09-07tools/intel_vbt_decode: Use hardcoded fp_timing size for generating LFP data ↵Ville Syrjälä1-27/+18
pointers The current scheme for generating the LFP data table pointers (when the block including them is missing from the VBT) expects the 0xffff sequence to only appear in the fp_timing terminator entries. However some VBTs also have extra 0xffff sequences elsewhere in the LFP data. When looking for the terminators we may end up finding those extra sequeneces insted, which means we deduce the wrong size for the fp_timing table. The code then notices the inconsistent looking values and gives up on the generated data table pointers, preventing us from parsing the LFP data table entirely. Let's give up on the "search for the terminators" approach and instead just hardcode the expected size for the fp_timing table. We have enough sanity checks in place to make sure we shouldn't end up parsing total garbage even if that size should change in the future (although that seems unlikely as the fp_timing and dvo_timing tables have been declared obsolete as of VBT version 229). Acked-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2022-09-07tools/intel_vbt_decode: Validate fp_timing terminator presenceVille Syrjälä1-28/+31
Validate the LFP data block a bit hardwer by making sure the fp_timing terminators (0xffff) are where we expect them to be. Acked-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2022-09-07tools/intel_vbt_decode: Fix mipi sequence block sizeVille Syrjälä1-0/+7
The v3+ MIPI sequence block version number and new size field are considered part of the BDB block header, and thus not included in the reported size. Bump up the size appropariately so that we copy the whole block. Acked-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2022-08-17tools/intel_vbt_decode: Extract dp_vswing()/dp_preemph()Ville Syrjälä1-76/+34
A bunch of places need to decode the DP vswing/preemph values. Fortunately all of them use the the same format so we can extract this stuff into a few helpers. v2: Fix dp_preemph vs. dp_vswing copypaste fail (Jani) Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Jani Nikula <jani.nikula@intel.com>
2022-08-17tools/intel_vbt_decode: Simplify fast link training lane countVille Syrjälä1-16/+2
Get rid of the pointless switch statement and decode the fast link training lane count as just <val>+1. We already do the same for the DSI lane count. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Jani Nikula <jani.nikula@intel.com>
2022-06-22tools/intel_vbt_decode: Warn if we lack the full definiton of the BDB blockVille Syrjälä1-0/+9
Warn in case out BDB block definition is smaller than what the VBT has. That is an indication that we are potentially forgetting to decode some useful new data. We exclude blocks 2,11,22 from this since we don't have a sensible min size for them. We also limit this to modernish VBTs (155+) since some old stuff doesn't really conform (eg. my cst with version 134 has a 9 byte block 1 even though our min size for it is 7 bytes, and all the other oldish machines have block 1 only made up of of 4 or 5 bytes). Reviewed-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2022-06-22tools/intel_vbt_decode: Generate LVDS data table pointes if not providedVille Syrjälä1-1/+127
Modern VBTs (at least observed on TGL machines) no longer provide the LVDS data table pointers block. Thus we can't currently decode the contents of the LVDS data table block. I see two options how to handle this: 1) Just hardocode the offsets/sizes (+ some checks to make sure the hardcoded values makes sense) 2) Deduce the offsets/sizes from the actual LVDS data table block contents I've chosen option 2 here. The fp_timing table 0xffff terminator is what allows us to do this. We just look up the first two of those from the LVDS data block and calculate the offsets/sizes from there. Only the fp_timing entries should have a variable size, and the dvo_timings and panel_pnp_id have fixed size (in fact IIRC they are 1:1 match for the equivalent EDID stuff). This is the same thing we do in the kernel parser as well since commit a87d0a847607 ("drm/i915/bios: Generate LFP data table pointers if the VBT lacks them") Reviewed-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2022-06-22tools/intel_vbt_decode: Validate LVDS data table pointersVille Syrjälä1-1/+90
Do a reasonably exhaustive check to make sure the LVDS data table pointers are sane. Reviewed-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2022-06-22tools/intel_vbt_decode: Dump the LVDS data ptrsVille Syrjälä1-0/+33
Decoede the LVDS data pointers. The offsets are specificed from the start of the whole VBT, but we've fixed them up to be relative to the start of the block already. For human parsing printing them as relative from the start of the block seems more useful anywya. Reviewed-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2022-06-22tools/intel_vbt_decode: Decode the end of the LFP dataVille Syrjälä1-1/+72
Decode the tail end of the LFP data, if available. Reviewed-by: Jani Nikula <jani.nikula@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>