Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/rockchip: Declare framebuffer width/height bounds

The VOP2 has limitations on its input and output sizes. The clipped
display region must be at least 4px in each dimension for both
framebuffer source and plane destination, and the clipped source region
must be no greater than a per-version limit.

It is never valid for VOP2 to have a framebuffer which is less than four
pixels in either dimension, so declare that as our min width/height,
enforced by AddFB failing if the user tries. It can theoretically be
valid to have a single large framebuffer of which only certain clipped
regions are shown, but this is a very uncommon case. Declaring to
userspace that the framebuffer's maximum width and height is the maximum
source clip helps it make better decisions as to which mode to use,
instead of trying unsupported sizes and having to fall back.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Link: https://lore.kernel.org/r/20251015110042.41273-3-daniels@collabora.com

authored by

Daniel Stone and committed by
Heiko Stuebner
4bfaa85b f233921d

+6
+6
drivers/gpu/drm/rockchip/rockchip_drm_vop2.c
··· 2647 2647 if (IS_ERR(vop2->map)) 2648 2648 return PTR_ERR(vop2->map); 2649 2649 2650 + /* Set the bounds for framebuffer creation */ 2651 + drm->mode_config.min_width = 4; 2652 + drm->mode_config.min_height = 4; 2653 + drm->mode_config.max_width = vop2_data->max_input.width; 2654 + drm->mode_config.max_height = vop2_data->max_input.height; 2655 + 2650 2656 ret = vop2_win_init(vop2); 2651 2657 if (ret) 2652 2658 return ret;