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: Jayaprakash <jmadiset@codeaurora.org>
Cette révision appartient à :
Jayaprakash
2020-10-23 13:08:10 +05:30
Parent a27dce97f8
révision babaee2f7f

Voir le fichier

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