mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-23 05:56:14 -04:00
drm: plane: Verify that no or all planes have a zpos property
The zpos property is used by userspace to sort the order of planes. While the property is not mandatory for drivers to implement, mixing planes with and without zpos confuses userspace, and shall not be allowed. Clarify this in the documentation and warn at runtime if the drivers mixes planes with and without zpos properties. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Sam Ravnborg <sam@ravnborg.org> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
@@ -289,6 +289,8 @@ EXPORT_SYMBOL(drm_universal_plane_init);
|
||||
|
||||
int drm_plane_register_all(struct drm_device *dev)
|
||||
{
|
||||
unsigned int num_planes = 0;
|
||||
unsigned int num_zpos = 0;
|
||||
struct drm_plane *plane;
|
||||
int ret = 0;
|
||||
|
||||
@@ -297,8 +299,15 @@ int drm_plane_register_all(struct drm_device *dev)
|
||||
ret = plane->funcs->late_register(plane);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (plane->zpos_property)
|
||||
num_zpos++;
|
||||
num_planes++;
|
||||
}
|
||||
|
||||
drm_WARN(dev, num_zpos && num_planes != num_zpos,
|
||||
"Mixing planes with and without zpos property is invalid\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user