drm/amd/display: Fill plane attrs only for valid pxl format
authorRoman Li <Roman.Li@amd.com>
Thu, 25 Apr 2019 15:02:30 +0000 (11:02 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 24 May 2019 17:20:50 +0000 (12:20 -0500)
commit1894478ad1f8fd7366edc5cee49ee9caea0e3d52
treea3fb560a3e872bb510c54562077022ffc6224223
parentb2293ac23776123b896479b6a53463753c648d3b
drm/amd/display: Fill plane attrs only for valid pxl format

[Why]
In fill_plane_buffer_attributes() we calculate chroma/luma
assuming that the surface_pixel_format is always valid.
If it's not the case, there's a risk of divide by zero error.

[How]
Check if format valid before calculating pixel format attributes

Signed-off-by: Roman Li <Roman.Li@amd.com>
Reviewed-by: David Francis <David.Francis@amd.com>
Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c