Skip to content

Commit 82d9de6

Browse files
hghimirarodrigovivi
authored andcommitted
drm/xe/hdcp: Update handling of xe_force_wake_get return
xe_force_wake_get() now returns the reference count-incremented domain mask. If it fails for individual domains, the return value will always be 0. However, for XE_FORCEWAKE_ALL, it may return a non-zero value even in the event of failure. Update the return handling of xe_force_wake_get() to reflect this behavior, and ensure that the return value is passed as input to xe_force_wake_put(). v3 - return xe_wakeref_t instead of int in xe_force_wake_get() v5 - return unsigned int for xe_force_wake_get() v7 - Fix commit message Cc: Suraj Kandpal <[email protected]> Cc: Daniele Ceraolo Spurio <[email protected]> Cc: Rodrigo Vivi <[email protected]> Cc: Lucas De Marchi <[email protected]> Signed-off-by: Himal Prasad Ghimiray <[email protected]> Reviewed-by: Suraj Kandpal <[email protected]> Reviewed-by: Nirmoy Das <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Rodrigo Vivi <[email protected]>
1 parent 3b41f88 commit 82d9de6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/gpu/drm/xe/display/xe_hdcp_gsc.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ bool intel_hdcp_gsc_check_status(struct xe_device *xe)
4141
struct xe_gt *gt = tile->media_gt;
4242
struct xe_gsc *gsc = &gt->uc.gsc;
4343
bool ret = true;
44+
unsigned int fw_ref;
4445

4546
if (!gsc && !xe_uc_fw_is_enabled(&gsc->fw)) {
4647
drm_dbg_kms(&xe->drm,
@@ -49,7 +50,8 @@ bool intel_hdcp_gsc_check_status(struct xe_device *xe)
4950
}
5051

5152
xe_pm_runtime_get(xe);
52-
if (xe_force_wake_get(gt_to_fw(gt), XE_FW_GSC)) {
53+
fw_ref = xe_force_wake_get(gt_to_fw(gt), XE_FW_GSC);
54+
if (!fw_ref) {
5355
drm_dbg_kms(&xe->drm,
5456
"failed to get forcewake to check proxy status\n");
5557
ret = false;
@@ -59,7 +61,7 @@ bool intel_hdcp_gsc_check_status(struct xe_device *xe)
5961
if (!xe_gsc_proxy_init_done(gsc))
6062
ret = false;
6163

62-
xe_force_wake_put(gt_to_fw(gt), XE_FW_GSC);
64+
xe_force_wake_put(gt_to_fw(gt), fw_ref);
6365
out:
6466
xe_pm_runtime_put(xe);
6567
return ret;

0 commit comments

Comments
 (0)