]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
Merge branches 'acpica' and 'acpi-scan'
[mirror_ubuntu-zesty-kernel.git] / drivers / gpu / drm / amd / amdgpu / amdgpu_bios.c
index 2b6afe123f3d90acce64b35325da1f1e9dbd1fa6..8ec1967a850b86361b18535955fd161a0808f6d4 100644 (file)
@@ -70,10 +70,11 @@ static bool igp_read_bios_from_vram(struct amdgpu_device *adev)
                return false;
        }
        adev->bios = kmalloc(size, GFP_KERNEL);
-       if (adev->bios == NULL) {
+       if (!adev->bios) {
                iounmap(bios);
                return false;
        }
+       adev->bios_size = size;
        memcpy_fromio(adev->bios, bios, size);
        iounmap(bios);
        return true;
@@ -103,6 +104,7 @@ bool amdgpu_read_bios(struct amdgpu_device *adev)
                pci_unmap_rom(adev->pdev, bios);
                return false;
        }
+       adev->bios_size = size;
        memcpy_fromio(adev->bios, bios, size);
        pci_unmap_rom(adev->pdev, bios);
        return true;
@@ -135,6 +137,7 @@ static bool amdgpu_read_bios_from_rom(struct amdgpu_device *adev)
                DRM_ERROR("no memory to allocate for BIOS\n");
                return false;
        }
+       adev->bios_size = len;
 
        /* read complete BIOS */
        return amdgpu_asic_read_bios_from_rom(adev, adev->bios, len);
@@ -159,6 +162,7 @@ static bool amdgpu_read_platform_bios(struct amdgpu_device *adev)
        if (adev->bios == NULL) {
                return false;
        }
+       adev->bios_size = size;
 
        return true;
 }
@@ -273,6 +277,7 @@ static bool amdgpu_atrm_get_bios(struct amdgpu_device *adev)
                kfree(adev->bios);
                return false;
        }
+       adev->bios_size = size;
        return true;
 }
 #else
@@ -300,8 +305,9 @@ static bool amdgpu_acpi_vfct_bios(struct amdgpu_device *adev)
        GOP_VBIOS_CONTENT *vbios;
        VFCT_IMAGE_HEADER *vhdr;
 
-       if (!ACPI_SUCCESS(acpi_get_table_with_size("VFCT", 1, &hdr, &tbl_size)))
+       if (!ACPI_SUCCESS(acpi_get_table("VFCT", 1, &hdr)))
                return false;
+       tbl_size = hdr->length;
        if (tbl_size < sizeof(UEFI_ACPI_VFCT)) {
                DRM_ERROR("ACPI VFCT table present but broken (too short #1)\n");
                goto out_unmap;
@@ -334,6 +340,7 @@ static bool amdgpu_acpi_vfct_bios(struct amdgpu_device *adev)
        }
 
        adev->bios = kmemdup(&vbios->VbiosContent, vhdr->ImageLength, GFP_KERNEL);
+       adev->bios_size = vhdr->ImageLength;
        ret = !!adev->bios;
 
 out_unmap: