From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Shashank Sharma <shashank.sharma@intel.com>
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v2 10/14] drm/i915: prepare scaler for YCBCR420 modeset
Date: Fri, 14 Jul 2017 21:30:47 +0300 [thread overview]
Message-ID: <20170714183047.GO12629@intel.com> (raw)
In-Reply-To: <1499960000-9232-11-git-send-email-shashank.sharma@intel.com>
On Thu, Jul 13, 2017 at 09:03:16PM +0530, Shashank Sharma wrote:
> To get a YCBCR420 output from intel platforms, we need one
> scaler to scale down YCBCR444 samples to YCBCR420 samples.
>
> This patch:
> - Does scaler allocation for HDMI ycbcr420 outputs.
> - Programs PIPE_MISC register for ycbcr420 output.
> - Adds a new scaler user "HDMI output" to plug-into existing
> scaler framework. This output type is identified using bit
> 30 of the scaler users bitmap.
>
> V2: rebase
> V3: rebase
> V4: rebase
> V5: addressed review comments from Ander:
> - No need to check both scaler_user && hdmi_output.
> Check for scaler_user is enough.
> V6: rebase
> V7: Do not create a new scaler user, use existing pipe scaler user.
>
> Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
> Cc: Ander Conselvan De Oliveira <conselvan2@gmail.com>
>
> Signed-off-by: Shashank Sharma <shashank.sharma@intel.com>
> ---
> drivers/gpu/drm/i915/intel_display.c | 3 +++
> drivers/gpu/drm/i915/intel_drv.h | 4 +++-
> drivers/gpu/drm/i915/intel_hdmi.c | 12 ++++++++++++
> drivers/gpu/drm/i915/intel_panel.c | 3 ++-
> 4 files changed, 20 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index a5140e4..d78f1c2 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -4624,6 +4624,9 @@ skl_update_scaler(struct intel_crtc_state *crtc_state, bool force_detach,
> */
> need_scaling = src_w != dst_w || src_h != dst_h;
>
> + if (crtc_state->ycbcr420 && scaler_user == SKL_CRTC_INDEX)
> + need_scaling = true;
> +
> /*
> * Scaling/fitting not supported in IF-ID mode in GEN9+
> * TODO: Interlace fetch mode doesn't support YUV420 planar formats.
> diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> index 592243b..94ea6ed 100644
> --- a/drivers/gpu/drm/i915/intel_drv.h
> +++ b/drivers/gpu/drm/i915/intel_drv.h
> @@ -471,7 +471,8 @@ struct intel_crtc_scaler_state {
> *
> * If a bit is set, a user is using a scaler.
> * Here user can be a plane or crtc as defined below:
> - * bits 0-30 - plane (bit position is index from drm_plane_index)
> + * bits 0-29 - plane (bit position is index from drm_plane_index)
> + * bit 30 - hdmi output
That's no longer true.
> * bit 31 - crtc
> *
> * Instead of creating a new index to cover planes and crtc, using
> @@ -484,6 +485,7 @@ struct intel_crtc_scaler_state {
> * avilability.
> */
> #define SKL_CRTC_INDEX 31
> +
Bogus whitespace change.
> unsigned scaler_users;
>
> /* scaler used by crtc for panel fitting purpose */
> diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
> index eb6243c..49f4fb8 100644
> --- a/drivers/gpu/drm/i915/intel_hdmi.c
> +++ b/drivers/gpu/drm/i915/intel_hdmi.c
> @@ -1356,6 +1356,7 @@ intel_hdmi_ycbcr420_config(struct drm_connector *connector,
> struct intel_crtc_state *config,
> int *clock_12bpc, int *clock_8bpc)
> {
> + struct intel_crtc *intel_crtc = to_intel_crtc(config->base.crtc);
>
> if (!connector->ycbcr_420_allowed) {
> DRM_ERROR("Platform doesn't support YCBCR420 output\n");
> @@ -1367,6 +1368,17 @@ intel_hdmi_ycbcr420_config(struct drm_connector *connector,
> *clock_12bpc /= 2;
> *clock_8bpc /= 2;
> config->ycbcr420 = true;
> +
> + /* YCBCR 420 output conversion needs a scaler */
> + if (skl_update_scaler_crtc(config)) {
> + DRM_ERROR("Scaler allocation for output failed\n");
DRM_DEBUG_KMS
> + return false;
> + }
> +
> + /* Bind this scaler to pipe */
Unnecesary comment.
> + intel_pch_panel_fitting(intel_crtc, config,
> + DRM_MODE_SCALE_FULLSCREEN);
> +
> return true;
> }
>
> diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c
> index 96c2cbd..fd2e081 100644
> --- a/drivers/gpu/drm/i915/intel_panel.c
> +++ b/drivers/gpu/drm/i915/intel_panel.c
> @@ -110,7 +110,8 @@ intel_pch_panel_fitting(struct intel_crtc *intel_crtc,
>
> /* Native modes don't need fitting */
> if (adjusted_mode->crtc_hdisplay == pipe_config->pipe_src_w &&
> - adjusted_mode->crtc_vdisplay == pipe_config->pipe_src_h)
> + adjusted_mode->crtc_vdisplay == pipe_config->pipe_src_h &&
> + !pipe_config->ycbcr420)
> goto done;
>
> switch (fitting_mode) {
> --
> 2.7.4
--
Ville Syrjälä
Intel OTC
_______________________________________________
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-14 18:30 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-13 15:33 [PATCH v2 00/14] YCBCR 4:2:0 handling in DRM layer Shashank Sharma
2017-07-13 15:33 ` [PATCH v2 01/14] drm: handle HDMI 2.0 VICs in AVI info-frames Shashank Sharma
2017-07-13 15:33 ` [PATCH v2 02/14] drm/edid: complete CEA modedb(VIC 1-107) Shashank Sharma
2017-07-13 15:33 ` [PATCH v2 03/14] drm/edid: parse sink information before CEA blocks Shashank Sharma
2017-07-13 15:33 ` [PATCH v2 04/14] drm/edid: cleanup patch for CEA extended-tag macro Shashank Sharma
2017-07-13 15:33 ` [PATCH v2 05/14] drm: add helper to validate YCBCR420 modes Shashank Sharma
2017-07-13 15:33 ` [PATCH v2 06/14] drm/edid: parse YCBCR420 videomodes from EDID Shashank Sharma
2017-07-13 16:21 ` Ville Syrjälä
2017-07-14 4:04 ` Sharma, Shashank
2017-07-14 10:33 ` [PATCH v8 " Shashank Sharma
2017-07-13 15:33 ` [PATCH v2 07/14] drm/edid: parse ycbcr 420 deep color information Shashank Sharma
2017-07-13 15:33 ` [PATCH v2 08/14] drm: add helper functions for YCBCR420 handling Shashank Sharma
2017-07-13 15:33 ` [PATCH v2 09/14] drm/i915: add config function for YCBCR420 outputs Shashank Sharma
2017-07-14 18:30 ` Ville Syrjälä
2017-07-15 4:40 ` Sharma, Shashank
2017-07-13 15:33 ` [PATCH v2 10/14] drm/i915: prepare scaler for YCBCR420 modeset Shashank Sharma
2017-07-14 18:30 ` Ville Syrjälä [this message]
2017-07-15 4:41 ` Sharma, Shashank
2017-07-13 15:33 ` [PATCH v2 11/14] drm/i915: prepare pipe for YCBCR420 output Shashank Sharma
2017-07-14 18:33 ` Ville Syrjälä
2017-07-15 4:45 ` Sharma, Shashank
2017-07-13 15:33 ` [PATCH v2 12/14] drm/i915: prepare csc unit " Shashank Sharma
2017-07-14 18:36 ` Ville Syrjälä
2017-07-15 4:46 ` Sharma, Shashank
2017-07-13 15:33 ` [PATCH v2 13/14] drm/i915: set colorspace for YCBCR420 outputs Shashank Sharma
2017-07-13 15:33 ` [PATCH v2 14/14] drm/i915/glk: set HDMI 2.0 identifier Shashank Sharma
2017-07-13 15:50 ` ✓ Fi.CI.BAT: success for YCBCR 4:2:0 handling in DRM layer (rev2) Patchwork
2017-07-14 10:57 ` ✓ Fi.CI.BAT: success for YCBCR 4:2:0 handling in DRM layer (rev3) Patchwork
2017-07-14 19:02 ` [PATCH v2 00/14] YCBCR 4:2:0 handling in DRM layer Ville Syrjälä
2017-07-15 5:03 ` Sharma, Shashank
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=20170714183047.GO12629@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=shashank.sharma@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