Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp38705imm; Thu, 4 Oct 2018 17:30:50 -0700 (PDT) X-Google-Smtp-Source: ACcGV60+0aAa3dXSqeMGj5ZuSAg74iIBKYimV6EMtyEBjwBr3q1CWaF9c5eFGaC6KX7MuUw7/j7L X-Received: by 2002:a63:1c6:: with SMTP id 189-v6mr7917610pgb.136.1538699450623; Thu, 04 Oct 2018 17:30:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538699450; cv=none; d=google.com; s=arc-20160816; b=EwGv4d0NiTzffdXLCjhhyiLp5OEk6Z7PhHGVfrFpaF9oFXAUG+W84Bp8ZvyIDyT0E1 Z/vKbz8iAbAZ2uHRWeTsge3RI9t0G+SM1GmqVKbYhQDWTA1NmsHKcY7hB8ND6fpXqE8x lNPt/PFurNbgBDCKwNBeZs40N2Zv+pRqtaQUi4fkTf05aAhK1xFBdD1nGq7B7G1ynZ8c mK34aDHPFKYGUyuaAQSM6ShgUeOFvcI3M2YynOhILpVbf0xtI+cDopWogWsmX8Y+qgcV DCTrZ/ZjO/XlcGEwBrmhjuiYzwwIYnKUUif2FaRj3QObTIenSpWOGleGR7aSyGJXCwTx YZcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=ihyv04Ios44jK8eQTGmclUVkV1veyO1dm1h9ujrCMeM=; b=dijXusKk7dkrmBfWVn06DEmlJK/QRVh6SNtVO2RlDE0/latf3rWGfxvg3HNDojTwXj xWeIxGyjFUuYIyxGYX1Ti14iQlblPBUcpHdf6lHz+yGYT5EpYT7Ntwe9Qd4zam8FOSM2 lyJOOyzTJxJchM5YgvnZ9J8x1UgvuTJ0rpo50AzvmaWRYgsOEzpPHSIn3T1mPuZIRXzk YKlU8kdqrmu7EaakzMEyMR3DQV49Wc/BddtUAMu7AMdBDlwsKEb34cstUvWFuU+dYnk8 LKf0Wb3axANQhnJcDxiaIzF7w1BPlfBuYvgBK0yxHdGTic7XvZOidKMotT4AX/pRr1X9 frYg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b65-v6si2208726pfa.92.2018.10.04.17.30.35; Thu, 04 Oct 2018 17:30:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727690AbeJEH00 (ORCPT + 99 others); Fri, 5 Oct 2018 03:26:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54856 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727615AbeJEH0Y (ORCPT ); Fri, 5 Oct 2018 03:26:24 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 816C6C04B2CC; Fri, 5 Oct 2018 00:30:20 +0000 (UTC) Received: from malachite.bss.redhat.com (dhcp-10-20-1-11.bss.redhat.com [10.20.1.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5A66318BAC; Fri, 5 Oct 2018 00:30:19 +0000 (UTC) From: Lyude Paul To: nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org Cc: Daniel Vetter , Jani Nikula , stable@vger.kernel.org, Joonas Lahtinen , Rodrigo Vivi , David Airlie , linux-kernel@vger.kernel.org Subject: [PATCH v4 4/5] drm/i915: Skip vcpi allocation for MSTB ports that are gone Date: Thu, 4 Oct 2018 20:29:53 -0400 Message-Id: <20181005002956.7317-5-lyude@redhat.com> In-Reply-To: <20181005002956.7317-1-lyude@redhat.com> References: <20181005002956.7317-1-lyude@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Fri, 05 Oct 2018 00:30:20 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since we need to be able to allow DPMS on->off prop changes after an MST port has disappeared from the system, we need to be able to make sure we can compute a config for the resulting atomic commit. Currently this is impossible when the port has disappeared, since the VCPI slot searching we try to do in intel_dp_mst_compute_config() will fail with -EINVAL. Since the only commits we want to allow on no-longer-present MST ports are ones that shut off display hardware, we already know that no VCPI allocations are needed. So, hardcode the VCPI slot count to 0 when intel_dp_mst_compute_config() is called on an MST port that's gone. Signed-off-by: Lyude Paul Cc: stable@vger.kernel.org --- drivers/gpu/drm/i915/intel_dp_mst.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c b/drivers/gpu/drm/i915/intel_dp_mst.c index fcb9b87b9339..a366f32b048a 100644 --- a/drivers/gpu/drm/i915/intel_dp_mst.c +++ b/drivers/gpu/drm/i915/intel_dp_mst.c @@ -42,7 +42,7 @@ static bool intel_dp_mst_compute_config(struct intel_encoder *encoder, to_intel_connector(conn_state->connector); struct drm_atomic_state *state = pipe_config->base.state; int bpp; - int lane_count, slots; + int lane_count, slots = 0; const struct drm_display_mode *adjusted_mode = &pipe_config->base.adjusted_mode; int mst_pbn; bool reduce_m_n = drm_dp_has_quirk(&intel_dp->desc, @@ -76,11 +76,16 @@ static bool intel_dp_mst_compute_config(struct intel_encoder *encoder, mst_pbn = drm_dp_calc_pbn_mode(adjusted_mode->crtc_clock, bpp); pipe_config->pbn = mst_pbn; - slots = drm_dp_atomic_find_vcpi_slots(state, &intel_dp->mst_mgr, - connector->port, mst_pbn); - if (slots < 0) { - DRM_DEBUG_KMS("failed finding vcpi slots:%d\n", slots); - return false; + if (!connector->mst_port_gone) { + slots = drm_dp_atomic_find_vcpi_slots(state, + &intel_dp->mst_mgr, + connector->port, + mst_pbn); + if (slots < 0) { + DRM_DEBUG_KMS("failed finding vcpi slots:%d\n", + slots); + return false; + } } intel_link_compute_m_n(bpp, lane_count, -- 2.17.1