Skip to content

Commit edfd93e

Browse files
mwajdeczjohnharr-intel
authored andcommitted
drm/i915/guc: Use FAST_REQUEST for non-blocking H2G calls
In addition to the already defined REQUEST HXG message format, which is used when sender expects some confirmation or data, HXG protocol includes definition of the FAST REQUEST message, that may be used when sender does not expect any useful data to be returned. Using this instead of GUC_HXG_TYPE_EVENT for non-blocking CTB requests will allow GuC to send back GUC_HXG_TYPE_RESPONSE_FAILURE in case of errors. Note that it is not possible to return such errors to the caller, since this is for non-blocking calls and the related fence is not stored. Instead such messages are treated as unexpected, which will give an indication of potential GuC misprogramming that warrants extra debugging effort. Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Signed-off-by: John Harrison <John.C.Harrison@Intel.com> Reviewed-by: John Harrison <John.C.Harrison@Intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230526235538.2230780-2-John.C.Harrison@Intel.com
1 parent 5945d8b commit edfd93e

2 files changed

Lines changed: 33 additions & 3 deletions

File tree

drivers/gpu/drm/i915/gt/uc/abi/guc_messages_abi.h

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
* | | 30:28 | **TYPE** - message type |
2525
* | | | - _`GUC_HXG_TYPE_REQUEST` = 0 |
2626
* | | | - _`GUC_HXG_TYPE_EVENT` = 1 |
27+
* | | | - _`GUC_HXG_TYPE_FAST_REQUEST` = 2 |
2728
* | | | - _`GUC_HXG_TYPE_NO_RESPONSE_BUSY` = 3 |
2829
* | | | - _`GUC_HXG_TYPE_NO_RESPONSE_RETRY` = 5 |
2930
* | | | - _`GUC_HXG_TYPE_RESPONSE_FAILURE` = 6 |
@@ -46,6 +47,7 @@
4647
#define GUC_HXG_MSG_0_TYPE (0x7 << 28)
4748
#define GUC_HXG_TYPE_REQUEST 0u
4849
#define GUC_HXG_TYPE_EVENT 1u
50+
#define GUC_HXG_TYPE_FAST_REQUEST 2u
4951
#define GUC_HXG_TYPE_NO_RESPONSE_BUSY 3u
5052
#define GUC_HXG_TYPE_NO_RESPONSE_RETRY 5u
5153
#define GUC_HXG_TYPE_RESPONSE_FAILURE 6u
@@ -89,6 +91,34 @@
8991
#define GUC_HXG_REQUEST_MSG_0_ACTION (0xffff << 0)
9092
#define GUC_HXG_REQUEST_MSG_n_DATAn GUC_HXG_MSG_n_PAYLOAD
9193

94+
/**
95+
* DOC: HXG Fast Request
96+
*
97+
* The `HXG Request`_ message should be used to initiate asynchronous activity
98+
* for which confirmation or return data is not expected.
99+
*
100+
* If confirmation is required then `HXG Request`_ shall be used instead.
101+
*
102+
* The recipient of this message may only use `HXG Failure`_ message if it was
103+
* unable to accept this request (like invalid data).
104+
*
105+
* Format of `HXG Fast Request`_ message is same as `HXG Request`_ except @TYPE.
106+
*
107+
* +---+-------+--------------------------------------------------------------+
108+
* | | Bits | Description |
109+
* +===+=======+==============================================================+
110+
* | 0 | 31 | ORIGIN - see `HXG Message`_ |
111+
* | +-------+--------------------------------------------------------------+
112+
* | | 30:28 | TYPE = `GUC_HXG_TYPE_FAST_REQUEST`_ |
113+
* | +-------+--------------------------------------------------------------+
114+
* | | 27:16 | DATA0 - see `HXG Request`_ |
115+
* | +-------+--------------------------------------------------------------+
116+
* | | 15:0 | ACTION - see `HXG Request`_ |
117+
* +---+-------+--------------------------------------------------------------+
118+
* |...| | DATAn - see `HXG Request`_ |
119+
* +---+-------+--------------------------------------------------------------+
120+
*/
121+
92122
/**
93123
* DOC: HXG Event
94124
*

drivers/gpu/drm/i915/gt/uc/intel_guc_ct.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -426,11 +426,11 @@ static int ct_write(struct intel_guc_ct *ct,
426426
FIELD_PREP(GUC_CTB_MSG_0_NUM_DWORDS, len) |
427427
FIELD_PREP(GUC_CTB_MSG_0_FENCE, fence);
428428

429-
type = (flags & INTEL_GUC_CT_SEND_NB) ? GUC_HXG_TYPE_EVENT :
429+
type = (flags & INTEL_GUC_CT_SEND_NB) ? GUC_HXG_TYPE_FAST_REQUEST :
430430
GUC_HXG_TYPE_REQUEST;
431431
hxg = FIELD_PREP(GUC_HXG_MSG_0_TYPE, type) |
432-
FIELD_PREP(GUC_HXG_EVENT_MSG_0_ACTION |
433-
GUC_HXG_EVENT_MSG_0_DATA0, action[0]);
432+
FIELD_PREP(GUC_HXG_REQUEST_MSG_0_ACTION |
433+
GUC_HXG_REQUEST_MSG_0_DATA0, action[0]);
434434

435435
CT_DEBUG(ct, "writing (tail %u) %*ph %*ph %*ph\n",
436436
tail, 4, &header, 4, &hxg, 4 * (len - 1), &action[1]);

0 commit comments

Comments
 (0)