[igt-dev] [PATCH i-g-t 1/6] lib/intel_bufops: Add bufops reference and relaxate stride requirement
Chris Wilson
chris at chris-wilson.co.uk
Tue May 12 09:29:07 UTC 2020
Quoting Zbigniew Kempczyński (2020-05-12 09:23:57)
> Add bufops reference to intel_buf to allow acquire drm fd against which
> buffer was created.
>
> Relax stride limitation for intel_buf for non-tiled buffers.
>
> Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
> Cc: Chris Wilson <chris at chris-wilson.co.uk>
> ---
> lib/intel_bufops.c | 20 +++++++++++++++++++-
> lib/intel_bufops.h | 3 +++
> 2 files changed, 22 insertions(+), 1 deletion(-)
>
> diff --git a/lib/intel_bufops.c b/lib/intel_bufops.c
> index 804b2a0a..cdf6b114 100644
> --- a/lib/intel_bufops.c
> +++ b/lib/intel_bufops.c
> @@ -686,6 +686,8 @@ static void __intel_buf_init(struct buf_ops *bops,
>
> memset(buf, 0, sizeof(*buf));
>
> + buf->bops = bops;
> +
> if (compression) {
> int aux_width, aux_height;
>
> @@ -721,7 +723,10 @@ static void __intel_buf_init(struct buf_ops *bops,
> size = buf->aux.offset + aux_width * aux_height;
>
> } else {
> - buf->stride = ALIGN(width * (bpp / 8), 128);
> + if (buf->tiling)
> + buf->stride = ALIGN(width * (bpp / 8), 128);
> + else
> + buf->stride = width * (bpp / 8);
There might be a chicken-and-egg problem here for intermixing bufops
with igt_fb. For a linear scanout buffer, we need stride aligned to 64B.
If there is [or will be] a buf_init_for_data() that will take in the
handle, size and stride, and should allow for interop.
-Chris
More information about the igt-dev
mailing list