From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tomi Valkeinen Subject: Re: [PATCH v5 1/4] drm: drm_helper_crtc_enable_color_mgmt() => drm_crtc_enable_color_mgmt() Date: Thu, 26 May 2016 12:05:32 +0300 Message-ID: <5746BC5C.1070600@ti.com> References: <0816cb2f539f2a8c7cd0d2e1252e6902f687e1ae.1464251087.git.jsarha@ti.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0396296548==" Return-path: Received: from comal.ext.ti.com (comal.ext.ti.com [198.47.26.152]) by gabe.freedesktop.org (Postfix) with ESMTPS id 56BE86EA63 for ; Thu, 26 May 2016 09:05:41 +0000 (UTC) In-Reply-To: <0816cb2f539f2a8c7cd0d2e1252e6902f687e1ae.1464251087.git.jsarha@ti.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Jyri Sarha , dri-devel@lists.freedesktop.org, daniel@ffwll.ch Cc: peter.ujfalusi@ti.com, laurent.pinchart@ideasonboard.com List-Id: dri-devel@lists.freedesktop.org --===============0396296548== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="5Lm0fvWlSBrRcgebfh5nqMT9X11uUjEhm" --5Lm0fvWlSBrRcgebfh5nqMT9X11uUjEhm Content-Type: multipart/mixed; boundary="AmJR7IhcocsQ0vac5eHU3Umgc4BO4UWJE" From: Tomi Valkeinen To: Jyri Sarha , dri-devel@lists.freedesktop.org, daniel@ffwll.ch Cc: airlied@linux.ie, peter.ujfalusi@ti.com, bparrot@ti.com, laurent.pinchart@ideasonboard.com, lionel.g.landwerlin@intel.com Message-ID: <5746BC5C.1070600@ti.com> Subject: Re: [PATCH v5 1/4] drm: drm_helper_crtc_enable_color_mgmt() => drm_crtc_enable_color_mgmt() References: <0816cb2f539f2a8c7cd0d2e1252e6902f687e1ae.1464251087.git.jsarha@ti.com> In-Reply-To: <0816cb2f539f2a8c7cd0d2e1252e6902f687e1ae.1464251087.git.jsarha@ti.com> --AmJR7IhcocsQ0vac5eHU3Umgc4BO4UWJE Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Jyri, Daniel, On 26/05/16 11:35, Jyri Sarha wrote: > Add drm_crtc_enable_color_mgmt(), remove drm_helper_crtc_enable_color_m= gmt() > and update drm/i915-driver (the only user of the old function). >=20 > The new function is more flexible. It allows driver to enable only the > features it has without forcing to enable all three color management > properties: degamma lut, csc matrix (ctm), and gamma lut. >=20 > Suggested-by: Daniel Vetter > Signed-off-by: Jyri Sarha > +void drm_crtc_enable_color_mgmt(struct drm_crtc *crtc, > + uint degamma_lut_size, > + bool has_ctm, > + uint gamma_lut_size) > +{ > + struct drm_device *dev =3D crtc->dev; > + struct drm_mode_config *config =3D &dev->mode_config; > + > + if (degamma_lut_size) { > + drm_object_attach_property(&crtc->base, > + config->degamma_lut_property, 0); > + drm_object_attach_property(&crtc->base, > + config->degamma_lut_size_property, > + degamma_lut_size); > + } > + > + if (has_ctm) > + drm_object_attach_property(&crtc->base, > + config->ctm_property, 0); > + > + if (gamma_lut_size) { > + drm_object_attach_property(&crtc->base, > + config->gamma_lut_property, 0); > + drm_object_attach_property(&crtc->base, > + config->gamma_lut_size_property, > + gamma_lut_size); > + } > +} As I mentioned, I think it would make sense to call drm_mode_crtc_set_gamma_size() here. At least from omapdrm perspective. I had a look at i915, and that one looks a bit odd. It always sets drm_mode_crtc_set_gamma_size(256), but then only calls drm_helper_crtc_enable_color_mgmt() if INTEL_INFO(dev)->color.gamma_lut_size > 0, and gives gamma_lut_size as the size. Is there some legacy stuff at play here? drm_mode_crtc_set_gamma_size() should always be 256 (as X expects that), but the GAMMA_LUT property can give the real gamma lut size? Tomi --AmJR7IhcocsQ0vac5eHU3Umgc4BO4UWJE-- --5Lm0fvWlSBrRcgebfh5nqMT9X11uUjEhm Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXRrxcAAoJEPo9qoy8lh71Oc8P/ie29mAWCFbHUQkhzgRc2iBB vbiCAq9HM5o9YFv4SVYCVw3hVLbXq9f3U67fCfuKJA/wqsmlkYi8WcwTv2PdDGio T571S0WnQVF3jc0BLd831JDUHmv0GjZOFf0GL4hJqVVz/9R5J8EYiV3ilX6xMsXm SkjwG1kMuzmKRE+mLycyVLpIUhHdZsz6okQtlPMbpqa9TD37rJIo9Wcw7yDPXVuM NyXqAVvu4FcR3k3UAPzm8K2VWA44G8spm/7VGDjsPSIn6MU67fLkfmMQi2X/o9YT lcSzSOdLWA5vGHD6dZI7asM9wUmHuS/vd4BMWcE3Y3x32s1AWddS0JNw3bexGZQy 4jwOB+qMEpNYa16VaZ50U5beu2m0UJMHoKoVHWqJC3KkiV1VGZVFHtd7BhUzKcXH gWqkdQv0GEDGlnk6jBoDFZe8vD/krXTFK2ooBXaCyScvmNgHkhrn8t0sSLQ1u79G iV2VUXBQAq0SUoAIMHmle7bL1PY7oxkhI8f2bP2zRE6Int3E9W27SQddHGzCZUTX XcV5rh7Po6nspi7sygIRxgyWD1utIvwBWLUFstH6ejnE8jWZ3NLtGOcouP5Z4ugI LXozfSkTs55MAyTmKyQteZs4ls2lXHXLHWnICBSKB/YgyGtqi4j/cP7kHvHKGrEm lvWJhxACnd5hvplk2Sl0 =FQAh -----END PGP SIGNATURE----- --5Lm0fvWlSBrRcgebfh5nqMT9X11uUjEhm-- --===============0396296548== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVsCg== --===============0396296548==--