All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ramalingam C <ramalingam.c@intel.com>
To: Shashank Sharma <shashank.sharma@intel.com>
Cc: Jani Nikula <jani.nikula@intel.com>,
	Daniel Vetter <daniel.vetter@intel.com>,
	intel-gfx@lists.freedesktop.org, Vivi@freedesktop.org
Subject: Re: [RFC 1/2] drm/i915: Indicate integer up-scaling ratios
Date: Wed, 4 Sep 2019 13:08:53 +0530	[thread overview]
Message-ID: <20190904073853.GA12577@intel.com> (raw)
In-Reply-To: <20190903165227.6056-2-shashank.sharma@intel.com>

On 2019-09-03 at 22:22:26 +0530, Shashank Sharma wrote:
> If the upscaling ratio is a complete integer, Intel display HW can
> pickup special scaling mode, which can produce better non-blurry
> outputs. This patch adds a check to indicate if this is such an upscaling
> opportunity, while calculating the scaler config, and stores it into scaler
> state.
> 
> Cc: Jani Nikula <jani.nikula@intel.com>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Cc: Daniel Vetter <daniel.vetter@intel.com>
> Cc: Vivi, Rodrigo <rodrigo.vivi@intel.com>
> Signed-off-by: Shashank Sharma <shashank.sharma@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_display.c  | 21 +++++++++++++++++++
>  .../drm/i915/display/intel_display_types.h    |  7 +++++++
>  2 files changed, 28 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index ee54d9659c99..613130db3c05 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -5388,6 +5388,19 @@ u16 skl_scaler_calc_phase(int sub, int scale, bool chroma_cosited)
>  #define SKL_MIN_YUV_420_SRC_W 16
>  #define SKL_MIN_YUV_420_SRC_H 16
>  
> +static inline bool
> +scaling_ratio_integer(int src_w, int dst_w, int src_h, int dst_h)
Just a suggestion: scaling_ratio_is_integer() might sound better here!?
> +{
> +	/* Integer mode scaling is applicable only for upscaling scenarios */
> +	if (dst_w < src_w || dst_h < src_h)
> +		return false;
> +
> +	if (dst_w % src_w == 0 && dst_h % src_h == 0)
> +		return true;
> +
> +	return false;
> +}
> +
>  static int
>  skl_update_scaler(struct intel_crtc_state *crtc_state, bool force_detach,
>  		  unsigned int scaler_user, int *scaler_id,
> @@ -5422,6 +5435,14 @@ skl_update_scaler(struct intel_crtc_state *crtc_state, bool force_detach,
>  		return -EINVAL;
>  	}
>  
> +	/*
> +	 * If we are upscaling, and the scaling ratios are integer, we can
> +	 * pick nearest-neighbour method in HW for scaling, which produces
> +	 * blurless outputs in such scenarios.
> +	 */
> +	if (scaling_ratio_integer(src_w, dst_w, src_h, dst_h))
> +		scaler_state->integer_scaling = true;
> +
>  	/*
>  	 * if plane is being disabled or scaler is no more required or force detach
>  	 *  - free scaler binded to this plane/crtc
> diff --git a/drivers/gpu/drm/i915/display/intel_display_types.h b/drivers/gpu/drm/i915/display/intel_display_types.h
> index 3c1a5f3e1d22..6bb32fbf3153 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_types.h
> +++ b/drivers/gpu/drm/i915/display/intel_display_types.h
> @@ -613,6 +613,13 @@ struct intel_crtc_scaler_state {
>  
>  	/* scaler used by crtc for panel fitting purpose */
>  	int scaler_id;
> +
> +	/*
> +	 * Nearest-neighbor method of upscaling gieves blurless output if
Typo: Gives.

-Ram
> +	 * the upscaling ratio is a complete integer. This bool is to indicate
> +	 * such an opportunity.
> +	 */
> +	bool integer_scaling;
>  };
>  
>  /* drm_mode->private_flags */
> -- 
> 2.17.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2019-09-04  7:39 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-03 16:52 [RFC 0/2] Enable Nearest-neighbor for Integer mode scaling Shashank Sharma
2019-09-03 16:52 ` [RFC 1/2] drm/i915: Indicate integer up-scaling ratios Shashank Sharma
2019-09-04  7:28   ` Jani Nikula
2019-09-04 10:37     ` Sharma, Shashank
2019-09-04  7:38   ` Ramalingam C [this message]
2019-09-04 10:38     ` Sharma, Shashank
2019-09-03 16:52 ` [RFC 2/2] drm/i915: Pick nearest-neighbor mode for integer scaling ratios Shashank Sharma
2019-09-04  7:54   ` Ramalingam C
2019-09-03 17:05 ` ✗ Fi.CI.CHECKPATCH: warning for Enable Nearest-neighbor for Integer mode scaling Patchwork
2019-09-03 17:20 ` [RFC 0/2] " Ville Syrjälä
2019-09-04  3:02   ` Sharma, Shashank
2019-09-04 12:26     ` Ville Syrjälä
2019-09-04 15:17       ` Sharma, Shashank
2019-09-03 17:21 ` ✗ Fi.CI.BAT: failure for " 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=20190904073853.GA12577@intel.com \
    --to=ramalingam.c@intel.com \
    --cc=Vivi@freedesktop.org \
    --cc=daniel.vetter@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    --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 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.