From patchwork Wed Jan 24 02:53:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Klymenko, Anatoliy" X-Patchwork-Id: 13528458 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 92179C47258 for ; Wed, 24 Jan 2024 02:54:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=IEZkrXbvmmx4WlBHwDs9fPXlBoeRBl+iXT1Kzgwb22c=; b=IT9udDiyrl8eeN v2DjXeihRs2F3VYOLf+4uJLbKjjIllwUrmLw7uLZizZmV5ebg0ACn7IJi8uHZeqtj+nPFyy3/IEVu cs7Fw/U+bZP/9KOFrkVf1QB3seNJizWVYLDgvYQbKY0yeAyeWGNQe0qExtUgXUqfnvlQ7F1ZyXHIA g89esTniNEEtOsmGegvYWnbNzdczjOPtlABhL4MGKoxTfvvXJPpvnwLLMN8hXL4DpMrJisSdEEaVd l47BgpISHTkzpk1z/Bug8ctFkD4PxEa9i+MkHkyvP0vKqSwUD0UDWFy4MGkSx3WkbR4jWm0h+37hy uoXoJiXDLHnH/KM7lbiA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rSTPH-001D8X-0c; Wed, 24 Jan 2024 02:54:27 +0000 Received: from mail-dm6nam10on2062a.outbound.protection.outlook.com ([2a01:111:f400:7e88::62a] helo=NAM10-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rSTP7-001D3W-0m for linux-arm-kernel@lists.infradead.org; Wed, 24 Jan 2024 02:54:19 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hyz0iFS7y2JSRV3QTsSHYUjW5CZKXDyMB7bOOpPJT36Yq2kcqvSZTCf3HYgrtnWB+NZS0i2ytDiotiH7ZJMQUXgHlGTwVcGFkHp3ZmvCG4ho31/4TcDwt8b/edmBW7zb6mz0MVNECVLUTJtaXym46hweXEfUI6n2cdmJSxYPdtesDEyRLlt9DYEFqQaTqYn1n52o3czVPgl0oXETBuu87v6+ljlgOwRyYEA2Rnjhh9c5QPf9h998M6JuouEKggCAj6qk0QaRbqX8GvwQG6z0nIZMMXsNVtuaib0Tw8bqkFj/CaNSa6LJHd625xhHRO3Q2Eo3j0hL9QfSnWyangyWBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=A078BbaAGY/zU6JL5BJwe7eSaF1X+L8idnxCjUVxvc0=; b=boYcr/A5dH7+lSOnUrYs3xfTis10xyz/7l79V4wfq2RsJVBWbqkU8s2qoR+BoeqfR33/9Q98hJeOMN0OSGCBQYvs2UnR2jugmW0jbZQrryOy27ZPzEPKJ7CbPmymIvquCeRx3c96crg22Yj5UxVcvp1+Pt2rxsdk4jq0+rjn80yfy/KWqllQxaYn19O7UQLCJ06MM8pZd4xCG3xoj/ndwIbBU+15wycsOblMMWE2kajCzUfxMKTE98Z+5pc6P4hQeltrmDgHJp4jvp15XaPPO+SsUeFWSA5I4iE+96NblrSrMLuLN11AFGJr7WvJ/Ld6m5cCdfAhNCTASPRpC924Bw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=ideasonboard.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=A078BbaAGY/zU6JL5BJwe7eSaF1X+L8idnxCjUVxvc0=; b=kCgZ5qjjNuqma8svSnKn7rCMmU31W4k+4FkFovItRy7BltmQE2agAYg6XANeHdpCl06KuxxwL3lCXhQnRHDe+2EhCdAOJy06PZmmjmC9q9B8jK9B/zQtBJeQHmuji4oCUOaYiLyi5yoMxU1y1BXENkDwSA8jxBqUcACFENBuux0= Received: from SN7PR04CA0110.namprd04.prod.outlook.com (2603:10b6:806:122::25) by CH2PR12MB4938.namprd12.prod.outlook.com (2603:10b6:610:34::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7202.37; Wed, 24 Jan 2024 02:54:06 +0000 Received: from SN1PEPF0002636C.namprd02.prod.outlook.com (2603:10b6:806:122:cafe::98) by SN7PR04CA0110.outlook.office365.com (2603:10b6:806:122::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.22 via Frontend Transport; Wed, 24 Jan 2024 02:54:05 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by SN1PEPF0002636C.mail.protection.outlook.com (10.167.241.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7202.16 via Frontend Transport; Wed, 24 Jan 2024 02:54:05 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Tue, 23 Jan 2024 20:54:04 -0600 Received: from xsjanatoliy50.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.34 via Frontend Transport; Tue, 23 Jan 2024 20:54:04 -0600 From: Anatoliy Klymenko To: , , , , , , , , , Subject: [PATCH v3 1/5] drm: xlnx: zynqmp_dpsub: Make drm bridge discoverable Date: Tue, 23 Jan 2024 18:53:58 -0800 Message-ID: <20240124025402.373620-2-anatoliy.klymenko@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240124025402.373620-1-anatoliy.klymenko@amd.com> References: <20240124025402.373620-1-anatoliy.klymenko@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF0002636C:EE_|CH2PR12MB4938:EE_ X-MS-Office365-Filtering-Correlation-Id: 1e32c268-01e2-4c48-a3c6-08dc1c87bac1 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MSWJ4t/kOnLJPwzzEwsglrVEjJ/C7vV5PRKZviuj0eZrJArZf5k2nDipz8TTenkXoN8ddr3HqRkkJFSzJWfkh6tpcFxte3HlQ+/DWMGktRW4yWgg81lEAeID6C+3xN36Q7TYuC/ofKGNJFXUrC5HEpMsLEbJ8uv9taTFx73VCYHC4LXB2uCjfpmxzOP2IuqQDaW6gO9xyEDkHBmCYoo0hGG/vsyQAjYHcqRPZ8vwTtCCYb6mPhsGs25FE6XAIWD8LN/xposJ7lSdiA5AhGbrZYDOqzN0eWICd/7Ei/OJgWcDEAPoJoTc3/9209ApJdQTvkm0AnQnBxOHBMzis82HlhXZbiKdhx0hQtd+tg5GvSiSeXfa+PjwJNINC9vYkawf6gX+CvR00RBZ9HN/ZO2rlJIzbNwGUW+0ZQKPK9E7+we5azIW3Vdaf2rKrAq8N81wVW/cEE0o4x4cVkiuQwTRc4X5e5t5xpEURa26fVqJ9YuxcAfgMY3twOo5oNfn57cs0/jePuX+t2lfD4YMPk9Okd+nRGKPbhb5EQhcm7JQRoY8XLrlI8+8yFoOwKMYSo5gNL7i1jFW5pDALoQADT1/TJFcevk02hVuZ2b8MVE24uRkGxautbeWsKqHalasw1YIjg5eQiZBjEOKhjwBOCAfCo9Q6VlvWZNMfa6N8+SHYPxw13ty7/8S18EBQwmqj7ujWYlbIupRUOVo07hX4ZD+PmizAcndAGB0B9uYPJkaEAsaCeOwqpm4dR4UzwkYLA5/NNst1glp5wHX41UUCJQSwE33NBFgyDAXy2cbbPdB+VkArlzOXu9j+H8697Nftv6LEpqw6PIRmFQ27AYWUDXUjJGQ0yUCdWk+7zVJugUYGsbaxw7CXNTpWW3aCwwizeZ+ X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(4636009)(346002)(396003)(39860400002)(376002)(136003)(230173577357003)(230273577357003)(230922051799003)(82310400011)(186009)(64100799003)(451199024)(1800799012)(40470700004)(46966006)(36840700001)(70206006)(110136005)(41300700001)(316002)(70586007)(82740400003)(478600001)(6666004)(356005)(86362001)(40460700003)(81166007)(40480700001)(36756003)(2616005)(336012)(1076003)(26005)(426003)(44832011)(2906002)(36860700001)(5660300002)(921011)(47076005)(8676002)(8936002)(83380400001)(83996005)(36900700001)(2101003);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jan 2024 02:54:05.8558 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1e32c268-01e2-4c48-a3c6-08dc1c87bac1 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF0002636C.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB4938 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240123_185417_300468_F7A38770 X-CRM114-Status: GOOD ( 13.00 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org ZynqMP DPSUB supports 2 input modes: DMA based and live video. In the first mode, the driver implements CRTC and DP encoder DRM bridge to model the complete display pipeline. In this case, DRM bridge is being directly instantiated within the driver, not using any bridge discovery mechanisms. In the live video input mode video signal is generated by FPGA fabric and passed into DPSUB over the connected bus. In this mode driver exposes the DP encoder as a DRM bridge, expecting external CRTC to discover it via drm_of_find_panel_or_bridge() or a similar call. This discovery relies on drm_bridge.of_node being properly set. Assign device OF node to the bridge prior to registering it. This will make said bridge discoverable by an external CRTC driver. Reviewed-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart Signed-off-by: Anatoliy Klymenko --- drivers/gpu/drm/xlnx/zynqmp_dp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/xlnx/zynqmp_dp.c b/drivers/gpu/drm/xlnx/zynqmp_dp.c index a0606fab0e22..d60b7431603f 100644 --- a/drivers/gpu/drm/xlnx/zynqmp_dp.c +++ b/drivers/gpu/drm/xlnx/zynqmp_dp.c @@ -1721,6 +1721,7 @@ int zynqmp_dp_probe(struct zynqmp_dpsub *dpsub) bridge->ops = DRM_BRIDGE_OP_DETECT | DRM_BRIDGE_OP_EDID | DRM_BRIDGE_OP_HPD; bridge->type = DRM_MODE_CONNECTOR_DisplayPort; + bridge->of_node = dp->dev->of_node; dpsub->bridge = bridge; /* From patchwork Wed Jan 24 02:53:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Klymenko, Anatoliy" X-Patchwork-Id: 13528460 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E0454C47E49 for ; Wed, 24 Jan 2024 02:54:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=9xZcPfb3a23a35gqnLb9vvmRTEUzntND5YiJiXx325I=; b=N+x4WXQkMtHpjb TxR1kacukVHwISE6kEVRzNzxPTnyi5EBa6j+Ruc0GaNsE8LeHEauGFmMNzR5WYz1wYr81Wjhpl+4w sxE+vofhn1qCB+q7YeBXaZBzoEbqy3G7l8oW+FhGNZxRrSutElN1HCV7cewtXSqbv7VF7nY4tO31L 4Lx44S/AWoTfPbT7ySYlyEWSFpdWKbJ98xB7YORJ2OzQxXO4eIZ4EMiDBDAAhZGeOH/6VfmjtmZZn hi2hJG8TCci1HtMOaS4aFRZoU2uA9ZrqfOtgqNt47M2UbNT7Kl1VZVgb05iLM0yOq4bxn0vEz6M9k Zpx8dhjF1omGIBwDgRrA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rSTPI-001D9G-1P; Wed, 24 Jan 2024 02:54:28 +0000 Received: from mail-dm6nam10on20625.outbound.protection.outlook.com ([2a01:111:f400:7e88::625] helo=NAM10-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rSTP8-001D4r-2k for linux-arm-kernel@lists.infradead.org; Wed, 24 Jan 2024 02:54:20 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RJbUX/jKB3HPJtMw/zVk7mzJF7Yj+hGHbMXnawP02y5SuZ4pNyEf91avnGJB15aXxy9wxqq81W43UmYP3Zs6QgBZLx0Exal+yLhTT6/iVzjpe5gYDGS8JauG+1L5+R7lpNTDS7MP97IJvh7sWrO1xfgBBHyyELA9gB4WUxz60Cs0BS1tyuX9zjtEoDm8j1LdzTI0Ay++czZc1bpe2xLb4EokFCRuE4uX7wcMkGbVlW1Z5sQVphTsd5V9/IOZj4l38s7wSBreypxPnCerGuyzPBLZ+T8EMltloNjYpXLlBxgsQK7TfaGxaF9wtY7hFjuoXyQOMs5A0DpPcJV6VvL8ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=sbYhtGPpxSXx/5jQiSZ/ohKOZc6mALk5xxnOCV2OPeg=; b=AR0uVJCEAyvUUsMo0oUo17EIUoaI+WIy+yO8C4iDJ7cr38rLVjxSU5SsgUA/KV/rua1RDbwOlkqeIBYQ2nWLTzIapN/9Bjm//5DYnVdY31OtDkpKlIJ+GeGaBki9zg5UzOeU6WviSCuUwmSP5stPQoygqYCt84gQHoHswlOzARJeWt8RWYK9+1HiR5dZialqa+k/2dW7pvo0sk4i3++AQIiF38WMIlE6mnkFhrOielU5SPOZor4t8e12qG0ZmxjrXC2+fAxXDbtaNxHbrJTdlCK5K2gbmR6Ct0ngzp9C/uEhImFtpdbSB9cOfOmSy7g5b2c3n92XVprB7i1ow/wWNQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=ideasonboard.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sbYhtGPpxSXx/5jQiSZ/ohKOZc6mALk5xxnOCV2OPeg=; b=gG16RFnfzOGTfEGg37mlF6KvRzS1GEhvMBq/CoZWdG7QQpBeKmXiAjYQGvleF1xV0J3MU2aTSTG3OLpgR8l4aZIEIVekCCP3J0VUNAIlPYIWTJIptrbAmEMxjbuKQkymaVzRYV7BqiwCufhJv5Nd+pJfXijs2sSvv6tId5obVm8= Received: from SN7PR04CA0097.namprd04.prod.outlook.com (2603:10b6:806:122::12) by IA0PR12MB7723.namprd12.prod.outlook.com (2603:10b6:208:431::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.22; Wed, 24 Jan 2024 02:54:07 +0000 Received: from SN1PEPF0002636C.namprd02.prod.outlook.com (2603:10b6:806:122:cafe::47) by SN7PR04CA0097.outlook.office365.com (2603:10b6:806:122::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.22 via Frontend Transport; Wed, 24 Jan 2024 02:54:06 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by SN1PEPF0002636C.mail.protection.outlook.com (10.167.241.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7202.16 via Frontend Transport; Wed, 24 Jan 2024 02:54:06 +0000 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Tue, 23 Jan 2024 20:54:05 -0600 Received: from xsjanatoliy50.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.34 via Frontend Transport; Tue, 23 Jan 2024 20:54:05 -0600 From: Anatoliy Klymenko To: , , , , , , , , , Subject: [PATCH v3 2/5] drm: xlnx: zynqmp_dpsub: Fix timing for live mode Date: Tue, 23 Jan 2024 18:53:59 -0800 Message-ID: <20240124025402.373620-3-anatoliy.klymenko@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240124025402.373620-1-anatoliy.klymenko@amd.com> References: <20240124025402.373620-1-anatoliy.klymenko@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF0002636C:EE_|IA0PR12MB7723:EE_ X-MS-Office365-Filtering-Correlation-Id: 77602114-7b14-434c-618a-08dc1c87bb61 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WNFYDaIxSNik4kLjU/J0cxkF+LY9cpRtGOIpGkFKhFEK9XWVNBb2l+5A/gf4ANv7uJKOXQmoNiSFbOht0DEu5saw/Pi6jdfS6bmaX5ii4UNU3Za0FKPLo9WtvIGsLNdqsooZ79m5RrOdg+IDQzoj1kCOo2vVXkX8YoI6dWtG68sJHab333687dHV9oTml0eGMPPuUMOKC1NBW5e0wPpXTLjvp3cXUTTlkhU1l1LKELyGW12HgU/WuP1q7NYwf6xbIMnMFarPC3vIJsfmaCpqsSCqnmKmrp//h4zC8G77hZcUf86lR9u/X++HVKb70+RF7PhwoliFUWG2qHB2zVHA7tGrBvk3590jkbgCDhGpxd2jHEyBZhUJ7IbjX7+yg/eS+bvEMdTT2q43rxDXxg4WGXzMFNEE2G6PoP/nyM9EnOPkf0fK2fR4QRmi6mONAsIHqIBUx0In9MH4Tl6aKNUACmi+gCB1jfICIb31DtJje5kBCqbUONa5Tn0vP7A+duGQXxkfov9twL/2vyr6IOhRIwqC4L9bx2fV9zUSMAGv+RCRQvE1U/HqnZGVpRPkbVf4KxsfxqryDXfk3IUchEofHwqTqb2vRm+qfSiitR8OBYbv5aQB/MgwOfLlWg5TUjMl+uovDNlMcC4oVX70/ONOiVEqlwtBNnR7S4e1u+KbAgiWrMw2J7MH75Icmgpo929VRQNWLdHbHAO3wU3LE4zAulHltStzmbT4Ov0HTWHHidgP1QK18wDjhC+UjpKQc+/7dSa2bAF+yjYWmfahOUIlPXcdrs/6vhxHpFUBAFnkfLdas+nqyQXkINJ1eCmdWnrt7Q0uVM1JhnztjsWHzOPKhc+jqyM7Zt1lsH+SO6oeOyD5CRvfV8qMQ9gnMqtk0IED X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(4636009)(39860400002)(396003)(136003)(376002)(346002)(230922051799003)(230173577357003)(230273577357003)(1800799012)(64100799003)(451199024)(82310400011)(186009)(40470700004)(46966006)(36840700001)(41300700001)(336012)(426003)(1076003)(921011)(40460700003)(40480700001)(26005)(47076005)(36860700001)(36756003)(478600001)(6666004)(2616005)(83380400001)(81166007)(82740400003)(356005)(44832011)(5660300002)(2906002)(4744005)(110136005)(86362001)(70586007)(70206006)(316002)(8676002)(8936002)(2101003)(36900700001)(83996005);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jan 2024 02:54:06.9183 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 77602114-7b14-434c-618a-08dc1c87bb61 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF0002636C.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR12MB7723 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240123_185418_889060_072CA26F X-CRM114-Status: GOOD ( 12.41 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Expect external video timing in live video input mode, program DPSUB acordingly. Reviewed-by: Tomi Valkeinen Signed-off-by: Anatoliy Klymenko Reviewed-by: Laurent Pinchart --- drivers/gpu/drm/xlnx/zynqmp_disp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/xlnx/zynqmp_disp.c b/drivers/gpu/drm/xlnx/zynqmp_disp.c index 407bc07cec69..8a39b3accce5 100644 --- a/drivers/gpu/drm/xlnx/zynqmp_disp.c +++ b/drivers/gpu/drm/xlnx/zynqmp_disp.c @@ -1166,7 +1166,7 @@ void zynqmp_disp_enable(struct zynqmp_disp *disp) /* Choose clock source based on the DT clock handle. */ zynqmp_disp_avbuf_set_clocks_sources(disp, disp->dpsub->vid_clk_from_ps, disp->dpsub->aud_clk_from_ps, - true); + disp->dpsub->vid_clk_from_ps); zynqmp_disp_avbuf_enable_channels(disp); zynqmp_disp_avbuf_enable_audio(disp); From patchwork Wed Jan 24 02:54:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Klymenko, Anatoliy" X-Patchwork-Id: 13528461 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DB15DC47DDB for ; Wed, 24 Jan 2024 02:54:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=UBMp1D+p3VDS+zul2m8JGrT1V/CJeRhkrANmYUcAlvI=; b=rBAjNIPEsbfZtU NUSrjlZZyYt2Wj+iCOSsI+p6GwpUURh+ZGeoAc9Ss5OclEVeh2m5V4pAC0Od/lqUjZi5eFh1T0ucq RNjgkf5QlY1adADcuDRtqh5geMyKOFeicxiKKl7hdzkZh7KY962bg9YkIJHO2BX3KwVpN9BY81PwV 8+wDRYQUGEe4KG6HooEYpsZt2bvpEjCSY+i0c3Tfp7Vu/zEXgAuwB1s0I3fmM0qoZ9sAnh/P1wQ+m qwVzWr9VNGWjdAh8cQYu44JUJCu2SfE5Nj3UZ9pDowyJDQ5F7dJkxtpUIXqAVelj/K3wqNtFNgMzV fWR1YOjJZF5av1GraCaA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rSTPH-001D8s-2d; Wed, 24 Jan 2024 02:54:27 +0000 Received: from mail-dm6nam11on20610.outbound.protection.outlook.com ([2a01:111:f400:7eaa::610] helo=NAM11-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rSTP8-001D3y-0i for linux-arm-kernel@lists.infradead.org; Wed, 24 Jan 2024 02:54:19 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=J+wbTqG48SuPFZ7BOIGuOJq0Sy+/4Ej7ROUh4xSWr8FEsa293Poihf/yLMS5gQ/XebZ2F4KY1douCWEM1Rtp+izrB2yrLFkXbxORZdLJ4nhS4+nWEk3/Ojlhr4s0h7GMnsvIVDLxkv9O46gSKueXgv/2pqxfzM0hpfcVUl4Hk5uL5OwPYRqTwvTwf7LO0GMd9yDdXLYuXg4gO9Z7dWXHahg3AdJWpW7pba5Qkc8eQ7FJtndlh1tpHfbQWVq6/lLBzYZDrGCSafMP+kHwxRwSuIFyH9/MAEGf2sh00CkMoAZUAW+lOWuzz60CGRcrhvH341zFfl920ij3d8AxXiTbJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=F5xjs/9hM8nZIBy2hz4SFYtAqsSXJjAP3hbwy3NWpmw=; b=f6frGkoJFhiuFZiDxWjsUIXwFt9Ki2Xc7kh5+8C31jkhuvU41D/x4l/gnF4W2Sb2PcDLGqFsMWO8HA0jpDhXjnK2bRwrmAwAQNh/U1nEgLVd8yd+k96S13TwF5iTX+lUqgS7zCFsxIpxygtAxcJVQwEZVjycCw4NZV1Goz9oGJZdy166yQOBJsmzmQuvnBlIMvGpWhxCTPHaqv+tMINKX+H73PPvZL5puvyVrrQ2kVk/yBYkNhPOG02TgnUEEGWPQiG/pux7ZqTriR1fIW0HWm0YJ+/VAwYcVAacSpYqdqz6OJt5HBqMGZhR8vN/hSUFBOjuwO61WYH2yRDN+1/1sw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=ideasonboard.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=F5xjs/9hM8nZIBy2hz4SFYtAqsSXJjAP3hbwy3NWpmw=; b=4ZIbFqKS/PT86x3YIQWfGYprnVMpEl8ASPjp1KU8uQ4b+U4++tWynZuXeMUNC3vvw6LHlAbMcpdb+1e4ppFlVYhCjktINU00dcOR1CVI2+9WkZoWcqh6be9AHqSJrnDDXT2McVsNRO46ap/xXw6QkvpYb2tsqy2Y8CC7FPpmYrI= Received: from SJ0PR03CA0113.namprd03.prod.outlook.com (2603:10b6:a03:333::28) by PH0PR12MB7079.namprd12.prod.outlook.com (2603:10b6:510:21d::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.22; Wed, 24 Jan 2024 02:54:10 +0000 Received: from SJ5PEPF000001CA.namprd05.prod.outlook.com (2603:10b6:a03:333:cafe::3d) by SJ0PR03CA0113.outlook.office365.com (2603:10b6:a03:333::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7202.37 via Frontend Transport; Wed, 24 Jan 2024 02:54:10 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by SJ5PEPF000001CA.mail.protection.outlook.com (10.167.242.39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7202.16 via Frontend Transport; Wed, 24 Jan 2024 02:54:10 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Tue, 23 Jan 2024 20:54:07 -0600 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Tue, 23 Jan 2024 20:54:06 -0600 Received: from xsjanatoliy50.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.34 via Frontend Transport; Tue, 23 Jan 2024 20:54:06 -0600 From: Anatoliy Klymenko To: , , , , , , , , , Subject: [PATCH v3 3/5] drm: xlnx: zynqmp_dpsub: Clear status register ASAP Date: Tue, 23 Jan 2024 18:54:00 -0800 Message-ID: <20240124025402.373620-4-anatoliy.klymenko@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240124025402.373620-1-anatoliy.klymenko@amd.com> References: <20240124025402.373620-1-anatoliy.klymenko@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ5PEPF000001CA:EE_|PH0PR12MB7079:EE_ X-MS-Office365-Filtering-Correlation-Id: 93895552-df44-4d6e-d085-08dc1c87bd6c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1205liwW61G2sjzowYbc1cl96pfYPBPUlhtinsO8WX3rnDmYMFyXNVpDOhbSOAQdRc1t9Ncxs3IF9yMXkJU7nqeVpYjV8Mgzmql/+kkkj4daQe1L1ChdSqsrLwPCPGIBQ4Qq1ev3xrUrlQzOg6RLaYhrwaMciEIUGDzItBRLdXpqmWgDiRJa/vbobXVitvwTL2hMPDCu99NHDh7byjwmfTq+iwmb06ckxIDYEvEiuUSZlMOYOXUVFuWWpN/fjB8u9X/6p3WnNfjxe0IoGDBB8xv1375qHj1NB0x0/Ln0wsv/g9PUCBjZWcXMNW9vxoKOrXgppn55NNuKS8GZa5cYdtVHRG3AaQvekuFm14dv7pwnYj/1NxPZ44xN/7qhIqG35C4/SR0w32pFxfcSYLYyV9S3Pdky7NWDevZ6J/yhSzlshTIz555M69cElZSErjT86LC5ce46uqzVCjH7nRFqC5zGCY4HTYU78qdinsyWqowvNndV8skjfjrwXe0l1UDPBfeBgzXN8FhNrEy8Rh3Py+QThdyWFY9gQdzj4+vPuKaDjGKW7qyN/XlFCYjD+FWkjWVWasOwiuOefDmtJ4JYagIhCGgwEWx275YLxUvnmi9fJrej9HYIbF5z6X3E7W4EHaEGvzmrF2M9rpwy/UKHDFIk0J8jx/Ov55dnYjsmmNZWseXLkd8Kqb2yW7UafajdUhp40pA/C5M8Zpk1mC8TzvfimLDNlx2yT8nqUz6qFa5KGl4nqNLCJ7O3j8HU3uNnF+Jnbe56edsokL1Y4hkW8FyRPpC27n3PhdjyhiZ7BeyrkkpJf2kLNG4gtXFoeOri1sfQIN+4IlMRZwctigLEBQ== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(4636009)(39860400002)(396003)(376002)(136003)(346002)(230922051799003)(64100799003)(1800799012)(186009)(451199024)(82310400011)(36840700001)(40470700004)(46966006)(966005)(426003)(36860700001)(82740400003)(356005)(2906002)(86362001)(41300700001)(36756003)(47076005)(81166007)(70586007)(70206006)(110136005)(8936002)(6666004)(316002)(478600001)(5660300002)(2616005)(336012)(8676002)(83380400001)(26005)(1076003)(44832011)(921011)(40480700001)(40460700003)(2101003)(83996005)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jan 2024 02:54:10.2705 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 93895552-df44-4d6e-d085-08dc1c87bd6c X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SJ5PEPF000001CA.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR12MB7079 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240123_185418_261352_5AFD531B X-CRM114-Status: GOOD ( 12.92 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Clear status register as soon as we read it. Addressing comments from https://lore.kernel.org/dri-devel/beb551c7-bb7e-4cd0-b166-e9aad90c4620@ideasonboard.com/ Signed-off-by: Anatoliy Klymenko Reviewed-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart --- drivers/gpu/drm/xlnx/zynqmp_dp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/xlnx/zynqmp_dp.c b/drivers/gpu/drm/xlnx/zynqmp_dp.c index d60b7431603f..5a3335e1fffa 100644 --- a/drivers/gpu/drm/xlnx/zynqmp_dp.c +++ b/drivers/gpu/drm/xlnx/zynqmp_dp.c @@ -1624,6 +1624,8 @@ static irqreturn_t zynqmp_dp_irq_handler(int irq, void *data) u32 status, mask; status = zynqmp_dp_read(dp, ZYNQMP_DP_INT_STATUS); + /* clear status register as soon as we read it */ + zynqmp_dp_write(dp, ZYNQMP_DP_INT_STATUS, status); mask = zynqmp_dp_read(dp, ZYNQMP_DP_INT_MASK); if (!(status & ~mask)) return IRQ_NONE; @@ -1634,8 +1636,6 @@ static irqreturn_t zynqmp_dp_irq_handler(int irq, void *data) if (status & ZYNQMP_DP_INT_CHBUF_OVERFLW_MASK) dev_dbg_ratelimited(dp->dev, "overflow interrupt\n"); - zynqmp_dp_write(dp, ZYNQMP_DP_INT_STATUS, status); - if (status & ZYNQMP_DP_INT_VBLANK_START) zynqmp_dpsub_drm_handle_vblank(dp->dpsub); From patchwork Wed Jan 24 02:54:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Klymenko, Anatoliy" X-Patchwork-Id: 13528459 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E0F3BC47258 for ; Wed, 24 Jan 2024 02:54:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=CfSB1uuBFrRUmNfBq36M9e0cmJ3HdrnAt/+lVHU9jjc=; b=wsfMF6GRJnwmKN G8xe22Wgw0OKhSL26SOdTM2INbFf3Y78d/LmMoW9ncttFzGhhlI51AfwU0NpSlG2ZaTWdwyw8hruo 02bUkK6V+6Zc8bwglHEMsh3xQ7P9tsaEwSqRJekOruRmeNxVE/iGRESNH60QyqLjZljI74vk4rt/0 cw65cUJLj+gml/2V2k/QpFoWbX9y7mLa5bVfoK99A8vXWbU9C/Bbis/FTBnWio/Nk7Q5GeBTHiFuT aR1gw2dBKtH0yfoe0RWAZcmMHy5ssM8nfbTuD5Z9xzsFYXex4CKR9zXRFQELDc4wUuZi5J/+NEbiN lMlQJ44NFprDSNy1Y5TQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rSTPJ-001DAA-2A; Wed, 24 Jan 2024 02:54:29 +0000 Received: from mail-bn8nam04on20600.outbound.protection.outlook.com ([2a01:111:f403:2408::600] helo=NAM04-BN8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rSTPD-001D6j-16 for linux-arm-kernel@lists.infradead.org; Wed, 24 Jan 2024 02:54:24 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZJ05E4X0S8HxCKFSQDogyX+tx7ukuL6L43WmTNJdcVphTWTadtckbWGCYJSIOnGpxKI9VUiOUG8RPe89p0yHKndjqrEaB5sH6xp5gE1fURM/l+v/S9tnay/3wNzy0cTr5lhV1mgF3OutwPWbyf6KWDK4JC90haNzJGlVwJw0FWJa0naTTdXRnHq4rtwLHSZ7S4D2uW4bW2PtR8L6Qcv4Wjua5+nv45hzRzx/LlYUYSpZKd0SC9DP4C0zrQm3pYo+aJs6nJ6LZyfehi67Avf1fkjDDmMpdgP2hgn9U4eC4o44mdFNY4cYl9no5rV0SoViIPxx5yT/c4dntnWgar2rWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Ro1x0XU0Vy+Jr6q29q7S5YrkHI5kVh8EnU6b+srSyEU=; b=iur3kL0sL9i/xCEvSGBOzhah9lafCWdj9ABZ9YtNW7/UrHqw3gSOGw7nxlFNKdEXoCYJzy5xY8HzjJoo6noo/+atXtu8IG93CIggkOWqkeHEc+uvDxlS3+1V9pTSFp8JwsKZt47ebR3SFYd1wKKkUDy5WM+jtYpHiVXbpSzs4VHU9gTrfJUeNxmOnPZj5rI0gUKB+wNKd/hzKEFVmU9JqSbQEd16X0JaPNj0aLPXFRckbv8pRky5qJW/VoqPSwRTLsxRtWK9V13BzsvFzpbXi2DhI10bIVNhc1BbPEzOMFDnlFGOOkCzHp6xZFyEZN/d01f84PA6ctPAabW3+jObFw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=ideasonboard.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Ro1x0XU0Vy+Jr6q29q7S5YrkHI5kVh8EnU6b+srSyEU=; b=D0lfzworJQ0Txd+MPmTrVqQaiW42+i9sgT8umbO0kcZrSdlTYg9IRlA6aHqVP1xZjKbnFS7XaBPOZYEIR6a99wgNxRl0imwnEi7Dq1Gwhh1abKfgwe2uvcgZWA4QlrTrtmJYdREvOjisexWT5wAR463ryO7zbJfdQ1yeaCVlYLA= Received: from DM6PR07CA0076.namprd07.prod.outlook.com (2603:10b6:5:337::9) by SJ2PR12MB8183.namprd12.prod.outlook.com (2603:10b6:a03:4f4::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.22; Wed, 24 Jan 2024 02:54:08 +0000 Received: from SN1PEPF0002636D.namprd02.prod.outlook.com (2603:10b6:5:337:cafe::91) by DM6PR07CA0076.outlook.office365.com (2603:10b6:5:337::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7202.38 via Frontend Transport; Wed, 24 Jan 2024 02:54:08 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB03.amd.com; pr=C Received: from SATLEXMB03.amd.com (165.204.84.17) by SN1PEPF0002636D.mail.protection.outlook.com (10.167.241.138) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7202.16 via Frontend Transport; Wed, 24 Jan 2024 02:54:08 +0000 Received: from SATLEXMB08.amd.com (10.181.40.132) by SATLEXMB03.amd.com (10.181.40.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Tue, 23 Jan 2024 20:54:07 -0600 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB08.amd.com (10.181.40.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.32; Tue, 23 Jan 2024 18:54:07 -0800 Received: from xsjanatoliy50.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.34 via Frontend Transport; Tue, 23 Jan 2024 20:54:06 -0600 From: Anatoliy Klymenko To: , , , , , , , , , Subject: [PATCH v3 4/5] drm: xlnx: zynqmp_dpsub: Filter interrupts against mask Date: Tue, 23 Jan 2024 18:54:01 -0800 Message-ID: <20240124025402.373620-5-anatoliy.klymenko@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240124025402.373620-1-anatoliy.klymenko@amd.com> References: <20240124025402.373620-1-anatoliy.klymenko@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SN1PEPF0002636D:EE_|SJ2PR12MB8183:EE_ X-MS-Office365-Filtering-Correlation-Id: dce21088-766d-4d7d-9e93-08dc1c87bc47 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: odM+Yc3cLGG8DTtI/A9rC9xp60KpdTBtqCFTotbh/DXm0b4wOYcAtoFzofuR5jQ4IL9xlTOV8NNEDJTKah4Gt7Tw3XkfVcA1lQ7lpW6azA75rV+xrSMjNNphtslLKkp/LtcCbFByTkyq7BSAWN80LIOEofzGiPpakW1gmx79xjUlhEmR1fkHqntmuN+jnj9EbZ8W4WNfwvDdNAbs/t6q7ZPNc2BmaYpVatLk65Cq96VtyKxOoIuAiSAipeLtyRhdwuo2d28t3y43QU752MxQ6hqa8mkMVmoIgIVK6M6DzF46qZ+UhOuCIP47Gv0ukq8AxvdDmmhM9Yx7AGWK8LS5exQavd7erf9B9q2kH4POCj+hrmLxKPvy6MxRY4cDux71q80QJL/WDOXVpC80PzPKnbqaxq4iP8PCATVrlt4AABtrKUoYhe5d7cflh4W/TTf74bIHdrX28ZNDxF+0HuVjDpFytNOSbyP0jFQvRsu5Xfrt2d140Hfbp3x+AAS4mIbEXAOklpPvmLT58SqSGkmLC1GbNemdpbsNBFhlnaBMTHhYmyGU7tb/Db7aBQVZXZHXVCuwXeSb+/H0ARiLQFNay4f7KCtaAMWFohmYNDcG+Joz7s2XNNT+YzXozvF1upckU13qJW1i9nUEKWJS2bN7QO214u1BuFeXQXPeR41vdkt1c1cDy9YawgdkdewlVDu1zGdFQDL+lZt8WLxwRH9LoFhAcJvTlESsj3nGsibboeMBb7TYS5lkVlGNvguz9ffrTS9tZZ2MNSi6eJ0SUKAW6Wyj0hZVQYsyCsLAULHKNjBsiDqMJBhEIsMbW2z757g1xvboZVTansUrrZjWaiLFmw== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB03.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(4636009)(136003)(376002)(396003)(39860400002)(346002)(230922051799003)(82310400011)(451199024)(1800799012)(64100799003)(186009)(36840700001)(46966006)(40470700004)(40480700001)(83380400001)(40460700003)(1076003)(921011)(47076005)(26005)(82740400003)(8676002)(8936002)(44832011)(356005)(70206006)(70586007)(110136005)(5660300002)(316002)(86362001)(478600001)(336012)(81166007)(2906002)(426003)(36860700001)(2616005)(41300700001)(36756003)(6666004)(83996005)(2101003)(36900700001);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jan 2024 02:54:08.4115 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: dce21088-766d-4d7d-9e93-08dc1c87bc47 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB03.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SN1PEPF0002636D.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR12MB8183 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240123_185423_396340_DD167433 X-CRM114-Status: GOOD ( 15.07 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Filter out status register against the interrupts' mask. Some events are being reported via DP status register, even if corresponding interrupts have been disabled. One instance of such event leads to generation of VBLANK when the driver is in DRM bridge mode, which in turn results in NULL pointer dereferencing. We should avoid processing such events in an interrupt handler context. This problem is less noticeable when the driver operates in DMA mode, as in this case we have DRM CRTC object instantiated and DRM framework simply discards unwanted VBLANKs in drm_handle_vblank(). Signed-off-by: Anatoliy Klymenko Reviewed-by: Tomi Valkeinen Reviewed-by: Laurent Pinchart --- drivers/gpu/drm/xlnx/zynqmp_dp.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/xlnx/zynqmp_dp.c b/drivers/gpu/drm/xlnx/zynqmp_dp.c index 5a3335e1fffa..9f48e5bbcdec 100644 --- a/drivers/gpu/drm/xlnx/zynqmp_dp.c +++ b/drivers/gpu/drm/xlnx/zynqmp_dp.c @@ -1627,7 +1627,14 @@ static irqreturn_t zynqmp_dp_irq_handler(int irq, void *data) /* clear status register as soon as we read it */ zynqmp_dp_write(dp, ZYNQMP_DP_INT_STATUS, status); mask = zynqmp_dp_read(dp, ZYNQMP_DP_INT_MASK); - if (!(status & ~mask)) + + /* + * Status register may report some events, which corresponding interrupts + * have been disabled. Filter out those events against interrupts' mask. + */ + status &= ~mask; + + if (!status) return IRQ_NONE; /* dbg for diagnostic, but not much that the driver can do */ From patchwork Wed Jan 24 02:54:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Klymenko, Anatoliy" X-Patchwork-Id: 13528462 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1605DC47DDB for ; Wed, 24 Jan 2024 02:55:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=KhKT4U8GgIv/2YkX1jdhXtYr5QxG0oultsfXbl/EMSA=; b=3y4infCO4oD34w i4Wq9/yruf9gtMQpCiKkfohZ3rnt+gm9q/4G9rb0KgoZH5Uidlj48/CvnWXm58Wx7YmGo58ppmU+/ jSeG0s0tFoeKCP6TDpyQPKVDcjlWUDrfn047pFgkYLRjF+OGpzHmF62vlPzDrEDVjPddz/u0kitko KU5qSFDNgEhxK0L7a65LImYhPTPTUuhko0319KqKzky9Z23FkSRxzxay1foqnsk9BaDy2dy6VtslM detdiPwXnKjAI1rAw2OJsNrnMn8zs4A5BYHpzDNODd1pLVl2iOhBygbQJipdWjKwJiuzL0UY0Y73A kNCpOqrhyb56b6JmW6nQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rSTPJ-001D9w-09; Wed, 24 Jan 2024 02:54:29 +0000 Received: from mail-bn1nam02on20601.outbound.protection.outlook.com ([2a01:111:f403:2407::601] helo=NAM02-BN1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rSTP8-001D4J-1E for linux-arm-kernel@lists.infradead.org; Wed, 24 Jan 2024 02:54:20 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CpPo1KL4SfyxHnEpr5d3B56Iwt4+NqLjafW1KEztp6WvI2N/9f8fbogHqnQ1midaCZvj+bNjYq/uHVFFs4r6QSHkzItGrUiPhSYYDX5eJqR4utg2ViUkkzyiJtvyi7BJgEOIVhJR17dFlaWV6J4M1g2zbzQDZL2bXo6t793VfdcW5+n+HvcVhcu21atSmtltz5A3IHsNIO+N35A4CD+3y77AyLaqcbxqH3b4NpfYbEjKczxUmcmKULN+pCVXlprom0x/Zm41S4/Pc6T4DkobgnWOgmS87MvCDe1guFa6jwRVMHU7JgSgnM51LY6eZ73k4NjzuUbmmuAgTSplTQhzvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=9mh8SYDYtZS4FEJxEJLtuXOIRmITcFUz9I9YrWBMw7k=; b=Nd6osq90nxS1RimFZlyfhxa/vgN8w44nCiGbqoNzPv2Fc5aC1foMmjHRnZllZDK1IGynFhR1jjAekJtUiqnwnMfVVXU/Tv5IpY+0jfM8lNEvMgZT1Yh1uA1+nxMEQfgW01KG2L1+tByrJlCsdzY6aCk+IZB+n0/5h83Qhr1Bt/1EWORfJPsYW3Wvfv2Ms7gNbGP84GARqfRxP8ypQqTWrpZ1XqaWwR3ffZ6EEabIk7ULQOmx2XLPgqP6xJA1UbXEPzs0wGMO4IDd+G4pjM6EUDe7yaSLRpu3eynYcEjq0DxVbxGamy992MiOXJY2QgeG8ETaWs2Uq/tYKH/S/+0X5A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=ideasonboard.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9mh8SYDYtZS4FEJxEJLtuXOIRmITcFUz9I9YrWBMw7k=; b=qqvEriiwXk5Q1AYH4snZ1DlrFxAiVhGCjbBXtYPwePoHQG03YcFm16Pu87nm2bgluxuakt5iACaqluoy2jwkdaSwpn8CnJqh2W3eeT6ZR1MW4blSWNvbLVzmxYkb3LBT4UGLGOHdPvf+5dsWhWKqN2ZyodW0mXVyoRQPgavuN94= Received: from SJ0PR03CA0117.namprd03.prod.outlook.com (2603:10b6:a03:333::32) by BN9PR12MB5340.namprd12.prod.outlook.com (2603:10b6:408:105::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7228.22; Wed, 24 Jan 2024 02:54:12 +0000 Received: from SJ5PEPF000001CA.namprd05.prod.outlook.com (2603:10b6:a03:333:cafe::7f) by SJ0PR03CA0117.outlook.office365.com (2603:10b6:a03:333::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7202.37 via Frontend Transport; Wed, 24 Jan 2024 02:54:12 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by SJ5PEPF000001CA.mail.protection.outlook.com (10.167.242.39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7202.16 via Frontend Transport; Wed, 24 Jan 2024 02:54:12 +0000 Received: from SATLEXMB06.amd.com (10.181.40.147) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Tue, 23 Jan 2024 20:54:09 -0600 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB06.amd.com (10.181.40.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Tue, 23 Jan 2024 20:54:08 -0600 Received: from xsjanatoliy50.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.34 via Frontend Transport; Tue, 23 Jan 2024 20:54:07 -0600 From: Anatoliy Klymenko To: , , , , , , , , , Subject: [PATCH v3 5/5] drm: xlnx: zynqmp_dpsub: Set live video in format Date: Tue, 23 Jan 2024 18:54:02 -0800 Message-ID: <20240124025402.373620-6-anatoliy.klymenko@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240124025402.373620-1-anatoliy.klymenko@amd.com> References: <20240124025402.373620-1-anatoliy.klymenko@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ5PEPF000001CA:EE_|BN9PR12MB5340:EE_ X-MS-Office365-Filtering-Correlation-Id: fcd51ae2-9da4-4251-99e6-08dc1c87be9b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zR5u6b4E2R6SgJ/+tCwfKyfUjaJf3llIWKwTUcC3c86oJWGGmennL6a5HTpgwEZxMluyhr7TferzfKNZOuB/lGOvVUKNM5LrckY+ZhjQ++NlrxuGH/IPvm8dxSLre0j1ofTqv7yQqrofnKEfVNsvX/TZavFrfugDomc32OPjVKhgYhiwu7S5NFq64rv4amFTFHYD5YA+FauFcyzCx3FOChLb+443Rn9BFlhsKrUciAS0tNUSCOrBRTufH4bT85WxaSVgk0z2r1AL+OwJZuj5POSh0CnaL1lMCTFRH28S9h0isD/z8wsCCKVRZC3pbbB8aUVCRpmAHkk4J92cAIoEr8ibbXjNz9tg2w7zjzP/Yro0nshHG3C2pzUGnJl3T/wKJMBME0pqyxw8AJTcZFBVHdyIJLv543xLK4WHrc5SojQPjQxsSS6XnwLpvZ5rusTWs5gp9UFaUkrhhZ+dLffwfsM7Szy2ntEyTSqyi7EwtMxvE97gSpcZZexVttD9TA673qL/nhOVPVYORMEGwn7nqmn82amR/z6JKxHEsSD54nknVXSmQzJXpibEkaudfj6jqXZPQvEviG91pTGNF9YdcB1qywhBl6kOW2mA4OrPF+AhyOpZCIieUPynWp7AtdcynIE1iU5xXwYEZWgoCU845x0Xm7Ldmm43S678NZWmU9v9VGevBDDO51vIVXv3EhIogGfqM7jzVqCCEKJAg+UArylk7EC7ob5H283E/Y9M5lxvRg6ZxVGMpZEBtzyNdpulOhxN2ofE3yKRTvLeURyl7Jnz7d5bTvAc6TUu+wABFhQ6NVYdIwX9K97uvHJAJKYm1+cXcvhfSlLoUbImdYDOoIExpn9OWIU46/QjWSJ+ecq4VV5S7ldUZU1TqPPAI9Yq X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(4636009)(346002)(136003)(396003)(39860400002)(376002)(230922051799003)(230273577357003)(230173577357003)(186009)(64100799003)(82310400011)(1800799012)(451199024)(40470700004)(36840700001)(46966006)(921011)(70206006)(110136005)(40480700001)(40460700003)(2906002)(30864003)(70586007)(5660300002)(44832011)(316002)(8676002)(8936002)(81166007)(356005)(478600001)(36756003)(82740400003)(86362001)(26005)(47076005)(426003)(336012)(6666004)(1076003)(36860700001)(83380400001)(2616005)(41300700001)(36900700001)(83996005)(2101003);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jan 2024 02:54:12.2549 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fcd51ae2-9da4-4251-99e6-08dc1c87be9b X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: SJ5PEPF000001CA.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR12MB5340 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240123_185418_505671_630B40BB X-CRM114-Status: GOOD ( 28.85 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org ZynqMP DPSUB supports 2 modes of operations in regard to video data input. In the first mode, DPSUB uses DMA engine to pull video data from memory buffers. To support this the driver implements CRTC and DRM bridge representing DP encoder. In the second mode, DPSUB acquires video data pushed from FPGA and passes it downstream to DP output. This mode of operation is modeled in the driver as a DRM bridge that should be attached to some external CRTC. DPSUB supports multiple input data formats. In order to properly operate exact media bus format should be negotiated between external CRTC and DPSUB bridge. DRM framework provides a mechanism to negotiate media bus formats between bridges connected into a chain, but not between CRTC and encoder (first bridge in the chain). This change mitigates the issue for FPGA based CRTC, which would typically have a single fixed media bus format. Expect live video input format to be set as "bus-format" property in connected remote endpoint. Set display layer mode in the layer creation context. Signed-off-by: Anatoliy Klymenko --- drivers/gpu/drm/xlnx/zynqmp_disp.c | 109 ++++++++++++++++++++++-- drivers/gpu/drm/xlnx/zynqmp_disp.h | 3 +- drivers/gpu/drm/xlnx/zynqmp_disp_regs.h | 8 +- drivers/gpu/drm/xlnx/zynqmp_dp.c | 2 +- drivers/gpu/drm/xlnx/zynqmp_kms.c | 2 +- 5 files changed, 107 insertions(+), 17 deletions(-) diff --git a/drivers/gpu/drm/xlnx/zynqmp_disp.c b/drivers/gpu/drm/xlnx/zynqmp_disp.c index 8a39b3accce5..a7115321b3fb 100644 --- a/drivers/gpu/drm/xlnx/zynqmp_disp.c +++ b/drivers/gpu/drm/xlnx/zynqmp_disp.c @@ -18,8 +18,10 @@ #include #include #include +#include #include #include +#include #include #include @@ -67,12 +69,16 @@ /** * struct zynqmp_disp_format - Display subsystem format information * @drm_fmt: DRM format (4CC) + * @bus_fmt: Live video media bus format * @buf_fmt: AV buffer format * @swap: Flag to swap R & B for RGB formats, and U & V for YUV formats * @sf: Scaling factors for color components */ struct zynqmp_disp_format { - u32 drm_fmt; + union { + u32 drm_fmt; + u32 bus_fmt; + }; u32 buf_fmt; bool swap; const u32 *sf; @@ -354,6 +360,16 @@ static const struct zynqmp_disp_format avbuf_gfx_fmts[] = { }, }; +/* TODO: add support for different formats */ +static const struct zynqmp_disp_format avbuf_live_vid_fmts[] = { + { + .bus_fmt = MEDIA_BUS_FMT_UYVY8_1X16, + .buf_fmt = ZYNQMP_DISP_AV_BUF_LIVE_CONFIG_BPC_8 | + ZYNQMP_DISP_AV_BUF_LIVE_CONFIG_FMT_YUV422, + .sf = scaling_factors_888, + } +}; + static u32 zynqmp_disp_avbuf_read(struct zynqmp_disp *disp, int reg) { return readl(disp->avbuf.base + reg); @@ -369,6 +385,34 @@ static bool zynqmp_disp_layer_is_video(const struct zynqmp_disp_layer *layer) return layer->id == ZYNQMP_DPSUB_LAYER_VID; } +/** + * zynqmp_disp_avbuf_set_live_format - Set live input format for a layer + * @disp: Display controller + * @layer: The layer + * @fmt: The format information + * + * Set the live video input format for @layer to @fmt. + */ +static void zynqmp_disp_avbuf_set_live_format(struct zynqmp_disp *disp, + struct zynqmp_disp_layer *layer, + const struct zynqmp_disp_format *fmt) +{ + u32 reg, i; + + reg = zynqmp_disp_layer_is_video(layer) + ? ZYNQMP_DISP_AV_BUF_LIVE_VID_CONFIG + : ZYNQMP_DISP_AV_BUF_LIVE_GFX_CONFIG; + zynqmp_disp_avbuf_write(disp, reg, fmt->buf_fmt); + + for (i = 0; i < ZYNQMP_DISP_AV_BUF_NUM_SF; ++i) { + reg = zynqmp_disp_layer_is_video(layer) + ? ZYNQMP_DISP_AV_BUF_LIVD_VID_COMP_SF(i) + : ZYNQMP_DISP_AV_BUF_LIVD_GFX_COMP_SF(i); + zynqmp_disp_avbuf_write(disp, reg, fmt->sf[i]); + } + layer->disp_fmt = fmt; +} + /** * zynqmp_disp_avbuf_set_format - Set the input format for a layer * @disp: Display controller @@ -902,15 +946,12 @@ u32 *zynqmp_disp_layer_drm_formats(struct zynqmp_disp_layer *layer, /** * zynqmp_disp_layer_enable - Enable a layer * @layer: The layer - * @mode: Operating mode of layer * * Enable the @layer in the audio/video buffer manager and the blender. DMA * channels are started separately by zynqmp_disp_layer_update(). */ -void zynqmp_disp_layer_enable(struct zynqmp_disp_layer *layer, - enum zynqmp_dpsub_layer_mode mode) +void zynqmp_disp_layer_enable(struct zynqmp_disp_layer *layer) { - layer->mode = mode; zynqmp_disp_avbuf_enable_video(layer->disp, layer); zynqmp_disp_blend_layer_enable(layer->disp, layer); } @@ -950,11 +991,12 @@ void zynqmp_disp_layer_set_format(struct zynqmp_disp_layer *layer, layer->disp_fmt = zynqmp_disp_layer_find_format(layer, info->format); layer->drm_fmt = info; - zynqmp_disp_avbuf_set_format(layer->disp, layer, layer->disp_fmt); - - if (!layer->disp->dpsub->dma_enabled) + /* Live format set during layer creation */ + if (layer->mode == ZYNQMP_DPSUB_LAYER_LIVE) return; + zynqmp_disp_avbuf_set_format(layer->disp, layer, layer->disp_fmt); + /* * Set pconfig for each DMA channel to indicate they're part of a * video group. @@ -1083,7 +1125,7 @@ static int zynqmp_disp_layer_request_dma(struct zynqmp_disp *disp, unsigned int i; int ret; - if (!disp->dpsub->dma_enabled) + if (layer->mode == ZYNQMP_DPSUB_LAYER_LIVE) return 0; for (i = 0; i < layer->info->num_channels; i++) { @@ -1104,6 +1146,43 @@ static int zynqmp_disp_layer_request_dma(struct zynqmp_disp *disp, return 0; } +/** + * zynqmp_disp_get_live_fmt - Get live video format + * @disp: Display controller + * @layer: Display layer + * + * Parse connected remote endpoint and retrieve configured bus-format + * + * Return: live format pointer on success, NULL otherwise + */ +static const struct zynqmp_disp_format *zynqmp_disp_get_live_fmt(struct zynqmp_disp *disp, + struct zynqmp_disp_layer *layer) +{ + struct device_node *local, *remote, *dpsub = disp->dev->of_node; + int rc, i; + u32 fmt; + + local = of_graph_get_endpoint_by_regs(dpsub, layer->id, -1); + if (!local) + return NULL; + + remote = of_graph_get_remote_endpoint(local); + of_node_put(local); + if (!remote) + return NULL; + + rc = of_property_read_u32(remote, "bus-format", &fmt); + of_node_put(remote); + if (rc) + return NULL; + + for (i = 0; i < ARRAY_SIZE(avbuf_live_vid_fmts); ++i) + if (avbuf_live_vid_fmts[i].bus_fmt == fmt) + return &avbuf_live_vid_fmts[i]; + + return NULL; +} + /** * zynqmp_disp_create_layers - Create and initialize all layers * @disp: Display controller @@ -1130,9 +1209,15 @@ static int zynqmp_disp_create_layers(struct zynqmp_disp *disp) for (i = 0; i < ARRAY_SIZE(disp->layers); i++) { struct zynqmp_disp_layer *layer = &disp->layers[i]; + const struct zynqmp_disp_format *disp_fmt; layer->id = i; layer->disp = disp; + /* For now we assume dpsub works in either live or non-live mode for both layers. + * Hybrid mode is not supported yet. + */ + layer->mode = disp->dpsub->dma_enabled ? ZYNQMP_DPSUB_LAYER_NONLIVE + : ZYNQMP_DPSUB_LAYER_LIVE; layer->info = &layer_info[i]; ret = zynqmp_disp_layer_request_dma(disp, layer); @@ -1140,6 +1225,12 @@ static int zynqmp_disp_create_layers(struct zynqmp_disp *disp) goto err; disp->dpsub->layers[i] = layer; + + if (layer->mode == ZYNQMP_DPSUB_LAYER_LIVE) { + disp_fmt = zynqmp_disp_get_live_fmt(disp, layer); + if (disp_fmt) + zynqmp_disp_avbuf_set_live_format(disp, layer, disp_fmt); + } } return 0; diff --git a/drivers/gpu/drm/xlnx/zynqmp_disp.h b/drivers/gpu/drm/xlnx/zynqmp_disp.h index 123cffac08be..f3357b2d5c09 100644 --- a/drivers/gpu/drm/xlnx/zynqmp_disp.h +++ b/drivers/gpu/drm/xlnx/zynqmp_disp.h @@ -62,8 +62,7 @@ void zynqmp_disp_blend_set_global_alpha(struct zynqmp_disp *disp, u32 *zynqmp_disp_layer_drm_formats(struct zynqmp_disp_layer *layer, unsigned int *num_formats); -void zynqmp_disp_layer_enable(struct zynqmp_disp_layer *layer, - enum zynqmp_dpsub_layer_mode mode); +void zynqmp_disp_layer_enable(struct zynqmp_disp_layer *layer); void zynqmp_disp_layer_disable(struct zynqmp_disp_layer *layer); void zynqmp_disp_layer_set_format(struct zynqmp_disp_layer *layer, const struct drm_format_info *info); diff --git a/drivers/gpu/drm/xlnx/zynqmp_disp_regs.h b/drivers/gpu/drm/xlnx/zynqmp_disp_regs.h index f92a006d5070..926e07c255bb 100644 --- a/drivers/gpu/drm/xlnx/zynqmp_disp_regs.h +++ b/drivers/gpu/drm/xlnx/zynqmp_disp_regs.h @@ -165,10 +165,10 @@ #define ZYNQMP_DISP_AV_BUF_LIVE_CONFIG_BPC_10 0x2 #define ZYNQMP_DISP_AV_BUF_LIVE_CONFIG_BPC_12 0x3 #define ZYNQMP_DISP_AV_BUF_LIVE_CONFIG_BPC_MASK GENMASK(2, 0) -#define ZYNQMP_DISP_AV_BUF_LIVE_CONFIG_FMT_RGB 0x0 -#define ZYNQMP_DISP_AV_BUF_LIVE_CONFIG_FMT_YUV444 0x1 -#define ZYNQMP_DISP_AV_BUF_LIVE_CONFIG_FMT_YUV422 0x2 -#define ZYNQMP_DISP_AV_BUF_LIVE_CONFIG_FMT_YONLY 0x3 +#define ZYNQMP_DISP_AV_BUF_LIVE_CONFIG_FMT_RGB 0x00 +#define ZYNQMP_DISP_AV_BUF_LIVE_CONFIG_FMT_YUV444 0x10 +#define ZYNQMP_DISP_AV_BUF_LIVE_CONFIG_FMT_YUV422 0x20 +#define ZYNQMP_DISP_AV_BUF_LIVE_CONFIG_FMT_YONLY 0x30 #define ZYNQMP_DISP_AV_BUF_LIVE_CONFIG_FMT_MASK GENMASK(5, 4) #define ZYNQMP_DISP_AV_BUF_LIVE_CONFIG_CB_FIRST BIT(8) #define ZYNQMP_DISP_AV_BUF_PALETTE_MEMORY 0x400 diff --git a/drivers/gpu/drm/xlnx/zynqmp_dp.c b/drivers/gpu/drm/xlnx/zynqmp_dp.c index 9f48e5bbcdec..6fd7eab0f6db 100644 --- a/drivers/gpu/drm/xlnx/zynqmp_dp.c +++ b/drivers/gpu/drm/xlnx/zynqmp_dp.c @@ -1295,7 +1295,7 @@ static void zynqmp_dp_disp_enable(struct zynqmp_dp *dp, /* TODO: Make the format configurable. */ info = drm_format_info(DRM_FORMAT_YUV422); zynqmp_disp_layer_set_format(layer, info); - zynqmp_disp_layer_enable(layer, ZYNQMP_DPSUB_LAYER_LIVE); + zynqmp_disp_layer_enable(layer); if (layer_id == ZYNQMP_DPSUB_LAYER_GFX) zynqmp_disp_blend_set_global_alpha(dp->dpsub->disp, true, 255); diff --git a/drivers/gpu/drm/xlnx/zynqmp_kms.c b/drivers/gpu/drm/xlnx/zynqmp_kms.c index db3bb4afbfc4..43bf416b33d5 100644 --- a/drivers/gpu/drm/xlnx/zynqmp_kms.c +++ b/drivers/gpu/drm/xlnx/zynqmp_kms.c @@ -122,7 +122,7 @@ static void zynqmp_dpsub_plane_atomic_update(struct drm_plane *plane, /* Enable or re-enable the plane if the format has changed. */ if (format_changed) - zynqmp_disp_layer_enable(layer, ZYNQMP_DPSUB_LAYER_NONLIVE); + zynqmp_disp_layer_enable(layer); } static const struct drm_plane_helper_funcs zynqmp_dpsub_plane_helper_funcs = {