public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 3/5] drm/i915: Introduce HAS_NV12 and define WA 0870.
Date: Tue, 30 Oct 2018 20:16:47 +0200	[thread overview]
Message-ID: <20181030181647.GE9144@intel.com> (raw)
In-Reply-To: <20181029230044.12876-3-rodrigo.vivi@intel.com>

On Mon, Oct 29, 2018 at 04:00:42PM -0700, Rodrigo Vivi wrote:
> Let's introduce HAS_NV12 to check for feature itself
> than spread the platform checks everywhere.
> 
> Also let's introduce the WA number that is the
> cause of having NV12 disabled on both SLK and BXT.
> 
> According to Spec:
> 
> WA 0870: "Display flickers with NV12 video playback in
> Y tiling mode.
> WA: Use YUV422 surface format instead of NV12."
> 
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> ---
>  drivers/gpu/drm/i915/i915_drv.h          | 1 +
>  drivers/gpu/drm/i915/i915_pci.c          | 5 +++++
>  drivers/gpu/drm/i915/intel_device_info.h | 1 +
>  drivers/gpu/drm/i915/intel_display.c     | 7 +++----
>  drivers/gpu/drm/i915/intel_sprite.c      | 2 +-
>  5 files changed, 11 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index c9e5bab6861b..57ea094054d5 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -2630,6 +2630,7 @@ intel_info(const struct drm_i915_private *dev_priv)
>  #define HAS_RC6pp(dev_priv)		 (false) /* HW was never validated */
>  
>  #define HAS_CSR(dev_priv)	((dev_priv)->info.has_csr)
> +#define HAS_NV12(dev_priv)	((dev_priv)->info.has_nv12)
>  
>  #define HAS_RUNTIME_PM(dev_priv) ((dev_priv)->info.has_runtime_pm)
>  #define HAS_64BIT_RELOC(dev_priv) ((dev_priv)->info.has_64bit_reloc)
> diff --git a/drivers/gpu/drm/i915/i915_pci.c b/drivers/gpu/drm/i915/i915_pci.c
> index 44e745921ac1..eb797c1ef842 100644
> --- a/drivers/gpu/drm/i915/i915_pci.c
> +++ b/drivers/gpu/drm/i915/i915_pci.c
> @@ -462,6 +462,7 @@ static const struct intel_device_info intel_cherryview_info = {
>  	GEN(9), \
>  	GEN9_DEFAULT_PAGE_SIZES, \
>  	.has_logical_ring_preemption = 1, \
> +	.has_nv12 = 1, \
>  	.has_csr = 1, \
>  	.has_guc = 1, \
>  	.has_ipc = 1, \
> @@ -471,6 +472,8 @@ static const struct intel_device_info intel_cherryview_info = {
>  	GEN9_FEATURES, \
>  	/* Display WA #0477 WaDisableIPC: skl */ \
>  	.has_ipc = 0, \
> +	/* Display WA #0870: skl */ \
> +	.has_nv12 = 0, \
>  	PLATFORM(INTEL_SKYLAKE)
>  
>  static const struct intel_device_info intel_skylake_gt1_info = {
> @@ -531,6 +534,8 @@ static const struct intel_device_info intel_broxton_info = {
>  	GEN9_LP_FEATURES,
>  	PLATFORM(INTEL_BROXTON),
>  	.ddb_size = 512,
> +	/* Display WA #0870: bxt */
> +	.has_nv12 = 0,
>  };
>  
>  static const struct intel_device_info intel_geminilake_info = {
> diff --git a/drivers/gpu/drm/i915/intel_device_info.h b/drivers/gpu/drm/i915/intel_device_info.h
> index b4c2c4eae78b..ba9e9c59dc6c 100644
> --- a/drivers/gpu/drm/i915/intel_device_info.h
> +++ b/drivers/gpu/drm/i915/intel_device_info.h
> @@ -104,6 +104,7 @@ enum intel_ppgtt {
>  	func(has_logical_ring_contexts); \
>  	func(has_logical_ring_elsq); \
>  	func(has_logical_ring_preemption); \
> +	func(has_nv12); \
>  	func(has_overlay); \
>  	func(has_pooled_eu); \
>  	func(has_psr); \
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index dd88ffe9e273..14f6f66b00d2 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -470,7 +470,7 @@ skl_wa_528(struct drm_i915_private *dev_priv, int pipe, bool enable)
>  static void
>  skl_wa_clkgate(struct drm_i915_private *dev_priv, int pipe, bool enable)
>  {
> -	if (IS_SKYLAKE(dev_priv) || IS_BROXTON(dev_priv))
> +	if (!HAS_NV12(dev_priv))
>  		return;
>  
>  	if (enable)
> @@ -5239,7 +5239,7 @@ static bool needs_nv12_wa(struct drm_i915_private *dev_priv,
>  	if (!crtc_state->nv12_planes)
>  		return false;
>  
> -	if (IS_SKYLAKE(dev_priv) || IS_BROXTON(dev_priv))
> +	if (!HAS_NV12(dev_priv))
>  		return false;

The above three checks (you missed skl_wa_528()) can be removed entirely.
The code won't be reached unless at least one plane uses NV12.

>  
>  	/* WA Display #0827: Gen9:all */
> @@ -14519,8 +14519,7 @@ static int intel_framebuffer_init(struct intel_framebuffer *intel_fb,
>  		}
>  		break;
>  	case DRM_FORMAT_NV12:
> -		if (INTEL_GEN(dev_priv) < 9 || IS_SKYLAKE(dev_priv) ||
> -		    IS_BROXTON(dev_priv)) {
> +		if (!HAS_NV12(dev_priv)) {
>  			DRM_DEBUG_KMS("unsupported pixel format: %s\n",
>  				      drm_get_format_name(mode_cmd->pixel_format,
>  							  &format_name));

Undead code. The kill-a-zombie (tm) potion should kick in soon:
https://patchwork.freedesktop.org/patch/259041/

> diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
> index e7c95ec879cc..582a2972c90d 100644
> --- a/drivers/gpu/drm/i915/intel_sprite.c
> +++ b/drivers/gpu/drm/i915/intel_sprite.c
> @@ -1868,7 +1868,7 @@ static bool skl_plane_has_planar(struct drm_i915_private *dev_priv,
>  	if (INTEL_GEN(dev_priv) >= 11)
>  		return plane_id <= PLANE_SPRITE3;
>  
> -	if (IS_SKYLAKE(dev_priv) || IS_BROXTON(dev_priv))
> +	if (!HAS_NV12(dev_priv))
>  		return false;

So this is the only thing left in the end. Adding a device info flag
for this is overkill IMO. The w/a name we should add of course.

>  
>  	if (IS_GEN9(dev_priv) && !IS_GEMINILAKE(dev_priv) && pipe == PIPE_C)
> -- 
> 2.19.1

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

  reply	other threads:[~2018-10-30 18:16 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-29 23:00 [PATCH 1/5] drm/i915: Remove CNL from WA 827 Rodrigo Vivi
2018-10-29 23:00 ` [PATCH 2/5] drm/i915/cnl: Remove useless CNL A-stepping workarounds Rodrigo Vivi
2018-10-29 23:57   ` [PATCH] " Rodrigo Vivi
2018-10-29 23:00 ` [PATCH 3/5] drm/i915: Introduce HAS_NV12 and define WA 0870 Rodrigo Vivi
2018-10-30 18:16   ` Ville Syrjälä [this message]
2018-10-30 22:15     ` [PATCH] drm/i915: Define WA 0870 and kill dead code Rodrigo Vivi
2018-10-31 13:07       ` Ville Syrjälä
2018-10-29 23:00 ` [PATCH 4/5] drm/i915: Kill WA 0528 Rodrigo Vivi
2018-10-30 18:32   ` Ville Syrjälä
2018-10-29 23:00 ` [PATCH 5/5] drm/i915: Kill WA 0826 Rodrigo Vivi
2018-10-30  0:00   ` [PATCH] " Rodrigo Vivi
2018-10-30 18:38   ` [PATCH 5/5] " Ville Syrjälä
2018-10-29 23:36 ` [PATCH 1/5] drm/i915: Remove CNL from WA 827 Clint Taylor
2018-10-29 23:58 ` ✗ Fi.CI.SPARSE: warning for series starting with [1/5] " Patchwork
2018-10-30  0:16 ` ✓ Fi.CI.BAT: success " Patchwork
2018-10-30  1:00 ` ✗ Fi.CI.SPARSE: warning for series starting with [1/5] drm/i915: Remove CNL from WA 827 (rev3) Patchwork
2018-10-30  1:17 ` ✓ Fi.CI.BAT: success " Patchwork
2018-10-30  8:35 ` ✓ Fi.CI.IGT: " Patchwork
2018-10-30 22:54 ` ✗ Fi.CI.BAT: failure for series starting with [1/5] drm/i915: Remove CNL from WA 827 (rev4) 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=20181030181647.GE9144@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=rodrigo.vivi@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