All of lore.kernel.org
 help / color / mirror / Atom feed
From: Uma Shankar <uma.shankar@intel.com>
To: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: [RFC 9/9] drm/i915: Write HDR infoframe and send to panel
Date: Wed, 31 May 2017 15:40:57 +0530	[thread overview]
Message-ID: <1496225457-30514-10-git-send-email-uma.shankar@intel.com> (raw)
In-Reply-To: <1496225457-30514-1-git-send-email-uma.shankar@intel.com>

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.

Signed-off-by: Uma Shankar <uma.shankar@intel.com>
---
 drivers/gpu/drm/i915/intel_hdmi.c |   25 +++++++++++++++++++++++++
 drivers/video/hdmi.c              |    2 +-
 2 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
index d8b53d0..91e0399 100644
--- a/drivers/gpu/drm/i915/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/intel_hdmi.c
@@ -453,6 +453,27 @@ static void intel_write_infoframe(struct drm_encoder *encoder,
 	intel_hdmi->write_infoframe(encoder, crtc_state, frame->any.type, buffer, len);
 }
 
+/* Set Dynamic Range and Mastering Infoframe */
+static void intel_hdmi_set_drm_infoframe(struct drm_encoder *encoder,
+					 const struct intel_crtc_state *crtc_state,
+					 const struct drm_connector_state *conn_state)
+{
+	union hdmi_infoframe frame;
+	struct hdr_static_metadata *hdr_metadata;
+	int ret;
+
+	hdr_metadata = (struct hdr_static_metadata *)
+		conn_state->hdr_source_metadata_blob_ptr->data;
+
+	ret = drm_hdmi_infoframe_set_hdr_metadata(&frame.drm, hdr_metadata);
+	if (ret < 0) {
+		DRM_ERROR("couldn't set HDR metadata in infoframe\n");
+		return;
+	}
+
+	intel_write_infoframe(encoder, crtc_state, &frame);
+}
+
 static void intel_hdmi_set_avi_infoframe(struct drm_encoder *encoder,
 					 const struct intel_crtc_state *crtc_state)
 {
@@ -840,6 +861,10 @@ static void hsw_set_infoframes(struct drm_encoder *encoder,
 	intel_hdmi_set_avi_infoframe(encoder, crtc_state);
 	intel_hdmi_set_spd_infoframe(encoder, crtc_state);
 	intel_hdmi_set_hdmi_infoframe(encoder, crtc_state);
+
+	/* Set Dynamic Range and Mastering Infoframe if supported and changed */
+	if (conn_state->hdr_metadata_changed)
+		intel_hdmi_set_drm_infoframe(encoder, crtc_state, conn_state);
 }
 
 void intel_dp_dual_mode_set_tmds_output(struct intel_hdmi *hdmi, bool enable)
diff --git a/drivers/video/hdmi.c b/drivers/video/hdmi.c
index 2740f40..8d06ea2 100644
--- a/drivers/video/hdmi.c
+++ b/drivers/video/hdmi.c
@@ -421,7 +421,7 @@ int hdmi_drm_infoframe_init(struct hdmi_drm_infoframe *frame)
  * error code on failure.
  */
 ssize_t hdmi_drm_infoframe_pack(struct hdmi_drm_infoframe *frame, void *buffer,
-                                size_t size)
+                               size_t size)
 {
 	u8 *ptr = buffer;
 	size_t length;
-- 
1.7.9.5

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2017-05-31 10:10 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-31 10:10 [RFC 0/9] Add HDR Metadata Parsing and handling in DRM layer Uma Shankar
2017-05-31  9:39 ` [Intel-gfx] " Daniel Vetter
2017-05-31 10:10 ` [RFC 1/9] drm: Add HDR source metadata property Uma Shankar
2017-05-31 10:10 ` [RFC 2/9] drm: Add CEA extended tag blocks and HDR bitfield macros Uma Shankar
2017-05-31 10:10 ` [RFC 3/9] drm: Parse HDR metadata info from EDID Uma Shankar
2017-05-31 10:10 ` [RFC 4/9] drm: Parse Colorimetry data block " Uma Shankar
2017-05-31 10:10 ` [RFC 5/9] drm/i915: Attach HDR metadata property to connector Uma Shankar
2017-05-31 10:10 ` [RFC 6/9] drm: Add HDR capabilty field to plane structure Uma Shankar
2017-05-31 10:10 ` [RFC 7/9] drm: Implement HDR source metadata set and get property handling Uma Shankar
2017-05-31 10:10 ` [RFC 8/9] drm: Enable HDR infoframe support Uma Shankar
2017-05-31 10:10 ` Uma Shankar [this message]
2017-05-31 10:36 ` ✓ Fi.CI.BAT: success for Add HDR Metadata Parsing and handling in DRM layer Patchwork

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=1496225457-30514-10-git-send-email-uma.shankar@intel.com \
    --to=uma.shankar@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.