linux/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
/**
 * vmw_du_cursor_plane_atomic_check - check if the new state is okay
 *
 * @plane: cursor plane
 * @state: info on the new plane state
 *
 * This is a chance to fail if the new cursor state does not fit
 * our requirements.
 *
 * Returns 0 on success
 */
check if the new state is okay
@plane: cursor plane
@state: info on the new plane state

This is a chance to fail if the new cursor state does not fit
our requirements.

Returns 0 on success
check if the new state is okay @plane : cursor plane @state : info on the new plane state This is a chance to fail if the new cursor state does not fit our requirements . Returns 0 on success
int vmw_du_cursor_plane_atomic_check(struct drm_plane *plane,
				     struct drm_plane_state *new_state)
{
	int ret = 0;
	struct vmw_surface *surface = NULL;
	struct drm_framebuffer *fb = new_state->fb;
	struct drm_rect src = drm_plane_state_src(new_state);
	struct drm_rect dest = drm_plane_state_dest(new_state);
	if (!fb)
		return ret;
	ret = drm_plane_helper_check_update(plane, new_state->crtc, fb,
					    &src, &dest,
					    DRM_MODE_ROTATE_0,
					    DRM_PLANE_HELPER_NO_SCALING,
					    DRM_PLANE_HELPER_NO_SCALING,
					    true, true, &new_state->visible);
	if (!ret)
		return ret;
	if (new_state->crtc_w != 64 || new_state->crtc_h != 64) {
		DRM_ERROR("Invalid cursor dimensions (%d, %d)\n",
			  new_state->crtc_w, new_state->crtc_h);
		ret = -EINVAL;
	}
	if (!vmw_framebuffer_to_vfb(fb)->bo)
		surface = vmw_framebuffer_to_vfbs(fb)->surface;
	if (surface && !surface->snooper.image) {
		DRM_ERROR("surface not suitable for cursor\n");
		ret = -EINVAL;
	}
	return ret;
}
int vmw_du_cursor_plane_atomic_check ( struct drm_plane * plane , struct drm_plane_state * new_state ) { int ret = 0 ; struct vmw_surface * surface = NULL ; struct drm_framebuffer * fb = new_state -> fb ; struct drm_rect src = drm_plane_state_src ( new_state ) ; struct drm_rect dest = drm_plane_state_dest ( new_state ) ; if ( ! fb ) return ret ; ret = drm_plane_helper_check_update ( plane , new_state -> crtc , fb , & src , & dest , DRM_MODE_ROTATE_0 , DRM_PLANE_HELPER_NO_SCALING , DRM_PLANE_HELPER_NO_SCALING , true , true , & new_state -> visible ) ; if ( ! ret ) return ret ; if ( new_state -> crtc_w != 64 || new_state -> crtc_h != 64 ) { DRM_ERROR ( " \n " , new_state -> crtc_w , new_state -> crtc_h ) ; ret = - EINVAL ; } if ( ! vmw_framebuffer_to_vfb ( fb ) -> bo ) surface = vmw_framebuffer_to_vfbs ( fb ) -> surface ; if ( surface && ! surface -> snooper . image ) { DRM_ERROR ( " \n " ) ; ret = - EINVAL ; } return ret ; }
vmw_du_cursor_plane_atomic_check - check if the new state is okay
 @plane: cursor plane
 @state: info on the new plane state
vmw_du_cursor_plane_atomic_check - check if the new state is okay @plane : cursor plane @state : info on the new plane state
/* Turning off */ /* A lot of the code assumes this */