disp: msm: sde: add helper to check VM hw availability

Add a utility function to check if HW has been handed over to
another VM.

Change-Id: Ic36ca1e7f15f7608e69d69fc3f4e7ad40be15704
Signed-off-by: Steve Cohen <cohens@codeaurora.org>
This commit is contained in:
Steve Cohen
2021-08-11 17:59:00 -04:00
parent 9690b545df
commit 7f3b2f0a4b
6 changed files with 40 additions and 36 deletions

View File

@@ -6451,7 +6451,6 @@ static ssize_t _sde_crtc_misr_read(struct file *file,
struct sde_crtc *sde_crtc;
struct sde_kms *sde_kms;
struct sde_crtc_mixer *m;
struct sde_vm_ops *vm_ops;
int i = 0, rc;
ssize_t len = 0;
char buf[MISR_BUFF_SIZE + 1] = {'\0'};
@@ -6472,9 +6471,8 @@ static ssize_t _sde_crtc_misr_read(struct file *file,
if (rc < 0)
return rc;
vm_ops = sde_vm_get_ops(sde_kms);
sde_vm_lock(sde_kms);
if (vm_ops && vm_ops->vm_owns_hw && !vm_ops->vm_owns_hw(sde_kms)) {
if (!sde_vm_owns_hw(sde_kms)) {
SDE_DEBUG("op not supported due to HW unavailability\n");
rc = -EOPNOTSUPP;
goto end;