Skip to content

Commit

Permalink
drm/i915/guc: Move check for fast memcpy_wc to relay creation
Browse files Browse the repository at this point in the history
We only need those fast memcpy_wc when we're using relay to read
continuous GuC log. Let's prevent the user from creating a relay if we
know we won't be able to keep up with GuC.

v2: Adjust the return value (Michał)

Signed-off-by: Michał Winiarski <[email protected]>
Cc: Chris Wilson <[email protected]>
Cc: Daniele Ceraolo Spurio <[email protected]>
Cc: Sagar Arun Kamble <[email protected]>
Cc: Michal Wajdeczko <[email protected]>
Reviewed-by: Sagar Arun Kamble <[email protected]>
Signed-off-by: Chris Wilson <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
  • Loading branch information
mwiniars authored and ickle committed Mar 19, 2018
1 parent 4977a28 commit b8299c7
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions drivers/gpu/drm/i915/intel_guc_log.c
Original file line number Diff line number Diff line change
Expand Up @@ -466,16 +466,6 @@ int intel_guc_log_create(struct intel_guc_log *log)

GEM_BUG_ON(log->vma);

/*
* We require SSE 4.1 for fast reads from the GuC log buffer and
* it should be present on the chipsets supporting GuC based
* submisssions.
*/
if (WARN_ON(!i915_has_memcpy_from_wc())) {
ret = -EINVAL;
goto err;
}

vma = intel_guc_allocate_vma(guc, GUC_LOG_SIZE);
if (IS_ERR(vma)) {
ret = PTR_ERR(vma);
Expand Down Expand Up @@ -574,6 +564,16 @@ int intel_guc_log_relay_open(struct intel_guc_log *log)
goto out_unlock;
}

/*
* We require SSE 4.1 for fast reads from the GuC log buffer and
* it should be present on the chipsets supporting GuC based
* submisssions.
*/
if (!i915_has_memcpy_from_wc()) {
ret = -ENXIO;
goto out_unlock;
}

ret = guc_log_relay_create(log);
if (ret)
goto out_unlock;
Expand Down

0 comments on commit b8299c7

Please sign in to comment.