All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] i965/gen9: Pass alignment as function parameter in drm_intel_gem_bo_alloc_internal()
@ 2015-04-11  0:20 Anuj Phogat
  2015-04-11  0:20 ` [PATCH 2/2] Set alignment value in drm_intel_add_validate_buffer() Anuj Phogat
                   ` (5 more replies)
  0 siblings, 6 replies; 32+ messages in thread
From: Anuj Phogat @ 2015-04-11  0:20 UTC (permalink / raw)
  To: intel-gfx

and use it to initialize the align variable in drm_intel_bo.

In case of YF/YS tiled buffers libdrm need not know about the tiling
format because these buffers don't have hardware support to be tiled
or detiled through a fenced region. But, libdrm still need to know
about buffer alignment restrictions because kernel uses it when
resolving the relocation.

Mesa uses drm_intel_gem_bo_alloc_for_render() to allocate Yf/Ys buffers.
So, use the passed alignment value in this function. Note that we continue
ignoring the alignment value passed to drm_intel_gem_bo_alloc() to follow
the previous behavior.

Cc: Kristian Høgsberg <krh@bitplanet.net>
Cc: Damien Lespiau <damien.lespiau@intel.com>
Cc: Daniel Vetter <daniel@ffwll.ch>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
---
 intel/intel_bufmgr_gem.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/intel/intel_bufmgr_gem.c b/intel/intel_bufmgr_gem.c
index 5a67f53..51d87ae 100644
--- a/intel/intel_bufmgr_gem.c
+++ b/intel/intel_bufmgr_gem.c
@@ -655,7 +655,8 @@ drm_intel_gem_bo_alloc_internal(drm_intel_bufmgr *bufmgr,
 				unsigned long size,
 				unsigned long flags,
 				uint32_t tiling_mode,
-				unsigned long stride)
+				unsigned long stride,
+				unsigned int alignment)
 {
 	drm_intel_bufmgr_gem *bufmgr_gem = (drm_intel_bufmgr_gem *) bufmgr;
 	drm_intel_bo_gem *bo_gem;
@@ -754,6 +755,7 @@ retry:
 			return NULL;
 		}
 		bo_gem->bo.bufmgr = bufmgr;
+		bo_gem->bo.align = alignment;
 
 		bo_gem->tiling_mode = I915_TILING_NONE;
 		bo_gem->swizzle_mode = I915_BIT_6_SWIZZLE_NONE;
@@ -797,7 +799,8 @@ drm_intel_gem_bo_alloc_for_render(drm_intel_bufmgr *bufmgr,
 {
 	return drm_intel_gem_bo_alloc_internal(bufmgr, name, size,
 					       BO_ALLOC_FOR_RENDER,
-					       I915_TILING_NONE, 0);
+					       I915_TILING_NONE, 0,
+					       alignment);
 }
 
 static drm_intel_bo *
@@ -807,7 +810,7 @@ drm_intel_gem_bo_alloc(drm_intel_bufmgr *bufmgr,
 		       unsigned int alignment)
 {
 	return drm_intel_gem_bo_alloc_internal(bufmgr, name, size, 0,
-					       I915_TILING_NONE, 0);
+					       I915_TILING_NONE, 0, 0);
 }
 
 static drm_intel_bo *
@@ -859,7 +862,7 @@ drm_intel_gem_bo_alloc_tiled(drm_intel_bufmgr *bufmgr, const char *name,
 		stride = 0;
 
 	return drm_intel_gem_bo_alloc_internal(bufmgr, name, size, flags,
-					       tiling, stride);
+					       tiling, stride, 0);
 }
 
 static drm_intel_bo *
-- 
2.3.4

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

^ permalink raw reply related	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2015-07-03 10:21 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-11  0:20 [PATCH 1/2] i965/gen9: Pass alignment as function parameter in drm_intel_gem_bo_alloc_internal() Anuj Phogat
2015-04-11  0:20 ` [PATCH 2/2] Set alignment value in drm_intel_add_validate_buffer() Anuj Phogat
2015-05-20 21:01   ` Anuj Phogat
2015-06-09 22:00     ` Anuj Phogat
2015-06-19 22:52   ` Anuj Phogat
2015-06-22 17:21     ` Ben Widawsky
2015-06-22 19:49       ` Daniel Vetter
2015-06-23 23:37         ` Anuj Phogat
2015-06-24  7:33           ` Chris Wilson
2015-06-24  8:22             ` Daniel Vetter
2015-05-20 21:01 ` [PATCH 1/2] i965/gen9: Pass alignment as function parameter in drm_intel_gem_bo_alloc_internal() Anuj Phogat
2015-06-09 21:59   ` Anuj Phogat
2015-06-10  8:47     ` Damien Lespiau
2015-06-19 22:10       ` Anuj Phogat
2015-06-22 11:53         ` Daniel Vetter
2015-06-19 22:50 ` Anuj Phogat
2015-06-22 17:01   ` Ben Widawsky
2015-06-22 18:39     ` Anuj Phogat
2015-06-22 18:47 ` [PATCH v2 " Anuj Phogat
2015-06-22 19:51   ` Daniel Vetter
2015-06-22 20:04     ` Chris Wilson
2015-06-23 23:44       ` Anuj Phogat
2015-06-24  7:28         ` Chris Wilson
2015-06-24  8:24           ` Daniel Vetter
2015-06-25 18:01           ` Ben Widawsky
2015-06-25 18:11             ` Chris Wilson
2015-06-25 19:17               ` Ben Widawsky
2015-06-26 20:43                 ` Anuj Phogat
2015-07-02 19:00 ` [PATCH v3 " Anuj Phogat
2015-07-02 19:21   ` Chris Wilson
2015-07-02 21:44 ` [PATCH v4 " Anuj Phogat
2015-07-03 10:21   ` Chris Wilson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.