All of lore.kernel.org
 help / color / mirror / Atom feed
From: ville.syrjala@linux.intel.com
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 02/14] drm/i915: Use skl_plane_ctl() for the SKL "sprite" planes
Date: Fri, 17 Mar 2017 23:17:56 +0200	[thread overview]
Message-ID: <20170317211808.14693-3-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20170317211808.14693-1-ville.syrjala@linux.intel.com>

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

On SKL the planes are uniform so the "sprites" can use the
primary plane code perfectly fine. The only difference we
have is the color key handling, but since we never enable that
for the primary plane the same code works just fine.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 16 +++++++++++-----
 drivers/gpu/drm/i915/intel_drv.h     |  5 ++---
 drivers/gpu/drm/i915/intel_sprite.c  | 18 +-----------------
 3 files changed, 14 insertions(+), 25 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 6ddf5c90d15c..8a9f1bd21e0e 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -3254,7 +3254,7 @@ u32 skl_plane_stride(const struct drm_framebuffer *fb, int plane,
 	return stride;
 }
 
-u32 skl_plane_ctl_format(uint32_t pixel_format)
+static u32 skl_plane_ctl_format(uint32_t pixel_format)
 {
 	switch (pixel_format) {
 	case DRM_FORMAT_C8:
@@ -3295,7 +3295,7 @@ u32 skl_plane_ctl_format(uint32_t pixel_format)
 	return 0;
 }
 
-u32 skl_plane_ctl_tiling(uint64_t fb_modifier)
+static u32 skl_plane_ctl_tiling(uint64_t fb_modifier)
 {
 	switch (fb_modifier) {
 	case DRM_FORMAT_MOD_NONE:
@@ -3313,7 +3313,7 @@ u32 skl_plane_ctl_tiling(uint64_t fb_modifier)
 	return 0;
 }
 
-u32 skl_plane_ctl_rotation(unsigned int rotation)
+static u32 skl_plane_ctl_rotation(unsigned int rotation)
 {
 	switch (rotation) {
 	case DRM_ROTATE_0:
@@ -3335,13 +3335,14 @@ u32 skl_plane_ctl_rotation(unsigned int rotation)
 	return 0;
 }
 
-static u32 skl_plane_ctl(const struct intel_crtc_state *crtc_state,
-			 const struct intel_plane_state *plane_state)
+u32 skl_plane_ctl(const struct intel_crtc_state *crtc_state,
+		  const struct intel_plane_state *plane_state)
 {
 	struct drm_i915_private *dev_priv =
 		to_i915(plane_state->base.plane->dev);
 	const struct drm_framebuffer *fb = plane_state->base.fb;
 	unsigned int rotation = plane_state->base.rotation;
+	const struct drm_intel_sprite_colorkey *key = &plane_state->ckey;
 	u32 plane_ctl;
 
 	plane_ctl = PLANE_CTL_ENABLE;
@@ -3357,6 +3358,11 @@ static u32 skl_plane_ctl(const struct intel_crtc_state *crtc_state,
 	plane_ctl |= skl_plane_ctl_tiling(fb->modifier);
 	plane_ctl |= skl_plane_ctl_rotation(rotation);
 
+	if (key->flags & I915_SET_COLORKEY_DESTINATION)
+		plane_ctl |= PLANE_CTL_KEY_ENABLE_DESTINATION;
+	else if (key->flags & I915_SET_COLORKEY_SOURCE)
+		plane_ctl |= PLANE_CTL_KEY_ENABLE_SOURCE;
+
 	return plane_ctl;
 }
 
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 51228fe4283b..45e55b45e772 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -1445,9 +1445,8 @@ static inline u32 intel_plane_ggtt_offset(const struct intel_plane_state *state)
 	return i915_ggtt_offset(state->vma);
 }
 
-u32 skl_plane_ctl_format(uint32_t pixel_format);
-u32 skl_plane_ctl_tiling(uint64_t fb_modifier);
-u32 skl_plane_ctl_rotation(unsigned int rotation);
+u32 skl_plane_ctl(const struct intel_crtc_state *crtc_state,
+		  const struct intel_plane_state *plane_state);
 u32 skl_plane_stride(const struct drm_framebuffer *fb, int plane,
 		     unsigned int rotation);
 int skl_check_plane_surface(struct intel_plane_state *plane_state);
diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
index b931d0bd7a64..455a9ed44204 100644
--- a/drivers/gpu/drm/i915/intel_sprite.c
+++ b/drivers/gpu/drm/i915/intel_sprite.c
@@ -232,23 +232,7 @@ skl_update_plane(struct drm_plane *drm_plane,
 	uint32_t src_h = drm_rect_height(&plane_state->base.src) >> 16;
 	unsigned long irqflags;
 
-	plane_ctl = PLANE_CTL_ENABLE;
-
-	if (!IS_GEMINILAKE(dev_priv)) {
-		plane_ctl |=
-			PLANE_CTL_PIPE_GAMMA_ENABLE |
-			PLANE_CTL_PIPE_CSC_ENABLE |
-			PLANE_CTL_PLANE_GAMMA_DISABLE;
-	}
-
-	plane_ctl |= skl_plane_ctl_format(fb->format->format);
-	plane_ctl |= skl_plane_ctl_tiling(fb->modifier);
-	plane_ctl |= skl_plane_ctl_rotation(rotation);
-
-	if (key->flags & I915_SET_COLORKEY_DESTINATION)
-		plane_ctl |= PLANE_CTL_KEY_ENABLE_DESTINATION;
-	else if (key->flags & I915_SET_COLORKEY_SOURCE)
-		plane_ctl |= PLANE_CTL_KEY_ENABLE_SOURCE;
+	plane_ctl = skl_plane_ctl(crtc_state, plane_state);
 
 	/* Sizes are 0 based */
 	src_w--;
-- 
2.10.2

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

  parent reply	other threads:[~2017-03-17 21:18 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-17 21:17 [PATCH 00/14] drm/i915: Moar plane update optimizations ville.syrjala
2017-03-17 21:17 ` [PATCH 01/14] drm/i915: Extract skl_plane_ctl() ville.syrjala
2017-03-17 21:46   ` Chris Wilson
2017-03-17 21:17 ` ville.syrjala [this message]
2017-03-17 21:48   ` [PATCH 02/14] drm/i915: Use skl_plane_ctl() for the SKL "sprite" planes Chris Wilson
2017-03-20 16:09     ` Ville Syrjälä
2017-03-20 16:16       ` Chris Wilson
2017-03-17 21:17 ` [PATCH 03/14] drm/i915: Extract i9xx_plane_ctl() ville.syrjala
2017-03-17 21:50   ` Chris Wilson
2017-03-20 16:47   ` [PATCH v2 03/14] drm/i915: Extract i9xx_plane_ctl() and ironlake_plane_ctl() ville.syrjala
2017-03-20 16:47     ` [PATCH 03.5/14] drm/i915: Nuke ironlake_plane_ctl() ville.syrjala
2017-03-17 21:17 ` [PATCH 04/14] drm/i915: Extract vlv_sprite_ctl() ville.syrjala
2017-03-17 21:51   ` Chris Wilson
2017-03-17 21:17 ` [PATCH 05/14] drm/i915: Extract ivb_sprite_ctl() ville.syrjala
2017-03-17 21:54   ` Chris Wilson
2017-03-17 21:18 ` [PATCH 06/14] drm/i915: Extract ilk_sprite_ctl() ville.syrjala
2017-03-17 21:54   ` Chris Wilson
2017-03-17 21:18 ` [PATCH 07/14] drm/i915: Extract i845_cursor_ctl() and i9xx_cursor_ctl() ville.syrjala
2017-03-17 21:58   ` Chris Wilson
2017-03-17 21:18 ` [PATCH 08/14] drm/i915: Pre-compute plane control register value ville.syrjala
2017-03-17 22:01   ` Chris Wilson
2017-03-17 21:18 ` [PATCH 09/14] drm/i915: Introduce i9xx_check_plane_surface() ville.syrjala
2017-03-17 22:04   ` Chris Wilson
2017-03-20 17:07     ` Ville Syrjälä
2017-03-20 17:33       ` Chris Wilson
2017-03-17 21:18 ` [PATCH 10/14] drm/i915: Eliminate ironlake_update_primary_plane() ville.syrjala
2017-03-17 22:06   ` Chris Wilson
2017-03-17 21:18 ` [PATCH 11/14] drm/i915: Use i9xx_check_plane_surface() for sprite planes as well ville.syrjala
2017-03-17 21:18 ` [PATCH 12/14] drm/i915: Keep vblanks enabled during the entire pipe update ville.syrjala
2017-03-17 21:28   ` Chris Wilson
2017-03-17 21:18 ` [RFC][PATCH 13/14] WIP/drm/i915: Protect the entire pipe update with uncore.lock ville.syrjala
2017-03-17 21:32   ` Chris Wilson
2017-03-17 21:18 ` [RFC][PATCH 14/14] WIP/drm/i915: Nuke posting reads from plane updates ville.syrjala
2017-03-17 22:12   ` Chris Wilson
2017-03-22 10:42     ` Maarten Lankhorst
2017-03-17 21:36 ` ✓ Fi.CI.BAT: success for drm/i915: Moar plane update optimizations Patchwork
2017-03-20 16:49 ` ✗ Fi.CI.BAT: failure for drm/i915: Moar plane update optimizations (rev3) Patchwork
2017-03-23 14:06 ` [PATCH 00/14] drm/i915: Moar plane update optimizations Ville Syrjälä

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170317211808.14693-3-ville.syrjala@linux.intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.