From: Jani Nikula <jani.nikula@intel.com>
To: Ville Syrjala <ville.syrjala@linux.intel.com>,
igt-dev@lists.freedesktop.org
Subject: Re: [PATCH i-g-t 1/8] tests/kms_plane_cursor: s/or/rect/
Date: Tue, 13 Jan 2026 16:31:12 +0200 [thread overview]
Message-ID: <85efa5f57b75c87750b4e71b447f57bb98bdf7cb@intel.com> (raw)
In-Reply-To: <20260113120439.12577-2-ville.syrjala@linux.intel.com>
On Tue, 13 Jan 2026, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Rename data.or to data.rect. Coccinelle seems to think
> 'or' is some kind of reserved keyword and fails to parse
> the code when it sees a variable with that name.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
> ---
> tests/kms_plane_cursor.c | 48 ++++++++++++++++++++--------------------
> 1 file changed, 24 insertions(+), 24 deletions(-)
>
> diff --git a/tests/kms_plane_cursor.c b/tests/kms_plane_cursor.c
> index 8b172794bc88..fcb7cea06c9e 100644
> --- a/tests/kms_plane_cursor.c
> +++ b/tests/kms_plane_cursor.c
> @@ -84,7 +84,7 @@ typedef struct data {
> igt_fb_t cfb;
> enum pipe pipe_id;
> int drm_fd;
> - rect_t or;
> + rect_t rect;
> uint64_t max_curw;
> uint64_t max_curh;
> } data_t;
> @@ -112,10 +112,10 @@ static void test_init(data_t *data, enum pipe pipe_id, igt_output_t *output,
> IGT_PIPE_CRC_SOURCE_AUTO);
>
> /* Overlay rectangle for a rect in the center of the screen */
> - data->or.x = data->mode->hdisplay / 4;
> - data->or.y = data->mode->vdisplay / 4;
> - data->or.w = data->mode->hdisplay / 2;
> - data->or.h = data->mode->vdisplay / 2;
> + data->rect.x = data->mode->hdisplay / 4;
> + data->rect.y = data->mode->vdisplay / 4;
> + data->rect.w = data->mode->hdisplay / 2;
> + data->rect.h = data->mode->vdisplay / 2;
> }
>
> /* Common test cleanup. */
> @@ -149,13 +149,13 @@ static void test_cursor_pos(data_t *data, int x, int y, unsigned int flags)
> igt_fb_t *cfb = &data->cfb;
> int cw = cfb->width;
> int ch = cfb->height;
> - const rect_t *or = &data->or;
> + const rect_t *rect = &data->rect;
>
> cr = igt_get_cairo_ctx(ref_fb->fd, ref_fb);
> igt_paint_color(cr, 0, 0, ref_fb->width, ref_fb->height, 1.0, 1.0, 1.0);
>
> if (flags & TEST_OVERLAY)
> - igt_paint_color(cr, or->x, or->y, or->w, or->h, 0.5, 0.5, 0.5);
> + igt_paint_color(cr, rect->x, rect->y, rect->w, rect->h, 0.5, 0.5, 0.5);
>
> igt_paint_color(cr, x, y, cw, ch, 1.0, 0.0, 1.0);
> igt_put_cairo_ctx(cr);
> @@ -173,12 +173,12 @@ static void test_cursor_pos(data_t *data, int x, int y, unsigned int flags)
>
> if (flags & TEST_OVERLAY) {
> igt_plane_set_fb(data->overlay, ofb);
> - igt_plane_set_position(data->overlay, or->x, or->y);
> - igt_plane_set_size(data->overlay, or->w, or->h);
> - igt_fb_set_size(ofb, data->overlay, or->w, or->h);
> + igt_plane_set_position(data->overlay, rect->x, rect->y);
> + igt_plane_set_size(data->overlay, rect->w, rect->h);
> + igt_fb_set_size(ofb, data->overlay, rect->w, rect->h);
> igt_fb_set_position(ofb, data->overlay,
> - (ofb->width - or->w) / 2,
> - (ofb->height - or->h) / 2);
> + (ofb->width - rect->w) / 2,
> + (ofb->height - rect->h) / 2);
> }
>
> igt_plane_set_fb(data->cursor, cfb);
> @@ -206,27 +206,27 @@ static void test_cursor_spots(data_t *data, int size, unsigned int flags)
> {
> int sw = data->mode->hdisplay;
> int sh = data->mode->vdisplay;
> - const rect_t *or = &data->or;
> + const rect_t *rect = &data->rect;
> int i;
> const pos_t pos[] = {
> /* Test diagonally from top left to bottom right. */
> { -size / 3, -size / 3 },
> { 0, 0 },
> - { or->x - size, or->y - size },
> - { or->x - size / 3, or->y - size / 3 },
> - { or->x, or->y },
> - { or->x + size, or->y + size },
> + { rect->x - size, rect->y - size },
> + { rect->x - size / 3, rect->y - size / 3 },
> + { rect->x, rect->y },
> + { rect->x + size, rect->y + size },
> { sw / 2, sh / 2 },
> - { or->x + or->w - size, or->y + or->h - size },
> - { or->x + or->w - size / 3, or->y + or->h - size / 3 },
> - { or->x + or->w + size, or->y + or->h + size },
> + { rect->x + rect->w - size, rect->y + rect->h - size },
> + { rect->x + rect->w - size / 3, rect->y + rect->h - size / 3 },
> + { rect->x + rect->w + size, rect->y + rect->h + size },
> { sw - size, sh - size },
> { sw - size / 3, sh - size / 3 },
> /* Test remaining corners. */
> { sw - size, 0 },
> { 0, sh - size },
> - { or->x + or->w - size, or->y },
> - { or->x, or->y + or->h - size }
> + { rect->x + rect->w - size, rect->y },
> + { rect->x, rect->y + rect->h - size }
> };
>
> for (i = 0; i < ARRAY_SIZE(pos); ++i) {
> @@ -265,8 +265,8 @@ static void test_cursor(data_t *data, int size, unsigned int flags)
> DRM_FORMAT_MOD_LINEAR, 1.0, 1.0, 1.0, &data->pfb);
>
> if (flags & TEST_OVERLAY) {
> - int width = (flags & TEST_VIEWPORT) ? data->or.w + pad : data->or.w;
> - int height = (flags & TEST_VIEWPORT) ? data->or.h + pad : data->or.h;
> + int width = (flags & TEST_VIEWPORT) ? data->rect.w + pad : data->rect.w;
> + int height = (flags & TEST_VIEWPORT) ? data->rect.h + pad : data->rect.h;
>
> igt_create_color_fb(data->drm_fd, width, height, DRM_FORMAT_XRGB8888,
> DRM_FORMAT_MOD_LINEAR, 0.5, 0.5, 0.5, &data->ofb);
--
Jani Nikula, Intel
next prev parent reply other threads:[~2026-01-13 14:31 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-13 12:04 [PATCH i-g-t 0/8] Some cleanups etc Ville Syrjala
2026-01-13 12:04 ` [PATCH i-g-t 1/8] tests/kms_plane_cursor: s/or/rect/ Ville Syrjala
2026-01-13 14:31 ` Jani Nikula [this message]
2026-01-13 12:04 ` [PATCH i-g-t 2/8] tests/intel/i915_pm_rpm: Nuke bogus NULL check Ville Syrjala
2026-01-13 14:31 ` Jani Nikula
2026-01-13 12:04 ` [PATCH i-g-t 3/8] tests/kms_rotation_crc: s/0/PIPE_A/ Ville Syrjala
2026-01-13 14:32 ` Jani Nikula
2026-01-13 12:04 ` [PATCH i-g-t 4/8] lib/kms: Nuke pipe_select() Ville Syrjala
2026-01-13 14:32 ` Jani Nikula
2026-01-13 12:04 ` [PATCH i-g-t 5/8] lib/kms: Simplify kmstest_get_vbl_flag() Ville Syrjala
2026-01-13 14:33 ` Jani Nikula
2026-01-13 12:04 ` [PATCH i-g-t 6/8] tests/kms_async_flips: Use designated initializers in wait_for_vblank() Ville Syrjala
2026-01-13 14:37 ` Jani Nikula
2026-01-13 12:04 ` [PATCH i-g-t 7/8] tests/intel/kms_pipe_stress: Eliminate double display.drm_fd initialization Ville Syrjala
2026-01-13 14:39 ` Jani Nikula
2026-01-13 12:04 ` [PATCH i-g-t 8/8] lib/kms: Turn igt_pipe_connector_valid() into a function Ville Syrjala
2026-01-13 14:41 ` Jani Nikula
2026-01-13 15:01 ` ✓ Xe.CI.BAT: success for Some cleanups etc Patchwork
2026-01-13 15:18 ` ✓ i915.CI.BAT: " Patchwork
2026-01-13 22:00 ` ✗ i915.CI.Full: failure " Patchwork
2026-01-13 23:14 ` ✗ Xe.CI.Full: " Patchwork
2026-01-15 15:09 ` ✓ Xe.CI.BAT: success for Some cleanups etc. (rev2) Patchwork
2026-01-15 15:17 ` ✓ i915.CI.BAT: " Patchwork
2026-01-15 17:26 ` ✗ Xe.CI.Full: failure " Patchwork
2026-01-15 18:22 ` ✗ i915.CI.Full: " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=85efa5f57b75c87750b4e71b447f57bb98bdf7cb@intel.com \
--to=jani.nikula@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=ville.syrjala@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox