disp: msm: fail commit if drm_gem_obj was found attached to a sec CB
This change fails the drm_atomic_commit and avoids S2 translation fault if drm_gem_object is found attached to a secure context bank during non secure session. In the current codeflow, we are detaching the gem object from secure CB and reattaching it to non secure CB, but only S1 pagetables entries get modified and S2 pagetables entries are not corrected since hyp_unassign is not called with CP_PIXEL VMID which can only be done by client when buffer gets allocated. Change-Id: I62302064f96276ef82044ee88fb89e295fb96b4b Signed-off-by: Jayaprakash Madisetty <quic_jmadiset@quicinc.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
* Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.
|
||||
* Copyright (C) 2013 Red Hat
|
||||
* Author: Rob Clark <robdclark@gmail.com>
|
||||
@@ -445,6 +445,17 @@ static int msm_gem_get_iova_locked(struct drm_gem_object *obj,
|
||||
if ((dev && obj->import_attach) &&
|
||||
((dev != obj->import_attach->dev) ||
|
||||
msm_obj->obj_dirty)) {
|
||||
|
||||
if (of_device_is_compatible(dev->of_node, "qcom,smmu_sde_unsec") &&
|
||||
of_device_is_compatible(obj->import_attach->dev->of_node,
|
||||
"qcom,smmu_sde_sec")) {
|
||||
SDE_EVT32(obj->import_attach->dev, dev, msm_obj->sgt,
|
||||
msm_obj->obj_dirty);
|
||||
DRM_ERROR("gem obj found mapped to %s, now requesting map on %s",
|
||||
dev_name(obj->import_attach->dev), dev_name(dev));
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
dmabuf = obj->import_attach->dmabuf;
|
||||
dma_map_attrs = obj->import_attach->dma_map_attrs;
|
||||
|
||||
|
Referens i nytt ärende
Block a user