Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 909f7878 authored by Veera Sundaram Sankaran's avatar Veera Sundaram Sankaran
Browse files

drm/msm: track msm_gem_obj in active_list with a boolean



The active_list is maintained to keep track of the unmapped
buffers during the detach of a context-bank, so that it can
be re-mapped during the re-attach process. Add a boolean to
track if the msm_obj is part of active_list to avoid adding
it twice. In addition, set the aspace domain_attached flag
before the re-mapping of buffers during the re-attach process.
This is required to re-map the buffers for which the domains
were removed during detach of the context-bank.

Change-Id: Ic4daa020dbed2faaffd609ceb369a2fbd36af4cf
Signed-off-by: default avatarVeera Sundaram Sankaran <veeras@codeaurora.org>
parent e00d2a35
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -490,7 +490,7 @@ int msm_gem_get_iova(struct drm_gem_object *obj,

	*iova = vma->iova;

	if (aspace && aspace->domain_attached) {
	if (aspace &&  !msm_obj->in_active_list) {
		mutex_lock(&aspace->list_lock);
		msm_gem_add_obj_to_aspace_active_list(aspace, obj);
		mutex_unlock(&aspace->list_lock);
@@ -1035,6 +1035,7 @@ static int msm_gem_new_impl(struct drm_device *dev,
	INIT_LIST_HEAD(&msm_obj->vmas);
	INIT_LIST_HEAD(&msm_obj->iova_list);
	msm_obj->aspace = NULL;
	msm_obj->in_active_list = false;

	if (struct_mutex_locked) {
		WARN_ON(!mutex_is_locked(&dev->struct_mutex));
+1 −0
Original line number Diff line number Diff line
@@ -134,6 +134,7 @@ struct msm_gem_object {
	struct list_head iova_list;

	struct msm_gem_address_space *aspace;
	bool in_active_list;
};
#define to_msm_bo(x) container_of(x, struct msm_gem_object, base)

+2 −0
Original line number Diff line number Diff line
@@ -68,6 +68,7 @@ static void smmu_aspace_add_to_active(
{
	WARN_ON(!mutex_is_locked(&aspace->list_lock));
	list_move_tail(&msm_obj->iova_list, &aspace->active_list);
	msm_obj->in_active_list = true;
}

static void smmu_aspace_remove_from_active(
@@ -81,6 +82,7 @@ static void smmu_aspace_remove_from_active(
	list_for_each_entry_safe(msm_obj, next, &aspace->active_list,
			iova_list) {
		if (msm_obj == obj) {
			msm_obj->in_active_list = false;
			list_del(&msm_obj->iova_list);
			break;
		}
+1 −1
Original line number Diff line number Diff line
@@ -1799,8 +1799,8 @@ int sde_kms_mmu_attach(struct sde_kms *sde_kms, bool secure_only)
		aspace->mmu->funcs->attach(mmu, (const char **)iommu_ports,
			ARRAY_SIZE(iommu_ports));

		msm_gem_aspace_domain_attach_detach_update(aspace, false);
		aspace->domain_attached = true;
		msm_gem_aspace_domain_attach_detach_update(aspace, false);
	}

	return 0;