From patchwork Fri Nov 16 18:42:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 10686841 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 5441917EE for ; Fri, 16 Nov 2018 18:44:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4612D2895F for ; Fri, 16 Nov 2018 18:44:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3A03D2D804; Fri, 16 Nov 2018 18:44:14 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 D0AC52D7FE for ; Fri, 16 Nov 2018 18:44:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727539AbeKQE5p (ORCPT ); Fri, 16 Nov 2018 23:57:45 -0500 Received: from mail-yb1-f196.google.com ([209.85.219.196]:38341 "EHLO mail-yb1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729377AbeKQE5o (ORCPT ); Fri, 16 Nov 2018 23:57:44 -0500 Received: by mail-yb1-f196.google.com with SMTP id u103-v6so10148061ybi.5 for ; Fri, 16 Nov 2018 10:44:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poorly.run; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=s6yHy4JTTvRzVyOH69HE64SrLSVM0dGADB8JcCUJY3c=; b=ADzfxePueueX1ui0A5rftrGoNjASY9JJ6Y0mzq9KY8fu3zaUcaWHJ3NcCh5evkYEAh DlMsAD0Uz7vy9Ah5RdbfitSGQiI7cO1Da1Qp5hD2ZrFzas92xk7V6B8tQg3lASj/7DTw ca+EhmWY71PHF/PZxrNhV+KuVJPN0OJk7FGMgJ2SLMESknLKLYDmbC0gY8LDasE3puRh UItrw/ldCdSYKBvnNScYZNB5mf6BRUKkHWaijgUR/Cj8+bqX1niiDXy40XQj7edk1YJ7 jp3U2DebUOmQx5gJiEsgRdMOw7jjW7bfq9iRCZGMoxxJ8SlB6KRalwJGef6Hoy4/UISU hIPw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=s6yHy4JTTvRzVyOH69HE64SrLSVM0dGADB8JcCUJY3c=; b=rb+9a9VPFjMpz08OCcf9ctDwAzs5jqIMapn44XKYH+KNg9314xMJpDpyBV+RQKILZL PSyUib+7jEgZIPTNOKKLEGHe3Jy4ubT/38YR+J0n+lZvDmeyw3eiFQSQ9w9AAVyOXM9q XohaYgf+Wt2mBTKI5wfUnJVb+ICfJz0WDMBztsdpGM1BmJzwZW3c0054g11ipq/7Nawh 8gc/LKkJgE9YJEDavmJF0wHrdhAFuZrGYmfV97c3JmHZWmcbHCw2K8qifyYC2x6/vsxK eif1xPI9T3fP8behSH1LXTx1vmc7Nvwmumu8gaIcyi8fAnU5Eq/lYvnO6j71f9K0tuf5 fckw== X-Gm-Message-State: AGRZ1gL32aJBhPZoZvViQCXRn3WZm3ceMOuNPDFy5lY4JbqVi9dGZm9g xoPKW1UgRgzUu/HkLzv8n3YGfA== X-Google-Smtp-Source: AJdET5ee3k0G3g/LjIEC8NRtCRnNQGK7K/8bBt9fT9DtK/YmSrQWRH36S6HJo7A7G4ykYCxaBuT5lw== X-Received: by 2002:a25:445:: with SMTP id 66-v6mr11268347ybe.372.1542393852256; Fri, 16 Nov 2018 10:44:12 -0800 (PST) Received: from rosewood.cam.corp.google.com ([2620:0:1013:11:ad55:b1db:adfe:3b9f]) by smtp.gmail.com with ESMTPSA id b144sm5359134ywa.33.2018.11.16.10.44.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Nov 2018 10:44:11 -0800 (PST) From: Sean Paul To: dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org Cc: robdclark@gmail.com, jsanka@codeaurora.org, Sean Paul Subject: [PATCH v2 16/24] drm/msm: dpu: Add modeset lock checks where applicable Date: Fri, 16 Nov 2018 13:42:26 -0500 Message-Id: <20181116184238.170034-17-sean@poorly.run> X-Mailer: git-send-email 2.19.1.1215.g8438c0b245-goog In-Reply-To: <20181116184238.170034-1-sean@poorly.run> References: <20181116184238.170034-1-sean@poorly.run> MIME-Version: 1.0 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 From: Sean Paul Add modeset lock checks to functions that could be called outside the core atomic stack. Changes in v2: - None Signed-off-by: Sean Paul Reviewed-by: Jeykumar Sankaran --- drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 2 ++ drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 1 + 2 files changed, 3 insertions(+) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c index a008a87a8113..cd0a0bea4335 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c @@ -284,6 +284,8 @@ enum dpu_intf_mode dpu_crtc_get_intf_mode(struct drm_crtc *crtc) return INTF_MODE_NONE; } + WARN_ON(!drm_modeset_is_locked(&crtc->mutex)); + /* TODO: Returns the first INTF_MODE, could there be multiple values? */ drm_for_each_encoder_mask(encoder, crtc->dev, crtc->state->encoder_mask) return dpu_encoder_get_intf_mode(encoder); diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c index 64134d619748..5104fc01147e 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c @@ -358,6 +358,7 @@ void dpu_kms_encoder_enable(struct drm_encoder *encoder) if (funcs && funcs->commit) funcs->commit(encoder); + WARN_ON(!drm_modeset_is_locked(&dev->mode_config.connection_mutex)); drm_for_each_crtc(crtc, dev) { if (!(crtc->state->encoder_mask & drm_encoder_mask(encoder))) continue;