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: 10707303 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 953DC1057 for ; Fri, 30 Nov 2018 22:00:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 88BF1302BE for ; Fri, 30 Nov 2018 22:00:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7D47C302C3; Fri, 30 Nov 2018 22:00:16 +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 18438302BE for ; Fri, 30 Nov 2018 22:00:16 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DEB9C6E641; Fri, 30 Nov 2018 22:00:14 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yw1-xc42.google.com (mail-yw1-xc42.google.com [IPv6:2607:f8b0:4864:20::c42]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9C38F6E641 for ; Fri, 30 Nov 2018 22:00:13 +0000 (UTC) Received: by mail-yw1-xc42.google.com with SMTP id d190so2908901ywd.12 for ; Fri, 30 Nov 2018 14:00:13 -0800 (PST) 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=g3DGio4AZPFFWMQakug5hQLBiqAMZI6J4LtCQNE8mRuD88QJge02i0LZAcd3/PF/ht Jj0ZVmiXOIGBkZ8YejpryZO+9NlOpePXkWidAVxSKFyyHt1AAOOBkVcWUuyukO0XntIZ Kx5WZoCUMLjbxCU6G+8mXu/DxTRDIa4hsgMzGgkkJpfPQl8u82c59ZaSGaaPmKUMwOup ondio1NIF9xpxWPSo/zqSiS2+iHqzhqEK3ZhVmfEpmBpl6/n8rYpWwws0JOZYLYkQeoG pb4WjetDK8YpyD4bHCGdWFBgO6yAw/1vXgrbqI2EDeAnmKzHB/qCPkUxNY42WoOHzKoV vgaA== X-Gm-Message-State: AA+aEWa52TSObTDrXuJnig2T7I2za5VSsjj+e4FsCTwq9C7ellwHyyDH HP0lZi4L0aO+lWA2C9s/TuhyuQ== 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 To: 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 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: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, Sean Paul , freedreno@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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);