diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2015-07-15 13:11:24 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2015-10-01 09:33:27 -0400 |
commit | de32301b86030b20a51151a12d81fff6429cad0c (patch) | |
tree | d8e137937e2464593d6712bd9390b5645be7cd5d | |
parent | 1c914cecb5bc4b097df07b799d39abac842ce193 (diff) |
drm/armada: allocate primary plane ourselves
Allocate our own primary plane as an armada_plane.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r-- | drivers/gpu/drm/armada/armada_crtc.c | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/drivers/gpu/drm/armada/armada_crtc.c b/drivers/gpu/drm/armada/armada_crtc.c index b96b77b61337..f146fcf6b274 100644 --- a/drivers/gpu/drm/armada/armada_crtc.c +++ b/drivers/gpu/drm/armada/armada_crtc.c | |||
@@ -1059,6 +1059,12 @@ static struct drm_crtc_funcs armada_crtc_funcs = { | |||
1059 | .set_property = armada_drm_crtc_set_property, | 1059 | .set_property = armada_drm_crtc_set_property, |
1060 | }; | 1060 | }; |
1061 | 1061 | ||
1062 | static const struct drm_plane_funcs armada_primary_plane_funcs = { | ||
1063 | .update_plane = drm_primary_helper_update, | ||
1064 | .disable_plane = drm_primary_helper_disable, | ||
1065 | .destroy = drm_primary_helper_destroy, | ||
1066 | }; | ||
1067 | |||
1062 | static struct drm_prop_enum_list armada_drm_csc_yuv_enum_list[] = { | 1068 | static struct drm_prop_enum_list armada_drm_csc_yuv_enum_list[] = { |
1063 | { CSC_AUTO, "Auto" }, | 1069 | { CSC_AUTO, "Auto" }, |
1064 | { CSC_YUV_CCIR601, "CCIR601" }, | 1070 | { CSC_YUV_CCIR601, "CCIR601" }, |
@@ -1097,7 +1103,7 @@ static int armada_drm_crtc_create(struct drm_device *drm, struct device *dev, | |||
1097 | { | 1103 | { |
1098 | struct armada_private *priv = drm->dev_private; | 1104 | struct armada_private *priv = drm->dev_private; |
1099 | struct armada_crtc *dcrtc; | 1105 | struct armada_crtc *dcrtc; |
1100 | struct drm_plane *primary; | 1106 | struct armada_plane *primary; |
1101 | void __iomem *base; | 1107 | void __iomem *base; |
1102 | int ret; | 1108 | int ret; |
1103 | 1109 | ||
@@ -1167,12 +1173,21 @@ static int armada_drm_crtc_create(struct drm_device *drm, struct device *dev, | |||
1167 | 1173 | ||
1168 | dcrtc->crtc.port = port; | 1174 | dcrtc->crtc.port = port; |
1169 | 1175 | ||
1170 | primary = drm_primary_helper_create_plane(drm, armada_primary_formats, | 1176 | primary = kzalloc(sizeof(*primary), GFP_KERNEL); |
1171 | ARRAY_SIZE(armada_primary_formats)); | ||
1172 | if (!primary) | 1177 | if (!primary) |
1173 | return -ENOMEM; | 1178 | return -ENOMEM; |
1174 | 1179 | ||
1175 | ret = drm_crtc_init_with_planes(drm, &dcrtc->crtc, primary, NULL, | 1180 | ret = drm_universal_plane_init(drm, &primary->base, 0, |
1181 | &armada_primary_plane_funcs, | ||
1182 | armada_primary_formats, | ||
1183 | ARRAY_SIZE(armada_primary_formats), | ||
1184 | DRM_PLANE_TYPE_PRIMARY); | ||
1185 | if (ret) { | ||
1186 | kfree(primary); | ||
1187 | return ret; | ||
1188 | } | ||
1189 | |||
1190 | ret = drm_crtc_init_with_planes(drm, &dcrtc->crtc, &primary->base, NULL, | ||
1176 | &armada_crtc_funcs); | 1191 | &armada_crtc_funcs); |
1177 | if (ret) | 1192 | if (ret) |
1178 | goto err_crtc_init; | 1193 | goto err_crtc_init; |
@@ -1187,7 +1202,7 @@ static int armada_drm_crtc_create(struct drm_device *drm, struct device *dev, | |||
1187 | return armada_overlay_plane_create(drm, 1 << dcrtc->num); | 1202 | return armada_overlay_plane_create(drm, 1 << dcrtc->num); |
1188 | 1203 | ||
1189 | err_crtc_init: | 1204 | err_crtc_init: |
1190 | primary->funcs->destroy(primary); | 1205 | primary->base.funcs->destroy(&primary->base); |
1191 | return ret; | 1206 | return ret; |
1192 | } | 1207 | } |
1193 | 1208 | ||