drm/radeon: finish getting bios earlier
authorIgor Murzov <intergalactic.anonymous@gmail.com>
Sun, 22 Jan 2012 14:47:28 +0000 (18:47 +0400)
committerDave Airlie <airlied@redhat.com>
Tue, 24 Jan 2012 17:34:32 +0000 (17:34 +0000)
commit211fa4fc4e13492151e698d92b0dff56b29928ec
tree2c2d74ce407bcb26a1b30beb9a95d903b3a912e2
parenta3f83ab1a717c0e6c2f59a4cfdaa10707cc35c55
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>
drivers/gpu/drm/radeon/radeon_atpx_handler.c
drivers/gpu/drm/radeon/radeon_bios.c