From patchwork Tue Jun 6 08:21:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aradhya Bhatia X-Patchwork-Id: 103632 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp3237305vqr; Tue, 6 Jun 2023 01:34:04 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6fEcn8XYAPNmD8ndgRczOvX14jMpvAXyl0U1ABwPYH9rFoMatN1478ShU5dPa26DduGP5u X-Received: by 2002:a05:622a:116:b0:3f5:c9f:1b27 with SMTP id u22-20020a05622a011600b003f50c9f1b27mr1686302qtw.1.1686040444016; Tue, 06 Jun 2023 01:34:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686040444; cv=none; d=google.com; s=arc-20160816; b=02R+ywao0P2S0irPET9Zorpt6G9GSV/3Nu+mGwra2hujPY4mOy+o/HpHQisOpnkJww 2OO/qOhRHZPf7Ml36/XsYqUSxtzsqPDk5SCWvKKfh/E7glqYhGN0OcK6qJcQhZ+njPNj 2AfsgznIeJ4cVd6fqLMmy9lVUxSfybCWWDG/VEfd/iDuu3uRIOOz6wo4HK95tAXlFuvq cUUSHt7v5c2RgyzgoNbW/Bex3xd+4dUUTd9XvMgOT2HeAoHDdCHskwi8hFqtjyL9BY80 KIJxmFlP/UgGpGQ2GzW+voXaC5Mr2uh3skzl4nPZuTo6CTnZs1tGHBgmS6X4M50jhN8o ltjQ== 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=U9ozOmsuQQic6oaJc3ZfjadaTi3g2owitvvLoaNCHAI=; b=NiqhWKZkGJVhCrs+/psqD473Gb8br7SdMxrmH5sObPo0/BuPMjbS9/OBrL/CjXNuwK Gj4gGSpGYnowK3Y+UMjmEMmVLEri/oKlyVDZrrIhEBUnnerCUlpm7DzefA1LXN5aS+Kr /f11dHtBbFlUQOwY3yq4cZ62Jx0BgmXsdFooWfiVKAAU9iNx4/jFOqK1mlEB0qaeAelx 6t9Yg/rE9/d9zOn5uhignjYLnLNUeZbWElQL+L4L7GCB4VqyYPEd+KRdhArUuW1sG+zF 3ZlHbBfbykD05XQUZP7+L22PVuZ6Kn5sdllLAbK6O7FCREqXqICgKK8ZrOvw3hCmPAmC BifQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=gAoYblKj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p5-20020ad45f45000000b00625b9a391e8si6024285qvg.414.2023.06.06.01.33.50; Tue, 06 Jun 2023 01:34:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=gAoYblKj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236424AbjFFIWw (ORCPT + 99 others); Tue, 6 Jun 2023 04:22:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236374AbjFFIWW (ORCPT ); Tue, 6 Jun 2023 04:22:22 -0400 Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13C23E47 for ; Tue, 6 Jun 2023 01:22:19 -0700 (PDT) Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 3568Lq7A013077; Tue, 6 Jun 2023 03:21:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1686039712; bh=U9ozOmsuQQic6oaJc3ZfjadaTi3g2owitvvLoaNCHAI=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=gAoYblKjLuSvwiziQGi4ic7D6Lp/hXIwVzpbQ8F7bdElNuoKpESljRKCsDKjB0qPp 2rZtbp0lQizqofxFY5sMyazpVVtkQmPDX8gO6liOf3cKrRTUFB/kQJ3CKkufKJfAQL 8uZpIqspe0s+xjZLK92xb9X7uIRJxpdEL7Q1mrrY= Received: from DLEE108.ent.ti.com (dlee108.ent.ti.com [157.170.170.38]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 3568Lq0R012376 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 6 Jun 2023 03:21:52 -0500 Received: from DLEE112.ent.ti.com (157.170.170.23) by DLEE108.ent.ti.com (157.170.170.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Tue, 6 Jun 2023 03:21:52 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DLEE112.ent.ti.com (157.170.170.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Tue, 6 Jun 2023 03:21:52 -0500 Received: from localhost (ileaxei01-snat2.itg.ti.com [10.180.69.6]) by fllv0040.itg.ti.com (8.15.2/8.15.2) with ESMTP id 3568Lp6w019614; Tue, 6 Jun 2023 03:21:52 -0500 From: Aradhya Bhatia To: Tomi Valkeinen , Jyri Sarha , David Airlie , Daniel Vetter , Laurent Pinchart , Andrzej Hajda , Neil Armstrong , Robert Foss , Jonas Karlman , Jernej Skrabec , Swapnil Jakhade , Boris Brezillon , Francesco Dolcini CC: DRI Development List , Linux Kernel List , Nishanth Menon , Vignesh Raghavendra , Rahul T R , Devarsh Thakkar , Jayesh Choudhary , Aradhya Bhatia Subject: [PATCH v7 6/8] drm/bridge: sii902x: Set input_bus_flags in atomic_check Date: Tue, 6 Jun 2023 13:51:40 +0530 Message-ID: <20230606082142.23760-7-a-bhatia1@ti.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230606082142.23760-1-a-bhatia1@ti.com> References: <20230606082142.23760-1-a-bhatia1@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767941544766519347?= X-GMAIL-MSGID: =?utf-8?q?1767941544766519347?= input_bus_flags are specified in drm_bridge_timings (legacy) as well as drm_bridge_state->input_bus_cfg.flags The flags from the timings will be deprecated. Bridges are supposed to validate and set the bridge state flags from atomic_check. Implement atomic_check hook for the same. Signed-off-by: Aradhya Bhatia Reviewed-by: Neil Armstrong --- Notes: changes from v6: * Add Neil Armstrong's R-b tag. drivers/gpu/drm/bridge/sii902x.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/gpu/drm/bridge/sii902x.c b/drivers/gpu/drm/bridge/sii902x.c index 70aeb04b7f77..8f1ec526863a 100644 --- a/drivers/gpu/drm/bridge/sii902x.c +++ b/drivers/gpu/drm/bridge/sii902x.c @@ -494,6 +494,20 @@ static u32 *sii902x_bridge_atomic_get_input_bus_fmts(struct drm_bridge *bridge, return input_fmts; } +static int sii902x_bridge_atomic_check(struct drm_bridge *bridge, + struct drm_bridge_state *bridge_state, + struct drm_crtc_state *crtc_state, + struct drm_connector_state *conn_state) +{ + /* + * There might be flags negotiation supported in future but + * set the bus flags in atomic_check statically for now. + */ + bridge_state->input_bus_cfg.flags = bridge->timings->input_bus_flags; + + return 0; +} + static const struct drm_bridge_funcs sii902x_bridge_funcs = { .attach = sii902x_bridge_attach, .mode_set = sii902x_bridge_mode_set, @@ -505,6 +519,7 @@ static const struct drm_bridge_funcs sii902x_bridge_funcs = { .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state, .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state, .atomic_get_input_bus_fmts = sii902x_bridge_atomic_get_input_bus_fmts, + .atomic_check = sii902x_bridge_atomic_check, }; static int sii902x_mute(struct sii902x *sii902x, bool mute)