From patchwork Fri Jan 4 19:10:37 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 209523 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 465BC2C0085 for ; Sat, 5 Jan 2013 06:18:54 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754238Ab3ADTSx (ORCPT ); Fri, 4 Jan 2013 14:18:53 -0500 Received: from mail-vb0-f74.google.com ([209.85.212.74]:40869 "EHLO mail-vb0-f74.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754013Ab3ADTSw (ORCPT ); Fri, 4 Jan 2013 14:18:52 -0500 Received: by mail-vb0-f74.google.com with SMTP id s24so1786732vbi.1 for ; Fri, 04 Jan 2013 11:18:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:subject:to:from:cc:date:message-id:in-reply-to :references:user-agent:mime-version:content-type :content-transfer-encoding; bh=qrkpKHAaveMwV1oxuFzBRiMzvJaLADIkjUaw4N37h60=; b=GDXZkY2bg7q7V/ay01D0gj2pdKPWxrrcQXTHLl2M8eWsrgZPM5ouvSVykqAZBZWs7P 7hnZVHSG+4vx9xgdSNyw5jDq1dvoOgpKdEpsvsU7pjU72onttNTZlggRUt7yoZJSnK2n mLmn9LTehPaf3Sly+9CF4tT3gKN51/UwxVEe0zpZWq898t5rUdxiS4yKWCKMO60Bgsd5 1O/3Ta9sWuume1O66ArDsap0vWIcHJzhy5bUaydFXMn1V+Z7sQMkYBRyTI8Eg3RDQdTK iceHysN34b8VKISI9jSE/vZbR6OUFKqYTd6CZBi1jayoYU8XwAOKUcOpfseDmZT8h+e+ XQqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:subject:to:from:cc:date:message-id:in-reply-to :references:user-agent:mime-version:content-type :content-transfer-encoding:x-gm-message-state; bh=qrkpKHAaveMwV1oxuFzBRiMzvJaLADIkjUaw4N37h60=; b=Z75SZfB1okWFaGyjEaw4nlGrY1diPl07AiUc31Wg9CoKt5TCap0tS+UB9DDqeCfUhJ yO3uZLVzseKG2TpGRLNR5eopkaqyBiuoKncsDjcHmCs7rMRsGVSUe8dXeNJ5aDicUuyH Yi1JUqr58dlqajHP919DI8a+DqAlW2fwBsmqhzvVMtl+Cuc2PcSx9NQGUQ9VT+5UVLZq XHdTw5bSspcu26ortzMd6OcB2q9ysHvn74IuxtduqJxLmu5b0hnBnXzRDgUpyZUxe021 qlTXpHrz65FYGir5wEJun5UPzGuTyI3smUvPDTdzKmZSuI9uPKD+A6v6VDrCMF720iUp 6Lkw== X-Received: by 10.236.69.101 with SMTP id m65mr28042827yhd.27.1357326637606; Fri, 04 Jan 2013 11:10:37 -0800 (PST) Received: from wpzn3.hot.corp.google.com (216-239-44-65.google.com [216.239.44.65]) by gmr-mx.google.com with ESMTPS id i63si4425261yhk.5.2013.01.04.11.10.37 (version=TLSv1/SSLv3 cipher=AES128-SHA); Fri, 04 Jan 2013 11:10:37 -0800 (PST) Received: from bhelgaas.mtv.corp.google.com (bhelgaas.mtv.corp.google.com [172.17.131.112]) by wpzn3.hot.corp.google.com (Postfix) with ESMTP id 6E0EA100047; Fri, 4 Jan 2013 11:10:37 -0800 (PST) Received: from bhelgaas.mtv.corp.google.com (unknown [IPv6:::1]) by bhelgaas.mtv.corp.google.com (Postfix) with ESMTP id 283EA18016C; Fri, 4 Jan 2013 11:10:37 -0800 (PST) Subject: [PATCH 2/3] drm/pci: Set all supported speeds in speed cap mask for pre-3.0 devices To: David Airlie From: Bjorn Helgaas Cc: linux-pci@vger.kernel.org, dri-devel@lists.freedesktop.org, Alex Deucher , Betty Dall , Lucas Kannebley Tavares , Ilija Hadzic Date: Fri, 04 Jan 2013 12:10:37 -0700 Message-ID: <20130104191037.4586.96280.stgit@bhelgaas.mtv.corp.google.com> In-Reply-To: <20130104190833.4586.16520.stgit@bhelgaas.mtv.corp.google.com> References: <20130104190833.4586.16520.stgit@bhelgaas.mtv.corp.google.com> User-Agent: StGit/0.15 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQlj6aRJSsRFV2sc7yxEJlU+H4C5P4eCPCnmEWBlRBkIJXz6lDjTp1jTp7X9zFHUN465Fi2SgK4vYKFoy70xU006OAQk/Ki2mnZJDbZkBB+8OpsOks4YjfJgHEIr8YYibxsm7VPLmX0ff+Fy7M+fdsexChNAHmJNlKJ47esAQJ7sgA9RItmCx6JEkLAjHCRGMkczAxuc1wACzrmOAsoCRxLE4m3USQ== Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org For devices that conform to PCIe r3.0 and have a Link Capabilities 2 register, we test and report every bit in the Supported Link Speeds Vector field. For a device that supports both 2.5GT/s and 5.0GT/s, we set both DRM_PCIE_SPEED_25 and DRM_PCIE_SPEED_50 in the returned mask. For pre-r3.0 devices, the Link Capabilities 0010b encoding (PCI_EXP_LNKCAP_SLS_5_0GB) means that both 5.0GT/s and 2.5GT/s are supported, so set both DRM_PCIE_SPEED_25 and DRM_PCIE_SPEED_50 in this case as well. Signed-off-by: Bjorn Helgaas --- drivers/gpu/drm/drm_pci.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c index 11c8add..50e26f2 100644 --- a/drivers/gpu/drm/drm_pci.c +++ b/drivers/gpu/drm/drm_pci.c @@ -507,7 +507,7 @@ int drm_pcie_get_speed_cap_mask(struct drm_device *dev, u32 *mask) 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_50; + *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);