disp: msm: sde: Rename the hypervisor interface

The hypervisor is renamed to gunyah now. All 'haven' words need change
to 'gunyah' and 'hh' words in hypervisor interface need change to 'gh'.

Change-Id: Ia7ff6d855eb5548540a2f11a781c2555beb23187
Signed-off-by: Cong Zhang <congzhan@codeaurora.org>
This commit is contained in:
Cong Zhang
2021-04-27 14:07:43 +08:00
committed by Gerrit - the friendly Code Review server
parent cbf860f8e0
commit 3133112917
8 changed files with 95 additions and 95 deletions

View File

@@ -14,7 +14,7 @@
/** /**
* struct - msm_io_irq_entry - define irq item * struct - msm_io_irq_entry - define irq item
* @label: hh_irq_label for the irq * @label: gh_irq_label for the irq
* @irq_num: linux mapped irq num * @irq_num: linux mapped irq num
* @list: list head pointer * @list: list head pointer
*/ */

View File

@@ -58,7 +58,7 @@
#include <linux/qcom-iommu-util.h> #include <linux/qcom-iommu-util.h>
#include "soc/qcom/secure_buffer.h" #include "soc/qcom/secure_buffer.h"
#include <linux/qtee_shmbridge.h> #include <linux/qtee_shmbridge.h>
#include <linux/haven/hh_irq_lend.h> #include <linux/gunyah/gh_irq_lend.h>
#define CREATE_TRACE_POINTS #define CREATE_TRACE_POINTS
#include "sde_trace.h" #include "sde_trace.h"
@@ -4605,7 +4605,7 @@ int sde_kms_get_io_resources(struct sde_kms *sde_kms, struct msm_io_res *io_res)
return rc; return rc;
} }
rc = msm_dss_get_io_irq(pdev, &io_res->irq, HH_IRQ_LABEL_SDE); rc = msm_dss_get_io_irq(pdev, &io_res->irq, GH_IRQ_LABEL_SDE);
if (rc) { if (rc) {
SDE_ERROR("failed to get io irq for KMS"); SDE_ERROR("failed to get io irq for KMS");
return rc; return rc;

View File

@@ -220,7 +220,7 @@ struct sde_vm_primary {
struct sde_vm_trusted { struct sde_vm_trusted {
struct sde_vm base; struct sde_vm base;
struct sde_vm_irq_desc *irq_desc; struct sde_vm_irq_desc *irq_desc;
struct hh_sgl_desc *sgl_desc; struct gh_sgl_desc *sgl_desc;
}; };
#if IS_ENABLED(CONFIG_DRM_SDE_VM) #if IS_ENABLED(CONFIG_DRM_SDE_VM)

View File

@@ -12,11 +12,11 @@
#include "sde_crtc.h" #include "sde_crtc.h"
#include "sde_vm_msgq.h" #include "sde_vm_msgq.h"
struct hh_notify_vmid_desc *sde_vm_populate_vmid(hh_vmid_t vmid) struct gh_notify_vmid_desc *sde_vm_populate_vmid(gh_vmid_t vmid)
{ {
struct hh_notify_vmid_desc *vmid_desc; struct gh_notify_vmid_desc *vmid_desc;
vmid_desc = kzalloc(offsetof(struct hh_notify_vmid_desc, vmid_desc = kzalloc(offsetof(struct gh_notify_vmid_desc,
vmid_entries[1]), GFP_KERNEL); vmid_entries[1]), GFP_KERNEL);
if (!vmid_desc) if (!vmid_desc)
return ERR_PTR(ENOMEM); return ERR_PTR(ENOMEM);
@@ -27,21 +27,21 @@ struct hh_notify_vmid_desc *sde_vm_populate_vmid(hh_vmid_t vmid)
return vmid_desc; return vmid_desc;
} }
struct hh_acl_desc *sde_vm_populate_acl(enum hh_vm_names vm_name) struct gh_acl_desc *sde_vm_populate_acl(enum gh_vm_names vm_name)
{ {
struct hh_acl_desc *acl_desc; struct gh_acl_desc *acl_desc;
hh_vmid_t vmid; gh_vmid_t vmid;
hh_rm_get_vmid(vm_name, &vmid); gh_rm_get_vmid(vm_name, &vmid);
acl_desc = kzalloc(offsetof(struct hh_acl_desc, acl_entries[1]), acl_desc = kzalloc(offsetof(struct gh_acl_desc, acl_entries[1]),
GFP_KERNEL); GFP_KERNEL);
if (!acl_desc) if (!acl_desc)
return ERR_PTR(ENOMEM); return ERR_PTR(ENOMEM);
acl_desc->n_acl_entries = 1; acl_desc->n_acl_entries = 1;
acl_desc->acl_entries[0].vmid = vmid; acl_desc->acl_entries[0].vmid = vmid;
acl_desc->acl_entries[0].perms = HH_RM_ACL_R | HH_RM_ACL_W; acl_desc->acl_entries[0].perms = GH_RM_ACL_R | GH_RM_ACL_W;
return acl_desc; return acl_desc;
} }
@@ -105,9 +105,9 @@ void _sde_vm_sort_and_align(struct list_head *mem)
entry->base, entry->size); entry->base, entry->size);
} }
struct hh_sgl_desc *sde_vm_populate_sgl(struct msm_io_res *io_res) struct gh_sgl_desc *sde_vm_populate_sgl(struct msm_io_res *io_res)
{ {
struct hh_sgl_desc *sgl_desc; struct gh_sgl_desc *sgl_desc;
struct msm_io_mem_entry *mem; struct msm_io_mem_entry *mem;
u32 i = 0, num_mem_entry = 0; u32 i = 0, num_mem_entry = 0;
@@ -116,7 +116,7 @@ struct hh_sgl_desc *sde_vm_populate_sgl(struct msm_io_res *io_res)
list_for_each_entry(mem, &io_res->mem, list) list_for_each_entry(mem, &io_res->mem, list)
num_mem_entry++; num_mem_entry++;
sgl_desc = kzalloc(offsetof(struct hh_sgl_desc, sgl_desc = kzalloc(offsetof(struct gh_sgl_desc,
sgl_entries[num_mem_entry]), GFP_KERNEL); sgl_entries[num_mem_entry]), GFP_KERNEL);
if (!sgl_desc) if (!sgl_desc)
return ERR_PTR(ENOMEM); return ERR_PTR(ENOMEM);

View File

@@ -6,7 +6,7 @@
#ifndef __SDE_VM_COMMON_H__ #ifndef __SDE_VM_COMMON_H__
#define __SDE_VM_COMMON_H__ #define __SDE_VM_COMMON_H__
#include <linux/haven/hh_rm_drv.h> #include <linux/gunyah/gh_rm_drv.h>
#include "sde_vm.h" #include "sde_vm.h"
#define SDE_VM_MEM_LABEL 0x11 #define SDE_VM_MEM_LABEL 0x11
@@ -15,25 +15,25 @@
* sde_vm_populate_vmid - create and populate the rm vmid desc structure with * sde_vm_populate_vmid - create and populate the rm vmid desc structure with
* the given vmid * the given vmid
* @vmid: vmid of the destination vm * @vmid: vmid of the destination vm
* @return: populated hh_notify_vmid_desc structure * @return: populated gh_notify_vmid_desc structure
*/ */
struct hh_notify_vmid_desc *sde_vm_populate_vmid(hh_vmid_t vmid); struct gh_notify_vmid_desc *sde_vm_populate_vmid(gh_vmid_t vmid);
/** /**
* sde_vm_populate_acl - create and populate the access control list structure * sde_vm_populate_acl - create and populate the access control list structure
* for the given vm name * for the given vm name
* @vm_name: vm name enum published by the RM driver * @vm_name: vm name enum published by the RM driver
* @return: populated hh_acl_desc structure * @return: populated gh_acl_desc structure
*/ */
struct hh_acl_desc *sde_vm_populate_acl(enum hh_vm_names vm_name); struct gh_acl_desc *sde_vm_populate_acl(enum gh_vm_names vm_name);
/** /**
* sde_vm_populate_sgl - create and populate the scatter/gather list structure * sde_vm_populate_sgl - create and populate the scatter/gather list structure
* with the given io memory list * with the given io memory list
* @io_res: io resource list containing the io memory * @io_res: io resource list containing the io memory
* @return: populated hh_sgl_desc structure * @return: populated gh_sgl_desc structure
*/ */
struct hh_sgl_desc *sde_vm_populate_sgl(struct msm_io_res *io_res); struct gh_sgl_desc *sde_vm_populate_sgl(struct msm_io_res *io_res);
/** /**
* sde_vm_populate_irq - create and populate the hw irq descriptor structure * sde_vm_populate_irq - create and populate the hw irq descriptor structure

View File

@@ -3,7 +3,7 @@
* Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
*/ */
#include <linux/haven/hh_msgq.h> #include <linux/gunyah/gh_msgq.h>
#include <linux/kthread.h> #include <linux/kthread.h>
#include "sde_kms.h" #include "sde_kms.h"
#include "sde_vm.h" #include "sde_vm.h"
@@ -37,15 +37,15 @@ static int _sde_vm_msgq_listener(void *data)
vm_work = &sde_vm->vm_work; vm_work = &sde_vm->vm_work;
while (true) { while (true) {
buf = kzalloc(HH_MSGQ_MAX_MSG_SIZE_BYTES, GFP_KERNEL); buf = kzalloc(GH_MSGQ_MAX_MSG_SIZE_BYTES, GFP_KERNEL);
if (!buf) if (!buf)
return -ENOMEM; return -ENOMEM;
ret = hh_msgq_recv(sde_vm->msgq_handle, buf, ret = gh_msgq_recv(sde_vm->msgq_handle, buf,
HH_MSGQ_MAX_MSG_SIZE_BYTES, &size, 0); GH_MSGQ_MAX_MSG_SIZE_BYTES, &size, 0);
if (ret < 0) { if (ret < 0) {
kfree(buf); kfree(buf);
SDE_ERROR("hh_msgq_recv failed, rc=%d\n", ret); SDE_ERROR("gh_msgq_recv failed, rc=%d\n", ret);
return -EINVAL; return -EINVAL;
} }
@@ -66,13 +66,13 @@ int sde_vm_msgq_send(struct sde_vm *sde_vm, void *msg, size_t msg_size)
return -EINVAL; return -EINVAL;
} }
if (msg_size > HH_MSGQ_MAX_MSG_SIZE_BYTES) { if (msg_size > GH_MSGQ_MAX_MSG_SIZE_BYTES) {
SDE_ERROR("msg size unsupported for msgq: %ld > %d\n", msg_size, SDE_ERROR("msg size unsupported for msgq: %ld > %d\n", msg_size,
HH_MSGQ_MAX_MSG_SIZE_BYTES); GH_MSGQ_MAX_MSG_SIZE_BYTES);
return -E2BIG; return -E2BIG;
} }
return hh_msgq_send(sde_vm->msgq_handle, msg, msg_size, HH_MSGQ_TX_PUSH); return gh_msgq_send(sde_vm->msgq_handle, msg, msg_size, GH_MSGQ_TX_PUSH);
} }
int sde_vm_msgq_init(struct sde_vm *sde_vm) int sde_vm_msgq_init(struct sde_vm *sde_vm)
@@ -82,9 +82,9 @@ int sde_vm_msgq_init(struct sde_vm *sde_vm)
struct task_struct *msgq_listener_thread = NULL; struct task_struct *msgq_listener_thread = NULL;
int rc = 0; int rc = 0;
msgq_handle = hh_msgq_register(HH_MSGQ_LABEL_DISPLAY); msgq_handle = gh_msgq_register(GH_MSGQ_LABEL_DISPLAY);
if (IS_ERR(msgq_handle)) { if (IS_ERR(msgq_handle)) {
SDE_ERROR("hh_msgq_register failed, hdl=%p\n", msgq_handle); SDE_ERROR("gh_msgq_register failed, hdl=%p\n", msgq_handle);
return -EINVAL; return -EINVAL;
} }
@@ -109,7 +109,7 @@ int sde_vm_msgq_init(struct sde_vm *sde_vm)
return 0; return 0;
kthread_create_fail: kthread_create_fail:
hh_msgq_unregister(msgq_handle); gh_msgq_unregister(msgq_handle);
sde_vm->msgq_handle = NULL; sde_vm->msgq_handle = NULL;
done: done:
return rc; return rc;
@@ -121,5 +121,5 @@ void sde_vm_msgq_deinit(struct sde_vm *sde_vm)
kthread_stop(sde_vm->msgq_listener_thread); kthread_stop(sde_vm->msgq_listener_thread);
if (sde_vm->msgq_handle) if (sde_vm->msgq_handle)
hh_msgq_unregister(sde_vm->msgq_handle); gh_msgq_unregister(sde_vm->msgq_handle);
} }

View File

@@ -3,9 +3,9 @@
* Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
*/ */
#include <linux/notifier.h> #include <linux/notifier.h>
#include <linux/haven/hh_rm_drv.h> #include <linux/gunyah/gh_rm_drv.h>
#include <linux/haven/hh_irq_lend.h> #include <linux/gunyah/gh_irq_lend.h>
#include <linux/haven/hh_mem_notifier.h> #include <linux/gunyah/gh_mem_notifier.h>
#include "sde_kms.h" #include "sde_kms.h"
#include "sde_vm.h" #include "sde_vm.h"
#include "sde_vm_common.h" #include "sde_vm_common.h"
@@ -27,13 +27,13 @@ static bool _sde_vm_owns_hw(struct sde_kms *sde_kms)
} }
void sde_vm_irq_release_notification_handler(void *req, void sde_vm_irq_release_notification_handler(void *req,
unsigned long notif_type, enum hh_irq_label label) unsigned long notif_type, enum gh_irq_label label)
{ {
SDE_INFO("irq release notification for label: %d\n", label); SDE_INFO("irq release notification for label: %d\n", label);
} }
static void sde_vm_mem_release_notification_handler( static void sde_vm_mem_release_notification_handler(
enum hh_mem_notifier_tag tag, unsigned long notif_type, enum gh_mem_notifier_tag tag, unsigned long notif_type,
void *entry_data, void *notif_msg) void *entry_data, void *notif_msg)
{ {
SDE_INFO("mem release notification for tag: %d\n", tag); SDE_INFO("mem release notification for tag: %d\n", tag);
@@ -47,7 +47,7 @@ int _sde_vm_reclaim_mem(struct sde_kms *sde_kms)
if (sde_vm->base.io_mem_handle < 0) if (sde_vm->base.io_mem_handle < 0)
return 0; return 0;
rc = hh_rm_mem_reclaim(sde_vm->base.io_mem_handle, 0); rc = gh_rm_mem_reclaim(sde_vm->base.io_mem_handle, 0);
if (rc) { if (rc) {
SDE_ERROR("failed to reclaim IO memory, rc=%d\n", rc); SDE_ERROR("failed to reclaim IO memory, rc=%d\n", rc);
goto reclaim_fail; goto reclaim_fail;
@@ -74,7 +74,7 @@ int _sde_vm_reclaim_irq(struct sde_kms *sde_kms)
for (i = atomic_read(&sde_vm->base.n_irq_lent) - 1; i >= 0; i--) { for (i = atomic_read(&sde_vm->base.n_irq_lent) - 1; i >= 0; i--) {
struct sde_vm_irq_entry *entry = &irq_desc->irq_entries[i]; struct sde_vm_irq_entry *entry = &irq_desc->irq_entries[i];
rc = hh_irq_reclaim(entry->label); rc = gh_irq_reclaim(entry->label);
if (rc) { if (rc) {
SDE_ERROR("failed to reclaim irq label: %d rc = %d\n", SDE_ERROR("failed to reclaim irq label: %d rc = %d\n",
entry->label, rc); entry->label, rc);
@@ -116,16 +116,16 @@ static int _sde_vm_lend_mem(struct sde_vm *vm,
struct msm_io_res *io_res) struct msm_io_res *io_res)
{ {
struct sde_vm_primary *sde_vm; struct sde_vm_primary *sde_vm;
struct hh_acl_desc *acl_desc; struct gh_acl_desc *acl_desc;
struct hh_sgl_desc *sgl_desc; struct gh_sgl_desc *sgl_desc;
struct hh_notify_vmid_desc *vmid_desc; struct gh_notify_vmid_desc *vmid_desc;
hh_memparcel_handle_t mem_handle; gh_memparcel_handle_t mem_handle;
hh_vmid_t trusted_vmid; gh_vmid_t trusted_vmid;
int rc = 0; int rc = 0;
sde_vm = to_vm_primary(vm); sde_vm = to_vm_primary(vm);
acl_desc = sde_vm_populate_acl(HH_TRUSTED_VM); acl_desc = sde_vm_populate_acl(GH_TRUSTED_VM);
if (IS_ERR(acl_desc)) { if (IS_ERR(acl_desc)) {
SDE_ERROR("failed to populate acl descriptor, rc = %ld\n", SDE_ERROR("failed to populate acl descriptor, rc = %ld\n",
PTR_ERR(acl_desc)); PTR_ERR(acl_desc));
@@ -140,7 +140,7 @@ static int _sde_vm_lend_mem(struct sde_vm *vm,
goto sgl_fail; goto sgl_fail;
} }
rc = hh_rm_mem_lend(HH_RM_MEM_TYPE_IO, 0, SDE_VM_MEM_LABEL, rc = gh_rm_mem_lend(GH_RM_MEM_TYPE_IO, 0, SDE_VM_MEM_LABEL,
acl_desc, sgl_desc, NULL, &mem_handle); acl_desc, sgl_desc, NULL, &mem_handle);
if (rc) { if (rc) {
SDE_ERROR("hyp lend failed with error, rc: %d\n", rc); SDE_ERROR("hyp lend failed with error, rc: %d\n", rc);
@@ -149,19 +149,19 @@ static int _sde_vm_lend_mem(struct sde_vm *vm,
sde_vm->base.io_mem_handle = mem_handle; sde_vm->base.io_mem_handle = mem_handle;
hh_rm_get_vmid(HH_TRUSTED_VM, &trusted_vmid); gh_rm_get_vmid(GH_TRUSTED_VM, &trusted_vmid);
vmid_desc = sde_vm_populate_vmid(trusted_vmid); vmid_desc = sde_vm_populate_vmid(trusted_vmid);
rc = hh_rm_mem_notify(mem_handle, HH_RM_MEM_NOTIFY_RECIPIENT_SHARED, rc = gh_rm_mem_notify(mem_handle, GH_RM_MEM_NOTIFY_RECIPIENT_SHARED,
HH_MEM_NOTIFIER_TAG_DISPLAY, vmid_desc); GH_MEM_NOTIFIER_TAG_DISPLAY, vmid_desc);
if (rc) { if (rc) {
SDE_ERROR("hyp mem notify failed, rc = %d\n", rc); SDE_ERROR("hyp mem notify failed, rc = %d\n", rc);
goto notify_fail; goto notify_fail;
} }
SDE_INFO("IO memory lend suceeded for tag: %d\n", SDE_INFO("IO memory lend suceeded for tag: %d\n",
HH_MEM_NOTIFIER_TAG_DISPLAY); GH_MEM_NOTIFIER_TAG_DISPLAY);
notify_fail: notify_fail:
kfree(vmid_desc); kfree(vmid_desc);
@@ -189,7 +189,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++) { for (i = 0; i < irq_desc->n_irq; i++) {
struct sde_vm_irq_entry *entry = &irq_desc->irq_entries[i]; struct sde_vm_irq_entry *entry = &irq_desc->irq_entries[i];
rc = hh_irq_lend_v2(entry->label, HH_TRUSTED_VM, entry->irq, rc = gh_irq_lend_v2(entry->label, GH_TRUSTED_VM, entry->irq,
sde_vm_irq_release_notification_handler, sde_vm_irq_release_notification_handler,
sde_vm); sde_vm);
if (rc) { if (rc) {
@@ -200,7 +200,7 @@ static int _sde_vm_lend_irq(struct sde_vm *vm, struct msm_io_res *io_res)
atomic_inc(&sde_vm->base.n_irq_lent); atomic_inc(&sde_vm->base.n_irq_lent);
rc = hh_irq_lend_notify(entry->label); rc = gh_irq_lend_notify(entry->label);
if (rc) { if (rc) {
SDE_ERROR("irq lend notify failed, label: %d, rc=%d\n", SDE_ERROR("irq lend notify failed, label: %d, rc=%d\n",
entry->label, rc); entry->label, rc);
@@ -270,7 +270,7 @@ static void _sde_vm_deinit(struct sde_kms *sde_kms, struct sde_vm_ops *ops)
sde_vm_msgq_deinit(sde_kms->vm); sde_vm_msgq_deinit(sde_kms->vm);
if (sde_vm->base.mem_notification_cookie) if (sde_vm->base.mem_notification_cookie)
hh_mem_notifier_unregister( gh_mem_notifier_unregister(
sde_vm->base.mem_notification_cookie); sde_vm->base.mem_notification_cookie);
if (sde_vm->irq_desc) if (sde_vm->irq_desc)
@@ -307,7 +307,7 @@ int sde_vm_primary_init(struct sde_kms *kms)
_sde_vm_set_ops(&sde_vm->base.vm_ops); _sde_vm_set_ops(&sde_vm->base.vm_ops);
cookie = hh_mem_notifier_register(HH_MEM_NOTIFIER_TAG_DISPLAY, cookie = gh_mem_notifier_register(GH_MEM_NOTIFIER_TAG_DISPLAY,
sde_vm_mem_release_notification_handler, sde_vm); sde_vm_mem_release_notification_handler, sde_vm);
if (!cookie) { if (!cookie) {
SDE_ERROR("fails to register RM mem release notifier\n"); SDE_ERROR("fails to register RM mem release notifier\n");

View File

@@ -3,9 +3,9 @@
* Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
*/ */
#include <linux/haven/hh_rm_drv.h> #include <linux/gunyah/gh_rm_drv.h>
#include <linux/haven/hh_irq_lend.h> #include <linux/gunyah/gh_irq_lend.h>
#include <linux/haven/hh_mem_notifier.h> #include <linux/gunyah/gh_mem_notifier.h>
#include <linux/sort.h> #include <linux/sort.h>
#include <linux/bsearch.h> #include <linux/bsearch.h>
#include <linux/irq.h> #include <linux/irq.h>
@@ -20,14 +20,14 @@
static int __sgl_cmp(const void *a, const void *b) static int __sgl_cmp(const void *a, const void *b)
{ {
struct hh_sgl_entry *l = (struct hh_sgl_entry *)a; struct gh_sgl_entry *l = (struct gh_sgl_entry *)a;
struct hh_sgl_entry *r = (struct hh_sgl_entry *)b; struct gh_sgl_entry *r = (struct gh_sgl_entry *)b;
return (l->ipa_base - r->ipa_base); return (l->ipa_base - r->ipa_base);
} }
int _sde_vm_validate_sgl(struct hh_sgl_desc *expected, int _sde_vm_validate_sgl(struct gh_sgl_desc *expected,
struct hh_sgl_desc *assigned) struct gh_sgl_desc *assigned)
{ {
u32 idx; u32 idx;
@@ -42,8 +42,8 @@ int _sde_vm_validate_sgl(struct hh_sgl_desc *expected,
sizeof(assigned->sgl_entries[0]), __sgl_cmp, NULL); sizeof(assigned->sgl_entries[0]), __sgl_cmp, NULL);
for (idx = 0; idx < expected->n_sgl_entries; idx++) { for (idx = 0; idx < expected->n_sgl_entries; idx++) {
struct hh_sgl_entry *e = &expected->sgl_entries[idx]; struct gh_sgl_entry *e = &expected->sgl_entries[idx];
struct hh_sgl_entry *a = &assigned->sgl_entries[idx]; struct gh_sgl_entry *a = &assigned->sgl_entries[idx];
if ((e->ipa_base != a->ipa_base) || (e->size != a->size)) { if ((e->ipa_base != a->ipa_base) || (e->size != a->size)) {
SDE_DEBUG("sgl mismatch: (%llu - %llu) vs (%llu - %llu)\n", SDE_DEBUG("sgl mismatch: (%llu - %llu) vs (%llu - %llu)\n",
@@ -63,23 +63,23 @@ static int __irq_cmp(const void *a, const void *b)
return (l->label - r->label); return (l->label - r->label);
} }
static void sde_vm_mem_lend_notification_handler(enum hh_mem_notifier_tag tag, static void sde_vm_mem_lend_notification_handler(enum gh_mem_notifier_tag tag,
unsigned long notif_type, unsigned long notif_type,
void *entry_data, void *notif_msg) void *entry_data, void *notif_msg)
{ {
struct hh_rm_notif_mem_shared_payload *payload; struct gh_rm_notif_mem_shared_payload *payload;
struct sde_vm_trusted *sde_vm; struct sde_vm_trusted *sde_vm;
if (notif_type != HH_RM_NOTIF_MEM_SHARED || if (notif_type != GH_RM_NOTIF_MEM_SHARED ||
tag != HH_MEM_NOTIFIER_TAG_DISPLAY) tag != GH_MEM_NOTIFIER_TAG_DISPLAY)
return; return;
if (!entry_data || !notif_msg) if (!entry_data || !notif_msg)
return; return;
payload = (struct hh_rm_notif_mem_shared_payload *)notif_msg; payload = (struct gh_rm_notif_mem_shared_payload *)notif_msg;
if (payload->trans_type != HH_RM_TRANS_TYPE_LEND || if (payload->trans_type != GH_RM_TRANS_TYPE_LEND ||
payload->label != SDE_VM_MEM_LABEL) payload->label != SDE_VM_MEM_LABEL)
return; return;
@@ -96,7 +96,7 @@ static void sde_vm_mem_lend_notification_handler(enum hh_mem_notifier_tag tag,
} }
void sde_vm_irq_lend_notification_handler(void *req, void sde_vm_irq_lend_notification_handler(void *req,
unsigned long notif_type, enum hh_irq_label label) unsigned long notif_type, enum gh_irq_label label)
{ {
SDE_INFO("IRQ LEND notification for label: %d\n", label); SDE_INFO("IRQ LEND notification for label: %d\n", label);
} }
@@ -110,7 +110,7 @@ static int _sde_vm_release_irq(struct sde_vm *vm)
for (i = atomic_read(&sde_vm->base.n_irq_lent) - 1; i >= 0; i--) { for (i = atomic_read(&sde_vm->base.n_irq_lent) - 1; i >= 0; i--) {
struct sde_vm_irq_entry *entry = &irq_desc->irq_entries[i]; struct sde_vm_irq_entry *entry = &irq_desc->irq_entries[i];
rc = hh_irq_release(entry->label); rc = gh_irq_release(entry->label);
if (rc) { if (rc) {
SDE_ERROR("failed to release IRQ label: %d rc = %d\n", SDE_ERROR("failed to release IRQ label: %d rc = %d\n",
entry->label, rc); entry->label, rc);
@@ -119,7 +119,7 @@ static int _sde_vm_release_irq(struct sde_vm *vm)
atomic_dec(&sde_vm->base.n_irq_lent); atomic_dec(&sde_vm->base.n_irq_lent);
rc = hh_irq_release_notify(entry->label); rc = gh_irq_release_notify(entry->label);
if (rc) { if (rc) {
SDE_ERROR( SDE_ERROR(
"irq release notify failed,label: %d rc: %d\n", "irq release notify failed,label: %d rc: %d\n",
@@ -142,15 +142,15 @@ static int _sde_vm_release_mem(struct sde_vm *vm)
if (sde_vm->base.io_mem_handle < 0) if (sde_vm->base.io_mem_handle < 0)
return 0; return 0;
rc = hh_rm_mem_release(sde_vm->base.io_mem_handle, 0); rc = gh_rm_mem_release(sde_vm->base.io_mem_handle, 0);
if (rc) { if (rc) {
SDE_ERROR("hh_rm_mem_release failed, rc=%d\n", rc); SDE_ERROR("gh_rm_mem_release failed, rc=%d\n", rc);
goto done; goto done;
} }
rc = hh_rm_mem_notify(sde_vm->base.io_mem_handle, rc = gh_rm_mem_notify(sde_vm->base.io_mem_handle,
HH_RM_MEM_NOTIFY_OWNER_RELEASED, GH_RM_MEM_NOTIFY_OWNER_RELEASED,
HH_MEM_NOTIFIER_TAG_DISPLAY, 0); GH_MEM_NOTIFIER_TAG_DISPLAY, 0);
if (rc) { if (rc) {
SDE_ERROR("hyp mem notify on release failed, rc = %d\n", rc); SDE_ERROR("hyp mem notify on release failed, rc = %d\n", rc);
goto done; goto done;
@@ -264,7 +264,7 @@ static void _sde_vm_deinit(struct sde_kms *kms, struct sde_vm_ops *ops)
sde_vm_msgq_deinit(kms->vm); sde_vm_msgq_deinit(kms->vm);
if (sde_vm->base.mem_notification_cookie) if (sde_vm->base.mem_notification_cookie)
hh_mem_notifier_unregister( gh_mem_notifier_unregister(
sde_vm->base.mem_notification_cookie); sde_vm->base.mem_notification_cookie);
kfree(sde_vm->sgl_desc); kfree(sde_vm->sgl_desc);
@@ -277,14 +277,14 @@ static void _sde_vm_deinit(struct sde_kms *kms, struct sde_vm_ops *ops)
static int _sde_vm_accept_mem(struct sde_vm *vm) static int _sde_vm_accept_mem(struct sde_vm *vm)
{ {
struct hh_sgl_desc *sgl_desc; struct gh_sgl_desc *sgl_desc;
struct hh_acl_desc *acl_desc; struct gh_acl_desc *acl_desc;
struct sde_vm_trusted *sde_vm; struct sde_vm_trusted *sde_vm;
int rc = 0; int rc = 0;
sde_vm = to_vm_trusted(vm); sde_vm = to_vm_trusted(vm);
acl_desc = sde_vm_populate_acl(HH_TRUSTED_VM); acl_desc = sde_vm_populate_acl(GH_TRUSTED_VM);
if (IS_ERR(acl_desc)) { if (IS_ERR(acl_desc)) {
SDE_ERROR("failed to populate acl data, rc=%ld\n", SDE_ERROR("failed to populate acl data, rc=%ld\n",
PTR_ERR(acl_desc)); PTR_ERR(acl_desc));
@@ -292,16 +292,16 @@ static int _sde_vm_accept_mem(struct sde_vm *vm)
goto done; goto done;
} }
sgl_desc = hh_rm_mem_accept(sde_vm->base.io_mem_handle, sgl_desc = gh_rm_mem_accept(sde_vm->base.io_mem_handle,
HH_RM_MEM_TYPE_IO, GH_RM_MEM_TYPE_IO,
HH_RM_TRANS_TYPE_LEND, GH_RM_TRANS_TYPE_LEND,
HH_RM_MEM_ACCEPT_VALIDATE_ACL_ATTRS| GH_RM_MEM_ACCEPT_VALIDATE_ACL_ATTRS|
HH_RM_MEM_ACCEPT_VALIDATE_LABEL| GH_RM_MEM_ACCEPT_VALIDATE_LABEL|
HH_RM_MEM_ACCEPT_DONE, GH_RM_MEM_ACCEPT_DONE,
SDE_VM_MEM_LABEL, SDE_VM_MEM_LABEL,
acl_desc, NULL, NULL, 0); acl_desc, NULL, NULL, 0);
if (IS_ERR_OR_NULL(sgl_desc)) { if (IS_ERR_OR_NULL(sgl_desc)) {
SDE_ERROR("hh_rm_mem_accept failed with error, rc=%ld\n", SDE_ERROR("gh_rm_mem_accept failed with error, rc=%ld\n",
PTR_ERR(sgl_desc)); PTR_ERR(sgl_desc));
rc = -EINVAL; rc = -EINVAL;
@@ -343,7 +343,7 @@ static int _sde_vm_accept_irq(struct sde_vm *vm)
struct sde_vm_irq_entry *irq_entry = &irq_desc->irq_entries[i]; struct sde_vm_irq_entry *irq_entry = &irq_desc->irq_entries[i];
expected_irq = irq_entry->irq; expected_irq = irq_entry->irq;
accepted_irq = hh_irq_accept(irq_entry->label, -1, accepted_irq = gh_irq_accept(irq_entry->label, -1,
IRQ_TYPE_LEVEL_HIGH); IRQ_TYPE_LEVEL_HIGH);
if (accepted_irq < 0) { if (accepted_irq < 0) {
SDE_ERROR("failed to accept irq for label: %d\n", SDE_ERROR("failed to accept irq for label: %d\n",
@@ -451,7 +451,7 @@ int sde_vm_trusted_init(struct sde_kms *kms)
goto init_fail; goto init_fail;
} }
cookie = hh_mem_notifier_register(HH_MEM_NOTIFIER_TAG_DISPLAY, cookie = gh_mem_notifier_register(GH_MEM_NOTIFIER_TAG_DISPLAY,
sde_vm_mem_lend_notification_handler, sde_vm); sde_vm_mem_lend_notification_handler, sde_vm);
if (!cookie) { if (!cookie) {
SDE_ERROR("fails to register RM mem lend notifier\n"); SDE_ERROR("fails to register RM mem lend notifier\n");
@@ -459,12 +459,12 @@ int sde_vm_trusted_init(struct sde_kms *kms)
} }
sde_vm->base.mem_notification_cookie = cookie; sde_vm->base.mem_notification_cookie = cookie;
rc = hh_irq_wait_for_lend_v2(HH_IRQ_LABEL_SDE, HH_PRIMARY_VM, rc = gh_irq_wait_for_lend_v2(GH_IRQ_LABEL_SDE, GH_PRIMARY_VM,
sde_vm_irq_lend_notification_handler, sde_vm_irq_lend_notification_handler,
(void *)sde_vm); (void *)sde_vm);
if (rc) { if (rc) {
SDE_ERROR("wait for irq lend on label: %d failed, rc=%d\n", SDE_ERROR("wait for irq lend on label: %d failed, rc=%d\n",
HH_IRQ_LABEL_SDE, rc); GH_IRQ_LABEL_SDE, rc);
goto init_fail; goto init_fail;
} }