diff --git a/drivers/gpu/drm/nouveau/dispnv50/wndw.c b/drivers/gpu/drm/nouveau/dispnv50/wndw.c index 15a322422f4e..378095138d12 100644 --- a/drivers/gpu/drm/nouveau/dispnv50/wndw.c +++ b/drivers/gpu/drm/nouveau/dispnv50/wndw.c @@ -752,18 +752,17 @@ nv50_wndw_zpos_default(struct drm_plane *plane) (plane->type == DRM_PLANE_TYPE_OVERLAY) ? 1 : 255; } -static void -nv50_wndw_reset(struct drm_plane *plane) +static struct drm_plane_state *nv50_wndw_create_state(struct drm_plane *plane) { struct nv50_wndw_atom *asyw; - if (WARN_ON(!(asyw = kzalloc_obj(*asyw)))) - return; + asyw = kzalloc_obj(*asyw); + if (WARN_ON(!asyw)) + return ERR_PTR(-ENOMEM); - if (plane->state) - plane->funcs->atomic_destroy_state(plane, plane->state); + __drm_atomic_helper_plane_state_init(&asyw->state, plane); - __drm_atomic_helper_plane_reset(plane, &asyw->state); + return &asyw->state; } static void @@ -837,7 +836,7 @@ nv50_wndw = { .update_plane = drm_atomic_helper_update_plane, .disable_plane = drm_atomic_helper_disable_plane, .destroy = nv50_wndw_destroy, - .reset = nv50_wndw_reset, + .atomic_create_state = nv50_wndw_create_state, .atomic_duplicate_state = nv50_wndw_atomic_duplicate_state, .atomic_destroy_state = nv50_wndw_atomic_destroy_state, .format_mod_supported = nv50_plane_format_mod_supported,