Răsfoiți Sursa

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 <[email protected]>
Jeykumar Sankaran 4 ani în urmă
părinte
comite
02bef42599
2 a modificat fișierele cu 22 adăugiri și 4 ștergeri
  1. 11 2
      msm/sde/sde_vm_primary.c
  2. 11 2
      msm/sde/sde_vm_trusted.c

+ 11 - 2
msm/sde/sde_vm_primary.c

@@ -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);
 	}
 

+ 11 - 2
msm/sde/sde_vm_trusted.c

@@ -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) {