aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm
diff options
context:
space:
mode:
authorNils Wallménius <nils.wallmenius@gmail.com>2016-12-14 15:52:45 -0500
committerAlex Deucher <alexander.deucher@amd.com>2017-01-27 11:12:39 -0500
commitf7e9e9feb09f833d03f5fc3f378083b4664bd374 (patch)
tree838e3d5fffca067480fe65c63c399be1fb9e94ae /drivers/gpu/drm
parente11666eb9b6bd55dfcfba7c2e029161932568335 (diff)
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>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu.h1
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c10
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c12
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_device.c8
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_display.c10
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c3
-rw-r--r--drivers/gpu/drm/amd/amdgpu/atombios_encoders.c6
7 files changed, 16 insertions, 34 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index f4f371fbce16..bea5747ef868 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -1333,7 +1333,6 @@ struct amdgpu_device {
1333 /* BIOS */ 1333 /* BIOS */
1334 uint8_t *bios; 1334 uint8_t *bios;
1335 uint32_t bios_size; 1335 uint32_t bios_size;
1336 bool is_atom_bios;
1337 struct amdgpu_bo *stollen_vga_memory; 1336 struct amdgpu_bo *stollen_vga_memory;
1338 uint32_t bios_scratch[AMDGPU_BIOS_NUM_SCRATCH]; 1337 uint32_t bios_scratch[AMDGPU_BIOS_NUM_SCRATCH];
1339 1338
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
index 5796539a0bcb..ef79551b4cb7 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c
@@ -672,12 +672,10 @@ int amdgpu_acpi_init(struct amdgpu_device *adev)
672 672
673 if ((enc->devices & (ATOM_DEVICE_LCD_SUPPORT)) && 673 if ((enc->devices & (ATOM_DEVICE_LCD_SUPPORT)) &&
674 enc->enc_priv) { 674 enc->enc_priv) {
675 if (adev->is_atom_bios) { 675 struct amdgpu_encoder_atom_dig *dig = enc->enc_priv;
676 struct amdgpu_encoder_atom_dig *dig = enc->enc_priv; 676 if (dig->bl_dev) {
677 if (dig->bl_dev) { 677 atif->encoder_for_bl = enc;
678 atif->encoder_for_bl = enc; 678 break;
679 break;
680 }
681 } 679 }
682 } 680 }
683 } 681 }
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
index 8ec1967a850b..f573a953b4c3 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_bios.c
@@ -394,15 +394,15 @@ bool amdgpu_get_bios(struct amdgpu_device *adev)
394 if (!bios_header_start) { 394 if (!bios_header_start) {
395 goto free_bios; 395 goto free_bios;
396 } 396 }
397
398 /* Must be an ATOMBIOS */
397 tmp = bios_header_start + 4; 399 tmp = bios_header_start + 4;
398 if (!memcmp(adev->bios + tmp, "ATOM", 4) || 400 if (memcmp(adev->bios + tmp, "ATOM", 4) &&
399 !memcmp(adev->bios + tmp, "MOTA", 4)) { 401 memcmp(adev->bios + tmp, "MOTA", 4)) {
400 adev->is_atom_bios = true; 402 goto free_bios;
401 } else {
402 adev->is_atom_bios = false;
403 } 403 }
404 404
405 DRM_DEBUG("%sBIOS detected\n", adev->is_atom_bios ? "ATOM" : "COM"); 405 DRM_DEBUG("ATOMBIOS detected\n");
406 return true; 406 return true;
407free_bios: 407free_bios:
408 kfree(adev->bios); 408 kfree(adev->bios);
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index fe3bb94fe58d..14550c85d6f2 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -1605,7 +1605,6 @@ int amdgpu_device_init(struct amdgpu_device *adev,
1605 adev->pdev = pdev; 1605 adev->pdev = pdev;
1606 adev->flags = flags; 1606 adev->flags = flags;
1607 adev->asic_type = flags & AMD_ASIC_MASK; 1607 adev->asic_type = flags & AMD_ASIC_MASK;
1608 adev->is_atom_bios = false;
1609 adev->usec_timeout = AMDGPU_MAX_USEC_TIMEOUT; 1608 adev->usec_timeout = AMDGPU_MAX_USEC_TIMEOUT;
1610 adev->mc.gtt_size = 512 * 1024 * 1024; 1609 adev->mc.gtt_size = 512 * 1024 * 1024;
1611 adev->accel_working = false; 1610 adev->accel_working = false;
@@ -1720,12 +1719,7 @@ int amdgpu_device_init(struct amdgpu_device *adev,
1720 r = -EINVAL; 1719 r = -EINVAL;
1721 goto failed; 1720 goto failed;
1722 } 1721 }
1723 /* Must be an ATOMBIOS */ 1722
1724 if (!adev->is_atom_bios) {
1725 dev_err(adev->dev, "Expecting atombios for GPU\n");
1726 r = -EINVAL;
1727 goto failed;
1728 }
1729 r = amdgpu_atombios_init(adev); 1723 r = amdgpu_atombios_init(adev);
1730 if (r) { 1724 if (r) {
1731 dev_err(adev->dev, "amdgpu_atombios_init failed\n"); 1725 dev_err(adev->dev, "amdgpu_atombios_init failed\n");
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
index d2036df145b3..48a3f677feca 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
@@ -582,12 +582,10 @@ int amdgpu_modeset_create_props(struct amdgpu_device *adev)
582{ 582{
583 int sz; 583 int sz;
584 584
585 if (adev->is_atom_bios) { 585 adev->mode_info.coherent_mode_property =
586 adev->mode_info.coherent_mode_property = 586 drm_property_create_range(adev->ddev, 0 , "coherent", 0, 1);
587 drm_property_create_range(adev->ddev, 0 , "coherent", 0, 1); 587 if (!adev->mode_info.coherent_mode_property)
588 if (!adev->mode_info.coherent_mode_property) 588 return -ENOMEM;
589 return -ENOMEM;
590 }
591 589
592 adev->mode_info.load_detect_property = 590 adev->mode_info.load_detect_property =
593 drm_property_create_range(adev->ddev, 0, "load detection", 0, 1); 591 drm_property_create_range(adev->ddev, 0, "load detection", 0, 1);
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c
index 91d367399956..f2739995c335 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_i2c.c
@@ -231,8 +231,7 @@ void amdgpu_i2c_init(struct amdgpu_device *adev)
231 if (amdgpu_hw_i2c) 231 if (amdgpu_hw_i2c)
232 DRM_INFO("hw_i2c forced on, you may experience display detection problems!\n"); 232 DRM_INFO("hw_i2c forced on, you may experience display detection problems!\n");
233 233
234 if (adev->is_atom_bios) 234 amdgpu_atombios_i2c_init(adev);
235 amdgpu_atombios_i2c_init(adev);
236} 235}
237 236
238/* remove all the buses */ 237/* remove all the buses */
diff --git a/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c b/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c
index c32eca26155c..2af26d2da127 100644
--- a/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c
+++ b/drivers/gpu/drm/amd/amdgpu/atombios_encoders.c
@@ -181,9 +181,6 @@ void amdgpu_atombios_encoder_init_backlight(struct amdgpu_encoder *amdgpu_encode
181 if (!amdgpu_encoder->enc_priv) 181 if (!amdgpu_encoder->enc_priv)
182 return; 182 return;
183 183
184 if (!adev->is_atom_bios)
185 return;
186
187 if (!(adev->mode_info.firmware_flags & ATOM_BIOS_INFO_BL_CONTROLLED_BY_GPU)) 184 if (!(adev->mode_info.firmware_flags & ATOM_BIOS_INFO_BL_CONTROLLED_BY_GPU))
188 return; 185 return;
189 186
@@ -236,9 +233,6 @@ amdgpu_atombios_encoder_fini_backlight(struct amdgpu_encoder *amdgpu_encoder)
236 if (!amdgpu_encoder->enc_priv) 233 if (!amdgpu_encoder->enc_priv)
237 return; 234 return;
238 235
239 if (!adev->is_atom_bios)
240 return;
241
242 if (!(adev->mode_info.firmware_flags & ATOM_BIOS_INFO_BL_CONTROLLED_BY_GPU)) 236 if (!(adev->mode_info.firmware_flags & ATOM_BIOS_INFO_BL_CONTROLLED_BY_GPU))
243 return; 237 return;
244 238