From: Shashank Sharma <shashank.sharma@intel.com>
To: dri-devel@lists.freedesktop.org, intel-gfx@lists.freedesktop.org,
	ville.syrjala@linux.intel.com
Cc: Daniel Vetter <daniel.vetter@intel.com>,
	ander.conselvan.de.oliveira@intel.com
Subject: [PATCH v3 11/14] drm/i915: prepare pipe for YCBCR output
Date: Wed, 14 Jun 2017 23:17:42 +0530	[thread overview]
Message-ID: <1497462465-14066-12-git-send-email-shashank.sharma@intel.com> (raw)
In-Reply-To: <1497462465-14066-1-git-send-email-shashank.sharma@intel.com>
To get HDMI YCBCR420 output, the PIPEMISC register should be
programmed to:
- Generate YCBCR output (bit 11)
- In case of YCBCR420 outputs, it should be programmed in full
  blend mode to use the scaler in 5x3 ratio (bits 26 and 27)
This patch:
- Adds definition of these bits.
- Programs PIPEMISC for YCBCR outputs.
V2: rebase
V3: rebase
Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
Cc: Ander Conselvan De Oliveira <ander.conselvan.de.oliveira@intel.com>
Cc: Daniel Vetter <daniel.vetter@intel.com>
Signed-off-by: Shashank Sharma <shashank.sharma@intel.com>
---
 drivers/gpu/drm/i915/i915_reg.h      | 3 +++
 drivers/gpu/drm/i915/intel_display.c | 9 +++++++++
 2 files changed, 12 insertions(+)
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index 88e4707..77921ec 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -5196,6 +5196,9 @@ enum {
 
 #define _PIPE_MISC_A			0x70030
 #define _PIPE_MISC_B			0x71030
+#define   PIPEMISC_YCBCR420_ENABLE	(1<<27)
+#define   PIPEMISC_YCBCR420_MODE_BLEND	(1<<26)
+#define   PIPEMISC_OUTPUT_YCBCR		(1<<11)
 #define   PIPEMISC_DITHER_BPC_MASK	(7<<5)
 #define   PIPEMISC_DITHER_8_BPC		(0<<5)
 #define   PIPEMISC_DITHER_10_BPC	(1<<5)
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 983f581..71fd19e 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -8109,6 +8109,15 @@ static void haswell_set_pipemisc(struct drm_crtc *crtc)
 		if (intel_crtc->config->dither)
 			val |= PIPEMISC_DITHER_ENABLE | PIPEMISC_DITHER_TYPE_SP;
 
+		if (hdmi_out > DRM_HDMI_OUTPUT_DEFAULT_RGB) {
+			val |= PIPEMISC_OUTPUT_YCBCR;
+
+			if (hdmi_out == DRM_HDMI_OUTPUT_YCBCR420) {
+				val |= PIPEMISC_YCBCR420_ENABLE |
+				       PIPEMISC_YCBCR420_MODE_BLEND;
+			}
+		}
+
 		I915_WRITE(PIPEMISC(intel_crtc->pipe), val);
 	}
 }
-- 
2.7.4
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply	other threads:[~2017-06-14 17:47 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-14 17:47 [PATCH v3 00/14] HDMI YCBCR output handling in DRM layer Shashank Sharma
2017-06-14 17:47 ` [PATCH v3 01/14] drm: add HDMI 2.0 VIC support for AVI info-frames Shashank Sharma
2017-06-14 20:20   ` Thierry Reding
2017-06-15  4:11     ` Sharma, Shashank
2017-06-14 17:47 ` [PATCH v3 02/14] drm/edid: Complete CEA modedb(VIC 1-107) Shashank Sharma
2017-06-15 13:29   ` Ville Syrjälä
2017-06-15 13:31     ` Sharma, Shashank
2017-06-15 14:51       ` Ville Syrjälä
2017-06-14 17:47 ` [PATCH v3 03/14] drm: add hdmi 2.0 source identifier Shashank Sharma
2017-06-14 17:47 ` [PATCH v3 04/14] drm/edid: parse YCBCR 420 videomodes from EDID Shashank Sharma
2017-06-15 14:43   ` Ville Syrjälä
2017-06-15 15:35     ` Sharma, Shashank
2017-06-15 16:12       ` Ville Syrjälä
2017-06-15 16:48         ` Sharma, Shashank
2017-06-15 16:59           ` Ville Syrjälä
2017-06-15 17:02             ` Sharma, Shashank
2017-06-16 18:55   ` kbuild test robot
2017-06-14 17:47 ` [PATCH v3 05/14] drm: parse ycbcr 420 deep color information Shashank Sharma
2017-06-14 17:47 ` [PATCH v3 06/14] drm: create hdmi output property Shashank Sharma
2017-06-14 17:47 ` [PATCH v3 07/14] drm: set output colorspace in AVI infoframe Shashank Sharma
2017-06-14 17:47 ` [PATCH v3 08/14] drm: add helper functions for YCBCR output handling Shashank Sharma
2017-06-14 17:47 ` [PATCH v3 09/14] drm/i915: add compute_config for YCBCR outputs Shashank Sharma
2017-06-16 21:15   ` kbuild test robot
2017-06-14 17:47 ` [PATCH v3 10/14] drm/i915: prepare scaler for YCBCR420 modeset Shashank Sharma
2017-06-14 17:47 ` Shashank Sharma [this message]
2017-06-14 17:47 ` [PATCH v3 12/14] drm/i915: prepare csc unit for YCBCR HDMI output Shashank Sharma
2017-06-14 17:47 ` [PATCH v3 13/14] drm/i915: set colorspace for ycbcr outputs Shashank Sharma
2017-06-14 17:47 ` [PATCH v3 14/14] drm/i915/glk: set HDMI 2.0 identifier Shashank Sharma
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=1497462465-14066-12-git-send-email-shashank.sharma@intel.com \
    --to=shashank.sharma@intel.com \
    --cc=ander.conselvan.de.oliveira@intel.com \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=ville.syrjala@linux.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;
as well as URLs for NNTP newsgroup(s).