|
@@ -1161,7 +1161,17 @@ static uint32_t skl_plane_formats[] = {
|
|
|
DRM_FORMAT_VYUY,
|
|
|
};
|
|
|
|
|
|
-static const uint64_t skl_plane_format_modifiers[] = {
|
|
|
+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_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,
|
|
@@ -1234,6 +1244,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:
|
|
@@ -1289,6 +1303,23 @@ static const struct drm_plane_funcs intel_sprite_plane_funcs = {
|
|
|
.format_mod_supported = intel_sprite_plane_format_mod_supported,
|
|
|
};
|
|
|
|
|
|
+bool skl_plane_has_ccs(struct drm_i915_private *dev_priv,
|
|
|
+ enum pipe pipe, enum plane_id plane_id)
|
|
|
+{
|
|
|
+ if (plane_id == PLANE_CURSOR)
|
|
|
+ return false;
|
|
|
+
|
|
|
+ if (INTEL_GEN(dev_priv) >= 10)
|
|
|
+ return true;
|
|
|
+
|
|
|
+ if (IS_GEMINILAKE(dev_priv))
|
|
|
+ return pipe != PIPE_C;
|
|
|
+
|
|
|
+ return pipe != PIPE_C &&
|
|
|
+ (plane_id == PLANE_PRIMARY ||
|
|
|
+ plane_id == PLANE_SPRITE0);
|
|
|
+}
|
|
|
+
|
|
|
struct intel_plane *
|
|
|
intel_sprite_plane_create(struct drm_i915_private *dev_priv,
|
|
|
enum pipe pipe, int plane)
|
|
@@ -1315,7 +1346,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) >= 9) {
|
|
|
intel_plane->can_scale = true;
|
|
|
state->scaler_id = -1;
|
|
|
|
|
@@ -1325,18 +1356,11 @@ 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;
|
|
|
- } else if (INTEL_GEN(dev_priv) >= 9) {
|
|
|
- intel_plane->can_scale = true;
|
|
|
- state->scaler_id = -1;
|
|
|
|
|
|
- intel_plane->update_plane = skl_update_plane;
|
|
|
- intel_plane->disable_plane = skl_disable_plane;
|
|
|
- intel_plane->get_hw_state = skl_plane_get_hw_state;
|
|
|
-
|
|
|
- plane_formats = skl_plane_formats;
|
|
|
- num_plane_formats = ARRAY_SIZE(skl_plane_formats);
|
|
|
- modifiers = skl_plane_format_modifiers;
|
|
|
+ if (skl_plane_has_ccs(dev_priv, pipe, PLANE_SPRITE0 + plane))
|
|
|
+ modifiers = skl_plane_format_modifiers_ccs;
|
|
|
+ else
|
|
|
+ modifiers = skl_plane_format_modifiers_noccs;
|
|
|
} else if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) {
|
|
|
intel_plane->can_scale = false;
|
|
|
intel_plane->max_downscale = 1;
|