* [PATCH] drm/i915: Explicitly mark Global GTT address spaces
@ 2018-08-31 14:36 Tvrtko Ursulin
2018-08-31 15:21 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Tvrtko Ursulin @ 2018-08-31 14:36 UTC (permalink / raw)
To: Intel-gfx
From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
So far we have been relying on vm->file pointer being NULL to declare
something GGTT.
This has the unfortunate consequence that the default kernel context is
also declared GGTT and interferes with the following patch which wants to
instantiate VMA's and execute requests against the kernel context.
Change the is_ggtt test to use an explicit flag in struct address_space to
solve this issue.
Note that the bit used is free since there is an alignment hole in the
struct.
v2:
* Mark mock ggtt.
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
---
drivers/gpu/drm/i915/i915_gem_gtt.c | 2 ++
drivers/gpu/drm/i915/i915_gem_gtt.h | 5 ++++-
drivers/gpu/drm/i915/selftests/mock_gtt.c | 2 ++
3 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
index d9d44639ba26..eb0e446d6482 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
@@ -3604,6 +3604,8 @@ int i915_ggtt_init_hw(struct drm_i915_private *dev_priv)
mutex_lock(&dev_priv->drm.struct_mutex);
i915_address_space_init(&ggtt->vm, dev_priv);
+ ggtt->vm.is_ggtt = true;
+
/* Only VLV supports read-only GGTT mappings */
ggtt->vm.has_read_only = IS_VALLEYVIEW(dev_priv);
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.h b/drivers/gpu/drm/i915/i915_gem_gtt.h
index 01d83a943142..7e2af5f4f39b 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.h
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.h
@@ -324,6 +324,9 @@ struct i915_address_space {
struct pagestash free_pages;
+ /* Global GTT */
+ bool is_ggtt:1;
+
/* Some systems require uncached updates of the page directories */
bool pt_kmap_wc:1;
@@ -357,7 +360,7 @@ struct i915_address_space {
I915_SELFTEST_DECLARE(bool scrub_64K);
};
-#define i915_is_ggtt(V) (!(V)->file)
+#define i915_is_ggtt(vm) ((vm)->is_ggtt)
static inline bool
i915_vm_is_48bit(const struct i915_address_space *vm)
diff --git a/drivers/gpu/drm/i915/selftests/mock_gtt.c b/drivers/gpu/drm/i915/selftests/mock_gtt.c
index a140ea5c3a7c..6ae418c76015 100644
--- a/drivers/gpu/drm/i915/selftests/mock_gtt.c
+++ b/drivers/gpu/drm/i915/selftests/mock_gtt.c
@@ -118,6 +118,8 @@ void mock_init_ggtt(struct drm_i915_private *i915)
ggtt->vm.vma_ops.clear_pages = clear_pages;
i915_address_space_init(&ggtt->vm, i915);
+
+ ggtt->vm.is_ggtt = true;
}
void mock_fini_ggtt(struct drm_i915_private *i915)
--
2.17.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 6+ messages in thread
* ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Explicitly mark Global GTT address spaces
2018-08-31 14:36 [PATCH] drm/i915: Explicitly mark Global GTT address spaces Tvrtko Ursulin
@ 2018-08-31 15:21 ` Patchwork
2018-08-31 15:42 ` ✓ Fi.CI.BAT: success " Patchwork
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2018-08-31 15:21 UTC (permalink / raw)
To: Tvrtko Ursulin; +Cc: intel-gfx
== Series Details ==
Series: drm/i915: Explicitly mark Global GTT address spaces
URL : https://patchwork.freedesktop.org/series/49018/
State : warning
== Summary ==
$ dim checkpatch origin/drm-tip
a97af16a4fee drm/i915: Explicitly mark Global GTT address spaces
-:47: WARNING:BOOL_BITFIELD: Avoid using bool as bitfield. Prefer bool bitfields as unsigned int or u<8|16|32>
#47: FILE: drivers/gpu/drm/i915/i915_gem_gtt.h:328:
+ bool is_ggtt:1;
total: 0 errors, 1 warnings, 0 checks, 33 lines checked
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 6+ messages in thread
* ✓ Fi.CI.BAT: success for drm/i915: Explicitly mark Global GTT address spaces
2018-08-31 14:36 [PATCH] drm/i915: Explicitly mark Global GTT address spaces Tvrtko Ursulin
2018-08-31 15:21 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
@ 2018-08-31 15:42 ` Patchwork
2018-08-31 15:47 ` [PATCH] " Chris Wilson
2018-08-31 22:58 ` ✓ Fi.CI.IGT: success for " Patchwork
3 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2018-08-31 15:42 UTC (permalink / raw)
To: Tvrtko Ursulin; +Cc: intel-gfx
== Series Details ==
Series: drm/i915: Explicitly mark Global GTT address spaces
URL : https://patchwork.freedesktop.org/series/49018/
State : success
== Summary ==
= CI Bug Log - changes from CI_DRM_4749 -> Patchwork_10061 =
== Summary - SUCCESS ==
No regressions found.
External URL: https://patchwork.freedesktop.org/api/1.0/series/49018/revisions/1/mbox/
== Known issues ==
Here are the changes found in Patchwork_10061 that come from known issues:
=== IGT changes ===
==== Issues hit ====
igt@drv_selftest@live_hangcheck:
fi-kbl-guc: PASS -> DMESG-FAIL (fdo#106947, fdo#107710)
igt@gem_exec_suspend@basic-s3:
{fi-kbl-soraka}: NOTRUN -> INCOMPLETE (fdo#107556, fdo#107774)
igt@kms_pipe_crc_basic@read-crc-pipe-b-frame-sequence:
{fi-byt-clapper}: PASS -> FAIL (fdo#107362, fdo#103191)
{igt@pm_rpm@module-reload}:
fi-cnl-psr: PASS -> WARN (fdo#107708, fdo#107602)
==== Possible fixes ====
{igt@kms_psr@primary_page_flip}:
fi-cnl-psr: FAIL (fdo#107336) -> PASS
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
fdo#103191 https://bugs.freedesktop.org/show_bug.cgi?id=103191
fdo#106947 https://bugs.freedesktop.org/show_bug.cgi?id=106947
fdo#107336 https://bugs.freedesktop.org/show_bug.cgi?id=107336
fdo#107362 https://bugs.freedesktop.org/show_bug.cgi?id=107362
fdo#107556 https://bugs.freedesktop.org/show_bug.cgi?id=107556
fdo#107602 https://bugs.freedesktop.org/show_bug.cgi?id=107602
fdo#107708 https://bugs.freedesktop.org/show_bug.cgi?id=107708
fdo#107710 https://bugs.freedesktop.org/show_bug.cgi?id=107710
fdo#107774 https://bugs.freedesktop.org/show_bug.cgi?id=107774
== Participating hosts (52 -> 47) ==
Additional (1): fi-kbl-soraka
Missing (6): fi-hsw-4770r fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-ctg-p8600
== Build changes ==
* Linux: CI_DRM_4749 -> Patchwork_10061
CI_DRM_4749: 4a46c18fad0de38a78b4b0c848892de494324a17 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4616: 5800e46c6f851c370c944a7cb169e99657239f8d @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_10061: a97af16a4feebcee5d0076479ff281eba089ffc2 @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
a97af16a4fee drm/i915: Explicitly mark Global GTT address spaces
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_10061/issues.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] drm/i915: Explicitly mark Global GTT address spaces
2018-08-31 14:36 [PATCH] drm/i915: Explicitly mark Global GTT address spaces Tvrtko Ursulin
2018-08-31 15:21 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2018-08-31 15:42 ` ✓ Fi.CI.BAT: success " Patchwork
@ 2018-08-31 15:47 ` Chris Wilson
2018-09-01 9:27 ` Chris Wilson
2018-08-31 22:58 ` ✓ Fi.CI.IGT: success for " Patchwork
3 siblings, 1 reply; 6+ messages in thread
From: Chris Wilson @ 2018-08-31 15:47 UTC (permalink / raw)
To: Intel-gfx, Tvrtko Ursulin
Quoting Tvrtko Ursulin (2018-08-31 15:36:43)
> From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>
> So far we have been relying on vm->file pointer being NULL to declare
> something GGTT.
>
> This has the unfortunate consequence that the default kernel context is
> also declared GGTT and interferes with the following patch which wants to
> instantiate VMA's and execute requests against the kernel context.
>
> Change the is_ggtt test to use an explicit flag in struct address_space to
> solve this issue.
>
> Note that the bit used is free since there is an alignment hole in the
> struct.
>
> v2:
> * Mark mock ggtt.
>
> Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> ---
> drivers/gpu/drm/i915/i915_gem_gtt.c | 2 ++
> drivers/gpu/drm/i915/i915_gem_gtt.h | 5 ++++-
> drivers/gpu/drm/i915/selftests/mock_gtt.c | 2 ++
> 3 files changed, 8 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
> index d9d44639ba26..eb0e446d6482 100644
> --- a/drivers/gpu/drm/i915/i915_gem_gtt.c
> +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
> @@ -3604,6 +3604,8 @@ int i915_ggtt_init_hw(struct drm_i915_private *dev_priv)
> mutex_lock(&dev_priv->drm.struct_mutex);
> i915_address_space_init(&ggtt->vm, dev_priv);
>
> + ggtt->vm.is_ggtt = true;
> +
> /* Only VLV supports read-only GGTT mappings */
> ggtt->vm.has_read_only = IS_VALLEYVIEW(dev_priv);
>
> diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.h b/drivers/gpu/drm/i915/i915_gem_gtt.h
> index 01d83a943142..7e2af5f4f39b 100644
> --- a/drivers/gpu/drm/i915/i915_gem_gtt.h
> +++ b/drivers/gpu/drm/i915/i915_gem_gtt.h
> @@ -324,6 +324,9 @@ struct i915_address_space {
>
> struct pagestash free_pages;
>
> + /* Global GTT */
> + bool is_ggtt:1;
> +
> /* Some systems require uncached updates of the page directories */
> bool pt_kmap_wc:1;
>
> @@ -357,7 +360,7 @@ struct i915_address_space {
> I915_SELFTEST_DECLARE(bool scrub_64K);
> };
>
> -#define i915_is_ggtt(V) (!(V)->file)
> +#define i915_is_ggtt(vm) ((vm)->is_ggtt)
But it's so explicit!
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 6+ messages in thread
* ✓ Fi.CI.IGT: success for drm/i915: Explicitly mark Global GTT address spaces
2018-08-31 14:36 [PATCH] drm/i915: Explicitly mark Global GTT address spaces Tvrtko Ursulin
` (2 preceding siblings ...)
2018-08-31 15:47 ` [PATCH] " Chris Wilson
@ 2018-08-31 22:58 ` Patchwork
3 siblings, 0 replies; 6+ messages in thread
From: Patchwork @ 2018-08-31 22:58 UTC (permalink / raw)
To: Tvrtko Ursulin; +Cc: intel-gfx
== Series Details ==
Series: drm/i915: Explicitly mark Global GTT address spaces
URL : https://patchwork.freedesktop.org/series/49018/
State : success
== Summary ==
= CI Bug Log - changes from CI_DRM_4749_full -> Patchwork_10061_full =
== Summary - SUCCESS ==
No regressions found.
== Known issues ==
Here are the changes found in Patchwork_10061_full that come from known issues:
=== IGT changes ===
==== Issues hit ====
igt@drv_suspend@shrink:
shard-kbl: PASS -> INCOMPLETE (fdo#103665, fdo#106886)
igt@gem_exec_suspend@basic-s3:
shard-apl: PASS -> INCOMPLETE (fdo#103927)
==== Possible fixes ====
igt@gem_eio@in-flight-contexts-10ms:
shard-glk: FAIL -> PASS
igt@kms_cursor_legacy@2x-long-flip-vs-cursor-atomic:
shard-glk: FAIL (fdo#104873) -> PASS
igt@kms_flip@flip-vs-expired-vblank:
shard-glk: FAIL (fdo#105363, fdo#102887) -> PASS
fdo#102887 https://bugs.freedesktop.org/show_bug.cgi?id=102887
fdo#103665 https://bugs.freedesktop.org/show_bug.cgi?id=103665
fdo#103927 https://bugs.freedesktop.org/show_bug.cgi?id=103927
fdo#104873 https://bugs.freedesktop.org/show_bug.cgi?id=104873
fdo#105363 https://bugs.freedesktop.org/show_bug.cgi?id=105363
fdo#106886 https://bugs.freedesktop.org/show_bug.cgi?id=106886
== Participating hosts (6 -> 5) ==
Missing (1): pig-snb-2600
== Build changes ==
* Linux: CI_DRM_4749 -> Patchwork_10061
CI_DRM_4749: 4a46c18fad0de38a78b4b0c848892de494324a17 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4616: 5800e46c6f851c370c944a7cb169e99657239f8d @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_10061: a97af16a4feebcee5d0076479ff281eba089ffc2 @ 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_10061/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] drm/i915: Explicitly mark Global GTT address spaces
2018-08-31 15:47 ` [PATCH] " Chris Wilson
@ 2018-09-01 9:27 ` Chris Wilson
0 siblings, 0 replies; 6+ messages in thread
From: Chris Wilson @ 2018-09-01 9:27 UTC (permalink / raw)
To: Intel-gfx, Tvrtko Ursulin
Quoting Chris Wilson (2018-08-31 16:47:24)
> Quoting Tvrtko Ursulin (2018-08-31 15:36:43)
> > From: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> >
> > So far we have been relying on vm->file pointer being NULL to declare
> > something GGTT.
> >
> > This has the unfortunate consequence that the default kernel context is
> > also declared GGTT and interferes with the following patch which wants to
> > instantiate VMA's and execute requests against the kernel context.
> >
> > Change the is_ggtt test to use an explicit flag in struct address_space to
> > solve this issue.
> >
> > Note that the bit used is free since there is an alignment hole in the
> > struct.
> >
> > v2:
> > * Mark mock ggtt.
> >
> > Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> > Cc: Chris Wilson <chris@chris-wilson.co.uk>
> > ---
> > drivers/gpu/drm/i915/i915_gem_gtt.c | 2 ++
> > drivers/gpu/drm/i915/i915_gem_gtt.h | 5 ++++-
> > drivers/gpu/drm/i915/selftests/mock_gtt.c | 2 ++
> > 3 files changed, 8 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c
> > index d9d44639ba26..eb0e446d6482 100644
> > --- a/drivers/gpu/drm/i915/i915_gem_gtt.c
> > +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
> > @@ -3604,6 +3604,8 @@ int i915_ggtt_init_hw(struct drm_i915_private *dev_priv)
> > mutex_lock(&dev_priv->drm.struct_mutex);
> > i915_address_space_init(&ggtt->vm, dev_priv);
> >
> > + ggtt->vm.is_ggtt = true;
> > +
> > /* Only VLV supports read-only GGTT mappings */
> > ggtt->vm.has_read_only = IS_VALLEYVIEW(dev_priv);
> >
> > diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.h b/drivers/gpu/drm/i915/i915_gem_gtt.h
> > index 01d83a943142..7e2af5f4f39b 100644
> > --- a/drivers/gpu/drm/i915/i915_gem_gtt.h
> > +++ b/drivers/gpu/drm/i915/i915_gem_gtt.h
> > @@ -324,6 +324,9 @@ struct i915_address_space {
> >
> > struct pagestash free_pages;
> >
> > + /* Global GTT */
> > + bool is_ggtt:1;
> > +
> > /* Some systems require uncached updates of the page directories */
> > bool pt_kmap_wc:1;
> >
> > @@ -357,7 +360,7 @@ struct i915_address_space {
> > I915_SELFTEST_DECLARE(bool scrub_64K);
> > };
> >
> > -#define i915_is_ggtt(V) (!(V)->file)
> > +#define i915_is_ggtt(vm) ((vm)->is_ggtt)
>
> But it's so explicit!
> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
And pushed, thanks for the patch.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2018-09-01 9:27 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-08-31 14:36 [PATCH] drm/i915: Explicitly mark Global GTT address spaces Tvrtko Ursulin
2018-08-31 15:21 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2018-08-31 15:42 ` ✓ Fi.CI.BAT: success " Patchwork
2018-08-31 15:47 ` [PATCH] " Chris Wilson
2018-09-01 9:27 ` Chris Wilson
2018-08-31 22:58 ` ✓ Fi.CI.IGT: success for " Patchwork
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox