Hi,

On further investigation it turns out that one large difference between
my x86 system and the arm64 system is they way the vga arbiter is
operating in the kernel. This means that the vga card isn't labelled as
the "boot vga" card, which affects how it's picked up by X.

On the HiSilicon board, I'm seeing:

[    0.815343] pci 0007:a1:00.0: vgaarb: VGA device added: 
decodes=io+mem,owns=none,locks=none
[    0.815355] pci 0007:a1:00.0: vgaarb: bridge control possible
[    0.815360] vgaarb: loaded

On an x86 vm I'm seeing:

[    0.390696] vgaarb: setting as boot device: PCI:0000:00:02.0
[    0.391245] vgaarb: device added: 
PCI:0000:00:02.0,decodes=io+mem,owns=io+mem,locks=none
[    0.393421] vgaarb: loaded
[    0.393811] vgaarb: bridge control possible 0000:00:02.0

(The difference in the format is due to different kernel versions)

Looking at the kernel source, it looks like the owns= section is getting
blanked because of the bridge that the VGA card is sitting behind.

>From drivers/gpu/vga/vgaarb.c:

        /* Mark that we "own" resources based on our enables, we will
         * clear that below if the bridge isn't forwarding
         */
        pci_read_config_word(pdev, PCI_COMMAND, &cmd);
        if (cmd & PCI_COMMAND_IO)
                vgadev->owns |= VGA_RSRC_LEGACY_IO;
        if (cmd & PCI_COMMAND_MEMORY)
                vgadev->owns |= VGA_RSRC_LEGACY_MEM;

        /* Check if VGA cycles can get down to us */
        bus = pdev->bus;
        while (bus) {
                bridge = bus->self;
                if (bridge) {
                        u16 l;

                        pci_read_config_word(bridge, PCI_BRIDGE_CONTROL, &l);
                        if (!(l & PCI_BRIDGE_CTL_VGA)) {
                                vgadev->owns = 0;
                                break;
                        }
                }
                bus = bus->parent;
        }

        /* Deal with VGA default device. Use first enabled one
         * by default if arch doesn't have it's own hook
         */
        if (vga_default == NULL &&
            ((vgadev->owns & VGA_RSRC_LEGACY_MASK) == VGA_RSRC_LEGACY_MASK)) {
                vgaarb_info(&pdev->dev, "setting as boot VGA device\n");
                vga_set_default_device(pdev);

Perhaps X should be be picking up the card through PCI probing on arm64
rather than platform probing which seems to rely a bit on boot VGA
devices. I will check this. But first I just wanted to check the PCI
topology: is the card behind any unusual bridges or switches?

I can write some kernel code next week to find out specifically why this
isn't being picked up, but I thought I'd check for HW quirks first.

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to xorg in Ubuntu.
https://bugs.launchpad.net/bugs/1691991

Title:
  Xorg Segmentation fault on Hisilicon D05 board (arm64)

Status in xorg package in Ubuntu:
  New

Bug description:
  ubuntu@ubuntu:~$ sudo /usr/lib/xorg/Xorg 
  [sudo] password for ubuntu: 

  X.Org X Server 1.18.4
  Release Date: 2016-07-19
  X Protocol Version 11, Revision 0
  Build Operating System: Linux 4.4.0-45-generic aarch64 Ubuntu
  Current Operating System: Linux ubuntu 4.10.0-20.22-generic 
#22+pearl.2-Ubuntu SMP Thu Apr 27 20:23:08 UTC 2017 aarch64
  Kernel command line: BOOT_IMAGE=/boot/vmlinuz-4.10.0-20.22-generic 
root=UUID=eee681c5-04ce-4cd0-a004-cae6717961ce ro debug 
earlycon=pl011,mmio,0x602B0000 console=tty0
  Build Date: 02 November 2016  10:05:28PM
  xorg-server 2:1.18.4-0ubuntu0.2 (For technical support please see 
http://www.ubuntu.com/support) 
  Current version of pixman: 0.33.6
        Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.
  Markers: (--) probed, (**) from config file, (==) default setting,
        (++) from command line, (!!) notice, (II) informational,
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
  (==) Log file: "/var/log/Xorg.0.log", Time: Fri May 19 18:10:13 2017
  (==) Using system config directory "/usr/share/X11/xorg.conf.d"
  pci id for fd 10: 19e5:1711, driver (null)
  EGL_MESA_drm_image required.
  (EE) 
  (EE) Backtrace:
  (EE) 0: /usr/lib/xorg/Xorg (xorg_backtrace+0x58) [0xaaaad7f1cc48]
  (EE) 
  (EE) Segmentation fault at address 0xa0
  (EE) 
  Fatal server error:
  (EE) Caught signal 11 (Segmentation fault). Server aborting
  (EE) 
  (EE) 
  Please consult the The X.Org Foundation support 
         at http://wiki.x.org
   for help. 
  (EE) Please also check the log file at "/var/log/Xorg.0.log" for additional 
information.
  (EE) 
  (EE) Server terminated with error (1). Closing log file.
  Aborted (core dumped)
  ubuntu@ubuntu:~$

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/xorg/+bug/1691991/+subscriptions

-- 
Mailing list: https://launchpad.net/~desktop-packages
Post to     : desktop-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~desktop-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to