Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3631pxu; Thu, 3 Dec 2020 17:27:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJzVNarh98wOsTaxnwlV4lkDx1ebkm97CoXQite3I0sNdyfEuAE/I7a3jJXJFUgkglQgGzVk X-Received: by 2002:a50:cfcf:: with SMTP id i15mr5504843edk.351.1607045264527; Thu, 03 Dec 2020 17:27:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607045264; cv=none; d=google.com; s=arc-20160816; b=Iwx3uMtUKovw3vPIo0/GWBKCcQDPh0f058vskNZx2bYwJhoLcLBOHMz6GUFZ7eoKhj KrVgbEMrIlXpHLFlPeWPItw67ka7Q6VFO2jn0iWlJuPh0wZVyipv+YNNuPwvBoeX1C8r DySiguEKOpTS9nVHeDPr6kcsOyyhs7rR9eGCOm3u1Ce9ZEQx96BGw+gs3Lsr0Or9t3O9 3lMfhzZpqknOeBfEOVBMUtmhVDpzxvauUPjlMSvUEpzeOd9UVFu8LLAeEu+kfXHoupmT P9Pl7rzzDFN+iAXJjGrYwBr0QamAYDfRa/YFjf0Nrk5Fm3qFAdsCrP3nQiB+Mdhjqof9 JPsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:to:from; bh=UX79FLME9XkF0FTnfiWanxcofMPaI+pm488UY78fSjM=; b=hLLtTjYZUrRoDFHdpzbbF2Ma1y4L3R2Zox8jKd0LhF8WewQSlPWhSPci+dqNWVeH7P +CSPsuBFyVtWor17YWyUVOTJK5uhnbDKGPxz83q16TzqN+vORvnmhG1deLeLhZihsHEk xP1vQMg0JlUqjj/pjTdg8eaJNb9cjf12g/+7Cj5pIRWaCeketGw3Anf2SWg/zGna0LMp LkmaRvmuHFEkVOI1vL6Z0CRsmfoBEHJIrJFa3HneDCKfE2uQguwlbLYpshX5cCsDUeqH RFfvtrAtpD4/D78eB/C+U43bb0runVtq1qdGu83qZRhKk6FZ2elmtqlJjdWqiu2iZwEw ftow== 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 n25si1933922edy.231.2020.12.03.17.27.22; Thu, 03 Dec 2020 17:27:44 -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 S1731959AbgLDBYl (ORCPT + 99 others); Thu, 3 Dec 2020 20:24:41 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:8638 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389549AbgLDBYk (ORCPT ); Thu, 3 Dec 2020 20:24:40 -0500 Received: from DGGEMS405-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4CnFLq5D4jz15XBJ; Fri, 4 Dec 2020 09:22:43 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.487.0; Fri, 4 Dec 2020 09:23:08 +0800 From: Tian Tao To: , , , , , , , , Subject: [PATCH v2] drm/hisilicon: Delete the entire file hibmc_ttm.c Date: Fri, 4 Dec 2020 09:23:18 +0800 Message-ID: <1607044999-47666-13-git-send-email-tiantao6@hisilicon.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1607044999-47666-1-git-send-email-tiantao6@hisilicon.com> References: <1607044999-47666-1-git-send-email-tiantao6@hisilicon.com> 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 Delete the entire file hibmc_ttm.c. drmm_vram_helper_init() can be called directly from hibmc_load(). hibmc_dumb_create() and hibmc_mode_funcs can go to hibmc_drm_drv.c v2: change Deletted to Delete Signed-off-by: Tian Tao Reviewed-by: Thomas Zimmermann --- drivers/gpu/drm/hisilicon/hibmc/Makefile | 2 +- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 21 ++++++++++- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.h | 4 -- drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c | 50 ------------------------- 4 files changed, 20 insertions(+), 57 deletions(-) delete mode 100644 drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c diff --git a/drivers/gpu/drm/hisilicon/hibmc/Makefile b/drivers/gpu/drm/hisilicon/hibmc/Makefile index 684ef79..d25c75e 100644 --- a/drivers/gpu/drm/hisilicon/hibmc/Makefile +++ b/drivers/gpu/drm/hisilicon/hibmc/Makefile @@ -1,4 +1,4 @@ # SPDX-License-Identifier: GPL-2.0-only -hibmc-drm-y := hibmc_drm_drv.o hibmc_drm_de.o hibmc_drm_vdac.o hibmc_ttm.o hibmc_drm_i2c.o +hibmc-drm-y := hibmc_drm_drv.o hibmc_drm_de.o hibmc_drm_vdac.o hibmc_drm_i2c.o obj-$(CONFIG_DRM_HISI_HIBMC) += hibmc-drm.o diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c index 5aea2e9..3687753 100644 --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c @@ -16,6 +16,7 @@ #include #include +#include #include #include #include @@ -43,6 +44,12 @@ static irqreturn_t hibmc_drm_interrupt(int irq, void *arg) return IRQ_HANDLED; } +static int hibmc_dumb_create(struct drm_file *file, struct drm_device *dev, + struct drm_mode_create_dumb *args) +{ + return drm_gem_vram_fill_create_dumb(file, dev, 0, 128, args); +} + static const struct drm_driver hibmc_driver = { .driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC, .fops = &hibmc_fops, @@ -77,6 +84,13 @@ static const struct dev_pm_ops hibmc_pm_ops = { hibmc_pm_resume) }; +static const struct drm_mode_config_funcs hibmc_mode_funcs = { + .mode_valid = drm_vram_helper_mode_valid, + .atomic_check = drm_atomic_helper_check, + .atomic_commit = drm_atomic_helper_commit, + .fb_create = drm_gem_fb_create, +}; + static int hibmc_kms_init(struct hibmc_drm_private *priv) { struct drm_device *dev = &priv->dev; @@ -262,9 +276,12 @@ static int hibmc_load(struct drm_device *dev) if (ret) goto err; - ret = hibmc_mm_init(priv); - if (ret) + ret = drmm_vram_helper_init(dev, pci_resource_start(dev->pdev, 0), + priv->fb_size); + if (ret) { + drm_err(dev, "Error initializing VRAM MM; %d\n", ret); goto err; + } ret = hibmc_kms_init(priv); if (ret) diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.h b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.h index 2786de5..a49c10e 100644 --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.h +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.h @@ -64,10 +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); -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); -extern const struct drm_mode_config_funcs hibmc_mode_funcs; - #endif diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c deleted file mode 100644 index 892d566..0000000 --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_ttm.c +++ /dev/null @@ -1,50 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -/* Hisilicon Hibmc SoC drm driver - * - * Based on the bochs drm driver. - * - * Copyright (c) 2016 Huawei Limited. - * - * Author: - * Rongrong Zou - * Rongrong Zou - * Jianhua Li - */ - -#include - -#include -#include -#include -#include -#include - -#include "hibmc_drm_drv.h" - -int hibmc_mm_init(struct hibmc_drm_private *hibmc) -{ - int ret; - struct drm_device *dev = &hibmc->dev; - - 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; - } - - return 0; -} - -int hibmc_dumb_create(struct drm_file *file, struct drm_device *dev, - struct drm_mode_create_dumb *args) -{ - return drm_gem_vram_fill_create_dumb(file, dev, 0, 128, args); -} - -const struct drm_mode_config_funcs hibmc_mode_funcs = { - .mode_valid = drm_vram_helper_mode_valid, - .atomic_check = drm_atomic_helper_check, - .atomic_commit = drm_atomic_helper_commit, - .fb_create = drm_gem_fb_create, -}; -- 2.7.4