2013-08-16 11:06:46 -04:00
|
|
|
/* edid.h
|
|
|
|
*
|
|
|
|
* Copyright 2007, 2008, Red Hat, Inc.
|
2014-05-02 09:34:02 -04:00
|
|
|
*
|
2013-08-16 11:06:46 -04:00
|
|
|
* This file is part of the Gnome Library.
|
2014-05-02 09:34:02 -04:00
|
|
|
*
|
2013-08-16 11:06:46 -04:00
|
|
|
* The Gnome Library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public License as
|
|
|
|
* published by the Free Software Foundation; either version 2 of the
|
|
|
|
* License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* The Gnome Library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
2014-05-02 09:34:02 -04:00
|
|
|
*
|
2013-08-16 11:06:46 -04:00
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with the Gnome Library; see the file COPYING.LIB. If not,
|
2023-08-07 05:50:23 -04:00
|
|
|
* see <http://www.gnu.org/licenses/>.
|
2014-05-02 09:34:02 -04:00
|
|
|
*
|
2013-08-16 11:06:46 -04:00
|
|
|
* Author: Soren Sandmann <sandmann@redhat.com>
|
|
|
|
*/
|
|
|
|
|
2023-07-21 09:37:20 -04:00
|
|
|
#pragma once
|
2013-08-16 11:06:46 -04:00
|
|
|
|
2021-11-08 08:56:35 -05:00
|
|
|
#include <stdint.h>
|
|
|
|
|
2022-03-25 15:15:31 -04:00
|
|
|
#include "core/util-private.h"
|
|
|
|
|
2021-11-08 08:56:35 -05:00
|
|
|
typedef struct _MetaEdidInfo MetaEdidInfo;
|
2022-03-18 17:02:13 -04:00
|
|
|
typedef struct _MetaEdidHdrStaticMetadata MetaEdidHdrStaticMetadata;
|
2013-08-16 11:06:46 -04:00
|
|
|
|
2022-03-29 09:25:31 -04:00
|
|
|
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;
|
|
|
|
|
2022-03-18 17:02:13 -04:00
|
|
|
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
|
|
|
|
{
|
2023-03-02 13:47:48 -05:00
|
|
|
META_EDID_STATIC_METADATA_TYPE1 = (1 << 0),
|
2022-03-18 17:02:13 -04:00
|
|
|
} MetaEdidStaticMetadataType;
|
|
|
|
|
|
|
|
struct _MetaEdidHdrStaticMetadata
|
|
|
|
{
|
|
|
|
int available;
|
|
|
|
int max_luminance;
|
|
|
|
int min_luminance;
|
|
|
|
int max_fal;
|
|
|
|
MetaEdidTransferFunction tf;
|
|
|
|
MetaEdidStaticMetadataType sm;
|
|
|
|
};
|
|
|
|
|
2021-11-08 08:56:35 -05:00
|
|
|
struct _MetaEdidInfo
|
2013-08-16 11:06:46 -04:00
|
|
|
{
|
2023-07-11 10:27:55 -04:00
|
|
|
char *manufacturer_code;
|
2023-02-03 00:50:15 -05:00
|
|
|
int product_code;
|
|
|
|
unsigned int serial_number;
|
2013-08-16 11:06:46 -04:00
|
|
|
|
2023-02-03 00:50:15 -05:00
|
|
|
double gamma; /* -1.0 if not specified */
|
2013-08-16 11:06:46 -04:00
|
|
|
|
2023-02-03 00:50:15 -05:00
|
|
|
double red_x;
|
|
|
|
double red_y;
|
|
|
|
double green_x;
|
|
|
|
double green_y;
|
|
|
|
double blue_x;
|
|
|
|
double blue_y;
|
|
|
|
double white_x;
|
|
|
|
double white_y;
|
2013-08-16 11:06:46 -04:00
|
|
|
|
|
|
|
/* Optional product description */
|
2023-07-11 10:27:55 -04:00
|
|
|
char *dsc_serial_number;
|
|
|
|
char *dsc_product_name;
|
2022-03-29 09:25:31 -04:00
|
|
|
|
|
|
|
MetaEdidColorimetry colorimetry;
|
2022-03-18 17:02:13 -04:00
|
|
|
MetaEdidHdrStaticMetadata hdr_static_metadata;
|
2013-08-16 11:06:46 -04:00
|
|
|
};
|
|
|
|
|
2022-03-25 15:15:31 -04:00
|
|
|
META_EXPORT_TEST
|
2023-03-07 00:21:19 -05:00
|
|
|
MetaEdidInfo *meta_edid_info_new_parse (const uint8_t *edid,
|
|
|
|
size_t size);
|