Thread (46 messages) 46 messages, 8 authors, 2021-06-16

Re: [igt-dev] [PATCH i-g-t v2 11/17] tests/kms_big_fb: Optimize setup_fb function

From: Karthik B S <hidden>
Date: 2021-06-11 11:32:06

On 6/11/2021 3:29 PM, venkata.sai.patnana@intel.com wrote:
From: Kunal Joshi <redacted>

libcario takes a lot of time converting 32bpp fb to 64bpp fb,
When fb memory is given by kernel its zeroed, here two different color fbs,
black and green are created hence if kernel give zeroed fbs there's
possibility to skip zeroing it again thus saving some time

Cc: Karthik B S <redacted>
Cc: Bhanuprakash Modem <redacted>
Signed-off-by: Juha-Pekka Heikkilä <redacted>
Signed-off-by: Kunal Joshi <redacted>
Reviewed-by: Karthik B S <redacted>
quoted hunk ↗ jump to hunk
---
  tests/kms_big_fb.c | 15 +++++++++------
  1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/tests/kms_big_fb.c b/tests/kms_big_fb.c
index 89ea0f23e2..3e19450a42 100644
--- a/tests/kms_big_fb.c
+++ b/tests/kms_big_fb.c
@@ -115,12 +115,15 @@ static void setup_fb(data_t *data, struct igt_fb *newfb, uint32_t width,
  		f.offsets[n] = newfb->offsets[n];
  	}
  
-	cr = igt_get_cairo_ctx(data->drm_fd, newfb);
-	igt_paint_color(cr, 0, 0, newfb->width, newfb->height,
-			data->planeclearrgb[0],
-			data->planeclearrgb[1],
-			data->planeclearrgb[2]);
-	igt_put_cairo_ctx(cr);
+       if (data->planeclearrgb[0] != 0.0 || data->planeclearrgb[1] != 0.0 ||
+           data->planeclearrgb[2] != 0.0) {
+               cr = igt_get_cairo_ctx(data->drm_fd, newfb);
+               igt_paint_color(cr, 0, 0, newfb->width, newfb->height,
+                               data->planeclearrgb[0],
+                               data->planeclearrgb[1],
+                               data->planeclearrgb[2]);
+               igt_put_cairo_ctx(cr);
+       }
  
  	igt_assert(drmIoctl(data->drm_fd, LOCAL_DRM_IOCTL_MODE_ADDFB2, &f) == 0);
  	newfb->fb_id = f.fb_id;

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help