Skip to content

Commit 6ff6d61

Browse files
gfxstranddanvet
authored andcommitted
drm/i915: Drop I915_CONTEXT_PARAM_NO_ZEROMAP
The idea behind this param is to support OpenCL drivers with relocations because OpenCL reserves 0x0 for NULL and, if we placed memory there, it would confuse CL kernels. It was originally sent out as part of a patch series including libdrm [1] and Beignet [2] support. However, the libdrm and Beignet patches never landed in their respective upstream projects so this API has never been used. It's never been used in Mesa or any other driver, either. Dropping this API allows us to delete a small bit of code. [1]: https://lists.freedesktop.org/archives/intel-gfx/2015-May/067030.html [2]: https://lists.freedesktop.org/archives/intel-gfx/2015-May/067031.html Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Daniel Vetter <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 74e4b90 commit 6ff6d61

File tree

4 files changed

+6
-23
lines changed

4 files changed

+6
-23
lines changed

drivers/gpu/drm/i915/gem/i915_gem_context.c

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1920,15 +1920,6 @@ static int ctx_setparam(struct drm_i915_file_private *fpriv,
19201920
int ret = 0;
19211921

19221922
switch (args->param) {
1923-
case I915_CONTEXT_PARAM_NO_ZEROMAP:
1924-
if (args->size)
1925-
ret = -EINVAL;
1926-
else if (args->value)
1927-
set_bit(UCONTEXT_NO_ZEROMAP, &ctx->user_flags);
1928-
else
1929-
clear_bit(UCONTEXT_NO_ZEROMAP, &ctx->user_flags);
1930-
break;
1931-
19321923
case I915_CONTEXT_PARAM_NO_ERROR_CAPTURE:
19331924
if (args->size)
19341925
ret = -EINVAL;
@@ -1978,6 +1969,7 @@ static int ctx_setparam(struct drm_i915_file_private *fpriv,
19781969
ret = set_persistence(ctx, args);
19791970
break;
19801971

1972+
case I915_CONTEXT_PARAM_NO_ZEROMAP:
19811973
case I915_CONTEXT_PARAM_BAN_PERIOD:
19821974
case I915_CONTEXT_PARAM_RINGSIZE:
19831975
default:
@@ -2358,11 +2350,6 @@ int i915_gem_context_getparam_ioctl(struct drm_device *dev, void *data,
23582350
return -ENOENT;
23592351

23602352
switch (args->param) {
2361-
case I915_CONTEXT_PARAM_NO_ZEROMAP:
2362-
args->size = 0;
2363-
args->value = test_bit(UCONTEXT_NO_ZEROMAP, &ctx->user_flags);
2364-
break;
2365-
23662353
case I915_CONTEXT_PARAM_GTT_SIZE:
23672354
args->size = 0;
23682355
rcu_read_lock();
@@ -2410,6 +2397,7 @@ int i915_gem_context_getparam_ioctl(struct drm_device *dev, void *data,
24102397
args->value = i915_gem_context_is_persistent(ctx);
24112398
break;
24122399

2400+
case I915_CONTEXT_PARAM_NO_ZEROMAP:
24132401
case I915_CONTEXT_PARAM_BAN_PERIOD:
24142402
case I915_CONTEXT_PARAM_RINGSIZE:
24152403
default:

drivers/gpu/drm/i915/gem/i915_gem_context_types.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ struct i915_gem_context {
129129
* @user_flags: small set of booleans controlled by the user
130130
*/
131131
unsigned long user_flags;
132-
#define UCONTEXT_NO_ZEROMAP 0
133132
#define UCONTEXT_NO_ERROR_CAPTURE 1
134133
#define UCONTEXT_BANNABLE 2
135134
#define UCONTEXT_RECOVERABLE 3

drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,6 @@ struct i915_execbuffer {
290290
struct intel_context *reloc_context;
291291

292292
u64 invalid_flags; /** Set of execobj.flags that are invalid */
293-
u32 context_flags; /** Set of execobj.flags to insert from the ctx */
294293

295294
u64 batch_len; /** Length of batch within object */
296295
u32 batch_start_offset; /** Location within object of batch */
@@ -541,9 +540,6 @@ eb_validate_vma(struct i915_execbuffer *eb,
541540
entry->flags |= EXEC_OBJECT_NEEDS_GTT | __EXEC_OBJECT_NEEDS_MAP;
542541
}
543542

544-
if (!(entry->flags & EXEC_OBJECT_PINNED))
545-
entry->flags |= eb->context_flags;
546-
547543
return 0;
548544
}
549545

@@ -750,10 +746,6 @@ static int eb_select_context(struct i915_execbuffer *eb)
750746
if (rcu_access_pointer(ctx->vm))
751747
eb->invalid_flags |= EXEC_OBJECT_NEEDS_GTT;
752748

753-
eb->context_flags = 0;
754-
if (test_bit(UCONTEXT_NO_ZEROMAP, &ctx->user_flags))
755-
eb->context_flags |= __EXEC_OBJECT_NEEDS_BIAS;
756-
757749
return 0;
758750
}
759751

include/uapi/drm/i915_drm.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1638,6 +1638,10 @@ struct drm_i915_gem_context_param {
16381638
__u32 size;
16391639
__u64 param;
16401640
#define I915_CONTEXT_PARAM_BAN_PERIOD 0x1
1641+
/* I915_CONTEXT_PARAM_NO_ZEROMAP has been removed. On the off chance
1642+
* someone somewhere has attempted to use it, never re-use this context
1643+
* param number.
1644+
*/
16411645
#define I915_CONTEXT_PARAM_NO_ZEROMAP 0x2
16421646
#define I915_CONTEXT_PARAM_GTT_SIZE 0x3
16431647
#define I915_CONTEXT_PARAM_NO_ERROR_CAPTURE 0x4

0 commit comments

Comments
 (0)