OSDN Git Service

drm/amdgpu: Handle 64-bit return from drm_crtc_vblank_count()
authorDhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
Sat, 3 Feb 2018 05:12:56 +0000 (21:12 -0800)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Thu, 15 Feb 2018 19:49:35 +0000 (11:49 -0800)
commit23effc1100975a36953255c1db737f18adf8dd0d
treeebef9e3337d8638ec487bc5fe337e0c5549cda51
parent1b29b7ca7d43be309d399c996910c04a8ba0c195
drm/amdgpu: Handle 64-bit return from drm_crtc_vblank_count()

570e86963a51 ("drm: Widen vblank count to 64-bits [v3]") changed the
return type for drm_crtc_vblank_count() to u64. This could cause
potential problems if the return value is used in arithmetic operations
with a 32-bit reference HW vblank count. Explicitly typecasting this down
to u32 either fixes a potential problem or serves to add clarity in case
the typecasting was implicitly done.

Cc: Keith Packard <keithp@keithp.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com> for both this patch
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180203051302.9974-4-dhinakaran.pandiyan@intel.com
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c