drm/i915: Don't use enums for hardware engine id
authorMichal Wajdeczko <michal.wajdeczko@intel.com>
Wed, 1 Mar 2017 20:26:15 +0000 (20:26 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Fri, 3 Mar 2017 22:54:21 +0000 (22:54 +0000)
Generally we are using macros for any hardware identifiers as these
may change between Gens. Do the same with hardware engine ids.

v2: move hw engine defs to i915_reg.h (Chris)

Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Link: http://patchwork.freedesktop.org/patch/msgid/20170301202615.118632-1-michal.wajdeczko@intel.com
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
drivers/gpu/drm/i915/i915_reg.h
drivers/gpu/drm/i915/intel_engine_cs.c
drivers/gpu/drm/i915/intel_ringbuffer.h

index 0d9ae27fddff977a20a8a1e7c7aaf95802637fec..243050ea4938803701206c8b8b4b6b033abf5a65 100644 (file)
@@ -77,7 +77,13 @@ static inline bool i915_mmio_reg_valid(i915_reg_t reg)
 #define _MASKED_BIT_ENABLE(a)  ({ typeof(a) _a = (a); _MASKED_FIELD(_a, _a); })
 #define _MASKED_BIT_DISABLE(a) (_MASKED_FIELD((a), 0))
 
+/* Engine ID */
 
+#define RCS_HW         0
+#define VCS_HW         1
+#define BCS_HW         2
+#define VECS_HW                3
+#define VCS2_HW                4
 
 /* PCI config space */
 
index 5fd4883db2358270258a2f503a3d25ef15c527dd..73fe718516a5adf7250a2c30bd2fab856a134f4a 100644 (file)
@@ -28,8 +28,8 @@
 
 static const struct engine_info {
        const char *name;
-       unsigned exec_id;
-       enum intel_engine_hw_id hw_id;
+       unsigned int exec_id;
+       unsigned int hw_id;
        u32 mmio_base;
        unsigned irq_shift;
        int (*init_legacy)(struct intel_engine_cs *engine);
index 9d6b83a16cc81070f520ad2381c4e2661ff54b33..0ef491df5b4e8011fdf557becd05fb696385ff89 100644 (file)
@@ -186,26 +186,26 @@ struct i915_ctx_workarounds {
 struct drm_i915_gem_request;
 struct intel_render_state;
 
+/*
+ * Engine IDs definitions.
+ * Keep instances of the same type engine together.
+ */
+enum intel_engine_id {
+       RCS = 0,
+       BCS,
+       VCS,
+       VCS2,
+#define _VCS(n) (VCS + (n))
+       VECS
+};
+
 struct intel_engine_cs {
        struct drm_i915_private *i915;
        const char      *name;
-       enum intel_engine_id {
-               RCS = 0,
-               BCS,
-               VCS,
-               VCS2,   /* Keep instances of the same type engine together. */
-               VECS
-       } id;
-#define _VCS(n) (VCS + (n))
+       enum intel_engine_id id;
        unsigned int exec_id;
-       enum intel_engine_hw_id {
-               RCS_HW = 0,
-               VCS_HW,
-               BCS_HW,
-               VECS_HW,
-               VCS2_HW
-       } hw_id;
-       enum intel_engine_hw_id guc_id; /* XXX same as hw_id? */
+       unsigned int hw_id;
+       unsigned int guc_id;
        u32             mmio_base;
        unsigned int irq_shift;
        struct intel_ring *buffer;