summaryrefslogtreecommitdiff
path: root/tests/lib/edid-test.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/edid-test.c')
-rw-r--r--tests/lib/edid-test.c959
1 files changed, 503 insertions, 456 deletions
diff --git a/tests/lib/edid-test.c b/tests/lib/edid-test.c
index a93e88a292..5a22e6bd95 100644
--- a/tests/lib/edid-test.c
+++ b/tests/lib/edid-test.c
@@ -34,22 +34,20 @@ static void test_decode_edid_no_edid(void **state)
static void test_decode_edid_invalid_header(void **state)
{
- struct edid_raw raw = {
- .header = EDID_HEADER_INVALID_RAW
- };
+ struct edid_raw raw = {.header = EDID_HEADER_INVALID_RAW};
raw.checksum = get_raw_edid_checksum((const unsigned char *)&raw);
assert_int_equal(EDID_ABSENT, decode_edid((unsigned char *)&raw, sizeof(raw), NULL));
}
/* Frame is modified example of an LCD Desktop IT display
- * from VESA E-EDID Standard Release A2.
- */
+ from VESA E-EDID Standard Release A2. */
static int setup_decode_edid_basic_frame(void **state)
{
struct edid_raw raw = {
EDID_RAW_DEFAULT_PARAMS,
- .video_input_type = EDID_ANALOG_VSI
+ .video_input_type =
+ EDID_ANALOG_VSI
| EDID_SIGNAL_LEVEL_0
| EDID_VIDEO_SETUP_BLANK_EQ_BLACK
| EDID_SEPARATE_SYNC_H_AND_V(1)
@@ -57,9 +55,10 @@ static int setup_decode_edid_basic_frame(void **state)
| EDID_COMPOSITE_SYNC_ON_GREEN(1)
| EDID_SERRATION_VSYNC(1),
.horizontal_size = 43, /* [cm] */
- .vertical_size = 32, /* [cm] */
- .display_gamma = 120, /* 220% */
- .supported_features = EDID_STANDBY_MODE(0)
+ .vertical_size = 32, /* [cm] */
+ .display_gamma = 120, /* 220% */
+ .supported_features =
+ EDID_STANDBY_MODE(0)
| EDID_SUSPEND_MODE(0)
| EDID_ACTIVE_OFF(1)
| EDID_COLOR_FORMAT_RGB444
@@ -68,21 +67,21 @@ static int setup_decode_edid_basic_frame(void **state)
| EDID_DISPLAY_FREQUENCY_CONTINUOUS,
.established_supported_timings = {
[0] = EDID_ESTABLISHED_TIMINGS_1_720x400_70Hz
- | EDID_ESTABLISHED_TIMINGS_1_720x400_88Hz
- | EDID_ESTABLISHED_TIMINGS_1_640x480_60Hz
- | EDID_ESTABLISHED_TIMINGS_1_640x480_67Hz
- | EDID_ESTABLISHED_TIMINGS_1_640x480_72Hz
- | EDID_ESTABLISHED_TIMINGS_1_640x480_75Hz
- | EDID_ESTABLISHED_TIMINGS_1_800x600_56Hz
- | EDID_ESTABLISHED_TIMINGS_1_800x600_60Hz,
+ | EDID_ESTABLISHED_TIMINGS_1_720x400_88Hz
+ | EDID_ESTABLISHED_TIMINGS_1_640x480_60Hz
+ | EDID_ESTABLISHED_TIMINGS_1_640x480_67Hz
+ | EDID_ESTABLISHED_TIMINGS_1_640x480_72Hz
+ | EDID_ESTABLISHED_TIMINGS_1_640x480_75Hz
+ | EDID_ESTABLISHED_TIMINGS_1_800x600_56Hz
+ | EDID_ESTABLISHED_TIMINGS_1_800x600_60Hz,
[1] = EDID_ESTABLISHED_TIMINGS_2_800x600_72Hz
- | EDID_ESTABLISHED_TIMINGS_2_800x600_75Hz
- | EDID_ESTABLISHED_TIMINGS_2_832x624_75Hz
- | EDID_ESTABLISHED_TIMINGS_2_1024x768_80HzI
- | EDID_ESTABLISHED_TIMINGS_2_1024x768_60Hz
- | EDID_ESTABLISHED_TIMINGS_2_1024x768_70Hz
- | EDID_ESTABLISHED_TIMINGS_2_1024x768_75Hz
- | EDID_ESTABLISHED_TIMINGS_2_1280x1024_75Hz,
+ | EDID_ESTABLISHED_TIMINGS_2_800x600_75Hz
+ | EDID_ESTABLISHED_TIMINGS_2_832x624_75Hz
+ | EDID_ESTABLISHED_TIMINGS_2_1024x768_80HzI
+ | EDID_ESTABLISHED_TIMINGS_2_1024x768_60Hz
+ | EDID_ESTABLISHED_TIMINGS_2_1024x768_70Hz
+ | EDID_ESTABLISHED_TIMINGS_2_1024x768_75Hz
+ | EDID_ESTABLISHED_TIMINGS_2_1280x1024_75Hz,
},
.manufacturers_reserved_timing = EDID_MANUFACTURERS_TIMINGS_1152x870_75Hz,
.standard_timings_supported = {
@@ -114,64 +113,69 @@ static int setup_decode_edid_basic_frame(void **state)
[0] = EDID_PIXEL_CLOCK(162000000u) & 0xFF,
[1] = (EDID_PIXEL_CLOCK(162000000u) >> 8) & 0xFF,
- /*
- * Horizontal Addressable Video is 1600px
- * Horizontal Blanking is 560px
- */
- [2] = 0x40, [3] = 0x30, [4] = 0x62,
+ /* Horizontal Addressable Video is 1600px,
+ Horizontal Blanking is 560px. */
+ [2] = 0x40,
+ [3] = 0x30,
+ [4] = 0x62,
- /*
- * Vertical Addressable Video is 1200 lines
- * Vertical Blanking is 50 lines
- */
- [5] = 0xB0, [6] = 0x32, [7] = 0x40,
+ /* Vertical Addressable Video is 1200 lines,
+ Vertical Blanking is 50 lines. */
+ [5] = 0xB0,
+ [6] = 0x32,
+ [7] = 0x40,
- [8] = 64u, /* Horizontal Front Porch in pixels */
- [9] = 192u, /* Horizontal Pulse Sync Width in pixels */
- [10] = 0x13, /* Vertical Front Porch is 1 line */
- [11] = 0x00, /* Vertical Sync Pulse Width is 3 lines */
+ [8] = 64u, /* Horizontal Front Porch in pixels. */
+ [9] = 192u, /* Horizontal Pulse Sync Width in pixels. */
+ [10] = 0x13, /* Vertical Front Porch is 1 line. */
+ [11] = 0x00, /* Vertical Sync Pulse Width is 3 lines. */
- /*
- * Horizontal Addressable Image Size is 427mm
- * Vertical Addressable Image Size is 320mm
- */
- [12] = 0xAB, [13] = 0x40, [14] = 0x11,
+ /* Horizontal Addressable Image Size is 427mm,
+ Vertical Addressable Image Size is 320mm. */
+ [12] = 0xAB,
+ [13] = 0x40,
+ [14] = 0x11,
- [15] = 0x00, /* Horizontal border size is 0px*/
- [16] = 0x00, /* Vertical Border Size is 0px */
+ [15] = 0x00, /* Horizontal Border Size is 0px. */
+ [16] = 0x00, /* Vertical Border Size is 0px. */
- /*
- * Timing is Non-Interlaced Video,
- * Stereo Video is not supported,
- * Digital separate syncs are requires.
- * */
+ /* Timing is Non-Interlaced Video,
+ Stereo Video is not supported,
+ Digital separate syncs are requires. */
[17] = 0x1E,
},
.descriptor_block_2 = {
/* Display Range Limits Block Tag */
- [0] = 0, [1] = 0, [2] = 0, [3] = 0xFD,
+ [0] = 0,
+ [1] = 0,
+ [2] = 0,
+ [3] = 0xFD,
- [4] = 0, /* Horizontal and Vertical Rate Offsets are zero */
- [5] = 50u, /* Minimum Vertical Freq is 50Hz */
- [6] = 90u, /* Maximum Vertical Freq is 90Hz */
+ [4] = 0, /* Horizontal and Vertical Rate Offsets are zero. */
+ [5] = 50u, /* Minimum Vertical Freq is 50Hz. */
+ [6] = 90u, /* Maximum Vertical Freq is 90Hz. */
- [7] = 30u, /* Minimum Horizontal Freq is 30kHz */
- [8] = 110u, /* Maximum Horizontal Freq is 110kHz */
- [9] = 23u, /* Maximum Pixel Clock Freq i 230MHz */
- [10] = 0x4, /* Begin CVT Support Info */
+ [7] = 30u, /* Minimum Horizontal Freq is 30kHz. */
+ [8] = 110u, /* Maximum Horizontal Freq is 110kHz. */
+ [9] = 23u, /* Maximum Pixel Clock Freq is 230MHz. */
+ [10] = 0x4, /* Begin CVT Support Info */
[11] = 0x11, /* Compatible with CVT Version 1.1 */
- [12] = 0, /* Maimum Pixel Clock Freq remains at 230MHz */
- [13] = 200, /* Maximum Active Pixels per Pile is 1600 */
- [14] = 0x90, /* Supported aspect ratios: 4:3, 5:4 */
+ [12] = 0, /* Maximum Pixel Clock Freq remains at 230MHz. */
+ [13] = 200, /* Maximum Active Pixels per Line is 1600. */
+ [14] = 0x90, /* Supported aspect ratios: 4:3, 5:4. */
- /* Preferred Aspect Ratio is 4:3, Standard CVT Blanking is supported */
+ /* Preferred Aspect Ratio is 4:3, Standard CVT Blanking is supported. */
[15] = 0,
- [16] = 0x50, /* H. & V. Stretch are supported and Shrinks are not */
- [17] = 60u, /* Preferred Refresh Rate is 60Hz */
+ [16] = 0x50, /* H. & V. Stretch are supported and Shrinks are not. */
+ [17] = 60u, /* Preferred Refresh Rate is 60Hz. */
},
.descriptor_block_3 = {
/* Established Timings III Block Tag */
- [0] = 0, [1] = 0, [2] = 0, [3] = 0xF7, [4] = 0,
+ [0] = 0,
+ [1] = 0,
+ [2] = 0,
+ [3] = 0xF7,
+ [4] = 0,
[5] = 10u, /* VESA DMT Standard Version #10 */
/*
@@ -181,7 +185,7 @@ static int setup_decode_edid_basic_frame(void **state)
* 640x480@85Hz,
* 800x600@85Hz,
* 1024x768@85Hz,
- * 1152x864@75Hz
+ * 1152x864@75Hz are supported.
*/
[6] = 0x7F,
@@ -189,7 +193,7 @@ static int setup_decode_edid_basic_frame(void **state)
* 1280x960@60Hz,
* 1280x960@85Hz,
* 1280x1024@60Hz,
- * 1280x1024@85Hz
+ * 1280x1024@85Hz are supported.
*/
[7] = 0x0F,
@@ -213,14 +217,18 @@ static int setup_decode_edid_basic_frame(void **state)
*/
[10] = 0xC0,
- /* 1920 timings not supported */
+ /* 1920 timings not supported. */
[11] = 0x0,
[12 ... 17] = 0,
},
.descriptor_block_4 = {
/* Display Product Name Block Tag */
- [0] = 0, [1] = 0, [2] = 0, [3] = 0xFC, [4] = 0,
+ [0] = 0,
+ [1] = 0,
+ [2] = 0,
+ [3] = 0xFC,
+ [4] = 0,
/* Product name */
[5] = 'A',
@@ -244,10 +252,8 @@ static int setup_decode_edid_basic_frame(void **state)
*state = malloc(sizeof(struct test_state));
- struct test_state ts = {
- .data_size = sizeof(struct edid_raw),
- .data = malloc(sizeof(struct edid_raw))
- };
+ struct test_state ts = {.data_size = sizeof(struct edid_raw),
+ .data = malloc(sizeof(struct edid_raw))};
memcpy(ts.data, &raw, sizeof(raw));
memcpy(*state, &ts, sizeof(ts));
@@ -255,18 +261,16 @@ static int setup_decode_edid_basic_frame(void **state)
return 0;
}
-/* Test decoding of EDID frame without extensions.
- */
+/* Test decoding of EDID frame without extensions. */
static void test_decode_edid_basic_frame(void **state)
{
struct edid out;
struct test_state *ts = *state;
/* In real-life situations frames often are not 100% conformant,
- * but are at least correct when it comes to key data fields.
- */
+ but are at least correct when it comes to key data fields. */
assert_int_equal(EDID_CONFORMANT,
- decode_edid((unsigned char *)ts->data, ts->data_size, &out));
+ decode_edid((unsigned char *)ts->data, ts->data_size, &out));
assert_int_equal(32, out.framebuffer_bits_per_pixel);
assert_int_equal(0, out.panel_bits_per_color);
@@ -305,19 +309,20 @@ static void test_decode_edid_basic_frame(void **state)
}
/* Frame is modified example of base EDID frame with CEA861 extension
- * for DTV Display from VESA E-EDID Standard Release A2.
- */
+ for DTV Display from VESA E-EDID Standard Release A2. */
static int setup_decode_edid_dtv_frame_with_extension(void **state)
{
struct edid_raw raw = {
EDID_RAW_DEFAULT_PARAMS,
- .video_input_type = EDID_DIGITAL_VSI
+ .video_input_type =
+ EDID_DIGITAL_VSI
| EDID_INTERFACE_HDMI_A
| EDID_COLOR_BIT_DEPTH_8B,
- .horizontal_size = 16, /* Aspect ratio 16:9 in landscape */
- .vertical_size = 0, /* Landscape flag */
- .display_gamma = 120, /* 220% */
- .supported_features = EDID_STANDBY_MODE(0)
+ .horizontal_size = 16, /* Aspect ratio 16:9 in landscape. */
+ .vertical_size = 0, /* Landscape flag */
+ .display_gamma = 120, /* 220% */
+ .supported_features =
+ EDID_STANDBY_MODE(0)
| EDID_SUSPEND_MODE(0)
| EDID_ACTIVE_OFF(0)
| EDID_COLOR_FORMAT_RGB444_YCRCB422_YCRCB422
@@ -330,109 +335,121 @@ static int setup_decode_edid_dtv_frame_with_extension(void **state)
[1] = 0,
},
.manufacturers_reserved_timing = 0,
- .standard_timings_supported = { [0 ... 15] = 0, },
+ .standard_timings_supported = {
+ [0 ... 15] = 0,
+ },
.descriptor_block_1 = {
[0] = EDID_PIXEL_CLOCK(148500000u) & 0xFF,
[1] = (EDID_PIXEL_CLOCK(148500000u) >> 8) & 0xFF,
- /* Horizontal Addressable Video is 1920px
- * Horizontal Blanking is 280px
- */
- [2] = 0x80, [3] = 0x18, [4] = 0x71,
+ /* Horizontal Addressable Video is 1920px,
+ Horizontal Blanking is 280px. */
+ [2] = 0x80,
+ [3] = 0x18,
+ [4] = 0x71,
- /* Vertical Addressable Video is 1080 lines
- * Vertical Blanking is 45 lines
- */
- [5] = 0x38, [6] = 0x2D, [7] = 0x40,
+ /* Vertical Addressable Video is 1080 lines,
+ Vertical Blanking is 45 lines. */
+ [5] = 0x38,
+ [6] = 0x2D,
+ [7] = 0x40,
- [8] = 88u, /* Horizontal Front Porch in pixels */
- [9] = 44u, /* Horizontal Pulse Sync Width in pixels */
- [10] = 4u, /* Vertical Front Porch is 4 lines */
- [11] = 5u, /* Vertical Sync Pulse Width is 5 lines */
+ [8] = 88u, /* Horizontal Front Porch in pixels. */
+ [9] = 44u, /* Horizontal Pulse Sync Width in pixels. */
+ [10] = 4u, /* Vertical Front Porch is 4 lines. */
+ [11] = 5u, /* Vertical Sync Pulse Width is 5 lines. */
- /* Horizontal Addressable Image Size is 1039mm
- * Vertical Addressable Image Size is 584mm
- */
- [12] = 0x0F, [13] = 0x48, [14] = 0x42,
+ /* Horizontal Addressable Image Size is 1039mm,
+ Vertical Addressable Image Size is 584mm. */
+ [12] = 0x0F,
+ [13] = 0x48,
+ [14] = 0x42,
- [15] = 0x00, /* Horizontal border size is 0px*/
- [16] = 0x00, /* Vertical Border Size is 0px */
+ [15] = 0x00, /* Horizontal Border Size is 0px. */
+ [16] = 0x00, /* Vertical Border Size is 0px. */
/* Timing is Non-Interlaced Video,
- * Stereo Video is not supported,
- * Digital separate and syncs are requires.
- */
+ Stereo Video is not supported,
+ Digital separate and syncs are requires. */
[17] = 0x1E,
},
.descriptor_block_2 = {
[0] = EDID_PIXEL_CLOCK(74250000u) & 0xFF,
[1] = (EDID_PIXEL_CLOCK(74250000u) >> 8) & 0xFF,
- /* Horizontal Addressable Video is 1920px
- * Horizontal Blanking is 280px
- */
- [2] = 0x80, [3] = 0x18, [4] = 0x71,
+ /* Horizontal Addressable Video is 1920px,
+ Horizontal Blanking is 280px. */
+ [2] = 0x80,
+ [3] = 0x18,
+ [4] = 0x71,
- /* Vertical Addressable Video is 540 lines
- * Vertical Blanking is 22 lines
- */
- [5] = 0x1C, [6] = 0x16, [7] = 0x20,
+ /* Vertical Addressable Video is 540 lines,
+ Vertical Blanking is 22 lines. */
+ [5] = 0x1C,
+ [6] = 0x16,
+ [7] = 0x20,
- [8] = 88u, /* Horizontal Front Porch in pixels */
- [9] = 44u, /* Horizontal Pulse Sync Width in pixels */
- [10] = 0x25, /* Vertical Front Porch is 2 lines */
- [11] = 0x00, /* Vertical Sync Pulse Width is 5 lines */
+ [8] = 88u, /* Horizontal Front Porch in pixels. */
+ [9] = 44u, /* Horizontal Pulse Sync Width in pixels. */
+ [10] = 0x25, /* Vertical Front Porch is 2 lines. */
+ [11] = 0x00, /* Vertical Sync Pulse Width is 5 lines. */
- /* Horizontal Addressable Image Size is 1039mm
- * Vertical Addressable Image Size is 584mm
- */
- [12] = 0x0F, [13] = 0x48, [14] = 0x42,
+ /* Horizontal Addressable Image Size is 1039mm,
+ Vertical Addressable Image Size is 584mm. */
+ [12] = 0x0F,
+ [13] = 0x48,
+ [14] = 0x42,
- [15] = 0x00, /* Horizontal border size is 0px*/
- [16] = 0x00, /* Vertical Border Size is 0px */
+ [15] = 0x00, /* Horizontal Border Size is 0px. */
+ [16] = 0x00, /* Vertical Border Size is 0px. */
/* Timing is Interlaced Video,
- * Stereo Video is not supported,
- * Digital separate and syncs are requires.
- */
+ Stereo Video is not supported,
+ Digital separate and syncs are requires. */
[17] = 0x9E,
},
.descriptor_block_3 = {
[0] = EDID_PIXEL_CLOCK(74250000u) & 0xFF,
[1] = (EDID_PIXEL_CLOCK(74250000u) >> 8) & 0xFF,
- /* Horizontal Addressable Video is 1280px
- * Horizontal Blanking is 370px
- */
- [2] = 0x00, [3] = 0x72, [4] = 0x51,
+ /* Horizontal Addressable Video is 1280px,
+ Horizontal Blanking is 370px. */
+ [2] = 0x00,
+ [3] = 0x72,
+ [4] = 0x51,
- /* Vertical Addressable Video is 720 lines
- * Vertical Blanking is 30 lines
- */
- [5] = 0xD0, [6] = 0x1E, [7] = 0x20,
+ /* Vertical Addressable Video is 720 lines,
+ Vertical Blanking is 30 lines. */
+ [5] = 0xD0,
+ [6] = 0x1E,
+ [7] = 0x20,
- [8] = 110u, /* Horizontal Front Porch in pixels */
- [9] = 40u, /* Horizontal Pulse Sync Width in pixels */
- [10] = 0x55u, /* Vertical Front Porch is 5 lines */
- [11] = 0x00, /* Vertical Sync Pulse Width is 5 lines */
+ [8] = 110u, /* Horizontal Front Porch in pixels. */
+ [9] = 40u, /* Horizontal Pulse Sync Width in pixels. */
+ [10] = 0x55u, /* Vertical Front Porch is 5 lines. */
+ [11] = 0x00, /* Vertical Sync Pulse Width is 5 lines. */
- /* Horizontal Addressable Image Size is 1039mm
- * Vertical Addressable Image Size is 584mm
- */
- [12] = 0x0F, [13] = 0x48, [14] = 0x42,
+ /* Horizontal Addressable Image Size is 1039mm,
+ Vertical Addressable Image Size is 584mm. */
+ [12] = 0x0F,
+ [13] = 0x48,
+ [14] = 0x42,
- [15] = 0x00, /* Horizontal border size is 0px*/
- [16] = 0x00, /* Vertical Border Size is 0px */
+ [15] = 0x00, /* Horizontal Border Size is 0px. */
+ [16] = 0x00, /* Vertical Border Size is 0px. */
/* Timing is Non-Interlaced Video,
- * Stereo Video is not supported,
- * Digital separate syncs are requires.
- */
+ Stereo Video is not supported,
+ Digital separate syncs are requires. */
[17] = 0x1E,
},
.descriptor_block_4 = {
/* Display Product Name Block Tag */
- [0] = 0, [1] = 0, [2] = 0, [3] = 0xFC, [4] = 0,
+ [0] = 0,
+ [1] = 0,
+ [2] = 0,
+ [3] = 0xFC,
+ [4] = 0,
/* Product name */
[5] = 'A',
@@ -458,26 +475,24 @@ static int setup_decode_edid_dtv_frame_with_extension(void **state)
[0] = 0x02, /* CEA 861 Extension Block Tag Code */
[1] = 0x03, /* CEA 861 Block Version */
- [2] = 0x18, /* Detail Timing Descriptors start 0x18 bytes from here */
+ [2] = 0x18, /* Detail Timing Descriptors start 0x18 bytes from here. */
- /* Underscan is not supported
- * Basic Audio is supported
- * YCbCr 4:4:4 & YCbCr 4:2:2 are supported
- * Number of native formats: 2
- */
+ /* Underscan is not supported,
+ Basic Audio is supported,
+ YCbCr 4:4:4 & YCbCr 4:2:2 are supported,
+ Number of native formats: 2. */
[3] = 0x72,
- /* Video Data Block Tag Code is 2
- * Number of Short Video Descriptor Bytes i 7
- */
+ /* Video Data Block Tag Code is 2,
+ Number of Short Video Descriptor Bytes is 7. */
[4] = 0x47,
/* 1920x1080p 59.94/60 Hz 16 : 9 AR (CEA Format #16)
- * is a supported Native Format. */
+ is a supported Native Format. */
[5] = 0x90,
/* 1920x1080i 59.94/60 Hz 16 : 9 AR (CEA Format #5)
- * is a supported Native Format. */
+ is a supported Native Format. */
[6] = 0x85,
/* 1280x720p 59.94/60 Hz 16 : 9 AR (CEA Format #4) is a supported format. */
@@ -495,14 +510,12 @@ static int setup_decode_edid_dtv_frame_with_extension(void **state)
/* 720x480i 59.94/60 Hz 4 : 3 AR (CEA Format #6) is a supported format. */
[11] = 0x06,
- /* Audio Data Block Tag Code is 1.
- * Number of Short Audio Descriptor Bytes is 3.
- */
+ /* Audio Data Block Tag Code is 1,
+ Number of Short Audio Descriptor Bytes is 3. */
[12] = 0x23,
- /* Audio Format Tag Code is 1 --- LPCM is supported.
- * Maximum number of audio channels is 2
- */
+ /* Audio Format Tag Code is 1 --- LPCM is supported,
+ Maximum number of audio channels is 2. */
[13] = 0x09,
/* Supported Sampling Frequencies include: 48kHz; 44.1kHz & 32kHz. */
@@ -511,59 +524,63 @@ static int setup_decode_edid_dtv_frame_with_extension(void **state)
/* Supported Sampling Bit Rates include: 24 bit; 20 bit & 16 bit. */
[15] = 0x07,
- /* Speaker Allocation Block Tag Code is 4.
- * Number of Speaker Allocation
- * Descriptor Bytes is 3.
- */
+ /* Speaker Allocation Block Tag Code is 4,
+ Number of Speaker Allocation Descriptor Bytes is 3. */
[16] = 0x83,
- /* Speaker Allocation is Front-Left & Front-Right */
+ /* Speaker Allocation is Front-Left & Front-Right. */
[17] = 0x01,
/* Reserved */
[18 ... 19] = 0,
- /* Vendor Specific Data Block Tag Code is 3.
- * Number of Vendor Specific Data Bytes is 5.
- */
+ /* Vendor Specific Data Block Tag Code is 3,
+ Number of Vendor Specific Data Bytes is 5. */
[20] = 0x65,
- /* 24bit IEEE registration Identifier is 0x000C03 */
- [21] = 0x03, [22] = 0x0C, [23] = 0x00,
+ /* 24bit IEEE registration Identifier is 0x000C03. */
+ [21] = 0x03,
+ [22] = 0x0C,
+ [23] = 0x00,
- /* Vendor Specific Data is 0x10000 */
- [24] = 0x01, [25] = 0x00,
+ /* Vendor Specific Data is 0x10000. */
+ [24] = 0x01,
+ [25] = 0x00,
/* Descriptor Block 5 [18 Bytes] */
[26] = EDID_PIXEL_CLOCK(27027000u) & 0xFF,
[27] = (EDID_PIXEL_CLOCK(27027000u) >> 8) & 0xFF,
- /* Horizontal Addressable Video is 720px.
- * Horizontal Blanking is 138 px.
- */
- [28] = 0xD0, [29] = 0x8A, [30] = 0x20,
+ /* Horizontal Addressable Video is 720px,
+ Horizontal Blanking is 138 px. */
+ [28] = 0xD0,
+ [29] = 0x8A,
+ [30] = 0x20,
- /* Vertical Addressable Video is 480 lines.
- * Vertical Blanking is 45 lines.
- */
- [31] = 0xE0, [32] = 0x2D, [33] = 0x10,
+ /* Vertical Addressable Video is 480 lines,
+ Vertical Blanking is 45 lines. */
+ [31] = 0xE0,
+ [32] = 0x2D,
+ [33] = 0x10,
- [34] = 16u, /* Horizontal Front Porch in pixels */
- [35] = 62u, /* Horizontal Sync Pulse Width in pixels */
- [36] = 0x96, /* Vertical Front Porch is 9 lines */
- [37] = 0x00, /* Vertical Sync Pulse Width is 6 lines */
+ [34] = 16u, /* Horizontal Front Porch in pixels. */
+ [35] = 62u, /* Horizontal Sync Pulse Width in pixels. */
+ [36] = 0x96, /* Vertical Front Porch is 9 lines. */
+ [37] = 0x00, /* Vertical Sync Pulse Width is 6 lines. */
/* Displayed Image Aspect Ratio is 16:9 */
- [38] = 16u, [39] = 9u, [40] = 0u,
+ [38] = 16u,
+ [39] = 9u,
+ [40] = 0u,
/* Horizontal and Vertical Border Size is 0 px */
- [41] = 0u, [42] = 0u,
+ [41] = 0u,
+ [42] = 0u,
- /* Timing is Interlaced Video
- * Stereo Video is not supported
- * Digital Separate Syncs are required
- */
+ /* Timing is Interlaced Video,
+ Stereo Video is not supported,
+ Digital Separate Syncs are required. */
[43] = 0x18,
/* Descriptor Block 6 [18 Bytes] */
@@ -571,31 +588,35 @@ static int setup_decode_edid_dtv_frame_with_extension(void **state)
[44] = EDID_PIXEL_CLOCK(27027000u) & 0xFF,
[45] = (EDID_PIXEL_CLOCK(27027000u) >> 8) & 0xFF,
- /* Horizontal Addressable Video is 720px.
- * Horizontal Blanking is 138 px.
- */
- [46] = 0xD0, [47] = 0x8A, [48] = 0x20,
-
- /* Vertical Addressable Video is 480 lines.
- * Vertical Blanking is 45 lines.
- */
- [49] = 0xE0, [50] = 0x2D, [51] = 0x10,
-
- [52] = 16u, /* Horizontal Front Porch in pixels */
- [53] = 62u, /* Horizontal Sync Pulse Width in pixels */
- [54] = 0x96, /* Vertical Front Porch is 9 lines */
- [55] = 0x00, /* Vertical Sync Pulse Width is 6 lines */
-
- /* Displayed Image Aspect Ratio is 4:3 */
- [56] = 4u, [57] = 3u, [58] = 0u,
-
- /* Horizontal and Vertical Border Size is 0 px */
- [59] = 0u, [60] = 0u,
-
- /* Timing is Interlaced Video
- * Stereo Video is not supported
- * Digital Separate Syncs are required
- */
+ /* Horizontal Addressable Video is 720px,
+ Horizontal Blanking is 138 px. */
+ [46] = 0xD0,
+ [47] = 0x8A,
+ [48] = 0x20,
+
+ /* Vertical Addressable Video is 480 lines,
+ Vertical Blanking is 45 lines. */
+ [49] = 0xE0,
+ [50] = 0x2D,
+ [51] = 0x10,
+
+ [52] = 16u, /* Horizontal Front Porch in pixels. */
+ [53] = 62u, /* Horizontal Sync Pulse Width in pixels. */
+ [54] = 0x96, /* Vertical Front Porch is 9 lines. */
+ [55] = 0x00, /* Vertical Sync Pulse Width is 6 lines. */
+
+ /* Displayed Image Aspect Ratio is 4:3. */
+ [56] = 4u,
+ [57] = 3u,
+ [58] = 0u,
+
+ /* Horizontal and Vertical Border Size is 0px. */
+ [59] = 0u,
+ [60] = 0u,
+
+ /* Timing is Interlaced Video,
+ Stereo Video is not supported,
+ Digital Separate Syncs are required. */
[61] = 0x18,
/* Descriptor Block 7 [18 Bytes] */
@@ -603,31 +624,35 @@ static int setup_decode_edid_dtv_frame_with_extension(void **state)
[62] = EDID_PIXEL_CLOCK(27027000u) & 0xFF,
[63] = (EDID_PIXEL_CLOCK(27027000u) >> 8) & 0xFF,
- /* Horizontal Addressable Video is 1440px.
- * Horizontal Blanking is 276 px.
- */
- [64] = 0xA0, [65] = 0x14, [66] = 0x51,
+ /* Horizontal Addressable Video is 1440px,
+ Horizontal Blanking is 276 px. */
+ [64] = 0xA0,
+ [65] = 0x14,
+ [66] = 0x51,
- /* Vertical Addressable Video is 240 lines.
- * Vertical Blanking is 23 lines.
- */
- [67] = 0xF0, [68] = 0x16, [69] = 0x00,
+ /* Vertical Addressable Video is 240 lines,
+ Vertical Blanking is 23 lines. */
+ [67] = 0xF0,
+ [68] = 0x16,
+ [69] = 0x00,
- [70] = 38u, /* Horizontal Front Porch in pixels */
- [71] = 124u, /* Horizontal Sync Pulse Width in pixels */
- [72] = 0x43, /* Vertical Front Porch is 9 lines */
- [73] = 0x00, /* Vertical Sync Pulse Width is 6 lines */
+ [70] = 38u, /* Horizontal Front Porch in pixels. */
+ [71] = 124u, /* Horizontal Sync Pulse Width in pixels. */
+ [72] = 0x43, /* Vertical Front Porch is 9 lines. */
+ [73] = 0x00, /* Vertical Sync Pulse Width is 6 lines. */
/* Displayed Image Aspect Ratio is 16:9 */
- [74] = 16u, [75] = 9u, [76] = 0u,
+ [74] = 16u,
+ [75] = 9u,
+ [76] = 0u,
- /* Horizontal and Vertical Border Size is 0 px */
- [77] = 0u, [78] = 0u,
+ /* Horizontal and Vertical Border Size is 0px. */
+ [77] = 0u,
+ [78] = 0u,
- /* Timing is Interlaced Video
- * Stereo Video is not supported
- * Digital Separate Syncs are required
- */
+ /* Timing is Interlaced Video,
+ Stereo Video is not supported,
+ Digital Separate Syncs are required. */
[79] = 0x98,
/* Descriptor Block 8 [18 Bytes] */
@@ -635,44 +660,45 @@ static int setup_decode_edid_dtv_frame_with_extension(void **state)
[80] = EDID_PIXEL_CLOCK(27027000u) & 0xFF,
[81] = (EDID_PIXEL_CLOCK(27027000u) >> 8) & 0xFF,
- /* Horizontal Addressable Video is 1440px.
- * Horizontal Blanking is 276 px.
- */
- [82] = 0xA0, [83] = 0x14, [84] = 0x51,
-
- /* Vertical Addressable Video is 240 lines.
- * Vertical Blanking is 23 lines.
- */
- [85] = 0xF0, [86] = 0x16, [87] = 0x00,
-
- [88] = 38u, /* Horizontal Front Porch in pixels */
- [89] = 124u, /* Horizontal Sync Pulse Width in pixels */
- [90] = 0x43, /* Vertical Front Porch is 9 lines */
- [91] = 0x00, /* Vertical Sync Pulse Width is 6 lines */
-
- /* Displayed Image Aspect Ratio is 4:3 */
- [92] = 4u, [93] = 3u, [94] = 0u,
-
- /* Horizontal and Vertical Border Size is 0 px */
- [95] = 0u, [96] = 0u,
-
- /* Timing is Interlaced Video
- * Stereo Video is not supported
- * Digital Separate Syncs are required
- */
+ /* Horizontal Addressable Video is 1440px,
+ Horizontal Blanking is 276 px. */
+ [82] = 0xA0,
+ [83] = 0x14,
+ [84] = 0x51,
+
+ /* Vertical Addressable Video is 240 lines,
+ Vertical Blanking is 23 lines. */
+ [85] = 0xF0,
+ [86] = 0x16,
+ [87] = 0x00,
+
+ [88] = 38u, /* Horizontal Front Porch in pixels. */
+ [89] = 124u, /* Horizontal Sync Pulse Width in pixels. */
+ [90] = 0x43, /* Vertical Front Porch is 9 lines. */
+ [91] = 0x00, /* Vertical Sync Pulse Width is 6 lines. */
+
+ /* Displayed Image Aspect Ratio is 4:3. */
+ [92] = 4u,
+ [93] = 3u,
+ [94] = 0u,
+
+ /* Horizontal and Vertical Border Size is 0px. */
+ [95] = 0u,
+ [96] = 0u,
+
+ /* Timing is Interlaced Video,
+ Stereo Video is not supported,
+ Digital Separate Syncs are required. */
[97] = 0x98,
- [99 ... 126] = 0
- };
+ [99 ... 126] = 0};
ext[127] = get_raw_edid_checksum(ext);
*state = malloc(sizeof(struct test_state));
- struct test_state ts = {
- .data_size = sizeof(raw) + sizeof(ext),
- .data = malloc(sizeof(raw) + sizeof(ext))
- };
+ struct test_state ts = {.data_size = sizeof(raw) + sizeof(ext),
+ .data = malloc(sizeof(raw) + sizeof(ext))};
memcpy(ts.data, &raw, sizeof(raw));
memcpy(ts.data + sizeof(raw), &ext[0], sizeof(ext));
@@ -682,18 +708,16 @@ static int setup_decode_edid_dtv_frame_with_extension(void **state)
return 0;
}
-/* Test decoding of EDID frame with one extension.
- */
+/* Test decoding of EDID frame with one extension. */
static void test_decode_edid_dtv_frame_with_extension(void **state)
{
struct edid out;
struct test_state *ts = *state;
/* In real-life situations frames often are not 100% conformant,
- * but are at least correct when it comes to key data fields.
- */
+ but are at least correct when it comes to key data fields. */
assert_int_equal(EDID_CONFORMANT,
- decode_edid((unsigned char *)ts->data, ts->data_size, &out));
+ decode_edid((unsigned char *)ts->data, ts->data_size, &out));
assert_int_equal(32, out.framebuffer_bits_per_pixel);
assert_int_equal(8, out.panel_bits_per_color);
@@ -733,20 +757,21 @@ static void test_decode_edid_dtv_frame_with_extension(void **state)
/* Test decoding of EDID frame with one extension. Tested frame is modified
- * example of base EDID frame with CEA861 extension for IT/DTV Display from
- * VESA E-EDID Standard Release A2.
- */
+ example of base EDID frame with CEA861 extension for IT/DTV Display from
+ VESA E-EDID Standard Release A2. */
static int setup_decode_edid_it_dtv_frame_with_extension(void **state)
{
struct edid_raw raw = {
EDID_RAW_DEFAULT_PARAMS,
- .video_input_type = EDID_DIGITAL_VSI
+ .video_input_type =
+ EDID_DIGITAL_VSI
| EDID_INTERFACE_HDMI_A
| EDID_COLOR_BIT_DEPTH_8B,
.horizontal_size = 121, /* Aspect ratio 16:9 in landscape */
- .vertical_size = 68, /* Landscape flag */
- .display_gamma = 120, /* 220% */
- .supported_features = EDID_STANDBY_MODE(0)
+ .vertical_size = 68, /* Landscape flag */
+ .display_gamma = 120, /* 220% */
+ .supported_features =
+ EDID_STANDBY_MODE(0)
| EDID_SUSPEND_MODE(0)
| EDID_ACTIVE_OFF(0)
| EDID_COLOR_FORMAT_RGB444_YCRCB422_YCRCB422
@@ -755,20 +780,20 @@ static int setup_decode_edid_it_dtv_frame_with_extension(void **state)
| EDID_DISPLAY_FREQUENCY_NON_CONTINUOUS,
.established_supported_timings = {
[0] = EDID_ESTABLISHED_TIMINGS_1_800x600_60Hz
- | EDID_ESTABLISHED_TIMINGS_1_800x600_56Hz
- | EDID_ESTABLISHED_TIMINGS_1_640x480_75Hz
- | EDID_ESTABLISHED_TIMINGS_1_640x480_72Hz
- | EDID_ESTABLISHED_TIMINGS_1_640x480_67Hz
- | EDID_ESTABLISHED_TIMINGS_1_640x480_60Hz
- | EDID_ESTABLISHED_TIMINGS_1_720x400_88Hz
- | EDID_ESTABLISHED_TIMINGS_1_720x400_70Hz,
+ | EDID_ESTABLISHED_TIMINGS_1_800x600_56Hz
+ | EDID_ESTABLISHED_TIMINGS_1_640x480_75Hz
+ | EDID_ESTABLISHED_TIMINGS_1_640x480_72Hz
+ | EDID_ESTABLISHED_TIMINGS_1_640x480_67Hz
+ | EDID_ESTABLISHED_TIMINGS_1_640x480_60Hz
+ | EDID_ESTABLISHED_TIMINGS_1_720x400_88Hz
+ | EDID_ESTABLISHED_TIMINGS_1_720x400_70Hz,
[1] = EDID_ESTABLISHED_TIMINGS_2_1280x1024_75Hz
- | EDID_ESTABLISHED_TIMINGS_2_1024x768_75Hz
- | EDID_ESTABLISHED_TIMINGS_2_1024x768_70Hz
- | EDID_ESTABLISHED_TIMINGS_2_1024x768_60Hz
- | EDID_ESTABLISHED_TIMINGS_2_832x624_75Hz
- | EDID_ESTABLISHED_TIMINGS_2_800x600_75Hz
- | EDID_ESTABLISHED_TIMINGS_2_800x600_72Hz,
+ | EDID_ESTABLISHED_TIMINGS_2_1024x768_75Hz
+ | EDID_ESTABLISHED_TIMINGS_2_1024x768_70Hz
+ | EDID_ESTABLISHED_TIMINGS_2_1024x768_60Hz
+ | EDID_ESTABLISHED_TIMINGS_2_832x624_75Hz
+ | EDID_ESTABLISHED_TIMINGS_2_800x600_75Hz
+ | EDID_ESTABLISHED_TIMINGS_2_800x600_72Hz,
},
.manufacturers_reserved_timing = EDID_MANUFACTURERS_TIMINGS_1152x870_75Hz,
.standard_timings_supported = {
@@ -800,78 +825,83 @@ static int setup_decode_edid_it_dtv_frame_with_extension(void **state)
[0] = EDID_PIXEL_CLOCK(85500000u) & 0xFF,
[1] = (EDID_PIXEL_CLOCK(85500000u) >> 8) & 0xFF,
- /* Horizontal Addressable Video is 1360px
- * Horizontal Blanking is 432px
- */
- [2] = 0x50, [3] = 0xB0, [4] = 0x51,
+ /* Horizontal Addressable Video is 1360px,
+ Horizontal Blanking is 432px. */
+ [2] = 0x50,
+ [3] = 0xB0,
+ [4] = 0x51,
- /* Vertical Addressable Video is 768 lines
- * Vertical Blanking is 27 lines
- */
- [5] = 0x00, [6] = 0x1B, [7] = 0x30,
+ /* Vertical Addressable Video is 768 lines,
+ Vertical Blanking is 27 lines. */
+ [5] = 0x00,
+ [6] = 0x1B,
+ [7] = 0x30,
- [8] = 64u, /* Horizontal Front Porch in pixels */
- [9] = 112u, /* Horizontal Pulse Sync Width in pixels */
- [10] = 0x36, /* Vertical Front Porch is 3 lines */
- [11] = 0u, /* Vertical Sync Pulse Width is 6 lines */
+ [8] = 64u, /* Horizontal Front Porch in pixels. */
+ [9] = 112u, /* Horizontal Pulse Sync Width in pixels. */
+ [10] = 0x36, /* Vertical Front Porch is 3 lines. */
+ [11] = 0u, /* Vertical Sync Pulse Width is 6 lines. */
- /* Horizontal Addressable Image Size is 1214mm
- * Vertical Addressable Image Size is 683mm
- */
- [12] = 0xBE, [13] = 0xAB, [14] = 0x42,
+ /* Horizontal Addressable Image Size is 1214mm,
+ Vertical Addressable Image Size is 683mm. */
+ [12] = 0xBE,
+ [13] = 0xAB,
+ [14] = 0x42,
- [15] = 0x00, /* Horizontal border size is 0px*/
- [16] = 0x00, /* Vertical Border Size is 0px */
+ [15] = 0x00, /* Horizontal border size is 0px. */
+ [16] = 0x00, /* Vertical Border Size is 0px. */
/* Timing is Non-Interlaced Video,
- * Stereo Video is not supported,
- * Digital separate and syncs are requires.
- */
+ Stereo Video is not supported,
+ Digital separate and syncs are requires. */
[17] = 0x1E,
},
.descriptor_block_2 = {
[0] = EDID_PIXEL_CLOCK(74250000u) & 0xFF,
[1] = (EDID_PIXEL_CLOCK(74250000u) >> 8) & 0xFF,
- /* Horizontal Addressable Video is 1280px
- * Horizontal Blanking is 370px
- */
- [2] = 0x00, [3] = 0x72, [4] = 0x51,
+ /* Horizontal Addressable Video is 1280px,
+ Horizontal Blanking is 370px. */
+ [2] = 0x00,
+ [3] = 0x72,
+ [4] = 0x51,
- /* Vertical Addressable Video is 720 lines
- * Vertical Blanking is 30 lines
- */
- [5] = 0xD0, [6] = 0x1E, [7] = 0x20,
+ /* Vertical Addressable Video is 720 lines,
+ Vertical Blanking is 30 lines. */
+ [5] = 0xD0,
+ [6] = 0x1E,
+ [7] = 0x20,
- [8] = 110u, /* Horizontal Front Porch in pixels */
- [9] = 40u, /* Horizontal Pulse Sync Width in pixels */
- [10] = 0x55, /* Vertical Front Porch is 5 lines */
- [11] = 0x00, /* Vertical Sync Pulse Width is 5 lines */
+ [8] = 110u, /* Horizontal Front Porch in pixels. */
+ [9] = 40u, /* Horizontal Pulse Sync Width in pixels. */
+ [10] = 0x55, /* Vertical Front Porch is 5 lines. */
+ [11] = 0x00, /* Vertical Sync Pulse Width is 5 lines. */
- /* Horizontal Addressable Image Size is 1214mm
- * Vertical Addressable Image Size is 683mm
- */
- [12] = 0xBE, [13] = 0xAB, [14] = 0x42,
+ /* Horizontal Addressable Image Size is 1214mm,
+ Vertical Addressable Image Size is 683mm. */
+ [12] = 0xBE,
+ [13] = 0xAB,
+ [14] = 0x42,
- [15] = 0x00, /* Horizontal border size is 0px*/
- [16] = 0x00, /* Vertical Border Size is 0px */
+ [15] = 0x00, /* Horizontal border size is 0px. */
+ [16] = 0x00, /* Vertical Border Size is 0px. */
/* Timing is Non-Interlaced Video,
- * Stereo Video is not supported,
- * Digital separate and syncs are requires.
- */
+ Stereo Video is not supported,
+ Digital separate and syncs are required. */
[17] = 0x1E,
},
.descriptor_block_3 = {
/* Established timings III Block Tag */
- [0 ... 2] = 0u, [3] = 0xF7, [4] = 0u,
+ [0 ... 2] = 0u,
+ [3] = 0xF7,
+ [4] = 0u,
- /*
- * VESA DMT Standard Version #10
- */
+ /* VESA DMT Standard Version #10 */
[5] = 10u,
- /* 640x350@85Hz,
+ /*
+ * 640x350@85Hz,
* 640x400@85Hz,
* 720x400@85Hz,
* 640x480@85Hz,
@@ -881,26 +911,30 @@ static int setup_decode_edid_it_dtv_frame_with_extension(void **state)
*/
[6] = 0x7F,
- /* 1280x960@60Hz,
+ /*
+ * 1280x960@60Hz,
* 1280x960@85Hz,
* 1280x1024@60Hz,
* 1280x1024@85Hz
*/
[7] = 0x0F,
- /* 1400x1050@60Hz (Normal Blanking),
+ /*
+ * 1400x1050@60Hz (Normal Blanking),
* 1400x1050@75Hz are supported.
*/
[8] = 0x03,
- /* 1400x1050@85Hz,
+ /*
+ * 1400x1050@85Hz,
* 1600x1200@60Hz,
* 1600x1200@65Hz,
* 1600x1200@70Hz are supported.
*/
[9] = 0x87,
- /* 1600x1200@75Hz,
+ /*
+ * 1600x1200@75Hz,
* 1600x1200@85Hz are supported.
*/
[10] = 0xC0,
@@ -913,7 +947,11 @@ static int setup_decode_edid_it_dtv_frame_with_extension(void **state)
},
.descriptor_block_4 = {
/* Display Product Name Block Tag */
- [0] = 0, [1] = 0, [2] = 0, [3] = 0xFC, [4] = 0,
+ [0] = 0,
+ [1] = 0,
+ [2] = 0,
+ [3] = 0xFC,
+ [4] = 0,
/* Product name */
[5] = 'A',
@@ -940,16 +978,14 @@ static int setup_decode_edid_it_dtv_frame_with_extension(void **state)
[1] = 0x03, /* CEA 861 Block Version */
[2] = 0x17, /* Detail Timing Descriptors start 0x17 bytesfrom here */
- /* Underscan is supported
- * Basic Audio is supported
- * YCbCr 4:4:4 & YCbCr 4:2:2 are supported
- * Number of native formats: 0
- */
+ /* Underscan is supported,
+ Basic Audio is supported,
+ YCbCr 4:4:4 & YCbCr 4:2:2 are supported,
+ Number of native formats: 0. */
[3] = 0xF0,
- /* Video Data Block Tag Code is 2
- * Number of Short Video Descriptor Bytes i 6
- */
+ /* Video Data Block Tag Code is 2.
+ Number of Short Video Descriptor Bytes is 6. */
[4] = 0x46,
/* 1920x1080i 59.94/60 Hz 16 : 9 AR (CEA Format #5) is a supported format. */
@@ -970,14 +1006,12 @@ static int setup_decode_edid_it_dtv_frame_with_extension(void **state)
/* 720x480i 59.94/60 Hz 4 : 3 AR (CEA Format #6) is a supported format. */
[10] = 0x06,
- /* Audio Data Block Tag Code is 1.
- * Number of Short Audio Descriptor Bytes is 3.
- */
+ /* Audio Data Block Tag Code is 1,
+ Number of Short Audio Descriptor Bytes is 3. */
[11] = 0x23,
- /* Audio Format Tag Code is 1 --- LPCM is supported.
- * Maximum number of audio channels is 2
- */
+ /* Audio Format Tag Code is 1 --- LPCM is supported,
+ Maximum number of audio channels is 2. */
[12] = 0x09,
/* Supported Sampling Frequencies include: 48kHz; 44.1kHz & 32kHz. */
@@ -986,10 +1020,8 @@ static int setup_decode_edid_it_dtv_frame_with_extension(void **state)
/* Supported Sampling Bit Rates include: 24 bit; 20 bit & 16 bit. */
[14] = 0x07,
- /* Speaker Allocation Block Tag Code is 4.
- * Number of Speaker Allocation
- * Descriptor Bytes is 3.
- */
+ /* Speaker Allocation Block Tag Code is 4,
+ Number of Speaker Allocation Descriptor Bytes is 3. */
[15] = 0x83,
/* Speaker Allocation is Front-Left & Front-Right */
@@ -998,47 +1030,53 @@ static int setup_decode_edid_it_dtv_frame_with_extension(void **state)
/* Reserved */
[17 ... 18] = 0,
- /* Vendor Specific Data Block Tag Code is 3.
- * Number of Vendor Specific Data Bytes is 5.
- */
+ /* Vendor Specific Data Block Tag Code is 3,
+ Number of Vendor Specific Data Bytes is 5. */
[19] = 0x65,
- /* 24bit IEEE registration Identifier is 0x000C03 */
- [20] = 0x03, [21] = 0x0C, [22] = 0x00,
+ /* 24bit IEEE registration Identifier is 0x000C03. */
+ [20] = 0x03,
+ [21] = 0x0C,
+ [22] = 0x00,
- /* Vendor Specific Data is 0x10000 */
- [23] = 0x01, [24] = 0x00,
+ /* Vendor Specific Data is 0x10000. */
+ [23] = 0x01,
+ [24] = 0x00,
/* Descriptor Block 5 [18 Bytes] */
[25] = EDID_PIXEL_CLOCK(74250000u) & 0xFF,
[26] = (EDID_PIXEL_CLOCK(74250000u) >> 8) & 0xFF,
- /* Horizontal Addressable Video is 1920px.
- * Horizontal Blanking is 280px.
- */
- [27] = 0x80, [28] = 0x18, [29] = 0x71,
+ /* Horizontal Addressable Video is 1920px,
+ Horizontal Blanking is 280px. */
+ [27] = 0x80,
+ [28] = 0x18,
+ [29] = 0x71,
- /* Vertical Addressable Video is 540 lines.
- * Vertical Blanking is 22 lines.
- */
- [30] = 0x1C, [31] = 0x16, [32] = 0x20,
+ /* Vertical Addressable Video is 540 lines,
+ Vertical Blanking is 22 lines. */
+ [30] = 0x1C,
+ [31] = 0x16,
+ [32] = 0x20,
- [33] = 88u, /* Horizontal Front Porch in pixels */
- [34] = 44u, /* Horizontal Sync Pulse Width in pixels */
- [35] = 0x25, /* Vertical Front Porch is 2 lines */
- [36] = 0x00, /* Vertical Sync Pulse Width is 5 lines */
+ [33] = 88u, /* Horizontal Front Porch in pixels. */
+ [34] = 44u, /* Horizontal Sync Pulse Width in pixels. */
+ [35] = 0x25, /* Vertical Front Porch is 2 lines. */
+ [36] = 0x00, /* Vertical Sync Pulse Width is 5 lines. */
/* Image size: 1039mm x 584mm */
- [37] = 0x0F, [38] = 0x48, [39] = 0x42,
+ [37] = 0x0F,
+ [38] = 0x48,
+ [39] = 0x42,
- /* Horizontal and Vertical Border Size is 0 px */
- [40] = 0u, [41] = 0u,
+ /* Horizontal and Vertical Border Size is 0px. */
+ [40] = 0u,
+ [41] = 0u,
- /* Timing is Interlaced Video
- * Stereo Video is not supported
- * Digital Separate Syncs are required
- */
+ /* Timing is Interlaced Video,
+ Stereo Video is not supported,
+ Digital Separate Syncs are required. */
[42] = 0x9E,
/* Descriptor Block 6 [18 Bytes] */
@@ -1046,31 +1084,35 @@ static int setup_decode_edid_it_dtv_frame_with_extension(void **state)
[43] = EDID_PIXEL_CLOCK(74250000u) & 0xFF,
[44] = (EDID_PIXEL_CLOCK(74250000u) >> 8) & 0xFF,
- /* Horizontal Addressable Video is 1280px.
- * Horizontal Blanking is 370 px.
- */
- [45] = 0x00, [46] = 0x72, [47] = 0x51,
+ /* Horizontal Addressable Video is 1280px,
+ Horizontal Blanking is 370 px. */
+ [45] = 0x00,
+ [46] = 0x72,
+ [47] = 0x51,
- /* Vertical Addressable Video is 720 lines.
- * Vertical Blanking is 30 lines.
- */
- [48] = 0xD0, [49] = 0x1E, [50] = 0x20,
+ /* Vertical Addressable Video is 720 lines,
+ Vertical Blanking is 30 lines. */
+ [48] = 0xD0,
+ [49] = 0x1E,
+ [50] = 0x20,
- [51] = 110u, /* Horizontal Front Porch in pixels */
- [52] = 40u, /* Horizontal Sync Pulse Width in pixels */
- [53] = 0x55, /* Vertical Front Porch is 5 lines */
- [54] = 0x00, /* Vertical Sync Pulse Width is 5 lines */
+ [51] = 110u, /* Horizontal Front Porch in pixels. */
+ [52] = 40u, /* Horizontal Sync Pulse Width in pixels. */
+ [53] = 0x55, /* Vertical Front Porch is 5 lines. */
+ [54] = 0x00, /* Vertical Sync Pulse Width is 5 lines. */
/* Image size: 1039mm x 584mm */
- [55] = 0x0F, [56] = 0x48, [57] = 0x42,
+ [55] = 0x0F,
+ [56] = 0x48,
+ [57] = 0x42,
- /* Horizontal and Vertical Border Size is 0 px */
- [58] = 0u, [59] = 0u,
+ /* Horizontal and Vertical Border Size is 0px. */
+ [58] = 0u,
+ [59] = 0u,
- /* Timing is Non-Interlaced Video
- * Stereo Video is not supported
- * Digital Separate Syncs are required
- */
+ /* Timing is Non-Interlaced Video,
+ Stereo Video is not supported,
+ Digital Separate Syncs are required. */
[60] = 0x1E,
/* Descriptor Block 7 [18 Bytes] */
@@ -1078,31 +1120,35 @@ static int setup_decode_edid_it_dtv_frame_with_extension(void **state)
[61] = EDID_PIXEL_CLOCK(27000000u) & 0xFF,
[62] = (EDID_PIXEL_CLOCK(27000000u) >> 8) & 0xFF,
- /* Horizontal Addressable Video is 1440px.
- * Horizontal Blanking is 276 px.
- */
- [63] = 0xA0, [64] = 0x14, [65] = 0x51,
+ /* Horizontal Addressable Video is 1440px,
+ Horizontal Blanking is 276 px. */
+ [63] = 0xA0,
+ [64] = 0x14,
+ [65] = 0x51,
- /* Vertical Addressable Video is 240 lines.
- * Vertical Blanking is 23 lines.
- */
- [66] = 0xF0, [67] = 0x16, [68] = 0x00,
+ /* Vertical Addressable Video is 240 lines,
+ Vertical Blanking is 23 lines. */
+ [66] = 0xF0,
+ [67] = 0x16,
+ [68] = 0x00,
- [69] = 38u, /* Horizontal Front Porch in pixels */
- [70] = 124u, /* Horizontal Sync Pulse Width in pixels */
- [71] = 0x43, /* Vertical Front Porch is 4 lines */
- [72] = 0x00, /* Vertical Sync Pulse Width is 3 lines */
+ [69] = 38u, /* Horizontal Front Porch in pixels. */
+ [70] = 124u, /* Horizontal Sync Pulse Width in pixels. */
+ [71] = 0x43, /* Vertical Front Porch is 4 lines. */
+ [72] = 0x00, /* Vertical Sync Pulse Width is 3 lines. */
/* Image size: 1039mm x 584mm */
- [73] = 0x0F, [74] = 0x48, [75] = 0x42,
+ [73] = 0x0F,
+ [74] = 0x48,
+ [75] = 0x42,
- /* Horizontal and Vertical Border Size is 0 px */
- [76] = 0u, [77] = 0u,
+ /* Horizontal and Vertical Border Size is 0px. */
+ [76] = 0u,
+ [77] = 0u,
- /* Timing is Interlaced Video
- * Stereo Video is not supported
- * Digital Separate Syncs are required
- */
+ /* Timing is Interlaced Video,
+ Stereo Video is not supported,
+ Digital Separate Syncs are required. */
[78] = 0x18,
/* Descriptor Block 8 [18 Bytes] */
@@ -1110,31 +1156,35 @@ static int setup_decode_edid_it_dtv_frame_with_extension(void **state)
[79] = EDID_PIXEL_CLOCK(27027000u) & 0xFF,
[80] = (EDID_PIXEL_CLOCK(27027000u) >> 8) & 0xFF,
- /* Horizontal Addressable Video is 1440px.
- * Horizontal Blanking is 276 px.
- */
- [81] = 0xA0, [82] = 0x14, [83] = 0x51,
+ /* Horizontal Addressable Video is 1440px,
+ Horizontal Blanking is 276 px. */
+ [81] = 0xA0,
+ [82] = 0x14,
+ [83] = 0x51,
- /* Vertical Addressable Video is 240 lines.
- * Vertical Blanking is 23 lines.
- */
- [84] = 0xF0, [85] = 0x16, [86] = 0x00,
+ /* Vertical Addressable Video is 240 lines,
+ Vertical Blanking is 23 lines. */
+ [84] = 0xF0,
+ [85] = 0x16,
+ [86] = 0x00,
- [87] = 38u, /* Horizontal Front Porch in pixels */
- [88] = 124u, /* Horizontal Sync Pulse Width in pixels */
- [89] = 0x43, /* Vertical Front Porch is 4 lines */
- [90] = 0x00, /* Vertical Sync Pulse Width is 3 lines */
+ [87] = 38u, /* Horizontal Front Porch in pixels. */
+ [88] = 124u, /* Horizontal Sync Pulse Width in pixels. */
+ [89] = 0x43, /* Vertical Front Porch is 4 lines. */
+ [90] = 0x00, /* Vertical Sync Pulse Width is 3 lines. */
/* Image size: 1039mm x 584mm */
- [91] = 0x0F, [92] = 0x48, [93] = 0x42,
+ [91] = 0x0F,
+ [92] = 0x48,
+ [93] = 0x42,
- /* Horizontal and Vertical Border Size is 0 px */
- [94] = 0u, [95] = 0u,
+ /* Horizontal and Vertical Border Size is 0px. */
+ [94] = 0u,
+ [95] = 0u,
- /* Timing is Interlaced Video
- * Stereo Video is not supported
- * Digital Separate Syncs are required
- */
+ /* Timing is Interlaced Video,
+ Stereo Video is not supported,
+ Digital Separate Syncs are required. */
[96] = 0x98,
[97 ... 126] = 0,
@@ -1144,10 +1194,8 @@ static int setup_decode_edid_it_dtv_frame_with_extension(void **state)
*state = malloc(sizeof(struct test_state));
- struct test_state ts = {
- .data_size = sizeof(raw) + sizeof(ext),
- .data = malloc(sizeof(raw) + sizeof(ext))
- };
+ struct test_state ts = {.data_size = sizeof(raw) + sizeof(ext),
+ .data = malloc(sizeof(raw) + sizeof(ext))};
memcpy(ts.data, &raw, sizeof(raw));
memcpy(ts.data + sizeof(raw), &ext[0], sizeof(ext));
@@ -1163,10 +1211,9 @@ static void test_decode_edid_it_dtv_frame_with_extension(void **state)
struct test_state *ts = *state;
/* In real-life situations frames often are not 100% conformant,
- * but are at least correct when it comes to key data fields.
- */
+ but are at least correct when it comes to key data fields. */
assert_int_equal(EDID_CONFORMANT,
- decode_edid((unsigned char *)ts->data, ts->data_size, &out));
+ decode_edid((unsigned char *)ts->data, ts->data_size, &out));
assert_int_equal(32, out.framebuffer_bits_per_pixel);
assert_int_equal(8, out.panel_bits_per_color);