From patchwork Fri Jan 22 22:07:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Harry Wentland X-Patchwork-Id: 8093681 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 4A1C89F744 for ; Fri, 22 Jan 2016 22:08:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 56203205BC for ; Fri, 22 Jan 2016 22:08:37 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 9713C205BB for ; Fri, 22 Jan 2016 22:08:35 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BA25272157; Fri, 22 Jan 2016 14:08:34 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from na01-bl2-obe.outbound.protection.outlook.com (mail-bl2on0072.outbound.protection.outlook.com [65.55.169.72]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9490772157 for ; Fri, 22 Jan 2016 14:08:32 -0800 (PST) Received: from BY2PR12CA0026.namprd12.prod.outlook.com (10.160.121.36) by BY2PR12MB0709.namprd12.prod.outlook.com (10.163.113.19) with Microsoft SMTP Server (TLS) id 15.1.365.19; Fri, 22 Jan 2016 22:08:29 +0000 Received: from CO1NAM03FT048.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::205) by BY2PR12CA0026.outlook.office365.com (2a01:111:e400:2c84::36) with Microsoft SMTP Server (TLS) id 15.1.390.13 via Frontend Transport; Fri, 22 Jan 2016 22:08:30 +0000 Authentication-Results: spf=none (sender IP is 165.204.84.222) 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 atltwp02.amd.com (165.204.84.222) by CO1NAM03FT048.mail.protection.outlook.com (10.152.81.49) with Microsoft SMTP Server id 15.1.390.12 via Frontend Transport; Fri, 22 Jan 2016 22:08:29 +0000 X-WSS-ID: 0O1DK62-08-AL3-02 X-M-MSG: Received: from satlvexedge02.amd.com (satlvexedge02.amd.com [10.177.96.29]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by atltwp02.amd.com (Axway MailGate 5.3.1) with ESMTPS id 2D792D23026 for ; Fri, 22 Jan 2016 17:08:26 -0500 (EST) Received: from SATLEXDAG03.amd.com (10.181.40.7) by SATLVEXEDGE02.amd.com (10.177.96.29) with Microsoft SMTP Server (TLS) id 14.3.195.1; Fri, 22 Jan 2016 16:08:32 -0600 Received: from STOREXDAG02.amd.com (10.1.13.11) by satlexdag03.amd.com (10.181.40.7) with Microsoft SMTP Server (TLS) id 14.3.266.1; Fri, 22 Jan 2016 17:08:26 -0500 Received: from cnhwentlanub.amd.com (172.29.225.36) by storexdag02.amd.com (10.1.13.11) with Microsoft SMTP Server id 14.3.266.1; Fri, 22 Jan 2016 17:08:25 -0500 From: Harry Wentland To: Subject: [PATCH 3/5] drm/dp/mst: change MST detection scheme Date: Fri, 22 Jan 2016 17:07:27 -0500 Message-ID: <1453500449-9224-4-git-send-email-harry.wentland@amd.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1453500449-9224-1-git-send-email-harry.wentland@amd.com> References: <1453500449-9224-1-git-send-email-harry.wentland@amd.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:165.204.84.222; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(428002)(189002)(199003)(1096002)(47776003)(5003600100002)(1220700001)(97736004)(5008740100001)(2950100001)(36756003)(110136002)(53416004)(2906002)(189998001)(4326007)(23676002)(92566002)(586003)(77096005)(50986999)(450100001)(101416001)(5820100001)(105586002)(76176999)(87936001)(86362001)(19580405001)(33646002)(19580395003)(106466001)(2351001)(50466002)(229853001)(50226001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR12MB0709; H:atltwp02.amd.com; FPR:; SPF:None; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2PR12MB0709; 2:q98RCeKZvR5UAxeMXALN3tsQX8J3NI2Y5y14XkzH9HlrDvcMRQ1lBtrkry0p/ULk+YKIODmTA8VaBNUEUEYBaM+HHc62G+3xgW89diMYC31BCxyCPCGjyTh7lKfKVWrtIKLKfRuMRgalBNpyvPYYIg==; 3:TVsrgW2MJLAISHWrSfWdseaqHsPA002dKAbdh32MuaZkVebT5paZM540iFozeDeBbuvx0DIPohM3GnP3heB1eFVGhEW5KdrMGOptJwNQBRCjsQyvWAiGPZ3Fbv0IAkFu0OgPm6Cil8T7D1QpeVmtNXFPnH9oOihvEpUQmhqrJv0hsz3jj1fu56NZrO5kHDOF5u+iWTOkN3rBWsn6EpiDd2lYqXRrWzBdxuYTYXmCdfs=; 25:hFYJbzux//6jppvZhhJ+1CJzqO9p5byIHOMEEJpsUndb6oseR4VtJ8XZQ0ME/nOGnTZGUOwHTowrTK45CXT73Awox8Iue0SWEW2LIz3ohCAXjzrmb5sxfu04aRFn193S9ZSHi7nP6V8/OM8TSsrFm+nuoMkVe5bidjSxn3a4Ban870AEatMxemhKfvxqibROUvByiY+ZAq5u57S1QJMByYDsd9LgiWg9+oOjJELuTj70vNG648ZSUr6r+Dug/A6V X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY2PR12MB0709; X-MS-Office365-Filtering-Correlation-Id: 5bddf3a3-64e8-44b5-c97f-08d323788f7a X-Microsoft-Exchange-Diagnostics: 1; BY2PR12MB0709; 20:z0K2iL/Qyg1Ru1FY6THybmZ8TFookhMcLFRLA2u0LEAO7MvJl1Ts29EbrJ2YlRB0hGqcifV8XXHv+R4GE7AkT6JHawN2zsckNRj/ES/DdKYROSeo1ao9fhP/RaYwVkm1mQdg8dYtmS55+bi3ZAg+0KfMH8QzH3jfZClWeL91lRWMzW6T1GJIATn5d20PPco5KrRYHpMWHTZUL7TNH4MjOmE2cDKjo6BzrPxTsvj99X1TWns5AVx1CWyV34JbeEI+tU8kPrMLKBv3sCgUeQe7P6luw2J7hT6jW/QY5x1wQfAseI8u+rhepI4ONYDnqY/DYfu4ZdtAVPiPDZRtN4/TwWtyMnDXFFZD96bm1+B39a29426E8Ac2Ljbfi90rB8hXHjdj8fBh983Rpw0aIjh2Z9Tn8HIe+8dH/Mdhjw0hWv/xikVFJ0pQfmyNvctpW83ST/BQu4pExJtF9yD7DyBKqZciz4yub9bcMexIVCW6GiZHTXMGozJPoKEX7+01L9WT X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(13023025)(8121501046)(13015025)(13024025)(520078)(13018025)(5005006)(13017025)(3002001)(10201501046); SRVR:BY2PR12MB0709; BCL:0; PCL:0; RULEID:; SRVR:BY2PR12MB0709; X-Microsoft-Exchange-Diagnostics: 1; BY2PR12MB0709; 4:PR6A4ysXi68p22k0MH1Bt/IASUwCljIR33HTu9/q3H38ZXy7FN9VcabXYfq3rGPIvyUmKUjnRYNxi5xa3fFp1tgipZIhmIcKdaG3IJsNtzlt3p7Prdw218opD2B0JIdjprYWVne1weduIlADDhkMcivriAGdgsQxZA2DpBY8pNgbURuH62qIF4E2bBJZHDb5qBaBJwWAOjBNyVmzofmETcF7IzfASDWbRGtcspMQJrqtwirlKSTjFKrgwfOqBSVmYCw6NTNJdE954kGKdSibUxV2glAMsBqFgHQH2qCop43Kg1ipOVXw0slIy2zeboPAr58Jc/8qWwLRn2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R2STtmmzkQ==; 24:usKzcYtJqR2H7PNoScp5Dmtjk0S9mz1/fLQnIy+hYWPYIY7nDKc8BEcxrfn9ic8q44c4VQBG/8AiI8jhHLIm37ZVn5ohlcJ5Y+Z7TCuCgkU=; 20:OVX6lp1au2n58aUSXibjPMqyx/dbZnIxuzqZhGVOnRKtYW5o1fjnYXh22gAkQ3/cCuf4B6ui82DpFG6EXbvW3y552YYvSUIvRuP8f+ui+y9PDtTI0wxwhfrSzV/e2jcDYpm5yub3fd4ni6DypIJms4JeuPDfqQoYT1155zSENLjXYkRgjlhLOtTzRDWNL+Xo02l5TrhjJPMDvILxdz7M/0qpu/6HayvIJKxlDSqIwY7ZaWp5owepdwrogEeYyhoS SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jan 2016 22:08:29.6795 (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.222]; Helo=[atltwp02.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR12MB0709 Cc: Mykola Lysenko 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-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Mykola Lysenko 1. Get edid for all connected MST displays, not only on logical ports, in the same thread as MST topology detection is done: There are displays that have branches inside w/o logical ports. So in case another SST display connected downstream system can end-up in situation when 3 DOWN requests sent: two for ‘remote i2c read’ and one for ‘enum path resources’, making slots full. 2. Call notification callback in one place in the end of topology discovery/update: This is done to reduce number of events sent to userspace in case complex topology discovery is going, adding multiple number of connectors; 3. Remove notification callback call from short pulse interrupt processing function: This is done in order not to block interrupt processing function, in case any MST request will be made from it. Notification will be send from topology discovery/update work item. Signed-off-by: Mykola Lysenko Reviewed-by: Harry Wentland Acked-by: Alex Deucher --- drivers/gpu/drm/drm_dp_mst_topology.c | 37 ++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c index 041597b7a7c6..052c20ca35ee 100644 --- a/drivers/gpu/drm/drm_dp_mst_topology.c +++ b/drivers/gpu/drm/drm_dp_mst_topology.c @@ -1130,13 +1130,11 @@ static void drm_dp_add_port(struct drm_dp_mst_branch *mstb, drm_dp_put_port(port); goto out; } - if (port->port_num >= DP_MST_LOGICAL_PORT_0) { - port->cached_edid = drm_get_edid(port->connector, &port->aux.ddc); - drm_mode_connector_set_tile_property(port->connector); - } + + drm_mode_connector_set_tile_property(port->connector); + (*mstb->mgr->cbs->register_connector)(port->connector); } - out: /* put reference to this port */ drm_dp_put_port(port); @@ -1161,9 +1159,9 @@ static void drm_dp_update_port(struct drm_dp_mst_branch *mstb, port->ddps = conn_stat->displayport_device_plug_status; if (old_ddps != port->ddps) { + dowork = true; if (port->ddps) { drm_dp_check_port_guid(mstb, port); - dowork = true; } else { port->guid_valid = false; port->available_pbn = 0; @@ -1271,8 +1269,13 @@ static void drm_dp_check_and_send_link_address(struct drm_dp_mst_topology_mgr *m if (port->input) continue; - if (!port->ddps) + if (!port->ddps) { + if (port->cached_edid) { + kfree(port->cached_edid); + port->cached_edid = NULL; + } continue; + } if (!port->available_pbn) drm_dp_send_enum_path_resources(mgr, mstb, port); @@ -1283,6 +1286,12 @@ static void drm_dp_check_and_send_link_address(struct drm_dp_mst_topology_mgr *m drm_dp_check_and_send_link_address(mgr, mstb_child); drm_dp_put_mst_branch_device(mstb_child); } + } else if (port->pdt == DP_PEER_DEVICE_SST_SINK || + port->pdt == DP_PEER_DEVICE_DP_LEGACY_CONV) { + if (!port->cached_edid) { + port->cached_edid = + drm_get_edid(port->connector, &port->aux.ddc); + } } } } @@ -1302,6 +1311,8 @@ static void drm_dp_mst_link_probe_work(struct work_struct *work) drm_dp_check_and_send_link_address(mgr, mstb); drm_dp_put_mst_branch_device(mstb); } + + (*mgr->cbs->hotplug)(mgr); } static bool drm_dp_validate_guid(struct drm_dp_mst_topology_mgr *mgr, @@ -1558,7 +1569,6 @@ static void drm_dp_send_link_address(struct drm_dp_mst_topology_mgr *mgr, for (i = 0; i < txmsg->reply.u.link_addr.nports; i++) { drm_dp_add_port(mstb, mgr->dev, &txmsg->reply.u.link_addr.ports[i]); } - (*mgr->cbs->hotplug)(mgr); } } else { mstb->link_address_sent = false; @@ -2232,8 +2242,6 @@ static int drm_dp_mst_handle_up_req(struct drm_dp_mst_topology_mgr *mgr) drm_dp_update_port(mstb, &msg.u.conn_stat); DRM_DEBUG_KMS("Got CSN: pn: %d ldps:%d ddps: %d mcs: %d ip: %d pdt: %d\n", msg.u.conn_stat.port_number, msg.u.conn_stat.legacy_device_plug_status, msg.u.conn_stat.displayport_device_plug_status, msg.u.conn_stat.message_capability_status, msg.u.conn_stat.input_port, msg.u.conn_stat.peer_device_type); - (*mgr->cbs->hotplug)(mgr); - } else if (msg.req_type == DP_RESOURCE_STATUS_NOTIFY) { drm_dp_send_up_ack_reply(mgr, mgr->mst_primary, msg.req_type, seqno, false); if (!mstb) @@ -2320,10 +2328,6 @@ enum drm_connector_status drm_dp_mst_detect_port(struct drm_connector *connector case DP_PEER_DEVICE_SST_SINK: status = connector_status_connected; - /* for logical ports - cache the EDID */ - if (port->port_num >= 8 && !port->cached_edid) { - port->cached_edid = drm_get_edid(connector, &port->aux.ddc); - } break; case DP_PEER_DEVICE_DP_LEGACY_CONV: if (port->ldps) @@ -2378,10 +2382,7 @@ struct edid *drm_dp_mst_get_edid(struct drm_connector *connector, struct drm_dp_ if (port->cached_edid) edid = drm_edid_duplicate(port->cached_edid); - else { - edid = drm_get_edid(connector, &port->aux.ddc); - drm_mode_connector_set_tile_property(connector); - } + port->has_audio = drm_detect_monitor_audio(edid); drm_dp_put_port(port); return edid;