From patchwork Thu Sep 28 14:13:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Harry Wentland X-Patchwork-Id: 9976221 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3050A60365 for ; Thu, 28 Sep 2017 14:14:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 226B82582C for ; Thu, 28 Sep 2017 14:14:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 16E92274D2; Thu, 28 Sep 2017 14:14:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 387932582C for ; Thu, 28 Sep 2017 14:14:05 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7E7D16E951; Thu, 28 Sep 2017 14:14:04 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0084.outbound.protection.outlook.com [104.47.38.84]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5A5C06E951; Thu, 28 Sep 2017 14:14:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=b4A+4K18tsdBHckx64bIwNPTQsgY/osO2K60wy8Vyiw=; b=ziFph2Rt2rEzBs+UPGWMb8IwGCqoiMM6iZRfYwKNrqzyuZPuhTgEsdPqZEg5lgXTATevN7cXiCBAlzaAGNvvO/CFo4A/582GejGvr5LVgC+mjOh7f1huO2e8C3o5zlnMkXJ3+pnP/YIjgq9jMtfh7MoEMuEECc/w+BIKzjENQNc= Received: from DM5PR12CA0014.namprd12.prod.outlook.com (10.172.32.152) by CY4PR12MB1448.namprd12.prod.outlook.com (10.172.71.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Thu, 28 Sep 2017 14:14:01 +0000 Received: from CO1NAM03FT040.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::200) by DM5PR12CA0014.outlook.office365.com (2603:10b6:4:1::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.56.11 via Frontend Transport; Thu, 28 Sep 2017 14:14:01 +0000 Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; lists.freedesktop.org; dkim=none (message not signed) header.d=none;lists.freedesktop.org; dmarc=permerror action=none header.from=amd.com; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV02.amd.com (165.204.84.17) by CO1NAM03FT040.mail.protection.outlook.com (10.152.81.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.20.77.10 via Frontend Transport; Thu, 28 Sep 2017 14:14:00 +0000 Received: from SATLEXDAG01.amd.com (10.181.40.3) by SATLEXCHOV02.amd.com (10.181.40.72) with Microsoft SMTP Server (TLS) id 14.3.361.1; Thu, 28 Sep 2017 09:13:59 -0500 Received: from localhost.localdomain (10.180.168.240) by SATLEXDAG01.amd.com (10.181.40.3) with Microsoft SMTP Server id 14.3.361.1; Thu, 28 Sep 2017 10:13:58 -0400 From: Harry Wentland To: Subject: [PATCH v2] drm/amd/display: DC I2C review Date: Thu, 28 Sep 2017 10:13:55 -0400 Message-ID: <20170928141355.6967-1-harry.wentland@amd.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(376002)(346002)(39860400002)(2980300002)(428002)(189002)(199003)(5003940100001)(106466001)(47776003)(2906002)(2351001)(50466002)(6666003)(33646002)(50226002)(50986999)(48376002)(5660300001)(105586002)(101416001)(77096006)(72206003)(316002)(1076002)(6916009)(81156014)(356003)(97736004)(8676002)(81166006)(8936002)(49486002)(305945005)(189998001)(86362001)(53936002)(4326008)(54906003)(68736007)(16586007)(478600001)(36756003); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR12MB1448; H:SATLEXCHOV02.amd.com; FPR:; SPF:None; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CO1NAM03FT040; 1:MQHcxssvLILs9qS3VIVDtMlKaveOuZLXqpCgRvztBJtL9MGgQVGVPAlCyrC3aRQiC+fTqmzIkqS6dfCyGX9PIFPDXvPcqO4kEVFzfeHYmNnwd0dQaWW0TJaCkuyJfeRy X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 31f6ff47-b60e-4e58-8ef1-08d5067b2aa0 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:CY4PR12MB1448; X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1448; 3:3QMYQ2Ynf28InnMRAR2ufRS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B14S5O30/WkOAJXjG4fYzBd+ElqcuWAirRg6SLzinplPIZOjoEZ3+XXWOT+f990mi/oinWO0/r7d9xTpYEzr/M+YATIKihCCeFffsZVDbhhzV1Yuu+tSPtErGS/u1OOXl6McVVFK5YgnO9Q/04fJsSzMrUMix5D6U0VkDscIBGrztLnjxxjHZ2TgLiZhc0L0bMLi39EOklybTwD4od7PoTTy+JK9rFsns2xcCF/j1QzlHfhwEP71+nbkAgmjGUh/5dwDxIPPlDNxw7wF9Em1hEQXnFhg9tKfUqTS/38BYik2OJCY9AEH3998JG0nwR5ha0uLFGfWiPoP8ljcy3cpoES2z165iNDdDKxQS3uWIdAXZCr8VmXkXZ4GHf4pBN0xPmnBeNYMxrhTubBaoVEH+U9ohENNJ4MhIZIOHbNZVHtIl507ptNkm X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(10201501046)(3002001)(93006095)(93003095)(100000703101)(100105400095)(6055026)(6041248)(20161123560025)(20161123558100)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(20161123562025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY4PR12MB1448; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY4PR12MB1448; X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1448; 4:UuAm4Jkfha+xeIUEnM9OUmLOH1i9JVCYrdsLwWhncQ23lGXJmgCgyRmPBYdjV8AZW0akGR4lEnS8SL4Oln+OJ9zKuzgSfekmaEAwUwGa/R2nUP1ZjW2abZeDSMU/1X1HSag0RhhsHEmBrKwPpXQXjsj6UCC44m4grLL1BtImxl+Y5HIxHVbFOYW/kwvple72TkrtkvaJFf0R4zn1pdQuttpv40P/M30STcB4dw5qW910bHvIPsHkyJZFzbLPi2Eb5v8lUm4P5nj6LkMD4kKPskGhORnsODic52Ok4KNJq64= X-Forefront-PRVS: 0444EB1997 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR12MB1448; 23:7emkOJr5WRizDPuCg1JkgxAMyNvb0zC/g3SbP/mRQ?= =?us-ascii?Q?pajr9KctNr2ioIBOGi0PnsZMEGg9lX6u9LwGxl1QEz4AaB8cwMcxiaUdaQip?= =?us-ascii?Q?08TErYYTRmihB4XuZCwfch5s6pVwAC8oq+W0RFgO+SECHYx5o3bKwa0JPrq9?= =?us-ascii?Q?ki7SWQvk/1F9F7Gt6T2FHWR2G9/+vtUxyxHJFwROiBNtqquBC+V4qjPGsq9E?= =?us-ascii?Q?YR8GJ/pwqR+QeZUnsOTIpuBgBAiyVHTInVTde1a9JbvUMg+NtBRxO/EG+eZr?= =?us-ascii?Q?R6xTCe62GHccDM2Qh/ZW6B9PkgGZEg5I5t3cPY478GJLsfVMiUI3x5LqOl0w?= =?us-ascii?Q?t2jR4qER8DtOfl0m1+q0Qm1fDqTcPgEG2y5QbKIPIVHzafCc7RqH1pRMxhCZ?= =?us-ascii?Q?pgnPsbtFN4egu/GKsqbdvw1Zde1DgVsTnMOe+FLMFTdqHUxHHh3lNhx9bpmY?= =?us-ascii?Q?abtcfcDxx5Uqc47S0EtH/ho2UUmjYe5uTPMzi9p2C6zSmQpioJzboMGxEudx?= =?us-ascii?Q?W9rWcFyKUwYB/mw5DaVOO1sbnrAFzSwk9iJuwq67d25i752fI4S96lAuQ2r7?= =?us-ascii?Q?4DuleOYCer+ZuM2ZWp+AjGcc2PRnKb6c4v/0zNn9WHsPhm9CZbFcsAxybIVB?= =?us-ascii?Q?2GA91MVyyZAtjKHgc0tGZxcjIu0TmZw8CJPqwVDm9xOvmPsoO/C+Y08t7Y4/?= =?us-ascii?Q?We99q6LeXarWawrDT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ydg=; 7:ErEEcYjZiu/C2Rdi9rGw47gN38wid46ADMQ6vTysSjUBakkSVP1x5dfczkUjisaBuks/1CXdqoAD1DhY2uM7srAQ1pwS0BEZNWjNsLvw23hVYRfL/pjYIAKBEjiC3aEjqMlLpQYOLZ3IOfZo7O5o9ZN0/W4mXec8F2hYFtHwtxSowuvKZRBr+np5lDhG9vWaq/MsWC1tNf0AWXm9XllI8OUS4AuqpO/nmTkM93KJu94= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1448; 20:OAWZf4DDznR2bkjIV6OpvOg+g6S3+PFh5WmaiIUaK49zQygaqaI7EXAdTSObBR1r0iqoEX/A1yqfbr5tz8pNFrGUw5rJ7ss2DmQtJavBilsOVKQfOASpPwZ5zrE4EcittGCBRLO+LlwBNmKyjWtpz3ZW8T6jSERFn07AYBxwXB5lHrJK4HtKYSO7bVgFfrh/wwlxLXJS67DxZQ2GKkQQR1YNskaEl8WbOhmB1vpAw5lmhJYQT7zoX5iGV++qvy4n X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Sep 2017 14:14:00.6358 (UTC) 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=[SATLEXCHOV02.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1448 Cc: daniel.vetter@ffwll.ch, dri-devel@lists.freedesktop.org, alexander.deucher@amd.com, daniel.vetter@intel.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP While reviewing I2C in DC identified a few places. Added a couple to the TODO list. 1) Connector info read See get_ext_display_connection_info On some boards the connector information has to be read through a special I2C channel. This line is only used for this purpose and only on driver init. 2) SCDC stuff This should all be reworked to go through DRM's SCDC code. When this is done some unnecessary I2C code can be retired as well. 3) Max TMDS clock read See dal_ddc_service_i2c_query_dp_dual_mode_adaptor This should happen in DRM as well. I haven't checked if there's currently functionality in DRM. If not we can propose something. 4) HDMI retimer programming Some boards have an HDMI retimer that we need to program to pass PHY compliance. 1 & 3 might be a good exercise if someone is looking for things to do. v2: Merge dp_dual_mode_adaptor TODO Signed-off-by: Harry Wentland Acked-by: Daniel Vetter Acked-by: Alex Deucher --- drivers/gpu/drm/amd/display/TODO | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/amd/display/TODO b/drivers/gpu/drm/amd/display/TODO index eea645b102a1..46464678f2b3 100644 --- a/drivers/gpu/drm/amd/display/TODO +++ b/drivers/gpu/drm/amd/display/TODO @@ -62,20 +62,10 @@ TODOs ~ Daniel Vetter -11. Remove existing i2c implementation from DC - - "Similar story for i2c, it uses the kernel's i2c code now, but there's - still a full i2c implementation hidden beneath that in - display/dc/i2caux. Kinda not cool, but imo ok if you fix that - post-merging (perhaps by not including any of this in the linux DC - code in the upstream kernel, but as an aux module in your internal - codebase since there you probably need that, same applies to the edid - parsing DC still does. For both cases I assume that the minimal shim - you need on linux (bit banging and edid parsing isn't rocket since) is - a lot less than the glue code to interface with the dc-provided - abstraction." - ~ Daniel Vetter - +11. Remove dc/i2caux. This folder can be somewhat misleading. It's basically an +overy complicated HW programming function for sendind and receiving i2c/aux +commands. We can greatly simplify that and move it into dc/dceXYZ like other +HW blocks. 12. drm_modeset_lock in MST should no longer be needed in recent kernels * Adopt appropriate locking scheme @@ -89,7 +79,8 @@ moving all your driver state printing into the various atomic_print_state callbacks. There's also plans to expose this stuff in a standard way across all drivers, to make debugging userspace compositors easier across different hw. -15. Move DP/HDMI dual mode adaptors to drm_dp_dual_mode_helper.c. +15. Move DP/HDMI dual mode adaptors to drm_dp_dual_mode_helper.c. See +dal_ddc_service_i2c_query_dp_dual_mode_adaptor. 16. Move to core SCDC helpers (I think those are new since initial DC review). @@ -110,3 +101,7 @@ guilty. stuff just isn't up to the challenges either. We need to figure out something that integrates better with DRM and linux debug printing, while not being useless with filtering output. dynamic debug printing might be an option. + +20. Use kernel i2c device to program HDMI retimer. Some boards have an HDMI +retimer that we need to program to pass PHY compliance. Currently that's +bypassing the i2c device and goes directly to HW. This should be changed.