]> Git Repo - linux.git/commitdiff
drm/i915/cmdparser: Ignore Length operands during command matching
authorJon Bloomfield <[email protected]>
Thu, 20 Sep 2018 16:45:10 +0000 (09:45 -0700)
committerJon Bloomfield <[email protected]>
Tue, 5 Nov 2019 19:38:34 +0000 (11:38 -0800)
Some of the gen instruction macros (e.g. MI_DISPLAY_FLIP) have the
length directly encoded in them. Since these are used directly in
the tables, the Length becomes part of the comparison used for
matching during parsing. Thus, if the cmd being parsed has a
different length to that in the table, it is not matched and the
cmd is accepted via the default variable length path.

Fix by masking out everything except the Opcode in the cmd tables

Cc: Tony Luck <[email protected]>
Cc: Dave Airlie <[email protected]>
Cc: Takashi Iwai <[email protected]>
Cc: Tyler Hicks <[email protected]>
Signed-off-by: Jon Bloomfield <[email protected]>
Reviewed-by: Chris Wilson <[email protected]>
drivers/gpu/drm/i915/i915_cmd_parser.c

index 365eea2b95bddfcd54b47e31a0c6500ce06d1a99..d78debed06e2f1f60d1dcbda81b954e95ceccdeb 100644 (file)
@@ -189,7 +189,7 @@ struct drm_i915_cmd_table {
 #define CMD(op, opm, f, lm, fl, ...)                           \
        {                                                       \
                .flags = (fl) | ((f) ? CMD_DESC_FIXED : 0),     \
-               .cmd = { (op), ~0u << (opm) },                  \
+               .cmd = { (op & ~0u << (opm)), ~0u << (opm) },   \
                .length = { (lm) },                             \
                __VA_ARGS__                                     \
        }
This page took 0.053524 seconds and 4 git commands to generate.