All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: dri-devel@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org
Subject: [PATCH v2 3/6] drm/tegra: Use __drm_atomic_helper_reset_connector for subclassing connector state, v2.
Date: Mon,  4 Jan 2016 12:53:17 +0100	[thread overview]
Message-ID: <1451908400-25147-3-git-send-email-maarten.lankhorst@linux.intel.com> (raw)
In-Reply-To: <1451908400-25147-1-git-send-email-maarten.lankhorst@linux.intel.com>

Changes since v1:
- Do not reset if state allocation fails.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Acked-by: Thierry Reding <treding@nvidia.com> #irc
---
 drivers/gpu/drm/tegra/dsi.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/tegra/dsi.c b/drivers/gpu/drm/tegra/dsi.c
index 50d46ae3786b..44e102799195 100644
--- a/drivers/gpu/drm/tegra/dsi.c
+++ b/drivers/gpu/drm/tegra/dsi.c
@@ -745,14 +745,13 @@ static void tegra_dsi_soft_reset(struct tegra_dsi *dsi)
 
 static void tegra_dsi_connector_reset(struct drm_connector *connector)
 {
-	struct tegra_dsi_state *state;
-
-	kfree(connector->state);
-	connector->state = NULL;
+	struct tegra_dsi_state *state =
+		kzalloc(sizeof(*state), GFP_KERNEL);
 
-	state = kzalloc(sizeof(*state), GFP_KERNEL);
-	if (state)
-		connector->state = &state->base;
+	if (state) {
+		kfree(connector->state);
+		__drm_atomic_helper_connector_reset(connector, &state->base);
+	}
 }
 
 static struct drm_connector_state *
-- 
2.1.0

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

  parent reply	other threads:[~2016-01-04 11:53 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-04 11:53 [PATCH v2 1/6] drm/i915: Set connector_state->connector using the helper Maarten Lankhorst
2016-01-04 11:53 ` [PATCH v2 2/6] drm/atomic: Add __drm_atomic_helper_connector_reset, v2 Maarten Lankhorst
2016-01-05  8:43   ` Daniel Vetter
2016-01-04 11:53 ` Maarten Lankhorst [this message]
2016-01-04 11:53 ` [PATCH v2 4/6] drm/atomic: add connector mask to drm_crtc_state Maarten Lankhorst
2016-01-05  8:43   ` Daniel Vetter
2016-01-04 11:53 ` [PATCH v2 5/6] drm/i915: Update connector_mask during readout Maarten Lankhorst
2016-01-05  8:35   ` Daniel Vetter
2016-01-05  9:05     ` Maarten Lankhorst
2016-01-05  9:10       ` [Intel-gfx] " Daniel Vetter
2016-01-05  9:16         ` Maarten Lankhorst
2016-01-06 13:53         ` [PATCH v2.1 5/6] drm/i915: Update connector_mask during readout, v2 Maarten Lankhorst
2016-01-04 11:53 ` [PATCH v2 6/6] drm/atomic: Remove drm_atomic_connectors_for_crtc Maarten Lankhorst
2016-01-05  8:45   ` Daniel Vetter
2016-01-04 12:49 ` ✗ warning: Fi.CI.BAT Patchwork

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=1451908400-25147-3-git-send-email-maarten.lankhorst@linux.intel.com \
    --to=maarten.lankhorst@linux.intel.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 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.