Re: [PATCH v7 09/12] drm/i915: add a new perf configuration execbuf parameter

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 09/07/2019 12:58, Chris Wilson wrote:
Quoting Lionel Landwerlin (2019-07-09 10:32:05)
+static int eb_oa_config(struct i915_execbuffer *eb)
+{
+       int err;
+
+       if (!eb->oa_config)
+               return 0;
+
+       err = i915_active_request_set(&eb->engine->last_oa_config,
+                                     eb->request);
This is outside of the eb->request->timeline->mutex and needs a mutex.


Can I do this inside i915_request_add() when rq->flags & I915_REQUEST_FLAGS_PERF ?



+       if (err)
+               return err;
+
+       /*
+        * If the config hasn't changed, skip reconfiguring the HW (this is
+        * subject to a delay we want to avoid has much as possible).
+        */
+       if (eb->oa_config == eb->i915->perf.oa.exclusive_stream->oa_config)
+               return 0;
+
+       err = i915_vma_move_to_active(eb->oa_vma, eb->request, 0);
+       if (err)
+               return err;
+
+       err = eb->engine->emit_bb_start(eb->request,
+                                       eb->oa_vma->node.start,
+                                       0, I915_DISPATCH_SECURE);
+       if (err)
+               return err;
+
+       swap(eb->oa_config, eb->i915->perf.oa.exclusive_stream->oa_config);
As does this this. So which mutex is to guard
i915->perf.oa.exclusive_stream->oa_config ?

Is i915->perf.metrics_locks sensible to guard [data within] this function?
-Chris

Oh sorry, I missed that again...

At the moment it would be i915->drm.struct_mutex but this could be a bit finer on the engine.


-Lionel

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux