Skip to content

Commit 41e65d8

Browse files
aalteresRadhakrishna Sripada
authored andcommitted
drm/i915/pxp: Enable PXP with MTL-GSC-CS
Enable PXP with MTL-GSC-CS: add the has_pxp into device info and increase the debugfs teardown timeouts to align with new GSC-CS + firmware specs. Now that we have 3 places that are selecting pxp timeouts based on tee vs gsccs back-end, let's add a helper. Signed-off-by: Alan Previn <alan.previn.teres.alexis@intel.com> Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Signed-off-by: Radhakrishna Sripada <radhakrishna.sripada@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230511231738.1077674-9-alan.previn.teres.alexis@intel.com
1 parent 9e134ed commit 41e65d8

5 files changed

Lines changed: 18 additions & 10 deletions

File tree

drivers/gpu/drm/i915/i915_pci.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1209,6 +1209,7 @@ static const struct intel_device_info mtl_info = {
12091209
.has_mslice_steering = 0,
12101210
.has_snoop = 1,
12111211
.max_pat_index = 4,
1212+
.has_pxp = 1,
12121213
.__runtime.memory_regions = REGION_SMEM | REGION_STOLEN_LMEM,
12131214
.__runtime.platform_engine_mask = BIT(RCS0) | BIT(BCS0) | BIT(CCS0),
12141215
.require_force_probe = 1,

drivers/gpu/drm/i915/pxp/intel_pxp.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,14 @@ static bool pxp_component_bound(struct intel_pxp *pxp)
289289
return bound;
290290
}
291291

292+
int intel_pxp_get_backend_timeout_ms(struct intel_pxp *pxp)
293+
{
294+
if (HAS_ENGINE(pxp->ctrl_gt, GSC0))
295+
return GSCFW_MAX_ROUND_TRIP_LATENCY_MS;
296+
else
297+
return 250;
298+
}
299+
292300
static int __pxp_global_teardown_final(struct intel_pxp *pxp)
293301
{
294302
int timeout;
@@ -302,10 +310,7 @@ static int __pxp_global_teardown_final(struct intel_pxp *pxp)
302310
intel_pxp_mark_termination_in_progress(pxp);
303311
intel_pxp_terminate(pxp, false);
304312

305-
if (HAS_ENGINE(pxp->ctrl_gt, GSC0))
306-
timeout = GSCFW_MAX_ROUND_TRIP_LATENCY_MS;
307-
else
308-
timeout = 250;
313+
timeout = intel_pxp_get_backend_timeout_ms(pxp);
309314

310315
if (!wait_for_completion_timeout(&pxp->termination, msecs_to_jiffies(timeout)))
311316
return -ETIMEDOUT;
@@ -325,10 +330,7 @@ static int __pxp_global_teardown_restart(struct intel_pxp *pxp)
325330
*/
326331
pxp_queue_termination(pxp);
327332

328-
if (HAS_ENGINE(pxp->ctrl_gt, GSC0))
329-
timeout = GSCFW_MAX_ROUND_TRIP_LATENCY_MS;
330-
else
331-
timeout = 250;
333+
timeout = intel_pxp_get_backend_timeout_ms(pxp);
332334

333335
if (!wait_for_completion_timeout(&pxp->termination, msecs_to_jiffies(timeout)))
334336
return -ETIMEDOUT;

drivers/gpu/drm/i915/pxp/intel_pxp.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ void intel_pxp_mark_termination_in_progress(struct intel_pxp *pxp);
2727
void intel_pxp_tee_end_arb_fw_session(struct intel_pxp *pxp, u32 arb_session_id);
2828

2929
int intel_pxp_get_readiness_status(struct intel_pxp *pxp);
30+
int intel_pxp_get_backend_timeout_ms(struct intel_pxp *pxp);
3031
int intel_pxp_start(struct intel_pxp *pxp);
3132
void intel_pxp_end(struct intel_pxp *pxp);
3233

drivers/gpu/drm/i915/pxp/intel_pxp_debugfs.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
#include "intel_pxp.h"
1616
#include "intel_pxp_debugfs.h"
17+
#include "intel_pxp_gsccs.h"
1718
#include "intel_pxp_irq.h"
1819
#include "intel_pxp_types.h"
1920

@@ -45,6 +46,7 @@ static int pxp_terminate_set(void *data, u64 val)
4546
{
4647
struct intel_pxp *pxp = data;
4748
struct intel_gt *gt = pxp->ctrl_gt;
49+
int timeout_ms;
4850

4951
if (!intel_pxp_is_active(pxp))
5052
return -ENODEV;
@@ -54,8 +56,10 @@ static int pxp_terminate_set(void *data, u64 val)
5456
intel_pxp_irq_handler(pxp, GEN12_DISPLAY_PXP_STATE_TERMINATED_INTERRUPT);
5557
spin_unlock_irq(gt->irq_lock);
5658

59+
timeout_ms = intel_pxp_get_backend_timeout_ms(pxp);
60+
5761
if (!wait_for_completion_timeout(&pxp->termination,
58-
msecs_to_jiffies(100)))
62+
msecs_to_jiffies(timeout_ms)))
5963
return -ETIMEDOUT;
6064

6165
return 0;

drivers/gpu/drm/i915/pxp/intel_pxp_session.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ static int pxp_wait_for_session_state(struct intel_pxp *pxp, u32 id, bool in_pla
4444
KCR_SIP(pxp->kcr_base),
4545
mask,
4646
in_play ? mask : 0,
47-
100);
47+
250);
4848

4949
intel_runtime_pm_put(uncore->rpm, wakeref);
5050

0 commit comments

Comments
 (0)