Skip to contentSkip to conversation

drm: Don't set the plane->fb to NULL on successfull set_plane

PATCH In review Daniel Vetter 4 participants 4 messages Feb 15, 2013 – Feb 19, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm: Don't set the plane->fb to NULL on successfull set_plane

We need to clear the local variable to get the refcounting right (since the reference drm_mode_setplane holds is transferred to the plane->fb pointer). But should be done _after_ we update the pointer.

Breakage introduced in

commit 6c2a75325c800de286166c693e0cd33c3a1c5ec8

Author: Daniel Vetter <[email protected]>
Date:   Tue Dec 11 00:59:24 2012 +0100

drm: refcounting for sprite framebuffers

---
 drivers/gpu/drm/drm_crtc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/drm_crtc.c +1 -1
index 826a5ca..1960418 100644
@@ -1982,9 +1982,9 @@ int drm_mode_setplane(struct drm_device *dev, void *data,
 					 plane_req->src_w, plane_req->src_h);
 	if (!ret) {
 		old_fb = plane->fb;
-		fb = NULL;
 		plane->crtc = crtc;
 		plane->fb = fb;
+		fb = NULL;
 	}
 	drm_modeset_unlock_all(dev);
 
Signature · 1 line
1.7.10.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 25 lines · On Fri, 15 Feb 2013 21:21:37 +0100 Daniel Vetter <[email protected]> wrote:

We need to clear the local variable to get the refcounting right (since the reference drm_mode_setplane holds is transferred to the plane->fb pointer). But should be done _after_ we update the pointer.

Breakage introduced in

commit 6c2a75325c800de286166c693e0cd33c3a1c5ec8

Author: Daniel Vetter <[email protected]>
Date:   Tue Dec 11 00:59:24 2012 +0100

drm: refcounting for sprite framebuffers

---
 drivers/gpu/drm/drm_crtc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/drm_crtc.c +0 -0
index 826a5ca..1960418 100644

drivers/gpu/drm/drm_crtc.c int drm_mode_setplane(struct drm_device *dev, void *data, · line 1990

Quoted 10 lines
drivers/gpu/drm/drm_crtc.c +1 -1
@@ -1982,9 +1982,9 @@ int drm_mode_setplane(struct drm_device *dev, void *data,
 					 plane_req->src_w, plane_req->src_h);
 	if (!ret) {
 		old_fb = plane->fb;
-		fb = NULL;
 		plane->crtc = crtc;
 		plane->fb = fb;
+		fb = NULL;
 	}
 	drm_modeset_unlock_all(dev);
 

This will allow us to restore the sprite config in no-VT switch resumes.

Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center
Reviewed-by on v1 1/1
#2 lore raw
In reply to Daniel Vetter
Quoted 10 lines · Daniel Vetter

We need to clear the local variable to get the refcounting right (since the reference drm_mode_setplane holds is transferred to the plane->fb pointer). But should be done _after_ we update the pointer.

Breakage introduced in

commit 6c2a75325c800de286166c693e0cd33c3a1c5ec8

Author: Daniel Vetter <[email protected]>
Date:   Tue Dec 11 00:59:24 2012 +0100
Quoted 6 lines

drm: refcounting for sprite framebuffers

Quoted 26 lines
---
 drivers/gpu/drm/drm_crtc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/drm_crtc.c +1 -1
index 826a5ca..1960418 100644
@@ -1982,9 +1982,9 @@ int drm_mode_setplane(struct drm_device *dev, void *data,
 					 plane_req->src_w, plane_req->src_h);
 	if (!ret) {
 		old_fb = plane->fb;
-		fb = NULL;
 		plane->crtc = crtc;
 		plane->fb = fb;
+		fb = NULL;
 	}
 	drm_modeset_unlock_all(dev);
 
Signature · 6 lines
1.7.10.4

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 2 lines
Ville Syrjälä
Intel OTC
Reviewed-by on v1 1/1
#3 lore raw
In reply to Daniel Vetter
Quoted 25 lines · Daniel Vetter

We need to clear the local variable to get the refcounting right (since the reference drm_mode_setplane holds is transferred to the plane->fb pointer). But should be done _after_ we update the pointer.

Breakage introduced in

commit 6c2a75325c800de286166c693e0cd33c3a1c5ec8

Author: Daniel Vetter <[email protected]>
Date:   Tue Dec 11 00:59:24 2012 +0100

drm: refcounting for sprite framebuffers

---
 drivers/gpu/drm/drm_crtc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/drm_crtc.c +0 -0
index 826a5ca..1960418 100644

drivers/gpu/drm/drm_crtc.c int drm_mode_setplane(struct drm_device *dev, void *data, · line 1990

Quoted 10 lines
drivers/gpu/drm/drm_crtc.c +1 -1
@@ -1982,9 +1982,9 @@ int drm_mode_setplane(struct drm_device *dev, void *data,
 					 plane_req->src_w, plane_req->src_h);
 	if (!ret) {
 		old_fb = plane->fb;
-		fb = NULL;
 		plane->crtc = crtc;
 		plane->fb = fb;
+		fb = NULL;
 	}
 	drm_modeset_unlock_all(dev);
 

Ugh... and again I sent the same patch because I didn't look properly and missed yours.

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx