Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Sharma, Shashank" <shashank.sharma@intel.com>
To: imre.deak@intel.com
Cc: Daniel Vetter <daniel.vetter@intel.com>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v5 3/6] drm/i915: prepare pipe for YCBCR420 output
Date: Sat, 22 Jul 2017 10:05:23 +0530	[thread overview]
Message-ID: <13a3924a-7d33-7f9e-1f2b-163074a00c28@intel.com> (raw)
In-Reply-To: <20170721190424.uah452nbto74zagk@ideak-desk.fi.intel.com>

Regards

Shashank


On 7/22/2017 12:34 AM, Imre Deak wrote:
> On Fri, Jul 21, 2017 at 08:55:06PM +0530, Shashank Sharma wrote:
>> 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 YCBCR420 outputs.
>> - Adds readouts to compare HW and SW states.
>>
>> V2: rebase
>> V3: rebase
>> V4: rebase
>> V5: added r-b from Ander
>> V6: Handle only YCBCR420 outputs (ville)
>> V7: rebase
>> V8: Addressed review comments from Ville
>>      - Add readouts for state->ycbcr420 and 420 pixel_clock.
>>      - Handle warning due to mismatch in clock for ycbcr420 clock.
>>      - Rename PIPEMISC macros to match the Bspec.
>>      - Add a debug print stating if YCBCR 4:2:0 output enabled.
>>      Added r-b from Ville
>> V9: Addressed review comments from Imre:
>>      - Add 420 mode clock adjustment in intel_hdmi_mode_valid to
>>        prevent 420_only modes getting rejected for high clock.
>>      - Add port clock adjustment for ycbcr420 modes in ddi_get_clock
>>      - Rename macros as per Ville's suggestion.
>>      - Remove unnecessary wl changes.
>> V10: Added r-b from Imre
>>
>> Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
>> Cc: Ander Conselvan de Oliveira <conselvan2@gmail.com>
>> Cc: Daniel Vetter <daniel.vetter@intel.com>
>> Cc: Imre Deak <imre.deak@intel.com>
>>
>> Reviewed-by: Ander Conselvan de Oliveira <conselvan2@gmail.com>
>> Reviewed-by: Ville Syrjala <ville.syrjala@linux.intel.com>
>> Reviewed-by: Imre Deak <imre.deak@intel.com>
>> Signed-off-by: Shashank Sharma <shashank.sharma@intel.com>
>> ---
>>   drivers/gpu/drm/i915/i915_reg.h      |  3 +++
>>   drivers/gpu/drm/i915/intel_ddi.c     |  3 +++
>>   drivers/gpu/drm/i915/intel_display.c | 14 ++++++++++++++
>>   drivers/gpu/drm/i915/intel_hdmi.c    |  3 +++
>>   4 files changed, 23 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
>> index c712d01..e5b4e2f 100644
>> --- a/drivers/gpu/drm/i915/i915_reg.h
>> +++ b/drivers/gpu/drm/i915/i915_reg.h
>> @@ -5227,6 +5227,9 @@ enum {
>>   
>>   #define _PIPE_MISC_A			0x70030
>>   #define _PIPE_MISC_B			0x71030
>> +#define   PIPEMISC_YUV420_ENABLE	(1<<27)
>> +#define   PIPEMISC_YUV420_MODE_FULL_BLEND (1<<26)
>> +#define   PIPEMISC_OUTPUT_COLORSPACE_YUV  (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_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
>> index efb1358..d88731b 100644
>> --- a/drivers/gpu/drm/i915/intel_ddi.c
>> +++ b/drivers/gpu/drm/i915/intel_ddi.c
>> @@ -1174,6 +1174,9 @@ static void ddi_dotclock_get(struct intel_crtc_state *pipe_config)
>>   	else
>>   		dotclock = pipe_config->port_clock;
>>   
>> +	if (pipe_config->ycbcr420)
>> +		dotclock = pipe_config->port_clock / 2;
> I see, it's Friday afternoon, so who cares about some statecheck WARNs
> in dmesg?;) It's '* 2'. Moreover it'd be incorrect for YUV420 12bpc, so
> just
>
> dotclock *= 2;
Embarrassing, let me too blame it to Friday evening ;-),  but I 
seriously looked for warnings in dmesg.
Let me check it on Monday, why dint I get it in dmesg and come back !
>> +
>>   	if (pipe_config->pixel_multiplier)
>>   		dotclock /= pipe_config->pixel_multiplier;
>>   
>> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
>> index 05ba0e9..6473ecf 100644
>> --- a/drivers/gpu/drm/i915/intel_display.c
>> +++ b/drivers/gpu/drm/i915/intel_display.c
>> @@ -8034,6 +8034,7 @@ static void haswell_set_pipemisc(struct drm_crtc *crtc)
>>   {
>>   	struct drm_i915_private *dev_priv = to_i915(crtc->dev);
>>   	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
>> +	struct intel_crtc_state *config = intel_crtc->config;
>>   
>>   	if (IS_BROADWELL(dev_priv) || INTEL_INFO(dev_priv)->gen >= 9) {
>>   		u32 val = 0;
>> @@ -8059,6 +8060,12 @@ static void haswell_set_pipemisc(struct drm_crtc *crtc)
>>   		if (intel_crtc->config->dither)
>>   			val |= PIPEMISC_DITHER_ENABLE | PIPEMISC_DITHER_TYPE_SP;
>>   
>> +		if (config->ycbcr420) {
>> +			val |= PIPEMISC_OUTPUT_COLORSPACE_YUV |
>> +				PIPEMISC_YUV420_ENABLE |
>> +				PIPEMISC_YUV420_MODE_FULL_BLEND;
>> +		}
>> +
>>   		I915_WRITE(PIPEMISC(intel_crtc->pipe), val);
>>   	}
>>   }
>> @@ -9128,6 +9135,10 @@ static bool haswell_get_pipe_config(struct intel_crtc *crtc,
>>   		pipe_config->scaler_state.scaler_users &= ~(1 << SKL_CRTC_INDEX);
>>   	}
>>   
>> +	if (IS_GEMINILAKE(dev_priv))
>> +		pipe_config->ycbcr420 = I915_READ(PIPEMISC(crtc->pipe)) &
>> +					PIPEMISC_YUV420_ENABLE;
> You missed my last comments about this part (it was a separate email
> from the rest of my comments).
Yes, sorry about that, will get it done !
- Shashank
>
>> +
>>   	power_domain = POWER_DOMAIN_PIPE_PANEL_FITTER(crtc->pipe);
>>   	if (intel_display_power_get_if_enabled(dev_priv, power_domain)) {
>>   		power_domain_mask |= BIT_ULL(power_domain);
>> @@ -10731,6 +10742,9 @@ static void intel_dump_pipe_config(struct intel_crtc *crtc,
>>   				      pipe_config->fdi_lanes,
>>   				      &pipe_config->fdi_m_n);
>>   
>> +	if (pipe_config->ycbcr420)
>> +		DRM_DEBUG_KMS("YCbCr 4:2:0 output enabled\n");
>> +
>>   	if (intel_crtc_has_dp_encoder(pipe_config)) {
>>   		intel_dump_m_n_config(pipe_config, "dp m_n",
>>   				pipe_config->lane_count, &pipe_config->dp_m_n);
>> diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
>> index 6addef5..da9d1d3 100644
>> --- a/drivers/gpu/drm/i915/intel_hdmi.c
>> +++ b/drivers/gpu/drm/i915/intel_hdmi.c
>> @@ -1295,6 +1295,9 @@ intel_hdmi_mode_valid(struct drm_connector *connector,
>>   	if (mode->flags & DRM_MODE_FLAG_DBLCLK)
>>   		clock *= 2;
>>   
>> +	if (drm_mode_is_420_only(&connector->display_info, mode))
>> +		clock /= 2;
>> +
>>   	/* check if we can do 8bpc */
>>   	status = hdmi_port_clock_valid(hdmi, clock, true, force_dvi);
>>   
>> -- 
>> 2.7.4
>>

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

  reply	other threads:[~2017-07-22  4:35 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-21 15:25 [PATCH v5 0/6] YCBCR 4:2:0 handling in i915 layer Shashank Sharma
2017-07-21 15:25 ` [PATCH v5 1/6] drm/i915: add config function for YCBCR420 outputs Shashank Sharma
2017-07-21 15:25 ` [PATCH v5 2/6] drm/i915: prepare scaler for YCBCR420 modeset Shashank Sharma
2017-07-21 15:25 ` [PATCH v5 3/6] drm/i915: prepare pipe for YCBCR420 output Shashank Sharma
2017-07-21 19:04   ` Imre Deak
2017-07-22  4:35     ` Sharma, Shashank [this message]
2017-07-24  9:34     ` [PATCH v6 " Shashank Sharma
2017-07-24 12:07       ` Imre Deak
2017-07-24 13:49         ` [PATCH v7 " Shashank Sharma
2017-07-21 15:25 ` [PATCH v5 4/6] drm/i915: prepare csc unit " Shashank Sharma
2017-07-21 15:25 ` [PATCH v5 5/6] drm/i915: set colorspace for YCBCR420 outputs Shashank Sharma
2017-07-21 15:25 ` [PATCH v5 6/6] drm/i915/glk: set HDMI 2.0 identifier Shashank Sharma
2017-07-21 16:40 ` ✓ Fi.CI.BAT: success for YCBCR 4:2:0 handling in i915 layer (rev2) Patchwork
2017-07-24  9:52 ` ✓ Fi.CI.BAT: success for YCBCR 4:2:0 handling in i915 layer (rev3) Patchwork
2017-07-24 14:03 ` ✓ Fi.CI.BAT: success for YCBCR 4:2:0 handling in i915 layer (rev4) Patchwork
2017-07-24 15:02   ` Imre Deak
2017-07-24 16:20     ` Imre Deak

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=13a3924a-7d33-7f9e-1f2b-163074a00c28@intel.com \
    --to=shashank.sharma@intel.com \
    --cc=daniel.vetter@intel.com \
    --cc=imre.deak@intel.com \
    --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