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

Commit babaee2f authored by Jayaprakash's avatar Jayaprakash
Browse files

disp: msm: re-apply dma_map_attr during secure-UI to secure-vid transition



Add changes to re-apply the dma_map attributes during secure UI
to secure-video transition to avoid mismatch of attributes
between the import_attach newly created and the msm_iommu
mappings already existed.

Change-Id: I5a902d6d88c6ea9f633b4396e8121c2b14708f31
Signed-off-by: default avatarJayaprakash <jmadiset@codeaurora.org>
parent a27dce97
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -431,12 +431,14 @@ static int msm_gem_get_iova_locked(struct drm_gem_object *obj,
		struct device *dev;
		struct dma_buf *dmabuf;
		bool reattach = false;
		unsigned long dma_map_attrs;

		dev = msm_gem_get_aspace_device(aspace);
		if ((dev && obj->import_attach) &&
				((dev != obj->import_attach->dev) ||
				msm_obj->obj_dirty)) {
			dmabuf = obj->import_attach->dmabuf;
			dma_map_attrs = obj->import_attach->dma_map_attrs;

			DRM_DEBUG("detach nsec-dev:%pK attach sec-dev:%pK\n",
					obj->import_attach->dev, dev);
@@ -455,6 +457,12 @@ static int msm_gem_get_iova_locked(struct drm_gem_object *obj,
				ret = PTR_ERR(obj->import_attach);
				return ret;
			}
			/*
			 * obj->import_attach is created as part of dma_buf_attach.
			 * Re-apply the dma_map_attr in this case to be in sync
			 * with iommu_map attrs during map_attachment callback.
			 */
			obj->import_attach->dma_map_attrs |= dma_map_attrs;
			msm_obj->obj_dirty = false;
			reattach = true;
		}