From 6e2a3b66e78b693065ee67af91175a1a7e4dc209 Mon Sep 17 00:00:00 2001 From: Gustavo Padovan Date: Fri, 3 Apr 2015 21:05:52 +0900 Subject: drm/exynos: preset zpos value for overlay planes Usually userspace don't want to have two overlay planes on the same zpos so this change assign a different zpos for each plane. Before this change a zpos of value zero was created for all planes so the userspace had to set up the zpos of every plane it wanted to use. Also all places that were storing zpos positions are now unsigned int. Signed-off-by: Gustavo Padovan Signed-off-by: Inki Dae --- drivers/gpu/drm/exynos/exynos_drm_plane.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'drivers/gpu/drm/exynos/exynos_drm_plane.c') diff --git a/drivers/gpu/drm/exynos/exynos_drm_plane.c b/drivers/gpu/drm/exynos/exynos_drm_plane.c index 4014c746a534..cee980e86fcd 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_plane.c +++ b/drivers/gpu/drm/exynos/exynos_drm_plane.c @@ -207,7 +207,8 @@ static struct drm_plane_funcs exynos_plane_funcs = { .set_property = exynos_plane_set_property, }; -static void exynos_plane_attach_zpos_property(struct drm_plane *plane) +static void exynos_plane_attach_zpos_property(struct drm_plane *plane, + unsigned int zpos) { struct drm_device *dev = plane->dev; struct exynos_drm_private *dev_priv = dev->dev_private; @@ -223,12 +224,13 @@ static void exynos_plane_attach_zpos_property(struct drm_plane *plane) dev_priv->plane_zpos_property = prop; } - drm_object_attach_property(&plane->base, prop, 0); + drm_object_attach_property(&plane->base, prop, zpos); } int exynos_plane_init(struct drm_device *dev, struct exynos_drm_plane *exynos_plane, - unsigned long possible_crtcs, enum drm_plane_type type) + unsigned long possible_crtcs, enum drm_plane_type type, + unsigned int zpos) { int err; @@ -240,10 +242,10 @@ int exynos_plane_init(struct drm_device *dev, return err; } - if (type == DRM_PLANE_TYPE_PRIMARY) - exynos_plane->zpos = DEFAULT_ZPOS; - else - exynos_plane_attach_zpos_property(&exynos_plane->base); + exynos_plane->zpos = zpos; + + if (type == DRM_PLANE_TYPE_OVERLAY) + exynos_plane_attach_zpos_property(&exynos_plane->base, zpos); return 0; } -- cgit v1.2.3