All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] drm/nouveau/kms/nv50-: Use state helper instead of crtc pointer
@ 2020-11-02 13:38 Maxime Ripard
  2020-11-02 13:38 ` [PATCH 2/3] drm: Use state helper instead of CRTC state pointer Maxime Ripard
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Maxime Ripard @ 2020-11-02 13:38 UTC (permalink / raw)
  To: Daniel Vetter, David Airlie, Maarten Lankhorst, Thomas Zimmermann,
	Maxime Ripard
  Cc: dri-devel

dispnv50 references the crtc->state pointer in order to get the current
CRTC state in its atomic_check hook, which would be the old CRTC state in
the global atomic state.

Use the drm_atomic_get_old_crtc_state helper to get that state to make it
more obvious.

Suggested-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
---
 drivers/gpu/drm/nouveau/dispnv50/head.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/nouveau/dispnv50/head.c b/drivers/gpu/drm/nouveau/dispnv50/head.c
index 0542ca22b33a..537c1ef2e464 100644
--- a/drivers/gpu/drm/nouveau/dispnv50/head.c
+++ b/drivers/gpu/drm/nouveau/dispnv50/head.c
@@ -313,11 +313,13 @@ nv50_head_atomic_check_mode(struct nv50_head *head, struct nv50_head_atom *asyh)
 static int
 nv50_head_atomic_check(struct drm_crtc *crtc, struct drm_atomic_state *state)
 {
+	struct drm_crtc_state *old_crtc_state = drm_atomic_get_old_crtc_state(state,
+									      crtc);
 	struct drm_crtc_state *crtc_state = drm_atomic_get_new_crtc_state(state,
 									  crtc);
 	struct nouveau_drm *drm = nouveau_drm(crtc->dev);
 	struct nv50_head *head = nv50_head(crtc);
-	struct nv50_head_atom *armh = nv50_head_atom(crtc->state);
+	struct nv50_head_atom *armh = nv50_head_atom(old_crtc_state);
 	struct nv50_head_atom *asyh = nv50_head_atom(crtc_state);
 	struct nouveau_conn_atom *asyc = NULL;
 	struct drm_connector_state *conns;
-- 
2.28.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2020-11-06  8:35 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-02 13:38 [PATCH 1/3] drm/nouveau/kms/nv50-: Use state helper instead of crtc pointer Maxime Ripard
2020-11-02 13:38 ` [PATCH 2/3] drm: Use state helper instead of CRTC state pointer Maxime Ripard
2020-11-02 16:04   ` Ville Syrjälä
2020-11-03 16:15     ` Maxime Ripard
2020-11-03 16:28       ` Ville Syrjälä
2020-11-05 16:35         ` Maxime Ripard
2020-11-05 16:56           ` Ville Syrjälä
2020-11-02 13:38 ` [PATCH 3/3] drm: Use the state pointer directly in atomic_check Maxime Ripard
2020-11-02 16:06   ` Ville Syrjälä
2020-11-03 10:07     ` Maxime Ripard
2020-11-02 16:06 ` [PATCH 1/3] drm/nouveau/kms/nv50-: Use state helper instead of crtc pointer Ville Syrjälä
2020-11-03 10:07   ` Maxime Ripard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.