disp: msm: sde: adapt VM IRQ notification framework

Kernel RM IRQ wrapper has changed the prototype of the
notification callback function to support per event
notifications. This uncouples the VM IRQ operations from
their respective notifications.

Adapt the changes in SDE driver by making the notification
handler generic and invoking the notifications calls
explicitly.

Change-Id: I02ddb1d2fa70fdab8002325e0472b43e94b6b09c
Signed-off-by: Jeykumar Sankaran <jsanka@codeaurora.org>
This commit is contained in:
Jeykumar Sankaran
2020-08-31 13:20:00 -07:00
committed by Gerrit - the friendly Code Review server
parent 8f16ccc93b
commit 02bef42599
2 changed files with 22 additions and 4 deletions

View File

@@ -25,7 +25,8 @@ static bool sde_vm_owns_hw(struct sde_kms *sde_kms)
return (owns_irq & owns_mem_io);
}
void sde_vm_irq_release_notification_handler(void *req, enum hh_irq_label label)
void sde_vm_irq_release_notification_handler(void *req,
unsigned long notif_type, enum hh_irq_label label)
{
struct sde_vm_primary *sde_vm;
int rc = 0;
@@ -169,7 +170,7 @@ static int _sde_vm_lend_irq(struct sde_vm *vm, struct msm_io_res *io_res)
for (i = 0; i < irq_desc->n_irq; i++) {
struct sde_vm_irq_entry *entry = &irq_desc->irq_entries[i];
rc = hh_irq_lend(entry->label, HH_TRUSTED_VM, entry->irq,
rc = hh_irq_lend_v2(entry->label, HH_TRUSTED_VM, entry->irq,
sde_vm_irq_release_notification_handler,
sde_vm);
if (rc) {
@@ -179,6 +180,14 @@ static int _sde_vm_lend_irq(struct sde_vm *vm, struct msm_io_res *io_res)
return rc;
}
rc = hh_irq_lend_notify(entry->label);
if (rc) {
SDE_ERROR("irq lend notify failed, label: %d, rc=%d\n",
entry->label, rc);
hh_irq_reclaim(entry->label);
return rc;
}
SDE_INFO("vm lend suceeded for IRQ label: %d\n", entry->label);
}

View File

@@ -61,7 +61,8 @@ static int __irq_cmp(const void *a, const void *b)
return (l->label - r->label);
}
void sde_vm_irq_lend_notification_handler(void *req, enum hh_irq_label label)
void sde_vm_irq_lend_notification_handler(void *req, unsigned long notif_type,
enum hh_irq_label label)
{
struct sde_vm_trusted *sde_vm;
struct sde_kms *sde_kms;
@@ -217,6 +218,14 @@ static int _sde_vm_release_irq(struct sde_vm *vm)
return rc;
}
rc = hh_irq_release_notify(entry->label);
if (rc) {
SDE_ERROR(
"irq release notify failed,label: %d rc: %d\n",
entry->label, rc);
return rc;
}
atomic_dec(&sde_vm->base.n_irq_lent);
}
@@ -387,7 +396,7 @@ int sde_vm_trusted_init(struct sde_kms *kms)
}
sde_vm->base.mem_notification_cookie = cookie;
rc = hh_irq_wait_for_lend(HH_IRQ_LABEL_SDE, HH_PRIMARY_VM,
rc = hh_irq_wait_for_lend_v2(HH_IRQ_LABEL_SDE, HH_PRIMARY_VM,
sde_vm_irq_lend_notification_handler,
(void *)sde_vm);
if (rc) {