disp: msm: use FB_NON_SEC_DIR_TRANS plane hint for TUI VM buffers
Add plane buffer flag to get the correct aspace during TUI VM usecase. FB_NON_SEC_DIR_TRANS plane flag is set by user-mode to indicate S2-only non-secure buffer in TUI VM. Return the default drm device when SMMU is not available during get_aspace_device to make the working seamless with/without SMMU. Change-Id: I158dc17ba51ff4b2f302d3e7017db8ab3cfe2b84 Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
This commit is contained in:

committed by
Gerrit - the friendly Code Review server

parent
bfec52ae7b
commit
68b75aac24
@@ -1259,12 +1259,6 @@ struct drm_gem_object *msm_gem_import(struct drm_device *dev,
|
|||||||
int ret;
|
int ret;
|
||||||
unsigned long flags = 0;
|
unsigned long flags = 0;
|
||||||
|
|
||||||
/* if we don't have IOMMU, don't bother pretending we can import: */
|
|
||||||
if (!iommu_present(&platform_bus_type)) {
|
|
||||||
dev_err(dev->dev, "cannot import without IOMMU\n");
|
|
||||||
return ERR_PTR(-EINVAL);
|
|
||||||
}
|
|
||||||
|
|
||||||
size = PAGE_ALIGN(dmabuf->size);
|
size = PAGE_ALIGN(dmabuf->size);
|
||||||
|
|
||||||
ret = msm_gem_new_impl(dev, size, MSM_BO_WC, dmabuf->resv, &obj,
|
ret = msm_gem_new_impl(dev, size, MSM_BO_WC, dmabuf->resv, &obj,
|
||||||
|
@@ -1726,6 +1726,8 @@ int sde_crtc_find_plane_fb_modes(struct drm_crtc *crtc,
|
|||||||
case SDE_DRM_FB_SEC_DIR_TRANS:
|
case SDE_DRM_FB_SEC_DIR_TRANS:
|
||||||
(*fb_sec_dir)++;
|
(*fb_sec_dir)++;
|
||||||
break;
|
break;
|
||||||
|
case SDE_DRM_FB_NON_SEC_DIR_TRANS:
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
SDE_ERROR("Error: Plane[%d], fb_trans_mode:%d",
|
SDE_ERROR("Error: Plane[%d], fb_trans_mode:%d",
|
||||||
DRMID(plane), mode);
|
DRMID(plane), mode);
|
||||||
@@ -1773,6 +1775,8 @@ int sde_crtc_state_find_plane_fb_modes(struct drm_crtc_state *state,
|
|||||||
case SDE_DRM_FB_SEC_DIR_TRANS:
|
case SDE_DRM_FB_SEC_DIR_TRANS:
|
||||||
(*fb_sec_dir)++;
|
(*fb_sec_dir)++;
|
||||||
break;
|
break;
|
||||||
|
case SDE_DRM_FB_NON_SEC_DIR_TRANS:
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
SDE_ERROR("Error: Plane[%d], fb_trans_mode:%d",
|
SDE_ERROR("Error: Plane[%d], fb_trans_mode:%d",
|
||||||
DRMID(plane), mode);
|
DRMID(plane), mode);
|
||||||
@@ -1927,6 +1931,10 @@ int sde_crtc_get_secure_transition_ops(struct drm_crtc *crtc,
|
|||||||
old_valid_fb, post_commit, &ops);
|
old_valid_fb, post_commit, &ops);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case SDE_DRM_FB_NON_SEC_DIR_TRANS:
|
||||||
|
ops = 0;
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
SDE_ERROR("crtc%d: invalid plane fb_mode %d\n",
|
SDE_ERROR("crtc%d: invalid plane fb_mode %d\n",
|
||||||
DRMID(crtc), translation_mode);
|
DRMID(crtc), translation_mode);
|
||||||
|
@@ -2147,11 +2147,31 @@ _sde_kms_get_address_space(struct msm_kms *kms,
|
|||||||
static struct device *_sde_kms_get_address_space_device(struct msm_kms *kms,
|
static struct device *_sde_kms_get_address_space_device(struct msm_kms *kms,
|
||||||
unsigned int domain)
|
unsigned int domain)
|
||||||
{
|
{
|
||||||
struct msm_gem_address_space *aspace =
|
struct sde_kms *sde_kms;
|
||||||
_sde_kms_get_address_space(kms, domain);
|
struct device *dev;
|
||||||
|
struct msm_gem_address_space *aspace;
|
||||||
|
|
||||||
return (aspace && aspace->domain_attached) ?
|
if (!kms) {
|
||||||
msm_gem_get_aspace_device(aspace) : NULL;
|
SDE_ERROR("invalid kms\n");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
sde_kms = to_sde_kms(kms);
|
||||||
|
if (!sde_kms || !sde_kms->dev || !sde_kms->dev->dev) {
|
||||||
|
SDE_ERROR("invalid params\n");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* return default device, when IOMMU is not present */
|
||||||
|
if (!iommu_present(&platform_bus_type)) {
|
||||||
|
dev = sde_kms->dev->dev;
|
||||||
|
} else {
|
||||||
|
aspace = _sde_kms_get_address_space(kms, domain);
|
||||||
|
dev = (aspace && aspace->domain_attached) ?
|
||||||
|
msm_gem_get_aspace_device(aspace) : NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
return dev;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void _sde_kms_post_open(struct msm_kms *kms, struct drm_file *file)
|
static void _sde_kms_post_open(struct msm_kms *kms, struct drm_file *file)
|
||||||
|
@@ -701,6 +701,7 @@ static int _sde_plane_get_aspace(
|
|||||||
if (!aspace)
|
if (!aspace)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
break;
|
break;
|
||||||
|
case SDE_DRM_FB_NON_SEC_DIR_TRANS:
|
||||||
case SDE_DRM_FB_SEC_DIR_TRANS:
|
case SDE_DRM_FB_SEC_DIR_TRANS:
|
||||||
*aspace = NULL;
|
*aspace = NULL;
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user