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

Commit 9fe041f6 authored by Jordan Crouse's avatar Jordan Crouse Committed by Rob Clark
Browse files

drm/msm: Add msm_gem_get_and_pin_iova()



Add a new function to get and pin the iova memory in one
step (basically renaming the old msm_gem_get_iova function)
and switch msm_gem_get_iova() to only allocate an iova but
not map it in the IOMMU. This is only currently used by
msm_ioctl_gem_info() since all other users of of the iova
expect that the memory be immediately available.

Signed-off-by: default avatarJordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: default avatarRob Clark <robdclark@gmail.com>
parent 575f0485
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -209,7 +209,8 @@ int adreno_hw_init(struct msm_gpu *gpu)
		if (!ring)
		if (!ring)
			continue;
			continue;


		ret = msm_gem_get_iova(ring->bo, gpu->aspace, &ring->iova);
		ret = msm_gem_get_and_pin_iova(ring->bo, gpu->aspace,
			&ring->iova);
		if (ret) {
		if (ret) {
			ring->iova = 0;
			ring->iova = 0;
			DRM_DEV_ERROR(gpu->dev->dev,
			DRM_DEV_ERROR(gpu->dev->dev,
+2 −2
Original line number Original line Diff line number Diff line
@@ -384,7 +384,7 @@ static void update_cursor(struct drm_crtc *crtc)
		if (next_bo) {
		if (next_bo) {
			/* take a obj ref + iova ref when we start scanning out: */
			/* take a obj ref + iova ref when we start scanning out: */
			drm_gem_object_get(next_bo);
			drm_gem_object_get(next_bo);
			msm_gem_get_iova(next_bo, kms->aspace, &iova);
			msm_gem_get_and_pin_iova(next_bo, kms->aspace, &iova);


			/* enable cursor: */
			/* enable cursor: */
			mdp4_write(mdp4_kms, REG_MDP4_DMA_CURSOR_SIZE(dma),
			mdp4_write(mdp4_kms, REG_MDP4_DMA_CURSOR_SIZE(dma),
@@ -442,7 +442,7 @@ static int mdp4_crtc_cursor_set(struct drm_crtc *crtc,
	}
	}


	if (cursor_bo) {
	if (cursor_bo) {
		ret = msm_gem_get_iova(cursor_bo, kms->aspace, &iova);
		ret = msm_gem_get_and_pin_iova(cursor_bo, kms->aspace, &iova);
		if (ret)
		if (ret)
			goto fail;
			goto fail;
	} else {
	} else {
+1 −1
Original line number Original line Diff line number Diff line
@@ -538,7 +538,7 @@ struct msm_kms *mdp4_kms_init(struct drm_device *dev)
		goto fail;
		goto fail;
	}
	}


	ret = msm_gem_get_iova(mdp4_kms->blank_cursor_bo, kms->aspace,
	ret = msm_gem_get_and_pin_iova(mdp4_kms->blank_cursor_bo, kms->aspace,
			&mdp4_kms->blank_cursor_iova);
			&mdp4_kms->blank_cursor_iova);
	if (ret) {
	if (ret) {
		DRM_DEV_ERROR(dev->dev, "could not pin blank-cursor bo: %d\n", ret);
		DRM_DEV_ERROR(dev->dev, "could not pin blank-cursor bo: %d\n", ret);
+1 −1
Original line number Original line Diff line number Diff line
@@ -903,7 +903,7 @@ static int mdp5_crtc_cursor_set(struct drm_crtc *crtc,
	if (!cursor_bo)
	if (!cursor_bo)
		return -ENOENT;
		return -ENOENT;


	ret = msm_gem_get_iova(cursor_bo, kms->aspace,
	ret = msm_gem_get_and_pin_iova(cursor_bo, kms->aspace,
			&mdp5_crtc->cursor.iova);
			&mdp5_crtc->cursor.iova);
	if (ret)
	if (ret)
		return -EINVAL;
		return -EINVAL;
+1 −1
Original line number Original line Diff line number Diff line
@@ -1248,7 +1248,7 @@ int dsi_dma_base_get_6g(struct msm_dsi_host *msm_host, uint64_t *dma_base)
	if (!dma_base)
	if (!dma_base)
		return -EINVAL;
		return -EINVAL;


	return msm_gem_get_iova(msm_host->tx_gem_obj,
	return msm_gem_get_and_pin_iova(msm_host->tx_gem_obj,
				priv->kms->aspace, dma_base);
				priv->kms->aspace, dma_base);
}
}


Loading