diff options
author | 2019-11-13 06:44:45 +0000 | |
---|---|---|
committer | 2019-11-13 06:44:45 +0000 | |
commit | cff9f180c785ff55a1cc84d3fa0bc081f1708a19 (patch) | |
tree | 0eb9f450798341936c30cbf612882689897a697c | |
parent | drm/i915/gen8+: Add RC6 CTX corruption WA (diff) | |
download | wireguard-openbsd-cff9f180c785ff55a1cc84d3fa0bc081f1708a19.tar.xz wireguard-openbsd-cff9f180c785ff55a1cc84d3fa0bc081f1708a19.zip |
drm/i915/cmdparser: Fix jump whitelist clearing
From Ben Hutchings
fee619bb813648ea90bf024171acfaaec2f031fc in linux 4.19.y/4.19.84
ea0b163b13ffc52818c079adb00d55e227a6da6f in mainline linux
-rw-r--r-- | sys/dev/pci/drm/i915/i915_cmd_parser.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/dev/pci/drm/i915/i915_cmd_parser.c b/sys/dev/pci/drm/i915/i915_cmd_parser.c index 5e53af19c13..9435a014f82 100644 --- a/sys/dev/pci/drm/i915/i915_cmd_parser.c +++ b/sys/dev/pci/drm/i915/i915_cmd_parser.c @@ -1374,7 +1374,7 @@ static void init_whitelist(struct i915_gem_context *ctx, u32 batch_len) return; if (batch_cmds <= ctx->jump_whitelist_cmds) { - memset(ctx->jump_whitelist, 0, exact_size * sizeof(u32)); + bitmap_zero(ctx->jump_whitelist, batch_cmds); return; } @@ -1394,8 +1394,7 @@ again: } DRM_DEBUG("CMD: Failed to extend whitelist. BB_START may be disallowed\n"); - memset(ctx->jump_whitelist, 0, - BITS_TO_LONGS(ctx->jump_whitelist_cmds) * sizeof(u32)); + bitmap_zero(ctx->jump_whitelist, ctx->jump_whitelist_cmds); return; } |