From patchwork Tue Jun 6 08:21:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aradhya Bhatia X-Patchwork-Id: 103646 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp3242008vqr; Tue, 6 Jun 2023 01:46:05 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6JLwEJXG24zhe1TNBuxF8useklqOB1I0f4rTfpBo/FeFl/uikOT9ElMDlRVhM6xkMWlqJZ X-Received: by 2002:a9d:6649:0:b0:6b2:420:672e with SMTP id q9-20020a9d6649000000b006b20420672emr1467115otm.8.1686041165427; Tue, 06 Jun 2023 01:46:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686041165; cv=none; d=google.com; s=arc-20160816; b=cRLzlcJA1Ig64riVhrGZo9KejaMfUmU3ToXLOcN4+s/8V2rRGPvaMFo22Uz9m05Nvp /EStdAbo5r/j+x4Jr2n2EEUNgQxOJm0dL/eh+FUJJZfQZaqYGL5t5nabAoq7TQ/OBpQv UzC/49v0eEJAv4OCFhLVyFCRxglE9kL9eW/1+WYL+SNPPta5KUIClnMFSnFrM7arPwbd n3zUROqJLF0BWOEDQTYh2znzi7OIrSNQ11/hi4Ycu+72HwcRtD348mUrzpBRnCKdk953 kRuMt6JYxzbSJci4V+X7yeC5QVisXrwTyvKK+uLiX6nU2tLteKGIwnzaIPJOGkPmqCZn aLrw== 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=VS8pLGzavRPRDee8Dc/PrcNO4RR5LuY8WkKTJA8aedc=; b=Z0D7lWRDH7YWkFhXOAh401/u9kyf4gWomK5tC/5QToUDz4I0Fjum6VHVu/P6CMO1y8 0nUELDbaLYEnYVmqjxSmGpLa/UhPmPZ7ml+34klbtH+JeVpNO5QJAvXRGCZvzUuv1Ubd gv1ejDc5w68zDrS5bf5jzOr0GMf6TufYjPJ1XFUOKlqEm4i9rbuOl2bljAdV52SLJ/+F 4bjTi19bND7YdgxqSGuVHDRwBX7S35ML5hhcoLYwSqYUJ4pjsHaCq1W9huVzV2Pmryfn m0qSI9B51+LSfumRXWRgxwrVYfMK4JK6/3Sw2I05hffxBKgKVMBRNQxnZ7kYiySi0gDq Y2hA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=XeTz71y5; 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 l198-20020a633ecf000000b0054294720d55si7138923pga.262.2023.06.06.01.45.52; Tue, 06 Jun 2023 01:46:05 -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=XeTz71y5; 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 S236327AbjFFIWY (ORCPT + 99 others); Tue, 6 Jun 2023 04:22:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236405AbjFFIWS (ORCPT ); Tue, 6 Jun 2023 04:22:18 -0400 Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7FB4CE53 for ; Tue, 6 Jun 2023 01:22:13 -0700 (PDT) Received: from fllv0035.itg.ti.com ([10.64.41.0]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 3568Lkvb038628; Tue, 6 Jun 2023 03:21:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1686039706; bh=VS8pLGzavRPRDee8Dc/PrcNO4RR5LuY8WkKTJA8aedc=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=XeTz71y5kP0VQhFCE1iLlXoiAy5vHj9j3ttBTiMzN8IWqOLl+OWKPpqAvFsVPrXKY /IDtDHTdlCJ5Xp3uTMirgEjOjMSEBhbdONH9/t+2trOZlrO9L41Z8zbLZg+moZrRXD 6Hb+qqzyLJQEJkf/y8uPHVtPjWS28fpd//HWGtIw= Received: from DFLE104.ent.ti.com (dfle104.ent.ti.com [10.64.6.25]) by fllv0035.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 3568LkLq012391 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 6 Jun 2023 03:21:46 -0500 Received: from DFLE109.ent.ti.com (10.64.6.30) by DFLE104.ent.ti.com (10.64.6.25) 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:46 -0500 Received: from fllv0039.itg.ti.com (10.64.41.19) by DFLE109.ent.ti.com (10.64.6.30) 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:46 -0500 Received: from localhost (ileaxei01-snat2.itg.ti.com [10.180.69.6]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 3568LjUa090167; Tue, 6 Jun 2023 03:21: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 , 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 2/8] drm/bridge: tfp410: Set input_bus_flags in atomic_check Date: Tue, 6 Jun 2023 13:51:36 +0530 Message-ID: <20230606082142.23760-3-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?1767942301386750330?= X-GMAIL-MSGID: =?utf-8?q?1767942301386750330?= From: Nikhil Devshatwar 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: Nikhil Devshatwar Signed-off-by: Aradhya Bhatia Reviewed-by: Neil Armstrong --- Notes: changes from v4: * fix a warning Reported-by: kernel test robot changes from v5: * Move the return statement here from patch 4 (where it was added by mistake). changes from v6: * Add new line before return statement. * Add Neil Armstrong's R-b tag. drivers/gpu/drm/bridge/ti-tfp410.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/drivers/gpu/drm/bridge/ti-tfp410.c b/drivers/gpu/drm/bridge/ti-tfp410.c index 7dacc7e03eee..edf4d30f4f2a 100644 --- a/drivers/gpu/drm/bridge/ti-tfp410.c +++ b/drivers/gpu/drm/bridge/ti-tfp410.c @@ -228,6 +228,22 @@ static u32 *tfp410_get_input_bus_fmts(struct drm_bridge *bridge, return input_fmts; } +static int tfp410_atomic_check(struct drm_bridge *bridge, + struct drm_bridge_state *bridge_state, + struct drm_crtc_state *crtc_state, + struct drm_connector_state *conn_state) +{ + struct tfp410 *dvi = drm_bridge_to_tfp410(bridge); + + /* + * There might be flags negotiation supported in future. + * Set the bus flags in atomic_check statically for now. + */ + bridge_state->input_bus_cfg.flags = dvi->timings.input_bus_flags; + + return 0; +} + static const struct drm_bridge_funcs tfp410_bridge_funcs = { .attach = tfp410_attach, .detach = tfp410_detach, @@ -238,6 +254,7 @@ static const struct drm_bridge_funcs tfp410_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 = tfp410_get_input_bus_fmts, + .atomic_check = tfp410_atomic_check, }; static const struct drm_bridge_timings tfp410_default_timings = {