<div dir="ltr">Thanks for revising these. The changes look good to me.<div><br></div><div>FWIW,</div><div><br></div><div>Reviewed-by: Sean Paul <<a href="mailto:seanpaul@chromium.org">seanpaul@chromium.org</a>></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jan 30, 2024 at 12:49 AM Bhanuprakash Modem <<a href="mailto:bhanuprakash.modem@intel.com">bhanuprakash.modem@intel.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">From: Sean Paul <<a href="mailto:seanpaul@chromium.org" target="_blank">seanpaul@chromium.org</a>><br>
<br>
Consolidate the 2 fb variables into an array. No functional changes.<br>
<br>
v2:<br>
- Clarified commit msg (Bhanu)<br>
v3: (Bhanu)<br>
- Rebase<br>
<br>
Cc: Mark Yacoub <<a href="mailto:markyacoub@chromium.org" target="_blank">markyacoub@chromium.org</a>><br>
Reviewed-by: Bhanuprakash Modem <<a href="mailto:bhanuprakash.modem@intel.com" target="_blank">bhanuprakash.modem@intel.com</a>><br>
Signed-off-by: Sean Paul <<a href="mailto:seanpaul@chromium.org" target="_blank">seanpaul@chromium.org</a>><br>
Signed-off-by: Bhanuprakash Modem <<a href="mailto:bhanuprakash.modem@intel.com" target="_blank">bhanuprakash.modem@intel.com</a>><br>
---<br>
 tests/kms_vrr.c | 19 +++++++++----------<br>
 1 file changed, 9 insertions(+), 10 deletions(-)<br>
<br>
diff --git a/tests/kms_vrr.c b/tests/kms_vrr.c<br>
index 9de0ffc85..a9fcde821 100644<br>
--- a/tests/kms_vrr.c<br>
+++ b/tests/kms_vrr.c<br>
@@ -104,8 +104,7 @@ typedef struct data {<br>
        igt_display_t display;<br>
        int drm_fd;<br>
        igt_plane_t *primary;<br>
-       igt_fb_t fb0;<br>
-       igt_fb_t fb1;<br>
+       igt_fb_t fb[2];<br>
        range_t range;<br>
        drmModeModeInfo switch_modes[RR_MODES_COUNT];<br>
 } data_t;<br>
@@ -280,13 +279,13 @@ static void prepare_test(data_t *data, igt_output_t *output, enum pipe pipe)<br>
        /* Prepare resources */<br>
        igt_create_color_fb(data->drm_fd, mode.hdisplay, mode.vdisplay,<br>
                            DRM_FORMAT_XRGB8888, DRM_FORMAT_MOD_LINEAR,<br>
-                           0.50, 0.50, 0.50, &data->fb0);<br>
+                           0.50, 0.50, 0.50, &data->fb[0]);<br>
<br>
        igt_create_color_fb(data->drm_fd, mode.hdisplay, mode.vdisplay,<br>
                            DRM_FORMAT_XRGB8888, DRM_FORMAT_MOD_LINEAR,<br>
-                           0.50, 0.50, 0.50, &data->fb1);<br>
+                           0.50, 0.50, 0.50, &data->fb[1]);<br>
<br>
-       cr = igt_get_cairo_ctx(data->drm_fd, &data->fb0);<br>
+       cr = igt_get_cairo_ctx(data->drm_fd, &data->fb[0]);<br>
<br>
        igt_paint_color(cr, 0, 0, mode.hdisplay / 10, mode.vdisplay / 10,<br>
                        1.00, 0.00, 0.00);<br>
@@ -295,7 +294,7 @@ static void prepare_test(data_t *data, igt_output_t *output, enum pipe pipe)<br>
<br>
        /* Take care of any required modesetting before the test begins. */<br>
        data->primary = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);<br>
-       igt_plane_set_fb(data->primary, &data->fb0);<br>
+       igt_plane_set_fb(data->primary, &data->fb[0]);<br>
<br>
        /* Clear vrr_enabled state before enabling it, because<br>
         * it might be left enabled if the previous test fails.<br>
@@ -358,7 +357,7 @@ flip_and_measure(data_t *data, igt_output_t *output, enum pipe pipe,<br>
                        rate_ns, threshold_hi, threshold_lo);<br>
<br>
        /* Align with the flip completion event to speed up convergence. */<br>
-       do_flip(data, &data->fb0);<br>
+       do_flip(data, &data->fb[0]);<br>
        start_ns = last_event_ns = target_ns = get_kernel_event_ns(data,<br>
                                                        DRM_EVENT_FLIP_COMPLETE);<br>
<br>
@@ -367,7 +366,7 @@ flip_and_measure(data_t *data, igt_output_t *output, enum pipe pipe,<br>
                int64_t diff_ns;<br>
<br>
                front = !front;<br>
-               do_flip(data, front ? &data->fb1 : &data->fb0);<br>
+               do_flip(data, front ? &data->fb[1] : &data->fb[0]);<br>
<br>
                /* We need to cpture flip event instead of vblank event,<br>
                 * because vblank is triggered after each frame, but depending<br>
@@ -573,8 +572,8 @@ static void test_cleanup(data_t *data, enum pipe pipe, igt_output_t *output)<br>
        igt_output_override_mode(output, NULL);<br>
        igt_display_commit2(&data->display, COMMIT_ATOMIC);<br>
<br>
-       igt_remove_fb(data->drm_fd, &data->fb1);<br>
-       igt_remove_fb(data->drm_fd, &data->fb0);<br>
+       igt_remove_fb(data->drm_fd, &data->fb[1]);<br>
+       igt_remove_fb(data->drm_fd, &data->fb[0]);<br>
 }<br>
<br>
 static bool output_constraint(data_t *data, igt_output_t *output, uint32_t flags)<br>
-- <br>
2.43.0<br>
<br>
</blockquote></div>