Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amdgpu: Remove checking for atombios

This is a left over from radeon, amdgpu doesn't support any
non-atombios parts and amdgpu_device_init would bail if the
check for atombios failed anyway.

Reviewed-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Signed-off-by: Nils Wallménius <nils.wallmenius@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Nils Wallménius and committed by
Alex Deucher
f7e9e9fe e11666eb

+16 -34
-1
drivers/gpu/drm/amd/amdgpu/amdgpu.h
··· 1333 1333 /* BIOS */ 1334 1334 uint8_t *bios; 1335 1335 uint32_t bios_size; 1336 - bool is_atom_bios; 1337 1336 struct amdgpu_bo *stollen_vga_memory; 1338 1337 uint32_t bios_scratch[AMDGPU_BIOS_NUM_SCRATCH]; 1339 1338
+4 -6
drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
··· 672 672 673 673 if ((enc->devices & (ATOM_DEVICE_LCD_SUPPORT)) && 674 674 enc->enc_priv) { 675 - if (adev->is_atom_bios) { 676 - struct amdgpu_encoder_atom_dig *dig = enc->enc_priv; 677 - if (dig->bl_dev) { 678 - atif->encoder_for_bl = enc; 679 - break; 680 - } 675 + struct amdgpu_encoder_atom_dig *dig = enc->enc_priv; 676 + if (dig->bl_dev) { 677 + atif->encoder_for_bl = enc; 678 + break; 681 679 } 682 680 } 683 681 }
+6 -6
drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
··· 394 394 if (!bios_header_start) { 395 395 goto free_bios; 396 396 } 397 + 398 + /* Must be an ATOMBIOS */ 397 399 tmp = bios_header_start + 4; 398 - if (!memcmp(adev->bios + tmp, "ATOM", 4) || 399 - !memcmp(adev->bios + tmp, "MOTA", 4)) { 400 - adev->is_atom_bios = true; 401 - } else { 402 - adev->is_atom_bios = false; 400 + if (memcmp(adev->bios + tmp, "ATOM", 4) && 401 + memcmp(adev->bios + tmp, "MOTA", 4)) { 402 + goto free_bios; 403 403 } 404 404 405 - DRM_DEBUG("%sBIOS detected\n", adev->is_atom_bios ? "ATOM" : "COM"); 405 + DRM_DEBUG("ATOMBIOS detected\n"); 406 406 return true; 407 407 free_bios: 408 408 kfree(adev->bios);
+1 -7
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
··· 1605 1605 adev->pdev = pdev; 1606 1606 adev->flags = flags; 1607 1607 adev->asic_type = flags & AMD_ASIC_MASK; 1608 - adev->is_atom_bios = false; 1609 1608 adev->usec_timeout = AMDGPU_MAX_USEC_TIMEOUT; 1610 1609 adev->mc.gtt_size = 512 * 1024 * 1024; 1611 1610 adev->accel_working = false; ··· 1719 1720 r = -EINVAL; 1720 1721 goto failed; 1721 1722 } 1722 - /* Must be an ATOMBIOS */ 1723 - if (!adev->is_atom_bios) { 1724 - dev_err(adev->dev, "Expecting atombios for GPU\n"); 1725 - r = -EINVAL; 1726 - goto failed; 1727 - } 1723 + 1728 1724 r = amdgpu_atombios_init(adev); 1729 1725 if (r) { 1730 1726 dev_err(adev->dev, "amdgpu_atombios_init failed\n");
+4 -6
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
··· 582 582 { 583 583 int sz; 584 584 585 - if (adev->is_atom_bios) { 586 - adev->mode_info.coherent_mode_property = 587 - drm_property_create_range(adev->ddev, 0 , "coherent", 0, 1); 588 - if (!adev->mode_info.coherent_mode_property) 589 - return -ENOMEM; 590 - } 585 + adev->mode_info.coherent_mode_property = 586 + drm_property_create_range(adev->ddev, 0 , "coherent", 0, 1); 587 + if (!adev->mode_info.coherent_mode_property) 588 + return -ENOMEM; 591 589 592 590 adev->mode_info.load_detect_property = 593 591 drm_property_create_range(adev->ddev, 0, "load detection", 0, 1);
+1 -2
drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c
··· 231 231 if (amdgpu_hw_i2c) 232 232 DRM_INFO("hw_i2c forced on, you may experience display detection problems!\n"); 233 233 234 - if (adev->is_atom_bios) 235 - amdgpu_atombios_i2c_init(adev); 234 + amdgpu_atombios_i2c_init(adev); 236 235 } 237 236 238 237 /* remove all the buses */
-6
drivers/gpu/drm/amd/amdgpu/atombios_encoders.c
··· 181 181 if (!amdgpu_encoder->enc_priv) 182 182 return; 183 183 184 - if (!adev->is_atom_bios) 185 - return; 186 - 187 184 if (!(adev->mode_info.firmware_flags & ATOM_BIOS_INFO_BL_CONTROLLED_BY_GPU)) 188 185 return; 189 186 ··· 231 234 struct amdgpu_encoder_atom_dig *dig; 232 235 233 236 if (!amdgpu_encoder->enc_priv) 234 - return; 235 - 236 - if (!adev->is_atom_bios) 237 237 return; 238 238 239 239 if (!(adev->mode_info.firmware_flags & ATOM_BIOS_INFO_BL_CONTROLLED_BY_GPU))