From: Ezequiel Garcia <ezequiel@collabora.com>
To: dri-devel@lists.freedesktop.org
Cc: linux-rockchip@lists.infradead.org,
"Heiko Stübner" <heiko@sntech.de>,
"Sandy Huang" <hjc@rock-chips.com>,
kernel@collabora.com, "Sean Paul" <seanpaul@chromium.org>,
"Boris Brezillon" <boris.brezillon@collabora.com>,
"Douglas Anderson" <dianders@chromium.org>,
"Jacopo Mondi" <jacopo@jmondi.org>,
"Ilia Mirkin" <imirkin@alum.mit.edu>,
"Rob Herring" <robh+dt@kernel.org>,
"Mark Rutland" <mark.rutland@arm.com>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
"Ezequiel Garcia" <ezequiel@collabora.com>
Subject: [PATCH v3 5/5] RFC: drm/atomic-helper: Reapply color transformation after resume
Date: Mon, 30 Sep 2019 19:28:02 -0300 [thread overview]
Message-ID: <20190930222802.32088-6-ezequiel@collabora.com> (raw)
In-Reply-To: <20190930222802.32088-1-ezequiel@collabora.com>
Some platforms are not able to maintain the color transformation
state after a system suspend/resume cycle.
Set the colog_mgmt_changed flag so that CMM on the CRTCs in
the suspend state are reapplied after system resume.
Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
---
This is an RFC, and it's mostly based on Jacopo Mondi's work https://lkml.org/lkml/2019/9/6/498.
Changes from v2:
* New patch.
---
drivers/gpu/drm/drm_atomic_helper.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index e41db0f202ca..518488125575 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -3234,8 +3234,20 @@ int drm_atomic_helper_resume(struct drm_device *dev,
struct drm_atomic_state *state)
{
struct drm_modeset_acquire_ctx ctx;
+ struct drm_crtc_state *crtc_state;
+ struct drm_crtc *crtc;
+ unsigned int i;
int err;
+ for_each_new_crtc_in_state(state, crtc, crtc_state, i) {
+ /*
+ * Force re-enablement of CMM after system resume if any
+ * of the DRM color transformation properties was set in
+ * the state saved at system suspend time.
+ */
+ if (crtc_state->gamma_lut)
+ crtc_state->color_mgmt_changed = true;
+ }
drm_mode_config_reset(dev);
DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, 0, err);
--
2.22.0
next prev parent reply other threads:[~2019-09-30 22:28 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-30 22:27 [PATCH v3 0/5] RK3288 Gamma LUT Ezequiel Garcia
2019-09-30 22:27 ` [PATCH v3 1/5] Revert "drm/rockchip: Use drm_atomic_helper_commit_tail_rpm" Ezequiel Garcia
2019-09-30 22:27 ` [PATCH v3 2/5] dt-bindings: display: rockchip: document VOP gamma LUT address Ezequiel Garcia
2019-09-30 22:28 ` [PATCH v3 3/5] drm/rockchip: Add optional support for CRTC gamma LUT Ezequiel Garcia
2019-10-07 18:54 ` Sean Paul
2019-10-08 19:23 ` Ezequiel Garcia
2019-10-08 19:33 ` Ezequiel Garcia
2019-10-08 20:03 ` Sean Paul
2019-10-08 21:55 ` Ezequiel Garcia
2019-09-30 22:28 ` [PATCH v3 4/5] ARM: dts: rockchip: Add RK3288 VOP gamma LUT address Ezequiel Garcia
2019-09-30 22:28 ` Ezequiel Garcia [this message]
2019-10-01 14:52 ` [PATCH v3 5/5] RFC: drm/atomic-helper: Reapply color transformation after resume Jacopo Mondi
2019-10-01 14:55 ` Ville Syrjälä
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=20190930222802.32088-6-ezequiel@collabora.com \
--to=ezequiel@collabora.com \
--cc=boris.brezillon@collabora.com \
--cc=devicetree@vger.kernel.org \
--cc=dianders@chromium.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=heiko@sntech.de \
--cc=hjc@rock-chips.com \
--cc=imirkin@alum.mit.edu \
--cc=jacopo@jmondi.org \
--cc=kernel@collabora.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=mark.rutland@arm.com \
--cc=robh+dt@kernel.org \
--cc=seanpaul@chromium.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;
as well as URLs for NNTP newsgroup(s).