From patchwork Wed Jul 8 07:49:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Zimmermann X-Patchwork-Id: 11650943 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3D8CC13B4 for ; Wed, 8 Jul 2020 07:49:22 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 25FD220760 for ; Wed, 8 Jul 2020 07:49:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 25FD220760 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E670E6E89F; Wed, 8 Jul 2020 07:49:16 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4F2466E89E for ; Wed, 8 Jul 2020 07:49:15 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 4AD58AEC9; Wed, 8 Jul 2020 07:49:14 +0000 (UTC) From: Thomas Zimmermann To: airlied@redhat.com, daniel@ffwll.ch, sam@ravnborg.org, noralf@tronnes.org, emil.l.velikov@gmail.com, yc_chen@aspeedtech.com Subject: [PATCH 3/6] drm/ast: Use managed VRAM-helper initialization Date: Wed, 8 Jul 2020 09:49:09 +0200 Message-Id: <20200708074912.25422-4-tzimmermann@suse.de> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200708074912.25422-1-tzimmermann@suse.de> References: <20200708074912.25422-1-tzimmermann@suse.de> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Zimmermann , dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" As a first step to managed MM code in ast, switch over VRAM MM helpers. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/ast/ast_mm.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/ast/ast_mm.c b/drivers/gpu/drm/ast/ast_mm.c index 9c3788a4c1c5..c0bbcfed9c43 100644 --- a/drivers/gpu/drm/ast/ast_mm.c +++ b/drivers/gpu/drm/ast/ast_mm.c @@ -39,9 +39,8 @@ int ast_mm_init(struct ast_private *ast) int ret; struct drm_device *dev = ast->dev; - vmm = drm_vram_helper_alloc_mm( - dev, pci_resource_start(dev->pdev, 0), - ast->vram_size); + vmm = drmm_vram_helper_alloc_mm(dev, pci_resource_start(dev->pdev, 0), + ast->vram_size); if (IS_ERR(vmm)) { ret = PTR_ERR(vmm); drm_err(dev, "Error initializing VRAM MM; %d\n", ret); @@ -60,8 +59,6 @@ void ast_mm_fini(struct ast_private *ast) { struct drm_device *dev = ast->dev; - drm_vram_helper_release_mm(dev); - arch_phys_wc_del(ast->fb_mtrr); arch_io_free_memtype_wc(pci_resource_start(dev->pdev, 0), pci_resource_len(dev->pdev, 0));