From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kenneth Graunke Subject: Re: [PATCH 6/6] [v4] drm/i915: Add support for CCS modifiers Date: Tue, 01 Aug 2017 15:43:50 -0700 Message-ID: <1530601.zh7oHHzDPt@kirito> References: <20170801165817.7063-1-ben@bwidawsk.net> <20170801165817.7063-6-ben@bwidawsk.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1012508978==" Return-path: In-Reply-To: <20170801165817.7063-6-ben@bwidawsk.net> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: intel-gfx@lists.freedesktop.org Cc: Ben Widawsky , Daniel Stone , DRI Development List-Id: intel-gfx@lists.freedesktop.org --===============1012508978== Content-Type: multipart/signed; boundary="nextPart2721788.6GxRjMOJGY"; micalg="pgp-sha256"; protocol="application/pgp-signature" --nextPart2721788.6GxRjMOJGY Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1" On Tuesday, August 1, 2017 9:58:17 AM PDT Ben Widawsky wrote: > v2: > - Support sprite plane. > - Support pipe C/D limitation on GEN9. >=20 > v3: > - Rename structure (Ville) > - Handle GLK (Ville) >=20 > v4: > - Fix PIPE_C check, introduced in v2 (Daniel) > - Whitespace fix (Daniel) >=20 > Cc: Daniel Stone > Cc: Kristian H=F8gsberg > Signed-off-by: Ben Widawsky > --- > drivers/gpu/drm/i915/intel_display.c | 30 +++++++++++++++++++++++++++--- > drivers/gpu/drm/i915/intel_sprite.c | 28 +++++++++++++++++++++++++++- > 2 files changed, 54 insertions(+), 4 deletions(-) >=20 > 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[] =3D { > DRM_FORMAT_VYUY, > }; > =20 > -static const uint64_t skl_format_modifiers[] =3D { > +static const uint64_t skl_format_modifiers_noccs[] =3D { > + 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[] =3D { > + 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, u= int64_t modifier) > case DRM_FORMAT_XBGR8888: > case DRM_FORMAT_ARGB8888: > case DRM_FORMAT_ABGR8888: > + if (modifier =3D=3D I915_FORMAT_MOD_Yf_TILED_CCS || > + modifier =3D=3D 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_priv= ate *dev_priv, enum pipe pipe) > primary->frontbuffer_bit =3D INTEL_FRONTBUFFER_PRIMARY(pipe); > primary->check_plane =3D intel_check_primary_plane; > =20 > - if (INTEL_GEN(dev_priv) >=3D 9) { > + if (INTEL_GEN(dev_priv) >=3D 10 || IS_GEMINILAKE(dev_priv)) { > + intel_primary_formats =3D skl_primary_formats; > + num_formats =3D ARRAY_SIZE(skl_primary_formats); > + modifiers =3D skl_format_modifiers_ccs; > + > + primary->update_plane =3D skylake_update_primary_plane; > + primary->disable_plane =3D skylake_disable_primary_plane; > + } else if (INTEL_GEN(dev_priv) >=3D 9) { > intel_primary_formats =3D skl_primary_formats; > num_formats =3D ARRAY_SIZE(skl_primary_formats); > - modifiers =3D skl_format_modifiers; > + if (pipe < PIPE_C) > + modifiers =3D skl_format_modifiers_ccs; > + else > + modifiers =3D skl_format_modifiers_noccs; > =20 > primary->update_plane =3D skylake_update_primary_plane; > primary->disable_plane =3D skylake_disable_primary_plane; > diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/i= ntel_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[] =3D { > DRM_FORMAT_VYUY, > }; > =20 > +static const uint64_t skl_plane_format_modifiers_noccs[] =3D { > + 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[] =3D { > + 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(s= truct drm_plane *plane, > case DRM_FORMAT_XBGR8888: > case DRM_FORMAT_ARGB8888: > case DRM_FORMAT_ABGR8888: > + if (modifier =3D=3D I915_FORMAT_MOD_Y_TILED_CCS || > + modifier =3D=3D 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 =3D &state->base; > =20 > - if (INTEL_GEN(dev_priv) >=3D 9) { > + if (INTEL_GEN(dev_priv) >=3D 10) { I think this should be INTEL_GEN(dev_priv) >=3D 10 || IS_GEMINILAKE(dev_pri= v). With that fixed, this patch would be: Reviewed-by: Kenneth Graunke for what it's worth (I'm not that familiar with display). > intel_plane->can_scale =3D true; > state->scaler_id =3D -1; > =20 > @@ -1240,6 +1253,19 @@ intel_sprite_plane_create(struct drm_i915_private = *dev_priv, > plane_formats =3D skl_plane_formats; > num_plane_formats =3D ARRAY_SIZE(skl_plane_formats); > modifiers =3D skl_plane_format_modifiers; > + } else if (INTEL_GEN(dev_priv) >=3D 9) { > + intel_plane->can_scale =3D true; > + state->scaler_id =3D -1; > + > + intel_plane->update_plane =3D skl_update_plane; > + intel_plane->disable_plane =3D skl_disable_plane; > + > + plane_formats =3D skl_plane_formats; > + num_plane_formats =3D ARRAY_SIZE(skl_plane_formats); > + if (pipe >=3D PIPE_C) > + modifiers =3D skl_plane_format_modifiers_noccs; > + else > + modifiers =3D skl_plane_format_modifiers; > } else if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) { > intel_plane->can_scale =3D false; > intel_plane->max_downscale =3D 1; --nextPart2721788.6GxRjMOJGY Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEE6OtbNAgc4e6ibv4ZW1vaBx1JzDgFAlmBBCYACgkQW1vaBx1J zDgtCQ//bJhgKEyffI6Fcol6NmydruBkPDxvLFL80gPE0SksQwmdxP3WGmQX4F0M 37pSsI7sU+q92Dho7m1xOD5VVUoBV11e3OYvzMISY2+ma1PQau5nrLnEfsz8IZsh 0ka3M5GWdeAHxSz8REf1YR7HbZvA3V3aquf3+KJn0u8NEL0HPX/Y2RkWUYxJ5YqJ WYrzi7/N7EpVD4S6mfIYSnPfVM7/tNVJAqKn6N7MaiG4a4LS/Msp1NAqslL2tr2d 47oy4PaDFHP2giajY9RRhmzSZdhPI6gPLm5U8sCzNau+IK+PEFPeieVDAHLFp/Wy PLVCWpGo1Mk8oDtqOaXRdWW9NtjHNuaUUpeo/S+kbA//SDg4wnXv4YprP1ZHpfip IiDSiqu09cSo4tQEGD2zT7TgywqfxUfgQjHPKI0djPY43gxfqIGctswxpKRqCZWh ig4f3be84bacF8f3svSQR9IebPASe+h3E+J5ou8rXl8f7iQnT3dVLP71PtAjRBgq zgivUx0vpXd8sNAJkNwVvLQOH4NBHjFycQwjvIloItKfdl2Be9XUu6ISFTvarCjV ugmL6utdUXQkK6zC29uNnig7jfj1rHmNJ3vu5Z+5SzoQq0gsLAmOdibRe/ua9YXl 0pe4e5MWh12ZNnvTTldID+ZXEIMVEbfQaV37/30CHC6N2ROt5W0= =D/r6 -----END PGP SIGNATURE----- --nextPart2721788.6GxRjMOJGY-- --===============1012508978== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KSW50ZWwtZ2Z4 IG1haWxpbmcgbGlzdApJbnRlbC1nZnhAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vaW50ZWwtZ2Z4Cg== --===============1012508978==--