All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/2] drm: clean up internally created framebuffer on CRTC disable
@ 2017-12-07  3:01 Gurchetan Singh
  2017-12-07  9:16 ` Daniel Vetter
  0 siblings, 1 reply; 4+ messages in thread
From: Gurchetan Singh @ 2017-12-07  3:01 UTC (permalink / raw)
  To: dri-devel; +Cc: Gurchetan Singh, laurent.pinchart, daniel.vetter

When a CRTC is disabled and we used an internally created framebuffer,
this patch disables the cursor plane and drops the reference that was
introduced when we called drm_internal_framebuffer_create.

Signed-off-by: Gurchetan Singh <gurchetansingh@chromium.org>
---
 drivers/gpu/drm/drm_crtc.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index f0556e654116..d732cca4879f 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -101,12 +101,19 @@ EXPORT_SYMBOL(drm_crtc_from_index);
  */
 int drm_crtc_force_disable(struct drm_crtc *crtc)
 {
+	struct drm_framebuffer *fb;
 	struct drm_mode_set set = {
 		.crtc = crtc,
 	};
 
 	WARN_ON(drm_drv_uses_atomic_modeset(crtc->dev));
 
+	if (crtc->cursor && crtc->cursor->fb && crtc->cursor->fb->internal) {
+		fb = crtc->cursor->fb;
+		drm_plane_force_disable(crtc->cursor);
+		drm_framebuffer_unreference(fb);
+	}
+
 	return drm_mode_set_config_internal(&set);
 }
 EXPORT_SYMBOL(drm_crtc_force_disable);
-- 
2.13.5

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

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

end of thread, other threads:[~2017-12-11  9:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-07  3:01 [PATCH 2/2] drm: clean up internally created framebuffer on CRTC disable Gurchetan Singh
2017-12-07  9:16 ` Daniel Vetter
2017-12-08 22:17   ` Gurchetan Singh
2017-12-11  9:13     ` Daniel Vetter

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.