From patchwork Fri Nov 30 22:00:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sean Paul X-Patchwork-Id: 10707301 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 C86DD17D5 for ; Fri, 30 Nov 2018 22:00:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BA0E0302BC for ; Fri, 30 Nov 2018 22:00:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AE5A7302BF; Fri, 30 Nov 2018 22:00:15 +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.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 2313C302BC for ; Fri, 30 Nov 2018 22:00:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726078AbeLAJK4 (ORCPT ); Sat, 1 Dec 2018 04:10:56 -0500 Received: from mail-yw1-f68.google.com ([209.85.161.68]:36974 "EHLO mail-yw1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725749AbeLAJK4 (ORCPT ); Sat, 1 Dec 2018 04:10:56 -0500 Received: by mail-yw1-f68.google.com with SMTP id h193so2918947ywc.4 for ; Fri, 30 Nov 2018 14:00:13 -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=iPem0/up88U/eJlDHo14NO6YZ/y0ZQkIrbaGNWNSj2I=; b=dfwcOrZTvB4FaDOTSgalWWo3BIT4WBozEVC8nJowqWaPWVClwTD8pK10QD8YL8r9la HBebEg969kp+iELrtjGoCaG03nt/lDYrkUXzKPUEr6SUt8eW138cP8xKbPo+O0yoWqDm e3lzH2vawJRYMbmStUNaxuqus6zhfNiVx99H/LAMyEupFiBXr8xp08xproA0hNNcyn5/ AE17Wp1fZ8CJuOmW5j9CIXN9pECg07SyCA965VC6TSy51zcLQWhF8xh/E9DE0iSsw6wp LOt7faCrPnqXgb+6K80SZeoDloH1GKhVr+H0H8ponMD64RmHUyZJmK0xDyyMLSrguFdI XupA== 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=iPem0/up88U/eJlDHo14NO6YZ/y0ZQkIrbaGNWNSj2I=; b=rlVlIyCesoHK+2US6mL3R/ovHVOXxYiRpYLvrGjETCTOVKPZhLoUxK/o/Wum2PYUft vOzl9c47AUyMxtXcmz0ItzGxWmkXFlgdKnyfo6to/+ZuAapa79bFFSv+AYrAR614D2MZ 3mdY80PV5W2ZJEiJXw7aYLSoB+WpFIBXn4gQdw5G/4B80DVXwn3DHHXWoW86sW3gTwA1 E1j9fZ4Cv/ZLcFQDoFbfjoOWpAZZs6QNrVaYQtH/44ccPNbCN2+WYQQlJop01dP1gbX4 JS4TCcvZIalb3/1lNlxXbCIgiZQ+HS+2brWAQOhrQLK5PglNmvue8uR6zzsQxvvzyNbM +kJw== X-Gm-Message-State: AA+aEWbI9VBd/nODewgBWM9NrfcwKDgNY32HYrWa65DKrcJmvuRJ6z5I HyKiNEfxmaNNmLhh93mlEqfvlA== X-Google-Smtp-Source: AFSGD/VbNFtwI6MU0htWgYMgEFo2RojE+lwQZZ+eUrZkHyRtZHWFtadNKuf9jRAkaGCqNHezutZQHQ== X-Received: by 2002:a81:34c3:: with SMTP id b186mr7637655ywa.509.1543615212858; Fri, 30 Nov 2018 14:00: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 k192-v6sm2162103ywk.99.2018.11.30.14.00.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 30 Nov 2018 14:00:11 -0800 (PST) From: Sean Paul Cc: Sean Paul , Daniel Vetter , Jeykumar Sankaran , Rob Clark , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org Subject: [PATCH v3 14/24] drm/msm: dpu: Grab the modeset locks in frame_event Date: Fri, 30 Nov 2018 17:00:02 -0500 Message-Id: <20181130220011.39644-1-sean@poorly.run> X-Mailer: git-send-email 2.20.0.rc1.387.gf8505762e3-goog In-Reply-To: <20181116184238.170034-15-sean@poorly.run> References: <20181116184238.170034-15-sean@poorly.run> MIME-Version: 1.0 To: unlisted-recipients:; (no To-header on input) 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 This patch wraps dpu_core_perf_crtc_release_bw() with modeset locks since it digs into the state objects. Changes in v2: - None Changes in v3: - Use those nifty new DRM_MODESET_LOCK_ALL_* helpers (Daniel) Cc: Daniel Vetter Cc: Jeykumar Sankaran Signed-off-by: Sean Paul Reviewed-by: Jeykumar Sankaran Acked-by: Daniel Vetter --- drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c index 74ef384d9cd6a..03ddd281a354f 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c @@ -306,6 +306,19 @@ static void dpu_crtc_vblank_cb(void *data) trace_dpu_crtc_vblank_cb(DRMID(crtc)); } +static void dpu_crtc_release_bw_unlocked(struct drm_crtc *crtc) +{ + int ret = 0; + struct drm_modeset_acquire_ctx ctx; + + DRM_MODESET_LOCK_ALL_BEGIN(crtc->dev, ctx, 0, ret); + dpu_core_perf_crtc_release_bw(crtc); + DRM_MODESET_LOCK_ALL_END(ctx, ret); + if (ret) + DRM_ERROR("Failed to acquire modeset locks to release bw, %d\n", + ret); +} + static void dpu_crtc_frame_event_work(struct kthread_work *work) { struct dpu_crtc_frame_event *fevent = container_of(work, @@ -335,7 +348,7 @@ static void dpu_crtc_frame_event_work(struct kthread_work *work) /* release bandwidth and other resources */ trace_dpu_crtc_frame_event_done(DRMID(crtc), fevent->event); - dpu_core_perf_crtc_release_bw(crtc); + dpu_crtc_release_bw_unlocked(crtc); } else { trace_dpu_crtc_frame_event_more_pending(DRMID(crtc), fevent->event);