Announcement

Collapse
No announcement yet.

More Radeon & AMDGPU Fixes Line-Up For Linux 4.10

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #11
    Originally posted by netkas View Post
    logs, subsys 0x012B - primary device, with output, 0x012A - secondary, no outputs (opencl only). hdmi port connected to display. radeon is not boot gpu (it's POSTed but no outputs on it durring boot efi boot, I connect hdmi to nmp when grub shows up, specific config to get these logs)
    4.9.3, amdgpu - http://pastebin.com/7VM8Z1Bn
    4.4, radeon - http://pastebin.com/ZYww8bx1
    According to the log, the driver is not able to find the vbios image for one of the cards (probably the one with the displays attached to it because the one with the driver loaded has no displays detected as attached). There is probably some proprietary, mac-specific magic required to fetch the vbios image on these macs.

    Comment


    • #12
      you are right,0x12a is primary, 0x12b is secondary (opencl only)
      so vfct only has vbios for secondary card.

      can I specify some external location (a file) for vbios somehow ?

      Comment


      • #13

        Thanks for getting the logs. Problem seems to be:

        Code:
        [    8.358193] [drm] initializing kernel modesetting (PITCAIRN 0x1002:0x6810 0x106B:0x012A 0x00).
        [    8.379700] [drm] register mmio base: 0xA0600000
        [    8.400813] [drm] register mmio size: 262144
        [    8.421487] [drm] ACPI VFCT contains a BIOS for 02:00.0 1002:6810, size 65536
        [    8.442002] [drm] ACPI VFCT table is not for this card
        [    8.462549] amdgpu 0000:06:00.0: Invalid PCI ROM header signature: expecting 0xaa55, got 0x0000
        [    8.483276] amdgpu 0000:06:00.0: Invalid PCI ROM header signature: expecting 0xaa55, got 0x0000
        [    8.503611] [drm:amdgpu_get_bios [amdgpu]] *ERROR* Unable to locate a BIOS ROM
        [    8.523669] amdgpu 0000:06:00.0: Fatal error during GPU init
        [    8.543586] [drm] amdgpu: finishing device.
        Looks like the ROM info in the table may not be correct (but that's just a first guess). Same error with both drivers.

        EDIT - sorry, I missed your second post there. I don't *think* we have a file option for VBIOS but will check.
        Test signature

        Comment


        • #14
          sp, infact VFCT table has two vbioses, for both cards (master and slave), first going slave vbios, then master vbios.

          Radeon driver is only able to extract first one. (in facts it's only looking for first one)

          windows amd drivers I believe is able to extract both

          here is that vfct table - http://rgho.st/6pG498pFz

          first vbios starts at 0x68, second vbios starts at 0x10084

          Last edited by netkas; 24 January 2017, 03:07 PM.

          Comment


          • #15
            so, here
            http://lxr.free-electrons.com/source...on_bios.c#L597

            if check for first vbios failed at line 630, a check for second vbios need to be done, it can be found at

            if ((vfct->VBIOSImageOffset + sizeof(VFCT_IMAGE_HEADER) + vhdr->ImageLength) < tbt_size) {

            vhdr = vfct->VBIOSImageOffset + sizeof(VFCT_IMAGE_HEADER) + vhdr->ImageLength;

            //start some checks again

            }

            Comment


            • #16
              I'll try to test this updated function some time soon, will report back.

              Code:
              static bool radeon_acpi_vfct_bios(struct radeon_device *rdev)
              
              {
              
              bool ret = false;
              
                  bool vbios_found = false;
              
              struct acpi_table_header *hdr;
              
              acpi_size tbl_size;
              
              UEFI_ACPI_VFCT *vfct;
              
              GOP_VBIOS_CONTENT *vbios;
              
              VFCT_IMAGE_HEADER *vhdr;
              
                  uint16_t vbios_index = 0;
              
                  uint32_t vbios_offset = 0;
              
              if (!ACPI_SUCCESS(acpi_get_table_with_size("VFCT", 1, &hdr, &tbl_size)))
              
              return false;
              
              if (tbl_size < sizeof(UEFI_ACPI_VFCT)) {
              
              DRM_ERROR("ACPI VFCT table present but broken (too short #1)\n");
              
              goto out_unmap;
              
              }
              
              
              
                  vfct = (UEFI_ACPI_VFCT *)hdr;
              
              
              
              
                  while (vbios_found == false)
              
                  {
              
              
              
                      if (vfct->VBIOSImageOffset + sizeof(VFCT_IMAGE_HEADER) + vbios_offset > tbl_size) {
              
                          DRM_ERROR("ACPI VFCT table present but broken (too short #2)\n");
              
                          goto out_unmap;
              
                      }
              
              
              
                      vbios = (GOP_VBIOS_CONTENT *)((char *)hdr + vfct->VBIOSImageOffset + vbios_offset);
              
                      vhdr = &vbios->VbiosHeader;
              
                      DRM_INFO("ACPI VFCT[%d] contains a BIOS for %02x:%02x.%d %04x:%04x, size %d\n", vbios_index,
              
                               vhdr->PCIBus, vhdr->PCIDevice, vhdr->PCIFunction,
              
                               vhdr->VendorID, vhdr->DeviceID, vhdr->ImageLength);
              
              
              
                      if (vhdr->PCIBus == rdev->pdev->bus->number &&
              
                          vhdr->PCIDevice == PCI_SLOT(rdev->pdev->devfn) &&
              
                          vhdr->PCIFunction == PCI_FUNC(rdev->pdev->devfn) &&
              
                          vhdr->VendorID == rdev->pdev->vendor &&
              
                          vhdr->DeviceID == rdev->pdev->device) {            
              
                          vbios_found = true;
              
                          break;
              
                      } else {
              
                          DRM_INFO("ACPI VFCT[%d] table is not for this card\n", vbios_index);
              
                      }
              
              
              
                      if (vfct->VBIOSImageOffset + sizeof(VFCT_IMAGE_HEADER) + vhdr->ImageLength + vbios_offset > tbl_size) {
              
                          DRM_ERROR("ACPI VFCT image truncated\n");
              
                          goto out_unmap;
              
                      }
              
                      if (vfct->VBIOSImageOffset + sizeof(VFCT_IMAGE_HEADER) + vhdr->ImageLength + vbios_offset < tbl_size) {
              
                          DRM_INFO("Checking next ACPI VFCT bios image\n");
              
                          vbios_index++;
              
                          vbios_offset += sizeof(VFCT_IMAGE_HEADER) + vhdr->ImageLength;
              
              
              
              
                      }
              
                  }
              
                  if (!vbios_found) goto out_unmap;
              
              
              
              
              rdev->bios = kmemdup(&vbios->VbiosContent, vhdr->ImageLength, GFP_KERNEL);
              
              ret = !!rdev->bios;
              
              
              
              
              out_unmap:
              
              return ret;
              
              }

              Comment


              • #17
                hello again.

                tested my patch, it works, I get screen output and acceleration

                log: http://pastebin.com/GrxUUPHZ

                interesting part of log -
                [ 2.154872] [drm] ACPI VFCT[0] contains a BIOS for 02:00.0 1002:6810, size 65536

                [ 4.497936] [drm] ACPI VFCT[0] contains a BIOS for 02:00.0 1002:6810, size 65536

                [ 4.497939] [drm] ACPI VFCT[0] table is not for this card

                [ 4.497941] [drm] Checking next ACPI VFCT bios image

                [ 4.497944] [drm] ACPI VFCT[1] contains a BIOS for 06:00.0 1002:6810, size 65536

                the patch - http://rgho.st/8YFjKysNy

                however after about 1 min the system hard freezes(even without x.org running), tried radeon.dpm=0, no change. kernel 4.4
                Last edited by netkas; 25 January 2017, 05:18 AM.

                Comment


                • #18
                  tried 4.9.5 kernel

                  with radeon - same patch, same behaviour


                  with amdgpu:
                  the log - http://pastebin.com/NiTiWAYi
                  the patch - http://rgho.st/68s7Zq9V9

                  system doesn't freeze.

                  but everything is green.

                  in console, black became green, white is still white.
                  Xorg - everything is greenish, I can see colors - red, blue, green (in glxgear), but the darker the color the more greenish it is. the brighter the color the more magentish it is.
                  Last edited by netkas; 25 January 2017, 09:39 AM.

                  Comment


                  • #19
                    Originally posted by debianxfce View Post

                    If you use kernel from kernel.org or similar, they have minimal amount of new amdgpu code (see the diff column from kernel.org) , so code is UNFINISHED AS YOU SEE WITH DMESG. Use this for the amdgpu driver:
                    https://cgit.freedesktop.org/%7Eagd5...-next-4.11-wip
                    And this:
                    https://launchpad.net/~paulo-miguel-...mesa/+packages
                    already had mesa &stuff from that ppa installed.

                    I have tried the kernel form drm-next-4.11-wip.
                    There is absolutely no difference in results versus 4.9.5 (== exactly same results)


                    also, 4.9.5+amdgpu hardfreezed after some time too (it took much longer than with radeon driver)

                    when system freeze happens, display goes black as well.

                    patches for drm-next-4.11-wip
                    radeon: http://rgho.st/6xtTt6XDf
                    amdgpu: http://rgho.st/8HxfqWdFg

                    Comment


                    • #20
                      Originally posted by netkas View Post
                      patches for drm-next-4.11-wip
                      radeon: http://rgho.st/6xtTt6XDf
                      amdgpu: http://rgho.st/8HxfqWdFg
                      Please generate proper git patches, sign off on them, and send the patches to the amd-gfx mailing list.

                      Comment

                      Working...
                      X