dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Matt Roper <matthew.d.roper@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Subject: [PATCH 2/7] drm/i915: Allow intel_plane_disable() to operate on all plane types
Date: Thu, 13 Nov 2014 10:43:21 -0800	[thread overview]
Message-ID: <1415904206-22548-3-git-send-email-matthew.d.roper@intel.com> (raw)
In-Reply-To: <1415904206-22548-1-git-send-email-matthew.d.roper@intel.com>

We'll want to call this from the type-agnostic atomic plane helper
hooks.  Since it's not sprite-specific anymore, more it to
intel_display.c as well.

Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 21 +++++++++++++++++++++
 drivers/gpu/drm/i915/intel_drv.h     |  3 ++-
 drivers/gpu/drm/i915/intel_sprite.c  | 10 +---------
 3 files changed, 24 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index a9f90b8..c6598e9 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -13679,3 +13679,24 @@ void intel_modeset_preclose(struct drm_device *dev, struct drm_file *file)
 		spin_unlock_irq(&dev->event_lock);
 	}
 }
+
+void intel_plane_disable(struct drm_plane *plane)
+{
+	if (!plane->crtc || !plane->fb)
+		return;
+
+	switch (plane->type) {
+	case DRM_PLANE_TYPE_PRIMARY:
+		intel_primary_plane_disable(plane);
+		break;
+	case DRM_PLANE_TYPE_CURSOR:
+		intel_cursor_plane_disable(plane);
+		break;
+	case DRM_PLANE_TYPE_OVERLAY:
+		intel_disable_plane(plane);
+		break;
+	default:
+		WARN(1, "Unknown plane type");
+	}
+}
+
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index bd5ef4e..df1420b 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -920,6 +920,7 @@ void intel_prepare_page_flip(struct drm_device *dev, int plane);
 void intel_finish_page_flip(struct drm_device *dev, int pipe);
 void intel_finish_page_flip_plane(struct drm_device *dev, int plane);
 void intel_check_page_flip(struct drm_device *dev, int pipe);
+void intel_plane_disable(struct drm_plane *plane);
 
 /* shared dpll functions */
 struct intel_shared_dpll *intel_crtc_to_shared_dpll(struct intel_crtc *crtc);
@@ -1180,7 +1181,6 @@ int intel_plane_set_property(struct drm_plane *plane,
 			     struct drm_property *prop,
 			     uint64_t val);
 int intel_plane_restore(struct drm_plane *plane);
-void intel_plane_disable(struct drm_plane *plane);
 int intel_sprite_set_colorkey(struct drm_device *dev, void *data,
 			      struct drm_file *file_priv);
 int intel_sprite_get_colorkey(struct drm_device *dev, void *data,
@@ -1188,6 +1188,7 @@ int intel_sprite_get_colorkey(struct drm_device *dev, void *data,
 bool intel_pipe_update_start(struct intel_crtc *crtc,
 			     uint32_t *start_vbl_count);
 void intel_pipe_update_end(struct intel_crtc *crtc, u32 start_vbl_count);
+int intel_disable_plane(struct drm_plane *plane);
 
 /* intel_tv.c */
 void intel_tv_init(struct drm_device *dev);
diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
index fc96d13..115acd3 100644
--- a/drivers/gpu/drm/i915/intel_sprite.c
+++ b/drivers/gpu/drm/i915/intel_sprite.c
@@ -1425,7 +1425,7 @@ intel_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
 	return 0;
 }
 
-static int
+int
 intel_disable_plane(struct drm_plane *plane)
 {
 	struct drm_device *dev = plane->dev;
@@ -1576,14 +1576,6 @@ int intel_plane_restore(struct drm_plane *plane)
 				  intel_plane->src_w, intel_plane->src_h);
 }
 
-void intel_plane_disable(struct drm_plane *plane)
-{
-	if (!plane->crtc || !plane->fb)
-		return;
-
-	intel_disable_plane(plane);
-}
-
 static const struct drm_plane_funcs intel_plane_funcs = {
 	.update_plane = intel_update_plane,
 	.disable_plane = intel_disable_plane,
-- 
1.8.5.1

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

  parent reply	other threads:[~2014-11-13 18:43 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-13 18:43 [PATCH 0/7] i915 atomic plane helper conversion Matt Roper
2014-11-13 18:43 ` [PATCH 1/7] drm/i915: Make intel_plane_state subclass drm_plane_state Matt Roper
2014-11-13 21:25   ` Bob Paauwe
2014-11-13 18:43 ` Matt Roper [this message]
2014-11-13 19:11   ` [PATCH 2/7] drm/i915: Allow intel_plane_disable() to operate on all plane types Bob Paauwe
2014-11-13 19:12     ` Matt Roper
2014-11-13 19:44       ` Bob Paauwe
2014-11-13 19:23     ` Ville Syrjälä
2014-11-13 22:15       ` Matt Roper
2014-11-13 18:43 ` [PATCH 3/7] drm/i915: Clarify sprite plane function names Matt Roper
2014-11-13 21:26   ` [Intel-gfx] " Bob Paauwe
2014-11-13 18:43 ` [PATCH 4/7] drm/i915: Make intel_crtc_has_pending_flip() non-static Matt Roper
2014-11-13 21:27   ` Bob Paauwe
2014-11-13 18:43 ` [PATCH 5/7] drm/i915: Prepare for atomic plane helpers Matt Roper
2014-11-13 19:46   ` Bob Paauwe
2014-11-13 21:31     ` Matt Roper
2014-11-13 22:51   ` [PATCH 5/8] drm/i915: Prepare for atomic plane helpers (v2) Matt Roper
2014-11-14  1:23     ` Matt Roper
2014-11-14  7:48       ` Daniel Vetter
2014-11-13 18:43 ` [PATCH 6/7] drm/i915: Switch plane handling to atomic helpers Matt Roper
2014-11-13 21:28   ` Bob Paauwe
2014-11-13 22:52   ` [PATCH 6/8] drm/i915: Switch plane handling to atomic helpers (v2) Matt Roper
2014-11-14  9:39   ` [Intel-gfx] [PATCH 6/7] drm/i915: Switch plane handling to atomic helpers Ville Syrjälä
2014-11-13 18:43 ` [PATCH 7/7] drm/i915: Drop unused position fields Matt Roper
2014-11-13 21:28   ` Bob Paauwe
2014-11-13 22:53 ` [PATCH 8/8] drm/i915: Integrate kerneldoc for atomic plane helpers Matt Roper

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=1415904206-22548-3-git-send-email-matthew.d.roper@intel.com \
    --to=matthew.d.roper@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

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

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