[igt-dev] [PATCH i-g-t v4 1/3] lib/intel_bufops: Introduce buffer operations

Chris Wilson chris at chris-wilson.co.uk
Wed Dec 18 17:32:29 UTC 2019


Quoting Zbigniew Kempczyński (2019-12-18 17:12:48)
> +static bool probe_hw_tiling(struct buf_ops *bops, uint32_t tiling)
> +{
> +       uint64_t size = 256 * 256;
> +       uint32_t handle, buf_tiling, buf_swizzle;
> +       uint32_t stride;
> +       int ret;
> +       bool is_set = false;
> +
> +       if (tiling == I915_TILING_X)
> +               stride = 512;

> +       else if (tiling == I915_TILING_Y)
> +               stride = 128;
> +       else
> +               return false;

X/Y tile_stride is 128 and tile_size 2048 on gen2.
Y tiling has stride 512 (tile_size 4096) on i915g[m], but stride 128
on all platforms since.

        if (kgem->gen <= 030) {
                if (tiling) {
                        if (kgem->gen < 030) {
                                *tile_width = 128;
                                *tile_height = 16;
                                *tile_size = 2048;
                        } else {
                                *tile_width = 512;
                                *tile_height = 8;
                                *tile_size = 4096;
                        }
                } else {
                        *tile_width = 1;
                        *tile_height = 1;
                        *tile_size = 1;
                }
        } else switch (tiling) {
        default:
        case I915_TILING_NONE:
                *tile_width = 1;
                *tile_height = 1;
                *tile_size = 1;
                break;
        case I915_TILING_X:
                *tile_width = 512;
                *tile_height = 8;
                *tile_size = 4096;
                break;
        case I915_TILING_Y:
                *tile_width = 128;
                *tile_height = 32;
                *tile_size = 4096;
                break;
        }


More information about the igt-dev mailing list