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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6BC35C77B7A for ; Mon, 29 May 2023 22:05:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8C98D10E2FD; Mon, 29 May 2023 22:05:56 +0000 (UTC) Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by gabe.freedesktop.org (Postfix) with ESMTPS id 085B410E2FD; Mon, 29 May 2023 22:05:54 +0000 (UTC) Received: from [192.168.2.2] (109-252-150-34.dynamic.spd-mgts.ru [109.252.150.34]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: dmitry.osipenko) by madras.collabora.co.uk (Postfix) with ESMTPSA id 26C94660217A; Mon, 29 May 2023 23:05:50 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1685397952; bh=E8D9UsqcqdEvEaSPqwft+gP6ubYKoB1Svo0H0BTDyFA=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=P6uFKmXC0TuQ4UYU9RsteNwepJOX/EuIwZ3L7kLP8gvVCzg0XXjllPHK/tLG5xcGx VJDkSEKqLLRaaDkqDA2Hf3zPtNqI4QWffOKLx5/FByohz6tXFlgep4mKsnMP5uwn3J ITdsL7oiuo7wEZNTU8EDVMvfsF+ONOzX1R+omxBBDun/jsdmTI3x84WaBr4jCTXgfr tI6vDNXbD0B0JM8bMmC22PwJqZMhYPK/Q6UTa7HnDxLhfJH9ZyAYCFj8XL7I/p7eZ8 OMtQvEIhBWLr1Wmp8g1qFwPQodk8FA+dembDBoTf4wzxgIvxEG8mqJnTxmV0pQ8l/e hmFRL6ZZZSLFg== Message-ID: Date: Tue, 30 May 2023 01:05:47 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Content-Language: en-US To: Emil Velikov References: <20230521205112.150206-1-dmitry.osipenko@collabora.com> <20230521205112.150206-7-dmitry.osipenko@collabora.com> From: Dmitry Osipenko In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Intel-gfx] [PATCH v3 6/6] drm/shmem-helper: Switch to reservation lock X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dri-devel@lists.freedesktop.org, John Stultz , Gerd Hoffmann , kernel@collabora.com, Sumit Semwal , Marek Szyprowski , Benjamin Gaignard , linux-media@vger.kernel.org, Daniel Vetter , Arnd Bergmann , intel-gfx@lists.freedesktop.org, linux-tegra@vger.kernel.org, Mauro Carvalho Chehab , Tomi Valkeinen , linux-kernel@vger.kernel.org, Liam Mark , Tomasz Figa , Thomas Zimmermann , =?UTF-8?Q?Christian_K=c3=b6nig?= Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On 5/22/23 16:02, Emil Velikov wrote: >> -void drm_gem_shmem_put_pages(struct drm_gem_shmem_object *shmem) >> +static int drm_gem_shmem_pin_locked(struct drm_gem_shmem_object *shmem) >> +{ >> + int ret; >> + >> + dma_resv_assert_held(shmem->base.resv); >> + >> + ret = drm_gem_shmem_get_pages(shmem); >> + >> + return ret; > With the assert_held in the getter, it would be less confusing to > inline this and the unpin_locked functions. Sorry, missed this comment earlier. The reason why it's a separate function is because there will be another caller once we'll add the drm-shrinker. -- Best regards, Dmitry