diff options
author | Maarten Lankhorst <maarten.lankhorst@linux.intel.com> | 2015-09-02 04:42:40 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2015-09-08 07:45:54 -0400 |
commit | 844f9111f6f54f88eb2f0fac121b82ce77193866 (patch) | |
tree | 99fe4604582b1ca0a9c3e71ce36d4c42ff46d2e1 /drivers/gpu/drm/drm_atomic_helper.c | |
parent | 825926d8e0bfa6f933706236603bb74a8cea002c (diff) |
drm/atomic: Make prepare_fb/cleanup_fb only take state, v3.
This removes the need to separately track fb changes i915.
That will be done as a separate commit, however.
Changes since v1:
- Add dri-devel to cc.
- Fix a check in intel's prepare and cleanup fb to take rotation
into account.
Changes since v2:
- Split out i915 changes to a separate commit.
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
[danvet: Squash in msm fixup from Maarten.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/drm_atomic_helper.c')
-rw-r--r-- | drivers/gpu/drm/drm_atomic_helper.c | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index a2629ee133ba..9b0c47690ae8 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c | |||
@@ -1111,17 +1111,14 @@ int drm_atomic_helper_prepare_planes(struct drm_device *dev, | |||
1111 | const struct drm_plane_helper_funcs *funcs; | 1111 | const struct drm_plane_helper_funcs *funcs; |
1112 | struct drm_plane *plane = state->planes[i]; | 1112 | struct drm_plane *plane = state->planes[i]; |
1113 | struct drm_plane_state *plane_state = state->plane_states[i]; | 1113 | struct drm_plane_state *plane_state = state->plane_states[i]; |
1114 | struct drm_framebuffer *fb; | ||
1115 | 1114 | ||
1116 | if (!plane) | 1115 | if (!plane) |
1117 | continue; | 1116 | continue; |
1118 | 1117 | ||
1119 | funcs = plane->helper_private; | 1118 | funcs = plane->helper_private; |
1120 | 1119 | ||
1121 | fb = plane_state->fb; | 1120 | if (funcs->prepare_fb) { |
1122 | 1121 | ret = funcs->prepare_fb(plane, plane_state); | |
1123 | if (fb && funcs->prepare_fb) { | ||
1124 | ret = funcs->prepare_fb(plane, fb, plane_state); | ||
1125 | if (ret) | 1122 | if (ret) |
1126 | goto fail; | 1123 | goto fail; |
1127 | } | 1124 | } |
@@ -1134,17 +1131,14 @@ fail: | |||
1134 | const struct drm_plane_helper_funcs *funcs; | 1131 | const struct drm_plane_helper_funcs *funcs; |
1135 | struct drm_plane *plane = state->planes[i]; | 1132 | struct drm_plane *plane = state->planes[i]; |
1136 | struct drm_plane_state *plane_state = state->plane_states[i]; | 1133 | struct drm_plane_state *plane_state = state->plane_states[i]; |
1137 | struct drm_framebuffer *fb; | ||
1138 | 1134 | ||
1139 | if (!plane) | 1135 | if (!plane) |
1140 | continue; | 1136 | continue; |
1141 | 1137 | ||
1142 | funcs = plane->helper_private; | 1138 | funcs = plane->helper_private; |
1143 | 1139 | ||
1144 | fb = state->plane_states[i]->fb; | 1140 | if (funcs->cleanup_fb) |
1145 | 1141 | funcs->cleanup_fb(plane, plane_state); | |
1146 | if (fb && funcs->cleanup_fb) | ||
1147 | funcs->cleanup_fb(plane, fb, plane_state); | ||
1148 | 1142 | ||
1149 | } | 1143 | } |
1150 | 1144 | ||
@@ -1300,14 +1294,11 @@ void drm_atomic_helper_cleanup_planes(struct drm_device *dev, | |||
1300 | 1294 | ||
1301 | for_each_plane_in_state(old_state, plane, plane_state, i) { | 1295 | for_each_plane_in_state(old_state, plane, plane_state, i) { |
1302 | const struct drm_plane_helper_funcs *funcs; | 1296 | const struct drm_plane_helper_funcs *funcs; |
1303 | struct drm_framebuffer *old_fb; | ||
1304 | 1297 | ||
1305 | funcs = plane->helper_private; | 1298 | funcs = plane->helper_private; |
1306 | 1299 | ||
1307 | old_fb = plane_state->fb; | 1300 | if (funcs->cleanup_fb) |
1308 | 1301 | funcs->cleanup_fb(plane, plane_state); | |
1309 | if (old_fb && funcs->cleanup_fb) | ||
1310 | funcs->cleanup_fb(plane, old_fb, plane_state); | ||
1311 | } | 1302 | } |
1312 | } | 1303 | } |
1313 | EXPORT_SYMBOL(drm_atomic_helper_cleanup_planes); | 1304 | EXPORT_SYMBOL(drm_atomic_helper_cleanup_planes); |