disp: msm: sde: add msgq support for sde vm layer

Linux message queues(msgq) are used to communicate between VM's
This change creates a display specific msgq and a set of
framework api's for the VM layer to invoke communication
between the VMs'.

Display msgq is bidirectional. Tx end is created by default for
both the VM's. Rx is kept optional to avoid unnecessary creation
of listener threads.

Change-Id: If4e6410045293d6b21087a76ec018d4784dd5238
Signed-off-by: Jeykumar Sankaran <jsanka@codeaurora.org>
This commit is contained in:
Jeykumar Sankaran
2020-09-24 18:49:27 -07:00
committed by Amine Najahi
parent 2fb129f394
commit d076f02017
8 changed files with 251 additions and 2 deletions

View File

@@ -13,6 +13,8 @@
#include "sde_kms.h"
#include "sde_vm_common.h"
#include "sde_vm.h"
#include "sde_vm_msgq.h"
#define to_vm_trusted(vm) ((struct sde_vm_trusted *)vm)
@@ -247,6 +249,8 @@ static void _sde_vm_deinit(struct sde_kms *kms, struct sde_vm_ops *ops)
memset(ops, 0, sizeof(*ops));
sde_vm_msgq_deinit(kms->vm);
if (sde_vm->base.mem_notification_cookie)
hh_mem_notifier_unregister(
sde_vm->base.mem_notification_cookie);
@@ -409,6 +413,7 @@ static void _sde_vm_set_ops(struct sde_vm_ops *ops)
ops->vm_post_commit = sde_kms_vm_trusted_post_commit;
ops->vm_request_valid = sde_vm_request_valid;
ops->vm_acquire_fail_handler = _sde_vm_release;
ops->vm_msg_send = sde_vm_msg_send;
}
int sde_vm_trusted_init(struct sde_kms *kms)
@@ -460,6 +465,12 @@ int sde_vm_trusted_init(struct sde_kms *kms)
atomic_set(&sde_vm->base.n_irq_lent, 0);
rc = sde_vm_msgq_init(kms->vm);
if (rc) {
SDE_ERROR("failed to initialize the msgq, rc=%d\n", rc);
goto init_fail;
}
return 0;
init_fail:
_sde_vm_deinit(kms, &sde_vm->base.vm_ops);