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

Commit 68b75aac authored by Veera Sundaram Sankaran's avatar Veera Sundaram Sankaran Committed by Gerrit - the friendly Code Review server
Browse files

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: default avatarVeera Sundaram Sankaran <veeras@codeaurora.org>
parent bfec52ae
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -1259,12 +1259,6 @@ struct drm_gem_object *msm_gem_import(struct drm_device *dev,
	int ret;
	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);

	ret = msm_gem_new_impl(dev, size, MSM_BO_WC, dmabuf->resv, &obj,
+8 −0
Original line number Diff line number Diff line
@@ -1726,6 +1726,8 @@ int sde_crtc_find_plane_fb_modes(struct drm_crtc *crtc,
		case SDE_DRM_FB_SEC_DIR_TRANS:
			(*fb_sec_dir)++;
			break;
		case SDE_DRM_FB_NON_SEC_DIR_TRANS:
			break;
		default:
			SDE_ERROR("Error: Plane[%d], fb_trans_mode:%d",
					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:
			(*fb_sec_dir)++;
			break;
		case SDE_DRM_FB_NON_SEC_DIR_TRANS:
			break;
		default:
			SDE_ERROR("Error: Plane[%d], fb_trans_mode:%d",
					DRMID(plane), mode);
@@ -1927,6 +1931,10 @@ int sde_crtc_get_secure_transition_ops(struct drm_crtc *crtc,
				old_valid_fb, post_commit, &ops);
		break;

	case SDE_DRM_FB_NON_SEC_DIR_TRANS:
		ops = 0;
		break;

	default:
		SDE_ERROR("crtc%d: invalid plane fb_mode %d\n",
				DRMID(crtc), translation_mode);
+24 −4
Original line number Diff line number Diff line
@@ -2147,13 +2147,33 @@ _sde_kms_get_address_space(struct msm_kms *kms,
static struct device *_sde_kms_get_address_space_device(struct msm_kms *kms,
		unsigned int domain)
{
	struct msm_gem_address_space *aspace =
		_sde_kms_get_address_space(kms, domain);
	struct sde_kms *sde_kms;
	struct device *dev;
	struct msm_gem_address_space *aspace;

	if (!kms) {
		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 (aspace && aspace->domain_attached) ?
	/* 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)
{
	struct drm_device *dev = NULL;
+1 −0
Original line number Diff line number Diff line
@@ -701,6 +701,7 @@ static int _sde_plane_get_aspace(
		if (!aspace)
			return -EINVAL;
		break;
	case SDE_DRM_FB_NON_SEC_DIR_TRANS:
	case SDE_DRM_FB_SEC_DIR_TRANS:
		*aspace = NULL;
		break;