struct drm_plane_state *plane_state = drm_atomic_get_new_plane_state(state, plane);
struct ssd130x_plane_state *ssd130x_state = to_ssd130x_plane_state(plane_state);
struct drm_crtc *crtc = plane_state->crtc;
- struct drm_crtc_state *crtc_state;
+ struct drm_crtc_state *crtc_state = NULL;
const struct drm_format_info *fi;
unsigned int pitch;
int ret;
- if (!crtc)
- return -EINVAL;
-
- crtc_state = drm_atomic_get_crtc_state(state, crtc);
- if (IS_ERR(crtc_state))
- return PTR_ERR(crtc_state);
+ if (crtc)
+ crtc_state = drm_atomic_get_new_crtc_state(state, crtc);
- ret = drm_plane_helper_atomic_check(plane, state);
+ ret = drm_atomic_helper_check_plane_state(plane_state, crtc_state,
+ DRM_PLANE_NO_SCALING,
+ DRM_PLANE_NO_SCALING,
+ false, false);
if (ret)
return ret;
+ else if (!plane_state->visible)
+ return 0;
fi = drm_format_info(DRM_FORMAT_R1);
if (!fi)