Unify HDMI audio EDID generation
Subsystems (2)
cover Unify HDMI audio EDID generation
HDMI audio EDIDs are used in both HDMI injection tests and Chamelium audio tests.
Simon Ser (3):
lib/tests/igt_edid: introduce EDID sanity checks lib/igt_edid: add support for Speaker Allocation Data blocks lib/igt_kms: introduce igt_kms_get_hdmi_audio_edid
lib/igt_edid.c | 12 ++++ lib/igt_edid.h | 18 +++++ lib/igt_kms.c | 133 ++++++++++++++++++++---------------- lib/igt_kms.h | 10 ++- lib/tests/igt_edid.c | 97 ++++++++++++++++++++++++++ lib/tests/igt_hdmi_inject.c | 1 - lib/tests/meson.build | 1 + tests/kms_chamelium.c | 62 +---------------- tests/kms_hdmi_inject.c | 9 ++- 9 files changed, 215 insertions(+), 128 deletions(-) create mode 100644 lib/tests/igt_edid.c
--
2.21.0
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH 1/3 lib/tests/igt_edid: introduce EDID sanity checks
The idea is to make sure we don't completely break EDIDs by performing some basic sanity-checking in lib tests.
The test currently only checks the base and alt EDIDs. More EDIDs will be added in the future: HDMI audio, 4K, 3D and so on.
The logic is mostly borrowed from lib/tests/igt_hdmi_inject.c. This patch is part of the "let's unify igt_edid and igt_hdmi_inject" series.
--- lib/tests/igt_edid.c | 96 +++++++++++++++++++++++++++++++++++++++++++ lib/tests/meson.build | 1 + 2 files changed, 97 insertions(+) create mode 100644 lib/tests/igt_edid.c
lib/tests/igt_edid.c new file +96 -0
@@ -0,0 +1,96 @@ +/* +* Copyright © 2019 Intel Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice (including the next +* paragraph) shall be included in all copies or substantial portions of the +* Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +* IN THE SOFTWARE. +* +* Authors: Simon Ser <[email protected]> +*/ + +#include "config.h" + +#include <stdbool.h> + +#include "igt_core.h" +#include "igt_kms.h" +#include "igt_edid.h" + +static const unsigned char edid_header[] = { +0x00 ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0x00 +}; + +/** +* Sanity check the header of the base EDID block. +*/ +static bool edid_header_is_valid (const unsigned char *raw_edid) +{ +size_t i; + +for (i =0 ; i <sizeof (edid_header); i++) +if (raw_edid[i] != edid_header[i]) +return false; + +return true; +} + +/** +* Sanity check the checksum of the EDID block. +*/ +static bool edid_block_checksum (const unsigned char *raw_edid) +{ +size_t i; +unsigned char csum =0 ; + +for (i =0 ; i <EDID_LENGTH ; i++) { + csum += raw_edid[i]; + } + +return csum ==0 ; +} + +typedef const unsigned char *(*get_edid_func )(void ); + +igt_simple_main +{ +const struct { +const char *desc; +get_edid_func f; +size_t exts; + } funcs[] = { + {"base" , igt_kms_get_base_edid,0 }, + {"alt" , igt_kms_get_alt_edid,0 }, + {0 }, + }, *f; +const unsigned char *edid; +size_t i; + +for (f = funcs; f->f; f++) { + edid = f->f (); + +igt_assert_f (edid_header_is_valid (edid), +"invalid header on %s EDID" , f->desc); +/* check base edid block */ +igt_assert_f (edid_block_checksum (edid), +"checksum failed on %s EDID" , f->desc); +/* check extension blocks, if any */ +for (i =0 ; i < f->exts; i++) +igt_assert_f (edid_block_checksum (edid + (i +1 ) *EDID_LENGTH ), +"CEA block checksum failed on %s EDID" , f->desc); + } +}
lib/tests/meson.build +1 -0
@@ -3,6 +3,7 @@ lib_tests = [ 'igt_can_fail', 'igt_can_fail_simple', 'igt_conflicting_args', + 'igt_edid', 'igt_exit_handler', 'igt_fork', 'igt_fork_helper',
Signature · 6 lines
2.21.0 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Re: [igt-dev] [PATCH i-g-t 1/3] lib/tests/igt_edid: introduce EDID sanity checks
Quoted 8 lines · Simon Ser
The idea is to make sure we don't completely break EDIDs by performing some basic sanity-checking in lib tests.
The test currently only checks the base and alt EDIDs. More EDIDs will be added in the future: HDMI audio, 4K, 3D and so on.
The logic is mostly borrowed from
lib/tests/igt_hdmi_inject.c. This patch is part of the "let's unifyigt_edidandigt_hdmi_inject" series.
Quoted 116 lines
Signed-off-by Simon Ser <[email protected]>--- lib/tests/igt_edid.c | 96 +++++++++++++++++++++++++++++++++++++++++++ lib/tests/meson.build | 1 + 2 files changed, 97 insertions(+) create mode 100644 lib/tests/igt_edid.clib/tests/igt_edid.c new file +96
-0@@ -0,0 +1,96 @@ +/* +* Copyright © 2019 Intel Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice (including the next +* paragraph) shall be included in all copies or substantial portions of the +* Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +* IN THE SOFTWARE. +* +* Authors: Simon Ser <[email protected]> +*/ + +#include "config.h" + +#include <stdbool.h> + +#include "igt_core.h" +#include "igt_kms.h" +#include "igt_edid.h" + +static const unsigned char edid_header[] = { +0x00 ,0xff ,0xff ,0xff ,0xff ,0xff ,0xff ,0x00 +}; + +/** +* Sanity check the header of the base EDID block. +*/ +static bool edid_header_is_valid (const unsigned char *raw_edid) +{ +size_t i; + +for (i =0 ; i <sizeof (edid_header); i++) +if (raw_edid[i] != edid_header[i]) +return false; + +return true; +} + +/** +* Sanity check the checksum of the EDID block. +*/ +static bool edid_block_checksum (const unsigned char *raw_edid) +{ +size_t i; +unsigned char csum =0 ; + +for (i =0 ; i <EDID_LENGTH ; i++) { + csum += raw_edid[i]; + } + +return csum ==0 ; +} + +typedef const unsigned char *(*get_edid_func )(void ); + +igt_simple_main +{ +const struct { +const char *desc; +get_edid_func f; +size_t exts; + } funcs[] = { + {"base" , igt_kms_get_base_edid,0 }, + {"alt" , igt_kms_get_alt_edid,0 }, + {0 }, + }, *f; +const unsigned char *edid; +size_t i; + +for (f = funcs; f->f; f++) { + edid = f->f (); + +igt_assert_f (edid_header_is_valid (edid), +"invalid header on %s EDID" , f->desc); +/* check base edid block */ +igt_assert_f (edid_block_checksum (edid), +"checksum failed on %s EDID" , f->desc); +/* check extension blocks, if any */ +for (i =0 ; i < f->exts; i++) +igt_assert_f (edid_block_checksum (edid + (i +1 ) *EDID_LENGTH ), +"CEA block checksum failed on %s EDID" , f->desc); + } +}lib/tests/meson.build +0
-0
lib/tests/meson.build lib_tests = [ · line 9
Quoted 7 lines
lib/tests/meson.build +1
-0@@ -3,6 +3,7 @@ lib_tests = [ 'igt_can_fail', 'igt_can_fail_simple', 'igt_conflicting_args', + 'igt_edid', 'igt_exit_handler', 'igt_fork', 'igt_fork_helper',
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH 2/3 lib/igt_edid: add support for Speaker Allocation Data blocks
In reply to Simon SerSpeaker Allocation Data blocks describe which speakers are present in the display device.
This block is required to make DisplayPort audio work.
--- lib/igt_edid.c | 12 ++++++++++++ lib/igt_edid.h | 18 ++++++++++++++++++ 2 files changed, 30 insertions(+)
lib/igt_edid.c +12 -0
@@ -348,6 +348,18 @@ size_t edid_cea_data_block_set_vsd(struct edid_cea_data_block *block,return sizeof (struct edid_cea_data_block ) + vsd_size; } +size_t edid_cea_data_block_set_speaker_alloc (struct edid_cea_data_block *block, +const struct cea_speaker_alloc *speakers) +{ +size_t size; + + size =sizeof (struct cea_speaker_alloc ); +edid_cea_data_block_init (block,EDID_CEA_DATA_SPEAKER_ALLOC , size); +memcpy (block->data.speakers, speakers, size); + +return sizeof (struct edid_cea_data_block ) + size; +} +void edid_ext_set_cea (struct edid_ext *ext,size_t data_blocks_size,uint8_t flags) {
lib/igt_edid.h +18 -0
@@ -195,6 +195,21 @@ struct cea_vsd {char data[]; }; +enum cea_speaker_alloc_item { +CEA_SPEAKER_FRONT_LEFT_RIGHT =1 <<0 , +CEA_SPEAKER_LFE =1 <<1 , +CEA_SPEAKER_FRONT_CENTER =1 <<2 , +CEA_SPEAKER_REAR_LEFT_RIGHT =1 <<3 , +CEA_SPEAKER_REAR_CENTER =1 <<4 , +CEA_SPEAKER_FRONT_LEFT_RIGHT_CENTER =1 <<5 , +CEA_SPEAKER_REAR_LEFT_RIGHT_CENTER =1 <<6 , +}; + +struct cea_speaker_alloc { +uint8_t speakers;/* enum cea_speaker_alloc_item */ +uint8_t reserved[2 ]; +} __attribute__((packed)); +enum edid_cea_data_type {EDID_CEA_DATA_AUDIO =1 ,EDID_CEA_DATA_VIDEO =2 ,
@@ -207,6 +222,7 @@ struct edid_cea_data_block {union {struct cea_sad sads[0 ];struct cea_vsd vsds[0 ]; +struct cea_speaker_alloc speakers[0 ]; } data; } __attribute__((packed));
@@ -295,6 +311,8 @@ size_t edid_cea_data_block_set_sad(struct edid_cea_data_block *block, const struct cea_sad *sads, size_t sads_len);size_t edid_cea_data_block_set_vsd (struct edid_cea_data_block *block,const struct cea_vsd *vsd,size_t vsd_size); +size_t edid_cea_data_block_set_speaker_alloc (struct edid_cea_data_block *block, +const struct cea_speaker_alloc *speakers);void edid_ext_set_cea (struct edid_ext *ext,size_t data_blocks_size,uint8_t flags);
Signature · 6 lines
2.21.0 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Re: [igt-dev] [PATCH i-g-t 2/3] lib/igt_edid: add support for Speaker Allocation Data blocks
Quoted 39 lines · Simon Ser
Speaker Allocation Data blocks describe which speakers are present in the display device.
This block is required to make DisplayPort audio work.
Signed-off-by Simon Ser <[email protected]>--- lib/igt_edid.c | 12 ++++++++++++ lib/igt_edid.h | 18 ++++++++++++++++++ 2 files changed, 30 insertions(+)lib/igt_edid.c +12
-0@@ -348,6 +348,18 @@ size_t edid_cea_data_block_set_vsd(struct edid_cea_data_block *block,return sizeof (struct edid_cea_data_block ) + vsd_size; } +size_t edid_cea_data_block_set_speaker_alloc (struct edid_cea_data_block *block, +const struct cea_speaker_alloc *speakers) +{ +size_t size; + + size =sizeof (struct cea_speaker_alloc ); +edid_cea_data_block_init (block,EDID_CEA_DATA_SPEAKER_ALLOC , size); +memcpy (block->data.speakers, speakers, size); + +return sizeof (struct edid_cea_data_block ) + size; +} +void edid_ext_set_cea (struct edid_ext *ext,size_t data_blocks_size,uint8_t flags) {lib/igt_edid.h +0
-0
lib/igt_edid.h struct cea_vsd { · line 198
Quoted 4 lines
lib/igt_edid.h +1
-0@@ -195,6 +195,21 @@ struct cea_vsd {char data[]; }; +enum cea_speaker_alloc_item {
Is that the official name? Having alloc in the name of an enum is a little odd...
Quoted 18 lines
lib/igt_edid.h +14
-0+CEA_SPEAKER_FRONT_LEFT_RIGHT =1 <<0 , +CEA_SPEAKER_LFE =1 <<1 , +CEA_SPEAKER_FRONT_CENTER =1 <<2 , +CEA_SPEAKER_REAR_LEFT_RIGHT =1 <<3 , +CEA_SPEAKER_REAR_CENTER =1 <<4 , +CEA_SPEAKER_FRONT_LEFT_RIGHT_CENTER =1 <<5 , + CEA_SPEAKER_REAR_LEFT_RIGHT_CENTER = 1 << 6, +}; + +struct cea_speaker_alloc { +uint8_t speakers;/* enum cea_speaker_alloc_item */ +uint8_t reserved[2 ]; +} __attribute__((packed)); +enum edid_cea_data_type {EDID_CEA_DATA_AUDIO =1 , EDID_CEA_DATA_VIDEO = 2,
lib/igt_edid.h struct edid_cea_data_block { · line 225
Quoted 4 lines
lib/igt_edid.h +1
-0@@ -207,6 +222,7 @@ struct edid_cea_data_block {union {struct cea_sad sads[0 ];struct cea_vsd vsds[0 ]; +struct cea_speaker_alloc speakers[0 ];
Why [0]? Shouldn't this all be [1]?
lib/igt_edid.h size_t edid_cea_data_block_set_sad(struct edid_cea_data_block *block, · line 318
Quoted 13 lines
lib/igt_edid.h +2
-0} data; } __attribute__((packed));@@ -295,6 +311,8 @@ size_t edid_cea_data_block_set_sad(struct edid_cea_data_block *block, const struct cea_sad *sads, size_t sads_len);size_t edid_cea_data_block_set_vsd (struct edid_cea_data_block *block,const struct cea_vsd *vsd,size_t vsd_size); +size_t edid_cea_data_block_set_speaker_alloc (struct edid_cea_data_block *block, +const struct cea_speaker_alloc *speakers);void edid_ext_set_cea (struct edid_ext *ext,size_t data_blocks_size,uint8_t flags);
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Re: [igt-dev] [PATCH i-g-t 2/3] lib/igt_edid: add support for Speaker Allocation Data blocks
Quoted 43 lines · Martin Peres
Quoted 42 lines · Simon Ser
Speaker Allocation Data blocks describe which speakers are present in the display device.
This block is required to make DisplayPort audio work.
Signed-off-by Simon Ser <[email protected]>--- lib/igt_edid.c | 12 ++++++++++++ lib/igt_edid.h | 18 ++++++++++++++++++ 2 files changed, 30 insertions(+)lib/igt_edid.c +12
-0@@ -348,6 +348,18 @@ size_t edid_cea_data_block_set_vsd(struct edid_cea_data_block *block,return sizeof (struct edid_cea_data_block ) + vsd_size; } +size_t edid_cea_data_block_set_speaker_alloc (struct edid_cea_data_block *block, +const struct cea_speaker_alloc *speakers) +{ +size_t size; + + size =sizeof (struct cea_speaker_alloc ); +edid_cea_data_block_init (block,EDID_CEA_DATA_SPEAKER_ALLOC , size); +memcpy (block->data.speakers, speakers, size); + +return sizeof (struct edid_cea_data_block ) + size; +} +void edid_ext_set_cea (struct edid_ext *ext,size_t data_blocks_size,uint8_t flags) {lib/igt_edid.h +0
-0@@ -195,6 +195,21 @@ struct cea_vsd {char data[]; };
Quoted 4 lines
lib/igt_edid.h struct cea_vsd { · line 198
Quoted 1 line
lib/igt_edid.h +1
-0+enum cea_speaker_alloc_item {Is that the official name? Having alloc in the name of an enum is a little odd...
Yes, "Speaker Allocation Data" is the official name.
Quoted 16 lines
Quoted 16 lines
lib/igt_edid.h +14
-0+CEA_SPEAKER_FRONT_LEFT_RIGHT =1 <<0 , +CEA_SPEAKER_LFE =1 <<1 , +CEA_SPEAKER_FRONT_CENTER =1 <<2 , +CEA_SPEAKER_REAR_LEFT_RIGHT =1 <<3 , +CEA_SPEAKER_REAR_CENTER =1 <<4 , +CEA_SPEAKER_FRONT_LEFT_RIGHT_CENTER =1 <<5 , + CEA_SPEAKER_REAR_LEFT_RIGHT_CENTER = 1 << 6, +}; + +struct cea_speaker_alloc { +uint8_t speakers;/* enum cea_speaker_alloc_item */ +uint8_t reserved[2 ]; +} __attribute__((packed)); +enum edid_cea_data_type { EDID_CEA_DATA_AUDIO = 1,
Quoted 8 lines
lib/igt_edid.h struct edid_cea_data_block { · line 225
Quoted 6 lines
lib/igt_edid.h +1
-0EDID_CEA_DATA_VIDEO = 2,@@ -207,6 +222,7 @@ struct edid_cea_data_block {union {struct cea_sad sads[0 ];struct cea_vsd vsds[0 ]; +struct cea_speaker_alloc speakers[0 ];Why [0]? Shouldn't this all be [1]?
EDID allows a variable number of these, so this struct has variable length. The array must have a zero size otherwise sizeof-based computations will be off (each of the members of the union have a different size). The idea is to allow indexing any of these from the end of the header block.
Alternatively, in all places where we access these fields we could cast the edid_cea_data_block to a char *, then add sizeof(struct edid_cea_data_block), then cast to a struct cea_speaker_alloc *. This sounds a little annoying to write and to read, though.
Quoted 13 lines
lib/igt_edid.h size_t edid_cea_data_block_set_sad(struct edid_cea_data_block *block, · line 318
Quoted 13 lines
lib/igt_edid.h +2
-0} data; } __attribute__((packed));@@ -295,6 +311,8 @@ size_t edid_cea_data_block_set_sad(struct edid_cea_data_block *block, const struct cea_sad *sads, size_t sads_len);size_t edid_cea_data_block_set_vsd (struct edid_cea_data_block *block,const struct cea_vsd *vsd,size_t vsd_size); +size_t edid_cea_data_block_set_speaker_alloc (struct edid_cea_data_block *block, +const struct cea_speaker_alloc *speakers);void edid_ext_set_cea (struct edid_ext *ext,size_t data_blocks_size,uint8_t flags);
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Martin Peres
Reviewed-byRe: [igt-dev] [PATCH i-g-t 2/3] lib/igt_edid: add support for Speaker Allocation Data blocks
Quoted 44 lines · Simon
Quoted 43 lines · Martin Peres
Quoted 42 lines · Simon Ser
Speaker Allocation Data blocks describe which speakers are present in the display device.
This block is required to make DisplayPort audio work.
Signed-off-by Simon Ser <[email protected]>--- lib/igt_edid.c | 12 ++++++++++++ lib/igt_edid.h | 18 ++++++++++++++++++ 2 files changed, 30 insertions(+)lib/igt_edid.c +12
-0@@ -348,6 +348,18 @@ size_t edid_cea_data_block_set_vsd(struct edid_cea_data_block *block,return sizeof (struct edid_cea_data_block ) + vsd_size; } +size_t edid_cea_data_block_set_speaker_alloc (struct edid_cea_data_block *block, +const struct cea_speaker_alloc *speakers) +{ +size_t size; + + size =sizeof (struct cea_speaker_alloc ); +edid_cea_data_block_init (block,EDID_CEA_DATA_SPEAKER_ALLOC , size); +memcpy (block->data.speakers, speakers, size); + +return sizeof (struct edid_cea_data_block ) + size; +} +void edid_ext_set_cea (struct edid_ext *ext,size_t data_blocks_size,uint8_t flags) {lib/igt_edid.h +0
-0@@ -195,6 +195,21 @@ struct cea_vsd {char data[]; };
Quoted 6 lines
Quoted 4 lines
lib/igt_edid.h struct cea_vsd { · line 198
Quoted 1 line
lib/igt_edid.h +1
-0+enum cea_speaker_alloc_item {Is that the official name? Having alloc in the name of an enum is a little odd...
Yes, "Speaker Allocation Data" is the official name.
ACK
Quoted 32 lines
Quoted 17 lines
Quoted 17 lines
lib/igt_edid.h +14
-0+CEA_SPEAKER_FRONT_LEFT_RIGHT =1 <<0 , +CEA_SPEAKER_LFE =1 <<1 , +CEA_SPEAKER_FRONT_CENTER =1 <<2 , +CEA_SPEAKER_REAR_LEFT_RIGHT =1 <<3 , +CEA_SPEAKER_REAR_CENTER =1 <<4 , +CEA_SPEAKER_FRONT_LEFT_RIGHT_CENTER =1 <<5 , + CEA_SPEAKER_REAR_LEFT_RIGHT_CENTER = 1 << 6, +}; + +struct cea_speaker_alloc { +uint8_t speakers;/* enum cea_speaker_alloc_item */ +uint8_t reserved[2 ]; +} __attribute__((packed)); +enum edid_cea_data_type { EDID_CEA_DATA_AUDIO = 1,Quoted 8 lines
lib/igt_edid.h struct edid_cea_data_block { · line 225
Quoted 6 lines
lib/igt_edid.h +1
-0EDID_CEA_DATA_VIDEO = 2,@@ -207,6 +222,7 @@ struct edid_cea_data_block {union {struct cea_sad sads[0 ];struct cea_vsd vsds[0 ]; +struct cea_speaker_alloc speakers[0 ];Why [0]? Shouldn't this all be [1]?
EDID allows a variable number of these, so this struct has variable length. The array must have a zero size otherwise sizeof-based computations will be off (each of the members of the union have a different size). The idea is to allow indexing any of these from the end of the header block.
Quoted 4 lines
Alternatively, in all places where we access these fields we could cast the
edid_cea_data_blockto a char *, then addsizeof(struct edid_cea_data_block), then cast to a structcea_speaker_alloc*. This sounds a little annoying to write and to read, though.
I see... Well, sounds like an acceptable reasoning. Is it documented on top of the union already?
Regardless:
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
lib/igt_edid.h +0
-0} data; } __attribute__((packed));
Quoted 10 lines
Quoted 10 lines
lib/igt_edid.h size_t edid_cea_data_block_set_sad(struct edid_cea_data_block *block, · line 318
Quoted 10 lines
lib/igt_edid.h +2
-0@@ -295,6 +311,8 @@ size_t edid_cea_data_block_set_sad(struct edid_cea_data_block *block, const struct cea_sad *sads, size_t sads_len);size_t edid_cea_data_block_set_vsd (struct edid_cea_data_block *block,const struct cea_vsd *vsd,size_t vsd_size); +size_t edid_cea_data_block_set_speaker_alloc (struct edid_cea_data_block *block, +const struct cea_speaker_alloc *speakers);void edid_ext_set_cea (struct edid_ext *ext,size_t data_blocks_size,uint8_t flags);
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH 3/3 lib/igt_kms: introduce igt_kms_get_hdmi_audio_edid
In reply to Simon SerThis new function uses igt_edid to generate an EDID suitable for testing HDMI audio. It's imported from kms_chamelium with minor edits, it's used there and in kms_hdmi_inject. A (unexported for now) generate_hdmi_audio_edid function enables generation of EDIDs with arbitrary SAD and speaker blocks.
This obsoletes kmstest_edid_add_audio.
The sanity check for the HDMI audio EDID has been moved from lib/tests/igt_hdmi_inject.c to lib/tests/igt_edid.c.
--- lib/igt_kms.c | 133 ++++++++++++++++++++---------------- lib/igt_kms.h | 10 ++- lib/tests/igt_edid.c | 1 + lib/tests/igt_hdmi_inject.c | 1 - tests/kms_chamelium.c | 62 +---------------- tests/kms_hdmi_inject.c | 9 ++- 6 files changed, 88 insertions(+), 128 deletions(-)
lib/igt_kms.c +75 -58
@@ -26,6 +26,8 @@*/ #include "config.h" + +#include <assert.h> #include <inttypes.h> #include <unistd.h> #include <stdio.h>
@@ -180,6 +182,79 @@ const unsigned char *igt_kms_get_alt_edid(void)return (unsigned char *) &edid; } +static void +generate_hdmi_audio_edid (unsigned char raw_edid[static HDMI_AUDIO_EDID_LENGTH ], +struct cea_sad *sad, +struct cea_speaker_alloc *speaker_alloc) +{ +struct edid *edid; +struct edid_ext *edid_ext; +struct edid_cea *edid_cea; +char *cea_data; +struct edid_cea_data_block *block; +const struct cea_vsd *vsd; +size_t cea_data_size, vsd_size; + +/* Create a new EDID from the base IGT EDID, and add an +* extension that advertises audio support. */ + edid = (struct edid *) raw_edid; +memcpy (edid,igt_kms_get_base_edid (),sizeof (struct edid )); + edid->extensions_len =1 ; + edid_ext = &edid->extensions[0 ]; + edid_cea = &edid_ext->data.cea; + cea_data = edid_cea->data; + cea_data_size =0 ; + +/* Short Audio Descriptor block */ + block = (struct edid_cea_data_block *) &cea_data[cea_data_size]; + cea_data_size +=edid_cea_data_block_set_sad (block, sad,1 ); + +/* A Vendor Specific Data block is needed for HDMI audio */ + block = (struct edid_cea_data_block *) &cea_data[cea_data_size]; + vsd =cea_vsd_get_hdmi_default (&vsd_size); + cea_data_size +=edid_cea_data_block_set_vsd (block, vsd, + vsd_size); + +/* Speaker Allocation Data block */ + block = (struct edid_cea_data_block *) &cea_data[cea_data_size]; + cea_data_size +=edid_cea_data_block_set_speaker_alloc (block, + speaker_alloc); + +assert (cea_data_size <=sizeof (edid_cea->data)); + +edid_ext_set_cea (edid_ext, cea_data_size, +EDID_CEA_BASIC_AUDIO ); + +edid_update_checksum (edid); +edid_ext_update_cea_checksum (edid_ext); +} + +const unsigned char *igt_kms_get_hdmi_audio_edid (void ) +{ +int channels; +uint8_t sampling_rates, sample_sizes; +static unsigned char raw_edid[HDMI_AUDIO_EDID_LENGTH ] = {0 }; +struct cea_sad sad = {0 }; +struct cea_speaker_alloc speaker_alloc = {0 }; + +/* Initialize the Short Audio Descriptor for PCM */ + channels =2 ; + sampling_rates =CEA_SAD_SAMPLING_RATE_32KHZ | +CEA_SAD_SAMPLING_RATE_44KHZ | +CEA_SAD_SAMPLING_RATE_48KHZ ; + sample_sizes =CEA_SAD_SAMPLE_SIZE_16 | +CEA_SAD_SAMPLE_SIZE_20 | +CEA_SAD_SAMPLE_SIZE_24 ; +cea_sad_init_pcm (&sad, channels, sampling_rates, sample_sizes); + +/* Initialize the Speaker Allocation Data */ + speaker_alloc.speakers =CEA_SPEAKER_FRONT_LEFT_RIGHT_CENTER ; + +generate_hdmi_audio_edid (raw_edid, &sad, &speaker_alloc); + +return raw_edid; +} +const char *const igt_plane_prop_names[IGT_NUM_PLANE_PROPS ] = { [IGT_PLANE_SRC_X ] ="SRC_X" , [IGT_PLANE_SRC_Y ] ="SRC_Y" ,
@@ -1356,64 +1431,6 @@ void kmstest_edid_add_4k(const unsigned char *edid, size_t length,update_edid_csum (new_edid.data, length); } -/** -* kmstest_edid_add_audio: -* @edid: an existing valid edid block -* @length: length of @edid -* @new_edid_ptr: pointer to where the new edid will be placed -* @new_length: pointer to the size of the new edid -* -* Makes a copy of an existing edid block and adds an extension indicating -* basic audio support and speaker data block. -* -*/ -void kmstest_edid_add_audio (const unsigned char *edid,size_t length, -unsigned char *new_edid_ptr[],size_t *new_length) -{ -char vsdb_block_len =10 , audio_block_len =4 , spkr_block_len =4 ; -struct edid_block new_edid =init_cea_block (edid, length, new_edid_ptr, - new_length, - vsdb_block_len + - audio_block_len + - spkr_block_len, -DTD_SUPPORTS_AUDIO ); -int pos = new_edid.pos; - -/* audio block, short audio block descriptors */ - new_edid.data[pos++] = (1 <<5 ) | (audio_block_len -1 ); - new_edid.data[pos++] =0x09 ;/* Audio Format, PCM */ - new_edid.data[pos++] =0x07 ;/* Frequency, 32, 44.1, 48kHz */ - new_edid.data[pos++] =0x07 ;/* Bit Rate 16, 20, 24 bit */ - - -/* vsdb block ( id | length ) -- need vsdb as well -* otherwise the kernel will fallback to lower clock modes */ - new_edid.data[pos++] =3 <<5 | (vsdb_block_len -1 ); -/* registration id */ - new_edid.data[pos++] =0x3 ; - new_edid.data[pos++] =0xc ; - new_edid.data[pos++] =0x0 ; -/* source physical address */ - new_edid.data[pos++] =0x10 ; - new_edid.data[pos++] =0x00 ; -/* Supports_AI ... etc */ - new_edid.data[pos++] =0x00 ; -/* Max TMDS Clock */ - new_edid.data[pos++] =0x00 ; -/* Latency present, HDMI Video Present */ - new_edid.data[pos++] =0x20 ; -/* HDMI Video */ - new_edid.data[pos++] =0x00 ;/* 3D present */ - -/* speaker data block */ - new_edid.data[pos++] = (4 <<5 ) | (spkr_block_len -1 ); - new_edid.data[pos++] = (1 <<5 ); - new_edid.data[pos++] =0x00 ; - new_edid.data[pos++] =0x00 ; - -update_edid_csum (new_edid.data, length); -} -/** * kmstest_unset_all_crtcs: * @drm_fd: the DRM fd
lib/igt_kms.h +7 -3
@@ -196,7 +196,6 @@ bool kmstest_force_connector(int fd, drmModeConnector *connector, enum kmstest_force_connector_state state);void kmstest_edid_add_3d (const unsigned char *edid,size_t length,unsigned char *new_edid_ptr[],size_t *new_length);void kmstest_edid_add_4k (const unsigned char *edid,size_t length,unsigned char *new_edid_ptr[],size_t *new_length); -void kmstest_edid_add_audio (const unsigned char *edid,size_t length,unsigned char *new_edid_ptr[],size_t *new_length);void kmstest_force_edid (int drm_fd,drmModeConnector *connector,const unsigned char *edid,size_t length);
@@ -754,9 +753,14 @@ void igt_reset_connectors(void);uint32_t kmstest_get_vbl_flag (uint32_t pipe_id); +struct cea_sad ; +struct cea_speaker_alloc ; +#define EDID_LENGTH 128 -const unsigned char *igt_kms_get_base_edid (void ); -const unsigned char *igt_kms_get_alt_edid (void ); +#define HDMI_AUDIO_EDID_LENGTH (2 * EDID_LENGTH) +const unsigned char *igt_kms_get_base_edid (void ); +const unsigned char *igt_kms_get_alt_edid (void ); +const unsigned char *igt_kms_get_hdmi_audio_edid (void );struct udev_monitor *igt_watch_hotplug (void ); bool igt_hotplug_detected(struct udev_monitor *mon,
lib/tests/igt_edid.c +1 -0
@@ -75,6 +75,7 @@ igt_simple_main } funcs[] = { { "base", igt_kms_get_base_edid, 0 }, { "alt", igt_kms_get_alt_edid, 0 }, + { "hdmi_audio", igt_kms_get_hdmi_audio_edid, 1 }, {0}, }, *f; const unsigned char *edid;
lib/tests/igt_hdmi_inject.c +0 -1
@@ -73,7 +73,6 @@ igt_simple_main } funcs[] = { { "3D", kmstest_edid_add_3d }, { "4k", kmstest_edid_add_4k }, - { "audio", kmstest_edid_add_audio }, { NULL, NULL }, }, *f;
tests/kms_chamelium.c +1 -61
74 lines not on this page · raw message
tests/kms_hdmi_inject.c +4 -5
@@ -24,6 +24,7 @@#include <dirent.h> #include "igt.h" +#include "igt_edid.h" #define HDISPLAY_4K 3840#define VDISPLAY_4K 2160
@@ -211,14 +212,14 @@ eld_is_valid(void)static void hdmi_inject_audio (int drm_fd,drmModeConnector *connector) { -unsigned char *edid; +const unsigned char *edid;size_t length;int fb_id, cid, ret, crtc_mask =-1 ;struct igt_fb fb;struct kmstest_connector_config config; -kmstest_edid_add_audio (igt_kms_get_base_edid (),EDID_LENGTH , &edid, - &length); + edid =igt_kms_get_hdmi_audio_edid (); + length =HDMI_AUDIO_EDID_LENGTH ;kmstest_force_edid (drm_fd, connector, edid, length);
@@ -261,8 +262,6 @@ hdmi_inject_audio(int drm_fd, drmModeConnector *connector)kmstest_force_connector (drm_fd, connector,FORCE_CONNECTOR_UNSPECIFIED );kmstest_force_edid (drm_fd, connector,NULL ,0 ); - -free (edid); } igt_main
Signature · 6 lines
2.21.0 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Re: [igt-dev] [PATCH i-g-t 3/3] lib/igt_kms: introduce igt_kms_get_hdmi_audio_edid
Quoted 73 lines · Simon Ser
This new function uses
igt_edidto generate an EDID suitable for testing HDMI audio. It's imported fromkms_chameliumwith minor edits, it's used there and inkms_hdmi_inject. A (unexported for now)generate_hdmi_audio_edidfunction enables generation of EDIDs with arbitrary SAD and speaker blocks.This obsoletes
kmstest_edid_add_audio.The sanity check for the HDMI audio EDID has been moved from
lib/tests/igt_hdmi_inject.ctolib/tests/igt_edid.c.Signed-off-by Simon Ser <[email protected]>--- lib/igt_kms.c | 133 ++++++++++++++++++++---------------- lib/igt_kms.h | 10 ++- lib/tests/igt_edid.c | 1 + lib/tests/igt_hdmi_inject.c | 1 - tests/kms_chamelium.c | 62 +---------------- tests/kms_hdmi_inject.c | 9 ++- 6 files changed, 88 insertions(+), 128 deletions(-)lib/igt_kms.c +38
-0@@ -26,6 +26,8 @@*/ #include "config.h" + +#include <assert.h> #include <inttypes.h> #include <unistd.h> #include <stdio.h> @@ -180,6 +182,79 @@ const unsigned char *igt_kms_get_alt_edid(void)return (unsigned char *) &edid; } +static void +generate_hdmi_audio_edid (unsigned char raw_edid[static HDMI_AUDIO_EDID_LENGTH ], +struct cea_sad *sad, +struct cea_speaker_alloc *speaker_alloc) +{ +struct edid *edid; +struct edid_ext *edid_ext; +struct edid_cea *edid_cea; +char *cea_data; +struct edid_cea_data_block *block; +const struct cea_vsd *vsd; +size_t cea_data_size, vsd_size; + +/* Create a new EDID from the base IGT EDID, and add an +* extension that advertises audio support. */ + edid = (struct edid *) raw_edid; +memcpy (edid,igt_kms_get_base_edid (),sizeof (struct edid )); + edid->extensions_len =1 ; + edid_ext = &edid->extensions[0 ]; + edid_cea = &edid_ext->data.cea; + cea_data = edid_cea->data; + cea_data_size =0 ; + +/* Short Audio Descriptor block */ + block = (struct edid_cea_data_block *) &cea_data[cea_data_size]; + cea_data_size +=edid_cea_data_block_set_sad (block, sad,1 ); + +/* A Vendor Specific Data block is needed for HDMI audio */ + block = (struct edid_cea_data_block *) &cea_data[cea_data_size]; + vsd =cea_vsd_get_hdmi_default (&vsd_size); + cea_data_size +=edid_cea_data_block_set_vsd (block, vsd, + vsd_size); + +/* Speaker Allocation Data block */ + block = (struct edid_cea_data_block *) &cea_data[cea_data_size]; + cea_data_size += edid_cea_data_block_set_speaker_alloc(block,
lib/igt_kms.c const unsigned char *igt_kms_get_alt_edid(void) · line 230
Quoted 10 lines
lib/igt_kms.c +10
-0+ speaker_alloc); + +assert (cea_data_size <=sizeof (edid_cea->data)); + +edid_ext_set_cea (edid_ext, cea_data_size, +EDID_CEA_BASIC_AUDIO ); + +edid_update_checksum (edid); +edid_ext_update_cea_checksum (edid_ext); +}
Looks pretty neat!
Quoted 260 lines
lib/igt_kms.c +27
-58+ +const unsigned char *igt_kms_get_hdmi_audio_edid (void ) +{ +int channels; +uint8_t sampling_rates, sample_sizes; +static unsigned char raw_edid[HDMI_AUDIO_EDID_LENGTH ] = {0 }; +struct cea_sad sad = {0 }; +struct cea_speaker_alloc speaker_alloc = {0 }; + +/* Initialize the Short Audio Descriptor for PCM */ + channels =2 ; + sampling_rates =CEA_SAD_SAMPLING_RATE_32KHZ | +CEA_SAD_SAMPLING_RATE_44KHZ | +CEA_SAD_SAMPLING_RATE_48KHZ ; + sample_sizes =CEA_SAD_SAMPLE_SIZE_16 | +CEA_SAD_SAMPLE_SIZE_20 | +CEA_SAD_SAMPLE_SIZE_24 ; +cea_sad_init_pcm (&sad, channels, sampling_rates, sample_sizes); + +/* Initialize the Speaker Allocation Data */ + speaker_alloc.speakers =CEA_SPEAKER_FRONT_LEFT_RIGHT_CENTER ; + +generate_hdmi_audio_edid (raw_edid, &sad, &speaker_alloc); + +return raw_edid; +} +const char *const igt_plane_prop_names[IGT_NUM_PLANE_PROPS ] = { [IGT_PLANE_SRC_X ] ="SRC_X" , [IGT_PLANE_SRC_Y ] ="SRC_Y" ,@@ -1356,64 +1431,6 @@ void kmstest_edid_add_4k(const unsigned char *edid, size_t length,update_edid_csum (new_edid.data, length); } -/** -* kmstest_edid_add_audio: -* @edid: an existing valid edid block -* @length: length of @edid -* @new_edid_ptr: pointer to where the new edid will be placed -* @new_length: pointer to the size of the new edid -* -* Makes a copy of an existing edid block and adds an extension indicating -* basic audio support and speaker data block. -* -*/ -void kmstest_edid_add_audio (const unsigned char *edid,size_t length, -unsigned char *new_edid_ptr[],size_t *new_length) -{ -char vsdb_block_len =10 , audio_block_len =4 , spkr_block_len =4 ; -struct edid_block new_edid =init_cea_block (edid, length, new_edid_ptr, - new_length, - vsdb_block_len + - audio_block_len + - spkr_block_len, -DTD_SUPPORTS_AUDIO ); -int pos = new_edid.pos; - -/* audio block, short audio block descriptors */ - new_edid.data[pos++] = (1 <<5 ) | (audio_block_len -1 ); - new_edid.data[pos++] =0x09 ;/* Audio Format, PCM */ - new_edid.data[pos++] =0x07 ;/* Frequency, 32, 44.1, 48kHz */ - new_edid.data[pos++] =0x07 ;/* Bit Rate 16, 20, 24 bit */ - - -/* vsdb block ( id | length ) -- need vsdb as well -* otherwise the kernel will fallback to lower clock modes */ - new_edid.data[pos++] =3 <<5 | (vsdb_block_len -1 ); -/* registration id */ - new_edid.data[pos++] =0x3 ; - new_edid.data[pos++] =0xc ; - new_edid.data[pos++] =0x0 ; -/* source physical address */ - new_edid.data[pos++] =0x10 ; - new_edid.data[pos++] =0x00 ; -/* Supports_AI ... etc */ - new_edid.data[pos++] =0x00 ; -/* Max TMDS Clock */ - new_edid.data[pos++] =0x00 ; -/* Latency present, HDMI Video Present */ - new_edid.data[pos++] =0x20 ; -/* HDMI Video */ - new_edid.data[pos++] =0x00 ;/* 3D present */ - -/* speaker data block */ - new_edid.data[pos++] = (4 <<5 ) | (spkr_block_len -1 ); - new_edid.data[pos++] = (1 <<5 ); - new_edid.data[pos++] =0x00 ; - new_edid.data[pos++] =0x00 ; - -update_edid_csum (new_edid.data, length); -} -/** * kmstest_unset_all_crtcs: * @drm_fd: the DRM fd lib/igt_kms.h +7
-3@@ -196,7 +196,6 @@ bool kmstest_force_connector(int fd, drmModeConnector *connector, enum kmstest_force_connector_state state);void kmstest_edid_add_3d (const unsigned char *edid,size_t length,unsigned char *new_edid_ptr[],size_t *new_length);void kmstest_edid_add_4k (const unsigned char *edid,size_t length,unsigned char *new_edid_ptr[],size_t *new_length); -void kmstest_edid_add_audio (const unsigned char *edid,size_t length,unsigned char *new_edid_ptr[],size_t *new_length);void kmstest_force_edid (int drm_fd,drmModeConnector *connector,const unsigned char *edid,size_t length);@@ -754,9 +753,14 @@ void igt_reset_connectors(void);uint32_t kmstest_get_vbl_flag (uint32_t pipe_id); +struct cea_sad ; +struct cea_speaker_alloc ; +#define EDID_LENGTH 128 -const unsigned char *igt_kms_get_base_edid (void ); -const unsigned char *igt_kms_get_alt_edid (void ); +#define HDMI_AUDIO_EDID_LENGTH (2 * EDID_LENGTH) +const unsigned char *igt_kms_get_base_edid (void ); +const unsigned char *igt_kms_get_alt_edid (void ); +const unsigned char *igt_kms_get_hdmi_audio_edid (void );struct udev_monitor *igt_watch_hotplug (void ); bool igt_hotplug_detected(struct udev_monitor *mon,lib/tests/igt_edid.c +1
-0@@ -75,6 +75,7 @@ igt_simple_main } funcs[] = { { "base", igt_kms_get_base_edid, 0 }, { "alt", igt_kms_get_alt_edid, 0 }, + { "hdmi_audio", igt_kms_get_hdmi_audio_edid, 1 }, {0}, }, *f; const unsigned char *edid;lib/tests/igt_hdmi_inject.c +0
-1@@ -73,7 +73,6 @@ igt_simple_main } funcs[] = { { "3D", kmstest_edid_add_3d }, { "4k", kmstest_edid_add_4k }, - { "audio", kmstest_edid_add_audio }, { NULL, NULL }, }, *f;tests/kms_chamelium.c +1
-61@@ -1740,66 +1740,6 @@ test_hpd_storm_disable(data_t *data, struct chamelium_port *port, int width)igt_hpd_storm_reset (data->drm_fd); } -#define HDMI_AUDIO_EDID_SIZE (sizeof(struct edid) + sizeof(struct edid_ext)) - -static unsigned const char *get_hdmi_audio_edid (void ) -{ -int channels; -uint8_t sampling_rates, sample_sizes; -static unsigned char raw_edid[HDMI_AUDIO_EDID_SIZE ] = {0 }; -struct edid *edid; -struct edid_ext *edid_ext; -struct edid_cea *edid_cea; -char *cea_data; -struct edid_cea_data_block *block; -struct cea_sad sad = {0 }; -const struct cea_vsd *vsd; -size_t cea_data_size, vsd_size; - -/* Initialize the Short Audio Descriptor for PCM */ - channels =2 ;/* TODO: speaker alloc blocks for > 2 channels */ - sampling_rates =CEA_SAD_SAMPLING_RATE_32KHZ | -CEA_SAD_SAMPLING_RATE_44KHZ | -CEA_SAD_SAMPLING_RATE_48KHZ | -CEA_SAD_SAMPLING_RATE_88KHZ | -CEA_SAD_SAMPLING_RATE_96KHZ | -CEA_SAD_SAMPLING_RATE_176KHZ | -CEA_SAD_SAMPLING_RATE_192KHZ ; - sample_sizes =CEA_SAD_SAMPLE_SIZE_16 | -CEA_SAD_SAMPLE_SIZE_20 | -CEA_SAD_SAMPLE_SIZE_24 ; -cea_sad_init_pcm (&sad, channels, sampling_rates, sample_sizes); - -/* Create a new EDID from the base IGT EDID, and add an -* extension that advertises audio support. */ - edid = (struct edid *) raw_edid; -memcpy (edid,igt_kms_get_base_edid (),sizeof (struct edid )); - edid->extensions_len =1 ; - edid_ext = &edid->extensions[0 ]; - edid_cea = &edid_ext->data.cea; - cea_data = edid_cea->data; - cea_data_size =0 ; - - block = (struct edid_cea_data_block *) &cea_data[cea_data_size]; - cea_data_size +=edid_cea_data_block_set_sad (block, &sad,1 ); - -/* A Vendor Specific Data block is needed for HDMI audio */ - block = (struct edid_cea_data_block *) &cea_data[cea_data_size]; - vsd =cea_vsd_get_hdmi_default (&vsd_size); - cea_data_size +=edid_cea_data_block_set_vsd (block, vsd, - vsd_size); - -igt_assert (cea_data_size <=sizeof (edid_cea->data)); - -edid_ext_set_cea (edid_ext, cea_data_size, -EDID_CEA_BASIC_AUDIO ); - -edid_update_checksum (edid); -edid_ext_update_cea_checksum (edid_ext); - -return raw_edid; -} -static const unsigned char *get_edid (enum test_edid edid) {switch (edid) {@@ -1811,7 +1751,7 @@ static const unsigned char *get_edid(enum test_edid edid)case TEST_EDID_ALT :return igt_kms_get_alt_edid ();case TEST_EDID_HDMI_AUDIO : -return get_hdmi_audio_edid (); +return igt_kms_get_hdmi_audio_edid (); }assert (0 );/* unreachable */ }tests/kms_hdmi_inject.c +4
-3@@ -24,6 +24,7 @@#include <dirent.h> #include "igt.h" +#include "igt_edid.h" #define HDISPLAY_4K 3840#define VDISPLAY_4K 2160@@ -211,14 +212,14 @@ eld_is_valid(void)static void hdmi_inject_audio (int drm_fd,drmModeConnector *connector) { -unsigned char *edid; +const unsigned char *edid;size_t length;int fb_id, cid, ret, crtc_mask =-1 ;struct igt_fb fb;struct kmstest_connector_config config; -kmstest_edid_add_audio (igt_kms_get_base_edid (),EDID_LENGTH , &edid, - &length); + edid =igt_kms_get_hdmi_audio_edid (); + length =HDMI_AUDIO_EDID_LENGTH ;kmstest_force_edid (drm_fd, connector, edid, length);
tests/kms_hdmi_inject.c hdmi_inject_audio(int drm_fd, drmModeConnector *connector) · line 267
Quoted 8 lines
tests/kms_hdmi_inject.c +0
-2@@ -261,8 +262,6 @@ hdmi_inject_audio(int drm_fd, drmModeConnector *connector)kmstest_force_connector (drm_fd, connector,FORCE_CONNECTOR_UNSPECIFIED );kmstest_force_edid (drm_fd, connector,NULL ,0 ); - -free (edid); } igt_main
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Patchwork
CI[igt-dev] ✓ Fi.CI.BAT: success for Unify HDMI audio EDID generation
In reply to Simon Ser== Series Details ==
== Series Details ==
Series: Unify HDMI audio EDID generation
URL : https://patchwork.freedesktop.org/series/61185/
State : success
== Summary ==
CI Bug Log - changes from IGT_5017 -> IGTPW_3063
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://patchwork.freedesktop.org/api/1.0/series/61185/revisions/1/mbox/
Known issues
------------
Here are the changes found in IGTPW_3063 that come from known issues:
### IGT changes ###
#### Possible fixes ####
* igt@gem_pwrite@basic:
- fi-icl-u3: [DMESG-WARN][1] ([fdo#107724]) -> [PASS][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5017/fi-icl-u3/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3063/fi-icl-u3/igt@[email protected]
* igt@i915_selftest@live_hangcheck:
- fi-icl-u3: [INCOMPLETE][3] ([fdo#107713] / [fdo#108569]) -> [PASS][4]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5017/fi-icl-u3/igt@i915_selftest@live_hangcheck.html
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3063/fi-icl-u3/igt@i915_selftest@live_hangcheck.html
- {fi-icl-dsi}: [INCOMPLETE][5] ([fdo#107713] / [fdo#108569]) -> [PASS][6]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5017/fi-icl-dsi/igt@i915_selftest@live_hangcheck.html
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3063/fi-icl-dsi/igt@i915_selftest@live_hangcheck.html
* {igt@i915_selftest@live_reset}:
- fi-skl-iommu: [INCOMPLETE][7] ([fdo#108602]) -> [PASS][8]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5017/fi-skl-iommu/igt@i915_selftest@live_reset.html
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3063/fi-skl-iommu/igt@i915_selftest@live_reset.html
* igt@kms_frontbuffer_tracking@basic:
- fi-icl-u2: [FAIL][9] ([fdo#103167]) -> [PASS][10]
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5017/fi-icl-u2/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3063/fi-icl-u2/igt@[email protected]
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
[fdo#106107]: https://bugs.freedesktop.org/show_bug.cgi?id=106107
[fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
[fdo#107724]: https://bugs.freedesktop.org/show_bug.cgi?id=107724
[fdo#108569]: https://bugs.freedesktop.org/show_bug.cgi?id=108569
[fdo#108602]: https://bugs.freedesktop.org/show_bug.cgi?id=108602
Participating hosts (53 -> 46)
------------------------------
Missing (7): fi-kbl-soraka fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-byt-clapper fi-bdw-samus
Build changes
-------------
* IGT: IGT_5017 -> IGTPW_3063
CI_DRM_6147: 12a8ed2d762a29845da42f16a175579896f58dea @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_3063: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3063/
IGT_5017: 2892adce93fb8eea3d764dc0f766a202d9dcef37 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3063/
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Patchwork
CI[igt-dev] ✓ Fi.CI.IGT: success for Unify HDMI audio EDID generation
In reply to Simon Ser== Series Details ==
== Series Details ==
Series: Unify HDMI audio EDID generation
URL : https://patchwork.freedesktop.org/series/61185/
State : success
== Summary ==
CI Bug Log - changes from IGT_5017_full -> IGTPW_3063_full
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://patchwork.freedesktop.org/api/1.0/series/61185/revisions/1/mbox/
Known issues
------------
Here are the changes found in IGTPW_3063_full that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_workarounds@suspend-resume:
- shard-kbl: [PASS][1] -> [INCOMPLETE][2] ([fdo#103665])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5017/shard-kbl7/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3063/shard-kbl3/igt@[email protected]
* igt@i915_suspend@fence-restore-untiled:
- shard-apl: [PASS][3] -> [DMESG-WARN][4] ([fdo#108566]) +4 similar issues
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5017/shard-apl4/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3063/shard-apl3/igt@[email protected]
* igt@kms_busy@extended-pageflip-hang-newfb-render-b:
- shard-iclb: [PASS][5] -> [INCOMPLETE][6] ([fdo#107713])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5017/shard-iclb3/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3063/shard-iclb5/igt@[email protected]
* igt@kms_cursor_crc@pipe-a-cursor-suspend:
- shard-kbl: [PASS][7] -> [DMESG-WARN][8] ([fdo#108566]) +2 similar issues
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5017/shard-kbl2/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3063/shard-kbl4/igt@[email protected]
* igt@kms_cursor_crc@pipe-b-cursor-64x64-sliding:
- shard-apl: [PASS][9] -> [FAIL][10] ([fdo#103232])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5017/shard-apl3/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3063/shard-apl3/igt@[email protected]
- shard-kbl: [PASS][11] -> [FAIL][12] ([fdo#103232])
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5017/shard-kbl6/igt@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3063/shard-kbl7/igt@[email protected]
* igt@kms_flip@2x-plain-flip-ts-check-interruptible:
- shard-hsw: [PASS][13] -> [SKIP][14] ([fdo#109271]) +12 similar issues
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5017/shard-hsw4/igt@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3063/shard-hsw1/igt@[email protected]
* igt@kms_flip@modeset-vs-vblank-race:
- shard-glk: [PASS][15] -> [FAIL][16] ([fdo#103060])
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5017/shard-glk1/igt@[email protected]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3063/shard-glk2/igt@[email protected]
* igt@kms_frontbuffer_tracking@fbcpsr-1p-pri-indfb-multidraw:
- shard-iclb: [PASS][17] -> [FAIL][18] ([fdo#103167]) +1 similar issue
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5017/shard-iclb8/igt@[email protected]
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3063/shard-iclb2/igt@[email protected]
* igt@kms_psr2_su@frontbuffer:
- shard-iclb: [PASS][19] -> [SKIP][20] ([fdo#109642])
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5017/shard-iclb2/igt@[email protected]
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3063/shard-iclb5/igt@[email protected]
* igt@kms_psr@psr2_cursor_plane_move:
- shard-iclb: [PASS][21] -> [SKIP][22] ([fdo#109441])
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5017/shard-iclb2/igt@kms_psr@psr2_cursor_plane_move.html
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3063/shard-iclb5/igt@kms_psr@psr2_cursor_plane_move.html
#### Possible fixes ####
* igt@gem_ctx_isolation@rcs0-s3:
- shard-apl: [DMESG-WARN][23] ([fdo#108566]) -> [PASS][24] +5 similar issues
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5017/shard-apl8/igt@[email protected]
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3063/shard-apl1/igt@[email protected]
* igt@gem_eio@in-flight-suspend:
- shard-kbl: [DMESG-WARN][25] ([fdo#108566]) -> [PASS][26] +2 similar issues
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5017/shard-kbl1/igt@[email protected]
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3063/shard-kbl3/igt@[email protected]
* igt@gem_eio@unwedge-stress:
- shard-snb: [FAIL][27] ([fdo#109661]) -> [PASS][28]
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5017/shard-snb5/igt@[email protected]
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3063/shard-snb7/igt@[email protected]
* igt@kms_flip@2x-flip-vs-expired-vblank-interruptible:
- shard-hsw: [SKIP][29] ([fdo#109271]) -> [PASS][30] +21 similar issues
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5017/shard-hsw1/igt@[email protected]
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3063/shard-hsw7/igt@[email protected]
* igt@kms_flip@flip-vs-expired-vblank-interruptible:
- shard-glk: [FAIL][31] ([fdo#105363]) -> [PASS][32]
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5017/shard-glk8/igt@[email protected]
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3063/shard-glk8/igt@[email protected]
* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-draw-pwrite:
- shard-apl: [FAIL][33] ([fdo#103167]) -> [PASS][34]
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5017/shard-apl8/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-draw-pwrite.html
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3063/shard-apl6/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-draw-pwrite.html
- shard-kbl: [FAIL][35] ([fdo#103167]) -> [PASS][36]
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5017/shard-kbl3/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-draw-pwrite.html
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3063/shard-kbl6/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-draw-pwrite.html
* igt@kms_frontbuffer_tracking@fbc-1p-primscrn-pri-indfb-draw-render:
- shard-iclb: [FAIL][37] ([fdo#103167]) -> [PASS][38] +6 similar issues
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5017/shard-iclb5/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-pri-indfb-draw-render.html
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3063/shard-iclb7/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-pri-indfb-draw-render.html
* igt@kms_frontbuffer_tracking@fbc-2p-primscrn-cur-indfb-draw-render:
- shard-glk: [FAIL][39] ([fdo#103167]) -> [PASS][40]
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5017/shard-glk1/igt@kms_frontbuffer_tracking@fbc-2p-primscrn-cur-indfb-draw-render.html
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3063/shard-glk5/igt@kms_frontbuffer_tracking@fbc-2p-primscrn-cur-indfb-draw-render.html
* igt@kms_plane_lowres@pipe-a-tiling-y:
- shard-iclb: [FAIL][41] ([fdo#103166]) -> [PASS][42]
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5017/shard-iclb6/igt@[email protected]
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3063/shard-iclb2/igt@[email protected]
* igt@kms_psr@psr2_sprite_plane_move:
- shard-iclb: [SKIP][43] ([fdo#109441]) -> [PASS][44] +1 similar issue
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5017/shard-iclb6/igt@kms_psr@psr2_sprite_plane_move.html
[44]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3063/shard-iclb2/igt@kms_psr@psr2_sprite_plane_move.html
* igt@kms_setmode@basic:
- shard-kbl: [FAIL][45] ([fdo#99912]) -> [PASS][46]
[45]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5017/shard-kbl1/igt@[email protected]
[46]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3063/shard-kbl3/igt@[email protected]
* igt@kms_vblank@pipe-a-ts-continuation-dpms-suspend:
- shard-hsw: [INCOMPLETE][47] ([fdo#103540]) -> [PASS][48]
[47]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5017/shard-hsw6/igt@[email protected]
[48]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3063/shard-hsw5/igt@[email protected]
#### Warnings ####
* igt@gem_mmap_gtt@forked-big-copy-odd:
- shard-iclb: [TIMEOUT][49] ([fdo#109673]) -> [INCOMPLETE][50] ([fdo#107713] / [fdo#109100]) +1 similar issue
[49]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5017/shard-iclb8/igt@[email protected]
[50]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3063/shard-iclb2/igt@[email protected]
* igt@gem_tiled_swapping@non-threaded:
- shard-hsw: [FAIL][51] ([fdo#108686]) -> [INCOMPLETE][52] ([fdo#103540])
[51]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5017/shard-hsw6/igt@[email protected]
[52]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3063/shard-hsw6/igt@[email protected]
* igt@prime_vgem@wait-bsd1:
- shard-snb: [INCOMPLETE][53] ([fdo#105411]) -> [FAIL][54] ([fdo#110764])
[53]: https://intel-gfx-ci.01.org/tree/drm-tip/IGT_5017/shard-snb2/igt@[email protected]
[54]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3063/shard-snb6/igt@[email protected]
[fdo#103060]: https://bugs.freedesktop.org/show_bug.cgi?id=103060
[fdo#103166]: https://bugs.freedesktop.org/show_bug.cgi?id=103166
[fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
[fdo#103232]: https://bugs.freedesktop.org/show_bug.cgi?id=103232
[fdo#103540]: https://bugs.freedesktop.org/show_bug.cgi?id=103540
[fdo#103665]: https://bugs.freedesktop.org/show_bug.cgi?id=103665
[fdo#105363]: https://bugs.freedesktop.org/show_bug.cgi?id=105363
[fdo#105411]: https://bugs.freedesktop.org/show_bug.cgi?id=105411
[fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
[fdo#108566]: https://bugs.freedesktop.org/show_bug.cgi?id=108566
[fdo#108686]: https://bugs.freedesktop.org/show_bug.cgi?id=108686
[fdo#109100]: https://bugs.freedesktop.org/show_bug.cgi?id=109100
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
[fdo#109642]: https://bugs.freedesktop.org/show_bug.cgi?id=109642
[fdo#109661]: https://bugs.freedesktop.org/show_bug.cgi?id=109661
[fdo#109673]: https://bugs.freedesktop.org/show_bug.cgi?id=109673
[fdo#110764]: https://bugs.freedesktop.org/show_bug.cgi?id=110764
[fdo#99912]: https://bugs.freedesktop.org/show_bug.cgi?id=99912
Participating hosts (7 -> 6)
------------------------------
Missing (1): shard-skl
Build changes
-------------
* IGT: IGT_5017 -> IGTPW_3063
CI_DRM_6147: 12a8ed2d762a29845da42f16a175579896f58dea @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_3063: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3063/
IGT_5017: 2892adce93fb8eea3d764dc0f766a202d9dcef37 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_3063/
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev