From patchwork Mon Jul 2 20:00:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 10502315 X-Patchwork-Delegate: agross@codeaurora.org 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 F0C7960362 for ; Mon, 2 Jul 2018 20:00:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E1A8328C57 for ; Mon, 2 Jul 2018 20:00:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D528428C55; Mon, 2 Jul 2018 20:00:45 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7694028C55 for ; Mon, 2 Jul 2018 20:00:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752144AbeGBUAo (ORCPT ); Mon, 2 Jul 2018 16:00:44 -0400 Received: from mail-yb0-f194.google.com ([209.85.213.194]:44183 "EHLO mail-yb0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752069AbeGBUAo (ORCPT ); Mon, 2 Jul 2018 16:00:44 -0400 Received: by mail-yb0-f194.google.com with SMTP id a2-v6so5537987ybe.11 for ; Mon, 02 Jul 2018 13:00:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id; bh=ksFJy3uSKK92XgSiwOnmuEP247DNWCQVhYQyWizcQlY=; b=OnIXkVhSeSwgpP+pDgf8TSlFd/CiAX33zqKJRuk/2jGTeDYTc/1J+uX4ipw+v99E2g kNnirLIZL480ICwvSneohSs0r0pmJoPrRxTyNWmM2kJIrnrpXmGYJhbpBw7Lw251kKGr T+KWIE4S0osZnHrhNaDxWvN66Qv6yVmpiVya8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=ksFJy3uSKK92XgSiwOnmuEP247DNWCQVhYQyWizcQlY=; b=YuZCXLMYjXWo9jqyh5N2um6myOXwVwIBtxyzVKqxfwt67sa5+AkPfl3wwR3+3UgiaA BBmXzNOKeG7RE9fwrlyjI208aVtl21pkUxDtLu5fd5GruAOPMADCASAizi5mDrriTtWM 3boDIRRbTaTtEiJUMBfdNzwU+obE11/lqXssvXCKBvdxEszh/mOk5EZ/54B3SJ1pdSca VlLcLozozeReH6/3ApfDZQcfV3jlng6ErSoiYP7czQEGHTjpU8vRrdrYcc0KFHrqlPhe IHnYET2D1mQZIEZeImU2Yjm6MyqnKlFSenm9khIZ8c5pGZ6c8PBMqf65bSD5Ka9VMqtT /U+Q== X-Gm-Message-State: APt69E35DzYDsVPfC0JYttOc4vBQ3m5p1SJ3XzocyBe7Zqn+GszMGolE kxwaJSXLRMdsx72pENBFWQJb2Q== X-Google-Smtp-Source: ADUXVKIiNduIei+OAWKDTX7y/nbnYRJ36UfobcLtnz2bt3o+rgNFFJ0JfiH19sBzln602O6IRo8Fjg== X-Received: by 2002:a5b:3ce:: with SMTP id t14-v6mr14322863ybp.197.1530561642954; Mon, 02 Jul 2018 13:00:42 -0700 (PDT) Received: from rosewood.cam.corp.google.com ([2620:0:1013:11:ad55:b1db:adfe:3b9f]) by smtp.gmail.com with ESMTPSA id l14-v6sm6328196ywi.35.2018.07.02.13.00.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Jul 2018 13:00:42 -0700 (PDT) From: Sean Paul To: dri-devel@lists.freedesktop.org, robdclark@gmail.com, linux-arm-msm@vger.kernel.org, daniel@fooishbar.org Cc: wayland-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, Sean Paul Subject: [PATCH] drm/msm: Disable mdp5 crtc when there are no active planes Date: Mon, 2 Jul 2018 16:00:17 -0400 Message-Id: <20180702200041.248415-1-seanpaul@chromium.org> X-Mailer: git-send-email 2.18.0.399.gad0ab374a1-goog Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Unlike other compositors, we don't get a crtc disable from weston when the cable is unplugged. As such, when the cable is re-plugged the kernel doesn't detect an enable/mode change and initiates a simple plane update instead of a modeset. This patch clears the mode when all planes are off. Signed-off-by: Sean Paul --- Sorry for the wide distribution, I'm not 100% on whether this is the right place to fix this. Is this expected behavior from weston? Once we have solid fill support, it seems reasonable that a crtc might be left on if no planes are active (for blanking the screen, etc). However, hotplug is currently borked, so I don't want to just leave it as-is if this should be handled in the kernel. Suggestions welcome! Sean drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c b/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c index 63dcc39b5efd..e89e46a4014e 100644 --- a/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c +++ b/drivers/gpu/drm/msm/disp/mdp5/mdp5_crtc.c @@ -645,7 +645,7 @@ static int mdp5_crtc_atomic_check(struct drm_crtc *crtc, /* bail out early if there aren't any planes */ if (!cnt) - return 0; + return drm_atomic_set_mode_for_crtc(state, NULL); hw_cfg = mdp5_cfg_get_hw_config(mdp5_kms->cfg);