mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-29 10:08:59 +00:00
1343acc8cd
Deleted (upstreamed): bcm27xx/patches-5.10/950-0669-drm-vc4-hdmi-Make-sure-the-device-is-powered-with-CE.patch [1] bcm27xx/patches-5.10/950-0672-drm-vc4-hdmi-Move-initial-register-read-after-pm_run.patch [1] gemini/patches-5.10/0003-ARM-dts-gemini-NAS4220-B-fis-index-block-with-128-Ki.patch [2] Manually rebased: bcm27xx/patches-5.10/950-0675-drm-vc4-hdmi-Drop-devm-interrupt-handler-for-CEC-int.patch Manually reverted: generic/pending-5.10/860-Revert-ASoC-mediatek-Check-for-error-clk-pointer.patch [3] [1] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.10.94&id=55b10b88ac8654fc2f31518aa349a2e643b37f18 [2] https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.10.94&id=958a8819d41420d7a74ed922a09cacc0ba3a4218 [3] https://lore.kernel.org/all/trinity-2a727d96-0335-4d03-8f30-e22a0e10112d-1643363480085@3c-app-gmx-bap33/ Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com> Signed-off-by: Daniel Golle <daniel@makrotopia.org>
100 lines
4.1 KiB
Diff
100 lines
4.1 KiB
Diff
From c65eada45c578cfb558ee9a92ce5048a367692d7 Mon Sep 17 00:00:00 2001
|
|
From: Maxime Ripard <maxime@cerno.tech>
|
|
Date: Fri, 19 Mar 2021 11:21:41 +0100
|
|
Subject: [PATCH] drm/connector: Create a helper to attach the
|
|
hdr_output_metadata property
|
|
|
|
All the drivers that implement HDR output call pretty much the same
|
|
function to initialise the hdr_output_metadata property, and while the
|
|
creation of that property is in a helper, every driver uses the same
|
|
code to attach it.
|
|
|
|
Provide a helper for it as well
|
|
|
|
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
|
|
---
|
|
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 +---
|
|
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 3 +--
|
|
drivers/gpu/drm/drm_connector.c | 21 +++++++++++++++++++
|
|
drivers/gpu/drm/i915/display/intel_hdmi.c | 3 +--
|
|
include/drm/drm_connector.h | 1 +
|
|
5 files changed, 25 insertions(+), 7 deletions(-)
|
|
|
|
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
|
|
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
|
|
@@ -6528,9 +6528,7 @@ void amdgpu_dm_connector_init_helper(str
|
|
if (connector_type == DRM_MODE_CONNECTOR_HDMIA ||
|
|
connector_type == DRM_MODE_CONNECTOR_DisplayPort ||
|
|
connector_type == DRM_MODE_CONNECTOR_eDP) {
|
|
- drm_object_attach_property(
|
|
- &aconnector->base.base,
|
|
- dm->ddev->mode_config.hdr_output_metadata_property, 0);
|
|
+ drm_connector_attach_hdr_output_metadata_property(&aconnector->base);
|
|
|
|
if (!aconnector->mst_port)
|
|
drm_connector_attach_vrr_capable_property(&aconnector->base);
|
|
--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
|
|
+++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
|
|
@@ -2500,8 +2500,7 @@ static int dw_hdmi_connector_create(stru
|
|
drm_connector_attach_max_bpc_property(connector, 8, 16);
|
|
|
|
if (hdmi->version >= 0x200a && hdmi->plat_data->use_drm_infoframe)
|
|
- drm_object_attach_property(&connector->base,
|
|
- connector->dev->mode_config.hdr_output_metadata_property, 0);
|
|
+ drm_connector_attach_hdr_output_metadata_property(connector);
|
|
|
|
drm_connector_attach_encoder(connector, hdmi->bridge.encoder);
|
|
|
|
--- a/drivers/gpu/drm/drm_connector.c
|
|
+++ b/drivers/gpu/drm/drm_connector.c
|
|
@@ -2144,6 +2144,27 @@ int drm_connector_attach_max_bpc_propert
|
|
EXPORT_SYMBOL(drm_connector_attach_max_bpc_property);
|
|
|
|
/**
|
|
+ * drm_connector_attach_hdr_output_metadata_property - attach "HDR_OUTPUT_METADA" property
|
|
+ * @connector: connector to attach the property on.
|
|
+ *
|
|
+ * This is used to allow the userspace to send HDR Metadata to the
|
|
+ * driver.
|
|
+ *
|
|
+ * Returns:
|
|
+ * Zero on success, negative errno on failure.
|
|
+ */
|
|
+int drm_connector_attach_hdr_output_metadata_property(struct drm_connector *connector)
|
|
+{
|
|
+ struct drm_device *dev = connector->dev;
|
|
+ struct drm_property *prop = dev->mode_config.hdr_output_metadata_property;
|
|
+
|
|
+ drm_object_attach_property(&connector->base, prop, 0);
|
|
+
|
|
+ return 0;
|
|
+}
|
|
+EXPORT_SYMBOL(drm_connector_attach_hdr_output_metadata_property);
|
|
+
|
|
+/**
|
|
* drm_connector_set_vrr_capable_property - sets the variable refresh rate
|
|
* capable property for a connector
|
|
* @connector: drm connector
|
|
--- a/drivers/gpu/drm/i915/display/intel_hdmi.c
|
|
+++ b/drivers/gpu/drm/i915/display/intel_hdmi.c
|
|
@@ -2971,8 +2971,7 @@ intel_hdmi_add_properties(struct intel_h
|
|
drm_connector_attach_content_type_property(connector);
|
|
|
|
if (INTEL_GEN(dev_priv) >= 10 || IS_GEMINILAKE(dev_priv))
|
|
- drm_object_attach_property(&connector->base,
|
|
- connector->dev->mode_config.hdr_output_metadata_property, 0);
|
|
+ drm_connector_attach_hdr_output_metadata_property(connector);
|
|
|
|
if (!HAS_GMCH(dev_priv))
|
|
drm_connector_attach_max_bpc_property(connector, 8, 12);
|
|
--- a/include/drm/drm_connector.h
|
|
+++ b/include/drm/drm_connector.h
|
|
@@ -1622,6 +1622,7 @@ int drm_connector_attach_scaling_mode_pr
|
|
u32 scaling_mode_mask);
|
|
int drm_connector_attach_vrr_capable_property(
|
|
struct drm_connector *connector);
|
|
+int drm_connector_attach_hdr_output_metadata_property(struct drm_connector *connector);
|
|
int drm_mode_create_aspect_ratio_property(struct drm_device *dev);
|
|
int drm_mode_create_hdmi_colorspace_property(struct drm_connector *connector);
|
|
int drm_mode_create_dp_colorspace_property(struct drm_connector *connector);
|