Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp2688511pxb; Sun, 24 Apr 2022 23:29:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwBfDIh4bLsgQP56yk+j/bfILNW4mkzL4StTxyTRemrdEN/0i8NjldCE5k5Zf6dDYa6Poho X-Received: by 2002:a17:902:9b92:b0:158:57d8:3a20 with SMTP id y18-20020a1709029b9200b0015857d83a20mr16528525plp.34.1650868148804; Sun, 24 Apr 2022 23:29:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650868148; cv=none; d=google.com; s=arc-20160816; b=yGuvAVKntWIBYAjGRPMAnhgBRp2P2QrK3zqkWGOG8MGq7052IkfwzQM8m1c2f0cWyp 9+59MVDSDwXr3EOw5SI0G2vEt+/wx6Wnl2Tx688zvVuzocCJN9pcNhBkRkGqeI+lHJKo KINgeu3sgnzo6i0ip7Te0vIvehJpv0HeLfsV5x0VByO9RkaEiOsMS5NVBDq7mur12RdB H/YDsoF+IKf8qqW1IrLyJPwmPJ3rVfIDnkjHiU07mh7dkGjvBAJGdcxGF3LseAk4Ivxm UWhkeTXNaUrvpwtHY0VOrUmNg/8LGv2YO+s0VfyXijgavcQBl1F7NqBB9sZ1tHhWD8sH uiTw== 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=YRzmVxaRSbRMwyWFK/pbu2MtfQh06YJDGjN+uLj6mW8=; b=WbehWBk5MLO7BBSrfjID9DNadqVBs92sTqUK/vwg4XS3ZPCxqQQRuiTzFw8kiVxYvX 4jb+c9l58jgZD1+ShCg2EsL5n91aytd5u15hvZj5lfgP7sKW2ho73+pQTXBElFGEE2cZ J9IplAeC49rWsR8HXfpWZkTWUyLWUDLgl4zWcaYPKXN3yIfISmwZaWlJRu0IZuz434dc fpw/lkzw8+6JnwHm2GMmkm1LsRJMWLhdJnSfa0tWLSL9d/pVdZbyIsb5R3f1Tzu7UevO M3hFq4v9ZM5FfWPtpoMPnQbgOJQyAtjJoaVRxXv92wXWTwmgWifry3tXD73auaR3gnFt cmRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=Ry+ZPMXQ; 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=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bt10-20020a056a00438a00b0050d4265128dsi1411111pfb.313.2022.04.24.23.28.55; Sun, 24 Apr 2022 23:29:08 -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=Ry+ZPMXQ; 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=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238080AbiDXTJR (ORCPT + 99 others); Sun, 24 Apr 2022 15:09:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237847AbiDXTIS (ORCPT ); Sun, 24 Apr 2022 15:08:18 -0400 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 571E122BCB for ; Sun, 24 Apr 2022 12:05:10 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: dmitry.osipenko) with ESMTPSA id 4F6101F4065F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1650827109; bh=AlpWMMFY2kuHyruY9FDCsN1f6mNBZxXcpmSdzVCs994=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ry+ZPMXQVP4xnByVPenI0tsSh+KMi7RYEpqpfiLul1cWE2liWNSVpPF7mdvTKsDf8 xMV/7sATfjAaFp1aKNpKKZVZHGvay96HMbwMhUZatIDB0+Y34qyQbm+S3NaMyK5Vo6 wrUY9C8NjiDr9BUaY0c2Wf2TEv5hgSRBEB9XXA62XAwPCuoRrs7l47RGOkjA8ma+f6 dUzSbg2NzG06GPMAywlfYjJu46eJBwFBF3HmrYwUj7wwY/SKwFtl619lyjd8ZUlLqG WAGXyzpQs1vlNCDn5coseHNkg4bI4C/IneTx2kfFrSDJYWgSBtw7izIZVoyE3bfZlw BeS+lMaC6L9zA== From: Dmitry Osipenko To: David Airlie , Gerd Hoffmann , Gurchetan Singh , Chia-I Wu , Daniel Vetter , Daniel Almeida , Gert Wollny , Gustavo Padovan , Daniel Stone , Tomeu Vizoso , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Steven Price , Alyssa Rosenzweig , Rob Clark , Emil Velikov , Robin Murphy , Qiang Yu , Sumit Semwal , =?UTF-8?q?Christian=20K=C3=B6nig?= Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, Dmitry Osipenko , Dmitry Osipenko Subject: [PATCH v5 17/17] drm/shmem-helper: Remove drm_gem_shmem_purge_locked() Date: Sun, 24 Apr 2022 22:04:24 +0300 Message-Id: <20220424190424.540501-18-dmitry.osipenko@collabora.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220424190424.540501-1-dmitry.osipenko@collabora.com> References: <20220424190424.540501-1-dmitry.osipenko@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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_PASS,SPF_PASS, UNPARSEABLE_RELAY,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 Panfrost driver was the only user of the drm_gem_shmem_purge_locked() helper. Panfrost driver was converted to use new generic memory shrinker and the helper doesn't have users anymore, remove it. Signed-off-by: Dmitry Osipenko --- drivers/gpu/drm/drm_gem_shmem_helper.c | 30 -------------------------- include/drm/drm_gem_shmem_helper.h | 1 - 2 files changed, 31 deletions(-) diff --git a/drivers/gpu/drm/drm_gem_shmem_helper.c b/drivers/gpu/drm/drm_gem_shmem_helper.c index 045921ad4795..ef7691c84fa8 100644 --- a/drivers/gpu/drm/drm_gem_shmem_helper.c +++ b/drivers/gpu/drm/drm_gem_shmem_helper.c @@ -899,36 +899,6 @@ static void drm_gem_shmem_unpin_pages_locked(struct drm_gem_shmem_object *shmem) shmem->sgt = NULL; } -void drm_gem_shmem_purge_locked(struct drm_gem_shmem_object *shmem) -{ - struct drm_gem_object *obj = &shmem->base; - struct drm_device *dev = obj->dev; - - WARN_ON(!drm_gem_shmem_is_purgeable(shmem)); - - dma_unmap_sgtable(dev->dev, shmem->sgt, DMA_BIDIRECTIONAL, 0); - sg_free_table(shmem->sgt); - kfree(shmem->sgt); - shmem->sgt = NULL; - - drm_gem_shmem_put_pages_locked(shmem); - - shmem->madv = -1; - - drm_vma_node_unmap(&obj->vma_node, dev->anon_inode->i_mapping); - drm_gem_free_mmap_offset(obj); - - /* Our goal here is to return as much of the memory as - * is possible back to the system as we are called from OOM. - * To do this we must instruct the shmfs to drop all of its - * backing pages, *now*. - */ - shmem_truncate_range(file_inode(obj->filp), 0, (loff_t)-1); - - invalidate_mapping_pages(file_inode(obj->filp)->i_mapping, 0, (loff_t)-1); -} -EXPORT_SYMBOL(drm_gem_shmem_purge_locked); - /** * drm_gem_shmem_dumb_create - Create a dumb shmem buffer object * @file: DRM file structure to create the dumb buffer for diff --git a/include/drm/drm_gem_shmem_helper.h b/include/drm/drm_gem_shmem_helper.h index 972687bf9717..8d7053c36fa6 100644 --- a/include/drm/drm_gem_shmem_helper.h +++ b/include/drm/drm_gem_shmem_helper.h @@ -195,7 +195,6 @@ int drm_gem_shmem_set_purgeable(struct drm_gem_shmem_object *shmem); int drm_gem_shmem_set_purgeable_and_evictable(struct drm_gem_shmem_object *shmem); int drm_gem_shmem_swap_in_locked(struct drm_gem_shmem_object *shmem); -void drm_gem_shmem_purge_locked(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); -- 2.35.1