From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Uma Shankar <uma.shankar@intel.com>
Cc: dcastagna@chromium.org, jonas@kwiboo.se,
intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
seanpaul@chromium.org, ville.syrjala@intel.com,
maarten.lankhorst@intel.com
Subject: Re: [v9 06/13] drm/i915: Write HDR infoframe and send to panel
Date: Mon, 13 May 2019 22:35:39 +0300 [thread overview]
Message-ID: <20190513193539.GS24299@intel.com> (raw)
In-Reply-To: <1557340733-9629-7-git-send-email-uma.shankar@intel.com>
On Thu, May 09, 2019 at 12:08:46AM +0530, Uma Shankar wrote:
> Enable writing of HDR metadata infoframe to panel.
> The data will be provid by usersapace compositors, based
> on blending policies and passsed to driver through a blob
> property.
>
> v2: Rebase
>
> v3: Fixed a warning message
>
> v4: Addressed Shashank's review comments
>
> v5: Rebase. Added infoframe calculation in compute config.
>
> v6: Addressed Shashank's review comment. Added HDR metadata
> support from GEN10 onwards as per Shashank's recommendation.
>
> v7: Addressed Shashank's review comments
>
> v8: Added Shashank's RB.
>
> Signed-off-by: Uma Shankar <uma.shankar@intel.com>
> Reviewed-by: Shashank Sharma <shashank.sharma@intel.com>
> ---
> drivers/gpu/drm/i915/intel_drv.h | 1 +
> drivers/gpu/drm/i915/intel_hdmi.c | 48 +++++++++++++++++++++++++++++++++++++++
> 2 files changed, 49 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> index 247893e..bc32b2c 100644
> --- a/drivers/gpu/drm/i915/intel_drv.h
> +++ b/drivers/gpu/drm/i915/intel_drv.h
> @@ -910,6 +910,7 @@ struct intel_crtc_state {
> union hdmi_infoframe avi;
> union hdmi_infoframe spd;
> union hdmi_infoframe hdmi;
> + union hdmi_infoframe drm;
> } infoframes;
>
> /* HDMI scrambling status */
> diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
> index 92597d8..980900b 100644
> --- a/drivers/gpu/drm/i915/intel_hdmi.c
> +++ b/drivers/gpu/drm/i915/intel_hdmi.c
> @@ -573,6 +573,7 @@ static u32 hsw_infoframes_enabled(struct intel_encoder *encoder,
> HDMI_INFOFRAME_TYPE_AVI,
> HDMI_INFOFRAME_TYPE_SPD,
> HDMI_INFOFRAME_TYPE_VENDOR,
> + HDMI_INFOFRAME_TYPE_DRM,
> };
>
> u32 intel_hdmi_infoframe_enable(unsigned int type)
> @@ -795,6 +796,30 @@ void intel_read_infoframe(struct intel_encoder *encoder,
> return true;
> }
>
> +static bool
> +intel_hdmi_compute_drm_infoframe(struct intel_encoder *encoder,
> + struct intel_crtc_state *crtc_state,
> + struct drm_connector_state *conn_state)
> +{
> + struct hdmi_drm_infoframe *frame = &crtc_state->infoframes.drm.drm;
> + struct hdr_output_metadata *hdr_metadata;
> + int ret;
Missing has_infoframes check.
> +
> + hdr_metadata = (struct hdr_output_metadata *)
Pointless cast?
> + conn_state->hdr_output_metadata->data;
NULL pointer deref? Hmm, how does this pass CI?
> +
> + ret = drm_hdmi_infoframe_set_hdr_metadata(frame, hdr_metadata);
> + if (ret < 0) {
> + DRM_ERROR("couldn't set HDR metadata in infoframe\n");
> + return false;
> + }
> +
> + crtc_state->infoframes.enable |=
> + intel_hdmi_infoframe_enable(HDMI_INFOFRAME_TYPE_DRM);
Everyone else sets this before populating the infoframe.
Missing the whatever_infoframe_check() call here.
> +
> + return true;
> +}
> +
> static void g4x_set_infoframes(struct intel_encoder *encoder,
> bool enable,
> const struct intel_crtc_state *crtc_state,
> @@ -1180,6 +1205,16 @@ static void hsw_set_infoframes(struct intel_encoder *encoder,
> intel_write_infoframe(encoder, crtc_state,
> HDMI_INFOFRAME_TYPE_VENDOR,
> &crtc_state->infoframes.hdmi);
> +
> + /*
> + * Support HDR Metadata from Gen10 onwards
> + * ToDo: Gen9 also can support HDR with LSPCON.
> + * Support for the same to be enabled later.
> + */
> + if (INTEL_GEN(dev_priv) >= 10)
Missing glk. Actually this check can be removed entirely since
intel_write_infoframe() already checks infoframes.enable.
> + intel_write_infoframe(encoder, crtc_state,
> + HDMI_INFOFRAME_TYPE_DRM,
> + &crtc_state->infoframes.drm);
> }
>
> void intel_dp_dual_mode_set_tmds_output(struct intel_hdmi *hdmi, bool enable)
> @@ -2386,6 +2421,19 @@ int intel_hdmi_compute_config(struct intel_encoder *encoder,
> return -EINVAL;
> }
>
> + /*
> + * Support HDR Metadata from Gen10 onwards
This is not providing extra information beyond what the code is saying.
> + * ToDo: Gen9 also can support HDR with LSPCON.
> + * Support for the same to be enabled later.
This is native HDMI code. LSPCON fixme doesn't make sense here.
> + */
> + if (INTEL_GEN(dev_priv) >= 10 || IS_GEMINILAKE(dev_priv)) {
For GCP the platform check is in the function itself. Could do the same
here for consistency.
> + if (!intel_hdmi_compute_drm_infoframe(encoder, pipe_config,
> + conn_state)) {
> + DRM_DEBUG_KMS("bad DRM infoframe\n");
> + return -EINVAL;
> + }
> + }
> +
> return 0;
> }
>
> --
> 1.9.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
--
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2019-05-13 19:35 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-08 18:38 [v9 00/13] Add HDR Metadata Parsing and handling in DRM layer Uma Shankar
2019-05-08 18:34 ` ✗ Fi.CI.CHECKPATCH: warning for Add HDR Metadata Parsing and handling in DRM layer (rev9) Patchwork
2019-05-08 18:38 ` [v9 01/13] drm: Add HDR source metadata property Uma Shankar
2019-05-08 18:38 ` [v9 02/13] drm: Add reference counting on HDR metadata blob Uma Shankar
2019-05-08 18:38 ` [v9 03/13] drm: Parse HDR metadata info from EDID Uma Shankar
2019-05-13 19:19 ` Ville Syrjälä
2019-05-14 9:49 ` Shankar, Uma
2019-05-14 12:40 ` Ville Syrjälä
2019-05-14 13:26 ` Shankar, Uma
2019-05-08 18:38 ` [v9 04/13] drm: Enable HDR infoframe support Uma Shankar
2019-05-14 12:36 ` Kazlauskas, Nicholas
2019-05-14 12:39 ` Shankar, Uma
2019-05-14 12:44 ` Ville Syrjälä
2019-05-08 18:38 ` [v9 05/13] drm/i915: Attach HDR metadata property to connector Uma Shankar
2019-05-08 18:38 ` [v9 06/13] drm/i915: Write HDR infoframe and send to panel Uma Shankar
2019-05-13 19:35 ` Ville Syrjälä [this message]
2019-05-14 10:22 ` Shankar, Uma
2019-05-08 18:38 ` [v9 07/13] drm: Add HLG EOTF Uma Shankar
2019-05-08 18:38 ` [v9 08/13] drm/i915: Enable infoframes on GLK+ for HDR Uma Shankar
2019-05-13 19:37 ` Ville Syrjälä
2019-05-08 18:38 ` [v9 09/13] drm/i915:Enabled Modeset when HDR Infoframe changes Uma Shankar
2019-05-08 18:38 ` [v9 10/13] drm/i915: Set Infoframe for non modeset case for HDR Uma Shankar
2019-05-13 19:39 ` Ville Syrjälä
2019-05-14 16:22 ` Shankar, Uma
2019-05-08 18:38 ` [v9 11/13] drm/i915: Added DRM Infoframe handling for BYT/CHT Uma Shankar
2019-05-08 18:38 ` [v9 12/13] video/hdmi: Add Unpack function for DRM infoframe Uma Shankar
2019-05-13 19:49 ` Ville Syrjälä
2019-05-14 16:18 ` Shankar, Uma
2019-05-08 18:38 ` [v9 13/13] drm/i915: Add state readout " Uma Shankar
2019-05-13 19:50 ` Ville Syrjälä
2019-05-08 18:54 ` ✓ Fi.CI.BAT: success for Add HDR Metadata Parsing and handling in DRM layer (rev9) Patchwork
2019-05-08 22:13 ` ✓ Fi.CI.IGT: " Patchwork
2019-05-12 20:12 ` [v9 00/13] Add HDR Metadata Parsing and handling in DRM layer Jonas Karlman
2019-05-13 15:48 ` Shankar, Uma
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=20190513193539.GS24299@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=dcastagna@chromium.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jonas@kwiboo.se \
--cc=maarten.lankhorst@intel.com \
--cc=seanpaul@chromium.org \
--cc=uma.shankar@intel.com \
--cc=ville.syrjala@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox