All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: Ville Syrjala <ville.syrjala@linux.intel.com>,
	igt-dev@lists.freedesktop.org
Subject: Re: [PATCH i-g-t 2/5] tools/intel_vbt_decode: Extract panel_str()
Date: Mon, 25 Mar 2024 16:56:48 +0200	[thread overview]
Message-ID: <87plviiclr.fsf@intel.com> (raw)
In-Reply-To: <20240322163251.11102-3-ville.syrjala@linux.intel.com>

On Fri, 22 Mar 2024, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Extract the code to generate the palen==panel_type indicator
> string to a small helper.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

Reviewed-by: Jani Nikula <jani.nikula@intel.com>

> ---
>  tools/intel_vbt_decode.c | 29 +++++++++++++++--------------
>  1 file changed, 15 insertions(+), 14 deletions(-)
>
> diff --git a/tools/intel_vbt_decode.c b/tools/intel_vbt_decode.c
> index 9a65a67b42bf..2473812cca6d 100644
> --- a/tools/intel_vbt_decode.c
> +++ b/tools/intel_vbt_decode.c
> @@ -90,6 +90,11 @@ static bool dump_panel(const struct context *context, int panel_type)
>  		context->dump_all_panel_types;
>  }
>  
> +static const char *panel_str(const struct context *context, int panel_type)
> +{
> +	return panel_type == context->panel_type ? " *" : "";
> +}
> +
>  /* Get BDB block size given a pointer to Block ID. */
>  static uint32_t _get_blocksize(const uint8_t *block_base)
>  {
> @@ -616,8 +621,7 @@ static void dump_backlight_info(struct context *context,
>  		if (!dump_panel(context, i))
>  			continue;
>  
> -		printf("\tPanel %d%s\n", i,
> -		       context->panel_type == i ? " *" : "");
> +		printf("\tPanel %d%s\n", i, panel_str(context, i));
>  
>  		blc = &backlight->data[i];
>  
> @@ -1231,7 +1235,7 @@ static void dump_lvds_options(struct context *context,
>  		if (!dump_panel(context, i))
>  			continue;
>  
> -		printf("\tPanel %d%s\n", i, context->panel_type == i ? " *" : "");
> +		printf("\tPanel %d%s\n", i, panel_str(context, i));
>  
>  		val = panel_bits(options->lvds_panel_channel_bits, i, 2);
>  		printf("\t\tChannel type: %s (0x%x)\n",
> @@ -1298,7 +1302,7 @@ static void dump_lvds_ptr_data(struct context *context,
>  		if (!dump_panel(context, i))
>  			continue;
>  
> -		printf("\tPanel %d%s\n", i, context->panel_type == i ? " *" : "");
> +		printf("\tPanel %d%s\n", i, panel_str(context, i));
>  
>  		if (ptrs->lvds_entries >= 1) {
>  			printf("\t\tFP timing offset: %d\n",
> @@ -1381,7 +1385,7 @@ static void dump_lvds_data(struct context *context,
>  		vtotal = vdisplay + _V_BLANK(timing_data);
>  		clock = _PIXEL_CLOCK(timing_data) / 1000;
>  
> -		printf("\tPanel %d%s\n", i, context->panel_type == i ? " *" : "");
> +		printf("\tPanel %d%s\n", i, panel_str(context, i));
>  		printf("\t\t%dx%d clock %d\n",
>  		       fp_timing->x_res, fp_timing->y_res,
>  		       _PIXEL_CLOCK(timing_data));
> @@ -1580,7 +1584,7 @@ static void dump_edp(struct context *context,
>  		if (!dump_panel(context, i))
>  			continue;
>  
> -		printf("\tPanel %d%s\n", i, context->panel_type == i ? " *" : "");
> +		printf("\tPanel %d%s\n", i, panel_str(context, i));
>  
>  		printf("\t\tPower Sequence: T3 %d T7 %d T9 %d T10 %d T12 %d\n",
>  		       edp->power_seqs[i].t3,
> @@ -1723,7 +1727,7 @@ static void dump_psr(struct context *context,
>  		if (!dump_panel(context, i))
>  			continue;
>  
> -		printf("\tPanel %d%s\n", i, context->panel_type == i ? " *" : "");
> +		printf("\tPanel %d%s\n", i, panel_str(context, i));
>  
>  		printf("\t\tFull link: %s\n", YESNO(psr->full_link));
>  		printf("\t\tRequire AUX to wakeup: %s\n", YESNO(psr->require_aux_to_wakeup));
> @@ -1800,7 +1804,7 @@ static void dump_lfp_power(struct context *context,
>  		if (!dump_panel(context, i))
>  			continue;
>  
> -		printf("\tPanel %d%s\n", i, context->panel_type == i ? " *" : "");
> +		printf("\tPanel %d%s\n", i, panel_str(context, i));
>  
>  		printf("\t\tDisplay Power Saving Technology (DPST): %s\n",
>  		       YESNO(panel_bool(lfp_block->dpst, i)));
> @@ -1932,8 +1936,7 @@ static void dump_mipi_config(struct context *context,
>  		if (!dump_panel(context, i))
>  			continue;
>  
> -		printf("\tPanel %d%s\n", i,
> -		       context->panel_type == i ? " *" : "");
> +		printf("\tPanel %d%s\n", i, panel_str(context, i));
>  
>  		printf("\t\tGeneral Param\n");
>  		printf("\t\t\t BTA disable: %s\n", config->bta ? "Disabled" : "Enabled");
> @@ -2386,8 +2389,7 @@ static void dump_mipi_sequence(struct context *context,
>  		if (!data)
>  			return;
>  
> -		printf("\tPanel %d%s\n", i,
> -		       context->panel_type == i ? " *" : "");
> +		printf("\tPanel %d%s\n", i, panel_str(context, i));
>  
>  		/* Parse the sequences. Corresponds to VBT parsing in the kernel. */
>  		for (;;) {
> @@ -2476,8 +2478,7 @@ static void dump_compression_parameters(struct context *context,
>  		if (!dump_panel(context, i))
>  			continue;
>  
> -		printf("\tDSC block %d%s\n", i,
> -		       i == context->panel_type ? " *" : "");
> +		printf("\tDSC block %d%s\n", i, panel_str(context, i));
>  		printf("\t\tDSC version: %u.%u\n", data->version_major,
>  		       data->version_minor);
>  		printf("\t\tActual buffer size: %d\n",

-- 
Jani Nikula, Intel

  reply	other threads:[~2024-03-25 14:56 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-22 16:32 [PATCH i-g-t 0/5] tools/intel_vbt_decode: Improve panel type handling Ville Syrjala
2024-03-22 16:32 ` [PATCH i-g-t 1/5] tools/intel_vbt_decode: Extract dump_panel() Ville Syrjala
2024-03-25 14:56   ` Jani Nikula
2024-03-22 16:32 ` [PATCH i-g-t 2/5] tools/intel_vbt_decode: Extract panel_str() Ville Syrjala
2024-03-25 14:56   ` Jani Nikula [this message]
2024-03-22 16:32 ` [PATCH i-g-t 3/5] tools/intel_vbt_decode: Change panel indicator from * to (1) Ville Syrjala
2024-03-25 14:57   ` Jani Nikula
2024-03-22 16:32 ` [PATCH i-g-t 4/5] tools/intel_vbt_decode: Also dump the second panel (panel_type2) Ville Syrjala
2024-03-25 15:04   ` Jani Nikula
2024-03-25 15:08     ` Ville Syrjälä
2024-03-25 16:33   ` [PATCH i-g-t v2 " Ville Syrjala
2024-03-22 16:32 ` [PATCH i-g-t 5/5] tools/intel_vbt_decode: Optionally determine panel type from EDID Ville Syrjala
2024-03-25 15:08   ` Jani Nikula
2024-03-25 15:16     ` Ville Syrjälä
2024-03-25 16:36   ` [PATCH i-g-t v2 " Ville Syrjala
2024-03-22 18:51 ` ✓ CI.xeBAT: success for tools/intel_vbt_decode: Improve panel type handling Patchwork
2024-03-22 18:56 ` ✓ Fi.CI.BAT: " Patchwork
2024-03-23 21:17 ` ✗ Fi.CI.IGT: failure " Patchwork
2024-03-25 19:39 ` ✗ Fi.CI.BAT: failure for tools/intel_vbt_decode: Improve panel type handling (rev3) Patchwork
2024-03-25 19:42 ` ✓ CI.xeBAT: success " Patchwork

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=87plviiclr.fsf@intel.com \
    --to=jani.nikula@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.