[PATCH i-g-t] tests/intel/kms_big_fb: Fix width calculation while creating the intel buf
Kamil Konieczny
kamil.konieczny at linux.intel.com
Wed May 8 15:13:00 UTC 2024
Hi Vinod,
On 2024-05-07 at 15:30:26 +0300, Vinod Govindapillai wrote:
> From: Bhanuprakash Modem <bhanuprakash.modem at intel.com>
>
Please add description here.
Regards,
Kamil
> Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem at intel.com>
> Signed-off-by: Vinod Govindapillai <vinod.govindapillai at intel.com>
> ---
> lib/igt_draw.c | 2 +-
> tests/intel/kms_big_fb.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/lib/igt_draw.c b/lib/igt_draw.c
> index 2c01d7b02..97a7e6b37 100644
> --- a/lib/igt_draw.c
> +++ b/lib/igt_draw.c
> @@ -650,7 +650,7 @@ static struct intel_buf *create_buf(int fd, struct buf_ops *bops,
> uint64_t region = driver == INTEL_DRIVER_XE ? vram_if_possible(fd, 0) : -1;
> uint64_t size = from->size;
>
> - width = from->width;
> + width = from->stride / (from->bpp / 8);
> height = from->height;
> if (driver == INTEL_DRIVER_XE)
> size = ALIGN(size, xe_get_default_alignment(fd));
> diff --git a/tests/intel/kms_big_fb.c b/tests/intel/kms_big_fb.c
> index f7f303d41..1e45d8e42 100644
> --- a/tests/intel/kms_big_fb.c
> +++ b/tests/intel/kms_big_fb.c
> @@ -199,7 +199,7 @@ static struct intel_buf *init_buf(data_t *data,
> tiling = igt_fb_mod_to_tiling(fb->modifier);
> bpp = fb->plane_bpp[0];
> size = fb->size;
> - width = fb->width;
> + width = fb->strides[0] / (bpp / 8);
> height = fb->height;
>
> name = gem_flink(data->drm_fd, fb->gem_handle);
> --
> 2.34.1
>
More information about the igt-dev
mailing list