aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/sti/sti_compositor.c
diff options
context:
space:
mode:
authorVincent Abriou <vincent.abriou@st.com>2015-08-03 14:22:16 +0200
committerBenjamin Gaignard <benjamin.gaignard@linaro.org>2015-08-03 14:26:05 +0200
commit29d1dc62e1618192a25bd2eae9617529b9930cfc (patch)
tree67e0151ceaad7b164d1f2b7accc7d6f21f377299 /drivers/gpu/drm/sti/sti_compositor.c
parentdrm/sti: rename files and functions (diff)
downloadlinux-dev-29d1dc62e1618192a25bd2eae9617529b9930cfc.tar.xz
linux-dev-29d1dc62e1618192a25bd2eae9617529b9930cfc.zip
drm/sti: atomic crtc/plane update
Better fit STI hardware structure. Planes are no more responsible of updating mixer information such as z-order and status. It is now up to the CRTC atomic flush to do it. Plane actions (enable or disable) are performed atomically. Disabling of a plane is synchronize with the vsync event. Signed-off-by: Vincent Abriou <vincent.abriou@st.com> Reviewed-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Diffstat (limited to 'drivers/gpu/drm/sti/sti_compositor.c')
-rw-r--r--drivers/gpu/drm/sti/sti_compositor.c32
1 files changed, 12 insertions, 20 deletions
diff --git a/drivers/gpu/drm/sti/sti_compositor.c b/drivers/gpu/drm/sti/sti_compositor.c
index d62ed7f4cb2c..c652627b1bca 100644
--- a/drivers/gpu/drm/sti/sti_compositor.c
+++ b/drivers/gpu/drm/sti/sti_compositor.c
@@ -61,15 +61,13 @@ static int sti_compositor_bind(struct device *dev,
{
struct sti_compositor *compo = dev_get_drvdata(dev);
struct drm_device *drm_dev = data;
- unsigned int i, mixer_id = 0, vid_id = 0, crtc_id = 0, plane_id = 0;
+ unsigned int i, mixer_id = 0, vid_id = 0, crtc_id = 0;
struct sti_private *dev_priv = drm_dev->dev_private;
struct drm_plane *cursor = NULL;
struct drm_plane *primary = NULL;
struct sti_compositor_subdev_descriptor *desc = compo->data.subdev_desc;
unsigned int array_size = compo->data.nb_subdev;
- struct sti_plane *plane;
-
dev_priv->compo = compo;
/* Register mixer subdev and video subdev first */
@@ -110,27 +108,25 @@ static int sti_compositor_bind(struct device *dev,
/* Nothing to do, already done at the first round */
break;
case STI_CURSOR_SUBDEV:
- plane = sti_cursor_create(compo->dev, desc[i].id,
- compo->regs + desc[i].offset);
- if (!plane) {
+ cursor = sti_cursor_create(drm_dev, compo->dev,
+ desc[i].id,
+ compo->regs + desc[i].offset,
+ 1);
+ if (!cursor) {
DRM_ERROR("Can't create CURSOR plane\n");
break;
}
- cursor = sti_plane_init(drm_dev, plane, 1,
- DRM_PLANE_TYPE_CURSOR);
- plane_id++;
break;
case STI_GPD_SUBDEV:
- plane = sti_gdp_create(compo->dev, desc[i].id,
- compo->regs + desc[i].offset);
- if (!plane) {
+ primary = sti_gdp_create(drm_dev, compo->dev,
+ desc[i].id,
+ compo->regs + desc[i].offset,
+ (1 << mixer_id) - 1,
+ plane_type);
+ if (!primary) {
DRM_ERROR("Can't create GDP plane\n");
break;
}
- primary = sti_plane_init(drm_dev, plane,
- (1 << mixer_id) - 1,
- plane_type);
- plane_id++;
break;
default:
DRM_ERROR("Unknown subdev compoment type\n");
@@ -151,10 +147,6 @@ static int sti_compositor_bind(struct device *dev,
/* Allow usage of vblank without having to call drm_irq_install */
drm_dev->irq_enabled = 1;
- DRM_DEBUG_DRIVER("Initialized %d DRM CRTC(s) and %d DRM plane(s)\n",
- crtc_id, plane_id);
- DRM_DEBUG_DRIVER("DRM plane(s) for VID/VDP not created yet\n");
-
return 0;
}