From patchwork Thu Jul 18 01:42:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lyude Paul X-Patchwork-Id: 11048367 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 07BE1138B for ; Thu, 18 Jul 2019 01:44:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E883128746 for ; Thu, 18 Jul 2019 01:44:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D83662878F; Thu, 18 Jul 2019 01:44:05 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED 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 B63CB28746 for ; Thu, 18 Jul 2019 01:44:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3E1CF6E2C0; Thu, 18 Jul 2019 01:44:02 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by gabe.freedesktop.org (Postfix) with ESMTPS id AB7766E2C0; Thu, 18 Jul 2019 01:44:00 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A569AA70E; Thu, 18 Jul 2019 01:43:58 +0000 (UTC) Received: from whitewolf.redhat.com (ovpn-120-112.rdu2.redhat.com [10.10.120.112]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5ECE219C67; Thu, 18 Jul 2019 01:43:50 +0000 (UTC) From: Lyude Paul To: dri-devel@lists.freedesktop.org Date: Wed, 17 Jul 2019 21:42:23 -0400 Message-Id: <20190718014329.8107-1-lyude@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Thu, 18 Jul 2019 01:43:59 +0000 (UTC) Subject: [Intel-gfx] [PATCH 00/26] DP MST Refactors + debugging tools + suspend/resume reprobing X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sam Ravnborg , David Airlie , nouveau@lists.freedesktop.org, Alexandru Gheorghe , Karol Herbst , Bhawanpreet Lakha , Huang Rui , Laurent Pinchart , Anthony Koo , Markus Elfring , "David \(ChunMing\) Zhou" , Thomas Hellstrom , Deepak Rawat , Yu Zhao , Harry Wentland , David Francis , amd-gfx@lists.freedesktop.org, Maxime Ripard , Ben Skeggs , Thierry Reding , Harry Wentland , Mauro Rossi , Andrey Grodzovsky , Leo Li , intel-gfx@lists.freedesktop.org, Emily Deng , Dhinakaran Pandiyan , Thomas Gleixner , Evan Quan , Felix Kuehling , xinhui pan , =?utf-8?q?Michel_D=C3=A4nzer?= , linux-kernel@vger.kernel.org, Nicholas Kazlauskas , Ilia Mirkin , Alex Deucher , Colin Ian King , Rex Zhu , =?utf-8?q?Christian_K=C3=B6nig?= , Hawking Zhang Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP This is the large series for adding MST suspend/resume reprobing that I've been working on for quite a while now. In addition, I: - Refactored and cleaned up any code I ended up digging through in the process of understanding how some parts of these helpers worked. - Added some debugging tools along the way that I ended up needing to figure out some issues in my own code Note that there's still one important part of this process missing that's not included in this patch series: EDID reprobing, which I believe Stanislav Lisovskiy from Intel is currently working on. The main purpose of this series is to fix the issue of the in-memory topology state (e.g. connectors connected to an MST hub, branch devices, etc.) going out of sync if a topology connected to a connector is swapped out with a different topology while the system is resumed, or while the device housing said connector is in runtime suspend. As well, the debugging tools that are added in this include: - A limited debugging utility for dumping the list of topology references on an MST port or branch connector whose topology reference count has reached 0 - Sideband down request dumping, along with some basic selftests for testing our encoding/decoding functions Cc: Juston Li Cc: Imre Deak Cc: Ville Syrjälä Cc: Harry Wentland Lyude Paul (26): drm/dp_mst: Move link address dumping into a function drm/dp_mst: Destroy mstbs from destroy_connector_work drm/dp_mst: Move test_calc_pbn_mode() into an actual selftest drm/print: Add drm_err_printer() drm/dp_mst: Add sideband down request tracing + selftests drm/dp_mst: Move PDT teardown for ports into destroy_connector_work drm/dp_mst: Get rid of list clear in drm_dp_finish_destroy_port() drm/dp_mst: Refactor drm_dp_send_enum_path_resources drm/dp_mst: Remove huge conditional in drm_dp_mst_handle_up_req() drm/dp_mst: Constify guid in drm_dp_get_mst_branch_by_guid() drm/dp_mst: Refactor drm_dp_mst_handle_up_req() drm/dp_mst: Refactor drm_dp_mst_handle_down_rep() drm/dp_mst: Destroy topology_mgr mutexes drm/dp_mst: Cleanup drm_dp_send_link_address() a bit drm/dp_mst: Refactor pdt setup/teardown, add more locking drm/dp_mst: Rename drm_dp_add_port and drm_dp_update_port drm/dp_mst: Remove lies in {up,down}_rep_recv documentation drm/dp_mst: Handle UP requests asynchronously drm/dp_mst: Protect drm_dp_mst_port members with connection_mutex drm/dp_mst: Don't forget to update port->input in drm_dp_mst_handle_conn_stat() drm/nouveau: Don't grab runtime PM refs for HPD IRQs drm/amdgpu: Iterate through DRM connectors correctly drm/amdgpu/dm: Resume short HPD IRQs before resuming MST topology drm/dp_mst: Add basic topology reprobing when resuming drm/dp_mst: Also print unhashed pointers for malloc/topology references drm/dp_mst: Add topology ref history tracking for debugging drivers/gpu/drm/Kconfig | 14 + .../gpu/drm/amd/amdgpu/amdgpu_connectors.c | 13 +- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 20 +- drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 5 +- drivers/gpu/drm/amd/amdgpu/amdgpu_encoders.c | 40 +- drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c | 5 +- drivers/gpu/drm/amd/amdgpu/dce_v10_0.c | 34 +- drivers/gpu/drm/amd/amdgpu/dce_v11_0.c | 34 +- drivers/gpu/drm/amd/amdgpu/dce_v6_0.c | 40 +- drivers/gpu/drm/amd/amdgpu/dce_v8_0.c | 34 +- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 41 +- .../drm/amd/display/amdgpu_dm/amdgpu_dm_irq.c | 10 +- drivers/gpu/drm/drm_dp_mst_topology.c | 1592 +++++++++++++---- .../gpu/drm/drm_dp_mst_topology_internal.h | 24 + drivers/gpu/drm/drm_print.c | 6 + drivers/gpu/drm/i915/display/intel_dp.c | 3 +- drivers/gpu/drm/nouveau/dispnv50/disp.c | 6 +- drivers/gpu/drm/nouveau/nouveau_connector.c | 33 +- drivers/gpu/drm/selftests/Makefile | 2 +- .../gpu/drm/selftests/drm_modeset_selftests.h | 2 + .../drm/selftests/test-drm_dp_mst_helper.c | 248 +++ .../drm/selftests/test-drm_modeset_common.h | 2 + include/drm/drm_dp_mst_helper.h | 127 +- include/drm/drm_print.h | 17 + 24 files changed, 1846 insertions(+), 506 deletions(-) create mode 100644 drivers/gpu/drm/drm_dp_mst_topology_internal.h create mode 100644 drivers/gpu/drm/selftests/test-drm_dp_mst_helper.c