drm/i915: Avoid using ctx->file_priv during construction
Subsystems (2)
PATCH 1/1 drm/i915: Avoid using ctx->file_priv during construction
As we only set ctx->file_priv on registering the GEM context after construction, it is invalid to try and use it in the middle for setting various parameters. Indeed, we put the file_priv into struct create_ext so that we have the right file_private available without having to look at ctx->file_priv. However, it helps to use it!
--- drivers/gpu/drm/i915/i915_gem_context.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-)
drivers/gpu/drm/i915/i915_gem_context.c +10 -9
@@ -969,10 +969,10 @@ int i915_gem_switch_to_kernel_context(struct drm_i915_private *i915,return 0 ; } -static int get_ppgtt (struct i915_gem_context *ctx, +static int get_ppgtt (struct drm_i915_file_private *file_priv, +struct i915_gem_context *ctx,struct drm_i915_gem_context_param *args) { -struct drm_i915_file_private *file_priv = ctx->file_priv;struct i915_hw_ppgtt *ppgtt;int ret;
@@ -1071,10 +1071,10 @@ static int emit_ppgtt_update(struct i915_request *rq, void *data)return 0 ; } -static int set_ppgtt (struct i915_gem_context *ctx, +static int set_ppgtt (struct drm_i915_file_private *file_priv, +struct i915_gem_context *ctx,struct drm_i915_gem_context_param *args) { -struct drm_i915_file_private *file_priv = ctx->file_priv;struct i915_hw_ppgtt *ppgtt, *old;int err;
@@ -1416,7 +1416,8 @@ static int set_sseu(struct i915_gem_context *ctx,return 0 ; } -static int ctx_setparam (struct i915_gem_context *ctx, +static int ctx_setparam (struct drm_i915_file_private *fpriv, +struct i915_gem_context *ctx,struct drm_i915_gem_context_param *args) {int ret =0 ;
@@ -1485,7 +1486,7 @@ static int ctx_setparam(struct i915_gem_context *ctx,break ;case I915_CONTEXT_PARAM_VM : - ret =set_ppgtt (ctx, args); + ret =set_ppgtt (fpriv, ctx, args);break ;case I915_CONTEXT_PARAM_BAN_PERIOD :
@@ -1513,7 +1514,7 @@ static int create_setparam(struct i915_user_extension __user *ext, void *data)if (local.param.ctx_id)return -EINVAL ; -return ctx_setparam (arg->ctx, &local.param); +return ctx_setparam (arg->fpriv, arg->ctx, &local.param); }static const i915_user_extension_fn create_extensions[] = {
@@ -1712,7 +1713,7 @@ int i915_gem_context_getparam_ioctl(struct drm_device *dev, void *data,break ;case I915_CONTEXT_PARAM_VM : - ret =get_ppgtt (ctx, args); + ret =get_ppgtt (file_priv, ctx, args);break ;case I915_CONTEXT_PARAM_BAN_PERIOD :
@@ -1737,7 +1738,7 @@ int i915_gem_context_setparam_ioctl(struct drm_device *dev, void *data,if (!ctx)return -ENOENT ; - ret =ctx_setparam (ctx, args); + ret =ctx_setparam (file_priv, ctx, args);i915_gem_context_put (ctx);return ret;
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.BAT: success for drm/i915: Avoid using ctx->file_priv during construction
== Series Details ==
== Series Details ==
Series: drm/i915: Avoid using ctx->file_priv during construction
URL : https://patchwork.freedesktop.org/series/58769/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_5841 -> Patchwork_12642
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://patchwork.freedesktop.org/api/1.0/series/58769/revisions/1/mbox/
Known issues
------------
Here are the changes found in Patchwork_12642 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@amdgpu/amd_cs_nop@fork-gfx0:
- fi-icl-u2: NOTRUN -> SKIP [fdo#109315] +17
* igt@gem_exec_basic@readonly-bsd1:
- fi-icl-u2: NOTRUN -> SKIP [fdo#109276] +7
* igt@gem_exec_parse@basic-allowed:
- fi-icl-u2: NOTRUN -> SKIP [fdo#109289] +1
* igt@i915_selftest@live_contexts:
- fi-icl-u2: NOTRUN -> DMESG-FAIL [fdo#108569]
* igt@i915_selftest@live_uncore:
- fi-ivb-3770: PASS -> DMESG-FAIL [fdo#110210]
* igt@kms_busy@basic-flip-a:
- fi-gdg-551: PASS -> FAIL [fdo#103182]
* igt@kms_chamelium@dp-edid-read:
- fi-icl-u2: NOTRUN -> SKIP [fdo#109316] +2
* igt@kms_chamelium@vga-hpd-fast:
- fi-icl-u2: NOTRUN -> SKIP [fdo#109309] +1
* igt@kms_force_connector_basic@prune-stale-modes:
- fi-icl-u2: NOTRUN -> SKIP [fdo#109285] +3
* igt@kms_frontbuffer_tracking@basic:
- fi-icl-u2: NOTRUN -> FAIL [fdo#103167]
#### Possible fixes ####
* igt@kms_busy@basic-flip-b:
- fi-gdg-551: FAIL [fdo#103182] -> PASS
* igt@kms_frontbuffer_tracking@basic:
- fi-byt-clapper: FAIL [fdo#103167] -> PASS
* igt@prime_vgem@basic-fence-flip:
- fi-gdg-551: DMESG-FAIL [fdo#103182] -> PASS
[fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
[fdo#103182]: https://bugs.freedesktop.org/show_bug.cgi?id=103182
[fdo#108569]: https://bugs.freedesktop.org/show_bug.cgi?id=108569
[fdo#109276]: https://bugs.freedesktop.org/show_bug.cgi?id=109276
[fdo#109285]: https://bugs.freedesktop.org/show_bug.cgi?id=109285
[fdo#109289]: https://bugs.freedesktop.org/show_bug.cgi?id=109289
[fdo#109309]: https://bugs.freedesktop.org/show_bug.cgi?id=109309
[fdo#109315]: https://bugs.freedesktop.org/show_bug.cgi?id=109315
[fdo#109316]: https://bugs.freedesktop.org/show_bug.cgi?id=109316
[fdo#110210]: https://bugs.freedesktop.org/show_bug.cgi?id=110210
Participating hosts (49 -> 43)
------------------------------
Additional (1): fi-icl-u2
Missing (7): fi-kbl-soraka fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-icl-guc fi-bdw-samus
Build changes
-------------
* Linux: CI_DRM_5841 -> Patchwork_12642
CI_DRM_5841: 828fef318bad96083e4ccfece408e995b177f777 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4914: b93309b7823dcbbd2c52adb4ebb98e3cb060f910 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_12642: 46d819b99170f0dfc9afe5d92bf39ed9da3a978a @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
46d819b99170 drm/i915: Avoid using ctx->file_priv during construction
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12642/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.IGT: success for drm/i915: Avoid using ctx->file_priv during construction
In reply to Chris Wilson== Series Details ==
== Series Details ==
Series: drm/i915: Avoid using ctx->file_priv during construction
URL : https://patchwork.freedesktop.org/series/58769/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_5841_full -> Patchwork_12642_full
====================================================
Summary
-------
**SUCCESS**
No regressions found.
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in Patchwork_12642_full:
### IGT changes ###
#### Suppressed ####
The following results come from untrusted machines, tests, or statuses. They do not affect the overall result.
* {igt@kms_plane@pixel-format-pipe-b-planes-source-clamping}:
- shard-skl: NOTRUN -> FAIL
Known issues
------------
Here are the changes found in Patchwork_12642_full that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@drm_import_export@prime:
- shard-apl: PASS -> INCOMPLETE [fdo#103927]
* igt@gem_tiled_pread_pwrite:
- shard-iclb: PASS -> TIMEOUT [fdo#109673] +1
* igt@i915_pm_rpm@basic-rte:
- shard-skl: PASS -> INCOMPLETE [fdo#107807] +2
* igt@i915_selftest@live_workarounds:
- shard-iclb: PASS -> DMESG-FAIL [fdo#108954]
* igt@kms_atomic_transition@3x-modeset-transitions-nonblocking:
- shard-snb: NOTRUN -> SKIP [fdo#109271] / [fdo#109278] +10
* igt@kms_atomic_transition@6x-modeset-transitions:
- shard-skl: NOTRUN -> SKIP [fdo#109271] / [fdo#109278] +2
* igt@kms_busy@extended-modeset-hang-newfb-with-reset-render-a:
- shard-skl: NOTRUN -> DMESG-WARN [fdo#110222]
* igt@kms_color@pipe-c-ctm-0-25:
- shard-iclb: PASS -> DMESG-WARN [fdo#106107]
* igt@kms_cursor_crc@cursor-256x256-suspend:
- shard-skl: PASS -> INCOMPLETE [fdo#104108]
* igt@kms_cursor_legacy@flip-vs-cursor-crc-legacy:
- shard-skl: PASS -> FAIL [fdo#102670]
* igt@kms_fbcon_fbt@psr-suspend:
- shard-skl: NOTRUN -> FAIL [fdo#103833]
* igt@kms_flip@2x-flip-vs-expired-vblank-interruptible:
- shard-glk: PASS -> FAIL [fdo#105363]
* igt@kms_flip@2x-flip-vs-wf_vblank-interruptible:
- shard-skl: NOTRUN -> SKIP [fdo#109271] +60
* igt@kms_flip@flip-vs-expired-vblank-interruptible:
- shard-skl: PASS -> FAIL [fdo#105363]
* igt@kms_flip@flip-vs-suspend:
- shard-apl: PASS -> DMESG-WARN [fdo#108566]
* igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-pri-shrfb-draw-pwrite:
- shard-iclb: PASS -> FAIL [fdo#103167] +9
* igt@kms_frontbuffer_tracking@fbcpsr-stridechange:
- shard-skl: NOTRUN -> FAIL [fdo#105683]
* igt@kms_frontbuffer_tracking@psr-1p-primscrn-cur-indfb-onoff:
- shard-snb: NOTRUN -> SKIP [fdo#109271] +108
* igt@kms_frontbuffer_tracking@psr-rgb101010-draw-blt:
- shard-iclb: PASS -> FAIL [fdo#109247] +21
* igt@kms_plane_alpha_blend@pipe-a-alpha-7efc:
- shard-skl: NOTRUN -> FAIL [fdo#107815] / [fdo#108145]
* igt@kms_plane_alpha_blend@pipe-b-constant-alpha-max:
- shard-skl: NOTRUN -> FAIL [fdo#108145] +1
* igt@kms_plane_alpha_blend@pipe-b-coverage-7efc:
- shard-skl: PASS -> FAIL [fdo#107815]
* igt@kms_psr@primary_blt:
- shard-iclb: PASS -> FAIL [fdo#107383] / [fdo#110215]
* igt@kms_psr@psr2_sprite_plane_onoff:
- shard-iclb: PASS -> SKIP [fdo#109441]
* igt@kms_rotation_crc@multiplane-rotation-cropping-bottom:
- shard-kbl: PASS -> DMESG-FAIL [fdo#105763]
* igt@kms_vblank@pipe-c-ts-continuation-dpms-suspend:
- shard-apl: PASS -> FAIL [fdo#104894]
#### Possible fixes ####
* igt@gem_create@create-clear:
- shard-snb: INCOMPLETE [fdo#105411] -> PASS
* igt@gem_linear_blits@normal:
- shard-iclb: TIMEOUT [fdo#109673] -> PASS
* igt@i915_pm_rpm@system-suspend:
- shard-skl: INCOMPLETE [fdo#104108] / [fdo#107807] -> PASS
* igt@kms_cursor_crc@cursor-128x128-sliding:
- shard-iclb: FAIL [fdo#103232] -> PASS
* igt@kms_flip@flip-vs-expired-vblank-interruptible:
- shard-iclb: FAIL [fdo#105363] -> PASS
* igt@kms_flip@flip-vs-suspend:
- shard-skl: INCOMPLETE [fdo#109507] -> PASS
* igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-cur-indfb-draw-render:
- shard-iclb: FAIL [fdo#103167] -> PASS +4
* igt@kms_frontbuffer_tracking@psr-1p-primscrn-cur-indfb-draw-pwrite:
- shard-iclb: FAIL [fdo#109247] -> PASS +15
* igt@kms_plane_alpha_blend@pipe-a-constant-alpha-min:
- shard-skl: FAIL [fdo#108145] -> PASS
* igt@kms_psr@psr2_basic:
- shard-iclb: SKIP [fdo#109441] -> PASS +3
* igt@kms_psr@sprite_mmap_gtt:
- shard-iclb: FAIL [fdo#107383] / [fdo#110215] -> PASS +4
* igt@kms_rotation_crc@multiplane-rotation:
- shard-kbl: DMESG-FAIL [fdo#105763] -> PASS
* igt@kms_rotation_crc@multiplane-rotation-cropping-top:
- shard-kbl: FAIL [fdo#109016] -> PASS
* igt@kms_vblank@pipe-b-ts-continuation-dpms-rpm:
- shard-apl: FAIL [fdo#104894] -> PASS +1
#### Warnings ####
* igt@i915_pm_rpm@i2c:
- shard-iclb: DMESG-WARN [fdo#109982] -> FAIL [fdo#104097]
* igt@i915_pm_rpm@pc8-residency:
- shard-skl: INCOMPLETE [fdo#107807] -> SKIP [fdo#109271]
* igt@kms_dp_dsc@basic-dsc-enable-edp:
- shard-iclb: FAIL [fdo#110270] -> SKIP [fdo#109349]
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[fdo#102670]: https://bugs.freedesktop.org/show_bug.cgi?id=102670
[fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
[fdo#103232]: https://bugs.freedesktop.org/show_bug.cgi?id=103232
[fdo#103833]: https://bugs.freedesktop.org/show_bug.cgi?id=103833
[fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
[fdo#104097]: https://bugs.freedesktop.org/show_bug.cgi?id=104097
[fdo#104108]: https://bugs.freedesktop.org/show_bug.cgi?id=104108
[fdo#104894]: https://bugs.freedesktop.org/show_bug.cgi?id=104894
[fdo#105363]: https://bugs.freedesktop.org/show_bug.cgi?id=105363
[fdo#105411]: https://bugs.freedesktop.org/show_bug.cgi?id=105411
[fdo#105683]: https://bugs.freedesktop.org/show_bug.cgi?id=105683
[fdo#105763]: https://bugs.freedesktop.org/show_bug.cgi?id=105763
[fdo#106107]: https://bugs.freedesktop.org/show_bug.cgi?id=106107
[fdo#107383]: https://bugs.freedesktop.org/show_bug.cgi?id=107383
[fdo#107807]: https://bugs.freedesktop.org/show_bug.cgi?id=107807
[fdo#107815]: https://bugs.freedesktop.org/show_bug.cgi?id=107815
[fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
[fdo#108566]: https://bugs.freedesktop.org/show_bug.cgi?id=108566
[fdo#108954]: https://bugs.freedesktop.org/show_bug.cgi?id=108954
[fdo#109016]: https://bugs.freedesktop.org/show_bug.cgi?id=109016
[fdo#109247]: https://bugs.freedesktop.org/show_bug.cgi?id=109247
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
[fdo#109349]: https://bugs.freedesktop.org/show_bug.cgi?id=109349
[fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
[fdo#109507]: https://bugs.freedesktop.org/show_bug.cgi?id=109507
[fdo#109673]: https://bugs.freedesktop.org/show_bug.cgi?id=109673
[fdo#109982]: https://bugs.freedesktop.org/show_bug.cgi?id=109982
[fdo#110215]: https://bugs.freedesktop.org/show_bug.cgi?id=110215
[fdo#110222]: https://bugs.freedesktop.org/show_bug.cgi?id=110222
[fdo#110270]: https://bugs.freedesktop.org/show_bug.cgi?id=110270
[fdo#110279]: https://bugs.freedesktop.org/show_bug.cgi?id=110279
Participating hosts (10 -> 9)
------------------------------
Missing (1): shard-hsw
Build changes
-------------
* Linux: CI_DRM_5841 -> Patchwork_12642
CI_DRM_5841: 828fef318bad96083e4ccfece408e995b177f777 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4914: b93309b7823dcbbd2c52adb4ebb98e3cb060f910 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_12642: 46d819b99170f0dfc9afe5d92bf39ed9da3a978a @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_12642/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
I think the change is focused mainly around setting the vm param, so perhaps the subject should mention that. Maybe something like:
drm/i915: Avoid using ctx->file_priv for VM param during construction
I guess a similar issue could arise if other context params are added later. Hopefully any issues can be caught by making sure to add tests for setting the new context params at context creation time.
and, I verified it fixes the segfault when setting vm at context create time, so:
Quoted 94 lines · Chris Wilson
As we only set
ctx->file_privon registering the GEM context after construction, it is invalid to try and use it in the middle for setting various parameters. Indeed, we put thefile_privinto structcreate_extso that we have the rightfile_privateavailable without having to look atctx->file_priv. However, it helps to use it!Reported-by Jordan Justen <[email protected]>Fixes b91715417244 ("drm/i915: Extend CONTEXT_CREATE to set parameters upon construction")Signed-off-by Chris Wilson <[email protected]>Cc Tvrtko Ursulin <[email protected]>Cc Jordan Justen <[email protected]>--- drivers/gpu/drm/i915/i915_gem_context.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-)drivers/gpu/drm/i915/i915_gem_context.c +10
-9@@ -969,10 +969,10 @@ int i915_gem_switch_to_kernel_context(struct drm_i915_private *i915,return 0 ; } -static int get_ppgtt (struct i915_gem_context *ctx, +static int get_ppgtt (struct drm_i915_file_private *file_priv, +struct i915_gem_context *ctx,struct drm_i915_gem_context_param *args) { -struct drm_i915_file_private *file_priv = ctx->file_priv;struct i915_hw_ppgtt *ppgtt;int ret;@@ -1071,10 +1071,10 @@ static int emit_ppgtt_update(struct i915_request *rq, void *data)return 0 ; } -static int set_ppgtt (struct i915_gem_context *ctx, +static int set_ppgtt (struct drm_i915_file_private *file_priv, +struct i915_gem_context *ctx,struct drm_i915_gem_context_param *args) { -struct drm_i915_file_private *file_priv = ctx->file_priv;struct i915_hw_ppgtt *ppgtt, *old;int err;@@ -1416,7 +1416,8 @@ static int set_sseu(struct i915_gem_context *ctx,return 0 ; } -static int ctx_setparam (struct i915_gem_context *ctx, +static int ctx_setparam (struct drm_i915_file_private *fpriv, +struct i915_gem_context *ctx,struct drm_i915_gem_context_param *args) {int ret =0 ;@@ -1485,7 +1486,7 @@ static int ctx_setparam(struct i915_gem_context *ctx,break ;case I915_CONTEXT_PARAM_VM : - ret =set_ppgtt (ctx, args); + ret =set_ppgtt (fpriv, ctx, args);break ;case I915_CONTEXT_PARAM_BAN_PERIOD :@@ -1513,7 +1514,7 @@ static int create_setparam(struct i915_user_extension __user *ext, void *data)if (local.param.ctx_id)return -EINVAL ; -return ctx_setparam (arg->ctx, &local.param); +return ctx_setparam (arg->fpriv, arg->ctx, &local.param); }static const i915_user_extension_fn create_extensions[] = {@@ -1712,7 +1713,7 @@ int i915_gem_context_getparam_ioctl(struct drm_device *dev, void *data,break ;case I915_CONTEXT_PARAM_VM : - ret =get_ppgtt (ctx, args); + ret =get_ppgtt (file_priv, ctx, args);break ;case I915_CONTEXT_PARAM_BAN_PERIOD :@@ -1737,7 +1738,7 @@ int i915_gem_context_setparam_ioctl(struct drm_device *dev, void *data,if (!ctx)return -ENOENT ; - ret =ctx_setparam (ctx, args); + ret =ctx_setparam (file_priv, ctx, args);i915_gem_context_put (ctx);return ret;Signature · 1 line
2.20.1
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoting Jordan Justen (2019-03-31 04:03:44)
Quoted 2 lines
I think the change is focused mainly around setting the vm param, so perhaps the subject should mention that. Maybe something like:
It's not just about that, it's the design in how create_ext is run before registration which caters for more than just vm. The problem already exists for the other extensions posted, I caught the bug in create_ext_clone and overlooked that I had been exclusively using normal ctx_setparam to manipulate the ppgtt.
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 9 lines · Chris Wilson
Quoting Jordan Justen (2019-03-31 04:03:44)
Quoted 2 lines
I think the change is focused mainly around setting the vm param, so perhaps the subject should mention that. Maybe something like:
It's not just about that, it's the design in how
create_extis run before registration which caters for more than just vm. The problem already exists for the other extensions posted, I caught the bug increate_ext_cloneand overlooked that I had been exclusively using normalctx_setparamto manipulate the ppgtt.
I guess I disagree for two reasons.
1. I think this patch only addresses the symptom with the vm param
2. It doesn't really prevent someone from adding a new param and accidentally doing the same thing.
But, feel free to keep the r-b and t-b even if you don't want to change the subject line.
-Jordan
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 2 lines · Chris Wilson
As we only set
ctx->file_privon registering the GEM context after construction, it is invalid to try and use it in the middle for setting
Other option would be to set ctx->file_priv ahead of gem_context_register and use gem_context_register only for registering (per function name)
Extra bonus would be that changed here static ctx functions will continue to take ctx as first parameter (same as other existing ctx functions)
Michal
Quoted 4 lines
various parameters. Indeed, we put the
file_privinto structcreate_extso that we have the rightfile_privateavailable without having to look atctx->file_priv. However, it helps to use it!
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoting Michal Wajdeczko (2019-03-31 10:12:52)
Quoted 8 lines
Quoted 2 lines · Chris Wilson
As we only set
ctx->file_privon registering the GEM context after construction, it is invalid to try and use it in the middle for settingOther option would be to set
ctx->file_privahead ofgem_context_registerand usegem_context_registeronly for registering (per function name)
I thought it might be useful for us to distinguish between unregistered protocontexts and unregistered kernel contexts with registered GEM contexts.
Quoted 2 lines
Extra bonus would be that changed here static ctx functions will continue to take ctx as first parameter (same as other existing ctx functions)
The only real use for ctx->file is for identifying the right lut in i915_gem_close_object() (the other is for charging a hang against a file, which is going to be more complicated in future, so expect changes).
Ideas for avoiding the search along the linked list in close are most welcome.
https://patchwork.freedesktop.org/patch/291947/?series=57942&rev=2
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx