Skip to content

Commit 926abff

Browse files
drm/i915/cmdparser: Ignore Length operands during command matching
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]>
1 parent f8c08d8 commit 926abff

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/i915/i915_cmd_parser.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ struct drm_i915_cmd_table {
189189
#define CMD(op, opm, f, lm, fl, ...) \
190190
{ \
191191
.flags = (fl) | ((f) ? CMD_DESC_FIXED : 0), \
192-
.cmd = { (op), ~0u << (opm) }, \
192+
.cmd = { (op & ~0u << (opm)), ~0u << (opm) }, \
193193
.length = { (lm) }, \
194194
__VA_ARGS__ \
195195
}

0 commit comments

Comments
 (0)