From patchwork Mon Jun 25 21:06:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 10487265 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1D72860230 for ; Mon, 25 Jun 2018 21:06:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0FFDC286A8 for ; Mon, 25 Jun 2018 21:06:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0496C286BD; Mon, 25 Jun 2018 21:06:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9A508286A8 for ; Mon, 25 Jun 2018 21:06:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752042AbeFYVGY (ORCPT ); Mon, 25 Jun 2018 17:06:24 -0400 Received: from mail-qt0-f193.google.com ([209.85.216.193]:38552 "EHLO mail-qt0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751347AbeFYVGX (ORCPT ); Mon, 25 Jun 2018 17:06:23 -0400 Received: by mail-qt0-f193.google.com with SMTP id c5-v6so2523000qth.5 for ; Mon, 25 Jun 2018 14:06:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=2Tzogu5+ywMn3s05PnRF+5OuujtEVG8Y9msdt5eyn2c=; b=s2VBKZdWsVF5ho+9ueas0ukvO+gg4vqef3fu7xBUwO72O4It3tDZRBQQwpom9CY0yg 7WlXtToSZazi4i9RfFiAwbvXXPptvTgpCmZnzgwTxp0IU4ZQuAxJWn1t9edQEiN5TFyT kR73xHsfWuv/UPV5XVCaM5whXwoPPId55JDuu4HusVJWHDlNfW7lLTCRlZniINeL5mQv v92Q6k0sUEldjYiNUCYi+2dRcH2AHgUQkaFYHU8N5Z99NfJdquRjatVFvCVHcxrwOO28 vQ/wSyfOZVy66R/ik4R5aobF27zR4i42tCQIk7hQq9h5WeCmmq/VWSyEgNqWKHXGc3Iy H9Ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=2Tzogu5+ywMn3s05PnRF+5OuujtEVG8Y9msdt5eyn2c=; b=uJYvl3X5NrhsTY9R4n8V85InNvKutXbK6QGUOoJ5AbQl35j4YUZRBRkPsnZf8odpUC f3ULF5fi1U+/BTX7JSknszXJGC5JluGSM0aMBBkWz5xS/ueVuRgzoNh4K5FGDj1/TC6q cSZW8rS3dYH1MEZcnh1jpYnLeW0t0pWHOYgLIH4SCWypkp/15vhXJxEu+hAv2VKA4I1B D7O9Y2JwXcQ+aDGZL1wG8bDy7t2/2wVZTseNTqiNpcaoBOKpEl4A+N7PeUy7agxCNm/a mrEBCathqRGTKJapifbQaUpyy8txi6+IFrLj80KB+0uzlgRWnIXJKoRaTaCvAoVtw+Z2 CIdQ== X-Gm-Message-State: APt69E20Yz6jiezE0gi0wbf5ioQe9NdlObkPX/uceK6afceERDbYgi6o lXf5GfcfwoVZ+mfyYrnMyk4= X-Google-Smtp-Source: AAOMgpc0c0idcMAbWH3LpyhI9M8mZ5SliGQyaAMdrG15FvUxQRq0HKZSahDS2r8FrJ6VtKpRcTsq7A== X-Received: by 2002:a0c:cb13:: with SMTP id o19-v6mr12345500qvk.216.1529960783155; Mon, 25 Jun 2018 14:06:23 -0700 (PDT) Received: from localhost.localdomain ([76.1.164.143]) by smtp.gmail.com with ESMTPSA id q13-v6sm4016108qkl.97.2018.06.25.14.06.21 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 25 Jun 2018 14:06:22 -0700 (PDT) From: Alex Deucher X-Google-Original-From: Alex Deucher To: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, airlied@gmail.com, linux-pci@vger.kernel.org, bhelgaas@google.com Cc: Alex Deucher Subject: [PATCH 5/5] drm: drop drm_pcie_get_speed_cap_mask and drm_pcie_get_max_link_width Date: Mon, 25 Jun 2018 16:06:06 -0500 Message-Id: <20180625210606.2736-6-alexander.deucher@amd.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180625210606.2736-1-alexander.deucher@amd.com> References: <20180625210606.2736-1-alexander.deucher@amd.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP These functions duplicated functionality which was ultimately added to the pci core. All users of these functions have been ported to using the newly exposed pci functionality. These functions are no longer used, so drop them. Signed-off-by: Alex Deucher Reviewed-by: Dave Airlie --- drivers/gpu/drm/drm_pci.c | 58 ----------------------------------------------- include/drm/drm_pci.h | 7 ------ 2 files changed, 65 deletions(-) diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c index 4db9c515b74f..896e42a34895 100644 --- a/drivers/gpu/drm/drm_pci.c +++ b/drivers/gpu/drm/drm_pci.c @@ -326,64 +326,6 @@ int drm_legacy_pci_init(struct drm_driver *driver, struct pci_driver *pdriver) } EXPORT_SYMBOL(drm_legacy_pci_init); -int drm_pcie_get_speed_cap_mask(struct drm_device *dev, u32 *mask) -{ - struct pci_dev *root; - u32 lnkcap, lnkcap2; - - *mask = 0; - if (!dev->pdev) - return -EINVAL; - - root = dev->pdev->bus->self; - - /* we've been informed via and serverworks don't make the cut */ - if (root->vendor == PCI_VENDOR_ID_VIA || - root->vendor == PCI_VENDOR_ID_SERVERWORKS) - return -EINVAL; - - pcie_capability_read_dword(root, PCI_EXP_LNKCAP, &lnkcap); - pcie_capability_read_dword(root, PCI_EXP_LNKCAP2, &lnkcap2); - - if (lnkcap2) { /* PCIe r3.0-compliant */ - if (lnkcap2 & PCI_EXP_LNKCAP2_SLS_2_5GB) - *mask |= DRM_PCIE_SPEED_25; - if (lnkcap2 & PCI_EXP_LNKCAP2_SLS_5_0GB) - *mask |= DRM_PCIE_SPEED_50; - if (lnkcap2 & PCI_EXP_LNKCAP2_SLS_8_0GB) - *mask |= DRM_PCIE_SPEED_80; - } else { /* pre-r3.0 */ - if (lnkcap & PCI_EXP_LNKCAP_SLS_2_5GB) - *mask |= DRM_PCIE_SPEED_25; - if (lnkcap & PCI_EXP_LNKCAP_SLS_5_0GB) - *mask |= (DRM_PCIE_SPEED_25 | DRM_PCIE_SPEED_50); - } - - DRM_INFO("probing gen 2 caps for device %x:%x = %x/%x\n", root->vendor, root->device, lnkcap, lnkcap2); - return 0; -} -EXPORT_SYMBOL(drm_pcie_get_speed_cap_mask); - -int drm_pcie_get_max_link_width(struct drm_device *dev, u32 *mlw) -{ - struct pci_dev *root; - u32 lnkcap; - - *mlw = 0; - if (!dev->pdev) - return -EINVAL; - - root = dev->pdev->bus->self; - - pcie_capability_read_dword(root, PCI_EXP_LNKCAP, &lnkcap); - - *mlw = (lnkcap & PCI_EXP_LNKCAP_MLW) >> 4; - - DRM_INFO("probing mlw for device %x:%x = %x\n", root->vendor, root->device, lnkcap); - return 0; -} -EXPORT_SYMBOL(drm_pcie_get_max_link_width); - #else void drm_pci_agp_destroy(struct drm_device *dev) {} diff --git a/include/drm/drm_pci.h b/include/drm/drm_pci.h index 674599025d7d..8181e9e7cf1d 100644 --- a/include/drm/drm_pci.h +++ b/include/drm/drm_pci.h @@ -58,11 +58,4 @@ static inline int drm_get_pci_dev(struct pci_dev *pdev, } #endif -#define DRM_PCIE_SPEED_25 1 -#define DRM_PCIE_SPEED_50 2 -#define DRM_PCIE_SPEED_80 4 - -int drm_pcie_get_speed_cap_mask(struct drm_device *dev, u32 *speed_mask); -int drm_pcie_get_max_link_width(struct drm_device *dev, u32 *mlw); - #endif /* _DRM_PCI_H_ */