Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2395641pxb; Fri, 17 Sep 2021 08:51:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxTW97fhZGwnFspo2mq1VIAf/F/gAD2PwU2xTWhdT/gaDhnciwPKmSLn2FMS+woSTYKeeOq X-Received: by 2002:a05:6638:14b:: with SMTP id y11mr2944261jao.34.1631893885648; Fri, 17 Sep 2021 08:51:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631893885; cv=none; d=google.com; s=arc-20160816; b=wZ8k5Pa1k3fOpqgiRKyOXgZ/cwBkV4a4OIMho8oxx/1FIr0J27Ok4hFKPhCO4SwCS/ Qp/cFYiLtvG4NEW0XriUKKyLqqZnzPPeodPD6uAayqrTUcvlUzLvUO2S68yh84S6pavA tPLg9UOHkhmGmglKl2WtkWhltVnZ58Fg1RSJM/1BrfgYRNQeTRG1ZKL22X1CsMd0eo9X /5Wmc3Zq5i6VlQkfDMvRJM7pMYQgkm5MTfJkuD2PzoUIMy1hYi5V3FeRaEFVQXCqyiSf zWyRCd+zeZEB1bstif2ZL+EfhH0vAtULFK+SNZsdAJ4AWiWrO4ZJKeffzDoXp1JXOVcc lrvQ== 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=yNboy2nybDEpZvjijJhKd+CeyrFg+AJ7CoANY2kY7TA=; b=TlOvtYU26EJ2bvaQlXsCIyAN7Gvi0VGK9V4Ua/nTE9nDwxVD71NJeY4tFfZLTfq5ef yE5jMnuPELHokRr6mBNtj9bLV7QOyiHFk1CawS8RrqmSq7CddHQryUipfZ6SwCLpPXE6 ubRRfG3Z76vHDCbyyGA8bViPOHOdvizj3EHhDByLXLumfFXBVVPubcRbonVd+MtI8QSK l9FGFwzowDYy13gky+6AqytXtmqsi2l7nFt0MlXvhLWx3N4Jepn7gX9U9L8SS/hMAYzI 5rrm8qbJtfb+qOd0qAx8FHydtSYPpUGp/yYI7125GpI529ELsbruzCihmJWzOBGSLvPQ D9hA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@poorly.run header.s=google header.b="PcnJ/Qqx"; 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 c35si5932336jai.6.2021.09.17.08.51.14; Fri, 17 Sep 2021 08:51:25 -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="PcnJ/Qqx"; 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 S1343723AbhIQPue (ORCPT + 99 others); Fri, 17 Sep 2021 11:50:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245715AbhIQPuc (ORCPT ); Fri, 17 Sep 2021 11:50:32 -0400 Received: from mail-qt1-x836.google.com (mail-qt1-x836.google.com [IPv6:2607:f8b0:4864:20::836]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B1870C061574 for ; Fri, 17 Sep 2021 08:49:10 -0700 (PDT) Received: by mail-qt1-x836.google.com with SMTP id x5so9084852qtq.13 for ; Fri, 17 Sep 2021 08:49:10 -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=yNboy2nybDEpZvjijJhKd+CeyrFg+AJ7CoANY2kY7TA=; b=PcnJ/QqxvMhMi9fyasgFvHa/sLaqYyMYOz6DJJFEFQCw9HGFfs7KGZWZUzOBnTccxd 2huaYpg3OXmPPgfhte1FwhCmhiI1kHSKEMbOEuKXXLM0yyR27/Pwox4unL+9FMs1qOyb rIGWayOPNyBFDBUlcmls4Q2wkFtbnCln6p7D2IWxdz6t6c5j5DaRVb2hBnqH5mSKvU1W vZFKE+JlnHA+HCiXhV+958t5hyEY439/W0qFxVKpGnZ4N0z8NlcCs119QpJw+JOP16BX E1zOKeTf6iaVRYQkRIzB3Fs/fdm5Y0Lv7oUvQSoSZhgwoQqhXoMeqfoDChjMr2cxoIxY ZU+Q== 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=yNboy2nybDEpZvjijJhKd+CeyrFg+AJ7CoANY2kY7TA=; b=Z3SDW2JsBrsrT5Lv5ebPipUxDAqynUWawtsKFyWOSKzbPK13x80uCBvdF4RPIraSIQ WlJlauYHXQnVM2QRNaEThML8+IYXIWI6mYg1P74jfvndhB+8REoefhzNHNM8F7VvAVvd Xl53u0BUhOYyGIk2s66JXCazgcpgChTpE31msGBYIJebysEv8aEFy10zcxxsQ2/zhxAg a8wqy+24bLq//TQ8hRIbyfH/6SSOZamtOtmgE/SHcLkUhPkSjlSSodrjIoAp3kWf4zGz M2LeyN4lZxjo5GuDKJ/a3drliZeTBXRQyBtLfBrsq3ZPh5IKO8TkS++BYboW8nLgIotW uDQA== X-Gm-Message-State: AOAM530rtU40ENSow+kk3vQXB0Kbej/gHw6+ijA+dcwzjMnOtpbJSXKL g46NK3jrHB1DAJGilefeDckZVQ== X-Received: by 2002:ac8:7558:: with SMTP id b24mr11241149qtr.160.1631893749909; Fri, 17 Sep 2021 08:49:09 -0700 (PDT) Received: from localhost ([167.100.64.199]) by smtp.gmail.com with ESMTPSA id c10sm4408958qtb.20.2021.09.17.08.49.09 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 17 Sep 2021 08:49:09 -0700 (PDT) Date: Fri, 17 Sep 2021 11:49:08 -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 13/15] drm/gma500: cleanup: drm_modeset_lock_all() --> DRM_MODESET_LOCK_ALL_BEGIN() Message-ID: <20210917154908.GN2515@art_vandelay> References: <20210916211552.33490-1-greenfoo@u92.eu> <20210916211552.33490-14-greenfoo@u92.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210916211552.33490-14-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:50PM +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/gma500/psb_device.c | 14 ++++++++++---- > 1 file changed, 10 insertions(+), 4 deletions(-) > > diff --git a/drivers/gpu/drm/gma500/psb_device.c b/drivers/gpu/drm/gma500/psb_device.c > index 951725a0f7a3..4e27f65a1f16 100644 > --- a/drivers/gpu/drm/gma500/psb_device.c > +++ b/drivers/gpu/drm/gma500/psb_device.c > @@ -8,6 +8,7 @@ > #include > > #include > +#include > > #include "gma_device.h" > #include "intel_bios.h" > @@ -169,8 +170,10 @@ static int psb_save_display_registers(struct drm_device *dev) > { > struct drm_psb_private *dev_priv = dev->dev_private; > struct drm_crtc *crtc; > + struct drm_modeset_acquire_ctx ctx; > struct gma_connector *connector; > struct psb_state *regs = &dev_priv->regs.psb; > + int ret; > > /* Display arbitration control + watermarks */ > regs->saveDSPARB = PSB_RVDC32(DSPARB); > @@ -183,7 +186,7 @@ static int psb_save_display_registers(struct drm_device *dev) > regs->saveCHICKENBIT = PSB_RVDC32(DSPCHICKENBIT); > > /* Save crtc and output state */ > - drm_modeset_lock_all(dev); > + DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, 0, ret); > list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { > if (drm_helper_crtc_in_use(crtc)) > dev_priv->ops->save_crtc(crtc); > @@ -193,7 +196,8 @@ static int psb_save_display_registers(struct drm_device *dev) > if (connector->save) > connector->save(&connector->base); > > - drm_modeset_unlock_all(dev); > + DRM_MODESET_LOCK_ALL_END(dev, ctx, ret); > + > return 0; Return ret here please > } > > @@ -207,8 +211,10 @@ static int psb_restore_display_registers(struct drm_device *dev) > { > struct drm_psb_private *dev_priv = dev->dev_private; > struct drm_crtc *crtc; > + struct drm_modeset_acquire_ctx ctx; > struct gma_connector *connector; > struct psb_state *regs = &dev_priv->regs.psb; > + int ret; > > /* Display arbitration + watermarks */ > PSB_WVDC32(regs->saveDSPARB, DSPARB); > @@ -223,7 +229,7 @@ static int psb_restore_display_registers(struct drm_device *dev) > /*make sure VGA plane is off. it initializes to on after reset!*/ > PSB_WVDC32(0x80000000, VGACNTRL); > > - drm_modeset_lock_all(dev); > + DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, 0, ret); > list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) > if (drm_helper_crtc_in_use(crtc)) > dev_priv->ops->restore_crtc(crtc); > @@ -232,7 +238,7 @@ static int psb_restore_display_registers(struct drm_device *dev) > if (connector->restore) > connector->restore(&connector->base); > > - drm_modeset_unlock_all(dev); > + DRM_MODESET_LOCK_ALL_END(dev, ctx, ret); > return 0; Here too > } > > -- > 2.33.0 > -- Sean Paul, Software Engineer, Google / Chromium OS