Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2392269pxb; Fri, 17 Sep 2021 08:46:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx0g9nTwl2iyJNQ3cJFNl37sALvxIObi3Xt9OreV8eyVXrcE8LmM6pnA2NCDOXOtWrpEnOu X-Received: by 2002:a05:6e02:1c2c:: with SMTP id m12mr5324936ilh.114.1631893597704; Fri, 17 Sep 2021 08:46:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631893597; cv=none; d=google.com; s=arc-20160816; b=T7hXmqlzUxhJhujnVNbGbksXu0yp3HtG7TCmtpYeRag86FbOTwHGWY5Nwpnv8V5EOo 7NFi1zg6PjKhx1dSt6rLmCchPngbFr8zqbxlMIr+RAOTWOMmnu5rHJJNvJN0McMPoSw6 w1NpaP+fogu/XXtBhnatsErYuga6fRa6B6Oa5YUR8cDCSFF/4I2xvbwZ4fVB+J+HneIm ku2ITmxy9dSnZIrm39hGShNjjjmNG7lX1rg4VQ0F0L8szCs+UbSRMokA9DGde9jFSnYn BQkT4NkkuhW9LU2kAeTcdee2eX947kOSOqLJEettTaguuqrGTnXzbfAro2Rb6yqsUrUs V6sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=KGhh0FxAoXjZdT5id36puiM73Gpg6jiXPwlF6zyy+Sg=; b=xNAR7DzOvMIPcam3wTqh7nrZLQNufIO8NWmmBd03ZhzEKHo0hWS/TA0+OCEWeGofol O+bPBff3KyH9jSoSpYiHgUdYJ7eF5uHnEe1ZoEYckVW/i14qMlEJiYxAOvos3U99qVF1 bfex7Z8uEjH6ZNKsw4ZfO4nP9aCyD1rK1OZ3flRONi6h7ivet0MdreN2FIp4BE/WnQcC QnkKTcUsFh+Z+cRK45i43/OFnD+Qp3QJgr6M1W11k/dt2SId7lPd7SymKhVUfE6gjuvo EKgGVjtRwi+JROniON5o//WoaWkLBnocD/mMnFu5D5Uc3qHZkeHvdJNdTEKDJRElN2ze U9cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@poorly.run header.s=google header.b=WrdgPsCU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m9si6092987iow.85.2021.09.17.08.46.26; Fri, 17 Sep 2021 08:46:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@poorly.run header.s=google header.b=WrdgPsCU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241770AbhIQPjd (ORCPT + 99 others); Fri, 17 Sep 2021 11:39:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242810AbhIQPja (ORCPT ); Fri, 17 Sep 2021 11:39:30 -0400 Received: from mail-qk1-x732.google.com (mail-qk1-x732.google.com [IPv6:2607:f8b0:4864:20::732]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 12CA9C061767 for ; Fri, 17 Sep 2021 08:38:08 -0700 (PDT) Received: by mail-qk1-x732.google.com with SMTP id b64so18762670qkg.0 for ; Fri, 17 Sep 2021 08:38:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=poorly.run; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=KGhh0FxAoXjZdT5id36puiM73Gpg6jiXPwlF6zyy+Sg=; b=WrdgPsCUaWeuwU1TkqYTtCQ2quYqXDaRjcmSfqsp6Vr2Ck3PrOIhPEfWlXA4RwwUQY LRrutmaNF63Ao+cfgmIYcVXLKpElilm+P2wdcvGcQLCBJmDJdxK5rYiaw4x+Tvjvdmc1 4WEvA2cfDVgExeoJCAq/aMXa31ooix2kinFj9+6K9IjpkNVXJPlIH4SV2rhCORJj1u8l eI0dxfKQuwrwYbLNCtrLiFnm2IQuWjt+YKtOefdKwg/ipfk1nY2MMiVhllPToyeJVWEq hHywQWPHCMO1TvfSvV/lDP4n5dOqmqG+5rkdLmdQ/Y831IebnOWlWM4Y1/CVwwOWUtb6 GRFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=KGhh0FxAoXjZdT5id36puiM73Gpg6jiXPwlF6zyy+Sg=; b=6lbyMgojDgcM8QnqdYKiLqibuRh84jQU87kZtH6UcL1sS9OmB8fPkqbh3kbgw3xaJ3 GixTcR91tvODt0k/blLbi33gtVmi4O2L0j3fpgFGtJLbhifBk2Ksuo1+48kitcfYrlef sFH1PTmjSM8sMpgVZHEwybiK6idZ4ofSc+uk9y5Ri5j289KVbWQkKK29z3rGTAHeprCu /izVjEPXItNmz29RxtChnLxv+WYhaiLefAC2Z3CIGgzSN1TxF/6oVXK3buNfXAULX1FC 6MYeu1FbnyFBBLxgyjb5hdUDyYgc3utFzASyVUg7bJC6g+EfGuTwEKTNJEA/Sz9CBtDf yPFA== X-Gm-Message-State: AOAM530zIFTf6ZOpzJfbImgz9455X6U0mAhUoFg5v9HcViKgMAtiltRa rA1s1QP+o762vqUYsqJvRnjw+w== X-Received: by 2002:a05:620a:789:: with SMTP id 9mr11259370qka.400.1631893087092; Fri, 17 Sep 2021 08:38:07 -0700 (PDT) Received: from localhost ([167.100.64.199]) by smtp.gmail.com with ESMTPSA id z6sm4991917qke.24.2021.09.17.08.38.06 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Sep 2021 08:38:06 -0700 (PDT) Date: Fri, 17 Sep 2021 11:38:05 -0400 From: Sean Paul To: Fernando Ramos Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, sean@poorly.run, linux-doc@vger.kernel.org, amd-gfx@lists.freedesktop.org, intel-gfx@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, nouveau@lists.freedesktop.org, linux-renesas-soc@vger.kernel.org, linux-tegra@vger.kernel.org Subject: Re: [PATCH 06/15] drm/tegra: cleanup: drm_modeset_lock_all() --> DRM_MODESET_LOCK_ALL_BEGIN() Message-ID: <20210917153805.GF2515@art_vandelay> References: <20210916211552.33490-1-greenfoo@u92.eu> <20210916211552.33490-7-greenfoo@u92.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210916211552.33490-7-greenfoo@u92.eu> User-Agent: Mutt/1.9.4 (2018-02-28) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 16, 2021 at 11:15:43PM +0200, Fernando Ramos wrote: > As requested in Documentation/gpu/todo.rst, replace driver calls to > drm_modeset_lock_all() with DRM_MODESET_LOCK_ALL_BEGIN() and > DRM_MODESET_LOCK_ALL_END() > > Signed-off-by: Fernando Ramos > --- > drivers/gpu/drm/tegra/dsi.c | 6 ++++-- > drivers/gpu/drm/tegra/hdmi.c | 5 +++-- > drivers/gpu/drm/tegra/sor.c | 10 ++++++---- > 3 files changed, 13 insertions(+), 8 deletions(-) > > diff --git a/drivers/gpu/drm/tegra/dsi.c b/drivers/gpu/drm/tegra/dsi.c > index f46d377f0c30..77a496f6a2e9 100644 > --- a/drivers/gpu/drm/tegra/dsi.c > +++ b/drivers/gpu/drm/tegra/dsi.c > @@ -202,10 +202,12 @@ static int tegra_dsi_show_regs(struct seq_file *s, void *data) > struct tegra_dsi *dsi = node->info_ent->data; > struct drm_crtc *crtc = dsi->output.encoder.crtc; > struct drm_device *drm = node->minor->dev; > + struct drm_modeset_acquire_ctx ctx; > unsigned int i; > int err = 0; > + int ret; You can use err here instead. With that fixed, Reviewed-by: Sean Paul > > - drm_modeset_lock_all(drm); > + DRM_MODESET_LOCK_ALL_BEGIN(drm, ctx, 0, ret); > > if (!crtc || !crtc->state->active) { > err = -EBUSY; > @@ -220,7 +222,7 @@ static int tegra_dsi_show_regs(struct seq_file *s, void *data) > } > > unlock: > - drm_modeset_unlock_all(drm); > + DRM_MODESET_LOCK_ALL_END(drm, ctx, ret); > return err; > } > > diff --git a/drivers/gpu/drm/tegra/hdmi.c b/drivers/gpu/drm/tegra/hdmi.c > index e5d2a4026028..669a2ebb55ae 100644 > --- a/drivers/gpu/drm/tegra/hdmi.c > +++ b/drivers/gpu/drm/tegra/hdmi.c > @@ -1031,10 +1031,11 @@ static int tegra_hdmi_show_regs(struct seq_file *s, void *data) > struct tegra_hdmi *hdmi = node->info_ent->data; > struct drm_crtc *crtc = hdmi->output.encoder.crtc; > struct drm_device *drm = node->minor->dev; > + struct drm_modeset_acquire_ctx ctx; > unsigned int i; > int err = 0; > > - drm_modeset_lock_all(drm); > + DRM_MODESET_LOCK_ALL_BEGIN(drm, ctx, 0, err); > > if (!crtc || !crtc->state->active) { > err = -EBUSY; > @@ -1049,7 +1050,7 @@ static int tegra_hdmi_show_regs(struct seq_file *s, void *data) > } > > unlock: > - drm_modeset_unlock_all(drm); > + DRM_MODESET_LOCK_ALL_END(drm, ctx, err); > return err; > } > > diff --git a/drivers/gpu/drm/tegra/sor.c b/drivers/gpu/drm/tegra/sor.c > index 0ea320c1092b..323d95eb0cac 100644 > --- a/drivers/gpu/drm/tegra/sor.c > +++ b/drivers/gpu/drm/tegra/sor.c > @@ -1490,10 +1490,11 @@ static int tegra_sor_show_crc(struct seq_file *s, void *data) > struct tegra_sor *sor = node->info_ent->data; > struct drm_crtc *crtc = sor->output.encoder.crtc; > struct drm_device *drm = node->minor->dev; > + struct drm_modeset_acquire_ctx ctx; > int err = 0; > u32 value; > > - drm_modeset_lock_all(drm); > + DRM_MODESET_LOCK_ALL_BEGIN(drm, ctx, 0, err); > > if (!crtc || !crtc->state->active) { > err = -EBUSY; > @@ -1522,7 +1523,7 @@ static int tegra_sor_show_crc(struct seq_file *s, void *data) > seq_printf(s, "%08x\n", value); > > unlock: > - drm_modeset_unlock_all(drm); > + DRM_MODESET_LOCK_ALL_END(drm, ctx, err); > return err; > } > > @@ -1652,10 +1653,11 @@ static int tegra_sor_show_regs(struct seq_file *s, void *data) > struct tegra_sor *sor = node->info_ent->data; > struct drm_crtc *crtc = sor->output.encoder.crtc; > struct drm_device *drm = node->minor->dev; > + struct drm_modeset_acquire_ctx ctx; > unsigned int i; > int err = 0; > > - drm_modeset_lock_all(drm); > + DRM_MODESET_LOCK_ALL_BEGIN(drm, ctx, 0, err); > > if (!crtc || !crtc->state->active) { > err = -EBUSY; > @@ -1670,7 +1672,7 @@ static int tegra_sor_show_regs(struct seq_file *s, void *data) > } > > unlock: > - drm_modeset_unlock_all(drm); > + DRM_MODESET_LOCK_ALL_END(drm, ctx, err); > return err; > } > > -- > 2.33.0 > -- Sean Paul, Software Engineer, Google / Chromium OS