Commit f7e9e9fe authored by Nils Wallménius's avatar Nils Wallménius Committed by Alex Deucher

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: default avatarEdward O'Callaghan <funfunctor@folklore1984.net>
Signed-off-by: default avatarNils Wallménius <nils.wallmenius@gmail.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent e11666eb
...@@ -1333,7 +1333,6 @@ struct amdgpu_device { ...@@ -1333,7 +1333,6 @@ struct amdgpu_device {
/* BIOS */ /* BIOS */
uint8_t *bios; uint8_t *bios;
uint32_t bios_size; uint32_t bios_size;
bool is_atom_bios;
struct amdgpu_bo *stollen_vga_memory; struct amdgpu_bo *stollen_vga_memory;
uint32_t bios_scratch[AMDGPU_BIOS_NUM_SCRATCH]; uint32_t bios_scratch[AMDGPU_BIOS_NUM_SCRATCH];
......
...@@ -672,12 +672,10 @@ int amdgpu_acpi_init(struct amdgpu_device *adev) ...@@ -672,12 +672,10 @@ int amdgpu_acpi_init(struct amdgpu_device *adev)
if ((enc->devices & (ATOM_DEVICE_LCD_SUPPORT)) && if ((enc->devices & (ATOM_DEVICE_LCD_SUPPORT)) &&
enc->enc_priv) { enc->enc_priv) {
if (adev->is_atom_bios) { struct amdgpu_encoder_atom_dig *dig = enc->enc_priv;
struct amdgpu_encoder_atom_dig *dig = enc->enc_priv; if (dig->bl_dev) {
if (dig->bl_dev) { atif->encoder_for_bl = enc;
atif->encoder_for_bl = enc; break;
break;
}
} }
} }
} }
......
...@@ -394,15 +394,15 @@ bool amdgpu_get_bios(struct amdgpu_device *adev) ...@@ -394,15 +394,15 @@ bool amdgpu_get_bios(struct amdgpu_device *adev)
if (!bios_header_start) { if (!bios_header_start) {
goto free_bios; goto free_bios;
} }
/* Must be an ATOMBIOS */
tmp = bios_header_start + 4; tmp = bios_header_start + 4;
if (!memcmp(adev->bios + tmp, "ATOM", 4) || if (memcmp(adev->bios + tmp, "ATOM", 4) &&
!memcmp(adev->bios + tmp, "MOTA", 4)) { memcmp(adev->bios + tmp, "MOTA", 4)) {
adev->is_atom_bios = true; goto free_bios;
} else {
adev->is_atom_bios = false;
} }
DRM_DEBUG("%sBIOS detected\n", adev->is_atom_bios ? "ATOM" : "COM"); DRM_DEBUG("ATOMBIOS detected\n");
return true; return true;
free_bios: free_bios:
kfree(adev->bios); kfree(adev->bios);
......
...@@ -1605,7 +1605,6 @@ int amdgpu_device_init(struct amdgpu_device *adev, ...@@ -1605,7 +1605,6 @@ int amdgpu_device_init(struct amdgpu_device *adev,
adev->pdev = pdev; adev->pdev = pdev;
adev->flags = flags; adev->flags = flags;
adev->asic_type = flags & AMD_ASIC_MASK; adev->asic_type = flags & AMD_ASIC_MASK;
adev->is_atom_bios = false;
adev->usec_timeout = AMDGPU_MAX_USEC_TIMEOUT; adev->usec_timeout = AMDGPU_MAX_USEC_TIMEOUT;
adev->mc.gtt_size = 512 * 1024 * 1024; adev->mc.gtt_size = 512 * 1024 * 1024;
adev->accel_working = false; adev->accel_working = false;
...@@ -1720,12 +1719,7 @@ int amdgpu_device_init(struct amdgpu_device *adev, ...@@ -1720,12 +1719,7 @@ int amdgpu_device_init(struct amdgpu_device *adev,
r = -EINVAL; r = -EINVAL;
goto failed; goto failed;
} }
/* Must be an ATOMBIOS */
if (!adev->is_atom_bios) {
dev_err(adev->dev, "Expecting atombios for GPU\n");
r = -EINVAL;
goto failed;
}
r = amdgpu_atombios_init(adev); r = amdgpu_atombios_init(adev);
if (r) { if (r) {
dev_err(adev->dev, "amdgpu_atombios_init failed\n"); dev_err(adev->dev, "amdgpu_atombios_init failed\n");
......
...@@ -582,12 +582,10 @@ int amdgpu_modeset_create_props(struct amdgpu_device *adev) ...@@ -582,12 +582,10 @@ int amdgpu_modeset_create_props(struct amdgpu_device *adev)
{ {
int sz; int sz;
if (adev->is_atom_bios) { adev->mode_info.coherent_mode_property =
adev->mode_info.coherent_mode_property = drm_property_create_range(adev->ddev, 0 , "coherent", 0, 1);
drm_property_create_range(adev->ddev, 0 , "coherent", 0, 1); if (!adev->mode_info.coherent_mode_property)
if (!adev->mode_info.coherent_mode_property) return -ENOMEM;
return -ENOMEM;
}
adev->mode_info.load_detect_property = adev->mode_info.load_detect_property =
drm_property_create_range(adev->ddev, 0, "load detection", 0, 1); drm_property_create_range(adev->ddev, 0, "load detection", 0, 1);
......
...@@ -231,8 +231,7 @@ void amdgpu_i2c_init(struct amdgpu_device *adev) ...@@ -231,8 +231,7 @@ void amdgpu_i2c_init(struct amdgpu_device *adev)
if (amdgpu_hw_i2c) if (amdgpu_hw_i2c)
DRM_INFO("hw_i2c forced on, you may experience display detection problems!\n"); DRM_INFO("hw_i2c forced on, you may experience display detection problems!\n");
if (adev->is_atom_bios) amdgpu_atombios_i2c_init(adev);
amdgpu_atombios_i2c_init(adev);
} }
/* remove all the buses */ /* remove all the buses */
......
...@@ -181,9 +181,6 @@ void amdgpu_atombios_encoder_init_backlight(struct amdgpu_encoder *amdgpu_encode ...@@ -181,9 +181,6 @@ void amdgpu_atombios_encoder_init_backlight(struct amdgpu_encoder *amdgpu_encode
if (!amdgpu_encoder->enc_priv) if (!amdgpu_encoder->enc_priv)
return; return;
if (!adev->is_atom_bios)
return;
if (!(adev->mode_info.firmware_flags & ATOM_BIOS_INFO_BL_CONTROLLED_BY_GPU)) if (!(adev->mode_info.firmware_flags & ATOM_BIOS_INFO_BL_CONTROLLED_BY_GPU))
return; return;
...@@ -236,9 +233,6 @@ amdgpu_atombios_encoder_fini_backlight(struct amdgpu_encoder *amdgpu_encoder) ...@@ -236,9 +233,6 @@ amdgpu_atombios_encoder_fini_backlight(struct amdgpu_encoder *amdgpu_encoder)
if (!amdgpu_encoder->enc_priv) if (!amdgpu_encoder->enc_priv)
return; return;
if (!adev->is_atom_bios)
return;
if (!(adev->mode_info.firmware_flags & ATOM_BIOS_INFO_BL_CONTROLLED_BY_GPU)) if (!(adev->mode_info.firmware_flags & ATOM_BIOS_INFO_BL_CONTROLLED_BY_GPU))
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment