From: Jani Nikula <jani.nikula@linux.intel.com>
To: Ville Syrjala <ville.syrjala@linux.intel.com>,
igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t 4/5] tools/intel_vbt_decode: Add version checks for a lot of child dev fields
Date: Wed, 12 Oct 2022 19:02:19 +0300 [thread overview]
Message-ID: <87czaxt4hg.fsf@intel.com> (raw)
In-Reply-To: <20220907094651.29527-4-ville.syrjala@linux.intel.com>
On Wed, 07 Sep 2022, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Stop decoding most child dev fields if the BDB version
> is too old.
In general I like it, but was wondering about printing something if it's
non-zero in this case. *shrug*. Gets pretty ugly in code though.
BR,
Jani.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> tools/intel_vbt_decode.c | 90 ++++++++++++++++++++++++----------------
> 1 file changed, 54 insertions(+), 36 deletions(-)
>
> diff --git a/tools/intel_vbt_decode.c b/tools/intel_vbt_decode.c
> index 3bd4d4b70fb3..0af7902c5102 100644
> --- a/tools/intel_vbt_decode.c
> +++ b/tools/intel_vbt_decode.c
> @@ -948,37 +948,47 @@ static void dump_child_device(struct context *context,
> printf("\t\tI2C speed: %s (0x%02x)\n",
> i2c_speed(child->i2c_speed), child->i2c_speed);
>
> - printf("\t\tDP onboard redriver:\n");
> - printf("\t\t\tpresent: %s\n",
> - YESNO((child->dp_onboard_redriver_present)));
> - printf("\t\t\tvswing: %s (0x%x)\n",
> - dp_vswing(child->dp_onboard_redriver_vswing),
> - child->dp_onboard_redriver_vswing);
> - printf("\t\t\tpre-emphasis: %s (0x%x)\n",
> - dp_preemph(child->dp_onboard_redriver_preemph),
> - child->dp_onboard_redriver_preemph);
> + if (context->bdb->version >= 158) {
> + printf("\t\tDP onboard redriver:\n");
> + printf("\t\t\tpresent: %s\n",
> + YESNO((child->dp_onboard_redriver_present)));
> + printf("\t\t\tvswing: %s (0x%x)\n",
> + dp_vswing(child->dp_onboard_redriver_vswing),
> + child->dp_onboard_redriver_vswing);
> + printf("\t\t\tpre-emphasis: %s (0x%x)\n",
> + dp_preemph(child->dp_onboard_redriver_preemph),
> + child->dp_onboard_redriver_preemph);
>
> - printf("\t\tDP ondock redriver:\n");
> - printf("\t\t\tpresent: %s\n",
> - YESNO((child->dp_ondock_redriver_present)));
> - printf("\t\t\tvswing: %s (0x%x)\n",
> - dp_vswing(child->dp_ondock_redriver_vswing),
> - child->dp_ondock_redriver_vswing);
> - printf("\t\t\tpre-emphasis: %s (0x%x)\n",
> - dp_preemph(child->dp_ondock_redriver_preemph),
> - child->dp_ondock_redriver_preemph);
> + printf("\t\tDP ondock redriver:\n");
> + printf("\t\t\tpresent: %s\n",
> + YESNO((child->dp_ondock_redriver_present)));
> + printf("\t\t\tvswing: %s (0x%x)\n",
> + dp_vswing(child->dp_ondock_redriver_vswing),
> + child->dp_ondock_redriver_vswing);
> + printf("\t\t\tpre-emphasis: %s (0x%x)\n",
> + dp_preemph(child->dp_ondock_redriver_preemph),
> + child->dp_ondock_redriver_preemph);
> + }
>
> - dump_hmdi_max_data_rate(child->hdmi_max_data_rate);
> - printf("\t\tHDMI level shifter value: 0x%02x\n", child->hdmi_level_shifter_value);
> + if (context->bdb->version >= 204)
> + dump_hmdi_max_data_rate(child->hdmi_max_data_rate);
> + if (context->bdb->version >= 169)
> + printf("\t\tHDMI level shifter value: 0x%02x\n", child->hdmi_level_shifter_value);
>
> - printf("\t\tOffset to DTD buffer for edidless CHILD: 0x%02x\n", child->dtd_buf_ptr);
> + if (context->bdb->version >= 161)
> + printf("\t\tOffset to DTD buffer for edidless CHILD: 0x%02x\n", child->dtd_buf_ptr);
>
> - printf("\t\tDual pipe ganged eDP: %s\n", YESNO(child->ganged_edp));
> - printf("\t\tCompression method CPS: %s\n", YESNO(child->compression_method_cps));
> - printf("\t\tCompression enable: %s\n", YESNO(child->compression_enable));
> - printf("\t\tEdidless EFP: %s\n", YESNO(child->edidless_efp));
> + if (context->bdb->version >= 202)
> + printf("\t\tDual pipe ganged eDP: %s\n", YESNO(child->ganged_edp));
> + if (context->bdb->version >= 198) {
> + printf("\t\tCompression method CPS: %s\n", YESNO(child->compression_method_cps));
> + printf("\t\tCompression enable: %s\n", YESNO(child->compression_enable));
> + }
> + if (context->bdb->version >= 161)
> + printf("\t\tEdidless EFP: %s\n", YESNO(child->edidless_efp));
>
> - printf("\t\tCompression structure index: %d\n", child->compression_structure_index);
> + if (context->bdb->version >= 198)
> + printf("\t\tCompression structure index: %d\n", child->compression_structure_index);
>
> if (context->bdb->version >= 237) {
> printf("\t\tHDMI Max FRL rate valid: %s\n",
> @@ -1007,16 +1017,24 @@ static void dump_child_device(struct context *context,
> } else {
> if (context->bdb->version >= 244)
> printf("\t\teDP/DP max lane count: X%d\n", child->dp_max_lane_count + 1);
> - printf("\t\tUse VBT vswing/premph table: %s\n", YESNO(child->use_vbt_vswing));
> - printf("\t\tHPD sense invert: %s\n", YESNO(child->hpd_invert));
> - printf("\t\tIboost enable: %s\n", YESNO(child->iboost));
> - printf("\t\tOnboard LSPCON: %s\n", YESNO(child->lspcon));
> - printf("\t\tLane reversal: %s\n", YESNO(child->lane_reversal));
> - printf("\t\tEFP routed through dock: %s\n", YESNO(child->efp_routed));
> -
> - printf("\t\tTMDS compatible? %s\n", YESNO(child->tmds_support));
> - printf("\t\tDP compatible? %s\n", YESNO(child->dp_support));
> - printf("\t\tHDMI compatible? %s\n", YESNO(child->hdmi_support));
> + if (context->bdb->version >= 218)
> + printf("\t\tUse VBT vswing/premph table: %s\n", YESNO(child->use_vbt_vswing));
> + if (context->bdb->version >= 196) {
> + printf("\t\tHPD sense invert: %s\n", YESNO(child->hpd_invert));
> + printf("\t\tIboost enable: %s\n", YESNO(child->iboost));
> + }
> + if (context->bdb->version >= 192)
> + printf("\t\tOnboard LSPCON: %s\n", YESNO(child->lspcon));
> + if (context->bdb->version >= 184)
> + printf("\t\tLane reversal: %s\n", YESNO(child->lane_reversal));
> + if (context->bdb->version >= 158)
> + printf("\t\tEFP routed through dock: %s\n", YESNO(child->efp_routed));
> +
> + if (context->bdb->version >= 158) {
> + printf("\t\tTMDS compatible? %s\n", YESNO(child->tmds_support));
> + printf("\t\tDP compatible? %s\n", YESNO(child->dp_support));
> + printf("\t\tHDMI compatible? %s\n", YESNO(child->hdmi_support));
> + }
>
> printf("\t\tAux channel: %s (0x%02x)\n",
> aux_ch(child->aux_channel), child->aux_channel);
--
Jani Nikula, Intel Open Source Graphics Center
next prev parent reply other threads:[~2022-10-12 16:02 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-07 9:46 [igt-dev] [PATCH i-g-t 1/5] tools/intel_vbt_decode: update vbt defs from kernel Ville Syrjala
2022-09-07 9:46 ` [igt-dev] [PATCH i-g-t 2/5] tools/intel_vbt_decode: Decode the i2c speed Ville Syrjala
2022-09-07 9:46 ` [igt-dev] [PATCH i-g-t 3/5] tools/intel_vbt_decode: Resort block 2 decoding Ville Syrjala
2022-09-07 9:46 ` [igt-dev] [PATCH i-g-t 4/5] tools/intel_vbt_decode: Add version checks for a lot of child dev fields Ville Syrjala
2022-10-12 16:02 ` Jani Nikula [this message]
2022-09-07 9:46 ` [igt-dev] [PATCH i-g-t 5/5] tools/intel_vbt_decode: Decode more " Ville Syrjala
2022-09-07 11:35 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/5] tools/intel_vbt_decode: update vbt defs from kernel Patchwork
2022-09-07 16:45 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2022-10-12 16:00 ` [igt-dev] [PATCH i-g-t 1/5] " Jani Nikula
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87czaxt4hg.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=ville.syrjala@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.