All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matt Roper <matthew.d.roper@intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 04/15] drm/i915: Determine I915_MAX_PLANES from plane enum
Date: Thu, 24 Sep 2015 15:53:09 -0700	[thread overview]
Message-ID: <1443135200-9870-5-git-send-email-matthew.d.roper@intel.com> (raw)
In-Reply-To: <1443135200-9870-1-git-send-email-matthew.d.roper@intel.com>

Let the compiler figure out what I915_MAX_PLANES is from 'enum plane' so
that we don't need a separate #define.

While we're at it, add the cursor plane to the enum.  This will cause
I915_MAX_PLANES to now include the cursor plane in its count (it didn't
previously).   This change is safe since we currently only use this
value in array declarations (never in the actual code logic); we just
wind up allocating slightly more memory than we need to.  A followup
patch will cause various parts of the code to start using the extra
array element where appropriate.

(This patch probably should have been squashed with the followup patch,
but I couldn't figure out how to get Coccinelle to modify enum
declarations...)

Suggested-by: Ander Conselvan De Oliveira <conselvan2@gmail.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_drv.h | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 2b5d587..eac9414 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -131,17 +131,17 @@ enum transcoder {
 #define transcoder_name(t) ((t) + 'A')
 
 /*
- * This is the maximum (across all platforms) number of planes (primary +
- * sprites) that can be active at the same time on one pipe.
- *
- * This value doesn't count the cursor plane.
+ * I915_MAX_PLANES in the enum below is the maximum (across all platforms)
+ * number of planes per CRTC.  Not all platforms really have this many planes,
+ * which means some arrays of size I915_MAX_PLANES may have unused entries
+ * between the topmost sprite plane and the cursor plane.
  */
-#define I915_MAX_PLANES	4
-
 enum plane {
 	PLANE_A = 0,
 	PLANE_B,
 	PLANE_C,
+	PLANE_CURSOR,
+	I915_MAX_PLANES,
 };
 #define plane_name(p) ((p) + 'A')
 
-- 
2.1.4

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

  parent reply	other threads:[~2015-09-24 22:53 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-24 22:53 [PATCH 00/15] Atomic watermark updates (v5) Matt Roper
2015-09-24 22:53 ` [PATCH 01/15] drm/i915: Drop redundant watermark programming Matt Roper
2015-09-24 22:53 ` [PATCH 02/15] drm/i915: Eliminate usage of plane_wm_parameters from ILK-style WM code (v2) Matt Roper
2016-01-05 12:49   ` Flicker caused by "drm/i915: Eliminate usage of plane_wm_parameters from ILK-style WM code (v2)" Jan Niehusmann
2016-01-05 21:58     ` Matt Roper
2016-01-06  0:46       ` Jan Niehusmann
2015-09-24 22:53 ` [PATCH 03/15] drm/i915: Eliminate usage of pipe_wm_parameters from ILK-style WM (v2) Matt Roper
2015-09-24 22:53 ` Matt Roper [this message]
2015-09-24 22:53 ` [PATCH 05/15] drm/i915/skl: Simplify wm structures slightly (v2) Matt Roper
2015-09-30 15:13   ` Daniel Vetter
2015-09-24 22:53 ` [PATCH 06/15] drm/i915/skl: Eliminate usage of pipe_wm_parameters from SKL-style WM (v3) Matt Roper
2015-09-24 22:53 ` [PATCH 07/15] drm/i915/ivb: Move WaCxSRDisabledForSpriteScaling w/a to atomic check Matt Roper
2015-09-24 22:53 ` [PATCH 08/15] drm/i915: Drop intel_update_sprite_watermarks Matt Roper
2015-09-24 22:53 ` [PATCH 09/15] drm/i915: Refactor ilk_update_wm (v3) Matt Roper
2015-09-24 22:53 ` [PATCH 10/15] drm/i915: Calculate pipe watermarks into CRTC state (v3) Matt Roper
2015-09-24 22:53 ` [PATCH 11/15] drm/i915: Calculate ILK-style watermarks during atomic check (v3) Matt Roper
2015-09-24 22:53 ` [PATCH 12/15] drm/i915: Don't set plane visible during HW readout if CRTC is off Matt Roper
2015-09-24 22:53 ` [PATCH 13/15] drm/i915: Calculate watermark configuration during atomic check (v2) Matt Roper
2015-09-24 22:53 ` [PATCH 14/15] drm/i915: Sanitize watermarks after hardware state readout Matt Roper
2015-10-01 13:58   ` Jani Nikula
2015-10-01 16:12     ` Daniel Vetter
2015-10-01 16:53     ` [PATCH] drm/i915: Convert hsw_compute_linetime_wm to use in-flight state Matt Roper
2015-10-06 14:34       ` Jani Nikula
2015-09-24 22:53 ` [PATCH 15/15] drm/i915: Add two-stage ILK-style watermark programming (v5) Matt Roper
2015-09-30 15:20 ` [PATCH 00/15] Atomic watermark updates (v5) Daniel Vetter
2015-09-30 22:21   ` Zanoni, Paulo R
2015-10-01 23:03     ` [PATCH] fixup! drm/i915/skl: Eliminate usage of pipe_wm_parameters from SKL-style WM (v3) Matt Roper
2015-10-02 18:43       ` Zanoni, Paulo R
2015-10-06 10:13         ` [PATCH] fixup! drm/i915/skl: Eliminate usage of pipe_wm_parameters from SKL-style WM (v3) [regression] Daniel Vetter

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=1443135200-9870-5-git-send-email-matthew.d.roper@intel.com \
    --to=matthew.d.roper@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.