diff --git a/src/backends/edid-parse.c b/src/backends/edid-parse.c index 0eeffa367..121bba731 100644 --- a/src/backends/edid-parse.c +++ b/src/backends/edid-parse.c @@ -35,166 +35,25 @@ #include "backends/edid.h" -static void -decode_edid_descriptors (const struct di_edid *di_edid, - const struct di_edid_display_descriptor *desc, - MetaEdidInfo *info) -{ - enum di_edid_display_descriptor_tag desc_tag; - const struct di_edid_display_range_limits *range_limits; - - desc_tag = di_edid_display_descriptor_get_tag (desc); - - switch (desc_tag) - { - case DI_EDID_DISPLAY_DESCRIPTOR_PRODUCT_SERIAL: - info->dsc_serial_number = - g_strdup (di_edid_display_descriptor_get_string (desc)); - break; - case DI_EDID_DISPLAY_DESCRIPTOR_PRODUCT_NAME: - info->dsc_product_name = - g_strdup (di_edid_display_descriptor_get_string (desc)); - break; - case DI_EDID_DISPLAY_DESCRIPTOR_RANGE_LIMITS: - range_limits = di_edid_display_descriptor_get_range_limits (desc); - g_assert (range_limits != NULL); - info->min_vert_rate_hz = range_limits->min_vert_rate_hz; - break; - default: - break; - } -} - -static void -decode_edid_colorimetry (const struct di_cta_colorimetry_block *colorimetry, - MetaEdidInfo *info) -{ - /* Colorimetry Data Block */ - if (colorimetry->xvycc_601) - info->colorimetry |= META_EDID_COLORIMETRY_XVYCC601; - if (colorimetry->xvycc_709) - info->colorimetry |= META_EDID_COLORIMETRY_XVYCC709; - if (colorimetry->sycc_601) - info->colorimetry |= META_EDID_COLORIMETRY_SYCC601; - if (colorimetry->opycc_601) - info->colorimetry |= META_EDID_COLORIMETRY_OPYCC601; - if (colorimetry->oprgb) - info->colorimetry |= META_EDID_COLORIMETRY_OPRGB; - if (colorimetry->bt2020_cycc) - info->colorimetry |= META_EDID_COLORIMETRY_BT2020CYCC; - if (colorimetry->bt2020_ycc) - info->colorimetry |= META_EDID_COLORIMETRY_BT2020YCC; - if (colorimetry->bt2020_rgb) - info->colorimetry |= META_EDID_COLORIMETRY_BT2020RGB; - if (colorimetry->st2113_rgb) - info->colorimetry |= META_EDID_COLORIMETRY_ST2113RGB; - if (colorimetry->ictcp) - info->colorimetry |= META_EDID_COLORIMETRY_ICTCP; -} - -static void -decode_edid_hdr_static_metadata (const struct di_cta_hdr_static_metadata_block *hdr, - MetaEdidInfo *info) -{ - /* HDR Static Metadata Block */ - if (hdr->descriptors->type1) - info->hdr_static_metadata.sm |= META_EDID_STATIC_METADATA_TYPE1; - - if (hdr->eotfs->traditional_sdr) - info->hdr_static_metadata.tf |= META_EDID_TF_TRADITIONAL_GAMMA_SDR; - if (hdr->eotfs->traditional_hdr) - info->hdr_static_metadata.tf |= META_EDID_TF_TRADITIONAL_GAMMA_HDR; - if (hdr->eotfs->pq) - info->hdr_static_metadata.tf |= META_EDID_TF_PQ; - if (hdr->eotfs->hlg) - info->hdr_static_metadata.tf |= META_EDID_TF_HLG; - - info->hdr_static_metadata.max_luminance = - hdr->desired_content_max_luminance; - info->hdr_static_metadata.max_fal = - hdr->desired_content_max_frame_avg_luminance; - info->hdr_static_metadata.min_luminance = - hdr->desired_content_min_luminance; -} - -static void -decode_edid_cta_ext (const struct di_edid_cta *cta, - MetaEdidInfo *info) -{ - const struct di_cta_data_block *const *data_blks; - const struct di_cta_data_block *data_blk; - enum di_cta_data_block_tag data_blk_tag; - const struct di_cta_colorimetry_block *colorimetry; - const struct di_cta_hdr_static_metadata_block *hdr_static_metadata; - size_t data_index; - - data_blks = di_edid_cta_get_data_blocks (cta); - for (data_index = 0; data_blks[data_index] != NULL; data_index++) - { - data_blk = data_blks[data_index]; - data_blk_tag = di_cta_data_block_get_tag (data_blk); - - switch (data_blk_tag) - { - case DI_CTA_DATA_BLOCK_COLORIMETRY: - colorimetry = di_cta_data_block_get_colorimetry (data_blk); - g_assert (colorimetry); - decode_edid_colorimetry (colorimetry, info); - break; - case DI_CTA_DATA_BLOCK_HDR_STATIC_METADATA: - hdr_static_metadata = - di_cta_data_block_get_hdr_static_metadata (data_blk); - g_assert (hdr_static_metadata); - decode_edid_hdr_static_metadata (hdr_static_metadata, info); - break; - default: - break; - } - } -} - -static void -decode_edid_extensions (const struct di_edid_ext *ext, - MetaEdidInfo *info) -{ - enum di_edid_ext_tag ext_tag; - const struct di_edid_cta *cta; - ext_tag = di_edid_ext_get_tag (ext); - - switch (ext_tag) - { - case DI_EDID_EXT_CEA: - cta = di_edid_ext_get_cta (ext); - decode_edid_cta_ext (cta, info); - break; - default: - break; - } -} - -static gboolean -decode_edid_info (const uint8_t *edid, - MetaEdidInfo *info, - size_t size) +MetaEdidInfo * +meta_edid_info_new_parse (const uint8_t *edid, + size_t size) { + g_autofree MetaEdidInfo *info = g_new0 (MetaEdidInfo, 1); + struct di_info *di_info; const struct di_edid *di_edid; - struct di_info *edid_info; const struct di_edid_vendor_product *vendor_product; - const struct di_edid_chromaticity_coords *chromaticity_coords; - float gamma; const struct di_edid_display_descriptor *const *edid_descriptors; - const struct di_edid_ext *const *extensions; - size_t desc_index; - size_t ext_index; + const struct di_color_primaries *default_color_primaries; + const struct di_supported_signal_colorimetry *signal_colorimetry; + const struct di_hdr_static_metadata *hdr_static_metadata; - edid_info = di_info_parse_edid (edid, size); + di_info = di_info_parse_edid (edid, size); - if (!edid_info) - { - return FALSE; - } + if (!di_info) + return NULL; - di_edid = di_info_get_edid (edid_info); + di_edid = di_info_get_edid (di_info); /* Vendor and Product identification */ vendor_product = di_edid_get_vendor_product (di_edid); @@ -208,61 +67,57 @@ decode_edid_info (const uint8_t *edid, /* Serial Number */ info->serial_number = vendor_product->serial; - /* Color Characteristics */ - chromaticity_coords = di_edid_get_chromaticity_coords (di_edid); - info->red_x = chromaticity_coords->red_x; - info->red_y = chromaticity_coords->red_y; - info->green_x = chromaticity_coords->green_x; - info->green_y = chromaticity_coords->green_y; - info->blue_x = chromaticity_coords->blue_x; - info->blue_y = chromaticity_coords->blue_y; - info->white_x = chromaticity_coords->white_x; - info->white_y = chromaticity_coords->white_y; - - /* Gamma */ - gamma = di_edid_get_basic_gamma (di_edid); - if (gamma != 0) - info->gamma = gamma; - else - info->gamma = -1; - - /* Descriptors */ + /* Product Serial and Name */ edid_descriptors = di_edid_get_display_descriptors (di_edid); - for (desc_index = 0; edid_descriptors[desc_index] != NULL; desc_index++) + for (; *edid_descriptors; edid_descriptors++) { - decode_edid_descriptors (di_edid, edid_descriptors[desc_index], info); + const struct di_edid_display_descriptor *desc = *edid_descriptors; + enum di_edid_display_descriptor_tag desc_tag = + di_edid_display_descriptor_get_tag (desc); + const struct di_edid_display_range_limits *range_limits; + + switch (desc_tag) + { + case DI_EDID_DISPLAY_DESCRIPTOR_PRODUCT_SERIAL: + info->dsc_serial_number = + g_strdup (di_edid_display_descriptor_get_string (desc)); + break; + case DI_EDID_DISPLAY_DESCRIPTOR_PRODUCT_NAME: + info->dsc_product_name = + g_strdup (di_edid_display_descriptor_get_string (desc)); + break; + case DI_EDID_DISPLAY_DESCRIPTOR_RANGE_LIMITS: + range_limits = di_edid_display_descriptor_get_range_limits (desc); + info->min_vert_rate_hz = range_limits->min_vert_rate_hz; + break; + default: + break; + } } - /* Extension Blocks */ - extensions = di_edid_get_extensions (di_edid); + /* Default Color Characteristics */ + default_color_primaries = di_info_get_default_color_primaries (di_info); + memcpy (&info->default_color_primaries, + default_color_primaries, + sizeof (*default_color_primaries)); - for (ext_index = 0; extensions[ext_index] != NULL; ext_index++) - { - decode_edid_extensions (extensions[ext_index], info); - } + /* Default Gamma */ + info->default_gamma = di_info_get_default_gamma (di_info); - di_info_destroy (edid_info); + /* Supported Signal Colorimetry */ + signal_colorimetry = di_info_get_supported_signal_colorimetry (di_info); + memcpy (&info->colorimetry, + signal_colorimetry, + sizeof (*signal_colorimetry)); - return TRUE; -} + /* Supported HDR Static Metadata */ + hdr_static_metadata = di_info_get_hdr_static_metadata (di_info); + memcpy (&info->hdr_static_metadata, + hdr_static_metadata, + sizeof (*hdr_static_metadata)); -MetaEdidInfo * -meta_edid_info_new_parse (const uint8_t *edid, - size_t size) -{ - MetaEdidInfo *info; - - info = g_new0 (MetaEdidInfo, 1); - - if (decode_edid_info (edid, info, size)) - { - return info; - } - else - { - meta_edid_info_free (info); - return NULL; - } + di_info_destroy (di_info); + return g_steal_pointer (&info); } void diff --git a/src/backends/edid.h b/src/backends/edid.h index f66fffa3f..ead8cc490 100644 --- a/src/backends/edid.h +++ b/src/backends/edid.h @@ -24,74 +24,28 @@ #pragma once #include +#include #include "core/util-private.h" -typedef struct _MetaEdidInfo MetaEdidInfo; -typedef struct _MetaEdidHdrStaticMetadata MetaEdidHdrStaticMetadata; - -typedef enum -{ - META_EDID_COLORIMETRY_XVYCC601 = (1 << 0), - META_EDID_COLORIMETRY_XVYCC709 = (1 << 1), - META_EDID_COLORIMETRY_SYCC601 = (1 << 2), - META_EDID_COLORIMETRY_OPYCC601 = (1 << 3), - META_EDID_COLORIMETRY_OPRGB = (1 << 4), - META_EDID_COLORIMETRY_BT2020CYCC = (1 << 5), - META_EDID_COLORIMETRY_BT2020YCC = (1 << 6), - META_EDID_COLORIMETRY_BT2020RGB = (1 << 7), - META_EDID_COLORIMETRY_ST2113RGB = (1 << 14), - META_EDID_COLORIMETRY_ICTCP = (1 << 15), -} MetaEdidColorimetry; - -typedef enum -{ - META_EDID_TF_TRADITIONAL_GAMMA_SDR = (1 << 0), - META_EDID_TF_TRADITIONAL_GAMMA_HDR = (1 << 1), - META_EDID_TF_PQ = (1 << 2), - META_EDID_TF_HLG = (1 << 3), -} MetaEdidTransferFunction; - -typedef enum -{ - META_EDID_STATIC_METADATA_TYPE1 = (1 << 0), -} MetaEdidStaticMetadataType; - -struct _MetaEdidHdrStaticMetadata -{ - float max_luminance; - float min_luminance; - float max_fal; - MetaEdidTransferFunction tf; - MetaEdidStaticMetadataType sm; -}; - -struct _MetaEdidInfo +typedef struct _MetaEdidInfo { char *manufacturer_code; int product_code; unsigned int serial_number; - double gamma; /* -1.0 if not specified */ - - double red_x; - double red_y; - double green_x; - double green_y; - double blue_x; - double blue_y; - double white_x; - double white_y; - /* Optional product description */ char *dsc_serial_number; char *dsc_product_name; + struct di_color_primaries default_color_primaries; + double default_gamma; /* -1.0 if not specified FIXME, now 0 */ + int32_t min_vert_rate_hz; - MetaEdidColorimetry colorimetry; - MetaEdidHdrStaticMetadata hdr_static_metadata; -}; + struct di_supported_signal_colorimetry colorimetry; + struct di_hdr_static_metadata hdr_static_metadata; +} MetaEdidInfo; META_EXPORT_TEST MetaEdidInfo *meta_edid_info_new_parse (const uint8_t *edid, diff --git a/src/backends/meta-color-device.c b/src/backends/meta-color-device.c index 42eec217c..849099596 100644 --- a/src/backends/meta-color-device.c +++ b/src/backends/meta-color-device.c @@ -991,15 +991,17 @@ create_icc_profile_from_edid (MetaColorDevice *color_device, const char *serial; g_autofree char *vendor_name = NULL; cmsHPROFILE lcms_profile; + const struct di_color_primaries *primaries = + &edid_info->default_color_primaries; - if (G_APPROX_VALUE (edid_info->red_x, 0.0, FLT_EPSILON) || - G_APPROX_VALUE (edid_info->red_y, 0.0, FLT_EPSILON) || - G_APPROX_VALUE (edid_info->green_x, 0.0, FLT_EPSILON) || - G_APPROX_VALUE (edid_info->green_y, 0.0, FLT_EPSILON) || - G_APPROX_VALUE (edid_info->blue_x, 0.0, FLT_EPSILON) || - G_APPROX_VALUE (edid_info->blue_y, 0.0, FLT_EPSILON) || - G_APPROX_VALUE (edid_info->white_x, 0.0, FLT_EPSILON) || - G_APPROX_VALUE (edid_info->white_y, 0.0, FLT_EPSILON)) + if (G_APPROX_VALUE (primaries->primary[0].x, 0.0, FLT_EPSILON) || + G_APPROX_VALUE (primaries->primary[0].y, 0.0, FLT_EPSILON) || + G_APPROX_VALUE (primaries->primary[1].x, 0.0, FLT_EPSILON) || + G_APPROX_VALUE (primaries->primary[1].y, 0.0, FLT_EPSILON) || + G_APPROX_VALUE (primaries->primary[2].x, 0.0, FLT_EPSILON) || + G_APPROX_VALUE (primaries->primary[2].y, 0.0, FLT_EPSILON) || + G_APPROX_VALUE (primaries->default_white.x, 0.0, FLT_EPSILON) || + G_APPROX_VALUE (primaries->default_white.y, 0.0, FLT_EPSILON)) { g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, "EDID for %s contains bogus Color Characteristics", @@ -1007,8 +1009,8 @@ create_icc_profile_from_edid (MetaColorDevice *color_device, return NULL; } - if (edid_info->gamma + FLT_EPSILON < 1.0 || - edid_info->gamma > 4.0) + if (edid_info->default_gamma + FLT_EPSILON < 1.0 || + edid_info->default_gamma > 4.0) { g_set_error (error, G_IO_ERROR, G_IO_ERROR_FAILED, "EDID for %s contains bogus Display Transfer " @@ -1027,18 +1029,18 @@ create_icc_profile_from_edid (MetaColorDevice *color_device, cd_icc = cd_icc_new (); - chroma.Red.x = edid_info->red_x; - chroma.Red.y = edid_info->red_y; - chroma.Green.x = edid_info->green_x; - chroma.Green.y = edid_info->green_y; - chroma.Blue.x = edid_info->blue_x; - chroma.Blue.y = edid_info->blue_y; - white_point.x = edid_info->white_x; - white_point.y = edid_info->white_y; + chroma.Red.x = primaries->primary[0].x; + chroma.Red.y = primaries->primary[0].y; + chroma.Green.x = primaries->primary[1].x; + chroma.Green.y = primaries->primary[1].y; + chroma.Blue.x = primaries->primary[2].x; + chroma.Blue.y = primaries->primary[2].y; + white_point.x = primaries->default_white.x; + white_point.y = primaries->default_white.y; white_point.Y = 1.0; /* Estimate the transfer function for the gamma */ - transfer_curve[0] = cmsBuildGamma (NULL, edid_info->gamma); + transfer_curve[0] = cmsBuildGamma (NULL, edid_info->default_gamma); transfer_curve[1] = transfer_curve[0]; transfer_curve[2] = transfer_curve[0]; diff --git a/src/backends/native/meta-output-kms.c b/src/backends/native/meta-output-kms.c index d95de564f..684cf0e09 100644 --- a/src/backends/native/meta-output-kms.c +++ b/src/backends/native/meta-output-kms.c @@ -446,42 +446,41 @@ meta_output_kms_new (MetaGpuKms *gpu_kms, if (output_info->edid_info) { - MetaEdidColorimetry edid_colorimetry = - output_info->edid_info->colorimetry; + struct di_supported_signal_colorimetry *edid_colorimetry = + &output_info->edid_info->colorimetry; uint64_t connector_colorimetry = connector_state->colorspace.supported; if (connector_colorimetry & (1 << META_OUTPUT_COLORSPACE_DEFAULT)) output_info->supported_color_spaces |= (1 << META_OUTPUT_COLORSPACE_DEFAULT); - if ((edid_colorimetry & META_EDID_COLORIMETRY_BT2020RGB) && + if ((edid_colorimetry->bt2020_rgb) && (connector_colorimetry & (1 << META_OUTPUT_COLORSPACE_BT2020))) output_info->supported_color_spaces |= (1 << META_OUTPUT_COLORSPACE_BT2020); } if (connector_state->hdr.supported && output_info->edid_info && - (output_info->edid_info->hdr_static_metadata.sm & - META_EDID_STATIC_METADATA_TYPE1)) + output_info->edid_info->hdr_static_metadata.type1) { - MetaEdidTransferFunction edid_tf = - output_info->edid_info->hdr_static_metadata.tf; + struct di_hdr_static_metadata *edid_hdr = + &output_info->edid_info->hdr_static_metadata; - if (edid_tf & META_EDID_TF_TRADITIONAL_GAMMA_SDR) + if (edid_hdr->traditional_sdr) { output_info->supported_hdr_eotfs |= (1 << META_OUTPUT_HDR_METADATA_EOTF_TRADITIONAL_GAMMA_SDR); } - if (edid_tf & META_EDID_TF_TRADITIONAL_GAMMA_HDR) + if (edid_hdr->traditional_hdr) { output_info->supported_hdr_eotfs |= (1 << META_OUTPUT_HDR_METADATA_EOTF_TRADITIONAL_GAMMA_HDR); } - if (edid_tf & META_EDID_TF_PQ) + if (edid_hdr->pq) { output_info->supported_hdr_eotfs |= (1 << META_OUTPUT_HDR_METADATA_EOTF_PQ); } - if (edid_tf & META_EDID_TF_HLG) + if (edid_hdr->hlg) { output_info->supported_hdr_eotfs |= (1 << META_OUTPUT_HDR_METADATA_EOTF_HLG); diff --git a/src/tests/color-management-tests.c b/src/tests/color-management-tests.c index 67aad17f7..18a4f16b2 100644 --- a/src/tests/color-management-tests.c +++ b/src/tests/color-management-tests.c @@ -81,29 +81,53 @@ static MonitorTestCaseSetup base_monitor_setup = { /* Extracted from a 'California Institute of Technology, 0x1403' monitor. */ #define CALTECH_MONITOR_EDID (\ (MetaEdidInfo) { \ - .gamma = 2.200000, \ - .red_x = 0.683594, \ - .red_y = 0.312500, \ - .green_x = 0.255859, \ - .green_y = 0.685547, \ - .blue_x = 0.139648, \ - .blue_y = 0.056641, \ - .white_x = 0.313477, \ - .white_y = 0.326172, \ + .default_gamma = 2.200000f, \ + .default_color_primaries = { \ + .primary = { \ + { \ + .x = 0.683594f, \ + .y = 0.312500f, \ + }, \ + { \ + .x = 0.255859f, \ + .y = 0.685547f, \ + }, \ + { \ + .x = 0.139648f, \ + .y = 0.056641f, \ + }, \ + }, \ + .default_white = { \ + .x = 0.313477f, \ + .y = 0.326172f, \ + }, \ + } \ }) /* Extracted from a 'Ancor Communications Inc, VX239, ECLMRS004144' monitor. */ #define ANCOR_VX239_EDID (\ (MetaEdidInfo) { \ - .gamma = 2.200000, \ - .red_x = 0.651367, \ - .red_y = 0.335938, \ - .green_x = 0.321289, \ - .green_y = 0.614258, \ - .blue_x = 0.154297, \ - .blue_y = 0.063477, \ - .white_x = 0.313477, \ - .white_y = 0.329102, \ + .default_gamma = 2.200000f, \ + .default_color_primaries = { \ + .primary = { \ + { \ + .x = 0.651367f, \ + .y = 0.335938f, \ + }, \ + { \ + .x = 0.321289f, \ + .y = 0.614258f, \ + }, \ + { \ + .x = 0.154297f, \ + .y = 0.063477f, \ + }, \ + }, \ + .default_white = { \ + .x = 0.313477f, \ + .y = 0.329102f, \ + }, \ + } \ }) #define assert_color_xyz_equal(color, expected_color) \ @@ -433,33 +457,41 @@ meta_test_color_management_device_basic (void) g_assert_nonnull (meta_monitor_get_edid_checksum_md5 (monitor)); monitor_edid_info = meta_monitor_get_edid_info (monitor); - g_assert_cmpfloat_with_epsilon (expected_edid_info->gamma, - monitor_edid_info->gamma, - FLT_EPSILON); - g_assert_cmpfloat_with_epsilon (expected_edid_info->red_x, - monitor_edid_info->red_x, - FLT_EPSILON); - g_assert_cmpfloat_with_epsilon (expected_edid_info->red_y, - monitor_edid_info->red_y, - FLT_EPSILON); - g_assert_cmpfloat_with_epsilon (expected_edid_info->green_x, - monitor_edid_info->green_x, - FLT_EPSILON); - g_assert_cmpfloat_with_epsilon (expected_edid_info->green_y, - monitor_edid_info->green_y, - FLT_EPSILON); - g_assert_cmpfloat_with_epsilon (expected_edid_info->blue_x, - monitor_edid_info->blue_x, - FLT_EPSILON); - g_assert_cmpfloat_with_epsilon (expected_edid_info->blue_y, - monitor_edid_info->blue_y, - FLT_EPSILON); - g_assert_cmpfloat_with_epsilon (expected_edid_info->white_x, - monitor_edid_info->white_x, - FLT_EPSILON); - g_assert_cmpfloat_with_epsilon (expected_edid_info->white_y, - monitor_edid_info->white_y, + g_assert_cmpfloat_with_epsilon (expected_edid_info->default_gamma, + monitor_edid_info->default_gamma, FLT_EPSILON); + g_assert_cmpfloat_with_epsilon ( + expected_edid_info->default_color_primaries.primary[0].x, + monitor_edid_info->default_color_primaries.primary[0].x, + FLT_EPSILON); + g_assert_cmpfloat_with_epsilon ( + expected_edid_info->default_color_primaries.primary[0].y, + monitor_edid_info->default_color_primaries.primary[0].y, + FLT_EPSILON); + g_assert_cmpfloat_with_epsilon ( + expected_edid_info->default_color_primaries.primary[1].x, + monitor_edid_info->default_color_primaries.primary[1].x, + FLT_EPSILON); + g_assert_cmpfloat_with_epsilon ( + expected_edid_info->default_color_primaries.primary[1].y, + monitor_edid_info->default_color_primaries.primary[1].y, + FLT_EPSILON); + g_assert_cmpfloat_with_epsilon ( + expected_edid_info->default_color_primaries.primary[2].x, + monitor_edid_info->default_color_primaries.primary[2].x, + FLT_EPSILON); + g_assert_cmpfloat_with_epsilon ( + expected_edid_info->default_color_primaries.primary[2].y, + monitor_edid_info->default_color_primaries.primary[2].y, + FLT_EPSILON); + g_assert_cmpfloat_with_epsilon ( + expected_edid_info->default_color_primaries.default_white.x, + monitor_edid_info->default_color_primaries.default_white.x, + FLT_EPSILON); + g_assert_cmpfloat_with_epsilon ( + expected_edid_info->default_color_primaries.default_white.y, + monitor_edid_info->default_color_primaries.default_white.y, + FLT_EPSILON); color_device = meta_color_manager_get_color_device (color_manager, monitor); @@ -605,7 +637,7 @@ meta_test_color_management_profile_device_bogus (void) edid_info = CALTECH_MONITOR_EDID; /* Decoding gamma is in [1, 4] */ - edid_info.gamma = 0.7; + edid_info.default_gamma = 0.7; test_case_setup.outputs[0].serial = "profile_device_bogus/gamma"; test_case_setup.outputs[0].edid_info = edid_info; test_case_setup.outputs[0].has_edid_info = TRUE; @@ -630,7 +662,7 @@ meta_test_color_management_profile_device_bogus (void) g_assert_null (color_profile); edid_info = CALTECH_MONITOR_EDID; - edid_info.green_y = 0.0; + edid_info.default_color_primaries.primary[1].y = 0.0; test_case_setup.outputs[0].serial = "profile_device_bogus/chromaticity"; test_case_setup.outputs[0].edid_info = edid_info; test_case_setup.outputs[0].has_edid_info = TRUE; diff --git a/src/tests/edid-tests.c b/src/tests/edid-tests.c index a4ba03419..dbf4dde16 100644 --- a/src/tests/edid-tests.c +++ b/src/tests/edid-tests.c @@ -71,11 +71,11 @@ main (int argc, g_assert_nonnull (edid_info); g_assert_cmpstr (edid_info->manufacturer_code, ==, "GSM"); g_assert_cmpint (edid_info->product_code, ==, 23507); - g_assert_cmpfloat_with_epsilon (edid_info->hdr_static_metadata.max_luminance, - 408.0f, 1.0f); - g_assert_cmpint (edid_info->hdr_static_metadata.tf, ==, - (META_EDID_TF_TRADITIONAL_GAMMA_SDR | META_EDID_TF_PQ)); - g_assert_cmpint (edid_info->colorimetry, ==, - (META_EDID_COLORIMETRY_BT2020YCC | - META_EDID_COLORIMETRY_BT2020RGB)); + g_assert_cmpfloat_with_epsilon ( + edid_info->hdr_static_metadata.desired_content_max_luminance, + 408.0f, 1.0f); + g_assert_true (edid_info->hdr_static_metadata.traditional_sdr); + g_assert_true (edid_info->hdr_static_metadata.pq); + g_assert_true (edid_info->colorimetry.bt2020_rgb); + g_assert_true (edid_info->colorimetry.bt2020_ycc); }