From: Shashank Sharma <shashank.sharma@intel.com>
To: dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org
Cc: Jose Abreu <Jose.Abreu@synopsys.com>
Subject: [PATCH v5 10/17] drm: set output colorspace in AVI infoframe
Date: Tue, 4 Jul 2017 19:41:57 +0530 [thread overview]
Message-ID: <1499177524-26292-11-git-send-email-shashank.sharma@intel.com> (raw)
In-Reply-To: <1499177524-26292-1-git-send-email-shashank.sharma@intel.com>
HDMI source must set output colorspace information in AVI
infoframes, so that the sink can decode upcoming frames
accordingly.
As this patch series is adding support for HDMI output modes
other than RGB, this patch adds a function in DRM layer, to
add the output colorspace information in the AVI infoframes.
V2: Rebase
V3: Rebase
V4: Rebase
V5: Rebase
Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
Cc: Jose Abreu <Jose.Abreu@synopsys.com>
Signed-off-by: Shashank Sharma <shashank.sharma@intel.com>
---
drivers/gpu/drm/drm_edid.c | 40 ++++++++++++++++++++++++++++++++++++++++
include/drm/drm_edid.h | 5 +++++
2 files changed, 45 insertions(+)
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 944a28f..9d030bb 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -4796,6 +4796,46 @@ drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame,
EXPORT_SYMBOL(drm_hdmi_avi_infoframe_from_display_mode);
/**
+ * drm_hdmi_avi_infoframe_set_colorspace - fill an HDMI AVI infoframe with
+ * colorspace data of the output type
+ *
+ * @frame: HDMI AVI infoframe
+ * @mode: DRM display mode
+ * @hdmi_output: HDMI output colorspace
+ *
+ * Return: 0 on success or a negative error code on failure.
+ */
+int
+drm_hdmi_avi_infoframe_set_colorspace(struct hdmi_avi_infoframe *frame,
+ const struct drm_display_mode *mode,
+ enum drm_hdmi_output_type hdmi_output)
+{
+ switch (hdmi_output) {
+ case DRM_HDMI_OUTPUT_YCBCR444:
+ frame->colorspace = HDMI_COLORSPACE_YUV444;
+ break;
+ case DRM_HDMI_OUTPUT_YCBCR422:
+ frame->colorspace = HDMI_COLORSPACE_YUV422;
+ break;
+ case DRM_HDMI_OUTPUT_YCBCR420:
+ frame->colorspace = HDMI_COLORSPACE_YUV420;
+ frame->pixel_repeat = 0;
+ break;
+ case DRM_HDMI_OUTPUT_DEFAULT_RGB:
+ frame->colorspace = HDMI_COLORSPACE_RGB;
+ break;
+ case DRM_HDMI_OUTPUT_YCBCR_HQ:
+ case DRM_HDMI_OUTPUT_YCBCR_LQ:
+ case DRM_HDMI_OUTPUT_INVALID:
+ DRM_ERROR("Invalid HDMI output type\n");
+ return -EINVAL;
+ }
+
+ return 0;
+}
+EXPORT_SYMBOL(drm_hdmi_avi_infoframe_set_colorspace);
+
+/**
* drm_hdmi_avi_infoframe_quant_range() - fill the HDMI AVI infoframe
* quantization range information
* @frame: HDMI AVI infoframe
diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h
index aa58146..286cff0 100644
--- a/include/drm/drm_edid.h
+++ b/include/drm/drm_edid.h
@@ -332,6 +332,7 @@ struct cea_sad {
struct drm_encoder;
struct drm_connector;
struct drm_display_mode;
+enum drm_hdmi_output_type;
void drm_edid_to_eld(struct drm_connector *connector, struct edid *edid);
int drm_edid_to_sad(struct edid *edid, struct cea_sad **sads);
@@ -354,6 +355,10 @@ drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame,
const struct drm_display_mode *mode,
bool is_hdmi2_sink);
int
+drm_hdmi_avi_infoframe_set_colorspace(struct hdmi_avi_infoframe *frame,
+ const struct drm_display_mode *mode,
+ enum drm_hdmi_output_type hdmi_output);
+int
drm_hdmi_vendor_infoframe_from_display_mode(struct hdmi_vendor_infoframe *frame,
const struct drm_display_mode *mode);
void
--
2.7.4
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-07-04 14:11 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-04 14:11 [PATCH v5 00/17] HDMI YCBCR output handling in DRM layer Shashank Sharma
2017-07-04 14:11 ` [PATCH v5 01/17] drm: add HDMI 2.0 VIC support for AVI info-frames Shashank Sharma
2017-07-04 14:11 ` [PATCH v5 02/17] drm: add YCBCR 420 capability identifier Shashank Sharma
2017-07-04 15:55 ` Ville Syrjälä
2017-07-05 3:15 ` Sharma, Shashank
2017-07-04 14:11 ` [PATCH v5 03/17] drm/edid: Complete CEA modedb(VIC 1-107) Shashank Sharma
2017-07-04 14:11 ` [PATCH v5 04/17] drm: add helper to validate ycbcr420 modes Shashank Sharma
2017-07-04 15:56 ` Ville Syrjälä
2017-07-05 3:18 ` Sharma, Shashank
2017-07-05 10:16 ` Ville Syrjälä
2017-07-05 10:19 ` Sharma, Shashank
2017-07-05 11:45 ` Ville Syrjälä
2017-07-04 14:11 ` [PATCH v5 05/17] drm/edid: parse sink information before CEA blocks Shashank Sharma
2017-07-04 14:11 ` [PATCH v5 06/17] drm/edid: rename macro for CEA extended-tag Shashank Sharma
2017-07-04 14:11 ` [PATCH v5 07/17] drm/edid: parse YCBCR 420 videomodes from EDID Shashank Sharma
2017-07-04 14:11 ` [PATCH v5 08/17] drm/edid: parse ycbcr 420 deep color information Shashank Sharma
2017-07-04 14:11 ` [PATCH v5 09/17] drm: create hdmi output property Shashank Sharma
2017-07-04 15:36 ` Daniel Vetter
2017-07-05 6:09 ` Sharma, Shashank
2017-07-05 6:31 ` Daniel Vetter
2017-07-05 6:41 ` Sharma, Shashank
2017-07-04 14:11 ` Shashank Sharma [this message]
2017-07-04 14:11 ` [PATCH v5 11/17] drm: add helper functions for YCBCR output handling Shashank Sharma
2017-07-04 14:11 ` [PATCH v5 12/17] drm/i915: add compute-config for YCBCR outputs Shashank Sharma
2017-07-04 14:12 ` [PATCH v5 13/17] drm/i915: prepare scaler for YCBCR420 modeset Shashank Sharma
2017-07-04 14:12 ` [PATCH v5 14/17] drm/i915: prepare pipe for YCBCR output Shashank Sharma
2017-07-04 14:12 ` [PATCH v5 15/17] drm/i915: prepare csc unit for YCBCR HDMI output Shashank Sharma
2017-07-04 14:12 ` [PATCH v5 16/17] drm/i915: set colorspace for ycbcr outputs Shashank Sharma
2017-07-04 14:12 ` [PATCH v5 17/17] drm/i915/glk: set HDMI 2.0 identifier Shashank Sharma
2017-07-04 14:27 ` ✓ Fi.CI.BAT: success for HDMI YCBCR output 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=1499177524-26292-11-git-send-email-shashank.sharma@intel.com \
--to=shashank.sharma@intel.com \
--cc=Jose.Abreu@synopsys.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).