lib/i915/intel_drrs: Fix igt helper to get drrs status
PATCH 1/4 lib/i915/intel_drrs: Fix igt helper to get drrs status
intel_is_drrs_supported() helper is giving False if DRRS supports on selected pipe which is not correct. Fix the helper to give True if DRRS supports on selected pipe.
--- lib/i915/intel_drrs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/i915/intel_drrs.c +1 -1
@@ -32,7 +32,7 @@ bool intel_is_drrs_supported(int device, enum pipe pipe)if (*buf =='\0' )return false; -return !strcasestr (buf,"DRRS enabled:" ); +return strcasestr (buf,"DRRS enabled:" ); }/**
Signature · 1 line
2.40.0
PATCH 2/4 tests/intel/kms_frontbuffer_tracking: Drop unused macros
Cleanup only, no functional change: Drop all unused macros from the code.
--- tests/intel/kms_frontbuffer_tracking.c | 2 -- 1 file changed, 2 deletions(-)
tests/intel/kms_frontbuffer_tracking.c +0 -2
@@ -1877,8 +1877,6 @@ static void __debugfs_read_crtc(const char *param, char *buf, int len) }#define debugfs_read_crtc (p, arr) __debugfs_read_crtc(p, arr, sizeof(arr)) -#define debugfs_write_crtc (p, arr) __debugfs_write_crtc(p, arr, sizeof(arr)) -#define debugfs_read_connector (p, arr) __debugfs_read_connector(p, arr, sizeof(arr))static bool is_drrs_high (void ) {
Signature · 1 line
2.40.0
Re: [i-g-t,2/4] tests/intel/kms_frontbuffer_tracking: Drop unused macros
Quoted 4 lines · Bhanuprakash Modem
Cleanup only, no functional change: Drop all unused macros from the code.
Signed-off-by Bhanuprakash Modem<[email protected]>
PATCH 3/4 tests/intel/kms_frontbuffer_tracking: Re-use devid & display_ver
In reply to Bhanuprakash ModemInstead of querying for devid & display_ver, just cache them and re-use where ever it's required.
--- tests/intel/kms_frontbuffer_tracking.c | 37 +++++++++++--------------- 1 file changed, 15 insertions(+), 22 deletions(-)
tests/intel/kms_frontbuffer_tracking.c +15 -22
@@ -1302,6 +1302,8 @@ struct {igt_display_t display;struct buf_ops *bops; +uint32_t devid; +unsigned display_ver; } drm;struct {
@@ -2873,8 +2875,6 @@ static bool enable_features_for_test(const struct test_mode *t)static void check_test_requirements (const struct test_mode *t) { -int ver; -if (t->pipes ==PIPE_DUAL )igt_require_f (scnd_mode_params.output,"Can't test dual pipes with the current outputs\n" );
@@ -2904,8 +2904,7 @@ static void check_test_requirements(const struct test_mode *t)igt_require (t->pipes == opt.only_pipes);/* Kernel disables fbc for display versions 12 and 13 if psr is enabled. */ - ver =intel_display_ver (intel_get_drm_devid (drm.fd)); -if (ver >=12 && ver <=13 ) +if (drm.display_ver >=12 && drm.display_ver <=13 )igt_require_f (!((t->feature &FEATURE_PSR ) && (t->feature &FEATURE_FBC )),"Can't test PSR and FBC together\n" );
@@ -3081,11 +3080,9 @@ static bool is_valid_plane(igt_plane_t *plane)static void plane_fbc_rte_subtest (const struct test_mode *t) { -int ver;igt_plane_t *plane; - ver =intel_display_ver (intel_get_drm_devid (drm.fd)); -igt_require_f ((ver >=20 ),"Can't test fbc for each plane\n" ); +igt_require_f ((drm.display_ver >=20 ),"Can't test fbc for each plane\n" );prepare_subtest_data (t,NULL );unset_all_crtcs ();
@@ -3294,8 +3291,6 @@ static void multidraw_subtest(const struct test_mode *t)static bool format_is_valid (int feature_flags,enum pixel_format format) { -int devid =intel_get_drm_devid (drm.fd); -if (!(feature_flags &FEATURE_FBC ))return true;
@@ -3303,7 +3298,7 @@ static bool format_is_valid(int feature_flags,case FORMAT_RGB888 :return true;case FORMAT_RGB565 : -if (IS_GEN2 (devid) ||IS_G4X (devid)) +if (IS_GEN2 (drm.devid) ||IS_G4X (drm.devid))return false;return true;case FORMAT_RGB101010 :
@@ -3374,19 +3369,17 @@ static void format_draw_subtest(const struct test_mode *t)static bool tiling_is_valid (int feature_flags,enum tiling_type tiling) { -int devid =intel_get_drm_devid (drm.fd); -if (!(feature_flags &FEATURE_FBC ))return true;switch (tiling) {case TILING_LINEAR : -return AT_LEAST_GEN (devid,9 ); +return AT_LEAST_GEN (drm.devid,9 );case TILING_X :case TILING_Y :return true;case TILING_4 : -return AT_LEAST_GEN (devid,12 ); +return AT_LEAST_GEN (drm.devid,12 );default :igt_assert (false);return false;
@@ -3805,7 +3798,7 @@ static void scaledprimary_subtest(const struct test_mode *t)struct igt_fb new_fb, *old_fb;struct modeset_params *params =pick_params (t);struct fb_region *reg = ¶ms->primary; -int gen =intel_display_ver (intel_get_drm_devid (drm.fd)); +int gen = drm.display_ver;int src_y_upscale =ALIGN (reg->h /4 ,4 ); igt_require_f(gen >= 9,
@@ -3990,7 +3983,7 @@ static void farfromfence_subtest(const struct test_mode *t)struct draw_pattern_info *pattern = &pattern1;struct fb_region *target;int max_height, assertions =0 ; -int gen =intel_display_ver (intel_get_drm_devid (drm.fd)); +int gen = drm.display_ver;switch (gen) {case 2 :
@@ -4461,13 +4454,13 @@ struct option long_options[] = { igt_main_args("", long_options, help_str, opt_handler, NULL) {struct test_mode t; -int devid;enum pipe pipe;igt_output_t *output; igt_fixture {setup_environment (); - devid =intel_get_drm_devid (drm.fd); + drm.devid =intel_get_drm_devid (drm.fd); + drm.display_ver =intel_display_ver (drm.devid); }for (t.feature =0 ; t.feature <FEATURE_COUNT ; t.feature++) {
@@ -4765,14 +4758,14 @@ igt_main_args("", long_options, help_str, opt_handler, NULL)/* Tiling Y is only supported on GEN9+ */ if (t.tiling ==TILING_Y ) { -igt_require (AT_LEAST_GEN (devid,9 )); -igt_require (!intel_get_device_info (devid)->has_4tile); +igt_require (AT_LEAST_GEN (drm.devid,9 )); +igt_require (!intel_get_device_info (drm.devid)->has_4tile); }/* Tiling 4 is only supported on GEN12+ */ if (t.tiling ==TILING_4 ) { -igt_require (AT_LEAST_GEN (devid,12 )); -igt_require (intel_get_device_info (devid)->has_4tile); +igt_require (AT_LEAST_GEN (drm.devid,12 )); +igt_require (intel_get_device_info (drm.devid)->has_4tile); }if (tiling_is_valid (t.feature, t.tiling))
Signature · 1 line
2.40.0
Re: [i-g-t, 3/4] tests/intel/kms_frontbuffer_tracking: Re-use devid & display_ver
Quoted 4 lines · Bhanuprakash Modem
Instead of querying for devid &
display_ver, just cache them and re-use where ever it's required.Signed-off-by Bhanuprakash Modem <[email protected]>
PATCH 4/4 tests/intel/kms_dirtyfb: Fix few fixtures
In reply to Bhanuprakash ModemAs this test is expected that the driver must be atomic and atleast one display panel connected, fix the igt_fixtures accordingly.
--- tests/intel/kms_dirtyfb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tests/intel/kms_dirtyfb.c +2 -2
@@ -304,11 +304,11 @@ igt_mainkmstest_set_vt_graphics_mode ();igt_display_require (&data.display, data.drm_fd); +igt_display_require_output (&data.display); +igt_require (data.display.is_atomic); data.bops =buf_ops_create (data.drm_fd); data.rendercopy =igt_get_render_copyfunc (intel_get_drm_devid (data.drm_fd)); - -igt_display_reset (&data.display); } for (data.feature = FEATURE_DEFAULT; data.feature > 0;
Signature · 1 line
2.40.0
Re: [i-g-t,4/4] tests/intel/kms_dirtyfb: Fix few fixtures
Quoted 5 lines · Bhanuprakash Modem
As this test is expected that the driver must be atomic and atleast one display panel connected, fix the
igt_fixturesaccordingly.Signed-off-by Bhanuprakash Modem <[email protected]>
PATCH 1/7 lib/i915/intel_drrs: Fix igt helper to get drrs status
In reply to Bhanuprakash Modemintel_is_drrs_supported() helper is giving False if DRRS supports on selected pipe which is not correct. Fix the helper to give True if DRRS supports on selected pipe.
--- lib/i915/intel_drrs.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
lib/i915/intel_drrs.c +1 -3
@@ -29,10 +29,8 @@ bool intel_is_drrs_supported(int device, enum pipe pipe)igt_require_fd (dir);igt_debugfs_simple_read (dir,"i915_drrs_status" , buf,sizeof (buf));close (dir); -if (*buf =='\0' ) -return false; -return !strcasestr (buf,"DRRS enabled:" ); +return strstr (buf,"DRRS enabled: yes" ); }/**
Signature · 1 line
2.40.0
PATCH 1/4 lib/i915/intel_drrs: Fix igt helper to get drrs status
intel_is_drrs_supported() helper is giving False if DRRS supports on selected pipe which is not correct. Fix the helper to give True if DRRS supports on selected pipe.
--- lib/i915/intel_drrs.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
lib/i915/intel_drrs.c +1 -3
@@ -29,10 +29,8 @@ bool intel_is_drrs_supported(int device, enum pipe pipe)igt_require_fd (dir);igt_debugfs_simple_read (dir,"i915_drrs_status" , buf,sizeof (buf));close (dir); -if (*buf =='\0' ) -return false; -return !strcasestr (buf,"DRRS enabled:" ); +return strstr (buf,"DRRS enabled: yes" ); }/**
--
2.40.0
Quoted 7 lines · Bhanuprakash Modem
intel_is_drrs_supported()helper is giving False if DRRS supports on selected pipe which is not correct. Fix the helper to give True if DRRS supports on selected pipe.Fixes c6f857e46 lib/i915/drrs: Add drrs helpersCc Jouni Högander <[email protected]>Signed-off-by Bhanuprakash Modem <[email protected]>