summaryrefslogtreecommitdiff
path: root/vmwgfx_ldu.c
diff options
context:
space:
mode:
authorSinclair Yeh <syeh@vmware.com>2016-12-21 17:37:56 -0800
committerSinclair Yeh <syeh@vmware.com>2017-02-23 12:54:52 -0800
commitd9a698c2d5edc1a8d96bc688048113b2090b8bc0 (patch)
tree6b4fdbe7ee910df302fa39601e84edc71b7d9f08 /vmwgfx_ldu.c
parentb41e20427e9449488fa499af605855772e55b01e (diff)
vmwgfx: Plane atomic state
Add plane state handling functions. We have to keep track of a few plane states so we cannot use the DRM helper for this. Created vmw_plane_state along with functions to reset, duplicate, and destroty it. Signed-off-by: Sinclair Yeh <syeh@vmware.com> Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Diffstat (limited to 'vmwgfx_ldu.c')
-rw-r--r--vmwgfx_ldu.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/vmwgfx_ldu.c b/vmwgfx_ldu.c
index 56cfd7c..d236ec0 100644
--- a/vmwgfx_ldu.c
+++ b/vmwgfx_ldu.c
@@ -346,12 +346,18 @@ static const struct drm_plane_funcs vmw_ldu_plane_funcs = {
.update_plane = drm_primary_helper_update,
.disable_plane = drm_primary_helper_disable,
.destroy = vmw_du_primary_plane_destroy,
+ .reset = vmw_du_plane_reset,
+ .atomic_duplicate_state = vmw_du_plane_duplicate_state,
+ .atomic_destroy_state = vmw_du_plane_destroy_state,
};
static const struct drm_plane_funcs vmw_ldu_cursor_funcs = {
.update_plane = vmw_du_cursor_plane_update,
.disable_plane = vmw_du_cursor_plane_disable,
.destroy = vmw_du_cursor_plane_destroy,
+ .reset = vmw_du_plane_reset,
+ .atomic_duplicate_state = vmw_du_plane_duplicate_state,
+ .atomic_destroy_state = vmw_du_plane_destroy_state,
};
@@ -361,6 +367,7 @@ static int vmw_ldu_init(struct vmw_private *dev_priv, unsigned unit)
struct drm_device *dev = dev_priv->dev;
struct drm_connector *connector;
struct drm_encoder *encoder;
+ struct drm_plane *primary, *cursor;
struct drm_crtc *crtc;
int ret;
@@ -372,6 +379,8 @@ static int vmw_ldu_init(struct vmw_private *dev_priv, unsigned unit)
crtc = &ldu->base.crtc;
encoder = &ldu->base.encoder;
connector = &ldu->base.connector;
+ primary = &ldu->base.primary;
+ cursor = &ldu->base.cursor;
INIT_LIST_HEAD(&ldu->active);
@@ -387,6 +396,8 @@ static int vmw_ldu_init(struct vmw_private *dev_priv, unsigned unit)
ldu->base.is_implicit = true;
/* Initialize primary plane */
+ vmw_du_plane_reset(primary);
+
ret = drm_universal_plane_init(dev, &ldu->base.primary,
0, &vmw_ldu_plane_funcs,
vmw_primary_plane_formats,
@@ -398,6 +409,8 @@ static int vmw_ldu_init(struct vmw_private *dev_priv, unsigned unit)
}
/* Initialize cursor plane */
+ vmw_du_plane_reset(cursor);
+
ret = drm_universal_plane_init(dev, &ldu->base.cursor,
0, &vmw_ldu_cursor_funcs,
vmw_cursor_plane_formats,