Skip to contentSkip to conversation

drm/i915: Some plane init cleanups

PATCH Superseded Ville Syrjala 6 participants 30 messages Jun 1, 2018 – Aug 29, 2018

Subsystems (2)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v3 cover drm/i915: Some plane init cleanups

From: Ville Syrjälä <[email protected]>

Another version of these cleansup. Last time there was some kind of smtp fail when sending and patchwork got confused at the wonky threading. So best to repost fully I thought. Additionally I had to resolve a lot of rebase confilicts and I spotted a few NV12 related things I missed the last time around.

Ville Syrjälä (12):
drm/i915: Constify all plane_funcs structs drm/i915: Populate possible_crtcs for primary/cursor planes drm/i915: Don't populate plane->i9xx_plane for sprites drm/i915: Allow horizontal mirroring for cnl+ "sprite" planes drm/i915: Disallow plane scaling with specific pixel formats drm/i915: Add missing pixel formats for skl+ "sprites" drm/i915: Move plane_state->scaler_id initialization into
intel_create_plane_state()
drm/i915: Introduce intel_plane_alloc()
drm/i915: Extract skl_universal_plane_init() drm/i915: Simplify skl_plane_has_planar()
drm/i915: s/intel_plane/plane/ in sprite init drm/i915: Rename variables in intel_primary_plane_create()

 drivers/gpu/drm/i915/intel_atomic_plane.c |   1 +
 drivers/gpu/drm/i915/intel_display.c      | 334 ++++++--------------------
 drivers/gpu/drm/i915/intel_drv.h          |  16 +-
 drivers/gpu/drm/i915/intel_sprite.c       | 374 ++++++++++++++++++++----------
 4 files changed, 322 insertions(+), 403 deletions(-)
Signature · 6 lines
2.16.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

PATCH v3 1/12 drm/i915: Constify all plane_funcs structs

From: Ville Syrjälä <[email protected]>

plane_funcs can be cosnt. Make them so.

v2: Rebase due to per-platforms plane_funcs

---
 drivers/gpu/drm/i915/intel_display.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/intel_display.c +3 -3
index 29940520a171..f0b269a2bc64 100644
@@ -13331,7 +13331,7 @@ static bool intel_cursor_format_mod_supported(struct drm_plane *_plane,
 		format == DRM_FORMAT_ARGB8888;
 }
 
-static struct drm_plane_funcs skl_plane_funcs = {
+static const struct drm_plane_funcs skl_plane_funcs = {
 	.update_plane = drm_atomic_helper_update_plane,
 	.disable_plane = drm_atomic_helper_disable_plane,
 	.destroy = intel_plane_destroy,
@@ -13342,7 +13342,7 @@ static struct drm_plane_funcs skl_plane_funcs = {
 	.format_mod_supported = skl_plane_format_mod_supported,
 };
 
-static struct drm_plane_funcs i965_plane_funcs = {
+static const struct drm_plane_funcs i965_plane_funcs = {
 	.update_plane = drm_atomic_helper_update_plane,
 	.disable_plane = drm_atomic_helper_disable_plane,
 	.destroy = intel_plane_destroy,
@@ -13353,7 +13353,7 @@ static struct drm_plane_funcs i965_plane_funcs = {
 	.format_mod_supported = i965_plane_format_mod_supported,
 };
 
-static struct drm_plane_funcs i8xx_plane_funcs = {
+static const struct drm_plane_funcs i8xx_plane_funcs = {
 	.update_plane = drm_atomic_helper_update_plane,
 	.disable_plane = drm_atomic_helper_disable_plane,
 	.destroy = intel_plane_destroy,
Signature · 6 lines
2.16.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
maintainer Reviewed-by on v3 1/12
#2 lore raw

Re: [PATCH v3 01/12] drm/i915: Constify all plane_funcs structs

Quoted 7 lines · Ville Syrjala

From: Ville Syrjälä <[email protected]>

plane_funcs can be cosnt. Make them so.

v2: Rebase due to per-platforms plane_funcs

Quoted 35 lines
---
 drivers/gpu/drm/i915/intel_display.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/intel_display.c +3 -3
index 29940520a171..f0b269a2bc64 100644
@@ -13331,7 +13331,7 @@ static bool intel_cursor_format_mod_supported(struct drm_plane *_plane,
 		format == DRM_FORMAT_ARGB8888;
 }
 
-static struct drm_plane_funcs skl_plane_funcs = {
+static const struct drm_plane_funcs skl_plane_funcs = {
 	.update_plane = drm_atomic_helper_update_plane,
 	.disable_plane = drm_atomic_helper_disable_plane,
 	.destroy = intel_plane_destroy,
@@ -13342,7 +13342,7 @@ static struct drm_plane_funcs skl_plane_funcs = {
 	.format_mod_supported = skl_plane_format_mod_supported,
 };
 
-static struct drm_plane_funcs i965_plane_funcs = {
+static const struct drm_plane_funcs i965_plane_funcs = {
 	.update_plane = drm_atomic_helper_update_plane,
 	.disable_plane = drm_atomic_helper_disable_plane,
 	.destroy = intel_plane_destroy,
@@ -13353,7 +13353,7 @@ static struct drm_plane_funcs i965_plane_funcs = {
 	.format_mod_supported = i965_plane_format_mod_supported,
 };
 
-static struct drm_plane_funcs i8xx_plane_funcs = {
+static const struct drm_plane_funcs i8xx_plane_funcs = {
 	.update_plane = drm_atomic_helper_update_plane,
 	.disable_plane = drm_atomic_helper_disable_plane,
 	.destroy = intel_plane_destroy,
Signature · 5 lines
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#3 lore raw

PATCH v3 2/12 drm/i915: Populate possible_crtcs for primary/cursor planes

In reply to Ville Syrjala

From: Ville Syrjälä <[email protected]>

We're currently not providing the possible_crtcs mask to drm_universal_plane_init() for primary/cursor planes. While that does work on account of drm_crtc_init_with_planes() filling those up for us, it's inconsisten with what we're doing for sprite planes.

Let's just always pass the possible_crtcs bitmask to drm_universal_plane_init(). This does assume that crtc->index == pipe. But we're already making that assumption elsewhere so it doesn't seem like a very big sin here.

---
 drivers/gpu/drm/i915/intel_display.c | 14 ++++++++++----
 drivers/gpu/drm/i915/intel_sprite.c  |  2 +-
 2 files changed, 11 insertions(+), 5 deletions(-)
drivers/gpu/drm/i915/intel_display.c +10 -4
index f0b269a2bc64..8b610c5498c0 100644
@@ -13547,6 +13547,7 @@ intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)
 	const struct drm_plane_funcs *plane_funcs;
 	const uint32_t *intel_primary_formats;
 	unsigned int supported_rotations;
+	unsigned int possible_crtcs;
 	unsigned int num_formats;
 	const uint64_t *modifiers;
 	int ret;
@@ -13643,23 +13644,25 @@ intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)
 		plane_funcs = &i8xx_plane_funcs;
 	}
 
+	possible_crtcs = BIT(pipe);
+
 	if (INTEL_GEN(dev_priv) >= 9)
 		ret = drm_universal_plane_init(&dev_priv->drm, &primary->base,
-					       0, plane_funcs,
+					       possible_crtcs, plane_funcs,
 					       intel_primary_formats, num_formats,
 					       modifiers,
 					       DRM_PLANE_TYPE_PRIMARY,
 					       "plane 1%c", pipe_name(pipe));
 	else if (INTEL_GEN(dev_priv) >= 5 || IS_G4X(dev_priv))
 		ret = drm_universal_plane_init(&dev_priv->drm, &primary->base,
-					       0, plane_funcs,
+					       possible_crtcs, plane_funcs,
 					       intel_primary_formats, num_formats,
 					       modifiers,
 					       DRM_PLANE_TYPE_PRIMARY,
 					       "primary %c", pipe_name(pipe));
 	else
 		ret = drm_universal_plane_init(&dev_priv->drm, &primary->base,
-					       0, plane_funcs,
+					       possible_crtcs, plane_funcs,
 					       intel_primary_formats, num_formats,
 					       modifiers,
 					       DRM_PLANE_TYPE_PRIMARY,
@@ -13719,6 +13722,7 @@ intel_cursor_plane_create(struct drm_i915_private *dev_priv,
 {
 	struct intel_plane *cursor = NULL;
 	struct intel_plane_state *state = NULL;
+	unsigned int possible_crtcs;
 	int ret;
 
 	cursor = kzalloc(sizeof(*cursor), GFP_KERNEL);
@@ -13760,8 +13764,10 @@ intel_cursor_plane_create(struct drm_i915_private *dev_priv,
 	if (IS_I845G(dev_priv) || IS_I865G(dev_priv) || HAS_CUR_FBC(dev_priv))
 		cursor->cursor.size = ~0;
 
+	possible_crtcs = BIT(pipe);
+
 	ret = drm_universal_plane_init(&dev_priv->drm, &cursor->base,
-				       0, &intel_cursor_plane_funcs,
+				       possible_crtcs, &intel_cursor_plane_funcs,
 				       intel_cursor_formats,
 				       ARRAY_SIZE(intel_cursor_formats),
 				       cursor_format_modifiers,
drivers/gpu/drm/i915/intel_sprite.c +1 -1
index 1160bc3a1e8e..612790b192b8 100644
@@ -1563,7 +1563,7 @@ intel_sprite_plane_create(struct drm_i915_private *dev_priv,
 	intel_plane->frontbuffer_bit = INTEL_FRONTBUFFER(pipe, intel_plane->id);
 	intel_plane->check_plane = intel_check_sprite_plane;
 
-	possible_crtcs = (1 << pipe);
+	possible_crtcs = BIT(pipe);
 
 	if (INTEL_GEN(dev_priv) >= 9)
 		ret = drm_universal_plane_init(&dev_priv->drm, &intel_plane->base,
Signature · 6 lines
2.16.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v3 2/12
#4 lore raw

Re: [PATCH v3 02/12] drm/i915: Populate possible_crtcs for primary/cursor planes

Quoting Ville Syrjala (2018-06-01 18:00:24)

Quoted 7 lines

From: Ville Syrjälä <[email protected]>

We're currently not providing the possible_crtcs mask to drm_universal_plane_init() for primary/cursor planes. While that does work on account of drm_crtc_init_with_planes() filling those up for us, it's inconsisten with what we're doing for sprite planes.

Quoted 6 lines

Let's just always pass the possible_crtcs bitmask to drm_universal_plane_init(). This does assume that crtc->index == pipe. But we're already making that assumption elsewhere so it doesn't seem like a very big sin here.

The remaining 3,

-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reviewed-by on v3 2/12
#5 lore raw

Re: [PATCH v3 02/12] drm/i915: Populate possible_crtcs for primary/cursor planes

In reply to Ville Syrjala

Quoting Ville Syrjala (2018-06-01 18:00:24)

Quoted 11 lines

From: Ville Syrjälä <[email protected]>

We're currently not providing the possible_crtcs mask to drm_universal_plane_init() for primary/cursor planes. While that does work on account of drm_crtc_init_with_planes() filling those up for us, it's inconsisten with what we're doing for sprite planes.

Let's just always pass the possible_crtcs bitmask to drm_universal_plane_init(). This does assume that crtc->index == pipe. But we're already making that assumption elsewhere so it doesn't seem like a very big sin here.

drm_crtc_index() == pipe is baked in.

Quoted 1 line

-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#6 lore raw

PATCH v3 3/12 drm/i915: Don't populate plane->i9xx_plane for sprites

In reply to Ville Syrjala

From: Ville Syrjälä <[email protected]>

enum i9xx_plane_id namespace is not valid for any sprite plane, so let's not even populate plane->i9xx_plane.

---
 drivers/gpu/drm/i915/intel_sprite.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/i915/intel_sprite.c +0 -1
index 612790b192b8..0a53f1fd6916 100644
@@ -1558,7 +1558,6 @@ intel_sprite_plane_create(struct drm_i915_private *dev_priv,
 	}
 
 	intel_plane->pipe = pipe;
-	intel_plane->i9xx_plane = plane;
 	intel_plane->id = PLANE_SPRITE0 + plane;
 	intel_plane->frontbuffer_bit = INTEL_FRONTBUFFER(pipe, intel_plane->id);
 	intel_plane->check_plane = intel_check_sprite_plane;
Signature · 6 lines
2.16.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#7 lore raw

PATCH v3 4/12 drm/i915: Allow horizontal mirroring for cnl+ "sprite" planes

In reply to Ville Syrjala

From: Ville Syrjälä <[email protected]>

All CNL universal planes support horizontal mirroring. Currently we expose the capability only for the primary plane. Expose it for the overlay planes as well.

---
 drivers/gpu/drm/i915/intel_sprite.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_sprite.c +6 -1
index 0a53f1fd6916..01b0d28e69f8 100644
@@ -1544,7 +1544,12 @@ intel_sprite_plane_create(struct drm_i915_private *dev_priv,
 		}
 	}
 
-	if (INTEL_GEN(dev_priv) >= 9) {
+	if (INTEL_GEN(dev_priv) >= 10) {
+		supported_rotations =
+			DRM_MODE_ROTATE_0 | DRM_MODE_ROTATE_90 |
+			DRM_MODE_ROTATE_180 | DRM_MODE_ROTATE_270 |
+			DRM_MODE_REFLECT_X;
+	} else if (INTEL_GEN(dev_priv) >= 9) {
 		supported_rotations =
 			DRM_MODE_ROTATE_0 | DRM_MODE_ROTATE_90 |
 			DRM_MODE_ROTATE_180 | DRM_MODE_ROTATE_270;
Signature · 6 lines
2.16.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#8 lore raw

PATCH v3 5/12 drm/i915: Disallow plane scaling with specific pixel formats

In reply to Ville Syrjala

From: Ville Syrjälä <[email protected]>

Plane scaling is not supported with specific pixel formats. Disallow plane scaling when such a format is used. Currently the only such pixel format we expose is C8, but in case we add more in the future let's make it easy to deal with them.

---
 drivers/gpu/drm/i915/intel_display.c |  2 +-
 drivers/gpu/drm/i915/intel_drv.h     |  1 +
 drivers/gpu/drm/i915/intel_sprite.c  | 41 ++++++++++++++++++++++++------------
 3 files changed, 29 insertions(+), 15 deletions(-)
drivers/gpu/drm/i915/intel_display.c +1 -1
index 8b610c5498c0..10585c623508 100644
@@ -13101,7 +13101,7 @@ intel_check_primary_plane(struct intel_plane *plane,
 
 	if (INTEL_GEN(dev_priv) >= 9) {
 		/* use scaler when colorkey is not required */
-		if (!state->ckey.flags) {
+		if (!state->ckey.flags && intel_fb_scalable(state->base.fb)) {
 			min_scale = 1;
 			if (state->base.fb)
 				pixel_format = state->base.fb->format->format;
drivers/gpu/drm/i915/intel_drv.h +1 -0
index 1b475744ab37..497b482b9c58 100644
@@ -2072,6 +2072,7 @@ bool intel_sdvo_init(struct drm_i915_private *dev_priv,
 
 /* intel_sprite.c */
 bool intel_format_is_yuv(u32 format);
+bool intel_fb_scalable(const struct drm_framebuffer *fb);
 int intel_usecs_to_scanlines(const struct drm_display_mode *adjusted_mode,
 			     int usecs);
 struct intel_plane *intel_sprite_plane_create(struct drm_i915_private *dev_priv,
drivers/gpu/drm/i915/intel_sprite.c +27 -14

64 lines not on this page · raw message

Signature · 6 lines
2.16.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#9 lore raw

PATCH v3 6/12 drm/i915: Add missing pixel formats for skl+ "sprites"

In reply to Ville Syrjala

From: Ville Syrjälä <[email protected]>

All SKL+ universal planes support the same set of formats (with the exception of NV12 which we don't expose yet). Make the format lists for primary and sprites the same.

And make the format list const while at it.

v2: Deal with the "planar" format lit as well

---
 drivers/gpu/drm/i915/intel_sprite.c | 22 ++++++++++++++--------
 1 file changed, 14 insertions(+), 8 deletions(-)
drivers/gpu/drm/i915/intel_sprite.c +14 -8
index 22fb7ca5ae90..adf6af8dcc43 100644
@@ -1211,24 +1211,30 @@ static const uint32_t vlv_plane_formats[] = {
 	DRM_FORMAT_VYUY,
 };
 
-static uint32_t skl_plane_formats[] = {
+static const uint32_t skl_plane_formats[] = {
+	DRM_FORMAT_C8,
 	DRM_FORMAT_RGB565,
-	DRM_FORMAT_ABGR8888,
-	DRM_FORMAT_ARGB8888,
-	DRM_FORMAT_XBGR8888,
 	DRM_FORMAT_XRGB8888,
+	DRM_FORMAT_XBGR8888,
+	DRM_FORMAT_ARGB8888,
+	DRM_FORMAT_ABGR8888,
+	DRM_FORMAT_XRGB2101010,
+	DRM_FORMAT_XBGR2101010,
 	DRM_FORMAT_YUYV,
 	DRM_FORMAT_YVYU,
 	DRM_FORMAT_UYVY,
 	DRM_FORMAT_VYUY,
 };
 
-static uint32_t skl_planar_formats[] = {
+static const uint32_t skl_planar_formats[] = {
+	DRM_FORMAT_C8,
 	DRM_FORMAT_RGB565,
-	DRM_FORMAT_ABGR8888,
-	DRM_FORMAT_ARGB8888,
-	DRM_FORMAT_XBGR8888,
 	DRM_FORMAT_XRGB8888,
+	DRM_FORMAT_XBGR8888,
+	DRM_FORMAT_ARGB8888,
+	DRM_FORMAT_ABGR8888,
+	DRM_FORMAT_XRGB2101010,
+	DRM_FORMAT_XBGR2101010,
 	DRM_FORMAT_YUYV,
 	DRM_FORMAT_YVYU,
 	DRM_FORMAT_UYVY,
Signature · 6 lines
2.16.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#10 lore raw

PATCH v3 7/12 drm/i915: Move plane_state->scaler_id initialization into intel_create_plane_state()

In reply to Ville Syrjala

From: Ville Syrjälä <[email protected]>

No point in having each caller of intel_create_plane_state() initialize the scaler_id to -1. Instead just do it in intel_create_plane_state().

Previously we left scaler_id at 0 for pre-SKL platforms, but I can't see how initializing it to -1 always would cause any harm.

---
 drivers/gpu/drm/i915/intel_atomic_plane.c | 1 +
 drivers/gpu/drm/i915/intel_display.c      | 7 +------
 drivers/gpu/drm/i915/intel_sprite.c       | 1 -
 3 files changed, 2 insertions(+), 7 deletions(-)
drivers/gpu/drm/i915/intel_atomic_plane.c +1 -0
index 6d068786eb41..cb9cc0877b36 100644
@@ -56,6 +56,7 @@ intel_create_plane_state(struct drm_plane *plane)
 
 	state->base.plane = plane;
 	state->base.rotation = DRM_MODE_ROTATE_0;
+	state->scaler_id = -1;
 
 	return state;
 }
drivers/gpu/drm/i915/intel_display.c +1 -6
index 10585c623508..a061e9a7eb6a 100644
@@ -13568,10 +13568,8 @@ intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)
 
 	primary->can_scale = false;
 	primary->max_downscale = 1;
-	if (INTEL_GEN(dev_priv) >= 9) {
+	if (INTEL_GEN(dev_priv) >= 9)
 		primary->can_scale = true;
-		state->scaler_id = -1;
-	}
 	primary->pipe = pipe;
 	/*
 	 * On gen2/3 only plane A can do FBC, but the panel fitter and LVDS
@@ -13782,9 +13780,6 @@ intel_cursor_plane_create(struct drm_i915_private *dev_priv,
 						   DRM_MODE_ROTATE_0 |
 						   DRM_MODE_ROTATE_180);
 
-	if (INTEL_GEN(dev_priv) >= 9)
-		state->scaler_id = -1;
-
 	drm_plane_helper_add(&cursor->base, &intel_plane_helper_funcs);
 
 	return cursor;
drivers/gpu/drm/i915/intel_sprite.c +0 -1
index adf6af8dcc43..dd1fa32f0bd4 100644
@@ -1486,7 +1486,6 @@ intel_sprite_plane_create(struct drm_i915_private *dev_priv,
 
 	if (INTEL_GEN(dev_priv) >= 9) {
 		intel_plane->can_scale = true;
-		state->scaler_id = -1;
 
 		intel_plane->has_ccs = skl_plane_has_ccs(dev_priv, pipe,
 							 PLANE_SPRITE0 + plane);
Signature · 6 lines
2.16.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v3 7/12
#11 lore raw

Re: [PATCH v3 07/12] drm/i915: Move plane_state->scaler_id initialization into intel_create_plane_state()

Quoting Ville Syrjala (2018-06-01 18:00:29)

Quoted 4 lines

From: Ville Syrjälä <[email protected]>

No point in having each caller of intel_create_plane_state() initialize the scaler_id to -1. Instead just do it in intel_create_plane_state().

No tricks spotted.

Quoted 2 lines

Previously we left scaler_id at 0 for pre-SKL platforms, but I can't see how initializing it to -1 always would cause any harm.

Seems fine.

Quoted 1 line

-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#12 lore raw

PATCH v3 8/12 drm/i915: Introduce intel_plane_alloc()

In reply to Ville Syrjala

From: Ville Syrjälä <[email protected]>

Pull the common plane+plane_state allocation into a small helper. Reduces the amount of boilerplate in the plane initialization functions.

---
 drivers/gpu/drm/i915/intel_display.c | 44 ++++++++-----------------------
 drivers/gpu/drm/i915/intel_drv.h     |  3 +++
 drivers/gpu/drm/i915/intel_sprite.c  | 50 ++++++++++++++++++++++++------------
 3 files changed, 47 insertions(+), 50 deletions(-)
drivers/gpu/drm/i915/intel_display.c +10 -34
index a061e9a7eb6a..13de4e9e276a 100644
@@ -13542,8 +13542,7 @@ bool skl_plane_has_planar(struct drm_i915_private *dev_priv,
 static struct intel_plane *
 intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)
 {
-	struct intel_plane *primary = NULL;
-	struct intel_plane_state *state = NULL;
+	struct intel_plane *primary;
 	const struct drm_plane_funcs *plane_funcs;
 	const uint32_t *intel_primary_formats;
 	unsigned int supported_rotations;
@@ -13552,19 +13551,9 @@ intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)
 	const uint64_t *modifiers;
 	int ret;
 
-	primary = kzalloc(sizeof(*primary), GFP_KERNEL);
-	if (!primary) {
-		ret = -ENOMEM;
-		goto fail;
-	}
-
-	state = intel_create_plane_state(&primary->base);
-	if (!state) {
-		ret = -ENOMEM;
-		goto fail;
-	}
-
-	primary->base.state = &state->base;
+	primary = intel_plane_alloc();
+	if (IS_ERR(primary))
+		return primary;
 
 	primary->can_scale = false;
 	primary->max_downscale = 1;
@@ -13708,8 +13697,7 @@ intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)
 	return primary;
 
 fail:
-	kfree(state);
-	kfree(primary);
+	intel_plane_free(primary);
 
 	return ERR_PTR(ret);
 }
@@ -13718,24 +13706,13 @@ static struct intel_plane *
 intel_cursor_plane_create(struct drm_i915_private *dev_priv,
 			  enum pipe pipe)
 {
-	struct intel_plane *cursor = NULL;
-	struct intel_plane_state *state = NULL;
 	unsigned int possible_crtcs;
+	struct intel_plane *cursor;
 	int ret;
 
-	cursor = kzalloc(sizeof(*cursor), GFP_KERNEL);
-	if (!cursor) {
-		ret = -ENOMEM;
-		goto fail;
-	}
-
-	state = intel_create_plane_state(&cursor->base);
-	if (!state) {
-		ret = -ENOMEM;
-		goto fail;
-	}
-
-	cursor->base.state = &state->base;
+	cursor = intel_plane_alloc();
+	if (IS_ERR(cursor))
+		return cursor;
 
 	cursor->can_scale = false;
 	cursor->max_downscale = 1;
@@ -13785,8 +13762,7 @@ intel_cursor_plane_create(struct drm_i915_private *dev_priv,
 	return cursor;
 
 fail:
-	kfree(state);
-	kfree(cursor);
+	intel_plane_free(cursor);
 
 	return ERR_PTR(ret);
 }
drivers/gpu/drm/i915/intel_drv.h +3 -0
index 497b482b9c58..88adf31ef1c2 100644
@@ -2091,6 +2091,9 @@ bool skl_plane_has_ccs(struct drm_i915_private *dev_priv,
 bool intel_format_is_yuv(uint32_t format);
 bool skl_plane_has_planar(struct drm_i915_private *dev_priv,
 			  enum pipe pipe, enum plane_id plane_id);
+struct intel_plane *intel_plane_alloc(void);
+void intel_plane_free(struct intel_plane *plane);
+
 
 /* intel_tv.c */
 void intel_tv_init(struct drm_i915_private *dev_priv);
drivers/gpu/drm/i915/intel_sprite.c +34 -16

72 lines not on this page · raw message

Signature · 6 lines
2.16.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v3 8/12
#13 lore raw

Re: [PATCH v3 08/12] drm/i915: Introduce intel_plane_alloc()

Quoting Ville Syrjala (2018-06-01 18:00:30)

Quoted 7 lines

From: Ville Syrjälä <[email protected]>

Pull the common plane+plane_state allocation into a small helper. Reduces the amount of boilerplate in the plane initialization functions.

-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#14 lore raw

PATCH v3 9/12 drm/i915: Extract skl_universal_plane_init()

In reply to Ville Syrjala

From: Ville Syrjälä <[email protected]>

There's not much point in following the primary vs. sprite split for the SKL+ universal plane init code. The only difference is of our own doing in the form of the .check_plane(). Let's make a small exception for that little detail and otherwise share the same code to initialize all the universal planes.

Eventually we should eliminate the mess around .check_plane() as well, but for now let's be happy with some code reduction.

v2: Remember to set up plane->has_fbc
Make skl_plane_has_ccs() static
v3: Rebase due to NV12, rename some variables

---
 drivers/gpu/drm/i915/intel_display.c | 211 +++--------------------------------
 drivers/gpu/drm/i915/intel_drv.h     |  12 +-
 drivers/gpu/drm/i915/intel_sprite.c  | 193 +++++++++++++++++++++++---------
 3 files changed, 159 insertions(+), 257 deletions(-)
drivers/gpu/drm/i915/intel_display.c +16 -195
index 13de4e9e276a..08ae063fecae 100644
@@ -73,55 +73,6 @@ static const uint64_t i9xx_format_modifiers[] = {
 	DRM_FORMAT_MOD_INVALID
 };
 
-static const uint32_t skl_primary_formats[] = {
-	DRM_FORMAT_C8,
-	DRM_FORMAT_RGB565,
-	DRM_FORMAT_XRGB8888,
-	DRM_FORMAT_XBGR8888,
-	DRM_FORMAT_ARGB8888,
-	DRM_FORMAT_ABGR8888,
-	DRM_FORMAT_XRGB2101010,
-	DRM_FORMAT_XBGR2101010,
-	DRM_FORMAT_YUYV,
-	DRM_FORMAT_YVYU,
-	DRM_FORMAT_UYVY,
-	DRM_FORMAT_VYUY,
-};
-
-static const uint32_t skl_pri_planar_formats[] = {
-	DRM_FORMAT_C8,
-	DRM_FORMAT_RGB565,
-	DRM_FORMAT_XRGB8888,
-	DRM_FORMAT_XBGR8888,
-	DRM_FORMAT_ARGB8888,
-	DRM_FORMAT_ABGR8888,
-	DRM_FORMAT_XRGB2101010,
-	DRM_FORMAT_XBGR2101010,
-	DRM_FORMAT_YUYV,
-	DRM_FORMAT_YVYU,
-	DRM_FORMAT_UYVY,
-	DRM_FORMAT_VYUY,
-	DRM_FORMAT_NV12,
-};
-
-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,
-	DRM_FORMAT_MOD_LINEAR,
-	DRM_FORMAT_MOD_INVALID
-};
-
 /* Cursor formats */
 static const uint32_t intel_cursor_formats[] = {
 	DRM_FORMAT_ARGB8888,
@@ -13273,57 +13224,6 @@ static bool i965_plane_format_mod_supported(struct drm_plane *_plane,
 	}
 }
 
-static bool skl_plane_format_mod_supported(struct drm_plane *_plane,
-					   u32 format, u64 modifier)
-{
-	struct intel_plane *plane = to_intel_plane(_plane);
-
-	switch (modifier) {
-	case DRM_FORMAT_MOD_LINEAR:
-	case I915_FORMAT_MOD_X_TILED:
-	case I915_FORMAT_MOD_Y_TILED:
-	case I915_FORMAT_MOD_Yf_TILED:
-		break;
-	case I915_FORMAT_MOD_Y_TILED_CCS:
-	case I915_FORMAT_MOD_Yf_TILED_CCS:
-		if (!plane->has_ccs)
-			return false;
-		break;
-	default:
-		return false;
-	}
-
-	switch (format) {
-	case DRM_FORMAT_XRGB8888:
-	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:
-	case DRM_FORMAT_YUYV:
-	case DRM_FORMAT_YVYU:
-	case DRM_FORMAT_UYVY:
-	case DRM_FORMAT_VYUY:
-	case DRM_FORMAT_NV12:
-		if (modifier == I915_FORMAT_MOD_Yf_TILED)
-			return true;
-		/* fall through */
-	case DRM_FORMAT_C8:
-		if (modifier == DRM_FORMAT_MOD_LINEAR ||
-		    modifier == I915_FORMAT_MOD_X_TILED ||
-		    modifier == I915_FORMAT_MOD_Y_TILED)
-			return true;
-		/* fall through */
-	default:
-		return false;
-	}
-}
-
 static bool intel_cursor_format_mod_supported(struct drm_plane *_plane,
 					      u32 format, u64 modifier)
 {
@@ -13331,17 +13231,6 @@ static bool intel_cursor_format_mod_supported(struct drm_plane *_plane,
 		format == DRM_FORMAT_ARGB8888;
 }
 
-static const struct drm_plane_funcs skl_plane_funcs = {
-	.update_plane = drm_atomic_helper_update_plane,
-	.disable_plane = drm_atomic_helper_disable_plane,
-	.destroy = intel_plane_destroy,
-	.atomic_get_property = intel_plane_atomic_get_property,
-	.atomic_set_property = intel_plane_atomic_set_property,
-	.atomic_duplicate_state = intel_plane_duplicate_state,
-	.atomic_destroy_state = intel_plane_destroy_state,
-	.format_mod_supported = skl_plane_format_mod_supported,
-};
-
 static const struct drm_plane_funcs i965_plane_funcs = {
 	.update_plane = drm_atomic_helper_update_plane,
 	.disable_plane = drm_atomic_helper_disable_plane,
@@ -13506,39 +13395,6 @@ static bool i9xx_plane_has_fbc(struct drm_i915_private *dev_priv,
 		return i9xx_plane == PLANE_A;
 }
 
-static bool skl_plane_has_fbc(struct drm_i915_private *dev_priv,
-			      enum pipe pipe, enum plane_id plane_id)
-{
-	if (!HAS_FBC(dev_priv))
-		return false;
-
-	return pipe == PIPE_A && plane_id == PLANE_PRIMARY;
-}
-
-bool skl_plane_has_planar(struct drm_i915_private *dev_priv,
-			  enum pipe pipe, enum plane_id plane_id)
-{
-	if (plane_id == PLANE_PRIMARY) {
-		if (IS_SKYLAKE(dev_priv) || IS_BROXTON(dev_priv))
-			return false;
-		else if ((INTEL_GEN(dev_priv) == 9 && pipe == PIPE_C) &&
-			 !IS_GEMINILAKE(dev_priv))
-			return false;
-	} else if (plane_id >= PLANE_SPRITE0) {
-		if (plane_id == PLANE_CURSOR)
-			return false;
-		if (IS_GEMINILAKE(dev_priv) || INTEL_GEN(dev_priv) == 10) {
-			if (plane_id != PLANE_SPRITE0)
-				return false;
-		} else {
-			if (plane_id != PLANE_SPRITE0 || pipe == PIPE_C ||
-			    IS_SKYLAKE(dev_priv) || IS_BROXTON(dev_priv))
-				return false;
-		}
-	}
-	return true;
-}
-
 static struct intel_plane *
 intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)
 {
@@ -13551,14 +13407,24 @@ intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)
 	const uint64_t *modifiers;
 	int ret;
 
+	if (INTEL_GEN(dev_priv) >= 9) {
+		primary = skl_universal_plane_create(dev_priv, pipe,
+						     PLANE_PRIMARY);
+		if (IS_ERR(primary))
+			return primary;
+
+		/* FIXME unify */
+		primary->check_plane = intel_check_primary_plane;
+
+		return primary;
+	}
+
 	primary = intel_plane_alloc();
 	if (IS_ERR(primary))
 		return primary;
 
 	primary->can_scale = false;
 	primary->max_downscale = 1;
-	if (INTEL_GEN(dev_priv) >= 9)
-		primary->can_scale = true;
 	primary->pipe = pipe;
 	/*
 	 * On gen2/3 only plane A can do FBC, but the panel fitter and LVDS
@@ -13571,14 +13437,7 @@ intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)
 	primary->id = PLANE_PRIMARY;
 	primary->frontbuffer_bit = INTEL_FRONTBUFFER(pipe, primary->id);
 
-	if (INTEL_GEN(dev_priv) >= 9)
-		primary->has_fbc = skl_plane_has_fbc(dev_priv,
-						     primary->pipe,
-						     primary->id);
-	else
-		primary->has_fbc = i9xx_plane_has_fbc(dev_priv,
-						      primary->i9xx_plane);
-
+	primary->has_fbc = i9xx_plane_has_fbc(dev_priv, primary->i9xx_plane);
 	if (primary->has_fbc) {
 		struct intel_fbc *fbc = &dev_priv->fbc;
 
@@ -13587,29 +13446,7 @@ intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)
 
 	primary->check_plane = intel_check_primary_plane;
 
-	if (INTEL_GEN(dev_priv) >= 9) {
-		primary->has_ccs = skl_plane_has_ccs(dev_priv, pipe,
-						     PLANE_PRIMARY);
-
-		if (skl_plane_has_planar(dev_priv, pipe, PLANE_PRIMARY)) {
-			intel_primary_formats = skl_pri_planar_formats;
-			num_formats = ARRAY_SIZE(skl_pri_planar_formats);
-		} else {
-			intel_primary_formats = skl_primary_formats;
-			num_formats = ARRAY_SIZE(skl_primary_formats);
-		}
-
-		if (primary->has_ccs)
-			modifiers = skl_format_modifiers_ccs;
-		else
-			modifiers = skl_format_modifiers_noccs;
-
-		primary->update_plane = skl_update_plane;
-		primary->disable_plane = skl_disable_plane;
-		primary->get_hw_state = skl_plane_get_hw_state;
-
-		plane_funcs = &skl_plane_funcs;
-	} else if (INTEL_GEN(dev_priv) >= 4) {
+	if (INTEL_GEN(dev_priv) >= 4) {
 		intel_primary_formats = i965_primary_formats;
 		num_formats = ARRAY_SIZE(i965_primary_formats);
 		modifiers = i9xx_format_modifiers;
@@ -13633,14 +13470,7 @@ intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)
 
 	possible_crtcs = BIT(pipe);
 
-	if (INTEL_GEN(dev_priv) >= 9)
-		ret = drm_universal_plane_init(&dev_priv->drm, &primary->base,
-					       possible_crtcs, plane_funcs,
-					       intel_primary_formats, num_formats,
-					       modifiers,
-					       DRM_PLANE_TYPE_PRIMARY,
-					       "plane 1%c", pipe_name(pipe));
-	else if (INTEL_GEN(dev_priv) >= 5 || IS_G4X(dev_priv))
+	if (INTEL_GEN(dev_priv) >= 5 || IS_G4X(dev_priv))
 		ret = drm_universal_plane_init(&dev_priv->drm, &primary->base,
 					       possible_crtcs, plane_funcs,
 					       intel_primary_formats, num_formats,
@@ -13658,16 +13488,7 @@ intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)
 	if (ret)
 		goto fail;
 
-	if (INTEL_GEN(dev_priv) >= 10) {
-		supported_rotations =
-			DRM_MODE_ROTATE_0 | DRM_MODE_ROTATE_90 |
-			DRM_MODE_ROTATE_180 | DRM_MODE_ROTATE_270 |
-			DRM_MODE_REFLECT_X;
-	} else if (INTEL_GEN(dev_priv) >= 9) {
-		supported_rotations =
-			DRM_MODE_ROTATE_0 | DRM_MODE_ROTATE_90 |
-			DRM_MODE_ROTATE_180 | DRM_MODE_ROTATE_270;
-	} else if (IS_CHERRYVIEW(dev_priv) && pipe == PIPE_B) {
+	if (IS_CHERRYVIEW(dev_priv) && pipe == PIPE_B) {
 		supported_rotations =
 			DRM_MODE_ROTATE_0 | DRM_MODE_ROTATE_180 |
 			DRM_MODE_REFLECT_X;
drivers/gpu/drm/i915/intel_drv.h +3 -9
index 88adf31ef1c2..3d5281a3cf1e 100644
@@ -2081,18 +2081,12 @@ int intel_sprite_set_colorkey_ioctl(struct drm_device *dev, void *data,
 				    struct drm_file *file_priv);
 void intel_pipe_update_start(const struct intel_crtc_state *new_crtc_state);
 void intel_pipe_update_end(struct intel_crtc_state *new_crtc_state);
-void skl_update_plane(struct intel_plane *plane,
-		      const struct intel_crtc_state *crtc_state,
-		      const struct intel_plane_state *plane_state);
-void skl_disable_plane(struct intel_plane *plane, struct intel_crtc *crtc);
-bool skl_plane_get_hw_state(struct intel_plane *plane, enum pipe *pipe);
-bool skl_plane_has_ccs(struct drm_i915_private *dev_priv,
-		       enum pipe pipe, enum plane_id plane_id);
 bool intel_format_is_yuv(uint32_t format);
-bool skl_plane_has_planar(struct drm_i915_private *dev_priv,
-			  enum pipe pipe, enum plane_id plane_id);
 struct intel_plane *intel_plane_alloc(void);
 void intel_plane_free(struct intel_plane *plane);
+struct intel_plane *
+skl_universal_plane_create(struct drm_i915_private *dev_priv,
+			   enum pipe pipe, enum plane_id plane_id);
 
 
 /* intel_tv.c */
drivers/gpu/drm/i915/intel_sprite.c +140 -53

247 lines not on this page · raw message

Signature · 6 lines
2.16.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#15 lore raw

PATCH v4 9/12 drm/i915: Extract skl_universal_plane_init()

From: Ville Syrjälä <[email protected]>

There's not much point in following the primary vs. sprite split for the SKL+ universal plane init code. The only difference is of our own doing in the form of the .check_plane(). Let's make a small exception for that little detail and otherwise share the same code to initialize all the universal planes.

Eventually we should eliminate the mess around .check_plane() as well, but for now let's be happy with some code reduction.

v2: Remember to set up plane->has_fbc
Make skl_plane_has_ccs() static
v3: Rebase due to NV12, rename some variables
v4: Don't leave the color_encoding/range props behind

---
 drivers/gpu/drm/i915/intel_display.c | 220 +++--------------------------------
 drivers/gpu/drm/i915/intel_drv.h     |  12 +-
 drivers/gpu/drm/i915/intel_sprite.c  | 201 +++++++++++++++++++++++---------
 3 files changed, 167 insertions(+), 266 deletions(-)
drivers/gpu/drm/i915/intel_display.c +16 -204
index 13de4e9e276a..2549fec31c79 100644
@@ -73,55 +73,6 @@ static const uint64_t i9xx_format_modifiers[] = {
 	DRM_FORMAT_MOD_INVALID
 };
 
-static const uint32_t skl_primary_formats[] = {
-	DRM_FORMAT_C8,
-	DRM_FORMAT_RGB565,
-	DRM_FORMAT_XRGB8888,
-	DRM_FORMAT_XBGR8888,
-	DRM_FORMAT_ARGB8888,
-	DRM_FORMAT_ABGR8888,
-	DRM_FORMAT_XRGB2101010,
-	DRM_FORMAT_XBGR2101010,
-	DRM_FORMAT_YUYV,
-	DRM_FORMAT_YVYU,
-	DRM_FORMAT_UYVY,
-	DRM_FORMAT_VYUY,
-};
-
-static const uint32_t skl_pri_planar_formats[] = {
-	DRM_FORMAT_C8,
-	DRM_FORMAT_RGB565,
-	DRM_FORMAT_XRGB8888,
-	DRM_FORMAT_XBGR8888,
-	DRM_FORMAT_ARGB8888,
-	DRM_FORMAT_ABGR8888,
-	DRM_FORMAT_XRGB2101010,
-	DRM_FORMAT_XBGR2101010,
-	DRM_FORMAT_YUYV,
-	DRM_FORMAT_YVYU,
-	DRM_FORMAT_UYVY,
-	DRM_FORMAT_VYUY,
-	DRM_FORMAT_NV12,
-};
-
-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,
-	DRM_FORMAT_MOD_LINEAR,
-	DRM_FORMAT_MOD_INVALID
-};
-
 /* Cursor formats */
 static const uint32_t intel_cursor_formats[] = {
 	DRM_FORMAT_ARGB8888,
@@ -13273,57 +13224,6 @@ static bool i965_plane_format_mod_supported(struct drm_plane *_plane,
 	}
 }
 
-static bool skl_plane_format_mod_supported(struct drm_plane *_plane,
-					   u32 format, u64 modifier)
-{
-	struct intel_plane *plane = to_intel_plane(_plane);
-
-	switch (modifier) {
-	case DRM_FORMAT_MOD_LINEAR:
-	case I915_FORMAT_MOD_X_TILED:
-	case I915_FORMAT_MOD_Y_TILED:
-	case I915_FORMAT_MOD_Yf_TILED:
-		break;
-	case I915_FORMAT_MOD_Y_TILED_CCS:
-	case I915_FORMAT_MOD_Yf_TILED_CCS:
-		if (!plane->has_ccs)
-			return false;
-		break;
-	default:
-		return false;
-	}
-
-	switch (format) {
-	case DRM_FORMAT_XRGB8888:
-	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:
-	case DRM_FORMAT_YUYV:
-	case DRM_FORMAT_YVYU:
-	case DRM_FORMAT_UYVY:
-	case DRM_FORMAT_VYUY:
-	case DRM_FORMAT_NV12:
-		if (modifier == I915_FORMAT_MOD_Yf_TILED)
-			return true;
-		/* fall through */
-	case DRM_FORMAT_C8:
-		if (modifier == DRM_FORMAT_MOD_LINEAR ||
-		    modifier == I915_FORMAT_MOD_X_TILED ||
-		    modifier == I915_FORMAT_MOD_Y_TILED)
-			return true;
-		/* fall through */
-	default:
-		return false;
-	}
-}
-
 static bool intel_cursor_format_mod_supported(struct drm_plane *_plane,
 					      u32 format, u64 modifier)
 {
@@ -13331,17 +13231,6 @@ static bool intel_cursor_format_mod_supported(struct drm_plane *_plane,
 		format == DRM_FORMAT_ARGB8888;
 }
 
-static const struct drm_plane_funcs skl_plane_funcs = {
-	.update_plane = drm_atomic_helper_update_plane,
-	.disable_plane = drm_atomic_helper_disable_plane,
-	.destroy = intel_plane_destroy,
-	.atomic_get_property = intel_plane_atomic_get_property,
-	.atomic_set_property = intel_plane_atomic_set_property,
-	.atomic_duplicate_state = intel_plane_duplicate_state,
-	.atomic_destroy_state = intel_plane_destroy_state,
-	.format_mod_supported = skl_plane_format_mod_supported,
-};
-
 static const struct drm_plane_funcs i965_plane_funcs = {
 	.update_plane = drm_atomic_helper_update_plane,
 	.disable_plane = drm_atomic_helper_disable_plane,
@@ -13506,39 +13395,6 @@ static bool i9xx_plane_has_fbc(struct drm_i915_private *dev_priv,
 		return i9xx_plane == PLANE_A;
 }
 
-static bool skl_plane_has_fbc(struct drm_i915_private *dev_priv,
-			      enum pipe pipe, enum plane_id plane_id)
-{
-	if (!HAS_FBC(dev_priv))
-		return false;
-
-	return pipe == PIPE_A && plane_id == PLANE_PRIMARY;
-}
-
-bool skl_plane_has_planar(struct drm_i915_private *dev_priv,
-			  enum pipe pipe, enum plane_id plane_id)
-{
-	if (plane_id == PLANE_PRIMARY) {
-		if (IS_SKYLAKE(dev_priv) || IS_BROXTON(dev_priv))
-			return false;
-		else if ((INTEL_GEN(dev_priv) == 9 && pipe == PIPE_C) &&
-			 !IS_GEMINILAKE(dev_priv))
-			return false;
-	} else if (plane_id >= PLANE_SPRITE0) {
-		if (plane_id == PLANE_CURSOR)
-			return false;
-		if (IS_GEMINILAKE(dev_priv) || INTEL_GEN(dev_priv) == 10) {
-			if (plane_id != PLANE_SPRITE0)
-				return false;
-		} else {
-			if (plane_id != PLANE_SPRITE0 || pipe == PIPE_C ||
-			    IS_SKYLAKE(dev_priv) || IS_BROXTON(dev_priv))
-				return false;
-		}
-	}
-	return true;
-}
-
 static struct intel_plane *
 intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)
 {
@@ -13551,14 +13407,24 @@ intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)
 	const uint64_t *modifiers;
 	int ret;
 
+	if (INTEL_GEN(dev_priv) >= 9) {
+		primary = skl_universal_plane_create(dev_priv, pipe,
+						     PLANE_PRIMARY);
+		if (IS_ERR(primary))
+			return primary;
+
+		/* FIXME unify */
+		primary->check_plane = intel_check_primary_plane;
+
+		return primary;
+	}
+
 	primary = intel_plane_alloc();
 	if (IS_ERR(primary))
 		return primary;
 
 	primary->can_scale = false;
 	primary->max_downscale = 1;
-	if (INTEL_GEN(dev_priv) >= 9)
-		primary->can_scale = true;
 	primary->pipe = pipe;
 	/*
 	 * On gen2/3 only plane A can do FBC, but the panel fitter and LVDS
@@ -13571,14 +13437,7 @@ intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)
 	primary->id = PLANE_PRIMARY;
 	primary->frontbuffer_bit = INTEL_FRONTBUFFER(pipe, primary->id);
 
-	if (INTEL_GEN(dev_priv) >= 9)
-		primary->has_fbc = skl_plane_has_fbc(dev_priv,
-						     primary->pipe,
-						     primary->id);
-	else
-		primary->has_fbc = i9xx_plane_has_fbc(dev_priv,
-						      primary->i9xx_plane);
-
+	primary->has_fbc = i9xx_plane_has_fbc(dev_priv, primary->i9xx_plane);
 	if (primary->has_fbc) {
 		struct intel_fbc *fbc = &dev_priv->fbc;
 
@@ -13587,29 +13446,7 @@ intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)
 
 	primary->check_plane = intel_check_primary_plane;
 
-	if (INTEL_GEN(dev_priv) >= 9) {
-		primary->has_ccs = skl_plane_has_ccs(dev_priv, pipe,
-						     PLANE_PRIMARY);
-
-		if (skl_plane_has_planar(dev_priv, pipe, PLANE_PRIMARY)) {
-			intel_primary_formats = skl_pri_planar_formats;
-			num_formats = ARRAY_SIZE(skl_pri_planar_formats);
-		} else {
-			intel_primary_formats = skl_primary_formats;
-			num_formats = ARRAY_SIZE(skl_primary_formats);
-		}
-
-		if (primary->has_ccs)
-			modifiers = skl_format_modifiers_ccs;
-		else
-			modifiers = skl_format_modifiers_noccs;
-
-		primary->update_plane = skl_update_plane;
-		primary->disable_plane = skl_disable_plane;
-		primary->get_hw_state = skl_plane_get_hw_state;
-
-		plane_funcs = &skl_plane_funcs;
-	} else if (INTEL_GEN(dev_priv) >= 4) {
+	if (INTEL_GEN(dev_priv) >= 4) {
 		intel_primary_formats = i965_primary_formats;
 		num_formats = ARRAY_SIZE(i965_primary_formats);
 		modifiers = i9xx_format_modifiers;
@@ -13633,14 +13470,7 @@ intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)
 
 	possible_crtcs = BIT(pipe);
 
-	if (INTEL_GEN(dev_priv) >= 9)
-		ret = drm_universal_plane_init(&dev_priv->drm, &primary->base,
-					       possible_crtcs, plane_funcs,
-					       intel_primary_formats, num_formats,
-					       modifiers,
-					       DRM_PLANE_TYPE_PRIMARY,
-					       "plane 1%c", pipe_name(pipe));
-	else if (INTEL_GEN(dev_priv) >= 5 || IS_G4X(dev_priv))
+	if (INTEL_GEN(dev_priv) >= 5 || IS_G4X(dev_priv))
 		ret = drm_universal_plane_init(&dev_priv->drm, &primary->base,
 					       possible_crtcs, plane_funcs,
 					       intel_primary_formats, num_formats,
@@ -13658,16 +13488,7 @@ intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)
 	if (ret)
 		goto fail;
 
-	if (INTEL_GEN(dev_priv) >= 10) {
-		supported_rotations =
-			DRM_MODE_ROTATE_0 | DRM_MODE_ROTATE_90 |
-			DRM_MODE_ROTATE_180 | DRM_MODE_ROTATE_270 |
-			DRM_MODE_REFLECT_X;
-	} else if (INTEL_GEN(dev_priv) >= 9) {
-		supported_rotations =
-			DRM_MODE_ROTATE_0 | DRM_MODE_ROTATE_90 |
-			DRM_MODE_ROTATE_180 | DRM_MODE_ROTATE_270;
-	} else if (IS_CHERRYVIEW(dev_priv) && pipe == PIPE_B) {
+	if (IS_CHERRYVIEW(dev_priv) && pipe == PIPE_B) {
 		supported_rotations =
 			DRM_MODE_ROTATE_0 | DRM_MODE_ROTATE_180 |
 			DRM_MODE_REFLECT_X;
@@ -13683,15 +13504,6 @@ intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)
 						   DRM_MODE_ROTATE_0,
 						   supported_rotations);
 
-	if (INTEL_GEN(dev_priv) >= 9)
-		drm_plane_create_color_properties(&primary->base,
-						  BIT(DRM_COLOR_YCBCR_BT601) |
-						  BIT(DRM_COLOR_YCBCR_BT709),
-						  BIT(DRM_COLOR_YCBCR_LIMITED_RANGE) |
-						  BIT(DRM_COLOR_YCBCR_FULL_RANGE),
-						  DRM_COLOR_YCBCR_BT709,
-						  DRM_COLOR_YCBCR_LIMITED_RANGE);
-
 	drm_plane_helper_add(&primary->base, &intel_plane_helper_funcs);
 
 	return primary;
drivers/gpu/drm/i915/intel_drv.h +3 -9
index 88adf31ef1c2..3d5281a3cf1e 100644
@@ -2081,18 +2081,12 @@ int intel_sprite_set_colorkey_ioctl(struct drm_device *dev, void *data,
 				    struct drm_file *file_priv);
 void intel_pipe_update_start(const struct intel_crtc_state *new_crtc_state);
 void intel_pipe_update_end(struct intel_crtc_state *new_crtc_state);
-void skl_update_plane(struct intel_plane *plane,
-		      const struct intel_crtc_state *crtc_state,
-		      const struct intel_plane_state *plane_state);
-void skl_disable_plane(struct intel_plane *plane, struct intel_crtc *crtc);
-bool skl_plane_get_hw_state(struct intel_plane *plane, enum pipe *pipe);
-bool skl_plane_has_ccs(struct drm_i915_private *dev_priv,
-		       enum pipe pipe, enum plane_id plane_id);
 bool intel_format_is_yuv(uint32_t format);
-bool skl_plane_has_planar(struct drm_i915_private *dev_priv,
-			  enum pipe pipe, enum plane_id plane_id);
 struct intel_plane *intel_plane_alloc(void);
 void intel_plane_free(struct intel_plane *plane);
+struct intel_plane *
+skl_universal_plane_create(struct drm_i915_private *dev_priv,
+			   enum pipe pipe, enum plane_id plane_id);
 
 
 /* intel_tv.c */
drivers/gpu/drm/i915/intel_sprite.c +148 -53

255 lines not on this page · raw message

Signature · 6 lines
2.16.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v4 9/12
#16 lore raw

Re: [PATCH v4 09/12] drm/i915: Extract skl_universal_plane_init()

Quoted 11 lines · Ville Syrjala

From: Ville Syrjälä <[email protected]>

There's not much point in following the primary vs. sprite split for the SKL+ universal plane init code. The only difference is of our own doing in the form of the .check_plane(). Let's make a small exception for that little detail and otherwise share the same code to initialize all the universal planes.

Eventually we should eliminate the mess around .check_plane() as well, but for now let's be happy with some code reduction.

Quoted 6 lines

v2: Remember to set up plane->has_fbc
Make skl_plane_has_ccs() static
v3: Rebase due to NV12, rename some variables
v4: Don't leave the color_encoding/range props behind

Quoted 696 lines
---
 drivers/gpu/drm/i915/intel_display.c | 220 +++--------------------
------------
 drivers/gpu/drm/i915/intel_drv.h     |  12 +-
 drivers/gpu/drm/i915/intel_sprite.c  | 201 +++++++++++++++++++++++
---------
 3 files changed, 167 insertions(+), 266 deletions(-)
drivers/gpu/drm/i915/intel_display.c +0 -100
index 13de4e9e276a..2549fec31c79 100644
@@ -73,55 +73,6 @@ static const uint64_t i9xx_format_modifiers[] = {
 	DRM_FORMAT_MOD_INVALID
 };
 
-static const uint32_t skl_primary_formats[] = {
-	DRM_FORMAT_C8,
-	DRM_FORMAT_RGB565,
-	DRM_FORMAT_XRGB8888,
-	DRM_FORMAT_XBGR8888,
-	DRM_FORMAT_ARGB8888,
-	DRM_FORMAT_ABGR8888,
-	DRM_FORMAT_XRGB2101010,
-	DRM_FORMAT_XBGR2101010,
-	DRM_FORMAT_YUYV,
-	DRM_FORMAT_YVYU,
-	DRM_FORMAT_UYVY,
-	DRM_FORMAT_VYUY,
-};
-
-static const uint32_t skl_pri_planar_formats[] = {
-	DRM_FORMAT_C8,
-	DRM_FORMAT_RGB565,
-	DRM_FORMAT_XRGB8888,
-	DRM_FORMAT_XBGR8888,
-	DRM_FORMAT_ARGB8888,
-	DRM_FORMAT_ABGR8888,
-	DRM_FORMAT_XRGB2101010,
-	DRM_FORMAT_XBGR2101010,
-	DRM_FORMAT_YUYV,
-	DRM_FORMAT_YVYU,
-	DRM_FORMAT_UYVY,
-	DRM_FORMAT_VYUY,
-	DRM_FORMAT_NV12,
-};
-
-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,
-	DRM_FORMAT_MOD_LINEAR,
-	DRM_FORMAT_MOD_INVALID
-};
-
 /* Cursor formats */
 static const uint32_t intel_cursor_formats[] = {
 	DRM_FORMAT_ARGB8888,
@@ -13273,57 +13224,6 @@ static bool
 i965_plane_format_mod_supported(struct drm_plane *_plane,
 	}
 }
 
-static bool skl_plane_format_mod_supported(struct drm_plane *_plane,
-					   u32 format, u64 modifier)
-{
-	struct intel_plane *plane = to_intel_plane(_plane);
-
-	switch (modifier) {
-	case DRM_FORMAT_MOD_LINEAR:
-	case I915_FORMAT_MOD_X_TILED:
-	case I915_FORMAT_MOD_Y_TILED:
-	case I915_FORMAT_MOD_Yf_TILED:
-		break;
-	case I915_FORMAT_MOD_Y_TILED_CCS:
-	case I915_FORMAT_MOD_Yf_TILED_CCS:
-		if (!plane->has_ccs)
-			return false;
-		break;
-	default:
-		return false;
-	}
-
-	switch (format) {
-	case DRM_FORMAT_XRGB8888:
-	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:
-	case DRM_FORMAT_YUYV:
-	case DRM_FORMAT_YVYU:
-	case DRM_FORMAT_UYVY:
-	case DRM_FORMAT_VYUY:
-	case DRM_FORMAT_NV12:
-		if (modifier == I915_FORMAT_MOD_Yf_TILED)
-			return true;
-		/* fall through */
-	case DRM_FORMAT_C8:
-		if (modifier == DRM_FORMAT_MOD_LINEAR ||
-		    modifier == I915_FORMAT_MOD_X_TILED ||
-		    modifier == I915_FORMAT_MOD_Y_TILED)
-			return true;
-		/* fall through */
-	default:
-		return false;
-	}
-}
-
 static bool intel_cursor_format_mod_supported(struct drm_plane
 *_plane,

u32 format, u64
modifier)
{

drivers/gpu/drm/i915/intel_display.c +0 -11
@@ -13331,17 +13231,6 @@ static bool
 intel_cursor_format_mod_supported(struct drm_plane *_plane,
 		format == DRM_FORMAT_ARGB8888;
 }
 
-static const struct drm_plane_funcs skl_plane_funcs = {
-	.update_plane = drm_atomic_helper_update_plane,
-	.disable_plane = drm_atomic_helper_disable_plane,
-	.destroy = intel_plane_destroy,
-	.atomic_get_property = intel_plane_atomic_get_property,
-	.atomic_set_property = intel_plane_atomic_set_property,
-	.atomic_duplicate_state = intel_plane_duplicate_state,
-	.atomic_destroy_state = intel_plane_destroy_state,
-	.format_mod_supported = skl_plane_format_mod_supported,
-};
-
 static const struct drm_plane_funcs i965_plane_funcs = {
 	.update_plane = drm_atomic_helper_update_plane,
drivers/gpu/drm/i915/intel_display.c +0 -16
 	.disable_plane = drm_atomic_helper_disable_plane,
@@ -13506,39 +13395,6 @@ static bool i9xx_plane_has_fbc(struct
 drm_i915_private *dev_priv,
 		return i9xx_plane == PLANE_A;
 }
 
-static bool skl_plane_has_fbc(struct drm_i915_private *dev_priv,
-			      enum pipe pipe, enum plane_id
 plane_id)
-{
-	if (!HAS_FBC(dev_priv))
-		return false;
-
-	return pipe == PIPE_A && plane_id == PLANE_PRIMARY;
-}
-
-bool skl_plane_has_planar(struct drm_i915_private *dev_priv,
-			  enum pipe pipe, enum plane_id plane_id)
-{
-	if (plane_id == PLANE_PRIMARY) {
-		if (IS_SKYLAKE(dev_priv) || IS_BROXTON(dev_priv))
-			return false;
-		else if ((INTEL_GEN(dev_priv) == 9 && pipe ==

PIPE_C) &&

drivers/gpu/drm/i915/intel_display.c +0 -6
-			 !IS_GEMINILAKE(dev_priv))
-			return false;
-	} else if (plane_id >= PLANE_SPRITE0) {
-		if (plane_id == PLANE_CURSOR)
-			return false;
-		if (IS_GEMINILAKE(dev_priv) || INTEL_GEN(dev_priv)

== 10) {

drivers/gpu/drm/i915/intel_display.c +0 -4
-			if (plane_id != PLANE_SPRITE0)
-				return false;
-		} else {
-			if (plane_id != PLANE_SPRITE0 || pipe ==

PIPE_C ||

drivers/gpu/drm/i915/intel_display.c +0 -1
-			    IS_SKYLAKE(dev_priv) ||

IS_BROXTON(dev_priv))

drivers/gpu/drm/i915/intel_display.c +0 -6
-				return false;
-		}
-	}
-	return true;
-}
-
 static struct intel_plane *
 intel_primary_plane_create(struct drm_i915_private *dev_priv, enum

pipe pipe)
{

drivers/gpu/drm/i915/intel_display.c +12 -2
@@ -13551,14 +13407,24 @@ intel_primary_plane_create(struct
 drm_i915_private *dev_priv, enum pipe pipe)
 	const uint64_t *modifiers;
 	int ret;
 
+	if (INTEL_GEN(dev_priv) >= 9) {
+		primary = skl_universal_plane_create(dev_priv, pipe,
+						     PLANE_PRIMARY);
+		if (IS_ERR(primary))
+			return primary;
+
+		/* FIXME unify */
+		primary->check_plane = intel_check_primary_plane;
+
+		return primary;
+	}
+
 	primary = intel_plane_alloc();
 	if (IS_ERR(primary))
 		return primary;
 
 	primary->can_scale = false;
 	primary->max_downscale = 1;
-	if (INTEL_GEN(dev_priv) >= 9)
-		primary->can_scale = true;
 	primary->pipe = pipe;
 	/*

* On gen2/3 only plane A can do FBC, but the panel fitter
and LVDS

drivers/gpu/drm/i915/intel_display.c +1 -8
@@ -13571,14 +13437,7 @@ intel_primary_plane_create(struct
 drm_i915_private *dev_priv, enum pipe pipe)
 	primary->id = PLANE_PRIMARY;
 	primary->frontbuffer_bit = INTEL_FRONTBUFFER(pipe, primary-
 >id);
 
-	if (INTEL_GEN(dev_priv) >= 9)
-		primary->has_fbc = skl_plane_has_fbc(dev_priv,
-						     primary->pipe,
-						     primary->id);
-	else
-		primary->has_fbc = i9xx_plane_has_fbc(dev_priv,
-						      primary-
 >i9xx_plane);
-
+	primary->has_fbc = i9xx_plane_has_fbc(dev_priv, primary-
Quoted 1 line

i9xx_plane);

drivers/gpu/drm/i915/intel_display.c +0 -10
 	if (primary->has_fbc) {
 		struct intel_fbc *fbc = &dev_priv->fbc;
@@ -13587,29 +13446,7 @@ intel_primary_plane_create(struct
 drm_i915_private *dev_priv, enum pipe pipe)
 
 	primary->check_plane = intel_check_primary_plane;
 
-	if (INTEL_GEN(dev_priv) >= 9) {
-		primary->has_ccs = skl_plane_has_ccs(dev_priv, pipe,
-						     PLANE_PRIMARY);
-
-		if (skl_plane_has_planar(dev_priv, pipe,
 PLANE_PRIMARY)) {
-			intel_primary_formats =
 skl_pri_planar_formats;
-			num_formats =
 ARRAY_SIZE(skl_pri_planar_formats);
-		} else {
-			intel_primary_formats = skl_primary_formats;
-			num_formats =

ARRAY_SIZE(skl_primary_formats);

drivers/gpu/drm/i915/intel_display.c +1 -19
-		}
-
-		if (primary->has_ccs)
-			modifiers = skl_format_modifiers_ccs;
-		else
-			modifiers = skl_format_modifiers_noccs;
-
-		primary->update_plane = skl_update_plane;
-		primary->disable_plane = skl_disable_plane;
-		primary->get_hw_state = skl_plane_get_hw_state;
-
-		plane_funcs = &skl_plane_funcs;
-	} else if (INTEL_GEN(dev_priv) >= 4) {
+	if (INTEL_GEN(dev_priv) >= 4) {
 		intel_primary_formats = i965_primary_formats;
 		num_formats = ARRAY_SIZE(i965_primary_formats);
 		modifiers = i9xx_format_modifiers;
@@ -13633,14 +13470,7 @@ intel_primary_plane_create(struct
 drm_i915_private *dev_priv, enum pipe pipe)
 
 	possible_crtcs = BIT(pipe);
 
-	if (INTEL_GEN(dev_priv) >= 9)
-		ret = drm_universal_plane_init(&dev_priv->drm,
 &primary->base,
-					       possible_crtcs,
 plane_funcs,
-					       intel_primary_formats
 , num_formats,
-					       modifiers,
-					       DRM_PLANE_TYPE_PRIMAR

Y,

drivers/gpu/drm/i915/intel_display.c +0 -1
-					       "plane 1%c",

pipe_name(pipe));

drivers/gpu/drm/i915/intel_display.c +1 -1
-	else if (INTEL_GEN(dev_priv) >= 5 || IS_G4X(dev_priv))
+	if (INTEL_GEN(dev_priv) >= 5 || IS_G4X(dev_priv))
 		ret = drm_universal_plane_init(&dev_priv->drm,

&primary->base,
possible_crtcs,
plane_funcs,
intel_primary_formats
, num_formats,

drivers/gpu/drm/i915/intel_display.c +1 -10
@@ -13658,16 +13488,7 @@ intel_primary_plane_create(struct
 drm_i915_private *dev_priv, enum pipe pipe)
 	if (ret)
 		goto fail;
 
-	if (INTEL_GEN(dev_priv) >= 10) {
-		supported_rotations =
-			DRM_MODE_ROTATE_0 | DRM_MODE_ROTATE_90 |
-			DRM_MODE_ROTATE_180 | DRM_MODE_ROTATE_270 |
-			DRM_MODE_REFLECT_X;
-	} else if (INTEL_GEN(dev_priv) >= 9) {
-		supported_rotations =
-			DRM_MODE_ROTATE_0 | DRM_MODE_ROTATE_90 |
-			DRM_MODE_ROTATE_180 | DRM_MODE_ROTATE_270;
-	} else if (IS_CHERRYVIEW(dev_priv) && pipe == PIPE_B) {
+	if (IS_CHERRYVIEW(dev_priv) && pipe == PIPE_B) {
 		supported_rotations =
 			DRM_MODE_ROTATE_0 | DRM_MODE_ROTATE_180 |
drivers/gpu/drm/i915/intel_display.c +0 -3
 			DRM_MODE_REFLECT_X;
@@ -13683,15 +13504,6 @@ intel_primary_plane_create(struct
 drm_i915_private *dev_priv, enum pipe pipe)
 						   DRM_MODE_ROTATE_0
 ,
 						   supported_rotatio
 ns);
 
-	if (INTEL_GEN(dev_priv) >= 9)
-		drm_plane_create_color_properties(&primary->base,
-						  BIT(DRM_COLOR_YCBC

R_BT601) |

drivers/gpu/drm/i915/intel_display.c +0 -1
-						  BIT(DRM_COLOR_YCBC

R_BT709),

drivers/gpu/drm/i915/intel_display.c +0 -1
-						  BIT(DRM_COLOR_YCBC

R_LIMITED_RANGE) |

drivers/gpu/drm/i915/intel_display.c +0 -1
-						  BIT(DRM_COLOR_YCBC

R_FULL_RANGE),

drivers/gpu/drm/i915/intel_display.c +0 -1
-						  DRM_COLOR_YCBCR_BT

709,

drivers/gpu/drm/i915/intel_display.c +0 -1
-						  DRM_COLOR_YCBCR_LI

MITED_RANGE);

drivers/gpu/drm/i915/intel_display.c +0 -1
-
 	drm_plane_helper_add(&primary->base,

&intel_plane_helper_funcs);

drivers/gpu/drm/i915/intel_display.c +0 -0
 	return primary;
drivers/gpu/drm/i915/intel_drv.h +3 -9
index 88adf31ef1c2..3d5281a3cf1e 100644
@@ -2081,18 +2081,12 @@ int intel_sprite_set_colorkey_ioctl(struct
 drm_device *dev, void *data,
 				    struct drm_file *file_priv);
 void intel_pipe_update_start(const struct intel_crtc_state
 *new_crtc_state);
 void intel_pipe_update_end(struct intel_crtc_state *new_crtc_state);
-void skl_update_plane(struct intel_plane *plane,
-		      const struct intel_crtc_state *crtc_state,
-		      const struct intel_plane_state *plane_state);
-void skl_disable_plane(struct intel_plane *plane, struct intel_crtc
 *crtc);
-bool skl_plane_get_hw_state(struct intel_plane *plane, enum pipe
 *pipe);
-bool skl_plane_has_ccs(struct drm_i915_private *dev_priv,
-		       enum pipe pipe, enum plane_id plane_id);
 bool intel_format_is_yuv(uint32_t format);
-bool skl_plane_has_planar(struct drm_i915_private *dev_priv,
-			  enum pipe pipe, enum plane_id plane_id);
 struct intel_plane *intel_plane_alloc(void);
 void intel_plane_free(struct intel_plane *plane);
+struct intel_plane *
+skl_universal_plane_create(struct drm_i915_private *dev_priv,
+			   enum pipe pipe, enum plane_id plane_id);
 
 
 /* intel_tv.c */
drivers/gpu/drm/i915/intel_sprite.c +1 -1
index cc78d6b14bf0..21b6ff63d15d 100644
@@ -230,7 +230,7 @@ void intel_pipe_update_end(struct
 intel_crtc_state *new_crtc_state)
 #endif
 }
 
-void
+static void
 skl_update_plane(struct intel_plane *plane,
 		 const struct intel_crtc_state *crtc_state,
drivers/gpu/drm/i915/intel_sprite.c +1 -1
 		 const struct intel_plane_state *plane_state)
@@ -330,7 +330,7 @@ skl_update_plane(struct intel_plane *plane,
 	spin_unlock_irqrestore(&dev_priv->uncore.lock, irqflags);
 }
 
-void
+static void
 skl_disable_plane(struct intel_plane *plane, struct intel_crtc
 *crtc)
 {

struct drm_i915_private *dev_priv = to_i915(plane-

Quoted 1 line

base.dev);

drivers/gpu/drm/i915/intel_sprite.c +1 -1
@@ -348,7 +348,7 @@ skl_disable_plane(struct intel_plane *plane,
 struct intel_crtc *crtc)
 	spin_unlock_irqrestore(&dev_priv->uncore.lock, irqflags);
 }
 
-bool
+static bool
 skl_plane_get_hw_state(struct intel_plane *plane,
 		       enum pipe *pipe)

{

drivers/gpu/drm/i915/intel_sprite.c +16 -2
@@ -1440,8 +1440,41 @@ static const struct drm_plane_funcs
 skl_plane_funcs = {
 	.format_mod_supported = skl_plane_format_mod_supported,
 };
 
-bool skl_plane_has_ccs(struct drm_i915_private *dev_priv,
-		       enum pipe pipe, enum plane_id plane_id)
+static bool skl_plane_has_fbc(struct drm_i915_private *dev_priv,
+			      enum pipe pipe, enum plane_id
 plane_id)
+{
+	if (!HAS_FBC(dev_priv))
+		return false;
+
+	return pipe == PIPE_A && plane_id == PLANE_PRIMARY;
+}
+
+static bool skl_plane_has_planar(struct drm_i915_private *dev_priv,
+				 enum pipe pipe, enum plane_id
 plane_id)
+{
+	if (plane_id == PLANE_PRIMARY) {
+		if (IS_SKYLAKE(dev_priv) || IS_BROXTON(dev_priv))
+			return false;
+		else if ((INTEL_GEN(dev_priv) == 9 && pipe ==

PIPE_C) &&

drivers/gpu/drm/i915/intel_sprite.c +6 -0
+			 !IS_GEMINILAKE(dev_priv))
+			return false;
+	} else if (plane_id >= PLANE_SPRITE0) {
+		if (plane_id == PLANE_CURSOR)
+			return false;
+		if (IS_GEMINILAKE(dev_priv) || INTEL_GEN(dev_priv)

== 10) {

drivers/gpu/drm/i915/intel_sprite.c +4 -0
+			if (plane_id != PLANE_SPRITE0)
+				return false;
+		} else {
+			if (plane_id != PLANE_SPRITE0 || pipe ==

PIPE_C ||

drivers/gpu/drm/i915/intel_sprite.c +1 -0
+			    IS_SKYLAKE(dev_priv) ||

IS_BROXTON(dev_priv))

drivers/gpu/drm/i915/intel_sprite.c +8 -0
+				return false;
+		}
+	}
+	return true;
+}
+
+static bool skl_plane_has_ccs(struct drm_i915_private *dev_priv,
+			      enum pipe pipe, enum plane_id

plane_id)
{

drivers/gpu/drm/i915/intel_sprite.c +56 -0
 	if (plane_id == PLANE_CURSOR)
 		return false;
@@ -1486,6 +1519,98 @@ void intel_plane_free(struct intel_plane
 *plane)
 	kfree(plane);
 }
 
+struct intel_plane *
+skl_universal_plane_create(struct drm_i915_private *dev_priv,
+			   enum pipe pipe, enum plane_id plane_id)
+{
+	struct intel_plane *plane;
+	enum drm_plane_type plane_type;
+	unsigned int supported_rotations;
+	unsigned int possible_crtcs;
+	const u64 *modifiers;
+	const u32 *formats;
+	int num_formats;
+	int ret;
+
+	plane = intel_plane_alloc();
+	if (IS_ERR(plane))
+		return plane;
+
+	plane->pipe = pipe;
+	plane->id = plane_id;
+	plane->frontbuffer_bit = INTEL_FRONTBUFFER(pipe, plane_id);
+
+	plane->can_scale = true;
+
+	plane->has_fbc = skl_plane_has_fbc(dev_priv, pipe,
 plane_id);
+	if (plane->has_fbc) {
+		struct intel_fbc *fbc = &dev_priv->fbc;
+
+		fbc->possible_framebuffer_bits |= plane-
 >frontbuffer_bit;
+	}
+
+	plane->update_plane = skl_update_plane;
+	plane->disable_plane = skl_disable_plane;
+	plane->get_hw_state = skl_plane_get_hw_state;
+
+	if (skl_plane_has_planar(dev_priv, pipe, plane_id)) {
+		formats = skl_planar_formats;
+		num_formats = ARRAY_SIZE(skl_planar_formats);
+	} else {
+		formats = skl_plane_formats;
+		num_formats = ARRAY_SIZE(skl_plane_formats);
+	}
+
+	if (skl_plane_has_ccs(dev_priv, pipe, plane_id))
+		modifiers = skl_plane_format_modifiers_ccs;
+	else
+		modifiers = skl_plane_format_modifiers_noccs;
+
+	if (plane_id == PLANE_PRIMARY)
+		plane_type = DRM_PLANE_TYPE_PRIMARY;
+	else
+		plane_type = DRM_PLANE_TYPE_OVERLAY;
+
+	possible_crtcs = BIT(pipe);
+
+	ret = drm_universal_plane_init(&dev_priv->drm, &plane->base,
+				       possible_crtcs,

&skl_plane_funcs,

drivers/gpu/drm/i915/intel_sprite.c +1 -0
+				       formats, num_formats,

modifiers,

drivers/gpu/drm/i915/intel_sprite.c +19 -0
+				       plane_type,
+				       "plane %d%c", plane_id + 1,
+				       pipe_name(pipe));
+	if (ret)
+		goto fail;
+
+	supported_rotations =
+		DRM_MODE_ROTATE_0 | DRM_MODE_ROTATE_90 |
+		DRM_MODE_ROTATE_180 | DRM_MODE_ROTATE_270;
+
+	if (INTEL_GEN(dev_priv) >= 10)
+		supported_rotations |= DRM_MODE_REFLECT_X;
+
+	drm_plane_create_rotation_property(&plane->base,
+					   DRM_MODE_ROTATE_0,
+					   supported_rotations);
+
+	drm_plane_create_color_properties(&plane->base,
+					  BIT(DRM_COLOR_YCBCR_BT601)

|

drivers/gpu/drm/i915/intel_sprite.c +1 -0
+					  BIT(DRM_COLOR_YCBCR_BT709)

,

drivers/gpu/drm/i915/intel_sprite.c +1 -0
+					  BIT(DRM_COLOR_YCBCR_LIMITE

D_RANGE) |

drivers/gpu/drm/i915/intel_sprite.c +1 -0
+					  BIT(DRM_COLOR_YCBCR_FULL_R

ANGE),

drivers/gpu/drm/i915/intel_sprite.c +2 -0
+					  DRM_COLOR_YCBCR_BT709,
+					  DRM_COLOR_YCBCR_LIMITED_RA

NGE);

drivers/gpu/drm/i915/intel_sprite.c +2 -0
+
+	drm_plane_helper_add(&plane->base,

&intel_plane_helper_funcs);

drivers/gpu/drm/i915/intel_sprite.c +16 -22
+
+	return plane;
+
+fail:
+	intel_plane_free(plane);
+
+	return ERR_PTR(ret);
+}
+
 struct intel_plane *
 intel_sprite_plane_create(struct drm_i915_private *dev_priv,
 			  enum pipe pipe, int plane)
@@ -1499,36 +1624,23 @@ intel_sprite_plane_create(struct
 drm_i915_private *dev_priv,
 	int num_plane_formats;
 	int ret;
 
-	intel_plane = intel_plane_alloc();
-	if (IS_ERR(intel_plane))
-		return intel_plane;
-
 	if (INTEL_GEN(dev_priv) >= 9) {
-		intel_plane->can_scale = true;
-
-		intel_plane->has_ccs = skl_plane_has_ccs(dev_priv,
 pipe,
+		intel_plane = skl_universal_plane_create(dev_priv,
 pipe,
 							 PLANE_SPRIT
 E0 + plane);
+		if (IS_ERR(intel_plane))
+			return intel_plane;
 
-		intel_plane->update_plane = skl_update_plane;
-		intel_plane->disable_plane = skl_disable_plane;
-		intel_plane->get_hw_state = skl_plane_get_hw_state;
+		/* FIXME unify */
+		intel_plane->check_plane = intel_check_sprite_plane;
 
-		if (skl_plane_has_planar(dev_priv, pipe,
-					 PLANE_SPRITE0 + plane)) {
-			plane_formats = skl_planar_formats;
-			num_plane_formats =
 ARRAY_SIZE(skl_planar_formats);
-		} else {
-			plane_formats = skl_plane_formats;
-			num_plane_formats =
 ARRAY_SIZE(skl_plane_formats);
-		}
+		return intel_plane;
+	}
 
-		if (intel_plane->has_ccs)
-			modifiers = skl_plane_format_modifiers_ccs;
-		else
-			modifiers =

skl_plane_format_modifiers_noccs;

drivers/gpu/drm/i915/intel_sprite.c +3 -2
+	intel_plane = intel_plane_alloc();
+	if (IS_ERR(intel_plane))
+		return intel_plane;
 
-		plane_funcs = &skl_plane_funcs;
-	} else if (IS_VALLEYVIEW(dev_priv) ||

IS_CHERRYVIEW(dev_priv)) {

drivers/gpu/drm/i915/intel_sprite.c +2 -10
+	if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) {
 		intel_plane->can_scale = false;
 		intel_plane->max_downscale = 1;
@@ -1581,16 +1693,7 @@ intel_sprite_plane_create(struct
 drm_i915_private *dev_priv,
 		}
 	}
 
-	if (INTEL_GEN(dev_priv) >= 10) {
-		supported_rotations =
-			DRM_MODE_ROTATE_0 | DRM_MODE_ROTATE_90 |
-			DRM_MODE_ROTATE_180 | DRM_MODE_ROTATE_270 |
-			DRM_MODE_REFLECT_X;
-	} else if (INTEL_GEN(dev_priv) >= 9) {
-		supported_rotations =
-			DRM_MODE_ROTATE_0 | DRM_MODE_ROTATE_90 |
-			DRM_MODE_ROTATE_180 | DRM_MODE_ROTATE_270;
-	} else if (IS_CHERRYVIEW(dev_priv) && pipe == PIPE_B) {
+	if (IS_CHERRYVIEW(dev_priv) && pipe == PIPE_B) {
 		supported_rotations =
 			DRM_MODE_ROTATE_0 | DRM_MODE_ROTATE_180 |
drivers/gpu/drm/i915/intel_sprite.c +0 -10
 			DRM_MODE_REFLECT_X;
@@ -1606,20 +1709,12 @@ intel_sprite_plane_create(struct
 drm_i915_private *dev_priv,
 
 	possible_crtcs = BIT(pipe);
 
-	if (INTEL_GEN(dev_priv) >= 9)
-		ret = drm_universal_plane_init(&dev_priv->drm,
 &intel_plane->base,
-					       possible_crtcs,
 plane_funcs,
-					       plane_formats,
 num_plane_formats,
-					       modifiers,
-					       DRM_PLANE_TYPE_OVERLA
 Y,
-					       "plane %d%c", plane +
 2, pipe_name(pipe));
-	else
-		ret = drm_universal_plane_init(&dev_priv->drm,
 &intel_plane->base,
-					       possible_crtcs,

plane_funcs,

drivers/gpu/drm/i915/intel_sprite.c +0 -1
-					       plane_formats,

num_plane_formats,

drivers/gpu/drm/i915/intel_sprite.c +0 -2
-					       modifiers,
-					       DRM_PLANE_TYPE_OVERLA

Y,

drivers/gpu/drm/i915/intel_sprite.c +0 -1
-					       "sprite %c",

sprite_name(pipe, plane));

drivers/gpu/drm/i915/intel_sprite.c +1 -0
+	ret = drm_universal_plane_init(&dev_priv->drm, &intel_plane-
Quoted 1 line

base,

drivers/gpu/drm/i915/intel_sprite.c +2 -0
+				       possible_crtcs, plane_funcs,
+				       plane_formats,

num_plane_formats,

drivers/gpu/drm/i915/intel_sprite.c +3 -0
+				       modifiers,
+				       DRM_PLANE_TYPE_OVERLAY,
+				       "sprite %c",

sprite_name(pipe, plane));

drivers/gpu/drm/i915/intel_sprite.c +0 -0
 	if (ret)
 		goto fail;
Signature · 7 lines
Best Regards,

Lisovskiy Stanislav
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#17 lore raw

PATCH v3 10/12 drm/i915: Simplify skl_plane_has_planar()

In reply to Ville Syrjala

From: Ville Syrjälä <[email protected]>

Untangle skl_plane_has_planar() into a more legible form.

---
 drivers/gpu/drm/i915/intel_sprite.c | 36 +++++++++++++++++-------------------
 1 file changed, 17 insertions(+), 19 deletions(-)
drivers/gpu/drm/i915/intel_sprite.c +17 -19
index 4a46c19098e9..74500c3afc76 100644
@@ -1452,25 +1452,23 @@ static bool skl_plane_has_fbc(struct drm_i915_private *dev_priv,
 static bool skl_plane_has_planar(struct drm_i915_private *dev_priv,
 				 enum pipe pipe, enum plane_id plane_id)
 {
-	if (plane_id == PLANE_PRIMARY) {
-		if (IS_SKYLAKE(dev_priv) || IS_BROXTON(dev_priv))
-			return false;
-		else if ((INTEL_GEN(dev_priv) == 9 && pipe == PIPE_C) &&
-			 !IS_GEMINILAKE(dev_priv))
-			return false;
-	} else if (plane_id >= PLANE_SPRITE0) {
-		if (plane_id == PLANE_CURSOR)
-			return false;
-		if (IS_GEMINILAKE(dev_priv) || INTEL_GEN(dev_priv) == 10) {
-			if (plane_id != PLANE_SPRITE0)
-				return false;
-		} else {
-			if (plane_id != PLANE_SPRITE0 || pipe == PIPE_C ||
-			    IS_SKYLAKE(dev_priv) || IS_BROXTON(dev_priv))
-				return false;
-		}
-	}
-	return true;
+	if (plane_id == PLANE_CURSOR)
+		return false;
+
+	if (IS_SKYLAKE(dev_priv) || IS_BROXTON(dev_priv))
+		return false;
+
+	/* FIXME */
+	if (INTEL_GEN(dev_priv) >= 11)
+		return false;
+
+	if (INTEL_GEN(dev_priv) >= 10 || IS_GEMINILAKE(dev_priv))
+		return plane_id == PLANE_PRIMARY ||
+			plane_id == PLANE_SPRITE0;
+
+	return pipe != PIPE_C &&
+		(plane_id == PLANE_PRIMARY ||
+		 plane_id == PLANE_SPRITE0);
 }
 
 static bool skl_plane_has_ccs(struct drm_i915_private *dev_priv,
Signature · 6 lines
2.16.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#18 lore raw

PATCH v3 11/12 drm/i915: s/intel_plane/plane/ in sprite init

In reply to Ville Syrjala

From: Ville Syrjälä <[email protected]>

Use a more familiar naming pattern for our variables in the sprite plane init function.

v2: Drop the redundant 'plane' from plane_formats and num_planes_formats
too

---
 drivers/gpu/drm/i915/intel_sprite.c | 103 ++++++++++++++++++------------------
 1 file changed, 51 insertions(+), 52 deletions(-)
drivers/gpu/drm/i915/intel_sprite.c +51 -52
index 74500c3afc76..6157e2562f07 100644
@@ -1603,81 +1603,81 @@ skl_universal_plane_create(struct drm_i915_private *dev_priv,
 
 struct intel_plane *
 intel_sprite_plane_create(struct drm_i915_private *dev_priv,
-			  enum pipe pipe, int plane)
+			  enum pipe pipe, int sprite)
 {
-	struct intel_plane *intel_plane;
+	struct intel_plane *plane;
 	const struct drm_plane_funcs *plane_funcs;
 	unsigned long possible_crtcs;
-	const uint32_t *plane_formats;
-	const uint64_t *modifiers;
 	unsigned int supported_rotations;
-	int num_plane_formats;
+	const u64 *modifiers;
+	const u32 *formats;
+	int num_formats;
 	int ret;
 
 	if (INTEL_GEN(dev_priv) >= 9) {
-		intel_plane = skl_universal_plane_create(dev_priv, pipe,
-							 PLANE_SPRITE0 + plane);
-		if (IS_ERR(intel_plane))
-			return intel_plane;
+		plane = skl_universal_plane_create(dev_priv, pipe,
+						   PLANE_SPRITE0 + sprite);
+		if (IS_ERR(plane))
+			return plane;
 
 		/* FIXME unify */
-		intel_plane->check_plane = intel_check_sprite_plane;
+		plane->check_plane = intel_check_sprite_plane;
 
-		return intel_plane;
+		return plane;
 	}
 
-	intel_plane = intel_plane_alloc();
-	if (IS_ERR(intel_plane))
-		return intel_plane;
+	plane = intel_plane_alloc();
+	if (IS_ERR(plane))
+		return plane;
 
 	if (IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) {
-		intel_plane->can_scale = false;
-		intel_plane->max_downscale = 1;
+		plane->can_scale = false;
+		plane->max_downscale = 1;
 
-		intel_plane->update_plane = vlv_update_plane;
-		intel_plane->disable_plane = vlv_disable_plane;
-		intel_plane->get_hw_state = vlv_plane_get_hw_state;
+		plane->update_plane = vlv_update_plane;
+		plane->disable_plane = vlv_disable_plane;
+		plane->get_hw_state = vlv_plane_get_hw_state;
 
-		plane_formats = vlv_plane_formats;
-		num_plane_formats = ARRAY_SIZE(vlv_plane_formats);
+		formats = vlv_plane_formats;
+		num_formats = ARRAY_SIZE(vlv_plane_formats);
 		modifiers = i9xx_plane_format_modifiers;
 
 		plane_funcs = &vlv_sprite_funcs;
 	} else if (INTEL_GEN(dev_priv) >= 7) {
 		if (IS_IVYBRIDGE(dev_priv)) {
-			intel_plane->can_scale = true;
-			intel_plane->max_downscale = 2;
+			plane->can_scale = true;
+			plane->max_downscale = 2;
 		} else {
-			intel_plane->can_scale = false;
-			intel_plane->max_downscale = 1;
+			plane->can_scale = false;
+			plane->max_downscale = 1;
 		}
 
-		intel_plane->update_plane = ivb_update_plane;
-		intel_plane->disable_plane = ivb_disable_plane;
-		intel_plane->get_hw_state = ivb_plane_get_hw_state;
+		plane->update_plane = ivb_update_plane;
+		plane->disable_plane = ivb_disable_plane;
+		plane->get_hw_state = ivb_plane_get_hw_state;
 
-		plane_formats = snb_plane_formats;
-		num_plane_formats = ARRAY_SIZE(snb_plane_formats);
+		formats = snb_plane_formats;
+		num_formats = ARRAY_SIZE(snb_plane_formats);
 		modifiers = i9xx_plane_format_modifiers;
 
 		plane_funcs = &snb_sprite_funcs;
 	} else {
-		intel_plane->can_scale = true;
-		intel_plane->max_downscale = 16;
+		plane->can_scale = true;
+		plane->max_downscale = 16;
 
-		intel_plane->update_plane = g4x_update_plane;
-		intel_plane->disable_plane = g4x_disable_plane;
-		intel_plane->get_hw_state = g4x_plane_get_hw_state;
+		plane->update_plane = g4x_update_plane;
+		plane->disable_plane = g4x_disable_plane;
+		plane->get_hw_state = g4x_plane_get_hw_state;
 
 		modifiers = i9xx_plane_format_modifiers;
 		if (IS_GEN6(dev_priv)) {
-			plane_formats = snb_plane_formats;
-			num_plane_formats = ARRAY_SIZE(snb_plane_formats);
+			formats = snb_plane_formats;
+			num_formats = ARRAY_SIZE(snb_plane_formats);
 
 			plane_funcs = &snb_sprite_funcs;
 		} else {
-			plane_formats = g4x_plane_formats;
-			num_plane_formats = ARRAY_SIZE(g4x_plane_formats);
+			formats = g4x_plane_formats;
+			num_formats = ARRAY_SIZE(g4x_plane_formats);
 
 			plane_funcs = &g4x_sprite_funcs;
 		}
@@ -1692,27 +1692,26 @@ intel_sprite_plane_create(struct drm_i915_private *dev_priv,
 			DRM_MODE_ROTATE_0 | DRM_MODE_ROTATE_180;
 	}
 
-	intel_plane->pipe = pipe;
-	intel_plane->id = PLANE_SPRITE0 + plane;
-	intel_plane->frontbuffer_bit = INTEL_FRONTBUFFER(pipe, intel_plane->id);
-	intel_plane->check_plane = intel_check_sprite_plane;
+	plane->pipe = pipe;
+	plane->id = PLANE_SPRITE0 + sprite;
+	plane->frontbuffer_bit = INTEL_FRONTBUFFER(pipe, plane->id);
+	plane->check_plane = intel_check_sprite_plane;
 
 	possible_crtcs = BIT(pipe);
 
-	ret = drm_universal_plane_init(&dev_priv->drm, &intel_plane->base,
+	ret = drm_universal_plane_init(&dev_priv->drm, &plane->base,
 				       possible_crtcs, plane_funcs,
-				       plane_formats, num_plane_formats,
-				       modifiers,
+				       formats, num_formats, modifiers,
 				       DRM_PLANE_TYPE_OVERLAY,
-				       "sprite %c", sprite_name(pipe, plane));
+				       "sprite %c", sprite_name(pipe, sprite));
 	if (ret)
 		goto fail;
 
-	drm_plane_create_rotation_property(&intel_plane->base,
+	drm_plane_create_rotation_property(&plane->base,
 					   DRM_MODE_ROTATE_0,
 					   supported_rotations);
 
-	drm_plane_create_color_properties(&intel_plane->base,
+	drm_plane_create_color_properties(&plane->base,
 					  BIT(DRM_COLOR_YCBCR_BT601) |
 					  BIT(DRM_COLOR_YCBCR_BT709),
 					  BIT(DRM_COLOR_YCBCR_LIMITED_RANGE) |
@@ -1720,12 +1719,12 @@ intel_sprite_plane_create(struct drm_i915_private *dev_priv,
 					  DRM_COLOR_YCBCR_BT709,
 					  DRM_COLOR_YCBCR_LIMITED_RANGE);
 
-	drm_plane_helper_add(&intel_plane->base, &intel_plane_helper_funcs);
+	drm_plane_helper_add(&plane->base, &intel_plane_helper_funcs);
 
-	return intel_plane;
+	return plane;
 
 fail:
-	intel_plane_free(intel_plane);
+	intel_plane_free(plane);
 
 	return ERR_PTR(ret);
 }
Signature · 6 lines
2.16.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#19 lore raw

PATCH v3 12/12 drm/i915: Rename variables in intel_primary_plane_create()

In reply to Ville Syrjala

From: Ville Syrjälä <[email protected]>

Let's try to stick a common naming pattern in all the plane init funcs.

---
 drivers/gpu/drm/i915/intel_display.c | 86 ++++++++++++++++++------------------
 1 file changed, 42 insertions(+), 44 deletions(-)
drivers/gpu/drm/i915/intel_display.c +42 -44
index 08ae063fecae..5e9e51135086 100644
@@ -13398,72 +13398,72 @@ static bool i9xx_plane_has_fbc(struct drm_i915_private *dev_priv,
 static struct intel_plane *
 intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)
 {
-	struct intel_plane *primary;
+	struct intel_plane *plane;
 	const struct drm_plane_funcs *plane_funcs;
-	const uint32_t *intel_primary_formats;
 	unsigned int supported_rotations;
 	unsigned int possible_crtcs;
-	unsigned int num_formats;
-	const uint64_t *modifiers;
+	const u64 *modifiers;
+	const u32 *formats;
+	int num_formats;
 	int ret;
 
 	if (INTEL_GEN(dev_priv) >= 9) {
-		primary = skl_universal_plane_create(dev_priv, pipe,
-						     PLANE_PRIMARY);
-		if (IS_ERR(primary))
-			return primary;
+		plane = skl_universal_plane_create(dev_priv, pipe,
+						   PLANE_PRIMARY);
+		if (IS_ERR(plane))
+			return plane;
 
 		/* FIXME unify */
-		primary->check_plane = intel_check_primary_plane;
+		plane->check_plane = intel_check_primary_plane;
 
-		return primary;
+		return plane;
 	}
 
-	primary = intel_plane_alloc();
-	if (IS_ERR(primary))
-		return primary;
+	plane = intel_plane_alloc();
+	if (IS_ERR(plane))
+		return plane;
 
-	primary->can_scale = false;
-	primary->max_downscale = 1;
-	primary->pipe = pipe;
+	plane->can_scale = false;
+	plane->max_downscale = 1;
+	plane->pipe = pipe;
 	/*
 	 * On gen2/3 only plane A can do FBC, but the panel fitter and LVDS
 	 * port is hooked to pipe B. Hence we want plane A feeding pipe B.
 	 */
 	if (HAS_FBC(dev_priv) && INTEL_GEN(dev_priv) < 4)
-		primary->i9xx_plane = (enum i9xx_plane_id) !pipe;
+		plane->i9xx_plane = (enum i9xx_plane_id) !pipe;
 	else
-		primary->i9xx_plane = (enum i9xx_plane_id) pipe;
-	primary->id = PLANE_PRIMARY;
-	primary->frontbuffer_bit = INTEL_FRONTBUFFER(pipe, primary->id);
+		plane->i9xx_plane = (enum i9xx_plane_id) pipe;
+	plane->id = PLANE_PRIMARY;
+	plane->frontbuffer_bit = INTEL_FRONTBUFFER(pipe, plane->id);
 
-	primary->has_fbc = i9xx_plane_has_fbc(dev_priv, primary->i9xx_plane);
-	if (primary->has_fbc) {
+	plane->has_fbc = i9xx_plane_has_fbc(dev_priv, plane->i9xx_plane);
+	if (plane->has_fbc) {
 		struct intel_fbc *fbc = &dev_priv->fbc;
 
-		fbc->possible_framebuffer_bits |= primary->frontbuffer_bit;
+		fbc->possible_framebuffer_bits |= plane->frontbuffer_bit;
 	}
 
-	primary->check_plane = intel_check_primary_plane;
+	plane->check_plane = intel_check_primary_plane;
 
 	if (INTEL_GEN(dev_priv) >= 4) {
-		intel_primary_formats = i965_primary_formats;
+		formats = i965_primary_formats;
 		num_formats = ARRAY_SIZE(i965_primary_formats);
 		modifiers = i9xx_format_modifiers;
 
-		primary->update_plane = i9xx_update_plane;
-		primary->disable_plane = i9xx_disable_plane;
-		primary->get_hw_state = i9xx_plane_get_hw_state;
+		plane->update_plane = i9xx_update_plane;
+		plane->disable_plane = i9xx_disable_plane;
+		plane->get_hw_state = i9xx_plane_get_hw_state;
 
 		plane_funcs = &i965_plane_funcs;
 	} else {
-		intel_primary_formats = i8xx_primary_formats;
+		formats = i8xx_primary_formats;
 		num_formats = ARRAY_SIZE(i8xx_primary_formats);
 		modifiers = i9xx_format_modifiers;
 
-		primary->update_plane = i9xx_update_plane;
-		primary->disable_plane = i9xx_disable_plane;
-		primary->get_hw_state = i9xx_plane_get_hw_state;
+		plane->update_plane = i9xx_update_plane;
+		plane->disable_plane = i9xx_disable_plane;
+		plane->get_hw_state = i9xx_plane_get_hw_state;
 
 		plane_funcs = &i8xx_plane_funcs;
 	}
@@ -13471,20 +13471,18 @@ intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)
 	possible_crtcs = BIT(pipe);
 
 	if (INTEL_GEN(dev_priv) >= 5 || IS_G4X(dev_priv))
-		ret = drm_universal_plane_init(&dev_priv->drm, &primary->base,
+		ret = drm_universal_plane_init(&dev_priv->drm, &plane->base,
 					       possible_crtcs, plane_funcs,
-					       intel_primary_formats, num_formats,
-					       modifiers,
+					       formats, num_formats, modifiers,
 					       DRM_PLANE_TYPE_PRIMARY,
 					       "primary %c", pipe_name(pipe));
 	else
-		ret = drm_universal_plane_init(&dev_priv->drm, &primary->base,
+		ret = drm_universal_plane_init(&dev_priv->drm, &plane->base,
 					       possible_crtcs, plane_funcs,
-					       intel_primary_formats, num_formats,
-					       modifiers,
+					       formats, num_formats, modifiers,
 					       DRM_PLANE_TYPE_PRIMARY,
 					       "plane %c",
-					       plane_name(primary->i9xx_plane));
+					       plane_name(plane->i9xx_plane));
 	if (ret)
 		goto fail;
 
@@ -13500,12 +13498,12 @@ intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)
 	}
 
 	if (INTEL_GEN(dev_priv) >= 4)
-		drm_plane_create_rotation_property(&primary->base,
+		drm_plane_create_rotation_property(&plane->base,
 						   DRM_MODE_ROTATE_0,
 						   supported_rotations);
 
 	if (INTEL_GEN(dev_priv) >= 9)
-		drm_plane_create_color_properties(&primary->base,
+		drm_plane_create_color_properties(&plane->base,
 						  BIT(DRM_COLOR_YCBCR_BT601) |
 						  BIT(DRM_COLOR_YCBCR_BT709),
 						  BIT(DRM_COLOR_YCBCR_LIMITED_RANGE) |
@@ -13513,12 +13511,12 @@ intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)
 						  DRM_COLOR_YCBCR_BT709,
 						  DRM_COLOR_YCBCR_LIMITED_RANGE);
 
-	drm_plane_helper_add(&primary->base, &intel_plane_helper_funcs);
+	drm_plane_helper_add(&plane->base, &intel_plane_helper_funcs);
 
-	return primary;
+	return plane;
 
 fail:
-	intel_plane_free(primary);
+	intel_plane_free(plane);
 
 	return ERR_PTR(ret);
 }
Signature · 6 lines
2.16.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#20 lore raw

PATCH v4 12/12 drm/i915: Rename variables in intel_primary_plane_create()

From: Ville Syrjälä <[email protected]>

Let's try to stick a common naming pattern in all the plane init funcs.

v2: Rebase due to color_encoding/range props

---
 drivers/gpu/drm/i915/intel_display.c | 84 ++++++++++++++++++------------------
 1 file changed, 41 insertions(+), 43 deletions(-)
drivers/gpu/drm/i915/intel_display.c +41 -43
index 2549fec31c79..b1b6b65f63a6 100644
@@ -13398,72 +13398,72 @@ static bool i9xx_plane_has_fbc(struct drm_i915_private *dev_priv,
 static struct intel_plane *
 intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)
 {
-	struct intel_plane *primary;
+	struct intel_plane *plane;
 	const struct drm_plane_funcs *plane_funcs;
-	const uint32_t *intel_primary_formats;
 	unsigned int supported_rotations;
 	unsigned int possible_crtcs;
-	unsigned int num_formats;
-	const uint64_t *modifiers;
+	const u64 *modifiers;
+	const u32 *formats;
+	int num_formats;
 	int ret;
 
 	if (INTEL_GEN(dev_priv) >= 9) {
-		primary = skl_universal_plane_create(dev_priv, pipe,
-						     PLANE_PRIMARY);
-		if (IS_ERR(primary))
-			return primary;
+		plane = skl_universal_plane_create(dev_priv, pipe,
+						   PLANE_PRIMARY);
+		if (IS_ERR(plane))
+			return plane;
 
 		/* FIXME unify */
-		primary->check_plane = intel_check_primary_plane;
+		plane->check_plane = intel_check_primary_plane;
 
-		return primary;
+		return plane;
 	}
 
-	primary = intel_plane_alloc();
-	if (IS_ERR(primary))
-		return primary;
+	plane = intel_plane_alloc();
+	if (IS_ERR(plane))
+		return plane;
 
-	primary->can_scale = false;
-	primary->max_downscale = 1;
-	primary->pipe = pipe;
+	plane->can_scale = false;
+	plane->max_downscale = 1;
+	plane->pipe = pipe;
 	/*
 	 * On gen2/3 only plane A can do FBC, but the panel fitter and LVDS
 	 * port is hooked to pipe B. Hence we want plane A feeding pipe B.
 	 */
 	if (HAS_FBC(dev_priv) && INTEL_GEN(dev_priv) < 4)
-		primary->i9xx_plane = (enum i9xx_plane_id) !pipe;
+		plane->i9xx_plane = (enum i9xx_plane_id) !pipe;
 	else
-		primary->i9xx_plane = (enum i9xx_plane_id) pipe;
-	primary->id = PLANE_PRIMARY;
-	primary->frontbuffer_bit = INTEL_FRONTBUFFER(pipe, primary->id);
+		plane->i9xx_plane = (enum i9xx_plane_id) pipe;
+	plane->id = PLANE_PRIMARY;
+	plane->frontbuffer_bit = INTEL_FRONTBUFFER(pipe, plane->id);
 
-	primary->has_fbc = i9xx_plane_has_fbc(dev_priv, primary->i9xx_plane);
-	if (primary->has_fbc) {
+	plane->has_fbc = i9xx_plane_has_fbc(dev_priv, plane->i9xx_plane);
+	if (plane->has_fbc) {
 		struct intel_fbc *fbc = &dev_priv->fbc;
 
-		fbc->possible_framebuffer_bits |= primary->frontbuffer_bit;
+		fbc->possible_framebuffer_bits |= plane->frontbuffer_bit;
 	}
 
-	primary->check_plane = intel_check_primary_plane;
+	plane->check_plane = intel_check_primary_plane;
 
 	if (INTEL_GEN(dev_priv) >= 4) {
-		intel_primary_formats = i965_primary_formats;
+		formats = i965_primary_formats;
 		num_formats = ARRAY_SIZE(i965_primary_formats);
 		modifiers = i9xx_format_modifiers;
 
-		primary->update_plane = i9xx_update_plane;
-		primary->disable_plane = i9xx_disable_plane;
-		primary->get_hw_state = i9xx_plane_get_hw_state;
+		plane->update_plane = i9xx_update_plane;
+		plane->disable_plane = i9xx_disable_plane;
+		plane->get_hw_state = i9xx_plane_get_hw_state;
 
 		plane_funcs = &i965_plane_funcs;
 	} else {
-		intel_primary_formats = i8xx_primary_formats;
+		formats = i8xx_primary_formats;
 		num_formats = ARRAY_SIZE(i8xx_primary_formats);
 		modifiers = i9xx_format_modifiers;
 
-		primary->update_plane = i9xx_update_plane;
-		primary->disable_plane = i9xx_disable_plane;
-		primary->get_hw_state = i9xx_plane_get_hw_state;
+		plane->update_plane = i9xx_update_plane;
+		plane->disable_plane = i9xx_disable_plane;
+		plane->get_hw_state = i9xx_plane_get_hw_state;
 
 		plane_funcs = &i8xx_plane_funcs;
 	}
@@ -13471,20 +13471,18 @@ intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)
 	possible_crtcs = BIT(pipe);
 
 	if (INTEL_GEN(dev_priv) >= 5 || IS_G4X(dev_priv))
-		ret = drm_universal_plane_init(&dev_priv->drm, &primary->base,
+		ret = drm_universal_plane_init(&dev_priv->drm, &plane->base,
 					       possible_crtcs, plane_funcs,
-					       intel_primary_formats, num_formats,
-					       modifiers,
+					       formats, num_formats, modifiers,
 					       DRM_PLANE_TYPE_PRIMARY,
 					       "primary %c", pipe_name(pipe));
 	else
-		ret = drm_universal_plane_init(&dev_priv->drm, &primary->base,
+		ret = drm_universal_plane_init(&dev_priv->drm, &plane->base,
 					       possible_crtcs, plane_funcs,
-					       intel_primary_formats, num_formats,
-					       modifiers,
+					       formats, num_formats, modifiers,
 					       DRM_PLANE_TYPE_PRIMARY,
 					       "plane %c",
-					       plane_name(primary->i9xx_plane));
+					       plane_name(plane->i9xx_plane));
 	if (ret)
 		goto fail;
 
@@ -13500,16 +13498,16 @@ intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)
 	}
 
 	if (INTEL_GEN(dev_priv) >= 4)
-		drm_plane_create_rotation_property(&primary->base,
+		drm_plane_create_rotation_property(&plane->base,
 						   DRM_MODE_ROTATE_0,
 						   supported_rotations);
 
-	drm_plane_helper_add(&primary->base, &intel_plane_helper_funcs);
+	drm_plane_helper_add(&plane->base, &intel_plane_helper_funcs);
 
-	return primary;
+	return plane;
 
 fail:
-	intel_plane_free(primary);
+	intel_plane_free(plane);
 
 	return ERR_PTR(ret);
 }
Signature · 6 lines
2.16.4

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#21 lore raw

Re: [PATCH v3 12/12] drm/i915: Rename variables in intel_primary_plane_create()

In reply to Ville Syrjala
Quoted 5 lines · Ville Syrjala

From: Ville Syrjälä <[email protected]>

Let's try to stick a common naming pattern in all the plane init funcs.

Since you are moving things around, do you think this is a good time to move all plane_create functions to intel_sprite and rename it as intel_plane.c?

Quoted 204 lines
---
 drivers/gpu/drm/i915/intel_display.c | 86 ++++++++++++++++++------
------------
 1 file changed, 42 insertions(+), 44 deletions(-)
drivers/gpu/drm/i915/intel_display.c +16 -16
index 08ae063fecae..5e9e51135086 100644
@@ -13398,72 +13398,72 @@ static bool i9xx_plane_has_fbc(struct
 drm_i915_private *dev_priv,
 static struct intel_plane *
 intel_primary_plane_create(struct drm_i915_private *dev_priv, enum
 pipe pipe)
 {
-	struct intel_plane *primary;
+	struct intel_plane *plane;
 	const struct drm_plane_funcs *plane_funcs;
-	const uint32_t *intel_primary_formats;
 	unsigned int supported_rotations;
 	unsigned int possible_crtcs;
-	unsigned int num_formats;
-	const uint64_t *modifiers;
+	const u64 *modifiers;
+	const u32 *formats;
+	int num_formats;
 	int ret;
 
 	if (INTEL_GEN(dev_priv) >= 9) {
-		primary = skl_universal_plane_create(dev_priv, pipe,
-						     PLANE_PRIMARY);
-		if (IS_ERR(primary))
-			return primary;
+		plane = skl_universal_plane_create(dev_priv, pipe,
+						   PLANE_PRIMARY);
+		if (IS_ERR(plane))
+			return plane;
 
 		/* FIXME unify */
-		primary->check_plane = intel_check_primary_plane;
+		plane->check_plane = intel_check_primary_plane;
 
-		return primary;
+		return plane;
 	}
 
-	primary = intel_plane_alloc();
-	if (IS_ERR(primary))
-		return primary;
+	plane = intel_plane_alloc();
+	if (IS_ERR(plane))
+		return plane;
 
-	primary->can_scale = false;
-	primary->max_downscale = 1;
-	primary->pipe = pipe;
+	plane->can_scale = false;
+	plane->max_downscale = 1;
+	plane->pipe = pipe;
 	/*
 	 * On gen2/3 only plane A can do FBC, but the panel fitter

and LVDS
* port is hooked to pipe B. Hence we want plane A feeding
pipe B.

drivers/gpu/drm/i915/intel_display.c +1 -4
 	 */
 	if (HAS_FBC(dev_priv) && INTEL_GEN(dev_priv) < 4)
-		primary->i9xx_plane = (enum i9xx_plane_id) !pipe;
+		plane->i9xx_plane = (enum i9xx_plane_id) !pipe;
 	else
-		primary->i9xx_plane = (enum i9xx_plane_id) pipe;
-	primary->id = PLANE_PRIMARY;
-	primary->frontbuffer_bit = INTEL_FRONTBUFFER(pipe, primary-
Quoted 1 line

id);

drivers/gpu/drm/i915/intel_display.c +3 -1
+		plane->i9xx_plane = (enum i9xx_plane_id) pipe;
+	plane->id = PLANE_PRIMARY;
+	plane->frontbuffer_bit = INTEL_FRONTBUFFER(pipe, plane->id);
 
-	primary->has_fbc = i9xx_plane_has_fbc(dev_priv, primary-
Quoted 1 line

i9xx_plane);

drivers/gpu/drm/i915/intel_display.c +1 -1
-	if (primary->has_fbc) {
+	plane->has_fbc = i9xx_plane_has_fbc(dev_priv, plane-
Quoted 1 line

i9xx_plane);

drivers/gpu/drm/i915/intel_display.c +1 -1
+	if (plane->has_fbc) {
 		struct intel_fbc *fbc = &dev_priv->fbc;
 
-		fbc->possible_framebuffer_bits |= primary-
Quoted 1 line

frontbuffer_bit;

drivers/gpu/drm/i915/intel_display.c +1 -0
+		fbc->possible_framebuffer_bits |= plane-
Quoted 1 line

frontbuffer_bit;

drivers/gpu/drm/i915/intel_display.c +12 -13
 	}
 
-	primary->check_plane = intel_check_primary_plane;
+	plane->check_plane = intel_check_primary_plane;
 
 	if (INTEL_GEN(dev_priv) >= 4) {
-		intel_primary_formats = i965_primary_formats;
+		formats = i965_primary_formats;
 		num_formats = ARRAY_SIZE(i965_primary_formats);
 		modifiers = i9xx_format_modifiers;
 
-		primary->update_plane = i9xx_update_plane;
-		primary->disable_plane = i9xx_disable_plane;
-		primary->get_hw_state = i9xx_plane_get_hw_state;
+		plane->update_plane = i9xx_update_plane;
+		plane->disable_plane = i9xx_disable_plane;
+		plane->get_hw_state = i9xx_plane_get_hw_state;
 
 		plane_funcs = &i965_plane_funcs;
 	} else {
-		intel_primary_formats = i8xx_primary_formats;
+		formats = i8xx_primary_formats;
 		num_formats = ARRAY_SIZE(i8xx_primary_formats);
 		modifiers = i9xx_format_modifiers;
 
-		primary->update_plane = i9xx_update_plane;
-		primary->disable_plane = i9xx_disable_plane;
-		primary->get_hw_state = i9xx_plane_get_hw_state;
+		plane->update_plane = i9xx_update_plane;
+		plane->disable_plane = i9xx_disable_plane;
+		plane->get_hw_state = i9xx_plane_get_hw_state;
 
 		plane_funcs = &i8xx_plane_funcs;
 	}
@@ -13471,20 +13471,18 @@ intel_primary_plane_create(struct
 drm_i915_private *dev_priv, enum pipe pipe)
 	possible_crtcs = BIT(pipe);
 
 	if (INTEL_GEN(dev_priv) >= 5 || IS_G4X(dev_priv))
-		ret = drm_universal_plane_init(&dev_priv->drm,
 &primary->base,
+		ret = drm_universal_plane_init(&dev_priv->drm,
 &plane->base,
 					       possible_crtcs,
 plane_funcs,
-					       intel_primary_formats
 , num_formats,
-					       modifiers,
+					       formats, num_formats,
 modifiers,
 					       DRM_PLANE_TYPE_PRIMAR
 Y,
 					       "primary %c",
 pipe_name(pipe));
 	else
-		ret = drm_universal_plane_init(&dev_priv->drm,
 &primary->base,
+		ret = drm_universal_plane_init(&dev_priv->drm,

&plane->base,
possible_crtcs,
plane_funcs,

drivers/gpu/drm/i915/intel_display.c +0 -1
-					       intel_primary_formats

, num_formats,

drivers/gpu/drm/i915/intel_display.c +1 -1
-					       modifiers,
+					       formats, num_formats,

modifiers,
DRM_PLANE_TYPE_PRIMAR
Y,

drivers/gpu/drm/i915/intel_display.c +0 -1
 					       "plane %c",
-					       plane_name(primary-
Quoted 1 line

i9xx_plane));

drivers/gpu/drm/i915/intel_display.c +1 -0
+					       plane_name(plane-
Quoted 1 line

i9xx_plane));

drivers/gpu/drm/i915/intel_display.c +2 -2
 	if (ret)
 		goto fail;
@@ -13500,12 +13498,12 @@ intel_primary_plane_create(struct
 drm_i915_private *dev_priv, enum pipe pipe)
 	}
 
 	if (INTEL_GEN(dev_priv) >= 4)
-		drm_plane_create_rotation_property(&primary->base,
+		drm_plane_create_rotation_property(&plane->base,
 						   DRM_MODE_ROTATE_0
 ,
 						   supported_rotatio
 ns);
 
 	if (INTEL_GEN(dev_priv) >= 9)
-		drm_plane_create_color_properties(&primary->base,
+		drm_plane_create_color_properties(&plane->base,

BIT(DRM_COLOR_YCBC
R_BT601) |
BIT(DRM_COLOR_YCBC
R_BT709),
BIT(DRM_COLOR_YCBC
R_LIMITED_RANGE) |

drivers/gpu/drm/i915/intel_display.c +2 -2
@@ -13513,12 +13511,12 @@ intel_primary_plane_create(struct
 drm_i915_private *dev_priv, enum pipe pipe)
 						  DRM_COLOR_YCBCR_BT
 709,
 						  DRM_COLOR_YCBCR_LI
 MITED_RANGE);
 
-	drm_plane_helper_add(&primary->base,
 &intel_plane_helper_funcs);
+	drm_plane_helper_add(&plane->base,
 &intel_plane_helper_funcs);
 
-	return primary;
+	return plane;
 

fail:

drivers/gpu/drm/i915/intel_display.c intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe) · line 13522

Quoted 5 lines
drivers/gpu/drm/i915/intel_display.c +1 -1
-	intel_plane_free(primary);
+	intel_plane_free(plane);
 
 	return ERR_PTR(ret);
 }

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#22 lore raw

Re: [PATCH v3 12/12] drm/i915: Rename variables in intel_primary_plane_create()

Quoted 6 lines · Dhinakaran Pandiyan
Quoted 2 lines · Ville Syrjala

From: Ville Syrjälä <[email protected]>

Quoted 7 lines
Quoted 3 lines

Let's try to stick a common naming pattern in all the plane init funcs.

Since you are moving things around, do you think this is a good time to move all plane_create functions to intel_sprite and rename it as intel_plane.c?

Yes. I've been thinking of moving most plane related code out from intel_display.c. We might even go a step further and have two files for pre-skl vs. skl+.

Quoted 212 lines
Quoted 212 lines
---
 drivers/gpu/drm/i915/intel_display.c | 86 ++++++++++++++++++------
------------
 1 file changed, 42 insertions(+), 44 deletions(-)
drivers/gpu/drm/i915/intel_display.c +16 -16
index 08ae063fecae..5e9e51135086 100644
@@ -13398,72 +13398,72 @@ static bool i9xx_plane_has_fbc(struct
 drm_i915_private *dev_priv,
 static struct intel_plane *
 intel_primary_plane_create(struct drm_i915_private *dev_priv, enum
 pipe pipe)
 {
-	struct intel_plane *primary;
+	struct intel_plane *plane;
 	const struct drm_plane_funcs *plane_funcs;
-	const uint32_t *intel_primary_formats;
 	unsigned int supported_rotations;
 	unsigned int possible_crtcs;
-	unsigned int num_formats;
-	const uint64_t *modifiers;
+	const u64 *modifiers;
+	const u32 *formats;
+	int num_formats;
 	int ret;
 
 	if (INTEL_GEN(dev_priv) >= 9) {
-		primary = skl_universal_plane_create(dev_priv, pipe,
-						     PLANE_PRIMARY);
-		if (IS_ERR(primary))
-			return primary;
+		plane = skl_universal_plane_create(dev_priv, pipe,
+						   PLANE_PRIMARY);
+		if (IS_ERR(plane))
+			return plane;
 
 		/* FIXME unify */
-		primary->check_plane = intel_check_primary_plane;
+		plane->check_plane = intel_check_primary_plane;
 
-		return primary;
+		return plane;
 	}
 
-	primary = intel_plane_alloc();
-	if (IS_ERR(primary))
-		return primary;
+	plane = intel_plane_alloc();
+	if (IS_ERR(plane))
+		return plane;
 
-	primary->can_scale = false;
-	primary->max_downscale = 1;
-	primary->pipe = pipe;
+	plane->can_scale = false;
+	plane->max_downscale = 1;
+	plane->pipe = pipe;
 	/*
 	 * On gen2/3 only plane A can do FBC, but the panel fitter

and LVDS
* port is hooked to pipe B. Hence we want plane A feeding
pipe B.

drivers/gpu/drm/i915/intel_display.c +1 -4
 	 */
 	if (HAS_FBC(dev_priv) && INTEL_GEN(dev_priv) < 4)
-		primary->i9xx_plane = (enum i9xx_plane_id) !pipe;
+		plane->i9xx_plane = (enum i9xx_plane_id) !pipe;
 	else
-		primary->i9xx_plane = (enum i9xx_plane_id) pipe;
-	primary->id = PLANE_PRIMARY;
-	primary->frontbuffer_bit = INTEL_FRONTBUFFER(pipe, primary-
Quoted 1 line

id);

drivers/gpu/drm/i915/intel_display.c +3 -1
+		plane->i9xx_plane = (enum i9xx_plane_id) pipe;
+	plane->id = PLANE_PRIMARY;
+	plane->frontbuffer_bit = INTEL_FRONTBUFFER(pipe, plane->id);
 
-	primary->has_fbc = i9xx_plane_has_fbc(dev_priv, primary-
Quoted 1 line

i9xx_plane);

drivers/gpu/drm/i915/intel_display.c +1 -1
-	if (primary->has_fbc) {
+	plane->has_fbc = i9xx_plane_has_fbc(dev_priv, plane-
Quoted 1 line

i9xx_plane);

drivers/gpu/drm/i915/intel_display.c +1 -1
+	if (plane->has_fbc) {
 		struct intel_fbc *fbc = &dev_priv->fbc;
 
-		fbc->possible_framebuffer_bits |= primary-
Quoted 1 line

frontbuffer_bit;

drivers/gpu/drm/i915/intel_display.c +1 -0
+		fbc->possible_framebuffer_bits |= plane-
Quoted 1 line

frontbuffer_bit;

drivers/gpu/drm/i915/intel_display.c +12 -13
 	}
 
-	primary->check_plane = intel_check_primary_plane;
+	plane->check_plane = intel_check_primary_plane;
 
 	if (INTEL_GEN(dev_priv) >= 4) {
-		intel_primary_formats = i965_primary_formats;
+		formats = i965_primary_formats;
 		num_formats = ARRAY_SIZE(i965_primary_formats);
 		modifiers = i9xx_format_modifiers;
 
-		primary->update_plane = i9xx_update_plane;
-		primary->disable_plane = i9xx_disable_plane;
-		primary->get_hw_state = i9xx_plane_get_hw_state;
+		plane->update_plane = i9xx_update_plane;
+		plane->disable_plane = i9xx_disable_plane;
+		plane->get_hw_state = i9xx_plane_get_hw_state;
 
 		plane_funcs = &i965_plane_funcs;
 	} else {
-		intel_primary_formats = i8xx_primary_formats;
+		formats = i8xx_primary_formats;
 		num_formats = ARRAY_SIZE(i8xx_primary_formats);
 		modifiers = i9xx_format_modifiers;
 
-		primary->update_plane = i9xx_update_plane;
-		primary->disable_plane = i9xx_disable_plane;
-		primary->get_hw_state = i9xx_plane_get_hw_state;
+		plane->update_plane = i9xx_update_plane;
+		plane->disable_plane = i9xx_disable_plane;
+		plane->get_hw_state = i9xx_plane_get_hw_state;
 
 		plane_funcs = &i8xx_plane_funcs;
 	}
@@ -13471,20 +13471,18 @@ intel_primary_plane_create(struct
 drm_i915_private *dev_priv, enum pipe pipe)
 	possible_crtcs = BIT(pipe);
 
 	if (INTEL_GEN(dev_priv) >= 5 || IS_G4X(dev_priv))
-		ret = drm_universal_plane_init(&dev_priv->drm,
 &primary->base,
+		ret = drm_universal_plane_init(&dev_priv->drm,
 &plane->base,
 					       possible_crtcs,
 plane_funcs,
-					       intel_primary_formats
 , num_formats,
-					       modifiers,
+					       formats, num_formats,
 modifiers,
 					       DRM_PLANE_TYPE_PRIMAR
 Y,
 					       "primary %c",
 pipe_name(pipe));
 	else
-		ret = drm_universal_plane_init(&dev_priv->drm,
 &primary->base,
+		ret = drm_universal_plane_init(&dev_priv->drm,

&plane->base,
possible_crtcs,
plane_funcs,

drivers/gpu/drm/i915/intel_display.c +0 -1
-					       intel_primary_formats

, num_formats,

drivers/gpu/drm/i915/intel_display.c +1 -1
-					       modifiers,
+					       formats, num_formats,

modifiers,
DRM_PLANE_TYPE_PRIMAR
Y,

drivers/gpu/drm/i915/intel_display.c +0 -1
 					       "plane %c",
-					       plane_name(primary-
Quoted 1 line

i9xx_plane));

drivers/gpu/drm/i915/intel_display.c +1 -0
+					       plane_name(plane-
Quoted 1 line

i9xx_plane));

drivers/gpu/drm/i915/intel_display.c +2 -2
 	if (ret)
 		goto fail;
@@ -13500,12 +13498,12 @@ intel_primary_plane_create(struct
 drm_i915_private *dev_priv, enum pipe pipe)
 	}
 
 	if (INTEL_GEN(dev_priv) >= 4)
-		drm_plane_create_rotation_property(&primary->base,
+		drm_plane_create_rotation_property(&plane->base,
 						   DRM_MODE_ROTATE_0
 ,
 						   supported_rotatio
 ns);
 
 	if (INTEL_GEN(dev_priv) >= 9)
-		drm_plane_create_color_properties(&primary->base,
+		drm_plane_create_color_properties(&plane->base,

BIT(DRM_COLOR_YCBC
R_BT601) |
BIT(DRM_COLOR_YCBC
R_BT709),
BIT(DRM_COLOR_YCBC
R_LIMITED_RANGE) |

drivers/gpu/drm/i915/intel_display.c +2 -2
@@ -13513,12 +13511,12 @@ intel_primary_plane_create(struct
 drm_i915_private *dev_priv, enum pipe pipe)
 						  DRM_COLOR_YCBCR_BT
 709,
 						  DRM_COLOR_YCBCR_LI
 MITED_RANGE);
 
-	drm_plane_helper_add(&primary->base,
 &intel_plane_helper_funcs);
+	drm_plane_helper_add(&plane->base,
 &intel_plane_helper_funcs);
 
-	return primary;
+	return plane;
 

fail:

drivers/gpu/drm/i915/intel_display.c +1 -1
-	intel_plane_free(primary);
+	intel_plane_free(plane);
 
 	return ERR_PTR(ret);
 }
Signature · 6 lines
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#23 lore raw

✗ Fi.CI.CHECKPATCH: warning for drm/i915: Some plane init cleanups

In reply to Ville Syrjala
== Series Details ==

== Series Details ==

Series: drm/i915: Some plane init cleanups
URL : https://patchwork.freedesktop.org/series/44104/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
bb943e33dcbe drm/i915: Constify all plane_funcs structs
4f6d16bcf869 drm/i915: Populate possible_crtcs for primary/cursor planes
e0a1a095982c drm/i915: Don't populate plane->i9xx_plane for sprites
aac10dbedbfb drm/i915: Allow horizontal mirroring for cnl+ "sprite" planes
f62eebbf98c0 drm/i915: Disallow plane scaling with specific pixel formats
200c194879aa drm/i915: Add missing pixel formats for skl+ "sprites"
5863eff46968 drm/i915: Move plane_state->scaler_id initialization into intel_create_plane_state()
261058ce4eda drm/i915: Introduce intel_plane_alloc()
f77caf348219 drm/i915: Extract skl_universal_plane_init()
bdbed3766875 drm/i915: Simplify skl_plane_has_planar()
91e98cde51e8 drm/i915: s/intel_plane/plane/ in sprite init
1e6423f433c7 drm/i915: Rename variables in intel_primary_plane_create()
-:71: CHECK:SPACING: No space is necessary after a cast
#71: FILE: drivers/gpu/drm/i915/intel_display.c:13434:
+		plane->i9xx_plane = (enum i9xx_plane_id) !pipe;

-:76: CHECK:SPACING: No space is necessary after a cast #76: FILE: drivers/gpu/drm/i915/intel_display.c:13436:
+ plane->i9xx_plane = (enum i9xx_plane_id) pipe;

total: 0 errors, 0 warnings, 2 checks, 158 lines checked

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#24 lore raw

✓ Fi.CI.BAT: success for drm/i915: Some plane init cleanups

In reply to Ville Syrjala
== Series Details ==

== Series Details ==

Series: drm/i915: Some plane init cleanups
URL : https://patchwork.freedesktop.org/series/44104/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4272 -> Patchwork_9173 =

== Summary - SUCCESS ==

No regressions found.

External URL: https://patchwork.freedesktop.org/api/1.0/series/44104/revisions/1/mbox/

== Known issues ==

Here are the changes found in Patchwork_9173 that come from known issues:

=== IGT changes ===

    ==== Issues hit ====

    igt@drv_module_reload@basic-reload-inject:
      fi-glk-j4005:       PASS -> DMESG-WARN (fdo#106248, fdo#106725)

    igt@kms_flip@basic-flip-vs-modeset:
      fi-glk-j4005:       PASS -> DMESG-WARN (fdo#106000) +1

    igt@kms_flip@basic-flip-vs-wf_vblank:
      fi-cnl-y3:          PASS -> INCOMPLETE (fdo#105086)
      fi-glk-j4005:       PASS -> FAIL (fdo#100368)
      fi-skl-6770hq:      PASS -> FAIL (fdo#103928, fdo#100368)

    igt@kms_pipe_crc_basic@suspend-read-crc-pipe-b:
      fi-snb-2520m:       PASS -> INCOMPLETE (fdo#103713)

    
    ==== Possible fixes ====

    igt@kms_busy@basic-flip-a:
      fi-glk-j4005:       DMESG-WARN (fdo#106000) -> PASS

    igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
      fi-cnl-psr:         DMESG-WARN (fdo#104951) -> PASS

fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713
fdo#103928 https://bugs.freedesktop.org/show_bug.cgi?id=103928
fdo#104951 https://bugs.freedesktop.org/show_bug.cgi?id=104951
fdo#105086 https://bugs.freedesktop.org/show_bug.cgi?id=105086
fdo#106000 https://bugs.freedesktop.org/show_bug.cgi?id=106000
fdo#106248 https://bugs.freedesktop.org/show_bug.cgi?id=106248
fdo#106725 https://bugs.freedesktop.org/show_bug.cgi?id=106725

== Participating hosts (44 -> 39) ==

Missing (5): fi-ctg-p8600 fi-ilk-m540 fi-byt-squawks fi-skl-gvtdvm fi-skl-6700hq

== Build changes ==

* Linux: CI_DRM_4272 -> Patchwork_9173

CI_DRM_4272: 3b9c62ebdab50cf4e3587eb080f9f126932e3f69 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4505: 8a8f0271a71e2e0d2a2caa4d41f4ad1d9c89670e @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_9173: 1e6423f433c7b2f37d5cb1c8b4fc19a2e9f0e27b @ git://anongit.freedesktop.org/gfx-ci/linux

== Linux commits ==

1e6423f433c7 drm/i915: Rename variables in intel_primary_plane_create() 91e98cde51e8 drm/i915: s/intel_plane/plane/ in sprite init
bdbed3766875 drm/i915: Simplify skl_plane_has_planar()
f77caf348219 drm/i915: Extract skl_universal_plane_init()
261058ce4eda drm/i915: Introduce intel_plane_alloc()
5863eff46968 drm/i915: Move plane_state->scaler_id initialization into intel_create_plane_state() 200c194879aa drm/i915: Add missing pixel formats for skl+ "sprites"
f62eebbf98c0 drm/i915: Disallow plane scaling with specific pixel formats aac10dbedbfb drm/i915: Allow horizontal mirroring for cnl+ "sprite" planes e0a1a095982c drm/i915: Don't populate plane->i9xx_plane for sprites
4f6d16bcf869 drm/i915: Populate possible_crtcs for primary/cursor planes bb943e33dcbe drm/i915: Constify all plane_funcs structs

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_9173/issues.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#25 lore raw

✗ Fi.CI.CHECKPATCH: warning for drm/i915: Some plane init cleanups (rev3)

In reply to Ville Syrjala
== Series Details ==

== Series Details ==

Series: drm/i915: Some plane init cleanups (rev3)
URL : https://patchwork.freedesktop.org/series/44104/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
af017bc71198 drm/i915: Constify all plane_funcs structs
06b012de49a5 drm/i915: Populate possible_crtcs for primary/cursor planes
f4e539977c8a drm/i915: Don't populate plane->i9xx_plane for sprites
2a857d83e179 drm/i915: Allow horizontal mirroring for cnl+ "sprite" planes
36e24d305cae drm/i915: Disallow plane scaling with specific pixel formats
bde47b9067bc drm/i915: Add missing pixel formats for skl+ "sprites"
00c3c30cc2bd drm/i915: Move plane_state->scaler_id initialization into intel_create_plane_state()
f18f22bce321 drm/i915: Introduce intel_plane_alloc()
95a52e8bcbac drm/i915: Extract skl_universal_plane_init()
94591e981ccb drm/i915: Simplify skl_plane_has_planar()
4cbfda80f4df drm/i915: s/intel_plane/plane/ in sprite init
e52c9fb3b1ef drm/i915: Rename variables in intel_primary_plane_create()
-:73: CHECK:SPACING: No space is necessary after a cast
#73: FILE: drivers/gpu/drm/i915/intel_display.c:13434:
+		plane->i9xx_plane = (enum i9xx_plane_id) !pipe;

-:78: CHECK:SPACING: No space is necessary after a cast #78: FILE: drivers/gpu/drm/i915/intel_display.c:13436:
+ plane->i9xx_plane = (enum i9xx_plane_id) pipe;

total: 0 errors, 0 warnings, 2 checks, 149 lines checked

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#26 lore raw

✓ Fi.CI.BAT: success for drm/i915: Some plane init cleanups (rev3)

In reply to Ville Syrjala
== Series Details ==

== Series Details ==

Series: drm/i915: Some plane init cleanups (rev3)
URL : https://patchwork.freedesktop.org/series/44104/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4272 -> Patchwork_9174 =

== Summary - SUCCESS ==

No regressions found.

External URL: https://patchwork.freedesktop.org/api/1.0/series/44104/revisions/3/mbox/

== Known issues ==

Here are the changes found in Patchwork_9174 that come from known issues:

=== IGT changes ===

    ==== Issues hit ====

    igt@kms_flip@basic-flip-vs-wf_vblank:
      fi-glk-j4005:       PASS -> FAIL (fdo#100368)

    igt@kms_pipe_crc_basic@read-crc-pipe-c:
      fi-glk-j4005:       PASS -> DMESG-WARN (fdo#106000)

    
    ==== Possible fixes ====

    igt@kms_busy@basic-flip-a:
      fi-glk-j4005:       DMESG-WARN (fdo#106000) -> PASS

    igt@kms_pipe_crc_basic@suspend-read-crc-pipe-a:
      fi-cnl-psr:         DMESG-WARN (fdo#104951) -> PASS

fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#104951 https://bugs.freedesktop.org/show_bug.cgi?id=104951
fdo#106000 https://bugs.freedesktop.org/show_bug.cgi?id=106000

== Participating hosts (44 -> 39) ==

Missing (5): fi-ctg-p8600 fi-ilk-m540 fi-byt-squawks fi-skl-gvtdvm fi-skl-6700hq

== Build changes ==

* Linux: CI_DRM_4272 -> Patchwork_9174

CI_DRM_4272: 3b9c62ebdab50cf4e3587eb080f9f126932e3f69 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4505: 8a8f0271a71e2e0d2a2caa4d41f4ad1d9c89670e @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_9174: e52c9fb3b1ef41df03fa84916eb307f96fd2de85 @ git://anongit.freedesktop.org/gfx-ci/linux

== Linux commits ==

e52c9fb3b1ef drm/i915: Rename variables in intel_primary_plane_create() 4cbfda80f4df drm/i915: s/intel_plane/plane/ in sprite init
94591e981ccb drm/i915: Simplify skl_plane_has_planar()
95a52e8bcbac drm/i915: Extract skl_universal_plane_init()
f18f22bce321 drm/i915: Introduce intel_plane_alloc()
00c3c30cc2bd drm/i915: Move plane_state->scaler_id initialization into intel_create_plane_state() bde47b9067bc drm/i915: Add missing pixel formats for skl+ "sprites"
36e24d305cae drm/i915: Disallow plane scaling with specific pixel formats 2a857d83e179 drm/i915: Allow horizontal mirroring for cnl+ "sprite" planes f4e539977c8a drm/i915: Don't populate plane->i9xx_plane for sprites
06b012de49a5 drm/i915: Populate possible_crtcs for primary/cursor planes af017bc71198 drm/i915: Constify all plane_funcs structs

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_9174/issues.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#27 lore raw

✓ Fi.CI.IGT: success for drm/i915: Some plane init cleanups

In reply to Ville Syrjala
== Series Details ==

== Series Details ==

Series: drm/i915: Some plane init cleanups
URL : https://patchwork.freedesktop.org/series/44104/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4272_full -> Patchwork_9173_full =

== Summary - WARNING ==

Minor unknown changes coming with Patchwork_9173_full need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in Patchwork_9173_full, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.

External URL: https://patchwork.freedesktop.org/api/1.0/series/44104/revisions/1/mbox/

== Possible new issues ==

Here are the unknown changes that may have been introduced in Patchwork_9173_full:

=== IGT changes ===

    ==== Warnings ====

    igt@gem_exec_schedule@deep-render:
      shard-kbl:          SKIP -> PASS

    igt@kms_ccs@pipe-a-ccs-on-another-bo:
      shard-glk:          PASS -> SKIP +14

    igt@kms_ccs@pipe-b-bad-pixel-format:
      shard-apl:          PASS -> SKIP +13

    igt@kms_ccs@pipe-b-missing-ccs-buffer:
      shard-kbl:          PASS -> SKIP +17

== Known issues ==

Here are the changes found in Patchwork_9173_full that come from known issues:

=== IGT changes ===

    ==== Issues hit ====

    igt@drv_selftest@live_gtt:
      shard-kbl:          PASS -> INCOMPLETE (fdo#103665)

    igt@gem_eio@suspend:
      shard-snb:          PASS -> INCOMPLETE (fdo#105411) +1

    igt@kms_cursor_legacy@flip-vs-cursor-varying-size:
      shard-hsw:          PASS -> FAIL (fdo#102670)

    igt@kms_flip@2x-flip-vs-absolute-wf_vblank-interruptible:
      shard-glk:          PASS -> FAIL (fdo#100368)

    igt@kms_flip_tiling@flip-to-x-tiled:
      shard-glk:          PASS -> FAIL (fdo#104724)

    igt@kms_flip_tiling@flip-y-tiled:
      shard-glk:          PASS -> FAIL (fdo#103822, fdo#104724)

    igt@kms_setmode@basic:
      shard-kbl:          PASS -> FAIL (fdo#99912)

    
    ==== Possible fixes ====

    igt@kms_ccs@pipe-a-crc-sprite-planes-basic:
      shard-apl:          FAIL (fdo#106510) -> SKIP +1

    igt@kms_flip@2x-dpms-vs-vblank-race:
      shard-hsw:          FAIL (fdo#103060) -> PASS

    igt@kms_flip@2x-flip-vs-wf_vblank:
      shard-glk:          FAIL (fdo#103928) -> PASS

    igt@kms_flip@2x-plain-flip-ts-check:
      shard-hsw:          FAIL (fdo#100368) -> PASS

    igt@kms_flip@flip-vs-expired-vblank-interruptible:
      shard-hsw:          FAIL (fdo#102887, fdo#105363) -> PASS

    igt@kms_frontbuffer_tracking@fbc-1p-primscrn-pri-shrfb-draw-render:
      shard-apl:          DMESG-WARN (fdo#106247) -> PASS

fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#102670 https://bugs.freedesktop.org/show_bug.cgi?id=102670
fdo#102887 https://bugs.freedesktop.org/show_bug.cgi?id=102887
fdo#103060 https://bugs.freedesktop.org/show_bug.cgi?id=103060
fdo#103665 https://bugs.freedesktop.org/show_bug.cgi?id=103665
fdo#103822 https://bugs.freedesktop.org/show_bug.cgi?id=103822
fdo#103928 https://bugs.freedesktop.org/show_bug.cgi?id=103928
fdo#104724 https://bugs.freedesktop.org/show_bug.cgi?id=104724
fdo#105363 https://bugs.freedesktop.org/show_bug.cgi?id=105363
fdo#105411 https://bugs.freedesktop.org/show_bug.cgi?id=105411
fdo#106247 https://bugs.freedesktop.org/show_bug.cgi?id=106247
fdo#106510 https://bugs.freedesktop.org/show_bug.cgi?id=106510
fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912

== Participating hosts (5 -> 5) ==

No changes in participating hosts

== Build changes ==

* Linux: CI_DRM_4272 -> Patchwork_9173

CI_DRM_4272: 3b9c62ebdab50cf4e3587eb080f9f126932e3f69 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4505: 8a8f0271a71e2e0d2a2caa4d41f4ad1d9c89670e @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_9173: 1e6423f433c7b2f37d5cb1c8b4fc19a2e9f0e27b @ git://anongit.freedesktop.org/gfx-ci/linux

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_9173/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#28 lore raw

✓ Fi.CI.IGT: success for drm/i915: Some plane init cleanups (rev3)

In reply to Ville Syrjala
== Series Details ==

== Series Details ==

Series: drm/i915: Some plane init cleanups (rev3)
URL : https://patchwork.freedesktop.org/series/44104/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4272_full -> Patchwork_9174_full =

== Summary - WARNING ==

Minor unknown changes coming with Patchwork_9174_full need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in Patchwork_9174_full, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.

External URL: https://patchwork.freedesktop.org/api/1.0/series/44104/revisions/3/mbox/

== Possible new issues ==

Here are the unknown changes that may have been introduced in Patchwork_9174_full:

=== IGT changes ===

    ==== Warnings ====

    igt@gem_exec_schedule@deep-render:
      shard-kbl:          SKIP -> PASS

    igt@kms_ccs@pipe-a-ccs-on-another-bo:
      shard-glk:          PASS -> SKIP +14

    igt@kms_ccs@pipe-b-bad-pixel-format:
      shard-apl:          PASS -> SKIP +13

    igt@kms_ccs@pipe-b-missing-ccs-buffer:
      shard-kbl:          PASS -> SKIP +15

== Known issues ==

Here are the changes found in Patchwork_9174_full that come from known issues:

=== IGT changes ===

    ==== Issues hit ====

    igt@gem_eio@suspend:
      shard-snb:          PASS -> INCOMPLETE (fdo#105411)

    igt@kms_flip@2x-flip-vs-expired-vblank:
      shard-hsw:          PASS -> FAIL (fdo#105363)

    igt@kms_flip_tiling@flip-to-x-tiled:
      shard-glk:          PASS -> FAIL (fdo#104724)

    igt@kms_setmode@basic:
      shard-apl:          PASS -> FAIL (fdo#99912)
      shard-kbl:          PASS -> FAIL (fdo#99912)

    igt@perf@polling:
      shard-hsw:          PASS -> FAIL (fdo#102252)

    
    ==== Possible fixes ====

    igt@drv_selftest@live_gtt:
      shard-apl:          INCOMPLETE (fdo#103927) -> PASS

    igt@drv_selftest@live_hangcheck:
      shard-kbl:          DMESG-FAIL (fdo#106560) -> PASS

    igt@gem_ppgtt@blt-vs-render-ctx0:
      shard-kbl:          INCOMPLETE (fdo#106023, fdo#103665) -> PASS

    igt@kms_ccs@pipe-a-crc-sprite-planes-basic:
      shard-apl:          FAIL (fdo#106510) -> SKIP +1

    igt@kms_flip@2x-flip-vs-wf_vblank:
      shard-glk:          FAIL (fdo#103928) -> PASS

    igt@kms_flip@2x-plain-flip-ts-check:
      shard-hsw:          FAIL (fdo#100368) -> PASS

    igt@kms_flip@flip-vs-expired-vblank-interruptible:
      shard-hsw:          FAIL (fdo#105363, fdo#102887) -> PASS

    igt@kms_flip@plain-flip-fb-recreate-interruptible:
      shard-glk:          FAIL (fdo#100368) -> PASS

    igt@kms_flip_tiling@flip-to-y-tiled:
      shard-glk:          FAIL (fdo#104724, fdo#103822) -> PASS

    igt@kms_frontbuffer_tracking@fbc-1p-primscrn-pri-shrfb-draw-render:
      shard-apl:          DMESG-WARN (fdo#106247) -> PASS

fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#102252 https://bugs.freedesktop.org/show_bug.cgi?id=102252
fdo#102887 https://bugs.freedesktop.org/show_bug.cgi?id=102887
fdo#103665 https://bugs.freedesktop.org/show_bug.cgi?id=103665
fdo#103822 https://bugs.freedesktop.org/show_bug.cgi?id=103822
fdo#103927 https://bugs.freedesktop.org/show_bug.cgi?id=103927
fdo#103928 https://bugs.freedesktop.org/show_bug.cgi?id=103928
fdo#104724 https://bugs.freedesktop.org/show_bug.cgi?id=104724
fdo#105363 https://bugs.freedesktop.org/show_bug.cgi?id=105363
fdo#105411 https://bugs.freedesktop.org/show_bug.cgi?id=105411
fdo#106023 https://bugs.freedesktop.org/show_bug.cgi?id=106023
fdo#106247 https://bugs.freedesktop.org/show_bug.cgi?id=106247
fdo#106510 https://bugs.freedesktop.org/show_bug.cgi?id=106510
fdo#106560 https://bugs.freedesktop.org/show_bug.cgi?id=106560
fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912

== Participating hosts (5 -> 5) ==

No changes in participating hosts

== Build changes ==

* Linux: CI_DRM_4272 -> Patchwork_9174

CI_DRM_4272: 3b9c62ebdab50cf4e3587eb080f9f126932e3f69 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4505: 8a8f0271a71e2e0d2a2caa4d41f4ad1d9c89670e @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_9174: e52c9fb3b1ef41df03fa84916eb307f96fd2de85 @ git://anongit.freedesktop.org/gfx-ci/linux

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_9174/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reviewed-by on the v3 series
#29 lore raw
In reply to Ville Syrjala
Quoted 12 lines · Ville Syrjala

From: Ville Syrjälä <[email protected]>

Another version of these cleansup. Last time there was some kind of smtp
fail when sending and patchwork got confused at the wonky threading. So
best to repost fully I thought. Additionally I had to resolve a lot of
rebase confilicts and I spotted a few NV12 related things I missed the
last time around.

Quoted 14 lines

Ville Syrjälä (12):
drm/i915: Constify all plane_funcs structs drm/i915: Populate possible_crtcs for primary/cursor planes drm/i915: Don't populate plane->i9xx_plane for sprites drm/i915: Allow horizontal mirroring for cnl+ "sprite" planes drm/i915: Disallow plane scaling with specific pixel formats drm/i915: Add missing pixel formats for skl+ "sprites" drm/i915: Move plane_state->scaler_id initialization into
intel_create_plane_state()
drm/i915: Introduce intel_plane_alloc()
drm/i915: Extract skl_universal_plane_init() drm/i915: Simplify skl_plane_has_planar()
drm/i915: s/intel_plane/plane/ in sprite init drm/i915: Rename variables in intel_primary_plane_create()

Quoted 9 lines
 drivers/gpu/drm/i915/intel_atomic_plane.c |   1 +
 drivers/gpu/drm/i915/intel_display.c      | 334 ++++++------------
--------
 drivers/gpu/drm/i915/intel_drv.h          |  16 +-
 drivers/gpu/drm/i915/intel_sprite.c       | 374
++++++++++++++++++++----------
 4 files changed, 322 insertions(+), 403 deletions(-)
Signature · 7 lines
Best Regards,

Lisovskiy Stanislav
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx