lib: Refactor construction of unique tokens
PATCH 1/2 lib: Refactor construction of unique tokens
From: Chris Wilson <[email protected]>
Wrap all the igt_tokencat(prefix, __LINE) into its own igt_unique() to reduce the clutter and make it easier to generate unique tokens for other common macros.
--- lib/igt_core.h | 54 ++++++++++++++++++++++++++++++-------------------- 1 file changed, 32 insertions(+), 22 deletions(-)
lib/igt_core.h +32 -22
@@ -147,12 +147,12 @@ __noreturn void __igt_fixture_end(void);* enumeration (e.g. when enumerating on systems without an intel gpu) such * blocks should be annotated with igt_fixture. */ -#define igt_fixture for (volatile int igt_tokencat(__tmpint,__LINE__) = 0; \ - igt_tokencat(__tmpint,__LINE__) < 1 && \ +#define igt_fixture for (volatile int igt_unique(__tmpint) = 0; \ + igt_unique(__tmpint) < 1 && \ (STATIC_ANALYSIS_BUILD || \ (__igt_fixture() && \ (sigsetjmp(igt_subtest_jmpbuf, 1) == 0))); \ - igt_tokencat(__tmpint,__LINE__) ++, \ + igt_unique(__tmpint) ++, \ __igt_fixture_complete())/* subtest infrastructure */
@@ -203,6 +203,16 @@ bool __igt_run_dynamic_subtest(const char *dynamic_subtest_name);*/ #define igt_tokencat (x, y) __igt_tokencat2(x, y) +/** +* igt_unique: +* @prefix: local identifier +* +* C preprocessor helper to generate a custom 'unique' token by appending +* the line number onto the token. +*/ +#define igt_unique (prefix) \ + igt_tokencat(igt_tokencat(__igt_unique__, prefix), __LINE__) +/** * igt_subtest: * @name: name of the subtest
@@ -238,7 +248,7 @@ bool __igt_run_dynamic_subtest(const char *dynamic_subtest_name);* static string. */ #define igt_subtest_f(f...) \ - __igt_subtest_f(igt_tokencat(__tmpchar, __LINE__), f) + __igt_subtest_f(igt_unique(__tmpchar), f)/** * igt_subtest_with_dynamic:
@@ -315,7 +325,7 @@ bool __igt_run_dynamic_subtest(const char *dynamic_subtest_name);* format string instead of a static string. */ #define igt_subtest_with_dynamic_f(f...) \ - __igt_subtest_with_dynamic_f(igt_tokencat(__tmpchar, __LINE__), f) + __igt_subtest_with_dynamic_f(igt_unique(__tmpchar), f)/** * igt_dynamic:
@@ -358,7 +368,7 @@ bool __igt_run_dynamic_subtest(const char *dynamic_subtest_name);* instead of a static string. */ #define igt_dynamic_f(f...) \ - __igt_dynamic_f(igt_tokencat(__tmpchar, __LINE__), f) + __igt_dynamic_f(igt_unique(__tmpchar), f)const char *igt_subtest_name (void );bool igt_only_list_subtests (void );
@@ -380,15 +390,15 @@ void __igt_subtest_group_restore(int, int);* clauses. If any common setup in a fixture fails, only the subtests in this * group will fail or skip. Subtest groups can be arbitrarily nested. */ -#define igt_subtest_group for (int igt_tokencat(__tmpint,__LINE__) = 0, \ - igt_tokencat(__save,__LINE__) = 0, \ - igt_tokencat(__desc,__LINE__) = 0; \ - igt_tokencat(__tmpint,__LINE__) < 1 && \ - (__igt_subtest_group_save(& igt_tokencat(__save,__LINE__), \ - & igt_tokencat(__desc,__LINE__) ), true); \ - igt_tokencat(__tmpint,__LINE__) ++, \ - __igt_subtest_group_restore(igt_tokencat(__save,__LINE__), \ - igt_tokencat(__desc,__LINE__))) +#define igt_subtest_group for (int igt_unique(__tmpint) = 0, \ + igt_unique(__save) = 0, \ + igt_unique(__desc) = 0; \ + igt_unique(__tmpint) < 1 && \ + (__igt_subtest_group_save(& igt_unique(__save), \ + & igt_unique(__desc) ), true); \ + igt_unique(__tmpint) ++, \ + __igt_subtest_group_restore(igt_unique(__save), \ + igt_unique(__desc)))/** * igt_main_args:
@@ -404,15 +414,15 @@ void __igt_subtest_group_restore(int, int);* #igt_subtest_init_parse_opts. */ #define igt_main_args (short_opts, long_opts, help_str, opt_handler, handler_data) \ - static void igt_tokencat(__real_main, __LINE__)(void); \ + static void igt_unique(__real_main)(void); \ int main(int argc, char **argv) { \ igt_subtest_init_parse_opts(&argc, argv, \ short_opts, long_opts, help_str, \ opt_handler, handler_data); \ - igt_tokencat(__real_main, __LINE__)(); \ + igt_unique(__real_main)(); \ igt_exit(); \ } \ - static void igt_tokencat(__real_main, __LINE__)(void) \ + static void igt_unique(__real_main)(void) \/**
@@ -460,15 +470,15 @@ void igt_simple_init_parse_opts(int *argc, char **argv,* #igt_simple_init_parse_opts. */ #define igt_simple_main_args (short_opts, long_opts, help_str, opt_handler, handler_data) \ - static void igt_tokencat(__real_main, __LINE__)(void); \ + static void igt_unique(__real_main)(void); \ int main(int argc, char **argv) { \ igt_simple_init_parse_opts(&argc, argv, \ short_opts, long_opts, help_str, \ opt_handler, handler_data); \ - igt_tokencat(__real_main, __LINE__)(); \ + igt_unique(__real_main)(); \ igt_exit(); \ } \ - static void igt_tokencat(__real_main, __LINE__)(void) \ + static void igt_unique(__real_main)(void) \/**
@@ -490,7 +500,7 @@ void igt_simple_init_parse_opts(int *argc, char **argv,*/ #define igt_constructor \ __attribute__((constructor)) \ - static void igt_tokencat(__igt_constructor_l, __LINE__)(void) + static void igt_unique(__igt_constructor_l)(void)__noreturn __attribute__((format (printf,1 ,2 )))void igt_skip (const char *f, ...);
Signature · 1 line
2.33.0
PATCH 2/2 lib: Typechecking minmax
From: Chris Wilson <[email protected]>
Add typechecking to the min/max macros and make their locals truly unique-ish to reduce the risk of shadowing.
v2: small bug fix, write also height coordinate on rotation
test. (jheikkil)
v3: Fix up a couple of other max/max_t instances (Ashutosh)
--- lib/i915/intel_memory_region.c | 9 ++---- lib/i915/intel_memory_region.h | 2 +- lib/igt_aux.h | 48 ++++++++++++++++++++---------- lib/igt_fb.c | 13 ++++---- lib/intel_allocator.c | 2 +- lib/intel_allocator_random.c | 2 +- lib/intel_allocator_reloc.c | 2 +- runner/resultgen.c | 7 +++-- tests/i915/api_intel_bb.c | 2 +- tests/i915/gem_eio.c | 4 +-- tests/i915/gem_exec_alignment.c | 4 +-- tests/i915/gem_exec_capture.c | 2 +- tests/i915/gem_exec_fair.c | 2 +- tests/i915/gem_stress.c | 2 +- tests/i915/gem_tiled_swapping.c | 5 ++-- tests/i915/gem_userptr_blits.c | 2 +- tests/i915/i915_pm_rc6_residency.c | 2 +- tests/i915/kms_big_fb.c | 2 +- tests/i915/perf_pmu.c | 2 +- tests/kms_atomic_transition.c | 2 +- tests/kms_chamelium.c | 2 +- tests/kms_content_protection.c | 4 +-- tests/kms_invalid_mode.c | 4 +-- tests/kms_multipipe_modeset.c | 3 +- tests/kms_rotation_crc.c | 21 ++++++++----- tests/kms_setmode.c | 11 ++----- tests/sw_sync.c | 5 ++-- tools/intel_vbt_decode.c | 3 +- 28 files changed, 93 insertions(+), 76 deletions(-)
lib/i915/intel_memory_region.c +3 -6
@@ -146,19 +146,16 @@ out:* * Returns: Number of found lmem regions. */ -uint8_t gem_get_lmem_region_count (int fd) +unsigned int gem_get_lmem_region_count (int fd) {struct drm_i915_query_memory_regions *query_info; -uint8_t num_regions; -uint8_t lmem_regions =0 ; +unsigned int lmem_regions =0 ; query_info =gem_get_query_memory_regions (fd);if (!query_info) goto out; - num_regions = query_info->num_regions; - -for (int i =0 ; i < num_regions; i++) { +for (unsigned int i =0 ; i < query_info->num_regions; i++) {if (query_info->regions[i].region.memory_class ==I915_MEMORY_CLASS_DEVICE ) lmem_regions +=1 ; }
lib/i915/intel_memory_region.h +1 -1
@@ -58,7 +58,7 @@ uint32_t gem_get_batch_size(int fd, uint8_t mem_region_type);struct drm_i915_query_memory_regions *gem_get_query_memory_regions (int fd); -uint8_t gem_get_lmem_region_count (int fd); +unsigned int gem_get_lmem_region_count (int fd);bool gem_has_lmem (int fd);
lib/igt_aux.h +33 -15
65 lines not on this page · raw message
lib/igt_fb.c +5 -8
@@ -733,7 +733,7 @@ static uint32_t calc_plane_stride(struct igt_fb *fb, int plane)* tiled. But then that failure is expected. */ - stride =max (min_stride,512 ); + stride =max (min_stride,512u ); stride =roundup_power_of_two (stride);return stride;
@@ -747,7 +747,7 @@ static uint32_t calc_plane_stride(struct igt_fb *fb, int plane)/* * For amdgpu device with tiling mode */ -unsigned int tile_width, tile_height; +uint32_t tile_width, tile_height;igt_amd_fb_calculate_tile_dimension (fb->plane_bpp[plane], &tile_width, &tile_height);
@@ -812,9 +812,9 @@ static uint64_t calc_plane_size(struct igt_fb *fb, int plane)if (fb->modifier !=DRM_FORMAT_MOD_NONE &&is_i915_device (fb->fd) &&intel_display_ver (intel_get_drm_devid (fb->fd)) <=3 ) { -uint64_t min_size = (uint64_t ) fb->strides[plane] * +uint64_t size = (uint64_t ) fb->strides[plane] * fb->plane_height[plane]; -uint64_t size; +uint64_t min_size =1024 *1024 ;/* Round the tiling up to the next power-of-two and the region * up to the next pot fence size so that this works on all
@@ -824,10 +824,7 @@ static uint64_t calc_plane_size(struct igt_fb *fb, int plane)* tiled. But then that failure is expected. */ - size =max (min_size,1024 *1024 ); - size =roundup_power_of_two (size); - -return size; +return roundup_power_of_two (max (size, min_size)); }else if (fb->modifier !=DRM_FORMAT_MOD_NONE &&is_amdgpu_device (fb->fd)) {/* * For amdgpu device with tiling mode
lib/intel_allocator.c +1 -1
@@ -1088,7 +1088,7 @@ uint64_t __intel_allocator_alloc(uint64_t allocator_handle, uint32_t handle,struct alloc_resp resp;igt_assert ((alignment & (alignment-1 )) ==0 ); - req.alloc.alignment =max (alignment,1 <<12 ); + req.alloc.alignment =max_t (uint64_t, alignment,1 <<12 );igt_assert (handle_request (&req, &resp) ==0 );igt_assert (resp.response_type ==RESP_ALLOC );
lib/intel_allocator_random.c +1 -1
@@ -180,7 +180,7 @@ intel_allocator_random_create(int fd, uint64_t start, uint64_t end)igt_assert (ial->priv); ialr->prng = (uint32_t )to_user_pointer (ial); - start =max (start,BIAS ); + start =max_t (uint64_t, start,BIAS );igt_assert (start < end); ialr->start = start; ialr->end = end;
lib/intel_allocator_reloc.c +1 -1
@@ -176,7 +176,7 @@ intel_allocator_reloc_create(int fd, uint64_t start, uint64_t end)igt_assert (ial->priv); ialr->prng = (uint32_t )to_user_pointer (ial); - start =max (start,BIAS ); + start =max_t (uint64_t, start,BIAS );igt_assert (start < end); ialr->offset = ialr->start = start; ialr->end = end;
runner/resultgen.c +5 -2
@@ -481,12 +481,15 @@ static int find_subtest_idx_limited(struct matches matches,if (line_len <0 )return -1 ; -for (k = first; k < last; k++) +for (k = first; k < last; k++) { +ptrdiff_t rem = bufend - matches.items[k].where; +if (matches.items[k].what == linekey && !memcmp (matches.items[k].where, full_line, -min (line_len, bufend - matches.items[k].where))) +min_t (ptrdiff_t, line_len, rem)))break ; + }free (full_line);
tests/i915/api_intel_bb.c +1 -1
@@ -904,7 +904,7 @@ static int compare_bufs(struct intel_buf *buf1, struct intel_buf *buf2,return ret; } -#define LINELEN 76 +#define LINELEN 76ulstatic int dump_base64 (const char *name,struct intel_buf *buf) {void *ptr;
tests/i915/gem_eio.c +2 -2
@@ -489,7 +489,7 @@ static void test_inflight(int fd, unsigned int wait) max =gem_measure_ring_inflight (fd,-1 ,0 );igt_require (max >1 ); - max =min (max -1 ,ARRAY_SIZE (fence)); + max =min_t (max, max -1 ,ARRAY_SIZE (fence));igt_debug ("Using %d inflight batches\n" , max);for_each_ring (e, parent_fd) {
@@ -558,7 +558,7 @@ static void test_inflight_suspend(int fd) max =gem_measure_ring_inflight (fd,-1 ,0 );igt_require (max >1 ); - max =min (max -1 ,ARRAY_SIZE (fence)); + max =min_t (max, max -1 ,ARRAY_SIZE (fence));igt_debug ("Using %d inflight batches\n" , max); fd =reopen_device (fd);
tests/i915/gem_exec_alignment.c +2 -2
@@ -166,7 +166,7 @@ naughty_child(int i915, int link, uint32_t shared, unsigned int flags)if (!gem_uses_full_ppgtt (i915)) gtt_size /=2 ;/* We have to *share* our GTT! */ - ram_size =min (intel_get_total_ram_mb (),4096 ); + ram_size =min_t (uint64_t,intel_get_total_ram_mb (),4096 ); ram_size *=1024 *1024 ; count =min (gtt_size, ram_size) /16384 ;
@@ -376,7 +376,7 @@ setup_many(int i915, unsigned long *out)if (!gem_uses_full_ppgtt (i915)) gtt_size /=2 ;/* We have to *share* our GTT! */ - ram_size =min (intel_get_total_ram_mb (),4096 ); + ram_size =min_t (uint64_t,intel_get_total_ram_mb (),4096 ); ram_size *=1024 *1024 ; count =min (gtt_size, ram_size) /16384 ;
tests/i915/gem_exec_capture.c +1 -1
@@ -566,7 +566,7 @@ static void prioinv(int fd, int dir, const intel_ctx_t *ctx, gtt, ram); count =min (gtt, ram) /4 ; - count =min (count,256 );/* Keep the duration within reason */ + count =min (count,256ul );/* Keep the duration within reason */ igt_require (count >1 );intel_require_memory (count, size,CHECK_RAM );
tests/i915/gem_exec_fair.c +1 -1
@@ -605,7 +605,7 @@ static void fair_child(int i915, const intel_ctx_t *ctx, map =gem_mmap__device_coherent (i915, obj[0 ].handle,0 ,4096 ,PROT_WRITE );igt_assert (map[0 ]); -for (n =1 ; n <min (count,512 ); n++) { +for (n =1 ; n <min (count,512ul ); n++) {igt_assert (map[n]); map[n -1 ] = map[n] - map[n -1 ]; }
tests/i915/gem_stress.c +1 -1
@@ -769,7 +769,7 @@ static void init(void)if (options.num_buffers ==0 ) { tmp =gem_aperture_size (drm_fd); - tmp =min (256 * (1024 *1024 ), tmp); + tmp =min (256 *1024 *1024u , tmp); num_buffers =2 * tmp / options.scratch_buf_size /3 ; num_buffers /=2 ;igt_info ("using %u buffers\n" , num_buffers);
tests/i915/gem_tiled_swapping.c +3 -2
@@ -67,7 +67,7 @@ IGT_TEST_DESCRIPTION("Exercise swizzle code for swapping.");static uint32_t current_tiling_mode;#define PAGE_SIZE 4096 -#define AVAIL_RAM 512 +#define AVAIL_RAM 512ulstatic uint32_t create_bo (int fd)
@@ -183,7 +183,8 @@ igt_main/* lock RAM, leaving only 512MB available */ count =intel_get_total_ram_mb () -intel_get_avail_ram_mb (); count =max (count +64 ,AVAIL_RAM ); - lock_size =max (0 ,intel_get_total_ram_mb () - count); + count =intel_get_total_ram_mb () - count; + lock_size =max_t (long,0 , count); igt_info("Mlocking %zdMiB of %ld/%ldMiB\n", lock_size, (long)intel_get_avail_ram_mb(),
tests/i915/gem_userptr_blits.c +1 -1
@@ -1693,7 +1693,7 @@ static void test_forking_evictions(int fd, int size, int count,* processes meaning swapping will be triggered system * wide even if one process on it's own can't do it. */ - num_threads =min (sysconf (_SC_NPROCESSORS_ONLN) *4 ,12 ); + num_threads =min_t (int,sysconf (_SC_NPROCESSORS_ONLN) *4 ,12 ); trash_count /= num_threads;if (count > trash_count) count = trash_count;
tests/i915/i915_pm_rc6_residency.c +1 -1
@@ -345,7 +345,7 @@ static void bg_load(int i915, unsigned int flags, unsigned long *ctl) ctl[1 ]++;/* aim for ~1% busy */ -usleep (min (elapsed /10 ,50 *1000 )); +usleep (min_t (elapsed, elapsed /10 ,50 *1000 )); }while (!READ_ONCE (*ctl)); }
tests/i915/kms_big_fb.c +1 -1
@@ -400,9 +400,9 @@ static bool test_plane(data_t *data)static bool test_pipe (data_t *data) { +uint16_t width, height;drmModeModeInfo *mode;igt_plane_t *primary; -int width, height;bool ret = false; if (data->format == DRM_FORMAT_C8 &&
tests/i915/perf_pmu.c +1 -1
@@ -1413,7 +1413,7 @@ static int target_num_interrupts(int i915) {const intel_ctx_cfg_t cfg =intel_ctx_cfg_all_physical (i915); -return min (gem_submission_measure (i915, &cfg,I915_EXEC_DEFAULT ),30 ); +return min (gem_submission_measure (i915, &cfg,I915_EXEC_DEFAULT ),30u ); } static void
tests/kms_atomic_transition.c +1 -1
@@ -789,7 +789,7 @@ static void run_modeset_tests(data_t *data, int howmany, bool nonblocking, boolunsigned iter_max;igt_pipe_crc_t *pipe_crcs[IGT_MAX_PIPES ] = {0 };igt_output_t *output; -unsigned width =0 , height =0 ; +uint16_t width =0 , height =0 ;for (i =0 ; i < data->display.n_outputs; i++)igt_output_set_pipe (&data->display.outputs[i],PIPE_NONE );
tests/kms_chamelium.c +1 -1
@@ -2399,7 +2399,7 @@ static void test_display_planes_random(data_t *data,igt_output_count_plane_type (output,DRM_PLANE_TYPE_OVERLAY );/* Limit the number of planes to a reasonable scene. */ - overlay_planes_max =min (overlay_planes_max,4 ); + overlay_planes_max =min (overlay_planes_max,4u ); overlay_planes_count = (rand () % overlay_planes_max) +1 ;igt_debug ("Using %d overlay planes\n" , overlay_planes_count);
tests/kms_content_protection.c +2 -2
@@ -703,9 +703,9 @@ static void test_content_protection_cleanup(void)static void create_fbs (void ) { -igt_output_t *output; -int width =0 , height =0 ; +uint16_t width =0 , height =0 ;drmModeModeInfo *mode; +igt_output_t *output;for_each_connected_output (&data.display, output) { mode =igt_output_get_mode (output);
tests/kms_invalid_mode.c +2 -2
@@ -195,8 +195,8 @@ test_output(data_t *data)return 0 ;igt_create_fb (data->drm_fd, -max (mode.hdisplay,64 ), -max (mode.vdisplay,64 ), +max_t (uint16_t, mode.hdisplay,64 ), +max_t (uint16_t, mode.vdisplay,64 ),DRM_FORMAT_XRGB8888 ,DRM_FORMAT_MOD_NONE , &fb);
tests/kms_multipipe_modeset.c +2 -1
@@ -40,10 +40,11 @@ static void run_test(data_t *data, int valid_outputs)igt_pipe_crc_t *pipe_crcs[IGT_MAX_PIPES ] = {0 };igt_crc_t ref_crcs[IGT_MAX_PIPES ], new_crcs[IGT_MAX_PIPES ];igt_display_t *display = &data->display; -int width =0 , height =0 , i =0 ; +uint16_t width =0 , height =0 ;igt_pipe_t *pipe;igt_plane_t *plane;drmModeModeInfo *mode; +int i =0 ;for_each_connected_output (display, output) { mode =igt_output_get_mode (output);
tests/kms_rotation_crc.c +13 -8
@@ -214,6 +214,11 @@ static void prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe,igt_pipe_crc_start (data->pipe_crc); } +#define TEST_WIDTH (km) \ + min_t((km)->hdisplay, (km)->hdisplay, TEST_MAX_WIDTH) +#define TEST_HEIGHT (km) \ + min_t((km)->vdisplay, (km)->vdisplay, TEST_MAX_HEIGHT) +static void prepare_fbs (data_t *data,igt_output_t *output,igt_plane_t *plane,enum rectangle_type rect,uint32_t format) {
@@ -234,8 +239,8 @@ static void prepare_fbs(data_t *data, igt_output_t *output, w = mode->hdisplay; h = mode->vdisplay; }else { - w =min (TEST_MAX_WIDTH , mode->hdisplay); - h =min (TEST_MAX_HEIGHT , mode->vdisplay); + w =TEST_WIDTH (mode); + h =TEST_HEIGHT (mode); } min_w =256 ;
@@ -614,7 +619,7 @@ static void pointlocation(data_t *data, planeinfos *p, drmModeModeInfo *mode, int c) {if (data->planepos[c].origo & p_right) { - p[c].x1 = (int32_t )(data->planepos[c].x *min (TEST_MAX_WIDTH , mode->hdisplay) + p[c].x1 = (int32_t )(data->planepos[c].x *TEST_WIDTH (mode) + mode->hdisplay); p[c].x1 &= ~3 ;/*
@@ -625,17 +630,17 @@ static void pointlocation(data_t *data, planeinfos *p, drmModeModeInfo *mode,*/ p[c].x1 -= mode->hdisplay &2 ; }else { - p[c].x1 = (int32_t )(data->planepos[c].x *min (TEST_MAX_WIDTH , mode->hdisplay)); + p[c].x1 = (int32_t )(data->planepos[c].x *TEST_WIDTH (mode)); p[c].x1 &= ~3 ; }if (data->planepos[c].origo & p_bottom) { - p[c].y1 = (int32_t )(data->planepos[c].y *min (TEST_MAX_HEIGHT , mode->vdisplay) + p[c].y1 = (int32_t )(data->planepos[c].y *TEST_HEIGHT (mode) + mode->vdisplay); p[c].y1 &= ~3 ; p[c].y1 -= mode->vdisplay &2 ; }else { - p[c].y1 = (int32_t )(data->planepos[c].y *min (TEST_MAX_HEIGHT , mode->vdisplay)); + p[c].y1 = (int32_t )(data->planepos[c].y *TEST_HEIGHT (mode)); p[c].y1 &= ~3 ; } }
@@ -698,8 +703,8 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)igt_display_require_output (display);igt_display_commit2 (display,COMMIT_ATOMIC ); - used_w =min (TEST_MAX_WIDTH , mode->hdisplay); - used_h =min (TEST_MAX_HEIGHT , mode->vdisplay); + used_w =TEST_WIDTH (mode); + used_h =TEST_HEIGHT (mode); p[0 ].plane =igt_output_get_plane_type (output,DRM_PLANE_TYPE_PRIMARY ); p[1 ].plane =igt_output_get_plane_type (output,DRM_PLANE_TYPE_OVERLAY );
tests/kms_setmode.c +2 -9
@@ -421,15 +421,8 @@ static int test_stealing(int fd, struct crtc_config *crtc, uint32_t *ids)return ret; } -static double frame_time (const drmModeModeInfo *kmode) -{ -return 1000.0 * kmode->htotal * kmode->vtotal / kmode->clock; -} - -static double line_time (const drmModeModeInfo *kmode) -{ -return 1000.0 * kmode->htotal / kmode->clock; -} +#define frame_time (km) (1000.0 * (km)->htotal * (km)->vtotal / (km)->clock) +#define line_time (km) (1000.0 * (km)->htotal / (km)->clock)static void check_timings (int crtc_idx,const drmModeModeInfo *kmode) {
tests/sw_sync.c +3 -2
@@ -837,8 +837,9 @@ igt_main igt_fixture {igt_require_sw_sync (); multi_consumer_threads = -min (multi_consumer_threads, -sysconf (_SC_NPROCESSORS_ONLN)); +min_t (multi_consumer_threads, + multi_consumer_threads, +sysconf (_SC_NPROCESSORS_ONLN)); }igt_subtest ("alloc_timeline" )
tools/intel_vbt_decode.c +2 -1
@@ -534,10 +534,11 @@ static void dump_child_devices(struct context *context, const uint8_t *devices,* initialized to zero. */ child =calloc (1 ,sizeof (*child)); +igt_assert (child);for (i =0 ; i < child_dev_num; i++) {memcpy (child, devices + i * child_dev_size, -min (sizeof (*child), child_dev_size)); +min_t (child_dev_size,sizeof (*child), child_dev_size));dump_child_device (context, child); }
Signature · 1 line
2.33.0
Re: [igt-dev] [PATCH i-g-t 2/2] lib: Typechecking minmax
Quoted 75 lines · Ashutosh Dixit
From: Chris Wilson <[email protected]>
Add typechecking to the min/max macros and make their locals truly unique-ish to reduce the risk of shadowing.
v2: small bug fix, write also height coordinate on rotation
test. (jheikkil)
v3: Fix up a couple of other max/max_t instances (Ashutosh)Signed-off-by Juha-Pekka Heikkilä <[email protected]>Signed-off-by Ashutosh Dixit <[email protected]>Signed-off-by Chris Wilson <[email protected]>--- lib/i915/intel_memory_region.c | 9 ++---- lib/i915/intel_memory_region.h | 2 +- lib/igt_aux.h | 48 ++++++++++++++++++++---------- lib/igt_fb.c | 13 ++++---- lib/intel_allocator.c | 2 +- lib/intel_allocator_random.c | 2 +- lib/intel_allocator_reloc.c | 2 +- runner/resultgen.c | 7 +++-- tests/i915/api_intel_bb.c | 2 +- tests/i915/gem_eio.c | 4 +-- tests/i915/gem_exec_alignment.c | 4 +-- tests/i915/gem_exec_capture.c | 2 +- tests/i915/gem_exec_fair.c | 2 +- tests/i915/gem_stress.c | 2 +- tests/i915/gem_tiled_swapping.c | 5 ++-- tests/i915/gem_userptr_blits.c | 2 +- tests/i915/i915_pm_rc6_residency.c | 2 +- tests/i915/kms_big_fb.c | 2 +- tests/i915/perf_pmu.c | 2 +- tests/kms_atomic_transition.c | 2 +- tests/kms_chamelium.c | 2 +- tests/kms_content_protection.c | 4 +-- tests/kms_invalid_mode.c | 4 +-- tests/kms_multipipe_modeset.c | 3 +- tests/kms_rotation_crc.c | 21 ++++++++----- tests/kms_setmode.c | 11 ++----- tests/sw_sync.c | 5 ++-- tools/intel_vbt_decode.c | 3 +- 28 files changed, 93 insertions(+), 76 deletions(-)lib/i915/intel_memory_region.c +3
-6@@ -146,19 +146,16 @@ out:* * Returns: Number of found lmem regions. */ -uint8_t gem_get_lmem_region_count (int fd) +unsigned int gem_get_lmem_region_count (int fd) {struct drm_i915_query_memory_regions *query_info; -uint8_t num_regions; -uint8_t lmem_regions =0 ; +unsigned int lmem_regions =0 ; query_info =gem_get_query_memory_regions (fd);if (!query_info) goto out; - num_regions = query_info->num_regions; - -for (int i =0 ; i < num_regions; i++) { +for (unsigned int i =0 ; i < query_info->num_regions; i++) {if (query_info->regions[i].region.memory_class ==I915_MEMORY_CLASS_DEVICE ) lmem_regions +=1 ; }lib/i915/intel_memory_region.h +0
-0
lib/i915/intel_memory_region.h uint32_t gem_get_batch_size(int fd, uint8_t mem_region_type); · line 63
Quoted 7 lines
lib/i915/intel_memory_region.h +1
-1@@ -58,7 +58,7 @@ uint32_t gem_get_batch_size(int fd, uint8_t mem_region_type);struct drm_i915_query_memory_regions *gem_get_query_memory_regions (int fd); -uint8_t gem_get_lmem_region_count (int fd); +unsigned int gem_get_lmem_region_count (int fd);bool gem_has_lmem (int fd);
Above changes in memory regions should be part of another patch as it not related to typechecking.
Quoted 62 lines
lib/igt_aux.h +28
-15@@ -40,6 +40,8 @@#include <i915/gem_submission.h> +#include "igt_core.h" +/* signal interrupt helpers */ #ifdef __linux__# ifndef HAVE_GETTID @@ -212,26 +214,42 @@ void intel_require_files(uint64_t count);#define CHECK_RAM 0x1#define CHECK_SWAP 0x2 -#define min (a, b) ({ \ - typeof(a) _a = (a); \ - typeof(b) _b = (b); \ - _a < _b ? _a : _b; \ -}) -#define max (a, b) ({ \ - typeof(a) _a = (a); \ - typeof(b) _b = (b); \ - _a > _b ? _a : _b; \ -}) +#define __typecheck (x, y) \ + (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1))) -#define clamp (x, min, max) ({ \ - typeof(min) _min = (min); \ - typeof(max) _max = (max); \ - typeof(x) _x = (x); \ - _x < _min ? _min : _x > _max ? _max : _x; \ +#define __cmp (x, y, op) ((x) op (y) ? (x) : (y)) + +#define __cmp_once (x, y, unique_x, unique_y, op) ({ \ + typeof(x) unique_x = (x); \ + typeof(y) unique_y = (y); \ + __cmp(unique_x, unique_y, op); \ }) +#define __is_constexpr (x) \ + (sizeof(int) == sizeof(*(8 ? ((void *)((long)(x) * 0l)) : (int *)8))) + +#define __no_side_effects (x, y) \ + (__is_constexpr(x) && __is_constexpr(y)) + +#define __safe_cmp (x, y) \ + (__typecheck(x, y) && __no_side_effects(x, y)) + +#define __careful_cmp (x, y, op, prefix) \ + __builtin_choose_expr(__safe_cmp(x, y), \ + __cmp(x, y, op), \ + __cmp_once(x, y, igt_unique(igt_tokencat(prefix, __x)), igt_unique(igt_tokencat(prefix, __y)), op)) + +#define min (x, y) __careful_cmp(x, y, <, min) +#define max (x, y) __careful_cmp(x, y, >, max) + +#define clamp (val, lo, hi) min(max(val, lo), hi)
lib/igt_aux.h void intel_require_files(uint64_t count); · line 255
Quoted 10 lines
lib/igt_aux.h +5
-0+ +#define min_t (t, x, y) __careful_cmp((typeof(t))x, (typeof(t))y, <, min_t) +#define max_t (t, x, y) __careful_cmp((typeof(t))x, (typeof(t))y, >, max_t) +#define igt_swap (a, b) do { \ typeof(a) _tmp = (a); \ + _Static_assert(__typecheck(a, b), "type mismatch for swap"); \ (a) = (b); \ (b) = _tmp; \ } while (0)
Transplanted from kernel, ok. __is_constexpr() is really mindblowing.
Quoted 431 lines
lib/igt_fb.c +5
-8@@ -733,7 +733,7 @@ static uint32_t calc_plane_stride(struct igt_fb *fb, int plane)* tiled. But then that failure is expected. */ - stride =max (min_stride,512 ); + stride =max (min_stride,512u ); stride =roundup_power_of_two (stride);return stride;@@ -747,7 +747,7 @@ static uint32_t calc_plane_stride(struct igt_fb *fb, int plane)/* * For amdgpu device with tiling mode */ -unsigned int tile_width, tile_height; +uint32_t tile_width, tile_height;igt_amd_fb_calculate_tile_dimension (fb->plane_bpp[plane], &tile_width, &tile_height);@@ -812,9 +812,9 @@ static uint64_t calc_plane_size(struct igt_fb *fb, int plane)if (fb->modifier !=DRM_FORMAT_MOD_NONE &&is_i915_device (fb->fd) &&intel_display_ver (intel_get_drm_devid (fb->fd)) <=3 ) { -uint64_t min_size = (uint64_t ) fb->strides[plane] * +uint64_t size = (uint64_t ) fb->strides[plane] * fb->plane_height[plane]; -uint64_t size; +uint64_t min_size =1024 *1024 ;/* Round the tiling up to the next power-of-two and the region * up to the next pot fence size so that this works on all @@ -824,10 +824,7 @@ static uint64_t calc_plane_size(struct igt_fb *fb, int plane)* tiled. But then that failure is expected. */ - size =max (min_size,1024 *1024 ); - size =roundup_power_of_two (size); - -return size; +return roundup_power_of_two (max (size, min_size)); }else if (fb->modifier !=DRM_FORMAT_MOD_NONE &&is_amdgpu_device (fb->fd)) {/* * For amdgpu device with tiling mode lib/intel_allocator.c +1
-1@@ -1088,7 +1088,7 @@ uint64_t __intel_allocator_alloc(uint64_t allocator_handle, uint32_t handle,struct alloc_resp resp;igt_assert ((alignment & (alignment-1 )) ==0 ); - req.alloc.alignment =max (alignment,1 <<12 ); + req.alloc.alignment =max_t (uint64_t, alignment,1 <<12 );igt_assert (handle_request (&req, &resp) ==0 );igt_assert (resp.response_type ==RESP_ALLOC );lib/intel_allocator_random.c +1
-1@@ -180,7 +180,7 @@ intel_allocator_random_create(int fd, uint64_t start, uint64_t end)igt_assert (ial->priv); ialr->prng = (uint32_t )to_user_pointer (ial); - start =max (start,BIAS ); + start =max_t (uint64_t, start,BIAS );igt_assert (start < end); ialr->start = start; ialr->end = end;lib/intel_allocator_reloc.c +1
-1@@ -176,7 +176,7 @@ intel_allocator_reloc_create(int fd, uint64_t start, uint64_t end)igt_assert (ial->priv); ialr->prng = (uint32_t )to_user_pointer (ial); - start =max (start,BIAS ); + start =max_t (uint64_t, start,BIAS );igt_assert (start < end); ialr->offset = ialr->start = start; ialr->end = end;runner/resultgen.c +5
-2@@ -481,12 +481,15 @@ static int find_subtest_idx_limited(struct matches matches,if (line_len <0 )return -1 ; -for (k = first; k < last; k++) +for (k = first; k < last; k++) { +ptrdiff_t rem = bufend - matches.items[k].where; +if (matches.items[k].what == linekey && !memcmp (matches.items[k].where, full_line, -min (line_len, bufend - matches.items[k].where))) +min_t (ptrdiff_t, line_len, rem)))break ; + }free (full_line);tests/i915/api_intel_bb.c +1
-1@@ -904,7 +904,7 @@ static int compare_bufs(struct intel_buf *buf1, struct intel_buf *buf2,return ret; } -#define LINELEN 76 +#define LINELEN 76ulstatic int dump_base64 (const char *name,struct intel_buf *buf) {void *ptr;tests/i915/gem_eio.c +2
-2@@ -489,7 +489,7 @@ static void test_inflight(int fd, unsigned int wait) max =gem_measure_ring_inflight (fd,-1 ,0 );igt_require (max >1 ); - max =min (max -1 ,ARRAY_SIZE (fence)); + max =min_t (max, max -1 ,ARRAY_SIZE (fence));igt_debug ("Using %d inflight batches\n" , max);for_each_ring (e, parent_fd) {@@ -558,7 +558,7 @@ static void test_inflight_suspend(int fd) max =gem_measure_ring_inflight (fd,-1 ,0 );igt_require (max >1 ); - max =min (max -1 ,ARRAY_SIZE (fence)); + max =min_t (max, max -1 ,ARRAY_SIZE (fence));igt_debug ("Using %d inflight batches\n" , max); fd =reopen_device (fd);tests/i915/gem_exec_alignment.c +2
-2@@ -166,7 +166,7 @@ naughty_child(int i915, int link, uint32_t shared, unsigned int flags)if (!gem_uses_full_ppgtt (i915)) gtt_size /=2 ;/* We have to *share* our GTT! */ - ram_size =min (intel_get_total_ram_mb (),4096 ); + ram_size =min_t (uint64_t,intel_get_total_ram_mb (),4096 ); ram_size *=1024 *1024 ; count =min (gtt_size, ram_size) /16384 ;@@ -376,7 +376,7 @@ setup_many(int i915, unsigned long *out)if (!gem_uses_full_ppgtt (i915)) gtt_size /=2 ;/* We have to *share* our GTT! */ - ram_size =min (intel_get_total_ram_mb (),4096 ); + ram_size =min_t (uint64_t,intel_get_total_ram_mb (),4096 ); ram_size *=1024 *1024 ; count =min (gtt_size, ram_size) /16384 ;tests/i915/gem_exec_capture.c +1
-1@@ -566,7 +566,7 @@ static void prioinv(int fd, int dir, const intel_ctx_t *ctx, gtt, ram); count =min (gtt, ram) /4 ; - count =min (count,256 );/* Keep the duration within reason */ + count =min (count,256ul );/* Keep the duration within reason */ igt_require (count >1 );intel_require_memory (count, size,CHECK_RAM );tests/i915/gem_exec_fair.c +1
-1@@ -605,7 +605,7 @@ static void fair_child(int i915, const intel_ctx_t *ctx, map =gem_mmap__device_coherent (i915, obj[0 ].handle,0 ,4096 ,PROT_WRITE );igt_assert (map[0 ]); -for (n =1 ; n <min (count,512 ); n++) { +for (n =1 ; n <min (count,512ul ); n++) {igt_assert (map[n]); map[n -1 ] = map[n] - map[n -1 ]; }tests/i915/gem_stress.c +1
-1@@ -769,7 +769,7 @@ static void init(void)if (options.num_buffers ==0 ) { tmp =gem_aperture_size (drm_fd); - tmp =min (256 * (1024 *1024 ), tmp); + tmp =min (256 *1024 *1024u , tmp); num_buffers =2 * tmp / options.scratch_buf_size /3 ; num_buffers /=2 ;igt_info ("using %u buffers\n" , num_buffers);tests/i915/gem_tiled_swapping.c +3
-2@@ -67,7 +67,7 @@ IGT_TEST_DESCRIPTION("Exercise swizzle code for swapping.");static uint32_t current_tiling_mode;#define PAGE_SIZE 4096 -#define AVAIL_RAM 512 +#define AVAIL_RAM 512ulstatic uint32_t create_bo (int fd)@@ -183,7 +183,8 @@ igt_main/* lock RAM, leaving only 512MB available */ count =intel_get_total_ram_mb () -intel_get_avail_ram_mb (); count =max (count +64 ,AVAIL_RAM ); - lock_size =max (0 ,intel_get_total_ram_mb () - count); + count =intel_get_total_ram_mb () - count; + lock_size =max_t (long,0 , count); igt_info("Mlocking %zdMiB of %ld/%ldMiB\n", lock_size, (long)intel_get_avail_ram_mb(),tests/i915/gem_userptr_blits.c +1
-1@@ -1693,7 +1693,7 @@ static void test_forking_evictions(int fd, int size, int count,* processes meaning swapping will be triggered system * wide even if one process on it's own can't do it. */ - num_threads =min (sysconf (_SC_NPROCESSORS_ONLN) *4 ,12 ); + num_threads =min_t (int,sysconf (_SC_NPROCESSORS_ONLN) *4 ,12 ); trash_count /= num_threads;if (count > trash_count) count = trash_count;tests/i915/i915_pm_rc6_residency.c +1
-1@@ -345,7 +345,7 @@ static void bg_load(int i915, unsigned int flags, unsigned long *ctl) ctl[1 ]++;/* aim for ~1% busy */ -usleep (min (elapsed /10 ,50 *1000 )); +usleep (min_t (elapsed, elapsed /10 ,50 *1000 )); }while (!READ_ONCE (*ctl)); }tests/i915/kms_big_fb.c +1
-1@@ -400,9 +400,9 @@ static bool test_plane(data_t *data)static bool test_pipe (data_t *data) { +uint16_t width, height;drmModeModeInfo *mode;igt_plane_t *primary; -int width, height;bool ret = false; if (data->format == DRM_FORMAT_C8 &&tests/i915/perf_pmu.c +1
-1@@ -1413,7 +1413,7 @@ static int target_num_interrupts(int i915) {const intel_ctx_cfg_t cfg =intel_ctx_cfg_all_physical (i915); -return min (gem_submission_measure (i915, &cfg,I915_EXEC_DEFAULT ),30 ); +return min (gem_submission_measure (i915, &cfg,I915_EXEC_DEFAULT ),30u ); } static voidtests/kms_atomic_transition.c +1
-1@@ -789,7 +789,7 @@ static void run_modeset_tests(data_t *data, int howmany, bool nonblocking, boolunsigned iter_max;igt_pipe_crc_t *pipe_crcs[IGT_MAX_PIPES ] = {0 };igt_output_t *output; -unsigned width =0 , height =0 ; +uint16_t width =0 , height =0 ;for (i =0 ; i < data->display.n_outputs; i++)igt_output_set_pipe (&data->display.outputs[i],PIPE_NONE );tests/kms_chamelium.c +1
-1@@ -2399,7 +2399,7 @@ static void test_display_planes_random(data_t *data,igt_output_count_plane_type (output,DRM_PLANE_TYPE_OVERLAY );/* Limit the number of planes to a reasonable scene. */ - overlay_planes_max =min (overlay_planes_max,4 ); + overlay_planes_max =min (overlay_planes_max,4u ); overlay_planes_count = (rand () % overlay_planes_max) +1 ;igt_debug ("Using %d overlay planes\n" , overlay_planes_count);tests/kms_content_protection.c +2
-2@@ -703,9 +703,9 @@ static void test_content_protection_cleanup(void)static void create_fbs (void ) { -igt_output_t *output; -int width =0 , height =0 ; +uint16_t width =0 , height =0 ;drmModeModeInfo *mode; +igt_output_t *output;for_each_connected_output (&data.display, output) { mode =igt_output_get_mode (output);tests/kms_invalid_mode.c +2
-2@@ -195,8 +195,8 @@ test_output(data_t *data)return 0 ;igt_create_fb (data->drm_fd, -max (mode.hdisplay,64 ), -max (mode.vdisplay,64 ), +max_t (uint16_t, mode.hdisplay,64 ), +max_t (uint16_t, mode.vdisplay,64 ),DRM_FORMAT_XRGB8888 ,DRM_FORMAT_MOD_NONE , &fb);tests/kms_multipipe_modeset.c +2
-1@@ -40,10 +40,11 @@ static void run_test(data_t *data, int valid_outputs)igt_pipe_crc_t *pipe_crcs[IGT_MAX_PIPES ] = {0 };igt_crc_t ref_crcs[IGT_MAX_PIPES ], new_crcs[IGT_MAX_PIPES ];igt_display_t *display = &data->display; -int width =0 , height =0 , i =0 ; +uint16_t width =0 , height =0 ;igt_pipe_t *pipe;igt_plane_t *plane;drmModeModeInfo *mode; +int i =0 ;for_each_connected_output (display, output) { mode =igt_output_get_mode (output);tests/kms_rotation_crc.c +13
-8@@ -214,6 +214,11 @@ static void prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe,igt_pipe_crc_start (data->pipe_crc); } +#define TEST_WIDTH (km) \ + min_t((km)->hdisplay, (km)->hdisplay, TEST_MAX_WIDTH) +#define TEST_HEIGHT (km) \ + min_t((km)->vdisplay, (km)->vdisplay, TEST_MAX_HEIGHT) +static void prepare_fbs (data_t *data,igt_output_t *output,igt_plane_t *plane,enum rectangle_type rect,uint32_t format) {@@ -234,8 +239,8 @@ static void prepare_fbs(data_t *data, igt_output_t *output, w = mode->hdisplay; h = mode->vdisplay; }else { - w =min (TEST_MAX_WIDTH , mode->hdisplay); - h =min (TEST_MAX_HEIGHT , mode->vdisplay); + w =TEST_WIDTH (mode); + h =TEST_HEIGHT (mode); } min_w =256 ;@@ -614,7 +619,7 @@ static void pointlocation(data_t *data, planeinfos *p, drmModeModeInfo *mode, int c) {if (data->planepos[c].origo & p_right) { - p[c].x1 = (int32_t )(data->planepos[c].x *min (TEST_MAX_WIDTH , mode->hdisplay) + p[c].x1 = (int32_t )(data->planepos[c].x *TEST_WIDTH (mode) + mode->hdisplay); p[c].x1 &= ~3 ;/* @@ -625,17 +630,17 @@ static void pointlocation(data_t *data, planeinfos *p, drmModeModeInfo *mode,*/ p[c].x1 -= mode->hdisplay &2 ; }else { - p[c].x1 = (int32_t )(data->planepos[c].x *min (TEST_MAX_WIDTH , mode->hdisplay)); + p[c].x1 = (int32_t )(data->planepos[c].x *TEST_WIDTH (mode)); p[c].x1 &= ~3 ; }if (data->planepos[c].origo & p_bottom) { - p[c].y1 = (int32_t )(data->planepos[c].y *min (TEST_MAX_HEIGHT , mode->vdisplay) + p[c].y1 = (int32_t )(data->planepos[c].y *TEST_HEIGHT (mode) + mode->vdisplay); p[c].y1 &= ~3 ; p[c].y1 -= mode->vdisplay &2 ; }else { - p[c].y1 = (int32_t )(data->planepos[c].y *min (TEST_MAX_HEIGHT , mode->vdisplay)); + p[c].y1 = (int32_t )(data->planepos[c].y *TEST_HEIGHT (mode)); p[c].y1 &= ~3 ; } }@@ -698,8 +703,8 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)igt_display_require_output (display);igt_display_commit2 (display,COMMIT_ATOMIC ); - used_w =min (TEST_MAX_WIDTH , mode->hdisplay); - used_h =min (TEST_MAX_HEIGHT , mode->vdisplay); + used_w =TEST_WIDTH (mode); + used_h =TEST_HEIGHT (mode); p[0 ].plane =igt_output_get_plane_type (output,DRM_PLANE_TYPE_PRIMARY ); p[1 ].plane =igt_output_get_plane_type (output,DRM_PLANE_TYPE_OVERLAY );tests/kms_setmode.c +0
-1@@ -421,15 +421,8 @@ static int test_stealing(int fd, struct crtc_config *crtc, uint32_t *ids)return ret; } -static double frame_time (const drmModeModeInfo *kmode)
tests/kms_setmode.c static int test_stealing(int fd, struct crtc_config *crtc, uint32_t *ids) · line 425
Quoted 10 lines
tests/kms_setmode.c +2
-8-{ -return 1000.0 * kmode->htotal * kmode->vtotal / kmode->clock; -} - -static double line_time (const drmModeModeInfo *kmode) -{ -return 1000.0 * kmode->htotal / kmode->clock; -} +#define frame_time (km) (1000.0 * (km)->htotal * (km)->vtotal / (km)->clock) +#define line_time (km) (1000.0 * (km)->htotal / (km)->clock)
These changes in kms_setmode also don't match typechecking patch subject and should be part of another patch IMO.
Other changes with typechecking looks ok. I would split this patch to three - memory regions changes, change function to definitions in kms_setmode and typechecking.
--
Zbigniew
Quoted 39 lines
tests/kms_setmode.c +0
-0static void check_timings (int crtc_idx,const drmModeModeInfo *kmode) {tests/sw_sync.c +3
-2@@ -837,8 +837,9 @@ igt_main igt_fixture {igt_require_sw_sync (); multi_consumer_threads = -min (multi_consumer_threads, -sysconf (_SC_NPROCESSORS_ONLN)); +min_t (multi_consumer_threads, + multi_consumer_threads, +sysconf (_SC_NPROCESSORS_ONLN)); }igt_subtest ("alloc_timeline" )tools/intel_vbt_decode.c +2
-1@@ -534,10 +534,11 @@ static void dump_child_devices(struct context *context, const uint8_t *devices,* initialized to zero. */ child =calloc (1 ,sizeof (*child)); +igt_assert (child);for (i =0 ; i < child_dev_num; i++) {memcpy (child, devices + i * child_dev_size, -min (sizeof (*child), child_dev_size)); +min_t (child_dev_size,sizeof (*child), child_dev_size));dump_child_device (context, child); }Signature · 1 line
2.33.0
Re: [igt-dev] [PATCH i-g-t 2/2] lib: Typechecking minmax
In reply to Ashutosh DixitQuoted 8 lines · Ashutosh Dixit
From: Chris Wilson <[email protected]>
Add typechecking to the min/max macros and make their locals truly unique-ish to reduce the risk of shadowing.
v2: small bug fix, write also height coordinate on rotation
test. (jheikkil)
v3: Fix up a couple of other max/max_t instances (Ashutosh)
Ok, I've discussed with Chris - we can take this patch as a whole without splitting. So:
--
Zbigniew
Quoted 626 lines
Signed-off-by Juha-Pekka Heikkilä <[email protected]>Signed-off-by Ashutosh Dixit <[email protected]>Signed-off-by Chris Wilson <[email protected]>--- lib/i915/intel_memory_region.c | 9 ++---- lib/i915/intel_memory_region.h | 2 +- lib/igt_aux.h | 48 ++++++++++++++++++++---------- lib/igt_fb.c | 13 ++++---- lib/intel_allocator.c | 2 +- lib/intel_allocator_random.c | 2 +- lib/intel_allocator_reloc.c | 2 +- runner/resultgen.c | 7 +++-- tests/i915/api_intel_bb.c | 2 +- tests/i915/gem_eio.c | 4 +-- tests/i915/gem_exec_alignment.c | 4 +-- tests/i915/gem_exec_capture.c | 2 +- tests/i915/gem_exec_fair.c | 2 +- tests/i915/gem_stress.c | 2 +- tests/i915/gem_tiled_swapping.c | 5 ++-- tests/i915/gem_userptr_blits.c | 2 +- tests/i915/i915_pm_rc6_residency.c | 2 +- tests/i915/kms_big_fb.c | 2 +- tests/i915/perf_pmu.c | 2 +- tests/kms_atomic_transition.c | 2 +- tests/kms_chamelium.c | 2 +- tests/kms_content_protection.c | 4 +-- tests/kms_invalid_mode.c | 4 +-- tests/kms_multipipe_modeset.c | 3 +- tests/kms_rotation_crc.c | 21 ++++++++----- tests/kms_setmode.c | 11 ++----- tests/sw_sync.c | 5 ++-- tools/intel_vbt_decode.c | 3 +- 28 files changed, 93 insertions(+), 76 deletions(-)lib/i915/intel_memory_region.c +3
-6@@ -146,19 +146,16 @@ out:* * Returns: Number of found lmem regions. */ -uint8_t gem_get_lmem_region_count (int fd) +unsigned int gem_get_lmem_region_count (int fd) {struct drm_i915_query_memory_regions *query_info; -uint8_t num_regions; -uint8_t lmem_regions =0 ; +unsigned int lmem_regions =0 ; query_info =gem_get_query_memory_regions (fd);if (!query_info) goto out; - num_regions = query_info->num_regions; - -for (int i =0 ; i < num_regions; i++) { +for (unsigned int i =0 ; i < query_info->num_regions; i++) {if (query_info->regions[i].region.memory_class ==I915_MEMORY_CLASS_DEVICE ) lmem_regions +=1 ; }lib/i915/intel_memory_region.h +1
-1@@ -58,7 +58,7 @@ uint32_t gem_get_batch_size(int fd, uint8_t mem_region_type);struct drm_i915_query_memory_regions *gem_get_query_memory_regions (int fd); -uint8_t gem_get_lmem_region_count (int fd); +unsigned int gem_get_lmem_region_count (int fd);bool gem_has_lmem (int fd);lib/igt_aux.h +33
-15@@ -40,6 +40,8 @@#include <i915/gem_submission.h> +#include "igt_core.h" +/* signal interrupt helpers */ #ifdef __linux__# ifndef HAVE_GETTID @@ -212,26 +214,42 @@ void intel_require_files(uint64_t count);#define CHECK_RAM 0x1#define CHECK_SWAP 0x2 -#define min (a, b) ({ \ - typeof(a) _a = (a); \ - typeof(b) _b = (b); \ - _a < _b ? _a : _b; \ -}) -#define max (a, b) ({ \ - typeof(a) _a = (a); \ - typeof(b) _b = (b); \ - _a > _b ? _a : _b; \ -}) +#define __typecheck (x, y) \ + (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1))) -#define clamp (x, min, max) ({ \ - typeof(min) _min = (min); \ - typeof(max) _max = (max); \ - typeof(x) _x = (x); \ - _x < _min ? _min : _x > _max ? _max : _x; \ +#define __cmp (x, y, op) ((x) op (y) ? (x) : (y)) + +#define __cmp_once (x, y, unique_x, unique_y, op) ({ \ + typeof(x) unique_x = (x); \ + typeof(y) unique_y = (y); \ + __cmp(unique_x, unique_y, op); \ }) +#define __is_constexpr (x) \ + (sizeof(int) == sizeof(*(8 ? ((void *)((long)(x) * 0l)) : (int *)8))) + +#define __no_side_effects (x, y) \ + (__is_constexpr(x) && __is_constexpr(y)) + +#define __safe_cmp (x, y) \ + (__typecheck(x, y) && __no_side_effects(x, y)) + +#define __careful_cmp (x, y, op, prefix) \ + __builtin_choose_expr(__safe_cmp(x, y), \ + __cmp(x, y, op), \ + __cmp_once(x, y, igt_unique(igt_tokencat(prefix, __x)), igt_unique(igt_tokencat(prefix, __y)), op)) + +#define min (x, y) __careful_cmp(x, y, <, min) +#define max (x, y) __careful_cmp(x, y, >, max) + +#define clamp (val, lo, hi) min(max(val, lo), hi) + +#define min_t (t, x, y) __careful_cmp((typeof(t))x, (typeof(t))y, <, min_t) +#define max_t (t, x, y) __careful_cmp((typeof(t))x, (typeof(t))y, >, max_t) +#define igt_swap (a, b) do { \ typeof(a) _tmp = (a); \ + _Static_assert(__typecheck(a, b), "type mismatch for swap"); \ (a) = (b); \ (b) = _tmp; \ } while (0)lib/igt_fb.c +5
-8@@ -733,7 +733,7 @@ static uint32_t calc_plane_stride(struct igt_fb *fb, int plane)* tiled. But then that failure is expected. */ - stride =max (min_stride,512 ); + stride =max (min_stride,512u ); stride =roundup_power_of_two (stride);return stride;@@ -747,7 +747,7 @@ static uint32_t calc_plane_stride(struct igt_fb *fb, int plane)/* * For amdgpu device with tiling mode */ -unsigned int tile_width, tile_height; +uint32_t tile_width, tile_height;igt_amd_fb_calculate_tile_dimension (fb->plane_bpp[plane], &tile_width, &tile_height);@@ -812,9 +812,9 @@ static uint64_t calc_plane_size(struct igt_fb *fb, int plane)if (fb->modifier !=DRM_FORMAT_MOD_NONE &&is_i915_device (fb->fd) &&intel_display_ver (intel_get_drm_devid (fb->fd)) <=3 ) { -uint64_t min_size = (uint64_t ) fb->strides[plane] * +uint64_t size = (uint64_t ) fb->strides[plane] * fb->plane_height[plane]; -uint64_t size; +uint64_t min_size =1024 *1024 ;/* Round the tiling up to the next power-of-two and the region * up to the next pot fence size so that this works on all @@ -824,10 +824,7 @@ static uint64_t calc_plane_size(struct igt_fb *fb, int plane)* tiled. But then that failure is expected. */ - size =max (min_size,1024 *1024 ); - size =roundup_power_of_two (size); - -return size; +return roundup_power_of_two (max (size, min_size)); }else if (fb->modifier !=DRM_FORMAT_MOD_NONE &&is_amdgpu_device (fb->fd)) {/* * For amdgpu device with tiling mode lib/intel_allocator.c +1
-1@@ -1088,7 +1088,7 @@ uint64_t __intel_allocator_alloc(uint64_t allocator_handle, uint32_t handle,struct alloc_resp resp;igt_assert ((alignment & (alignment-1 )) ==0 ); - req.alloc.alignment =max (alignment,1 <<12 ); + req.alloc.alignment =max_t (uint64_t, alignment,1 <<12 );igt_assert (handle_request (&req, &resp) ==0 );igt_assert (resp.response_type ==RESP_ALLOC );lib/intel_allocator_random.c +1
-1@@ -180,7 +180,7 @@ intel_allocator_random_create(int fd, uint64_t start, uint64_t end)igt_assert (ial->priv); ialr->prng = (uint32_t )to_user_pointer (ial); - start =max (start,BIAS ); + start =max_t (uint64_t, start,BIAS );igt_assert (start < end); ialr->start = start; ialr->end = end;lib/intel_allocator_reloc.c +1
-1@@ -176,7 +176,7 @@ intel_allocator_reloc_create(int fd, uint64_t start, uint64_t end)igt_assert (ial->priv); ialr->prng = (uint32_t )to_user_pointer (ial); - start =max (start,BIAS ); + start =max_t (uint64_t, start,BIAS );igt_assert (start < end); ialr->offset = ialr->start = start; ialr->end = end;runner/resultgen.c +5
-2@@ -481,12 +481,15 @@ static int find_subtest_idx_limited(struct matches matches,if (line_len <0 )return -1 ; -for (k = first; k < last; k++) +for (k = first; k < last; k++) { +ptrdiff_t rem = bufend - matches.items[k].where; +if (matches.items[k].what == linekey && !memcmp (matches.items[k].where, full_line, -min (line_len, bufend - matches.items[k].where))) +min_t (ptrdiff_t, line_len, rem)))break ; + }free (full_line);tests/i915/api_intel_bb.c +1
-1@@ -904,7 +904,7 @@ static int compare_bufs(struct intel_buf *buf1, struct intel_buf *buf2,return ret; } -#define LINELEN 76 +#define LINELEN 76ulstatic int dump_base64 (const char *name,struct intel_buf *buf) {void *ptr;tests/i915/gem_eio.c +2
-2@@ -489,7 +489,7 @@ static void test_inflight(int fd, unsigned int wait) max =gem_measure_ring_inflight (fd,-1 ,0 );igt_require (max >1 ); - max =min (max -1 ,ARRAY_SIZE (fence)); + max =min_t (max, max -1 ,ARRAY_SIZE (fence));igt_debug ("Using %d inflight batches\n" , max);for_each_ring (e, parent_fd) {@@ -558,7 +558,7 @@ static void test_inflight_suspend(int fd) max =gem_measure_ring_inflight (fd,-1 ,0 );igt_require (max >1 ); - max =min (max -1 ,ARRAY_SIZE (fence)); + max =min_t (max, max -1 ,ARRAY_SIZE (fence));igt_debug ("Using %d inflight batches\n" , max); fd =reopen_device (fd);tests/i915/gem_exec_alignment.c +2
-2@@ -166,7 +166,7 @@ naughty_child(int i915, int link, uint32_t shared, unsigned int flags)if (!gem_uses_full_ppgtt (i915)) gtt_size /=2 ;/* We have to *share* our GTT! */ - ram_size =min (intel_get_total_ram_mb (),4096 ); + ram_size =min_t (uint64_t,intel_get_total_ram_mb (),4096 ); ram_size *=1024 *1024 ; count =min (gtt_size, ram_size) /16384 ;@@ -376,7 +376,7 @@ setup_many(int i915, unsigned long *out)if (!gem_uses_full_ppgtt (i915)) gtt_size /=2 ;/* We have to *share* our GTT! */ - ram_size =min (intel_get_total_ram_mb (),4096 ); + ram_size =min_t (uint64_t,intel_get_total_ram_mb (),4096 ); ram_size *=1024 *1024 ; count =min (gtt_size, ram_size) /16384 ;tests/i915/gem_exec_capture.c +1
-1@@ -566,7 +566,7 @@ static void prioinv(int fd, int dir, const intel_ctx_t *ctx, gtt, ram); count =min (gtt, ram) /4 ; - count =min (count,256 );/* Keep the duration within reason */ + count =min (count,256ul );/* Keep the duration within reason */ igt_require (count >1 );intel_require_memory (count, size,CHECK_RAM );tests/i915/gem_exec_fair.c +1
-1@@ -605,7 +605,7 @@ static void fair_child(int i915, const intel_ctx_t *ctx, map =gem_mmap__device_coherent (i915, obj[0 ].handle,0 ,4096 ,PROT_WRITE );igt_assert (map[0 ]); -for (n =1 ; n <min (count,512 ); n++) { +for (n =1 ; n <min (count,512ul ); n++) {igt_assert (map[n]); map[n -1 ] = map[n] - map[n -1 ]; }tests/i915/gem_stress.c +1
-1@@ -769,7 +769,7 @@ static void init(void)if (options.num_buffers ==0 ) { tmp =gem_aperture_size (drm_fd); - tmp =min (256 * (1024 *1024 ), tmp); + tmp =min (256 *1024 *1024u , tmp); num_buffers =2 * tmp / options.scratch_buf_size /3 ; num_buffers /=2 ;igt_info ("using %u buffers\n" , num_buffers);tests/i915/gem_tiled_swapping.c +3
-2@@ -67,7 +67,7 @@ IGT_TEST_DESCRIPTION("Exercise swizzle code for swapping.");static uint32_t current_tiling_mode;#define PAGE_SIZE 4096 -#define AVAIL_RAM 512 +#define AVAIL_RAM 512ulstatic uint32_t create_bo (int fd)@@ -183,7 +183,8 @@ igt_main/* lock RAM, leaving only 512MB available */ count =intel_get_total_ram_mb () -intel_get_avail_ram_mb (); count =max (count +64 ,AVAIL_RAM ); - lock_size =max (0 ,intel_get_total_ram_mb () - count); + count =intel_get_total_ram_mb () - count; + lock_size =max_t (long,0 , count); igt_info("Mlocking %zdMiB of %ld/%ldMiB\n", lock_size, (long)intel_get_avail_ram_mb(),tests/i915/gem_userptr_blits.c +1
-1@@ -1693,7 +1693,7 @@ static void test_forking_evictions(int fd, int size, int count,* processes meaning swapping will be triggered system * wide even if one process on it's own can't do it. */ - num_threads =min (sysconf (_SC_NPROCESSORS_ONLN) *4 ,12 ); + num_threads =min_t (int,sysconf (_SC_NPROCESSORS_ONLN) *4 ,12 ); trash_count /= num_threads;if (count > trash_count) count = trash_count;tests/i915/i915_pm_rc6_residency.c +1
-1@@ -345,7 +345,7 @@ static void bg_load(int i915, unsigned int flags, unsigned long *ctl) ctl[1 ]++;/* aim for ~1% busy */ -usleep (min (elapsed /10 ,50 *1000 )); +usleep (min_t (elapsed, elapsed /10 ,50 *1000 )); }while (!READ_ONCE (*ctl)); }tests/i915/kms_big_fb.c +1
-1@@ -400,9 +400,9 @@ static bool test_plane(data_t *data)static bool test_pipe (data_t *data) { +uint16_t width, height;drmModeModeInfo *mode;igt_plane_t *primary; -int width, height;bool ret = false; if (data->format == DRM_FORMAT_C8 &&tests/i915/perf_pmu.c +1
-1@@ -1413,7 +1413,7 @@ static int target_num_interrupts(int i915) {const intel_ctx_cfg_t cfg =intel_ctx_cfg_all_physical (i915); -return min (gem_submission_measure (i915, &cfg,I915_EXEC_DEFAULT ),30 ); +return min (gem_submission_measure (i915, &cfg,I915_EXEC_DEFAULT ),30u ); } static voidtests/kms_atomic_transition.c +1
-1@@ -789,7 +789,7 @@ static void run_modeset_tests(data_t *data, int howmany, bool nonblocking, boolunsigned iter_max;igt_pipe_crc_t *pipe_crcs[IGT_MAX_PIPES ] = {0 };igt_output_t *output; -unsigned width =0 , height =0 ; +uint16_t width =0 , height =0 ;for (i =0 ; i < data->display.n_outputs; i++)igt_output_set_pipe (&data->display.outputs[i],PIPE_NONE );tests/kms_chamelium.c +1
-1@@ -2399,7 +2399,7 @@ static void test_display_planes_random(data_t *data,igt_output_count_plane_type (output,DRM_PLANE_TYPE_OVERLAY );/* Limit the number of planes to a reasonable scene. */ - overlay_planes_max =min (overlay_planes_max,4 ); + overlay_planes_max =min (overlay_planes_max,4u ); overlay_planes_count = (rand () % overlay_planes_max) +1 ;igt_debug ("Using %d overlay planes\n" , overlay_planes_count);tests/kms_content_protection.c +2
-2@@ -703,9 +703,9 @@ static void test_content_protection_cleanup(void)static void create_fbs (void ) { -igt_output_t *output; -int width =0 , height =0 ; +uint16_t width =0 , height =0 ;drmModeModeInfo *mode; +igt_output_t *output;for_each_connected_output (&data.display, output) { mode =igt_output_get_mode (output);tests/kms_invalid_mode.c +2
-2@@ -195,8 +195,8 @@ test_output(data_t *data)return 0 ;igt_create_fb (data->drm_fd, -max (mode.hdisplay,64 ), -max (mode.vdisplay,64 ), +max_t (uint16_t, mode.hdisplay,64 ), +max_t (uint16_t, mode.vdisplay,64 ),DRM_FORMAT_XRGB8888 ,DRM_FORMAT_MOD_NONE , &fb);tests/kms_multipipe_modeset.c +2
-1@@ -40,10 +40,11 @@ static void run_test(data_t *data, int valid_outputs)igt_pipe_crc_t *pipe_crcs[IGT_MAX_PIPES ] = {0 };igt_crc_t ref_crcs[IGT_MAX_PIPES ], new_crcs[IGT_MAX_PIPES ];igt_display_t *display = &data->display; -int width =0 , height =0 , i =0 ; +uint16_t width =0 , height =0 ;igt_pipe_t *pipe;igt_plane_t *plane;drmModeModeInfo *mode; +int i =0 ;for_each_connected_output (display, output) { mode =igt_output_get_mode (output);tests/kms_rotation_crc.c +13
-8@@ -214,6 +214,11 @@ static void prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe,igt_pipe_crc_start (data->pipe_crc); } +#define TEST_WIDTH (km) \ + min_t((km)->hdisplay, (km)->hdisplay, TEST_MAX_WIDTH) +#define TEST_HEIGHT (km) \ + min_t((km)->vdisplay, (km)->vdisplay, TEST_MAX_HEIGHT) +static void prepare_fbs (data_t *data,igt_output_t *output,igt_plane_t *plane,enum rectangle_type rect,uint32_t format) {@@ -234,8 +239,8 @@ static void prepare_fbs(data_t *data, igt_output_t *output, w = mode->hdisplay; h = mode->vdisplay; }else { - w =min (TEST_MAX_WIDTH , mode->hdisplay); - h =min (TEST_MAX_HEIGHT , mode->vdisplay); + w =TEST_WIDTH (mode); + h =TEST_HEIGHT (mode); } min_w =256 ;@@ -614,7 +619,7 @@ static void pointlocation(data_t *data, planeinfos *p, drmModeModeInfo *mode, int c) {if (data->planepos[c].origo & p_right) { - p[c].x1 = (int32_t )(data->planepos[c].x *min (TEST_MAX_WIDTH , mode->hdisplay) + p[c].x1 = (int32_t )(data->planepos[c].x *TEST_WIDTH (mode) + mode->hdisplay); p[c].x1 &= ~3 ;/* @@ -625,17 +630,17 @@ static void pointlocation(data_t *data, planeinfos *p, drmModeModeInfo *mode,*/ p[c].x1 -= mode->hdisplay &2 ; }else { - p[c].x1 = (int32_t )(data->planepos[c].x *min (TEST_MAX_WIDTH , mode->hdisplay)); + p[c].x1 = (int32_t )(data->planepos[c].x *TEST_WIDTH (mode)); p[c].x1 &= ~3 ; }if (data->planepos[c].origo & p_bottom) { - p[c].y1 = (int32_t )(data->planepos[c].y *min (TEST_MAX_HEIGHT , mode->vdisplay) + p[c].y1 = (int32_t )(data->planepos[c].y *TEST_HEIGHT (mode) + mode->vdisplay); p[c].y1 &= ~3 ; p[c].y1 -= mode->vdisplay &2 ; }else { - p[c].y1 = (int32_t )(data->planepos[c].y *min (TEST_MAX_HEIGHT , mode->vdisplay)); + p[c].y1 = (int32_t )(data->planepos[c].y *TEST_HEIGHT (mode)); p[c].y1 &= ~3 ; } }@@ -698,8 +703,8 @@ static void test_multi_plane_rotation(data_t *data, enum pipe pipe)igt_display_require_output (display);igt_display_commit2 (display,COMMIT_ATOMIC ); - used_w =min (TEST_MAX_WIDTH , mode->hdisplay); - used_h =min (TEST_MAX_HEIGHT , mode->vdisplay); + used_w =TEST_WIDTH (mode); + used_h =TEST_HEIGHT (mode); p[0 ].plane =igt_output_get_plane_type (output,DRM_PLANE_TYPE_PRIMARY ); p[1 ].plane =igt_output_get_plane_type (output,DRM_PLANE_TYPE_OVERLAY );tests/kms_setmode.c +2
-9@@ -421,15 +421,8 @@ static int test_stealing(int fd, struct crtc_config *crtc, uint32_t *ids)return ret; } -static double frame_time (const drmModeModeInfo *kmode) -{ -return 1000.0 * kmode->htotal * kmode->vtotal / kmode->clock; -} - -static double line_time (const drmModeModeInfo *kmode) -{ -return 1000.0 * kmode->htotal / kmode->clock; -} +#define frame_time (km) (1000.0 * (km)->htotal * (km)->vtotal / (km)->clock) +#define line_time (km) (1000.0 * (km)->htotal / (km)->clock)static void check_timings (int crtc_idx,const drmModeModeInfo *kmode) {tests/sw_sync.c +3
-2@@ -837,8 +837,9 @@ igt_main igt_fixture {igt_require_sw_sync (); multi_consumer_threads = -min (multi_consumer_threads, -sysconf (_SC_NPROCESSORS_ONLN)); +min_t (multi_consumer_threads, + multi_consumer_threads, +sysconf (_SC_NPROCESSORS_ONLN)); }igt_subtest ("alloc_timeline" )tools/intel_vbt_decode.c +2
-1@@ -534,10 +534,11 @@ static void dump_child_devices(struct context *context, const uint8_t *devices,* initialized to zero. */ child =calloc (1 ,sizeof (*child)); +igt_assert (child);for (i =0 ; i < child_dev_num; i++) {memcpy (child, devices + i * child_dev_size, -min (sizeof (*child), child_dev_size)); +min_t (child_dev_size,sizeof (*child), child_dev_size));dump_child_device (context, child); }Signature · 1 line
2.33.0
Patchwork
CI[igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] lib: Refactor construction of unique tokens
In reply to Ashutosh Dixit== Series Details ==
== Series Details ==
Series: series starting with [i-g-t,1/2] lib: Refactor construction of unique tokens
URL : https://patchwork.freedesktop.org/series/95485/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_10685 -> IGTPW_6291
====================================================
Summary
-------
**SUCCESS**
No regressions found.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/index.html
Known issues
------------
Here are the changes found in IGTPW_6291 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_exec_suspend@basic-s0:
- fi-cfl-8109u: [PASS][1] -> [INCOMPLETE][2] ([i915#155])
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10685/fi-cfl-8109u/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/fi-cfl-8109u/igt@[email protected]
#### Possible fixes ####
* igt@core_hotunplug@unbind-rebind:
- fi-tgl-u2: [INCOMPLETE][3] -> [PASS][4]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10685/fi-tgl-u2/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/fi-tgl-u2/igt@[email protected]
* igt@gem_exec_suspend@basic-s3:
- fi-tgl-u2: [FAIL][5] ([i915#1888]) -> [PASS][6]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10685/fi-tgl-u2/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/fi-tgl-u2/igt@[email protected]
* igt@kms_frontbuffer_tracking@basic:
- fi-cml-u2: [DMESG-WARN][7] ([i915#95]) -> [PASS][8]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10685/fi-cml-u2/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/fi-cml-u2/igt@[email protected]
[i915#155]: https://gitlab.freedesktop.org/drm/intel/issues/155
[i915#1888]: https://gitlab.freedesktop.org/drm/intel/issues/1888
[i915#95]: https://gitlab.freedesktop.org/drm/intel/issues/95
Participating hosts (41 -> 21)
------------------------------
Missing (20): fi-kbl-soraka fi-ilk-m540 bat-dg1-6 fi-bsw-n3050 fi-hsw-4200u fi-glk-dsi fi-icl-u2 fi-bwr-2160 fi-apl-guc fi-snb-2520m fi-ctg-p8600 fi-tgl-1115g4 fi-bsw-cyan bat-adlp-4 fi-ivb-3770 fi-icl-y fi-bsw-kefka fi-bsw-nick bat-jsl-1 fi-kbl-r
Build changes
-------------
* CI: CI-20190529 -> None
* IGT: IGT_6232 -> IGTPW_6291
CI-20190529: 20190529
CI_DRM_10685: 36c3656c997b07f326d6b967efb1b75e01713773 @ git://anongit.freedesktop.org/gfx-ci/linux
IGTPW_6291: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/index.html
IGT_6232: effad6af5678be711a2c3e58e182319de784de54 @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/index.html
Patchwork
CI[igt-dev] ✗ Fi.CI.IGT: failure for series starting with [i-g-t,1/2] lib: Refactor construction of unique tokens
In reply to Ashutosh Dixit== Series Details ==
== Series Details ==
Series: series starting with [i-g-t,1/2] lib: Refactor construction of unique tokens
URL : https://patchwork.freedesktop.org/series/95485/
State : failure
== Summary ==
CI Bug Log - changes from CI_DRM_10685_full -> IGTPW_6291_full
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with IGTPW_6291_full absolutely need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in IGTPW_6291_full, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/index.html
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in IGTPW_6291_full:
### IGT changes ###
#### Possible regressions ####
* igt@kms_writeback@writeback-invalid-parameters:
- shard-tglb: NOTRUN -> [SKIP][1]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-tglb3/igt@[email protected]
- shard-iclb: NOTRUN -> [SKIP][2]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-iclb3/igt@[email protected]
#### Warnings ####
* igt@kms_writeback@writeback-check-output:
- shard-iclb: [SKIP][3] ([i915#2437]) -> [SKIP][4] +2 similar issues
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10685/shard-iclb1/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-iclb3/igt@[email protected]
* igt@kms_writeback@writeback-fb-id:
- shard-tglb: [SKIP][5] ([i915#2437]) -> [SKIP][6] +2 similar issues
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10685/shard-tglb5/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-tglb3/igt@[email protected]
Known issues
------------
Here are the changes found in IGTPW_6291_full that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@feature_discovery@display-2x:
- shard-tglb: NOTRUN -> [SKIP][7] ([i915#1839])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-tglb3/igt@[email protected]
* igt@gem_ctx_persistence@legacy-engines-mixed:
- shard-snb: NOTRUN -> [SKIP][8] ([fdo#109271] / [i915#1099]) +4 similar issues
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-snb2/igt@[email protected]
* igt@gem_exec_fair@basic-none-share@rcs0:
- shard-iclb: [PASS][9] -> [FAIL][10] ([i915#2842])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10685/shard-iclb6/igt@gem_exec_fair@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-iclb3/igt@gem_exec_fair@[email protected]
- shard-glk: [PASS][11] -> [FAIL][12] ([i915#2842])
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10685/shard-glk2/igt@gem_exec_fair@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-glk3/igt@gem_exec_fair@[email protected]
* igt@gem_exec_fair@basic-none@rcs0:
- shard-kbl: [PASS][13] -> [FAIL][14] ([i915#2842])
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10685/shard-kbl3/igt@gem_exec_fair@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-kbl3/igt@gem_exec_fair@[email protected]
* igt@gem_exec_fair@basic-throttle@rcs0:
- shard-glk: NOTRUN -> [FAIL][15] ([i915#2842])
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-glk3/igt@gem_exec_fair@[email protected]
* igt@gem_exec_whisper@basic-queues-forked-all:
- shard-glk: [PASS][16] -> [DMESG-WARN][17] ([i915#118] / [i915#95]) +1 similar issue
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10685/shard-glk8/igt@[email protected]
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-glk2/igt@[email protected]
* igt@gem_huc_copy@huc-copy:
- shard-apl: NOTRUN -> [SKIP][18] ([fdo#109271] / [i915#2190])
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-apl6/igt@[email protected]
* igt@gem_media_vme:
- shard-tglb: NOTRUN -> [SKIP][19] ([i915#284])
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-tglb1/igt@gem_media_vme.html
* igt@gem_render_copy@linear-to-vebox-y-tiled:
- shard-iclb: NOTRUN -> [SKIP][20] ([i915#768]) +1 similar issue
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-iclb7/igt@[email protected]
* igt@gem_softpin@evict-snoop:
- shard-iclb: NOTRUN -> [SKIP][21] ([fdo#109312])
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-iclb3/igt@[email protected]
- shard-tglb: NOTRUN -> [SKIP][22] ([fdo#109312])
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-tglb3/igt@[email protected]
* igt@gem_userptr_blits@dmabuf-sync:
- shard-kbl: NOTRUN -> [SKIP][23] ([fdo#109271] / [i915#3323])
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-kbl7/igt@[email protected]
- shard-iclb: NOTRUN -> [SKIP][24] ([i915#3323])
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-iclb2/igt@[email protected]
- shard-apl: NOTRUN -> [SKIP][25] ([fdo#109271] / [i915#3323])
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-apl1/igt@[email protected]
- shard-glk: NOTRUN -> [SKIP][26] ([fdo#109271] / [i915#3323])
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-glk7/igt@[email protected]
- shard-tglb: NOTRUN -> [SKIP][27] ([i915#3323])
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-tglb1/igt@[email protected]
* igt@gem_userptr_blits@readonly-pwrite-unsync:
- shard-tglb: NOTRUN -> [SKIP][28] ([i915#3297])
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-tglb1/igt@[email protected]
- shard-iclb: NOTRUN -> [SKIP][29] ([i915#3297])
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-iclb1/igt@[email protected]
* igt@gem_userptr_blits@vma-merge:
- shard-snb: NOTRUN -> [FAIL][30] ([i915#2724])
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-snb2/igt@[email protected]
* igt@gem_workarounds@suspend-resume-fd:
- shard-kbl: NOTRUN -> [DMESG-WARN][31] ([i915#180])
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-kbl6/igt@[email protected]
* igt@gen3_render_tiledy_blits:
- shard-tglb: NOTRUN -> [SKIP][32] ([fdo#109289]) +3 similar issues
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-tglb7/igt@gen3_render_tiledy_blits.html
* igt@gen7_exec_parse@basic-allowed:
- shard-iclb: NOTRUN -> [SKIP][33] ([fdo#109289])
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-iclb5/igt@[email protected]
* igt@gen9_exec_parse@bb-secure:
- shard-tglb: NOTRUN -> [SKIP][34] ([i915#2856]) +1 similar issue
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-tglb8/igt@[email protected]
* igt@i915_pm_lpsp@screens-disabled:
- shard-tglb: NOTRUN -> [SKIP][35] ([i915#1902])
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-tglb3/igt@[email protected]
* igt@i915_pm_rc6_residency@media-rc6-accuracy:
- shard-tglb: NOTRUN -> [SKIP][36] ([fdo#109289] / [fdo#111719])
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-tglb6/igt@[email protected]
* igt@i915_pm_rc6_residency@rc6-idle:
- shard-tglb: NOTRUN -> [WARN][37] ([i915#2681] / [i915#2684])
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-tglb1/igt@[email protected]
- shard-iclb: NOTRUN -> [WARN][38] ([i915#2684])
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-iclb2/igt@[email protected]
* igt@i915_pm_rpm@pc8-residency:
- shard-tglb: NOTRUN -> [SKIP][39] ([fdo#109506] / [i915#2411])
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-tglb6/igt@[email protected]
* igt@i915_selftest@live@gt_lrc:
- shard-tglb: NOTRUN -> [DMESG-FAIL][40] ([i915#2373])
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-tglb5/igt@i915_selftest@live@gt_lrc.html
* igt@i915_selftest@live@gt_pm:
- shard-tglb: NOTRUN -> [DMESG-FAIL][41] ([i915#1759] / [i915#2291])
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-tglb5/igt@i915_selftest@live@gt_pm.html
* igt@i915_selftest@live@hangcheck:
- shard-snb: NOTRUN -> [INCOMPLETE][42] ([i915#3921])
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-snb6/igt@i915_selftest@[email protected]
* igt@kms_addfb_basic@invalid-smem-bo-on-discrete:
- shard-tglb: NOTRUN -> [SKIP][43] ([i915#3826])
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-tglb6/igt@[email protected]
- shard-iclb: NOTRUN -> [SKIP][44] ([i915#3826])
[44]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-iclb6/igt@[email protected]
* igt@kms_big_fb@linear-64bpp-rotate-270:
- shard-tglb: NOTRUN -> [SKIP][45] ([fdo#111614])
[45]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-tglb8/igt@[email protected]
* igt@kms_big_fb@x-tiled-max-hw-stride-64bpp-rotate-180-hflip:
- shard-apl: NOTRUN -> [SKIP][46] ([fdo#109271] / [i915#3777]) +3 similar issues
[46]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-apl2/igt@[email protected]
* igt@kms_big_fb@yf-tiled-32bpp-rotate-270:
- shard-iclb: [PASS][47] -> [DMESG-FAIL][48] ([i915#1226])
[47]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10685/shard-iclb1/igt@[email protected]
[48]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-iclb4/igt@[email protected]
* igt@kms_big_fb@yf-tiled-8bpp-rotate-270:
- shard-iclb: NOTRUN -> [SKIP][49] ([fdo#110723])
[49]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-iclb5/igt@[email protected]
* igt@kms_big_fb@yf-tiled-max-hw-stride-32bpp-rotate-0-hflip:
- shard-kbl: NOTRUN -> [SKIP][50] ([fdo#109271] / [i915#3777])
[50]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-kbl3/igt@[email protected]
* igt@kms_big_fb@yf-tiled-max-hw-stride-64bpp-rotate-0:
- shard-apl: NOTRUN -> [SKIP][51] ([fdo#109271]) +295 similar issues
[51]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-apl7/igt@[email protected]
* igt@kms_big_joiner@2x-modeset:
- shard-iclb: NOTRUN -> [SKIP][52] ([i915#2705])
[52]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-iclb2/igt@[email protected]
- shard-tglb: NOTRUN -> [SKIP][53] ([i915#2705])
[53]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-tglb1/igt@[email protected]
* igt@kms_ccs@pipe-a-random-ccs-data-y_tiled_gen12_rc_ccs_cc:
- shard-iclb: NOTRUN -> [SKIP][54] ([fdo#109278] / [i915#3886]) +2 similar issues
[54]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-iclb3/igt@kms_ccs@pipe-a-random-ccs-data-y_tiled_gen12_rc_ccs_cc.html
* igt@kms_ccs@pipe-b-ccs-on-another-bo-y_tiled_gen12_mc_ccs:
- shard-tglb: NOTRUN -> [SKIP][55] ([i915#3689] / [i915#3886]) +4 similar issues
[55]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-tglb5/igt@kms_ccs@pipe-b-ccs-on-another-bo-y_tiled_gen12_mc_ccs.html
* igt@kms_ccs@pipe-c-ccs-on-another-bo-y_tiled_gen12_mc_ccs:
- shard-kbl: NOTRUN -> [SKIP][56] ([fdo#109271] / [i915#3886]) +7 similar issues
[56]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-kbl7/igt@kms_ccs@pipe-c-ccs-on-another-bo-y_tiled_gen12_mc_ccs.html
* igt@kms_ccs@pipe-c-ccs-on-another-bo-y_tiled_gen12_rc_ccs_cc:
- shard-apl: NOTRUN -> [SKIP][57] ([fdo#109271] / [i915#3886]) +15 similar issues
[57]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-apl2/igt@kms_ccs@pipe-c-ccs-on-another-bo-y_tiled_gen12_rc_ccs_cc.html
* igt@kms_ccs@pipe-c-missing-ccs-buffer-y_tiled_gen12_rc_ccs_cc:
- shard-glk: NOTRUN -> [SKIP][58] ([fdo#109271] / [i915#3886]) +1 similar issue
[58]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-glk5/igt@kms_ccs@pipe-c-missing-ccs-buffer-y_tiled_gen12_rc_ccs_cc.html
* igt@kms_ccs@pipe-d-crc-sprite-planes-basic-y_tiled_ccs:
- shard-tglb: NOTRUN -> [SKIP][59] ([i915#3689]) +9 similar issues
[59]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-tglb2/igt@kms_ccs@pipe-d-crc-sprite-planes-basic-y_tiled_ccs.html
* igt@kms_cdclk@plane-scaling:
- shard-tglb: NOTRUN -> [SKIP][60] ([i915#3742])
[60]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-tglb2/igt@[email protected]
* igt@kms_chamelium@hdmi-hpd-storm:
- shard-kbl: NOTRUN -> [SKIP][61] ([fdo#109271] / [fdo#111827]) +13 similar issues
[61]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-kbl7/igt@[email protected]
* igt@kms_chamelium@vga-hpd:
- shard-apl: NOTRUN -> [SKIP][62] ([fdo#109271] / [fdo#111827]) +19 similar issues
[62]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-apl1/igt@[email protected]
* igt@kms_chamelium@vga-hpd-without-ddc:
- shard-snb: NOTRUN -> [SKIP][63] ([fdo#109271] / [fdo#111827]) +15 similar issues
[63]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-snb6/igt@[email protected]
* igt@kms_color@pipe-a-gamma:
- shard-tglb: [PASS][64] -> [FAIL][65] ([i915#1149])
[64]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10685/shard-tglb8/igt@[email protected]
[65]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-tglb2/igt@[email protected]
* igt@kms_color_chamelium@pipe-a-ctm-0-75:
- shard-iclb: NOTRUN -> [SKIP][66] ([fdo#109284] / [fdo#111827]) +1 similar issue
[66]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-iclb5/igt@[email protected]
* igt@kms_color_chamelium@pipe-c-ctm-0-5:
- shard-glk: NOTRUN -> [SKIP][67] ([fdo#109271] / [fdo#111827]) +6 similar issues
[67]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-glk6/igt@[email protected]
* igt@kms_color_chamelium@pipe-d-ctm-blue-to-red:
- shard-iclb: NOTRUN -> [SKIP][68] ([fdo#109278] / [fdo#109284] / [fdo#111827])
[68]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-iclb2/igt@[email protected]
* igt@kms_color_chamelium@pipe-d-ctm-red-to-blue:
- shard-tglb: NOTRUN -> [SKIP][69] ([fdo#109284] / [fdo#111827]) +10 similar issues
[69]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-tglb5/igt@[email protected]
* igt@kms_concurrent@pipe-a:
- shard-tglb: NOTRUN -> [FAIL][70] ([i915#1385])
[70]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-tglb3/igt@[email protected]
* igt@kms_content_protection@srm:
- shard-kbl: NOTRUN -> [TIMEOUT][71] ([i915#1319])
[71]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-kbl6/igt@[email protected]
* igt@kms_content_protection@uevent:
- shard-kbl: NOTRUN -> [FAIL][72] ([i915#2105])
[72]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-kbl7/igt@[email protected]
* igt@kms_cursor_crc@pipe-a-cursor-alpha-opaque:
- shard-iclb: [PASS][73] -> [FAIL][74] ([i915#3444])
[73]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10685/shard-iclb8/igt@[email protected]
[74]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-iclb6/igt@[email protected]
- shard-apl: [PASS][75] -> [FAIL][76] ([i915#3444])
[75]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10685/shard-apl8/igt@[email protected]
[76]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-apl6/igt@[email protected]
- shard-glk: [PASS][77] -> [FAIL][78] ([i915#3444])
[77]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10685/shard-glk7/igt@[email protected]
[78]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-glk6/igt@[email protected]
- shard-tglb: [PASS][79] -> [FAIL][80] ([i915#2124] / [i915#4024])
[79]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10685/shard-tglb6/igt@[email protected]
[80]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-tglb2/igt@[email protected]
- shard-snb: [PASS][81] -> [FAIL][82] ([i915#4024])
[81]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10685/shard-snb5/igt@[email protected]
[82]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-snb6/igt@[email protected]
* igt@kms_cursor_crc@pipe-b-cursor-32x10-random:
- shard-tglb: NOTRUN -> [SKIP][83] ([i915#3359]) +3 similar issues
[83]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-tglb6/igt@[email protected]
* igt@kms_cursor_crc@pipe-b-cursor-512x512-rapid-movement:
- shard-iclb: NOTRUN -> [SKIP][84] ([fdo#109278] / [fdo#109279]) +1 similar issue
[84]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-iclb4/igt@[email protected]
* igt@kms_cursor_crc@pipe-b-cursor-suspend:
- shard-apl: [PASS][85] -> [DMESG-WARN][86] ([i915#180])
[85]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10685/shard-apl8/igt@[email protected]
[86]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-apl3/igt@[email protected]
* igt@kms_cursor_crc@pipe-c-cursor-32x32-onscreen:
- shard-tglb: NOTRUN -> [SKIP][87] ([i915#3319]) +1 similar issue
[87]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-tglb7/igt@[email protected]
* igt@kms_cursor_crc@pipe-d-cursor-512x170-offscreen:
- shard-tglb: NOTRUN -> [SKIP][88] ([fdo#109279] / [i915#3359]) +4 similar issues
[88]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-tglb5/igt@[email protected]
* igt@kms_cursor_crc@pipe-d-cursor-suspend:
- shard-tglb: [PASS][89] -> [INCOMPLETE][90] ([i915#4211])
[89]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10685/shard-tglb2/igt@[email protected]
[90]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-tglb7/igt@[email protected]
* igt@kms_cursor_legacy@basic-busy-flip-before-cursor-atomic:
- shard-tglb: NOTRUN -> [SKIP][91] ([i915#4103])
[91]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-tglb8/igt@[email protected]
* igt@kms_cursor_legacy@cursorb-vs-flipa-atomic:
- shard-iclb: NOTRUN -> [SKIP][92] ([fdo#109274] / [fdo#109278])
[92]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-iclb4/igt@[email protected]
* igt@kms_cursor_legacy@pipe-d-torture-bo:
- shard-apl: NOTRUN -> [SKIP][93] ([fdo#109271] / [i915#533]) +1 similar issue
[93]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-apl1/igt@[email protected]
- shard-glk: NOTRUN -> [SKIP][94] ([fdo#109271] / [i915#533]) +1 similar issue
[94]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-glk4/igt@[email protected]
* igt@kms_flip@2x-plain-flip-interruptible:
- shard-iclb: NOTRUN -> [SKIP][95] ([fdo#109274]) +1 similar issue
[95]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-iclb3/igt@[email protected]
* igt@kms_flip@flip-vs-expired-vblank@c-dp1:
- shard-apl: NOTRUN -> [FAIL][96] ([i915#79])
[96]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-apl3/igt@kms_flip@[email protected]
* igt@kms_flip@flip-vs-suspend@c-dp1:
- shard-kbl: [PASS][97] -> [DMESG-WARN][98] ([i915#180]) +11 similar issues
[97]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10685/shard-kbl7/igt@kms_flip@[email protected]
[98]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-kbl1/igt@kms_flip@[email protected]
- shard-apl: NOTRUN -> [DMESG-WARN][99] ([i915#180]) +1 similar issue
[99]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-apl8/igt@kms_flip@[email protected]
* igt@kms_flip_scaled_crc@flip-32bpp-ytile-to-32bpp-ytilegen12rcccs:
- shard-apl: NOTRUN -> [SKIP][100] ([fdo#109271] / [i915#2672])
[100]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-apl8/igt@kms_flip_scaled_crc@flip-32bpp-ytile-to-32bpp-ytilegen12rcccs.html
* igt@kms_flip_scaled_crc@flip-64bpp-ytile-to-32bpp-ytilercccs:
- shard-kbl: NOTRUN -> [SKIP][101] ([fdo#109271] / [i915#2672])
[101]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-kbl3/igt@[email protected]
* igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-cur-indfb-draw-blt:
- shard-iclb: NOTRUN -> [SKIP][102] ([fdo#109280]) +14 similar issues
[102]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-iclb5/igt@[email protected]
* igt@kms_frontbuffer_tracking@fbcpsr-2p-primscrn-pri-indfb-draw-blt:
- shard-tglb: NOTRUN -> [SKIP][103] ([fdo#111825]) +41 similar issues
[103]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-tglb1/igt@kms_frontbuffer_tracking@fbcpsr-2p-primscrn-pri-indfb-draw-blt.html
* igt@kms_frontbuffer_tracking@psr-1p-primscrn-cur-indfb-onoff:
- shard-snb: NOTRUN -> [SKIP][104] ([fdo#109271]) +370 similar issues
[104]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-snb5/igt@[email protected]
* igt@kms_frontbuffer_tracking@psr-2p-scndscrn-spr-indfb-draw-render:
- shard-glk: NOTRUN -> [SKIP][105] ([fdo#109271]) +71 similar issues
[105]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-glk2/igt@kms_frontbuffer_tracking@psr-2p-scndscrn-spr-indfb-draw-render.html
* igt@kms_frontbuffer_tracking@psr-rgb101010-draw-mmap-wc:
- shard-kbl: NOTRUN -> [SKIP][106] ([fdo#109271]) +146 similar issues
[106]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-kbl7/igt@[email protected]
* igt@kms_hdr@static-toggle:
- shard-tglb: NOTRUN -> [SKIP][107] ([i915#1187])
[107]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-tglb5/igt@[email protected]
* igt@kms_plane@plane-panning-bottom-right-suspend@pipe-b-planes:
- shard-tglb: [PASS][108] -> [INCOMPLETE][109] ([i915#456])
[108]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10685/shard-tglb5/igt@kms_plane@[email protected]
[109]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-tglb7/igt@kms_plane@[email protected]
* igt@kms_plane_alpha_blend@pipe-c-alpha-basic:
- shard-apl: NOTRUN -> [FAIL][110] ([fdo#108145] / [i915#265]) +3 similar issues
[110]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-apl1/igt@[email protected]
* igt@kms_plane_alpha_blend@pipe-c-alpha-opaque-fb:
- shard-glk: NOTRUN -> [FAIL][111] ([fdo#108145] / [i915#265])
[111]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-glk1/igt@[email protected]
* igt@kms_plane_alpha_blend@pipe-c-alpha-transparent-fb:
- shard-apl: NOTRUN -> [FAIL][112] ([i915#265])
[112]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-apl1/igt@[email protected]
* igt@kms_plane_alpha_blend@pipe-d-constant-alpha-max:
- shard-iclb: NOTRUN -> [SKIP][113] ([fdo#109278]) +13 similar issues
[113]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-iclb2/igt@[email protected]
* igt@kms_plane_lowres@pipe-a-tiling-none:
- shard-tglb: NOTRUN -> [SKIP][114] ([i915#3536]) +2 similar issues
[114]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-tglb6/igt@[email protected]
* igt@kms_plane_scaling@scaler-with-clipping-clamping@pipe-c-scaler-with-clipping-clamping:
- shard-apl: NOTRUN -> [SKIP][115] ([fdo#109271] / [i915#2733])
[115]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-apl3/igt@kms_plane_scaling@scaler-with-clipping-clamping@pipe-c-scaler-with-clipping-clamping.html
* igt@kms_psr2_sf@cursor-plane-update-sf:
- shard-tglb: NOTRUN -> [SKIP][116] ([i915#2920]) +2 similar issues
[116]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-tglb2/igt@[email protected]
* igt@kms_psr2_sf@overlay-primary-update-sf-dmg-area-3:
- shard-iclb: NOTRUN -> [SKIP][117] ([i915#658])
[117]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-iclb7/igt@[email protected]
- shard-kbl: NOTRUN -> [SKIP][118] ([fdo#109271] / [i915#658]) +3 similar issues
[118]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-kbl3/igt@[email protected]
* igt@kms_psr2_sf@overlay-primary-update-sf-dmg-area-4:
- shard-apl: NOTRUN -> [SKIP][119] ([fdo#109271] / [i915#658]) +7 similar issues
[119]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-apl1/igt@[email protected]
* igt@kms_psr2_su@frontbuffer:
- shard-iclb: [PASS][120] -> [SKIP][121] ([fdo#109642] / [fdo#111068] / [i915#658])
[120]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10685/shard-iclb2/igt@[email protected]
[121]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-iclb3/igt@[email protected]
* igt@kms_psr2_su@page_flip:
- shard-glk: NOTRUN -> [SKIP][122] ([fdo#109271] / [i915#658]) +1 similar issue
[122]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-glk8/igt@kms_psr2_su@page_flip.html
* igt@kms_psr@psr2_cursor_mmap_gtt:
- shard-tglb: NOTRUN -> [FAIL][123] ([i915#132] / [i915#3467])
[123]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-tglb3/igt@kms_psr@psr2_cursor_mmap_gtt.html
* igt@kms_psr@psr2_sprite_blt:
- shard-iclb: [PASS][124] -> [SKIP][125] ([fdo#109441]) +1 similar issue
[124]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10685/shard-iclb2/igt@kms_psr@psr2_sprite_blt.html
[125]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-iclb8/igt@kms_psr@psr2_sprite_blt.html
* igt@kms_rotation_crc@primary-yf-tiled-reflect-x-0:
- shard-tglb: NOTRUN -> [SKIP][126] ([fdo#111615]) +7 similar issues
[126]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-tglb3/igt@[email protected]
* igt@kms_sysfs_edid_timing:
- shard-apl: [PASS][127] -> [FAIL][128] ([IGT#2])
[127]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10685/shard-apl3/igt@kms_sysfs_edid_timing.html
[128]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-apl2/igt@kms_sysfs_edid_timing.html
- shard-kbl: [PASS][129] -> [FAIL][130] ([IGT#2])
[129]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_10685/shard-kbl7/igt@kms_sysfs_edid_timing.html
[130]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-kbl2/igt@kms_sysfs_edid_timing.html
* igt@nouveau_crc@pipe-a-source-outp-inactive:
- shard-iclb: NOTRUN -> [SKIP][131] ([i915#2530])
[131]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-iclb1/igt@[email protected]
* igt@nouveau_crc@pipe-c-ctx-flip-skip-current-frame:
- shard-tglb: NOTRUN -> [SKIP][132] ([i915#2530]) +3 similar issues
[132]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-tglb1/igt@[email protected]
* igt@prime_nv_test@i915_blt_fill_nv_read:
- shard-tglb: NOTRUN -> [SKIP][133] ([fdo#109291])
[133]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-tglb8/igt@prime_nv_test@i915_blt_fill_nv_read.html
- shard-iclb: NOTRUN -> [SKIP][134] ([fdo#109291])
[134]: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/shard-iclb5/igt@prime
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_6291/index.html
Quoted 7 lines · Ashutosh Dixit
From: Chris Wilson <[email protected]>
Wrap all the
igt_tokencat(prefix, __LINE)into its ownigt_unique()to reduce the clutter and make it easier to generate unique tokens for other common macros.Signed-off-by Chris Wilson <[email protected]>
Ok, looks safe.
--
Zbigniew
Quoted 143 lines
--- lib/igt_core.h | 54 ++++++++++++++++++++++++++++++-------------------- 1 file changed, 32 insertions(+), 22 deletions(-)lib/igt_core.h +32
-22@@ -147,12 +147,12 @@ __noreturn void __igt_fixture_end(void);* enumeration (e.g. when enumerating on systems without an intel gpu) such * blocks should be annotated with igt_fixture. */ -#define igt_fixture for (volatile int igt_tokencat(__tmpint,__LINE__) = 0; \ - igt_tokencat(__tmpint,__LINE__) < 1 && \ +#define igt_fixture for (volatile int igt_unique(__tmpint) = 0; \ + igt_unique(__tmpint) < 1 && \ (STATIC_ANALYSIS_BUILD || \ (__igt_fixture() && \ (sigsetjmp(igt_subtest_jmpbuf, 1) == 0))); \ - igt_tokencat(__tmpint,__LINE__) ++, \ + igt_unique(__tmpint) ++, \ __igt_fixture_complete())/* subtest infrastructure */ @@ -203,6 +203,16 @@ bool __igt_run_dynamic_subtest(const char *dynamic_subtest_name);*/ #define igt_tokencat (x, y) __igt_tokencat2(x, y) +/** +* igt_unique: +* @prefix: local identifier +* +* C preprocessor helper to generate a custom 'unique' token by appending +* the line number onto the token. +*/ +#define igt_unique (prefix) \ + igt_tokencat(igt_tokencat(__igt_unique__, prefix), __LINE__) +/** * igt_subtest: * @name: name of the subtest @@ -238,7 +248,7 @@ bool __igt_run_dynamic_subtest(const char *dynamic_subtest_name);* static string. */ #define igt_subtest_f(f...) \ - __igt_subtest_f(igt_tokencat(__tmpchar, __LINE__), f) + __igt_subtest_f(igt_unique(__tmpchar), f)/** * igt_subtest_with_dynamic: @@ -315,7 +325,7 @@ bool __igt_run_dynamic_subtest(const char *dynamic_subtest_name);* format string instead of a static string. */ #define igt_subtest_with_dynamic_f(f...) \ - __igt_subtest_with_dynamic_f(igt_tokencat(__tmpchar, __LINE__), f) + __igt_subtest_with_dynamic_f(igt_unique(__tmpchar), f)/** * igt_dynamic: @@ -358,7 +368,7 @@ bool __igt_run_dynamic_subtest(const char *dynamic_subtest_name);* instead of a static string. */ #define igt_dynamic_f(f...) \ - __igt_dynamic_f(igt_tokencat(__tmpchar, __LINE__), f) + __igt_dynamic_f(igt_unique(__tmpchar), f)const char *igt_subtest_name (void );bool igt_only_list_subtests (void );@@ -380,15 +390,15 @@ void __igt_subtest_group_restore(int, int);* clauses. If any common setup in a fixture fails, only the subtests in this * group will fail or skip. Subtest groups can be arbitrarily nested. */ -#define igt_subtest_group for (int igt_tokencat(__tmpint,__LINE__) = 0, \ - igt_tokencat(__save,__LINE__) = 0, \ - igt_tokencat(__desc,__LINE__) = 0; \ - igt_tokencat(__tmpint,__LINE__) < 1 && \ - (__igt_subtest_group_save(& igt_tokencat(__save,__LINE__), \ - & igt_tokencat(__desc,__LINE__) ), true); \ - igt_tokencat(__tmpint,__LINE__) ++, \ - __igt_subtest_group_restore(igt_tokencat(__save,__LINE__), \ - igt_tokencat(__desc,__LINE__))) +#define igt_subtest_group for (int igt_unique(__tmpint) = 0, \ + igt_unique(__save) = 0, \ + igt_unique(__desc) = 0; \ + igt_unique(__tmpint) < 1 && \ + (__igt_subtest_group_save(& igt_unique(__save), \ + & igt_unique(__desc) ), true); \ + igt_unique(__tmpint) ++, \ + __igt_subtest_group_restore(igt_unique(__save), \ + igt_unique(__desc)))/** * igt_main_args: @@ -404,15 +414,15 @@ void __igt_subtest_group_restore(int, int);* #igt_subtest_init_parse_opts. */ #define igt_main_args (short_opts, long_opts, help_str, opt_handler, handler_data) \ - static void igt_tokencat(__real_main, __LINE__)(void); \ + static void igt_unique(__real_main)(void); \ int main(int argc, char **argv) { \ igt_subtest_init_parse_opts(&argc, argv, \ short_opts, long_opts, help_str, \ opt_handler, handler_data); \ - igt_tokencat(__real_main, __LINE__)(); \ + igt_unique(__real_main)(); \ igt_exit(); \ } \ - static void igt_tokencat(__real_main, __LINE__)(void) \ + static void igt_unique(__real_main)(void) \/** @@ -460,15 +470,15 @@ void igt_simple_init_parse_opts(int *argc, char **argv,* #igt_simple_init_parse_opts. */ #define igt_simple_main_args (short_opts, long_opts, help_str, opt_handler, handler_data) \ - static void igt_tokencat(__real_main, __LINE__)(void); \ + static void igt_unique(__real_main)(void); \ int main(int argc, char **argv) { \ igt_simple_init_parse_opts(&argc, argv, \ short_opts, long_opts, help_str, \ opt_handler, handler_data); \ - igt_tokencat(__real_main, __LINE__)(); \ + igt_unique(__real_main)(); \ igt_exit(); \ } \ - static void igt_tokencat(__real_main, __LINE__)(void) \ + static void igt_unique(__real_main)(void) \/** @@ -490,7 +500,7 @@ void igt_simple_init_parse_opts(int *argc, char **argv,*/ #define igt_constructor \ __attribute__((constructor)) \ - static void igt_tokencat(__igt_constructor_l, __LINE__)(void) + static void igt_unique(__igt_constructor_l)(void)__noreturn __attribute__((format (printf,1 ,2 )))void igt_skip (const char *f, ...);Signature · 1 line
2.33.0