aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgor Murzov <intergalactic.anonymous@gmail.com>2012-01-22 09:47:28 -0500
committerDave Airlie <airlied@redhat.com>2012-01-24 12:34:32 -0500
commit211fa4fc4e13492151e698d92b0dff56b29928ec (patch)
tree2c2d74ce407bcb26a1b30beb9a95d903b3a912e2
parenta3f83ab1a717c0e6c2f59a4cfdaa10707cc35c55 (diff)
drm/radeon: finish getting bios earlier
Return a number of bytes read in radeon_atrm_get_bios_chunk() and properly check this value in radeon_atrm_get_bios(). If radeon_atrm_get_bios_chunk() read less bytes then were requested, it means that it finished reading bios data. Prior to this patch, condition in radeon_atrm_get_bios() was always equivalent to "if (ATRM_BIOS_PAGE <= 0)", so it was always false, thus radeon_atrm_get_bios() was trying to read past the bios data wasting boot time. On my lenovo ideapad u455 laptop this patch drops bios reading time from ~5.5s to ~1.5s. Signed-off-by: Igor Murzov <e-mail@date.by> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--drivers/gpu/drm/radeon/radeon_atpx_handler.c2
-rw-r--r--drivers/gpu/drm/radeon/radeon_bios.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_atpx_handler.c b/drivers/gpu/drm/radeon/radeon_atpx_handler.c
index c666a5b5e505..13ac63ba6075 100644
--- a/drivers/gpu/drm/radeon/radeon_atpx_handler.c
+++ b/drivers/gpu/drm/radeon/radeon_atpx_handler.c
@@ -60,7 +60,7 @@ static int radeon_atrm_call(acpi_handle atrm_handle, uint8_t *bios,
60 obj = (union acpi_object *)buffer.pointer; 60 obj = (union acpi_object *)buffer.pointer;
61 memcpy(bios+offset, obj->buffer.pointer, obj->buffer.length); 61 memcpy(bios+offset, obj->buffer.pointer, obj->buffer.length);
62 kfree(buffer.pointer); 62 kfree(buffer.pointer);
63 return len; 63 return obj->buffer.length;
64} 64}
65 65
66bool radeon_atrm_supported(struct pci_dev *pdev) 66bool radeon_atrm_supported(struct pci_dev *pdev)
diff --git a/drivers/gpu/drm/radeon/radeon_bios.c b/drivers/gpu/drm/radeon/radeon_bios.c
index 229a20f10e2b..501f4881e5aa 100644
--- a/drivers/gpu/drm/radeon/radeon_bios.c
+++ b/drivers/gpu/drm/radeon/radeon_bios.c
@@ -120,7 +120,7 @@ static bool radeon_atrm_get_bios(struct radeon_device *rdev)
120 ret = radeon_atrm_get_bios_chunk(rdev->bios, 120 ret = radeon_atrm_get_bios_chunk(rdev->bios,
121 (i * ATRM_BIOS_PAGE), 121 (i * ATRM_BIOS_PAGE),
122 ATRM_BIOS_PAGE); 122 ATRM_BIOS_PAGE);
123 if (ret <= 0) 123 if (ret < ATRM_BIOS_PAGE)
124 break; 124 break;
125 } 125 }
126 126