From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 903F9C2D0EA for ; Wed, 8 Apr 2020 13:38:10 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 66C4A2072A for ; Wed, 8 Apr 2020 13:38:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 66C4A2072A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DEC576EA64; Wed, 8 Apr 2020 13:38:09 +0000 (UTC) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id 028AA6EA64 for ; Wed, 8 Apr 2020 13:38:07 +0000 (UTC) IronPort-SDR: +k19JGhziT6GVi2jLp5EVAmtr5PREv5ECxQtj00ad6dxiZevW0ZTbqJ40ENf/UCovebz1fIMUY YMpD/StuFOWg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Apr 2020 06:38:07 -0700 IronPort-SDR: 7LJhH5rOmB845bgIYQaqlToBdjxOB24weK1EIgyRwFvIvG1yXx1MQplp/NQTP0+RSiWRimaVTg sQuNEBAJmPDg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,358,1580803200"; d="scan'208";a="244037430" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by fmsmga008.fm.intel.com with SMTP; 08 Apr 2020 06:38:02 -0700 Received: by stinkbox (sSMTP sendmail emulation); Wed, 08 Apr 2020 16:38:01 +0300 Date: Wed, 8 Apr 2020 16:38:01 +0300 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= To: "Shankar, Uma" Message-ID: <20200408133801.GS6112@intel.com> References: <20200408111347.5156-1-kishore.kadiyala@intel.com> <20200408124630.GQ6112@intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Patchwork-Hint: comment User-Agent: Mutt/1.10.1 (2018-07-13) Subject: Re: [Intel-gfx] [PATCH v3] drm/i915: Add Plane color encoding support for YCBCR_BT2020 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Nikula, Jani" , "intel-gfx@lists.freedesktop.org" , "Kadiyala, Kishore" Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Wed, Apr 08, 2020 at 01:23:27PM +0000, Shankar, Uma wrote: > = > = > > -----Original Message----- > > From: Ville Syrj=E4l=E4 > > Sent: Wednesday, April 8, 2020 6:17 PM > > To: Kadiyala, Kishore > > Cc: intel-gfx@lists.freedesktop.org; Shankar, Uma ; > > Nikula, Jani > > Subject: Re: [PATCH v3] drm/i915: Add Plane color encoding support for > > YCBCR_BT2020 > > = > > On Wed, Apr 08, 2020 at 04:43:47PM +0530, Kishore Kadiyala wrote: > > > Currently the plane property doesn't have support for YCBCR_BT2020, > > > which enables the corresponding color conversion mode on plane CSC. > > > In ICL+ platforms , this property setting is confined only to HDR > > > Planes as there is limitation in SDR Planes and while in GLK it set > > > for all planes. > > > > > > V2: Enabling support for YCBCT_BT2020 for HDR planes on > > > platforms GLK & ICL > > > > > > V3: Refined the condition check to handle GLK & ICL+ HDR planes > > > Also added BT2020 handling in glk_plane_color_ctl. > > > > > > Cc: Ville Syrjala > > > Cc: Uma Shankar > > > Cc: Jani Nikula > > > Signed-off-by: Kishore Kadiyala > > > --- > > > drivers/gpu/drm/i915/display/intel_display.c | 12 +++++++++--- > > > drivers/gpu/drm/i915/display/intel_sprite.c | 17 +++++++++++++++-- > > > 2 files changed, 24 insertions(+), 5 deletions(-) > > > > > > diff --git a/drivers/gpu/drm/i915/display/intel_display.c > > > b/drivers/gpu/drm/i915/display/intel_display.c > > > index 70ec301fe6e3..f2dfa61a49fa 100644 > > > --- a/drivers/gpu/drm/i915/display/intel_display.c > > > +++ b/drivers/gpu/drm/i915/display/intel_display.c > > > @@ -4808,11 +4808,17 @@ u32 glk_plane_color_ctl(const struct intel_cr= tc_state > > *crtc_state, > > > plane_color_ctl |=3D glk_plane_color_ctl_alpha(plane_state); > > > > > > if (fb->format->is_yuv && !icl_is_hdr_plane(dev_priv, plane->id)) { > > > - if (plane_state->hw.color_encoding =3D=3D > > DRM_COLOR_YCBCR_BT709) > > > + switch (plane_state->hw.color_encoding) { > > > + case DRM_COLOR_YCBCR_BT709: > > > plane_color_ctl |=3D > > PLANE_COLOR_CSC_MODE_YUV709_TO_RGB709; > > > - else > > > + break; > > > + case DRM_COLOR_YCBCR_BT2020: > > > + plane_color_ctl |=3D > > > + > > PLANE_COLOR_CSC_MODE_YUV2020_TO_RGB2020; > > > + break; > > > + default: > > > plane_color_ctl |=3D > > PLANE_COLOR_CSC_MODE_YUV601_TO_RGB709; > > > - > > > + } > > > if (plane_state->hw.color_range =3D=3D > > DRM_COLOR_YCBCR_FULL_RANGE) > > > plane_color_ctl |=3D > > PLANE_COLOR_YUV_RANGE_CORRECTION_DISABLE; > > > } else if (fb->format->is_yuv) { > > > diff --git a/drivers/gpu/drm/i915/display/intel_sprite.c > > > b/drivers/gpu/drm/i915/display/intel_sprite.c > > > index deda351719db..237c4b951f02 100644 > > > --- a/drivers/gpu/drm/i915/display/intel_sprite.c > > > +++ b/drivers/gpu/drm/i915/display/intel_sprite.c > > > @@ -3031,6 +3031,7 @@ skl_universal_plane_create(struct drm_i915_priv= ate > > *dev_priv, > > > struct intel_plane *plane; > > > enum drm_plane_type plane_type; > > > unsigned int supported_rotations; > > > + unsigned int supported_csc; > > > const u64 *modifiers; > > > const u32 *formats; > > > int num_formats; > > > @@ -3105,9 +3106,21 @@ skl_universal_plane_create(struct drm_i915_pri= vate > > *dev_priv, > > > DRM_MODE_ROTATE_0, > > > supported_rotations); > > > > > > + supported_csc =3D BIT(DRM_COLOR_YCBCR_BT601) | > > > +BIT(DRM_COLOR_YCBCR_BT709); > > > + > > > + /* > > > + * Setting the CSC BT2020 for all the planes in case of GLK > > > + * While for ICL+ platforms it is set only for HDR planes 1 through= 3 > > > + * as there are issues seen with SDR planes > > = > > What issues are those? > = > There was an issue on some of the hardcoded matrix values used in SDR pla= nes, > hence it would be good to not enable BT2020 conversion on SDR planes in I= CL+ > till this gets resolved. = > Reference WA: #220884772 > "Incorrect plane CSC coefficients for sRGB to Bt2020 : > SDR planes PLANE_COLOR_CTL Plane CSC Mode 100b, RGB709 to RGB2020, = > uses hardcoded R-Y coefficient of 0.75 instead of 0.625, resulting in inc= orrect BT2020 > color conversion. WA: Limit RGB709 to RGB2020 conversion to the HDR capab= le planes" That only matters for RGB->RGB conversion, which has nothing to do with this patch. > = > @Kishore : Please add this as comment here. > = > > > + */ > > > + if ((INTEL_GEN(dev_priv) =3D=3D 10) || IS_GEMINILAKE(dev_priv)) > > > + supported_csc |=3D BIT(DRM_COLOR_YCBCR_BT2020); > > > + else > > > + if (icl_is_hdr_plane(dev_priv, plane_id)) > > > + supported_csc |=3D BIT(DRM_COLOR_YCBCR_BT2020); > > > + > > > drm_plane_create_color_properties(&plane->base, > > > - BIT(DRM_COLOR_YCBCR_BT601) | > > > - BIT(DRM_COLOR_YCBCR_BT709), > > > + supported_csc, > > > > > BIT(DRM_COLOR_YCBCR_LIMITED_RANGE) | > > > BIT(DRM_COLOR_YCBCR_FULL_RANGE), > > > DRM_COLOR_YCBCR_BT709, > > > -- > > > 2.17.1 > > = > > -- > > Ville Syrj=E4l=E4 > > Intel -- = Ville Syrj=E4l=E4 Intel _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx