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: 1934351 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id E0E8E3FDDA for ; Fri, 4 Jan 2013 19:12:24 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B2E3AE5F64 for ; Fri, 4 Jan 2013 11:12:24 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-gh0-f202.google.com (mail-gh0-f202.google.com [209.85.160.202]) by gabe.freedesktop.org (Postfix) with ESMTP id 1820FE668A for ; Fri, 4 Jan 2013 11:10:38 -0800 (PST) Received: by mail-gh0-f202.google.com with SMTP id z10so1474011ghb.3 for ; Fri, 04 Jan 2013 11:10:37 -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=i2ocaVIyTr56zBMMKGwE2u8VP1h0obxaA5aGyzS76yOyDGK/I2hYGHIsRbSaQggz1w 4NHp3gHw4EA2BSbd2MVAlKoD0VD8d+Q86qXEBCFVKJZ2lL99fzf+4eKpjJpVG8J9JHXu LPatzyTk+I/QXUYNgsZ0N6JkL4wzHvjXYlYJ7Y9xgx0CqXz/SAUm/kWkiWxXqJ/I1+5e X5YRnMHg0SAoK54fL/adQM6Zcolcfw1jwHhihyz7Fdv1GEmbjG+gbmvpbLDnp71MWK5M XSsyQCH6/uYxxD5BCH2Jbx4RBnXsySwi+atwfdacVIDMB64C9eMEe2GoWNDFe8Jkmx6x 3tEA== 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 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: ALoCoQmWQuv+R6CypNjTNx2sHFTBeWgYu2bjzTH3oST+QVTCrpeSqWc46Bxb8NnEHjVickSjhawnwVWXI6WpyJY+6vrQ9prTF9adaRv0PhyNaUznrcmCGsa+i4d2vg93Eo8pzxmmvaV2z6iuIQYSCR/4+WCJlttROFqO/Vr1HLbrk82jtvaonTVTodUYUjZapbeXiMRtxLztRZou09vmWhqa2TFaD9HTqg== Cc: linux-pci@vger.kernel.org, dri-devel@lists.freedesktop.org, Betty Dall , Lucas Kannebley Tavares , Alex Deucher X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.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(-) 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);