Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2070521ybv; Sun, 23 Feb 2020 22:03:02 -0800 (PST) X-Google-Smtp-Source: APXvYqxAdi+PcaDMMBmeykWs2QfLe6vbofYh5zWjGVLQ2dDrW/90Y4a1JPNNVnt1iowI2bB8o+sO X-Received: by 2002:a9d:66c1:: with SMTP id t1mr35239106otm.73.1582524182330; Sun, 23 Feb 2020 22:03:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582524182; cv=none; d=google.com; s=arc-20160816; b=aeqNcmpcmAp9DpaLNpGx8TV+YfYbur0rB2qup2XarjhVHyvNHU1xjbQEQjd5Pte23T X6SpZm8IQcqtuExDCb7XMJgWmDqiTCmm3J6TXA9yNpu5QDN7bDR9uO3XYGFpXhYLxDnG hSJMHZk7mq8HiI8rVCrvVOaopqc+dcR4CUgL+T0INDBFKK5Ysvg8CIUFn7lkswo1KLvi oEyXlP45GPGBzJoGI1+ogLZk3i/gqQD/eSfg2OYJDP02PhRxYQ+DXiPsR3ZFCuFT5CwG U3Czthbr6IOcahr6FdjlJ7RSSo6hO+yGxr3E7vXheOo7bRBCno9HkQ/nUVbKK/lSQscW +XAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=JKeXFOWaox3JNyfprXvMJ4JNaw9XFKLyMynWXgGRwvI=; b=aMVdSlHItOfNpg/vpBBkWdiHxX2HNti9ZGrII22C9tQZVAoK6ms7yE3cDX8J0XkbQr UdQwvXz+Q0PkoJiHeiBa4evCfMyyisdWzMy4xKyXPvOdj2AjLKBU5VHSo5WXIxNIPgRJ Tt0ueT9PENJLNiwgBDFhytCS1rP3alEywlaa8Y2z6SY3Z0NAiqQ7pmdFhCqbiD5OdqLB 48dXBaatRTZfGZU9qdQRzM4/C/NKqtIiRlUC5ivmllsRpIt5KxpZ4SSFWOFSS/qHdpr3 Er767gf8jGvQVd1ZoUdp0xiPi+Kfg453ef7NzgaVkwQY1drC8RlbnEMVsgBniMpPU99A NOFw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y6si4286993oih.217.2020.02.23.22.02.49; Sun, 23 Feb 2020 22:03:02 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727186AbgBXGCY (ORCPT + 99 others); Mon, 24 Feb 2020 01:02:24 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:10677 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726509AbgBXGCY (ORCPT ); Mon, 24 Feb 2020 01:02:24 -0500 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 7BBA65D9DB5044CD82B9; Mon, 24 Feb 2020 14:02:20 +0800 (CST) Received: from localhost.localdomain (10.69.192.56) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.439.0; Mon, 24 Feb 2020 14:02:13 +0800 From: Tian Tao To: , , , , , , , , , CC: Subject: [PATCH v2] drm/hisilicon: Fixed pcie resource conflict between drm and firmware Date: Mon, 24 Feb 2020 14:01:52 +0800 Message-ID: <1582524112-5628-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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org use the drm_fb_helper_remove_conflicting_pci_framebuffer to remove the framebuffer initialized by fireware/bootloader to avoid resource conflict. Signed-off-by: Tian Tao --- v2: use the general API to remove the conflict resource instead of rolling our own. --- --- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c index 4a8a4cf..7518980 100644 --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c @@ -327,6 +327,11 @@ static int hibmc_pci_probe(struct pci_dev *pdev, struct drm_device *dev; int ret; + ret = drm_fb_helper_remove_conflicting_pci_framebuffers(pdev, + "hibmcdrmfb"); + if (ret) + return ret; + dev = drm_dev_alloc(&hibmc_driver, &pdev->dev); if (IS_ERR(dev)) { DRM_ERROR("failed to allocate drm_device\n"); -- 2.7.4