From cbaca0039b32bfd4ca123023fa1b60a30a67fe2a Mon Sep 17 00:00:00 2001 From: Jeykumar Sankaran Date: Fri, 21 Aug 2020 19:29:09 -0700 Subject: [PATCH] disp: msm: sde: add vote for trusted vm splash handoff Trusted VM adapts splash handoff path to acquire the same set of HW blocks the tui display was using in the primary VM before switching out. To use the splash handoff path, Trusted VM should add an additional vote to the PM so that refcounts will be remain balanced after the splash path cleanup at the completion of the first valid commit. This change adds the needed vote and as a result cleans up explicit voting from trusted vm commit paths. Change-Id: I9eb33c364f1dfb4205547a8353f57b73c68b8af3 Signed-off-by: Jeykumar Sankaran --- msm/sde/sde_kms.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/msm/sde/sde_kms.c b/msm/sde/sde_kms.c index 93731938..c1c11906 100644 --- a/msm/sde/sde_kms.c +++ b/msm/sde/sde_kms.c @@ -998,8 +998,6 @@ int sde_kms_vm_trusted_prepare_commit(struct sde_kms *sde_kms, ddev = sde_kms->dev; - pm_runtime_get_sync(ddev->dev); - cstate = to_sde_crtc_state(state->crtcs[0].new_state); vm_req = sde_crtc_get_property(cstate, CRTC_PROP_VM_REQ_STATE); @@ -1262,8 +1260,6 @@ int sde_kms_vm_trusted_post_commit(struct sde_kms *sde_kms, drm_for_each_encoder_mask(encoder, crtc->dev, crtc->state->encoder_mask) sde_encoder_irq_control(encoder, false); - sde_irq_update(&sde_kms->base, false); - list_for_each_entry(plane, &ddev->mode_config.plane_list, head) sde_plane_set_sid(plane, 0); @@ -1274,8 +1270,6 @@ int sde_kms_vm_trusted_post_commit(struct sde_kms *sde_kms, if (vm_ops->vm_release) rc = vm_ops->vm_release(sde_kms); - pm_runtime_put_sync(ddev->dev); - return rc; } @@ -4304,7 +4298,7 @@ int sde_kms_vm_trusted_resource_init(struct sde_kms *sde_kms) } vm_ops = sde_vm_get_ops(sde_kms); - if (vm_ops && vm_ops->vm_owns_hw(sde_kms)) { + if (vm_ops && !vm_ops->vm_owns_hw(sde_kms)) { SDE_DEBUG( "skipping sde res init as device assign is not completed\n"); return 0; @@ -4340,6 +4334,12 @@ int sde_kms_vm_trusted_resource_init(struct sde_kms *sde_kms) goto error; } + /** + * fill-in vote for the continuous splash hanodff path, which will be + * removed on the successful first commit. + */ + pm_runtime_get_sync(sde_kms->dev->dev); + return 0; error: