mirror of
https://github.com/torvalds/linux.git
synced 2026-05-23 14:42:08 +02:00
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>
This commit is contained in:
parent
b2293ac237
commit
1894478ad1
|
|
@ -2584,7 +2584,7 @@ fill_plane_buffer_attributes(struct amdgpu_device *adev,
|
|||
address->type = PLN_ADDR_TYPE_GRAPHICS;
|
||||
address->grph.addr.low_part = lower_32_bits(afb->address);
|
||||
address->grph.addr.high_part = upper_32_bits(afb->address);
|
||||
} else {
|
||||
} else if (format < SURFACE_PIXEL_FORMAT_INVALID) {
|
||||
uint64_t chroma_addr = afb->address + fb->offsets[1];
|
||||
|
||||
plane_size->video.luma_size.x = 0;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user