From 8b032e5e466beec93f790dd075d13b833b3a0cdc Mon Sep 17 00:00:00 2001 From: Jeykumar Sankaran Date: Wed, 11 Mar 2020 16:10:18 -0700 Subject: [PATCH] disp: sde: add CRTC property for VM requests Add a CRTC property to request the VM to acquire/release HW resources. Display driver in trusted VM boots up without HW ownership. Set the default value of the property as RELEASED to handle resource assignments. Change-Id: Iea651a2fea902d95d4b954052af4ef016af15a91 Signed-off-by: Jeykumar Sankaran --- msm/msm_drv.h | 1 + msm/sde/sde_crtc.c | 15 +++++++++++++++ msm/sde/sde_crtc.h | 12 ++++++++++++ 3 files changed, 28 insertions(+) diff --git a/msm/msm_drv.h b/msm/msm_drv.h index f34697628aed..55ea0f1c42fb 100644 --- a/msm/msm_drv.h +++ b/msm/msm_drv.h @@ -172,6 +172,7 @@ enum msm_mdp_crtc_property { CRTC_PROP_IDLE_PC_STATE, CRTC_PROP_CACHE_STATE, + CRTC_PROP_VM_REQ_STATE, /* total # of properties */ CRTC_PROP_COUNT diff --git a/msm/sde/sde_crtc.c b/msm/sde/sde_crtc.c index c3cdeed477b0..5d7fc785f03b 100644 --- a/msm/sde/sde_crtc.c +++ b/msm/sde/sde_crtc.c @@ -5236,6 +5236,12 @@ static void sde_crtc_install_properties(struct drm_crtc *crtc, {CACHE_STATE_ENABLED, "cache_state_enabled"}, }; + static const struct drm_prop_enum_list e_vm_req_state[] = { + {VM_REQ_NONE, "vm_req_none"}, + {VM_REQ_RELEASE, "vm_req_release"}, + {VM_REQ_ACQUIRE, "vm_req_acquire"}, + }; + SDE_DEBUG("\n"); if (!crtc || !catalog) { @@ -5274,6 +5280,15 @@ static void sde_crtc_install_properties(struct drm_crtc *crtc, "idle_time", 0, 0, U64_MAX, 0, CRTC_PROP_IDLE_TIMEOUT); + if (catalog->has_trusted_vm_support) { + int init_idx = sde_in_trusted_vm(sde_kms) ? 1 : 0; + + msm_property_install_enum(&sde_crtc->property_info, + "vm_request_state", 0x0, 0, e_vm_req_state, + ARRAY_SIZE(e_vm_req_state), init_idx, + CRTC_PROP_VM_REQ_STATE); + } + if (catalog->has_idle_pc) msm_property_install_enum(&sde_crtc->property_info, "idle_pc_state", 0x0, 0, e_idle_pc_state, diff --git a/msm/sde/sde_crtc.h b/msm/sde/sde_crtc.h index 44e93377e274..339900deb5d3 100644 --- a/msm/sde/sde_crtc.h +++ b/msm/sde/sde_crtc.h @@ -88,6 +88,18 @@ enum sde_crtc_cache_state { CACHE_STATE_FRAME_READ }; +/** + * enum sde_crtc_vm_req: request for VM operations + * @VM_REQ_NONE: no request. Normal VM operations. + * @VM_REQ_RELEASE: request to release the HW resources from the current VM + * @VM_REQ_ACQUIRE: request to acquire the HW resources in the current VM + */ +enum sde_crtc_vm_req { + VM_REQ_NONE, + VM_REQ_RELEASE, + VM_REQ_ACQUIRE, +}; + /** * @connectors : Currently associated drm connectors for retire event * @num_connectors: Number of associated drm connectors for retire event