From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CF90FC433F5 for ; Tue, 8 Mar 2022 16:04:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347948AbiCHQFu (ORCPT ); Tue, 8 Mar 2022 11:05:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243540AbiCHQFo (ORCPT ); Tue, 8 Mar 2022 11:05:44 -0500 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 837544FC59 for ; Tue, 8 Mar 2022 08:04:47 -0800 (PST) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: dmitry.osipenko) with ESMTPSA id 577761F445B7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1646755486; bh=hOiZ9ykiaBDPKQzbGHfm3j2FlBLb1AlaOgBoAKkcoPg=; h=Date:Subject:From:To:Cc:References:In-Reply-To:From; b=FBtBWn9E/pS7cuhC9BkGYA5+Me1Js9aqgIplk3YYC1XpdPiYgr4/OV47uPbqINlQ2 ePGG2EkSTYr/as5sSE0KgnvoLJs8H4t9MOXFrE/VCAYlOewQaXfLrZVIC1xFnCmJ3H +eS+TT3G+Ntg7T7LQxZkgEghutet5hVU/muOQ7z7nU+03X0Lh7dpQNLqsjmXRbN7qq 330vN5NO2lS2lsBQuKoaIc0ULCjmHKjrUQiLNgR0WLoopfs/3T4Rte7UH3uS9xJ2Sq GR/NFtcru+JD4/hatzxB+pmDr4oOWhoPoAQ1lN38owV+9Yj8AgmFi8/uWVZ0mXd5q7 tsTT0/7BvMSVw== Message-ID: Date: Tue, 8 Mar 2022 19:04:42 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH v1 5/5] drm/virtio: Add memory shrinker Content-Language: en-US From: Dmitry Osipenko To: David Airlie , Gerd Hoffmann , Gurchetan Singh , Chia-I Wu , Daniel Vetter , Daniel Almeida , Gert Wollny Cc: Tomeu Vizoso , linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, Gustavo Padovan , dri-devel@lists.freedesktop.org, Dmitry Osipenko References: <20220308131725.60607-1-dmitry.osipenko@collabora.com> <20220308131725.60607-6-dmitry.osipenko@collabora.com> In-Reply-To: <20220308131725.60607-6-dmitry.osipenko@collabora.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/8/22 16:17, Dmitry Osipenko wrote: > @@ -246,20 +246,28 @@ static int virtio_gpu_plane_prepare_fb(struct drm_plane *plane, > struct virtio_gpu_device *vgdev = dev->dev_private; > struct virtio_gpu_framebuffer *vgfb; > struct virtio_gpu_object *bo; > + int err; > > if (!new_state->fb) > return 0; > > vgfb = to_virtio_gpu_framebuffer(new_state->fb); > bo = gem_to_virtio_gpu_obj(vgfb->base.obj[0]); > - if (!bo || (plane->type == DRM_PLANE_TYPE_PRIMARY && !bo->guest_blob)) > + > + err = virtio_gpu_gem_pin(bo); > + if (err) > + return err; I just noticed that this produces a refcount debug warning because I missed to initialize the refcount when BO is created. That warning splat was hidden by a huge lockdep splat produced by drm_aperture_remove_conflicting_pci_framebuffers(), which probably should be fixed. I'll correct it in v2.