@@ -688,12 +688,13 @@ static int __setplane_internal(struct drm_plane *plane,
if (!fb) {
plane->old_fb = plane->fb;
ret = plane->funcs->disable_plane(plane, ctx);
- if (!ret) {
- plane->crtc = NULL;
- plane->fb = NULL;
- } else {
+ if (ret) {
plane->old_fb = NULL;
+ return ret;
}
+
+ plane->crtc = NULL;
+ plane->fb = NULL;
goto out;
}
@@ -701,26 +702,27 @@ static int __setplane_internal(struct drm_plane *plane,
crtc_x, crtc_y, crtc_w, crtc_h,
src_x, src_y, src_w, src_h);
if (ret)
- goto out;
+ return ret;
plane->old_fb = plane->fb;
ret = plane->funcs->update_plane(plane, crtc, fb,
crtc_x, crtc_y, crtc_w, crtc_h,
src_x, src_y, src_w, src_h, ctx);
- if (!ret) {
- plane->crtc = crtc;
- plane->fb = fb;
- drm_framebuffer_get(plane->fb);
- } else {
+ if (ret) {
plane->old_fb = NULL;
+ return ret;
}
+ plane->crtc = crtc;
+ plane->fb = fb;
+ drm_framebuffer_get(plane->fb);
+
out:
if (plane->old_fb)
drm_framebuffer_put(plane->old_fb);
plane->old_fb = NULL;
- return ret;
+ return 0;
}
static int __setplane_atomic(struct drm_plane *plane,