* [igt-dev] [PATCH i-g-t 1/3] tools/intel_vbt_decode: Correctly decode v3 GPIO sequence
@ 2019-03-08 14:57 Ville Syrjala
2019-03-08 14:57 ` [igt-dev] [PATCH i-g-t 2/3] tools/intel_vbt_decode: Check the number of bytes dumped for the mipi seq operation Ville Syrjala
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Ville Syrjala @ 2019-03-08 14:57 UTC (permalink / raw)
To: igt-dev
From: Ville Syrjälä <ville.syrjala@linux.intel.com>
The v3 GPIO seq is three bytes, not two. Decode it correctly.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
tools/intel_vbt_decode.c | 33 ++++++++++++++++++++-------------
1 file changed, 20 insertions(+), 13 deletions(-)
diff --git a/tools/intel_vbt_decode.c b/tools/intel_vbt_decode.c
index e6e06b1b5618..2c71f0846c15 100644
--- a/tools/intel_vbt_decode.c
+++ b/tools/intel_vbt_decode.c
@@ -1151,7 +1151,7 @@ static void dump_mipi_config(struct context *context,
printf("\t\tPanel power cycle delay: %d\n", pps->panel_power_cycle_delay);
}
-static const uint8_t *mipi_dump_send_packet(const uint8_t *data)
+static const uint8_t *mipi_dump_send_packet(const uint8_t *data, uint8_t seq_version)
{
uint8_t flags, type;
uint16_t len, i;
@@ -1174,29 +1174,36 @@ static const uint8_t *mipi_dump_send_packet(const uint8_t *data)
return data;
}
-static const uint8_t *mipi_dump_delay(const uint8_t *data)
+static const uint8_t *mipi_dump_delay(const uint8_t *data, uint8_t seq_version)
{
printf("\t\tDelay: %u us\n", *((const uint32_t *)data));
return data + 4;
}
-static const uint8_t *mipi_dump_gpio(const uint8_t *data)
+static const uint8_t *mipi_dump_gpio(const uint8_t *data, uint8_t seq_version)
{
- uint8_t index, flags;
+ uint8_t index, number, flags;
- index = *data++;
- flags = *data++;
+ if (seq_version >= 3) {
+ index = *data++;
+ number = *data++;
+ flags = *data++;
- printf("\t\tGPIO index %u, source %d, set %d\n",
- index,
- (flags >> 1) & 3,
- flags & 1);
+ printf("\t\tGPIO index %u, number %u, set %d\n",
+ index, number, flags & 1);
+ } else {
+ index = *data++;
+ flags = *data++;
+
+ printf("\t\tGPIO index %u, source %d, set %d\n",
+ index, (flags >> 1) & 3, flags & 1);
+ }
return data;
}
-static const uint8_t *mipi_dump_i2c(const uint8_t *data)
+static const uint8_t *mipi_dump_i2c(const uint8_t *data, uint8_t seq_version)
{
uint8_t flags, index, bus, offset, len, i;
uint16_t address;
@@ -1218,7 +1225,7 @@ static const uint8_t *mipi_dump_i2c(const uint8_t *data)
return data;
}
-typedef const uint8_t * (*fn_mipi_elem_dump)(const uint8_t *data);
+typedef const uint8_t * (*fn_mipi_elem_dump)(const uint8_t *data, uint8_t seq_version);
static const fn_mipi_elem_dump dump_elem[] = {
[MIPI_SEQ_ELEM_SEND_PKT] = mipi_dump_send_packet,
@@ -1279,7 +1286,7 @@ static const uint8_t *dump_sequence(const uint8_t *data, uint8_t seq_version)
operation_size = *data++;
if (mipi_elem_dump) {
- data = mipi_elem_dump(data);
+ data = mipi_elem_dump(data, seq_version);
} else if (operation_size) {
/* We have size, skip. */
data += operation_size;
--
2.19.2
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [igt-dev] [PATCH i-g-t 2/3] tools/intel_vbt_decode: Check the number of bytes dumped for the mipi seq operation
2019-03-08 14:57 [igt-dev] [PATCH i-g-t 1/3] tools/intel_vbt_decode: Correctly decode v3 GPIO sequence Ville Syrjala
@ 2019-03-08 14:57 ` Ville Syrjala
2019-03-08 14:57 ` [igt-dev] [PATCH i-g-t 3/3] tools/intel_vbt_decode: Dump the GPIO value/config/flag as a raw hex byte Ville Syrjala
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Ville Syrjala @ 2019-03-08 14:57 UTC (permalink / raw)
To: igt-dev
From: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cross check the return value from the mipi seq dump function and the
size of the operation declared in the sequence (for v3+ sequence block).
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
tools/intel_vbt_decode.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/tools/intel_vbt_decode.c b/tools/intel_vbt_decode.c
index 2c71f0846c15..5742081ea29a 100644
--- a/tools/intel_vbt_decode.c
+++ b/tools/intel_vbt_decode.c
@@ -1286,7 +1286,14 @@ static const uint8_t *dump_sequence(const uint8_t *data, uint8_t seq_version)
operation_size = *data++;
if (mipi_elem_dump) {
- data = mipi_elem_dump(data, seq_version);
+ const u8 *next;
+
+ next = mipi_elem_dump(data, seq_version);
+ if (operation_size)
+ data += operation_size;
+ else
+ data = next;
+ assert(next == data);
} else if (operation_size) {
/* We have size, skip. */
data += operation_size;
--
2.19.2
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [igt-dev] [PATCH i-g-t 3/3] tools/intel_vbt_decode: Dump the GPIO value/config/flag as a raw hex byte
2019-03-08 14:57 [igt-dev] [PATCH i-g-t 1/3] tools/intel_vbt_decode: Correctly decode v3 GPIO sequence Ville Syrjala
2019-03-08 14:57 ` [igt-dev] [PATCH i-g-t 2/3] tools/intel_vbt_decode: Check the number of bytes dumped for the mipi seq operation Ville Syrjala
@ 2019-03-08 14:57 ` Ville Syrjala
2019-03-08 19:27 ` Jani Nikula
2019-03-08 19:27 ` [igt-dev] [PATCH i-g-t 1/3] tools/intel_vbt_decode: Correctly decode v3 GPIO sequence Jani Nikula
2019-03-08 20:44 ` [igt-dev] ✗ Fi.CI.BAT: failure for series starting with [i-g-t,1/3] " Patchwork
3 siblings, 1 reply; 6+ messages in thread
From: Ville Syrjala @ 2019-03-08 14:57 UTC (permalink / raw)
To: igt-dev
From: Ville Syrjälä <ville.syrjala@linux.intel.com>
The spec is totally confused when it comes to the GPIO flags byte.
To allow us to inspect that the decoded result at least seems
sensible let's also dump the raw byte. Should at least show if
some bits are set which we're not expecting.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
tools/intel_vbt_decode.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/tools/intel_vbt_decode.c b/tools/intel_vbt_decode.c
index 5742081ea29a..857b017b41dd 100644
--- a/tools/intel_vbt_decode.c
+++ b/tools/intel_vbt_decode.c
@@ -1190,14 +1190,14 @@ static const uint8_t *mipi_dump_gpio(const uint8_t *data, uint8_t seq_version)
number = *data++;
flags = *data++;
- printf("\t\tGPIO index %u, number %u, set %d\n",
- index, number, flags & 1);
+ printf("\t\tGPIO index %u, number %u, set %d (0x%02x)\n",
+ index, number, flags & 1, flags);
} else {
index = *data++;
flags = *data++;
- printf("\t\tGPIO index %u, source %d, set %d\n",
- index, (flags >> 1) & 3, flags & 1);
+ printf("\t\tGPIO index %u, source %d, set %d (0x%02x)\n",
+ index, (flags >> 1) & 3, flags & 1, flags);
}
return data;
--
2.19.2
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [igt-dev] [PATCH i-g-t 1/3] tools/intel_vbt_decode: Correctly decode v3 GPIO sequence
2019-03-08 14:57 [igt-dev] [PATCH i-g-t 1/3] tools/intel_vbt_decode: Correctly decode v3 GPIO sequence Ville Syrjala
2019-03-08 14:57 ` [igt-dev] [PATCH i-g-t 2/3] tools/intel_vbt_decode: Check the number of bytes dumped for the mipi seq operation Ville Syrjala
2019-03-08 14:57 ` [igt-dev] [PATCH i-g-t 3/3] tools/intel_vbt_decode: Dump the GPIO value/config/flag as a raw hex byte Ville Syrjala
@ 2019-03-08 19:27 ` Jani Nikula
2019-03-08 20:44 ` [igt-dev] ✗ Fi.CI.BAT: failure for series starting with [i-g-t,1/3] " Patchwork
3 siblings, 0 replies; 6+ messages in thread
From: Jani Nikula @ 2019-03-08 19:27 UTC (permalink / raw)
To: Ville Syrjala, igt-dev
On Fri, 08 Mar 2019, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> The v3 GPIO seq is three bytes, not two. Decode it correctly.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
and pushed to igt, I think it's better than mine
> ---
> tools/intel_vbt_decode.c | 33 ++++++++++++++++++++-------------
> 1 file changed, 20 insertions(+), 13 deletions(-)
>
> diff --git a/tools/intel_vbt_decode.c b/tools/intel_vbt_decode.c
> index e6e06b1b5618..2c71f0846c15 100644
> --- a/tools/intel_vbt_decode.c
> +++ b/tools/intel_vbt_decode.c
> @@ -1151,7 +1151,7 @@ static void dump_mipi_config(struct context *context,
> printf("\t\tPanel power cycle delay: %d\n", pps->panel_power_cycle_delay);
> }
>
> -static const uint8_t *mipi_dump_send_packet(const uint8_t *data)
> +static const uint8_t *mipi_dump_send_packet(const uint8_t *data, uint8_t seq_version)
> {
> uint8_t flags, type;
> uint16_t len, i;
> @@ -1174,29 +1174,36 @@ static const uint8_t *mipi_dump_send_packet(const uint8_t *data)
> return data;
> }
>
> -static const uint8_t *mipi_dump_delay(const uint8_t *data)
> +static const uint8_t *mipi_dump_delay(const uint8_t *data, uint8_t seq_version)
> {
> printf("\t\tDelay: %u us\n", *((const uint32_t *)data));
>
> return data + 4;
> }
>
> -static const uint8_t *mipi_dump_gpio(const uint8_t *data)
> +static const uint8_t *mipi_dump_gpio(const uint8_t *data, uint8_t seq_version)
> {
> - uint8_t index, flags;
> + uint8_t index, number, flags;
>
> - index = *data++;
> - flags = *data++;
> + if (seq_version >= 3) {
> + index = *data++;
> + number = *data++;
> + flags = *data++;
>
> - printf("\t\tGPIO index %u, source %d, set %d\n",
> - index,
> - (flags >> 1) & 3,
> - flags & 1);
> + printf("\t\tGPIO index %u, number %u, set %d\n",
> + index, number, flags & 1);
> + } else {
> + index = *data++;
> + flags = *data++;
> +
> + printf("\t\tGPIO index %u, source %d, set %d\n",
> + index, (flags >> 1) & 3, flags & 1);
> + }
>
> return data;
> }
>
> -static const uint8_t *mipi_dump_i2c(const uint8_t *data)
> +static const uint8_t *mipi_dump_i2c(const uint8_t *data, uint8_t seq_version)
> {
> uint8_t flags, index, bus, offset, len, i;
> uint16_t address;
> @@ -1218,7 +1225,7 @@ static const uint8_t *mipi_dump_i2c(const uint8_t *data)
> return data;
> }
>
> -typedef const uint8_t * (*fn_mipi_elem_dump)(const uint8_t *data);
> +typedef const uint8_t * (*fn_mipi_elem_dump)(const uint8_t *data, uint8_t seq_version);
>
> static const fn_mipi_elem_dump dump_elem[] = {
> [MIPI_SEQ_ELEM_SEND_PKT] = mipi_dump_send_packet,
> @@ -1279,7 +1286,7 @@ static const uint8_t *dump_sequence(const uint8_t *data, uint8_t seq_version)
> operation_size = *data++;
>
> if (mipi_elem_dump) {
> - data = mipi_elem_dump(data);
> + data = mipi_elem_dump(data, seq_version);
> } else if (operation_size) {
> /* We have size, skip. */
> data += operation_size;
--
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [igt-dev] [PATCH i-g-t 3/3] tools/intel_vbt_decode: Dump the GPIO value/config/flag as a raw hex byte
2019-03-08 14:57 ` [igt-dev] [PATCH i-g-t 3/3] tools/intel_vbt_decode: Dump the GPIO value/config/flag as a raw hex byte Ville Syrjala
@ 2019-03-08 19:27 ` Jani Nikula
0 siblings, 0 replies; 6+ messages in thread
From: Jani Nikula @ 2019-03-08 19:27 UTC (permalink / raw)
To: Ville Syrjala, igt-dev
On Fri, 08 Mar 2019, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> The spec is totally confused when it comes to the GPIO flags byte.
> To allow us to inspect that the decoded result at least seems
> sensible let's also dump the raw byte. Should at least show if
> some bits are set which we're not expecting.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
and pushed to igt
> ---
> tools/intel_vbt_decode.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/tools/intel_vbt_decode.c b/tools/intel_vbt_decode.c
> index 5742081ea29a..857b017b41dd 100644
> --- a/tools/intel_vbt_decode.c
> +++ b/tools/intel_vbt_decode.c
> @@ -1190,14 +1190,14 @@ static const uint8_t *mipi_dump_gpio(const uint8_t *data, uint8_t seq_version)
> number = *data++;
> flags = *data++;
>
> - printf("\t\tGPIO index %u, number %u, set %d\n",
> - index, number, flags & 1);
> + printf("\t\tGPIO index %u, number %u, set %d (0x%02x)\n",
> + index, number, flags & 1, flags);
> } else {
> index = *data++;
> flags = *data++;
>
> - printf("\t\tGPIO index %u, source %d, set %d\n",
> - index, (flags >> 1) & 3, flags & 1);
> + printf("\t\tGPIO index %u, source %d, set %d (0x%02x)\n",
> + index, (flags >> 1) & 3, flags & 1, flags);
> }
>
> return data;
--
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 6+ messages in thread
* [igt-dev] ✗ Fi.CI.BAT: failure for series starting with [i-g-t,1/3] tools/intel_vbt_decode: Correctly decode v3 GPIO sequence
2019-03-08 14:57 [igt-dev] [PATCH i-g-t 1/3] tools/intel_vbt_decode: Correctly decode v3 GPIO sequence Ville Syrjala
` (2 preceding siblings ...)
2019-03-08 19:27 ` [igt-dev] [PATCH i-g-t 1/3] tools/intel_vbt_decode: Correctly decode v3 GPIO sequence Jani Nikula
@ 2019-03-08 20:44 ` Patchwork
3 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2019-03-08 20:44 UTC (permalink / raw)
To: Ville Syrjälä; +Cc: igt-dev
== Series Details ==
Series: series starting with [i-g-t,1/3] tools/intel_vbt_decode: Correctly decode v3 GPIO sequence
URL : https://patchwork.freedesktop.org/series/57748/
State : failure
== Summary ==
Applying: tools/intel_vbt_decode: Correctly decode v3 GPIO sequence
Using index info to reconstruct a base tree...
M tools/intel_vbt_decode.c
Falling back to patching base and 3-way merge...
Auto-merging tools/intel_vbt_decode.c
CONFLICT (content): Merge conflict in tools/intel_vbt_decode.c
Patch failed at 0001 tools/intel_vbt_decode: Correctly decode v3 GPIO sequence
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2019-03-08 20:44 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-08 14:57 [igt-dev] [PATCH i-g-t 1/3] tools/intel_vbt_decode: Correctly decode v3 GPIO sequence Ville Syrjala
2019-03-08 14:57 ` [igt-dev] [PATCH i-g-t 2/3] tools/intel_vbt_decode: Check the number of bytes dumped for the mipi seq operation Ville Syrjala
2019-03-08 14:57 ` [igt-dev] [PATCH i-g-t 3/3] tools/intel_vbt_decode: Dump the GPIO value/config/flag as a raw hex byte Ville Syrjala
2019-03-08 19:27 ` Jani Nikula
2019-03-08 19:27 ` [igt-dev] [PATCH i-g-t 1/3] tools/intel_vbt_decode: Correctly decode v3 GPIO sequence Jani Nikula
2019-03-08 20:44 ` [igt-dev] ✗ Fi.CI.BAT: failure for series starting with [i-g-t,1/3] " Patchwork
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox