From patchwork Tue May 9 09:30:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aradhya Bhatia X-Patchwork-Id: 91476 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2744785vqo; Tue, 9 May 2023 02:40:01 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5tOLgRVdm2IC7BsV4xxHafC23LQvKVl/eZR2U1VNf3B5iCQvZYdsFt3MwG4C5fsxz9qRG+ X-Received: by 2002:a05:6a20:9144:b0:f5:b7c9:57b5 with SMTP id x4-20020a056a20914400b000f5b7c957b5mr18090605pzc.24.1683625201288; Tue, 09 May 2023 02:40:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683625201; cv=none; d=google.com; s=arc-20160816; b=OK3GzcMx09jHcOkp09zdLML6+PMrdG6eResj9nnqbskCznFlYkhhrABf+cBpVXSC/R 846Zz2/GqbvfL7YzWv1iwiO3rfbKjKMN23xxvldYLPw8b7G1tO32XByLxV9W67Quuw5M oyBxj7bJ+huG1Ye04Widp2lFiljbq4G6lTA5xh1heeF6pfeZyM46Pdf48ULTRaQPI6P3 6uvYirwaQFMPK56RoHcG+xrGMC00Z0FiX0ujaINJOgKF2ENXgS2SCJxVdyxarNqBuOrw HNns7uGdG/n4aKt4bb+J0EuFOGlde24JM2rDH3hI5qRUBg8NLnrQxSGstXQBQLriwYzf 6rpw== 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=QxtvhK8W40hctV3hPFsZ3fKHSmpeqUJ/FdzCKSSQfhY=; b=YMuP/AnHBiSGlL3J8kx/ZtylJuqF8nXeE85zVgNiXkH9CD8TOA0r/cIKRhK1K5BVuT AA9q231DzD5O+PZImiRE07ezRnUC5NbibdtMLks1vOMYQzOApaLRlTkhUf/oOEvXOLZK +aROMa1of9hR+YeD1E5LcL6nFCuSXkaQw/Y2pnEVLr32GxIRrnGfbN1OWHeQG3KLLAbB mihXW0fThtlmew9e0OSrOSDLuHTBJ20gffwmcr+IyZJqYxUrrT9Cn+GBnnk+IS7Cn9IZ 7T0++Y2idfxYCl0/+1dE+Le8x5CHVx3pi5pHnTNnszE51H4oOyMxWKjCfHbSmEr8G854 biwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=L2+LejUX; 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 p19-20020a637f53000000b0051a8a22a42dsi1141262pgn.268.2023.05.09.02.39.49; Tue, 09 May 2023 02:40:01 -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=L2+LejUX; 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 S235178AbjEIJbx (ORCPT + 99 others); Tue, 9 May 2023 05:31:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235106AbjEIJbr (ORCPT ); Tue, 9 May 2023 05:31:47 -0400 Received: from fllv0016.ext.ti.com (fllv0016.ext.ti.com [198.47.19.142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02C99E72B for ; Tue, 9 May 2023 02:31:22 -0700 (PDT) Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 3499UkDp030787; Tue, 9 May 2023 04:30:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1683624646; bh=QxtvhK8W40hctV3hPFsZ3fKHSmpeqUJ/FdzCKSSQfhY=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=L2+LejUXXrh49fmEqLxmNz1nQDCXu36jSxGjroeTUEpS/lFn2vHCfYSWecKya9f15 WQEESh/hyY8eed5X17zDXwY7SGK4tLdC3YRU3KuhDPdQDUr6ieooFU/Q8+BrmN8ijz yS0uyweWUu4RSN1+SK9H1aEupTWmbbFJzp9xf+yI= Received: from DFLE114.ent.ti.com (dfle114.ent.ti.com [10.64.6.35]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 3499UkII111946 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 9 May 2023 04:30:46 -0500 Received: from DFLE113.ent.ti.com (10.64.6.34) by DFLE114.ent.ti.com (10.64.6.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Tue, 9 May 2023 04:30:46 -0500 Received: from fllv0040.itg.ti.com (10.64.41.20) by DFLE113.ent.ti.com (10.64.6.34) 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, 9 May 2023 04:30:46 -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 3499UjhW100387; Tue, 9 May 2023 04:30:45 -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 , Rahul T R , Swapnil Jakhade , Boris Brezillon , Francesco Dolcini CC: DRI Development List , Linux Kernel List , Nishanth Menon , Vignesh Raghavendra , Devarsh Thakkar , Jayesh Choudhary , Aradhya Bhatia Subject: [PATCH v6 6/8] drm/bridge: sii902x: Set input_bus_flags in atomic_check Date: Tue, 9 May 2023 15:00:34 +0530 Message-ID: <20230509093036.3303-7-a-bhatia1@ti.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230509093036.3303-1-a-bhatia1@ti.com> References: <20230509093036.3303-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?1765408979443913658?= X-GMAIL-MSGID: =?utf-8?q?1765408979443913658?= 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 --- 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 662b6cb4aa62..4d1f10532fa6 100644 --- a/drivers/gpu/drm/bridge/sii902x.c +++ b/drivers/gpu/drm/bridge/sii902x.c @@ -495,6 +495,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, @@ -506,6 +520,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)