From patchwork Tue Mar 14 02:26:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Osipenko X-Patchwork-Id: 69264 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp1525585wrd; Mon, 13 Mar 2023 19:39:54 -0700 (PDT) X-Google-Smtp-Source: AK7set/YE+nHwKKlwRLksBBOgA5mUBLpOZx3iNnM80naUbWNlFQPNEfWQVKpudut09veQsfMLG0O X-Received: by 2002:aa7:973d:0:b0:5a8:ab21:be2e with SMTP id k29-20020aa7973d000000b005a8ab21be2emr26274092pfg.18.1678761594416; Mon, 13 Mar 2023 19:39:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678761594; cv=none; d=google.com; s=arc-20160816; b=xKjl2zKUtN3EiBJRO9wEXsTAcjbO1ASx5tS/1XUwWOitthWgXyUouz/mFcAsFAhODW 7DW3/F9J17FToIGDr1IeuM9FvFykRGjQMB497xzUueYRYlgOxPw7+915GLajwPIE8UtP Rb+rWSuJaXHmnBGRDuNE2nB8KMNBsROzvgBpWxHxxJY+rZtk1Tzs/zIiRz/b3fzuCwgM rorOUJ4VxeoGNdInF59Qj7EUGSGEmLfBbbcMZwvgL/V6jg8yVQBOoER/14IcWmlV7qQM 3lqVSMqNogHHiIal/WableUahk+ailOlTButcujkSouflZcuFJuC9ZF/e1aoEDOgUSHH NqJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=kY2h90PXKqQNM1hZ+ApcGt7H/i9ExiDD3EmljJDC9W4=; b=bdBH5BDES6m/2hZq/lwudNzRGO65hbt0A8ix2pSUL9XXPbuTLDWNrUN93YsmGlz1uz VZwqhZHUzMFY50PGOKHYq3pVs2o1nlSB6rT1kyE+kzMu4ZIK78YN1hONTNrAds5aicqv Ajr0XSpQ77AI28tGapbUAldHO3dYe4FqU5uBtiB0EK9p0uQ0IC0JhAKk8P8O8KuGHoOX hVMr3qnwZh1QyIzAdd8X6y0hXPGRqDVcBl0kpis0MAwFaMlP785A8rwB0kPxFEERXJ3U 2fNqEnJ79BCa+9UxXqT2t3/O/DTE3kmuEG6x4Iyrzkz5+tFl/kBWIitfiNcW2e0o23tE eRAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=lT9HE8S6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m185-20020a6258c2000000b00624cfaddb05si1000728pfb.316.2023.03.13.19.39.42; Mon, 13 Mar 2023 19:39:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=lT9HE8S6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230215AbjCNC24 (ORCPT + 99 others); Mon, 13 Mar 2023 22:28:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230203AbjCNC2c (ORCPT ); Mon, 13 Mar 2023 22:28:32 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1215C94F4D for ; Mon, 13 Mar 2023 19:28:23 -0700 (PDT) Received: from workpc.. (109-252-120-116.nat.spd-mgts.ru [109.252.120.116]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 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 B7C306602FE9; Tue, 14 Mar 2023 02:28:20 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1678760902; bh=h7muO8aLNK5vnlF0NmBZq0VqO05JdUeVBgmQMp13WZU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lT9HE8S6b+eooLEIJQtUoU2QVgofXX2YPWjI1GL5MzGC7aAYbpfeczWw1dyZjycX1 PtmMn3/BvFR1LdwUhqCiUuHDq3/d+LENab92zKPkwaw85FBhvEMYExUjnJj7dVBCL5 Wtcj5CmpHkEwMlbAoOLA8/k91k5QBiryJd+0auJMW90Jm+PwctRmTSOFElxHAT5Z/b ilupL/tHZYL48GQvS9cjZAl5HRc4kr8lgEElM0wxiRCt6J8Ja20Bz5RFztwvT1Y/Gv fIk82RUwGKA99/FyJ8E1E97TkUdNd0WUqOD8pxY05fojKp44OMolKTV6FdGQRJoXWm fJGpy/B1II5qA== From: Dmitry Osipenko To: David Airlie , Gerd Hoffmann , Gurchetan Singh , Chia-I Wu , Daniel Vetter , Daniel Almeida , Gustavo Padovan , Daniel Stone , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Sumit Semwal , =?utf-8?q?Christian_K=C3=B6nig?= , Qiang Yu , Steven Price , Alyssa Rosenzweig , Rob Herring Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, kernel@collabora.com, virtualization@lists.linux-foundation.org, intel-gfx@lists.freedesktop.org Subject: [PATCH v13 08/10] drm/shmem-helper: Export drm_gem_shmem_get_pages_sgt_locked() Date: Tue, 14 Mar 2023 05:26:57 +0300 Message-Id: <20230314022659.1816246-9-dmitry.osipenko@collabora.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230314022659.1816246-1-dmitry.osipenko@collabora.com> References: <20230314022659.1816246-1-dmitry.osipenko@collabora.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760309117983851867?= X-GMAIL-MSGID: =?utf-8?q?1760309117983851867?= Export drm_gem_shmem_get_pages_sgt_locked() that will be used by virtio-gpu shrinker during GEM swap-in operation done under the held reservation lock. Signed-off-by: Dmitry Osipenko --- drivers/gpu/drm/drm_gem_shmem_helper.c | 3 ++- include/drm/drm_gem_shmem_helper.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_gem_shmem_helper.c b/drivers/gpu/drm/drm_gem_shmem_helper.c index 9e94652a141c..dd333610d175 100644 --- a/drivers/gpu/drm/drm_gem_shmem_helper.c +++ b/drivers/gpu/drm/drm_gem_shmem_helper.c @@ -849,7 +849,7 @@ struct sg_table *drm_gem_shmem_get_sg_table(struct drm_gem_shmem_object *shmem) } EXPORT_SYMBOL_GPL(drm_gem_shmem_get_sg_table); -static struct sg_table *drm_gem_shmem_get_pages_sgt_locked(struct drm_gem_shmem_object *shmem) +struct sg_table *drm_gem_shmem_get_pages_sgt_locked(struct drm_gem_shmem_object *shmem) { struct drm_gem_object *obj = &shmem->base; int ret; @@ -887,6 +887,7 @@ static struct sg_table *drm_gem_shmem_get_pages_sgt_locked(struct drm_gem_shmem_ drm_gem_shmem_put_pages(shmem); return ERR_PTR(ret); } +EXPORT_SYMBOL_GPL(drm_gem_shmem_get_pages_sgt_locked); /** * drm_gem_shmem_get_pages_sgt - Pin pages, dma map them, and return a diff --git a/include/drm/drm_gem_shmem_helper.h b/include/drm/drm_gem_shmem_helper.h index e99f1715514b..61aaacc6cb99 100644 --- a/include/drm/drm_gem_shmem_helper.h +++ b/include/drm/drm_gem_shmem_helper.h @@ -144,6 +144,7 @@ void drm_gem_shmem_purge(struct drm_gem_shmem_object *shmem); struct sg_table *drm_gem_shmem_get_sg_table(struct drm_gem_shmem_object *shmem); struct sg_table *drm_gem_shmem_get_pages_sgt(struct drm_gem_shmem_object *shmem); +struct sg_table *drm_gem_shmem_get_pages_sgt_locked(struct drm_gem_shmem_object *shmem); void drm_gem_shmem_print_info(const struct drm_gem_shmem_object *shmem, struct drm_printer *p, unsigned int indent);