Re: [Intel-gfx] [PATCH 2/2] drm/i915: remove unused has_dma_mapping flag

2015-07-13 Thread Daniel Vetter
On Wed, Jul 08, 2015 at 06:43:23PM +0100, Chris Wilson wrote:
 On Wed, Jul 08, 2015 at 07:18:59PM +0300, Imre Deak wrote:
  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.d...@intel.com
 
 Mentioned a trivial obj-get_page bugfix for
 __i915_gem_userptr_set_pages(), and then went on an archaelogical dig to
 understand why I didn't think of this earlier. Apparently, it just never
 occurred to me that I could remove this flag introduced for
 i915_gem_prime when we did the get_pages/put_pages support for it.
 
 Both patches (incl. the minor fix above for 1),
 Reviewed-by: Chris Wilson ch...@chris-wilson.co.uk

Applied to -fixes (too lazy for a backmerge), thanks.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 2/2] drm/i915: remove unused has_dma_mapping flag

2015-07-08 Thread Imre Deak
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.d...@intel.com
---
 drivers/gpu/drm/i915/i915_drv.h| 2 --
 drivers/gpu/drm/i915/i915_gem.c| 3 ---
 drivers/gpu/drm/i915/i915_gem_dmabuf.c | 2 --
 drivers/gpu/drm/i915/i915_gem_gtt.c| 9 ++---
 drivers/gpu/drm/i915/i915_gem_stolen.c | 1 -
 5 files changed, 2 insertions(+), 15 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 093d642..152eedf 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -2071,8 +2071,6 @@ struct drm_i915_gem_object {
unsigned int cache_level:3;
unsigned int cache_dirty:1;
 
-   unsigned int has_dma_mapping:1;
-
unsigned int frontbuffer_bits:INTEL_FRONTBUFFER_BITS;
 
unsigned int pin_display;
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index aa71067..219d4d5 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -217,7 +217,6 @@ i915_gem_object_get_pages_phys(struct drm_i915_gem_object 
*obj)
sg_dma_len(sg) = obj-base.size;
 
obj-pages = st;
-   obj-has_dma_mapping = true;
return 0;
 }
 
@@ -269,8 +268,6 @@ i915_gem_object_put_pages_phys(struct drm_i915_gem_object 
*obj)
 
sg_free_table(obj-pages);
kfree(obj-pages);
-
-   obj-has_dma_mapping = false;
 }
 
 static void
diff --git a/drivers/gpu/drm/i915/i915_gem_dmabuf.c 
b/drivers/gpu/drm/i915/i915_gem_dmabuf.c
index 7998da2..e9c2bfd 100644
--- a/drivers/gpu/drm/i915/i915_gem_dmabuf.c
+++ b/drivers/gpu/drm/i915/i915_gem_dmabuf.c
@@ -256,7 +256,6 @@ static int i915_gem_object_get_pages_dmabuf(struct 
drm_i915_gem_object *obj)
return PTR_ERR(sg);
 
obj-pages = sg;
-   obj-has_dma_mapping = true;
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,
 obj-pages, DMA_BIDIRECTIONAL);
-   obj-has_dma_mapping = false;
 }
 
 static const struct drm_i915_gem_object_ops i915_gem_object_dmabuf_ops = {
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c 
b/drivers/gpu/drm/i915/i915_gem_gtt.c
index b29b73f..44255a8 100644
--- a/drivers/gpu/drm/i915/i915_gem_gtt.c
+++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
@@ -1802,9 +1802,6 @@ void i915_gem_suspend_gtt_mappings(struct drm_device *dev)
 
 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,
obj-pages-sgl, obj-pages-nents,
PCI_DMA_BIDIRECTIONAL))
@@ -2052,10 +2049,8 @@ void i915_gem_gtt_finish_object(struct 
drm_i915_gem_object *obj)
 
interruptible = do_idling(dev_priv);
 
-   if (!obj-has_dma_mapping)
-   dma_unmap_sg(dev-pdev-dev,
-obj-pages-sgl, obj-pages-nents,
-PCI_DMA_BIDIRECTIONAL);
+   dma_unmap_sg(dev-pdev-dev, obj-pages-sgl, obj-pages-nents,
+PCI_DMA_BIDIRECTIONAL);
 
undo_idling(dev_priv, interruptible);
 }
diff --git a/drivers/gpu/drm/i915/i915_gem_stolen.c 
b/drivers/gpu/drm/i915/i915_gem_stolen.c
index de76d88..ed682a9 100644
--- a/drivers/gpu/drm/i915/i915_gem_stolen.c
+++ b/drivers/gpu/drm/i915/i915_gem_stolen.c
@@ -316,7 +316,6 @@ _i915_gem_object_create_stolen(struct drm_device *dev,
if (obj-pages == NULL)
goto cleanup;
 
-   obj-has_dma_mapping = true;
i915_gem_object_pin_pages(obj);
obj-stolen = stolen;
 
-- 
2.1.4

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 2/2] drm/i915: remove unused has_dma_mapping flag

2015-07-08 Thread Chris Wilson
On Wed, Jul 08, 2015 at 07:18:59PM +0300, Imre Deak wrote:
 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.d...@intel.com

Mentioned a trivial obj-get_page bugfix for
__i915_gem_userptr_set_pages(), and then went on an archaelogical dig to
understand why I didn't think of this earlier. Apparently, it just never
occurred to me that I could remove this flag introduced for
i915_gem_prime when we did the get_pages/put_pages support for it.

Both patches (incl. the minor fix above for 1),
Reviewed-by: Chris Wilson ch...@chris-wilson.co.uk
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 2/2] drm/i915: remove unused has_dma_mapping flag

2015-07-08 Thread shuang . he
Tested-By: Intel Graphics QA PRTS (Patch Regression Test System Contact: 
shuang...@intel.com)
Task id: 6754
-Summary-
Platform  Delta  drm-intel-nightly  Series Applied
ILK  302/302  302/302
SNB  312/316  312/316
IVB  343/343  343/343
BYT  287/287  287/287
HSW  380/380  380/380
-Detailed-
Platform  Testdrm-intel-nightly  Series 
Applied
Note: You need to pay more attention to line start with '*'
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx