Skip to content

Commit

Permalink
drm/msm: no mmu is only error if not using vram carveout
Browse files Browse the repository at this point in the history
Signed-off-by: Rob Clark <robdclark@gmail.com>
  • Loading branch information
Rob Clark committed Aug 4, 2014
1 parent 036c170 commit 1c4997f
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions drivers/gpu/drm/msm/msm_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,24 +278,23 @@ int msm_gem_get_iova_locked(struct drm_gem_object *obj, int id,
uint32_t *iova)
{
struct msm_gem_object *msm_obj = to_msm_bo(obj);
struct drm_device *dev = obj->dev;
int ret = 0;

if (!msm_obj->domain[id].iova) {
struct msm_drm_private *priv = obj->dev->dev_private;
struct msm_mmu *mmu = priv->mmus[id];
struct page **pages = get_pages(obj);

if (!mmu) {
dev_err(dev->dev, "null MMU pointer\n");
return -EINVAL;
}

if (IS_ERR(pages))
return PTR_ERR(pages);

if (iommu_present(&platform_bus_type)) {
uint32_t offset = (uint32_t)mmap_offset(obj);
struct msm_mmu *mmu = priv->mmus[id];
uint32_t offset;

if (WARN_ON(!mmu))
return -EINVAL;

offset = (uint32_t)mmap_offset(obj);
ret = mmu->funcs->map(mmu, offset, msm_obj->sgt,
obj->size, IOMMU_READ | IOMMU_WRITE);
msm_obj->domain[id].iova = offset;
Expand Down

0 comments on commit 1c4997f

Please sign in to comment.