linux/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
/**
 * vmw_du_crtc_reset - creates a blank vmw crtc state
 * @crtc: DRM crtc
 *
 * Resets the atomic state for @crtc by freeing the state pointer (which
 * might be NULL, e.g. at driver load time) and allocating a new empty state
 * object.
 */


Resets the atomic state for @crtc by freeing the state pointer (which
might be NULL, e.g. at driver load time) and allocating a new empty state
object.
Resets the atomic state for @crtc by freeing the state pointer ( which might be NULL e . g . at driver load time ) and allocating a new empty state object .
void vmw_du_crtc_reset(struct drm_crtc *crtc)
{
	struct vmw_crtc_state *vcs;
	if (crtc->state) {
		__drm_atomic_helper_crtc_destroy_state(crtc->state);
		kfree(vmw_crtc_state_to_vcs(crtc->state));
	}
	vcs = kzalloc(sizeof(*vcs), GFP_KERNEL);
	if (!vcs) {
		DRM_ERROR("Cannot allocate vmw_crtc_state\n");
		return;
	}
	crtc->state = &vcs->base;
	crtc->state->crtc = crtc;
}
void vmw_du_crtc_reset ( struct drm_crtc * crtc ) { struct vmw_crtc_state * vcs ; if ( crtc -> state ) { __drm_atomic_helper_crtc_destroy_state ( crtc -> state ) ; kfree ( vmw_crtc_state_to_vcs ( crtc -> state ) ) ; } vcs = kzalloc ( sizeof ( * vcs ) , GFP_KERNEL ) ; if ( ! vcs ) { DRM_ERROR ( " \n " ) ; return ; } crtc -> state = & vcs -> base ; crtc -> state -> crtc = crtc ; }
vmw_du_crtc_reset - creates a blank vmw crtc state
 @crtc: DRM crtc
vmw_du_crtc_reset - creates a blank vmw crtc state @crtc : DRM crtc