From patchwork Tue Apr 13 12:11:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 12200329 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 889E0C43461 for ; Tue, 13 Apr 2021 12:11:31 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 580B86100B for ; Tue, 13 Apr 2021 12:11:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 580B86100B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=cerno.tech Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 92DD26E28B; Tue, 13 Apr 2021 12:11:18 +0000 (UTC) Received: from new2-smtp.messagingengine.com (new2-smtp.messagingengine.com [66.111.4.224]) by gabe.freedesktop.org (Postfix) with ESMTPS id 519F589ECB; Tue, 13 Apr 2021 12:11:14 +0000 (UTC) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailnew.nyi.internal (Postfix) with ESMTP id B3D77580446; Tue, 13 Apr 2021 08:11:13 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Tue, 13 Apr 2021 08:11:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm2; bh=F1eyLPQMrVY+E Res3vt9RF9miK1ff4SmcdhrwV4b2bQ=; b=XAcdTMXblEePAHsVGvnHnsoHaEney eB10z6QapGxQ1hBmLnVOnPsrwy1J9GFcFzSr+5vsNBXmjD8lhnxQhfQZkgRou+9V BxeGNNamkZTo0M4nwN+ktyd/sBbc2wvZJbBynC464x4h0X04Ks0FPr2DEtwbOiK/ hMnGCxTRQNXnAPhq1Gapgl751J7tAoFz1M1yum7m52bTHYBKDITzuWKCWBvgdN0r bTL6OdnrBLyJZeJv3U+Fk24KCNUIlTiu4vlKt2pJFQjEX+WENJtW5eP6Nlh6X43c irpUa03pTBEzU9he+fpGKip2xlhjLCHZBq/thqZHS1RSmzmP5veI9H+/w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=F1eyLPQMrVY+ERes3vt9RF9miK1ff4SmcdhrwV4b2bQ=; b=fIf4mWTY /IvAEuCbl3DwoVtyi7U9tff1Efp7FSaE7BgOXWdjVjhTduhIyRZLCwoIsxJ5x2Nx Ok08Tc5JULhQyjnMTeid55CMBiwSyCjV5SSjDAZ9iJmjAKU7s4XAd9jRRK1KGr1G aMoeoHiFPABNLyOE84U/o4aQJjld9uN9LkHA+/CiLGeczwHosDHslVWm/ZcAIIjc a14L/kiLxwQR2eoNU++kspWLwJrLcwf9kEk7uy2S1G2kaptZ1+c9ZXEW1ZjhHW0+ gy15Jc+zJHSy0XZB7keMvcp3tz4LYHT2SWTwAnfFOVDS/EaJ7bhbkDDyu3o1BeqF K7ihVCk3KytEfQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudekledggeelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeforgigihhm vgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrfgrth htvghrnhepvdekleevfeffkeejhfffueelteelfeduieefheduudfggffhhfffheevveeh hedvnecukfhppeeltddrkeelrdeikedrjeeinecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepmhgrgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Received: from localhost (lfbn-tou-1-1502-76.w90-89.abo.wanadoo.fr [90.89.68.76]) by mail.messagingengine.com (Postfix) with ESMTPA id 4A7761080064; Tue, 13 Apr 2021 08:11:13 -0400 (EDT) From: Maxime Ripard To: dri-devel@lists.freedesktop.org, Daniel Vetter , David Airlie , Maarten Lankhorst , Thomas Zimmermann , Maxime Ripard Date: Tue, 13 Apr 2021 14:11:04 +0200 Message-Id: <20210413121104.375789-5-maxime@cerno.tech> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210413121104.375789-1-maxime@cerno.tech> References: <20210413121104.375789-1-maxime@cerno.tech> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH v2 5/5] drm/vc4: hdmi: Signal the proper colorimetry info in the infoframe X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tim Gover , Neil Armstrong , Eric Anholt , Laurent Pinchart , Phil Elwell , Dave Stevenson , amd-gfx@lists.freedesktop.org, Harry Wentland , Jonas Karlman , Leo Li , intel-gfx@lists.freedesktop.org, Maxime Ripard , Jernej Skrabec , Dom Cobley , Andrzej Hajda , linux-kernel@vger.kernel.org, Robert Foss , Alex Deucher , =?utf-8?q?Christian_K=C3=B6nig?= Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Our driver while supporting HDR didn't send the proper colorimetry info in the AVI infoframe. Let's add the property needed so that the userspace can let us know what the colorspace is supposed to be. Signed-off-by: Maxime Ripard --- Changes from v1: - New patch --- drivers/gpu/drm/vc4/vc4_hdmi.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index a33fa1662588..a22e17788074 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -226,7 +226,8 @@ static int vc4_hdmi_connector_atomic_check(struct drm_connector *connector, if (!crtc) return 0; - if (!drm_connector_atomic_hdr_metadata_equal(old_state, new_state)) { + if (old_state->colorspace != new_state->colorspace || + !drm_connector_atomic_hdr_metadata_equal(old_state, new_state)) { struct drm_crtc_state *crtc_state; crtc_state = drm_atomic_get_crtc_state(state, crtc); @@ -316,6 +317,11 @@ static int vc4_hdmi_connector_init(struct drm_device *dev, if (ret) return ret; + ret = drm_mode_create_hdmi_colorspace_property(connector); + if (ret) + return ret; + + drm_connector_attach_colorspace_property(connector); drm_connector_attach_tv_margin_properties(connector); drm_connector_attach_max_bpc_property(connector, 8, 12); @@ -424,7 +430,7 @@ static void vc4_hdmi_set_avi_infoframe(struct drm_encoder *encoder) vc4_encoder->limited_rgb_range ? HDMI_QUANTIZATION_RANGE_LIMITED : HDMI_QUANTIZATION_RANGE_FULL); - + drm_hdmi_avi_infoframe_colorspace(&frame.avi, cstate); drm_hdmi_avi_infoframe_bars(&frame.avi, cstate); vc4_hdmi_write_infoframe(encoder, &frame);