Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp1879042ybm; Sun, 31 May 2020 01:19:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyPXZTYgIV/6wF1Oq2Wjes+p7omF+uwmTjxUcJx05KG2IhZ3C8HxJL/iu9ivcPYmpkgW68R X-Received: by 2002:a50:9e49:: with SMTP id z67mr16630648ede.236.1590913159854; Sun, 31 May 2020 01:19:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590913159; cv=none; d=google.com; s=arc-20160816; b=lkItU26fuQU6atFGz2zAjdq8dSxzh8skxtjSxs5KoxULl5NRJRf2aeaNqIKkF1MjFF 8FXguoO3iSMKVgQI08uZTl2Kfa9SkxVlXE4mVWKJK446MVQFmMJC9e9oQnDyzumxpP2r OrPksegMkgIfGF0jcn2VwtawJT5uUG0/s+FvV3xqQh0pcNU4iYjYdf5671rJkR66WF4n TFRe/4E6szhD/xVZebo8Fh+o42cRnyRJcguLiCWA+FPhu4yDTQTkwBW2KtHdvSoOA+Cr xwduaB9i+GBO+M46q8OUCK0dY9fy1kahyvkJzSEsL7rz+p4yc0T5A4mzoxjx9Hw9lAo4 PDCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=6uR+wd/weKraWD0vMBYS18dzk5u+Kj+FmTqA29PPa8A=; b=Y2jUJmUDQPmdOyC3chX2fHJ9KDHjZfw0iBW+pfQLjVbftA8Xpn3W6SCZgY6RtR4kLg zZY3UlnniIlOIKxq0V0S73GgQnZ2fh1v681rqZnPNGACzZjZMP9c9Sk0mu+PetadvuKy gK+WNewxDWiQp2vaLEu3aDhzFg16BujeOmNPy5jBVTZAaqG8/Rq516otUpWzKfGdrhMU sjgZ73101Pdy4DGiYiBnn1FYxKKoEjF9gHDS0yJDQ5gNI/ZmGXyxFTEzHHPqSsKELfwe 1ypMEdEDX+qa9qobHRU1BZfFaPCiVUDfDld6uQahVuR3VgOxc2cG34ZyYM3K3yu71pvS mJFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="ahdGhBN/"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id rk22si8979194ejb.461.2020.05.31.01.18.42; Sun, 31 May 2020 01:19:19 -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=@gmail.com header.s=20161025 header.b="ahdGhBN/"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726882AbgEaINx (ORCPT + 99 others); Sun, 31 May 2020 04:13:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725898AbgEaINx (ORCPT ); Sun, 31 May 2020 04:13:53 -0400 Received: from mail-pl1-x641.google.com (mail-pl1-x641.google.com [IPv6:2607:f8b0:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E02D3C061A0E for ; Sun, 31 May 2020 01:13:51 -0700 (PDT) Received: by mail-pl1-x641.google.com with SMTP id k22so3006895pls.10 for ; Sun, 31 May 2020 01:13:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=6uR+wd/weKraWD0vMBYS18dzk5u+Kj+FmTqA29PPa8A=; b=ahdGhBN/XSdHjOAjGB6Ws7NB7SrMve5vxOKpjuHzSLkHfamgJTzfpf6yHtC1v2HGv6 MNRFxsu3zx8lWwu0rFFhYrFMsjd1GRccXNao5lsb1Kjrto3ht1nTWTEKIhSQBXLiIaZP fUdIX30Qe7mOBAEhhE1IqZO8dmTLsAH5pzHyw7IBpJCSDU2oAZCdSUm/Qqsxbb076atm Qy1FSVtX3CmldFt3Xxx5rtlzasbO+9P8JoCsqhlPgIW7Rt281DVy6B0+5Wej2dTP7bSb xXkT1hPVutUb1ak4mv9VNnmEoGBFjAYEhG/cFGZ3DoPUl1FC3xlmV74tviLvdDbR13ha ywDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=6uR+wd/weKraWD0vMBYS18dzk5u+Kj+FmTqA29PPa8A=; b=Q2Qumn+35mVs8dxvtFnan5G1o5r1wZmMDN0kGjRu2BBBOlsstzIleUNr0F92M1K91t UpwNfY8ywCelLsb2b8tXUJaJY2QH4F53fKIhDWhJAOhNuXwBay82WDlCa7kh0WEkx/qy 8DBZiLwuV+WkD5SCYOdRX3L+n/Dsm/LdfGjVhMYGzVjvDCwOnzzQLHgtPkdt4RlkivO2 8pXVEI7uN3LVosfOtkcBLviMnqg45+kMWvH4TzhWh3KYcKn2kOMIZwSEWbUMiFA//PEC OV9w8gkKNH8YqnUqCJTKUx0VCOgES0oqTpTAcjpUts/2ts11aI1+nBQ3dp9y+iOoTc0F QV6A== X-Gm-Message-State: AOAM5305K2RKHsd68uZGgMu1kfTY2X7wa+s8VSoldp+VMvACU+eP4vCJ nNGm06K6/pysbhsZ5r+if97TGnOV X-Received: by 2002:a17:902:ee12:: with SMTP id z18mr14281390plb.308.1590912831140; Sun, 31 May 2020 01:13:51 -0700 (PDT) Received: from realwakka-Lenovo-IdeaPad-S340-14API ([61.83.141.141]) by smtp.gmail.com with ESMTPSA id n21sm4094931pjo.25.2020.05.31.01.13.47 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 31 May 2020 01:13:50 -0700 (PDT) Date: Sun, 31 May 2020 17:13:39 +0900 From: Sidong Yang To: David Airlie Cc: Gerd Hoffmann , Daniel Vetter , virtualization@lists.linux-foundation.org, spice-devel@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drm/qxl: Replace deprecated function in qxl_display Message-ID: <20200531081339.GA16336@realwakka-Lenovo-IdeaPad-S340-14API> References: <20200523160156.32511-1-realwakka@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, May 24, 2020 at 07:42:25AM +1000, David Airlie wrote: > On Sun, May 24, 2020 at 2:02 AM Sidong Yang wrote: > > > > Hi, Dave. > > > > I'm a newbie kernel developer interested in qxl driver. And I want to participate in > > contributing for QXL module. > > I wrote some simple patch for refactoring task found in todos in gpu documentation. > > I want to know it's okay to contribute and write some patch for qxl module. > > If this patch is wrong, please give me some advice for me. > > Or if you have some simple task for me, I'll be glad to do it. > > Thanks. > > Hi Sidong, > > The best way to start is probably to email dri-devel list rather than > just me, there are a few more people there who can help with > onboarding and accepting patches. > > For QXL, Gerd Hoffmann (kraxel@redhat.com) is also worth cc'ing as he > is mostly maintaining it at the moment. > > Dave. > Thanks so much for advice Dave. I'll add cc for qxl maintainer and dri-devel in next patch. Sidong. > > > > > Sincerely, > > Sidong. > > > > Replace deprecated function drm_modeset_lock/unlock_all with > > helper function DRM_MODESET_LOCK_ALL_BEGIN/END. > > > > Signed-off-by: Sidong Yang > > --- > > drivers/gpu/drm/qxl/qxl_display.c | 21 +++++++++++---------- > > 1 file changed, 11 insertions(+), 10 deletions(-) > > > > diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c > > index 1082cd5d2fd4..07e164cee868 100644 > > --- a/drivers/gpu/drm/qxl/qxl_display.c > > +++ b/drivers/gpu/drm/qxl/qxl_display.c > > @@ -162,7 +162,8 @@ static void qxl_update_offset_props(struct qxl_device *qdev) > > void qxl_display_read_client_monitors_config(struct qxl_device *qdev) > > { > > struct drm_device *dev = &qdev->ddev; > > - int status, retries; > > + struct drm_modeset_acquire_ctx ctx; > > + int status, retries, ret; > > > > for (retries = 0; retries < 10; retries++) { > > status = qxl_display_copy_rom_client_monitors_config(qdev); > > @@ -183,9 +184,9 @@ void qxl_display_read_client_monitors_config(struct qxl_device *qdev) > > return; > > } > > > > - drm_modeset_lock_all(dev); > > + DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, DRM_MODESET_ACQUIRE_INTERRUPTIBLE, ret); > > qxl_update_offset_props(qdev); > > - drm_modeset_unlock_all(dev); > > + DRM_MODESET_LOCK_ALL_END(ctx, ret); > > if (!drm_helper_hpd_irq_event(dev)) { > > /* notify that the monitor configuration changed, to > > adjust at the arbitrary resolution */ > > @@ -403,18 +404,17 @@ static int qxl_framebuffer_surface_dirty(struct drm_framebuffer *fb, > > struct qxl_device *qdev = to_qxl(fb->dev); > > struct drm_clip_rect norect; > > struct qxl_bo *qobj; > > + struct drm_modeset_acquire_ctx ctx; > > bool is_primary; > > - int inc = 1; > > + int inc = 1, ret; > > > > - drm_modeset_lock_all(fb->dev); > > + DRM_MODESET_LOCK_ALL_BEGIN(fb->dev, ctx, DRM_MODESET_ACQUIRE_INTERRUPTIBLE, ret); > > > > qobj = gem_to_qxl_bo(fb->obj[0]); > > /* if we aren't primary surface ignore this */ > > is_primary = qobj->shadow ? qobj->shadow->is_primary : qobj->is_primary; > > - if (!is_primary) { > > - drm_modeset_unlock_all(fb->dev); > > - return 0; > > - } > > + if (!is_primary) > > + goto out_lock_end; > > > > if (!num_clips) { > > num_clips = 1; > > @@ -430,7 +430,8 @@ static int qxl_framebuffer_surface_dirty(struct drm_framebuffer *fb, > > qxl_draw_dirty_fb(qdev, fb, qobj, flags, color, > > clips, num_clips, inc, 0); > > > > - drm_modeset_unlock_all(fb->dev); > > +out_lock_end: > > + DRM_MODESET_LOCK_ALL_END(ctx, ret); > > > > return 0; > > } > > -- > > 2.17.1 > > >