linux/drivers/gpu
Colin Ian King 005d5d547f drm/rockchip: cdn-dp: fix sign extension on an int multiply for a u64 result
[ Upstream commit ce0cb93a5a ]

The variable bit_per_pix is a u8 and is promoted in the multiplication
to an int type and then sign extended to a u64. If the result of the
int multiplication is greater than 0x7fffffff then the upper 32 bits will
be set to 1 as a result of the sign extension. Avoid this by casting
tu_size_reg to u64 to avoid sign extension and also a potential overflow.

Fixes: 1a0f7ed3ab ("drm/rockchip: cdn-dp: add cdn DP support for rk3399")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Guenter Roeck <groeck@chromium.org>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20200915162049.36434-1-colin.king@canonical.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2021-07-14 17:06:59 +02:00
..
drm drm/rockchip: cdn-dp: fix sign extension on an int multiply for a u64 result 2021-07-14 17:06:59 +02:00
host1x gpu: host1x: Split up client initalization and registration 2021-05-17 12:31:05 +02:00
ipu-v3 gpu/ipu-v3/ipu-di: Strip out 2 unused 'di_sync_config' entries 2021-01-04 12:54:18 +01:00
trace gpu/trace: add a gpu total memory usage tracepoint 2020-03-03 17:52:41 -05:00
vga pci-v5.11-changes 2020-12-15 16:49:59 -08:00
Makefile gpu/trace: add a gpu total memory usage tracepoint 2020-03-03 17:52:41 -05:00