Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1233599pxj; Fri, 18 Jun 2021 02:35:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxH3uuo39ZwBVr2eqrqkeH8qk5Ne+n8F56kW/7ZDaanx/HgmTK4jqpMxhjkEOQVJYz+hEV2 X-Received: by 2002:a17:906:4447:: with SMTP id i7mr10333801ejp.185.1624008933604; Fri, 18 Jun 2021 02:35:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624008933; cv=none; d=google.com; s=arc-20160816; b=tnizvGuJ76ymh7j+SAzgF/AwoIwyZL26sy7h9SNg26J1g3rOmGmL5l+eHsFChUowIL 5sHk8ha4bO146JDgv2pTJM8EoWjY/AFPM4cFUjt6A7qzVeiGXzeJtieanL+QG3Nm2LJv HugrTlPFnTNEsv1DbVnO7BwqdEK8Ce4wcHioznVb/qfGNQwCg6qRGkFd55yf/iMRbZQt 42nQwJ/v2tTRt7I7kLtjF2e0PijwwoF6zL3pIffSPVxYIMj8P1FYGiIUJCa9JoyKlzX/ glIxKu+/+pxymXl8eqOrHnieMYTqq00J+eh6upz2kVARsG5ymBp8gL3OE/Pvwasbd9nH 7sMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=5Cc5NsZc9DncIpgdDnqBi30mb+isHSK/82g258dvkRg=; b=q07PfHxpD4Yg7yRIASSCBvG4Xa9z73p66swXpBKO2o0VCaF18JqQQv2hWU/yEgeepg 6sEE5umdbzkY3DkgeoFwMQ1SV6AEURzI9li+GB4bvdVYoi1m1+JHjXzk14X/EBeHVayq 567zKKA6sWqiWUoFpu91Rc8Aj4XutiND3Pq44Aa79o76+OhXJRW4w1NDNzDeP2BtlVWl 2kALBl974Tq89BmdmdYowlxd5ovR8MSo72B0/o61gPz8450CynH47L9GmzEcLWCuHtft WTe9rc4jjGNMIAAUgVsKf4qHYr8ujTE6tUIyMiWvZqv56rXij1KNHMoANGwownzutF0d FNwQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v7si8356478edq.284.2021.06.18.02.35.11; Fri, 18 Jun 2021 02:35:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232231AbhFRJOt (ORCPT + 99 others); Fri, 18 Jun 2021 05:14:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233956AbhFRJN5 (ORCPT ); Fri, 18 Jun 2021 05:13:57 -0400 Received: from srv6.fidu.org (srv6.fidu.org [IPv6:2a01:4f8:231:de0::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA188C061574 for ; Fri, 18 Jun 2021 02:11:47 -0700 (PDT) Received: from localhost (localhost.localdomain [127.0.0.1]) by srv6.fidu.org (Postfix) with ESMTP id 95D8CC800BA; Fri, 18 Jun 2021 11:11:46 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at srv6.fidu.org Received: from srv6.fidu.org ([127.0.0.1]) by localhost (srv6.fidu.org [127.0.0.1]) (amavisd-new, port 10026) with LMTP id RSAZ3gf78Xpk; Fri, 18 Jun 2021 11:11:46 +0200 (CEST) Received: from wsembach-tuxedo.fritz.box (p200300e37f3949001760E5710682cA7E.dip0.t-ipconnect.de [IPv6:2003:e3:7f39:4900:1760:e571:682:ca7e]) (Authenticated sender: wse@tuxedocomputers.com) by srv6.fidu.org (Postfix) with ESMTPA id 155C0C800B9; Fri, 18 Jun 2021 11:11:46 +0200 (CEST) From: Werner Sembach To: harry.wentland@amd.com, sunpeng.li@amd.com, alexander.deucher@amd.com, christian.koenig@amd.com, airlied@linux.ie, daniel@ffwll.ch, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, jani.nikula@linux.intel.com, joonas.lahtinen@linux.intel.com, rodrigo.vivi@intel.com, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org Cc: Werner Sembach Subject: [PATCH v4 16/17] drm/i915/display: Use the general "Broadcast RGB" implementation Date: Fri, 18 Jun 2021 11:11:15 +0200 Message-Id: <20210618091116.14428-17-wse@tuxedocomputers.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210618091116.14428-1-wse@tuxedocomputers.com> References: <20210618091116.14428-1-wse@tuxedocomputers.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Change from the i915 specific "Broadcast RGB" drm property implementation to the general one. This commit delete all traces of the former "Broadcast RGB" implementation and add a new one using the new driver agnoistic functions an variables. Signed-off-by: Werner Sembach --- drivers/gpu/drm/i915/display/intel_atomic.c | 8 ------ .../gpu/drm/i915/display/intel_connector.c | 28 ------------------- .../gpu/drm/i915/display/intel_connector.h | 1 - .../drm/i915/display/intel_display_types.h | 8 ------ drivers/gpu/drm/i915/display/intel_dp.c | 9 ++---- drivers/gpu/drm/i915/display/intel_dp_mst.c | 6 +++- drivers/gpu/drm/i915/display/intel_hdmi.c | 8 ++---- drivers/gpu/drm/i915/display/intel_sdvo.c | 2 +- drivers/gpu/drm/i915/i915_drv.h | 1 - 9 files changed, 12 insertions(+), 59 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_atomic.c b/drivers/gpu/drm/i915/display/intel_atomic.c index b4e7ac51aa31..f8d5a0e287b0 100644 --- a/drivers/gpu/drm/i915/display/intel_atomic.c +++ b/drivers/gpu/drm/i915/display/intel_atomic.c @@ -63,8 +63,6 @@ int intel_digital_connector_atomic_get_property(struct drm_connector *connector, if (property == dev_priv->force_audio_property) *val = intel_conn_state->force_audio; - else if (property == dev_priv->broadcast_rgb_property) - *val = intel_conn_state->broadcast_rgb; else { drm_dbg_atomic(&dev_priv->drm, "Unknown property [PROP:%d:%s]\n", @@ -99,11 +97,6 @@ int intel_digital_connector_atomic_set_property(struct drm_connector *connector, return 0; } - if (property == dev_priv->broadcast_rgb_property) { - intel_conn_state->broadcast_rgb = val; - return 0; - } - drm_dbg_atomic(&dev_priv->drm, "Unknown property [PROP:%d:%s]\n", property->base.id, property->name); return -EINVAL; @@ -134,7 +127,6 @@ int intel_digital_connector_atomic_check(struct drm_connector *conn, * up in a modeset. */ if (new_conn_state->force_audio != old_conn_state->force_audio || - new_conn_state->broadcast_rgb != old_conn_state->broadcast_rgb || new_conn_state->base.colorspace != old_conn_state->base.colorspace || new_conn_state->base.picture_aspect_ratio != old_conn_state->base.picture_aspect_ratio || new_conn_state->base.content_type != old_conn_state->base.content_type || diff --git a/drivers/gpu/drm/i915/display/intel_connector.c b/drivers/gpu/drm/i915/display/intel_connector.c index 9bed1ccecea0..89f0edf19182 100644 --- a/drivers/gpu/drm/i915/display/intel_connector.c +++ b/drivers/gpu/drm/i915/display/intel_connector.c @@ -241,34 +241,6 @@ intel_attach_force_audio_property(struct drm_connector *connector) drm_object_attach_property(&connector->base, prop, 0); } -static const struct drm_prop_enum_list broadcast_rgb_names[] = { - { INTEL_BROADCAST_RGB_AUTO, "Automatic" }, - { INTEL_BROADCAST_RGB_FULL, "Full" }, - { INTEL_BROADCAST_RGB_LIMITED, "Limited 16:235" }, -}; - -void -intel_attach_broadcast_rgb_property(struct drm_connector *connector) -{ - struct drm_device *dev = connector->dev; - struct drm_i915_private *dev_priv = to_i915(dev); - struct drm_property *prop; - - prop = dev_priv->broadcast_rgb_property; - if (prop == NULL) { - prop = drm_property_create_enum(dev, DRM_MODE_PROP_ENUM, - "Broadcast RGB", - broadcast_rgb_names, - ARRAY_SIZE(broadcast_rgb_names)); - if (prop == NULL) - return; - - dev_priv->broadcast_rgb_property = prop; - } - - drm_object_attach_property(&connector->base, prop, 0); -} - void intel_attach_aspect_ratio_property(struct drm_connector *connector) { diff --git a/drivers/gpu/drm/i915/display/intel_connector.h b/drivers/gpu/drm/i915/display/intel_connector.h index 661a37a3c6d8..f3058a035476 100644 --- a/drivers/gpu/drm/i915/display/intel_connector.h +++ b/drivers/gpu/drm/i915/display/intel_connector.h @@ -28,7 +28,6 @@ int intel_connector_update_modes(struct drm_connector *connector, struct edid *edid); int intel_ddc_get_modes(struct drm_connector *c, struct i2c_adapter *adapter); void intel_attach_force_audio_property(struct drm_connector *connector); -void intel_attach_broadcast_rgb_property(struct drm_connector *connector); void intel_attach_aspect_ratio_property(struct drm_connector *connector); void intel_attach_hdmi_colorspace_property(struct drm_connector *connector); void intel_attach_dp_colorspace_property(struct drm_connector *connector); diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h index 15e91a99c8b9..fb091216df78 100644 --- a/drivers/gpu/drm/i915/display/intel_display_types.h +++ b/drivers/gpu/drm/i915/display/intel_display_types.h @@ -77,13 +77,6 @@ enum hdmi_force_audio { HDMI_AUDIO_ON, /* force turn on HDMI audio */ }; -/* "Broadcast RGB" property */ -enum intel_broadcast_rgb { - INTEL_BROADCAST_RGB_AUTO, - INTEL_BROADCAST_RGB_FULL, - INTEL_BROADCAST_RGB_LIMITED, -}; - struct intel_fb_view { /* * The remap information used in the remapped and rotated views to @@ -552,7 +545,6 @@ struct intel_digital_connector_state { struct drm_connector_state base; enum hdmi_force_audio force_audio; - int broadcast_rgb; }; #define to_intel_digital_connector_state(x) container_of(x, struct intel_digital_connector_state, base) diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c index 4c01ab887904..d20da3b8f56a 100644 --- a/drivers/gpu/drm/i915/display/intel_dp.c +++ b/drivers/gpu/drm/i915/display/intel_dp.c @@ -1417,8 +1417,6 @@ intel_dp_compute_link_config(struct intel_encoder *encoder, bool intel_dp_limited_color_range(const struct intel_crtc_state *crtc_state, const struct drm_connector_state *conn_state) { - const struct intel_digital_connector_state *intel_conn_state = - to_intel_digital_connector_state(conn_state); const struct drm_display_mode *adjusted_mode = &crtc_state->hw.adjusted_mode; @@ -1432,7 +1430,7 @@ bool intel_dp_limited_color_range(const struct intel_crtc_state *crtc_state, if (crtc_state->output_format != INTEL_OUTPUT_FORMAT_RGB) return false; - if (intel_conn_state->broadcast_rgb == INTEL_BROADCAST_RGB_AUTO) { + if (conn_state->preferred_color_range == DRM_MODE_COLOR_RANGE_UNSET) { /* * See: * CEA-861-E - 5.1 Default Encoding Parameters @@ -1442,8 +1440,7 @@ bool intel_dp_limited_color_range(const struct intel_crtc_state *crtc_state, drm_default_rgb_quant_range(adjusted_mode) == HDMI_QUANTIZATION_RANGE_LIMITED; } else { - return intel_conn_state->broadcast_rgb == - INTEL_BROADCAST_RGB_LIMITED; + return conn_state->preferred_color_range == DRM_MODE_COLOR_RANGE_LIMITED_16_235; } } @@ -4690,7 +4687,7 @@ intel_dp_add_properties(struct intel_dp *intel_dp, struct drm_connector *connect if (!IS_G4X(dev_priv) && port != PORT_A) intel_attach_force_audio_property(connector); - intel_attach_broadcast_rgb_property(connector); + drm_connector_attach_preferred_color_range_property(connector); if (HAS_GMCH(dev_priv)) { drm_connector_attach_max_bpc_property(connector, 6, 10); drm_connector_attach_active_bpc_property(connector, 6, 10); diff --git a/drivers/gpu/drm/i915/display/intel_dp_mst.c b/drivers/gpu/drm/i915/display/intel_dp_mst.c index 67f0fb649876..1a0684c0cb5d 100644 --- a/drivers/gpu/drm/i915/display/intel_dp_mst.c +++ b/drivers/gpu/drm/i915/display/intel_dp_mst.c @@ -833,7 +833,6 @@ static struct drm_connector *intel_dp_add_mst_connector(struct drm_dp_mst_topolo goto err; intel_attach_force_audio_property(connector); - intel_attach_broadcast_rgb_property(connector); if (DISPLAY_VER(dev_priv) <= 12) { ret = intel_dp_hdcp_init(dig_port, intel_connector); @@ -866,6 +865,11 @@ static struct drm_connector *intel_dp_add_mst_connector(struct drm_dp_mst_topolo if (connector->active_color_format_property) drm_connector_attach_active_color_format_property(connector); + connector->preferred_color_range_property = + intel_dp->attached_connector->base.preferred_color_range_property; + if (connector->preferred_color_range_property) + drm_connector_attach_preferred_color_range_property(connector); + connector->active_color_range_property = intel_dp->attached_connector->base.active_color_range_property; if (connector->active_color_range_property) diff --git a/drivers/gpu/drm/i915/display/intel_hdmi.c b/drivers/gpu/drm/i915/display/intel_hdmi.c index bce253bc5b16..4faed5572160 100644 --- a/drivers/gpu/drm/i915/display/intel_hdmi.c +++ b/drivers/gpu/drm/i915/display/intel_hdmi.c @@ -2091,8 +2091,6 @@ static int intel_hdmi_compute_clock(struct intel_encoder *encoder, bool intel_hdmi_limited_color_range(const struct intel_crtc_state *crtc_state, const struct drm_connector_state *conn_state) { - const struct intel_digital_connector_state *intel_conn_state = - to_intel_digital_connector_state(conn_state); const struct drm_display_mode *adjusted_mode = &crtc_state->hw.adjusted_mode; @@ -2106,13 +2104,13 @@ bool intel_hdmi_limited_color_range(const struct intel_crtc_state *crtc_state, if (crtc_state->output_format != INTEL_OUTPUT_FORMAT_RGB) return false; - if (intel_conn_state->broadcast_rgb == INTEL_BROADCAST_RGB_AUTO) { + if (conn_state->preferred_color_range == DRM_MODE_COLOR_RANGE_UNSET) { /* See CEA-861-E - 5.1 Default Encoding Parameters */ return crtc_state->has_hdmi_sink && drm_default_rgb_quant_range(adjusted_mode) == HDMI_QUANTIZATION_RANGE_LIMITED; } else { - return intel_conn_state->broadcast_rgb == INTEL_BROADCAST_RGB_LIMITED; + return conn_state->preferred_color_range == DRM_MODE_COLOR_RANGE_LIMITED_16_235; } } @@ -2509,7 +2507,7 @@ intel_hdmi_add_properties(struct intel_hdmi *intel_hdmi, struct drm_connector *c struct drm_i915_private *dev_priv = to_i915(connector->dev); intel_attach_force_audio_property(connector); - intel_attach_broadcast_rgb_property(connector); + drm_connector_attach_preferred_color_range_property(connector); intel_attach_aspect_ratio_property(connector); intel_attach_hdmi_colorspace_property(connector); diff --git a/drivers/gpu/drm/i915/display/intel_sdvo.c b/drivers/gpu/drm/i915/display/intel_sdvo.c index e4f91d7a5c60..bf4ecd029533 100644 --- a/drivers/gpu/drm/i915/display/intel_sdvo.c +++ b/drivers/gpu/drm/i915/display/intel_sdvo.c @@ -2722,7 +2722,7 @@ intel_sdvo_add_hdmi_properties(struct intel_sdvo *intel_sdvo, { intel_attach_force_audio_property(&connector->base.base); if (intel_sdvo->colorimetry_cap & SDVO_COLORIMETRY_RGB220) - intel_attach_broadcast_rgb_property(&connector->base.base); + drm_connector_attach_preferred_color_range_property(&connector->base.base); intel_attach_aspect_ratio_property(&connector->base.base); } diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 01e11fe38642..f5987e809b78 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -999,7 +999,6 @@ struct drm_i915_private { struct intel_fbdev *fbdev; struct work_struct fbdev_suspend_work; - struct drm_property *broadcast_rgb_property; struct drm_property *force_audio_property; /* hda/i915 audio component */ -- 2.25.1