Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp185255pxu; Wed, 2 Dec 2020 19:12:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJwP5LIBE3IwtdWmA8sEeeTfCflL5H0H4P8pV5DW++LqA2pDstf+gjQ8ZEtL2fu5AsaGAPIX X-Received: by 2002:aa7:d6d8:: with SMTP id x24mr1039760edr.105.1606965170762; Wed, 02 Dec 2020 19:12:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606965170; cv=none; d=google.com; s=arc-20160816; b=ZROE8X/VXCZzhKoo11s8P1UanMiosI7iLkOB7pBSvAQ2VuUSKev/aNtPZ13xh1so7Q 6N0iPnsH0ma8PBkLul8zRS1Qbv5AKzKGSVx/RiYfqE1eQ43iEvkbVyb6vEpizXPiufJy 306YoUGeo2MhuB+8+CSdRu9E9abh+5ZJ+f5zD5mSwMuKguTq7D0yEu+Jy4bKWlOuMOa1 7MmkNimX71pa5ac+d1RS64pxQlkehN+UvGUHr1DYCD/xfCxkRF7Jf0abckDq63t+Y3lG dvhJsWXZHvyRnCSlCYs8VjRgCIpo8TqQsOZGMmx9E5X+P8pawibPbY0c0JHd4/2jnktH gbDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:to:from; bh=+fMgGJ9bUfTdhyCgNU5ClEdlIr2ftsZAtMRhs7byFG0=; b=HOwU2fGiPhOOpMnxE7sJTdsPEpRXB4koK8VCj2Yy/gundRKq3Cz5GD6C+cOCnjYmad soMVaUTaTA2+xM/WmYzYRbPCk7LPwg//T4+7SmAxbZZ+czrLZL3MXDQKOylJv++Vw8Fk 58CfNB0zfCmeNkisQBq+fiCSwgt8J/BNmkFdzQjUxeWPsNrzR0DlVQqpgMJZHNsVHzPG 4O26VJobIC8xvi5a9MCphEy2lCJXuxECMPnqUT2D6cXxTsH9EKz/FkVLq2F9A7zCmCXB 0Ez/7Z3sozTR08THOPxj6yoigG9zO4AhKnvlqN4RREPa2OlxBLYNzWcHC+q6xMn5LpM8 3ypw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u8si360304eje.57.2020.12.02.19.12.27; Wed, 02 Dec 2020 19:12:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729549AbgLCDJo (ORCPT + 99 others); Wed, 2 Dec 2020 22:09:44 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:8931 "EHLO szxga06-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726629AbgLCDJo (ORCPT ); Wed, 2 Dec 2020 22:09:44 -0500 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4CmglY37FJzhm0B; Thu, 3 Dec 2020 11:08:41 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.487.0; Thu, 3 Dec 2020 11:08:56 +0800 From: Tian Tao To: , , , , , , , , Subject: [PATCH] drm/hisilicon: Use managed VRAM-helper initialization Date: Thu, 3 Dec 2020 11:09:13 +0800 Message-ID: <1606964953-24309-1-git-send-email-tiantao6@hisilicon.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.69.192.56] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org updated to use drmm_vram_helper_init() Signed-off-by: Tian Tao --- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 1 - drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.h | 1 - drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c | 19 +++---------------- 3 files changed, 3 insertions(+), 18 deletions(-) diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c index 8020604..5aea2e9 100644 --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c @@ -249,7 +249,6 @@ static int hibmc_unload(struct drm_device *dev) pci_disable_msi(dev->pdev); hibmc_kms_fini(priv); - hibmc_mm_fini(priv); dev->dev_private = NULL; return 0; } diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.h b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.h index 7e0c756..2786de5 100644 --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.h +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.h @@ -64,7 +64,6 @@ int hibmc_de_init(struct hibmc_drm_private *priv); int hibmc_vdac_init(struct hibmc_drm_private *priv); int hibmc_mm_init(struct hibmc_drm_private *hibmc); -void hibmc_mm_fini(struct hibmc_drm_private *hibmc); int hibmc_dumb_create(struct drm_file *file, struct drm_device *dev, struct drm_mode_create_dumb *args); int hibmc_ddc_create(struct drm_device *drm_dev, struct hibmc_connector *connector); diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c index e84fb81..892d566 100644 --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c @@ -23,15 +23,12 @@ int hibmc_mm_init(struct hibmc_drm_private *hibmc) { - struct drm_vram_mm *vmm; int ret; struct drm_device *dev = &hibmc->dev; - vmm = drm_vram_helper_alloc_mm(dev, - pci_resource_start(dev->pdev, 0), - hibmc->fb_size); - if (IS_ERR(vmm)) { - ret = PTR_ERR(vmm); + ret = drmm_vram_helper_init(dev, pci_resource_start(dev->pdev, 0), + hibmc->fb_size); + if (ret) { drm_err(dev, "Error initializing VRAM MM; %d\n", ret); return ret; } @@ -39,16 +36,6 @@ int hibmc_mm_init(struct hibmc_drm_private *hibmc) return 0; } -void hibmc_mm_fini(struct hibmc_drm_private *hibmc) -{ - struct drm_device *dev = &hibmc->dev; - - if (!dev->vram_mm) - return; - - drm_vram_helper_release_mm(dev); -} - int hibmc_dumb_create(struct drm_file *file, struct drm_device *dev, struct drm_mode_create_dumb *args) { -- 2.7.4