提交 211fa4fc 编写于 作者: I Igor Murzov 提交者: Dave Airlie

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: NIgor Murzov <e-mail@date.by>
Reviewed-by: NAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: NDave Airlie <airlied@redhat.com>
上级 a3f83ab1
...@@ -60,7 +60,7 @@ static int radeon_atrm_call(acpi_handle atrm_handle, uint8_t *bios, ...@@ -60,7 +60,7 @@ static int radeon_atrm_call(acpi_handle atrm_handle, uint8_t *bios,
obj = (union acpi_object *)buffer.pointer; obj = (union acpi_object *)buffer.pointer;
memcpy(bios+offset, obj->buffer.pointer, obj->buffer.length); memcpy(bios+offset, obj->buffer.pointer, obj->buffer.length);
kfree(buffer.pointer); kfree(buffer.pointer);
return len; return obj->buffer.length;
} }
bool radeon_atrm_supported(struct pci_dev *pdev) bool radeon_atrm_supported(struct pci_dev *pdev)
......
...@@ -120,7 +120,7 @@ static bool radeon_atrm_get_bios(struct radeon_device *rdev) ...@@ -120,7 +120,7 @@ static bool radeon_atrm_get_bios(struct radeon_device *rdev)
ret = radeon_atrm_get_bios_chunk(rdev->bios, ret = radeon_atrm_get_bios_chunk(rdev->bios,
(i * ATRM_BIOS_PAGE), (i * ATRM_BIOS_PAGE),
ATRM_BIOS_PAGE); ATRM_BIOS_PAGE);
if (ret <= 0) if (ret < ATRM_BIOS_PAGE)
break; break;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册