aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/drm_atomic_helper.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/drm_atomic_helper.c')
-rw-r--r--drivers/gpu/drm/drm_atomic_helper.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index 28aa87510551..7715c40d4e74 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -1116,6 +1116,7 @@ int drm_atomic_helper_prepare_planes(struct drm_device *dev,
1116 for (i = 0; i < nplanes; i++) { 1116 for (i = 0; i < nplanes; i++) {
1117 struct drm_plane_helper_funcs *funcs; 1117 struct drm_plane_helper_funcs *funcs;
1118 struct drm_plane *plane = state->planes[i]; 1118 struct drm_plane *plane = state->planes[i];
1119 struct drm_plane_state *plane_state = state->plane_states[i];
1119 struct drm_framebuffer *fb; 1120 struct drm_framebuffer *fb;
1120 1121
1121 if (!plane) 1122 if (!plane)
@@ -1123,10 +1124,10 @@ int drm_atomic_helper_prepare_planes(struct drm_device *dev,
1123 1124
1124 funcs = plane->helper_private; 1125 funcs = plane->helper_private;
1125 1126
1126 fb = state->plane_states[i]->fb; 1127 fb = plane_state->fb;
1127 1128
1128 if (fb && funcs->prepare_fb) { 1129 if (fb && funcs->prepare_fb) {
1129 ret = funcs->prepare_fb(plane, fb); 1130 ret = funcs->prepare_fb(plane, fb, plane_state);
1130 if (ret) 1131 if (ret)
1131 goto fail; 1132 goto fail;
1132 } 1133 }
@@ -1138,6 +1139,7 @@ fail:
1138 for (i--; i >= 0; i--) { 1139 for (i--; i >= 0; i--) {
1139 struct drm_plane_helper_funcs *funcs; 1140 struct drm_plane_helper_funcs *funcs;
1140 struct drm_plane *plane = state->planes[i]; 1141 struct drm_plane *plane = state->planes[i];
1142 struct drm_plane_state *plane_state = state->plane_states[i];
1141 struct drm_framebuffer *fb; 1143 struct drm_framebuffer *fb;
1142 1144
1143 if (!plane) 1145 if (!plane)
@@ -1148,7 +1150,7 @@ fail:
1148 fb = state->plane_states[i]->fb; 1150 fb = state->plane_states[i]->fb;
1149 1151
1150 if (fb && funcs->cleanup_fb) 1152 if (fb && funcs->cleanup_fb)
1151 funcs->cleanup_fb(plane, fb); 1153 funcs->cleanup_fb(plane, fb, plane_state);
1152 1154
1153 } 1155 }
1154 1156
@@ -1254,6 +1256,7 @@ void drm_atomic_helper_cleanup_planes(struct drm_device *dev,
1254 for (i = 0; i < nplanes; i++) { 1256 for (i = 0; i < nplanes; i++) {
1255 struct drm_plane_helper_funcs *funcs; 1257 struct drm_plane_helper_funcs *funcs;
1256 struct drm_plane *plane = old_state->planes[i]; 1258 struct drm_plane *plane = old_state->planes[i];
1259 struct drm_plane_state *plane_state = old_state->plane_states[i];
1257 struct drm_framebuffer *old_fb; 1260 struct drm_framebuffer *old_fb;
1258 1261
1259 if (!plane) 1262 if (!plane)
@@ -1261,10 +1264,10 @@ void drm_atomic_helper_cleanup_planes(struct drm_device *dev,
1261 1264
1262 funcs = plane->helper_private; 1265 funcs = plane->helper_private;
1263 1266
1264 old_fb = old_state->plane_states[i]->fb; 1267 old_fb = plane_state->fb;
1265 1268
1266 if (old_fb && funcs->cleanup_fb) 1269 if (old_fb && funcs->cleanup_fb)
1267 funcs->cleanup_fb(plane, old_fb); 1270 funcs->cleanup_fb(plane, old_fb, plane_state);
1268 } 1271 }
1269} 1272}
1270EXPORT_SYMBOL(drm_atomic_helper_cleanup_planes); 1273EXPORT_SYMBOL(drm_atomic_helper_cleanup_planes);