public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Kenneth Graunke <kenneth@whitecape.org>
To: intel-gfx@lists.freedesktop.org
Cc: Ben Widawsky <ben@bwidawsk.net>,
	Daniel Stone <daniels@collabora.com>,
	DRI Development <dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH 6/6] [v4] drm/i915: Add support for CCS modifiers
Date: Tue, 01 Aug 2017 15:52:38 -0700	[thread overview]
Message-ID: <10882811.hqQZZsOt1U@kirito> (raw)
In-Reply-To: <20170801224753.GA2441@mail.bwidawsk.net>


[-- Attachment #1.1: Type: text/plain, Size: 7439 bytes --]

On Tuesday, August 1, 2017 3:47:53 PM PDT Ben Widawsky wrote:
> On 17-08-01 15:43:50, Kenneth Graunke wrote:
> >On Tuesday, August 1, 2017 9:58:17 AM PDT Ben Widawsky wrote:
> >> v2:
> >>   - Support sprite plane.
> >>   - Support pipe C/D limitation on GEN9.
> >>
> >> v3:
> >>   - Rename structure (Ville)
> >>   - Handle GLK (Ville)
> >>
> >> v4:
> >>   - Fix PIPE_C check, introduced in v2 (Daniel)
> >>   - Whitespace fix (Daniel)
> >>
> >> Cc: Daniel Stone <daniels@collabora.com>
> >> Cc: Kristian Høgsberg <krh@bitplanet.net>
> >> Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
> >> ---
> >>  drivers/gpu/drm/i915/intel_display.c | 30 +++++++++++++++++++++++++++---
> >>  drivers/gpu/drm/i915/intel_sprite.c  | 28 +++++++++++++++++++++++++++-
> >>  2 files changed, 54 insertions(+), 4 deletions(-)
> >>
> >> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> >> index ad49b99ef25f..0dc9f40edc7e 100644
> >> --- a/drivers/gpu/drm/i915/intel_display.c
> >> +++ b/drivers/gpu/drm/i915/intel_display.c
> >> @@ -93,7 +93,17 @@ static const uint32_t skl_primary_formats[] = {
> >>  	DRM_FORMAT_VYUY,
> >>  };
> >>
> >> -static const uint64_t skl_format_modifiers[] = {
> >> +static const uint64_t skl_format_modifiers_noccs[] = {
> >> +	I915_FORMAT_MOD_Yf_TILED,
> >> +	I915_FORMAT_MOD_Y_TILED,
> >> +	I915_FORMAT_MOD_X_TILED,
> >> +	DRM_FORMAT_MOD_LINEAR,
> >> +	DRM_FORMAT_MOD_INVALID
> >> +};
> >> +
> >> +static const uint64_t skl_format_modifiers_ccs[] = {
> >> +	I915_FORMAT_MOD_Yf_TILED_CCS,
> >> +	I915_FORMAT_MOD_Y_TILED_CCS,
> >>  	I915_FORMAT_MOD_Yf_TILED,
> >>  	I915_FORMAT_MOD_Y_TILED,
> >>  	I915_FORMAT_MOD_X_TILED,
> >> @@ -13853,6 +13863,10 @@ static bool skl_mod_supported(uint32_t format, uint64_t modifier)
> >>  	case DRM_FORMAT_XBGR8888:
> >>  	case DRM_FORMAT_ARGB8888:
> >>  	case DRM_FORMAT_ABGR8888:
> >> +		if (modifier == I915_FORMAT_MOD_Yf_TILED_CCS ||
> >> +		    modifier == I915_FORMAT_MOD_Y_TILED_CCS)
> >> +			return true;
> >> +		/* fall through */
> >>  	case DRM_FORMAT_RGB565:
> >>  	case DRM_FORMAT_XRGB2101010:
> >>  	case DRM_FORMAT_XBGR2101010:
> >> @@ -14099,10 +14113,20 @@ intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)
> >>  	primary->frontbuffer_bit = INTEL_FRONTBUFFER_PRIMARY(pipe);
> >>  	primary->check_plane = intel_check_primary_plane;
> >>
> >> -	if (INTEL_GEN(dev_priv) >= 9) {
> >> +	if (INTEL_GEN(dev_priv) >= 10 || IS_GEMINILAKE(dev_priv)) {
> >> +		intel_primary_formats = skl_primary_formats;
> >> +		num_formats = ARRAY_SIZE(skl_primary_formats);
> >> +		modifiers = skl_format_modifiers_ccs;
> >> +
> >> +		primary->update_plane = skylake_update_primary_plane;
> >> +		primary->disable_plane = skylake_disable_primary_plane;
> >> +	} else if (INTEL_GEN(dev_priv) >= 9) {
> >>  		intel_primary_formats = skl_primary_formats;
> >>  		num_formats = ARRAY_SIZE(skl_primary_formats);
> >> -		modifiers = skl_format_modifiers;
> >> +		if (pipe < PIPE_C)
> >> +			modifiers = skl_format_modifiers_ccs;
> >> +		else
> >> +			modifiers = skl_format_modifiers_noccs;
> >>
> >>  		primary->update_plane = skylake_update_primary_plane;
> >>  		primary->disable_plane = skylake_disable_primary_plane;
> >> diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
> >> index b1cc4835b963..5a2b3f3693a6 100644
> >> --- a/drivers/gpu/drm/i915/intel_sprite.c
> >> +++ b/drivers/gpu/drm/i915/intel_sprite.c
> >> @@ -1085,7 +1085,17 @@ static uint32_t skl_plane_formats[] = {
> >>  	DRM_FORMAT_VYUY,
> >>  };
> >>
> >> +static const uint64_t skl_plane_format_modifiers_noccs[] = {
> >> +	I915_FORMAT_MOD_Yf_TILED,
> >> +	I915_FORMAT_MOD_Y_TILED,
> >> +	I915_FORMAT_MOD_X_TILED,
> >> +	DRM_FORMAT_MOD_LINEAR,
> >> +	DRM_FORMAT_MOD_INVALID
> >> +};
> >> +
> >>  static const uint64_t skl_plane_format_modifiers[] = {
> >> +	I915_FORMAT_MOD_Yf_TILED_CCS,
> >> +	I915_FORMAT_MOD_Y_TILED_CCS,
> >>  	I915_FORMAT_MOD_Yf_TILED,
> >>  	I915_FORMAT_MOD_Y_TILED,
> >>  	I915_FORMAT_MOD_X_TILED,
> >> @@ -1148,6 +1158,9 @@ static bool skl_sprite_plane_format_mod_supported(struct drm_plane *plane,
> >>  	case DRM_FORMAT_XBGR8888:
> >>  	case DRM_FORMAT_ARGB8888:
> >>  	case DRM_FORMAT_ABGR8888:
> >> +		if (modifier == I915_FORMAT_MOD_Y_TILED_CCS ||
> >> +		    modifier == I915_FORMAT_MOD_Yf_TILED_CCS)
> >> +			return true;
> >>  	case DRM_FORMAT_RGB565:
> >>  	case DRM_FORMAT_XRGB2101010:
> >>  	case DRM_FORMAT_XBGR2101010:
> >> @@ -1230,7 +1243,7 @@ intel_sprite_plane_create(struct drm_i915_private *dev_priv,
> >>  	}
> >>  	intel_plane->base.state = &state->base;
> >>
> >> -	if (INTEL_GEN(dev_priv) >= 9) {
> >> +	if (INTEL_GEN(dev_priv) >= 10) {
> >
> >I think this should be INTEL_GEN(dev_priv) >= 10 || IS_GEMINILAKE(dev_priv).
> >
> >With that fixed, this patch would be:
> >Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
> >
> >for what it's worth (I'm not that familiar with display).
> >
> 
> Thanks. Here is what I've changed locally which didn't match the primary
> support:
> 
> diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
> index 5a2b3f3693a6..1c484195fd0f 100644
> --- a/drivers/gpu/drm/i915/intel_sprite.c
> +++ b/drivers/gpu/drm/i915/intel_sprite.c
> @@ -1093,7 +1093,7 @@ static const uint64_t skl_plane_format_modifiers_noccs[] = {
>         DRM_FORMAT_MOD_INVALID
>  };
>  
> -static const uint64_t skl_plane_format_modifiers[] = {
> +static const uint64_t skl_plane_format_modifiers_ccs[] = {
>         I915_FORMAT_MOD_Yf_TILED_CCS,
>         I915_FORMAT_MOD_Y_TILED_CCS,
>         I915_FORMAT_MOD_Yf_TILED,
> @@ -1243,7 +1243,7 @@ intel_sprite_plane_create(struct drm_i915_private *dev_priv,
>         }
>         intel_plane->base.state = &state->base;
>  
> -       if (INTEL_GEN(dev_priv) >= 10) {
> +       if (INTEL_GEN(dev_priv) >= 10 || IS_GEMINILAKE(dev_priv)) {
>                 intel_plane->can_scale = true;
>                 state->scaler_id = -1;
>  
> @@ -1252,7 +1252,7 @@ intel_sprite_plane_create(struct drm_i915_private *dev_priv,
>  
>                 plane_formats = skl_plane_formats;
>                 num_plane_formats = ARRAY_SIZE(skl_plane_formats);
> -               modifiers = skl_plane_format_modifiers;
> +               modifiers = skl_plane_format_modifiers_ccs;
>         } else if (INTEL_GEN(dev_priv) >= 9) {
>                 intel_plane->can_scale = true;
>                 state->scaler_id = -1;
> @@ -1262,10 +1262,10 @@ intel_sprite_plane_create(struct drm_i915_private *dev_priv,
>  
>                 plane_formats = skl_plane_formats;
>                 num_plane_formats = ARRAY_SIZE(skl_plane_formats);
> -               if (pipe >= PIPE_C)
> -                       modifiers = skl_plane_format_modifiers_noccs;
> +               if (pipe < PIPE_C)
> +                       modifiers = skl_plane_format_modifiers_ccs;
>                 else
> -                       modifiers = skl_plane_format_modifiers;
> +                       modifiers = skl_plane_format_modifiers_noccs;
>         } else if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) {
>                 intel_plane->can_scale = false;

That looks good, with that squashed in,
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>

[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

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

  reply	other threads:[~2017-08-01 22:52 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-01 16:58 [PATCH 1/6] drm/i915: Implement .get_format_info() hook for CCS Ben Widawsky
2017-08-01 16:58 ` [PATCH 2/6] drm/i915: Add render decompression support Ben Widawsky
2017-08-01 16:58 ` [PATCH 3/6] [v7] drm: Plumb modifiers through plane init Ben Widawsky
2017-08-01 16:58 ` [PATCH 4/6] [v5] drm: Create a format/modifier blob Ben Widawsky
2017-08-01 16:58 ` [PATCH 5/6] [v10] drm/i915: Add format modifiers for Intel Ben Widawsky
2017-08-01 16:58 ` [PATCH 6/6] [v4] drm/i915: Add support for CCS modifiers Ben Widawsky
2017-08-01 22:43   ` Kenneth Graunke
2017-08-01 22:47     ` [Intel-gfx] " Ben Widawsky
2017-08-01 22:52       ` Kenneth Graunke [this message]
2017-08-03 11:00   ` Daniel Stone
2017-08-03 17:21     ` Ben Widawsky
2017-08-04  9:27       ` Daniel Stone
2017-08-08 16:24     ` Daniel Stone
2017-08-01 17:31 ` ✓ Fi.CI.BAT: success for series starting with [1/6] drm/i915: Implement .get_format_info() hook for CCS Patchwork
2017-08-02 21:28 ` [PATCH 1/6] " Jason Ekstrand

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=10882811.hqQZZsOt1U@kirito \
    --to=kenneth@whitecape.org \
    --cc=ben@bwidawsk.net \
    --cc=daniels@collabora.com \
    --cc=dri-devel@lists.freedesktop.org \
    --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