From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jacopo Mondi Subject: Re: [PATCH v3 5/5] RFC: drm/atomic-helper: Reapply color transformation after resume Date: Tue, 1 Oct 2019 16:52:22 +0200 Message-ID: <20191001145222.32aapomoqlaxpvbb@uno.localdomain> References: <20190930222802.32088-1-ezequiel@collabora.com> <20190930222802.32088-6-ezequiel@collabora.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="zl62uyu5oe5zzls3" Return-path: Content-Disposition: inline In-Reply-To: <20190930222802.32088-6-ezequiel@collabora.com> Sender: linux-kernel-owner@vger.kernel.org To: Ezequiel Garcia Cc: dri-devel@lists.freedesktop.org, linux-rockchip@lists.infradead.org, Heiko =?utf-8?Q?St=C3=BCbner?= , Sandy Huang , kernel@collabora.com, Sean Paul , Boris Brezillon , Douglas Anderson , Ilia Mirkin , Rob Herring , Mark Rutland , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org List-Id: devicetree@vger.kernel.org --zl62uyu5oe5zzls3 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Hi Ezequiel, On Mon, Sep 30, 2019 at 07:28:02PM -0300, Ezequiel Garcia wrote: > 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 CMM is the name of the Renesas unit for color enanchement. It should not be used here as this will apply to all platforms. > the suspend state are reapplied after system resume. > > Signed-off-by: Ezequiel Garcia > --- > 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) Please note that in my original patch I only took gamma_lut into account as that's what our CMM supports at the moment, but you should here consider the degamma_lut and cmt flags in the crtc_state. > + crtc_state->color_mgmt_changed = true; > + } > drm_mode_config_reset(dev); > > DRM_MODESET_LOCK_ALL_BEGIN(dev, ctx, 0, err); > -- > 2.22.0 > --zl62uyu5oe5zzls3 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEtcQ9SICaIIqPWDjAcjQGjxahVjwFAl2TaCYACgkQcjQGjxah VjyNJA//aSwBuTdB7lLcaiEaE+P3RsAcLZl6sS/EGaTO5tsvgJD43qhcW0FyAZdV 8ABNJ3e+W7ZgTzkHWVBvs6Y5eQlE3AvvAhXFPEjL9ca9Y/rRLgcF6mQ8GQCqsYO7 dvBkd1bpWG7XBOO5KzSLSDbIsjDRmDbpFVQHtTWDJZN/LzIqZHoGPZL9Tc7yoAY7 9MW3av52glPOWqTJj9zscg/Y7BWuapCmmPPV97iLUPKVtvN/G+2fgIVxushM2e3K TJvYsU63CZ5pzKX1U02UBbs0KKsENRRjWCTcGs2gf5xq0WhBs+lC0uZAclNkw/lu wd5ehPD3CaE2NiBECnHtptxEZE+jMzzP7jmDojYHILG0NqV6pcVVHdZsYK7AE/qb CfqDtLn6HnbaZZcia7Smp50QpTGY5z46Qe9l15CH/wtzjywwyKyl9GvuEK18ycx5 6iwGZW0PYHJnAQwh0U4F92akAXIOf5xfpW2358jlIr8iwmSE5UgrqA4YcDDPGDfs 7YvBDUBn/Bs0RYUetb/+HI5rcYZsWdBkpL/cHP6y+8yItmdS9IyYlHS6pXxm3X04 dS7tEaUs29GYJKsVshqq7ORctg0pd4ebsSsZeyqTLq7YmzXefjzpHihSvuKt0oMU pqCdnYKZkFUm70gLJXTHVVjSty7YOBB428DgPlWTFmgNUvVUqec= =hYRk -----END PGP SIGNATURE----- --zl62uyu5oe5zzls3--