From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Jani Nikula <jani.nikula@intel.com>
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t 2/2] tools/intel_vbt_decode: add decoding of the compression parameters block
Date: Mon, 28 Oct 2019 18:35:30 +0200 [thread overview]
Message-ID: <20191028163530.GP1208@intel.com> (raw)
In-Reply-To: <20191028135451.17289-2-jani.nikula@intel.com>
On Mon, Oct 28, 2019 at 03:54:51PM +0200, Jani Nikula wrote:
> Decode block 56.
lgtm
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> ---
> tools/intel_vbt_decode.c | 87 ++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 87 insertions(+)
>
> diff --git a/tools/intel_vbt_decode.c b/tools/intel_vbt_decode.c
> index deba47994c89..625dc0787527 100644
> --- a/tools/intel_vbt_decode.c
> +++ b/tools/intel_vbt_decode.c
> @@ -1548,6 +1548,88 @@ static void dump_mipi_sequence(struct context *context,
> dump_sequence(sequence_ptrs[i], sequence->version);
> }
>
> +#define KB(x) ((x) * 1024)
> +
> +static int dsc_buffer_block_size(u8 buffer_block_size)
> +{
> + switch (buffer_block_size) {
> + case VBT_RC_BUFFER_BLOCK_SIZE_1KB:
> + return KB(1);
> + break;
> + case VBT_RC_BUFFER_BLOCK_SIZE_4KB:
> + return KB(4);
> + break;
> + case VBT_RC_BUFFER_BLOCK_SIZE_16KB:
> + return KB(16);
> + break;
> + case VBT_RC_BUFFER_BLOCK_SIZE_64KB:
> + return KB(64);
> + break;
> + default:
> + return 0;
> + }
> +}
> +
> +static int actual_buffer_size(u8 buffer_block_size, u8 rc_buffer_size)
> +{
> + return dsc_buffer_block_size(buffer_block_size) * (rc_buffer_size + 1);
> +}
> +
> +static const char *dsc_max_bpp(u8 value)
> +{
> + switch (value) {
> + case 0:
> + return "6";
> + case 1:
> + return "8";
> + case 2:
> + return "10";
> + case 3:
> + return "12";
> + default:
> + return "<unknown>";
> + }
> +}
> +
> +static void dump_compression_parameters(struct context *context,
> + const struct bdb_block *block)
> +{
> + const struct bdb_compression_parameters *dsc = block->data;
> + const struct dsc_compression_parameters_entry *data;
> + int i;
> +
> + for (i = 0; i < ARRAY_SIZE(dsc->data); i++) {
> + /* FIXME: need to handle sizeof(*data) != dsc->entry_size */
> + data = &dsc->data[i];
> +
> + if (i != context->panel_type && !context->dump_all_panel_types)
> + continue;
> +
> + printf("\tDSC block %d%s\n", i,
> + i == context->panel_type ? " *" : "");
> + printf("\t\tDSC version: %u.%u\n", data->version_major,
> + data->version_minor);
> + printf("\t\tActual buffer size: %d\n",
> + actual_buffer_size(data->rc_buffer_block_size,
> + data->rc_buffer_size));
> + printf("\t\t\tRC buffer block size: %d (%u)\n",
> + dsc_buffer_block_size(data->rc_buffer_block_size),
> + data->rc_buffer_block_size);
> + printf("\t\t\tRC buffer size: %u\n", data->rc_buffer_size);
> + printf("\t\tSlices per line: 0x%02x\n", data->slices_per_line);
> + printf("\t\tLine buffer depth: %u bits (%u)\n",
> + data->line_buffer_depth + 8, data->line_buffer_depth);
> + printf("\t\tBlock prediction enable: %u\n",
> + data->block_prediction_enable);
> + printf("\t\tMax bpp: %s bpp (%u)\n", dsc_max_bpp(data->max_bpp),
> + data->max_bpp);
> + printf("\t\tSupport 8 bpc: %u\n", data->support_8bpc);
> + printf("\t\tSupport 10 bpc: %u\n", data->support_10bpc);
> + printf("\t\tSupport 12 bpc: %u\n", data->support_12bpc);
> + printf("\t\tSlice height: %u\n", data->slice_height);
> + }
> +}
> +
> /* get panel type from lvds options block, or -1 if block not found */
> static int get_panel_type(struct context *context)
> {
> @@ -1665,6 +1747,11 @@ struct dumper dumpers[] = {
> .name = "MIPI sequence block",
> .dump = dump_mipi_sequence,
> },
> + {
> + .id = BDB_COMPRESSION_PARAMETERS,
> + .name = "Compression parameters block",
> + .dump = dump_compression_parameters,
> + },
> };
>
> static void hex_dump(const void *data, uint32_t size)
> --
> 2.20.1
>
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev
--
Ville Syrjälä
Intel
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2019-10-28 16:35 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-28 13:54 [igt-dev] [PATCH i-g-t 1/2] tools/intel_vbt_decode: update vbt defs Jani Nikula
2019-10-28 13:54 ` [igt-dev] [PATCH i-g-t 2/2] tools/intel_vbt_decode: add decoding of the compression parameters block Jani Nikula
2019-10-28 16:35 ` Ville Syrjälä [this message]
2019-10-28 14:37 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] tools/intel_vbt_decode: update vbt defs Patchwork
2019-10-28 16:07 ` [igt-dev] [PATCH i-g-t 1/2] " Ville Syrjälä
2019-10-29 8:39 ` Jani Nikula
2019-10-29 10:02 ` [igt-dev] ✓ Fi.CI.IGT: success for series starting with [i-g-t,1/2] " 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=20191028163530.GP1208@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=jani.nikula@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox