2019-03-08 16:23:15 +01:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2019 Red Hat
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License as
|
|
|
|
* published by the Free Software Foundation; either version 2 of the
|
|
|
|
* License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program 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
|
|
|
|
* General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2023-08-07 11:50:23 +02:00
|
|
|
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
2019-03-08 16:23:15 +01:00
|
|
|
*/
|
|
|
|
|
2023-07-21 15:37:20 +02:00
|
|
|
#pragma once
|
2019-03-08 16:23:15 +01:00
|
|
|
|
2020-07-14 16:48:47 +02:00
|
|
|
#include "backends/native/meta-kms-connector.h"
|
|
|
|
|
|
|
|
typedef enum _MetaKmsConnectorProp
|
|
|
|
{
|
2020-07-16 22:05:18 +02:00
|
|
|
META_KMS_CONNECTOR_PROP_CRTC_ID = 0,
|
|
|
|
META_KMS_CONNECTOR_PROP_DPMS,
|
2020-07-14 16:48:47 +02:00
|
|
|
META_KMS_CONNECTOR_PROP_UNDERSCAN,
|
|
|
|
META_KMS_CONNECTOR_PROP_UNDERSCAN_HBORDER,
|
|
|
|
META_KMS_CONNECTOR_PROP_UNDERSCAN_VBORDER,
|
2021-03-22 01:27:39 +01:00
|
|
|
META_KMS_CONNECTOR_PROP_PRIVACY_SCREEN_SW_STATE,
|
|
|
|
META_KMS_CONNECTOR_PROP_PRIVACY_SCREEN_HW_STATE,
|
2022-04-20 21:43:28 +02:00
|
|
|
META_KMS_CONNECTOR_PROP_EDID,
|
|
|
|
META_KMS_CONNECTOR_PROP_TILE,
|
|
|
|
META_KMS_CONNECTOR_PROP_SUGGESTED_X,
|
|
|
|
META_KMS_CONNECTOR_PROP_SUGGESTED_Y,
|
|
|
|
META_KMS_CONNECTOR_PROP_HOTPLUG_MODE_UPDATE,
|
|
|
|
META_KMS_CONNECTOR_PROP_SCALING_MODE,
|
|
|
|
META_KMS_CONNECTOR_PROP_PANEL_ORIENTATION,
|
|
|
|
META_KMS_CONNECTOR_PROP_NON_DESKTOP,
|
2022-05-13 16:20:57 +08:00
|
|
|
META_KMS_CONNECTOR_PROP_MAX_BPC,
|
2023-03-02 01:47:00 +01:00
|
|
|
META_KMS_CONNECTOR_PROP_COLORSPACE,
|
|
|
|
META_KMS_CONNECTOR_PROP_HDR_OUTPUT_METADATA,
|
2020-07-14 16:48:47 +02:00
|
|
|
META_KMS_CONNECTOR_N_PROPS
|
|
|
|
} MetaKmsConnectorProp;
|
|
|
|
|
2022-04-20 21:43:28 +02:00
|
|
|
typedef enum _MetaKmsConnectorDpms
|
|
|
|
{
|
|
|
|
META_KMS_CONNECTOR_DPMS_ON = 0,
|
|
|
|
META_KMS_CONNECTOR_DPMS_STANDBY,
|
|
|
|
META_KMS_CONNECTOR_DPMS_SUSPEND,
|
|
|
|
META_KMS_CONNECTOR_DPMS_OFF,
|
2022-04-20 21:52:10 +02:00
|
|
|
META_KMS_CONNECTOR_DPMS_N_PROPS,
|
|
|
|
META_KMS_CONNECTOR_DPMS_UNKNOWN,
|
2022-04-20 21:43:28 +02:00
|
|
|
} MetaKmsConnectorDpms;
|
|
|
|
|
|
|
|
typedef enum _MetaKmsConnectorUnderscan
|
|
|
|
{
|
|
|
|
META_KMS_CONNECTOR_UNDERSCAN_OFF = 0,
|
|
|
|
META_KMS_CONNECTOR_UNDERSCAN_ON,
|
|
|
|
META_KMS_CONNECTOR_UNDERSCAN_AUTO,
|
2022-04-20 21:52:10 +02:00
|
|
|
META_KMS_CONNECTOR_UNDERSCAN_N_PROPS,
|
|
|
|
META_KMS_CONNECTOR_UNDERSCAN_UNKNOWN,
|
2022-04-20 21:43:28 +02:00
|
|
|
} MetaKmsConnectorUnderscan;
|
|
|
|
|
|
|
|
typedef enum _MetaKmsConnectorPrivacyScreen
|
|
|
|
{
|
|
|
|
META_KMS_CONNECTOR_PRIVACY_SCREEN_ENABLED = 0,
|
|
|
|
META_KMS_CONNECTOR_PRIVACY_SCREEN_DISABLED,
|
|
|
|
META_KMS_CONNECTOR_PRIVACY_SCREEN_ENABLED_LOCKED,
|
|
|
|
META_KMS_CONNECTOR_PRIVACY_SCREEN_DISABLED_LOCKED,
|
|
|
|
META_KMS_CONNECTOR_PRIVACY_SCREEN_N_PROPS,
|
2022-04-20 21:52:10 +02:00
|
|
|
META_KMS_CONNECTOR_PRIVACY_SCREEN_UNKNOWN,
|
2022-04-20 21:43:28 +02:00
|
|
|
} MetaKmsConnectorPrivacyScreen;
|
|
|
|
|
|
|
|
typedef enum _MetaKmsConnectorScalingMode
|
|
|
|
{
|
|
|
|
META_KMS_CONNECTOR_SCALING_MODE_NONE = 0,
|
|
|
|
META_KMS_CONNECTOR_SCALING_MODE_FULL,
|
|
|
|
META_KMS_CONNECTOR_SCALING_MODE_CENTER,
|
|
|
|
META_KMS_CONNECTOR_SCALING_MODE_FULL_ASPECT,
|
|
|
|
META_KMS_CONNECTOR_SCALING_MODE_N_PROPS,
|
2022-04-20 21:52:10 +02:00
|
|
|
META_KMS_CONNECTOR_SCALING_MODE_UNKNOWN,
|
2022-04-20 21:43:28 +02:00
|
|
|
} MetaKmsConnectorScalingMode;
|
|
|
|
|
|
|
|
typedef enum _MetaKmsConnectorPanelOrientation
|
|
|
|
{
|
|
|
|
META_KMS_CONNECTOR_PANEL_ORIENTATION_NORMAL = 0,
|
|
|
|
META_KMS_CONNECTOR_PANEL_ORIENTATION_UPSIDE_DOWN,
|
|
|
|
META_KMS_CONNECTOR_PANEL_ORIENTATION_LEFT_SIDE_UP,
|
|
|
|
META_KMS_CONNECTOR_PANEL_ORIENTATION_RIGHT_SIDE_UP,
|
|
|
|
META_KMS_CONNECTOR_PANEL_ORIENTATION_N_PROPS,
|
2022-04-20 21:52:10 +02:00
|
|
|
META_KMS_CONNECTOR_PANEL_ORIENTATION_UNKNOWN,
|
2022-04-20 21:43:28 +02:00
|
|
|
} MetaKmsConnectorPanelOrientation;
|
|
|
|
|
2023-03-02 01:47:00 +01:00
|
|
|
typedef enum _MetaKmsConnectorColorspace
|
|
|
|
{
|
|
|
|
META_KMS_CONNECTOR_COLORSPACE_DEFAULT = 0,
|
|
|
|
META_KMS_CONNECTOR_COLORSPACE_RGB_WIDE_GAMUT_FIXED_POINT,
|
|
|
|
META_KMS_CONNECTOR_COLORSPACE_RGB_WIDE_GAMUT_FLOATING_POINT,
|
|
|
|
META_KMS_CONNECTOR_COLORSPACE_RGB_OPRGB,
|
|
|
|
META_KMS_CONNECTOR_COLORSPACE_RGB_DCI_P3_RGB_D65,
|
|
|
|
META_KMS_CONNECTOR_COLORSPACE_BT2020_RGB,
|
|
|
|
META_KMS_CONNECTOR_COLORSPACE_BT601_YCC,
|
|
|
|
META_KMS_CONNECTOR_COLORSPACE_BT709_YCC,
|
|
|
|
META_KMS_CONNECTOR_COLORSPACE_XVYCC_601,
|
|
|
|
META_KMS_CONNECTOR_COLORSPACE_XVYCC_709,
|
|
|
|
META_KMS_CONNECTOR_COLORSPACE_SYCC_601,
|
|
|
|
META_KMS_CONNECTOR_COLORSPACE_OPYCC_601,
|
|
|
|
META_KMS_CONNECTOR_COLORSPACE_BT2020_CYCC,
|
|
|
|
META_KMS_CONNECTOR_COLORSPACE_BT2020_YCC,
|
|
|
|
META_KMS_CONNECTOR_COLORSPACE_SMPTE_170M_YCC,
|
|
|
|
META_KMS_CONNECTOR_COLORSPACE_DCI_P3_RGB_THEATER,
|
|
|
|
META_KMS_CONNECTOR_COLORSPACE_N_PROPS,
|
|
|
|
META_KMS_CONNECTOR_COLORSPACE_UNKNOWN,
|
|
|
|
} MetaKmsConnectorColorspace;
|
|
|
|
|
2020-07-14 16:48:47 +02:00
|
|
|
uint32_t meta_kms_connector_get_prop_id (MetaKmsConnector *connector,
|
|
|
|
MetaKmsConnectorProp prop);
|
|
|
|
|
|
|
|
const char * meta_kms_connector_get_prop_name (MetaKmsConnector *connector,
|
|
|
|
MetaKmsConnectorProp prop);
|
2019-03-08 16:23:15 +01:00
|
|
|
|
2022-04-20 22:54:27 +02:00
|
|
|
uint64_t meta_kms_connector_get_prop_drm_value (MetaKmsConnector *connector,
|
|
|
|
MetaKmsConnectorProp prop,
|
|
|
|
uint64_t value);
|
|
|
|
|
2022-03-17 10:45:53 +01:00
|
|
|
MetaKmsResourceChanges meta_kms_connector_update_state_in_impl (MetaKmsConnector *connector,
|
|
|
|
drmModeRes *drm_resources,
|
|
|
|
drmModeConnector *drm_connector);
|
2019-03-09 15:55:24 +01:00
|
|
|
|
2022-03-17 10:45:53 +01:00
|
|
|
void meta_kms_connector_disable_in_impl (MetaKmsConnector *connector);
|
2021-06-28 10:11:31 +02:00
|
|
|
|
2022-03-17 10:45:53 +01:00
|
|
|
MetaKmsResourceChanges meta_kms_connector_predict_state_in_impl (MetaKmsConnector *connector,
|
|
|
|
MetaKmsUpdate *update);
|
2019-10-04 11:54:29 +02:00
|
|
|
|
2019-03-08 16:23:15 +01:00
|
|
|
MetaKmsConnector * meta_kms_connector_new (MetaKmsImplDevice *impl_device,
|
|
|
|
drmModeConnector *drm_connector,
|
|
|
|
drmModeRes *drm_resources);
|
|
|
|
|
2019-08-22 14:26:54 +02:00
|
|
|
gboolean meta_kms_connector_is_same_as (MetaKmsConnector *connector,
|
|
|
|
drmModeConnector *drm_connector);
|
|
|
|
|
2023-03-04 15:31:14 +01:00
|
|
|
uint64_t meta_output_color_space_to_drm_color_space (MetaOutputColorspace color_space);
|
|
|
|
|
2023-03-03 16:37:34 +01:00
|
|
|
META_EXPORT_TEST
|
2023-03-02 02:06:24 +01:00
|
|
|
void meta_set_drm_hdr_metadata (MetaOutputHdrMetadata *metadata,
|
|
|
|
struct hdr_output_metadata *drm_metadata);
|
|
|
|
|
2023-03-03 16:37:34 +01:00
|
|
|
META_EXPORT_TEST
|
|
|
|
gboolean set_output_hdr_metadata (struct hdr_output_metadata *drm_metadata,
|
|
|
|
MetaOutputHdrMetadata *metadata);
|
|
|
|
|
|
|
|
META_EXPORT_TEST
|
|
|
|
gboolean hdr_metadata_equal (MetaOutputHdrMetadata *metadata,
|
|
|
|
MetaOutputHdrMetadata *other_metadata);
|