All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jyri Sarha <jsarha@ti.com>
To: dri-devel@lists.freedesktop.org, linux-omap@vger.kernel.org
Cc: tomi.valkeinen@ti.com, Jyri Sarha <jsarha@ti.com>,
	laurent.pinchart@ideasonboard.com
Subject: [PATCH RFC v2 2/2] drm/atomic: Disable planes on blanked CRTC and enable on unblank
Date: Fri, 13 Nov 2015 17:53:15 +0200	[thread overview]
Message-ID: <43567a2449ed676194303f879e90feac9bf53f24.1447428525.git.jsarha@ti.com> (raw)
In-Reply-To: <cover.1447428525.git.jsarha@ti.com>

Disable planes if they are on to be blanked CRTC and enable them when
the CRTC is turned back on by DMPS.

This is desirable on HW that loses its context on blanking. When
planes are enabled and disabled with the associated CRTCs, there is no
need to restore the plane context in runtime_resume callback.

Signed-off-by: Jyri Sarha <jsarha@ti.com>
---
 drivers/gpu/drm/drm_atomic_helper.c | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index d03e2ac..5cd8016 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -2027,8 +2027,8 @@ EXPORT_SYMBOL(drm_atomic_helper_page_flip);
  *
  * This is the main helper function provided by the atomic helper framework for
  * implementing the legacy DPMS connector interface. It computes the new desired
- * ->active state for the corresponding CRTC (if the connector is enabled) and
- *  updates it.
+ * ->active state for the corresponding CRTC and planes on it (if the connector
+ * is enabled) and updates it.
  *
  * Returns:
  * Returns 0 on success, negative errno numbers on failure.
@@ -2041,6 +2041,7 @@ int drm_atomic_helper_connector_dpms(struct drm_connector *connector,
 	struct drm_crtc_state *crtc_state;
 	struct drm_crtc *crtc;
 	struct drm_connector *tmp_connector;
+	struct drm_plane *tmp_plane;
 	int ret;
 	bool active = false;
 	int old_mode = connector->dpms;
@@ -2079,6 +2080,20 @@ retry:
 	}
 	crtc_state->active = active;
 
+	/* Collect associated plane states to global state object. */
+	list_for_each_entry(tmp_plane, &config->plane_list, head) {
+		struct drm_plane_state *plane_state;
+
+		if (tmp_plane->state->crtc != crtc)
+			continue;
+
+		plane_state = drm_atomic_get_plane_state(state, tmp_plane);
+		if (IS_ERR(plane_state)) {
+			ret = PTR_ERR(plane_state);
+			goto fail;
+		}
+	}
+
 	ret = drm_atomic_commit(state);
 	if (ret != 0)
 		goto fail;
-- 
1.9.1

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

  parent reply	other threads:[~2015-11-13 15:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-13 15:53 [PATCH RFC v2 0/2] Disable planes on blanked CRTC and enable on unblank Jyri Sarha
2015-11-13 15:53 ` [PATCH RFC v2 1/2] drm/atomic: Track drm_plane's active state Jyri Sarha
2015-11-13 15:53 ` Jyri Sarha [this message]
2015-11-17 10:28 ` [PATCH RFC v2 0/2] Disable planes on blanked CRTC and enable on unblank Daniel Vetter
2015-11-17 15:38   ` Jyri Sarha

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=43567a2449ed676194303f879e90feac9bf53f24.1447428525.git.jsarha@ti.com \
    --to=jsarha@ti.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=tomi.valkeinen@ti.com \
    /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.