disp: msm: sde: accept and reclaim resources on user prompt
Currently, trusted VM accepts and releases the resources on RM notifications. In cases, where TUI fails to submit the first frame on the trusted vm, display cannot rely on the teardown commit IOCTL to release the resources back to primary VM. To handle scenarios where RM notification drops, the VM's should be able to ACCEPT/RECLAIM resources without relying on the RM. To address above scenarios, this change moves the resource handling calls from notification handlers to user prompt. With this change, trusted VM will ACCEPT the resource only on the first frame commit and primary VM can RECLAIM the resources back if the TUI use case fails or any of the RM notifications fail to deliver. Change-Id: Iebb1724a7558e52567f8af1a49e38f8adbec88a0 Signed-off-by: Jeykumar Sankaran <jsanka@codeaurora.org>
This commit is contained in:

gecommit door
Gerrit - the friendly Code Review server

bovenliggende
de8c973a73
commit
9de6eee40e
@@ -300,33 +300,30 @@ int sde_vm_request_valid(struct sde_kms *sde_kms,
|
||||
|
||||
switch (new_state) {
|
||||
case VM_REQ_RELEASE:
|
||||
if (old_state == VM_REQ_RELEASE)
|
||||
rc = -EINVAL;
|
||||
break;
|
||||
case VM_REQ_NONE:
|
||||
if (old_state == VM_REQ_RELEASE)
|
||||
if ((old_state == VM_REQ_RELEASE) ||
|
||||
!vm_ops->vm_owns_hw(sde_kms))
|
||||
rc = -EINVAL;
|
||||
break;
|
||||
case VM_REQ_ACQUIRE:
|
||||
/**
|
||||
* Only the display which requested for HW assignment
|
||||
* can reclaim it back
|
||||
*/
|
||||
if (old_state != VM_REQ_RELEASE)
|
||||
if (old_state != VM_REQ_RELEASE) {
|
||||
rc = -EINVAL;
|
||||
} else if (!vm_ops->vm_owns_hw(sde_kms)) {
|
||||
if (vm_ops->vm_acquire)
|
||||
rc = vm_ops->vm_acquire(sde_kms);
|
||||
else
|
||||
rc = -EINVAL;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
SDE_ERROR("invalid vm request\n");
|
||||
rc = -EINVAL;
|
||||
};
|
||||
|
||||
if (!rc && !vm_ops->vm_owns_hw(sde_kms))
|
||||
rc = -EINVAL;
|
||||
|
||||
SDE_DEBUG("old req: %d new req: %d owns_hw: %d\n",
|
||||
SDE_DEBUG("old req: %d new req: %d owns_hw: %d, rc: %d\n",
|
||||
old_state, new_state,
|
||||
vm_ops->vm_owns_hw(sde_kms));
|
||||
SDE_EVT32(old_state, new_state, vm_ops->vm_owns_hw(sde_kms));
|
||||
vm_ops->vm_owns_hw(sde_kms), rc);
|
||||
SDE_EVT32(old_state, new_state, vm_ops->vm_owns_hw(sde_kms), rc);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
Verwijs in nieuw issue
Block a user