intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH i-g-t] [RFC] tests/kms_prime: Aligned pitch to 64 byte for Intel platforms
@ 2021-05-28  4:34 Vidya Srinivas
  2021-05-31 14:17 ` [Intel-gfx] [igt-dev] " Ville Syrjälä
  0 siblings, 1 reply; 8+ messages in thread
From: Vidya Srinivas @ 2021-05-28  4:34 UTC (permalink / raw)
  To: intel-gfx, igt-dev; +Cc: markyacoub, charlton.lin

For Intel platforms, pitch needs to be 64 byte aligned.
Kernel code vgem_gem_dumb_create which is platform generic code
doesnt do the alignment. This causes frame buffer creation to fail
on Intel platforms where the pitch is not 64 byte aligned.

tests: test run on Intel platforms with panel resolution 1366x768

Signed-off-by: Vidya Srinivas <vidya.srinivas@intel.com>
---
 tests/kms_prime.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tests/kms_prime.c b/tests/kms_prime.c
index 8cb2ca2a9dc3..fdc941fe8100 100644
--- a/tests/kms_prime.c
+++ b/tests/kms_prime.c
@@ -51,6 +51,8 @@ static struct {
 	{ .r = 1.0, .g = 0.0, .b = 0.0, .color = 0xffff0000 },
 };
 
+bool check_platform;
+
 IGT_TEST_DESCRIPTION("Prime tests, focusing on KMS side");
 
 static bool has_prime_import(int fd)
@@ -101,7 +103,7 @@ static void prepare_scratch(int exporter_fd, struct dumb_bo *scratch,
 	scratch->bpp = 32;
 
 	scratch->handle = kmstest_dumb_create(exporter_fd,
-			scratch->width,
+			check_platform? ALIGN(scratch->width, 64): scratch->width,
 			scratch->height,
 			scratch->bpp,
 			&scratch->pitch,
@@ -262,6 +264,7 @@ igt_main
 
 		/* ANY = anything that is not VGEM */
 		first_fd = __drm_open_driver_another(0, DRIVER_ANY | DRIVER_VGEM);
+		check_platform = is_i915_device(first_fd);
 		igt_require(first_fd >= 0);
 
 		second_fd = __drm_open_driver_another(1, DRIVER_ANY | DRIVER_VGEM);
-- 
2.7.4

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

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

* Re: [Intel-gfx] [igt-dev] [PATCH i-g-t] [RFC] tests/kms_prime: Aligned pitch to 64 byte for Intel platforms
  2021-05-28  4:34 [Intel-gfx] [PATCH i-g-t] [RFC] tests/kms_prime: Aligned pitch to 64 byte for Intel platforms Vidya Srinivas
@ 2021-05-31 14:17 ` Ville Syrjälä
  2021-05-31 14:47   ` Srinivas, Vidya
  0 siblings, 1 reply; 8+ messages in thread
From: Ville Syrjälä @ 2021-05-31 14:17 UTC (permalink / raw)
  To: Vidya Srinivas; +Cc: igt-dev, intel-gfx, charlton.lin

On Fri, May 28, 2021 at 10:04:03AM +0530, Vidya Srinivas wrote:
> For Intel platforms, pitch needs to be 64 byte aligned.
> Kernel code vgem_gem_dumb_create which is platform generic code
> doesnt do the alignment. This causes frame buffer creation to fail
> on Intel platforms where the pitch is not 64 byte aligned.
> 
> tests: test run on Intel platforms with panel resolution 1366x768
> 
> Signed-off-by: Vidya Srinivas <vidya.srinivas@intel.com>
> ---
>  tests/kms_prime.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/kms_prime.c b/tests/kms_prime.c
> index 8cb2ca2a9dc3..fdc941fe8100 100644
> --- a/tests/kms_prime.c
> +++ b/tests/kms_prime.c
> @@ -51,6 +51,8 @@ static struct {
>  	{ .r = 1.0, .g = 0.0, .b = 0.0, .color = 0xffff0000 },
>  };
>  
> +bool check_platform;
> +
>  IGT_TEST_DESCRIPTION("Prime tests, focusing on KMS side");
>  
>  static bool has_prime_import(int fd)
> @@ -101,7 +103,7 @@ static void prepare_scratch(int exporter_fd, struct dumb_bo *scratch,
>  	scratch->bpp = 32;
>  
>  	scratch->handle = kmstest_dumb_create(exporter_fd,
> -			scratch->width,
> +			check_platform? ALIGN(scratch->width, 64): scratch->width,

The dumb_create ioctl already does this for us.

>  			scratch->height,
>  			scratch->bpp,
>  			&scratch->pitch,
> @@ -262,6 +264,7 @@ igt_main
>  
>  		/* ANY = anything that is not VGEM */
>  		first_fd = __drm_open_driver_another(0, DRIVER_ANY | DRIVER_VGEM);
> +		check_platform = is_i915_device(first_fd);
>  		igt_require(first_fd >= 0);
>  
>  		second_fd = __drm_open_driver_another(1, DRIVER_ANY | DRIVER_VGEM);
> -- 
> 2.7.4
> 
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev

-- 
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [Intel-gfx] [igt-dev] [PATCH i-g-t] [RFC] tests/kms_prime: Aligned pitch to 64 byte for Intel platforms
  2021-05-31 14:17 ` [Intel-gfx] [igt-dev] " Ville Syrjälä
@ 2021-05-31 14:47   ` Srinivas, Vidya
  2021-06-04 18:54     ` Mark Yacoub
                       ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Srinivas, Vidya @ 2021-05-31 14:47 UTC (permalink / raw)
  To: Ville Syrjälä; +Cc: igt-dev, intel-gfx, Lin,  Charlton

Hello Ville,

Thank you very much.
Before reaching our i915's i915_gem_dumb_create, it goes to vgem_gem_dumb_create for kms_prime.

The pitch gets calculated there and it is not 64 byte aligned. Due to this, intel_framebuffer_init reports "pitch must be 64 byte aligned"
and framebuffer creation fails. I tried submitting vgem patch where 64 byte alignment can be done in vgem_gem_dumb_create and that also
passes. But we did not get approval yet as few of them felt, vgem is generic and other platforms might fail if we do 64 byte alignment there.

Kindly suggest. Thanks a lot.

Regards
Vidya

-----Original Message-----
From: Ville Syrjälä <ville.syrjala@linux.intel.com> 
Sent: Monday, May 31, 2021 7:48 PM
To: Srinivas, Vidya <vidya.srinivas@intel.com>
Cc: intel-gfx@lists.freedesktop.org; igt-dev@lists.freedesktop.org; Lin, Charlton <charlton.lin@intel.com>
Subject: Re: [igt-dev] [PATCH i-g-t] [RFC] tests/kms_prime: Aligned pitch to 64 byte for Intel platforms

On Fri, May 28, 2021 at 10:04:03AM +0530, Vidya Srinivas wrote:
> For Intel platforms, pitch needs to be 64 byte aligned.
> Kernel code vgem_gem_dumb_create which is platform generic code doesnt 
> do the alignment. This causes frame buffer creation to fail on Intel 
> platforms where the pitch is not 64 byte aligned.
> 
> tests: test run on Intel platforms with panel resolution 1366x768
> 
> Signed-off-by: Vidya Srinivas <vidya.srinivas@intel.com>
> ---
>  tests/kms_prime.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/kms_prime.c b/tests/kms_prime.c index 
> 8cb2ca2a9dc3..fdc941fe8100 100644
> --- a/tests/kms_prime.c
> +++ b/tests/kms_prime.c
> @@ -51,6 +51,8 @@ static struct {
>  	{ .r = 1.0, .g = 0.0, .b = 0.0, .color = 0xffff0000 },  };
>  
> +bool check_platform;
> +
>  IGT_TEST_DESCRIPTION("Prime tests, focusing on KMS side");
>  
>  static bool has_prime_import(int fd)
> @@ -101,7 +103,7 @@ static void prepare_scratch(int exporter_fd, struct dumb_bo *scratch,
>  	scratch->bpp = 32;
>  
>  	scratch->handle = kmstest_dumb_create(exporter_fd,
> -			scratch->width,
> +			check_platform? ALIGN(scratch->width, 64): scratch->width,

The dumb_create ioctl already does this for us.

>  			scratch->height,
>  			scratch->bpp,
>  			&scratch->pitch,
> @@ -262,6 +264,7 @@ igt_main
>  
>  		/* ANY = anything that is not VGEM */
>  		first_fd = __drm_open_driver_another(0, DRIVER_ANY | DRIVER_VGEM);
> +		check_platform = is_i915_device(first_fd);
>  		igt_require(first_fd >= 0);
>  
>  		second_fd = __drm_open_driver_another(1, DRIVER_ANY | DRIVER_VGEM);
> --
> 2.7.4
> 
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev

--
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [Intel-gfx] [igt-dev] [PATCH i-g-t] [RFC] tests/kms_prime: Aligned pitch to 64 byte for Intel platforms
  2021-05-31 14:47   ` Srinivas, Vidya
@ 2021-06-04 18:54     ` Mark Yacoub
  2021-06-05  5:44       ` Srinivas, Vidya
  2021-06-11  7:35     ` Srinivas, Vidya
  2021-06-28 11:08     ` Surendrakumar Upadhyay, TejaskumarX
  2 siblings, 1 reply; 8+ messages in thread
From: Mark Yacoub @ 2021-06-04 18:54 UTC (permalink / raw)
  To: Srinivas, Vidya; +Cc: igt-dev, intel-gfx, Lin, Charlton

On Mon, May 31, 2021 at 10:47 AM Srinivas, Vidya
<vidya.srinivas@intel.com> wrote:
>
> Hello Ville,
>
> Thank you very much.
> Before reaching our i915's i915_gem_dumb_create, it goes to vgem_gem_dumb_create for kms_prime.
>
> The pitch gets calculated there and it is not 64 byte aligned. Due to this, intel_framebuffer_init reports "pitch must be 64 byte aligned"
> and framebuffer creation fails. I tried submitting vgem patch where 64 byte alignment can be done in vgem_gem_dumb_create and that also
> passes. But we did not get approval yet as few of them felt, vgem is generic and other platforms might fail if we do 64 byte alignment there.
>
> Kindly suggest. Thanks a lot.
>
> Regards
> Vidya
>
> -----Original Message-----
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Sent: Monday, May 31, 2021 7:48 PM
> To: Srinivas, Vidya <vidya.srinivas@intel.com>
> Cc: intel-gfx@lists.freedesktop.org; igt-dev@lists.freedesktop.org; Lin, Charlton <charlton.lin@intel.com>
> Subject: Re: [igt-dev] [PATCH i-g-t] [RFC] tests/kms_prime: Aligned pitch to 64 byte for Intel platforms
>
> On Fri, May 28, 2021 at 10:04:03AM +0530, Vidya Srinivas wrote:
> > For Intel platforms, pitch needs to be 64 byte aligned.
> > Kernel code vgem_gem_dumb_create which is platform generic code doesnt
> > do the alignment. This causes frame buffer creation to fail on Intel
> > platforms where the pitch is not 64 byte aligned.
> >
> > tests: test run on Intel platforms with panel resolution 1366x768
> >
Tested on ChromeOS on JSL (Drawlat).
Tested-by: Mark Yacoub <markyacoub@chromium.org>
> > Signed-off-by: Vidya Srinivas <vidya.srinivas@intel.com>
> > ---
> >  tests/kms_prime.c | 5 ++++-
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/tests/kms_prime.c b/tests/kms_prime.c index
> > 8cb2ca2a9dc3..fdc941fe8100 100644
> > --- a/tests/kms_prime.c
> > +++ b/tests/kms_prime.c
> > @@ -51,6 +51,8 @@ static struct {
> >       { .r = 1.0, .g = 0.0, .b = 0.0, .color = 0xffff0000 },  };
> >
> > +bool check_platform;
I think we can do a more precise name to indicate which platform.
Something like is_intel_device or is_i915 would be more appropriate.
alternatively, we can drop the boolean and just do the check when needed.
So it would look something like
+ is_i915_device(fd) ? ALIGN(scratch->width, 64) : scratch->width,

> > +
> >  IGT_TEST_DESCRIPTION("Prime tests, focusing on KMS side");
> >
> >  static bool has_prime_import(int fd)
> > @@ -101,7 +103,7 @@ static void prepare_scratch(int exporter_fd, struct dumb_bo *scratch,
> >       scratch->bpp = 32;
> >
> >       scratch->handle = kmstest_dumb_create(exporter_fd,
> > -                     scratch->width,
> > +                     check_platform? ALIGN(scratch->width, 64): scratch->width,
>
> The dumb_create ioctl already does this for us.
>
> >                       scratch->height,
> >                       scratch->bpp,
> >                       &scratch->pitch,
> > @@ -262,6 +264,7 @@ igt_main
> >
> >               /* ANY = anything that is not VGEM */
> >               first_fd = __drm_open_driver_another(0, DRIVER_ANY | DRIVER_VGEM);
> > +             check_platform = is_i915_device(first_fd);
> >               igt_require(first_fd >= 0);
> >
> >               second_fd = __drm_open_driver_another(1, DRIVER_ANY | DRIVER_VGEM);
> > --
> > 2.7.4
> >
> > _______________________________________________
> > igt-dev mailing list
> > igt-dev@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/igt-dev
>
> --
> Ville Syrjälä
> Intel
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [Intel-gfx] [igt-dev] [PATCH i-g-t] [RFC] tests/kms_prime: Aligned pitch to 64 byte for Intel platforms
  2021-06-04 18:54     ` Mark Yacoub
@ 2021-06-05  5:44       ` Srinivas, Vidya
  0 siblings, 0 replies; 8+ messages in thread
From: Srinivas, Vidya @ 2021-06-05  5:44 UTC (permalink / raw)
  To: Mark Yacoub; +Cc: igt-dev, intel-gfx, Lin,  Charlton

Thank you very much Mark, for testing the patch and providing the "Tested-by" tag.
I shall incorporate you review comments and submit the patch.

Additionally, we have submitted the kernel alternative https://patchwork.freedesktop.org/patch/436199/

Regards
Vidya

-----Original Message-----
From: Mark Yacoub <markyacoub@chromium.org> 
Sent: Saturday, June 5, 2021 12:24 AM
To: Srinivas, Vidya <vidya.srinivas@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>; igt-dev@lists.freedesktop.org; intel-gfx@lists.freedesktop.org; Lin, Charlton <charlton.lin@intel.com>
Subject: Re: [igt-dev] [PATCH i-g-t] [RFC] tests/kms_prime: Aligned pitch to 64 byte for Intel platforms

On Mon, May 31, 2021 at 10:47 AM Srinivas, Vidya <vidya.srinivas@intel.com> wrote:
>
> Hello Ville,
>
> Thank you very much.
> Before reaching our i915's i915_gem_dumb_create, it goes to vgem_gem_dumb_create for kms_prime.
>
> The pitch gets calculated there and it is not 64 byte aligned. Due to this, intel_framebuffer_init reports "pitch must be 64 byte aligned"
> and framebuffer creation fails. I tried submitting vgem patch where 64 
> byte alignment can be done in vgem_gem_dumb_create and that also passes. But we did not get approval yet as few of them felt, vgem is generic and other platforms might fail if we do 64 byte alignment there.
>
> Kindly suggest. Thanks a lot.
>
> Regards
> Vidya
>
> -----Original Message-----
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Sent: Monday, May 31, 2021 7:48 PM
> To: Srinivas, Vidya <vidya.srinivas@intel.com>
> Cc: intel-gfx@lists.freedesktop.org; igt-dev@lists.freedesktop.org; 
> Lin, Charlton <charlton.lin@intel.com>
> Subject: Re: [igt-dev] [PATCH i-g-t] [RFC] tests/kms_prime: Aligned 
> pitch to 64 byte for Intel platforms
>
> On Fri, May 28, 2021 at 10:04:03AM +0530, Vidya Srinivas wrote:
> > For Intel platforms, pitch needs to be 64 byte aligned.
> > Kernel code vgem_gem_dumb_create which is platform generic code 
> > doesnt do the alignment. This causes frame buffer creation to fail 
> > on Intel platforms where the pitch is not 64 byte aligned.
> >
> > tests: test run on Intel platforms with panel resolution 1366x768
> >
Tested on ChromeOS on JSL (Drawlat).
Tested-by: Mark Yacoub <markyacoub@chromium.org>
> > Signed-off-by: Vidya Srinivas <vidya.srinivas@intel.com>
> > ---
> >  tests/kms_prime.c | 5 ++++-
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/tests/kms_prime.c b/tests/kms_prime.c index
> > 8cb2ca2a9dc3..fdc941fe8100 100644
> > --- a/tests/kms_prime.c
> > +++ b/tests/kms_prime.c
> > @@ -51,6 +51,8 @@ static struct {
> >       { .r = 1.0, .g = 0.0, .b = 0.0, .color = 0xffff0000 },  };
> >
> > +bool check_platform;
I think we can do a more precise name to indicate which platform.
Something like is_intel_device or is_i915 would be more appropriate.
alternatively, we can drop the boolean and just do the check when needed.
So it would look something like
+ is_i915_device(fd) ? ALIGN(scratch->width, 64) : scratch->width,

> > +
> >  IGT_TEST_DESCRIPTION("Prime tests, focusing on KMS side");
> >
> >  static bool has_prime_import(int fd) @@ -101,7 +103,7 @@ static 
> > void prepare_scratch(int exporter_fd, struct dumb_bo *scratch,
> >       scratch->bpp = 32;
> >
> >       scratch->handle = kmstest_dumb_create(exporter_fd,
> > -                     scratch->width,
> > +                     check_platform? ALIGN(scratch->width, 64): 
> > + scratch->width,
>
> The dumb_create ioctl already does this for us.
>
> >                       scratch->height,
> >                       scratch->bpp,
> >                       &scratch->pitch, @@ -262,6 +264,7 @@ igt_main
> >
> >               /* ANY = anything that is not VGEM */
> >               first_fd = __drm_open_driver_another(0, DRIVER_ANY | 
> > DRIVER_VGEM);
> > +             check_platform = is_i915_device(first_fd);
> >               igt_require(first_fd >= 0);
> >
> >               second_fd = __drm_open_driver_another(1, DRIVER_ANY | 
> > DRIVER_VGEM);
> > --
> > 2.7.4
> >
> > _______________________________________________
> > igt-dev mailing list
> > igt-dev@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/igt-dev
>
> --
> Ville Syrjälä
> Intel
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [Intel-gfx] [igt-dev] [PATCH i-g-t] [RFC] tests/kms_prime: Aligned pitch to 64 byte for Intel platforms
  2021-05-31 14:47   ` Srinivas, Vidya
  2021-06-04 18:54     ` Mark Yacoub
@ 2021-06-11  7:35     ` Srinivas, Vidya
  2021-06-28 11:08     ` Surendrakumar Upadhyay, TejaskumarX
  2 siblings, 0 replies; 8+ messages in thread
From: Srinivas, Vidya @ 2021-06-11  7:35 UTC (permalink / raw)
  To: Ville Syrjälä; +Cc: igt-dev, intel-gfx, Lin,  Charlton

Hello Ville,

Apologies for bothering you.
Kms_prime goes through vgem_gem_dumb_create where the pitch gets calculated which is not 64 byte aligned.

kms_prime->vgem_gem_dumb_create->intel_framebuffer_init which reports plane 0 pitch (5464) must be at least 64 byte aligned.

We have submitted this patch for kernel https://patchwork.freedesktop.org/patch/436199/ also for the same.
If we try to align stride in IGT after it gets back from vgem_gem_dumb_ioctl, Kernel gives error - [drm:intel_fill_fb_info] fb too big for bo (need 4227072 bytes, have 4198400 bytes).

As a workaround (if the above kernel patch does not go through) we submitted this https://patchwork.freedesktop.org/patch/435794/.

Can you kindly help suggest which is the better way? If not both - kindly guide us how we can address this issue. Thank you so much.

Regards
Vidya

-----Original Message-----
From: Srinivas, Vidya 
Sent: Monday, May 31, 2021 8:18 PM
To: 'Ville Syrjälä' <ville.syrjala@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org; igt-dev@lists.freedesktop.org; Lin, Charlton <Charlton.Lin@intel.com>
Subject: RE: [igt-dev] [PATCH i-g-t] [RFC] tests/kms_prime: Aligned pitch to 64 byte for Intel platforms

Hello Ville,

Thank you very much.
Before reaching our i915's i915_gem_dumb_create, it goes to vgem_gem_dumb_create for kms_prime.

The pitch gets calculated there and it is not 64 byte aligned. Due to this, intel_framebuffer_init reports "pitch must be 64 byte aligned"
and framebuffer creation fails. I tried submitting vgem patch where 64 byte alignment can be done in vgem_gem_dumb_create and that also passes. But we did not get approval yet as few of them felt, vgem is generic and other platforms might fail if we do 64 byte alignment there.

Kindly suggest. Thanks a lot.

Regards
Vidya

-----Original Message-----
From: Ville Syrjälä <ville.syrjala@linux.intel.com>
Sent: Monday, May 31, 2021 7:48 PM
To: Srinivas, Vidya <vidya.srinivas@intel.com>
Cc: intel-gfx@lists.freedesktop.org; igt-dev@lists.freedesktop.org; Lin, Charlton <charlton.lin@intel.com>
Subject: Re: [igt-dev] [PATCH i-g-t] [RFC] tests/kms_prime: Aligned pitch to 64 byte for Intel platforms

On Fri, May 28, 2021 at 10:04:03AM +0530, Vidya Srinivas wrote:
> For Intel platforms, pitch needs to be 64 byte aligned.
> Kernel code vgem_gem_dumb_create which is platform generic code doesnt 
> do the alignment. This causes frame buffer creation to fail on Intel 
> platforms where the pitch is not 64 byte aligned.
> 
> tests: test run on Intel platforms with panel resolution 1366x768
> 
> Signed-off-by: Vidya Srinivas <vidya.srinivas@intel.com>
> ---
>  tests/kms_prime.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/kms_prime.c b/tests/kms_prime.c index
> 8cb2ca2a9dc3..fdc941fe8100 100644
> --- a/tests/kms_prime.c
> +++ b/tests/kms_prime.c
> @@ -51,6 +51,8 @@ static struct {
>  	{ .r = 1.0, .g = 0.0, .b = 0.0, .color = 0xffff0000 },  };
>  
> +bool check_platform;
> +
>  IGT_TEST_DESCRIPTION("Prime tests, focusing on KMS side");
>  
>  static bool has_prime_import(int fd)
> @@ -101,7 +103,7 @@ static void prepare_scratch(int exporter_fd, struct dumb_bo *scratch,
>  	scratch->bpp = 32;
>  
>  	scratch->handle = kmstest_dumb_create(exporter_fd,
> -			scratch->width,
> +			check_platform? ALIGN(scratch->width, 64): scratch->width,

The dumb_create ioctl already does this for us.

>  			scratch->height,
>  			scratch->bpp,
>  			&scratch->pitch,
> @@ -262,6 +264,7 @@ igt_main
>  
>  		/* ANY = anything that is not VGEM */
>  		first_fd = __drm_open_driver_another(0, DRIVER_ANY | DRIVER_VGEM);
> +		check_platform = is_i915_device(first_fd);
>  		igt_require(first_fd >= 0);
>  
>  		second_fd = __drm_open_driver_another(1, DRIVER_ANY | DRIVER_VGEM);
> --
> 2.7.4
> 
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev

--
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [Intel-gfx] [igt-dev] [PATCH i-g-t] [RFC] tests/kms_prime: Aligned pitch to 64 byte for Intel platforms
  2021-05-31 14:47   ` Srinivas, Vidya
  2021-06-04 18:54     ` Mark Yacoub
  2021-06-11  7:35     ` Srinivas, Vidya
@ 2021-06-28 11:08     ` Surendrakumar Upadhyay, TejaskumarX
  2021-07-13 17:14       ` Srinivas, Vidya
  2 siblings, 1 reply; 8+ messages in thread
From: Surendrakumar Upadhyay, TejaskumarX @ 2021-06-28 11:08 UTC (permalink / raw)
  To: Srinivas, Vidya, Ville Syrjälä
  Cc: igt-dev, intel-gfx, Lin,  Charlton



> -----Original Message-----
> From: Intel-gfx <intel-gfx-bounces@lists.freedesktop.org> On Behalf Of
> Srinivas, Vidya
> Sent: 31 May 2021 20:18
> To: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Cc: igt-dev@lists.freedesktop.org; intel-gfx@lists.freedesktop.org; Lin,
> Charlton <charlton.lin@intel.com>
> Subject: Re: [Intel-gfx] [igt-dev] [PATCH i-g-t] [RFC] tests/kms_prime: Aligned
> pitch to 64 byte for Intel platforms
> 
> Hello Ville,
> 
> Thank you very much.
> Before reaching our i915's i915_gem_dumb_create, it goes to
> vgem_gem_dumb_create for kms_prime.
> 
> The pitch gets calculated there and it is not 64 byte aligned. Due to this,
> intel_framebuffer_init reports "pitch must be 64 byte aligned"
> and framebuffer creation fails. I tried submitting vgem patch where 64 byte
> alignment can be done in vgem_gem_dumb_create and that also passes. But
> we did not get approval yet as few of them felt, vgem is generic and other
> platforms might fail if we do 64 byte alignment there.
> 
> Kindly suggest. Thanks a lot.
> 
> Regards
> Vidya
> 
> -----Original Message-----
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Sent: Monday, May 31, 2021 7:48 PM
> To: Srinivas, Vidya <vidya.srinivas@intel.com>
> Cc: intel-gfx@lists.freedesktop.org; igt-dev@lists.freedesktop.org; Lin,
> Charlton <charlton.lin@intel.com>
> Subject: Re: [igt-dev] [PATCH i-g-t] [RFC] tests/kms_prime: Aligned pitch to 64
> byte for Intel platforms
> 
> On Fri, May 28, 2021 at 10:04:03AM +0530, Vidya Srinivas wrote:
> > For Intel platforms, pitch needs to be 64 byte aligned.
> > Kernel code vgem_gem_dumb_create which is platform generic code
> doesnt
> > do the alignment. This causes frame buffer creation to fail on Intel
> > platforms where the pitch is not 64 byte aligned.
> >
> > tests: test run on Intel platforms with panel resolution 1366x768
> >
> > Signed-off-by: Vidya Srinivas <vidya.srinivas@intel.com>
> > ---
> >  tests/kms_prime.c | 5 ++++-
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/tests/kms_prime.c b/tests/kms_prime.c index
> > 8cb2ca2a9dc3..fdc941fe8100 100644
> > --- a/tests/kms_prime.c
> > +++ b/tests/kms_prime.c
> > @@ -51,6 +51,8 @@ static struct {
> >  	{ .r = 1.0, .g = 0.0, .b = 0.0, .color = 0xffff0000 },  };
> >
> > +bool check_platform;
> > +
> >  IGT_TEST_DESCRIPTION("Prime tests, focusing on KMS side");
> >
> >  static bool has_prime_import(int fd)
> > @@ -101,7 +103,7 @@ static void prepare_scratch(int exporter_fd, struct
> dumb_bo *scratch,
> >  	scratch->bpp = 32;
> >
> >  	scratch->handle = kmstest_dumb_create(exporter_fd,
> > -			scratch->width,
> > +			check_platform? ALIGN(scratch->width, 64): scratch-
> >width,
> 
> The dumb_create ioctl already does this for us.

I915_dumb_create does it for us but "vgem_gem_dumb_create" does not do 64 ALIGN. And kms_prime is using "vgem_gem_dumb_create" never call i915 dumb_create() as the IGT creates buffer through VGEM driver, see below IGT snippet :

/* ANY = anything that is not VGEM */
                first_fd = __drm_open_driver_another(0, DRIVER_ANY | DRIVER_VGEM);
                igt_require(first_fd >= 0);

                second_fd = __drm_open_driver_another(1, DRIVER_ANY | DRIVER_VGEM);

Thanks,
Tejas
> 
> >  			scratch->height,
> >  			scratch->bpp,
> >  			&scratch->pitch,
> > @@ -262,6 +264,7 @@ igt_main
> >
> >  		/* ANY = anything that is not VGEM */
> >  		first_fd = __drm_open_driver_another(0, DRIVER_ANY |
> DRIVER_VGEM);
> > +		check_platform = is_i915_device(first_fd);
> >  		igt_require(first_fd >= 0);
> >
> >  		second_fd = __drm_open_driver_another(1, DRIVER_ANY |
> DRIVER_VGEM);
> > --
> > 2.7.4
> >
> > _______________________________________________
> > igt-dev mailing list
> > igt-dev@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/igt-dev
> 
> --
> Ville Syrjälä
> Intel
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [Intel-gfx] [igt-dev] [PATCH i-g-t] [RFC] tests/kms_prime: Aligned pitch to 64 byte for Intel platforms
  2021-06-28 11:08     ` Surendrakumar Upadhyay, TejaskumarX
@ 2021-07-13 17:14       ` Srinivas, Vidya
  0 siblings, 0 replies; 8+ messages in thread
From: Srinivas, Vidya @ 2021-07-13 17:14 UTC (permalink / raw)
  To: Surendrakumar Upadhyay, TejaskumarX, Ville Syrjälä
  Cc: igt-dev, intel-gfx, Lin,  Charlton

Hello All,

Very sorry to bother you all again. Kindly can you help so that we can close on this please?
We have submitted both IGT and kernel patches. If none are okay, should we skip the subtest for panels which have width not 64 byte aligned for Intel platforms?

https://patchwork.freedesktop.org/patch/435794/  - IGT patch (we are aligning width itself as workaround due to missing alignment in VGEM before reaching i915)
https://patchwork.freedesktop.org/patch/436199/  - Kernel patch

Tejas has submitted another solution https://patchwork.freedesktop.org/patch/441967/ (256B alignment) - this too works.

Regards
Vidya

-----Original Message-----
From: Surendrakumar Upadhyay, TejaskumarX <tejaskumarx.surendrakumar.upadhyay@intel.com> 
Sent: Monday, June 28, 2021 4:39 PM
To: Srinivas, Vidya <vidya.srinivas@intel.com>; Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: igt-dev@lists.freedesktop.org; intel-gfx@lists.freedesktop.org; Lin, Charlton <charlton.lin@intel.com>
Subject: RE: [igt-dev] [PATCH i-g-t] [RFC] tests/kms_prime: Aligned pitch to 64 byte for Intel platforms



> -----Original Message-----
> From: Intel-gfx <intel-gfx-bounces@lists.freedesktop.org> On Behalf Of 
> Srinivas, Vidya
> Sent: 31 May 2021 20:18
> To: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Cc: igt-dev@lists.freedesktop.org; intel-gfx@lists.freedesktop.org; 
> Lin, Charlton <charlton.lin@intel.com>
> Subject: Re: [Intel-gfx] [igt-dev] [PATCH i-g-t] [RFC] 
> tests/kms_prime: Aligned pitch to 64 byte for Intel platforms
> 
> Hello Ville,
> 
> Thank you very much.
> Before reaching our i915's i915_gem_dumb_create, it goes to 
> vgem_gem_dumb_create for kms_prime.
> 
> The pitch gets calculated there and it is not 64 byte aligned. Due to 
> this, intel_framebuffer_init reports "pitch must be 64 byte aligned"
> and framebuffer creation fails. I tried submitting vgem patch where 64 
> byte alignment can be done in vgem_gem_dumb_create and that also 
> passes. But we did not get approval yet as few of them felt, vgem is 
> generic and other platforms might fail if we do 64 byte alignment there.
> 
> Kindly suggest. Thanks a lot.
> 
> Regards
> Vidya
> 
> -----Original Message-----
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Sent: Monday, May 31, 2021 7:48 PM
> To: Srinivas, Vidya <vidya.srinivas@intel.com>
> Cc: intel-gfx@lists.freedesktop.org; igt-dev@lists.freedesktop.org; 
> Lin, Charlton <charlton.lin@intel.com>
> Subject: Re: [igt-dev] [PATCH i-g-t] [RFC] tests/kms_prime: Aligned 
> pitch to 64 byte for Intel platforms
> 
> On Fri, May 28, 2021 at 10:04:03AM +0530, Vidya Srinivas wrote:
> > For Intel platforms, pitch needs to be 64 byte aligned.
> > Kernel code vgem_gem_dumb_create which is platform generic code
> doesnt
> > do the alignment. This causes frame buffer creation to fail on Intel 
> > platforms where the pitch is not 64 byte aligned.
> >
> > tests: test run on Intel platforms with panel resolution 1366x768
> >
> > Signed-off-by: Vidya Srinivas <vidya.srinivas@intel.com>
> > ---
> >  tests/kms_prime.c | 5 ++++-
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/tests/kms_prime.c b/tests/kms_prime.c index
> > 8cb2ca2a9dc3..fdc941fe8100 100644
> > --- a/tests/kms_prime.c
> > +++ b/tests/kms_prime.c
> > @@ -51,6 +51,8 @@ static struct {
> >  	{ .r = 1.0, .g = 0.0, .b = 0.0, .color = 0xffff0000 },  };
> >
> > +bool check_platform;
> > +
> >  IGT_TEST_DESCRIPTION("Prime tests, focusing on KMS side");
> >
> >  static bool has_prime_import(int fd) @@ -101,7 +103,7 @@ static 
> > void prepare_scratch(int exporter_fd, struct
> dumb_bo *scratch,
> >  	scratch->bpp = 32;
> >
> >  	scratch->handle = kmstest_dumb_create(exporter_fd,
> > -			scratch->width,
> > +			check_platform? ALIGN(scratch->width, 64): scratch-
> >width,
> 
> The dumb_create ioctl already does this for us.

I915_dumb_create does it for us but "vgem_gem_dumb_create" does not do 64 ALIGN. And kms_prime is using "vgem_gem_dumb_create" never call i915 dumb_create() as the IGT creates buffer through VGEM driver, see below IGT snippet :

/* ANY = anything that is not VGEM */
                first_fd = __drm_open_driver_another(0, DRIVER_ANY | DRIVER_VGEM);
                igt_require(first_fd >= 0);

                second_fd = __drm_open_driver_another(1, DRIVER_ANY | DRIVER_VGEM);

Thanks,
Tejas
> 
> >  			scratch->height,
> >  			scratch->bpp,
> >  			&scratch->pitch,
> > @@ -262,6 +264,7 @@ igt_main
> >
> >  		/* ANY = anything that is not VGEM */
> >  		first_fd = __drm_open_driver_another(0, DRIVER_ANY |
> DRIVER_VGEM);
> > +		check_platform = is_i915_device(first_fd);
> >  		igt_require(first_fd >= 0);
> >
> >  		second_fd = __drm_open_driver_another(1, DRIVER_ANY |
> DRIVER_VGEM);
> > --
> > 2.7.4
> >
> > _______________________________________________
> > igt-dev mailing list
> > igt-dev@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/igt-dev
> 
> --
> Ville Syrjälä
> Intel
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2021-07-13 17:14 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-28  4:34 [Intel-gfx] [PATCH i-g-t] [RFC] tests/kms_prime: Aligned pitch to 64 byte for Intel platforms Vidya Srinivas
2021-05-31 14:17 ` [Intel-gfx] [igt-dev] " Ville Syrjälä
2021-05-31 14:47   ` Srinivas, Vidya
2021-06-04 18:54     ` Mark Yacoub
2021-06-05  5:44       ` Srinivas, Vidya
2021-06-11  7:35     ` Srinivas, Vidya
2021-06-28 11:08     ` Surendrakumar Upadhyay, TejaskumarX
2021-07-13 17:14       ` Srinivas, Vidya

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).