diff options
author | Suraj Kandpal <[email protected]> | 2024-01-24 10:22:48 +0530 |
---|---|---|
committer | Daniele Ceraolo Spurio <[email protected]> | 2024-02-01 13:25:47 -0800 |
commit | d6beadc8d7326adf4fb6e62bb0453b17b93816c7 (patch) | |
tree | 3b2958b50425e1fad86b35e20eacd22487a2d3d6 | |
parent | 5bd24e78829ad569fa1c3ce9a05b59bb97b91f3d (diff) |
drm/xe/gsc: Add status check during gsc header readout
Before checking if data is present in the message reply check the
status in header and see if it indicates any error.
--v2
- Use drm_err() instead of drm_dbg_kms() [Daniele]
--v3
- Use &xe->drm in drm_err to make it more cleaner [Daniele]
Cc: Daniele Ceraolo Spurio <[email protected]>
Signed-off-by: Suraj Kandpal <[email protected]>
Reviewed-by: Daniele Ceraolo Spurio <[email protected]>
Signed-off-by: Daniele Ceraolo Spurio <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
-rw-r--r-- | drivers/gpu/drm/xe/xe_gsc_submit.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/gpu/drm/xe/xe_gsc_submit.c b/drivers/gpu/drm/xe/xe_gsc_submit.c index 9ecc1ead6844..348994b271be 100644 --- a/drivers/gpu/drm/xe/xe_gsc_submit.c +++ b/drivers/gpu/drm/xe/xe_gsc_submit.c @@ -125,11 +125,18 @@ int xe_gsc_read_out_header(struct xe_device *xe, { u32 marker = mtl_gsc_header_rd(xe, map, offset, validity_marker); u32 size = mtl_gsc_header_rd(xe, map, offset, message_size); + u32 status = mtl_gsc_header_rd(xe, map, offset, status); u32 payload_size = size - GSC_HDR_SIZE; if (marker != GSC_HECI_VALIDITY_MARKER) return -EPROTO; + if (status != 0) { + drm_err(&xe->drm, "GSC header readout indicates error: %d\n", + status); + return -EINVAL; + } + if (size < GSC_HDR_SIZE || payload_size < min_payload_size) return -ENODATA; |