Context isolation
Rebase and resend and mmio workarounds moved (see patch 5/9), and they are very sensitive to init-ordering...
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v5 1/9 drm/i915: Include engine state on detecting a missed breadcrumb/seqno
Now that we have a common engine state pretty printer, we can use that instead of the adhoc information printed when we miss a breadcrumb.
--- drivers/gpu/drm/i915/intel_breadcrumbs.c | 11 +++++------ drivers/gpu/drm/i915/intel_engine_cs.c | 6 ++++++ 2 files changed, 11 insertions(+), 6 deletions(-)
drivers/gpu/drm/i915/intel_breadcrumbs.c +5 -6
@@ -64,12 +64,11 @@ static unsigned long wait_timeout(void) static noinline void missed_breadcrumb(struct intel_engine_cs *engine) { -DRM_DEBUG_DRIVER ("%s missed breadcrumb at %pS, irq posted? %s, current seqno=%x, last=%x\n" , - engine->name,__builtin_return_address (0 ), -yesno (test_bit (ENGINE_IRQ_BREADCRUMB , - &engine->irq_posted)), -intel_engine_get_seqno (engine), -intel_engine_last_submit (engine)); +struct drm_printer p =drm_debug_printer (__func__); + +DRM_DEBUG_DRIVER ("%s missed breadcrumb at %pS\n" , + engine->name,__builtin_return_address (0 )); +intel_engine_dump (engine, &p);set_bit (engine->id, &engine->i915->gpu_error.missed_irq_rings); }
drivers/gpu/drm/i915/intel_engine_cs.c +6 -0
@@ -1835,6 +1835,12 @@ void intel_engine_dump(struct intel_engine_cs *engine, struct drm_printer *m) }spin_unlock_irq (&b->rb_lock); +drm_printf (m,"IRQ? 0x%lx (breadcrumbs? %s) (execlists? %s)\n" , + engine->irq_posted, +yesno (test_bit (ENGINE_IRQ_BREADCRUMB , + &engine->irq_posted)), +yesno (test_bit (ENGINE_IRQ_EXECLIST , + &engine->irq_posted)));drm_printf (m,"Idle? %s\n" ,yesno (intel_engine_is_idle (engine)));drm_printf (m,"\n" ); }
Signature · 6 lines
2.15.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v5 1/9] drm/i915: Include engine state on detecting a missed breadcrumb/seqno
Quoted 20 lines · Chris Wilson
Now that we have a common engine state pretty printer, we can use that instead of the adhoc information printed when we miss a breadcrumb.
Signed-off-by Chris Wilson <[email protected]>Cc Mika Kuoppala <[email protected]>Cc Tvrtko Ursulin <[email protected]>--- drivers/gpu/drm/i915/intel_breadcrumbs.c | 11 +++++------ drivers/gpu/drm/i915/intel_engine_cs.c | 6 ++++++ 2 files changed, 11 insertions(+), 6 deletions(-)drivers/gpu/drm/i915/intel_breadcrumbs.c +0
-1@@ -64,12 +64,11 @@ static unsigned long wait_timeout(void) static noinline void missed_breadcrumb(struct intel_engine_cs *engine) { - DRM_DEBUG_DRIVER("%s missed breadcrumb at %pS, irq posted? %s, current seqno=%x, last=%x\n",
drivers/gpu/drm/i915/intel_breadcrumbs.c static unsigned long wait_timeout(void) · line 71
Quoted 10 lines
drivers/gpu/drm/i915/intel_breadcrumbs.c +5
-5- engine->name,__builtin_return_address (0 ), -yesno (test_bit (ENGINE_IRQ_BREADCRUMB , - &engine->irq_posted)), -intel_engine_get_seqno (engine), - intel_engine_last_submit(engine)); +struct drm_printer p =drm_debug_printer (__func__); + +DRM_DEBUG_DRIVER ("%s missed breadcrumb at %pS\n" , + engine->name,__builtin_return_address (0 )); +intel_engine_dump (engine, &p);
We are holding rb_lock while we enter and the dump will retake it.
We also should add proper asserts to intel_engine_dump that we notice immediately if we try to dump on wrong context.
-Mika
Quoted 22 lines
drivers/gpu/drm/i915/intel_breadcrumbs.c +0
-0set_bit (engine->id, &engine->i915->gpu_error.missed_irq_rings); }drivers/gpu/drm/i915/intel_engine_cs.c +6
-0@@ -1835,6 +1835,12 @@ void intel_engine_dump(struct intel_engine_cs *engine, struct drm_printer *m) }spin_unlock_irq (&b->rb_lock); +drm_printf (m,"IRQ? 0x%lx (breadcrumbs? %s) (execlists? %s)\n" , + engine->irq_posted, +yesno (test_bit (ENGINE_IRQ_BREADCRUMB , + &engine->irq_posted)), +yesno (test_bit (ENGINE_IRQ_EXECLIST , + &engine->irq_posted)));drm_printf (m,"Idle? %s\n" ,yesno (intel_engine_is_idle (engine)));drm_printf (m,"\n" ); }Signature · 1 line
2.15.0
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v5 1/9] drm/i915: Include engine state on detecting a missed breadcrumb/seqno
Quoting Mika Kuoppala (2017-11-09 11:03:39)
Quoted 19 lines
Quoted 17 lines · Chris Wilson
Now that we have a common engine state pretty printer, we can use that instead of the adhoc information printed when we miss a breadcrumb.
Signed-off-by Chris Wilson <[email protected]>Cc Mika Kuoppala <[email protected]>Cc Tvrtko Ursulin <[email protected]>--- drivers/gpu/drm/i915/intel_breadcrumbs.c | 11 +++++------ drivers/gpu/drm/i915/intel_engine_cs.c | 6 ++++++ 2 files changed, 11 insertions(+), 6 deletions(-)drivers/gpu/drm/i915/intel_breadcrumbs.c +0
-0@@ -64,12 +64,11 @@ static unsigned long wait_timeout(void)
Quoted 15 lines
drivers/gpu/drm/i915/intel_breadcrumbs.c static unsigned long wait_timeout(void) · line 71
Quoted 13 lines
drivers/gpu/drm/i915/intel_breadcrumbs.c +5
-6static noinline void missed_breadcrumb(struct intel_engine_cs *engine) { -DRM_DEBUG_DRIVER ("%s missed breadcrumb at %pS, irq posted? %s, current seqno=%x, last=%x\n" , - engine->name,__builtin_return_address (0 ), -yesno (test_bit (ENGINE_IRQ_BREADCRUMB , - &engine->irq_posted)), -intel_engine_get_seqno (engine), -intel_engine_last_submit (engine)); +struct drm_printer p =drm_debug_printer (__func__); + +DRM_DEBUG_DRIVER ("%s missed breadcrumb at %pS\n" , + engine->name,__builtin_return_address (0 )); +intel_engine_dump (engine, &p);We are holding
rb_lockwhile we enter and the dump will retake it.
Well that's annoying. It also leads to the next point, that intel_engine_dump() isn't taking the engine->timeline->lock enough.
Good catch, thanks.
Quoted 2 lines
We also should add proper asserts to
intel_engine_dumpthat we notice immediately if we try to dump on wrong context.
You can't just assert(!spin_locked()) as that gives false positives when it is in use elsewhere. The answer would be to annotate all spinlocks with lockdep.
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v5 2/9 drm/i915: Define an engine class enum for the uABI
In reply to Chris WilsonFrom: Tvrtko Ursulin <[email protected]>
We want to be able to report back to userspace details about an engine's class, and in return for userspace to be able to request actions regarding certain classes of engines. To isolate the uABI from any variations between hw generations, we define an abstract class for the engines and internally map onto the hw.
v2: Remove MAX from the uABI; keep it internal if we need it, but don't let userspace make the mistake of using it themselves.
--- drivers/gpu/drm/i915/intel_engine_cs.c | 10 +++++++++- drivers/gpu/drm/i915/intel_ringbuffer.h | 5 ++++- include/uapi/drm/i915_drm.h | 15 +++++++++++++++ 3 files changed, 28 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_engine_cs.c +9 -1
@@ -50,6 +50,8 @@ struct engine_class_info {const char *name;int (*init_legacy)(struct intel_engine_cs *engine);int (*init_execlists)(struct intel_engine_cs *engine); + +u8 uabi_class; };static const struct engine_class_info intel_engine_classes[] = {
@@ -57,21 +59,25 @@ static const struct engine_class_info intel_engine_classes[] = { .name = "rcs", .init_execlists = logical_render_ring_init, .init_legacy = intel_init_render_ring_buffer, + .uabi_class = I915_ENGINE_CLASS_RENDER, }, [COPY_ENGINE_CLASS] = { .name = "bcs", .init_execlists = logical_xcs_ring_init, .init_legacy = intel_init_blt_ring_buffer, + .uabi_class = I915_ENGINE_CLASS_COPY, }, [VIDEO_DECODE_CLASS] = { .name = "vcs", .init_execlists = logical_xcs_ring_init, .init_legacy = intel_init_bsd_ring_buffer, + .uabi_class = I915_ENGINE_CLASS_VIDEO, }, [VIDEO_ENHANCEMENT_CLASS] = { .name = "vecs", .init_execlists = logical_xcs_ring_init, .init_legacy = intel_init_vebox_ring_buffer, + .uabi_class = I915_ENGINE_CLASS_VIDEO_ENHANCE, }, };
@@ -213,13 +219,15 @@ intel_engine_setup(struct drm_i915_private *dev_priv,WARN_ON (snprintf (engine->name,sizeof (engine->name),"%s%u" , class_info->name, info->instance) >=sizeof (engine->name)); - engine->uabi_id = info->uabi_id; engine->hw_id = engine->guc_id = info->hw_id; engine->mmio_base = info->mmio_base; engine->irq_shift = info->irq_shift; engine->class = info->class; engine->instance = info->instance; + engine->uabi_id = info->uabi_id; + engine->uabi_class = class_info->uabi_class; + engine->context_size =__intel_engine_context_size (dev_priv, engine->class);if (WARN_ON (engine->context_size >BIT (20 )))
drivers/gpu/drm/i915/intel_ringbuffer.h +4 -1
@@ -290,11 +290,14 @@ struct intel_engine_execlists {struct intel_engine_cs {struct drm_i915_private *i915;char name[INTEL_ENGINE_CS_MAX_NAME ]; +enum intel_engine_id id; -unsigned int uabi_id;unsigned int hw_id;unsigned int guc_id; +u8 uabi_id; +u8 uabi_class; +u8 class;u8 instance;u32 context_size;
include/uapi/drm/i915_drm.h +15 -0
@@ -86,6 +86,21 @@ enum i915_mocs_table_index { I915_MOCS_CACHED, }; +/* +* Different engines serve different roles, and there may be more than one +* engine serving each role. enum drm_i915_gem_engine_class provides a +* classification of the role of the engine, which may be used when requesting +* operations to be performed on a certain subset of engines, or for providing +* information about that group. +*/ +enum drm_i915_gem_engine_class { +I915_ENGINE_CLASS_OTHER =0 , +I915_ENGINE_CLASS_RENDER =1 , +I915_ENGINE_CLASS_COPY =2 , +I915_ENGINE_CLASS_VIDEO =3 , +I915_ENGINE_CLASS_VIDEO_ENHANCE =4 , +}; +/* Each region is a minimum of 16k, and there are at most 255 of them. */ #define I915_NR_TEX_REGIONS 255/* table size 2k - maximum due to use
Signature · 6 lines
2.15.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v5 2/9] drm/i915: Define an engine class enum for the uABI
Quoted 6 lines · Chris Wilson
include/uapi/drm/i915_drm.h +5
-0+/* +* Different engines serve different roles, and there may be more than one +* engine serving each role. enum drm_i915_gem_engine_class provides a +* classification of the role of the engine, which may be used when requesting +* operations to be performed on a certain subset of engines, or for providing
include/uapi/drm/i915_drm.h enum i915_mocs_table_index { · line 103
Quoted 10 lines
include/uapi/drm/i915_drm.h +10
-0+* information about that group. +*/ +enum drm_i915_gem_engine_class { +I915_ENGINE_CLASS_OTHER =0 , +I915_ENGINE_CLASS_RENDER =1 , +I915_ENGINE_CLASS_COPY =2 , +I915_ENGINE_CLASS_VIDEO =3 , +I915_ENGINE_CLASS_VIDEO_ENHANCE =4 , +}; +
I've tried to build a bit UI in GPUTop to show this.
I'm a bit skeptical about the OTHER type because if this enum is meant to be extended, then why do we need an OTHER class? We should create new classes instead.
-
Lionel
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v5 2/9] drm/i915: Define an engine class enum for the uABI
Quoted 13 lines · Lionel Landwerlin
Quoted 12 lines · Chris Wilson
+/*
+ * Different engines serve different roles, and there may be more than one
+ * engine serving each role. enumdrm_i915_gem_engine_classprovides a
+ * classification of the role of the engine, which may be used when requesting
+ * operations to be performed on a certain subset of engines, or for providing
+ * information about that group.
+ */
+enumdrm_i915_gem_engine_class{
+I915_ENGINE_CLASS_OTHER= 0,
Quoted 8 lines
include/uapi/drm/i915_drm.h enum i915_mocs_table_index { · line 103
Quoted 6 lines
+
I915_ENGINE_CLASS_RENDER= 1,
+I915_ENGINE_CLASS_COPY= 2,
+I915_ENGINE_CLASS_VIDEO= 3,
+I915_ENGINE_CLASS_VIDEO_ENHANCE= 4,include/uapi/drm/i915_drm.h +2
-0+}; +I've tried to build a bit UI in GPUTop to show this.
I'm a bit skeptical about the OTHER type because if this enum is meant to be extended, then why do we need an OTHER class? We should create new classes instead.
Good point, I agree that I cannot find a reason why we would have it in the uAPI. I suspect I was just doing a copy-paste-transform of the hardware definitions from i915_reg.h.
Regards,
Tvrtko
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v5 2/9] drm/i915: Define an engine class enum for the uABI
Quoting Tvrtko Ursulin (2017-11-09 09:27:33)
Quoted 26 lines · Lionel Landwerlin
Quoted 15 lines · Chris Wilson
Quoted 14 lines
+/*
+ * Different engines serve different roles, and there may be more than one
+ * engine serving each role. enumdrm_i915_gem_engine_classprovides a
+ * classification of the role of the engine, which may be used when requesting
+ * operations to be performed on a certain subset of engines, or for providing
+ * information about that group.
+ */
+enumdrm_i915_gem_engine_class{
+I915_ENGINE_CLASS_OTHER= 0,
+I915_ENGINE_CLASS_RENDER= 1,
+I915_ENGINE_CLASS_COPY= 2,Quoted 8 lines
include/uapi/drm/i915_drm.h enum i915_mocs_table_index { · line 103
Quoted 4 lines
+
I915_ENGINE_CLASS_VIDEO= 3,
+I915_ENGINE_CLASS_VIDEO_ENHANCE= 4,include/uapi/drm/i915_drm.h +2
-0+}; +I've tried to build a bit UI in GPUTop to show this.
I'm a bit skeptical about the OTHER type because if this enum is meant to be extended, then why do we need an OTHER class? We should create new classes instead.
Quoted 3 lines
Good point, I agree that I cannot find a reason why we would have it in the uAPI. I suspect I was just doing a copy-paste-transform of the hardware definitions from
i915_reg.h.
Do we want to keep 0 as undefined? It can be both a nuisance and a blessing...
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v5 2/9] drm/i915: Define an engine class enum for the uABI
Quoted 27 lines · Chris Wilson
Quoting Tvrtko Ursulin (2017-11-09 09:27:33)
Quoted 26 lines · Lionel Landwerlin
Quoted 23 lines · Chris Wilson
Quoted 10 lines
+/*
+ * Different engines serve different roles, and there may be more than one
+ * engine serving each role. enumdrm_i915_gem_engine_classprovides a
+ * classification of the role of the engine, which may be used when requesting
+ * operations to be performed on a certain subset of engines, or for providing
+ * information about that group.
+ */include/uapi/drm/i915_drm.h enum i915_mocs_table_index { · line 103
Quoted 8 lines
include/uapi/drm/i915_drm.h +8
-0+enum drm_i915_gem_engine_class { + I915_ENGINE_CLASS_OTHER = 0, + I915_ENGINE_CLASS_RENDER = 1, + I915_ENGINE_CLASS_COPY = 2, + I915_ENGINE_CLASS_VIDEO = 3, + I915_ENGINE_CLASS_VIDEO_ENHANCE = 4, +}; +I've tried to build a bit UI in GPUTop to show this.
I'm a bit skeptical about the OTHER type because if this enum is meant to be extended, then why do we need an OTHER class? We should create new classes instead.
Quoted 6 lines
Quoted 3 lines
Good point, I agree that I cannot find a reason why we would have it in the uAPI. I suspect I was just doing a copy-paste-transform of the hardware definitions from
i915_reg.h.Do we want to keep 0 as undefined? It can be both a nuisance and a blessing...
What can you imagine it would be useful for?
Regards,
Tvrtko
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v5 2/9] drm/i915: Define an engine class enum for the uABI
Quoting Tvrtko Ursulin (2017-11-09 10:04:17)
Quoted 29 lines · Chris Wilson
Quoted 27 lines
Quoting Tvrtko Ursulin (2017-11-09 09:27:33)
Quoted 26 lines · Lionel Landwerlin
Quoted 23 lines · Chris Wilson
Quoted 10 lines
+/*
+ * Different engines serve different roles, and there may be more than one
+ * engine serving each role. enumdrm_i915_gem_engine_classprovides a
+ * classification of the role of the engine, which may be used when requesting
+ * operations to be performed on a certain subset of engines, or for providing
+ * information about that group.
+ */include/uapi/drm/i915_drm.h enum i915_mocs_table_index { · line 103
Quoted 8 lines
include/uapi/drm/i915_drm.h +8
-0+enum drm_i915_gem_engine_class { + I915_ENGINE_CLASS_OTHER = 0, + I915_ENGINE_CLASS_RENDER = 1, + I915_ENGINE_CLASS_COPY = 2, + I915_ENGINE_CLASS_VIDEO = 3, + I915_ENGINE_CLASS_VIDEO_ENHANCE = 4, +}; +I've tried to build a bit UI in GPUTop to show this.
I'm a bit skeptical about the OTHER type because if this enum is meant to be extended, then why do we need an OTHER class? We should create new classes instead.
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Good point, I agree that I cannot find a reason why we would have it in the uAPI. I suspect I was just doing a copy-paste-transform of the hardware definitions from
i915_reg.h.Do we want to keep 0 as undefined? It can be both a nuisance and a blessing...
What can you imagine it would be useful for?
I915_EXEC_DEFAULT is of I915_ENGINE_CLASS_OTHER.
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v5 2/9] drm/i915: Define an engine class enum for the uABI
Quoted 27 lines · Chris Wilson
Quoting Tvrtko Ursulin (2017-11-09 10:04:17)
Quoted 26 lines · Chris Wilson
Quoted 25 lines
Quoting Tvrtko Ursulin (2017-11-09 09:27:33)
Quoted 24 lines · Lionel Landwerlin
Quoted 23 lines · Chris Wilson
Quoted 10 lines
+/*
+ * Different engines serve different roles, and there may be more than one
+ * engine serving each role. enumdrm_i915_gem_engine_classprovides a
+ * classification of the role of the engine, which may be used when requesting
+ * operations to be performed on a certain subset of engines, or for providing
+ * information about that group.
+ */include/uapi/drm/i915_drm.h enum i915_mocs_table_index { · line 103
Quoted 8 lines
include/uapi/drm/i915_drm.h +8
-0+enum drm_i915_gem_engine_class { + I915_ENGINE_CLASS_OTHER = 0, + I915_ENGINE_CLASS_RENDER = 1, + I915_ENGINE_CLASS_COPY = 2, + I915_ENGINE_CLASS_VIDEO = 3, + I915_ENGINE_CLASS_VIDEO_ENHANCE = 4, +}; +I've tried to build a bit UI in GPUTop to show this.
I'm a bit skeptical about the OTHER type because if this enum is meant to be extended, then why do we need an OTHER class? We should create new classes instead.
Quoted 9 lines
Quoted 6 lines
Quoted 5 lines
Quoted 3 lines
Good point, I agree that I cannot find a reason why we would have it in the uAPI. I suspect I was just doing a copy-paste-transform of the hardware definitions from
i915_reg.h.Do we want to keep 0 as undefined? It can be both a nuisance and a blessing...
What can you imagine it would be useful for?
I915_EXEC_DEFAULTis ofI915_ENGINE_CLASS_OTHER.
-Chris
But that's render, right?
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v5 2/9] drm/i915: Define an engine class enum for the uABI
In reply to Lionel LandwerlinQuoting Lionel Landwerlin (2017-11-09 09:13:03)
Quoted 13 lines · Chris Wilson
Quoted 12 lines
include/uapi/drm/i915_drm.h +11
-0+/* +* Different engines serve different roles, and there may be more than one +* engine serving each role. enum drm_i915_gem_engine_class provides a +* classification of the role of the engine, which may be used when requesting +* operations to be performed on a certain subset of engines, or for providing +* information about that group. +*/ +enum drm_i915_gem_engine_class { +I915_ENGINE_CLASS_OTHER =0 , +I915_ENGINE_CLASS_RENDER =1 , +I915_ENGINE_CLASS_COPY =2 ,
Quoted 8 lines
include/uapi/drm/i915_drm.h enum i915_mocs_table_index { · line 103
Quoted 4 lines
include/uapi/drm/i915_drm.h +4
-0+I915_ENGINE_CLASS_VIDEO =3 , + I915_ENGINE_CLASS_VIDEO_ENHANCE = 4, +}; +I've tried to build a bit UI in GPUTop to show this.
I'm a bit skeptical about the OTHER type because if this enum is meant to be extended, then why do we need an OTHER class? We should create new classes instead.
Whilst OTHER is certainly a question of "why not add a define for the new class", my 2c is that we do want an explicit INVALID enum. It doesn't have to 0, -1 will work just fine as well, but there will be a time either in userspace or in reporting from the kernel where we will need to store an invalid value that is guaranteed not to map onto a real class.
So I915_ENGINE_CLASS_INVALID = -1 ?
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v5 2/9] drm/i915: Define an engine class enum for the uABI
Quoted 29 lines · Chris Wilson
Quoting Lionel Landwerlin (2017-11-09 09:13:03)
Quoted 13 lines · Chris Wilson
Quoted 12 lines
include/uapi/drm/i915_drm.h +11
-0+/* +* Different engines serve different roles, and there may be more than one +* engine serving each role. enum drm_i915_gem_engine_class provides a +* classification of the role of the engine, which may be used when requesting +* operations to be performed on a certain subset of engines, or for providing +* information about that group. +*/ +enum drm_i915_gem_engine_class { +I915_ENGINE_CLASS_OTHER =0 , +I915_ENGINE_CLASS_RENDER =1 , +I915_ENGINE_CLASS_COPY =2 ,Quoted 8 lines
include/uapi/drm/i915_drm.h enum i915_mocs_table_index { · line 103
Quoted 4 lines
include/uapi/drm/i915_drm.h +4
-0+I915_ENGINE_CLASS_VIDEO =3 , + I915_ENGINE_CLASS_VIDEO_ENHANCE = 4, +}; +I've tried to build a bit UI in GPUTop to show this.
I'm a bit skeptical about the OTHER type because if this enum is meant to be extended, then why do we need an OTHER class? We should create new classes instead.Whilst OTHER is certainly a question of "why not add a define for the new class", my 2c is that we do want an explicit INVALID enum. It doesn't have to 0, -1 will work just fine as well, but there will be a time either in userspace or in reporting from the kernel where we will need to store an invalid value that is guaranteed not to map onto a real class.
Quoted 3 lines
So
I915_ENGINE_CLASS_INVALID= -1 ?
-Chris
Okay, so you want to use that value for userspace to say "execute this batch buffer on whatever engine". And in that case that's fine with me, I didn't get that would be used in the userspace->kernel direction.
But I'm still struggling to understand why the kernel would report that there is an "invalid" class of engine on this device, rather than something more descriptive.
-
Lionel
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v5 2/9] drm/i915: Define an engine class enum for the uABI
Quoting Lionel Landwerlin (2017-11-09 22:16:26)
Quoted 30 lines · Chris Wilson
Quoted 29 lines
Quoting Lionel Landwerlin (2017-11-09 09:13:03)
Quoted 13 lines · Chris Wilson
Quoted 12 lines
include/uapi/drm/i915_drm.h +11
-0+/* +* Different engines serve different roles, and there may be more than one +* engine serving each role. enum drm_i915_gem_engine_class provides a +* classification of the role of the engine, which may be used when requesting +* operations to be performed on a certain subset of engines, or for providing +* information about that group. +*/ +enum drm_i915_gem_engine_class { +I915_ENGINE_CLASS_OTHER =0 , +I915_ENGINE_CLASS_RENDER =1 , +I915_ENGINE_CLASS_COPY =2 ,Quoted 8 lines
include/uapi/drm/i915_drm.h enum i915_mocs_table_index { · line 103
Quoted 4 lines
include/uapi/drm/i915_drm.h +4
-0+I915_ENGINE_CLASS_VIDEO =3 , + I915_ENGINE_CLASS_VIDEO_ENHANCE = 4, +}; +I've tried to build a bit UI in GPUTop to show this.
I'm a bit skeptical about the OTHER type because if this enum is meant to be extended, then why do we need an OTHER class? We should create new classes instead.Whilst OTHER is certainly a question of "why not add a define for the new class", my 2c is that we do want an explicit INVALID enum. It doesn't have to 0, -1 will work just fine as well, but there will be a time either in userspace or in reporting from the kernel where we will need to store an invalid value that is guaranteed not to map onto a real class.
Quoted 5 lines
Quoted 3 lines
So
I915_ENGINE_CLASS_INVALID= -1 ?
-ChrisOkay, so you want to use that value for userspace to say "execute this batch buffer on whatever engine".
No, I don't expect it to ever be a part of a request from userspace. (Though who knows!)
Quoted 6 lines
And in that case that's fine with me, I didn't get that would be used in the
userspace->kerneldirection.But I'm still struggling to understand why the kernel would report that there is an "invalid" class of engine on this device, rather than something more descriptive.
There's the discussion of exactly what class gen2-5 CS comprises; it has dual functionality of both CLASS_COPY and CLASS_RENDER. (And the unspoken CLASS_GPGPU.)
The usecase for invalid is in userspace in being able to say that its struct engine doesn't map to any exact HW class. And at some point, in some interface the same will be required from the kernel. What I am saying is that history says that having an explicit invalid value from the beginning is useful for futureproofing the API, as well as being convenient for writing generic code to map between the different interfaces.
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v3 1/1 drm/i915: Define an engine class enum for the uABI
In reply to Chris WilsonFrom: Tvrtko Ursulin <[email protected]>
We want to be able to report back to userspace details about an engine's class, and in return for userspace to be able to request actions regarding certain classes of engines. To isolate the uABI from any variations between hw generations, we define an abstract class for the engines and internally map onto the hw.
v2: Remove MAX from the uABI; keep it internal if we need it, but don't let userspace make the mistake of using it themselves.
v3: s/OTHER/INVALID/
The use of OTHER is ill-defined, so remove it from the uABI as any future new type of engine can define a class to suit it. But keep a reserved value for an invalid class, so that we can always unambiguously express when something doesn't belong to the classification.
--- drivers/gpu/drm/i915/intel_engine_cs.c | 10 +++++++++- drivers/gpu/drm/i915/intel_ringbuffer.h | 5 ++++- include/uapi/drm/i915_drm.h | 16 ++++++++++++++++ 3 files changed, 29 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_engine_cs.c +9 -1
@@ -50,6 +50,8 @@ struct engine_class_info {const char *name;int (*init_legacy)(struct intel_engine_cs *engine);int (*init_execlists)(struct intel_engine_cs *engine); + +u8 uabi_class; };static const struct engine_class_info intel_engine_classes[] = {
@@ -57,21 +59,25 @@ static const struct engine_class_info intel_engine_classes[] = { .name = "rcs", .init_execlists = logical_render_ring_init, .init_legacy = intel_init_render_ring_buffer, + .uabi_class = I915_ENGINE_CLASS_RENDER, }, [COPY_ENGINE_CLASS] = { .name = "bcs", .init_execlists = logical_xcs_ring_init, .init_legacy = intel_init_blt_ring_buffer, + .uabi_class = I915_ENGINE_CLASS_COPY, }, [VIDEO_DECODE_CLASS] = { .name = "vcs", .init_execlists = logical_xcs_ring_init, .init_legacy = intel_init_bsd_ring_buffer, + .uabi_class = I915_ENGINE_CLASS_VIDEO, }, [VIDEO_ENHANCEMENT_CLASS] = { .name = "vecs", .init_execlists = logical_xcs_ring_init, .init_legacy = intel_init_vebox_ring_buffer, + .uabi_class = I915_ENGINE_CLASS_VIDEO_ENHANCE, }, };
@@ -213,13 +219,15 @@ intel_engine_setup(struct drm_i915_private *dev_priv,WARN_ON (snprintf (engine->name,sizeof (engine->name),"%s%u" , class_info->name, info->instance) >=sizeof (engine->name)); - engine->uabi_id = info->uabi_id; engine->hw_id = engine->guc_id = info->hw_id; engine->mmio_base = info->mmio_base; engine->irq_shift = info->irq_shift; engine->class = info->class; engine->instance = info->instance; + engine->uabi_id = info->uabi_id; + engine->uabi_class = class_info->uabi_class; + engine->context_size =__intel_engine_context_size (dev_priv, engine->class);if (WARN_ON (engine->context_size >BIT (20 )))
drivers/gpu/drm/i915/intel_ringbuffer.h +4 -1
@@ -290,11 +290,14 @@ struct intel_engine_execlists {struct intel_engine_cs {struct drm_i915_private *i915;char name[INTEL_ENGINE_CS_MAX_NAME ]; +enum intel_engine_id id; -unsigned int uabi_id;unsigned int hw_id;unsigned int guc_id; +u8 uabi_id; +u8 uabi_class; +u8 class;u8 instance;u32 context_size;
include/uapi/drm/i915_drm.h +16 -0
@@ -86,6 +86,22 @@ enum i915_mocs_table_index { I915_MOCS_CACHED, }; +/* +* Different engines serve different roles, and there may be more than one +* engine serving each role. enum drm_i915_gem_engine_class provides a +* classification of the role of the engine, which may be used when requesting +* operations to be performed on a certain subset of engines, or for providing +* information about that group. +*/ +enum drm_i915_gem_engine_class { +I915_ENGINE_CLASS_RENDER =0 , +I915_ENGINE_CLASS_COPY =1 , +I915_ENGINE_CLASS_VIDEO =2 , +I915_ENGINE_CLASS_VIDEO_ENHANCE =3 , + +I915_ENGINE_CLASS_INVALID =-1 +}; +/* Each region is a minimum of 16k, and there are at most 255 of them. */ #define I915_NR_TEX_REGIONS 255/* table size 2k - maximum due to use
Signature · 6 lines
2.15.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v3] drm/i915: Define an engine class enum for the uABI
Quoted 119 lines · Chris Wilson
From: Tvrtko Ursulin <[email protected]>
We want to be able to report back to userspace details about an engine's class, and in return for userspace to be able to request actions regarding certain classes of engines. To isolate the uABI from any variations between hw generations, we define an abstract class for the engines and internally map onto the hw.
v2: Remove MAX from the uABI; keep it internal if we need it, but don't let userspace make the mistake of using it themselves.
v3: s/OTHER/INVALID/
The use of OTHER is ill-defined, so remove it from the uABI as any future new type of engine can define a class to suit it. But keep a reserved value for an invalid class, so that we can always unambiguously express when something doesn't belong to the classification.Signed-off-by Tvrtko Ursulin <[email protected]>Signed-off-by Chris Wilson <[email protected]>Reviewed-by Joonas Lahtinen <[email protected]> #v2--- drivers/gpu/drm/i915/intel_engine_cs.c | 10 +++++++++- drivers/gpu/drm/i915/intel_ringbuffer.h | 5 ++++- include/uapi/drm/i915_drm.h | 16 ++++++++++++++++ 3 files changed, 29 insertions(+), 2 deletions(-)drivers/gpu/drm/i915/intel_engine_cs.c +9
-1@@ -50,6 +50,8 @@ struct engine_class_info {const char *name;int (*init_legacy)(struct intel_engine_cs *engine);int (*init_execlists)(struct intel_engine_cs *engine); + +u8 uabi_class; };static const struct engine_class_info intel_engine_classes[] = {@@ -57,21 +59,25 @@ static const struct engine_class_info intel_engine_classes[] = { .name = "rcs", .init_execlists = logical_render_ring_init, .init_legacy = intel_init_render_ring_buffer, + .uabi_class = I915_ENGINE_CLASS_RENDER, }, [COPY_ENGINE_CLASS] = { .name = "bcs", .init_execlists = logical_xcs_ring_init, .init_legacy = intel_init_blt_ring_buffer, + .uabi_class = I915_ENGINE_CLASS_COPY, }, [VIDEO_DECODE_CLASS] = { .name = "vcs", .init_execlists = logical_xcs_ring_init, .init_legacy = intel_init_bsd_ring_buffer, + .uabi_class = I915_ENGINE_CLASS_VIDEO, }, [VIDEO_ENHANCEMENT_CLASS] = { .name = "vecs", .init_execlists = logical_xcs_ring_init, .init_legacy = intel_init_vebox_ring_buffer, + .uabi_class = I915_ENGINE_CLASS_VIDEO_ENHANCE, }, };@@ -213,13 +219,15 @@ intel_engine_setup(struct drm_i915_private *dev_priv,WARN_ON (snprintf (engine->name,sizeof (engine->name),"%s%u" , class_info->name, info->instance) >=sizeof (engine->name)); - engine->uabi_id = info->uabi_id; engine->hw_id = engine->guc_id = info->hw_id; engine->mmio_base = info->mmio_base; engine->irq_shift = info->irq_shift; engine->class = info->class; engine->instance = info->instance; + engine->uabi_id = info->uabi_id; + engine->uabi_class = class_info->uabi_class; + engine->context_size =__intel_engine_context_size (dev_priv, engine->class);if (WARN_ON (engine->context_size >BIT (20 )))drivers/gpu/drm/i915/intel_ringbuffer.h +4
-1@@ -290,11 +290,14 @@ struct intel_engine_execlists {struct intel_engine_cs {struct drm_i915_private *i915;char name[INTEL_ENGINE_CS_MAX_NAME ]; +enum intel_engine_id id; -unsigned int uabi_id;unsigned int hw_id;unsigned int guc_id; +u8 uabi_id; +u8 uabi_class; +u8 class;u8 instance;u32 context_size;include/uapi/drm/i915_drm.h +9
-0@@ -86,6 +86,22 @@ enum i915_mocs_table_index { I915_MOCS_CACHED, }; +/* +* Different engines serve different roles, and there may be more than one +* engine serving each role. enum drm_i915_gem_engine_class provides a +* classification of the role of the engine, which may be used when requesting +* operations to be performed on a certain subset of engines, or for providing +* information about that group. +*/ +enum drm_i915_gem_engine_class { +I915_ENGINE_CLASS_RENDER =0 ,
include/uapi/drm/i915_drm.h enum i915_mocs_table_index { · line 107
Quoted 10 lines
include/uapi/drm/i915_drm.h +7
-0+I915_ENGINE_CLASS_COPY =1 , +I915_ENGINE_CLASS_VIDEO =2 , +I915_ENGINE_CLASS_VIDEO_ENHANCE =3 , + + I915_ENGINE_CLASS_INVALID = -1 +}; +/* Each region is a minimum of 16k, and there are at most 255 of them. */ #define I915_NR_TEX_REGIONS 255/* table size 2k - maximum due to use
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v3 1/1 drm/i915: Define an engine class enum for the uABI
In reply to Chris WilsonFrom: Tvrtko Ursulin <[email protected]>
We want to be able to report back to userspace details about an engine's class, and in return for userspace to be able to request actions regarding certain classes of engines. To isolate the uABI from any variations between hw generations, we define an abstract class for the engines and internally map onto the hw.
v2: Remove MAX from the uABI; keep it internal if we need it, but don't let userspace make the mistake of using it themselves.
v3: s/OTHER/INVALID/
The use of OTHER is ill-defined, so remove it from the uABI as any future new type of engine can define a class to suit it. But keep a reserved value for an invalid class, so that we can always unambiguously express when something doesn't belong to the classification.
--- drivers/gpu/drm/i915/intel_engine_cs.c | 10 +++++++++- drivers/gpu/drm/i915/intel_ringbuffer.h | 5 ++++- include/uapi/drm/i915_drm.h | 16 ++++++++++++++++ 3 files changed, 29 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_engine_cs.c +9 -1
@@ -50,6 +50,8 @@ struct engine_class_info {const char *name;int (*init_legacy)(struct intel_engine_cs *engine);int (*init_execlists)(struct intel_engine_cs *engine); + +u8 uabi_class; };static const struct engine_class_info intel_engine_classes[] = {
@@ -57,21 +59,25 @@ static const struct engine_class_info intel_engine_classes[] = { .name = "rcs", .init_execlists = logical_render_ring_init, .init_legacy = intel_init_render_ring_buffer, + .uabi_class = I915_ENGINE_CLASS_RENDER, }, [COPY_ENGINE_CLASS] = { .name = "bcs", .init_execlists = logical_xcs_ring_init, .init_legacy = intel_init_blt_ring_buffer, + .uabi_class = I915_ENGINE_CLASS_COPY, }, [VIDEO_DECODE_CLASS] = { .name = "vcs", .init_execlists = logical_xcs_ring_init, .init_legacy = intel_init_bsd_ring_buffer, + .uabi_class = I915_ENGINE_CLASS_VIDEO, }, [VIDEO_ENHANCEMENT_CLASS] = { .name = "vecs", .init_execlists = logical_xcs_ring_init, .init_legacy = intel_init_vebox_ring_buffer, + .uabi_class = I915_ENGINE_CLASS_VIDEO_ENHANCE, }, };
@@ -213,13 +219,15 @@ intel_engine_setup(struct drm_i915_private *dev_priv,WARN_ON (snprintf (engine->name,sizeof (engine->name),"%s%u" , class_info->name, info->instance) >=sizeof (engine->name)); - engine->uabi_id = info->uabi_id; engine->hw_id = engine->guc_id = info->hw_id; engine->mmio_base = info->mmio_base; engine->irq_shift = info->irq_shift; engine->class = info->class; engine->instance = info->instance; + engine->uabi_id = info->uabi_id; + engine->uabi_class = class_info->uabi_class; + engine->context_size =__intel_engine_context_size (dev_priv, engine->class);if (WARN_ON (engine->context_size >BIT (20 )))
drivers/gpu/drm/i915/intel_ringbuffer.h +4 -1
@@ -290,11 +290,14 @@ struct intel_engine_execlists {struct intel_engine_cs {struct drm_i915_private *i915;char name[INTEL_ENGINE_CS_MAX_NAME ]; +enum intel_engine_id id; -unsigned int uabi_id;unsigned int hw_id;unsigned int guc_id; +u8 uabi_id; +u8 uabi_class; +u8 class;u8 instance;u32 context_size;
include/uapi/drm/i915_drm.h +16 -0
@@ -86,6 +86,22 @@ enum i915_mocs_table_index { I915_MOCS_CACHED, }; +/* +* Different engines serve different roles, and there may be more than one +* engine serving each role. enum drm_i915_gem_engine_class provides a +* classification of the role of the engine, which may be used when requesting +* operations to be performed on a certain subset of engines, or for providing +* information about that group. +*/ +enum drm_i915_gem_engine_class { +I915_ENGINE_CLASS_RENDER =0 , +I915_ENGINE_CLASS_COPY =1 , +I915_ENGINE_CLASS_VIDEO =2 , +I915_ENGINE_CLASS_VIDEO_ENHANCE =3 , + +I915_ENGINE_CLASS_INVALID =-1 +}; +/* Each region is a minimum of 16k, and there are at most 255 of them. */ #define I915_NR_TEX_REGIONS 255/* table size 2k - maximum due to use
Signature · 6 lines
2.15.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v5 3/9 drm/i915: Force the switch to the i915->kernel_context
In reply to Chris WilsonIn the next few patches, we will have a hard requirement that we emit a context-switch to the perma-pinned i915->kernel_context (so that we can save the HW state using that context-switch). As the first context itself may be classed as a kernel context, we want to be explicit in our comparison. For an extra-layer of finesse, we can check the last unretired context on the engine; as well as the last retired context when idle.
v2: verbose verbosity
v3: Always force the switch, even when the engine is idle, and update the assert that this happens before suspend.
--- drivers/gpu/drm/i915/i915_gem.c | 10 ++++++---- drivers/gpu/drm/i915/intel_engine_cs.c | 26 ++++++++++++++++++++++++-- 2 files changed, 30 insertions(+), 6 deletions(-)
drivers/gpu/drm/i915/i915_gem.c +6 -4
@@ -4693,14 +4693,16 @@ void __i915_gem_object_release_unless_active(struct drm_i915_gem_object *obj)i915_gem_object_put (obj); } -static void assert_kernel_context_is_current (struct drm_i915_private *dev_priv) +static void assert_kernel_context_is_current (struct drm_i915_private *i915) { +struct i915_gem_context *kernel_context = i915->kernel_context;struct intel_engine_cs *engine;enum intel_engine_id id; -for_each_engine (engine, dev_priv, id) -GEM_BUG_ON (engine->last_retired_context && - !i915_gem_context_is_kernel (engine->last_retired_context)); +for_each_engine (engine, i915, id) { +GEM_BUG_ON (__i915_gem_active_peek (&engine->timeline->last_request)); +GEM_BUG_ON (engine->last_retired_context != kernel_context); + } }void i915_gem_sanitize (struct drm_i915_private *i915)
drivers/gpu/drm/i915/intel_engine_cs.c +24 -2
@@ -1593,10 +1593,32 @@ bool intel_engines_are_idle(struct drm_i915_private *dev_priv)return true; } +/** +* intel_engine_has_kernel_context: +* @engine: the engine +* +* Returns true if the last context to be executed on this engine, or has been +* executed if the engine is already idle, is the kernel context +* (#i915.kernel_context). +*/ bool intel_engine_has_kernel_context (const struct intel_engine_cs *engine) { -return (!engine->last_retired_context || -i915_gem_context_is_kernel (engine->last_retired_context)); +const struct i915_gem_context *const kernel_context = + engine->i915->kernel_context; +struct drm_i915_gem_request *rq; + +lockdep_assert_held (&engine->i915->drm.struct_mutex); + +/* +* Check the last context seen by the engine. If active, it will be +* the last request that remains in the timeline. When idle, it is +* the last executed context as tracked by retirement. +*/ + rq =__i915_gem_active_peek (&engine->timeline->last_request); +if (rq) +return rq->ctx == kernel_context; +else +return engine->last_retired_context == kernel_context; }void intel_engines_reset_default_submission (struct drm_i915_private *i915)
Signature · 6 lines
2.15.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v5 4/9 drm/i915: Move GT powersaving init to i915_gem_init()
In reply to Chris WilsonGT powersaving is tightly coupled to the request infrastructure. To avoid complications with the order of initialisation in the next patch (where we want to send requests to hw during GEM init) move the powersaving initialisation into the purview of i915_gem_init().
--- drivers/gpu/drm/i915/i915_gem.c | 2 ++ drivers/gpu/drm/i915/intel_display.c | 2 -- drivers/gpu/drm/i915/intel_pm.c | 2 -- 3 files changed, 2 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/i915_gem.c +2 -0
@@ -5021,6 +5021,8 @@ int i915_gem_init(struct drm_i915_private *dev_priv)if (ret) goto out_unlock; +intel_init_gt_powersave (dev_priv); + ret =i915_gem_init_hw (dev_priv);if (ret == -EIO ) {/* Allow engine initialisation to fail by marking the GPU as
drivers/gpu/drm/i915/intel_display.c +0 -2
@@ -15197,8 +15197,6 @@ void intel_modeset_gem_init(struct drm_device *dev) {struct drm_i915_private *dev_priv =to_i915 (dev); -intel_init_gt_powersave (dev_priv); -intel_init_clock_gating (dev_priv);intel_setup_overlay (dev_priv);
drivers/gpu/drm/i915/intel_pm.c +0 -2
@@ -7918,7 +7918,6 @@ void intel_init_gt_powersave(struct drm_i915_private *dev_priv)intel_runtime_pm_get (dev_priv); } -mutex_lock (&dev_priv->drm.struct_mutex);mutex_lock (&dev_priv->pcu_lock);/* Initialize RPS limits (for userspace) */
@@ -7960,7 +7959,6 @@ void intel_init_gt_powersave(struct drm_i915_private *dev_priv) rps->boost_freq = rps->max_freq;mutex_unlock (&dev_priv->pcu_lock); -mutex_unlock (&dev_priv->drm.struct_mutex);intel_autoenable_gt_powersave (dev_priv); }
Signature · 6 lines
2.15.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v5 5/9 drm/i915: Move intel_init_clock_gating() to i915_gem_init()
In reply to Chris WilsonDespite its name intel_init_clock_gating applies both display clock gating workarounds; GT mmio workarounds and the occasional GT power context workaround. Worse, sometimes it includes a context register workaround which we need to apply before we record the default HW state for all contexts.
--- drivers/gpu/drm/i915/i915_gem.c | 16 ++++++++++++++-- drivers/gpu/drm/i915/intel_display.c | 2 -- 2 files changed, 14 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/i915_gem.c +14 -2
@@ -5024,6 +5024,20 @@ int i915_gem_init(struct drm_i915_private *dev_priv)intel_init_gt_powersave (dev_priv); ret =i915_gem_init_hw (dev_priv); +if (ret) + goto out_unlock; + +/* Despite its name intel_init_clock_gating applies both display +* clock gating workarounds; GT mmio workarounds and the occasional +* GT power context workaround. Worse, sometimes it includes a context +* register workaround which we need to apply before we record the +* default HW state for all contexts. +* +* FIXME: break up the workarounds and apply them at the right time! +*/ +intel_init_clock_gating (dev_priv); + +out_unlock:if (ret == -EIO ) {/* Allow engine initialisation to fail by marking the GPU as * wedged. But we only want to do this where the GPU is angry,
@@ -5035,8 +5049,6 @@ int i915_gem_init(struct drm_i915_private *dev_priv) } ret =0 ; } - -out_unlock:intel_uncore_forcewake_put (dev_priv,FORCEWAKE_ALL );mutex_unlock (&dev_priv->drm.struct_mutex);
drivers/gpu/drm/i915/intel_display.c +0 -2
@@ -15197,8 +15197,6 @@ void intel_modeset_gem_init(struct drm_device *dev) {struct drm_i915_private *dev_priv =to_i915 (dev); -intel_init_clock_gating (dev_priv); -intel_setup_overlay (dev_priv); }
Signature · 6 lines
2.15.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v5 5/9] drm/i915: Move intel_init_clock_gating() to i915_gem_init()
Quoted 24 lines · Chris Wilson
Despite its name
intel_init_clock_gatingapplies both display clock gating workarounds; GT mmio workarounds and the occasional GT power context workaround. Worse, sometimes it includes a context register workaround which we need to apply before we record the default HW state for all contexts.Signed-off-by Chris Wilson <[email protected]>Cc Ville Syrjälä <[email protected]>Cc Joonas Lahtinen <[email protected]>--- drivers/gpu/drm/i915/i915_gem.c | 16 ++++++++++++++-- drivers/gpu/drm/i915/intel_display.c | 2 -- 2 files changed, 14 insertions(+), 4 deletions(-)drivers/gpu/drm/i915/i915_gem.c +2
-0@@ -5024,6 +5024,20 @@ int i915_gem_init(struct drm_i915_private *dev_priv)intel_init_gt_powersave (dev_priv); ret =i915_gem_init_hw (dev_priv); +if (ret) + goto out_unlock;
drivers/gpu/drm/i915/i915_gem.c int i915_gem_init(struct drm_i915_private *dev_priv) · line 5038
Quoted 10 lines
drivers/gpu/drm/i915/i915_gem.c +10
-0+ +/* Despite its name intel_init_clock_gating applies both display +* clock gating workarounds; GT mmio workarounds and the occasional +* GT power context workaround. Worse, sometimes it includes a context +* register workaround which we need to apply before we record the +* default HW state for all contexts. +* +* FIXME: break up the workarounds and apply them at the right time! +*/ +intel_init_clock_gating (dev_priv);
This part lgtm.
drivers/gpu/drm/i915/i915_gem.c int i915_gem_init(struct drm_i915_private *dev_priv) · line 5039
Quoted 11 lines
drivers/gpu/drm/i915/i915_gem.c +2
-2+ +out_unlock:if (ret == -EIO ) {/* Allow engine initialisation to fail by marking the GPU as * wedged. But we only want to do this where the GPU is angry, @@ -5035,8 +5049,6 @@ int i915_gem_init(struct drm_i915_private *dev_priv) } ret =0 ; } - -out_unlock:
Is the movement of the label going to adversely affect error handling for the other functions which already use the label? Or none of them can return -EIO?
Quoted 18 lines
drivers/gpu/drm/i915/i915_gem.c +0
-0intel_uncore_forcewake_put (dev_priv,FORCEWAKE_ALL );mutex_unlock (&dev_priv->drm.struct_mutex);drivers/gpu/drm/i915/intel_display.c +0
-2@@ -15197,8 +15197,6 @@ void intel_modeset_gem_init(struct drm_device *dev) {struct drm_i915_private *dev_priv =to_i915 (dev); -intel_init_clock_gating (dev_priv); -intel_setup_overlay (dev_priv); }Signature · 1 line
2.15.0
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v5 5/9] drm/i915: Move intel_init_clock_gating() to i915_gem_init()
Quoting Ville Syrjälä (2017-11-08 19:27:41)
Quoted 7 lines · Chris Wilson
Quoted 6 lines
drivers/gpu/drm/i915/i915_gem.c +1
-0+out_unlock:if (ret == -EIO ) {/* Allow engine initialisation to fail by marking the GPU as * wedged. But we only want to do this where the GPU is angry, @@ -5035,8 +5049,6 @@ int i915_gem_init(struct drm_i915_private *dev_priv) }
Quoted 8 lines
drivers/gpu/drm/i915/i915_gem.c int i915_gem_init(struct drm_i915_private *dev_priv) · line 5039
Quoted 4 lines
drivers/gpu/drm/i915/i915_gem.c +0
-2ret =0 ; } - -out_unlock:Is the movement of the label going to adversely affect error handling for the other functions which already use the label? Or none of them can return
-EIO?
None of those can return -EIO, but if they did the same principle applies to them. We would much prefer to disable GEM submission than disable the driver; the theory being as always if the user can see the display and the error messages, they can report a bug. If the driver dies in the middle of loading, it's likely they won't be able to see anything at all (since we've already kicked out the VGA console and it is not coming back).
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Ville Syrjälä
Reviewed-byRe: [PATCH v5 5/9] drm/i915: Move intel_init_clock_gating() to i915_gem_init()
Quoted 17 lines · Chris Wilson
Quoting Ville Syrjälä (2017-11-08 19:27:41)
Quoted 7 lines · Chris Wilson
Quoted 6 lines
drivers/gpu/drm/i915/i915_gem.c +1
-0+out_unlock:if (ret == -EIO ) {/* Allow engine initialisation to fail by marking the GPU as * wedged. But we only want to do this where the GPU is angry, @@ -5035,8 +5049,6 @@ int i915_gem_init(struct drm_i915_private *dev_priv) }Quoted 8 lines
drivers/gpu/drm/i915/i915_gem.c int i915_gem_init(struct drm_i915_private *dev_priv) · line 5039
Quoted 4 lines
drivers/gpu/drm/i915/i915_gem.c +0
-2ret =0 ; } - -out_unlock:Is the movement of the label going to adversely affect error handling for the other functions which already use the label? Or none of them can return
-EIO?
Quoted 7 lines
None of those can return
-EIO, but if they did the same principle applies to them. We would much prefer to disable GEM submission than disable the driver; the theory being as always if the user can see the display and the error messages, they can report a bug. If the driver dies in the middle of loading, it's likely they won't be able to see anything at all (since we've already kicked out the VGA console and it is not coming back).
Ack.
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v5 6/9 drm/i915: Inline intel_modeset_gem_init()
In reply to Chris Wilsonintel_modeset_gem_init() now only sets up the legacy overlay, so let's remove the function and call the setup directly during driver load. This should help us find a better point in the initialisation sequence for it later.
--- drivers/gpu/drm/i915/i915_drv.c | 2 +- drivers/gpu/drm/i915/i915_drv.h | 1 - drivers/gpu/drm/i915/intel_display.c | 7 ------- 3 files changed, 1 insertion(+), 9 deletions(-)
drivers/gpu/drm/i915/i915_drv.c +1 -1
@@ -676,7 +676,7 @@ static int i915_load_modeset_init(struct drm_device *dev)if (ret) goto cleanup_uc; -intel_modeset_gem_init (dev); +intel_setup_overlay (dev_priv);if (INTEL_INFO (dev_priv)->num_pipes ==0 )return 0 ;
drivers/gpu/drm/i915/i915_drv.h +0 -1
@@ -4124,7 +4124,6 @@ void intel_device_info_dump(struct drm_i915_private *dev_priv);/* modesetting */ extern void intel_modeset_init_hw (struct drm_device *dev);extern int intel_modeset_init (struct drm_device *dev); -extern void intel_modeset_gem_init (struct drm_device *dev);extern void intel_modeset_cleanup (struct drm_device *dev);extern int intel_connector_register (struct drm_connector *);extern void intel_connector_unregister (struct drm_connector *);
drivers/gpu/drm/i915/intel_display.c +0 -7
@@ -15193,13 +15193,6 @@ void intel_display_resume(struct drm_device *dev)drm_atomic_state_put (state); } -void intel_modeset_gem_init (struct drm_device *dev) -{ -struct drm_i915_private *dev_priv =to_i915 (dev); - -intel_setup_overlay (dev_priv); -} -int intel_connector_register (struct drm_connector *connector) {struct intel_connector *intel_connector =to_intel_connector (connector);
Signature · 6 lines
2.15.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v5 7/9 drm/i915: Mark the context state as dirty/written
In reply to Chris WilsonIn the next few patches, we will want to both copy out of the context image and write a valid image into a new context. To be completely safe, we should then couple in our domain tracking to ensure that we don't have any issues with stale data remaining in unwanted cachelines.
Historically, we omitted the .write=true from the call to set-gtt-domain in i915_switch_context() in order to avoid a stall between every request as we would want to wait for the previous context write from the gpu. Since then, we limit the set-gtt-domain to only occur when we first bind the vma, so once in use we will never stall, and we are sure to flush the context following a load from swap.
Equally we never applied the lessons learnt from ringbuffer submission to execlists; so time to apply the flush of the lrc after load as well.
--- drivers/gpu/drm/i915/intel_lrc.c | 32 ++++++++++++++++++++++++-------- drivers/gpu/drm/i915/intel_ringbuffer.c | 6 +++--- 2 files changed, 27 insertions(+), 11 deletions(-)
drivers/gpu/drm/i915/intel_lrc.c +24 -8
@@ -1060,12 +1060,34 @@ static void execlists_schedule(struct drm_i915_gem_request *request, int prio)spin_unlock_irq (&engine->timeline->lock); } +static int __context_pin (struct i915_gem_context *ctx,struct i915_vma *vma) +{ +unsigned int flags; +int err; + +/* +* Clear this page out of any CPU caches for coherent swap-in/out. +* We only want to do this on the first bind so that we do not stall +* on an active context (which by nature is already on the GPU). +*/ +if (!(vma->flags &I915_VMA_GLOBAL_BIND )) { + err =i915_gem_object_set_to_gtt_domain (vma->obj, true); +if (err) +return err; + } + + flags =PIN_GLOBAL |PIN_HIGH ; +if (ctx->ggtt_offset_bias) + flags |=PIN_OFFSET_BIAS | ctx->ggtt_offset_bias; + +return i915_vma_pin (vma,0 ,GEN8_LR_CONTEXT_ALIGN , flags); +} +static struct intel_ring *execlists_context_pin (struct intel_engine_cs *engine,struct i915_gem_context *ctx) {struct intel_context *ce = &ctx->engine[engine->id]; -unsigned int flags;void *vaddr;int ret;
@@ -1082,11 +1104,7 @@ execlists_context_pin(struct intel_engine_cs *engine, }GEM_BUG_ON (!ce->state); - flags =PIN_GLOBAL |PIN_HIGH ; -if (ctx->ggtt_offset_bias) - flags |=PIN_OFFSET_BIAS | ctx->ggtt_offset_bias; - - ret =i915_vma_pin (ce->state,0 ,GEN8_LR_CONTEXT_ALIGN , flags); + ret =__context_pin (ctx, ce->state);if (ret) goto err;
@@ -1106,9 +1124,7 @@ execlists_context_pin(struct intel_engine_cs *engine, ce->lrc_reg_state[CTX_RING_BUFFER_START +1 ] =i915_ggtt_offset (ce->ring->vma); - ce->state->obj->mm.dirty = true; ce->state->obj->pin_global++; -i915_gem_context_get (ctx); out:return ce->ring;
drivers/gpu/drm/i915/intel_ringbuffer.c +3 -3
@@ -1363,12 +1363,13 @@ static int context_pin(struct i915_gem_context *ctx)struct i915_vma *vma = ctx->engine[RCS ].state;int ret; -/* Clear this page out of any CPU caches for coherent swap-in/out. +/* +* Clear this page out of any CPU caches for coherent swap-in/out. * We only want to do this on the first bind so that we do not stall * on an active context (which by nature is already on the GPU). */ if (!(vma->flags &I915_VMA_GLOBAL_BIND )) { - ret =i915_gem_object_set_to_gtt_domain (vma->obj, false); + ret =i915_gem_object_set_to_gtt_domain (vma->obj, true);if (ret)return ret; }
@@ -1445,7 +1446,6 @@ intel_ring_context_pin(struct intel_engine_cs *engine,if (ret) goto err; - ce->state->obj->mm.dirty = true; ce->state->obj->pin_global++; }
Signature · 6 lines
2.15.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v5 8/9 drm/i915: Record the default hw state after reset upon load
In reply to Chris WilsonTake a copy of the HW state after a reset upon module loading by executing a context switch from a blank context to the kernel context, thus saving the default hw state over the blank context image. We can then use the default hw state to initialise any future context, ensuring that each starts with the default view of hw state.
v2: Unmap our default state from the GTT after stealing it from the context. This should stop us from accidentally overwriting it via the GTT (and frees up some precious GTT space).
Testcase: igt/gem_ctx_isolation
--- drivers/gpu/drm/i915/gvt/scheduler.c | 2 - drivers/gpu/drm/i915/i915_debugfs.c | 1 - drivers/gpu/drm/i915/i915_drv.c | 3 + drivers/gpu/drm/i915/i915_gem.c | 115 ++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/i915_gem_context.c | 55 ++++----------- drivers/gpu/drm/i915/i915_gem_context.h | 4 +- drivers/gpu/drm/i915/intel_engine_cs.c | 17 +++++ drivers/gpu/drm/i915/intel_lrc.c | 39 +++++++---- drivers/gpu/drm/i915/intel_ringbuffer.c | 45 +++++++++---- drivers/gpu/drm/i915/intel_ringbuffer.h | 2 + include/uapi/drm/i915_drm.h | 15 +++++ 11 files changed, 225 insertions(+), 73 deletions(-)
drivers/gpu/drm/i915/gvt/scheduler.c +0 -2
@@ -723,8 +723,6 @@ int intel_vgpu_init_gvt_context(struct intel_vgpu *vgpu)if (IS_ERR (vgpu->shadow_ctx))return PTR_ERR (vgpu->shadow_ctx); - vgpu->shadow_ctx->engine[RCS ].initialised = true; -bitmap_zero (vgpu->shadow_ctx_desc_updated,I915_NUM_ENGINES );return 0 ;
drivers/gpu/drm/i915/i915_debugfs.c +0 -1
@@ -1974,7 +1974,6 @@ static int i915_context_status(struct seq_file *m, void *unused)struct intel_context *ce = &ctx->engine[engine->id];seq_printf (m,"%s: " , engine->name); -seq_putc (m, ce->initialised ?'I' :'i' );if (ce->state)describe_obj (m, ce->state->obj);if (ce->ring)
drivers/gpu/drm/i915/i915_drv.c +3 -0
@@ -406,6 +406,9 @@ static int i915_getparam(struct drm_device *dev, void *data,*/ value =1 ;break ; +case I915_PARAM_HAS_CONTEXT_ISOLATION : + value =intel_engines_has_context_isolation (dev_priv); +break ;case I915_PARAM_SLICE_MASK : value =INTEL_INFO (dev_priv)->sseu.slice_mask;if (!value)
drivers/gpu/drm/i915/i915_gem.c +115 -0
127 lines not on this page · raw message
drivers/gpu/drm/i915/i915_gem_context.c +12 -43
97 lines not on this page · raw message
drivers/gpu/drm/i915/i915_gem_context.h +3 -1
@@ -157,7 +157,6 @@ struct i915_gem_context {u32 *lrc_reg_state;u64 lrc_desc;int pin_count; -bool initialised; } engine[I915_NUM_ENGINES ];/** ring_size: size for allocating the per-engine ring buffer */
@@ -292,6 +291,9 @@ int i915_gem_context_setparam_ioctl(struct drm_device *dev, void *data,int i915_gem_context_reset_stats_ioctl (struct drm_device *dev,void *data,struct drm_file *file); +struct i915_gem_context * +i915_gem_context_create_kernel (struct drm_i915_private *i915,int prio); +static inline struct i915_gem_context *i915_gem_context_get (struct i915_gem_context *ctx) {
drivers/gpu/drm/i915/intel_engine_cs.c +17 -0
@@ -687,6 +687,9 @@ void intel_engine_cleanup_common(struct intel_engine_cs *engine)intel_engine_cleanup_cmd_parser (engine);i915_gem_batch_pool_fini (&engine->batch_pool); +if (engine->default_state) +i915_gem_object_put (engine->default_state); +if (HAS_LOGICAL_RING_PREEMPTION (engine->i915)) engine->context_unpin (engine, engine->i915->preempt_context); engine->context_unpin (engine, engine->i915->kernel_context);
@@ -1701,6 +1704,20 @@ bool intel_engine_can_store_dword(struct intel_engine_cs *engine) } } +unsigned int intel_engines_has_context_isolation (struct drm_i915_private *i915) +{ +struct intel_engine_cs *engine; +enum intel_engine_id id; +unsigned int which; + + which =0 ; +for_each_engine (engine, i915, id) +if (engine->default_state) + which |=BIT (engine->uabi_class); + +return which; +} +static void print_request (struct drm_printer *m,struct drm_i915_gem_request *rq,const char *prefix)
drivers/gpu/drm/i915/intel_lrc.c +25 -14
@@ -1163,7 +1163,6 @@ static int execlists_request_alloc(struct drm_i915_gem_request *request)struct intel_engine_cs *engine = request->engine;struct intel_context *ce = &request->ctx->engine[engine->id];u32 *cs; -int ret;GEM_BUG_ON (!ce->pin_count);
@@ -1177,14 +1176,6 @@ static int execlists_request_alloc(struct drm_i915_gem_request *request)if (IS_ERR (cs))return PTR_ERR (cs); -if (!ce->initialised) { - ret = engine->init_context (request); -if (ret) -return ret; - - ce->initialised = true; - } -/* Note that after this point, we have committed to using * this request as it is being used to both track the * state of engine initialisation and liveness of the
@@ -2116,7 +2107,6 @@ static void execlists_init_reg_state(u32 *regs,CTX_REG (regs,CTX_CONTEXT_CONTROL ,RING_CONTEXT_CONTROL (engine),_MASKED_BIT_ENABLE (CTX_CTRL_INHIBIT_SYN_CTX_SWITCH | -CTX_CTRL_ENGINE_CTX_RESTORE_INHIBIT | (HAS_RESOURCE_STREAMER (dev_priv) ?CTX_CTRL_RS_CTX_ENABLE :0 )));CTX_REG (regs,CTX_RING_HEAD ,RING_HEAD (base),0 );
@@ -2193,6 +2183,7 @@ populate_lr_context(struct i915_gem_context *ctx, struct intel_ring *ring) {void *vaddr; +u32 *regs;int ret; ret =i915_gem_object_set_to_cpu_domain (ctx_obj, true);
@@ -2209,11 +2200,32 @@ populate_lr_context(struct i915_gem_context *ctx, } ctx_obj->mm.dirty = true; +if (engine->default_state) { +/* +* We only want to copy over the template context state; +* skipping over the headers reserved for GuC comunication, +* leaving those as zero. +*/ +const unsigned long start =LRC_HEADER_PAGES *PAGE_SIZE ; +void *defaults; + + defaults =i915_gem_object_pin_map (engine->default_state, +I915_MAP_WB ); +if (IS_ERR (defaults)) +return PTR_ERR (defaults); + +memcpy (vaddr + start, defaults + start, engine->context_size); +i915_gem_object_unpin_map (engine->default_state); + } +/* The second page of the context object contains some fields which must * be set up prior to the first execution. */ - -execlists_init_reg_state (vaddr +LRC_STATE_PN *PAGE_SIZE , - ctx, engine, ring); + regs = vaddr +LRC_STATE_PN *PAGE_SIZE ; +execlists_init_reg_state (regs, ctx, engine, ring); +if (!engine->default_state) { + regs[CTX_CONTEXT_CONTROL +1 ] |= +_MASKED_BIT_ENABLE (CTX_CTRL_ENGINE_CTX_RESTORE_INHIBIT ); + }i915_gem_object_unpin_map (ctx_obj);
@@ -2266,7 +2278,6 @@ static int execlists_context_deferred_alloc(struct i915_gem_context *ctx, ce->ring = ring; ce->state = vma; - ce->initialised |= engine->init_context ==NULL ;return 0 ;
drivers/gpu/drm/i915/intel_ringbuffer.c +33 -12
70 lines not on this page · raw message
drivers/gpu/drm/i915/intel_ringbuffer.h +2 -0
@@ -307,6 +307,7 @@ struct intel_engine_cs {struct intel_ring *buffer;struct intel_timeline *timeline; +struct drm_i915_gem_object *default_state;struct intel_render_state *render_state;atomic_t irq_count;
@@ -933,6 +934,7 @@ void intel_engines_park(struct drm_i915_private *i915);void intel_engines_unpark (struct drm_i915_private *i915);void intel_engines_reset_default_submission (struct drm_i915_private *i915); +unsigned int intel_engines_has_context_isolation (struct drm_i915_private *i915);bool intel_engine_can_store_dword (struct intel_engine_cs *engine);
include/uapi/drm/i915_drm.h +15 -0
@@ -465,6 +465,21 @@ typedef struct drm_i915_irq_wait {*/ #define I915_PARAM_HAS_EXEC_FENCE_ARRAY 49 +/* +* Query whether every context (both per-file default and user created) is +* isolated (insofar as HW supports). If this parameter is not true, then +* freshly created contexts may inherit values from an existing context, +* rather than default HW values. If true, it also ensures (insofar as HW +* supports) that all state set by this context will not leak to any other +* context. +* +* As not every engine across every gen support contexts, the returned +* value reports the support of context isolation for individual engines by +* returning a bitmask of each engine class set to true if that class supports +* isolation. +*/ +#define I915_PARAM_HAS_CONTEXT_ISOLATION 50 + typedef struct drm_i915_getparam { __s32 param; /*
Signature · 6 lines
2.15.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v5 9/9 drm/i915: Stop caching the "golden" renderstate
In reply to Chris WilsonAs we now record the default HW state and so only emit the "golden" renderstate once to prepare the HW, there is no advantage in keeping the renderstate batch around as it will never be used again.
--- drivers/gpu/drm/i915/i915_drv.h | 1 - drivers/gpu/drm/i915/i915_gem_render_state.c | 141 +++++++++------------------ drivers/gpu/drm/i915/i915_gem_render_state.h | 4 +- drivers/gpu/drm/i915/intel_engine_cs.c | 9 +- drivers/gpu/drm/i915/intel_lrc.c | 1 + drivers/gpu/drm/i915/intel_ringbuffer.c | 5 +- drivers/gpu/drm/i915/intel_ringbuffer.h | 2 - 7 files changed, 54 insertions(+), 109 deletions(-)
drivers/gpu/drm/i915/i915_drv.h +0 -1
@@ -67,7 +67,6 @@#include "i915_gem_fence_reg.h" #include "i915_gem_object.h" #include "i915_gem_gtt.h" -#include "i915_gem_render_state.h" #include "i915_gem_request.h" #include "i915_gem_timeline.h"
drivers/gpu/drm/i915/i915_gem_render_state.c +47 -94
208 lines not on this page · raw message
drivers/gpu/drm/i915/i915_gem_render_state.h +1 -3
@@ -26,8 +26,6 @@struct drm_i915_gem_request ; -int i915_gem_render_state_init (struct intel_engine_cs *engine); -int i915_gem_render_state_emit (struct drm_i915_gem_request *req); -void i915_gem_render_state_fini (struct intel_engine_cs *engine); +int i915_gem_render_state_emit (struct drm_i915_gem_request *rq);#endif /* _I915_GEM_RENDER_STATE_H_ */
drivers/gpu/drm/i915/intel_engine_cs.c +1 -8
@@ -641,21 +641,15 @@ int intel_engine_init_common(struct intel_engine_cs *engine)if (ret) goto err_unpin_preempt; - ret =i915_gem_render_state_init (engine); -if (ret) - goto err_breadcrumbs; -if (HWS_NEEDS_PHYSICAL (engine->i915)) ret =init_phys_status_page (engine);else ret =init_status_page (engine);if (ret) - goto err_rs_fini; + goto err_breadcrumbs;return 0 ; -err_rs_fini: -i915_gem_render_state_fini (engine); err_breadcrumbs:intel_engine_fini_breadcrumbs (engine); err_unpin_preempt:
@@ -682,7 +676,6 @@ void intel_engine_cleanup_common(struct intel_engine_cs *engine)else cleanup_status_page (engine); -i915_gem_render_state_fini (engine);intel_engine_fini_breadcrumbs (engine);intel_engine_cleanup_cmd_parser (engine);i915_gem_batch_pool_fini (&engine->batch_pool);
drivers/gpu/drm/i915/intel_lrc.c +1 -0
@@ -136,6 +136,7 @@#include <drm/drmP.h> #include <drm/i915_drm.h> #include "i915_drv.h" +#include "i915_gem_render_state.h" #include "intel_mocs.h" #define RING_EXECLIST_QFULL (1 << 0x2)
drivers/gpu/drm/i915/intel_ringbuffer.c +4 -1
@@ -28,9 +28,12 @@*/ #include <linux/log2.h> +#include <drm/drmP.h> -#include "i915_drv.h" #include <drm/i915_drm.h> + +#include "i915_drv.h" +#include "i915_gem_render_state.h" #include "i915_trace.h" #include "intel_drv.h"
drivers/gpu/drm/i915/intel_ringbuffer.h +0 -2
@@ -166,7 +166,6 @@ struct i915_ctx_workarounds { };struct drm_i915_gem_request ; -struct intel_render_state ;/* * Engine IDs definitions.
@@ -308,7 +307,6 @@ struct intel_engine_cs {struct intel_timeline *timeline;struct drm_i915_gem_object *default_state; -struct intel_render_state *render_state;atomic_t irq_count;unsigned long irq_posted;
Signature · 6 lines
2.15.0 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.BAT: failure for series starting with [v5,1/9] drm/i915: Include engine state on detecting a missed breadcrumb/seqno
In reply to Chris Wilson== Series Details ==
== Series Details ==
Series: series starting with [v5,1/9] drm/i915: Include engine state on detecting a missed breadcrumb/seqno
URL : https://patchwork.freedesktop.org/series/33452/
State : failure
== Summary ==
CHK include/config/kernel.release CHK include/generated/uapi/linux/version.h CHK include/generated/utsrelease.h CHK include/generated/bounds.h CHK include/generated/timeconst.h CHK include/generated/asm-offsets.h CALL scripts/checksyscalls.sh CHK scripts/mod/devicetable-offsets.h CHK include/generated/compile.h CHK kernel/config_data.h CC [M] drivers/gpu/drm/i915/intel_display.o
drivers/gpu/drm/i915/intel_display.c: In function ‘intel_modeset_gem_init’:drivers/gpu/drm/i915/intel_display.c:15192:1: error: version control conflict marker in file
<<<<<<< HEAD
^~~~~~~drivers/gpu/drm/i915/intel_display.c:15194:1: error: version control conflict marker in file
=======
^~~~~~~drivers/gpu/drm/i915/intel_display.c:15196:1: error: version control conflict marker in file
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
drm/i915: Move GT powersaving init to
i915_gem_init()
^~~~~~~drivers/gpu/drm/i915/intel_display.c:15190:27: error: unused variable ‘dev_priv’ [-Werror=unused-variable]
struct drm_i915_private *dev_priv = to_i915(dev);
^~~~~~~~cc1: all warnings being treated as errorsscripts/Makefile.build:314: recipe for target 'drivers/gpu/drm/i915/intel_display.o' failed make[4]: *** [drivers/gpu/drm/i915/intel_display.o] Error 1 scripts/Makefile.build:573: recipe for target 'drivers/gpu/drm/i915' failed make[3]: *** [drivers/gpu/drm/i915] Error 2scripts/Makefile.build:573: recipe for target 'drivers/gpu/drm' failed make[2]: *** [drivers/gpu/drm] Error 2scripts/Makefile.build:573: recipe for target 'drivers/gpu' failed
make[1]: *** [drivers/gpu] Error 2
Makefile:1024: recipe for target 'drivers' failed
make: *** [drivers] Error 2
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: ✗ Fi.CI.BAT: failure for series starting with [v5,1/9] drm/i915: Include engine state on detecting a missed breadcrumb/seqno
Quoting Patchwork (2017-11-08 19:45:20)
Quoted 27 lines
== Series Details ==
Series: series starting with [v5,1/9] drm/i915: Include engine state on detecting a missed breadcrumb/seqno
URL : https://patchwork.freedesktop.org/series/33452/
State : failure== Summary ==
CHK include/config/kernel.release CHK include/generated/uapi/linux/version.h CHK include/generated/utsrelease.h CHK include/generated/bounds.h CHK include/generated/timeconst.h CHK include/generated/asm-offsets.h CALL scripts/checksyscalls.sh CHK scripts/mod/devicetable-offsets.h CHK include/generated/compile.h CHK kernel/config_data.h CC [M] drivers/gpu/drm/i915/intel_display.o
drivers/gpu/drm/i915/intel_display.c: In function ‘intel_modeset_gem_init’:drivers/gpu/drm/i915/intel_display.c:15192:1: error: version control conflict marker in file
<<<<<<< HEAD
^~~~~~~drivers/gpu/drm/i915/intel_display.c:15194:1: error: version control conflict marker in file
=======
^~~~~~~drivers/gpu/drm/i915/intel_display.c:15196:1: error: version control conflict marker in file
Quoted 5 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
drm/i915: Move GT powersaving init to
i915_gem_init()^~~~~~~
drivers/gpu/drm/i915/intel_display.c:15190:27: error: unused variable ‘dev_priv’ [-Werror=unused-variable]struct drm_i915_private *dev_priv = to_i915(dev); ^~~~~~~~
So if we are not meant to be sending patches based on drm-tip, what tree should we be using? >:
-Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.BAT: failure for series starting with [v5,1/9] drm/i915: Include engine state on detecting a missed breadcrumb/seqno
In reply to Chris Wilson== Series Details ==
== Series Details ==
Series: series starting with [v5,1/9] drm/i915: Include engine state on detecting a missed breadcrumb/seqno
URL : https://patchwork.freedesktop.org/series/33452/
State : failure
== Summary ==
Series 33452v1 series starting with [v5,1/9] drm/i915: Include engine state on detecting a missed breadcrumb/seqno
https://patchwork.freedesktop.org/api/1.0/series/33452/revisions/1/mbox/
Test gem_ctx_basic:
fail -> SKIP (fi-gdg-551)
Test gem_exec_reloc:
Subgroup basic-cpu-active:
fail -> PASS (fi-gdg-551) fdo#102582 +4
Test gem_ringfill:
Subgroup basic-default-hang:
pass -> INCOMPLETE (fi-byt-n2820)
Test gem_sync:
Subgroup basic-store-all:
fail -> PASS (fi-ivb-3520m) fdo#100007
Test kms_busy:
Subgroup basic-flip-a:
pass -> FAIL (fi-gdg-551) fdo#102654 +1
Test kms_cursor_legacy:
Subgroup basic-busy-flip-before-cursor-legacy:
pass -> FAIL (fi-gdg-551) fdo#102618
Subgroup basic-flip-after-cursor-legacy:
pass -> SKIP (fi-hsw-4770r)fdo#102582 https://bugs.freedesktop.org/show_bug.cgi?id=102582
fdo#100007 https://bugs.freedesktop.org/show_bug.cgi?id=100007
fdo#102654 https://bugs.freedesktop.org/show_bug.cgi?id=102654
fdo#102618 https://bugs.freedesktop.org/show_bug.cgi?id=102618
fi-bdw-5557u total:289 pass:268 dwarn:0 dfail:0 fail:0 skip:21 time:444s fi-bdw-gvtdvm total:289 pass:265 dwarn:0 dfail:0 fail:0 skip:24 time:457s fi-blb-e6850 total:289 pass:223 dwarn:1 dfail:0 fail:0 skip:65 time:381s fi-bsw-n3050 total:289 pass:243 dwarn:0 dfail:0 fail:0 skip:46 time:542s fi-bwr-2160 total:289 pass:183 dwarn:0 dfail:0 fail:0 skip:106 time:273s fi-bxt-dsi total:289 pass:259 dwarn:0 dfail:0 fail:0 skip:30 time:500s fi-bxt-j4205 total:289 pass:260 dwarn:0 dfail:0 fail:0 skip:29 time:501s fi-byt-j1900 total:289 pass:254 dwarn:0 dfail:0 fail:0 skip:35 time:496s fi-byt-n2820 total:156 pass:133 dwarn:0 dfail:0 fail:0 skip:22 fi-elk-e7500 total:289 pass:229 dwarn:0 dfail:0 fail:0 skip:60 time:428s fi-gdg-551 total:289 pass:175 dwarn:1 dfail:0 fail:4 skip:109 time:277s fi-glk-1 total:289 pass:261 dwarn:0 dfail:0 fail:0 skip:28 time:538s fi-hsw-4770 total:289 pass:262 dwarn:0 dfail:0 fail:0 skip:27 time:431s fi-hsw-4770r total:289 pass:261 dwarn:0 dfail:0 fail:0 skip:28 time:436s fi-ilk-650 total:289 pass:228 dwarn:0 dfail:0 fail:0 skip:61 time:425s fi-ivb-3520m total:289 pass:260 dwarn:0 dfail:0 fail:0 skip:29 time:481s fi-ivb-3770 total:289 pass:260 dwarn:0 dfail:0 fail:0 skip:29 time:461s fi-kbl-7500u total:289 pass:264 dwarn:1 dfail:0 fail:0 skip:24 time:483s fi-kbl-7560u total:289 pass:270 dwarn:0 dfail:0 fail:0 skip:19 time:515s fi-kbl-7567u total:289 pass:269 dwarn:0 dfail:0 fail:0 skip:20 time:482s fi-kbl-r total:289 pass:262 dwarn:0 dfail:0 fail:0 skip:27 time:534s fi-pnv-d510 total:289 pass:222 dwarn:1 dfail:0 fail:0 skip:66 time:583s fi-skl-6260u total:289 pass:269 dwarn:0 dfail:0 fail:0 skip:20 time:453s fi-skl-6600u total:289 pass:262 dwarn:0 dfail:0 fail:0 skip:27 time:549s fi-skl-6700hq total:289 pass:263 dwarn:0 dfail:0 fail:0 skip:26 time:563s fi-skl-6700k total:289 pass:265 dwarn:0 dfail:0 fail:0 skip:24 time:522s fi-skl-6770hq total:289 pass:269 dwarn:0 dfail:0 fail:0 skip:20 time:492s fi-skl-gvtdvm total:289 pass:266 dwarn:0 dfail:0 fail:0 skip:23 time:458s fi-snb-2520m total:289 pass:250 dwarn:0 dfail:0 fail:0 skip:39 time:563s fi-snb-2600 total:289 pass:249 dwarn:0 dfail:0 fail:0 skip:40 time:418s Blacklisted hosts: fi-cnl-y total:289 pass:260 dwarn:0 dfail:0 fail:2 skip:27 time:567s fi-glk-dsi total:289 pass:259 dwarn:0 dfail:0 fail:0 skip:30 time:490s
65dc54b704d3ee0486f9f5b11f00c28973f783a2 drm-tip: 2017y-11m-09d-08h-53m-46s UTC integration manifest 0c8c4a6a3f63 drm/i915: Stop caching the "golden" renderstate528a4ce78ed7 drm/i915: Record the default hw state after reset upon load 1106020bc009 drm/i915: Mark the context state as dirty/written619ba0893cd9 drm/i915: Inline intel_modeset_gem_init()50252cc19f5c drm/i915: Move intel_init_clock_gating() to i915_gem_init() ccae92ebc55d drm/i915: Move GT powersaving init to i915_gem_init()161777f07799 drm/i915: Force the switch to the i915->kernel_context0695687350ee drm/i915: Define an engine class enum for the uABI5282596b7c4c drm/i915: Include engine state on detecting a missed breadcrumb/seqno
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7029/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.BAT: warning for series starting with [v5,1/9] drm/i915: Include engine state on detecting a missed breadcrumb/seqno (rev3)
In reply to Chris Wilson== Series Details ==
== Series Details ==
Series: series starting with [v5,1/9] drm/i915: Include engine state on detecting a missed breadcrumb/seqno (rev3)
URL : https://patchwork.freedesktop.org/series/33452/
State : warning
== Summary ==
Series 33452v3 series starting with [v5,1/9] drm/i915: Include engine state on detecting a missed breadcrumb/seqno
https://patchwork.freedesktop.org/api/1.0/series/33452/revisions/3/mbox/
Test kms_cursor_legacy:
Subgroup basic-flip-before-cursor-atomic:
pass -> DMESG-WARN (fi-bsw-n3050)fi-bdw-5557u total:289 pass:268 dwarn:0 dfail:0 fail:0 skip:21 time:447s fi-bdw-gvtdvm total:289 pass:265 dwarn:0 dfail:0 fail:0 skip:24 time:459s fi-blb-e6850 total:289 pass:223 dwarn:1 dfail:0 fail:0 skip:65 time:382s fi-bsw-n3050 total:289 pass:242 dwarn:1 dfail:0 fail:0 skip:46 time:540s fi-bwr-2160 total:289 pass:183 dwarn:0 dfail:0 fail:0 skip:106 time:275s fi-bxt-dsi total:289 pass:259 dwarn:0 dfail:0 fail:0 skip:30 time:500s fi-bxt-j4205 total:289 pass:260 dwarn:0 dfail:0 fail:0 skip:29 time:511s fi-byt-j1900 total:289 pass:254 dwarn:0 dfail:0 fail:0 skip:35 time:494s fi-byt-n2820 total:289 pass:250 dwarn:0 dfail:0 fail:0 skip:39 time:498s fi-elk-e7500 total:289 pass:229 dwarn:0 dfail:0 fail:0 skip:60 time:430s fi-gdg-551 total:289 pass:178 dwarn:1 dfail:0 fail:1 skip:109 time:263s fi-glk-1 total:289 pass:261 dwarn:0 dfail:0 fail:0 skip:28 time:543s fi-hsw-4770 total:289 pass:262 dwarn:0 dfail:0 fail:0 skip:27 time:431s fi-hsw-4770r total:289 pass:262 dwarn:0 dfail:0 fail:0 skip:27 time:438s fi-ilk-650 total:289 pass:228 dwarn:0 dfail:0 fail:0 skip:61 time:426s fi-ivb-3520m total:289 pass:260 dwarn:0 dfail:0 fail:0 skip:29 time:492s fi-ivb-3770 total:289 pass:260 dwarn:0 dfail:0 fail:0 skip:29 time:459s fi-kbl-7500u total:289 pass:264 dwarn:1 dfail:0 fail:0 skip:24 time:487s fi-kbl-7560u total:289 pass:270 dwarn:0 dfail:0 fail:0 skip:19 time:523s fi-kbl-7567u total:289 pass:269 dwarn:0 dfail:0 fail:0 skip:20 time:476s fi-kbl-r total:289 pass:262 dwarn:0 dfail:0 fail:0 skip:27 time:535s fi-pnv-d510 total:289 pass:222 dwarn:1 dfail:0 fail:0 skip:66 time:573s fi-skl-6260u total:289 pass:269 dwarn:0 dfail:0 fail:0 skip:20 time:454s fi-skl-6600u total:289 pass:262 dwarn:0 dfail:0 fail:0 skip:27 time:547s fi-skl-6700hq total:289 pass:263 dwarn:0 dfail:0 fail:0 skip:26 time:561s fi-skl-6700k total:289 pass:265 dwarn:0 dfail:0 fail:0 skip:24 time:517s fi-skl-6770hq total:289 pass:269 dwarn:0 dfail:0 fail:0 skip:20 time:493s fi-skl-gvtdvm total:289 pass:266 dwarn:0 dfail:0 fail:0 skip:23 time:461s fi-snb-2520m total:289 pass:250 dwarn:0 dfail:0 fail:0 skip:39 time:557s fi-snb-2600 total:289 pass:249 dwarn:0 dfail:0 fail:0 skip:40 time:424s Blacklisted hosts: fi-cfl-s total:289 pass:254 dwarn:3 dfail:0 fail:0 skip:32 time:540s fi-cnl-y total:289 pass:261 dwarn:0 dfail:0 fail:1 skip:27 time:550s fi-glk-dsi total:289 pass:259 dwarn:0 dfail:0 fail:0 skip:30 time:497s
c36994b067f0771eee4d3136f40c0c6040a8fa77 drm-tip: 2017y-11m-10d-11h-48m-19s UTC integration manifest 93d8c14b43b5 drm/i915: Stop caching the "golden" renderstatea85db8f2b31f drm/i915: Record the default hw state after reset upon load 72548ae0b293 drm/i915: Mark the context state as dirty/writtenf55cbe8ee5ec drm/i915: Inline intel_modeset_gem_init()fe2ab7c41411 drm/i915: Move intel_init_clock_gating() to i915_gem_init() 6aab922466d6 drm/i915: Move GT powersaving init to i915_gem_init()6b6c6918fabb drm/i915: Force the switch to the i915->kernel_contextfda06e94d307 drm/i915: Define an engine class enum for the uABIf60ae93cab98 drm/i915: Include engine state on detecting a missed breadcrumb/seqno
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7059/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx