All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH v3 09/20] drm/i915: Fill in more crtc state, v3.
Date: Mon, 13 Jul 2015 16:30:22 +0200	[thread overview]
Message-ID: <1436797833-11493-10-git-send-email-maarten.lankhorst@linux.intel.com> (raw)
In-Reply-To: <1436797833-11493-1-git-send-email-maarten.lankhorst@linux.intel.com>

There is a small memory leak in intel_modeset_readout_hw_state,
plug it.

intel_sanitize_crtc should set a null mode when disabling the crtc,
this updates crtc_state->enable too.

intel_sanitize_crtc also needs to update the vblank timestamps before
enabling vblank to make it work right.

Changes since v1:
- Moved after reworking primary plane and updating mode members.
- Force a modeset calculation by changing mode->type from what the
  final mode will be.
Changes since v2:
- Do not fill out mode, this should only be done for supporting fastboot.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index d37f6a93b094..819a2b551f1f 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -15248,6 +15248,7 @@ static void intel_sanitize_crtc(struct intel_crtc *crtc)
 	/* restore vblank interrupts to correct state */
 	drm_crtc_vblank_reset(&crtc->base);
 	if (crtc->active) {
+		drm_calc_timestamping_constants(&crtc->base, &crtc->base.hwmode);
 		update_scanline_offset(crtc);
 		drm_crtc_vblank_on(&crtc->base);
 	}
@@ -15300,7 +15301,7 @@ static void intel_sanitize_crtc(struct intel_crtc *crtc)
 			      crtc->base.state->enable ? "enabled" : "disabled",
 			      crtc->active ? "enabled" : "disabled");
 
-		crtc->base.state->enable = crtc->active;
+		WARN_ON(drm_atomic_set_mode_for_crtc(crtc->base.state, NULL) < 0);
 		crtc->base.state->active = crtc->active;
 		crtc->base.enabled = crtc->active;
 
@@ -15450,6 +15451,7 @@ static void intel_modeset_readout_hw_state(struct drm_device *dev)
 	int i;
 
 	for_each_intel_crtc(dev, crtc) {
+		__drm_atomic_helper_crtc_destroy_state(&crtc->base, crtc->base.state);
 		memset(crtc->config, 0, sizeof(*crtc->config));
 		crtc->config->base.crtc = &crtc->base;
 
-- 
2.1.0

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

  parent reply	other threads:[~2015-07-13 14:30 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-13 14:30 [PATCH v3 00/20] Convert to atomic, part 4 Maarten Lankhorst
2015-07-13 14:30 ` [PATCH v3 01/20] drm/i915: Only update state on crtc's that are part of the atomic state Maarten Lankhorst
2015-07-13 14:30 ` [PATCH v3 02/20] drm/i915: Do not update pfit state when toggling crtc enabled Maarten Lankhorst
2015-07-13 14:30 ` [PATCH v3 03/20] drm/i915: Do not use plane_config in intel_fbdev.c Maarten Lankhorst
2015-07-13 14:30 ` [PATCH v3 04/20] drm/i915: Allow fuzzy matching in pipe_config_compare, v2 Maarten Lankhorst
2015-07-14  9:49   ` Daniel Vetter
2015-07-14 10:17     ` [PATCH v3.1 " Maarten Lankhorst
2015-07-13 14:30 ` [PATCH v3 05/20] drm/i915: Update missing properties in find_initial_plane_obj Maarten Lankhorst
2015-07-13 14:30 ` [PATCH v3 06/20] drm/i915: Remove plane_config from struct intel_crtc Maarten Lankhorst
2015-07-13 16:30   ` Daniel Stone
2015-07-14  8:27     ` Maarten Lankhorst
2015-07-14 11:23       ` Daniel Stone
2015-07-14 10:33     ` [PATCH v3.1 06/20] drm/i915: Remove plane_config from struct intel_crtc, v2 Maarten Lankhorst
2015-07-14 12:02       ` Daniel Vetter
2015-07-13 14:30 ` [PATCH v3 07/20] drm/i915: Rework plane readout Maarten Lankhorst
2015-07-14  9:53   ` Daniel Vetter
2015-07-14 10:30     ` Maarten Lankhorst
2015-07-14 10:35       ` Daniel Vetter
2015-07-13 14:30 ` [PATCH v3 08/20] drm/i915: fill in more mode members Maarten Lankhorst
2015-07-14  9:50   ` Daniel Vetter
2015-07-14 10:31     ` Maarten Lankhorst
2015-07-14 11:21     ` Daniel Stone
2015-07-14 11:40       ` Maarten Lankhorst
2015-07-14 12:12         ` [PATCH v3.1 " Maarten Lankhorst
2015-07-14 12:12           ` Daniel Stone
2015-07-14 12:42         ` [PATCH v3 " Daniel Vetter
2015-07-13 14:30 ` Maarten Lankhorst [this message]
2015-07-14  9:49   ` [PATCH v3 09/20] drm/i915: Fill in more crtc state, v3 Daniel Vetter
2015-07-14 11:42     ` Maarten Lankhorst
2015-07-14 11:42     ` [PATCH 1/3] drm/i915: Fix reference leak in intel_modeset_readout_hw_state Maarten Lankhorst
2015-07-14 11:47       ` Daniel Stone
2015-07-14 11:45     ` [PATCH 2/3] drm/i915: Zero the mode in intel_sanitize_crtc when force disabling Maarten Lankhorst
2015-07-14 11:47       ` Daniel Stone
2015-07-14 11:46     ` [PATCH 3/3] drm/i915: Calculate vblank timestamping constants before enabling vblank Maarten Lankhorst
2015-07-14 11:47       ` Daniel Stone
2015-07-13 14:30 ` [PATCH v3 10/20] drm/i915: Set csc coefficients in intel_sanitize_crtc Maarten Lankhorst
2015-07-13 16:21   ` Daniel Stone
2015-07-14  8:50     ` Maarten Lankhorst
2015-07-14  9:55       ` Daniel Vetter
2015-07-14 10:12         ` Maarten Lankhorst
2015-07-13 14:30 ` [PATCH v3 11/20] drm/i915: Readout initial hw mode Maarten Lankhorst
2015-07-14 13:58   ` [PATCH v3.1 " Maarten Lankhorst
2015-07-13 14:30 ` [PATCH v3 12/20] drm/i915: Convert resume to atomic Maarten Lankhorst
2015-07-13 14:30 ` [PATCH v3 13/20] drm/i915: Get rid of unused transitional members Maarten Lankhorst
2015-07-13 14:30 ` [PATCH v3 14/20] drm/i915: Update power domains on readout Maarten Lankhorst
2015-07-13 14:30 ` [PATCH v3 15/20] drm/i915: Always reset in intel_crtc_restore_mode Maarten Lankhorst
2015-07-14  9:56   ` Daniel Vetter
2015-07-14 14:19     ` [PATCH v3.1 15/20] drm/i915: Always force a modeset in intel_crtc_restore_mode, v2 Maarten Lankhorst
2015-07-13 14:30 ` [PATCH v3 16/20] drm/i915: Make intel_display_suspend atomic, try 2 Maarten Lankhorst
2015-07-14 16:14   ` Daniel Vetter
2015-07-15  4:05     ` Maarten Lankhorst
2015-07-13 14:30 ` [PATCH v3 17/20] drm/i915: Use full atomic modeset Maarten Lankhorst
2015-07-13 14:30 ` [PATCH v3 18/20] drm/i915: Call plane update functions directly from intel_atomic_commit Maarten Lankhorst
2015-07-13 14:30 ` [PATCH v3 19/20] drm/i915: always disable irqs in intel_pipe_update_start Maarten Lankhorst
2015-07-13 17:16   ` Daniel Stone
2015-07-14  7:57     ` Maarten Lankhorst
2015-07-15  6:38     ` Maarten Lankhorst
2015-07-13 14:30 ` [PATCH v3 20/20] drm/i915: Remove use of runtime pm in atomic commit functions Maarten Lankhorst
2015-07-13 17:35 ` [PATCH v3 00/20] Convert to atomic, part 4 Daniel Stone
2015-07-16 17:43 ` Daniel Stone

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=1436797833-11493-10-git-send-email-maarten.lankhorst@linux.intel.com \
    --to=maarten.lankhorst@linux.intel.com \
    --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.