Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp1710206pxt; Sat, 7 Aug 2021 22:12:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwc8UCwmwArsmsGYeQdUG97BnY7rB8h2NgDpNAjnxu+BDRvMQmlv/nkoU74Hqe+FixM1tGA X-Received: by 2002:a92:7d07:: with SMTP id y7mr120252ilc.68.1628399534159; Sat, 07 Aug 2021 22:12:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628399534; cv=none; d=google.com; s=arc-20160816; b=gVIR93f4tQtBY3cxfMChMnCAu0lfyZC26p/j5RDH24EGrbqq1W29JY8w4rAhirBNbM CHiYX5VdX7w98mu5Rw3E3xL737cpz3TZwqznLeMzrgl3UR9ggGotQbAHuPHEwiShN8mK 2EPO0Tyf15UjdVs+aNeFkmiQeZHaSFi3oqhloW32KhREPeFPKV7yMiSuyCC5vaNneer5 a9VjV5ErO/j2IIsDQPo4DniN6prJjxxoIt1sx5JMGiZIhYWaQQV4UhdGoWfqcCyXFGZF bbZHhezmao8oCviRwmsTxh3fQF2Sz2qjnvW0/XUV2g1KxShtHuUr8cf4HTl8M2amPKDh 2fJw== 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 :dkim-signature; bh=r8uH9OfkPi18OfoBjC7SXOXfarBdmqieXQKH3Ejk3CE=; b=qsslIGB4fXPbSQROm+hs1HBOaNa8lyrcth8qnprYvN8w/YnVQIOJE8DK4RFar5+O3D fIan+jEwFwGivgYPoMyF8YGWHrM9B20Rvps9o4imnh7wUIv590ru6gQQjxLGUC0X7DBT 95ccZdjHUPSSUJ1gdKs3bId3zNC40YIrOcP54qlddUruagNxyzT004Ne0GRMxC2FIeMs 622GfEv+sLtdyCDsn7TiB7x+ACxzkCzcehLYD5sE7i2z5TFZokJlG4zLRIxNIre2Jdwo tNNKw+I1pTMKip9pJotlmZfucqPuBePk9OPX3IAPQJfzvlPmHjqr3hmm7B19mPuX52CT 67Tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@goldelico.com header.s=strato-dkim-0002 header.b=ZuXHOkaJ; 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 s12si14464596iog.99.2021.08.07.22.12.03; Sat, 07 Aug 2021 22:12:14 -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; dkim=pass header.i=@goldelico.com header.s=strato-dkim-0002 header.b=ZuXHOkaJ; 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 S230197AbhHHFL0 (ORCPT + 99 others); Sun, 8 Aug 2021 01:11:26 -0400 Received: from mo4-p03-ob.smtp.rzone.de ([81.169.146.175]:8775 "EHLO mo4-p03-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229572AbhHHFLY (ORCPT ); Sun, 8 Aug 2021 01:11:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1628399445; s=strato-dkim-0002; d=goldelico.com; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=r8uH9OfkPi18OfoBjC7SXOXfarBdmqieXQKH3Ejk3CE=; b=ZuXHOkaJZ3srsEw4SLnt85cr5eV9kcO38u7UnSDj6Ijq82GflOAJ25Mv06ZYtuugO9 Wkp0UkScAo5DXFB7a8TLoKBdVDE3fGccVRaSHPmW0BxD16VIq+W9mwvaUo6mKNjHmQr3 bTfjLxvqt+Y+JHlwZG8HKlobFkfiDY8uqQpPZVphjzIXsPieYYdOpLfj0V/PB26pPk14 d7bV1GmlLAEQUoOj3ywVF3x/SaPtcTLP0qzyofzhmx6r9dDdbyRH7OLe+r4VfpCD3Iai kNkH8H2xIF33ZK7wfKk6m44ePcpeBDGiEWTNIDwEeaxSPBRlcAJGJ1d4XBaCKtLiud5W PtGA== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":JGIXVUS7cutRB/49FwqZ7WcJeFKiMhflhwDubTJ9o12DNOsPj0lByOdcKVX0" X-RZG-CLASS-ID: mo00 Received: from iMac.fritz.box by smtp.strato.de (RZmta 47.31.0 DYNA|AUTH) with ESMTPSA id Q02727x785AjEyd (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Sun, 8 Aug 2021 07:10:45 +0200 (CEST) From: "H. Nikolaus Schaller" To: Paul Cercueil , Rob Herring , Mark Rutland , Thomas Bogendoerfer , "H. Nikolaus Schaller" , Geert Uytterhoeven , Kees Cook , "Eric W. Biederman" , Miquel Raynal , David Airlie , Daniel Vetter , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jernej Skrabec , Ezequiel Garcia , Harry Wentland , Sam Ravnborg , Maxime Ripard , Hans Verkuil Cc: devicetree@vger.kernel.org, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, letux-kernel@openphoenux.org, Paul Boddie , Jonas Karlman , dri-devel@lists.freedesktop.org Subject: [PATCH v3 2/9] drm/bridge: synopsis: Add mode_fixup and bridge timings support Date: Sun, 8 Aug 2021 07:10:36 +0200 Message-Id: X-Mailer: git-send-email 2.31.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Paul Boddie The platform-specific configuration structure is augmented with mode_fixup and timings members so that specialisations of the Synopsys driver can introduce mode flags and bus flags. Signed-off-by: Paul Boddie Signed-off-by: Ezequiel Garcia Signed-off-by: H. Nikolaus Schaller --- drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 7 +++++++ include/drm/bridge/dw_hdmi.h | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c index e7c7c9b9c646f..d53bc557ef4ce 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c @@ -2766,6 +2766,11 @@ static int dw_hdmi_bridge_atomic_check(struct drm_bridge *bridge, bridge_state->input_bus_cfg.format, bridge_state->output_bus_cfg.format); + if (hdmi->plat_data->mode_fixup) + if (!hdmi->plat_data->mode_fixup(bridge, &crtc_state->mode, + &crtc_state->adjusted_mode)) + return -EINVAL; + return 0; } @@ -3364,6 +3369,8 @@ struct dw_hdmi *dw_hdmi_probe(struct platform_device *pdev, #ifdef CONFIG_OF hdmi->bridge.of_node = pdev->dev.of_node; #endif + if (plat_data->timings) + hdmi->bridge.timings = plat_data->timings; memset(&pdevinfo, 0, sizeof(pdevinfo)); pdevinfo.parent = dev; diff --git a/include/drm/bridge/dw_hdmi.h b/include/drm/bridge/dw_hdmi.h index 6a5716655619b..677137445d534 100644 --- a/include/drm/bridge/dw_hdmi.h +++ b/include/drm/bridge/dw_hdmi.h @@ -8,6 +8,7 @@ #include +struct drm_bridge; struct drm_display_info; struct drm_display_mode; struct drm_encoder; @@ -140,6 +141,10 @@ struct dw_hdmi_plat_data { enum drm_mode_status (*mode_valid)(struct dw_hdmi *hdmi, void *data, const struct drm_display_info *info, const struct drm_display_mode *mode); + bool (*mode_fixup)(struct drm_bridge *bridge, + const struct drm_display_mode *mode, + struct drm_display_mode *adjusted_mode); + const struct drm_bridge_timings *timings; /* Vendor PHY support */ const struct dw_hdmi_phy_ops *phy_ops; -- 2.31.1