Skip to content

Commit 5487edb

Browse files
Lyudegregkh
authored andcommitted
drm/nouveau/dispnv50: Don't call drm_atomic_get_crtc_state() in prepare_fb
commit 560271e upstream. Since we recently started warning about uses of this function after the atomic check phase completes, we've started getting warnings about this in nouveau. It appears a misplaced drm_atomic_get_crtc_state() call has been hiding in our .prepare_fb callback for a while. So, fix this by adding a new nv50_head_atom_get_new() function and use that in our .prepare_fb callback instead. Signed-off-by: Lyude Paul <lyude@redhat.com> Reviewed-by: Dave Airlie <airlied@redhat.com> Fixes: 1590700 ("drm/nouveau/kms/nv50-: split each resource type into their own source files") Cc: <stable@vger.kernel.org> # v4.18+ Link: https://patch.msgid.link/20251211190256.396742-1-lyude@redhat.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent c79ee71 commit 5487edb

2 files changed

Lines changed: 14 additions & 1 deletion

File tree

drivers/gpu/drm/nouveau/dispnv50/atom.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,21 @@ static inline struct nv50_head_atom *
152152
nv50_head_atom_get(struct drm_atomic_state *state, struct drm_crtc *crtc)
153153
{
154154
struct drm_crtc_state *statec = drm_atomic_get_crtc_state(state, crtc);
155+
155156
if (IS_ERR(statec))
156157
return (void *)statec;
158+
159+
return nv50_head_atom(statec);
160+
}
161+
162+
static inline struct nv50_head_atom *
163+
nv50_head_atom_get_new(struct drm_atomic_state *state, struct drm_crtc *crtc)
164+
{
165+
struct drm_crtc_state *statec = drm_atomic_get_new_crtc_state(state, crtc);
166+
167+
if (!statec)
168+
return NULL;
169+
157170
return nv50_head_atom(statec);
158171
}
159172

drivers/gpu/drm/nouveau/dispnv50/wndw.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ nv50_wndw_prepare_fb(struct drm_plane *plane, struct drm_plane_state *state)
583583
asyw->image.offset[0] = nvbo->offset;
584584

585585
if (wndw->func->prepare) {
586-
asyh = nv50_head_atom_get(asyw->state.state, asyw->state.crtc);
586+
asyh = nv50_head_atom_get_new(asyw->state.state, asyw->state.crtc);
587587
if (IS_ERR(asyh))
588588
return PTR_ERR(asyh);
589589

0 commit comments

Comments
 (0)