]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - drivers/gpu/drm/i915/gt/uc/intel_guc_ct.h
drm/i915/guc/ct: Group request-related variables in a sub-structure
[linux.git] / drivers / gpu / drm / i915 / gt / uc / intel_guc_ct.h
index 7c24d83f5c24125b30da4bca6a24e9ba82086cd8..29a026dc3a132d9e6f6a508c9d00df8448b8a777 100644 (file)
@@ -35,44 +35,28 @@ struct intel_guc_ct_buffer {
        u32 *cmds;
 };
 
-/** Represents pair of command transport buffers.
- *
- * Buffers go in pairs to allow bi-directional communication.
- * To simplify the code we place both of them in the same vma.
- * Buffers from the same pair must share unique owner id.
- *
- * @vma: pointer to the vma with pair of CT buffers
- * @ctbs: buffers for sending(0) and receiving(1) commands
- * @owner: unique identifier
- * @next_fence: fence to be used with next send command
- */
-struct intel_guc_ct_channel {
-       struct i915_vma *vma;
-       struct intel_guc_ct_buffer ctbs[2];
-       u32 owner;
-       u32 next_fence;
-       bool enabled;
-};
 
-/** Holds all command transport channels.
+/** Top-level structure for Command Transport related data
  *
- * @host_channel: main channel used by the host
+ * Includes a pair of CT buffers for bi-directional communication and tracking
+ * for the H2G and G2H requests sent and received through the buffers.
  */
 struct intel_guc_ct {
-       struct intel_guc_ct_channel host_channel;
-       /* other channels are tbd */
+       struct i915_vma *vma;
+       bool enabled;
 
-       /** @lock: protects pending requests list */
-       spinlock_t lock;
+       /* buffers for sending(0) and receiving(1) commands */
+       struct intel_guc_ct_buffer ctbs[2];
 
-       /** @pending_requests: list of requests waiting for response */
-       struct list_head pending_requests;
+       struct {
+               u32 next_fence; /* fence to be used with next request to send */
 
-       /** @incoming_requests: list of incoming requests */
-       struct list_head incoming_requests;
+               spinlock_t lock; /* protects pending requests list */
+               struct list_head pending; /* requests waiting for response */
 
-       /** @worker: worker for handling incoming requests */
-       struct work_struct worker;
+               struct list_head incoming; /* incoming requests */
+               struct work_struct worker; /* handler for incoming requests */
+       } requests;
 };
 
 void intel_guc_ct_init_early(struct intel_guc_ct *ct);
@@ -81,11 +65,6 @@ void intel_guc_ct_fini(struct intel_guc_ct *ct);
 int intel_guc_ct_enable(struct intel_guc_ct *ct);
 void intel_guc_ct_disable(struct intel_guc_ct *ct);
 
-static inline void intel_guc_ct_stop(struct intel_guc_ct *ct)
-{
-       ct->host_channel.enabled = false;
-}
-
 int intel_guc_send_ct(struct intel_guc *guc, const u32 *action, u32 len,
                      u32 *response_buf, u32 response_buf_size);
 void intel_guc_to_host_event_handler_ct(struct intel_guc *guc);