[i-g-t,v2,02/13] igt: fb: Reduce tile size alignment for non intel platforms

Submitted by Maxime Ripard on Jan. 8, 2019, 3:19 p.m.

Details

Message ID 20190108152001.5367-2-maxime.ripard@bootlin.com
State Accepted
Commit 6112f956cf4c6736967eb40eaa7224b33b69a03d
Headers show
Series "igt: chamelium: Test YUV buffers using the Chamelium" ( rev: 4 3 ) in IGT

Not browsing as part of any series.

Commit Message

Maxime Ripard Jan. 8, 2019, 3:19 p.m.
Aligning the width on 64 pixels only make sense on intel platforms, make
sure to add a check against this.

Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
---
 lib/igt_fb.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index 00db2ee57cad..6ab4e3039166 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -204,7 +204,11 @@  void igt_get_fb_tile_size(int fd, uint64_t tiling, int fb_bpp,
 {
 	switch (tiling) {
 	case LOCAL_DRM_FORMAT_MOD_NONE:
-		*width_ret = 64;
+		if (is_i915_device(fd))
+			*width_ret = 64;
+		else
+			*width_ret = 1;
+
 		*height_ret = 1;
 		break;
 	case LOCAL_I915_FORMAT_MOD_X_TILED:

Comments

On Tue, 2019-01-08 at 16:19 +0100, Maxime Ripard wrote:
> Aligning the width on 64 pixels only make sense on intel platforms, make
> sure to add a check against this.
> 
> Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>

Reviewed-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>

> ---
>  lib/igt_fb.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/igt_fb.c b/lib/igt_fb.c
> index 00db2ee57cad..6ab4e3039166 100644
> --- a/lib/igt_fb.c
> +++ b/lib/igt_fb.c
> @@ -204,7 +204,11 @@ void igt_get_fb_tile_size(int fd, uint64_t tiling, int fb_bpp,
>  {
>  	switch (tiling) {
>  	case LOCAL_DRM_FORMAT_MOD_NONE:
> -		*width_ret = 64;
> +		if (is_i915_device(fd))
> +			*width_ret = 64;
> +		else
> +			*width_ret = 1;
> +
>  		*height_ret = 1;
>  		break;
>  	case LOCAL_I915_FORMAT_MOD_X_TILED: