From patchwork Fri Jun 9 06:57:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Axtens X-Patchwork-Id: 9780141 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 EA3CC60352 for ; Sun, 11 Jun 2017 11:18:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E9EAC28553 for ; Sun, 11 Jun 2017 11:18:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DE8812857D; Sun, 11 Jun 2017 11:18:32 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 54A4428553 for ; Sun, 11 Jun 2017 11:18:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 038D96E062; Sun, 11 Jun 2017 11:17:22 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pf0-x243.google.com (mail-pf0-x243.google.com [IPv6:2607:f8b0:400e:c00::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id 528EA6E565 for ; Fri, 9 Jun 2017 06:58:11 +0000 (UTC) Received: by mail-pf0-x243.google.com with SMTP id f27so7689479pfe.0 for ; Thu, 08 Jun 2017 23:58:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axtens.net; s=google; h=from:to:cc:subject:date:message-id; bh=AAxkBt7rlF1kWXgxW2OTx4Z9Ws3RrCwCZAPJ8B6N60Q=; b=kUxtjmtQhbdXtE1KopWx2MqZXowqhen+wpdoLIstUYGn8gXNnuhBSJuCn5U3fJag2h 6jP92VQHlJvqw6uvy7+TXhO9CweWysGcubq0EklKRmdy6RFU7CaySVntEVrFh/CnDuY9 75v0Ug21palLkIFW6dPHUhvWY+xW5iDsTJaZY= 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; bh=AAxkBt7rlF1kWXgxW2OTx4Z9Ws3RrCwCZAPJ8B6N60Q=; b=gcJ4pYkefqI6DPy3Igwse7tWm9lOWOXRJTfF7Crogkv53BwO4+gQLmum4USdxnD1/N Wn43RFvRimxyltkQACSTukNenysc0ngWYqHazrU/lEMG8DjUodH4Rp6qpZdvKghKO8Ce gV5Pvd0nDJL4O5mooeGvv2WsZJYxSrghsjDz+lPN0XvDIMDNc2QGiKEmQr0wPRr+BuMH I5oTLzF7piw+5ntFTBM/NdXAx7aOoBsU1udUOo6f2cmz+4Q224gr+pdfUB/+cRv3LyIL KOjSTJ6d2U71tmQVt7RinyBGlmq34RFeJc2ozn2FRqmD7J3O5TRQYVE3Q5u+uWks/d38 3qKA== X-Gm-Message-State: AODbwcCcI2nE0G420oigQtzn/vutzQxCqGuVnd8okSzaXTgHNhP+cJgP h5Ul32a9X4P3FzZu04dFiQ== X-Received: by 10.98.198.130 with SMTP id x2mr41088734pfk.232.1496991490536; Thu, 08 Jun 2017 23:58:10 -0700 (PDT) Received: from localhost.localdomain (124-171-203-65.dyn.iinet.net.au. [124.171.203.65]) by smtp.gmail.com with ESMTPSA id 62sm686856pfz.39.2017.06.08.23.58.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Jun 2017 23:58:10 -0700 (PDT) From: Daniel Axtens To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm: hibmc: Use set_busid function from drm core Date: Fri, 9 Jun 2017 16:57:57 +1000 Message-Id: <20170609065757.9736-1-dja@axtens.net> X-Mailer: git-send-email 2.11.0 X-Mailman-Approved-At: Sun, 11 Jun 2017 11:17:15 +0000 Cc: Xinliang Liu , Rongrong Zou , Daniel Axtens X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Currently, calling drmGetBusid from libdrm on a hibmc VGA card returns a string like "0007:a1:00.0". The busid reported by most cards begins with "pci:". For example, on an amd64 system, a VGA card reported "pci:0000:00:02.0". The missing "pci:" prefix confuses Xorg and leads to crashes and other misbehaviour.[0] Use the standard helper from the drm core to set the busid to include the "pci:" prefix. This is done by many other drivers. With this patch, Xorg can be run successfully. [0]: https://bugs.launchpad.net/ubuntu/+source/xorg/+bug/1691991 Cc: Xinliang Liu Cc: Rongrong Zou Signed-off-by: Daniel Axtens --- drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c index 2ffdbf9801bd..9663a633897a 100644 --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_drv.c @@ -69,6 +69,7 @@ static struct drm_driver hibmc_driver = { .dumb_map_offset = hibmc_dumb_mmap_offset, .dumb_destroy = drm_gem_dumb_destroy, .irq_handler = hibmc_drm_interrupt, + .set_busid = drm_pci_set_busid, }; static int __maybe_unused hibmc_pm_suspend(struct device *dev)