* [PATCH] i965: Always try to create a logical context
@ 2017-11-20 9:29 Chris Wilson
2017-11-20 18:43 ` Kenneth Graunke
0 siblings, 1 reply; 2+ messages in thread
From: Chris Wilson @ 2017-11-20 9:29 UTC (permalink / raw)
To: intel-gfx; +Cc: Jason Ekstrand, Kenneth Graunke
Always enable use of HW logical contexts to preserve GPU state between
batches when the kernel supports such constructs, continuing to enforce
the required support for gen6+.
At runtime, this effectively removes the BRW_NEW_CONTEXT flag (and the
upload of invariant state) from the start of every batch for any kernel
supporting contexts. So long as the older atoms are correctly listening
to the right flag (NEW_CONTEXT rather than NEW_BATCH) this should
eliminate a few redundant state uploads for the older platforms.
Cc: Jason Ekstrand <jason.ekstrand@intel.com>
Cc: Kenneth Graunke <kenneth@whitecape.org>
---
src/mesa/drivers/dri/i965/brw_context.c | 29 ++++++++++++++---------------
1 file changed, 14 insertions(+), 15 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c
index 7038f9da59..e2d7f0d296 100644
--- a/src/mesa/drivers/dri/i965/brw_context.c
+++ b/src/mesa/drivers/dri/i965/brw_context.c
@@ -966,22 +966,21 @@ brwCreateContext(gl_api api,
intel_batchbuffer_init(brw);
- if (devinfo->gen >= 6) {
- /* Create a new hardware context. Using a hardware context means that
- * our GPU state will be saved/restored on context switch, allowing us
- * to assume that the GPU is in the same state we left it in.
- *
- * This is required for transform feedback buffer offsets, query objects,
- * and also allows us to reduce how much state we have to emit.
- */
- brw->hw_ctx = brw_create_hw_context(brw->bufmgr);
-
- if (!brw->hw_ctx) {
- fprintf(stderr, "Failed to create hardware context.\n");
- intelDestroyContext(driContextPriv);
- return false;
- }
+ /* Create a new hardware context. Using a hardware context means that
+ * our GPU state will be saved/restored on context switch, allowing us
+ * to assume that the GPU is in the same state we left it in.
+ *
+ * This is required for transform feedback buffer offsets, query objects,
+ * and also allows us to reduce how much state we have to emit.
+ */
+ brw->hw_ctx = brw_create_hw_context(brw->bufmgr);
+ if (!brw->hw_ctx && devinfo->gen >= 6) {
+ fprintf(stderr, "Failed to create hardware context.\n");
+ intelDestroyContext(driContextPriv);
+ return false;
+ }
+ if (brw->hw_ctx) {
int hw_priority = BRW_CONTEXT_MEDIUM_PRIORITY;
if (ctx_config->attribute_mask & __DRIVER_CONTEXT_ATTRIB_PRIORITY) {
switch (ctx_config->priority) {
--
2.15.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] i965: Always try to create a logical context
2017-11-20 9:29 [PATCH] i965: Always try to create a logical context Chris Wilson
@ 2017-11-20 18:43 ` Kenneth Graunke
0 siblings, 0 replies; 2+ messages in thread
From: Kenneth Graunke @ 2017-11-20 18:43 UTC (permalink / raw)
To: Chris Wilson; +Cc: Jason Ekstrand, intel-gfx
[-- Attachment #1.1: Type: text/plain, Size: 890 bytes --]
On Monday, November 20, 2017 1:29:42 AM PST Chris Wilson wrote:
> Always enable use of HW logical contexts to preserve GPU state between
> batches when the kernel supports such constructs, continuing to enforce
> the required support for gen6+.
>
> At runtime, this effectively removes the BRW_NEW_CONTEXT flag (and the
> upload of invariant state) from the start of every batch for any kernel
> supporting contexts. So long as the older atoms are correctly listening
> to the right flag (NEW_CONTEXT rather than NEW_BATCH) this should
> eliminate a few redundant state uploads for the older platforms.
>
> Cc: Jason Ekstrand <jason.ekstrand@intel.com>
> Cc: Kenneth Graunke <kenneth@whitecape.org>
Nice, I saw Ironlake RC6 go by and was wondering if contexts were up
next :)
It makes sense to use them if the kernel supports them.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
[-- Attachment #1.2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
[-- Attachment #2: Type: text/plain, Size: 160 bytes --]
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-11-20 18:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-20 9:29 [PATCH] i965: Always try to create a logical context Chris Wilson
2017-11-20 18:43 ` Kenneth Graunke
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox