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: 10502317 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 62E7D60284 for ; Mon, 2 Jul 2018 20:00:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5431028C57 for ; Mon, 2 Jul 2018 20:00:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 482D928C6E; Mon, 2 Jul 2018 20:00:49 +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 4F03028C57 for ; Mon, 2 Jul 2018 20:00:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 908516E339; Mon, 2 Jul 2018 20:00:45 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yb0-x241.google.com (mail-yb0-x241.google.com [IPv6:2607:f8b0:4002:c09::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id 72DA36E4D1 for ; Mon, 2 Jul 2018 20:00:44 +0000 (UTC) Received: by mail-yb0-x241.google.com with SMTP id x15-v6so5544649ybm.2 for ; Mon, 02 Jul 2018 13:00:44 -0700 (PDT) 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=R1CgN93hqBFWKDe8aFH2OoPPzMNgGBJipLKb/qPRQAQFvdLy89IZqO2M42rQzy6yJH sQfb3FQF3tSiUrLrtQJdpIUQHftijSpmNnrDtoUO2ORDcZOmqTDpdFLFfu7nefSYNFlk qHbedcME1MibCeLGWGqC+tVsMi5hRXusamoJdr97mKxDTQr7K1frpKMgm68lvBIZQc68 FkFmprUlGbwTxEKMTr8vp6TYDHufmSF6baxyvrbK0RMzTq7yb/2DzZ0dmEP7vo6A3uBk u+I6xAdCtooFPR8LmjJS9v5MMPCEFNtmB/2v/n2fgc9l8rrYYmAUl+/a62BcGyssVAZt Djtg== X-Gm-Message-State: APt69E2gjyHEyUTuD05jjk2wxUaHsMV3jFN3UDF2dSQ3JTNFntqZA4KY a4Nxpy1cqoy1B0H7EEu0lltfTHJOUgk= 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 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 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: freedreno@lists.freedesktop.org, wayland-devel@lists.freedesktop.org MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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);