public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Dave Airlie <airlied@gmail.com>
To: dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org
Subject: [PATCH 3/5] drm/crtc: take references to connectors used in a modeset.
Date: Wed, 27 Apr 2016 12:03:27 +1000	[thread overview]
Message-ID: <1461722609-32474-3-git-send-email-airlied@gmail.com> (raw)
In-Reply-To: <1461722609-32474-1-git-send-email-airlied@gmail.com>

From: Dave Airlie <airlied@redhat.com>

This just takes a reference on the connector when we set a mode
in the non-atomic paths.

Signed-off-by: Dave Airlie <airlied@redhat.com>
---
 drivers/gpu/drm/drm_crtc_helper.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c
index 66ca313..29b7835 100644
--- a/drivers/gpu/drm/drm_crtc_helper.c
+++ b/drivers/gpu/drm/drm_crtc_helper.c
@@ -456,6 +456,9 @@ drm_crtc_helper_disable(struct drm_crtc *crtc)
 			 * between them is henceforth no longer available.
 			 */
 			connector->dpms = DRM_MODE_DPMS_OFF;
+
+			/* we keep a reference while the encoder is bound */
+			drm_connector_unreference(connector);
 		}
 	}
 
@@ -635,9 +638,12 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
 			mode_changed = true;
 			/* If the encoder is reused for another connector, then
 			 * the appropriate crtc will be set later.
+			 * take a reference only if we haven't had an encoder before.
 			 */
 			if (connector->encoder)
 				connector->encoder->crtc = NULL;
+			else
+				drm_connector_reference(connector);
 			connector->encoder = new_encoder;
 		}
 	}
-- 
2.5.5

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2016-04-27  2:03 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-27  2:03 [PATCH 1/5] drm/modes: add connector reference counting. (v2) Dave Airlie
2016-04-27  2:03 ` [PATCH 2/5] drm/fb_helper: add connector reference counting Dave Airlie
2016-04-27  7:33   ` [Intel-gfx] " Daniel Vetter
2016-04-27  2:03 ` Dave Airlie [this message]
2016-04-27  7:07   ` [PATCH 3/5] drm/crtc: take references to connectors used in a modeset Daniel Stone
2016-04-27  7:34   ` [Intel-gfx] " Daniel Vetter
2016-04-27  7:48     ` Daniel Vetter
2016-04-27  2:03 ` [PATCH 4/5] drm/atomic: use connector references Dave Airlie
2016-04-27  7:13   ` Daniel Stone
2016-04-27  7:47     ` [Intel-gfx] " Daniel Vetter
2016-04-27  7:22   ` Daniel Stone
2016-04-27  2:03 ` [PATCH 5/5] drm/i915/mst: use reference counted connectors. (v2) Dave Airlie
2016-04-27  7:52   ` Daniel Vetter
2016-04-27  7:28 ` [Intel-gfx] [PATCH 1/5] drm/modes: add connector reference counting. (v2) Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1461722609-32474-3-git-send-email-airlied@gmail.com \
    --to=airlied@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox