[Intel-gfx] [PATCH 1/2] drm/i915: Use anonymous union/struct to save space taken by latency values

Damien Lespiau damien.lespiau at intel.com
Fri Sep 5 14:53:11 CEST 2014


Suggested-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau at intel.com>
---
 drivers/gpu/drm/i915/i915_drv.h | 38 +++++++++++++++++++++-----------------
 1 file changed, 21 insertions(+), 17 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 0baf7f3..8471d12 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -1730,23 +1730,27 @@ struct drm_i915_private {
 	struct vlv_s0ix_state vlv_s0ix_state;
 
 	struct {
-		/*
-		 * Raw watermark latency values:
-		 * in 0.1us units for WM0,
-		 * in 0.5us units for WM1+.
-		 */
-		/* primary */
-		uint16_t pri_latency[5];
-		/* sprite */
-		uint16_t spr_latency[5];
-		/* cursor */
-		uint16_t cur_latency[5];
-		/*
-		 * Raw watermark memory latency values
-		 * for SKL for all 8 levels
-		 * in 1us units.
-		 */
-		uint16_t skl_latency[8];
+		union {
+			/*
+			 * Raw watermark latency values:
+			 * in 0.1us units for WM0,
+			 * in 0.5us units for WM1+.
+			 */
+			struct {
+				/* primary */
+				uint16_t pri_latency[5];
+				/* sprite */
+				uint16_t spr_latency[5];
+				/* cursor */
+				uint16_t cur_latency[5];
+			};
+
+			/*
+			 * Raw watermark memory latency values for SKL for all
+			 * 8 levels. In 1us units.
+			 */
+			uint16_t skl_latency[8];
+		};
 
 		/*
 		 * The skl_wm_values structure is a bit too big for stack
-- 
1.8.3.1




More information about the Intel-gfx mailing list