drm/i915: remove unused has_dma_mapping flag
After the previous patch this flag will check always clear, as it's never set for shmem backed and userptr objects, so we can remove it. Signed-off-by: Imre Deak <imre.deak@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> [danvet: Yeah this isn't really fixes but it's a nice cleanup to clarify the code but not really worth the hassle of backmerging. So just add to -fixes, we're still early in -rc.] Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
parent
101057fa40
commit
5ec5b51639
|
@ -2037,8 +2037,6 @@ struct drm_i915_gem_object {
|
||||||
unsigned int cache_level:3;
|
unsigned int cache_level:3;
|
||||||
unsigned int cache_dirty:1;
|
unsigned int cache_dirty:1;
|
||||||
|
|
||||||
unsigned int has_dma_mapping:1;
|
|
||||||
|
|
||||||
unsigned int frontbuffer_bits:INTEL_FRONTBUFFER_BITS;
|
unsigned int frontbuffer_bits:INTEL_FRONTBUFFER_BITS;
|
||||||
|
|
||||||
unsigned int pin_display;
|
unsigned int pin_display;
|
||||||
|
|
|
@ -213,7 +213,6 @@ i915_gem_object_get_pages_phys(struct drm_i915_gem_object *obj)
|
||||||
sg_dma_len(sg) = obj->base.size;
|
sg_dma_len(sg) = obj->base.size;
|
||||||
|
|
||||||
obj->pages = st;
|
obj->pages = st;
|
||||||
obj->has_dma_mapping = true;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -265,8 +264,6 @@ i915_gem_object_put_pages_phys(struct drm_i915_gem_object *obj)
|
||||||
|
|
||||||
sg_free_table(obj->pages);
|
sg_free_table(obj->pages);
|
||||||
kfree(obj->pages);
|
kfree(obj->pages);
|
||||||
|
|
||||||
obj->has_dma_mapping = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -256,7 +256,6 @@ static int i915_gem_object_get_pages_dmabuf(struct drm_i915_gem_object *obj)
|
||||||
return PTR_ERR(sg);
|
return PTR_ERR(sg);
|
||||||
|
|
||||||
obj->pages = sg;
|
obj->pages = sg;
|
||||||
obj->has_dma_mapping = true;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -264,7 +263,6 @@ static void i915_gem_object_put_pages_dmabuf(struct drm_i915_gem_object *obj)
|
||||||
{
|
{
|
||||||
dma_buf_unmap_attachment(obj->base.import_attach,
|
dma_buf_unmap_attachment(obj->base.import_attach,
|
||||||
obj->pages, DMA_BIDIRECTIONAL);
|
obj->pages, DMA_BIDIRECTIONAL);
|
||||||
obj->has_dma_mapping = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct drm_i915_gem_object_ops i915_gem_object_dmabuf_ops = {
|
static const struct drm_i915_gem_object_ops i915_gem_object_dmabuf_ops = {
|
||||||
|
|
|
@ -1723,9 +1723,6 @@ void i915_gem_suspend_gtt_mappings(struct drm_device *dev)
|
||||||
|
|
||||||
int i915_gem_gtt_prepare_object(struct drm_i915_gem_object *obj)
|
int i915_gem_gtt_prepare_object(struct drm_i915_gem_object *obj)
|
||||||
{
|
{
|
||||||
if (obj->has_dma_mapping)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
if (!dma_map_sg(&obj->base.dev->pdev->dev,
|
if (!dma_map_sg(&obj->base.dev->pdev->dev,
|
||||||
obj->pages->sgl, obj->pages->nents,
|
obj->pages->sgl, obj->pages->nents,
|
||||||
PCI_DMA_BIDIRECTIONAL))
|
PCI_DMA_BIDIRECTIONAL))
|
||||||
|
@ -1972,9 +1969,7 @@ void i915_gem_gtt_finish_object(struct drm_i915_gem_object *obj)
|
||||||
|
|
||||||
interruptible = do_idling(dev_priv);
|
interruptible = do_idling(dev_priv);
|
||||||
|
|
||||||
if (!obj->has_dma_mapping)
|
dma_unmap_sg(&dev->pdev->dev, obj->pages->sgl, obj->pages->nents,
|
||||||
dma_unmap_sg(&dev->pdev->dev,
|
|
||||||
obj->pages->sgl, obj->pages->nents,
|
|
||||||
PCI_DMA_BIDIRECTIONAL);
|
PCI_DMA_BIDIRECTIONAL);
|
||||||
|
|
||||||
undo_idling(dev_priv, interruptible);
|
undo_idling(dev_priv, interruptible);
|
||||||
|
|
|
@ -416,7 +416,6 @@ _i915_gem_object_create_stolen(struct drm_device *dev,
|
||||||
if (obj->pages == NULL)
|
if (obj->pages == NULL)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
obj->has_dma_mapping = true;
|
|
||||||
i915_gem_object_pin_pages(obj);
|
i915_gem_object_pin_pages(obj);
|
||||||
obj->stolen = stolen;
|
obj->stolen = stolen;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue