]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
drm/i915: Add the predicate source registers to the register whitelist
authorNeil Roberts <neil@linux.intel.com>
Fri, 7 Nov 2014 19:00:26 +0000 (19:00 +0000)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 14 Nov 2014 09:29:24 +0000 (10:29 +0100)
The predicate source registers are needed to implement conditional
rendering without stalling. The two source registers are used to load
the previous values of the PS_DEPTH_COUNT register saved from
PIPE_CONTROL commands. These can then be compared and used to set the
predicate enable bit via the MI_PREDICATE command.

The command parser version number is increased to 2 to make it easier
to detect the new functionality in user space.

Signed-off-by: Neil Roberts <neil@linux.intel.com>
Reviewed-by: Brad Volkin <bradley.d.volkin@intel.com> (v1)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_cmd_parser.c
drivers/gpu/drm/i915/i915_reg.h

index 809bb957b4522d495c59359fb0705b6238cd4da1..22c992a78ac6a86dd976bbe106c140fa61814b67 100644 (file)
@@ -413,6 +413,8 @@ static const u32 gen7_render_regs[] = {
        REG64(PS_INVOCATION_COUNT),
        REG64(PS_DEPTH_COUNT),
        OACONTROL, /* Only allowed for LRI and SRM. See below. */
+       REG64(MI_PREDICATE_SRC0),
+       REG64(MI_PREDICATE_SRC1),
        GEN7_3DPRIM_END_OFFSET,
        GEN7_3DPRIM_START_VERTEX,
        GEN7_3DPRIM_VERTEX_COUNT,
@@ -1072,6 +1074,8 @@ int i915_cmd_parser_get_version(void)
         *
         * 1. Initial version. Checks batches and reports violations, but leaves
         *    hardware parsing enabled (so does not allow new use cases).
+        * 2. Allow access to the MI_PREDICATE_SRC0 and
+        *    MI_PREDICATE_SRC1 registers.
         */
-       return 1;
+       return 2;
 }
index 97d3479ad92e12f8b38961bf80fa69f32285575f..35cfc16814c0e4ac28cc33fa9878e8d6fdcfd40d 100644 (file)
 #define   MI_BATCH_GTT             (2<<6) /* aliased with (1<<7) on gen4 */
 #define MI_BATCH_BUFFER_START_GEN8     MI_INSTR(0x31, 1)
 
+#define MI_PREDICATE_SRC0      (0x2400)
+#define MI_PREDICATE_SRC1      (0x2408)
 
 #define MI_PREDICATE_RESULT_2  (0x2214)
 #define  LOWER_SLICE_ENABLED   (1<<0)