[igt-dev] [PATCH i-g-t v27 03/30] lib/intel_bufops: change stride requirements for Grantsdale

Zbigniew Kempczyński
2020-08-10T09:47:22Z

Grantsdale requires 512 stride on Y tiling.

Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
Cc: Dominik Grzegorzek <dominik.grzegorzek@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
---
lib/intel_bufops.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/lib/intel_bufops.c b/lib/intel_bufops.c
index 2a9b07a5..c641dba4 100644
--- a/lib/intel_bufops.c
+++ b/lib/intel_bufops.c
@@ -752,8 +752,7 @@ static void __intel_buf_init(struct buf_ops *bops,

if (bops->intel_gen < 3)
tile_width = 128;
- else if (IS_915GM(devid) || IS_915G(devid) ||
- buf->tiling == I915_TILING_X)
+ else if (IS_915G(devid) || buf->tiling == I915_TILING_X)
tile_width = 512;
else
tile_width = 128;
@@ -1037,11 +1036,13 @@ static bool probe_hw_tiling(struct buf_ops *bops, uint32_t tiling,
{
uint64_t size = 256 * 256;
uint32_t handle, buf_tiling, buf_swizzle, phys_swizzle;
- uint32_t stride;
+ uint32_t devid, stride;
int ret;
bool is_set = false;

- if (tiling == I915_TILING_X)
+ devid = intel_get_drm_devid(bops->fd);
+
+ if (tiling == I915_TILING_X || IS_915G(devid))
stride = 512;
else if (tiling == I915_TILING_Y)
stride = 128;